summaryrefslogtreecommitdiff
path: root/spec/ruby/core/matchdata/values_at_spec.rb
blob: 8f7fdf557cb58183ca9d472069dc1a1e49cd9ac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require_relative '../../spec_helper'

describe "MatchData#values_at" do
  it "returns an array of the matching value" do
    /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").values_at(0, 2, -2).should == ["HX1138", "X", "113"]
  end

  describe "when passed a Range" do
    it "returns an array of the matching value" do
      /(.)(.)(\d+)(\d)/.match("THX1138: The Movie").values_at(2..4, 0..1).should == ["X", "113", "8", "HX1138", "H"]
    end
  end

  it 'slices captures with the given names' do
    /(?<a>.)(?<b>.)(?<c>.)/.match('012').values_at(:c, :a).should == ['2', '0']
  end

  it 'takes names and indices' do
    /\A(?<a>.)(?<b>.)\z/.match('01').values_at(0, 1, 2, :a, :b).should == ['01', '0', '1', '0', '1']
  end
end
'upd'>.gdbinit521
-rw-r--r--.gitattributes6
-rw-r--r--.gitignore73
-rw-r--r--.travis.yml91
-rw-r--r--COPYING14
-rw-r--r--ChangeLog8211
-rw-r--r--KNOWNBUGS.rb6
-rw-r--r--LEGAL370
-rw-r--r--Makefile.in267
-rw-r--r--NEWS692
-rw-r--r--README.EXT1680
-rw-r--r--README.EXT.ja1667
-rw-r--r--README.ja.md48
-rw-r--r--README.md102
-rw-r--r--acinclude.m446
-rw-r--r--aclocal.m415
-rw-r--r--addr2line.c82
-rw-r--r--appveyor.yml55
-rw-r--r--array.c1107
-rwxr-xr-xbasictest/runner.rb33
-rwxr-xr-xbasictest/test.rb2367
-rw-r--r--benchmark/bm_app_aobench.rb2
-rw-r--r--benchmark/bm_array_sample_100k_10.rb2
-rw-r--r--benchmark/bm_array_sample_100k_11.rb2
-rw-r--r--benchmark/bm_array_sample_100k__100.rb2
-rw-r--r--benchmark/bm_array_sample_100k__1k.rb2
-rw-r--r--benchmark/bm_array_sample_100k__6k.rb2
-rw-r--r--benchmark/bm_array_sample_100k___10k.rb2
-rw-r--r--benchmark/bm_array_sample_100k___50k.rb2
-rw-r--r--benchmark/bm_array_shift.rb14
-rw-r--r--benchmark/bm_array_small_and.rb17
-rw-r--r--benchmark/bm_array_small_diff.rb17
-rw-r--r--benchmark/bm_array_small_or.rb17
-rw-r--r--benchmark/bm_array_sort_block.rb2
-rw-r--r--benchmark/bm_array_sort_float.rb2
-rw-r--r--benchmark/bm_bighash.rb1
-rw-r--r--benchmark/bm_dir_empty_p.rb5
-rw-r--r--benchmark/bm_erb_render.rb26
-rw-r--r--benchmark/bm_file_chmod.rb9
-rw-r--r--benchmark/bm_file_rename.rb11
-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_sym.rb7
-rw-r--r--benchmark/bm_hash_aref_sym_long.rb7
-rw-r--r--benchmark/bm_hash_ident_flo.rb4
-rw-r--r--benchmark/bm_hash_long.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_small2.rb1
-rw-r--r--benchmark/bm_hash_small4.rb1
-rw-r--r--benchmark/bm_hash_small8.rb1
-rw-r--r--benchmark/bm_hash_to_proc.rb9
-rw-r--r--benchmark/bm_int_quo.rb1
-rw-r--r--benchmark/bm_io_copy_stream_write.rb24
-rw-r--r--benchmark/bm_io_copy_stream_write_socket.rb35
-rw-r--r--benchmark/bm_io_nonblock_noex.rb22
-rw-r--r--benchmark/bm_io_nonblock_noex2.rb21
-rw-r--r--benchmark/bm_io_pipe_rw.rb13
-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_so_fasta.rb2
-rw-r--r--[-rwxr-xr-x]benchmark/bm_so_meteor_contest.rb7
-rw-r--r--benchmark/bm_so_pidigits.rb2
-rw-r--r--benchmark/bm_string_index.rb3
-rw-r--r--benchmark/bm_string_scan_re.rb2
-rw-r--r--benchmark/bm_string_scan_str.rb2
-rw-r--r--benchmark/bm_time_subsec.rb2
-rwxr-xr-xbenchmark/bm_vm1_blockparam.rb9
-rwxr-xr-xbenchmark/bm_vm1_blockparam_call.rb9
-rwxr-xr-xbenchmark/bm_vm1_blockparam_pass.rb13
-rwxr-xr-xbenchmark/bm_vm1_blockparam_yield.rb9
-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_fiber_switch.rb9
-rw-r--r--benchmark/bm_vm2_module_ann_const_set.rb5
-rw-r--r--benchmark/bm_vm2_module_const_set.rb8
-rw-r--r--benchmark/bm_vm2_mutex.rb2
-rw-r--r--benchmark/bm_vm2_poly_singleton.rb14
-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
-rwxr-xr-x[-rw-r--r--]benchmark/bm_vm3_gc.rb1
-rw-r--r--benchmark/bm_vm3_gc_old_full.rb4
-rw-r--r--benchmark/bm_vm3_gc_old_immediate.rb4
-rw-r--r--benchmark/bm_vm3_gc_old_lazy.rb4
-rw-r--r--benchmark/bm_vm_symbol_block_pass.rb13
-rw-r--r--benchmark/bm_vm_thread_condvar1.rb28
-rw-r--r--benchmark/bm_vm_thread_condvar2.rb35
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb2
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb2
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb2
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb2
-rw-r--r--benchmark/bm_vm_thread_pipe.rb2
-rw-r--r--benchmark/bm_vm_thread_queue.rb2
-rw-r--r--benchmark/bm_vm_thread_sized_queue.rb20
-rw-r--r--benchmark/bm_vm_thread_sized_queue2.rb23
-rw-r--r--benchmark/bm_vm_thread_sized_queue3.rb22
-rw-r--r--benchmark/bm_vm_thread_sized_queue4.rb26
-rw-r--r--[-rwxr-xr-x]benchmark/driver.rb158
-rw-r--r--benchmark/memory_wrapper.rb16
-rw-r--r--benchmark/prepare_require.rb25
-rw-r--r--benchmark/prepare_require_thread.rb2
-rw-r--r--bignum.c1323
-rwxr-xr-xbin/erb36
-rwxr-xr-xbin/rake33
-rwxr-xr-xbootstraptest/runner.rb42
-rw-r--r--bootstraptest/test_block.rb14
-rw-r--r--bootstraptest/test_env.rb12
-rw-r--r--bootstraptest/test_eval.rb2
-rw-r--r--bootstraptest/test_flow.rb10
-rw-r--r--bootstraptest/test_fork.rb2
-rw-r--r--bootstraptest/test_insns.rb389
-rw-r--r--bootstraptest/test_io.rb6
-rw-r--r--bootstraptest/test_literal.rb40
-rw-r--r--bootstraptest/test_method.rb32
-rw-r--r--bootstraptest/test_objectspace.rb2
-rw-r--r--bootstraptest/test_string.rb3
-rw-r--r--bootstraptest/test_syntax.rb2
-rw-r--r--bootstraptest/test_thread.rb36
-rw-r--r--ccan/list/list.h194
-rw-r--r--class.c790
-rw-r--r--common.mk2587
-rw-r--r--compar.c110
-rw-r--r--compile.c7792
-rw-r--r--complex.c578
-rw-r--r--configure.ac4591
-rw-r--r--configure.in4217
-rw-r--r--constant.h18
-rw-r--r--cont.c1197
-rw-r--r--cygwin/GNUmakefile.in37
-rw-r--r--debug.c167
-rw-r--r--debug_counter.c41
-rw-r--r--debug_counter.h109
-rw-r--r--defs/default_gems4
-rw-r--r--defs/gmake.mk119
-rw-r--r--defs/id.def69
-rw-r--r--defs/keywords8
-rw-r--r--defs/known_errors.def3
-rw-r--r--defs/lex.c.src8
-rw-r--r--defs/opt_insn_unif.def2
-rw-r--r--defs/separated_version.mk38
-rw-r--r--dir.c1420
-rw-r--r--dln.c111
-rw-r--r--dln_find.c17
-rw-r--r--dmydln.c1
-rw-r--r--dmyenc.c10
-rw-r--r--dmyext.c5
-rw-r--r--doc/.document1
-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.08
-rw-r--r--doc/ChangeLog-1.9.344
-rw-r--r--doc/ChangeLog-2.1.02
-rw-r--r--doc/ChangeLog-2.2.012157
-rw-r--r--doc/ChangeLog-2.3.012187
-rw-r--r--doc/ChangeLog-2.4.09492
-rw-r--r--doc/ChangeLog-20166
-rw-r--r--doc/ChangeLog-YARV22
-rw-r--r--doc/NEWS-1.8.78
-rw-r--r--doc/NEWS-1.9.22
-rw-r--r--doc/NEWS-2.0.02
-rw-r--r--doc/NEWS-2.2.0361
-rw-r--r--doc/NEWS-2.3.0404
-rw-r--r--doc/NEWS-2.4.0397
-rw-r--r--doc/contributing.rdoc78
-rw-r--r--doc/contributors.rdoc17
-rw-r--r--doc/dtrace_probes.rdoc10
-rw-r--r--doc/etc.rd.ja4
-rw-r--r--doc/extension.ja.rdoc1833
-rw-r--r--doc/extension.rdoc1959
-rw-r--r--doc/forwardable.rd.ja6
-rw-r--r--doc/globals.rdoc2
-rw-r--r--doc/irb/irb-tools.rd.ja10
-rw-r--r--doc/irb/irb.rd.ja5
-rw-r--r--doc/maintainers.rdoc249
-rw-r--r--doc/marshal.rdoc4
-rw-r--r--doc/pty/README.ja2
-rw-r--r--doc/regexp.rdoc32
-rw-r--r--doc/security.rdoc42
-rw-r--r--doc/shell.rd.ja8
-rw-r--r--doc/standard_library.rdoc80
-rw-r--r--doc/syntax/assignment.rdoc9
-rw-r--r--doc/syntax/calling_methods.rdoc27
-rw-r--r--doc/syntax/control_expressions.rdoc31
-rw-r--r--doc/syntax/exceptions.rdoc7
-rw-r--r--doc/syntax/literals.rdoc78
-rw-r--r--doc/syntax/methods.rdoc66
-rw-r--r--doc/syntax/miscellaneous.rdoc11
-rw-r--r--doc/syntax/modules_and_classes.rdoc5
-rw-r--r--doc/syntax/refinements.rdoc112
-rw-r--r--enc/Makefile.in14
-rw-r--r--enc/ascii.c10
-rw-r--r--enc/big5.c3
-rw-r--r--enc/cp949.c1
-rw-r--r--enc/depend625
-rw-r--r--enc/ebcdic.h11
-rw-r--r--enc/emacs_mule.c3
-rw-r--r--enc/encdb.c9
-rw-r--r--enc/encinit.c.erb17
-rw-r--r--enc/euc_jp.c9
-rw-r--r--enc/euc_kr.c26
-rw-r--r--enc/euc_tw.c1
-rw-r--r--enc/gb18030.c2
-rw-r--r--enc/gbk.c1
-rw-r--r--enc/iso_2022_jp.h2
-rw-r--r--enc/iso_8859.h1
-rw-r--r--enc/iso_8859_1.c65
-rw-r--r--enc/iso_8859_10.c58
-rw-r--r--enc/iso_8859_11.c1
-rw-r--r--enc/iso_8859_13.c74
-rw-r--r--enc/iso_8859_14.c67
-rw-r--r--enc/iso_8859_15.c64
-rw-r--r--enc/iso_8859_16.c66
-rw-r--r--enc/iso_8859_2.c63
-rw-r--r--enc/iso_8859_3.c67
-rw-r--r--enc/iso_8859_4.c57
-rw-r--r--enc/iso_8859_5.c33
-rw-r--r--enc/iso_8859_6.c1
-rw-r--r--enc/iso_8859_7.c65
-rw-r--r--enc/iso_8859_8.c1
-rw-r--r--enc/iso_8859_9.c79
-rw-r--r--enc/jis/props.h227
-rw-r--r--enc/jis/props.h.blt56
-rw-r--r--enc/jis/props.kwd6
-rw-r--r--enc/jis/props.src6
-rw-r--r--enc/koi8_r.c2
-rw-r--r--enc/koi8_u.c1
-rwxr-xr-xenc/make_encmake.rb25
-rw-r--r--enc/mktable.c42
-rw-r--r--enc/prelude.rb6
-rw-r--r--enc/shift_jis.c526
-rw-r--r--enc/shift_jis.h546
-rw-r--r--enc/trans/GB/GB12345%UCS.src61
-rw-r--r--enc/trans/GB/GB2312%UCS.src75
-rw-r--r--enc/trans/GB/UCS%GB12345.src61
-rw-r--r--enc/trans/GB/UCS%GB2312.src75
-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/single_byte.trans9
-rw-r--r--enc/trans/windows-1255-tbl.rb3
-rw-r--r--enc/unicode.c314
-rw-r--r--enc/unicode/10.0.0/casefold.h7044
-rw-r--r--enc/unicode/10.0.0/name2ctype.h38381
-rwxr-xr-xenc/unicode/case-folding.rb257
-rw-r--r--enc/unicode/casefold.h5619
-rw-r--r--enc/unicode/name2ctype.h32679
-rw-r--r--enc/unicode/name2ctype.h.blt28722
-rw-r--r--enc/unicode/name2ctype.kwd26550
-rw-r--r--enc/unicode/name2ctype.src26550
-rw-r--r--enc/us_ascii.c10
-rw-r--r--enc/utf_16_32.h2
-rw-r--r--enc/utf_16be.c4
-rw-r--r--enc/utf_16le.c4
-rw-r--r--enc/utf_32be.c23
-rw-r--r--enc/utf_32le.c22
-rw-r--r--enc/utf_7.h2
-rw-r--r--enc/utf_8.c38
-rw-r--r--enc/windows_1250.c271
-rw-r--r--enc/windows_1251.c47
-rw-r--r--enc/windows_1252.c260
-rw-r--r--enc/windows_1253.c297
-rw-r--r--enc/windows_1254.c302
-rw-r--r--enc/windows_1257.c304
-rw-r--r--enc/windows_31j.c7
-rw-r--r--enc/x_emoji.h4
-rw-r--r--encindex.h69
-rw-r--r--encoding.c255
-rw-r--r--enum.c1574
-rw-r--r--enumerator.c588
-rw-r--r--error.c1182
-rw-r--r--eval.c1002
-rw-r--r--eval_error.c389
-rw-r--r--eval_intern.h229
-rw-r--r--eval_jump.c31
-rw-r--r--ext/-test-/array/resize/depend12
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/auto_ext.rb10
-rw-r--r--ext/-test-/bignum/big2str.c1
-rw-r--r--ext/-test-/bignum/bigzero.c1
-rw-r--r--ext/-test-/bignum/depend120
-rw-r--r--ext/-test-/bignum/div.c1
-rw-r--r--ext/-test-/bignum/extconf.rb10
-rw-r--r--ext/-test-/bignum/intpack.c1
-rw-r--r--ext/-test-/bignum/mul.c5
-rw-r--r--ext/-test-/bignum/str2big.c1
-rw-r--r--ext/-test-/bug-3571/bug.c2
-rw-r--r--ext/-test-/bug-3571/extconf.rb3
-rw-r--r--ext/-test-/bug-3662/bug.c16
-rw-r--r--ext/-test-/bug-3662/extconf.rb1
-rw-r--r--ext/-test-/bug-5832/bug.c2
-rw-r--r--ext/-test-/bug-5832/extconf.rb3
-rw-r--r--ext/-test-/bug_reporter/extconf.rb3
-rw-r--r--ext/-test-/class/depend23
-rw-r--r--ext/-test-/class/extconf.rb10
-rw-r--r--ext/-test-/debug/depend38
-rw-r--r--ext/-test-/debug/extconf.rb9
-rw-r--r--ext/-test-/dln/empty/depend3
-rw-r--r--ext/-test-/dln/empty/extconf.rb2
-rw-r--r--ext/-test-/exception/depend51
-rw-r--r--ext/-test-/exception/ensured.c14
-rw-r--r--ext/-test-/exception/extconf.rb9
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/file/depend43
-rw-r--r--ext/-test-/file/extconf.rb25
-rw-r--r--ext/-test-/file/fs.c122
-rw-r--r--ext/-test-/float/extconf.rb10
-rw-r--r--ext/-test-/funcall/extconf.rb3
-rw-r--r--ext/-test-/funcall/funcall.c44
-rw-r--r--ext/-test-/funcall/passing_block.c30
-rw-r--r--ext/-test-/gvl/call_without_gvl/call_without_gvl.c34
-rw-r--r--ext/-test-/gvl/call_without_gvl/depend13
-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.rb3
-rw-r--r--ext/-test-/hash/init.c11
-rw-r--r--ext/-test-/integer/core_ext.c36
-rw-r--r--ext/-test-/integer/depend40
-rw-r--r--ext/-test-/integer/extconf.rb3
-rw-r--r--ext/-test-/integer/init.c11
-rw-r--r--ext/-test-/integer/my_integer.c16
-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.rb10
-rw-r--r--ext/-test-/load/dot.dot/depend3
-rw-r--r--ext/-test-/load/dot.dot/extconf.rb3
-rw-r--r--ext/-test-/load/protect/extconf.rb1
-rw-r--r--ext/-test-/load/protect/protect.c19
-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-/memory_status/extconf.rb12
-rw-r--r--ext/-test-/memory_status/memory_status.c65
-rw-r--r--ext/-test-/method/extconf.rb9
-rw-r--r--ext/-test-/notimplement/bug.c16
-rw-r--r--ext/-test-/notimplement/extconf.rb2
-rw-r--r--ext/-test-/num2int/extconf.rb3
-rw-r--r--ext/-test-/path_to_class/extconf.rb3
-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.c23
-rw-r--r--ext/-test-/proc/extconf.rb3
-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/depend19
-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-/regexp/extconf.rb3
-rw-r--r--ext/-test-/regexp/init.c11
-rw-r--r--ext/-test-/regexp/parse_depth_limit.c23
-rwxr-xr-xext/-test-/scan_args/extconf.rb1
-rw-r--r--ext/-test-/scan_args/scan_args.c286
-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/capacity.c17
-rw-r--r--ext/-test-/string/coderange.c2
-rw-r--r--ext/-test-/string/cstr.c130
-rw-r--r--ext/-test-/string/depend201
-rw-r--r--ext/-test-/string/ellipsize.c2
-rw-r--r--ext/-test-/string/enc_associate.c10
-rw-r--r--ext/-test-/string/enc_str_buf_cat.c2
-rw-r--r--ext/-test-/string/extconf.rb10
-rw-r--r--ext/-test-/string/fstring.c15
-rw-r--r--ext/-test-/string/init.c2
-rw-r--r--ext/-test-/string/modify.c2
-rw-r--r--ext/-test-/string/new.c21
-rw-r--r--ext/-test-/string/nofree.c13
-rw-r--r--ext/-test-/string/normalize.c3
-rw-r--r--ext/-test-/string/qsort.c2
-rw-r--r--ext/-test-/string/rb_str_dup.c35
-rw-r--r--ext/-test-/string/set_len.c2
-rw-r--r--ext/-test-/struct/depend46
-rw-r--r--ext/-test-/struct/duplicate.c24
-rw-r--r--ext/-test-/struct/extconf.rb10
-rw-r--r--ext/-test-/struct/len.c13
-rw-r--r--ext/-test-/symbol/extconf.rb9
-rw-r--r--ext/-test-/symbol/init.c13
-rw-r--r--ext/-test-/thread_fd_close/depend16
-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.rb3
-rw-r--r--ext/-test-/time/init.c11
-rw-r--r--ext/-test-/time/new.c34
-rw-r--r--ext/-test-/tracepoint/depend25
-rw-r--r--ext/-test-/tracepoint/extconf.rb1
-rw-r--r--ext/-test-/typeddata/extconf.rb3
-rw-r--r--ext/-test-/typeddata/typeddata.c24
-rw-r--r--ext/-test-/vm/at_exit.c44
-rw-r--r--ext/-test-/vm/depend13
-rw-r--r--ext/-test-/vm/extconf.rb1
-rw-r--r--ext/-test-/wait_for_single_fd/depend20
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb3
-rw-r--r--ext/-test-/win32/console/attribute.c26
-rw-r--r--ext/-test-/win32/console/extconf.rb9
-rw-r--r--ext/-test-/win32/dln/depend9
-rw-r--r--ext/-test-/win32/dln/empty/empty.c (renamed from ext/-test-/dln/empty/empty.c)0
-rw-r--r--ext/-test-/win32/dln/empty/extconf.rb3
-rw-r--r--ext/-test-/win32/dln/extconf.rb42
-rw-r--r--ext/-test-/win32/fd_setsize/extconf.rb1
-rw-r--r--ext/.document26
-rw-r--r--ext/Setup20
-rw-r--r--ext/Setup.atheos3
-rw-r--r--ext/Setup.emx32
-rw-r--r--ext/Setup.nacl48
-rw-r--r--ext/Setup.nt3
-rw-r--r--ext/bigdecimal/README60
-rw-r--r--ext/bigdecimal/bigdecimal.c922
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec44
-rw-r--r--ext/bigdecimal/bigdecimal.h93
-rw-r--r--ext/bigdecimal/depend14
-rw-r--r--ext/bigdecimal/extconf.rb31
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/ludcmp.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/math.rb19
-rw-r--r--ext/bigdecimal/lib/bigdecimal/newton.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb109
-rw-r--r--ext/bigdecimal/sample/linear.rb1
-rw-r--r--ext/bigdecimal/sample/nlsolve.rb1
-rw-r--r--ext/bigdecimal/sample/pi.rb1
-rw-r--r--ext/cgi/escape/depend16
-rw-r--r--ext/cgi/escape/escape.c422
-rw-r--r--ext/cgi/escape/extconf.rb3
-rw-r--r--ext/continuation/continuation.c5
-rw-r--r--ext/continuation/depend12
-rw-r--r--ext/continuation/extconf.rb1
-rw-r--r--ext/coverage/coverage.c235
-rw-r--r--ext/coverage/depend33
-rw-r--r--ext/coverage/extconf.rb1
-rw-r--r--ext/date/date.gemspec24
-rw-r--r--ext/date/date_core.c1083
-rw-r--r--ext/date/date_parse.c294
-rw-r--r--ext/date/date_strftime.c9
-rw-r--r--ext/date/date_strptime.c4
-rw-r--r--ext/date/date_tmx.h2
-rw-r--r--ext/date/depend68
-rw-r--r--ext/date/extconf.rb7
-rw-r--r--ext/date/lib/date.rb31
-rw-r--r--ext/date/prereq.mk8
-rw-r--r--ext/date/zonetab.h895
-rw-r--r--ext/date/zonetab.list181
-rw-r--r--ext/dbm/dbm.c104
-rw-r--r--ext/dbm/dbm.gemspec21
-rw-r--r--ext/dbm/depend13
-rw-r--r--ext/dbm/extconf.rb18
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c6
-rw-r--r--ext/digest/bubblebabble/depend15
-rw-r--r--ext/digest/bubblebabble/extconf.rb2
-rw-r--r--ext/digest/depend15
-rw-r--r--ext/digest/digest.c95
-rw-r--r--ext/digest/digest.h19
-rw-r--r--ext/digest/digest_conf.rb84
-rw-r--r--ext/digest/extconf.rb1
-rw-r--r--ext/digest/lib/digest.rb25
-rw-r--r--ext/digest/md5/depend19
-rw-r--r--ext/digest/md5/extconf.rb15
-rw-r--r--ext/digest/md5/md5.c4
-rw-r--r--ext/digest/md5/md5.h2
-rw-r--r--ext/digest/md5/md5cc.h12
-rw-r--r--ext/digest/md5/md5init.c35
-rw-r--r--ext/digest/md5/md5ossl.c9
-rw-r--r--ext/digest/md5/md5ossl.h4
-rw-r--r--ext/digest/rmd160/depend21
-rw-r--r--ext/digest/rmd160/extconf.rb14
-rw-r--r--ext/digest/rmd160/rmd160.h2
-rw-r--r--ext/digest/rmd160/rmd160init.c33
-rw-r--r--ext/digest/rmd160/rmd160ossl.c8
-rw-r--r--ext/digest/rmd160/rmd160ossl.h3
-rw-r--r--ext/digest/sha1/depend19
-rw-r--r--ext/digest/sha1/extconf.rb14
-rw-r--r--ext/digest/sha1/sha1.h2
-rw-r--r--ext/digest/sha1/sha1cc.h14
-rw-r--r--ext/digest/sha1/sha1init.c37
-rw-r--r--ext/digest/sha1/sha1ossl.c10
-rw-r--r--ext/digest/sha1/sha1ossl.h4
-rw-r--r--ext/digest/sha2/depend21
-rw-r--r--ext/digest/sha2/extconf.rb20
-rw-r--r--ext/digest/sha2/lib/sha2.rb45
-rw-r--r--ext/digest/sha2/sha2.c4
-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.c669
-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.rb48
-rw-r--r--ext/dl/handle.c431
-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/depend23
-rw-r--r--ext/etc/etc.c184
-rw-r--r--ext/etc/etc.gemspec42
-rw-r--r--ext/etc/extconf.rb7
-rw-r--r--ext/etc/mkconstants.rb1
-rwxr-xr-xext/extmk.rb367
-rw-r--r--ext/fcntl/depend13
-rw-r--r--ext/fcntl/extconf.rb1
-rw-r--r--ext/fcntl/fcntl.c4
-rw-r--r--ext/fcntl/fcntl.gemspec26
-rw-r--r--ext/fiber/depend1
-rw-r--r--ext/fiber/extconf.rb1
-rw-r--r--ext/fiddle/closure.c99
-rw-r--r--ext/fiddle/closure.h2
-rw-r--r--ext/fiddle/conversions.h4
-rw-r--r--ext/fiddle/depend160
-rw-r--r--ext/fiddle/extconf.rb151
-rw-r--r--ext/fiddle/extlibs5
-rw-r--r--ext/fiddle/fiddle.gemspec23
-rw-r--r--ext/fiddle/fiddle.h5
-rw-r--r--ext/fiddle/function.c108
-rw-r--r--ext/fiddle/function.h2
-rw-r--r--ext/fiddle/handle.c25
-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.rb161
-rw-r--r--ext/fiddle/lib/fiddle/function.rb1
-rw-r--r--ext/fiddle/lib/fiddle/import.rb16
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb3
-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.c2
-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/depend13
-rw-r--r--ext/gdbm/extconf.rb12
-rw-r--r--ext/gdbm/gdbm.c71
-rw-r--r--ext/gdbm/gdbm.gemspec27
-rwxr-xr-xext/io/console/buildgem.sh5
-rw-r--r--ext/io/console/console.c386
-rw-r--r--ext/io/console/depend41
-rw-r--r--ext/io/console/extconf.rb25
-rw-r--r--ext/io/console/io-console.gemspec15
-rw-r--r--ext/io/console/lib/console/size.rb3
-rw-r--r--ext/io/console/win32_vk.chksum1
-rw-r--r--ext/io/console/win32_vk.inc1391
-rw-r--r--ext/io/console/win32_vk.list166
-rw-r--r--ext/io/nonblock/depend21
-rw-r--r--ext/io/nonblock/extconf.rb1
-rw-r--r--ext/io/nonblock/nonblock.c17
-rw-r--r--ext/io/wait/depend21
-rw-r--r--ext/io/wait/extconf.rb1
-rw-r--r--ext/io/wait/wait.c159
-rw-r--r--ext/json/extconf.rb1
-rw-r--r--ext/json/fbuffer/fbuffer.h5
-rw-r--r--ext/json/generator/depend21
-rw-r--r--ext/json/generator/generator.c173
-rw-r--r--ext/json/generator/generator.h37
-rw-r--r--ext/json/json.gemspecbin5474 -> 0 bytes-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.rb4
-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.rb82
-rw-r--r--ext/json/lib/json/ext.rb6
-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/depend20
-rw-r--r--ext/json/parser/extconf.rb3
-rw-r--r--ext/json/parser/parser.c865
-rw-r--r--ext/json/parser/parser.h32
-rw-r--r--ext/json/parser/parser.rl344
-rw-r--r--ext/mathn/complex/complex.c7
-rw-r--r--ext/mathn/complex/extconf.rb3
-rw-r--r--ext/mathn/rational/extconf.rb3
-rw-r--r--ext/mathn/rational/rational.c7
-rw-r--r--ext/nkf/depend30
-rw-r--r--ext/nkf/extconf.rb1
-rw-r--r--ext/nkf/lib/kconv.rb1
-rw-r--r--ext/nkf/nkf-utf8/nkf.c31
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c2
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h2
-rw-r--r--ext/nkf/nkf.c11
-rw-r--r--ext/objspace/depend89
-rw-r--r--ext/objspace/extconf.rb2
-rw-r--r--ext/objspace/object_tracing.c7
-rw-r--r--ext/objspace/objspace.c324
-rw-r--r--ext/objspace/objspace_dump.c133
-rw-r--r--ext/openssl/History.md339
-rw-r--r--ext/openssl/depend1158
-rw-r--r--ext/openssl/deprecation.rb12
-rw-r--r--ext/openssl/extconf.rb235
-rw-r--r--ext/openssl/lib/openssl.rb10
-rw-r--r--ext/openssl/lib/openssl/bn.rb20
-rw-r--r--ext/openssl/lib/openssl/buffering.rb69
-rw-r--r--ext/openssl/lib/openssl/cipher.rb48
-rw-r--r--ext/openssl/lib/openssl/config.rb26
-rw-r--r--ext/openssl/lib/openssl/digest.rb33
-rw-r--r--ext/openssl/lib/openssl/pkcs5.rb22
-rw-r--r--ext/openssl/lib/openssl/pkey.rb25
-rw-r--r--ext/openssl/lib/openssl/ssl.rb390
-rw-r--r--ext/openssl/lib/openssl/x509.rb73
-rw-r--r--ext/openssl/openssl.gemspec46
-rw-r--r--ext/openssl/openssl_missing.c380
-rw-r--r--ext/openssl/openssl_missing.h248
-rw-r--r--ext/openssl/ossl.c573
-rw-r--r--ext/openssl/ossl.h157
-rw-r--r--ext/openssl/ossl_asn1.c972
-rw-r--r--ext/openssl/ossl_asn1.h15
-rw-r--r--ext/openssl/ossl_bio.c75
-rw-r--r--ext/openssl/ossl_bio.h9
-rw-r--r--ext/openssl/ossl_bn.c664
-rw-r--r--ext/openssl/ossl_bn.h8
-rw-r--r--ext/openssl/ossl_cipher.c500
-rw-r--r--ext/openssl/ossl_cipher.h6
-rw-r--r--ext/openssl/ossl_config.c24
-rw-r--r--ext/openssl/ossl_config.h5
-rw-r--r--ext/openssl/ossl_digest.c112
-rw-r--r--ext/openssl/ossl_digest.h6
-rw-r--r--ext/openssl/ossl_engine.c265
-rw-r--r--ext/openssl/ossl_engine.h3
-rw-r--r--ext/openssl/ossl_hmac.c189
-rw-r--r--ext/openssl/ossl_hmac.h3
-rw-r--r--ext/openssl/ossl_kdf.c319
-rw-r--r--ext/openssl/ossl_kdf.h6
-rw-r--r--ext/openssl/ossl_ns_spki.c90
-rw-r--r--ext/openssl/ossl_ns_spki.h4
-rw-r--r--ext/openssl/ossl_ocsp.c1246
-rw-r--r--ext/openssl/ossl_ocsp.h5
-rw-r--r--ext/openssl/ossl_pkcs12.c137
-rw-r--r--ext/openssl/ossl_pkcs12.h4
-rw-r--r--ext/openssl/ossl_pkcs5.c189
-rw-r--r--ext/openssl/ossl_pkcs5.h6
-rw-r--r--ext/openssl/ossl_pkcs7.c186
-rw-r--r--ext/openssl/ossl_pkcs7.h4
-rw-r--r--ext/openssl/ossl_pkey.c302
-rw-r--r--ext/openssl/ossl_pkey.h170
-rw-r--r--ext/openssl/ossl_pkey_dh.c326
-rw-r--r--ext/openssl/ossl_pkey_dsa.c301
-rw-r--r--ext/openssl/ossl_pkey_ec.c1299
-rw-r--r--ext/openssl/ossl_pkey_rsa.c535
-rw-r--r--ext/openssl/ossl_rand.c134
-rw-r--r--ext/openssl/ossl_rand.h4
-rw-r--r--ext/openssl/ossl_ssl.c2155
-rw-r--r--ext/openssl/ossl_ssl.h22
-rw-r--r--ext/openssl/ossl_ssl_session.c191
-rw-r--r--ext/openssl/ossl_version.h5
-rw-r--r--ext/openssl/ossl_x509.c95
-rw-r--r--ext/openssl/ossl_x509.h29
-rw-r--r--ext/openssl/ossl_x509attr.c177
-rw-r--r--ext/openssl/ossl_x509cert.c202
-rw-r--r--ext/openssl/ossl_x509crl.c187
-rw-r--r--ext/openssl/ossl_x509ext.c202
-rw-r--r--ext/openssl/ossl_x509name.c240
-rw-r--r--ext/openssl/ossl_x509req.c155
-rw-r--r--ext/openssl/ossl_x509revoked.c127
-rw-r--r--ext/openssl/ossl_x509store.c496
-rw-r--r--ext/openssl/ruby_missing.h20
-rw-r--r--ext/pathname/depend19
-rw-r--r--ext/pathname/extconf.rb1
-rw-r--r--ext/pathname/lib/pathname.rb28
-rw-r--r--ext/pathname/pathname.c382
-rw-r--r--ext/psych/depend100
-rw-r--r--ext/psych/extconf.rb1
-rw-r--r--ext/psych/lib/psych.rb86
-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.rb20
-rw-r--r--ext/psych/lib/psych/deprecated.rb85
-rw-r--r--ext/psych/lib/psych/exception.rb1
-rw-r--r--ext/psych/lib/psych/handler.rb6
-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.rb13
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb1
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb1
-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.rb10
-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.rb49
-rw-r--r--ext/psych/lib/psych/versions.rb9
-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.rb53
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb1
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb220
-rw-r--r--ext/psych/lib/psych/y.rb1
-rw-r--r--ext/psych/psych.c2
-rw-r--r--ext/psych/psych.gemspec75
-rw-r--r--ext/psych/psych.h3
-rw-r--r--ext/psych/psych_emitter.c126
-rw-r--r--ext/psych/psych_emitter.h2
-rw-r--r--ext/psych/psych_parser.c106
-rw-r--r--ext/psych/psych_parser.h2
-rw-r--r--ext/psych/psych_to_ruby.c4
-rw-r--r--ext/psych/psych_yaml_tree.c2
-rw-r--r--ext/psych/yaml/LICENSE19
-rw-r--r--ext/psych/yaml/api.c57
-rw-r--r--ext/psych/yaml/config.h12
-rw-r--r--ext/psych/yaml/emitter.c16
-rw-r--r--ext/psych/yaml/loader.c25
-rw-r--r--ext/psych/yaml/scanner.c51
-rw-r--r--ext/psych/yaml/yaml_private.h4
-rw-r--r--ext/pty/depend25
-rw-r--r--ext/pty/extconf.rb2
-rw-r--r--ext/pty/lib/expect.rb10
-rw-r--r--ext/pty/pty.c127
-rw-r--r--ext/racc/cparse/cparse.c54
-rw-r--r--ext/racc/cparse/depend12
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/rbconfig/sizeof/depend38
-rw-r--r--ext/rbconfig/sizeof/extconf.rb35
-rw-r--r--ext/readline/depend24
-rw-r--r--ext/readline/extconf.rb5
-rw-r--r--ext/readline/readline.c211
-rw-r--r--ext/ripper/depend59
-rw-r--r--ext/ripper/eventids2.c523
-rw-r--r--ext/ripper/extconf.rb3
-rw-r--r--ext/ripper/lib/ripper.rb9
-rw-r--r--ext/ripper/lib/ripper/core.rb22
-rw-r--r--ext/ripper/lib/ripper/filter.rb11
-rw-r--r--ext/ripper/lib/ripper/lexer.rb101
-rw-r--r--ext/ripper/lib/ripper/sexp.rb110
-rwxr-xr-xext/ripper/tools/generate-param-macros.rb1
-rwxr-xr-xext/ripper/tools/generate.rb38
-rwxr-xr-xext/ripper/tools/preproc.rb23
-rwxr-xr-xext/ripper/tools/strip.rb8
-rw-r--r--ext/rubyvm/extconf.rb1
-rw-r--r--ext/rubyvm/lib/forwardable/impl.rb19
-rw-r--r--ext/sdbm/_sdbm.c73
-rw-r--r--ext/sdbm/depend27
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c54
-rw-r--r--ext/sdbm/sdbm.gemspec22
-rw-r--r--ext/socket/ancdata.c282
-rw-r--r--ext/socket/basicsocket.c147
-rw-r--r--ext/socket/constants.c2
-rw-r--r--ext/socket/depend348
-rw-r--r--ext/socket/extconf.rb41
-rw-r--r--ext/socket/getaddrinfo.c15
-rw-r--r--ext/socket/getnameinfo.c28
-rw-r--r--ext/socket/ifaddr.c90
-rw-r--r--ext/socket/init.c488
-rw-r--r--ext/socket/ipsocket.c63
-rw-r--r--ext/socket/lib/socket.rb605
-rw-r--r--ext/socket/mkconstants.rb1
-rw-r--r--ext/socket/option.c60
-rw-r--r--ext/socket/raddrinfo.c108
-rw-r--r--ext/socket/rubysocket.h65
-rw-r--r--ext/socket/socket.c461
-rw-r--r--ext/socket/sockssocket.c3
-rw-r--r--ext/socket/tcpserver.c44
-rw-r--r--ext/socket/tcpsocket.c17
-rw-r--r--ext/socket/udpsocket.c186
-rw-r--r--ext/socket/unixserver.c45
-rw-r--r--ext/socket/unixsocket.c50
-rw-r--r--ext/stringio/README18
-rw-r--r--ext/stringio/README.md10
-rw-r--r--ext/stringio/depend21
-rw-r--r--ext/stringio/extconf.rb1
-rw-r--r--ext/stringio/stringio.c364
-rw-r--r--ext/stringio/stringio.gemspec27
-rw-r--r--ext/strscan/depend26
-rw-r--r--ext/strscan/extconf.rb1
-rw-r--r--ext/strscan/strscan.c146
-rw-r--r--ext/strscan/strscan.gemspec20
-rw-r--r--ext/syslog/depend15
-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.rb3
-rw-r--r--ext/thread/thread.c653
-rw-r--r--ext/tk/ChangeLog.tkextlib949
-rw-r--r--ext/tk/MANUAL_tcltklib.eng473
-rw-r--r--ext/tk/MANUAL_tcltklib.ja584
-rw-r--r--ext/tk/README.1st19
-rw-r--r--ext/tk/README.ActiveTcl62
-rw-r--r--ext/tk/README.fork34
-rw-r--r--ext/tk/README.macosx-aqua67
-rw-r--r--ext/tk/README.tcltklib152
-rw-r--r--ext/tk/config_list.in41
-rw-r--r--ext/tk/depend2
-rw-r--r--ext/tk/extconf.rb2094
-rw-r--r--ext/tk/lib/README30
-rw-r--r--ext/tk/lib/multi-tk.rb3754
-rw-r--r--ext/tk/lib/remote-tk.rb530
-rw-r--r--ext/tk/lib/tcltk.rb367
-rw-r--r--ext/tk/lib/tk.rb5761
-rw-r--r--ext/tk/lib/tk/after.rb6
-rw-r--r--ext/tk/lib/tk/autoload.rb760
-rw-r--r--ext/tk/lib/tk/bgerror.rb29
-rw-r--r--ext/tk/lib/tk/bindtag.rb138
-rw-r--r--ext/tk/lib/tk/busy.rb118
-rw-r--r--ext/tk/lib/tk/button.rb31
-rw-r--r--ext/tk/lib/tk/canvas.rb846
-rw-r--r--ext/tk/lib/tk/canvastag.rb459
-rw-r--r--ext/tk/lib/tk/checkbutton.rb32
-rw-r--r--ext/tk/lib/tk/clipboard.rb75
-rw-r--r--ext/tk/lib/tk/clock.rb71
-rw-r--r--ext/tk/lib/tk/composite.rb484
-rw-r--r--ext/tk/lib/tk/console.rb52
-rw-r--r--ext/tk/lib/tk/dialog.rb326
-rw-r--r--ext/tk/lib/tk/encodedstr.rb187
-rw-r--r--ext/tk/lib/tk/entry.rb120
-rw-r--r--ext/tk/lib/tk/event.rb562
-rw-r--r--ext/tk/lib/tk/font.rb2351
-rw-r--r--ext/tk/lib/tk/fontchooser.rb176
-rw-r--r--ext/tk/lib/tk/frame.rb132
-rw-r--r--ext/tk/lib/tk/grid.rb279
-rw-r--r--ext/tk/lib/tk/image.rb395
-rw-r--r--ext/tk/lib/tk/itemconfig.rb1222
-rw-r--r--ext/tk/lib/tk/itemfont.rb327
-rw-r--r--ext/tk/lib/tk/kinput.rb71
-rw-r--r--ext/tk/lib/tk/label.rb22
-rw-r--r--ext/tk/lib/tk/labelframe.rb31
-rw-r--r--ext/tk/lib/tk/listbox.rb284
-rw-r--r--ext/tk/lib/tk/macpkg.rb80
-rw-r--r--ext/tk/lib/tk/menu.rb718
-rw-r--r--ext/tk/lib/tk/menubar.rb137
-rw-r--r--ext/tk/lib/tk/menuspec.rb456
-rw-r--r--ext/tk/lib/tk/message.rb24
-rw-r--r--ext/tk/lib/tk/mngfocus.rb33
-rw-r--r--ext/tk/lib/tk/msgcat.rb299
-rw-r--r--ext/tk/lib/tk/namespace.rb546
-rw-r--r--ext/tk/lib/tk/optiondb.rb377
-rw-r--r--ext/tk/lib/tk/optionobj.rb212
-rw-r--r--ext/tk/lib/tk/pack.rb107
-rw-r--r--ext/tk/lib/tk/package.rb143
-rw-r--r--ext/tk/lib/tk/palette.rb55
-rw-r--r--ext/tk/lib/tk/panedwindow.rb260
-rw-r--r--ext/tk/lib/tk/place.rb128
-rw-r--r--ext/tk/lib/tk/radiobutton.rb73
-rw-r--r--ext/tk/lib/tk/root.rb95
-rw-r--r--ext/tk/lib/tk/scale.rb112
-rw-r--r--ext/tk/lib/tk/scrollable.rb82
-rw-r--r--ext/tk/lib/tk/scrollbar.rb183
-rw-r--r--ext/tk/lib/tk/scrollbox.rb39
-rw-r--r--ext/tk/lib/tk/selection.rb86
-rw-r--r--ext/tk/lib/tk/spinbox.rb144
-rw-r--r--ext/tk/lib/tk/tagfont.rb43
-rw-r--r--ext/tk/lib/tk/text.rb1604
-rw-r--r--ext/tk/lib/tk/textimage.rb88
-rw-r--r--ext/tk/lib/tk/textmark.rb204
-rw-r--r--ext/tk/lib/tk/texttag.rb321
-rw-r--r--ext/tk/lib/tk/textwindow.rb154
-rw-r--r--ext/tk/lib/tk/timer.rb669
-rw-r--r--ext/tk/lib/tk/toplevel.rb264
-rw-r--r--ext/tk/lib/tk/ttk_selector.rb98
-rw-r--r--ext/tk/lib/tk/txtwin_abst.rb39
-rw-r--r--ext/tk/lib/tk/validation.rb397
-rw-r--r--ext/tk/lib/tk/variable.rb1799
-rw-r--r--ext/tk/lib/tk/virtevent.rb139
-rw-r--r--ext/tk/lib/tk/winfo.rb392
-rw-r--r--ext/tk/lib/tk/winpkg.rb156
-rw-r--r--ext/tk/lib/tk/wm.rb552
-rw-r--r--ext/tk/lib/tk/xim.rb122
-rw-r--r--ext/tk/lib/tkafter.rb4
-rw-r--r--ext/tk/lib/tkbgerror.rb4
-rw-r--r--ext/tk/lib/tkcanvas.rb4
-rw-r--r--ext/tk/lib/tkclass.rb47
-rw-r--r--ext/tk/lib/tkconsole.rb4
-rw-r--r--ext/tk/lib/tkdialog.rb4
-rw-r--r--ext/tk/lib/tkentry.rb4
-rw-r--r--ext/tk/lib/tkextlib/ICONS.rb13
-rw-r--r--ext/tk/lib/tkextlib/ICONS/icons.rb129
-rw-r--r--ext/tk/lib/tkextlib/ICONS/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/SUPPORT_STATUS193
-rw-r--r--ext/tk/lib/tkextlib/blt.rb189
-rw-r--r--ext/tk/lib/tkextlib/blt/barchart.rb79
-rw-r--r--ext/tk/lib/tkextlib/blt/bitmap.rb112
-rw-r--r--ext/tk/lib/tkextlib/blt/busy.rb83
-rw-r--r--ext/tk/lib/tkextlib/blt/component.rb2218
-rw-r--r--ext/tk/lib/tkextlib/blt/container.rb28
-rw-r--r--ext/tk/lib/tkextlib/blt/cutbuffer.rb23
-rw-r--r--ext/tk/lib/tkextlib/blt/dragdrop.rb269
-rw-r--r--ext/tk/lib/tkextlib/blt/eps.rb32
-rw-r--r--ext/tk/lib/tkextlib/blt/graph.rb67
-rw-r--r--ext/tk/lib/tkextlib/blt/htext.rb112
-rw-r--r--ext/tk/lib/tkextlib/blt/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/blt/spline.rb23
-rw-r--r--ext/tk/lib/tkextlib/blt/stripchart.rb74
-rw-r--r--ext/tk/lib/tkextlib/blt/table.rb412
-rw-r--r--ext/tk/lib/tkextlib/blt/tabnotebook.rb110
-rw-r--r--ext/tk/lib/tkextlib/blt/tabset.rb504
-rw-r--r--ext/tk/lib/tkextlib/blt/ted.rb68
-rw-r--r--ext/tk/lib/tkextlib/blt/tile.rb25
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/button.rb16
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/checkbutton.rb17
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/frame.rb16
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/label.rb16
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/radiobutton.rb17
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/scrollbar.rb16
-rw-r--r--ext/tk/lib/tkextlib/blt/tile/toplevel.rb16
-rw-r--r--ext/tk/lib/tkextlib/blt/tree.rb1058
-rw-r--r--ext/tk/lib/tkextlib/blt/treeview.rb1287
-rw-r--r--ext/tk/lib/tkextlib/blt/unix_dnd.rb141
-rw-r--r--ext/tk/lib/tkextlib/blt/vector.rb256
-rw-r--r--ext/tk/lib/tkextlib/blt/watch.rb175
-rw-r--r--ext/tk/lib/tkextlib/blt/win_printer.rb61
-rw-r--r--ext/tk/lib/tkextlib/blt/winop.rb107
-rw-r--r--ext/tk/lib/tkextlib/bwidget.rb153
-rw-r--r--ext/tk/lib/tkextlib/bwidget/arrowbutton.rb21
-rw-r--r--ext/tk/lib/tkextlib/bwidget/bitmap.rb21
-rw-r--r--ext/tk/lib/tkextlib/bwidget/button.rb31
-rw-r--r--ext/tk/lib/tkextlib/bwidget/buttonbox.rb90
-rw-r--r--ext/tk/lib/tkextlib/bwidget/combobox.rb62
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dialog.rb194
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dragsite.rb31
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dropsite.rb39
-rw-r--r--ext/tk/lib/tkextlib/bwidget/dynamichelp.rb63
-rw-r--r--ext/tk/lib/tkextlib/bwidget/entry.rb43
-rw-r--r--ext/tk/lib/tkextlib/bwidget/label.rb41
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelentry.rb80
-rw-r--r--ext/tk/lib/tkextlib/bwidget/labelframe.rb52
-rw-r--r--ext/tk/lib/tkextlib/bwidget/listbox.rb361
-rw-r--r--ext/tk/lib/tkextlib/bwidget/mainframe.rb132
-rw-r--r--ext/tk/lib/tkextlib/bwidget/messagedlg.rb192
-rw-r--r--ext/tk/lib/tkextlib/bwidget/notebook.rb166
-rw-r--r--ext/tk/lib/tkextlib/bwidget/pagesmanager.rb73
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panedwindow.rb42
-rw-r--r--ext/tk/lib/tkextlib/bwidget/panelframe.rb67
-rw-r--r--ext/tk/lib/tkextlib/bwidget/passwddlg.rb44
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressbar.rb20
-rw-r--r--ext/tk/lib/tkextlib/bwidget/progressdlg.rb58
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollableframe.rb40
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb48
-rw-r--r--ext/tk/lib/tkextlib/bwidget/scrollview.rb25
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectcolor.rb73
-rw-r--r--ext/tk/lib/tkextlib/bwidget/selectfont.rb91
-rw-r--r--ext/tk/lib/tkextlib/bwidget/separator.rb20
-rw-r--r--ext/tk/lib/tkextlib/bwidget/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/bwidget/spinbox.rb98
-rw-r--r--ext/tk/lib/tkextlib/bwidget/statusbar.rb62
-rw-r--r--ext/tk/lib/tkextlib/bwidget/titleframe.rb33
-rw-r--r--ext/tk/lib/tkextlib/bwidget/tree.rb500
-rw-r--r--ext/tk/lib/tkextlib/bwidget/widget.rb129
-rw-r--r--ext/tk/lib/tkextlib/itcl.rb13
-rw-r--r--ext/tk/lib/tkextlib/itcl/incr_tcl.rb178
-rw-r--r--ext/tk/lib/tkextlib/itcl/setup.rb13
-rw-r--r--ext/tk/lib/tkextlib/itk.rb13
-rw-r--r--ext/tk/lib/tkextlib/itk/incr_tk.rb446
-rw-r--r--ext/tk/lib/tkextlib/itk/setup.rb13
-rw-r--r--ext/tk/lib/tkextlib/iwidgets.rb94
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/buttonbox.rb121
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/calendar.rb125
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb53
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb38
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/checkbox.rb130
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/combobox.rb104
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dateentry.rb20
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/datefield.rb58
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialog.rb20
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/dialogshell.rb121
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb50
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/entryfield.rb185
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extbutton.rb40
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb46
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb33
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/feedback.rb35
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb46
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb33
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/finddialog.rb42
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hierarchy.rb365
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb50
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledframe.rb39
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb45
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/mainwindow.rb67
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/menubar.rb212
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagebox.rb93
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/messagedialog.rb20
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/notebook.rb175
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/optionmenu.rb92
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/panedwindow.rb134
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/promptdialog.rb131
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/pushbutton.rb35
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/radiobox.rb121
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scopedobject.rb24
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb353
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb59
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb58
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb207
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb568
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb20
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectionbox.rb102
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb92
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/shell.rb38
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spindate.rb48
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinint.rb30
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spinner.rb169
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/spintime.rb48
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb181
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/tabset.rb145
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timeentry.rb25
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb58
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/toolbar.rb112
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/watch.rb56
-rwxr-xr-xext/tk/lib/tkextlib/pkg_checker.rb184
-rw-r--r--ext/tk/lib/tkextlib/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tcllib.rb105
-rw-r--r--ext/tk/lib/tkextlib/tcllib/README135
-rw-r--r--ext/tk/lib/tkextlib/tcllib/autoscroll.rb158
-rw-r--r--ext/tk/lib/tkextlib/tcllib/calendar.rb55
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb36
-rw-r--r--ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb21
-rw-r--r--ext/tk/lib/tkextlib/tcllib/chatwidget.rb151
-rw-r--r--ext/tk/lib/tkextlib/tcllib/crosshair.rb117
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ctext.rb160
-rw-r--r--ext/tk/lib/tkextlib/tcllib/cursor.rb97
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dateentry.rb62
-rw-r--r--ext/tk/lib/tkextlib/tcllib/datefield.rb57
-rw-r--r--ext/tk/lib/tkextlib/tcllib/diagrams.rb224
-rw-r--r--ext/tk/lib/tkextlib/tcllib/dialog.rb84
-rw-r--r--ext/tk/lib/tkextlib/tcllib/getstring.rb134
-rw-r--r--ext/tk/lib/tkextlib/tcllib/history.rb73
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ico.rb146
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ip_entry.rb75
-rw-r--r--ext/tk/lib/tkextlib/tcllib/khim.rb68
-rw-r--r--ext/tk/lib/tkextlib/tcllib/menuentry.rb47
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ntext.rb146
-rw-r--r--ext/tk/lib/tkextlib/tcllib/panelframe.rb78
-rw-r--r--ext/tk/lib/tkextlib/tcllib/plotchart.rb1404
-rw-r--r--ext/tk/lib/tkextlib/tcllib/ruler.rb65
-rw-r--r--ext/tk/lib/tkextlib/tcllib/screenruler.rb68
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb57
-rw-r--r--ext/tk/lib/tkextlib/tcllib/scrollwin.rb61
-rw-r--r--ext/tk/lib/tkextlib/tcllib/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tcllib/statusbar.rb79
-rw-r--r--ext/tk/lib/tkextlib/tcllib/style.rb61
-rw-r--r--ext/tk/lib/tkextlib/tcllib/superframe.rb51
-rw-r--r--ext/tk/lib/tkextlib/tcllib/swaplist.rb150
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist.rb28
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_core.rb1072
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb43
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tkpiechart.rb314
-rw-r--r--ext/tk/lib/tkextlib/tcllib/toolbar.rb175
-rw-r--r--ext/tk/lib/tkextlib/tcllib/tooltip.rb104
-rw-r--r--ext/tk/lib/tkextlib/tcllib/widget.rb82
-rw-r--r--ext/tk/lib/tkextlib/tclx.rb13
-rw-r--r--ext/tk/lib/tkextlib/tclx/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tclx/tclx.rb74
-rw-r--r--ext/tk/lib/tkextlib/tile.rb449
-rw-r--r--ext/tk/lib/tkextlib/tile/dialog.rb102
-rw-r--r--ext/tk/lib/tkextlib/tile/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tile/sizegrip.rb32
-rw-r--r--ext/tk/lib/tkextlib/tile/style.rb336
-rw-r--r--ext/tk/lib/tkextlib/tile/tbutton.rb34
-rw-r--r--ext/tk/lib/tkextlib/tile/tcheckbutton.rb38
-rw-r--r--ext/tk/lib/tkextlib/tile/tcombobox.rb55
-rw-r--r--ext/tk/lib/tkextlib/tile/tentry.rb49
-rw-r--r--ext/tk/lib/tkextlib/tile/tframe.rb34
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabel.rb34
-rw-r--r--ext/tk/lib/tkextlib/tile/tlabelframe.rb38
-rw-r--r--ext/tk/lib/tkextlib/tile/tmenubutton.rb38
-rw-r--r--ext/tk/lib/tkextlib/tile/tnotebook.rb147
-rw-r--r--ext/tk/lib/tkextlib/tile/tpaned.rb245
-rw-r--r--ext/tk/lib/tkextlib/tile/tprogressbar.rb57
-rw-r--r--ext/tk/lib/tkextlib/tile/tradiobutton.rb38
-rw-r--r--ext/tk/lib/tkextlib/tile/treeview.rb1306
-rw-r--r--ext/tk/lib/tkextlib/tile/tscale.rb56
-rw-r--r--ext/tk/lib/tkextlib/tile/tscrollbar.rb63
-rw-r--r--ext/tk/lib/tkextlib/tile/tseparator.rb34
-rw-r--r--ext/tk/lib/tkextlib/tile/tspinbox.rb107
-rw-r--r--ext/tk/lib/tkextlib/tile/tsquare.rb30
-rw-r--r--ext/tk/lib/tkextlib/tkDND.rb18
-rw-r--r--ext/tk/lib/tkextlib/tkDND/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tkDND/shape.rb125
-rw-r--r--ext/tk/lib/tkextlib/tkDND/tkdnd.rb182
-rw-r--r--ext/tk/lib/tkextlib/tkHTML.rb13
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb453
-rw-r--r--ext/tk/lib/tkextlib/tkHTML/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tkimg.rb36
-rw-r--r--ext/tk/lib/tkextlib/tkimg/README26
-rw-r--r--ext/tk/lib/tkextlib/tkimg/bmp.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/gif.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ico.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/jpeg.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pcx.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/pixmap.rb44
-rw-r--r--ext/tk/lib/tkextlib/tkimg/png.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ppm.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/ps.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sgi.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/sun.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tga.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/tiff.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/window.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xbm.rb33
-rw-r--r--ext/tk/lib/tkextlib/tkimg/xpm.rb33
-rw-r--r--ext/tk/lib/tkextlib/tktable.rb14
-rw-r--r--ext/tk/lib/tkextlib/tktable/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tktable/tktable.rb966
-rw-r--r--ext/tk/lib/tkextlib/tktrans.rb14
-rw-r--r--ext/tk/lib/tkextlib/tktrans/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/tktrans/tktrans.rb64
-rw-r--r--ext/tk/lib/tkextlib/treectrl.rb13
-rw-r--r--ext/tk/lib/tkextlib/treectrl/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/treectrl/tktreectrl.rb2522
-rw-r--r--ext/tk/lib/tkextlib/trofs.rb13
-rw-r--r--ext/tk/lib/tkextlib/trofs/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/trofs/trofs.rb51
-rw-r--r--ext/tk/lib/tkextlib/version.rb6
-rw-r--r--ext/tk/lib/tkextlib/vu.rb48
-rw-r--r--ext/tk/lib/tkextlib/vu/bargraph.rb61
-rw-r--r--ext/tk/lib/tkextlib/vu/charts.rb53
-rw-r--r--ext/tk/lib/tkextlib/vu/dial.rb102
-rw-r--r--ext/tk/lib/tkextlib/vu/pie.rb286
-rw-r--r--ext/tk/lib/tkextlib/vu/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/vu/spinbox.rb22
-rw-r--r--ext/tk/lib/tkextlib/winico.rb14
-rw-r--r--ext/tk/lib/tkextlib/winico/setup.rb8
-rw-r--r--ext/tk/lib/tkextlib/winico/winico.rb224
-rw-r--r--ext/tk/lib/tkfont.rb4
-rw-r--r--ext/tk/lib/tkmacpkg.rb4
-rw-r--r--ext/tk/lib/tkmenubar.rb4
-rw-r--r--ext/tk/lib/tkmngfocus.rb4
-rw-r--r--ext/tk/lib/tkpalette.rb4
-rw-r--r--ext/tk/lib/tkscrollbox.rb4
-rw-r--r--ext/tk/lib/tktext.rb4
-rw-r--r--ext/tk/lib/tkvirtevent.rb4
-rw-r--r--ext/tk/lib/tkwinpkg.rb4
-rw-r--r--ext/tk/old-README.tcltklib.ja159
-rw-r--r--ext/tk/old-extconf.rb440
-rw-r--r--ext/tk/sample/24hr_clock.rb286
-rw-r--r--ext/tk/sample/binding_sample.rb87
-rw-r--r--ext/tk/sample/bindtag_sample.rb127
-rw-r--r--ext/tk/sample/binstr_usage.rb45
-rw-r--r--ext/tk/sample/btn_with_frame.rb20
-rw-r--r--ext/tk/sample/cd_timer.rb81
-rw-r--r--ext/tk/sample/cmd_res_test.rb17
-rw-r--r--ext/tk/sample/cmd_resource5
-rw-r--r--ext/tk/sample/demos-en/ChangeLog64
-rw-r--r--ext/tk/sample/demos-en/ChangeLog.prev9
-rw-r--r--ext/tk/sample/demos-en/README138
-rw-r--r--ext/tk/sample/demos-en/README.1st18
-rw-r--r--ext/tk/sample/demos-en/README.tkencoding29
-rw-r--r--ext/tk/sample/demos-en/anilabel.rb174
-rw-r--r--ext/tk/sample/demos-en/aniwave.rb118
-rw-r--r--ext/tk/sample/demos-en/arrow.rb249
-rw-r--r--ext/tk/sample/demos-en/bind.rb127
-rw-r--r--ext/tk/sample/demos-en/bitmap.rb75
-rw-r--r--ext/tk/sample/demos-en/browse163
-rw-r--r--ext/tk/sample/demos-en/browse282
-rw-r--r--ext/tk/sample/demos-en/button.rb84
-rw-r--r--ext/tk/sample/demos-en/check.rb72
-rw-r--r--ext/tk/sample/demos-en/check2.rb109
-rw-r--r--ext/tk/sample/demos-en/clrpick.rb87
-rw-r--r--ext/tk/sample/demos-en/colors.rb158
-rw-r--r--ext/tk/sample/demos-en/combo.rb96
-rw-r--r--ext/tk/sample/demos-en/cscroll.rb136
-rw-r--r--ext/tk/sample/demos-en/ctext.rb207
-rw-r--r--ext/tk/sample/demos-en/dialog1.rb38
-rw-r--r--ext/tk/sample/demos-en/dialog2.rb41
-rw-r--r--ext/tk/sample/demos-en/doc.org/README7
-rw-r--r--ext/tk/sample/demos-en/doc.org/README.JP14
-rw-r--r--ext/tk/sample/demos-en/doc.org/README.tk8046
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms39
-rw-r--r--ext/tk/sample/demos-en/doc.org/license.terms.tk8039
-rw-r--r--ext/tk/sample/demos-en/entry1.rb58
-rw-r--r--ext/tk/sample/demos-en/entry2.rb93
-rw-r--r--ext/tk/sample/demos-en/entry3.rb220
-rw-r--r--ext/tk/sample/demos-en/filebox.rb102
-rw-r--r--ext/tk/sample/demos-en/floor.rb1723
-rw-r--r--ext/tk/sample/demos-en/floor2.rb1722
-rw-r--r--ext/tk/sample/demos-en/form.rb64
-rw-r--r--ext/tk/sample/demos-en/goldberg.rb2006
-rw-r--r--ext/tk/sample/demos-en/hello14
-rw-r--r--ext/tk/sample/demos-en/hscale.rb75
-rw-r--r--ext/tk/sample/demos-en/icon.rb105
-rw-r--r--ext/tk/sample/demos-en/image1.rb65
-rw-r--r--ext/tk/sample/demos-en/image2.rb107
-rw-r--r--ext/tk/sample/demos-en/image3.rb125
-rw-r--r--ext/tk/sample/demos-en/items.rb381
-rw-r--r--ext/tk/sample/demos-en/ixset333
-rw-r--r--ext/tk/sample/demos-en/ixset2367
-rw-r--r--ext/tk/sample/demos-en/knightstour.rb271
-rw-r--r--ext/tk/sample/demos-en/label.rb72
-rw-r--r--ext/tk/sample/demos-en/labelframe.rb95
-rw-r--r--ext/tk/sample/demos-en/mclist.rb117
-rw-r--r--ext/tk/sample/demos-en/menu.rb196
-rw-r--r--ext/tk/sample/demos-en/menu84.rb215
-rw-r--r--ext/tk/sample/demos-en/menubu.rb237
-rw-r--r--ext/tk/sample/demos-en/msgbox.rb90
-rw-r--r--ext/tk/sample/demos-en/msgbox2.rb91
-rw-r--r--ext/tk/sample/demos-en/paned1.rb47
-rw-r--r--ext/tk/sample/demos-en/paned2.rb94
-rw-r--r--ext/tk/sample/demos-en/pendulum.rb240
-rw-r--r--ext/tk/sample/demos-en/plot.rb124
-rw-r--r--ext/tk/sample/demos-en/puzzle.rb134
-rw-r--r--ext/tk/sample/demos-en/radio.rb86
-rw-r--r--ext/tk/sample/demos-en/radio2.rb109
-rw-r--r--ext/tk/sample/demos-en/radio3.rb117
-rw-r--r--ext/tk/sample/demos-en/rmt268
-rw-r--r--ext/tk/sample/demos-en/rolodex320
-rw-r--r--ext/tk/sample/demos-en/ruler.rb205
-rw-r--r--ext/tk/sample/demos-en/sayings.rb106
-rw-r--r--ext/tk/sample/demos-en/search.rb187
-rw-r--r--ext/tk/sample/demos-en/spin.rb65
-rw-r--r--ext/tk/sample/demos-en/square81
-rw-r--r--ext/tk/sample/demos-en/states.rb80
-rw-r--r--ext/tk/sample/demos-en/style.rb231
-rw-r--r--ext/tk/sample/demos-en/tcolor526
-rw-r--r--ext/tk/sample/demos-en/text.rb128
-rw-r--r--ext/tk/sample/demos-en/textpeer.rb76
-rw-r--r--ext/tk/sample/demos-en/timer136
-rw-r--r--ext/tk/sample/demos-en/tkencoding.rb42
-rw-r--r--ext/tk/sample/demos-en/toolbar.rb130
-rw-r--r--ext/tk/sample/demos-en/tree.rb119
-rw-r--r--ext/tk/sample/demos-en/ttkbut.rb139
-rw-r--r--ext/tk/sample/demos-en/ttkmenu.rb85
-rw-r--r--ext/tk/sample/demos-en/ttknote.rb89
-rw-r--r--ext/tk/sample/demos-en/ttkpane.rb213
-rw-r--r--ext/tk/sample/demos-en/ttkprogress.rb66
-rw-r--r--ext/tk/sample/demos-en/twind.rb291
-rw-r--r--ext/tk/sample/demos-en/twind2.rb384
-rw-r--r--ext/tk/sample/demos-en/unicodeout.rb114
-rw-r--r--ext/tk/sample/demos-en/vscale.rb79
-rw-r--r--ext/tk/sample/demos-en/widget1087
-rw-r--r--ext/tk/sample/demos-jp/README54
-rw-r--r--ext/tk/sample/demos-jp/README.1st20
-rw-r--r--ext/tk/sample/demos-jp/anilabel.rb177
-rw-r--r--ext/tk/sample/demos-jp/aniwave.rb120
-rw-r--r--ext/tk/sample/demos-jp/arrow.rb247
-rw-r--r--ext/tk/sample/demos-jp/bind.rb125
-rw-r--r--ext/tk/sample/demos-jp/bitmap.rb74
-rw-r--r--ext/tk/sample/demos-jp/browse163
-rw-r--r--ext/tk/sample/demos-jp/browse282
-rw-r--r--ext/tk/sample/demos-jp/button.rb83
-rw-r--r--ext/tk/sample/demos-jp/check.rb70
-rw-r--r--ext/tk/sample/demos-jp/check2.rb110
-rw-r--r--ext/tk/sample/demos-jp/clrpick.rb84
-rw-r--r--ext/tk/sample/demos-jp/colors.rb155
-rw-r--r--ext/tk/sample/demos-jp/combo.rb98
-rw-r--r--ext/tk/sample/demos-jp/cscroll.rb134
-rw-r--r--ext/tk/sample/demos-jp/ctext.rb204
-rw-r--r--ext/tk/sample/demos-jp/dialog1.rb39
-rw-r--r--ext/tk/sample/demos-jp/dialog2.rb43
-rw-r--r--ext/tk/sample/demos-jp/doc.org/README7
-rw-r--r--ext/tk/sample/demos-jp/doc.org/README.JP14
-rw-r--r--ext/tk/sample/demos-jp/doc.org/README.tk8046
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms39
-rw-r--r--ext/tk/sample/demos-jp/doc.org/license.terms.tk8039
-rw-r--r--ext/tk/sample/demos-jp/entry1.rb60
-rw-r--r--ext/tk/sample/demos-jp/entry2.rb91
-rw-r--r--ext/tk/sample/demos-jp/entry3.rb225
-rw-r--r--ext/tk/sample/demos-jp/filebox.rb102
-rw-r--r--ext/tk/sample/demos-jp/floor.rb1721
-rw-r--r--ext/tk/sample/demos-jp/floor2.rb1719
-rw-r--r--ext/tk/sample/demos-jp/form.rb66
-rw-r--r--ext/tk/sample/demos-jp/goldberg.rb2011
-rw-r--r--ext/tk/sample/demos-jp/hello10
-rw-r--r--ext/tk/sample/demos-jp/hscale.rb78
-rw-r--r--ext/tk/sample/demos-jp/icon.rb103
-rw-r--r--ext/tk/sample/demos-jp/image1.rb64
-rw-r--r--ext/tk/sample/demos-jp/image2.rb106
-rw-r--r--ext/tk/sample/demos-jp/image3.rb127
-rw-r--r--ext/tk/sample/demos-jp/items.rb379
-rw-r--r--ext/tk/sample/demos-jp/ixset333
-rw-r--r--ext/tk/sample/demos-jp/ixset2369
-rw-r--r--ext/tk/sample/demos-jp/knightstour.rb273
-rw-r--r--ext/tk/sample/demos-jp/label.rb69
-rw-r--r--ext/tk/sample/demos-jp/labelframe.rb102
-rw-r--r--ext/tk/sample/demos-jp/mclist.rb121
-rw-r--r--ext/tk/sample/demos-jp/menu.rb201
-rw-r--r--ext/tk/sample/demos-jp/menu84.rb213
-rw-r--r--ext/tk/sample/demos-jp/menu8x.rb233
-rw-r--r--ext/tk/sample/demos-jp/menubu.rb238
-rw-r--r--ext/tk/sample/demos-jp/msgbox.rb89
-rw-r--r--ext/tk/sample/demos-jp/msgbox2.rb90
-rw-r--r--ext/tk/sample/demos-jp/paned1.rb52
-rw-r--r--ext/tk/sample/demos-jp/paned2.rb100
-rw-r--r--ext/tk/sample/demos-jp/pendulum.rb242
-rw-r--r--ext/tk/sample/demos-jp/plot.rb126
-rw-r--r--ext/tk/sample/demos-jp/puzzle.rb131
-rw-r--r--ext/tk/sample/demos-jp/radio.rb84
-rw-r--r--ext/tk/sample/demos-jp/radio2.rb112
-rw-r--r--ext/tk/sample/demos-jp/radio3.rb119
-rw-r--r--ext/tk/sample/demos-jp/rmt268
-rw-r--r--ext/tk/sample/demos-jp/rolodex320
-rw-r--r--ext/tk/sample/demos-jp/rolodex-j300
-rw-r--r--ext/tk/sample/demos-jp/ruler.rb203
-rw-r--r--ext/tk/sample/demos-jp/sayings.rb103
-rw-r--r--ext/tk/sample/demos-jp/search.rb184
-rw-r--r--ext/tk/sample/demos-jp/spin.rb71
-rw-r--r--ext/tk/sample/demos-jp/square81
-rw-r--r--ext/tk/sample/demos-jp/states.rb74
-rw-r--r--ext/tk/sample/demos-jp/style.rb270
-rw-r--r--ext/tk/sample/demos-jp/tcolor534
-rw-r--r--ext/tk/sample/demos-jp/text.rb120
-rw-r--r--ext/tk/sample/demos-jp/textpeer.rb82
-rw-r--r--ext/tk/sample/demos-jp/timer136
-rw-r--r--ext/tk/sample/demos-jp/toolbar.rb136
-rw-r--r--ext/tk/sample/demos-jp/tree.rb120
-rw-r--r--ext/tk/sample/demos-jp/ttkbut.rb145
-rw-r--r--ext/tk/sample/demos-jp/ttkmenu.rb91
-rw-r--r--ext/tk/sample/demos-jp/ttknote.rb97
-rw-r--r--ext/tk/sample/demos-jp/ttkpane.rb216
-rw-r--r--ext/tk/sample/demos-jp/ttkprogress.rb71
-rw-r--r--ext/tk/sample/demos-jp/twind.rb292
-rw-r--r--ext/tk/sample/demos-jp/twind2.rb384
-rw-r--r--ext/tk/sample/demos-jp/unicodeout.rb119
-rw-r--r--ext/tk/sample/demos-jp/vscale.rb80
-rw-r--r--ext/tk/sample/demos-jp/widget1122
-rw-r--r--ext/tk/sample/editable_listbox.rb148
-rw-r--r--ext/tk/sample/encstr_usage.rb30
-rw-r--r--ext/tk/sample/figmemo_sample.rb456
-rw-r--r--ext/tk/sample/images/earth.gifbin0 -> 51712 bytes-rw-r--r--ext/tk/sample/images/earthris.gifbin0 -> 6343 bytes-rw-r--r--ext/tk/sample/images/face.xbm173
-rw-r--r--ext/tk/sample/images/flagdown.xbm27
-rw-r--r--ext/tk/sample/images/flagup.xbm27
-rw-r--r--ext/tk/sample/images/gray25.xbm6
-rw-r--r--ext/tk/sample/images/grey.256
-rw-r--r--ext/tk/sample/images/grey.56
-rw-r--r--ext/tk/sample/images/letters.xbm27
-rw-r--r--ext/tk/sample/images/noletter.xbm27
-rw-r--r--ext/tk/sample/images/pattern.xbm6
-rw-r--r--ext/tk/sample/images/tcllogo.gifbin0 -> 2341 bytes-rw-r--r--ext/tk/sample/images/teapot.ppm31
-rw-r--r--ext/tk/sample/irbtk.rb30
-rw-r--r--ext/tk/sample/irbtkw.rbw156
-rw-r--r--ext/tk/sample/iso2022-kr.txt2
-rw-r--r--ext/tk/sample/menubar1.rb51
-rw-r--r--ext/tk/sample/menubar2.rb56
-rw-r--r--ext/tk/sample/menubar3.rb72
-rw-r--r--ext/tk/sample/msgs_rb/README3
-rw-r--r--ext/tk/sample/msgs_rb/cs.msg84
-rw-r--r--ext/tk/sample/msgs_rb/de.msg88
-rw-r--r--ext/tk/sample/msgs_rb/el.msg98
-rw-r--r--ext/tk/sample/msgs_rb/en.msg83
-rw-r--r--ext/tk/sample/msgs_rb/en_gb.msg7
-rw-r--r--ext/tk/sample/msgs_rb/eo.msg87
-rw-r--r--ext/tk/sample/msgs_rb/es.msg84
-rw-r--r--ext/tk/sample/msgs_rb/fr.msg84
-rw-r--r--ext/tk/sample/msgs_rb/it.msg84
-rw-r--r--ext/tk/sample/msgs_rb/ja.msg13
-rw-r--r--ext/tk/sample/msgs_rb/nl.msg123
-rw-r--r--ext/tk/sample/msgs_rb/pl.msg87
-rw-r--r--ext/tk/sample/msgs_rb/ru.msg87
-rw-r--r--ext/tk/sample/msgs_rb2/README5
-rw-r--r--ext/tk/sample/msgs_rb2/de.msg88
-rw-r--r--ext/tk/sample/msgs_rb2/ja.msg85
-rw-r--r--ext/tk/sample/msgs_tk/README4
-rw-r--r--ext/tk/sample/msgs_tk/cs.msg84
-rw-r--r--ext/tk/sample/msgs_tk/de.msg88
-rw-r--r--ext/tk/sample/msgs_tk/el.msg103
-rw-r--r--ext/tk/sample/msgs_tk/en.msg83
-rw-r--r--ext/tk/sample/msgs_tk/en_gb.msg7
-rw-r--r--ext/tk/sample/msgs_tk/eo.msg87
-rw-r--r--ext/tk/sample/msgs_tk/es.msg84
-rw-r--r--ext/tk/sample/msgs_tk/fr.msg84
-rw-r--r--ext/tk/sample/msgs_tk/it.msg84
-rw-r--r--ext/tk/sample/msgs_tk/ja.msg13
-rw-r--r--ext/tk/sample/msgs_tk/license.terms39
-rw-r--r--ext/tk/sample/msgs_tk/nl.msg123
-rw-r--r--ext/tk/sample/msgs_tk/pl.msg87
-rw-r--r--ext/tk/sample/msgs_tk/ru.msg87
-rw-r--r--ext/tk/sample/multi-ip_sample.rb103
-rw-r--r--ext/tk/sample/multi-ip_sample2.rb29
-rw-r--r--ext/tk/sample/optobj_sample.rb67
-rw-r--r--ext/tk/sample/propagate.rb30
-rw-r--r--ext/tk/sample/remote-ip_sample.rb33
-rw-r--r--ext/tk/sample/remote-ip_sample2.rb56
-rw-r--r--ext/tk/sample/resource.en13
-rw-r--r--ext/tk/sample/resource.ja13
-rw-r--r--ext/tk/sample/safe-tk.rb134
-rw-r--r--ext/tk/sample/scrollframe.rb249
-rw-r--r--ext/tk/sample/tcltklib/batsu.gifbin0 -> 538 bytes-rw-r--r--ext/tk/sample/tcltklib/lines0.tcl42
-rw-r--r--ext/tk/sample/tcltklib/lines1.rb50
-rw-r--r--ext/tk/sample/tcltklib/lines2.rb54
-rw-r--r--ext/tk/sample/tcltklib/lines3.rb54
-rw-r--r--ext/tk/sample/tcltklib/lines4.rb54
-rw-r--r--ext/tk/sample/tcltklib/maru.gifbin0 -> 481 bytes-rw-r--r--ext/tk/sample/tcltklib/safeTk.rb22
-rw-r--r--ext/tk/sample/tcltklib/sample0.rb39
-rw-r--r--ext/tk/sample/tcltklib/sample1.rb634
-rw-r--r--ext/tk/sample/tcltklib/sample2.rb451
-rw-r--r--ext/tk/sample/tkalignbox.rb235
-rw-r--r--ext/tk/sample/tkballoonhelp.rb220
-rw-r--r--ext/tk/sample/tkbiff.rb155
-rw-r--r--ext/tk/sample/tkbrowse.rb79
-rw-r--r--ext/tk/sample/tkcombobox.rb497
-rw-r--r--ext/tk/sample/tkdialog.rb61
-rw-r--r--ext/tk/sample/tkextlib/ICONS/Orig_LICENSE.txt61
-rw-r--r--ext/tk/sample/tkextlib/ICONS/tkIcons195
-rw-r--r--ext/tk/sample/tkextlib/ICONS/tkIcons-sample.kde658
-rw-r--r--ext/tk/sample/tkextlib/ICONS/tkIcons.kde195
-rw-r--r--ext/tk/sample/tkextlib/ICONS/viewIcons.rb329
-rw-r--r--ext/tk/sample/tkextlib/blt/barchart5.rb101
-rw-r--r--ext/tk/sample/tkextlib/blt/calendar.rb117
-rw-r--r--ext/tk/sample/tkextlib/blt/graph6.rb2222
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7.rb40
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7a.rb63
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7b.rb41
-rw-r--r--ext/tk/sample/tkextlib/blt/graph7c.rb45
-rw-r--r--ext/tk/sample/tkextlib/blt/images/buckskin.gifbin0 -> 7561 bytes-rw-r--r--ext/tk/sample/tkextlib/blt/images/chalk.gifbin0 -> 4378 bytes-rw-r--r--ext/tk/sample/tkextlib/blt/images/qv100.t.gifbin0 -> 2694 bytes-rw-r--r--ext/tk/sample/tkextlib/blt/images/rain.gifbin0 -> 3785 bytes-rw-r--r--ext/tk/sample/tkextlib/blt/images/sample.gifbin0 -> 186103 bytes-rw-r--r--ext/tk/sample/tkextlib/blt/pareto.rb90
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1.rb9
-rw-r--r--ext/tk/sample/tkextlib/blt/plot1b.rb10
-rw-r--r--ext/tk/sample/tkextlib/blt/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/blt/scripts/stipples.rb156
-rw-r--r--ext/tk/sample/tkextlib/blt/winop1.rb40
-rw-r--r--ext/tk/sample/tkextlib/blt/winop2.rb28
-rw-r--r--ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt53
-rw-r--r--ext/tk/sample/tkextlib/bwidget/basic.rb198
-rw-r--r--ext/tk/sample/tkextlib/bwidget/bwidget.xbm46
-rw-r--r--ext/tk/sample/tkextlib/bwidget/demo.rb243
-rw-r--r--ext/tk/sample/tkextlib/bwidget/dnd.rb46
-rw-r--r--ext/tk/sample/tkextlib/bwidget/manager.rb150
-rw-r--r--ext/tk/sample/tkextlib/bwidget/select.rb82
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tmpldlg.rb221
-rw-r--r--ext/tk/sample/tkextlib/bwidget/tree.rb289
-rw-r--r--ext/tk/sample/tkextlib/bwidget/x1.xbm2258
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt42
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/box.xbm14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gifbin0 -> 279 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gifbin0 -> 249 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gifbin0 -> 269 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gifbin0 -> 179 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gifbin0 -> 396 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gifbin0 -> 386 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gifbin0 -> 591 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/line.xbm14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gifbin0 -> 183 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gifbin0 -> 212 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gifbin0 -> 258 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/oval.xbm14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gifbin0 -> 376 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/points.xbm14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gifbin0 -> 141 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gifbin0 -> 263 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gifbin0 -> 174 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gifbin0 -> 270 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gifbin0 -> 124 bytes-rw-r--r--ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/text.xbm14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb22
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb32
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb7
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb20
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb16
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb39
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb44
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb40
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb20
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb29
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb28
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb15
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb25
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb13
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb64
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb124
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb44
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb19
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb19
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb44
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb30
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb30
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb14
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb22
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb22
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb17
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb9
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb13
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb13
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb18
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb15
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb22
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb11
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb19
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb12
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/shell.rb17
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb7
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb10
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb33
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb7
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb26
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb30
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb34
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb7
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb8
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb152
-rw-r--r--ext/tk/sample/tkextlib/iwidgets/sample/watch.rb18
-rw-r--r--ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt46
-rw-r--r--ext/tk/sample/tkextlib/tcllib/datefield.rb29
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos1.rb158
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos2.rb71
-rw-r--r--ext/tk/sample/tkextlib/tcllib/plotdemos3.rb83
-rw-r--r--ext/tk/sample/tkextlib/tcllib/xyplot.rb17
-rw-r--r--ext/tk/sample/tkextlib/tile/Orig_LICENSE.txt30
-rw-r--r--ext/tk/sample/tkextlib/tile/demo.rb983
-rw-r--r--ext/tk/sample/tkextlib/tile/iconlib.tcl110
-rw-r--r--ext/tk/sample/tkextlib/tile/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/tile/repeater.tcl117
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl149
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gifbin0 -> 315 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gifbin0 -> 312 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gifbin0 -> 313 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gifbin0 -> 329 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gifbin0 -> 327 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gifbin0 -> 323 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gifbin0 -> 330 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gifbin0 -> 327 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gifbin0 -> 324 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gifbin0 -> 309 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gifbin0 -> 313 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gifbin0 -> 314 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gifbin0 -> 696 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gifbin0 -> 770 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcfbin0 -> 1942 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gifbin0 -> 769 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gifbin0 -> 254 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gifbin0 -> 234 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gifbin0 -> 249 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gifbin0 -> 229 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gifbin0 -> 1098 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gifbin0 -> 626 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gifbin0 -> 389 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gifbin0 -> 401 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gifbin0 -> 343 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gifbin0 -> 316 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gifbin0 -> 333 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gifbin0 -> 308 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gifbin0 -> 182 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gifbin0 -> 182 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gifbin0 -> 183 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gifbin0 -> 283 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl6
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl194
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gifbin0 -> 273 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gifbin0 -> 258 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gifbin0 -> 292 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gifbin0 -> 272 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gifbin0 -> 274 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gifbin0 -> 258 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gifbin0 -> 286 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gifbin0 -> 271 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gifbin0 -> 1266 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gifbin0 -> 896 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gifbin0 -> 881 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gifbin0 -> 625 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gifbin0 -> 859 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gifbin0 -> 434 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gifbin0 -> 423 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gifbin0 -> 401 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gifbin0 -> 395 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gifbin0 -> 592 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gifbin0 -> 1116 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gifbin0 -> 61 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gifbin0 -> 1057 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gifbin0 -> 1095 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gifbin0 -> 695 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gifbin0 -> 686 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gifbin0 -> 383 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gifbin0 -> 878 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gifbin0 -> 907 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gifbin0 -> 238 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gifbin0 -> 927 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gifbin0 -> 405 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gifbin0 -> 399 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gifbin0 -> 587 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl15
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc.rb226
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl163
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gifbin0 -> 522 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gifbin0 -> 554 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gifbin0 -> 548 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gifbin0 -> 281 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gifbin0 -> 273 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gifbin0 -> 303 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gifbin0 -> 294 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gifbin0 -> 652 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gifbin0 -> 644 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gifbin0 -> 632 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gifbin0 -> 621 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl15
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl16
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl125
-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gifbin0 -> 362 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gifbin0 -> 250 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gifbin0 -> 378 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gifbin0 -> 267 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gifbin0 -> 379 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gifbin0 -> 266 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gifbin0 -> 363 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gifbin0 -> 251 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gifbin0 -> 439 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gifbin0 -> 443 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gifbin0 -> 302 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gifbin0 -> 169 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gifbin0 -> 170 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gifbin0 -> 235 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gifbin0 -> 226 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gifbin0 -> 169 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gifbin0 -> 269 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gifbin0 -> 342 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gifbin0 -> 178 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gifbin0 -> 179 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gifbin0 -> 236 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gifbin0 -> 178 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gifbin0 -> 178 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gifbin0 -> 366 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gifbin0 -> 336 bytes-rw-r--r--ext/tk/sample/tkextlib/tile/toolbutton.tcl152
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/Orig_COPYRIGHT.txt12
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/README12
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/hv.rb313
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image1bin0 -> 8995 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image10bin0 -> 3095 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image11bin0 -> 1425 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image12bin0 -> 2468 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image13bin0 -> 4073 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image14bin0 -> 53 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image2bin0 -> 42 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image3bin0 -> 3473 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image4bin0 -> 1988 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image5bin0 -> 973 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image6bin0 -> 2184 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image7bin0 -> 2022 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image8bin0 -> 1186 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/image9bin0 -> 139 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page1/index.html115
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image1bin0 -> 1966 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image10bin0 -> 255 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image11bin0 -> 590 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image12bin0 -> 254 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image13bin0 -> 493 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image14bin0 -> 195 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image15bin0 -> 68 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image16bin0 -> 157 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image17bin0 -> 81 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image18bin0 -> 545 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image19bin0 -> 53 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image2bin0 -> 49 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image20bin0 -> 533 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image21bin0 -> 564 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image22bin0 -> 81 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image23bin0 -> 539 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image24bin0 -> 151 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image25bin0 -> 453 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image26bin0 -> 520 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image27bin0 -> 565 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image28bin0 -> 416 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image29bin0 -> 121 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image3bin0 -> 10835 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image30bin0 -> 663 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image31bin0 -> 78 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image32bin0 -> 556 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image33bin0 -> 598 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image34bin0 -> 496 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image35bin0 -> 724 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image36bin0 -> 404 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image37bin0 -> 124 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image38bin0 -> 8330 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image39bin0 -> 369 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image4bin0 -> 268 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image5bin0 -> 492 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image6bin0 -> 246 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image7bin0 -> 551 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image8bin0 -> 497 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/image9bin0 -> 492 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page2/index.html433
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image1bin0 -> 113 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image10bin0 -> 5088 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image11bin0 -> 4485 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image12bin0 -> 3579 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image13bin0 -> 5119 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image14bin0 -> 3603 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image2bin0 -> 74 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image3bin0 -> 681 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image4bin0 -> 3056 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image5bin0 -> 2297 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image6bin0 -> 79 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image7bin0 -> 1613 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image8bin0 -> 864 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/image9bin0 -> 2379 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page3/index.html2787
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image1bin0 -> 42 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image2bin0 -> 14343 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image3bin0 -> 17750 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image4bin0 -> 61 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image5bin0 -> 201 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image6bin0 -> 214 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image7bin0 -> 149 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image8bin0 -> 203 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/image9bin0 -> 1504 bytes-rw-r--r--ext/tk/sample/tkextlib/tkHTML/page4/index.html768
-rw-r--r--ext/tk/sample/tkextlib/tkHTML/ss.rb436
-rw-r--r--ext/tk/sample/tkextlib/tkimg/demo.rb1478
-rw-r--r--ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension41
-rw-r--r--ext/tk/sample/tkextlib/tkimg/readme.txt3
-rw-r--r--ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt52
-rw-r--r--ext/tk/sample/tkextlib/tktable/basic.rb60
-rw-r--r--ext/tk/sample/tkextlib/tktable/buttons.rb76
-rw-r--r--ext/tk/sample/tkextlib/tktable/command.rb89
-rw-r--r--ext/tk/sample/tkextlib/tktable/debug.rb101
-rw-r--r--ext/tk/sample/tkextlib/tktable/dynarows.rb99
-rw-r--r--ext/tk/sample/tkextlib/tktable/maxsize.rb67
-rw-r--r--ext/tk/sample/tkextlib/tktable/spreadsheet.rb137
-rw-r--r--ext/tk/sample/tkextlib/tktable/tcllogo.gifbin0 -> 2341 bytes-rw-r--r--ext/tk/sample/tkextlib/tktable/valid.rb88
-rw-r--r--ext/tk/sample/tkextlib/treectrl/bitmaps.rb76
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb1305
-rw-r--r--ext/tk/sample/tkextlib/treectrl/explorer.rb430
-rw-r--r--ext/tk/sample/tkextlib/treectrl/help.rb404
-rw-r--r--ext/tk/sample/tkextlib/treectrl/imovie.rb130
-rw-r--r--ext/tk/sample/tkextlib/treectrl/layout.rb159
-rw-r--r--ext/tk/sample/tkextlib/treectrl/mailwasher.rb269
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-folders.rb124
-rw-r--r--ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb448
-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/big-dll.gifbin0 -> 437 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/big-exe.gifbin0 -> 368 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/big-file.gifbin0 -> 466 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/big-folder.gifbin0 -> 459 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/big-txt.gifbin0 -> 392 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/checked.gifbin0 -> 78 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/file.gifbin0 -> 279 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gifbin0 -> 111 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/folder-open.gifbin0 -> 120 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gifbin0 -> 115 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gifbin0 -> 128 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/help-page.gifbin0 -> 132 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gifbin0 -> 5406 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gifbin0 -> 5912 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gifbin0 -> 4696 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gifbin0 -> 5783 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gifbin0 -> 3238 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gifbin0 -> 3509 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gifbin0 -> 2091 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gifbin0 -> 70 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gifbin0 -> 76 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-print.gifbin0 -> 124 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gifbin0 -> 68 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gifbin0 -> 71 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-search.gifbin0 -> 114 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/internet-security.gifbin0 -> 108 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gifbin0 -> 275 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gifbin0 -> 277 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gifbin0 -> 73 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gifbin0 -> 73 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gifbin0 -> 138 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gifbin0 -> 134 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gifbin0 -> 133 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gifbin0 -> 144 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gifbin0 -> 133 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gifbin0 -> 146 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gifbin0 -> 174 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gifbin0 -> 136 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gifbin0 -> 343 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gifbin0 -> 304 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gifbin0 -> 132 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gifbin0 -> 163 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gifbin0 -> 303 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gifbin0 -> 98 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/sky.gifbin0 -> 6454 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/small-dll.gifbin0 -> 311 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/small-exe.gifbin0 -> 115 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/small-file.gifbin0 -> 338 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/small-folder.gifbin0 -> 307 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/small-txt.gifbin0 -> 302 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/pics/unchecked.gifbin0 -> 72 bytes-rw-r--r--ext/tk/sample/tkextlib/treectrl/random.rb508
-rw-r--r--ext/tk/sample/tkextlib/treectrl/readme.txt2
-rw-r--r--ext/tk/sample/tkextlib/treectrl/www-options.rb303
-rw-r--r--ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt51
-rw-r--r--ext/tk/sample/tkextlib/vu/README.txt50
-rw-r--r--ext/tk/sample/tkextlib/vu/canvItems.rb90
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker.rb82
-rw-r--r--ext/tk/sample/tkextlib/vu/canvSticker2.rb101
-rw-r--r--ext/tk/sample/tkextlib/vu/dial_demo.rb113
-rw-r--r--ext/tk/sample/tkextlib/vu/m128_000.xbm174
-rw-r--r--ext/tk/sample/tkextlib/vu/oscilloscope.rb68
-rw-r--r--ext/tk/sample/tkextlib/vu/pie.rb56
-rw-r--r--ext/tk/sample/tkextlib/vu/vu_demo.rb67
-rw-r--r--ext/tk/sample/tkfrom.rb132
-rw-r--r--ext/tk/sample/tkhello.rb10
-rw-r--r--ext/tk/sample/tkline.rb47
-rw-r--r--ext/tk/sample/tkmenubutton.rb135
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb.rb102
-rw-r--r--ext/tk/sample/tkmsgcat-load_rb2.rb102
-rw-r--r--ext/tk/sample/tkmsgcat-load_tk.rb118
-rw-r--r--ext/tk/sample/tkmulticolumnlist.rb743
-rw-r--r--ext/tk/sample/tkmultilistbox.rb654
-rw-r--r--ext/tk/sample/tkmultilistframe.rb940
-rw-r--r--ext/tk/sample/tkoptdb-safeTk.rb73
-rw-r--r--ext/tk/sample/tkoptdb.rb106
-rw-r--r--ext/tk/sample/tkrttimer.rb77
-rw-r--r--ext/tk/sample/tksleep_sample.rb29
-rw-r--r--ext/tk/sample/tktextframe.rb281
-rw-r--r--ext/tk/sample/tktextio.rb1060
-rw-r--r--ext/tk/sample/tktimer.rb50
-rw-r--r--ext/tk/sample/tktimer2.rb47
-rw-r--r--ext/tk/sample/tktimer3.rb59
-rw-r--r--ext/tk/sample/tktree.rb103
-rw-r--r--ext/tk/sample/tktree.tcl305
-rw-r--r--ext/tk/sample/ttk_wrapper.rb154
-rw-r--r--ext/tk/stubs.c592
-rw-r--r--ext/tk/stubs.h33
-rw-r--r--ext/tk/tcltklib.c11058
-rw-r--r--ext/tk/tkutil/depend1
-rw-r--r--ext/tk/tkutil/extconf.rb11
-rw-r--r--ext/tk/tkutil/tkutil.c1870
-rw-r--r--ext/win32/extconf.rb3
-rw-r--r--ext/win32/lib/Win32API.rb34
-rw-r--r--ext/win32/lib/win32/importer.rb11
-rw-r--r--ext/win32/lib/win32/registry.rb61
-rw-r--r--ext/win32/lib/win32/resolv.rb323
-rw-r--r--ext/win32/lib/win32/resolv9x.rb253
-rw-r--r--ext/win32/lib/win32/sspi.rb3
-rw-r--r--ext/win32/resolv/extconf.rb3
-rw-r--r--ext/win32/resolv/resolv.c65
-rw-r--r--ext/win32ole/extconf.rb1
-rw-r--r--ext/win32ole/lib/win32ole.rb33
-rw-r--r--ext/win32ole/lib/win32ole/property.rb1
-rw-r--r--ext/win32ole/sample/excel1.rb10
-rw-r--r--ext/win32ole/sample/excel2.rb6
-rw-r--r--ext/win32ole/sample/excel3.rb10
-rw-r--r--ext/win32ole/sample/ie.rb3
-rw-r--r--ext/win32ole/sample/ieconst.rb1
-rw-r--r--ext/win32ole/sample/ienavi.rb7
-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.c602
-rw-r--r--ext/win32ole/win32ole.h22
-rw-r--r--ext/win32ole/win32ole_error.c4
-rw-r--r--ext/win32ole/win32ole_error.h5
-rw-r--r--ext/win32ole/win32ole_event.c110
-rw-r--r--ext/win32ole/win32ole_event.h2
-rw-r--r--ext/win32ole/win32ole_method.c106
-rw-r--r--ext/win32ole/win32ole_method.h3
-rw-r--r--ext/win32ole/win32ole_param.c70
-rw-r--r--ext/win32ole/win32ole_param.h2
-rw-r--r--ext/win32ole/win32ole_record.c49
-rw-r--r--ext/win32ole/win32ole_record.h2
-rw-r--r--ext/win32ole/win32ole_type.c36
-rw-r--r--ext/win32ole/win32ole_type.h2
-rw-r--r--ext/win32ole/win32ole_typelib.c34
-rw-r--r--ext/win32ole/win32ole_typelib.h2
-rw-r--r--ext/win32ole/win32ole_variable.c38
-rw-r--r--ext/win32ole/win32ole_variable.h2
-rw-r--r--ext/win32ole/win32ole_variant.c93
-rw-r--r--ext/win32ole/win32ole_variant.h8
-rw-r--r--ext/win32ole/win32ole_variant_m.c55
-rw-r--r--ext/win32ole/win32ole_variant_m.h2
-rw-r--r--ext/zlib/depend23
-rw-r--r--ext/zlib/extconf.rb82
-rw-r--r--ext/zlib/zlib.c575
-rw-r--r--ext/zlib/zlib.gemspec25
-rw-r--r--file.c1676
-rw-r--r--gc.c2980
-rw-r--r--gc.h15
-rw-r--r--gem_prelude.rb9
-rw-r--r--gems/bundled_gems10
-rw-r--r--golf_prelude.rb2
-rw-r--r--goruby.c10
-rw-r--r--hash.c1490
-rw-r--r--id_table.c303
-rw-r--r--id_table.h31
-rw-r--r--include/ruby/backward.h72
-rw-r--r--include/ruby/backward/classext.h2
-rw-r--r--include/ruby/backward/rubyio.h2
-rw-r--r--include/ruby/backward/rubysig.h2
-rw-r--r--include/ruby/backward/st.h2
-rw-r--r--include/ruby/backward/util.h2
-rw-r--r--include/ruby/debug.h1
-rw-r--r--include/ruby/defines.h123
-rw-r--r--include/ruby/encoding.h213
-rw-r--r--include/ruby/intern.h196
-rw-r--r--include/ruby/io.h53
-rw-r--r--include/ruby/missing.h43
-rw-r--r--include/ruby/onigmo.h935
-rw-r--r--include/ruby/oniguruma.h841
-rw-r--r--include/ruby/re.h1
-rw-r--r--include/ruby/ruby.h1523
-rw-r--r--include/ruby/st.h76
-rw-r--r--include/ruby/util.h15
-rw-r--r--include/ruby/version.h4
-rw-r--r--include/ruby/win32.h167
-rw-r--r--inits.c5
-rw-r--r--insns.def1306
-rw-r--r--internal.h1398
-rw-r--r--io.c2841
-rw-r--r--iseq.c2150
-rw-r--r--iseq.h259
-rw-r--r--lex.c.blt218
-rw-r--r--lib/.document24
-rw-r--r--lib/English.rb5
-rw-r--r--lib/abbrev.rb1
-rw-r--r--lib/base64.rb26
-rw-r--r--lib/benchmark.rb45
-rw-r--r--lib/cgi.rb3
-rw-r--r--lib/cgi/cookie.rb64
-rw-r--r--lib/cgi/core.rb28
-rw-r--r--lib/cgi/html.rb5
-rw-r--r--lib/cgi/session.rb29
-rw-r--r--lib/cgi/session/pstore.rb1
-rw-r--r--lib/cgi/util.rb55
-rw-r--r--lib/cmath.gemspec24
-rw-r--r--lib/cmath.rb225
-rw-r--r--lib/csv.gemspec21
-rw-r--r--lib/csv.rb512
-rw-r--r--lib/debug.rb26
-rw-r--r--lib/delegate.rb55
-rw-r--r--lib/drb.rb1
-rw-r--r--lib/drb/acl.rb11
-rw-r--r--lib/drb/drb.rb96
-rw-r--r--lib/drb/eq.rb1
-rw-r--r--lib/drb/extserv.rb1
-rw-r--r--lib/drb/extservm.rb6
-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.rb66
-rw-r--r--lib/drb/unix.rb7
-rw-r--r--lib/e2mmap.rb11
-rw-r--r--lib/erb.rb286
-rw-r--r--lib/fileutils.gemspec25
-rw-r--r--lib/fileutils.rb557
-rw-r--r--lib/find.rb7
-rw-r--r--lib/forwardable.rb107
-rw-r--r--lib/forwardable/impl.rb24
-rw-r--r--lib/getoptlong.rb25
-rw-r--r--lib/ipaddr.gemspec26
-rw-r--r--lib/ipaddr.rb110
-rw-r--r--lib/irb.rb95
-rw-r--r--lib/irb/cmd/chws.rb5
-rw-r--r--lib/irb/cmd/fork.rb3
-rw-r--r--lib/irb/cmd/help.rb3
-rw-r--r--lib/irb/cmd/load.rb7
-rw-r--r--lib/irb/cmd/nop.rb1
-rw-r--r--lib/irb/cmd/pushws.rb7
-rw-r--r--lib/irb/cmd/subirb.rb9
-rw-r--r--lib/irb/completion.rb1
-rw-r--r--lib/irb/context.rb3
-rw-r--r--lib/irb/ext/change-ws.rb1
-rw-r--r--lib/irb/ext/history.rb1
-rw-r--r--lib/irb/ext/loader.rb1
-rw-r--r--lib/irb/ext/math-mode.rb47
-rw-r--r--lib/irb/ext/multi-irb.rb2
-rw-r--r--lib/irb/ext/save-history.rb2
-rw-r--r--lib/irb/ext/tracer.rb1
-rw-r--r--lib/irb/ext/use-loader.rb1
-rw-r--r--lib/irb/ext/workspaces.rb1
-rw-r--r--lib/irb/extend-command.rb4
-rw-r--r--lib/irb/frame.rb1
-rw-r--r--lib/irb/help.rb1
-rw-r--r--lib/irb/init.rb36
-rw-r--r--lib/irb/input-method.rb1
-rw-r--r--lib/irb/inspector.rb1
-rw-r--r--lib/irb/lc/error.rb1
-rw-r--r--lib/irb/lc/help-message1
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb1
-rw-r--r--lib/irb/lc/ja/error.rb1
-rw-r--r--lib/irb/lc/ja/help-message1
-rw-r--r--lib/irb/locale.rb3
-rw-r--r--lib/irb/magic-file.rb3
-rw-r--r--lib/irb/notifier.rb7
-rw-r--r--lib/irb/output-method.rb3
-rw-r--r--lib/irb/ruby-lex.rb22
-rw-r--r--lib/irb/ruby-token.rb1
-rw-r--r--lib/irb/slex.rb3
-rw-r--r--lib/irb/src_encoding.rb7
-rw-r--r--lib/irb/version.rb1
-rw-r--r--lib/irb/workspace.rb27
-rw-r--r--lib/irb/ws-for-case-2.rb1
-rw-r--r--lib/irb/xmp.rb1
-rw-r--r--lib/logger.rb216
-rw-r--r--lib/mathn.rb191
-rw-r--r--lib/matrix.rb482
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb209
-rw-r--r--lib/matrix/lup_decomposition.rb3
-rw-r--r--lib/mkmf.rb307
-rw-r--r--lib/monitor.rb50
-rw-r--r--lib/mutex_m.rb6
-rw-r--r--lib/net/ftp.rb659
-rw-r--r--lib/net/http.rb277
-rw-r--r--lib/net/http/backward.rb1
-rw-r--r--lib/net/http/exceptions.rb1
-rw-r--r--lib/net/http/generic_request.rb14
-rw-r--r--lib/net/http/header.rb94
-rw-r--r--lib/net/http/proxy_delta.rb1
-rw-r--r--lib/net/http/request.rb1
-rw-r--r--lib/net/http/requests.rb1
-rw-r--r--lib/net/http/response.rb27
-rw-r--r--lib/net/http/responses.rb36
-rw-r--r--lib/net/http/status.rb83
-rw-r--r--lib/net/https.rb3
-rw-r--r--lib/net/imap.rb287
-rw-r--r--lib/net/pop.rb37
-rw-r--r--lib/net/protocol.rb76
-rw-r--r--lib/net/smtp.rb35
-rw-r--r--lib/net/telnet.rb763
-rw-r--r--lib/observer.rb3
-rw-r--r--lib/open-uri.rb52
-rw-r--r--lib/open3.rb54
-rw-r--r--lib/optionparser.rb1
-rw-r--r--lib/optparse.rb380
-rw-r--r--lib/optparse/ac.rb1
-rw-r--r--lib/optparse/date.rb1
-rw-r--r--lib/optparse/kwargs.rb17
-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.rb1
-rw-r--r--lib/ostruct.rb274
-rw-r--r--lib/pp.rb81
-rw-r--r--lib/prettyprint.rb8
-rw-r--r--lib/prime.rb134
-rw-r--r--lib/profile.rb1
-rw-r--r--lib/profiler.rb1
-rw-r--r--lib/pstore.rb23
-rw-r--r--lib/racc/parser.rb1
-rw-r--r--lib/racc/rdoc/grammar.en.rdoc32
-rw-r--r--lib/rake.rb78
-rw-r--r--lib/rake/alt_system.rb110
-rw-r--r--lib/rake/application.rb783
-rw-r--r--lib/rake/backtrace.rb23
-rw-r--r--lib/rake/clean.rb76
-rw-r--r--lib/rake/cloneable.rb16
-rw-r--r--lib/rake/contrib/.document (renamed from spec/mspec/spec/commands/fixtures/level2/three_spec.rb)0
-rw-r--r--lib/rake/contrib/compositepublisher.rb21
-rw-r--r--lib/rake/contrib/ftptools.rb137
-rw-r--r--lib/rake/contrib/publisher.rb81
-rw-r--r--lib/rake/contrib/rubyforgepublisher.rb18
-rw-r--r--lib/rake/contrib/sshpublisher.rb61
-rw-r--r--lib/rake/contrib/sys.rb4
-rw-r--r--lib/rake/cpu_counter.rb110
-rw-r--r--lib/rake/default_loader.rb14
-rw-r--r--lib/rake/dsl_definition.rb199
-rw-r--r--lib/rake/early_time.rb21
-rw-r--r--lib/rake/ext/core.rb25
-rw-r--r--lib/rake/ext/module.rb2
-rw-r--r--lib/rake/ext/pathname.rb25
-rw-r--r--lib/rake/ext/string.rb173
-rw-r--r--lib/rake/ext/time.rb15
-rw-r--r--lib/rake/file_creation_task.rb24
-rw-r--r--lib/rake/file_list.rb428
-rw-r--r--lib/rake/file_task.rb46
-rw-r--r--lib/rake/file_utils.rb128
-rw-r--r--lib/rake/file_utils_ext.rb144
-rw-r--r--lib/rake/gempackagetask.rb4
-rw-r--r--lib/rake/invocation_chain.rb56
-rw-r--r--lib/rake/invocation_exception_mixin.rb16
-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.rb38
-rw-r--r--lib/rake/packagetask.rb202
-rw-r--r--lib/rake/pathmap.rb3
-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.rb38
-rw-r--r--lib/rake/rake_test_loader.rb22
-rw-r--r--lib/rake/rdoctask.rb4
-rw-r--r--lib/rake/ruby182_test_unit_fix.rb29
-rw-r--r--lib/rake/rule_recursion_overflow_error.rb20
-rw-r--r--lib/rake/runtest.rb27
-rw-r--r--lib/rake/scope.rb42
-rw-r--r--lib/rake/task.rb383
-rw-r--r--lib/rake/task_argument_error.rb7
-rw-r--r--lib/rake/task_arguments.rb98
-rw-r--r--lib/rake/task_manager.rb310
-rw-r--r--lib/rake/tasklib.rb24
-rw-r--r--lib/rake/testtask.rb212
-rw-r--r--lib/rake/thread_history_display.rb48
-rw-r--r--lib/rake/thread_pool.rb164
-rw-r--r--lib/rake/trace_output.rb22
-rw-r--r--lib/rake/version.rb7
-rw-r--r--lib/rake/win32.rb56
-rw-r--r--lib/rbconfig/.document1
-rw-r--r--lib/rbconfig/datadir.rb13
-rw-r--r--lib/rdoc.rb9
-rw-r--r--lib/rdoc/.document1
-rw-r--r--lib/rdoc/alias.rb1
-rw-r--r--lib/rdoc/anon_class.rb1
-rw-r--r--lib/rdoc/any_method.rb14
-rw-r--r--lib/rdoc/attr.rb1
-rw-r--r--lib/rdoc/class_module.rb5
-rw-r--r--lib/rdoc/code_object.rb14
-rw-r--r--lib/rdoc/code_objects.rb1
-rw-r--r--lib/rdoc/comment.rb30
-rw-r--r--lib/rdoc/constant.rb5
-rw-r--r--lib/rdoc/context.rb38
-rw-r--r--lib/rdoc/context/section.rb9
-rw-r--r--lib/rdoc/cross_reference.rb1
-rw-r--r--lib/rdoc/encoding.rb119
-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.rb79
-rw-r--r--lib/rdoc/generator/json_index.rb53
-rw-r--r--lib/rdoc/generator/markup.rb1
-rw-r--r--lib/rdoc/generator/pot.rb1
-rw-r--r--lib/rdoc/generator/pot/message_extractor.rb1
-rw-r--r--lib/rdoc/generator/pot/po.rb5
-rw-r--r--lib/rdoc/generator/pot/po_entry.rb21
-rw-r--r--lib/rdoc/generator/ri.rb1
-rw-r--r--lib/rdoc/generator/template/darkfish/_footer.rhtml6
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml14
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml4
-rw-r--r--lib/rdoc/generator/template/darkfish/css/fonts.css167
-rw-r--r--lib/rdoc/generator/template/darkfish/css/rdoc.css611
-rw-r--r--lib/rdoc/generator/template/darkfish/fonts.css167
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js123
-rw-r--r--lib/rdoc/generator/template/darkfish/js/jquery.js4
-rw-r--r--lib/rdoc/generator/template/darkfish/js/search.js63
-rw-r--r--lib/rdoc/generator/template/darkfish/rdoc.css590
-rw-r--r--lib/rdoc/generator/template/json_index/js/navigation.js44
-rw-r--r--lib/rdoc/generator/template/json_index/js/searcher.js17
-rw-r--r--lib/rdoc/ghost_method.rb1
-rw-r--r--lib/rdoc/i18n.rb3
-rw-r--r--lib/rdoc/i18n/locale.rb3
-rw-r--r--lib/rdoc/i18n/text.rb9
-rw-r--r--lib/rdoc/include.rb1
-rw-r--r--lib/rdoc/known_classes.rb2
-rw-r--r--lib/rdoc/markdown.rb1503
-rw-r--r--lib/rdoc/markdown/entities.rb1
-rw-r--r--lib/rdoc/markdown/literals.rb416
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb420
-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.rb5
-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.rb23
-rw-r--r--lib/rdoc/markup/pre_process.rb18
-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.rb3
-rw-r--r--lib/rdoc/markup/to_html.rb23
-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.rb37
-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.rb3
-rw-r--r--lib/rdoc/mixin.rb1
-rw-r--r--lib/rdoc/normal_class.rb5
-rw-r--r--lib/rdoc/normal_module.rb1
-rw-r--r--lib/rdoc/options.rb62
-rw-r--r--lib/rdoc/parser.rb53
-rw-r--r--lib/rdoc/parser/c.rb135
-rw-r--r--lib/rdoc/parser/changelog.rb16
-rw-r--r--lib/rdoc/parser/markdown.rb1
-rw-r--r--lib/rdoc/parser/rd.rb1
-rw-r--r--lib/rdoc/parser/ripper_state_lex.rb605
-rw-r--r--lib/rdoc/parser/ruby.rb910
-rw-r--r--lib/rdoc/parser/ruby_tools.rb54
-rw-r--r--lib/rdoc/parser/simple.rb6
-rw-r--r--lib/rdoc/parser/text.rb1
-rw-r--r--lib/rdoc/rd.rb1
-rw-r--r--lib/rdoc/rd/block_parser.rb102
-rw-r--r--lib/rdoc/rd/inline.rb9
-rw-r--r--lib/rdoc/rd/inline_parser.rb314
-rw-r--r--lib/rdoc/rdoc.gemspec63
-rw-r--r--lib/rdoc/rdoc.rb61
-rw-r--r--lib/rdoc/require.rb1
-rw-r--r--lib/rdoc/ri.rb1
-rw-r--r--lib/rdoc/ri/driver.rb142
-rw-r--r--lib/rdoc/ri/formatter.rb1
-rw-r--r--lib/rdoc/ri/paths.rb4
-rw-r--r--lib/rdoc/ri/store.rb1
-rw-r--r--lib/rdoc/ri/task.rb71
-rw-r--r--lib/rdoc/ruby_lex.rb1377
-rw-r--r--lib/rdoc/ruby_token.rb460
-rw-r--r--lib/rdoc/rubygems_hook.rb13
-rw-r--r--lib/rdoc/servlet.rb13
-rw-r--r--lib/rdoc/single_class.rb5
-rw-r--r--lib/rdoc/stats.rb5
-rw-r--r--lib/rdoc/stats/normal.rb13
-rw-r--r--lib/rdoc/stats/quiet.rb1
-rw-r--r--lib/rdoc/stats/verbose.rb1
-rw-r--r--lib/rdoc/store.rb19
-rw-r--r--lib/rdoc/task.rb3
-rw-r--r--lib/rdoc/test_case.rb24
-rw-r--r--lib/rdoc/text.rb50
-rw-r--r--lib/rdoc/token_stream.rb75
-rw-r--r--lib/rdoc/tom_doc.rb3
-rw-r--r--lib/rdoc/top_level.rb1
-rw-r--r--lib/resolv-replace.rb2
-rw-r--r--lib/resolv.rb231
-rw-r--r--lib/rexml/attlistdecl.rb3
-rw-r--r--lib/rexml/attribute.rb3
-rw-r--r--lib/rexml/cdata.rb3
-rw-r--r--lib/rexml/child.rb1
-rw-r--r--lib/rexml/comment.rb4
-rw-r--r--lib/rexml/doctype.rb1
-rw-r--r--lib/rexml/document.rb5
-rw-r--r--lib/rexml/dtd/attlistdecl.rb1
-rw-r--r--lib/rexml/dtd/dtd.rb1
-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.rb27
-rw-r--r--lib/rexml/encoding.rb1
-rw-r--r--lib/rexml/entity.rb13
-rw-r--r--lib/rexml/formatters/default.rb3
-rw-r--r--lib/rexml/formatters/pretty.rb1
-rw-r--r--lib/rexml/formatters/transitive.rb1
-rw-r--r--lib/rexml/functions.rb41
-rw-r--r--lib/rexml/instruction.rb3
-rw-r--r--lib/rexml/light/node.rb1
-rw-r--r--lib/rexml/namespace.rb1
-rw-r--r--lib/rexml/node.rb3
-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.rb42
-rw-r--r--lib/rexml/quickpath.rb5
-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.rb5
-rw-r--r--lib/rexml/streamlistener.rb1
-rw-r--r--lib/rexml/syncenumerator.rb1
-rw-r--r--lib/rexml/text.rb5
-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.rb1
-rw-r--r--lib/rexml/xpath.rb1
-rw-r--r--lib/rexml/xpath_parser.rb103
-rw-r--r--lib/rinda/rinda.rb2
-rw-r--r--lib/rinda/ring.rb10
-rw-r--r--lib/rinda/tuplespace.rb5
-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.rb260
-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.rb3
-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.rb1
-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.rb9
-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.rb32
-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.rb7
-rw-r--r--lib/rss/xml-stylesheet.rb1
-rw-r--r--lib/rss/xml.rb1
-rw-r--r--lib/rss/xmlparser.rb1
-rw-r--r--lib/rss/xmlscanner.rb1
-rw-r--r--lib/rubygems.rb290
-rw-r--r--lib/rubygems/LICENSE.txt54
-rw-r--r--lib/rubygems/available_set.rb1
-rw-r--r--lib/rubygems/basic_specification.rb158
-rw-r--r--lib/rubygems/bundler_version_finder.rb96
-rw-r--r--lib/rubygems/command.rb26
-rw-r--r--lib/rubygems/command_manager.rb13
-rw-r--r--lib/rubygems/commands/build_command.rb5
-rw-r--r--lib/rubygems/commands/cert_command.rb38
-rw-r--r--lib/rubygems/commands/check_command.rb1
-rw-r--r--lib/rubygems/commands/cleanup_command.rb25
-rw-r--r--lib/rubygems/commands/contents_command.rb4
-rw-r--r--lib/rubygems/commands/dependency_command.rb45
-rw-r--r--lib/rubygems/commands/environment_command.rb8
-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.rb17
-rw-r--r--lib/rubygems/commands/install_command.rb50
-rw-r--r--lib/rubygems/commands/list_command.rb5
-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.rb11
-rw-r--r--lib/rubygems/commands/outdated_command.rb1
-rw-r--r--lib/rubygems/commands/owner_command.rb13
-rw-r--r--lib/rubygems/commands/pristine_command.rb50
-rw-r--r--lib/rubygems/commands/push_command.rb14
-rw-r--r--lib/rubygems/commands/query_command.rb48
-rw-r--r--lib/rubygems/commands/rdoc_command.rb1
-rw-r--r--lib/rubygems/commands/search_command.rb1
-rw-r--r--lib/rubygems/commands/server_command.rb1
-rw-r--r--lib/rubygems/commands/setup_command.rb246
-rw-r--r--lib/rubygems/commands/signin_command.rb33
-rw-r--r--lib/rubygems/commands/signout_command.rb33
-rw-r--r--lib/rubygems/commands/sources_command.rb5
-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.rb10
-rw-r--r--lib/rubygems/commands/unpack_command.rb25
-rw-r--r--lib/rubygems/commands/update_command.rb15
-rw-r--r--lib/rubygems/commands/which_command.rb3
-rw-r--r--lib/rubygems/commands/yank_command.rb39
-rw-r--r--lib/rubygems/compatibility.rb4
-rw-r--r--lib/rubygems/config_file.rb78
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb10
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb35
-rw-r--r--lib/rubygems/defaults.rb19
-rw-r--r--lib/rubygems/dependency.rb43
-rw-r--r--lib/rubygems/dependency_installer.rb17
-rw-r--r--lib/rubygems/dependency_list.rb12
-rw-r--r--lib/rubygems/deprecate.rb1
-rw-r--r--lib/rubygems/doctor.rb1
-rw-r--r--lib/rubygems/errors.rb48
-rw-r--r--lib/rubygems/exceptions.rb10
-rw-r--r--lib/rubygems/ext.rb1
-rw-r--r--lib/rubygems/ext/build_error.rb1
-rw-r--r--lib/rubygems/ext/builder.rb7
-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.rb36
-rw-r--r--lib/rubygems/ext/rake_builder.rb5
-rw-r--r--lib/rubygems/gem_runner.rb7
-rw-r--r--lib/rubygems/gemcutter_utilities.rb29
-rw-r--r--lib/rubygems/indexer.rb129
-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.rb86
-rw-r--r--lib/rubygems/installer.rb200
-rw-r--r--lib/rubygems/installer_test_case.rb16
-rw-r--r--lib/rubygems/local_remote_options.rb3
-rw-r--r--lib/rubygems/mock_gem_ui.rb1
-rw-r--r--lib/rubygems/name_tuple.rb3
-rw-r--r--lib/rubygems/package.rb83
-rw-r--r--lib/rubygems/package/digest_io.rb1
-rw-r--r--lib/rubygems/package/file_source.rb5
-rw-r--r--lib/rubygems/package/io_source.rb1
-rw-r--r--lib/rubygems/package/old.rb22
-rw-r--r--lib/rubygems/package/source.rb1
-rw-r--r--lib/rubygems/package/tar_header.rb25
-rw-r--r--lib/rubygems/package/tar_reader.rb2
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb9
-rw-r--r--lib/rubygems/package/tar_test_case.rb16
-rw-r--r--lib/rubygems/package/tar_writer.rb57
-rw-r--r--lib/rubygems/package_task.rb1
-rw-r--r--lib/rubygems/path_support.rb57
-rw-r--r--lib/rubygems/platform.rb8
-rw-r--r--lib/rubygems/psych_additions.rb3
-rw-r--r--lib/rubygems/psych_tree.rb1
-rw-r--r--lib/rubygems/rdoc.rb4
-rw-r--r--lib/rubygems/remote_fetcher.rb49
-rw-r--r--lib/rubygems/request.rb60
-rw-r--r--lib/rubygems/request/connection_pools.rb19
-rw-r--r--lib/rubygems/request/http_pool.rb10
-rw-r--r--lib/rubygems/request/https_pool.rb1
-rw-r--r--lib/rubygems/request_set.rb103
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb85
-rw-r--r--lib/rubygems/request_set/lockfile.rb525
-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.rb26
-rw-r--r--lib/rubygems/resolver.rb329
-rw-r--r--lib/rubygems/resolver/activation_request.rb26
-rw-r--r--lib/rubygems/resolver/api_set.rb3
-rw-r--r--lib/rubygems/resolver/api_specification.rb3
-rw-r--r--lib/rubygems/resolver/best_set.rb1
-rw-r--r--lib/rubygems/resolver/composed_set.rb1
-rw-r--r--lib/rubygems/resolver/conflict.rb2
-rw-r--r--lib/rubygems/resolver/current_set.rb1
-rw-r--r--lib/rubygems/resolver/dependency_request.rb6
-rw-r--r--lib/rubygems/resolver/git_set.rb1
-rw-r--r--lib/rubygems/resolver/git_specification.rb4
-rw-r--r--lib/rubygems/resolver/index_set.rb1
-rw-r--r--lib/rubygems/resolver/index_specification.rb1
-rw-r--r--lib/rubygems/resolver/installed_specification.rb1
-rw-r--r--lib/rubygems/resolver/installer_set.rb21
-rw-r--r--lib/rubygems/resolver/local_specification.rb1
-rw-r--r--lib/rubygems/resolver/lock_set.rb9
-rw-r--r--lib/rubygems/resolver/lock_specification.rb8
-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/delegates/resolution_state.rb50
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb80
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb222
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb35
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb65
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb61
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb62
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb60
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb125
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb45
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb35
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb125
-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.rb65
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb494
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb45
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/state.rb54
-rw-r--r--lib/rubygems/resolver/requirement_list.rb1
-rw-r--r--lib/rubygems/resolver/set.rb3
-rw-r--r--lib/rubygems/resolver/source_set.rb48
-rw-r--r--lib/rubygems/resolver/spec_specification.rb1
-rw-r--r--lib/rubygems/resolver/specification.rb3
-rw-r--r--lib/rubygems/resolver/stats.rb1
-rw-r--r--lib/rubygems/resolver/vendor_set.rb1
-rw-r--r--lib/rubygems/resolver/vendor_specification.rb1
-rw-r--r--lib/rubygems/safe_yaml.rb51
-rw-r--r--lib/rubygems/security.rb20
-rw-r--r--lib/rubygems/security/policies.rb1
-rw-r--r--lib/rubygems/security/policy.rb4
-rw-r--r--lib/rubygems/security/signer.rb5
-rw-r--r--lib/rubygems/security/trust_dir.rb3
-rw-r--r--lib/rubygems/security_option.rb43
-rw-r--r--lib/rubygems/server.rb84
-rw-r--r--lib/rubygems/source.rb22
-rw-r--r--lib/rubygems/source/git.rb14
-rw-r--r--lib/rubygems/source/installed.rb1
-rw-r--r--lib/rubygems/source/local.rb74
-rw-r--r--lib/rubygems/source/lock.rb6
-rw-r--r--lib/rubygems/source/specific_file.rb1
-rw-r--r--lib/rubygems/source/vendor.rb1
-rw-r--r--lib/rubygems/source_list.rb5
-rw-r--r--lib/rubygems/source_local.rb5
-rw-r--r--lib/rubygems/source_specific_file.rb6
-rw-r--r--lib/rubygems/spec_fetcher.rb11
-rw-r--r--lib/rubygems/specification.rb996
-rw-r--r--lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem14
-rw-r--r--lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem (renamed from lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem)0
-rw-r--r--lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem28
-rw-r--r--lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem20
-rw-r--r--lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem21
-rw-r--r--lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem25
-rw-r--r--lib/rubygems/stub_specification.rb186
-rw-r--r--lib/rubygems/syck_hack.rb1
-rw-r--r--lib/rubygems/test_case.rb213
-rw-r--r--lib/rubygems/test_utilities.rb39
-rw-r--r--lib/rubygems/text.rb23
-rw-r--r--lib/rubygems/uninstaller.rb3
-rw-r--r--lib/rubygems/uri_formatter.rb1
-rw-r--r--lib/rubygems/user_interaction.rb55
-rw-r--r--lib/rubygems/util.rb31
-rw-r--r--lib/rubygems/util/licenses.rb380
-rw-r--r--lib/rubygems/util/list.rb31
-rw-r--r--lib/rubygems/util/stringio.rb34
-rw-r--r--lib/rubygems/validator.rb7
-rw-r--r--lib/rubygems/version.rb94
-rw-r--r--lib/rubygems/version_option.rb8
-rw-r--r--lib/scanf.gemspec25
-rw-r--r--lib/scanf.rb14
-rw-r--r--lib/securerandom.rb325
-rw-r--r--lib/set.rb461
-rw-r--r--lib/shell.rb15
-rw-r--r--lib/shell/builtin-command.rb3
-rw-r--r--lib/shell/command-processor.rb5
-rw-r--r--lib/shell/error.rb1
-rw-r--r--lib/shell/filter.rb13
-rw-r--r--lib/shell/process-controller.rb21
-rw-r--r--lib/shell/system-command.rb5
-rw-r--r--lib/shell/version.rb1
-rw-r--r--lib/shellwords.rb28
-rw-r--r--lib/singleton.rb4
-rw-r--r--lib/sync.rb7
-rw-r--r--lib/tempfile.rb143
-rw-r--r--lib/thwait.rb4
-rw-r--r--lib/time.rb36
-rw-r--r--lib/timeout.rb42
-rw-r--r--lib/tmpdir.rb67
-rw-r--r--lib/tracer.rb4
-rw-r--r--lib/tsort.rb16
-rw-r--r--lib/ubygems.rb10
-rw-r--r--lib/un.rb32
-rw-r--r--lib/unicode_normalize/normalize.rb175
-rw-r--r--lib/unicode_normalize/tables.rb1170
-rw-r--r--lib/uri.rb3
-rw-r--r--lib/uri/common.rb62
-rw-r--r--lib/uri/ftp.rb9
-rw-r--r--lib/uri/generic.rb182
-rw-r--r--lib/uri/http.rb58
-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.rb30
-rw-r--r--lib/uri/rfc2396_parser.rb7
-rw-r--r--lib/uri/rfc3986_parser.rb104
-rw-r--r--lib/weakref.rb50
-rw-r--r--lib/webrick.rb3
-rw-r--r--lib/webrick/.document6
-rw-r--r--lib/webrick/accesslog.rb1
-rw-r--r--lib/webrick/cgi.rb5
-rw-r--r--lib/webrick/compat.rb1
-rw-r--r--lib/webrick/config.rb15
-rw-r--r--lib/webrick/cookie.rb3
-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.rb16
-rw-r--r--lib/webrick/httpauth/htdigest.rb9
-rw-r--r--lib/webrick/httpauth/htgroup.rb5
-rw-r--r--lib/webrick/httpauth/htpasswd.rb7
-rw-r--r--lib/webrick/httpauth/userdb.rb1
-rw-r--r--lib/webrick/httpproxy.rb17
-rw-r--r--lib/webrick/httprequest.rb30
-rw-r--r--lib/webrick/httpresponse.rb142
-rw-r--r--lib/webrick/https.rb66
-rw-r--r--lib/webrick/httpserver.rb8
-rw-r--r--lib/webrick/httpservlet.rb1
-rw-r--r--lib/webrick/httpservlet/abstract.rb3
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb5
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb6
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb3
-rw-r--r--lib/webrick/httpservlet/filehandler.rb74
-rw-r--r--lib/webrick/httpservlet/prochandler.rb1
-rw-r--r--lib/webrick/httpstatus.rb8
-rw-r--r--lib/webrick/httputils.rb4
-rw-r--r--lib/webrick/httpversion.rb1
-rw-r--r--lib/webrick/log.rb7
-rw-r--r--lib/webrick/server.rb172
-rw-r--r--lib/webrick/ssl.rb34
-rw-r--r--lib/webrick/utils.rb136
-rw-r--r--lib/webrick/version.rb3
-rw-r--r--lib/webrick/webrick.gemspec29
-rw-r--r--lib/xmlrpc.rb301
-rw-r--r--lib/xmlrpc/base64.rb62
-rw-r--r--lib/xmlrpc/client.rb614
-rw-r--r--lib/xmlrpc/config.rb42
-rw-r--r--lib/xmlrpc/create.rb286
-rw-r--r--lib/xmlrpc/datetime.rb129
-rw-r--r--lib/xmlrpc/marshal.rb66
-rw-r--r--lib/xmlrpc/parser.rb838
-rw-r--r--lib/xmlrpc/server.rb707
-rw-r--r--lib/xmlrpc/utils.rb171
-rw-r--r--lib/yaml.rb9
-rw-r--r--lib/yaml/dbm.rb1
-rw-r--r--lib/yaml/store.rb21
-rw-r--r--load.c412
-rw-r--r--localeinit.c98
-rw-r--r--main.c6
-rw-r--r--man/erb.120
-rw-r--r--man/goruby.14
-rw-r--r--man/irb.127
-rw-r--r--man/rake.1198
-rw-r--r--man/ri.1244
-rw-r--r--man/ruby.1230
-rw-r--r--marshal.c409
-rw-r--r--math.c369
-rw-r--r--method.h225
-rw-r--r--miniinit.c21
-rwxr-xr-xmisc/lldb_cruby.py177
-rw-r--r--misc/ruby-additional.el65
-rw-r--r--misc/ruby-electric.el304
-rw-r--r--misc/ruby-mode.el12
-rw-r--r--misc/ruby-style.el2
-rw-r--r--misc/test_lldb_cruby.rb36
-rw-r--r--missing/crypt.c546
-rw-r--r--missing/crypt.h248
-rw-r--r--missing/des_tables.c1616
-rw-r--r--missing/explicit_bzero.c88
-rw-r--r--missing/flock.c2
-rw-r--r--missing/lgamma_r.c2
-rw-r--r--missing/os2.c138
-rw-r--r--missing/setproctitle.c8
-rw-r--r--missing/stdbool.h20
-rw-r--r--missing/strerror.c2
-rw-r--r--missing/strlcat.c86
-rw-r--r--missing/strlcpy.c77
-rw-r--r--missing/strtol.c27
-rw-r--r--missing/tgamma.c55
-rw-r--r--nacl/GNUmakefile.in87
-rw-r--r--nacl/README.nacl34
-rw-r--r--nacl/create_nmf.rb70
-rw-r--r--nacl/dirent.h15
-rw-r--r--nacl/example.html150
-rw-r--r--nacl/ioctl.h7
-rwxr-xr-xnacl/nacl-config.rb61
-rw-r--r--nacl/package.rb109
-rw-r--r--nacl/pepper_main.c870
-rw-r--r--nacl/resource.h8
-rw-r--r--nacl/select.h7
-rw-r--r--nacl/signal.h6
-rw-r--r--nacl/stat.h10
-rw-r--r--nacl/unistd.h9
-rw-r--r--nacl/utime.h11
-rw-r--r--node.c847
-rw-r--r--node.h170
-rw-r--r--numeric.c3088
-rw-r--r--object.c1689
-rw-r--r--pack.c843
-rw-r--r--parse.y6747
-rw-r--r--prelude.rb150
-rw-r--r--probes.d6
-rw-r--r--probes_helper.h78
-rw-r--r--proc.c1674
-rw-r--r--process.c1785
-rw-r--r--random.c764
-rw-r--r--range.c266
-rw-r--r--rational.c1381
-rw-r--r--re.c793
-rw-r--r--regcomp.c759
-rw-r--r--regenc.c85
-rw-r--r--regenc.h138
-rw-r--r--regerror.c66
-rw-r--r--regexec.c1697
-rw-r--r--regint.h466
-rw-r--r--regparse.c1752
-rw-r--r--regparse.h63
-rw-r--r--regsyntax.c15
-rw-r--r--ruby-runner.c77
-rw-r--r--ruby.c990
-rw-r--r--ruby_assert.h54
-rw-r--r--ruby_atomic.h79
-rw-r--r--rubystub.c60
-rw-r--r--safe.c54
-rw-r--r--sample/cbreak.rb8
-rw-r--r--sample/delegate.rb2
-rw-r--r--sample/dir.rb2
-rw-r--r--sample/drb/dchats.rb1
-rw-r--r--sample/drb/dhasen.rb3
-rw-r--r--sample/drb/dlogd.rb3
-rw-r--r--sample/drb/dqueue.rb3
-rw-r--r--sample/drb/http0serv.rb5
-rw-r--r--sample/drb/name.rb5
-rw-r--r--sample/drb/old_tuplespace.rb2
-rw-r--r--sample/drb/ring_echo.rb1
-rw-r--r--sample/drb/simpletuple.rb2
-rw-r--r--sample/dualstack-httpd.rb1
-rw-r--r--sample/export.rb2
-rw-r--r--sample/exyacc.rb2
-rw-r--r--sample/iseq_loader.rb243
-rw-r--r--sample/list.rb2
-rw-r--r--sample/observ.rb1
-rw-r--r--sample/openssl/cipher.rb4
-rw-r--r--sample/philos.rb3
-rw-r--r--sample/pty/expect_sample.rb14
-rw-r--r--sample/pty/script.rb2
-rw-r--r--sample/pty/shl.rb47
-rw-r--r--sample/simple-bench.rb140
-rwxr-xr-xsample/test.rb2365
-rw-r--r--sample/timeout.rb2
-rw-r--r--sample/trick2013/README.md2
-rw-r--r--sample/trick2013/kinaba/remarks.markdown6
-rw-r--r--sample/trick2013/yhara/entry.rb2
-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--signal.c420
-rw-r--r--siphash.c12
-rw-r--r--siphash.h2
-rw-r--r--sparc.c2
-rw-r--r--spec/README31
-rw-r--r--spec/README.md79
-rw-r--r--spec/default.mspec60
-rw-r--r--spec/mspec/.gitignore26
-rw-r--r--spec/mspec/.travis.yml18
-rw-r--r--spec/mspec/Gemfile4
-rw-r--r--spec/mspec/Gemfile.lock24
-rw-r--r--spec/mspec/LICENSE22
-rw-r--r--spec/mspec/README.md91
-rw-r--r--spec/mspec/Rakefile7
-rwxr-xr-xspec/mspec/bin/mkspec7
-rwxr-xr-xspec/mspec/bin/mkspec.bat1
-rwxr-xr-xspec/mspec/bin/mspec7
-rwxr-xr-xspec/mspec/bin/mspec-ci7
-rwxr-xr-xspec/mspec/bin/mspec-ci.bat1
-rwxr-xr-xspec/mspec/bin/mspec-run7
-rwxr-xr-xspec/mspec/bin/mspec-run.bat1
-rwxr-xr-xspec/mspec/bin/mspec-tag7
-rwxr-xr-xspec/mspec/bin/mspec-tag.bat1
-rwxr-xr-xspec/mspec/bin/mspec.bat1
-rw-r--r--spec/mspec/lib/mspec.rb20
-rwxr-xr-xspec/mspec/lib/mspec/commands/mkspec.rb155
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-ci.rb78
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-run.rb86
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-tag.rb132
-rwxr-xr-xspec/mspec/lib/mspec/commands/mspec.rb178
-rw-r--r--spec/mspec/lib/mspec/expectations.rb2
-rw-r--r--spec/mspec/lib/mspec/expectations/expectations.rb21
-rw-r--r--spec/mspec/lib/mspec/expectations/should.rb29
-rw-r--r--spec/mspec/lib/mspec/guards.rb11
-rw-r--r--spec/mspec/lib/mspec/guards/block_device.rb16
-rw-r--r--spec/mspec/lib/mspec/guards/bug.rb28
-rw-r--r--spec/mspec/lib/mspec/guards/conflict.rb17
-rw-r--r--spec/mspec/lib/mspec/guards/endian.rb25
-rw-r--r--spec/mspec/lib/mspec/guards/feature.rb41
-rw-r--r--spec/mspec/lib/mspec/guards/guard.rb141
-rw-r--r--spec/mspec/lib/mspec/guards/platform.rb76
-rw-r--r--spec/mspec/lib/mspec/guards/quarantine.rb11
-rw-r--r--spec/mspec/lib/mspec/guards/superuser.rb15
-rw-r--r--spec/mspec/lib/mspec/guards/support.rb14
-rw-r--r--spec/mspec/lib/mspec/guards/version.rb37
-rw-r--r--spec/mspec/lib/mspec/helpers.rb14
-rw-r--r--spec/mspec/lib/mspec/helpers/argf.rb35
-rw-r--r--spec/mspec/lib/mspec/helpers/argv.rb44
-rw-r--r--spec/mspec/lib/mspec/helpers/datetime.rb47
-rw-r--r--spec/mspec/lib/mspec/helpers/fixture.rb24
-rw-r--r--spec/mspec/lib/mspec/helpers/flunk.rb3
-rw-r--r--spec/mspec/lib/mspec/helpers/frozen_error_class.rb17
-rw-r--r--spec/mspec/lib/mspec/helpers/fs.rb70
-rw-r--r--spec/mspec/lib/mspec/helpers/io.rb111
-rw-r--r--spec/mspec/lib/mspec/helpers/mock_to_path.rb6
-rw-r--r--spec/mspec/lib/mspec/helpers/numeric.rb70
-rw-r--r--spec/mspec/lib/mspec/helpers/ruby_exe.rb186
-rw-r--r--spec/mspec/lib/mspec/helpers/scratch.rb17
-rw-r--r--spec/mspec/lib/mspec/helpers/tmp.rb43
-rw-r--r--spec/mspec/lib/mspec/helpers/warning.rb7
-rw-r--r--spec/mspec/lib/mspec/matchers.rb35
-rw-r--r--spec/mspec/lib/mspec/matchers/base.rb107
-rw-r--r--spec/mspec/lib/mspec/matchers/be_an_instance_of.rb26
-rw-r--r--spec/mspec/lib/mspec/matchers/be_ancestor_of.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/be_close.rb27
-rw-r--r--spec/mspec/lib/mspec/matchers/be_computed_by.rb37
-rw-r--r--spec/mspec/lib/mspec/matchers/be_empty.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/be_false.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/be_kind_of.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/be_nan.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/be_nil.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/be_true.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/be_true_or_false.rb20
-rw-r--r--spec/mspec/lib/mspec/matchers/block_caller.rb35
-rw-r--r--spec/mspec/lib/mspec/matchers/complain.rb60
-rw-r--r--spec/mspec/lib/mspec/matchers/eql.rb26
-rw-r--r--spec/mspec/lib/mspec/matchers/equal.rb26
-rw-r--r--spec/mspec/lib/mspec/matchers/equal_element.rb78
-rw-r--r--spec/mspec/lib/mspec/matchers/have_class_variable.rb12
-rw-r--r--spec/mspec/lib/mspec/matchers/have_constant.rb12
-rw-r--r--spec/mspec/lib/mspec/matchers/have_instance_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_instance_variable.rb12
-rw-r--r--spec/mspec/lib/mspec/matchers/have_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_private_instance_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_private_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_protected_instance_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_public_instance_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/have_singleton_method.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/include.rb31
-rw-r--r--spec/mspec/lib/mspec/matchers/infinity.rb28
-rw-r--r--spec/mspec/lib/mspec/matchers/match_yaml.rb46
-rw-r--r--spec/mspec/lib/mspec/matchers/method.rb10
-rw-r--r--spec/mspec/lib/mspec/matchers/output.rb67
-rw-r--r--spec/mspec/lib/mspec/matchers/output_to_fd.rb71
-rw-r--r--spec/mspec/lib/mspec/matchers/raise_error.rb87
-rw-r--r--spec/mspec/lib/mspec/matchers/respond_to.rb24
-rw-r--r--spec/mspec/lib/mspec/matchers/signed_zero.rb28
-rw-r--r--spec/mspec/lib/mspec/matchers/variable.rb24
-rw-r--r--spec/mspec/lib/mspec/mocks.rb3
-rw-r--r--spec/mspec/lib/mspec/mocks/mock.rb198
-rw-r--r--spec/mspec/lib/mspec/mocks/object.rb28
-rw-r--r--spec/mspec/lib/mspec/mocks/proxy.rb186
-rw-r--r--spec/mspec/lib/mspec/runner.rb12
-rw-r--r--spec/mspec/lib/mspec/runner/actions.rb6
-rw-r--r--spec/mspec/lib/mspec/runner/actions/filter.rb40
-rw-r--r--spec/mspec/lib/mspec/runner/actions/leakchecker.rb301
-rw-r--r--spec/mspec/lib/mspec/runner/actions/tag.rb133
-rw-r--r--spec/mspec/lib/mspec/runner/actions/taglist.rb56
-rw-r--r--spec/mspec/lib/mspec/runner/actions/tagpurge.rb56
-rw-r--r--spec/mspec/lib/mspec/runner/actions/tally.rb133
-rw-r--r--spec/mspec/lib/mspec/runner/actions/timer.rb22
-rw-r--r--spec/mspec/lib/mspec/runner/context.rb239
-rw-r--r--spec/mspec/lib/mspec/runner/evaluate.rb54
-rw-r--r--spec/mspec/lib/mspec/runner/example.rb34
-rw-r--r--spec/mspec/lib/mspec/runner/exception.rb43
-rw-r--r--spec/mspec/lib/mspec/runner/filters.rb4
-rw-r--r--spec/mspec/lib/mspec/runner/filters/match.rb18
-rw-r--r--spec/mspec/lib/mspec/runner/filters/profile.rb54
-rw-r--r--spec/mspec/lib/mspec/runner/filters/regexp.rb7
-rw-r--r--spec/mspec/lib/mspec/runner/filters/tag.rb29
-rw-r--r--spec/mspec/lib/mspec/runner/formatters.rb12
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/describe.rb24
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/dotted.rb117
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/file.rb19
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/html.rb81
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/junit.rb88
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/method.rb93
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/multi.rb37
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/profile.rb70
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/specdoc.rb41
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/spinner.rb117
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/summary.rb11
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/unit.rb21
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/yaml.rb42
-rw-r--r--spec/mspec/lib/mspec/runner/mspec.rb408
-rw-r--r--spec/mspec/lib/mspec/runner/object.rb26
-rw-r--r--spec/mspec/lib/mspec/runner/shared.rb10
-rw-r--r--spec/mspec/lib/mspec/runner/tag.rb38
-rw-r--r--spec/mspec/lib/mspec/utils/deprecate.rb6
-rw-r--r--spec/mspec/lib/mspec/utils/name_map.rb128
-rw-r--r--spec/mspec/lib/mspec/utils/options.rb481
-rw-r--r--spec/mspec/lib/mspec/utils/script.rb274
-rw-r--r--spec/mspec/lib/mspec/utils/version.rb52
-rw-r--r--spec/mspec/lib/mspec/utils/warnings.rb61
-rw-r--r--spec/mspec/lib/mspec/version.rb5
-rw-r--r--spec/mspec/spec/commands/fixtures/four.txt0
-rw-r--r--spec/mspec/spec/commands/fixtures/one_spec.rb1
-rw-r--r--spec/mspec/spec/commands/fixtures/three.rb1
-rw-r--r--spec/mspec/spec/commands/fixtures/two_spec.rb1
-rw-r--r--spec/mspec/spec/commands/mkspec_spec.rb363
-rw-r--r--spec/mspec/spec/commands/mspec_ci_spec.rb150
-rw-r--r--spec/mspec/spec/commands/mspec_run_spec.rb173
-rw-r--r--spec/mspec/spec/commands/mspec_spec.rb207
-rw-r--r--spec/mspec/spec/commands/mspec_tag_spec.rb414
-rw-r--r--spec/mspec/spec/expectations/expectations_spec.rb29
-rw-r--r--spec/mspec/spec/expectations/should.rb73
-rw-r--r--spec/mspec/spec/expectations/should_spec.rb61
-rw-r--r--spec/mspec/spec/fixtures/a_spec.rb15
-rw-r--r--spec/mspec/spec/fixtures/b_spec.rb7
-rw-r--r--spec/mspec/spec/fixtures/config.mspec10
-rwxr-xr-xspec/mspec/spec/fixtures/my_ruby4
-rw-r--r--spec/mspec/spec/fixtures/object_methods_spec.rb8
-rw-r--r--spec/mspec/spec/fixtures/print_interpreter_spec.rb4
-rw-r--r--spec/mspec/spec/fixtures/tagging_spec.rb16
-rw-r--r--spec/mspec/spec/guards/block_device_spec.rb46
-rw-r--r--spec/mspec/spec/guards/bug_spec.rb151
-rw-r--r--spec/mspec/spec/guards/conflict_spec.rb51
-rw-r--r--spec/mspec/spec/guards/endian_spec.rb55
-rw-r--r--spec/mspec/spec/guards/feature_spec.rb80
-rw-r--r--spec/mspec/spec/guards/guard_spec.rb421
-rw-r--r--spec/mspec/spec/guards/platform_spec.rb328
-rw-r--r--spec/mspec/spec/guards/quarantine_spec.rb35
-rw-r--r--spec/mspec/spec/guards/superuser_spec.rb35
-rw-r--r--spec/mspec/spec/guards/support_spec.rb54
-rw-r--r--spec/mspec/spec/guards/user_spec.rb20
-rw-r--r--spec/mspec/spec/guards/version_spec.rb90
-rw-r--r--spec/mspec/spec/helpers/argf_spec.rb37
-rw-r--r--spec/mspec/spec/helpers/argv_spec.rb27
-rw-r--r--spec/mspec/spec/helpers/datetime_spec.rb44
-rw-r--r--spec/mspec/spec/helpers/fixture_spec.rb25
-rw-r--r--spec/mspec/spec/helpers/flunk_spec.rb20
-rw-r--r--spec/mspec/spec/helpers/fs_spec.rb195
-rw-r--r--spec/mspec/spec/helpers/io_spec.rb174
-rw-r--r--spec/mspec/spec/helpers/mock_to_path_spec.rb17
-rw-r--r--spec/mspec/spec/helpers/numeric_spec.rb25
-rw-r--r--spec/mspec/spec/helpers/ruby_exe_spec.rb197
-rw-r--r--spec/mspec/spec/helpers/scratch_spec.rb24
-rw-r--r--spec/mspec/spec/helpers/suppress_warning_spec.rb19
-rw-r--r--spec/mspec/spec/helpers/tmp_spec.rb27
-rw-r--r--spec/mspec/spec/integration/interpreter_spec.rb18
-rw-r--r--spec/mspec/spec/integration/object_methods_spec.rb18
-rw-r--r--spec/mspec/spec/integration/run_spec.rb52
-rw-r--r--spec/mspec/spec/integration/tag_spec.rb63
-rw-r--r--spec/mspec/spec/matchers/base_spec.rb225
-rw-r--r--spec/mspec/spec/matchers/be_an_instance_of_spec.rb50
-rw-r--r--spec/mspec/spec/matchers/be_ancestor_of_spec.rb28
-rw-r--r--spec/mspec/spec/matchers/be_close_spec.rb46
-rw-r--r--spec/mspec/spec/matchers/be_computed_by_spec.rb42
-rw-r--r--spec/mspec/spec/matchers/be_empty_spec.rb26
-rw-r--r--spec/mspec/spec/matchers/be_false_spec.rb28
-rw-r--r--spec/mspec/spec/matchers/be_kind_of_spec.rb31
-rw-r--r--spec/mspec/spec/matchers/be_nan_spec.rb28
-rw-r--r--spec/mspec/spec/matchers/be_nil_spec.rb27
-rw-r--r--spec/mspec/spec/matchers/be_true_or_false_spec.rb19
-rw-r--r--spec/mspec/spec/matchers/be_true_spec.rb28
-rw-r--r--spec/mspec/spec/matchers/block_caller_spec.rb13
-rw-r--r--spec/mspec/spec/matchers/complain_spec.rb52
-rw-r--r--spec/mspec/spec/matchers/eql_spec.rb33
-rw-r--r--spec/mspec/spec/matchers/equal_element_spec.rb75
-rw-r--r--spec/mspec/spec/matchers/equal_spec.rb32
-rw-r--r--spec/mspec/spec/matchers/have_class_variable_spec.rb49
-rw-r--r--spec/mspec/spec/matchers/have_constant_spec.rb37
-rw-r--r--spec/mspec/spec/matchers/have_instance_method_spec.rb53
-rw-r--r--spec/mspec/spec/matchers/have_instance_variable_spec.rb50
-rw-r--r--spec/mspec/spec/matchers/have_method_spec.rb55
-rw-r--r--spec/mspec/spec/matchers/have_private_instance_method_spec.rb57
-rw-r--r--spec/mspec/spec/matchers/have_private_method_spec.rb44
-rw-r--r--spec/mspec/spec/matchers/have_protected_instance_method_spec.rb57
-rw-r--r--spec/mspec/spec/matchers/have_public_instance_method_spec.rb53
-rw-r--r--spec/mspec/spec/matchers/have_singleton_method_spec.rb45
-rw-r--r--spec/mspec/spec/matchers/include_spec.rb37
-rw-r--r--spec/mspec/spec/matchers/infinity_spec.rb34
-rw-r--r--spec/mspec/spec/matchers/match_yaml_spec.rb39
-rw-r--r--spec/mspec/spec/matchers/output_spec.rb74
-rw-r--r--spec/mspec/spec/matchers/output_to_fd_spec.rb44
-rw-r--r--spec/mspec/spec/matchers/raise_error_spec.rb120
-rw-r--r--spec/mspec/spec/matchers/respond_to_spec.rb33
-rw-r--r--spec/mspec/spec/matchers/signed_zero_spec.rb32
-rw-r--r--spec/mspec/spec/mocks/mock_spec.rb467
-rw-r--r--spec/mspec/spec/mocks/proxy_spec.rb405
-rw-r--r--spec/mspec/spec/runner/actions/filter_spec.rb84
-rw-r--r--spec/mspec/spec/runner/actions/tag_spec.rb315
-rw-r--r--spec/mspec/spec/runner/actions/taglist_spec.rb152
-rw-r--r--spec/mspec/spec/runner/actions/tagpurge_spec.rb154
-rw-r--r--spec/mspec/spec/runner/actions/tally_spec.rb352
-rw-r--r--spec/mspec/spec/runner/actions/timer_spec.rb44
-rw-r--r--spec/mspec/spec/runner/context_spec.rb1041
-rw-r--r--spec/mspec/spec/runner/example_spec.rb117
-rw-r--r--spec/mspec/spec/runner/exception_spec.rb146
-rw-r--r--spec/mspec/spec/runner/filters/a.yaml4
-rw-r--r--spec/mspec/spec/runner/filters/b.yaml11
-rw-r--r--spec/mspec/spec/runner/filters/match_spec.rb34
-rw-r--r--spec/mspec/spec/runner/filters/profile_spec.rb117
-rw-r--r--spec/mspec/spec/runner/filters/regexp_spec.rb13
-rw-r--r--spec/mspec/spec/runner/filters/tag_spec.rb92
-rw-r--r--spec/mspec/spec/runner/formatters/describe_spec.rb67
-rw-r--r--spec/mspec/spec/runner/formatters/dotted_spec.rb285
-rw-r--r--spec/mspec/spec/runner/formatters/file_spec.rb84
-rw-r--r--spec/mspec/spec/runner/formatters/html_spec.rb216
-rw-r--r--spec/mspec/spec/runner/formatters/junit_spec.rb147
-rw-r--r--spec/mspec/spec/runner/formatters/method_spec.rb178
-rw-r--r--spec/mspec/spec/runner/formatters/multi_spec.rb68
-rw-r--r--spec/mspec/spec/runner/formatters/specdoc_spec.rb106
-rw-r--r--spec/mspec/spec/runner/formatters/spinner_spec.rb83
-rw-r--r--spec/mspec/spec/runner/formatters/summary_spec.rb26
-rw-r--r--spec/mspec/spec/runner/formatters/unit_spec.rb74
-rw-r--r--spec/mspec/spec/runner/formatters/yaml_spec.rb125
-rw-r--r--spec/mspec/spec/runner/mspec_spec.rb595
-rw-r--r--spec/mspec/spec/runner/shared_spec.rb90
-rw-r--r--spec/mspec/spec/runner/tag_spec.rb123
-rw-r--r--spec/mspec/spec/runner/tags.txt4
-rw-r--r--spec/mspec/spec/spec_helper.rb55
-rw-r--r--spec/mspec/spec/utils/deprecate_spec.rb17
-rw-r--r--spec/mspec/spec/utils/name_map_spec.rb175
-rw-r--r--spec/mspec/spec/utils/options_spec.rb1285
-rw-r--r--spec/mspec/spec/utils/script_spec.rb475
-rw-r--r--spec/mspec/spec/utils/version_spec.rb45
-rwxr-xr-xspec/mspec/tool/find.rb10
-rw-r--r--spec/mspec/tool/remove_old_guards.rb41
-rw-r--r--spec/mspec/tool/sync/.gitignore4
-rw-r--r--spec/mspec/tool/sync/sync-rubyspec.rb240
-rw-r--r--spec/ruby/.gitignore5
-rw-r--r--spec/ruby/.rubocop.yml60
-rw-r--r--spec/ruby/.rubocop_todo.yml207
-rw-r--r--spec/ruby/.travis.yml36
-rw-r--r--spec/ruby/CHANGES.before-2008-05-1017796
-rw-r--r--spec/ruby/CONTRIBUTING.md171
-rw-r--r--spec/ruby/LICENSE22
-rw-r--r--spec/ruby/README.md97
-rw-r--r--spec/ruby/TODO8
-rw-r--r--spec/ruby/appveyor.yml30
-rw-r--r--spec/ruby/command_line/dash_a_spec.rb17
-rw-r--r--spec/ruby/command_line/dash_c_spec.rb13
-rw-r--r--spec/ruby/command_line/dash_d_spec.rb22
-rw-r--r--spec/ruby/command_line/dash_e_spec.rb41
-rw-r--r--spec/ruby/command_line/dash_n_spec.rb34
-rw-r--r--spec/ruby/command_line/dash_p_spec.rb17
-rw-r--r--spec/ruby/command_line/dash_r_spec.rb13
-rw-r--r--spec/ruby/command_line/dash_s_spec.rb52
-rw-r--r--spec/ruby/command_line/dash_upper_c_spec.rb18
-rw-r--r--spec/ruby/command_line/dash_upper_e_spec.rb7
-rw-r--r--spec/ruby/command_line/dash_upper_f_spec.rb11
-rw-r--r--spec/ruby/command_line/dash_upper_i_spec.rb11
-rw-r--r--spec/ruby/command_line/dash_upper_k_spec.rb33
-rw-r--r--spec/ruby/command_line/dash_upper_s_spec.rb29
-rw-r--r--spec/ruby/command_line/dash_upper_u_spec.rb41
-rw-r--r--spec/ruby/command_line/dash_upper_w_spec.rb20
-rw-r--r--spec/ruby/command_line/dash_v_spec.rb12
-rw-r--r--spec/ruby/command_line/dash_w_spec.rb6
-rw-r--r--spec/ruby/command_line/dash_x_spec.rb21
-rw-r--r--spec/ruby/command_line/error_message_spec.rb11
-rw-r--r--spec/ruby/command_line/fixtures/bad_syntax.rb1
-rw-r--r--spec/ruby/command_line/fixtures/bin/bad_embedded_ruby.txt3
-rw-r--r--spec/ruby/command_line/fixtures/bin/dash_s_fail1
-rw-r--r--spec/ruby/command_line/fixtures/bin/embedded_ruby.txt3
-rw-r--r--spec/ruby/command_line/fixtures/bin/hybrid_launcher.sh4
-rw-r--r--spec/ruby/command_line/fixtures/bin/launcher.rb2
-rw-r--r--spec/ruby/command_line/fixtures/conditional_range.txt5
-rw-r--r--spec/ruby/command_line/fixtures/dash_s_script.rb12
-rw-r--r--spec/ruby/command_line/fixtures/dash_upper_c_script.rb1
-rw-r--r--spec/ruby/command_line/fixtures/debug.rb10
-rw-r--r--spec/ruby/command_line/fixtures/debug_info.rb11
-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_across_files.rb3
-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_across_files_diff_enc.rb3
-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_one_literal.rb2
-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_required.rb1
-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_required_diff_enc.rbbin121 -> 0 bytes-rw-r--r--spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb1
-rw-r--r--spec/ruby/command_line/fixtures/full_names.txt3
-rw-r--r--spec/ruby/command_line/fixtures/loadpath.rb1
-rw-r--r--spec/ruby/command_line/fixtures/names.txt3
-rw-r--r--spec/ruby/command_line/fixtures/passwd_file.txt3
-rw-r--r--spec/ruby/command_line/fixtures/require.rb1
-rw-r--r--spec/ruby/command_line/fixtures/rubyopt.rb1
-rw-r--r--spec/ruby/command_line/fixtures/test_file.rb1
-rw-r--r--spec/ruby/command_line/fixtures/verbose.rb1
-rw-r--r--spec/ruby/command_line/frozen_strings_spec.rb30
-rw-r--r--spec/ruby/command_line/rubyopt_spec.rb165
-rw-r--r--spec/ruby/command_line/shared/verbose.rb9
-rw-r--r--spec/ruby/command_line/syntax_error_spec.rb13
-rw-r--r--spec/ruby/core/argf/argf_spec.rb11
-rw-r--r--spec/ruby/core/argf/argv_spec.rb19
-rw-r--r--spec/ruby/core/argf/binmode_spec.rb43
-rw-r--r--spec/ruby/core/argf/bytes_spec.rb6
-rw-r--r--spec/ruby/core/argf/chars_spec.rb6
-rw-r--r--spec/ruby/core/argf/close_spec.rb46
-rw-r--r--spec/ruby/core/argf/closed_spec.rb18
-rw-r--r--spec/ruby/core/argf/codepoints_spec.rb6
-rw-r--r--spec/ruby/core/argf/each_byte_spec.rb6
-rw-r--r--spec/ruby/core/argf/each_char_spec.rb6
-rw-r--r--spec/ruby/core/argf/each_codepoint_spec.rb6
-rw-r--r--spec/ruby/core/argf/each_line_spec.rb6
-rw-r--r--spec/ruby/core/argf/each_spec.rb6
-rw-r--r--spec/ruby/core/argf/eof_spec.rb10
-rw-r--r--spec/ruby/core/argf/file_spec.rb21
-rw-r--r--spec/ruby/core/argf/filename_spec.rb6
-rw-r--r--spec/ruby/core/argf/fileno_spec.rb6
-rw-r--r--spec/ruby/core/argf/fixtures/bin_file.txt2
-rw-r--r--spec/ruby/core/argf/fixtures/file1.txt2
-rw-r--r--spec/ruby/core/argf/fixtures/file2.txt2
-rw-r--r--spec/ruby/core/argf/fixtures/filename.rb3
-rw-r--r--spec/ruby/core/argf/fixtures/lineno.rb5
-rw-r--r--spec/ruby/core/argf/fixtures/rewind.rb5
-rw-r--r--spec/ruby/core/argf/fixtures/stdin.txt2
-rw-r--r--spec/ruby/core/argf/getc_spec.rb20
-rw-r--r--spec/ruby/core/argf/gets_spec.rb51
-rw-r--r--spec/ruby/core/argf/lineno_spec.rb30
-rw-r--r--spec/ruby/core/argf/lines_spec.rb6
-rw-r--r--spec/ruby/core/argf/path_spec.rb6
-rw-r--r--spec/ruby/core/argf/pos_spec.rb38
-rw-r--r--spec/ruby/core/argf/read_nonblock_spec.rb82
-rw-r--r--spec/ruby/core/argf/read_spec.rb87
-rw-r--r--spec/ruby/core/argf/readchar_spec.rb19
-rw-r--r--spec/ruby/core/argf/readline_spec.rb23
-rw-r--r--spec/ruby/core/argf/readlines_spec.rb6
-rw-r--r--spec/ruby/core/argf/readpartial_spec.rb77
-rw-r--r--spec/ruby/core/argf/rewind_spec.rb39
-rw-r--r--spec/ruby/core/argf/seek_spec.rb63
-rw-r--r--spec/ruby/core/argf/set_encoding_spec.rb41
-rw-r--r--spec/ruby/core/argf/shared/each_byte.rb58
-rw-r--r--spec/ruby/core/argf/shared/each_char.rb58
-rw-r--r--spec/ruby/core/argf/shared/each_codepoint.rb58
-rw-r--r--spec/ruby/core/argf/shared/each_line.rb62
-rw-r--r--spec/ruby/core/argf/shared/eof.rb24
-rw-r--r--spec/ruby/core/argf/shared/filename.rb28
-rw-r--r--spec/ruby/core/argf/shared/fileno.rb24
-rw-r--r--spec/ruby/core/argf/shared/getc.rb17
-rw-r--r--spec/ruby/core/argf/shared/gets.rb99
-rw-r--r--spec/ruby/core/argf/shared/pos.rb31
-rw-r--r--spec/ruby/core/argf/shared/read.rb58
-rw-r--r--spec/ruby/core/argf/shared/readlines.rb22
-rw-r--r--spec/ruby/core/argf/skip_spec.rb42
-rw-r--r--spec/ruby/core/argf/tell_spec.rb6
-rw-r--r--spec/ruby/core/argf/to_a_spec.rb6
-rw-r--r--spec/ruby/core/argf/to_i_spec.rb6
-rw-r--r--spec/ruby/core/argf/to_io_spec.rb23
-rw-r--r--spec/ruby/core/argf/to_s_spec.rb14
-rw-r--r--spec/ruby/core/array/allocate_spec.rb19
-rw-r--r--spec/ruby/core/array/any_spec.rb37
-rw-r--r--spec/ruby/core/array/append_spec.rb42
-rw-r--r--spec/ruby/core/array/array_spec.rb7
-rw-r--r--spec/ruby/core/array/assoc_spec.rb40
-rw-r--r--spec/ruby/core/array/at_spec.rb56
-rw-r--r--spec/ruby/core/array/bsearch_index_spec.rb87
-rw-r--r--spec/ruby/core/array/bsearch_spec.rb84
-rw-r--r--spec/ruby/core/array/clear_spec.rb49
-rw-r--r--spec/ruby/core/array/clone_spec.rb31
-rw-r--r--spec/ruby/core/array/collect_spec.rb11
-rw-r--r--spec/ruby/core/array/combination_spec.rb74
-rw-r--r--spec/ruby/core/array/compact_spec.rb77
-rw-r--r--spec/ruby/core/array/comparison_spec.rb97
-rw-r--r--spec/ruby/core/array/concat_spec.rb132
-rw-r--r--spec/ruby/core/array/constructor_spec.rb24
-rw-r--r--spec/ruby/core/array/count_spec.rb15
-rw-r--r--spec/ruby/core/array/cycle_spec.rb101
-rw-r--r--spec/ruby/core/array/delete_at_spec.rb61
-rw-r--r--spec/ruby/core/array/delete_if_spec.rb66
-rw-r--r--spec/ruby/core/array/delete_spec.rb66
-rw-r--r--spec/ruby/core/array/dig_spec.rb54
-rw-r--r--spec/ruby/core/array/drop_spec.rb33
-rw-r--r--spec/ruby/core/array/drop_while_spec.rb15
-rw-r--r--spec/ruby/core/array/dup_spec.rb31
-rw-r--r--spec/ruby/core/array/each_index_spec.rb42
-rw-r--r--spec/ruby/core/array/each_spec.rb32
-rw-r--r--spec/ruby/core/array/element_reference_spec.rb50
-rw-r--r--spec/ruby/core/array/element_set_spec.rb417
-rw-r--r--spec/ruby/core/array/empty_spec.rb10
-rw-r--r--spec/ruby/core/array/eql_spec.rb19
-rw-r--r--spec/ruby/core/array/equal_value_spec.rb51
-rw-r--r--spec/ruby/core/array/fetch_spec.rb55
-rw-r--r--spec/ruby/core/array/fill_spec.rb317
-rw-r--r--spec/ruby/core/array/find_index_spec.rb6
-rw-r--r--spec/ruby/core/array/first_spec.rb93
-rw-r--r--spec/ruby/core/array/fixtures/classes.rb525
-rw-r--r--spec/ruby/core/array/fixtures/encoded_strings.rb69
-rw-r--r--spec/ruby/core/array/flatten_spec.rb286
-rw-r--r--spec/ruby/core/array/frozen_spec.rb16
-rw-r--r--spec/ruby/core/array/hash_spec.rb83
-rw-r--r--spec/ruby/core/array/include_spec.rb33
-rw-r--r--spec/ruby/core/array/index_spec.rb6
-rw-r--r--spec/ruby/core/array/initialize_spec.rb156
-rw-r--r--spec/ruby/core/array/insert_spec.rb78
-rw-r--r--spec/ruby/core/array/inspect_spec.rb7
-rw-r--r--spec/ruby/core/array/intersection_spec.rb87
-rw-r--r--spec/ruby/core/array/join_spec.rb48
-rw-r--r--spec/ruby/core/array/keep_if_spec.rb10
-rw-r--r--spec/ruby/core/array/last_spec.rb87
-rw-r--r--spec/ruby/core/array/length_spec.rb7
-rw-r--r--spec/ruby/core/array/map_spec.rb11
-rw-r--r--spec/ruby/core/array/max_spec.rb118
-rw-r--r--spec/ruby/core/array/min_spec.rb123
-rw-r--r--spec/ruby/core/array/minus_spec.rb87
-rw-r--r--spec/ruby/core/array/multiply_spec.rb132
-rw-r--r--spec/ruby/core/array/new_spec.rb122
-rw-r--r--spec/ruby/core/array/pack/a_spec.rb59
-rw-r--r--spec/ruby/core/array/pack/at_spec.rb30
-rw-r--r--spec/ruby/core/array/pack/b_spec.rb105
-rw-r--r--spec/ruby/core/array/pack/buffer_spec.rb52
-rw-r--r--spec/ruby/core/array/pack/c_spec.rb75
-rw-r--r--spec/ruby/core/array/pack/comment_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/d_spec.rb39
-rw-r--r--spec/ruby/core/array/pack/e_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/empty_spec.rb11
-rw-r--r--spec/ruby/core/array/pack/f_spec.rb39
-rw-r--r--spec/ruby/core/array/pack/g_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/h_spec.rb197
-rw-r--r--spec/ruby/core/array/pack/i_spec.rb133
-rw-r--r--spec/ruby/core/array/pack/j_spec.rb222
-rw-r--r--spec/ruby/core/array/pack/l_spec.rb221
-rw-r--r--spec/ruby/core/array/pack/m_spec.rb306
-rw-r--r--spec/ruby/core/array/pack/n_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/p_spec.rb11
-rw-r--r--spec/ruby/core/array/pack/percent_spec.rb7
-rw-r--r--spec/ruby/core/array/pack/q_spec.rb61
-rw-r--r--spec/ruby/core/array/pack/s_spec.rb133
-rw-r--r--spec/ruby/core/array/pack/shared/basic.rb65
-rw-r--r--spec/ruby/core/array/pack/shared/encodings.rb16
-rw-r--r--spec/ruby/core/array/pack/shared/float.rb249
-rw-r--r--spec/ruby/core/array/pack/shared/integer.rb381
-rw-r--r--spec/ruby/core/array/pack/shared/numeric_basic.rb44
-rw-r--r--spec/ruby/core/array/pack/shared/string.rb80
-rw-r--r--spec/ruby/core/array/pack/shared/unicode.rb94
-rw-r--r--spec/ruby/core/array/pack/u_spec.rb128
-rw-r--r--spec/ruby/core/array/pack/v_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/w_spec.rb42
-rw-r--r--spec/ruby/core/array/pack/x_spec.rb64
-rw-r--r--spec/ruby/core/array/pack/z_spec.rb32
-rw-r--r--spec/ruby/core/array/partition_spec.rb43
-rw-r--r--spec/ruby/core/array/permutation_spec.rb138
-rw-r--r--spec/ruby/core/array/plus_spec.rb57
-rw-r--r--spec/ruby/core/array/pop_spec.rb168
-rw-r--r--spec/ruby/core/array/prepend_spec.rb9
-rw-r--r--spec/ruby/core/array/product_spec.rb68
-rw-r--r--spec/ruby/core/array/push_spec.rb7
-rw-r--r--spec/ruby/core/array/rassoc_spec.rb38
-rw-r--r--spec/ruby/core/array/reject_spec.rb117
-rw-r--r--spec/ruby/core/array/repeated_combination_spec.rb84
-rw-r--r--spec/ruby/core/array/repeated_permutation_spec.rb94
-rw-r--r--spec/ruby/core/array/replace_spec.rb7
-rw-r--r--spec/ruby/core/array/reverse_each_spec.rb43
-rw-r--r--spec/ruby/core/array/reverse_spec.rb42
-rw-r--r--spec/ruby/core/array/rindex_spec.rb80
-rw-r--r--spec/ruby/core/array/rotate_spec.rb129
-rw-r--r--spec/ruby/core/array/sample_spec.rb155
-rw-r--r--spec/ruby/core/array/select_spec.rb36
-rw-r--r--spec/ruby/core/array/shared/clone.rb42
-rw-r--r--spec/ruby/core/array/shared/collect.rb136
-rw-r--r--spec/ruby/core/array/shared/delete_if.rb27
-rw-r--r--spec/ruby/core/array/shared/enumeratorize.rb5
-rw-r--r--spec/ruby/core/array/shared/eql.rb92
-rw-r--r--spec/ruby/core/array/shared/index.rb37
-rw-r--r--spec/ruby/core/array/shared/inspect.rb144
-rw-r--r--spec/ruby/core/array/shared/join.rb161
-rw-r--r--spec/ruby/core/array/shared/keep_if.rb60
-rw-r--r--spec/ruby/core/array/shared/length.rb11
-rw-r--r--spec/ruby/core/array/shared/push.rb33
-rw-r--r--spec/ruby/core/array/shared/replace.rb60
-rw-r--r--spec/ruby/core/array/shared/slice.rb459
-rw-r--r--spec/ruby/core/array/shared/unshift.rb46
-rw-r--r--spec/ruby/core/array/shift_spec.rb134
-rw-r--r--spec/ruby/core/array/shuffle_spec.rb102
-rw-r--r--spec/ruby/core/array/size_spec.rb7
-rw-r--r--spec/ruby/core/array/slice_spec.rb160
-rw-r--r--spec/ruby/core/array/sort_by_spec.rb52
-rw-r--r--spec/ruby/core/array/sort_spec.rb252
-rw-r--r--spec/ruby/core/array/sum_spec.rb44
-rw-r--r--spec/ruby/core/array/take_spec.rb27
-rw-r--r--spec/ruby/core/array/take_while_spec.rb15
-rw-r--r--spec/ruby/core/array/to_a_spec.rb24
-rw-r--r--spec/ruby/core/array/to_ary_spec.rb20
-rw-r--r--spec/ruby/core/array/to_h_spec.rb37
-rw-r--r--spec/ruby/core/array/to_s_spec.rb8
-rw-r--r--spec/ruby/core/array/transpose_spec.rb53
-rw-r--r--spec/ruby/core/array/try_convert_spec.rb50
-rw-r--r--spec/ruby/core/array/union_spec.rb82
-rw-r--r--spec/ruby/core/array/uniq_spec.rb221
-rw-r--r--spec/ruby/core/array/unshift_spec.rb7
-rw-r--r--spec/ruby/core/array/values_at_spec.rb63
-rw-r--r--spec/ruby/core/array/zip_spec.rb65
-rw-r--r--spec/ruby/core/basicobject/__id__spec.rb6
-rw-r--r--spec/ruby/core/basicobject/__send___spec.rb10
-rw-r--r--spec/ruby/core/basicobject/basicobject_spec.rb87
-rw-r--r--spec/ruby/core/basicobject/equal_spec.rb52
-rw-r--r--spec/ruby/core/basicobject/equal_value_spec.rb10
-rw-r--r--spec/ruby/core/basicobject/fixtures/classes.rb33
-rw-r--r--spec/ruby/core/basicobject/fixtures/common.rb9
-rw-r--r--spec/ruby/core/basicobject/fixtures/remove_method_missing.rb9
-rw-r--r--spec/ruby/core/basicobject/fixtures/singleton_method.rb10
-rw-r--r--spec/ruby/core/basicobject/initialize_spec.rb13
-rw-r--r--spec/ruby/core/basicobject/instance_eval_spec.rb180
-rw-r--r--spec/ruby/core/basicobject/instance_exec_spec.rb107
-rw-r--r--spec/ruby/core/basicobject/method_missing_spec.rb39
-rw-r--r--spec/ruby/core/basicobject/not_equal_spec.rb53
-rw-r--r--spec/ruby/core/basicobject/not_spec.rb11
-rw-r--r--spec/ruby/core/basicobject/singleton_method_added_spec.rb86
-rw-r--r--spec/ruby/core/basicobject/singleton_method_removed_spec.rb24
-rw-r--r--spec/ruby/core/basicobject/singleton_method_undefined_spec.rb24
-rw-r--r--spec/ruby/core/bignum/abs_spec.rb7
-rw-r--r--spec/ruby/core/bignum/bignum_spec.rb31
-rw-r--r--spec/ruby/core/bignum/bit_and_spec.rb50
-rw-r--r--spec/ruby/core/bignum/bit_length_spec.rb33
-rw-r--r--spec/ruby/core/bignum/bit_or_spec.rb41
-rw-r--r--spec/ruby/core/bignum/bit_xor_spec.rb47
-rw-r--r--spec/ruby/core/bignum/case_compare_spec.rb6
-rw-r--r--spec/ruby/core/bignum/coerce_spec.rb65
-rw-r--r--spec/ruby/core/bignum/comparison_spec.rb162
-rw-r--r--spec/ruby/core/bignum/complement_spec.rb9
-rw-r--r--spec/ruby/core/bignum/div_spec.rb21
-rw-r--r--spec/ruby/core/bignum/divide_spec.rb18
-rw-r--r--spec/ruby/core/bignum/divmod_spec.rb81
-rw-r--r--spec/ruby/core/bignum/element_reference_spec.rb30
-rw-r--r--spec/ruby/core/bignum/eql_spec.rb22
-rw-r--r--spec/ruby/core/bignum/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/bignum/even_spec.rb19
-rw-r--r--spec/ruby/core/bignum/exponent_spec.rb29
-rw-r--r--spec/ruby/core/bignum/fdiv_spec.rb5
-rw-r--r--spec/ruby/core/bignum/gt_spec.rb20
-rw-r--r--spec/ruby/core/bignum/gte_spec.rb19
-rw-r--r--spec/ruby/core/bignum/hash_spec.rb12
-rw-r--r--spec/ruby/core/bignum/left_shift_spec.rb73
-rw-r--r--spec/ruby/core/bignum/lt_spec.rb22
-rw-r--r--spec/ruby/core/bignum/lte_spec.rb24
-rw-r--r--spec/ruby/core/bignum/magnitude_spec.rb6
-rw-r--r--spec/ruby/core/bignum/minus_spec.rb19
-rw-r--r--spec/ruby/core/bignum/modulo_spec.rb10
-rw-r--r--spec/ruby/core/bignum/multiply_spec.rb20
-rw-r--r--spec/ruby/core/bignum/odd_spec.rb19
-rw-r--r--spec/ruby/core/bignum/plus_spec.rb19
-rw-r--r--spec/ruby/core/bignum/remainder_spec.rb21
-rw-r--r--spec/ruby/core/bignum/right_shift_spec.rb99
-rw-r--r--spec/ruby/core/bignum/shared/abs.rb6
-rw-r--r--spec/ruby/core/bignum/shared/divide.rb27
-rw-r--r--spec/ruby/core/bignum/shared/equal.rb31
-rw-r--r--spec/ruby/core/bignum/shared/modulo.rb29
-rw-r--r--spec/ruby/core/bignum/size_spec.rb16
-rw-r--r--spec/ruby/core/bignum/to_f_spec.rb13
-rw-r--r--spec/ruby/core/bignum/to_s_spec.rb48
-rw-r--r--spec/ruby/core/bignum/uminus_spec.rb11
-rw-r--r--spec/ruby/core/binding/clone_spec.rb7
-rw-r--r--spec/ruby/core/binding/dup_spec.rb7
-rw-r--r--spec/ruby/core/binding/eval_spec.rb37
-rw-r--r--spec/ruby/core/binding/fixtures/classes.rb40
-rw-r--r--spec/ruby/core/binding/local_variable_defined_spec.rb46
-rw-r--r--spec/ruby/core/binding/local_variable_get_spec.rb56
-rw-r--r--spec/ruby/core/binding/local_variable_set_spec.rb71
-rw-r--r--spec/ruby/core/binding/local_variables_spec.rb35
-rw-r--r--spec/ruby/core/binding/location_spec.rb46
-rw-r--r--spec/ruby/core/binding/receiver_spec.rb11
-rw-r--r--spec/ruby/core/binding/shared/clone.rb34
-rw-r--r--spec/ruby/core/builtin_constants/builtin_constants_spec.rb49
-rw-r--r--spec/ruby/core/class/allocate_spec.rb41
-rw-r--r--spec/ruby/core/class/dup_spec.rb64
-rw-r--r--spec/ruby/core/class/fixtures/classes.rb47
-rw-r--r--spec/ruby/core/class/inherited_spec.rb102
-rw-r--r--spec/ruby/core/class/initialize_spec.rb34
-rw-r--r--spec/ruby/core/class/new_spec.rb154
-rw-r--r--spec/ruby/core/class/superclass_spec.rb27
-rw-r--r--spec/ruby/core/class/to_s_spec.rb23
-rw-r--r--spec/ruby/core/comparable/between_spec.rb25
-rw-r--r--spec/ruby/core/comparable/clamp_spec.rb50
-rw-r--r--spec/ruby/core/comparable/equal_value_spec.rb139
-rw-r--r--spec/ruby/core/comparable/fixtures/classes.rb36
-rw-r--r--spec/ruby/core/comparable/gt_spec.rb43
-rw-r--r--spec/ruby/core/comparable/gte_spec.rb47
-rw-r--r--spec/ruby/core/comparable/lt_spec.rb43
-rw-r--r--spec/ruby/core/comparable/lte_spec.rb46
-rw-r--r--spec/ruby/core/complex/abs2_spec.rb5
-rw-r--r--spec/ruby/core/complex/abs_spec.rb5
-rw-r--r--spec/ruby/core/complex/angle_spec.rb7
-rw-r--r--spec/ruby/core/complex/arg_spec.rb7
-rw-r--r--spec/ruby/core/complex/coerce_spec.rb5
-rw-r--r--spec/ruby/core/complex/conj_spec.rb6
-rw-r--r--spec/ruby/core/complex/conjugate_spec.rb6
-rw-r--r--spec/ruby/core/complex/constants_spec.rb5
-rw-r--r--spec/ruby/core/complex/denominator_spec.rb5
-rw-r--r--spec/ruby/core/complex/divide_spec.rb5
-rw-r--r--spec/ruby/core/complex/eql_spec.rb31
-rw-r--r--spec/ruby/core/complex/equal_value_spec.rb5
-rw-r--r--spec/ruby/core/complex/exponent_spec.rb5
-rw-r--r--spec/ruby/core/complex/fdiv_spec.rb129
-rw-r--r--spec/ruby/core/complex/finite_spec.rb36
-rw-r--r--spec/ruby/core/complex/hash_spec.rb6
-rw-r--r--spec/ruby/core/complex/imag_spec.rb5
-rw-r--r--spec/ruby/core/complex/imaginary_spec.rb5
-rw-r--r--spec/ruby/core/complex/infinite_spec.rb34
-rw-r--r--spec/ruby/core/complex/inspect_spec.rb5
-rw-r--r--spec/ruby/core/complex/integer_spec.rb9
-rw-r--r--spec/ruby/core/complex/magnitude_spec.rb5
-rw-r--r--spec/ruby/core/complex/marshal_dump_spec.rb11
-rw-r--r--spec/ruby/core/complex/minus_spec.rb5
-rw-r--r--spec/ruby/core/complex/multiply_spec.rb5
-rw-r--r--spec/ruby/core/complex/negative_spec.rb11
-rw-r--r--spec/ruby/core/complex/numerator_spec.rb5
-rw-r--r--spec/ruby/core/complex/phase_spec.rb6
-rw-r--r--spec/ruby/core/complex/plus_spec.rb5
-rw-r--r--spec/ruby/core/complex/polar_spec.rb14
-rw-r--r--spec/ruby/core/complex/positive_spec.rb11
-rw-r--r--spec/ruby/core/complex/quo_spec.rb5
-rw-r--r--spec/ruby/core/complex/rationalize_spec.rb29
-rw-r--r--spec/ruby/core/complex/real_spec.rb23
-rw-r--r--spec/ruby/core/complex/rect_spec.rb9
-rw-r--r--spec/ruby/core/complex/rectangular_spec.rb9
-rw-r--r--spec/ruby/core/complex/to_f_spec.rb41
-rw-r--r--spec/ruby/core/complex/to_i_spec.rb41
-rw-r--r--spec/ruby/core/complex/to_r_spec.rb41
-rw-r--r--spec/ruby/core/complex/to_s_spec.rb5
-rw-r--r--spec/ruby/core/complex/uminus_spec.rb11
-rw-r--r--spec/ruby/core/dir/chdir_spec.rb124
-rw-r--r--spec/ruby/core/dir/children_spec.rb72
-rw-r--r--spec/ruby/core/dir/chroot_spec.rb47
-rw-r--r--spec/ruby/core/dir/close_spec.rb29
-rw-r--r--spec/ruby/core/dir/delete_spec.rb15
-rw-r--r--spec/ruby/core/dir/dir_spec.rb7
-rw-r--r--spec/ruby/core/dir/each_child_spec.rb53
-rw-r--r--spec/ruby/core/dir/each_spec.rb64
-rw-r--r--spec/ruby/core/dir/element_reference_spec.rb33
-rw-r--r--spec/ruby/core/dir/empty_spec.rb33
-rw-r--r--spec/ruby/core/dir/entries_spec.rb70
-rw-r--r--spec/ruby/core/dir/exist_spec.rb15
-rw-r--r--spec/ruby/core/dir/exists_spec.rb15
-rw-r--r--spec/ruby/core/dir/fileno_spec.rb37
-rw-r--r--spec/ruby/core/dir/fixtures/common.rb169
-rw-r--r--spec/ruby/core/dir/foreach_spec.rb56
-rw-r--r--spec/ruby/core/dir/getwd_spec.rb15
-rw-r--r--spec/ruby/core/dir/glob_spec.rb156
-rw-r--r--spec/ruby/core/dir/home_spec.rb26
-rw-r--r--spec/ruby/core/dir/initialize_spec.rb23
-rw-r--r--spec/ruby/core/dir/inspect_spec.rb24
-rw-r--r--spec/ruby/core/dir/mkdir_spec.rb85
-rw-r--r--spec/ruby/core/dir/open_spec.rb15
-rw-r--r--spec/ruby/core/dir/path_spec.rb15
-rw-r--r--spec/ruby/core/dir/pos_spec.rb40
-rw-r--r--spec/ruby/core/dir/pwd_spec.rb39
-rw-r--r--spec/ruby/core/dir/read_spec.rb43
-rw-r--r--spec/ruby/core/dir/rewind_spec.rb36
-rw-r--r--spec/ruby/core/dir/rmdir_spec.rb15
-rw-r--r--spec/ruby/core/dir/seek_spec.rb19
-rw-r--r--spec/ruby/core/dir/shared/chroot.rb41
-rw-r--r--spec/ruby/core/dir/shared/closed.rb9
-rw-r--r--spec/ruby/core/dir/shared/delete.rb61
-rw-r--r--spec/ruby/core/dir/shared/exist.rb56
-rw-r--r--spec/ruby/core/dir/shared/glob.rb328
-rw-r--r--spec/ruby/core/dir/shared/open.rb63
-rw-r--r--spec/ruby/core/dir/shared/path.rb32
-rw-r--r--spec/ruby/core/dir/shared/pos.rb51
-rw-r--r--spec/ruby/core/dir/shared/pwd.rb49
-rw-r--r--spec/ruby/core/dir/tell_spec.rb18
-rw-r--r--spec/ruby/core/dir/to_path_spec.rb15
-rw-r--r--spec/ruby/core/dir/unlink_spec.rb15
-rw-r--r--spec/ruby/core/encoding/_dump_spec.rb5
-rw-r--r--spec/ruby/core/encoding/_load_spec.rb5
-rw-r--r--spec/ruby/core/encoding/aliases_spec.rb45
-rw-r--r--spec/ruby/core/encoding/ascii_compatible_spec.rb13
-rw-r--r--spec/ruby/core/encoding/compatible_spec.rb381
-rw-r--r--spec/ruby/core/encoding/converter/asciicompat_encoding_spec.rb39
-rw-r--r--spec/ruby/core/encoding/converter/constants_spec.rb133
-rw-r--r--spec/ruby/core/encoding/converter/convert_spec.rb47
-rw-r--r--spec/ruby/core/encoding/converter/convpath_spec.rb65
-rw-r--r--spec/ruby/core/encoding/converter/destination_encoding_spec.rb13
-rw-r--r--spec/ruby/core/encoding/converter/finish_spec.rb38
-rw-r--r--spec/ruby/core/encoding/converter/insert_output_spec.rb5
-rw-r--r--spec/ruby/core/encoding/converter/inspect_spec.rb13
-rw-r--r--spec/ruby/core/encoding/converter/last_error_spec.rb85
-rw-r--r--spec/ruby/core/encoding/converter/new_spec.rb121
-rw-r--r--spec/ruby/core/encoding/converter/primitive_convert_spec.rb213
-rw-r--r--spec/ruby/core/encoding/converter/primitive_errinfo_spec.rb70
-rw-r--r--spec/ruby/core/encoding/converter/putback_spec.rb49
-rw-r--r--spec/ruby/core/encoding/converter/replacement_spec.rb74
-rw-r--r--spec/ruby/core/encoding/converter/search_convpath_spec.rb73
-rw-r--r--spec/ruby/core/encoding/converter/source_encoding_spec.rb13
-rw-r--r--spec/ruby/core/encoding/default_external_spec.rb74
-rw-r--r--spec/ruby/core/encoding/default_internal_spec.rb93
-rw-r--r--spec/ruby/core/encoding/dummy_spec.rb16
-rw-r--r--spec/ruby/core/encoding/find_spec.rb84
-rw-r--r--spec/ruby/core/encoding/fixtures/classes.rb49
-rw-r--r--spec/ruby/core/encoding/inspect_spec.rb21
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb20
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb20
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb32
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb31
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb32
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb30
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb35
-rw-r--r--spec/ruby/core/encoding/list_spec.rb43
-rw-r--r--spec/ruby/core/encoding/locale_charmap_spec.rb47
-rw-r--r--spec/ruby/core/encoding/name_list_spec.rb25
-rw-r--r--spec/ruby/core/encoding/name_spec.rb7
-rw-r--r--spec/ruby/core/encoding/names_spec.rb37
-rw-r--r--spec/ruby/core/encoding/replicate_spec.rb48
-rw-r--r--spec/ruby/core/encoding/shared/name.rb15
-rw-r--r--spec/ruby/core/encoding/to_s_spec.rb7
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb17
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/destination_encoding_spec.rb17
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/error_char_spec.rb29
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb30
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/source_encoding_spec.rb31
-rw-r--r--spec/ruby/core/enumerable/all_spec.rb130
-rw-r--r--spec/ruby/core/enumerable/any_spec.rb225
-rw-r--r--spec/ruby/core/enumerable/chunk_spec.rb100
-rw-r--r--spec/ruby/core/enumerable/chunk_while_spec.rb44
-rw-r--r--spec/ruby/core/enumerable/collect_concat_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/collect_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/count_spec.rb59
-rw-r--r--spec/ruby/core/enumerable/cycle_spec.rb104
-rw-r--r--spec/ruby/core/enumerable/detect_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/drop_spec.rb43
-rw-r--r--spec/ruby/core/enumerable/drop_while_spec.rb50
-rw-r--r--spec/ruby/core/enumerable/each_cons_spec.rb99
-rw-r--r--spec/ruby/core/enumerable/each_entry_spec.rb41
-rw-r--r--spec/ruby/core/enumerable/each_slice_spec.rb101
-rw-r--r--spec/ruby/core/enumerable/each_with_index_spec.rb53
-rw-r--r--spec/ruby/core/enumerable/each_with_object_spec.rb41
-rw-r--r--spec/ruby/core/enumerable/entries_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/find_all_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/find_index_spec.rb89
-rw-r--r--spec/ruby/core/enumerable/find_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/first_spec.rb28
-rw-r--r--spec/ruby/core/enumerable/fixtures/classes.rb331
-rw-r--r--spec/ruby/core/enumerable/flat_map_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/grep_spec.rb52
-rw-r--r--spec/ruby/core/enumerable/grep_v_spec.rb43
-rw-r--r--spec/ruby/core/enumerable/group_by_spec.rb45
-rw-r--r--spec/ruby/core/enumerable/include_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/inject_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/lazy_spec.rb10
-rw-r--r--spec/ruby/core/enumerable/map_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/max_by_spec.rb81
-rw-r--r--spec/ruby/core/enumerable/max_spec.rb119
-rw-r--r--spec/ruby/core/enumerable/member_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/min_by_spec.rb81
-rw-r--r--spec/ruby/core/enumerable/min_spec.rb123
-rw-r--r--spec/ruby/core/enumerable/minmax_by_spec.rb44
-rw-r--r--spec/ruby/core/enumerable/minmax_spec.rb44
-rw-r--r--spec/ruby/core/enumerable/none_spec.rb68
-rw-r--r--spec/ruby/core/enumerable/one_spec.rb60
-rw-r--r--spec/ruby/core/enumerable/partition_spec.rb20
-rw-r--r--spec/ruby/core/enumerable/reduce_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/reject_spec.rb25
-rw-r--r--spec/ruby/core/enumerable/reverse_each_spec.rb26
-rw-r--r--spec/ruby/core/enumerable/select_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/shared/collect.rb32
-rw-r--r--spec/ruby/core/enumerable/shared/collect_concat.rb54
-rw-r--r--spec/ruby/core/enumerable/shared/entries.rb24
-rw-r--r--spec/ruby/core/enumerable/shared/enumerable_enumeratorized.rb33
-rw-r--r--spec/ruby/core/enumerable/shared/enumeratorized.rb42
-rw-r--r--spec/ruby/core/enumerable/shared/find.rb73
-rw-r--r--spec/ruby/core/enumerable/shared/find_all.rb31
-rw-r--r--spec/ruby/core/enumerable/shared/include.rb34
-rw-r--r--spec/ruby/core/enumerable/shared/inject.rb69
-rw-r--r--spec/ruby/core/enumerable/shared/take.rb63
-rw-r--r--spec/ruby/core/enumerable/slice_after_spec.rb61
-rw-r--r--spec/ruby/core/enumerable/slice_before_spec.rb87
-rw-r--r--spec/ruby/core/enumerable/slice_when_spec.rb54
-rw-r--r--spec/ruby/core/enumerable/sort_by_spec.rb36
-rw-r--r--spec/ruby/core/enumerable/sort_spec.rb54
-rw-r--r--spec/ruby/core/enumerable/sum_spec.rb30
-rw-r--r--spec/ruby/core/enumerable/take_spec.rb13
-rw-r--r--spec/ruby/core/enumerable/take_while_spec.rb51
-rw-r--r--spec/ruby/core/enumerable/to_a_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/to_h_spec.rb46
-rw-r--r--spec/ruby/core/enumerable/uniq_spec.rb94
-rw-r--r--spec/ruby/core/enumerable/zip_spec.rb42
-rw-r--r--spec/ruby/core/enumerator/each_spec.rb5
-rw-r--r--spec/ruby/core/enumerator/each_with_index_spec.rb38
-rw-r--r--spec/ruby/core/enumerator/each_with_object_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/enum_for_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/enumerator_spec.rb7
-rw-r--r--spec/ruby/core/enumerator/feed_spec.rb52
-rw-r--r--spec/ruby/core/enumerator/first_spec.rb7
-rw-r--r--spec/ruby/core/enumerator/fixtures/common.rb9
-rw-r--r--spec/ruby/core/enumerator/generator/each_spec.rb40
-rw-r--r--spec/ruby/core/enumerator/generator/initialize_spec.rb26
-rw-r--r--spec/ruby/core/enumerator/initialize_spec.rb61
-rw-r--r--spec/ruby/core/enumerator/inject_spec.rb15
-rw-r--r--spec/ruby/core/enumerator/inspect_spec.rb17
-rw-r--r--spec/ruby/core/enumerator/lazy/collect_concat_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/collect_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/drop_spec.rb52
-rw-r--r--spec/ruby/core/enumerator/lazy/drop_while_spec.rb60
-rw-r--r--spec/ruby/core/enumerator/lazy/enum_for_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/find_all_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/fixtures/classes.rb54
-rw-r--r--spec/ruby/core/enumerator/lazy/flat_map_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/force_spec.rb30
-rw-r--r--spec/ruby/core/enumerator/lazy/grep_spec.rb82
-rw-r--r--spec/ruby/core/enumerator/lazy/grep_v_spec.rb86
-rw-r--r--spec/ruby/core/enumerator/lazy/initialize_spec.rb63
-rw-r--r--spec/ruby/core/enumerator/lazy/lazy_spec.rb16
-rw-r--r--spec/ruby/core/enumerator/lazy/map_spec.rb12
-rw-r--r--spec/ruby/core/enumerator/lazy/reject_spec.rb60
-rw-r--r--spec/ruby/core/enumerator/lazy/select_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/collect.rb56
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/collect_concat.rb72
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/select.rb60
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/to_enum.rb50
-rw-r--r--spec/ruby/core/enumerator/lazy/take_spec.rb66
-rw-r--r--spec/ruby/core/enumerator/lazy/take_while_spec.rb60
-rw-r--r--spec/ruby/core/enumerator/lazy/to_enum_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/uniq_spec.rb70
-rw-r--r--spec/ruby/core/enumerator/lazy/zip_spec.rb74
-rw-r--r--spec/ruby/core/enumerator/new_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/next_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/next_values_spec.rb55
-rw-r--r--spec/ruby/core/enumerator/peek_spec.rb36
-rw-r--r--spec/ruby/core/enumerator/peek_values_spec.rb57
-rw-r--r--spec/ruby/core/enumerator/rewind_spec.rb38
-rw-r--r--spec/ruby/core/enumerator/size_spec.rb26
-rw-r--r--spec/ruby/core/enumerator/to_enum_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/with_index_spec.rb72
-rw-r--r--spec/ruby/core/enumerator/with_object_spec.rb6
-rw-r--r--spec/ruby/core/enumerator/yielder/append_spec.rb35
-rw-r--r--spec/ruby/core/enumerator/yielder/initialize_spec.rb18
-rw-r--r--spec/ruby/core/enumerator/yielder/yield_spec.rb16
-rw-r--r--spec/ruby/core/env/assoc_spec.rb23
-rw-r--r--spec/ruby/core/env/clear_spec.rb20
-rw-r--r--spec/ruby/core/env/delete_if_spec.rb27
-rw-r--r--spec/ruby/core/env/delete_spec.rb24
-rw-r--r--spec/ruby/core/env/each_key_spec.rb32
-rw-r--r--spec/ruby/core/env/each_pair_spec.rb6
-rw-r--r--spec/ruby/core/env/each_spec.rb6
-rw-r--r--spec/ruby/core/env/each_value_spec.rb32
-rw-r--r--spec/ruby/core/env/element_reference_spec.rb66
-rw-r--r--spec/ruby/core/env/element_set_spec.rb6
-rw-r--r--spec/ruby/core/env/empty_spec.rb23
-rw-r--r--spec/ruby/core/env/fetch_spec.rb35
-rw-r--r--spec/ruby/core/env/has_key_spec.rb6
-rw-r--r--spec/ruby/core/env/has_value_spec.rb6
-rw-r--r--spec/ruby/core/env/include_spec.rb6
-rw-r--r--spec/ruby/core/env/index_spec.rb6
-rw-r--r--spec/ruby/core/env/indexes_spec.rb1
-rw-r--r--spec/ruby/core/env/indices_spec.rb1
-rw-r--r--spec/ruby/core/env/inspect_spec.rb11
-rw-r--r--spec/ruby/core/env/invert_spec.rb16
-rw-r--r--spec/ruby/core/env/keep_if_spec.rb33
-rw-r--r--spec/ruby/core/env/key_spec.rb11
-rw-r--r--spec/ruby/core/env/keys_spec.rb14
-rw-r--r--spec/ruby/core/env/length_spec.rb6
-rw-r--r--spec/ruby/core/env/member_spec.rb6
-rw-r--r--spec/ruby/core/env/rassoc_spec.rb23
-rw-r--r--spec/ruby/core/env/rehash_spec.rb1
-rw-r--r--spec/ruby/core/env/reject_spec.rb77
-rw-r--r--spec/ruby/core/env/replace_spec.rb15
-rw-r--r--spec/ruby/core/env/select_spec.rb39
-rw-r--r--spec/ruby/core/env/shared/each.rb65
-rw-r--r--spec/ruby/core/env/shared/include.rb11
-rw-r--r--spec/ruby/core/env/shared/key.rb15
-rw-r--r--spec/ruby/core/env/shared/length.rb13
-rw-r--r--spec/ruby/core/env/shared/store.rb56
-rw-r--r--spec/ruby/core/env/shared/to_hash.rb22
-rw-r--r--spec/ruby/core/env/shared/value.rb11
-rw-r--r--spec/ruby/core/env/shift_spec.rb59
-rw-r--r--spec/ruby/core/env/size_spec.rb6
-rw-r--r--spec/ruby/core/env/store_spec.rb6
-rw-r--r--spec/ruby/core/env/to_a_spec.rb19
-rw-r--r--spec/ruby/core/env/to_h_spec.rb6
-rw-r--r--spec/ruby/core/env/to_hash_spec.rb6
-rw-r--r--spec/ruby/core/env/to_s_spec.rb7
-rw-r--r--spec/ruby/core/env/update_spec.rb25
-rw-r--r--spec/ruby/core/env/value_spec.rb6
-rw-r--r--spec/ruby/core/env/values_at_spec.rb17
-rw-r--r--spec/ruby/core/env/values_spec.rb21
-rw-r--r--spec/ruby/core/exception/args_spec.rb5
-rw-r--r--spec/ruby/core/exception/arguments_spec.rb11
-rw-r--r--spec/ruby/core/exception/backtrace_spec.rb68
-rw-r--r--spec/ruby/core/exception/case_compare_spec.rb5
-rw-r--r--spec/ruby/core/exception/cause_spec.rb19
-rw-r--r--spec/ruby/core/exception/destination_encoding_name_spec.rb9
-rw-r--r--spec/ruby/core/exception/destination_encoding_spec.rb9
-rw-r--r--spec/ruby/core/exception/equal_value_spec.rb68
-rw-r--r--spec/ruby/core/exception/errno_spec.rb48
-rw-r--r--spec/ruby/core/exception/error_bytes_spec.rb5
-rw-r--r--spec/ruby/core/exception/error_char_spec.rb5
-rw-r--r--spec/ruby/core/exception/exception_spec.rb83
-rw-r--r--spec/ruby/core/exception/exit_value_spec.rb5
-rw-r--r--spec/ruby/core/exception/fixtures/common.rb64
-rw-r--r--spec/ruby/core/exception/incomplete_input_spec.rb5
-rw-r--r--spec/ruby/core/exception/initialize_spec.rb1
-rw-r--r--spec/ruby/core/exception/inspect_spec.rb20
-rw-r--r--spec/ruby/core/exception/interrupt_spec.rb41
-rw-r--r--spec/ruby/core/exception/io_error_spec.rb51
-rw-r--r--spec/ruby/core/exception/load_error_spec.rb21
-rw-r--r--spec/ruby/core/exception/message_spec.rb27
-rw-r--r--spec/ruby/core/exception/name_error_spec.rb13
-rw-r--r--spec/ruby/core/exception/name_spec.rb61
-rw-r--r--spec/ruby/core/exception/new_spec.rb7
-rw-r--r--spec/ruby/core/exception/no_method_error_spec.rb59
-rw-r--r--spec/ruby/core/exception/range_error_spec.rb7
-rw-r--r--spec/ruby/core/exception/readagain_bytes_spec.rb5
-rw-r--r--spec/ruby/core/exception/reason_spec.rb5
-rw-r--r--spec/ruby/core/exception/receiver_spec.rb62
-rw-r--r--spec/ruby/core/exception/result_spec.rb29
-rw-r--r--spec/ruby/core/exception/script_error_spec.rb15
-rw-r--r--spec/ruby/core/exception/set_backtrace_spec.rb56
-rw-r--r--spec/ruby/core/exception/shared/new.rb18
-rw-r--r--spec/ruby/core/exception/signal_exception_spec.rb74
-rw-r--r--spec/ruby/core/exception/signm_spec.rb5
-rw-r--r--spec/ruby/core/exception/signo_spec.rb5
-rw-r--r--spec/ruby/core/exception/source_encoding_name_spec.rb9
-rw-r--r--spec/ruby/core/exception/source_encoding_spec.rb9
-rw-r--r--spec/ruby/core/exception/standard_error_spec.rb50
-rw-r--r--spec/ruby/core/exception/status_spec.rb5
-rw-r--r--spec/ruby/core/exception/success_spec.rb5
-rw-r--r--spec/ruby/core/exception/system_call_error_spec.rb89
-rw-r--r--spec/ruby/core/exception/system_stack_error_spec.rb7
-rw-r--r--spec/ruby/core/exception/to_s_spec.rb23
-rw-r--r--spec/ruby/core/exception/uncaught_throw_error_spec.rb19
-rw-r--r--spec/ruby/core/false/and_spec.rb11
-rw-r--r--spec/ruby/core/false/dup_spec.rb9
-rw-r--r--spec/ruby/core/false/falseclass_spec.rb15
-rw-r--r--spec/ruby/core/false/inspect_spec.rb7
-rw-r--r--spec/ruby/core/false/or_spec.rb11
-rw-r--r--spec/ruby/core/false/to_s_spec.rb7
-rw-r--r--spec/ruby/core/false/xor_spec.rb11
-rw-r--r--spec/ruby/core/fiber/new_spec.rb41
-rw-r--r--spec/ruby/core/fiber/resume_spec.rb54
-rw-r--r--spec/ruby/core/fiber/yield_spec.rb51
-rw-r--r--spec/ruby/core/file/absolute_path_spec.rb37
-rw-r--r--spec/ruby/core/file/atime_spec.rb55
-rw-r--r--spec/ruby/core/file/basename_spec.rb170
-rw-r--r--spec/ruby/core/file/birthtime_spec.rb56
-rw-r--r--spec/ruby/core/file/blockdev_spec.rb6
-rw-r--r--spec/ruby/core/file/chardev_spec.rb6
-rw-r--r--spec/ruby/core/file/chmod_spec.rb239
-rw-r--r--spec/ruby/core/file/chown_spec.rb152
-rw-r--r--spec/ruby/core/file/constants/constants_spec.rb31
-rw-r--r--spec/ruby/core/file/constants_spec.rb141
-rw-r--r--spec/ruby/core/file/ctime_spec.rb51
-rw-r--r--spec/ruby/core/file/delete_spec.rb6
-rw-r--r--spec/ruby/core/file/directory_spec.rb10
-rw-r--r--spec/ruby/core/file/dirname_spec.rb108
-rw-r--r--spec/ruby/core/file/empty_spec.rb15
-rw-r--r--spec/ruby/core/file/executable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/executable_spec.rb7
-rw-r--r--spec/ruby/core/file/exist_spec.rb6
-rw-r--r--spec/ruby/core/file/exists_spec.rb6
-rw-r--r--spec/ruby/core/file/expand_path_spec.rb242
-rw-r--r--spec/ruby/core/file/extname_spec.rb54
-rw-r--r--spec/ruby/core/file/file_spec.rb16
-rw-r--r--spec/ruby/core/file/fixtures/common.rb22
-rw-r--r--spec/ruby/core/file/fixtures/do_not_remove1
-rw-r--r--spec/ruby/core/file/fixtures/file_types.rb64
-rw-r--r--spec/ruby/core/file/flock_spec.rb106
-rw-r--r--spec/ruby/core/file/fnmatch_spec.rb10
-rw-r--r--spec/ruby/core/file/ftype_spec.rb73
-rw-r--r--spec/ruby/core/file/grpowned_spec.rb10
-rw-r--r--spec/ruby/core/file/identical_spec.rb6
-rw-r--r--spec/ruby/core/file/initialize_spec.rb23
-rw-r--r--spec/ruby/core/file/inspect_spec.rb17
-rw-r--r--spec/ruby/core/file/join_spec.rb139
-rw-r--r--spec/ruby/core/file/lchmod_spec.rb42
-rw-r--r--spec/ruby/core/file/lchown_spec.rb63
-rw-r--r--spec/ruby/core/file/link_spec.rb39
-rw-r--r--spec/ruby/core/file/lstat_spec.rb33
-rw-r--r--spec/ruby/core/file/mkfifo_spec.rb53
-rw-r--r--spec/ruby/core/file/mtime_spec.rb51
-rw-r--r--spec/ruby/core/file/new_spec.rb162
-rw-r--r--spec/ruby/core/file/null_spec.rb15
-rw-r--r--spec/ruby/core/file/open_spec.rb678
-rw-r--r--spec/ruby/core/file/owned_spec.rb33
-rw-r--r--spec/ruby/core/file/path_spec.rb29
-rw-r--r--spec/ruby/core/file/pipe_spec.rb32
-rw-r--r--spec/ruby/core/file/printf_spec.rb18
-rw-r--r--spec/ruby/core/file/read_spec.rb6
-rw-r--r--spec/ruby/core/file/readable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/readable_spec.rb7
-rw-r--r--spec/ruby/core/file/readlink_spec.rb86
-rw-r--r--spec/ruby/core/file/realdirpath_spec.rb104
-rw-r--r--spec/ruby/core/file/realpath_spec.rb88
-rw-r--r--spec/ruby/core/file/rename_spec.rb37
-rw-r--r--spec/ruby/core/file/reopen_spec.rb32
-rw-r--r--spec/ruby/core/file/setgid_spec.rb36
-rw-r--r--spec/ruby/core/file/setuid_spec.rb38
-rw-r--r--spec/ruby/core/file/shared/fnmatch.rb241
-rw-r--r--spec/ruby/core/file/shared/open.rb12
-rw-r--r--spec/ruby/core/file/shared/read.rb15
-rw-r--r--spec/ruby/core/file/shared/stat.rb32
-rw-r--r--spec/ruby/core/file/shared/unlink.rb63
-rw-r--r--spec/ruby/core/file/size_spec.rb119
-rw-r--r--spec/ruby/core/file/socket_spec.rb42
-rw-r--r--spec/ruby/core/file/split_spec.rb63
-rw-r--r--spec/ruby/core/file/stat/atime_spec.rb18
-rw-r--r--spec/ruby/core/file/stat/birthtime_spec.rb27
-rw-r--r--spec/ruby/core/file/stat/blksize_spec.rb27
-rw-r--r--spec/ruby/core/file/stat/blockdev_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/blocks_spec.rb27
-rw-r--r--spec/ruby/core/file/stat/chardev_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/comparison_spec.rb66
-rw-r--r--spec/ruby/core/file/stat/ctime_spec.rb18
-rw-r--r--spec/ruby/core/file/stat/dev_major_spec.rb23
-rw-r--r--spec/ruby/core/file/stat/dev_minor_spec.rb23
-rw-r--r--spec/ruby/core/file/stat/dev_spec.rb15
-rw-r--r--spec/ruby/core/file/stat/directory_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/executable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/executable_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/file_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/fixtures/classes.rb5
-rw-r--r--spec/ruby/core/file/stat/ftype_spec.rb68
-rw-r--r--spec/ruby/core/file/stat/gid_spec.rb19
-rw-r--r--spec/ruby/core/file/stat/grpowned_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/ino_spec.rb38
-rw-r--r--spec/ruby/core/file/stat/inspect_spec.rb26
-rw-r--r--spec/ruby/core/file/stat/mode_spec.rb19
-rw-r--r--spec/ruby/core/file/stat/mtime_spec.rb18
-rw-r--r--spec/ruby/core/file/stat/new_spec.rb32
-rw-r--r--spec/ruby/core/file/stat/nlink_spec.rb21
-rw-r--r--spec/ruby/core/file/stat/owned_spec.rb31
-rw-r--r--spec/ruby/core/file/stat/pipe_spec.rb32
-rw-r--r--spec/ruby/core/file/stat/rdev_major_spec.rb31
-rw-r--r--spec/ruby/core/file/stat/rdev_minor_spec.rb31
-rw-r--r--spec/ruby/core/file/stat/rdev_spec.rb15
-rw-r--r--spec/ruby/core/file/stat/readable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/readable_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/setgid_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/setuid_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/size_spec.rb21
-rw-r--r--spec/ruby/core/file/stat/socket_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/sticky_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/symlink_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/uid_spec.rb18
-rw-r--r--spec/ruby/core/file/stat/world_readable_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/world_writable_spec.rb11
-rw-r--r--spec/ruby/core/file/stat/writable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/writable_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/zero_spec.rb7
-rw-r--r--spec/ruby/core/file/stat_spec.rb45
-rw-r--r--spec/ruby/core/file/sticky_spec.rb50
-rw-r--r--spec/ruby/core/file/symlink_spec.rb57
-rw-r--r--spec/ruby/core/file/to_path_spec.rb49
-rw-r--r--spec/ruby/core/file/truncate_spec.rb177
-rw-r--r--spec/ruby/core/file/umask_spec.rb60
-rw-r--r--spec/ruby/core/file/unlink_spec.rb6
-rw-r--r--spec/ruby/core/file/utime_spec.rb47
-rw-r--r--spec/ruby/core/file/world_readable_spec.rb12
-rw-r--r--spec/ruby/core/file/world_writable_spec.rb12
-rw-r--r--spec/ruby/core/file/writable_real_spec.rb7
-rw-r--r--spec/ruby/core/file/writable_spec.rb7
-rw-r--r--spec/ruby/core/file/zero_spec.rb13
-rw-r--r--spec/ruby/core/filetest/blockdev_spec.rb6
-rw-r--r--spec/ruby/core/filetest/chardev_spec.rb6
-rw-r--r--spec/ruby/core/filetest/directory_spec.rb10
-rw-r--r--spec/ruby/core/filetest/executable_real_spec.rb7
-rw-r--r--spec/ruby/core/filetest/executable_spec.rb7
-rw-r--r--spec/ruby/core/filetest/exist_spec.rb6
-rw-r--r--spec/ruby/core/filetest/exists_spec.rb6
-rw-r--r--spec/ruby/core/filetest/file_spec.rb10
-rw-r--r--spec/ruby/core/filetest/grpowned_spec.rb10
-rw-r--r--spec/ruby/core/filetest/identical_spec.rb6
-rw-r--r--spec/ruby/core/filetest/owned_spec.rb10
-rw-r--r--spec/ruby/core/filetest/pipe_spec.rb10
-rw-r--r--spec/ruby/core/filetest/readable_real_spec.rb7
-rw-r--r--spec/ruby/core/filetest/readable_spec.rb7
-rw-r--r--spec/ruby/core/filetest/setgid_spec.rb10
-rw-r--r--spec/ruby/core/filetest/setuid_spec.rb10
-rw-r--r--spec/ruby/core/filetest/size_spec.rb34
-rw-r--r--spec/ruby/core/filetest/socket_spec.rb10
-rw-r--r--spec/ruby/core/filetest/sticky_spec.rb7
-rw-r--r--spec/ruby/core/filetest/symlink_spec.rb10
-rw-r--r--spec/ruby/core/filetest/world_readable_spec.rb5
-rw-r--r--spec/ruby/core/filetest/world_writable_spec.rb5
-rw-r--r--spec/ruby/core/filetest/writable_real_spec.rb7
-rw-r--r--spec/ruby/core/filetest/writable_spec.rb7
-rw-r--r--spec/ruby/core/filetest/zero_spec.rb13
-rw-r--r--spec/ruby/core/fixnum/abs_spec.rb7
-rw-r--r--spec/ruby/core/fixnum/bit_and_spec.rb46
-rw-r--r--spec/ruby/core/fixnum/bit_length_spec.rb42
-rw-r--r--spec/ruby/core/fixnum/bit_or_spec.rb26
-rw-r--r--spec/ruby/core/fixnum/bit_xor_spec.rb24
-rw-r--r--spec/ruby/core/fixnum/case_compare_spec.rb6
-rw-r--r--spec/ruby/core/fixnum/coerce_spec.rb39
-rw-r--r--spec/ruby/core/fixnum/comparison_spec.rb26
-rw-r--r--spec/ruby/core/fixnum/complement_spec.rb10
-rw-r--r--spec/ruby/core/fixnum/div_spec.rb44
-rw-r--r--spec/ruby/core/fixnum/divide_spec.rb35
-rw-r--r--spec/ruby/core/fixnum/divmod_spec.rb35
-rw-r--r--spec/ruby/core/fixnum/element_reference_spec.rb80
-rw-r--r--spec/ruby/core/fixnum/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/fixnum/even_spec.rb23
-rw-r--r--spec/ruby/core/fixnum/exponent_spec.rb76
-rw-r--r--spec/ruby/core/fixnum/fdiv_spec.rb49
-rw-r--r--spec/ruby/core/fixnum/fixnum_spec.rb31
-rw-r--r--spec/ruby/core/fixnum/gt_spec.rb19
-rw-r--r--spec/ruby/core/fixnum/gte_spec.rb20
-rw-r--r--spec/ruby/core/fixnum/hash_spec.rb11
-rw-r--r--spec/ruby/core/fixnum/left_shift_spec.rb91
-rw-r--r--spec/ruby/core/fixnum/lt_spec.rb19
-rw-r--r--spec/ruby/core/fixnum/lte_spec.rb20
-rw-r--r--spec/ruby/core/fixnum/magnitude_spec.rb6
-rw-r--r--spec/ruby/core/fixnum/minus_spec.rb29
-rw-r--r--spec/ruby/core/fixnum/modulo_spec.rb10
-rw-r--r--spec/ruby/core/fixnum/multiply_spec.rb27
-rw-r--r--spec/ruby/core/fixnum/odd_spec.rb23
-rw-r--r--spec/ruby/core/fixnum/plus_spec.rb29
-rw-r--r--spec/ruby/core/fixnum/right_shift_spec.rb91
-rw-r--r--spec/ruby/core/fixnum/shared/abs.rb9
-rw-r--r--spec/ruby/core/fixnum/shared/equal.rb24
-rw-r--r--spec/ruby/core/fixnum/shared/modulo.rb42
-rw-r--r--spec/ruby/core/fixnum/size_spec.rb19
-rw-r--r--spec/ruby/core/fixnum/succ_spec.rb15
-rw-r--r--spec/ruby/core/fixnum/to_f_spec.rb9
-rw-r--r--spec/ruby/core/fixnum/to_s_spec.rb50
-rw-r--r--spec/ruby/core/fixnum/uminus_spec.rb16
-rw-r--r--spec/ruby/core/fixnum/zero_spec.rb9
-rw-r--r--spec/ruby/core/float/abs_spec.rb5
-rw-r--r--spec/ruby/core/float/angle_spec.rb5
-rw-r--r--spec/ruby/core/float/arg_spec.rb5
-rw-r--r--spec/ruby/core/float/case_compare_spec.rb6
-rw-r--r--spec/ruby/core/float/ceil_spec.rb23
-rw-r--r--spec/ruby/core/float/coerce_spec.rb18
-rw-r--r--spec/ruby/core/float/comparison_spec.rb36
-rw-r--r--spec/ruby/core/float/constants_spec.rb55
-rw-r--r--spec/ruby/core/float/denominator_spec.rb29
-rw-r--r--spec/ruby/core/float/divide_spec.rb36
-rw-r--r--spec/ruby/core/float/divmod_spec.rb43
-rw-r--r--spec/ruby/core/float/dup_spec.rb10
-rw-r--r--spec/ruby/core/float/eql_spec.rb16
-rw-r--r--spec/ruby/core/float/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/float/exponent_spec.rb15
-rw-r--r--spec/ruby/core/float/fdiv_spec.rb6
-rw-r--r--spec/ruby/core/float/finite_spec.rb19
-rw-r--r--spec/ruby/core/float/fixtures/coerce.rb15
-rw-r--r--spec/ruby/core/float/float_spec.rb19
-rw-r--r--spec/ruby/core/float/floor_spec.rb23
-rw-r--r--spec/ruby/core/float/gt_spec.rb14
-rw-r--r--spec/ruby/core/float/gte_spec.rb14
-rw-r--r--spec/ruby/core/float/hash_spec.rb11
-rw-r--r--spec/ruby/core/float/infinite_spec.rb19
-rw-r--r--spec/ruby/core/float/lt_spec.rb14
-rw-r--r--spec/ruby/core/float/lte_spec.rb15
-rw-r--r--spec/ruby/core/float/magnitude_spec.rb5
-rw-r--r--spec/ruby/core/float/minus_spec.rb9
-rw-r--r--spec/ruby/core/float/modulo_spec.rb10
-rw-r--r--spec/ruby/core/float/multiply_spec.rb14
-rw-r--r--spec/ruby/core/float/nan_spec.rb9
-rw-r--r--spec/ruby/core/float/next_float_spec.rb49
-rw-r--r--spec/ruby/core/float/numerator_spec.rb39
-rw-r--r--spec/ruby/core/float/phase_spec.rb5
-rw-r--r--spec/ruby/core/float/plus_spec.rb9
-rw-r--r--spec/ruby/core/float/prev_float_spec.rb49
-rw-r--r--spec/ruby/core/float/quo_spec.rb6
-rw-r--r--spec/ruby/core/float/rationalize_spec.rb43
-rw-r--r--spec/ruby/core/float/round_spec.rb101
-rw-r--r--spec/ruby/core/float/shared/abs.rb21
-rw-r--r--spec/ruby/core/float/shared/equal.rb17
-rw-r--r--spec/ruby/core/float/shared/modulo.rb48
-rw-r--r--spec/ruby/core/float/shared/quo.rb59
-rw-r--r--spec/ruby/core/float/shared/to_i.rb10
-rw-r--r--spec/ruby/core/float/to_f_spec.rb9
-rw-r--r--spec/ruby/core/float/to_i_spec.rb6
-rw-r--r--spec/ruby/core/float/to_int_spec.rb6
-rw-r--r--spec/ruby/core/float/to_r_spec.rb5
-rw-r--r--spec/ruby/core/float/to_s_spec.rb120
-rw-r--r--spec/ruby/core/float/truncate_spec.rb16
-rw-r--r--spec/ruby/core/float/uminus_spec.rb28
-rw-r--r--spec/ruby/core/float/uplus_spec.rb9
-rw-r--r--spec/ruby/core/float/zero_spec.rb9
-rw-r--r--spec/ruby/core/gc/count_spec.rb7
-rw-r--r--spec/ruby/core/gc/disable_spec.rb18
-rw-r--r--spec/ruby/core/gc/enable_spec.rb13
-rw-r--r--spec/ruby/core/gc/garbage_collect_spec.rb15
-rw-r--r--spec/ruby/core/gc/profiler/clear_spec.rb5
-rw-r--r--spec/ruby/core/gc/profiler/disable_spec.rb16
-rw-r--r--spec/ruby/core/gc/profiler/enable_spec.rb17
-rw-r--r--spec/ruby/core/gc/profiler/enabled_spec.rb21
-rw-r--r--spec/ruby/core/gc/profiler/report_spec.rb5
-rw-r--r--spec/ruby/core/gc/profiler/result_spec.rb7
-rw-r--r--spec/ruby/core/gc/profiler/total_time_spec.rb7
-rw-r--r--spec/ruby/core/gc/start_spec.rb8
-rw-r--r--spec/ruby/core/gc/stress_spec.rb27
-rw-r--r--spec/ruby/core/hash/allocate_spec.rb15
-rw-r--r--spec/ruby/core/hash/any_spec.rb30
-rw-r--r--spec/ruby/core/hash/assoc_spec.rb50
-rw-r--r--spec/ruby/core/hash/clear_spec.rb32
-rw-r--r--spec/ruby/core/hash/clone_spec.rb13
-rw-r--r--spec/ruby/core/hash/compact_spec.rb61
-rw-r--r--spec/ruby/core/hash/compare_by_identity_spec.rb140
-rw-r--r--spec/ruby/core/hash/constructor_spec.rb110
-rw-r--r--spec/ruby/core/hash/default_proc_spec.rb80
-rw-r--r--spec/ruby/core/hash/default_spec.rb46
-rw-r--r--spec/ruby/core/hash/delete_if_spec.rb44
-rw-r--r--spec/ruby/core/hash/delete_spec.rb44
-rw-r--r--spec/ruby/core/hash/dig_spec.rb68
-rw-r--r--spec/ruby/core/hash/each_key_spec.rb23
-rw-r--r--spec/ruby/core/hash/each_pair_spec.rb11
-rw-r--r--spec/ruby/core/hash/each_spec.rb11
-rw-r--r--spec/ruby/core/hash/each_value_spec.rb23
-rw-r--r--spec/ruby/core/hash/element_reference_spec.rb120
-rw-r--r--spec/ruby/core/hash/element_set_spec.rb7
-rw-r--r--spec/ruby/core/hash/empty_spec.rb15
-rw-r--r--spec/ruby/core/hash/eql_spec.rb9
-rw-r--r--spec/ruby/core/hash/equal_value_spec.rb18
-rw-r--r--spec/ruby/core/hash/fetch_spec.rb36
-rw-r--r--spec/ruby/core/hash/fetch_values_spec.rb35
-rw-r--r--spec/ruby/core/hash/fixtures/classes.rb68
-rw-r--r--spec/ruby/core/hash/flatten_spec.rb62
-rw-r--r--spec/ruby/core/hash/gt_spec.rb44
-rw-r--r--spec/ruby/core/hash/gte_spec.rb44
-rw-r--r--spec/ruby/core/hash/has_key_spec.rb8
-rw-r--r--spec/ruby/core/hash/has_value_spec.rb8
-rw-r--r--spec/ruby/core/hash/hash_spec.rb36
-rw-r--r--spec/ruby/core/hash/include_spec.rb7
-rw-r--r--spec/ruby/core/hash/index_spec.rb7
-rw-r--r--spec/ruby/core/hash/initialize_spec.rb40
-rw-r--r--spec/ruby/core/hash/inspect_spec.rb7
-rw-r--r--spec/ruby/core/hash/invert_spec.rb27
-rw-r--r--spec/ruby/core/hash/keep_if_spec.rb37
-rw-r--r--spec/ruby/core/hash/key_spec.rb12
-rw-r--r--spec/ruby/core/hash/keys_spec.rb23
-rw-r--r--spec/ruby/core/hash/length_spec.rb7
-rw-r--r--spec/ruby/core/hash/lt_spec.rb44
-rw-r--r--spec/ruby/core/hash/lte_spec.rb44
-rw-r--r--spec/ruby/core/hash/member_spec.rb7
-rw-r--r--spec/ruby/core/hash/merge_spec.rb77
-rw-r--r--spec/ruby/core/hash/new_spec.rb36
-rw-r--r--spec/ruby/core/hash/rassoc_spec.rb42
-rw-r--r--spec/ruby/core/hash/rehash_spec.rb42
-rw-r--r--spec/ruby/core/hash/reject_spec.rb100
-rw-r--r--spec/ruby/core/hash/replace_spec.rb7
-rw-r--r--spec/ruby/core/hash/select_spec.rb83
-rw-r--r--spec/ruby/core/hash/shared/comparison.rb15
-rw-r--r--spec/ruby/core/hash/shared/each.rb68
-rw-r--r--spec/ruby/core/hash/shared/eql.rb216
-rw-r--r--spec/ruby/core/hash/shared/equal.rb90
-rw-r--r--spec/ruby/core/hash/shared/greater_than.rb23
-rw-r--r--spec/ruby/core/hash/shared/index.rb27
-rw-r--r--spec/ruby/core/hash/shared/iteration.rb19
-rw-r--r--spec/ruby/core/hash/shared/key.rb38
-rw-r--r--spec/ruby/core/hash/shared/length.rb12
-rw-r--r--spec/ruby/core/hash/shared/less_than.rb23
-rw-r--r--spec/ruby/core/hash/shared/replace.rb51
-rw-r--r--spec/ruby/core/hash/shared/store.rb98
-rw-r--r--spec/ruby/core/hash/shared/to_s.rb109
-rw-r--r--spec/ruby/core/hash/shared/update.rb59
-rw-r--r--spec/ruby/core/hash/shared/value.rb14
-rw-r--r--spec/ruby/core/hash/shared/values_at.rb9
-rw-r--r--spec/ruby/core/hash/shift_spec.rb64
-rw-r--r--spec/ruby/core/hash/size_spec.rb7
-rw-r--r--spec/ruby/core/hash/slice_spec.rb36
-rw-r--r--spec/ruby/core/hash/sort_spec.rb17
-rw-r--r--spec/ruby/core/hash/store_spec.rb7
-rw-r--r--spec/ruby/core/hash/to_a_spec.rb37
-rw-r--r--spec/ruby/core/hash/to_h_spec.rb34
-rw-r--r--spec/ruby/core/hash/to_hash_spec.rb14
-rw-r--r--spec/ruby/core/hash/to_proc_spec.rb89
-rw-r--r--spec/ruby/core/hash/to_s_spec.rb7
-rw-r--r--spec/ruby/core/hash/transform_keys_spec.rb110
-rw-r--r--spec/ruby/core/hash/transform_values_spec.rb99
-rw-r--r--spec/ruby/core/hash/try_convert_spec.rb50
-rw-r--r--spec/ruby/core/hash/update_spec.rb7
-rw-r--r--spec/ruby/core/hash/value_spec.rb8
-rw-r--r--spec/ruby/core/hash/values_at_spec.rb7
-rw-r--r--spec/ruby/core/hash/values_spec.rb10
-rw-r--r--spec/ruby/core/integer/allbits_spec.rb37
-rw-r--r--spec/ruby/core/integer/anybits_spec.rb36
-rw-r--r--spec/ruby/core/integer/ceil_spec.rb21
-rw-r--r--spec/ruby/core/integer/chr_spec.rb239
-rw-r--r--spec/ruby/core/integer/denominator_spec.rb20
-rw-r--r--spec/ruby/core/integer/digits_spec.rb34
-rw-r--r--spec/ruby/core/integer/downto_spec.rb69
-rw-r--r--spec/ruby/core/integer/dup_spec.rb10
-rw-r--r--spec/ruby/core/integer/even_spec.rb20
-rw-r--r--spec/ruby/core/integer/floor_spec.rb21
-rw-r--r--spec/ruby/core/integer/gcd_spec.rb58
-rw-r--r--spec/ruby/core/integer/gcdlcm_spec.rb53
-rw-r--r--spec/ruby/core/integer/integer_spec.rb22
-rw-r--r--spec/ruby/core/integer/lcm_spec.rb58
-rw-r--r--spec/ruby/core/integer/next_spec.rb6
-rw-r--r--spec/ruby/core/integer/nobits_spec.rb36
-rw-r--r--spec/ruby/core/integer/numerator_spec.rb18
-rw-r--r--spec/ruby/core/integer/odd_spec.rb18
-rw-r--r--spec/ruby/core/integer/ord_spec.rb17
-rw-r--r--spec/ruby/core/integer/pred_spec.rb11
-rw-r--r--spec/ruby/core/integer/rationalize_spec.rb39
-rw-r--r--spec/ruby/core/integer/round_spec.rb95
-rw-r--r--spec/ruby/core/integer/shared/integer_rounding.rb31
-rw-r--r--spec/ruby/core/integer/shared/next.rb25
-rw-r--r--spec/ruby/core/integer/shared/to_i.rb8
-rw-r--r--spec/ruby/core/integer/sqrt_spec.rb33
-rw-r--r--spec/ruby/core/integer/succ_spec.rb6
-rw-r--r--spec/ruby/core/integer/times_spec.rb79
-rw-r--r--spec/ruby/core/integer/to_i_spec.rb6
-rw-r--r--spec/ruby/core/integer/to_int_spec.rb6
-rw-r--r--spec/ruby/core/integer/to_r_spec.rb26
-rw-r--r--spec/ruby/core/integer/truncate_spec.rb21
-rw-r--r--spec/ruby/core/integer/upto_spec.rb69
-rw-r--r--spec/ruby/core/io/advise_spec.rb97
-rw-r--r--spec/ruby/core/io/binmode_spec.rb60
-rw-r--r--spec/ruby/core/io/binread_spec.rb49
-rw-r--r--spec/ruby/core/io/binwrite_spec.rb8
-rw-r--r--spec/ruby/core/io/bytes_spec.rb43
-rw-r--r--spec/ruby/core/io/chars_spec.rb12
-rw-r--r--spec/ruby/core/io/close_on_exec_spec.rb100
-rw-r--r--spec/ruby/core/io/close_read_spec.rb80
-rw-r--r--spec/ruby/core/io/close_spec.rb82
-rw-r--r--spec/ruby/core/io/close_write_spec.rb84
-rw-r--r--spec/ruby/core/io/closed_spec.rb20
-rw-r--r--spec/ruby/core/io/codepoints_spec.rb25
-rw-r--r--spec/ruby/core/io/constants_spec.rb19
-rw-r--r--spec/ruby/core/io/copy_stream_spec.rb282
-rw-r--r--spec/ruby/core/io/dup_spec.rb69
-rw-r--r--spec/ruby/core/io/each_byte_spec.rb57
-rw-r--r--spec/ruby/core/io/each_char_spec.rb12
-rw-r--r--spec/ruby/core/io/each_codepoint_spec.rb45
-rw-r--r--spec/ruby/core/io/each_line_spec.rb11
-rw-r--r--spec/ruby/core/io/each_spec.rb11
-rw-r--r--spec/ruby/core/io/eof_spec.rb107
-rw-r--r--spec/ruby/core/io/external_encoding_spec.rb218
-rw-r--r--spec/ruby/core/io/fcntl_spec.rb8
-rw-r--r--spec/ruby/core/io/fdatasync_spec.rb5
-rw-r--r--spec/ruby/core/io/fileno_spec.rb12
-rw-r--r--spec/ruby/core/io/fixtures/bom_UTF-16BE.txtbin20 -> 0 bytes-rw-r--r--spec/ruby/core/io/fixtures/bom_UTF-16LE.txtbin20 -> 0 bytes-rw-r--r--spec/ruby/core/io/fixtures/bom_UTF-32BE.txtbin40 -> 0 bytes-rw-r--r--spec/ruby/core/io/fixtures/bom_UTF-32LE.txtbin40 -> 0 bytes-rw-r--r--spec/ruby/core/io/fixtures/bom_UTF-8.txt1
-rw-r--r--spec/ruby/core/io/fixtures/classes.rb189
-rw-r--r--spec/ruby/core/io/fixtures/copy_stream.txt6
-rw-r--r--spec/ruby/core/io/fixtures/empty.txt0
-rw-r--r--spec/ruby/core/io/fixtures/incomplete.txt1
-rw-r--r--spec/ruby/core/io/fixtures/lines.txt9
-rw-r--r--spec/ruby/core/io/fixtures/no_bom_UTF-8.txt1
-rw-r--r--spec/ruby/core/io/fixtures/numbered_lines.txt5
-rw-r--r--spec/ruby/core/io/fixtures/one_byte.txt1
-rw-r--r--spec/ruby/core/io/fixtures/read_binary.txt1
-rw-r--r--spec/ruby/core/io/fixtures/read_euc_jp.txt1
-rw-r--r--spec/ruby/core/io/fixtures/read_text.txt1
-rw-r--r--spec/ruby/core/io/fixtures/reopen_stdout.rb3
-rw-r--r--spec/ruby/core/io/flush_spec.rb8
-rw-r--r--spec/ruby/core/io/for_fd_spec.rb10
-rw-r--r--spec/ruby/core/io/foreach_spec.rb81
-rw-r--r--spec/ruby/core/io/fsync_spec.rb24
-rw-r--r--spec/ruby/core/io/getbyte_spec.rb42
-rw-r--r--spec/ruby/core/io/getc_spec.rb42
-rw-r--r--spec/ruby/core/io/gets_spec.rb321
-rw-r--r--spec/ruby/core/io/initialize_spec.rb53
-rw-r--r--spec/ruby/core/io/inspect_spec.rb23
-rw-r--r--spec/ruby/core/io/internal_encoding_spec.rb140
-rw-r--r--spec/ruby/core/io/io_spec.rb11
-rw-r--r--spec/ruby/core/io/ioctl_spec.rb32
-rw-r--r--spec/ruby/core/io/isatty_spec.rb6
-rw-r--r--spec/ruby/core/io/lineno_spec.rb95
-rw-r--r--spec/ruby/core/io/lines_spec.rb42
-rw-r--r--spec/ruby/core/io/new_spec.rb10
-rw-r--r--spec/ruby/core/io/open_spec.rb86
-rw-r--r--spec/ruby/core/io/output_spec.rb27
-rw-r--r--spec/ruby/core/io/pid_spec.rb35
-rw-r--r--spec/ruby/core/io/pipe_spec.rb214
-rw-r--r--spec/ruby/core/io/popen_spec.rb286
-rw-r--r--spec/ruby/core/io/pos_spec.rb12
-rw-r--r--spec/ruby/core/io/print_spec.rb54
-rw-r--r--spec/ruby/core/io/printf_spec.rb32
-rw-r--r--spec/ruby/core/io/putc_spec.rb11
-rw-r--r--spec/ruby/core/io/puts_spec.rb141
-rw-r--r--spec/ruby/core/io/read_nonblock_spec.rb95
-rw-r--r--spec/ruby/core/io/read_spec.rb616
-rw-r--r--spec/ruby/core/io/readbyte_spec.rb26
-rw-r--r--spec/ruby/core/io/readchar_spec.rb44
-rw-r--r--spec/ruby/core/io/readline_spec.rb53
-rw-r--r--spec/ruby/core/io/readlines_spec.rb210
-rw-r--r--spec/ruby/core/io/readpartial_spec.rb96
-rw-r--r--spec/ruby/core/io/reopen_spec.rb302
-rw-r--r--spec/ruby/core/io/rewind_spec.rb38
-rw-r--r--spec/ruby/core/io/seek_spec.rb79
-rw-r--r--spec/ruby/core/io/select_spec.rb116
-rw-r--r--spec/ruby/core/io/set_encoding_spec.rb193
-rw-r--r--spec/ruby/core/io/shared/binwrite.rb78
-rw-r--r--spec/ruby/core/io/shared/chars.rb73
-rw-r--r--spec/ruby/core/io/shared/codepoints.rb54
-rw-r--r--spec/ruby/core/io/shared/each.rb185
-rw-r--r--spec/ruby/core/io/shared/gets_ascii.rb19
-rw-r--r--spec/ruby/core/io/shared/new.rb378
-rw-r--r--spec/ruby/core/io/shared/pos.rb72
-rw-r--r--spec/ruby/core/io/shared/readlines.rb211
-rw-r--r--spec/ruby/core/io/shared/tty.rb25
-rw-r--r--spec/ruby/core/io/shared/write.rb72
-rw-r--r--spec/ruby/core/io/stat_spec.rb24
-rw-r--r--spec/ruby/core/io/sync_spec.rb64
-rw-r--r--spec/ruby/core/io/sysopen_spec.rb50
-rw-r--r--spec/ruby/core/io/sysread_spec.rb98
-rw-r--r--spec/ruby/core/io/sysseek_spec.rb44
-rw-r--r--spec/ruby/core/io/syswrite_spec.rb54
-rw-r--r--spec/ruby/core/io/tell_spec.rb7
-rw-r--r--spec/ruby/core/io/to_i_spec.rb12
-rw-r--r--spec/ruby/core/io/to_io_spec.rb21
-rw-r--r--spec/ruby/core/io/try_convert_spec.rb49
-rw-r--r--spec/ruby/core/io/tty_spec.rb6
-rw-r--r--spec/ruby/core/io/ungetbyte_spec.rb48
-rw-r--r--spec/ruby/core/io/ungetc_spec.rb119
-rw-r--r--spec/ruby/core/io/write_nonblock_spec.rb86
-rw-r--r--spec/ruby/core/io/write_spec.rb157
-rw-r--r--spec/ruby/core/kernel/Array_spec.rb97
-rw-r--r--spec/ruby/core/kernel/Complex_spec.rb6
-rw-r--r--spec/ruby/core/kernel/Float_spec.rb316
-rw-r--r--spec/ruby/core/kernel/Hash_spec.rb57
-rw-r--r--spec/ruby/core/kernel/Integer_spec.rb697
-rw-r--r--spec/ruby/core/kernel/Rational_spec.rb6
-rw-r--r--spec/ruby/core/kernel/String_spec.rb106
-rw-r--r--spec/ruby/core/kernel/__callee___spec.rb48
-rw-r--r--spec/ruby/core/kernel/__dir___spec.rb13
-rw-r--r--spec/ruby/core/kernel/__method___spec.rb40
-rw-r--r--spec/ruby/core/kernel/abort_spec.rb15
-rw-r--r--spec/ruby/core/kernel/at_exit_spec.rb44
-rw-r--r--spec/ruby/core/kernel/autoload_spec.rb121
-rw-r--r--spec/ruby/core/kernel/backtick_spec.rb80
-rw-r--r--spec/ruby/core/kernel/binding_spec.rb51
-rw-r--r--spec/ruby/core/kernel/block_given_spec.rb38
-rw-r--r--spec/ruby/core/kernel/caller_locations_spec.rb32
-rw-r--r--spec/ruby/core/kernel/caller_spec.rb37
-rw-r--r--spec/ruby/core/kernel/case_compare_spec.rb135
-rw-r--r--spec/ruby/core/kernel/catch_spec.rb127
-rw-r--r--spec/ruby/core/kernel/chomp_spec.rb67
-rw-r--r--spec/ruby/core/kernel/chop_spec.rb55
-rw-r--r--spec/ruby/core/kernel/class_spec.rb26
-rw-r--r--spec/ruby/core/kernel/clone_spec.rb118
-rw-r--r--spec/ruby/core/kernel/comparison_spec.rb31
-rw-r--r--spec/ruby/core/kernel/define_singleton_method_spec.rb101
-rw-r--r--spec/ruby/core/kernel/display_spec.rb6
-rw-r--r--spec/ruby/core/kernel/dup_spec.rb67
-rw-r--r--spec/ruby/core/kernel/enum_for_spec.rb5
-rw-r--r--spec/ruby/core/kernel/eql_spec.rb11
-rw-r--r--spec/ruby/core/kernel/equal_value_spec.rb15
-rw-r--r--spec/ruby/core/kernel/eval_spec.rb216
-rw-r--r--spec/ruby/core/kernel/exec_spec.rb18
-rw-r--r--spec/ruby/core/kernel/exit_spec.rb27
-rw-r--r--spec/ruby/core/kernel/extend_spec.rb79
-rw-r--r--spec/ruby/core/kernel/fail_spec.rb43
-rw-r--r--spec/ruby/core/kernel/fixtures/__callee__.rb34
-rw-r--r--spec/ruby/core/kernel/fixtures/__method__.rb34
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_b.rb5
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_c.rb5
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_d.rb5
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_frozen.rb7
-rw-r--r--spec/ruby/core/kernel/fixtures/caller.rb7
-rw-r--r--spec/ruby/core/kernel/fixtures/caller_locations.rb7
-rw-r--r--spec/ruby/core/kernel/fixtures/chomp.rb4
-rw-r--r--spec/ruby/core/kernel/fixtures/chomp_f.rb4
-rw-r--r--spec/ruby/core/kernel/fixtures/chop.rb4
-rw-r--r--spec/ruby/core/kernel/fixtures/chop_f.rb4
-rw-r--r--spec/ruby/core/kernel/fixtures/classes.rb419
-rw-r--r--spec/ruby/core/kernel/fixtures/eval_locals.rb6
-rw-r--r--spec/ruby/core/kernel/fixtures/eval_return_with_lambda.rb12
-rw-r--r--spec/ruby/core/kernel/fixtures/eval_return_without_lambda.rb14
-rw-r--r--spec/ruby/core/kernel/fixtures/test.rb362
-rw-r--r--spec/ruby/core/kernel/fork_spec.rb15
-rw-r--r--spec/ruby/core/kernel/format_spec.rb14
-rw-r--r--spec/ruby/core/kernel/freeze_spec.rb85
-rw-r--r--spec/ruby/core/kernel/frozen_spec.rb78
-rw-r--r--spec/ruby/core/kernel/gets_spec.rb17
-rw-r--r--spec/ruby/core/kernel/global_variables_spec.rb26
-rw-r--r--spec/ruby/core/kernel/gsub_spec.rb96
-rw-r--r--spec/ruby/core/kernel/inspect_spec.rb31
-rw-r--r--spec/ruby/core/kernel/instance_of_spec.rb40
-rw-r--r--spec/ruby/core/kernel/instance_variable_defined_spec.rb41
-rw-r--r--spec/ruby/core/kernel/instance_variable_get_spec.rb105
-rw-r--r--spec/ruby/core/kernel/instance_variable_set_spec.rb93
-rw-r--r--spec/ruby/core/kernel/instance_variables_spec.rb27
-rw-r--r--spec/ruby/core/kernel/is_a_spec.rb6
-rw-r--r--spec/ruby/core/kernel/iterator_spec.rb12
-rw-r--r--spec/ruby/core/kernel/itself_spec.rb9
-rw-r--r--spec/ruby/core/kernel/kind_of_spec.rb6
-rw-r--r--spec/ruby/core/kernel/lambda_spec.rb86
-rw-r--r--spec/ruby/core/kernel/load_spec.rb40
-rw-r--r--spec/ruby/core/kernel/local_variables_spec.rb37
-rw-r--r--spec/ruby/core/kernel/loop_spec.rb81
-rw-r--r--spec/ruby/core/kernel/match_spec.rb14
-rw-r--r--spec/ruby/core/kernel/method_spec.rb37
-rw-r--r--spec/ruby/core/kernel/methods_spec.rb101
-rw-r--r--spec/ruby/core/kernel/nil_spec.rb6
-rw-r--r--spec/ruby/core/kernel/not_match_spec.rb21
-rw-r--r--spec/ruby/core/kernel/object_id_spec.rb6
-rw-r--r--spec/ruby/core/kernel/open_spec.rb142
-rw-r--r--spec/ruby/core/kernel/p_spec.rb79
-rw-r--r--spec/ruby/core/kernel/print_spec.rb12
-rw-r--r--spec/ruby/core/kernel/printf_spec.rb61
-rw-r--r--spec/ruby/core/kernel/private_methods_spec.rb69
-rw-r--r--spec/ruby/core/kernel/proc_spec.rb50
-rw-r--r--spec/ruby/core/kernel/protected_methods_spec.rb69
-rw-r--r--spec/ruby/core/kernel/public_method_spec.rb32
-rw-r--r--spec/ruby/core/kernel/public_methods_spec.rb76
-rw-r--r--spec/ruby/core/kernel/public_send_spec.rb108
-rw-r--r--spec/ruby/core/kernel/putc_spec.rb39
-rw-r--r--spec/ruby/core/kernel/puts_spec.rb29
-rw-r--r--spec/ruby/core/kernel/raise_spec.rb17
-rw-r--r--spec/ruby/core/kernel/rand_spec.rb139
-rw-r--r--spec/ruby/core/kernel/readline_spec.rb12
-rw-r--r--spec/ruby/core/kernel/readlines_spec.rb12
-rw-r--r--spec/ruby/core/kernel/remove_instance_variable_spec.rb59
-rw-r--r--spec/ruby/core/kernel/require_relative_spec.rb349
-rw-r--r--spec/ruby/core/kernel/require_spec.rb36
-rw-r--r--spec/ruby/core/kernel/respond_to_missing_spec.rb100
-rw-r--r--spec/ruby/core/kernel/respond_to_spec.rb73
-rw-r--r--spec/ruby/core/kernel/select_spec.rb20
-rw-r--r--spec/ruby/core/kernel/send_spec.rb68
-rw-r--r--spec/ruby/core/kernel/set_trace_func_spec.rb12
-rw-r--r--spec/ruby/core/kernel/shared/dup_clone.rb149
-rw-r--r--spec/ruby/core/kernel/shared/kind_of.rb44
-rw-r--r--spec/ruby/core/kernel/shared/lambda.rb9
-rw-r--r--spec/ruby/core/kernel/shared/load.rb139
-rw-r--r--spec/ruby/core/kernel/shared/method.rb50
-rw-r--r--spec/ruby/core/kernel/shared/require.rb703
-rw-r--r--spec/ruby/core/kernel/shared/sprintf.rb871
-rw-r--r--spec/ruby/core/kernel/shared/sprintf_encoding.rb28
-rw-r--r--spec/ruby/core/kernel/singleton_class_spec.rb27
-rw-r--r--spec/ruby/core/kernel/singleton_method_spec.rb41
-rw-r--r--spec/ruby/core/kernel/singleton_methods_spec.rb180
-rw-r--r--spec/ruby/core/kernel/sleep_spec.rb52
-rw-r--r--spec/ruby/core/kernel/spawn_spec.rb25
-rw-r--r--spec/ruby/core/kernel/sprintf_spec.rb24
-rw-r--r--spec/ruby/core/kernel/srand_spec.rb61
-rw-r--r--spec/ruby/core/kernel/sub_spec.rb26
-rw-r--r--spec/ruby/core/kernel/syscall_spec.rb12
-rw-r--r--spec/ruby/core/kernel/system_spec.rb107
-rw-r--r--spec/ruby/core/kernel/taint_spec.rb45
-rw-r--r--spec/ruby/core/kernel/tainted_spec.rb12
-rw-r--r--spec/ruby/core/kernel/tap_spec.rb13
-rw-r--r--spec/ruby/core/kernel/test_spec.rb109
-rw-r--r--spec/ruby/core/kernel/throw_spec.rb80
-rw-r--r--spec/ruby/core/kernel/to_enum_spec.rb5
-rw-r--r--spec/ruby/core/kernel/to_s_spec.rb16
-rw-r--r--spec/ruby/core/kernel/trace_var_spec.rb54
-rw-r--r--spec/ruby/core/kernel/trap_spec.rb12
-rw-r--r--spec/ruby/core/kernel/trust_spec.rb25
-rw-r--r--spec/ruby/core/kernel/untaint_spec.rb25
-rw-r--r--spec/ruby/core/kernel/untrace_var_spec.rb12
-rw-r--r--spec/ruby/core/kernel/untrust_spec.rb25
-rw-r--r--spec/ruby/core/kernel/untrusted_spec.rb28
-rw-r--r--spec/ruby/core/kernel/warn_spec.rb79
-rw-r--r--spec/ruby/core/kernel/yield_self_spec.rb26
-rw-r--r--spec/ruby/core/main/define_method_spec.rb28
-rw-r--r--spec/ruby/core/main/fixtures/classes.rb18
-rw-r--r--spec/ruby/core/main/fixtures/string_refinement.rb7
-rw-r--r--spec/ruby/core/main/fixtures/string_refinement_user.rb11
-rw-r--r--spec/ruby/core/main/fixtures/wrapped_include.rb1
-rw-r--r--spec/ruby/core/main/include_spec.rb16
-rw-r--r--spec/ruby/core/main/private_spec.rb23
-rw-r--r--spec/ruby/core/main/public_spec.rb23
-rw-r--r--spec/ruby/core/main/to_s_spec.rb7
-rw-r--r--spec/ruby/core/main/using_spec.rb135
-rw-r--r--spec/ruby/core/marshal/dump_spec.rb582
-rw-r--r--spec/ruby/core/marshal/fixtures/marshal_data.rb420
-rw-r--r--spec/ruby/core/marshal/fixtures/random.dumpbin2520 -> 0 bytes-rw-r--r--spec/ruby/core/marshal/float_spec.rb77
-rw-r--r--spec/ruby/core/marshal/load_spec.rb6
-rw-r--r--spec/ruby/core/marshal/major_version_spec.rb7
-rw-r--r--spec/ruby/core/marshal/minor_version_spec.rb7
-rw-r--r--spec/ruby/core/marshal/restore_spec.rb6
-rw-r--r--spec/ruby/core/marshal/shared/load.rb830
-rw-r--r--spec/ruby/core/matchdata/begin_spec.rb30
-rw-r--r--spec/ruby/core/matchdata/captures_spec.rb7
-rw-r--r--spec/ruby/core/matchdata/element_reference_spec.rb87
-rw-r--r--spec/ruby/core/matchdata/end_spec.rb30
-rw-r--r--spec/ruby/core/matchdata/eql_spec.rb6
-rw-r--r--spec/ruby/core/matchdata/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/matchdata/hash_spec.rb5
-rw-r--r--spec/ruby/core/matchdata/inspect_spec.rb17
-rw-r--r--spec/ruby/core/matchdata/length_spec.rb6
-rw-r--r--spec/ruby/core/matchdata/named_captures_spec.rb13
-rw-r--r--spec/ruby/core/matchdata/names_spec.rb33
-rw-r--r--spec/ruby/core/matchdata/offset_spec.rb30
-rw-r--r--spec/ruby/core/matchdata/post_match_spec.rb36
-rw-r--r--spec/ruby/core/matchdata/pre_match_spec.rb36
-rw-r--r--spec/ruby/core/matchdata/regexp_spec.rb13
-rw-r--r--spec/ruby/core/matchdata/shared/eql.rb26
-rw-r--r--spec/ruby/core/matchdata/shared/length.rb5
-rw-r--r--spec/ruby/core/matchdata/size_spec.rb6
-rw-r--r--spec/ruby/core/matchdata/string_spec.rb14
-rw-r--r--spec/ruby/core/matchdata/to_a_spec.rb7
-rw-r--r--spec/ruby/core/matchdata/to_s_spec.rb7
-rw-r--r--spec/ruby/core/matchdata/values_at_spec.rb23
-rw-r--r--spec/ruby/core/math/acos_spec.rb58
-rw-r--r--spec/ruby/core/math/acosh_spec.rb43
-rw-r--r--spec/ruby/core/math/asin_spec.rb50
-rw-r--r--spec/ruby/core/math/asinh_spec.rb42
-rw-r--r--spec/ruby/core/math/atan2_spec.rb54
-rw-r--r--spec/ruby/core/math/atan_spec.rb40
-rw-r--r--spec/ruby/core/math/atanh_spec.rb14
-rw-r--r--spec/ruby/core/math/cbrt_spec.rb27
-rw-r--r--spec/ruby/core/math/constants_spec.rb22
-rw-r--r--spec/ruby/core/math/cos_spec.rb42
-rw-r--r--spec/ruby/core/math/cosh_spec.rb37
-rw-r--r--spec/ruby/core/math/erf_spec.rb44
-rw-r--r--spec/ruby/core/math/erfc_spec.rb43
-rw-r--r--spec/ruby/core/math/exp_spec.rb37
-rw-r--r--spec/ruby/core/math/fixtures/classes.rb28
-rw-r--r--spec/ruby/core/math/frexp_spec.rb37
-rw-r--r--spec/ruby/core/math/gamma_spec.rb69
-rw-r--r--spec/ruby/core/math/hypot_spec.rb41
-rw-r--r--spec/ruby/core/math/ldexp_spec.rb54
-rw-r--r--spec/ruby/core/math/lgamma_spec.rb56
-rw-r--r--spec/ruby/core/math/log10_spec.rb45
-rw-r--r--spec/ruby/core/math/log2_spec.rb41
-rw-r--r--spec/ruby/core/math/log_spec.rb59
-rw-r--r--spec/ruby/core/math/sin_spec.rb39
-rw-r--r--spec/ruby/core/math/sinh_spec.rb37
-rw-r--r--spec/ruby/core/math/sqrt_spec.rb36
-rw-r--r--spec/ruby/core/math/tan_spec.rb42
-rw-r--r--spec/ruby/core/math/tanh_spec.rb39
-rw-r--r--spec/ruby/core/method/arity_spec.rb222
-rw-r--r--spec/ruby/core/method/call_spec.rb7
-rw-r--r--spec/ruby/core/method/clone_spec.rb14
-rw-r--r--spec/ruby/core/method/curry_spec.rb36
-rw-r--r--spec/ruby/core/method/element_reference_spec.rb7
-rw-r--r--spec/ruby/core/method/eql_spec.rb6
-rw-r--r--spec/ruby/core/method/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/method/fixtures/classes.rb184
-rw-r--r--spec/ruby/core/method/hash_spec.rb17
-rw-r--r--spec/ruby/core/method/inspect_spec.rb6
-rw-r--r--spec/ruby/core/method/name_spec.rb22
-rw-r--r--spec/ruby/core/method/owner_spec.rb26
-rw-r--r--spec/ruby/core/method/parameters_spec.rb244
-rw-r--r--spec/ruby/core/method/receiver_spec.rb22
-rw-r--r--spec/ruby/core/method/shared/call.rb51
-rw-r--r--spec/ruby/core/method/shared/eql.rb94
-rw-r--r--spec/ruby/core/method/shared/to_s.rb34
-rw-r--r--spec/ruby/core/method/source_location_spec.rb95
-rw-r--r--spec/ruby/core/method/super_method_spec.rb45
-rw-r--r--spec/ruby/core/method/to_proc_spec.rb89
-rw-r--r--spec/ruby/core/method/to_s_spec.rb6
-rw-r--r--spec/ruby/core/method/unbind_spec.rb37
-rw-r--r--spec/ruby/core/module/alias_method_spec.rb157
-rw-r--r--spec/ruby/core/module/allocate_spec.rb14
-rw-r--r--spec/ruby/core/module/ancestors_spec.rb70
-rw-r--r--spec/ruby/core/module/append_features_spec.rb73
-rw-r--r--spec/ruby/core/module/attr_accessor_spec.rb97
-rw-r--r--spec/ruby/core/module/attr_reader_spec.rb71
-rw-r--r--spec/ruby/core/module/attr_spec.rb156
-rw-r--r--spec/ruby/core/module/attr_writer_spec.rb71
-rw-r--r--spec/ruby/core/module/autoload_spec.rb508
-rw-r--r--spec/ruby/core/module/case_compare_spec.rb31
-rw-r--r--spec/ruby/core/module/class_eval_spec.rb7
-rw-r--r--spec/ruby/core/module/class_exec_spec.rb7
-rw-r--r--spec/ruby/core/module/class_variable_defined_spec.rb72
-rw-r--r--spec/ruby/core/module/class_variable_get_spec.rb76
-rw-r--r--spec/ruby/core/module/class_variable_set_spec.rb62
-rw-r--r--spec/ruby/core/module/class_variables_spec.rb26
-rw-r--r--spec/ruby/core/module/comparison_spec.rb36
-rw-r--r--spec/ruby/core/module/const_defined_spec.rb144
-rw-r--r--spec/ruby/core/module/const_get_spec.rb208
-rw-r--r--spec/ruby/core/module/const_missing_spec.rb27
-rw-r--r--spec/ruby/core/module/const_set_spec.rb86
-rw-r--r--spec/ruby/core/module/constants_spec.rb91
-rw-r--r--spec/ruby/core/module/define_method_spec.rb633
-rw-r--r--spec/ruby/core/module/define_singleton_method_spec.rb17
-rw-r--r--spec/ruby/core/module/deprecate_constant_spec.rb52
-rw-r--r--spec/ruby/core/module/eql_spec.rb7
-rw-r--r--spec/ruby/core/module/equal_spec.rb7
-rw-r--r--spec/ruby/core/module/equal_value_spec.rb7
-rw-r--r--spec/ruby/core/module/extend_object_spec.rb68
-rw-r--r--spec/ruby/core/module/extended_spec.rb44
-rw-r--r--spec/ruby/core/module/fixtures/autoload.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_abc.rb11
-rw-r--r--spec/ruby/core/module/fixtures/autoload_c.rb11
-rw-r--r--spec/ruby/core/module/fixtures/autoload_concur.rb9
-rw-r--r--spec/ruby/core/module/fixtures/autoload_d.rb11
-rw-r--r--spec/ruby/core/module/fixtures/autoload_e.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_empty.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_ex1.rb16
-rw-r--r--spec/ruby/core/module/fixtures/autoload_f.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_g.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_h.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_i.rb5
-rw-r--r--spec/ruby/core/module/fixtures/autoload_j.rb3
-rw-r--r--spec/ruby/core/module/fixtures/autoload_k.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_lm.rb4
-rw-r--r--spec/ruby/core/module/fixtures/autoload_never_set.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_o.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_r.rb4
-rw-r--r--spec/ruby/core/module/fixtures/autoload_s.rb5
-rw-r--r--spec/ruby/core/module/fixtures/autoload_scope.rb8
-rw-r--r--spec/ruby/core/module/fixtures/autoload_subclass.rb11
-rw-r--r--spec/ruby/core/module/fixtures/autoload_t.rb3
-rw-r--r--spec/ruby/core/module/fixtures/autoload_v.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_w.rb2
-rw-r--r--spec/ruby/core/module/fixtures/autoload_w2.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_x.rb3
-rw-r--r--spec/ruby/core/module/fixtures/autoload_z.rb5
-rw-r--r--spec/ruby/core/module/fixtures/classes.rb605
-rw-r--r--spec/ruby/core/module/fixtures/constant_unicode.rb5
-rw-r--r--spec/ruby/core/module/fixtures/module.rb4
-rw-r--r--spec/ruby/core/module/fixtures/name.rb10
-rw-r--r--spec/ruby/core/module/fixtures/path1/load_path.rb9
-rw-r--r--spec/ruby/core/module/fixtures/path2/load_path.rb1
-rw-r--r--spec/ruby/core/module/fixtures/refine.rb13
-rw-r--r--spec/ruby/core/module/fixtures/repeated_concurrent_autoload.rb8
-rw-r--r--spec/ruby/core/module/freeze_spec.rb6
-rw-r--r--spec/ruby/core/module/gt_spec.rb36
-rw-r--r--spec/ruby/core/module/gte_spec.rb33
-rw-r--r--spec/ruby/core/module/include_spec.rb270
-rw-r--r--spec/ruby/core/module/included_modules_spec.rb12
-rw-r--r--spec/ruby/core/module/included_spec.rb44
-rw-r--r--spec/ruby/core/module/initialize_copy_spec.rb10
-rw-r--r--spec/ruby/core/module/initialize_spec.rb18
-rw-r--r--spec/ruby/core/module/instance_method_spec.rb85
-rw-r--r--spec/ruby/core/module/instance_methods_spec.rb61
-rw-r--r--spec/ruby/core/module/lt_spec.rb36
-rw-r--r--spec/ruby/core/module/lte_spec.rb33
-rw-r--r--spec/ruby/core/module/method_added_spec.rb62
-rw-r--r--spec/ruby/core/module/method_defined_spec.rb49
-rw-r--r--spec/ruby/core/module/method_removed_spec.rb33
-rw-r--r--spec/ruby/core/module/method_undefined_spec.rb33
-rw-r--r--spec/ruby/core/module/module_eval_spec.rb7
-rw-r--r--spec/ruby/core/module/module_exec_spec.rb7
-rw-r--r--spec/ruby/core/module/module_function_spec.rb269
-rw-r--r--spec/ruby/core/module/name_spec.rb68
-rw-r--r--spec/ruby/core/module/nesting_spec.rb31
-rw-r--r--spec/ruby/core/module/new_spec.rb31
-rw-r--r--spec/ruby/core/module/prepend_features_spec.rb76
-rw-r--r--spec/ruby/core/module/prepend_spec.rb361
-rw-r--r--spec/ruby/core/module/prepended_spec.rb25
-rw-r--r--spec/ruby/core/module/private_class_method_spec.rb81
-rw-r--r--spec/ruby/core/module/private_constant_spec.rb32
-rw-r--r--spec/ruby/core/module/private_instance_methods_spec.rb54
-rw-r--r--spec/ruby/core/module/private_method_defined_spec.rb72
-rw-r--r--spec/ruby/core/module/private_spec.rb93
-rw-r--r--spec/ruby/core/module/protected_instance_methods_spec.rb57
-rw-r--r--spec/ruby/core/module/protected_method_defined_spec.rb72
-rw-r--r--spec/ruby/core/module/protected_spec.rb56
-rw-r--r--spec/ruby/core/module/public_class_method_spec.rb80
-rw-r--r--spec/ruby/core/module/public_constant_spec.rb38
-rw-r--r--spec/ruby/core/module/public_instance_method_spec.rb65
-rw-r--r--spec/ruby/core/module/public_instance_methods_spec.rb61
-rw-r--r--spec/ruby/core/module/public_method_defined_spec.rb72
-rw-r--r--spec/ruby/core/module/public_spec.rb44
-rw-r--r--spec/ruby/core/module/refine_spec.rb657
-rw-r--r--spec/ruby/core/module/remove_class_variable_spec.rb44
-rw-r--r--spec/ruby/core/module/remove_const_spec.rb84
-rw-r--r--spec/ruby/core/module/remove_method_spec.rb116
-rw-r--r--spec/ruby/core/module/shared/class_eval.rb115
-rw-r--r--spec/ruby/core/module/shared/class_exec.rb29
-rw-r--r--spec/ruby/core/module/shared/equal_value.rb14
-rw-r--r--spec/ruby/core/module/shared/set_visibility.rb135
-rw-r--r--spec/ruby/core/module/singleton_class_spec.rb27
-rw-r--r--spec/ruby/core/module/to_s_spec.rb18
-rw-r--r--spec/ruby/core/module/undef_method_spec.rb159
-rw-r--r--spec/ruby/core/module/using_spec.rb287
-rw-r--r--spec/ruby/core/mutex/lock_spec.rb41
-rw-r--r--spec/ruby/core/mutex/locked_spec.rb36
-rw-r--r--spec/ruby/core/mutex/owned_spec.rb43
-rw-r--r--spec/ruby/core/mutex/sleep_spec.rb95
-rw-r--r--spec/ruby/core/mutex/synchronize_spec.rb27
-rw-r--r--spec/ruby/core/mutex/try_lock_spec.rb32
-rw-r--r--spec/ruby/core/mutex/unlock_spec.rb38
-rw-r--r--spec/ruby/core/nil/and_spec.rb11
-rw-r--r--spec/ruby/core/nil/dup_spec.rb9
-rw-r--r--spec/ruby/core/nil/inspect_spec.rb7
-rw-r--r--spec/ruby/core/nil/nil_spec.rb7
-rw-r--r--spec/ruby/core/nil/nilclass_spec.rb15
-rw-r--r--spec/ruby/core/nil/or_spec.rb11
-rw-r--r--spec/ruby/core/nil/rationalize_spec.rb16
-rw-r--r--spec/ruby/core/nil/to_a_spec.rb7
-rw-r--r--spec/ruby/core/nil/to_c_spec.rb7
-rw-r--r--spec/ruby/core/nil/to_f_spec.rb11
-rw-r--r--spec/ruby/core/nil/to_h_spec.rb8
-rw-r--r--spec/ruby/core/nil/to_i_spec.rb11
-rw-r--r--spec/ruby/core/nil/to_r_spec.rb7
-rw-r--r--spec/ruby/core/nil/to_s_spec.rb7
-rw-r--r--spec/ruby/core/nil/xor_spec.rb11
-rw-r--r--spec/ruby/core/numeric/abs2_spec.rb34
-rw-r--r--spec/ruby/core/numeric/abs_spec.rb5
-rw-r--r--spec/ruby/core/numeric/angle_spec.rb6
-rw-r--r--spec/ruby/core/numeric/arg_spec.rb6
-rw-r--r--spec/ruby/core/numeric/ceil_spec.rb15
-rw-r--r--spec/ruby/core/numeric/coerce_spec.rb76
-rw-r--r--spec/ruby/core/numeric/comparison_spec.rb48
-rw-r--r--spec/ruby/core/numeric/conj_spec.rb6
-rw-r--r--spec/ruby/core/numeric/conjugate_spec.rb6
-rw-r--r--spec/ruby/core/numeric/denominator_spec.rb24
-rw-r--r--spec/ruby/core/numeric/div_spec.rb22
-rw-r--r--spec/ruby/core/numeric/divmod_spec.rb15
-rw-r--r--spec/ruby/core/numeric/eql_spec.rb22
-rw-r--r--spec/ruby/core/numeric/fdiv_spec.rb32
-rw-r--r--spec/ruby/core/numeric/finite_spec.rb10
-rw-r--r--spec/ruby/core/numeric/fixtures/classes.rb17
-rw-r--r--spec/ruby/core/numeric/floor_spec.rb14
-rw-r--r--spec/ruby/core/numeric/i_spec.rb15
-rw-r--r--spec/ruby/core/numeric/imag_spec.rb6
-rw-r--r--spec/ruby/core/numeric/imaginary_spec.rb6
-rw-r--r--spec/ruby/core/numeric/infinite_spec.rb10
-rw-r--r--spec/ruby/core/numeric/integer_spec.rb8
-rw-r--r--spec/ruby/core/numeric/magnitude_spec.rb5
-rw-r--r--spec/ruby/core/numeric/modulo_spec.rb24
-rw-r--r--spec/ruby/core/numeric/negative_spec.rb43
-rw-r--r--spec/ruby/core/numeric/nonzero_spec.rb18
-rw-r--r--spec/ruby/core/numeric/numerator_spec.rb33
-rw-r--r--spec/ruby/core/numeric/numeric_spec.rb7
-rw-r--r--spec/ruby/core/numeric/phase_spec.rb6
-rw-r--r--spec/ruby/core/numeric/polar_spec.rb6
-rw-r--r--spec/ruby/core/numeric/positive_spec.rb43
-rw-r--r--spec/ruby/core/numeric/quo_spec.rb55
-rw-r--r--spec/ruby/core/numeric/real_spec.rb13
-rw-r--r--spec/ruby/core/numeric/rect_spec.rb6
-rw-r--r--spec/ruby/core/numeric/rectangular_spec.rb6
-rw-r--r--spec/ruby/core/numeric/remainder_spec.rb67
-rw-r--r--spec/ruby/core/numeric/round_spec.rb14
-rw-r--r--spec/ruby/core/numeric/shared/abs.rb19
-rw-r--r--spec/ruby/core/numeric/shared/quo.rb7
-rw-r--r--spec/ruby/core/numeric/shared/rect.rb48
-rw-r--r--spec/ruby/core/numeric/shared/step.rb425
-rw-r--r--spec/ruby/core/numeric/singleton_method_added_spec.rb41
-rw-r--r--spec/ruby/core/numeric/step_spec.rb163
-rw-r--r--spec/ruby/core/numeric/to_c_spec.rb45
-rw-r--r--spec/ruby/core/numeric/to_int_spec.rb10
-rw-r--r--spec/ruby/core/numeric/truncate_spec.rb14
-rw-r--r--spec/ruby/core/numeric/uminus_spec.rb31
-rw-r--r--spec/ruby/core/numeric/uplus_spec.rb9
-rw-r--r--spec/ruby/core/numeric/zero_spec.rb18
-rw-r--r--spec/ruby/core/objectspace/_id2ref_spec.rb25
-rw-r--r--spec/ruby/core/objectspace/add_finalizer_spec.rb5
-rw-r--r--spec/ruby/core/objectspace/call_finalizer_spec.rb5
-rw-r--r--spec/ruby/core/objectspace/count_objects_spec.rb5
-rw-r--r--spec/ruby/core/objectspace/define_finalizer_spec.rb101
-rw-r--r--spec/ruby/core/objectspace/each_object_spec.rb225
-rw-r--r--spec/ruby/core/objectspace/finalizers_spec.rb5
-rw-r--r--spec/ruby/core/objectspace/fixtures/classes.rb64
-rw-r--r--spec/ruby/core/objectspace/garbage_collect_spec.rb22
-rw-r--r--spec/ruby/core/objectspace/remove_finalizer_spec.rb5
-rw-r--r--spec/ruby/core/objectspace/undefine_finalizer_spec.rb5
-rw-r--r--spec/ruby/core/proc/allocate_spec.rb9
-rw-r--r--spec/ruby/core/proc/arity_spec.rb640
-rw-r--r--spec/ruby/core/proc/binding_spec.rb21
-rw-r--r--spec/ruby/core/proc/block_pass_spec.rb41
-rw-r--r--spec/ruby/core/proc/call_spec.rb16
-rw-r--r--spec/ruby/core/proc/case_compare_spec.rb16
-rw-r--r--spec/ruby/core/proc/clone_spec.rb6
-rw-r--r--spec/ruby/core/proc/curry_spec.rb180
-rw-r--r--spec/ruby/core/proc/dup_spec.rb6
-rw-r--r--spec/ruby/core/proc/element_reference_spec.rb16
-rw-r--r--spec/ruby/core/proc/eql_spec.rb6
-rw-r--r--spec/ruby/core/proc/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/proc/fixtures/common.rb51
-rw-r--r--spec/ruby/core/proc/fixtures/source_location.rb55
-rw-r--r--spec/ruby/core/proc/hash_spec.rb17
-rw-r--r--spec/ruby/core/proc/inspect_spec.rb6
-rw-r--r--spec/ruby/core/proc/lambda_spec.rb60
-rw-r--r--spec/ruby/core/proc/new_spec.rb190
-rw-r--r--spec/ruby/core/proc/parameters_spec.rb95
-rw-r--r--spec/ruby/core/proc/shared/call.rb96
-rw-r--r--spec/ruby/core/proc/shared/call_arguments.rb7
-rw-r--r--spec/ruby/core/proc/shared/dup.rb10
-rw-r--r--spec/ruby/core/proc/shared/equal.rb100
-rw-r--r--spec/ruby/core/proc/shared/to_s.rb27
-rw-r--r--spec/ruby/core/proc/source_location_spec.rb72
-rw-r--r--spec/ruby/core/proc/to_proc_spec.rb9
-rw-r--r--spec/ruby/core/proc/to_s_spec.rb6
-rw-r--r--spec/ruby/core/proc/yield_spec.rb16
-rw-r--r--spec/ruby/core/process/abort_spec.rb6
-rw-r--r--spec/ruby/core/process/constants_spec.rb63
-rw-r--r--spec/ruby/core/process/daemon_spec.rb123
-rw-r--r--spec/ruby/core/process/detach_spec.rb46
-rw-r--r--spec/ruby/core/process/egid_spec.rb19
-rw-r--r--spec/ruby/core/process/euid_spec.rb59
-rw-r--r--spec/ruby/core/process/exec_spec.rb218
-rw-r--r--spec/ruby/core/process/exit_spec.rb10
-rw-r--r--spec/ruby/core/process/fixtures/common.rb84
-rw-r--r--spec/ruby/core/process/fixtures/daemon.rb111
-rw-r--r--spec/ruby/core/process/fixtures/kill.rb45
-rw-r--r--spec/ruby/core/process/fixtures/map_fd.rb8
-rw-r--r--spec/ruby/core/process/fixtures/setpriority.rb12
-rw-r--r--spec/ruby/core/process/fork_spec.rb6
-rw-r--r--spec/ruby/core/process/getpgid_spec.rb17
-rw-r--r--spec/ruby/core/process/getpgrp_spec.rb7
-rw-r--r--spec/ruby/core/process/getpriority_spec.rb23
-rw-r--r--spec/ruby/core/process/getrlimit_spec.rb91
-rw-r--r--spec/ruby/core/process/gid/change_privilege_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/eid_spec.rb9
-rw-r--r--spec/ruby/core/process/gid/grant_privilege_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/re_exchange_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/re_exchangeable_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/rid_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/sid_available_spec.rb5
-rw-r--r--spec/ruby/core/process/gid/switch_spec.rb5
-rw-r--r--spec/ruby/core/process/gid_spec.rb22
-rw-r--r--spec/ruby/core/process/groups_spec.rb64
-rw-r--r--spec/ruby/core/process/initgroups_spec.rb20
-rw-r--r--spec/ruby/core/process/kill_spec.rb128
-rw-r--r--spec/ruby/core/process/maxgroups_spec.rb19
-rw-r--r--spec/ruby/core/process/pid_spec.rb9
-rw-r--r--spec/ruby/core/process/ppid_spec.rb23
-rw-r--r--spec/ruby/core/process/set_proctitle_spec.rb23
-rw-r--r--spec/ruby/core/process/setpgid_spec.rb28
-rw-r--r--spec/ruby/core/process/setpgrp_spec.rb37
-rw-r--r--spec/ruby/core/process/setpriority_spec.rb41
-rw-r--r--spec/ruby/core/process/setrlimit_spec.rb232
-rw-r--r--spec/ruby/core/process/setsid_spec.rb37
-rw-r--r--spec/ruby/core/process/spawn_spec.rb636
-rw-r--r--spec/ruby/core/process/status/bit_and_spec.rb5
-rw-r--r--spec/ruby/core/process/status/coredump_spec.rb5
-rw-r--r--spec/ruby/core/process/status/equal_value_spec.rb5
-rw-r--r--spec/ruby/core/process/status/exited_spec.rb37
-rw-r--r--spec/ruby/core/process/status/exitstatus_spec.rb13
-rw-r--r--spec/ruby/core/process/status/inspect_spec.rb5
-rw-r--r--spec/ruby/core/process/status/pid_spec.rb15
-rw-r--r--spec/ruby/core/process/status/right_shift_spec.rb5
-rw-r--r--spec/ruby/core/process/status/signaled_spec.rb35
-rw-r--r--spec/ruby/core/process/status/stopped_spec.rb5
-rw-r--r--spec/ruby/core/process/status/stopsig_spec.rb5
-rw-r--r--spec/ruby/core/process/status/success_spec.rb51
-rw-r--r--spec/ruby/core/process/status/termsig_spec.rb39
-rw-r--r--spec/ruby/core/process/status/to_i_spec.rb5
-rw-r--r--spec/ruby/core/process/status/to_int_spec.rb5
-rw-r--r--spec/ruby/core/process/status/to_s_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/getegid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/geteuid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/getgid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/getuid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/issetugid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setegid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/seteuid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setgid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setregid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setresgid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setresuid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setreuid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setrgid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setruid_spec.rb5
-rw-r--r--spec/ruby/core/process/sys/setuid_spec.rb5
-rw-r--r--spec/ruby/core/process/times_spec.rb27
-rw-r--r--spec/ruby/core/process/uid/change_privilege_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/eid_spec.rb9
-rw-r--r--spec/ruby/core/process/uid/grant_privilege_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/re_exchange_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/re_exchangeable_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/rid_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/sid_available_spec.rb5
-rw-r--r--spec/ruby/core/process/uid/switch_spec.rb5
-rw-r--r--spec/ruby/core/process/uid_spec.rb84
-rw-r--r--spec/ruby/core/process/wait2_spec.rb32
-rw-r--r--spec/ruby/core/process/wait_spec.rb90
-rw-r--r--spec/ruby/core/process/waitall_spec.rb48
-rw-r--r--spec/ruby/core/process/waitpid2_spec.rb5
-rw-r--r--spec/ruby/core/process/waitpid_spec.rb15
-rw-r--r--spec/ruby/core/random/bytes_spec.rb39
-rw-r--r--spec/ruby/core/random/default_spec.rb7
-rw-r--r--spec/ruby/core/random/equal_value_spec.rb37
-rw-r--r--spec/ruby/core/random/new_seed_spec.rb24
-rw-r--r--spec/ruby/core/random/new_spec.rb37
-rw-r--r--spec/ruby/core/random/rand_spec.rb216
-rw-r--r--spec/ruby/core/random/raw_seed_spec.rb9
-rw-r--r--spec/ruby/core/random/seed_spec.rb29
-rw-r--r--spec/ruby/core/random/shared/urandom.rb23
-rw-r--r--spec/ruby/core/random/srand_spec.rb39
-rw-r--r--spec/ruby/core/random/urandom_spec.rb9
-rw-r--r--spec/ruby/core/range/begin_spec.rb6
-rw-r--r--spec/ruby/core/range/bsearch_spec.rb137
-rw-r--r--spec/ruby/core/range/case_compare_spec.rb11
-rw-r--r--spec/ruby/core/range/cover_spec.rb9
-rw-r--r--spec/ruby/core/range/dup_spec.rb15
-rw-r--r--spec/ruby/core/range/each_spec.rb66
-rw-r--r--spec/ruby/core/range/end_spec.rb6
-rw-r--r--spec/ruby/core/range/eql_spec.rb10
-rw-r--r--spec/ruby/core/range/equal_value_spec.rb10
-rw-r--r--spec/ruby/core/range/exclude_end_spec.rb19
-rw-r--r--spec/ruby/core/range/first_spec.rb49
-rw-r--r--spec/ruby/core/range/fixtures/classes.rb65
-rw-r--r--spec/ruby/core/range/hash_spec.rb24
-rw-r--r--spec/ruby/core/range/include_spec.rb10
-rw-r--r--spec/ruby/core/range/initialize_spec.rb41
-rw-r--r--spec/ruby/core/range/inspect_spec.rb26
-rw-r--r--spec/ruby/core/range/last_spec.rb49
-rw-r--r--spec/ruby/core/range/max_spec.rb82
-rw-r--r--spec/ruby/core/range/member_spec.rb10
-rw-r--r--spec/ruby/core/range/min_spec.rb75
-rw-r--r--spec/ruby/core/range/new_spec.rb34
-rw-r--r--spec/ruby/core/range/range_spec.rb7
-rw-r--r--spec/ruby/core/range/shared/begin.rb10
-rw-r--r--spec/ruby/core/range/shared/cover.rb93
-rw-r--r--spec/ruby/core/range/shared/cover_and_include.rb66
-rw-r--r--spec/ruby/core/range/shared/end.rb10
-rw-r--r--spec/ruby/core/range/shared/equal_value.rb45
-rw-r--r--spec/ruby/core/range/shared/include.rb91
-rw-r--r--spec/ruby/core/range/size_spec.rb31
-rw-r--r--spec/ruby/core/range/step_spec.rb347
-rw-r--r--spec/ruby/core/range/to_a_spec.rb22
-rw-r--r--spec/ruby/core/range/to_s_spec.rb25
-rw-r--r--spec/ruby/core/rational/abs_spec.rb5
-rw-r--r--spec/ruby/core/rational/ceil_spec.rb5
-rw-r--r--spec/ruby/core/rational/coerce_spec.rb5
-rw-r--r--spec/ruby/core/rational/comparison_spec.rb21
-rw-r--r--spec/ruby/core/rational/denominator_spec.rb5
-rw-r--r--spec/ruby/core/rational/div_spec.rb17
-rw-r--r--spec/ruby/core/rational/divide_spec.rb17
-rw-r--r--spec/ruby/core/rational/divmod_spec.rb13
-rw-r--r--spec/ruby/core/rational/equal_value_spec.rb17
-rw-r--r--spec/ruby/core/rational/exponent_spec.rb5
-rw-r--r--spec/ruby/core/rational/fdiv_spec.rb5
-rw-r--r--spec/ruby/core/rational/floor_spec.rb5
-rw-r--r--spec/ruby/core/rational/hash_spec.rb5
-rw-r--r--spec/ruby/core/rational/inspect_spec.rb5
-rw-r--r--spec/ruby/core/rational/integer_spec.rb9
-rw-r--r--spec/ruby/core/rational/magnitude_spec.rb5
-rw-r--r--spec/ruby/core/rational/marshal_dump_spec.rb11
-rw-r--r--spec/ruby/core/rational/minus_spec.rb5
-rw-r--r--spec/ruby/core/rational/modulo_spec.rb5
-rw-r--r--spec/ruby/core/rational/multiply_spec.rb17
-rw-r--r--spec/ruby/core/rational/numerator_spec.rb5
-rw-r--r--spec/ruby/core/rational/plus_spec.rb16
-rw-r--r--spec/ruby/core/rational/quo_spec.rb5
-rw-r--r--spec/ruby/core/rational/rational_spec.rb7
-rw-r--r--spec/ruby/core/rational/rationalize_spec.rb36
-rw-r--r--spec/ruby/core/rational/remainder_spec.rb5
-rw-r--r--spec/ruby/core/rational/round_spec.rb5
-rw-r--r--spec/ruby/core/rational/to_f_spec.rb5
-rw-r--r--spec/ruby/core/rational/to_i_spec.rb5
-rw-r--r--spec/ruby/core/rational/to_r_spec.rb20
-rw-r--r--spec/ruby/core/rational/to_s_spec.rb5
-rw-r--r--spec/ruby/core/rational/truncate_spec.rb5
-rw-r--r--spec/ruby/core/rational/zero_spec.rb13
-rw-r--r--spec/ruby/core/regexp/case_compare_spec.rb25
-rw-r--r--spec/ruby/core/regexp/casefold_spec.rb8
-rw-r--r--spec/ruby/core/regexp/compile_spec.rb18
-rw-r--r--spec/ruby/core/regexp/encoding_spec.rb58
-rw-r--r--spec/ruby/core/regexp/eql_spec.rb6
-rw-r--r--spec/ruby/core/regexp/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/regexp/escape_spec.rb6
-rw-r--r--spec/ruby/core/regexp/fixed_encoding_spec.rb36
-rw-r--r--spec/ruby/core/regexp/hash_spec.rb20
-rw-r--r--spec/ruby/core/regexp/initialize_spec.rb15
-rw-r--r--spec/ruby/core/regexp/inspect_spec.rb44
-rw-r--r--spec/ruby/core/regexp/last_match_spec.rb14
-rw-r--r--spec/ruby/core/regexp/match_spec.rb148
-rw-r--r--spec/ruby/core/regexp/named_captures_spec.rb35
-rw-r--r--spec/ruby/core/regexp/names_spec.rb29
-rw-r--r--spec/ruby/core/regexp/new_spec.rb30
-rw-r--r--spec/ruby/core/regexp/options_spec.rb54
-rw-r--r--spec/ruby/core/regexp/quote_spec.rb6
-rw-r--r--spec/ruby/core/regexp/shared/equal_value.rb31
-rw-r--r--spec/ruby/core/regexp/shared/new_ascii.rb464
-rw-r--r--spec/ruby/core/regexp/shared/new_ascii_8bit.rb553
-rw-r--r--spec/ruby/core/regexp/shared/quote.rb31
-rw-r--r--spec/ruby/core/regexp/source_spec.rb29
-rw-r--r--spec/ruby/core/regexp/to_s_spec.rb62
-rw-r--r--spec/ruby/core/regexp/try_convert_spec.rb21
-rw-r--r--spec/ruby/core/regexp/union_spec.rb149
-rw-r--r--spec/ruby/core/signal/list_spec.rb64
-rw-r--r--spec/ruby/core/signal/signame_spec.rb23
-rw-r--r--spec/ruby/core/signal/trap_spec.rb135
-rw-r--r--spec/ruby/core/string/allocate_spec.rb19
-rw-r--r--spec/ruby/core/string/append_spec.rb8
-rw-r--r--spec/ruby/core/string/ascii_only_spec.rb85
-rw-r--r--spec/ruby/core/string/b_spec.rb24
-rw-r--r--spec/ruby/core/string/bytes_spec.rb57
-rw-r--r--spec/ruby/core/string/bytesize_spec.rb37
-rw-r--r--spec/ruby/core/string/byteslice_spec.rb29
-rw-r--r--spec/ruby/core/string/capitalize_spec.rb70
-rw-r--r--spec/ruby/core/string/case_compare_spec.rb8
-rw-r--r--spec/ruby/core/string/casecmp_spec.rb184
-rw-r--r--spec/ruby/core/string/center_spec.rb133
-rw-r--r--spec/ruby/core/string/chars_spec.rb11
-rw-r--r--spec/ruby/core/string/chomp_spec.rb387
-rw-r--r--spec/ruby/core/string/chop_spec.rb128
-rw-r--r--spec/ruby/core/string/chr_spec.rb44
-rw-r--r--spec/ruby/core/string/clear_spec.rb39
-rw-r--r--spec/ruby/core/string/clone_spec.rb58
-rw-r--r--spec/ruby/core/string/codepoints_spec.rb20
-rw-r--r--spec/ruby/core/string/comparison_spec.rb108
-rw-r--r--spec/ruby/core/string/concat_spec.rb28
-rw-r--r--spec/ruby/core/string/count_spec.rb105
-rw-r--r--spec/ruby/core/string/crypt_spec.rb75
-rw-r--r--spec/ruby/core/string/delete_prefix_spec.rb81
-rw-r--r--spec/ruby/core/string/delete_spec.rb119
-rw-r--r--spec/ruby/core/string/delete_suffix_spec.rb81
-rw-r--r--spec/ruby/core/string/downcase_spec.rb73
-rw-r--r--spec/ruby/core/string/dump_spec.rb424
-rw-r--r--spec/ruby/core/string/dup_spec.rb52
-rw-r--r--spec/ruby/core/string/each_byte_spec.rb61
-rw-r--r--spec/ruby/core/string/each_char_spec.rb7
-rw-r--r--spec/ruby/core/string/each_codepoint_spec.rb10
-rw-r--r--spec/ruby/core/string/each_line_spec.rb9
-rw-r--r--spec/ruby/core/string/element_reference_spec.rb35
-rw-r--r--spec/ruby/core/string/element_set_spec.rb612
-rw-r--r--spec/ruby/core/string/empty_spec.rb12
-rw-r--r--spec/ruby/core/string/encode_spec.rb159
-rw-r--r--spec/ruby/core/string/encoding_spec.rb189
-rw-r--r--spec/ruby/core/string/end_with_spec.rb50
-rw-r--r--spec/ruby/core/string/eql_spec.rb21
-rw-r--r--spec/ruby/core/string/equal_value_spec.rb8
-rw-r--r--spec/ruby/core/string/fixtures/classes.rb49
-rw-r--r--spec/ruby/core/string/fixtures/freeze_magic_comment.rb3
-rw-r--r--spec/ruby/core/string/fixtures/iso-8859-9-encoding.rb9
-rw-r--r--spec/ruby/core/string/fixtures/utf-8-encoding.rb7
-rw-r--r--spec/ruby/core/string/force_encoding_spec.rb53
-rw-r--r--spec/ruby/core/string/freeze_spec.rb18
-rw-r--r--spec/ruby/core/string/getbyte_spec.rb69
-rw-r--r--spec/ruby/core/string/gsub_spec.rb696
-rw-r--r--spec/ruby/core/string/hash_spec.rb9
-rw-r--r--spec/ruby/core/string/hex_spec.rb49
-rw-r--r--spec/ruby/core/string/include_spec.rb35
-rw-r--r--spec/ruby/core/string/index_spec.rb316
-rw-r--r--spec/ruby/core/string/initialize_spec.rb26
-rw-r--r--spec/ruby/core/string/insert_spec.rb84
-rw-r--r--spec/ruby/core/string/inspect_spec.rb492
-rw-r--r--spec/ruby/core/string/intern_spec.rb7
-rw-r--r--spec/ruby/core/string/length_spec.rb7
-rw-r--r--spec/ruby/core/string/lines_spec.rb22
-rw-r--r--spec/ruby/core/string/ljust_spec.rb116
-rw-r--r--spec/ruby/core/string/lstrip_spec.rb50
-rw-r--r--spec/ruby/core/string/match_spec.rb175
-rw-r--r--spec/ruby/core/string/modulo_spec.rb789
-rw-r--r--spec/ruby/core/string/multiply_spec.rb7
-rw-r--r--spec/ruby/core/string/new_spec.rb65
-rw-r--r--spec/ruby/core/string/next_spec.rb11
-rw-r--r--spec/ruby/core/string/oct_spec.rb88
-rw-r--r--spec/ruby/core/string/ord_spec.rb30
-rw-r--r--spec/ruby/core/string/partition_spec.rb38
-rw-r--r--spec/ruby/core/string/percent_spec.rb14
-rw-r--r--spec/ruby/core/string/plus_spec.rb47
-rw-r--r--spec/ruby/core/string/prepend_spec.rb64
-rw-r--r--spec/ruby/core/string/replace_spec.rb7
-rw-r--r--spec/ruby/core/string/reverse_spec.rb52
-rw-r--r--spec/ruby/core/string/rindex_spec.rb368
-rw-r--r--spec/ruby/core/string/rjust_spec.rb116
-rw-r--r--spec/ruby/core/string/rpartition_spec.rb33
-rw-r--r--spec/ruby/core/string/rstrip_spec.rb52
-rw-r--r--spec/ruby/core/string/scan_spec.rb192
-rw-r--r--spec/ruby/core/string/scrub_spec.rb101
-rw-r--r--spec/ruby/core/string/setbyte_spec.rb105
-rw-r--r--spec/ruby/core/string/shared/chars.rb80
-rw-r--r--spec/ruby/core/string/shared/codepoints.rb56
-rw-r--r--spec/ruby/core/string/shared/concat.rb160
-rw-r--r--spec/ruby/core/string/shared/each_char_without_block.rb26
-rw-r--r--spec/ruby/core/string/shared/each_codepoint_without_block.rb33
-rw-r--r--spec/ruby/core/string/shared/each_line.rb150
-rw-r--r--spec/ruby/core/string/shared/each_line_without_block.rb17
-rw-r--r--spec/ruby/core/string/shared/encode.rb247
-rw-r--r--spec/ruby/core/string/shared/eql.rb34
-rw-r--r--spec/ruby/core/string/shared/equal_value.rb29
-rw-r--r--spec/ruby/core/string/shared/length.rb28
-rw-r--r--spec/ruby/core/string/shared/replace.rb75
-rw-r--r--spec/ruby/core/string/shared/slice.rb557
-rw-r--r--spec/ruby/core/string/shared/succ.rb88
-rw-r--r--spec/ruby/core/string/shared/to_a.rb9
-rw-r--r--spec/ruby/core/string/shared/to_s.rb18
-rw-r--r--spec/ruby/core/string/shared/to_sym.rb63
-rw-r--r--spec/ruby/core/string/size_spec.rb7
-rw-r--r--spec/ruby/core/string/slice_spec.rb476
-rw-r--r--spec/ruby/core/string/split_spec.rb405
-rw-r--r--spec/ruby/core/string/squeeze_spec.rb113
-rw-r--r--spec/ruby/core/string/start_with_spec.rb45
-rw-r--r--spec/ruby/core/string/string_spec.rb7
-rw-r--r--spec/ruby/core/string/strip_spec.rb60
-rw-r--r--spec/ruby/core/string/sub_spec.rb571
-rw-r--r--spec/ruby/core/string/succ_spec.rb11
-rw-r--r--spec/ruby/core/string/sum_spec.rb22
-rw-r--r--spec/ruby/core/string/swapcase_spec.rb66
-rw-r--r--spec/ruby/core/string/to_c_spec.rb99
-rw-r--r--spec/ruby/core/string/to_f_spec.rb69
-rw-r--r--spec/ruby/core/string/to_i_spec.rb337
-rw-r--r--spec/ruby/core/string/to_r_spec.rb58
-rw-r--r--spec/ruby/core/string/to_s_spec.rb7
-rw-r--r--spec/ruby/core/string/to_str_spec.rb7
-rw-r--r--spec/ruby/core/string/to_sym_spec.rb7
-rw-r--r--spec/ruby/core/string/tr_s_spec.rb136
-rw-r--r--spec/ruby/core/string/tr_spec.rb131
-rw-r--r--spec/ruby/core/string/try_convert_spec.rb50
-rw-r--r--spec/ruby/core/string/uminus_spec.rb21
-rw-r--r--spec/ruby/core/string/unicode_normalize_spec.rb115
-rw-r--r--spec/ruby/core/string/unicode_normalized_spec.rb74
-rw-r--r--spec/ruby/core/string/unpack/a_spec.rb63
-rw-r--r--spec/ruby/core/string/unpack/at_spec.rb29
-rw-r--r--spec/ruby/core/string/unpack/b_spec.rb190
-rw-r--r--spec/ruby/core/string/unpack/c_spec.rb63
-rw-r--r--spec/ruby/core/string/unpack/comment_spec.rb25
-rw-r--r--spec/ruby/core/string/unpack/d_spec.rb28
-rw-r--r--spec/ruby/core/string/unpack/e_spec.rb14
-rw-r--r--spec/ruby/core/string/unpack/f_spec.rb28
-rw-r--r--spec/ruby/core/string/unpack/g_spec.rb14
-rw-r--r--spec/ruby/core/string/unpack/h_spec.rb124
-rw-r--r--spec/ruby/core/string/unpack/i_spec.rb152
-rw-r--r--spec/ruby/core/string/unpack/j_spec.rb277
-rw-r--r--spec/ruby/core/string/unpack/l_spec.rb265
-rw-r--r--spec/ruby/core/string/unpack/m_spec.rb170
-rw-r--r--spec/ruby/core/string/unpack/n_spec.rb18
-rw-r--r--spec/ruby/core/string/unpack/p_spec.rb21
-rw-r--r--spec/ruby/core/string/unpack/percent_spec.rb7
-rw-r--r--spec/ruby/core/string/unpack/q_spec.rb64
-rw-r--r--spec/ruby/core/string/unpack/s_spec.rb152
-rw-r--r--spec/ruby/core/string/unpack/shared/basic.rb29
-rw-r--r--spec/ruby/core/string/unpack/shared/float.rb271
-rw-r--r--spec/ruby/core/string/unpack/shared/integer.rb339
-rw-r--r--spec/ruby/core/string/unpack/shared/string.rb51
-rw-r--r--spec/ruby/core/string/unpack/shared/unicode.rb60
-rw-r--r--spec/ruby/core/string/unpack/u_spec.rb94
-rw-r--r--spec/ruby/core/string/unpack/v_spec.rb18
-rw-r--r--spec/ruby/core/string/unpack/w_spec.rb25
-rw-r--r--spec/ruby/core/string/unpack/x_spec.rb62
-rw-r--r--spec/ruby/core/string/unpack/z_spec.rb21
-rw-r--r--spec/ruby/core/string/unpack1_spec.rb12
-rw-r--r--spec/ruby/core/string/upcase_spec.rb68
-rw-r--r--spec/ruby/core/string/uplus_spec.rb24
-rw-r--r--spec/ruby/core/string/upto_spec.rb98
-rw-r--r--spec/ruby/core/string/valid_encoding_spec.rb129
-rw-r--r--spec/ruby/core/struct/dig_spec.rb44
-rw-r--r--spec/ruby/core/struct/dup_spec.rb20
-rw-r--r--spec/ruby/core/struct/each_pair_spec.rb33
-rw-r--r--spec/ruby/core/struct/each_spec.rb27
-rw-r--r--spec/ruby/core/struct/element_reference_spec.rb52
-rw-r--r--spec/ruby/core/struct/element_set_spec.rb29
-rw-r--r--spec/ruby/core/struct/eql_spec.rb13
-rw-r--r--spec/ruby/core/struct/equal_value_spec.rb7
-rw-r--r--spec/ruby/core/struct/fixtures/classes.rb26
-rw-r--r--spec/ruby/core/struct/hash_spec.rb46
-rw-r--r--spec/ruby/core/struct/initialize_spec.rb43
-rw-r--r--spec/ruby/core/struct/inspect_spec.rb15
-rw-r--r--spec/ruby/core/struct/instance_variables_spec.rb16
-rw-r--r--spec/ruby/core/struct/length_spec.rb12
-rw-r--r--spec/ruby/core/struct/members_spec.rb13
-rw-r--r--spec/ruby/core/struct/new_spec.rb134
-rw-r--r--spec/ruby/core/struct/select_spec.rb30
-rw-r--r--spec/ruby/core/struct/shared/accessor.rb7
-rw-r--r--spec/ruby/core/struct/shared/equal_value.rb30
-rw-r--r--spec/ruby/core/struct/shared/inspect.rb5
-rw-r--r--spec/ruby/core/struct/size_spec.rb11
-rw-r--r--spec/ruby/core/struct/struct_spec.rb43
-rw-r--r--spec/ruby/core/struct/tms/cstime_spec.rb9
-rw-r--r--spec/ruby/core/struct/tms/cutime_spec.rb9
-rw-r--r--spec/ruby/core/struct/tms/element_reference_spec.rb5
-rw-r--r--spec/ruby/core/struct/tms/members_spec.rb5
-rw-r--r--spec/ruby/core/struct/tms/new_spec.rb5
-rw-r--r--spec/ruby/core/struct/tms/stime_spec.rb9
-rw-r--r--spec/ruby/core/struct/tms/utime_spec.rb9
-rw-r--r--spec/ruby/core/struct/to_a_spec.rb12
-rw-r--r--spec/ruby/core/struct/to_h_spec.rb15
-rw-r--r--spec/ruby/core/struct/to_s_spec.rb12
-rw-r--r--spec/ruby/core/struct/values_at_spec.rb16
-rw-r--r--spec/ruby/core/struct/values_spec.rb11
-rw-r--r--spec/ruby/core/symbol/all_symbols_spec.rb14
-rw-r--r--spec/ruby/core/symbol/capitalize_spec.rb56
-rw-r--r--spec/ruby/core/symbol/case_compare_spec.rb11
-rw-r--r--spec/ruby/core/symbol/casecmp_spec.rb146
-rw-r--r--spec/ruby/core/symbol/comparison_spec.rb51
-rw-r--r--spec/ruby/core/symbol/downcase_spec.rb33
-rw-r--r--spec/ruby/core/symbol/dup_spec.rb9
-rw-r--r--spec/ruby/core/symbol/element_reference_spec.rb6
-rw-r--r--spec/ruby/core/symbol/empty_spec.rb11
-rw-r--r--spec/ruby/core/symbol/encoding_spec.rb23
-rw-r--r--spec/ruby/core/symbol/equal_value_spec.rb14
-rw-r--r--spec/ruby/core/symbol/fixtures/classes.rb3
-rw-r--r--spec/ruby/core/symbol/id2name_spec.rb6
-rw-r--r--spec/ruby/core/symbol/inspect_spec.rb105
-rw-r--r--spec/ruby/core/symbol/intern_spec.rb11
-rw-r--r--spec/ruby/core/symbol/length_spec.rb6
-rw-r--r--spec/ruby/core/symbol/match_spec.rb70
-rw-r--r--spec/ruby/core/symbol/next_spec.rb6
-rw-r--r--spec/ruby/core/symbol/shared/id2name.rb9
-rw-r--r--spec/ruby/core/symbol/shared/length.rb23
-rw-r--r--spec/ruby/core/symbol/shared/slice.rb278
-rw-r--r--spec/ruby/core/symbol/shared/succ.rb18
-rw-r--r--spec/ruby/core/symbol/size_spec.rb6
-rw-r--r--spec/ruby/core/symbol/slice_spec.rb6
-rw-r--r--spec/ruby/core/symbol/succ_spec.rb6
-rw-r--r--spec/ruby/core/symbol/swapcase_spec.rb41
-rw-r--r--spec/ruby/core/symbol/symbol_spec.rb19
-rw-r--r--spec/ruby/core/symbol/to_proc_spec.rb41
-rw-r--r--spec/ruby/core/symbol/to_s_spec.rb6
-rw-r--r--spec/ruby/core/symbol/to_sym_spec.rb9
-rw-r--r--spec/ruby/core/symbol/upcase_spec.rb29
-rw-r--r--spec/ruby/core/systemexit/initialize_spec.rb27
-rw-r--r--spec/ruby/core/systemexit/success_spec.rb13
-rw-r--r--spec/ruby/core/thread/abort_on_exception_spec.rb106
-rw-r--r--spec/ruby/core/thread/add_trace_func_spec.rb5
-rw-r--r--spec/ruby/core/thread/alive_spec.rb58
-rw-r--r--spec/ruby/core/thread/allocate_spec.rb9
-rw-r--r--spec/ruby/core/thread/backtrace/location/absolute_path_spec.rb12
-rw-r--r--spec/ruby/core/thread/backtrace/location/base_label_spec.rb12
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/classes.rb17
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/main.rb5
-rw-r--r--spec/ruby/core/thread/backtrace/location/inspect_spec.rb13
-rw-r--r--spec/ruby/core/thread/backtrace/location/label_spec.rb20
-rw-r--r--spec/ruby/core/thread/backtrace/location/lineno_spec.rb13
-rw-r--r--spec/ruby/core/thread/backtrace/location/path_spec.rb91
-rw-r--r--spec/ruby/core/thread/backtrace/location/to_s_spec.rb13
-rw-r--r--spec/ruby/core/thread/backtrace_spec.rb27
-rw-r--r--spec/ruby/core/thread/current_spec.rb15
-rw-r--r--spec/ruby/core/thread/element_reference_spec.rb44
-rw-r--r--spec/ruby/core/thread/element_set_spec.rb51
-rw-r--r--spec/ruby/core/thread/exclusive_spec.rb18
-rw-r--r--spec/ruby/core/thread/exit_spec.rb15
-rw-r--r--spec/ruby/core/thread/fixtures/classes.rb303
-rw-r--r--spec/ruby/core/thread/fork_spec.rb9
-rw-r--r--spec/ruby/core/thread/group_spec.rb5
-rw-r--r--spec/ruby/core/thread/initialize_spec.rb27
-rw-r--r--spec/ruby/core/thread/inspect_spec.rb44
-rw-r--r--spec/ruby/core/thread/join_spec.rb65
-rw-r--r--spec/ruby/core/thread/key_spec.rb53
-rw-r--r--spec/ruby/core/thread/keys_spec.rb44
-rw-r--r--spec/ruby/core/thread/kill_spec.rb21
-rw-r--r--spec/ruby/core/thread/list_spec.rb42
-rw-r--r--spec/ruby/core/thread/main_spec.rb10
-rw-r--r--spec/ruby/core/thread/name_spec.rb56
-rw-r--r--spec/ruby/core/thread/new_spec.rb56
-rw-r--r--spec/ruby/core/thread/pass_spec.rb8
-rw-r--r--spec/ruby/core/thread/priority_spec.rb68
-rw-r--r--spec/ruby/core/thread/raise_spec.rb181
-rw-r--r--spec/ruby/core/thread/report_on_exception_spec.rb120
-rw-r--r--spec/ruby/core/thread/run_spec.rb9
-rw-r--r--spec/ruby/core/thread/set_trace_func_spec.rb5
-rw-r--r--spec/ruby/core/thread/shared/exit.rb176
-rw-r--r--spec/ruby/core/thread/shared/start.rb41
-rw-r--r--spec/ruby/core/thread/shared/wakeup.rb61
-rw-r--r--spec/ruby/core/thread/start_spec.rb9
-rw-r--r--spec/ruby/core/thread/status_spec.rb60
-rw-r--r--spec/ruby/core/thread/stop_spec.rb54
-rw-r--r--spec/ruby/core/thread/terminate_spec.rb7
-rw-r--r--spec/ruby/core/thread/thread_variable_get_spec.rb25
-rw-r--r--spec/ruby/core/thread/thread_variable_set_spec.rb26
-rw-r--r--spec/ruby/core/thread/thread_variable_spec.rb21
-rw-r--r--spec/ruby/core/thread/thread_variables_spec.rb29
-rw-r--r--spec/ruby/core/thread/value_spec.rb21
-rw-r--r--spec/ruby/core/thread/wakeup_spec.rb7
-rw-r--r--spec/ruby/core/threadgroup/add_spec.rb36
-rw-r--r--spec/ruby/core/threadgroup/default_spec.rb11
-rw-r--r--spec/ruby/core/threadgroup/enclose_spec.rb25
-rw-r--r--spec/ruby/core/threadgroup/enclosed_spec.rb14
-rw-r--r--spec/ruby/core/threadgroup/fixtures/classes.rb6
-rw-r--r--spec/ruby/core/threadgroup/list_spec.rb24
-rw-r--r--spec/ruby/core/time/_dump_spec.rb56
-rw-r--r--spec/ruby/core/time/_load_spec.rb54
-rw-r--r--spec/ruby/core/time/asctime_spec.rb6
-rw-r--r--spec/ruby/core/time/at_spec.rb201
-rw-r--r--spec/ruby/core/time/comparison_spec.rb94
-rw-r--r--spec/ruby/core/time/ctime_spec.rb6
-rw-r--r--spec/ruby/core/time/day_spec.rb6
-rw-r--r--spec/ruby/core/time/dst_spec.rb6
-rw-r--r--spec/ruby/core/time/dup_spec.rb46
-rw-r--r--spec/ruby/core/time/eql_spec.rb29
-rw-r--r--spec/ruby/core/time/fixtures/classes.rb12
-rw-r--r--spec/ruby/core/time/friday_spec.rb11
-rw-r--r--spec/ruby/core/time/getgm_spec.rb6
-rw-r--r--spec/ruby/core/time/getlocal_spec.rb98
-rw-r--r--spec/ruby/core/time/getutc_spec.rb6
-rw-r--r--spec/ruby/core/time/gm_spec.rb10
-rw-r--r--spec/ruby/core/time/gmt_offset_spec.rb6
-rw-r--r--spec/ruby/core/time/gmt_spec.rb8
-rw-r--r--spec/ruby/core/time/gmtime_spec.rb6
-rw-r--r--spec/ruby/core/time/gmtoff_spec.rb6
-rw-r--r--spec/ruby/core/time/hash_spec.rb11
-rw-r--r--spec/ruby/core/time/hour_spec.rb17
-rw-r--r--spec/ruby/core/time/inspect_spec.rb6
-rw-r--r--spec/ruby/core/time/isdst_spec.rb6
-rw-r--r--spec/ruby/core/time/local_spec.rb11
-rw-r--r--spec/ruby/core/time/localtime_spec.rb140
-rw-r--r--spec/ruby/core/time/mday_spec.rb6
-rw-r--r--spec/ruby/core/time/min_spec.rb17
-rw-r--r--spec/ruby/core/time/minus_spec.rb103
-rw-r--r--spec/ruby/core/time/mktime_spec.rb11
-rw-r--r--spec/ruby/core/time/mon_spec.rb6
-rw-r--r--spec/ruby/core/time/monday_spec.rb11
-rw-r--r--spec/ruby/core/time/month_spec.rb6
-rw-r--r--spec/ruby/core/time/new_spec.rb99
-rw-r--r--spec/ruby/core/time/now_spec.rb6
-rw-r--r--spec/ruby/core/time/nsec_spec.rb27
-rw-r--r--spec/ruby/core/time/plus_spec.rb100
-rw-r--r--spec/ruby/core/time/round_spec.rb35
-rw-r--r--spec/ruby/core/time/saturday_spec.rb11
-rw-r--r--spec/ruby/core/time/sec_spec.rb7
-rw-r--r--spec/ruby/core/time/shared/asctime.rb6
-rw-r--r--spec/ruby/core/time/shared/day.rb15
-rw-r--r--spec/ruby/core/time/shared/getgm.rb9
-rw-r--r--spec/ruby/core/time/shared/gm.rb29
-rw-r--r--spec/ruby/core/time/shared/gmt_offset.rb53
-rw-r--r--spec/ruby/core/time/shared/gmtime.rb33
-rw-r--r--spec/ruby/core/time/shared/inspect.rb23
-rw-r--r--spec/ruby/core/time/shared/isdst.rb8
-rw-r--r--spec/ruby/core/time/shared/local.rb45
-rw-r--r--spec/ruby/core/time/shared/month.rb15
-rw-r--r--spec/ruby/core/time/shared/now.rb20
-rw-r--r--spec/ruby/core/time/shared/time_params.rb258
-rw-r--r--spec/ruby/core/time/shared/to_i.rb9
-rw-r--r--spec/ruby/core/time/strftime_spec.rb52
-rw-r--r--spec/ruby/core/time/subsec_spec.rb27
-rw-r--r--spec/ruby/core/time/succ_spec.rb19
-rw-r--r--spec/ruby/core/time/sunday_spec.rb11
-rw-r--r--spec/ruby/core/time/thursday_spec.rb11
-rw-r--r--spec/ruby/core/time/time_spec.rb7
-rw-r--r--spec/ruby/core/time/to_a_spec.rb12
-rw-r--r--spec/ruby/core/time/to_f_spec.rb7
-rw-r--r--spec/ruby/core/time/to_i_spec.rb6
-rw-r--r--spec/ruby/core/time/to_r_spec.rb11
-rw-r--r--spec/ruby/core/time/to_s_spec.rb6
-rw-r--r--spec/ruby/core/time/tuesday_spec.rb11
-rw-r--r--spec/ruby/core/time/tv_nsec_spec.rb5
-rw-r--r--spec/ruby/core/time/tv_sec_spec.rb6
-rw-r--r--spec/ruby/core/time/tv_usec_spec.rb5
-rw-r--r--spec/ruby/core/time/usec_spec.rb39
-rw-r--r--spec/ruby/core/time/utc_offset_spec.rb6
-rw-r--r--spec/ruby/core/time/utc_spec.rb21
-rw-r--r--spec/ruby/core/time/wday_spec.rb9
-rw-r--r--spec/ruby/core/time/wednesday_spec.rb11
-rw-r--r--spec/ruby/core/time/yday_spec.rb21
-rw-r--r--spec/ruby/core/time/year_spec.rb17
-rw-r--r--spec/ruby/core/time/zone_spec.rb90
-rw-r--r--spec/ruby/core/tracepoint/binding_spec.rb19
-rw-r--r--spec/ruby/core/tracepoint/callee_id_spec.rb20
-rw-r--r--spec/ruby/core/tracepoint/defined_class_spec.rb26
-rw-r--r--spec/ruby/core/tracepoint/disable_spec.rb73
-rw-r--r--spec/ruby/core/tracepoint/enable_spec.rb102
-rw-r--r--spec/ruby/core/tracepoint/enabled_spec.rb14
-rw-r--r--spec/ruby/core/tracepoint/event_spec.rb21
-rw-r--r--spec/ruby/core/tracepoint/fixtures/classes.rb34
-rw-r--r--spec/ruby/core/tracepoint/inspect_spec.rb8
-rw-r--r--spec/ruby/core/tracepoint/lineno_spec.rb10
-rw-r--r--spec/ruby/core/tracepoint/method_id_spec.rb13
-rw-r--r--spec/ruby/core/tracepoint/new_spec.rb68
-rw-r--r--spec/ruby/core/tracepoint/path_spec.rb18
-rw-r--r--spec/ruby/core/tracepoint/raised_exception_spec.rb16
-rw-r--r--spec/ruby/core/tracepoint/return_value_spec.rb13
-rw-r--r--spec/ruby/core/tracepoint/self_spec.rb10
-rw-r--r--spec/ruby/core/tracepoint/trace_spec.rb9
-rw-r--r--spec/ruby/core/true/and_spec.rb11
-rw-r--r--spec/ruby/core/true/dup_spec.rb9
-rw-r--r--spec/ruby/core/true/inspect_spec.rb7
-rw-r--r--spec/ruby/core/true/or_spec.rb11
-rw-r--r--spec/ruby/core/true/to_s_spec.rb7
-rw-r--r--spec/ruby/core/true/trueclass_spec.rb15
-rw-r--r--spec/ruby/core/true/xor_spec.rb11
-rw-r--r--spec/ruby/core/unboundmethod/arity_spec.rb207
-rw-r--r--spec/ruby/core/unboundmethod/bind_spec.rb51
-rw-r--r--spec/ruby/core/unboundmethod/clone_spec.rb12
-rw-r--r--spec/ruby/core/unboundmethod/eql_spec.rb5
-rw-r--r--spec/ruby/core/unboundmethod/equal_value_spec.rb101
-rw-r--r--spec/ruby/core/unboundmethod/fixtures/classes.rb86
-rw-r--r--spec/ruby/core/unboundmethod/hash_spec.rb17
-rw-r--r--spec/ruby/core/unboundmethod/inspect_spec.rb7
-rw-r--r--spec/ruby/core/unboundmethod/name_spec.rb15
-rw-r--r--spec/ruby/core/unboundmethod/owner_spec.rb26
-rw-r--r--spec/ruby/core/unboundmethod/parameters_spec.rb5
-rw-r--r--spec/ruby/core/unboundmethod/shared/to_s.rb25
-rw-r--r--spec/ruby/core/unboundmethod/source_location_spec.rb52
-rw-r--r--spec/ruby/core/unboundmethod/super_method_spec.rb28
-rw-r--r--spec/ruby/core/unboundmethod/to_s_spec.rb7
-rw-r--r--spec/ruby/core/warning/warn_spec.rb60
-rw-r--r--spec/ruby/default.mspec52
-rw-r--r--spec/ruby/fixtures/basicobject/method_missing.rb55
-rw-r--r--spec/ruby/fixtures/class.rb136
-rw-r--r--spec/ruby/fixtures/class_variables.rb58
-rw-r--r--spec/ruby/fixtures/code/a/load_fixture.bundle1
-rw-r--r--spec/ruby/fixtures/code/a/load_fixture.dll1
-rw-r--r--spec/ruby/fixtures/code/a/load_fixture.so1
-rw-r--r--spec/ruby/fixtures/code/b/load_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/concurrent.rb12
-rw-r--r--spec/ruby/fixtures/code/concurrent2.rb8
-rw-r--r--spec/ruby/fixtures/code/concurrent3.rb2
-rw-r--r--spec/ruby/fixtures/code/file_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/gem/load_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/line_fixture.rb5
-rw-r--r--spec/ruby/fixtures/code/load_ext_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/load_fixture1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.bundle1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.dll1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.ext1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.ext.bundle1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.ext.dll1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.ext.rb1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.ext.so1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/load_fixture.so1
-rw-r--r--spec/ruby/fixtures/code/load_wrap_method_fixture.rb9
-rw-r--r--spec/ruby/fixtures/code/methods_fixture.rb364
-rw-r--r--spec/ruby/fixtures/code/raise_fixture.rb1
-rw-r--r--spec/ruby/fixtures/code/recursive_load_fixture.rb5
-rw-r--r--spec/ruby/fixtures/code/recursive_require_fixture.rb3
-rw-r--r--spec/ruby/fixtures/code/symlink/symlink1.rb1
-rw-r--r--spec/ruby/fixtures/code/symlink/symlink2/symlink2.rb1
-rw-r--r--spec/ruby/fixtures/code/wrap_fixture.rb3
-rw-r--r--spec/ruby/fixtures/code_loading.rb26
-rw-r--r--spec/ruby/fixtures/constants.rb288
-rw-r--r--spec/ruby/fixtures/enumerator/classes.rb15
-rw-r--r--spec/ruby/fixtures/math/common.rb3
-rw-r--r--spec/ruby/fixtures/rational.rb11
-rw-r--r--spec/ruby/fixtures/reflection.rb352
-rw-r--r--spec/ruby/language/BEGIN_spec.rb36
-rw-r--r--spec/ruby/language/README30
-rw-r--r--spec/ruby/language/alias_spec.rb246
-rw-r--r--spec/ruby/language/and_spec.rb80
-rw-r--r--spec/ruby/language/array_spec.rb155
-rw-r--r--spec/ruby/language/block_spec.rb865
-rw-r--r--spec/ruby/language/break_spec.rb365
-rw-r--r--spec/ruby/language/case_spec.rb389
-rw-r--r--spec/ruby/language/class_spec.rb330
-rw-r--r--spec/ruby/language/class_variable_spec.rb84
-rw-r--r--spec/ruby/language/constants_spec.rb668
-rw-r--r--spec/ruby/language/def_spec.rb714
-rw-r--r--spec/ruby/language/defined_spec.rb1140
-rw-r--r--spec/ruby/language/encoding_spec.rb36
-rw-r--r--spec/ruby/language/ensure_spec.rb293
-rw-r--r--spec/ruby/language/execution_spec.rb15
-rw-r--r--spec/ruby/language/file_spec.rb29
-rw-r--r--spec/ruby/language/fixtures/argv_encoding.rb1
-rw-r--r--spec/ruby/language/fixtures/array.rb11
-rw-r--r--spec/ruby/language/fixtures/begin_file.rb3
-rw-r--r--spec/ruby/language/fixtures/binary_symbol.rb4
-rw-r--r--spec/ruby/language/fixtures/block.rb57
-rw-r--r--spec/ruby/language/fixtures/break.rb291
-rw-r--r--spec/ruby/language/fixtures/break_lambda_toplevel.rb9
-rw-r--r--spec/ruby/language/fixtures/break_lambda_toplevel_block.rb23
-rw-r--r--spec/ruby/language/fixtures/break_lambda_toplevel_method.rb17
-rw-r--r--spec/ruby/language/fixtures/classes.rb31
-rw-r--r--spec/ruby/language/fixtures/coding_us_ascii.rb11
-rw-r--r--spec/ruby/language/fixtures/coding_utf_8.rb11
-rw-r--r--spec/ruby/language/fixtures/constant_visibility.rb98
-rw-r--r--spec/ruby/language/fixtures/constants_sclass.rb54
-rw-r--r--spec/ruby/language/fixtures/def.rb8
-rw-r--r--spec/ruby/language/fixtures/defined.rb298
-rw-r--r--spec/ruby/language/fixtures/dollar_zero.rb6
-rw-r--r--spec/ruby/language/fixtures/ensure.rb77
-rw-r--r--spec/ruby/language/fixtures/file.rb1
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_across_files.rb5
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_across_files_diff_enc.rb5
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_across_files_no_comment.rb5
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_one_literal.rb4
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_required.rb3
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_required_diff_enc.rbbin181 -> 0 bytes-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_required_no_comment.rb1
-rw-r--r--spec/ruby/language/fixtures/freeze_magic_comment_two_literals.rb3
-rw-r--r--spec/ruby/language/fixtures/hash_strings_ascii8bit.rb7
-rw-r--r--spec/ruby/language/fixtures/hash_strings_usascii.rb7
-rw-r--r--spec/ruby/language/fixtures/hash_strings_utf8.rb7
-rw-r--r--spec/ruby/language/fixtures/match_operators.rb9
-rw-r--r--spec/ruby/language/fixtures/metaclass.rb34
-rw-r--r--spec/ruby/language/fixtures/module.rb24
-rw-r--r--spec/ruby/language/fixtures/next.rb134
-rw-r--r--spec/ruby/language/fixtures/precedence.rb16
-rw-r--r--spec/ruby/language/fixtures/private.rb59
-rw-r--r--spec/ruby/language/fixtures/rescue.rb63
-rw-r--r--spec/ruby/language/fixtures/return.rb139
-rw-r--r--spec/ruby/language/fixtures/send.rb140
-rw-r--r--spec/ruby/language/fixtures/squiggly_heredoc.rb39
-rw-r--r--spec/ruby/language/fixtures/super.rb664
-rw-r--r--spec/ruby/language/fixtures/variables.rb85
-rw-r--r--spec/ruby/language/fixtures/yield.rb37
-rw-r--r--spec/ruby/language/for_spec.rb177
-rw-r--r--spec/ruby/language/hash_spec.rb154
-rw-r--r--spec/ruby/language/heredoc_spec.rb87
-rw-r--r--spec/ruby/language/if_spec.rb373
-rw-r--r--spec/ruby/language/lambda_spec.rb573
-rw-r--r--spec/ruby/language/line_spec.rb45
-rw-r--r--spec/ruby/language/loop_spec.rb67
-rw-r--r--spec/ruby/language/magic_comment_spec.rb62
-rw-r--r--spec/ruby/language/match_spec.rb74
-rw-r--r--spec/ruby/language/metaclass_spec.rb143
-rw-r--r--spec/ruby/language/method_spec.rb1296
-rw-r--r--spec/ruby/language/module_spec.rb91
-rw-r--r--spec/ruby/language/next_spec.rb410
-rw-r--r--spec/ruby/language/not_spec.rb51
-rw-r--r--spec/ruby/language/numbers_spec.rb97
-rw-r--r--spec/ruby/language/optional_assignments_spec.rb226
-rw-r--r--spec/ruby/language/or_spec.rb90
-rw-r--r--spec/ruby/language/order_spec.rb75
-rw-r--r--spec/ruby/language/precedence_spec.rb448
-rw-r--r--spec/ruby/language/predefined/data_spec.rb29
-rw-r--r--spec/ruby/language/predefined/fixtures/data1.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/data2.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/data3.rb7
-rw-r--r--spec/ruby/language/predefined/fixtures/data4.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/data5.rb5
-rw-r--r--spec/ruby/language/predefined/fixtures/data_only.rb2
-rw-r--r--spec/ruby/language/predefined/fixtures/print_data.rb3
-rw-r--r--spec/ruby/language/predefined_spec.rb1240
-rw-r--r--spec/ruby/language/private_spec.rb67
-rw-r--r--spec/ruby/language/proc_spec.rb220
-rw-r--r--spec/ruby/language/redo_spec.rb66
-rw-r--r--spec/ruby/language/regexp/anchors_spec.rb179
-rw-r--r--spec/ruby/language/regexp/back-references_spec.rb48
-rw-r--r--spec/ruby/language/regexp/character_classes_spec.rb633
-rw-r--r--spec/ruby/language/regexp/encoding_spec.rb103
-rw-r--r--spec/ruby/language/regexp/escapes_spec.rb81
-rw-r--r--spec/ruby/language/regexp/grouping_spec.rb23
-rw-r--r--spec/ruby/language/regexp/interpolation_spec.rb58
-rw-r--r--spec/ruby/language/regexp/modifiers_spec.rb117
-rw-r--r--spec/ruby/language/regexp/repetition_spec.rb57
-rw-r--r--spec/ruby/language/regexp_spec.rb150
-rw-r--r--spec/ruby/language/rescue_spec.rb452
-rw-r--r--spec/ruby/language/retry_spec.rb52
-rw-r--r--spec/ruby/language/return_spec.rb483
-rw-r--r--spec/ruby/language/safe_navigator_spec.rb101
-rw-r--r--spec/ruby/language/send_spec.rb521
-rw-r--r--spec/ruby/language/shared/__FILE__.rb23
-rw-r--r--spec/ruby/language/shared/__LINE__.rb15
-rw-r--r--spec/ruby/language/singleton_class_spec.rb293
-rw-r--r--spec/ruby/language/string_spec.rb282
-rw-r--r--spec/ruby/language/super_spec.rb359
-rw-r--r--spec/ruby/language/symbol_spec.rb106
-rw-r--r--spec/ruby/language/throw_spec.rb81
-rw-r--r--spec/ruby/language/undef_spec.rb72
-rw-r--r--spec/ruby/language/unless_spec.rb43
-rw-r--r--spec/ruby/language/until_spec.rb234
-rw-r--r--spec/ruby/language/variables_spec.rb760
-rw-r--r--spec/ruby/language/while_spec.rb344
-rw-r--r--spec/ruby/language/yield_spec.rb179
-rw-r--r--spec/ruby/library/English/English_spec.rb171
-rw-r--r--spec/ruby/library/abbrev/abbrev_spec.rb31
-rw-r--r--spec/ruby/library/base64/decode64_spec.rb9
-rw-r--r--spec/ruby/library/base64/encode64_spec.rb14
-rw-r--r--spec/ruby/library/base64/urlsafe_decode64_spec.rb27
-rw-r--r--spec/ruby/library/base64/urlsafe_encode64_spec.rb22
-rw-r--r--spec/ruby/library/bigdecimal/abs_spec.rb50
-rw-r--r--spec/ruby/library/bigdecimal/add_spec.rb179
-rw-r--r--spec/ruby/library/bigdecimal/case_compare_spec.rb7
-rw-r--r--spec/ruby/library/bigdecimal/ceil_spec.rb104
-rw-r--r--spec/ruby/library/bigdecimal/coerce_spec.rb26
-rw-r--r--spec/ruby/library/bigdecimal/comparison_spec.rb81
-rw-r--r--spec/ruby/library/bigdecimal/div_spec.rb102
-rw-r--r--spec/ruby/library/bigdecimal/divide_spec.rb7
-rw-r--r--spec/ruby/library/bigdecimal/divmod_spec.rb180
-rw-r--r--spec/ruby/library/bigdecimal/double_fig_spec.rb9
-rw-r--r--spec/ruby/library/bigdecimal/eql_spec.rb6
-rw-r--r--spec/ruby/library/bigdecimal/equal_value_spec.rb7
-rw-r--r--spec/ruby/library/bigdecimal/exponent_spec.rb38
-rw-r--r--spec/ruby/library/bigdecimal/finite_spec.rb35
-rw-r--r--spec/ruby/library/bigdecimal/fix_spec.rb57
-rw-r--r--spec/ruby/library/bigdecimal/fixtures/classes.rb17
-rw-r--r--spec/ruby/library/bigdecimal/floor_spec.rb100
-rw-r--r--spec/ruby/library/bigdecimal/frac_spec.rb48
-rw-r--r--spec/ruby/library/bigdecimal/gt_spec.rb98
-rw-r--r--spec/ruby/library/bigdecimal/gte_spec.rb102
-rw-r--r--spec/ruby/library/bigdecimal/infinite_spec.rb32
-rw-r--r--spec/ruby/library/bigdecimal/inspect_spec.rb47
-rw-r--r--spec/ruby/library/bigdecimal/limit_spec.rb45
-rw-r--r--spec/ruby/library/bigdecimal/lt_spec.rb96
-rw-r--r--spec/ruby/library/bigdecimal/lte_spec.rb102
-rw-r--r--spec/ruby/library/bigdecimal/minus_spec.rb58
-rw-r--r--spec/ruby/library/bigdecimal/mode_spec.rb36
-rw-r--r--spec/ruby/library/bigdecimal/modulo_spec.rb12
-rw-r--r--spec/ruby/library/bigdecimal/mult_spec.rb24
-rw-r--r--spec/ruby/library/bigdecimal/multiply_spec.rb26
-rw-r--r--spec/ruby/library/bigdecimal/nan_spec.rb23
-rw-r--r--spec/ruby/library/bigdecimal/new_spec.rb109
-rw-r--r--spec/ruby/library/bigdecimal/nonzero_spec.rb29
-rw-r--r--spec/ruby/library/bigdecimal/plus_spec.rb47
-rw-r--r--spec/ruby/library/bigdecimal/power_spec.rb6
-rw-r--r--spec/ruby/library/bigdecimal/precs_spec.rb49
-rw-r--r--spec/ruby/library/bigdecimal/quo_spec.rb13
-rw-r--r--spec/ruby/library/bigdecimal/remainder_spec.rb84
-rw-r--r--spec/ruby/library/bigdecimal/round_spec.rb202
-rw-r--r--spec/ruby/library/bigdecimal/shared/eql.rb61
-rw-r--r--spec/ruby/library/bigdecimal/shared/modulo.rb116
-rw-r--r--spec/ruby/library/bigdecimal/shared/mult.rb97
-rw-r--r--spec/ruby/library/bigdecimal/shared/power.rb72
-rw-r--r--spec/ruby/library/bigdecimal/shared/quo.rb59
-rw-r--r--spec/ruby/library/bigdecimal/shared/to_int.rb16
-rw-r--r--spec/ruby/library/bigdecimal/sign_spec.rb47
-rw-r--r--spec/ruby/library/bigdecimal/split_spec.rb88
-rw-r--r--spec/ruby/library/bigdecimal/sqrt_spec.rb112
-rw-r--r--spec/ruby/library/bigdecimal/sub_spec.rb53
-rw-r--r--spec/ruby/library/bigdecimal/to_f_spec.rb55
-rw-r--r--spec/ruby/library/bigdecimal/to_i_spec.rb7
-rw-r--r--spec/ruby/library/bigdecimal/to_int_spec.rb8
-rw-r--r--spec/ruby/library/bigdecimal/to_r_spec.rb16
-rw-r--r--spec/ruby/library/bigdecimal/to_s_spec.rb73
-rw-r--r--spec/ruby/library/bigdecimal/truncate_spec.rb81
-rw-r--r--spec/ruby/library/bigdecimal/uminus_spec.rb58
-rw-r--r--spec/ruby/library/bigdecimal/uplus_spec.rb20
-rw-r--r--spec/ruby/library/bigdecimal/ver_spec.rb11
-rw-r--r--spec/ruby/library/bigdecimal/zero_spec.rb28
-rw-r--r--spec/ruby/library/bigmath/log_spec.rb10
-rw-r--r--spec/ruby/library/cgi/cookie/domain_spec.rb23
-rw-r--r--spec/ruby/library/cgi/cookie/expires_spec.rb23
-rw-r--r--spec/ruby/library/cgi/cookie/initialize_spec.rb147
-rw-r--r--spec/ruby/library/cgi/cookie/name_spec.rb23
-rw-r--r--spec/ruby/library/cgi/cookie/parse_spec.rb39
-rw-r--r--spec/ruby/library/cgi/cookie/path_spec.rb23
-rw-r--r--spec/ruby/library/cgi/cookie/secure_spec.rb70
-rw-r--r--spec/ruby/library/cgi/cookie/to_s_spec.rb42
-rw-r--r--spec/ruby/library/cgi/cookie/value_spec.rb76
-rw-r--r--spec/ruby/library/cgi/escapeElement_spec.rb20
-rw-r--r--spec/ruby/library/cgi/escapeHTML_spec.rb13
-rw-r--r--spec/ruby/library/cgi/escape_spec.rb26
-rw-r--r--spec/ruby/library/cgi/htmlextension/a_spec.rb49
-rw-r--r--spec/ruby/library/cgi/htmlextension/base_spec.rb33
-rw-r--r--spec/ruby/library/cgi/htmlextension/blockquote_spec.rb33
-rw-r--r--spec/ruby/library/cgi/htmlextension/br_spec.rb22
-rw-r--r--spec/ruby/library/cgi/htmlextension/caption_spec.rb33
-rw-r--r--spec/ruby/library/cgi/htmlextension/checkbox_group_spec.rb76
-rw-r--r--spec/ruby/library/cgi/htmlextension/checkbox_spec.rb77
-rw-r--r--spec/ruby/library/cgi/htmlextension/doctype_spec.rb27
-rw-r--r--spec/ruby/library/cgi/htmlextension/file_field_spec.rb72
-rw-r--r--spec/ruby/library/cgi/htmlextension/fixtures/common.rb15
-rw-r--r--spec/ruby/library/cgi/htmlextension/form_spec.rb58
-rw-r--r--spec/ruby/library/cgi/htmlextension/frame_spec.rb14
-rw-r--r--spec/ruby/library/cgi/htmlextension/frameset_spec.rb14
-rw-r--r--spec/ruby/library/cgi/htmlextension/hidden_spec.rb59
-rw-r--r--spec/ruby/library/cgi/htmlextension/html_spec.rb66
-rw-r--r--spec/ruby/library/cgi/htmlextension/image_button_spec.rb69
-rw-r--r--spec/ruby/library/cgi/htmlextension/img_spec.rb83
-rw-r--r--spec/ruby/library/cgi/htmlextension/multipart_form_spec.rb64
-rw-r--r--spec/ruby/library/cgi/htmlextension/password_field_spec.rb84
-rw-r--r--spec/ruby/library/cgi/htmlextension/popup_menu_spec.rb8
-rw-r--r--spec/ruby/library/cgi/htmlextension/radio_button_spec.rb77
-rw-r--r--spec/ruby/library/cgi/htmlextension/radio_group_spec.rb77
-rw-r--r--spec/ruby/library/cgi/htmlextension/reset_spec.rb57
-rw-r--r--spec/ruby/library/cgi/htmlextension/scrolling_list_spec.rb8
-rw-r--r--spec/ruby/library/cgi/htmlextension/shared/popup_menu.rb94
-rw-r--r--spec/ruby/library/cgi/htmlextension/submit_spec.rb57
-rw-r--r--spec/ruby/library/cgi/htmlextension/text_field_spec.rb84
-rw-r--r--spec/ruby/library/cgi/htmlextension/textarea_spec.rb73
-rw-r--r--spec/ruby/library/cgi/http_header_spec.rb8
-rw-r--r--spec/ruby/library/cgi/initialize_spec.rb133
-rw-r--r--spec/ruby/library/cgi/out_spec.rb51
-rw-r--r--spec/ruby/library/cgi/parse_spec.rb24
-rw-r--r--spec/ruby/library/cgi/pretty_spec.rb24
-rw-r--r--spec/ruby/library/cgi/print_spec.rb26
-rw-r--r--spec/ruby/library/cgi/queryextension/accept_charset_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/accept_encoding_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/accept_language_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/accept_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/auth_type_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/cache_control_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/content_length_spec.rb26
-rw-r--r--spec/ruby/library/cgi/queryextension/content_type_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/cookies_spec.rb10
-rw-r--r--spec/ruby/library/cgi/queryextension/element_reference_spec.rb27
-rw-r--r--spec/ruby/library/cgi/queryextension/from_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/gateway_interface_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/has_key_spec.rb7
-rw-r--r--spec/ruby/library/cgi/queryextension/host_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/include_spec.rb7
-rw-r--r--spec/ruby/library/cgi/queryextension/key_spec.rb7
-rw-r--r--spec/ruby/library/cgi/queryextension/keys_spec.rb20
-rw-r--r--spec/ruby/library/cgi/queryextension/multipart_spec.rb40
-rw-r--r--spec/ruby/library/cgi/queryextension/negotiate_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/params_spec.rb37
-rw-r--r--spec/ruby/library/cgi/queryextension/path_info_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/path_translated_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/pragma_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/query_string_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/raw_cookie2_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/raw_cookie_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/referer_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/remote_addr_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/remote_host_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/remote_ident_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/remote_user_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/request_method_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/script_name_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/server_name_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/server_port_spec.rb26
-rw-r--r--spec/ruby/library/cgi/queryextension/server_protocol_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/server_software_spec.rb22
-rw-r--r--spec/ruby/library/cgi/queryextension/shared/has_key.rb19
-rw-r--r--spec/ruby/library/cgi/queryextension/user_agent_spec.rb22
-rw-r--r--spec/ruby/library/cgi/rfc1123_date_spec.rb10
-rw-r--r--spec/ruby/library/cgi/shared/http_header.rb112
-rw-r--r--spec/ruby/library/cgi/unescapeElement_spec.rb20
-rw-r--r--spec/ruby/library/cgi/unescapeHTML_spec.rb39
-rw-r--r--spec/ruby/library/cgi/unescape_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/acos_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/acosh_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/asin_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/asinh_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/atan2_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/atan_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/atanh_spec.rb17
-rw-r--r--spec/ruby/library/complex/math/cos_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/cosh_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/exp_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/fixtures/classes.rb4
-rw-r--r--spec/ruby/library/complex/math/log10_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/log_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/shared/acos.rb41
-rw-r--r--spec/ruby/library/complex/math/shared/acosh.rb37
-rw-r--r--spec/ruby/library/complex/math/shared/asin.rb47
-rw-r--r--spec/ruby/library/complex/math/shared/asinh.rb32
-rw-r--r--spec/ruby/library/complex/math/shared/atan.rb32
-rw-r--r--spec/ruby/library/complex/math/shared/atan2.rb34
-rw-r--r--spec/ruby/library/complex/math/shared/atanh.rb30
-rw-r--r--spec/ruby/library/complex/math/shared/cos.rb30
-rw-r--r--spec/ruby/library/complex/math/shared/cosh.rb28
-rw-r--r--spec/ruby/library/complex/math/shared/exp.rb28
-rw-r--r--spec/ruby/library/complex/math/shared/log.rb39
-rw-r--r--spec/ruby/library/complex/math/shared/log10.rb41
-rw-r--r--spec/ruby/library/complex/math/shared/sin.rb30
-rw-r--r--spec/ruby/library/complex/math/shared/sinh.rb28
-rw-r--r--spec/ruby/library/complex/math/shared/sqrt.rb34
-rw-r--r--spec/ruby/library/complex/math/shared/tan.rb28
-rw-r--r--spec/ruby/library/complex/math/shared/tanh.rb32
-rw-r--r--spec/ruby/library/complex/math/sin_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/sinh_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/sqrt_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/tan_spec.rb15
-rw-r--r--spec/ruby/library/complex/math/tanh_spec.rb15
-rw-r--r--spec/ruby/library/complex/numeric/im_spec.rb3
-rw-r--r--spec/ruby/library/conditionvariable/broadcast_spec.rb67
-rw-r--r--spec/ruby/library/conditionvariable/marshal_dump_spec.rb9
-rw-r--r--spec/ruby/library/conditionvariable/signal_spec.rb69
-rw-r--r--spec/ruby/library/conditionvariable/wait_spec.rb25
-rw-r--r--spec/ruby/library/coverage/fixtures/second_class.rb5
-rw-r--r--spec/ruby/library/coverage/fixtures/some_class.rb16
-rw-r--r--spec/ruby/library/coverage/fixtures/spec_helper.rb11
-rw-r--r--spec/ruby/library/coverage/fixtures/start_coverage.rb3
-rw-r--r--spec/ruby/library/coverage/peek_result_spec.rb67
-rw-r--r--spec/ruby/library/coverage/result_spec.rb78
-rw-r--r--spec/ruby/library/coverage/start_spec.rb6
-rw-r--r--spec/ruby/library/csv/basicwriter/close_on_terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/basicwriter/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/basicwriter/terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/cell/data_spec.rb6
-rw-r--r--spec/ruby/library/csv/cell/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/fixtures/one_line.csv1
-rw-r--r--spec/ruby/library/csv/foreach_spec.rb6
-rw-r--r--spec/ruby/library/csv/generate_line_spec.rb30
-rw-r--r--spec/ruby/library/csv/generate_row_spec.rb6
-rw-r--r--spec/ruby/library/csv/generate_spec.rb32
-rw-r--r--spec/ruby/library/csv/iobuf/close_spec.rb6
-rw-r--r--spec/ruby/library/csv/iobuf/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/iobuf/read_spec.rb6
-rw-r--r--spec/ruby/library/csv/iobuf/terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/ioreader/close_on_terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/ioreader/get_row_spec.rb6
-rw-r--r--spec/ruby/library/csv/ioreader/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/ioreader/terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/liberal_parsing_spec.rb21
-rw-r--r--spec/ruby/library/csv/open_spec.rb6
-rw-r--r--spec/ruby/library/csv/parse_spec.rb95
-rw-r--r--spec/ruby/library/csv/read_spec.rb6
-rw-r--r--spec/ruby/library/csv/readlines_spec.rb37
-rw-r--r--spec/ruby/library/csv/streambuf/add_buf_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/buf_size_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/drop_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/element_reference_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/get_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/idx_is_eos_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/is_eos_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/read_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/rel_buf_spec.rb6
-rw-r--r--spec/ruby/library/csv/streambuf/terminate_spec.rb6
-rw-r--r--spec/ruby/library/csv/stringreader/get_row_spec.rb6
-rw-r--r--spec/ruby/library/csv/stringreader/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/add_row_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/append_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/close_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/create_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/generate_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/initialize_spec.rb6
-rw-r--r--spec/ruby/library/csv/writer/terminate_spec.rb6
-rw-r--r--spec/ruby/library/date/accessor_spec.rb91
-rw-r--r--spec/ruby/library/date/add_month_spec.rb38
-rw-r--r--spec/ruby/library/date/add_spec.rb30
-rw-r--r--spec/ruby/library/date/ajd_spec.rb6
-rw-r--r--spec/ruby/library/date/ajd_to_amjd_spec.rb6
-rw-r--r--spec/ruby/library/date/ajd_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/amjd_spec.rb6
-rw-r--r--spec/ruby/library/date/amjd_to_ajd_spec.rb6
-rw-r--r--spec/ruby/library/date/append_spec.rb6
-rw-r--r--spec/ruby/library/date/asctime_spec.rb6
-rw-r--r--spec/ruby/library/date/boat_spec.rb24
-rw-r--r--spec/ruby/library/date/case_compare_spec.rb6
-rw-r--r--spec/ruby/library/date/civil_spec.rb12
-rw-r--r--spec/ruby/library/date/commercial_spec.rb18
-rw-r--r--spec/ruby/library/date/commercial_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/comparison_spec.rb6
-rw-r--r--spec/ruby/library/date/constants_spec.rb48
-rw-r--r--spec/ruby/library/date/conversions_spec.rb43
-rw-r--r--spec/ruby/library/date/ctime_spec.rb6
-rw-r--r--spec/ruby/library/date/cwday_spec.rb6
-rw-r--r--spec/ruby/library/date/cweek_spec.rb6
-rw-r--r--spec/ruby/library/date/cwyear_spec.rb6
-rw-r--r--spec/ruby/library/date/day_fraction_spec.rb6
-rw-r--r--spec/ruby/library/date/day_fraction_to_time_spec.rb6
-rw-r--r--spec/ruby/library/date/day_spec.rb9
-rw-r--r--spec/ruby/library/date/downto_spec.rb18
-rw-r--r--spec/ruby/library/date/england_spec.rb6
-rw-r--r--spec/ruby/library/date/eql_spec.rb12
-rw-r--r--spec/ruby/library/date/format/bag/method_missing_spec.rb6
-rw-r--r--spec/ruby/library/date/format/bag/to_hash_spec.rb6
-rw-r--r--spec/ruby/library/date/friday_spec.rb12
-rw-r--r--spec/ruby/library/date/gregorian_leap_spec.rb16
-rw-r--r--spec/ruby/library/date/gregorian_spec.rb16
-rw-r--r--spec/ruby/library/date/hash_spec.rb8
-rw-r--r--spec/ruby/library/date/infinity/abs_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/coerce_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/comparison_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/d_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/finite_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/infinite_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/nan_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/uminus_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/uplus_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity/zero_spec.rb6
-rw-r--r--spec/ruby/library/date/infinity_spec.rb67
-rw-r--r--spec/ruby/library/date/inspect_spec.rb6
-rw-r--r--spec/ruby/library/date/italy_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_spec.rb15
-rw-r--r--spec/ruby/library/date/jd_to_ajd_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_civil_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_commercial_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_ld_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_mjd_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_ordinal_spec.rb6
-rw-r--r--spec/ruby/library/date/jd_to_wday_spec.rb6
-rw-r--r--spec/ruby/library/date/julian_leap_spec.rb15
-rw-r--r--spec/ruby/library/date/julian_spec.rb16
-rw-r--r--spec/ruby/library/date/ld_spec.rb6
-rw-r--r--spec/ruby/library/date/ld_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/leap_spec.rb10
-rw-r--r--spec/ruby/library/date/mday_spec.rb6
-rw-r--r--spec/ruby/library/date/minus_month_spec.rb25
-rw-r--r--spec/ruby/library/date/minus_spec.rb30
-rw-r--r--spec/ruby/library/date/mjd_spec.rb6
-rw-r--r--spec/ruby/library/date/mjd_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/mon_spec.rb6
-rw-r--r--spec/ruby/library/date/monday_spec.rb8
-rw-r--r--spec/ruby/library/date/month_spec.rb9
-rw-r--r--spec/ruby/library/date/new_spec.rb8
-rw-r--r--spec/ruby/library/date/new_start_spec.rb6
-rw-r--r--spec/ruby/library/date/next_day_spec.rb14
-rw-r--r--spec/ruby/library/date/next_month_spec.rb29
-rw-r--r--spec/ruby/library/date/next_spec.rb6
-rw-r--r--spec/ruby/library/date/next_year_spec.rb12
-rw-r--r--spec/ruby/library/date/ordinal_spec.rb8
-rw-r--r--spec/ruby/library/date/ordinal_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/parse_spec.rb137
-rw-r--r--spec/ruby/library/date/plus_spec.rb20
-rw-r--r--spec/ruby/library/date/prev_day_spec.rb14
-rw-r--r--spec/ruby/library/date/prev_month_spec.rb29
-rw-r--r--spec/ruby/library/date/prev_year_spec.rb12
-rw-r--r--spec/ruby/library/date/relationship_spec.rb20
-rw-r--r--spec/ruby/library/date/right_shift_spec.rb6
-rw-r--r--spec/ruby/library/date/saturday_spec.rb8
-rw-r--r--spec/ruby/library/date/shared/civil.rb57
-rw-r--r--spec/ruby/library/date/shared/commercial.rb39
-rw-r--r--spec/ruby/library/date/shared/jd.rb14
-rw-r--r--spec/ruby/library/date/shared/new_bang.rb14
-rw-r--r--spec/ruby/library/date/shared/ordinal.rb22
-rw-r--r--spec/ruby/library/date/shared/parse.rb54
-rw-r--r--spec/ruby/library/date/shared/parse_eu.rb37
-rw-r--r--spec/ruby/library/date/shared/parse_us.rb36
-rw-r--r--spec/ruby/library/date/shared/valid_civil.rb36
-rw-r--r--spec/ruby/library/date/shared/valid_commercial.rb34
-rw-r--r--spec/ruby/library/date/shared/valid_jd.rb15
-rw-r--r--spec/ruby/library/date/shared/valid_ordinal.rb26
-rw-r--r--spec/ruby/library/date/start_spec.rb6
-rw-r--r--spec/ruby/library/date/step_spec.rb56
-rw-r--r--spec/ruby/library/date/strftime_spec.rb40
-rw-r--r--spec/ruby/library/date/strptime_spec.rb149
-rw-r--r--spec/ruby/library/date/succ_spec.rb6
-rw-r--r--spec/ruby/library/date/sunday_spec.rb8
-rw-r--r--spec/ruby/library/date/thursday_spec.rb8
-rw-r--r--spec/ruby/library/date/time_to_day_fraction_spec.rb6
-rw-r--r--spec/ruby/library/date/to_s_spec.rb6
-rw-r--r--spec/ruby/library/date/today_spec.rb14
-rw-r--r--spec/ruby/library/date/tuesday_spec.rb8
-rw-r--r--spec/ruby/library/date/upto_spec.rb16
-rw-r--r--spec/ruby/library/date/valid_civil_spec.rb10
-rw-r--r--spec/ruby/library/date/valid_commercial_spec.rb10
-rw-r--r--spec/ruby/library/date/valid_date_spec.rb7
-rw-r--r--spec/ruby/library/date/valid_jd_spec.rb10
-rw-r--r--spec/ruby/library/date/valid_ordinal_spec.rb10
-rw-r--r--spec/ruby/library/date/valid_time_spec.rb6
-rw-r--r--spec/ruby/library/date/wday_spec.rb9
-rw-r--r--spec/ruby/library/date/wednesday_spec.rb8
-rw-r--r--spec/ruby/library/date/yday_spec.rb6
-rw-r--r--spec/ruby/library/date/year_spec.rb9
-rw-r--r--spec/ruby/library/date/zone_to_diff_spec.rb6
-rw-r--r--spec/ruby/library/datetime/_strptime_spec.rb6
-rw-r--r--spec/ruby/library/datetime/civil_spec.rb6
-rw-r--r--spec/ruby/library/datetime/commercial_spec.rb6
-rw-r--r--spec/ruby/library/datetime/hour_spec.rb47
-rw-r--r--spec/ruby/library/datetime/httpdate_spec.rb6
-rw-r--r--spec/ruby/library/datetime/iso8601_spec.rb10
-rw-r--r--spec/ruby/library/datetime/jd_spec.rb6
-rw-r--r--spec/ruby/library/datetime/jisx0301_spec.rb10
-rw-r--r--spec/ruby/library/datetime/min_spec.rb6
-rw-r--r--spec/ruby/library/datetime/minute_spec.rb6
-rw-r--r--spec/ruby/library/datetime/new_offset_spec.rb6
-rw-r--r--spec/ruby/library/datetime/new_spec.rb52
-rw-r--r--spec/ruby/library/datetime/now_spec.rb25
-rw-r--r--spec/ruby/library/datetime/offset_spec.rb6
-rw-r--r--spec/ruby/library/datetime/ordinal_spec.rb6
-rw-r--r--spec/ruby/library/datetime/parse_spec.rb127
-rw-r--r--spec/ruby/library/datetime/rfc2822_spec.rb6
-rw-r--r--spec/ruby/library/datetime/rfc3339_spec.rb10
-rw-r--r--spec/ruby/library/datetime/rfc822_spec.rb6
-rw-r--r--spec/ruby/library/datetime/sec_fraction_spec.rb6
-rw-r--r--spec/ruby/library/datetime/sec_spec.rb6
-rw-r--r--spec/ruby/library/datetime/second_fraction_spec.rb6
-rw-r--r--spec/ruby/library/datetime/second_spec.rb6
-rw-r--r--spec/ruby/library/datetime/shared/min.rb40
-rw-r--r--spec/ruby/library/datetime/shared/sec.rb45
-rw-r--r--spec/ruby/library/datetime/strftime_spec.rb51
-rw-r--r--spec/ruby/library/datetime/strptime_spec.rb6
-rw-r--r--spec/ruby/library/datetime/to_date_spec.rb37
-rw-r--r--spec/ruby/library/datetime/to_datetime_spec.rb9
-rw-r--r--spec/ruby/library/datetime/to_s_spec.rb17
-rw-r--r--spec/ruby/library/datetime/to_time_spec.rb38
-rw-r--r--spec/ruby/library/datetime/xmlschema_spec.rb10
-rw-r--r--spec/ruby/library/datetime/zone_spec.rb6
-rw-r--r--spec/ruby/library/delegate/delegate_class/instance_method_spec.rb52
-rw-r--r--spec/ruby/library/delegate/delegate_class/instance_methods_spec.rb26
-rw-r--r--spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb23
-rw-r--r--spec/ruby/library/delegate/delegate_class/protected_instance_methods_spec.rb29
-rw-r--r--spec/ruby/library/delegate/delegate_class/public_instance_methods_spec.rb25
-rw-r--r--spec/ruby/library/delegate/delegate_class/respond_to_missing_spec.rb23
-rw-r--r--spec/ruby/library/delegate/delegator/case_compare_spec.rb11
-rw-r--r--spec/ruby/library/delegate/delegator/compare_spec.rb11
-rw-r--r--spec/ruby/library/delegate/delegator/complement_spec.rb11
-rw-r--r--spec/ruby/library/delegate/delegator/eql_spec.rb46
-rw-r--r--spec/ruby/library/delegate/delegator/equal_spec.rb13
-rw-r--r--spec/ruby/library/delegate/delegator/equal_value_spec.rb24
-rw-r--r--spec/ruby/library/delegate/delegator/frozen_spec.rb39
-rw-r--r--spec/ruby/library/delegate/delegator/hash_spec.rb11
-rw-r--r--spec/ruby/library/delegate/delegator/marshal_spec.rb21
-rw-r--r--spec/ruby/library/delegate/delegator/method_spec.rb69
-rw-r--r--spec/ruby/library/delegate/delegator/methods_spec.rb37
-rw-r--r--spec/ruby/library/delegate/delegator/not_equal_spec.rb24
-rw-r--r--spec/ruby/library/delegate/delegator/not_spec.rb11
-rw-r--r--spec/ruby/library/delegate/delegator/private_methods_spec.rb20
-rw-r--r--spec/ruby/library/delegate/delegator/protected_methods_spec.rb18
-rw-r--r--spec/ruby/library/delegate/delegator/public_methods_spec.rb18
-rw-r--r--spec/ruby/library/delegate/delegator/send_spec.rb26
-rw-r--r--spec/ruby/library/delegate/delegator/taint_spec.rb23
-rw-r--r--spec/ruby/library/delegate/delegator/tap_spec.rb16
-rw-r--r--spec/ruby/library/delegate/delegator/trust_spec.rb22
-rw-r--r--spec/ruby/library/delegate/delegator/untaint_spec.rb24
-rw-r--r--spec/ruby/library/delegate/delegator/untrust_spec.rb23
-rw-r--r--spec/ruby/library/delegate/fixtures/classes.rb60
-rw-r--r--spec/ruby/library/digest/bubblebabble_spec.rb29
-rw-r--r--spec/ruby/library/digest/hexencode_spec.rb31
-rw-r--r--spec/ruby/library/digest/md5/append_spec.rb7
-rw-r--r--spec/ruby/library/digest/md5/block_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/md5/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/md5/digest_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/md5/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/md5/equal_spec.rb38
-rw-r--r--spec/ruby/library/digest/md5/file_spec.rb43
-rw-r--r--spec/ruby/library/digest/md5/hexdigest_bang_spec.rb14
-rw-r--r--spec/ruby/library/digest/md5/hexdigest_spec.rb32
-rw-r--r--spec/ruby/library/digest/md5/inspect_spec.rb12
-rw-r--r--spec/ruby/library/digest/md5/length_spec.rb8
-rw-r--r--spec/ruby/library/digest/md5/reset_spec.rb15
-rw-r--r--spec/ruby/library/digest/md5/shared/constants.rb16
-rw-r--r--spec/ruby/library/digest/md5/shared/length.rb8
-rw-r--r--spec/ruby/library/digest/md5/shared/sample.rb17
-rw-r--r--spec/ruby/library/digest/md5/shared/update.rb7
-rw-r--r--spec/ruby/library/digest/md5/size_spec.rb8
-rw-r--r--spec/ruby/library/digest/md5/to_s_spec.rb24
-rw-r--r--spec/ruby/library/digest/md5/update_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha1/digest_spec.rb20
-rw-r--r--spec/ruby/library/digest/sha1/file_spec.rb43
-rw-r--r--spec/ruby/library/digest/sha1/shared/constants.rb17
-rw-r--r--spec/ruby/library/digest/sha256/append_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha256/block_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha256/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha256/digest_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha256/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha256/equal_spec.rb37
-rw-r--r--spec/ruby/library/digest/sha256/file_spec.rb43
-rw-r--r--spec/ruby/library/digest/sha256/hexdigest_bang_spec.rb14
-rw-r--r--spec/ruby/library/digest/sha256/hexdigest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha256/inspect_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha256/length_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha256/reset_spec.rb15
-rw-r--r--spec/ruby/library/digest/sha256/shared/constants.rb17
-rw-r--r--spec/ruby/library/digest/sha256/shared/length.rb8
-rw-r--r--spec/ruby/library/digest/sha256/shared/update.rb7
-rw-r--r--spec/ruby/library/digest/sha256/size_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha256/to_s_spec.rb21
-rw-r--r--spec/ruby/library/digest/sha256/update_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha384/append_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha384/block_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha384/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha384/digest_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha384/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha384/equal_spec.rb37
-rw-r--r--spec/ruby/library/digest/sha384/file_spec.rb43
-rw-r--r--spec/ruby/library/digest/sha384/hexdigest_bang_spec.rb14
-rw-r--r--spec/ruby/library/digest/sha384/hexdigest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha384/inspect_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha384/length_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha384/reset_spec.rb15
-rw-r--r--spec/ruby/library/digest/sha384/shared/constants.rb18
-rw-r--r--spec/ruby/library/digest/sha384/shared/length.rb8
-rw-r--r--spec/ruby/library/digest/sha384/shared/update.rb7
-rw-r--r--spec/ruby/library/digest/sha384/size_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha384/to_s_spec.rb21
-rw-r--r--spec/ruby/library/digest/sha384/update_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha512/append_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha512/block_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha512/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha512/digest_length_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha512/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha512/equal_spec.rb37
-rw-r--r--spec/ruby/library/digest/sha512/file_spec.rb43
-rw-r--r--spec/ruby/library/digest/sha512/hexdigest_bang_spec.rb14
-rw-r--r--spec/ruby/library/digest/sha512/hexdigest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha512/inspect_spec.rb12
-rw-r--r--spec/ruby/library/digest/sha512/length_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha512/reset_spec.rb15
-rw-r--r--spec/ruby/library/digest/sha512/shared/constants.rb17
-rw-r--r--spec/ruby/library/digest/sha512/shared/length.rb8
-rw-r--r--spec/ruby/library/digest/sha512/shared/update.rb7
-rw-r--r--spec/ruby/library/digest/sha512/size_spec.rb8
-rw-r--r--spec/ruby/library/digest/sha512/to_s_spec.rb21
-rw-r--r--spec/ruby/library/digest/sha512/update_spec.rb7
-rw-r--r--spec/ruby/library/drb/fixtures/test_server.rb8
-rw-r--r--spec/ruby/library/drb/start_service_spec.rb28
-rw-r--r--spec/ruby/library/erb/def_class_spec.rb29
-rw-r--r--spec/ruby/library/erb/def_method_spec.rb26
-rw-r--r--spec/ruby/library/erb/def_module_spec.rb27
-rw-r--r--spec/ruby/library/erb/defmethod/def_erb_method_spec.rb63
-rw-r--r--spec/ruby/library/erb/filename_spec.rb40
-rw-r--r--spec/ruby/library/erb/new_spec.rb134
-rw-r--r--spec/ruby/library/erb/result_spec.rb86
-rw-r--r--spec/ruby/library/erb/run_spec.rb97
-rw-r--r--spec/ruby/library/erb/src_spec.rb33
-rw-r--r--spec/ruby/library/erb/util/h_spec.rb7
-rw-r--r--spec/ruby/library/erb/util/html_escape_spec.rb8
-rw-r--r--spec/ruby/library/erb/util/shared/html_escape.rb42
-rw-r--r--spec/ruby/library/erb/util/shared/url_encode.rb50
-rw-r--r--spec/ruby/library/erb/util/u_spec.rb8
-rw-r--r--spec/ruby/library/erb/util/url_encode_spec.rb7
-rw-r--r--spec/ruby/library/etc/endgrent_spec.rb7
-rw-r--r--spec/ruby/library/etc/endpwent_spec.rb7
-rw-r--r--spec/ruby/library/etc/getgrent_spec.rb7
-rw-r--r--spec/ruby/library/etc/getgrgid_spec.rb70
-rw-r--r--spec/ruby/library/etc/getgrnam_spec.rb30
-rw-r--r--spec/ruby/library/etc/getlogin_spec.rb38
-rw-r--r--spec/ruby/library/etc/getpwent_spec.rb7
-rw-r--r--spec/ruby/library/etc/getpwnam_spec.rb28
-rw-r--r--spec/ruby/library/etc/getpwuid_spec.rb36
-rw-r--r--spec/ruby/library/etc/group_spec.rb18
-rw-r--r--spec/ruby/library/etc/nprocessors_spec.rb9
-rw-r--r--spec/ruby/library/etc/shared/windows.rb7
-rw-r--r--spec/ruby/library/etc/struct_group_spec.rb31
-rw-r--r--spec/ruby/library/etc/struct_passwd_spec.rb43
-rw-r--r--spec/ruby/library/expect/expect_spec.rb62
-rw-r--r--spec/ruby/library/fiber/alive_spec.rb48
-rw-r--r--spec/ruby/library/fiber/current_spec.rb53
-rw-r--r--spec/ruby/library/fiber/resume_spec.rb14
-rw-r--r--spec/ruby/library/fiber/transfer_spec.rb51
-rw-r--r--spec/ruby/library/find/find_spec.rb30
-rw-r--r--spec/ruby/library/find/fixtures/common.rb174
-rw-r--r--spec/ruby/library/find/prune_spec.rb12
-rw-r--r--spec/ruby/library/getoptlong/each_option_spec.rb7
-rw-r--r--spec/ruby/library/getoptlong/each_spec.rb7
-rw-r--r--spec/ruby/library/getoptlong/error_message_spec.rb23
-rw-r--r--spec/ruby/library/getoptlong/get_option_spec.rb7
-rw-r--r--spec/ruby/library/getoptlong/get_spec.rb7
-rw-r--r--spec/ruby/library/getoptlong/initialize_spec.rb28
-rw-r--r--spec/ruby/library/getoptlong/ordering_spec.rb38
-rw-r--r--spec/ruby/library/getoptlong/set_options_spec.rb98
-rw-r--r--spec/ruby/library/getoptlong/shared/each.rb18
-rw-r--r--spec/ruby/library/getoptlong/shared/get.rb64
-rw-r--r--spec/ruby/library/getoptlong/terminate_spec.rb30
-rw-r--r--spec/ruby/library/getoptlong/terminated_spec.rb17
-rw-r--r--spec/ruby/library/ipaddr/hton_spec.rb30
-rw-r--r--spec/ruby/library/ipaddr/ipv4_conversion_spec.rb46
-rw-r--r--spec/ruby/library/ipaddr/new_spec.rb93
-rw-r--r--spec/ruby/library/ipaddr/operator_spec.rb87
-rw-r--r--spec/ruby/library/ipaddr/reverse_spec.rb27
-rw-r--r--spec/ruby/library/ipaddr/to_s_spec.rb20
-rw-r--r--spec/ruby/library/logger/device/close_spec.rb22
-rw-r--r--spec/ruby/library/logger/device/new_spec.rb47
-rw-r--r--spec/ruby/library/logger/device/write_spec.rb42
-rw-r--r--spec/ruby/library/logger/fixtures/common.rb9
-rw-r--r--spec/ruby/library/logger/logger/add_spec.rb81
-rw-r--r--spec/ruby/library/logger/logger/close_spec.rb20
-rw-r--r--spec/ruby/library/logger/logger/datetime_format_spec.rb60
-rw-r--r--spec/ruby/library/logger/logger/debug_spec.rb52
-rw-r--r--spec/ruby/library/logger/logger/error_spec.rb53
-rw-r--r--spec/ruby/library/logger/logger/fatal_spec.rb53
-rw-r--r--spec/ruby/library/logger/logger/info_spec.rb53
-rw-r--r--spec/ruby/library/logger/logger/new_spec.rb120
-rw-r--r--spec/ruby/library/logger/logger/unknown_spec.rb36
-rw-r--r--spec/ruby/library/logger/logger/warn_spec.rb53
-rw-r--r--spec/ruby/library/logger/severity_spec.rb13
-rw-r--r--spec/ruby/library/mathn/bignum/exponent_spec.rb21
-rw-r--r--spec/ruby/library/mathn/complex/Complex_spec.rb14
-rw-r--r--spec/ruby/library/mathn/fixnum/exponent_spec.rb17
-rw-r--r--spec/ruby/library/mathn/float/exponent_spec.rb17
-rw-r--r--spec/ruby/library/mathn/integer/from_prime_division_spec.rb11
-rw-r--r--spec/ruby/library/mathn/integer/prime_division_spec.rb21
-rw-r--r--spec/ruby/library/mathn/math/fixtures/classes.rb3
-rw-r--r--spec/ruby/library/mathn/math/rsqrt_spec.rb17
-rw-r--r--spec/ruby/library/mathn/math/shared/rsqrt.rb21
-rw-r--r--spec/ruby/library/mathn/math/shared/sqrt.rb25
-rw-r--r--spec/ruby/library/mathn/math/sqrt_spec.rb17
-rw-r--r--spec/ruby/library/mathn/rational/Rational_spec.rb14
-rw-r--r--spec/ruby/library/mathn/rational/inspect_spec.rb15
-rw-r--r--spec/ruby/library/matrix/I_spec.rb6
-rw-r--r--spec/ruby/library/matrix/build_spec.rb73
-rw-r--r--spec/ruby/library/matrix/clone_spec.rb25
-rw-r--r--spec/ruby/library/matrix/coerce_spec.rb10
-rw-r--r--spec/ruby/library/matrix/collect_spec.rb6
-rw-r--r--spec/ruby/library/matrix/column_size_spec.rb13
-rw-r--r--spec/ruby/library/matrix/column_spec.rb35
-rw-r--r--spec/ruby/library/matrix/column_vector_spec.rb25
-rw-r--r--spec/ruby/library/matrix/column_vectors_spec.rb26
-rw-r--r--spec/ruby/library/matrix/columns_spec.rb42
-rw-r--r--spec/ruby/library/matrix/conj_spec.rb6
-rw-r--r--spec/ruby/library/matrix/conjugate_spec.rb6
-rw-r--r--spec/ruby/library/matrix/constructor_spec.rb65
-rw-r--r--spec/ruby/library/matrix/det_spec.rb7
-rw-r--r--spec/ruby/library/matrix/determinant_spec.rb7
-rw-r--r--spec/ruby/library/matrix/diagonal_spec.rb72
-rw-r--r--spec/ruby/library/matrix/divide_spec.rb55
-rw-r--r--spec/ruby/library/matrix/each_spec.rb74
-rw-r--r--spec/ruby/library/matrix/each_with_index_spec.rb81
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/eigenvalue_matrix_spec.rb9
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/eigenvalues_spec.rb22
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/eigenvector_matrix_spec.rb20
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/eigenvectors_spec.rb22
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/initialize_spec.rb24
-rw-r--r--spec/ruby/library/matrix/eigenvalue_decomposition/to_a_spec.rb18
-rw-r--r--spec/ruby/library/matrix/element_reference_spec.rb23
-rw-r--r--spec/ruby/library/matrix/empty_spec.rb68
-rw-r--r--spec/ruby/library/matrix/eql_spec.rb11
-rw-r--r--spec/ruby/library/matrix/equal_value_spec.rb11
-rw-r--r--spec/ruby/library/matrix/exponent_spec.rb51
-rw-r--r--spec/ruby/library/matrix/find_index_spec.rb146
-rw-r--r--spec/ruby/library/matrix/fixtures/classes.rb7
-rw-r--r--spec/ruby/library/matrix/hash_spec.rb15
-rw-r--r--spec/ruby/library/matrix/hermitian_spec.rb34
-rw-r--r--spec/ruby/library/matrix/identity_spec.rb6
-rw-r--r--spec/ruby/library/matrix/imag_spec.rb6
-rw-r--r--spec/ruby/library/matrix/imaginary_spec.rb6
-rw-r--r--spec/ruby/library/matrix/inspect_spec.rb27
-rw-r--r--spec/ruby/library/matrix/inv_spec.rb7
-rw-r--r--spec/ruby/library/matrix/inverse_from_spec.rb6
-rw-r--r--spec/ruby/library/matrix/inverse_spec.rb7
-rw-r--r--spec/ruby/library/matrix/lower_triangular_spec.rb24
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/determinant_spec.rb21
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/initialize_spec.rb13
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/l_spec.rb18
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/p_spec.rb18
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/solve_spec.rb53
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/to_a_spec.rb33
-rw-r--r--spec/ruby/library/matrix/lup_decomposition/u_spec.rb18
-rw-r--r--spec/ruby/library/matrix/map_spec.rb6
-rw-r--r--spec/ruby/library/matrix/minor_spec.rb85
-rw-r--r--spec/ruby/library/matrix/minus_spec.rb42
-rw-r--r--spec/ruby/library/matrix/multiply_spec.rb68
-rw-r--r--spec/ruby/library/matrix/new_spec.rb8
-rw-r--r--spec/ruby/library/matrix/normal_spec.rb26
-rw-r--r--spec/ruby/library/matrix/orthogonal_spec.rb26
-rw-r--r--spec/ruby/library/matrix/permutation_spec.rb32
-rw-r--r--spec/ruby/library/matrix/plus_spec.rb42
-rw-r--r--spec/ruby/library/matrix/rank_spec.rb19
-rw-r--r--spec/ruby/library/matrix/real_spec.rb42
-rw-r--r--spec/ruby/library/matrix/rect_spec.rb6
-rw-r--r--spec/ruby/library/matrix/rectangular_spec.rb6
-rw-r--r--spec/ruby/library/matrix/regular_spec.rb31
-rw-r--r--spec/ruby/library/matrix/round_spec.rb21
-rw-r--r--spec/ruby/library/matrix/row_size_spec.rb13
-rw-r--r--spec/ruby/library/matrix/row_spec.rb36
-rw-r--r--spec/ruby/library/matrix/row_vector_spec.rb24
-rw-r--r--spec/ruby/library/matrix/row_vectors_spec.rb26
-rw-r--r--spec/ruby/library/matrix/rows_spec.rb41
-rw-r--r--spec/ruby/library/matrix/scalar/Fail_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/Raise_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/divide_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/exponent_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/included_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/initialize_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/minus_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/multiply_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar/plus_spec.rb6
-rw-r--r--spec/ruby/library/matrix/scalar_spec.rb67
-rw-r--r--spec/ruby/library/matrix/shared/collect.rb26
-rw-r--r--spec/ruby/library/matrix/shared/conjugate.rb20
-rw-r--r--spec/ruby/library/matrix/shared/determinant.rb38
-rw-r--r--spec/ruby/library/matrix/shared/equal_value.rb33
-rw-r--r--spec/ruby/library/matrix/shared/identity.rb19
-rw-r--r--spec/ruby/library/matrix/shared/imaginary.rb20
-rw-r--r--spec/ruby/library/matrix/shared/inverse.rb38
-rw-r--r--spec/ruby/library/matrix/shared/rectangular.rb18
-rw-r--r--spec/ruby/library/matrix/shared/trace.rb12
-rw-r--r--spec/ruby/library/matrix/shared/transpose.rb19
-rw-r--r--spec/ruby/library/matrix/singular_spec.rb31
-rw-r--r--spec/ruby/library/matrix/spec_helper.rb35
-rw-r--r--spec/ruby/library/matrix/square_spec.rb28
-rw-r--r--spec/ruby/library/matrix/symmetric_spec.rb29
-rw-r--r--spec/ruby/library/matrix/t_spec.rb6
-rw-r--r--spec/ruby/library/matrix/to_a_spec.rb11
-rw-r--r--spec/ruby/library/matrix/to_s_spec.rb6
-rw-r--r--spec/ruby/library/matrix/tr_spec.rb7
-rw-r--r--spec/ruby/library/matrix/trace_spec.rb7
-rw-r--r--spec/ruby/library/matrix/transpose_spec.rb6
-rw-r--r--spec/ruby/library/matrix/unit_spec.rb6
-rw-r--r--spec/ruby/library/matrix/unitary_spec.rb28
-rw-r--r--spec/ruby/library/matrix/upper_triangular_spec.rb24
-rw-r--r--spec/ruby/library/matrix/vector/cross_product_spec.rb14
-rw-r--r--spec/ruby/library/matrix/vector/each2_spec.rb49
-rw-r--r--spec/ruby/library/matrix/vector/eql_spec.rb16
-rw-r--r--spec/ruby/library/matrix/vector/inner_product_spec.rb22
-rw-r--r--spec/ruby/library/matrix/vector/normalize_spec.rb18
-rw-r--r--spec/ruby/library/matrix/zero_spec.rb52
-rw-r--r--spec/ruby/library/net/FTPError_spec.rb8
-rw-r--r--spec/ruby/library/net/FTPPermError_spec.rb12
-rw-r--r--spec/ruby/library/net/FTPProtoError_spec.rb12
-rw-r--r--spec/ruby/library/net/FTPReplyError_spec.rb12
-rw-r--r--spec/ruby/library/net/FTPTempError_spec.rb12
-rw-r--r--spec/ruby/library/net/ftp/abort_spec.rb62
-rw-r--r--spec/ruby/library/net/ftp/acct_spec.rb58
-rw-r--r--spec/ruby/library/net/ftp/binary_spec.rb24
-rw-r--r--spec/ruby/library/net/ftp/chdir_spec.rb99
-rw-r--r--spec/ruby/library/net/ftp/close_spec.rb30
-rw-r--r--spec/ruby/library/net/ftp/closed_spec.rb21
-rw-r--r--spec/ruby/library/net/ftp/connect_spec.rb49
-rw-r--r--spec/ruby/library/net/ftp/debug_mode_spec.rb23
-rw-r--r--spec/ruby/library/net/ftp/default_passive_spec.rb10
-rw-r--r--spec/ruby/library/net/ftp/delete_spec.rb59
-rw-r--r--spec/ruby/library/net/ftp/dir_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/fixtures/default_passive.rb3
-rw-r--r--spec/ruby/library/net/ftp/fixtures/passive.rb2
-rw-r--r--spec/ruby/library/net/ftp/fixtures/putbinaryfile3
-rw-r--r--spec/ruby/library/net/ftp/fixtures/puttextfile3
-rw-r--r--spec/ruby/library/net/ftp/fixtures/server.rb277
-rw-r--r--spec/ruby/library/net/ftp/get_spec.rb21
-rw-r--r--spec/ruby/library/net/ftp/getbinaryfile_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/getdir_spec.rb7
-rw-r--r--spec/ruby/library/net/ftp/gettextfile_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/help_spec.rb66
-rw-r--r--spec/ruby/library/net/ftp/initialize_spec.rb91
-rw-r--r--spec/ruby/library/net/ftp/last_response_code_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/last_response_spec.rb25
-rw-r--r--spec/ruby/library/net/ftp/lastresp_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/list_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/login_spec.rb195
-rw-r--r--spec/ruby/library/net/ftp/ls_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/mdtm_spec.rb38
-rw-r--r--spec/ruby/library/net/ftp/mkdir_spec.rb61
-rw-r--r--spec/ruby/library/net/ftp/mtime_spec.rb50
-rw-r--r--spec/ruby/library/net/ftp/nlst_spec.rb92
-rw-r--r--spec/ruby/library/net/ftp/noop_spec.rb38
-rw-r--r--spec/ruby/library/net/ftp/open_spec.rb55
-rw-r--r--spec/ruby/library/net/ftp/passive_spec.rb36
-rw-r--r--spec/ruby/library/net/ftp/put_spec.rb21
-rw-r--r--spec/ruby/library/net/ftp/putbinaryfile_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/puttextfile_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/pwd_spec.rb53
-rw-r--r--spec/ruby/library/net/ftp/quit_spec.rb33
-rw-r--r--spec/ruby/library/net/ftp/rename_spec.rb94
-rw-r--r--spec/ruby/library/net/ftp/resume_spec.rb23
-rw-r--r--spec/ruby/library/net/ftp/retrbinary_spec.rb30
-rw-r--r--spec/ruby/library/net/ftp/retrlines_spec.rb34
-rw-r--r--spec/ruby/library/net/ftp/return_code_spec.rb24
-rw-r--r--spec/ruby/library/net/ftp/rmdir_spec.rb58
-rw-r--r--spec/ruby/library/net/ftp/sendcmd_spec.rb54
-rw-r--r--spec/ruby/library/net/ftp/set_socket_spec.rb8
-rw-r--r--spec/ruby/library/net/ftp/shared/getbinaryfile.rb150
-rw-r--r--spec/ruby/library/net/ftp/shared/gettextfile.rb100
-rw-r--r--spec/ruby/library/net/ftp/shared/last_response_code.rb25
-rw-r--r--spec/ruby/library/net/ftp/shared/list.rb104
-rw-r--r--spec/ruby/library/net/ftp/shared/putbinaryfile.rb167
-rw-r--r--spec/ruby/library/net/ftp/shared/puttextfile.rb120
-rw-r--r--spec/ruby/library/net/ftp/shared/pwd.rb3
-rw-r--r--spec/ruby/library/net/ftp/site_spec.rb53
-rw-r--r--spec/ruby/library/net/ftp/size_spec.rb48
-rw-r--r--spec/ruby/library/net/ftp/spec_helper.rb5
-rw-r--r--spec/ruby/library/net/ftp/status_spec.rb69
-rw-r--r--spec/ruby/library/net/ftp/storbinary_spec.rb48
-rw-r--r--spec/ruby/library/net/ftp/storlines_spec.rb43
-rw-r--r--spec/ruby/library/net/ftp/system_spec.rb48
-rw-r--r--spec/ruby/library/net/ftp/voidcmd_spec.rb54
-rw-r--r--spec/ruby/library/net/ftp/welcome_spec.rb25
-rw-r--r--spec/ruby/library/net/http/HTTPBadResponse_spec.rb8
-rw-r--r--spec/ruby/library/net/http/HTTPError_spec.rb12
-rw-r--r--spec/ruby/library/net/http/HTTPFatalError_spec.rb12
-rw-r--r--spec/ruby/library/net/http/HTTPHeaderSyntaxError_spec.rb8
-rw-r--r--spec/ruby/library/net/http/HTTPRetriableError_spec.rb12
-rw-r--r--spec/ruby/library/net/http/HTTPServerException_spec.rb12
-rw-r--r--spec/ruby/library/net/http/http/Proxy_spec.rb35
-rw-r--r--spec/ruby/library/net/http/http/active_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/address_spec.rb9
-rw-r--r--spec/ruby/library/net/http/http/close_on_empty_response_spec.rb10
-rw-r--r--spec/ruby/library/net/http/http/copy_spec.rb21
-rw-r--r--spec/ruby/library/net/http/http/default_port_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/delete_spec.rb21
-rw-r--r--spec/ruby/library/net/http/http/finish_spec.rb29
-rw-r--r--spec/ruby/library/net/http/http/fixtures/http_server.rb105
-rw-r--r--spec/ruby/library/net/http/http/get2_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/get_print_spec.rb30
-rw-r--r--spec/ruby/library/net/http/http/get_response_spec.rb30
-rw-r--r--spec/ruby/library/net/http/http/get_spec.rb26
-rw-r--r--spec/ruby/library/net/http/http/head2_spec.rb9
-rw-r--r--spec/ruby/library/net/http/http/head_spec.rb25
-rw-r--r--spec/ruby/library/net/http/http/http_default_port_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/https_default_port_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/initialize_spec.rb46
-rw-r--r--spec/ruby/library/net/http/http/inspect_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/is_version_1_1_spec.rb7
-rw-r--r--spec/ruby/library/net/http/http/is_version_1_2_spec.rb7
-rw-r--r--spec/ruby/library/net/http/http/lock_spec.rb21
-rw-r--r--spec/ruby/library/net/http/http/mkcol_spec.rb21
-rw-r--r--spec/ruby/library/net/http/http/move_spec.rb25
-rw-r--r--spec/ruby/library/net/http/http/new_spec.rb86
-rw-r--r--spec/ruby/library/net/http/http/newobj_spec.rb48
-rw-r--r--spec/ruby/library/net/http/http/open_timeout_spec.rb35
-rw-r--r--spec/ruby/library/net/http/http/options_spec.rb25
-rw-r--r--spec/ruby/library/net/http/http/port_spec.rb9
-rw-r--r--spec/ruby/library/net/http/http/post2_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/post_form_spec.rb22
-rw-r--r--spec/ruby/library/net/http/http/post_spec.rb77
-rw-r--r--spec/ruby/library/net/http/http/propfind_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/proppatch_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/proxy_address_spec.rb31
-rw-r--r--spec/ruby/library/net/http/http/proxy_class_spec.rb9
-rw-r--r--spec/ruby/library/net/http/http/proxy_pass_spec.rb39
-rw-r--r--spec/ruby/library/net/http/http/proxy_port_spec.rb39
-rw-r--r--spec/ruby/library/net/http/http/proxy_user_spec.rb39
-rw-r--r--spec/ruby/library/net/http/http/put2_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/put_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/read_timeout_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/request_get_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/request_head_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/request_post_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/request_put_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/request_spec.rb109
-rw-r--r--spec/ruby/library/net/http/http/request_types_spec.rb254
-rw-r--r--spec/ruby/library/net/http/http/send_request_spec.rb61
-rw-r--r--spec/ruby/library/net/http/http/set_debug_output_spec.rb33
-rw-r--r--spec/ruby/library/net/http/http/shared/request_get.rb41
-rw-r--r--spec/ruby/library/net/http/http/shared/request_head.rb41
-rw-r--r--spec/ruby/library/net/http/http/shared/request_post.rb41
-rw-r--r--spec/ruby/library/net/http/http/shared/request_put.rb41
-rw-r--r--spec/ruby/library/net/http/http/shared/started.rb26
-rw-r--r--spec/ruby/library/net/http/http/shared/version_1_1.rb6
-rw-r--r--spec/ruby/library/net/http/http/shared/version_1_2.rb6
-rw-r--r--spec/ruby/library/net/http/http/socket_type_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/start_spec.rb111
-rw-r--r--spec/ruby/library/net/http/http/started_spec.rb8
-rw-r--r--spec/ruby/library/net/http/http/trace_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/unlock_spec.rb24
-rw-r--r--spec/ruby/library/net/http/http/use_ssl_spec.rb9
-rw-r--r--spec/ruby/library/net/http/http/version_1_1_spec.rb7
-rw-r--r--spec/ruby/library/net/http/http/version_1_2_spec.rb20
-rw-r--r--spec/ruby/library/net/http/httpexceptions/fixtures/classes.rb5
-rw-r--r--spec/ruby/library/net/http/httpexceptions/initialize_spec.rb17
-rw-r--r--spec/ruby/library/net/http/httpexceptions/response_spec.rb10
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/body_exist_spec.rb22
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/body_spec.rb30
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/body_stream_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/exec_spec.rb131
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/inspect_spec.rb25
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/method_spec.rb15
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/path_spec.rb12
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/request_body_permitted_spec.rb12
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/response_body_permitted_spec.rb12
-rw-r--r--spec/ruby/library/net/http/httpgenericrequest/set_body_internal_spec.rb21
-rw-r--r--spec/ruby/library/net/http/httpheader/add_field_spec.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/basic_auth_spec.rb14
-rw-r--r--spec/ruby/library/net/http/httpheader/canonical_each_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/chunked_spec.rb22
-rw-r--r--spec/ruby/library/net/http/httpheader/content_length_spec.rb54
-rw-r--r--spec/ruby/library/net/http/httpheader/content_range_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/content_type_spec.rb26
-rw-r--r--spec/ruby/library/net/http/httpheader/delete_spec.rb30
-rw-r--r--spec/ruby/library/net/http/httpheader/each_capitalized_name_spec.rb35
-rw-r--r--spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpheader/each_header_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_key_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_name_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_value_spec.rb35
-rw-r--r--spec/ruby/library/net/http/httpheader/element_reference_spec.rb39
-rw-r--r--spec/ruby/library/net/http/httpheader/element_set_spec.rb41
-rw-r--r--spec/ruby/library/net/http/httpheader/fetch_spec.rb68
-rw-r--r--spec/ruby/library/net/http/httpheader/fixtures/classes.rb11
-rw-r--r--spec/ruby/library/net/http/httpheader/form_data_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/get_fields_spec.rb39
-rw-r--r--spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb22
-rw-r--r--spec/ruby/library/net/http/httpheader/key_spec.rb21
-rw-r--r--spec/ruby/library/net/http/httpheader/length_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/main_type_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpheader/proxy_basic_auth_spec.rb14
-rw-r--r--spec/ruby/library/net/http/httpheader/range_length_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/range_spec.rb48
-rw-r--r--spec/ruby/library/net/http/httpheader/set_content_type_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/set_form_data_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/set_range_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_capitalized.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_header.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_name.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_content_type.rb18
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_form_data.rb27
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_range.rb89
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/size.rb18
-rw-r--r--spec/ruby/library/net/http/httpheader/size_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/sub_type_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/to_hash_spec.rb25
-rw-r--r--spec/ruby/library/net/http/httpheader/type_params_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httprequest/initialize_spec.rb45
-rw-r--r--spec/ruby/library/net/http/httpresponse/body_permitted_spec.rb13
-rw-r--r--spec/ruby/library/net/http/httpresponse/body_spec.rb7
-rw-r--r--spec/ruby/library/net/http/httpresponse/code_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpresponse/code_type_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpresponse/entity_spec.rb7
-rw-r--r--spec/ruby/library/net/http/httpresponse/error_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpresponse/error_type_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpresponse/exception_type_spec.rb13
-rw-r--r--spec/ruby/library/net/http/httpresponse/header_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpresponse/http_version_spec.rb12
-rw-r--r--spec/ruby/library/net/http/httpresponse/initialize_spec.rb11
-rw-r--r--spec/ruby/library/net/http/httpresponse/inspect_spec.rb15
-rw-r--r--spec/ruby/library/net/http/httpresponse/message_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpresponse/msg_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpresponse/read_body_spec.rb86
-rw-r--r--spec/ruby/library/net/http/httpresponse/read_header_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpresponse/read_new_spec.rb22
-rw-r--r--spec/ruby/library/net/http/httpresponse/reading_body_spec.rb58
-rw-r--r--spec/ruby/library/net/http/httpresponse/response_spec.rb9
-rw-r--r--spec/ruby/library/net/http/httpresponse/shared/body.rb18
-rw-r--r--spec/ruby/library/net/http/httpresponse/value_spec.rb24
-rw-r--r--spec/ruby/library/observer/add_observer_spec.rb23
-rw-r--r--spec/ruby/library/observer/count_observers_spec.rb23
-rw-r--r--spec/ruby/library/observer/delete_observer_spec.rb19
-rw-r--r--spec/ruby/library/observer/delete_observers_spec.rb19
-rw-r--r--spec/ruby/library/observer/fixtures/classes.rb17
-rw-r--r--spec/ruby/library/observer/notify_observers_spec.rb31
-rw-r--r--spec/ruby/library/open3/capture2_spec.rb6
-rw-r--r--spec/ruby/library/open3/capture2e_spec.rb6
-rw-r--r--spec/ruby/library/open3/capture3_spec.rb6
-rw-r--r--spec/ruby/library/open3/pipeline_r_spec.rb6
-rw-r--r--spec/ruby/library/open3/pipeline_rw_spec.rb6
-rw-r--r--spec/ruby/library/open3/pipeline_spec.rb6
-rw-r--r--spec/ruby/library/open3/pipeline_start_spec.rb6
-rw-r--r--spec/ruby/library/open3/pipeline_w_spec.rb6
-rw-r--r--spec/ruby/library/open3/popen2_spec.rb6
-rw-r--r--spec/ruby/library/open3/popen2e_spec.rb6
-rw-r--r--spec/ruby/library/open3/popen3_spec.rb43
-rw-r--r--spec/ruby/library/openssl/cipher_spec.rb9
-rw-r--r--spec/ruby/library/openssl/config/freeze_spec.rb20
-rw-r--r--spec/ruby/library/openssl/hmac/digest_spec.rb16
-rw-r--r--spec/ruby/library/openssl/hmac/hexdigest_spec.rb16
-rw-r--r--spec/ruby/library/openssl/random/pseudo_bytes_spec.rb8
-rw-r--r--spec/ruby/library/openssl/random/random_bytes_spec.rb6
-rw-r--r--spec/ruby/library/openssl/random/shared/random_bytes.rb29
-rw-r--r--spec/ruby/library/openssl/shared/constants.rb11
-rw-r--r--spec/ruby/library/openssl/x509/name/parse_spec.rb48
-rw-r--r--spec/ruby/library/openstruct/delete_field_spec.rb19
-rw-r--r--spec/ruby/library/openstruct/element_reference_spec.rb13
-rw-r--r--spec/ruby/library/openstruct/element_set_spec.rb13
-rw-r--r--spec/ruby/library/openstruct/equal_value_spec.rb28
-rw-r--r--spec/ruby/library/openstruct/fixtures/classes.rb4
-rw-r--r--spec/ruby/library/openstruct/frozen_spec.rb38
-rw-r--r--spec/ruby/library/openstruct/initialize_spec.rb8
-rw-r--r--spec/ruby/library/openstruct/inspect_spec.rb8
-rw-r--r--spec/ruby/library/openstruct/marshal_dump_spec.rb9
-rw-r--r--spec/ruby/library/openstruct/marshal_load_spec.rb12
-rw-r--r--spec/ruby/library/openstruct/method_missing_spec.rb47
-rw-r--r--spec/ruby/library/openstruct/new_spec.rb20
-rw-r--r--spec/ruby/library/openstruct/shared/inspect.rb20
-rw-r--r--spec/ruby/library/openstruct/to_h_spec.rb29
-rw-r--r--spec/ruby/library/openstruct/to_s_spec.rb8
-rw-r--r--spec/ruby/library/optionparser/order_spec.rb32
-rw-r--r--spec/ruby/library/optionparser/parse_spec.rb32
-rw-r--r--spec/ruby/library/pathname/absolute_spec.rb23
-rw-r--r--spec/ruby/library/pathname/empty_spec.rb34
-rw-r--r--spec/ruby/library/pathname/equal_value_spec.rb15
-rw-r--r--spec/ruby/library/pathname/hash_spec.rb15
-rw-r--r--spec/ruby/library/pathname/join_spec.rb40
-rw-r--r--spec/ruby/library/pathname/new_spec.rb28
-rw-r--r--spec/ruby/library/pathname/parent_spec.rb19
-rw-r--r--spec/ruby/library/pathname/realdirpath_spec.rb10
-rw-r--r--spec/ruby/library/pathname/realpath_spec.rb10
-rw-r--r--spec/ruby/library/pathname/relative_path_from_spec.rb51
-rw-r--r--spec/ruby/library/pathname/relative_spec.rb23
-rw-r--r--spec/ruby/library/pathname/root_spec.rb27
-rw-r--r--spec/ruby/library/pathname/sub_spec.rb16
-rw-r--r--spec/ruby/library/pp/pp_spec.rb25
-rw-r--r--spec/ruby/library/prime/each_spec.rb167
-rw-r--r--spec/ruby/library/prime/instance_spec.rb21
-rw-r--r--spec/ruby/library/prime/int_from_prime_division_spec.rb13
-rw-r--r--spec/ruby/library/prime/integer/each_prime_spec.rb13
-rw-r--r--spec/ruby/library/prime/integer/from_prime_division_spec.rb13
-rw-r--r--spec/ruby/library/prime/integer/prime_division_spec.rb19
-rw-r--r--spec/ruby/library/prime/integer/prime_spec.rb17
-rw-r--r--spec/ruby/library/prime/next_spec.rb7
-rw-r--r--spec/ruby/library/prime/prime_division_spec.rb25
-rw-r--r--spec/ruby/library/prime/prime_spec.rb17
-rw-r--r--spec/ruby/library/prime/shared/next.rb8
-rw-r--r--spec/ruby/library/prime/succ_spec.rb7
-rw-r--r--spec/ruby/library/readline/basic_quote_characters_spec.rb18
-rw-r--r--spec/ruby/library/readline/basic_word_break_characters_spec.rb16
-rw-r--r--spec/ruby/library/readline/completer_quote_characters_spec.rb16
-rw-r--r--spec/ruby/library/readline/completer_word_break_characters_spec.rb16
-rw-r--r--spec/ruby/library/readline/completion_append_character_spec.rb16
-rw-r--r--spec/ruby/library/readline/completion_case_fold_spec.rb18
-rw-r--r--spec/ruby/library/readline/completion_proc_spec.rb22
-rw-r--r--spec/ruby/library/readline/constants_spec.rb18
-rw-r--r--spec/ruby/library/readline/emacs_editing_mode_spec.rb11
-rw-r--r--spec/ruby/library/readline/filename_quote_characters_spec.rb18
-rw-r--r--spec/ruby/library/readline/history/append_spec.rb28
-rw-r--r--spec/ruby/library/readline/history/delete_at_spec.rb45
-rw-r--r--spec/ruby/library/readline/history/each_spec.rb29
-rw-r--r--spec/ruby/library/readline/history/element_reference_spec.rb40
-rw-r--r--spec/ruby/library/readline/history/element_set_spec.rb35
-rw-r--r--spec/ruby/library/readline/history/empty_spec.rb13
-rw-r--r--spec/ruby/library/readline/history/history_spec.rb9
-rw-r--r--spec/ruby/library/readline/history/length_spec.rb9
-rw-r--r--spec/ruby/library/readline/history/pop_spec.rb30
-rw-r--r--spec/ruby/library/readline/history/push_spec.rb26
-rw-r--r--spec/ruby/library/readline/history/shared/size.rb14
-rw-r--r--spec/ruby/library/readline/history/shift_spec.rb30
-rw-r--r--spec/ruby/library/readline/history/size_spec.rb9
-rw-r--r--spec/ruby/library/readline/history/to_s_spec.rb9
-rw-r--r--spec/ruby/library/readline/readline_spec.rb31
-rw-r--r--spec/ruby/library/readline/spec_helper.rb11
-rw-r--r--spec/ruby/library/readline/vi_editing_mode_spec.rb11
-rw-r--r--spec/ruby/library/resolv/get_address_spec.rb21
-rw-r--r--spec/ruby/library/resolv/get_addresses_spec.rb14
-rw-r--r--spec/ruby/library/resolv/get_name_spec.rb19
-rw-r--r--spec/ruby/library/resolv/get_names_spec.rb14
-rw-r--r--spec/ruby/library/rexml/attribute/clone_spec.rb11
-rw-r--r--spec/ruby/library/rexml/attribute/element_spec.rb23
-rw-r--r--spec/ruby/library/rexml/attribute/equal_value_spec.rb18
-rw-r--r--spec/ruby/library/rexml/attribute/hash_spec.rb13
-rw-r--r--spec/ruby/library/rexml/attribute/initialize_spec.rb29
-rw-r--r--spec/ruby/library/rexml/attribute/inspect_spec.rb20
-rw-r--r--spec/ruby/library/rexml/attribute/namespace_spec.rb24
-rw-r--r--spec/ruby/library/rexml/attribute/node_type_spec.rb10
-rw-r--r--spec/ruby/library/rexml/attribute/prefix_spec.rb18
-rw-r--r--spec/ruby/library/rexml/attribute/remove_spec.rb20
-rw-r--r--spec/ruby/library/rexml/attribute/to_s_spec.rb14
-rw-r--r--spec/ruby/library/rexml/attribute/to_string_spec.rb15
-rw-r--r--spec/ruby/library/rexml/attribute/value_spec.rb15
-rw-r--r--spec/ruby/library/rexml/attribute/write_spec.rb23
-rw-r--r--spec/ruby/library/rexml/attribute/xpath_spec.rb20
-rw-r--r--spec/ruby/library/rexml/attributes/add_spec.rb7
-rw-r--r--spec/ruby/library/rexml/attributes/append_spec.rb7
-rw-r--r--spec/ruby/library/rexml/attributes/delete_all_spec.rb31
-rw-r--r--spec/ruby/library/rexml/attributes/delete_spec.rb27
-rw-r--r--spec/ruby/library/rexml/attributes/each_attribute_spec.rb25
-rw-r--r--spec/ruby/library/rexml/attributes/each_spec.rb25
-rw-r--r--spec/ruby/library/rexml/attributes/element_reference_spec.rb19
-rw-r--r--spec/ruby/library/rexml/attributes/element_set_spec.rb26
-rw-r--r--spec/ruby/library/rexml/attributes/get_attribute_ns_spec.rb14
-rw-r--r--spec/ruby/library/rexml/attributes/get_attribute_spec.rb29
-rw-r--r--spec/ruby/library/rexml/attributes/initialize_spec.rb18
-rw-r--r--spec/ruby/library/rexml/attributes/length_spec.rb7
-rw-r--r--spec/ruby/library/rexml/attributes/namespaces_spec.rb6
-rw-r--r--spec/ruby/library/rexml/attributes/prefixes_spec.rb24
-rw-r--r--spec/ruby/library/rexml/attributes/shared/add.rb17
-rw-r--r--spec/ruby/library/rexml/attributes/shared/length.rb13
-rw-r--r--spec/ruby/library/rexml/attributes/size_spec.rb7
-rw-r--r--spec/ruby/library/rexml/attributes/to_a_spec.rb20
-rw-r--r--spec/ruby/library/rexml/cdata/clone_spec.rb10
-rw-r--r--spec/ruby/library/rexml/cdata/initialize_spec.rb24
-rw-r--r--spec/ruby/library/rexml/cdata/shared/to_s.rb11
-rw-r--r--spec/ruby/library/rexml/cdata/to_s_spec.rb7
-rw-r--r--spec/ruby/library/rexml/cdata/value_spec.rb7
-rw-r--r--spec/ruby/library/rexml/document/add_element_spec.rb31
-rw-r--r--spec/ruby/library/rexml/document/add_spec.rb57
-rw-r--r--spec/ruby/library/rexml/document/clone_spec.rb20
-rw-r--r--spec/ruby/library/rexml/document/doctype_spec.rb15
-rw-r--r--spec/ruby/library/rexml/document/encoding_spec.rb22
-rw-r--r--spec/ruby/library/rexml/document/expanded_name_spec.rb16
-rw-r--r--spec/ruby/library/rexml/document/new_spec.rb36
-rw-r--r--spec/ruby/library/rexml/document/node_type_spec.rb8
-rw-r--r--spec/ruby/library/rexml/document/root_spec.rb12
-rw-r--r--spec/ruby/library/rexml/document/stand_alone_spec.rb19
-rw-r--r--spec/ruby/library/rexml/document/version_spec.rb14
-rw-r--r--spec/ruby/library/rexml/document/write_spec.rb35
-rw-r--r--spec/ruby/library/rexml/document/xml_decl_spec.rb15
-rw-r--r--spec/ruby/library/rexml/element/add_attribute_spec.rb41
-rw-r--r--spec/ruby/library/rexml/element/add_attributes_spec.rb22
-rw-r--r--spec/ruby/library/rexml/element/add_element_spec.rb39
-rw-r--r--spec/ruby/library/rexml/element/add_namespace_spec.rb24
-rw-r--r--spec/ruby/library/rexml/element/add_text_spec.rb24
-rw-r--r--spec/ruby/library/rexml/element/attribute_spec.rb17
-rw-r--r--spec/ruby/library/rexml/element/attributes_spec.rb19
-rw-r--r--spec/ruby/library/rexml/element/cdatas_spec.rb24
-rw-r--r--spec/ruby/library/rexml/element/clone_spec.rb29
-rw-r--r--spec/ruby/library/rexml/element/comments_spec.rb20
-rw-r--r--spec/ruby/library/rexml/element/delete_attribute_spec.rb39
-rw-r--r--spec/ruby/library/rexml/element/delete_element_spec.rb49
-rw-r--r--spec/ruby/library/rexml/element/delete_namespace_spec.rb25
-rw-r--r--spec/ruby/library/rexml/element/document_spec.rb18
-rw-r--r--spec/ruby/library/rexml/element/each_element_with_attribute_spec.rb35
-rw-r--r--spec/ruby/library/rexml/element/each_element_with_text_spec.rb31
-rw-r--r--spec/ruby/library/rexml/element/element_reference_spec.rb22
-rw-r--r--spec/ruby/library/rexml/element/get_text_spec.rb18
-rw-r--r--spec/ruby/library/rexml/element/has_attributes_spec.rb17
-rw-r--r--spec/ruby/library/rexml/element/has_elements_spec.rb18
-rw-r--r--spec/ruby/library/rexml/element/has_text_spec.rb16
-rw-r--r--spec/ruby/library/rexml/element/inspect_spec.rb27
-rw-r--r--spec/ruby/library/rexml/element/instructions_spec.rb21
-rw-r--r--spec/ruby/library/rexml/element/namespace_spec.rb27
-rw-r--r--spec/ruby/library/rexml/element/namespaces_spec.rb32
-rw-r--r--spec/ruby/library/rexml/element/new_spec.rb35
-rw-r--r--spec/ruby/library/rexml/element/next_element_spec.rb19
-rw-r--r--spec/ruby/library/rexml/element/node_type_spec.rb8
-rw-r--r--spec/ruby/library/rexml/element/prefixes_spec.rb23
-rw-r--r--spec/ruby/library/rexml/element/previous_element_spec.rb20
-rw-r--r--spec/ruby/library/rexml/element/raw_spec.rb24
-rw-r--r--spec/ruby/library/rexml/element/root_spec.rb28
-rw-r--r--spec/ruby/library/rexml/element/text_spec.rb46
-rw-r--r--spec/ruby/library/rexml/element/texts_spec.rb16
-rw-r--r--spec/ruby/library/rexml/element/whitespace_spec.rb23
-rw-r--r--spec/ruby/library/rexml/node/each_recursive_spec.rb21
-rw-r--r--spec/ruby/library/rexml/node/find_first_recursive_spec.rb25
-rw-r--r--spec/ruby/library/rexml/node/index_in_parent_spec.rb15
-rw-r--r--spec/ruby/library/rexml/node/next_sibling_node_spec.rb21
-rw-r--r--spec/ruby/library/rexml/node/parent_spec.rb21
-rw-r--r--spec/ruby/library/rexml/node/previous_sibling_node_spec.rb21
-rw-r--r--spec/ruby/library/rexml/shared/each_element.rb36
-rw-r--r--spec/ruby/library/rexml/shared/elements_to_a.rb34
-rw-r--r--spec/ruby/library/rexml/text/append_spec.rb10
-rw-r--r--spec/ruby/library/rexml/text/clone_spec.rb10
-rw-r--r--spec/ruby/library/rexml/text/comparison_spec.rb25
-rw-r--r--spec/ruby/library/rexml/text/empty_spec.rb12
-rw-r--r--spec/ruby/library/rexml/text/indent_text_spec.rb24
-rw-r--r--spec/ruby/library/rexml/text/inspect_spec.rb8
-rw-r--r--spec/ruby/library/rexml/text/new_spec.rb49
-rw-r--r--spec/ruby/library/rexml/text/node_type_spec.rb8
-rw-r--r--spec/ruby/library/rexml/text/normalize_spec.rb8
-rw-r--r--spec/ruby/library/rexml/text/read_with_substitution_spec.rb13
-rw-r--r--spec/ruby/library/rexml/text/to_s_spec.rb18
-rw-r--r--spec/ruby/library/rexml/text/unnormalize_spec.rb8
-rw-r--r--spec/ruby/library/rexml/text/value_spec.rb37
-rw-r--r--spec/ruby/library/rexml/text/wrap_spec.rb21
-rw-r--r--spec/ruby/library/rexml/text/write_with_substitution_spec.rb33
-rw-r--r--spec/ruby/library/scanf/io/block_scanf_spec.rb7
-rw-r--r--spec/ruby/library/scanf/io/fixtures/date.txt4
-rw-r--r--spec/ruby/library/scanf/io/fixtures/helloworld.txt1
-rw-r--r--spec/ruby/library/scanf/io/scanf_spec.rb35
-rw-r--r--spec/ruby/library/scanf/io/shared/block_scanf.rb28
-rw-r--r--spec/ruby/library/scanf/string/block_scanf_spec.rb7
-rw-r--r--spec/ruby/library/scanf/string/scanf_spec.rb53
-rw-r--r--spec/ruby/library/scanf/string/shared/block_scanf.rb25
-rw-r--r--spec/ruby/library/securerandom/base64_spec.rb55
-rw-r--r--spec/ruby/library/securerandom/hex_spec.rb54
-rw-r--r--spec/ruby/library/securerandom/random_bytes_spec.rb50
-rw-r--r--spec/ruby/library/securerandom/random_number_spec.rb95
-rw-r--r--spec/ruby/library/set/add_spec.rb27
-rw-r--r--spec/ruby/library/set/append_spec.rb7
-rw-r--r--spec/ruby/library/set/case_compare_spec.rb15
-rw-r--r--spec/ruby/library/set/case_equality_spec.rb9
-rw-r--r--spec/ruby/library/set/classify_spec.rb27
-rw-r--r--spec/ruby/library/set/clear_spec.rb17
-rw-r--r--spec/ruby/library/set/collect_spec.rb7
-rw-r--r--spec/ruby/library/set/compare_by_identity_spec.rb147
-rw-r--r--spec/ruby/library/set/constructor_spec.rb15
-rw-r--r--spec/ruby/library/set/delete_if_spec.rb38
-rw-r--r--spec/ruby/library/set/delete_spec.rb37
-rw-r--r--spec/ruby/library/set/difference_spec.rb7
-rw-r--r--spec/ruby/library/set/divide_spec.rb34
-rw-r--r--spec/ruby/library/set/each_spec.rb26
-rw-r--r--spec/ruby/library/set/empty_spec.rb10
-rw-r--r--spec/ruby/library/set/enumerable/to_set_spec.rb19
-rw-r--r--spec/ruby/library/set/eql_spec.rb15
-rw-r--r--spec/ruby/library/set/equal_value_spec.rb26
-rw-r--r--spec/ruby/library/set/exclusion_spec.rb18
-rw-r--r--spec/ruby/library/set/flatten_merge_spec.rb23
-rw-r--r--spec/ruby/library/set/flatten_spec.rb40
-rw-r--r--spec/ruby/library/set/hash_spec.rb13
-rw-r--r--spec/ruby/library/set/include_spec.rb7
-rw-r--r--spec/ruby/library/set/initialize_spec.rb24
-rw-r--r--spec/ruby/library/set/inspect_spec.rb7
-rw-r--r--spec/ruby/library/set/intersection_spec.rb11
-rw-r--r--spec/ruby/library/set/keep_if_spec.rb38
-rw-r--r--spec/ruby/library/set/length_spec.rb7
-rw-r--r--spec/ruby/library/set/map_spec.rb7
-rw-r--r--spec/ruby/library/set/member_spec.rb7
-rw-r--r--spec/ruby/library/set/merge_spec.rb19
-rw-r--r--spec/ruby/library/set/minus_spec.rb7
-rw-r--r--spec/ruby/library/set/plus_spec.rb7
-rw-r--r--spec/ruby/library/set/pretty_print_cycle_spec.rb10
-rw-r--r--spec/ruby/library/set/pretty_print_spec.rb17
-rw-r--r--spec/ruby/library/set/proper_subset_spec.rb34
-rw-r--r--spec/ruby/library/set/proper_superset_spec.rb34
-rw-r--r--spec/ruby/library/set/reject_spec.rb42
-rw-r--r--spec/ruby/library/set/replace_spec.rb17
-rw-r--r--spec/ruby/library/set/select_spec.rb42
-rw-r--r--spec/ruby/library/set/shared/add.rb14
-rw-r--r--spec/ruby/library/set/shared/collect.rb20
-rw-r--r--spec/ruby/library/set/shared/difference.rb15
-rw-r--r--spec/ruby/library/set/shared/include.rb29
-rw-r--r--spec/ruby/library/set/shared/inspect.rb15
-rw-r--r--spec/ruby/library/set/shared/intersection.rb15
-rw-r--r--spec/ruby/library/set/shared/length.rb6
-rw-r--r--spec/ruby/library/set/shared/union.rb15
-rw-r--r--spec/ruby/library/set/size_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/add_spec.rb39
-rw-r--r--spec/ruby/library/set/sortedset/append_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/case_equality_spec.rb9
-rw-r--r--spec/ruby/library/set/sortedset/classify_spec.rb27
-rw-r--r--spec/ruby/library/set/sortedset/clear_spec.rb17
-rw-r--r--spec/ruby/library/set/sortedset/collect_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/constructor_spec.rb15
-rw-r--r--spec/ruby/library/set/sortedset/delete_if_spec.rb38
-rw-r--r--spec/ruby/library/set/sortedset/delete_spec.rb37
-rw-r--r--spec/ruby/library/set/sortedset/difference_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/divide_spec.rb34
-rw-r--r--spec/ruby/library/set/sortedset/each_spec.rb26
-rw-r--r--spec/ruby/library/set/sortedset/empty_spec.rb10
-rw-r--r--spec/ruby/library/set/sortedset/eql_spec.rb16
-rw-r--r--spec/ruby/library/set/sortedset/equal_value_spec.rb13
-rw-r--r--spec/ruby/library/set/sortedset/exclusion_spec.rb18
-rw-r--r--spec/ruby/library/set/sortedset/flatten_merge_spec.rb8
-rw-r--r--spec/ruby/library/set/sortedset/flatten_spec.rb44
-rw-r--r--spec/ruby/library/set/sortedset/hash_spec.rb13
-rw-r--r--spec/ruby/library/set/sortedset/include_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/initialize_spec.rb30
-rw-r--r--spec/ruby/library/set/sortedset/inspect_spec.rb10
-rw-r--r--spec/ruby/library/set/sortedset/intersection_spec.rb11
-rw-r--r--spec/ruby/library/set/sortedset/keep_if_spec.rb31
-rw-r--r--spec/ruby/library/set/sortedset/length_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/map_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/member_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/merge_spec.rb19
-rw-r--r--spec/ruby/library/set/sortedset/minus_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/plus_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/pretty_print_cycle_spec.rb10
-rw-r--r--spec/ruby/library/set/sortedset/pretty_print_spec.rb17
-rw-r--r--spec/ruby/library/set/sortedset/proper_subset_spec.rb33
-rw-r--r--spec/ruby/library/set/sortedset/proper_superset_spec.rb33
-rw-r--r--spec/ruby/library/set/sortedset/reject_spec.rb42
-rw-r--r--spec/ruby/library/set/sortedset/replace_spec.rb17
-rw-r--r--spec/ruby/library/set/sortedset/select_spec.rb35
-rw-r--r--spec/ruby/library/set/sortedset/shared/add.rb14
-rw-r--r--spec/ruby/library/set/sortedset/shared/collect.rb20
-rw-r--r--spec/ruby/library/set/sortedset/shared/difference.rb15
-rw-r--r--spec/ruby/library/set/sortedset/shared/include.rb7
-rw-r--r--spec/ruby/library/set/sortedset/shared/intersection.rb15
-rw-r--r--spec/ruby/library/set/sortedset/shared/length.rb6
-rw-r--r--spec/ruby/library/set/sortedset/shared/union.rb15
-rw-r--r--spec/ruby/library/set/sortedset/size_spec.rb7
-rw-r--r--spec/ruby/library/set/sortedset/subset_spec.rb33
-rw-r--r--spec/ruby/library/set/sortedset/subtract_spec.rb17
-rw-r--r--spec/ruby/library/set/sortedset/superset_spec.rb33
-rw-r--r--spec/ruby/library/set/sortedset/to_a_spec.rb17
-rw-r--r--spec/ruby/library/set/sortedset/union_spec.rb11
-rw-r--r--spec/ruby/library/set/subset_spec.rb34
-rw-r--r--spec/ruby/library/set/subtract_spec.rb17
-rw-r--r--spec/ruby/library/set/superset_spec.rb34
-rw-r--r--spec/ruby/library/set/to_a_spec.rb8
-rw-r--r--spec/ruby/library/set/to_s_spec.rb13
-rw-r--r--spec/ruby/library/set/union_spec.rb11
-rw-r--r--spec/ruby/library/shellwords/shellwords_spec.rb36
-rw-r--r--spec/ruby/library/singleton/allocate_spec.rb8
-rw-r--r--spec/ruby/library/singleton/clone_spec.rb8
-rw-r--r--spec/ruby/library/singleton/dump_spec.rb14
-rw-r--r--spec/ruby/library/singleton/dup_spec.rb8
-rw-r--r--spec/ruby/library/singleton/fixtures/classes.rb18
-rw-r--r--spec/ruby/library/singleton/instance_spec.rb30
-rw-r--r--spec/ruby/library/singleton/load_spec.rb21
-rw-r--r--spec/ruby/library/singleton/new_spec.rb8
-rw-r--r--spec/ruby/library/socket/addrinfo/afamily_spec.rb38
-rw-r--r--spec/ruby/library/socket/addrinfo/bind_spec.rb29
-rw-r--r--spec/ruby/library/socket/addrinfo/canonname_spec.rb19
-rw-r--r--spec/ruby/library/socket/addrinfo/initialize_spec.rb253
-rw-r--r--spec/ruby/library/socket/addrinfo/inspect_sockaddr_spec.rb25
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_address_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_port_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_unpack_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb46
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb46
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb41
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_loopback_spec.rb46
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb46
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/pfamily_spec.rb38
-rw-r--r--spec/ruby/library/socket/addrinfo/protocol_spec.rb38
-rw-r--r--spec/ruby/library/socket/addrinfo/shared/to_sockaddr.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/socktype_spec.rb38
-rw-r--r--spec/ruby/library/socket/addrinfo/tcp_spec.rb20
-rw-r--r--spec/ruby/library/socket/addrinfo/to_s_spec.rb7
-rw-r--r--spec/ruby/library/socket/addrinfo/to_sockaddr_spec.rb7
-rw-r--r--spec/ruby/library/socket/addrinfo/udp_spec.rb20
-rw-r--r--spec/ruby/library/socket/addrinfo/unix_path_spec.rb40
-rw-r--r--spec/ruby/library/socket/addrinfo/unix_spec.rb54
-rw-r--r--spec/ruby/library/socket/basicsocket/close_read_spec.rb43
-rw-r--r--spec/ruby/library/socket/basicsocket/close_write_spec.rb48
-rw-r--r--spec/ruby/library/socket/basicsocket/do_not_reverse_lookup_spec.rb39
-rw-r--r--spec/ruby/library/socket/basicsocket/for_fd_spec.rb21
-rw-r--r--spec/ruby/library/socket/basicsocket/getpeername_spec.rb26
-rw-r--r--spec/ruby/library/socket/basicsocket/getsockname_spec.rb28
-rw-r--r--spec/ruby/library/socket/basicsocket/getsockopt_spec.rb46
-rw-r--r--spec/ruby/library/socket/basicsocket/ioctl_spec.rb43
-rw-r--r--spec/ruby/library/socket/basicsocket/recv_nonblock_spec.rb7
-rw-r--r--spec/ruby/library/socket/basicsocket/recv_spec.rb96
-rw-r--r--spec/ruby/library/socket/basicsocket/send_spec.rb85
-rw-r--r--spec/ruby/library/socket/basicsocket/setsockopt_spec.rb213
-rw-r--r--spec/ruby/library/socket/basicsocket/shutdown_spec.rb6
-rw-r--r--spec/ruby/library/socket/constants/constants_spec.rb90
-rw-r--r--spec/ruby/library/socket/fixtures/classes.rb93
-rw-r--r--spec/ruby/library/socket/fixtures/send_io.txt1
-rw-r--r--spec/ruby/library/socket/ipsocket/addr_spec.rb42
-rw-r--r--spec/ruby/library/socket/ipsocket/getaddress_spec.rb27
-rw-r--r--spec/ruby/library/socket/ipsocket/peeraddr_spec.rb51
-rw-r--r--spec/ruby/library/socket/ipsocket/recvfrom_spec.rb72
-rw-r--r--spec/ruby/library/socket/option/bool_spec.rb25
-rw-r--r--spec/ruby/library/socket/option/inspect_spec.rb20
-rw-r--r--spec/ruby/library/socket/option/int_spec.rb28
-rw-r--r--spec/ruby/library/socket/option/linger_spec.rb62
-rw-r--r--spec/ruby/library/socket/option/new_spec.rb35
-rw-r--r--spec/ruby/library/socket/shared/pack_sockaddr.rb50
-rw-r--r--spec/ruby/library/socket/shared/partially_closable_sockets.rb13
-rw-r--r--spec/ruby/library/socket/shared/recv_nonblock.rb54
-rw-r--r--spec/ruby/library/socket/shared/socketpair.rb23
-rw-r--r--spec/ruby/library/socket/socket/accept_nonblock_spec.rb37
-rw-r--r--spec/ruby/library/socket/socket/accept_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/bind_spec.rb81
-rw-r--r--spec/ruby/library/socket/socket/connect_nonblock_spec.rb73
-rw-r--r--spec/ruby/library/socket/socket/connect_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/for_fd_spec.rb31
-rw-r--r--spec/ruby/library/socket/socket/getaddrinfo_spec.rb112
-rw-r--r--spec/ruby/library/socket/socket/gethostbyaddr_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/gethostbyname_spec.rb17
-rw-r--r--spec/ruby/library/socket/socket/gethostname_spec.rb8
-rw-r--r--spec/ruby/library/socket/socket/getnameinfo_spec.rb66
-rw-r--r--spec/ruby/library/socket/socket/getservbyname_spec.rb24
-rw-r--r--spec/ruby/library/socket/socket/listen_spec.rb22
-rw-r--r--spec/ruby/library/socket/socket/new_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/pack_sockaddr_in_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/pack_sockaddr_un_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/pair_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/recvfrom_nonblock_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/recvfrom_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/sockaddr_in_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/sockaddr_un_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/socket_spec.rb38
-rw-r--r--spec/ruby/library/socket/socket/socketpair_spec.rb7
-rw-r--r--spec/ruby/library/socket/socket/sysaccept_spec.rb2
-rw-r--r--spec/ruby/library/socket/socket/unpack_sockaddr_in_spec.rb29
-rw-r--r--spec/ruby/library/socket/socket/unpack_sockaddr_un_spec.rb26
-rw-r--r--spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb50
-rw-r--r--spec/ruby/library/socket/tcpserver/accept_spec.rb66
-rw-r--r--spec/ruby/library/socket/tcpserver/gets_spec.rb16
-rw-r--r--spec/ruby/library/socket/tcpserver/listen_spec.rb18
-rw-r--r--spec/ruby/library/socket/tcpserver/new_spec.rb96
-rw-r--r--spec/ruby/library/socket/tcpserver/sysaccept_spec.rb32
-rw-r--r--spec/ruby/library/socket/tcpsocket/gethostbyname_spec.rb51
-rw-r--r--spec/ruby/library/socket/tcpsocket/new_spec.rb5
-rw-r--r--spec/ruby/library/socket/tcpsocket/open_spec.rb5
-rw-r--r--spec/ruby/library/socket/tcpsocket/partially_closable_spec.rb21
-rw-r--r--spec/ruby/library/socket/tcpsocket/recv_nonblock_spec.rb36
-rw-r--r--spec/ruby/library/socket/tcpsocket/setsockopt_spec.rb45
-rw-r--r--spec/ruby/library/socket/tcpsocket/shared/new.rb79
-rw-r--r--spec/ruby/library/socket/udpsocket/bind_spec.rb42
-rw-r--r--spec/ruby/library/socket/udpsocket/new_spec.rb34
-rw-r--r--spec/ruby/library/socket/udpsocket/open_spec.rb13
-rw-r--r--spec/ruby/library/socket/udpsocket/send_spec.rb78
-rw-r--r--spec/ruby/library/socket/udpsocket/write_spec.rb21
-rw-r--r--spec/ruby/library/socket/unixserver/accept_nonblock_spec.rb38
-rw-r--r--spec/ruby/library/socket/unixserver/accept_spec.rb61
-rw-r--r--spec/ruby/library/socket/unixserver/for_fd_spec.rb23
-rw-r--r--spec/ruby/library/socket/unixserver/new_spec.rb6
-rw-r--r--spec/ruby/library/socket/unixserver/open_spec.rb25
-rw-r--r--spec/ruby/library/socket/unixserver/shared/new.rb23
-rw-r--r--spec/ruby/library/socket/unixsocket/addr_spec.rb36
-rw-r--r--spec/ruby/library/socket/unixsocket/inspect_spec.rb17
-rw-r--r--spec/ruby/library/socket/unixsocket/new_spec.rb6
-rw-r--r--spec/ruby/library/socket/unixsocket/open_spec.rb27
-rw-r--r--spec/ruby/library/socket/unixsocket/pair_spec.rb39
-rw-r--r--spec/ruby/library/socket/unixsocket/partially_closable_spec.rb25
-rw-r--r--spec/ruby/library/socket/unixsocket/path_spec.rb28
-rw-r--r--spec/ruby/library/socket/unixsocket/peeraddr_spec.rb30
-rw-r--r--spec/ruby/library/socket/unixsocket/recv_io_spec.rb44
-rw-r--r--spec/ruby/library/socket/unixsocket/recvfrom_spec.rb47
-rw-r--r--spec/ruby/library/socket/unixsocket/send_io_spec.rb35
-rw-r--r--spec/ruby/library/socket/unixsocket/shared/new.rb24
-rw-r--r--spec/ruby/library/stringio/append_spec.rb84
-rw-r--r--spec/ruby/library/stringio/binmode_spec.rb9
-rw-r--r--spec/ruby/library/stringio/bytes_spec.rb11
-rw-r--r--spec/ruby/library/stringio/chars_spec.rb11
-rw-r--r--spec/ruby/library/stringio/close_read_spec.rb36
-rw-r--r--spec/ruby/library/stringio/close_spec.rb32
-rw-r--r--spec/ruby/library/stringio/close_write_spec.rb36
-rw-r--r--spec/ruby/library/stringio/closed_read_spec.rb12
-rw-r--r--spec/ruby/library/stringio/closed_spec.rb16
-rw-r--r--spec/ruby/library/stringio/closed_write_spec.rb12
-rw-r--r--spec/ruby/library/stringio/codepoints_spec.rb9
-rw-r--r--spec/ruby/library/stringio/each_byte_spec.rb11
-rw-r--r--spec/ruby/library/stringio/each_char_spec.rb11
-rw-r--r--spec/ruby/library/stringio/each_codepoint_spec.rb10
-rw-r--r--spec/ruby/library/stringio/each_line_spec.rb21
-rw-r--r--spec/ruby/library/stringio/each_spec.rb21
-rw-r--r--spec/ruby/library/stringio/eof_spec.rb11
-rw-r--r--spec/ruby/library/stringio/external_encoding_spec.rb21
-rw-r--r--spec/ruby/library/stringio/fcntl_spec.rb8
-rw-r--r--spec/ruby/library/stringio/fileno_spec.rb9
-rw-r--r--spec/ruby/library/stringio/fixtures/classes.rb15
-rw-r--r--spec/ruby/library/stringio/flush_spec.rb9
-rw-r--r--spec/ruby/library/stringio/fsync_spec.rb9
-rw-r--r--spec/ruby/library/stringio/getbyte_spec.rb19
-rw-r--r--spec/ruby/library/stringio/getc_spec.rb19
-rw-r--r--spec/ruby/library/stringio/getch_spec.rb46
-rw-r--r--spec/ruby/library/stringio/gets_spec.rb247
-rw-r--r--spec/ruby/library/stringio/initialize_spec.rb185
-rw-r--r--spec/ruby/library/stringio/internal_encoding_spec.rb10
-rw-r--r--spec/ruby/library/stringio/isatty_spec.rb7
-rw-r--r--spec/ruby/library/stringio/length_spec.rb7
-rw-r--r--spec/ruby/library/stringio/lineno_spec.rb30
-rw-r--r--spec/ruby/library/stringio/lines_spec.rb21
-rw-r--r--spec/ruby/library/stringio/open_spec.rb208
-rw-r--r--spec/ruby/library/stringio/path_spec.rb8
-rw-r--r--spec/ruby/library/stringio/pid_spec.rb8
-rw-r--r--spec/ruby/library/stringio/pos_spec.rb28
-rw-r--r--spec/ruby/library/stringio/print_spec.rb100
-rw-r--r--spec/ruby/library/stringio/printf_spec.rb71
-rw-r--r--spec/ruby/library/stringio/putc_spec.rb88
-rw-r--r--spec/ruby/library/stringio/puts_spec.rb159
-rw-r--r--spec/ruby/library/stringio/read_nonblock_spec.rb20
-rw-r--r--spec/ruby/library/stringio/read_spec.rb62
-rw-r--r--spec/ruby/library/stringio/readbyte_spec.rb20
-rw-r--r--spec/ruby/library/stringio/readchar_spec.rb20
-rw-r--r--spec/ruby/library/stringio/readline_spec.rb131
-rw-r--r--spec/ruby/library/stringio/readlines_spec.rb101
-rw-r--r--spec/ruby/library/stringio/readpartial_spec.rb80
-rw-r--r--spec/ruby/library/stringio/reopen_spec.rb288
-rw-r--r--spec/ruby/library/stringio/rewind_spec.rb24
-rw-r--r--spec/ruby/library/stringio/seek_spec.rb67
-rw-r--r--spec/ruby/library/stringio/set_encoding_spec.rb10
-rw-r--r--spec/ruby/library/stringio/shared/codepoints.rb45
-rw-r--r--spec/ruby/library/stringio/shared/each.rb114
-rw-r--r--spec/ruby/library/stringio/shared/each_byte.rb48
-rw-r--r--spec/ruby/library/stringio/shared/each_char.rb36
-rw-r--r--spec/ruby/library/stringio/shared/eof.rb24
-rw-r--r--spec/ruby/library/stringio/shared/getc.rb43
-rw-r--r--spec/ruby/library/stringio/shared/isatty.rb5
-rw-r--r--spec/ruby/library/stringio/shared/length.rb5
-rw-r--r--spec/ruby/library/stringio/shared/read.rb121
-rw-r--r--spec/ruby/library/stringio/shared/readchar.rb29
-rw-r--r--spec/ruby/library/stringio/shared/sysread.rb15
-rw-r--r--spec/ruby/library/stringio/shared/tell.rb12
-rw-r--r--spec/ruby/library/stringio/shared/write.rb87
-rw-r--r--spec/ruby/library/stringio/size_spec.rb7
-rw-r--r--spec/ruby/library/stringio/string_spec.rb50
-rw-r--r--spec/ruby/library/stringio/stringio_spec.rb9
-rw-r--r--spec/ruby/library/stringio/sync_spec.rb19
-rw-r--r--spec/ruby/library/stringio/sysread_spec.rb48
-rw-r--r--spec/ruby/library/stringio/syswrite_spec.rb19
-rw-r--r--spec/ruby/library/stringio/tell_spec.rb7
-rw-r--r--spec/ruby/library/stringio/truncate_spec.rb70
-rw-r--r--spec/ruby/library/stringio/tty_spec.rb7
-rw-r--r--spec/ruby/library/stringio/ungetbyte_spec.rb6
-rw-r--r--spec/ruby/library/stringio/ungetc_spec.rb72
-rw-r--r--spec/ruby/library/stringio/write_nonblock_spec.rb19
-rw-r--r--spec/ruby/library/stringio/write_spec.rb19
-rw-r--r--spec/ruby/library/stringscanner/append_spec.rb11
-rw-r--r--spec/ruby/library/stringscanner/beginning_of_line_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/bol_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/check_spec.rb16
-rw-r--r--spec/ruby/library/stringscanner/check_until_spec.rb15
-rw-r--r--spec/ruby/library/stringscanner/clear_spec.rb20
-rw-r--r--spec/ruby/library/stringscanner/concat_spec.rb11
-rw-r--r--spec/ruby/library/stringscanner/dup_spec.rb39
-rw-r--r--spec/ruby/library/stringscanner/element_reference_spec.rb61
-rw-r--r--spec/ruby/library/stringscanner/empty_spec.rb20
-rw-r--r--spec/ruby/library/stringscanner/eos_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/exist_spec.rb24
-rw-r--r--spec/ruby/library/stringscanner/get_byte_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/getbyte_spec.rb23
-rw-r--r--spec/ruby/library/stringscanner/getch_spec.rb35
-rw-r--r--spec/ruby/library/stringscanner/initialize_spec.rb28
-rw-r--r--spec/ruby/library/stringscanner/inspect_spec.rb20
-rw-r--r--spec/ruby/library/stringscanner/match_spec.rb28
-rw-r--r--spec/ruby/library/stringscanner/matched_size_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/matched_spec.rb41
-rw-r--r--spec/ruby/library/stringscanner/must_C_version_spec.rb8
-rw-r--r--spec/ruby/library/stringscanner/peek_spec.rb8
-rw-r--r--spec/ruby/library/stringscanner/peep_spec.rb20
-rw-r--r--spec/ruby/library/stringscanner/pointer_spec.rb11
-rw-r--r--spec/ruby/library/stringscanner/pos_spec.rb11
-rw-r--r--spec/ruby/library/stringscanner/post_match_spec.rb28
-rw-r--r--spec/ruby/library/stringscanner/pre_match_spec.rb41
-rw-r--r--spec/ruby/library/stringscanner/reset_spec.rb15
-rw-r--r--spec/ruby/library/stringscanner/rest_size_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/rest_spec.rb48
-rw-r--r--spec/ruby/library/stringscanner/restsize_spec.rb20
-rw-r--r--spec/ruby/library/stringscanner/scan_full_spec.rb30
-rw-r--r--spec/ruby/library/stringscanner/scan_spec.rb43
-rw-r--r--spec/ruby/library/stringscanner/scan_until_spec.rb23
-rw-r--r--spec/ruby/library/stringscanner/search_full_spec.rb30
-rw-r--r--spec/ruby/library/stringscanner/shared/bol.rb25
-rw-r--r--spec/ruby/library/stringscanner/shared/concat.rb30
-rw-r--r--spec/ruby/library/stringscanner/shared/eos.rb17
-rw-r--r--spec/ruby/library/stringscanner/shared/extract_range.rb22
-rw-r--r--spec/ruby/library/stringscanner/shared/extract_range_matched.rb22
-rw-r--r--spec/ruby/library/stringscanner/shared/get_byte.rb29
-rw-r--r--spec/ruby/library/stringscanner/shared/matched_size.rb21
-rw-r--r--spec/ruby/library/stringscanner/shared/peek.rb47
-rw-r--r--spec/ruby/library/stringscanner/shared/pos.rb52
-rw-r--r--spec/ruby/library/stringscanner/shared/rest_size.rb18
-rw-r--r--spec/ruby/library/stringscanner/shared/terminate.rb8
-rw-r--r--spec/ruby/library/stringscanner/skip_spec.rb18
-rw-r--r--spec/ruby/library/stringscanner/skip_until_spec.rb18
-rw-r--r--spec/ruby/library/stringscanner/string_spec.rb40
-rw-r--r--spec/ruby/library/stringscanner/terminate_spec.rb7
-rw-r--r--spec/ruby/library/stringscanner/unscan_spec.rb28
-rw-r--r--spec/ruby/library/syslog/alert_spec.rb10
-rw-r--r--spec/ruby/library/syslog/close_spec.rb58
-rw-r--r--spec/ruby/library/syslog/constants_spec.rb41
-rw-r--r--spec/ruby/library/syslog/crit_spec.rb10
-rw-r--r--spec/ruby/library/syslog/debug_spec.rb10
-rw-r--r--spec/ruby/library/syslog/emerg_spec.rb16
-rw-r--r--spec/ruby/library/syslog/err_spec.rb10
-rw-r--r--spec/ruby/library/syslog/facility_spec.rb48
-rw-r--r--spec/ruby/library/syslog/ident_spec.rb35
-rw-r--r--spec/ruby/library/syslog/info_spec.rb10
-rw-r--r--spec/ruby/library/syslog/inspect_spec.rb39
-rw-r--r--spec/ruby/library/syslog/instance_spec.rb13
-rw-r--r--spec/ruby/library/syslog/log_spec.rb56
-rw-r--r--spec/ruby/library/syslog/mask_spec.rb113
-rw-r--r--spec/ruby/library/syslog/notice_spec.rb10
-rw-r--r--spec/ruby/library/syslog/open_spec.rb92
-rw-r--r--spec/ruby/library/syslog/opened_spec.rb39
-rw-r--r--spec/ruby/library/syslog/options_spec.rb48
-rw-r--r--spec/ruby/library/syslog/reopen_spec.rb10
-rw-r--r--spec/ruby/library/syslog/shared/log.rb40
-rw-r--r--spec/ruby/library/syslog/shared/reopen.rb40
-rw-r--r--spec/ruby/library/syslog/warning_spec.rb10
-rw-r--r--spec/ruby/library/tempfile/_close_spec.rb21
-rw-r--r--spec/ruby/library/tempfile/callback_spec.rb6
-rw-r--r--spec/ruby/library/tempfile/close_spec.rb57
-rw-r--r--spec/ruby/library/tempfile/delete_spec.rb7
-rw-r--r--spec/ruby/library/tempfile/initialize_spec.rb41
-rw-r--r--spec/ruby/library/tempfile/length_spec.rb7
-rw-r--r--spec/ruby/library/tempfile/open_spec.rb82
-rw-r--r--spec/ruby/library/tempfile/path_spec.rb26
-rw-r--r--spec/ruby/library/tempfile/shared/length.rb21
-rw-r--r--spec/ruby/library/tempfile/shared/unlink.rb12
-rw-r--r--spec/ruby/library/tempfile/size_spec.rb7
-rw-r--r--spec/ruby/library/tempfile/unlink_spec.rb7
-rw-r--r--spec/ruby/library/thread/exclusive_spec.rb12
-rw-r--r--spec/ruby/library/thread/queue/append_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/clear_spec.rb9
-rw-r--r--spec/ruby/library/thread/queue/close_spec.rb9
-rw-r--r--spec/ruby/library/thread/queue/closed_spec.rb9
-rw-r--r--spec/ruby/library/thread/queue/deq_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/empty_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/enq_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/length_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/num_waiting_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/pop_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/push_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/shift_spec.rb7
-rw-r--r--spec/ruby/library/thread/queue/size_spec.rb7
-rw-r--r--spec/ruby/library/thread/shared/queue/clear.rb10
-rw-r--r--spec/ruby/library/thread/shared/queue/close.rb26
-rw-r--r--spec/ruby/library/thread/shared/queue/closed.rb12
-rw-r--r--spec/ruby/library/thread/shared/queue/deque.rb37
-rw-r--r--spec/ruby/library/thread/shared/queue/empty.rb12
-rw-r--r--spec/ruby/library/thread/shared/queue/enque.rb10
-rw-r--r--spec/ruby/library/thread/shared/queue/length.rb9
-rw-r--r--spec/ruby/library/thread/shared/queue/num_waiting.rb16
-rw-r--r--spec/ruby/library/thread/sizedqueue/append_spec.rb12
-rw-r--r--spec/ruby/library/thread/sizedqueue/clear_spec.rb9
-rw-r--r--spec/ruby/library/thread/sizedqueue/close_spec.rb9
-rw-r--r--spec/ruby/library/thread/sizedqueue/closed_spec.rb9
-rw-r--r--spec/ruby/library/thread/sizedqueue/deq_spec.rb7
-rw-r--r--spec/ruby/library/thread/sizedqueue/empty_spec.rb7
-rw-r--r--spec/ruby/library/thread/sizedqueue/enq_spec.rb12
-rw-r--r--spec/ruby/library/thread/sizedqueue/length_spec.rb7
-rw-r--r--spec/ruby/library/thread/sizedqueue/max_spec.rb52
-rw-r--r--spec/ruby/library/thread/sizedqueue/new_spec.rb25
-rw-r--r--spec/ruby/library/thread/sizedqueue/num_waiting_spec.rb18
-rw-r--r--spec/ruby/library/thread/sizedqueue/pop_spec.rb7
-rw-r--r--spec/ruby/library/thread/sizedqueue/push_spec.rb12
-rw-r--r--spec/ruby/library/thread/sizedqueue/shared/enque.rb34
-rw-r--r--spec/ruby/library/thread/sizedqueue/shift_spec.rb7
-rw-r--r--spec/ruby/library/thread/sizedqueue/size_spec.rb7
-rw-r--r--spec/ruby/library/time/httpdate_spec.rb21
-rw-r--r--spec/ruby/library/time/iso8601_spec.rb7
-rw-r--r--spec/ruby/library/time/rfc2822_spec.rb7
-rw-r--r--spec/ruby/library/time/rfc822_spec.rb7
-rw-r--r--spec/ruby/library/time/shared/rfc2822.rb65
-rw-r--r--spec/ruby/library/time/shared/xmlschema.rb53
-rw-r--r--spec/ruby/library/time/to_date_spec.rb42
-rw-r--r--spec/ruby/library/time/to_datetime_spec.rb27
-rw-r--r--spec/ruby/library/time/to_time_spec.rb17
-rw-r--r--spec/ruby/library/time/xmlschema_spec.rb7
-rw-r--r--spec/ruby/library/timeout/error_spec.rb8
-rw-r--r--spec/ruby/library/timeout/timeout_spec.rb37
-rw-r--r--spec/ruby/library/tmpdir/dir/mktmpdir_spec.rb117
-rw-r--r--spec/ruby/library/tmpdir/dir/tmpdir_spec.rb10
-rw-r--r--spec/ruby/library/uri/decode_www_form_component_spec.rb6
-rw-r--r--spec/ruby/library/uri/decode_www_form_spec.rb6
-rw-r--r--spec/ruby/library/uri/encode_www_form_component_spec.rb6
-rw-r--r--spec/ruby/library/uri/encode_www_form_spec.rb6
-rw-r--r--spec/ruby/library/uri/eql_spec.rb10
-rw-r--r--spec/ruby/library/uri/equality_spec.rb46
-rw-r--r--spec/ruby/library/uri/escape/decode_spec.rb6
-rw-r--r--spec/ruby/library/uri/escape/encode_spec.rb6
-rw-r--r--spec/ruby/library/uri/escape/escape_spec.rb6
-rw-r--r--spec/ruby/library/uri/escape/unescape_spec.rb6
-rw-r--r--spec/ruby/library/uri/extract_spec.rb86
-rw-r--r--spec/ruby/library/uri/fixtures/classes.rb11
-rw-r--r--spec/ruby/library/uri/fixtures/normalization.rb54
-rw-r--r--spec/ruby/library/uri/ftp/build_spec.rb6
-rw-r--r--spec/ruby/library/uri/ftp/merge_spec.rb6
-rw-r--r--spec/ruby/library/uri/ftp/new2_spec.rb6
-rw-r--r--spec/ruby/library/uri/ftp/path_spec.rb26
-rw-r--r--spec/ruby/library/uri/ftp/set_typecode_spec.rb6
-rw-r--r--spec/ruby/library/uri/ftp/to_s_spec.rb15
-rw-r--r--spec/ruby/library/uri/ftp/typecode_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/absolute_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/build2_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/build_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/coerce_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/component_ary_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/component_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/default_port_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/eql_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/equal_value_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/fragment_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/hash_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/hierarchical_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/host_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/inspect_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/merge_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/minus_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/normalize_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/opaque_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/password_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/path_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/plus_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/port_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/query_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/registry_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/relative_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/route_from_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/route_to_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/scheme_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/select_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_fragment_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_host_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_opaque_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_password_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_path_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_port_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_query_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_registry_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_scheme_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_user_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/set_userinfo_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/to_s_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/use_registry_spec.rb6
-rw-r--r--spec/ruby/library/uri/generic/user_spec.rb10
-rw-r--r--spec/ruby/library/uri/generic/userinfo_spec.rb10
-rw-r--r--spec/ruby/library/uri/http/build_spec.rb6
-rw-r--r--spec/ruby/library/uri/http/request_uri_spec.rb16
-rw-r--r--spec/ruby/library/uri/join_spec.rb59
-rw-r--r--spec/ruby/library/uri/ldap/attributes_spec.rb10
-rw-r--r--spec/ruby/library/uri/ldap/build_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/dn_spec.rb10
-rw-r--r--spec/ruby/library/uri/ldap/extensions_spec.rb10
-rw-r--r--spec/ruby/library/uri/ldap/filter_spec.rb10
-rw-r--r--spec/ruby/library/uri/ldap/hierarchical_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/scope_spec.rb10
-rw-r--r--spec/ruby/library/uri/ldap/set_attributes_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/set_dn_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/set_extensions_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/set_filter_spec.rb6
-rw-r--r--spec/ruby/library/uri/ldap/set_scope_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/build_spec.rb98
-rw-r--r--spec/ruby/library/uri/mailto/headers_spec.rb10
-rw-r--r--spec/ruby/library/uri/mailto/set_headers_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/set_to_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/to_mailtext_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/to_rfc822text_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/to_s_spec.rb6
-rw-r--r--spec/ruby/library/uri/mailto/to_spec.rb10
-rw-r--r--spec/ruby/library/uri/merge_spec.rb20
-rw-r--r--spec/ruby/library/uri/normalize_spec.rb35
-rw-r--r--spec/ruby/library/uri/parse_spec.rb203
-rw-r--r--spec/ruby/library/uri/parser/escape_spec.rb6
-rw-r--r--spec/ruby/library/uri/parser/extract_spec.rb7
-rw-r--r--spec/ruby/library/uri/parser/inspect_spec.rb6
-rw-r--r--spec/ruby/library/uri/parser/join_spec.rb7
-rw-r--r--spec/ruby/library/uri/parser/make_regexp_spec.rb6
-rw-r--r--spec/ruby/library/uri/parser/parse_spec.rb7
-rw-r--r--spec/ruby/library/uri/parser/split_spec.rb6
-rw-r--r--spec/ruby/library/uri/parser/unescape_spec.rb6
-rw-r--r--spec/ruby/library/uri/plus_spec.rb459
-rw-r--r--spec/ruby/library/uri/regexp_spec.rb18
-rw-r--r--spec/ruby/library/uri/route_from_spec.rb23
-rw-r--r--spec/ruby/library/uri/route_to_spec.rb26
-rw-r--r--spec/ruby/library/uri/select_spec.rb31
-rw-r--r--spec/ruby/library/uri/set_component_spec.rb47
-rw-r--r--spec/ruby/library/uri/shared/eql.rb17
-rw-r--r--spec/ruby/library/uri/shared/extract.rb83
-rw-r--r--spec/ruby/library/uri/shared/join.rb56
-rw-r--r--spec/ruby/library/uri/shared/parse.rb199
-rw-r--r--spec/ruby/library/uri/split_spec.rb6
-rw-r--r--spec/ruby/library/uri/uri_spec.rb29
-rw-r--r--spec/ruby/library/uri/util/make_components_hash_spec.rb6
-rw-r--r--spec/ruby/library/weakref/__getobj___spec.rb17
-rw-r--r--spec/ruby/library/weakref/fixtures/classes.rb24
-rw-r--r--spec/ruby/library/weakref/send_spec.rb37
-rw-r--r--spec/ruby/library/weakref/weakref_alive_spec.rb15
-rw-r--r--spec/ruby/library/win32ole/fixtures/classes.rb14
-rw-r--r--spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole/_invoke_spec.rb23
-rw-r--r--spec/ruby/library/win32ole/win32ole/codepage_spec.rb15
-rw-r--r--spec/ruby/library/win32ole/win32ole/connect_spec.rb17
-rw-r--r--spec/ruby/library/win32ole/win32ole/const_load_spec.rb34
-rw-r--r--spec/ruby/library/win32ole/win32ole/constants_spec.rb44
-rw-r--r--spec/ruby/library/win32ole/win32ole/create_guid_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole/invoke_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole/locale_spec.rb31
-rw-r--r--spec/ruby/library/win32ole/win32ole/new_spec.rb27
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb27
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb12
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_method_spec.rb12
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_methods_spec.rb27
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_obj_help_spec.rb23
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_put_methods_spec.rb27
-rw-r--r--spec/ruby/library/win32ole/win32ole/setproperty_spec.rb12
-rw-r--r--spec/ruby/library/win32ole/win32ole/shared/ole_method.rb25
-rw-r--r--spec/ruby/library/win32ole/win32ole/shared/setproperty.rb25
-rw-r--r--spec/ruby/library/win32ole/win32ole_event/new_spec.rb33
-rw-r--r--spec/ruby/library/win32ole/win32ole_event/on_event_spec.rb62
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/dispid_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb26
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/event_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb26
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/helpfile_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/helpstring_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/invkind_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/invoke_kind_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/name_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/new_spec.rb33
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/offset_vtbl_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/params_spec.rb28
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/return_type_detail_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/return_type_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/return_vtype_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/shared/name.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/size_opt_params_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/size_params_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/to_s_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/visible_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/default_spec.rb31
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/input_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/name_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/ole_type_detail_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/ole_type_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/optional_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/retval_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/shared/name.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole_param/to_s_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/guid_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/helpcontext_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/helpfile_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/helpstring_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/major_version_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/minor_version_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/name_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/new_spec.rb37
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/ole_classes_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/ole_methods_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/ole_type_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/progid_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/progids_spec.rb14
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/shared/name.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/src_type_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/to_s_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/typekind_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/typelibs_spec.rb22
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/variables_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_type/visible_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/name_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/ole_type_detail_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/ole_type_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/shared/name.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/to_s_spec.rb11
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/value_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/variable_kind_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/varkind_spec.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole_variable/visible_spec.rb18
-rw-r--r--spec/ruby/library/yaml/add_builtin_type_spec.rb2
-rw-r--r--spec/ruby/library/yaml/add_domain_type_spec.rb2
-rw-r--r--spec/ruby/library/yaml/add_private_type_spec.rb2
-rw-r--r--spec/ruby/library/yaml/add_ruby_type_spec.rb2
-rw-r--r--spec/ruby/library/yaml/detect_implicit_spec.rb2
-rw-r--r--spec/ruby/library/yaml/dump_spec.rb51
-rw-r--r--spec/ruby/library/yaml/dump_stream_spec.rb8
-rw-r--r--spec/ruby/library/yaml/each_node_spec.rb2
-rw-r--r--spec/ruby/library/yaml/emitter_spec.rb2
-rw-r--r--spec/ruby/library/yaml/fixtures/common.rb10
-rw-r--r--spec/ruby/library/yaml/fixtures/example_class.rb5
-rw-r--r--spec/ruby/library/yaml/fixtures/strings.rb36
-rw-r--r--spec/ruby/library/yaml/fixtures/test_yaml.yml2
-rw-r--r--spec/ruby/library/yaml/generic_parser_spec.rb2
-rw-r--r--spec/ruby/library/yaml/load_documents_spec.rb10
-rw-r--r--spec/ruby/library/yaml/load_file_spec.rb13
-rw-r--r--spec/ruby/library/yaml/load_spec.rb137
-rw-r--r--spec/ruby/library/yaml/load_stream_spec.rb8
-rw-r--r--spec/ruby/library/yaml/object_maker_spec.rb2
-rw-r--r--spec/ruby/library/yaml/parse_documents_spec.rb2
-rw-r--r--spec/ruby/library/yaml/parse_file_spec.rb10
-rw-r--r--spec/ruby/library/yaml/parse_spec.rb22
-rw-r--r--spec/ruby/library/yaml/parser_spec.rb2
-rw-r--r--spec/ruby/library/yaml/quick_emit_spec.rb2
-rw-r--r--spec/ruby/library/yaml/read_type_class_spec.rb2
-rw-r--r--spec/ruby/library/yaml/shared/each_document.rb18
-rw-r--r--spec/ruby/library/yaml/tagurize_spec.rb11
-rw-r--r--spec/ruby/library/yaml/to_yaml_spec.rb99
-rw-r--r--spec/ruby/library/yaml/transfer_spec.rb2
-rw-r--r--spec/ruby/library/yaml/try_implicit_spec.rb2
-rw-r--r--spec/ruby/library/zlib/adler32_spec.rb46
-rw-r--r--spec/ruby/library/zlib/crc32_spec.rb52
-rw-r--r--spec/ruby/library/zlib/crc_table_spec.rb75
-rw-r--r--spec/ruby/library/zlib/deflate/append_spec.rb1
-rw-r--r--spec/ruby/library/zlib/deflate/deflate_spec.rb128
-rw-r--r--spec/ruby/library/zlib/deflate/flush_spec.rb1
-rw-r--r--spec/ruby/library/zlib/deflate/new_spec.rb1
-rw-r--r--spec/ruby/library/zlib/deflate/params_spec.rb17
-rw-r--r--spec/ruby/library/zlib/deflate/set_dictionary_spec.rb15
-rw-r--r--spec/ruby/library/zlib/gzipfile/close_spec.rb22
-rw-r--r--spec/ruby/library/zlib/gzipfile/closed_spec.rb17
-rw-r--r--spec/ruby/library/zlib/gzipfile/comment_spec.rb27
-rw-r--r--spec/ruby/library/zlib/gzipfile/crc_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/finish_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/level_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/mtime_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/orig_name_spec.rb27
-rw-r--r--spec/ruby/library/zlib/gzipfile/os_code_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/sync_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/to_io_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipfile/wrap_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/each_byte_spec.rb51
-rw-r--r--spec/ruby/library/zlib/gzipreader/each_line_spec.rb5
-rw-r--r--spec/ruby/library/zlib/gzipreader/each_spec.rb5
-rw-r--r--spec/ruby/library/zlib/gzipreader/eof_spec.rb56
-rw-r--r--spec/ruby/library/zlib/gzipreader/getc_spec.rb41
-rw-r--r--spec/ruby/library/zlib/gzipreader/gets_spec.rb22
-rw-r--r--spec/ruby/library/zlib/gzipreader/lineno_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/new_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/open_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/pos_spec.rb27
-rw-r--r--spec/ruby/library/zlib/gzipreader/read_spec.rb68
-rw-r--r--spec/ruby/library/zlib/gzipreader/readchar_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/readline_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/readlines_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/readpartial_spec.rb17
-rw-r--r--spec/ruby/library/zlib/gzipreader/rewind_spec.rb48
-rw-r--r--spec/ruby/library/zlib/gzipreader/shared/each.rb51
-rw-r--r--spec/ruby/library/zlib/gzipreader/tell_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/ungetbyte_spec.rb122
-rw-r--r--spec/ruby/library/zlib/gzipreader/ungetc_spec.rb292
-rw-r--r--spec/ruby/library/zlib/gzipreader/unused_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/append_spec.rb17
-rw-r--r--spec/ruby/library/zlib/gzipwriter/comment_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/flush_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/mtime_spec.rb38
-rw-r--r--spec/ruby/library/zlib/gzipwriter/new_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/open_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/orig_name_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/pos_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/print_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/printf_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/putc_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/puts_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/tell_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipwriter/write_spec.rb36
-rw-r--r--spec/ruby/library/zlib/inflate/append_spec.rb60
-rw-r--r--spec/ruby/library/zlib/inflate/finish_spec.rb28
-rw-r--r--spec/ruby/library/zlib/inflate/inflate_spec.rb152
-rw-r--r--spec/ruby/library/zlib/inflate/new_spec.rb1
-rw-r--r--spec/ruby/library/zlib/inflate/set_dictionary_spec.rb21
-rw-r--r--spec/ruby/library/zlib/inflate/sync_point_spec.rb1
-rw-r--r--spec/ruby/library/zlib/inflate/sync_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zlib_version_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/adler_spec.rb11
-rw-r--r--spec/ruby/library/zlib/zstream/avail_in_spec.rb9
-rw-r--r--spec/ruby/library/zlib/zstream/avail_out_spec.rb9
-rw-r--r--spec/ruby/library/zlib/zstream/close_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/closed_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/data_type_spec.rb9
-rw-r--r--spec/ruby/library/zlib/zstream/end_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/ended_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/finish_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/finished_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/flush_next_in_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/flush_next_out_spec.rb16
-rw-r--r--spec/ruby/library/zlib/zstream/reset_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/stream_end_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/total_in_spec.rb1
-rw-r--r--spec/ruby/library/zlib/zstream/total_out_spec.rb1
-rw-r--r--spec/ruby/optional/capi/README16
-rw-r--r--spec/ruby/optional/capi/array_spec.rb463
-rw-r--r--spec/ruby/optional/capi/bignum_spec.rb214
-rw-r--r--spec/ruby/optional/capi/boolean_spec.rb33
-rw-r--r--spec/ruby/optional/capi/class_spec.rb386
-rw-r--r--spec/ruby/optional/capi/complex_spec.rb45
-rw-r--r--spec/ruby/optional/capi/constants_spec.rb270
-rw-r--r--spec/ruby/optional/capi/data_spec.rb46
-rw-r--r--spec/ruby/optional/capi/encoding_spec.rb485
-rw-r--r--spec/ruby/optional/capi/enumerator_spec.rb39
-rw-r--r--spec/ruby/optional/capi/exception_spec.rb58
-rw-r--r--spec/ruby/optional/capi/ext/.gitignore9
-rw-r--r--spec/ruby/optional/capi/ext/array_spec.c452
-rw-r--r--spec/ruby/optional/capi/ext/bignum_spec.c149
-rw-r--r--spec/ruby/optional/capi/ext/boolean_spec.c34
-rw-r--r--spec/ruby/optional/capi/ext/class_id_under_autoload_spec.c5
-rw-r--r--spec/ruby/optional/capi/ext/class_spec.c261
-rw-r--r--spec/ruby/optional/capi/ext/class_under_autoload_spec.c5
-rw-r--r--spec/ruby/optional/capi/ext/complex_spec.c76
-rw-r--r--spec/ruby/optional/capi/ext/constants_spec.c646
-rw-r--r--spec/ruby/optional/capi/ext/data_spec.c97
-rw-r--r--spec/ruby/optional/capi/ext/encoding_spec.c424
-rw-r--r--spec/ruby/optional/capi/ext/enumerator_spec.c27
-rw-r--r--spec/ruby/optional/capi/ext/exception_spec.c72
-rw-r--r--spec/ruby/optional/capi/ext/file_spec.c44
-rw-r--r--spec/ruby/optional/capi/ext/fixnum_spec.c52
-rw-r--r--spec/ruby/optional/capi/ext/float_spec.c54
-rw-r--r--spec/ruby/optional/capi/ext/gc_spec.c72
-rw-r--r--spec/ruby/optional/capi/ext/globals_spec.c199
-rw-r--r--spec/ruby/optional/capi/ext/hash_spec.c218
-rw-r--r--spec/ruby/optional/capi/ext/integer_spec.c40
-rw-r--r--spec/ruby/optional/capi/ext/io_spec.c303
-rw-r--r--spec/ruby/optional/capi/ext/kernel_spec.c450
-rw-r--r--spec/ruby/optional/capi/ext/marshal_spec.c36
-rw-r--r--spec/ruby/optional/capi/ext/module_spec.c262
-rw-r--r--spec/ruby/optional/capi/ext/module_under_autoload_spec.c7
-rw-r--r--spec/ruby/optional/capi/ext/mutex_spec.c91
-rw-r--r--spec/ruby/optional/capi/ext/numeric_spec.c176
-rw-r--r--spec/ruby/optional/capi/ext/object_spec.c646
-rw-r--r--spec/ruby/optional/capi/ext/proc_spec.c85
-rw-r--r--spec/ruby/optional/capi/ext/range_spec.c66
-rw-r--r--spec/ruby/optional/capi/ext/rational_spec.c95
-rw-r--r--spec/ruby/optional/capi/ext/regexp_spec.c84
-rw-r--r--spec/ruby/optional/capi/ext/rubyspec.h613
-rw-r--r--spec/ruby/optional/capi/ext/st_spec.c93
-rw-r--r--spec/ruby/optional/capi/ext/string_spec.c698
-rw-r--r--spec/ruby/optional/capi/ext/struct_spec.c131
-rw-r--r--spec/ruby/optional/capi/ext/symbol_spec.c138
-rw-r--r--spec/ruby/optional/capi/ext/thread_spec.c188
-rw-r--r--spec/ruby/optional/capi/ext/time_spec.c127
-rw-r--r--spec/ruby/optional/capi/ext/typed_data_spec.c177
-rw-r--r--spec/ruby/optional/capi/ext/util_spec.c95
-rw-r--r--spec/ruby/optional/capi/file_spec.rb89
-rw-r--r--spec/ruby/optional/capi/fixnum_spec.rb124
-rw-r--r--spec/ruby/optional/capi/fixtures/class.rb82
-rw-r--r--spec/ruby/optional/capi/fixtures/const_get.rb5
-rw-r--r--spec/ruby/optional/capi/fixtures/const_get_at.rb5
-rw-r--r--spec/ruby/optional/capi/fixtures/const_get_from.rb5
-rw-r--r--spec/ruby/optional/capi/fixtures/const_get_object.rb3
-rw-r--r--spec/ruby/optional/capi/fixtures/encoding.rb3
-rw-r--r--spec/ruby/optional/capi/fixtures/foo.rb1
-rw-r--r--spec/ruby/optional/capi/fixtures/module.rb35
-rw-r--r--spec/ruby/optional/capi/fixtures/module_autoload.rb4
-rw-r--r--spec/ruby/optional/capi/fixtures/path_to_class.rb6
-rw-r--r--spec/ruby/optional/capi/fixtures/proc.rb20
-rw-r--r--spec/ruby/optional/capi/float_spec.rb30
-rw-r--r--spec/ruby/optional/capi/gc_spec.rb54
-rw-r--r--spec/ruby/optional/capi/globals_spec.rb224
-rw-r--r--spec/ruby/optional/capi/hash_spec.rb245
-rw-r--r--spec/ruby/optional/capi/integer_spec.rb275
-rw-r--r--spec/ruby/optional/capi/io_spec.rb344
-rw-r--r--spec/ruby/optional/capi/kernel_spec.rb532
-rw-r--r--spec/ruby/optional/capi/marshal_spec.rb46
-rw-r--r--spec/ruby/optional/capi/module_spec.rb349
-rw-r--r--spec/ruby/optional/capi/mutex_spec.rb88
-rw-r--r--spec/ruby/optional/capi/numeric_spec.rb447
-rw-r--r--spec/ruby/optional/capi/object_spec.rb835
-rw-r--r--spec/ruby/optional/capi/proc_spec.rb112
-rw-r--r--spec/ruby/optional/capi/rake_helper.rb23
-rw-r--r--spec/ruby/optional/capi/range_spec.rb95
-rw-r--r--spec/ruby/optional/capi/rational_spec.rb57
-rw-r--r--spec/ruby/optional/capi/regexp_spec.rb71
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb116
-rw-r--r--spec/ruby/optional/capi/st_spec.rb41
-rw-r--r--spec/ruby/optional/capi/string_spec.rb812
-rw-r--r--spec/ruby/optional/capi/struct_spec.rb209
-rw-r--r--spec/ruby/optional/capi/symbol_spec.rb133
-rw-r--r--spec/ruby/optional/capi/thread_spec.rb127
-rw-r--r--spec/ruby/optional/capi/time_spec.rb302
-rw-r--r--spec/ruby/optional/capi/typed_data_spec.rb56
-rw-r--r--spec/ruby/optional/capi/util_spec.rb201
-rw-r--r--spec/ruby/security/cve_2011_4815_spec.rb41
-rw-r--r--spec/ruby/security/cve_2013_4164_spec.rb19
-rw-r--r--spec/ruby/security/cve_2014_8080_spec.rb32
-rw-r--r--spec/ruby/shared/basicobject/method_missing.rb126
-rw-r--r--spec/ruby/shared/basicobject/send.rb110
-rw-r--r--spec/ruby/shared/complex/Complex.rb133
-rw-r--r--spec/ruby/shared/complex/abs.rb12
-rw-r--r--spec/ruby/shared/complex/abs2.rb12
-rw-r--r--spec/ruby/shared/complex/arg.rb9
-rw-r--r--spec/ruby/shared/complex/coerce.rb70
-rw-r--r--spec/ruby/shared/complex/conjugate.rb8
-rw-r--r--spec/ruby/shared/complex/constants.rb7
-rw-r--r--spec/ruby/shared/complex/denominator.rb13
-rw-r--r--spec/ruby/shared/complex/divide.rb84
-rw-r--r--spec/ruby/shared/complex/equal_value.rb93
-rw-r--r--spec/ruby/shared/complex/exponent.rb61
-rw-r--r--spec/ruby/shared/complex/float/arg.rb38
-rw-r--r--spec/ruby/shared/complex/hash.rb16
-rw-r--r--spec/ruby/shared/complex/image.rb10
-rw-r--r--spec/ruby/shared/complex/inspect.rb14
-rw-r--r--spec/ruby/shared/complex/minus.rb45
-rw-r--r--spec/ruby/shared/complex/multiply.rb49
-rw-r--r--spec/ruby/shared/complex/numerator.rb19
-rw-r--r--spec/ruby/shared/complex/numeric/arg.rb38
-rw-r--r--spec/ruby/shared/complex/numeric/conj.rb20
-rw-r--r--spec/ruby/shared/complex/numeric/imag.rb26
-rw-r--r--spec/ruby/shared/complex/numeric/polar.rb50
-rw-r--r--spec/ruby/shared/complex/numeric/real.rb30
-rw-r--r--spec/ruby/shared/complex/plus.rb45
-rw-r--r--spec/ruby/shared/complex/polar.rb22
-rw-r--r--spec/ruby/shared/complex/real.rb8
-rw-r--r--spec/ruby/shared/complex/rect.rb96
-rw-r--r--spec/ruby/shared/complex/to_s.rb44
-rw-r--r--spec/ruby/shared/enumerator/each.rb89
-rw-r--r--spec/ruby/shared/enumerator/enum_cons.rb12
-rw-r--r--spec/ruby/shared/enumerator/enum_for.rb50
-rw-r--r--spec/ruby/shared/enumerator/new.rb42
-rw-r--r--spec/ruby/shared/enumerator/next.rb28
-rw-r--r--spec/ruby/shared/enumerator/rewind.rb39
-rw-r--r--spec/ruby/shared/enumerator/with_index.rb32
-rw-r--r--spec/ruby/shared/enumerator/with_object.rb42
-rw-r--r--spec/ruby/shared/fiber/resume.rb82
-rw-r--r--spec/ruby/shared/file/blockdev.rb9
-rw-r--r--spec/ruby/shared/file/chardev.rb9
-rw-r--r--spec/ruby/shared/file/directory.rb66
-rw-r--r--spec/ruby/shared/file/executable.rb48
-rw-r--r--spec/ruby/shared/file/executable_real.rb46
-rw-r--r--spec/ruby/shared/file/exist.rb24
-rw-r--r--spec/ruby/shared/file/file.rb45
-rw-r--r--spec/ruby/shared/file/grpowned.rb40
-rw-r--r--spec/ruby/shared/file/identical.rb47
-rw-r--r--spec/ruby/shared/file/owned.rb3
-rw-r--r--spec/ruby/shared/file/pipe.rb3
-rw-r--r--spec/ruby/shared/file/readable.rb30
-rw-r--r--spec/ruby/shared/file/readable_real.rb23
-rw-r--r--spec/ruby/shared/file/setgid.rb2
-rw-r--r--spec/ruby/shared/file/setuid.rb2
-rw-r--r--spec/ruby/shared/file/size.rb124
-rw-r--r--spec/ruby/shared/file/socket.rb3
-rw-r--r--spec/ruby/shared/file/sticky.rb29
-rw-r--r--spec/ruby/shared/file/symlink.rb46
-rw-r--r--spec/ruby/shared/file/world_readable.rb49
-rw-r--r--spec/ruby/shared/file/world_writable.rb49
-rw-r--r--spec/ruby/shared/file/writable.rb26
-rw-r--r--spec/ruby/shared/file/writable_real.rb33
-rw-r--r--spec/ruby/shared/file/zero.rb68
-rw-r--r--spec/ruby/shared/io/putc.rb57
-rw-r--r--spec/ruby/shared/kernel/equal.rb54
-rw-r--r--spec/ruby/shared/kernel/object_id.rb80
-rw-r--r--spec/ruby/shared/kernel/raise.rb68
-rw-r--r--spec/ruby/shared/math/atanh.rb44
-rw-r--r--spec/ruby/shared/process/abort.rb36
-rw-r--r--spec/ruby/shared/process/exit.rb94
-rw-r--r--spec/ruby/shared/process/fork.rb90
-rw-r--r--spec/ruby/shared/rational/Rational.rb103
-rw-r--r--spec/ruby/shared/rational/abs.rb11
-rw-r--r--spec/ruby/shared/rational/ceil.rb45
-rw-r--r--spec/ruby/shared/rational/coerce.rb21
-rw-r--r--spec/ruby/shared/rational/comparison.rb85
-rw-r--r--spec/ruby/shared/rational/denominator.rb14
-rw-r--r--spec/ruby/shared/rational/div.rb54
-rw-r--r--spec/ruby/shared/rational/divide.rb71
-rw-r--r--spec/ruby/shared/rational/divmod.rb42
-rw-r--r--spec/ruby/shared/rational/equal_value.rb39
-rw-r--r--spec/ruby/shared/rational/exponent.rb176
-rw-r--r--spec/ruby/shared/rational/fdiv.rb5
-rw-r--r--spec/ruby/shared/rational/floor.rb45
-rw-r--r--spec/ruby/shared/rational/hash.rb9
-rw-r--r--spec/ruby/shared/rational/inspect.rb12
-rw-r--r--spec/ruby/shared/rational/marshal_dump.rb5
-rw-r--r--spec/ruby/shared/rational/marshal_load.rb5
-rw-r--r--spec/ruby/shared/rational/minus.rb48
-rw-r--r--spec/ruby/shared/rational/modulo.rb43
-rw-r--r--spec/ruby/shared/rational/multiply.rb62
-rw-r--r--spec/ruby/shared/rational/numerator.rb10
-rw-r--r--spec/ruby/shared/rational/plus.rb48
-rw-r--r--spec/ruby/shared/rational/quo.rb5
-rw-r--r--spec/ruby/shared/rational/remainder.rb5
-rw-r--r--spec/ruby/shared/rational/round.rb96
-rw-r--r--spec/ruby/shared/rational/to_f.rb10
-rw-r--r--spec/ruby/shared/rational/to_i.rb12
-rw-r--r--spec/ruby/shared/rational/to_r.rb13
-rw-r--r--spec/ruby/shared/rational/to_s.rb11
-rw-r--r--spec/ruby/shared/rational/truncate.rb45
-rw-r--r--spec/ruby/shared/string/times.rb64
-rw-r--r--spec/ruby/shared/time/strftime_for_date.rb275
-rw-r--r--spec/ruby/shared/time/strftime_for_time.rb173
-rw-r--r--spec/ruby/spec_helper.rb32
-rw-r--r--sprintf.c366
-rw-r--r--st.c2870
-rw-r--r--strftime.c284
-rw-r--r--string.c4503
-rw-r--r--struct.c622
-rw-r--r--symbol.c803
-rw-r--r--symbol.h84
-rw-r--r--template/Doxyfile.tmpl74
-rw-r--r--template/GNUmakefile.in1
-rw-r--r--template/configure-ext.mk.tmpl44
-rw-r--r--template/encdb.h.tmpl3
-rw-r--r--template/extinit.c.tmpl17
-rw-r--r--template/exts.mk.tmpl148
-rw-r--r--template/fake.rb.in50
-rw-r--r--template/id.c.tmpl16
-rw-r--r--template/id.h.tmpl73
-rw-r--r--template/insns.inc.tmpl10
-rw-r--r--template/insns_info.inc.tmpl82
-rw-r--r--template/known_errors.inc.tmpl2
-rw-r--r--template/limits.c.tmpl97
-rw-r--r--template/minsns.inc.tmpl8
-rw-r--r--template/opt_sc.inc.tmpl3
-rw-r--r--template/optinsn.inc.tmpl68
-rw-r--r--template/optunifs.inc.tmpl38
-rw-r--r--template/prelude.c.tmpl238
-rw-r--r--template/ruby-runner.h.in7
-rw-r--r--template/ruby.pc.in4
-rw-r--r--template/sizes.c.tmpl28
-rw-r--r--template/unicode_norm_gen.tmpl220
-rw-r--r--template/verconf.h.tmpl16
-rw-r--r--template/vm.inc.tmpl16
-rw-r--r--template/vmtc.inc.tmpl5
-rw-r--r--test/-ext-/array/test_resize.rb1
-rw-r--r--test/-ext-/bignum/test_big2str.rb5
-rw-r--r--test/-ext-/bignum/test_bigzero.rb7
-rw-r--r--test/-ext-/bignum/test_div.rb5
-rw-r--r--test/-ext-/bignum/test_mul.rb13
-rw-r--r--test/-ext-/bignum/test_pack.rb1
-rw-r--r--test/-ext-/bignum/test_str2big.rb5
-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.rb17
-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-/exception/test_exception_at_throwing.rb18
-rw-r--r--test/-ext-/file/test_stat.rb1
-rw-r--r--test/-ext-/float/test_nextafter.rb14
-rw-r--r--test/-ext-/funcall/test_funcall.rb11
-rw-r--r--test/-ext-/funcall/test_passing_block.rb3
-rw-r--r--test/-ext-/gvl/test_last_thread.rb23
-rw-r--r--test/-ext-/hash/test_delete.rb20
-rw-r--r--test/-ext-/integer/test_integer.rb26
-rw-r--r--test/-ext-/integer/test_my_integer.rb48
-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.rb13
-rw-r--r--test/-ext-/load/script.rb2
-rw-r--r--test/-ext-/load/test_dot_dot.rb3
-rw-r--r--test/-ext-/load/test_protect.rb14
-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.rb3
-rw-r--r--test/-ext-/num2int/test_num2int.rb46
-rw-r--r--test/-ext-/path_to_class/test_path_to_class.rb3
-rw-r--r--test/-ext-/popen_deadlock/test_popen_deadlock.rb36
-rw-r--r--test/-ext-/postponed_job/test_postponed_job.rb2
-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_capacity.rb40
-rw-r--r--test/-ext-/string/test_coderange.rb3
-rw-r--r--test/-ext-/string/test_cstr.rb130
-rw-r--r--test/-ext-/string/test_ellipsize.rb3
-rw-r--r--test/-ext-/string/test_enc_associate.rb18
-rw-r--r--test/-ext-/string/test_enc_str_buf_cat.rb3
-rw-r--r--test/-ext-/string/test_external_new.rb17
-rw-r--r--test/-ext-/string/test_fstring.rb74
-rw-r--r--test/-ext-/string/test_modify_expand.rb18
-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_rb_str_dup.rb16
-rw-r--r--test/-ext-/string/test_set_len.rb12
-rw-r--r--test/-ext-/struct/test_duplicate.rb22
-rw-r--r--test/-ext-/struct/test_len.rb10
-rw-r--r--test/-ext-/struct/test_member.rb6
-rw-r--r--test/-ext-/symbol/noninterned_name.rb15
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb264
-rw-r--r--test/-ext-/symbol/test_type.rb15
-rw-r--r--test/-ext-/test_bug-3571.rb4
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb3
-rw-r--r--test/-ext-/test_notimplement.rb15
-rw-r--r--test/-ext-/test_printf.rb9
-rw-r--r--test/-ext-/test_recursion.rb2
-rw-r--r--test/-ext-/test_scan_args.rb231
-rw-r--r--test/-ext-/thread_fd_close/test_thread_fd_close.rb25
-rw-r--r--test/-ext-/time/test_new.rb44
-rw-r--r--test/-ext-/tracepoint/test_tracepoint.rb2
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb17
-rw-r--r--test/-ext-/vm/test_at_exit.rb19
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb10
-rw-r--r--test/-ext-/win32/test_console_attr.rb1
-rw-r--r--test/-ext-/win32/test_dln.rb16
-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.rb1
-rw-r--r--test/bigdecimal/test_bigdecimal.rb764
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb12
-rw-r--r--test/bigdecimal/test_bigmath.rb2
-rw-r--r--test/bigdecimal/testbase.rb1
-rw-r--r--test/cgi/test_cgi_cookie.rb31
-rw-r--r--test/cgi/test_cgi_core.rb81
-rw-r--r--test/cgi/test_cgi_header.rb23
-rw-r--r--test/cgi/test_cgi_modruby.rb11
-rw-r--r--test/cgi/test_cgi_multipart.rb29
-rw-r--r--test/cgi/test_cgi_session.rb55
-rw-r--r--test/cgi/test_cgi_tag_helper.rb16
-rw-r--r--test/cgi/test_cgi_util.rb140
-rw-r--r--test/cgi/update_env.rb9
-rw-r--r--test/colors3
-rw-r--r--test/coverage/test_coverage.rb483
-rw-r--r--test/csv/base.rb1
-rwxr-xr-xtest/csv/test_csv_parsing.rb23
-rwxr-xr-xtest/csv/test_csv_writing.rb1
-rwxr-xr-xtest/csv/test_data_converters.rb16
-rwxr-xr-xtest/csv/test_encodings.rb1
-rwxr-xr-xtest/csv/test_features.rb55
-rwxr-xr-xtest/csv/test_headers.rb8
-rwxr-xr-xtest/csv/test_interface.rb25
-rwxr-xr-xtest/csv/test_row.rb29
-rwxr-xr-xtest/csv/test_table.rb63
-rw-r--r--test/csv/ts_all.rb1
-rw-r--r--test/date/test_date.rb5
-rw-r--r--test/date/test_date_arith.rb14
-rw-r--r--test/date/test_date_attr.rb4
-rw-r--r--test/date/test_date_base.rb11
-rw-r--r--test/date/test_date_compat.rb1
-rw-r--r--test/date/test_date_conv.rb26
-rw-r--r--test/date/test_date_marshal.rb5
-rw-r--r--test/date/test_date_new.rb7
-rw-r--r--test/date/test_date_parse.rb1
-rw-r--r--test/date/test_date_strftime.rb9
-rw-r--r--test/date/test_date_strptime.rb1
-rw-r--r--test/date/test_switch_hitter.rb36
-rw-r--r--test/dbm/test_dbm.rb11
-rw-r--r--test/digest/digest/foo.rb11
-rwxr-xr-x[-rw-r--r--]test/digest/test_digest.rb93
-rw-r--r--test/digest/test_digest_extend.rb3
-rw-r--r--test/dl/test_base.rb146
-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.rb226
-rw-r--r--test/dl/test_dl2.rb140
-rw-r--r--test/dl/test_func.rb190
-rw-r--r--test/dl/test_handle.rb191
-rw-r--r--test/dl/test_import.rb165
-rw-r--r--test/dl/test_win32.rb54
-rw-r--r--test/drb/drbtest.rb87
-rw-r--r--test/drb/ignore_test_drb.rb1
-rw-r--r--test/drb/test_acl.rb102
-rw-r--r--test/drb/test_drb.rb100
-rw-r--r--test/drb/test_drbssl.rb1
-rw-r--r--test/drb/test_drbunix.rb1
-rw-r--r--test/drb/ut_array.rb1
-rw-r--r--test/drb/ut_array_drbssl.rb3
-rw-r--r--test/drb/ut_array_drbunix.rb1
-rw-r--r--test/drb/ut_drb.rb3
-rw-r--r--test/drb/ut_drb_drbssl.rb3
-rw-r--r--test/drb/ut_drb_drbunix.rb1
-rw-r--r--test/drb/ut_eq.rb1
-rw-r--r--test/drb/ut_eval.rb36
-rw-r--r--test/drb/ut_large.rb27
-rw-r--r--test/drb/ut_port.rb1
-rw-r--r--test/drb/ut_safe1.rb1
-rw-r--r--test/drb/ut_timerholder.rb103
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb42
-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.rb7
-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.rb252
-rw-r--r--test/erb/test_erb_command.rb18
-rw-r--r--test/erb/test_erb_m17n.rb1
-rw-r--r--test/etc/test_etc.rb26
-rw-r--r--test/excludes/TestException.rb8
-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.rb12
-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.rb7
-rw-r--r--test/fiddle/test_cparser.rb178
-rw-r--r--test/fiddle/test_fiddle.rb1
-rw-r--r--test/fiddle/test_func.rb15
-rw-r--r--test/fiddle/test_function.rb37
-rw-r--r--test/fiddle/test_handle.rb110
-rw-r--r--test/fiddle/test_import.rb9
-rw-r--r--test/fiddle/test_pointer.rb12
-rw-r--r--test/fileutils/clobber.rb1
-rw-r--r--test/fileutils/fileasserts.rb1
-rw-r--r--test/fileutils/test_dryrun.rb1
-rw-r--r--test/fileutils/test_fileutils.rb263
-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.rb27
-rw-r--r--test/inlinetest.rb55
-rw-r--r--test/io/console/test_io_console.rb156
-rw-r--r--test/io/nonblock/test_flush.rb22
-rw-r--r--test/io/wait/test_io_wait.rb67
-rw-r--r--test/irb/test_completion.rb2
-rw-r--r--test/irb/test_init.rb31
-rw-r--r--test/irb/test_option.rb2
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb2
-rw-r--r--test/irb/test_ruby-lex.rb108
-rw-r--r--test/irb/test_workspace.rb94
-rw-r--r--test/json/fixtures/fail1.json1
-rw-r--r--test/json/fixtures/obsolete_fail1.json1
-rw-r--r--test/json/json_addition_test.rb193
-rw-r--r--test/json/json_common_interface_test.rb126
-rw-r--r--test/json/json_encoding_test.rb107
-rw-r--r--test/json/json_ext_parser_test.rb15
-rw-r--r--test/json/json_fixtures_test.rb32
-rw-r--r--test/json/json_generator_test.rb377
-rw-r--r--test/json/json_generic_object_test.rb82
-rw-r--r--test/json/json_parser_test.rb472
-rw-r--r--test/json/json_string_matching_test.rb38
-rw-r--r--test/json/setup_variant.rb11
-rw-r--r--test/json/test_helper.rb21
-rwxr-xr-xtest/json/test_json.rb547
-rwxr-xr-xtest/json/test_json_addition.rb196
-rw-r--r--test/json/test_json_encoding.rb65
-rwxr-xr-xtest/json/test_json_fixtures.rb35
-rwxr-xr-xtest/json/test_json_generate.rb323
-rw-r--r--test/json/test_json_generic_object.rb75
-rw-r--r--test/json/test_json_string_matching.rb39
-rwxr-xr-xtest/json/test_json_unicode.rb72
-rw-r--r--test/lib/-test-/integer.rb14
-rw-r--r--test/lib/envutil.rb298
-rw-r--r--test/lib/find_executable.rb22
-rw-r--r--test/lib/iseq_loader_checker.rb75
-rw-r--r--test/lib/leakchecker.rb84
-rw-r--r--test/lib/memory_status.rb149
-rw-r--r--test/lib/minitest/autorun.rb1
-rw-r--r--test/lib/minitest/benchmark.rb1
-rw-r--r--test/lib/minitest/mock.rb1
-rw-r--r--test/lib/minitest/unit.rb71
-rw-r--r--test/lib/profile_test_all.rb1
-rw-r--r--test/lib/test/unit.rb912
-rw-r--r--test/lib/test/unit/assertions.rb514
-rw-r--r--test/lib/test/unit/parallel.rb30
-rw-r--r--test/lib/test/unit/testcase.rb2
-rw-r--r--test/lib/tracepointchecker.rb20
-rw-r--r--test/lib/with_different_ofs.rb1
-rw-r--r--test/lib/zombie_hunter.rb9
-rw-r--r--test/logger/test_logdevice.rb534
-rw-r--r--test/logger/test_logger.rb100
-rw-r--r--test/logger/test_severity.rb1
-rw-r--r--test/matrix/test_matrix.rb171
-rw-r--r--test/matrix/test_vector.rb77
-rw-r--r--test/minitest/metametameta.rb4
-rw-r--r--test/minitest/test_minitest_benchmark.rb1
-rw-r--r--test/minitest/test_minitest_mock.rb5
-rw-r--r--test/minitest/test_minitest_unit.rb36
-rw-r--r--test/misc/test_ruby_mode.rb17
-rw-r--r--test/mkmf/base.rb20
-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.rb34
-rw-r--r--test/mkmf/test_flags.rb22
-rw-r--r--test/mkmf/test_framework.rb7
-rw-r--r--test/mkmf/test_have_func.rb3
-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.rb191
-rw-r--r--test/net/fixtures/cacert.pem24
-rw-r--r--test/net/fixtures/dhparams.pem29
-rw-r--r--test/net/fixtures/server.crt82
-rw-r--r--test/net/fixtures/server.key28
-rw-r--r--test/net/ftp/test_buffered_socket.rb10
-rw-r--r--test/net/ftp/test_ftp.rb1794
-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.rb334
-rw-r--r--test/net/http/test_http_request.rb21
-rw-r--r--test/net/http/test_httpheader.rb93
-rw-r--r--test/net/http/test_httpresponse.rb185
-rw-r--r--test/net/http/test_httpresponses.rb1
-rw-r--r--test/net/http/test_https.rb113
-rw-r--r--test/net/http/test_https_proxy.rb32
-rw-r--r--test/net/http/utils.rb18
-rw-r--r--test/net/imap/cacert.pem66
-rw-r--r--test/net/imap/server.crt48
-rw-r--r--test/net/imap/server.key15
-rw-r--r--test/net/imap/test_imap.rb693
-rw-r--r--test/net/imap/test_imap_response_parser.rb55
-rw-r--r--test/net/pop/test_pop.rb58
-rw-r--r--test/net/protocol/test_protocol.rb7
-rw-r--r--test/net/smtp/test_response.rb5
-rw-r--r--test/net/smtp/test_smtp.rb152
-rw-r--r--test/net/smtp/test_ssl_socket.rb12
-rw-r--r--test/nkf/test_kconv.rb9
-rw-r--r--test/nkf/test_nkf.rb1
-rw-r--r--test/objspace/test_objspace.rb291
-rw-r--r--test/open-uri/test_open-uri.rb237
-rw-r--r--test/open-uri/test_ssl.rb321
-rw-r--r--test/openssl/fixtures/pkey/dh1024.pem5
-rw-r--r--test/openssl/fixtures/pkey/dsa1024.pem12
-rw-r--r--test/openssl/fixtures/pkey/dsa256.pem8
-rw-r--r--test/openssl/fixtures/pkey/dsa512.pem8
-rw-r--r--test/openssl/fixtures/pkey/p256.pem5
-rw-r--r--test/openssl/fixtures/pkey/rsa1024.pem15
-rw-r--r--test/openssl/fixtures/pkey/rsa2048.pem27
-rw-r--r--test/openssl/ssl_server.rb81
-rw-r--r--test/openssl/test_asn1.rb800
-rw-r--r--test/openssl/test_bn.rb293
-rw-r--r--test/openssl/test_buffering.rb19
-rw-r--r--test/openssl/test_cipher.rb472
-rw-r--r--test/openssl/test_config.rb21
-rw-r--r--test/openssl/test_digest.rb97
-rw-r--r--test/openssl/test_engine.rb116
-rw-r--r--test/openssl/test_fips.rb20
-rw-r--r--test/openssl/test_hmac.rb55
-rw-r--r--test/openssl/test_kdf.rb183
-rw-r--r--test/openssl/test_ns_spki.rb8
-rw-r--r--test/openssl/test_ocsp.rb305
-rw-r--r--test/openssl/test_pair.rb356
-rw-r--r--test/openssl/test_partial_record_read.rb36
-rw-r--r--test/openssl/test_pkcs12.rb166
-rw-r--r--test/openssl/test_pkcs5.rb97
-rw-r--r--test/openssl/test_pkcs7.rb30
-rw-r--r--test/openssl/test_pkey_dh.rb61
-rw-r--r--test/openssl/test_pkey_dsa.rb304
-rw-r--r--test/openssl/test_pkey_ec.rb462
-rw-r--r--test/openssl/test_pkey_rsa.rb395
-rw-r--r--test/openssl/test_random.rb19
-rw-r--r--test/openssl/test_ssl.rb1517
-rw-r--r--test/openssl/test_ssl_session.rb449
-rw-r--r--test/openssl/test_x509attr.rb84
-rw-r--r--test/openssl/test_x509cert.rb153
-rw-r--r--test/openssl/test_x509crl.rb99
-rw-r--r--test/openssl/test_x509ext.rb48
-rw-r--r--test/openssl/test_x509name.rb159
-rw-r--r--test/openssl/test_x509req.rb43
-rw-r--r--test/openssl/test_x509store.rb93
-rw-r--r--test/openssl/ut_eof.rb133
-rw-r--r--test/openssl/utils.rb432
-rw-r--r--test/optparse/test_acceptable.rb56
-rw-r--r--test/optparse/test_autoconf.rb3
-rw-r--r--test/optparse/test_bash_completion.rb6
-rw-r--r--test/optparse/test_cclass.rb18
-rw-r--r--test/optparse/test_getopts.rb1
-rw-r--r--test/optparse/test_kwargs.rb40
-rw-r--r--test/optparse/test_noarg.rb22
-rw-r--r--test/optparse/test_optarg.rb14
-rw-r--r--test/optparse/test_optparse.rb14
-rw-r--r--test/optparse/test_placearg.rb14
-rw-r--r--test/optparse/test_reqarg.rb18
-rw-r--r--test/optparse/test_summary.rb1
-rw-r--r--test/optparse/test_zsh_completion.rb1
-rw-r--r--test/ostruct/test_ostruct.rb85
-rw-r--r--test/pathname/test_pathname.rb89
-rw-r--r--test/psych/handlers/test_recorder.rb1
-rw-r--r--test/psych/helper.rb30
-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.rb11
-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.rb34
-rw-r--r--test/psych/test_deprecated.rb127
-rw-r--r--test/psych/test_document.rb1
-rw-r--r--test/psych/test_emitter.rb24
-rw-r--r--test/psych/test_encoding.rb22
-rw-r--r--test/psych/test_exception.rb14
-rw-r--r--test/psych/test_hash.rb46
-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.rb1
-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.rb1
-rw-r--r--test/psych/test_omap.rb1
-rw-r--r--test/psych/test_parser.rb63
-rw-r--r--test/psych/test_psych.rb43
-rw-r--r--test/psych/test_safe_load.rb1
-rw-r--r--test/psych/test_scalar.rb6
-rw-r--r--test/psych/test_scalar_scanner.rb17
-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.rb85
-rw-r--r--test/psych/test_struct.rb1
-rw-r--r--test/psych/test_symbol.rb1
-rw-r--r--test/psych/test_tainted.rb3
-rw-r--r--test/psych/test_to_yaml_properties.rb63
-rw-r--r--test/psych/test_tree_builder.rb15
-rw-r--r--test/psych/test_yaml.rb9
-rw-r--r--test/psych/test_yamldbm.rb2
-rw-r--r--test/psych/test_yamlstore.rb1
-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.rb34
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb130
-rw-r--r--test/rake/support/rakefile_definitions.rb478
-rw-r--r--test/rake/support/ruby_runner.rb34
-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.rb643
-rw-r--r--test/rake/test_rake_application_options.rb466
-rw-r--r--test/rake/test_rake_backtrace.rb119
-rw-r--r--test/rake/test_rake_clean.rb61
-rw-r--r--test/rake/test_rake_cpu_counter.rb50
-rw-r--r--test/rake/test_rake_definitions.rb79
-rw-r--r--test/rake/test_rake_directory_task.rb76
-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.rb655
-rw-r--r--test/rake/test_rake_file_list_path_map.rb8
-rw-r--r--test/rake/test_rake_file_task.rb201
-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.rb482
-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.rb64
-rw-r--r--test/rake/test_rake_name_space.rb57
-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_pathname_extensions.rb15
-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.rb388
-rw-r--r--test/rake/test_rake_scope.rb44
-rw-r--r--test/rake/test_rake_task.rb393
-rw-r--r--test/rake/test_rake_task_argument_parsing.rb119
-rw-r--r--test/rake/test_rake_task_arguments.rb127
-rw-r--r--test/rake/test_rake_task_lib.rb9
-rw-r--r--test/rake/test_rake_task_manager.rb178
-rw-r--r--test/rake/test_rake_task_manager_argument_resolution.rb19
-rw-r--r--test/rake/test_rake_task_with_arguments.rb172
-rw-r--r--test/rake/test_rake_test_task.rb141
-rw-r--r--test/rake/test_rake_thread_pool.rb146
-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/MarkdownTest_1.0.3/Markdown Documentation - Basics.text2
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text2
-rw-r--r--test/rdoc/test_rdoc_alias.rb1
-rw-r--r--test/rdoc/test_rdoc_any_method.rb12
-rw-r--r--test/rdoc/test_rdoc_attr.rb1
-rw-r--r--test/rdoc/test_rdoc_class_module.rb4
-rw-r--r--test/rdoc/test_rdoc_code_object.rb16
-rw-r--r--test/rdoc/test_rdoc_comment.rb18
-rw-r--r--test/rdoc/test_rdoc_constant.rb7
-rw-r--r--test/rdoc/test_rdoc_context.rb78
-rw-r--r--test/rdoc/test_rdoc_context_section.rb25
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb1
-rw-r--r--test/rdoc/test_rdoc_encoding.rb87
-rw-r--r--test/rdoc/test_rdoc_extend.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb35
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb68
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po_entry.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb10
-rw-r--r--test/rdoc/test_rdoc_i18n_locale.rb1
-rw-r--r--test/rdoc/test_rdoc_i18n_text.rb3
-rw-r--r--test/rdoc/test_rdoc_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markdown.rb40
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb7
-rw-r--r--test/rdoc/test_rdoc_markup.rb1
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb24
-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.rb3
-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.rb18
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb20
-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.rb16
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb216
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb7
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb25
-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.rb1
-rw-r--r--test/rdoc/test_rdoc_normal_class.rb1
-rw-r--r--test/rdoc/test_rdoc_normal_module.rb1
-rw-r--r--test/rdoc/test_rdoc_options.rb12
-rw-r--r--test/rdoc/test_rdoc_parser.rb8
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb80
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb5
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb1
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb1
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb737
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb1
-rw-r--r--test/rdoc/test_rdoc_rd.rb1
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb3
-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.rb49
-rw-r--r--test/rdoc/test_rdoc_require.rb7
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb67
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb1
-rw-r--r--test/rdoc/test_rdoc_ruby_lex.rb421
-rw-r--r--test/rdoc/test_rdoc_ruby_token.rb19
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb9
-rw-r--r--test/rdoc/test_rdoc_servlet.rb23
-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.rb14
-rw-r--r--test/rdoc/test_rdoc_task.rb8
-rw-r--r--test/rdoc/test_rdoc_text.rb34
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb23
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb5
-rw-r--r--test/rdoc/test_rdoc_top_level.rb1
-rw-r--r--test/rdoc/xref_data.rb38
-rw-r--r--test/rdoc/xref_test_case.rb3
-rw-r--r--test/readline/test_readline.rb117
-rw-r--r--test/readline/test_readline_history.rb1
-rw-r--r--test/resolv/test_addr.rb12
-rw-r--r--test/resolv/test_dns.rb238
-rw-r--r--test/resolv/test_mdns.rb22
-rw-r--r--test/resolv/test_resource.rb26
-rw-r--r--test/rexml/data/ticket_110_utf16.xml (renamed from test/rexml/data/utf16.xml)bin207464 -> 207464 bytes-rw-r--r--test/rexml/listener.rb1
-rw-r--r--test/rexml/parse/test_document_type_declaration.rb1
-rw-r--r--test/rexml/parse/test_notation_declaration.rb1
-rw-r--r--test/rexml/parser/test_sax2.rb1
-rw-r--r--test/rexml/parser/test_stream.rb32
-rw-r--r--test/rexml/parser/test_tree.rb1
-rw-r--r--test/rexml/parser/test_ultra_light.rb1
-rw-r--r--test/rexml/rexml_test_utils.rb1
-rw-r--r--test/rexml/test_attributes.rb1
-rw-r--r--test/rexml/test_attributes_mixin.rb1
-rw-r--r--test/rexml/test_changing_encoding.rb5
-rw-r--r--test/rexml/test_comment.rb1
-rw-r--r--test/rexml/test_contrib.rb1
-rw-r--r--test/rexml/test_core.rb3
-rw-r--r--test/rexml/test_doctype.rb1
-rw-r--r--test/rexml/test_document.rb143
-rw-r--r--test/rexml/test_element.rb18
-rw-r--r--test/rexml/test_elements.rb1
-rw-r--r--test/rexml/test_encoding.rb16
-rw-r--r--test/rexml/test_entity.rb19
-rw-r--r--test/rexml/test_functions.rb14
-rw-r--r--test/rexml/test_functions_number.rb1
-rw-r--r--test/rexml/test_jaxen.rb3
-rw-r--r--test/rexml/test_light.rb1
-rw-r--r--test/rexml/test_lightparser.rb1
-rw-r--r--test/rexml/test_listener.rb1
-rw-r--r--test/rexml/test_martin_fowler.rb1
-rw-r--r--test/rexml/test_namespace.rb1
-rw-r--r--test/rexml/test_order.rb1
-rw-r--r--test/rexml/test_preceding_sibling.rb1
-rw-r--r--test/rexml/test_pullparser.rb1
-rw-r--r--test/rexml/test_rexml_issuezilla.rb1
-rw-r--r--test/rexml/test_sax.rb1
-rw-r--r--test/rexml/test_stream.rb1
-rw-r--r--test/rexml/test_text.rb1
-rw-r--r--test/rexml/test_ticket_80.rb1
-rw-r--r--test/rexml/test_validation_rng.rb1
-rw-r--r--test/rexml/test_xml_declaration.rb1
-rw-r--r--test/rexml/xpath/test_attribute.rb1
-rw-r--r--test/rexml/xpath/test_axis_preceding_sibling.rb1
-rw-r--r--test/rexml/xpath/test_base.rb1
-rw-r--r--test/rexml/xpath/test_node.rb1
-rw-r--r--test/rexml/xpath/test_predicate.rb1
-rw-r--r--test/rexml/xpath/test_text.rb5
-rw-r--r--test/rinda/test_rinda.rb171
-rw-r--r--test/rinda/test_tuplebag.rb1
-rw-r--r--test/ripper/dummyparser.rb74
-rw-r--r--test/ripper/test_files.rb48
-rw-r--r--test/ripper/test_filter.rb14
-rw-r--r--test/ripper/test_lexer.rb93
-rw-r--r--test/ripper/test_parser_events.rb388
-rw-r--r--test/ripper/test_ripper.rb99
-rw-r--r--test/ripper/test_scanner_events.rb148
-rw-r--r--test/ripper/test_sexp.rb143
-rw-r--r--test/rss/rss-assertions.rb1
-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.rb7
-rw-r--r--test/rss/test_maker_0.9.rb3
-rw-r--r--test/rss/test_maker_1.0.rb3
-rw-r--r--test/rss/test_maker_2.0.rb7
-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.rb15
-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.rb1
-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.rb22
-rw-r--r--test/ruby/enc/test_big5.rb1
-rw-r--r--test/ruby/enc/test_case_comprehensive.rb303
-rw-r--r--test/ruby/enc/test_case_mapping.rb198
-rw-r--r--test/ruby/enc/test_case_options.rb81
-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.rb1
-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_grapheme_breaks.rb92
-rw-r--r--test/ruby/enc/test_iso_8859.rb7
-rw-r--r--test/ruby/enc/test_koi8.rb1
-rw-r--r--test/ruby/enc/test_regex_casefold.rb120
-rw-r--r--test/ruby/enc/test_shift_jis.rb1
-rw-r--r--test/ruby/enc/test_utf16.rb113
-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.rb522
-rw-r--r--test/ruby/find_executable.rb21
-rw-r--r--test/ruby/lbtest.rb6
-rw-r--r--test/ruby/marshaltestlib.rb1
-rw-r--r--test/ruby/memory_status.rb134
-rw-r--r--test/ruby/sentence.rb1
-rw-r--r--test/ruby/test_alias.rb47
-rw-r--r--test/ruby/test_argf.rb761
-rw-r--r--test/ruby/test_arity.rb45
-rw-r--r--test/ruby/test_array.rb647
-rw-r--r--test/ruby/test_assignment.rb34
-rw-r--r--test/ruby/test_autoload.rb171
-rw-r--r--test/ruby/test_backtrace.rb68
-rw-r--r--test/ruby/test_basicinstructions.rb33
-rw-r--r--test/ruby/test_beginendblock.rb228
-rw-r--r--test/ruby/test_bignum.rb233
-rw-r--r--test/ruby/test_call.rb68
-rw-r--r--test/ruby/test_case.rb25
-rw-r--r--test/ruby/test_class.rb243
-rw-r--r--test/ruby/test_clone.rb1
-rw-r--r--test/ruby/test_comparable.rb30
-rw-r--r--test/ruby/test_complex.rb243
-rw-r--r--test/ruby/test_complex2.rb1
-rw-r--r--test/ruby/test_complexrational.rb19
-rw-r--r--test/ruby/test_condition.rb1
-rw-r--r--test/ruby/test_const.rb26
-rw-r--r--test/ruby/test_continuation.rb13
-rw-r--r--test/ruby/test_defined.rb50
-rw-r--r--test/ruby/test_dir.rb165
-rw-r--r--test/ruby/test_dir_m17n.rb142
-rw-r--r--test/ruby/test_econv.rb15
-rw-r--r--test/ruby/test_encoding.rb10
-rw-r--r--test/ruby/test_enum.rb502
-rw-r--r--test/ruby/test_enumerator.rb42
-rw-r--r--test/ruby/test_env.rb162
-rw-r--r--test/ruby/test_eval.rb79
-rw-r--r--test/ruby/test_exception.rb588
-rw-r--r--test/ruby/test_fiber.rb77
-rw-r--r--test/ruby/test_file.rb116
-rw-r--r--test/ruby/test_file_exhaustive.rb1253
-rw-r--r--test/ruby/test_fixnum.rb39
-rw-r--r--test/ruby/test_flip.rb34
-rw-r--r--test/ruby/test_float.rb254
-rw-r--r--test/ruby/test_fnmatch.rb2
-rw-r--r--test/ruby/test_gc.rb117
-rw-r--r--test/ruby/test_hash.rb366
-rw-r--r--test/ruby/test_ifunless.rb1
-rw-r--r--test/ruby/test_integer.rb386
-rw-r--r--test/ruby/test_integer_comb.rb99
-rw-r--r--test/ruby/test_io.rb1018
-rw-r--r--test/ruby/test_io_m17n.rb181
-rw-r--r--test/ruby/test_iseq.rb335
-rw-r--r--test/ruby/test_iterator.rb13
-rw-r--r--test/ruby/test_keyword.rb199
-rw-r--r--test/ruby/test_lambda.rb46
-rw-r--r--test/ruby/test_lazy_enumerator.rb93
-rw-r--r--test/ruby/test_literal.rb149
-rw-r--r--test/ruby/test_m17n.rb164
-rw-r--r--test/ruby/test_m17n_comb.rb76
-rw-r--r--test/ruby/test_marshal.rb149
-rw-r--r--test/ruby/test_math.rb150
-rw-r--r--test/ruby/test_metaclass.rb1
-rw-r--r--test/ruby/test_method.rb244
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb11
-rw-r--r--test/ruby/test_module.rb428
-rw-r--r--test/ruby/test_not.rb1
-rw-r--r--test/ruby/test_notimp.rb3
-rw-r--r--test/ruby/test_numeric.rb273
-rw-r--r--test/ruby/test_object.rb173
-rw-r--r--test/ruby/test_objectspace.rb102
-rw-r--r--test/ruby/test_optimization.rb695
-rw-r--r--test/ruby/test_pack.rb171
-rw-r--r--test/ruby/test_parse.rb315
-rw-r--r--test/ruby/test_path.rb4
-rw-r--r--test/ruby/test_pipe.rb1
-rw-r--r--test/ruby/test_primitive.rb3
-rw-r--r--test/ruby/test_proc.rb99
-rw-r--r--test/ruby/test_process.rb670
-rw-r--r--test/ruby/test_rand.rb71
-rw-r--r--test/ruby/test_range.rb216
-rw-r--r--test/ruby/test_rational.rb337
-rw-r--r--test/ruby/test_rational2.rb1
-rw-r--r--test/ruby/test_readpartial.rb9
-rw-r--r--test/ruby/test_refinement.rb1048
-rw-r--r--test/ruby/test_regexp.rb225
-rw-r--r--test/ruby/test_require.rb334
-rw-r--r--test/ruby/test_rubyoptions.rb522
-rw-r--r--test/ruby/test_rubyvm.rb3
-rw-r--r--test/ruby/test_settracefunc.rb633
-rw-r--r--test/ruby/test_signal.rb84
-rw-r--r--test/ruby/test_sleep.rb1
-rw-r--r--test/ruby/test_sprintf.rb136
-rw-r--r--test/ruby/test_sprintf_comb.rb1
-rw-r--r--test/ruby/test_string.rb1053
-rw-r--r--test/ruby/test_stringchar.rb1
-rw-r--r--test/ruby/test_struct.rb95
-rw-r--r--test/ruby/test_super.rb81
-rw-r--r--test/ruby/test_symbol.rb309
-rw-r--r--test/ruby/test_syntax.rb780
-rw-r--r--test/ruby/test_system.rb2
-rw-r--r--test/ruby/test_thread.rb487
-rw-r--r--test/ruby/test_threadgroup.rb3
-rw-r--r--test/ruby/test_time.rb148
-rw-r--r--test/ruby/test_time_tz.rb188
-rw-r--r--test/ruby/test_trace.rb1
-rw-r--r--test/ruby/test_transcode.rb163
-rw-r--r--test/ruby/test_undef.rb1
-rw-r--r--test/ruby/test_unicode_escape.rb21
-rw-r--r--test/ruby/test_variable.rb76
-rw-r--r--test/ruby/test_vm_dump.rb21
-rw-r--r--test/ruby/test_weakmap.rb3
-rw-r--r--test/ruby/test_whileuntil.rb4
-rw-r--r--test/ruby/test_yield.rb48
-rw-r--r--test/ruby/ut_eof.rb1
-rw-r--r--test/rubygems/alternate_cert.pem19
-rw-r--r--test/rubygems/alternate_cert_32.pem19
-rw-r--r--test/rubygems/bad_rake.rb1
-rw-r--r--test/rubygems/bogussources.rb1
-rw-r--r--test/rubygems/ca_cert.pem139
-rw-r--r--test/rubygems/child_cert.pem20
-rw-r--r--test/rubygems/child_cert_32.pem20
-rw-r--r--test/rubygems/client.pem148
-rw-r--r--test/rubygems/encrypted_private_key.pem52
-rw-r--r--test/rubygems/expired_cert.pem17
-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/future_cert.pem17
-rw-r--r--test/rubygems/future_cert_32.pem17
-rw-r--r--test/rubygems/good_rake.rb1
-rw-r--r--test/rubygems/grandchild_cert.pem20
-rw-r--r--test/rubygems/grandchild_cert_32.pem20
-rw-r--r--test/rubygems/invalid_issuer_cert.pem20
-rw-r--r--test/rubygems/invalid_issuer_cert_32.pem20
-rw-r--r--test/rubygems/invalid_signer_cert.pem19
-rw-r--r--test/rubygems/invalid_signer_cert_32.pem19
-rw-r--r--test/rubygems/invalidchild_cert.pem20
-rw-r--r--test/rubygems/invalidchild_cert_32.pem20
-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/private3072_key.pem40
-rw-r--r--test/rubygems/public3072_cert.pem25
-rw-r--r--test/rubygems/public_cert.pem20
-rw-r--r--test/rubygems/public_cert_32.pem19
-rw-r--r--test/rubygems/rubygems/commands/crash_command.rb1
-rw-r--r--test/rubygems/rubygems_plugin.rb5
-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.gemspec (renamed from test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec)bin269 -> 269 bytes-rw-r--r--test/rubygems/ssl_cert.pem95
-rw-r--r--test/rubygems/ssl_key.pem38
-rw-r--r--test/rubygems/test_bundled_ca.rb83
-rw-r--r--test/rubygems/test_config.rb14
-rw-r--r--test/rubygems/test_deprecate.rb1
-rw-r--r--test/rubygems/test_gem.rb493
-rw-r--r--test/rubygems/test_gem_available_set.rb4
-rw-r--r--test/rubygems/test_gem_bundler_version_finder.rb126
-rw-r--r--test/rubygems/test_gem_command.rb11
-rw-r--r--test/rubygems/test_gem_command_manager.rb1
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb39
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb65
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb87
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb9
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb11
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb3
-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.rb1
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb104
-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.rb33
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb6
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb131
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb88
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb360
-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.rb172
-rw-r--r--test/rubygems/test_gem_commands_signin_command.rb98
-rw-r--r--test/rubygems/test_gem_commands_signout_command.rb37
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb53
-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.rb26
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb15
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb96
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb23
-rw-r--r--test/rubygems/test_gem_config_file.rb29
-rw-r--r--test/rubygems/test_gem_dependency.rb43
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb41
-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.rb7
-rw-r--r--test/rubygems/test_gem_ext_builder.rb25
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb7
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb15
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb70
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb50
-rw-r--r--test/rubygems/test_gem_gem_runner.rb35
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb13
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb1
-rw-r--r--test/rubygems/test_gem_indexer.rb12
-rw-r--r--test/rubygems/test_gem_install_update_options.rb22
-rw-r--r--test/rubygems/test_gem_installer.rb502
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb1
-rw-r--r--test/rubygems/test_gem_name_tuple.rb1
-rw-r--r--test/rubygems/test_gem_package.rb214
-rw-r--r--test/rubygems/test_gem_package_old.rb3
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb21
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb1
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb12
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb52
-rw-r--r--test/rubygems/test_gem_package_task.rb8
-rw-r--r--test/rubygems/test_gem_path_support.rb49
-rw-r--r--test/rubygems/test_gem_platform.rb12
-rw-r--r--test/rubygems/test_gem_rdoc.rb3
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb173
-rw-r--r--test/rubygems/test_gem_request.rb135
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb23
-rw-r--r--test/rubygems/test_gem_request_set.rb32
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb117
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb826
-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.rb17
-rw-r--r--test/rubygems/test_gem_resolver.rb78
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb1
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb5
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb3
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb1
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb4
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb1
-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.rb33
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb18
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb1
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb1
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb1
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb1
-rw-r--r--test/rubygems/test_gem_security.rb6
-rw-r--r--test/rubygems/test_gem_security_policy.rb51
-rw-r--r--test/rubygems/test_gem_security_signer.rb21
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb7
-rw-r--r--test/rubygems/test_gem_server.rb213
-rw-r--r--test/rubygems/test_gem_silent_ui.rb1
-rw-r--r--test/rubygems/test_gem_source.rb30
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb9
-rw-r--r--test/rubygems/test_gem_source_git.rb14
-rw-r--r--test/rubygems/test_gem_source_installed.rb1
-rw-r--r--test/rubygems/test_gem_source_list.rb7
-rw-r--r--test/rubygems/test_gem_source_local.rb1
-rw-r--r--test/rubygems/test_gem_source_lock.rb1
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb1
-rw-r--r--test/rubygems/test_gem_source_vendor.rb1
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb21
-rw-r--r--test/rubygems/test_gem_specification.rb885
-rw-r--r--test/rubygems/test_gem_stream_ui.rb25
-rw-r--r--test/rubygems/test_gem_stub_specification.rb135
-rw-r--r--test/rubygems/test_gem_text.rb35
-rw-r--r--test/rubygems/test_gem_uninstaller.rb8
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb1
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb1
-rw-r--r--test/rubygems/test_gem_util.rb35
-rw-r--r--test/rubygems/test_gem_validator.rb1
-rw-r--r--test/rubygems/test_gem_version.rb61
-rw-r--r--test/rubygems/test_gem_version_option.rb16
-rw-r--r--test/rubygems/test_kernel.rb62
-rw-r--r--test/rubygems/test_remote_fetch_error.rb21
-rw-r--r--test/rubygems/test_require.rb419
-rw-r--r--test/rubygems/wrong_key_cert.pem19
-rw-r--r--test/rubygems/wrong_key_cert_32.pem19
-rw-r--r--test/runner.rb26
-rw-r--r--test/scanf/test_scanf.rb2
-rw-r--r--test/scanf/test_scanfblocks.rb1
-rw-r--r--test/scanf/test_scanfio.rb8
-rw-r--r--test/sdbm/test_sdbm.rb8
-rw-r--r--test/shell/test_command_processor.rb15
-rw-r--r--test/socket/test_addrinfo.rb46
-rw-r--r--test/socket/test_ancdata.rb2
-rw-r--r--test/socket/test_basicsocket.rb163
-rw-r--r--test/socket/test_nonblock.rb104
-rw-r--r--test/socket/test_socket.rb90
-rw-r--r--test/socket/test_sockopt.rb15
-rw-r--r--test/socket/test_tcp.rb21
-rw-r--r--test/socket/test_udp.rb44
-rw-r--r--test/socket/test_unix.rb53
-rw-r--r--test/stringio/test_stringio.rb225
-rw-r--r--test/strscan/test_stringscanner.rb89
-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.rb25
-rw-r--r--test/test_extlibs.rb83
-rw-r--r--test/test_find.rb41
-rw-r--r--test/test_forwardable.rb339
-rw-r--r--test/test_ipaddr.rb140
-rw-r--r--test/test_mathn.rb120
-rw-r--r--test/test_mutex_m.rb4
-rw-r--r--test/test_observer.rb66
-rw-r--r--test/test_open3.rb58
-rw-r--r--test/test_pp.rb58
-rw-r--r--test/test_prettyprint.rb14
-rw-r--r--test/test_prime.rb140
-rw-r--r--test/test_pstore.rb23
-rw-r--r--test/test_pty.rb2
-rw-r--r--test/test_rbconfig.rb1
-rw-r--r--test/test_securerandom.rb101
-rw-r--r--test/test_set.rb322
-rw-r--r--test/test_shellwords.rb95
-rw-r--r--test/test_singleton.rb13
-rw-r--r--test/test_syslog.rb15
-rw-r--r--test/test_tempfile.rb120
-rw-r--r--test/test_time.rb203
-rw-r--r--test/test_timeout.rb47
-rw-r--r--test/test_tmpdir.rb49
-rw-r--r--test/test_tracer.rb9
-rw-r--r--test/test_tsort.rb15
-rw-r--r--test/test_unicode_normalize.rb198
-rw-r--r--test/test_weakref.rb10
-rw-r--r--test/test_win32api.rb24
-rw-r--r--test/testunit/test4test_hideskip.rb1
-rw-r--r--test/testunit/test4test_redefinition.rb1
-rw-r--r--test/testunit/test4test_sorting.rb1
-rw-r--r--test/testunit/test_assertion.rb21
-rw-r--r--test/testunit/test_hideskip.rb7
-rw-r--r--test/testunit/test_parallel.rb53
-rw-r--r--test/testunit/test_rake_integration.rb36
-rw-r--r--test/testunit/test_redefinition.rb1
-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.rb1
-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.rb1
-rw-r--r--test/thread/test_cv.rb41
-rw-r--r--test/thread/test_queue.rb349
-rw-r--r--test/thread/test_sync.rb9
-rw-r--r--test/uri/test_common.rb2
-rw-r--r--test/uri/test_ftp.rb1
-rw-r--r--test/uri/test_generic.rb263
-rw-r--r--test/uri/test_http.rb6
-rw-r--r--test/uri/test_ldap.rb1
-rw-r--r--test/uri/test_mailto.rb77
-rw-r--r--test/uri/test_parser.rb7
-rw-r--r--test/webrick/test_cgi.rb50
-rw-r--r--test/webrick/test_config.rb17
-rw-r--r--test/webrick/test_cookie.rb10
-rw-r--r--test/webrick/test_do_not_reverse_lookup.rb71
-rw-r--r--test/webrick/test_filehandler.rb107
-rw-r--r--test/webrick/test_htmlutils.rb1
-rw-r--r--test/webrick/test_httpauth.rb167
-rw-r--r--test/webrick/test_httpproxy.rb64
-rw-r--r--test/webrick/test_httprequest.rb8
-rw-r--r--test/webrick/test_httpresponse.rb62
-rw-r--r--test/webrick/test_https.rb112
-rw-r--r--test/webrick/test_httpserver.rb174
-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.rb67
-rw-r--r--test/webrick/test_utils.rb96
-rw-r--r--test/webrick/utils.rb59
-rw-r--r--test/webrick/webrick.cgi6
-rw-r--r--test/webrick/webrick.rhtml4
-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.rb1
-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.rb3
-rw-r--r--test/win32ole/test_propertyputref.rb1
-rw-r--r--test/win32ole/test_thread.rb1
-rw-r--r--test/win32ole/test_win32ole.rb23
-rw-r--r--test/win32ole/test_win32ole_event.rb156
-rw-r--r--test/win32ole/test_win32ole_method.rb1
-rw-r--r--test/win32ole/test_win32ole_param.rb1
-rw-r--r--test/win32ole/test_win32ole_record.rb110
-rw-r--r--test/win32ole/test_win32ole_type.rb1
-rw-r--r--test/win32ole/test_win32ole_typelib.rb1
-rw-r--r--test/win32ole/test_win32ole_variable.rb1
-rw-r--r--test/win32ole/test_win32ole_variant.rb36
-rw-r--r--test/win32ole/test_win32ole_variant_m.rb1
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb1
-rw-r--r--test/win32ole/test_word.rb26
-rw-r--r--test/xmlrpc/data/blog.xml18
-rw-r--r--test/xmlrpc/data/bug_bool.expected3
-rw-r--r--test/xmlrpc/data/bug_bool.xml8
-rw-r--r--test/xmlrpc/data/bug_cdata.expected3
-rw-r--r--test/xmlrpc/data/bug_cdata.xml8
-rw-r--r--test/xmlrpc/data/bug_covert.expected10
-rw-r--r--test/xmlrpc/data/bug_covert.xml6
-rw-r--r--test/xmlrpc/data/datetime_iso8601.xml8
-rw-r--r--test/xmlrpc/data/fault.xml16
-rw-r--r--test/xmlrpc/data/value.expected7
-rw-r--r--test/xmlrpc/data/value.xml22
-rw-r--r--test/xmlrpc/data/xml1.expected243
-rw-r--r--test/xmlrpc/data/xml1.xml1
-rw-r--r--test/xmlrpc/htpasswd2
-rw-r--r--test/xmlrpc/test_client.rb317
-rw-r--r--test/xmlrpc/test_cookie.rb98
-rw-r--r--test/xmlrpc/test_datetime.rb161
-rw-r--r--test/xmlrpc/test_features.rb50
-rw-r--r--test/xmlrpc/test_marshal.rb110
-rw-r--r--test/xmlrpc/test_parser.rb93
-rw-r--r--test/xmlrpc/test_webrick_server.rb137
-rw-r--r--test/xmlrpc/webrick_testing.rb48
-rw-r--r--test/yaml/test_store.rb180
-rw-r--r--test/zlib/test_zlib.rb146
-rw-r--r--thread.c2396
-rw-r--r--thread_pthread.c577
-rw-r--r--thread_pthread.h2
-rw-r--r--thread_sync.c1532
-rw-r--r--thread_win32.c99
-rw-r--r--time.c987
-rw-r--r--tool/asm_parse.rb2
-rwxr-xr-xtool/bisect.sh25
-rwxr-xr-xtool/change_maker.rb17
-rwxr-xr-xtool/checksum.rb72
-rw-r--r--tool/colorize.rb41
-rw-r--r--tool/compile_prelude.rb199
-rw-r--r--tool/downloader.rb328
-rwxr-xr-xtool/enc-unicode.rb319
-rw-r--r--tool/eval.rb1
-rwxr-xr-xtool/expand-config.rb34
-rwxr-xr-xtool/extlibs.rb186
-rw-r--r--tool/fake.rb62
-rwxr-xr-xtool/fetch-bundled_gems.rb27
-rwxr-xr-xtool/file2lastrev.rb68
-rwxr-xr-xtool/gem-unpack.rb18
-rwxr-xr-xtool/gen_dummy_probes.rb24
-rwxr-xr-xtool/gen_ruby_tapset.rb3
-rw-r--r--tool/generate-backport-changelog.rb99
-rw-r--r--tool/generic_erb.rb32
-rwxr-xr-xtool/get-config_files13
-rwxr-xr-xtool/git-refresh43
-rw-r--r--tool/gperf.sed22
-rwxr-xr-xtool/id2token.rb3
-rwxr-xr-xtool/ifchange50
-rwxr-xr-xtool/insns2vm.rb3
-rw-r--r--tool/install-sh6
-rwxr-xr-xtool/instruction.rb282
-rw-r--r--tool/jisx0208.rb2
-rwxr-xr-xtool/make-snapshot281
-rw-r--r--tool/make_hgraph.rb95
-rwxr-xr-xtool/mdoc2man.rb60
-rwxr-xr-xtool/merger.rb121
-rw-r--r--tool/mk_call_iseq_optimized.rb73
-rwxr-xr-xtool/mkconfig.rb131
-rwxr-xr-xtool/mkrunnable.rb29
-rwxr-xr-xtool/node_name.rb4
-rw-r--r--tool/parse.rb3
-rw-r--r--tool/prereq.status43
-rwxr-xr-xtool/pull-latest-mspec-spec18
-rwxr-xr-xtool/rbinstall.rb459
-rwxr-xr-xtool/rbuninstall.rb4
-rwxr-xr-xtool/redmine-backporter.rb293
-rwxr-xr-xtool/release.sh4
-rwxr-xr-xtool/rmdirs3
-rwxr-xr-xtool/rubytest.rb30
-rw-r--r--tool/run-gcov.rb54
-rw-r--r--tool/run-lcov.rb164
-rwxr-xr-xtool/runruby.rb90
-rwxr-xr-xtool/strip-rdoc.rb3
-rw-r--r--tool/sync_default_gems.rb198
-rw-r--r--tool/test-coverage.rb103
-rw-r--r--tool/transcode-tblgen.rb68
-rwxr-xr-xtool/update-deps566
-rw-r--r--tool/vcs.rb427
-rw-r--r--tool/vpath.rb5
-rw-r--r--tool/vtlh.rb2
-rwxr-xr-xtool/ytab.sed28
-rw-r--r--transcode.c90
-rw-r--r--transcode_data.h30
-rw-r--r--util.c112
-rw-r--r--variable.c1626
-rw-r--r--version.c28
-rw-r--r--version.h40
-rw-r--r--vm.c2401
-rw-r--r--vm_args.c884
-rw-r--r--vm_backtrace.c312
-rw-r--r--vm_core.h1542
-rw-r--r--vm_dump.c320
-rw-r--r--vm_eval.c1494
-rw-r--r--vm_exec.c43
-rw-r--r--vm_exec.h30
-rw-r--r--vm_insnhelper.c4030
-rw-r--r--vm_insnhelper.h166
-rw-r--r--vm_method.c1435
-rw-r--r--vm_opts.h12
-rw-r--r--vm_trace.c575
-rw-r--r--vsnprintf.c92
-rw-r--r--win32/Makefile.sub314
-rwxr-xr-xwin32/configure.bat84
-rw-r--r--win32/dir.h16
-rw-r--r--win32/file.c298
-rw-r--r--win32/file.h48
-rwxr-xr-xwin32/ifchange.bat22
-rwxr-xr-xwin32/mkexports.rb7
-rwxr-xr-xwin32/resource.rb3
-rwxr-xr-xwin32/rmdirs.bat1
-rw-r--r--win32/rtname.cmd33
-rw-r--r--win32/setup.mak171
-rw-r--r--win32/stub.c42
-rw-r--r--win32/win32.c2609
8725 files changed, 399290 insertions, 523186 deletions
diff --git a/.document b/.document
index eeb565b08b..9a5067bc52 100644
--- a/.document
+++ b/.document
@@ -5,13 +5,10 @@
# Process all the C source files
*.c
-*.y
# prelude
prelude.rb
-rbconfig.rb
-
# the lib/ directory (which has its own .document file)
lib
@@ -19,9 +16,13 @@ lib
ext
# rdoc files
+ChangeLog
+
NEWS
-README.md
-README.ja.md
+README
+README.EXT
+README.EXT.ja
+README.ja
doc
diff --git a/.editorconfig b/.editorconfig
index 49cc692091..67abf4b978 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -2,23 +2,15 @@ root = true
[*]
end_of_line = lf
-indent_size = 4
-indent_style = tab
insert_final_newline = true
-tab_width = 8
trim_trailing_whitespace = true
+tab_width = 8
+indent_style = tab
+indent_size = 4
-[*.bat]
+[**.bat]
end_of_line = crlf
-[*.gemspec]
-indent_size = 2
-indent_style = space
-
-[*.rb]
-indent_size = 2
+[**.rb]
indent_style = space
-
-[*.yml]
indent_size = 2
-indent_style = space
diff --git a/.gdbinit b/.gdbinit
index a188ffa172..e2a34f3715 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -63,15 +63,7 @@ define rp
else
if ($flags & RUBY_T_MASK) == RUBY_T_OBJECT
printf "%sT_OBJECT%s: ", $color_type, $color_end
- print ((struct RObject *)($arg0))->basic
- if ($flags & ROBJECT_EMBED)
- print/x *((VALUE*)((struct RObject*)($arg0))->as.ary) @ (ROBJECT_EMBED_LEN_MAX+0)
- else
- print (((struct RObject *)($arg0))->as.heap)
- if (((struct RObject*)($arg0))->as.heap.numiv) > 0
- print/x *(((struct RObject*)($arg0))->as.heap.ivptr) @ (((struct RObject*)($arg0))->as.heap.numiv)
- end
- end
+ print (struct RObject *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_CLASS
printf "%sT_CLASS%s%s: ", $color_type, ($flags & RUBY_FL_SINGLETON) ? "*" : "", $color_end
@@ -97,15 +89,14 @@ define rp
set $regsrc = ((struct RRegexp*)($arg0))->src
set $rsflags = ((struct RBasic*)$regsrc)->flags
printf "%sT_REGEXP%s: ", $color_type, $color_end
- set $len = ($rsflags & RUBY_FL_USER1) ? \
- ((struct RString*)$regsrc)->as.heap.len : \
- (($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
set print address off
- output *(char *)(($rsflags & RUBY_FL_USER1) ? \
+ output (char *)(($rsflags & RUBY_FL_USER1) ? \
((struct RString*)$regsrc)->as.heap.ptr : \
- ((struct RString*)$regsrc)->as.ary) @ $len
+ ((struct RString*)$regsrc)->as.ary)
set print address on
- printf " len:%ld ", $len
+ printf " len:%ld ", ($rsflags & RUBY_FL_USER1) ? \
+ ((struct RString*)$regsrc)->as.heap.len : \
+ (($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
if $flags & RUBY_FL_USER6
printf "(none) "
end
@@ -126,7 +117,7 @@ define rp
if ($len == 0)
printf "{(empty)} "
else
- print/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.ary) @ $len
printf " "
end
else
@@ -142,7 +133,7 @@ define rp
if ($len == 0)
printf "{(empty)} "
else
- print/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len
+ output/x *((VALUE*)((struct RArray*)($arg0))->as.heap.ptr) @ $len
printf " "
end
end
@@ -160,17 +151,28 @@ define rp
print (struct RHash *)($arg0)
else
if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
- set $len = (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, \
+ (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
((struct RStruct *)($arg0))->as.heap.len)
- printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, $len
print (struct RStruct *)($arg0)
- output/x *(($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
- ((struct RStruct *)($arg0))->as.ary : \
- ((struct RStruct *)($arg0))->as.heap.ptr) @ $len
+ x/xw (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
+ ((struct RStruct *)($arg0))->as.ary : \
+ ((struct RStruct *)($arg0))->as.heap.ptr)
else
if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
- rp_bignum $arg0
+ printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \
+ (($flags & RUBY_FL_USER1) != 0), \
+ (($flags & RUBY_FL_USER2) ? \
+ ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
+ ((struct RBignum*)($arg0))->as.heap.len)
+ if $flags & RUBY_FL_USER2
+ printf "(embed) "
+ end
+ print (struct RBignum *)($arg0)
+ x/xw (($flags & RUBY_FL_USER2) ? \
+ ((struct RBignum*)($arg0))->as.ary : \
+ ((struct RBignum*)($arg0))->as.heap.digits)
else
if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
printf "%sT_RATIONAL%s: ", $color_type, $color_end
@@ -210,7 +212,7 @@ define rp
if ($flags & RUBY_T_MASK) == RUBY_T_SYMBOL
printf "%sT_SYMBOL%s: ", $color_type, $color_end
print (struct RSymbol *)($arg0)
- set $id_type = ((struct RSymbol *)($arg0))->id & RUBY_ID_SCOPE_MASK
+ set $id_type = ((struct RSymbol *)($arg0))->type
if $id_type == RUBY_ID_LOCAL
printf "l"
else
@@ -243,12 +245,6 @@ define rp
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)&RUBY_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)
@@ -293,7 +289,6 @@ define rp
end
end
end
- end
end
document rp
Print a Ruby's VALUE.
@@ -325,9 +320,6 @@ define rp_id
if $id == idLTLT
printf "(:<<)\n"
else
- if $id == idGTGT
- printf "(:>>)\n"
- else
if $id == idLE
printf "(:<=)\n"
else
@@ -355,18 +347,6 @@ define rp_id
if $id == idASET
printf "(:[]=)\n"
else
- if $id == idCOLON2
- printf "(:'::')\n"
- else
- if $id == idANDOP
- printf "(:&&)\n"
- else
- if $id == idOROP
- printf "(:||)\n"
- else
- if $id == idANDDOT
- printf "(:&.)\n"
- else
if $id <= tLAST_OP_ID
printf "O"
else
@@ -398,13 +378,12 @@ define rp_id
end
end
printf "(%ld): ", $id
- print_id $id
- echo \n
- end
- end
- end
- end
- end
+ rb_numtable_entry global_symbols.id_str $id
+ if $rb_numtable_rec
+ rp_string $rb_numtable_rec
+ else
+ echo undef\n
+ end
end
end
end
@@ -427,35 +406,16 @@ document rp_id
Print an ID.
end
-define output_string
+define rp_string
set $flags = ((struct RBasic*)($arg0))->flags
- set $len = ($flags & RUBY_FL_USER1) ? \
- ((struct RString*)($arg0))->as.heap.len : \
- (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
- if $len > 0
- output *(char *)(($flags & RUBY_FL_USER1) ? \
+ set print address off
+ output (char *)(($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.ptr : \
- ((struct RString*)($arg0))->as.ary) @ $len
- else
- output ""
- end
-end
-
-define print_string
- set $flags = ((struct RBasic*)($arg0))->flags
- set $len = ($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)($arg0))->as.ary)
+ set print address on
+ printf " bytesize:%ld ", ($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.len : \
(($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
- if $len > 0
- printf "%s", *(char *)(($flags & RUBY_FL_USER1) ? \
- ((struct RString*)($arg0))->as.heap.ptr : \
- ((struct RString*)($arg0))->as.ary) @ $len
- end
-end
-
-define rp_string
- output_string $arg0
- printf " bytesize:%ld ", $len
if !($flags & RUBY_FL_USER1)
printf "(embed) "
else
@@ -486,109 +446,20 @@ document rp_string
Print the content of a String.
end
-define rp_bignum
- set $flags = ((struct RBignum*)($arg0))->basic.flags
- set $len = (($flags & RUBY_FL_USER2) ? \
- ($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
- ((struct RBignum*)($arg0))->as.heap.len)
- printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \
- (($flags & RUBY_FL_USER1) != 0), $len
- if $flags & RUBY_FL_USER2
- printf "(embed) "
- end
- print (struct RBignum *)($arg0)
- set $ptr = (($flags & RUBY_FL_USER2) ? \
- ((struct RBignum*)($arg0))->as.ary : \
- ((struct RBignum*)($arg0))->as.heap.digits)
- set $len = $len-1
- printf "0x%x", $ptr[$len]
- while $len > 0
- set $len = $len-1
- set $val = $ptr[$len]
- set $w = sizeof($ptr[0])
- printf "_"
- if $w > 8
- printf "%.32x", $val
- else
- if $w > 4
- printf "%.16x", $val
- else
- if $w > 2
- printf "%.8x", $val
- else
- if $w > 1
- printf "%.4x", $val
- else
- printf "%.2x", $val
- end
- end
- end
- end
- end
- printf "\n"
-end
-document rp_bignum
- Print the content of a Bignum.
-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
- print/x *(struct RClass *)($arg0)
+ print *(struct RClass *)($arg0)
print *((struct RClass *)($arg0))->ptr
end
document rp_class
Print the content of a Class/Module.
end
-define rp_imemo
- set $flags = (enum imemo_type)((((struct RBasic *)($arg0))->flags >> RUBY_FL_USHIFT) & RUBY_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
- if $flags == imemo_ment
- printf "(rb_method_entry_t *) %p\n", (void*)$arg0
- print *(rb_method_entry_t *)$arg0
- else
- if $flags == imemo_iseq
- printf "(rb_iseq_t *) %p\n", (void*)$arg0
- print *(rb_iseq_t *)$arg0
- else
- printf "(struct RIMemo *) %p\n", (void*)$arg0
- print *(struct RIMemo *)$arg0
- end
- end
- 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
@@ -867,12 +738,6 @@ 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_tmp_new(0), 0, ($arg0))
- printf "%s\n", $buf->as.heap.ptr
-end
-
define rb_p
call rb_p($arg0)
end
@@ -940,7 +805,8 @@ end
define rb_classname
# up to 128bit int
- set $rb_classname = rb_mod_name($arg0)
+ set $rb_classname_permanent = "0123456789ABCDEF"
+ set $rb_classname = classname($arg0, $rb_classname_permanent)
if $rb_classname != RUBY_Qnil
rp $rb_classname
else
@@ -989,7 +855,7 @@ define iseq
end
define rb_ps
- rb_ps_vm ruby_current_vm_ptr
+ rb_ps_vm ruby_current_vm
end
document rb_ps
Dump all threads and their callstacks
@@ -997,273 +863,33 @@ end
define rb_ps_vm
print $ps_vm = (rb_vm_t*)$arg0
- 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
-Dump all threads in a (rb_vm_t*) and their callstacks
-end
-
-define print_lineno
- set $cfp = $arg0
- set $iseq = $cfp->iseq
- set $pos = $cfp->pc - $iseq->body->iseq_encoded
- if $pos != 0
- set $pos = $pos - 1
- end
-
- set $i = 0
- set $size = $iseq->body->insns_info_size
- set $table = $iseq->body->insns_info
- #printf "size: %d\n", $size
- if $size == 0
- else
- set $i = 1
- while $i < $size
- #printf "table[%d]: position: %d, line: %d, pos: %d\n", $i, $table[$i].position, $table[$i].line_no, $pos
- if $table[$i].position > $pos
- loop_break
- end
- set $i = $i + 1
- if $table[$i].position == $pos
- loop_break
- end
- end
- printf "%d", $table[$i-1].line_no
- end
-end
-
-define check_method_entry
- set $imemo = (struct RBasic *)$arg0
- if $imemo != RUBY_Qfalse
- set $type = ($imemo->flags >> 12) & 0x07
- if $type == imemo_ment
- set $me = (rb_callable_method_entry_t *)$imemo
- else
- if $type == imemo_svar
- set $imemo = ((struct vm_svar *)$imemo)->cref_or_me
- check_method_entry $imemo
- end
+ 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
- end
-end
-
-define print_id
- set $id = $arg0
- # rb_id_to_serial
- if $id > tLAST_OP_ID
- set $serial = (rb_id_serial_t)($id >> RUBY_ID_SCOPE_SHIFT)
else
- set $serial = (rb_id_serial_t)$id
- end
- if $serial && $serial <= global_symbols.last_id
- set $idx = $serial / ID_ENTRY_UNIT
- set $ids = (struct RArray *)global_symbols.ids
- set $flags = $ids->basic.flags
- if ($flags & RUBY_FL_USER1)
- set $idsptr = $ids->as.ary
- set $idslen = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
- else
- set $idsptr = $ids->as.heap.ptr
- set $idslen = $ids->as.heap.len
- end
- if $idx < $idslen
- set $t = 0
- set $ary = (struct RArray *)$idsptr[$idx]
- if $ary != RUBY_Qnil
- set $flags = $ary->basic.flags
- if ($flags & RUBY_FL_USER1)
- set $aryptr = $ary->as.ary
- set $arylen = (($flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
- else
- set $aryptr = $ary->as.heap.ptr
- set $arylen = $ary->as.heap.len
- end
- set $result = $aryptr[($serial % ID_ENTRY_UNIT) * ID_ENTRY_SIZE + $t]
- if $result != RUBY_Qnil
- print_string $result
- else
- echo undef
- end
- end
+ 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
end
end
end
-
-define print_pathobj
- set $flags = ((struct RBasic*)($arg0))->flags
- if ($flags & RUBY_T_MASK) == RUBY_T_STRING
- print_string $arg0
- end
- if ($flags & RUBY_T_MASK) == RUBY_T_ARRAY
- if $flags & RUBY_FL_USER1
- set $str = ((struct RArray*)($arg0))->as.ary[0]
- else
- set $str = ((struct RArray*)($arg0))->as.heap.ptr[0]
- end
- print_string $str
- end
+document rb_ps_vm
+Dump all threads in a (rb_vm_t*) and their callstacks
end
define rb_ps_thread
set $ps_thread = (struct RTypedData*)$arg0
- 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
- set $cfp = $ps_thread_th->ec->cfp
- set $cfpend = (rb_control_frame_t *)($ps_thread_th->ec->vm_stack + $ps_thread_th->ec->vm_stack_size)-1
- while $cfp < $cfpend
- if $cfp->iseq
- if !((VALUE)$cfp->iseq & RUBY_IMMEDIATE_MASK) && (((imemo_ifunc << RUBY_FL_USHIFT) | RUBY_T_IMEMO)==$cfp->iseq->flags & ((RUBY_IMEMO_MASK << RUBY_FL_USHIFT) | RUBY_T_MASK))
- printf "%d:ifunc ", $cfpend-$cfp
- set print symbol-filename on
- output/a $cfp->iseq.body
- set print symbol-filename off
- printf "\n"
- else
- if $cfp->pc
- set $location = $cfp->iseq->body->location
- printf "%d:", $cfpend-$cfp
- print_pathobj $location.pathobj
- printf ":"
- print_lineno $cfp
- printf ":in `"
- print_string $location.label
- printf "'\n"
- else
- printf "%d: ???.rb:???:in `???'\n", $cfpend-$cfp
- end
- end
- else
- # if VM_FRAME_TYPE($cfp->flag) == VM_FRAME_MAGIC_CFUNC
- set $ep = $cfp->ep
- if ($ep[0] & 0xffff0001) == 0x55550001
- #define VM_ENV_FLAG_LOCAL 0x02
- #define VM_ENV_PREV_EP(ep) GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL])
- set $me = 0
- set $env_specval = $ep[-1]
- set $env_me_cref = $ep[-2]
- while ($env_specval & 0x02) != 0
- check_method_entry $env_me_cref
- if $me != 0
- loop_break
- end
- set $ep = $ep[0]
- set $env_specval = $ep[-1]
- set $env_me_cref = $ep[-2]
- end
- if $me == 0
- check_method_entry $env_me_cref
- end
- printf "%d:", $cfpend-$cfp
- set print symbol-filename on
- output/a $me->def->body.cfunc.func
- set print symbol-filename off
- set $mid = $me->def->original_id
- printf ":in `"
- print_id $mid
- printf "'\n"
- else
- printf "%d:unknown_frame:???:in `???'\n", $cfpend-$cfp
- end
- end
- set $cfp = $cfp + 1
- end
-end
-
-define rb_count_objects
- set $objspace = ruby_current_vm_ptr->objspace
- set $counts_00 = 0
- set $counts_01 = 0
- set $counts_02 = 0
- set $counts_03 = 0
- set $counts_04 = 0
- set $counts_05 = 0
- set $counts_06 = 0
- set $counts_07 = 0
- set $counts_08 = 0
- set $counts_09 = 0
- set $counts_0a = 0
- set $counts_0b = 0
- set $counts_0c = 0
- set $counts_0d = 0
- set $counts_0e = 0
- set $counts_0f = 0
- set $counts_10 = 0
- set $counts_11 = 0
- set $counts_12 = 0
- set $counts_13 = 0
- set $counts_14 = 0
- set $counts_15 = 0
- set $counts_16 = 0
- set $counts_17 = 0
- set $counts_18 = 0
- set $counts_19 = 0
- set $counts_1a = 0
- set $counts_1b = 0
- set $counts_1c = 0
- set $counts_1d = 0
- set $counts_1e = 0
- set $counts_1f = 0
- set $total = 0
- set $i = 0
- while $i < $objspace->heap_pages.allocated_pages
- printf "\rcounting... %d/%d", $i, $objspace->heap_pages.allocated_pages
- set $page = $objspace->heap_pages.sorted[$i]
- set $p = $page->start
- set $pend = $p + $page->total_slots
- while $p < $pend
- set $flags = $p->as.basic.flags & 0x1f
- eval "set $counts_%02x = $counts_%02x + 1", $flags, $flags
- set $p = $p + 1
- end
- set $total = $total + $page->total_slots
- set $i = $i + 1
- end
- printf "\rTOTAL: %d, FREE: %d\n", $total, $counts_00
- printf "T_OBJECT: %d\n", $counts_01
- printf "T_CLASS: %d\n", $counts_02
- printf "T_MODULE: %d\n", $counts_03
- printf "T_FLOAT: %d\n", $counts_04
- printf "T_STRING: %d\n", $counts_05
- printf "T_REGEXP: %d\n", $counts_06
- printf "T_ARRAY: %d\n", $counts_07
- printf "T_HASH: %d\n", $counts_08
- printf "T_STRUCT: %d\n", $counts_09
- printf "T_BIGNUM: %d\n", $counts_0a
- printf "T_FILE: %d\n", $counts_0b
- printf "T_DATA: %d\n", $counts_0c
- printf "T_MATCH: %d\n", $counts_0d
- printf "T_COMPLEX: %d\n", $counts_0e
- printf "T_RATIONAL: %d\n", $counts_0f
- #printf "UNKNOWN_10: %d\n", $counts_10
- printf "T_NIL: %d\n", $counts_11
- printf "T_TRUE: %d\n", $counts_12
- printf "T_FALSE: %d\n", $counts_13
- printf "T_SYMBOL: %d\n", $counts_14
- printf "T_FIXNUM: %d\n", $counts_15
- printf "T_UNDEF: %d\n", $counts_16
- #printf "UNKNOWN_17: %d\n", $counts_17
- #printf "UNKNOWN_18: %d\n", $counts_18
- #printf "UNKNOWN_19: %d\n", $counts_19
- printf "T_IMEMO: %d\n", $counts_1a
- printf "T_NODE: %d\n", $counts_1b
- printf "T_ICLASS: %d\n", $counts_1c
- printf "T_ZOMBIE: %d\n", $counts_1d
- #printf "UNKNOWN_1E: %d\n", $counts_1e
- printf "T_MASK: %d\n", $counts_1f
-end
-document rb_count_objects
- Counts all objects grouped by type.
+ set $ps_thread_id = $arg1
+ print $ps_thread_th = (rb_thread_t*)$ps_thread->data
end
# Details: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/MachineInstructionsTraceWithGDB
@@ -1282,26 +908,3 @@ 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
-
-define dump_node
- set $str = rb_parser_dump_tree($arg0, 0)
- set $flags = ((struct RBasic*)($str))->flags
- printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
- ((struct RString*)$str)->as.heap.ptr : \
- ((struct RString*)$str)->as.ary)
-end
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 6ca2f89462..0000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,6 +0,0 @@
-*.gemspec diff=ruby
-*.rb diff=ruby
-bin svn-properties=svn:ignore=ruby
-bin/* diff=ruby
-tool/update-deps diff=ruby
-tool/make-snapshot diff=ruby
diff --git a/.gitignore b/.gitignore
index efc7fd5864..9515852837 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,58 +1,44 @@
*-*-*.def
-*-*-*.exp
-*-*-*.lib
*.a
*.bak
-*.bc
*.dSYM
*.dmyh
*.dylib
*.elc
-*.i
*.inc
*.log
*.o
-*.obj
-*.old
*.orig
-*.pdb
*.rej
-*.s
*.sav
*.swp
-*.yarb
*~
.*-*
.*.list
.*.time
.DS_Store
-.bundle
.ccmalloc
.ext
.pc
.ppack
.svn
Makefile
-cygruby*.def
+Makefile.old
extconf.h
y.output
y.tab.c
-*.gcda
-*.gcno
-*.gcov
-lcov*.info
# /
/*-fake.rb
-/*.dll
-/*.exe
-/*.res
/*.pc
-/*.rc
/*_prelude.c
/COPYING.LIB
+/ChangeLog-*
+/ChangeLog.pre-alpha
+/ChangeLog.pre1_1
/Doxyfile
/GNUmakefile
+/GNUmakefile.old
/README.atheos
/README.fat-patch
/README.v6
@@ -70,8 +56,6 @@ lcov*.info
/config.status.lineno
/configure
/coverage/simplecov
-/coverage/simplecov-html
-/coverage/doclie
/coverage/.last_run.json
/coverage/.resultset.json*
/coverage/assets
@@ -83,9 +67,6 @@ lcov*.info
/goruby
/id.[ch]
/largefile.h
-/lcov-c-out
-/lcov-rb-out
-/lcov-out
/lex.c
/libruby*.*
/miniprelude.c
@@ -101,7 +82,6 @@ lcov*.info
/ppack
/prelude.c
/preview
-/probes.dmyh
/probes.h
/rbconfig.rb
/rename2.h
@@ -110,63 +90,36 @@ lcov*.info
/riscos
/rubicon
/ruby
-/ruby-runner
-/ruby-runner.h
/ruby-man.rd.gz
-/run.gdb
/sizes.c
/test.rb
-/test-coverage.dat
/tmp
/transdb.h
/uncommon.mk
/verconf.h
-/verconf.mk
/web
/yasmdata.rb
# /benchmark/
-/benchmark/bm_require.data
/benchmark/bmx_*.rb
/benchmark/fasta.output.*
/benchmark/wc.input
-/enc/*.def
-/enc/*.exp
-/enc/*.lib
-/enc/jis/props.h
-/enc/unicode/data
-
# /enc/trans/
/enc/trans/*.c
-/enc/trans/*.def
-/enc/trans/*.exp
-/enc/trans/*.lib
-/enc/trans/.time
-
-# /exe/
-/exe/ruby
-/exe/.time
# /ext/
/ext/extinit.c
-/ext/configure-ext.mk
-/ext/*/exts.mk
-# /ext/-test-/win32/dln/
-/ext/-test-/win32/dln/dlntest.dll
-/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
-/ext/rbconfig/sizeof/limits.c
# /ext/ripper/
/ext/ripper/eventids1.c
@@ -180,13 +133,15 @@ lcov*.info
/ext/socket/constdefs.h
/ext/socket/constdefs.c
+# /ext/tk/
+/ext/tk/config_list
+
# /gems
/gems/*.gem
-/gems/src
-/gems/*-*
-# /spec/bundler
-/.rspec_status
+# /spec/
+/spec/mspec
+/spec/rubyspec
# /tool/
/tool/config.guess
diff --git a/.travis.yml b/.travis.yml
index a9117d190f..d39c72b0f9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,88 +16,71 @@
#
# is also a good place to look at.
+# Language specification.
language: c
-dist: trusty
-
-# temporary workaround for https://github.com/travis-ci/travis-ci/issues/8892
-sudo: required
-group: deprecated-2017Q4
+# 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:
- - "CONFIG_FLAG="
- - "JOBS=-j`nproc`"
+ - "sudo apt-get -qq update"
+ - "sudo apt-get -qq install $CC" # upgrade if any
+install: "sudo apt-get -qq build-dep ruby1.9.1 2>/dev/null"
+# Script is where the test runs. Note we just do "make test", not other tests
+# like test-all, test-rubyspec. This is because they take too much time,
+# enough for Travis to shut down the VM as being stalled.
before_script:
- - "echo JOBS=$JOBS"
- "uname -a"
- "uname -r"
- "rm -fr .ext autom4te.cache"
- - "echo $TERM"
- - "> config.status"
- - "sed -f tool/prereq.status Makefile.in common.mk > Makefile"
- - "make update-config_files"
- - "make touch-unicode-files"
- - "make -s $JOBS srcs UNICODE_FILES=."
- - "requests=; for req in ${RUBYSPEC_PULL_REQUEST//,/ }; do
- requests=\"$requests +refs/pull/$req/merge:\";
- done"
- - "${requests:+git -C spec/ruby -c user.email=none -c user.name=none pull --no-edit origin $requests}"
- - "${requests:+git -C spec/ruby log --oneline origin/master..@}"
- - "rm config.status Makefile rbconfig.rb .rbconfig.time"
- - "mkdir build config_1st config_2nd"
- - "chmod -R a-w ."
- - "chmod u+w build config_1st config_2nd"
- - "cd build"
- - "../configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG"
- - "cp -pr config.cache config.status .ext/include ../config_1st"
+ - "make -f common.mk BASERUBY=ruby srcdir=. update-config_files"
+ - "autoconf"
+ - "mkdir config_1st config_2nd"
+ - "./configure -C --with-gcc=$CC"
+ - "cp -pr config.status .ext/include config_1st"
- "make reconfig"
- - "cp -pr config.cache config.status .ext/include ../config_2nd"
- - "(cd .. && exec diff -ru config_1st config_2nd)"
- - "make -s $JOBS"
-
+ - "cp -pr config.status .ext/include config_2nd"
+ - "diff -ru config_1st config_2nd"
+ - "make -sj encs"
+ - "make -sj exts"
script:
- - "make -s test TESTOPTS=--color=never"
- - "make -s $JOBS test-all -o exts TESTOPTS='-q --color=never --job-status=normal'"
- - "make -s $JOBS test-spec MSPECOPT=-j"
+ - "make test OPTS=-v"
+ - "make test-all TESTS='-qv -j2'"
# 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
- - ruby_2_4
- - ruby_2_5
- - /^feature\//
- - /^bug\//
# We want to be notified when something happens.
notifications:
irc:
channels:
- - "chat.freenode.net#ruby-core"
- - "chat.freenode.net#ruby-ja"
+ - "irc.freenode.org#ruby-core"
+ - "irc.freenode.org#ruby-ja"
on_success: change # [always|never|change] # default: always
- on_failure: always # [always|never|change] # default: always
+ on_failure: change # [always|never|change] # default: always
template:
- "%{message} by @%{author}: See %{build_url}"
- slack:
- rooms:
- - secure: i1GLETSKye85ea6dGNA3MxI/5myChmMFiZtBd5C69xK+s1sBFqEgOSbaSf9KHc0CYrHVyNhQMaZRruieV7xS+6Pfs0Zvxf1DO6QQTWC2KhkqwFDLvZncAzjoyASdR90hbr+iRPOngQ+HJuE94zemALAwEqNAinzA74PMiJXktqY= # ruby:<token>#commits
- - secure: ah7UEHBvncXT7bM5mvYIQAO+tIyV/wl7nXLb7wQD16dO2v8Gragy0mWjB79Q09hrrMGmp6H9bCDpdGS80boIA5EHaHoG4QaP0i9bsSt8U2AMWgZtfyIgQKJ4H2kXkGlrjO+AXTgnIkP7LNjdgAVUUTGQPb26T3QmoN2Splt+fIQ= # ruby:<token>#alerts
- on_pull_requests: false
- on_success: change
- on_failure: always
-
- email:
- - ko1c-failure@atdot.net
+ # Update ruby-head installed on Travis CI so other projects can test against it.
+ webhooks:
+ urls:
+ - "https://rubies.travis-ci.org/rebuild/ruby-head"
+ on_success: always
+ on_failure: never
# Local Variables:
# mode: YAML
diff --git a/COPYING b/COPYING
index f06056fb45..a1f19ff99d 100644
--- a/COPYING
+++ b/COPYING
@@ -11,8 +11,8 @@ You can redistribute it and/or modify it under either the terms of the
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.
+ 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.
@@ -26,11 +26,11 @@ You can redistribute it and/or modify it under either the terms of the
provided that you do at least ONE of the following:
a) distribute the binaries and library files of the software,
- together with instructions (in the manual page or equivalent)
- on where to get the original distribution.
+ 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.
+ the software.
c) give non-standard binaries non-standard names, with
instructions on where to get the original software distribution.
@@ -44,9 +44,9 @@ You can redistribute it and/or modify it under either the terms of the
For the list of those files and their copying conditions, see the
file LEGAL.
- 5. The scripts and library files supplied as input to or produced as
+ 5. The scripts and library files supplied as input to or produced as
output from the software do not automatically fall under the
- copyright of the software, but belong to whomever generated them,
+ copyright of the software, but belong to whomever generated them,
and may be sold commercially, and may be aggregated with this
software.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000000..dc0c1aed39
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,8211 @@
+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/KNOWNBUGS.rb b/KNOWNBUGS.rb
index 35a8e75876..b97a08d928 100644
--- a/KNOWNBUGS.rb
+++ b/KNOWNBUGS.rb
@@ -1,7 +1,5 @@
#
-# 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.
+# This test file concludes tests which point out known bugs.
# So all tests will cause failure.
#
+
diff --git a/LEGAL b/LEGAL
index 0479751691..24e36e6231 100644
--- a/LEGAL
+++ b/LEGAL
@@ -12,7 +12,7 @@ ccan/str/str.h
These files are licensed under the CC0.
- https://creativecommons.org/choose/zero/
+ http://creativecommons.org/choose/zero/
ccan/list/list.h
@@ -36,7 +36,6 @@ ccan/list/list.h
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-include/ruby/onigmo.h:
include/ruby/oniguruma.h:
regcomp.c:
regenc.[ch]:
@@ -82,114 +81,15 @@ enc/utf_32le.c
enc/utf_8.c
enc/windows_1251.c
-Onigmo (Oniguruma-mod) LICENSE
-------------------------------
+Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
-/*-
- * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2014 K.Takata <kentkt AT csc DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-Oniguruma LICENSE
------------------
-
-/*-
- * Copyright (c) 2002-2009 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.
- */
-
-https://github.com/k-takata/Onigmo/
-https://github.com/kkos/oniguruma
-https://svnweb.freebsd.org/ports/head/devel/oniguruma/
+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,
this of Ruby follows the license of Ruby.
-enc/trans/GB/GB12345%UCS.src:
-enc/trans/GB/UCS%GB12345.src:
-enc/trans/GB/GB2312%UCS.src:
-enc/trans/GB/UCS%GB2312.src:
-
- This mapping data was created from files provided by Unicode, Inc.
- (The Unicode Consortium). The files were used to create a product supporting
- Unicode, as explicitly permitted in the files' copyright notices.
- Please note that Unicode, Inc. never made any claims as to fitness of these
- files for any particular purpose, and has ceased to publish the files many
- years ago.
-
-enc/trans/JIS/JISX0201-KANA%UCS.src:
-enc/trans/JIS/JISX0208@1990%UCS.src:
-enc/trans/JIS/JISX0212%UCS.src:
-enc/trans/JIS/UCS%JISX0201-KANA.src:
-enc/trans/JIS/UCS%JISX0208@1990.src:
-enc/trans/JIS/UCS%JISX0212.src:
-
- © 2015 Unicode®, Inc.
- For terms of use, see http://www.unicode.org/terms_of_use.html
-
-enc/trans/JIS/JISX0213-1%UCS@BMP.src:
-enc/trans/JIS/JISX0213-1%UCS@SIP.src:
-enc/trans/JIS/JISX0213-2%UCS@BMP.src:
-enc/trans/JIS/JISX0213-2%UCS@SIP.src:
-
- Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
- Copyright (C) 2001 I'O, All Rights Reserved.
- Copyright (C) 2006 Project X0213, All Rights Reserved.
- You can use, modify, distribute this table freely.
-
-enc/trans/JIS/UCS@BMP%JISX0213-1.src:
-enc/trans/JIS/UCS@BMP%JISX0213-2.src:
-enc/trans/JIS/UCS@SIP%JISX0213-1.src:
-enc/trans/JIS/UCS@SIP%JISX0213-2.src:
-
- Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
- Copyright (C) 2001 I'O, All Rights Reserved.
- You can use, modify, distribute this table freely.
-
configure:
This file is free software.
@@ -362,37 +262,33 @@ random.c
http://www.math.keio.ac.jp/matumoto/emt.html
email: matumoto@math.keio.ac.jp
- The Wayback Machine url: http://web.archive.org/web/19990429082237/http://www.math.keio.ac.jp/matumoto/emt.html
-
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 $
+ * 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:
@@ -434,10 +330,7 @@ vsnprintf.c:
From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
paragraph 3 above is now null and void.
-st.c:
-strftime.c:
-include/ruby/st.h:
-missing/acosh.c:
+st.[ch]:
missing/alloca.c:
missing/dup2.c:
missing/erf.c:
@@ -449,13 +342,10 @@ missing/lgamma_r.c:
missing/memcmp.c:
missing/memmove.c:
missing/strchr.c:
-missing/strerror.c:
missing/strstr.c:
+missing/strtol.c:
missing/tgamma.c:
-ext/date/date_strftime.c:
ext/digest/sha1/sha1.[ch]:
-ext/sdbm/_sdbm.c:
-ext/sdbm/sdbm.h:
These files are all under public domain.
@@ -531,21 +421,32 @@ missing/setproctitle.c
missing/strlcat.c
missing/strlcpy.c
- These files are under an ISC-style license.
-
- Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ These files are under the new-style BSD license.
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ All rights reserved.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ 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
@@ -626,28 +527,6 @@ ext/digest/sha2/sha2.[ch]:
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-ext/json/generator/generator.c:
-
- Copyright 2001-2004 Unicode, Inc.
-
- Disclaimer
-
- This source code is provided as is by Unicode, Inc. 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
- purchased on magnetic or optical media from Unicode, Inc., the
- sole remedy for any claim will be exchange of defective media
- within 90 days of receipt.
-
- Limitations on Rights to Redistribute This Code
-
- Unicode, Inc. hereby grants the right to freely use the information
- supplied in this file in the creation of products supporting the
- Unicode Standard, and to make copies of this file in any form
- for internal or external distribution as long as this notice
- remains attached.
-
ext/nkf/nkf-utf8/config.h:
ext/nkf/nkf-utf8/nkf.c:
ext/nkf/nkf-utf8/utf8tbl.c:
@@ -664,51 +543,6 @@ ext/nkf/nkf-utf8/utf8tbl.c:
You don't have to ask before copying, redistribution or publishing.
THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
-ext/psych:
-test/psych:
-
- Copyright 2009 Aaron Patterson, et al.
-
- 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.
-
-ext/psych/yaml:
-
- Copyright (c) 2006 Kirill Simonov
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-
ext/socket/addrinfo.h:
ext/socket/getaddrinfo.c:
ext/socket/getnameinfo.c:
@@ -756,95 +590,3 @@ ext/win32ole/win32ole.c:
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.
-
- The Wayback Machine url: http://web.archive.org/web/19970607104352/http://www.activeware.com:80/
-
-lib/rdoc/generator/template/darkfish/css/fonts.css:
-
- This file is licensed under the SIL Open Font License.
-
- http://scripts.sil.org/OFL
-
-spec/mspec:
-spec/ruby:
-
- Copyright (c) 2008 Engine Yard, Inc. All rights reserved.
-
- 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.
-
-lib/rubygems.rb:
-lib/rubygems:
-test/rubygems:
-
- RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim
- Weirich and others. You can redistribute it and/or modify it under
- either the terms of the MIT license (see the file MIT.txt), 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. 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.
-
- 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. The scripts and library files supplied as input to or produced as
- output from the software do not automatically fall under the
- copyright of the software, but belong to whomever generated them,
- and may be sold commercially, and may be aggregated with this
- software.
-
- 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE.
diff --git a/Makefile.in b/Makefile.in
index 25075f5900..39fe0bb37f 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,12 +22,9 @@ LD = @LD@
YACC = bison
PURIFY =
AUTOCONF = autoconf
-ACLOCAL = aclocal
-CONFIGURE = @CONFIGURE@
@SET_MAKE@
MKFILES = @MAKEFILES@
BASERUBY = @BASERUBY@
-HAVE_BASERUBY = @HAVE_BASERUBY@
TEST_RUNNABLE = @TEST_RUNNABLE@
CROSS_COMPILING = @CROSS_COMPILING@
DOXYGEN = @DOXYGEN@
@@ -53,7 +50,7 @@ DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
EXTOUT = @EXTOUT@
arch_hdrdir = $(EXTOUT)/include/$(arch)
-VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
empty =
CC_VERSION = @CC_VERSION@
@@ -67,6 +64,7 @@ optflags = @optflags@
debugflags = @debugflags@
warnflags = @warnflags@ @strict_warnflags@
cppflags = @cppflags@
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
XCFLAGS = @XCFLAGS@
CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
@@ -75,11 +73,9 @@ XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
-ENABLE_SHARED = @ENABLE_SHARED@
LDSHARED = @LIBRUBY_LDSHARED@
DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
SOLIBS = @SOLIBS@
-ENABLE_DEBUG_ENV = @ENABLE_DEBUG_ENV@
MAINLIBS = @MAINLIBS@
ARCHMINIOBJS = @MINIOBJS@
DLNOBJ = @DLNOBJ@
@@ -92,7 +88,6 @@ POSTLINK = @POSTLINK@
RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
-RUBY_API_VERSION=@RUBY_API_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
EXEEXT = @EXEEXT@
@@ -117,18 +112,15 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
XRUBY_LIBDIR = @XRUBY_LIBDIR@
XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
-BOOTSTRAPRUBY = @BOOTSTRAPRUBY@
#### End of system configuration section. ####
MAJOR= @MAJOR@
MINOR= @MINOR@
TEENY= @TEENY@
-RUBY_PROGRAM_VERSION = @RUBY_PROGRAM_VERSION@
LIBRUBY_A = @LIBRUBY_A@
LIBRUBY_SO = @LIBRUBY_SO@
-LIBRUBY_SONAME= @LIBRUBY_SONAME@
LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
LIBRUBY = @LIBRUBY@
LIBRUBYARG = @LIBRUBYARG@
@@ -137,19 +129,6 @@ 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@
@@ -168,7 +147,7 @@ RMDIRS = @RMDIRS@
RMALL = @RMALL@
NM = @NM@
AR = @AR@
-ARFLAGS = @ARFLAGS@$(empty)
+ARFLAGS = rcu
RANLIB = @RANLIB@
AS = @AS@
ASFLAGS = @ASFLAGS@ $(INCFLAGS)
@@ -176,32 +155,25 @@ IFCHANGE = $(srcdir)/tool/ifchange
SET_LC_MESSAGES = env LC_MESSAGES=C
OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@
-HAVE_GIT = @HAVE_GIT@
-GIT = @GIT@
VCS = @VCS@
VCSUP = @VCSUP@
-DTRACE = @DTRACE@ @DTRACE_OPT@
+DTRACE = @DTRACE@
DTRACE_EXT = @DTRACE_EXT@
-DTRACE_OBJ = @DTRACE_OBJ@
-DTRACE_REBUILD= @DTRACE_REBUILD@
-DTRACE_GLOMMED_OBJ = $(DTRACE_REBUILD:yes=ruby-glommed.$(OBJEXT))
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_GLOMMED_OBJ = @DTRACE_GLOMMED_OBJ@
OBJEXT = @OBJEXT@
ASMEXT = S
-SOEXT = @SOEXT@
DLEXT = @DLEXT@
MANTYPE = @MANTYPE@
SYMBOL_PREFIX = @SYMBOL_PREFIX@
INSTALLED_LIST= .installed.list
-NEWLINE_C = enc/trans/newline.c
+NEWLINE_C = newline.c
MINIPRELUDE_C = miniprelude.c
-PRELUDE_C = prelude.c
RBCONFIG = .rbconfig.time
-MAINSRC = $(MAINOBJ:@OBJEXT@=c)
-
SRC_FILE = $<
OS_SRC_FILE = $<
DEST_FILE = $@
@@ -227,8 +199,7 @@ all:
miniruby$(EXEEXT):
@-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
- $(Q) $(POSTLINK)
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT) $(DTRACE_OBJ) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
$(PROGRAM):
@$(RM) $@
@@ -242,36 +213,29 @@ $(PROGRAM):
$(LIBRUBY_A):
@$(RM) $@
$(ECHO) linking static-library $@
- $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(INITOBJS)
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)
@-$(RANLIB) $@ 2> /dev/null || true
-
-verify-static-library: $(LIBRUBY_A)
$(ECHO) verifying static-library $@
@$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
- @$(RMALL) conftest$(EXEEXT) conftest.c conftest.dSYM
+ @$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
- $(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_*' -L '$(SYMBOL_PREFIX)*_ec_*' $@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(DTRACE_OBJ) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
+ -$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -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.h: template/ruby-runner.h.in
- @./config.status --file=$@:$(srcdir)/template/$(@F).in
-
-$(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
@@ -307,25 +271,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 = 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-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
reconfig-exec-1 = set -x; "$$@"
-reconfig config.status: $(srcdir)/$(CONFIGURE) $(srcdir)/enc/Makefile.in \
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
$(srcdir)/include/ruby/version.h
@PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
set $(SHELL) $($@-args); $(reconfig-exec-$(V))
-$(srcdir)/$(CONFIGURE): $(srcdir)/configure.ac $(srcdir)/aclocal.m4
- $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F)
-
-$(srcdir)/aclocal.m4:
- $(CHDIR) $(srcdir) && \
- type $(ACLOCAL) >/dev/null 2>&1 && exec $(ACLOCAL); \
- touch $(@F)
-
-prereq: $(srcdir)/$(CONFIGURE)
+$(srcdir)/configure: $(srcdir)/configure.in
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF)
incs: id.h
all-incs: probes.h
@@ -344,17 +301,34 @@ lex.c: defs/keywords
$(CP) $(srcdir)/lex.c.blt $@; \
else \
[ $(Q) ] && echo generating $@ || set -x; \
- gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \
- | sed -f $(srcdir)/tool/gperf.sed \
- > $@.tmp && \
+ gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
$(MV) $@.tmp $@ && \
$(CP) $? $(srcdir)/defs/lex.c.src && \
$(CP) $@ $(srcdir)/lex.c.blt; \
fi
+NAME2CTYPE_OPTIONS = -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p
+
+enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
+ $(MAKEDIRS) $(@D)
+ @set +e; \
+ if cmp -s $(?:.kwd=.src) $?; then \
+ set -x; \
+ $(CP) $(?:.kwd=.h.blt) $@; \
+ else \
+ trap '$(RM) $@-1.h $@-2.h' 0 && \
+ set -x; \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-1.h && \
+ sed '/^#ifdef USE_UNICODE_PROPERTIES/d;/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-2.h && \
+ diff -DUSE_UNICODE_PROPERTIES $@-1.h $@-2.h > $@.tmp || :; \
+ $(MV) $@.tmp $@ && \
+ $(CP) $? $(?:.kwd=.src) && \
+ $(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
-$(srcdir)/enc/jis/props.h: enc/jis/props.kwd
+enc/jis/props.h: enc/jis/props.kwd
$(MAKEDIRS) $(@D)
@set +e; \
if cmp -s $(?:.kwd=.src) $?; then \
@@ -363,7 +337,7 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.kwd
else \
set -x; \
gperf $(JIS_PROPS_OPTIONS) $? | \
- sed -f $(srcdir)/tool/gperf.sed > $@ && \
+ 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
@@ -387,37 +361,37 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.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/RUBY_PROBES_H/' -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/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp
.dmyh.h:
- @$(ECHO) making dummy $(DEST_FILE)
- $(Q)echo '#include "$(*F).dmyh"' > $@
-
-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 $@
+ @$(ECHO) copying dummy $(DEST_FILE)
+ $(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE)
-probes.@OBJEXT@: $(srcdir)/probes.d $(DTRACE_REBUILD:yes=probes.stamp)
+probes.@OBJEXT@: $(srcdir)/probes.d
@$(ECHO) processing probes in object files
- $(Q) $(RM) $@
- $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
+ $(Q) stamp="$*.stamp"; \
+ if test -f "$$stamp" -o -f "$@"; then \
+ $(RM) $(DTRACE_DEPENDENT_OBJS) "$$stamp"; \
+ for o in $(DTRACE_DEPENDENT_OBJS); do \
+ echo "rebuilding $$o which was modified by \"dtrace -G\""; \
+ $(MAKE) "$$o"; \
+ done; \
+ fi; \
+ touch "$$stamp"
+ $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS)
# DTrace static library hacks described here:
# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
ruby-glommed.$(OBJEXT):
@$(ECHO) generating a glommed object with DTrace probes for static library
- $(Q) $(LD) -r -o $@ $(OBJS)
+ $(Q) $(LD) -r -o $@ $(OBJS) $(DTRACE_OBJ)
clean-local::
$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
enc/encinit.c enc/encinit.$(OBJEXT)
-$(Q)$(RM) $(pkgconfig_DATA)
- -$(Q)$(RMALL) exe/ ruby-runner.h *.dSYM
distclean-local::
$(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
@@ -425,48 +399,33 @@ distclean-local::
-$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
-$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
-ext/clean.sub gems/clean.sub:: ext/clean.mk
-ext/distclean.sub gems/distclean.sub:: ext/distclean.mk
-ext/realclean.sub gems/realclean.sub:: ext/realclean.mk
-
-ext/clean.mk ext/distclean.mk ext/realclean.mk::
- -$(Q) if [ -f $(EXTS_MK) ]; then exec $(MAKE) -f $(EXTS_MK) $(@F:.mk=); fi
-
-ext/clean:: ext/clean.sub
-ext/distclean:: ext/distclean.sub
-ext/realclean:: ext/realclean.sub
-gems/clean:: gems/clean.sub
-gems/distclean:: gems/distclean.sub
-gems/realclean:: gems/realclean.sub
-
-ext/clean.sub ext/distclean.sub ext/realclean.sub \
-gems/clean.sub gems/distclean.sub gems/realclean.sub::
- $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \
+clean-ext distclean-ext realclean-ext::
+ @cd ext 2>/dev/null || exit 0; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
test "$$#" = 0 && set .; \
set dummy `\
- cd $(@D) 2>/dev/null && \
- find "$$@" \( -name Makefile -o -name exts.mk \) -print | \
- sed -n 's:^\./::;s:^:$(@D)/:;s:/[^/][^/]*$$::p' | sort -u; \
+ find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
`; shift; \
+ cd ..; \
for dir do \
- $(RM) "$$dir/exts.mk"; \
- if [ -f "$$dir/Makefile" ]; then \
- echo $(@F:.sub=)ing "$$dir"; \
- (cd "$$dir" && exec $(MAKE) $(mflags) $(@F:.sub=)); \
- fi; \
- done || true
-
-ext/distclean ext/realclean gems/distclean gems/realclean::
- $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \
- test "$$#" = 0 && set .; \
- cd $(@D) 2>/dev/null && \
- find "$$@" -type d -empty -exec $(RMDIRS) {} + 2> /dev/null || true
- $(Q) $(RMDIRS) $(@D) 2> /dev/null || true
+ echo $(@:-ext=)ing "$$dir"; \
+ (cd "ext/$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \
+ case "$@" in \
+ *distclean-ext*|*realclean-ext*) \
+ $(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
+ esac; \
+ done
+ -$(Q)$(RM) ext/extinit.$(OBJEXT)
+
+distclean-ext realclean-ext::
+ -$(Q)$(RM) ext/extinit.c
+ -$(Q)$(RMDIR) ext 2> /dev/null || true
+
+clean-extout:
clean-enc distclean-enc realclean-enc:
@test -f "$(ENC_MK)" || exit 0; \
echo $(@:-enc=ing) encodings; \
- exec $(MAKE) $(MAKE_ENC) $(@:-enc=)
+ exec $(MAKE) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(ECHO) compiling $@
@@ -474,41 +433,49 @@ ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
-test-bundled-gems-run:
- $(Q) set -e; while read gem _; do \
- echo testing $$gem gem && \
- $(XRUBY) -C $(srcdir)/gems/src/$$gem -Ilib ../../../.bundle/bin/rake; \
- done < $(srcdir)/gems/bundled_gems
-
-update-src::
+up::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
-update-download:: update-config_files
+up::
+ -$(Q)$(MAKE) $(MFLAGS) after-update
-after-update:: prereq
+after-update:: update-config_files
-gcov:
- $(Q) $(BASERUBY) $(srcdir)/tool/run-gcov.rb
-
-lcov:
- $(Q) $(BASERUBY) $(srcdir)/tool/run-lcov.rb
-
-update-doclie:
- $(Q) $(srcdir)/tool/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \
- --branch $(DOCLIE_GIT_REF) \
- $(DOCLIE_GIT_URL) doclie $(GIT_OPTS)
+update-mspec:
+ @$(CHDIR) $(srcdir); \
+ if [ -d spec/mspec ]; then \
+ cd spec/mspec; \
+ echo updating mspec ...; \
+ exec git pull; \
+ else \
+ echo retrieving mspec ...; \
+ exec git clone $(MSPEC_GIT_URL) spec/mspec; \
+ fi
-update-simplecov-html:
- $(Q) $(srcdir)/tool/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \
- --branch $(SIMPLECOV_HTML_GIT_REF) \
- $(SIMPLECOV_HTML_GIT_URL) simplecov-html $(GIT_OPTS)
+update-rubyspec: update-mspec
+ @$(CHDIR) $(srcdir); \
+ if [ -d spec/rubyspec ]; then \
+ cd spec/rubyspec; \
+ echo updating rubyspec ...; \
+ exec git pull; \
+ else \
+ echo retrieving rubyspec ...; \
+ exec git clone $(RUBYSPEC_GIT_URL) spec/rubyspec; \
+ fi
-update-simplecov:
- $(Q) $(srcdir)/tool/git-refresh -C $(srcdir)/coverage $(Q1:0=-q) \
- --branch $(SIMPLECOV_GIT_REF) \
- $(SIMPLECOV_GIT_URL) simplecov $(GIT_OPTS)
+test-rubyspec-precheck:
+ @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
-update-coverage: update-simplecov update-simplecov-html update-doclie
+update-coverage:
+ @$(CHDIR) $(srcdir); \
+ if [ -d coverage/simplecov ]; then \
+ cd coverage/simplecov; \
+ echo updating simplecov ...; \
+ exec git pull; \
+ else \
+ echo retrieving simplecov ...; \
+ exec git clone $(SIMPLECOV_GIT_URL) coverage/simplecov; \
+ fi
INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \
vmtc.inc vm.inc
@@ -519,13 +486,7 @@ $(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' \
-e '/^ /!d;s/ *"\\0"$$//;s/" *"//g'
-
-un-runnable:
- $(ECHO) cannot make runnable, configure with --enable-load-relative.
- $(Q) exit 1
diff --git a/NEWS b/NEWS
index e1b91f38b7..6abfa3fc50 100644
--- a/NEWS
+++ b/NEWS
@@ -1,577 +1,255 @@
# -*- rdoc -*-
-= NEWS for Ruby 2.5.0
+= 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 or Redmine
-(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
+with all sufficient information, see the ChangeLog file.
-== Changes since the 2.4.0 release
+== Changes since the 2.1.0 release
=== Language changes
-* Top-level constant look-up is removed. [Feature #11547]
-
-* rescue/else/ensure are allowed inside do/end blocks. [Feature #12906]
-
-* refinements take place in string interpolations. [Feature #13812]
+* nil/true/false
+ * nil/true/false objects are frozen. [Feature #8923]
=== Core classes updates (outstanding ones only)
-* Array
-
+* Binding
* New methods:
-
- * Array#append [Feature #12746]
- * Array#prepend [Feature #12746]
-
-* Data
-
- * Is deprecated. It was a base class for C extensions, and it's not
- necessary to expose in Ruby level. [Feature #3072]
-
-* Exception
-
- * New methods:
-
- * Exception#full_message to retrieve a String expression of an exception,
- formatted in the same way in which Ruby prints out an uncaught exception.
- [Feature #14141] [experimental]
+ * Binding#local_variables
+ * Binding#receiver
* Dir
-
- * Dir.glob provides new optional keyword argument, :base.
- [Feature #13056]
- * Dir.chdir (without block arg), Dir.open, Dir.new, Dir.mkdir, Dir.rmdir,
- Dir.empty? releases GVL
-
* New methods:
-
- * Dir.children [Feature #11302]
- * Dir.each_child [Feature #11302]
+ * Dir#fileno
* Enumerable
-
- * Enumerable#{any?,all?,none?,one?} accept a pattern argument [Feature #11286]
-
-* File
-
- * File.open accepts :newline option to imply text mode. [Bug #13350]
- * File#path raises an IOError for files opened with
- File::Constants::TMPFILE option. [Feature #13568]
- * File.stat, File.exist?, and other rb_stat()-using methods release GVL
- [Bug #13941]
- * File.rename releases GVL [Feature #13951]
- * File::Stat#{atime,mtime,ctime} support fractional second timestamps on
- Windows 8 and later [Feature #13726]
- * File::Stat#ino and File.indentical? support ReFS 128bit ino on Windows 8.1
- and later [Feature #13731]
- * File.readable?, File.readable_real?, File.writable?, File.writable_real?,
- File.executable?, File.executable_real?, File.mkfifo, File.readlink,
- File.truncate, File#truncate, File.chmod, File.lchmod, File.chown,
- File.lchown, File.unlink, File.utime, File.lstat release GVL
-
- * New method:
-
- * File.lutime [Feature #4052]
-
-* Exception
-
- * Exception#full_message takes :highlight and :order options [Bug #14324]
-
-* Hash
-
* New methods:
+ * Enumerable#slice_after
+ * Extended methods:
+ * min, min_by, max and max_by supports optional argument to return
+ multiple elements.
- * Hash#transform_keys [Feature #13583]
- * Hash#transform_keys! [Feature #13583]
- * Hash#slice [Feature #8499]
-
-* IO
-
- * IO#copy_stream tries copy offload with copy_file_range(2) [Feature #13867]
-
+* Float
* New methods:
+ * Float#next_float
+ * Float#prev_float
- * IO#pread [Feature #4532]
- * IO#pwrite [Feature #4532]
- * IO#write accepts multiple arguments [Feature #9323]
-
-* IOError
-
- * IO#close might raise an error with message "stream closed",
- but it is refined to "stream closed in another thread". The new message
- is more clear for user.
- [Bug #13405]
-
-* Integer
-
- * Integer#step no longer hides errors from coerce method when
- given a step value which cannot be compared with #> to 0.
- [Feature #7688]
- * Integer#{round,floor,ceil,truncate} always return an Integer.
- [Bug #13420]
- * Integer#pow accepts modulo argument for calculating modular
- exponentiation. [Feature #12508] [Feature #11003]
+* File
+ * New methods:
+ * File.birthtime
+ * File#birthtime
+* File::Stat
* New methods:
+ * File::Stat#birthtime
- * Integer#allbits?, Integer#anybits?, Integer#nobits? [Feature #12753]
- * Integer.sqrt [Feature #13219]
+* GC
+ * Improvements
+ * Introduce incremental marking for major GC. [Feature #10137]
* Kernel
-
- * Kernel#yield_self [Feature #6721]
- * Kernel#pp [Feature #14123]
- * Kernel#warn(..., uplevel:n) [Feature #12882]
-
-* Method
-
* New methods:
-
- * Method#=== that invokes Method#call, as same as Proc#=== [Feature #14142]
-
-* Module
-
- * Module#{attr,attr_accessor,attr_reader,attr_writer} become public [Feature #14132]
- * Module#{define_method,alias_method,undef_method,remove_method} become public [Feature #14133]
-
-* Numeric
-
- * Numerical comparison operators (<,<=,>=,>) no longer hide exceptions
- from #coerce method internally. Return nil in #coerce if the coercion is
- impossible. [Feature #7688]
+ * Kernel#itself
* Process
+ * Extended method:
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+ * Process creation methods, such as spawn(), uses vfork() system call.
+ vfork() is faster than fork() when the parent process uses huge memory.
- * Precision of Process.times is improved if getrusage(2) exists. [Feature #11952]
-
- * New method:
-
- * Process.last_status as an alias of $? [Feature #14043]
-
-* Range
- * Range#initialize no longer hides exceptions when comparing begin and
- end with #<=> and raise a "bad value for range" ArgumentError
- but instead lets the exception from the #<=> call go through.
- [Feature #7688]
-
-* Regexp
-
- * Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05.
-
- * Support absence operator https://github.com/k-takata/Onigmo/issues/82
-
- * Support new 5 emoji-related Unicode character properties
-
-* RubyVM::InstructionSequence
-
- * New method:
-
- * RubyVM::InstructionSequence#each_child
- * RubyVM::InstructionSequence#trace_points
-
-* String
-
- * String#-@ deduplicates unfrozen strings. Already-frozen
- strings remain unchanged for compatibility. [Feature #13077]
- * -"literal" (String#-@) optimized to return the same object
- (same as "literal".freeze in Ruby 2.1+) [Feature #13295]
- * String#{casecmp,casecmp?} return nil for non-string arguments
- instead of raising a TypeError. [Bug #13312]
- * String#start_with? accepts a regexp [Feature #13712]
+* Symbol
+ * Improvements
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able.
+* 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).
- * String#delete_prefix, String#delete_prefix! [Feature #12694]
- * String#delete_suffix, String#delete_suffix! [Feature #13665]
- * String#each_grapheme_cluster and String#grapheme_clusters to
- enumerate grapheme clusters [Feature #13780]
- * String#undump to unescape String#dump'ed string [Feature #12275]
-
-* Struct
-
- * Struct.new takes `keyword_init: true` option to initialize members
- with keyword arguments. [Feature #11925]
-
-* Regexp/String: Update Unicode version from 9.0.0 to 10.0.0 [Feature #13685]
-
-* Thread
-
- * Description set by Thread#name= is now visible on Windows 10.
-
- * New method:
- * Thread#fetch [Feature #13009]
-
- * The default of Thread.report_on_exception is now true,
- showing unhandled exceptions terminating threads on $stderr.
- [Feature #14143]
-
-* Time
-
- * Time#at receives 3rd argument which specifies the unit of 2nd argument.
- [Feature #13919]
-
-* KeyError
-
+* 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.
- * KeyError#receiver [Feature #12063]
- * KeyError#key [Feature #12063]
-
-* FrozenError
-
- * New exception class. [Feature #13224]
-
-=== Stdlib updates (outstanding ones only)
-
-* BigDecimal
-
- * Update to BigDecimal 1.3.4
-
- * The following features are added:
-
- * BigDecimal::VERSION
-
- * The following features have been deprecated,
- and are planned to be removed in the version 1.4.0:
-
- * BigDecimal.new
-
- * BigDecimal.ver
-
- * BigDecimal#clone and #dup now do not make a new instance,
- but returns the receiver itself.
-
-* Coverage
-
- * Support branch coverage and method coverage measurement. [Feature #13901]
- Branch coverage tells you which branches are executed, and which not.
- Method coverage tells you which methods are invoked, and which not.
- By running a test suite with this new feature, you can know which branches
- and methods are executed by a test, and evaluate total coverage of a test
- suite more strictly.
-
- You can specify the measuring target by an option to `Coverage.start`:
-
- Coverage.start(lines: true, branches: true, methods: true)
-
- After some Ruby files are loaded, you can use `Coverage.result` to get
- the coverage result:
-
- Coverage.result
- #=> { "/path/to/file.rb"=>
- # { :lines => [1, 2, 0, nil, ...],
- # :branches =>
- # { [:if, 0, 2, 1, 6, 4] =>
- # { [:then, 1, 3, 2, 3, 8] => 0,
- # [:else, 2, 5, 2, 5, 8] => 2
- # }
- # },
- # :methods => {
- # [Object, :foo, 1, 0, 7, 3] => 2
- # }
- # }
- # }
-
- The result type of line coverage is not changed; it is just an array that
- contains numbers, which means the count that each line was executed,
- or `nil`s, which means that the line is not relevant.
+=== Core classes compatibility issues (excluding feature bug fixes)
- The result type of branch coverage is:
-
- { (jump base) => { (jump target) => (counter) } }
-
- where jump base and targets have the format
-
- [type, unique-id, start lineno, start column, end lineno, end column]
-
- For example, `[:if, 0, 2, 1, 6, 4]` reads an `if` statement that ranges from
- line 2 and column 1, to line 6 and column 4. `[:then, 1, 3, 2, 3, 8]` reads
- a `then` clause that ranges from line 3 and column 2, to line 3 and column 8.
- Note that lineno starts from 1, and that columnno starts from 0. So, the
- above example shows a branch from the `if` to the `then` was never executed,
- and a branch from the `if` to the `else` was executed twice.
-
- The result type of method coverage is:
-
- { (method key) => (counter) }
-
- where method key has the format
-
- [class, method-name, start lineno, start column, end lineno, end column]
-
- For example, `[Object, :foo, 1, 0, 7, 3]` reads `Object#foo` that ranges from
- line 1 and column 0, to line 7 and column 3. The above example shows this
- `Object#foo` was invoked twice.
-
- Note: To keep compatibility, passing no option to `Coverage.start` will measure
- only line coverage, and `Coverage.result` will return the old format:
-
- Coverage.result
- #=> { "/path/to/file.rb"=> [1, 2, 0, nil, ...] }
-
-* DRb
-
- * ACL::ACLEntry.new no longer suppresses IPAddr::InvalidPrefixError.
-
-* ERB
-
- * Add ERB#result_with_hash to render a template with local variables passed
- with a Hash object. [Feature #8631]
-
- * Default template file encoding is changed from ASCII-8BIT to UTF-8 in erb
- command. [Bug #14095]
-
- * Carriage returns are changed to be trimmed properly if trim_mode is specified
- and used. Duplicated newlines will be removed on Windows. [Bug #5339] [Bug #11464]
-
-* IPAddr
-
- * IPAddr no longer accepts invalid address mask. [Bug #13399]
- * IPAddr#{ipv4_compat,ipv4_compat?} are marked for deprecation. [Bug #13769]
-
- * New methods:
-
- * IPAddr#prefix
- * IPAddr#loopback?
- * IPAddr#private? [Feature #11666]
- * IPAddr#link_local? [Feature #10912]
+* GC
+ * incompatible changes:
+ * Rename GC.stat entries. [Feature #9924]
+ See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+* IO
+ * incompatible changes:
+ * When flushing file IO, 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.
+
+* 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.
-* IRB
+* 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.
- * Print backtrace and error message in reverse order [Feature #8661] [experimental]
- * `binding.irb` automatically requires irb and runs [Bug #13099] [experimental]
- * `binding.irb` on its start shows source around the line where it was called
- [Feature #14124]
+=== Stdlib updates (outstanding ones only)
-* Matrix
+* Digest
+ * Digest::HMAC has been removed just as previously noticed.
+* Etc
* New methods:
+ * Etc.uname
+ * Etc.sysconf
+ * Etc.confstr
+ * IO#pathconf
- * Matrix.combine and Matrix#combine [Feature #10903]
- * Matrix#{hadamard_product,entrywise_product}
-
-* Net::HTTP
-
- * Net::HTTP.new supports no_proxy parameter [Feature #11195]
- * Net::HTTP#{min_version,max_version}, [Feature #9450]
- * Add more HTTP status classes
- * Net::HTTP::STATUS_CODES is added as HTTP Status Code Repository [Misc #12935]
- * Net::HTTP#{proxy_user,proxy_pass} reflect http_proxy environment variable
- if the system's environment variable is multiuser safe. [Bug #12921]
-
-* open-uri
- * URI.open method defined as an alias to open-uri's Kernel.open.
- open-uri's Kernel.open will be deprecated in future.
-
-* OpenSSL
-
- * Updated Ruby/OpenSSL from version 2.0 to 2.1. Changes are noted in
- "Version 2.1.0" section in ext/openssl/History.md.
+* Find, Pathname
+ * Extended methods:
+ * find method accepts "ignore_error" keyword argument.
* Pathname
-
- * New method:
-
- * Pathname#glob [Feature #7360]
-
-* Psych
-
- * Update to Psych 3.0.2.
-
- * Convert fallback option to a keyword argument
- https://github.com/ruby/psych/pull/342
- * Add :symbolize_names option to Psych.load, Psych.safe_load like JSON.parse
- https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337
- * Add Psych::Handler#event_location
- https://github.com/ruby/psych/pull/326
- * Make frozen string literal = true
- https://github.com/ruby/psych/pull/320
- * Preserve time zone offset when deserializing times
- https://github.com/ruby/psych/pull/316
- * Remove deprecated method aliases for syck gem
- https://github.com/ruby/psych/pull/312
-
-* RbConfig
-
- * RbConfig::LIMITS is added to provide the limits of C types.
- This is available when rbconfig/sizeof is loaded.
-
-* Ripper
-
- * Ripper::EXPR_BEG and so on for Ripper#state.
-
- * New method:
-
- * Ripper#state to tell the state of scanner. [Feature #13686]
-
-* RDoc
-
- * Update to RDoc 6.0.1.
-
- * Replace IRB based lexer with Ripper.
- * https://github.com/ruby/rdoc/pull/512
- * This much improves the speed of generating documents.
- * It also facilitates supporting new syntax in the future.
- * Support many new syntaxes of Ruby from the past few years.
- * Use "frozen_string_literal: true".
- Performance survey: https://gist.github.com/aycabta/abdfaa75ea8a6877eeb734e942e73800
- * Support did_you_mean.
-
-* Rubygems
-
- * Update to Rubygems 2.7.3.
- * http://blog.rubygems.org/2017/11/28/2.7.3-released.html
- * http://blog.rubygems.org/2017/11/08/2.7.2-released.html
- * http://blog.rubygems.org/2017/11/03/2.7.1-released.html
- * http://blog.rubygems.org/2017/11/01/2.7.0-released.html
- * http://blog.rubygems.org/2017/10/09/2.6.14-released.html
- * http://blog.rubygems.org/2017/08/27/2.6.13-released.html
-
-* SecureRandom
-
- * New method:
-
- * SecureRandom.alphanumeric
-
-* Set
-
+ * Pathname#/ is aliased to Pathname#+.
* New methods:
+ * Pathname#birthtime
- * Set#to_s as alias to #inspect [Feature #13676]
- * Set#=== as alias to #include? [Feature #13801]
- * Set#reset [Feature #6589]
-
-* StringIO
-
- * StringIO#write accepts multiple arguments
-
-* StringScanner
-
- * New methods:
-
- * StringScanner#size, StringScanner#captures, StringScanner#values_at [Feature #836]
-
-* URI
-
- * Relative path operations no longer collapse consecutive slashes to a single slash. [Bug #8352]
-
-* WEBrick
-
- * Add Server Name Indication (SNI) support [Feature #13729]
- * support Proc objects as body responses [Feature #855]
- * released as a RubyGem [Feature #13173]
- * avoid unintended behavior from Kernel#open [Misc #14216]
-
-* Zlib
+=== Stdlib compatibility issues (excluding feature bug fixes)
- * Zlib::GzipWriter#write accepts multiple arguments
+* lib/mathn.rb
+ * Show deprecated warning [Feature #10169]
-=== Compatibility issues (excluding feature bug fixes)
+* ext/date/lib/date/format.rb
+ * Removed because it's empty file.
-* Socket
+* Digest
+ * Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead.
- * BasicSocket#read_nonblock and BasicSocket#write_nonblock no
- longer set the O_NONBLOCK file description flag as side effect
- (on Linux only) [Feature #13362]
+* 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.
-* Random
+* lib/rational.rb
+ * Removed because it is deprecated from 2009.
- * Random.raw_seed renamed to become Random.urandom. It is now
- applicable to non-seeding purposes due to [Bug #9569].
+* lib/complex.rb
+ * Removed because it is deprecated from 2009.
-* Socket
+* lib/prettyprint.rb
+ * Removed PrettyPrint#first?
- * Socket::Ifaddr#vhid is added [Feature #13803]
+* lib/minitest/*.rb
+ * Removed because it conflicts to minitest 5. [Feature #9711]
-* ConditionVariable, Queue and SizedQueue reimplemented for speed.
- They no longer subclass Struct. [Feature #13552]
+* lib/test/**/*.rb
+ * Removed because it conflicts to minitest 5, and it was just an wrapper
+ of minitest 4. [Feature #9711]
-=== Stdlib compatibility issues (excluding feature bug fixes)
+* lib/uri
+ * support RFC 3986. [Feature #2542]
-* Gemification
-
- * Promote following standard libraries to default gems.
- * cmath
- * csv
- * date
- * dbm
- * etc
- * fcntl
- * fiddle
- * fileutils
- * gdbm
- * ipaddr
- * scanf
- * sdbm
- * stringio
- * strscan
- * webrick
- * zlib
+* GServer
+ * GServer is extracted to gserver gem. It's unmaintain code.
* Logger
+ * Logger::Application is extracted to logger-application gem. It's unmaintain code.
- * Logger.new("| command") had been working to open a command
- unintentionally. It was prohibited, and now Logger#initialize
- treats a String argument only as a filename, as its specification.
- [Bug #14212]
-
-* Net::HTTP
-
- * Net::HTTP#start now passes :ENV to p_addr by default. [Bug #13351]
- To avoid this, pass nil explicitly.
-
-* mathn.rb
-
- * Removed from stdlib. [Feature #10169]
+* 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]
-* Rubygems
+* Psych
+ * Removed Psych::EngineManager [Bug #8344]
- * Removed "ubygems.rb" file from stdlib. It's needless since Ruby 1.9.
+=== Built-in global variables compatibility issues
=== C API updates
-=== Supported platform changes
-
-* Drop support of NaCl platform
-
- * https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160
-
-=== Implementation improvements
-
-* (This might not be a "user visible feature change" but) Hash class's
- hash function is now SipHash13. [Feature #13017]
-
-* SecureRandom now prefers OS-provided sources than OpenSSL. [Bug #9569]
-
-* Mutex rewritten to be smaller and faster [Feature #13517]
-
-* Performance of block passing using block parameters is improved by
- lazy Proc allocation [Feature #14045]
-
-* Dynamic instrumentation for TracePoint hooks instead of using "trace"
- instruction to avoid overhead [Feature #14104]
-
-* ERB now generates code from a template which runs 2 times faster than Ruby 2.4
-
-=== Miscellaneous changes
-
-* Print backtrace and error message in reverse order if STDERR is unchanged and a tty.
- [Feature #8661] [experimental]
-
-* Print error message in bold/underlined text if STDERR is unchanged and a tty.
- [Feature #14140] [experimental]
-
-* configure option --with-ext now mandates its arguments. So for
- instance if you run ./configure --with-ext=openssl,+ then the
- openssl library is guaranteed compiled, otherwise the build fails
- abnormally.
-
- Note however to always add the ",+" at the end of the argument.
- Otherwise nothing but openssl are built. [Feature #13302]
+* 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.
+
+* 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()` now share middle of a string,
+ but not only the end of a string. 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
diff --git a/README.EXT b/README.EXT
index 48b8d964c4..f7ee0022df 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1 +1,1679 @@
-Moved to doc/extension.rdoc
+# 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) ::
+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_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.
+
+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)
+
+=== 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 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 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 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;
+ };
+
+ 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) do {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ 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.
+
+*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
+
+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 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.
+ 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 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.
+
+/*
+ * Local variables:
+ * fill-column: 70
+ * end:
+ */
diff --git a/README.EXT.ja b/README.EXT.ja
index f884ecbb0e..0ab61abcbe 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1 +1,1666 @@
-doc/extension.ja.rdocに移動しました
+# 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)
+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_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の文字列を使います.
+
+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のオブジェクトとして
+取り扱いたい場合がありえます.このような場合には,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は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;
+ };
+
+
+ obj = Data_Make_Struct(klass, struct dbmdata, 0, free_dbm, dbmp);
+
+ここではdbmstruct構造体へのポインタをDataにカプセル化してい
+ます.DBM*を直接カプセル化しないのはclose()した時の処理を考
+えてのことです.
+
+Dataオブジェクトからdbmstruct構造体のポインタを取り出すため
+に以下のマクロを使っています.
+
+ #define GetDBM(obj, dbmp) do {\
+ Data_Get_Struct(obj, struct dbmdata, dbmp);\
+ 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 : 自動生成
+ 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)
+ 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)になります.
+
+ 返り値は与えられた引数の数です.オプションハッシュおよびイ
+ テレータブロックは数えません.
+
+== 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インタプリタのコマンドライン引数の処理を行ない,
+ 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」を参照して下さい.
+
+/*
+ * Local variables:
+ * fill-column: 60
+ * end:
+ */
diff --git a/README.ja.md b/README.ja.md
index 2902216f99..1e9bae7e0c 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -17,8 +17,8 @@ Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい
* ガーベージコレクタ
* ダイナミックローディング (アーキテクチャによる)
* 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で動くだけでなく,Windows, Mac OS
- X,Haikuなどの上でも動く cf.
- https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
+ X,BeOSなどの上でも動く cf.
+ http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
## 入手法
@@ -33,11 +33,11 @@ ftp://ftp.ruby-lang.org/pub/ruby/
開発先端のソースコードは次のコマンドで取得できます.
- $ svn co https://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
他に開発中のブランチの一覧は次のコマンドで見られます.
- $ svn ls https://svn.ruby-lang.org/repos/ruby/branches/
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
### Gitで
@@ -49,13 +49,13 @@ SubversionのミラーをGitHubに公開しています. 以下のコマンド
RubyのホームページのURLは
-https://www.ruby-lang.org/
+http://www.ruby-lang.org/
です.
## メーリングリスト
-Rubyのメーリングリストがあります.参加希望の方は
+Rubyのメーリングリストがあります。参加希望の方は
mailto:ruby-list-request@ruby-lang.org
@@ -63,22 +63,22 @@ mailto:ruby-list-request@ruby-lang.org
subscribe
-と書いて送って下さい.
+と書いて送って下さい。
-Ruby開発者向けメーリングリストもあります.こちらではrubyのバグ,将来の仕様拡張など実装上の問題について議論されています. 参加希望の方は
+Ruby開発者向けメーリングリストもあります。こちらではrubyのバグ、将来の仕様拡張など実装上の問題について議論されています。 参加希望の方は
mailto:ruby-dev-request@ruby-lang.org
-までruby-listと同様の方法でメールしてください.
+までruby-listと同様の方法でメールしてください。
Ruby拡張モジュールについて話し合うruby-extメーリングリストと数学関係の話題について話し合うruby-mathメーリングリストと
-英語でrubyについて話し合うruby-talkメーリングリストもあります.参加方法はどれも同じです.
+英語でrubyについて話し合うruby-talkメーリングリストもあります。参加方法はどれも同じです。
## コンパイル・インストール
以下の手順で行ってください.
-1. もし `configure` ファイルが見つからない,もしくは `configure.ac` より古いようなら, `autoconf` を実行して
+1. もし `configure` ファイルが見つからない、もしくは `configure.in` より古いようなら、 `autoconf` を実行して
新しく `configure` を生成する
2. `configure` を実行して `Makefile` などを生成する
@@ -109,17 +109,20 @@ Ruby拡張モジュールについて話し合うruby-extメーリングリス
* `${DESTDIR}${prefix}/bin`
* `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}`
- * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}`
+ * `${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFOR
+ M}`
* `${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/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${P
+ LATFORM}`
* `${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/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`
@@ -144,28 +147,17 @@ UNIXであれば `configure` がほとんどの差異を吸収してくれるは
のアーキテクチャが`setjmp()`または`getcontext()`によって全てのレジスタを `jmp_buf` や `ucontext_t`
に格納することと, `jmp_buf` や `ucontext_t` とスタックが32bitアラインメントされていることを仮定
しています.特に前者が成立しない場合の対応は非常に困難でしょう. 後者の解決は比較的簡単で, `gc.c` でスタックをマークしている
-部分にアラインメントのバイト数だけずらしてマークするコードを追加するだけで済みます.`defined(__mc68000__)`で括られてい
+部分にアラインメントのバイト数だけずらしてマークするコードを追加するだけで済みます.`defined(_\*mc68000*\_)`で括られてい
る部分を参考にしてください.
レジスタウィンドウを持つCPUでは,レジスタウィンドウをスタックにフラッシュするアセンブラコードを追加する必要があるかもしれません.
## 配布条件
-[COPYING.ja](COPYING.ja) ファイルを参照してください.
-
-## フィードバック
-
-Rubyに関する質問は Ruby-Talk(英語)や Ruby-List(日本語) (https://www.ruby-lang.org/ja/community/mailing-lists) や,
-stackoverflow (https://ja.stackoverflow.com/) などのWebサイトに投稿してください.
-
-バグ報告は https://bugs.ruby-lang.org で受け付けています.
-
+`COPYING.ja` ファイルを参照してください。
## 著者
-Rubyのオリジナル版は,1995年にまつもとゆきひろ氏によって設計・開発されました.
-
-<mailto:matz@ruby-lang.org>
-
+コメント,バグレポートその他は mailto:matz@ruby-lang.org まで.
---
created at: Thu Aug 3 11:57:36 JST 1995
diff --git a/README.md b/README.md
index 7a24329fe8..c6498a8cca 100644
--- a/README.md
+++ b/README.md
@@ -1,67 +1,64 @@
-[![Build Status](https://travis-ci.org/ruby/ruby.svg)](https://travis-ci.org/ruby/ruby)
-[![Build status](https://ci.appveyor.com/api/projects/status/0sy8rrxut4o0k960/branch/trunk?svg=true)](https://ci.appveyor.com/project/ruby/ruby/branch/trunk)
-
# 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
+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)
+* **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 architectures)
+* Dynamic Loading of Object files(on some architecture)
* Highly Portable (works on many Unix-like/POSIX compatible platforms as
- well as Windows, macOS, Haiku, etc.) cf.
- https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
+ 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
+For a complete list of ways to install Ruby, including using third party tools
like rvm, see:
-https://www.ruby-lang.org/en/downloads/
+http://www.ruby-lang.org/en/downloads/
-The Ruby distribution files can be found on the following FTP site:
+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 https://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
Or if you are using git then use the following command:
- $ git clone https://github.com/ruby/ruby.git
+ $ 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:
+There are some other branches under development. Try the following command
+and see the list of branches:
- $ svn ls https://svn.ruby-lang.org/repos/ruby/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
+## Ruby home-page
-The URL of the Ruby home page is:
+The URL of the Ruby home-page is:
-https://www.ruby-lang.org/
+http://www.ruby-lang.org/
## Mailing list
-There is a mailing list to talk about Ruby. To subscribe to this list, please
-send the following phrase:
+There is a mailing list to talk about Ruby. To subscribe this list, please
+send the following phrase
subscribe
@@ -72,16 +69,16 @@ in the mail body (not subject) to the address
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](win32/README.win32) instead of this document.
+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.ac`, run
- `autoconf` to (re)generate configure.
+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`.
+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
+ environment. Specify `optflags=..` and `warnflags=..` as necessary to
override them.
4. Edit `defines.h` if you need. Usually this step will not be needed.
@@ -97,36 +94,31 @@ This is what you need to do to compile and install Ruby:
6. Run `make`.
- * On Mac, set RUBY\_CODESIGN environment variable with a signing identity.
- It uses the identity to sign `ruby` binary. See also codesign(1).
-
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. Optionally, run `make update-gems` and `make extract-gems`.
-
- If you want to install bundled gems, run `make update-gems` and
- `make extract-gems` before running `make install`.
+ ruby works as it should (hopefully).
-9. Run '`make install`'.
+8. Run '`make install`'
- This command will create the following directories and install files into
+ 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}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFOR
+ M}`
* `${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/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${P
+ LATFORM}`
* `${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/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`
@@ -138,34 +130,28 @@ This is what you need to do to compile and install Ruby:
**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.
+ 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
+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.
+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](COPYING).
+See the file `COPYING`.
## Feedback
Questions about the Ruby language can be asked on the Ruby-Talk mailing list
-(https://www.ruby-lang.org/en/community/mailing-lists) or on websites like
-(https://stackoverflow.com).
-
-Bug reports should be filed at https://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](CONTRIBUTING.md)
+(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
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 99b24e6d93..0000000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- 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/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index 18ba297b05..0000000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
-
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-m4_include([acinclude.m4])
diff --git a/addr2line.c b/addr2line.c
index 09fcc3c225..c8faf48d62 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -15,12 +15,6 @@
#include <stdio.h>
#include <errno.h>
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#else
-#include "missing/stdbool.h"
-#endif
-
#ifdef USE_ELF
#include <fcntl.h>
@@ -42,9 +36,11 @@
/* Make alloca work the best possible way. */
#ifdef __GNUC__
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
#else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
@@ -100,10 +96,6 @@ void *alloca();
#define PATH_MAX 4096
#endif
-#ifndef SHF_COMPRESSED /* compatibility with glibc < 2.22 */
-#define SHF_COMPRESSED 0
-#endif
-
int kprintf(const char *fmt, ...);
typedef struct {
@@ -235,7 +227,7 @@ fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
}
}
-static int
+static void
parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
obj_info_t *obj, line_info_t *lines, int offset)
{
@@ -297,13 +289,9 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
include_directories = p;
- /* temporary measure for compress-debug-sections */
- if (p >= cu_end) return -1;
-
/* skip include directories */
while (*p) {
- p = memchr(p, '\0', cu_end - p);
- if (!p) return -1;
+ while (*p) p++;
p++;
}
p++;
@@ -411,24 +399,21 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
}
}
*debug_line = p;
- return 0;
}
-static int
+static void
parse_debug_line(int num_traces, void **traces,
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) {
- if (parse_debug_line_cu(num_traces, traces, &debug_line, obj, lines, offset))
- return -1;
+ 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",
binary_filename);
}
- return 0;
}
/* read file and fill lines */
@@ -437,25 +422,22 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
obj_info_t **objp, line_info_t *lines, int offset);
static void
-append_obj(obj_info_t **objp)
-{
+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(const char *debuglink, int num_traces, void **traces,
+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";
- const size_t global_debug_dir_len = sizeof(global_debug_dir) - 1;
- char *p;
+ char *p, *subdir;
obj_info_t *o1 = *objp, *o2;
- size_t len;
p = strrchr(binary_filename, '/');
if (!p) {
@@ -463,13 +445,11 @@ follow_debuglink(const char *debuglink, int num_traces, void **traces,
}
p[1] = '\0';
- len = strlen(binary_filename);
- if (len >= PATH_MAX - global_debug_dir_len)
- len = PATH_MAX - global_debug_dir_len - 1;
- memmove(binary_filename + global_debug_dir_len, binary_filename, len);
- memcpy(binary_filename, global_debug_dir, global_debug_dir_len);
- len += global_debug_dir_len;
- strlcpy(binary_filename + len, debuglink, PATH_MAX - len);
+ subdir = (char *)alloca(strlen(binary_filename) + 1);
+ strcpy(subdir, binary_filename);
+ strcpy(binary_filename, global_debug_dir);
+ strlcat(binary_filename, subdir, PATH_MAX);
+ strlcat(binary_filename, debuglink, PATH_MAX);
append_obj(objp);
o2 = *objp;
@@ -496,7 +476,6 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
ElfW(Shdr) *dynsym_shdr = NULL, *dynstr_shdr = NULL;
obj_info_t *obj = *objp;
uintptr_t dladdr_fbase = 0;
- bool compressed_p = false;
fd = open(binary_filename, O_RDONLY);
if (fd < 0) {
@@ -566,9 +545,6 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
break;
case SHT_PROGBITS:
if (!strcmp(section_name, ".debug_line")) {
- if (shdr[i].sh_flags & SHF_COMPRESSED) {
- compressed_p = true;
- }
debug_line_shdr = shdr + i;
}
else if (!strcmp(section_name, ".gnu_debuglink")) {
@@ -646,12 +622,10 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
goto finish;
}
- if (!compressed_p &&
- parse_debug_line(num_traces, traces,
- file + debug_line_shdr->sh_offset,
- debug_line_shdr->sh_size,
- obj, lines, offset))
- goto fail;
+ parse_debug_line(num_traces, traces,
+ file + debug_line_shdr->sh_offset,
+ debug_line_shdr->sh_size,
+ obj, lines, offset);
finish:
return dladdr_fbase;
fail:
@@ -669,7 +643,7 @@ fail:
* it is NUL terminated.
*/
#if defined(__linux__)
-static ssize_t
+ssize_t
main_exe_path(void)
{
# define PROC_SELF_EXE "/proc/self/exe"
@@ -678,7 +652,7 @@ main_exe_path(void)
return len;
}
#elif defined(__FreeBSD__)
-static ssize_t
+ssize_t
main_exe_path(void)
{
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
@@ -746,9 +720,8 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces)
path = info.dli_fname;
obj->path = path;
lines[i].path = path;
- strlcpy(binary_filename, path, PATH_MAX);
- if (fill_lines(num_traces, traces, 1, &obj, lines, i) == (uintptr_t)-1)
- break;
+ strcpy(binary_filename, path);
+ fill_lines(num_traces, traces, 1, &obj, lines, i);
}
next_line:
continue;
@@ -763,7 +736,7 @@ next_line:
kprintf("[0x%lx]\n", addr);
}
else if (!line->saddr || !line->sname) {
- kprintf("%s(0x%lx) [0x%lx]\n", line->path, addr-line->base_addr, addr);
+ 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,
@@ -839,7 +812,8 @@ next_line:
#include <stdarg.h>
#define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1)
-static inline int toupper(int c) { return ('A' <= c && c <= 'Z') ? (c&0x5f) : c; }
+extern int rb_toupper(int c);
+#define toupper(c) rb_toupper(c)
#define hex2ascii(hex) (hex2ascii_data[hex])
char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz";
static inline int imax(int a, int b) { return (a > b ? a : b); }
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 22c7bdce6a..0000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,55 +0,0 @@
----
-shallow_clone: true
-platform:
- - x64
-environment:
- ruby_version: "24-%Platform%"
- zlib_version: "1.2.11"
- matrix:
- - vs: "120"
-install:
- - chcp
- - SET BITS=%Platform:x86=32%
- - SET BITS=%BITS:x=%
- - SET OPENSSL_DIR=c:\OpenSSL-Win%BITS%
- - CALL SET vcvars=%%^VS%VS%COMNTOOLS^%%..\..\VC\vcvarsall.bat
- - SET vcvars
- - '"%vcvars%" %Platform:x64=amd64%'
- - SET ruby_path=C:\Ruby%ruby_version:-x86=%
- - SET PATH=\usr\local\bin;%ruby_path%\bin;%PATH%;C:\msys64\mingw64\bin;C:\msys64\usr\bin
- - ruby --version
- - 'cl'
- - SET
- - echo> Makefile srcdir=.
- - echo>> Makefile MSC_VER=0
- - echo>> Makefile RT=none
- - echo>> Makefile RT_VER=0
- - echo>> Makefile BUILTIN_ENCOBJS=nul
- - type win32\Makefile.sub >> Makefile
- - nmake %mflags% touch-unicode-files
- - nmake %mflags% up incs UNICODE_FILES=.
- - del Makefile
- - mkdir \usr\local\bin
- - mkdir \usr\local\include
- - mkdir \usr\local\lib
- - appveyor DownloadFile https://zlib.net/zlib%zlib_version:.=%.zip
- - 7z x -o%APPVEYOR_BUILD_FOLDER%\ext\zlib zlib%zlib_version:.=%.zip
- - for %%I in (%OPENSSL_DIR%\*.dll) do mklink /h \usr\local\bin\%%~nxI %%I
- - mkdir %Platform%-mswin_%vs%
- - ps: Get-ChildItem "win32" -Recurse | foreach {$_.Attributes = 'Readonly'}
- - ps: Get-Item $env:Platform"-mswin_"$env:vs | foreach {$_.Attributes = 'Normal'}
-build_script:
- - cd %APPVEYOR_BUILD_FOLDER%
- - cd %Platform%-mswin_%vs%
- - ..\win32\configure.bat --without-ext=+,dbm,gdbm,readline --with-opt-dir=/usr/local --with-openssl-dir=%OPENSSL_DIR:\=/%
- - nmake -l
- - nmake install-nodoc
- - \usr\bin\ruby -v -e "p :locale => Encoding.find('locale'), :filesystem => Encoding.find('filesystem')"
-test_script:
- - set /a JOBS=%NUMBER_OF_PROCESSORS%
- - nmake -l "TESTOPTS=-v -q" btest
- - nmake -l "TESTOPTS=-v -q" test-basic
- - nmake -l "TESTOPTS=-q -j%JOBS%" test-all
- - nmake -l test-spec
-matrix:
- fast_finish: true
diff --git a/array.c b/array.c
index 1600e484fe..6b551dbe24 100644
--- a/array.c
+++ b/array.c
@@ -11,26 +11,25 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/util.h"
#include "ruby/st.h"
+#include "ruby/encoding.h"
+#include "internal.h"
#include "probes.h"
#include "id.h"
-#include "debug_counter.h"
#ifndef ARRAY_DEBUG
# define NDEBUG
#endif
-#include "ruby_assert.h"
+#include <assert.h>
VALUE rb_cArray;
-/* for OPTIMIZED_CMP: */
-#define id_cmp idCmp
+static ID id_cmp, id_div, id_power;
#define ARY_DEFAULT_SIZE 16
#define ARY_MAX_SIZE (LONG_MAX / (int)sizeof(VALUE))
-#define SMALL_ARRAY_LEN 16
# define ARY_SHARED_P(ary) \
(assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
@@ -356,13 +355,9 @@ rb_ary_modify(VALUE ary)
static VALUE
ary_ensure_room_for_push(VALUE ary, long add_len)
{
- long old_len = RARRAY_LEN(ary);
- long new_len = old_len + add_len;
+ long new_len = RARRAY_LEN(ary) + 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);
@@ -382,11 +377,8 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
}
}
}
- rb_ary_modify(ary);
- }
- else {
- rb_ary_modify_check(ary);
}
+ rb_ary_modify(ary);
capa = ARY_CAPA(ary);
if (new_len > capa) {
ary_double_capa(ary, new_len);
@@ -459,7 +451,10 @@ ary_alloc(VALUE klass)
static VALUE
empty_ary_alloc(VALUE klass)
{
- RUBY_DTRACE_CREATE_HOOK(ARRAY, 0);
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
+
return ary_alloc(klass);
}
@@ -475,16 +470,21 @@ ary_new(VALUE klass, long capa)
rb_raise(rb_eArgError, "array size too big");
}
- RUBY_DTRACE_CREATE_HOOK(ARRAY, capa);
+ if (RUBY_DTRACE_ARRAY_CREATE_ENABLED()) {
+ RUBY_DTRACE_ARRAY_CREATE(capa, rb_sourcefile(), rb_sourceline());
+ }
- ary = ary_alloc(klass);
if (capa > RARRAY_EMBED_LEN_MAX) {
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;
}
@@ -502,7 +502,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;
@@ -521,11 +521,11 @@ VALUE
}
VALUE
-rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
+rb_ary_new_from_values(long n, const VALUE *elts)
{
VALUE ary;
- ary = ary_new(klass, n);
+ ary = rb_ary_new2(n);
if (n > 0 && elts) {
ary_memcpy(ary, 0, n, elts);
ARY_SET_LEN(ary, n);
@@ -535,12 +535,6 @@ rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
}
VALUE
-rb_ary_new_from_values(long n, const VALUE *elts)
-{
- return rb_ary_tmp_new_from_values(rb_cArray, n, elts);
-}
-
-VALUE
rb_ary_tmp_new(long capa)
{
return ary_new(0, capa);
@@ -559,19 +553,15 @@ void
rb_ary_free(VALUE ary)
{
if (ARY_OWNS_HEAP_P(ary)) {
- RB_DEBUG_COUNTER_INC(obj_ary_ptr);
ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
}
- else {
- RB_DEBUG_COUNTER_INC(obj_ary_embed);
- }
}
RUBY_FUNC_EXPORTED size_t
rb_ary_memsize(VALUE ary)
{
if (ARY_OWNS_HEAP_P(ary)) {
- return ARY_CAPA(ary) * sizeof(VALUE);
+ return RARRAY(ary)->as.heap.aux.capa * sizeof(VALUE);
}
else {
return 0;
@@ -641,17 +631,16 @@ rb_assoc_new(VALUE car, VALUE cdr)
return rb_ary_new3(2, car, cdr);
}
-VALUE
-rb_to_array_type(VALUE ary)
+static VALUE
+to_ary(VALUE ary)
{
- return rb_convert_type_with_id(ary, T_ARRAY, "Array", idTo_ary);
+ return rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
-#define to_ary rb_to_array_type
VALUE
rb_check_array_type(VALUE ary)
{
- return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_ary);
+ return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
/*
@@ -913,10 +902,7 @@ ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos
* expression returns the array itself, so several appends
* may be chained together.
*
- * a = [ 1, 2 ]
- * a << "c" << "d" << [ 3, 4 ]
- * #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
- * a
+ * [ 1, 2 ] << "c" << "d" << [ 3, 4 ]
* #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
*
*/
@@ -955,7 +941,7 @@ rb_ary_cat(VALUE ary, const VALUE *argv, long len)
* a = [ "a", "b", "c" ]
* a.push("d", "e", "f")
* #=> ["a", "b", "c", "d", "e", "f"]
- * [1, 2, 3].push(4).push(5)
+ * [1, 2, 3,].push(4).push(5)
* #=> [1, 2, 3, 4, 5]
*/
@@ -1085,21 +1071,14 @@ 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 {
- 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;
- }
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr, ptr + n, VALUE, RARRAY_LEN(ary)-n);
+ }); /* WB: no new reference */
}
ARY_INCREASE_LEN(ary, -n);
@@ -1114,12 +1093,6 @@ 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);
- }
-
- rb_ary_modify(ary);
-
if (ARY_SHARED_P(ary)) {
VALUE shared = ARY_SHARED(ary);
capa = RARRAY_LEN(shared);
@@ -1130,6 +1103,7 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
}
}
+ rb_ary_modify(ary);
capa = ARY_CAPA(ary);
if (capa - (capa >> 6) <= new_len) {
ary_double_capa(ary, new_len);
@@ -1216,17 +1190,10 @@ rb_ary_elt(VALUE ary, long offset)
VALUE
rb_ary_entry(VALUE ary, long offset)
{
- long len = RARRAY_LEN(ary);
- const VALUE *ptr = RARRAY_CONST_PTR(ary);
- if (len == 0) return Qnil;
if (offset < 0) {
- offset += len;
- if (offset < 0) return Qnil;
- }
- else if (len <= offset) {
- return Qnil;
+ offset += RARRAY_LEN(ary);
}
- return ptr[offset];
+ return rb_ary_elt(ary, offset);
}
VALUE
@@ -1286,29 +1253,21 @@ rb_ary_subseq(VALUE ary, long beg, long len)
VALUE
rb_ary_aref(int argc, const VALUE *argv, VALUE ary)
{
- rb_check_arity(argc, 1, 2);
+ VALUE arg;
+ long beg, len;
+
if (argc == 2) {
- return rb_ary_aref2(ary, argv[0], argv[1]);
+ beg = NUM2LONG(argv[0]);
+ len = NUM2LONG(argv[1]);
+ if (beg < 0) {
+ beg += RARRAY_LEN(ary);
+ }
+ return rb_ary_subseq(ary, beg, len);
}
- return rb_ary_aref1(ary, argv[0]);
-}
-
-VALUE
-rb_ary_aref2(VALUE ary, VALUE b, VALUE e)
-{
- long beg = NUM2LONG(b);
- long len = NUM2LONG(e);
- if (beg < 0) {
- beg += RARRAY_LEN(ary);
+ if (argc != 1) {
+ rb_scan_args(argc, argv, "11", NULL, NULL);
}
- return rb_ary_subseq(ary, beg, len);
-}
-
-VALUE
-rb_ary_aref1(VALUE ary, VALUE arg)
-{
- long beg, len;
-
+ arg = argv[0];
/* special case - speeding up */
if (FIXNUM_P(arg)) {
return rb_ary_entry(ary, FIX2LONG(arg));
@@ -1338,7 +1297,7 @@ rb_ary_aref1(VALUE ary, VALUE arg)
* a.at(-1) #=> "e"
*/
-VALUE
+static VALUE
rb_ary_at(VALUE ary, VALUE pos)
{
return rb_ary_entry(ary, NUM2LONG(pos));
@@ -1411,9 +1370,8 @@ rb_ary_last(int argc, const VALUE *argv, VALUE ary)
* +default+ value.
*
* Alternatively, if a block is given it will only be executed when an
- * invalid +index+ is referenced.
- *
- * Negative values of +index+ count from the end of the array.
+ * invalid +index+ is referenced. Negative values of +index+ count from the
+ * end of the array.
*
* a = [ 11, 22, 33, 44 ]
* a.fetch(1) #=> 22
@@ -1480,8 +1438,9 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_index(int argc, VALUE *argv, VALUE ary)
{
+ const VALUE *ptr;
VALUE val;
- long i;
+ long i, len;
if (argc == 0) {
RETURN_ENUMERATOR(ary, 0, 0);
@@ -1496,11 +1455,20 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
val = argv[0];
if (rb_block_given_p())
rb_warn("given block not used");
- for (i=0; i<RARRAY_LEN(ary); i++) {
- VALUE e = RARRAY_AREF(ary, i);
- if (rb_equal(e, val)) {
+ len = RARRAY_LEN(ary);
+ ptr = RARRAY_CONST_PTR(ary);
+ for (i=0; i<len; i++) {
+ VALUE e = ptr[i];
+ switch (rb_equal_opt(e, val)) {
+ case Qundef:
+ if (!rb_equal(e, val)) break;
+ case Qtrue:
return LONG2NUM(i);
+ case Qfalse:
+ continue;
}
+ len = RARRAY_LEN(ary);
+ ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
@@ -1532,6 +1500,7 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
{
+ const VALUE *ptr;
VALUE val;
long i = RARRAY_LEN(ary), len;
@@ -1550,11 +1519,21 @@ rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
val = argv[0];
if (rb_block_given_p())
rb_warn("given block not used");
+ ptr = RARRAY_CONST_PTR(ary);
while (i--) {
- VALUE e = RARRAY_AREF(ary, i);
- if (rb_equal(e, val)) {
+ VALUE e = ptr[i];
+ switch (rb_equal_opt(e, val)) {
+ case Qundef:
+ if (!rb_equal(e, val)) break;
+ case Qtrue:
return LONG2NUM(i);
+ case Qfalse:
+ continue;
+ }
+ if (i > (len = RARRAY_LEN(ary))) {
+ i = len;
}
+ ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
@@ -1569,10 +1548,10 @@ rb_ary_to_ary(VALUE obj)
}
static void
-rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
+rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl)
{
+ long rlen;
long olen;
- long rofs;
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
olen = RARRAY_LEN(ary);
@@ -1587,11 +1566,14 @@ rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
len = olen - beg;
}
- {
- const VALUE *optr = RARRAY_CONST_PTR(ary);
- rofs = (rptr >= optr && rptr < optr + olen) ? rptr - optr : -1;
+ if (rpl == Qundef) {
+ rlen = 0;
+ }
+ else {
+ rpl = rb_ary_to_ary(rpl);
+ rlen = RARRAY_LEN(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) {
@@ -1601,17 +1583,13 @@ rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
len = beg + rlen;
ary_mem_clear(ary, olen, beg - olen);
if (rlen > 0) {
- if (rofs != -1) rptr = RARRAY_CONST_PTR(ary) + rofs;
- ary_memcpy0(ary, beg, rlen, rptr, target_ary);
+ 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)) {
@@ -1625,8 +1603,7 @@ rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
ARY_SET_LEN(ary, alen);
}
if (rlen > 0) {
- if (rofs != -1) rptr = RARRAY_CONST_PTR(ary) + rofs;
- MEMMOVE(RARRAY_PTR(ary) + beg, rptr, VALUE, rlen);
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_CONST_PTR(rpl), VALUE, rlen);
}
}
}
@@ -1731,13 +1708,13 @@ static VALUE
rb_ary_aset(int argc, VALUE *argv, VALUE ary)
{
long offset, beg, len;
- VALUE rpl;
if (argc == 3) {
rb_ary_modify_check(ary);
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
- goto range;
+ rb_ary_splice(ary, beg, len, argv[2]);
+ return argv[2];
}
rb_check_arity(argc, 2, 2);
rb_ary_modify_check(ary);
@@ -1747,11 +1724,8 @@ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
}
if (rb_range_beg_len(argv[0], &beg, &len, RARRAY_LEN(ary), 1)) {
/* check if idx is Range */
- range:
- rpl = rb_ary_to_ary(argv[argc-1]);
- rb_ary_splice(ary, beg, len, RARRAY_CONST_PTR(rpl), RARRAY_LEN(rpl));
- RB_GC_GUARD(rpl);
- return argv[argc-1];
+ rb_ary_splice(ary, beg, len, argv[1]);
+ return argv[1];
}
offset = NUM2LONG(argv[0]);
@@ -1783,20 +1757,15 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_ary_modify_check(ary);
- pos = NUM2LONG(argv[0]);
if (argc == 1) return ary;
+ pos = NUM2LONG(argv[0]);
if (pos == -1) {
pos = RARRAY_LEN(ary);
}
- else if (pos < 0) {
- long minpos = -RARRAY_LEN(ary) - 1;
- if (pos < minpos) {
- rb_raise(rb_eIndexError, "index %ld too small for array; minimum: %ld",
- pos, minpos);
- }
+ if (pos < 0) {
pos++;
}
- rb_ary_splice(ary, pos, 0, argv + 1, argc - 1);
+ rb_ary_splice(ary, pos, 0, rb_ary_new4(argc - 1, argv + 1));
return ary;
}
@@ -1815,9 +1784,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. Returns the array itself.
+ * as a parameter.
*
- * If no block is given, an Enumerator is returned.
+ * An Enumerator is returned if no block is given.
*
* a = [ "a", "b", "c" ]
* a.each {|x| print x, " -- " }
@@ -1828,9 +1797,10 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
*/
VALUE
-rb_ary_each(VALUE ary)
+rb_ary_each(VALUE array)
{
long i;
+ volatile VALUE ary = array;
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
@@ -2003,10 +1973,7 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
if (RB_TYPE_P(val, T_STRING)) {
str_join:
rb_str_buf_append(result, val);
- if (*first) {
- rb_enc_copy(result, val);
- *first = FALSE;
- }
+ *first = FALSE;
}
else if (RB_TYPE_P(val, T_ARRAY)) {
obj = val;
@@ -2017,7 +1984,6 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
else {
VALUE args[4];
- *first = FALSE;
args[0] = val;
args[1] = sep;
args[2] = result;
@@ -2031,13 +1997,17 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result, int *first)
val = tmp;
goto str_join;
}
- tmp = rb_check_array_type(val);
+ tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_ary");
if (!NIL_P(tmp)) {
obj = val;
val = tmp;
goto ary_join;
}
val = rb_obj_as_string(val);
+ if (*first) {
+ rb_enc_copy(result, val);
+ *first = FALSE;
+ }
goto str_join;
}
}
@@ -2088,16 +2058,11 @@ rb_ary_join(VALUE ary, VALUE sep)
*
* Returns a string created by converting each element of the array to
* a string, separated by the given +separator+.
- * If the +separator+ is +nil+, it uses current <code>$,</code>.
- * If both the +separator+ and <code>$,</code> are +nil+,
- * it uses an empty string.
+ * If the +separator+ is +nil+, it uses current $,.
+ * If both the +separator+ and $, are nil, it uses empty string.
*
* [ "a", "b", "c" ].join #=> "abc"
* [ "a", "b", "c" ].join("-") #=> "a-b-c"
- *
- * For nested arrays, join is applied recursively:
- *
- * [ "a", [1, 2, [:x, :y]], "b" ].join("-") #=> "a-1-2-x-y-b"
*/
static VALUE
@@ -2190,13 +2155,12 @@ static VALUE
rb_ary_to_h(VALUE ary)
{
long i;
- VALUE hash = rb_hash_new_with_size(RARRAY_LEN(ary));
+ VALUE hash = rb_hash_new();
for (i=0; i<RARRAY_LEN(ary); i++) {
- const VALUE elt = rb_ary_elt(ary, i);
- const VALUE key_value_pair = rb_check_array_type(elt);
+ VALUE key_value_pair = rb_check_array_type(rb_ary_elt(ary, i));
if (NIL_P(key_value_pair)) {
- rb_raise(rb_eTypeError, "wrong element type %"PRIsVALUE" at %ld (expected array)",
- rb_obj_class(elt), i);
+ rb_raise(rb_eTypeError, "wrong element type %s at %ld (expected array)",
+ rb_builtin_class_name(rb_ary_elt(ary, i)), i);
}
if (RARRAY_LEN(key_value_pair) != 2) {
rb_raise(rb_eArgError, "wrong array length at %ld (expected 2, was %ld)",
@@ -2391,9 +2355,26 @@ rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
struct ary_sort_data {
VALUE ary;
- struct cmp_opt_data cmp_opt;
+ int opt_methods;
+ int opt_inited;
+};
+
+enum {
+ sort_opt_Fixnum,
+ sort_opt_String,
+ sort_optimizable_count
};
+#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
+
+#define SORT_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(sort_opt_,type))
+#define SORT_OPTIMIZABLE(data, type) \
+ (((data)->opt_inited & SORT_OPTIMIZABLE_BIT(type)) ? \
+ ((data)->opt_methods & SORT_OPTIMIZABLE_BIT(type)) : \
+ (((data)->opt_inited |= SORT_OPTIMIZABLE_BIT(type)), \
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
+ ((data)->opt_methods |= SORT_OPTIMIZABLE_BIT(type))))
+
static VALUE
sort_reentered(VALUE ary)
{
@@ -2409,12 +2390,9 @@ sort_1(const void *ap, const void *bp, void *dummy)
struct ary_sort_data *data = dummy;
VALUE retval = sort_reentered(data->ary);
VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
- VALUE args[2];
int n;
- args[0] = a;
- args[1] = b;
- retval = rb_yield_values2(2, args);
+ retval = rb_yield_values(2, a, b);
n = rb_cmpint(retval, a, b);
sort_reentered(data->ary);
return n;
@@ -2428,17 +2406,14 @@ sort_2(const void *ap, const void *bp, void *dummy)
VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
int n;
- if (FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, Fixnum)) {
+ if (FIXNUM_P(a) && FIXNUM_P(b) && SORT_OPTIMIZABLE(data, Fixnum)) {
if ((long)a > (long)b) return 1;
if ((long)a < (long)b) return -1;
return 0;
}
- if (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, String)) {
+ if (STRING_P(a) && STRING_P(b) && SORT_OPTIMIZABLE(data, String)) {
return rb_str_cmp(a, b);
}
- if (RB_FLOAT_TYPE_P(a) && CMP_OPTIMIZABLE(data->cmp_opt, Float)) {
- return rb_float_cmp(a, b);
- }
retval = rb_funcallv(a, id_cmp, 1, &b);
n = rb_cmpint(retval, a, b);
@@ -2457,18 +2432,15 @@ 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
- * 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+.
- *
- * The result is not guaranteed to be stable. When the comparison of two
- * elements returns +0+, the order of the elements is unpredictable.
- *
- * ary = [ "d", "a", "e", "c", "b" ]
- * ary.sort! #=> ["a", "b", "c", "d", "e"]
- * ary.sort! { |a, b| b <=> a } #=> ["e", "d", "c", "b", "a"]
+ * The block must implement a comparison between +a+ and +b+, and return
+ * +-1+, when +a+ follows +b+, +0+ when +a+ and +b+ are equivalent, or ++1+
+ * if +b+ follows +a+.
*
* See also Enumerable#sort_by.
+ *
+ * a = [ "d", "a", "e", "c", "b" ]
+ * a.sort! #=> ["a", "b", "c", "d", "e"]
+ * a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
@@ -2483,8 +2455,8 @@ rb_ary_sort_bang(VALUE ary)
RBASIC_CLEAR_CLASS(tmp);
data.ary = tmp;
- data.cmp_opt.opt_methods = 0;
- data.cmp_opt.opt_inited = 0;
+ data.opt_methods = 0;
+ data.opt_inited = 0;
RARRAY_PTR_USE(tmp, ptr, {
ruby_qsort(ptr, len, sizeof(VALUE),
rb_block_given_p()?sort_1:sort_2, &data);
@@ -2493,8 +2465,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));
}
@@ -2541,18 +2513,16 @@ 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
- * 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+.
+ * 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 result is not guaranteed to be stable. When the comparison of two
- * elements returns +0+, the order of the elements is unpredictable.
- *
- * ary = [ "d", "a", "e", "c", "b" ]
- * ary.sort #=> ["a", "b", "c", "d", "e"]
- * ary.sort { |a, b| b <=> a } #=> ["e", "d", "c", "b", "a"]
*
* See also Enumerable#sort_by.
+ *
+ * a = [ "d", "a", "e", "c", "b" ]
+ * a.sort #=> ["a", "b", "c", "d", "e"]
+ * a.sort { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"]
*/
VALUE
@@ -2563,8 +2533,6 @@ rb_ary_sort(VALUE ary)
return ary;
}
-static VALUE rb_ary_bsearch_index(VALUE ary);
-
/*
* call-seq:
* ary.bsearch {|x| block } -> elem
@@ -2572,12 +2540,12 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
* By using binary search, finds a value from this array which meets
* the given condition in O(log n) where n is the size of the array.
*
- * You can use this method in two modes: a find-minimum mode and
+ * You can use this method in two use cases: a find-minimum mode and
* a find-any mode. In either case, the elements of the array must be
* monotone (or sorted) with respect to the block.
*
- * In find-minimum mode (this is a good choice for typical use cases),
- * the block must always return true or false, and there must be an index i
+ * In find-minimum mode (this is a good choice for typical use case),
+ * the block must return true or false, and there must be an index i
* (0 <= i <= ary.size) so that:
*
* - the block returns false for any element whose index is less than
@@ -2595,7 +2563,7 @@ static VALUE rb_ary_bsearch_index(VALUE ary);
* ary.bsearch {|x| x >= 100 } #=> nil
*
* In find-any mode (this behaves like libc's bsearch(3)), the block
- * must always return a number, and there must be two indices i and j
+ * must return a number, and there must be two indices i and j
* (0 <= i <= j <= ary.size) so that:
*
* - the block returns a positive number for ary[k] if 0 <= k < i,
@@ -2621,30 +2589,6 @@ static VALUE rb_ary_bsearch_index(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. They are
- * exactly the same as in the case of the #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;
@@ -2655,8 +2599,8 @@ rb_ary_bsearch_index(VALUE ary)
val = rb_ary_entry(ary, mid);
v = rb_yield(val);
if (FIXNUM_P(v)) {
- if (v == INT2FIX(0)) return INT2FIX(mid);
- smaller = (SIGNED_VALUE)v < 0; /* Fixnum preserves its sign-bit */
+ if (FIX2INT(v) == 0) return val;
+ smaller = FIX2INT(v) < 0;
}
else if (v == Qtrue) {
satisfied = 1;
@@ -2667,16 +2611,16 @@ rb_ary_bsearch_index(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, zero)) {
- case 0: return INT2FIX(mid);
- case 1: smaller = 1; break;
- case -1: smaller = 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;
}
}
else {
- rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE
- " (must be numeric, true, false or nil)",
- rb_obj_class(v));
+ rb_raise(rb_eTypeError, "wrong argument type %s"
+ " (must be numeric, true, false or nil)",
+ rb_obj_classname(v));
}
if (smaller) {
high = mid;
@@ -2685,8 +2629,9 @@ rb_ary_bsearch_index(VALUE ary)
low = mid + 1;
}
}
+ if (low == RARRAY_LEN(ary)) return Qnil;
if (!satisfied) return Qnil;
- return INT2FIX(low);
+ return rb_ary_entry(ary, low);
}
@@ -2704,12 +2649,8 @@ sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
* Sorts +self+ in place using a set of keys generated by mapping the
* values in +self+ through the given block.
*
- * The result is not guaranteed to be stable. When two keys are equal,
- * the order of the corresponding elements is unpredictable.
- *
* If no block is given, an Enumerator is returned instead.
*
- * See also Enumerable#sort_by.
*/
static VALUE
@@ -2741,9 +2682,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
@@ -2755,7 +2696,7 @@ rb_ary_collect(VALUE ary)
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
collect = rb_ary_new2(RARRAY_LEN(ary));
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_ary_push(collect, rb_yield_force_blockarg(RARRAY_AREF(ary, i)));
+ rb_ary_push(collect, rb_yield(RARRAY_AREF(ary, i)));
}
return collect;
}
@@ -2880,50 +2821,6 @@ 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
@@ -2932,8 +2829,6 @@ select_bang_ensure(VALUE a)
* 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
@@ -2945,14 +2840,23 @@ select_bang_ensure(VALUE a)
static VALUE
rb_ary_select_bang(VALUE ary)
{
- struct select_bang_arg args;
+ long i1, i2;
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++;
+ }
- args.ary = ary;
- args.len[0] = args.len[1] = 0;
- return rb_ensure(select_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
+ if (i1 == i2) return Qnil;
+ if (i2 < i1)
+ ARY_SET_LEN(ary, i2);
+ return ary;
}
/*
@@ -3153,7 +3057,7 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
if (len == 0) return rb_ary_new2(0);
arg2 = rb_ary_new4(len, RARRAY_CONST_PTR(ary)+pos);
RBASIC_SET_CLASS(arg2, rb_obj_class(ary));
- rb_ary_splice(ary, pos, len, 0, 0);
+ rb_ary_splice(ary, pos, len, Qundef);
return arg2;
}
@@ -3195,32 +3099,23 @@ ary_reject(VALUE orig, VALUE result)
}
static VALUE
-reject_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
ary_reject_bang(VALUE ary)
{
- struct select_bang_arg args;
+ long i;
+ VALUE result = Qnil;
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);
+ 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++;
+ }
+ }
+ return result;
}
/*
@@ -3228,10 +3123,11 @@ ary_reject_bang(VALUE ary)
* ary.reject! { |item| block } -> ary or nil
* ary.reject! -> Enumerator
*
- * Deletes every element of +self+ for which the block evaluates to +true+,
- * if no changes were made returns +nil+.
+ * Equivalent to Array#delete_if, deleting elements from +self+ for which the
+ * block evaluates to +true+, but returns +nil+ if no changes were made.
*
- * The array may not be changed instantly every time the block is called.
+ * The array is changed instantly every time the block is called, not after
+ * the iteration is over.
*
* See also Enumerable#reject and Array#delete_if.
*
@@ -3242,7 +3138,6 @@ static VALUE
rb_ary_reject_bang(VALUE ary)
{
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
- rb_ary_modify(ary);
return ary_reject_bang(ary);
}
@@ -3252,7 +3147,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+. The ordering of non-rejected elements is maintained.
+ * block is not +true+.
*
* See also Array#delete_if
*
@@ -3558,10 +3453,12 @@ rb_ary_clear(VALUE ary)
static VALUE
rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
- VALUE item = Qundef, arg1, arg2;
+ VALUE item, arg1, arg2;
long beg = 0, end = 0, len = 0;
+ int block_p = FALSE;
if (rb_block_given_p()) {
+ block_p = TRUE;
rb_scan_args(argc, argv, "02", &arg1, &arg2);
argc += 1; /* hackish */
}
@@ -3603,7 +3500,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
ARY_SET_LEN(ary, end);
}
- if (item == Qundef) {
+ if (block_p) {
VALUE v;
long i;
@@ -3632,13 +3529,6 @@ 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.
*/
@@ -3660,62 +3550,32 @@ rb_ary_plus(VALUE x, VALUE y)
return z;
}
-static VALUE
-ary_append(VALUE x, VALUE y)
-{
- long n = RARRAY_LEN(y);
- if (n > 0) {
- rb_ary_splice(x, RARRAY_LEN(x), 0, RARRAY_CONST_PTR(y), n);
- }
- return x;
-}
-
/*
* call-seq:
- * ary.concat(other_ary1, other_ary2,...) -> ary
+ * ary.concat(other_ary) -> ary
*
- * Appends the elements of +other_ary+s to +self+.
+ * Appends the elements of +other_ary+ to +self+.
*
* [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
- * [ "a" ].concat( ["b"], ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
- * [ "a" ].concat #=> [ "a" ]
- *
* a = [ 1, 2, 3 ]
* a.concat( [ 4, 5 ] )
* a #=> [ 1, 2, 3, 4, 5 ]
*
- * a = [ 1, 2 ]
- * a.concat(a, a) #=> [1, 2, 1, 2, 1, 2]
- *
* See also Array#+.
*/
-static VALUE
-rb_ary_concat_multi(int argc, VALUE *argv, VALUE ary)
-{
- rb_ary_modify_check(ary);
-
- if (argc == 1) {
- rb_ary_concat(ary, argv[0]);
- }
- else if (argc > 1) {
- int i;
- VALUE args = rb_ary_tmp_new(argc);
- for (i = 0; i < argc; i++) {
- rb_ary_concat(args, argv[i]);
- }
- ary_append(ary, args);
- }
-
- return ary;
-}
-
VALUE
rb_ary_concat(VALUE x, VALUE y)
{
- return ary_append(x, to_ary(y));
+ rb_ary_modify_check(x);
+ y = to_ary(y);
+ if (RARRAY_LEN(y) > 0) {
+ rb_ary_splice(x, RARRAY_LEN(x), 0, y);
+ }
+ return x;
}
+
/*
* call-seq:
* ary * int -> new_ary
@@ -3781,7 +3641,7 @@ rb_ary_times(VALUE ary, VALUE times)
/*
* call-seq:
- * ary.assoc(obj) -> element_ary or nil
+ * ary.assoc(obj) -> new_ary or nil
*
* Searches through an array whose elements are also arrays comparing +obj+
* with the first element of each contained array using <code>obj.==</code>.
@@ -3816,7 +3676,7 @@ rb_ary_assoc(VALUE ary, VALUE key)
/*
* call-seq:
- * ary.rassoc(obj) -> element_ary or nil
+ * ary.rassoc(obj) -> new_ary or nil
*
* Searches through the array whose elements are also arrays.
*
@@ -3943,7 +3803,7 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
/*
* call-seq:
- * ary.hash -> integer
+ * ary.hash -> fixnum
*
* Compute a hash-code for this array.
*
@@ -3967,7 +3827,7 @@ rb_ary_hash(VALUE ary)
h = rb_hash_uint(h, NUM2LONG(n));
}
h = rb_hash_end(h);
- return ST2FIX(h);
+ return LONG2FIX(h);
}
/*
@@ -3986,31 +3846,15 @@ VALUE
rb_ary_includes(VALUE ary, VALUE item)
{
long i;
- VALUE e;
for (i=0; i<RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- if (rb_equal(e, item)) {
+ if (rb_equal(RARRAY_AREF(ary, i), item)) {
return Qtrue;
}
}
return Qfalse;
}
-static VALUE
-rb_ary_includes_by_eql(VALUE ary, VALUE item)
-{
- long i;
- VALUE e;
-
- for (i=0; i<RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- if (rb_eql(item, e)) {
- return Qtrue;
- }
- }
- return Qfalse;
-}
static VALUE
recursive_cmp(VALUE ary1, VALUE ary2, int recur)
@@ -4086,16 +3930,17 @@ ary_add_hash(VALUE hash, VALUE ary)
for (i=0; i<RARRAY_LEN(ary); i++) {
VALUE elt = RARRAY_AREF(ary, i);
- rb_hash_add_new_element(hash, elt, elt);
+ if (rb_hash_lookup2(hash, elt, Qundef) == Qundef) {
+ rb_hash_aset(hash, elt, elt);
+ }
}
return hash;
}
static inline VALUE
-ary_tmp_hash_new(VALUE ary)
+ary_tmp_hash_new(void)
{
- long size = RARRAY_LEN(ary);
- VALUE hash = rb_hash_new_with_size(size);
+ VALUE hash = rb_hash_new();
RBASIC_CLEAR_CLASS(hash);
return hash;
@@ -4104,7 +3949,7 @@ ary_tmp_hash_new(VALUE ary)
static VALUE
ary_make_hash(VALUE ary)
{
- VALUE hash = ary_tmp_hash_new(ary);
+ VALUE hash = ary_tmp_hash_new();
return ary_add_hash(hash, ary);
}
@@ -4115,7 +3960,9 @@ ary_add_hash_by(VALUE hash, VALUE ary)
for (i = 0; i < RARRAY_LEN(ary); ++i) {
VALUE v = rb_ary_elt(ary, i), k = rb_yield(v);
- rb_hash_add_new_element(hash, k, v);
+ if (rb_hash_lookup2(hash, k, Qundef) == Qundef) {
+ rb_hash_aset(hash, k, v);
+ }
}
return hash;
}
@@ -4123,19 +3970,18 @@ ary_add_hash_by(VALUE hash, VALUE ary)
static VALUE
ary_make_hash_by(VALUE ary)
{
- VALUE hash = ary_tmp_hash_new(ary);
+ VALUE hash = ary_tmp_hash_new();
return ary_add_hash_by(hash, ary);
}
static inline void
ary_recycle_hash(VALUE hash)
{
- assert(RBASIC_CLASS(hash) == 0);
if (RHASH(hash)->ntbl) {
st_table *tbl = RHASH(hash)->ntbl;
+ RHASH(hash)->ntbl = 0;
st_free_table(tbl);
}
- rb_gc_force_recycle(hash);
}
/*
@@ -4159,22 +4005,12 @@ static VALUE
rb_ary_diff(VALUE ary1, VALUE ary2)
{
VALUE ary3;
- VALUE hash;
+ volatile VALUE hash;
long i;
- ary2 = to_ary(ary2);
+ hash = ary_make_hash(to_ary(ary2));
ary3 = rb_ary_new();
- if (RARRAY_LEN(ary1) <= SMALL_ARRAY_LEN || RARRAY_LEN(ary2) <= SMALL_ARRAY_LEN) {
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- VALUE elt = rb_ary_elt(ary1, i);
- if (rb_ary_includes_by_eql(ary2, elt)) continue;
- rb_ary_push(ary3, elt);
- }
- return ary3;
- }
-
- hash = ary_make_hash(ary2);
for (i=0; i<RARRAY_LEN(ary1); i++) {
if (st_lookup(rb_hash_tbl_raw(hash), RARRAY_AREF(ary1, i), 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
@@ -4187,12 +4023,13 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
* call-seq:
* ary & other_ary -> new_ary
*
- * Set Intersection --- Returns a new array containing unique elements common to the
- * two arrays. The order is preserved from the original array.
+ * Set Intersection --- Returns a new array containing elements common to the
+ * two arrays, excluding any duplicates. The order is preserved from the
+ * original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
- * [ 1, 1, 3, 5 ] & [ 3, 2, 1 ] #=> [ 1, 3 ]
+ * [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
* [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
*
* See also Array#uniq.
@@ -4210,17 +4047,6 @@ rb_ary_and(VALUE ary1, VALUE ary2)
ary2 = to_ary(ary2);
ary3 = rb_ary_new();
if (RARRAY_LEN(ary2) == 0) return ary3;
-
- if (RARRAY_LEN(ary1) <= SMALL_ARRAY_LEN && RARRAY_LEN(ary2) <= SMALL_ARRAY_LEN) {
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- v = RARRAY_AREF(ary1, i);
- if (!rb_ary_includes_by_eql(ary2, v)) continue;
- if (rb_ary_includes_by_eql(ary3, v)) continue;
- rb_ary_push(ary3, v);
- }
- return ary3;
- }
-
hash = ary_make_hash(ary2);
table = rb_hash_tbl_raw(hash);
@@ -4249,12 +4075,11 @@ ary_hash_orset(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
* ary | other_ary -> new_ary
*
* Set Union --- Returns a new array by joining +ary+ with +other_ary+,
- * excluding any duplicates and preserving the order from the given arrays.
+ * excluding any duplicates and preserving the order from the original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
* [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
- * [ "c", "d", "a" ] | [ "a", "b", "c" ] #=> [ "c", "d", "a", "b" ]
*
* See also Array#uniq.
*/
@@ -4266,22 +4091,8 @@ rb_ary_or(VALUE ary1, VALUE ary2)
long i;
ary2 = to_ary(ary2);
- if (RARRAY_LEN(ary1) + RARRAY_LEN(ary2) <= SMALL_ARRAY_LEN) {
- ary3 = rb_ary_new();
- for (i=0; i<RARRAY_LEN(ary1); i++) {
- VALUE elt = rb_ary_elt(ary1, i);
- if (rb_ary_includes_by_eql(ary3, elt)) continue;
- rb_ary_push(ary3, elt);
- }
- for (i=0; i<RARRAY_LEN(ary2); i++) {
- VALUE elt = rb_ary_elt(ary2, i);
- if (rb_ary_includes_by_eql(ary3, elt)) continue;
- rb_ary_push(ary3, elt);
- }
- return ary3;
- }
-
hash = ary_make_hash(ary1);
+
for (i=0; i<RARRAY_LEN(ary2); i++) {
VALUE elt = RARRAY_AREF(ary2, i);
if (!st_update(RHASH_TBL_RAW(hash), (st_data_t)elt, ary_hash_orset, (st_data_t)elt)) {
@@ -4293,116 +4104,6 @@ rb_ary_or(VALUE ary1, VALUE ary2)
return ary3;
}
-/*
- * call-seq:
- * ary.max -> obj
- * ary.max { |a, b| block } -> obj
- * ary.max(n) -> array
- * ary.max(n) { |a, b| block } -> array
- *
- * Returns the object in _ary_ with the maximum value. The
- * first form assumes all objects implement <code>Comparable</code>;
- * the second uses the block to return <em>a <=> b</em>.
- *
- * ary = %w(albatross dog horse)
- * ary.max #=> "horse"
- * ary.max { |a, b| a.length <=> b.length } #=> "albatross"
- *
- * If the +n+ argument is given, maximum +n+ elements are returned
- * as an array.
- *
- * ary = %w[albatross dog horse]
- * ary.max(2) #=> ["horse", "dog"]
- * ary.max(2) {|a, b| a.length <=> b.length } #=> ["albatross", "horse"]
- */
-static VALUE
-rb_ary_max(int argc, VALUE *argv, VALUE ary)
-{
- struct cmp_opt_data cmp_opt = { 0, 0 };
- VALUE result = Qundef, v;
- VALUE num;
- long i;
-
- rb_scan_args(argc, argv, "01", &num);
-
- if (!NIL_P(num))
- return rb_nmin_run(ary, num, 0, 1, 1);
-
- if (rb_block_given_p()) {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- v = RARRAY_AREF(ary, i);
- if (result == Qundef || rb_cmpint(rb_yield_values(2, v, result), v, result) > 0) {
- result = v;
- }
- }
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- v = RARRAY_AREF(ary, i);
- if (result == Qundef || OPTIMIZED_CMP(v, result, cmp_opt) > 0) {
- result = v;
- }
- }
- }
- if (result == Qundef) return Qnil;
- return result;
-}
-
-/*
- * call-seq:
- * ary.min -> obj
- * ary.min {| a,b | block } -> obj
- * ary.min(n) -> array
- * ary.min(n) {| a,b | block } -> array
- *
- * Returns the object in _ary_ with the minimum value. The
- * first form assumes all objects implement <code>Comparable</code>;
- * the second uses the block to return <em>a <=> b</em>.
- *
- * ary = %w(albatross dog horse)
- * ary.min #=> "albatross"
- * ary.min { |a, b| a.length <=> b.length } #=> "dog"
- *
- * If the +n+ argument is given, minimum +n+ elements are returned
- * as an array.
- *
- * ary = %w[albatross dog horse]
- * ary.min(2) #=> ["albatross", "dog"]
- * ary.min(2) {|a, b| a.length <=> b.length } #=> ["dog", "horse"]
- */
-static VALUE
-rb_ary_min(int argc, VALUE *argv, VALUE ary)
-{
- struct cmp_opt_data cmp_opt = { 0, 0 };
- VALUE result = Qundef, v;
- VALUE num;
- long i;
-
- rb_scan_args(argc, argv, "01", &num);
-
- if (!NIL_P(num))
- return rb_nmin_run(ary, num, 0, 0, 1);
-
- if (rb_block_given_p()) {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- v = RARRAY_AREF(ary, i);
- if (result == Qundef || rb_cmpint(rb_yield_values(2, v, result), v, result) < 0) {
- result = v;
- }
- }
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- v = RARRAY_AREF(ary, i);
- if (result == Qundef || OPTIMIZED_CMP(v, result, cmp_opt) < 0) {
- result = v;
- }
- }
- }
- if (result == Qundef) return Qnil;
- return result;
-}
-
static int
push_value(st_data_t key, st_data_t val, st_data_t ary)
{
@@ -4422,8 +4123,6 @@ 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" ]
@@ -4479,8 +4178,6 @@ 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"]
*
@@ -4632,15 +4329,11 @@ 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)) {
+ if (NIL_P(tmp) || (level >= 0 && RARRAY_LEN(stack) / 2 >= level)) {
rb_ary_push(result, elt);
}
else {
@@ -4669,7 +4362,7 @@ flatten(VALUE ary, int level, int *modified)
st_free_table(memo);
- RBASIC_SET_CLASS(result, rb_obj_class(ary));
+ RBASIC_SET_CLASS(result, rb_class_of(ary));
return result;
}
@@ -4867,7 +4560,6 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
VALUE opts, randgen = rb_cRandom;
long n, len, i, j, k, idx[10];
long rnds[numberof(idx)];
- long memo_threshold;
if (OPTHASH_GIVEN_P(opts)) {
VALUE rnd;
@@ -4927,11 +4619,6 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
}
return rb_ary_new_from_args(3, RARRAY_AREF(ary, i), RARRAY_AREF(ary, j), RARRAY_AREF(ary, k));
}
- memo_threshold =
- len < 2560 ? len / 128 :
- len < 5120 ? len / 64 :
- len < 10240 ? len / 32 :
- len / 16;
if (n <= numberof(idx)) {
long sorted[numberof(idx)];
sorted[0] = idx[0] = rnds[0];
@@ -4951,38 +4638,6 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
}
});
}
- else if (n <= memo_threshold / 2) {
- long max_idx = 0;
-#undef RUBY_UNTYPED_DATA_WARNING
-#define RUBY_UNTYPED_DATA_WARNING 0
- VALUE vmemo = Data_Wrap_Struct(0, 0, st_free_table, 0);
- st_table *memo = st_init_numtable_with_size(n);
- DATA_PTR(vmemo) = memo;
- result = rb_ary_new_capa(n);
- RARRAY_PTR_USE(result, ptr_result, {
- for (i=0; i<n; i++) {
- long r = RAND_UPTO(len-i) + i;
- ptr_result[i] = r;
- if (r > max_idx) max_idx = r;
- }
- len = RARRAY_LEN(ary);
- if (len <= max_idx) n = 0;
- else if (n > len) n = len;
- RARRAY_PTR_USE(ary, ptr_ary, {
- for (i=0; i<n; i++) {
- long j2 = j = ptr_result[i];
- long i2 = i;
- st_data_t value;
- if (st_lookup(memo, (st_data_t)i, &value)) i2 = (long)value;
- if (st_lookup(memo, (st_data_t)j, &value)) j2 = (long)value;
- st_insert(memo, (st_data_t)j, (st_data_t)i2);
- ptr_result[i] = ptr_ary[j2];
- }
- });
- });
- DATA_PTR(vmemo) = 0;
- st_free_table(memo);
- }
else {
result = rb_ary_dup(ary);
RBASIC_CLEAR_CLASS(result);
@@ -5015,7 +4670,7 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
mul = NUM2LONG(n);
if (mul <= 0) return INT2FIX(0);
n = LONG2FIX(mul);
- return rb_fix_mul_fix(rb_ary_length(self), n);
+ return rb_funcallv(rb_ary_length(self), '*', 1, &n);
}
/*
@@ -5090,8 +4745,8 @@ yield_indexed_values(const VALUE values, const long r, const long *const p)
/*
* Compute permutations of +r+ elements of the set <code>[0..n-1]</code>.
*
- * When we have a complete permutation of array indices, copy the values
- * at those indices into a new array and yield that array.
+ * When we have a complete permutation of array indexes, copy the values
+ * at those indexes into a new array and yield that array.
*
* n: the size of the set
* r: the number of elements in each permutation
@@ -5141,16 +4796,10 @@ permute0(const long n, const long r, long *const p, char *const used, const VALU
static VALUE
descending_factorial(long from, long how_many)
{
- VALUE cnt;
- if (how_many > 0) {
- cnt = LONG2FIX(from);
- while (--how_many > 0) {
- long v = --from;
- cnt = rb_int_mul(cnt, LONG2FIX(v));
- }
- }
- else {
- cnt = LONG2FIX(how_many == 0);
+ VALUE cnt = LONG2FIX(how_many >= 0);
+ while (how_many-- > 0) {
+ VALUE v = LONG2FIX(from--);
+ cnt = rb_funcallv(cnt, '*', 1, &v);
}
return cnt;
}
@@ -5158,23 +4807,16 @@ descending_factorial(long from, long how_many)
static VALUE
binomial_coefficient(long comb, long size)
{
- VALUE r;
- long i;
+ VALUE r, v;
if (comb > size-comb) {
comb = size-comb;
}
if (comb < 0) {
return LONG2FIX(0);
}
- else if (comb == 0) {
- return LONG2FIX(1);
- }
- r = LONG2FIX(size);
- for (i = 1; i < comb; ++i) {
- r = rb_int_mul(r, LONG2FIX(size - i));
- r = rb_int_idiv(r, LONG2FIX(i + 1));
- }
- return r;
+ r = descending_factorial(size, comb);
+ v = descending_factorial(comb, comb);
+ return rb_funcallv(r, id_div, 1, &v);
}
static VALUE
@@ -5238,7 +4880,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
}
else { /* this is the general case */
volatile VALUE t0;
- long *p = ALLOCV_N(long, t0, r+roomof(n, sizeof(long)));
+ long *p = (long*)ALLOCV(t0, r*sizeof(long)+n*sizeof(char));
char *used = (char*)(p + r);
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
RBASIC_CLEAR_CLASS(ary0);
@@ -5322,7 +4964,7 @@ rb_ary_combination(VALUE ary, VALUE num)
rb_yield(rb_ary_new2(0));
}
else if (n == 1) {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
+ for (i = 0; i < len; i++) {
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
@@ -5343,8 +4985,8 @@ rb_ary_combination(VALUE ary, VALUE num)
* Compute repeated permutations of +r+ elements of the set
* <code>[0..n-1]</code>.
*
- * When we have a complete repeated permutation of array indices, copy the
- * values at those indices into a new array and yield that array.
+ * When we have a complete repeated permutation of array indexes, copy the
+ * values at those indexes into a new array and yield that array.
*
* n: the size of the set
* r: the number of elements in each permutation
@@ -5379,14 +5021,14 @@ rb_ary_repeated_permutation_size(VALUE ary, VALUE args, VALUE eobj)
{
long n = RARRAY_LEN(ary);
long k = NUM2LONG(RARRAY_AREF(args, 0));
+ VALUE v;
if (k < 0) {
return LONG2FIX(0);
}
- if (n <= 0) {
- return LONG2FIX(!k);
- }
- return rb_int_positive_pow(n, (unsigned long)k);
+
+ v = LONG2NUM(k);
+ return rb_funcallv(LONG2NUM(n), id_power, 1, &v);
}
/*
@@ -5434,7 +5076,7 @@ rb_ary_repeated_permutation(VALUE ary, VALUE num)
}
else { /* this is the general case */
volatile VALUE t0;
- long *p = ALLOCV_N(long, t0, r);
+ long *p = ALLOCV_N(long, t0, r * sizeof(long));
VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
RBASIC_CLEAR_CLASS(ary0);
@@ -5521,7 +5163,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
rb_yield(rb_ary_new2(0));
}
else if (n == 1) {
- for (i = 0; i < RARRAY_LEN(ary); i++) {
+ for (i = 0; i < len; i++) {
rb_yield(rb_ary_new3(1, RARRAY_AREF(ary, i)));
}
}
@@ -5678,7 +5320,7 @@ rb_ary_take(VALUE obj, VALUE n)
/*
* call-seq:
- * ary.take_while { |obj| block } -> new_ary
+ * ary.take_while { |arr| block } -> new_ary
* ary.take_while -> Enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+, then
@@ -5737,7 +5379,7 @@ rb_ary_drop(VALUE ary, VALUE n)
/*
* call-seq:
- * ary.drop_while { |obj| block } -> new_ary
+ * ary.drop_while { |arr| block } -> new_ary
* ary.drop_while -> Enumerator
*
* Drops elements up to, but not including, the first element for which the
@@ -5773,19 +5415,13 @@ rb_ary_drop_while(VALUE ary)
*/
static VALUE
-rb_ary_any_p(int argc, VALUE *argv, VALUE ary)
+rb_ary_any_p(VALUE ary)
{
long i, len = RARRAY_LEN(ary);
const VALUE *ptr = RARRAY_CONST_PTR(ary);
- rb_check_arity(argc, 0, 1);
if (!len) return Qfalse;
- if (argc) {
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_funcall(argv[0], idEqq, 1, RARRAY_AREF(ary, i)))) return Qtrue;
- }
- }
- else if (!rb_block_given_p()) {
+ if (!rb_block_given_p()) {
for (i = 0; i < len; ++i) if (RTEST(ptr[i])) return Qtrue;
}
else {
@@ -5797,205 +5433,6 @@ rb_ary_any_p(int argc, VALUE *argv, VALUE ary)
}
/*
- * 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) #=> TypeError: Integer does not have #dig method
- * [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);
-}
-
-static inline VALUE
-finish_exact_sum(long n, VALUE r, VALUE v, int z)
-{
- if (n != 0)
- v = rb_fix_plus(LONG2FIX(n), v);
- if (r != Qundef) {
- /* r can be an Integer when mathn is loaded */
- if (FIXNUM_P(r))
- v = rb_fix_plus(r, v);
- else if (RB_TYPE_P(r, T_BIGNUM))
- v = rb_big_plus(r, v);
- else
- v = rb_rational_plus(r, v);
- }
- else if (!n && z) {
- v = rb_fix_plus(LONG2FIX(0), v);
- }
- return v;
-}
-
-/*
- * call-seq:
- * ary.sum(init=0) -> number
- * ary.sum(init=0) {|e| expr } -> number
- *
- * Returns the sum of elements.
- * For example, [e1, e2, e3].sum returns init + e1 + e2 + e3.
- *
- * If a block is given, the block is applied to each element
- * before addition.
- *
- * If <i>ary</i> is empty, it returns <i>init</i>.
- *
- * [].sum #=> 0
- * [].sum(0.0) #=> 0.0
- * [1, 2, 3].sum #=> 6
- * [3, 5.5].sum #=> 8.5
- * [2.5, 3.0].sum(0.0) {|e| e * e } #=> 15.25
- * [Object.new].sum #=> TypeError
- *
- * The (arithmetic) mean value of an array can be obtained as follows.
- *
- * mean = ary.sum(0.0) / ary.length
- *
- * This method can be used for non-numeric objects by
- * explicit <i>init</i> argument.
- *
- * ["a", "b", "c"].sum("") #=> "abc"
- * [[1], [[2]], [3]].sum([]) #=> [1, [2], 3]
- *
- * However, Array#join and Array#flatten is faster than Array#sum for
- * array of strings and array of arrays.
- *
- * ["a", "b", "c"].join #=> "abc"
- * [[1], [[2]], [3]].flatten(1) #=> [1, [2], 3]
- *
- *
- * Array#sum method may not respect method redefinition of "+" methods
- * such as Integer#+.
- *
- */
-
-static VALUE
-rb_ary_sum(int argc, VALUE *argv, VALUE ary)
-{
- VALUE e, v, r;
- long i, n;
- int block_given;
-
- if (rb_scan_args(argc, argv, "01", &v) == 0)
- v = LONG2FIX(0);
-
- block_given = rb_block_given_p();
-
- if (RARRAY_LEN(ary) == 0)
- return v;
-
- n = 0;
- r = Qundef;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- if (block_given)
- e = rb_yield(e);
- if (FIXNUM_P(e)) {
- n += FIX2LONG(e); /* should not overflow long type */
- if (!FIXABLE(n)) {
- v = rb_big_plus(LONG2NUM(n), v);
- n = 0;
- }
- }
- else if (RB_TYPE_P(e, T_BIGNUM))
- v = rb_big_plus(e, v);
- else if (RB_TYPE_P(e, T_RATIONAL)) {
- if (r == Qundef)
- r = e;
- else
- r = rb_rational_plus(r, e);
- }
- else
- goto not_exact;
- }
- v = finish_exact_sum(n, r, v, argc!=0);
- return v;
-
- not_exact:
- v = finish_exact_sum(n, r, v, i!=0);
-
- if (RB_FLOAT_TYPE_P(e)) {
- /*
- * Kahan-Babuska balancing compensated summation algorithm
- * See http://link.springer.com/article/10.1007/s00607-005-0139-x
- */
- double f, c;
-
- f = NUM2DBL(v);
- c = 0.0;
- goto has_float_value;
- for (; i < RARRAY_LEN(ary); i++) {
- double x, t;
- e = RARRAY_AREF(ary, i);
- if (block_given)
- e = rb_yield(e);
- if (RB_FLOAT_TYPE_P(e))
- has_float_value:
- x = RFLOAT_VALUE(e);
- else if (FIXNUM_P(e))
- x = FIX2LONG(e);
- else if (RB_TYPE_P(e, T_BIGNUM))
- x = rb_big2dbl(e);
- else if (RB_TYPE_P(e, T_RATIONAL))
- x = rb_num2dbl(e);
- else
- goto not_float;
-
- if (isnan(f)) continue;
- if (isnan(x)) {
- f = x;
- continue;
- }
- if (isinf(x)) {
- if (isinf(f) && signbit(x) != signbit(f))
- f = NAN;
- else
- f = x;
- continue;
- }
- if (isinf(f)) continue;
-
- t = f + x;
- if (fabs(f) >= fabs(x))
- c += ((f - t) + x);
- else
- c += ((x - t) + f);
- f = t;
- }
- f += c;
- return DBL2NUM(f);
-
- not_float:
- v = DBL2NUM(f);
- }
-
- goto has_some_value;
- for (; i < RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- if (block_given)
- e = rb_yield(e);
- has_some_value:
- v = rb_funcall(v, idPLUS, 1, e);
- }
- return v;
-}
-
-/*
* Arrays are ordered, integer-indexed collections of any object.
*
* Array indexing starts at 0, as in C or Java. A negative index is assumed
@@ -6028,8 +5465,7 @@ rb_ary_sum(int argc, VALUE *argv, 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) {|i| i.to_s } #=> ["0", "1", "2", "3"]
+ * Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
*
* This is also a quick way to build up multi-dimensional arrays:
*
@@ -6265,14 +5701,12 @@ Init_Array(void)
rb_define_method(rb_cArray, "fetch", rb_ary_fetch, -1);
rb_define_method(rb_cArray, "first", rb_ary_first, -1);
rb_define_method(rb_cArray, "last", rb_ary_last, -1);
- rb_define_method(rb_cArray, "concat", rb_ary_concat_multi, -1);
+ rb_define_method(rb_cArray, "concat", rb_ary_concat, 1);
rb_define_method(rb_cArray, "<<", rb_ary_push, 1);
rb_define_method(rb_cArray, "push", rb_ary_push_m, -1);
- rb_define_alias(rb_cArray, "append", "push");
rb_define_method(rb_cArray, "pop", rb_ary_pop_m, -1);
rb_define_method(rb_cArray, "shift", rb_ary_shift_m, -1);
rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1);
- rb_define_alias(rb_cArray, "prepend", "unshift");
rb_define_method(rb_cArray, "insert", rb_ary_insert, -1);
rb_define_method(rb_cArray, "each", rb_ary_each, 0);
rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0);
@@ -6325,9 +5759,6 @@ Init_Array(void)
rb_define_method(rb_cArray, "&", rb_ary_and, 1);
rb_define_method(rb_cArray, "|", rb_ary_or, 1);
- rb_define_method(rb_cArray, "max", rb_ary_max, -1);
- rb_define_method(rb_cArray, "min", rb_ary_min, -1);
-
rb_define_method(rb_cArray, "uniq", rb_ary_uniq, 0);
rb_define_method(rb_cArray, "uniq!", rb_ary_uniq_bang, 0);
rb_define_method(rb_cArray, "compact", rb_ary_compact, 0);
@@ -6350,10 +5781,10 @@ 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, -1);
- rb_define_method(rb_cArray, "dig", rb_ary_dig, -1);
- rb_define_method(rb_cArray, "sum", rb_ary_sum, -1);
+ rb_define_method(rb_cArray, "any?", rb_ary_any_p, 0);
+ id_cmp = rb_intern("<=>");
id_random = rb_intern("random");
+ id_div = rb_intern("div");
+ id_power = rb_intern("**");
}
diff --git a/basictest/runner.rb b/basictest/runner.rb
deleted file mode 100755
index 0f398e7acc..0000000000
--- a/basictest/runner.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#! ./miniruby
-
-exit if defined?(CROSS_COMPILING) and CROSS_COMPILING
-ruby = ENV["RUBY"]
-unless ruby
- load './rbconfig.rb'
- ruby = "./#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}"
-end
-unless File.exist? ruby
- print "#{ruby} is not found.\n"
- print "Try `make' first, then `make test', please.\n"
- exit false
-end
-ARGV[0] and opt = ARGV[0][/\A--run-opt=(.*)/, 1] and ARGV.shift
-
-$stderr.reopen($stdout)
-error = ''
-
-srcdir = File.expand_path('..', File.dirname(__FILE__))
-if env = ENV["RUBYOPT"]
- ENV["RUBYOPT"] = env + " -W1"
-end
-`#{ruby} #{opt} -W1 #{srcdir}/basictest/test.rb #{ARGV.join(' ')}`.each_line do |line|
- if line =~ /^end of test/
- print "\ntest succeeded\n"
- exit true
- end
- error << line if %r:^(basictest/test.rb|not): =~ line
-end
-puts
-print error
-print "test failed\n"
-exit false
diff --git a/basictest/test.rb b/basictest/test.rb
deleted file mode 100755
index 25d52ca1ef..0000000000
--- a/basictest/test.rb
+++ /dev/null
@@ -1,2367 +0,0 @@
-#! /usr/bin/env ruby
-# -*- coding: us-ascii -*-
-
-$testnum=0
-$ntest=0
-$failed = 0
-class Progress
- def initialize
- @color = nil
- @tty = nil
- @quiet = nil
- @verbose = nil
- ARGV.each do |arg|
- case arg
- when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
- warn "unknown --color argument: #$3" if $3
- @color = $1 ? nil : !$2
- when /\A--tty(=(?:yes|(no)|(.*)))?\z/
- warn "unknown --tty argument: #$3" if $3
- @tty = !$1 || !$2
- true
- when /\A-(q|-quiet)\z/
- @quiet = true
- when /\A-(v|-verbose)\z/
- @verbose = true
- end
- end
- @tty = STDERR.tty? && !STDOUT.tty? && /dumb/ !~ ENV["TERM"] if @tty.nil?
- @eol = @tty && !@verbose ? "\r\e[K\r" : "\n"
- case @color
- when nil
- @color = @tty
- end
- if @color
- # dircolors-like style
- 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"
- else
- @passed = @failed = @reset = ""
- end
- extend(Rotator) if @tty
- end
-
- def passed_string
- "."
- end
- def failed_string
- "#{@failed}F#{@reset}"
- end
- def init_string
- end
- def finish_string
- if @quiet
- @eol
- else
- "#{@passed}#{@ok ? 'OK' : ''} #{$testnum}#{@reset}#{@eol}"
- end
- end
- def pass
- STDERR.print passed_string
- end
- def fail
- @ok = false
- STDERR.print failed_string
- end
- def init
- @ok = true
- STDERR.print init_string
- end
- def finish
- STDERR.print finish_string
- end
-
- module Rotator
- ROTATOR = %w[- \\ | /]
- BS = "\b" * ROTATOR[0].size
- def passed_string
- "#{BS}#{ROTATOR[(@count += 1) % ROTATOR.size]}"
- end
- def failed_string
- "#{BS}#{super}#{ROTATOR[@count % ROTATOR.size]}"
- end
- def init_string
- @count = 0
- " "
- end
- def finish_string
- s = "#{BS}#{' ' * BS.size}#{BS}#{super}"
- s.gsub!(/\n/, "\r\e[2K\r") if @quiet
- s
- end
- end
-end
-PROGRESS = Progress.new
-
-def test_check(what)
- unless $ntest.zero?
- PROGRESS.finish
- end
- STDERR.print "#{$0}:#{what} "
- PROGRESS.init
- $what = what
- $testnum = 0
-end
-
-def test_ok(cond,n=1)
- $testnum+=1
- $ntest+=1
- where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}"
- if cond
- PROGRESS.pass
- printf "ok %d (%s)\n", $testnum, where
- else
- PROGRESS.fail
- printf "not ok %s %d -- %s\n", $what, $testnum, where
- $failed+=1
- end
- STDOUT.flush
- STDERR.flush
-end
-
-# make sure conditional operators work
-
-test_check "assignment"
-
-a=[]; a[0] ||= "bar";
-test_ok(a[0] == "bar")
-h={}; h["foo"] ||= "bar";
-test_ok(h["foo"] == "bar")
-
-aa = 5
-aa ||= 25
-test_ok(aa == 5)
-bb ||= 25
-test_ok(bb == 25)
-cc &&=33
-test_ok(cc == nil)
-cc = 5
-cc &&=44
-test_ok(cc == 44)
-
-a = nil; test_ok(a == nil)
-a = 1; test_ok(a == 1)
-a = []; test_ok(a == [])
-a = [1]; test_ok(a == [1])
-a = [nil]; test_ok(a == [nil])
-a = [[]]; test_ok(a == [[]])
-a = [1,2]; test_ok(a == [1,2])
-a = [*[]]; test_ok(a == [])
-a = [*[1]]; test_ok(a == [1])
-a = [*[1,2]]; test_ok(a == [1,2])
-
-a = *[]; test_ok(a == [])
-a = *[1]; test_ok(a == [1])
-a = *[nil]; test_ok(a == [nil])
-a = *[[]]; test_ok(a == [[]])
-a = *[1,2]; test_ok(a == [1,2])
-a = *[*[]]; test_ok(a == [])
-a = *[*[1]]; test_ok(a == [1])
-a = *[*[1,2]]; test_ok(a == [1,2])
-
-a, = nil; test_ok(a == nil)
-a, = 1; test_ok(a == 1)
-a, = []; test_ok(a == nil)
-a, = [1]; test_ok(a == 1)
-a, = [nil]; test_ok(a == nil)
-a, = [[]]; test_ok(a == [])
-a, = 1,2; test_ok(a == 1)
-a, = [1,2]; test_ok(a == 1)
-a, = [*[]]; test_ok(a == nil)
-a, = [*[1]]; test_ok(a == 1)
-a, = *[1,2]; test_ok(a == 1)
-a, = [*[1,2]]; test_ok(a == 1)
-
-a, = *[]; test_ok(a == nil)
-a, = *[1]; test_ok(a == 1)
-a, = *[nil]; test_ok(a == nil)
-a, = *[[]]; test_ok(a == [])
-a, = *[1,2]; test_ok(a == 1)
-a, = *[*[]]; test_ok(a == nil)
-a, = *[*[1]]; test_ok(a == 1)
-a, = *[*[1,2]]; test_ok(a == 1)
-
-*a = nil; test_ok(a == [nil])
-*a = 1; test_ok(a == [1])
-*a = []; test_ok(a == [])
-*a = [1]; test_ok(a == [1])
-*a = [nil]; test_ok(a == [nil])
-*a = [[]]; test_ok(a == [[]])
-*a = [1,2]; test_ok(a == [1,2])
-*a = [*[]]; test_ok(a == [])
-*a = [*[1]]; test_ok(a == [1])
-*a = [*[1,2]]; test_ok(a == [1,2])
-
-*a = *[]; test_ok(a == [])
-*a = *[1]; test_ok(a == [1])
-*a = *[nil]; test_ok(a == [nil])
-*a = *[[]]; test_ok(a == [[]])
-*a = *[1,2]; test_ok(a == [1,2])
-*a = *[*[]]; test_ok(a == [])
-*a = *[*[1]]; test_ok(a == [1])
-*a = *[*[1,2]]; test_ok(a == [1,2])
-
-a,b,*c = nil; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = 1; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = []; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = [1]; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = [nil]; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = [[]]; test_ok([a,b,c] == [[],nil,[]])
-a,b,*c = [1,2]; test_ok([a,b,c] == [1,2,[]])
-a,b,*c = [*[]]; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = [*[1]]; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = [*[1,2]]; test_ok([a,b,c] == [1,2,[]])
-
-a,b,*c = *[]; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = *[1]; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = *[nil]; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = *[[]]; test_ok([a,b,c] == [[],nil,[]])
-a,b,*c = *[1,2]; test_ok([a,b,c] == [1,2,[]])
-a,b,*c = *[*[]]; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = *[*[1]]; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = *[*[1,2]]; test_ok([a,b,c] == [1,2,[]])
-
-def f; yield nil; end; f {|a| test_ok(a == nil)}
-def f; yield 1; end; f {|a| test_ok(a == 1)}
-def f; yield []; end; f {|a| test_ok(a == [])}
-def f; yield [1]; end; f {|a| test_ok(a == [1])}
-def f; yield [nil]; end; f {|a| test_ok(a == [nil])}
-def f; yield [[]]; end; f {|a| test_ok(a == [[]])}
-def f; yield [*[]]; end; f {|a| test_ok(a == [])}
-def f; yield [*[1]]; end; f {|a| test_ok(a == [1])}
-def f; yield [*[1,2]]; end; f {|a| test_ok(a == [1,2])}
-def f; yield *[]; end; f {|a| test_ok(a == nil)}
-def f; yield *[1]; end; f {|a| test_ok(a == 1)}
-def f; yield *[nil]; end; f {|a| test_ok(a == nil)}
-def f; yield *[[]]; end; f {|a| test_ok(a == [])}
-def f; yield *[*[]]; end; f {|a| test_ok(a == nil)}
-def f; yield *[*[1]]; end; f {|a| test_ok(a == 1)}
-def f; yield *[*[1,2]]; end; f {|a| test_ok(a == 1)}
-
-def f; yield; end; f {|a,| test_ok(a == nil)}
-def f; yield nil; end; f {|a,| test_ok(a == nil)}
-def f; yield 1; end; f {|a,| test_ok(a == 1)}
-def f; yield []; end; f {|a,| test_ok(a == nil)}
-def f; yield [1]; end; f {|a,| test_ok(a == 1)}
-def f; yield [nil]; end; f {|a,| test_ok(a == nil)}
-def f; yield [[]]; end; f {|a,| test_ok(a == [])}
-def f; yield [*[]]; end; f {|a,| test_ok(a == nil)}
-def f; yield [*[1]]; end; f {|a,| test_ok(a == 1)}
-def f; yield [*[1,2]]; end; f {|a,| test_ok(a == 1)}
-
-def f; yield *[]; end; f {|a,| test_ok(a == nil)}
-def f; yield *[1]; end; f {|a,| test_ok(a == 1)}
-def f; yield *[nil]; end; f {|a,| test_ok(a == nil)}
-def f; yield *[[]]; end; f {|a,| test_ok(a == nil)}
-def f; yield *[*[]]; end; f {|a,| test_ok(a == nil)}
-def f; yield *[*[1]]; end; f {|a,| test_ok(a == 1)}
-def f; yield *[*[1,2]]; end; f {|a,| test_ok(a == 1)}
-
-def f; yield; end; f {|*a| test_ok(a == [])}
-def f; yield nil; end; f {|*a| test_ok(a == [nil])}
-def f; yield 1; end; f {|*a| test_ok(a == [1])}
-def f; yield []; end; f {|*a| test_ok(a == [[]])}
-def f; yield [1]; end; f {|*a| test_ok(a == [[1]])}
-def f; yield [nil]; end; f {|*a| test_ok(a == [[nil]])}
-def f; yield [[]]; end; f {|*a| test_ok(a == [[[]]])}
-def f; yield [1,2]; end; f {|*a| test_ok(a == [[1,2]])}
-def f; yield [*[]]; end; f {|*a| test_ok(a == [[]])}
-def f; yield [*[1]]; end; f {|*a| test_ok(a == [[1]])}
-def f; yield [*[1,2]]; end; f {|*a| test_ok(a == [[1,2]])}
-
-def f; yield *[]; end; f {|*a| test_ok(a == [])}
-def f; yield *[1]; end; f {|*a| test_ok(a == [1])}
-def f; yield *[nil]; end; f {|*a| test_ok(a == [nil])}
-def f; yield *[[]]; end; f {|*a| test_ok(a == [[]])}
-def f; yield *[*[]]; end; f {|*a| test_ok(a == [])}
-def f; yield *[*[1]]; end; f {|*a| test_ok(a == [1])}
-def f; yield *[*[1,2]]; end; f {|*a| test_ok(a == [1,2])}
-
-def f; yield; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield nil; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield 1; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
-def f; yield []; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield [1]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
-def f; yield [nil]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield [[]]; end; f {|a,b,*c| test_ok([a,b,c] == [[],nil,[]])}
-def f; yield [*[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield [*[1]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
-def f; yield [*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])}
-
-def f; yield *[]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield *[1]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
-def f; yield *[nil]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield *[[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield *[*[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
-def f; yield *[*[1]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
-def f; yield *[*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])}
-
-def r; return; end; a = r(); test_ok(a == nil)
-def r; return nil; end; a = r(); test_ok(a == nil)
-def r; return 1; end; a = r(); test_ok(a == 1)
-def r; return []; end; a = r(); test_ok(a == [])
-def r; return [1]; end; a = r(); test_ok(a == [1])
-def r; return [nil]; end; a = r(); test_ok(a == [nil])
-def r; return [[]]; end; a = r(); test_ok(a == [[]])
-def r; return [*[]]; end; a = r(); test_ok(a == [])
-def r; return [*[1]]; end; a = r(); test_ok(a == [1])
-def r; return [*[1,2]]; end; a = r(); test_ok(a == [1,2])
-
-def r; return *[]; end; a = r(); test_ok(a == [])
-def r; return *[1]; end; a = r(); test_ok(a == [1])
-def r; return *[nil]; end; a = r(); test_ok(a == [nil])
-def r; return *[[]]; end; a = r(); test_ok(a == [[]])
-def r; return *[*[]]; end; a = r(); test_ok(a == [])
-def r; return *[*[1]]; end; a = r(); test_ok(a == [1])
-def r; return *[*[1,2]]; end; a = r(); test_ok(a == [1,2])
-
-def r; return *[[]]; end; a = *r(); test_ok(a == [[]])
-def r; return *[*[1,2]]; end; a = *r(); test_ok(a == [1,2])
-
-def r; return; end; *a = r(); test_ok(a == [nil])
-def r; return nil; end; *a = r(); test_ok(a == [nil])
-def r; return 1; end; *a = r(); test_ok(a == [1])
-def r; return []; end; *a = r(); test_ok(a == [])
-def r; return [1]; end; *a = r(); test_ok(a == [1])
-def r; return [nil]; end; *a = r(); test_ok(a == [nil])
-def r; return [[]]; end; *a = r(); test_ok(a == [[]])
-def r; return [1,2]; end; *a = r(); test_ok(a == [1,2])
-def r; return [*[]]; end; *a = r(); test_ok(a == [])
-def r; return [*[1]]; end; *a = r(); test_ok(a == [1])
-def r; return [*[1,2]]; end; *a = r(); test_ok(a == [1,2])
-
-def r; return *[]; end; *a = r(); test_ok(a == [])
-def r; return *[1]; end; *a = r(); test_ok(a == [1])
-def r; return *[nil]; end; *a = r(); test_ok(a == [nil])
-def r; return *[[]]; end; *a = r(); test_ok(a == [[]])
-def r; return *[1,2]; end; *a = r(); test_ok(a == [1,2])
-def r; return *[*[]]; end; *a = r(); test_ok(a == [])
-def r; return *[*[1]]; end; *a = r(); test_ok(a == [1])
-def r; return *[*[1,2]]; end; *a = r(); test_ok(a == [1,2])
-
-def r; return *[[]]; end; *a = *r(); test_ok(a == [[]])
-def r; return *[1,2]; end; *a = *r(); test_ok(a == [1,2])
-def r; return *[*[1,2]]; end; *a = *r(); test_ok(a == [1,2])
-
-def r; return; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return nil; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return 1; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
-def r; return []; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return [1]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
-def r; return [nil]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return [[]]; end; a,b,*c = r(); test_ok([a,b,c] == [[],nil,[]])
-def r; return [1,2]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
-def r; return [*[]]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return [*[1]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
-def r; return [*[1,2]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
-
-def r; return *[]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return *[1]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
-def r; return *[nil]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return *[[]]; end; a,b,*c = r(); test_ok([a,b,c] == [[],nil,[]])
-def r; return *[1,2]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
-def r; return *[*[]]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
-def r; return *[*[1]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
-def r; return *[*[1,2]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
-
-f = lambda {|r,| test_ok([] == r)}
-f.call([], *[])
-
-f = lambda {|r,*l| test_ok([] == r); test_ok([1] == l)}
-f.call([], *[1])
-
-f = lambda{|x| x}
-test_ok(f.call(42) == 42)
-test_ok(f.call([42]) == [42])
-test_ok(f.call([[42]]) == [[42]])
-test_ok(f.call([42,55]) == [42,55])
-
-f = lambda{|x,| x}
-test_ok(f.call(42) == 42)
-test_ok(f.call([42]) == [42])
-test_ok(f.call([[42]]) == [[42]])
-test_ok(f.call([42,55]) == [42,55])
-
-f = lambda{|*x| x}
-test_ok(f.call(42) == [42])
-test_ok(f.call([42]) == [[42]])
-test_ok(f.call([[42]]) == [[[42]]])
-test_ok(f.call([42,55]) == [[42,55]])
-test_ok(f.call(42,55) == [42,55])
-
-f = lambda { |a, b=42, *c| [a,b,c] }
-test_ok(f.call(1 ) == [1,42,[ ]] )
-test_ok(f.call(1,43 ) == [1,43,[ ]] )
-test_ok(f.call(1,43,44) == [1,43,[44]] )
-
-f = lambda { |a, b=(a|16), *c, &block| [a,b,c,block&&block[]] }
-test_ok(f.call(8 ) == [8,24,[ ],nil] )
-test_ok(f.call(8,43 ) == [8,43,[ ],nil] )
-test_ok(f.call(8,43,44) == [8,43,[44],nil] )
-test_ok(f.call(8 ){45} == [8,24,[ ],45 ] )
-test_ok(f.call(8,43 ){45} == [8,43,[ ],45 ] )
-test_ok(f.call(8,43,44){45} == [8,43,[44],45 ] )
-
-f = lambda { |a, b=42, *c, d| [a,b,c,d] }
-test_ok(f.call(1 ,99) == [1,42,[ ],99] )
-test_ok(f.call(1,43 ,99) == [1,43,[ ],99] )
-test_ok(f.call(1,43,44,99) == [1,43,[44],99] )
-
-f = lambda { |a, b=(a|16), &block| [a,b,block&&block[]] }
-test_ok(f.call(8 ) == [8,24,nil] )
-test_ok(f.call(8,43) == [8,43,nil] )
-test_ok(f.call(8,43) == [8,43,nil] )
-test_ok(f.call(8 ){45} == [8,24,45 ] )
-test_ok(f.call(8,43){45} == [8,43,45 ] )
-test_ok(f.call(8,43){45} == [8,43,45 ] )
-
-f = lambda { |a, b=42, d| [a,b,d] }
-test_ok(f.call(1 ,99) == [1,42,99] )
-test_ok(f.call(1,43,99) == [1,43,99] )
-test_ok(f.call(1,43,99) == [1,43,99] )
-
-f = lambda { |b=42, *c, &block| [b,c,block&&block[]] }
-test_ok(f.call( ) == [42,[ ],nil] )
-test_ok(f.call(43 ) == [43,[ ],nil] )
-test_ok(f.call(43,44) == [43,[44],nil] )
-test_ok(f.call( ){45} == [42,[ ],45 ] )
-test_ok(f.call(43 ){45} == [43,[ ],45 ] )
-test_ok(f.call(43,44){45} == [43,[44],45 ] )
-
-f = lambda { |b=42, *c, d| [b,c,d] }
-test_ok(f.call( 99) == [42,[ ],99] )
-test_ok(f.call(43 ,99) == [43,[ ],99] )
-test_ok(f.call(43,44,99) == [43,[44],99] )
-
-f = lambda { |b=42, &block| [b,block&&block[]] }
-test_ok(f.call( ) == [42,nil] )
-test_ok(f.call(43) == [43,nil] )
-test_ok(f.call(43) == [43,nil] )
-test_ok(f.call( ){45} == [42,45 ] )
-test_ok(f.call(43){45} == [43,45 ] )
-test_ok(f.call(43){45} == [43,45 ] )
-
-f = lambda { |b=42, d| [b,d] }
-test_ok(f.call( 99) == [42,99] )
-test_ok(f.call(43,99) == [43,99] )
-test_ok(f.call(43,99) == [43,99] )
-
-
-a,=*[1]
-test_ok(a == 1)
-a,=*[[1]]
-test_ok(a == [1])
-a,=*[[[1]]]
-test_ok(a == [[1]])
-
-x, (y, z) = 1, 2, 3
-test_ok([1,2,nil] == [x,y,z])
-x, (y, z) = 1, [2,3]
-test_ok([1,2,3] == [x,y,z])
-x, (y, z) = 1, [2]
-test_ok([1,2,nil] == [x,y,z])
-
-a = loop do break; end; test_ok(a == nil)
-a = loop do break nil; end; test_ok(a == nil)
-a = loop do break 1; end; test_ok(a == 1)
-a = loop do break []; end; test_ok(a == [])
-a = loop do break [1]; end; test_ok(a == [1])
-a = loop do break [nil]; end; test_ok(a == [nil])
-a = loop do break [[]]; end; test_ok(a == [[]])
-a = loop do break [*[]]; end; test_ok(a == [])
-a = loop do break [*[1]]; end; test_ok(a == [1])
-a = loop do break [*[1,2]]; end; test_ok(a == [1,2])
-
-a = loop do break *[]; end; test_ok(a == [])
-a = loop do break *[1]; end; test_ok(a == [1])
-a = loop do break *[nil]; end; test_ok(a == [nil])
-a = loop do break *[[]]; end; test_ok(a == [[]])
-a = loop do break *[*[]]; end; test_ok(a == [])
-a = loop do break *[*[1]]; end; test_ok(a == [1])
-a = loop do break *[*[1,2]]; end; test_ok(a == [1,2])
-
-*a = loop do break; end; test_ok(a == [nil])
-*a = loop do break nil; end; test_ok(a == [nil])
-*a = loop do break 1; end; test_ok(a == [1])
-*a = loop do break []; end; test_ok(a == [])
-*a = loop do break [1]; end; test_ok(a == [1])
-*a = loop do break [nil]; end; test_ok(a == [nil])
-*a = loop do break [[]]; end; test_ok(a == [[]])
-*a = loop do break [1,2]; end; test_ok(a == [1,2])
-*a = loop do break [*[]]; end; test_ok(a == [])
-*a = loop do break [*[1]]; end; test_ok(a == [1])
-*a = loop do break [*[1,2]]; end; test_ok(a == [1,2])
-
-*a = loop do break *[]; end; test_ok(a == [])
-*a = loop do break *[1]; end; test_ok(a == [1])
-*a = loop do break *[nil]; end; test_ok(a == [nil])
-*a = loop do break *[[]]; end; test_ok(a == [[]])
-*a = loop do break *[1,2]; end; test_ok(a == [1,2])
-*a = loop do break *[*[]]; end; test_ok(a == [])
-*a = loop do break *[*[1]]; end; test_ok(a == [1])
-*a = loop do break *[*[1,2]]; end; test_ok(a == [1,2])
-
-*a = *loop do break *[[]]; end; test_ok(a == [[]])
-*a = *loop do break *[1,2]; end; test_ok(a == [1,2])
-*a = *loop do break *[*[1,2]]; end; test_ok(a == [1,2])
-
-a,b,*c = loop do break; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break nil; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break 1; end; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = loop do break []; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break [1]; end; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = loop do break [nil]; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break [[]]; end; test_ok([a,b,c] == [[],nil,[]])
-a,b,*c = loop do break [1,2]; end; test_ok([a,b,c] == [1,2,[]])
-a,b,*c = loop do break [*[]]; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break [*[1]]; end; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = loop do break [*[1,2]]; end; test_ok([a,b,c] == [1,2,[]])
-
-a,b,*c = loop do break *[]; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break *[1]; end; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = loop do break *[nil]; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break *[[]]; end; test_ok([a,b,c] == [[],nil,[]])
-a,b,*c = loop do break *[1,2]; end; test_ok([a,b,c] == [1,2,[]])
-a,b,*c = loop do break *[*[]]; end; test_ok([a,b,c] == [nil,nil,[]])
-a,b,*c = loop do break *[*[1]]; end; test_ok([a,b,c] == [1,nil,[]])
-a,b,*c = loop do break *[*[1,2]]; end; test_ok([a,b,c] == [1,2,[]])
-
-def r(val); a = yield(); test_ok(a == val, 2); end
-r(nil){next}
-r(nil){next nil}
-r(1){next 1}
-r([]){next []}
-r([1]){next [1]}
-r([nil]){next [nil]}
-r([[]]){next [[]]}
-r([]){next [*[]]}
-r([1]){next [*[1]]}
-r([1,2]){next [*[1,2]]}
-
-r([]){next *[]}
-r([1]){next *[1]}
-r([nil]){next *[nil]}
-r([[]]){next *[[]]}
-r([]){next *[*[]]}
-r([1]){next *[*[1]]}
-r([1,2]){next *[*[1,2]]}
-
-def r(val); *a = yield(); test_ok(a == val, 2); end
-r([nil]){next}
-r([nil]){next nil}
-r([1]){next 1}
-r([]){next []}
-r([1]){next [1]}
-r([nil]){next [nil]}
-r([[]]){next [[]]}
-r([1,2]){next [1,2]}
-r([]){next [*[]]}
-r([1]){next [*[1]]}
-r([1,2]){next [*[1,2]]}
-
-def r(val); *a = *yield(); test_ok(a == val, 2); end
-r([[]]){next *[[]]}
-r([1,2]){next *[1,2]}
-r([1,2]){next *[*[1,2]]}
-
-def r(val); a,b,*c = yield(); test_ok([a,b,c] == val, 2); end
-r([nil,nil,[]]){next}
-r([nil,nil,[]]){next nil}
-r([1,nil,[]]){next 1}
-r([nil,nil,[]]){next []}
-r([1,nil,[]]){next [1]}
-r([nil,nil,[]]){next [nil]}
-r([[],nil,[]]){next [[]]}
-r([1,2,[]]){next [1,2]}
-r([nil,nil,[]]){next [*[]]}
-r([1,nil,[]]){next [*[1]]}
-r([1,2,[]]){next [*[1,2]]}
-
-def r(val); a,b,*c = *yield(); test_ok([a,b,c] == val, 2); end
-r([[],nil,[]]){next *[[]]}
-r([1,2,[]]){next *[1,2]}
-r([1,2,[]]){next *[*[1,2]]}
-
-test_check "condition"
-
-$x = '0';
-
-$x == $x && test_ok(true)
-$x != $x && test_ok(false)
-$x == $x || test_ok(false)
-$x != $x || test_ok(true)
-
-# first test to see if we can run the tests.
-
-test_check "if/unless";
-
-$x = 'test';
-test_ok(if $x == $x then true else false end)
-$bad = false
-unless $x == $x
- $bad = true
-end
-test_ok(!$bad)
-test_ok(unless $x != $x then true else false end)
-
-test_check "case"
-
-case 5
-when 1, 2, 3, 4, 6, 7, 8
- test_ok(false)
-when 5
- test_ok(true)
-end
-
-case 5
-when 5
- test_ok(true)
-when 1..10
- test_ok(false)
-end
-
-case 5
-when 1..10
- test_ok(true)
-else
- test_ok(false)
-end
-
-case 5
-when 5
- test_ok(true)
-else
- test_ok(false)
-end
-
-case "foobar"
-when /^f.*r$/
- test_ok(true)
-else
- test_ok(false)
-end
-
-test_check "while/until";
-
-while_tmp = "while_tmp.#{$$}"
-tmp = open(while_tmp, "w")
-tmp.print "tvi925\n";
-tmp.print "tvi920\n";
-tmp.print "vt100\n";
-tmp.print "Amiga\n";
-tmp.print "paper\n";
-tmp.close
-
-# test break
-
-tmp = open(while_tmp, "r")
-test_ok(tmp.kind_of?(File))
-
-while line = tmp.gets()
- break if /vt100/ =~ line
-end
-
-test_ok(!tmp.eof? && /vt100/ =~ line)
-tmp.close
-
-# test next
-$bad = false
-tmp = open(while_tmp, "r")
-while line = tmp.gets()
- next if /vt100/ =~ line
- $bad = 1 if /vt100/ =~ line
-end
-test_ok(!(!tmp.eof? || /vt100/ =~ line || $bad))
-tmp.close
-
-# test redo
-$bad = false
-tmp = open(while_tmp, "r")
-while line = tmp.gets()
- lastline = line
- line = line.gsub(/vt100/, 'VT100')
- if lastline != line
- line.gsub!('VT100', 'Vt100')
- redo
- end
- $bad = 1 if /vt100/ =~ line
- $bad = 1 if /VT100/ =~ line
-end
-test_ok(tmp.eof? && !$bad)
-tmp.close
-
-sum=0
-for i in 1..10
- sum += i
- i -= 1
- if i > 0
- redo
- end
-end
-test_ok(sum == 220)
-
-# test interval
-$bad = false
-tmp = open(while_tmp, "r")
-while line = tmp.gets()
- break if 3
- case line
- when /vt100/, /Amiga/, /paper/
- $bad = true
- end
-end
-test_ok(!$bad)
-tmp.close
-
-File.unlink while_tmp or `/bin/rm -f "#{while_tmp}"`
-test_ok(!File.exist?(while_tmp))
-
-i = 0
-until i>4
- i+=1
-end
-test_ok(i>4)
-
-
-# exception handling
-test_check "exception";
-
-begin
- raise "this must be handled"
- test_ok(false)
-rescue
- test_ok(true)
-end
-
-$bad = true
-begin
- raise "this must be handled no.2"
-rescue
- if $bad
- $bad = false
- retry
- test_ok(false)
- end
-end
-test_ok(true)
-
-# exception in rescue clause
-$string = "this must be handled no.3"
-begin
- begin
- raise "exception in rescue clause"
- rescue
- raise $string
- end
- test_ok(false)
-rescue => e
- test_ok($! == e)
- test_ok(e.message == $string)
- test_ok(e != $string)
-end
-
-# exception in ensure clause
-begin
- begin
- raise "this must be handled no.4"
- ensure
- raise "exception in ensure clause"
- end
- test_ok(false)
-rescue
- test_ok(true)
-end
-
-$bad = true
-begin
- begin
- raise "this must be handled no.5"
- ensure
- $bad = false
- end
-rescue
-end
-test_ok(!$bad)
-
-$bad = true
-begin
- begin
- raise "this must be handled no.6"
- ensure
- $bad = false
- end
-rescue
-end
-test_ok(!$bad)
-
-$bad = true
-while true
- begin
- break
- ensure
- $bad = false
- end
-end
-test_ok(!$bad)
-
-test_ok(catch(:foo) {
- loop do
- loop do
- throw :foo, true
- break
- end
- break
- test_ok(false) # should not reach here
- end
- false
- })
-
-test_check "array"
-test_ok([1, 2] + [3, 4] == [1, 2, 3, 4])
-test_ok([1, 2] * 2 == [1, 2, 1, 2])
-test_ok([1, 2] * ":" == "1:2")
-
-test_ok([1, 2].hash == [1, 2].hash)
-
-test_ok([1,2,3] & [2,3,4] == [2,3])
-test_ok([1,2,3] | [2,3,4] == [1,2,3,4])
-test_ok([1,2,3] - [2,3] == [1])
-
-$x = [0, 1, 2, 3, 4, 5]
-test_ok($x[2] == 2)
-test_ok($x[1..3] == [1, 2, 3])
-test_ok($x[1,3] == [1, 2, 3])
-
-$x[0, 2] = 10
-test_ok($x[0] == 10 && $x[1] == 2)
-
-$x[0, 0] = -1
-test_ok($x[0] == -1 && $x[1] == 10)
-
-$x[-1, 1] = 20
-test_ok($x[-1] == 20 && $x.pop == 20)
-
-# array and/or
-test_ok(([1,2,3]&[2,4,6]) == [2])
-test_ok(([1,2,3]|[2,4,6]) == [1,2,3,4,6])
-
-# compact
-$x = [nil, 1, nil, nil, 5, nil, nil]
-$x.compact!
-test_ok($x == [1, 5])
-
-# uniq
-$x = [1, 1, 4, 2, 5, 4, 5, 1, 2]
-$x.uniq!
-test_ok($x == [1, 4, 2, 5])
-
-# empty?
-test_ok(!$x.empty?)
-$x = []
-test_ok($x.empty?)
-
-# sort
-$x = ["it", "came", "to", "pass", "that", "..."]
-$x = $x.sort.join(" ")
-test_ok($x == "... came it pass that to")
-$x = [2,5,3,1,7]
-$x.sort!{|a,b| a<=>b} # sort with condition
-test_ok($x == [1,2,3,5,7])
-$x.sort!{|a,b| b-a} # reverse sort
-test_ok($x == [7,5,3,2,1])
-
-# split test
-$x = "The Book of Mormon"
-test_ok($x.split(//).reverse!.join == $x.reverse)
-test_ok($x.reverse == $x.reverse!)
-test_ok("1 byte string".split(//).reverse.join(":") == "g:n:i:r:t:s: :e:t:y:b: :1")
-$x = "a b c d"
-test_ok($x.split == ['a', 'b', 'c', 'd'])
-test_ok($x.split(' ') == ['a', 'b', 'c', 'd'])
-test_ok(defined? "a".chomp)
-test_ok("abc".scan(/./) == ["a", "b", "c"])
-test_ok("1a2b3c".scan(/(\d.)/) == [["1a"], ["2b"], ["3c"]])
-# non-greedy match
-test_ok("a=12;b=22".scan(/(.*?)=(\d*);?/) == [["a", "12"], ["b", "22"]])
-
-$x = [1]
-test_ok(($x * 5).join(":") == '1:1:1:1:1')
-test_ok(($x * 1).join(":") == '1')
-test_ok(($x * 0).join(":") == '')
-
-*$x = *(1..7).to_a
-test_ok($x.size == 7)
-test_ok($x == [1, 2, 3, 4, 5, 6, 7])
-
-$x = [1,2,3]
-$x[1,0] = $x
-test_ok($x == [1,1,2,3,2,3])
-
-$x = [1,2,3]
-$x[-1,0] = $x
-test_ok($x == [1,2,1,2,3,3])
-
-$x = [1,2,3]
-$x.concat($x)
-test_ok($x == [1,2,3,1,2,3])
-
-test_check "hash"
-$x = {1=>2, 2=>4, 3=>6}
-
-test_ok($x[1] == 2)
-
-test_ok(begin
- for k,v in $x
- raise if k*2 != v
- end
- true
- rescue
- false
- end)
-
-test_ok($x.length == 3)
-test_ok($x.has_key?(1))
-test_ok($x.has_value?(4))
-test_ok($x.values_at(2,3) == [4,6])
-test_ok($x == {1=>2, 2=>4, 3=>6})
-
-$z = $x.keys.sort.join(":")
-test_ok($z == "1:2:3")
-
-$z = $x.values.sort.join(":")
-test_ok($z == "2:4:6")
-test_ok($x == $x)
-
-$x.shift
-test_ok($x.length == 2)
-
-$z = [1,2]
-$x[$z] = 256
-test_ok($x[$z] == 256)
-
-$x = Hash.new(0)
-$x[1] = 1
-test_ok($x[1] == 1)
-test_ok($x[2] == 0)
-
-$x = Hash.new([])
-test_ok($x[22] == [])
-test_ok($x[22].equal?($x[22]))
-
-$x = Hash.new{[]}
-test_ok($x[22] == [])
-test_ok(!$x[22].equal?($x[22]))
-
-$x = Hash.new{|h,k| $z = k; h[k] = k*2}
-$z = 0
-test_ok($x[22] == 44)
-test_ok($z == 22)
-$z = 0
-test_ok($x[22] == 44)
-test_ok($z == 0)
-$x.default = 5
-test_ok($x[23] == 5)
-
-$x = Hash.new
-def $x.default(k)
- $z = k
- self[k] = k*2
-end
-$z = 0
-test_ok($x[22] == 44)
-test_ok($z == 22)
-$z = 0
-test_ok($x[22] == 44)
-test_ok($z == 0)
-
-test_check "iterator"
-
-test_ok(!iterator?)
-
-def ttt
- test_ok(iterator?)
-end
-ttt{}
-
-# yield at top level
-test_ok(!defined?(yield))
-
-$x = [1, 2, 3, 4]
-$y = []
-
-# iterator over array
-for i in $x
- $y.push i
-end
-test_ok($x == $y)
-
-# nested iterator
-def tt
- 1.upto(10) {|i|
- yield i
- }
-end
-
-i=0
-tt{|i| break if i == 5}
-test_ok(i == 0)
-
-def tt2(dummy)
- yield 1
-end
-
-def tt3(&block)
- tt2(raise(ArgumentError,""),&block)
-end
-
-$x = false
-begin
- tt3{}
-rescue ArgumentError
- $x = true
-rescue Exception
-end
-test_ok($x)
-
-def tt4 &block
- tt2(raise(ArgumentError,""),&block)
-end
-$x = false
-begin
- tt4{}
-rescue ArgumentError
- $x = true
-rescue Exception
-end
-test_ok($x)
-
-# iterator break/redo/next/retry
-done = true
-loop{
- break
- done = false # should not reach here
-}
-test_ok(done)
-
-done = false
-$bad = false
-loop {
- break if done
- done = true
- next
- $bad = true # should not reach here
-}
-test_ok(!$bad)
-
-done = false
-$bad = false
-loop {
- break if done
- done = true
- redo
- $bad = true # should not reach here
-}
-test_ok(!$bad)
-
-$x = []
-for i in 1 .. 7
- $x.push i
-end
-test_ok($x.size == 7)
-test_ok($x == [1, 2, 3, 4, 5, 6, 7])
-
-# append method to built-in class
-class Array
- def iter_test1
- collect{|e| [e, yield(e)]}.sort{|a,b|a[1]<=>b[1]}
- end
- def iter_test2
- a = collect{|e| [e, yield(e)]}
- a.sort{|a,b|a[1]<=>b[1]}
- end
-end
-$x = [[1,2],[3,4],[5,6]]
-test_ok($x.iter_test1{|x|x} == $x.iter_test2{|x|x})
-
-class IterTest
- def initialize(e); @body = e; end
-
- def each0(&block); @body.each(&block); end
- def each1(&block); @body.each {|*x| block.call(*x) } end
- def each2(&block); @body.each {|*x| block.call(x) } end
- def each3(&block); @body.each {|x| block.call(*x) } end
- def each4(&block); @body.each {|x| block.call(x) } end
- def each5; @body.each {|*x| yield(*x) } end
- def each6; @body.each {|*x| yield(x) } end
- def each7; @body.each {|x| yield(*x) } end
- def each8; @body.each {|x| yield(x) } end
-
- def f(a)
- a
- end
-end
-test_ok(IterTest.new(nil).method(:f).to_proc.call([1]) == [1])
-m = /\w+/.match("abc")
-test_ok(IterTest.new(nil).method(:f).to_proc.call([m]) == [m])
-
-IterTest.new([0]).each0 {|x| test_ok(x == 0)}
-IterTest.new([1]).each1 {|x| test_ok(x == 1)}
-IterTest.new([2]).each2 {|x| test_ok(x == [2])}
-#IterTest.new([3]).each3 {|x| test_ok(x == 3)}
-IterTest.new([4]).each4 {|x| test_ok(x == 4)}
-IterTest.new([5]).each5 {|x| test_ok(x == 5)}
-IterTest.new([6]).each6 {|x| test_ok(x == [6])}
-#IterTest.new([7]).each7 {|x| test_ok(x == 7)}
-IterTest.new([8]).each8 {|x| test_ok(x == 8)}
-
-IterTest.new([[0]]).each0 {|x| test_ok(x == [0])}
-IterTest.new([[1]]).each1 {|x| test_ok(x == [1])}
-IterTest.new([[2]]).each2 {|x| test_ok(x == [[2]])}
-IterTest.new([[3]]).each3 {|x| test_ok(x == 3)}
-IterTest.new([[4]]).each4 {|x| test_ok(x == [4])}
-IterTest.new([[5]]).each5 {|x| test_ok(x == [5])}
-IterTest.new([[6]]).each6 {|x| test_ok(x == [[6]])}
-IterTest.new([[7]]).each7 {|x| test_ok(x == 7)}
-IterTest.new([[8]]).each8 {|x| test_ok(x == [8])}
-
-IterTest.new([[0,0]]).each0 {|*x| test_ok(x == [[0,0]])}
-IterTest.new([[8,8]]).each8 {|*x| test_ok(x == [[8,8]])}
-
-def m0(v)
- v
-end
-
-def m1
- m0(block_given?)
-end
-test_ok(m1{p 'test'})
-test_ok(!m1)
-
-def m
- m0(block_given?,&Proc.new{})
-end
-test_ok(m1{p 'test'})
-test_ok(!m1)
-
-class C
- include Enumerable
- def initialize
- @a = [1,2,3]
- end
- def each(&block)
- @a.each(&block)
- end
-end
-
-test_ok(C.new.collect{|n| n} == [1,2,3])
-
-test_ok(Proc == lambda{}.class)
-test_ok(Proc == Proc.new{}.class)
-lambda{|a|test_ok(a==1)}.call(1)
-def block_test(klass, &block)
- test_ok(klass === block)
-end
-
-block_test(NilClass)
-block_test(Proc){}
-
-def call_argument_test(state, proc, *args)
- x = state
- begin
- proc.call(*args)
- rescue ArgumentError
- x = !x
- end
- test_ok(x,2)
-end
-
-call_argument_test(true, lambda{||})
-call_argument_test(false, lambda{||}, 1)
-call_argument_test(true, lambda{|a,|}, 1)
-call_argument_test(false, lambda{|a,|})
-call_argument_test(false, lambda{|a,|}, 1,2)
-
-call_argument_test(true, Proc.new{||})
-call_argument_test(true, Proc.new{||}, 1)
-call_argument_test(true, Proc.new{|a,|}, 1)
-call_argument_test(true, Proc.new{|a,|})
-call_argument_test(true, Proc.new{|a,|}, 1,2)
-
-def block_get(&block)
- block
-end
-
-test_ok(Proc == block_get{}.class)
-call_argument_test(true, block_get{||})
-call_argument_test(true, block_get{||}, 1)
-call_argument_test(true, block_get{|a,|}, 1)
-call_argument_test(true, block_get{|a,|})
-call_argument_test(true, block_get{|a,|}, 1,2)
-
-call_argument_test(true, block_get(&lambda{||}))
-call_argument_test(false, block_get(&lambda{||}),1)
-call_argument_test(true, block_get(&lambda{|a,|}),1)
-call_argument_test(false, block_get(&lambda{|a,|}),1,2)
-
-blk = block_get{11}
-test_ok(blk.class == Proc)
-test_ok(blk.to_proc.class == Proc)
-test_ok(blk.clone.call == 11)
-test_ok(block_get(&blk).class == Proc)
-
-lmd = lambda{44}
-test_ok(lmd.class == Proc)
-test_ok(lmd.to_proc.class == Proc)
-test_ok(lmd.clone.call == 44)
-test_ok(block_get(&lmd).class == Proc)
-
-test_ok(Proc.new{|a,| a}.yield(1,2,3) == 1)
-call_argument_test(true, Proc.new{|a,|}, 1,2)
-
-test_ok(Proc.new{|&b| b.call(10)}.call {|x| x} == 10)
-test_ok(Proc.new{|a,&b| b.call(a)}.call(12) {|x| x} == 12)
-
-def test_return1
- Proc.new {
- return 55
- }.yield + 5
-end
-test_ok(test_return1() == 55)
-def test_return2
- lambda {
- return 55
- }.call + 5
-end
-test_ok(test_return2() == 60)
-
-def proc_call(&b)
- b.call
-end
-def proc_yield()
- yield
-end
-def proc_return1
- lambda{return 42}.call+1
-end
-test_ok(proc_return1() == 43)
-def proc_return2
- ->{return 42}.call+1
-end
-test_ok(proc_return2() == 43)
-def proc_return3
- proc_call{return 42}+1
-end
-test_ok(proc_return3() == 42)
-def proc_return4
- proc_yield{return 42}+1
-end
-test_ok(proc_return4() == 42)
-
-def ljump_test(state, proc, *args)
- x = state
- begin
- proc.call(*args)
- rescue LocalJumpError
- x = !x
- end
- test_ok(x,2)
-end
-
-ljump_test(false, block_get{break})
-ljump_test(true, lambda{break})
-
-def exit_value_test(&block)
- block.call
-rescue LocalJumpError
- $!.exit_value
-end
-
-test_ok(45 == exit_value_test{break 45})
-
-test_ok(55 == begin
- block_get{break 55}.call
- rescue LocalJumpError
- $!.exit_value
- end)
-
-def block_call(&block)
- block.call
-end
-
-def test_b1
- block_call{break 11}
-end
-test_ok(test_b1() == 11)
-
-def ljump_rescue(r)
- begin
- yield
- rescue LocalJumpError => e
- r if /from proc-closure/ =~ e.message
- end
-end
-
-def test_b2
- ljump_rescue(22) do
- block_get{break 21}.call
- end
-end
-test_ok(test_b2() == 22)
-
-def test_b3
- ljump_rescue(33) do
- Proc.new{break 31}.yield
- end
-end
-test_ok(test_b3() == 33)
-
-def test_b4
- lambda{break 44}.call
-end
-test_ok(test_b4() == 44)
-
-def test_b5
- ljump_rescue(55) do
- b = block_get{break 54}
- block_call(&b)
- end
-end
-test_ok(test_b5() == 55)
-
-def test_b6
- b = lambda{break 67}
- block_call(&b)
- 66
-end
-test_ok(test_b6() == 66)
-
-def util_r7
- block_get{break 78}
-end
-
-def test_b7
- b = util_r7()
- ljump_rescue(77) do
- block_call(&b)
- end
-end
-test_ok(test_b7() == 77)
-
-def util_b8(&block)
- block_call(&block)
-end
-
-def test_b8
- util_b8{break 88}
-end
-test_ok(test_b8() == 88)
-
-def util_b9(&block)
- lambda{block.call; 98}.call
-end
-
-def test_b9
- util_b9{break 99}
-end
-test_ok(test_b9() == 99)
-
-def util_b10
- util_b9{break 100}
-end
-
-def test_b10
- util_b10()
-end
-test_ok(test_b10() == 100)
-
-def test_b11
- ljump_rescue(111) do
- loop do
- Proc.new{break 110}.yield
- break 112
- end
- end
-end
-test_ok(test_b11() == 111)
-
-def test_b12
- loop do
- break lambda{break 122}.call
- break 121
- end
-end
-test_ok(test_b12() == 122)
-
-def test_b13
- ljump_rescue(133) do
- while true
- Proc.new{break 130}.yield
- break 131
- end
- end
-end
-test_ok(test_b13() == 133)
-
-def test_b14
- while true
- break lambda{break 144}.call
- break 143
- end
-end
-test_ok(test_b14() == 144)
-
-def test_b15
- [0].each {|c| yield 1 }
- 156
-end
-test_ok(test_b15{|e| break 155 } == 155)
-
-def marity_test(m)
- method = method(m)
- test_ok(method.arity == method.to_proc.arity, 2)
-end
-marity_test(:test_ok)
-marity_test(:marity_test)
-marity_test(:p)
-
-lambda(&method(:test_ok)).call(true)
-lambda(&block_get{|a,n| test_ok(a,n)}).call(true, 2)
-
-class ITER_TEST1
- def a
- block_given?
- end
-end
-
-class ITER_TEST2 < ITER_TEST1
- def a
- test_ok(super)
- super
- end
-end
-test_ok(ITER_TEST2.new.a {})
-
-class ITER_TEST3
- def foo x
- return yield if block_given?
- x
- end
-end
-
-class ITER_TEST4 < ITER_TEST3
- def foo x
- test_ok(super == yield)
- test_ok(super(x, &nil) == x)
- end
-end
-
-ITER_TEST4.new.foo(44){55}
-
-class ITER_TEST5
- def tt(aa)
- aa
- end
-
- def uu(a)
- class << self
- define_method(:tt) do |sym|
- super(sym)
- end
- end
- end
-
- def xx(*x)
- x.size
- end
-end
-
-a = ITER_TEST5.new
-a.uu(12)
-test_ok(a.tt(1) == 1)
-
-class ITER_TEST6 < ITER_TEST5
- def xx(*a)
- a << 12
- super
- end
-end
-
-test_ok(ITER_TEST6.new.xx([24]) == 2)
-
-test_check "float"
-test_ok(2.6.floor == 2)
-test_ok((-2.6).floor == -3)
-test_ok(2.6.ceil == 3)
-test_ok((-2.6).ceil == -2)
-test_ok(2.6.truncate == 2)
-test_ok((-2.6).truncate == -2)
-test_ok(2.6.round == 3)
-test_ok((-2.4).truncate == -2)
-test_ok((13.4 % 1 - 0.4).abs < 0.0001)
-nan = 0.0/0
-def nan_test(x,y)
- test_ok(x != y)
- test_ok((x < y) == false)
- test_ok((x > y) == false)
- test_ok((x <= y) == false)
- test_ok((x >= y) == false)
-end
-nan_test(nan, nan)
-nan_test(nan, 0)
-nan_test(nan, 1)
-nan_test(nan, -1)
-nan_test(nan, 1000)
-nan_test(nan, -1000)
-nan_test(nan, 1_000_000_000_000)
-nan_test(nan, -1_000_000_000_000)
-nan_test(nan, 100.0);
-nan_test(nan, -100.0);
-nan_test(nan, 0.001);
-nan_test(nan, -0.001);
-nan_test(nan, 1.0/0);
-nan_test(nan, -1.0/0);
-
-#s = "3.7517675036461267e+17"
-#test_ok(s == sprintf("%.16e", s.to_f))
-f = 3.7517675036461267e+17
-test_ok(f == sprintf("%.16e", f).to_f)
-
-
-test_check "bignum"
-def fact(n)
- return 1 if n == 0
- f = 1
- while n>0
- f *= n
- n -= 1
- end
- return f
-end
-$x = fact(40)
-test_ok($x == $x)
-test_ok($x == fact(40))
-test_ok($x < $x+2)
-test_ok($x > $x-2)
-test_ok($x == 815915283247897734345611269596115894272000000000)
-test_ok($x != 815915283247897734345611269596115894272000000001)
-test_ok($x+1 == 815915283247897734345611269596115894272000000001)
-test_ok($x/fact(20) == 335367096786357081410764800000)
-$x = -$x
-test_ok($x == -815915283247897734345611269596115894272000000000)
-test_ok(2-(2**32) == -(2**32-2))
-test_ok(2**32 - 5 == (2**32-3)-2)
-
-$good = true;
-for i in 1000..1014
- $good = false if ((1 << i) != (2**i))
-end
-test_ok($good)
-
-$good = true;
-n1= 1 << 1000
-for i in 1000..1014
- $good = false if ((1 << i) != n1)
- n1 *= 2
-end
-test_ok($good)
-
-$good = true;
-n2=n1
-for i in 1..10
- n1 = n1 / 2
- n2 = n2 >> 1
- $good = false if (n1 != n2)
-end
-test_ok($good)
-
-$good = true;
-for i in 4000..4096
- n1 = 1 << i;
- if (n1**2-1) / (n1+1) != (n1-1)
- $good = false
- end
-end
-test_ok($good)
-
-b = 10**80
-a = b * 9 + 7
-test_ok(7 == a.modulo(b))
-test_ok(-b + 7 == a.modulo(-b))
-test_ok(b + -7 == (-a).modulo(b))
-test_ok(-7 == (-a).modulo(-b))
-test_ok(7 == a.remainder(b))
-test_ok(7 == a.remainder(-b))
-test_ok(-7 == (-a).remainder(b))
-test_ok(-7 == (-a).remainder(-b))
-
-test_ok(10**40+10**20 == 10000000000000000000100000000000000000000)
-test_ok(10**40/10**20 == 100000000000000000000)
-
-a = 677330545177305025495135714080
-b = 14269972710765292560
-test_ok(a % b == 0)
-test_ok(-a % b == 0)
-
-def shift_test(a)
- b = a / (2 ** 32)
- c = a >> 32
- test_ok(b == c)
-
- b = a * (2 ** 32)
- c = a << 32
- test_ok(b == c)
-end
-
-shift_test(-4518325415524767873)
-shift_test(-0xfffffffffffffffff)
-
-test_check "string & char"
-
-test_ok("abcd" == "abcd")
-test_ok("abcd" =~ /abcd/)
-test_ok("abcd" === "abcd")
-# compile time string concatenation
-test_ok("ab" "cd" == "abcd")
-test_ok("#{22}aa" "cd#{44}" == "22aacd44")
-test_ok("#{22}aa" "cd#{44}" "55" "#{66}" == "22aacd445566")
-test_ok("abc" !~ /^$/)
-test_ok("abc\n" !~ /^$/)
-test_ok("abc" !~ /^d*$/)
-test_ok(("abc" =~ /d*$/) == 3)
-test_ok("" =~ /^$/)
-test_ok("\n" =~ /^$/)
-test_ok("a\n\n" =~ /^$/)
-test_ok("abcabc" =~ /.*a/ && $& == "abca")
-test_ok("abcabc" =~ /.*c/ && $& == "abcabc")
-test_ok("abcabc" =~ /.*?a/ && $& == "a")
-test_ok("abcabc" =~ /.*?c/ && $& == "abc")
-test_ok(/(.|\n)*?\n(b|\n)/ =~ "a\nb\n\n" && $& == "a\nb")
-
-test_ok(/^(ab+)+b/ =~ "ababb" && $& == "ababb")
-test_ok(/^(?:ab+)+b/ =~ "ababb" && $& == "ababb")
-test_ok(/^(ab+)+/ =~ "ababb" && $& == "ababb")
-test_ok(/^(?:ab+)+/ =~ "ababb" && $& == "ababb")
-
-test_ok(/(\s+\d+){2}/ =~ " 1 2" && $& == " 1 2")
-test_ok(/(?:\s+\d+){2}/ =~ " 1 2" && $& == " 1 2")
-
-$x = <<END;
-ABCD
-ABCD
-END
-$x.gsub!(/((.|\n)*?)B((.|\n)*?)D/, '\1\3')
-test_ok($x == "AC\nAC\n")
-
-test_ok("foobar" =~ /foo(?=(bar)|(baz))/)
-test_ok("foobaz" =~ /foo(?=(bar)|(baz))/)
-
-$foo = "abc"
-test_ok("#$foo = abc" == "abc = abc")
-test_ok("#{$foo} = abc" == "abc = abc")
-
-foo = "abc"
-test_ok("#{foo} = abc" == "abc = abc")
-
-test_ok('-' * 5 == '-----')
-test_ok('-' * 1 == '-')
-test_ok('-' * 0 == '')
-
-foo = '-'
-test_ok(foo * 5 == '-----')
-test_ok(foo * 1 == '-')
-test_ok(foo * 0 == '')
-
-$x = "a.gif"
-test_ok($x.sub(/.*\.([^\.]+)$/, '\1') == "gif")
-test_ok($x.sub(/.*\.([^\.]+)$/, 'b.\1') == "b.gif")
-test_ok($x.sub(/.*\.([^\.]+)$/, '\2') == "")
-test_ok($x.sub(/.*\.([^\.]+)$/, 'a\2b') == "ab")
-test_ok($x.sub(/.*\.([^\.]+)$/, '<\&>') == "<a.gif>")
-
-# character constants(assumes ASCII)
-test_ok("a"[0] == ?a)
-test_ok(?a == ?a)
-test_ok(?\C-a == "\1")
-test_ok(?\M-a == "\341")
-test_ok(?\M-\C-a == "\201")
-test_ok("a".upcase![0] == ?A)
-test_ok("A".downcase![0] == ?a)
-test_ok("abc".tr!("a-z", "A-Z") == "ABC")
-test_ok("aabbcccc".tr_s!("a-z", "A-Z") == "ABC")
-test_ok("abcc".squeeze!("a-z") == "abc")
-test_ok("abcd".delete!("bc") == "ad")
-
-$x = "abcdef"
-$y = [ ?a, ?b, ?c, ?d, ?e, ?f ]
-$bad = false
-$x.each_byte {|i|
- if i.chr != $y.shift
- $bad = true
- break
- end
-}
-test_ok(!$bad)
-
-s = "a string"
-s[0..s.size]="another string"
-test_ok(s == "another string")
-
-s = <<EOS
-#{
-[1,2,3].join(",")
-}
-EOS
-test_ok(s == "1,2,3\n")
-test_ok("Just".to_i(36) == 926381)
-test_ok("-another".to_i(36) == -23200231779)
-test_ok(1299022.to_s(36) == "ruby")
-test_ok(-1045307475.to_s(36) == "-hacker")
-test_ok("Just_another_Ruby_hacker".to_i(36) == 265419172580680477752431643787347)
-test_ok(-265419172580680477752431643787347.to_s(36) == "-justanotherrubyhacker")
-
-a = []
-(0..255).each {|n|
- ch = [n].pack("C")
- a.push ch if /a#{Regexp.quote ch}b/x =~ "ab"
-}
-test_ok(a.size == 0)
-
-test_check "assignment"
-a = nil
-test_ok(defined?(a))
-test_ok(a == nil)
-
-# multiple asignment
-a, b = 1, 2
-test_ok(a == 1 && b == 2)
-
-a, b = b, a
-test_ok(a == 2 && b == 1)
-
-a, = 1,2
-test_ok(a == 1)
-
-a, *b = 1, 2, 3
-test_ok(a == 1 && b == [2, 3])
-
-a, (b, c), d = 1, [2, 3], 4
-test_ok(a == 1 && b == 2 && c == 3 && d == 4)
-
-*a = 1, 2, 3
-test_ok(a == [1, 2, 3])
-
-*a = 4
-test_ok(a == [4])
-
-*a = nil
-test_ok(a == [nil])
-
-test_check "call"
-def aaa(a, b=100, *rest)
- res = [a, b]
- res += rest if rest
- return res
-end
-
-# not enough argument
-begin
- aaa() # need at least 1 arg
- test_ok(false)
-rescue
- test_ok(true)
-end
-
-begin
- aaa # no arg given (exception raised)
- test_ok(false)
-rescue
- test_ok(true)
-end
-
-test_ok(aaa(1) == [1, 100])
-test_ok(aaa(1, 2) == [1, 2])
-test_ok(aaa(1, 2, 3, 4) == [1, 2, 3, 4])
-test_ok(aaa(1, *[2, 3, 4]) == [1, 2, 3, 4])
-
-test_check "proc"
-$proc = Proc.new{|i| i}
-test_ok($proc.call(2) == 2)
-test_ok($proc.call(3) == 3)
-
-$proc = Proc.new{|i| i*2}
-test_ok($proc.call(2) == 4)
-test_ok($proc.call(3) == 6)
-
-Proc.new{
- iii=5 # nested local variable
- $proc = Proc.new{|i|
- iii = i
- }
- $proc2 = Proc.new {
- $x = iii # nested variables shared by procs
- }
- # scope of nested variables
- test_ok(defined?(iii))
-}.call
-test_ok(!defined?(iii)) # out of scope
-
-loop{iii=5; test_ok(eval("defined? iii")); break}
-loop {
- iii = 10
- def dyna_var_check
- loop {
- test_ok(!defined?(iii))
- break
- }
- end
- dyna_var_check
- break
-}
-$x=0
-$proc.call(5)
-$proc2.call
-test_ok($x == 5)
-
-if defined? Process.kill
- test_check "signal"
-
- $x = 0
- trap "SIGINT", Proc.new{|sig| $x = 2}
- Process.kill "SIGINT", $$
- 100.times {
- sleep 0.1
- break if $x != 0
- }
- test_ok($x == 2)
-
- trap "SIGINT", Proc.new{raise "Interrupt"}
-
- x = false
- begin
- Process.kill "SIGINT", $$
- sleep 0.1
- rescue
- x = $!
- end
- test_ok(x && /Interrupt/ =~ x.message)
-end
-
-test_check "eval"
-test_ok(eval("") == nil)
-$bad=false
-eval 'while false; $bad = true; print "foo\n" end'
-test_ok(!$bad)
-
-test_ok(eval('Object'))
-test_ok(eval('true'))
-test_ok(!eval('nil'))
-test_ok(!eval('false'))
-
-$foo = 'test_ok(true)'
-begin
- eval $foo
-rescue
- test_ok(false)
-end
-
-test_ok(eval("$foo") == 'test_ok(true)')
-test_ok(eval("true") == true)
-i = 5
-test_ok(eval("i == 5"))
-test_ok(eval("i") == 5)
-test_ok(eval("defined? i"))
-
-# eval with binding
-def test_ev
- local1 = "local1"
- lambda {
- local2 = "local2"
- return binding
- }.call
-end
-
-$x = test_ev
-test_ok(eval("local1", $x) == "local1") # normal local var
-test_ok(eval("local2", $x) == "local2") # nested local var
-$bad = true
-begin
- p eval("local1")
-rescue NameError # must raise error
- $bad = false
-end
-test_ok(!$bad)
-
-module EvTest
- EVTEST1 = 25
- evtest2 = 125
- $x = binding
-end
-test_ok(eval("EVTEST1", $x) == 25) # constant in module
-test_ok(eval("evtest2", $x) == 125) # local var in module
-$bad = true
-begin
- eval("EVTEST1")
-rescue NameError # must raise error
- $bad = false
-end
-test_ok(!$bad)
-
-x = binding #! YARV Limitation: Proc.new{}
-eval "i4 = 1", x
-test_ok(eval("i4", x) == 1)
-x = Proc.new{binding}.call #! YARV Limitation: Proc.new{Proc.new{}}.call
-eval "i4 = 22", x
-test_ok(eval("i4", x) == 22)
-$x = []
-x = Proc.new{binding}.call #! YARV Limitation: Proc.new{Proc.new{}}.call
-eval "(0..9).each{|i5| $x[i5] = Proc.new{i5*2}}", x
-test_ok($x[4].call == 8)
-
-x = binding
-eval "i = 1", x
-test_ok(eval("i", x) == 1)
-x = Proc.new{binding}.call
-eval "i = 22", x
-test_ok(eval("i", x) == 22)
-$x = []
-x = Proc.new{binding}.call
-eval "(0..9).each{|i5| $x[i5] = Proc.new{i5*2}}", x
-test_ok($x[4].call == 8)
-x = Proc.new{binding}.call
-eval "for i6 in 1..1; j6=i6; end", x
-test_ok(eval("defined? i6", x))
-test_ok(eval("defined? j6", x))
-
-Proc.new {
- p = binding
- eval "foo11 = 1", p
- foo22 = 5
- Proc.new{foo11=22}.call
- Proc.new{foo22=55}.call
- test_ok(eval("foo11", p) == eval("foo11"))
- test_ok(eval("foo11") == 1)
- test_ok(eval("foo22", p) == eval("foo22"))
- test_ok(eval("foo22") == 55)
-}.call if false #! YARV Limitation
-
-#! YARV Limitation: p1 = Proc.new{i7 = 0; Proc.new{i7}}.call
-p1 = Proc.new{i7 = 0; binding}.call
-#! YARV Limitation: test_ok(p1.call == 0)
-eval "i7=5", p1
-#! YARV Limitation: test_ok(p1.call == 5)
-test_ok(!defined?(i7))
-
-if false #! YARV Limitation
-p1 = Proc.new{i7 = 0; Proc.new{i7}}.call
-i7 = nil
-test_ok(p1.call == 0)
-eval "i7=1", p1
-test_ok(p1.call == 1)
-eval "i7=5", p1
-test_ok(p1.call == 5)
-test_ok(i7 == nil)
-end
-
-test_check "system"
-test_ok(`echo foobar` == "foobar\n")
-test_ok(`./miniruby -e 'print "foobar"'` == 'foobar')
-
-script_tmp = "script_tmp.#{$$}"
-tmp = open(script_tmp, "w")
-tmp.print "print $zzz\n";
-tmp.close
-
-test_ok(`./miniruby -s #{script_tmp} -zzz` == 'true')
-test_ok(`./miniruby -s #{script_tmp} -zzz=555` == '555')
-
-tmp = open(script_tmp, "w")
-tmp.print "#! /usr/local/bin/ruby -s\n";
-tmp.print "print $zzz\n";
-tmp.close
-
-test_ok(`./miniruby #{script_tmp} -zzz=678` == '678')
-
-tmp = open(script_tmp, "w")
-tmp.print "this is a leading junk\n";
-tmp.print "#! /usr/local/bin/ruby -s\n";
-tmp.print "print $zzz\n";
-tmp.print "__END__\n";
-tmp.print "this is a trailing junk\n";
-tmp.close
-
-test_ok(`./miniruby -x #{script_tmp}` == '')
-test_ok(`./miniruby -x #{script_tmp} -zzz=555` == '555')
-
-tmp = open(script_tmp, "w")
-for i in 1..5
- tmp.print i, "\n"
-end
-tmp.close
-
-`./miniruby -i.bak -pe '$_.sub!(/^[0-9]+$/){$&.to_i * 5}' #{script_tmp}`
-done = true
-tmp = open(script_tmp, "r")
-while tmp.gets
- if $_.to_i % 5 != 0
- done = false
- break
- end
-end
-tmp.close
-test_ok(done)
-
-File.unlink script_tmp or `/bin/rm -f "#{script_tmp}"`
-File.unlink "#{script_tmp}.bak" or `/bin/rm -f "#{script_tmp}.bak"`
-
-test_check "const"
-TEST1 = 1
-TEST2 = 2
-
-module Const
- TEST3 = 3
- TEST4 = 4
-end
-
-module Const2
- TEST3 = 6
- TEST4 = 8
-end
-
-include Const
-
-test_ok([TEST1,TEST2,TEST3,TEST4] == [1,2,3,4])
-
-include Const2
-STDERR.print "intentionally redefines TEST3, TEST4\n" if $VERBOSE
-test_ok([TEST1,TEST2,TEST3,TEST4] == [1,2,6,8])
-
-
-test_ok((String <=> Object) == -1)
-test_ok((Object <=> String) == 1)
-test_ok((Array <=> String) == nil)
-
-test_check "clone"
-foo = Object.new
-def foo.test
- "test"
-end
-bar = foo.clone
-def bar.test2
- "test2"
-end
-
-test_ok(bar.test2 == "test2")
-test_ok(bar.test == "test")
-test_ok(foo.test == "test")
-
-begin
- foo.test2
- test_ok false
-rescue NoMethodError
- test_ok true
-end
-
-module M001; end
-module M002; end
-module M003; include M002; end
-module M002; include M001; end
-module M003; include M002; end
-
-test_ok(M003.ancestors == [M003, M002, M001])
-
-test_check "marshal"
-$x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
-$y = Marshal.dump($x)
-test_ok($x == Marshal.load($y))
-
-StrClone=String.clone;
-test_ok(Marshal.load(Marshal.dump(StrClone.new("abc"))).class == StrClone)
-
-[[1,2,3,4], [81, 2, 118, 3146]].each { |w,x,y,z|
- a = (x.to_f + y.to_f / z.to_f) * Math.exp(w.to_f / (x.to_f + y.to_f / z.to_f))
- ma = Marshal.dump(a)
- b = Marshal.load(ma)
- test_ok(a == b)
-}
-
-test_check "pack"
-
-$format = "c2x5CCxsdils_l_a6";
-# Need the expression in here to force ary[5] to be numeric. This avoids
-# test2 failing because ary2 goes str->numeric->str and ary does not.
-ary = [1,-100,127,128,32767,987.654321098 / 100.0,12345,123456,-32767,-123456,"abcdef"]
-$x = ary.pack($format)
-ary2 = $x.unpack($format)
-
-test_ok(ary.length == ary2.length)
-test_ok(ary.join(':') == ary2.join(':'))
-test_ok($x =~ /def/)
-
-$x = [-1073741825]
-test_ok($x.pack("q").unpack("q") == $x)
-
-test_check "math"
-test_ok(Math.sqrt(4) == 2)
-
-include Math
-test_ok(sqrt(4) == 2)
-
-test_check "struct"
-struct_test = Struct.new("Test", :foo, :bar)
-test_ok(struct_test == Struct::Test)
-
-test = struct_test.new(1, 2)
-test_ok(test.foo == 1 && test.bar == 2)
-test_ok(test[0] == 1 && test[1] == 2)
-
-a, b = test.to_a
-test_ok(a == 1 && b == 2)
-
-test[0] = 22
-test_ok(test.foo == 22)
-
-test.bar = 47
-test_ok(test.bar == 47)
-
-test_check "variable"
-test_ok($$.instance_of?(Integer))
-
-# read-only variable
-begin
- $$ = 5
- test_ok false
-rescue NameError
- test_ok true
-end
-
-foobar = "foobar"
-$_ = foobar
-test_ok($_ == foobar)
-
-class Gods
- @@rule = "Uranus" # private to Gods
- def ruler0
- @@rule
- end
-
- def self.ruler1 # <= per method definition style
- @@rule
- end
- class << self # <= multiple method definition style
- def ruler2
- @@rule
- end
- end
-end
-
-module Olympians
- @@rule ="Zeus"
- def ruler3
- @@rule
- end
-end
-
-class Titans < Gods
- @@rule = "Cronus" # do not affect @@rule in Gods
- include Olympians
- def ruler4
- @@rule
- end
-end
-
-test_ok(Gods.new.ruler0 == "Cronus")
-test_ok(Gods.ruler1 == "Cronus")
-test_ok(Gods.ruler2 == "Cronus")
-test_ok(Titans.ruler1 == "Cronus")
-test_ok(Titans.ruler2 == "Cronus")
-atlas = Titans.new
-test_ok(atlas.ruler0 == "Cronus")
-test_ok(atlas.ruler3 == "Zeus")
-test_ok(atlas.ruler4 == "Cronus")
-
-test_check "trace"
-$x = 1234
-$y = 0
-trace_var :$x, Proc.new{$y = $x}
-$x = 40414
-test_ok($y == $x)
-
-untrace_var :$x
-$x = 19660208
-test_ok($y != $x)
-
-trace_var :$x, Proc.new{$x *= 2}
-$x = 5
-test_ok($x == 10)
-
-untrace_var :$x
-
-test_check "defined?"
-
-test_ok(defined?($x)) # global variable
-test_ok(defined?($x) == 'global-variable')# returns description
-
-foo=5
-test_ok(defined?(foo)) # local variable
-
-test_ok(defined?(Array)) # constant
-test_ok(defined?(Object.new)) # method
-test_ok(!defined?(Object.print))# private method
-test_ok(defined?(1 == 2)) # operator expression
-
-class Foo
- def foo
- p :foo
- end
- protected :foo
- def bar(f)
- test_ok(defined?(self.foo))
- test_ok(defined?(f.foo))
- end
-end
-f = Foo.new
-test_ok(defined?(f.foo) == nil)
-f.bar(f)
-
-def defined_test
- return !defined?(yield)
-end
-
-test_ok(defined_test) # not iterator
-test_ok(!defined_test{}) # called as iterator
-
-test_check "alias"
-class Alias0
- def foo; "foo" end
-end
-class Alias1 < Alias0
- alias bar foo
- def foo; "foo+" + super end
-end
-class Alias2 < Alias1
- alias baz foo
- undef foo
-end
-
-x = Alias2.new
-test_ok(x.bar == "foo")
-test_ok(x.baz == "foo+foo")
-
-# test_check for cache
-test_ok(x.baz == "foo+foo")
-
-class Alias3 < Alias2
- def foo
- defined? super
- end
- def bar
- defined? super
- end
- def quux
- defined? super
- end
-end
-x = Alias3.new
-test_ok(!x.foo)
-test_ok(x.bar)
-test_ok(!x.quux)
-
-test_check "path"
-test_ok(File.basename("a") == "a")
-test_ok(File.basename("a/b") == "b")
-test_ok(File.basename("a/b/") == "b")
-test_ok(File.basename("/") == "/")
-test_ok(File.basename("//") == "/")
-test_ok(File.basename("///") == "/")
-test_ok(File.basename("a/b////") == "b")
-test_ok(File.basename("a.rb", ".rb") == "a")
-test_ok(File.basename("a.rb///", ".rb") == "a")
-test_ok(File.basename("a.rb///", ".*") == "a")
-test_ok(File.basename("a.rb///", ".c") == "a.rb")
-test_ok(File.dirname("a") == ".")
-test_ok(File.dirname("/") == "/")
-test_ok(File.dirname("/a") == "/")
-test_ok(File.dirname("a/b") == "a")
-test_ok(File.dirname("a/b/c") == "a/b")
-test_ok(File.dirname("/a/b/c") == "/a/b")
-test_ok(File.dirname("/a/b/") == "/a")
-test_ok(File.dirname("/a/b///") == "/a")
-case Dir.pwd
-when %r'\A\w:'
- test_ok(/\A\w:\/\z/ =~ File.expand_path(".", "/"))
- test_ok(/\A\w:\/a\z/ =~ File.expand_path("a", "/"))
- dosish = true
-when %r'\A//'
- test_ok(%r'\A//[^/]+/[^/]+\z' =~ File.expand_path(".", "/"))
- test_ok(%r'\A//[^/]+/[^/]+/a\z' =~ File.expand_path(".", "/"))
- dosish = true
-else
- test_ok(File.expand_path(".", "/") == "/")
- test_ok(File.expand_path("sub", "/") == "/sub")
-end
-if dosish
- test_ok(File.expand_path("/", "//machine/share/sub") == "//machine/share")
- test_ok(File.expand_path("/dir", "//machine/share/sub") == "//machine/share/dir")
- test_ok(File.expand_path("/", "z:/sub") == "z:/")
- test_ok(File.expand_path("/dir", "z:/sub") == "z:/dir")
-end
-test_ok(File.expand_path(".", "//") == "//")
-test_ok(File.expand_path("sub", "//") == "//sub")
-
-# test_check "Proc#binding"
-ObjectSpace.each_object(Proc){|o|
- begin
- b = o.binding
- eval 'self', b
- rescue ArgumentError
- end
-}
-
-test_check "gc"
-begin
- 1.upto(10000) {
- tmp = [0,1,2,3,4,5,6,7,8,9]
- }
- tmp = nil
- test_ok true
-rescue
- test_ok false
-end
-class S
- def initialize(a)
- @a = a
- end
-end
-l=nil
-100000.times {
- l = S.new(l)
-}
-GC.start
-test_ok true # reach here or dumps core
-l = []
-100000.times {
- l.push([l])
-}
-GC.start
-test_ok true # reach here or dumps core
-
-ObjectSpace.each_object{|o|
- o.class.name
-}
-
-test_ok true # reach here or dumps core
-
-PROGRESS.finish
-if $failed > 0
- printf "not ok/test: %d failed %d\n", $ntest, $failed
-else
- printf "end of test(test: %d)\n", $ntest
-end
diff --git a/benchmark/bm_app_aobench.rb b/benchmark/bm_app_aobench.rb
index 2bd6acfaf8..ffab116fcd 100644
--- a/benchmark/bm_app_aobench.rb
+++ b/benchmark/bm_app_aobench.rb
@@ -229,7 +229,7 @@ class Scene
w.times do |x|
rad = Vec.new(0.0, 0.0, 0.0)
- # Subsampling
+ # Subsmpling
nsubsamples.times do |v|
nsubsamples.times do |u|
diff --git a/benchmark/bm_array_sample_100k_10.rb b/benchmark/bm_array_sample_100k_10.rb
deleted file mode 100644
index 5f41ecc32b..0000000000
--- a/benchmark/bm_array_sample_100k_10.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 10}
diff --git a/benchmark/bm_array_sample_100k_11.rb b/benchmark/bm_array_sample_100k_11.rb
deleted file mode 100644
index 18b1715319..0000000000
--- a/benchmark/bm_array_sample_100k_11.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 11}
diff --git a/benchmark/bm_array_sample_100k__100.rb b/benchmark/bm_array_sample_100k__100.rb
deleted file mode 100644
index 22863afe89..0000000000
--- a/benchmark/bm_array_sample_100k__100.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 100}
diff --git a/benchmark/bm_array_sample_100k__1k.rb b/benchmark/bm_array_sample_100k__1k.rb
deleted file mode 100644
index 4cd79e6c67..0000000000
--- a/benchmark/bm_array_sample_100k__1k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 1000}
diff --git a/benchmark/bm_array_sample_100k__6k.rb b/benchmark/bm_array_sample_100k__6k.rb
deleted file mode 100644
index b3d264249e..0000000000
--- a/benchmark/bm_array_sample_100k__6k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 6000}
diff --git a/benchmark/bm_array_sample_100k___10k.rb b/benchmark/bm_array_sample_100k___10k.rb
deleted file mode 100644
index 5dd55ec058..0000000000
--- a/benchmark/bm_array_sample_100k___10k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 10_000}
diff --git a/benchmark/bm_array_sample_100k___50k.rb b/benchmark/bm_array_sample_100k___50k.rb
deleted file mode 100644
index 1506732c3c..0000000000
--- a/benchmark/bm_array_sample_100k___50k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 50_000}
diff --git a/benchmark/bm_array_shift.rb b/benchmark/bm_array_shift.rb
deleted file mode 100644
index 798bb9e3f4..0000000000
--- a/benchmark/bm_array_shift.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-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_array_small_and.rb b/benchmark/bm_array_small_and.rb
deleted file mode 100644
index e53a6edae6..0000000000
--- a/benchmark/bm_array_small_and.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-MIN_SIZE = ENV.fetch('SMALL_ARRAY_MIN', 0).to_i
-MAX_SIZE = ENV.fetch('SMALL_ARRAY_MAX', 16).to_i
-ITERATIONS = ENV.fetch('SMALL_ARRAY_ITERATIONS', 100).to_i
-
-ARRAYS = (MIN_SIZE..MAX_SIZE).map do |size1|
- (MIN_SIZE..MAX_SIZE).map do |size2|
- [Array.new(size1) { rand(MAX_SIZE) }, Array.new(size2) { rand(MAX_SIZE) }]
- end
-end
-
-ITERATIONS.times do
- ARRAYS.each do |group|
- group.each do |arr1, arr2|
- arr1 & arr2
- end
- end
-end
diff --git a/benchmark/bm_array_small_diff.rb b/benchmark/bm_array_small_diff.rb
deleted file mode 100644
index 9661ee48db..0000000000
--- a/benchmark/bm_array_small_diff.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-MIN_SIZE = ENV.fetch('SMALL_ARRAY_MIN', 0).to_i
-MAX_SIZE = ENV.fetch('SMALL_ARRAY_MAX', 16).to_i
-ITERATIONS = ENV.fetch('SMALL_ARRAY_ITERATIONS', 100).to_i
-
-ARRAYS = (MIN_SIZE..MAX_SIZE).map do |size1|
- (MIN_SIZE..MAX_SIZE).map do |size2|
- [Array.new(size1) { rand(MAX_SIZE) }, Array.new(size2) { rand(MAX_SIZE) }]
- end
-end
-
-ITERATIONS.times do
- ARRAYS.each do |group|
- group.each do |arr1, arr2|
- arr1 - arr2
- end
- end
-end
diff --git a/benchmark/bm_array_small_or.rb b/benchmark/bm_array_small_or.rb
deleted file mode 100644
index c58b5fd1ff..0000000000
--- a/benchmark/bm_array_small_or.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-MIN_SIZE = ENV.fetch('SMALL_ARRAY_MIN', 0).to_i
-MAX_SIZE = ENV.fetch('SMALL_ARRAY_MAX', 16).to_i
-ITERATIONS = ENV.fetch('SMALL_ARRAY_ITERATIONS', 100).to_i
-
-ARRAYS = (MIN_SIZE..MAX_SIZE).map do |size1|
- (MIN_SIZE..MAX_SIZE).map do |size2|
- [Array.new(size1) { rand(MAX_SIZE) }, Array.new(size2) { rand(MAX_SIZE) }]
- end
-end
-
-ITERATIONS.times do
- ARRAYS.each do |group|
- group.each do |arr1, arr2|
- arr1 | arr2
- end
- end
-end
diff --git a/benchmark/bm_array_sort_block.rb b/benchmark/bm_array_sort_block.rb
deleted file mode 100644
index 3579786056..0000000000
--- a/benchmark/bm_array_sort_block.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ary = Array.new(1000) { rand(1000) }
-10000.times { ary.sort { |a, b| a <=> b } }
diff --git a/benchmark/bm_array_sort_float.rb b/benchmark/bm_array_sort_float.rb
deleted file mode 100644
index 9a6e2f8bd2..0000000000
--- a/benchmark/bm_array_sort_float.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = Array.new(1000) { rand }
-10000.times { arr.sort }
diff --git a/benchmark/bm_bighash.rb b/benchmark/bm_bighash.rb
deleted file mode 100644
index e2ad5a5c94..0000000000
--- a/benchmark/bm_bighash.rb
+++ /dev/null
@@ -1 +0,0 @@
-h = {}; 5000000.times {|n| h[n] = n }
diff --git a/benchmark/bm_dir_empty_p.rb b/benchmark/bm_dir_empty_p.rb
deleted file mode 100644
index 8329c757cf..0000000000
--- a/benchmark/bm_dir_empty_p.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'tmpdir'
-max = 100_000
-Dir.mktmpdir('bm_dir_empty_p') do |dir|
- max.times { Dir.empty?(dir) }
-end
diff --git a/benchmark/bm_erb_render.rb b/benchmark/bm_erb_render.rb
deleted file mode 100644
index d2929b0553..0000000000
--- a/benchmark/bm_erb_render.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'erb'
-
-data = DATA.read
-max = 1_500_000
-title = "hello world!"
-content = "hello world!\n" * 10
-
-src = "def self.render(title, content); #{ERB.new(data).src}; end"
-mod = Module.new
-mod.instance_eval(src, "(ERB)")
-
-max.times do
- mod.render(title, content)
-end
-
-__END__
-
-<html>
- <head> <%= title %> </head>
- <body>
- <h1> <%= title %> </h1>
- <p>
- <%= content %>
- </p>
- </body>
-</html>
diff --git a/benchmark/bm_file_chmod.rb b/benchmark/bm_file_chmod.rb
deleted file mode 100644
index 1cd4760c9d..0000000000
--- a/benchmark/bm_file_chmod.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# chmod file
-require 'tempfile'
-max = 200_000
-tmp = Tempfile.new('chmod')
-path = tmp.path
-max.times do
- File.chmod(0777, path)
-end
-tmp.close!
diff --git a/benchmark/bm_file_rename.rb b/benchmark/bm_file_rename.rb
deleted file mode 100644
index 3bf6a5ef35..0000000000
--- a/benchmark/bm_file_rename.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# rename file
-require 'tempfile'
-
-max = 100_000
-tmp = [ Tempfile.new('rename-a'), Tempfile.new('rename-b') ]
-a, b = tmp.map { |x| x.path }
-max.times do
- File.rename(a, b)
- File.rename(b, a)
-end
-tmp.each { |t| t.close! }
diff --git a/benchmark/bm_hash_aref_dsym.rb b/benchmark/bm_hash_aref_dsym.rb
deleted file mode 100644
index af4f8c36d4..0000000000
--- a/benchmark/bm_hash_aref_dsym.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 9d7759379e..0000000000
--- a/benchmark/bm_hash_aref_dsym_long.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# [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
deleted file mode 100644
index 1346890582..0000000000
--- a/benchmark/bm_hash_aref_fix.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 2217274c82..0000000000
--- a/benchmark/bm_hash_aref_flo.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-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_sym.rb b/benchmark/bm_hash_aref_sym.rb
index f75d163fe6..54298ffc9e 100644
--- a/benchmark/bm_hash_aref_sym.rb
+++ b/benchmark/bm_hash_aref_sym.rb
@@ -1,9 +1,4 @@
h = {}
-syms = ('a'..'z').to_a
-begin
- syms = eval("%i[#{syms.join(' ')}]")
-rescue SyntaxError # <= 1.9.3
- syms.map!(&:to_sym)
-end
+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_aref_sym_long.rb b/benchmark/bm_hash_aref_sym_long.rb
index 9dab8df7be..a9be4059e6 100644
--- a/benchmark/bm_hash_aref_sym_long.rb
+++ b/benchmark/bm_hash_aref_sym_long.rb
@@ -3,11 +3,6 @@ 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
+].map!(&:to_sym)
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
deleted file mode 100644
index 0c7edfed3e..0000000000
--- a/benchmark/bm_hash_ident_flo.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-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_long.rb b/benchmark/bm_hash_long.rb
deleted file mode 100644
index 03d9109602..0000000000
--- a/benchmark/bm_hash_long.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-k1 = "Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong";
-k2 = "Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping";
-h = {k1 => 0, k2 => 0};
-3000000.times{|i| k = i % 2 ? k2 : k1; h [k] = h[k] + 1}
diff --git a/benchmark/bm_hash_shift_u16.rb b/benchmark/bm_hash_shift_u16.rb
deleted file mode 100644
index ec800d0342..0000000000
--- a/benchmark/bm_hash_shift_u16.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-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
deleted file mode 100644
index de4e0fa696..0000000000
--- a/benchmark/bm_hash_shift_u24.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-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
deleted file mode 100644
index 656aa55583..0000000000
--- a/benchmark/bm_hash_shift_u32.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-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_small2.rb b/benchmark/bm_hash_small2.rb
deleted file mode 100644
index 45485d9c71..0000000000
--- a/benchmark/bm_hash_small2.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a}
diff --git a/benchmark/bm_hash_small4.rb b/benchmark/bm_hash_small4.rb
deleted file mode 100644
index acd4084334..0000000000
--- a/benchmark/bm_hash_small4.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 4.times{|j| a[j]=j}; a}
diff --git a/benchmark/bm_hash_small8.rb b/benchmark/bm_hash_small8.rb
deleted file mode 100644
index 9cffcc91b6..0000000000
--- a/benchmark/bm_hash_small8.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 8.times{|j| a[j]=j}; a}
diff --git a/benchmark/bm_hash_to_proc.rb b/benchmark/bm_hash_to_proc.rb
deleted file mode 100644
index 2b675bf509..0000000000
--- a/benchmark/bm_hash_to_proc.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-h = {}
-
-10000.times do |i|
- h[i] = nil
-end
-
-5000.times do |i|
- [i].map(&h)
-end
diff --git a/benchmark/bm_int_quo.rb b/benchmark/bm_int_quo.rb
deleted file mode 100644
index e22a3f8c30..0000000000
--- a/benchmark/bm_int_quo.rb
+++ /dev/null
@@ -1 +0,0 @@
-5000000.times { 42.quo(3) }
diff --git a/benchmark/bm_io_copy_stream_write.rb b/benchmark/bm_io_copy_stream_write.rb
deleted file mode 100644
index 3fd87250a4..0000000000
--- a/benchmark/bm_io_copy_stream_write.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# The goal of this is to use a synthetic (non-IO) reader
-# to trigger the read/write loop of IO.copy_stream,
-# bypassing in-kernel mechanisms like sendfile for zero copy,
-# so we wrap the /dev/zero IO object:
-
-class Zero
- def initialize
- @n = 100000
- @in = File.open('/dev/zero', 'rb')
- end
-
- def read(len, buf)
- return if (@n -= 1) == 0
- @in.read(len, buf)
- end
-end
-
-begin
- src = Zero.new
- dst = File.open(IO::NULL, 'wb')
- n = IO.copy_stream(src, dst)
-rescue Errno::ENOENT
- # not *nix
-end if IO.respond_to?(:copy_stream) && IO.const_defined?(:NULL)
diff --git a/benchmark/bm_io_copy_stream_write_socket.rb b/benchmark/bm_io_copy_stream_write_socket.rb
deleted file mode 100644
index 11f369bd0d..0000000000
--- a/benchmark/bm_io_copy_stream_write_socket.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# The goal of this is to use a synthetic (non-IO) reader
-# to trigger the read/write loop of IO.copy_stream,
-# bypassing in-kernel mechanisms like sendfile for zero copy,
-# so we wrap the /dev/zero IO object:
-class Zero
- def initialize
- @n = 100000
- @in = File.open('/dev/zero', 'rb')
- end
-
- def read(len, buf)
- return if (@n -= 1) == 0
- @in.read(len, buf)
- end
-end
-
-begin
- require 'socket'
- src = Zero.new
- rd, wr = UNIXSocket.pair
- pid = fork do
- wr.close
- buf = String.new
- while rd.read(16384, buf)
- end
- end
- rd.close
- IO.copy_stream(src, wr)
-rescue Errno::ENOENT, NotImplementedError, NameError
- # not *nix: missing /dev/zero, fork, or UNIXSocket
-rescue LoadError # no socket?
-ensure
- wr.close if wr
- Process.waitpid(pid) if pid
-end if IO.respond_to?(:copy_stream)
diff --git a/benchmark/bm_io_nonblock_noex.rb b/benchmark/bm_io_nonblock_noex.rb
deleted file mode 100644
index da9357fdc6..0000000000
--- a/benchmark/bm_io_nonblock_noex.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-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
deleted file mode 100644
index 56819d049b..0000000000
--- a/benchmark/bm_io_nonblock_noex2.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-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_io_pipe_rw.rb b/benchmark/bm_io_pipe_rw.rb
deleted file mode 100644
index 6862a8ae61..0000000000
--- a/benchmark/bm_io_pipe_rw.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# Measure uncontended GVL performance via read/write with 1:1 threading
-# If we switch to M:N threading, this will benchmark something else...
-r, w = IO.pipe
-src = '0'.freeze
-dst = String.new
-i = 0
-while i < 1_000_000
- i += 1
- w.write(src)
- r.read(1, dst)
-end
-w.close
-r.close
diff --git a/benchmark/bm_marshal_dump_flo.rb b/benchmark/bm_marshal_dump_flo.rb
deleted file mode 100644
index 9b8d0c6afb..0000000000
--- a/benchmark/bm_marshal_dump_flo.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-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
deleted file mode 100644
index 8252ad90fa..0000000000
--- a/benchmark/bm_marshal_dump_load_geniv.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-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
deleted file mode 100644
index e29743b791..0000000000
--- a/benchmark/bm_marshal_dump_load_time.rb
+++ /dev/null
@@ -1 +0,0 @@
-100000.times { Marshal.load(Marshal.dump(Time.now)) }
diff --git a/benchmark/bm_require.rb b/benchmark/bm_require.rb
deleted file mode 100644
index b8abc88f41..0000000000
--- a/benchmark/bm_require.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-$:.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
deleted file mode 100644
index e54db6c6e5..0000000000
--- a/benchmark/bm_require_thread.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-$:.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_so_fasta.rb b/benchmark/bm_so_fasta.rb
index dcc6b39507..3f759ba7ae 100644
--- a/benchmark/bm_so_fasta.rb
+++ b/benchmark/bm_so_fasta.rb
@@ -3,7 +3,7 @@
# Contributed by Sokolov Yura
$last = 42.0
-def gen_random(max, im=139968, ia=3877, ic=29573)
+def gen_random (max,im=139968,ia=3877,ic=29573)
(max * ($last = ($last * ia + ic) % im)) / im
end
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
index 8c136baa6c..b8e93bd150 100755..100644
--- a/benchmark/bm_so_meteor_contest.rb
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -155,7 +155,7 @@ class Rotation
# given a set of directions places the piece (as defined by a set of directions) on the board at
# a location that will not take it off the edge
- def get_values( directions )
+ def get_values ( directions )
start = start_adjust(directions)
values = [ start ]
directions.each do | direction |
@@ -260,7 +260,7 @@ end
# support function that create three utility maps:
# $converter -- for each row an array that maps a five bit row (via array mapping)
-# to the a five bit representation of the bits below it
+# to the a a five bit representation of the bits below it
# $bit_count -- maps a five bit row (via array mapping) to the number of 1s in the row
# @@new_regions -- maps a five bit row (via array mapping) to an array of "region" arrays
# a region array has three values the first is a mask of bits in the region,
@@ -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 achieved via recursion. the overall approach is described
+# and adds any boards found. depth is acheived 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
@@ -561,3 +561,4 @@ create_collector_support
@boards_found = 0
find_all ######## DO IT!!!
+
diff --git a/benchmark/bm_so_pidigits.rb b/benchmark/bm_so_pidigits.rb
index 9a537b2d1c..c7d6fbfb4d 100644
--- a/benchmark/bm_so_pidigits.rb
+++ b/benchmark/bm_so_pidigits.rb
@@ -38,7 +38,7 @@ end
class Transformation
attr_reader :q, :r, :s, :t
- def initialize(q, r, s, t)
+ def initialize (q, r, s, t)
@q,@r,@s,@t,@k = q,r,s,t,0
end
diff --git a/benchmark/bm_string_index.rb b/benchmark/bm_string_index.rb
deleted file mode 100644
index 7783111082..0000000000
--- a/benchmark/bm_string_index.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-str1 = "あ" * 1024 + "い" # not single byte optimizable
-str2 = "い"
-100_000.times { str1.index(str2) }
diff --git a/benchmark/bm_string_scan_re.rb b/benchmark/bm_string_scan_re.rb
deleted file mode 100644
index b0d60201a9..0000000000
--- a/benchmark/bm_string_scan_re.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-str = Array.new(1_000, 'abc').join(',')
-1_000.times { str.scan(/abc/) }
diff --git a/benchmark/bm_string_scan_str.rb b/benchmark/bm_string_scan_str.rb
deleted file mode 100644
index 42440bd948..0000000000
--- a/benchmark/bm_string_scan_str.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-str = Array.new(1_000, 'abc').join(',')
-1_000.times { str.scan('abc') }
diff --git a/benchmark/bm_time_subsec.rb b/benchmark/bm_time_subsec.rb
deleted file mode 100644
index 505021c701..0000000000
--- a/benchmark/bm_time_subsec.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-t = Time.now
-4000000.times { t.subsec }
diff --git a/benchmark/bm_vm1_blockparam.rb b/benchmark/bm_vm1_blockparam.rb
deleted file mode 100755
index 11680a2e61..0000000000
--- a/benchmark/bm_vm1_blockparam.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m &b
-end
-
-i = 0
-while i<30_000_000 # while loop 1
- i += 1
- m{}
-end
-
diff --git a/benchmark/bm_vm1_blockparam_call.rb b/benchmark/bm_vm1_blockparam_call.rb
deleted file mode 100755
index f6102a2b5a..0000000000
--- a/benchmark/bm_vm1_blockparam_call.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def m &b
- b.call
-end
-
-i = 0
-while i<30_000_000 # while loop 1
- i += 1
- m{}
-end
diff --git a/benchmark/bm_vm1_blockparam_pass.rb b/benchmark/bm_vm1_blockparam_pass.rb
deleted file mode 100755
index 10029a257a..0000000000
--- a/benchmark/bm_vm1_blockparam_pass.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-def bp_yield
- yield
-end
-
-def bp_pass &b
- bp_yield &b
-end
-
-i = 0
-while i<30_000_000 # while loop 1
- i += 1
- bp_pass{}
-end
diff --git a/benchmark/bm_vm1_blockparam_yield.rb b/benchmark/bm_vm1_blockparam_yield.rb
deleted file mode 100755
index 6dc01ced7c..0000000000
--- a/benchmark/bm_vm1_blockparam_yield.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-def bp_yield &b
- yield
-end
-
-i = 0
-while i<30_000_000 # while loop 1
- i += 1
- bp_yield{}
-end
diff --git a/benchmark/bm_vm1_gc_wb_ary.rb b/benchmark/bm_vm1_gc_wb_ary.rb
index 1b030386cf..ecfab51dbf 100644
--- a/benchmark/bm_vm1_gc_wb_ary.rb
+++ b/benchmark/bm_vm1_gc_wb_ary.rb
@@ -1,12 +1,10 @@
-short_lived_ary = []
-
-if RUBY_VERSION >= "2.2.0"
- GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true)
-end
+long_lived = []
+GC.start
+GC.start
i = 0
short_lived = ''
while i<30_000_000 # while loop 1
- short_lived_ary[0] = short_lived # write barrier
+ long_lived[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
deleted file mode 100644
index ebc369a60f..0000000000
--- a/benchmark/bm_vm1_gc_wb_ary_promoted.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-long_lived = []
-
-if RUBY_VERSION > "2.2.0"
- 3.times{ GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true) }
-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 96f4261915..017eff4f94 100644
--- a/benchmark/bm_vm1_gc_wb_obj.rb
+++ b/benchmark/bm_vm1_gc_wb_obj.rb
@@ -1,15 +1,13 @@
class C
attr_accessor :foo
end
-short_lived_obj = C.new
-
-if RUBY_VERSION >= "2.2.0"
- GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true)
-end
+long_lived = C.new
+GC.start
+GC.start
i = 0
short_lived = ''
while i<30_000_000 # while loop 1
- short_lived_obj.foo = short_lived # write barrier
+ long_lived.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
deleted file mode 100644
index 674c413992..0000000000
--- a/benchmark/bm_vm1_gc_wb_obj_promoted.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-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, immediate_sweep: true) }
-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
deleted file mode 100644
index c62b294e0e..0000000000
--- a/benchmark/bm_vm2_case_lit.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-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_fiber_switch.rb b/benchmark/bm_vm2_fiber_switch.rb
deleted file mode 100644
index c6f615d71d..0000000000
--- a/benchmark/bm_vm2_fiber_switch.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# based on benchmark for [ruby-core:65518] [Feature #10341] by Knut Franke
-fib = Fiber.new do
- loop { Fiber.yield }
-end
-i = 0
-while i< 6_000_000 # benchmark loop 2
- i += 1
- fib.resume
-end
diff --git a/benchmark/bm_vm2_module_ann_const_set.rb b/benchmark/bm_vm2_module_ann_const_set.rb
deleted file mode 100644
index 12ccfd2ff3..0000000000
--- a/benchmark/bm_vm2_module_ann_const_set.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-i = 0
-while i<6_000_000 # benchmark loop 2
- i += 1
- Module.new.const_set(:X, Module.new)
-end
diff --git a/benchmark/bm_vm2_module_const_set.rb b/benchmark/bm_vm2_module_const_set.rb
deleted file mode 100644
index f4d4c1b2e7..0000000000
--- a/benchmark/bm_vm2_module_const_set.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-i = 0
-module M
-end
-$VERBOSE = nil
-while i<6_000_000 # benchmark loop 2
- i += 1
- M.const_set(:X, Module.new)
-end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
index 5d16480c6b..7362f738c5 100644
--- a/benchmark/bm_vm2_mutex.rb
+++ b/benchmark/bm_vm2_mutex.rb
@@ -1,6 +1,6 @@
require 'thread'
-m = Thread::Mutex.new
+m = Mutex.new
i = 0
while i<6_000_000 # benchmark loop 2
diff --git a/benchmark/bm_vm2_poly_singleton.rb b/benchmark/bm_vm2_poly_singleton.rb
deleted file mode 100644
index 0dba4320c4..0000000000
--- a/benchmark/bm_vm2_poly_singleton.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class C1
- def m; 1; end
-end
-
-o1 = C1.new
-o2 = C1.new
-o2.singleton_class
-
-i = 0
-while i<6_000_000 # benchmark loop 2
- o = (i % 2 == 0) ? o1 : o2
- o.m; o.m; o.m; o.m; o.m; o.m; o.m; o.m
- i += 1
-end
diff --git a/benchmark/bm_vm2_string_literal.rb b/benchmark/bm_vm2_string_literal.rb
deleted file mode 100644
index 1d73036849..0000000000
--- a/benchmark/bm_vm2_string_literal.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-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
deleted file mode 100644
index 22cb26b0a5..0000000000
--- a/benchmark/bm_vm2_struct_big_aref_hi.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 5e61a7087e..0000000000
--- a/benchmark/bm_vm2_struct_big_aref_lo.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 5a1c3d16f3..0000000000
--- a/benchmark/bm_vm2_struct_big_aset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index fff940a80a..0000000000
--- a/benchmark/bm_vm2_struct_big_href_hi.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 5e4085d59d..0000000000
--- a/benchmark/bm_vm2_struct_big_href_lo.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 9c0cee4141..0000000000
--- a/benchmark/bm_vm2_struct_big_hset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 8eaa555b41..0000000000
--- a/benchmark/bm_vm2_struct_small_aref.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index ecd0f95669..0000000000
--- a/benchmark/bm_vm2_struct_small_aset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 2c88fee6bf..0000000000
--- a/benchmark/bm_vm2_struct_small_href.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index 33c36d20f1..0000000000
--- a/benchmark/bm_vm2_struct_small_hset.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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 e668026915..7db9829d44 100644..100755
--- a/benchmark/bm_vm3_gc.rb
+++ b/benchmark/bm_vm3_gc.rb
@@ -1,3 +1,4 @@
+#! /usr/bin/ruby
5000.times do
100.times do
{"xxxx"=>"yyyy"}
diff --git a/benchmark/bm_vm3_gc_old_full.rb b/benchmark/bm_vm3_gc_old_full.rb
deleted file mode 100644
index cfdfc8c5a5..0000000000
--- a/benchmark/bm_vm3_gc_old_full.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-old_object = Array.new(1_000_000){''}
-100.times do
- GC.start
-end
diff --git a/benchmark/bm_vm3_gc_old_immediate.rb b/benchmark/bm_vm3_gc_old_immediate.rb
deleted file mode 100644
index ad22feb655..0000000000
--- a/benchmark/bm_vm3_gc_old_immediate.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-old_object = Array.new(1_000_000){''}
-30_000.times do
- GC.start(full_mark: false, immediate_sweep: true)
-end
diff --git a/benchmark/bm_vm3_gc_old_lazy.rb b/benchmark/bm_vm3_gc_old_lazy.rb
deleted file mode 100644
index b74d44baf1..0000000000
--- a/benchmark/bm_vm3_gc_old_lazy.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-old_object = Array.new(1_000_000){''}
-30_000.times do
- GC.start(full_mark: false, immediate_sweep: false)
-end
diff --git a/benchmark/bm_vm_symbol_block_pass.rb b/benchmark/bm_vm_symbol_block_pass.rb
deleted file mode 100644
index 1d433353e1..0000000000
--- a/benchmark/bm_vm_symbol_block_pass.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-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_condvar1.rb b/benchmark/bm_vm_thread_condvar1.rb
deleted file mode 100644
index cf5706b23e..0000000000
--- a/benchmark/bm_vm_thread_condvar1.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# two threads, two mutex, two condvar ping-pong
-require 'thread'
-m1 = Mutex.new
-m2 = Mutex.new
-cv1 = ConditionVariable.new
-cv2 = ConditionVariable.new
-max = 100000
-i = 0
-wait = nil
-m2.synchronize do
- wait = Thread.new do
- m1.synchronize do
- m2.synchronize { cv2.signal }
- while (i += 1) < max
- cv1.wait(m1)
- cv2.signal
- end
- end
- end
- cv2.wait(m2)
-end
-m1.synchronize do
- while i < max
- cv1.signal
- cv2.wait(m1)
- end
-end
-wait.join
diff --git a/benchmark/bm_vm_thread_condvar2.rb b/benchmark/bm_vm_thread_condvar2.rb
deleted file mode 100644
index 7c8dc19481..0000000000
--- a/benchmark/bm_vm_thread_condvar2.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# many threads, one mutex, many condvars
-require 'thread'
-m = Mutex.new
-cv1 = ConditionVariable.new
-cv2 = ConditionVariable.new
-max = 1000
-n = 100
-waiting = 0
-scvs = []
-waiters = n.times.map do |i|
- start_cv = ConditionVariable.new
- scvs << start_cv
- start_mtx = Mutex.new
- start_mtx.synchronize do
- th = Thread.new(start_mtx, start_cv) do |sm, scv|
- m.synchronize do
- sm.synchronize { scv.signal }
- max.times do
- cv2.signal if (waiting += 1) == n
- cv1.wait(m)
- end
- end
- end
- start_cv.wait(start_mtx)
- th
- end
-end
-m.synchronize do
- max.times do
- cv2.wait(m) until waiting == n
- waiting = 0
- cv1.broadcast
- end
-end
-waiters.each(&:join)
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
index 66e42c85e1..5c9f85dfb7 100644
--- a/benchmark/bm_vm_thread_mutex1.rb
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -1,7 +1,7 @@
# one thread, one mutex (no contention)
require 'thread'
-m = Thread::Mutex.new
+m = Mutex.new
r = 0
max = 2000
lmax = max * max
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
index 6e6c804c31..10de59054f 100644
--- a/benchmark/bm_vm_thread_mutex2.rb
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -1,7 +1,7 @@
# two threads, one mutex
require 'thread'
-m = Thread::Mutex.new
+m = Mutex.new
r = 0
max = 2000
lmax = (max * max)/2
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
index c750dc542a..7f9a44b39d 100644
--- a/benchmark/bm_vm_thread_mutex3.rb
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -1,7 +1,7 @@
# 1000 threads, one mutex
require 'thread'
-m = Thread::Mutex.new
+m = Mutex.new
r = 0
max = 2000
(1..max).map{
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
index a660aafc18..27157d1a6f 100644
--- a/benchmark/bm_vm_thread_pass_flood.rb
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -1,5 +1,3 @@
-# n.b. this is a good test for GVL when pinned to a single CPU
-
1000.times{
Thread.new{loop{Thread.pass}}
}
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
index 112a621905..272d231eba 100644
--- a/benchmark/bm_vm_thread_pipe.rb
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -1,4 +1,4 @@
-# Measure small and plenty pipe read/write.
+# Mesure small and plenty pipe read/write.
# A performance may depend on GVL implementation.
lmax = 100_000
diff --git a/benchmark/bm_vm_thread_queue.rb b/benchmark/bm_vm_thread_queue.rb
index 274ceda366..37381ae62b 100644
--- a/benchmark/bm_vm_thread_queue.rb
+++ b/benchmark/bm_vm_thread_queue.rb
@@ -1,7 +1,7 @@
require 'thread'
n = 1_000_000
-q = Thread::Queue.new
+q = Queue.new
consumer = Thread.new{
while q.pop
# consuming
diff --git a/benchmark/bm_vm_thread_sized_queue.rb b/benchmark/bm_vm_thread_sized_queue.rb
deleted file mode 100644
index 7b9af5482b..0000000000
--- a/benchmark/bm_vm_thread_sized_queue.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'thread'
-# on producer, one consumer
-
-n = 1_000_000
-q = Thread::SizedQueue.new(100)
-consumer = Thread.new{
- while q.pop
- # consuming
- end
-}
-
-producer = Thread.new{
- while n > 0
- q.push true
- n -= 1
- end
- q.push nil
-}
-
-consumer.join
diff --git a/benchmark/bm_vm_thread_sized_queue2.rb b/benchmark/bm_vm_thread_sized_queue2.rb
deleted file mode 100644
index de9f55e978..0000000000
--- a/benchmark/bm_vm_thread_sized_queue2.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'thread'
-# one producer, many consumers
-n = 1_000_000
-m = 10
-q = Thread::SizedQueue.new(100)
-consumers = m.times.map do
- Thread.new do
- while q.pop
- # consuming
- end
- end
-end
-
-producer = Thread.new do
- while n > 0
- q.push true
- n -= 1
- end
- m.times { q.push nil }
-end
-
-producer.join
-consumers.each(&:join)
diff --git a/benchmark/bm_vm_thread_sized_queue3.rb b/benchmark/bm_vm_thread_sized_queue3.rb
deleted file mode 100644
index ce5f1796d8..0000000000
--- a/benchmark/bm_vm_thread_sized_queue3.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'thread'
-# many producers, one consumer
-n = 1_000_000
-m = 10
-q = Thread::SizedQueue.new(100)
-consumer = Thread.new do
- while q.pop
- # consuming
- end
-end
-
-producers = m.times.map do
- Thread.new do
- while n > 0
- q.push true
- n -= 1
- end
- end
-end
-producers.each(&:join)
-q.push nil
-consumer.join
diff --git a/benchmark/bm_vm_thread_sized_queue4.rb b/benchmark/bm_vm_thread_sized_queue4.rb
deleted file mode 100644
index a9b7d80ec0..0000000000
--- a/benchmark/bm_vm_thread_sized_queue4.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'thread'
-# many producers, many consumers
-nr = 1_000_000
-n = 10
-m = 10
-q = Thread::SizedQueue.new(100)
-consumers = n.times.map do
- Thread.new do
- while q.pop
- # consuming
- end
- end
-end
-
-producers = m.times.map do
- Thread.new do
- while nr > 0
- q.push true
- nr -= 1
- end
- end
-end
-
-producers.each(&:join)
-n.times { q.push nil }
-consumers.each(&:join)
diff --git a/benchmark/driver.rb b/benchmark/driver.rb
index 469fc99f40..3904e25503 100755..100644
--- a/benchmark/driver.rb
+++ b/benchmark/driver.rb
@@ -1,4 +1,3 @@
-#!/usr/bin/env ruby
#
# Ruby Benchmark driver
#
@@ -19,7 +18,6 @@ end
require 'benchmark'
require 'pp'
-require 'tempfile'
class BenchmarkDriver
def self.benchmark(opt)
@@ -31,30 +29,6 @@ class BenchmarkDriver
end
end
- def self.load(input, type, opt)
- case type
- when 'yaml'
- require 'yaml'
- h = YAML.load(input)
- when 'json'
- require 'json'
- h = JSON.load(input)
- else
- h = eval(input.read)
- end
- results = h[:results] || h["results"]
- obj = allocate
- obj.instance_variable_set("@execs", h[:executables] || h["executables"])
- obj.instance_variable_set("@results", results)
- obj.instance_variable_set("@opt", opt)
- [1, 2].each do |i|
- loop = results.assoc((n = "loop_whileloop#{i}").intern) || results.assoc(n)
- obj.instance_variable_set("@loop_wl#{i}", loop ? loop[1].map {|t,*|t} : nil)
- end
- obj.instance_variable_set("@measure_target", opt[:measure_target] || opt["measure_target"])
- obj
- end
-
def output *args
puts(*args)
@output and @output.puts(*args)
@@ -103,9 +77,9 @@ class BenchmarkDriver
@exclude = opt[:exclude] || nil
@verbose = opt[:quiet] ? false : (opt[:verbose] || false)
@output = opt[:output] ? open(opt[:output], 'w') : nil
+ @rawdata_output = opt[:rawdata_output] ? open(opt[:rawdata_output], 'w') : nil
@loop_wl1 = @loop_wl2 = nil
@ruby_arg = opt[:ruby_arg] || nil
- @measure_target = opt[:measure_target]
@opt = opt
# [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
@@ -117,7 +91,6 @@ class BenchmarkDriver
@execs.each_with_index{|(path, label, version), i|
message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at \"#{path}\""
}
- message "measure target: #{@measure_target}"
end
end
@@ -145,27 +118,6 @@ 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, result|
- v.size + (case v; when /^vm1_/; @loop_wl1; when /^vm2_/; @loop_wl2; end ? 1 : 0)
- }.max
- minwidth ||= 7
- width = @execs.map{|(_, v)| [v.size, minwidth].max}
-
output
if @verbose
@@ -177,27 +129,12 @@ class BenchmarkDriver
message "Elapsed time: #{Time.now - @start_time} (sec)"
end
- if rawdata_output = @opt[:rawdata_output]
+ if @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}
+ @rawdata_output.puts h.inspect
end
output '-----------------------------------------------------------'
@@ -207,33 +144,20 @@ class BenchmarkDriver
output "minimum results in each #{@repeat} measurements."
end
- output({
- real: "Execution time (sec)",
- peak: "Memory usage (peak) (B)",
- size: "Memory usage (last size) (B)",
- }[@measure_target])
- 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
+ output "Execution time (sec)"
+ output "name\t#{@execs.map{|(_, v)| v}.join("\t")}"
@results.each{|v, result|
rets = []
s = adjusted_results(v, result){|r|
- rets << sprintf(numformat, r, width[rets.size])
+ rets << sprintf("%.3f", r)
}
- v += s if s
- output [v.ljust(name_width), rets].join("")
+ output "#{v}#{s}\t#{rets.join("\t")}"
}
if @execs.size > 1
output
- output({
- real: "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)",
- peak: "Memory consuming ratio (peak) with the result of `#{@execs[0][1]}' (greater is better)",
- size: "Memory consuming ratio (size) with the result of `#{@execs[0][1]}' (greater is better)",
- }[@measure_target])
- 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
+ output "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)"
+ output "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
@results.each{|v, result|
rets = []
first_value = nil
@@ -242,14 +166,13 @@ class BenchmarkDriver
if r == 0
rets << "Error"
else
- rets << sprintf(numformat, first_value/Float(r), width[rets.size+1])
+ rets << sprintf("%.3f", first_value/r)
end
else
first_value = r
end
}
- v += s if s
- output [v.ljust(name_width), rets].join("")
+ output "#{v}#{s}\t#{rets.join("\t")}"
}
end
@@ -331,30 +254,17 @@ class BenchmarkDriver
end
def measure executable, file
- case @measure_target
- when :real
- cmd = "#{executable} #{@ruby_arg} #{file}"
- m = Benchmark.measure{
- system(cmd, out: File::NULL)
- }
- result = m.real
- when :peak, :size
- tmp = Tempfile.new("benchmark-memory-wrapper-data")
- wrapper = "#{File.join(__dir__, 'memory_wrapper.rb')} #{tmp.path} #{@measure_target}"
- cmd = "#{executable} #{@ruby_arg} #{wrapper} #{file}"
+ cmd = "#{executable} #{@ruby_arg} #{file}"
+
+ m = Benchmark.measure{
system(cmd, out: File::NULL)
- result = tmp.read.to_i
- tmp.close
- else
- raise "unknown measure target"
- end
+ }
if $? != 0
- raise $?.inspect if $? && $?.signaled?
output "\`#{cmd}\' exited with abnormal status (#{$?})"
0
else
- result
+ m.real
end
end
end
@@ -364,15 +274,8 @@ if __FILE__ == $0
:execs => [],
:dir => File.dirname(__FILE__),
:repeat => 1,
- :measure_target => :real,
- :output => nil,
- :raw_output => nil,
- :format => :tsv,
- }
- formats = {
- :tsv => ".tsv",
- :markdown => ".md",
- :plain => ".txt",
+ :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ :raw_output => nil
}
parser = OptionParser.new{|o|
@@ -382,11 +285,6 @@ if __FILE__ == $0
opt[:execs] << path
}
}
- o.on('--rbenv [VERSIONS]', 'Specify benchmark targets with rbenv version (vX.X.X;vX.X.X;...)'){|v|
- v.split(/;/).each{|version|
- opt[:execs] << "#{version}::#{`RBENV_VERSION='#{version}' rbenv which ruby`.rstrip}"
- }
- }
o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
opt[:dir] = d
}
@@ -405,18 +303,9 @@ if __FILE__ == $0
o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
opt[:ruby_arg] = a
}
- o.on('--measure-target [TARGET]', 'real (execution time), peak, size (memory)'){|mt|
- opt[:measure_target] = mt.to_sym
- }
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
}
@@ -427,15 +316,6 @@ if __FILE__ == $0
}
parser.parse!(ARGV)
-
- if input = opt[:rawdata_input]
- b = open(input) {|f|
- BenchmarkDriver.load(f, File.extname(input)[1..-1], opt)
- }
- b.show_results
- else
- opt[:output] ||= "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}#{formats[opt[:format]]}"
- BenchmarkDriver.benchmark(opt)
- end
+ BenchmarkDriver.benchmark(opt)
end
diff --git a/benchmark/memory_wrapper.rb b/benchmark/memory_wrapper.rb
deleted file mode 100644
index 3f4451a037..0000000000
--- a/benchmark/memory_wrapper.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-
-write_file, target, script_file = ARGV
-
-load(script_file)
-require_relative '../test/lib/memory_status'
-open(write_file, 'wb'){|f|
- ms = Memory::Status.new
- case target.to_sym
- when :peak
- key = ms.respond_to?(:hwm) ? :hwm : :peak
- when :size
- key = ms.respond_to?(:rss) ? :rss : :size
- end
-
- f.puts ms[key]
-}
diff --git a/benchmark/prepare_require.rb b/benchmark/prepare_require.rb
deleted file mode 100644
index c4786f04ad..0000000000
--- a/benchmark/prepare_require.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-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
deleted file mode 100644
index 339ecb8b39..0000000000
--- a/benchmark/prepare_require_thread.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-load File.join(File.dirname(__FILE__), "prepare_require.rb")
-
diff --git a/bignum.c b/bignum.c
index 7ffb798e5e..08b4337262 100644
--- a/bignum.c
+++ b/bignum.c
@@ -9,10 +9,10 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/thread.h"
#include "ruby/util.h"
-#include "id.h"
+#include "internal.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -23,7 +23,7 @@
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
-#include "ruby_assert.h"
+#include <assert.h>
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
#define USE_GMP
@@ -32,9 +32,7 @@
#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
-#ifndef RUBY_INTEGER_UNIFICATION
VALUE rb_cBignum;
-#endif
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
#ifndef SIZEOF_BDIGIT_DBL
@@ -101,6 +99,7 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
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_BDIGIT)
#define BARY_ARGS(ary) ary, numberof(ary)
@@ -113,7 +112,7 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
#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_cInteger,(len),(sign))
+#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
#define BDIGITS_ZERO(ptr, n) do { \
BDIGIT *bdigitz_zero_ptr = (ptr); \
@@ -139,11 +138,6 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
#define GMP_DIV_DIGITS 20
#define GMP_BIG2STR_DIGITS 20
#define GMP_STR2BIG_DIGITS 20
-#ifdef USE_GMP
-# define NAIVE_MUL_DIGITS GMP_MUL_DIGITS
-#else
-# define NAIVE_MUL_DIGITS KARATSUBA_MUL_DIGITS
-#endif
typedef void (mulfunc_t)(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, BDIGIT *wds, size_t wn);
@@ -180,7 +174,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 script, maxpow.rb, generates the tables follows.
+/* The following scirpt, maxpow.rb, generates the tables follows.
def big(n, bits)
ns = []
@@ -420,20 +414,21 @@ static void
bary_small_rshift(BDIGIT *zds, const BDIGIT *xds, size_t n, int shift, BDIGIT higher_bdigit)
{
BDIGIT_DBL num = 0;
+ BDIGIT x;
assert(0 <= shift && shift < BITSPERDIG);
num = BIGUP(higher_bdigit);
while (n--) {
- BDIGIT x = xds[n];
- num = (num | x) >> shift;
+ num = (num | xds[n]) >> shift;
+ x = xds[n];
zds[n] = BIGLO(num);
num = BIGUP(x);
}
}
static int
-bary_zero_p(const BDIGIT *xds, size_t xn)
+bary_zero_p(BDIGIT *xds, size_t xn)
{
if (xn == 0)
return 1;
@@ -903,6 +898,8 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
if ((flags & INTEGER_PACK_2COMP) && (sign < 0 && numwords != 0)) {
+ unsigned char *buf;
+
int word_num_partialbits;
size_t word_num_fullbytes;
@@ -1653,7 +1650,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);
@@ -2490,8 +2487,13 @@ bary_mul_toom3_start(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const
static void
bary_mul(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
+#ifdef USE_GMP
+ const size_t naive_threshold = GMP_MUL_DIGITS;
+#else
+ const size_t naive_threshold = KARATSUBA_MUL_DIGITS;
+#endif
if (xn <= yn) {
- if (xn < NAIVE_MUL_DIGITS) {
+ if (xn < naive_threshold) {
if (xds == yds && xn == yn)
bary_sq_fast(zds, zn, xds, xn);
else
@@ -2500,7 +2502,7 @@ bary_mul(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds
}
}
else {
- if (yn < NAIVE_MUL_DIGITS) {
+ if (yn < naive_threshold) {
bary_short_mul(zds, zn, yds, yn, xds, xn);
return;
}
@@ -2978,7 +2980,7 @@ static VALUE
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));
- BIGNUM_SET_SIGN(big, sign);
+ BIGNUM_SET_SIGN(big, sign?1:0);
if (len <= BIGNUM_EMBED_LEN_MAX) {
RBASIC(big)->flags |= BIGNUM_EMBED_FLAG;
BIGNUM_SET_LEN(big, len);
@@ -3174,7 +3176,7 @@ rb_int2big(SIGNED_VALUE n)
}
big = rb_uint2big(u);
if (neg) {
- BIGNUM_SET_NEGATIVE_SIGN(big);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -3292,7 +3294,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];
+ BDIGIT nlz_bits_in_msbyte_bary[1] = { nlz_bits_in_msbyte };
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)];
@@ -3302,8 +3304,6 @@ 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)
@@ -3685,44 +3685,16 @@ rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t na
#define conv_digit(c) (ruby_digit36_to_number_table[(unsigned char)(c)])
-NORETURN(static inline void invalid_radix(int base));
-NORETURN(static inline void invalid_integer(VALUE s));
-
-static inline int
-valid_radix_p(int base)
-{
- return (1 < base && base <= 36);
-}
-
-static inline void
-invalid_radix(int base)
-{
- rb_raise(rb_eArgError, "invalid radix %d", base);
-}
-
-static inline void
-invalid_integer(VALUE s)
-{
- rb_raise(rb_eArgError, "invalid value for Integer(): %+"PRIsVALUE, s);
-}
-
-static int
-str2big_scan_digits(const char *s, const char *str, int base, int badcheck, size_t *num_digits_p, ssize_t *len_p)
+static void
+str2big_scan_digits(const char *s, const char *str, int base, int badcheck, size_t *num_digits_p, size_t *len_p)
{
char nondigit = 0;
size_t num_digits = 0;
const char *digits_start = str;
const char *digits_end = str;
- ssize_t len = *len_p;
int c;
- if (!len) {
- *num_digits_p = 0;
- *len_p = 0;
- return TRUE;
- }
-
if (badcheck && *str == '_') goto bad;
while ((c = *str++) != 0) {
@@ -3732,32 +3704,27 @@ str2big_scan_digits(const char *s, const char *str, int base, int badcheck, size
break;
}
nondigit = (char) c;
+ continue;
}
- else if ((c = conv_digit(c)) < 0 || c >= base) {
+ else if ((c = conv_digit(c)) < 0) {
break;
}
- else {
- nondigit = 0;
- num_digits++;
- digits_end = str;
- }
- if (len > 0 && !--len) break;
+ if (c >= base) break;
+ nondigit = 0;
+ num_digits++;
+ digits_end = str;
}
- if (badcheck && nondigit) goto bad;
- if (badcheck && len) {
+ if (badcheck) {
str--;
- while (*str && ISSPACE(*str)) {
- str++;
- if (len > 0 && !--len) break;
- }
- if (len && *str) {
+ if (s+1 < str && str[-1] == '_') goto bad;
+ while (*str && ISSPACE(*str)) str++;
+ if (*str) {
bad:
- return FALSE;
+ rb_invalid_str(s, "Integer()");
}
}
*num_digits_p = num_digits;
*len_p = digits_end - digits_start;
- return TRUE;
}
static VALUE
@@ -3972,115 +3939,59 @@ 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)
{
- char *end;
- VALUE ret = rb_cstr_parse_inum(str, -1, (badcheck ? NULL : &end), base);
- if (NIL_P(ret)) {
- if (badcheck) rb_invalid_str(str, "Integer()");
- ret = INT2FIX(0);
- }
- return ret;
-}
-
-/*
- * Parse +str+ as Ruby Integer, i.e., underscores, 0d and 0b prefixes.
- *
- * str: pointer to the string to be parsed.
- * should be NUL-terminated if +len+ is negative.
- * len: length of +str+ if >= 0. if +len+ is negative, +str+ should
- * be NUL-terminated.
- * endp: if non-NULL, the address after parsed part is stored. if
- * NULL, Qnil is returned when +str+ is not valid as an Integer.
- * ndigits: if non-NULL, the number of parsed digits is stored.
- * base: see +rb_cstr_to_inum+
- * flags: bitwise OR of below flags:
- * RB_INT_PARSE_SIGN: allow preceding spaces and +/- sign
- * RB_INT_PARSE_UNDERSCORE: allow an underscore between digits
- * RB_INT_PARSE_PREFIX: allow preceding prefix
- */
-
-VALUE
-rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
- int base, int flags)
-{
- const char *const s = str;
+ const char *s = str;
char sign = 1;
int c;
- VALUE z = Qnil;
+ VALUE z;
- unsigned long val;
- int ov;
+ int bits_per_digit;
const char *digits_start, *digits_end;
- size_t num_digits = 0;
+ size_t num_digits;
size_t num_bdigits;
- const ssize_t len0 = len;
- const int badcheck = !endp;
-
-#define ADV(n) do {\
- if (len > 0 && len <= (n)) goto bad; \
- str += (n); \
- len -= (n); \
- } while (0)
-#define ASSERT_LEN() do {\
- assert(len != 0); \
- if (len0 >= 0) assert(s + len0 == str + len); \
- } while (0)
+ size_t len;
if (!str) {
- bad:
- if (endp) *endp = (char *)str;
- if (ndigits) *ndigits = num_digits;
- return z;
+ if (badcheck) {
+ bad:
+ rb_invalid_str(s, "Integer()");
+ }
+ return INT2FIX(0);
}
- if (len && (flags & RB_INT_PARSE_SIGN)) {
- while (ISSPACE(*str)) ADV(1);
+ while (ISSPACE(*str)) str++;
- if (str[0] == '+') {
- ADV(1);
- }
- else if (str[0] == '-') {
- ADV(1);
- sign = 0;
- }
- ASSERT_LEN();
+ if (str[0] == '+') {
+ str++;
+ }
+ else if (str[0] == '-') {
+ str++;
+ sign = 0;
+ }
+ if (str[0] == '+' || str[0] == '-') {
+ if (badcheck) goto bad;
+ return INT2FIX(0);
}
if (base <= 0) {
- if (str[0] == '0' && len > 1) {
+ if (str[0] == '0') {
switch (str[1]) {
case 'x': case 'X':
base = 16;
- ADV(2);
+ str += 2;
break;
case 'b': case 'B':
base = 2;
- ADV(2);
+ str += 2;
break;
case 'o': case 'O':
base = 8;
- ADV(2);
+ str += 2;
break;
case 'd': case 'D':
base = 10;
- ADV(2);
+ str += 2;
break;
default:
base = 8;
@@ -4093,75 +4004,59 @@ rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
base = 10;
}
}
- else if (len == 1 || !(flags & RB_INT_PARSE_PREFIX)) {
- /* no prefix */
- }
else if (base == 2) {
if (str[0] == '0' && (str[1] == 'b'||str[1] == 'B')) {
- ADV(2);
+ str += 2;
}
}
else if (base == 8) {
if (str[0] == '0' && (str[1] == 'o'||str[1] == 'O')) {
- ADV(2);
+ str += 2;
}
}
else if (base == 10) {
if (str[0] == '0' && (str[1] == 'd'||str[1] == 'D')) {
- ADV(2);
+ str += 2;
}
}
else if (base == 16) {
if (str[0] == '0' && (str[1] == 'x'||str[1] == 'X')) {
- ADV(2);
+ str += 2;
}
}
- if (!valid_radix_p(base)) {
- invalid_radix(base);
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
- if (!len) goto bad;
- num_digits = str - s;
- if (*str == '0' && len != 1) { /* squeeze preceding 0s */
+ if (*str == '0') { /* squeeze preceding 0s */
int us = 0;
- const char *end = len < 0 ? NULL : str + len;
- ++num_digits;
- while ((c = *++str) == '0' ||
- ((flags & RB_INT_PARSE_UNDERSCORE) && c == '_')) {
+ while ((c = *++str) == '0' || c == '_') {
if (c == '_') {
if (++us >= 2)
break;
}
else {
- ++num_digits;
us = 0;
}
- if (str == end) break;
}
- if (!c || ISSPACE(c)) --str;
- if (end) len = end - str;
- ASSERT_LEN();
+ if (!(c = *str) || ISSPACE(c)) --str;
}
c = *str;
c = conv_digit(c);
if (c < 0 || c >= base) {
- if (!badcheck && num_digits) z = INT2FIX(0);
- goto bad;
- }
-
- if (ndigits) *ndigits = num_digits;
- val = ruby_scan_digits(str, len, base, &num_digits, &ov);
- if (!ov) {
- const char *end = &str[num_digits];
- if (num_digits > 0 && *end == '_' && (flags & RB_INT_PARSE_UNDERSCORE))
- goto bigparse;
- if (endp) *endp = (char *)end;
- if (ndigits) *ndigits += num_digits;
+ if (badcheck) goto bad;
+ return INT2FIX(0);
+ }
+
+ bits_per_digit = bit_length(base-1);
+ if (bits_per_digit * strlen(str) <= sizeof(long) * CHAR_BIT) {
+ char *end;
+ unsigned long val = STRTOUL(str, &end, base);
+
+ if (str < end && *end == '_') goto bigparse;
if (badcheck) {
- if (num_digits == 0) return Qnil; /* no number */
- while (len < 0 ? *end : end < str + len) {
- if (!ISSPACE(*end)) return Qnil; /* trailing garbage */
- end++;
- }
+ if (end == str) goto bad; /* no number */
+ while (*end && ISSPACE(*end)) end++;
+ if (*end) goto bad; /* trailing garbage */
}
if (POSFIXABLE(val)) {
@@ -4180,15 +4075,12 @@ rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
bigparse:
digits_start = str;
- if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
- goto bad;
- if (endp) *endp = (char *)(str + len);
- if (ndigits) *ndigits += num_digits;
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
digits_end = digits_start + len;
if (POW2_P(base)) {
z = str2big_poweroftwo(sign, digits_start, digits_end, num_digits,
- bit_length(base-1));
+ bits_per_digit);
}
else {
int digits_per_bdigits_dbl;
@@ -4216,28 +4108,34 @@ rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
}
VALUE
-rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base)
-{
- return rb_int_parse_cstr(str, len, endp, NULL, base,
- RB_INT_PARSE_DEFAULT);
-}
-
-VALUE
rb_str_to_inum(VALUE str, int base, int badcheck)
{
- VALUE ret;
- const char *s;
+ char *s;
long len;
- char *end;
+ VALUE v = 0;
+ VALUE ret;
StringValue(str);
rb_must_asciicompat(str);
- RSTRING_GETMEM(str, s, len);
- ret = rb_cstr_parse_inum(s, len, (badcheck ? NULL : &end), base);
- if (NIL_P(ret)) {
- if (badcheck) invalid_integer(str);
- ret = INT2FIX(0);
+ if (badcheck) {
+ s = StringValueCStr(str);
+ }
+ else {
+ s = RSTRING_PTR(str);
+ }
+ if (s) {
+ len = RSTRING_LEN(str);
+ if (s[len]) { /* no sentinel somehow */
+ char *p = ALLOCV(v, len+1);
+
+ MEMCPY(p, s, char, len);
+ p[len] = '\0';
+ s = p;
+ }
}
+ ret = rb_cstr_to_inum(s, base, badcheck);
+ if (v)
+ ALLOCV_END(v);
return ret;
}
@@ -4248,25 +4146,22 @@ rb_str2big_poweroftwo(VALUE arg, int base, int badcheck)
const char *s, *str;
const char *digits_start, *digits_end;
size_t num_digits;
- ssize_t len;
+ size_t len;
VALUE z;
- if (!valid_radix_p(base) || !POW2_P(base)) {
- invalid_radix(base);
+ if (base < 2 || 36 < base || !POW2_P(base)) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
rb_must_asciicompat(arg);
s = str = StringValueCStr(arg);
- len = RSTRING_LEN(arg);
if (*str == '-') {
- len--;
str++;
positive_p = 0;
}
digits_start = str;
- if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
- invalid_integer(arg);
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
digits_end = digits_start + len;
z = str2big_poweroftwo(positive_p, digits_start, digits_end, num_digits,
@@ -4284,28 +4179,25 @@ rb_str2big_normal(VALUE arg, int base, int badcheck)
const char *s, *str;
const char *digits_start, *digits_end;
size_t num_digits;
- ssize_t len;
+ size_t len;
VALUE z;
int digits_per_bdigits_dbl;
size_t num_bdigits;
- if (!valid_radix_p(base)) {
- invalid_radix(base);
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
rb_must_asciicompat(arg);
- s = str = StringValuePtr(arg);
- len = RSTRING_LEN(arg);
- if (len > 0 && *str == '-') {
- len--;
+ s = str = StringValueCStr(arg);
+ if (*str == '-') {
str++;
positive_p = 0;
}
digits_start = str;
- if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
- invalid_integer(arg);
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
digits_end = digits_start + len;
maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
@@ -4326,28 +4218,25 @@ rb_str2big_karatsuba(VALUE arg, int base, int badcheck)
const char *s, *str;
const char *digits_start, *digits_end;
size_t num_digits;
- ssize_t len;
+ size_t len;
VALUE z;
int digits_per_bdigits_dbl;
size_t num_bdigits;
- if (!valid_radix_p(base)) {
- invalid_radix(base);
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
rb_must_asciicompat(arg);
- s = str = StringValuePtr(arg);
- len = RSTRING_LEN(arg);
- if (len > 0 && *str == '-') {
- len--;
+ s = str = StringValueCStr(arg);
+ if (*str == '-') {
str++;
positive_p = 0;
}
digits_start = str;
- if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
- invalid_integer(arg);
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
digits_end = digits_start + len;
maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
@@ -4369,28 +4258,25 @@ rb_str2big_gmp(VALUE arg, int base, int badcheck)
const char *s, *str;
const char *digits_start, *digits_end;
size_t num_digits;
- ssize_t len;
+ size_t len;
VALUE z;
int digits_per_bdigits_dbl;
size_t num_bdigits;
- if (!valid_radix_p(base)) {
- invalid_radix(base);
+ if (base < 2 || 36 < base) {
+ rb_raise(rb_eArgError, "invalid radix %d", base);
}
rb_must_asciicompat(arg);
- s = str = StringValuePtr(arg);
- len = RSTRING_LEN(arg);
- if (len > 0 && *str == '-') {
- len--;
+ s = str = StringValueCStr(arg);
+ if (*str == '-') {
str++;
positive_p = 0;
}
digits_start = str;
- if (!str2big_scan_digits(s, str, base, badcheck, &num_digits, &len))
- invalid_integer(arg);
+ str2big_scan_digits(s, str, base, badcheck, &num_digits, &len);
digits_end = digits_start + len;
maxpow_in_bdigit_dbl(base, &digits_per_bdigits_dbl);
@@ -4444,7 +4330,7 @@ rb_ll2big(LONG_LONG n)
}
big = rb_ull2big(u);
if (neg) {
- BIGNUM_SET_NEGATIVE_SIGN(big);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -4465,46 +4351,6 @@ rb_ll2inum(LONG_LONG n)
#endif /* HAVE_LONG_LONG */
-#ifdef HAVE_INT128_T
-static VALUE
-rb_uint128t2big(uint128_t n)
-{
- long i;
- VALUE big = bignew(bdigit_roomof(SIZEOF_INT128_T), 1);
- BDIGIT *digits = BDIGITS(big);
-
- for (i = 0; i < bdigit_roomof(SIZEOF_INT128_T); i++) {
- digits[i] = BIGLO(RSHIFT(n ,BITSPERDIG*i));
- }
-
- i = bdigit_roomof(SIZEOF_INT128_T);
- while (i-- && !digits[i]) ;
- BIGNUM_SET_LEN(big, i+1);
- return big;
-}
-
-VALUE
-rb_int128t2big(int128_t n)
-{
- int neg = 0;
- uint128_t u;
- VALUE big;
-
- if (n < 0) {
- u = 1 + (uint128_t)(-(n + 1)); /* u = -n avoiding overflow */
- neg = 1;
- }
- else {
- u = n;
- }
- big = rb_uint128t2big(u);
- if (neg) {
- BIGNUM_SET_NEGATIVE_SIGN(big);
- }
- return big;
-}
-#endif
-
VALUE
rb_cstr2inum(const char *str, int base)
{
@@ -4713,9 +4559,8 @@ big2str_2bdigits(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t tail
p = buf;
j = sizeof(buf);
do {
- BDIGIT_DBL idx = num % b2s->base;
+ p[--j] = ruby_digitmap[num % b2s->base];
num /= b2s->base;
- p[--j] = ruby_digitmap[idx];
} while (num);
len = sizeof(buf) - j;
big2str_alloc(b2s, len + taillen);
@@ -4725,9 +4570,8 @@ big2str_2bdigits(struct big2str_struct *b2s, BDIGIT *xds, size_t xn, size_t tail
p = b2s->ptr;
j = b2s->hbase2_numdigits;
do {
- BDIGIT_DBL idx = num % b2s->base;
+ p[--j] = ruby_digitmap[num % b2s->base];
num /= b2s->base;
- p[--j] = ruby_digitmap[idx];
} while (j);
len = b2s->hbase2_numdigits;
}
@@ -4911,8 +4755,8 @@ big2str_generic(VALUE x, int base)
return rb_usascii_str_new2("0");
}
- if (!valid_radix_p(base))
- invalid_radix(base);
+ if (base < 2 || 36 < base)
+ rb_raise(rb_eArgError, "invalid radix %d", base);
if (xn >= LONG_MAX/BITSPERDIG) {
rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
@@ -4978,7 +4822,7 @@ rb_big2str_generic(VALUE x, int base)
}
#ifdef USE_GMP
-static VALUE
+VALUE
big2str_gmp(VALUE x, int base)
{
const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
@@ -5037,8 +4881,8 @@ rb_big2str1(VALUE x, int base)
return rb_usascii_str_new2("0");
}
- if (!valid_radix_p(base))
- invalid_radix(base);
+ if (base < 2 || 36 < base)
+ rb_raise(rb_eArgError, "invalid radix %d", base);
if (xn >= LONG_MAX/BITSPERDIG) {
rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
@@ -5064,6 +4908,35 @@ rb_big2str(VALUE x, int base)
return rb_big2str1(x, base);
}
+/*
+ * call-seq:
+ * big.to_s(base=10) -> string
+ *
+ * Returns a string containing the representation of <i>big</i> radix
+ * <i>base</i> (2 through 36).
+ *
+ * 12345654321.to_s #=> "12345654321"
+ * 12345654321.to_s(2) #=> "1011011111110110111011110000110001"
+ * 12345654321.to_s(8) #=> "133766736061"
+ * 12345654321.to_s(16) #=> "2dfdbbc31"
+ * 78546939656932.to_s(36) #=> "rubyrules"
+ */
+
+static VALUE
+rb_big_to_s(int argc, VALUE *argv, VALUE x)
+{
+ int base;
+
+ if (argc == 0) base = 10;
+ else {
+ VALUE b;
+
+ rb_scan_args(argc, argv, "01", &b);
+ base = NUM2INT(b);
+ }
+ return rb_big2str(x, base);
+}
+
static unsigned long
big2ulong(VALUE x, const char *type)
{
@@ -5098,8 +4971,10 @@ rb_big2ulong(VALUE x)
return num;
}
else {
- if (num <= 1+(unsigned long)(-(LONG_MIN+1)))
- return -(long)(num-1)-1;
+ if (num <= LONG_MAX)
+ return -(long)num;
+ if (num == 1+(unsigned long)(-(LONG_MIN+1)))
+ return LONG_MIN;
}
rb_raise(rb_eRangeError, "bignum out of range of unsigned long");
}
@@ -5114,8 +4989,10 @@ rb_big2long(VALUE x)
return num;
}
else {
- if (num <= 1+(unsigned long)(-(LONG_MIN+1)))
- return -(long)(num-1)-1;
+ if (num <= LONG_MAX)
+ return -(long)num;
+ if (num == 1+(unsigned long)(-(LONG_MIN+1)))
+ return LONG_MIN;
}
rb_raise(rb_eRangeError, "bignum too big to convert into `long'");
}
@@ -5154,8 +5031,10 @@ rb_big2ull(VALUE x)
return num;
}
else {
- if (num <= 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
- return -(LONG_LONG)(num-1)-1;
+ if (num <= LLONG_MAX)
+ return -(LONG_LONG)num;
+ if (num == 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
+ return LLONG_MIN;
}
rb_raise(rb_eRangeError, "bignum out of range of unsigned long long");
}
@@ -5170,8 +5049,10 @@ rb_big2ll(VALUE x)
return num;
}
else {
- if (num <= 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
- return -(LONG_LONG)(num-1)-1;
+ if (num <= LLONG_MAX)
+ return -(LONG_LONG)num;
+ if (num == 1+(unsigned LONG_LONG)(-(LLONG_MIN+1)))
+ return LLONG_MIN;
}
rb_raise(rb_eRangeError, "bignum too big to convert into `long long'");
}
@@ -5262,7 +5143,7 @@ big2dbl(VALUE x)
}
}
}
- if (BIGNUM_NEGATIVE_P(x)) d = -d;
+ if (!BIGNUM_SIGN(x)) d = -d;
return d;
}
@@ -5281,6 +5162,21 @@ rb_big2dbl(VALUE x)
return d;
}
+/*
+ * call-seq:
+ * big.to_f -> float
+ *
+ * Converts <i>big</i> to a <code>Float</code>. If <i>big</i> doesn't
+ * fit in a <code>Float</code>, the result is infinity.
+ *
+ */
+
+static VALUE
+rb_big_to_f(VALUE x)
+{
+ return DBL2NUM(rb_big2dbl(x));
+}
+
VALUE
rb_integer_float_cmp(VALUE x, VALUE y)
{
@@ -5363,32 +5259,52 @@ rb_integer_float_eq(VALUE x, VALUE y)
return rb_big_eq(x, y);
}
+/*
+ * call-seq:
+ * big <=> numeric -> -1, 0, +1 or nil
+ *
+ * Comparison---Returns -1, 0, or +1 depending on whether +big+ is
+ * less than, equal to, or greater than +numeric+. This is the
+ * basis for the tests in Comparable.
+ *
+ * +nil+ is returned if the two values are incomparable.
+ *
+ */
+
VALUE
rb_big_cmp(VALUE x, VALUE y)
{
+ int cmp;
+
if (FIXNUM_P(y)) {
- x = bigfixize(x);
+ x = bignorm(x);
if (FIXNUM_P(x)) {
- /* SIGNED_VALUE and Fixnum have same sign-bits, same
- * order */
- SIGNED_VALUE sx = (SIGNED_VALUE)x, sy = (SIGNED_VALUE)y;
- if (sx < sy) return INT2FIX(-1);
- return INT2FIX(sx > sy);
+ 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)) {
- if (BIGNUM_SIGN(x) == BIGNUM_SIGN(y)) {
- int cmp = bary_cmp(BDIGITS(x), BIGNUM_LEN(x), BDIGITS(y), BIGNUM_LEN(y));
- return INT2FIX(BIGNUM_SIGN(x) ? cmp : -cmp);
- }
}
else if (RB_FLOAT_TYPE_P(y)) {
return rb_integer_float_cmp(x, y);
}
else {
- return rb_num_coerce_cmp(x, y, idCmp);
+ return rb_num_coerce_cmp(x, y, rb_intern("<=>"));
}
- return INT2FIX(BIGNUM_SIGN(x) ? 1 : -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), BIGNUM_LEN(x), BDIGITS(y), BIGNUM_LEN(y));
+ if (BIGNUM_SIGN(x))
+ return INT2FIX(cmp);
+ else
+ return INT2FIX(-cmp);
}
enum big_op_t {
@@ -5404,7 +5320,7 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
VALUE rel;
int n;
- if (RB_INTEGER_TYPE_P(y)) {
+ if (FIXNUM_P(y) || RB_BIGNUM_TYPE_P(y)) {
rel = rb_big_cmp(x, y);
}
else if (RB_FLOAT_TYPE_P(y)) {
@@ -5414,9 +5330,9 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
ID id = 0;
switch (op) {
case big_op_gt: id = '>'; break;
- case big_op_ge: id = idGE; break;
+ case big_op_ge: id = rb_intern(">="); break;
case big_op_lt: id = '<'; break;
- case big_op_le: id = idLE; break;
+ case big_op_le: id = rb_intern("<="); break;
}
return rb_num_coerce_relop(x, y, id);
}
@@ -5433,26 +5349,58 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
return Qundef;
}
-VALUE
-rb_big_gt(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big > real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than that of <code>real</code>.
+ */
+
+static VALUE
+big_gt(VALUE x, VALUE y)
{
return big_op(x, y, big_op_gt);
}
-VALUE
-rb_big_ge(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big >= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * greater than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_ge(VALUE x, VALUE y)
{
return big_op(x, y, big_op_ge);
}
-VALUE
-rb_big_lt(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big < real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than that of <code>real</code>.
+ */
+
+static VALUE
+big_lt(VALUE x, VALUE y)
{
return big_op(x, y, big_op_lt);
}
-VALUE
-rb_big_le(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big <= real -> true or false
+ *
+ * Returns <code>true</code> if the value of <code>big</code> is
+ * less than or equal to that of <code>real</code>.
+ */
+
+static VALUE
+big_le(VALUE x, VALUE y)
{
return big_op(x, y, big_op_le);
}
@@ -5462,8 +5410,8 @@ rb_big_le(VALUE x, VALUE y)
* big == obj -> true or false
*
* Returns <code>true</code> only if <i>obj</i> has the same value
- * as <i>big</i>. Contrast this with <code>Integer#eql?</code>, which
- * requires <i>obj</i> to be a <code>Integer</code>.
+ * as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which
+ * requires <i>obj</i> to be a <code>Bignum</code>.
*
* 68719476736 == 68719476736.0 #=> true
*/
@@ -5472,7 +5420,8 @@ VALUE
rb_big_eq(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return bignorm(x) == y ? Qtrue : Qfalse;
+ if (bignorm(x) == y) return Qtrue;
+ y = rb_int2big(FIX2LONG(y));
}
else if (RB_BIGNUM_TYPE_P(y)) {
}
@@ -5488,6 +5437,17 @@ rb_big_eq(VALUE x, VALUE y)
return Qtrue;
}
+/*
+ * call-seq:
+ * big.eql?(obj) -> true or false
+ *
+ * Returns <code>true</code> only if <i>obj</i> is a
+ * <code>Bignum</code> with the same value as <i>big</i>. Contrast this
+ * with <code>Bignum#==</code>, which performs type conversions.
+ *
+ * 68719476736.eql?(68719476736.0) #=> false
+ */
+
VALUE
rb_big_eql(VALUE x, VALUE y)
{
@@ -5498,18 +5458,37 @@ rb_big_eql(VALUE x, VALUE y)
return Qtrue;
}
+/*
+ * call-seq:
+ * -big -> integer
+ *
+ * Unary minus (returns an integer whose value is 0-big)
+ */
+
VALUE
rb_big_uminus(VALUE x)
{
VALUE z = rb_big_clone(x);
- BIGNUM_NEGATE(z);
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
return bignorm(z);
}
-VALUE
-rb_big_comp(VALUE x)
+/*
+ * call-seq:
+ * ~big -> integer
+ *
+ * Inverts the bits in big. As Bignums are conceptually infinite
+ * length, the result acts as if it had an infinite number of one
+ * bits to the left. In hex representations, this is displayed
+ * as two periods to the left of the digits.
+ *
+ * sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA"
+ */
+
+static VALUE
+rb_big_neg(VALUE x)
{
VALUE z = rb_big_clone(x);
BDIGIT *ds = BDIGITS(z);
@@ -5589,7 +5568,7 @@ bigsub_int(VALUE x, long y0)
assert(xn == zn);
num = (BDIGIT_DBL_SIGNED)xds[0] - y;
if (xn == 1 && num < 0) {
- BIGNUM_NEGATE(z);
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
zds[0] = (BDIGIT)-num;
RB_GC_GUARD(x);
return bignorm(z);
@@ -5652,7 +5631,7 @@ bigsub_int(VALUE x, long y0)
assert(num == 0 || num == -1);
if (num < 0) {
get2comp(z);
- BIGNUM_NEGATE(z);
+ BIGNUM_SET_SIGN(z, !BIGNUM_SIGN(x));
}
RB_GC_GUARD(x);
return bignorm(z);
@@ -5768,6 +5747,13 @@ bigadd(VALUE x, VALUE y, int sign)
return z;
}
+/*
+ * call-seq:
+ * big + other -> Numeric
+ *
+ * Adds big and other, returning the result.
+ */
+
VALUE
rb_big_plus(VALUE x, VALUE y)
{
@@ -5797,6 +5783,13 @@ rb_big_plus(VALUE x, VALUE y)
}
}
+/*
+ * call-seq:
+ * big - other -> Numeric
+ *
+ * Subtracts other from big, returning the result.
+ */
+
VALUE
rb_big_minus(VALUE x, VALUE y)
{
@@ -5841,10 +5834,17 @@ bigsq(VALUE x)
xds = BDIGITS(x);
zds = BDIGITS(z);
- if (xn < NAIVE_MUL_DIGITS)
+#ifdef USE_GMP
+ if (xn < GMP_MUL_DIGITS)
+ bary_sq_fast(zds, zn, xds, xn);
+ else
+ bary_mul(zds, zn, xds, xn, xds, xn);
+#else
+ if (xn < KARATSUBA_MUL_DIGITS)
bary_sq_fast(zds, zn, xds, xn);
else
bary_mul(zds, zn, xds, xn, xds, xn);
+#endif
RB_GC_GUARD(x);
return z;
@@ -5877,6 +5877,13 @@ bigmul0(VALUE x, VALUE y)
return z;
}
+/*
+ * call-seq:
+ * big * other -> Numeric
+ *
+ * Multiplies big and other, returning the result.
+ */
+
VALUE
rb_big_mul(VALUE x, VALUE y)
{
@@ -6032,18 +6039,43 @@ rb_big_divide(VALUE x, VALUE y, ID op)
return bignorm(z);
}
+/*
+ * call-seq:
+ * big / other -> Numeric
+ *
+ * Performs division: the class of the resulting object depends on
+ * the class of <code>numeric</code> and on the magnitude of the
+ * result.
+ */
+
VALUE
rb_big_div(VALUE x, VALUE y)
{
return rb_big_divide(x, y, '/');
}
+/*
+ * call-seq:
+ * big.div(other) -> integer
+ *
+ * Performs integer division: returns integer value.
+ */
+
VALUE
rb_big_idiv(VALUE x, VALUE y)
{
return rb_big_divide(x, y, rb_intern("div"));
}
+/*
+ * call-seq:
+ * big % other -> Numeric
+ * big.modulo(other) -> Numeric
+ *
+ * Returns big modulo other. See Numeric.divmod for more
+ * information.
+ */
+
VALUE
rb_big_modulo(VALUE x, VALUE y)
{
@@ -6060,7 +6092,16 @@ rb_big_modulo(VALUE x, VALUE y)
return bignorm(z);
}
-VALUE
+/*
+ * call-seq:
+ * big.remainder(numeric) -> number
+ *
+ * Returns the remainder after dividing <i>big</i> by <i>numeric</i>.
+ *
+ * -1234567890987654321.remainder(13731) #=> -6966
+ * -1234567890987654321.remainder(13731.24) #=> -9906.22531493148
+ */
+static VALUE
rb_big_remainder(VALUE x, VALUE y)
{
VALUE z;
@@ -6076,6 +6117,13 @@ rb_big_remainder(VALUE x, VALUE y)
return bignorm(z);
}
+/*
+ * call-seq:
+ * big.divmod(numeric) -> array
+ *
+ * See <code>Numeric#divmod</code>.
+ *
+ */
VALUE
rb_big_divmod(VALUE x, VALUE y)
{
@@ -6102,11 +6150,10 @@ big_shift(VALUE x, long n)
return x;
}
-enum {DBL_BIGDIG = ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)};
-
-static double
+static VALUE
big_fdiv(VALUE x, VALUE y, long ey)
{
+#define DBL_BIGDIG ((DBL_MANT_DIG + BITSPERDIG) / BITSPERDIG)
VALUE z;
long l, ex;
@@ -6114,8 +6161,6 @@ big_fdiv(VALUE x, VALUE y, long ey)
l = BIGNUM_LEN(x);
ex = l * BITSPERDIG - nlz(BDIGITS(x)[l-1]);
ex -= 2 * DBL_BIGDIG * BITSPERDIG;
- if (ex > BITSPERDIG) ex -= BITSPERDIG;
- else if (ex > 0) ex = 0;
if (ex) x = big_shift(x, ex);
bigdivrem(x, y, &z, 0);
@@ -6123,14 +6168,14 @@ big_fdiv(VALUE x, VALUE y, long ey)
#if SIZEOF_LONG > SIZEOF_INT
{
/* Visual C++ can't be here */
- if (l > INT_MAX) return INFINITY;
- if (l < INT_MIN) return 0.0;
+ if (l > INT_MAX) return DBL2NUM(INFINITY);
+ if (l < INT_MIN) return DBL2NUM(0.0);
}
#endif
- return ldexp(big2dbl(z), (int)l);
+ return DBL2NUM(ldexp(big2dbl(z), (int)l));
}
-static double
+static VALUE
big_fdiv_int(VALUE x, VALUE y)
{
long l, ey;
@@ -6142,7 +6187,7 @@ big_fdiv_int(VALUE x, VALUE y)
return big_fdiv(x, y, ey);
}
-static double
+static VALUE
big_fdiv_float(VALUE x, VALUE y)
{
int i;
@@ -6150,8 +6195,21 @@ big_fdiv_float(VALUE x, VALUE y)
return big_fdiv(x, y, i - DBL_MANT_DIG);
}
-double
-rb_big_fdiv_double(VALUE x, VALUE y)
+/*
+ * call-seq:
+ * big.fdiv(numeric) -> float
+ *
+ * Returns the floating point result of dividing <i>big</i> by
+ * <i>numeric</i>.
+ *
+ * -1234567890987654321.fdiv(13731) #=> -89910996357705.5
+ * -1234567890987654321.fdiv(13731.24) #=> -89909424858035.7
+ *
+ */
+
+
+VALUE
+rb_big_fdiv(VALUE x, VALUE y)
{
double dx, dy;
@@ -6169,21 +6227,28 @@ rb_big_fdiv_double(VALUE x, VALUE y)
else if (RB_FLOAT_TYPE_P(y)) {
dy = RFLOAT_VALUE(y);
if (isnan(dy))
- return dy;
+ return y;
if (isinf(dx))
return big_fdiv_float(x, y);
}
else {
- return NUM2DBL(rb_num_coerce_bin(x, y, rb_intern("fdiv")));
+ return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
- return dx / dy;
+ return DBL2NUM(dx / dy);
}
-VALUE
-rb_big_fdiv(VALUE x, VALUE y)
-{
- return DBL2NUM(rb_big_fdiv_double(x, y));
-}
+/*
+ * call-seq:
+ * big ** exponent -> numeric
+ *
+ * Raises _big_ to the _exponent_ power (which may be an integer, float,
+ * or anything that will coerce to a number). The result may be
+ * a Fixnum, Bignum, or Float
+ *
+ * 123456789 ** 2 #=> 15241578750190521
+ * 123456789 ** 1.2 #=> 5126464716.09932
+ * 123456789 ** -2 #=> 6.5610001194102e-17
+ */
VALUE
rb_big_pow(VALUE x, VALUE y)
@@ -6195,8 +6260,8 @@ 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 ((BIGNUM_NEGATIVE_P(x) && !BIGZEROP(x)) && d != round(d))
- return rb_funcall(rb_complex_raw1(x), idPow, 1, y);
+ 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)) {
y = bignorm(y);
@@ -6209,7 +6274,7 @@ rb_big_pow(VALUE x, VALUE y)
yy = FIX2LONG(y);
if (yy < 0)
- return rb_funcall(rb_rational_raw1(x), idPow, 1, y);
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
else {
VALUE z = 0;
SIGNED_VALUE mask;
@@ -6234,7 +6299,7 @@ rb_big_pow(VALUE x, VALUE y)
}
}
else {
- return rb_num_coerce_bin(x, y, idPow);
+ return rb_num_coerce_bin(x, y, rb_intern("**"));
}
return DBL2NUM(pow(rb_big2dbl(x), d));
}
@@ -6294,6 +6359,13 @@ bigand_int(VALUE x, long xn, BDIGIT hibitsx, long y)
return bignorm(z);
}
+/*
+ * call-seq:
+ * big & numeric -> integer
+ *
+ * Performs bitwise +and+ between _big_ and _numeric_.
+ */
+
VALUE
rb_big_and(VALUE x, VALUE y)
{
@@ -6306,7 +6378,7 @@ rb_big_and(VALUE x, VALUE y)
BDIGIT tmph;
long tmpn;
- if (!RB_INTEGER_TYPE_P(y)) {
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
return rb_num_coerce_bit(x, y, '&');
}
@@ -6413,6 +6485,13 @@ bigor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
return bignorm(z);
}
+/*
+ * call-seq:
+ * big | numeric -> integer
+ *
+ * Performs bitwise +or+ between _big_ and _numeric_.
+ */
+
VALUE
rb_big_or(VALUE x, VALUE y)
{
@@ -6425,7 +6504,7 @@ rb_big_or(VALUE x, VALUE y)
BDIGIT tmph;
long tmpn;
- if (!RB_INTEGER_TYPE_P(y)) {
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
return rb_num_coerce_bit(x, y, '|');
}
@@ -6506,6 +6585,12 @@ bigxor_int(VALUE x, long xn, BDIGIT hibitsx, long y)
RB_GC_GUARD(x);
return bignorm(z);
}
+/*
+ * call-seq:
+ * big ^ numeric -> integer
+ *
+ * Performs bitwise +exclusive or+ between _big_ and _numeric_.
+ */
VALUE
rb_big_xor(VALUE x, VALUE y)
@@ -6519,7 +6604,7 @@ rb_big_xor(VALUE x, VALUE y)
BDIGIT tmph;
long tmpn;
- if (!RB_INTEGER_TYPE_P(y)) {
+ if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) {
return rb_num_coerce_bit(x, y, '^');
}
@@ -6555,6 +6640,13 @@ rb_big_xor(VALUE x, VALUE y)
return bignorm(z);
}
+/*
+ * call-seq:
+ * big << numeric -> integer
+ *
+ * Shifts big left _numeric_ positions (right if _numeric_ is negative).
+ */
+
VALUE
rb_big_lshift(VALUE x, VALUE y)
{
@@ -6585,6 +6677,14 @@ rb_big_lshift(VALUE x, VALUE y)
}
}
+
+/*
+ * call-seq:
+ * big >> numeric -> integer
+ *
+ * Shifts big right _numeric_ positions (left if _numeric_ is negative).
+ */
+
VALUE
rb_big_rshift(VALUE x, VALUE y)
{
@@ -6615,7 +6715,26 @@ rb_big_rshift(VALUE x, VALUE y)
}
}
-VALUE
+/*
+ * call-seq:
+ * big[n] -> 0, 1
+ *
+ * Bit Reference---Returns the <em>n</em>th bit in the (assumed) binary
+ * representation of <i>big</i>, where <i>big</i>[0] is the least
+ * significant bit.
+ *
+ * a = 9**15
+ * 50.downto(0) do |n|
+ * print a[n]
+ * end
+ *
+ * <em>produces:</em>
+ *
+ * 000101110110100000111000011110010100111100010111001
+ *
+ */
+
+static VALUE
rb_big_aref(VALUE x, VALUE y)
{
BDIGIT *xds;
@@ -6625,7 +6744,7 @@ rb_big_aref(VALUE x, VALUE y)
BDIGIT bit;
if (RB_BIGNUM_TYPE_P(y)) {
- if (BIGNUM_NEGATIVE_P(y))
+ if (!BIGNUM_SIGN(y))
return INT2FIX(0);
bigtrunc(y);
if (BIGSIZE(y) > sizeof(size_t)) {
@@ -6660,13 +6779,22 @@ rb_big_aref(VALUE x, VALUE y)
return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
}
-VALUE
+/*
+ * call-seq:
+ * big.hash -> fixnum
+ *
+ * Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
+ */
+
+static VALUE
rb_big_hash(VALUE x)
{
st_index_t hash;
hash = rb_memhash(BDIGITS(x), sizeof(BDIGIT)*BIGNUM_LEN(x)) ^ BIGNUM_SIGN(x);
- return ST2FIX(hash);
+ return INT2FIX(hash);
}
/*
@@ -6684,47 +6812,95 @@ rb_big_hash(VALUE x)
*/
static VALUE
-rb_int_coerce(VALUE x, VALUE y)
+rb_big_coerce(VALUE x, VALUE y)
{
- if (RB_INTEGER_TYPE_P(y)) {
- return rb_assoc_new(y, x);
+ if (FIXNUM_P(y)) {
+ y = rb_int2big(FIX2LONG(y));
}
- else {
- x = rb_Float(x);
- y = rb_Float(y);
- return rb_assoc_new(y, x);
+ else if (!RB_BIGNUM_TYPE_P(y)) {
+ rb_raise(rb_eTypeError, "can't coerce %s to Bignum",
+ rb_obj_classname(y));
}
+ return rb_assoc_new(y, x);
}
-VALUE
+/*
+ * call-seq:
+ * big.abs -> aBignum
+ * big.magnitude -> aBignum
+ *
+ * Returns the absolute value of <i>big</i>.
+ *
+ * -1234567890987654321.abs #=> 1234567890987654321
+ */
+
+static VALUE
rb_big_abs(VALUE x)
{
- if (BIGNUM_NEGATIVE_P(x)) {
+ if (!BIGNUM_SIGN(x)) {
x = rb_big_clone(x);
- BIGNUM_SET_POSITIVE_SIGN(x);
+ BIGNUM_SET_SIGN(x, 1);
}
return x;
}
-int
-rb_big_sign(VALUE x)
-{
- return BIGNUM_SIGN(x);
-}
+/*
+ * call-seq:
+ * big.size -> integer
+ *
+ * Returns the number of bytes in the machine representation of
+ * <i>big</i>.
+ *
+ * (256**10 - 1).size #=> 12
+ * (256**20 - 1).size #=> 20
+ * (256**40 - 1).size #=> 40
+ */
-size_t
+static VALUE
rb_big_size(VALUE big)
{
- return BIGSIZE(big);
+ return SIZET2NUM(BIGSIZE(big));
}
-VALUE
-rb_big_size_m(VALUE big)
-{
- return SIZET2NUM(rb_big_size(big));
-}
+/*
+ * call-seq:
+ * int.bit_length -> integer
+ *
+ * Returns the number of bits of the value of <i>int</i>.
+ *
+ * "the number of bits" means that
+ * the bit position of the highest bit which is different to the sign bit.
+ * (The bit position of the bit 2**n is n+1.)
+ * If there is no such bit (zero or minus one), zero is returned.
+ *
+ * I.e. This method returns ceil(log2(int < 0 ? -int : int+1)).
+ *
+ * (-2**10000-1).bit_length #=> 10001
+ * (-2**10000).bit_length #=> 10000
+ * (-2**10000+1).bit_length #=> 10000
+ *
+ * (-2**1000-1).bit_length #=> 1001
+ * (-2**1000).bit_length #=> 1000
+ * (-2**1000+1).bit_length #=> 1000
+ *
+ * (2**1000-1).bit_length #=> 1000
+ * (2**1000).bit_length #=> 1001
+ * (2**1000+1).bit_length #=> 1001
+ *
+ * (2**10000-1).bit_length #=> 10000
+ * (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
+ */
-VALUE
+static VALUE
rb_big_bit_length(VALUE big)
{
int nlz_bits;
@@ -6765,7 +6941,14 @@ rb_big_bit_length(VALUE big)
INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
}
-VALUE
+/*
+ * call-seq:
+ * big.odd? -> true or false
+ *
+ * Returns <code>true</code> if <i>big</i> is an odd number.
+ */
+
+static VALUE
rb_big_odd_p(VALUE num)
{
if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
@@ -6774,314 +6957,20 @@ rb_big_odd_p(VALUE num)
return Qfalse;
}
-VALUE
-rb_big_even_p(VALUE num)
-{
- if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
- return Qfalse;
- }
- return Qtrue;
-}
-
-unsigned long rb_ulong_isqrt(unsigned long);
-#if SIZEOF_BDIGIT*2 > SIZEOF_LONG
-BDIGIT rb_bdigit_dbl_isqrt(BDIGIT_DBL);
-# ifdef ULL_TO_DOUBLE
-# define BDIGIT_DBL_TO_DOUBLE(n) ULL_TO_DOUBLE(n)
-# endif
-#else
-# define rb_bdigit_dbl_isqrt(x) (BDIGIT)rb_ulong_isqrt(x)
-#endif
-#ifndef BDIGIT_DBL_TO_DOUBLE
-# define BDIGIT_DBL_TO_DOUBLE(n) (double)(n)
-#endif
-
-static BDIGIT *
-estimate_initial_sqrt(VALUE *xp, const size_t xn, const BDIGIT *nds, size_t len)
-{
- enum {dbl_per_bdig = roomof(DBL_MANT_DIG,BITSPERDIG)};
- const int zbits = nlz(nds[len-1]);
- VALUE x = *xp = bignew_1(0, xn, 1); /* division may release the GVL */
- BDIGIT *xds = BDIGITS(x);
- BDIGIT_DBL d = bary2bdigitdbl(nds+len-dbl_per_bdig, dbl_per_bdig);
- BDIGIT lowbits = 1;
- int rshift = (int)((BITSPERDIG*2-zbits+(len&BITSPERDIG&1) - DBL_MANT_DIG + 1) & ~1);
- double f;
-
- if (rshift > 0) {
- lowbits = (BDIGIT)d & ~(~(BDIGIT)1U << rshift);
- d >>= rshift;
- }
- else if (rshift < 0) {
- d <<= -rshift;
- d |= nds[len-dbl_per_bdig-1] >> (BITSPERDIG+rshift);
- }
- f = sqrt(BDIGIT_DBL_TO_DOUBLE(d));
- d = (BDIGIT_DBL)ceil(f);
- if (BDIGIT_DBL_TO_DOUBLE(d) == f) {
- if (lowbits || (lowbits = !bary_zero_p(nds, len-dbl_per_bdig)))
- ++d;
- }
- else {
- lowbits = 1;
- }
- rshift /= 2;
- rshift += (2-(len&1))*BITSPERDIG/2;
- if (rshift >= 0) {
- d <<= rshift;
- }
- BDIGITS_ZERO(xds, xn-2);
- bdigitdbl2bary(&xds[xn-2], 2, d);
-
- if (!lowbits) return NULL; /* special case, exact result */
- return xds;
-}
-
-VALUE
-rb_big_isqrt(VALUE n)
-{
- BDIGIT *nds = BDIGITS(n);
- size_t len = BIGNUM_LEN(n);
- size_t xn = (len+1) / 2;
- VALUE x;
- BDIGIT *xds;
-
- if (len <= 2) {
- BDIGIT sq = rb_bdigit_dbl_isqrt(bary2bdigitdbl(nds, len));
-#if SIZEOF_BDIGIT > SIZEOF_LONG
- return ULL2NUM(sq);
-#else
- return ULONG2NUM(sq);
-#endif
- }
- else if ((xds = estimate_initial_sqrt(&x, xn, nds, len)) != 0) {
- size_t tn = xn + BIGDIVREM_EXTRA_WORDS;
- VALUE t = bignew_1(0, tn, 1);
- BDIGIT *tds = BDIGITS(t);
- tn = BIGNUM_LEN(t);
-
- /* t = n/x */
- while (bary_divmod_branch(tds, tn, NULL, 0, nds, len, xds, xn),
- bary_cmp(tds, tn, xds, xn) < 0) {
- int carry;
- BARY_TRUNC(tds, tn);
- /* x = (x+t)/2 */
- carry = bary_add(xds, xn, xds, xn, tds, tn);
- bary_small_rshift(xds, xds, xn, 1, carry);
- tn = BIGNUM_LEN(t);
- }
- rb_big_realloc(t, 0);
- rb_gc_force_recycle(t);
- }
- RBASIC_SET_CLASS_RAW(x, rb_cInteger);
- return x;
-}
-
-#ifdef USE_GMP
-static void
-bary_powm_gmp(BDIGIT *zds, size_t zn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn, const BDIGIT *mds, size_t mn)
-{
- const size_t nails = (sizeof(BDIGIT)-SIZEOF_BDIGIT)*CHAR_BIT;
- mpz_t z, x, y, m;
- size_t count;
- mpz_init(x);
- mpz_init(y);
- mpz_init(m);
- mpz_init(z);
- mpz_import(x, xn, -1, sizeof(BDIGIT), 0, nails, xds);
- mpz_import(y, yn, -1, sizeof(BDIGIT), 0, nails, yds);
- mpz_import(m, mn, -1, sizeof(BDIGIT), 0, nails, mds);
- mpz_powm(z, x, y, m);
- mpz_export(zds, &count, -1, sizeof(BDIGIT), 0, nails, z);
- BDIGITS_ZERO(zds+count, zn-count);
- mpz_clear(x);
- mpz_clear(y);
- mpz_clear(m);
- mpz_clear(z);
-}
-#endif
-
-static VALUE
-int_pow_tmp3(VALUE x, VALUE y, VALUE m, int nega_flg)
-{
-#ifdef USE_GMP
- VALUE z;
- size_t xn, yn, mn, zn;
-
- if (FIXNUM_P(x)) {
- x = rb_int2big(FIX2LONG(x));
- }
- if (FIXNUM_P(y)) {
- y = rb_int2big(FIX2LONG(y));
- }
- assert(RB_BIGNUM_TYPE_P(m));
- xn = BIGNUM_LEN(x);
- yn = BIGNUM_LEN(y);
- mn = BIGNUM_LEN(m);
- zn = mn;
- z = bignew(zn, 1);
- bary_powm_gmp(BDIGITS(z), zn, BDIGITS(x), xn, BDIGITS(y), yn, BDIGITS(m), mn);
- if (nega_flg & BIGNUM_POSITIVE_P(z)) {
- z = rb_funcall(z, '-', 1, m);
- }
- RB_GC_GUARD(x);
- RB_GC_GUARD(y);
- RB_GC_GUARD(m);
- return rb_big_norm(z);
-#else
- VALUE tmp = LONG2FIX(1L);
- long yy;
-
- for (/*NOP*/; ! FIXNUM_P(y); y = rb_funcall(y, rb_intern(">>"), 1, LONG2FIX(1L))) {
- if (RTEST(rb_funcall(y, rb_intern("odd?"), 0))) {
- tmp = rb_funcall(tmp, '*', 1, x);
- tmp = rb_int_modulo(tmp, m);
- }
- x = rb_funcall(x, '*', 1, x);
- x = rb_int_modulo(x, m);
- }
- for (yy = FIX2LONG(y); yy; yy >>= 1L) {
- if (yy & 1L) {
- tmp = rb_funcall(tmp, '*', 1, x);
- tmp = rb_int_modulo(tmp, m);
- }
- x = rb_funcall(x, '*', 1, x);
- x = rb_int_modulo(x, m);
- }
-
- if (nega_flg && RTEST(rb_funcall(tmp, rb_intern("positive?"), 0))) {
- tmp = rb_funcall(tmp, '-', 1, m);
- }
- return tmp;
-#endif
-}
-
/*
- * Integer#pow
+ * call-seq:
+ * big.even? -> true or false
+ *
+ * Returns <code>true</code> if <i>big</i> is an even number.
*/
static VALUE
-int_pow_tmp1(VALUE x, VALUE y, long mm, int nega_flg)
-{
- long xx = FIX2LONG(x);
- long tmp = 1L;
- long yy;
-
- for (/*NOP*/; ! FIXNUM_P(y); y = rb_funcall(y, idGTGT, 1, LONG2FIX(1L))) {
- if (RTEST(rb_int_odd_p(y))) {
- tmp = (tmp * xx) % mm;
- }
- xx = (xx * xx) % mm;
- }
- for (yy = FIX2LONG(y); yy; yy >>= 1L) {
- if (yy & 1L) {
- tmp = (tmp * xx) % mm;
- }
- xx = (xx * xx) % mm;
- }
-
- if (nega_flg && tmp) {
- tmp -= mm;
- }
- return LONG2FIX(tmp);
-}
-
-static VALUE
-int_pow_tmp2(VALUE x, VALUE y, long mm, int nega_flg)
-{
- long tmp = 1L;
- long yy;
-#ifdef DLONG
- const DLONG m = mm;
- long tmp2 = tmp;
- long xx = FIX2LONG(x);
-# define MUL_MODULO(a, b, c) (long)(((DLONG)(a) * (DLONG)(b)) % (c))
-#else
- const VALUE m = LONG2FIX(mm);
- VALUE tmp2 = LONG2FIX(tmp);
- VALUE xx = x;
-# define MUL_MODULO(a, b, c) rb_int_modulo(rb_fix_mul_fix((a), (b)), (c))
-#endif
-
- for (/*NOP*/; ! FIXNUM_P(y); y = rb_funcall(y, idGTGT, 1, LONG2FIX(1L))) {
- if (RTEST(rb_int_odd_p(y))) {
- tmp2 = MUL_MODULO(tmp2, xx, m);
- }
- xx = MUL_MODULO(xx, xx, m);
- }
- for (yy = FIX2LONG(y); yy; yy >>= 1L) {
- if (yy & 1L) {
- tmp2 = MUL_MODULO(tmp2, xx, m);
- }
- xx = MUL_MODULO(xx, xx, m);
- }
-
-#ifdef DLONG
- tmp = tmp2;
-#else
- tmp = FIX2LONG(tmp2);
-#endif
- if (nega_flg && tmp) {
- tmp -= mm;
- }
- return LONG2FIX(tmp);
-}
-
-/*
- * Document-method: Integer#pow
- * call-seq:
- * integer.pow(numeric) -> numeric
- * integer.pow(integer, integer) -> integer
- *
- * Returns (modular) exponentiation as:
- *
- * a.pow(b) #=> same as a**b
- * a.pow(b, m) #=> same as (a**b) % m, but avoids huge temporary values
- */
-VALUE
-rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
+rb_big_even_p(VALUE num)
{
- rb_check_arity(argc, 1, 2);
-
- if (argc == 1) {
- return rb_funcall(num, rb_intern("**"), 1, argv[0]);
- }
- else {
- VALUE const a = num;
- VALUE const b = argv[0];
- VALUE m = argv[1];
- int nega_flg = 0;
- if ( ! RB_INTEGER_TYPE_P(b)) {
- rb_raise(rb_eTypeError, "Integer#pow() 2nd argument not allowed unless a 1st argument is integer");
- }
- if (rb_num_negative_int_p(b)) {
- rb_raise(rb_eRangeError, "Integer#pow() 1st argument cannot be negative when 2nd argument specified");
- }
- if (!RB_INTEGER_TYPE_P(m)) {
- rb_raise(rb_eTypeError, "Integer#pow() 2nd argument not allowed unless all arguments are integers");
- }
-
- if (rb_num_negative_int_p(m)) {
- m = rb_funcall(m, idUMinus, 0);
- nega_flg = 1;
- }
-
- if (!rb_num_positive_int_p(m)) {
- rb_num_zerodiv();
- }
- if (FIXNUM_P(m)) {
- long const half_val = (long)HALF_LONG_MSB;
- long const mm = FIX2LONG(m);
- if (mm <= half_val) {
- return int_pow_tmp1(rb_int_modulo(a, m), b, mm, nega_flg);
- } else {
- return int_pow_tmp2(rb_int_modulo(a, m), b, mm, nega_flg);
- }
- } else if (RB_TYPE_P(m, T_BIGNUM)) {
- return int_pow_tmp3(rb_int_modulo(a, m), b, m, nega_flg);
- }
+ if (BIGNUM_LEN(num) != 0 && BDIGITS(num)[0] & 1) {
+ return Qfalse;
}
- UNREACHABLE;
+ return Qtrue;
}
/*
@@ -7105,17 +6994,51 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
void
Init_Bignum(void)
{
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_cBignum = rb_cInteger;
-#endif
- rb_define_const(rb_cObject, "Bignum", rb_cInteger);
- rb_deprecate_constant(rb_cObject, "Bignum");
-
- rb_define_method(rb_cInteger, "coerce", rb_int_coerce, 1);
+ rb_cBignum = rb_define_class("Bignum", rb_cInteger);
+
+ rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1);
+ rb_define_alias(rb_cBignum, "inspect", "to_s");
+ rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1);
+ rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0);
+ rb_define_method(rb_cBignum, "+", rb_big_plus, 1);
+ rb_define_method(rb_cBignum, "-", rb_big_minus, 1);
+ rb_define_method(rb_cBignum, "*", rb_big_mul, 1);
+ rb_define_method(rb_cBignum, "/", rb_big_div, 1);
+ rb_define_method(rb_cBignum, "%", rb_big_modulo, 1);
+ rb_define_method(rb_cBignum, "div", rb_big_idiv, 1);
+ rb_define_method(rb_cBignum, "divmod", rb_big_divmod, 1);
+ rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1);
+ rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1);
+ rb_define_method(rb_cBignum, "fdiv", rb_big_fdiv, 1);
+ rb_define_method(rb_cBignum, "**", rb_big_pow, 1);
+ rb_define_method(rb_cBignum, "&", rb_big_and, 1);
+ rb_define_method(rb_cBignum, "|", rb_big_or, 1);
+ rb_define_method(rb_cBignum, "^", rb_big_xor, 1);
+ rb_define_method(rb_cBignum, "~", rb_big_neg, 0);
+ rb_define_method(rb_cBignum, "<<", rb_big_lshift, 1);
+ rb_define_method(rb_cBignum, ">>", rb_big_rshift, 1);
+ rb_define_method(rb_cBignum, "[]", rb_big_aref, 1);
+
+ rb_define_method(rb_cBignum, "<=>", rb_big_cmp, 1);
+ rb_define_method(rb_cBignum, "==", rb_big_eq, 1);
+ rb_define_method(rb_cBignum, ">", big_gt, 1);
+ rb_define_method(rb_cBignum, ">=", big_ge, 1);
+ rb_define_method(rb_cBignum, "<", big_lt, 1);
+ rb_define_method(rb_cBignum, "<=", big_le, 1);
+ rb_define_method(rb_cBignum, "===", rb_big_eq, 1);
+ rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1);
+ rb_define_method(rb_cBignum, "hash", rb_big_hash, 0);
+ rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0);
+ rb_define_method(rb_cBignum, "abs", rb_big_abs, 0);
+ rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0);
+ rb_define_method(rb_cBignum, "size", rb_big_size, 0);
+ rb_define_method(rb_cBignum, "bit_length", rb_big_bit_length, 0);
+ rb_define_method(rb_cBignum, "odd?", rb_big_odd_p, 0);
+ rb_define_method(rb_cBignum, "even?", rb_big_even_p, 0);
#ifdef USE_GMP
/* The version of loaded GMP. */
- rb_define_const(rb_cInteger, "GMP_VERSION", rb_sprintf("GMP %s", gmp_version));
+ rb_define_const(rb_cBignum, "GMP_VERSION", rb_sprintf("GMP %s", gmp_version));
#endif
power_cache_init();
diff --git a/bin/erb b/bin/erb
index 86f7042fae..6a7ea7d593 100755
--- a/bin/erb
+++ b/bin/erb
@@ -11,8 +11,7 @@ class ERB
return nil if self.empty?
arg = self.shift
return nil if arg == '--'
- case arg
- when /\A-(.)(.*)/
+ if arg =~ /^-(.)(.*)/
if $1 == '-'
arg, @maybe_arg = arg.split(/=/, 2)
return arg
@@ -25,8 +24,6 @@ class ERB
@maybe_arg = nil
end
"-#{$1}"
- when /\A(\w+)=/
- arg
else
self.unshift arg
nil
@@ -57,7 +54,6 @@ class ERB
def run(factory=ERB)
trim_mode = 0
disable_percent = false
- variables = {}
begin
while switch = ARGV.switch
case switch
@@ -76,7 +72,7 @@ class ERB
require ARGV.req_arg
when '-S' # security level
arg = ARGV.req_arg
- raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-1]\z/
+ raise "invalid safe_level #{arg.dump}" unless arg =~ /^[0-3]$/
safe_level = arg.to_i
when '-T' # trim mode
arg = ARGV.req_arg
@@ -84,7 +80,7 @@ class ERB
trim_mode = arg
next
end
- raise "invalid trim mode #{arg.dump}" unless arg =~ /\A[0-2]\z/
+ raise "invalid trim mode #{arg.dump}" unless arg =~ /^[0-2]$/
trim_mode = arg.to_i
when '-E', '--encoding'
arg = ARGV.req_arg
@@ -95,34 +91,30 @@ class ERB
disable_percent = true
when '--help'
raise "print this help"
- when /\A-/
- raise "unknown switch #{switch.dump}"
else
- var, val = *switch.split('=', 2)
- (variables ||= {})[var] = val
+ raise "unknown switch #{switch.dump}"
end
end
rescue # usage
STDERR.puts $!.to_s
STDERR.puts File.basename($0) +
- " [switches] [var=value...] [inputfile]"
+ " [switches] [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..1)
+ -S safe_level set $SAFE (0..3)
-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
- $<.set_encoding(Encoding::UTF_8, nil)
+ $<.set_encoding(Encoding::ASCII_8BIT, nil)
src = $<.read
filename = $FILENAME
exit 2 unless src
@@ -138,23 +130,15 @@ EOU
puts erb.src
end
else
- 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)
+ erb.run(TOPLEVEL_BINDING.taint)
end
end
module_function :run
def set_encoding(extern, intern = nil)
verbose, $VERBOSE = $VERBOSE, nil
- Encoding.default_external = extern unless extern.nil? || extern == ""
- Encoding.default_internal = intern unless intern.nil? || intern == ""
+ Encoding.default_external = extern unless extern.nil? || extern.empty?
+ Encoding.default_internal = intern unless intern.nil? || intern.empty?
[$stdin, $stdout, $stderr].each do |io|
io.set_encoding(extern, intern)
end
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 0000000000..4e0bbb7b7a
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,33 @@
+#!/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/bootstraptest/runner.rb b/bootstraptest/runner.rb
index e807ce5b62..d58b824386 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -60,7 +60,6 @@ end
def main
@ruby = File.expand_path('miniruby')
@verbose = false
- $VERBOSE = false
$stress = false
@color = nil
@tty = nil
@@ -137,15 +136,9 @@ End
@tty &&= !@verbose
if @color
# dircolors-like style
- 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"
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
@reset = "\e[m"
else
@passed = @failed = @reset = ""
@@ -254,7 +247,6 @@ def show_progress(message = '')
end
end
rescue Interrupt
- $stderr.puts "\##{@count} #{@location}"
raise Interrupt
rescue Exception => err
$stderr.print 'E'
@@ -262,17 +254,23 @@ rescue Exception => err
error err.message, message
end
-def assert_check(testsrc, message = '', opt = '', **argh)
+# NativeClient is special. The binary is cross-compiled. But runs on the build environment.
+# So RUBY_PLATFORM in this process is not useful to detect it.
+def nacl?
+ @ruby and File.basename(@ruby.split(/\s/).first)['sel_ldr']
+end
+
+def assert_check(testsrc, message = '', opt = '')
show_progress(message) {
- result = get_result_string(testsrc, opt, **argh)
+ result = get_result_string(testsrc, opt)
check_coredump
yield(result)
}
end
-def assert_equal(expected, testsrc, message = '', opt = '', **argh)
+def assert_equal(expected, testsrc, message = '')
newtest
- assert_check(testsrc, message, opt, **argh) {|result|
+ assert_check(testsrc, message) {|result|
if expected == result
nil
else
@@ -313,10 +311,13 @@ def assert_valid_syntax(testsrc, message = '')
}
end
-def assert_normal_exit(testsrc, *rest, timeout: nil, **opt)
+def assert_normal_exit(testsrc, *rest)
newtest
+ opt = {}
+ opt = rest.pop if Hash === rest.last
message, ignore_signals = rest
message ||= ''
+ timeout = opt[:timeout]
show_progress(message) {
faildesc = nil
filename = make_srcfile(testsrc)
@@ -397,7 +398,7 @@ def flunk(message = '')
end
def pretty(src, desc, result)
- src = src.sub(/\A\s*\n/, '')
+ src = src.sub(/\A.*\n/, '')
(/\n/ =~ src ? "\n#{adjust_indent(src)}" : src) + " #=> #{desc}"
end
@@ -411,19 +412,18 @@ def untabify(str)
str.gsub(/^\t+/) {' ' * (8 * $&.size) }
end
-def make_srcfile(src, frozen_string_literal: nil)
+def make_srcfile(src)
filename = 'bootstraptest.tmp.rb'
File.open(filename, 'w') {|f|
- f.puts "#frozen_string_literal:true" if frozen_string_literal
f.puts "GC.stress = true" if $stress
f.puts "print(begin; #{src}; end)"
}
filename
end
-def get_result_string(src, opt = '', **argh)
+def get_result_string(src, opt = '')
if @ruby
- filename = make_srcfile(src, **argh)
+ filename = make_srcfile(src)
begin
`#{@ruby} -W0 #{opt} #{filename}`
ensure
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index cdc5960a59..6a2ccfc6da 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -597,17 +597,3 @@ 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_env.rb b/bootstraptest/test_env.rb
deleted file mode 100644
index 7d1b45b75e..0000000000
--- a/bootstraptest/test_env.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-assert_equal "true", %q{
- ENV["ENVTEST"] = "\u{e9 3042 d76c}"
- env = ENV["ENVTEST"]
- env.valid_encoding?
-}
-
-# different encoding is used for PATH
-assert_equal "true", %q{
- ENV["PATH"] = "\u{e9 3042 d76c}"
- env = ENV["PATH"]
- env.valid_encoding?
-}
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 8e90ac2728..bf7478006d 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -109,7 +109,7 @@ assert_equal %q{foo}, %q{
}
}
assert_equal %q{1}, %q{
- class Integer
+ class Fixnum
Const = 1
end
1.instance_eval %{
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb
index 9da6d45cbd..0390062a24 100644
--- a/bootstraptest/test_flow.rb
+++ b/bootstraptest/test_flow.rb
@@ -589,13 +589,3 @@ assert_equal "foo", %q{
end
Bug6460.new.m1
}, '[ruby-dev:46372]'
-
-assert_equal "foo", %q{
- obj = "foo"
- if obj || any1
- any2 = any2
- else
- raise obj.inspect
- end
- obj
-}, '[ruby-core:87830]'
diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb
index 1cd9f7ac6c..5de6ee1b12 100644
--- a/bootstraptest/test_fork.rb
+++ b/bootstraptest/test_fork.rb
@@ -24,7 +24,7 @@ assert_finish 10, %q{
assert_normal_exit(<<'End', '[ruby-dev:37934]')
main = Thread.current
Thread.new { sleep 0.01 until main.stop?; Thread.kill main }
- Process.setrlimit(:NPROC, 1) if defined?(Process::RLIMIT_NPROC)
+ Process.setrlimit(:NPROC, 1)
fork {}
End
diff --git a/bootstraptest/test_insns.rb b/bootstraptest/test_insns.rb
deleted file mode 100644
index 4dd888897a..0000000000
--- a/bootstraptest/test_insns.rb
+++ /dev/null
@@ -1,389 +0,0 @@
-# C0 coverage of each instructions
-
-# :NOTE: This is for development purpose; never consider this file as
-# ISeq compilation specification.
-
-begin
- # This library brings some additional coverage.
- # Not mandatory.
- require 'rbconfig/sizeof'
-rescue LoadError
- # OK, just skip
-else
- $FIXNUM_MAX = RbConfig::LIMITS["FIXNUM_MAX"]
- $FIXNUM_MIN = RbConfig::LIMITS["FIXNUM_MIN"]
-end
-
-fsl = { frozen_string_literal: true } # used later
-tests = [
- # insn , expression to generate such insn
- [ 'nop', %q{ raise rescue true }, ],
- [ 'trace', %q{ true }, ],
-
- [ 'setlocal *, 0', %q{ x = true }, ],
- [ 'setlocal *, 1', %q{ x = nil; -> { x = true }.call }, ],
- [ 'setlocal', %q{ x = nil; -> { -> { x = true }.() }.() }, ],
- [ 'getlocal *, 0', %q{ x = true; x }, ],
- [ 'getlocal *, 1', %q{ x = true; -> { x }.call }, ],
- [ 'getlocal', %q{ x = true; -> { -> { x }.() }.() }, ],
-
- [ 'setspecial', %q{ true if true..true }, ],
- [ 'getspecial', %q{ $&.nil? }, ],
- [ 'getspecial', %q{ $`.nil? }, ],
- [ 'getspecial', %q{ $'.nil? }, ],
- [ 'getspecial', %q{ $+.nil? }, ],
- [ 'getspecial', %q{ $1.nil? }, ],
- [ 'getspecial', %q{ $128.nil? }, ],
-
- [ 'getglobal', %q{ String === $0 }, ],
- [ 'getglobal', %q{ $_.nil? }, ],
- [ 'setglobal', %q{ $0 = "true" }, ],
-
- [ 'setinstancevariable', %q{ @x = true }, ],
- [ 'getinstancevariable', %q{ @x = true; @x }, ],
-
- [ 'setclassvariable', %q{ @@x = true }, ],
- [ 'getclassvariable', %q{ @@x = true; @@x }, ],
-
- [ 'setconstant', %q{ X = true }, ],
- [ 'setconstant', %q{ Object::X = true }, ],
- [ 'getconstant', %q{ X = true; X }, ],
- [ 'getconstant', %q{ X = true; Object::X }, ],
-
- [ 'getinlinecache / setinlinecache', %q{ def x; X; end; X = true; x; x; x }, ],
-
- [ 'putnil', %q{ $~ == nil }, ],
- [ 'putself', %q{ $~ != self }, ],
- [ 'putobject INT2FIX(0)', %q{ $~ != 0 }, ],
- [ 'putobject INT2FIX(1)', %q{ $~ != 1 }, ],
- [ 'putobject', %q{ $~ != -1 }, ],
- [ 'putobject', %q{ $~ != /x/ }, ],
- [ 'putobject', %q{ $~ != :x }, ],
- [ 'putobject', %q{ $~ != (1..2) }, ],
- [ 'putobject', %q{ $~ != true }, ],
- [ 'putobject', %q{ /(?<x>x)/ =~ "x"; x == "x" }, ],
-
- [ 'putspecialobject', %q{ {//=>true}[//] }, ],
- [ 'putiseq', %q{ -> { true }.() }, ],
- [ 'putstring', %q{ "true" }, ],
- [ 'tostring / concatstrings', %q{ "#{true}" }, ],
- [ 'freezestring', %q{ "#{true}"}, fsl, ],
- [ 'freezestring', %q{ "#{true}"}, '-d', fsl, ],
- [ 'toregexp', %q{ /#{true}/ =~ "true" && $~ }, ],
-
- [ 'newarray', %q{ ["true"][0] }, ],
- [ 'duparray', %q{ [ true ][0] }, ],
- [ 'expandarray', %q{ y = [ true, false, nil ]; x, = y; x }, ],
- [ 'expandarray', %q{ y = [ true, false, nil ]; x, *z = y; x }, ],
- [ 'expandarray', %q{ y = [ true, false, nil ]; x, *z, w = y; x }, ],
- [ 'splatarray', %q{ x, = *(y = true), false; x }, ],
- [ 'concatarray', %q{ ["t", "r", *x = "u", "e"].join }, ],
- [ 'concatarray', <<~'},', ], # {
- class X; def to_a; ['u']; end; end
- ['t', 'r', *X.new, 'e'].join
- },
- [ 'concatarray', <<~'},', ], # {
- r = false
- t = [true, nil]
- q, w, e = r, *t # here
- w
- },
-
- [ 'newhash', %q{ x = {}; x[x] = true }, ],
- [ 'newhash', %q{ x = true; { x => x }[x] }, ],
- [ 'newrange', %q{ x = 1; [*(0..x)][0] == 0 }, ],
- [ 'newrange', %q{ x = 1; [*(0...x)][0] == 0 }, ],
-
- [ 'pop', %q{ def x; true; end; x }, ],
- [ 'dup', %q{ x = y = true; x }, ],
- [ 'dupn', %q{ Object::X ||= true }, ],
- [ 'dupn', %q{ Object::X ||= true }, ],
- [ 'reverse', %q{ q, (w, e), r = 1, [2, 3], 4; e == 3 }, ],
- [ 'swap', <<~'},', ], # {
- x = [[false, true]]
- for i, j in x # here
- ;
- end
- j
- },
-
- [ 'topn', %q{ x, y = [], 0; x[*y], = [true, false]; x[0] }, ],
- [ 'setn', %q{ x, y = [], 0; x[*y] = true ; x[0] }, ],
- [ 'adjuststack', %q{ x = [true]; x[0] ||= nil; x[0] }, ],
-
- [ 'defined', %q{ !defined?(x) }, ],
- [ 'checkkeyword', %q{ def x x:rand;x end; x x: true }, ],
- [ 'checkmatch', <<~'},', ], # {
- x = y = true
- case x
- when false
- y = false
- when true # here
- y = nil
- end
- y == nil
- },
- [ 'checkmatch', <<~'},', ], # {
- x, y = true, [false]
- case x
- when *y # here
- z = false
- else
- z = true
- end
- z
- },
- [ 'checkmatch', <<~'},', ], # {
- x = false
- begin
- raise
- rescue # here
- x = true
- end
- x
- },
-
- [ 'defineclass', %q{ module X; true end }, ],
- [ 'defineclass', %q{ X = Module.new; module X; true end }, ],
- [ 'defineclass', %q{ class X; true end }, ],
- [ 'defineclass', %q{ X = Class.new; class X; true end }, ],
- [ 'defineclass', %q{ X = Class.new; class Y < X; true end }, ],
- [ 'defineclass', %q{ X = Class.new; class << X; true end }, ],
- [ 'defineclass', <<~'},', ], # {
- X = Class.new
- Y = Class.new(X)
- class Y < X
- true
- end
- },
-
- [ 'opt_send_without_block', %q{ true.to_s }, ],
- [ 'send', %q{ true.tap {|i| i.to_s } }, ],
- [ 'leave', %q{ def x; true; end; x }, ],
- [ 'invokesuper', <<~'},', ], # {
- class X < String
- def empty?
- super # here
- end
- end
- X.new.empty?
- },
- [ 'invokeblock', <<~'},', ], # {
- def x
- return yield self # here
- end
- x do
- true
- end
- },
-
- [ 'opt_str_freeze', %q{ 'true'.freeze }, ],
- [ 'opt_str_uminus', %q{ -'true' }, ],
- [ 'opt_str_freeze', <<~'},', ], # {
- class String
- def freeze
- true
- end
- end
- 'true'.freeze
- },
-
- [ 'opt_newarray_max', %q{ [ ].max.nil? }, ],
- [ 'opt_newarray_max', %q{ [1, x = 2, 3].max == 3 }, ],
- [ 'opt_newarray_max', <<~'},', ], # {
- class Array
- def max
- true
- end
- end
- [1, x = 2, 3].max
- },
- [ 'opt_newarray_min', %q{ [ ].min.nil? }, ],
- [ 'opt_newarray_min', %q{ [3, x = 2, 1].min == 1 }, ],
- [ 'opt_newarray_min', <<~'},', ], # {
- class Array
- def min
- true
- end
- end
- [3, x = 2, 1].min
- },
-
- [ 'throw', %q{ false.tap { break true } }, ],
- [ 'branchif', %q{ x = nil; x ||= true }, ],
- [ 'branchif', %q{ x = true; x ||= nil; x }, ],
- [ 'branchunless', %q{ x = 1; x &&= true }, ],
- [ 'branchunless', %q{ x = nil; x &&= true; x.nil? }, ],
- [ 'branchnil', %q{ x = true; x&.to_s }, ],
- [ 'branchnil', %q{ x = nil; (x&.to_s).nil? }, ],
- [ 'jump', <<~'},', ], # {
- y = 1
- x = if y == 0 then nil elsif y == 1 then true else nil end
- x
- },
- [ 'jump', <<~'},', ], # {
- # ultra complicated situation: this ||= assignment only generates
- # 15 instructions, not including the class definition.
- class X; attr_accessor :x; end
- x = X.new
- x&.x ||= true # here
- },
-
- [ 'once', %q{ /#{true}/o =~ "true" && $~ }, ],
- [ 'once', <<~'},', ], # {
- def once expr
- return /#{expr}/o # here
- end
- x = once(true); x = once(false); x = once(nil);
- x =~ "true" && $~
- },
- [ 'once', <<~'},', ], # {
- # recursive once
- def once n
- return %r/#{
- if n == 0
- true
- else
- once(n-1) # here
- end
- }/ox
- end
- x = once(128); x = once(7); x = once(16);
- x =~ "true" && $~
- },
- [ 'once', <<~'},', ], # {
- # inter-thread lockup situation
- def once n
- return Thread.start n do |m|
- Thread.pass
- next %r/#{
- sleep m # here
- true
- }/ox
- end
- end
- x = once(1); y = once(0.1); z = y.value
- z =~ "true" && $~
- },
-
- [ 'opt_case_dispatch', %q{ case 0 when 1.1 then false else true end }, ],
- [ 'opt_case_dispatch', %q{ case 1.0 when 1.1 then false else true end }, ],
-
- [ 'opt_plus', %q{ 1 + 1 == 2 }, ],
- if defined? $FIXNUM_MAX then
- [ 'opt_plus', %Q{ #{ $FIXNUM_MAX } + 1 == #{ $FIXNUM_MAX + 1 } }, ]
- end,
- [ 'opt_plus', %q{ 1.0 + 1.0 == 2.0 }, ],
- [ 'opt_plus', %q{ x = +0.0.next_float; x + x >= x }, ],
- [ 'opt_plus', %q{ 't' + 'rue' }, ],
- [ 'opt_plus', %q{ ( ['t'] + ['r', ['u', ['e'], ], ] ).join }, ],
- [ 'opt_plus', %q{ Time.at(1) + 1 == Time.at(2) }, ],
- [ 'opt_minus', %q{ 1 - 1 == 0 }, ],
- if defined? $FIXNUM_MIN then
- [ 'opt_minus', %Q{ #{ $FIXNUM_MIN } - 1 == #{ $FIXNUM_MIN - 1 } }, ]
- end,
- [ 'opt_minus', %q{ 1.0 - 1.0 == 0.0 }, ],
- [ 'opt_minus', %q{ x = -0.0.prev_float; x - x == 0.0 }, ],
- [ 'opt_minus', %q{ ( [false, true] - [false] )[0] }, ],
- [ 'opt_mult', %q{ 1 * 1 == 1 }, ],
- [ 'opt_mult', %q{ 1.0 * 1.0 == 1.0 }, ],
- [ 'opt_mult', %q{ x = +0.0.next_float; x * x <= x }, ],
- [ 'opt_mult', %q{ ( "ruet" * 3 )[7,4] }, ],
- [ 'opt_div', %q{ 1 / 1 == 1 }, ],
- [ 'opt_div', %q{ 1.0 / 1.0 == 1.0 }, ],
- [ 'opt_div', %q{ x = +0.0.next_float; x / x >= x }, ],
- [ 'opt_div', %q{ x = 1/2r; x / x == 1 }, ],
- [ 'opt_mod', %q{ 1 % 1 == 0 }, ],
- [ 'opt_mod', %q{ 1.0 % 1.0 == 0.0 }, ],
- [ 'opt_mod', %q{ x = +0.0.next_float; x % x == 0.0 }, ],
- [ 'opt_mod', %q{ '%s' % [ true ] }, ],
-
- [ 'opt_eq', %q{ 1 == 1 }, ],
- [ 'opt_eq', <<~'},', ], # {
- class X; def == other; true; end; end
- X.new == true
- },
- [ 'opt_neq', %q{ 1 != 0 }, ],
- [ 'opt_neq', <<~'},', ], # {
- class X; def != other; true; end; end
- X.new != true
- },
-
- [ 'opt_lt', %q{ -1 < 0 }, ],
- [ 'opt_lt', %q{ -1.0 < 0.0 }, ],
- [ 'opt_lt', %q{ -0.0.prev_float < 0.0 }, ],
- [ 'opt_lt', %q{ ?a < ?z }, ],
- [ 'opt_le', %q{ -1 <= 0 }, ],
- [ 'opt_le', %q{ -1.0 <= 0.0 }, ],
- [ 'opt_le', %q{ -0.0.prev_float <= 0.0 }, ],
- [ 'opt_le', %q{ ?a <= ?z }, ],
- [ 'opt_gt', %q{ 1 > 0 }, ],
- [ 'opt_gt', %q{ 1.0 > 0.0 }, ],
- [ 'opt_gt', %q{ +0.0.next_float > 0.0 }, ],
- [ 'opt_gt', %q{ ?z > ?a }, ],
- [ 'opt_ge', %q{ 1 >= 0 }, ],
- [ 'opt_ge', %q{ 1.0 >= 0.0 }, ],
- [ 'opt_ge', %q{ +0.0.next_float >= 0.0 }, ],
- [ 'opt_ge', %q{ ?z >= ?a }, ],
-
- [ 'opt_ltlt', %q{ '' << 'true' }, ],
- [ 'opt_ltlt', %q{ ([] << 'true').join }, ],
- [ 'opt_ltlt', %q{ (1 << 31) == 2147483648 }, ],
-
- [ 'opt_aref', %q{ ['true'][0] }, ],
- [ 'opt_aref', %q{ { 0 => 'true'}[0] }, ],
- [ 'opt_aref', %q{ 'true'[0] == ?t }, ],
- [ 'opt_aset', %q{ [][0] = true }, ],
- [ 'opt_aset', %q{ {}[0] = true }, ],
- [ 'opt_aset', %q{ x = 'frue'; x[0] = 't'; x }, ],
- [ 'opt_aset', <<~'},', ], # {
- # opt_aref / opt_aset mixup situation
- class X; def x; {}; end; end
- x = X.new
- x&.x[true] ||= true # here
- },
-
- [ 'opt_aref_with', %q{ { 'true' => true }['true'] }, ],
- [ 'opt_aref_with', %q{ Struct.new(:nil).new['nil'].nil? }, ],
- [ 'opt_aset_with', %q{ {}['true'] = true }, ],
- [ 'opt_aset_with', %q{ Struct.new(:true).new['true'] = true }, ],
-
- [ 'opt_length', %q{ 'true' .length == 4 }, ],
- [ 'opt_length', %q{ :true .length == 4 }, ],
- [ 'opt_length', %q{ [ 'true' ] .length == 1 }, ],
- [ 'opt_length', %q{ { 'true' => 1 }.length == 1 }, ],
- [ 'opt_size', %q{ 'true' .size == 4 }, ],
- [ 'opt_size', %q{ 1.size >= 4 }, ],
- [ 'opt_size', %q{ [ 'true' ] .size == 1 }, ],
- [ 'opt_size', %q{ { 'true' => 1 }.size == 1 }, ],
- [ 'opt_empty_p', %q{ ''.empty? }, ],
- [ 'opt_empty_p', %q{ [].empty? }, ],
- [ 'opt_empty_p', %q{ {}.empty? }, ],
- [ 'opt_empty_p', %q{ Queue.new.empty? }, ],
-
- [ 'opt_succ', %q{ 1.succ == 2 }, ],
- if defined? $FIXNUM_MAX then
- [ 'opt_succ',%Q{ #{ $FIXNUM_MAX }.succ == #{ $FIXNUM_MAX + 1 } }, ]
- end,
- [ 'opt_succ', %q{ '1'.succ == '2' }, ],
- [ 'opt_succ', %q{ x = Time.at(0); x.succ == Time.at(1) }, ],
-
- [ 'opt_not', %q{ ! false }, ],
- [ 'opt_neq', <<~'},', ], # {
- class X; def !; true; end; end
- ! X.new
- },
-
- [ 'opt_regexpmatch1', %q{ /true/ =~ 'true' && $~ }, ],
- [ 'opt_regexpmatch1', <<~'},', ], # {
- class Regexp; def =~ other; true; end; end
- /true/ =~ 'true'
- },
- [ 'opt_regexpmatch2', %q{ 'true' =~ /true/ && $~ }, ],
- [ 'opt_regexpmatch2', <<~'},', ], # {
- class String; def =~ other; true; end; end
- 'true' =~ /true/
- },
-]
-
-tests.compact.each {|(insn, expr, *a)| assert_equal 'true', expr, insn, *a }
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index 89c00d0b88..cee8cb399e 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -26,7 +26,7 @@ assert_finish 10, %q{
t1.join
t2.join
end
- rescue LoadError, Timeout::Error, NotImplementedError
+ rescue LoadError, TimeoutError, NotImplementedError
end
}, '[ruby-dev:32566]'
@@ -52,7 +52,7 @@ assert_equal 'ok', %q{
STDIN.reopen(rw)
STDIN.reopen(save)
rw.close
- File.unlink(tmpname)
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
:ok
}
@@ -69,7 +69,7 @@ assert_equal 'ok', %q{
STDIN.print "a"
STDIN.reopen(save)
rw.close
- File.unlink(tmpname)
+ File.unlink(tmpname) unless RUBY_PLATFORM['nacl']
:ok
}
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index 9b3c10d519..aa65bddae1 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -15,17 +15,17 @@ assert_equal 'sym', ':sym'
assert_equal ':sym', ':sym.inspect'
assert_equal 'Symbol', ':sym.class'
assert_equal '1234', '1234'
-assert_equal 'Integer', '1234.class'
+assert_equal 'Fixnum', '1234.class'
assert_equal '1234', '1_2_3_4'
-assert_equal 'Integer', '1_2_3_4.class'
+assert_equal 'Fixnum', '1_2_3_4.class'
assert_equal '18', '0x12'
-assert_equal 'Integer', '0x12.class'
+assert_equal 'Fixnum', '0x12.class'
assert_equal '15', '0o17'
-assert_equal 'Integer', '0o17.class'
+assert_equal 'Fixnum', '0o17.class'
assert_equal '5', '0b101'
-assert_equal 'Integer', '0b101.class'
+assert_equal 'Fixnum', '0b101.class'
assert_equal '123456789012345678901234567890', '123456789012345678901234567890'
-assert_equal 'Integer', '123456789012345678901234567890.class'
+assert_equal 'Bignum', '123456789012345678901234567890.class'
assert_equal '2.0', '2.0'
assert_equal 'Float', '1.3.class'
@@ -65,8 +65,10 @@ assert_equal ':a3c', ':"a#{1+2}c".inspect'
assert_equal 'Symbol', ':"a#{1+2}c".class'
# xstring
-assert_equal "foo\n", %q(`echo foo`)
-assert_equal "foo\n", %q(s = "foo"; `echo #{s}`)
+unless nacl?
+ assert_equal "foo\n", %q(`echo foo`)
+ assert_equal "foo\n", %q(s = "foo"; `echo #{s}`)
+end
# regexp
assert_equal '', '//.source'
@@ -97,7 +99,7 @@ assert_equal '[3]', '[3].inspect'
assert_equal '3', 'a = [3]; a[0]'
assert_equal 'Array', '[1,2].class'
assert_equal '2', '[1,2].size'
-assert_equal '[1, 2]', '[1,2].inspect'
+assert_equal '[1, 2]', '[1,2].inspect'
assert_equal 'Array', '[1,2,3,4,5].class'
assert_equal '5', '[1,2,3,4,5].size'
assert_equal '[1, 2, 3, 4, 5]', '[1,2,3,4,5].inspect'
@@ -167,7 +169,7 @@ assert_equal 'a', 'r = ("a".."c"); r.begin'
assert_equal 'c', 'r = ("a".."c"); r.end'
assert_equal 'String', '__FILE__.class'
-assert_equal 'Integer', '__LINE__.class'
+assert_equal 'Fixnum', '__LINE__.class'
###
@@ -223,24 +225,6 @@ assert_equal 'ok', %q{ # long hash literal (optimized)
:ok
}
-assert_equal 'ok', %q{ # Bug #15536
- eval <<-END
- {
- **{
- a0: nil, a1: nil, a2: nil, a3: nil, a4: nil, a5: nil, a6: nil, a7: nil, a8: nil,
- },
- a0: nil, a1: nil, a2: nil, a3: nil, a4: nil, a5: nil, a6: nil, a7: nil, a8: nil,
- **{
- c: nil
- },
- b0: nil, b1: nil, b2: nil, b3: nil, b4: nil, b5: nil, b6: nil, b7: nil, b8: nil,
- b9: nil, b10: nil, b11: nil, b12: nil, b13: nil, b14: nil, b15: nil, b16: nil,
- b17: nil, b18: nil, b19: nil, b20: nil, b21: nil,
- }
- END
- :ok
-}
-
assert_equal 'ok', %q{
[print(:ok), exit] # void literal with side-effect
:dummy
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 3462aa9434..0a7cb0a577 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_match /\Awrong number of arguments \(.*\b1\b.* 0\)\z/, %q{
+assert_equal 'wrong number of arguments (1 for 0)', %q{
def m; end
begin
m(1)
@@ -12,7 +12,7 @@ assert_match /\Awrong number of arguments \(.*\b1\b.* 0\)\z/, %q{
end
}
-assert_match /\Awrong number of arguments \(.*\b0\b.* 1\)\z/, %q{
+assert_equal 'wrong number of arguments (0 for 1)', %q{
def m a; end
begin
m
@@ -910,6 +910,34 @@ 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
diff --git a/bootstraptest/test_objectspace.rb b/bootstraptest/test_objectspace.rb
index 24a1a0ce2c..862a94e376 100644
--- a/bootstraptest/test_objectspace.rb
+++ b/bootstraptest/test_objectspace.rb
@@ -35,7 +35,7 @@ assert_normal_exit %q{
assert_normal_exit %q{
ObjectSpace.define_finalizer("") do
- Thread::Mutex.new.lock
+ Mutex.new.lock
end
}, '[ruby-dev:44049]'
diff --git a/bootstraptest/test_string.rb b/bootstraptest/test_string.rb
deleted file mode 100644
index 849dcd45b0..0000000000
--- a/bootstraptest/test_string.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-assert_normal_exit %q{
- inspect.clear
-}, '[ruby-core:68110]'
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index a111990a1f..80eaa6416d 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -376,8 +376,6 @@ 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 d16295de8b..048aeb19c2 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -25,9 +25,8 @@ rescue ThreadError => e
:ok if /can't create Thread/ =~ e.message
end
}
-assert_equal %q{ok}, %q{
-begin
- :ok if 5000 == 5000.times{|e|
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
(1..2).map{
Thread.new{
}
@@ -35,13 +34,9 @@ begin
e.join()
}
}
-rescue ThreadError => e
- :ok if /can't create Thread/ =~ e.message
-end
}
-assert_equal %q{ok}, %q{
-begin
- :ok if 5000 == 5000.times{|e|
+assert_equal %q{5000}, %q{
+ 5000.times{|e|
(1..2).map{
Thread.new{
}
@@ -49,9 +44,6 @@ begin
e.join(1000000000)
}
}
-rescue ThreadError => e
- :ok if /can't create Thread/ =~ e.message
-end
}
assert_equal %q{ok}, %q{
begin
@@ -93,7 +85,7 @@ assert_equal %q{ok}, %q{
ans = :ok
end
}
- Thread.pass until t.stop?
+ Thread.pass
t.kill
t.join
ans
@@ -347,7 +339,7 @@ assert_equal 'ok', %q{
assert_equal 'ok', %q{
begin
- m1, m2 = Thread::Mutex.new, Thread::Mutex.new
+ m1, m2 = Mutex.new, Mutex.new
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
@@ -358,32 +350,32 @@ assert_equal 'ok', %q{
}
assert_equal 'ok', %q{
- m = Thread::Mutex.new
+ m = Mutex.new
Thread.new { m.lock }; sleep 0.1; m.lock
:ok
}
assert_equal 'ok', %q{
- m = Thread::Mutex.new
+ m = Mutex.new
Thread.new { m.lock }; m.lock
:ok
}
assert_equal 'ok', %q{
- m = Thread::Mutex.new
+ m = Mutex.new
Thread.new { m.lock }.join; m.lock
:ok
}
assert_equal 'ok', %q{
- m = Thread::Mutex.new
+ m = Mutex.new
Thread.new { m.lock; sleep 0.2 }
sleep 0.1; m.lock
:ok
}
assert_equal 'ok', %q{
- m = Thread::Mutex.new
+ m = Mutex.new
Thread.new { m.lock; sleep 0.2; m.unlock }
sleep 0.1; m.lock
:ok
@@ -409,7 +401,7 @@ assert_equal 'ok', %{
open("zzz.rb", "w") do |f|
f.puts <<-'end;' # do
begin
- m = Thread::Mutex.new
+ m = Mutex.new
parent = Thread.current
th1 = Thread.new { m.lock; sleep }
sleep 0.01 until th1.stop?
@@ -437,8 +429,8 @@ assert_equal 'ok', %{
assert_finish 3, %q{
require 'thread'
- lock = Thread::Mutex.new
- cond = Thread::ConditionVariable.new
+ lock = Mutex.new
+ cond = ConditionVariable.new
t = Thread.new do
lock.synchronize do
cond.wait(lock)
diff --git a/ccan/list/list.h b/ccan/list/list.h
index ca9f9f1f7f..749db7849a 100644
--- a/ccan/list/list.h
+++ b/ccan/list/list.h
@@ -42,8 +42,8 @@ struct list_head
};
#define LIST_LOC __FILE__ ":" stringify(__LINE__)
-#define list_debug(h, loc) ((void)loc, h)
-#define list_debug_node(n, loc) ((void)loc, n)
+#define list_debug(h, loc) (h)
+#define list_debug_node(n, loc) (n)
/**
* LIST_HEAD_INIT - initializer for an empty list_head
@@ -104,36 +104,6 @@ static inline void list_node_init(struct list_node *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.
@@ -151,34 +121,10 @@ 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;
+ n->next = h->n.next;
+ n->prev = &h->n;
+ h->n.next->prev = n;
+ h->n.next = n;
(void)list_debug(h, abortstr);
}
@@ -197,7 +143,11 @@ 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);
+ n->next = &h->n;
+ n->prev = h->n.prev;
+ h->n.prev->next = n;
+ h->n.prev = n;
+ (void)list_debug(h, abortstr);
}
/**
@@ -315,39 +265,6 @@ static inline void list_del_from(struct list_head *h, struct list_node *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
@@ -468,29 +385,9 @@ static inline const void *list_tail_(const struct list_head *h, size_t off)
* 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))
+ for (i = container_of_var(list_debug(h, LIST_LOC)->n.prev, i, member); \
+ &i->member != &(h)->n; \
+ i = container_of_var(i->member.prev, i, member))
/**
* list_for_each_safe - iterate through a list, maybe during deletion
@@ -504,6 +401,7 @@ static inline const void *list_tail_(const struct list_head *h, size_t off)
* @nxt is used to hold the next element, so you can delete @i from the list.
*
* Example:
+ * struct child *next;
* list_for_each_safe(&parent->children, child, next, list) {
* list_del(&child->list);
* parent->num_children--;
@@ -618,24 +516,6 @@ static inline void list_prepend_list_(struct list_head *to,
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
@@ -666,18 +546,11 @@ static inline void list_prepend_list_(struct list_head *to,
* 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)
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next, \
+ (off)); \
+ list_node_from_off_((void *)i, (off)) != &(h)->n; \
+ i = list_node_to_off_(list_node_from_off_((void *)i, (off))->next, \
+ (off)))
/**
* list_for_each_safe_off - iterate through a list of memory regions, maybe
@@ -696,26 +569,15 @@ static inline void list_prepend_list_(struct list_head *to,
* 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)
+ for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next, \
+ (off)), \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->next, \
+ (off)); \
+ list_node_from_off_(i, (off)) != &(h)->n; \
+ i = nxt, \
+ nxt = list_node_to_off_(list_node_from_off_(i, (off))->next, \
+ (off)))
-/**
- * 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) \
diff --git a/class.c b/class.c
index 364f258333..d841328077 100644
--- a/class.c
+++ b/class.c
@@ -23,13 +23,17 @@
* \{
*/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/st.h"
+#include "method.h"
#include "constant.h"
#include "vm_core.h"
-#include "id_table.h"
+#include "internal.h"
#include <ctype.h>
+int rb_vm_add_root_module(ID id, VALUE module);
+
+
#define id_attached id__attached__
void
@@ -110,7 +114,7 @@ rb_class_remove_from_module_subclasses(VALUE klass)
}
void
-rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE arg)
+rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE))
{
rb_subclass_entry_t *cur = RCLASS_EXT(klass)->subclasses;
@@ -119,32 +123,20 @@ rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE arg)
while (cur) {
VALUE curklass = cur->klass;
cur = cur->next;
- f(curklass, arg);
+ f(curklass);
}
}
-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, class_detach_subclasses, Qnil);
-}
-
-static void
-class_detach_module_subclasses(VALUE klass, VALUE arg)
-{
- rb_class_remove_from_module_subclasses(klass);
+ rb_class_foreach_subclass(klass, rb_class_remove_from_super_subclasses);
}
void
rb_class_detach_module_subclasses(VALUE klass)
{
- rb_class_foreach_subclass(klass, class_detach_module_subclasses, Qnil);
+ rb_class_foreach_subclass(klass, rb_class_remove_from_module_subclasses);
}
/**
@@ -162,31 +154,25 @@ rb_class_detach_module_subclasses(VALUE klass)
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
- 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);
+ 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;
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.
@@ -220,8 +206,8 @@ void
rb_check_inheritable(VALUE super)
{
if (!RB_TYPE_P(super, T_CLASS)) {
- rb_raise(rb_eTypeError, "superclass must be a Class (%"PRIsVALUE" given)",
- rb_obj_class(super));
+ rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
+ rb_obj_classname(super));
}
if (RBASIC(super)->flags & FL_SINGLETON) {
rb_raise(rb_eTypeError, "can't make subclass of singleton class");
@@ -247,34 +233,53 @@ rb_class_new(VALUE super)
}
static void
-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));
+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);
}
else {
- rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me));
+ rb_method_entry_set(klass, mid, me, me->flag);
}
}
-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)
+static int
+clone_method_i(st_data_t key, st_data_t value, st_data_t data)
{
- 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;
+ clone_method((VALUE)data, (ID)key, (const rb_method_entry_t *)value);
+ return ST_CONTINUE;
}
struct clone_const_arg {
VALUE klass;
- struct rb_id_table *tbl;
+ st_table *tbl;
};
static int
@@ -285,14 +290,14 @@ clone_const(ID key, const rb_const_entry_t *ce, struct clone_const_arg *arg)
RB_OBJ_WRITTEN(arg->klass, Qundef, ce->value);
RB_OBJ_WRITTEN(arg->klass, Qundef, ce->file);
- rb_id_table_insert(arg->tbl, key, (VALUE)nce);
- return ID_TABLE_CONTINUE;
+ st_insert(arg->tbl, key, (st_data_t)nce);
+ return ST_CONTINUE;
}
-static enum rb_id_table_iterator_result
-clone_const_i(ID key, VALUE value, void *data)
+static int
+clone_const_i(st_data_t key, st_data_t value, st_data_t data)
{
- return clone_const(key, (const rb_const_entry_t *)value, data);
+ return clone_const((ID)key, (const rb_const_entry_t *)value, (struct clone_const_arg *)data);
}
static void
@@ -331,7 +336,10 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
rb_free_const_table(RCLASS_CONST_TBL(clone));
RCLASS_CONST_TBL(clone) = 0;
}
- RCLASS_M_TBL(clone) = 0;
+ if (RCLASS_M_TBL_WRAPPER(clone)) {
+ rb_free_m_tbl_wrapper(RCLASS_M_TBL_WRAPPER(clone));
+ RCLASS_M_TBL_WRAPPER(clone) = 0;
+ }
if (RCLASS_IV_TBL(orig)) {
st_data_t id;
@@ -346,16 +354,14 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
if (RCLASS_CONST_TBL(orig)) {
struct clone_const_arg arg;
- arg.tbl = RCLASS_CONST_TBL(clone) = rb_id_table_create(0);
+ RCLASS_CONST_TBL(clone) = st_init_numtable();
arg.klass = clone;
- rb_id_table_foreach(RCLASS_CONST_TBL(orig), clone_const_i, &arg);
+ arg.tbl = RCLASS_CONST_TBL(clone);
+ st_foreach(RCLASS_CONST_TBL(orig), clone_const_i, (st_data_t)&arg);
}
if (RCLASS_M_TBL(orig)) {
- struct clone_method_arg arg;
- arg.old_klass = orig;
- arg.new_klass = clone;
RCLASS_M_TBL_INIT(clone);
- rb_id_table_foreach(RCLASS_M_TBL(orig), clone_method_i, &arg);
+ st_foreach(RCLASS_M_TBL(orig), clone_method_i, (st_data_t)clone);
}
return clone;
@@ -370,7 +376,7 @@ rb_singleton_class_clone(VALUE obj)
VALUE
rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
{
- const VALUE klass = RBASIC(obj)->klass;
+ VALUE klass = RBASIC(obj)->klass;
if (!FL_TEST(klass, FL_SINGLETON))
return klass;
@@ -392,20 +398,16 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
}
if (RCLASS_CONST_TBL(klass)) {
struct clone_const_arg arg;
- arg.tbl = RCLASS_CONST_TBL(clone) = rb_id_table_create(0);
+ RCLASS_CONST_TBL(clone) = st_init_numtable();
arg.klass = clone;
- rb_id_table_foreach(RCLASS_CONST_TBL(klass), clone_const_i, &arg);
+ arg.tbl = RCLASS_CONST_TBL(clone);
+ st_foreach(RCLASS_CONST_TBL(klass), clone_const_i, (st_data_t)&arg);
}
if (attach != Qundef) {
rb_singleton_class_attached(clone, attach);
}
RCLASS_M_TBL_INIT(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);
- }
+ st_foreach(RCLASS_M_TBL(klass), clone_method_i, (st_data_t)clone);
rb_singleton_class_attached(RBASIC(clone)->klass, clone);
FL_SET(clone, FL_SINGLETON);
@@ -424,7 +426,7 @@ rb_singleton_class_attached(VALUE klass, VALUE obj)
if (!RCLASS_IV_TBL(klass)) {
RCLASS_IV_TBL(klass) = st_init_numtable();
}
- rb_class_ivar_set(klass, id_attached, obj);
+ rb_st_insert_id_and_value(klass, RCLASS_IV_TBL(klass), id_attached, obj);
}
}
@@ -440,19 +442,6 @@ 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
@@ -460,7 +449,7 @@ rb_singleton_class_internal_p(VALUE sklass)
*/
#define HAVE_METACLASS_P(k) \
(FL_TEST(METACLASS_OF(k), FL_SINGLETON) && \
- rb_singleton_class_has_metaclass_p(k))
+ rb_ivar_get(METACLASS_OF(k), id_attached) == (k))
/*!
* ensures \a klass belongs to its own eigenclass.
@@ -547,11 +536,6 @@ Init_class_hierarchy(void)
{
rb_cBasicObject = boot_defclass("BasicObject", 0);
rb_cObject = boot_defclass("Object", rb_cBasicObject);
- rb_gc_register_mark_object(rb_cObject);
-
- /* resolve class name ASAP for order-independence */
- rb_class_name(rb_cObject);
-
rb_cModule = boot_defclass("Module", rb_cObject);
rb_cClass = boot_defclass("Class", rb_cModule);
@@ -631,12 +615,12 @@ rb_class_inherited(VALUE super, VALUE klass)
* Defines a top-level class.
* \param name name of the class
* \param super a class from which the new class will derive.
+ * NULL means \c Object class.
* \return the created class
* \throw TypeError if the constant name \a name is already taken but
* the constant is not a \c Class.
- * \throw TypeError if the class is already defined but the class can not
+ * \throw NameError if the class is already defined but the class can not
* be reopened because its superclass is not \a super.
- * \throw ArgumentError if the \a super is NULL.
* \post top-level constant named \a name refers the returned class.
*
* \note if a class named \a name is already defined and its superclass is
@@ -652,8 +636,7 @@ 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 (%"PRIsVALUE")",
- name, rb_obj_class(klass));
+ rb_raise(rb_eTypeError, "%s is not a class", name);
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
rb_raise(rb_eTypeError, "superclass mismatch for class %s", name);
@@ -661,7 +644,7 @@ rb_define_class(const char *name, VALUE super)
return klass;
}
if (!super) {
- rb_raise(rb_eArgError, "no super class for `%s'", name);
+ rb_warn("no super class for `%s', Object assumed", name);
}
klass = rb_define_class_id(id, super);
rb_vm_add_root_module(id, klass);
@@ -682,7 +665,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 TypeError if the class is already defined but the class can not
+ * \throw NameError 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.
*
@@ -705,7 +688,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 TypeError if the class is already defined but the class can not
+ * \throw NameError 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.
*
@@ -720,21 +703,16 @@ 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, "%"PRIsVALUE"::%"PRIsVALUE" is not a class"
- " (%"PRIsVALUE")",
- outer, rb_id2str(id), rb_obj_class(klass));
+ rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
- rb_raise(rb_eTypeError, "superclass mismatch for class "
- "%"PRIsVALUE"::%"PRIsVALUE""
- " (%"PRIsVALUE" is given but was %"PRIsVALUE")",
- outer, rb_id2str(id), RCLASS_SUPER(klass), super);
+ rb_name_error(id, "%s is already defined", rb_id2name(id));
}
return klass;
}
if (!super) {
- rb_raise(rb_eArgError, "no super class for `%"PRIsVALUE"::%"PRIsVALUE"'",
- rb_class_path(outer), rb_id2str(id));
+ rb_warn("no super class for `%s::%s', Object assumed",
+ rb_class2name(outer), rb_id2name(id));
}
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, outer, rb_id2str(id));
@@ -773,11 +751,9 @@ 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)) {
- rb_raise(rb_eTypeError, "%s is not a module (%"PRIsVALUE")",
- name, rb_obj_class(module));
- }
- return module;
+ if (RB_TYPE_P(module, T_MODULE))
+ return module;
+ rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
}
module = rb_define_module_id(id);
rb_vm_add_root_module(id, module);
@@ -799,12 +775,10 @@ 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)) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a module"
- " (%"PRIsVALUE")",
- outer, rb_id2str(id), rb_obj_class(module));
- }
- return module;
+ if (RB_TYPE_P(module, T_MODULE))
+ return module;
+ rb_raise(rb_eTypeError, "%s::%s is not a module",
+ rb_class2name(outer), rb_obj_classname(module));
}
module = rb_define_module_id(id);
rb_const_set(outer, id, module);
@@ -826,13 +800,13 @@ rb_include_class_new(VALUE module, VALUE super)
RCLASS_IV_TBL(module) = st_init_numtable();
}
if (!RCLASS_CONST_TBL(module)) {
- RCLASS_CONST_TBL(module) = rb_id_table_create(0);
+ RCLASS_CONST_TBL(module) = st_init_numtable();
}
RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
RCLASS_CONST_TBL(klass) = RCLASS_CONST_TBL(module);
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module))); /* TODO: unprotected? */
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(klass)) =
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(RCLASS_ORIGIN(module)));
RCLASS_SET_SUPER(klass, super);
if (RB_TYPE_P(module, T_ICLASS)) {
@@ -847,48 +821,42 @@ rb_include_class_new(VALUE module, VALUE super)
return (VALUE)klass;
}
-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);
-}
+static int include_modules_at(const VALUE klass, VALUE c, VALUE module);
void
rb_include_module(VALUE klass, VALUE module)
{
int changed = 0;
- ensure_includable(klass, module);
+ rb_frozen_class_p(klass);
+
+ if (!RB_TYPE_P(module, T_MODULE)) {
+ Check_Type(module, T_MODULE);
+ }
+
+ OBJ_INFECT(klass, module);
- changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module, TRUE);
+ changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic include detected");
}
-static enum rb_id_table_iterator_result
-add_refined_method_entry_i(ID key, VALUE value, void *data)
+static int
+add_refined_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
- rb_add_refined_method_entry((VALUE)data, key);
- return ID_TABLE_CONTINUE;
+ rb_add_refined_method_entry((VALUE) data, (ID) key);
+ return ST_CONTINUE;
}
static int
-include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
+include_modules_at(const VALUE klass, VALUE c, VALUE module)
{
VALUE p, iclass;
int method_changed = 0, constant_changed = 0;
- struct rb_id_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
+ const st_table *const klass_m_tbl = RCLASS_M_TBL(RCLASS_ORIGIN(klass));
while (module) {
int superclass_seen = FALSE;
- struct rb_id_table *tbl;
if (RCLASS_ORIGIN(module) != module)
goto skip;
@@ -896,42 +864,42 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
return -1;
/* ignore if the module included already in superclasses */
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
- int type = BUILTIN_TYPE(p);
- if (type == T_ICLASS) {
- if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
+ switch (BUILTIN_TYPE(p)) {
+ case T_ICLASS:
+ if (RCLASS_M_TBL_WRAPPER(p) == RCLASS_M_TBL_WRAPPER(module)) {
if (!superclass_seen) {
c = p; /* move insertion point */
}
goto skip;
}
- }
- else if (type == T_CLASS) {
- if (!search_super) break;
+ break;
+ case T_CLASS:
superclass_seen = TRUE;
+ break;
}
}
iclass = rb_include_class_new(module, RCLASS_SUPER(c));
c = RCLASS_SET_SUPER(c, iclass);
- {
- VALUE m = module;
- if (BUILTIN_TYPE(m) == T_ICLASS) m = RBASIC(m)->klass;
- rb_module_add_to_subclasses_list(m, 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);
}
if (FL_TEST(klass, RMODULE_IS_REFINEMENT)) {
VALUE refined_class =
rb_refinement_module_get_refined_class(klass);
- rb_id_table_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i, (void *)refined_class);
+ st_foreach(RMODULE_M_TBL(module), add_refined_method_entry_i,
+ (st_data_t) refined_class);
FL_SET(c, RMODULE_INCLUDED_INTO_REFINEMENT);
}
-
- tbl = RMODULE_M_TBL(module);
- if (tbl && rb_id_table_size(tbl)) method_changed = 1;
-
- tbl = RMODULE_CONST_TBL(module);
- if (tbl && rb_id_table_size(tbl)) constant_changed = 1;
+ 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;
skip:
module = RCLASS_SUPER(module);
}
@@ -942,40 +910,45 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super)
return method_changed;
}
-static enum rb_id_table_iterator_result
-move_refined_method(ID key, VALUE value, void *data)
+static int
+move_refined_method(st_data_t key, st_data_t value, st_data_t data)
{
rb_method_entry_t *me = (rb_method_entry_t *) value;
- VALUE klass = (VALUE)data;
- struct rb_id_table *tbl = RCLASS_M_TBL(klass);
+ st_table *tbl = (st_table *) data;
if (me->def->type == VM_METHOD_TYPE_REFINED) {
- 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;
+ 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;
}
else {
- rb_id_table_insert(tbl, key, (VALUE)me);
- return ID_TABLE_DELETE;
+ st_add_direct(tbl, key, (st_data_t) me);
+ return ST_DELETE;
}
}
else {
- return ID_TABLE_CONTINUE;
+ return ST_CONTINUE;
}
}
void
rb_prepend_module(VALUE klass, VALUE module)
{
+ void rb_vm_check_redefinition_by_prepend(VALUE klass);
VALUE origin;
int changed = 0;
- ensure_includable(klass, module);
+ rb_frozen_class_p(klass);
+
+ Check_Type(module, T_MODULE);
+
+ OBJ_INFECT(klass, module);
origin = RCLASS_ORIGIN(klass);
if (origin == klass) {
@@ -983,12 +956,13 @@ rb_prepend_module(VALUE klass, VALUE module)
OBJ_WB_UNPROTECT(origin); /* TODO: conservative shading. Need more survey. */
RCLASS_SET_SUPER(origin, RCLASS_SUPER(klass));
RCLASS_SET_SUPER(klass, origin);
- RCLASS_SET_ORIGIN(klass, origin);
- RCLASS_M_TBL(origin) = RCLASS_M_TBL(klass);
+ RCLASS_ORIGIN(klass) = origin;
+ RCLASS_M_TBL_WRAPPER(origin) = RCLASS_M_TBL_WRAPPER(klass);
RCLASS_M_TBL_INIT(klass);
- rb_id_table_foreach(RCLASS_M_TBL(origin), move_refined_method, (void *)klass);
+ st_foreach(RCLASS_M_TBL(origin), move_refined_method,
+ (st_data_t) RCLASS_M_TBL(klass));
}
- changed = include_modules_at(klass, klass, module, FALSE);
+ changed = include_modules_at(klass, klass, module);
if (changed < 0)
rb_raise(rb_eArgError, "cyclic prepend detected");
if (changed) {
@@ -1097,81 +1071,75 @@ rb_mod_ancestors(VALUE mod)
return ary;
}
-static void
-ins_methods_push(st_data_t name, st_data_t ary)
-{
- rb_ary_push((VALUE)ary, ID2SYM((ID)name));
-}
+#define VISI(x) ((x)&NOEX_MASK)
+#define VISI_CHECK(x,f) (VISI(x) == (f))
static int
-ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
+ins_methods_push(ID name, long type, VALUE ary, long visi)
{
- switch ((rb_method_visibility_t)type) {
- case METHOD_VISI_UNDEF:
- case METHOD_VISI_PRIVATE:
+ if (type == -1) return ST_CONTINUE;
+
+ switch (visi) {
+ case NOEX_PRIVATE:
+ case NOEX_PROTECTED:
+ case NOEX_PUBLIC:
+ visi = (type == visi);
break;
- default: /* everything but private */
- ins_methods_push(name, ary);
+ default:
+ visi = (type != NOEX_PRIVATE);
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 */
+}
+
+static int
ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
{
- if ((rb_method_visibility_t)type == METHOD_VISI_PROTECTED) {
- ins_methods_push(name, ary);
- }
- return ST_CONTINUE;
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PROTECTED);
}
static int
ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
{
- if ((rb_method_visibility_t)type == METHOD_VISI_PRIVATE) {
- ins_methods_push(name, ary);
- }
- return ST_CONTINUE;
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PRIVATE);
}
static int
ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
{
- if ((rb_method_visibility_t)type == METHOD_VISI_PUBLIC) {
- ins_methods_push(name, ary);
- }
- return ST_CONTINUE;
+ return ins_methods_push((ID)name, (long)type, (VALUE)ary, NOEX_PUBLIC);
}
-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)
+static int
+method_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
const rb_method_entry_t *me = (const rb_method_entry_t *)value;
- struct method_entry_arg *arg = (struct method_entry_arg *)data;
- rb_method_visibility_t type;
+ st_table *list = (st_table *)data;
+ long type;
- 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 (me && me->def->type == VM_METHOD_TYPE_REFINED) {
+ me = rb_resolve_refined_method(Qnil, me, NULL);
+ if (!me) return ST_CONTINUE;
}
- if (!st_lookup(arg->list, key, 0)) {
+ if (!st_lookup(list, key, 0)) {
if (UNDEFINED_METHOD_ENTRY_P(me)) {
- type = METHOD_VISI_UNDEF; /* none */
+ type = -1; /* none */
}
else {
- type = METHOD_ENTRY_VISI(me);
+ type = VISI(me->flag);
}
- st_add_direct(arg->list, key, (st_data_t)type);
+ st_add_direct(list, key, type);
}
- return ID_TABLE_CONTINUE;
+ return ST_CONTINUE;
}
static VALUE
@@ -1179,7 +1147,7 @@ class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int
{
VALUE ary;
int recur, prepended = 0;
- struct method_entry_arg me_arg;
+ st_table *list;
if (argc == 0) {
recur = TRUE;
@@ -1195,17 +1163,16 @@ class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int
prepended = 1;
}
- me_arg.list = st_init_numtable();
- me_arg.recur = recur;
+ list = st_init_numtable();
for (; mod; mod = RCLASS_SUPER(mod)) {
- if (RCLASS_M_TBL(mod)) rb_id_table_foreach(RCLASS_M_TBL(mod), method_entry_i, &me_arg);
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)list);
if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
ary = rb_ary_new();
- st_foreach(me_arg.list, func, ary);
- st_free_table(me_arg.list);
+ st_foreach(list, func, ary);
+ st_free_table(list);
return ary;
}
@@ -1418,8 +1385,7 @@ VALUE
rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
{
VALUE recur, ary, klass, origin;
- struct method_entry_arg me_arg;
- struct rb_id_table *mtbl;
+ st_table *list, *mtbl;
if (argc == 0) {
recur = Qtrue;
@@ -1429,21 +1395,22 @@ rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
}
klass = CLASS_OF(obj);
origin = RCLASS_ORIGIN(klass);
- me_arg.list = st_init_numtable();
- me_arg.recur = RTEST(recur);
+ list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
- if ((mtbl = RCLASS_M_TBL(origin)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
+ if ((mtbl = RCLASS_M_TBL(origin)) != 0)
+ st_foreach(mtbl, method_entry_i, (st_data_t)list);
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) rb_id_table_foreach(mtbl, method_entry_i, &me_arg);
+ if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0)
+ st_foreach(mtbl, method_entry_i, (st_data_t)list);
klass = RCLASS_SUPER(klass);
}
}
ary = rb_ary_new();
- st_foreach(me_arg.list, ins_methods_i, ary);
- st_free_table(me_arg.list);
+ st_foreach(list, ins_methods_i, ary);
+ st_free_table(list);
return ary;
}
@@ -1508,48 +1475,31 @@ rb_obj_singleton_methods(int argc, const 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, METHOD_VISI_PUBLIC);
+ rb_add_method_cfunc(klass, mid, func, argc, NOEX_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, METHOD_VISI_PUBLIC);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_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, METHOD_VISI_PROTECTED);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_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, METHOD_VISI_PRIVATE);
+ rb_add_method_cfunc(klass, rb_intern(name), func, argc, NOEX_PRIVATE);
}
void
rb_undef_method(VALUE klass, const char *name)
{
- rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, METHOD_VISI_UNDEF);
-}
-
-static enum rb_id_table_iterator_result
-undef_method_i(ID name, VALUE value, void *data)
-{
- VALUE klass = (VALUE)data;
- rb_add_method(klass, name, VM_METHOD_TYPE_UNDEF, 0, METHOD_VISI_UNDEF);
- return ID_TABLE_CONTINUE;
-}
-
-void
-rb_undef_methods_from(VALUE klass, VALUE super)
-{
- struct rb_id_table *mtbl = RCLASS_M_TBL(super);
- if (mtbl) {
- rb_id_table_foreach(mtbl, undef_method_i, (void *)klass);
- }
+ rb_add_method(klass, rb_intern(name), VM_METHOD_TYPE_UNDEF, 0, NOEX_UNDEF);
}
/*!
@@ -1595,8 +1545,7 @@ singleton_class_of(VALUE obj)
{
VALUE klass;
- if (FIXNUM_P(obj) || FLONUM_P(obj) || STATIC_SYM_P(obj)) {
- no_singleton:
+ if (FIXNUM_P(obj) || FLONUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
}
if (SPECIAL_CONST_P(obj)) {
@@ -1606,21 +1555,16 @@ singleton_class_of(VALUE obj)
return klass;
}
else {
- 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;
+ enum ruby_value_type type = BUILTIN_TYPE(obj);
+ if (type == T_FLOAT || type == T_BIGNUM) {
+ rb_raise(rb_eTypeError, "can't define singleton");
}
}
klass = RBASIC(obj)->klass;
if (!(FL_TEST(klass, FL_SINGLETON) &&
rb_ivar_get(klass, id_attached) == obj)) {
- rb_serial_t serial = RCLASS_SERIAL(klass);
klass = rb_make_metaclass(obj, klass);
- RCLASS_SERIAL(klass) = serial;
}
if (OBJ_TAINTED(obj)) {
@@ -1629,24 +1573,11 @@ singleton_class_of(VALUE obj)
else {
FL_UNSET(klass, FL_TAINT);
}
- RB_FL_SET_RAW(klass, RB_OBJ_FROZEN_RAW(obj));
+ 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.
@@ -1672,7 +1603,7 @@ rb_singleton_class_get(VALUE obj)
* Returns the singleton class of \a obj. Creates it if necessary.
*
* \param obj an arbitrary object.
- * \throw TypeError if \a obj is a Integer or a Symbol.
+ * \throw TypeError if \a obj is a Fixnum or a Symbol.
* \return the singleton class.
*
* \post \a obj has its own singleton class.
@@ -1773,137 +1704,18 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
rb_attr(klass, rb_intern(name), read, write, FALSE);
}
-VALUE
-rb_keyword_error_new(const char *error, VALUE keys)
-{
- const VALUE *ptr = RARRAY_CONST_PTR(keys);
- long i = 0, len = RARRAY_LEN(keys);
- VALUE error_message = rb_sprintf("%s keyword%.*s", error, len > 1, "s");
-
- if (len > 0) {
- rb_str_cat_cstr(error_message, ": ");
- while (1) {
- const VALUE k = ptr[i];
- Check_Type(k, T_SYMBOL); /* wrong hash is given to rb_get_kwargs */
- rb_str_append(error_message, rb_sym2str(k));
- if (++i >= len) break;
- rb_str_cat_cstr(error_message, ", ");
- }
- }
-
- 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);
- int i;
- for (i = 0; i < keywords; i++) {
- st_data_t key = ID2SYM(table[i]);
- st_delete(tbl, &key, NULL);
- }
- rb_keyword_error("unknown", rb_hash_keys(hash));
-}
-
-static int
-separate_symbol(st_data_t key, st_data_t value, st_data_t arg)
-{
- VALUE *kwdhash = (VALUE *)arg;
-
- if (!SYMBOL_P(key)) kwdhash++;
- if (!*kwdhash) *kwdhash = rb_hash_new();
- rb_hash_aset(*kwdhash, (VALUE)key, (VALUE)value);
- return ST_CONTINUE;
-}
-
-VALUE
-rb_extract_keywords(VALUE *orighash)
-{
- VALUE parthash[2] = {0, 0};
- VALUE hash = *orighash;
-
- if (RHASH_EMPTY_P(hash)) {
- *orighash = 0;
- return hash;
- }
- 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];
-}
-
int
-rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
+rb_obj_basic_to_s_p(VALUE obj)
{
- int i = 0, j;
- int rest = 0;
- VALUE missing = Qnil;
- st_data_t key;
-
-#define extract_kwarg(keyword, val) \
- (key = (st_data_t)(keyword), values ? \
- 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;
- }
- if (values) {
- for (j = 0; j < required + optional; j++) {
- values[j] = Qundef;
- }
- }
- if (required) {
- for (; i < required; i++) {
- VALUE keyword = ID2SYM(table[i]);
- if (keyword_hash) {
- st_data_t val;
- if (extract_kwarg(keyword, &val)) {
- if (values) values[i] = (VALUE)val;
- continue;
- }
- }
- if (NIL_P(missing)) missing = rb_ary_tmp_new(1);
- rb_ary_push(missing, keyword);
- }
- if (!NIL_P(missing)) {
- rb_keyword_error("missing", missing);
- }
- }
- j = i;
- if (optional && keyword_hash) {
- for (i = 0; i < optional; i++) {
- st_data_t val;
- if (extract_kwarg(ID2SYM(table[required+i]), &val)) {
- if (values) values[required+i] = (VALUE)val;
- j++;
- }
- }
- }
- if (!rest && keyword_hash) {
- if (RHASH_SIZE(keyword_hash) > (unsigned int)(values ? 0 : j)) {
- unknown_keyword_error(keyword_hash, table, required+optional);
- }
- }
- return j;
-#undef extract_kwarg
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"), 0);
+ if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
+ me->def->body.cfunc.func == rb_any_to_s)
+ return 1;
+ return 0;
}
-#undef rb_scan_args
+#include <stdarg.h>
+
int
rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
{
@@ -1913,8 +1725,8 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
va_list vargs;
int f_var = 0, f_hash = 0, f_block = 0;
int n_lead = 0, n_opt = 0, n_trail = 0, n_mand;
- int argi = 0, last_idx = -1;
- VALUE hash = Qnil, last_hash = 0;
+ int argi = 0;
+ VALUE hash = Qnil;
if (ISDIGIT(*p)) {
n_lead = *p - '0';
@@ -1922,16 +1734,22 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
if (ISDIGIT(*p)) {
n_opt = *p - '0';
p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ goto block_arg;
+ }
}
}
if (*p == '*') {
f_var = 1;
p++;
+ if (ISDIGIT(*p)) {
+ n_trail = *p - '0';
+ p++;
+ }
}
- if (ISDIGIT(*p)) {
- n_trail = *p - '0';
- p++;
- }
+ block_arg:
if (*p == ':') {
f_hash = 1;
p++;
@@ -1965,8 +1783,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
hash = rb_check_hash_type(last);
if (!NIL_P(hash)) {
VALUE opts = rb_extract_keywords(&hash);
- if (!(last_hash = hash)) argc--;
- else last_idx = argc - 1;
+ if (!hash) argc--;
hash = opts ? opts : Qnil;
}
}
@@ -1974,14 +1791,14 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
/* capture leading mandatory arguments */
for (i = n_lead; i-- > 0; ) {
var = va_arg(vargs, VALUE *);
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
+ if (var) *var = argv[argi];
argi++;
}
/* capture optional arguments */
for (i = n_opt; i-- > 0; ) {
var = va_arg(vargs, VALUE *);
if (argi < argc - n_trail) {
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
+ if (var) *var = argv[argi];
argi++;
}
else {
@@ -1994,11 +1811,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
var = va_arg(vargs, VALUE *);
if (0 < n_var) {
- if (var) {
- int f_last = (last_idx + 1 == argc - n_trail);
- *var = rb_ary_new4(n_var-f_last, &argv[argi]);
- if (f_last) rb_ary_push(*var, last_hash);
- }
+ if (var) *var = rb_ary_new4(n_var, &argv[argi]);
argi += n_var;
}
else {
@@ -2008,7 +1821,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
/* capture trailing mandatory arguments */
for (i = n_trail; i-- > 0; ) {
var = va_arg(vargs, VALUE *);
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
+ if (var) *var = argv[argi];
argi++;
}
/* capture an option hash - phase 2: assignment */
@@ -2036,10 +1849,119 @@ 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)
+{
+ const char *msg = "";
+ if (RARRAY_LEN(keys) == 1) {
+ keys = RARRAY_AREF(keys, 0);
+ }
+ else {
+ keys = rb_ary_join(keys, rb_usascii_str_new2(", "));
+ msg = "s";
+ }
+ rb_raise(rb_eArgError, "%s keyword%s: %"PRIsVALUE, error, msg, 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)
+{
+ VALUE keys;
+ int i;
+ for (i = 0; i < keywords; i++) {
+ rb_hash_delete(hash, ID2SYM(table[i]));
+ }
+ keys = rb_funcall(hash, rb_intern("keys"), 0, 0);
+ if (!RB_TYPE_P(keys, T_ARRAY)) rb_raise(rb_eArgError, "unknown keyword");
+ keyword_error("unknown", keys);
+}
+
+static int
+separate_symbol(st_data_t key, st_data_t value, st_data_t arg)
+{
+ VALUE *kwdhash = (VALUE *)arg;
+
+ if (!SYMBOL_P(key)) kwdhash++;
+ if (!*kwdhash) *kwdhash = rb_hash_new();
+ rb_hash_aset(*kwdhash, (VALUE)key, (VALUE)value);
+ return ST_CONTINUE;
+}
+
+VALUE
+rb_extract_keywords(VALUE *orighash)
+{
+ VALUE parthash[2] = {0, 0};
+ VALUE hash = *orighash;
+
+ if (RHASH_EMPTY_P(hash)) {
+ *orighash = 0;
+ return hash;
+ }
+ st_foreach(rb_hash_tbl_raw(hash), separate_symbol, (st_data_t)&parthash);
+ *orighash = parthash[1];
+ return parthash[0];
+}
+
int
-rb_class_has_methods(VALUE c)
+rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
{
- return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
+ int i = 0, j;
+ int rest = 0;
+ VALUE missing = Qnil;
+ st_data_t key;
+
+#define extract_kwarg(keyword, val) \
+ (key = (st_data_t)(keyword), values ? \
+ 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;
+ }
+ if (values) {
+ for (j = 0; j < required + optional; j++) {
+ values[j] = Qundef;
+ }
+ }
+ if (required) {
+ for (; i < required; i++) {
+ VALUE keyword = ID2SYM(table[i]);
+ if (keyword_hash) {
+ st_data_t val;
+ if (extract_kwarg(keyword, &val)) {
+ if (values) values[i] = (VALUE)val;
+ continue;
+ }
+ }
+ if (NIL_P(missing)) missing = rb_ary_tmp_new(1);
+ rb_ary_push(missing, keyword);
+ }
+ if (!NIL_P(missing)) {
+ keyword_error("missing", missing);
+ }
+ }
+ j = i;
+ if (optional && keyword_hash) {
+ for (i = 0; i < optional; i++) {
+ st_data_t val;
+ if (extract_kwarg(ID2SYM(table[required+i]), &val)) {
+ if (values) values[required+i] = (VALUE)val;
+ j++;
+ }
+ }
+ }
+ if (!rest && keyword_hash) {
+ if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
+ unknown_keyword_error(keyword_hash, table, required+optional);
+ }
+ }
+ return j;
+#undef extract_kwarg
}
/*!
diff --git a/common.mk b/common.mk
index 2175f67eba..2c8f914ccf 100644
--- a/common.mk
+++ b/common.mk
@@ -8,77 +8,41 @@ dll: $(LIBRUBY_SO)
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-ECHO0 = $(ECHO1:0=echo)
-ECHO = @$(ECHO0)
-
-mflags = $(MFLAGS)
-gnumake_recursive =
-enable_shared = $(ENABLE_SHARED:no=)
-
-UNICODE_VERSION = 10.0.0
-UNICODE_EMOJI_VERSION = 5.0
-
-### set the following environment variable or uncomment the line if
-### the Unicode data files should be updated completely on every update ('make up',...).
-# ALWAYS_UPDATE_UNICODE = yes
-UNICODE_DATA_DIR = enc/unicode/data/$(UNICODE_VERSION)/ucd
-UNICODE_SRC_DATA_DIR = $(srcdir)/$(UNICODE_DATA_DIR)
-UNICODE_SRC_EMOJI_DATA_DIR = $(srcdir)/enc/unicode/data/emoji/$(UNICODE_EMOJI_VERSION)
-UNICODE_HDR_DIR = $(srcdir)/enc/unicode/$(UNICODE_VERSION)
-UNICODE_DATA_HEADERS = \
- $(UNICODE_HDR_DIR)/casefold.h \
- $(UNICODE_HDR_DIR)/name2ctype.h \
- $(empty)
-
-RUBY_RELEASE_DATE = $(RUBY_RELEASE_YEAR)-$(RUBY_RELEASE_MONTH)-$(RUBY_RELEASE_DAY)
+ECHO = $(ECHO1:0=@echo)
+
RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
RUN_OPTS = --disable-gems
-INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(UNICODE_HDR_DIR)
-
-GEM_HOME =
-GEM_PATH =
-GEM_VENDOR =
+SPEC_GIT_BASE = git://github.com/nurse
+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.15.0
-SIMPLECOV_HTML_GIT_URL = git://github.com/colszowka/simplecov-html.git
-SIMPLECOV_HTML_GIT_REF = v0.10.2
-DOCLIE_GIT_URL = git://github.com/ms-ati/docile.git
-DOCLIE_GIT_REF = v1.1.5
+SIMPLECOV_GIT_URL = git://github.com/hsbt/simplecov.git
STATIC_RUBY = static-ruby
-TIMESTAMPDIR = $(EXTOUT)/.timestamp
EXTCONF = extconf.rb
LIBRUBY_EXTS = ./.libruby-with-ext.time
REVISION_H = ./.revision.time
-PLATFORM_D = $(TIMESTAMPDIR)/.$(PLATFORM_DIR).time
-ENC_TRANS_D = $(TIMESTAMPDIR)/.enc-trans.time
+PLATFORM_D = ./$(PLATFORM_DIR)/.time
RDOCOUT = $(EXTOUT)/rdoc
-HTMLOUT = $(EXTOUT)/html
CAPIOUT = doc/capi
-INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
+DMYEXT = dmyext.$(OBJEXT)
NORMALMAINOBJ = main.$(OBJEXT)
MAINOBJ = $(NORMALMAINOBJ)
-DLDOBJS = $(INITOBJS)
+EXTOBJS =
+DLDOBJS = $(DMYEXT)
EXTSOLIBS =
-MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
+MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) miniprelude.$(OBJEXT)
ENC_MK = enc.mk
-MAKE_ENC = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
- RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(mflags)
COMMONOBJS = array.$(OBJEXT) \
bignum.$(OBJEXT) \
class.$(OBJEXT) \
compar.$(OBJEXT) \
- compile.$(OBJEXT) \
complex.$(OBJEXT) \
- cont.$(OBJEXT) \
- debug.$(OBJEXT) \
- debug_counter.$(OBJEXT) \
dir.$(OBJEXT) \
dln_find.$(OBJEXT) \
encoding.$(OBJEXT) \
@@ -86,13 +50,13 @@ COMMONOBJS = array.$(OBJEXT) \
enumerator.$(OBJEXT) \
error.$(OBJEXT) \
eval.$(OBJEXT) \
+ load.$(OBJEXT) \
+ proc.$(OBJEXT) \
file.$(OBJEXT) \
gc.$(OBJEXT) \
hash.$(OBJEXT) \
inits.$(OBJEXT) \
io.$(OBJEXT) \
- iseq.$(OBJEXT) \
- load.$(OBJEXT) \
marshal.$(OBJEXT) \
math.$(OBJEXT) \
node.$(OBJEXT) \
@@ -100,7 +64,6 @@ COMMONOBJS = array.$(OBJEXT) \
object.$(OBJEXT) \
pack.$(OBJEXT) \
parse.$(OBJEXT) \
- proc.$(OBJEXT) \
process.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
@@ -121,17 +84,20 @@ COMMONOBJS = array.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
symbol.$(OBJEXT) \
- thread.$(OBJEXT) \
time.$(OBJEXT) \
transcode.$(OBJEXT) \
util.$(OBJEXT) \
variable.$(OBJEXT) \
version.$(OBJEXT) \
+ compile.$(OBJEXT) \
+ debug.$(OBJEXT) \
+ iseq.$(OBJEXT) \
vm.$(OBJEXT) \
- vm_backtrace.$(OBJEXT) \
vm_dump.$(OBJEXT) \
+ vm_backtrace.$(OBJEXT) \
vm_trace.$(OBJEXT) \
- $(DTRACE_OBJ) \
+ thread.$(OBJEXT) \
+ cont.$(OBJEXT) \
$(BUILTIN_ENCOBJS) \
$(BUILTIN_TRANSOBJS) \
$(MISSING)
@@ -142,23 +108,22 @@ EXPORTOBJS = $(DLNOBJ) \
$(COMMONOBJS)
OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
-ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
+ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(DMYEXT)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
DEFAULT_PRELUDES = $(GEM_PRELUDE)
-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES)
-GEM_PRELUDE = $(srcdir)/gem_prelude.rb
-PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
-GOLFPRELUDES = {$(srcdir)}golf_prelude.c
+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
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)'" \
- --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
+ --make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --gnumake=$(gnumake) \
--
INSTRUBY = $(SUDO) $(RUNRUBY) -r./$(arch)-fake $(srcdir)/tool/rbinstall.rb
INSTRUBY_ARGS = $(SCRIPT_ARGS) \
@@ -173,24 +138,21 @@ 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
-COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
+BOOTSTRAPRUBY = $(BASERUBY)
-SHOWFLAGS = showflags
+COMPILE_PRELUDE = $(MINIRUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb
-all: $(SHOWFLAGS) main docs
+all: showflags main docs
-main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs
+main: showflags $(ENCSTATIC:static=lib)encs exts
@$(NULLCMD)
.PHONY: showflags
-exts enc trans: $(SHOWFLAGS)
+exts enc trans: showflags
showflags:
$(MESSAGE_BEGIN) \
" CC = $(CC)" \
@@ -201,9 +163,6 @@ showflags:
" CPPFLAGS = $(CPPFLAGS)" \
" DLDFLAGS = $(DLDFLAGS)" \
" SOLIBS = $(SOLIBS)" \
- " LANG = $(LANG)" \
- " LC_ALL = $(LC_ALL)" \
- " LC_CTYPE = $(LC_CTYPE)" \
$(MESSAGE_END)
-@$(CC_VERSION)
@@ -213,77 +172,49 @@ showconfig:
$(configure_args) \
$(ECHO_END)
-EXTS_NOTE = -f $(EXTS_MK) $(mflags) RUBY="$(MINIRUBY)" top_srcdir="$(srcdir)" note
-
exts: build-ext
EXTS_MK = exts.mk
-$(EXTS_MK): ext/configure-ext.mk $(TIMESTAMPDIR)/$(arch)/.time $(srcdir)/template/exts.mk.tmpl
- $(Q)$(MAKE) -f ext/configure-ext.mk $(mflags) V=$(V) EXTSTATIC=$(EXTSTATIC) \
- gnumake=$(gnumake) MINIRUBY="$(MINIRUBY)" \
- EXTLDFLAGS="$(EXTLDFLAGS)" srcdir="$(srcdir)"
+$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
$(ECHO) generating makefile $@
- $(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
- $(srcdir)/template/exts.mk.tmpl --gnumake=$(gnumake)
-
-ext/configure-ext.mk: $(PREP) all-incs $(MKFILES) $(RBCONFIG) $(LIBRUBY) \
- $(srcdir)/template/configure-ext.mk.tmpl
- $(ECHO) generating makefiles $@
- $(Q)$(MAKEDIRS) $(@D)
- $(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
- $(srcdir)/template/$(@F).tmpl --srcdir="$(srcdir)" \
- --miniruby="$(MINIRUBY)" --script-args='$(SCRIPT_ARGS)'
+ $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
configure-ext: $(EXTS_MK)
build-ext: $(EXTS_MK)
- $(Q)$(MAKE) -f $(EXTS_MK) $(mflags) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) \
- EXTENCS="$(ENCOBJS)" UPDATE_LIBRARIES=no $(EXTSTATIC)
- $(Q)$(MAKE) $(EXTS_NOTE)
-
-exts-note: $(EXTS_MK)
- $(Q)$(MAKE) $(EXTS_NOTE)
-
-ext/extinit.c: $(srcdir)/template/extinit.c.tmpl
- $(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
- $(srcdir)/template/extinit.c.tmpl $(EXTINITS)
+ $(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
prog: program wprogram
-programs: $(PROGRAM) $(WPROGRAM)
$(PREP): $(MKFILES)
-miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
+miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE) $(DTRACE_OBJ)
objs: $(ALLOBJS)
GORUBY = go$(RUBY_INSTALL_NAME)
golf: $(LIBRUBY) $(GOLFOBJS) PHONY
- $(Q) $(MAKE) $(mflags) \
- MAINOBJ=goruby.$(OBJEXT) \
- EXTOBJS="golf_prelude.$(OBJEXT) $(EXTOBJS)" \
- PROGRAM=$(GORUBY)$(EXEEXT) \
- program
+ $(Q) $(MAKE) $(MFLAGS) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
capi: $(CAPIOUT)/.timestamp PHONY
$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
$(Q) $(MAKEDIRS) "$(@D)"
$(ECHO) generating capi
-$(Q) $(DOXYGEN) -b
- $(Q) $(MINIRUBY) -e 'File.open(ARGV[0], "w"){'"|f|"' f.puts(Time.now)}' "$@"
+ $(Q) $(MINIRUBY) -e 'File.open(ARGV[0], "w"){|f| f.puts(Time.now)}' "$@"
Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
$(ECHO) generating $@
$(Q) $(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ $(srcdir)/template/Doxyfile.tmpl \
--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): $(LIBRUBY_A_OBJS) $(MAINOBJ) $(INITOBJS) $(ARCHFILE)
+$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DTRACE_OBJ) $(DTRACE_GLOMMED_OBJ) $(DMYEXT) $(ARCHFILE)
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
@@ -296,7 +227,7 @@ $(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
ruby.imp: $(COMMONOBJS)
$(Q)$(NM) -Pgp $(COMMONOBJS) | \
- awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|ruby_static_id_|.*_threadptr_|rb_ec_\.)/{print $$1}' | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
sort -u -o $@
install: install-$(INSTALLDOC)
@@ -489,11 +420,7 @@ post-install-gem::
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)" $(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)" $(RDOCFLAGS) "$(srcdir)"
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --op "$(RDOCOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
rdoc-coverage: PHONY main
@echo Generating RDoc coverage report
@@ -526,13 +453,12 @@ install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake sudo-precheck PHONY
clear-installed-list: PHONY
@> $(INSTALLED_LIST) set MAKE="$(MAKE)"
-clean: clean-ext clean-enc clean-golf clean-docs clean-extout clean-local clean-platform clean-spec
+clean: clean-ext clean-local clean-enc clean-golf clean-rdoc clean-capi clean-extout 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) 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
+ $(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) GNUmakefile.old Makefile.old $(arch)-fake.rb
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
@@ -541,91 +467,44 @@ 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
-$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || exit 0
-clean-docs: clean-rdoc clean-html clean-capi
-clean-spec: PHONY
-clean-rubyspec: clean-spec
+clean-docs: clean-rdoc clean-capi
-distclean: distclean-ext distclean-enc distclean-golf distclean-docs distclean-extout distclean-local distclean-platform distclean-spec
+distclean: distclean-ext distclean-local distclean-enc distclean-golf distclean-extout distclean-platform
distclean-local:: clean-local
- $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(PRELUDES)
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc
$(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
-distclean-rdoc: clean-rdoc
-distclean-html: clean-html
-distclean-capi: clean-capi
-distclean-docs: clean-docs
+ $(Q)$(RM) $(GOLFPRELUDES)
+distclean-rdoc: PHONY
+distclean-capi: PHONY
distclean-extout: clean-extout
distclean-platform: clean-platform
-distclean-spec: clean-spec
-distclean-rubyspec: distclean-spec
realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
realclean-local:: distclean-local
- $(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 aclocal.m4 tool/config.guess tool/config.sub gems/*.gem
+ $(Q)$(RM) parse.c parse.h lex.c newline.c miniprelude.c revision.h
realclean-ext:: PHONY
realclean-golf: distclean-golf
- $(Q)$(RM) $(GOLFPRELUDES)
-realclean-rdoc: distclean-rdoc
-realclean-html: distclean-html
-realclean-capi: distclean-capi
-realclean-docs: distclean-docs
+realclean-capi: PHONY
realclean-extout: distclean-extout
-realclean-platform: distclean-platform
-realclean-spec: distclean-spec
-realclean-rubyspec: realclean-spec
-
-clean-ext:: ext/clean gems/clean timestamp/clean
-distclean-ext:: ext/distclean gems/distclean timestamp/distclean
-realclean-ext:: ext/realclean gems/realclean timestamp/realclean
-
-ext/clean.mk ext/distclean.mk ext/realclean.mk::
-ext/clean gems/clean:: ext/clean.mk
-ext/distclean gems/distclean:: ext/distclean.mk
-ext/realclean gems/realclean:: ext/realclean.mk
-timestamp/clean:: ext/clean gems/clean
-timestamp/distclean:: ext/distclean gems/distclean
-timestamp/realclean:: ext/realclean gems/realclean
-
-timestamp/clean timestamp/distclean timestamp/realclean::
- $(Q)$(RM) $(TIMESTAMPDIR)/.*.time $(TIMESTAMPDIR)/$(arch)/.time
- $(Q)$(RMDIRS) $(TIMESTAMPDIR)/$(arch) 2> $(NULL) || exit 0
-
-clean-ext::
- -$(Q)$(RM) ext/extinit.$(OBJEXT)
-
-distclean-ext realclean-ext::
- -$(Q)$(RM) $(EXTS_MK) ext/extinit.* ext/configure-ext.mk
- -$(Q)$(RMDIR) ext 2> $(NULL) || exit 0
+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
-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)
@@ -634,103 +513,62 @@ clean-platform:
$(Q) $(RM) $(PLATFORM_D)
-$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || exit 0
-RUBYSPEC_CAPIEXT = spec/ruby/optional/capi/ext
-clean-spec: PHONY
- -$(Q) $(RM) $(RUBYSPEC_CAPIEXT)/*.$(OBJEXT) $(RUBYSPEC_CAPIEXT)/*.$(DLEXT)
- -$(Q) $(RMDIRS) $(RUBYSPEC_CAPIEXT) 2> $(NULL) || exit 0
-
-check: main test test-testframework test-almost
+check: main test test-all
$(ECHO) check succeeded
check-ruby: test test-ruby
fake: $(CROSS_COMPILING)-fake
yes-fake: $(arch)-fake.rb $(RBCONFIG) 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)"
+no-fake: PHONY
btest: $(TEST_RUNNABLE)-btest
no-btest: PHONY
yes-btest: fake miniruby$(EXEEXT) PHONY
- $(Q)$(exec) $(BOOTSTRAPRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(BTESTRUBY) $(RUN_OPTS)" $(OPTS) $(TESTOPTS)
+ $(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)$(exec) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
+ $(Q)$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib $(RUN_OPTS)" -q $(OPTS) $(TESTOPTS)
-test-basic: $(TEST_RUNNABLE)-test-basic
-no-test-basic: PHONY
-yes-test-basic: prog PHONY
- $(Q)$(exec) $(RUNRUBY) "$(srcdir)/basictest/runner.rb" --run-opt=$(RUN_OPTS) $(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)
test-knownbugs: test-knownbug
test-knownbug: $(TEST_RUNNABLE)-test-knownbug
no-test-knownbug: PHONY
yes-test-knownbug: prog PHONY
- -$(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
- $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
-no-test-testframework: PHONY
+ -$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) $(RUN_OPTS)" $(OPTS) $(TESTOPTS) $(srcdir)/KNOWNBUGS.rb
-test-sample: test-basic # backward compatibility for mswin-build
-test: btest-ruby test-knownbug test-basic
+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: programs PHONY
- $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(TESTS)
+yes-test-all: prog PHONY
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) $(TESTS)
TESTS_BUILD = mkmf
no-test-all: PHONY
- $(gnumake_recursive)$(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
-
-test-almost: $(TEST_RUNNABLE)-test-almost
-yes-test-almost: prog PHONY
- $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(srcdir)/test/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) $(EXCLUDE_TESTFRAMEWORK) $(TESTS)
-no-test-almost: PHONY
+ $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
test-ruby: $(TEST_RUNNABLE)-test-ruby
no-test-ruby: PHONY
yes-test-ruby: prog encs PHONY
- $(gnumake_recursive)$(RUNRUBY) "$(srcdir)/test/runner.rb" $(TEST_EXCLUDES) $(TESTOPTS) -- ruby -ext-
+ $(RUNRUBY) "$(srcdir)/test/runner.rb" -q $(TESTOPTS) -- ruby -ext-
extconf: $(PREP)
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
- $(Q)$(BOOTSTRAPRUBY) -n \
- -e 'BEGIN{version=ARGV.shift;mis=ARGV.dup}' \
- -e 'END{abort "UNICODE version mismatch: #{mis}" unless mis.empty?}' \
- -e '(mis.delete(ARGF.path); ARGF.close) if /ONIG_UNICODE_VERSION_STRING +"#{Regexp.quote(version)}"/o' \
- $(UNICODE_VERSION) $(UNICODE_DATA_HEADERS)
- $(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb \
- -arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
+$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
+ $(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) \
- -unicode_version=$(UNICODE_VERSION) \
- > rbconfig.tmp
- $(IFCHANGE) "--timestamp=$@" rbconfig.rb rbconfig.tmp
-
-test-rubyspec: test-spec
-yes-test-rubyspec: yes-test-spec
+ -so_name=$(RUBY_SO_NAME) rbconfig.rb
-test-spec-precheck: $(arch)-fake.rb programs
+test-rubyspec-precheck:
-test-spec: $(TEST_RUNNABLE)-test-spec
-yes-test-spec: test-spec-precheck
- $(gnumake_recursive)$(Q) \
- $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT) $(SPECOPTS)
-no-test-spec:
+test-rubyspec: test-rubyspec-precheck
+ $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
@@ -739,32 +577,32 @@ yes-runnable: PHONY
encs: enc trans
libencs: libenc libtrans
-encs enc trans libencs libenc libtrans: $(SHOWFLAGS) $(ENC_MK) $(LIBRUBY) $(PREP) PHONY
+encs enc trans libencs libenc libtrans: showflags $(ENC_MK) $(LIBRUBY) $(PREP) PHONY
$(ECHO) making $@
- $(Q) $(MAKE) $(MAKE_ENC) $@
+ $(Q) $(MAKE) -f $(ENC_MK) V="$(V)" \
+ RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" \
+ $(MFLAGS) $@
libenc enc: {$(VPATH)}encdb.h
libtrans trans: {$(VPATH)}transdb.h
-# Use MINIRUBY which loads fake.rb for cross compiling
$(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
- $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG) fake
+ $(srcdir)/enc/encinit.c.erb $(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(ECHO) generating $@
- $(Q) $(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" --builtin-transes="$(BUILTIN_TRANSOBJS)" --module$(ENCSTATIC) $(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-html clean-extout
+.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc 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-basic test-knownbug
+.PHONY: check test test-all btest btest-ruby test-sample test-knownbug
.PHONY: run runruby parse benchmark benchmark-each tbench gdb gdb-ruby
-.PHONY: update-mspec update-rubyspec test-rubyspec test-spec
-.PHONY: touch-unicode-files
+.PHONY: update-mspec update-rubyspec test-rubyspec
PHONY:
@@ -776,97 +614,284 @@ PHONY:
$(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
$(Q)$(YACC) -d $(YFLAGS) -o y.tab.c parse.tmp.y
$(Q)$(RM) parse.tmp.y
- $(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s|parse\.tmp\.[iy]|$(SRC_FILE)|" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
+ $(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
$(Q)$(MV) $@.new $@
$(Q)sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse.*\.y/d" y.tab.h > $(@:.c=.h)
$(Q)$(RM) y.tab.c y.tab.h
$(PLATFORM_D):
- $(Q) $(MAKEDIRS) $(PLATFORM_DIR) $(@D)
- @exit > $@
-
-exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT)
- $(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ $<
- $(Q) ./miniruby$(EXEEXT) \
- -e 'prog, dest = ARGV; dest += "/ruby"' \
- -e 'unless prog=="ruby"' \
- -e ' begin File.unlink(dest); rescue Errno::ENOENT; end' \
- -e ' File.symlink(prog, dest)' \
- -e 'end' \
- $(@F) $(@D)
-
-exe/.time:
- $(Q) $(MAKEDIRS) exe $(@D)
- @exit > $@
-
-$(BUILTIN_ENCOBJS) $(BUILTIN_TRANSOBJS): $(ENC_TRANS_D)
-
-$(ENC_TRANS_D):
- $(Q) $(MAKEDIRS) enc/trans $(@D)
- @exit > $@
-
-$(TIMESTAMPDIR)/$(arch)/.time:
- $(Q)$(MAKEDIRS) $(@D) $(EXTOUT)/$(arch)
+ $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
@exit > $@
###
CCAN_DIR = {$(VPATH)}ccan
+CCAN_LIST_INCLUDES = $(CCAN_DIR)/build_assert/build_assert.h \
+ $(CCAN_DIR)/check_type/check_type.h \
+ $(CCAN_DIR)/container_of/container_of.h \
+ $(CCAN_DIR)/list/list.h \
+ $(CCAN_DIR)/str/str.h
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 \
+ $(CCAN_LIST_INCLUDES)
###
acosh.$(OBJEXT): {$(VPATH)}acosh.c
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
-crypt.$(OBJEXT): {$(VPATH)}crypt.c {$(VPATH)}crypt.h {$(VPATH)}missing/des_tables.c
+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
+setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c {$(VPATH)}util.h $(RUBY_H_INCLUDES) $(hdrdir)/ruby.h
strchr.$(OBJEXT): {$(VPATH)}strchr.c
strdup.$(OBJEXT): {$(VPATH)}strdup.c
strerror.$(OBJEXT): {$(VPATH)}strerror.c
strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
strstr.$(OBJEXT): {$(VPATH)}strstr.c
+strtod.$(OBJEXT): {$(VPATH)}strtod.c
+strtol.$(OBJEXT): {$(VPATH)}strtol.c
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 $<
###
-# 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) \
- {$(VPATH)}vm.h $(PLATFORM_D)
-win32/file.$(OBJEXT): {$(VPATH)}win32/file.c {$(VPATH)}win32/file.h \
- $(RUBY_H_INCLUDES) $(PLATFORM_D)
+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 {$(VPATH)}id.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)}symbol.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 {$(VPATH)}gc.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)}id.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)}gc.h \
+ {$(VPATH)}regex.h $(ENCODING_H_INCLUDES) {$(VPATH)}internal.h \
+ $(PROBES_H_INCLUDES)
+struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
+symbol.$(OBJEXT): {$(VPATH)}symbol.c $(RUBY_H_INCLUDES) $(ENCODING_H_INCLUDES) \
+ {$(VPATH)}internal.h {$(VPATH)}node.h {$(VPATH)}id.h {$(VPATH)}symbol.h \
+ $(PROBES_H_INCLUDES)
+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 \
+ {$(VPATH)}util.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
+
+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)
$(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
-enc/trans/newline.$(OBJEXT): $(NEWLINE_C)
+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
-verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb
+verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb $(RBCONFIG)
$(ECHO) creating $@
- $(Q) $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
+ $(Q) $(MINIRUBY) "$(srcdir)/tool/generic_erb.rb" $(srcdir)/template/verconf.h.tmpl > $@
-ruby-glommed.$(OBJEXT): $(OBJS)
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ symbol.$(OBJEXT) \
+ vm.$(OBJEXT)
+
+probes.$(OBJEXT): $(DTRACE_DEPENDENT_OBJS)
+ruby-glommed.$(OBJEXT): $(OBJS) $(DTRACE_OBJ)
$(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
@@ -888,38 +913,20 @@ INSNS2VMOPT = --srcdir="$(srcdir)"
{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
-common-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}enc/trans/newline.c {$(VPATH)}id.c \
- srcs-lib srcs-ext incs
+srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c srcs-ext srcs-enc
-missing-srcs: $(srcdir)/missing/des_tables.c
-
-srcs: common-srcs missing-srcs srcs-enc
-
-EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \
- $(srcdir)/ext/rbconfig/sizeof/sizes.c \
- $(srcdir)/ext/rbconfig/sizeof/limits.c \
- $(srcdir)/ext/socket/constdefs.c \
- # EXT_SRCS
+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-ext: $(EXT_SRCS)
-srcs-extra: $(srcdir)/ext/json/parser/parser.c \
- $(srcdir)/ext/date/zonetab.h \
- $(empty)
-
-LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb
-
-srcs-lib: $(LIB_SRCS)
-
srcs-enc: $(ENC_MK)
$(ECHO) making srcs under enc
- $(Q) $(MAKE) $(MAKE_ENC) srcs
+ $(Q) $(MAKE) -f $(ENC_MK) RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
-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) \
- $(UNICODE_DATA_HEADERS) $(srcdir)/enc/jis/props.h \
+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 enc/jis/props.h \
{$(VPATH)}id.h {$(VPATH)}probes.dmyh
insns: $(INSNS)
@@ -952,91 +959,58 @@ 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
-vm_call_iseq_optimized.inc: $(srcdir)/tool/mk_call_iseq_optimized.rb
+$(MINIPRELUDE_C): $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/mk_call_iseq_optimized.rb > $@
+ $(Q) $(BASERUBY) -I$(srcdir) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
-$(MINIPRELUDE_C): $(COMPILE_PRELUDE)
+prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) \
+ $(srcdir)/lib/rubygems/defaults.rb \
+ $(srcdir)/lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(PREP)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
- $(srcdir)/template/prelude.c.tmpl
+ $(Q) $(COMPILE_PRELUDE) $(PRELUDE_SCRIPTS) $@
-$(PRELUDE_C): $(COMPILE_PRELUDE) \
- $(PRELUDE_SCRIPTS)
+golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude.rb $(srcdir)/golf_prelude.rb $(PREP)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
- $(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
+ $(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@
-{$(VPATH)}golf_prelude.c: $(COMPILE_PRELUDE) {$(srcdir)}golf_prelude.rb
- $(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
- $(srcdir)/template/prelude.c.tmpl golf_prelude.rb
-
-MAINCPPFLAGS = $(ENABLE_DEBUG_ENV:yes=-DRUBY_DEBUG_ENV=1)
-
-$(MAINOBJ): $(srcdir)/$(MAINSRC)
- $(ECHO) compiling $(srcdir)/$(MAINSRC)
- $(Q) $(CC) $(MAINCPPFLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(srcdir)/$(MAINSRC)
-
-{$(VPATH)}probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
-
-probes.dmyh:
+probes.dmyh: {$(srcdir)}probes.d $(srcdir)/tool/gen_dummy_probes.rb
$(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@
probes.h: {$(VPATH)}probes.$(DTRACE_EXT)
prereq: incs srcs preludes PHONY
-preludes: {$(VPATH)}prelude.c
preludes: {$(VPATH)}miniprelude.c
preludes: {$(srcdir)}golf_prelude.c
$(srcdir)/revision.h:
@exit > $@
-$(REVISION_H): $(srcdir)/version.h $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
- -$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb -q --revision.h "$(srcdir)" > revision.tmp
+$(REVISION_H): $(srcdir)/version.h $(srcdir)/ChangeLog $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
+ -$(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb --revision.h "$(srcdir)" > revision.tmp
$(Q)$(IFCHANGE) "--timestamp=$@" "$(srcdir)/revision.h" revision.tmp
-$(srcdir)/ext/ripper/ripper.c: $(srcdir)/parse.y id.h
+$(srcdir)/ext/ripper/ripper.c: parse.y id.h
$(ECHO) generating $@
- $(Q) VPATH=$${PWD-`pwd`} && $(CHDIR) $(@D) && \
- sed /AUTOGENERATED/q depend | \
- $(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$${VPATH}" \
- RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. 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) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)"
-$(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list
+$(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 prereq.mk $(mflags) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. BASERUBY="$(BASERUBY)"
+ $(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.ac
+ $(srcdir)/tool/generic_erb.rb $(srcdir)/template/sizes.c.tmpl $(srcdir)/configure.in
$(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && \
- sed '/AUTOGENERATED/q' depend | \
- $(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
-
-$(srcdir)/ext/rbconfig/sizeof/limits.c: $(srcdir)/ext/rbconfig/sizeof/depend \
- $(srcdir)/tool/generic_erb.rb $(srcdir)/template/limits.c.tmpl
- $(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && \
- sed '/AUTOGENERATED/q' depend | \
- $(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
-
-$(srcdir)/ext/socket/constdefs.c: $(srcdir)/ext/socket/depend
- $(Q) $(CHDIR) $(@D) && \
- sed '/AUTOGENERATED/q' depend | \
- $(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)"
##
@@ -1047,7 +1021,7 @@ runruby: $(PROGRAM) PHONY
$(RUNRUBY) $(TESTRUN_SCRIPT)
parse: fake miniruby$(EXEEXT) PHONY
- $(BTESTRUBY) --dump=parsetree_with_comment,insns $(TESTRUN_SCRIPT)
+ $(BTESTRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT)
bisect: PHONY
$(srcdir)/tool/bisect.sh miniruby $(srcdir)
@@ -1059,24 +1033,19 @@ 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: miniruby$(EXEEXT) PHONY
+benchmark: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY) -I$(srcdir)/lib -I. -I$(EXTOUT)/common --disable-gem; built-ruby::$(MINIRUBY) --disable-gem" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
-benchmark-each: miniruby$(EXEEXT) PHONY
+benchmark-each: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY) -I$(srcdir)/lib -I. -I$(EXTOUT)/common --disable-gem; built-ruby::$(MINIRUBY) --disable-gem" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
-tbench: miniruby$(EXEEXT) PHONY
+tbench: $(PROGRAM) PHONY
$(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
- --executables="$(COMPARE_RUBY) -I$(srcdir)/lib -I. -I$(EXTOUT)/common --disable-gem; built-ruby::$(MINIRUBY) --disable-gem" \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
--pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
run.gdb:
@@ -1100,1834 +1069,70 @@ gdb: miniruby$(EXEEXT) run.gdb PHONY
gdb-ruby: $(PROGRAM) run.gdb PHONY
$(Q) $(RUNRUBY_COMMAND) $(RUNRUBY_DEBUGGER) -- $(TESTRUN_SCRIPT)
-LLDB_INIT = command script import -r $(srcdir)/misc/lldb_cruby.py
-
-lldb: miniruby$(EXEEXT) PHONY
- lldb -o '$(LLDB_INIT)' miniruby$(EXEEXT) -- $(TESTRUN_SCRIPT)
-
-lldb-ruby: $(PROGRAM) PHONY
- lldb $(enable_shared:yes=-o 'target modules add ${LIBRUBY_SO}') -o '$(LLDB_INIT)' $(PROGRAM) -- $(TESTRUN_SCRIPT)
-
-DISTPKGS = gzip,zip,all
dist:
- $(BASERUBY) $(srcdir)/tool/make-snapshot \
- -srcdir=$(srcdir) -packages=$(DISTPKGS) \
- -unicode-version=$(UNICODE_VERSION) \
- tmp $(RELNAME)
-
-up:: update-remote
+ $(BASERUBY) $(srcdir)/tool/make-snapshot tmp $(RELNAME)
up::
- -$(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
+ -$(Q)$(MAKE) $(MFLAGS) REVISION_FORCE=PHONY "$(REVISION_H)"
-up::
- -$(Q)$(MAKE) $(mflags) Q=$(Q) after-update
-
-after-update:: extract-extlibs
-
-update-remote:: update-src update-download
-update-download:: update-unicode update-gems download-extlibs
-
-update-mspec:
-update-rubyspec:
-
-update-config_files: PHONY
- $(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb -d tool -e gnu \
- config.guess config.sub
-
-update-gems: PHONY
- $(ECHO) Downloading bundled gem files...
- $(Q) $(BASERUBY) -C "$(srcdir)" \
- -I./tool -rdownloader -answ \
- -e 'gem, ver = *$$F' \
- -e 'old = Dir.glob("gems/#{gem}-*.gem")' \
- -e 'gem = "#{gem}-#{ver}.gem"' \
- -e 'Downloader::RubyGems.download(gem, "gems", nil) and' \
- -e '(old.delete("gems/#{gem}"); !old.empty?) and' \
- -e 'File.unlink(*old) and' \
- -e 'FileUtils.rm_rf(old.map{'"|n|"'n.chomp(".gem")})' \
- gems/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-bundled_gems: PHONY
- $(Q) $(RUNRUBY) -rrubygems \
- -pla \
- -e '$$_=Gem::SpecFetcher.fetcher.detect(:latest) {'"|s|" \
- -e 'if s.platform=="ruby"&&s.name==$$F[0]' \
- -e 'break [s.name, s.version, *$$F[2..-1]].join(" ")' \
- -e 'end' \
- -e '}' \
- "$(srcdir)/gems/bundled_gems" | \
- "$(IFCHANGE)" "$(srcdir)/gems/bundled_gems" -
-
-test-bundled-gems-precheck: $(arch)-fake.rb programs
-
-test-bundled-gems-fetch: $(PREP)
- $(Q) $(BASERUBY) -C $(srcdir)/gems ../tool/fetch-bundled_gems.rb src bundled_gems
-
-test-bundled-gems-prepare: test-bundled-gems-precheck test-bundled-gems-fetch
- $(XRUBY) -C "$(srcdir)" bin/gem install --no-ri --no-rdoc \
- --install-dir .bundle --conservative "bundler" "minitest:~> 5" 'test-unit' 'rake' 'hoe' 'yard' 'pry' 'packnga'
-
-PREPARE_BUNDLED_GEMS = test-bundled-gems-prepare
-test-bundled-gems: $(TEST_RUNNABLE)-test-bundled-gems
-yes-test-bundled-gems: test-bundled-gems-run
-no-test-bundled-gems:
-test-bundled-gems-run: $(PREPARE_BUNDLED_GEMS)
-
-UNICODE_FILES = $(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
- $(UNICODE_SRC_DATA_DIR)/CompositionExclusions.txt \
- $(UNICODE_SRC_DATA_DIR)/NormalizationTest.txt \
- $(UNICODE_SRC_DATA_DIR)/CaseFolding.txt \
- $(UNICODE_SRC_DATA_DIR)/SpecialCasing.txt \
- $(empty)
-
-UNICODE_PROPERTY_FILES = \
- $(UNICODE_SRC_DATA_DIR)/Blocks.txt \
- $(UNICODE_SRC_DATA_DIR)/DerivedAge.txt \
- $(UNICODE_SRC_DATA_DIR)/DerivedCoreProperties.txt \
- $(UNICODE_SRC_DATA_DIR)/PropList.txt \
- $(UNICODE_SRC_DATA_DIR)/PropertyAliases.txt \
- $(UNICODE_SRC_DATA_DIR)/PropertyValueAliases.txt \
- $(UNICODE_SRC_DATA_DIR)/Scripts.txt \
- $(UNICODE_SRC_DATA_DIR)/auxiliary/GraphemeBreakProperty.txt \
- $(empty)
-
-UNICODE_EMOJI_FILES = \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-data.txt \
- $(empty)
-
-update-unicode: $(UNICODE_FILES)
-
-CACHE_DIR = $(srcdir)/.downloaded-cache
-UNICODE_DOWNLOAD = \
- $(BASERUBY) $(srcdir)/tool/downloader.rb \
- --cache-dir=$(CACHE_DIR) \
- -d $(UNICODE_SRC_DATA_DIR) \
- -p $(UNICODE_VERSION)/ucd \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
-UNICODE_EMOJI_DOWNLOAD = \
- $(BASERUBY) $(srcdir)/tool/downloader.rb \
- --cache-dir=$(CACHE_DIR) \
- -d $(UNICODE_SRC_EMOJI_DATA_DIR) \
- -p emoji/$(UNICODE_EMOJI_VERSION) \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
-
-$(UNICODE_PROPERTY_FILES): update-unicode-property-files
-update-unicode-property-files:
- $(ECHO) Downloading Unicode $(UNICODE_VERSION) property files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_DATA_DIR)/auxiliary"
- $(Q) $(UNICODE_DOWNLOAD) $(UNICODE_PROPERTY_FILES)
- $(ECHO) Downloading Unicode emoji $(UNICODE_EMOJI_VERSION) files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_EMOJI_DATA_DIR)"
- $(Q) $(UNICODE_EMOJI_DOWNLOAD) $(UNICODE_EMOJI_FILES)
-
-$(UNICODE_FILES): update-unicode-files
-update-unicode-files:
- $(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_DATA_DIR)"
- $(Q) $(UNICODE_DOWNLOAD) $(UNICODE_FILES)
-
-$(srcdir)/$(HAVE_BASERUBY:yes=lib/unicode_normalize/tables.rb): \
- $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time
-
-$(UNICODE_SRC_DATA_DIR)/$(ALWAYS_UPDATE_UNICODE:yes=.unicode-tables.time): \
- $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
-
-touch-unicode-files:
- $(MAKEDIRS) $(UNICODE_SRC_DATA_DIR)
- touch $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time $(UNICODE_DATA_HEADERS)
-
-$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
- $(srcdir)/template/unicode_norm_gen.tmpl \
- $(ALWAYS_UPDATE_UNICODE:yes=update-unicode)
- $(Q) $(MAKE) $(@D)
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
- -c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
- -I $(srcdir) \
- $(srcdir)/template/unicode_norm_gen.tmpl \
- $(UNICODE_DATA_DIR) lib/unicode_normalize
-
-$(UNICODE_SRC_DATA_DIR):
- $(Q) $(exec) $(MAKEDIRS) $@ || exit && echo $(MAKE)
-
-$(UNICODE_HDR_DIR)/$(ALWAYS_UPDATE_UNICODE:yes=name2ctype.h): \
- $(srcdir)/tool/enc-unicode.rb \
- $(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
- $(UNICODE_PROPERTY_FILES)
-
-$(UNICODE_HDR_DIR)/name2ctype.h:
- $(MAKEDIRS) $(@D)
- $(BOOTSTRAPRUBY) $(srcdir)/tool/enc-unicode.rb --header \
- $(UNICODE_SRC_DATA_DIR) $(UNICODE_SRC_EMOJI_DATA_DIR) > $@.new
- $(MV) $@.new $@
-
-# the next non-comment line was:
-# $(UNICODE_HDR_DIR)/casefold.h: $(srcdir)/enc/unicode/case-folding.rb \
-# but was changed to make sure CI works on systems that don't have gperf
-unicode-up: $(UNICODE_DATA_HEADERS)
-
-$(UNICODE_HDR_DIR)/$(ALWAYS_UPDATE_UNICODE:yes=casefold.h): \
- $(srcdir)/enc/unicode/case-folding.rb \
- $(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
- $(UNICODE_SRC_DATA_DIR)/SpecialCasing.txt \
- $(UNICODE_SRC_DATA_DIR)/CaseFolding.txt
-
-$(UNICODE_HDR_DIR)/casefold.h:
- $(MAKEDIRS) $(@D)
- $(Q) $(BASERUBY) $(srcdir)/enc/unicode/case-folding.rb \
- --output-file=$@ \
- --mapping-data-directory=$(UNICODE_SRC_DATA_DIR)
-
-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
+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)
info: info-program info-libruby_a info-libruby_so info-arch
-info-program: PHONY
+info-program:
@echo PROGRAM=$(PROGRAM)
-info-libruby_a: PHONY
+info-libruby_a:
@echo LIBRUBY_A=$(LIBRUBY_A)
-info-libruby_so: PHONY
+info-libruby_so:
@echo LIBRUBY_SO=$(LIBRUBY_SO)
-info-arch: PHONY
+info-arch:
@echo arch=$(arch)
change: PHONY
$(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
-exam: check test-spec
-
-love: sudo-precheck up all test exam install
+love: sudo-precheck up all test install test-all
@echo love is all you need
-great: exam
-
-yes-test-all no-test-all: sudo-precheck
+yes-test-all: sudo-precheck
-sudo-precheck: PHONY
+sudo-precheck:
@$(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" \
"" \
"targets:" \
- " all (default): builds all of below" \
- " miniruby: builds only miniruby" \
- " encs: builds encodings" \
- " exts: builds extensions" \
- " main: builds encodings, extensions and ruby" \
- " docs: builds documents" \
- " install-capi: builds C API documents" \
- " run: runs test.rb by miniruby" \
- " runruby: runs test.rb by ruby you just built" \
- " 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-spec" \
- " test: ruby core tests" \
- " test-all: all ruby tests [TESTOPTS=-j4 TESTS=<test files>]" \
- " test-spec: run the Ruby spec suite" \
- " test-rubyspec: same as test-spec" \
- " test-bundled-gems: run the test suite of bundled gems" \
- " up: update local copy and autogenerated files" \
- " 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" \
- " install-nodoc: install without rdoc" \
- " install-cross: install cross compiling stuff" \
- " clean: clean for tarball" \
- " distclean: clean for repository" \
- " change: make change log template" \
- " golf: for golfers" \
+ " all (default): builds all of below" \
+ " miniruby: builds only miniruby" \
+ " encs: builds encodings" \
+ " exts: builds extensions" \
+ " main: builds encodings, extensions and ruby" \
+ " docs: builds documents" \
+ " run: runs test.rb by miniruby" \
+ " runruby: runs test.rb by ruby you just built" \
+ " gdb: runs test.rb by miniruby under gdb" \
+ " gdb-ruby: runs test.rb by ruby under gdb" \
+ " check: equals make test test-all" \
+ " test: ruby core tests" \
+ " test-all: all ruby tests [TESTS=<test files>]" \
+ " test-rubyspec: run RubySpec test suite" \
+ " update-rubyspec: update local copy of RubySpec" \
+ " 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" \
+ " install-nodoc: install without rdoc" \
+ " install-cross: install cross compiling staff" \
+ " clean: clean for tarball" \
+ " distclean: clean for repository" \
+ " change: make change log template" \
+ " golf: for golfers" \
"" \
"see DeveloperHowto for more detail: " \
" 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)}debug_counter.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)}onigmo.h
-array.$(OBJEXT): {$(VPATH)}oniguruma.h
-array.$(OBJEXT): {$(VPATH)}probes.dmyh
-array.$(OBJEXT): {$(VPATH)}probes.h
-array.$(OBJEXT): {$(VPATH)}ruby_assert.h
-array.$(OBJEXT): {$(VPATH)}st.h
-array.$(OBJEXT): {$(VPATH)}subst.h
-array.$(OBJEXT): {$(VPATH)}util.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)}id.h
-bignum.$(OBJEXT): {$(VPATH)}intern.h
-bignum.$(OBJEXT): {$(VPATH)}internal.h
-bignum.$(OBJEXT): {$(VPATH)}io.h
-bignum.$(OBJEXT): {$(VPATH)}missing.h
-bignum.$(OBJEXT): {$(VPATH)}onigmo.h
-bignum.$(OBJEXT): {$(VPATH)}oniguruma.h
-bignum.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-class.$(OBJEXT): {$(VPATH)}oniguruma.h
-class.$(OBJEXT): {$(VPATH)}ruby_assert.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)}id.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): $(hdrdir)/ruby/version.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)}id_table.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)}onigmo.h
-compile.$(OBJEXT): {$(VPATH)}oniguruma.h
-compile.$(OBJEXT): {$(VPATH)}opt_sc.inc
-compile.$(OBJEXT): {$(VPATH)}optinsn.inc
-compile.$(OBJEXT): {$(VPATH)}optunifs.inc
-compile.$(OBJEXT): {$(VPATH)}re.h
-compile.$(OBJEXT): {$(VPATH)}regex.h
-compile.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-complex.$(OBJEXT): {$(VPATH)}oniguruma.h
-complex.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-cont.$(OBJEXT): {$(VPATH)}oniguruma.h
-cont.$(OBJEXT): {$(VPATH)}ruby_assert.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)}gc.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)}onigmo.h
-debug.$(OBJEXT): {$(VPATH)}oniguruma.h
-debug.$(OBJEXT): {$(VPATH)}ruby_assert.h
-debug.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-debug.$(OBJEXT): {$(VPATH)}st.h
-debug.$(OBJEXT): {$(VPATH)}subst.h
-debug.$(OBJEXT): {$(VPATH)}symbol.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
-debug_counter.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-debug_counter.$(OBJEXT): $(top_srcdir)/include/ruby.h
-debug_counter.$(OBJEXT): {$(VPATH)}config.h
-debug_counter.$(OBJEXT): {$(VPATH)}debug_counter.c
-debug_counter.$(OBJEXT): {$(VPATH)}debug_counter.h
-debug_counter.$(OBJEXT): {$(VPATH)}defines.h
-debug_counter.$(OBJEXT): {$(VPATH)}encoding.h
-debug_counter.$(OBJEXT): {$(VPATH)}intern.h
-debug_counter.$(OBJEXT): {$(VPATH)}internal.h
-debug_counter.$(OBJEXT): {$(VPATH)}io.h
-debug_counter.$(OBJEXT): {$(VPATH)}missing.h
-debug_counter.$(OBJEXT): {$(VPATH)}onigmo.h
-debug_counter.$(OBJEXT): {$(VPATH)}oniguruma.h
-debug_counter.$(OBJEXT): {$(VPATH)}st.h
-debug_counter.$(OBJEXT): {$(VPATH)}subst.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)}onigmo.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): $(UNICODE_HDR_DIR)/casefold.h
-enc/unicode.$(OBJEXT): $(UNICODE_HDR_DIR)/name2ctype.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)}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)}onigmo.h
-encoding.$(OBJEXT): {$(VPATH)}oniguruma.h
-encoding.$(OBJEXT): {$(VPATH)}regenc.h
-encoding.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-enum.$(OBJEXT): {$(VPATH)}oniguruma.h
-enum.$(OBJEXT): {$(VPATH)}st.h
-enum.$(OBJEXT): {$(VPATH)}subst.h
-enum.$(OBJEXT): {$(VPATH)}symbol.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)}onigmo.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)}onigmo.h
-error.$(OBJEXT): {$(VPATH)}oniguruma.h
-error.$(OBJEXT): {$(VPATH)}ruby_assert.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): $(hdrdir)/ruby/version.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)}onigmo.h
-eval.$(OBJEXT): {$(VPATH)}oniguruma.h
-eval.$(OBJEXT): {$(VPATH)}probes.dmyh
-eval.$(OBJEXT): {$(VPATH)}probes.h
-eval.$(OBJEXT): {$(VPATH)}probes_helper.h
-eval.$(OBJEXT): {$(VPATH)}ruby_assert.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
-explicit_bzero.$(OBJEXT): {$(VPATH)}config.h
-explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
-explicit_bzero.$(OBJEXT): {$(VPATH)}missing.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)}id.h
-file.$(OBJEXT): {$(VPATH)}intern.h
-file.$(OBJEXT): {$(VPATH)}internal.h
-file.$(OBJEXT): {$(VPATH)}io.h
-file.$(OBJEXT): {$(VPATH)}missing.h
-file.$(OBJEXT): {$(VPATH)}onigmo.h
-file.$(OBJEXT): {$(VPATH)}oniguruma.h
-file.$(OBJEXT): {$(VPATH)}st.h
-file.$(OBJEXT): {$(VPATH)}subst.h
-file.$(OBJEXT): {$(VPATH)}thread.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)}debug_counter.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)}onigmo.h
-gc.$(OBJEXT): {$(VPATH)}oniguruma.h
-gc.$(OBJEXT): {$(VPATH)}probes.dmyh
-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_assert.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): $(hdrdir)/ruby/version.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)}iseq.h
-golf_prelude.$(OBJEXT): {$(VPATH)}method.h
-golf_prelude.$(OBJEXT): {$(VPATH)}missing.h
-golf_prelude.$(OBJEXT): {$(VPATH)}node.h
-golf_prelude.$(OBJEXT): {$(VPATH)}onigmo.h
-golf_prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
-golf_prelude.$(OBJEXT): {$(VPATH)}ruby_assert.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)}backward.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)}onigmo.h
-hash.$(OBJEXT): {$(VPATH)}oniguruma.h
-hash.$(OBJEXT): {$(VPATH)}probes.dmyh
-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
-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)}onigmo.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)}onigmo.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): $(hdrdir)/ruby/version.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)}id_table.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)}onigmo.h
-iseq.$(OBJEXT): {$(VPATH)}oniguruma.h
-iseq.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-load.$(OBJEXT): {$(VPATH)}oniguruma.h
-load.$(OBJEXT): {$(VPATH)}probes.dmyh
-load.$(OBJEXT): {$(VPATH)}probes.h
-load.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.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)}backward.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)}onigmo.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)}onigmo.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)}onigmo.h
-miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
-miniinit.$(OBJEXT): {$(VPATH)}st.h
-miniinit.$(OBJEXT): {$(VPATH)}subst.h
-miniprelude.$(OBJEXT): $(hdrdir)/ruby/version.h
-miniprelude.$(OBJEXT): {$(VPATH)}iseq.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)}onigmo.h
-node.$(OBJEXT): {$(VPATH)}oniguruma.h
-node.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-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)}onigmo.h
-object.$(OBJEXT): {$(VPATH)}oniguruma.h
-object.$(OBJEXT): {$(VPATH)}probes.dmyh
-object.$(OBJEXT): {$(VPATH)}probes.h
-object.$(OBJEXT): {$(VPATH)}st.h
-object.$(OBJEXT): {$(VPATH)}subst.h
-object.$(OBJEXT): {$(VPATH)}util.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)}onigmo.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)}onigmo.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.dmyh
-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
-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): $(hdrdir)/ruby/version.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)}iseq.h
-prelude.$(OBJEXT): {$(VPATH)}method.h
-prelude.$(OBJEXT): {$(VPATH)}missing.h
-prelude.$(OBJEXT): {$(VPATH)}node.h
-prelude.$(OBJEXT): {$(VPATH)}onigmo.h
-prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
-prelude.$(OBJEXT): {$(VPATH)}prelude.c
-prelude.$(OBJEXT): {$(VPATH)}ruby_assert.h
-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): $(hdrdir)/ruby/version.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)}onigmo.h
-proc.$(OBJEXT): {$(VPATH)}oniguruma.h
-proc.$(OBJEXT): {$(VPATH)}proc.c
-proc.$(OBJEXT): {$(VPATH)}ruby_assert.h
-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)}onigmo.h
-process.$(OBJEXT): {$(VPATH)}oniguruma.h
-process.$(OBJEXT): {$(VPATH)}process.c
-process.$(OBJEXT): {$(VPATH)}ruby_assert.h
-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)}onigmo.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)}onigmo.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)}id.h
-rational.$(OBJEXT): {$(VPATH)}intern.h
-rational.$(OBJEXT): {$(VPATH)}internal.h
-rational.$(OBJEXT): {$(VPATH)}io.h
-rational.$(OBJEXT): {$(VPATH)}missing.h
-rational.$(OBJEXT): {$(VPATH)}onigmo.h
-rational.$(OBJEXT): {$(VPATH)}oniguruma.h
-rational.$(OBJEXT): {$(VPATH)}rational.c
-rational.$(OBJEXT): {$(VPATH)}ruby_assert.h
-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)}onigmo.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)}onigmo.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)}onigmo.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)}onigmo.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)}onigmo.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)}onigmo.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)}onigmo.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-runner.$(OBJEXT): {$(VPATH)}ruby-runner.c
-ruby-runner.$(OBJEXT): {$(VPATH)}ruby-runner.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)}onigmo.h
-ruby.$(OBJEXT): {$(VPATH)}oniguruma.h
-ruby.$(OBJEXT): {$(VPATH)}ruby.c
-ruby.$(OBJEXT): {$(VPATH)}ruby_assert.h
-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)}onigmo.h
-safe.$(OBJEXT): {$(VPATH)}oniguruma.h
-safe.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.h
-signal.$(OBJEXT): {$(VPATH)}oniguruma.h
-signal.$(OBJEXT): {$(VPATH)}ruby_assert.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)}onigmo.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)}onigmo.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): $(top_srcdir)/include/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)}internal.h
-strftime.$(OBJEXT): {$(VPATH)}io.h
-strftime.$(OBJEXT): {$(VPATH)}missing.h
-strftime.$(OBJEXT): {$(VPATH)}onigmo.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)}crypt.h
-string.$(OBJEXT): {$(VPATH)}debug_counter.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)}onigmo.h
-string.$(OBJEXT): {$(VPATH)}oniguruma.h
-string.$(OBJEXT): {$(VPATH)}probes.dmyh
-string.$(OBJEXT): {$(VPATH)}probes.h
-string.$(OBJEXT): {$(VPATH)}re.h
-string.$(OBJEXT): {$(VPATH)}regex.h
-string.$(OBJEXT): {$(VPATH)}ruby_assert.h
-string.$(OBJEXT): {$(VPATH)}st.h
-string.$(OBJEXT): {$(VPATH)}string.c
-string.$(OBJEXT): {$(VPATH)}subst.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)}onigmo.h
-struct.$(OBJEXT): {$(VPATH)}oniguruma.h
-struct.$(OBJEXT): {$(VPATH)}ruby_assert.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)}id_table.c
-symbol.$(OBJEXT): {$(VPATH)}id_table.h
-symbol.$(OBJEXT): {$(VPATH)}intern.h
-symbol.$(OBJEXT): {$(VPATH)}internal.h
-symbol.$(OBJEXT): {$(VPATH)}io.h
-symbol.$(OBJEXT): {$(VPATH)}missing.h
-symbol.$(OBJEXT): {$(VPATH)}onigmo.h
-symbol.$(OBJEXT): {$(VPATH)}oniguruma.h
-symbol.$(OBJEXT): {$(VPATH)}probes.dmyh
-symbol.$(OBJEXT): {$(VPATH)}probes.h
-symbol.$(OBJEXT): {$(VPATH)}ruby_assert.h
-symbol.$(OBJEXT): {$(VPATH)}st.h
-symbol.$(OBJEXT): {$(VPATH)}subst.h
-symbol.$(OBJEXT): {$(VPATH)}symbol.c
-symbol.$(OBJEXT): {$(VPATH)}symbol.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)}onigmo.h
-thread.$(OBJEXT): {$(VPATH)}oniguruma.h
-thread.$(OBJEXT): {$(VPATH)}ruby_assert.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)}id.h
-time.$(OBJEXT): {$(VPATH)}intern.h
-time.$(OBJEXT): {$(VPATH)}internal.h
-time.$(OBJEXT): {$(VPATH)}io.h
-time.$(OBJEXT): {$(VPATH)}missing.h
-time.$(OBJEXT): {$(VPATH)}onigmo.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)}onigmo.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)}onigmo.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): $(CCAN_DIR)/check_type/check_type.h
-variable.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-variable.$(OBJEXT): $(CCAN_DIR)/list/list.h
-variable.$(OBJEXT): $(CCAN_DIR)/str/str.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)}debug_counter.h
-variable.$(OBJEXT): {$(VPATH)}defines.h
-variable.$(OBJEXT): {$(VPATH)}encoding.h
-variable.$(OBJEXT): {$(VPATH)}id.h
-variable.$(OBJEXT): {$(VPATH)}id_table.h
-variable.$(OBJEXT): {$(VPATH)}intern.h
-variable.$(OBJEXT): {$(VPATH)}internal.h
-variable.$(OBJEXT): {$(VPATH)}io.h
-variable.$(OBJEXT): {$(VPATH)}missing.h
-variable.$(OBJEXT): {$(VPATH)}onigmo.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): $(hdrdir)/ruby/version.h
-vm.$(OBJEXT): $(top_srcdir)/include/ruby.h
-vm.$(OBJEXT): {$(VPATH)}config.h
-vm.$(OBJEXT): {$(VPATH)}constant.h
-vm.$(OBJEXT): {$(VPATH)}debug_counter.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)}onigmo.h
-vm.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm.$(OBJEXT): {$(VPATH)}probes.dmyh
-vm.$(OBJEXT): {$(VPATH)}probes.h
-vm.$(OBJEXT): {$(VPATH)}probes_helper.h
-vm.$(OBJEXT): {$(VPATH)}ruby_assert.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_args.c
-vm.$(OBJEXT): {$(VPATH)}vm_call_iseq_optimized.inc
-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): $(hdrdir)/ruby/version.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)}onigmo.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}ruby_assert.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_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): $(hdrdir)/ruby/version.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)}onigmo.h
-vm_dump.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_dump.$(OBJEXT): {$(VPATH)}ruby_assert.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)}iseq.h
-vm_trace.$(OBJEXT): {$(VPATH)}method.h
-vm_trace.$(OBJEXT): {$(VPATH)}missing.h
-vm_trace.$(OBJEXT): {$(VPATH)}node.h
-vm_trace.$(OBJEXT): {$(VPATH)}onigmo.h
-vm_trace.$(OBJEXT): {$(VPATH)}oniguruma.h
-vm_trace.$(OBJEXT): {$(VPATH)}ruby_assert.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 02529c9960..81dff38f49 100644
--- a/compar.c
+++ b/compar.c
@@ -10,22 +10,17 @@
**********************************************************************/
#include "ruby/ruby.h"
-#include "id.h"
VALUE rb_mComparable;
-static VALUE
-rb_cmp(VALUE x, VALUE y)
-{
- return rb_funcallv(x, idCmp, 1, &y);
-}
+static ID cmp;
void
rb_cmperr(VALUE x, VALUE y)
{
VALUE classname;
- if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
+ if (SPECIAL_CONST_P(y)) {
classname = rb_inspect(y);
}
else {
@@ -39,7 +34,7 @@ static VALUE
invcmp_recursive(VALUE x, VALUE y, int recursive)
{
if (recursive) return Qnil;
- return rb_cmp(y, x);
+ return rb_check_funcall(y, cmp, 1, &x);
}
VALUE
@@ -59,7 +54,25 @@ static VALUE
cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
{
if (recursive) return Qnil;
- return rb_cmp(arg1, arg2);
+ 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)
+{
+ rb_warn("Comparable#== will no more rescue exceptions of #<=> in the next release.");
+ rb_warn("Return nil in #<=> if the comparison is inappropriate or avoid such comparison.");
+ return Qfalse;
}
/*
@@ -69,25 +82,20 @@ cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
* 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 c;
- if (x == y) return Qtrue;
-
- c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y);
+ VALUE a[2];
- if (NIL_P(c)) return Qfalse;
- if (rb_cmpint(c, x, y) == 0) return Qtrue;
- return Qfalse;
-}
+ if (x == y) return Qtrue;
-static int
-cmpint(VALUE x, VALUE y)
-{
- return rb_cmpint(rb_cmp(x, y), x, y);
+ a[0] = x; a[1] = y;
+ return rb_rescue(cmp_eq, (VALUE)a, cmp_failed, 0);
}
/*
@@ -101,7 +109,9 @@ cmpint(VALUE x, VALUE y)
static VALUE
cmp_gt(VALUE x, VALUE y)
{
- if (cmpint(x, y) > 0) return Qtrue;
+ VALUE c = rb_funcall(x, cmp, 1, y);
+
+ if (rb_cmpint(c, x, y) > 0) return Qtrue;
return Qfalse;
}
@@ -116,7 +126,9 @@ cmp_gt(VALUE x, VALUE y)
static VALUE
cmp_ge(VALUE x, VALUE y)
{
- if (cmpint(x, y) >= 0) return Qtrue;
+ VALUE c = rb_funcall(x, cmp, 1, y);
+
+ if (rb_cmpint(c, x, y) >= 0) return Qtrue;
return Qfalse;
}
@@ -131,7 +143,9 @@ cmp_ge(VALUE x, VALUE y)
static VALUE
cmp_lt(VALUE x, VALUE y)
{
- if (cmpint(x, y) < 0) return Qtrue;
+ VALUE c = rb_funcall(x, cmp, 1, y);
+
+ if (rb_cmpint(c, x, y) < 0) return Qtrue;
return Qfalse;
}
@@ -146,7 +160,9 @@ cmp_lt(VALUE x, VALUE y)
static VALUE
cmp_le(VALUE x, VALUE y)
{
- if (cmpint(x, y) <= 0) return Qtrue;
+ VALUE c = rb_funcall(x, cmp, 1, y);
+
+ if (rb_cmpint(c, x, y) <= 0) return Qtrue;
return Qfalse;
}
@@ -168,45 +184,12 @@ cmp_le(VALUE x, VALUE y)
static VALUE
cmp_between(VALUE x, VALUE min, VALUE max)
{
- if (cmpint(x, min) < 0) return Qfalse;
- if (cmpint(x, max) > 0) return Qfalse;
+ if (RTEST(cmp_lt(x, min))) return Qfalse;
+ if (RTEST(cmp_gt(x, max))) return Qfalse;
return Qtrue;
}
/*
- * call-seq:
- * obj.clamp(min, max) -> obj
- *
- * Returns <i>min</i> if <i>obj</i> <code><=></code> <i>min</i> is less
- * than zero, <i>max</i> if <i>obj</i> <code><=></code> <i>max</i> is
- * greater than zero and <i>obj</i> otherwise.
- *
- * 12.clamp(0, 100) #=> 12
- * 523.clamp(0, 100) #=> 100
- * -3.123.clamp(0, 100) #=> 0
- *
- * 'd'.clamp('a', 'f') #=> 'd'
- * 'z'.clamp('a', 'f') #=> 'f'
- */
-
-static VALUE
-cmp_clamp(VALUE x, VALUE min, VALUE max)
-{
- int c;
-
- if (cmpint(min, max) > 0) {
- rb_raise(rb_eArgError, "min argument must be smaller than max argument");
- }
-
- c = cmpint(x, min);
- if (c == 0) return x;
- if (c < 0) return min;
- c = cmpint(x, max);
- if (c > 0) return max;
- return x;
-}
-
-/*
* The <code>Comparable</code> mixin is used by classes whose objects
* may be ordered. The class must define the <code><=></code> operator,
* which compares the receiver against another object, returning -1, 0,
@@ -221,8 +204,8 @@ cmp_clamp(VALUE x, VALUE min, VALUE max)
* class SizeMatters
* include Comparable
* attr :str
- * def <=>(other)
- * str.size <=> other.str.size
+ * def <=>(anOther)
+ * str.size <=> anOther.str.size
* end
* def initialize(str)
* @str = str
@@ -258,5 +241,6 @@ Init_Comparable(void)
rb_define_method(rb_mComparable, "<", cmp_lt, 1);
rb_define_method(rb_mComparable, "<=", cmp_le, 1);
rb_define_method(rb_mComparable, "between?", cmp_between, 2);
- rb_define_method(rb_mComparable, "clamp", cmp_clamp, 2);
+
+ cmp = rb_intern("<=>");
}
diff --git a/compile.c b/compile.c
index 2c10d151f5..ac4e5bac22 100644
--- a/compile.c
+++ b/compile.c
@@ -9,9 +9,8 @@
**********************************************************************/
+#include "ruby/ruby.h"
#include "internal.h"
-#include "ruby/re.h"
-#include "encindex.h"
#include <math.h>
#define USE_INSN_STACK_INCREASE 1
@@ -19,27 +18,16 @@
#include "iseq.h"
#include "insns.inc"
#include "insns_info.inc"
-#include "id_table.h"
-#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))
typedef struct iseq_link_element {
enum {
+ ISEQ_ELEMENT_NONE,
ISEQ_ELEMENT_LABEL,
ISEQ_ELEMENT_INSN,
- ISEQ_ELEMENT_ADJUST,
- ISEQ_ELEMENT_TRACE
+ ISEQ_ELEMENT_ADJUST
} type;
struct iseq_link_element *next;
struct iseq_link_element *prev;
@@ -50,35 +38,22 @@ 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;
int position;
int sc_state;
+ int set;
int sp;
- int refcnt;
- unsigned int set: 1;
- unsigned int rescued: 2;
- unsigned int unremovable: 1;
} LABEL;
typedef struct iseq_insn_data {
LINK_ELEMENT link;
enum ruby_vminsn_type insn_id;
+ unsigned int line_no;
int operand_size;
int sc_state;
VALUE *operands;
- struct {
- int line_no;
- rb_event_flag_t events;
- } insn_info;
} INSN;
typedef struct iseq_adjust_data {
@@ -87,11 +62,6 @@ typedef struct iseq_adjust_data {
int line_no;
} ADJUST;
-typedef struct iseq_trace_data {
- LINK_ELEMENT link;
- rb_event_flag_t event;
-} TRACE;
-
struct ensure_range {
LABEL *begin;
LABEL *end;
@@ -99,7 +69,7 @@ struct ensure_range {
};
struct iseq_compile_data_ensure_node_stack {
- const NODE *ensure_node;
+ NODE *ensure_node;
struct iseq_compile_data_ensure_node_stack *prev;
struct ensure_range *erange;
};
@@ -124,7 +94,7 @@ struct iseq_compile_data_ensure_node_stack {
#if CPDEBUG >= 0
#define compile_debug CPDEBUG
#else
-#define compile_debug ISEQ_COMPILE_DATA(iseq)->option->debug_level
+#define compile_debug iseq->compile_data->option->debug_level
#endif
#if CPDEBUG
@@ -154,24 +124,35 @@ struct iseq_compile_data_ensure_node_stack {
#define debug_node_start(node) ((void) \
(compile_debug_print_indent(1) && \
- (ruby_debug_print_node(1, CPDEBUG, "", (const NODE *)(node)), gl_node_level)), \
+ (ruby_debug_print_node(1, CPDEBUG, "", (NODE *)(node)), gl_node_level)), \
gl_node_level++)
#define debug_node_end() gl_node_level --
#else
-#define debugi(header, id) ((void)0)
-#define debugp(header, value) ((void)0)
-#define debugp_verbose(header, value) ((void)0)
-#define debugp_verbose_node(header, value) ((void)0)
-#define debugp_param(header, value) ((void)0)
+static inline ID
+r_id(ID id)
+{
+ return id;
+}
+
+static inline VALUE
+r_value(VALUE value)
+{
+ return value;
+}
+
+#define debugi(header, id) r_id(id)
+#define debugp(header, value) r_value(value)
+#define debugp_verbose(header, value) r_value(value)
+#define debugp_verbose_node(header, value) r_value(value)
+#define debugp_param(header, value) r_value(value)
#define debug_node_start(node) ((void)0)
#define debug_node_end() ((void)0)
#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
@@ -179,17 +160,21 @@ struct iseq_compile_data_ensure_node_stack {
#define debug_compile(msg, v) (v)
#endif
-#define LVAR_ERRINFO (1)
/* create new label */
#define NEW_LABEL(l) new_label_body(iseq, (l))
-#define LABEL_FORMAT "<L%03d>"
-#define NEW_ISEQ(node, name, type, line_no) \
+#define iseq_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.path)
+
+#define iseq_absolute_path(iseq) \
+ (((rb_iseq_t*)DATA_PTR(iseq))->location.absolute_path)
+
+#define NEW_ISEQVAL(node, name, type, line_no) \
new_child_iseq(iseq, (node), rb_fstring(name), 0, (type), (line_no))
-#define NEW_CHILD_ISEQ(node, name, type, line_no) \
- new_child_iseq(iseq, (node), rb_fstring(name), iseq, (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))
/* add instructions */
#define ADD_SEQ(seq1, seq2) \
@@ -199,24 +184,13 @@ struct iseq_compile_data_ensure_node_stack {
#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) \
- ELEM_INSERT_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) \
- ELEM_INSERT_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), LABEL_REF(label))
+#define ADD_INSNL(seq, line, insn, label) ADD_INSN1(seq, line, insn, label)
#define ADD_INSN2(seq, line, insn, op1, op2) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
@@ -228,78 +202,35 @@ struct iseq_compile_data_ensure_node_stack {
/* Specific Insn factory */
#define ADD_SEND(seq, line, id, argc) \
- 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)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(0))
#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), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL))
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
- ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
-
-#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, event) \
- ADD_ELEM((seq), (LINK_ELEMENT *)new_trace_body(iseq, (event)))
-#define ADD_TRACE_LINE_COVERAGE(seq, line) \
- do { \
- if (ISEQ_COVERAGE(iseq) && \
- ISEQ_LINE_COVERAGE(iseq) && \
- (line) > 0) { \
- RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
- ADD_INSN2((seq), (line), tracecoverage, INT2FIX(RUBY_EVENT_COVERAGE_LINE), INT2FIX(line)); \
- } \
- } while (0)
+ ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL))
+#define ADD_SEND_R(seq, line, id, argc, block, flag) \
+ ADD_ELEM((seq), (LINK_ELEMENT *) \
+ new_insn_send(iseq, (line), \
+ (id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag)))
-#define DECL_BRANCH_BASE(branches, first_line, first_column, last_line, last_column, type) \
+#define ADD_TRACE(seq, line, event) \
do { \
- if (ISEQ_COVERAGE(iseq) && \
- ISEQ_BRANCH_COVERAGE(iseq) && \
- (first_line) > 0) { \
- VALUE structure = RARRAY_AREF(ISEQ_BRANCH_COVERAGE(iseq), 0); \
- branches = rb_ary_tmp_new(0); \
- rb_ary_push(structure, branches); \
- rb_ary_push(branches, ID2SYM(rb_intern(type))); \
- rb_ary_push(branches, INT2FIX(first_line)); \
- rb_ary_push(branches, INT2FIX(first_column)); \
- rb_ary_push(branches, INT2FIX(last_line)); \
- rb_ary_push(branches, INT2FIX(last_column)); \
+ 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); \
+ ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
- } while (0)
-#define ADD_TRACE_BRANCH_COVERAGE(seq, first_line, first_column, last_line, last_column, type, branches) \
- do { \
- if (ISEQ_COVERAGE(iseq) && \
- ISEQ_BRANCH_COVERAGE(iseq) && \
- (first_line) > 0) { \
- VALUE counters = RARRAY_AREF(ISEQ_BRANCH_COVERAGE(iseq), 1); \
- long counter_idx = RARRAY_LEN(counters); \
- rb_ary_push(counters, INT2FIX(0)); \
- rb_ary_push(branches, ID2SYM(rb_intern(type))); \
- rb_ary_push(branches, INT2FIX(first_line)); \
- rb_ary_push(branches, INT2FIX(first_column)); \
- rb_ary_push(branches, INT2FIX(last_line)); \
- rb_ary_push(branches, INT2FIX(last_column)); \
- rb_ary_push(branches, INT2FIX(counter_idx)); \
- ADD_INSN2((seq), (first_line), tracecoverage, INT2FIX(RUBY_EVENT_COVERAGE_BRANCH), INT2FIX(counter_idx)); \
+ if (iseq->compile_data->option->trace_instruction) { \
+ ADD_INSN1((seq), (line), trace, INT2FIX(event)); \
} \
} while (0)
-static void iseq_add_getlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line, int idx, int level);
-static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line, int idx, int level);
-
-#define ADD_GETLOCAL(seq, line, idx, level) iseq_add_getlocal(iseq, (seq), (line), (idx), (level))
-#define ADD_SETLOCAL(seq, line, idx, level) iseq_add_setlocal(iseq, (seq), (line), (idx), (level))
-
/* add label */
#define ADD_LABEL(seq, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) (label))
@@ -313,17 +244,11 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line,
#define ADD_ADJUST_RESTORE(seq, label) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_adjust_body(iseq, (label), -1))
-#define LABEL_UNREMOVABLE(label) \
- ((label) ? (LABEL_REF(label), (label)->unremovable=1) : 0)
-#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); \
- LABEL_UNREMOVABLE(ls); \
- LABEL_REF(le); \
- LABEL_REF(lc); \
- rb_ary_push(ISEQ_COMPILE_DATA(iseq)->catch_table_ary, freeze_hide_obj(_e)); \
-} while (0)
+#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)))
/* compile node */
#define COMPILE(anchor, desc, node) \
@@ -331,14 +256,14 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line,
iseq_compile_each(iseq, (anchor), (node), 0)))
/* compile node, this node's value will be popped */
-#define COMPILE_POPPED(anchor, desc, node) \
+#define COMPILE_POPED(anchor, desc, node) \
(debug_compile("== " desc "\n", \
iseq_compile_each(iseq, (anchor), (node), 1)))
-/* compile node, which is popped when 'popped' is true */
-#define COMPILE_(anchor, desc, node, popped) \
+/* compile node, which is popped when 'poped' is true */
+#define COMPILE_(anchor, desc, node, poped) \
(debug_compile("== " desc "\n", \
- iseq_compile_each(iseq, (anchor), (node), (popped))))
+ iseq_compile_each(iseq, (anchor), (node), (poped))))
#define COMPILE_RECV(anchor, desc, node) \
(private_recv_p(node) ? \
@@ -351,104 +276,34 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line,
#define INSN_OF(insn) \
(((INSN*)(insn))->insn_id)
-#define IS_INSN(link) ((link)->type == ISEQ_ELEMENT_INSN)
-#define IS_LABEL(link) ((link)->type == ISEQ_ELEMENT_LABEL)
-#define IS_ADJUST(link) ((link)->type == ISEQ_ELEMENT_ADJUST)
-#define IS_TRACE(link) ((link)->type == ISEQ_ELEMENT_TRACE)
-#define IS_INSN_ID(iobj, insn) (INSN_OF(iobj) == BIN(insn))
-#define IS_NEXT_INSN_ID(link, insn) \
- ((link)->next && IS_INSN((link)->next) && IS_INSN_ID((link)->next, insn))
-
/* error */
-#if CPDEBUG > 0
-NORETURN(static void append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...));
-#endif
-
-static void
-append_compile_error(rb_iseq_t *iseq, int line, const char *fmt, ...)
-{
- VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info;
- VALUE file = rb_iseq_path(iseq);
- VALUE err = err_info == Qtrue ? Qfalse : err_info;
- va_list args;
-
- va_start(args, fmt);
- err = rb_syntax_error_append(err, file, line, -1, NULL, fmt, args);
- va_end(args);
- if (NIL_P(err_info)) {
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err);
- rb_set_errinfo(err);
- }
- else if (!err_info) {
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, Qtrue);
- }
- if (compile_debug) rb_exc_fatal(err);
+#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; \
}
-#if 0
-static void
-compile_bug(rb_iseq_t *iseq, int line, const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- rb_report_bug_valist(rb_iseq_path(iseq), line, fmt, args);
- va_end(args);
- abort();
-}
-#endif
-
-#define COMPILE_ERROR append_compile_error
+#define ERROR_ARGS ruby_sourcefile, nd_line(node),
-#define ERROR_ARGS_AT(n) iseq, nd_line(n),
-#define ERROR_ARGS ERROR_ARGS_AT(node)
-
-#define EXPECT_NODE(prefix, node, ndtype, errval) \
-do { \
- const NODE *error_node = (node); \
- enum node_type error_type = nd_type(error_node); \
- if (error_type != (ndtype)) { \
- COMPILE_ERROR(ERROR_ARGS_AT(error_node) \
- prefix ": " #ndtype " is expected, but %s", \
- ruby_node_name(error_type)); \
- return errval; \
- } \
-} while (0)
-
-#define EXPECT_NODE_NONULL(prefix, parent, ndtype, errval) \
-do { \
- COMPILE_ERROR(ERROR_ARGS_AT(parent) \
- prefix ": must be " #ndtype ", but 0"); \
- return errval; \
-} while (0)
-
-#define UNKNOWN_NODE(prefix, node, errval) \
-do { \
- const NODE *error_node = (node); \
- COMPILE_ERROR(ERROR_ARGS_AT(error_node) prefix ": unknown node (%s)", \
- ruby_node_name(nd_type(error_node))); \
- return errval; \
-} while (0)
#define COMPILE_OK 1
#define COMPILE_NG 0
-#define CHECK(sub) if (!(sub)) {BEFORE_RETURN;return COMPILE_NG;}
-#define BEFORE_RETURN
/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
* missing */
#define DECL_ANCHOR(name) \
- LINK_ANCHOR name[1] = {{{0,},}}
+ LINK_ANCHOR *name, name##_body__ = {{0,},}
#define INIT_ANCHOR(name) \
- (name->last = &name->anchor)
+ (name##_body__.last = &name##_body__.anchor, name = &name##_body__)
-static inline VALUE
-freeze_hide_obj(VALUE obj)
-{
- OBJ_FREEZE(obj);
- RBASIC_CLEAR_CLASS(obj);
- return obj;
-}
+#define hide_obj(obj) do {OBJ_FREEZE(obj); RBASIC_CLEAR_CLASS(obj);} while (0)
#include "optinsn.inc"
#if OPT_INSTRUCTIONS_UNIFICATION
@@ -465,11 +320,13 @@ freeze_hide_obj(VALUE obj)
#endif
#if CPDEBUG
-#define gl_node_level ISEQ_COMPILE_DATA(iseq)->node_level
+#define gl_node_level iseq->compile_data->node_level
+#if 0
+static void debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor);
+#endif
#endif
-static void dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest);
-static void dump_disasm_list(const LINK_ELEMENT *elem);
+static void dump_disasm_list(LINK_ELEMENT *elem);
static int insn_data_length(INSN *iobj);
static int calc_sp_depth(int depth, INSN *iobj);
@@ -477,32 +334,27 @@ static int calc_sp_depth(int depth, INSN *iobj);
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);
-static TRACE *new_trace_body(rb_iseq_t *iseq, rb_event_flag_t event);
-
-static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, const NODE *n, int);
-static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
-static int iseq_setup_insn(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
-static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
-static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
+static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * n, int);
+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, const ID *tbl);
+static int iseq_set_local_table(rb_iseq_t *iseq, ID *tbl);
static int iseq_set_exception_local_table(rb_iseq_t *iseq);
-static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, const NODE *const node);
+static int iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *anchor, NODE * node);
-static int iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
-static int iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
+static int iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
+static int iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor);
static int iseq_set_exception_table(rb_iseq_t *iseq);
static int iseq_set_optargs_table(rb_iseq_t *iseq);
-static int compile_defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE needstr);
-
/*
* To make Array to LinkedList, use link_anchor
*/
static void
-verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *const anchor)
+verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *anchor)
{
#if CPDEBUG
int flag = 0;
@@ -537,7 +389,7 @@ verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *const anchor)
* elem1, elem2 => elem1, elem2, elem
*/
static void
-ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
+ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *elem)
{
elem->prev = anchor->last;
anchor->last->next = elem;
@@ -549,7 +401,7 @@ ADD_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *elem)
* elem1, before, elem2 => elem1, before, elem, elem2
*/
static void
-APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
+APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELEMENT *elem)
{
elem->prev = before;
elem->next = before->next;
@@ -560,11 +412,11 @@ APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor, LINK_ELEMENT *before, LI
}
#if CPDEBUG < 0
#define ADD_ELEM(anchor, elem) ADD_ELEM(iseq, (anchor), (elem))
-#define APPEND_ELEM(anchor, before, elem) APPEND_ELEM(iseq, (anchor), (before), (elem))
+#define APPEND_ELEM(anchor, before, elem) ADD_ELEM(iseq, (anchor), (before), (elem))
#endif
static int
-iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
rb_iseq_add_mark_object(iseq, v);
@@ -572,23 +424,17 @@ iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
return COMPILE_OK;
}
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
+
static int
-iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
{
if (!SPECIAL_CONST_P(v)) {
- rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, v);
+ rb_ary_push(iseq->compile_data->mark_ary, v);
}
return COMPILE_OK;
}
-static inline VALUE
-freeze_literal(rb_iseq_t *iseq, VALUE lit)
-{
- lit = rb_fstring(lit);
- rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, lit);
- return lit;
-}
-
static int
validate_label(st_data_t name, st_data_t label, st_data_t arg)
{
@@ -596,9 +442,10 @@ validate_label(st_data_t name, st_data_t label, st_data_t arg)
LABEL *lobj = (LABEL *)label;
if (!lobj->link.next) {
do {
- COMPILE_ERROR(iseq, lobj->position,
- "%"PRIsVALUE": undefined label",
- rb_sym2str((VALUE)name));
+ int ret;
+ COMPILE_ERROR((ruby_sourcefile, lobj->position,
+ "%s: undefined label", rb_id2name((ID)name)));
+ if (ret) break;
} while (0);
}
return ST_CONTINUE;
@@ -608,137 +455,110 @@ static void
validate_labels(rb_iseq_t *iseq, st_table *labels_table)
{
st_foreach(labels_table, validate_label, (st_data_t)iseq);
- st_free_table(labels_table);
-}
-
-VALUE
-rb_iseq_compile_ifunc(rb_iseq_t *iseq, const struct vm_ifunc *ifunc)
-{
- DECL_ANCHOR(ret);
- INIT_ANCHOR(ret);
-
- (*ifunc->func)(iseq, ret, ifunc->data);
-
- ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, leave);
-
- CHECK(iseq_setup_insn(iseq, ret));
- return iseq_setup(iseq, ret);
+ if (!NIL_P(iseq->compile_data->err_info)) {
+ rb_exc_raise(iseq->compile_data->err_info);
+ }
}
VALUE
-rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
+rb_iseq_compile_node(VALUE self, NODE *node)
{
DECL_ANCHOR(ret);
+ rb_iseq_t *iseq;
INIT_ANCHOR(ret);
+ GetISeqPtr(self, iseq);
if (node == 0) {
COMPILE(ret, "nil", node);
iseq_set_local_table(iseq, 0);
}
- else if (imemo_type_p((VALUE)node, imemo_ifunc)) {
- const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
- /* user callback */
- (*ifunc->func)(iseq, ret, ifunc->data);
- }
- /* assume node is T_NODE */
else if (nd_type(node) == NODE_SCOPE) {
/* iseq type of top, method, class, block */
iseq_set_local_table(iseq, node->nd_tbl);
iseq_set_arguments(iseq, ret, node->nd_args);
- switch (iseq->body->type) {
+ switch (iseq->type) {
case ISEQ_TYPE_BLOCK:
{
- LABEL *start = ISEQ_COMPILE_DATA(iseq)->start_label = NEW_LABEL(0);
- LABEL *end = ISEQ_COMPILE_DATA(iseq)->end_label = NEW_LABEL(0);
+ LABEL *start = iseq->compile_data->start_label = NEW_LABEL(0);
+ LABEL *end = iseq->compile_data->end_label = NEW_LABEL(0);
- start->rescued = LABEL_RESCUE_BEG;
- end->rescued = LABEL_RESCUE_END;
-
- ADD_TRACE(ret, RUBY_EVENT_B_CALL);
- ADD_INSN (ret, FIX2INT(iseq->body->location.first_lineno), nop);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
ADD_LABEL(ret, start);
- CHECK(COMPILE(ret, "block body", node->nd_body));
+ COMPILE(ret, "block body", node->nd_body);
ADD_LABEL(ret, end);
- ADD_TRACE(ret, RUBY_EVENT_B_RETURN);
- ISEQ_COMPILE_DATA(iseq)->last_line = iseq->body->location.code_range.last_loc.lineno;
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
/* wide range catch handler must put at last */
- ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, NULL, start);
- ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, NULL, end);
+ ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
+ ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, start, end, 0, end);
break;
}
case ISEQ_TYPE_CLASS:
{
- ADD_TRACE(ret, RUBY_EVENT_CLASS);
- CHECK(COMPILE(ret, "scoped node", node->nd_body));
- ADD_TRACE(ret, RUBY_EVENT_END);
- ISEQ_COMPILE_DATA(iseq)->last_line = nd_line(node);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CLASS);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_END);
break;
}
case ISEQ_TYPE_METHOD:
{
- ADD_TRACE(ret, RUBY_EVENT_CALL);
- CHECK(COMPILE(ret, "scoped node", node->nd_body));
- ADD_TRACE(ret, RUBY_EVENT_RETURN);
- ISEQ_COMPILE_DATA(iseq)->last_line = nd_line(node);
+ ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_CALL);
+ COMPILE(ret, "scoped node", node->nd_body);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_RETURN);
break;
}
default: {
- CHECK(COMPILE(ret, "scoped node", node->nd_body));
+ COMPILE(ret, "scoped node", node->nd_body);
break;
}
}
}
+ else if (nd_type(node) == NODE_IFUNC) {
+ /* user callback */
+ (*node->nd_cfnc)(iseq, ret, node->nd_tval);
+ }
else {
- const char *m;
-#define INVALID_ISEQ_TYPE(type) \
- ISEQ_TYPE_##type: m = #type; goto invalid_iseq_type
- switch (iseq->body->type) {
- case INVALID_ISEQ_TYPE(METHOD);
- case INVALID_ISEQ_TYPE(CLASS);
- case INVALID_ISEQ_TYPE(BLOCK);
- case INVALID_ISEQ_TYPE(EVAL);
- case INVALID_ISEQ_TYPE(MAIN);
- case INVALID_ISEQ_TYPE(TOP);
-#undef INVALID_ISEQ_TYPE /* invalid iseq types end */
+ switch (iseq->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;
case ISEQ_TYPE_RESCUE:
iseq_set_exception_local_table(iseq);
- CHECK(COMPILE(ret, "rescue", node));
+ COMPILE(ret, "rescue", node);
break;
case ISEQ_TYPE_ENSURE:
iseq_set_exception_local_table(iseq);
- CHECK(COMPILE_POPPED(ret, "ensure", node));
+ COMPILE_POPED(ret, "ensure", node);
break;
case ISEQ_TYPE_DEFINED_GUARD:
- iseq_set_exception_local_table(iseq);
- CHECK(COMPILE(ret, "defined guard", node));
+ iseq_set_local_table(iseq, 0);
+ COMPILE(ret, "defined guard", node);
break;
default:
- COMPILE_ERROR(ERROR_ARGS "unknown scope: %d", iseq->body->type);
- return COMPILE_NG;
- invalid_iseq_type:
- COMPILE_ERROR(ERROR_ARGS "compile/ISEQ_TYPE_%s should not be reached", m);
- return COMPILE_NG;
+ rb_bug("unknown scope");
}
}
- if (iseq->body->type == ISEQ_TYPE_RESCUE || iseq->body->type == ISEQ_TYPE_ENSURE) {
- ADD_GETLOCAL(ret, 0, LVAR_ERRINFO, 0);
+ if (iseq->type == ISEQ_TYPE_RESCUE || iseq->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(iseq)->last_line, leave);
+ ADD_INSN(ret, iseq->compile_data->last_line, leave);
}
#if SUPPORT_JOKE
- 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);
+ if (iseq->compile_data->labels_table) {
+ validate_labels(iseq, iseq->compile_data->labels_table);
}
#endif
- CHECK(iseq_setup_insn(iseq, ret));
return iseq_setup(iseq, ret);
}
@@ -748,12 +568,11 @@ 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 int i;
- VALUE *encoded = (VALUE *)iseq->body->iseq_encoded;
- for (i = 0; i < iseq->body->iseq_size; /* */ ) {
- int insn = (int)iseq->body->iseq_encoded[i];
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ int insn = (int)iseq->iseq_encoded[i];
int len = insn_len(insn);
- encoded[i] = (VALUE)table[insn];
+ iseq->iseq_encoded[i] = (VALUE)table[insn];
i += len;
}
#endif
@@ -777,118 +596,57 @@ rb_vm_insn_addr2insn(const void *addr) /* cold path */
#endif
VALUE *
-rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
+rb_iseq_original_iseq(rb_iseq_t *iseq) /* cold path */
{
- VALUE *original_code;
+ if (iseq->iseq) return iseq->iseq;
- 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);
+ iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
+
+ MEMCPY(iseq->iseq, iseq->iseq_encoded, VALUE, iseq->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];
+ for (i = 0; i < iseq->iseq_size; /* */ ) {
+ const void *addr = (const void *)iseq->iseq[i];
const int insn = rb_vm_insn_addr2insn(addr);
- original_code[i] = insn;
+ iseq->iseq[i] = insn;
i += insn_len(insn);
}
}
#endif
- return original_code;
+ return iseq->iseq;
}
/*********************************************/
/* 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(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 */
+ iseq->compile_data->storage_current;
- if (size >= INT_MAX - padding) rb_memerror();
- if (storage->pos + size + padding > storage->size) {
+ if (size >= INT_MAX) rb_memerror();
+ if (storage->pos + size > storage->size) {
unsigned int alloc_size = storage->size;
- while (alloc_size < size + PADDING_SIZE_MAX) {
+ while (alloc_size < size) {
if (alloc_size >= INT_MAX / 2) rb_memerror();
alloc_size *= 2;
}
storage->next = (void *)ALLOC_N(char, alloc_size +
SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
- storage = ISEQ_COMPILE_DATA(iseq)->storage_current = storage->next;
+ storage = iseq->compile_data->storage_current = storage->next;
storage->next = 0;
storage->pos = 0;
storage->size = alloc_size;
-#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 += (int)size;
return ptr;
@@ -912,17 +670,11 @@ compile_data_alloc_adjust(rb_iseq_t *iseq)
return (ADJUST *)compile_data_alloc(iseq, sizeof(ADJUST));
}
-static TRACE *
-compile_data_alloc_trace(rb_iseq_t *iseq)
-{
- return (TRACE *)compile_data_alloc(iseq, sizeof(TRACE));
-}
-
/*
* elem1, elemX => elem1, elem2, elemX
*/
static void
-ELEM_INSERT_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+INSERT_ELEM_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
{
elem2->next = elem1->next;
elem2->prev = elem1;
@@ -932,11 +684,12 @@ ELEM_INSERT_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
}
}
+#if 0 /* unused */
/*
- * elem1, elemX => elemX, elem2, elem1
+ * elemX, elem1 => elemX, elem2, elem1
*/
static void
-ELEM_INSERT_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
{
elem2->prev = elem1->prev;
elem2->next = elem1;
@@ -945,12 +698,13 @@ ELEM_INSERT_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
elem2->prev->next = elem2;
}
}
+#endif
/*
* elemX, elem1, elemY => elemX, elem2, elemY
*/
static void
-ELEM_REPLACE(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
+REPLACE_ELEM(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
{
elem2->prev = elem1->prev;
elem2->next = elem1->next;
@@ -963,7 +717,7 @@ ELEM_REPLACE(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
}
static void
-ELEM_REMOVE(LINK_ELEMENT *elem)
+REMOVE_ELEM(LINK_ELEMENT *elem)
{
elem->prev->next = elem->next;
if (elem->next) {
@@ -972,19 +726,21 @@ ELEM_REMOVE(LINK_ELEMENT *elem)
}
static LINK_ELEMENT *
-FIRST_ELEMENT(const LINK_ANCHOR *const anchor)
+FIRST_ELEMENT(LINK_ANCHOR *anchor)
{
return anchor->anchor.next;
}
+#if 0 /* unused */
static LINK_ELEMENT *
-LAST_ELEMENT(LINK_ANCHOR *const anchor)
+LAST_ELEMENT(LINK_ANCHOR *anchor)
{
- return anchor->last;
+ return anchor->last;
}
+#endif
static LINK_ELEMENT *
-POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor)
+POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
{
LINK_ELEMENT *elem = anchor->last;
anchor->last = anchor->last->prev;
@@ -996,42 +752,40 @@ POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor)
#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
#endif
+#if 0 /* unused */
static LINK_ELEMENT *
-ELEM_FIRST_INSN(LINK_ELEMENT *elem)
+SHIFT_ELEMENT(LINK_ANCHOR *anchor)
{
- while (elem) {
- switch (elem->type) {
- case ISEQ_ELEMENT_INSN:
- case ISEQ_ELEMENT_ADJUST:
- return elem;
- default:
- elem = elem->next;
- }
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ if (elem) {
+ anchor->anchor.next = elem->next;
}
- return NULL;
+ return elem;
}
+#endif
+#if 0 /* unused */
static int
-LIST_INSN_SIZE_ONE(const LINK_ANCHOR *const anchor)
+LIST_SIZE(LINK_ANCHOR *anchor)
{
- LINK_ELEMENT *first_insn = ELEM_FIRST_INSN(FIRST_ELEMENT(anchor));
- if (first_insn != NULL &&
- ELEM_FIRST_INSN(first_insn->next) == NULL) {
- return TRUE;
- }
- else {
- return FALSE;
+ LINK_ELEMENT *elem = anchor->anchor.next;
+ int size = 0;
+ while (elem) {
+ size += 1;
+ elem = elem->next;
}
+ return size;
}
+#endif
static int
-LIST_INSN_SIZE_ZERO(const LINK_ANCHOR *const anchor)
+LIST_SIZE_ZERO(LINK_ANCHOR *anchor)
{
- if (ELEM_FIRST_INSN(FIRST_ELEMENT(anchor)) == NULL) {
- return TRUE;
+ if (anchor->anchor.next == 0) {
+ return 1;
}
else {
- return FALSE;
+ return 0;
}
}
@@ -1043,7 +797,7 @@ LIST_INSN_SIZE_ZERO(const LINK_ANCHOR *const anchor)
* anc2: e4, e5 (broken)
*/
static void
-APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
+APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
{
if (anc2->anchor.next) {
anc1->last->next = anc2->anchor.next;
@@ -1064,7 +818,7 @@ APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
* anc2: e4, e5 (broken)
*/
static void
-INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
+INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
{
if (anc2->anchor.next) {
LINK_ELEMENT *first = anc1->anchor.next;
@@ -1085,9 +839,68 @@ INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const 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 *const anchor)
+debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor)
{
LINK_ELEMENT *list = FIRST_ELEMENT(anchor);
printf("----\n");
@@ -1106,22 +919,8 @@ debug_list(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor)
#if CPDEBUG < 0
#define debug_list(anc) debug_list(iseq, (anc))
#endif
-#else
-#define debug_list(anc) ((void)0)
#endif
-static TRACE *
-new_trace_body(rb_iseq_t *iseq, rb_event_flag_t event)
-{
- TRACE *trace = compile_data_alloc_trace(iseq);
-
- trace->link.type = ISEQ_ELEMENT_TRACE;
- trace->link.next = NULL;
- trace->event = event;
-
- return trace;
-}
-
static LABEL *
new_label_body(rb_iseq_t *iseq, long line)
{
@@ -1130,13 +929,9 @@ 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(iseq)->label_no++;
+ labelobj->label_no = iseq->compile_data->label_no++;
labelobj->sc_state = 0;
labelobj->sp = -1;
- labelobj->refcnt = 0;
- labelobj->set = 0;
- labelobj->rescued = LABEL_RESCUE_NONE;
- labelobj->unremovable = 0;
return labelobj;
}
@@ -1148,7 +943,6 @@ new_adjust_body(rb_iseq_t *iseq, LABEL *label, int line)
adjust->link.next = 0;
adjust->label = label;
adjust->line_no = line;
- LABEL_UNREMOVABLE(label);
return adjust;
}
@@ -1157,14 +951,12 @@ new_insn_core(rb_iseq_t *iseq, int line_no,
int insn_id, int argc, VALUE *argv)
{
INSN *iobj = compile_data_alloc_insn(iseq);
-
/* printf("insn_id: %d, line: %d\n", insn_id, line_no); */
iobj->link.type = ISEQ_ELEMENT_INSN;
iobj->link.next = 0;
iobj->insn_id = insn_id;
- iobj->insn_info.line_no = line_no;
- iobj->insn_info.events = 0;
+ iobj->line_no = line_no;
iobj->operands = argv;
iobj->operand_size = argc;
iobj->sc_state = 0;
@@ -1189,86 +981,61 @@ new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int a
return new_insn_core(iseq, line_no, insn_id, argc, operands);
}
-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)
+static rb_call_info_t *
+new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned int flag)
{
- 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;
-
+ rb_call_info_t *ci = (rb_call_info_t *)compile_data_alloc(iseq, sizeof(rb_call_info_t));
ci->mid = mid;
ci->flag = flag;
ci->orig_argc = argc;
+ ci->argc = argc;
- if (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++;
+ if (block) {
+ GetISeqPtr(block, ci->blockiseq);
}
else {
- iseq->body->ci_size++;
+ ci->blockiseq = 0;
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG))) {
+ ci->flag |= VM_CALL_ARGS_SKIP_SETUP;
+ }
}
+ 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 | VM_CALL_KW_SPLAT)) &&
- 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, ID id, VALUE argc, const rb_iseq_t *blockiseq, VALUE flag, struct rb_call_info_kw_arg *keywords)
+new_insn_send(rb_iseq_t *iseq, int line_no, ID id, VALUE argc, VALUE block, VALUE flag)
{
- 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);
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), block, FIX2INT(flag));
+ return new_insn_core(iseq, line_no, BIN(send), 1, operands);
}
-static rb_iseq_t *
-new_child_iseq(rb_iseq_t *iseq, const NODE *const node,
- VALUE name, const rb_iseq_t *parent, enum iseq_type type, int line_no)
+static VALUE
+new_child_iseq(rb_iseq_t *iseq, NODE *node,
+ VALUE name, VALUE parent, enum iseq_type type, int line_no)
{
- rb_iseq_t *ret_iseq;
+ VALUE ret;
debugs("[new_child_iseq]> ---------------------------------------\n");
- ret_iseq = rb_iseq_new_with_opt(node, name,
- rb_iseq_path(iseq), rb_iseq_realpath(iseq),
- INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
+ ret = rb_iseq_new_with_opt(node, name,
+ iseq_path(iseq->self), iseq_absolute_path(iseq->self),
+ INT2FIX(line_no), parent, type, iseq->compile_data->option);
debugs("[new_child_iseq]< ---------------------------------------\n");
- iseq_add_mark_object(iseq, (VALUE)ret_iseq);
- return ret_iseq;
-}
-
-static void
-iseq_insert_nop_between_end_and_cont(rb_iseq_t *iseq)
-{
- VALUE catch_table_ary = ISEQ_COMPILE_DATA(iseq)->catch_table_ary;
- unsigned int i, tlen = (unsigned int)RARRAY_LEN(catch_table_ary);
- const VALUE *tptr = RARRAY_CONST_PTR(catch_table_ary);
- for (i = 0; i < tlen; i++) {
- const VALUE *ptr = RARRAY_CONST_PTR(tptr[i]);
- LINK_ELEMENT *end = (LINK_ELEMENT *)(ptr[2] & ~1);
- LINK_ELEMENT *cont = (LINK_ELEMENT *)(ptr[4] & ~1);
- LINK_ELEMENT *e;
- for (e = end; e && (IS_LABEL(e) || IS_TRACE(e)); e = e->next) {
- if (e == cont) {
- INSN *nop = new_insn_core(iseq, 0, BIN(nop), 0, 0);
- ELEM_INSERT_NEXT(end, &nop->link);
- break;
- }
- }
- }
+ iseq_add_mark_object(iseq, ret);
+ return ret;
}
static int
-iseq_setup_insn(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
+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)
@@ -1280,99 +1047,85 @@ iseq_setup_insn(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
- if (ISEQ_COMPILE_DATA(iseq)->option->instructions_unification) {
+ if (iseq->compile_data->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(iseq)->option->stack_caching) {
+ if (iseq->compile_data->option->stack_caching) {
debugs("[compile step 3.3 (iseq_set_sequence_stackcaching)]\n");
iseq_set_sequence_stackcaching(iseq, anchor);
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
}
- debugs("[compile step 3.4 (iseq_insert_nop_between_end_and_cont)]\n");
- iseq_insert_nop_between_end_and_cont(iseq);
-
- return COMPILE_OK;
-}
-
-static int
-iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
-{
- if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
- return COMPILE_NG;
-
debugs("[compile step 4.1 (iseq_set_sequence)]\n");
- if (!iseq_set_sequence(iseq, anchor)) return COMPILE_NG;
+ iseq_set_sequence(iseq, anchor);
if (compile_debug > 5)
dump_disasm_list(FIRST_ELEMENT(anchor));
debugs("[compile step 4.2 (iseq_set_exception_table)]\n");
- if (!iseq_set_exception_table(iseq)) return COMPILE_NG;
+ iseq_set_exception_table(iseq);
debugs("[compile step 4.3 (set_optargs_table)] \n");
- if (!iseq_set_optargs_table(iseq)) return COMPILE_NG;
+ iseq_set_optargs_table(iseq);
debugs("[compile step 5 (iseq_translate_threaded_code)] \n");
- if (!rb_iseq_translate_threaded_code(iseq)) return COMPILE_NG;
+ rb_iseq_translate_threaded_code(iseq);
if (compile_debug > 1) {
- VALUE str = rb_iseq_disasm(iseq);
+ VALUE str = rb_iseq_disasm(iseq->self);
printf("%s\n", StringValueCStr(str));
+ fflush(stdout);
}
debugs("[compile step: finish]\n");
- return COMPILE_OK;
+ return 0;
}
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->body->local_table_size = 1;
- ids[0] = id_dollar_bang;
- iseq->body->local_table = ids;
+ 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;
return COMPILE_OK;
}
static int
-get_lvar_level(const rb_iseq_t *iseq)
+get_lvar_level(rb_iseq_t *iseq)
{
int lev = 0;
- while (iseq != iseq->body->local_iseq) {
+ while (iseq != iseq->local_iseq) {
lev++;
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
}
return lev;
}
static int
-get_dyna_var_idx_at_raw(const rb_iseq_t *iseq, ID id)
+get_dyna_var_idx_at_raw(rb_iseq_t *iseq, ID id)
{
- unsigned int i;
+ int i;
- for (i = 0; i < iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
- return (int)i;
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return i;
}
}
return -1;
}
static int
-get_local_var_idx(const rb_iseq_t *iseq, ID id)
+get_local_var_idx(rb_iseq_t *iseq, ID id)
{
- int idx = get_dyna_var_idx_at_raw(iseq->body->local_iseq, id);
+ int idx = get_dyna_var_idx_at_raw(iseq->local_iseq, id);
if (idx < 0) {
rb_bug("get_local_var_idx: %d", idx);
@@ -1382,7 +1135,7 @@ get_local_var_idx(const rb_iseq_t *iseq, ID id)
}
static int
-get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
+get_dyna_var_idx(rb_iseq_t *iseq, ID id, int *level, int *ls)
{
int lv = 0, idx = -1;
@@ -1391,7 +1144,7 @@ get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
if (idx >= 0) {
break;
}
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
lv++;
}
@@ -1400,161 +1153,12 @@ get_dyna_var_idx(const rb_iseq_t *iseq, ID id, int *level, int *ls)
}
*level = lv;
- *ls = iseq->body->local_table_size;
+ *ls = iseq->local_size;
return idx;
}
static int
-iseq_local_block_param_p(const rb_iseq_t *iseq, unsigned int idx, unsigned int level)
-{
- while (level > 0) {
- iseq = iseq->body->parent_iseq;
- level--;
- }
- if (iseq->body->local_iseq == iseq && /* local variables */
- iseq->body->param.flags.has_block &&
- iseq->body->local_table_size - iseq->body->param.block_start == idx) {
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-static void
-iseq_add_getlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line, int idx, int level)
-{
- if (iseq_local_block_param_p(iseq, idx, level)) {
- ADD_INSN2(seq, line, getblockparam, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level));
- }
- else {
- ADD_INSN2(seq, line, getlocal, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level));
- }
-}
-
-static void
-iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, int line, int idx, int level)
-{
- if (iseq_local_block_param_p(iseq, idx, level)) {
- ADD_INSN2(seq, line, setblockparam, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level));
- }
- else {
- ADD_INSN2(seq, line, setlocal, INT2FIX((idx) + VM_ENV_DATA_SIZE - 1), INT2FIX(level));
- }
-}
-
-
-
-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 *const optargs,
- const struct rb_args_info *args)
-{
- const 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_cflag);
-
- while (node) {
- const NODE *val_node = node->nd_body->nd_value;
- VALUE dv;
-
- if (val_node == (const 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_POPPED(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_vid != 0) {
- keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
- 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 *const optargs, const NODE *const node_args)
+iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *optargs, NODE *node_args)
{
debugs("iseq_set_arguments: %s\n", node_args ? "" : "0");
@@ -1564,11 +1168,14 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
int last_comma = 0;
ID block_id = 0;
- EXPECT_NODE("iseq_set_arguments", node_args, NODE_ARGS, COMPILE_NG);
+ 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)));
+ }
+
- 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);
+ iseq->argc = (int)args->pre_args_num;
+ debugs(" - argc: %d\n", iseq->argc);
rest_id = args->rest_arg;
if (rest_id == 1) {
@@ -1578,23 +1185,21 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
block_id = args->block_arg;
if (args->first_post_arg) {
- 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;
+ iseq->arg_post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->arg_post_len = args->post_args_num;
}
if (args->opt_args) {
- const NODE *node = 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) {
label = NEW_LABEL(nd_line(node));
rb_ary_push(labels, (VALUE)label | 1);
ADD_LABEL(optargs, label);
- COMPILE_POPPED(optargs, "optarg", node->nd_body);
+ COMPILE_POPED(optargs, "optarg", node->nd_body);
node = node->nd_next;
i += 1;
}
@@ -1603,79 +1208,139 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
label = NEW_LABEL(nd_line(node_args));
rb_ary_push(labels, (VALUE)label | 1);
ADD_LABEL(optargs, label);
+ i += 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;
+ 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;
}
rb_ary_clear(labels);
-
- iseq->body->param.flags.has_opt = TRUE;
- iseq->body->param.opt_num = i;
- iseq->body->param.opt_table = opt_table;
+ }
+ else {
+ iseq->arg_opts = 0;
}
if (args->kw_args) {
- iseq_set_arguments_keywords(iseq, optargs, 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_cflag != 0;
+ 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);
}
else if (args->kw_rest_arg) {
- 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;
+ 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;
}
if (args->pre_init) { /* m_init */
- COMPILE_POPPED(optargs, "init arguments (m)", args->pre_init);
+ COMPILE_POPED(optargs, "init arguments (m)", args->pre_init);
}
if (args->post_init) { /* p_init */
- COMPILE_POPPED(optargs, "init arguments (p)", args->post_init);
+ COMPILE_POPED(optargs, "init arguments (p)", args->post_init);
}
if (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);
+ iseq->arg_rest = get_dyna_var_idx_at_raw(iseq, rest_id);
- if (iseq->body->param.post_start == 0) { /* TODO: why that? */
- iseq->body->param.post_start = 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 (block_id) {
- iseq->body->param.block_start = get_dyna_var_idx_at_raw(iseq, block_id);
- iseq->body->param.flags.has_block = TRUE;
+ iseq->arg_block = get_dyna_var_idx_at_raw(iseq, block_id);
}
- iseq_calc_param_size(iseq);
+ 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;
- 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) {
+ /* 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->param.lead_num == 1 && last_comma == 0) {
+ 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) {
/* {|a|} */
- iseq->body->param.flags.ambiguous_param0 = TRUE;
+ iseq->arg_simple |= 0x02;
}
}
}
}
+ else {
+ iseq->arg_simple = 1;
+ }
return COMPILE_OK;
}
static int
-iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
+iseq_set_local_table(rb_iseq_t *iseq, ID *tbl)
{
- unsigned int size;
+ int size;
if (tbl) {
- size = (unsigned int)*tbl;
+ size = (int)*tbl;
tbl++;
}
else {
@@ -1683,13 +1348,21 @@ iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
}
if (size > 0) {
- ID *ids = (ID *)ALLOC_N(ID, size);
- MEMCPY(ids, tbl, ID, size);
- iseq->body->local_table = ids;
+ iseq->local_table = (ID *)ALLOC_N(ID, size);
+ MEMCPY(iseq->local_table, tbl, ID, size);
}
- iseq->body->local_table_size = size;
- debugs("iseq_set_local_table: %u\n", iseq->body->local_table_size);
+ iseq->local_size = iseq->local_table_size = size;
+ iseq->local_size += 1;
+ /*
+ if (lfp == dfp ) { // top, class, method
+ dfp[-1]: svar
+ else { // block
+ dfp[-1]: cref
+ }
+ */
+
+ debugs("iseq_set_local_table: %d, %d\n", iseq->local_size, iseq->local_table_size);
return COMPILE_OK;
}
@@ -1740,254 +1413,74 @@ cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
return ST_CONTINUE;
}
-
-static inline VALUE
-get_ivar_ic_value(rb_iseq_t *iseq,ID id)
-{
- VALUE val;
- struct rb_id_table *tbl = ISEQ_COMPILE_DATA(iseq)->ivar_cache_table;
- if (tbl) {
- if (rb_id_table_lookup(tbl,id,&val)) {
- return val;
- }
- }
- else {
- tbl = rb_id_table_create(1);
- ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = tbl;
- }
- val = INT2FIX(iseq->body->is_size++);
- rb_id_table_insert(tbl,id,val);
- return val;
-}
-
-#define BADINSN_DUMP(anchor, list, dest) \
- dump_disasm_list_with_cursor(&anchor->anchor, list, dest)
-
-#define BADINSN_ERROR \
- (xfree(generated_iseq), \
- xfree(insns_info), \
- BADINSN_DUMP(anchor, list, NULL), \
- COMPILE_ERROR)
-
-static int
-fix_sp_depth(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
-{
- int stack_max = 0, sp = 0, line = 0;
- LINK_ELEMENT *list;
-
- for (list = FIRST_ELEMENT(anchor); list; list = list->next) {
- if (list->type == ISEQ_ELEMENT_LABEL) {
- LABEL *lobj = (LABEL *)list;
- lobj->set = TRUE;
- }
- }
-
- for (list = FIRST_ELEMENT(anchor); list; list = list->next) {
- switch (list->type) {
- case ISEQ_ELEMENT_INSN:
- {
- int j, len, insn;
- const char *types;
- VALUE *operands;
- INSN *iobj = (INSN *)list;
-
- /* update sp */
- sp = calc_sp_depth(sp, iobj);
- if (sp < 0) {
- BADINSN_DUMP(anchor, list, NULL);
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "argument stack underflow (%d)", sp);
- return -1;
- }
- if (sp > stack_max) {
- stack_max = sp;
- }
-
- line = iobj->insn_info.line_no;
- /* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
- operands = iobj->operands;
- insn = iobj->insn_id;
- types = insn_op_types(insn);
- len = insn_len(insn);
-
- /* operand check */
- if (iobj->operand_size != len - 1) {
- /* printf("operand size miss! (%d, %d)\n", iobj->operand_size, len); */
- BADINSN_DUMP(anchor, list, NULL);
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "operand size miss! (%d for %d)",
- iobj->operand_size, len - 1);
- return -1;
- }
-
- for (j = 0; types[j]; j++) {
- if (types[j] == TS_OFFSET) {
- /* label(destination position) */
- LABEL *lobj = (LABEL *)operands[j];
- if (!lobj->set) {
- BADINSN_DUMP(anchor, list, NULL);
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "unknown label: "LABEL_FORMAT, lobj->label_no);
- return -1;
- }
- if (lobj->sp == -1) {
- lobj->sp = sp;
- }
- }
- }
- break;
- }
- case ISEQ_ELEMENT_LABEL:
- {
- LABEL *lobj = (LABEL *)list;
- if (lobj->sp == -1) {
- lobj->sp = sp;
- }
- else {
- sp = lobj->sp;
- }
- break;
- }
- case ISEQ_ELEMENT_TRACE:
- {
- /* ignore */
- break;
- }
- case ISEQ_ELEMENT_ADJUST:
- {
- ADJUST *adjust = (ADJUST *)list;
- int orig_sp = sp;
-
- sp = adjust->label ? adjust->label->sp : 0;
- if (adjust->line_no != -1 && orig_sp - sp < 0) {
- BADINSN_DUMP(anchor, list, NULL);
- COMPILE_ERROR(iseq, adjust->line_no,
- "iseq_set_sequence: adjust bug %d < %d",
- orig_sp, sp);
- return -1;
- }
- break;
- }
- default:
- BADINSN_DUMP(anchor, list, NULL);
- COMPILE_ERROR(iseq, line, "unknown list type: %d", list->type);
- return -1;
- }
- }
- return stack_max;
-}
-
-static int
-add_insn_info(struct iseq_insn_info_entry *insns_info, int insns_info_index, int code_index, LINK_ELEMENT *list)
-{
- if (list->type == ISEQ_ELEMENT_INSN) {
- INSN *iobj = (INSN *)list;
- if (insns_info_index == 0 ||
- insns_info[insns_info_index-1].line_no != iobj->insn_info.line_no ||
- insns_info[insns_info_index-1].events != iobj->insn_info.events) {
- insns_info[insns_info_index].position = code_index;
- insns_info[insns_info_index].line_no = iobj->insn_info.line_no;
- insns_info[insns_info_index].events = iobj->insn_info.events;
- return TRUE;
- }
- else {
- return FALSE;
- }
- }
- else if (list->type == ISEQ_ELEMENT_ADJUST) {
- ADJUST *adjust = (ADJUST *)list;
- if (insns_info_index > 0 ||
- insns_info[insns_info_index-1].line_no != adjust->line_no) {
- insns_info[insns_info_index].position = code_index;
- insns_info[insns_info_index].line_no = adjust->line_no;
- insns_info[insns_info_index].events = 0;
- return TRUE;
- }
- else {
- return FALSE;
- }
- }
- else {
- VM_UNREACHABLE(add_insn_info);
- }
-}
-
/**
ruby insn object list -> raw instruction sequence
*/
static int
-iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
+iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
- struct iseq_insn_info_entry *insns_info;
+ LABEL *lobj;
+ INSN *iobj;
+ struct iseq_line_info_entry *line_info_table;
+ unsigned int last_line = 0;
LINK_ELEMENT *list;
VALUE *generated_iseq;
- rb_event_flag_t events = 0;
-
- int insn_num, code_index, insns_info_index, sp = 0;
- int stack_max = fix_sp_depth(iseq, anchor);
- if (stack_max < 0) return COMPILE_NG;
+ int k, pos, sp, stack_max = 0, line = 0;
- /* fix label position */
+ /* set label position */
list = FIRST_ELEMENT(anchor);
- insn_num = code_index = 0;
+ k = pos = 0;
while (list) {
switch (list->type) {
case ISEQ_ELEMENT_INSN:
{
- INSN *iobj = (INSN *)list;
- /* update sp */
- sp = calc_sp_depth(sp, iobj);
- code_index += insn_data_length(iobj);
- insn_num++;
- iobj->insn_info.events |= events;
- events = 0;
+ iobj = (INSN *)list;
+ line = iobj->line_no;
+ pos += insn_data_length(iobj);
+ k++;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- LABEL *lobj = (LABEL *)list;
- lobj->position = code_index;
- sp = lobj->sp;
+ lobj = (LABEL *)list;
+ lobj->position = pos;
+ lobj->set = TRUE;
break;
}
- case ISEQ_ELEMENT_TRACE:
+ case ISEQ_ELEMENT_NONE:
{
- TRACE *trace = (TRACE *)list;
- events |= trace->event;
+ /* ignore */
break;
}
case ISEQ_ELEMENT_ADJUST:
{
ADJUST *adjust = (ADJUST *)list;
if (adjust->line_no != -1) {
- int orig_sp = sp;
- sp = adjust->label ? adjust->label->sp : 0;
- if (orig_sp - sp > 0) {
- if (orig_sp - sp > 1) code_index++; /* 1 operand */
- code_index++; /* insn */
- insn_num++;
- }
+ pos += 2 /* insn + 1 operand */;
+ k++;
}
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;
}
list = list->next;
}
/* make instruction sequence */
- generated_iseq = ALLOC_N(VALUE, code_index);
- insns_info = ALLOC_N(struct iseq_insn_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);
- MEMZERO(iseq->body->ci_entries + iseq->body->ci_size, struct rb_call_info_with_kwarg, iseq->body->ci_kw_size); /* need to clear ci_kw entries */
- 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;
+ generated_iseq = ALLOC_N(VALUE, pos);
+ line_info_table = ALLOC_N(struct iseq_line_info_entry, k);
+ iseq->is_entries = ZALLOC_N(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); */
list = FIRST_ELEMENT(anchor);
- insns_info_index = code_index = sp = 0;
+ k = pos = sp = 0;
while (list) {
switch (list->type) {
@@ -1996,17 +1489,34 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
int j, len, insn;
const char *types;
VALUE *operands;
- INSN *iobj = (INSN *)list;
+
+ iobj = (INSN *)list;
/* update sp */
sp = calc_sp_depth(sp, iobj);
+ if (sp > stack_max) {
+ stack_max = sp;
+ }
+
/* fprintf(stderr, "insn: %-16s, sp: %d\n", insn_name(iobj->insn_id), sp); */
operands = iobj->operands;
insn = iobj->insn_id;
- generated_iseq[code_index] = insn;
+ generated_iseq[pos] = insn;
types = insn_op_types(insn);
len = insn_len(insn);
+ /* operand check */
+ 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;
+ }
+
for (j = 0; types[j]; j++) {
char type = types[j];
/* printf("--> [%c - (%d-%d)]\n", type, k, j); */
@@ -2014,8 +1524,15 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
case TS_OFFSET:
{
/* label(destination position) */
- LABEL *lobj = (LABEL *)operands[j];
- generated_iseq[code_index + 1 + j] = lobj->position - (code_index + len);
+ lobj = (LABEL *)operands[j];
+ if (!lobj->set) {
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unknown label");
+ }
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ generated_iseq[pos + 1 + j] = lobj->position - (pos + len);
break;
}
case TS_CDHASH:
@@ -2023,97 +1540,93 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
VALUE map = operands[j];
struct cdhash_set_label_struct data;
data.hash = map;
- data.pos = code_index;
+ data.pos = pos;
data.len = len;
rb_hash_foreach(map, cdhash_set_label_i, (VALUE)&data);
- rb_hash_rehash(map);
- freeze_hide_obj(map);
- generated_iseq[code_index + 1 + j] = map;
+ hide_obj(map);
+ generated_iseq[pos + 1 + j] = map;
break;
}
case TS_LINDEX:
case TS_NUM: /* ulong */
- generated_iseq[code_index + 1 + j] = FIX2INT(operands[j]);
+ generated_iseq[pos + 1 + j] = FIX2INT(operands[j]);
break;
case TS_ISEQ: /* iseq */
{
VALUE v = operands[j];
- generated_iseq[code_index + 1 + j] = v;
+ rb_iseq_t *block = 0;
+ if (v) {
+ GetISeqPtr(v, block);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)block;
break;
}
case TS_VALUE: /* VALUE */
{
VALUE v = operands[j];
- generated_iseq[code_index + 1 + j] = v;
+ generated_iseq[pos + 1 + j] = v;
/* to mark ruby object */
iseq_add_mark_object(iseq, v);
break;
}
case TS_IC: /* inline cache */
{
- 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);
+ 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);
}
- generated_iseq[code_index + 1 + j] = (VALUE)ic;
+ generated_iseq[pos + 1 + j] = (VALUE)ic;
break;
}
case TS_CALLINFO: /* call info */
{
- 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);
- }
+ 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;
- 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;
+ if (UNLIKELY(base_ci->aux.index >= iseq->callinfo_size)) {
+ rb_bug("iseq_set_sequence: ci_index overflow: index: %d, size: %d", base_ci->argc, iseq->callinfo_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ci;
break;
}
case TS_ID: /* ID */
- generated_iseq[code_index + 1 + j] = SYM2ID(operands[j]);
+ generated_iseq[pos + 1 + j] = SYM2ID(operands[j]);
break;
case TS_GENTRY:
{
struct rb_global_entry *entry =
(struct rb_global_entry *)(operands[j] & (~1));
- generated_iseq[code_index + 1 + j] = (VALUE)entry;
+ generated_iseq[pos + 1 + j] = (VALUE)entry;
}
break;
- case TS_FUNCPTR:
- generated_iseq[code_index + 1 + j] = operands[j];
- break;
default:
- BADINSN_ERROR(iseq, iobj->insn_info.line_no,
- "unknown operand type: %c", type);
- return COMPILE_NG;
+ 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;
}
}
- if (add_insn_info(insns_info, insns_info_index, code_index, (LINK_ELEMENT *)iobj)) insns_info_index++;
- code_index += len;
+ if (last_line != iobj->line_no) {
+ line_info_table[k].line_no = last_line = iobj->line_no;
+ line_info_table[k].position = pos;
+ k++;
+ }
+ pos += len;
break;
}
case ISEQ_ELEMENT_LABEL:
{
- LABEL *lobj = (LABEL *)list;
- sp = lobj->sp;
+ lobj = (LABEL *)list;
+ if (lobj->sp == -1) {
+ lobj->sp = sp;
+ }
+ else {
+ sp = lobj->sp;
+ }
break;
}
case ISEQ_ELEMENT_ADJUST:
@@ -2129,26 +1642,27 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
}
if (adjust->line_no != -1) {
- const int diff = orig_sp - sp;
- if (diff > 0) {
- if (add_insn_info(insns_info, insns_info_index, code_index, (LINK_ELEMENT *)adjust)) insns_info_index++;
- }
- if (diff > 1) {
- generated_iseq[code_index++] = BIN(adjuststack);
- generated_iseq[code_index++] = orig_sp - sp;
+ 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++;
+ }
+ generated_iseq[pos++] = BIN(adjuststack);
+ generated_iseq[pos++] = orig_sp - sp;
}
- else if (diff == 1) {
- generated_iseq[code_index++] = BIN(pop);
+ 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++;
+ }
+ generated_iseq[pos++] = BIN(jump);
+ generated_iseq[pos++] = 0;
}
- else if (diff < 0) {
- int label_no = adjust->label ? adjust->label->label_no : -1;
- xfree(generated_iseq);
- xfree(insns_info);
- debug_list(anchor);
- COMPILE_ERROR(iseq, adjust->line_no,
- "iseq_set_sequence: adjust bug to %d %d < %d",
- label_no, orig_sp, sp);
- return COMPILE_NG;
+ else {
+ rb_bug("iseq_set_sequence: adjust bug");
}
}
break;
@@ -2160,16 +1674,20 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
list = list->next;
}
- iseq->body->iseq_encoded = (void *)generated_iseq;
- iseq->body->iseq_size = code_index;
- iseq->body->stack_max = stack_max;
+#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
- /* get rid of memory leak when REALLOC failed */
- iseq->body->insns_info = insns_info;
+ iseq->iseq_encoded = (void *)generated_iseq;
+ iseq->iseq_size = pos;
+ iseq->stack_max = stack_max;
- REALLOC_N(insns_info, struct iseq_insn_info_entry, insns_info_index);
- iseq->body->insns_info = insns_info;
- iseq->body->insns_info_size = insns_info_index;
+ REALLOC_N(line_info_table, struct iseq_line_info_entry, k);
+ iseq->line_info_table = line_info_table;
+ iseq->line_info_size = k;
return COMPILE_OK;
}
@@ -2190,53 +1708,50 @@ static int
iseq_set_exception_table(rb_iseq_t *iseq)
{
const VALUE *tptr, *ptr;
- unsigned int tlen, i;
+ int tlen, i;
struct iseq_catch_table_entry *entry;
- tlen = (int)RARRAY_LEN(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
- tptr = RARRAY_CONST_PTR(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
+ tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary);
+ tptr = RARRAY_CONST_PTR(iseq->compile_data->catch_table_ary);
+ iseq->catch_table = 0;
if (tlen > 0) {
- struct iseq_catch_table *table = xmalloc(iseq_catch_table_bytes(tlen));
- table->size = tlen;
-
- 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, (VALUE)entry->iseq);
- }
+ iseq->catch_table = xmalloc(iseq_catch_table_bytes(tlen));
+ iseq->catch_table->size = tlen;
+ }
- /* 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;
+ if (iseq->catch_table) for (i = 0; i < iseq->catch_table->size; i++) {
+ ptr = RARRAY_CONST_PTR(tptr[i]);
+ entry = &iseq->catch_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 = 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);
+
+ /* TODO: Dirty Hack! Fix me */
+ if (entry->type == CATCH_TYPE_RESCUE ||
+ entry->type == CATCH_TYPE_BREAK ||
+ entry->type == CATCH_TYPE_NEXT) {
+ entry->sp--;
}
}
- iseq->body->catch_table = table;
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, 0); /* free */
- }
- else {
- iseq->body->catch_table = NULL;
+ else {
+ entry->cont = 0;
+ }
}
+ RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, 0); /* free */
return COMPILE_OK;
}
@@ -2253,11 +1768,11 @@ static int
iseq_set_optargs_table(rb_iseq_t *iseq)
{
int i;
- VALUE *opt_table = (VALUE *)iseq->body->param.opt_table;
- 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]);
+ 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]);
}
}
return COMPILE_OK;
@@ -2268,31 +1783,14 @@ get_destination_insn(INSN *iobj)
{
LABEL *lobj = (LABEL *)OPERAND_AT(iobj, 0);
LINK_ELEMENT *list;
- rb_event_flag_t events = 0;
list = lobj->link.next;
while (list) {
- switch (list->type) {
- case ISEQ_ELEMENT_INSN:
- case ISEQ_ELEMENT_ADJUST:
- goto found;
- case ISEQ_ELEMENT_LABEL:
- /* ignore */
- break;
- case ISEQ_ELEMENT_TRACE:
- {
- TRACE *trace = (TRACE *)list;
- events |= trace->event;
- }
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
break;
}
list = list->next;
}
- found:
- if (list && IS_INSN(list)) {
- INSN *iobj = (INSN *)list;
- iobj->insn_info.events |= events;
- }
return list;
}
@@ -2302,7 +1800,7 @@ get_next_insn(INSN *iobj)
LINK_ELEMENT *list = iobj->link.next;
while (list) {
- if (IS_INSN(list) || IS_ADJUST(list)) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
return list;
}
list = list->next;
@@ -2316,7 +1814,7 @@ get_prev_insn(INSN *iobj)
LINK_ELEMENT *list = iobj->link.prev;
while (list) {
- if (IS_INSN(list) || IS_ADJUST(list)) {
+ if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
return list;
}
list = list->prev;
@@ -2324,141 +1822,23 @@ get_prev_insn(INSN *iobj)
return 0;
}
-static void
-unref_destination(INSN *iobj, int pos)
-{
- LABEL *lobj = (LABEL *)OPERAND_AT(iobj, pos);
- --lobj->refcnt;
- if (!lobj->refcnt) ELEM_REMOVE(&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) ELEM_REMOVE(&dl->link);
-}
-
-static LABEL*
-find_destination(INSN *i)
-{
- int pos, len = insn_len(i->insn_id);
- for (pos = 0; pos < len; ++pos) {
- if (insn_op_types(i->insn_id)[pos] == TS_OFFSET) {
- return (LABEL *)OPERAND_AT(i, pos);
- }
- }
- return 0;
-}
-
-static int
-remove_unreachable_chunk(rb_iseq_t *iseq, LINK_ELEMENT *i)
-{
- LINK_ELEMENT *first = i, *end;
- int *unref_counts = 0, nlabels = ISEQ_COMPILE_DATA(iseq)->label_no;
-
- if (!i) return 0;
- unref_counts = ALLOCA_N(int, nlabels);
- MEMZERO(unref_counts, int, nlabels);
- end = i;
- do {
- LABEL *lab;
- if (IS_INSN(i)) {
- if (IS_INSN_ID(i, leave)) {
- end = i;
- break;
- }
- else if ((lab = find_destination((INSN *)i)) != 0) {
- if (lab->unremovable) break;
- unref_counts[lab->label_no]++;
- }
- }
- else if (IS_LABEL(i)) {
- lab = (LABEL *)i;
- if (lab->unremovable) return 0;
- if (lab->refcnt > unref_counts[lab->label_no]) {
- if (i == first) return 0;
- break;
- }
- continue;
- }
- else if (IS_TRACE(i)) {
- /* do nothing */
- }
- else if (IS_ADJUST(i)) {
- LABEL *dest = ((ADJUST *)i)->label;
- if (dest && dest->unremovable) return 0;
- }
- end = i;
- } while ((i = i->next) != 0);
- i = first;
- do {
- if (IS_INSN(i)) {
- struct rb_iseq_constant_body *body = iseq->body;
- VALUE insn = INSN_OF(i);
- int pos, len = insn_len(insn);
- for (pos = 0; pos < len; ++pos) {
- switch (insn_op_types(insn)[pos]) {
- case TS_OFFSET:
- unref_destination((INSN *)i, pos);
- break;
- case TS_CALLINFO:
- if (((struct rb_call_info *)OPERAND_AT(i, pos))->flag & VM_CALL_KWARG)
- --(body->ci_kw_size);
- else
- --(body->ci_size);
- break;
- }
- }
- }
- ELEM_REMOVE(i);
- } while ((i != end) && (i = i->next) != 0);
- return 1;
-}
-
-static int
-iseq_pop_newarray(rb_iseq_t *iseq, INSN *iobj)
-{
- switch (OPERAND_AT(iobj, 0)) {
- case INT2FIX(0): /* empty array */
- ELEM_REMOVE(&iobj->link);
- return TRUE;
- case INT2FIX(1): /* single element array */
- ELEM_REMOVE(&iobj->link);
- return FALSE;
- default:
- iobj->insn_id = BIN(adjuststack);
- return TRUE;
- }
-}
-
-static int
-same_debug_pos_p(LINK_ELEMENT *iobj1, LINK_ELEMENT *iobj2)
-{
- VALUE debug1 = OPERAND_AT(iobj1, 0);
- VALUE debug2 = OPERAND_AT(iobj2, 0);
- if (debug1 == debug2) return TRUE;
- if (!RB_TYPE_P(debug1, T_ARRAY)) return FALSE;
- if (!RB_TYPE_P(debug2, T_ARRAY)) return FALSE;
- if (RARRAY_LEN(debug1) != 2) return FALSE;
- if (RARRAY_LEN(debug2) != 2) return FALSE;
- if (RARRAY_AREF(debug1, 0) != RARRAY_AREF(debug2, 0)) return FALSE;
- if (RARRAY_AREF(debug1, 1) != RARRAY_AREF(debug2, 1)) return FALSE;
- return TRUE;
-}
-
static int
iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcallopt)
{
- INSN *const iobj = (INSN *)list;
+ INSN *iobj = (INSN *)list;
again:
- if (IS_INSN_ID(iobj, jump)) {
+ if (iobj->insn_id == BIN(jump)) {
INSN *niobj, *diobj, *piobj;
+ /*
+ * useless jump elimination:
+ * jump LABEL1
+ * ...
+ * LABEL1:
+ * jump LABEL2
+ *
+ * => in this case, first jump instruction should jump to
+ * LABEL2 directly
+ */
diobj = (INSN *)get_destination_insn(iobj);
niobj = (INSN *)get_next_insn(iobj);
@@ -2469,28 +1849,15 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* =>
* LABEL:
*/
- unref_destination(iobj, 0);
- ELEM_REMOVE(&iobj->link);
- return COMPILE_OK;
+ REMOVE_ELEM(&iobj->link);
}
- else if (iobj != diobj && IS_INSN_ID(diobj, jump) &&
- OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
- /*
- * useless jump elimination:
- * jump LABEL1
- * ...
- * LABEL1:
- * jump LABEL2
- *
- * => in this case, first jump instruction should jump to
- * LABEL2 directly
- */
- replace_destination(iobj, diobj);
- remove_unreachable_chunk(iseq, iobj->link.next);
- goto again;
+ 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 (IS_INSN_ID(diobj, leave)) {
- INSN *pop;
+ else if (diobj->insn_id == BIN(leave)) {
/*
* jump LABEL
* ...
@@ -2498,116 +1865,47 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* leave
* =>
* leave
- * pop
* ...
* 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 */
- unref_destination(iobj, 0);
- iobj->insn_id = BIN(leave);
- iobj->operand_size = 0;
- iobj->insn_info = diobj->insn_info;
- /* adjust stack depth */
- pop = new_insn_body(iseq, diobj->insn_info.line_no, BIN(pop), 0);
- ELEM_INSERT_NEXT(&iobj->link, &pop->link);
- goto again;
- }
- else if (IS_INSN(iobj->link.prev) &&
- (piobj = (INSN *)iobj->link.prev) &&
- (IS_INSN_ID(piobj, branchif) ||
- IS_INSN_ID(piobj, branchunless))) {
- INSN *pdiobj = (INSN *)get_destination_insn(piobj);
- if (niobj == pdiobj) {
- int refcnt = IS_LABEL(piobj->link.next) ?
- ((LABEL *)piobj->link.next)->refcnt : 0;
- /*
- * useless jump elimination (if/unless destination):
- * if L1
- * jump L2
- * L1:
- * ...
- * L2:
- *
- * ==>
- * unless L2
- * L1:
- * ...
- * L2:
- */
- piobj->insn_id = (IS_INSN_ID(piobj, branchif))
+ REPLACE_ELEM((LINK_ELEMENT *)iobj, (LINK_ELEMENT *)eiobj);
+ INSERT_ELEM_NEXT((LINK_ELEMENT *)eiobj, (LINK_ELEMENT *)popiobj);
+ iobj = popiobj;
+ }
+ /*
+ * useless jump elimination (if/unless destination):
+ * if L1
+ * jump L2
+ * L1:
+ * ...
+ * L2:
+ *
+ * ==>
+ * unless L2
+ * L1:
+ * ...
+ * L2:
+ */
+ else if ((piobj = (INSN *)get_prev_insn(iobj)) != 0 &&
+ (piobj->insn_id == BIN(branchif) ||
+ piobj->insn_id == BIN(branchunless))) {
+ if (niobj == (INSN *)get_destination_insn(piobj)) {
+ piobj->insn_id = (piobj->insn_id == BIN(branchif))
? BIN(branchunless) : BIN(branchif);
- replace_destination(piobj, iobj);
- if (refcnt <= 1) {
- ELEM_REMOVE(&iobj->link);
- }
- else {
- /* TODO: replace other branch destinations too */
- }
- return COMPILE_OK;
+ OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
+ REMOVE_ELEM(&iobj->link);
}
- else if (diobj == pdiobj) {
- /*
- * useless jump elimination (if/unless before jump):
- * L1:
- * ...
- * if L1
- * jump L1
- *
- * ==>
- * L1:
- * ...
- * pop
- * jump L1
- */
- INSN *popiobj = new_insn_core(iseq, iobj->insn_info.line_no,
- BIN(pop), 0, 0);
- ELEM_REPLACE(&piobj->link, &popiobj->link);
- }
- }
- if (remove_unreachable_chunk(iseq, iobj->link.next)) {
- goto again;
- }
- }
-
- /*
- * putstring "beg"
- * putstring "end"
- * newrange excl
- *
- * ==>
- *
- * putobject "beg".."end"
- */
- if (IS_INSN_ID(iobj, checkmatch)) {
- INSN *range = (INSN *)get_prev_insn(iobj);
- INSN *beg, *end;
-
- if (range && IS_INSN_ID(range, newrange) &&
- (end = (INSN *)get_prev_insn(range)) != 0 &&
- IS_INSN_ID(end, putstring) &&
- (beg = (INSN *)get_prev_insn(end)) != 0 &&
- IS_INSN_ID(beg, putstring)) {
- VALUE str_beg = OPERAND_AT(beg, 0);
- VALUE str_end = OPERAND_AT(end, 0);
- int excl = FIX2INT(OPERAND_AT(range, 0));
- VALUE lit_range = rb_range_new(str_beg, str_end, excl);
-
- iseq_add_mark_object_compile_time(iseq, lit_range);
- ELEM_REMOVE(&beg->link);
- ELEM_REMOVE(&end->link);
- range->insn_id = BIN(putobject);
- OPERAND_AT(range, 0) = lit_range;
}
}
- if (IS_INSN_ID(iobj, leave)) {
- remove_unreachable_chunk(iseq, iobj->link.next);
- }
-
- if (IS_INSN_ID(iobj, branchif) ||
- IS_INSN_ID(iobj, branchnil) ||
- IS_INSN_ID(iobj, branchunless)) {
+ if (iobj->insn_id == BIN(branchif) ||
+ iobj->insn_id == BIN(branchunless)) {
/*
* if L1
* ...
@@ -2617,236 +1915,12 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* if L2
*/
INSN *nobj = (INSN *)get_destination_insn(iobj);
- INSN *pobj = (INSN *)iobj->link.prev;
- int prev_dup = 0;
- if (pobj) {
- if (!IS_INSN(&pobj->link))
- pobj = 0;
- else if (IS_INSN_ID(pobj, dup))
- prev_dup = 1;
- }
-
- for (;;) {
- if (IS_INSN_ID(nobj, jump)) {
- replace_destination(iobj, nobj);
- }
- else if (prev_dup && IS_INSN_ID(nobj, 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 && IS_INSN(pobj->link.prev)) {
- pobj = (INSN *)pobj->link.prev;
- }
- if (IS_INSN_ID(pobj, putobject)) {
- cond = (IS_INSN_ID(iobj, branchif) ?
- OPERAND_AT(pobj, 0) != Qfalse :
- IS_INSN_ID(iobj, branchunless) ?
- OPERAND_AT(pobj, 0) == Qfalse :
- FALSE);
- }
- else if (IS_INSN_ID(pobj, putstring) ||
- IS_INSN_ID(pobj, duparray) ||
- IS_INSN_ID(pobj, newarray)) {
- cond = IS_INSN_ID(iobj, branchif);
- }
- else if (IS_INSN_ID(pobj, putnil)) {
- cond = !IS_INSN_ID(iobj, branchif);
- }
- else break;
- if (prev_dup || !IS_INSN_ID(pobj, newarray)) {
- ELEM_REMOVE(iobj->link.prev);
- }
- else if (!iseq_pop_newarray(iseq, pobj)) {
- pobj = new_insn_core(iseq, pobj->insn_info.line_no, BIN(pop), 0, NULL);
- ELEM_INSERT_PREV(&iobj->link, &pobj->link);
- }
- if (cond) {
- if (prev_dup) {
- pobj = new_insn_core(iseq, pobj->insn_info.line_no, BIN(putnil), 0, NULL);
- ELEM_INSERT_NEXT(&iobj->link, &pobj->link);
- }
- iobj->insn_id = BIN(jump);
- goto again;
- }
- else {
- unref_destination(iobj, 0);
- ELEM_REMOVE(&iobj->link);
- }
- break;
- }
- else break;
- nobj = (INSN *)get_destination_insn(nobj);
- }
- }
-
- if (IS_INSN_ID(iobj, pop)) {
- /*
- * putself / putnil / putobject obj / putstring "..."
- * pop
- * =>
- * # do nothing
- */
- LINK_ELEMENT *prev = iobj->link.prev;
- if (IS_INSN(prev)) {
- enum ruby_vminsn_type previ = ((INSN *)prev)->insn_id;
- if (previ == BIN(putobject) || previ == BIN(putnil) ||
- previ == BIN(putself) || previ == BIN(putstring) ||
- previ == BIN(duparray)) {
- /* just push operand or static value and pop soon, no
- * side effects */
- ELEM_REMOVE(prev);
- ELEM_REMOVE(&iobj->link);
- }
- else if (previ == BIN(newarray) && iseq_pop_newarray(iseq, (INSN*)prev)) {
- ELEM_REMOVE(&iobj->link);
- }
- }
- }
-
- if (IS_INSN_ID(iobj, newarray) ||
- IS_INSN_ID(iobj, duparray) ||
- IS_INSN_ID(iobj, expandarray) ||
- IS_INSN_ID(iobj, concatarray) ||
- IS_INSN_ID(iobj, splatarray) ||
- 0) {
- /*
- * newarray N
- * splatarray
- * =>
- * newarray N
- * newarray always puts an array
- */
- LINK_ELEMENT *next = iobj->link.next;
- if (IS_INSN(next) && IS_INSN_ID(next, splatarray)) {
- /* remove splatarray following always-array insn */
- ELEM_REMOVE(next);
- }
- }
-
- if (IS_INSN_ID(iobj, tostring)) {
- LINK_ELEMENT *next = iobj->link.next;
- /*
- * tostring
- * concatstrings 1
- * =>
- * tostring
- */
- if (IS_INSN(next) && IS_INSN_ID(next, concatstrings) &&
- OPERAND_AT(next, 0) == INT2FIX(1)) {
- ELEM_REMOVE(next);
- }
- }
-
- if (IS_INSN_ID(iobj, putstring) ||
- (IS_INSN_ID(iobj, putobject) && RB_TYPE_P(OPERAND_AT(iobj, 0), T_STRING))) {
- /*
- * putstring ""
- * concatstrings N
- * =>
- * concatstrings N-1
- */
- if (IS_NEXT_INSN_ID(&iobj->link, concatstrings) &&
- RSTRING_LEN(OPERAND_AT(iobj, 0)) == 0) {
- INSN *next = (INSN *)iobj->link.next;
- if ((OPERAND_AT(next, 0) = FIXNUM_INC(OPERAND_AT(next, 0), -1)) == INT2FIX(1)) {
- ELEM_REMOVE(&next->link);
- }
- ELEM_REMOVE(&iobj->link);
+ if (nobj->insn_id == BIN(jump)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
}
}
- if (IS_INSN_ID(iobj, concatstrings)) {
- /*
- * concatstrings N
- * concatstrings M
- * =>
- * concatstrings N+M-1
- */
- LINK_ELEMENT *next = iobj->link.next, *freeze = 0;
- INSN *jump = 0;
- if (IS_INSN(next) && IS_INSN_ID(next, freezestring))
- next = (freeze = next)->next;
- if (IS_INSN(next) && IS_INSN_ID(next, jump))
- next = get_destination_insn(jump = (INSN *)next);
- if (IS_INSN(next) && IS_INSN_ID(next, concatstrings)) {
- int n = FIX2INT(OPERAND_AT(iobj, 0)) + FIX2INT(OPERAND_AT(next, 0)) - 1;
- OPERAND_AT(iobj, 0) = INT2FIX(n);
- if (jump) {
- LABEL *label = ((LABEL *)OPERAND_AT(jump, 0));
- if (!--label->refcnt) {
- ELEM_REMOVE(&label->link);
- }
- else {
- label = NEW_LABEL(0);
- OPERAND_AT(jump, 0) = (VALUE)label;
- }
- label->refcnt++;
- if (freeze && IS_NEXT_INSN_ID(next, freezestring)) {
- if (same_debug_pos_p(freeze, next->next)) {
- ELEM_REMOVE(freeze);
- }
- else {
- next = next->next;
- }
- }
- ELEM_INSERT_NEXT(next, &label->link);
- CHECK(iseq_peephole_optimize(iseq, get_next_insn(jump), do_tailcallopt));
- }
- else {
- if (freeze) ELEM_REMOVE(freeze);
- ELEM_REMOVE(next);
- }
- }
- }
-
- if (do_tailcallopt &&
- (IS_INSN_ID(iobj, send) ||
- IS_INSN_ID(iobj, opt_aref_with) ||
- IS_INSN_ID(iobj, opt_aset_with) ||
- IS_INSN_ID(iobj, invokesuper))) {
+ if (do_tailcallopt && iobj->insn_id == BIN(leave)) {
/*
* send ...
* leave
@@ -2854,102 +1928,34 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* send ..., ... | VM_CALL_TAILCALL, ...
* leave # unreachable
*/
- INSN *piobj = NULL;
- if (iobj->link.next) {
- LINK_ELEMENT *next = iobj->link.next;
- do {
- if (!IS_INSN(next)) {
- next = next->next;
- continue;
- }
- switch (INSN_OF(next)) {
- case BIN(nop):
- 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);
- }
+ INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
+ enum ruby_vminsn_type previ = piobj->insn_id;
- if (piobj) {
- struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
- if (IS_INSN_ID(piobj, send) || IS_INSN_ID(piobj, invokesuper)) {
- if (piobj->operands[2] == 0) { /* no blockiseq */
- ci->flag |= VM_CALL_TAILCALL;
- }
- }
- else {
+ 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) {
ci->flag |= VM_CALL_TAILCALL;
}
}
}
-
- if (IS_INSN_ID(iobj, dup)) {
- if (IS_NEXT_INSN_ID(&iobj->link, setlocal)) {
- LINK_ELEMENT *set1 = iobj->link.next, *set2 = NULL;
- if (IS_NEXT_INSN_ID(set1, setlocal)) {
- set2 = set1->next;
- if (OPERAND_AT(set1, 0) == OPERAND_AT(set2, 0) &&
- OPERAND_AT(set1, 1) == OPERAND_AT(set2, 1)) {
- ELEM_REMOVE(set1);
- ELEM_REMOVE(&iobj->link);
- }
- }
- else if (IS_NEXT_INSN_ID(set1, dup) &&
- IS_NEXT_INSN_ID(set1->next, setlocal)) {
- set2 = set1->next->next;
- if (OPERAND_AT(set1, 0) == OPERAND_AT(set2, 0) &&
- OPERAND_AT(set1, 1) == OPERAND_AT(set2, 1)) {
- ELEM_REMOVE(set1->next);
- ELEM_REMOVE(set2);
- }
- }
- }
- }
-
- if (IS_INSN_ID(iobj, getlocal)) {
- LINK_ELEMENT *niobj = &iobj->link;
- if (IS_NEXT_INSN_ID(niobj, dup)) {
- niobj = niobj->next;
- }
- if (IS_NEXT_INSN_ID(niobj, setlocal)) {
- LINK_ELEMENT *set1 = niobj->next;
- if (OPERAND_AT(iobj, 0) == OPERAND_AT(set1, 0) &&
- OPERAND_AT(iobj, 1) == OPERAND_AT(set1, 1)) {
- ELEM_REMOVE(set1);
- ELEM_REMOVE(niobj);
- }
- }
- }
-
return COMPILE_OK;
}
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 (insn_id == BIN(opt_neq)) {
+ if (iobj->operand_size > old_opsize) {
VALUE *old_operands = iobj->operands;
- iobj->operand_size = 4;
+ if (insn_id != BIN(opt_neq)) {
+ rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
+ }
iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size * sizeof(VALUE));
iobj->operands[0] = old_operands[0];
- iobj->operands[1] = Qfalse; /* CALL_CACHE */
- iobj->operands[2] = (VALUE)new_callinfo(iseq, idEq, 1, 0, NULL, FALSE);
- iobj->operands[3] = Qfalse; /* CALL_CACHE */
+ iobj->operands[1] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0);
}
return COMPILE_OK;
@@ -2958,35 +1964,11 @@ insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
static int
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
{
- if (IS_INSN_ID(iobj, newarray) && iobj->link.next &&
- IS_INSN(iobj->link.next)) {
- /*
- * [a, b, ...].max/min -> a, b, c, opt_newarray_max/min
- */
- INSN *niobj = (INSN *)iobj->link.next;
- if (IS_INSN_ID(niobj, send)) {
- struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
- if ((ci->flag & VM_CALL_ARGS_SIMPLE) && ci->orig_argc == 0) {
- switch (ci->mid) {
- case idMax:
- iobj->insn_id = BIN(opt_newarray_max);
- ELEM_REMOVE(&niobj->link);
- return COMPILE_OK;
- case idMin:
- iobj->insn_id = BIN(opt_newarray_min);
- ELEM_REMOVE(&niobj->link);
- return COMPILE_OK;
- }
- }
- }
- }
-
- if (IS_INSN_ID(iobj, send)) {
- 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);
+ if (iobj->insn_id == BIN(send)) {
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, 0);
#define SP_INSN(opt) insn_set_specialized_instruction(iseq, iobj, BIN(opt_##opt))
- if (ci->flag & VM_CALL_ARGS_SIMPLE) {
+ if (ci->blockiseq == 0 && (ci->flag & ~VM_CALL_ARGS_SKIP_SETUP) == 0) {
switch (ci->orig_argc) {
case 0:
switch (ci->mid) {
@@ -3021,10 +2003,8 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
break;
}
}
-
- 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;
+ if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {
+ iobj->insn_id = BIN(opt_send_simple);
}
}
#undef SP_INSN
@@ -3032,41 +2012,20 @@ 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_TOP:
- case ISEQ_TYPE_EVAL:
- case ISEQ_TYPE_MAIN:
- /* not tail callable because cfp will be over popped */
- 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 *const anchor)
+iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
LINK_ELEMENT *list;
- 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;
-
+ 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;
list = FIRST_ELEMENT(anchor);
while (list) {
- if (IS_INSN(list)) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
if (do_peepholeopt) {
- iseq_peephole_optimize(iseq, list, tailcallopt);
+ iseq_peephole_optimize(iseq, list, do_tailcallopt);
}
if (do_si) {
iseq_specialized_instruction(iseq, (INSN *)list);
@@ -3075,17 +2034,6 @@ iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
insn_operands_unification((INSN *)list);
}
}
- if (IS_LABEL(list)) {
- 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;
@@ -3123,7 +2071,7 @@ new_unified_insn(rb_iseq_t *iseq,
list = list->next;
}
- return new_insn_core(iseq, iobj->insn_info.line_no, insn_id, argc, operands);
+ return new_insn_core(iseq, iobj->line_no, insn_id, argc, operands);
}
#endif
@@ -3133,7 +2081,7 @@ new_unified_insn(rb_iseq_t *iseq,
* It's future work (if compile time was bottle neck).
*/
static int
-iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
+iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
#if OPT_INSTRUCTIONS_UNIFICATION
LINK_ELEMENT *list;
@@ -3143,7 +2091,7 @@ iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
list = FIRST_ELEMENT(anchor);
while (list) {
- if (IS_INSN(list)) {
+ if (list->type == ISEQ_ELEMENT_INSN) {
iobj = (INSN *)list;
id = iobj->insn_id;
if (unified_insns_data[id] != 0) {
@@ -3152,7 +2100,7 @@ iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
const int *unified = entry[j];
LINK_ELEMENT *li = list->next;
for (k = 2; k < unified[1]; k++) {
- if (!IS_INSN(li) ||
+ if (li->type != ISEQ_ELEMENT_INSN ||
((INSN *)li)->insn_id != unified[k]) {
goto miss;
}
@@ -3191,7 +2139,7 @@ iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
#include "opt_sc.inc"
static int
-insn_set_sc_state(rb_iseq_t *iseq, const LINK_ELEMENT *anchor, INSN *iobj, int state)
+insn_set_sc_state(rb_iseq_t *iseq, INSN *iobj, int state)
{
int nstate;
int insn_id;
@@ -3206,12 +2154,12 @@ insn_set_sc_state(rb_iseq_t *iseq, const LINK_ELEMENT *anchor, INSN *iobj, int s
if (lobj->sc_state != 0) {
if (lobj->sc_state != nstate) {
- BADINSN_DUMP(anchor, iobj, lobj);
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "insn_set_sc_state error: %d at "LABEL_FORMAT
- ", %d expected\n",
- lobj->sc_state, lobj->label_no, nstate);
- return COMPILE_NG;
+ 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;
}
}
else {
@@ -3247,7 +2195,7 @@ label_set_sc_state(LABEL *lobj, int state)
#endif
static int
-iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
+iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
{
#if OPT_STACK_CACHING
LINK_ELEMENT *list;
@@ -3278,7 +2226,7 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
new_insn_body(iseq, 0, BIN(reput), 0);
/* replace this insn */
- ELEM_REPLACE(list, (LINK_ELEMENT *)rpobj);
+ REPLACE_ELEM(list, (LINK_ELEMENT *)rpobj);
list = (LINK_ELEMENT *)rpobj;
goto redo_point;
}
@@ -3289,7 +2237,7 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
if (state == SCS_AB || state == SCS_BA) {
state = (state == SCS_AB ? SCS_BA : SCS_AB);
- ELEM_REMOVE(list);
+ REMOVE_ELEM(list);
list = list->next;
goto redo_point;
}
@@ -3311,12 +2259,11 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
case SCS_XX:
goto normal_insn;
default:
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "unreachable");
- return COMPILE_NG;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), iobj->line_no,
+ "unreachable");
}
/* remove useless pop */
- ELEM_REMOVE(list);
+ REMOVE_ELEM(list);
list = list->next;
goto redo_point;
}
@@ -3324,7 +2271,7 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
/* none */
} /* end of switch */
normal_insn:
- state = insn_set_sc_state(iseq, anchor, iobj, state);
+ state = insn_set_sc_state(iseq, iobj, state);
break;
}
case ISEQ_ELEMENT_LABEL:
@@ -3344,153 +2291,83 @@ iseq_set_sequence_stackcaching(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
}
static int
-all_string_result_p(const NODE *node)
+compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
{
- if (!node) return FALSE;
- switch (nd_type(node)) {
- case NODE_STR: case NODE_DSTR:
- return TRUE;
- case NODE_IF: case NODE_UNLESS:
- if (!node->nd_body || !node->nd_else) return FALSE;
- if (all_string_result_p(node->nd_body))
- return all_string_result_p(node->nd_else);
- return FALSE;
- case NODE_AND: case NODE_OR:
- if (!node->nd_2nd)
- return all_string_result_p(node->nd_1st);
- if (!all_string_result_p(node->nd_1st))
- return FALSE;
- return all_string_result_p(node->nd_2nd);
- default:
- return FALSE;
- }
-}
-
-static int
-compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int *cntp)
-{
- const NODE *list = node->nd_next;
+ 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)) {
- COMPILE_ERROR(ERROR_ARGS "dstr: must be string: %s",
- rb_builtin_type_name(TYPE(lit)));
- return COMPILE_NG;
- }
- lit = freeze_literal(iseq, lit);
+ if (RB_TYPE_P(lit, T_STRING))
+ lit = node->nd_lit = rb_fstring(node->nd_lit);
ADD_INSN1(ret, nd_line(node), putobject, lit);
- if (RSTRING_LEN(lit) == 0) first_lit = LAST_ELEMENT(ret);
}
while (list) {
- const NODE *const head = list->nd_head;
- if (nd_type(head) == NODE_STR) {
- lit = freeze_literal(iseq, head->nd_lit);
- ADD_INSN1(ret, nd_line(head), putobject, lit);
- lit = Qnil;
+ node = list->nd_head;
+ if (nd_type(node) == NODE_STR) {
+ node->nd_lit = rb_fstring(node->nd_lit);
+ ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
}
else {
- CHECK(COMPILE(ret, "each string", head));
+ COMPILE(ret, "each string", node);
}
cnt++;
list = list->nd_next;
}
- if (NIL_P(lit) && first_lit) {
- ELEM_REMOVE(first_lit);
- --cnt;
- }
*cntp = cnt;
return COMPILE_OK;
}
static int
-compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node)
+compile_dstr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
{
int cnt;
- CHECK(compile_dstr_fragments(iseq, ret, node, &cnt));
+ compile_dstr_fragments(iseq, ret, node, &cnt);
ADD_INSN1(ret, nd_line(node), concatstrings, INT2FIX(cnt));
return COMPILE_OK;
}
static int
-compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node)
+compile_dregx(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node)
{
int cnt;
- CHECK(compile_dstr_fragments(iseq, ret, node, &cnt));
+ compile_dstr_fragments(iseq, ret, node, &cnt);
ADD_INSN2(ret, nd_line(node), toregexp, INT2FIX(node->nd_cflag), INT2FIX(cnt));
return COMPILE_OK;
}
static int
-compile_flip_flop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int again,
- LABEL *then_label, LABEL *else_label)
-{
- const int line = nd_line(node);
- LABEL *lend = NEW_LABEL(line);
- rb_num_t cnt = ISEQ_FLIP_CNT_INCREMENT(iseq->body->local_iseq)
- + VM_SVAR_FLIPFLOP_START;
- VALUE key = INT2FIX(cnt);
-
- ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));
- ADD_INSNL(ret, line, branchif, lend);
-
- /* *flip == 0 */
- CHECK(COMPILE(ret, "flip2 beg", node->nd_beg));
- ADD_INSNL(ret, line, branchunless, else_label);
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSN1(ret, line, setspecial, key);
- if (!again) {
- ADD_INSNL(ret, line, jump, then_label);
- }
-
- /* *flip == 1 */
- ADD_LABEL(ret, lend);
- CHECK(COMPILE(ret, "flip2 end", node->nd_end));
- ADD_INSNL(ret, line, branchunless, then_label);
- ADD_INSN1(ret, line, putobject, Qfalse);
- ADD_INSN1(ret, line, setspecial, key);
- ADD_INSNL(ret, line, jump, then_label);
-
- return COMPILE_OK;
-}
-
-static int
-compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *cond,
+compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
LABEL *then_label, LABEL *else_label)
{
- again:
switch (nd_type(cond)) {
case NODE_AND:
{
LABEL *label = NEW_LABEL(nd_line(cond));
- CHECK(compile_branch_condition(iseq, ret, cond->nd_1st, label,
- else_label));
- if (!label->refcnt) break;
+ compile_branch_condition(iseq, ret, cond->nd_1st, label,
+ else_label);
ADD_LABEL(ret, label);
- cond = cond->nd_2nd;
- goto again;
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
}
case NODE_OR:
{
LABEL *label = NEW_LABEL(nd_line(cond));
- CHECK(compile_branch_condition(iseq, ret, cond->nd_1st, then_label,
- label));
- if (!label->refcnt) break;
+ compile_branch_condition(iseq, ret, cond->nd_1st, then_label,
+ label);
ADD_LABEL(ret, label);
- cond = cond->nd_2nd;
- goto again;
+ compile_branch_condition(iseq, ret, cond->nd_2nd, then_label,
+ else_label);
+ break;
}
- case NODE_LIT: /* NODE_LIT is always true */
+ case NODE_LIT: /* NODE_LIT is always not true */
case NODE_TRUE:
case NODE_STR:
- case NODE_ZARRAY:
- case NODE_LAMBDA:
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
ADD_INSNL(ret, nd_line(cond), jump, then_label);
break;
@@ -3499,18 +2376,8 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *co
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
ADD_INSNL(ret, nd_line(cond), jump, else_label);
break;
- case NODE_FLIP2:
- CHECK(compile_flip_flop(iseq, ret, cond, TRUE, then_label, else_label));
- break;
- case NODE_FLIP3:
- CHECK(compile_flip_flop(iseq, ret, cond, FALSE, then_label, else_label));
- break;
- case NODE_DEFINED:
- CHECK(compile_defined_expr(iseq, ret, cond, Qfalse));
- goto branch;
default:
- CHECK(COMPILE(ret, "branch condition", cond));
- branch:
+ COMPILE(ret, "branch condition", cond);
ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
ADD_INSNL(ret, nd_line(cond), jump, then_label);
break;
@@ -3518,107 +2385,22 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *co
return COMPILE_OK;
}
-static int
-compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const root_node,
- struct rb_call_info_kw_arg **const kw_arg_ptr,
- unsigned int *flag)
-{
- 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) {
- const NODE *node = root_node->nd_head;
-
- while (node) {
- const NODE *key_node = node->nd_head;
-
- assert(nd_type(node) == NODE_ARRAY);
- if (!key_node) {
- if (flag && !root_node->nd_alen) *flag |= VM_CALL_KW_SPLAT;
- return FALSE;
- }
- else if (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) {
- const NODE *key_node = node->nd_head;
- const 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,
COMPILE_ARRAY_TYPE_ARGS
};
-static inline int
-static_literal_node_p(const NODE *node)
-{
- node = node->nd_head;
- switch (nd_type(node)) {
- case NODE_LIT:
- case NODE_NIL:
- case NODE_TRUE:
- case NODE_FALSE:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-static inline VALUE
-static_literal_value(const NODE *node)
-{
- node = node->nd_head;
- switch (nd_type(node)) {
- case NODE_NIL:
- return Qnil;
- case NODE_TRUE:
- return Qtrue;
- case NODE_FALSE:
- return Qfalse;
- default:
- return node->nd_lit;
- }
-}
-
static int
-compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_root,
- enum compile_array_type_t type, struct rb_call_info_kw_arg **keywords_ptr,
- unsigned int *flag, int popped)
+compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
+ enum compile_array_type_t type, int poped)
{
- const NODE *node = node_root;
+ NODE *node = node_root;
int line = (int)nd_line(node);
int len = 0;
if (nd_type(node) == NODE_ZARRAY) {
- if (!popped) {
+ if (!poped) {
switch (type) {
case COMPILE_ARRAY_TYPE_ARRAY: ADD_INSN1(ret, line, newarray, INT2FIX(0)); break;
case COMPILE_ARRAY_TYPE_HASH: ADD_INSN1(ret, line, newhash, INT2FIX(0)); break;
@@ -3631,60 +2413,48 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
int first = 1, i;
while (node) {
- const NODE *start_node = node, *end_node;
- const NODE *kw = 0;
+ NODE *start_node = node, *end_node;
+ NODE *kw = 0;
const int max = 0x100;
DECL_ANCHOR(anchor);
INIT_ANCHOR(anchor);
for (i=0; i<max && node; i++, len++, node = node->nd_next) {
- if (CPDEBUG > 0) {
- EXPECT_NODE("compile_array", node, NODE_ARRAY, -1);
+ 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 (type != COMPILE_ARRAY_TYPE_ARRAY && !node->nd_head) {
+ if (type == COMPILE_ARRAY_TYPE_HASH && !node->nd_head) {
+ opt_p = 0;
kw = node->nd_next;
- node = 0;
- if (kw) {
- opt_p = 0;
- node = kw->nd_next;
- kw = kw->nd_head;
- }
+ node = kw->nd_next;
+ kw = kw->nd_head;
break;
}
- if (opt_p && !static_literal_node_p(node)) {
+ if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
opt_p = 0;
}
- if (type == COMPILE_ARRAY_TYPE_ARGS &&
- node->nd_next == NULL /* last node */ &&
- compile_array_keyword_arg(iseq, anchor, node->nd_head, keywords_ptr, flag)) {
- len--;
- }
- else {
- COMPILE_(anchor, "array element", node->nd_head, popped);
- }
+ COMPILE_(anchor, "array element", node->nd_head, poped);
}
if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
- if (!popped) {
+ if (!poped) {
VALUE ary = rb_ary_tmp_new(i);
end_node = node;
node = start_node;
while (node != end_node) {
- rb_ary_push(ary, static_literal_value(node));
+ rb_ary_push(ary, node->nd_head->nd_lit);
node = node->nd_next;
}
- while (node && node->nd_next &&
- static_literal_node_p(node) &&
- static_literal_node_p(node->nd_next)) {
- VALUE elem[2];
- elem[0] = static_literal_value(node);
- elem[1] = static_literal_value(node->nd_next);
- rb_ary_cat(ary, elem, 2);
- node = node->nd_next->nd_next;
+ while (node && nd_type(node->nd_head) == NODE_LIT &&
+ node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
len++;
}
@@ -3709,21 +2479,15 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
ADD_INSN(ret, line, concatarray);
}
else {
-#if 0
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putobject, ary);
ADD_SEND(ret, line, id_core_hash_merge_ary, INT2FIX(1));
- /* wrong number of arguments -----------------------^ */
-#else
- COMPILE_ERROR(ERROR_ARGS "core#hash_merge_ary");
- return -1;
-#endif
}
}
}
}
else {
- if (!popped || kw) {
+ if (!poped) {
switch (type) {
case COMPILE_ARRAY_TYPE_ARRAY:
ADD_INSN1(anchor, line, newarray, INT2FIX(i));
@@ -3740,36 +2504,23 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
case COMPILE_ARRAY_TYPE_HASH:
if (i > 0) {
if (first) {
- if (!popped) {
- ADD_INSN1(anchor, line, newhash, INT2FIX(i));
- }
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
APPEND_LIST(ret, anchor);
}
else {
- if (!popped) {
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN(ret, line, swap);
- }
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
APPEND_LIST(ret, anchor);
- if (!popped) {
- ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
- }
+ ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
}
}
if (kw) {
VALUE nhash = (i > 0 || !first) ? INT2FIX(2) : INT2FIX(1);
- if (!popped) {
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (i > 0 || !first) ADD_INSN(ret, line, swap);
- }
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ if (i > 0 || !first) ADD_INSN(ret, line, swap);
COMPILE(ret, "keyword splat", kw);
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
- else {
- ADD_SEND(ret, line, id_core_hash_merge_kwd, nhash);
- if (nhash == INT2FIX(1)) ADD_SEND(ret, line, rb_intern("dup"), INT2FIX(0));
- }
+ 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;
@@ -3779,7 +2530,7 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
}
}
else {
- /* popped */
+ /* poped */
APPEND_LIST(ret, anchor);
}
}
@@ -3789,7 +2540,13 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
}
static VALUE
-case_when_optimizable_literal(const NODE *const node)
+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);
+}
+
+static VALUE
+case_when_optimizable_literal(NODE * node)
{
switch (nd_type(node)) {
case NODE_LIT: {
@@ -3804,24 +2561,17 @@ case_when_optimizable_literal(const NODE *const node)
}
break;
}
- case NODE_NIL:
- return Qnil;
- case NODE_TRUE:
- return Qtrue;
- case NODE_FALSE:
- return Qfalse;
case NODE_STR:
- return rb_fstring(node->nd_lit);
+ return node->nd_lit = rb_fstring(node->nd_lit);
}
return Qundef;
}
static int
-when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
- LABEL *l1, int only_special_literals, VALUE literals)
+when_vals(rb_iseq_t *iseq, LINK_ANCHOR *cond_seq, NODE *vals, LABEL *l1, int only_special_literals, VALUE literals)
{
while (vals) {
- const NODE *val = vals->nd_head;
+ NODE* val = vals->nd_head;
VALUE lit = case_when_optimizable_literal(val);
if (lit == Qundef) {
@@ -3829,9 +2579,7 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
}
else {
if (rb_hash_lookup(literals, lit) != Qnil) {
- VALUE file = rb_iseq_path(iseq);
- rb_compile_warning(RSTRING_PTR(file), nd_line(val),
- "duplicated when clause is ignored");
+ rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
}
else {
rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
@@ -3841,9 +2589,9 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
ADD_INSN(cond_seq, nd_line(val), dup); /* dup target */
if (nd_type(val) == NODE_STR) {
+ val->nd_lit = rb_fstring(val->nd_lit);
debugp_param("nd_lit", val->nd_lit);
- lit = freeze_literal(iseq, val->nd_lit);
- ADD_INSN1(cond_seq, nd_line(val), putobject, lit);
+ ADD_INSN1(cond_seq, nd_line(val), putobject, val->nd_lit);
}
else {
COMPILE(cond_seq, "when cond", val);
@@ -3857,44 +2605,41 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
}
static int
-compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node)
+compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node)
{
switch (nd_type(node)) {
case NODE_ATTRASGN: {
INSN *iobj;
- struct rb_call_info *ci;
+ rb_call_info_t *ci;
VALUE dupidx;
- int line = nd_line(node);
- CHECK(COMPILE_POPPED(ret, "masgn lhs (NODE_ATTRASGN)", node));
+ COMPILE_POPED(ret, "masgn lhs (NODE_ATTRASGN)", node);
- iobj = (INSN *)get_prev_insn((INSN *)LAST_ELEMENT(ret)); /* send insn */
- ci = (struct rb_call_info *)iobj->operands[0];
- ci->orig_argc += 1;
+ 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;
dupidx = INT2FIX(ci->orig_argc);
- 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 */
+ 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 */
break;
}
case NODE_MASGN: {
DECL_ANCHOR(anchor);
INIT_ANCHOR(anchor);
- CHECK(COMPILE_POPPED(anchor, "nest masgn lhs", node));
- ELEM_REMOVE(FIRST_ELEMENT(anchor));
+ COMPILE_POPED(anchor, "nest masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
ADD_SEQ(ret, anchor);
break;
}
default: {
DECL_ANCHOR(anchor);
INIT_ANCHOR(anchor);
- CHECK(COMPILE_POPPED(anchor, "masgn lhs", node));
- ELEM_REMOVE(FIRST_ELEMENT(anchor));
+ COMPILE_POPED(anchor, "masgn lhs", node);
+ REMOVE_ELEM(FIRST_ELEMENT(anchor));
ADD_SEQ(ret, anchor);
}
}
@@ -3902,26 +2647,25 @@ compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const n
return COMPILE_OK;
}
-static int
-compile_massign_opt_lhs(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *lhsn)
+static void
+compile_massign_opt_lhs(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *lhsn)
{
if (lhsn) {
- CHECK(compile_massign_opt_lhs(iseq, ret, lhsn->nd_next));
- CHECK(compile_massign_lhs(iseq, ret, lhsn->nd_head));
+ compile_massign_opt_lhs(iseq, ret, lhsn->nd_next);
+ compile_massign_lhs(iseq, ret, lhsn->nd_head);
}
- return COMPILE_OK;
}
static int
-compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *rhsn, const NODE *orig_lhsn)
+compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *rhsn, NODE *orig_lhsn)
{
VALUE mem[64];
const int memsize = numberof(mem);
int memindex = 0;
int llen = 0, rlen = 0;
int i;
- const NODE *lhsn = orig_lhsn;
+ NODE *lhsn = orig_lhsn;
#define MEMORY(v) { \
int i; \
@@ -3937,7 +2681,7 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
}
while (lhsn) {
- const NODE *ln = lhsn->nd_head;
+ NODE *ln = lhsn->nd_head;
switch (nd_type(ln)) {
case NODE_LASGN:
MEMORY(ln->nd_vid);
@@ -3945,6 +2689,7 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
case NODE_DASGN:
case NODE_DASGN_CURR:
case NODE_IASGN:
+ case NODE_IASGN2:
case NODE_CVASGN:
MEMORY(ln->nd_vid);
break;
@@ -3957,7 +2702,7 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
while (rhsn) {
if (llen <= rlen) {
- COMPILE_POPPED(ret, "masgn val (popped)", rhsn->nd_head);
+ COMPILE_POPED(ret, "masgn val (popped)", rhsn->nd_head);
}
else {
COMPILE(ret, "masgn val", rhsn->nd_head);
@@ -3976,96 +2721,58 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
return 1;
}
-static void
-adjust_stack(rb_iseq_t *iseq, LINK_ANCHOR *const 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 *const ret, const NODE *const node, int popped)
+compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int poped)
{
- const NODE *rhsn = node->nd_value;
- const NODE *splatn = node->nd_args;
- const NODE *lhsn = node->nd_head;
- int lhs_splat = (splatn && splatn != NODE_SPECIAL_NO_NAME_REST) ? 1 : 0;
+ NODE *rhsn = node->nd_value;
+ NODE *splatn = node->nd_args;
+ NODE *lhsn = node->nd_head;
+ int lhs_splat = (splatn && (VALUE)splatn != (VALUE)-1) ? 1 : 0;
- if (!popped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
+ if (!poped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
int llen = 0;
- int expand = 1;
DECL_ANCHOR(lhsseq);
INIT_ANCHOR(lhsseq);
while (lhsn) {
- CHECK(compile_massign_lhs(iseq, lhsseq, lhsn->nd_head));
+ compile_massign_lhs(iseq, lhsseq, lhsn->nd_head);
llen += 1;
lhsn = lhsn->nd_next;
}
COMPILE(ret, "normal masgn rhs", rhsn);
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, nd_line(node), dup);
}
- else if (!lhs_splat) {
- INSN *last = (INSN*)ret->last;
- if (IS_INSN(&last->link) &&
- IS_INSN_ID(last, 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_INSN2(ret, nd_line(node), expandarray,
+ INT2FIX(llen), INT2FIX(lhs_splat));
ADD_SEQ(ret, lhsseq);
if (lhs_splat) {
if (nd_type(splatn) == NODE_POSTARG) {
/*a, b, *r, p1, p2 */
- const NODE *postn = splatn->nd_2nd;
- const NODE *restn = splatn->nd_1st;
+ NODE *postn = splatn->nd_2nd;
+ NODE *restn = splatn->nd_1st;
int num = (int)postn->nd_alen;
- int flag = 0x02 | ((restn == NODE_SPECIAL_NO_NAME_REST) ? 0x00 : 0x01);
+ int flag = 0x02 | (((VALUE)restn == (VALUE)-1) ? 0x00 : 0x01);
ADD_INSN2(ret, nd_line(splatn), expandarray,
INT2FIX(num), INT2FIX(flag));
- if (restn != NODE_SPECIAL_NO_NAME_REST) {
- CHECK(compile_massign_lhs(iseq, ret, restn));
+ if ((VALUE)restn != (VALUE)-1) {
+ compile_massign_lhs(iseq, ret, restn);
}
while (postn) {
- CHECK(compile_massign_lhs(iseq, ret, postn->nd_head));
+ compile_massign_lhs(iseq, ret, postn->nd_head);
postn = postn->nd_next;
}
}
else {
/* a, b, *r */
- CHECK(compile_massign_lhs(iseq, ret, splatn));
+ compile_massign_lhs(iseq, ret, splatn);
}
}
}
@@ -4073,61 +2780,59 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node,
}
static int
-compile_const_prefix(rb_iseq_t *iseq, const NODE *const node,
- LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
+compile_colon2(rb_iseq_t *iseq, NODE * node,
+ LINK_ANCHOR *pref, LINK_ANCHOR *body)
{
switch (nd_type(node)) {
case NODE_CONST:
- debugi("compile_const_prefix - colon", node->nd_vid);
+ debugi("compile_colon2 - colon", node->nd_vid);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
break;
case NODE_COLON3:
- debugi("compile_const_prefix - colon3", node->nd_mid);
+ debugi("compile_colon2 - colon3", node->nd_mid);
ADD_INSN(body, nd_line(node), pop);
ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
break;
case NODE_COLON2:
- CHECK(compile_const_prefix(iseq, node->nd_head, pref, body));
- debugi("compile_const_prefix - colon2", node->nd_mid);
+ compile_colon2(iseq, node->nd_head, pref, body);
+ debugi("compile_colon2 - colon2", node->nd_mid);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
break;
default:
- CHECK(COMPILE(pref, "const colon2 prefix", node));
+ COMPILE(pref, "const colon2 prefix", node);
break;
}
return COMPILE_OK;
}
-static int
-compile_cpath(LINK_ANCHOR *const ret, rb_iseq_t *iseq, const NODE *cpath)
+static VALUE
+compile_cpath(LINK_ANCHOR *ret, rb_iseq_t *iseq, NODE *cpath)
{
if (nd_type(cpath) == NODE_COLON3) {
/* toplevel class ::Foo */
ADD_INSN1(ret, nd_line(cpath), putobject, rb_cObject);
- return VM_DEFINECLASS_FLAG_SCOPED;
+ return Qfalse;
}
else if (cpath->nd_head) {
/* Bar::Foo */
COMPILE(ret, "nd_else->nd_head", cpath->nd_head);
- return VM_DEFINECLASS_FLAG_SCOPED;
+ return Qfalse;
}
else {
/* class at cbase Foo */
ADD_INSN1(ret, nd_line(cpath), putspecialobject,
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
- return 0;
+ return Qtrue;
}
}
#define private_recv_p(node) (nd_type((node)->nd_recv) == NODE_SELF)
-static int
-defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr);
+#define defined_expr defined_expr0
static int
-defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr)
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
{
enum defined_type expr_type = 0;
enum node_type type;
@@ -4149,10 +2854,10 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
break;
case NODE_ARRAY:{
- const NODE *vals = node;
+ NODE *vals = node;
do {
- defined_expr0(iseq, ret, vals->nd_head, lfinish, Qfalse);
+ defined_expr(iseq, ret, vals->nd_head, lfinish, Qfalse);
if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
@@ -4202,14 +2907,19 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
}
- defined_expr0(iseq, ret, node->nd_head, lfinish, Qfalse);
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
- COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
- ADD_INSN3(ret, nd_line(node), defined,
- (rb_is_const_id(node->nd_mid) ?
- INT2FIX(DEFINED_CONST) : INT2FIX(DEFINED_METHOD)),
- ID2SYM(node->nd_mid), needstr);
+ if (rb_is_const_id(node->nd_mid)) {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
+ ID2SYM(node->nd_mid), needstr);
+ }
+ else {
+ COMPILE(ret, "defined/colon2#nd_head", node->nd_head);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
+ ID2SYM(node->nd_mid), needstr);
+ }
return 1;
case NODE_COLON3:
ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
@@ -4219,23 +2929,22 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
/* method dispatch */
case NODE_CALL:
- case NODE_OPCALL:
case NODE_VCALL:
case NODE_FCALL:
case NODE_ATTRASGN:{
const int explicit_receiver =
- (type == NODE_CALL || type == NODE_OPCALL ||
+ (type == NODE_CALL ||
(type == NODE_ATTRASGN && !private_recv_p(node)));
- if (!lfinish[1] && (node->nd_args || explicit_receiver)) {
+ if (!lfinish[1]) {
lfinish[1] = NEW_LABEL(nd_line(node));
}
if (node->nd_args) {
- defined_expr0(iseq, ret, node->nd_args, lfinish, Qfalse);
+ defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse);
ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
}
if (explicit_receiver) {
- defined_expr0(iseq, ret, node->nd_recv, lfinish, Qfalse);
+ 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);
ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_METHOD),
@@ -4281,6 +2990,7 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
case NODE_GASGN:
case NODE_IASGN:
case NODE_CDECL:
+ case NODE_CVDECL:
case NODE_CVASGN:
expr_type = DEFINED_ASGN;
break;
@@ -4298,10 +3008,11 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
}
return 0;
}
+#undef defined_expr
static int
-defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr)
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
{
LINK_ELEMENT *lcur = ret->last;
int done = defined_expr0(iseq, ret, node, lfinish, needstr);
@@ -4309,16 +3020,11 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
int line = nd_line(node);
LABEL *lstart = NEW_LABEL(line);
LABEL *lend = NEW_LABEL(line);
- const rb_iseq_t *rescue;
- NODE tmp_node, *node = &tmp_node;
- rb_node_init(node, NODE_NIL, 0, 0, 0);
- rescue = NEW_CHILD_ISEQ(node,
- 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;
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
APPEND_LABEL(ret, lcur, lstart);
ADD_LABEL(ret, lend);
ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
@@ -4326,63 +3032,38 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
return done;
}
-static int
-compile_defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, VALUE needstr)
-{
- const int line = nd_line(node);
- if (!node->nd_head) {
- VALUE str = rb_iseq_defined_string(DEFINED_NIL);
- ADD_INSN1(ret, line, putobject, str);
- }
- else {
- LABEL *lfinish[2];
- LINK_ELEMENT *last = ret->last;
- lfinish[0] = NEW_LABEL(line);
- lfinish[1] = 0;
- defined_expr(iseq, ret, node->nd_head, lfinish, needstr);
- if (lfinish[1]) {
- ELEM_INSERT_NEXT(last, &new_insn_body(iseq, line, BIN(putnil), 0)->link);
- ADD_INSN(ret, line, swap);
- ADD_INSN(ret, line, pop);
- ADD_LABEL(ret, lfinish[1]);
- }
- ADD_LABEL(ret, lfinish[0]);
- }
- return COMPILE_OK;
-}
-
static VALUE
-make_name_for_block(const rb_iseq_t *orig_iseq)
+make_name_for_block(rb_iseq_t *iseq)
{
int level = 1;
- const rb_iseq_t *iseq = orig_iseq;
+ rb_iseq_t *ip = iseq;
- if (orig_iseq->body->parent_iseq != 0) {
- while (orig_iseq->body->local_iseq != iseq) {
- if (iseq->body->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->parent_iseq != 0) {
+ while (ip->local_iseq != ip) {
+ if (ip->type == ISEQ_TYPE_BLOCK) {
level++;
}
- iseq = iseq->body->parent_iseq;
+ ip = ip->parent_iseq;
}
}
if (level == 1) {
- return rb_sprintf("block in %"PRIsVALUE, iseq->body->location.label);
+ return rb_sprintf("block in %"PRIsVALUE, ip->location.label);
}
else {
- return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, iseq->body->location.label);
+ return rb_sprintf("block (%d levels) in %"PRIsVALUE, level, ip->location.label);
}
}
static void
push_ensure_entry(rb_iseq_t *iseq,
struct iseq_compile_data_ensure_node_stack *enl,
- struct ensure_range *er, const NODE *const node)
+ struct ensure_range *er, NODE *node)
{
enl->ensure_node = node;
- enl->prev = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack; /* prev */
+ enl->prev = iseq->compile_data->ensure_node_stack; /* prev */
enl->erange = er;
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl;
+ iseq->compile_data->ensure_node_stack = enl;
}
static void
@@ -4404,16 +3085,16 @@ add_ensure_range(rb_iseq_t *iseq, struct ensure_range *erange,
}
static void
-add_ensure_iseq(LINK_ANCHOR *const ret, rb_iseq_t *iseq, int is_return)
+add_ensure_iseq(LINK_ANCHOR *ret, rb_iseq_t *iseq, int is_return)
{
struct iseq_compile_data_ensure_node_stack *enlp =
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack;
+ iseq->compile_data->ensure_node_stack;
struct iseq_compile_data_ensure_node_stack *prev_enlp = enlp;
DECL_ANCHOR(ensure);
INIT_ANCHOR(ensure);
while (enlp) {
- if (enlp->erange != NULL) {
+ if (enlp->erange != 0) {
DECL_ANCHOR(ensure_part);
LABEL *lstart = NEW_LABEL(0);
LABEL *lend = NEW_LABEL(0);
@@ -4421,9 +3102,9 @@ add_ensure_iseq(LINK_ANCHOR *const ret, rb_iseq_t *iseq, int is_return)
add_ensure_range(iseq, enlp->erange, lstart, lend);
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enlp->prev;
+ iseq->compile_data->ensure_node_stack = enlp->prev;
ADD_LABEL(ensure_part, lstart);
- COMPILE_POPPED(ensure_part, "ensure part", enlp->ensure_node);
+ COMPILE_POPED(ensure_part, "ensure part", enlp->ensure_node);
ADD_LABEL(ensure_part, lend);
ADD_SEQ(ensure, ensure_part);
}
@@ -4434,13 +3115,12 @@ add_ensure_iseq(LINK_ANCHOR *const ret, rb_iseq_t *iseq, int is_return)
}
enlp = enlp->prev;
}
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = prev_enlp;
+ iseq->compile_data->ensure_node_stack = prev_enlp;
ADD_SEQ(ret, ensure);
}
static VALUE
-setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
- unsigned int *flag, struct rb_call_info_kw_arg **keywords)
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag)
{
VALUE argc = INT2FIX(0);
int nsplat = 0;
@@ -4460,7 +3140,6 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
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;
@@ -4473,22 +3152,23 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
INIT_ANCHOR(tmp);
COMPILE(tmp, "args (cat: splat)", argn->nd_body);
- if (nd_type(argn) == NODE_ARGSCAT) {
- ADD_INSN1(tmp, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
+ if (next_is_array && nsplat == 0) {
+ /* none */
}
else {
- ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ if (nd_type(argn) == NODE_ARGSCAT) {
+ ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
+ }
+ else {
+ ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
+ }
}
INSERT_LIST(args_splat, tmp);
nsplat++;
*flag |= VM_CALL_ARGS_SPLAT;
- if (nd_type(argn->nd_body) == NODE_HASH)
- *flag |= VM_CALL_KW_SPLAT;
if (next_is_array) {
- int len = compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS, NULL, flag, FALSE);
- if (len < 0) return Qnil;
- argc = INT2FIX(len + 1);
+ argc = INT2FIX(compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS) + 1);
}
else {
argn = argn->nd_head;
@@ -4496,15 +3176,12 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
}
break;
}
- case NODE_ARRAY:
- {
- int len = compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS, keywords, flag, FALSE);
- if (len < 0) return Qnil;
- argc = INT2FIX(len);
- break;
- }
+ case NODE_ARRAY: {
+ argc = INT2FIX(compile_array(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS));
+ break;
+ }
default: {
- UNKNOWN_NODE("setup_arg", argn, Qnil);
+ rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
}
}
}
@@ -4512,1107 +3189,729 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
if (nsplat > 1) {
int i;
for (i=1; i<nsplat; i++) {
- ADD_INSN(args_splat, nd_line(argn), concatarray);
+ ADD_INSN(args_splat, nd_line(args), concatarray);
}
}
- if (!LIST_INSN_SIZE_ZERO(args_splat)) {
+ if (!LIST_SIZE_ZERO(args_splat)) {
ADD_SEQ(args, args_splat);
}
if (*flag & VM_CALL_ARGS_BLOCKARG) {
- if (LIST_INSN_SIZE_ONE(arg_block)) {
- LINK_ELEMENT *elem = FIRST_ELEMENT(arg_block);
- if (elem->type == ISEQ_ELEMENT_INSN) {
- INSN *iobj = (INSN *)elem;
- if (iobj->insn_id == BIN(getblockparam)) {
- iobj->insn_id = BIN(getlocal);
- *flag |= VM_CALL_ARGS_BLOCKARG_BLOCKPARAM;
- }
- }
- }
ADD_SEQ(args, arg_block);
}
return argc;
}
static VALUE
-build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *body)
+build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *body)
{
int line = nd_line(body);
VALUE argc = INT2FIX(0);
- const rb_iseq_t *block = NEW_CHILD_ISEQ(body, make_name_for_block(iseq->body->parent_iseq), ISEQ_TYPE_BLOCK, line);
-
+ VALUE block = NEW_CHILD_ISEQVAL(body, make_name_for_block(iseq->parent_iseq), ISEQ_TYPE_BLOCK, line);
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_CALL_WITH_BLOCK(ret, line, id_core_set_postexe, argc, block);
iseq_set_local_table(iseq, 0);
return Qnil;
}
-static void
-compile_named_capture_assign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node)
+/**
+ compile each node
+
+ self: InstructionSequence
+ node: Ruby compiled node
+ poped: This node will be poped
+ */
+static int
+iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
{
- const NODE *vars;
- LINK_ELEMENT *last;
- int line = nd_line(node);
- LABEL *fail_label = NEW_LABEL(line), *end_label = NEW_LABEL(line);
+ enum node_type type;
+ LINK_ELEMENT *saved_last_element = 0;
+ int line;
-#if !(defined(NAMED_CAPTURE_BY_SVAR) && NAMED_CAPTURE_BY_SVAR-0)
- ADD_INSN1(ret, line, getglobal, ((VALUE)rb_global_entry(idBACKREF) | 1));
-#else
- ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */, INT2FIX(0));
-#endif
- ADD_INSN(ret, line, dup);
- ADD_INSNL(ret, line, branchunless, fail_label);
+ if (node == 0) {
+ if (!poped) {
+ debugs("node: NODE_NIL(implicit)\n");
+ ADD_INSN(ret, iseq->compile_data->last_line, putnil);
+ }
+ return COMPILE_OK;
+ }
- for (vars = node; vars; vars = vars->nd_next) {
- INSN *cap;
- if (vars->nd_next) {
- ADD_INSN(ret, line, dup);
+ iseq->compile_data->last_line = line = (int)nd_line(node);
+ 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) {
+ COMPILE_(ret, "BLOCK body", node->nd_head,
+ (node->nd_next == 0 && poped == 0) ? 0 : 1);
+ node = node->nd_next;
}
- last = ret->last;
- COMPILE_POPPED(ret, "capture", vars->nd_head);
- last = last->next; /* putobject :var */
- cap = new_insn_send(iseq, line, idAREF, INT2FIX(1),
- NULL, INT2FIX(0), NULL);
- ELEM_INSERT_PREV(last->next, (LINK_ELEMENT *)cap);
-#if !defined(NAMED_CAPTURE_SINGLE_OPT) || NAMED_CAPTURE_SINGLE_OPT-0
- if (!vars->nd_next && vars == node) {
- /* only one name */
- DECL_ANCHOR(nom);
-
- INIT_ANCHOR(nom);
- ADD_INSNL(nom, line, jump, end_label);
- ADD_LABEL(nom, fail_label);
-# if 0 /* $~ must be MatchData or nil */
- ADD_INSN(nom, line, pop);
- ADD_INSN(nom, line, putnil);
-# endif
- ADD_LABEL(nom, end_label);
- (nom->last->next = cap->link.next)->prev = nom->last;
- (cap->link.next = nom->anchor.next)->prev = &cap->link;
- return;
+ if (node) {
+ COMPILE_(ret, "BLOCK next", node->nd_next, poped);
}
-#endif
- }
- ADD_INSNL(ret, line, jump, end_label);
- ADD_LABEL(ret, fail_label);
- ADD_INSN(ret, line, pop);
- for (vars = node; vars; vars = vars->nd_next) {
- last = ret->last;
- COMPILE_POPPED(ret, "capture", vars->nd_head);
- last = last->next; /* putobject :var */
- ((INSN*)last)->insn_id = BIN(putnil);
- ((INSN*)last)->operand_size = 0;
- }
- ADD_LABEL(ret, end_label);
-}
+ break;
+ }
+ case NODE_IF:{
+ DECL_ANCHOR(cond_seq);
+ DECL_ANCHOR(then_seq);
+ DECL_ANCHOR(else_seq);
+ LABEL *then_label, *else_label, *end_label;
+
+ INIT_ANCHOR(cond_seq);
+ INIT_ANCHOR(then_seq);
+ INIT_ANCHOR(else_seq);
+ then_label = NEW_LABEL(line);
+ else_label = NEW_LABEL(line);
+ end_label = NEW_LABEL(line);
-static int
-number_literal_p(const NODE *n)
-{
- return (n && nd_type(n) == NODE_LIT && RB_INTEGER_TYPE_P(n->nd_lit));
-}
+ compile_branch_condition(iseq, cond_seq, node->nd_cond,
+ then_label, else_label);
+ COMPILE_(then_seq, "then", node->nd_body, poped);
+ COMPILE_(else_seq, "else", node->nd_else, poped);
+
+ ADD_SEQ(ret, cond_seq);
-static int
-compile_if(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
-{
- const NODE *const node_body = type == NODE_IF ? node->nd_body : node->nd_else;
- const NODE *const node_else = type == NODE_IF ? node->nd_else : node->nd_body;
-
- const int line = nd_line(node);
- const int lineno = nd_first_lineno(node);
- const int column = nd_first_column(node);
- const int last_lineno = nd_last_lineno(node);
- const int last_column = nd_last_column(node);
- DECL_ANCHOR(cond_seq);
- DECL_ANCHOR(then_seq);
- DECL_ANCHOR(else_seq);
- LABEL *then_label, *else_label, *end_label;
- VALUE branches = 0;
- int ci_size, ci_kw_size;
-
- INIT_ANCHOR(cond_seq);
- INIT_ANCHOR(then_seq);
- INIT_ANCHOR(else_seq);
- then_label = NEW_LABEL(line);
- else_label = NEW_LABEL(line);
- end_label = 0;
-
- compile_branch_condition(iseq, cond_seq, node->nd_cond,
- then_label, else_label);
-
- ci_size = iseq->body->ci_size;
- ci_kw_size = iseq->body->ci_kw_size;
- CHECK(COMPILE_(then_seq, "then", node_body, popped));
- if (!then_label->refcnt) {
- iseq->body->ci_size = ci_size;
- iseq->body->ci_kw_size = ci_kw_size;
- }
-
- ci_size = iseq->body->ci_size;
- ci_kw_size = iseq->body->ci_kw_size;
- CHECK(COMPILE_(else_seq, "else", node_else, popped));
- if (!else_label->refcnt) {
- iseq->body->ci_size = ci_size;
- iseq->body->ci_kw_size = ci_kw_size;
- }
-
- ADD_SEQ(ret, cond_seq);
-
- if (then_label->refcnt && else_label->refcnt) {
- DECL_BRANCH_BASE(branches, lineno, column, last_lineno, last_column, type == NODE_IF ? "if" : "unless");
- }
-
- if (then_label->refcnt) {
ADD_LABEL(ret, then_label);
- if (else_label->refcnt) {
- ADD_TRACE_BRANCH_COVERAGE(
- ret,
- node_body ? nd_first_lineno(node_body) : lineno,
- node_body ? nd_first_column(node_body) : column,
- node_body ? nd_last_lineno(node_body) : last_lineno,
- node_body ? nd_last_column(node_body) : last_column,
- type == NODE_IF ? "then" : "else",
- branches);
- }
ADD_SEQ(ret, then_seq);
- end_label = NEW_LABEL(line);
ADD_INSNL(ret, line, jump, end_label);
- }
- if (else_label->refcnt) {
ADD_LABEL(ret, else_label);
- if (then_label->refcnt) {
- ADD_TRACE_BRANCH_COVERAGE(
- ret,
- node_else ? nd_first_lineno(node_else) : lineno,
- node_else ? nd_first_column(node_else) : column,
- node_else ? nd_last_lineno(node_else) : last_lineno,
- node_else ? nd_last_column(node_else) : last_column,
- type == NODE_IF ? "else" : "then",
- branches);
- }
ADD_SEQ(ret, else_seq);
- }
- if (end_label) {
ADD_LABEL(ret, end_label);
- }
- return COMPILE_OK;
-}
+ break;
+ }
+ case NODE_CASE:{
+ NODE *vals;
+ NODE *tempnode = node;
+ LABEL *endlabel, *elselabel;
+ DECL_ANCHOR(head);
+ DECL_ANCHOR(body_seq);
+ DECL_ANCHOR(cond_seq);
+ int only_special_literals = 1;
+ VALUE literals = rb_hash_new();
+
+ INIT_ANCHOR(head);
+ INIT_ANCHOR(body_seq);
+ INIT_ANCHOR(cond_seq);
+
+ rb_hash_tbl_raw(literals)->type = &cdhash_type;
+
+ if (node->nd_head == 0) {
+ COMPILE_(ret, "when", node->nd_body, poped);
+ break;
+ }
+ COMPILE(head, "case base", node->nd_head);
-static int
-compile_case(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_node, int popped)
-{
- const NODE *vals;
- const NODE *node = orig_node;
- LABEL *endlabel, *elselabel;
- DECL_ANCHOR(head);
- DECL_ANCHOR(body_seq);
- DECL_ANCHOR(cond_seq);
- int only_special_literals = 1;
- VALUE literals = rb_hash_new();
- int line, lineno, column, last_lineno, last_column;
- enum node_type type;
- VALUE branches = 0;
+ node = node->nd_body;
+ type = nd_type(node);
+ line = nd_line(node);
- INIT_ANCHOR(head);
- INIT_ANCHOR(body_seq);
- INIT_ANCHOR(cond_seq);
+ if (type != NODE_WHEN) {
+ COMPILE_ERROR((ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type)));
+ }
- rb_hash_tbl_raw(literals)->type = &cdhash_type;
+ endlabel = NEW_LABEL(line);
+ elselabel = NEW_LABEL(line);
- CHECK(COMPILE(head, "case base", node->nd_head));
+ ADD_SEQ(ret, head); /* case VAL */
- DECL_BRANCH_BASE(branches, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "case");
+ while (type == NODE_WHEN) {
+ LABEL *l1;
- node = node->nd_body;
- type = nd_type(node);
- line = nd_line(node);
- lineno = nd_first_lineno(node);
- column = nd_first_column(node);
- last_lineno = nd_last_lineno(node);
- last_column = nd_last_column(node);
-
- if (type != NODE_WHEN) {
- COMPILE_ERROR(ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type));
- return COMPILE_NG;
- }
+ l1 = NEW_LABEL(line);
+ ADD_LABEL(body_seq, l1);
+ ADD_INSN(body_seq, line, pop);
+ COMPILE_(body_seq, "when body", node->nd_body, poped);
+ ADD_INSNL(body_seq, line, jump, endlabel);
- endlabel = NEW_LABEL(line);
- elselabel = NEW_LABEL(line);
+ vals = node->nd_head;
+ if (vals) {
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ only_special_literals = 0;
+ ADD_INSN (cond_seq, nd_line(vals), dup);
+ COMPILE(cond_seq, "when/cond splat", vals);
+ ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
+ break;
+ default:
+ rb_bug("NODE_CASE: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ }
+ else {
+ rb_bug("NODE_CASE: must be NODE_ARRAY, but 0");
+ }
- ADD_SEQ(ret, head); /* case VAL */
+ node = node->nd_next;
+ if (!node) {
+ break;
+ }
+ type = nd_type(node);
+ line = nd_line(node);
+ }
+ /* else */
+ if (node) {
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, line, pop);
+ COMPILE_(cond_seq, "else", node, poped);
+ ADD_INSNL(cond_seq, line, jump, endlabel);
+ }
+ else {
+ debugs("== else (implicit)\n");
+ ADD_LABEL(cond_seq, elselabel);
+ ADD_INSN(cond_seq, nd_line(tempnode), pop);
+ if (!poped) {
+ ADD_INSN(cond_seq, nd_line(tempnode), putnil);
+ }
+ ADD_INSNL(cond_seq, nd_line(tempnode), jump, endlabel);
+ }
- while (type == NODE_WHEN) {
- LABEL *l1;
+ if (only_special_literals) {
+ iseq_add_mark_object(iseq, literals);
- l1 = NEW_LABEL(line);
- ADD_LABEL(body_seq, l1);
- ADD_INSN(body_seq, line, pop);
- ADD_TRACE_BRANCH_COVERAGE(
- body_seq,
- node->nd_body ? nd_first_lineno(node->nd_body) : lineno,
- node->nd_body ? nd_first_column(node->nd_body) : column,
- node->nd_body ? nd_last_lineno(node->nd_body) : last_lineno,
- node->nd_body ? nd_last_column(node->nd_body) : last_column,
- "when",
- branches);
- CHECK(COMPILE_(body_seq, "when body", node->nd_body, popped));
- ADD_INSNL(body_seq, line, jump, endlabel);
+ ADD_INSN(ret, nd_line(tempnode), dup);
+ ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
+ }
- vals = node->nd_head;
- if (vals) {
+ ADD_SEQ(ret, cond_seq);
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
+ break;
+ }
+ case NODE_WHEN:{
+ NODE *vals;
+ NODE *val;
+ NODE *orig_node = node;
+ LABEL *endlabel;
+ DECL_ANCHOR(body_seq);
+
+ INIT_ANCHOR(body_seq);
+ endlabel = NEW_LABEL(line);
+
+ while (node && nd_type(node) == NODE_WHEN) {
+ LABEL *l1 = NEW_LABEL(line = nd_line(node));
+ ADD_LABEL(body_seq, l1);
+ COMPILE_(body_seq, "when", node->nd_body, poped);
+ ADD_INSNL(body_seq, line, jump, endlabel);
+
+ vals = node->nd_head;
+ if (!vals) {
+ rb_bug("NODE_WHEN: must be NODE_ARRAY, but 0");
+ }
switch (nd_type(vals)) {
case NODE_ARRAY:
- only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
+ while (vals) {
+ val = vals->nd_head;
+ COMPILE(ret, "when2", val);
+ ADD_INSNL(ret, nd_line(val), branchif, l1);
+ vals = vals->nd_next;
+ }
break;
case NODE_SPLAT:
case NODE_ARGSCAT:
case NODE_ARGSPUSH:
- only_special_literals = 0;
- ADD_INSN (cond_seq, nd_line(vals), dup);
- CHECK(COMPILE(cond_seq, "when/cond splat", vals));
- ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
- ADD_INSNL(cond_seq, nd_line(vals), branchif, l1);
+ ADD_INSN(ret, nd_line(vals), putnil);
+ COMPILE(ret, "when2/cond splat", vals);
+ ADD_INSN1(ret, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_WHEN | VM_CHECKMATCH_ARRAY));
+ ADD_INSNL(ret, nd_line(vals), branchif, l1);
break;
default:
- UNKNOWN_NODE("NODE_CASE", vals, COMPILE_NG);
+ rb_bug("NODE_WHEN: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
}
+ node = node->nd_next;
}
- else {
- EXPECT_NODE_NONULL("NODE_CASE", node, NODE_ARRAY, COMPILE_NG);
- }
+ /* else */
+ COMPILE_(ret, "else", node, poped);
+ ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
- node = node->nd_next;
- if (!node) {
- break;
- }
- type = nd_type(node);
- line = nd_line(node);
- lineno = nd_first_lineno(node);
- column = nd_first_column(node);
- last_lineno = nd_last_lineno(node);
- last_column = nd_last_column(node);
- }
- /* else */
- if (node) {
- ADD_LABEL(cond_seq, elselabel);
- ADD_INSN(cond_seq, line, pop);
- ADD_TRACE_BRANCH_COVERAGE(cond_seq, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "else", branches);
- CHECK(COMPILE_(cond_seq, "else", node, popped));
- ADD_INSNL(cond_seq, line, jump, endlabel);
- }
- else {
- debugs("== else (implicit)\n");
- ADD_LABEL(cond_seq, elselabel);
- ADD_INSN(cond_seq, nd_line(orig_node), pop);
- ADD_TRACE_BRANCH_COVERAGE(cond_seq, nd_first_lineno(orig_node), nd_first_column(orig_node), nd_last_lineno(orig_node), nd_last_column(orig_node), "else", branches);
- if (!popped) {
- ADD_INSN(cond_seq, nd_line(orig_node), putnil);
- }
- ADD_INSNL(cond_seq, nd_line(orig_node), jump, endlabel);
- }
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
- if (only_special_literals) {
- iseq_add_mark_object(iseq, literals);
+ break;
+ }
+ 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;
- ADD_INSN(ret, nd_line(orig_node), dup);
- ADD_INSN2(ret, nd_line(orig_node), opt_case_dispatch, literals, elselabel);
- LABEL_REF(elselabel);
- }
+ struct iseq_compile_data_ensure_node_stack enl;
- ADD_SEQ(ret, cond_seq);
- ADD_SEQ(ret, body_seq);
- ADD_LABEL(ret, endlabel);
- return COMPILE_OK;
-}
+ 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 *end_label = NEW_LABEL(line);
-static int
-compile_case2(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_node, int popped)
-{
- const NODE *vals;
- const NODE *val;
- const NODE *node = orig_node->nd_body;
- LABEL *endlabel;
- DECL_ANCHOR(body_seq);
- VALUE branches = 0;
-
- DECL_BRANCH_BASE(branches, nd_first_lineno(orig_node), nd_first_column(orig_node), nd_last_lineno(orig_node), nd_last_column(orig_node), "case");
-
- INIT_ANCHOR(body_seq);
- endlabel = NEW_LABEL(nd_line(node));
-
- while (node && nd_type(node) == NODE_WHEN) {
- const int line = nd_line(node);
- const int lineno = nd_first_lineno(node);
- const int column = nd_first_column(node);
- const int last_lineno = nd_last_lineno(node);
- const int last_column = nd_last_column(node);
- LABEL *l1 = NEW_LABEL(line);
- ADD_LABEL(body_seq, l1);
- ADD_TRACE_BRANCH_COVERAGE(
- body_seq,
- node->nd_body ? nd_first_lineno(node->nd_body) : lineno,
- node->nd_body ? nd_first_column(node->nd_body) : column,
- node->nd_body ? nd_last_lineno(node->nd_body) : last_lineno,
- node->nd_body ? nd_last_column(node->nd_body) : last_column,
- "when",
- branches);
- CHECK(COMPILE_(body_seq, "when", node->nd_body, popped));
- ADD_INSNL(body_seq, line, jump, endlabel);
-
- vals = node->nd_head;
- if (!vals) {
- COMPILE_ERROR(ERROR_ARGS "NODE_WHEN: must be NODE_ARRAY, but 0");
- return COMPILE_NG;
- }
- switch (nd_type(vals)) {
- case NODE_ARRAY:
- while (vals) {
- val = vals->nd_head;
- CHECK(COMPILE(ret, "when2", val));
- ADD_INSNL(ret, nd_line(val), branchif, l1);
- vals = vals->nd_next;
- }
- break;
- case NODE_SPLAT:
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH:
- ADD_INSN(ret, nd_line(vals), putnil);
- CHECK(COMPILE(ret, "when2/cond splat", vals));
- ADD_INSN1(ret, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_WHEN | VM_CHECKMATCH_ARRAY));
- ADD_INSNL(ret, nd_line(vals), branchif, l1);
- break;
- default:
- UNKNOWN_NODE("NODE_WHEN", vals, COMPILE_NG);
- }
- node = node->nd_next;
- }
- /* else */
- ADD_TRACE_BRANCH_COVERAGE(
- ret,
- node ? nd_first_lineno(node) : nd_first_lineno(orig_node),
- node ? nd_first_column(node) : nd_first_column(orig_node),
- node ? nd_last_lineno(node) : nd_last_lineno(orig_node),
- node ? nd_last_column(node) : nd_last_column(orig_node),
- "else",
- branches);
- CHECK(COMPILE_(ret, "else", node, popped));
- ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
-
- ADD_SEQ(ret, body_seq);
- ADD_LABEL(ret, endlabel);
- return COMPILE_OK;
-}
+ LABEL *next_catch_label = NEW_LABEL(line);
+ LABEL *tmp_label = NULL;
-static int
-compile_loop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
-{
- const int line = (int)nd_line(node);
- const int lineno = nd_first_lineno(node);
- const int column = nd_first_column(node);
- const int last_lineno = nd_last_lineno(node);
- const int last_column = nd_last_column(node);
- 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;
- VALUE branches = 0;
-
- struct iseq_compile_data_ensure_node_stack enl;
-
- 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(iseq)->loopval_popped = 0;
- push_ensure_entry(iseq, &enl, NULL, NULL);
-
- if (node->nd_state == 1) {
- ADD_INSNL(ret, line, jump, next_label);
- }
- else {
- 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);
- ADD_INSNL(ret, line, jump, next_label);
- if (tmp_label) ADD_LABEL(ret, tmp_label);
-
- ADD_LABEL(ret, redo_label);
- DECL_BRANCH_BASE(branches, lineno, column, last_lineno, last_column, type == NODE_WHILE ? "while" : "until");
- ADD_TRACE_BRANCH_COVERAGE(
- ret,
- node->nd_body ? nd_first_lineno(node->nd_body) : lineno,
- node->nd_body ? nd_first_column(node->nd_body) : column,
- node->nd_body ? nd_last_lineno(node->nd_body) : last_lineno,
- node->nd_body ? nd_last_column(node->nd_body) : last_column,
- "body",
- branches);
- CHECK(COMPILE_POPPED(ret, "while body", node->nd_body));
- ADD_LABEL(ret, next_label); /* next */
-
- if (type == NODE_WHILE) {
- compile_branch_condition(iseq, ret, node->nd_cond,
- redo_label, end_label);
- }
- else {
- /* until */
- compile_branch_condition(iseq, ret, node->nd_cond,
- end_label, redo_label);
- }
-
- ADD_LABEL(ret, end_label);
- ADD_ADJUST_RESTORE(ret, adjust_label);
+ iseq->compile_data->loopval_popped = 0;
+ push_ensure_entry(iseq, &enl, 0, 0);
- if (node->nd_state == Qundef) {
- /* ADD_INSN(ret, line, putundef); */
- COMPILE_ERROR(ERROR_ARGS "unsupported: putundef");
- return COMPILE_NG;
- }
- else {
+ if (type == NODE_OPT_N || node->nd_state == 1) {
+ ADD_INSNL(ret, line, jump, next_label);
+ }
+ else {
+ tmp_label = NEW_LABEL(line);
+ ADD_INSNL(ret, line, jump, tmp_label);
+ }
ADD_INSN(ret, line, putnil);
- }
-
- ADD_LABEL(ret, break_label); /* break */
-
- if (popped) {
+ ADD_LABEL(ret, next_catch_label);
ADD_INSN(ret, line, pop);
- }
+ ADD_INSNL(ret, line, jump, next_label);
+ if (tmp_label) ADD_LABEL(ret, tmp_label);
- ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label, NULL,
- break_label);
- ADD_CATCH_ENTRY(CATCH_TYPE_NEXT, redo_label, break_label, NULL,
- next_catch_label);
- ADD_CATCH_ENTRY(CATCH_TYPE_REDO, redo_label, break_label, NULL,
- ISEQ_COMPILE_DATA(iseq)->redo_label);
+ ADD_LABEL(ret, redo_label);
+ COMPILE_POPED(ret, "while body", node->nd_body);
+ ADD_LABEL(ret, next_label); /* next */
- 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;
- return COMPILE_OK;
-}
+ if (type == NODE_WHILE) {
+ compile_branch_condition(iseq, ret, node->nd_cond,
+ redo_label, end_label);
+ }
+ else if (type == NODE_UNTIL) {
+ /* until */
+ compile_branch_condition(iseq, ret, node->nd_cond,
+ end_label, redo_label);
+ }
+ else {
+ ADD_CALL_RECEIVER(ret, line);
+ ADD_CALL(ret, line, idGets, INT2FIX(0));
+ ADD_INSNL(ret, line, branchif, redo_label);
+ /* opt_n */
+ }
-static int
-compile_iter(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- const rb_iseq_t *prevblock = ISEQ_COMPILE_DATA(iseq)->current_block;
- LABEL *retry_label = NEW_LABEL(line);
- LABEL *retry_end_l = NEW_LABEL(line);
- const rb_iseq_t *child_iseq;
+ ADD_LABEL(ret, end_label);
+
+ if (node->nd_state == Qundef) {
+ /* ADD_INSN(ret, line, putundef); */
+ rb_bug("unsupported: putundef");
+ }
+ else {
+ ADD_INSN(ret, line, putnil);
+ }
- ADD_LABEL(ret, retry_label);
- if (nd_type(node) == NODE_FOR) {
- CHECK(COMPILE(ret, "iter caller (for)", node->nd_iter));
+ ADD_LABEL(ret, break_label); /* break */
- ISEQ_COMPILE_DATA(iseq)->current_block = child_iseq =
- NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
- ADD_SEND_WITH_BLOCK(ret, line, idEach, INT2FIX(0), child_iseq);
- }
- else {
- ISEQ_COMPILE_DATA(iseq)->current_block = child_iseq =
- NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq),
- ISEQ_TYPE_BLOCK, line);
- CHECK(COMPILE(ret, "iter caller", node->nd_iter));
- }
- ADD_LABEL(ret, retry_end_l);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, redo_label, break_label,
+ 0, break_label);
+ 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)->current_block = prevblock;
+ 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;
+ break;
+ }
+ case NODE_ITER:
+ case NODE_FOR:{
+ VALUE prevblock = iseq->compile_data->current_block;
+ LABEL *retry_label = NEW_LABEL(line);
+ LABEL *retry_end_l = NEW_LABEL(line);
- ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, child_iseq, retry_end_l);
- return COMPILE_OK;
-}
+ ADD_LABEL(ret, retry_label);
+ if (nd_type(node) == NODE_FOR) {
+ COMPILE(ret, "iter caller (for)", node->nd_iter);
-static int
-compile_for(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- if (node->nd_var) {
- /* massign to var in "for"
- * args.length == 1 && Array === (tmp = args[0]) ? tmp : args
- */
- const NODE *var = node->nd_var;
- LABEL *not_single = NEW_LABEL(nd_line(var));
- LABEL *not_ary = NEW_LABEL(nd_line(var));
- CHECK(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);
- return COMPILE_OK;
- }
- else {
- return compile_iter(iseq, ret, node, popped);
- }
-}
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
-static int
-compile_break(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- unsigned long level = 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(iseq)->redo_label);
- CHECK(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(iseq)->end_label);
- ADD_ADJUST_RESTORE(ret, splabel);
-
- if (!popped) {
- ADD_INSN(ret, line, putnil);
+ ADD_SEND_R(ret, line, idEach, INT2FIX(0),
+ iseq->compile_data->current_block, INT2FIX(0));
}
- }
- else if (iseq->body->type == ISEQ_TYPE_BLOCK) {
- break_by_insn:
- /* escape from block */
- CHECK(COMPILE(ret, "break val (block)", node->nd_stts));
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_BREAK));
- if (popped) {
+ else {
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(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);
+
+ if (poped) {
ADD_INSN(ret, line, pop);
}
- }
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
- break_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with break");
- return COMPILE_NG;
- }
- else {
- const rb_iseq_t *ip = iseq->body->parent_iseq;
- while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
- ip = 0;
- break;
- }
+ iseq->compile_data->current_block = prevblock;
- level++;
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- level = VM_THROW_NO_ESCAPE_FLAG;
- goto break_by_insn;
- }
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- level <<= VM_THROW_LEVEL_SHIFT;
- goto break_by_insn;
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
+
+ break;
+ }
+ case NODE_BREAK:{
+ unsigned long level = 0;
+
+ if (iseq->compile_data->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_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
- goto break_in_eval;
+ }
+ else if (iseq->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 */ );
+ if (poped) {
+ ADD_INSN(ret, line, pop);
}
-
- ip = ip->body->parent_iseq;
}
- COMPILE_ERROR(ERROR_ARGS "Invalid break");
- return COMPILE_NG;
- }
- return COMPILE_OK;
-}
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ break_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with break"));
+ }
+ else {
+ rb_iseq_t *ip = iseq->parent_iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
-static int
-compile_next(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- unsigned long level = 0;
-
- if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
- LABEL *splabel = NEW_LABEL(0);
- debugs("next in while loop\n");
- ADD_LABEL(ret, splabel);
- CHECK(COMPILE(ret, "next val/valid syntax?", node->nd_stts));
- add_ensure_iseq(ret, iseq, 0);
- 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 (!popped) {
- ADD_INSN(ret, line, putnil);
+ level++;
+ if (ip->compile_data->redo_label != 0) {
+ level = 0x8000;
+ if (ip->compile_data->loopval_popped == 0) {
+ /* need value */
+ level |= 0x4000;
+ }
+ goto break_by_insn;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ level <<= 16;
+ goto break_by_insn;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto break_in_eval;
+ }
+
+ ip = ip->parent_iseq;
+ }
+ COMPILE_ERROR((ERROR_ARGS "Invalid break"));
}
- }
- 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(iseq)->start_label);
- CHECK(COMPILE(ret, "next val", node->nd_stts));
- add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
- ADD_ADJUST_RESTORE(ret, splabel);
- splabel->unremovable = FALSE;
+ break;
+ }
+ case NODE_NEXT:{
+ unsigned long level = 0;
- if (!popped) {
- ADD_INSN(ret, line, putnil);
+ if (iseq->compile_data->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_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
}
- }
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
- next_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with next");
- return COMPILE_NG;
- }
- else {
- const rb_iseq_t *ip = iseq;
+ else if (iseq->compile_data->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);
+ COMPILE(ret, "next val", node->nd_stts);
+ add_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->end_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
- while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
- ip = 0;
- break;
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
}
+ }
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ next_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with next"));
+ }
+ else {
+ rb_iseq_t *ip;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
- level = VM_THROW_NO_ESCAPE_FLAG;
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- /* while loop */
- break;
+ level = 0x8000 | 0x4000;
+ if (ip->compile_data->redo_label != 0) {
+ /* while loop */
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto next_in_eval;
+ }
+
+ ip = ip->parent_iseq;
}
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- break;
+ if (ip != 0) {
+ COMPILE(ret, "next val", node->nd_stts);
+ ADD_INSN1(ret, line, throw, INT2FIX(level | 0x03) /* TAG_NEXT */ );
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
- goto next_in_eval;
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid next"));
}
-
- ip = ip->body->parent_iseq;
}
- if (ip != 0) {
- CHECK(COMPILE(ret, "next val", node->nd_stts));
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_NEXT));
-
- if (popped) {
- ADD_INSN(ret, line, pop);
+ break;
+ }
+ case NODE_REDO:{
+ if (iseq->compile_data->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_ensure_iseq(ret, iseq, 0);
+ ADD_INSNL(ret, line, jump, iseq->compile_data->redo_label);
+ ADD_ADJUST_RESTORE(ret, splabel);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
}
}
- else {
- COMPILE_ERROR(ERROR_ARGS "Invalid next");
- return COMPILE_NG;
- }
- }
- return COMPILE_OK;
-}
-
-static int
-compile_redo(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
-
- 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(iseq)->redo_label);
- add_ensure_iseq(ret, iseq, 0);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->redo_label);
- ADD_ADJUST_RESTORE(ret, splabel);
- if (!popped) {
- ADD_INSN(ret, line, putnil);
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ redo_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
}
- }
- else if (iseq->body->type == ISEQ_TYPE_EVAL) {
- redo_in_eval:
- COMPILE_ERROR(ERROR_ARGS "Can't escape from eval with redo");
- return COMPILE_NG;
- }
- else if (ISEQ_COMPILE_DATA(iseq)->start_label) {
- LABEL *splabel = NEW_LABEL(0);
+ else if (iseq->compile_data->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(iseq)->start_label);
- ADD_INSNL(ret, line, jump, ISEQ_COMPILE_DATA(iseq)->start_label);
- ADD_ADJUST_RESTORE(ret, splabel);
+ 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_RESTORE(ret, splabel);
- if (!popped) {
- ADD_INSN(ret, line, putnil);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
}
- }
- else {
- const rb_iseq_t *ip = iseq;
- const unsigned long level = VM_THROW_NO_ESCAPE_FLAG;
+ else {
+ rb_iseq_t *ip;
+ unsigned long level;
+ level = 0x8000 | 0x4000;
+ ip = iseq;
+ while (ip) {
+ if (!ip->compile_data) {
+ ip = 0;
+ break;
+ }
- while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
- ip = 0;
- break;
- }
+ if (ip->compile_data->redo_label != 0) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_BLOCK) {
+ break;
+ }
+ else if (ip->type == ISEQ_TYPE_EVAL) {
+ goto redo_in_eval;
+ }
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- break;
+ ip = ip->parent_iseq;
}
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- break;
+ if (ip != 0) {
+ ADD_INSN(ret, line, putnil);
+ ADD_INSN1(ret, line, throw, INT2FIX(level | 0x05) /* TAG_REDO */ );
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
}
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
- goto redo_in_eval;
+ else {
+ COMPILE_ERROR((ERROR_ARGS "Invalid redo"));
}
-
- ip = ip->body->parent_iseq;
}
- if (ip != 0) {
+ break;
+ }
+ case NODE_RETRY:{
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_REDO));
+ ADD_INSN1(ret, line, throw, INT2FIX(0x04) /* TAG_RETRY */ );
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "Invalid redo");
- return COMPILE_NG;
+ COMPILE_ERROR((ERROR_ARGS "Invalid retry"));
}
- }
- return COMPILE_OK;
-}
-
-static int
-compile_retry(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
-
- if (iseq->body->type == ISEQ_TYPE_RESCUE) {
- ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETRY));
-
- if (popped) {
+ break;
+ }
+ case NODE_BEGIN:{
+ COMPILE_(ret, "NODE_BEGIN", node->nd_body, poped);
+ break;
+ }
+ case NODE_RESCUE:{
+ 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);
+
+ ADD_LABEL(ret, lstart);
+ COMPILE(ret, "rescue head", node->nd_head);
+ ADD_LABEL(ret, lend);
+ if (node->nd_else) {
ADD_INSN(ret, line, pop);
+ COMPILE(ret, "rescue else", node->nd_else);
}
- }
- else {
- COMPILE_ERROR(ERROR_ARGS "Invalid retry");
- return COMPILE_NG;
- }
- return COMPILE_OK;
-}
-
-static int
-compile_rescue(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- LABEL *lstart = NEW_LABEL(line);
- LABEL *lend = NEW_LABEL(line);
- LABEL *lcont = NEW_LABEL(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);
- CHECK(COMPILE(ret, "rescue head", node->nd_head));
- ADD_LABEL(ret, lend);
- if (node->nd_else) {
- ADD_INSN(ret, line, pop);
- CHECK(COMPILE(ret, "rescue else", node->nd_else));
- }
- ADD_INSN(ret, line, nop);
- ADD_LABEL(ret, lcont);
-
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
+ ADD_INSN(ret, line, nop);
+ ADD_LABEL(ret, lcont);
- /* register catch entry */
- ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lcont);
- ADD_CATCH_ENTRY(CATCH_TYPE_RETRY, lend, lcont, NULL, lstart);
- return COMPILE_OK;
-}
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
-static int
-compile_resbody(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- const NODE *resq = node;
- const NODE *narg;
- LABEL *label_miss, *label_hit;
-
- while (resq) {
- label_miss = NEW_LABEL(line);
- label_hit = NEW_LABEL(line);
-
- narg = resq->nd_args;
- if (narg) {
- switch (nd_type(narg)) {
- case NODE_ARRAY:
- while (narg) {
- ADD_GETLOCAL(ret, line, LVAR_ERRINFO, 0);
- CHECK(COMPILE(ret, "rescue arg", narg->nd_head));
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ /* register catch entry */
+ ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lcont);
+ ADD_CATCH_ENTRY(CATCH_TYPE_RETRY, lend, lcont, 0, lstart);
+ break;
+ }
+ case NODE_RESBODY:{
+ NODE *resq = node;
+ NODE *narg;
+ LABEL *label_miss, *label_hit;
+
+ while (resq) {
+ label_miss = NEW_LABEL(line);
+ label_hit = NEW_LABEL(line);
+
+ narg = resq->nd_args;
+ if (narg) {
+ switch (nd_type(narg)) {
+ case NODE_ARRAY:
+ while (narg) {
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ COMPILE(ret, "rescue arg", narg->nd_head);
+ ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
+ ADD_INSNL(ret, line, branchif, label_hit);
+ narg = narg->nd_next;
+ }
+ break;
+ case NODE_SPLAT:
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH:
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ COMPILE(ret, "rescue/cond splat", narg);
+ ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
ADD_INSNL(ret, line, branchif, label_hit);
- narg = narg->nd_next;
+ break;
+ default:
+ rb_bug("NODE_RESBODY: unknown node (%s)",
+ ruby_node_name(nd_type(narg)));
}
- break;
- case NODE_SPLAT:
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH:
- ADD_GETLOCAL(ret, line, LVAR_ERRINFO, 0);
- CHECK(COMPILE(ret, "rescue/cond splat", narg));
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE | VM_CHECKMATCH_ARRAY));
+ }
+ else {
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
+ ADD_INSN1(ret, line, putobject, rb_eStandardError);
+ ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
ADD_INSNL(ret, line, branchif, label_hit);
- break;
- default:
- UNKNOWN_NODE("NODE_RESBODY", narg, COMPILE_NG);
}
- }
- else {
- ADD_GETLOCAL(ret, line, LVAR_ERRINFO, 0);
- ADD_INSN1(ret, line, putobject, rb_eStandardError);
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_RESCUE));
- ADD_INSNL(ret, line, branchif, label_hit);
- }
- ADD_INSNL(ret, line, jump, label_miss);
- ADD_LABEL(ret, label_hit);
- CHECK(COMPILE(ret, "resbody body", resq->nd_body));
- if (ISEQ_COMPILE_DATA(iseq)->option->tailcall_optimization) {
- ADD_INSN(ret, line, nop);
- }
- ADD_INSN(ret, line, leave);
- ADD_LABEL(ret, label_miss);
- resq = resq->nd_head;
- }
- return COMPILE_OK;
-}
-
-static int
-compile_ensure(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
- DECL_ANCHOR(ensr);
- 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);
- LINK_ELEMENT *last;
- int last_leave = 0;
- struct ensure_range er;
- struct iseq_compile_data_ensure_node_stack enl;
- struct ensure_range *erange;
-
- INIT_ANCHOR(ensr);
- CHECK(COMPILE_POPPED(ensr, "ensure ensr", node->nd_ensr));
- last = ensr->last;
- last_leave = last && IS_INSN(last) && IS_INSN_ID(last, leave);
-
- er.begin = lstart;
- er.end = lend;
- er.next = 0;
- push_ensure_entry(iseq, &enl, &er, node->nd_ensr);
-
- ADD_LABEL(ret, lstart);
- CHECK(COMPILE_(ret, "ensure head", node->nd_head, (popped | last_leave)));
- ADD_LABEL(ret, lend);
- ADD_SEQ(ret, ensr);
- if (!popped && last_leave) ADD_INSN(ret, line, putnil);
- ADD_LABEL(ret, lcont);
- if (last_leave) ADD_INSN(ret, line, pop);
-
- erange = ISEQ_COMPILE_DATA(iseq)->ensure_node_stack->erange;
- if (lstart->link.next != &lend->link) {
- while (erange) {
- ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, erange->begin, erange->end,
- ensure, lcont);
- erange = erange->next;
- }
- }
-
- ISEQ_COMPILE_DATA(iseq)->ensure_node_stack = enl.prev;
- return COMPILE_OK;
-}
-
-static int
-compile_return(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- const int line = nd_line(node);
-
- if (iseq) {
- enum iseq_type type = iseq->body->type;
- const rb_iseq_t *is = iseq;
- enum iseq_type t = type;
- const NODE *retval = node->nd_stts;
- LABEL *splabel = 0;
-
- while (t == ISEQ_TYPE_RESCUE || t == ISEQ_TYPE_ENSURE) {
- if (!(is = is->body->parent_iseq)) break;
- t = is->body->type;
- }
- switch (t) {
- case ISEQ_TYPE_TOP:
- case ISEQ_TYPE_MAIN:
- if (is == iseq) {
- /* plain top-level, leave directly */
- type = ISEQ_TYPE_METHOD;
+ 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) {
+ ADD_INSN(ret, line, nop);
}
- break;
- default:
- break;
- }
-
- if (type == ISEQ_TYPE_METHOD) {
- splabel = NEW_LABEL(0);
- ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, 0);
+ ADD_INSN(ret, line, leave);
+ ADD_LABEL(ret, label_miss);
+ resq = resq->nd_head;
}
+ break;
+ }
+ 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);
+ LABEL *lstart = NEW_LABEL(line);
+ LABEL *lend = NEW_LABEL(line);
+ LABEL *lcont = NEW_LABEL(line);
+ struct ensure_range er;
+ struct iseq_compile_data_ensure_node_stack enl;
+ struct ensure_range *erange;
- CHECK(COMPILE(ret, "return nd_stts (return val)", retval));
+ INIT_ANCHOR(ensr);
+ COMPILE_POPED(ensr, "ensure ensr", node->nd_ensr);
- if (type == ISEQ_TYPE_METHOD) {
- add_ensure_iseq(ret, iseq, 1);
- ADD_TRACE(ret, RUBY_EVENT_RETURN);
- ADD_INSN(ret, line, leave);
- ADD_ADJUST_RESTORE(ret, splabel);
+ er.begin = lstart;
+ er.end = lend;
+ er.next = 0;
+ push_ensure_entry(iseq, &enl, &er, node->nd_ensr);
- if (!popped) {
- ADD_INSN(ret, line, putnil);
- }
+ ADD_LABEL(ret, lstart);
+ COMPILE_(ret, "ensure head", node->nd_head, poped);
+ ADD_LABEL(ret, lend);
+ if (ensr->anchor.next == 0) {
+ ADD_INSN(ret, line, nop);
}
else {
- ADD_INSN1(ret, line, throw, INT2FIX(TAG_RETURN));
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
+ ADD_SEQ(ret, ensr);
}
- }
- return COMPILE_OK;
-}
-
-static int iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped);
-/**
- compile each node
+ ADD_LABEL(ret, lcont);
- self: InstructionSequence
- node: Ruby compiled node
- popped: This node will be popped
- */
-static int
-iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE *node, int popped)
-{
- if (node == 0) {
- if (!popped) {
- int lineno = ISEQ_COMPILE_DATA(iseq)->last_line;
- if (lineno == 0) lineno = FIX2INT(rb_iseq_first_lineno(iseq));
- debugs("node: NODE_NIL(implicit)\n");
- ADD_INSN(ret, lineno, putnil);
- }
- return COMPILE_OK;
- }
- return iseq_compile_each0(iseq, ret, node, popped);
-}
-
-static int
-iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped)
-{
- const int line = (int)nd_line(node);
- const enum node_type type = nd_type(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_LINE_COVERAGE(ret, line);
- ADD_TRACE(ret, RUBY_EVENT_LINE);
+ erange = iseq->compile_data->ensure_node_stack->erange;
+ while (erange) {
+ ADD_CATCH_ENTRY(CATCH_TYPE_ENSURE, erange->begin, erange->end,
+ ensure, lcont);
+ erange = erange->next;
}
- }
- debug_node_start(node);
-#undef BEFORE_RETURN
-#define BEFORE_RETURN debug_node_end()
-
- switch (type) {
- case NODE_BLOCK:{
- while (node && nd_type(node) == NODE_BLOCK) {
- CHECK(COMPILE_(ret, "BLOCK body", node->nd_head,
- (node->nd_next ? 1 : popped)));
- node = node->nd_next;
- }
- if (node) {
- CHECK(COMPILE_(ret, "BLOCK next", node->nd_next, popped));
- }
- break;
- }
- case NODE_IF:
- case NODE_UNLESS:
- CHECK(compile_if(iseq, ret, node, popped, type));
- break;
- case NODE_CASE:
- CHECK(compile_case(iseq, ret, node, popped));
- break;
- case NODE_CASE2:
- CHECK(compile_case2(iseq, ret, node, popped));
- break;
- case NODE_WHILE:
- case NODE_UNTIL:
- CHECK(compile_loop(iseq, ret, node, popped, type));
- break;
- case NODE_FOR:
- CHECK(compile_for(iseq, ret, node, popped));
- break;
- case NODE_ITER:
- CHECK(compile_iter(iseq, ret, node, popped));
- break;
- case NODE_BREAK:
- CHECK(compile_break(iseq, ret, node, popped));
- break;
- case NODE_NEXT:
- CHECK(compile_next(iseq, ret, node, popped));
- break;
- case NODE_REDO:
- CHECK(compile_redo(iseq, ret, node, popped));
- break;
- case NODE_RETRY:
- CHECK(compile_retry(iseq, ret, node, popped));
- break;
- case NODE_BEGIN:{
- CHECK(COMPILE_(ret, "NODE_BEGIN", node->nd_body, popped));
+ iseq->compile_data->ensure_node_stack = enl.prev;
break;
}
- case NODE_RESCUE:
- CHECK(compile_rescue(iseq, ret, node, popped));
- break;
- case NODE_RESBODY:
- CHECK(compile_resbody(iseq, ret, node, popped));
- break;
- case NODE_ENSURE:
- CHECK(compile_ensure(iseq, ret, node, popped));
- break;
case NODE_AND:
case NODE_OR:{
LABEL *end_label = NEW_LABEL(line);
- CHECK(COMPILE(ret, "nd_1st", node->nd_1st));
- if (!popped) {
+ COMPILE(ret, "nd_1st", node->nd_1st);
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
if (type == NODE_AND) {
@@ -5621,77 +3920,76 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else {
ADD_INSNL(ret, line, branchif, end_label);
}
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, pop);
}
- CHECK(COMPILE_(ret, "nd_2nd", node->nd_2nd, popped));
+ COMPILE_(ret, "nd_2nd", node->nd_2nd, poped);
ADD_LABEL(ret, end_label);
break;
}
case NODE_MASGN:{
- compile_massign(iseq, ret, node, popped);
+ compile_massign(iseq, ret, node, poped);
break;
}
case NODE_LASGN:{
ID id = node->nd_vid;
- int idx = iseq->body->local_iseq->body->local_table_size - get_local_var_idx(iseq, id);
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
debugs("lvar: %s idx: %d\n", rb_id2name(id), idx);
- CHECK(COMPILE(ret, "rvalue", node->nd_value));
+ COMPILE(ret, "rvalue", node->nd_value);
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
- ADD_SETLOCAL(ret, line, idx, get_lvar_level(iseq));
+ ADD_INSN2(ret, line, setlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
+
break;
}
case NODE_DASGN:
case NODE_DASGN_CURR:{
int idx, lv, ls;
- ID id = node->nd_vid;
- CHECK(COMPILE(ret, "dvalue", node->nd_value));
- debugi("dassn id", rb_id2str(id) ? id : '*');
+ COMPILE(ret, "dvalue", node->nd_value);
+ debugp_param("dassn id", rb_str_new2(rb_id2name(node->nd_vid) ? rb_id2name(node->nd_vid) : "*"));
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
- idx = get_dyna_var_idx(iseq, id, &lv, &ls);
+ idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- COMPILE_ERROR(ERROR_ARGS "NODE_DASGN(_CURR): unknown id (%"PRIsVALUE")",
- rb_id2str(id));
- goto ng;
+ rb_bug("NODE_DASGN(_CURR): unknown id (%s)", rb_id2name(node->nd_vid));
}
- ADD_SETLOCAL(ret, line, ls - idx, lv);
+
+ ADD_INSN2(ret, line, setlocal, INT2FIX(ls - idx), INT2FIX(lv));
break;
}
case NODE_GASGN:{
- CHECK(COMPILE(ret, "lvalue", node->nd_value));
+ COMPILE(ret, "lvalue", node->nd_value);
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
ADD_INSN1(ret, line, setglobal,
((VALUE)node->nd_entry | 1));
break;
}
- case NODE_IASGN:{
- CHECK(COMPILE(ret, "lvalue", node->nd_value));
- if (!popped) {
+ case NODE_IASGN:
+ case NODE_IASGN2:{
+ COMPILE(ret, "lvalue", node->nd_value);
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
ADD_INSN2(ret, line, setinstancevariable,
- ID2SYM(node->nd_vid),
- get_ivar_ic_value(iseq,node->nd_vid));
+ ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
break;
}
case NODE_CDECL:{
- CHECK(COMPILE(ret, "lvalue", node->nd_value));
+ COMPILE(ret, "lvalue", node->nd_value);
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
@@ -5707,8 +4005,8 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
break;
}
case NODE_CVASGN:{
- CHECK(COMPILE(ret, "cvasgn val", node->nd_value));
- if (!popped) {
+ COMPILE(ret, "cvasgn val", node->nd_value);
+ if (!poped) {
ADD_INSN(ret, line, dup);
}
ADD_INSN1(ret, line, setclassvariable,
@@ -5746,7 +4044,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
* nd_mid
*/
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, putnil);
}
asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN1 recv", node);
@@ -5758,13 +4056,12 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
boff = 1;
default:
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
- CHECK(!NIL_P(argc));
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag);
ADD_SEQ(ret, args);
}
ADD_INSN1(ret, line, dupn, FIXNUM_INC(argc, 1 + boff));
- ADD_SEND_WITH_FLAG(ret, line, idAREF, argc, INT2FIX(flag));
flag |= asgnflag;
+ ADD_SEND_R(ret, line, idAREF, argc, Qfalse, INT2FIX(flag));
if (id == 0 || id == 1) {
/* 0: or, 1: and
@@ -5790,8 +4087,8 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
ADD_INSN(ret, line, pop);
- CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
- if (!popped) {
+ COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
+ if (!poped) {
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
}
if (flag & VM_CALL_ARGS_SPLAT) {
@@ -5807,26 +4104,28 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN(ret, line, pop);
ADD_INSN(ret, line, pop);
}
- ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
+ ADD_SEND_R(ret, line, idASET,
+ argc, Qfalse, INT2FIX(flag));
}
else {
if (boff > 0)
ADD_INSN(ret, line, swap);
- ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ ADD_SEND_R(ret, line, idASET,
+ FIXNUM_INC(argc, 1), Qfalse, INT2FIX(flag));
}
ADD_INSN(ret, line, pop);
ADD_INSNL(ret, line, jump, lfin);
ADD_LABEL(ret, label);
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
}
ADD_INSN1(ret, line, adjuststack, FIXNUM_INC(argc, 2+boff));
ADD_LABEL(ret, lfin);
}
else {
- CHECK(COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body));
+ COMPILE(ret, "NODE_OP_ASGN1 args->body: ", node->nd_args->nd_body);
ADD_SEND(ret, line, id, INT2FIX(1));
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2+boff));
}
if (flag & VM_CALL_ARGS_SPLAT) {
@@ -5842,12 +4141,14 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN(ret, line, pop);
ADD_INSN(ret, line, pop);
}
- ADD_SEND_WITH_FLAG(ret, line, idASET, argc, INT2FIX(flag));
+ ADD_SEND_R(ret, line, idASET,
+ argc, Qfalse, INT2FIX(flag));
}
else {
if (boff > 0)
ADD_INSN(ret, line, swap);
- ADD_SEND_WITH_FLAG(ret, line, idASET, FIXNUM_INC(argc, 1), INT2FIX(flag));
+ ADD_SEND_R(ret, line, idASET,
+ FIXNUM_INC(argc, 1), Qfalse, INT2FIX(flag));
}
ADD_INSN(ret, line, pop);
}
@@ -5856,11 +4157,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
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
@@ -5904,13 +4203,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
*/
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, vid, INT2FIX(0));
+ ADD_SEND_R(ret, line, node->nd_next->nd_vid,
+ INT2FIX(0), Qfalse, INT2FIX(asgnflag));
if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
ADD_INSN(ret, line, dup);
@@ -5921,10 +4216,11 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSNL(ret, line, branchunless, lcfin);
}
ADD_INSN(ret, line, pop);
- CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
+ COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
ADD_INSN(ret, line, swap);
ADD_INSN1(ret, line, topn, INT2FIX(1));
- ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_SEND_R(ret, line, node->nd_next->nd_aid,
+ INT2FIX(1), Qfalse, INT2FIX(asgnflag));
ADD_INSNL(ret, line, jump, lfin);
ADD_LABEL(ret, lcfin);
@@ -5932,29 +4228,22 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_LABEL(ret, lfin);
ADD_INSN(ret, line, pop);
- if (lskip) {
- ADD_LABEL(ret, lskip);
- }
- if (popped) {
+ if (poped) {
/* we can apply more optimize */
ADD_INSN(ret, line, pop);
}
}
else {
- CHECK(COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value));
- ADD_SEND(ret, line, atype, INT2FIX(1));
- if (!popped) {
+ COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
+ ADD_SEND(ret, line, node->nd_next->nd_mid,
+ INT2FIX(1));
+ if (!poped) {
ADD_INSN(ret, line, swap);
ADD_INSN1(ret, line, topn, INT2FIX(1));
}
- ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
- if (lskip && popped) {
- ADD_LABEL(ret, lskip);
- }
+ ADD_SEND_R(ret, line, node->nd_next->nd_aid,
+ INT2FIX(1), Qfalse, INT2FIX(asgnflag));
ADD_INSN(ret, line, pop);
- if (lskip && !popped) {
- ADD_LABEL(ret, lskip);
- }
}
break;
}
@@ -5968,12 +4257,14 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN1(ret, line, putobject, rb_cObject);
break;
case NODE_COLON2:
- CHECK(COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head));
+ COMPILE(ret, "NODE_OP_CDECL/colon2#nd_head", node->nd_head->nd_head);
break;
default:
- COMPILE_ERROR(ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
- ruby_node_name(nd_type(node->nd_head)));
- goto ng;
+ do {
+ COMPILE_ERROR((ERROR_ARGS "%s: invalid node in NODE_OP_CDECL",
+ ruby_node_name(nd_type(node->nd_head))));
+ } while (0);
+ return COMPILE_NG;
}
mid = node->nd_head->nd_mid;
/* cref */
@@ -5989,17 +4280,17 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
if (node->nd_aid == 0 || node->nd_aid == 1) {
lfin = NEW_LABEL(line);
- if (!popped) ADD_INSN(ret, line, dup); /* cref [obj] obj */
+ if (!poped) ADD_INSN(ret, line, dup); /* cref [obj] obj */
if (node->nd_aid == 0)
ADD_INSNL(ret, line, branchif, lfin);
else
ADD_INSNL(ret, line, branchunless, lfin);
/* cref [obj] */
- if (!popped) ADD_INSN(ret, line, pop); /* cref */
+ if (!poped) ADD_INSN(ret, line, pop); /* cref */
if (lassign) ADD_LABEL(ret, lassign);
- CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
+ COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
/* cref value */
- if (popped)
+ if (poped)
ADD_INSN1(ret, line, topn, INT2FIX(1)); /* cref value cref */
else {
ADD_INSN1(ret, line, dupn, INT2FIX(2)); /* cref value cref value */
@@ -6007,16 +4298,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
ADD_INSN1(ret, line, setconstant, ID2SYM(mid)); /* cref [value] */
ADD_LABEL(ret, lfin); /* cref [value] */
- if (!popped) ADD_INSN(ret, line, swap); /* [value] cref */
+ if (!poped) ADD_INSN(ret, line, swap); /* [value] cref */
ADD_INSN(ret, line, pop); /* [value] */
}
else {
- CHECK(COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value));
+ COMPILE(ret, "NODE_OP_CDECL#nd_value", node->nd_value);
/* cref obj value */
ADD_CALL(ret, line, node->nd_aid, INT2FIX(1));
/* cref value */
ADD_INSN(ret, line, swap); /* value cref */
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, topn, INT2FIX(1)); /* value cref value */
ADD_INSN(ret, line, swap); /* value value cref */
}
@@ -6044,7 +4335,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
lassign = NEW_LABEL(line);
}
- CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head));
+ COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_head", node->nd_head);
ADD_INSN(ret, line, dup);
if (nd_type(node) == NODE_OP_ASGN_AND) {
@@ -6056,33 +4347,26 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN(ret, line, pop);
ADD_LABEL(ret, lassign);
- CHECK(COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value));
+ COMPILE(ret, "NODE_OP_ASGN_AND/OR#nd_value", node->nd_value);
ADD_LABEL(ret, lfin);
- if (popped) {
+ if (poped) {
/* we can apply more optimize */
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_CALL:
- case NODE_OPCALL:
/* 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_mid == idUMinus) &&
- node->nd_args == NULL &&
- ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = freeze_literal(iseq, node->nd_recv->nd_lit);
- if (node->nd_mid == idUMinus) {
- ADD_INSN1(ret, line, opt_str_uminus, str);
- }
- else {
- ADD_INSN1(ret, line, opt_str_freeze, str);
- }
- if (popped) {
+ node->nd_mid == idFreeze && node->nd_args == NULL)
+ {
+ VALUE str = rb_fstring(node->nd_recv->nd_lit);
+ iseq_add_mark_object(iseq, str);
+ ADD_INSN1(ret, line, opt_str_freeze, str);
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6092,21 +4376,18 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
*/
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->frozen_string_literal &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
- CHECK(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 (popped) {
+ nd_type(node->nd_args->nd_head) == NODE_STR)
+ {
+ 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_INSN2(ret, line, opt_aref_with,
+ new_callinfo(iseq, idAREF, 1, 0, 0), str);
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_QCALL:
case NODE_FCALL:
case NODE_VCALL:{ /* VCALL: variable or call */
/*
@@ -6116,15 +4397,11 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
*/
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
- LABEL *else_label = 0;
- LABEL *end_label = 0;
- VALUE branches = 0;
ID mid = node->nd_mid;
VALUE argc;
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;
+ VALUE parent_block = iseq->compile_data->current_block;
+ iseq->compile_data->current_block = Qfalse;
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
@@ -6157,17 +4434,17 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
(mid == goto_id || mid == label_id)) {
LABEL *label;
st_data_t data;
- st_table *labels_table = ISEQ_COMPILE_DATA(iseq)->labels_table;
- VALUE label_name;
+ st_table *labels_table = iseq->compile_data->labels_table;
+ ID label_name;
if (!labels_table) {
labels_table = st_init_numtable();
- ISEQ_COMPILE_DATA(iseq)->labels_table = labels_table;
+ iseq->compile_data->labels_table = labels_table;
}
if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
- label_name = node->nd_args->nd_head->nd_lit;
+ label_name = SYM2ID(node->nd_args->nd_head->nd_lit);
if (!st_lookup(labels_table, (st_data_t)label_name, &data)) {
label = NEW_LABEL(line);
label->position = line;
@@ -6178,8 +4455,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
}
else {
- COMPILE_ERROR(ERROR_ARGS "invalid goto/label format");
- goto ng;
+ COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
}
@@ -6194,26 +4470,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
#endif
/* receiver */
- if (type == NODE_CALL || type == NODE_OPCALL || type == NODE_QCALL) {
- CHECK(COMPILE(recv, "recv", node->nd_recv));
- if (type == NODE_QCALL) {
- else_label = NEW_LABEL(line);
- end_label = NEW_LABEL(line);
-
- DECL_BRANCH_BASE(branches, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "&.");
- ADD_INSN(recv, line, dup);
- ADD_INSNL(recv, line, branchnil, else_label);
- ADD_TRACE_BRANCH_COVERAGE(recv, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "then", branches);
- }
+ if (type == NODE_CALL) {
+ COMPILE(recv, "recv", node->nd_recv);
}
else if (type == NODE_FCALL || type == NODE_VCALL) {
ADD_CALL_RECEIVER(recv, line);
}
/* args */
- if (type != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- CHECK(!NIL_P(argc));
+ if (nd_type(node) != NODE_VCALL) {
+ argc = setup_args(iseq, args, node->nd_args, &flag);
}
else {
argc = INT2FIX(0);
@@ -6225,7 +4491,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
debugp_param("call args argc", argc);
debugp_param("call method", ID2SYM(mid));
- switch ((int)type) {
+ switch (nd_type(node)) {
case NODE_VCALL:
flag |= VM_CALL_VCALL;
/* VCALL is funcall, so fall through */
@@ -6233,15 +4499,10 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
flag |= VM_CALL_FCALL;
}
- ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
+ ADD_SEND_R(ret, line, mid,
+ argc, parent_block, INT2FIX(flag));
- if (else_label && end_label) {
- ADD_INSNL(ret, line, jump, end_label);
- ADD_LABEL(ret, else_label);
- ADD_TRACE_BRANCH_COVERAGE(ret, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "else", branches);
- ADD_LABEL(ret, end_label);
- }
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6251,254 +4512,260 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
DECL_ANCHOR(args);
int argc;
unsigned int flag = 0;
- struct rb_call_info_kw_arg *keywords = NULL;
- const rb_iseq_t *parent_block = ISEQ_COMPILE_DATA(iseq)->current_block;
+ VALUE parent_block = iseq->compile_data->current_block;
INIT_ANCHOR(args);
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
- if (type == NODE_SUPER) {
- VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- CHECK(!NIL_P(vargc));
+ iseq->compile_data->current_block = Qfalse;
+ if (nd_type(node) == NODE_SUPER) {
+ VALUE vargc = setup_args(iseq, args, node->nd_args, &flag);
argc = FIX2INT(vargc);
}
else {
/* NODE_ZSUPER */
int i;
- const rb_iseq_t *liseq = iseq->body->local_iseq;
+ rb_iseq_t *liseq = iseq->local_iseq;
int lvar_level = get_lvar_level(iseq);
- argc = liseq->body->param.lead_num;
+ argc = liseq->argc;
/* normal arguments */
- for (i = 0; i < liseq->body->param.lead_num; i++) {
- int idx = liseq->body->local_table_size - i;
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ for (i = 0; i < liseq->argc; i++) {
+ int idx = liseq->local_size - i;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- 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_table_size - (i + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ if (!liseq->arg_simple) {
+ if (liseq->arg_opts) {
+ /* optional arguments */
+ int j;
+ for (j = 0; j < liseq->arg_opts - 1; j++) {
+ int idx = liseq->local_size - (i + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ }
+ i += j;
+ argc = i;
}
- i += j;
- argc = i;
- }
- if (liseq->body->param.flags.has_rest) {
- /* rest argument */
- int idx = liseq->body->local_table_size - liseq->body->param.rest_start;
- ADD_GETLOCAL(args, line, idx, lvar_level);
- ADD_INSN1(args, line, splatarray, Qfalse);
+ 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;
+ }
- 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->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_rest) {
- int j;
- for (j=0; j<post_len; j++) {
- int idx = liseq->body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ 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 */
}
- 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->body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ 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;
}
- argc = post_len + post_start;
}
- }
-
- if (liseq->body->param.flags.has_kw) { /* TODO: support keywords */
- int local_size = liseq->body->local_table_size;
- argc++;
-
- ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (liseq->body->param.flags.has_kwrest) {
- int idx = liseq->body->local_table_size - liseq->body->param.keyword->rest_start;
- ADD_GETLOCAL(args, line, idx, 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_GETLOCAL(args, line, idx, lvar_level);
- }
- 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) {
- int idx = liseq->body->local_table_size - liseq->body->param.keyword->rest_start;
- ADD_GETLOCAL(args, line, idx, 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 {
+ 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));
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ ADD_SEND (args, line, 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, 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;
+ }
}
}
}
/* dummy receiver */
- ADD_INSN1(ret, line, putobject, type == NODE_ZSUPER ? Qfalse : Qtrue);
+ ADD_INSN1(ret, line, putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
ADD_SEQ(ret, args);
- 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);
+ ADD_INSN1(ret, line, invokesuper, new_callinfo(iseq, 0, argc, parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_ARRAY:{
- CHECK(compile_array(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, NULL, NULL, popped) >= 0);
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, poped);
break;
}
case NODE_ZARRAY:{
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, newarray, INT2FIX(0));
}
break;
}
case NODE_VALUES:{
- const NODE *n = node;
- if (popped) {
- COMPILE_ERROR(ERROR_ARGS "NODE_VALUES: must not be popped");
- }
+ NODE *n = node;
while (n) {
- CHECK(COMPILE(ret, "values item", n->nd_head));
+ COMPILE(ret, "values item", n->nd_head);
n = n->nd_next;
}
ADD_INSN1(ret, line, newarray, INT2FIX(node->nd_alen));
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
break;
}
case NODE_HASH:{
DECL_ANCHOR(list);
- enum node_type type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
+ int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
INIT_ANCHOR(list);
switch (type) {
case NODE_ARRAY:
- CHECK(compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH, NULL, NULL, popped) >= 0);
+ compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
ADD_SEQ(ret, list);
break;
case NODE_ZARRAY:
- if (popped) break;
ADD_INSN1(ret, line, newhash, INT2FIX(0));
break;
default:
- COMPILE_ERROR(ERROR_ARGS_AT(node->nd_head) "can't make hash with this node: %s",
- ruby_node_name(type));
- goto ng;
+ rb_bug("can't make hash with this node: %s", ruby_node_name(type));
+ }
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_RETURN:
- CHECK(compile_return(iseq, ret, node, popped));
+ case NODE_RETURN:{
+ rb_iseq_t *is = iseq;
+
+ if (is) {
+ if (is->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid return"));
+ }
+ else {
+ LABEL *splabel = 0;
+
+ if (is->type == ISEQ_TYPE_METHOD) {
+ splabel = NEW_LABEL(0);
+ ADD_LABEL(ret, splabel);
+ ADD_ADJUST(ret, line, 0);
+ }
+
+ COMPILE(ret, "return nd_stts (return val)", node->nd_stts);
+
+ if (is->type == ISEQ_TYPE_METHOD) {
+ add_ensure_iseq(ret, iseq, 1);
+ ADD_TRACE(ret, line, RUBY_EVENT_RETURN);
+ ADD_INSN(ret, line, leave);
+ ADD_ADJUST_RESTORE(ret, splabel);
+
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
+ }
+ else {
+ ADD_INSN1(ret, line, throw, INT2FIX(0x01) /* TAG_RETURN */ );
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ }
+ }
+ }
break;
+ }
case NODE_YIELD:{
DECL_ANCHOR(args);
VALUE argc;
unsigned int flag = 0;
- struct rb_call_info_kw_arg *keywords = NULL;
INIT_ANCHOR(args);
- if (iseq->body->type == ISEQ_TYPE_TOP ||
- iseq->body->type == ISEQ_TYPE_MAIN) {
- COMPILE_ERROR(ERROR_ARGS "Invalid yield");
- goto ng;
+ if (iseq->type == ISEQ_TYPE_TOP) {
+ COMPILE_ERROR((ERROR_ARGS "Invalid yield"));
}
if (node->nd_head) {
- argc = setup_args(iseq, args, node->nd_head, &flag, &keywords);
- CHECK(!NIL_P(argc));
+ argc = setup_args(iseq, args, node->nd_head, &flag);
}
else {
argc = INT2FIX(0);
}
ADD_SEQ(ret, args);
- ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), flag, keywords, FALSE));
+ ADD_INSN1(ret, line, invokeblock, new_callinfo(iseq, 0, FIX2INT(argc), 0, flag));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_LVAR:{
- if (!popped) {
+ if (!poped) {
ID id = node->nd_vid;
- int idx = iseq->body->local_iseq->body->local_table_size - get_local_var_idx(iseq, id);
+ int idx = iseq->local_iseq->local_size - get_local_var_idx(iseq, id);
debugs("id: %s idx: %d\n", rb_id2name(id), idx);
- ADD_GETLOCAL(ret, line, idx, get_lvar_level(iseq));
+ ADD_INSN2(ret, line, getlocal, INT2FIX(idx), INT2FIX(get_lvar_level(iseq)));
}
break;
}
case NODE_DVAR:{
int lv, idx, ls;
debugi("nd_vid", node->nd_vid);
- if (!popped) {
+ if (!poped) {
idx = get_dyna_var_idx(iseq, node->nd_vid, &lv, &ls);
if (idx < 0) {
- COMPILE_ERROR(ERROR_ARGS "unknown dvar (%"PRIsVALUE")",
- rb_id2str(node->nd_vid));
- goto ng;
+ rb_bug("unknown dvar (%s)", rb_id2name(node->nd_vid));
}
- ADD_GETLOCAL(ret, line, ls - idx, lv);
+ ADD_INSN2(ret, line, getlocal, INT2FIX(ls - idx), INT2FIX(lv));
}
break;
}
case NODE_GVAR:{
ADD_INSN1(ret, line, getglobal,
((VALUE)node->nd_entry | 1));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_IVAR:{
debugi("nd_vid", node->nd_vid);
- if (!popped) {
+ if (!poped) {
ADD_INSN2(ret, line, getinstancevariable,
- ID2SYM(node->nd_vid),
- get_ivar_ic_value(iseq,node->nd_vid));
+ ID2SYM(node->nd_vid), INT2FIX(iseq->is_size++));
}
break;
}
case NODE_CONST:{
debugi("nd_vid", node->nd_vid);
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ if (iseq->compile_data->option->inline_const_cache) {
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ int ic_index = iseq->is_size++;
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
@@ -6510,31 +4777,27 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
}
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_CVAR:{
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, getclassvariable,
ID2SYM(node->nd_vid));
}
break;
}
case NODE_NTH_REF:{
- if (!popped) {
- if (!node->nd_nth) {
- ADD_INSN(ret, line, putnil);
- break;
- }
+ if (!poped) {
ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(node->nd_nth << 1));
}
break;
}
case NODE_BACK_REF:{
- if (!popped) {
+ if (!poped) {
ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(0x01 | (node->nd_nth << 1)));
}
@@ -6555,16 +4818,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
INT2FIX(0));
break;
case NODE_MATCH2:
- CHECK(COMPILE(recv, "receiver", node->nd_recv));
- CHECK(COMPILE(val, "value", node->nd_value));
+ COMPILE(recv, "receiver", node->nd_recv);
+ COMPILE(val, "value", node->nd_value);
break;
case NODE_MATCH3:
- CHECK(COMPILE(recv, "receiver", node->nd_value));
- CHECK(COMPILE(val, "value", node->nd_recv));
+ COMPILE(recv, "receiver", node->nd_value);
+ COMPILE(val, "value", node->nd_recv);
break;
}
- if (ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
+ if (iseq->compile_data->option->specialized_instruction) {
/* TODO: detect by node */
if (recv->last == recv->anchor.next &&
INSN_OF(recv->last) == BIN(putobject) &&
@@ -6576,7 +4839,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, val);
- ADD_INSN2(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, NULL, FALSE), Qnil);
+ ADD_INSN1(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, 0));
}
}
else {
@@ -6585,70 +4848,41 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
}
- if (node->nd_args) {
- compile_named_capture_assign(iseq, ret, node->nd_args);
- }
-
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_LIT:{
debugp_param("lit", node->nd_lit);
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, putobject, node->nd_lit);
}
break;
}
case NODE_STR:{
+ node->nd_lit = rb_fstring(node->nd_lit);
debugp_param("nd_lit", node->nd_lit);
- if (!popped) {
- VALUE lit = node->nd_lit;
- if (!ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal) {
- lit = freeze_literal(iseq, lit);
- ADD_INSN1(ret, line, putstring, lit);
- }
- else {
- if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
- VALUE debug_info = rb_ary_new_from_args(2, rb_iseq_path(iseq), INT2FIX(line));
- lit = rb_str_dup(lit);
- rb_ivar_set(lit, id_debug_created_info, rb_obj_freeze(debug_info));
- lit = rb_str_freeze(lit);
- }
- else {
- lit = rb_fstring(lit);
- }
- ADD_INSN1(ret, line, putobject, lit);
- iseq_add_mark_object_compile_time(iseq, lit);
- }
+ if (!poped) {
+ ADD_INSN1(ret, line, putstring, node->nd_lit);
}
break;
}
case NODE_DSTR:{
compile_dstr(iseq, ret, node);
- if (popped) {
+ 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, rb_iseq_path(iseq), 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, freeze_literal(iseq, node->nd_lit));
+ ADD_INSN1(ret, line, putobject, node->nd_lit);
ADD_CALL(ret, line, idBackquote, INT2FIX(1));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6658,122 +4892,117 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
compile_dstr(iseq, ret, node);
ADD_CALL(ret, line, idBackquote, INT2FIX(1));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_EVSTR:{
- CHECK(COMPILE(ret, "nd_body", node->nd_body));
+ COMPILE(ret, "nd_body", node->nd_body);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
- else if (!all_string_result_p(node->nd_body)) {
- const unsigned int flag = VM_CALL_FCALL;
- LABEL *isstr = NEW_LABEL(line);
- ADD_INSN(ret, line, dup);
- ADD_INSN2(ret, line, branchiftype, INT2FIX(T_STRING), isstr);
- LABEL_REF(isstr);
- ADD_INSN(ret, line, dup);
- ADD_SEND_R(ret, line, idTo_s, INT2FIX(0), NULL, INT2FIX(flag), NULL);
+ else {
ADD_INSN(ret, line, tostring);
- ADD_LABEL(ret, isstr);
}
break;
}
case NODE_DREGX:{
compile_dregx(iseq, ret, node);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_SCOPE:{
- int ic_index = iseq->body->is_size++;
- const rb_iseq_t *block_iseq = NEW_CHILD_ISEQ(node, make_name_for_block(iseq),
- ISEQ_TYPE_ONCE_GUARD, line);
+ case NODE_DREGX_ONCE:{
+ int ic_index = iseq->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);
ADD_INSN2(ret, line, once, block_iseq, INT2FIX(ic_index));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_ARGSCAT:{
- if (popped) {
- CHECK(COMPILE(ret, "argscat head", node->nd_head));
+ if (poped) {
+ COMPILE(ret, "argscat head", node->nd_head);
ADD_INSN1(ret, line, splatarray, Qfalse);
ADD_INSN(ret, line, pop);
- CHECK(COMPILE(ret, "argscat body", node->nd_body));
+ COMPILE(ret, "argscat body", node->nd_body);
ADD_INSN1(ret, line, splatarray, Qfalse);
ADD_INSN(ret, line, pop);
}
else {
- CHECK(COMPILE(ret, "argscat head", node->nd_head));
- CHECK(COMPILE(ret, "argscat body", node->nd_body));
+ COMPILE(ret, "argscat head", node->nd_head);
+ COMPILE(ret, "argscat body", node->nd_body);
ADD_INSN(ret, line, concatarray);
}
break;
}
case NODE_ARGSPUSH:{
- if (popped) {
- CHECK(COMPILE(ret, "arsgpush head", node->nd_head));
+ if (poped) {
+ COMPILE(ret, "arsgpush head", node->nd_head);
ADD_INSN1(ret, line, splatarray, Qfalse);
ADD_INSN(ret, line, pop);
- CHECK(COMPILE_(ret, "argspush body", node->nd_body, popped));
+ COMPILE_(ret, "argspush body", node->nd_body, poped);
}
else {
- CHECK(COMPILE(ret, "arsgpush head", node->nd_head));
- CHECK(COMPILE_(ret, "argspush body", node->nd_body, popped));
+ COMPILE(ret, "arsgpush head", node->nd_head);
+ COMPILE_(ret, "argspush body", node->nd_body, poped);
ADD_INSN1(ret, line, newarray, INT2FIX(1));
ADD_INSN(ret, line, concatarray);
}
break;
}
case NODE_SPLAT:{
- CHECK(COMPILE(ret, "splat", node->nd_head));
+ COMPILE(ret, "splat", node->nd_head);
ADD_INSN1(ret, line, splatarray, Qtrue);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_DEFN:{
- const rb_iseq_t *method_iseq = NEW_ISEQ(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
- debugp_param("defn/iseq", rb_iseqw_new(method_iseq));
+ debugp_param("defn/iseq", iseqval);
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, method_iseq);
- ADD_SEND (ret, line, id_core_define_method, INT2FIX(2));
+ ADD_INSN1(ret, line, putiseq, iseqval);
+ ADD_SEND (ret, line, id_core_define_method, INT2FIX(3));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
+ debugp_param("defn", iseqval);
break;
}
case NODE_DEFS:{
- const rb_iseq_t * singleton_method = NEW_ISEQ(node->nd_defn,
- rb_id2str(node->nd_mid),
- ISEQ_TYPE_METHOD, line);
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
- debugp_param("defs/iseq", rb_iseqw_new(singleton_method));
+ debugp_param("defs/iseq", iseqval);
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- CHECK(COMPILE(ret, "defs: recv", node->nd_recv));
+ COMPILE(ret, "defs: recv", node->nd_recv);
ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
- ADD_INSN1(ret, line, putiseq, singleton_method);
+ ADD_INSN1(ret, line, putiseq, iseqval);
ADD_SEND (ret, line, id_core_define_singleton_method, INT2FIX(3));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6781,22 +5010,22 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
case NODE_ALIAS:{
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- CHECK(COMPILE(ret, "alias arg1", node->nd_1st));
- CHECK(COMPILE(ret, "alias arg2", node->nd_2nd));
+ COMPILE(ret, "alias arg1", node->u1.node);
+ COMPILE(ret, "alias arg2", node->u2.node);
ADD_SEND(ret, line, id_core_set_method_alias, INT2FIX(3));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_VALIAS:{
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_alias));
- ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_orig));
+ ADD_INSN1(ret, line, putobject, ID2SYM(node->u1.id));
+ ADD_INSN1(ret, line, putobject, ID2SYM(node->u2.id));
ADD_SEND(ret, line, id_core_set_variable_alias, INT2FIX(2));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6804,58 +5033,64 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
case NODE_UNDEF:{
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
- CHECK(COMPILE(ret, "undef arg", node->nd_undef));
+ COMPILE(ret, "undef arg", node->u2.node);
ADD_SEND(ret, line, id_core_undef_method, INT2FIX(2));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_CLASS:{
- 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);
- const int flags = VM_DEFINECLASS_TYPE_CLASS |
- (node->nd_super ? VM_DEFINECLASS_FLAG_HAS_SUPERCLASS : 0) |
- compile_cpath(ret, iseq, node->nd_cpath);
-
- CHECK(COMPILE(ret, "super", node->nd_super));
- ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), class_iseq, INT2FIX(flags));
+ VALUE iseqval =
+ NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<class:%s>", rb_id2name(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));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_MODULE:{
- 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);
- const int flags = VM_DEFINECLASS_TYPE_MODULE |
- compile_cpath(ret, iseq, node->nd_cpath);
-
+ VALUE iseqval = NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<module:%s>", rb_id2name(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), module_iseq, INT2FIX(flags));
-
- if (popped) {
+ ADD_INSN3(ret, line, defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_SCLASS:{
ID singletonclass;
- const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_fstring_cstr("singleton class"),
- ISEQ_TYPE_CLASS, line);
+ VALUE iseqval =
+ NEW_ISEQVAL(node->nd_body, rb_str_new2("singleton class"),
+ ISEQ_TYPE_CLASS, line);
- CHECK(COMPILE(ret, "sclass#recv", node->nd_recv));
+ COMPILE(ret, "sclass#recv", node->nd_recv);
ADD_INSN (ret, line, putnil);
CONST_ID(singletonclass, "singletonclass");
ADD_INSN3(ret, line, defineclass,
- ID2SYM(singletonclass), singleton_class,
+ ID2SYM(singletonclass), iseqval,
INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -6864,16 +5099,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
if (rb_is_const_id(node->nd_mid)) {
/* constant */
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ int ic_index = iseq->is_size++;
DECL_ANCHOR(pref);
DECL_ANCHOR(body);
INIT_ANCHOR(pref);
INIT_ANCHOR(body);
- CHECK(compile_const_prefix(iseq, node, pref, body));
- if (LIST_INSN_SIZE_ZERO(pref)) {
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ compile_colon2(iseq, node, pref, body);
+ if (LIST_SIZE_ZERO(pref)) {
+ if (iseq->compile_data->option->inline_const_cache) {
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
}
else {
@@ -6882,7 +5117,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_SEQ(ret, body);
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ if (iseq->compile_data->option->inline_const_cache) {
ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
@@ -6895,22 +5130,23 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else {
/* function call */
ADD_CALL_RECEIVER(ret, line);
- CHECK(COMPILE(ret, "colon2#nd_head", node->nd_head));
- ADD_CALL(ret, line, node->nd_mid, INT2FIX(1));
+ COMPILE(ret, "colon2#nd_head", node->nd_head);
+ ADD_CALL(ret, line, node->nd_mid,
+ INT2FIX(1));
}
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_COLON3:{
LABEL *lend = NEW_LABEL(line);
- int ic_index = iseq->body->is_size++;
+ int ic_index = iseq->is_size++;
debugi("colon3#nd_mid", node->nd_mid);
/* add cache insn */
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ if (iseq->compile_data->option->inline_const_cache) {
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
ADD_INSN(ret, line, pop);
}
@@ -6918,94 +5154,112 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN1(ret, line, putobject, rb_cObject);
ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
+ if (iseq->compile_data->option->inline_const_cache) {
ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_DOT2:
case NODE_DOT3:{
- int excl = type == NODE_DOT3;
- VALUE flag = INT2FIX(excl);
- const NODE *b = node->nd_beg;
- const NODE *e = node->nd_end;
- if (number_literal_p(b) && number_literal_p(e)) {
- if (!popped) {
- VALUE val = rb_range_new(b->nd_lit, e->nd_lit, excl);
- iseq_add_mark_object_compile_time(iseq, val);
- ADD_INSN1(ret, line, putobject, val);
- }
+ VALUE flag = type == NODE_DOT2 ? INT2FIX(0) : INT2FIX(1);
+ COMPILE(ret, "min", (NODE *) node->nd_beg);
+ COMPILE(ret, "max", (NODE *) node->nd_end);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ ADD_INSN(ret, line, pop);
}
else {
- CHECK(COMPILE_(ret, "min", b, popped));
- CHECK(COMPILE_(ret, "max", e, popped));
- if (!popped) {
- ADD_INSN1(ret, line, newrange, flag);
- }
+ ADD_INSN1(ret, line, newrange, flag);
}
break;
}
case NODE_FLIP2:
case NODE_FLIP3:{
LABEL *lend = NEW_LABEL(line);
+ LABEL *lfin = NEW_LABEL(line);
LABEL *ltrue = NEW_LABEL(line);
- LABEL *lfalse = NEW_LABEL(line);
- CHECK(compile_flip_flop(iseq, ret, node, type == NODE_FLIP2,
- ltrue, lfalse));
+ rb_iseq_t *local_iseq = iseq->local_iseq;
+ rb_num_t cnt;
+ VALUE key;
+
+ cnt = local_iseq->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
+ key = INT2FIX(cnt);
+
+ ADD_INSN2(ret, line, getspecial, key, INT2FIX(0));
+ ADD_INSNL(ret, line, branchif, lend);
+
+ /* *flip == 0 */
+ COMPILE(ret, "flip2 beg", node->nd_beg);
+ ADD_INSN(ret, line, dup);
+ ADD_INSNL(ret, line, branchunless, lfin);
+ if (nd_type(node) == NODE_FLIP3) {
+ ADD_INSN(ret, line, dup);
+ ADD_INSN1(ret, line, setspecial, key);
+ ADD_INSNL(ret, line, jump, lfin);
+ }
+ else {
+ ADD_INSN1(ret, line, setspecial, key);
+ }
+
+ /* *flip == 1 */
+ ADD_LABEL(ret, lend);
+ COMPILE(ret, "flip2 end", node->nd_end);
+ ADD_INSNL(ret, line, branchunless, ltrue);
+ ADD_INSN1(ret, line, putobject, Qfalse);
+ ADD_INSN1(ret, line, setspecial, key);
+
ADD_LABEL(ret, ltrue);
ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSNL(ret, line, jump, lend);
- ADD_LABEL(ret, lfalse);
- ADD_INSN1(ret, line, putobject, Qfalse);
- ADD_LABEL(ret, lend);
+
+ ADD_LABEL(ret, lfin);
break;
}
case NODE_SELF:{
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, putself);
}
break;
}
case NODE_NIL:{
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, putnil);
}
break;
}
case NODE_TRUE:{
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, putobject, Qtrue);
}
break;
}
case NODE_FALSE:{
- if (!popped) {
+ if (!poped) {
ADD_INSN1(ret, line, putobject, Qfalse);
}
break;
}
case NODE_ERRINFO:{
- if (!popped) {
- if (iseq->body->type == ISEQ_TYPE_RESCUE) {
- ADD_GETLOCAL(ret, line, LVAR_ERRINFO, 0);
+ if (!poped) {
+ if (iseq->type == ISEQ_TYPE_RESCUE) {
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(0));
}
else {
- const rb_iseq_t *ip = iseq;
+ rb_iseq_t *ip = iseq;
int level = 0;
while (ip) {
- if (ip->body->type == ISEQ_TYPE_RESCUE) {
+ if (ip->type == ISEQ_TYPE_RESCUE) {
break;
}
- ip = ip->body->parent_iseq;
+ ip = ip->parent_iseq;
level++;
}
if (ip) {
- ADD_GETLOCAL(ret, line, LVAR_ERRINFO, level);
+ ADD_INSN2(ret, line, getlocal, INT2FIX(2), INT2FIX(level));
}
else {
ADD_INSN(ret, line, putnil);
@@ -7014,63 +5268,84 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
break;
}
- case NODE_DEFINED:
- if (!popped) {
- CHECK(compile_defined_expr(iseq, ret, node, Qtrue));
+ case NODE_DEFINED:{
+ if (poped) break;
+ if (!node->nd_head) {
+ VALUE str = rb_iseq_defined_string(DEFINED_NIL);
+ ADD_INSN1(ret, nd_line(node), putobject, str);
+ }
+ else {
+ LABEL *lfinish[2];
+ lfinish[0] = NEW_LABEL(line);
+ lfinish[1] = 0;
+ ADD_INSN(ret, line, putnil);
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
+ ADD_INSN(ret, line, swap);
+ ADD_INSN(ret, line, pop);
+ if (lfinish[1]) {
+ ADD_LABEL(ret, lfinish[1]);
+ }
+ ADD_LABEL(ret, lfinish[0]);
}
break;
+ }
case NODE_POSTEXE:{
/* compiled to:
* ONCE{ rb_mRubyVMFrozenCore::core#set_postexe{ ... } }
*/
- int is_index = iseq->body->is_size++;
- const rb_iseq_t *once_iseq = NEW_CHILD_ISEQ((const NODE *)IFUNC_NEW(build_postexe_iseq, node->nd_body, 0),
- make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ 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);
ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_KW_ARG:
- {
- LABEL *end_label = NEW_LABEL(nd_line(node));
- const NODE *default_value = node->nd_body->nd_value;
-
- if (default_value == (const NODE *)-1) {
- /* required argument. do nothing */
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
- }
- 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) {
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
- }
- else {
- /* if keywordcheck(_kw_bits, nth_keyword)
- * kw = default_value
- * end
- */
- int kw_bits_idx = iseq->body->local_table_size - iseq->body->param.keyword->bits_start;
- int keyword_idx = iseq->body->param.keyword->num;
-
- ADD_INSN2(ret, line, checkkeyword, INT2FIX(kw_bits_idx + VM_ENV_DATA_SIZE - 1), INT2FIX(keyword_idx));
- ADD_INSNL(ret, line, branchif, end_label);
- CHECK(COMPILE_POPPED(ret, "keyword default argument", node->nd_body));
- ADD_LABEL(ret, end_label);
- }
+ 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;
+ ADD_INSN(ret, line, dup);
+ ADD_INSN1(ret, line, putobject, ID2SYM(id));
+ ADD_SEND(ret, line, 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, 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 (!popped) {
- ADD_INSN(ret, line, intern);
+ if (!poped) {
+ ADD_SEND(ret, line, idIntern, INT2FIX(0));
}
else {
ADD_INSN(ret, line, pop);
@@ -7081,52 +5356,41 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
DECL_ANCHOR(recv);
DECL_ANCHOR(args);
unsigned int flag = 0;
- ID mid = node->nd_mid;
- LABEL *lskip = 0;
VALUE argc;
+ int asgnflag;
/* optimization shortcut
* obj["literal"] = value -> opt_aset_with(obj, "literal", value)
*/
- if (mid == idASET && !private_recv_p(node) && node->nd_args &&
+ if (node->nd_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->frozen_string_literal &&
- ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
+ nd_type(node->nd_args->nd_head) == NODE_STR)
{
- VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
- CHECK(COMPILE(ret, "recv", node->nd_recv));
- CHECK(COMPILE(ret, "value", node->nd_args->nd_next->nd_head));
- if (!popped) {
+ 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_INSN2(ret, line, opt_aset_with,
+ new_callinfo(iseq, idASET, 2, 0, 0), str);
ADD_INSN(ret, line, pop);
break;
}
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
- argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
- CHECK(!NIL_P(argc));
+ argc = setup_args(iseq, args, node->nd_args, &flag);
- flag |= COMPILE_RECV(recv, "recv", node);
+ flag |= (asgnflag = COMPILE_RECV(recv, "recv", node));
debugp_param("argc", argc);
- debugp_param("nd_mid", ID2SYM(mid));
+ debugp_param("nd_mid", ID2SYM(node->nd_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 (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, putnil);
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
@@ -7135,7 +5399,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_INSN1(ret, line, topn, INT2FIX(1));
if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
+ ADD_SEND_R(ret, line, idAREF, INT2FIX(1), Qfalse, INT2FIX(asgnflag));
}
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 3));
ADD_INSN (ret, line, pop);
@@ -7143,7 +5407,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else if (flag & VM_CALL_ARGS_SPLAT) {
ADD_INSN(ret, line, dup);
ADD_INSN1(ret, line, putobject, INT2FIX(-1));
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
+ ADD_SEND_R(ret, line, idAREF, INT2FIX(1), Qfalse, INT2FIX(asgnflag));
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2));
ADD_INSN (ret, line, pop);
}
@@ -7155,62 +5419,38 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
}
- ADD_SEND_WITH_FLAG(ret, line, mid, argc, INT2FIX(flag));
- if (lskip) ADD_LABEL(ret, lskip);
+ ADD_SEND_R(ret, line, node->nd_mid, argc, 0, INT2FIX(flag));
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_compile_option) {
- rb_iseq_make_compile_option(&new_opt, node->nd_compile_option);
- ISEQ_COMPILE_DATA(iseq)->option = &new_opt;
- }
- if (!new_opt.coverage_enabled) ISEQ_COVERAGE_SET(iseq, Qfalse);
- CHECK(COMPILE_POPPED(ret, "prelude", node->nd_head));
- CHECK(COMPILE_(ret, "body", node->nd_body, popped));
- ISEQ_COMPILE_DATA(iseq)->option = orig_opt;
- /* Do NOT restore ISEQ_COVERAGE!
- * If ISEQ_COVERAGE is not false, finish_iseq_build function in iseq.c
- * will initialize the counter array of line coverage.
- * We keep ISEQ_COVERAGE as nil to disable this initialization.
- * This is not harmful assuming that NODE_PRELUDE pragma does not occur
- * in NODE tree except the root.
- */
+ COMPILE_POPED(ret, "prelude", node->nd_head);
+ COMPILE_(ret, "body", node->nd_body, poped);
break;
}
case NODE_LAMBDA:{
/* compile same as lambda{...} */
- const rb_iseq_t *block = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line);
+ VALUE block = NEW_CHILD_ISEQVAL(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, idLambda, argc, block);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
default:
- UNKNOWN_NODE("iseq_compile_each", node, COMPILE_NG);
- ng:
- debug_node_end();
+ rb_bug("iseq_compile_each: unknown node: %s", ruby_node_name(type));
return COMPILE_NG;
}
- /* remove tracecoverage instruction if there is no relevant instruction */
- if (IS_TRACE(ret->last) && ((TRACE*) ret->last)->event == RUBY_EVENT_LINE) {
- LINK_ELEMENT *insn = ret->last->prev;
- if (IS_INSN(insn) &&
- IS_INSN_ID(insn, tracecoverage) &&
- FIX2LONG(OPERAND_AT(insn, 0)) == RUBY_EVENT_COVERAGE_LINE
- ) {
- ELEM_REMOVE(insn); /* remove tracecovearge */
- RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line - 1, Qnil);
- }
+ /* check & remove redundant trace(line) */
+ if (saved_last_element && ret /* ret can be 0 when error */ &&
+ ret->last == saved_last_element &&
+ ((INSN *)saved_last_element)->insn_id == BIN(trace)) {
+ POP_ELEMENT(ret);
}
debug_node_end();
@@ -7268,7 +5508,7 @@ insn_data_to_s_detail(INSN *iobj)
case TS_OFFSET: /* label(destination position) */
{
LABEL *lobj = (LABEL *)OPERAND_AT(iobj, j);
- rb_str_catf(str, LABEL_FORMAT, lobj->label_no);
+ rb_str_catf(str, "<L%03d>", lobj->label_no);
break;
}
break;
@@ -7277,7 +5517,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 = (VALUE)iseq;
+ val = iseq->self;
}
rb_str_concat(str, opobj_inspect(val));
}
@@ -7297,7 +5537,7 @@ insn_data_to_s_detail(INSN *iobj)
{
struct rb_global_entry *entry = (struct rb_global_entry *)
(OPERAND_AT(iobj, j) & (~1));
- rb_str_append(str, rb_id2str(entry->id));
+ rb_str_cat2(str, rb_id2name(entry->id));
break;
}
case TS_IC: /* inline cache */
@@ -7305,33 +5545,13 @@ insn_data_to_s_detail(INSN *iobj)
break;
case TS_CALLINFO: /* call info */
{
- 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>");
+ rb_call_info_t *ci = (rb_call_info_t *)OPERAND_AT(iobj, j);
+ rb_str_catf(str, "<callinfo:%s, %d>", ci->mid ? rb_id2name(ci->mid) : "", ci->orig_argc);
break;
}
case TS_CDHASH: /* case/when condition cache */
rb_str_cat2(str, "<ch>");
break;
- 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);
}
@@ -7345,13 +5565,7 @@ insn_data_to_s_detail(INSN *iobj)
}
static void
-dump_disasm_list(const LINK_ELEMENT *link)
-{
- dump_disasm_list_with_cursor(link, NULL, NULL);
-}
-
-static void
-dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest)
+dump_disasm_list(struct iseq_link_element *link)
{
int pos = 0;
INSN *iobj;
@@ -7361,26 +5575,24 @@ dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr,
printf("-- raw disasm--------\n");
while (link) {
- if (curr) printf(curr == link ? "*" : " ");
switch (link->type) {
case ISEQ_ELEMENT_INSN:
{
iobj = (INSN *)link;
str = insn_data_to_s_detail(iobj);
- printf("%04d %-65s(%4u)\n", pos, StringValueCStr(str), iobj->insn_info.line_no);
+ printf("%04d %-65s(%4d)\n", pos, StringValueCStr(str), iobj->line_no);
pos += insn_data_length(iobj);
break;
}
case ISEQ_ELEMENT_LABEL:
{
lobj = (LABEL *)link;
- printf(LABEL_FORMAT"%s\n", lobj->label_no, dest == lobj ? " <---" : "");
+ printf("<L%03d>\n", lobj->label_no);
break;
}
- case ISEQ_ELEMENT_TRACE:
+ case ISEQ_ELEMENT_NONE:
{
- TRACE *trace = (TRACE *)link;
- printf("trace: %0x\n", trace->event);
+ printf("[none]\n");
break;
}
case ISEQ_ELEMENT_ADJUST:
@@ -7396,7 +5608,6 @@ dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr,
link = link->next;
}
printf("---------------------\n");
- fflush(stdout);
}
const char *
@@ -7410,8 +5621,8 @@ rb_insns_name_array(void)
{
VALUE ary = rb_ary_new();
int i;
- for (i = 0; i < VM_INSTRUCTION_SIZE; i++) {
- rb_ary_push(ary, rb_fstring_cstr(insn_name_info[i]));
+ for (i = 0; i < numberof(insn_name_info); i++) {
+ rb_ary_push(ary, rb_fstring(rb_str_new2(insn_name_info[i])));
}
return rb_obj_freeze(ary);
}
@@ -7421,7 +5632,7 @@ register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
{
LABEL *label = 0;
st_data_t tmp;
- obj = rb_to_symbol_type(obj);
+ obj = rb_convert_type(obj, T_SYMBOL, "Symbol", "to_sym");
if (st_lookup(labels_table, obj, &tmp) == 0) {
label = NEW_LABEL(0);
@@ -7430,7 +5641,6 @@ register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
else {
label = (LABEL *)tmp;
}
- LABEL_REF(label);
return label;
}
@@ -7439,6 +5649,7 @@ 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;
@@ -7457,7 +5668,9 @@ 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;
- rb_raise(rb_eSyntaxError, "invalid exception symbol: %+"PRIsVALUE, sym);
+ sym_inspect = rb_inspect(sym);
+ rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
+ StringValuePtr(sym_inspect));
return 0;
}
@@ -7468,42 +5681,33 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
int i;
for (i=0; i<RARRAY_LEN(exception); i++) {
- const rb_iseq_t *eiseq;
- VALUE v, type;
+ VALUE v, type, eiseqval;
const VALUE *ptr;
LABEL *lstart, *lend, *lcont;
- unsigned int sp;
+ int sp;
- v = rb_to_array_type(RARRAY_AREF(exception, i));
+ RB_GC_GUARD(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");
}
ptr = RARRAY_CONST_PTR(v);
type = get_exception_sym2type(ptr[0]);
if (ptr[1] == Qnil) {
- eiseq = NULL;
+ eiseqval = 0;
}
else {
- eiseq = rb_iseqw_to_iseq(rb_iseq_load(ptr[1], (VALUE)iseq, Qnil));
+ eiseqval = rb_iseq_load(ptr[1], iseq->self, 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 = NUM2UINT(ptr[5]);
-
- /* TODO: Dirty Hack! Fix me */
- if (type == CATCH_TYPE_RESCUE ||
- type == CATCH_TYPE_BREAK ||
- type == CATCH_TYPE_NEXT) {
- ++sp;
- }
+ sp = NUM2INT(ptr[5]);
- lcont->sp = sp;
+ (void)sp;
- ADD_CATCH_ENTRY(type, lstart, lend, eiseq, lcont);
-
- RB_GC_GUARD(v);
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
}
return COMPILE_OK;
}
@@ -7522,89 +5726,32 @@ insn_make_insn_table(void)
return table;
}
-static const rb_iseq_t *
-iseq_build_load_iseq(const rb_iseq_t *iseq, VALUE op)
+static VALUE
+iseq_build_load_iseq(rb_iseq_t *iseq, VALUE op)
{
- VALUE iseqw;
- const rb_iseq_t *loaded_iseq;
-
+ VALUE iseqval;
if (RB_TYPE_P(op, T_ARRAY)) {
- iseqw = rb_iseq_load(op, (VALUE)iseq, Qnil);
+ iseqval = rb_iseq_load(op, iseq->self, Qnil);
}
else if (CLASS_OF(op) == rb_cISeq) {
- iseqw = op;
+ iseqval = op;
}
else {
rb_raise(rb_eSyntaxError, "ISEQ is required");
}
-
- 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 rb_event_flag_t
-event_name_to_flag(VALUE sym)
-{
-#define CHECK_EVENT(ev) if (sym == ID2SYM(rb_intern(#ev))) return ev;
- CHECK_EVENT(RUBY_EVENT_LINE);
- CHECK_EVENT(RUBY_EVENT_CLASS);
- CHECK_EVENT(RUBY_EVENT_END);
- CHECK_EVENT(RUBY_EVENT_CALL);
- CHECK_EVENT(RUBY_EVENT_RETURN);
- CHECK_EVENT(RUBY_EVENT_B_CALL);
- CHECK_EVENT(RUBY_EVENT_B_RETURN);
-#undef CHECK_EVENT
- return RUBY_EVENT_NONE;
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
}
static int
-iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
- VALUE body, VALUE labels_wrapper)
+iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor,
+ VALUE body, struct st_table *labels_table)
{
/* 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
@@ -7619,14 +5766,8 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
VALUE obj = ptr[i];
if (SYMBOL_P(obj)) {
- rb_event_flag_t event;
- if ((event = event_name_to_flag(obj)) != RUBY_EVENT_NONE) {
- ADD_TRACE(anchor, event);
- }
- else {
- LABEL *label = register_label(iseq, labels_table, obj);
- ADD_LABEL(anchor, label);
- }
+ LABEL *label = register_label(iseq, labels_table, obj);
+ ADD_LABEL(anchor, label);
}
else if (FIXNUM_P(obj)) {
line_no = NUM2INT(obj);
@@ -7640,17 +5781,14 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
insn = (argc < 0) ? Qnil : RARRAY_AREF(obj, 0);
if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
/* TODO: exception */
- COMPILE_ERROR(iseq, line_no,
- "unknown instruction: %+"PRIsVALUE, insn);
- ret = COMPILE_NG;
- break;
+ RB_GC_GUARD(insn) = rb_inspect(insn);
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "unknown instruction: %s", RSTRING_PTR(insn));
}
if (argc != insn_len((VALUE)insn_id)-1) {
- COMPILE_ERROR(iseq, line_no,
- "operand size mismatch");
- ret = COMPILE_NG;
- break;
+ rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "operand size mismatch");
}
if (argc > 0) {
@@ -7675,7 +5813,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
case TS_ISEQ:
{
if (op != Qnil) {
- argv[j] = (VALUE)iseq_build_load_iseq(iseq, op);
+ argv[j] = iseq_build_load_iseq(iseq, op);
}
else {
argv[j] = 0;
@@ -7683,51 +5821,53 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
}
break;
case TS_GENTRY:
- op = rb_to_symbol_type(op);
+ op = rb_convert_type(op, T_SYMBOL, "Symbol", "to_sym");
argv[j] = (VALUE)rb_global_entry(SYM2ID(op));
break;
case TS_IC:
argv[j] = op;
- if (NUM2UINT(op) >= iseq->body->is_size) {
- iseq->body->is_size = NUM2INT(op) + 1;
+ if (NUM2INT(op) >= iseq->is_size) {
+ iseq->is_size = NUM2INT(op) + 1;
}
break;
case TS_CALLINFO:
- argv[j] = iseq_build_callinfo_from_hash(iseq, op);
- break;
- case TS_CALLCACHE:
- argv[j] = Qfalse;
+ {
+ ID mid = 0;
+ int orig_argc = 0;
+ VALUE block = 0;
+ unsigned int 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("blockptr")));
+
+ 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(vblock)) block = iseq_build_load_iseq(iseq, vblock);
+ }
+ argv[j] = (VALUE)new_callinfo(iseq, mid, orig_argc, block, flag);
+ }
break;
case TS_ID:
- argv[j] = rb_to_symbol_type(op);
+ argv[j] = rb_convert_type(op, T_SYMBOL,
+ "Symbol", "to_sym");
break;
case TS_CDHASH:
{
int i;
- VALUE map = rb_hash_new_with_size(RARRAY_LEN(op)/2);
-
- rb_hash_tbl_raw(map)->type = &cdhash_type;
- op = rb_to_array_type(op);
+ 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 key = RARRAY_AREF(op, i);
- VALUE sym = RARRAY_AREF(op, i+1);
+ VALUE sym = rb_ary_entry(op, i+1);
LABEL *label =
register_label(iseq, labels_table, sym);
- rb_hash_aset(map, key, (VALUE)label | 1);
+ rb_ary_store(op, i+1, (VALUE)label | 1);
}
- 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;
+ argv[j] = op;
+ iseq_add_mark_object_compile_time(iseq, op);
}
break;
default:
@@ -7743,1857 +5883,143 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
rb_raise(rb_eTypeError, "unexpected object for instruction");
}
}
- DATA_PTR(labels_wrapper) = 0;
validate_labels(iseq, labels_table);
- if (!ret) return ret;
- return iseq_setup(iseq, anchor);
-}
-
-#define CHECK_ARRAY(v) rb_to_array_type(v)
-#define CHECK_SYMBOL(v) rb_to_symbol_type(v)
-
-static int
-int_param(int *dst, VALUE param, VALUE sym)
-{
- VALUE val = rb_hash_aref(param, sym);
- if (FIXNUM_P(val)) {
- *dst = FIX2INT(val);
- return TRUE;
- }
- else if (!NIL_P(val)) {
- rb_raise(rb_eTypeError, "invalid %+"PRIsVALUE" Fixnum: %+"PRIsVALUE,
- sym, val);
- }
- return FALSE;
+ st_free_table(labels_table);
+ iseq_setup(iseq, anchor);
+ return COMPILE_OK;
}
-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 = (ID *)&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) {
- keyword->table = ids;
- return keyword;
- }
-
- dvs = ALLOC_N(VALUE, (unsigned int)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;
- }
+#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;}
- 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
+rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
VALUE exception, VALUE body)
{
-#define SYM(s) ID2SYM(rb_intern(#s))
- int i, len;
- unsigned int arg_size, local_size, stack_max;
+ int i;
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);
- 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->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;
- for (i = 0; i < len; i++) {
+ for (i=0; i<RARRAY_LEN(locals); i++) {
VALUE lv = RARRAY_AREF(locals, i);
+ tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ }
- if (sym_arg_rest == lv) {
- tbl[i] = 0;
+ /* 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;
}
else {
- tbl[i] = FIXNUM_P(lv) ? (ID)FIX2LONG(lv) : SYM2ID(CHECK_SYMBOL(lv));
+ iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
}
- }
-#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
- {
-#define INT_PARAM(F) F = (int_param(&x, misc, SYM(F)) ? (unsigned int)x : 0)
- int x;
- INT_PARAM(arg_size);
- INT_PARAM(local_size);
- INT_PARAM(stack_max);
-#undef INT_PARAM
- }
-
- if (RB_TYPE_P(arg_opt_labels, 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;
+ 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));
}
- }
- else if (!NIL_P(arg_opt_labels)) {
- rb_raise(rb_eTypeError, ":opt param is not an array: %+"PRIsVALUE,
- arg_opt_labels);
- }
-
- if (RB_TYPE_P(keywords, T_ARRAY)) {
- iseq->body->param.keyword = iseq_build_kw(iseq, params, keywords);
- }
- else if (!NIL_P(keywords)) {
- 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;
+ iseq->arg_simple = NUM2INT(arg_simple);
}
-#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_wrapper);
-
- iseq->body->param.size = arg_size;
- iseq->body->local_table_size = local_size;
- iseq->body->stack_max = stack_max;
+ iseq_build_from_ary_body(iseq, anchor, body, labels_table);
+ return iseq->self;
}
/* for parser */
int
-rb_dvar_defined(ID id, const struct rb_block *base_block)
+rb_dvar_defined(ID id)
{
- const rb_iseq_t *iseq;
-
- if (base_block && (iseq = vm_block_iseq(base_block)) != NULL) {
- 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
+ rb_thread_t *th = GET_THREAD();
+ 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
) {
- unsigned int i;
+ int i;
- for (i = 0; i < iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
return 1;
}
}
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
}
}
return 0;
}
int
-rb_local_defined(ID id, const struct rb_block *base_block)
+rb_local_defined(ID id)
{
- const rb_iseq_t *iseq;
-
- if (base_block && (iseq = vm_block_iseq(base_block)) != NULL) {
- unsigned int i;
- iseq = iseq->body->local_iseq;
-
- for (i=0; i<iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == id) {
- return 1;
- }
- }
- }
- return 0;
-}
-
-static int
-caller_location(VALUE *path, VALUE *realpath)
-{
- const rb_execution_context_t *ec = GET_EC();
- const rb_control_frame_t *const cfp =
- rb_vm_get_ruby_level_next_cfp(ec, ec->cfp);
-
- if (cfp) {
- int line = rb_vm_get_sourceline(cfp);
- *path = rb_iseq_path(cfp->iseq);
- *realpath = rb_iseq_realpath(cfp->iseq);
- return line;
- }
- else {
- *path = rb_fstring_cstr("<compiled>");
- *realpath = *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 *const, VALUE))
-{
- VALUE path, realpath;
- accessor_args acc;
-
- acc.arg = arg;
- acc.func = func;
- acc.line = caller_location(&path, &realpath);
- return rb_iseq_new_with_opt((const NODE *)IFUNC_NEW(build, (VALUE)&acc, 0),
- rb_sym2str(name), path, realpath,
- INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
-}
-
-static VALUE
-for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *const 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 *const 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_GETLOCAL(ret, line, numberof(vars)-1, 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_thread_t *th = GET_THREAD();
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;
- }
- }
- if (insn_len(insn) != op_index+1) {
- rb_raise(rb_eRuntimeError, "operand size mismatch");
- }
- }
-
-
- 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_insn_info_entry *
-ibf_dump_insns_info(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- return IBF_W(iseq->body->insns_info, struct iseq_insn_info_entry, iseq->body->insns_info_size);
-}
-
-static struct iseq_insn_info_entry *
-ibf_load_insns_info(const struct ibf_load *load, const struct rb_iseq_constant_body *body)
-{
- return IBF_R(body->insns_info, struct iseq_insn_info_entry, body->insns_info_size);
-}
-
-static ID *
-ibf_dump_local_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const int size = iseq->body->local_table_size;
- 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_table_size;
-
- if (size > 0) {
- ID *table = IBF_R(body->local_table, ID, size);
+ if (th->base_block && th->base_block->iseq) {
int i;
+ iseq = th->base_block->iseq->local_iseq;
- 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.pathobj = ibf_dump_object(dump, dump_body.location.pathobj); /* TODO: freeze */
- 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.insns_info = ibf_dump_insns_info(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->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->insns_info_size = body->insns_info_size;
-
- RB_OBJ_WRITE(iseq, &load_body->mark_ary, iseq_mark_ary_create((int)body->mark_ary));
-
- {
- VALUE realpath = Qnil, path = ibf_load_object(load, body->location.pathobj);
- if (RB_TYPE_P(path, T_STRING)) {
- realpath = path = rb_fstring(path);
- }
- else if (RB_TYPE_P(path, T_ARRAY)) {
- VALUE pathobj = path;
- if (RARRAY_LEN(pathobj) != 2) {
- rb_raise(rb_eRuntimeError, "path object size mismatch");
- }
- path = rb_fstring(RARRAY_AREF(pathobj, 0));
- realpath = RARRAY_AREF(pathobj, 1);
- if (!NIL_P(realpath)) {
- if (!RB_TYPE_P(realpath, T_STRING)) {
- rb_raise(rb_eArgError, "unexpected realpath %"PRIxVALUE
- "(%x), path=%+"PRIsVALUE,
- realpath, TYPE(realpath), path);
- }
- realpath = rb_fstring(realpath);
- }
- }
- else {
- rb_raise(rb_eRuntimeError, "unexpected path object");
- }
- rb_iseq_pathobj_set(iseq, path, realpath);
- }
-
- 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->location.code_range = body->location.code_range;
-
- 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->insns_info = ibf_load_insns_info(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;
- VALUE srcstr = RREGEXP_SRC(obj);
- regexp.option = (char)rb_reg_options(obj);
- regexp.srcstr = (long)ibf_dump_object(dump, 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_with_size(hash->len);
- 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
-rb_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
-rb_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_CLEAR(iseq);
- 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)
-{
- rb_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
- rb_ibf_load_iseq_complete(iseq);
-#endif /* !USE_LAZY_LOAD */
-
- if (load->iseq) {
- iseq_add_mark_object(load->iseq, (VALUE)iseq);
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
+ return 1;
}
- return iseq;
}
}
+ return 0;
}
-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)
-{
- 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)
-{
- 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 *
-rb_iseq_ibf_load(VALUE str)
+int
+rb_parse_in_eval(void)
{
- struct ibf_load *load;
- 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_iseq_init_trace(iseq);
-
- RB_GC_GUARD(loader_obj);
- return iseq;
+ return GET_THREAD()->parse_in_eval > 0;
}
-VALUE
-rb_iseq_ibf_load_extra_data(VALUE str)
+int
+rb_parse_in_main(void)
{
- 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;
+ return GET_THREAD()->parse_in_eval < 0;
}
diff --git a/complex.c b/complex.c
index e06faa813b..b65bc8a61c 100644
--- a/complex.c
+++ b/complex.c
@@ -5,38 +5,24 @@
which is written in ruby.
*/
-#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 "ruby.h"
#include "internal.h"
+#include <math.h>
#define NDEBUG
-#include "ruby_assert.h"
+#include <assert.h>
#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 VALUE nucomp_abs(VALUE self);
-static VALUE nucomp_arg(VALUE self);
-
-static ID id_abs, id_arg,
- id_denominator, id_expt, id_fdiv,
+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,
- id_finite_p, id_infinite_p, id_rationalize,
- id_PI;
+ id_i_real, id_i_imag;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -81,9 +67,9 @@ inline static VALUE
f_add(VALUE x, VALUE y)
{
#ifndef PRESERVE_SIGNEDZERO
- if (FIXNUM_P(y) && FIXNUM_ZERO_P(y))
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
return x;
- else if (FIXNUM_P(x) && FIXNUM_ZERO_P(x))
+ else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
return y;
#endif
return rb_funcall(x, '+', 1, y);
@@ -97,21 +83,12 @@ f_div(VALUE x, VALUE y)
return rb_funcall(x, '/', 1, y);
}
-inline static int
+inline static VALUE
f_gt_p(VALUE x, VALUE y)
{
- if (RB_INTEGER_TYPE_P(x)) {
- if (FIXNUM_P(x) && FIXNUM_P(y))
- return (SIGNED_VALUE)x > (SIGNED_VALUE)y;
- return RTEST(rb_int_gt(x, y));
- }
- else if (RB_FLOAT_TYPE_P(x))
- return RTEST(rb_float_gt(x, y));
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- int const cmp = rb_cmpint(rb_rational_cmp(x, y), x, y);
- return cmp > 0;
- }
- return RTEST(rb_funcall(x, '>', 1, y));
+ if (FIXNUM_P(x) && FIXNUM_P(y))
+ return f_boolcast(FIX2LONG(x) > FIX2LONG(y));
+ return rb_funcall(x, '>', 1, y);
}
inline static VALUE
@@ -121,7 +98,7 @@ f_mul(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
long iy = FIX2LONG(y);
if (iy == 0) {
- if (RB_INTEGER_TYPE_P(x))
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
return ZERO;
}
else if (iy == 1)
@@ -130,7 +107,7 @@ f_mul(VALUE x, VALUE y)
else if (FIXNUM_P(x)) {
long ix = FIX2LONG(x);
if (ix == 0) {
- if (RB_INTEGER_TYPE_P(y))
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
return ZERO;
}
else if (ix == 1)
@@ -144,7 +121,7 @@ inline static VALUE
f_sub(VALUE x, VALUE y)
{
#ifndef PRESERVE_SIGNEDZERO
- if (FIXNUM_P(y) && FIXNUM_ZERO_P(y))
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
return x;
#endif
return rb_funcall(x, '-', 1, y);
@@ -153,27 +130,7 @@ f_sub(VALUE x, VALUE y)
fun1(abs)
fun1(arg)
fun1(denominator)
-
-static VALUE nucomp_negate(VALUE self);
-
-inline static VALUE
-f_negate(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x)) {
- return rb_int_uminus(x);
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- return rb_float_uminus(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return rb_rational_uminus(x);
- }
- else if (RB_TYPE_P(x, T_COMPLEX)) {
- return nucomp_negate(x);
- }
- return rb_funcall(x, id_negate, 0);
-}
-
+fun1(negate)
fun1(numerator)
fun1(real_p)
@@ -194,102 +151,122 @@ f_to_f(VALUE x)
fun1(to_r)
-inline static int
+inline static VALUE
f_eqeq_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
- return x == y;
- else if (RB_FLOAT_TYPE_P(x) || RB_FLOAT_TYPE_P(y))
- return NUM2DBL(x) == NUM2DBL(y);
- return (int)rb_equal(x, y);
+ return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
+ return rb_funcall(x, id_eqeq_p, 1, y);
}
fun2(expt)
fun2(fdiv)
fun2(quo)
-inline static int
+inline static VALUE
f_negative_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x))
- return INT_NEGATIVE_P(x);
- else if (RB_FLOAT_TYPE_P(x))
- return RFLOAT_VALUE(x) < 0.0;
- else if (RB_TYPE_P(x, T_RATIONAL))
- return INT_NEGATIVE_P(RRATIONAL(x)->num);
- return rb_num_negative_p(x);
+ if (FIXNUM_P(x))
+ return f_boolcast(FIX2LONG(x) < 0);
+ return rb_funcall(x, '<', 1, ZERO);
}
#define f_positive_p(x) (!f_negative_p(x))
-inline static int
+inline static VALUE
f_zero_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return FIXNUM_ZERO_P(x);
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 0);
+ }
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
}
else if (RB_TYPE_P(x, T_RATIONAL)) {
- const VALUE num = RRATIONAL(x)->num;
- return FIXNUM_ZERO_P(num);
+ VALUE num = RRATIONAL(x)->num;
+
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
}
- return (int)rb_equal(x, ZERO);
+ return rb_funcall(x, id_eqeq_p, 1, ZERO);
}
#define f_nonzero_p(x) (!f_zero_p(x))
-VALUE rb_flo_is_finite_p(VALUE num);
-inline static int
-f_finite_p(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x)) {
- return TRUE;
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- return (int)rb_flo_is_finite_p(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return TRUE;
- }
- return RTEST(rb_funcallv(x, id_finite_p, 0, 0));
-}
-
-VALUE rb_flo_is_infinite_p(VALUE num);
inline static VALUE
-f_infinite_p(VALUE x)
+f_one_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return Qnil;
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 1);
}
- else if (RB_FLOAT_TYPE_P(x)) {
- return rb_flo_is_infinite_p(x);
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
}
else if (RB_TYPE_P(x, T_RATIONAL)) {
- return Qnil;
+ VALUE num = RRATIONAL(x)->num;
+ VALUE den = RRATIONAL(x)->den;
+
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
+ FIXNUM_P(den) && FIX2LONG(den) == 1);
}
- return rb_funcallv(x, id_infinite_p, 0, 0);
+ return rb_funcall(x, id_eqeq_p, 1, ONE);
}
-inline static int
+inline static VALUE
f_kind_of_p(VALUE x, VALUE c)
{
- return (int)rb_obj_is_kind_of(x, c);
+ return rb_obj_is_kind_of(x, c);
}
-inline static int
+inline static VALUE
k_numeric_p(VALUE x)
{
return f_kind_of_p(x, rb_cNumeric);
}
-#define k_exact_p(x) (!RB_FLOAT_TYPE_P(x))
+inline static VALUE
+k_fixnum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFixnum);
+}
+
+inline static VALUE
+k_bignum_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cBignum);
+}
+
+inline static VALUE
+k_float_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cFloat);
+}
+
+inline static VALUE
+k_rational_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cRational);
+}
+
+inline static VALUE
+k_complex_p(VALUE x)
+{
+ return f_kind_of_p(x, rb_cComplex);
+}
+
+#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 = RCOMPLEX(x)
+ struct RComplex *dat;\
+ dat = ((struct RComplex *)(x))
#define get_dat2(x,y) \
- struct RComplex *adat = RCOMPLEX(x), *bdat = RCOMPLEX(y)
+ struct RComplex *adat, *bdat;\
+ adat = ((struct RComplex *)(x));\
+ bdat = ((struct RComplex *)(y))
inline static VALUE
nucomp_s_new_internal(VALUE klass, VALUE real, VALUE imag)
@@ -298,7 +275,6 @@ nucomp_s_new_internal(VALUE klass, VALUE real, VALUE imag)
RCOMPLEX_SET_REAL(obj, real);
RCOMPLEX_SET_IMAG(obj, imag);
- OBJ_FREEZE_RAW(obj);
return (VALUE)obj;
}
@@ -336,15 +312,15 @@ nucomp_s_new_bang(int argc, VALUE *argv, VALUE klass)
inline static VALUE
f_complex_new_bang1(VALUE klass, VALUE x)
{
- assert(!RB_TYPE_P(x, T_COMPLEX));
+ assert(!k_complex_p(x));
return nucomp_s_new_internal(klass, x, ZERO);
}
inline static VALUE
f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
{
- assert(!RB_TYPE_P(x, T_COMPLEX));
- assert(!RB_TYPE_P(y, T_COMPLEX));
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
return nucomp_s_new_internal(klass, x, y);
}
@@ -360,15 +336,14 @@ nucomp_canonicalization(int f)
{
canonicalization = f;
}
-#else
-#define canonicalization 0
#endif
inline static void
nucomp_real_check(VALUE num)
{
- if (!RB_INTEGER_TYPE_P(num) &&
- !RB_FLOAT_TYPE_P(num) &&
+ if (!RB_TYPE_P(num, T_FIXNUM) &&
+ !RB_TYPE_P(num, T_BIGNUM) &&
+ !RB_TYPE_P(num, T_FLOAT) &&
!RB_TYPE_P(num, T_RATIONAL)) {
if (!k_numeric_p(num) || !f_real_p(num))
rb_raise(rb_eTypeError, "not a real");
@@ -444,12 +419,10 @@ nucomp_s_new(int argc, VALUE *argv, VALUE klass)
inline static VALUE
f_complex_new2(VALUE klass, VALUE x, VALUE y)
{
- assert(!RB_TYPE_P(x, T_COMPLEX));
+ assert(!k_complex_p(x));
return nucomp_s_canonicalize_internal(klass, x, y);
}
-static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
-
/*
* call-seq:
* Complex(x[, y]) -> numeric
@@ -486,7 +459,7 @@ static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
static VALUE
nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
{
- return nucomp_s_convert(argc, argv, rb_cComplex);
+ return rb_funcall2(rb_cComplex, id_convert, argc, argv);
}
#define imp1(n) \
@@ -496,9 +469,20 @@ m_##n##_bang(VALUE x)\
return rb_math_##n(x);\
}
+#define imp2(n) \
+inline static VALUE \
+m_##n##_bang(VALUE x, VALUE y)\
+{\
+ return rb_math_##n(x, y);\
+}
+
+imp2(atan2)
imp1(cos)
imp1(cosh)
imp1(exp)
+imp2(hypot)
+
+#define m_hypot(x,y) m_hypot_bang((x),(y))
static VALUE
m_log_bang(VALUE x)
@@ -542,21 +526,6 @@ m_sin(VALUE x)
#if 0
imp1(sqrt)
-VALUE
-rb_complex_sqrt(VALUE x)
-{
- int pos;
- VALUE a, re, im;
- get_dat1(x);
-
- pos = f_positive_p(dat->imag);
- a = f_abs(x);
- re = m_sqrt_bang(f_div(f_add(a, dat->real), TWO));
- im = m_sqrt_bang(f_div(f_sub(a, dat->real), TWO));
- if (!pos) im = f_negate(im);
- return f_complex_new2(rb_cComplex, re, im);
-}
-
static VALUE
m_sqrt(VALUE x)
{
@@ -565,48 +534,26 @@ m_sqrt(VALUE x)
return m_sqrt_bang(x);
return f_complex_new2(rb_cComplex, ZERO, m_sqrt_bang(f_negate(x)));
}
- return rb_complex_sqrt(x);
+ else {
+ get_dat1(x);
+
+ if (f_negative_p(dat->imag))
+ return f_conj(m_sqrt(f_conj(x)));
+ else {
+ VALUE a = f_abs(x);
+ return f_complex_new2(rb_cComplex,
+ m_sqrt_bang(f_div(f_add(a, dat->real), TWO)),
+ m_sqrt_bang(f_div(f_sub(a, dat->real), TWO)));
+ }
+ }
}
#endif
-static VALUE
+inline static VALUE
f_complex_polar(VALUE klass, VALUE x, VALUE y)
{
- assert(!RB_TYPE_P(x, T_COMPLEX));
- assert(!RB_TYPE_P(y, T_COMPLEX));
- 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);
- }
+ assert(!k_complex_p(x));
+ assert(!k_complex_p(y));
return nucomp_s_canonicalize_internal(klass,
f_mul(x, m_cos(y)),
f_mul(x, m_sin(y)));
@@ -631,8 +578,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);
- if (canonicalization) return abs;
- return nucomp_s_new_internal(klass, abs, ZERO);
+ arg = ZERO;
+ break;
default:
nucomp_real_check(abs);
nucomp_real_check(arg);
@@ -690,28 +637,17 @@ nucomp_negate(VALUE self)
f_negate(dat->real), f_negate(dat->imag));
}
-/*
- * call-seq:
- * cmp + numeric -> complex
- *
- * Performs addition.
- *
- * Complex(2, 3) + Complex(2, 3) #=> (4+6i)
- * Complex(900) + Complex(1) #=> (901+0i)
- * Complex(-2, 9) + Complex(-9, 2) #=> (-11+11i)
- * Complex(9, 8) + 4 #=> (13+8i)
- * Complex(20, 9) + 9.8 #=> (29.8+9i)
- */
-VALUE
-rb_complex_plus(VALUE self, VALUE other)
+inline static VALUE
+f_addsub(VALUE self, VALUE other,
+ VALUE (*func)(VALUE, VALUE), ID id)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
VALUE real, imag;
get_dat2(self, other);
- real = f_add(adat->real, bdat->real);
- imag = f_add(adat->imag, bdat->imag);
+ real = (*func)(adat->real, bdat->real);
+ imag = (*func)(adat->imag, bdat->imag);
return f_complex_new2(CLASS_OF(self), real, imag);
}
@@ -719,9 +655,27 @@ rb_complex_plus(VALUE self, VALUE other)
get_dat1(self);
return f_complex_new2(CLASS_OF(self),
- f_add(dat->real, other), dat->imag);
+ (*func)(dat->real, other), dat->imag);
}
- return rb_num_coerce_bin(self, other, '+');
+ return rb_num_coerce_bin(self, other, id);
+}
+
+/*
+ * call-seq:
+ * cmp + numeric -> complex
+ *
+ * Performs addition.
+ *
+ * Complex(2, 3) + Complex(2, 3) #=> (4+6i)
+ * Complex(900) + Complex(1) #=> (901+0i)
+ * Complex(-2, 9) + Complex(-9, 2) #=> (-11+11i)
+ * Complex(9, 8) + 4 #=> (13+8i)
+ * Complex(20, 9) + 9.8 #=> (29.8+9i)
+ */
+static VALUE
+nucomp_add(VALUE self, VALUE other)
+{
+ return f_addsub(self, other, f_add, '+');
}
/*
@@ -739,36 +693,7 @@ rb_complex_plus(VALUE self, VALUE other)
static VALUE
nucomp_sub(VALUE self, VALUE other)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
- VALUE real, imag;
-
- get_dat2(self, other);
-
- real = f_sub(adat->real, bdat->real);
- imag = f_sub(adat->imag, bdat->imag);
-
- return f_complex_new2(CLASS_OF(self), real, imag);
- }
- if (k_numeric_p(other) && f_real_p(other)) {
- get_dat1(self);
-
- return f_complex_new2(CLASS_OF(self),
- f_sub(dat->real, other), dat->imag);
- }
- return rb_num_coerce_bin(self, other, '-');
-}
-
-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);
+ return f_addsub(self, other, f_sub, '-');
}
/*
@@ -783,24 +708,18 @@ safe_mul(VALUE a, VALUE b, int az, int bz)
* Complex(9, 8) * 4 #=> (36+32i)
* Complex(20, 9) * 9.8 #=> (196.0+88.2i)
*/
-VALUE
-rb_complex_mul(VALUE self, VALUE other)
+static VALUE
+nucomp_mul(VALUE self, VALUE other)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
VALUE real, imag;
- VALUE areal, aimag, breal, bimag;
- int arzero, aizero, brzero, bizero;
get_dat2(self, other);
- 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));
+ 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));
return f_complex_new2(CLASS_OF(self), real, imag);
}
@@ -813,18 +732,17 @@ rb_complex_mul(VALUE self, VALUE other)
}
return rb_num_coerce_bin(self, other, '*');
}
-#define nucomp_mul rb_complex_mul
inline static VALUE
f_divide(VALUE self, VALUE other,
VALUE (*func)(VALUE, VALUE), ID id)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
int flo;
get_dat2(self, other);
- flo = (RB_FLOAT_TYPE_P(adat->real) || RB_FLOAT_TYPE_P(adat->imag) ||
- RB_FLOAT_TYPE_P(bdat->real) || RB_FLOAT_TYPE_P(bdat->imag));
+ flo = (k_float_p(adat->real) || k_float_p(adat->imag) ||
+ k_float_p(bdat->real) || k_float_p(bdat->imag));
if (f_gt_p(f_abs(bdat->real), f_abs(bdat->imag))) {
VALUE r, n;
@@ -925,17 +843,17 @@ nucomp_expt(VALUE self, VALUE other)
if (k_numeric_p(other) && k_exact_zero_p(other))
return f_complex_new_bang1(CLASS_OF(self), ONE);
- if (RB_TYPE_P(other, T_RATIONAL) && RRATIONAL(other)->den == LONG2FIX(1))
- other = RRATIONAL(other)->num; /* c14n */
+ if (k_rational_p(other) && f_one_p(f_denominator(other)))
+ other = f_numerator(other); /* c14n */
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
get_dat1(other);
if (k_exact_zero_p(dat->imag))
other = dat->real; /* c14n */
}
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
VALUE r, theta, nr, ntheta;
get_dat1(other);
@@ -949,7 +867,7 @@ nucomp_expt(VALUE self, VALUE other)
f_mul(dat->imag, m_log_bang(r)));
return f_complex_polar(CLASS_OF(self), nr, ntheta);
}
- if (FIXNUM_P(other)) {
+ if (k_fixnum_p(other)) {
if (f_gt_p(other, ZERO)) {
VALUE x, z;
long n;
@@ -981,12 +899,12 @@ nucomp_expt(VALUE self, VALUE other)
}
return z;
}
- return f_expt(f_reciprocal(self), rb_int_uminus(other));
+ return f_expt(f_reciprocal(self), f_negate(other));
}
if (k_numeric_p(other) && f_real_p(other)) {
VALUE r, theta;
- if (RB_TYPE_P(other, T_BIGNUM))
+ if (k_bignum_p(other))
rb_warn("in a**b, b may be too big");
r = f_abs(self);
@@ -1013,7 +931,7 @@ nucomp_expt(VALUE self, VALUE other)
static VALUE
nucomp_eqeq_p(VALUE self, VALUE other)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
get_dat2(self, other);
return f_boolcast(f_eqeq_p(adat->real, bdat->real) &&
@@ -1024,7 +942,7 @@ nucomp_eqeq_p(VALUE self, VALUE other)
return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag));
}
- return f_boolcast(f_eqeq_p(other, self));
+ return f_eqeq_p(other, self);
}
/* :nodoc: */
@@ -1036,8 +954,8 @@ nucomp_coerce(VALUE self, VALUE other)
if (RB_TYPE_P(other, T_COMPLEX))
return rb_assoc_new(other, self);
- rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
- rb_obj_class(other), rb_obj_class(self));
+ rb_raise(rb_eTypeError, "%s can't be coerced into %s",
+ rb_obj_classname(other), rb_obj_classname(self));
return Qnil;
}
@@ -1058,17 +976,17 @@ nucomp_abs(VALUE self)
if (f_zero_p(dat->real)) {
VALUE a = f_abs(dat->imag);
- if (RB_FLOAT_TYPE_P(dat->real) && !RB_FLOAT_TYPE_P(dat->imag))
+ if (k_float_p(dat->real) && !k_float_p(dat->imag))
a = f_to_f(a);
return a;
}
if (f_zero_p(dat->imag)) {
VALUE a = f_abs(dat->real);
- if (!RB_FLOAT_TYPE_P(dat->real) && RB_FLOAT_TYPE_P(dat->imag))
+ if (!k_float_p(dat->real) && k_float_p(dat->imag))
a = f_to_f(a);
return a;
}
- return rb_math_hypot(dat->real, dat->imag);
+ return m_hypot(dat->real, dat->imag);
}
/*
@@ -1102,7 +1020,7 @@ static VALUE
nucomp_arg(VALUE self)
{
get_dat1(self);
- return rb_math_atan2(dat->imag, dat->real);
+ return m_atan2_bang(dat->imag, dat->real);
}
/*
@@ -1250,14 +1168,14 @@ nucomp_hash(VALUE self)
n = rb_hash(dat->imag);
h[1] = NUM2LONG(n);
v = rb_memhash(h, sizeof(h));
- return ST2FIX(v);
+ return LONG2FIX(v);
}
/* :nodoc: */
static VALUE
nucomp_eql_p(VALUE self, VALUE other)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
+ if (k_complex_p(other)) {
get_dat2(self, other);
return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) &&
@@ -1268,27 +1186,30 @@ nucomp_eql_p(VALUE self, VALUE other)
return Qfalse;
}
-inline static int
+inline static VALUE
f_signbit(VALUE x)
{
- if (RB_FLOAT_TYPE_P(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 !isnan(f) && signbit(f);
+ return f_boolcast(!isnan(f) && signbit(f));
}
return f_negative_p(x);
}
-inline static int
+inline static VALUE
f_tpositive_p(VALUE x)
{
- return !f_signbit(x);
+ return f_boolcast(!f_signbit(x));
}
static VALUE
f_format(VALUE self, VALUE (*func)(VALUE))
{
- VALUE s;
- int impos;
+ VALUE s, impos;
get_dat1(self);
@@ -1347,51 +1268,6 @@ nucomp_inspect(VALUE self)
return s;
}
-#define FINITE_TYPE_P(v) (RB_INTEGER_TYPE_P(v) || RB_TYPE_P(v, T_RATIONAL))
-
-/*
- * call-seq:
- * cmp.finite? -> true or false
- *
- * Returns +true+ if +cmp+'s magnitude is a finite number,
- * otherwise returns +false+.
- */
-static VALUE
-rb_complex_finite_p(VALUE self)
-{
- get_dat1(self);
-
- if (f_finite_p(dat->real) && f_finite_p(dat->imag)) {
- return Qtrue;
- }
- return Qfalse;
-}
-
-/*
- * call-seq:
- * cmp.infinite? -> nil or 1
- *
- * Returns values corresponding to the value of +cmp+'s magnitude:
- *
- * +finite+:: +nil+
- * ++Infinity+:: ++1+
- *
- * For example:
- *
- * (1+1i).infinite? #=> nil
- * (Float::INFINITY + 1i).infinite? #=> 1
- */
-static VALUE
-rb_complex_infinite_p(VALUE self)
-{
- get_dat1(self);
-
- if (NIL_P(f_infinite_p(dat->real)) && NIL_P(f_infinite_p(dat->imag))) {
- return Qnil;
- }
- return ONE;
-}
-
/* :nodoc: */
static VALUE
nucomp_dumper(VALUE self)
@@ -1407,7 +1283,6 @@ nucomp_loader(VALUE self, VALUE a)
RCOMPLEX_SET_REAL(dat, rb_ivar_get(a, id_i_real));
RCOMPLEX_SET_IMAG(dat, rb_ivar_get(a, id_i_imag));
- OBJ_FREEZE_RAW(self);
return self;
}
@@ -1456,6 +1331,8 @@ rb_complex_polar(VALUE x, VALUE y)
return f_complex_polar(rb_cComplex, x, y);
}
+static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
+
VALUE
rb_Complex(VALUE x, VALUE y)
{
@@ -1466,9 +1343,17 @@ rb_Complex(VALUE x, VALUE y)
}
VALUE
-rb_complex_abs(VALUE cmp)
+rb_complex_set_real(VALUE cmp, VALUE r)
{
- return nucomp_abs(cmp);
+ RCOMPLEX_SET_REAL(cmp, r);
+ return cmp;
+}
+
+VALUE
+rb_complex_set_imag(VALUE cmp, VALUE i)
+{
+ RCOMPLEX_SET_REAL(cmp, i);
+ return cmp;
}
/*
@@ -1487,7 +1372,7 @@ nucomp_to_i(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Integer",
self);
}
@@ -1510,7 +1395,7 @@ nucomp_to_f(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
self);
}
@@ -1535,7 +1420,7 @@ nucomp_to_r(VALUE self)
{
get_dat1(self);
- if (!k_exact_zero_p(dat->imag)) {
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
self);
}
@@ -1562,11 +1447,11 @@ nucomp_rationalize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", NULL);
- if (!k_exact_zero_p(dat->imag)) {
+ if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
self);
}
- return rb_funcallv(dat->real, id_rationalize, argc, argv);
+ return rb_funcall2(dat->real, rb_intern("rationalize"), argc, argv);
}
/*
@@ -1749,6 +1634,8 @@ isimagunit(int c)
c == 'j' || c == 'J');
}
+VALUE rb_cstr_to_rat(const char *, int);
+
static VALUE
str2num(char *s)
{
@@ -2060,6 +1947,8 @@ numeric_abs2(VALUE self)
return f_mul(self, self);
}
+#define id_PI rb_intern("PI")
+
/*
* call-seq:
* num.arg -> 0 or float
@@ -2072,8 +1961,8 @@ static VALUE
numeric_arg(VALUE self)
{
if (f_positive_p(self))
- return INT2FIX(0);
- return DBL2NUM(M_PI);
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
}
/*
@@ -2089,8 +1978,6 @@ numeric_rect(VALUE self)
return rb_assoc_new(self, INT2FIX(0));
}
-static VALUE float_arg(VALUE self);
-
/*
* call-seq:
* num.polar -> array
@@ -2100,25 +1987,7 @@ static VALUE float_arg(VALUE self);
static VALUE
numeric_polar(VALUE self)
{
- VALUE abs, arg;
-
- if (RB_INTEGER_TYPE_P(self)) {
- abs = rb_int_abs(self);
- arg = numeric_arg(self);
- }
- else if (RB_FLOAT_TYPE_P(self)) {
- abs = rb_float_abs(self);
- arg = float_arg(self);
- }
- else if (RB_TYPE_P(self, T_RATIONAL)) {
- abs = rb_rational_abs(self);
- arg = numeric_arg(self);
- }
- else {
- abs = f_abs(self);
- arg = f_arg(self);
- }
- return rb_assoc_new(abs, arg);
+ return rb_assoc_new(f_abs(self), f_arg(self));
}
/*
@@ -2158,10 +2027,9 @@ float_arg(VALUE self)
* and i is imaginary unit. Real a equals complex a+0i
* mathematically.
*
- * Complex object can be created as literal, and also by using
- * Kernel#Complex, Complex::rect, Complex::polar or to_c method.
+ * In ruby, you can create complex object with 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)
@@ -2196,7 +2064,9 @@ Init_Complex(void)
id_abs = rb_intern("abs");
id_arg = rb_intern("arg");
+ id_convert = rb_intern("convert");
id_denominator = rb_intern("denominator");
+ id_eqeq_p = rb_intern("==");
id_expt = rb_intern("**");
id_fdiv = rb_intern("fdiv");
id_negate = rb_intern("-@");
@@ -2208,10 +2078,6 @@ Init_Complex(void)
id_to_r = rb_intern("to_r");
id_i_real = rb_intern("@real");
id_i_imag = rb_intern("@image"); /* @image, not @imag */
- id_finite_p = rb_intern("finite?");
- id_infinite_p = rb_intern("infinite?");
- id_rationalize = rb_intern("rationalize");
- id_PI = rb_intern("PI");
rb_cComplex = rb_define_class("Complex", rb_cNumeric);
@@ -2231,9 +2097,13 @@ Init_Complex(void)
rb_define_global_function("Complex", nucomp_f_complex, -1);
- rb_undef_methods_from(rb_cComplex, rb_mComparable);
rb_undef_method(rb_cComplex, "%");
+ rb_undef_method(rb_cComplex, "<");
+ rb_undef_method(rb_cComplex, "<=");
rb_undef_method(rb_cComplex, "<=>");
+ rb_undef_method(rb_cComplex, ">");
+ rb_undef_method(rb_cComplex, ">=");
+ rb_undef_method(rb_cComplex, "between?");
rb_undef_method(rb_cComplex, "div");
rb_undef_method(rb_cComplex, "divmod");
rb_undef_method(rb_cComplex, "floor");
@@ -2245,12 +2115,16 @@ 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);
rb_define_method(rb_cComplex, "-@", nucomp_negate, 0);
- rb_define_method(rb_cComplex, "+", rb_complex_plus, 1);
+ rb_define_method(rb_cComplex, "+", nucomp_add, 1);
rb_define_method(rb_cComplex, "-", nucomp_sub, 1);
rb_define_method(rb_cComplex, "*", nucomp_mul, 1);
rb_define_method(rb_cComplex, "/", nucomp_div, 1);
@@ -2292,12 +2166,6 @@ 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_method(rb_cComplex, "finite?", rb_complex_finite_p, 0);
- rb_define_method(rb_cComplex, "infinite?", rb_complex_infinite_p, 0);
-
rb_define_private_method(rb_cComplex, "marshal_dump", nucomp_marshal_dump, 0);
compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject); /* :nodoc: */
rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 8a7cee55b8..0000000000
--- a/configure.ac
+++ /dev/null
@@ -1,4591 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-{
-AC_CONFIG_AUX_DIR(tool)
-
-AC_PREREQ(2.67)
-
-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_version_prereq([2.70], [-1], [
-# suppress error messages, rm: cannot remove 'conftest.dSYM', from
-# AC_EGREP_CPP with CFLAGS=-g on Darwin.
-AS_CASE([$build_os], [darwin*], [
-rm() {
- rm_recursive=''
- for arg do
- AS_CASE("$arg",
- [--*], [],
- [-*r*], [break],
- [conftest.*], [AS_IF([test -d "$arg"], [rm_recursive=-r; break])],
- [])
- done
- command rm $rm_recursive "[$]@"
-}
-])])])
-
-{ # environment section
-
-HAVE_BASERUBY=yes
-AC_ARG_WITH(baseruby,
- AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
- [AS_CASE(["$withval"],
- [*ruby*],[BASERUBY=$withval],
- [no],[HAVE_BASERUBY=no],
- [AC_MSG_ERROR(need ruby)])
- ],
- [
- AC_PATH_PROG([BASERUBY], [ruby], [false])
- ])
-AS_IF([test "$HAVE_BASERUBY" = yes -a "`RUBYOPT=- $BASERUBY -e 'print 42' 2>/dev/null`" = 42], [
- AS_IF([test "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42' 2>/dev/null`" = 42], [
- BASERUBY="$BASERUBY --disable=gems"
- ])
- $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub
-], [
- BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
- HAVE_BASERUBY=no
-])
-AC_SUBST(BASERUBY)
-AC_SUBST(HAVE_BASERUBY)
-
-: ${GIT=git}
-HAVE_GIT=yes
-AC_ARG_WITH(git,
- AS_HELP_STRING([--without-git], [never use git]),
- [AS_CASE([$withval],
- [no], [GIT=never-use HAVE_GIT=no],
- [yes], [],
- [GIT=$withval])])
-AS_IF([test x"$HAVE_GIT" = xyes], [command -v "$GIT" > /dev/null || HAVE_GIT=no])
-AC_SUBST(GIT)
-AC_SUBST(HAVE_GIT)
-
-AC_DEFUN([RUBY_MINGW32],
-[AS_CASE(["$host_os"],
-[cygwin*], [
-AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
-[AC_TRY_CPP([
-#ifndef __MINGW32__
-# error
-#endif
-], rb_cv_mingw32=yes,rb_cv_mingw32=no)
-rm -f conftest*])
-AS_IF([test "$rb_cv_mingw32" = yes], [
- target_os="mingw32"
- : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
-])
-])
-AS_CASE(["$target_os"], [mingw*msvc], [
-target_os="`echo ${target_os} | sed 's/msvc$//'`"
-])
-AS_CASE(["$target_cpu-$target_os"], [x86_64-mingw*], [
-target_cpu=x64
-])
-])
-
-AC_DEFUN([RUBY_CPPOUTFILE],
-[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
-[save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS='-o conftest-1.i'
-rb_cv_cppoutfile=no
-AC_TRY_CPP([test-for-cppout],
- [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
-CPPFLAGS="$save_CPPFLAGS"
-rm -f conftest*])
-AS_IF([test "$rb_cv_cppoutfile" = yes], [
- CPPOUTFILE='-o conftest.i'
-], [test "$rb_cv_cppoutfile" = no], [
- CPPOUTFILE='> conftest.i'
-], [test -n "$rb_cv_cppoutfile"], [
- CPPOUTFILE="$rb_cv_cppoutfile"
-])
-AC_SUBST(CPPOUTFILE)])
-
-AC_DEFUN([RUBY_PROG_GNU_LD],
-[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
-[AS_IF([`$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null], [
- rb_cv_prog_gnu_ld=yes
-], [
- rb_cv_prog_gnu_ld=no
-])])
-GNU_LD=$rb_cv_prog_gnu_ld
-AC_SUBST(GNU_LD)])
-
-eval `sed -n ['s/^@%:@define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/API_\1=\2/p'] $srcdir/include/ruby/version.h`
-RUBY_PROGRAM_VERSION=`sed -n 's/^@%:@define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
-MAJOR=`echo $RUBY_PROGRAM_VERSION | cut -d. -f1`
-MINOR=`echo $RUBY_PROGRAM_VERSION | cut -d. -f2`
-TEENY=`echo $RUBY_PROGRAM_VERSION | cut -d. -f3`
-for v in MAJOR MINOR TEENY; do
- AS_IF([eval "test \"\$$v\" = ''"], [
- AC_MSG_ERROR(could not determine $v number from version.h)
- ])
-done
-AS_IF([test "$MAJOR.$MINOR" != "$API_MAJOR.$API_MINOR"], [
- AC_MSG_ERROR([API version $API_MAJOR.$API_MINOR differs from program version $MAJOR.$MINOR])
-])
-AC_SUBST(MAJOR)
-AC_SUBST(MINOR)
-AC_SUBST(TEENY)
-AC_SUBST(RUBY_PROGRAM_VERSION)
-AC_SUBST(RUBY_API_VERSION, '$(MAJOR).$(MINOR)')
-RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
-AC_DEFINE(CANONICALIZATION_FOR_MATHN)
-dnl checks for alternative programs
-AC_CANONICAL_BUILD
-RUBY_RM_RECURSIVE
-AC_ARG_WITH(gcc,
- AS_HELP_STRING([--without-gcc], [never use gcc]),
- [
- AS_CASE([$withval],
- [no], [: ${CC=cc}],
- [yes], [: ${CC=gcc}],
- [CC=$withval])])
-dnl If the user switches compilers, we can't believe the cache
-AS_IF([test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"], [
- AC_MSG_ERROR(cached CC is different -- throw away $cache_file
-(it is also a good idea to do 'make clean' before compiling))
-])
-test -z "$CC" || ac_cv_prog_CC="$CC"
-
-AS_IF([test "$program_prefix" = NONE], [
- program_prefix=
-])
-AS_IF([test "$prefix" -ef .], [
- AC_MSG_ERROR(--prefix cannot be the current working directory.)
-])
-RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
-RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
-AC_SUBST(RUBY_BASE_NAME)
-AC_SUBST(RUBYW_BASE_NAME)
-AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
-
-AC_CANONICAL_TARGET
-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.
-
-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=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], [],
- [minor+0], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1.0/']],
- [minor], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1/']],
- [major+0], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1.0/']],
- [major], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1/']],
- [none], [os_version_style_transform=['s/[0-9]\.[0-9][.0-9]*$//']],
- [AC_MSG_ERROR(unknown --with-os-version-style: $withval)])
-AS_IF([test -z "$target_alias" -a -n "$os_version_style_transform"],
- [
- target=`echo ${target} | sed "$os_version_style_transform"`
- target_os=`echo ${target_os} | sed "$os_version_style_transform"`
- ])
-
-AC_DEFUN([RUBY_APPEND_OPTION],
- [# RUBY_APPEND_OPTION($1)
- AS_CASE([" [$]{$1-} "],
- [*" $2 "*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
-AC_DEFUN([RUBY_APPEND_OPTIONS],
- [# RUBY_APPEND_OPTIONS($1)
- for rb_opt in $2; do
- AS_CASE([" [$]{$1-} "],
- [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
- done])
-AC_DEFUN([RUBY_PREPEND_OPTION],
- [# RUBY_PREPEND_OPTION($1)
- AS_CASE([" [$]{$1-} "],
- [*" $2 "*], [], [' '], [ $1="$2"], [ $1="$2 [$]$1"])])
-AC_DEFUN([RUBY_PREPEND_OPTIONS],
- [# RUBY_PREPEND_OPTIONS($1)
- unset rb_opts; for rb_opt in $2; do
- AS_CASE([" [$]{rb_opts} [$]{$1-} "],
- [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
- done
- $1="[$]{rb_opts}[$]$1"])
-
-AC_ARG_WITH(arch,
- AS_HELP_STRING([--with-arch=ARCHS],
- [build an Apple/NeXT Multi Architecture Binary (MAB);
- ARCHS is a comma-delimited list of architectures for
- which to build; if this option is disabled or omitted
- entirely, then the package will be built only for the
- target platform]),
- [target_archs="$withval"], [unset target_archs])
-
-AC_DEFUN([RUBY_DEFAULT_ARCH], [
-AC_MSG_CHECKING([arch option])
-AS_CASE([$1],
- [*64], [ARCH_FLAG=-m64],
- [[i[3-6]86]], [ARCH_FLAG=-m32],
- [AC_MSG_ERROR(unknown target architecture: $target_archs)]
- )
-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']`
-unset universal_binary universal_archnames
-AS_IF([test ${target_archs+set}], [
- AC_MSG_CHECKING([target architectures])
- target_archs=`echo $target_archs | tr , ' '`
- # /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- for archs in $target_archs
- do
- AS_CASE([",$universal_binary,"],[*",$archs,"*], [],[
- cpu=`$SHELL "$ac_aux_dir/config.sub" "${archs}-${target_os}" 2>&1` || {
- AC_MSG_RESULT([failed])
- AC_MSG_ERROR([$cpu])
- }
- cpu=`echo $cpu | sed 's/-.*-.*//'`
- universal_binary="${universal_binary+$universal_binary,}$cpu"
- universal_archnames="${universal_archnames} ${archs}=${cpu}"
- ARCH_FLAG="${ARCH_FLAG+$ARCH_FLAG }-arch $archs"
- ])
- done
- target_archs="$universal_binary"
- unset universal_binary
- AS_CASE(["$target_archs"],
- [*,*], [universal_binary=yes],
- [unset universal_archnames])
- AC_MSG_RESULT([$target_archs])
-
- target=`echo $target | sed "s/^$target_cpu-/-/"`
- target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
- AS_IF([test "${universal_binary-no}" = yes], [
- AC_SUBST(try_header,try_compile)
- target_cpu=universal
- real_cross_compiling=$cross_compiling
- ], [
- AS_IF([test x"$target_cpu" != x"${target_archs}"], [
- echo 'int main(){return 0;}' > conftest.c
- AS_IF([$CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1], [
- rm -fr conftest.*
- ], [
- RUBY_DEFAULT_ARCH("$target_archs")
- ])
- ])
- target_cpu=${target_archs}
- ])
- AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
- AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
-], [
- AS_IF([test x"$target_alias" = x], [
- AS_CASE(["$target_os"],
- [darwin*], [
- AC_MSG_CHECKING([for real target cpu])
- target=`echo $target | sed "s/^$target_cpu-/-/"`
- target_cpu=`$CC -E - 2>/dev/null <<EOF |
-#ifdef __x86_64__
-"processor-name=x86_64"
-#endif
-#ifdef __i386__
-"processor-name=i386"
-#endif
-#ifdef __ppc__
-"processor-name=powerpc"
-#endif
-#ifdef __ppc64__
-"processor-name=powerpc64"
-#endif
-EOF
- sed -n 's/^"processor-name=\(.*\)"/\1/p'`
- target="$target_cpu${target}"
- AC_MSG_RESULT([$target_cpu])
- ])
- ])
- target_archs="$target_cpu"
-])
-AS_IF([test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"], [
- AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}])
-], [
- rb_cv_target_archs=${target_archs}
-])
-AS_IF([test "x${ARCH_FLAG}" != x], [
- CFLAGS="${CFLAGS:+$CFLAGS }${ARCH_FLAG}"
- LDFLAGS="${LDFLAGS:+$LDFLAGS }${ARCH_FLAG}"
-])
-# RUBY_UNIVERSAL_ARCH end
-])
-
-AC_ARG_ENABLE(load-relative,
- AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
- [load_relative=$enableval])
-
-AC_ARG_PROGRAM
-
-dnl Checks for programs.
-
-cflagspat=
-test -z "$optflags" ||
- cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
-test -z "$debugflags" ||
- cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
-test -z "warnflags" ||
- cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
-AS_IF([test -z "${CFLAGS+set}"], [
- cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
- orig_cflags="$cflags"
- cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
-])
-AS_IF([test -z "${CXXFLAGS+set}"], [
- cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
- orig_cxxflags="$cxxflags"
- cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
-])
-
-AS_CASE(["$host_os:$build_os"],
-[darwin*:darwin*], [
- 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)
- # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
- AS_IF([! $CC -E -xc - <<SRC >/dev/null], [
- @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
- @%:@error premature clang
- @%:@endif
-SRC
- AC_MSG_ERROR([clang version 3.0 or later is required])
- ])
-])
-AS_IF([test x"${build}" != x"${host}"], [
- AC_CHECK_TOOL(CC, gcc)
-])
-
-AC_PROG_CC
-
-dnl Select the appropriate C++ compiler in OS X
-AS_CASE(["$build_os"],
- [darwin1*.*], [
- AS_CASE(["x$CC"],
- [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
- [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
- [xcc|x/usr/bin/cc], [: ${CXX=c++}],
- [xicc], [: ${CXX=icpc}],
- [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
- ])
-test -z "$CXX" || ac_cv_prog_CXX="$CXX"
-
-AC_PROG_CXX
-RUBY_MINGW32
-AC_PROG_GCC_TRADITIONAL
-AC_SUBST(GCC)
-AS_CASE(["$target_os"],
-[solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])],
-[AC_CHECK_TOOL([LD], [ld], [ld])])
-AC_SUBST(LD)
-AS_IF([test "$GCC" = yes], [
- 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
- AS_CASE(["x$CC"], [xicc], [
- icc_version=`echo =__ICC | $CC -E -xc - | sed '/^=/!d;s///'`
- ])
- test -n "$icc_version" || icc_version=0
- # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
-], [
- linker_flag=
-])
-
-RUBY_PROG_GNU_LD
-RUBY_CPPOUTFILE
-
-: ${OUTFLAG='-o '}
-: ${COUTFLAG=${OUTFLAG}}
-: ${CSRCFLAG=''}
-AC_SUBST(OUTFLAG)
-AC_SUBST(COUTFLAG)
-AC_SUBST(CSRCFLAG)
-
-cc_version=
-for option in --version -v -V -qversion; do
- cc_version_message=`$CC $option 2>&1`
- cc_version_status=$?
- AS_CASE($cc_version_status, [0], [:], [continue])
- AS_CASE($cc_version_message, [*Warning*], [continue])
- cc_version='$(CC) '$option
- break
-done
-AC_SUBST(CC_VERSION, $cc_version)
-AC_SUBST(CC_VERSION_MESSAGE, $cc_version_message)
-
-RUBY_UNIVERSAL_ARCH
-AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no], [
- RUBY_DEFAULT_ARCH("$target_cpu")
-])
-
-AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
- AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
- AC_TRY_LINK([unsigned long atomic_var;],
- [
- __sync_val_compare_and_swap(&atomic_var, 0, 1);
- ],
- [rb_cv_gcc_compiler_cas=yes],
- [rb_cv_gcc_compiler_cas=no])])
- AS_IF([test "$rb_cv_gcc_compiler_cas" = no], [
- unset rb_cv_gcc_compiler_cas
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -march=i486"
- AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [
- AC_TRY_LINK([unsigned long atomic_var;],
- [
- __sync_val_compare_and_swap(&atomic_var, 0, 1);
- ],
- [rb_cv_gcc_compiler_cas=yes
- ARCH_FLAG="-march=i486"],
- [rb_cv_gcc_compiler_cas=no])])
- CFLAGS="$save_CFLAGS"
- ])])
-
-AS_CASE(["$target_os"], [darwin*], [
-if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then
- ac_cv_prog_ac_ct_RANLIB=:
- ac_cv_prog_ac_ct_AR='libtool -static'
- rb_cv_arflags='-no_warning_for_no_symbols -o'
-fi
-])
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(AR, ar)
-AS_IF([test -z "$AR"], [
- AC_CHECK_PROGS(AR, aal, ar)
-])
-AC_CACHE_CHECK([for $AR flags], [rb_cv_arflags], [
- AS_IF([$AR rcD conftest.a > /dev/null 2>&1 && rm conftest.a],
- [rb_cv_arflags=rcD], [rb_cv_arflags=rcu])
-])
-AC_SUBST(ARFLAGS, ["$rb_cv_arflags "])
-
-AC_CHECK_TOOL(AS, as)
-ASFLAGS=$ASFLAGS
-AC_SUBST(ASFLAGS)
-
-AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
-
-# BSD's ports and MacPorts prefix GNU binutils with 'g'
-AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
-AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
-
-AS_CASE(["$target_os"],
-[cygwin*|mingw*], [
- AC_CHECK_TOOL(WINDRES, windres)
- AC_CHECK_TOOL(DLLWRAP, dllwrap)
- target=`echo $target | sed "s/^$target_cpu-/-/"`
- target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
- target_cpu=`echo $target_cpu | sed s/i.86/i386/`
- AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
- AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
- AS_CASE(["$target_os"],
- [mingw*], [
- test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
- AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
- AC_TRY_LINK([@%:@include <stdio.h>],
- [FILE* volatile f = stdin; return 0;],
- [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
- tr A-Z a-z |
- sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
- [rb_cv_msvcrt=msvcrt])
- test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
- RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
- test "$RT_VER" = "" && RT_VER=60
- AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
- sysconfdir=
- ])
- : ${enable_shared=yes}
- ],
-[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
-[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
-AC_CHECK_TOOL(NM, nm)
-
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_PROG_INSTALL
-AC_PROG_MKDIR_P
-AS_IF([test "x$MKDIR_P" = "x -d"], [
- AS_IF([test x"$as_mkdir_p" != xfalse], [
- MKDIR_P='mkdir -p'
- echo "use 'mkdir -p' as MKDIR_P"
- ], [
- AC_MSG_ERROR([mkdir -p is required])
- ])
-])
-MAKEDIRS="$MKDIR_P"
-AC_SUBST(MAKEDIRS)
-
-AC_DEFUN([RUBY_DTRACE_AVAILABLE],
-[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available,
-[
- echo "provider conftest{ probe fire(); };" > conftest_provider.d
- rb_cv_dtrace_available=no
- AS_FOR(opt, rb_dtrace_opt, ["-xnolibs" ""], [dnl
- AS_IF([$DTRACE opt -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null],
- [], [continue])
- AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();],
- [], [continue])
- # DTrace is available on the system
- rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"}
- break
- ])
- rm -f conftest.[co] conftest_provider.[dho]
-])
-AS_CASE(["$rb_cv_dtrace_available"], ["yes("*")"],
- [DTRACE_OPT=`expr "$rb_cv_dtrace_available" : "yes(\(.*\))"`])
-])
-
-AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
-[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
-[
- rb_cv_prog_dtrace_g=no
- AS_IF([{
- cat >conftest_provider.d <<_PROBES &&
- provider conftest {
- probe fire();
- };
-_PROBES
- $DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
- :
- }], [
- AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
- AS_IF([{
- cp -p conftest.${ac_objext} conftest.${ac_objext}.save &&
- $DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null &&
- :
- }], [
- AS_IF([cmp -s conftest.o conftest.${ac_objext}.save], [
- rb_cv_prog_dtrace_g=yes
- ], [
- rb_cv_prog_dtrace_g=rebuild
- ])
- ])])
- ])
- rm -f conftest.[co] conftest_provider.[dho]
-])
-])
-
-AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
-AS_IF([test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"], [
- AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
-])
-
-AC_CHECK_PROGS(DOT, dot)
-AC_CHECK_PROGS(DOXYGEN, doxygen)
-
-AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
- [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
-
-# checks for UNIX variants that set C preprocessor variables
-AC_USE_SYSTEM_EXTENSIONS
-
-AC_SUBST(RM, ['rm -f'])
-AC_SUBST(CP, ['cp'])
-RMDIRS='$(top_srcdir)/tool/rmdirs'
-RMDIR=rmdir
-mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
-rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
-RMDIR='rmdir --ignore-fail-on-non-empty'
-$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
-{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
-rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
-AC_SUBST(RMDIR)
-AC_SUBST(RMDIRS)
-AC_SUBST(RMALL, ['rm -fr'])
-
-AC_MSG_CHECKING([for cd using physical directory])
-rm -fr conf$$.dir
-mkdir conf$$.dir &&
-(cd conf$$.dir && mkdir src build && cd src &&
-$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
-for chdir in 'cd -P' 'PWD= cd'; do
- /bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
-done)
-AS_IF([test -f conf$$.dir/src/cdcmd], [
- read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
-], [
- CHDIR=cd
-])
-rm -fr conf$$.dir
-AC_MSG_RESULT([$CHDIR])
-AC_SUBST(CHDIR)
-
-}
-{ # compiler section
-
-AC_DEFUN([RUBY_WERROR_FLAG], [dnl
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $rb_cv_warnflags"
-AS_IF([test "${ac_c_werror_flag+set}"], [
- rb_c_werror_flag="$ac_c_werror_flag"
-], [
- unset rb_c_werror_flag
-])
-ac_c_werror_flag=yes
-$1
-CFLAGS="$save_CFLAGS"
-save_CFLAGS=
-AS_IF([test "${rb_c_werror_flag+set}"], [
- ac_c_werror_flag="$rb_c_werror_flag"
-], [
- unset ac_c_werror_flag
-])])
-
-RUBY_WERROR_FLAG([
- AC_MSG_CHECKING([whether CFLAGS is valid])
- AC_TRY_COMPILE([], [],
- [AC_MSG_RESULT(yes)],
- [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
- ]
- )
- 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_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
- RUBY_WERROR_FLAG([
- CFLAGS="[$]CFLAGS $1"
- AC_TRY_COMPILE([$4], [$5],
- [$2
- AC_MSG_RESULT(yes)],
- [$3
- AC_MSG_RESULT(no)])
- ])
-])
-
-AC_DEFUN([RUBY_TRY_LDFLAGS], [
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="[$]LDFLAGS $1"
- AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
- RUBY_WERROR_FLAG([
- AC_TRY_LINK([$4], [$5],
- [$2
- AC_MSG_RESULT(yes)],
- [$3
- AC_MSG_RESULT(no)])
- ])
- LDFLAGS="$save_LDFLAGS"
- save_LDFLAGS=
-])
-
-: ${DLDFLAGS="$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], [-*],
- [RUBY_DEVEL=yes], [RUBY_DEVEL=no])
-particular_werror_flags=$RUBY_DEVEL
-AC_ARG_ENABLE(werror,
- AS_HELP_STRING([--disable-werror],
- [don't make warnings into errors
- even if a compiler support -Werror feature
- [[disabled by default unless development version]]]),
- [particular_werror_flags=$enableval])
-
-rb_cv_warnflags="$warnflags"
-AS_IF([test "$GCC:${warnflags+set}:no" = yes::no], [
- AS_IF([test $gcc_major -ge 4], [
- extra_warning=-Werror=extra-tokens
- ], [
- extra_warning=
- ])
- AS_IF([test $gcc_major -ge 5 -a $gcc_major -le 6], [
- extra_warning="$extra_warning -Wno-maybe-uninitialized"
- ])
- # ICC doesn't support -Werror=
- AS_IF([test $icc_version -gt 0], [
- particular_werror_flags=no
- ])
- for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
- -diag-disable=175,188,2259 \
- -Wno-missing-field-initializers \
- -Wno-tautological-compare \
- -Wno-parentheses-equality \
- -Wno-constant-logical-operand \
- -Wno-self-assign \
- -Wunused-variable \
- -Werror=implicit-int \
- -Werror=pointer-arith \
- -Werror=write-strings \
- -Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
- -Werror=implicit-function-declaration \
- -Werror=division-by-zero \
- -Werror=deprecated-declarations \
- -Werror=misleading-indentation \
- -Wno-packed-bitfield-compat \
- -Wsuggest-attribute=noreturn \
- -Wsuggest-attribute=format \
- -Wimplicit-fallthrough=0 \
- -Werror=duplicated-cond \
- -Werror=restrict \
- $extra_warning \
- ; do
- AS_IF([test "$particular_werror_flags" != yes], [
- wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
- ])
- ok=no
- RUBY_TRY_CFLAGS($wflag, [
- RUBY_APPEND_OPTIONS(warnflags, $wflag)
- ok=yes
- ])
- AS_CASE([$ok:$wflag], [no:-Werror=*], [
- wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
- RUBY_TRY_CFLAGS($wflag, [
- RUBY_APPEND_OPTIONS(warnflags, $wflag)
- particular_werror_flags=no
- ])
- ])
- done
- AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
- [wflag=-Wall])
- RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
- # Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
- rb_cv_warnflags="$warnflags"
- warnflags=
-])
-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])])
- AS_IF([eval test '"$rb_cv_'$n'"' = yes], [
- AC_DEFINE_UNQUOTED([HAVE_]$m)
- ])
-done
-
-AC_ARG_WITH(compress-debug-sections,
- AS_HELP_STRING([--with-compress-debug-sections=type],
- [enable debug section compression]),
- [compress_debug_sections=$withval], [compress_debug_sections=])
-
-AS_IF([test "$GCC" = yes], [
- # -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*], [
- stack_protector=no
- ])
- AS_IF([test -z "${stack_protector+set}"], [
- RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
- AS_IF([test "x$stack_protector" = xyes], [
- RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
- ])
- ])
- AS_IF([test "x$stack_protector" = xyes], [
- RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
- RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
- RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
- ])
-
- AS_CASE("${compress_debug_sections:-zlib}",
- [none|no], [], [
- RUBY_TRY_LDFLAGS(${linker_flag}--compress-debug-sections=${compress_debug_sections:-zlib},
- [compress_debug_sections=${compress_debug_sections:-zlib}],
- [compress_debug_sections=no])
- ])
- AS_IF([test "x$compress_debug_sections" != xno], [
- RUBY_APPEND_OPTION(DLDFLAGS, ${linker_flag}--compress-debug-sections=$compress_debug_sections)
- ])
-
- AS_CASE(["$target_os"],[mingw*], [
- # On Windows platforms, system provided headers are VC++
- # optimized. That is, C++ habits are often contaminated into
- # various headers. Most frequent situation is the use of //
- # comments. We bypass ANSI C mode for them. Otherwise
- # extension libs cannot include those headers.
-
- # 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"
- AS_IF([test "$particular_werror_flags" = "yes"], [
- CFLAGS="$CFLAGS -Werror=uninitialized"
- ], [
- CFLAGS="$CFLAGS -Werror -Wuninitialized"
- ])
- 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"
- ])
- AS_IF([test "$rb_cv_mingw64_broken_frexp_modf" = yes], [
- AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
- ])
- ],
- [cygwin*|darwin*|netbsd*], [
- # need lgamma_r(), finite()
- ],
- [
- # ANSI (no XCFLAGS because this is C only)
- for ansi_options in -std=gnu99; 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
- RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
-
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
- test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
-])
-test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
-AS_IF([test "x$RUBY_DEVEL" = xyes], [RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_DEVEL=1)])
-
-AS_IF([test "$GCC" = ""], [
- AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
-])
-AS_IF([test "$GCC" = yes], [
- AS_IF([test "$gcc_major" -ge 4], [
- RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
- ])
- AC_SUBST(WERRORFLAG, "-Werror")
- AS_IF([test "$visibility_option" = yes], [
- RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
- AC_DEFINE(RUBY_SYMBOL_EXPORT_BEGIN, [_Pragma("GCC visibility push(default)")])
- AC_DEFINE(RUBY_SYMBOL_EXPORT_END, [_Pragma("GCC visibility pop")])
- ], [
- RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
- ])
- test "$visibility_option" = no || OBJCOPY=:
-])
-
-AS_IF([test "$GCC" = yes], [
- # optflags
-
- 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])
- AS_IF([test "$static_libgcc" = yes], [
- RUBY_APPEND_OPTION(EXTLDFLAGS, -static-libgcc)
- ])
- ])
-
- # disable fast-math
- for oflag in -fno-fast-math; do
- RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(CFLAGS, $oflag)])
- done
- for oflag in -fexcess-precision=standard -fp-model\ precise; do
- RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(XCFLAGS, $oflag)])
- done
-])
-
-AC_ARG_WITH(opt-dir,
- AS_HELP_STRING([--with-opt-dir=DIR-LIST],
- [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
- [
- val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
- CPPFLAGS="$CPPFLAGS $val"
- 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"
- 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\""
-
-}
-{ # header and library section
-
-AC_ARG_WITH(winnt-ver,
- AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
- [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
-AS_CASE(["$target_os"],
-[mingw*], [
- RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
- RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
-])
-
-AS_CASE(["$target_os"],
-[freebsd*], [
- AC_CACHE_CHECK([whether pthread should be enabled by default],
- rb_cv_enable_pthread_default,
- [AC_TRY_CPP([
-#include <osreldate.h>
-#if __FreeBSD_version < 502102
-#error pthread should be disabled on this platform
-#endif
- ],
- rb_cv_enable_pthread_default=yes,
- rb_cv_enable_pthread_default=no)])
- enable_pthread=$rb_cv_enable_pthread_default
- ],
-[mingw*], [
- enable_pthread=no
- ],
-[
- enable_pthread=yes
- ])
-
-dnl Checks for libraries.
-AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
-
-POSTLINK=:
-AC_SUBST(POSTLINK)
-AS_CASE(["$target_os"],
-[nextstep*], [ ],
-[openstep*], [ ],
-[rhapsody*], [ ],
-[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
- AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
- AC_TRY_CPP([#include <AvailabilityMacros.h>
- #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
- #error pre OS X 10.4
- [!<===== pre OS X 10.4 =====>]
- #endif
- ],
- [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
- ])
- AS_IF([test $macosx_10_5 = yes], [
- ac_cv_func_getcontext=no
- ac_cv_func_setcontext=no
- ], [
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ])
- 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
- AS_IF([test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \)], [
- ac_cv_func___builtin_setjmp=no
- ])
- AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-
-void
-broken_crypt(const char *salt, const char *buf1, const char *buf2)
-{
-#if 0
- printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
- buf1+2, buf2+2);
-#endif
-}
-
-int
-main()
-{
- int i;
- char salt[2], buf[256], *s;
- for (i = 0; i < 128*128; i++) {
- salt[0] = 0x80 | (i & 0x7f);
- salt[1] = 0x80 | (i >> 7);
- strcpy(buf, crypt("", salt));
- if (strcmp(buf, s = crypt("", salt))) {
- broken_crypt(salt, buf, s);
- return 1;
- }
- }
- salt[0] = salt[1] = ' ';
- strcpy(buf, crypt("", salt));
- salt[0] = salt[1] = 0x80 | ' ';
- if (strcmp(buf, s = crypt("", salt))) {
- broken_crypt(salt, buf, s);
- return 1;
- }
- return 0;
-}
-],
- rb_cv_broken_crypt=no,
- rb_cv_broken_crypt=yes,
- rb_cv_broken_crypt=yes)])
- AS_IF([test "$rb_cv_broken_crypt" = yes], [
- AC_DEFINE(BROKEN_CRYPT, 1)
- ])
- POSTLINK=""
- AC_CHECK_PROGS(codesign, codesign)
- AC_CHECK_PROGS(dsymutil, dsymutil)
- AS_IF([test -n "$codesign"], [
- POSTLINK="{ test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@; }${POSTLINK:+; $POSTLINK}"
- ])
- AS_IF([test -n "$dsymutil"], [
- POSTLINK="$dsymutil \$@${POSTLINK:+; $POSTLINK}"
- ])
- AS_IF([test -n "${POSTLINK}"], [
- LINK_SO="$LINK_SO
-\$(POSTLINK)"
- ])
- AC_CHECK_HEADERS(crt_externs.h, [], [], [
- #include <crt_externs.h>
- ])
- ],
-[hpux*], [ LIBS="-lm $LIBS"
- ac_cv_c_inline=no],
-[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)
- AS_IF([test $given_xopen_source = no], [
- # 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
- AS_IF([test x"$define_xopen_source" != x], [
- break
- ])
- # 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
- AS_IF([test x"$define_xopen_source" = x], [
- define_xopen_source=no
- ])
- AC_MSG_RESULT($define_xopen_source)
- AS_IF([test x"$define_xopen_source" != xno], [
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
- ])
- ])
- ],
-[haiku*], [
- LIBS="$LIBS" # m lib is include in root
- ],
-[cygwin*], [ ac_cv_header_langinfo_h=yes
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_GNU_SOURCE)
- AC_CHECK_FUNCS(cygwin_conv_path)
- AC_LIBOBJ([langinfo])
- ],
-[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi $LIBS"
- ac_cv_header_a_out_h=no
- ac_cv_header_pwd_h=no
- ac_cv_header_utime_h=no
- ac_cv_header_sys_ioctl_h=no
- ac_cv_header_sys_param_h=no
- ac_cv_header_sys_resource_h=no
- ac_cv_header_sys_select_h=no
- 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
- ac_cv_func_seekdir=yes
- ac_cv_func_telldir=yes
- 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
- ac_cv_lib_dl_dlopen=no
- rb_cv_binary_elf=no
- rb_cv_negative_time_t=no
- ac_cv_func_fcntl=yes
- ac_cv_func_flock=yes
- ac_cv_func_gmtime_r=yes
- rb_cv_large_fd_select=yes
- ac_cv_type_struct_timeval=yes
- ac_cv_func_clock_gettime=yes
- ac_cv_func_clock_getres=yes
- ac_cv_func_malloc_usable_size=no
- AS_IF([test "$target_cpu" = x64], [
- ac_cv_func___builtin_setjmp=no
- ac_cv_func_round=no
- ])
- ac_cv_func_tgamma=no
- rb_cv_negative_time_t=yes
- AC_CHECK_TYPE([NET_LUID], [], [],
- [@%:@include <winsock2.h>
- @%:@include <iphlpapi.h>])
- AS_IF([test x"$ac_cv_type_NET_LUID" = xyes], [
- AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
- ])
- AC_CHECK_FUNCS(_gmtime64_s)
- AC_CHECK_FUNCS(_wfreopen_s)
- AC_LIBOBJ([langinfo])
- ],
-[bsdi*], [ LIBS="-lm $LIBS"
- AC_DEFINE(BROKEN_SETREUID, 1)
- AC_DEFINE(BROKEN_SETREGID, 1)
- ac_cv_sizeof_rlim_t=8],
-[freebsd*], [ LIBS="-lm $LIBS"
- ac_cv_func_getpeername=no
- ac_cv_func_getsockname=no
- 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
- ],
-[ LIBS="-lm $LIBS"])
-
-AC_CHECK_LIB(crypt, crypt) # glibc (GNU/Linux, GNU/Hurd, GNU/kFreeBSD)
-AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
-AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
-AC_CHECK_LIB(socket, shutdown) # SunOS/Solaris
-
-dnl Checks for header files.
-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(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/sysmacros.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],
- [disable GNU GMP to accelerate Bignum operations])],
- [],
- [with_gmp=yes])
-AS_IF([test "x$with_gmp" != xno],
- [AC_CHECK_HEADERS(gmp.h)
- AS_IF([test "x$ac_cv_header_gmp_h" != xno],
- 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>])
- ],
- [test x$with_jemalloc = xyes && with_jemalloc=no])
- 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_DEFINE(HAVE_MALLOC_CONF)
- 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.
-AS_IF([test x"$enable_largefile" != xno], [
- 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])])
- ])
-])
-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],
- [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)])
-
-AC_CHECK_TYPES([long long, off_t])
-
-AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
- [test "$universal_binary" = yes && cross_compiling=yes
- AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
- [AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
- test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
-
-dnl RUBY_CHECK_SIZEOF [typename], [maybe same size types], [macros], [include]
-AC_DEFUN([RUBY_CHECK_SIZEOF],
-[dnl
-AS_VAR_PUSHDEF([rbcv_var], [rbcv_sizeof_var])dnl
-AS_VAR_PUSHDEF([cond], [rbcv_sizeof_cond])dnl
-AS_VAR_PUSHDEF([t], [rbcv_sizeof_type])dnl
-AS_VAR_PUSHDEF([s], [rbcv_sizeof_size])dnl
-]
-[m4_bmatch([$1], [\.], [], [if test "$universal_binary" = yes; then])
-AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [
- unset AS_TR_SH(ac_cv_sizeof_$1)
- rbcv_var="
-typedef m4_bpatsubst([$1], [\..*]) ac__type_sizeof_;
-static ac__type_sizeof_ *rbcv_ptr;
-@%:@define AS_TR_CPP(SIZEOF_$1) sizeof((*rbcv_ptr)[]m4_bmatch([$1], [\.], .m4_bpatsubst([$1], [^[^.]*\.])))
-"
- m4_ifval([$2], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
- for t in $2; do
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([$4]
- [$rbcv_var]),
- [AS_TR_CPP(SIZEOF_$1) == sizeof($t)])], [
- AS_TR_SH(ac_cv_sizeof_$1)=AS_TR_CPP([SIZEOF_]$t)
- break])
- done
- }], [
- AC_COMPUTE_INT([AS_TR_SH(ac_cv_sizeof_$1)], [AS_TR_CPP(SIZEOF_$1)],
- [AC_INCLUDES_DEFAULT([$4])
-$rbcv_var],
- [AS_TR_SH(ac_cv_sizeof_$1)=])
- ])
- unset cond
- m4_ifval([$3], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
- for s in 32 64 128; do
- for t in $3; do
- cond="${cond}
-@%:@${cond+el}if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})"
- hdr="AC_INCLUDES_DEFAULT([$4
-@%:@if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})
-@%:@ define AS_TR_CPP(HAVE_$1) 1
-@%:@else
-@%:@ define AS_TR_CPP(HAVE_$1) 0
-@%:@endif])"
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr], [!AS_TR_CPP(HAVE_$1)])], [continue])
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
- [$rbcv_var],
- [AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == ($s / $rb_cv_char_bit))])],
- [AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}"; continue])
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
-[
-@%:@if AS_TR_CPP(HAVE_$1)
-$rbcv_var
-@%:@else
-@%:@define AS_TR_CPP(SIZEOF_$1) 0
-@%:@endif
-],
- [AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == (m4_bmatch([$2], [^[0-9][0-9]*$], [$2], [($s / $rb_cv_char_bit)])))])],
- [AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}m4_bmatch([$2], [^[0-9][0-9]*$], [:$2])"])
- done
- done
- }])
- test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@@<:@1-9@:>@}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" &&
- m4_ifval([$2][$3],
- [test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
- test "$universal_binary" = yes && cross_compiling=yes
- AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
-[${cond+$cond
-@%:@else}
-$rbcv_var
-${cond+@%:@endif}
-@%:@ifndef AS_TR_CPP(SIZEOF_$1)
-@%:@define AS_TR_CPP(SIZEOF_$1) 0
-@%:@endif], [t=0])
- test "$universal_binary" = yes && cross_compiling=$real_cross_compiling
- AS_IF([test ${t-0} != 0], [
- AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
- ])
- }
- : ${AS_TR_SH(ac_cv_sizeof_$1)=0}
-])
-{
- unset cond
- for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
- AS_CASE(["$t"],
- [[[0-9]*|SIZEOF_*]], [
- ${cond+echo "@%:@else"}
- echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) $t"
- break
- ],
- [
- s=`expr $t : ['.*[^0-9]\([0-9][0-9]*\)$']`
- AS_CASE([$t], [*:*], [t="${t%:*}"], [s=`expr $s / $rb_cv_char_bit`])
- echo "@%:@${cond+el}if defined(__${t}__) || defined(__${t}) || defined(_${t}) || defined($t)"
- echo "@%:@define AS_TR_CPP(SIZEOF_$1) $s"
- cond=1
- ])
- done
- ${cond+echo "@%:@endif"}
-} >> confdefs.h
-m4_bmatch([$1], [\.], [], [else
-AC_CHECK_SIZEOF([$1], 0, [$4])
-fi])
-AS_VAR_POPDEF([rbcv_var])dnl
-AS_VAR_POPDEF([cond])dnl
-AS_VAR_POPDEF([t])dnl
-AS_VAR_POPDEF([s])dnl
-])
-
-RUBY_CHECK_SIZEOF(int, [], [ILP])
-RUBY_CHECK_SIZEOF(short)
-RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
-RUBY_CHECK_SIZEOF(long long)
-RUBY_CHECK_SIZEOF(__int64, [8], [ILP LP])
-RUBY_CHECK_SIZEOF(__int128, [16], [ILP LP])
-RUBY_CHECK_SIZEOF(off_t)
-RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
-RUBY_CHECK_SIZEOF(float)
-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])
-AS_IF([test "$rb_cv_packed_struct" != no], [
- AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
- RUBY_TRY_CFLAGS(-Wno-address-of-packed-member, [AC_DEFINE(USE_UNALIGNED_MEMBER_ACCESS)])
-], [
- AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
-])
-
-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(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
- for pri in $2; do
- AC_TRY_COMPILE(
- [@%:@include <stdio.h>
- @%:@include <stddef.h>
- @%:@ifdef __GNUC__
- @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
- decl __attribute__((format(printf, string_index, first_to_check)))
- @%:@else
- @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
- @%:@endif
- PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);],
- [printf("%]${pri}[d", (]$1[)42);
- test_sprintf("%]${pri}[d", (]$1[)42);],
- [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
- done)])
-AS_IF([test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE], [
- AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
- "[$rb_cv_pri_prefix_]AS_TR_SH($1)")
-])
-])
-
-AS_IF([test "x$ac_cv_type_long_long" = xyes], [
- RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
-], [test "x$ac_cv_type___int64" = xyes], [
- RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
-])
-
-dnl RUBY_CHECK_SIGNEDNESS [typename] [if-signed] [if-unsigned] [included]
-AC_DEFUN([RUBY_CHECK_SIGNEDNESS], [dnl
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($1)-1 > 0])],
- [$3], [$2])])
-
-dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
-AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
- AC_CHECK_TYPE([$1],
- [n="patsubst([$1],["],[\\"])"],
- [n="patsubst([$2],["],[\\"])"],
- [$4])
- AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
- u= t=
- AS_CASE(["$n "],
- [*" signed "*], [ ],
- [*" unsigned "*], [
- u=U],
- [RUBY_CHECK_SIGNEDNESS($n, [], [u=U], [$4])])
- AS_IF([test x"$t" = x], [
- for t in "long long" long int short; do
- test -n "$u" && t="unsigned $t"
- AC_COMPILE_IFELSE(
- [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])]
- [typedef $n rbcv_conftest_target_type;
- typedef $t rbcv_conftest_replace_type;
- extern rbcv_conftest_target_type rbcv_conftest_var;
- extern rbcv_conftest_replace_type rbcv_conftest_var;
- extern rbcv_conftest_target_type rbcv_conftest_func(void);
- extern rbcv_conftest_replace_type rbcv_conftest_func(void);
- ], [sizeof(rbcv_conftest_target_type) == sizeof(rbcv_conftest_replace_type)])],
- [n="$t"; break])
- done
- ])
- AS_CASE([" $n "],
- [*" long long "*], [
- t=LL],
- [*" long "*], [
- t=LONG],
- [
- t=INT])
- rb_cv_[$1]_convertible=${u}${t}])
- AS_IF([test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes"], [
- n="$1"
- ], [
- 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"])
- ])
- 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)
- AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
- AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
- AC_DEFINE_UNQUOTED(PRI_[$3]_PREFIX,
- [PRI_`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//']`_PREFIX])
-])
-RUBY_REPLACE_TYPE(pid_t, int, PIDT)
-RUBY_REPLACE_TYPE(uid_t, int, UIDT)
-RUBY_REPLACE_TYPE(gid_t, int, GIDT)
-RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
-RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
-RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
-RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [
-@%:@ifdef HAVE_SYS_TYPES_H
-@%:@include <sys/types.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TYPES_H
-@%:@include <sys/time.h>
-@%:@endif
-@%:@include <sys/resource.h>
-])
-RUBY_REPLACE_TYPE(off_t, [], OFFT)
-RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID)
-
-AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
- [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
- rb_cv_have_prototypes=yes,
- rb_cv_have_prototypes=no)])
-AS_IF([test "$rb_cv_have_prototypes" = yes], [
- AC_DEFINE(HAVE_PROTOTYPES)
-])
-
-AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
- [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
- [int xy = 1; return paste(x,y);],
- rb_cv_tokenpaste=ansi,
- rb_cv_tokenpaste=knr)])
-AS_IF([test "$rb_cv_tokenpaste" = ansi], [
- AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
-], [
- AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
-])
-
-AC_CACHE_CHECK(stringization, rb_cv_stringization, [
- rb_cv_stringization=no
- for string in "#expr" '"expr"'; do
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([
-#define STRINGIZE0(expr) $string
-#define STRINGIZE(expr) STRINGIZE0(expr)
-#undef real_test_for_stringization
-#define test_for_stringization -.real_test_for_stringization.-
-const char stringized[[]] = STRINGIZE(test_for_stringization);
-], [sizeof(stringized) == 32])],
- [rb_cv_stringization="$string"; break],
- [rb_cv_stringization=no])
- done]
-)
-AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
-AS_IF([test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"], [
- AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
- AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
-])
-
-AC_CACHE_CHECK([string literal concatenation],
- rb_cv_string_literal_concatenation, [
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([
-const char concatenated_literal[[]] = "literals" "to"
- "be" "concatenated.";
-], [sizeof(concatenated_literal) == 26])],
- [rb_cv_string_literal_concatenation=yes],
- [rb_cv_string_literal_concatenation=no])]
-)
-AS_IF([test "$rb_cv_string_literal_concatenation" = no], [
- AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
-])
-
-AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
- [AC_TRY_COMPILE([
-#include <stdarg.h>
-int foo(int x, ...) {
- va_list va;
- va_start(va, x);
- va_arg(va, int);
- va_arg(va, char *);
- va_arg(va, double);
- return 0;
-}
-], [return foo(10, "", 3.14);],
- rb_cv_stdarg=yes,
- rb_cv_stdarg=no)])
-AS_IF([test "$rb_cv_stdarg" = yes], [
- AC_DEFINE(HAVE_STDARG_PROTOTYPES)
-])
-
-AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
- [AC_TRY_COMPILE([
-int foo(int x, ...);
-@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)
-], [FOO(1);FOO(1,2);FOO(1,2,3);],
- rb_cv_va_args_macro=yes,
- rb_cv_va_args_macro=no)])
-AS_IF([test "$rb_cv_va_args_macro" = yes], [
- AC_DEFINE(HAVE_VA_ARGS_MACRO)
-])
-
-AC_DEFUN([RUBY_DEFINE_IF], [dnl
- m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
-@%:@if $1
-EOH
-])dnl
-AC_DEFINE_UNQUOTED($2, $3)dnl
- m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
-@%:@endif /* $1 */
-EOH
-])dnl
-])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], 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_]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 m4_ifval([$2],[m4_bpatsubst([$2], [(.*)], [])],[$1]) [$5] attribute, rbcv, dnl
-[rbcv=x
-RUBY_WERROR_FLAG([
-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[](attrib_params)[ $mac]
-m4_ifval([$4],${rbcv_cond+[@%:@else]}
-${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]}
-${rbcv_cond+[@%:@endif]})
-$6
-@%:@define mesg ("")
- attrib[](attrib_params)[;], [],
- [rbcv="$mac"; break])
-done
-])])
-AS_IF([test "$rbcv" != x], [
- RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv)
-])
-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 int 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;}
-])
-])
-
-RUBY_FUNC_ATTRIBUTE(__const__, CONSTFUNC)
-RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC)
-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(__always_inline__, ALWAYS_INLINE)
-RUBY_FUNC_ATTRIBUTE(__warn_unused_result__, WARN_UNUSED_RESULT)
-RUBY_FUNC_ATTRIBUTE(__unused__, MAYBE_UNUSED)
-RUBY_FUNC_ATTRIBUTE(__error__ mesg, ERRORFUNC(mesg,x), rb_cv_func___error__)
-RUBY_FUNC_ATTRIBUTE(__warning__ mesg, WARNINGFUNC(mesg,x), rb_cv_func___warning__)
-RUBY_FUNC_ATTRIBUTE(__weak__, WEAK, rb_cv_func_weak)
-AS_IF([test "$rb_cv_func_weak" != x], [
- AC_DEFINE(HAVE_FUNC_WEAK)
-])
-
-if_i386=${universal_binary+[defined __i386__]}
-RUBY_FUNC_ATTRIBUTE(__stdcall__, FUNC_STDCALL, rb_cv_func_stdcall, ${if_i386})
-RUBY_FUNC_ATTRIBUTE(__cdecl__, FUNC_CDECL, rb_cv_func_cdecl, ${if_i386})
-RUBY_FUNC_ATTRIBUTE(__fastcall__, FUNC_FASTCALL, rb_cv_func_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)
-
-AS_IF([test "$GCC" = yes], [
- AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
- [rb_cv_gcc_function_alias=no
- for a in alias weak,alias; do
- AC_TRY_LINK([void foo(void) {}
- void bar(void) __attribute__(($a("foo")));], [bar()],
- [rb_cv_gcc_function_alias=$a; break])
- done])
- AS_IF([test "$rb_cv_gcc_function_alias" != no], [
- AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS)
- AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
- [type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
- AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
- [RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
- ])
-
- AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
- AC_TRY_LINK([unsigned char atomic_var;],
- [
- __atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
- __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])])
- AS_IF([test "$rb_cv_gcc_atomic_builtins" = yes], [
- AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
- ])
-
- AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
- AC_TRY_LINK([unsigned char atomic_var;],
- [
- __sync_lock_test_and_set(&atomic_var, 0);
- __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])])
- AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [
- AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
- ])
-
- AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
- [RUBY_WERROR_FLAG(
- [AC_TRY_LINK([volatile int zero;],
- [if (zero) __builtin_unreachable();],
- [rb_cv_func___builtin_unreachable=yes],
- [rb_cv_func___builtin_unreachable=no])
- ])
- ])
- AS_IF([test "$rb_cv_func___builtin_unreachable" = yes], [
- AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
- ])
-])
-
-AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
-rb_cv_func_exported=no
-RUBY_WERROR_FLAG([
-for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do
- AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
- RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
- [rb_cv_func_exported="$mac"; break])
-done
-])])
-AS_IF([test "$rb_cv_func_exported" != no], [
- AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
-])
-
-RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-
-AC_CACHE_CHECK(for function name string predefined identifier,
- rb_cv_function_name_string,
- [rb_cv_function_name_string=no
- RUBY_WERROR_FLAG([
- for func in __func__ __FUNCTION__; do
- AC_TRY_LINK([@%:@include <stdio.h>],
- [puts($func);],
- [rb_cv_function_name_string=$func
- break])
- done
- ])]
-)
-AS_IF([test "$rb_cv_function_name_string" != no], [
- AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
-])
-
-AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [
- rb_cv_enum_over_int=no
- AS_IF([test "x$ac_cv_type_long_long" = xyes], [
- type="unsigned long long" max="ULLONG_MAX"
- ], [
- type="unsigned long" max="ULONG_MAX"
- ])
- 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]
- )
- ])
-])
-AS_IF([test $rb_cv_enum_over_int = yes], [
- AC_DEFINE(ENUM_OVER_INT, 1)
-])
-
-dnl Check whether we need to define sys_nerr locally
-AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
-@%:@include <errno.h>])
-
-AC_CHECK_DECLS([getenv])
-
-AS_CASE(["$target_cpu"],
-[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
- [*::yes], # gcc
- [CFLAGS="-mieee $CFLAGS"],
- [osf*], # ccc
- [CFLAGS="-ieee $CFLAGS"],
- )],
-[sparc*], [AC_LIBOBJ([sparc])])
-
-ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
-AS_IF([test "$ac_cv_header_net_socket_h" = yes], [
- ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
-], [
- ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
-])
-
-
-AC_TYPE_SIZE_T
-RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [],
- [@%:@include <sys/types.h>])
-RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
-RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
-RUBY_CHECK_PRINTF_PREFIX(size_t, z)
-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], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
-AS_IF([test "$ac_cv_member_struct_stat_st_blocks" = yes], [
- RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
-])
-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])
-AC_CHECK_MEMBERS([struct stat.st_mtim])
-AC_CHECK_MEMBERS([struct stat.st_mtimespec])
-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>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@include <sys/time.h>
-@%:@endif])
-
-AS_IF([test "${ac_cv_type_struct_timeval}" = yes], [
- RUBY_CHECK_SIZEOF([struct timeval.tv_sec], [time_t long "long long"], [],
- [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@include <sys/time.h>
-@%:@endif])
- AS_CASE(${ac_cv_sizeof_struct_timeval_tv_sec},
- [SIZEOF_INT], [t=int],
- [SIZEOF_LONG], [t=long],
- [SIZEOF_LONG_LONG], [t=LONG_LONG],
- [t=])
- AS_IF([test "${t}" != ""], [
- AC_DEFINE_UNQUOTED(TYPEOF_TIMEVAL_TV_SEC, [$t])
- ])
-])
-
-AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@include <sys/time.h>
-@%:@endif])
-
-AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@ include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@ include <sys/time.h>
-@%:@endif])
-
-AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H
-@%:@ include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@ include <sys/time.h>
-@%:@endif])
-
-AC_CACHE_VAL([rb_cv_large_fd_select],
- [AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no], [AC_INCLUDES_DEFAULT([])
-@%:@ifdef HAVE_SYS_SELECT_H
-@%:@ include <sys/select.h>
-@%:@endif])])
-AS_IF([test "$rb_cv_large_fd_select" = yes], [
- AC_DEFINE(HAVE_RB_FD_INIT, 1)
-])
-
-dnl RUBY_DEFINT TYPENAME, SIZE, [UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
-AC_DEFUN([RUBY_DEFINT], [dnl
-AS_VAR_PUSHDEF([cond], [rb_defint_cond])dnl
-AS_VAR_PUSHDEF([type], [rb_defint_type])dnl
-AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
-typedef $1 t; int s = sizeof(t) == 42;])],
- [rb_cv_type_$1=yes],
- [AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
- ["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
- ["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
- ["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
- ["$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])])])
-AS_IF([test "${rb_cv_type_$1}" != no], [
- type="${rb_cv_type_$1@%:@@%:@unsigned }"
- AS_IF([test "$type" != yes && eval 'test -n "${ac_cv_sizeof_'$type'+set}"'], [
- eval cond='"${ac_cv_sizeof_'$type'}"'
- AS_CASE([$cond], [*:*], [
- cond=AS_TR_CPP($type)
- echo "@%:@if defined SIZEOF_"$cond" && SIZEOF_"$cond" > 0" >> confdefs.h
- ], [cond=])
- ], [cond=])
- AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
- AS_IF([test "${rb_cv_type_$1}" = yes], [
- m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
- [RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
- ], [
- AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
- AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$type]))
- ])
- test -n "$cond" && echo "@%:@endif /* $cond */" >> confdefs.h
-])
-AS_VAR_POPDEF([cond])dnl
-AS_VAR_POPDEF([type])dnl
-])
-
-RUBY_DEFINT(int8_t, 1)
-RUBY_DEFINT(uint8_t, 1, unsigned)
-RUBY_DEFINT(int16_t, 2)
-RUBY_DEFINT(uint16_t, 2, unsigned)
-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.
-
-AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
-[rb_cv_stack_end_address=no
- AC_TRY_LINK(
- [extern void *__libc_stack_end;],
- [if (!__libc_stack_end) return 1;],
- [rb_cv_stack_end_address="__libc_stack_end"])
-])
-AS_IF([test $rb_cv_stack_end_address != no], [
- AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
-])
-
-# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE.
-# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901
-# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142)
-# MirOS #10semel has the problem but fixed in the repository. (src/lib/libc/stdlib/malloc.c:1.9)
-AS_CASE(["$target_os"],
-[openbsd*|mirbsd*], [
- AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
- [rb_cv_page_size_log=no
- for page_log in 12 13; do
- AC_TRY_RUN([
-#include <math.h>
-#include <unistd.h>
-
-int
-main() {
- if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
- return 0;
-}
- ],
- rb_cv_page_size_log="$page_log"; break)
- done])
- AS_IF([test $rb_cv_page_size_log != no], [
- AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
- ], [
- AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
- ])
-])
-
-dnl Checks for library functions.
-AC_TYPE_GETGROUPS
-AC_TYPE_SIGNAL
-AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
-[powerpc-darwin*], [
- AC_LIBSOURCES(alloca.c)
- AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
- AC_DEFINE(C_ALLOCA)
- AC_DEFINE_UNQUOTED(alloca, alloca)
- ],
-[universal-darwin*:*ppc*], [
- AC_LIBSOURCES(alloca.c)
- AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
- RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
- RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
- ],
-[
- AC_FUNC_ALLOCA
- ])
-AS_IF([test "x$ALLOCA" = "x"], [
- AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
- for chk in ok __chkstk; do
- AC_TRY_LINK([
- @%:@ifdef HAVE_ALLOCA_H
- @%:@include <alloca.h>
- @%:@endif
- void $chk() {}
- int dynamic_alloca_test;
- int dynamic_alloca_result;],
- [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
- [rb_cv_dynamic_alloca=$chk; break])
- done])
- AS_IF([test "x$rb_cv_dynamic_alloca" = "x__chkstk"], [
- AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
- AS_CASE("$target_cpu",
- [x64|x86_64], [
- AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
- ],)
- ])
-])
-AC_FUNC_MEMCMP
-
-# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
-# Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
-# Debian GNU/Linux Lenny's libc6.1 2.7-10 has no problem.
-AC_CACHE_CHECK(for broken erfc of glibc-2.3.6 on IA64, rb_cv_broken_glibc_ia64_erfc,
- [AC_TRY_RUN([
-#include <math.h>
-int
-main()
-{
- erfc(10000.0);
- return 0;
-}
-],
- rb_cv_broken_glibc_ia64_erfc=no,
- rb_cv_broken_glibc_ia64_erfc=yes,
- rb_cv_broken_glibc_ia64_erfc=no)])
-AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no])
-
-AS_CASE(["$target_os"],[freebsd*],[
- AC_DEFINE(BROKEN_CLOSE)
- AC_REPLACE_FUNCS(close)
- ])
-
-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"],
-[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
-[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
-[])
-AC_CHECK_HEADERS(sys/pstat.h)
-
-
-AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
- [AC_TRY_LINK([
-#include <math.h>
-], [int v = signbit(-0.0);],
- rb_cv_have_signbit=yes,
- rb_cv_have_signbit=no)])
-AS_IF([test "$rb_cv_have_signbit" = yes], [
- AC_DEFINE(HAVE_SIGNBIT)
-], [
- AC_LIBOBJ([signbit])
-])
-
-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(arc4random_buf)
-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(crypt_r)
-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)
-AC_CHECK_FUNCS(endgrent)
-AC_CHECK_FUNCS(fchmod)
-AC_CHECK_FUNCS(fchown)
-AC_CHECK_FUNCS(fcntl)
-AC_CHECK_FUNCS(fdatasync)
-AC_CHECK_FUNCS(fdopendir)
-AC_CHECK_FUNCS(fgetattrlist)
-AC_CHECK_FUNCS(fmod)
-AC_CHECK_FUNCS(fstatat)
-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)
-AC_CHECK_FUNCS(lchown)
-AC_CHECK_FUNCS(link)
-AC_CHECK_FUNCS(llabs)
-AC_CHECK_FUNCS(lockf)
-AC_CHECK_FUNCS(log2)
-AC_CHECK_FUNCS(lstat)
-AC_CHECK_FUNCS(lutimes)
-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(openat)
-AC_CHECK_FUNCS(pipe2)
-AC_CHECK_FUNCS(poll)
-AC_CHECK_FUNCS(posix_fadvise)
-AC_CHECK_FUNCS(posix_memalign)
-AC_CHECK_FUNCS(ppoll)
-AC_CHECK_FUNCS(pread)
-AC_CHECK_FUNCS(pwrite)
-AC_CHECK_FUNCS(qsort_r)
-AC_CHECK_FUNCS(qsort_s)
-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)
-AC_CHECK_FUNCS(setegid)
-AC_CHECK_FUNCS(setenv)
-AC_CHECK_FUNCS(seteuid)
-AC_CHECK_FUNCS(setgid)
-AC_CHECK_FUNCS(setgroups)
-AC_CHECK_FUNCS(setpgid)
-AC_CHECK_FUNCS(setpgrp)
-AC_CHECK_FUNCS(setregid)
-AC_CHECK_FUNCS(setresgid)
-AC_CHECK_FUNCS(setresuid)
-AC_CHECK_FUNCS(setreuid)
-AC_CHECK_FUNCS(setrgid)
-AC_CHECK_FUNCS(setrlimit)
-AC_CHECK_FUNCS(setruid)
-AC_CHECK_FUNCS(setsid)
-AC_CHECK_FUNCS(setuid)
-AC_CHECK_FUNCS(shutdown)
-AC_CHECK_FUNCS(sigaction)
-AC_CHECK_FUNCS(sigaltstack)
-AC_CHECK_FUNCS(sigprocmask)
-AC_CHECK_FUNCS(sinh)
-AC_CHECK_FUNCS(spawnv)
-AC_CHECK_FUNCS(symlink)
-AC_CHECK_FUNCS(syscall)
-AC_CHECK_FUNCS(sysconf)
-AC_CHECK_FUNCS(tanh)
-AC_CHECK_FUNCS(telldir)
-AC_CHECK_FUNCS(timegm)
-AC_CHECK_FUNCS(times)
-AC_CHECK_FUNCS(truncate)
-AC_CHECK_FUNCS(truncate64) # used for Win32
-AC_CHECK_FUNCS(unsetenv)
-AC_CHECK_FUNCS(utimensat)
-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)])
-])
-
-AS_IF([test "$ac_cv_func_crypt_r" = yes],
- [AC_CHECK_HEADERS(crypt.h)])
-AS_IF([test "$ac_cv_func_crypt_r:$ac_cv_header_crypt_h" = yes:yes],
- [AC_CHECK_MEMBERS([struct crypt_data.initialized], [], [],
- [AC_INCLUDES_DEFAULT([@%:@include <crypt.h>])])])
-
-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([int foo;], [$2;])],
- [AS_TR_SH(rb_cv_builtin_$1)=yes],
- [AS_TR_SH(rb_cv_builtin_$1)=no])])
-AS_IF([test "${AS_TR_SH(rb_cv_builtin_$1)}" != no], [
- AC_DEFINE(AS_TR_CPP(HAVE_BUILTIN_$1))
-])])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap16, [__builtin_bswap16(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap32, [__builtin_bswap32(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_popcount, [__builtin_popcount(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_popcountll, [__builtin_popcountll(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_ctz, [__builtin_ctz(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_ctzll, [__builtin_ctzll(0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_add_overflow, [int x;__builtin_add_overflow(0,0,&x)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_sub_overflow, [int x;__builtin_sub_overflow(0,0,&x)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_mul_overflow, [int x;__builtin_mul_overflow(0,0,&x)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_mul_overflow_p, [__builtin_mul_overflow_p(0,0,(int)0)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_constant_p, [__builtin_constant_p(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))]];
- ])
-AS_IF([test x$rb_cv_builtin___builtin_choose_expr = xyes], [
- 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))]];
- ])
-])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)])
-
-AS_IF([test "$ac_cv_func_qsort_r" != no], [
- 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)
- ])
-])
-
-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)])
-
-# Some platform need -lrt for clock_gettime, but the other don't.
-AS_IF([test x"$ac_cv_func_clock_gettime" != xyes], [
- # glibc 2.17 moves clock_* functions from librt to the main C library.
- # http://sourceware.org/ml/libc-announce/2012/msg00001.html
- AC_CHECK_LIB(rt, clock_gettime)
- AS_IF([test x"$ac_cv_lib_rt_clock_gettime" = xyes], [
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
- ])
-])
-AC_CHECK_FUNCS(clock_getres) # clock_getres should be tested after clock_gettime test including librt test.
-
-AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
- [AC_TRY_COMPILE([
-#include <stdlib.h>
-], [int v = unsetenv("foo");],
- rb_cv_unsetenv_return_value=yes,
- rb_cv_unsetenv_return_value=no)])
-AS_IF([test "$rb_cv_unsetenv_return_value" = no], [
- AC_DEFINE(VOID_UNSETENV)
-])
-
-# used for AC_ARG_WITH(setjmp-type)
-AC_DEFUN([RUBY_CHECK_SETJMP], [
-AC_CACHE_CHECK([for ]$1[ as a macro or function], ac_cv_func_$1,
- [AC_TRY_COMPILE([
-@%:@include <setjmp.h>
-]AC_INCLUDES_DEFAULT([$3])[
-@%:@define JMPARGS_1 env
-@%:@define JMPARGS_2 env,1
-@%:@define JMPARGS JMPARGS_]m4_ifval($2,2,1)[
-],
- m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);],
- ac_cv_func_$1=yes,
- ac_cv_func_$1=no)]
-)
-AS_IF([test "$ac_cv_func_]$1[" = yes], [AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)])
-])
-
-AC_DEFUN([RUBY_CHECK_BUILTIN_SETJMP], [
-AS_IF([test x"${ac_cv_func___builtin_setjmp}" = xyes], [
- unset ac_cv_func___builtin_setjmp
-])
-AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
- [
- 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;
- @%:@ifdef NORETURN
- NORETURN(void t(void));
- @%:@endif
- 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])
-])
-
-AC_DEFUN([RUBY_SETJMP_TYPE], [
-RUBY_CHECK_BUILTIN_SETJMP
-RUBY_CHECK_SETJMP(_setjmpex, [], [@%:@include <setjmpex.h>])
-RUBY_CHECK_SETJMP(_setjmp)
-RUBY_CHECK_SETJMP(sigsetjmp, [sigjmp_buf])
-AC_MSG_CHECKING(for setjmp type)
-setjmp_suffix=
-unset setjmp_sigmask
-AC_ARG_WITH(setjmp-type,
- AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
- [
- AS_CASE([$withval],
- [__builtin_setjmp], [setjmp=__builtin_setjmp],
- [_setjmp], [ setjmp_prefix=_],
- [sigsetjmp,*], [ setjmp_prefix=sig setjmp_sigmask=`expr "$withval" : 'sigsetjmp\(,.*\)'`],
- [sigsetjmp], [ setjmp_prefix=sig],
- [setjmp], [ setjmp_prefix=],
- [setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
- [''], [ unset setjmp_prefix],
- [ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
-setjmp_cast=
-AS_IF([test ${setjmp_prefix+set}], [
- AS_IF([test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no], [
- AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
- ])
-], [{ AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]) }], [
- setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
- setjmp_prefix=__builtin_
- setjmp_suffix=
-], [test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes], [
- setjmp_prefix=
- setjmp_suffix=ex
-], [test "$ac_cv_func__setjmp" = yes], [
- setjmp_prefix=_
- setjmp_suffix=
-], [test "$ac_cv_func_sigsetjmp" = yes], [
- AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
- setjmp_suffix=
-], [
- setjmp_prefix=
- setjmp_suffix=
-])
-AS_IF([test x$setjmp_prefix:$setjmp_sigmask = xsig:], [
- setjmp_sigmask=,0
-])
-AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+\($setjmp_cast\)}${setjmp_sigmask})
-AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask})])
-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)
-AS_IF([test x$setjmp_suffix = xex], [AC_DEFINE_UNQUOTED(RUBY_USE_SETJMPEX, 1)])
-])
-# End of setjmp check.
-
-AC_ARG_ENABLE(setreuid,
- AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
- [use_setreuid=$enableval])
-AS_IF([test "$use_setreuid" = yes], [
- AC_DEFINE(USE_SETREUID)
- AC_DEFINE(USE_SETREGID)
-])
-AC_STRUCT_TIMEZONE
-AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
- [AC_TRY_COMPILE([
-@%:@define _BSD_SOURCE
-@%:@define _DEFAULT_SOURCE
-@%:@include <time.h>
- ],
- [struct tm t; t.tm_gmtoff = 3600;],
- [rb_cv_member_struct_tm_tm_gmtoff=yes],
- [rb_cv_member_struct_tm_tm_gmtoff=no])])
-AS_IF([test "$rb_cv_member_struct_tm_tm_gmtoff" = yes], [
- AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
-])
-AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
- [AC_TRY_LINK([#include <time.h>
- int i;],
- [i = daylight;],
- rb_cv_have_daylight=yes,
- rb_cv_have_daylight=no)])
-AS_IF([test "$rb_cv_have_daylight" = yes], [
- AC_DEFINE(HAVE_DAYLIGHT)
-])
-
-AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
- [AC_TRY_RUN([
-#include <stdlib.h>
-#include <time.h>
-
-void
-check(tm, y, m, d, h, s)
- struct tm *tm;
- int y, m, d, h, s;
-{
- if (!tm ||
- tm->tm_year != y ||
- tm->tm_mon != m-1 ||
- tm->tm_mday != d ||
- tm->tm_hour != h ||
- tm->tm_sec != s) {
- exit(1);
- }
-}
-
-int
-main()
-{
- time_t t = -1;
- struct tm *tm;
-
- check(gmtime(&t), 69, 12, 31, 23, 59);
- t = ~(time_t)0 << 31;
- check(gmtime(&t), 1, 12, 13, 20, 52);
- return 0;
-}
-],
- rb_cv_negative_time_t=yes,
- rb_cv_negative_time_t=no,
- rb_cv_negative_time_t=yes)])
-AS_IF([test "$rb_cv_negative_time_t" = yes], [
- AC_DEFINE(NEGATIVE_TIME_T)
-])
-
-# [ruby-dev:40910] overflow of time on FreeBSD
-# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
-AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
- [AC_TRY_RUN([
-#include <stdlib.h>
-#include <time.h>
-
-void
-check(time_t t1)
-{
- struct tm *tm;
- time_t t2;
- tm = localtime(&t1);
- if (!tm)
- return; /* overflow detected. ok. */
- t2 = mktime(tm);
- if (t1 == t2)
- return; /* round-trip. ok. */
- exit(1);
-}
-
-int
-main()
-{
- time_t t;
- if (~(time_t)0 <= 0) {
- t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
- t |= t - 1;
- }
- else {
- t = ~(time_t)0;
- }
- check(t);
- return 0;
-}
-],
- rb_cv_localtime_overflow=yes,
- rb_cv_localtime_overflow=no,
- rb_cv_localtime_overflow=no)])
-AS_IF([test "$rb_cv_localtime_overflow" = no], [
- AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
-])
-
-AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes], [
- AC_DEFINE(POSIX_SIGNAL)
-], [
- AC_CHECK_FUNCS(sigsetmask)
- AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
- [AC_TRY_RUN([
-#include <stdio.h>
-#include <signal.h>
-
-void
-sig_handler(dummy)
- int dummy;
-{
-}
-
-int
-main()
-{
- signal(SIGINT, sig_handler);
- kill(getpid(), SIGINT);
- kill(getpid(), SIGINT);
- return 0;
-}
-],
- rb_cv_bsd_signal=yes,
- rb_cv_bsd_signal=no,
- rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
- AS_IF([test "$rb_cv_bsd_signal" = yes], [
- AC_DEFINE(BSD_SIGNAL)
- ])
-])
-
-AC_CHECK_TYPES([sig_t],[],[],[@%:@include <signal.h>])
-
-AS_IF([test "$ac_cv_func_getpgid" = no], [
- # AC_FUNC_GETPGRP fails when cross-compiling with old autoconf.
- # autoconf is changed between 2.52d and 2.52f?
- # http://lists.gnu.org/archive/html/bug-gnu-utils/2001-09/msg00181.html
- # "autoconf cleanup for AC_FUNC_GETPGRP and GETPGRP_VOID"
-AC_FUNC_GETPGRP
-])
-AS_IF([test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes], [
- # AC_FUNC_SETPGRP fails when cross-compiling. (until autoconf 2.69?)
- # https://lists.gnu.org/archive/html/bug-autoconf/2013-02/msg00002.html
- # "AC_FUNC_SETPGRP fails to work properly when cross-compiling"
-AC_FUNC_SETPGRP
-])
-
-AS_IF([test x"$ac_cv_func_dirfd" = xno], [
- AS_CASE(["$target_os"],[solaris*],
- [AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[
-#include <sys/types.h>
-#include <dirent.h>
-])])
-])
-
-AS_IF([test x"$target_cpu" = xia64], [
- AC_LIBOBJ([ia64])
- AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
- rb_cv___libc_ia64_register_backing_store_base,
- [rb_cv___libc_ia64_register_backing_store_base=no
- AC_TRY_LINK(
- [extern unsigned long __libc_ia64_register_backing_store_base;],
- [unsigned long p = __libc_ia64_register_backing_store_base;
- printf("%ld\n", p);],
- [rb_cv___libc_ia64_register_backing_store_base=yes])])
- AS_IF([test $rb_cv___libc_ia64_register_backing_store_base = yes], [
- AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
- ])
-])
-
-AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
- [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
- rb_cv_rshift_sign=yes,
- rb_cv_rshift_sign=no)])
-AS_IF([test "$rb_cv_rshift_sign" = yes], [
- AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
-], [
- AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
-])
-
-AS_IF([test x"$ac_cv_func_gettimeofday" != xyes], [
- AC_MSG_ERROR(gettimeofday() must exist)
-])
-
-AS_IF([test "$ac_cv_func_sysconf" = yes], [
- AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
- AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
- [AC_TRY_COMPILE([#include <unistd.h>
- ],
- [_SC_$1 >= 0],
- rb_cv_have_sc_[]m4_tolower($1)=yes,
- rb_cv_have_sc_[]m4_tolower($1)=no)
- ])
- AS_IF([test "$rb_cv_have_sc_[]m4_tolower($1)" = yes], [
- AC_DEFINE(HAVE__SC_$1)
- ])
- ])
- RUBY_CHECK_SYSCONF(CLK_TCK)
-])
-
-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"],
-[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
-[hppa*], [ $2=+1],
-[
- AC_TRY_RUN([
-/* recurse to get rid of inlining */
-static int
-stack_growup_p(addr, n)
- volatile int *addr, n;
-{
- volatile int end;
- if (n > 0)
- return *addr = stack_growup_p(addr, n - 1);
- else
- return (&end > addr);
-}
-int main()
-{
- int x;
- return stack_growup_p(&x, 10);
-}
-], $2=-1, $2=+1, $2=0)
- ])
-eval stack_grow_dir=\$$2])
-eval $2=\$stack_grow_dir
-AS_VAR_POPDEF([stack_grow_dir])])
-AS_IF([test "${universal_binary-no}" = yes ], [
- archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
- save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
- save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
- stack_dir=
- for archs in ${universal_archnames}; do
- archs=`echo $archs | sed 's/=.*//'`
- CFLAGS="$new_cflags -arch $archs"
- LDFLAGS="$new_ldflags -arch $archs"
- RUBY_STACK_GROW_DIRECTION($archs, dir)
- AS_IF([test x$stack_dir = x], [
- stack_dir=$dir
- ], [test x$stack_dir != x$dir], [
- stack_dir=no
- ])
- done
- CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
- AS_IF([test x$stack_dir = xno], [
- for archs in ${universal_archnames}; do
- archs=`echo $archs | sed 's/=.*//'`
- eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
- RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
- done
- ], [
- AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
- ])
-], [
- RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
- AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
-])
-
-AS_IF([test x"$enable_pthread" = xyes], [
- for pthread_lib in thr pthread pthreads c c_r root; do
- AC_CHECK_LIB($pthread_lib, pthread_kill,
- rb_with_pthread=yes, rb_with_pthread=no)
- AS_IF([test "$rb_with_pthread" = "yes"], [ break; fi
- done
- AS_IF([test x"$rb_with_pthread" = xyes], [
- AC_DEFINE(_REENTRANT)
- AC_DEFINE(_THREAD_SAFE)
- AC_DEFINE(HAVE_LIBPTHREAD)
- AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
- AS_CASE([$pthread_lib],
- [c], [],
- [root], [],
- [c_r], [MAINLIBS="-pthread $MAINLIBS"],
- [AS_CASE(["$target_os"],
- [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
- [LIBS="-l$pthread_lib $LIBS"])])
- ], [
- AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
- ])
- 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])
- ])
- AS_IF([test x"$rb_cv_scalar_pthread_t" = xyes], [
- : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>])
- ], [
- AC_DEFINE(NON_SCALAR_THREAD_ID)
- ])
- AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
- pthread_attr_get_np pthread_attr_getstack pthread_attr_init \
- 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_setname_np pthread_set_name_np)
- AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
- set_current_thread_name=
- AS_IF([test "$ac_cv_func_pthread_setname_np" = yes], [
- 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
- ]
- )
- AS_IF([test -n "${rb_cv_func_pthread_setname_np_arguments}"], [
- set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setname_np_arguments}"
- ])
- ], [test "$ac_cv_func_pthread_set_name_np" = yes], [
- set_current_thread_name="pthread_set_name_np(pthread_self(), name)"
- ])
- 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)
- ])
- ])
-])
-
-AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [
- 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])])
- AS_IF([test x"$rb_cv_ucontext_in_signal_h" = xyes], [
- AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1)
- ])
-])
-AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes], [
- 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])])
- AS_IF([test x"$rb_cv_mcontext_t_ptr" = xyes], [
- AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
- ], [
- AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext)
- ])
- AS_IF([test x"$rb_with_pthread" = xyes], [
- AC_CHECK_FUNCS(getcontext setcontext)
- ])
-])
-
-AS_IF([test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"], [
- AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
- [AC_TRY_RUN([
-#include <stdlib.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
-
-void *
-thread_func(void *dmy)
-{
- return dmy;
-}
-
-int
-use_threads(void)
-{
- pthread_t tid;
- if (pthread_create(&tid, 0, thread_func, 0) != 0) {
- return -1;
- }
- if (pthread_join(tid, 0) != 0) {
- return -1;
- }
- return 0;
-}
-
-int
-main(int argc, char *argv[])
-{
- pid_t pid;
- if (use_threads()) return EXIT_FAILURE;
- pid = fork();
-
- if (pid) {
- int loc;
- sleep(1);
- if (waitpid(pid, &loc, WNOHANG) == 0) {
- kill(pid, SIGKILL);
- return EXIT_FAILURE;
- }
- if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
- return EXIT_FAILURE;
- }
- else {
- if (use_threads()) return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}],
- rb_cv_fork_with_pthread=yes,
- rb_cv_fork_with_pthread=no,
- rb_cv_fork_with_pthread=yes)])
- test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
-])
-
-
-}
-{ # runtime section
-
-dnl wheather use dln_a_out or not
-AC_ARG_WITH(dln-a-out,
- AS_HELP_STRING([--with-dln-a-out], [use dln_a_out if possible]),
- [
- AS_CASE([$withval],
- [yes], [
- AS_IF([test "$enable_shared" = yes], [
- AC_MSG_ERROR(dln_a_out can not make shared library)
- ])
- with_dln_a_out=yes],
- [
- with_dln_a_out=no])], [with_dln_a_out=no])
-
-AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
-[AC_TRY_LINK([],[], [
-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)])
-
-AS_IF([test "$rb_cv_binary_elf" = yes], [
- AC_DEFINE(USE_ELF)
- AS_IF([test "$with_dln_a_out" = yes], [
- AC_MSG_ERROR(dln_a_out does not work with ELF)
- ])
- AC_CHECK_HEADERS([elf.h elf_abi.h])
- AS_IF([test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes], [
- AC_LIBOBJ([addr2line])
- ])
-])
-
-AS_CASE(["$target_os"],
-[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu], [
- AS_IF([test "$rb_cv_binary_elf" = no], [
- with_dln_a_out=yes
- ], [
- LDFLAGS="$LDFLAGS -rdynamic"
- ])])
-LIBEXT=a
-
-AC_SUBST(DLDFLAGS)dnl
-AC_SUBST(ARCH_FLAG)dnl
-
-AC_SUBST(STATIC)dnl
-AC_SUBST(CCDLFLAGS)dnl
-AC_SUBST(LDSHARED)dnl
-AC_SUBST(LDSHAREDXX)dnl
-AC_SUBST(DLEXT)dnl
-AC_SUBST(DLEXT2)dnl
-AC_SUBST(LIBEXT)dnl
-AC_SUBST(ASMEXT, S)dnl
-
-STATIC=
-
-AS_IF([test "$with_dln_a_out" != yes], [
- rb_cv_dlopen=unknown
- AC_MSG_CHECKING(whether OS depend dynamic link works)
- AS_IF([test "$GCC" = yes], [
- AS_CASE(["$target_os"],
- [darwin*], [
- # The -fno-common is needed if we wish to embed the Ruby interpreter
- # into a plugin module of some project (as opposed to embedding it
- # within the project's application). The -I/usr/local/include is
- # needed because CPP as discovered by configure (cc -E -traditional)
- # fails to consult /usr/local/include by default. This causes
- # 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*|cygwin*|mingw*|aix*|interix*], [ ],
- [
- RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
- ], [
- AS_CASE(["$target_os"],
- [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"],
- [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
- [sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
- [esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
- [: ${CCDLFLAGS=""}])
- ])
-
-
- AC_ARG_ENABLE(rpath,
- 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"])
-
- AS_CASE(["$target_os"],
- [hpux*], [ DLDFLAGS="$DLDFLAGS -E"
- : ${LDSHARED='$(LD) -b'}
- XLDFLAGS="$XLDFLAGS -Wl,-E"
- : ${LIBPATHENV=SHLIB_PATH}
- rb_cv_dlopen=yes],
- [solaris*], [ AS_IF([test "$GCC" = yes], [
- : ${LDSHARED='$(CC) -shared'}
- AS_IF([test "$rb_cv_prog_gnu_ld" = yes], [
- LDFLAGS="$LDFLAGS -Wl,-E"
- ])
- ], [
- : ${LDSHARED='$(CC) -G'}
- ])
- AS_IF([test "$ac_cv_sizeof_voidp" = 8], [
- : ${LIBPATHENV=LD_LIBRARY_PATH_64}
- : ${PRELOADENV=LD_PRELOAD_64}
- ], [
- : ${LIBPATHENV=LD_LIBRARY_PATH_32}
- : ${PRELOADENV=LD_PRELOAD_32}
- ])
- rb_cv_dlopen=yes],
- [sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
- rb_cv_dlopen=yes],
- [irix*], [ : ${LDSHARED='$(LD) -shared'}
- rb_cv_dlopen=yes],
- [sysv4*], [ : ${LDSHARED='$(LD) -G'}
- rb_cv_dlopen=yes],
- [nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
- rb_cv_dlopen=yes],
- [esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
- rb_cv_dlopen=yes],
- [osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
- rb_cv_dlopen=yes],
- [bsdi3*], [ AS_CASE(["$CC"],
- [*shlicc*], [ : ${LDSHARED='$(CC) -r'}
- rb_cv_dlopen=yes])],
- [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [
- : ${LDSHARED='$(CC) -shared'}
- AS_IF([test "$rb_cv_binary_elf" = yes], [
- LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
- ])
- rb_cv_dlopen=yes],
- [interix*], [ : ${LDSHARED='$(CC) -shared'}
- XLDFLAGS="$XLDFLAGS -Wl,-E"
- LIBPATHFLAG=" -L%1\$-s"
- rb_cv_dlopen=yes],
- [freebsd*|dragonfly*], [
- : ${LDSHARED='$(CC) -shared'}
- AS_IF([test "$rb_cv_binary_elf" = yes], [
- LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
- ], [
- test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
- ])
- rb_cv_dlopen=yes],
- [openbsd*|mirbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
- AS_IF([test "$rb_cv_binary_elf" = yes], [
- LDFLAGS="$LDFLAGS -Wl,-E"
- ])
- rb_cv_dlopen=yes],
- [darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
- : ${LDFLAGS=""}
- : ${LIBPATHENV=DYLD_LIBRARY_PATH}
- : ${PRELOADENV=DYLD_INSERT_LIBRARIES}
- rb_cv_dlopen=yes],
- [aix*], [ : ${LDSHARED='$(CC)'}
- LDSHARED="$LDSHARED ${linker_flag}-G"
- EXTDLDFLAGS='-e$(TARGET_ENTRY)'
- XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
- XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
- : ${ARCHFILE="ruby.imp"}
- TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
- TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=LIBPATH}
- 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"
- rb_cv_dlopen=yes],
- [cygwin*|mingw*], [
- : ${LDSHARED='$(CC) -shared'}
- XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
- DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
- : ${LIBPATHENV=PATH}
- : ${PRELOADENV=""}
- rb_cv_dlopen=yes],
- [hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
- [atheos*], [ : ${LDSHARED='$(CC) -shared'}
- rb_cv_dlopen=yes],
- [ : ${LDSHARED='$(LD)'}])
- AC_MSG_RESULT($rb_cv_dlopen)
-
- AS_IF([test "$rb_cv_dlopen" = yes], [
- 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=])
- AS_IF([test "x$flag" != x], [
- RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
- ])
- done
- ])
- ])
-
- AS_IF([test "$enable_rpath:${RPATHFLAG}" = yes:], [
- AS_IF([test "x$rpathflag" != x], [
- RPATHFLAG=" ${rpathflag}%1\$-s"
- ])
- ])
-])
-AS_IF([test "${LDSHAREDXX}" = ""], [
- AS_CASE(["${LDSHARED}"],
- [*'$(CC)'*], [
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
- ],
- [*'${CC}'*], [
- LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
- ],
- [*$CC*], [
- LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
- ],
- [ld" "*], [
- ])
-])
-AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
-
-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)
-
-AS_IF([test "x$OPT_DIR" != x], [
- 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/ *$//'`
- AS_IF([test x"$val" != x], [
- test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
- LDFLAGS="$LDFLAGS$val"
- test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
- DLDFLAGS="$DLDFLAGS$val"
- ])
- LDFLAGS_OPTDIR="$val"
-])
-
-AS_CASE(["$target_os"],
-[freebsd*], [
- AC_CHECK_LIB([procstat], [procstat_open_sysctl])
- AS_IF([test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes], [
- AC_CHECK_FUNCS(procstat_getvmmap)
- ])
- ])
-AS_CASE(["$target_cpu-$target_os"],
-[*-darwin*], [
- AC_CHECK_HEADERS([execinfo.h])
- AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
- AC_CHECK_LIB([execinfo], [backtrace])
- AC_CHECK_HEADERS([libunwind.h])
- ])],
-[*-freebsd*|x86_64-netbsd*], [
- AC_CHECK_HEADERS([execinfo.h])
- AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
- AC_CHECK_LIB([execinfo], [backtrace])
- AC_CHECK_LIB([unwind], [unw_backtrace])
- ])])
-AC_CHECK_FUNCS(backtrace)
-
-AS_IF([test "x$ac_cv_func_backtrace" = xyes], [
- AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace,
- [AC_TRY_RUN([
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <signal.h>
-#include <execinfo.h>
-
-#define TRACE_SIZE 256
-
-void sigsegv(int signum, siginfo_t *info, void *ctx){
- void *trace[TRACE_SIZE];
- int n = backtrace(trace, TRACE_SIZE);
- if (n > 0) {
- /*fprintf(stdout, "backtrace:%d\n",n);*/
- } else {
- _exit(EXIT_FAILURE);
- }
- _exit(EXIT_SUCCESS);
-}
-int
-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");
- return EXIT_FAILURE;
- }
- ss.ss_size = SIGSTKSZ;
- ss.ss_flags = 0;
- if (sigaltstack(&ss, NULL) == -1) {
- fprintf(stderr, "sigaltstack failed\n");
- return EXIT_FAILURE;
- }
- struct sigaction sa;
- memset(&sa, 0, sizeof(struct sigaction));
- sigemptyset(&sa.sa_mask);
- sa.sa_sigaction = sigsegv;
- sa.sa_flags |= SA_SIGINFO;
- sa.sa_flags |= SA_ONSTACK;
- sigaction(SIGSEGV, &sa, NULL);
- a[0] = 1;
- return EXIT_SUCCESS;
-}
-],
- rb_cv_broken_backtrace=no,
- rb_cv_broken_backtrace=yes,
- rb_cv_broken_backtrace=no)])
- AS_IF([test "$rb_cv_broken_backtrace" = yes], [
- AC_DEFINE(BROKEN_BACKTRACE, 1)
- ])
-])
-
-AC_ARG_WITH(valgrind,
- AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
- [], with_valgrind=yes)
-AS_IF([test x$with_valgrind != xno],
- [AC_CHECK_HEADERS(valgrind/memcheck.h)])
-
-dln_a_out_works=no
-AS_IF([test "$ac_cv_header_a_out_h" = yes], [
- AS_IF([test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown], [
- cat confdefs.h > config.h
- AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
- [AC_TRY_COMPILE([
-#define USE_DLN_A_OUT
-#include "dln.c"
-],
- [],
- rb_cv_dln_a_out=yes,
- rb_cv_dln_a_out=no)])
- AS_IF([test "$rb_cv_dln_a_out" = yes], [
- dln_a_out_works=yes
- AC_DEFINE(USE_DLN_A_OUT)
- ])
- ])
-])
-
-AS_IF([test "$dln_a_out_works" = yes], [
- AS_IF([test "$GCC" = yes], [
- STATIC=-static
- ], [
- STATIC=-Bstatic
- ])
- DLEXT=so
- CCDLFLAGS=
-], [
- AS_CASE(["$target_os"],
- [hpux*], [
- DLEXT=sl],
- [darwin*], [
- SOEXT=dylib
- DLEXT=bundle],
- [cygwin*|mingw*|*djgpp*], [
- LOAD_RELATIVE=1
- SOEXT=dll
- DLEXT=so],
- [
- DLEXT=so])
-])
-: ${SOEXT="${DLEXT}"}
-AC_SUBST(SOEXT)
-AS_IF([test "$rb_cv_dlopen:$load_relative" = yes:yes], [
- AS_IF([test "$ac_cv_func_dladdr" = yes], [
- LOAD_RELATIVE=1
- ])
-])
-AS_IF([test x"$LOAD_RELATIVE" = x1], [
- load_relative=yes
-], [
- unset load_relative
-])
-
-len=2 # .rb
-n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
-n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
-AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
-test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
-test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
-AC_SUBST(DLEXT)
-
-AS_IF([test "$with_dln_a_out" = yes], [
- STRIP=true
-], [
- AC_CHECK_TOOL(STRIP, strip, :)dnl
-])
-
-AS_CASE(["$target_os"],
- [linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
- STRIP="$STRIP -S -x"],
- [darwin*], [
- STRIP="$STRIP -A -n"])
-
-AC_ARG_WITH(ext,
- AC_HELP_STRING([--with-ext=EXTS],
- [pass to --with-ext option of extmk.rb]))
-AC_ARG_WITH(out-ext,
- AC_HELP_STRING([--with-out-ext=EXTS],
- [pass to --without-ext option of extmk.rb]))
-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],[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)
- AC_SUBST(ENCSTATIC, static)
-], [
- ENCOBJS='dmyenc.$(OBJEXT)'
- EXTOBJS='dmyext.$(OBJEXT)'
-])
-AC_SUBST(ENCOBJS)
-AC_SUBST(EXTOBJS)
-
-AC_ARG_WITH(setup,
- AS_HELP_STRING([--with-setup=SETUP], [use extension libraries setup]),
- [setup=$withval])
-AS_IF([test -n "$setup"], [
- AS_IF([! test -f "ext/$setup" -o -f "$srcdir/ext/$setup"], [
- AC_MSG_ERROR(Setup file $setup not found under ext or $srcdir/ext)
- ])
-], [test -f "$srcdir/ext/Setup.$target_os"], [
- setup="Setup.$target_os"
-], [
- setup=
- for file in "$srcdir"/ext/Setup.*; do
- AS_CASE(["$file"], [*~|*.bak|*.orig|*.rej|*.tmp], [continue])
- setup=`basename "$file"`
- AS_CASE(["$target_os"], [`expr "$setup" : 'Setup.\(.*\)'`*], [break])
- platform=`sed '/^option *platform */!d;s///;s/|/*|/g;q' "$file"`
- AS_IF([test "x$platform" != x], [
- eval "AS_CASE([\"\$target_os\"], [$platform*], [break])"
- ])
- setup=
- done
- : ${setup:=Setup}
-])
-AC_SUBST(setup)
-
-rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
-AC_ARG_WITH(rubylibprefix,
- AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
- [AS_IF([test "x$withval" = xno], [
- AC_MSG_ERROR([No ruby, No libprefix])
- ])
- rubylibprefix="$withval"])
-AC_SUBST(rubylibprefix)
-
-AS_IF([test x"${exec_prefix}" != xNONE], [
- RUBY_EXEC_PREFIX="$exec_prefix"
-], [test x"$prefix" != xNONE], [
- RUBY_EXEC_PREFIX="$prefix"
-], [
- RUBY_EXEC_PREFIX=$ac_default_prefix
-])
-pat=`echo "${RUBY_EXEC_PREFIX}" | tr -c '\012' .`'\(.*\)'
-for var in bindir libdir rubylibprefix; do
- eval val='"$'$var'"'
- AS_CASE(["$val"], ["${RUBY_EXEC_PREFIX}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
- eval $var='"$val"'
-done
-
-BTESTRUBY='$(MINIRUBY)'
-AS_IF([test x"$cross_compiling" = xyes], [
- test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
- XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
- XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
- XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
- AC_SUBST(XRUBY_LIBDIR)
- AC_SUBST(XRUBY_RUBYLIBDIR)
- AC_SUBST(XRUBY_RUBYHDRDIR)
- PREP='$(arch)-fake.rb'
- RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
- RUNRUBY='$(RUNRUBY_COMMAND)'
- XRUBY='$(MINIRUBY)'
- BOOTSTRAPRUBY='$(BASERUBY)'
- TEST_RUNNABLE=no
- CROSS_COMPILING=yes
-], [
- MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
- MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
- PREP='miniruby$(EXEEXT)'
- RUNRUBY_COMMAND='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
- RUNRUBY='$(RUNRUBY_COMMAND) --'
- XRUBY='$(RUNRUBY)'
- BOOTSTRAPRUBY='$(MINIRUBY)'
- TEST_RUNNABLE=yes
- CROSS_COMPILING=no
-])
-AC_SUBST(TEST_RUNNABLE)
-AC_SUBST(CROSS_COMPILING)
-AC_SUBST(MINIRUBY)
-AC_SUBST(BTESTRUBY)
-AC_SUBST(PREP)
-AC_SUBST(RUNRUBY_COMMAND)
-AC_SUBST(RUNRUBY)
-AC_SUBST(XRUBY)
-AC_SUBST(BOOTSTRAPRUBY)
-AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
-
-])RSTMAKEFILE=""
-LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
-LIBRUBY='$(LIBRUBY_A)'
-LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
-LIBRUBYARG='$(LIBRUBYARG_STATIC)'
-SOLIBS=
-
-AS_CASE(["$target_os"],
- [cygwin*|mingw*|haiku*|darwin*], [
- : ${DLDLIBS=""}
- ],
- [
- DLDLIBS="$DLDLIBS -lc"
- ])
-
-AC_ARG_ENABLE(multiarch,
- AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
- [multiarch=], [unset multiarch])
-AS_IF([test ${multiarch+set}], [
- AC_DEFINE(ENABLE_MULTIARCH)
-])
-
-archlibdir='${libdir}/${arch}'
-sitearchlibdir='${libdir}/${sitearch}'
-archincludedir='${includedir}/${arch}'
-sitearchincludedir='${includedir}/${sitearch}'
-
-AC_ARG_WITH(soname,
- AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
- [RUBY_SO_NAME=$withval],
- [
- AS_CASE(["$target_os"],
- [darwin*], [
- RUBY_SO_NAME='$(RUBY_BASE_NAME).$(RUBY_PROGRAM_VERSION)'
- ],
- [cygwin*], [
- RUBY_SO_NAME='$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
- ],
- [mingw*], [
- RUBY_SO_NAME="${rb_cv_msvcrt}"'-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
- AS_IF([test x"${target_cpu}" != xi386], [
- RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
- ])
- ],
- [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
- ])
-
-LIBRUBY_LDSHARED=$LDSHARED
-LIBRUBY_DLDFLAGS=$DLDFLAGS
-LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_PROGRAM_VERSION)'
-LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_API_VERSION)'
-LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(SOEXT)'
-ENABLE_SHARED=no
-
-AC_ARG_ENABLE(shared,
- AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
- [enable_shared=$enableval])
-libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
-LIBRUBY_RELATIVE=${load_relative-no}
-AS_CASE("$enable_shared", [yes], [
- LIBRUBY='$(LIBRUBY_SO)'
- LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
- LIBRUBYARG='$(LIBRUBYARG_SHARED)'
- LIBRUBY_RELATIVE=no
- test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
- ENABLE_SHARED=yes
- AS_IF([test "$rb_cv_binary_elf" = yes], [
- SOLIBS='$(LIBS)'
- ])
-
- # libdir can be overridden in config.site file (on OpenSUSE at least).
- libdir_basename=lib
- AS_IF([test "$bindir" = '${exec_prefix}/bin'], [
- AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
- ])
- AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
- libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}
-
- AS_CASE(["$target_os"],
- [freebsd*|dragonfly*], [],
- [
- AS_IF([test "$GCC" = yes], [
- RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
- AS_IF([test "no_undefined" = yes], [
- RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
- ])
- ])
- ])
-
- AS_CASE(["$target_os"],
- [sunos4*], [
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
- ],
- [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu | haiku*], [
- RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,$(LIBRUBY_SONAME)' "$LDFLAGS_OPTDIR"])
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
- AS_IF([test "$load_relative" = yes], [
- libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
- LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
- LIBRUBY_RELATIVE=yes
- ])
- ],
- [freebsd*|dragonfly*], [
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
- LIBRUBY_SONAME='$(LIBRUBY_SO)'
- AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
- LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
- LIBRUBY_ALIASES=''
- ])
- ],
- [netbsd*], [
- SOLIBS='$(LIBS)'
- LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
- LIBRUBY_SO="${LIBRUBY_SONAME}"'.$(TEENY)'
- RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,$(LIBRUBY_SONAME)' "$LDFLAGS_OPTDIR"])
- AS_IF([test "$rb_cv_binary_elf" = yes], [ # ELF platforms
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
- ], [ # a.out platforms
- LIBRUBY_ALIASES=""
- ])
- ],
- [openbsd*|mirbsd*], [
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
- ],
- [solaris*], [
- SOLIBS='$(LIBS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)'
- LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_PROGRAM_VERSION)'
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
- AS_IF([test "$GCC" = yes], [
- LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
- ], [
- LIBRUBY_DLDFLAGS="$DLDFLAGS "'-h $(@F)'
- ])
- XLDFLAGS="$XLDFLAGS "'-R${libdir}'
- ],
- [hpux*], [
- XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
- ],
- [aix*], [
- RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-bnoentry" "$XLDFLAGS" "$LDFLAGS_OPTDIR"])
- LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
- SOLIBS='-lm -lc'
- ],
- [darwin*], [
- LIBRUBY_LDSHARED='$(CC) -dynamiclib'
- AS_IF([test "$load_relative" = yes], [
- libprefix="@executable_path/../${libdir_basename}"
- LIBRUBY_RELATIVE=yes
- ])
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS -install_name ${libprefix}"'/$(LIBRUBY_SONAME)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(RUBY_API_VERSION)'
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION)'
- AS_IF([test "$visibility_option" = ld], [
- 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_*'
- ])
- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT)'
- LIBRUBY_SONAME='lib$(RUBY_BASE_NAME).$(RUBY_API_VERSION).$(SOEXT)'
- LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_INSTALL_NAME).$(SOEXT)'
- SOLIBS='$(LIBS)'
- ],
- [interix*], [
- LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
- ],
- [mingw*|cygwin*|mswin*], [
- LIBRUBY_RELATIVE=yes
- ])
-], [
- LIBRUBYARG_SHARED=
-
- # enable PIE if possible
- AC_ARG_ENABLE(pie,
- AS_HELP_STRING([--disable-pie], [disable PIE feature]),
- [pie=$enableval], [pie=])
- AS_IF([test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno], [
- RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
- AS_IF([test "$pie" = yes], [
- # Use -fPIE when testing -pie. RUBY_TRY_LDFLAGS sets
- # $save_CFLAGS internally, so set other name here.
- save_CFLAGS_before_pie="$CFLAGS"
- CFLAGS="$CFLAGS -fPIE"
-
- # gcc need -pie but clang need -Wl,-pie.
- for pie in -pie -Wl,-pie; do
- RUBY_TRY_LDFLAGS([$pie], [], [pie=])
- AS_IF([test "x$pie" != x], [
- RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
- RUBY_APPEND_OPTION(XLDFLAGS, $pie)
- break
- ])
- done
- CFLAGS="$save_CFLAGS_before_pie"
- ])
- ])
-])
-AS_IF([test "$enable_rpath" = yes], [
- test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
- 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"
-])
-AC_SUBST(LIBRUBY_RELATIVE)
-
-LDFLAGS="-L. $LDFLAGS"
-AC_SUBST(ARCHFILE)
-
-AS_IF([test "$EXEEXT" = .exe], [
- EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
- AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
- EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
- AC_SUBST(EXECUTABLE_EXTS)
-])
-
-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"' exe/$(PROGRAM)'
- 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]),
- [enable_dtrace=$enableval], [enable_dtrace=auto])
-
-LIBRUBY_A_OBJS='$(OBJS)'
-DTRACE_REBUILD=
-AS_CASE(["${enable_dtrace}"],
-[yes|auto], [
- RUBY_DTRACE_AVAILABLE()
-], [
- rb_cv_dtrace_available=no
-])
-AS_IF([test "${enable_dtrace}" = yes], [dnl
- AS_IF([test -z "$DTRACE"], [dnl
- AC_MSG_ERROR([dtrace(1) is missing])
- ], [test "$cross_compiling" = yes], [dnl
- AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
- ], [test "${rb_cv_dtrace_available}" = "no"], [dnl
- AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
- ])
-])
-AS_CASE([$rb_cv_dtrace_available],
-[yes*], [dnl
- RUBY_DTRACE_POSTPROCESS()
- AS_IF([test "$rb_cv_prog_dtrace_g" != no], [dnl
- DTRACE_OBJ='probes.$(OBJEXT)'
- ])
- AS_IF([test "$rb_cv_prog_dtrace_g" = rebuild], [dnl
- DTRACE_REBUILD=yes
- LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
- ])
- AS_CASE("${target_os}", [freebsd*], [dnl
- # FreeBSD's dtrace requires libelf
- LIBS="-lelf $LIBS"
- ])
- DTRACE_EXT=d
-], [dnl
- enable_dtrace=no
- DTRACE_EXT=dmyh
-])
-AC_SUBST(DTRACE_EXT)
-AC_SUBST(DTRACE_OBJ)
-AC_SUBST(DTRACE_REBUILD)
-AC_SUBST(DTRACE_OPT)
-AC_SUBST(LIBRUBY_A_OBJS)
-
-AC_ARG_ENABLE(gcov,
- AS_HELP_STRING([--enable-gcov], [enable coverage measurement by gcov]),
- [gcov=yes])
-AS_IF([test x"$gcov" = xyes], [
- CFLAGS="$CFLAGS -coverage"
- LDFLAGS="$LDFLAGS -coverage"
-])
-
-RUBY_SETJMP_TYPE
-}
-{ # build section
-
-dnl build rdoc index if requested
-RDOCTARGET=""
-CAPITARGET=""
-AC_ARG_ENABLE(install-doc,
- 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=no])
-
-AS_IF([test "$install_doc" != no], [
- AS_IF([test "$install_rdoc" != no], [
- RDOCTARGET="rdoc"
- ], [
- RDOCTARGET="nodoc"
- ])
- AS_IF([test "$install_capi" != no -a -n "$DOXYGEN"], [
- CAPITARGET="capi"
- ], [
- CAPITARGET="nodoc"
- ])
-], [
- RDOCTARGET="nodoc"
- CAPITARGET="nodoc"
-])
-
-AC_SUBST(RDOCTARGET)
-AC_SUBST(CAPITARGET)
-
-AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
-AC_SUBST(INSTALLDOC)
-
-AC_ARG_ENABLE(install-static-library,
- AS_HELP_STRING([--disable-install-static-library], [do not install static ruby library]),
- [INSTALL_STATIC_LIBRARY=$enableval],
- AS_IF([test x"$enable_shared" = xyes],
- [INSTALL_STATIC_LIBRARY=no],
- [INSTALL_STATIC_LIBRARY=yes]))
-AC_SUBST(INSTALL_STATIC_LIBRARY)
-
-AS_IF([test "$rb_with_pthread" = "yes"], [
- THREAD_MODEL=pthread
-])
-AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
- AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [
- rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
- sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
- ],
- [rb_cv_symbol_prefix=''])
- test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
-])
-SYMBOL_PREFIX="$rb_cv_symbol_prefix"
-test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
-DLNOBJ=dln.o
-AC_ARG_ENABLE(dln,
- AC_HELP_STRING([--disable-dln], [disable dynamic link feature]),
- [test "$enableval" = yes || DLNOBJ=dmydln.o])
-AC_SUBST(DLNOBJ)
-MINIDLNOBJ=dmydln.o
-
-AS_CASE(["$target_os"],
- [linux*], [
- ],
- [netbsd*], [
- RUBY_APPEND_OPTION(CFLAGS, -pipe)
- ],
- [darwin*], [
- RUBY_APPEND_OPTION(CFLAGS, -pipe)
- RUBY_APPEND_OPTION(XLDFLAGS, [-framework Foundation])
- RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Foundation])
- ],
- [osf*], [
- AS_IF([test "$GCC" != "yes" ], [
- # compile something small: taint.c is fine for this.
- # the main point is the '-v' flag of 'cc'.
- AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
- [*/gemc_cc*], [ # we have the new DEC GEM CC
- CFLAGS="$CFLAGS -oldc"
- ],
- [ # we have the old MIPS CC
- ])
- # cleanup
- rm -f /tmp/main.o
- CFLAGS="$CFLAGS -std"
- ])
- ],
- [cygwin*|mingw*], [
- LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
- AS_CASE(["$target_os"],
- [cygwin*], [
- AS_IF([test x"$enable_shared" = xyes], [
- LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
- LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
- ])
- ],
- [mingw*], [
- AS_IF([test x"$enable_shared" = xyes], [
- LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
- LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
- ])
- EXPORT_PREFIX=' '
- DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
- AC_LIBOBJ([win32/win32])
- AC_LIBOBJ([win32/file])
- COMMON_LIBS=m
-# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="winsock2.h windows.h"
- THREAD_MODEL=win32
- PLATFORM_DIR=win32
- ])
- LIBRUBY_ALIASES=''
- FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
- SOLIBS='$(LIBS)'
- AS_IF([test x"$enable_shared" = xyes], [
- LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
- ], [
- LIBRUBY_SO=dummy
- LIBRUBY='lib$(RUBY_SO_NAME).a'
- LIBRUBYARG='-l$(RUBY_SO_NAME)'
- ])
- ],
- [hpux*], [
- AS_CASE(["$YACC"],[*yacc*], [
- XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
- YACC="$YACC -Nl40000 -Nm40000"
- ])
-])
-
-MINIOBJS="$MINIDLNOBJ"
-
-AS_CASE(["$THREAD_MODEL"],
-[pthread], [AC_CHECK_HEADERS(pthread.h)],
-[win32], [],
-[""], [AC_MSG_ERROR(thread model is missing)],
- [AC_MSG_ERROR(unknown thread model $THREAD_MODEL)])
-
-AC_ARG_ENABLE(debug-env,
- AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
- [AC_SUBST(ENABLE_DEBUG_ENV, yes)])
-
-AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
- AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
- mkdir conftest.dir
- echo "all:; @echo yes" > conftest.dir/GNUmakefile
- echo "all:; @echo no" > conftest.dir/Makefile
- gnumake=`(cd conftest.dir; ${MAKE-make})`
- rm -fr conftest.dir
- AS_CASE(["$gnumake"],
- [*yes*], [
- FIRSTMAKEFILE=GNUmakefile:template/GNUmakefile.in
- gnumake=yes],
- [
- gnumake=no])
- AC_MSG_RESULT($gnumake)
-])
-AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
- AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
- mkdir conftest.dir
- NULLCMD=
- for cmd in : true; do
- echo 'A=1' > conftest.dir/Makefile
- echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
- echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
- AS_IF([(cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null)], [
- NULLCMD=$cmd
- break
- ])
- done
- rm -fr conftest.dir
- AS_IF([test -z "$NULLCMD"], [
- AC_MSG_ERROR(no candidate for safe null command)
- ])
- AC_MSG_RESULT($NULLCMD)
-])
-AC_SUBST(NULLCMD)
-
-AS_IF([test "${universal_binary-no}" = yes ], [
- AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
- mv confdefs.h confdefs1.h
- : > confdefs.h
- AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} |
- sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
-@%:@else
-@%:@error
->>>>>><<<<<<
-@%:@endif], [],
-[
- rb_cv_architecture_macros=yes
- mv -f confdefs1.h confdefs.h
-], [
- rb_cv_architecture_macros=no
- archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
- new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
- for archs in ${universal_archnames}; do
- cpu=${archs@%:@*=}
- archs=${archs%=*}
- CFLAGS="$new_cflags -arch $archs"
- archs="__${archs}__"
- AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
- AC_TRY_COMPILE([@%:@ifndef ${archs}
-@%:@error
-@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
- done
- 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]))
-])
-
-CPPFLAGS="$CPPFLAGS "'$(DEFS)'
-test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
-AS_IF([test -n "${cflags+set}"], [
- cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
- CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
-])
-AS_IF([test -n "${cxxflags+set}"], [
- cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
- CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
-])
-AS_IF([test "${ARCH_FLAG}"], [
- archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
- CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
- CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
- LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
-])
-warnflags="$rb_cv_warnflags"
-AC_SUBST(cppflags)dnl
-AC_SUBST(cflags, ["${orig_cflags:+$orig_cflags }"'${optflags} ${debugflags} ${warnflags}'])dnl
-AC_SUBST(cxxflags, ["${orig_cxxflags:+$orig_cxxflags }"'${optflags} ${debugflags} ${warnflags}'])dnl
-AC_SUBST(optflags)dnl
-AC_SUBST(debugflags)dnl
-AC_SUBST(warnflags)dnl
-AC_SUBST(strict_warnflags)dnl
-AC_SUBST(XCFLAGS)dnl
-AC_SUBST(XLDFLAGS)dnl
-AC_SUBST(EXTLDFLAGS)dnl
-AC_SUBST(EXTDLDFLAGS)dnl
-AC_SUBST(LIBRUBY_LDSHARED)
-AC_SUBST(LIBRUBY_DLDFLAGS)
-AC_SUBST(RUBY_INSTALL_NAME)
-AC_SUBST(rubyw_install_name)
-AC_SUBST(RUBYW_INSTALL_NAME)
-AC_SUBST(RUBY_SO_NAME)
-AC_SUBST(LIBRUBY_A)
-AC_SUBST(LIBRUBY_SO)
-AC_SUBST(LIBRUBY_SONAME)
-AC_SUBST(LIBRUBY_ALIASES)
-AC_SUBST(LIBRUBY)
-AC_SUBST(LIBRUBYARG)
-AC_SUBST(LIBRUBYARG_STATIC)
-AC_SUBST(LIBRUBYARG_SHARED)
-AC_SUBST(SOLIBS)
-AC_SUBST(DLDLIBS)
-AC_SUBST(ENABLE_SHARED)
-AC_SUBST(MAINLIBS)
-AC_SUBST(COMMON_LIBS)
-AC_SUBST(COMMON_MACROS)
-AC_SUBST(COMMON_HEADERS)
-AC_SUBST(EXPORT_PREFIX)
-AC_SUBST(SYMBOL_PREFIX)
-AC_SUBST(MINIOBJS)
-AC_SUBST(THREAD_MODEL)
-AC_SUBST(PLATFORM_DIR)
-
-firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
-firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
-MAKEFILES="Makefile $firstmf"
-MAKEFILES="`echo $MAKEFILES`"
-AC_SUBST(MAKEFILES)
-
-ri_prefix=
-test "$program_prefix" != NONE &&
- ri_prefix=$program_prefix
-
-ri_suffix=
-test "$program_suffix" != NONE &&
- ri_suffix=$program_suffix
-
-RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
-AS_CASE(["$target_os"],
- [cygwin*|mingw*], [
- RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
- rubyw_install_name='$(RUBYW_INSTALL_NAME)'
- ])
-
-rubylibdir='${rubylibprefix}/${ruby_version}'
-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
-
-rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
-AC_ARG_WITH(rubyarchprefix,
- AS_HELP_STRING([--with-rubyarchprefix=DIR],
- [prefix for architecture dependent ruby libraries [[RUBYLIBPREFIX/ARCH]]]),
- [rubyarchprefix="$withval"])
-AC_SUBST(rubyarchprefix)
-
-rubysitearchprefix=${multiarch+'${sitearchlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${sitearch}'}
-AC_ARG_WITH(rubysitearchprefix,
- AS_HELP_STRING([--with-rubysitearchprefix=DIR],
- [prefix for architecture dependent site libraries [[RUBYLIBPREFIX/SITEARCH]]]),
- [rubysitearchprefix="$withval"])
-AC_SUBST(rubysitearchprefix)
-
-RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
-ridir='${datarootdir}/${RI_BASE_NAME}'
-AC_ARG_WITH(ridir,
- AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
- [ridir=$withval])
-AC_SUBST(ridir)
-AC_SUBST(RI_BASE_NAME)
-
-AC_ARG_WITH(ruby-version,
- AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
- [ruby_version=$withval],
- [ruby_version=full])
-unset RUBY_LIB_VERSION
-unset RUBY_LIB_VERSION_STYLE
-AS_CASE(["$ruby_version"],
- [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
- [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
-AS_IF([test ${RUBY_LIB_VERSION_STYLE+set}], [
- {
- echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
- echo '#define STRINGIZE(x) x'
- test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
- echo '#include "version.h"'
- echo 'ruby_version=RUBY_LIB_VERSION'
- } > conftest.c
- ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
- eval $ruby_version
-], [test -z "${ruby_version}"], [
- AC_MSG_ERROR([No ruby version, No place for bundled libraries])
-], [
- RUBY_LIB_VERSION="${ruby_version}"
-])
-AC_SUBST(RUBY_LIB_VERSION_STYLE)
-AC_SUBST(RUBY_LIB_VERSION)
-
-AC_ARG_WITH(sitedir,
- AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
- [sitedir=$withval],
- [sitedir='${rubylibprefix}/site_ruby'])
-sitelibdir='${sitedir}/${ruby_version}'
-
-AC_ARG_WITH(sitearchdir,
- AS_HELP_STRING([--with-sitearchdir=DIR],
- [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
- [sitearchdir=$withval],
- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
-
-AC_ARG_WITH(vendordir,
- AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
- [vendordir=$withval],
- [vendordir='${rubylibprefix}/vendor_ruby'])
-vendorlibdir='${vendordir}/${ruby_version}'
-
-AC_ARG_WITH(vendorarchdir,
- AS_HELP_STRING([--with-vendorarchdir=DIR],
- [architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
- [vendorarchdir=$withval],
- [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
-
-AS_IF([test "${LOAD_RELATIVE+set}"], [
- AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
- RUBY_EXEC_PREFIX=''
-])
-
-AC_SUBST(RUBY_EXEC_PREFIX)
-
-AC_SUBST(libdirname, ${multiarch+arch}libdir)
-AC_SUBST(archlibdir)dnl
-AC_SUBST(sitearchlibdir)dnl
-AC_SUBST(archincludedir)dnl
-AC_SUBST(sitearchincludedir)dnl
-AC_SUBST(arch)dnl
-AC_SUBST(sitearch)dnl
-AC_SUBST(ruby_version)dnl
-AC_SUBST(rubylibdir)dnl
-AC_SUBST(rubyarchdir)dnl
-AC_SUBST(sitedir)dnl
-AC_SUBST(sitelibdir)dnl
-AC_SUBST(sitearchdir)dnl
-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
-
-AS_IF([test "${universal_binary-no}" = yes ], [
- arch="universal-${target_os}"
- AS_IF([test "${rb_cv_architecture_available}" = yes], [
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
- ], [
- for archs in ${universal_archnames}; do
- cpu=`echo $archs | sed 's/.*=//'`
- archs=`echo $archs | sed 's/=.*//'`
- RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
- done
- ])
- ints='long int short'
- test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
- AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
- AC_SUBST(UNIVERSAL_INTS, "${ints}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
-], [
- arch="${target_cpu}-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
-])
-
-unset sitearch
-AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
-: ${sitearch='${arch}'}
-
-AC_ARG_WITH(search-path,
- AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
- [search_path=$withval])
-AS_IF([test "$search_path" != ""], [
- AC_SUBST(RUBY_SEARCH_PATH, $search_path)
-])
-
-AC_ARG_WITH(rubyhdrdir,
- AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
- [rubyhdrdir=$withval],
- [rubyhdrdir='${includedir}/${RUBY_VERSION_NAME}'])
-
-AC_ARG_WITH(rubyarchhdrdir,
- AS_HELP_STRING([--with-rubyarchhdrdir=DIR],
- [architecture dependent core headers in DIR [[$(rubyhdrdir)/$(arch)]]]),
- [rubyarchhdrdir=$withval],
- [rubyarchhdrdir=${multiarch+'${archincludedir}/${RUBY_VERSION_NAME}'}${multiarch-'${rubyhdrdir}/${arch}'}])
-
-AC_ARG_WITH(sitehdrdir,
- AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
- [sitehdrdir=$withval],
- [sitehdrdir='${rubyhdrdir}/site_ruby'])
-
-AC_ARG_WITH(sitearchhdrdir,
- AS_HELP_STRING([--with-sitearchhdrdir=DIR],
- [architecture dependent core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
- [sitearchhdrdir=$withval],
- [sitearchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/site_ruby'}${multiarch-'${sitehdrdir}/${sitearch}'}])
-
-AC_ARG_WITH(vendorhdrdir,
- AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
- [vendorhdrdir=$withval],
- [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
-
-AC_ARG_WITH(vendorarchhdrdir,
- AS_HELP_STRING([--with-vendorarchhdrdir=DIR],
- [architecture dependent core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
- [vendorarchhdrdir=$withval],
- [vendorarchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/vendor_ruby'}${multiarch-'${vendorhdrdir}/${sitearch}'}])
-
-AC_SUBST(rubyhdrdir)dnl
-AC_SUBST(sitehdrdir)dnl
-AC_SUBST(vendorhdrdir)dnl
-AC_SUBST(rubyarchhdrdir)dnl
-AC_SUBST(sitearchhdrdir)dnl
-AC_SUBST(vendorarchhdrdir)dnl
-
-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|man.gz|man.bz2|doc|doc.gz|doc.bz2], [MANTYPE=$withval],
- [AC_MSG_ERROR(invalid man type: $withval)])
- ])
-AS_IF([test -z "$MANTYPE"], [
- dnl Looks for nroff with -mdoc support.
- AC_CACHE_VAL([ac_cv_path_NROFF], [
- AC_PATH_PROGS_FEATURE_CHECK([NROFF],
- [nroff awf mandoc],
- [$ac_path_NROFF -mdoc ${srcdir}/man/ruby.1 \
- >/dev/null 2>&1 &&
- ac_cv_path_NROFF=$ac_path_NROFF \
- ac_path_NROFF_found=:],
- [], ["/usr/bin:/usr/ucb"]
- )
- ])
- AS_IF([test -n "$ac_cv_path_NROFF"], [
- MANTYPE=doc
- ], [
- MANTYPE=man
- ])
-])
-AC_SUBST(MANTYPE)
-
-AC_ARG_ENABLE(rubygems,
- AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
- [enable_rubygems="$enableval"], [enable_rubygems=yes])
-AS_IF([test x"$enable_rubygems" = xno], [
- AC_DEFINE(DISABLE_RUBYGEMS, 1)
- USE_RUBYGEMS=NO
-], [
- USE_RUBYGEMS=YES
-])
-AC_SUBST(USE_RUBYGEMS)
-
-arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
-AS_MKDIR_P("${arch_hdrdir}")
-config_h="${arch_hdrdir}/config.h"
-guard=INCLUDE_RUBY_CONFIG_H
-{
- echo "#ifndef $guard"
- echo "#define $guard 1"
- grep -v "^#define PACKAGE_" confdefs.h
- echo "#endif /* $guard */"
-} | tr -d '\015' |
-(
- AS_IF([test "x$CONFIGURE_TTY" = xyes], [color=--color], [color=])
- 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
-
-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 "`echo $e | sed 's/\.c$/.$(OBJEXT)/'`; done
-AC_SUBST(BUILTIN_ENCOBJS)
-
-BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
- -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
- -e '}' "${srcdir}/enc/Makefile.in"`"]
-BUILTIN_TRANSSRCS=
-BUILTIN_TRANSOBJS=
-for e in $BUILTIN_TRANSES; do
- 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)
-AS_MESSAGE([$PACKAGE library version = $ruby_version])
-
-AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
-
-AS_IF([test x"$firstmf" != x], [
- AC_CONFIG_FILES($firstmf:$firsttmpl, [], [firstmf="$firstmf" firsttmpl="$firsttmpl"])
-])
-AC_CONFIG_FILES(Makefile, [
- tmpmk=confmk$$.tmp
- {
- AS_IF([test ${VCS+set}], [
- :
- ], [svn info "$srcdir" > /dev/null 2>&1], [
- VCS='svn'
- ], [git_dir=`$GIT --work-tree="$srcdir" --git-dir="$srcdir/.git" rev-parse --git-dir 2>/dev/null`], [
- AS_IF([test -d "$git_dir/svn"], [
- VCS='$(GIT) svn'
- ], [
- VCS='$(GIT)'
- ])
- ], [
- VCS='echo cannot'
- ])
- AS_CASE("$VCS",
- [svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
- ['$(GIT) svn'], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
- ['$(GIT)'|git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
- [VCSUP='$(VCS)'])
- sed -n \
- -e '[/^@%:@define \(RUBY_RELEASE_[A-Z]*\) \([0-9][0-9]*\)/]{' \
- -e 's//\1 = \2/' \
- -e '[s/ \([0-9]\)$/ 0\1/]' \
- -e p \
- -e '}' "$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)'
- AS_IF([test "$gnumake" != yes], [
- echo ['$(MKFILES): $(srcdir)/common.mk']
- sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
- ], [
- echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
- ])
- } > $tmpmk && AS_IF([! grep '^ruby:' $tmpmk > /dev/null], [
- AS_IF([test "${gnumake}" = yes], [
- tmpgmk=confgmk$$.tmp
- {
- echo "include $tmpmk"
- echo "-include uncommon.mk"
- } > $tmpgmk
- ], [
- tmpgmk=$tmpmk
- ]) &&
- test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
- echo 'ruby: $(PROGRAM);' >> $tmpmk
- test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
- ]) && mv -f $tmpmk Makefile],
-[EXEEXT='$EXEEXT' gnumake='$gnumake' GIT='$GIT'])
-
-AC_ARG_WITH([ruby-pc],
- 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,
- [
- AS_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 &&
- {
- test -z "$PKG_CONFIG" ||
- PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
- }],
- [
- mv -f ruby.tmp.pc $ruby_pc
- ], [
- exit 1
- ])
- ],
- [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
-
-AC_OUTPUT
-}
-}
-
-AS_IF([${FOLD+:} false], [], [
-AS_IF([test "`echo abcdefg hijklmno | fold -s -w10 | sed 1d`" = hijklmno], [FOLD="fold"], [FOLD=])
-])
-AS_REQUIRE_SHELL_FN([config_summary],
- [AS_FUNCTION_DESCRIBE([config_summary], [NAME, VAL], [configuration summary])],
- [AS_IF([test -z "$2"], [], [
- AS_ECHO_N([" * $1: "]) | dd bs=1 count=26 2>/dev/null
- AS_IF([test "$FOLD"], [
- echo "$2" | fold -s -w50 |
- sed '1!s/^/ /;$!s/$/\\/'
- ], [echo "$2"])
- ])]
-)
-
-echo "---"
-echo "Configuration summary for $RUBY_BASE_NAME version $RUBY_PROGRAM_VERSION"
-echo ""
-config_summary "Installation prefix" "$prefix"
-config_summary "exec prefix" "$exec_prefix"
-config_summary "arch" "$arch"
-config_summary "site arch" "$sitearch"
-config_summary "RUBY_BASE_NAME" "$RUBY_BASE_NAME"
-config_summary "enable shared" "$enable_shared"
-config_summary "ruby lib prefix" "$rubylibprefix"
-config_summary "site libraries path" "$rubysitearchprefix"
-config_summary "vendor path" "$vendordir"
-config_summary "target OS" "$target_os"
-config_summary "compiler" "$CC"
-config_summary "with pthread" "$enable_pthread"
-config_summary "enable shared libs" "$ENABLE_SHARED"
-config_summary "dynamic library ext" "$DLEXT"
-config_summary "CFLAGS" "$cflags"
-config_summary "CPPFLAGS" "$cppflags"
-config_summary "LDFLAGS" "$LDFLAGS"
-config_summary "optflags" "$optflags"
-config_summary "debugflags" "$debugflags"
-config_summary "warnflags" "$warnflags"
-config_summary "strip command" "$STRIP"
-config_summary "install doc" "$install_doc"
-config_summary "man page type" "$MANTYPE"
-config_summary "search path" "$search_path"
-config_summary "static-linked-ext" ${EXTSTATIC:+"yes"}
-echo ""
-echo "---"
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000000..d2373ed2b6
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,4217 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT()
+{
+AC_CONFIG_AUX_DIR(tool)
+
+AC_PREREQ(2.67)
+
+AC_DEFUN([RUBY_PREREQ_AC],
+ [m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), [-1],
+ AC_MSG_ERROR([Autoconf version ]$1[ or higher is required]$2))])
+
+AC_DISABLE_OPTION_CHECKING
+
+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
+# AC_EGREP_CPP with CFLAGS=-g on Darwin.
+#
+# TODO: remove this hack when AC_PREREQ() becomes 2.70 or later.
+AS_CASE([$build_os], [darwin*], [
+rm() {
+ rm_recursive=''
+ for arg do
+ AS_CASE("$arg",
+ [--*], [],
+ [-*r*], [break],
+ [conftest.*], [if test -d "$arg"; then rm_recursive=-r; break; fi],
+ [])
+ done
+ command rm $rm_recursive "[$]@"
+}
+])])])
+
+{ # environment section
+
+AC_ARG_WITH(baseruby,
+ AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
+ [
+ AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
+ ],
+ [
+ BASERUBY="ruby"
+ ])
+if test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42; then
+ if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'p 42' 2>/dev/null`" = 42; then
+ BASERUBY="$BASERUBY --disable=gems"
+ fi
+else
+ BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
+fi
+AC_SUBST(BASERUBY)
+
+for conf in config.guess config.sub; do
+ test -f "$srcdir/tool/$conf" && continue
+ $BASERUBY -C "$srcdir/tool" get-config_files $conf
+done
+
+AC_DEFUN([RUBY_MINGW32],
+[AS_CASE(["$host_os"],
+[cygwin*], [
+AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
+[AC_TRY_CPP([
+#ifndef __MINGW32__
+# error
+#endif
+], rb_cv_mingw32=yes,rb_cv_mingw32=no)
+rm -f conftest*])
+if test "$rb_cv_mingw32" = yes; then
+ target_os="mingw32"
+ : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
+fi
+])
+AS_CASE(["$target_os"], [mingw*msvc], [
+target_os="`echo ${target_os} | sed 's/msvc$//'`"
+])
+AS_CASE(["$target_cpu-$target_os"], [x86_64-mingw*], [
+target_cpu=x64
+])
+])
+
+AC_DEFUN([RUBY_NACL],
+[
+ AS_CASE(["${host_os}"],
+[nacl], [
+ ac_cv_exeext=.nexe
+ host_vendor=chromium
+ ac_cv_host=chromium
+ AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set])
+ if test x"${NACL_SDK_ROOT}" = x; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient])
+ fi
+ AC_MSG_RESULT([yes])
+
+ nacl_cv_build_variant=glibc
+ AC_ARG_WITH(newlib,
+ AS_HELP_STRING([--with-newlib], [uses newlib version of NativeClient SDK]),
+ [AS_CASE([$withval],
+ [no], [nacl_cv_build_variant=glibc],
+ [yes], [nacl_cv_build_variant=newlib])])
+
+ AS_CASE(["$build_cpu"],
+ [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
+ AS_CASE(["$build_os"],
+ [linux*], [nacl_cv_os_nick=linux],
+ [darwin*], [nacl_cv_os_nick=mac],
+ [cygwin*|mingw*], [nacl_cv_os_nick=win],
+ [nacl_cv_os_nick=$build_os])
+
+ host="$host_cpu-chromium-$host_os-"
+ ac_tool_prefix="$host_cpu-nacl-"
+
+ AC_MSG_CHECKING([NativeClient toolchain])
+ if test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
+ else
+ AS_CASE(
+ ["${nacl_cv_build_variant}"],
+ [glibc], [if test \
+ -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \
+ -a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"
+ fi],
+ [newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ])
+ fi
+ if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then
+ if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl-
+ fi
+ if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
+ ac_tool_prefix=nacl64-
+ fi
+ fi
+ if test -z "${NACL_TOOLCHAIN}"; then
+ AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed])
+ fi
+ AC_MSG_RESULT(${NACL_TOOLCHAIN})
+
+ AC_MSG_CHECKING([path to SDK])
+ if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
+ PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
+ fi
+
+ AC_SUBST(NACL_TOOLCHAIN)
+ AC_SUBST(NACL_SDK_ROOT)
+ AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
+])])
+
+AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
+[AS_CASE(["${host_os}"],
+[nacl], [
+ AC_CHECK_TYPES([struct PPB_Core, struct PPB_Messaging, struct PPB_Var,
+ struct PPB_URLLoader, struct PPB_URLRequestInfo,
+ struct PPB_URLResponseInfo, struct PPB_FileRef,
+ struct PPP_Instance])
+])
+])
+
+AC_DEFUN([RUBY_CPPOUTFILE],
+[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
+[save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS='-o conftest-1.i'
+rb_cv_cppoutfile=no
+AC_TRY_CPP([test-for-cppout],
+ [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
+CPPFLAGS="$save_CPPFLAGS"
+rm -f conftest*])
+if test "$rb_cv_cppoutfile" = yes; then
+ CPPOUTFILE='-o conftest.i'
+elif test "$rb_cv_cppoutfile" = no; then
+ CPPOUTFILE='> conftest.i'
+elif test -n "$rb_cv_cppoutfile"; then
+ CPPOUTFILE="$rb_cv_cppoutfile"
+fi
+AC_SUBST(CPPOUTFILE)])
+
+AC_DEFUN([RUBY_PROG_GNU_LD],
+[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
+[if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then
+ rb_cv_prog_gnu_ld=yes
+else
+ rb_cv_prog_gnu_ld=no
+fi
+])
+GNU_LD=$rb_cv_prog_gnu_ld
+AC_SUBST(GNU_LD)])
+
+eval `sed -n 's/^#define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/include/ruby/version.h`
+for v in MAJOR MINOR TEENY; do
+ if eval "test \"\$$v\" = ''"; then
+ AC_MSG_ERROR(could not determine $v number from version.h)
+ fi
+done
+AC_SUBST(MAJOR)
+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_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
+AC_DEFINE(CANONICALIZATION_FOR_MATHN)
+dnl checks for alternative programs
+AC_CANONICAL_BUILD
+RUBY_RM_RECURSIVE
+AC_ARG_WITH(gcc,
+ AS_HELP_STRING([--without-gcc], [never use gcc]),
+ [
+ AS_CASE([$withval],
+ [no], [: ${CC=cc}],
+ [yes], [: ${CC=gcc}],
+ [CC=$withval])])
+dnl If the user switches compilers, we can't believe the cache
+if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
+then
+ AC_MSG_ERROR(cached CC is different -- throw away $cache_file
+(it is also a good idea to do 'make clean' before compiling))
+fi
+AS_CASE(["$build_os"],
+ [darwin1*.*], [
+ AS_CASE(["x$CC"],
+ [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
+ [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
+ [xcc|x/usr/bin/cc], [: ${CXX=c++}],
+ [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
+ ])
+test -z "$CC" || ac_cv_prog_CC="$CC"
+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)
+AC_SUBST(RUBYW_BASE_NAME)
+AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
+
+AC_CANONICAL_TARGET
+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.
+
+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=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], [],
+ [minor+0], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1.0/']],
+ [minor], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1/']],
+ [major+0], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1.0/']],
+ [major], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1/']],
+ [none], [os_version_style_transform=['s/[0-9]\.[0-9][.0-9]*$//']],
+ [AC_MSG_ERROR(unknown --with-os-version-style: $withval)])
+AS_IF([test -z "$target_alias" -a -n "$os_version_style_transform"],
+ [
+ target=`echo ${target} | sed "$os_version_style_transform"`
+ target_os=`echo ${target_os} | sed "$os_version_style_transform"`
+ ])
+
+AC_DEFUN([RUBY_APPEND_OPTION],
+ [# RUBY_APPEND_OPTION($1)
+ AS_CASE([" [$]{$1-} "],
+ [*' $2 '*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
+AC_DEFUN([RUBY_APPEND_OPTIONS],
+ [# RUBY_APPEND_OPTIONS($1)
+ for rb_opt in $2; do
+ AS_CASE([" [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
+ done])
+AC_DEFUN([RUBY_PREPEND_OPTION],
+ [# RUBY_PREPEND_OPTION($1)
+ AS_CASE([" [$]{$1-} "],
+ [*' $2 '*], [], [' '], [ $1="$2"], [ $1="$2 [$]$1"])])
+AC_DEFUN([RUBY_PREPEND_OPTIONS],
+ [# RUBY_PREPEND_OPTIONS($1)
+ unset rb_opts; for rb_opt in $2; do
+ AS_CASE([" [$]{rb_opts} [$]{$1-} "],
+ [*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
+ done
+ $1="[$]{rb_opts}[$]$1"])
+
+AC_ARG_WITH(arch,
+ AS_HELP_STRING([--with-arch=ARCHS],
+ [build an Apple/NeXT Multi Architecture Binary (MAB);
+ ARCHS is a comma-delimited list of architectures for
+ which to build; if this option is disabled or omitted
+ entirely, then the package will be built only for the
+ target platform]),
+ [target_archs="$withval"], [unset target_archs])
+
+AC_DEFUN([RUBY_DEFAULT_ARCH], [
+AC_MSG_CHECKING([arch option])
+AS_CASE([$1],
+ [*64], [ARCH_FLAG=-m64],
+ [[i[3-6]86]], [ARCH_FLAG=-m32],
+ [AC_MSG_ERROR(unknown target architecture: $target_archs)]
+ )
+AC_MSG_RESULT([$ARCH_FLAG])
+])
+
+AC_DEFUN([RUBY_UNIVERSAL_ARCH], [
+# RUBY_UNIVERSAL_ARCH begin
+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'`
+unset universal_binary universal_archnames
+if test ${target_archs+set}; then
+ AC_MSG_CHECKING([target architectures])
+ target_archs=`echo $target_archs | tr , ' '`
+ # /usr/lib/arch_tool -archify_list $TARGET_ARCHS
+ for archs in $target_archs
+ do
+ AS_CASE([",$universal_binary,"],[*",$archs,"*], [],[
+ cpu=`$SHELL "$ac_aux_dir/config.sub" "${archs}-${target_os}" 2>&1` || {
+ AC_MSG_RESULT([failed])
+ AC_MSG_ERROR([$cpu])
+ }
+ cpu=`echo $cpu | sed 's/-.*-.*//'`
+ universal_binary="${universal_binary+$universal_binary,}$cpu"
+ universal_archnames="${universal_archnames} ${archs}=${cpu}"
+ ARCH_FLAG="${ARCH_FLAG+$ARCH_FLAG }-arch $archs"
+ ])
+ done
+ target_archs="$universal_binary"
+ unset universal_binary
+ AS_CASE(["$target_archs"],
+ [*,*], [universal_binary=yes],
+ [unset universal_archnames])
+ AC_MSG_RESULT([$target_archs])
+
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
+ if test "${universal_binary-no}" = yes; then
+ AC_SUBST(try_header,try_compile)
+ target_cpu=universal
+ real_cross_compiling=$cross_compiling
+ else
+ if test x"$target_cpu" != x"${target_archs}"; then
+ echo 'int main(){return 0;}' > conftest.c
+ if $CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1; then
+ rm -fr conftest.*
+ else
+ RUBY_DEFAULT_ARCH("$target_archs")
+ fi
+ fi
+ target_cpu=${target_archs}
+ fi
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+else
+ if test x"$target_alias" = x; then
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ AC_MSG_CHECKING([for real target cpu])
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_cpu=`$CC -E - 2>/dev/null <<EOF |
+#ifdef __x86_64__
+"processor-name=x86_64"
+#endif
+#ifdef __i386__
+"processor-name=i386"
+#endif
+#ifdef __ppc__
+"processor-name=powerpc"
+#endif
+#ifdef __ppc64__
+"processor-name=powerpc64"
+#endif
+EOF
+ sed -n 's/^"processor-name=\(.*\)"/\1/p'`
+ target="$target_cpu${target}"
+ AC_MSG_RESULT([$target_cpu])
+ ])
+ fi
+ target_archs="$target_cpu"
+fi
+if test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"; then
+ AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}])
+else
+ rb_cv_target_archs=${target_archs}
+fi
+if test "x${ARCH_FLAG}" != x; then
+ CFLAGS="$CFLAGS ${ARCH_FLAG}"
+ LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
+fi
+# RUBY_UNIVERSAL_ARCH end
+])
+
+AC_ARG_ENABLE(load-relative,
+ AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
+ [load_relative=$enableval])
+
+AC_ARG_PROGRAM
+
+dnl Checks for programs.
+
+cflagspat=
+test -z "$optflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "$debugflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+test -z "warnflags" ||
+ cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
+if test -z "${CFLAGS+set}"; then
+ cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cflags="$cflags"
+ cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
+fi
+if test -z "${CXXFLAGS+set}"; then
+ cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
+ orig_cxxflags="$cxxflags"
+ cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
+fi
+
+RUBY_NACL
+AS_CASE(["$host_os:$build_os"],
+[darwin*:darwin*], [
+ AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
+ # 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)
+ # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
+ if ! $CC -E -xc - <<SRC >/dev/null; then
+ @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
+ @%:@error premature clang
+ @%:@endif
+SRC
+ AC_MSG_ERROR([clang version 3.0 or later is required])
+ fi
+])
+if test x"${build}" != x"${host}"; then
+ AC_CHECK_TOOL(CC, gcc)
+fi
+
+AC_PROG_CC
+AC_PROG_CXX
+RUBY_MINGW32
+AC_PROG_GCC_TRADITIONAL
+AC_SUBST(GCC)
+AS_CASE(["$target_os"],
+[solaris*], [AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])],
+[AC_CHECK_TOOL([LD], [ld], [ld])])
+AC_SUBST(LD)
+if test "$GCC" = yes; then
+ linker_flag=-Wl,
+ : ${optflags=-O3}
+ gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'`
+ test -n "$gcc_major" || gcc_major=0
+ # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
+else
+ linker_flag=
+fi
+
+RUBY_PROG_GNU_LD
+RUBY_CPPOUTFILE
+
+: ${OUTFLAG='-o '}
+: ${COUTFLAG=${OUTFLAG}}
+AC_SUBST(OUTFLAG)
+AC_SUBST(COUTFLAG)
+
+cc_version=
+for option in --version -v -V -qversion; do
+ cc_version_message=`$CC $option 2>&1`
+ cc_version_status=$?
+ AS_CASE($cc_version_status, [0], [:], [continue])
+ AS_CASE($cc_version_message, [*Warning*], [continue])
+ cc_version='$(CC) '$option
+done
+AC_SUBST(CC_VERSION, $cc_version)
+
+RUBY_UNIVERSAL_ARCH
+if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then
+ RUBY_DEFAULT_ARCH("$target_cpu")
+fi
+
+AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [
+ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
+ AC_TRY_LINK([unsigned long atomic_var;],
+ [
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
+ ],
+ [rb_cv_gcc_compiler_cas=yes],
+ [rb_cv_gcc_compiler_cas=no])])
+ if test "$rb_cv_gcc_compiler_cas" = no; then
+ unset rb_cv_gcc_compiler_cas
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -march=i486"
+ AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [
+ AC_TRY_LINK([unsigned long atomic_var;],
+ [
+ __sync_val_compare_and_swap(&atomic_var, 0, 1);
+ ],
+ [rb_cv_gcc_compiler_cas=yes
+ ARCH_FLAG="-march=i486"],
+ [rb_cv_gcc_compiler_cas=no])])
+ CFLAGS="$save_CFLAGS"
+ fi])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(AR, ar)
+if test -z "$AR"; then
+ AC_CHECK_PROGS(AR, aal, ar)
+fi
+
+AC_CHECK_TOOL(AS, as)
+ASFLAGS=$ASFLAGS
+AC_SUBST(ASFLAGS)
+
+AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
+
+# BSD's ports and MacPorts prefix GNU binutils with 'g'
+AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
+AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
+
+AS_CASE(["$target_os"],
+[cygwin*|mingw*], [
+ AC_CHECK_TOOL(WINDRES, windres)
+ AC_CHECK_TOOL(DLLWRAP, dllwrap)
+ target=`echo $target | sed "s/^$target_cpu-/-/"`
+ target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
+ target_cpu=`echo $target_cpu | sed s/i.86/i386/`
+ AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
+ AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
+ AS_CASE(["$target_os"],
+ [mingw*], [
+ test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
+ AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
+ AC_TRY_LINK([@%:@include <stdio.h>],
+ [FILE* volatile f = stdin; return 0;],
+ [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
+ tr A-Z a-z |
+ sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
+ [rb_cv_msvcrt=msvcrt])
+ test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
+ RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
+ test "$RT_VER" = "" && RT_VER=60
+ AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
+ ])
+ : ${enable_shared=yes}
+ ],
+[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
+[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
+AC_CHECK_TOOL(NM, nm)
+
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+AC_PROG_MKDIR_P
+if test "x$MKDIR_P" = "x -d"; then
+ if test x"$as_mkdir_p" != xfalse; then
+ MKDIR_P='mkdir -p'
+ echo "use 'mkdir -p' as MKDIR_P"
+ else
+ AC_MSG_ERROR([mkdir -p is required])
+ fi
+fi
+MAKEDIRS="$MKDIR_P"
+AC_SUBST(MAKEDIRS)
+
+AC_DEFUN([RUBY_DTRACE_AVAILABLE],
+[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available,
+[
+ echo "provider conftest{ probe fire(); };" > conftest_provider.d
+ if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then
+ # DTrace is available on the system
+ rb_cv_dtrace_available=yes
+ else
+ # DTrace is not available while dtrace command exists
+ # for example FreeBSD 8 or FreeBSD 9 without DTrace build option
+ rb_cv_dtrace_available=no
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
+[AC_CACHE_CHECK(whether $DTRACE needs post processing, rb_cv_prog_dtrace_g,
+[
+ if {
+ cat >conftest_provider.d <<_PROBES &&
+ provider conftest {
+ probe fire();
+ };
+_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
+ fi
+ rm -f conftest.[co] conftest_provider.[dho]
+])
+])
+
+AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
+if test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
+fi
+
+AC_CHECK_PROGS(DOT, dot)
+AC_CHECK_PROGS(DOXYGEN, doxygen)
+AS_CASE(["${host_os}"], [nacl], [AC_PATH_PROG(PYTHON, python)])
+
+AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
+ [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
+
+# checks for UNIX variants that set C preprocessor variables
+AC_USE_SYSTEM_EXTENSIONS
+
+AC_SUBST(RM, ['rm -f'])
+AC_SUBST(CP, ['cp'])
+RMDIRS='$(top_srcdir)/tool/rmdirs'
+RMDIR=rmdir
+mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
+rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
+RMDIR='rmdir --ignore-fail-on-non-empty'
+$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
+{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
+rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
+AC_SUBST(RMDIR)
+AC_SUBST(RMDIRS)
+AC_SUBST(RMALL, ['rm -fr'])
+
+AC_MSG_CHECKING([for cd using physical directory])
+rm -fr conf$$.dir
+mkdir conf$$.dir &&
+(cd conf$$.dir && mkdir src build && cd src &&
+$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
+for chdir in 'cd -P' 'PWD= cd'; do
+ /bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
+done)
+if test -f conf$$.dir/src/cdcmd; then
+ read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
+else
+ CHDIR=cd
+fi
+rm -fr conf$$.dir
+AC_MSG_RESULT([$CHDIR])
+AC_SUBST(CHDIR)
+
+}
+{ # compiler section
+
+AC_DEFUN([RUBY_WERROR_FLAG], [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $rb_cv_warnflags"
+if test "${ac_c_werror_flag+set}"; then
+ rb_c_werror_flag="$ac_c_werror_flag"
+else
+ unset rb_c_werror_flag
+fi
+ac_c_werror_flag=yes
+$1
+CFLAGS="$save_CFLAGS"
+save_CFLAGS=
+if test "${rb_c_werror_flag+set}"; then
+ ac_c_werror_flag="$rb_c_werror_flag"
+else
+ unset ac_c_werror_flag
+fi])
+
+RUBY_WERROR_FLAG([
+ AC_MSG_CHECKING([whether CFLAGS is valid])
+ AC_TRY_COMPILE([], [],
+ [AC_MSG_RESULT(yes)],
+ [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
+ ]
+ )
+ 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([faild 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_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
+ RUBY_WERROR_FLAG([
+ CFLAGS="[$]CFLAGS $1"
+ AC_TRY_COMPILE([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+])
+
+AC_DEFUN([RUBY_TRY_LDFLAGS], [
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="[$]LDFLAGS $1"
+ AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
+ RUBY_WERROR_FLAG([
+ AC_TRY_LINK([$4], [$5],
+ [$2
+ AC_MSG_RESULT(yes)],
+ [$3
+ AC_MSG_RESULT(no)])
+ ])
+ LDFLAGS="$save_LDFLAGS"
+ save_LDFLAGS=
+])
+
+AS_CASE([$RUBY_PATCHLEVEL], [-*],
+ [particular_werror_flags=yes], [particular_werror_flags=no])
+AC_ARG_ENABLE(werror,
+ AS_HELP_STRING([--disable-werror],
+ [don't make warnings into errors
+ even if a compiler support -Werror feature
+ [[disabled by default unless development version]]]),
+ [particular_werror_flags=$enableval])
+
+rb_cv_warnflags="$warnflags"
+if test "$GCC:${warnflags+set}:no" = yes::no; then
+ if test $gcc_major -ge 4; then
+ extra_warning=-Werror=extra-tokens
+ else
+ extra_warning=
+ fi
+ for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
+ -Wno-missing-field-initializers \
+ -Wunused-variable \
+ -Werror=pointer-arith \
+ -Werror=write-strings \
+ -Werror=declaration-after-statement \
+ -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
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
+ fi
+ ok=no
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ ok=yes
+ ])
+ AS_CASE([$ok:$wflag], [no:-Werror=*], [
+ wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
+ RUBY_TRY_CFLAGS($wflag, [
+ RUBY_APPEND_OPTIONS(warnflags, $wflag)
+ particular_werror_flags=no
+ ])
+ ])
+ done
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
+ [wflag=-Wall])
+ RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
+ # Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
+ rb_cv_warnflags="$warnflags"
+ warnflags=
+fi
+RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
+
+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)])
+
+ # -fstack-protector
+ AS_CASE(["$target_os"],
+ [mingw*|nacl|haiku], [
+ stack_protector=no
+ ])
+ if test -z "${stack_protector+set}"; then
+ RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
+ if test "x$stack_protector" = xyes; then
+ RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
+ fi
+ fi
+ if test "x$stack_protector" = xyes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
+ RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
+ fi
+
+ AS_CASE(["$target_os"],[mingw*], [
+ # On Windows platforms, system provided headers are VC++
+ # optimized. That is, C++ habits are often contaminated into
+ # various headers. Most frequent situation is the use of //
+ # comments. We bypass ANSI C mode for them. Otherwise
+ # extension libs cannot include those headers.
+ ],
+ [cygwin*|darwin*|netbsd*], [
+ # need lgamma_r(), finite()
+ ],
+ [haiku], [
+ # Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
+ # with ANSI standard flags. Anonumous union is required to compile
+ # socket extension where <net/if.h> uses anonymous union.
+ ],
+ [
+ # ANSI (no XCFLAGS because this is C only)
+ 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
+ RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
+
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
+ test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
+fi
+test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
+
+if test "$GCC" = ""; then
+ AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
+fi
+if test "$GCC" = yes; then
+ if test "$gcc_major" -ge 4; then
+ RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
+ fi
+ AC_SUBST(WERRORFLAG, "-Werror")
+ if test "$visibility_option" = yes; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
+ AC_DEFINE(RUBY_SYMBOL_EXPORT_BEGIN, [_Pragma("GCC visibility push(default)")])
+ AC_DEFINE(RUBY_SYMBOL_EXPORT_END, [_Pragma("GCC visibility pop")])
+ else
+ RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
+ fi
+ test "$visibility_option" = no -o "$host_os" = nacl || OBJCOPY=:
+fi
+
+if test "$GCC" = yes; then
+ # optflags
+
+ AS_CASE(["$target_os"], [mingw*], [
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
+ ])
+
+ # disable fast-math
+ for oflag in -fno-fast-math; do
+ RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
+ done
+fi
+
+AC_ARG_WITH(opt-dir,
+ AS_HELP_STRING([--with-opt-dir=DIR-LIST],
+ [add optional headers and libraries directories separated by $PATH_SEPARATOR]),
+ [
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
+ CPPFLAGS="$CPPFLAGS $val"
+ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib|g;s/^ //"`
+ LDFLAGS="$LDFLAGS $val"
+ LDFLAGS_OPTDIR="$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\""
+
+}
+{ # header and library section
+
+AC_ARG_WITH(winnt-ver,
+ AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
+ [with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
+AS_CASE(["$target_os"],
+[mingw*], [
+ RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
+ RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
+])
+
+AS_CASE(["$target_os"],
+[freebsd*], [
+ AC_CACHE_CHECK([whether pthread should be enabled by default],
+ rb_cv_enable_pthread_default,
+ [AC_TRY_CPP([
+#include <osreldate.h>
+#if __FreeBSD_version < 502102
+#error pthread should be disabled on this platform
+#endif
+ ],
+ rb_cv_enable_pthread_default=yes,
+ rb_cv_enable_pthread_default=no)])
+ enable_pthread=$rb_cv_enable_pthread_default
+ ],
+[mingw*], [
+ enable_pthread=no
+ ],
+[
+ enable_pthread=yes
+ ])
+
+AC_ARG_ENABLE(pthread,
+ AS_HELP_STRING([--enable-pthread], [obsolete, and ignored]))
+
+dnl Checks for libraries.
+AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
+
+POSTLINK=:
+AC_SUBST(POSTLINK)
+AS_CASE(["$target_os"],
+[nextstep*], [ ],
+[openstep*], [ ],
+[rhapsody*], [ ],
+[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
+ AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
+ AC_TRY_CPP([#include <AvailabilityMacros.h>
+ #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
+ #error pre OS X 10.4
+ [!<===== pre OS X 10.4 =====>]
+ #endif
+ ],
+ [macosx_10_5=yes], [macosx_10_5=no])
+ AC_MSG_RESULT($macosx_10_5)
+ if test $macosx_10_5 = yes; then
+ ac_cv_func_getcontext=no
+ ac_cv_func_setcontext=no
+ else
+ AC_DEFINE(BROKEN_SETREUID, 1)
+ AC_DEFINE(BROKEN_SETREGID, 1)
+ fi
+ 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
+ AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int
+main()
+{
+ int i;
+ for (i = 0; i < 128*128; i++) {
+ char salt[2], buf[256], *s;
+ salt[0] = 0x80 | (i & 0x7f);
+ salt[1] = 0x80 | (i >> 7);
+ strcpy(buf, crypt("", salt));
+ if (strcmp(buf, s = crypt("", salt))) {
+#if 0
+ printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
+ buf+2, s+2);
+#endif
+ return 1;
+ }
+ }
+ return 0;
+}
+],
+ rb_cv_broken_crypt=no,
+ rb_cv_broken_crypt=yes,
+ rb_cv_broken_crypt=yes)])
+ if test "$rb_cv_broken_crypt" = yes; then
+ AC_DEFINE(BROKEN_CRYPT, 1)
+ fi
+ AC_CHECK_PROGS(codesign, codesign)
+ if test -n "$codesign"; then
+ POSTLINK="test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@"
+ LINK_SO="$LINK_SO
+\$(POSTLINK)"
+ fi
+ AC_CHECK_HEADERS(crt_externs.h, [], [], [
+ #include <crt_externs.h>
+ ])
+ ],
+[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
+ ],
+[cygwin*], [ ac_cv_header_langinfo_h=yes
+ AC_CHECK_FUNCS(cygwin_conv_path)
+ AC_LIBOBJ([langinfo])
+ ],
+[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi $LIBS"
+ ac_cv_header_a_out_h=no
+ ac_cv_header_pwd_h=no
+ ac_cv_header_utime_h=no
+ ac_cv_header_sys_ioctl_h=no
+ ac_cv_header_sys_param_h=no
+ ac_cv_header_sys_resource_h=no
+ ac_cv_header_sys_select_h=no
+ ac_cv_header_sys_time_h=no
+ ac_cv_header_sys_times_h=no
+ ac_cv_header_sys_socket_h=no
+ ac_cv_func_times=yes
+ ac_cv_func_waitpid=yes
+ ac_cv_func_fsync=yes
+ ac_cv_func_seekdir=yes
+ ac_cv_func_telldir=yes
+ ac_cv_func_isinf=yes
+ ac_cv_func_isnan=yes
+ ac_cv_func_finite=yes
+ ac_cv_func_link=yes
+ ac_cv_lib_crypt_crypt=no
+ ac_cv_func_getpgrp_void=no
+ ac_cv_func_memcmp_working=yes
+ ac_cv_lib_dl_dlopen=no
+ rb_cv_binary_elf=no
+ rb_cv_negative_time_t=no
+ ac_cv_func_fcntl=yes
+ ac_cv_func_flock=yes
+ ac_cv_func_gmtime_r=yes
+ rb_cv_large_fd_select=yes
+ ac_cv_type_struct_timeval=yes
+ 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>])
+ if test x"$ac_cv_type_NET_LUID" = xyes; then
+ AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
+ fi
+ AC_CHECK_FUNCS(_gmtime64_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)
+ ac_cv_sizeof_rlim_t=8],
+[freebsd*], [ LIBS="-lm $LIBS"
+ ac_cv_func_getpeername=no
+ ac_cv_func_getsockname=no
+ 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
+ ],
+[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"])
+
+AC_CHECK_LIB(crypt, crypt) # glibc (GNU/Linux, GNU/Hurd, GNU/kFreeBSD)
+AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
+AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+AC_CHECK_LIB(socket, shutdown) # SunOS/Solaris
+
+dnl Checks for header files.
+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/param.h \
+ sys/select.h \
+ sys/time.h \
+ sys/times.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 \
+ sys/uio.h \
+ atomic.h \
+ malloc.h \
+ malloc_np.h \
+ malloc/malloc.h \
+ setjmpex.h \
+ sys/id.h
+)
+
+AC_ARG_WITH([gmp],
+ [AS_HELP_STRING([--without-gmp],
+ [disable GNU GMP to accelerate Bignum operations])],
+ [],
+ [with_gmp=yes])
+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_ARG_WITH([jemalloc],
+ [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
+ [with_jemalloc=yes], [with_jemalloc=no])
+AS_IF([test "x$with_jemalloc" = xyes],[
+ AC_CHECK_LIB([jemalloc], [malloc_conf], [], [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
+ LIBS="-ljemalloc $LIBS"
+ ])
+ 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
+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],
+ [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_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)])
+
+AC_CHECK_TYPES([long long, off_t])
+
+AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
+ [test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
+ [AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
+
+dnl RUBY_CHECK_SIZEOF [typename], [maybe same size types], [macros], [include]
+AC_DEFUN([RUBY_CHECK_SIZEOF],
+[m4_bmatch([$1], [\.], [], [if test "$universal_binary" = yes; then])
+AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [
+ unset AS_TR_SH(ac_cv_sizeof_$1)
+ rbcv_var="
+typedef m4_bpatsubst([$1], [\..*]) ac__type_sizeof_;
+static ac__type_sizeof_ *rbcv_ptr;
+@%:@define AS_TR_CPP(SIZEOF_$1) sizeof((*rbcv_ptr)[]m4_bmatch([$1], [\.], .m4_bpatsubst([$1], [^[^.]*\.])))
+"
+ m4_ifval([$2], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for t in $2; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([$4]
+ [$rbcv_var]),
+ [AS_TR_CPP(SIZEOF_$1) == sizeof($t)])], [
+ AS_TR_SH(ac_cv_sizeof_$1)=AS_TR_CPP([SIZEOF_]$t)
+ break])
+ done
+ }])
+ unset cond
+ m4_ifval([$3], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
+ for s in 32 64 128; do
+ for t in $3; do
+ cond="${cond}
+@%:@${cond+el}if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})"
+ hdr="AC_INCLUDES_DEFAULT([$4
+@%:@if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})
+@%:@ define AS_TR_CPP(HAVE_$1) 1
+@%:@else
+@%:@ define AS_TR_CPP(HAVE_$1) 0
+@%:@endif])"
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr], [!AS_TR_CPP(HAVE_$1)])], [continue])
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
+ [$rbcv_var],
+ [AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == ([$[s / rb_cv_char_bit]]))])],
+ [AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}"])
+ done
+ done
+ }])
+ m4_ifval([$2][$3],
+ [test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
+ test "$universal_binary" = yes && cross_compiling=yes
+ AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
+[${cond+$cond
+@%:@else}
+$rbcv_var
+${cond+@%:@endif}
+@%:@ifndef AS_TR_CPP(SIZEOF_$1)
+@%:@define AS_TR_CPP(SIZEOF_$1) 0
+@%:@endif], [t=0])
+ test "$universal_binary" = yes && cross_compiling=$real_cross_compiling
+ if test ${t-0} != 0; then
+ AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
+ fi
+ }
+ : ${AS_TR_SH(ac_cv_sizeof_$1)=0}
+])
+{
+ unset cond
+ for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
+ AS_CASE(["$t"],
+ [[[0-9]*|SIZEOF_*]], [
+ ${cond+echo "@%:@else"}
+ echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) [$t]"
+ break
+ ],
+ [
+ s=`expr $t : ['.*[^0-9]\([0-9][0-9]*\)$']`
+ echo "@%:@${cond+el}if defined(__${t}__) || defined(__${t}) || defined(_${t}) || defined($t)"
+ echo "@%:@define AS_TR_CPP(SIZEOF_$1) [$[s / rb_cv_char_bit]]"
+ cond=1
+ ])
+ done
+ ${cond+echo "@%:@endif"}
+} >> confdefs.h
+m4_bmatch([$1], [\.], [], [else
+AC_CHECK_SIZEOF([$1], 0, [$4])
+fi])
+])
+
+RUBY_CHECK_SIZEOF(int, [], [ILP])
+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)
+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(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
+ for pri in $2; do
+ AC_TRY_COMPILE(
+ [@%:@include <stdio.h>
+ @%:@include <stddef.h>
+ @%:@ifdef __GNUC__
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
+ decl __attribute__((format(printf, string_index, first_to_check)))
+ @%:@else
+ @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
+ @%:@endif
+ PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);],
+ [printf("%]${pri}[d", (]$1[)42);
+ test_sprintf("%]${pri}[d", (]$1[)42);],
+ [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
+ done)])
+if test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE; then
+ AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
+ "[$rb_cv_pri_prefix_]AS_TR_SH($1)")
+fi
+])
+
+if test "x$ac_cv_type_long_long" = xyes; then
+ RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
+elif test "x$ac_cv_type___int64" = xyes; then
+ RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
+fi
+
+dnl RUBY_CHECK_SIZEOF [typename] [if-signed] [if-unsigned] [included]
+AC_DEFUN([RUBY_CHECK_SIGNEDNESS], [dnl
+ AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($1)-1 > 0])],
+ [$3], [$2])])
+
+dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
+AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
+ AC_CHECK_TYPE([$1],
+ [n="patsubst([$1],["],[\\"])"],
+ [n="patsubst([$2],["],[\\"])"],
+ [$4])
+ AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
+ u= t=
+ AS_CASE(["$n "],
+ [*" signed "*], [ ],
+ [*" unsigned "*], [
+ u=U],
+ [RUBY_CHECK_SIGNEDNESS($n, [], [u=U], [$4])])
+ if test x"$t" = x; then
+ for t in "long long" long int short; do
+ test -n "$u" && t="unsigned $t"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])]
+ [typedef $n rbcv_conftest_target_type;
+ typedef $t rbcv_conftest_replace_type;
+ extern rbcv_conftest_target_type rbcv_conftest_var;
+ extern rbcv_conftest_replace_type rbcv_conftest_var;
+ extern rbcv_conftest_target_type rbcv_conftest_func(void);
+ extern rbcv_conftest_replace_type rbcv_conftest_func(void);
+ ], [sizeof(rbcv_conftest_target_type) == sizeof(rbcv_conftest_replace_type)])],
+ [n="$t"; break])
+ done
+ fi
+ AS_CASE([" $n "],
+ [*" long long "*], [
+ t=LL],
+ [*" long "*], [
+ t=LONG],
+ [
+ t=INT])
+ rb_cv_[$1]_convertible=${u}${t}])
+ test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
+ 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)
+ AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
+ AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
+ AC_DEFINE_UNQUOTED(PRI_[$3]_PREFIX,
+ [PRI_`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//']`_PREFIX])
+])
+RUBY_REPLACE_TYPE(pid_t, int, PIDT)
+RUBY_REPLACE_TYPE(uid_t, int, UIDT)
+RUBY_REPLACE_TYPE(gid_t, int, GIDT)
+RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
+RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
+RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
+RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [
+@%:@ifdef HAVE_SYS_TYPES_H
+@%:@include <sys/types.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TYPES_H
+@%:@include <sys/time.h>
+@%:@endif
+@%:@include <sys/resource.h>
+])
+RUBY_REPLACE_TYPE(off_t, [], OFFT)
+RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID)
+
+AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
+ [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
+ rb_cv_have_prototypes=yes,
+ rb_cv_have_prototypes=no)])
+if test "$rb_cv_have_prototypes" = yes; then
+ AC_DEFINE(HAVE_PROTOTYPES)
+fi
+
+AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
+ [AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
+ [int xy = 1; return paste(x,y);],
+ rb_cv_tokenpaste=ansi,
+ rb_cv_tokenpaste=knr)])
+if test "$rb_cv_tokenpaste" = ansi; then
+ AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
+else
+ AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
+fi
+
+AC_CACHE_CHECK(stringization, rb_cv_stringization, [
+ rb_cv_stringization=no
+ for string in "#expr" '"expr"'; do
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+#define STRINGIZE0(expr) $string
+#define STRINGIZE(expr) STRINGIZE0(expr)
+#undef real_test_for_stringization
+#define test_for_stringization -.real_test_for_stringization.-
+const char stringized[[]] = STRINGIZE(test_for_stringization);
+], [sizeof(stringized) == 32])],
+ [rb_cv_stringization="$string"; break],
+ [rb_cv_stringization=no])
+ done]
+)
+AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
+if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
+ AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
+ AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
+fi
+
+AC_CACHE_CHECK([string literal concatenation],
+ rb_cv_string_literal_concatenation, [
+ AC_COMPILE_IFELSE([
+ AC_LANG_BOOL_COMPILE_TRY([
+const char concatenated_literal[[]] = "literals" "to"
+ "be" "concatenated.";
+], [sizeof(concatenated_literal) == 26])],
+ [rb_cv_string_literal_concatenation=yes],
+ [rb_cv_string_literal_concatenation=no])]
+)
+if test "$rb_cv_string_literal_concatenation" = no; then
+ AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
+fi
+
+AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
+ [AC_TRY_COMPILE([
+#include <stdarg.h>
+int foo(int x, ...) {
+ va_list va;
+ va_start(va, x);
+ va_arg(va, int);
+ va_arg(va, char *);
+ va_arg(va, double);
+ return 0;
+}
+], [return foo(10, "", 3.14);],
+ rb_cv_stdarg=yes,
+ rb_cv_stdarg=no)])
+if test "$rb_cv_stdarg" = yes; then
+ AC_DEFINE(HAVE_STDARG_PROTOTYPES)
+fi
+
+AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
+ [AC_TRY_COMPILE([
+int foo(int x, ...);
+@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)
+], [FOO(1);FOO(1,2);FOO(1,2,3);],
+ rb_cv_va_args_macro=yes,
+ rb_cv_va_args_macro=no)])
+if test "$rb_cv_va_args_macro" = yes; then
+ AC_DEFINE(HAVE_VA_ARGS_MACRO)
+fi
+
+AC_DEFUN([RUBY_DEFINE_IF], [dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@if $1
+EOH
+])dnl
+AC_DEFINE_UNQUOTED($2, $3)dnl
+ m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
+@%:@endif /* $1 */
+EOH
+])dnl
+])dnl
+
+dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
+AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
+m4_ifval([$2], dnl
+ [AS_VAR_PUSHDEF([attrib],[$2])], dnl
+ [AS_VAR_PUSHDEF([attrib],[FUNC_]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
+)dnl
+m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])
+m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
+AC_CACHE_CHECK(for m4_ifval([$2],[$2],[$1]) function attribute, rbcv,
+[rbcv=x
+RUBY_WERROR_FLAG([
+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]
+m4_ifval([$4],${rbcv_cond+[@%:@else]}
+${rbcv_cond+[@%:@define ]attrib[(x) x]}
+${rbcv_cond+[@%:@endif]})
+ attrib[(void conftest_attribute_check(void));], [],
+ [rbcv="$mac"; break])
+done
+])])
+if test "$rbcv" != x; then
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
+fi
+m4_ifval([$4], [unset rbcv_cond]) dnl
+AS_VAR_POPDEF([attrib])dnl
+AS_VAR_POPDEF([rbcv])dnl
+])
+
+RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
+RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
+RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
+
+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("-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],
+ [rb_cv_gcc_function_alias=no
+ for a in alias weak,alias; do
+ AC_TRY_LINK([void foo(void) {}
+ void bar(void) __attribute__(($a("foo")));], [bar()],
+ [rb_cv_gcc_function_alias=$a; break])
+ done])
+ if test "$rb_cv_gcc_function_alias" != no; then
+ AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS)
+ AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
+ [type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
+ AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
+ [RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
+ fi
+
+ AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
+ AC_TRY_LINK([unsigned char atomic_var;],
+ [
+ __atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
+ __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);
+ ],
+ [rb_cv_gcc_atomic_builtins=yes],
+ [rb_cv_gcc_atomic_builtins=no])])
+ if test "$rb_cv_gcc_atomic_builtins" = yes; then
+ AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
+ fi
+
+ AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
+ AC_TRY_LINK([unsigned char atomic_var;],
+ [
+ __sync_lock_test_and_set(&atomic_var, 0);
+ __sync_lock_test_and_set(&atomic_var, 1);
+ __sync_fetch_and_add(&atomic_var, 1);
+ __sync_fetch_and_sub(&atomic_var, 1);
+ ],
+ [rb_cv_gcc_sync_builtins=yes],
+ [rb_cv_gcc_sync_builtins=no])])
+ if test "$rb_cv_gcc_sync_builtins" = yes; then
+ AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
+ fi
+
+ AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
+ [RUBY_WERROR_FLAG(
+ [AC_TRY_LINK([volatile int zero;],
+ [if (zero) __builtin_unreachable();],
+ [rb_cv_func___builtin_unreachable=yes],
+ [rb_cv_func___builtin_unreachable=no])
+ ])
+ ])
+ if test "$rb_cv_func___builtin_unreachable" = yes; then
+ AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
+ fi
+fi
+
+AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
+rb_cv_func_exported=no
+RUBY_WERROR_FLAG([
+for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
+ AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
+ RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
+ [rb_cv_func_exported="$mac"; break])
+done
+])])
+if test "$rb_cv_func_exported" != no; then
+ AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
+fi
+
+RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
+
+AC_CACHE_CHECK(for function name string predefined identifier,
+ rb_cv_function_name_string,
+ [rb_cv_function_name_string=no
+ RUBY_WERROR_FLAG([
+ for func in __func__ __FUNCTION__; do
+ AC_TRY_LINK([@%:@include <stdio.h>],
+ [puts($func);],
+ [rb_cv_function_name_string=$func
+ break])
+ done
+ ])]
+)
+if test "$rb_cv_function_name_string" != no; then
+ AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
+fi
+
+dnl Check whether we need to define sys_nerr locally
+AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
+@%:@include <errno.h>])
+
+AC_CHECK_DECLS([getenv])
+
+AS_CASE(["$target_cpu"],
+[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
+ [*::yes], # gcc
+ [CFLAGS="-mieee $CFLAGS"],
+ [osf*], # ccc
+ [CFLAGS="-ieee $CFLAGS"],
+ )],
+[sparc*], [AC_LIBOBJ([sparc])])
+
+ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
+if test "$ac_cv_header_net_socket_h" = yes; then
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
+else
+ ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
+fi
+
+
+AC_TYPE_SIZE_T
+RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [],
+ [@%:@include <sys/types.h>])
+RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
+RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
+RUBY_CHECK_PRINTF_PREFIX(size_t, z)
+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>])
+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>])
+fi
+AC_CHECK_MEMBERS([struct stat.st_atim])
+AC_CHECK_MEMBERS([struct stat.st_atimespec])
+AC_CHECK_MEMBERS([struct stat.st_atimensec])
+AC_CHECK_MEMBERS([struct stat.st_mtim])
+AC_CHECK_MEMBERS([struct stat.st_mtimespec])
+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>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
+@%:@endif])
+
+if test "${ac_cv_type_struct_timeval}" = yes; then
+ RUBY_CHECK_SIZEOF([struct timeval.tv_sec], [time_t long "long long"], [],
+ [@%:@ifdef HAVE_TIME_H
+@%:@include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
+@%:@endif])
+ AS_CASE(${ac_cv_sizeof_struct_timeval_tv_sec},
+ [SIZEOF_INT], [t=int],
+ [SIZEOF_LONG], [t=long],
+ [SIZEOF_LONG_LONG], [t=LONG_LONG],
+ [t=])
+ if test "${t}" != ""; then
+ AC_DEFINE_UNQUOTED(TYPEOF_TIMEVAL_TV_SEC, [$t])
+ fi
+fi
+
+AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
+AC_CACHE_VAL([rb_cv_large_fd_select],
+ [AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no])])
+if test "$rb_cv_large_fd_select" = yes; then
+ AC_DEFINE(HAVE_RB_FD_INIT, 1)
+fi
+
+dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
+AC_DEFUN([RUBY_DEFINT], [dnl
+AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
+typedef $1 t; int s = sizeof(t) == 42;])],
+ [rb_cv_type_$1=yes],
+ [AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
+ ["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
+ ["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
+ ["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
+ ["$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)
+ if test "${rb_cv_type_$1}" = yes; then
+ m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
+ [RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
+ else
+ AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
+ AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$rb_cv_type_$1]))
+ fi
+fi
+])
+
+RUBY_DEFINT(int8_t, 1)
+RUBY_DEFINT(uint8_t, 1, unsigned)
+RUBY_DEFINT(int16_t, 2)
+RUBY_DEFINT(uint16_t, 2, unsigned)
+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.
+
+RUBY_NACL_CHECK_PEPPER_TYPES
+
+AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
+[rb_cv_stack_end_address=no
+ AC_TRY_LINK(
+ [extern void *__libc_stack_end;],
+ [if (!__libc_stack_end) return 1;],
+ [rb_cv_stack_end_address="__libc_stack_end"])
+])
+if test $rb_cv_stack_end_address != no; then
+ AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
+fi
+
+# posix_memalign(memptr, alignment, size) implemented for OpenBSD 4.8 doesn't work if alignment > MALLOC_PAGESIZE.
+# [ruby-core:42158] https://bugs.ruby-lang.org/issues/5901
+# OpenBSD 5.2 fixed the problem. (src/lib/libc/stdlib/malloc.c:1.142)
+# MirOS #10semel has the problem but fixed in the repository. (src/lib/libc/stdlib/malloc.c:1.9)
+AS_CASE(["$target_os"],
+[openbsd*|mirbsd*], [
+ AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
+ [rb_cv_page_size_log=no
+ for page_log in 12 13; do
+ AC_TRY_RUN([
+#include <math.h>
+#include <unistd.h>
+
+int
+main() {
+ if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
+ return 0;
+}
+ ],
+ rb_cv_page_size_log="$page_log"; break)
+ done])
+ if test $rb_cv_page_size_log != no; then
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
+ else
+ AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
+ fi
+])
+
+dnl Checks for library functions.
+AC_TYPE_GETGROUPS
+AC_TYPE_SIGNAL
+AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
+[powerpc-darwin*], [
+ AC_LIBSOURCES(alloca.c)
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
+ AC_DEFINE(C_ALLOCA)
+ AC_DEFINE_UNQUOTED(alloca, alloca)
+ ],
+[universal-darwin*:*ppc*], [
+ AC_LIBSOURCES(alloca.c)
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
+ RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
+ RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
+ ],
+[
+ AC_FUNC_ALLOCA
+ ])
+if test "x$ALLOCA" = "x"; then
+ AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
+ for chk in ok __chkstk; do
+ AC_TRY_LINK([
+ @%:@ifdef HAVE_ALLOCA_H
+ @%:@include <alloca.h>
+ @%:@endif
+ void $chk() {}
+ int dynamic_alloca_test;
+ int dynamic_alloca_result;],
+ [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
+ [rb_cv_dynamic_alloca=$chk; break])
+ done])
+ if test "x$rb_cv_dynamic_alloca" = "x__chkstk"; then
+ AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
+ AS_CASE("$target_cpu",
+ [x64|x86_64], [
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
+ ],)
+ fi
+fi
+AC_FUNC_MEMCMP
+
+# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
+# Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
+# Debian GNU/Linux Lenny's libc6.1 2.7-10 has no problem.
+AC_CACHE_CHECK(for broken erfc of glibc-2.3.6 on IA64, rb_cv_broken_glibc_ia64_erfc,
+ [AC_TRY_RUN([
+#include <math.h>
+int
+main()
+{
+ erfc(10000.0);
+ return 0;
+}
+],
+ rb_cv_broken_glibc_ia64_erfc=no,
+ rb_cv_broken_glibc_ia64_erfc=yes,
+ rb_cv_broken_glibc_ia64_erfc=no)])
+AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no])
+
+AS_CASE(["$target_os"],[freebsd*],[
+ AC_DEFINE(BROKEN_CLOSE)
+ AC_REPLACE_FUNCS(close)
+ ])
+
+AC_REPLACE_FUNCS(acosh)
+AC_REPLACE_FUNCS(cbrt)
+AC_REPLACE_FUNCS(crypt)
+AC_REPLACE_FUNCS(dup2)
+AC_REPLACE_FUNCS(erf)
+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"],
+[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
+[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
+[])
+AC_CHECK_HEADERS(sys/pstat.h)
+
+
+AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
+ [AC_TRY_LINK([
+#include <math.h>
+], [int v = signbit(-0.0);],
+ rb_cv_have_signbit=yes,
+ rb_cv_have_signbit=no)])
+if test "$rb_cv_have_signbit" = yes; then
+ AC_DEFINE(HAVE_SIGNBIT)
+else
+ AC_LIBOBJ([signbit])
+fi
+
+AC_FUNC_FORK
+
+AC_CHECK_FUNCS(__syscall)
+AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
+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)
+AC_CHECK_FUNCS(endgrent)
+AC_CHECK_FUNCS(fchmod)
+AC_CHECK_FUNCS(fchown)
+AC_CHECK_FUNCS(fcntl)
+AC_CHECK_FUNCS(fdatasync)
+AC_CHECK_FUNCS(fmod)
+AC_CHECK_FUNCS(fsync)
+AC_CHECK_FUNCS(ftruncate)
+AC_CHECK_FUNCS(ftruncate64) # used for Win32 platform
+AC_CHECK_FUNCS(getcwd)
+AC_CHECK_FUNCS(getgidx)
+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)
+AC_CHECK_FUNCS(lchown)
+AC_CHECK_FUNCS(link)
+AC_CHECK_FUNCS(llabs)
+AC_CHECK_FUNCS(lockf)
+AC_CHECK_FUNCS(log2)
+AC_CHECK_FUNCS(lstat)
+AC_CHECK_FUNCS(malloc_usable_size)
+AC_CHECK_FUNCS(malloc_size)
+AC_CHECK_FUNCS(mblen)
+AC_CHECK_FUNCS(memalign)
+AC_CHECK_FUNCS(writev)
+AC_CHECK_FUNCS(memrchr)
+AC_CHECK_FUNCS(memmem)
+AC_CHECK_FUNCS(mktime)
+AC_CHECK_FUNCS(pipe2)
+AC_CHECK_FUNCS(poll)
+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(seekdir)
+AC_CHECK_FUNCS(select_large_fdset)
+AC_CHECK_FUNCS(sendfile)
+AC_CHECK_FUNCS(setegid)
+AC_CHECK_FUNCS(setenv)
+AC_CHECK_FUNCS(seteuid)
+AC_CHECK_FUNCS(setgid)
+AC_CHECK_FUNCS(setgroups)
+AC_CHECK_FUNCS(setpgid)
+AC_CHECK_FUNCS(setpgrp)
+AC_CHECK_FUNCS(setregid)
+AC_CHECK_FUNCS(setresgid)
+AC_CHECK_FUNCS(setresuid)
+AC_CHECK_FUNCS(setreuid)
+AC_CHECK_FUNCS(setrgid)
+AC_CHECK_FUNCS(setrlimit)
+AC_CHECK_FUNCS(setruid)
+AC_CHECK_FUNCS(setsid)
+AC_CHECK_FUNCS(setuid)
+AC_CHECK_FUNCS(shutdown)
+AC_CHECK_FUNCS(sigaction)
+AC_CHECK_FUNCS(sigaltstack)
+AC_CHECK_FUNCS(sigprocmask)
+AC_CHECK_FUNCS(sinh)
+AC_CHECK_FUNCS(spawnv)
+AC_CHECK_FUNCS(symlink)
+AC_CHECK_FUNCS(syscall)
+AC_CHECK_FUNCS(sysconf)
+AC_CHECK_FUNCS(tanh)
+AC_CHECK_FUNCS(telldir)
+AC_CHECK_FUNCS(timegm)
+AC_CHECK_FUNCS(times)
+AC_CHECK_FUNCS(truncate)
+AC_CHECK_FUNCS(truncate64) # used for Win32
+AC_CHECK_FUNCS(unsetenv)
+AC_CHECK_FUNCS(utimensat)
+AC_CHECK_FUNCS(utimes)
+AC_CHECK_FUNCS(wait4)
+AC_CHECK_FUNCS(waitpid)
+
+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;])],
+ [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
+ AC_DEFINE(AS_TR_CPP(HAVE_BUILTIN_$1))
+fi])
+RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap16, [__builtin_bswap16(0)])
+RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap32, [__builtin_bswap32(0)])
+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_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)
+ ])
+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)])
+
+# 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.
+ # http://sourceware.org/ml/libc-announce/2012/msg00001.html
+ AC_CHECK_LIB(rt, clock_gettime)
+ if test x"$ac_cv_lib_rt_clock_gettime" = xyes; then
+ AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
+ fi
+fi
+AC_CHECK_FUNCS(clock_getres) # clock_getres should be tested after clock_gettime test including librt test.
+
+AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
+ [AC_TRY_COMPILE([
+#include <stdlib.h>
+], [int v = unsetenv("foo");],
+ rb_cv_unsetenv_return_value=yes,
+ rb_cv_unsetenv_return_value=no)])
+if test "$rb_cv_unsetenv_return_value" = no; then
+ AC_DEFINE(VOID_UNSETENV)
+fi
+
+# used for AC_ARG_WITH(setjmp-type)
+AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp,
+ [AC_TRY_COMPILE([
+#include <setjmp.h>
+], [sigjmp_buf env; sigsetjmp(env,1);],
+ 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_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,
+ AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
+ [
+ AS_CASE([$withval],
+ [__builtin_setjmp], [setjmp=__builtin_setjmp],
+ [_setjmp], [ setjmp_prefix=_],
+ [sigsetjmp], [ setjmp_prefix=sig],
+ [setjmp], [ setjmp_prefix=],
+ [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 { 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
+ setjmp_prefix=
+ setjmp_suffix=ex
+elif test "$ac_cv_func__setjmp" = yes; then
+ setjmp_prefix=_
+ setjmp_suffix=
+elif test "$ac_cv_func_sigsetjmp" = yes; then
+ AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
+ setjmp_suffix=
+else
+ setjmp_prefix=
+ setjmp_suffix=
+fi
+if test x$setjmp_prefix = xsig; then
+ setjmp_sigmask=yes
+else
+ unset setjmp_sigmask
+fi
+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,
+ AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
+ [use_setreuid=$enableval])
+if test "$use_setreuid" = yes; then
+ AC_DEFINE(USE_SETREUID)
+ AC_DEFINE(USE_SETREGID)
+fi
+AC_STRUCT_TIMEZONE
+AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
+ [AC_TRY_COMPILE([@%:@include <time.h>],
+ [struct tm t; t.tm_gmtoff = 3600;],
+ [rb_cv_member_struct_tm_tm_gmtoff=yes],
+ [rb_cv_member_struct_tm_tm_gmtoff=no])])
+if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
+ AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
+fi
+AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
+ [AC_TRY_LINK([#include <time.h>
+ int i;],
+ [i = daylight;],
+ rb_cv_have_daylight=yes,
+ rb_cv_have_daylight=no)])
+if test "$rb_cv_have_daylight" = yes; then
+ AC_DEFINE(HAVE_DAYLIGHT)
+fi
+AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
+AC_CACHE_CHECK([for external $1], AS_TR_SH(rb_cv_var_$1),
+ [AS_TR_SH(rb_cv_var_$1)=no
+ AC_TRY_COMPILE([
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+$2
+;
+const volatile void *volatile t;],
+ [t = &(&$1)[0];],
+ [for t in $3; do
+ AC_TRY_COMPILE([
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+$2
+;
+extern $t $1;
+const volatile void *volatile t;],
+ [t = &(&$1)[0];],
+ [AS_TR_SH(rb_cv_var_$1)=$t; break])
+ done])])
+if test "${AS_TR_SH(rb_cv_var_$1)}" != no; then
+ AC_DEFINE(AS_TR_CPP(HAVE_VAR_$1))
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(TYPEOF_VAR_$1), ${AS_TR_SH(rb_cv_var_$1)})
+fi])
+RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
+RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
+AC_CHECK_FUNCS(timezone)
+if test "$ac_cv_func_timezone" = yes; then
+ AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
+ [AC_TRY_COMPILE([@%:@include <time.h>],
+ [(void)timezone(0, 0);],
+ [rb_cv_func_timezone_void=no],
+ [rb_cv_func_timezone_void=yes])]
+ )
+ if test $rb_cv_func_timezone_void = yes; then
+ AC_DEFINE(TIMEZONE_VOID)
+ fi
+fi
+
+AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
+ [AC_TRY_RUN([
+#include <stdlib.h>
+#include <time.h>
+
+void
+check(tm, y, m, d, h, s)
+ struct tm *tm;
+ int y, m, d, h, s;
+{
+ if (!tm ||
+ tm->tm_year != y ||
+ tm->tm_mon != m-1 ||
+ tm->tm_mday != d ||
+ tm->tm_hour != h ||
+ tm->tm_sec != s) {
+ exit(1);
+ }
+}
+
+int
+main()
+{
+ time_t t = -1;
+ struct tm *tm;
+
+ check(gmtime(&t), 69, 12, 31, 23, 59);
+ t = ~(time_t)0 << 31;
+ check(gmtime(&t), 1, 12, 13, 20, 52);
+ return 0;
+}
+],
+ rb_cv_negative_time_t=yes,
+ rb_cv_negative_time_t=no,
+ rb_cv_negative_time_t=yes)])
+if test "$rb_cv_negative_time_t" = yes; then
+ AC_DEFINE(NEGATIVE_TIME_T)
+fi
+
+# [ruby-dev:40910] overflow of time on FreeBSD
+# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
+AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
+ [AC_TRY_RUN([
+#include <stdlib.h>
+#include <time.h>
+
+void
+check(time_t t1)
+{
+ struct tm *tm;
+ time_t t2;
+ tm = localtime(&t1);
+ if (!tm)
+ return; /* overflow detected. ok. */
+ t2 = mktime(tm);
+ if (t1 == t2)
+ return; /* round-trip. ok. */
+ exit(1);
+}
+
+int
+main()
+{
+ time_t t;
+ if (~(time_t)0 <= 0) {
+ t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
+ t |= t - 1;
+ }
+ else {
+ t = ~(time_t)0;
+ }
+ check(t);
+ return 0;
+}
+],
+ rb_cv_localtime_overflow=yes,
+ rb_cv_localtime_overflow=no,
+ rb_cv_localtime_overflow=no)])
+if test "$rb_cv_localtime_overflow" = no; then
+ AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
+fi
+
+if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
+ AC_DEFINE(POSIX_SIGNAL)
+else
+ AC_CHECK_FUNCS(sigsetmask)
+ AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
+ [AC_TRY_RUN([
+#include <stdio.h>
+#include <signal.h>
+
+void
+sig_handler(dummy)
+ int dummy;
+{
+}
+
+int
+main()
+{
+ signal(SIGINT, sig_handler);
+ kill(getpid(), SIGINT);
+ kill(getpid(), SIGINT);
+ return 0;
+}
+],
+ rb_cv_bsd_signal=yes,
+ rb_cv_bsd_signal=no,
+ rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
+ if test "$rb_cv_bsd_signal" = yes; then
+ AC_DEFINE(BSD_SIGNAL)
+ fi
+fi
+
+if test "$ac_cv_func_getpgid" = no; then
+ # AC_FUNC_GETPGRP fails when cross-compiling with old autoconf.
+ # autoconf is changed between 2.52d and 2.52f?
+ # http://lists.gnu.org/archive/html/bug-gnu-utils/2001-09/msg00181.html
+ # "autoconf cleanup for AC_FUNC_GETPGRP and GETPGRP_VOID"
+AC_FUNC_GETPGRP
+fi
+if test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes; then
+ # AC_FUNC_SETPGRP fails when cross-compiling. (until autoconf 2.69?)
+ # https://lists.gnu.org/archive/html/bug-autoconf/2013-02/msg00002.html
+ # "AC_FUNC_SETPGRP fails to work properly when cross-compiling"
+AC_FUNC_SETPGRP
+fi
+
+if test x"$target_cpu" = xia64; then
+ AC_LIBOBJ([ia64])
+ AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
+ rb_cv___libc_ia64_register_backing_store_base,
+ [rb_cv___libc_ia64_register_backing_store_base=no
+ AC_TRY_LINK(
+ [extern unsigned long __libc_ia64_register_backing_store_base;],
+ [unsigned long p = __libc_ia64_register_backing_store_base;
+ printf("%ld\n", p);],
+ [rb_cv___libc_ia64_register_backing_store_base=yes])])
+ if test $rb_cv___libc_ia64_register_backing_store_base = yes; then
+ AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
+ fi
+fi
+
+AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
+ [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
+ rb_cv_rshift_sign=yes,
+ rb_cv_rshift_sign=no)])
+if test "$rb_cv_rshift_sign" = yes; then
+ AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
+else
+ AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
+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),
+ [AC_TRY_COMPILE([#include <unistd.h>
+ ],
+ [_SC_$1 >= 0],
+ rb_cv_have_sc_[]m4_tolower($1)=yes,
+ rb_cv_have_sc_[]m4_tolower($1)=no)
+ ])
+ if test "$rb_cv_have_sc_[]m4_tolower($1)" = yes; then
+ AC_DEFINE(HAVE__SC_$1)
+ fi
+ ])
+ RUBY_CHECK_SYSCONF(CLK_TCK)
+fi
+
+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"],
+[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
+[hppa*], [ $2=+1],
+[
+ AC_TRY_RUN([
+/* recurse to get rid of inlining */
+static int
+stack_growup_p(addr, n)
+ volatile int *addr, n;
+{
+ volatile int end;
+ if (n > 0)
+ return *addr = stack_growup_p(addr, n - 1);
+ else
+ return (&end > addr);
+}
+int main()
+{
+ int x;
+ return stack_growup_p(&x, 10);
+}
+], $2=-1, $2=+1, $2=0)
+ ])
+eval stack_grow_dir=\$$2])
+eval $2=\$stack_grow_dir
+AS_VAR_POPDEF([stack_grow_dir])])
+if test "${universal_binary-no}" = yes ; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
+ stack_dir=
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ CFLAGS="$new_cflags -arch $archs"
+ LDFLAGS="$new_ldflags -arch $archs"
+ RUBY_STACK_GROW_DIRECTION($archs, dir)
+ if test x$stack_dir = x; then
+ stack_dir=$dir
+ elif test x$stack_dir != x$dir; then
+ stack_dir=no
+ fi
+ done
+ CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
+ if test x$stack_dir = xno; then
+ for archs in ${universal_archnames}; do
+ archs=`echo $archs | sed 's/=.*//'`
+ eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
+ RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
+ done
+ else
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
+ fi
+else
+ RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
+ AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
+fi
+
+if test x"$enable_pthread" = xyes; then
+ for pthread_lib in thr pthread pthreads c c_r root; do
+ AC_CHECK_LIB($pthread_lib, pthread_kill,
+ rb_with_pthread=yes, rb_with_pthread=no)
+ if test "$rb_with_pthread" = "yes"; then break; fi
+ done
+ if test x"$rb_with_pthread" = xyes; then
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ AC_DEFINE(HAVE_LIBPTHREAD)
+ AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
+ AS_CASE([$pthread_lib],
+ [c], [],
+ [root], [],
+ [c_r], [MAINLIBS="-pthread $MAINLIBS"],
+ [AS_CASE(["$target_os"],
+ [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
+ [LIBS="-l$pthread_lib $LIBS"])])
+ else
+ AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
+ fi
+ 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_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_setname_np)
+ if test "${host_os}" = "nacl"; then
+ ac_cv_func_pthread_attr_init=no
+ else
+ AC_CHECK_FUNCS(pthread_attr_init)
+ fi
+ 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
+ AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), pthread_setname_np${rb_cv_func_pthread_setname_np_arguments})
+ else
+ AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), (void)0)
+ fi
+ fi
+fi
+if test x"$ac_cv_header_ucontext_h" = xyes; then
+ if test x"$rb_with_pthread" = xyes; then
+ AC_CHECK_FUNCS(getcontext setcontext)
+ fi
+fi
+
+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>
+#include <unistd.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+void *
+thread_func(void *dmy)
+{
+ return dmy;
+}
+
+int
+use_threads(void)
+{
+ pthread_t tid;
+ if (pthread_create(&tid, 0, thread_func, 0) != 0) {
+ return -1;
+ }
+ if (pthread_join(tid, 0) != 0) {
+ return -1;
+ }
+ return 0;
+}
+
+int
+main(int argc, char *argv[])
+{
+ pid_t pid;
+ if (use_threads()) return EXIT_FAILURE;
+ pid = fork();
+
+ if (pid) {
+ int loc;
+ sleep(1);
+ if (waitpid(pid, &loc, WNOHANG) == 0) {
+ kill(pid, SIGKILL);
+ return EXIT_FAILURE;
+ }
+ if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
+ return EXIT_FAILURE;
+ }
+ else {
+ if (use_threads()) return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}],
+ rb_cv_fork_with_pthread=yes,
+ rb_cv_fork_with_pthread=no,
+ rb_cv_fork_with_pthread=yes)])
+ test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
+fi
+
+
+}
+{ # runtime section
+
+dnl wheather use dln_a_out or not
+AC_ARG_WITH(dln-a-out,
+ AS_HELP_STRING([--with-dln-a-out], [use dln_a_out if possible]),
+ [
+ AS_CASE([$withval],
+ [yes], [
+ if test "$enable_shared" = yes; then
+ AC_MSG_ERROR(dln_a_out can not make shared library)
+ fi
+ with_dln_a_out=yes],
+ [
+ with_dln_a_out=no])], [with_dln_a_out=no])
+
+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])],
+rb_cv_binary_elf=no)])
+
+if test "$rb_cv_binary_elf" = yes; then
+ AC_DEFINE(USE_ELF)
+ if test "$with_dln_a_out" = yes; then
+ AC_MSG_ERROR(dln_a_out does not work with ELF)
+ fi
+ AC_CHECK_HEADERS([elf.h elf_abi.h])
+ if test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes; then
+ AC_LIBOBJ([addr2line])
+ fi
+fi
+
+AS_CASE(["$target_os"],
+[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu | nacl], [
+ if test "$rb_cv_binary_elf" = no; then
+ with_dln_a_out=yes
+ else
+ LDFLAGS="$LDFLAGS -rdynamic"
+ fi])
+LIBEXT=a
+
+AC_SUBST(DLDFLAGS)dnl
+AC_SUBST(ARCH_FLAG)dnl
+
+AC_SUBST(STATIC)dnl
+AC_SUBST(CCDLFLAGS)dnl
+AC_SUBST(LDSHARED)dnl
+AC_SUBST(LDSHAREDXX)dnl
+AC_SUBST(DLEXT)dnl
+AC_SUBST(DLEXT2)dnl
+AC_SUBST(LIBEXT)dnl
+
+STATIC=
+: ${PATHFLAG=''}
+
+if test "$with_dln_a_out" != yes; then
+ rb_cv_dlopen=unknown
+ AC_MSG_CHECKING(whether OS depend dynamic link works)
+ if test "$GCC" = yes; then
+ AS_CASE(["$target_os"],
+ [darwin*], [
+ # The -fno-common is needed if we wish to embed the Ruby interpreter
+ # into a plugin module of some project (as opposed to embedding it
+ # within the project's application). The -I/usr/local/include is
+ # needed because CPP as discovered by configure (cc -E -traditional)
+ # fails to consult /usr/local/include by default. This causes
+ # 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*], [ ],
+ [
+ RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
+ else
+ AS_CASE(["$target_os"],
+ [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"],
+ [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
+ [esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
+ [: ${CCDLFLAGS=""}])
+ fi
+
+
+ AC_ARG_ENABLE(rpath,
+ 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"])
+
+ 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
+ : ${LDSHARED='$(CC) -shared'}
+ if test "$rb_cv_prog_gnu_ld" = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ fi
+ else
+ : ${LDSHARED='$(CC) -G'}
+ fi
+ if test "$ac_cv_sizeof_voidp" = 8; then
+ : ${LIBPATHENV=LD_LIBRARY_PATH_64}
+ fi
+ rb_cv_dlopen=yes],
+ [sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
+ rb_cv_dlopen=yes],
+ [irix*], [ : ${LDSHARED='$(LD) -shared'}
+ rb_cv_dlopen=yes],
+ [sysv4*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
+ rb_cv_dlopen=yes],
+ [esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
+ rb_cv_dlopen=yes],
+ [osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
+ rb_cv_dlopen=yes],
+ [bsdi3*], [ AS_CASE(["$CC"],
+ [*shlicc*], [ : ${LDSHARED='$(CC) -r'}
+ rb_cv_dlopen=yes])],
+ [linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [
+ : ${LDSHARED='$(CC) -shared'}
+ if test "$rb_cv_binary_elf" = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
+ fi
+ rb_cv_dlopen=yes],
+ [interix*], [ : ${LDSHARED='$(CC) -shared'}
+ XLDFLAGS="$XLDFLAGS -Wl,-E"
+ LIBPATHFLAG=" -L%1\$-s"
+ rb_cv_dlopen=yes],
+ [freebsd*|dragonfly*], [
+ : ${LDSHARED='$(CC) -shared'}
+ if test "$rb_cv_binary_elf" = yes; then
+ LDFLAGS="$LDFLAGS -rdynamic"
+ DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
+ else
+ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
+ fi
+ rb_cv_dlopen=yes],
+ [openbsd*|mirbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
+ if test "$rb_cv_binary_elf" = yes; then
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ fi
+ rb_cv_dlopen=yes],
+ [darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
+ : ${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
+ rb_cv_dlopen=yes],
+ [aix*], [ : ${LDSHARED='$(CC)'}
+ LDSHARED="$LDSHARED ${linker_flag}-G"
+ EXTDLDFLAGS='-e$(TARGET_ENTRY)'
+ XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
+ XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
+ : ${ARCHFILE="ruby.imp"}
+ TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
+ TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
+ : ${LIBPATHENV=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"
+ rb_cv_dlopen=yes],
+ [cygwin*|mingw*], [
+ : ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'}
+ XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
+ : ${LIBPATHENV=""}
+ 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)'}])
+ 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}${flag// /,}"
+ RUBY_TRY_LDFLAGS([$flag], [], [flag=])
+ if test "x$flag" != x; then
+ RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
+ fi
+ done
+ ])
+ fi
+
+ if test "$enable_rpath" = yes; then
+ if test x"${RPATHFLAG}" = x; then
+ 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=])
+ if test "x${rpathflag}" != x; then
+ RPATHFLAG=" ${rpathflag}%1\$-s"
+ break
+ fi
+ done
+ fi
+ fi
+fi
+if test "${LDSHAREDXX}" = ""; then
+ AS_CASE(["${LDSHARED}"],
+ [*'$(CC)'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
+ ],
+ [*'${CC}'*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
+ ],
+ [*$CC*], [
+ LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
+ ],
+ [ld" "*], [
+ ])
+fi
+AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
+
+AC_SUBST(LINK_SO)
+AC_SUBST(LIBPATHFLAG)
+AC_SUBST(RPATHFLAG)
+AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
+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' ' '`
+ test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS "
+ LDFLAGS="$LDFLAGS$val"
+ test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS "
+ DLDFLAGS="$DLDFLAGS$val"
+ LDFLAGS_OPTDIR="$val"
+fi
+
+AS_CASE(["$target_os"],
+[freebsd*], [
+ AC_CHECK_LIB([procstat], [procstat_open_sysctl])
+ ])
+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])
+ fi],
+[*-freebsd*|x86_64-netbsd*], [
+ AC_CHECK_HEADERS([execinfo.h])
+ if test "x$ac_cv_header_execinfo_h" = xyes; then
+ AC_CHECK_LIB([execinfo], [backtrace])
+ AC_CHECK_LIB([unwind], [unw_backtrace])
+ fi])
+AC_CHECK_FUNCS(backtrace)
+
+if test "x$ac_cv_func_backtrace" = xyes; then
+ AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace,
+ [AC_TRY_RUN([
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <signal.h>
+#include <execinfo.h>
+
+#define TRACE_SIZE 256
+
+void sigsegv(int signum, siginfo_t *info, void *ctx){
+ void *trace[TRACE_SIZE];
+ int n = backtrace(trace, TRACE_SIZE);
+ if (n > 0) {
+ /*fprintf(stdout, "backtrace:%d\n",n);*/
+ } else {
+ _exit(EXIT_FAILURE);
+ }
+ _exit(EXIT_SUCCESS);
+}
+int
+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");
+ return EXIT_FAILURE;
+ }
+ ss.ss_size = SIGSTKSZ;
+ ss.ss_flags = 0;
+ if (sigaltstack(&ss, NULL) == -1) {
+ fprintf(stderr, "sigaltstack failed\n");
+ return EXIT_FAILURE;
+ }
+ struct sigaction sa;
+ memset(&sa, 0, sizeof(struct sigaction));
+ sigemptyset(&sa.sa_mask);
+ sa.sa_sigaction = sigsegv;
+ sa.sa_flags |= SA_SIGINFO;
+ sa.sa_flags |= SA_ONSTACK;
+ sigaction(SIGSEGV, &sa, NULL);
+ a[0] = 1;
+ return EXIT_SUCCESS;
+}
+],
+ rb_cv_broken_backtrace=no,
+ rb_cv_broken_backtrace=yes,
+ rb_cv_broken_backtrace=no)])
+ if test "$rb_cv_broken_backtrace" = yes; then
+ AC_DEFINE(BROKEN_BACKTRACE, 1)
+ fi
+fi
+
+AC_ARG_WITH(valgrind,
+ AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
+ [], with_valgrind=yes)
+AS_IF([test x$with_valgrind != xno],
+ [AC_CHECK_HEADERS(valgrind/memcheck.h)])
+
+dln_a_out_works=no
+if test "$ac_cv_header_a_out_h" = yes; then
+ if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
+ cat confdefs.h > config.h
+ AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
+ [AC_TRY_COMPILE([
+#define USE_DLN_A_OUT
+#include "dln.c"
+],
+ [],
+ rb_cv_dln_a_out=yes,
+ rb_cv_dln_a_out=no)])
+ if test "$rb_cv_dln_a_out" = yes; then
+ dln_a_out_works=yes
+ AC_DEFINE(USE_DLN_A_OUT)
+ fi
+ fi
+fi
+
+if test "$dln_a_out_works" = yes; then
+ if test "$GCC" = yes; then
+ STATIC=-static
+ else
+ STATIC=-Bstatic
+ fi
+ DLEXT=so
+ CCDLFLAGS=
+else
+ AS_CASE(["$target_os"],
+ [hpux*], [
+ DLEXT=sl],
+ [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],
+ [
+ DLEXT=so])
+fi
+if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
+ if test "$ac_cv_func_dladdr" = yes; then
+ LOAD_RELATIVE=1
+ fi
+fi
+if test x"$LOAD_RELATIVE" = x1; then
+ load_relative=yes
+else
+ unset load_relative
+fi
+
+len=2 # .rb
+n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
+n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
+AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
+test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
+test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
+AC_SUBST(DLEXT)
+
+if test "$with_dln_a_out" = yes; then
+ STRIP=true
+else
+ AC_CHECK_TOOL(STRIP, strip, :)dnl
+fi
+
+AS_CASE(["$target_os"],
+ [linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
+ STRIP="$STRIP -S -x"],
+ [darwin*], [
+ STRIP="$STRIP -A -n"])
+
+AC_ARG_WITH(ext,
+ AC_HELP_STRING([--with-ext=EXTS],
+ [pass to --with-ext option of extmk.rb]))
+AC_ARG_WITH(out-ext,
+ AC_HELP_STRING([--with-out-ext=EXTS],
+ [pass to --without-ext option of extmk.rb]))
+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],[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)
+ AC_SUBST(ENCSTATIC, static)
+])
+AC_SUBST(ENCOBJS)
+AC_SUBST(EXTOBJS)
+
+if test -f "$srcdir/ext/Setup.$target_os"; then
+ setup="Setup.$target_os"
+else
+ setup=
+ for file in "$srcdir"/ext/Setup.*; do
+ AS_CASE(["$file"], [*~|*.bak|*.orig|*.rej|*.tmp], [continue])
+ setup=`basename "$file"`
+ AS_CASE(["$target_os"], [`expr "$setup" : 'Setup.\(.*\)'`*], [break])
+ platform=`sed '/^option *platform */!d;s///;s/|/*|/g;q' "$file"`
+ if test "x$platform" != x; then
+ eval "AS_CASE([\"\$target_os\"], [$platform*], [break])"
+ fi
+ setup=
+ done
+ : ${setup:=Setup}
+fi
+AC_SUBST(setup)
+
+rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
+AC_ARG_WITH(rubylibprefix,
+ AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
+ [if test "x$withval" = xno; then
+ AC_MSG_ERROR([No ruby, No libprefix])
+ fi
+ rubylibprefix="$withval"])
+AC_SUBST(rubylibprefix)
+
+if test x"${exec_prefix}" != xNONE; then
+ RUBY_EXEC_PREFIX="$exec_prefix"
+elif test x"$prefix" != xNONE; then
+ RUBY_EXEC_PREFIX="$prefix"
+else
+ RUBY_EXEC_PREFIX=$ac_default_prefix
+fi
+pat=`echo "${RUBY_EXEC_PREFIX}" | tr -c '\012' .`'\(.*\)'
+for var in bindir libdir rubylibprefix; do
+ eval val='"$'$var'"'
+ AS_CASE(["$val"], ["${RUBY_EXEC_PREFIX}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
+ eval $var='"$val"'
+done
+
+BTESTRUBY='$(MINIRUBY)'
+if test x"$cross_compiling" = xyes; then
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
+ XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
+ XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
+ XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
+ AC_SUBST(XRUBY_LIBDIR)
+ AC_SUBST(XRUBY_RUBYLIBDIR)
+ AC_SUBST(XRUBY_RUBYHDRDIR)
+ PREP='$(arch)-fake.rb'
+ RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
+ RUNRUBY='$(RUNRUBY_COMMAND)'
+ XRUBY='$(MINIRUBY)'
+ TEST_RUNNABLE=no
+ CROSS_COMPILING=yes
+
+ if test "$host_os" = "nacl"; then
+ if test "$build_cpu" = "$host_cpu" || test "${nacl_cv_cpu_nick}" = "x86" -a "$host_cpu" = "i686"; then
+ nacl_cv_sel_ldr='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb sel_ldr`'
+ nacl_cv_irt_core='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb irt_core`'
+ nacl_cv_runnable_ld='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb runnable_ld`'
+ nacl_cv_host_lib='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb host_lib`'
+ TEST_RUNNABLE=yes
+ BTESTRUBY="${nacl_cv_sel_ldr} -a -B ${nacl_cv_irt_core} -w 1:3 -w 2:4"
+ BTESTRUBY="$BTESTRUBY -- ${nacl_cv_runnable_ld} --library-path ${nacl_cv_host_lib}"
+ BTESTRUBY="$BTESTRUBY `pwd`/"'miniruby$(EXEEXT) -I`cd $(srcdir)/lib; pwd` -I.'
+ BTESTRUBY="$BTESTRUBY"' -I$(EXTOUT)/common 3>&1 4>&2 1>/dev/null 2>/dev/null '
+ fi
+ fi
+else
+ MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
+ MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
+ PREP='miniruby$(EXEEXT)'
+ RUNRUBY_COMMAND='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
+ RUNRUBY='$(RUNRUBY_COMMAND) --'
+ XRUBY='$(RUNRUBY)'
+ TEST_RUNNABLE=yes
+ CROSS_COMPILING=no
+fi
+AC_SUBST(TEST_RUNNABLE)
+AC_SUBST(CROSS_COMPILING)
+AC_SUBST(MINIRUBY)
+AC_SUBST(BTESTRUBY)
+AC_SUBST(PREP)
+AC_SUBST(RUNRUBY_COMMAND)
+AC_SUBST(RUNRUBY)
+AC_SUBST(XRUBY)
+AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
+
+FIRSTMAKEFILE=""
+LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
+LIBRUBY='$(LIBRUBY_A)'
+LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
+LIBRUBYARG='$(LIBRUBYARG_STATIC)'
+SOLIBS=
+
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
+ : ${DLDLIBS=""}
+ ],
+ [
+ DLDLIBS="$DLDLIBS -lc"
+ ])
+
+AC_ARG_ENABLE(multiarch,
+ AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
+ [multiarch=], [unset multiarch])
+if test ${multiarch+set}; then
+ AC_DEFINE(ENABLE_MULTIARCH)
+fi
+
+archlibdir='${libdir}/${arch}'
+sitearchlibdir='${libdir}/${sitearch}'
+archincludedir='${includedir}/${arch}'
+sitearchincludedir='${includedir}/${sitearch}'
+
+AC_ARG_WITH(soname,
+ AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
+ [RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
+
+LIBRUBY_LDSHARED=$LDSHARED
+LIBRUBY_DLDFLAGS=$DLDFLAGS
+LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
+LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
+ENABLE_SHARED=no
+
+AC_ARG_ENABLE(shared,
+ AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
+ [enable_shared=$enableval])
+libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
+LIBRUBY_RELATIVE=${load_relative-no}
+AS_CASE("$enable_shared", [yes], [
+ LIBRUBY='$(LIBRUBY_SO)'
+ LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
+ LIBRUBYARG='$(LIBRUBYARG_SHARED)'
+ LIBRUBY_RELATIVE=no
+ test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
+ ENABLE_SHARED=yes
+ if test "$rb_cv_binary_elf" = yes; then
+ SOLIBS='$(LIBS)'
+ fi
+
+ # libdir can be overridden in config.site file (on OpenSUSE at least).
+ libdir_basename=lib
+ if test "$bindir" = '${exec_prefix}/bin'; then
+ AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
+ fi
+ AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
+ libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}
+
+ AS_CASE(["$target_os"],
+ [freebsd*|dragonfly*], [],
+ [
+ if test "$GCC" = yes; then
+ RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
+ if test "no_undefined" = yes; then
+ RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
+ fi
+ fi
+ ])
+
+ AS_CASE(["$target_os"],
+ [sunos4*], [
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
+ ],
+ [linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
+ 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
+ libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
+ LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
+ LIBRUBY_RELATIVE=yes
+ fi
+ ],
+ [freebsd*|dragonfly*], [
+ SOLIBS='$(LIBS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
+ if test "$rb_cv_binary_elf" != "yes" ; then
+ LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
+ LIBRUBY_ALIASES=''
+ fi
+ ],
+ [netbsd*], [
+ SOLIBS='$(LIBS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'" $LDFLAGS_OPTDIR"
+ if test "$rb_cv_binary_elf" = yes; then # ELF platforms
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
+ else # a.out platforms
+ LIBRUBY_ALIASES=""
+ fi
+ ],
+ [openbsd*|mirbsd*], [
+ SOLIBS='$(LIBS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
+ ],
+ [solaris*], [
+ SOLIBS='$(LIBS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
+ if test "$GCC" = yes; then
+ LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
+ else
+ LIBRUBY_DLDFLAGS="$DLDFLAGS "'-h $(@F)'
+ fi
+ XLDFLAGS="$XLDFLAGS "'-R${libdir}'
+ ],
+ [hpux*], [
+ XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
+ ],
+ [aix*], [
+ LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS $LDFLAGS_OPTDIR"
+ 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'
+ if test "$load_relative" = yes; then
+ libprefix="@executable_path/../${libdir_basename}"
+ 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)'
+ if test "$visibility_option" = ld; then
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
+ fi
+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
+ LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
+ SOLIBS='$(LIBS)'
+ ],
+ [interix*], [
+ LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
+ ],
+ [mingw*|cygwin*|mswin*], [
+ LIBRUBY_RELATIVE=yes
+ ])
+], [
+ LIBRUBYARG_SHARED=
+
+ # enable PIE if possible
+ 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
+ ])
+ if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
+ RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
+ if test "$pie" = yes; then
+ # Use -fPIE when testing -pie. RUBY_TRY_LDFLAGS sets
+ # $save_CFLAGS internally, so set other name here.
+ save_CFLAGS_before_pie="$CFLAGS"
+ CFLAGS="$CFLAGS -fPIE"
+
+ # gcc need -pie but clang need -Wl,-pie.
+ for pie in -pie -Wl,-pie; do
+ RUBY_TRY_LDFLAGS([$pie], [], [pie=])
+ if test "x$pie" != x; then
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
+ RUBY_APPEND_OPTION(XLDFLAGS, $pie)
+ break
+ fi
+ done
+ CFLAGS="$save_CFLAGS_before_pie"
+ fi
+ fi
+])
+if test "$enable_rpath" = yes; then
+ test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
+ 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
+AC_SUBST(LIBRUBY_RELATIVE)
+
+LDFLAGS="-L. $LDFLAGS"
+AC_SUBST(ARCHFILE)
+
+if test "$EXEEXT" = .exe; then
+ EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
+ AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
+ EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
+ AC_SUBST(EXECUTABLE_EXTS)
+fi
+
+AC_ARG_ENABLE(dtrace,
+ AS_HELP_STRING([--enable-dtrace],
+ [enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
+ [enable_dtrace=$enableval], [enable_dtrace=auto])
+
+if test "${enable_dtrace}" = "auto"; then
+ if test x"$DTRACE" != x -a x"$cross_compiling" != xyes; then
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ else
+ enable_dtrace=no
+ fi
+fi
+
+LIBRUBY_A_OBJS='$(OBJS)'
+if test "${enable_dtrace}" = "yes"; then
+ if test -z "$DTRACE"; then
+ AC_MSG_ERROR([dtrace(1) is missing])
+ elif test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
+ else
+ RUBY_DTRACE_AVAILABLE()
+ enable_dtrace=$rb_cv_dtrace_available
+ if test "${enable_dtrace}" = "no"; then
+ AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
+ fi
+ RUBY_DTRACE_POSTPROCESS()
+ if test "$rb_cv_prog_dtrace_g" = 'yes'; then
+ DTRACE_OBJ='probes.$(OBJEXT)'
+ DTRACE_GLOMMED_OBJ='ruby-glommed.$(OBJEXT)'
+ LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
+ fi
+ AS_CASE("${target_os}", [freebsd*], [
+ # FreeBSD's dtrace requires libelf
+ LIBS="-lelf $LIBS"
+ ])
+ fi
+ DTRACE_EXT=d
+else
+ DTRACE_EXT=dmyh
+fi
+AC_SUBST(DTRACE_EXT)
+AC_SUBST(DTRACE_OBJ)
+AC_SUBST(DTRACE_GLOMMED_OBJ)
+AC_SUBST(LIBRUBY_A_OBJS)
+
+RUBY_SETJMP_TYPE
+}
+{ # build section
+
+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]),
+ [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=no])
+
+if test "$install_doc" != no; then
+ if test "$install_rdoc" != no; then
+ RDOCTARGET="rdoc"
+ else
+ RDOCTARGET="nodoc"
+ fi
+ if test "$install_capi" != no -a -n "$DOXYGEN"; then
+ CAPITARGET="capi"
+ else
+ CAPITARGET="nodoc"
+ fi
+else
+ RDOCTARGET="nodoc"
+ CAPITARGET="nodoc"
+fi
+
+AC_SUBST(RDOCTARGET)
+AC_SUBST(CAPITARGET)
+
+AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
+AC_SUBST(INSTALLDOC)
+
+if test "$rb_with_pthread" = "yes"; then
+ THREAD_MODEL=pthread
+fi
+AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
+ AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [
+ rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
+ sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
+ ],
+ [rb_cv_symbol_prefix=''])
+ test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
+])
+SYMBOL_PREFIX="$rb_cv_symbol_prefix"
+test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
+DLNOBJ=dln.o
+AC_ARG_ENABLE(dln,
+ AC_HELP_STRING([--disable-dln], [disable dynamic link feature]),
+ [test "$enableval" = yes || DLNOBJ=dmydln.o])
+AC_SUBST(DLNOBJ)
+MINIDLNOBJ=dmydln.o
+
+AS_CASE(["$target_os"],
+ [linux*], [
+ ],
+ [netbsd*], [
+ RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ ],
+ [darwin*], [
+ RUBY_APPEND_OPTION(CFLAGS, -pipe)
+ 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.
+ # the main point is the '-v' flag of 'cc'.
+ AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
+ [*/gemc_cc*], [ # we have the new DEC GEM CC
+ CFLAGS="$CFLAGS -oldc"
+ ],
+ [ # we have the old MIPS CC
+ ])
+ # cleanup
+ rm -f /tmp/main.o
+ 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)'
+ AS_CASE(["$target_os"],
+ [cygwin*], [
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ fi
+ ],
+ [mingw*], [
+ RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
+ if test x"${target_cpu}" != xi386; then
+ RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
+ fi
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ fi
+ EXPORT_PREFIX=' '
+ DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
+ AC_LIBOBJ([win32/win32])
+ AC_LIBOBJ([win32/file])
+ COMMON_LIBS=m
+# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
+ COMMON_HEADERS="winsock2.h windows.h"
+ THREAD_MODEL=win32
+ PLATFORM_DIR=win32
+ ])
+ LIBRUBY_ALIASES=''
+ FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
+ SOLIBS='$(LIBS)'
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
+ else
+ LIBRUBY_SO=dummy
+ LIBRUBY='lib$(RUBY_SO_NAME).a'
+ LIBRUBYARG='-l$(RUBY_SO_NAME)'
+ fi
+ ],
+ [hpux*], [
+ AS_CASE(["$YACC"],[*yacc*], [
+ XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
+ YACC="$YACC -Nl40000 -Nm40000"
+ ])],
+ [nacl], [
+ FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
+ ])
+
+AS_CASE(["$with_gmp: $SOLIBS "], [no:* | *' -lgmp '*|*' $(LIBS) '*], [],
+ [SOLIBS="-lgmp $SOLIBS"])
+
+MINIOBJS="$MINIDLNOBJ"
+
+AS_CASE(["$THREAD_MODEL"],
+[pthread], [AC_CHECK_HEADERS(pthread.h)],
+[win32], [],
+[""], [AC_MSG_ERROR(thread model is missing)],
+ [AC_MSG_ERROR(unknown thread model $THREAD_MODEL)])
+
+AC_ARG_ENABLE(debug-env,
+ AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
+ [AC_DEFINE(RUBY_DEBUG_ENV)])
+
+AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
+ AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
+ mkdir conftest.dir
+ echo "all:; @echo yes" > conftest.dir/GNUmakefile
+ echo "all:; @echo no" > conftest.dir/Makefile
+ gnumake=`(cd conftest.dir; ${MAKE-make})`
+ rm -fr conftest.dir
+ AS_CASE(["$gnumake"],
+ [*yes*], [
+ FIRSTMAKEFILE=GNUmakefile:template/GNUmakefile.in
+ gnumake=yes],
+ [
+ gnumake=no])
+ AC_MSG_RESULT($gnumake)
+])
+AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
+ AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
+ mkdir conftest.dir
+ NULLCMD=
+ for cmd in : true; do
+ echo 'A=1' > conftest.dir/Makefile
+ echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
+ echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
+ if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
+ NULLCMD=$cmd
+ break
+ fi
+ done
+ rm -fr conftest.dir
+ if test -z "$NULLCMD"; then
+ AC_MSG_ERROR(no candidate for safe null command)
+ fi
+ AC_MSG_RESULT($NULLCMD)
+])
+AC_SUBST(NULLCMD)
+
+if test "${universal_binary-no}" = yes ; then
+ AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
+ mv confdefs.h confdefs1.h
+ : > confdefs.h
+ AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} |
+ sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
+@%:@else
+@%:@error
+>>>>>><<<<<<
+@%:@endif], [],
+[
+ rb_cv_architecture_macros=yes
+ mv -f confdefs1.h confdefs.h
+], [
+ rb_cv_architecture_macros=no
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
+ for archs in ${universal_archnames}; do
+ cpu=${archs@%:@*=}
+ archs=${archs%=*}
+ CFLAGS="$new_cflags -arch $archs"
+ archs="__${archs}__"
+ AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
+ AC_TRY_COMPILE([@%:@ifndef ${archs}
+@%:@error
+@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ done
+ 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
+
+if test "$ac_cv_func_memmem" = yes; then
+ 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)
+ ])
+ test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no
+fi
+
+
+CPPFLAGS="$CPPFLAGS "'$(DEFS)'
+test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
+if test -n "${cflags+set}"; then
+ cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
+fi
+if test -n "${cxxflags+set}"; then
+ cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
+ CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
+fi
+if test "${ARCH_FLAG}"; then
+ archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
+ CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
+ CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
+ LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
+fi
+warnflags="$rb_cv_warnflags"
+AC_SUBST(cppflags)dnl
+AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
+AC_SUBST(optflags)dnl
+AC_SUBST(debugflags)dnl
+AC_SUBST(warnflags)dnl
+AC_SUBST(strict_warnflags)dnl
+AC_SUBST(XCFLAGS)dnl
+AC_SUBST(XLDFLAGS)dnl
+AC_SUBST(EXTLDFLAGS)dnl
+AC_SUBST(EXTDLDFLAGS)dnl
+AC_SUBST(LIBRUBY_LDSHARED)
+AC_SUBST(LIBRUBY_DLDFLAGS)
+AC_SUBST(RUBY_INSTALL_NAME)
+AC_SUBST(rubyw_install_name)
+AC_SUBST(RUBYW_INSTALL_NAME)
+AC_SUBST(RUBY_SO_NAME)
+AC_SUBST(LIBRUBY_A)
+AC_SUBST(LIBRUBY_SO)
+AC_SUBST(LIBRUBY_ALIASES)
+AC_SUBST(LIBRUBY)
+AC_SUBST(LIBRUBYARG)
+AC_SUBST(LIBRUBYARG_STATIC)
+AC_SUBST(LIBRUBYARG_SHARED)
+AC_SUBST(SOLIBS)
+AC_SUBST(DLDLIBS)
+AC_SUBST(ENABLE_SHARED)
+AC_SUBST(MAINLIBS)
+AC_SUBST(COMMON_LIBS)
+AC_SUBST(COMMON_MACROS)
+AC_SUBST(COMMON_HEADERS)
+AC_SUBST(EXPORT_PREFIX)
+AC_SUBST(SYMBOL_PREFIX)
+AC_SUBST(MINIOBJS)
+AC_SUBST(THREAD_MODEL)
+AC_SUBST(PLATFORM_DIR)
+
+firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
+firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
+MAKEFILES="Makefile $firstmf"
+MAKEFILES="`echo $MAKEFILES`"
+AC_SUBST(MAKEFILES)
+
+ri_prefix=
+test "$program_prefix" != NONE &&
+ ri_prefix=$program_prefix
+
+ri_suffix=
+test "$program_suffix" != NONE &&
+ ri_suffix=$program_suffix
+
+RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
+AS_CASE(["$target_os"],
+ [cygwin*|mingw*], [
+ RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
+ rubyw_install_name='$(RUBYW_INSTALL_NAME)'
+ ])
+
+rubylibdir='${rubylibprefix}/${ruby_version}'
+rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
+
+rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
+AC_ARG_WITH(rubyarchprefix,
+ AS_HELP_STRING([--with-rubyarchprefix=DIR],
+ [prefix for architecture dependent ruby libraries [[RUBYLIBPREFIX/ARCH]]]),
+ [rubyarchprefix="$withval"])
+AC_SUBST(rubyarchprefix)
+
+rubysitearchprefix=${multiarch+'${sitearchlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${sitearch}'}
+AC_ARG_WITH(rubysitearchprefix,
+ AS_HELP_STRING([--with-rubysitearchprefix=DIR],
+ [prefix for architecture dependent site libraries [[RUBYLIBPREFIX/SITEARCH]]]),
+ [rubysitearchprefix="$withval"])
+AC_SUBST(rubysitearchprefix)
+
+RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
+ridir='${datarootdir}/${RI_BASE_NAME}'
+AC_ARG_WITH(ridir,
+ AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
+ [ridir=$withval])
+AC_SUBST(ridir)
+AC_SUBST(RI_BASE_NAME)
+
+AC_ARG_WITH(ruby-version,
+ AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
+ [ruby_version=$withval],
+ [ruby_version=full])
+unset RUBY_LIB_VERSION
+unset RUBY_LIB_VERSION_STYLE
+AS_CASE(["$ruby_version"],
+ [full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
+ [minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
+if test ${RUBY_LIB_VERSION_STYLE+set}; then
+ {
+ echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
+ echo '#define STRINGIZE(x) x'
+ test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
+ echo '#include "verconf.h"'
+ echo '#include "version.h"'
+ echo 'ruby_version=RUBY_LIB_VERSION'
+ } > conftest.c
+ test -f verconf.h || > verconf.h
+ ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
+ eval $ruby_version
+elif test -z "${ruby_version}"; then
+ AC_MSG_ERROR([No ruby version, No place for bundled libraries])
+else
+ RUBY_LIB_VERSION="\"${ruby_version}\""
+fi
+AC_SUBST(RUBY_LIB_VERSION_STYLE)
+AC_SUBST(RUBY_LIB_VERSION)
+
+AC_ARG_WITH(sitedir,
+ AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
+ [sitedir=$withval],
+ [sitedir='${rubylibprefix}/site_ruby'])
+sitelibdir='${sitedir}/${ruby_version}'
+
+AC_ARG_WITH(sitearchdir,
+ AS_HELP_STRING([--with-sitearchdir=DIR],
+ [architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
+ [sitearchdir=$withval],
+ [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
+
+AC_ARG_WITH(vendordir,
+ AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
+ [vendordir=$withval],
+ [vendordir='${rubylibprefix}/vendor_ruby'])
+vendorlibdir='${vendordir}/${ruby_version}'
+
+AC_ARG_WITH(vendorarchdir,
+ AS_HELP_STRING([--with-vendorarchdir=DIR],
+ [architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
+ [vendorarchdir=$withval],
+ [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
+
+if test "${LOAD_RELATIVE+set}"; then
+ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
+ RUBY_EXEC_PREFIX=''
+fi
+
+AC_SUBST(RUBY_EXEC_PREFIX)
+
+AC_SUBST(libdirname, ${multiarch+arch}libdir)
+AC_SUBST(archlibdir)dnl
+AC_SUBST(sitearchlibdir)dnl
+AC_SUBST(archincludedir)dnl
+AC_SUBST(sitearchincludedir)dnl
+AC_SUBST(arch)dnl
+AC_SUBST(sitearch)dnl
+AC_SUBST(ruby_version)dnl
+AC_SUBST(rubylibdir)dnl
+AC_SUBST(rubyarchdir)dnl
+AC_SUBST(sitedir)dnl
+AC_SUBST(sitelibdir)dnl
+AC_SUBST(sitearchdir)dnl
+AC_SUBST(vendordir)dnl
+AC_SUBST(vendorlibdir)dnl
+AC_SUBST(vendorarchdir)dnl
+
+AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
+
+if test "${universal_binary-no}" = yes ; then
+ arch="universal-${target_os}"
+ if test "${rb_cv_architecture_available}" = yes; then
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
+ else
+ for archs in ${universal_archnames}; do
+ cpu=`echo $archs | sed 's/.*=//'`
+ archs=`echo $archs | sed 's/=.*//'`
+ RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
+ done
+ fi
+ ints='long int short'
+ test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
+ AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
+ AC_SUBST(UNIVERSAL_INTS, "${ints}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
+else
+ arch="${target_cpu}-${target_os}"
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+fi
+
+unset sitearch
+AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
+: ${sitearch='${arch}'}
+
+AC_ARG_WITH(search-path,
+ AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
+ [search_path=$withval])
+if test "$search_path" != ""; then
+ AC_SUBST(RUBY_SEARCH_PATH, $search_path)
+fi
+
+AC_ARG_WITH(rubyhdrdir,
+ AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
+ [rubyhdrdir=$withval],
+ [rubyhdrdir='${includedir}/${RUBY_VERSION_NAME}'])
+
+AC_ARG_WITH(rubyarchhdrdir,
+ AS_HELP_STRING([--with-rubyarchhdrdir=DIR],
+ [architecture dependent core headers in DIR [[$(rubyhdrdir)/$(arch)]]]),
+ [rubyarchhdrdir=$withval],
+ [rubyarchhdrdir=${multiarch+'${archincludedir}/${RUBY_VERSION_NAME}'}${multiarch-'${rubyhdrdir}/${arch}'}])
+
+AC_ARG_WITH(sitehdrdir,
+ AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
+ [sitehdrdir=$withval],
+ [sitehdrdir='${rubyhdrdir}/site_ruby'])
+
+AC_ARG_WITH(sitearchhdrdir,
+ AS_HELP_STRING([--with-sitearchhdrdir=DIR],
+ [architecture dependent core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
+ [sitearchhdrdir=$withval],
+ [sitearchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/site_ruby'}${multiarch-'${sitehdrdir}/${sitearch}'}])
+
+AC_ARG_WITH(vendorhdrdir,
+ AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
+ [vendorhdrdir=$withval],
+ [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
+
+AC_ARG_WITH(vendorarchhdrdir,
+ AS_HELP_STRING([--with-vendorarchhdrdir=DIR],
+ [architecture dependent core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
+ [vendorarchhdrdir=$withval],
+ [vendorarchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/vendor_ruby'}${multiarch-'${vendorhdrdir}/${sitearch}'}])
+
+AC_SUBST(rubyhdrdir)dnl
+AC_SUBST(sitehdrdir)dnl
+AC_SUBST(vendorhdrdir)dnl
+AC_SUBST(rubyarchhdrdir)dnl
+AC_SUBST(sitearchhdrdir)dnl
+AC_SUBST(vendorarchhdrdir)dnl
+
+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],
+ [AC_MSG_ERROR(invalid man type: $withval)])
+ ])
+if test -z "$MANTYPE"; then
+ AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
+ if ${NROFF} -mdoc ${srcdir}/man/ruby.1 >/dev/null 2>&1; then
+ MANTYPE=doc
+ else
+ MANTYPE=man
+ fi
+fi
+AC_SUBST(MANTYPE)
+
+AC_ARG_ENABLE(rubygems,
+ AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
+ [enable_rubygems="$enableval"], [enable_rubygems=yes])
+if test x"$enable_rubygems" = xno; then
+ AC_DEFINE(DISABLE_RUBYGEMS, 1)
+ USE_RUBYGEMS=NO
+else
+ USE_RUBYGEMS=YES
+fi
+AC_SUBST(USE_RUBYGEMS)
+
+arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
+AS_MKDIR_P("${arch_hdrdir}")
+config_h="${arch_hdrdir}/config.h"
+guard=INCLUDE_RUBY_CONFIG_H
+{
+ echo "#ifndef $guard"
+ echo "#define $guard 1"
+ grep -v "^#define PACKAGE_" confdefs.h
+ echo "#endif /* $guard */"
+} | tr -d '\015' |
+${srcdir}/tool/ifchange "${config_h}" -
+tr -d '\015' < largefile.h > confdefs.h
+rm largefile.h
+
+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
+AC_SUBST(BUILTIN_ENCOBJS)
+
+BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
+ -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
+ -e '}' "${srcdir}/enc/Makefile.in"`"]
+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)';
+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_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
+
+if test x"$firstmf" != x; then
+ AC_CONFIG_FILES($firstmf:$firsttmpl, [], [firstmf="$firstmf" firsttmpl="$firsttmpl"])
+fi
+AC_CONFIG_FILES(Makefile, [
+ tmpmk=confmk$$.tmp
+ {
+ if test ${VCS+set}; then
+ :
+ elif svn info "$srcdir" > /dev/null 2>&1; then
+ VCS='svn'
+ elif test -d "$srcdir/.git/svn"; then
+ VCS='git svn'
+ elif test -d "$srcdir/.git"; then
+ VCS='git'
+ else
+ VCS='echo cannot'
+ fi
+ AS_CASE("$VCS",
+ [svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
+ ["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
+ echo ['$(MKFILES): $(srcdir)/common.mk']
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
+ else
+ echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
+ fi
+ } > $tmpmk && if ! grep '^ruby:' $tmpmk > /dev/null; then
+ if test "${gnumake}" = yes; then
+ tmpgmk=confgmk$$.tmp
+ {
+ echo "include $tmpmk"
+ echo "-include uncommon.mk"
+ } > $tmpgmk
+ else
+ tmpgmk=$tmpmk
+ fi &&
+ test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
+ echo 'ruby: $(PROGRAM);' >> $tmpmk
+ test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
+ fi && mv -f $tmpmk Makefile],
+[EXEEXT='$EXEEXT' gnumake='$gnumake'])
+
+AC_ARG_WITH([ruby-pc],
+ AC_HELP_STRING([pc file basename]),
+ [ruby_pc="$withval"],
+ [ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
+AC_SUBST(ruby_pc)
+AC_SUBST(exec, [exec])
+
+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 &&
+ {
+ test -z "$PKG_CONFIG" ||
+ PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
+ }
+ then
+ mv -f ruby.tmp.pc $ruby_pc
+ else
+ exit 1
+ fi
+ ],
+ [ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
+
+AC_OUTPUT
+}
+}
diff --git a/constant.h b/constant.h
index fcccf07384..8c854bfffa 100644
--- a/constant.h
+++ b/constant.h
@@ -12,22 +12,10 @@
#define CONSTANT_H
typedef enum {
- CONST_DEPRECATED = 0x100,
-
- CONST_VISIBILITY_MASK = 0xff,
CONST_PUBLIC = 0x00,
- CONST_PRIVATE,
- CONST_VISIBILITY_MAX
+ CONST_PRIVATE = 0x01
} 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;
@@ -37,8 +25,7 @@ typedef struct rb_const_entry_struct {
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(struct rb_id_table *tbl);
+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);
VALUE rb_public_const_get_from(VALUE klass, ID id);
@@ -46,6 +33,5 @@ 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);
-int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
#endif /* CONSTANT_H */
diff --git a/cont.c b/cont.c
index 539d1f48cc..2ff2cbb98c 100644
--- a/cont.c
+++ b/cont.c
@@ -9,6 +9,7 @@
**********************************************************************/
+#include "ruby/ruby.h"
#include "internal.h"
#include "vm_core.h"
#include "gc.h"
@@ -54,7 +55,13 @@
# define FIBER_USE_NATIVE 1
# endif
# elif defined(_WIN32)
-# define FIBER_USE_NATIVE 1
+# if _WIN32_WINNT >= 0x0400
+/* only when _WIN32_WINNT >= 0x0400 on Windows because Fiber APIs are
+ * supported only such building (and running) environments.
+ * [ruby-dev:41192]
+ */
+# define FIBER_USE_NATIVE 1
+# endif
# endif
#endif
#if !defined(FIBER_USE_NATIVE)
@@ -80,22 +87,16 @@ enum context_type {
ROOT_FIBER_CONTEXT = 2
};
-struct cont_saved_vm_stack {
- VALUE *ptr;
-#ifdef CAPTURE_JUST_VALID_VM_STACK
- size_t slen; /* length of stack (head of ec->vm_stack) */
- size_t clen; /* length of control frames (tail of ec->vm_stack) */
-#endif
-};
-
typedef struct rb_context_struct {
enum context_type type;
int argc;
VALUE self;
VALUE value;
-
- struct cont_saved_vm_stack saved_vm_stack;
-
+ 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
struct {
VALUE *stack;
VALUE *stack_src;
@@ -106,38 +107,18 @@ typedef struct rb_context_struct {
int register_stack_size;
#endif
} machine;
- rb_execution_context_t saved_ec;
+ rb_thread_t saved_thread;
rb_jmpbuf_t jmpbuf;
rb_ensure_entry_t *ensure_array;
rb_ensure_list_t *ensure_list;
} rb_context_t;
-
-/*
- * Fiber status:
- * [Fiber.new] ------> FIBER_CREATED
- * | [Fiber#resume]
- * v
- * +--> FIBER_RESUMED ----+
- * [Fiber#resume] | | [Fiber.yield] |
- * | v |
- * +-- FIBER_SUSPENDED | [Terminate]
- * |
- * FIBER_TERMINATED <-+
- */
enum fiber_status {
- FIBER_CREATED,
- FIBER_RESUMED,
- FIBER_SUSPENDED,
- FIBER_TERMINATED
+ CREATED,
+ RUNNING,
+ TERMINATED
};
-#define FIBER_CREATED_P(fib) ((fib)->status == FIBER_CREATED)
-#define FIBER_RESUMED_P(fib) ((fib)->status == FIBER_RESUMED)
-#define FIBER_SUSPENDED_P(fib) ((fib)->status == FIBER_SUSPENDED)
-#define FIBER_TERMINATED_P(fib) ((fib)->status == FIBER_TERMINATED)
-#define FIBER_RUNNABLE_P(fib) (FIBER_CREATED_P(fib) || FIBER_SUSPENDED_P(fib))
-
#if FIBER_USE_NATIVE && !defined(_WIN32)
#define MAX_MACHINE_STACK_CACHE 10
static int machine_stack_cache_index = 0;
@@ -149,17 +130,18 @@ static machine_stack_cache_t machine_stack_cache[MAX_MACHINE_STACK_CACHE];
static machine_stack_cache_t terminated_machine_stack;
#endif
-struct rb_fiber_struct {
+typedef struct rb_fiber_struct {
rb_context_t cont;
- VALUE first_proc;
- struct rb_fiber_struct *prev;
- const enum fiber_status status;
+ VALUE prev;
+ enum fiber_status status;
/* If a fiber invokes "transfer",
* then this fiber can't "resume" any more after that.
* You shouldn't mix "transfer" and "resume".
*/
- int transferred;
+ int transfered;
+ struct rb_fiber_struct *prev_fiber;
+ struct rb_fiber_struct *next_fiber;
#if FIBER_USE_NATIVE
#ifdef _WIN32
void *fib_handle;
@@ -173,86 +155,7 @@ struct rb_fiber_struct {
size_t ss_size;
#endif
#endif
-};
-
-static const char *
-fiber_status_name(enum fiber_status s)
-{
- switch (s) {
- case FIBER_CREATED: return "created";
- case FIBER_RESUMED: return "resumed";
- case FIBER_SUSPENDED: return "suspended";
- case FIBER_TERMINATED: return "terminated";
- }
- VM_UNREACHABLE(fiber_status_name);
- return NULL;
-}
-
-static void
-fiber_verify(const rb_fiber_t *fib)
-{
-#if VM_CHECK_MODE > 0
- VM_ASSERT(fib->cont.saved_ec.fiber_ptr == fib);
-
- switch (fib->status) {
- case FIBER_RESUMED:
- VM_ASSERT(fib->cont.saved_ec.vm_stack != NULL);
- break;
- case FIBER_SUSPENDED:
- VM_ASSERT(fib->cont.saved_ec.vm_stack != NULL);
- break;
- case FIBER_CREATED:
- case FIBER_TERMINATED:
- /* TODO */
- break;
- default:
- VM_UNREACHABLE(fiber_verify);
- }
-#endif
-}
-
-#if VM_CHECK_MODE > 0
-void
-rb_ec_verify(const rb_execution_context_t *ec)
-{
- /* TODO */
-}
-#endif
-
-static void
-fiber_status_set(const rb_fiber_t *fib, enum fiber_status s)
-{
- if (0) fprintf(stderr, "fib: %p, status: %s -> %s\n", fib, fiber_status_name(fib->status), fiber_status_name(s));
- VM_ASSERT(!FIBER_TERMINATED_P(fib));
- VM_ASSERT(fib->status != s);
- fiber_verify(fib);
- *((enum fiber_status *)&fib->status) = s;
-}
-
-void
-ec_set_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size)
-{
- *(VALUE **)(&ec->vm_stack) = stack;
- *(size_t *)(&ec->vm_stack_size) = size;
-}
-
-static inline void
-ec_switch(rb_thread_t *th, rb_fiber_t *fib)
-{
- rb_execution_context_t *ec = &fib->cont.saved_ec;
-
- ruby_current_execution_context_ptr = th->ec = ec;
-
- /*
- * timer-thread may set trap interrupt on previous th->ec at any time;
- * ensure we do not delay (or lose) the trap interrupt handling.
- */
- if (th->vm->main_thread == th && rb_signal_buff_size() > 0) {
- RUBY_VM_SET_TRAP_INTERRUPT(ec);
- }
-
- VM_ASSERT(ec->fiber_ptr->cont.self == 0 || ec->vm_stack != NULL);
-}
+} rb_fiber_t;
static const rb_data_type_t cont_data_type, fiber_data_type;
static VALUE rb_cContinuation;
@@ -267,114 +170,111 @@ static VALUE rb_eFiberError;
if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
} while (0)
-NOINLINE(static VALUE cont_capture(volatile int *volatile stat));
+NOINLINE(static VALUE cont_capture(volatile int *stat));
#define THREAD_MUST_BE_RUNNING(th) do { \
- if (!(th)->ec->tag) rb_raise(rb_eThreadError, "not running thread"); \
+ if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
} while (0)
-static VALUE
-cont_thread_value(const rb_context_t *cont)
-{
- return cont->saved_ec.thread_ptr->self;
-}
-
static void
cont_mark(void *ptr)
{
- rb_context_t *cont = ptr;
-
RUBY_MARK_ENTER("cont");
- rb_gc_mark(cont->value);
-
- rb_execution_context_mark(&cont->saved_ec);
- rb_gc_mark(cont_thread_value(cont));
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ rb_gc_mark(cont->value);
+ rb_thread_mark(&cont->saved_thread);
+ rb_gc_mark(cont->saved_thread.self);
- if (cont->saved_vm_stack.ptr) {
+ if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
- rb_gc_mark_locations(cont->saved_vm_stack.ptr,
- cont->saved_vm_stack.ptr + cont->saved_vm_stack.slen + cont->saved_vm_stack.clen);
+ rb_gc_mark_locations(cont->vm_stack,
+ cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
#else
- rb_gc_mark_locations(cont->saved_vm_stack.ptr,
- cont->saved_vm_stack.ptr, cont->saved_ec.stack_size);
+ rb_gc_mark_locations(cont->vm_stack,
+ cont->vm_stack, cont->saved_thread.stack_size);
#endif
- }
-
- if (cont->machine.stack) {
- if (cont->type == CONTINUATION_CONTEXT) {
- /* cont */
- rb_gc_mark_locations(cont->machine.stack,
- cont->machine.stack + cont->machine.stack_size);
}
- else {
- /* fiber */
- const rb_fiber_t *fib = (rb_fiber_t*)cont;
- if (!FIBER_TERMINATED_P(fib)) {
+ if (cont->machine.stack) {
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* cont */
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);
+ }
}
}
- }
#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
-
+ }
RUBY_MARK_LEAVE("cont");
}
static void
cont_free(void *ptr)
{
- rb_context_t *cont = ptr;
-
RUBY_FREE_ENTER("cont");
- ruby_xfree(cont->saved_ec.vm_stack);
-
+ if (ptr) {
+ rb_context_t *cont = ptr;
+ RUBY_FREE_UNLESS_NULL(cont->saved_thread.stack); fflush(stdout);
#if FIBER_USE_NATIVE
- if (cont->type == CONTINUATION_CONTEXT) {
- /* cont */
- ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine.stack);
- }
- else {
- /* fiber */
- const rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (cont->type == CONTINUATION_CONTEXT) {
+ /* cont */
+ ruby_xfree(cont->ensure_array);
+ RUBY_FREE_UNLESS_NULL(cont->machine.stack);
+ }
+ else {
+ /* fiber */
#ifdef _WIN32
- if (cont->type != ROOT_FIBER_CONTEXT) {
- /* don't delete root fiber handle */
- if (fib->fib_handle) {
- DeleteFiber(fib->fib_handle);
+ if (GET_THREAD()->fiber != cont->self && 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 (fib->ss_sp != NULL) {
- if (cont->type == ROOT_FIBER_CONTEXT) {
- rb_bug("Illegal root fiber parameter");
+ if (GET_THREAD()->fiber != cont->self) {
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->ss_sp) {
+ if (cont->type == ROOT_FIBER_CONTEXT) {
+ rb_bug("Illegal root fiber parameter");
+ }
+ munmap((void*)fib->ss_sp, fib->ss_size);
+ }
}
- munmap((void*)fib->ss_sp, fib->ss_size);
- }
- else {
- /* It may reached here when finalize */
- /* TODO examine whether it is a bug */
- /* rb_bug("cont_free: release self"); */
- }
+ else {
+ /* It may reached here when finalize */
+ /* TODO examine whether it is a bug */
+ /* rb_bug("cont_free: release self"); */
+ }
#endif
- }
+ }
#else /* not FIBER_USE_NATIVE */
- ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine.stack);
+ ruby_xfree(cont->ensure_array);
+ 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->saved_vm_stack.ptr);
+ RUBY_FREE_UNLESS_NULL(cont->vm_stack);
- /* free rb_cont_t or rb_fiber_t */
- ruby_xfree(ptr);
+ /* free rb_cont_t or rb_fiber_t */
+ ruby_xfree(ptr);
+ }
RUBY_FREE_LEAVE("cont");
}
@@ -383,72 +283,76 @@ cont_memsize(const void *ptr)
{
const rb_context_t *cont = ptr;
size_t size = 0;
-
- size = sizeof(*cont);
- if (cont->saved_vm_stack.ptr) {
+ if (cont) {
+ size = sizeof(*cont);
+ if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
- size_t n = (cont->saved_vm_stack.slen + cont->saved_vm_stack.clen);
+ size_t n = (cont->vm_stack_slen + cont->vm_stack_clen);
#else
- size_t n = cont->saved_ec.vm_stack_size;
+ size_t n = cont->saved_thread.stack_size;
#endif
- size += n * sizeof(*cont->saved_vm_stack.ptr);
- }
+ 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);
- }
+ if (cont->machine.register_stack) {
+ size += cont->machine.register_stack_size * sizeof(*cont->machine.register_stack);
+ }
#endif
+ }
return size;
}
-void
-rb_fiber_mark_self(const rb_fiber_t *fib)
+static void
+fiber_mark(void *ptr)
{
- if (fib->cont.self) {
- rb_gc_mark(fib->cont.self);
- }
- else {
- rb_execution_context_mark(&fib->cont.saved_ec);
+ RUBY_MARK_ENTER("cont");
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ rb_gc_mark(fib->prev);
+ cont_mark(&fib->cont);
}
+ RUBY_MARK_LEAVE("cont");
}
static void
-fiber_mark(void *ptr)
+fiber_link_join(rb_fiber_t *fib)
{
- rb_fiber_t *fib = ptr;
- RUBY_MARK_ENTER("cont");
- fiber_verify(fib);
- rb_gc_mark(fib->first_proc);
- if (fib->prev) rb_fiber_mark_self(fib->prev);
+ VALUE current_fibval = rb_fiber_current();
+ rb_fiber_t *current_fib;
+ GetFiberPtr(current_fibval, current_fib);
-#if !FIBER_USE_NATIVE
- if (fib->status == FIBER_TERMINATED) {
- /* FIBER_TERMINATED fiber should not mark machine stack */
- if (fib->cont.saved_ec.machine.stack_end != NULL) {
- fib->cont.saved_ec.machine.stack_end = NULL;
- }
- }
-#endif
+ /* 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;
+}
- cont_mark(&fib->cont);
- RUBY_MARK_LEAVE("cont");
+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)
{
- rb_fiber_t *fib = ptr;
RUBY_FREE_ENTER("fiber");
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ if (fib->cont.type != ROOT_FIBER_CONTEXT &&
+ fib->cont.saved_thread.local_storage) {
+ st_free_table(fib->cont.saved_thread.local_storage);
+ }
+ fiber_link_remove(fib);
- if (fib->cont.saved_ec.local_storage) {
- st_free_table(fib->cont.saved_ec.local_storage);
+ cont_free(&fib->cont);
}
-
- cont_free(&fib->cont);
RUBY_FREE_LEAVE("fiber");
}
@@ -457,13 +361,14 @@ fiber_memsize(const void *ptr)
{
const rb_fiber_t *fib = ptr;
size_t size = 0;
-
- size = sizeof(*fib);
- if (fib->cont.type != ROOT_FIBER_CONTEXT &&
- fib->cont.saved_ec.local_storage != NULL) {
- size += st_memsize(fib->cont.saved_ec.local_storage);
+ 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 += cont_memsize(&fib->cont);
return size;
}
@@ -483,18 +388,18 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{
size_t size;
- SET_MACHINE_STACK_END(&th->ec->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
#ifdef __ia64
th->machine.register_stack_end = rb_ia64_bsp();
#endif
- if (th->ec->machine.stack_start > th->ec->machine.stack_end) {
- size = cont->machine.stack_size = th->ec->machine.stack_start - th->ec->machine.stack_end;
- cont->machine.stack_src = th->ec->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->ec->machine.stack_end - th->ec->machine.stack_start;
- cont->machine.stack_src = th->ec->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) {
@@ -525,26 +430,21 @@ cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
static const rb_data_type_t cont_data_type = {
"continuation",
{cont_mark, cont_free, cont_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
-static inline void
+static void
cont_save_thread(rb_context_t *cont, rb_thread_t *th)
{
- rb_execution_context_t *sec = &cont->saved_ec;
-
- VM_ASSERT(th->status == THREAD_RUNNABLE);
-
/* save thread context */
- *sec = *th->ec;
-
- /* saved_thread->machine.stack_end should be NULL */
+ cont->saved_thread = *th;
+ /* saved_thread->machine.stack_(start|end) should be NULL */
/* because it may happen GC afterward */
- sec->machine.stack_end = NULL;
-
+ cont->saved_thread.machine.stack_start = 0;
+ cont->saved_thread.machine.stack_end = 0;
#ifdef __ia64
- sec->machine.register_stack_start = NULL;
- sec->machine.register_stack_end = NULL;
+ cont->saved_thread.machine.register_stack_start = 0;
+ cont->saved_thread.machine.register_stack_end = 0;
#endif
}
@@ -553,10 +453,7 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
{
/* save thread context */
cont_save_thread(cont, th);
- cont->saved_ec.thread_ptr = th;
- cont->saved_ec.local_storage = NULL;
- cont->saved_ec.local_storage_recursive_hash = Qnil;
- cont->saved_ec.local_storage_recursive_hash_for_trace = Qnil;
+ cont->saved_thread.local_storage = 0;
}
static rb_context_t *
@@ -573,62 +470,31 @@ cont_new(VALUE klass)
return cont;
}
-#if 0
-void
-show_vm_stack(const rb_execution_context_t *ec)
-{
- VALUE *p = ec->vm_stack;
- while (p < ec->cfp->sp) {
- fprintf(stderr, "%3d ", (int)(p - ec->vm_stack));
- rb_obj_info_dump(*p);
- p++;
- }
-}
-
-void
-show_vm_pcs(const rb_control_frame_t *cfp,
- const rb_control_frame_t *end_of_cfp)
-{
- int i=0;
- while (cfp != end_of_cfp) {
- int pc = 0;
- if (cfp->iseq) {
- pc = cfp->pc - cfp->iseq->body->iseq_encoded;
- }
- fprintf(stderr, "%2d pc: %d\n", i++, pc);
- cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- }
-}
-#endif
static VALUE
-cont_capture(volatile int *volatile stat)
+cont_capture(volatile int *stat)
{
- rb_context_t *volatile cont;
- rb_thread_t *th = GET_THREAD();
+ rb_context_t *cont;
+ rb_thread_t *th = GET_THREAD(), *sth;
volatile VALUE contval;
- const rb_execution_context_t *ec = th->ec;
THREAD_MUST_BE_RUNNING(th);
- rb_vm_stack_to_heap(th->ec);
+ 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->saved_vm_stack.slen = ec->cfp->sp - ec->vm_stack;
- cont->saved_vm_stack.clen = ec->vm_stack + ec->vm_stack_size - (VALUE*)ec->cfp;
- cont->saved_vm_stack.ptr = ALLOC_N(VALUE, cont->saved_vm_stack.slen + cont->saved_vm_stack.clen);
- MEMCPY(cont->saved_vm_stack.ptr,
- ec->vm_stack,
- VALUE, cont->saved_vm_stack.slen);
- MEMCPY(cont->saved_vm_stack.ptr + cont->saved_vm_stack.slen,
- (VALUE*)ec->cfp,
- VALUE,
- cont->saved_vm_stack.clen);
+ cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - 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);
+ MEMCPY(cont->vm_stack + cont->vm_stack_slen, (VALUE*)th->cfp, VALUE, cont->vm_stack_clen);
#else
- cont->saved_vm_stack.ptr = ALLOC_N(VALUE, ec->vm_stack_size);
- MEMCPY(cont->saved_vm_stack.ptr, ec->vm_stack, VALUE, ec->vm_stack_size);
+ cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
+ MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size);
#endif
- ec_set_vm_stack(&cont->saved_ec, NULL, 0);
+ sth->stack = 0;
+
cont_save_machine_stack(th, cont);
/* backup ensure_list to array for search in another context */
@@ -636,10 +502,10 @@ cont_capture(volatile int *volatile stat)
rb_ensure_list_t *p;
int size = 0;
rb_ensure_entry_t *entry;
- for (p=th->ec->ensure_list; p; p=p->next)
+ for (p=th->ensure_list; p; p=p->next)
size++;
entry = cont->ensure_array = ALLOC_N(rb_ensure_entry_t,size+1);
- for (p=th->ec->ensure_list; p; p=p->next) {
+ for (p=th->ensure_list; p; p=p->next) {
if (!p->entry.marker)
p->entry.marker = rb_ary_tmp_new(0); /* dummy object */
*entry++ = p->entry;
@@ -648,7 +514,7 @@ cont_capture(volatile int *volatile stat)
}
if (ruby_setjmp(cont->jmpbuf)) {
- VALUE value;
+ volatile VALUE value;
VAR_INITIALIZED(cont);
value = cont->value;
@@ -663,74 +529,54 @@ cont_capture(volatile int *volatile stat)
}
}
-static inline void
-fiber_restore_thread(rb_thread_t *th, rb_fiber_t *fib)
-{
- ec_switch(th, fib);
- VM_ASSERT(th->ec->fiber_ptr == fib);
-}
-
-static inline void
+static void
cont_restore_thread(rb_context_t *cont)
{
- rb_thread_t *th = GET_THREAD();
+ rb_thread_t *th = GET_THREAD(), *sth = &cont->saved_thread;
/* restore thread context */
if (cont->type == CONTINUATION_CONTEXT) {
/* continuation */
- rb_execution_context_t *sec = &cont->saved_ec;
- rb_fiber_t *fib = NULL;
+ VALUE fib;
- if (sec->fiber_ptr != NULL) {
- fib = sec->fiber_ptr;
- }
- else if (th->root_fiber) {
- fib = th->root_fiber;
- }
+ th->fiber = sth->fiber;
+ fib = th->fiber ? th->fiber : th->root_fiber;
- if (fib && th->ec != &fib->cont.saved_ec) {
- ec_switch(th, fib);
+ 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;
}
-
- /* copy vm stack */
#ifdef CAPTURE_JUST_VALID_VM_STACK
- MEMCPY(th->ec->vm_stack,
- cont->saved_vm_stack.ptr,
- VALUE, cont->saved_vm_stack.slen);
- MEMCPY(th->ec->vm_stack + th->ec->vm_stack_size - cont->saved_vm_stack.clen,
- cont->saved_vm_stack.ptr + cont->saved_vm_stack.slen,
- VALUE, cont->saved_vm_stack.clen);
+ MEMCPY(th->stack, cont->vm_stack, VALUE, cont->vm_stack_slen);
+ MEMCPY(th->stack + sth->stack_size - cont->vm_stack_clen,
+ cont->vm_stack + cont->vm_stack_slen, VALUE, cont->vm_stack_clen);
#else
- MEMCPY(th->ec->vm_stack, cont->saved_vm_stack.ptr, VALUE, sec->vm_stack_size);
+ MEMCPY(th->stack, cont->vm_stack, VALUE, sth->stack_size);
#endif
- /* other members of ec */
-
- th->ec->cfp = sec->cfp;
- th->ec->safe_level = sec->safe_level;
- th->ec->raised_flag = sec->raised_flag;
- th->ec->tag = sec->tag;
- th->ec->protect_tag = sec->protect_tag;
- th->ec->root_lep = sec->root_lep;
- th->ec->root_svar = sec->root_svar;
- th->ec->ensure_list = sec->ensure_list;
- th->ec->errinfo = sec->errinfo;
-
- /* trace on -> trace off */
- if (th->ec->trace_arg != NULL && sec->trace_arg == NULL) {
- GET_VM()->trace_running--;
- }
- /* trace off -> trace on */
- else if (th->ec->trace_arg == NULL && sec->trace_arg != NULL) {
- GET_VM()->trace_running++;
- }
- th->ec->trace_arg = sec->trace_arg;
-
- VM_ASSERT(th->ec->vm_stack != NULL);
}
else {
/* fiber */
- fiber_restore_thread(th, (rb_fiber_t*)cont);
+ th->stack = sth->stack;
+ th->stack_size = sth->stack_size;
+ th->local_storage = sth->local_storage;
+ th->fiber = cont->self;
}
+
+ th->cfp = sth->cfp;
+ th->safe_level = sth->safe_level;
+ th->raised_flag = sth->raised_flag;
+ th->state = sth->state;
+ th->status = sth->status;
+ th->tag = sth->tag;
+ th->protect_tag = sth->protect_tag;
+ th->errinfo = sth->errinfo;
+ th->first_proc = sth->first_proc;
+ th->root_lep = sth->root_lep;
+ th->root_svar = sth->root_svar;
+ th->ensure_list = sth->ensure_list;
+
}
#if FIBER_USE_NATIVE
@@ -742,7 +588,7 @@ fiber_set_stack_location(void)
VALUE *ptr;
SET_MACHINE_STACK_END(&ptr);
- th->ec->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
@@ -805,13 +651,9 @@ fiber_machine_stack_alloc(size_t size)
static void
fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
{
- rb_execution_context_t *sec = &fib->cont.saved_ec;
+ 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 */
@@ -821,7 +663,7 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
rb_raise(rb_eFiberError, "can't create fiber");
}
}
- sec->machine.stack_maxsize = size;
+ sth->machine.stack_maxsize = size;
#else /* not WIN32 */
ucontext_t *context = &fib->context;
char *ptr;
@@ -835,8 +677,8 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
fib->ss_sp = ptr;
fib->ss_size = size;
makecontext(context, rb_fiber_start, 0);
- sec->machine.stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
- sec->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;
@@ -848,36 +690,43 @@ NOINLINE(static void fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib));
static void
fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
{
- rb_thread_t *th = GET_THREAD();
+ rb_thread_t *th = GET_THREAD(), *sth = &newfib->cont.saved_thread;
+
+ if (newfib->status != RUNNING) {
+ fiber_initialize_machine_stack_context(newfib, th->vm->default_params.fiber_machine_stack_size);
+ }
- /* save oldfib's machine stack / TODO: is it needed? */
- if (!FIBER_TERMINATED_P(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");
+ }
+
+ /* save oldfib's machine stack */
+ if (oldfib->status != TERMINATED) {
STACK_GROW_DIR_DETECTION;
- SET_MACHINE_STACK_END(&th->ec->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
if (STACK_DIR_UPPER(0, 1)) {
- oldfib->cont.machine.stack_size = th->ec->machine.stack_start - th->ec->machine.stack_end;
- oldfib->cont.machine.stack = th->ec->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->ec->machine.stack_end - th->ec->machine.stack_start;
- oldfib->cont.machine.stack = th->ec->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_ec.machine.stack_start = th->ec->machine.stack_start;
-
+ 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_ec.machine.stack_end = NULL;
-
- /* restore thread context */
- fiber_restore_thread(th, newfib);
-
+ oldfib->cont.saved_thread.machine.stack_end = 0;
#ifndef _WIN32
- if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib) {
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib->cont.self) {
rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
}
#endif
+
/* swap machine context */
#ifdef _WIN32
SwitchToFiber(newfib->fib_handle);
@@ -1035,24 +884,6 @@ 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:
*
@@ -1216,22 +1047,28 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
rb_thread_t *th = GET_THREAD();
GetContPtr(contval, cont);
- if (cont_thread_value(cont) != th->self) {
+ if (cont->saved_thread.self != th->self) {
rb_raise(rb_eRuntimeError, "continuation called across threads");
}
- if (cont->saved_ec.protect_tag != th->ec->protect_tag) {
+ if (cont->saved_thread.protect_tag != th->protect_tag) {
rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
}
- if (cont->saved_ec.fiber_ptr) {
- if (th->ec->fiber_ptr != cont->saved_ec.fiber_ptr) {
+ 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");
}
}
- rollback_ensure_stack(contval, th->ec->ensure_list, cont->ensure_array);
+ rollback_ensure_stack(contval, th->ensure_list, cont->ensure_array);
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
+
cont_restore_0(cont, &contval);
return Qnil; /* unreachable */
}
@@ -1250,11 +1087,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
* the programmer and not the VM.
*
* As opposed to other stackless light weight concurrency models, each fiber
- * comes with a stack. This enables the fiber to be paused from deeply
- * nested function calls within the fiber block. See the ruby(1)
- * manpage to configure the size of the fiber stack(s).
+ * 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
+ * When a fiber is created it will not run automatically. Rather it must be
* 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
@@ -1306,7 +1142,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,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -1330,66 +1166,55 @@ fiber_t_alloc(VALUE fibval)
fib->cont.self = fibval;
fib->cont.type = FIBER_CONTEXT;
cont_init(&fib->cont, th);
- fib->cont.saved_ec.fiber_ptr = fib;
- fib->prev = NULL;
-
- /* fib->status == 0 == CREATED
- * So that we don't need to set status: fiber_status_set(fib, FIBER_CREATED); */
- VM_ASSERT(FIBER_CREATED_P(fib));
+ fib->prev = Qnil;
+ fib->status = CREATED;
DATA_PTR(fibval) = fib;
return fib;
}
-rb_control_frame_t *
-rb_vm_push_frame(rb_execution_context_t *sec,
- const rb_iseq_t *iseq,
- VALUE type,
- VALUE self,
- VALUE specval,
- VALUE cref_or_me,
- const VALUE *pc,
- VALUE *sp,
- int local_size,
- int stack_max);
-
static VALUE
fiber_init(VALUE fibval, VALUE proc)
{
rb_fiber_t *fib = fiber_t_alloc(fibval);
rb_context_t *cont = &fib->cont;
- rb_execution_context_t *sec = &cont->saved_ec;
- rb_thread_t *cth = GET_THREAD();
- size_t fib_stack_size = cth->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
+ rb_thread_t *th = &cont->saved_thread;
/* initialize cont */
- cont->saved_vm_stack.ptr = NULL;
- ec_set_vm_stack(sec, NULL, 0);
-
- ec_set_vm_stack(sec, ALLOC_N(VALUE, fib_stack_size), fib_stack_size);
- sec->cfp = (void *)(sec->vm_stack + sec->vm_stack_size);
-
- rb_vm_push_frame(sec,
- NULL,
- VM_FRAME_MAGIC_DUMMY | VM_ENV_FLAG_LOCAL | VM_FRAME_FLAG_FINISH | VM_FRAME_FLAG_CFRAME,
- Qnil, /* self */
- VM_BLOCK_HANDLER_NONE,
- 0, /* specval */
- NULL, /* pc */
- sec->vm_stack, /* sp */
- 0, /* local_size */
- 0);
-
- sec->tag = NULL;
- sec->local_storage = NULL;
- sec->local_storage_recursive_hash = Qnil;
- sec->local_storage_recursive_hash_for_trace = Qnil;
-
- fib->first_proc = proc;
+ cont->vm_stack = 0;
+
+ 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 = 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;
+#if VM_DEBUG_BP_CHECK
+ th->cfp->bp_check = 0;
+#endif
+ th->cfp->ep = th->stack;
+ *th->cfp->ep = VM_ENVVAL_BLOCK_PTR(0);
+ th->cfp->self = Qnil;
+ th->cfp->klass = Qnil;
+ th->cfp->flag = 0;
+ 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->first_proc = proc;
#if !FIBER_USE_NATIVE
- MEMCPY(&cont->jmpbuf, &cth->root_jmpbuf, rb_jmpbuf_t, 1);
+ MEMCPY(&cont->jmpbuf, &th->root_jmpbuf, rb_jmpbuf_t, 1);
#endif
return fibval;
@@ -1408,377 +1233,289 @@ rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
}
-static void rb_fiber_terminate(rb_fiber_t *fib, int need_interrupt);
+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, const 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->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
+ rb_fiber_transfer(return_fiber(), 1, &value);
+}
void
rb_fiber_start(void)
{
- rb_thread_t * volatile th = GET_THREAD();
- rb_fiber_t *fib = th->ec->fiber_ptr;
+ rb_thread_t *th = GET_THREAD();
+ rb_fiber_t *fib;
rb_proc_t *proc;
- enum ruby_tag_type state;
- int need_interrupt = TRUE;
+ int state;
- VM_ASSERT(th->ec == ruby_current_execution_context_ptr);
- VM_ASSERT(FIBER_RESUMED_P(fib));
+ GetFiberPtr(th->fiber, fib);
- EC_PUSH_TAG(th->ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ 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(fib->first_proc, proc);
+ GetProcPtr(cont->saved_thread.first_proc, proc);
argv = (argc = cont->argc) > 1 ? RARRAY_CONST_PTR(args) : &args;
cont->value = Qnil;
- th->ec->errinfo = Qnil;
- th->ec->root_lep = rb_vm_proc_local_ep(fib->first_proc);
- th->ec->root_svar = Qfalse;
+ th->errinfo = Qnil;
+ th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
+ th->root_svar = Qnil;
- EXEC_EVENT_HOOK(th->ec, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, 0, Qnil);
- cont->value = rb_vm_invoke_proc(th->ec, proc, argc, argv, VM_BLOCK_HANDLER_NONE);
+ fib->status = RUNNING;
+ cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
- EC_POP_TAG();
+ TH_POP_TAG();
if (state) {
- VALUE err = th->ec->errinfo;
- VM_ASSERT(FIBER_RESUMED_P(fib));
-
if (state == TAG_RAISE || state == TAG_FATAL) {
- rb_threadptr_pending_interrupt_enque(th, err);
+ rb_threadptr_pending_interrupt_enque(th, th->errinfo);
}
else {
- err = rb_vm_make_jump_tag_but_local_jump(state, err);
- if (!NIL_P(err)) {
+ VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ if (!NIL_P(err))
rb_threadptr_pending_interrupt_enque(th, err);
- }
}
- need_interrupt = TRUE;
+ RUBY_VM_SET_INTERRUPT(th);
}
- rb_fiber_terminate(fib, need_interrupt);
- VM_UNREACHABLE(rb_fiber_start);
+ rb_fiber_terminate(fib);
+ rb_bug("rb_fiber_start: unreachable");
}
static rb_fiber_t *
root_fiber_alloc(rb_thread_t *th)
{
- VALUE fibval = fiber_alloc(rb_cFiber);
- rb_fiber_t *fib = th->ec->fiber_ptr;
-
- VM_ASSERT(DATA_PTR(fibval) == NULL);
- VM_ASSERT(fib->cont.type == ROOT_FIBER_CONTEXT);
- VM_ASSERT(fib->status == FIBER_RESUMED);
-
- th->root_fiber = fib;
- DATA_PTR(fibval) = fib;
- fib->cont.self = fibval;
-#if FIBER_USE_NATIVE
-#ifdef _WIN32
- if (fib->fib_handle == 0) {
- fib->fib_handle = ConvertThreadToFiber(0);
- }
-#endif
-#endif
- return fib;
-}
-
-void
-rb_threadptr_root_fiber_setup(rb_thread_t *th)
-{
- rb_fiber_t *fib = ruby_mimmalloc(sizeof(rb_fiber_t));
- MEMZERO(fib, rb_fiber_t, 1);
+ rb_fiber_t *fib;
+ /* no need to allocate vm stack */
+ fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
fib->cont.type = ROOT_FIBER_CONTEXT;
- fib->cont.saved_ec.fiber_ptr = fib;
- fib->cont.saved_ec.thread_ptr = th;
- fiber_status_set(fib, FIBER_RESUMED); /* skip CREATED */
- th->ec = &fib->cont.saved_ec;
#if FIBER_USE_NATIVE
#ifdef _WIN32
- if (fib->fib_handle == 0) {
- fib->fib_handle = ConvertThreadToFiber(0);
- }
+ fib->fib_handle = ConvertThreadToFiber(0);
#endif
#endif
-}
+ fib->status = RUNNING;
+ fib->prev_fiber = fib->next_fiber = fib;
-void
-rb_threadptr_root_fiber_release(rb_thread_t *th)
-{
- if (th->root_fiber) {
- /* ignore. A root fiber object will free th->ec */
- }
- else {
- VM_ASSERT(th->ec->fiber_ptr->cont.type == ROOT_FIBER_CONTEXT);
- VM_ASSERT(th->ec->fiber_ptr->cont.self == 0);
- fiber_free(th->ec->fiber_ptr);
-
- if (th->ec == ruby_current_execution_context_ptr) {
- ruby_current_execution_context_ptr = NULL;
- }
- th->ec = NULL;
- }
-}
-
-static inline rb_fiber_t*
-fiber_current(void)
-{
- rb_execution_context_t *ec = GET_EC();
- if (ec->fiber_ptr->cont.self == 0) {
- root_fiber_alloc(rb_ec_thread_ptr(ec));
- }
- return ec->fiber_ptr;
-}
-
-static inline rb_fiber_t*
-return_fiber(void)
-{
- rb_fiber_t *fib = fiber_current();
- rb_fiber_t *prev = fib->prev;
-
- if (!prev) {
- rb_thread_t *th = GET_THREAD();
- rb_fiber_t *root_fiber = th->root_fiber;
-
- VM_ASSERT(root_fiber != NULL);
-
- if (root_fiber == fib) {
- rb_raise(rb_eFiberError, "can't yield from root fiber");
- }
- return root_fiber;
- }
- else {
- fib->prev = NULL;
- return prev;
- }
+ return fib;
}
VALUE
rb_fiber_current(void)
{
- return fiber_current()->cont.self;
+ 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;
+ }
+ return th->fiber;
}
-static inline VALUE
-fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
+static VALUE
+fiber_store(rb_fiber_t *next_fib)
{
+ rb_thread_t *th = GET_THREAD();
rb_fiber_t *fib;
- if (th->ec->fiber_ptr != NULL) {
- fib = th->ec->fiber_ptr;
+ if (th->fiber) {
+ GetFiberPtr(th->fiber, fib);
+ cont_save_thread(&fib->cont, th);
}
else {
- /* create root fiber */
+ /* create current fiber */
fib = root_fiber_alloc(th);
+ th->root_fiber = th->fiber = fib->cont.self;
}
- VM_ASSERT(FIBER_RESUMED_P(fib) || FIBER_TERMINATED_P(fib));
- VM_ASSERT(FIBER_RUNNABLE_P(next_fib));
-
-#if FIBER_USE_NATIVE
- if (FIBER_CREATED_P(next_fib)) {
- fiber_initialize_machine_stack_context(next_fib, th->vm->default_params.fiber_machine_stack_size);
- }
-#endif
-
- if (FIBER_RESUMED_P(fib)) fiber_status_set(fib, FIBER_SUSPENDED);
-
-#if FIBER_USE_NATIVE == 0
- /* should (re-)allocate stack are before fib->status change to pass fiber_verify() */
+#if !FIBER_USE_NATIVE
cont_save_machine_stack(th, &fib->cont);
#endif
- fiber_status_set(next_fib, FIBER_RESUMED);
-
+ if (FIBER_USE_NATIVE || ruby_setjmp(fib->cont.jmpbuf)) {
#if FIBER_USE_NATIVE
- fiber_setcontext(next_fib, fib);
- /* restored */
+ fiber_setcontext(next_fib, fib);
#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++;
- }
- else {
- if (terminated_machine_stack.ptr != fib->cont.machine.stack) {
- munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
+ 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 {
- rb_bug("terminated fiber resumed");
+ 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");
+ }
}
+ terminated_machine_stack.ptr = NULL;
+ terminated_machine_stack.size = 0;
}
- terminated_machine_stack.ptr = NULL;
- terminated_machine_stack.size = 0;
- }
-#endif /* not _WIN32 */
- fib = th->ec->fiber_ptr;
- if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
- return fib->cont.value;
-
-#else /* FIBER_USE_NATIVE */
- fib->cont.saved_ec.machine.stack_end = NULL;
- if (ruby_setjmp(fib->cont.jmpbuf)) {
+#endif
+#endif
/* restored */
- fib = th->ec->fiber_ptr;
+ GetFiberPtr(th->fiber, fib);
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);
- VM_UNREACHABLE(fiber_store);
- }
return fib->cont.value;
}
+#if !FIBER_USE_NATIVE
else {
- VALUE undef = Qundef;
- cont_restore_0(&next_fib->cont, &undef);
- VM_UNREACHABLE(fiber_store);
+ return Qundef;
}
-#endif /* FIBER_USE_NATIVE */
+#endif
}
static inline VALUE
-fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
+fiber_switch(VALUE fibval, int argc, const VALUE *argv, int is_resume)
{
VALUE value;
- rb_context_t *cont = &fib->cont;
+ rb_fiber_t *fib;
+ rb_context_t *cont;
rb_thread_t *th = GET_THREAD();
- /* make sure the root_fiber object is available */
- if (th->root_fiber == NULL) root_fiber_alloc(th);
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
- if (th->ec->fiber_ptr == fib) {
+ if (th->fiber == fibval) {
/* ignore fiber context switch
* because destination fiber is same as current fiber
*/
return make_passing_arg(argc, argv);
}
- if (cont_thread_value(cont) != th->self) {
+ if (cont->saved_thread.self != th->self) {
rb_raise(rb_eFiberError, "fiber called across threads");
}
- else if (cont->saved_ec.protect_tag != th->ec->protect_tag) {
+ else if (cont->saved_thread.protect_tag != th->protect_tag) {
rb_raise(rb_eFiberError, "fiber called across stack rewinding barrier");
}
- else if (FIBER_TERMINATED_P(fib)) {
+ else if (fib->status == TERMINATED) {
value = rb_exc_new2(rb_eFiberError, "dead fiber called");
-
- if (!FIBER_TERMINATED_P(th->ec->fiber_ptr)) {
- rb_exc_raise(value);
- VM_UNREACHABLE(fiber_switch);
+ if (th->fiber != fibval) {
+ GetFiberPtr(th->fiber, fib);
+ if (fib->status != TERMINATED) rb_exc_raise(value);
+ fibval = th->root_fiber;
}
else {
- /* th->ec->fiber_ptr 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) */
- VM_ASSERT(FIBER_SUSPENDED_P(th->root_fiber));
-
- cont = &th->root_fiber->cont;
- cont->argc = -1;
- cont->value = value;
+ fibval = fib->prev;
+ if (NIL_P(fibval)) fibval = th->root_fiber;
+ }
+ GetFiberPtr(fibval, fib);
+ cont = &fib->cont;
+ cont->argc = -1;
+ cont->value = value;
#if FIBER_USE_NATIVE
- fiber_setcontext(th->root_fiber, th->ec->fiber_ptr);
+ {
+ VALUE oldfibval;
+ rb_fiber_t *oldfib;
+ oldfibval = rb_fiber_current();
+ GetFiberPtr(oldfibval, oldfib);
+ fiber_setcontext(fib, oldfib);
+ }
#else
- cont_restore_0(cont, &value);
+ cont_restore_0(cont, &value);
#endif
- VM_UNREACHABLE(fiber_switch);
- }
}
if (is_resume) {
- fib->prev = fiber_current();
+ fib->prev = rb_fiber_current();
+ }
+ else {
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
}
-
- VM_ASSERT(FIBER_RUNNABLE_P(fib));
cont->argc = argc;
cont->value = make_passing_arg(argc, argv);
- value = fiber_store(fib, th);
- RUBY_VM_CHECK_INTS(th->ec);
- EXEC_EVENT_HOOK(th->ec, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, 0, Qnil);
+ value = fiber_store(fib);
+#if !FIBER_USE_NATIVE
+ if (value == Qundef) {
+ cont_restore_0(cont, &value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+#endif
+ RUBY_VM_CHECK_INTS(th);
return value;
}
VALUE
-rb_fiber_transfer(VALUE fibval, int argc, const VALUE *argv)
+rb_fiber_transfer(VALUE fib, int argc, const VALUE *argv)
{
- rb_fiber_t *fib;
- GetFiberPtr(fibval, fib);
return fiber_switch(fib, argc, argv, 0);
}
-void
-rb_fiber_close(rb_fiber_t *fib)
-{
- VALUE *vm_stack = fib->cont.saved_ec.vm_stack;
- fiber_status_set(fib, FIBER_TERMINATED);
- if (fib->cont.type == ROOT_FIBER_CONTEXT) {
- rb_thread_recycle_stack_release(vm_stack);
- }
- else {
- ruby_xfree(vm_stack);
- }
- ec_set_vm_stack(&fib->cont.saved_ec, NULL, 0);
-
-#if !FIBER_USE_NATIVE
- /* should not mark machine stack any more */
- fib->cont.saved_ec.machine.stack_end = NULL;
-#endif
-}
-
-static void
-rb_fiber_terminate(rb_fiber_t *fib, int need_interrupt)
-{
- VALUE value = fib->cont.value;
- rb_fiber_t *ret_fib;
-
- VM_ASSERT(FIBER_RESUMED_P(fib));
- rb_fiber_close(fib);
-
-#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
-
- ret_fib = return_fiber();
- if (need_interrupt) RUBY_VM_SET_INTERRUPT(&ret_fib->cont.saved_ec);
- fiber_switch(ret_fib, 1, &value, 0);
-}
-
VALUE
rb_fiber_resume(VALUE fibval, int argc, const VALUE *argv)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- if (fib->prev != 0 || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ if (fib->prev != Qnil || fib->cont.type == ROOT_FIBER_CONTEXT) {
rb_raise(rb_eFiberError, "double resume");
}
- if (fib->transferred != 0) {
+ if (fib->transfered != 0) {
rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
}
- return fiber_switch(fib, argc, argv, 1);
+ return fiber_switch(fibval, argc, argv, 1);
}
VALUE
rb_fiber_yield(int argc, const VALUE *argv)
{
- return fiber_switch(return_fiber(), argc, argv, 0);
+ return rb_fiber_transfer(return_fiber(), argc, argv);
}
void
rb_fiber_reset_root_local_storage(VALUE thval)
{
- rb_thread_t *th = rb_thread_ptr(thval);
+ rb_thread_t *th;
+ rb_fiber_t *fib;
- if (th->root_fiber && th->root_fiber != th->ec->fiber_ptr) {
- th->ec->local_storage = th->root_fiber->cont.saved_ec.local_storage;
+ 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;
}
}
@@ -1794,9 +1531,9 @@ rb_fiber_reset_root_local_storage(VALUE thval)
VALUE
rb_fiber_alive_p(VALUE fibval)
{
- const rb_fiber_t *fib;
+ rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- return FIBER_TERMINATED_P(fib) ? Qfalse : Qtrue;
+ return fib->status != TERMINATED ? Qtrue : Qfalse;
}
/*
@@ -1870,8 +1607,8 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
{
rb_fiber_t *fib;
GetFiberPtr(fibval, fib);
- fib->transferred = 1;
- return fiber_switch(fib, argc, argv, 0);
+ fib->transfered = 1;
+ return rb_fiber_transfer(fibval, argc, argv);
}
/*
@@ -1904,47 +1641,7 @@ rb_fiber_s_current(VALUE klass)
return rb_fiber_current();
}
-/*
- * call-seq:
- * fiber.to_s -> string
- *
- * Returns fiber information string.
- *
- */
-static VALUE
-fiber_to_s(VALUE fibval)
-{
- const rb_fiber_t *fib;
- const rb_proc_t *proc;
- char status_info[0x10];
-
- GetFiberPtr(fibval, fib);
- snprintf(status_info, 0x10, " (%s)", fiber_status_name(fib->status));
- if (!rb_obj_is_proc(fib->first_proc)) {
- VALUE str = rb_any_to_s(fibval);
- strlcat(status_info, ">", sizeof(status_info));
- rb_str_set_len(str, RSTRING_LEN(str)-1);
- rb_str_cat_cstr(str, status_info);
- return str;
- }
- GetProcPtr(fib->first_proc, proc);
- return rb_block_to_s(fibval, &proc->block, status_info);
-}
-
-#ifdef HAVE_WORKING_FORK
-void
-rb_fiber_atfork(rb_thread_t *th)
-{
- if (th->root_fiber) {
- if (&th->root_fiber->cont.saved_ec != th->ec) {
- th->root_fiber = th->ec->fiber_ptr;
- th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
- }
- th->root_fiber->prev = 0;
- }
-}
-#endif
/*
* Document-class: FiberError
@@ -1972,7 +1669,7 @@ Init_Cont(void)
#else /* not WIN32 */
pagesize = sysconf(_SC_PAGESIZE);
#endif
- SET_MACHINE_STACK_END(&th->ec->machine.stack_end);
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
#endif
rb_cFiber = rb_define_class("Fiber", rb_cObject);
@@ -1981,8 +1678,6 @@ Init_Cont(void)
rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1);
rb_define_method(rb_cFiber, "initialize", rb_fiber_init, 0);
rb_define_method(rb_cFiber, "resume", rb_fiber_m_resume, -1);
- rb_define_method(rb_cFiber, "to_s", fiber_to_s, 0);
- rb_define_alias(rb_cFiber, "inspect", "to_s");
}
RUBY_SYMBOL_EXPORT_BEGIN
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 192cf43b37..5bd414d786 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -3,7 +3,6 @@ include Makefile
ENABLE_SHARED=@ENABLE_SHARED@
DLLWRAP = @DLLWRAP@ --target=@target_os@ --driver-name="$(CC)"
WINDRES = @WINDRES@ --preprocessor="$(CPP) -xc" -DRC_INVOKED
-STRIP = @STRIP@
ifeq (@target_os@,cygwin)
DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
@@ -11,6 +10,9 @@ else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
VPATH := $(VPATH):$(srcdir)/win32
+ STUBPROGRAM = rubystub$(EXEEXT)
+ IGNOREDPATTERNS = %~ .% %.orig %.rej \#%\#
+ SCRIPTPROGRAMS = $(addsuffix $(EXEEXT),$(filter-out $(IGNOREDPATTERNS),$(notdir $(wildcard $(srcdir)/bin/*))))
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -30,15 +32,20 @@ WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
-include uncommon.mk
-include $(srcdir)/defs/gmake.mk
-
SOLIBS := $(DLL_BASE_NAME).res.@OBJEXT@ $(SOLIBS)
-override EXTOBJS += $(if $(filter-out $(RUBYW_INSTALL_NAME),$(@:$(EXEEXT)=)),$(RUBY_INSTALL_NAME),$(@:$(EXEEXT)=)).res.$(OBJEXT)
+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
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
+stub: $(STUBPROGRAM)
+scriptbin: $(SCRIPTPROGRAMS)
+
+%$(EXEEXT): bin/% $(STUBPROGRAM)
+ $(ECHO) generating $@
+ $(Q) { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
+ $(Q) chmod +x $@
$(LIBRUBY): $(RUBY_EXP) $(LIBRUBY_SO)
$(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
@@ -47,11 +54,11 @@ $(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
$(ECHO) compiling $@
$(Q) $(WINDRES) --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-%.rc: $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
+$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
$(ECHO) generating $@
$(Q) $(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
- -so_name=$(DLL_BASE_NAME) -output=$(*F) \
+ -so_name=$(DLL_BASE_NAME) \
. $(icondirs) $(srcdir)/win32
$(PROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@
@@ -60,7 +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@
+$(STUBPROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@ stub.@OBJEXT@
+ @rm -f $@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) \
+ stub.@OBJEXT@ $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
$(ECHO) creating $@
@@ -75,15 +86,7 @@ GNUmakefile: $(srcdir)/cygwin/GNUmakefile.in
ifeq (@target_os@,mingw32)
$(OBJS) $(MAINOBJ): win32.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)
-
+dir.$(OBJEXT) win32.$(OBJEXT): win32/dir.h
endif
$(LIBRUBY_SO): $(RUBYDEF)
@@ -96,7 +99,7 @@ clean-local::
@$(RM) $(RUBYDEF)
ifeq (@target_os@,cygwin)
-cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)0.dll: $(LIBRUBY_A) $(RUBYDEF)
+cygwin-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY).dll: $(LIBRUBY_A) $(RUBYDEF)
$(ECHO) generating $@
$(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
diff --git a/debug.c b/debug.c
index f811ec6779..15c1ea8b9e 100644
--- a/debug.c
+++ b/debug.c
@@ -15,7 +15,6 @@
#include "vm_debug.h"
#include "eval_intern.h"
#include "vm_core.h"
-#include "symbol.h"
#include "id.h"
/* for gdb */
@@ -26,48 +25,52 @@ 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_robject_flags robject_flags;
- enum ruby_rmodule_flags rmodule_flags;
- enum ruby_rstring_flags rstring_flags;
- enum ruby_rarray_flags rarray_flags;
enum {
- RUBY_FMODE_READABLE = FMODE_READABLE,
- RUBY_FMODE_WRITABLE = FMODE_WRITABLE,
- RUBY_FMODE_READWRITE = FMODE_READWRITE,
- RUBY_FMODE_BINMODE = FMODE_BINMODE,
- RUBY_FMODE_SYNC = FMODE_SYNC,
- RUBY_FMODE_TTY = FMODE_TTY,
- RUBY_FMODE_DUPLEX = FMODE_DUPLEX,
- RUBY_FMODE_APPEND = FMODE_APPEND,
- RUBY_FMODE_CREATE = FMODE_CREATE,
- RUBY_FMODE_NOREVLOOKUP = 0x00000100,
- RUBY_FMODE_TRUNC = FMODE_TRUNC,
- RUBY_FMODE_TEXTMODE = FMODE_TEXTMODE,
- RUBY_FMODE_PREP = 0x00010000,
- RUBY_FMODE_SETENC_BY_BOM = FMODE_SETENC_BY_BOM,
- RUBY_FMODE_UNIX = 0x00200000,
- RUBY_FMODE_INET = 0x00400000,
- RUBY_FMODE_INET6 = 0x00800000,
-
+ 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_PROMOTED0 = FL_PROMOTED0,
+ RUBY_FL_PROMOTED1 = FL_PROMOTED1,
+ RUBY_FL_PROMOTED = FL_PROMOTED0|FL_PROMOTED1,
+ 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,
RUBY_NODE_FL_NEWLINE = NODE_FL_NEWLINE
} various;
- union {
- enum imemo_type types;
- enum {RUBY_IMEMO_MASK = IMEMO_MASK} mask;
- struct RIMemo *ptr;
- } imemo;
- struct RSymbol *symbol_ptr;
- enum vm_call_flag_bits vm_call_flags;
} 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)
@@ -89,16 +92,14 @@ ruby_debug_printf(const char *format, ...)
va_end(ap);
}
-#include "gc.h"
-
VALUE
ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
{
if (level < debug_level) {
- char buff[0x100];
- rb_raw_obj_info(buff, 0x100, obj);
-
- fprintf(stderr, "DBG> %s: %s\n", header, buff);
+ VALUE str;
+ str = rb_inspect(obj);
+ fprintf(stderr, "DBG> %s: %s\n", header,
+ obj == (VALUE)(SIGNED_VALUE)-1 ? "" : StringValueCStr(str));
fflush(stderr);
}
return obj;
@@ -136,87 +137,23 @@ ruby_debug_breakpoint(void)
/* */
}
-#if defined _WIN32
-# if RUBY_MSVCRT_VERSION >= 80
-extern int ruby_w32_rtc_error;
-# endif
-#endif
-#if defined _WIN32 || defined __CYGWIN__
-#include <windows.h>
-UINT ruby_w32_codepage[2];
-#endif
-extern int ruby_rgengc_debug;
-
-int
-ruby_env_debug_option(const char *str, int len, void *arg)
+static void
+set_debug_option(const char *str, int len, void *arg)
{
- int ov;
- size_t retlen;
- unsigned long n;
-#define SET_WHEN(name, var, val) do { \
+#define SET_WHEN(name, var) do { \
if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \
- (var) = (val); \
- return 1; \
+ extern int var; \
+ var = 1; \
+ return; \
} \
} while (0)
-#define NAME_MATCH_VALUE(name) \
- ((size_t)len >= sizeof(name)-1 && \
- strncmp(str, (name), sizeof(name)-1) == 0 && \
- ((len == sizeof(name)-1 && !(len = 0)) || \
- (str[sizeof(name)-1] == '=' && \
- (str += sizeof(name), len -= sizeof(name), 1))))
-#define SET_UINT(val) do { \
- n = ruby_scan_digits(str, len, 10, &retlen, &ov); \
- if (!ov && retlen) { \
- val = (unsigned int)n; \
- } \
- str += retlen; \
- len -= retlen; \
- } while (0)
-#define SET_UINT_LIST(name, vals, num) do { \
- int i; \
- for (i = 0; i < (num); ++i) { \
- SET_UINT((vals)[i]); \
- if (!len || *str != ':') break; \
- ++str; \
- --len; \
- } \
- if (len > 0) { \
- fprintf(stderr, "ignored "name" option: `%.*s'\n", len, str); \
- } \
- } while (0)
-#define SET_WHEN_UINT(name, vals, num, req) \
- if (NAME_MATCH_VALUE(name)) SET_UINT_LIST(name, vals, num);
-
- SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
- SET_WHEN("core", ruby_enable_coredump, 1);
- if (NAME_MATCH_VALUE("rgengc")) {
- if (!len) ruby_rgengc_debug = 1;
- else SET_UINT_LIST("rgengc", &ruby_rgengc_debug, 1);
- return 1;
- }
-#if defined _WIN32
-# if RUBY_MSVCRT_VERSION >= 80
- SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
-# endif
+ 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);
#endif
-#if defined _WIN32 || defined __CYGWIN__
- if (NAME_MATCH_VALUE("codepage")) {
- if (!len) fprintf(stderr, "missing codepage argument");
- else SET_UINT_LIST("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage));
- return 1;
- }
-#endif
- return 0;
-}
-
-static void
-set_debug_option(const char *str, int len, void *arg)
-{
- if (!ruby_env_debug_option(str, len, arg)) {
- fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
- }
+ fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
}
void
diff --git a/debug_counter.c b/debug_counter.c
deleted file mode 100644
index 6000f98c54..0000000000
--- a/debug_counter.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/**********************************************************************
-
- debug_counter.c -
-
- created at: Tue Feb 21 16:51:18 2017
-
- Copyright (C) 2017 Koichi Sasada
-
-**********************************************************************/
-
-#include "debug_counter.h"
-#include <stdio.h>
-
-#if USE_DEBUG_COUNTER
-#include "internal.h"
-
-static const char *const debug_counter_names[] = {
- ""
-#define RB_DEBUG_COUNTER(name) #name,
-#include "debug_counter.h"
-#undef RB_DEBUG_COUNTER
-};
-
-size_t rb_debug_counter[numberof(debug_counter_names)];
-
-__attribute__((destructor))
-static void
-rb_debug_counter_show_results(void)
-{
- const char *env = getenv("RUBY_DEBUG_COUNTER_DISABLE");
- if (env == NULL || strcmp("1", env) != 0) {
- int i;
- for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) {
- fprintf(stderr, "[RUBY_DEBUG_COUNTER]\t%s\t%"PRIuSIZE"\n",
- debug_counter_names[i],
- rb_debug_counter[i]);
- }
- }
-}
-
-#endif /* USE_DEBUG_COUNTER */
diff --git a/debug_counter.h b/debug_counter.h
deleted file mode 100644
index f0f4e5ed0b..0000000000
--- a/debug_counter.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/**********************************************************************
-
- debug_counter.h -
-
- created at: Tue Feb 21 16:51:18 2017
-
- Copyright (C) 2017 Koichi Sasada
-
-**********************************************************************/
-
-#ifndef USE_DEBUG_COUNTER
-#define USE_DEBUG_COUNTER 0
-#endif
-
-#ifdef RB_DEBUG_COUNTER
-
-/* method search */
-RB_DEBUG_COUNTER(mc_inline_hit)
-RB_DEBUG_COUNTER(mc_inline_miss)
-RB_DEBUG_COUNTER(mc_global_hit)
-RB_DEBUG_COUNTER(mc_global_miss)
-RB_DEBUG_COUNTER(mc_global_state_miss)
-RB_DEBUG_COUNTER(mc_class_serial_miss)
-RB_DEBUG_COUNTER(mc_cme_complement)
-RB_DEBUG_COUNTER(mc_cme_complement_hit)
-RB_DEBUG_COUNTER(mc_search_super)
-
-/* ivar access */
-RB_DEBUG_COUNTER(ivar_get_ic_hit)
-RB_DEBUG_COUNTER(ivar_get_ic_miss)
-RB_DEBUG_COUNTER(ivar_get_ic_miss_serial)
-RB_DEBUG_COUNTER(ivar_get_ic_miss_unset)
-RB_DEBUG_COUNTER(ivar_get_ic_miss_noobject)
-RB_DEBUG_COUNTER(ivar_set_ic_hit)
-RB_DEBUG_COUNTER(ivar_set_ic_miss)
-RB_DEBUG_COUNTER(ivar_set_ic_miss_serial)
-RB_DEBUG_COUNTER(ivar_set_ic_miss_unset)
-RB_DEBUG_COUNTER(ivar_set_ic_miss_oorange)
-RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject)
-RB_DEBUG_COUNTER(ivar_get_base)
-RB_DEBUG_COUNTER(ivar_set_base)
-
-/* lvar access */
-RB_DEBUG_COUNTER(lvar_get)
-RB_DEBUG_COUNTER(lvar_get_dynamic)
-RB_DEBUG_COUNTER(lvar_set)
-RB_DEBUG_COUNTER(lvar_set_dynamic)
-RB_DEBUG_COUNTER(lvar_set_slowpath)
-
-/* object counts */
-RB_DEBUG_COUNTER(obj_free)
-
-RB_DEBUG_COUNTER(obj_str_ptr)
-RB_DEBUG_COUNTER(obj_str_embed)
-RB_DEBUG_COUNTER(obj_str_shared)
-RB_DEBUG_COUNTER(obj_str_nofree)
-RB_DEBUG_COUNTER(obj_str_fstr)
-
-RB_DEBUG_COUNTER(obj_ary_ptr)
-RB_DEBUG_COUNTER(obj_ary_embed)
-
-RB_DEBUG_COUNTER(obj_obj_ptr)
-RB_DEBUG_COUNTER(obj_obj_embed)
-
-/* load */
-RB_DEBUG_COUNTER(load_files)
-RB_DEBUG_COUNTER(load_path_is_not_realpath)
-
-#endif
-
-#ifndef RUBY_DEBUG_COUNTER_H
-#define RUBY_DEBUG_COUNTER_H 1
-
-#if !defined(__GNUC__) && USE_DEBUG_COUNTER
-#error "USE_DEBUG_COUNTER is not supported by other than __GNUC__"
-#endif
-
-enum rb_debug_counter_type {
-#define RB_DEBUG_COUNTER(name) RB_DEBUG_COUNTER_##name,
-#include "debug_counter.h"
- RB_DEBUG_COUNTER_MAX
-#undef RB_DEBUG_COUNTER
-};
-
-#if USE_DEBUG_COUNTER
-#include "ruby/ruby.h"
-
-extern size_t rb_debug_counter[];
-
-inline static int
-rb_debug_counter_add(enum rb_debug_counter_type type, int add, int cond)
-{
- if (cond) {
- rb_debug_counter[(int)type] += add;
- }
- return cond;
-}
-
-#define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1)
-#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond)))
-#define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, (cond))
-
-#else
-#define RB_DEBUG_COUNTER_INC(type) ((void)0)
-#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (cond)
-#define RB_DEBUG_COUNTER_INC_IF(type, cond) (cond)
-#endif
-
-#endif /* RUBY_DEBUG_COUNTER_H */
diff --git a/defs/default_gems b/defs/default_gems
new file mode 100644
index 0000000000..ce9010910a
--- /dev/null
+++ b/defs/default_gems
@@ -0,0 +1,4 @@
+# gem base directory versioning file [executable files under bin]
+rake lib/rake lib/rake.rb [rake]
+rdoc lib/rdoc lib/rdoc.rb [rdoc ri]
+json ext/json ext/json/lib/json/version.rb
diff --git a/defs/gmake.mk b/defs/gmake.mk
index d961e27f77..f5033b2245 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -1,38 +1,17 @@
# -*- makefile-gmake -*-
gnumake = yes
-override gnumake_recursive := $(if $(findstring n,$(firstword $(MFLAGS))),,+)
-override mflags := $(filter-out -j%,$(MFLAGS))
-MSPECOPT += $(if $(filter -j%,$(MFLAGS)),-j)
-CHECK_TARGETS := great exam love check test check% test% btest%
-# expand test targets, and those dependents
-TEST_TARGETS := $(filter $(CHECK_TARGETS),$(MAKECMDGOALS))
-TEST_DEPENDS := $(filter-out commit $(TEST_TARGETS),$(MAKECMDGOALS))
-TEST_TARGETS := $(patsubst great,exam,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out great $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst exam,check test-rubyspec,$(TEST_TARGETS))
-TEST_TARGETS := $(patsubst test-rubyspec,test-spec,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out exam $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst love,check,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out love $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst check,test test-testframework test-almost,$(patsubst check-%,test test-%,$(TEST_TARGETS)))
-TEST_DEPENDS := $(filter-out check $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst test,btest-ruby test-knownbug test-basic,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out test $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_DEPENDS += $(if $(filter great exam love check,$(MAKECMDGOALS)),all exts)
+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 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
@@ -52,21 +31,19 @@ $(foreach arch,$(filter -arch=%,$(subst -arch ,-arch=,$(ARCH_FLAG))),\
$(eval $(call archcmd,$(patsubst -arch=%,%,$(value arch)),$(patsubst -arch=%,-arch %,$(value arch)))))
endif
-.PHONY: $(addprefix yes-,$(TEST_TARGETS))
-
-ifneq ($(filter-out btest%,$(TEST_TARGETS)),)
-$(addprefix yes-,$(TEST_TARGETS)): $(TEST_DEPENDS)
+ifneq ($(filter love check% 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 love check%,$(MAKECMDGOALS)) $(filter test-all,$(TEST_TARGETS)),)
+yes-test-all yes-test-ruby: $(filter-out %test-all %test-ruby check%,$(TEST_TARGETS))
+endif
+ifneq ($(filter love check%,$(MAKECMDGOALS))$(if $(filter test-all,$(MAKECMDGOALS)),$(filter test-knownbug,$(MAKECMDGOALS))),)
+yes-test-all yes-test-ruby: yes-test-knownbug
endif
-ORDERED_TEST_TARGETS := $(filter $(TEST_TARGETS), \
- btest-ruby test-knownbug test-basic \
- test-testframework test-ruby test-almost test-all \
- test-spec \
- )
-prev_test := $(if $(filter test-spec,$(ORDERED_TEST_TARGETS)),test-spec-precheck)
-$(foreach test,$(ORDERED_TEST_TARGETS), \
- $(eval yes-$(value test) no-$(value test): $(value prev_test)); \
- $(eval prev_test := $(value test)))
+$(TEST_TARGETS): $(TEST_DEPENDS)
ifneq ($(if $(filter install,$(MAKECMDGOALS)),$(filter uninstall,$(MAKECMDGOALS))),)
install-targets := $(filter install uninstall,$(MAKECMDGOALS))
@@ -80,67 +57,7 @@ endif
ifneq ($(filter love,$(MAKECMDGOALS)),)
showflags: up
-sudo-precheck: test yes-test-testframework no-test-testframework
+sudo-precheck: test
install-prereq: sudo-precheck
yes-test-all no-test-all: install
-yes-test-almost no-test-almost: install
-endif
-ifneq ($(filter great,$(MAKECMDGOALS)),)
-love: test-rubyspec
-endif
-
-$(srcdir)/missing/des_tables.c: $(srcdir)/missing/crypt.c
-ifeq ($(if $(filter yes,$(CROSS_COMPILING)),,$(CC)),)
- touch $@
-else
- @$(ECHO) building make_des_table
- $(CC) $(CPPFLAGS) -DDUMP $(LDFLAGS) $(XLDFLAGS) $(LIBS) -omake_des_table $(srcdir)/missing/crypt.c
- @[ -x ./make_des_table ]
- @$(ECHO) generating $@
- $(Q) $(MAKEDIRS) $(@D)
- $(Q) ./make_des_table > $@.new
- $(Q) mv $@.new $@
- $(Q) $(RMALL) make_des_table*
-endif
-
-STUBPROGRAM = rubystub$(EXEEXT)
-IGNOREDPATTERNS = %~ .% %.orig %.rej \#%\#
-SCRIPTBINDIR := $(if $(EXEEXT),,exec/)
-SCRIPTPROGRAMS = $(addprefix $(SCRIPTBINDIR),$(addsuffix $(EXEEXT),$(filter-out $(IGNOREDPATTERNS),$(notdir $(wildcard $(srcdir)/bin/*)))))
-
-stub: $(STUBPROGRAM)
-scriptbin: $(SCRIPTPROGRAMS)
-ifneq ($(STUBPROGRAM),rubystub)
-rubystub: $(STUBPROGRAM)
-endif
-
-$(SCRIPTPROGRAMS): $(STUBPROGRAM)
-
-$(STUBPROGRAM): rubystub.$(OBJEXT) $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
-
-rubystub$(EXEEXT):
- @rm -f $@
- $(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) rubystub.$(OBJEXT) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
- $(Q) $(POSTLINK)
- $(if $(STRIP),$(Q) $(STRIP) $@)
-
-$(SCRIPTBINDIR)%$(EXEEXT): bin/% $(STUBPROGRAM) \
- $(if $(SCRIPTBINDIR),$(TIMESTAMPDIR)/.exec.time)
- $(ECHO) generating $@
- $(Q) { cat $(STUBPROGRAM); echo; sed -e '1{' -e '/^#!.*ruby/!i\' -e '#!/bin/ruby' -e '}' $<; } > $@
- $(Q) chmod +x $@
- $(Q) $(POSTLINK)
-
-$(TIMESTAMPDIR)/.exec.time:
- $(Q) mkdir exec
- $(Q) exit > $@
-
-.PHONY: commit
-commit: $(if $(filter commit,$(MAKECMDGOALS)),$(filter-out commit,$(MAKECMDGOALS)))
- @$(BASERUBY) -C "$(srcdir)" -I./tool -rvcs -e 'VCS.detect(".").commit'
- $(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY update-src srcs all-incs
-
-ifeq ($(words $(filter update-gems extract-gems,$(MAKECMDGOALS))),2)
-extract-gems: update-gems
endif
diff --git a/defs/id.def b/defs/id.def
index f30b993bd9..f7fffbde3c 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -1,7 +1,5 @@
# -*- mode: ruby; coding: us-ascii -*-
firstline, predefined = __LINE__+1, %[\
- max
- min
freeze
inspect
intern
@@ -38,15 +36,8 @@ firstline, predefined = __LINE__+1, %[\
to_a
to_s
to_i
- to_r
bt
bt_locations
- call
- mesg
- exception
- not NOT
- and AND
- or OR
_ UScore
"/*NULL*/" NULL
@@ -66,45 +57,6 @@ firstline, predefined = __LINE__+1, %[\
core#hash_merge_ary
core#hash_merge_ptr
core#hash_merge_kwd
-
- - debug#created_info
-
- $_ LASTLINE
- $~ BACKREF
-]
-
-# VM ID OP Parser Token
-token_ops = %[\
- Dot2 .. DOT2
- Dot3 ... DOT3
- UPlus +@ UPLUS
- UMinus -@ UMINUS
- Pow ** POW
- 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 ::
- ANDOP &&
- OROP ||
- ANDDOT &.
]
class KeywordError < RuntimeError
@@ -120,8 +72,6 @@ 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
@@ -138,10 +88,6 @@ 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
@@ -152,30 +98,21 @@ predefined.split(/^/).each_with_index do |line, num|
case name
when /\A[A-Z]\w*\z/; const_ids
when /\A(?!\d)\w+\z/; local_ids
- when /\A\$(?:\d+|(?!\d)\w+|\W)\z/; global_ids
+ 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/; attrset_ids
+ when /\A((?!\d)\w+)=\z/
+ KeywordError.raise("use ID2ATTRSET(#{$1}) instead of ATTRSET #{name}", firstline+num)
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 7f5422faef..1b5719aa85 100644
--- a/defs/keywords
+++ b/defs/keywords
@@ -1,8 +1,8 @@
%{
-struct kwtable {int name, id[2], state;};
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
-static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
+static const struct kwtable *reserved_word(const char *, unsigned int);
#define rb_reserved_word(str, len) reserved_word(str, len)
%}
@@ -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|EXPR_FITEM
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME
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|EXPR_FITEM
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME
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 b9c490d3a2..3cebe90a8e 100644
--- a/defs/known_errors.def
+++ b/defs/known_errors.def
@@ -143,6 +143,3 @@ EPROGMISMATCH
EPROGUNAVAIL
ERPCMISMATCH
EIPSEC
-EHWPOISON
-ECAPMODE
-ENOTCAPABLE
diff --git a/defs/lex.c.src b/defs/lex.c.src
index 7f5422faef..1b5719aa85 100644
--- a/defs/lex.c.src
+++ b/defs/lex.c.src
@@ -1,8 +1,8 @@
%{
-struct kwtable {int name, id[2], state;};
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
-static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
+static const struct kwtable *reserved_word(const char *, unsigned int);
#define rb_reserved_word(str, len) reserved_word(str, len)
%}
@@ -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|EXPR_FITEM
+alias, {keyword_alias, keyword_alias}, EXPR_FNAME
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|EXPR_FITEM
+undef, {keyword_undef, keyword_undef}, EXPR_FNAME
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_insn_unif.def b/defs/opt_insn_unif.def
index 31ae2eb6a1..1ac613dbea 100644
--- a/defs/opt_insn_unif.def
+++ b/defs/opt_insn_unif.def
@@ -8,10 +8,12 @@ __END__
putobject putobject
putobject putstring
putobject setlocal
+putobject setdynamic
putstring putstring
putstring putobject
putstring setlocal
+putstring setdynamic
# putnil end
diff --git a/defs/separated_version.mk b/defs/separated_version.mk
deleted file mode 100644
index f086f4b24a..0000000000
--- a/defs/separated_version.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# ******** FOR DEVELEPERS ONLY ********
-# Separate version.o into a shared library which varies every
-# revisions, in order to make the rest sharable.
-
-include $(firstword $(wildcard GNUmakefile Makefile))
-
-ifneq ($(filter @executable_path/%,$(DLDFLAGS)),)
-RUBY_VERSION_SO = $(subst ruby,ruby_version,$(LIBRUBY_SO))
-RUBY_VERSION_DLDFLAGS := $(patsubst @executable_path/%/$(LIBRUBY_SO),@loader_path/$(RUBY_VERSION_SO),$(DLDFLAGS)) -exported_symbol=Init_version
-else ifneq ($(findstring -soname,$(DLDFLAGS)),)
-RUBY_VERSION_SO = $(subst ruby,ruby_version,$(LIBRUBY_SO))
-RUBY_VERSION_DLDFLAGS := $(subst ruby,ruby_version,$(DLDFLAGS)) -Wl,-rpath-link,'$${ORIGIN}'
-else
-ERROR
-endif
-
-ifneq ($(RUBY_VERSION_SO),)
-
-version.$(OBJEXT): XCFLAGS := $(subst -fvisibility=hidden,,$(XCFLAGS))
-
-MINIOBJS += version.$(OBJEXT)
-DLDOBJS += $(RUBY_VERSION_SO)
-LIBRUBYARG_SHARED := -lruby_version $(LIBRUBYARG_SHARED)
-$(LIBRUBY_SO): COMMONOBJS := $(filter-out version.$(OBJEXT),$(COMMONOBJS))
-$(LIBRUBY_A): COMMONOBJS := $(sort version.$(OBJEXT) $(COMMONOBJS))
-
-$(LIBRUBY_SO): $(RUBY_VERSION_SO)
-
-$(RUBY_VERSION_SO): version.$(OBJEXT)
- $(ECHO) linking shared-library $@
- $(LDSHARED) $(RUBY_VERSION_DLDFLAGS) version.$(OBJEXT) $(OUTFLAG)$@
- -$(Q) $(MINIRUBY) -e 'ARGV.each{|link|' \
- -e 'File.delete link rescue nil' \
- -e 'File.symlink "$(RUBY_VERSION_SO)", link' \
- -e '}' \
- $(subst ruby,ruby_version,$(LIBRUBY_ALIASES)) || true
-
-endif
diff --git a/dir.c b/dir.c
index 351d36157a..09b78c6b4b 100644
--- a/dir.c
+++ b/dir.c
@@ -11,9 +11,9 @@
**********************************************************************/
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "internal.h"
-#include "encindex.h"
-#include "ruby/thread.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -22,26 +22,6 @@
#include <unistd.h>
#endif
-#ifndef O_CLOEXEC
-# define O_CLOEXEC 0
-#endif
-
-#ifndef USE_OPENDIR_AT
-# if defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD) && \
- defined(HAVE_OPENAT) && defined(HAVE_FSTATAT)
-# define USE_OPENDIR_AT 1
-# else
-# define USE_OPENDIR_AT 0
-# endif
-#endif
-#if USE_OPENDIR_AT
-# include <fcntl.h>
-#endif
-#ifndef AT_FDCWD
-# define AT_FDCWD -1
-#endif
-
-#undef HAVE_DIRENT_NAMLEN
#if defined HAVE_DIRENT_H && !defined _WIN32
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
@@ -51,7 +31,6 @@
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
-# define HAVE_DIRENT_NAMLEN 1
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
@@ -65,6 +44,10 @@
# include "win32/dir.h"
# endif
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/dirent.h"
+# include "nacl/stat.h"
+#endif
#include <errno.h>
@@ -80,8 +63,6 @@ char *strchr(char*,char);
#include "ruby/util.h"
-#define vm_initialized rb_cThread
-
/* define system APIs */
#ifdef _WIN32
#undef chdir
@@ -92,69 +73,24 @@ char *strchr(char*,char);
#define rmdir(p) rb_w32_urmdir(p)
#undef opendir
#define opendir(p) rb_w32_uopendir(p)
-#define ruby_getcwd() rb_w32_ugetcwd(NULL, 0)
-#define IS_WIN32 1
-#else
-#define IS_WIN32 0
-#endif
-
-#ifdef HAVE_SYS_ATTR_H
-#include <sys/attr.h>
-#endif
-
-#define USE_NAME_ON_FS_REAL_BASENAME 1 /* platform dependent APIs to
- * get real basenames */
-#define USE_NAME_ON_FS_BY_FNMATCH 2 /* select the matching
- * basename by fnmatch */
-
-#ifdef HAVE_GETATTRLIST
-# define USE_NAME_ON_FS USE_NAME_ON_FS_REAL_BASENAME
-# define RUP32(size) ((size)+3/4)
-# define SIZEUP32(type) RUP32(sizeof(type))
-#elif defined _WIN32
-# define USE_NAME_ON_FS USE_NAME_ON_FS_REAL_BASENAME
-#elif defined DOSISH
-# define USE_NAME_ON_FS USE_NAME_ON_FS_BY_FNMATCH
-#else
-# define USE_NAME_ON_FS 0
#endif
#ifdef __APPLE__
-# define NORMALIZE_UTF8PATH 1
+# define HAVE_HFS 1
#else
-# define NORMALIZE_UTF8PATH 0
+# define HAVE_HFS 0
#endif
-
-#if NORMALIZE_UTF8PATH
+#if HAVE_HFS
#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
-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;
- }
+is_hfs(DIR *dirp)
+{
+ struct statfs buf;
+ if (fstatfs(dirfd(dirp), &buf) == 0) {
+ return buf.f_type == 17; /* HFS on darwin */
}
-# endif
return FALSE;
}
@@ -169,31 +105,11 @@ has_nonascii(const char *ptr, size_t len)
return 0;
}
-# define IF_NORMALIZE_UTF8PATH(something) something
+# define IF_HAVE_HFS(something) something
#else
-# define IF_NORMALIZE_UTF8PATH(something) /* nothing */
+# define IF_HAVE_HFS(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
- 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
#define FNM_DOTMATCH 0x04
@@ -204,11 +120,6 @@ typedef enum {
#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
@@ -285,7 +196,7 @@ bracket(
return ok == not ? NULL : (char *)p + 1;
}
-/* If FNM_PATHNAME is set, only path element will be matched. (up to '/' or '\0')
+/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\0')
Otherwise, entire string will be matched.
End marker itself won't be compared.
And if function succeeds, *pcur reaches end marker.
@@ -440,7 +351,7 @@ VALUE rb_cDir;
struct dir_data {
DIR *dir;
- const VALUE path;
+ VALUE path;
rb_encoding *enc;
};
@@ -455,25 +366,35 @@ static void
dir_free(void *ptr)
{
struct dir_data *dir = ptr;
-
- if (dir->dir) closedir(dir->dir);
+ if (dir) {
+ if (dir->dir) closedir(dir->dir);
+ }
xfree(dir);
}
static size_t
dir_memsize(const void *ptr)
{
- return sizeof(struct dir_data);
+ return ptr ? sizeof(struct dir_data) : 0;
}
static const rb_data_type_t dir_data_type = {
"dir",
{dir_mark, dir_free, dir_memsize,},
- 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE dir_close(VALUE);
+#define GlobPathValue(str, safe) \
+ /* can contain null bytes as separators */ \
+ (!RB_TYPE_P((str), T_STRING) ? \
+ (void)FilePathValue(str) : \
+ (void)(check_safe_glob((str), (safe)), \
+ check_glob_encoding(str), (str)))
+#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0)
+#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding()))
+
static VALUE
dir_s_alloc(VALUE klass)
{
@@ -481,34 +402,12 @@ dir_s_alloc(VALUE klass)
VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp);
dirp->dir = NULL;
- RB_OBJ_WRITE(obj, &dirp->path, Qnil);
+ dirp->path = Qnil;
dirp->enc = NULL;
return obj;
}
-static void *
-nogvl_opendir(void *ptr)
-{
- const char *path = ptr;
-
- return (void *)opendir(path);
-}
-
-static DIR *
-opendir_without_gvl(const char *path)
-{
- if (vm_initialized) {
- union { const void *in; void *out; } u;
-
- u.in = path;
-
- return rb_thread_call_without_gvl(nogvl_opendir, u.out, RUBY_UBF_IO, 0);
- }
- else
- return opendir(path);
-}
-
/*
* call-seq:
* Dir.new( string ) -> aDir
@@ -516,7 +415,7 @@ opendir_without_gvl(const char *path)
*
* Returns a new directory object for the named directory.
*
- * The optional <i>encoding</i> keyword argument specifies the encoding of the directory.
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
* If not specified, the filesystem encoding is used.
*/
static VALUE
@@ -526,10 +425,9 @@ 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_id_encoding();
+ keyword_ids[0] = rb_intern("encoding");
}
fsenc = rb_filesystem_encoding();
@@ -544,7 +442,7 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
}
}
- FilePathValue(dirname);
+ GlobPathValue(dirname, FALSE);
orig = rb_str_dup_frozen(dirname);
dirname = rb_str_encode_ospath(dirname);
dirname = rb_str_dup_frozen(dirname);
@@ -552,30 +450,19 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dp);
if (dp->dir) closedir(dp->dir);
dp->dir = NULL;
- RB_OBJ_WRITE(dir, &dp->path, Qnil);
+ dp->path = Qnil;
dp->enc = fsenc;
- path = RSTRING_PTR(dirname);
- dp->dir = opendir_without_gvl(path);
+ dp->dir = opendir(RSTRING_PTR(dirname));
if (dp->dir == NULL) {
- int e = errno;
- if (rb_gc_for_fd(e)) {
- dp->dir = opendir_without_gvl(path);
- }
-#ifdef HAVE_GETATTRLIST
- else if (e == 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_without_gvl(path);
- }
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ dp->dir = opendir(RSTRING_PTR(dirname));
}
-#endif
if (dp->dir == NULL) {
- RB_GC_GUARD(dirname);
- rb_syserr_fail_path(e, orig);
+ rb_sys_fail_path(orig);
}
}
- RB_OBJ_WRITE(dir, &dp->path, orig);
+ dp->path = orig;
return dir;
}
@@ -587,7 +474,7 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
* Dir.open( string ) {| aDir | block } -> anObject
* Dir.open( string, encoding: enc ) {| aDir | block } -> anObject
*
- * The optional <i>encoding</i> keyword argument specifies the encoding of the directory.
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
* If not specified, the filesystem encoding is used.
*
* With no block, <code>open</code> is a synonym for
@@ -617,16 +504,11 @@ dir_closed(void)
}
static struct dir_data *
-dir_get(VALUE dir)
-{
- rb_check_frozen(dir);
- return rb_check_typeddata(dir, &dir_data_type);
-}
-
-static struct dir_data *
dir_check(VALUE dir)
{
- struct dir_data *dirp = dir_get(dir);
+ struct dir_data *dirp;
+ rb_check_frozen(dir);
+ dirp = rb_check_typeddata(dir, &dir_data_type);
if (!dirp->dir) dir_closed();
return dirp;
}
@@ -654,22 +536,9 @@ dir_inspect(VALUE dir)
rb_str_cat2(str, ">");
return str;
}
- return rb_funcallv(dir, rb_intern("to_s"), 0, 0);
+ return rb_funcall(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:
@@ -722,46 +591,11 @@ 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))
#endif
-/* safe to use without GVL */
-static int
-to_be_skipped(const struct dirent *dp)
-{
- const char *name = dp->d_name;
- if (name[0] != '.') return FALSE;
-#ifdef HAVE_DIRENT_NAMLEN
- switch (NAMLEN(dp)) {
- case 2:
- if (name[1] != '.') return FALSE;
- case 1:
- return TRUE;
- default:
- break;
- }
-#else
- if (!name[1]) return TRUE;
- if (name[1] != '.') return FALSE;
- if (!name[2]) return TRUE;
-#endif
- return FALSE;
-}
-
/*
* call-seq:
* dir.read -> string or nil
@@ -786,20 +620,11 @@ dir_read(VALUE dir)
return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc);
}
else {
- int e = errno;
- if (e != 0) rb_syserr_fail(e, 0);
+ if (errno != 0) rb_sys_fail(0);
return Qnil; /* end of stream */
}
}
-static VALUE dir_each_entry(VALUE, VALUE (*)(VALUE, VALUE), VALUE, int);
-
-static VALUE
-dir_yield(VALUE arg, VALUE path)
-{
- return rb_yield(path);
-}
-
/*
* call-seq:
* dir.each { |filename| block } -> dir
@@ -823,38 +648,27 @@ dir_yield(VALUE arg, VALUE path)
static VALUE
dir_each(VALUE dir)
{
- RETURN_ENUMERATOR(dir, 0, 0);
- return dir_each_entry(dir, dir_yield, Qnil, FALSE);
-}
-
-static VALUE
-dir_each_entry(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_only)
-{
struct dir_data *dirp;
struct dirent *dp;
- IF_NORMALIZE_UTF8PATH(int norm_p);
+ IF_HAVE_HFS(int hfs_p);
+ RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
- IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir, RSTRING_PTR(dirp->path)));
+ IF_HAVE_HFS(hfs_p = is_hfs(dirp->dir));
while ((dp = READDIR(dirp->dir, dirp->enc)) != NULL) {
const char *name = dp->d_name;
size_t namlen = NAMLEN(dp);
VALUE path;
-
- if (children_only && name[0] == '.') {
- if (namlen == 1) continue; /* current directory */
- if (namlen == 2 && name[1] == '.') continue; /* parent directory */
- }
-#if NORMALIZE_UTF8PATH
- if (norm_p && has_nonascii(name, namlen) &&
+#if HAVE_HFS
+ if (hfs_p && has_nonascii(name, namlen) &&
!NIL_P(path = rb_str_normalize_ospath(name, namlen))) {
path = rb_external_str_with_enc(path, dirp->enc);
}
else
#endif
path = rb_external_str_new_with_enc(name, namlen, dirp->enc);
- (*each)(arg, path);
+ rb_yield(path);
if (dirp->dir == NULL) dir_closed();
}
return dir;
@@ -967,8 +781,8 @@ dir_rewind(VALUE dir)
* call-seq:
* dir.close -> nil
*
- * Closes the directory stream.
- * Calling this method on closed Dir object is ignored since Ruby 2.3.
+ * Closes the directory stream. Any further attempts to access
+ * <em>dir</em> will raise an <code>IOError</code>.
*
* d = Dir.new("testdir")
* d.close #=> nil
@@ -978,22 +792,13 @@ dir_close(VALUE dir)
{
struct dir_data *dirp;
- dirp = dir_get(dir);
- if (!dirp->dir) return Qnil;
+ GetDIR(dir, dirp);
closedir(dirp->dir);
dirp->dir = NULL;
return Qnil;
}
-static void *
-nogvl_chdir(void *ptr)
-{
- const char *path = ptr;
-
- return (void *)(VALUE)chdir(path);
-}
-
static void
dir_chdir(VALUE path)
{
@@ -1076,6 +881,7 @@ 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);
@@ -1102,62 +908,24 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
args.done = FALSE;
return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args);
}
- else {
- char *p = RSTRING_PTR(path);
- int r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_chdir, p,
- RUBY_UBF_IO, 0);
- if (r < 0)
- rb_sys_fail_path(path);
- }
+ dir_chdir(path);
return INT2FIX(0);
}
-#ifndef _WIN32
VALUE
-rb_dir_getwd_ospath(void)
+rb_dir_getwd(void)
{
char *path;
VALUE cwd;
- VALUE path_guard;
-#undef RUBY_UNTYPED_DATA_WARNING
-#define RUBY_UNTYPED_DATA_WARNING 0
- path_guard = Data_Wrap_Struct((VALUE)0, NULL, RUBY_DEFAULT_FREE, NULL);
- path = ruby_getcwd();
- DATA_PTR(path_guard) = path;
-#ifdef __APPLE__
- cwd = rb_str_normalize_ospath(path, strlen(path));
- OBJ_TAINT(cwd);
-#else
+ path = my_getcwd();
cwd = rb_tainted_str_new2(path);
-#endif
- DATA_PTR(path_guard) = 0;
+ rb_enc_associate(cwd, rb_filesystem_encoding());
xfree(path);
return cwd;
}
-#endif
-
-VALUE
-rb_dir_getwd(void)
-{
- rb_encoding *fs = rb_filesystem_encoding();
- int fsenc = rb_enc_to_index(fs);
- VALUE cwd = rb_dir_getwd_ospath();
-
- switch (fsenc) {
- case ENCINDEX_US_ASCII:
- fsenc = ENCINDEX_ASCII;
- case ENCINDEX_ASCII:
- break;
-#if defined _WIN32 || defined __APPLE__
- default:
- return rb_str_conv_enc(cwd, NULL, fs);
-#endif
- }
- return rb_enc_associate_index(cwd, fsenc);
-}
/*
* call-seq:
@@ -1177,14 +945,15 @@ dir_s_getwd(VALUE dir)
return rb_dir_getwd();
}
-static VALUE
-check_dirname(VALUE dir)
+static void
+check_dirname(volatile 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);
@@ -1192,9 +961,8 @@ check_dirname(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);
}
- return rb_str_encode_ospath(d);
+ *dir = rb_str_encode_ospath(d);
}
#if defined(HAVE_CHROOT)
@@ -1210,7 +978,7 @@ check_dirname(VALUE dir)
static VALUE
dir_s_chroot(VALUE dir, VALUE path)
{
- path = check_dirname(path);
+ check_dirname(&path);
if (chroot(RSTRING_PTR(path)) == -1)
rb_sys_fail_path(path);
@@ -1220,19 +988,6 @@ dir_s_chroot(VALUE dir, VALUE path)
#define dir_s_chroot rb_f_notimplement
#endif
-struct mkdir_arg {
- const char *path;
- mode_t mode;
-};
-
-static void *
-nogvl_mkdir(void *ptr)
-{
- struct mkdir_arg *m = ptr;
-
- return (void *)(VALUE)mkdir(m->path, m->mode);
-}
-
/*
* call-seq:
* Dir.mkdir( string [, integer] ) -> 0
@@ -1251,34 +1006,23 @@ nogvl_mkdir(void *ptr)
static VALUE
dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
{
- struct mkdir_arg m;
VALUE path, vmode;
- int r;
+ int mode;
if (rb_scan_args(argc, argv, "11", &path, &vmode) == 2) {
- m.mode = NUM2MODET(vmode);
+ mode = NUM2INT(vmode);
}
else {
- m.mode = 0777;
+ mode = 0777;
}
- path = check_dirname(path);
- m.path = RSTRING_PTR(path);
- r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_mkdir, &m, RUBY_UBF_IO, 0);
- if (r < 0)
+ check_dirname(&path);
+ if (mkdir(RSTRING_PTR(path), mode) == -1)
rb_sys_fail_path(path);
return INT2FIX(0);
}
-static void *
-nogvl_rmdir(void *ptr)
-{
- const char *path = ptr;
-
- return (void *)(VALUE)rmdir(path);
-}
-
/*
* call-seq:
* Dir.delete( string ) -> 0
@@ -1291,61 +1035,26 @@ nogvl_rmdir(void *ptr)
static VALUE
dir_s_rmdir(VALUE obj, VALUE dir)
{
- const char *p;
- int r;
-
- dir = check_dirname(dir);
- p = RSTRING_PTR(dir);
- r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_rmdir, (void *)p, RUBY_UBF_IO, 0);
- if (r < 0)
+ 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)
{
- 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
+ rb_sys_warning("%s:%s", strerror(errno), (const char *)mesg);
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, enc) \
- ((flags & GLOB_VERBOSE) ? sys_enc_warning_in(RUBY_FUNCTION_NAME_STRING, (val), (enc)) :(void)0)
+#define sys_warning(val) \
+ (void)((flags & GLOB_VERBOSE) && rb_protect(sys_warning_1, (VALUE)(val), 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))
@@ -1353,53 +1062,33 @@ sys_enc_warning_in(const char *func, const char *mesg, rb_encoding *enc)
* ENOTDIR can be returned by stat(2) if a non-leaf element of the path
* is not a directory.
*/
-ALWAYS_INLINE(static int to_be_ignored(int e));
-static inline int
-to_be_ignored(int e)
-{
- return e == ENOENT || e == ENOTDIR;
-}
+#define to_be_ignored(e) ((e) == ENOENT || (e) == ENOTDIR)
#ifdef _WIN32
-#define STAT(p, s) rb_w32_ustati128((p), (s))
-#undef lstat
-#define lstat(p, s) rb_w32_ulstati128((p), (s))
+#define STAT(p, s) rb_w32_ustati64((p), (s))
#else
#define STAT(p, s) stat((p), (s))
#endif
-typedef int ruby_glob_errfunc(const char*, VALUE, const void*, int);
-typedef struct {
- ruby_glob_func *match;
- ruby_glob_errfunc *error;
-} ruby_glob_funcs_t;
-
/* System call with warning */
static int
-do_stat(int fd, const char *path, struct stat *pst, int flags, rb_encoding *enc)
+do_stat(const char *path, struct stat *pst, int flags)
+
{
-#if USE_OPENDIR_AT
- int ret = fstatat(fd, path, pst, 0);
-#else
int ret = STAT(path, pst);
-#endif
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path, enc);
+ sys_warning(path);
return ret;
}
-#if defined HAVE_LSTAT || defined lstat || USE_OPENDIR_AT
+#if defined HAVE_LSTAT || defined lstat
static int
-do_lstat(int fd, const char *path, struct stat *pst, int flags, rb_encoding *enc)
+do_lstat(const char *path, struct stat *pst, int flags)
{
-#if USE_OPENDIR_AT
- int ret = fstatat(fd, path, pst, AT_SYMLINK_NOFOLLOW);
-#else
int ret = lstat(path, pst);
-#endif
if (ret < 0 && !to_be_ignored(errno))
- sys_warning(path, enc);
+ sys_warning(path);
return ret;
}
@@ -1407,112 +1096,23 @@ do_lstat(int fd, const char *path, struct stat *pst, int flags, rb_encoding *enc
#define do_lstat do_stat
#endif
-struct opendir_at_arg {
- int basefd;
- const char *path;
-};
-
-static void *
-with_gvl_gc_for_fd(void *ptr)
-{
- int *e = ptr;
-
- return (void *)(rb_gc_for_fd(*e) ? Qtrue : Qfalse);
-}
-
-static int
-gc_for_fd_with_gvl(int e)
-{
- if (vm_initialized)
- return (int)(VALUE)rb_thread_call_with_gvl(with_gvl_gc_for_fd, &e);
- else
- return rb_gc_for_fd(e) ? Qtrue : Qfalse;
-}
-
-static void *
-nogvl_opendir_at(void *ptr)
-{
- const struct opendir_at_arg *oaa = ptr;
- DIR *dirp;
-
-#if USE_OPENDIR_AT
- const int opendir_flags = (O_RDONLY|O_CLOEXEC|
-# ifdef O_DIRECTORY
- O_DIRECTORY|
-# endif /* O_DIRECTORY */
- 0);
- int fd = openat(oaa->basefd, oaa->path, opendir_flags);
-
- dirp = fd >= 0 ? fdopendir(fd) : 0;
- if (!dirp) {
- int e = errno;
-
- switch (gc_for_fd_with_gvl(e)) {
- default:
- if (fd < 0) fd = openat(oaa->basefd, oaa->path, opendir_flags);
- if (fd >= 0) dirp = fdopendir(fd);
- if (dirp) return dirp;
-
- e = errno;
- /* fallthrough*/
- case 0:
- if (fd >= 0) close(fd);
- errno = e;
- }
- }
-#else /* !USE_OPENDIR_AT */
- dirp = opendir(oaa->path);
- if (!dirp && gc_for_fd_with_gvl(errno))
- dirp = opendir(oaa->path);
-#endif /* !USE_OPENDIR_AT */
-
- return dirp;
-}
-
-static DIR *
-opendir_at(int basefd, const char *path)
-{
- struct opendir_at_arg oaa;
-
- oaa.basefd = basefd;
- oaa.path = path;
-
- if (vm_initialized)
- return rb_thread_call_without_gvl(nogvl_opendir_at, &oaa, RUBY_UBF_IO, 0);
- else
- return nogvl_opendir_at(&oaa);
-}
-
static DIR *
-do_opendir(const int basefd, const char *path, int flags, rb_encoding *enc,
- ruby_glob_errfunc *errfunc, VALUE arg, int *status)
+do_opendir(const char *path, int flags, rb_encoding *enc)
{
DIR *dirp;
#ifdef _WIN32
- VALUE tmp = 0;
- if (!fundamental_encoding_p(enc)) {
+ volatile VALUE tmp;
+ if (enc != rb_usascii_encoding() &&
+ enc != rb_ascii8bit_encoding() &&
+ enc != rb_utf8_encoding()) {
tmp = rb_enc_str_new(path, strlen(path), enc);
tmp = rb_str_encode_ospath(tmp);
path = RSTRING_PTR(tmp);
}
#endif
- dirp = opendir_at(basefd, path);
- if (!dirp) {
- int e = errno;
-
- *status = 0;
- if (!to_be_ignored(e)) {
- if (errfunc) {
- *status = (*errfunc)(path, arg, enc, e);
- }
- else {
- sys_warning(path, enc);
- }
- }
- }
-#ifdef _WIN32
- if (tmp) rb_str_resize(tmp, 0); /* GC guard */
-#endif
+ dirp = opendir(path);
+ if (dirp == NULL && !to_be_ignored(errno))
+ sys_warning(path);
return dirp;
}
@@ -1537,23 +1137,14 @@ has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
return MAGICAL;
case '\\':
- if (escape && p++ >= pend)
- continue;
- break;
-
-#ifdef _WIN32
- case '.':
- break;
+ if (escape && !(c = *p++))
+ return PLAIN;
+ continue;
- case '~':
- hasalpha = 1;
- break;
-#endif
default:
- if (IS_WIN32 || ISALPHA(c)) {
+ if (ISALPHA(c)) {
hasalpha = 1;
}
- break;
}
p = Next(p-1, pend, enc);
@@ -1652,7 +1243,7 @@ glob_make_pattern(const char *p, const char *e, int flags, rb_encoding *enc)
else {
const char *m = find_dirsep(p, e, 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;
+ const enum glob_pattern_type non_magic = (HAVE_HFS || FNM_SYSCASE) ? PLAIN : ALPHA;
char *buf;
if (!(FNM_SYSCASE || magic > non_magic) && !recursive && *m) {
@@ -1712,7 +1303,7 @@ glob_free_pattern(struct glob_pattern *list)
}
static char *
-join_path(const char *path, size_t len, int dirsep, const char *name, size_t namlen)
+join_path(const char *path, long len, int dirsep, const char *name, size_t namlen)
{
char *buf = GLOB_ALLOC_N(char, len+namlen+(dirsep?1:0)+1);
@@ -1726,165 +1317,7 @@ join_path(const char *path, size_t len, int dirsep, const char *name, size_t nam
return buf;
}
-#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 == USE_NAME_ON_FS_REAL_BASENAME
-# error not implemented
-#endif
+enum answer {UNKNOWN = -1, NO, YES};
#ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -1901,8 +1334,6 @@ replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int f
struct glob_args {
void (*func)(const char *, VALUE, void *);
const char *path;
- const char *base;
- size_t baselen;
VALUE value;
rb_encoding *enc;
};
@@ -1918,85 +1349,16 @@ glob_func_caller(VALUE val)
return Qnil;
}
-struct glob_error_args {
- const char *path;
- rb_encoding *enc;
- int error;
-};
-
-static VALUE
-glob_func_warning(VALUE val)
-{
- struct glob_error_args *arg = (struct glob_error_args *)val;
- rb_syserr_enc_warning(arg->error, arg->enc, "%s", arg->path);
- return Qnil;
-}
-
-#if 0
-static int
-rb_glob_warning(const char *path, VALUE a, const void *enc, int error)
-{
- int status;
- struct glob_error_args args;
-
- args.path = path;
- args.enc = enc;
- args.error = error;
- rb_protect(glob_func_warning, (VALUE)&args, &status);
- return status;
-}
-#endif
-
-static VALUE
-glob_func_error(VALUE val)
-{
- struct glob_error_args *arg = (struct glob_error_args *)val;
- VALUE path = rb_enc_str_new_cstr(arg->path, arg->enc);
- rb_syserr_fail_str(arg->error, path);
- return Qnil;
-}
-
-static int
-rb_glob_error(const char *path, VALUE a, const void *enc, int error)
-{
- int status;
- struct glob_error_args args;
- VALUE (*errfunc)(VALUE) = glob_func_error;
-
- if (error == EACCES) {
- errfunc = glob_func_warning;
- }
- args.path = path;
- args.enc = enc;
- args.error = error;
- rb_protect(errfunc, (VALUE)&args, &status);
- return status;
-}
-
-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(
- int fd,
const char *path,
- size_t baselen,
- size_t namelen,
int dirsep, /* '/' should be placed before appending child entry's name to 'path'. */
- rb_pathtype_t pathtype, /* type of 'path' */
+ enum answer exist, /* Does 'path' indicate an existing entry? */
+ enum answer isdir, /* Does 'path' indicate a directory or a symlink to a directory? */
struct glob_pattern **beg,
struct glob_pattern **end,
int flags,
- const ruby_glob_funcs_t *funcs,
+ ruby_glob_func *func,
VALUE arg,
rb_encoding *enc)
{
@@ -2005,10 +1367,7 @@ 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);
- size_t pathlen = baselen + namelen;
- const char *base = path;
-
- if (fd != AT_FDCWD && *(base += baselen) == '/') base++;
+ long pathlen;
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
@@ -2021,11 +1380,7 @@ glob_helper(
plain = 1;
break;
case ALPHA:
-#if USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
- plain = 1;
-#else
magical = 1;
-#endif
break;
case MAGICAL:
magical = 2;
@@ -2041,131 +1396,125 @@ glob_helper(
}
}
- if (*base) {
- if (match_all && pathtype == path_unknown) {
- if (do_lstat(fd, base, &st, flags, enc) == 0) {
- pathtype = IFTODT(st.st_mode);
+ 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;
}
else {
- pathtype = path_noent;
+ exist = NO;
+ isdir = NO;
}
}
- if (match_dir && (pathtype == path_unknown || pathtype == path_symlink)) {
- if (do_stat(fd, base, &st, flags, enc) == 0) {
- pathtype = IFTODT(st.st_mode);
+ if (match_dir && isdir == UNKNOWN) {
+ if (do_stat(path, &st, flags) == 0) {
+ exist = YES;
+ isdir = S_ISDIR(st.st_mode) ? YES : NO;
}
else {
- pathtype = path_noent;
+ exist = NO;
+ isdir = NO;
}
}
- if (match_all && pathtype > path_noent) {
- const char *subpath = path + baselen + (baselen && path[baselen] == '/');
- status = glob_call_func(funcs->match, subpath, arg, enc);
+ if (match_all && exist == YES) {
+ status = glob_call_func(func, path, arg, enc);
if (status) return status;
}
- if (match_dir && pathtype == path_directory) {
- const char *subpath = path + baselen + (baselen && path[baselen] == '/');
- char *tmp = join_path(subpath, namelen, dirsep, "", 0);
+ if (match_dir && isdir == YES) {
+ char *tmp = join_path(path, pathlen, dirsep, "", 0);
if (!tmp) return -1;
- status = glob_call_func(funcs->match, tmp + (baselen ? dirsep : 0), arg, enc);
+ status = glob_call_func(func, tmp, arg, enc);
GLOB_FREE(tmp);
if (status) return status;
}
}
- if (pathtype == path_noent) return 0;
+ if (exist == NO || isdir == NO) return 0;
if (magical || recursive) {
struct dirent *dp;
DIR *dirp;
-# if USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH
+# ifdef DOSISH
char *plainname = 0;
# endif
- IF_NORMALIZE_UTF8PATH(int norm_p);
-# if USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH
+ IF_HAVE_HFS(int hfs_p);
+# ifdef DOSISH
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(fd, plainname, flags, enc, funcs->error, arg, &status);
+ dirp = do_opendir(plainname, flags, enc);
GLOB_FREE(plainname);
}
else
-# else
- ;
# endif
- dirp = do_opendir(fd, *base ? base : ".", flags, enc, funcs->error, arg, &status);
+ dirp = do_opendir(*path ? path : ".", flags, enc);
if (dirp == NULL) {
-# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+# if FNM_SYSCASE || HAVE_HFS
if ((magical < 2) && !recursive && (errno == EACCES)) {
/* no read permission, fallback */
goto literally;
}
# endif
- return status;
+ return 0;
}
- IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp, *base ? base : "."));
+ IF_HAVE_HFS(hfs_p = is_hfs(dirp));
-# if NORMALIZE_UTF8PATH
- if (!(norm_p || magical || recursive)) {
+# if HAVE_HFS
+ if (!(hfs_p || magical || recursive)) {
closedir(dirp);
goto literally;
}
-# endif
-# ifdef HAVE_GETATTRLIST
- if (is_case_sensitive(dirp, path) == 0)
- flags |= FNM_CASEFOLD;
+ flags |= FNM_CASEFOLD;
# endif
while ((dp = READDIR(dirp, enc)) != NULL) {
char *buf;
- rb_pathtype_t new_pathtype = path_unknown;
+ enum answer new_isdir = UNKNOWN;
const char *name;
size_t namlen;
int dotfile = 0;
- IF_NORMALIZE_UTF8PATH(VALUE utf8str = Qnil);
+ IF_HAVE_HFS(VALUE utf8str = Qnil);
- name = dp->d_name;
- namlen = NAMLEN(dp);
- if (recursive && name[0] == '.') {
+ if (recursive && dp->d_name[0] == '.') {
++dotfile;
- if (namlen == 1) {
+ if (!dp->d_name[1]) {
/* unless DOTMATCH, skip current directories not to recurse infinitely */
if (!(flags & FNM_DOTMATCH)) continue;
++dotfile;
- new_pathtype = path_directory; /* force to skip stat/lstat */
}
- else if (namlen == 2 && name[1] == '.') {
+ else if (dp->d_name[1] == '.' && !dp->d_name[2]) {
/* always skip parent directories not to recurse infinitely */
continue;
}
}
-# if NORMALIZE_UTF8PATH
- if (norm_p && has_nonascii(name, namlen)) {
+ name = dp->d_name;
+ namlen = NAMLEN(dp);
+# if HAVE_HFS
+ if (hfs_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_NORMALIZE_UTF8PATH(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
+ IF_HAVE_HFS(if (!NIL_P(utf8str)) rb_str_resize(utf8str, 0));
if (!buf) {
status = -1;
break;
}
name = buf + pathlen + (dirsep != 0);
-#ifdef DT_UNKNOWN
- if (dp->d_type != DT_UNKNOWN) {
- /* Got it. We need no more lstat. */
- new_pathtype = dp->d_type;
- }
-#endif
- if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1) &&
- new_pathtype == path_unknown) {
+ if (recursive && dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1)) {
/* RECURSIVE never match dot files unless FNM_DOTMATCH is set */
- if (do_lstat(fd, buf, &st, flags, enc) == 0)
- new_pathtype = IFTODT(st.st_mode);
+#ifndef _WIN32
+ if (do_lstat(buf, &st, flags) == 0)
+ new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
else
- new_pathtype = path_noent;
+ new_isdir = NO;
+#else
+ new_isdir = dp->d_isdir ? (!dp->d_isrep ? YES : UNKNOWN) : NO;
+#endif
}
new_beg = new_end = GLOB_ALLOC_N(struct glob_pattern *, (end - beg) * 2);
@@ -2178,16 +1527,13 @@ glob_helper(
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
if (p->type == RECURSIVE) {
- if (new_pathtype == path_directory || /* not symlink but real directory */
- new_pathtype == path_exist) {
- if (dotfile < ((flags & FNM_DOTMATCH) ? 2 : 1))
- *new_end++ = p; /* append recursive pattern */
- }
+ if (new_isdir == YES) /* not symlink but real directory */
+ *new_end++ = p; /* append recursive pattern */
p = p->next; /* 0 times recursion */
}
switch (p->type) {
case ALPHA:
-# if USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH
+# ifdef DOSISH
if (plainname) {
*new_end++ = p->next;
break;
@@ -2195,16 +1541,15 @@ glob_helper(
# endif
case PLAIN:
case MAGICAL:
- if (dirent_match(p->str, enc, name, dp, flags))
+ if (fnmatch(p->str, enc, name, flags) == 0)
*new_end++ = p->next;
default:
break;
}
}
- status = glob_helper(fd, buf, baselen, name - buf - baselen + namlen, 1,
- new_pathtype, new_beg, new_end,
- flags, funcs, arg, enc);
+ status = glob_helper(buf, 1, YES, new_isdir, new_beg, new_end,
+ flags, func, arg, enc);
GLOB_FREE(buf);
GLOB_FREE(new_beg);
if (status) break;
@@ -2215,7 +1560,7 @@ glob_helper(
else if (plain) {
struct glob_pattern **copy_beg, **copy_end, **cur2;
-# if FNM_SYSCASE || NORMALIZE_UTF8PATH
+# if FNM_SYSCASE || HAVE_HFS
literally:
# endif
copy_beg = copy_end = GLOB_ALLOC_N(struct glob_pattern *, end - beg);
@@ -2225,7 +1570,6 @@ glob_helper(
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;
@@ -2259,18 +1603,8 @@ glob_helper(
status = -1;
break;
}
-#if USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
- if ((*cur)->type == ALPHA) {
- buf = replace_real_basename(buf, pathlen + (dirsep != 0), enc,
- IF_NORMALIZE_UTF8PATH(1)+0,
- flags, &new_pathtype);
- if (!buf) break;
- }
-#endif
- status = glob_helper(fd, buf, baselen,
- namelen + strlen(buf + pathlen), 1,
- new_pathtype, new_beg, new_end,
- flags, funcs, arg, enc);
+ status = glob_helper(buf, 1, UNKNOWN, UNKNOWN, new_beg,
+ new_end, flags, func, arg, enc);
GLOB_FREE(buf);
GLOB_FREE(new_beg);
if (status) break;
@@ -2284,15 +1618,13 @@ glob_helper(
}
static int
-ruby_glob0(const char *path, int fd, const char *base, int flags,
- const ruby_glob_funcs_t *funcs, VALUE arg,
- rb_encoding *enc)
+ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
{
struct glob_pattern *list;
const char *root, *start;
char *buf;
- size_t n, baselen = 0;
- int status, dirsep = FALSE;
+ size_t n;
+ int status;
start = root = path;
flags |= FNM_SYSCASE;
@@ -2300,15 +1632,9 @@ ruby_glob0(const char *path, int fd, const char *base, int flags,
root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
#endif
- if (*root == '/') root++;
+ if (root && *root == '/') root++;
n = root - start;
- if (!n && base) {
- n = strlen(base);
- baselen = n;
- start = base;
- dirsep = TRUE;
- }
buf = GLOB_ALLOC_N(char, n + 1);
if (!buf) return -1;
MEMCPY(buf, start, char, n);
@@ -2319,9 +1645,7 @@ ruby_glob0(const char *path, int fd, const char *base, int flags,
GLOB_FREE(buf);
return -1;
}
- status = glob_helper(fd, buf, baselen, n-baselen, dirsep,
- path_unknown, &list, &list + 1,
- flags, funcs, arg, enc);
+ status = glob_helper(buf, 0, UNKNOWN, UNKNOWN, &list, &list + 1, flags, func, arg, enc);
glob_free_pattern(list);
GLOB_FREE(buf);
@@ -2331,11 +1655,8 @@ ruby_glob0(const char *path, int fd, const char *base, int flags,
int
ruby_glob(const char *path, int flags, ruby_glob_func *func, VALUE arg)
{
- ruby_glob_funcs_t funcs;
- funcs.match = func;
- funcs.error = NULL;
- return ruby_glob0(path, AT_FDCWD, 0, flags & ~GLOB_VERBOSE,
- &funcs, arg, rb_ascii8bit_encoding());
+ return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg,
+ rb_ascii8bit_encoding());
}
static int
@@ -2349,42 +1670,41 @@ rb_glob_caller(const char *path, VALUE a, void *enc)
return status;
}
-static const ruby_glob_funcs_t rb_glob_funcs = {
- rb_glob_caller, rb_glob_error,
-};
-
-void
-rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg)
+static int
+rb_glob2(const char *path, int flags,
+ void (*func)(const char *, VALUE, void *), VALUE arg,
+ rb_encoding* enc)
{
struct glob_args args;
- int status;
args.func = func;
args.value = arg;
- args.enc = rb_ascii8bit_encoding();
+ args.enc = enc;
- status = ruby_glob0(path, AT_FDCWD, 0, GLOB_VERBOSE, &rb_glob_funcs,
- (VALUE)&args, args.enc);
+ if (flags & FNM_SYSCASE) {
+ rb_warning("Dir.glob() ignores File::FNM_CASEFOLD");
+ }
+
+ return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args,
+ enc);
+}
+
+void
+rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg)
+{
+ int status = rb_glob2(path, 0, func, arg, rb_ascii8bit_encoding());
if (status) GLOB_JUMP_TAG(status);
}
static void
push_pattern(const char *path, VALUE ary, void *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);
+ rb_ary_push(ary, rb_external_str_new_with_enc(path, strlen(path), enc));
}
static int
ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
- rb_encoding *enc, VALUE var)
+ rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
const char *p = str;
@@ -2397,7 +1717,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
if (*p == '{' && nest++ == 0) {
lbrace = p;
}
- if (*p == '}' && lbrace && --nest == 0) {
+ if (*p == '}' && --nest <= 0) {
rbrace = p;
break;
}
@@ -2429,7 +1749,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
}
memcpy(buf+shift, t, p-t);
strlcpy(buf+shift+(p-t), rbrace+1, len-(shift+(p-t)));
- status = ruby_brace_expand(buf, flags, func, arg, enc, var);
+ status = ruby_brace_expand(buf, flags, func, arg, enc);
if (status) break;
}
GLOB_FREE(buf);
@@ -2438,12 +1758,11 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
status = glob_call_func(func, s, arg, enc);
}
- RB_GC_GUARD(var);
return status;
}
struct brace_args {
- ruby_glob_funcs_t funcs;
+ ruby_glob_func *func;
VALUE value;
int flags;
};
@@ -2453,97 +1772,64 @@ glob_brace(const char *path, VALUE val, void *enc)
{
struct brace_args *arg = (struct brace_args *)val;
- return ruby_glob0(path, AT_FDCWD, 0, arg->flags, &arg->funcs, arg->value, enc);
+ return ruby_glob0(path, arg->flags, arg->func, arg->value, enc);
}
-int
-ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
+static int
+ruby_brace_glob0(const char *str, int flags, ruby_glob_func *func, VALUE arg,
+ rb_encoding* enc)
{
struct brace_args args;
- flags &= ~GLOB_VERBOSE;
- args.funcs.match = func;
- args.funcs.error = NULL;
+ args.func = func;
args.value = arg;
args.flags = flags;
- return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args, enc, Qfalse);
+ return ruby_brace_expand(str, flags, glob_brace, (VALUE)&args, enc);
}
int
ruby_brace_glob(const char *str, int flags, ruby_glob_func *func, VALUE arg)
{
- return ruby_brace_glob_with_enc(str, flags, func, arg, rb_ascii8bit_encoding());
+ return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg,
+ rb_ascii8bit_encoding());
}
-struct push_glob_args {
- struct glob_args glob;
- int flags;
- int fd;
-};
-
-static int
-push_caller(const char *path, VALUE val, void *enc)
+int
+ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
{
- struct push_glob_args *arg = (struct push_glob_args *)val;
-
- return ruby_glob0(path, arg->fd, arg->glob.base, arg->flags, &rb_glob_funcs,
- (VALUE)&arg->glob, enc);
+ return ruby_brace_glob0(str, flags & ~GLOB_VERBOSE, func, arg, enc);
}
static int
-push_glob(VALUE ary, VALUE str, VALUE base, int flags)
+push_glob(VALUE ary, VALUE str, int flags)
{
- struct push_glob_args args;
- rb_encoding *enc = rb_enc_get(str);
+ struct glob_args args;
+#ifdef __APPLE__
+ rb_encoding *enc = rb_utf8_encoding();
-#if defined _WIN32 || defined __APPLE__
str = rb_str_encode_ospath(str);
+#else
+ rb_encoding *enc = rb_enc_get(str);
+
+ if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
+ if (enc == rb_usascii_encoding()) enc = rb_ascii8bit_encoding();
#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.glob.base = 0;
- args.flags = flags;
- args.fd = AT_FDCWD;
- if (!NIL_P(base)) {
- if (!RB_TYPE_P(base, T_STRING) || !rb_enc_check(str, base)) {
- struct dir_data *dirp = DATA_PTR(base);
- if (!dirp->dir) dir_closed();
-#ifdef HAVE_DIRFD
- if ((args.fd = dirfd(dirp->dir)) == -1)
- rb_sys_fail_path(dir_inspect(base));
-#endif
- base = dirp->path;
- }
- args.glob.base = RSTRING_PTR(base);
- }
-#if defined _WIN32 || defined __APPLE__
- enc = rb_utf8_encoding();
-#endif
+ args.func = push_pattern;
+ args.value = ary;
+ args.enc = enc;
- return ruby_brace_expand(RSTRING_PTR(str), flags,
- push_caller, (VALUE)&args, enc, str);
+ RB_GC_GUARD(str);
+ return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
+ rb_glob_caller, (VALUE)&args, enc);
}
static VALUE
-rb_push_glob(VALUE str, VALUE base, int flags) /* '\0' is delimiter */
+rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */
{
long offset = 0;
VALUE ary;
- /* can contain null bytes as separators */
- if (!RB_TYPE_P((str), T_STRING)) {
- FilePathValue(str);
- }
- else {
- rb_check_safe_obj(str);
- rb_enc_check(str, rb_enc_from_encoding(rb_usascii_encoding()));
- }
+ GlobPathValue(str, TRUE);
ary = rb_ary_new();
while (offset < RSTRING_LEN(str)) {
@@ -2551,7 +1837,7 @@ rb_push_glob(VALUE str, VALUE base, int flags) /* '\0' is delimiter */
int status;
p = RSTRING_PTR(str) + offset;
status = push_glob(ary, rb_enc_str_new(p, strlen(p), rb_enc_get(str)),
- base, flags);
+ flags);
if (status) GLOB_JUMP_TAG(status);
if (offset >= RSTRING_LEN(str)) break;
p += strlen(p) + 1;
@@ -2565,7 +1851,7 @@ rb_push_glob(VALUE str, VALUE base, int flags) /* '\0' is delimiter */
}
static VALUE
-dir_globs(long argc, const VALUE *argv, VALUE base, int flags)
+dir_globs(long argc, const VALUE *argv, int flags)
{
VALUE ary = rb_ary_new();
long i;
@@ -2573,80 +1859,45 @@ dir_globs(long argc, const VALUE *argv, VALUE base, int flags)
for (i = 0; i < argc; ++i) {
int status;
VALUE str = argv[i];
- FilePathValue(str);
- status = push_glob(ary, str, base, flags);
+ GlobPathValue(str, TRUE);
+ status = push_glob(ary, str, flags);
if (status) GLOB_JUMP_TAG(status);
}
return ary;
}
-static void
-dir_glob_options(VALUE opt, VALUE *base, int *flags)
-{
- ID kw[2];
- VALUE args[2];
- kw[0] = rb_intern("base");
- if (flags) kw[1] = rb_intern("flags");
- rb_get_kwargs(opt, kw, 0, flags ? 2 : 1, args);
- if (args[0] == Qundef || NIL_P(args[0])) {
- *base = Qnil;
- }
-#if USE_OPENDIR_AT
- else if (rb_typeddata_is_kind_of(args[0], &dir_data_type)) {
- *base = args[0];
- }
-#endif
- else {
- FilePathValue(args[0]);
- if (!RSTRING_LEN(args[0])) args[0] = Qnil;
- *base = args[0];
- }
- if (flags && args[1] != Qundef) {
- *flags = NUM2INT(args[1]);
- }
-}
-
/*
* call-seq:
- * Dir[ string [, string ...] [, base: path] ] -> array
+ * Dir[ array ] -> array
+ * Dir[ string [, string ...] ] -> array
*
* Equivalent to calling
- * <code>Dir.glob([</code><i>string,...</i><code>], 0)</code>.
+ * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
+ * <code>Dir.glob([</code><i>string,...</i><code>],0)</code>.
*
*/
static VALUE
dir_s_aref(int argc, VALUE *argv, VALUE obj)
{
- VALUE opts, base;
- argc = rb_scan_args(argc, argv, "*:", NULL, &opts);
- dir_glob_options(opts, &base, NULL);
if (argc == 1) {
- return rb_push_glob(argv[0], base, 0);
+ return rb_push_glob(argv[0], 0);
}
- return dir_globs(argc, argv, base, 0);
+ return dir_globs(argc, argv, 0);
}
/*
* call-seq:
- * Dir.glob( pattern, [flags], [base: path] ) -> array
- * Dir.glob( pattern, [flags], [base: path] ) { |filename| block } -> nil
+ * Dir.glob( pattern, [flags] ) -> matches
+ * Dir.glob( pattern, [flags] ) { |filename| block } -> nil
*
- * Expands +pattern+, which is a pattern string or an Array of pattern
- * strings, and returns an array containing the matching filenames.
- * If a block is given, calls the block once for each matching filename,
- * passing the filename as a parameter to the block.
+ * Expands +pattern+, which is an Array of patterns or a pattern String, and
+ * returns the results as +matches+ or as arguments given to the block.
*
- * The optional +base+ keyword argument specifies the base directory for
- * interpreting relative pathnames instead of the current working directory.
- * As the results are not prefixed with the base directory name in this
- * case, you will need to prepend the base directory name if you want real
- * paths.
- *
- * Note that the pattern is not a regexp, it's closer to a shell glob.
- * See File::fnmatch for the meaning of the +flags+ parameter.
- * Case sensitivity depends on your system (File::FNM_CASEFOLD is ignored),
- * as does the order in which the results are returned.
+ * Note that this pattern is not a regexp, it's closer to a shell glob. See
+ * File::fnmatch for the meaning of the +flags+ parameter. Note that case
+ * sensitivity depends on your system (so File::FNM_CASEFOLD is ignored), as
+ * does the order in which the results are returned.
*
* <code>*</code>::
* Matches any file. Can be restricted by other values in the glob.
@@ -2700,10 +1951,6 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
* Dir.glob(rbfiles) #=> ["main.rb",
* # "lib/song.rb",
* # "lib/song/karaoke.rb"]
- *
- * Dir.glob(rbfiles, base: "lib") #=> ["song.rb",
- * # "song/karaoke.rb"]
- *
* libdirs = File.join("**", "lib")
* Dir.glob(libdirs) #=> ["lib"]
*
@@ -2717,23 +1964,21 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
static VALUE
dir_s_glob(int argc, VALUE *argv, VALUE obj)
{
- VALUE str, rflags, ary, opts, base;
+ VALUE str, rflags, ary;
int flags;
- argc = rb_scan_args(argc, argv, "11:", &str, &rflags, &opts);
- if (argc == 2)
+ if (rb_scan_args(argc, argv, "11", &str, &rflags) == 2)
flags = NUM2INT(rflags);
else
flags = 0;
- dir_glob_options(opts, &base, &flags);
ary = rb_check_array_type(str);
if (NIL_P(ary)) {
- ary = rb_push_glob(str, base, flags);
+ ary = rb_push_glob(str, flags);
}
else {
VALUE v = ary;
- ary = dir_globs(RARRAY_LEN(v), RARRAY_CONST_PTR(v), base, flags);
+ ary = dir_globs(RARRAY_LEN(v), RARRAY_CONST_PTR(v), flags);
RB_GC_GUARD(v);
}
@@ -2747,7 +1992,7 @@ dir_s_glob(int argc, VALUE *argv, VALUE obj)
static VALUE
dir_open_dir(int argc, VALUE *argv)
{
- VALUE dir = rb_funcallv(rb_cDir, rb_intern("open"), argc, argv);
+ VALUE dir = rb_funcall2(rb_cDir, rb_intern("open"), argc, argv);
rb_check_typeddata(dir, &dir_data_type);
return dir;
@@ -2787,14 +2032,6 @@ dir_foreach(int argc, VALUE *argv, VALUE io)
return Qnil;
}
-static VALUE
-dir_collect(VALUE dir)
-{
- VALUE ary = rb_ary_new();
- dir_each_entry(dir, rb_ary_push, ary, FALSE);
- return ary;
-}
-
/*
* call-seq:
* Dir.entries( dirname ) -> array
@@ -2804,8 +2041,8 @@ dir_collect(VALUE dir)
* directory. Will raise a <code>SystemCallError</code> if the named
* directory doesn't exist.
*
- * The optional <i>encoding</i> keyword argument specifies the encoding of the
- * directory. If not specified, the filesystem encoding is used.
+ * The optional <i>enc</i> argument specifies the encoding of the directory.
+ * If not specified, the filesystem encoding is used.
*
* Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"]
*
@@ -2816,77 +2053,7 @@ dir_entries(int argc, VALUE *argv, VALUE io)
VALUE dir;
dir = dir_open_dir(argc, argv);
- return rb_ensure(dir_collect, dir, dir_close, dir);
-}
-
-static VALUE
-dir_each_child(VALUE dir)
-{
- return dir_each_entry(dir, dir_yield, Qnil, TRUE);
-}
-
-/*
- * call-seq:
- * Dir.each_child( dirname ) {| filename | block } -> nil
- * Dir.each_child( dirname, encoding: enc ) {| filename | block } -> nil
- * Dir.each_child( dirname ) -> an_enumerator
- * Dir.each_child( dirname, encoding: enc ) -> an_enumerator
- *
- * Calls the block once for each entry except for "." and ".." in the
- * named directory, passing the filename of each entry as a parameter
- * to the block.
- *
- * If no block is given, an enumerator is returned instead.
- *
- * Dir.each_child("testdir") {|x| puts "Got #{x}" }
- *
- * <em>produces:</em>
- *
- * Got config.h
- * Got main.rb
- *
- */
-static VALUE
-dir_s_each_child(int argc, VALUE *argv, VALUE io)
-{
- VALUE dir;
-
- RETURN_ENUMERATOR(io, argc, argv);
- dir = dir_open_dir(argc, argv);
- rb_ensure(dir_each_child, dir, dir_close, dir);
- return Qnil;
-}
-
-static VALUE
-dir_collect_children(VALUE dir)
-{
- VALUE ary = rb_ary_new();
- dir_each_entry(dir, rb_ary_push, ary, TRUE);
- return ary;
-}
-
-/*
- * call-seq:
- * Dir.children( dirname ) -> array
- * Dir.children( dirname, encoding: enc ) -> array
- *
- * Returns an array containing all of the filenames except for "."
- * and ".." in the given directory. Will raise a
- * <code>SystemCallError</code> if the named directory doesn't exist.
- *
- * The optional <i>encoding</i> keyword argument specifies the encoding of the
- * directory. If not specified, the filesystem encoding is used.
- *
- * Dir.children("testdir") #=> ["config.h", "main.rb"]
- *
- */
-static VALUE
-dir_s_children(int argc, VALUE *argv, VALUE io)
-{
- VALUE dir;
-
- dir = dir_open_dir(argc, argv);
- return rb_ensure(dir_collect_children, dir, dir_close, dir);
+ return rb_ensure(rb_Array, dir, dir_close, dir);
}
static int
@@ -3029,7 +2196,7 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
args.value = path;
args.flags = flags;
if (ruby_brace_expand(RSTRING_PTR(pattern), flags, fnmatch_brace,
- (VALUE)&args, rb_enc_get(pattern), pattern) > 0)
+ (VALUE)&args, rb_enc_get(pattern)) > 0)
return Qtrue;
}
else {
@@ -3081,7 +2248,7 @@ dir_s_home(int argc, VALUE *argv, VALUE obj)
*
*/
VALUE
-rb_file_directory_p(void)
+rb_file_directory_p()
{
}
#endif
@@ -3099,85 +2266,6 @@ rb_dir_exists_p(VALUE obj, VALUE fname)
return rb_file_directory_p(obj, fname);
}
-static void *
-nogvl_dir_empty_p(void *ptr)
-{
- const char *path = ptr;
- DIR *dir = opendir(path);
- struct dirent *dp;
- VALUE result = Qtrue;
-
- if (!dir) {
- int e = errno;
- switch (gc_for_fd_with_gvl(e)) {
- default:
- dir = opendir(path);
- if (dir) break;
- e = errno;
- /* fall through */
- case 0:
- if (e == ENOTDIR) return (void *)Qfalse;
- errno = e; /* for rb_sys_fail_path */
- return (void *)Qundef;
- }
- }
- while ((dp = READDIR(dir, NULL)) != NULL) {
- if (!to_be_skipped(dp)) {
- result = Qfalse;
- break;
- }
- }
- closedir(dir);
- return (void *)result;
-}
-
-/*
- * call-seq:
- * Dir.empty?(path_name) -> true or false
- *
- * Returns <code>true</code> if the named file is an empty directory,
- * <code>false</code> if it is not a directory or non-empty.
- */
-static VALUE
-rb_dir_s_empty_p(VALUE obj, VALUE dirname)
-{
- VALUE result, orig;
- const char *path;
- enum {false_on_notdir = 1};
-
- FilePathValue(dirname);
- orig = rb_str_dup_frozen(dirname);
- dirname = rb_str_encode_ospath(dirname);
- dirname = rb_str_dup_frozen(dirname);
- path = RSTRING_PTR(dirname);
-
-#if defined HAVE_GETATTRLIST && defined ATTR_DIR_ENTRYCOUNT
- {
- u_int32_t attrbuf[SIZEUP32(fsobj_tag_t)];
- struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_OBJTAG,};
- if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0) != 0)
- rb_sys_fail_path(orig);
- if (*(const fsobj_tag_t *)(attrbuf+1) == VT_HFS) {
- al.commonattr = 0;
- al.dirattr = ATTR_DIR_ENTRYCOUNT;
- if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0) == 0) {
- if (attrbuf[0] >= 2 * sizeof(u_int32_t))
- return attrbuf[1] ? Qfalse : Qtrue;
- if (false_on_notdir) return Qfalse;
- }
- rb_sys_fail_path(orig);
- }
- }
-#endif
-
- result = (VALUE)rb_thread_call_without_gvl(nogvl_dir_empty_p, (void *)path,
- RUBY_UBF_IO, 0);
- if (result == Qundef) {
- rb_sys_fail_path(orig);
- }
- return result;
-}
-
/*
* Objects of class <code>Dir</code> are directory streams representing
* directories in the underlying file system. They provide a variety of
@@ -3200,8 +2288,6 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir, "open", dir_s_open, -1);
rb_define_singleton_method(rb_cDir, "foreach", dir_foreach, -1);
rb_define_singleton_method(rb_cDir, "entries", dir_entries, -1);
- rb_define_singleton_method(rb_cDir, "each_child", dir_s_each_child, -1);
- rb_define_singleton_method(rb_cDir, "children", dir_s_children, -1);
rb_define_method(rb_cDir,"initialize", dir_initialize, -1);
rb_define_method(rb_cDir,"fileno", dir_fileno, 0);
@@ -3231,7 +2317,6 @@ Init_Dir(void)
rb_define_singleton_method(rb_cDir,"[]", dir_s_aref, -1);
rb_define_singleton_method(rb_cDir,"exist?", rb_file_directory_p, 1);
rb_define_singleton_method(rb_cDir,"exists?", rb_dir_exists_p, 1);
- rb_define_singleton_method(rb_cDir,"empty?", rb_dir_s_empty_p, 1);
rb_define_singleton_method(rb_cFile,"fnmatch", file_s_fnmatch, -1);
rb_define_singleton_method(rb_cFile,"fnmatch?", file_s_fnmatch, -1);
@@ -3275,11 +2360,4 @@ Init_Dir(void)
* 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 55f29fda51..2b6a82f063 100644
--- a/dln.c
+++ b/dln.c
@@ -85,6 +85,10 @@ char *getenv();
# endif
#endif
+#if defined(__BEOS__) || defined(__HAIKU__)
+# include <image.h>
+#endif
+
#ifndef dln_loaderror
static void
dln_loaderror(const char *format, ...)
@@ -102,12 +106,13 @@ dln_loaderror(const char *format, ...)
# define USE_DLN_DLOPEN
#endif
-#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(NeXT) || defined(MACOSX_DYLD)
-# define EXTERNAL_PREFIX "_"
-#else
-# define EXTERNAL_PREFIX ""
+#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
#endif
-#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
#if defined __CYGWIN__ || defined DOSISH
#define isdirsep(x) ((x) == '/' || (x) == '\\')
@@ -1113,12 +1118,12 @@ dln_sym(const char *name)
#endif
#endif
-#ifdef _WIN32
+#if defined _WIN32 && !defined __CYGWIN__
#include <windows.h>
#include <imagehlp.h>
#endif
-#ifdef _WIN32
+#if defined _WIN32 && !defined __CYGWIN__
static const char *
dln_strerror(char *message, size_t size)
{
@@ -1245,14 +1250,12 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
void*
dln_load(const char *file)
{
-#if (defined _WIN32 || defined USE_DLN_DLOPEN) && defined RUBY_EXPORT
- static const char incompatible[] = "incompatible library version";
-#endif
#if !defined(_AIX) && !defined(NeXT)
const char *error = 0;
+#define DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))
#endif
-#if defined _WIN32
+#if defined _WIN32 && !defined __CYGWIN__
HINSTANCE handle;
WCHAR *winfile;
char message[1024];
@@ -1280,7 +1283,7 @@ dln_load(const char *file)
#if defined _WIN32 && defined RUBY_EXPORT
if (!rb_w32_check_imported(handle, rb_libruby_handle())) {
FreeLibrary(handle);
- error = incompatible;
+ error = "incompatible library version";
goto failed;
}
#endif
@@ -1322,34 +1325,30 @@ 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
- {
- 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 (init_fct == NULL) {
- const size_t errlen = strlen(error = dln_strerror()) + 1;
- error = memcpy(ALLOCA_N(char, errlen), error, errlen);
+ error = DLN_ERROR();
dlclose(handle);
goto failed;
}
@@ -1442,6 +1441,54 @@ 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 b08612764e..56a19818cf 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -48,6 +48,13 @@ char *dln_argv0;
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifndef MAXPATHLEN
+# define MAXPATHLEN 1024
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -269,15 +276,13 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
}
goto next;
}
-#endif
+#endif /* _WIN32 or __EMX__ */
-#ifndef S_ISREG
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
- if (stat(fbuf, &st) == 0 && S_ISREG(st.st_mode)) {
+ if (stat(fbuf, &st) == 0) {
if (exe_flag == 0) return fbuf;
/* looking for executable */
- if (eaccess(fbuf, X_OK) == 0) return fbuf;
+ if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
+ return fbuf;
}
next:
/* if not, and no other alternatives, life is bleak */
diff --git a/dmydln.c b/dmydln.c
index 0fc0a5325e..25872efc98 100644
--- a/dmydln.c
+++ b/dmydln.c
@@ -1,6 +1,5 @@
#include "ruby/ruby.h"
-NORETURN(void *dln_load(const char *));
void*
dln_load(const char *file)
{
diff --git a/dmyenc.c b/dmyenc.c
deleted file mode 100644
index 7e006e826c..0000000000
--- a/dmyenc.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#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 4d273f7faf..34ea7a02f4 100644
--- a/dmyext.c
+++ b/dmyext.c
@@ -2,3 +2,8 @@ void
Init_ext(void)
{
}
+
+void
+Init_enc(void)
+{
+}
diff --git a/doc/.document b/doc/.document
index d739c9f6bc..b48c0387a7 100644
--- a/doc/.document
+++ b/doc/.document
@@ -1,3 +1,4 @@
*.rdoc
+ChangeLog*
NEWS-*
syntax
diff --git a/doc/ChangeLog-0.06_to_0.52 b/doc/ChangeLog-0.06_to_0.52
deleted file mode 100644
index 63826081b3..0000000000
--- a/doc/ChangeLog-0.06_to_0.52
+++ /dev/null
@@ -1,1147 +0,0 @@
-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
deleted file mode 100644
index 5f5b03ff40..0000000000
--- a/doc/ChangeLog-0.50_to_0.60
+++ /dev/null
@@ -1,462 +0,0 @@
-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
deleted file mode 100644
index 33b0326892..0000000000
--- a/doc/ChangeLog-0.60_to_1.1
+++ /dev/null
@@ -1,3955 +0,0 @@
-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 3f7d6bfb3c..07d7c6b165 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
- argument type mismatch, and inline method_list().
+ arguement 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 accidentally removed.
+ * lib/net/pop.rb: Exception line was accidentaly 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 receiver's type.
+ really a module, whose methods must be safe for reciever's type.
* eval.c (rb_eval): nosuper should not be inherited unless the
overwritten method is an undef placeholder.
@@ -21236,7 +21236,7 @@ Sun Jan 3 01:37:58 1999 Takao KAWAMURA <kawamura@ike.tottori-u.ac.jp>
Sat Jan 2 17:09:06 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_jump_tag): new api to invoke JUMP_TAG. tag values
- can be obtained from rb_eval_string_protect()/rb_load_protect().
+ can obtained from rb_eval_string_protect()/rb_load_protect().
* eval.c (rb_rescue): now catches all exceptions but SystemExit.
diff --git a/doc/ChangeLog-1.9.3 b/doc/ChangeLog-1.9.3
index eecfc44325..e9ede641f5 100644
--- a/doc/ChangeLog-1.9.3
+++ b/doc/ChangeLog-1.9.3
@@ -3325,7 +3325,7 @@ Thu May 19 06:30:38 2011 Eric Hodel <drbrain@segment7.net>
Thu May 19 06:16:41 2011 Eric Hodel <drbrain@segment7.net>
* lib: Convert tabs to spaces for ruby files per
- https://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
+ http://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
Patch by Steve Klabnik [Ruby 1.9 - Bug #4730]
Patch by Jason Dew [Ruby 1.9 - Feature #4718]
@@ -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 conversion with #to_str. [ruby-dev:43169] fixes #4362
+ implicit convertion with #to_str. [ruby-dev:43169] fixes #4362
* test/ruby/test_signal.rb (test_signal_process_group): add a test
for send signal to process group.
@@ -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 conversion.
+ parameter to get rid of wrong convertion.
* 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
- made by make_temfile is already closed.
+ maked by make_temfile is already closed.
Tue Dec 14 13:52:19 2010 NAKAMURA Usaku <usa@ruby-lang.org>
@@ -12814,7 +12814,7 @@ Thu Aug 5 22:09:30 2010 Tanaka Akira <akr@fsij.org>
Thu Aug 5 21:20:31 2010 Yusuke Endoh <mame@tsg.ne.jp>
* compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): drop unused ARGSCAT
- results when popped is true. [ruby-dev:41933], [Bug #3658]
+ results when poped is true. [ruby-dev:41933], [Bug #3658]
This is retry of r28870 and r28873 which were reverted.
Thu Aug 5 20:13:49 2010 Nobuyoshi Nakada <nobu@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-conversion encoding.
+ * io.c (rb_scan_open_args): add UTF8-MAC to no-convertion 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.
- (committed at r20981)
+ (commited 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: committed magic for reducing RVALUE size on windows. (24->20byte)
+ * gc.c: commited 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
- accidentally HAVE_CLOSESOCKET is defined on windows again because
+ accidently 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): conversion from `int' to `char' discards
+ * bignum.c (bignew_1): convertion 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 conversion.
+ * dln.c: avoid warning of const to non-const convertion.
[ruby-dev:27041]
* eval.c, io.c, ruby.c: ditto.
@@ -77162,7 +77162,7 @@ Sun May 22 21:54:06 2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
Sun May 22 19:11:35 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#initialize):
+ * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#intialize):
should initialize session id context. [ruby-core:4663]
* ext/openssl/ossl_ssl.c (ossl_sslctx_setup): add session id support.
@@ -82601,7 +82601,7 @@ Sat Sep 18 14:10:23 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to
the original directory when exception has caused in changing
- directory or within block. thanks to Johan Holmberg
+ direcotry or within block. thanks to Johan Holmberg
<holmberg@iar.se> [ruby-core:03446]
Fri Sep 17 20:29:33 2004 NAKAMURA Usaku <usa@ruby-lang.org>
@@ -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 information.
+ * ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
* 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 omitted. [ruby-dev:23883]
+ "-I.FE-X" which both "I" and "F" are ommitted. [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) control Tk interpreters
+ * ext/tk/lib/remote-tk.rb: (NEW library) controll 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 compatibility)
+ (Rev1.112 lost compatiblity)
* dir.c (fnmatch_helper): File.fnmatch('\/', '/', File::FNM_PATHNAME)
- should return true. (Rev1.112 lost compatibility)
+ should return true. (Rev1.112 lost compatiblity)
* 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. (referring to mingw)
+ * bcc32/Makefile.sub: show more warnings. (refering 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 achieved by calling downcase() for single-byte
+ in Win32. This is achived 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: slightly improved documentation (sync with 1.8)
+ * lib/fileutils.rb: slighly improved documentation (sync with 1.8)
Fri Feb 13 19:57:01 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 receives the exception of the callback.
+ TkTimer#wait recieves 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
index 76edfd3ce7..f80b2d6bd1 100644
--- a/doc/ChangeLog-2.1.0
+++ b/doc/ChangeLog-2.1.0
@@ -2948,7 +2948,7 @@ Tue Nov 5 03:31:23 2013 Koichi Sasada <ko1@atdot.net>
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 promote as old
+ 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.
diff --git a/doc/ChangeLog-2.2.0 b/doc/ChangeLog-2.2.0
deleted file mode 100644
index 5a7dbf826d..0000000000
--- a/doc/ChangeLog-2.2.0
+++ /dev/null
@@ -1,12157 +0,0 @@
-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-2.3.0 b/doc/ChangeLog-2.3.0
deleted file mode 100644
index 7f3c4e672a..0000000000
--- a/doc/ChangeLog-2.3.0
+++ /dev/null
@@ -1,12187 +0,0 @@
-Thu Dec 24 23:01:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: added entry for CGI.escapeHTML optimization.
-
-Thu Dec 24 18:43:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_compile_error_with_enc, rb_compile_error),
- (rb_compile_bug): deprecate internal functions.
-
- * parse.y (parser_yyerror): construct exception message with
- source code and caret.
-
-Thu Dec 24 17:25:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (append_compile_error), parse.y (compile_error):
- preserve encoding of source file name in exceptions.
-
- * error.c (rb_compile_error_str, rb_compile_bug_str): add.
-
-Thu Dec 24 16:17:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (fake.rb): $(arch)-fake.rb must depend on miniruby because
- it may depend on miniruby.
-
-Thu Dec 24 16:13:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (ripper.c): r50045 wrongly replace $(PWD) with ../..
- It is the top of build directory, not topsrcdir.
-
-Thu Dec 24 15:02:42 2015 sorah (Shota Fukumori) <her@sorah.jp>
-
- * tool/vcs.rb (IO.popen): Refactor. Avoid assigning in condition.
-
-Thu Dec 24 15:01:38 2015 sorah (Shota Fukumori) <her@sorah.jp>
-
- * tool/file2lastrev.rb: Fix ArgumentError to work on Ruby 1.8.7.
-
-Thu Dec 24 14:44:08 2015 sorah (Shota Fukumori) <her@sorah.jp>
-
- * tool/vcs.rb (IO.popen): Enable on Ruby 1.9 where chdir option is not
- supported on IO.popen
-
- * tool/vcs.rb (IO.popen): Fix NoMethodError. I guess r49705 was not
- tested... :/
-
-Thu Dec 24 14:57:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * NEWS: rename
- "Implementation changes" section to
- "Supported platform changes" section.
-
- * NEWS: add "Implementation improvements" and add several entries.
-
- * NEWS: add NEWS entries by Eric Wong. [ruby-core:72450]
-
-Thu Dec 24 00:26:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
- * ext/io/console/io-console.gemspec: include depend file and
- win32_vk header.
-
-Wed Dec 23 23:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_readwrite_syserr_fail): works with the given errno than
- thread local errno.
-
-Wed Dec 23 17:57:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Dec 23 11:58:52 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * 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]
-
-Wed Dec 23 07:15:17 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/init.c (rsock_init_sock): reject reserved FDs
- [ruby-core:72445] [Bug #11862]
-
-Wed Dec 23 02:59:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (__STDC_WANT_LIB_EXT1__): necessary to use memset_s
- in strict C99 mode.
-
-Wed Dec 23 02:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Dec 23 02:23:19 2015 Yuki Nishijima <mail@yukinishijima.net>
-
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0
-
- * NEWS: Add news about the did_you_mean gem
-
-Wed Dec 23 02:18:57 2015 Jake Worth <jakeworth82@gmail.com>
-
- * doc/contributing.rdoc: [DOC] remove an extra word "here".
- [Fix GH-1169]
-
-Wed Dec 23 01:58:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regexec.c (USE_DIRECT_THREADED_VM): enable direct threaded VM by
- the default.
-
-Tue Dec 22 22:15:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (internal_object_p): should not expose singleton classes
- without a metaclass. based on patches by ko1 and shugo.
- [Bug #11740]
-
- * class.c (rb_singleton_class_object_p): added.
-
-Tue Dec 22 22:15:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/console/io-console.gemspec: bump up to 0.4.4.
-
-Tue Dec 22 22:11:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Added news entry of Psych 2.0.17
-
-Tue Dec 22 22:09:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Added news entry of RDoc 4.2.1
-
-Tue Dec 22 21:20:00 2015 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.gemspec: bump version to 1.2.8.
-
-Tue Dec 22 21:08:05 2015 SHIBATA Hiroshi <hsbt@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.
-
-Tue Dec 22 20:25:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/lib/psych.rb: bump version to 2.0.17
- * ext/psych/psych.gemspec: ditto.
-
-Tue Dec 22 20:14:47 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c: move vm_callee_setup_block_arg() (and related
- functions) to the latter location.
- This moving recovers performance a little.
- [Bug #11829]
-
-Tue Dec 22 15:21:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_compat_and_valid): as scrub does nothing for dummy
- encoding string now, incompatible encoding is not a matter.
-
-Tue Dec 22 14:31:28 2015 Toru Iwase <tietew@tietew.net>
-
- * ext/cgi/escape/escape.c (optimized_escape_html): CGI.escapeHTML
- should return unfrozen new string.
- [ruby-core:72426] [Bug #11858]
-
-Tue Dec 22 05:39:58 2015 Takashi Kokubun <takashikkbn@gmail.com>
-
- * ext/cgi/escape/escape.c (preserve_original_state): Preserve
- original state for tainted and frozen. [Fix GH-1166]
- [ruby-dev:49451] [Bug #11855]
-
-Tue Dec 22 03:57:20 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Mon Dec 21 21:29:45 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Mon Dec 21 12:15:32 2015 Kimura Wataru <kimuraw@i.nifty.jp>
-
- * test/ruby/test_io.rb: handled rlimit value same as r52277
- [Bug #11852][ruby-dev:49446]
-
-Mon Dec 21 10:21:22 2015 Ilya Vassilevsky <vassilevsky@gmail.com>
-
- * lib/net/http.rb (open_timeout): update default value in RDoc
- [ruby-core:72413]
-
-Mon Dec 21 10:18:46 2015 Kazuki Yamaguchi <k@rhe.jp>
-
- * vm_backtrace.c (rb_profile_frames): ignore ifunc frames as it
- did before. [ruby-core:72409] [Bug #11851]
-
-Mon Dec 21 09:33:17 2015 Karol Bucek <kares@users.noreply.github.com>
-
- * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket): fix
- NotImplementedError typo. [Fix GH-1165]
-
-Sun Dec 20 20:54:51 2015 Takashi Kokubun <takashikkbn@gmail.com>
-
- * cgi/escape/escape.c: Optimize CGI.escapeHTML for
- ASCII-compatible encodings. [Fix GH-1164]
-
-Sun Dec 20 15:36:46 2015 SHIBATA Hiroshi <hsbt@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.
-
-Sun Dec 20 11:43:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_yylex): allow here documents in labeled
- argument. [ruby-core:72396] [Bug #11849]
-
-Sun Dec 20 11:14:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_mod_define_method): should check Symbol or not.
- [Bug #11850]
-
- * test/ruby/test_method.rb: add a test.
-
-Sun Dec 20 11:01:57 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_mod_define_method): fix notation.
-
-Sun Dec 20 10:54:15 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_new): fix notation.
-
-Sun Dec 20 00:29:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_proc_get_iseq): proc made from symbol does not have
- iseq. fix infinite loop. [ruby-core:72381] [Bug #11845]
-
-Sat Dec 19 20:06:10 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * enc/windows_1250.c: Should not use C++ style comments (C99 feature).
- [Bug #11843]
-
-Sat Dec 19 17:17:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Sat Dec 19 14:28:01 2015 Jake Worth <jakeworth82@gmail.com>
-
- * ext/zlib/zlib.c (Init_zlib): [DOC] Fix double-word typo and
- grammatical error. [Fix GH-1162]
-
-Sat Dec 19 14:23:59 2015 Jake Worth <jakeworth82@gmail.com>
-
- * lib/csv.rb (CSV#initialize): [DOC] Fix double-word typo.
- [Fix GH-1161]
-
-Sat Dec 19 10:33:33 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_2.c, enc/windows_1250.c: separate Windows-1250
- from ISO-8859-2 to fix 0x80..0x9e range (from Kimihito Matsui)
-
-Fri Dec 18 21:26:54 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Fri Dec 18 17:24:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (ibf_load_object_string): use fstring if frozen string.
-
-Fri Dec 18 16:54:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Fri Dec 18 16:50:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (ibf_load_setup): check tainted string argument.
-
-Fri Dec 18 16:12:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: define USE_LAZY_LOAD if it is not defined.
-
-Fri Dec 18 15:40:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_unget_bytes): extract from
- strio_ungetbyte to share with strio_ungetc.
-
-Fri Dec 18 12:39:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/syntax/*.rdoc: separated modifier at sentence.
- [ci skip][fix GH-1121] Patch by @clandry94
-
-Fri Dec 18 12:09:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_ungetbyte): pad with \000 when
- the current position is after the end.
-
-Fri Dec 18 11:24:48 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Fri Dec 18 11:09:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * vm.c (vm_exec): call RUBY_DTRACE_CMETHOD_RETURN_HOOK instead of
- RUBY_DTRACE_METHOD_RETURN_HOOK.
-
-Fri Dec 18 10:24:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
- [fix GH-1127] Patch by @koic
-
-Fri Dec 18 09:44:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/pty/pty.c: fix double words typo.
- [ci skip][fix GH-1157] Patch by @jwworth
-
-Fri Dec 18 09:42:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Fri Dec 18 07:39:01 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm.c (rb_vm_check_redefinition_opt_method): should check the real
- class instead of the origin iclass.
- [ruby-core:72188] [Bug #11826]
-
-Thu Dec 17 22:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_args.c (vm_caller_setup_arg_block): remove code for ifunc
- because it was made unnecessary by r52138.
-
-Thu Dec 17 16:13:10 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * proc.c (rb_block_arity): should not call GetProcPtr() for symbols.
- [ruby-core:72205] [Bug #11830]
-
-Thu Dec 17 14:16:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_scrub): the result should be infected by the
- original string.
-
-Thu Dec 17 13:35:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_econv_substr_append, econv_primitive_convert):
- the result should be infected by the original string.
-
-Thu Dec 17 09:46:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (reg_names_iter): should consider encoding of regexp.
- [ruby-core:72185] [Bug #11825]
-
-Thu Dec 17 03:52:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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
-
-Thu Dec 17 03:15:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method_each_type): should not set fastpath
- with keyword arguments for VM_METHOD_TYPE_ATTRSET type methods.
-
- 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]
-
- * test/ruby/test_keyword.rb: add a test for this fix.
-
-Wed Dec 16 20:32:43 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * ext/fiddle/handle.c: check tainted string arguments.
- Patch provided by tenderlove and nobu.
-
- * test/fiddle/test_handle.rb (class TestHandle): add test for above.
-
-
-Wed Dec 16 19:30:56 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm.c (vm_make_proc_from_block): should convert a Symbol to a Proc.
- [ruby-core:72083] [Bug #11811]
-
-Wed Dec 16 16:17:34 2015 Eric Wong <e@80x24.org>
-
- * test/ruby/test_io.rb: fix spelling errors
-
-Wed Dec 16 16:04:49 2015 Eric Wong <e@80x24.org>
-
- * NEWS: note IO#advise change [ruby-core:72168]
-
-Wed Dec 16 15:35:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: fix mark miss for proc given as passed block.
- [Bug #11750]
-
- * 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.
-
- * vm.c (vm_make_env_each): ditto.
-
- * test/ruby/test_proc.rb: add a test for this bug.
-
-Wed Dec 16 12:24:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * test_struct.rb: Test that initialize is overridable [#11708]
-
-Wed Dec 16 10:49:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (block_command, block_call): fix `&.` calls after
- block_call. [Feature #11537]
-
-Wed Dec 16 00:53:45 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquire
- TimeoutMutex only when accessing @timeout_info for avoiding
- potential deadlock. [Bug #11742] [ruby-dev:49387]
-
-Wed Dec 16 00:39:27 2015 Jake Worth <jakeworth82@gmail.com>
-
- * doc/extension.rdoc: [DOC] fix double-word typo. [Fix GH-1153]
-
-Wed Dec 16 00:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Tue Dec 15 23:13:10 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * hash.c: ditto, after NOINSERT_UPDATE_CALLBACK().
-
-Tue Dec 15 18:04:04 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * NEWS: added news about EBCDIC encoding
-
-Tue Dec 15 17:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * 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)
-
-Tue Dec 15 16:19:26 2015 Takashi Kokubun <takashikkbn@gmail.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.
-
-Tue Dec 15 13:50:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_oct): [DOC] mention radix indicators.
- [ruby-core:71310] [Bug #11648]
-
-Tue Dec 15 12:20:30 2015 Takashi Kokubun <takashikkbn@gmail.com>
-
- * lib/erb.rb: Simplify regexp to optimize erb scanner.
- [fix GH-1144]
-
-Tue Dec 15 11:56:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/uri/common.rb: make code block for rdoc.
- [ci skip][fix GH-1152] Patch by @Tonkpils
-
-Tue Dec 15 11:55:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/zlib/zlib.c: fix a typo.
- [ci skip][fix GH-1149] Patch by @crismali
-
-Tue Dec 15 09:14:14 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * tool/transcode_tablegen.rb: detailed documentation
- for transcode_tblgen function [ci skip]
-
-Mon Dec 14 22:11:11 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * 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
-
-Mon Dec 14 17:04:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Mon Dec 14 17:03:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Mon Dec 14 14:33:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/xmlrpc.rb: added documentation for parser details.
- [ci skip][fix GH-1124] Patch by @jrafanie
-
-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.
- * numeric.c: ditto.
- * process.c: ditto.
- * string.c: ditto.
- * vm_trace.c: ditto.
-
-Mon Dec 14 11:41:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/cgi.rb: fix a typo in documentation.
- [ci skip][fix GH-1140] Patch by @jutaz
-
-Mon Dec 14 11:31:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Mon Dec 14 11:27:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Mon Dec 14 11:25:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * benchmark/bm_app_aobench.rb: fix typos.
- [ci skip][fix GH-1140] Patch by @jutaz
- * benchmark/bm_vm_thread_pipe.rb: ditto.
-
-Sun Dec 13 23:46:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (trace_lex_state): trace lex_state changes if yydebug is
- set, and send the messages to rb_stdout.
-
- * parse.y (rb_parser_printf): store YYPRINTF messages per lines
- so that lex_state traces do not mix.
-
- * tool/ytab.sed: add parser argument to yy_stack_print too.
-
-Sun Dec 13 20:41:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (build_lex_state_name, trace_lex_state): lex_state is
- now bit flags and can be set 2 bits or more.
-
-Sun Dec 13 20:26:30 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-
- * test/ruby/test_syntax.rb: fix typo in test
-
-Sun Dec 13 20:12:14 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-
- * parse.y (parse_percent): Allow %-literals in labeled arg as
- r51624 did for parentheses.
- Fixes [ruby-core:72084] [Bug #11812].
-
-Sun Dec 13 20:02:15 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: fix a typo
-
-Sun Dec 13 19:54:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/lib/envutil.rb: move envutil's assertions under Test::Unit::Assertion.
- * test/lib/test/unit/assertions.rb: ditto.
-
-Sun Dec 13 19:24:20 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-
- * parse.y (lex_state_name): Make it return the correct names.
- Add new names to follow r51617; Indices ffs(2) returns are 1-origin.
-
-Sun Dec 13 18:40:45 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-
- * parse.y: debug output of lex_state transition if PARSER_DEBUG
-
-Sun Dec 13 18:49:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (parse_mode_enc): preserve encoding of mode string in
- warnings.
-
- * io.c (io_encname_bom_p): check BOM prefix only, not including
- UTF prefix.
-
- * io.c (parse_mode_enc): warn BOM with non-UTF encoding.
-
- * io.c (parse_mode_enc): fix buffer overflow.
-
-Sun Dec 13 18:35:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/fiddle/function.c (initialize): check all arguments first.
- reported by Marcin 'Icewall' Noga of Cisco Talos.
-
- * ext/fiddle/conversions.h (PTR2NUM): use signed integer to make
- Fixnum for negative values.
-
-Sun Dec 13 18:33:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Sun Dec 13 18:28:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/psych/psych_emitter.c (start_document): should not exceed
- tags array range.
-
- * ext/psych/psych_emitter.c (start_document): ensure string before
- encoding conversion.
-
-Sun Dec 13 18:26:31 2015 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.
-
- * 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.
-
- * ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check types of
- argument elements. reported by Marcin 'Icewall' Noga of Cisco
- Talos.
-
-Sun Dec 13 18:19:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (ole_vstr2wc): check argument type, vstr
- must be a String here. reported by Marcin 'Icewall' Noga of
- Cisco Talos.
-
-Sun Dec 13 16:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (BOOTSTRAPRUBY): make BASERUBY full path before
- building ruby to get rid of unexpectedly invoking built ruby.
- [ruby-core:72065] [Bug #11807]
-
- * configure.in (BOOTSTRAPRUBY): use MINIRUBY but not BASERUBY
- unless cross compiling. [ruby-core:72065] [Bug #11807]
-
-Sun Dec 13 14:17:19 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * test/test_shellwords.rb (TestShellwords): Add many more tests
- for handling whitespace characters and frozenness.
-
-Sun Dec 13 14:16:09 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/shellwords.rb (Shellwords#shellsplit): Document that this
- method does not treat shell metacharacters as such.
-
-Sun Dec 13 12:17:43 2015 Eric Wong <e@80x24.org>
-
- * lib/shellwords.rb (shellescape): duplicate frozen literal
- * test/test_shellwords.rb (test_stringification): new test
-
-Sun Dec 13 11:47:35 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * object.c (rb_inspect): check the default internal encoding as
- String#inspect do.
- [ruby-dev:49415] [Bug #11787]
-
-Sun Dec 13 11:38:12 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/shellwords.rb: Turn on frozen-string-literal after fixing
- shellsplit.
-
-Sun Dec 13 10:44:44 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * KNOWNBUGS.rb: Fixed typo, made more explicit [ci skip]
-
-Sun Dec 13 10:26:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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]
-
-Sun Dec 13 06:40:30 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a
- symbol
- nor a string. See [#11762]
-
-Sun Dec 13 00:05:42 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_insnhelper.c (vm_call_method_missing): method_missing should
- not be refined.
- [ruby-core:72080] [Bug #11809]
-
-Sat Dec 12 23:00:17 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: Merge nkf 2.1.4.
-
-Sat Dec 12 18:52:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_obj_dig): raise TypeError if an element does not
- have #dig method. [ruby-core:71798] [Bug #11762]
-
-Sat Dec 12 17:59:07 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * test/ruby/test_regexp.rb: Add test cases for `$KCODE` and `$=` warning
- [Misc #11770][ruby-dev:49398]
-
-Sat Dec 12 17:11:57 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * doc/NEWS-0.2.2: add description about incompatible change in Hash
- duplicated key overriding policy. [Bug #10315] [Bug #11501]
-
-Sat Dec 12 07:44:38 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sat Dec 12 07:05:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/windows_1252.c: separate from ISO-8859-1 to fix 0x80..0x9e
- range. [ruby-core:64049] [Bug #10097]
-
-Fri Dec 11 23:33:40 2015 Yusuke Endoh <mame@ruby-lang.org>
-
- * sample/trick2015/: added the award-winning entries of TRICK 2015.
- See https://github.com/tric/trick2015 for the contest outline.
-
-Fri Dec 11 17:59:05 2015 Eric Wong <e@80x24.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]'
-
-Fri Dec 11 16:48:57 2015 Eric Wong <e@80x24.org>
-
- * hash.c (rb_num_hash_start): avoid pathological behavior
- [ruby-core:72028] [Feature #11405]
-
-Fri Dec 11 11:58:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Mentioned rubygems-2.5.1
-
-Fri Dec 11 11:52:39 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems: Update to RubyGems 2.5.1
- * test/rubygems: ditto.
-
-Fri Dec 11 11:38:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.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
-
-Fri Dec 11 03:44:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * object.c (rb_inspect): dump inspected result with rb_str_escape()
- instead of raising Encoding::CompatibilityError. [Feature #11801]
-
- * 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.
-
-Thu Dec 10 14:59:59 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_gc.rb (test_expand_heap): relax condition (1->2).
-
-Thu Dec 10 14:15:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * cont.c: fix a double word typo.
- [Bug #11313][ruby-core:69749]
-
-Thu Dec 10 14:13:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/tk/lib/multi-tk.rb: fix typos.
- [Bug #11764][ruby-core:71800]
-
-Thu Dec 10 11:33:34 2015 Eric Wong <e@80x24.org>
-
- * compile.c (iseq_compile_each): reduce needless rb_str_dup
- [ruby-core:72018] <5668DB6E.8000101@ruby-lang.org>
-
-Thu Dec 10 09:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal.
- [ruby-core:72011] [Bug #11800]
-
-Thu Dec 10 06:33:39 2015 Eric Wong <e@80x24.org>
-
- * marshal.c (memsize_dump_arg): remove NULL check
- (memsize_load_arg): ditto
-
-Thu Dec 10 05:53:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/mkconfig.rb: rbconfig must not be frozen-string-literal to
- expand CONFIG hash. [ruby-core:72006] [Bug #11798]
-
-Thu Dec 10 05:03:51 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ifaddr.c (ifaddr_mark): remove empty function
- (ifaddr_type): pass zero to rb_data_type_t.function.dmark
-
-Thu Dec 10 04:49:16 2015 Eric Wong <e@80x24.org>
-
- * proc.c (bm_free): remove, use default free
- (method_data_type): use RUBY_TYPED_DEFAULT_FREE
-
-Thu Dec 10 02:01:41 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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]
-
- * NEWS: apply about it.
-
- * test/ruby/test_rubyoptions.rb: catch up this fix with refactoring.
-
-Thu Dec 10 00:06:56 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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
-
- * iseq.c: fix document of iseq.to_binary.
- [Fix GH-1134]
-
- * sample/iseq_loader.rb: catch up this change.
-
- * test/lib/iseq_loader_checker.rb: ditto.
-
-Wed Dec 9 17:02:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * regparse.h (SET_NTYPE): get rid of breaking strict aliasing.
- patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790]
-
-Wed Dec 9 16:10:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (rb_vm_cref_in_context): Module#define_method in non-class
- expression should be public.
- [Bug #11754]
-
- * test/ruby/test_method.rb: add a test.
-
-Wed Dec 9 14:45:27 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_stacked_objects): fix typo.
- reported by XIE Zhibang. [Bug #11763]
-
-Wed Dec 9 14:37:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * doc/syntax/refinements.rdoc: remove outdated description.
-
-Wed Dec 9 09:58:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/**/*.c (*_memsize): same as r52986 for extensions.
-
-Wed Dec 9 09:46:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * .gitignore: ignored ISeq binary format.
-
-Wed Dec 9 09:34:41 2015 Koichi Sasada <ko1@atdot.net>
-
- * *.c (*_memsize): do not check ptr.
- NULL checking is finished Before call of memsize functions.
- See r52979.
-
-Wed Dec 9 09:25:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/net/smtp/test_response.rb: use Test::Unit. We should use Test::Unit
- without rubygems and rdoc.
-
-Wed Dec 9 06:26:23 2015 Colin Kelley <colindkelley@gmail.com>
-
- * 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]
-
-Wed Dec 9 06:25:47 2015 Eric Wong <e@80x24.org>
-
- * test/uri/test_generic.rb (to_s): new test
- [ruby-core:71820]
-
-Wed Dec 9 02:18:52 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (ibf_dump_memsize): should check NULL.
-
-Wed Dec 9 01:46:35 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_init): now accepts new option parameter `encoding'.
- [Feature #11785]
-
-Wed Dec 9 00:52:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Wed Dec 9 00:24:33 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_ibf_dump): dump extra data just string length.
-
- * sample/iseq_loader.rb: add using
- RubyVM::InstructionSequence.from_binary_format_extra_data method
- (commented out).
-
-Mon Dec 9 00:21:19 2015 Yuki Nishijima <mail@yukinishijima.net>
-
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.rc1
-
-Wed Dec 9 00:17:49 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (ibf_load_setup): cast to int.
-
-Wed Dec 9 00:13:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (ibf_setup_load): rename to ibf_load_setup().
-
- * compile.c (iseq_load_setup): check binary format.
-
-Tue Dec 8 23:30:07 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Tue Dec 8 23:05:47 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_ibf_dump): fix for clang type checker.
-
-Tue Dec 8 23:04:02 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_s_load): fix mysterious bug.
-
-Tue Dec 8 22:31:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * introduce new ISeq binary format serializer/de-serializer
- and a pre-compilation/runtime loader sample.
- [Feature #11788]
-
- * 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)
-
- * compile.c: implement body of this new feature.
-
- * 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.
-
- We can return any ISeq object as a result value.
- Otherwise loading will be continue as usual.
-
- 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.
-
- * iseq.h: move ISEQ_MAJOR/MINOR_VERSION (and some definitions)
- from iseq.c.
-
- * encoding.c (rb_data_is_encoding), internal.h: added.
-
- * 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().
-
- * insns.def: some check for lazy loading feature.
-
- * vm_insnhelper.c: ditto.
-
- * proc.c: ditto.
-
- * vm.c: ditto.
-
- * test/lib/iseq_loader_checker.rb: enabled iff suitable
- environment variables are provided.
-
- * test/runner.rb: enable lib/iseq_loader_checker.rb.
-
- * sample/iseq_loader.rb: add sample compiler and loader.
-
- $ ruby sample/iseq_loader.rb [dir]
-
- will compile all ruby scripts in [dir].
- With default setting, this compile creates *.rb.yarb files
- in same directory of target .rb scripts.
-
- $ ruby -r sample/iseq_loader.rb [app]
-
- will run with enable to load compiled binary data.
-
-Tue Dec 8 21:21:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention about Enumerator::Lazy#grep_v.
- [ruby-core:71845] [Feature #11773]
-
-Tue Dec 8 17:36:36 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: removed unused variable
-
-Tue Dec 8 16:23:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
- as Enumerable, to enumerate lazily.
- [ruby-core:71845] [Feature #11773]
-
-Tue Dec 8 14:27:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_local_variables): new method
- NameError#local_variables for internal use only.
- [Feature #11777]
-
-Tue Dec 8 14:20:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_objivar): skip internal instance variables in
- T_OBJECT too.
-
-Tue Dec 8 12:58:04 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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 Dec 8 10:40:21 2015 Eric Wong <e@80x24.org>
-
- * 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>
-
-Tue Dec 8 10:19:02 2015 Jake Worth <jakeworth82@gmail.com>
-
- * lib/optparse.rb: fix double word typo in the document.
- [Misc #10608] [Fix GH-1126]
-
-Tue Dec 8 09:03:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/date/date_core.c (d_lite_lshift): should check the argument
- before negation.
-
-Tue Dec 8 08:56:16 2015 Eric Wong <e@80x24.org>
-
- * insns.def (opt_case_dispatch): check Float#=== redefinition
- * test/ruby/test_optimization.rb (test_opt_case_dispatch): new
- [ruby-core:71920] [Bug #11784]
-
-Tue Dec 8 03:56:05 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- 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.
-
- * test/runner.rb: require test/lib/iseq_loader_checker.rb but
- disabled at default (commented out).
-
-Tue Dec 8 03:45:47 2015 Eric Wong <e@80x24.org>
-
- * doc/extension.rdoc: warn about kwargs performance in C
- [Feature #11339] [ci skip]
-
-Tue Dec 8 03:44:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_load): disable peephole optimization option
- because apply it multiple times change the sequence.
- (iseq != peephole_optimize(load(iseq.to_a)))
-
-Tue Dec 8 03:43:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (rb_iseq_build_from_ary): do not allocate table
- if table_size is 0.
-
-Tue Dec 8 03:30:34 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/unixsocket.c (unix_send_io): document args
- (unix_recv_io): ditto
- * test/socket/test_unix.rb (test_fd_passing_class_mode): added
-
-Tue Dec 08 02:21:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- For example, this method is useful to test iseq dumper/loader
- such as RubyVM::InstructionSequence#to_a and rb_iseq_load().
-
- 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.
-
- So that we don't guarantee future compatibility of this method.
- Basically, do not use this method.
-
-Tue Dec 8 01:57:13 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/psych/*: update psych to 2.0.16
- * test/psych/*: ditto
-
-Mon Dec 7 23:45:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * string.c: introduce String#+@ and String#-@ to control
- String mutability.
- [Feature #11782]
-
-Mon Dec 7 23:39:49 2015 Ben Miller <bjmllr@gmail.com>
-
- * parse.y: add heredoc <<~ syntax. [Feature #9098]
-
-Mon Dec 7 23:06:16 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * prelude.rb (IO#read_nonblock): [DOC] add missing options to
- call-seq. [ruby-core:71627] [Bug #11730]
-
-Mon Dec 7 15:50:50 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * .gitignore: added cygruby*.def for Cygwin
-
-Sun Dec 6 19:52:31 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sun Dec 6 18:25:22 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Sun Dec 6 15:25:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/console/console.c (console_getpass): add IO#getpass
- method.
-
-Sun Dec 6 08:39:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
- upstream changes.
-
- https://github.com/ruby/ruby/commit/4d059bf9f5f10f3d3088de49fc87e5555db7770d
- https://github.com/flori/json/commit/d4c99de78905d96c3f301f48b2c789943bb3f098
-
- * ext/json/lib/json/version.rb: ditto.
-
-Sat Dec 5 17:48:25 2015 Lars Kanis <lars@greiz-reinsdorf.de>
-
- * tool/fake.rb: Fix cross build when srcdir is an absolute path.
-
- * Makefile.in: PREP dependency is needed when cross build too, not
- "-r$(arch)-fake" to be used before created. [Fix GH-1125]
-
-Sat Dec 5 17:26:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (env_str_new, env_path_str_new): make default string
- UTF-8 for the case conversion is not possible. [Bug #8822]
-
- * hash.c (get_env_cstr): convert non-ASCII string to UTF-8 string.
-
- * hash.c (ruby_setenv): use wide char version to put environment
- variable to deal with non-ASCII value.
-
-Sat Dec 5 09:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby_atomic.h (ATOMIC_CAS): old value to be swapped should be
- same as the destination. immediate value may need type
- promotion.
-
- * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
- InterlockedCompareExchange64. new value and then old value is
- the last.
-
-Sat Dec 5 09:23:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (fill_random_seed): fix the size to be filled, not the
- size of element, but the whole size of array.
-
-Sat Dec 5 06:03:54 2015 Eric Wong <e@80x24.org>
-
- * vm.c (ruby_vm_verbose_ptr): make static
- (ruby_vm_debug_ptr): ditto
-
-Sat Dec 5 00:56:29 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Fri Dec 4 19:52:52 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_13.c: Added three missing lower/upper-case
- character pairs (from Kimihito Matsui)
-
-Fri Dec 4 18:57:57 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * 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)
-
-Fri Dec 4 16:48:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Fri Dec 4 15:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).
- this version includes #1396, #1397, #1398, #1399
- * test/rubygems: ditto.
-
-Fri Dec 4 11:22:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_setname): name must be ascii-compatible, as
- pthread APIs do not accept legacy wide char strings.
-
-Thu Dec 3 15:39:21 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/scanf.rb: fixed double words typo.
- [ci skip][fix GH-1123] Patch by @jwworth
-
-Thu Dec 3 15:37:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.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.
-
-Thu Dec 3 15:33:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Thu Dec 3 14:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (range_to_s): should be infected by the receiver.
- str2 infects by appending. [ruby-core:71811] [Bug #11767]
-
-Thu Dec 3 11:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.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.
-
- * thread.c (rb_thread_setname): use SET_ANOTHER_THREAD_NAME. OS X
- is not possible to set another thread name.
-
- * thread_pthread.c (native_set_thread_name, thread_timer): use
- SET_CURRENT_THREAD_NAME.
-
-Wed Dec 02 22:57:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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).
-
- Index 0 to 2 of mark_ary are reserved by these objects.
-
- * iseq.c: catch up this fix.
-
- * compile.c (rb_iseq_original_iseq): trivial rewrite.
-
-Wed Dec 2 17:19:02 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.h: introduce ISEQ_ORIGINAL_ISEQ() and
- ISEQ_ORIGINAL_ISEQ_ALLOC() macro.
-
- * compile.c: use them to access original iseq buffer.
-
- * iseq.c: ditto.
-
- * vm_core.h: rename iseq field to support this fix.
-
-Wed Dec 2 17:10:32 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro.
-
- * compile.c (iseq_compile_each): use it.
-
- * vm_core.h: rename flip_cnt field to support this fix.
-
-Wed Dec 2 17:05:15 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro.
-
- * compile.c: use them.
-
- * iseq.c: ditto.
-
- * iseq.c (rb_iseq_coverage): added.
-
- * thread.c (update_coverage): use rb_iseq_coverage().
-
- * vm_core.h: rename coverage field name to support this fix.
-
-Wed Dec 2 17:00:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_name, rb_enc_name_list_i, rb_enc_aliases_enc_i):
- make fstring instead of making each copies.
-
-Wed Dec 2 16:32:08 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.h: introduce ISEQ_COMPILE_DATA() macro.
-
- * compile.c, iseq.c: use ISEQ_COMPILE_DATA().
-
- * vm_core.h: rename compile_data field to support this fix.
-
-Wed Dec 2 16:27:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_m_loader): defer finding encoding object not to
- be infected by marshal source. [ruby-core:71793] [Bug #11760]
-
- * 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.
-
- * marshal.c (compat_allocator_table): initialize
- compat_allocator_tbl on demand.
-
- * object.c (rb_undefined_alloc): extract from rb_obj_alloc.
-
-Wed Dec 2 15:12:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * configure.in: Fixed double negative comments.
- [Bug #11698][ruby-core:71506]
-
-Wed Dec 2 14:55:01 2015 yui-knk <spiketeika@gmail.com>
-
- * test/ruby/test_string.rb: removed non executing tests.
- [Misc #11757][ruby-dev:49397]
-
-Wed Dec 2 11:23:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/csv.rb: enable frozen_string_literal.
- [fix GH-1116] Patch by @marshall-lee
-
-Wed Dec 2 10:36:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c: Fix double word typo.
- [ci skip][fix GH-1120] Patch by @jwworth
-
-Wed Dec 2 07:43:51 2015 Eric Wong <e@80x24.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
-
-Wed Dec 2 07:41:08 2015 Eric Wong <e@80x24.org>
-
- * missing/explicit_bzero.c (explicit_bzero): fixup r52839
- for compilers with "weak" attribute
-
-Wed Dec 2 06:47:25 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * missing/explicit_bzero.c: add ruby_explicit_bzero_hook_unused
- for preventing optimization. Inspired from OpenBSD.
-
-Tue Dec 1 23:36:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_setname): allow to reset thread name.
-
-Tue Dec 1 23:14:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_setname): check the argument if valid
- string. [ruby-core:71774] [Bug #11756]
-
-Tue Dec 1 17:13:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_string_value_cstr): should not raise on frozen
- string.
-
-Tue Dec 1 09:35:29 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * missing/explicit_bzero.c: add a few comment.
-
-Tue Dec 1 09:31:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * missing/explicit_bzero.c: add disabling optimization on gcc.
-
-Tue Dec 1 07:50:33 2015 Eric Wong <e@80x24.org>
-
- * missing/explicit_bzero.c: new file. define explicit_bzero.
- Fixup r52806
-
-Thu Oct 22 12:54:43 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
- * 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.
-
- * thread_pthread.c (print_signal_list): removed.
-
-Thu Oct 22 08:03:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * test/ruby/test_rand.rb (TestRand#test_default_seed): add
- srand case.
-
-Thu Oct 22 06:33:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Thu Oct 22 06:20:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
- * random.c (init_hashseed): add MT argument.
- * random.c: (init_siphash): ditto.
-
- * test/ruby/test_rand.rb (TestRand#test_default_seed): new
- test for Random::DEFAULT::seed.
-
-Thu Oct 22 05:23:48 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * random.c (init_hashseed, init_siphash): extract initialize
- functions.
-
-Thu Oct 22 01:01:34 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * configure.in: sort AC_CHECK_HEADERS() by alphabetical order.
-
-Thu Oct 22 00:19:07 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * random.c (init_randomseed): remove "initial" argument. It never
- be used from outside of this function.
-
-Thu Oct 22 00:12:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
- for initialize OpenSSL's rand.
-
-Wed Oct 21 12:10:04 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Wed Oct 21 09:04:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Wed Oct 21 08:23:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Sun Oct 18 17:26:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Mon Nov 30 18:46:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/readline/extconf.rb: call dir_config("libedit")
- if --enable-libedit is specified. [Bug #11751]
- patched by John Hein
-
-Mon Nov 30 08:44:29 2015 Eric Wong <e@80x24.org>
-
- * variable.c: remove spurious #define for globals
- [ruby-core:71735] [Feature #11749]
-
-Sun Nov 29 09:13:03 2015 Conor Landry <clandry94@gmail.com>
-
- * NEWS: [DOC] Various grammar corrections and clarifications to
- increase readability. [Fix GH-1115]
-
-Sat Nov 28 19:33:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_here_document): store dispatched result of
- on_tstring_content at the last fragment of a here document.
-
-Fri Nov 27 19:19:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
-Thu Nov 26 21:36:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): enable tail call
- optimization for specialized indexers.
-
- * compile.c (iseq_compile_each): blockiseq should be NULL, but not
- Qnil.
-
-Thu Nov 26 17:22:53 2015 NARUSE, Yui <naruse@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
-
-Thu Nov 26 09:50:02 2015 yui-knk <spiketeika@gmail.com>
-
- * test/coverage/test_coverage.rb: Added test-case for Coverage.restart.
- [Misc #11732][ruby-dev:49379]
-
-Thu Nov 26 09:46:36 2015 yui-knk <spiketeika@gmail.com>
-
- * test/coverage/test_coverage.rb: Added test-case for Coverage.peek_result
- without Coverage.start. [Misc #11726][ruby-core:71622]
-
-Thu Nov 26 07:22:55 2015 Eric Wong <e@80x24.org>
-
- * test/openssl/test_ssl.rb (test_copy_stream): new test
-
-Wed Nov 25 21:23:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (copy_stream_body): try to_io conversion before read,
- readpartial, and write methods. [ruby-dev:49008] [Bug #11199]
-
-Wed Nov 25 10:55:21 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * io.c (argf_getpartial): should not resize str if the second
- argument is not given.
- [ruby-core:71668] [Bug #11738]
-
-Tue Nov 24 23:56:25 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
- when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile).
-
-Tue Nov 24 10:00:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems/installer.rb: Fix two double-word typos.
- [ci skip][fix GH-1108] Patch by @jwworth
-
-Tue Nov 24 09:17:02 2015 Alexander von Gluck IV <kallisti5@unixzen.com>
-
- * beos: Drop support for BeOS now that Haiku is stable.
- [Fix GH-1112]
-
-Tue Nov 24 09:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (rb_gc_for_fd): move to export, as referred by
- ext/socket.
-
-Tue Nov 24 09:04:29 2015 David Rodriguez <deivid.rodriguez@gmail.com>
-
- * file.c: [DOC] add a missing period to File docs, to terminate
- the sentence and separate from the next sentence. [Fix GH-1111]
-
-Tue Nov 24 08:30:06 2015 JuanitoFatas <katehuang0320@gmail.com>
-
- * NEWS: Fix the issue number of `Struct#dig`, which should be
- [Feature #11688]. [Fix GH-1110]
-
-Tue Nov 24 07:56:54 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/init.c (rsock_s_accept): handle ENOMEM
-
-Tue Nov 24 07:50:15 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Nov 24 06:46:27 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Nov 24 05:13:35 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Mon Nov 23 19:53:12 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Mon Nov 23 12:54:39 2015 Hamish Morrison <hamishm53@gmail.com>
-
- * configure.in: remove obsolete workarounds for Haiku.
-
- * dln.c, file.c, io.c: remove obsolete Haiku workarounds.
-
- * thread_pthread.c: add stack bounds detection for Haiku.
-
- * signal.c: get stack pointer from signal context on Haiku.
- [ruby-core:67923] [Bug #10811] [Fix GH-1109]
-
-Mon Nov 23 11:44:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: bump version to minitest-5.8.3
-
-Mon Nov 23 08:55:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: fix wrong reference for r52714
-
-Sun Nov 22 22:23:37 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * gc.c (rb_raw_obj_info): fix compile errors when USE_RGENGC
- is 0.
-
-Sun Nov 22 21:58:09 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Sun Nov 22 19:36:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/openssl/ossl.c: fix brew command for installation of openssl.
- [ci skip][fix GH-1107] Patch by @arthurnn
-
-Sun Nov 22 17:59:50 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Sun Nov 22 16:53:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): remove unreachable code
- chunk after jump/leave.
-
- * parse.y: move dead code elimination of logical operation to
- compile.c. not to warn logical operation of literal constants.
-
-Sun Nov 22 16:37:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): eliminate always/never
- branches after a literal object and when the value is used after
- the branch.
-
-Sun Nov 22 01:23:43 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
- if available, mainly for enabling some features in sockets.
-
-Sun Nov 22 00:17:22 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Sat Nov 21 18:57:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (need_argument): move frozen-string-literal-debug option
- from --enable to --debug. [Feature #11725]
-
- * ruby.c (proc_options): fix pointer overrun. do not advance argv
- until it is valid.
-
-Sat Nov 21 13:59:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/digest/sha1/extconf.rb: OpenSSL's struct name for SHA1 is
- SHA_CTX. http://openssl.org/docs/man0.9.8/crypto/SHA1.html
-
-Sat Nov 21 13:31:52 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
- * ext/digest/*/extconf.rb: remove ext/digest from include search path
- to avoid confusion of cl.exe.
-
- * ext/digest/*/*.[ch]: explicitly specify def.h's path.
-
-Sat Nov 21 13:05:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/openssl/ossl.h: LibreSSL doesn't have and need e_os2.h.
-
-Sat Nov 21 09:18:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * thread_sync.c: reduce the specification of Queue#close.
- * Queue#close accepts no arguments.
- * deq'ing on closed queue returns nil, always.
- [Feature #10600]
-
- * test/thread/test_queue.rb: catch up this fix.
-
-Sat Nov 21 08:44:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): add debug information to NODE_STR
- strings as default.
- [Feature #11725]
-
- * insns.def (freezestring): add new instruction to support adding
- debug information for dynamically constructed strings.
-
- * compile.c (iseq_compile_each): support adding debug information
- for NODE_DSTR with freezestring instruction.
-
- * 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.
-
- * defs/id.def: ditto.
-
- * test/ruby/test_rubyoptions.rb: catch up this fix.
-
- * test/ruby/test_iseq.rb: now frozen strings are not same.
-
-Sat Nov 21 04:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * symbol.c (rb_str_intern): should not freeze the receiver itself
- unexpectedly. [ruby-core:71611] [Bug #11721]
-
-Fri Nov 20 23:15:18 2015 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: expose logger mutex
- [fix GH-541] Patch by @arthurnn
-
-Fri Nov 20 15:05:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * Added missing reference of GitHub
-
-Fri Nov 20 14:57:01 2015 Trevor Rowe <trevorrowe@gmail.com>
-
- * 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.
-
-Fri Nov 20 14:39:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http.rb: set hostname before call ossl_ssl_set_session.
- [Bug #11401][ruby-core:70152][fix GH-964] Patch by @mkarnebeek
-
-Fri Nov 20 12:53:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * array.c: clarify docs for take_while/drop_while samples.
- [ci skip][fix GH-1028] Patch by @leriksen
-
-Fri Nov 20 12:48:04 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Fri Nov 20 12:44:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rss/syndication.rb: Add nodoc marker for #validate_sy_updatePeriod.
- [ci skip][fix GH-1105] Patch by @davydovanton
-
-Fri Nov 20 09:05:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (rb_vm_cref_replace_with_duplicated_cref): added.
-
- CREFs should not be shared by methods between `using'.
- [Bug #11247]
-
- * vm_insnhelper.c (vm_cref_replace_with_duplicated_cref): ditto.
-
- * vm.c (vm_cref_dup): should copy refinements correctly.
-
- * eval.c: use rb_vm_cref_replace_with_duplicated_cref().
-
- * eval_intern.h: add a decl. of
- rb_vm_cref_replace_with_duplicated_cref().
-
- * vm_eval.c (eval_string_with_cref): do not need to pass
- scope's CREF because VM can find out CREF from stack frames.
-
- * test/ruby/test_refinement.rb: add a test.
-
-Fri Nov 20 06:52:53 2015 Eric Wong <e@80x24.org>
-
- * .gitattributes: new file for git users
- [ruby-core:71578] [Feature #11713]
-
-Thu Nov 19 22:35:31 2015 Tanaka Akira <akr@fsij.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.
-
-Thu Nov 19 21:55:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_start): force to invoke GC by GC.start
- even if it is GC.disable'd.
-
- * test/ruby/test_gc.rb: add a test.
-
-Thu Nov 19 20:08:59 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: trivial performance improvements.
-
- 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
-
- * gc.c (gc_writebarrier_generational): reorder parameters to optimize
- register passing function call.
-
- * gc.c (gc_writebarrier_incremental): ditto.
-
- * gc.c (rb_gc_writebarrier): remove LIKELY().
- LIKELY() seems to move related functions not better places.
-
-Thu Nov 19 19:45:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_prog_init): [DOC] ARGV does not contain the name of
- the executable. [ruby-core:71561] [Bug #11711]
-
-Thu Nov 19 15:53:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * signal.c: should also clear ruby_disable_gc.
- [Bug #11692]
-
-Thu Nov 19 15:31:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_compile_each): T_IMEMO/iseq objects should be
- wrap with ISeq wrappers. [Bug #11676]
-
-Thu Nov 19 15:16:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(c6b4946).
- this version includes #1114, #1314, #1322, #1375, #1383, #1387
- * test/rubygems: ditto.
-
-Thu Nov 19 14:14:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (finish_overlapped_socket): return value of this
- function should be only 0 or SOCKET_ERROR.
-
-Thu Nov 19 14:12:12 2015 Nobuyoshi Nakada <nobu@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.
-
-Thu Nov 19 13:57:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (finish_overlapped_socket): ignore EMSGSIZE when input,
- because POSIX platforms just do so. fixes test errors revealed by
- r52647.
-
-Thu Nov 19 02:52:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
- only when vmaxdatlen is nil.
-
-Thu Nov 19 02:20:11 2015 Tanaka Akira <akr@fsij.org>
-
- * 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]
-
-Thu Nov 19 01:48:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in: add -static-libgcc for mingw automatically if available.
-
-Thu Nov 19 00:53:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/extmk.rb (--extflags): new option to pass EXTLDFLAGS to children,
- especially exts.mk.
-
- * common.mk (EXTMK_ARGS): use above option.
-
-Wed Nov 18 22:50:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_class_clear_method_cache): should clear all
- RCLASS_CALLABLE_M_TBLs of all sub-classes (T_ICLASS).
-
- 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.
-
- However, refinements create complex data structure. So that
- we need to clear all children (and descendants).
- [ruby-core:71423] [Bug #11672]
-
- * 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.
-
- * test/ruby/test_refinement.rb: enable disabled test.
-
-Wed Nov 18 21:09:08 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (prepare_callable_method_entry): use
- RCLASS_CALLABLE_M_TBL() instead of accessing a filed directly.
-
-Wed Nov 18 17:08:18 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: introduce the following field and macros.
-
- * rb_method_definition_t::complemented_count to count shared method
- entries because of complemented method entries and separate from
- alias_count.
-
- Shared `def' only by complemented method entries should not prevent
- method re-definition warning.
-
- * METHOD_ENTRY_COMPLEMENTED(me) to represent complemented method entry.
- * METHOD_ENTRY_COMPLEMENTED_SET(me) to check it as complemented me.
-
- * vm_insnhelper.c (aliased_callable_method_entry): should also
- check me->def->complemented_count.
-
- * vm_method.c (method_definition_addref_complement): add to count
- complemented method entries number.
-
- * vm_method.c (rb_method_definition_release): release `def' iff
- alias_count == 0 and complemented_count == 0.
-
- * test/ruby/test_module.rb: add a test.
-
-Wed Nov 18 17:06:19 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_raw_obj_info): fix trivial issues.
-
- * support SPECIAL_CONSTs.
- * fix IMEMO/ment outputs.
-
-Wed Nov 18 11:32:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Nov 18 10:33:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Wed Nov 18 10:12:36 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): use 4096 as
- default size to match pre-r52610, which also maps to a common
- page size.
-
-Wed Nov 18 10:05:25 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * doc/syntax/refinements.rdoc: update documentation to reflect
- recent changes.
- [ci skip] [ruby-core:71466] [Misc #11681] Patch by James Adam
-
-Wed Nov 18 09:50:21 2015 Naotoshi Seo <sonots@gmail.com>
-
- * test/logger/test_logdevice.rb: Fix tests of logger to make it work on
- windows (windows can not remove opened file) [Bug #11702]
-
-Wed Nov 18 06:59:52 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Nov 17 19:50:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (fstat): declare for mingw.
-
-Tue Nov 17 19:02:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in (BASERUBY): use Kernel#print instead of Kernel#p because
- the baseruby may output CRLF as end of line.
-
-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]
-
-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]
-
-Tue Nov 17 14:36:00 2015 Kenichi Kamiya <kachick1@gmail.com>
-
- * lib/ostruct.rb (dig): Implement OpenStruct#dig
- [Feature #11688]
-
-Tue Nov 17 14:04:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values
- of clen must be nil.
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen.
- fixes test errors introduced at r52602.
-
-Tue Nov 17 13:43:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
- install error on Windows, introduced at r52601.
-
-Tue Nov 17 11:27:23 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Nov 17 11:25:05 2015 Eric Turner <ericturnerdev@gmail.com>
-
- * array.c (rb_ary_dig), hash.c (rb_hash_dig): [DOC] Update
- comments describing dig methods. [Fix GH-1103]
-
- * struct.c (rb_struct_dig): [DOC] add rdoc.
-
-Tue Nov 17 11:22:22 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
- * NEWS: Small grammatical fix [ci skip]
-
-Tue Nov 17 10:12:30 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/lib/socket.rb (Socket.accept_loop): avoid exceptions
- (Socket.udp_server_recv): ditto
-
-Tue Nov 17 09:59:00 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Nov 17 09:45:18 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Nov 17 08:36:34 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Nov 17 08:25:57 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Nov 17 08:16:09 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Mon Nov 16 21:27:54 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/dtrace/helper.rb (Dtrace::TestCase#trap_probe): dtrace buffer
- size is set as 8m on Solaris (default 4m). [Bug #11697]
-
-Mon Nov 16 20:03:14 2015 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: Add Logger#reopen
-
-Mon Nov 16 18:21:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_obj_dig): dig in nested structs too.
-
- * struct.c (rb_struct_dig): new method Struct#dig.
- [Feature #11688]
-
-Mon Nov 16 17:41:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): optimize tail calls on aref
- and aset specialized instructions.
-
- * compile.c (iseq_peephole_optimize): optimize replaced leave
- instruction copied to jump instruction too.
-
-Mon Nov 16 16:39:38 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb: Enable frozen_string_literal.
-
- * lib/set.rb: Move << out of the begin block that ensures pop.
-
-Mon Nov 16 16:28:30 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Hash#flatten!, #add?, #delete?, #collect!, #reject!,
- #select!, #^, #classify): Micro-optimize some methods for
- performance and readability.
-
-Mon Nov 16 16:17:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: fixed accidentally commit.
-
-Mon Nov 16 16:10:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * mkconfig.rb: Add some high-level documentation.
- [ci skip][fix GH-1081] Patch by @ulfalizer
-
-Mon Nov 16 15:59:14 2015 yui-knk <spiketeika@gmail.com>
-
- * proc.c: Add call-seq of `Method#super_method`
- [ci skip][fix GH-1094]
-
-Mon Nov 16 15:58:39 2015 Kenichi Kamiya <kachick1@gmail.com>
-
- * struct.c: Standardize a method signature of Struct#[]=.
- [ci skip][fix GH-1095]
-
-Mon Nov 16 15:42:36 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, and
- #<= when comparing against an instance of the same kind.
-
-Mon Nov 16 15:37:11 2015 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: Support symbol and string log level setting
-
-Mon Nov 16 15:33:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * tool/rbinstall.rb: fix wrong permission for gem specification without
- zlib runtime. [Bug #11685][ruby-dev:49343]
-
-Mon Nov 16 12:11:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/httpauth/basicauth.rb: fix a typo.
- [ci skip][fix GH-1099] Patch by @jwworth
- * lib/webrick/httpauth/digestauth.rb: ditto.
-
-Sun Nov 15 18:28:43 2015 Kenichi Kamiya <kachick1@gmail.com>
-
- * vm_method.c (set_method_visibility): should fail if the receiver
- is frozen. [ruby-core:71489] [Bug #11687]
-
-Sat Nov 14 22:15:07 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
-
-Sat Nov 14 21:44:56 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb: Use "<<" to reduce string allocation.
-
-Sat Nov 14 17:45:49 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/tsort.rb: Specify frozen_string_literal: true.
-
-Sat Nov 14 17:25:15 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv-replace.rb: Specify frozen_string_literal: true.
-
-Sat Nov 14 17:00:13 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb: Specify frozen_string_literal: true.
-
-Sat Nov 14 16:43:02 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/open3.rb: Specify frozen_string_literal: true.
-
-Sat Nov 14 05:04:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * node.h: remove old comments.
-
-Sat Nov 14 04:55:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * refactoring CREF related code.
-
- * eval_intern.h: remove unused setter functions.
- CREF_CLASS_SET()
- CREF_NEXT_SET()
- CREF_SCOPE_VISI_COPY()
-
- * 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.
-
- * vm.c (vm_cref_new): accept push_by_eval parameter.
-
- * vm.c (vm_cref_new_use_prev): added for rb_vm_rewrite_cref().
-
- * vm_insnhelper.c (vm_cref_push): accept pushed_by_eval parameter.
-
- * vm_insnhelper.h: remove unused macros:
- COPY_CREF_OMOD() and COPY_CREF().
-
- * vm_eval.c, insns.def: catch up this fix.
-
-Sat Nov 14 02:58:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_define_method): refactoring.
- * get CREF in this function.
- * cbase is no longer needed (CREF_CLASS(cref) is enough).
-
- * compile.c: RubyVM::FrozenCore.define_method only accept 2 args.
-
-Sat Nov 14 02:34:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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]
-
- * vm_method.c (rb_scope_module_func_check): check CREF in env or me.
- if CREF is contained by `me', then return FALSE.
-
- * test/ruby/test_method.rb: add a test.
-
-Sat Nov 14 02:19:16 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: constify rb_cref_t::scope_visi;
-
- * eval_intern.h (CREF_SCOPE_VISI_COPY): catch up this fix.
-
- * vm_method.c: ditto.
-
-Sat Nov 14 01:53:52 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Fri Nov 13 23:00:23 2015 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-
- * configure.in: unset LD_PRELOAD on mingw. msys2 child processes
- crash at make test-all with LD_PRELOAD.
- [ruby-core:71461] [Bug #11680]
-
-Fri Nov 13 14:00:43 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
-
-Fri Nov 13 13:09:16 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c: Merge ruby/openssl@81e1a30
-
- * test/openssl/test_ssl.rb: ditto
-
-Fri Nov 13 13:05:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * prelude.rb (Thread.exclusive): warn as deprecated.
-
-Fri Nov 13 10:36:39 2015 Victor Nawothnig <Victor.Nawothnig@gmail.com>
-
- * parse.y (new_unless): optimize constant condition for `unless`
- as well as `if`. [Fix GH-1092]
-
-Fri Nov 13 10:08:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/psych.gemspec: bump version to 2.0.15
-
-Thu Nov 12 18:44:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_magic_comment): should match exactly.
- [ruby-core:71460] [Bug #11679]
-
-Thu Nov 12 16:16:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/prelude.c.tmpl: enable tail call optimization.
-
-Thu Nov 12 14:17:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Thu Nov 12 13:49:50 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(db78980).
- this version includes #1367 , #1373 , #1375
- * test/rubygems: ditto.
-
-Thu Nov 12 10:53:41 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed Nov 11 18:30:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Nov 11 17:38:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Nov 11 14:14:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * transcode.c: fix a typo
- [ci skip][fix GH-1091] Patch by @jwworth
-
-Wed Nov 11 11:58:38 2015 Shugo Maeda <shugo@ruby-lang.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]
-
- * lib/net/ftp.rb (default_passive=, default_passive): new methods.
-
-Wed Nov 11 09:03:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Tue Nov 10 20:35:12 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".
-
- * lib/pp.rb: Ditto.
-
- * lib/prettyprint.rb: Ditto.
-
- * lib/resolv.rb: Ditto.
-
- * lib/securerandom.rb: Ditto.
-
- * lib/tmpdir.rb: Ditto.
-
- * lib/unicode_normalize/tables.rb: Ditto.
-
- * test/net/ftp/test_buffered_socket.rb: Ditto.
-
- * test/net/ftp/test_mlsx_entry.rb: Ditto.
-
- * test/open-uri/test_open-uri.rb: Ditto.
-
- * test/open-uri/test_ssl.rb: Ditto.
-
- * test/pathname/test_pathname.rb: Ditto.
-
- * test/test_pp.rb: Ditto.
-
- * test/test_prettyprint.rb: Ditto.
-
- * tool/transcode-tblgen.rb: Ditto.
-
- * ext/pathname/lib/pathname.rb: Ditto.
-
-Tue Nov 10 18:42:24 2015 Aleksandrs Ledovskis <aleksandrs@ledovskis.lv>
-
- * defs/id.def, parse.y: Switch internal token name to reflect
- current form of safe-call operator. [Fix GH-1090]
-
-Tue Nov 10 18:25:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_to_proc): use rb_func_proc_new to make light
- weight proc. [Feature #11653]
-
-Tue Nov 10 18:23:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (cfunc_proc_t): add room for me.
-
- * proc.c (cfunc_proc_new): generalise for cfunc proc without env.
-
- * proc.c (rb_func_proc_new, rb_func_lambda_new): new functions to
- make proc/lambda without env from cfunc.
-
-Tue Nov 10 17:32:35 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * bootstraptest/test_fork.rb ([ruby-dev:37934]): :NPROC (RLIMIT_NPROC)
- is not supported on some platforms (e.g. Solaris 10).
-
-Tue Nov 10 16:57:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_to_proc): new method Hash#to_proc.
- [Feature #11653]
-
-Tue Nov 10 14:34:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (rb_time_timespec_new): swap utc and localtime
- to generate gmt flag by INT_MAX - gmtoff.
-
-Tue Nov 10 14:01:59 2015 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]
-
-Tue Nov 10 11:25:29 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (rb_timespec_now): added. [Feature #11558]
-
- * time.c (rb_time_timespec_new): added. [Feature #11558]
-
-Tue Nov 10 06:17:17 2015 Eric Wong <e@80x24.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]
-
-Tue Nov 10 00:36:46 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::DNS::Message::MessageEncoder#put_labels):
- Prevent overflow of pointer to labels.
- Patch by Hannes Georg. [ruby-core:71248] [Bug #11632]
-
-Tue Nov 10 00:25:41 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * gems/bundled_gems: update to power_assert 0.2.6.
-
-Mon Nov 9 21:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_check_funcall_default): split from
- rb_check_funcall to return the given fallback value.
-
- * object.c (rb_obj_dig): use rb_check_funcall_default so that tail
- call optimization will be possible. [Feature #11643]
-
-Mon Nov 9 21:27:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_dig): new method Array#dig.
-
- * hash.c (rb_hash_dig): new method Hash#dig.
-
- * object.c (rb_obj_dig): dig in nested arrays/hashes.
- [Feature #11643]
-
-Mon Nov 9 18:00:47 2015 Yuki Nishijima <mail@yukinishijima.net>
-
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta3
-
-Mon Nov 9 17:38:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/runner.rb: use official repository for coverage tool.
- * Makefile.in: ditto.
- * common.mk: ditto.
- * .gitignore: ignored third party repositories.
-
-Mon Nov 9 17:29:09 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * compile.c (iseq_compile_each): Dynamic string literals should be
- frozen.
- [ruby-core:57574] [Feature #8976]
-
-Mon Nov 9 15:56:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * common.mk: Use ruby organization url for simplecov repository.
-
-Sun Nov 8 16:24:09 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * NEWS: describe addition of File::TMPFILE
-
-Sun Nov 8 15:19:17 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * file.c: Add O_TMPFILE.
-
-Sun Nov 8 14:24:43 2015 windwiny <windwiny.ubt@gmail.com>
-
- * method.h (METHOD_ENTRY_{VISI,BASIC,FLAGS}_SET): suppress
- shift-op-parentheses warnings. [Fix GH-1082]
-
-Sun Nov 8 14:01:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/psych_emitter.c: backport 5bd7744 from tenderlove/psych.
- support backward compatibility of Ruby 2.0
-
-Sun Nov 8 10:55:10 2015 Anton Davydov <antondavydov.o@gmail.com>
-
- * io.c (rb_io_gets_m): Update IO#gets doc for characters more than
- 1 byte. [Fix GH-1085]
-
-Sun Nov 8 10:37:58 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/uri/ftp.rb: fix a typo.
- [fix GH-1084][ci skip] Patch by @windwiny
-
-Sun Nov 8 08:10:31 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (exec_hooks_precheck): check need_clean everytime
- to clean-up unused hooks.
-
- * vm_trace.c (list->need_clean): use as boolean value.
-
-Sun Nov 8 01:31:27 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP#initialize):
- default value of Net::HTTP#open_timeout is now 60 (was nil).
-
-Sat Nov 7 12:18:05 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Sat Nov 7 11:40:05 2015 Eric Wong <e@80x24.org>
-
- * thread.c (rb_cThreadShield): make static
-
-Sat Nov 7 09:51:38 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (rb_threadptr_exec_event_hooks_orig):
- maintain trace_running counter on internal events.
-
- This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
- [Bug #11603] https://github.com/ruby/ruby/pull/1059
-
-Sat Nov 7 03:32:27 2015 Koichi Sasada <ko1@atdot.net>
-
- * include/ruby/ruby.h (RSTRUCT_PTR): need a close parenthesis.
-
-Sat Nov 7 01:32:06 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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).
-
- * configure.in: checks for DIR.d_fd and DIR.dd_fd on Solaris 10.
-
-Fri Nov 6 23:13:53 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * array.c: clarifies Array#reject! documentation.
- [fix GH-894][ci skip] Patch by @GxSplinter
-
-Fri Nov 6 20:18:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/runner.rb: extracted test helper.
- * test/lib/zombie_hunter.rb: ditto.
-
-Fri Nov 6 18:07:47 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Fri Nov 6 12:39:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ
- from ".?" to "&.". [ruby-core:71363] [Feature #11537]
-
-Fri Nov 6 09:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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 Nov 6 06:59:37 2015 Eric Wong <e@80x24.org>
-
- * test/ruby/test_autoload: hoist out ruby_impl_require
-
-Thu Nov 5 13:03:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/id.def (token_ops): gather associations between IDs,
- operators, and parser tokens.
-
-Thu Nov 5 10:17:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (make_addrinfo): use RARRAY_ASET for
- write-barrier.
-
- * ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): ditto.
-
- * ext/tk/tkutil/tkutil.c (ary2list, ary2list2): ditto.
-
-Thu Nov 5 10:09:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
- pointed out by hanmac.
- https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670
-
-Wed Nov 4 17:33:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/debug.rb: Add documentation for #thread_list_all.
- [Misc #11580][ci skip]
-
-Wed Nov 4 15:45:59 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * class.c: fix documentation for rb_define_class{_id}_under.
- [fix GH-991][ci skip] Patch by @kachick
-
-Wed Nov 4 15:40:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * method.h: fix typo. Patch by @davydovanton
- [fix GH-1076][ci skip]
-
-Wed Nov 4 15:39:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * hash.c: use correct grammar. Patch by @tveastman
- [fix GH-1079][ci skip]
-
-Wed Nov 4 11:38:23 2015 Jake Worth <jakeworth82@gmail.com>
-
- * process.c (proc_getsid): [DOC] Fix double word 'for' and typo.
- [Fix GH-1080]
-
-Wed Nov 4 06:01:52 2015 Eric Wong <e@80x24.org>
-
- * include/ruby/ruby.h (struct RObject): hide iv_index_tbl type
- [ruby-core:71306] [Feature #11647]
-
-Tue Nov 3 06:48:58 2015 Eric Wong <e@80x24.org>
-
- * variable.c (find_class_path): remove cast for rb_class_ivar_set
- (rb_ivar_set): ditto
- (rb_cvar_set): ditto
-
-Tue Nov 3 06:18:21 2015 Eric Wong <e@80x24.org>
-
- * variable.c (rb_global_tbl): convert to id_table
-
-Tue Nov 3 01:58:46 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * parse.y (NO_QCALL): fix type mismatch of operands that causes
- compile error with Oracle Solaris Studio on Solaris.
- [Bug #11645] [ruby-dev:49327]
-
-Sun Nov 1 17:14:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * id_table.c (mix_id_table_insert): do not touch list during
- list->hash transition because GC can run during transition.
-
-Sun Nov 1 11:07:31 2015 Eric Wong <e@80x24.org>
-
- * iseq.c (iseq_memsize): account for rb_call_cache entries
-
-Sun Nov 1 09:12:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_yylex): ':' separated by a comment and a newline
- is not valid as symbol.
-
-Sat Oct 31 20:15:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/openssl/test_pair.rb: skipped tests if openssl doesn't support
- ECDH cipher.
-
-Sat Oct 31 14:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
- it does not allow spaces before its argument.
- [ruby-core:71283] [Bug #11641]
-
-Sat Oct 31 14:58:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * man/ruby.1 (SYNOPSIS): remove extraneous space for -F option as
- it does not allow spaces before its argument.
- [ruby-core:71283] [Bug #11641]
-
-Sat Oct 31 10:22:49 2015 yui-knk <spiketeika@gmail.com>
-
- * 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]
-
-Fri Oct 30 21:12:45 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * gems/bundled_gems: update to power_assert 0.2.5.
-
-Fri Oct 30 19:29:52 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (newobj_slowpath): do not need to use flags hack (commit miss).
-
-Fri Oct 30 19:08:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (heap_get_freeobj_from_next_freepage): not so UNLIKELY.
-
-Fri Oct 30 18:09:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (newobj_slowpath): reduce 1 parameter to use only registers
- for performance.
-
- On my laptop, 'N.times{x = []}' (where N = 29_000_000) is
- 1.86 sec -> 1.74 sec.
-
-Fri Oct 30 12:53:21 2015 yui-knk <spiketeika@gmail.com>
-
- * test/ruby/test_call.rb: added test for safe navigation operator.
- [fix GH-1066]
-
-Fri Oct 30 12:47:34 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: fix wrong commit name.
-
-Fri Oct 30 12:36:16 2015 yui-knk <spiketeika@gmail.com>
-
- * 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]
-
-Fri Oct 30 12:06:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_class_ivar_set): rename as class specific ivar
- setter, and st_table is no longer involved.
-
-Fri Oct 30 11:36:33 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Fri Oct 30 10:37:56 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Fri Oct 30 09:57:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: update latest gems.
- test-unit-3.1.5 and minitest-5.8.2
-
-Fri Oct 30 09:54:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Fri Oct 30 07:38:29 2015 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (getinlinecache/setinlinecache): compare ic->ic_cref and
- current cref only when cached CREF list includes singleton class.
-
- Singleton classes have own namespaces, so that we need to check
- cref as a key (#10943).
-
- However, if current CREF list does not include singleton class,
- no need to check CREF because it should be same name space.
-
- * vm_insnhelper.c (vm_get_const_key_cref): add a function returns
- CREF only when it includes singleton class.
-
- * vm_core.h: constify iseq_inline_cache_entry::ic_cref.
-
-Fri Oct 30 06:43:50 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_env_cref): make it inline for performance.
-
- * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.
-
-Fri Oct 30 06:20:40 2015 Koichi Sasada <ko1@atdot.net>
-
- * insns.def: nobody set ic->ic_value.value to Qundef.
-
-Fri Oct 30 06:15:50 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: add ifndef guard for VM_CHECK_MODE.
-
-Fri Oct 30 06:13:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_check_frame_detail): should require me for
- VM_FRAME_FLAG_BMETHOD type frame.
-
-Thu Oct 29 18:42:30 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_ptr): specify NOINLINE so that gc_mark() can return
- immediately when obj is not a markable object.
-
-Thu Oct 29 18:05:22 2015 Koichi Sasada <ko1@atdot.net>
-
- * encoding.c (rb_enc_check_str): add for performance.
- This function only accepts T_STRING (and T_REGEXP).
-
- 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
-
- * encoding.c: add ENC_DEBUG and ENC_ASSERT() macros.
-
- * internal.h: add a decl. of rb_enc_check_str().
-
- * string.c (rb_str_plus): use rb_enc_check_str().
-
- * string.c (rb_str_subpat_set): ditto.
-
-Thu Oct 29 17:16:40 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: export rb_wb_(un)protected_newobj_of()
- because some extensions include internal.h.
-
-Thu Oct 29 16:42:19 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_imemo_new): should not pass FL_WB_PROTECTED flag.
-
- * gc.c (rb_wb_protected_newobj_of): add more assertions.
-
- * gc.c (rb_wb_unprotected_newobj_of): ditto.
-
-Thu Oct 29 16:20:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: introduce rb_wb_unprotected_newobj_of() and
- rb_wb_protected_newobj_of(), pass the WB_PROTECTED
- information explicitly.
-
- * internal.h: use introduced functions by NEWOBJ_OF().
- `flag' is immediate value, so that C compilers can
- solve them at compile time.
-
- * include/ruby/ruby.h: add a comment about that.
-
-Thu Oct 29 14:52:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: add rb_objspace::flags::has_hook to represent hook availability.
-
- * gc.c: add gc_event_hook_available_p(objspace) to check that flag.
-
- * 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.
-
- * gc.c (newobj_init): add UNLIKELY() for FL_WB_PROTECTED flag.
-
- * gc.c (newobj_init): change parameters order (trivial change).
-
-Thu Oct 29 14:45:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (rb_thread_struct): move forward declarations before
- used.
-
-Thu Oct 29 14:07:54 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_ptr): remove debug code for #11244.
-
-Thu Oct 29 10:08:33 2015 Eric Wong <e@80x24.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
-
-Thu Oct 29 08:48:05 2015 Eric Wong <e@80x24.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]
-
-Wed Oct 29 00:39:50 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Wed Oct 28 23:52:48 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * probes_helper.h (RUBY_DTRACE_HOOK): add RB_GC_GUARD, though paranoic.
-
-Wed Oct 28 15:36:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_name_err_new): store the receiver directly.
-
- * error.c (name_err_receiver): return directly stored receiver.
- [Feature #10881]
-
- * error.c (name_err_mesg_to_str): quote the name if unprintable.
-
- * object.c (check_setter_id): use rb_check_id to convert names.
-
- * variable.c (uninitialized_constant): use NameError::message to
- keep the receiver of uninitialized constant. [Feature #10881]
-
- * error.c (rb_name_err_new): new function to create NameError
- exception instance. [Feature #10881]
-
-Wed Oct 28 13:29:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (new_attr_op_assign): fix op_assign type, which is
- already an ID since r52284. [Feature #11537]
-
-Tue Oct 27 23:14:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/id.def: enable anonymous IDs not to expose internal IDs for
- frozen-string-literal-debug by Marshal.dump.
-
-Tue Oct 27 17:06:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/id.def: move internal IDs for frozen-string-literal-debug.
-
-Tue Oct 27 16:41:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Tue Oct 27 16:18:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Tue Oct 27 16:12:37 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
-Tue Oct 27 12:00:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Oct 26 22:43:03 2015 yui-knk <spiketeika@gmail.com>
-
- * 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]
-
-Mon Oct 26 22:23:30 2015 SimonDKnight <simondknight@hotmail.com>
-
- * lib/racc/rdoc/grammar.en.rdoc: Grammatical errors fixed.
- [Fix GH-1070]
-
-Mon Oct 26 18:36:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-
- * vm_method.c(rb_method_entry_make):
- [DOC] [ci skip] Remove a needless space from comment
- [Fixes GH-1069] Patch by @yui-knk
-
-Mon Oct 26 17:30:13 2015 Ryan Hosford <tad.hosford@gmail.com>
-
- * lib/fileutils.rb: rename tailing to trailing.
- [Misc #11548]
-
-Mon Oct 26 17:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (call_op, call_op2): fix values on ripper. [Feature #11537]
-
-Mon Oct 26 12:55:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (call_op2): separate from call_op and also allow "::",
- while dot_or_colon should not allow ".?". [Feature #11537]
-
-Mon Oct 26 01:03:23 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * thread_pthread.c: fix compile errors when
- USE_SLEEPY_TIMER_THREAD is disabled.
-
-Sun Oct 25 10:12:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * symbol.c (op_tbl): add DOTQ for ripper. [Feature #11537]
-
-Sat Oct 24 22:51:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Sat Oct 24 21:16:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/fileutils/test_fileutils.rb (test_uptodate): relax error
- message format. [Feature #9025], [ruby-core:71178] [Bug #11617]
-
-Sat Oct 24 21:06:43 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-
- * lib/mkmf.rb: Revert r45640 because it may lead to link
- with different libruby. [Bug #9760]
-
-Sat Oct 24 15:42:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/test_method.rb: relax error message format.
-
- * test/ruby/test_arity.rb (err_mess): ditto.
- [Feature #9025], [ruby-core:71178] [Bug #11617]
-
-Sat Oct 24 12:47:47 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * vm_insnhelper.c: improved error message for "wrong number
- of arguments", distinguishing given and expected argument
- numbers clearly. [Feature #9025]
-
-Sat Oct 24 11:57:59 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_insnhelper.c: remove the typedef redeclaration of
- vm_call_handler.
-
-Sat Oct 24 07:29:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Oct 24 04:10:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (make_compile_option_value): include frozen_string_literal*
- in a made option value.
-
- * vm_opts.h: forgot to add OPT_FROZEN_STRING_LITERAL_DEBUG
- at last commit.
-
-Sat Oct 24 03:58:02 2015 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)
-
- * iseq.h: add compile option frozen_string_literal_debug.
-
- * compile.c: catch up this fix.
-
- * error.c (rb_error_frozen): ditto.
-
- * iseq.c (set_compile_option_from_hash): ditto.
-
- * test/ruby/test_rubyoptions.rb: add a test for this fix.
-
-Sat Oct 24 02:02:24 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c: introduce new call handler for simple ISeqs.
-
- 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).
-
- 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.
-
- 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.
-
- These functions creates fast method dispatch by inlining
- vm_push_frame() with immediate params/locals sizes.
-
- On my laptop, we can have the following results.
-
- vm2_method* 1.083 (8.3% faster)
- vm2_poly_method* 0.961 (3.4% slower)
-
- 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.
-
- * common.mk: add a rule for vm_call_iseq_optimized.inc.
-
- * tool/mk_call_iseq_optimized.rb: added.
-
- * vm.c: include vm_call_iseq_optimized.inc.
-
-Sat Oct 24 01:58:50 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: define vm_call_handler.
-
-Sat Oct 24 01:56:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, vm_insnhelper.h: move definition of VMDEBUG
- from vm_insnhelper.h to vm_core.h.
-
-Sat Oct 24 01:51:01 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * NEWS: [DOC] In the new safe call syntax, arguments are evaluated
- only if a call is made.
-
- * doc/syntax/calling_methods.rdoc: Fix a typo.
-
-Sat Oct 24 00:38:34 2015 Shugo Maeda <shugo@ruby-lang.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]
-
-Fri Oct 23 21:10:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_mesg_to_str): separate class names from the
- receiver description.
-
- * vm_eval.c (make_no_method_exception, raise_method_missing): add
- format specifiers for class names.
-
-Fri Oct 23 18:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * .gitignore: ignored environmental wrapper files.
-
-Fri Oct 23 17:55:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Fri Oct 23 16:35:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
- EOL string. Patch by @kachick [fix GH-942][Bug #11513]
-
-Fri Oct 23 16:03:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Fri Oct 23 15:46:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * string.c: Added method signature to include hash. It's inconsistency
- with `gsub` method signature.
- [ci skip][fix GH-1023] Patch by @danielevans
-
-Fri Oct 23 15:25:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: remove an empty comment line and -*-.
-
-Fri Oct 23 15:20:02 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (gettextfile, getbinaryfile): use the safe
- navigation operator.
-
-Fri Oct 23 13:51:33 2015 yui-knk <spiketeika@gmail.com>
-
- * 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`
-
-Fri Oct 23 11:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): optimize lengthy safe
- navigation method chain. [Feature #11537]
-
-Fri Oct 23 10:58:41 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/matrix/eigenvalue_decomposition.rb (tridiagonalize): fix
- indentation to avoid a warning when the command line option -w of
- ruby is specified.
-
- * 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.
-
-Fri Oct 23 10:49:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): support safe navigation of simple
- attribute assignment. [Feature #11537]
-
- * parse.y (mlhs_node, lhs, attrset_gen): ditto. keep mid
- non-attrset as the sign of safe navigation.
-
-Fri Oct 23 07:17:11 2015 Eric Wong <e@80x24.org>
-
- * test/io/wait/test_io_wait.rb (test_wait_eof): test return value
-
-Fri Oct 23 00:32:02 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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>
-
-Fri Oct 23 00:49:45 2015 Shugo Maeda <shugo@ruby-lang.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.
-
-Fri Oct 23 00:22:20 2015 Josef Simanek <josef.simanek@gmail.com>
-
- * string.c (rb_str_tr): [DOC] Escape backslash in String#tr
- documentation. [Fix GH-1063]
-
-Fri Oct 23 00:19:04 2015 yui-knk <spiketeika@gmail.com>
-
- * array.c (rb_ary_collect): [DOC] Fix space of code example of
- Array#map. [Fix GH-1062]
-
-Thu Oct 22 18:52:53 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * 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]
-
-Thu Oct 22 18:25:10 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (idle): add a new argument timeout for keep-alive.
- [ruby-core:63693] [Bug #10031]
-
-Thu Oct 22 15:30:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): peephole optimization for
- branchnil jumps.
-
- * compile.c (iseq_compile_each): generate save navigation operator
- code.
-
- * insns.def (branchnil): new opcode to pop the tos and branch if
- it is nil.
-
- * parse.y (NEW_QCALL, call_op, parser_yylex): parse token '.?'.
- [Feature #11537]
-
-Thu Oct 22 13:16:19 2015 Guilherme Reis Campos <guilhermekbsa@gmail.com>
-
- * 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]
-
-Thu Oct 22 13:13:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (argf_next_argv): check ARGV element type, and try
- conversion if necessary. [ruby-core:71140] [Bug #11610]
-
-Thu Oct 22 11:11:16 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/net/ftp/test_ftp.rb: add tests for getbinaryfile and
- gettextfile.
-
-Wed Oct 21 18:34:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_magic_comment): allow a sole magic comment without
- indicators, neither other non-space comments. [Feature #8976]
-
-Tue Oct 20 12:17:56 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Add basic argument checking to Prime.prime?
- [Bug #11606]
-
-Tue Oct 20 12:17:50 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Optimize Integer#prime?
- Patch by Nick Slocum [Bug #10354]
-
-Tue Oct 20 08:12:47 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * configure.in: pthread_getattr_np is broken on AIX.
- More specifically, the stack address and size returned are
- not correct.
-
-Tue Oct 20 05:54:46 2015 Eric Wong <e@80x24.org>
-
- * ext/fiddle/closure.c (callback): static function
-
-Mon Oct 19 10:33:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/init.c (rsock_raise_socket_error): get rid of a glibc
- bug. [ruby-core:71100] [Bug #11600]
-
-Mon Oct 19 01:26:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (rb_file_identical_p): not necessary to compare the paths after
- comparing the file indexes on Windows. designate by kosaki.
-
-Sun Oct 18 21:17:27 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: Specify frozen_string_literal: true.
-
-Sun Oct 18 14:37:56 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * random.c (fill_random_bytes_urandom): add a comment why using
- O_NONBLOCK and O_NOCTTY.
-
-Sun Oct 18 13:24:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * random.c (fill_random_bytes_syscall): use ATOMIC_SET() for
- updating try_syscall.
-
-Sun Oct 18 13:03:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * include/ruby/backward/util.h: Good-by Borland-C.
-
-Sun Oct 18 13:03:09 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * common.mk: add a comment how to use "make test-all"
-
-Sun Oct 18 12:59:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * common.mk: add comments how to use "make benchmark"
-
-Sun Oct 18 12:58:15 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/securerandom.rb: Specify frozen_string_literal: true.
-
-Sun Oct 18 11:22:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * dln.c: remove defined(__WATCOMC__).
-
-Sun Oct 18 11:16:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * lib/mkmf.rb: Good-by Borland-C.
-
-Sun Oct 18 11:04:36 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Sun Oct 18 10:54:52 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.
- see include/ruby/defines.h
- * gc.c: ditto.
- * ext/sdbm/_sdbm.c: ditto.
-
-Sun Oct 18 10:42:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * ruby.c (open_load_file): add a comment.
-
-Sun Oct 18 10:12:46 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * file.c (rb_file_identical_p): simplify ifdefs
-
-Sun Oct 18 10:01:40 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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.
-
-Sun Oct 18 08:50:15 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * include/ruby/defines.h (DOSISH): add comments.
-
-Sun Oct 18 08:26:51 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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
-
-Sun Oct 18 09:32:58 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * file.c (ruby_is_fd_loadable): this should be fail if st_mode is
- not regular file nor FIFO.
-
-Sun Oct 18 09:20:17 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * ruby.c (open_load_file): use rb_thread_wait_fd() instead of reopen.
-
-Sun Oct 18 05:11:22 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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]
-
- * ruby.c (loadopen_func): new for the above.
-
- * 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()
-
- * common.mk: now, ruby.o depend on thread.h.
-
- * test/ruby/test_require.rb
- (TestRequire#test_loading_fifo_threading_success): new test.
- This test successful case that loading from FIFO.
-
- * 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.
-
-Sat Oct 17 13:55:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_expand_path_internal): concatenate converted
- string to the result instead of making converted string and
- append it.
-
- * string.c (rb_str_cat_conv_enc_opts): from rb_str_conv_enc_opts,
- separate function to concatenate with transcoding.
-
-Sat Oct 17 13:19:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Sat Oct 17 05:28:32 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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]
-
-Fri Oct 16 15:54:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
- * ruby.c (load_file_internal): ditto.
-
-Thu Oct 15 23:56:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_sym_to_proc): make void env.
-
-Thu Oct 15 13:37:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_sym_to_proc): move from string.c and create a Proc
- with no environments. [ruby-core:71088] [Bug #11594]
-
-Thu Oct 15 01:57:03 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * 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]
-
-Thu Oct 15 01:53:38 2015 Benoit Daloze <eregontp@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
-
-Thu Oct 15 01:49:25 2015 Benoit Daloze <eregontp@gmail.com>
-
- * 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
-
-Wed Oct 14 16:56:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check for libunwind.h, which is not available in
- very old OS X SDK. [ruby-core:71080] [Bug #11591]
-
-Wed Oct 14 14:11:42 2015 Brian Black <bblack@veracode.com>
-
- * 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]
-
-Wed Oct 14 13:58:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_nextc): send a warning to ripper, not to STDERR
- always.
-
- * parse.y (rb_warn1, rb_warning1): move argument conversions to
- callers. PRIsVALUE is not valid in String#%.
-
-Wed Oct 14 13:37:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/racc/rdoc/grammar.en.rdoc: fix spell error.
- [fix GH-1053][ci skip] Patch by @Matrixbirds
-
-Tue Oct 13 22:06:50 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/socket/raddrinfo.c (rsock_fd_family): Check sa_len.
-
-Tue Oct 13 12:14:10 2015 Craig Davison <craig65535@gmail.com>
-
- * ext/socket/rsock_addrinfo (rsock_addrinfo): specify address
- family. [Fix GH-1052]
-
- * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send):
- address family by the receiver.
-
-Sun Oct 11 07:09:19 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_push_frame): initialize other than sp (and ep)
- first for performance.
-
-Sun Oct 11 06:21:50 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_eval.c, internal.h (rb_yield_1): added for performance which
- doesn't check Qundef.
-
- * numeric.c (int_dotimes): use rb_yield_1.
-
-Sun Oct 11 06:19:49 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_iseq_setup_normal): setup sp first
- for performance.
-
-Sun Oct 11 05:29:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (invoke_block_from_c): split this function into several
- functions.
-
- * vm_insnhelper.c (vm_yield_callee_setup_arg): remove this function
- because it is only delegation function.
-
-Sun Oct 11 03:48:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (newobj_of_slowpass): fix typo (pass -> path).
- Pointed out by Yukihiro Matsumoto <matz@ruby-lang.org>.
-
- * gc.c (newobj_of_...): `of' is unnecessary.
-
-Sat Oct 10 19:04:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/udpsocket.c (udp_connect, udp_bind): get open files
- inside ensure functions.
-
-Sat Oct 10 18:35:12 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method0): do not propagate enable_fastpath,
- but pass dummy CC to prevent wrong caching.
-
-Sat Oct 10 15:28:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * import a github pull request
- https://github.com/ruby/ruby/pull/1050
- by Kazuho Oku <kazuho@natadeco.co>.
-
- This pull request has the following commits.
-
- * 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.
-
- * gc.c (newobj_of), string.c (str_duplicate): for performance,
- the hot functions must be inlined.
-
- * gc.c: for performance, preceding arguments of `.*newobj_of.*`
- must be same, so that the arg registers can be reused in case of
- TCO.
-
-Sat Oct 10 08:52:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send): fix
- memory leaks at closed socket.
-
-Fri Oct 9 17:29:07 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (parse257): refactor.
-
-Fri Oct 9 16:42:26 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb: use frozen_string_literal: true.
-
- * test/net/imap/test_imap.rb: ditto.
-
- * test/net/imap/test_imap_response_parser.rb: ditto.
-
-Fri Oct 9 15:52:28 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb: use frozen_string_literal: true.
-
- * test/net/ftp/test_buffered_socket.rb: ditto.
-
- * test/net/ftp/test_ftp.rb: ditto.
-
- * test/net/ftp/test_mlsx_entry.rb: ditto.
-
-Fri Oct 9 14:12:35 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-
- * 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.
-
- For instance, Servers where aws-sdk connects to still don't support
- TLS v1.2 and it became broken.
-
- We should consider more carefully about this.
-
- [Fix GH-873] [Feature #11524]
-
-Fri Oct 9 12:52:08 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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 Oct 9 06:52:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * benchmark/prepare_require.rb: skip file creation if it already
- exist. Suggested by ko1.
-
-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.
-
-Thu Oct 8 14:10:45 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * 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
-
-Wed Oct 7 22:55:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/minitest/metametameta.rb (with_output): restore output to
- fix mixing test result output in worker responses.
-
-Wed Oct 7 21:32:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_duplicate): move from rb_str_resurrect to short
- circuit initialization.
-
-Wed Oct 7 20:43:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_resurrect): fix resurrection of short enough to
- be embedded but not embedded string.
-
-Wed Oct 7 20:17:29 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (newobj_of): divide fast path and slow path
- to avoid register savings for fast path.
-
- This idea is given by Kazuho Oku <kazuho@natadeco.co>.
-
-Wed Oct 7 17:30:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_times): optimize for the argument 0 and 1.
-
-Wed Oct 7 01:20:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.h, gc.c: introduce new debug function rb_obj_info_dump(VALUE obj)
- which prints the result of rb_raw_obj_info(..., obj).
-
-Wed Oct 7 01:16:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_args.c: remove an unused field args_info::calling.
-
-Tue Oct 6 23:43:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_method_entry_min_max_arity): should support
- OPTIMIZED_METHOD_TYPE_CALL.
-
-Tue Oct 6 21:29:08 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/tmpdir.rb (Dir.tmpdir): return duplicated string to be
- modify safely even when $SAFE > 0.
-
-Tue Oct 6 19:24:38 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_method0): use switch() for visibilities
- (for readability).
-
-Tue Oct 6 19:23:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (Init_Proc): Proc#call and others should be public.
-
-Tue Oct 6 18:51:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: IMEMO_FL_USER3 and IMEMO_FL_USER4 is not needed any more.
-
-Tue Oct 6 18:47:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
-
-Tue Oct 6 13:56:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h: turn function macros into inline functions,
- for debuggers.
-
- * include/ruby/ruby.h: turn constant macros into enums, for
- debuggers.
-
-Tue Oct 6 13:48:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * method.h: typo fix. Patch by @davydovanton [fix GH-1032][ci skip]
-
-Tue Oct 6 06:54:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (rb_iseq_free): free iseq::variable_body to avoid memory
- leak.
-
-Tue Oct 6 06:32:52 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: enable optimization of Proc#call.
- [Feature #11569]
-
- * NEWS: write about this optimization and incompatibilities.
-
- * test/ruby/test_backtrace.rb: catch up this fix.
-
-Tue Oct 6 04:41:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c: solve goto spaghetti.
-
- Change all goto statement across blocks to tail call functions.
-
-Tue Oct 6 02:29:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_resurrect): optimize by short circuit to copy
- hidden string without checking length, encoding and so on.
-
-Mon Oct 5 23:08:17 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * test/ruby/test_thread.rb (test_handle_interrupt_blocking): check if
- exception handling was postponed until sleep.
-
-Mon Oct 5 22:25:49 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb: Use frozen_string_literal: true.
-
- * lib/prettyprint.rb: Ditto.
-
- * lib/resolv.rb: Ditto.
-
- * lib/tmpdir.rb: Ditto.
-
- * test/test_pp.rb: Ditto.
-
- * test/test_prettyprint.rb: Ditto.
-
- * tool/transcode-tblgen.rb: Ditto.
-
-Mon Oct 5 20:39:32 2015 Benoit Daloze <eregontp@gmail.com>
-
- * 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.
-
-Mon Oct 5 15:39:30 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * numeric.c: [DOC] Overview for Numeric class by Joe Corcoran
- This patch was created at ROSSConf Berlin 2015 [Bug #11555]
-
-Mon Oct 5 15:34:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_new): link ep to calling block.
- [ruby-core:70980] [Bug #11566]
-
-Mon Oct 5 00:53:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (rb_dir_getwd): make ASCII-8BIT if filesystem encoding is
- US-ASCII, like as Dir.glob.
-
-Sun Oct 4 23:39:09 2015 Tanaka Akira <akr@fsij.org>
-
- * enum.c (nmin_filter): Fix limit value.
- patch by Helder Pereira.
- [Bug #11471] [ruby-core:70477]
-
-Sun Oct 4 15:11:48 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
- and if invalid, return 1. [Bug #11486]
-
-Sun Oct 4 10:09:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (rb_dir_getwd): normalize OS path to UTF-8 on OS X.
-
-Sun Oct 4 00:09:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
- 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
-
-Sun Oct 2 10:59:00 2015 schneems <richard.schneeman@gmail.com>
-
- * ext/pathname/lib/pathname.rb: freeze string literals for
- reduced object allocation.
- [Feature #11375] [ruby-core:70043]
-
-Fri Oct 2 09:20:20 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk, lib/unicode_normalize/tables.rb: Change Unicode
- Version for character normalization data from 7.0.0 to
- 8.0.0.
-
-Fri Oct 2 00:18:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_mark): block.ep of Proc from Symbol is now NULL.
- [ruby-core:70961] [Bug #11560]
-
-Wed Sep 30 15:47:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_args.c (vm_caller_setup_arg_block): bypass Symbol#to_proc
- call to optimize symbol block passing.
-
-Wed Sep 30 01:34:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_free): fix memory leak at syntax error when
- warn-indent is enabled.
-
-Tue Sep 29 22:27:50 2015 Benoit Daloze <eregontp@gmail.com>
-
- * parse.y: fix minor typo. [ci skip][fix GH-1038].
- Patch by @ltratt.
-
-Tue Sep 29 16:53:53 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
- get rid of many .freeze commands by using frozen_string_literal
- pragma.
-
-Tue Sep 29 16:37:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
- * string.c (rb_str_append_literal): append but keep encoding non
- US-ASCII.
-
-Mon Sep 28 17:40:17 2015 Shugo Maeda <shugo@ruby-lang.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.
-
-Mon Sep 28 16:07:08 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (mtime): parse decimal fractions of a second as
- specified in RFC 3659.
-
-Mon Sep 28 10:31:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/test_forwardable.rb: Write basic tests for lib/forwardable.
- [fix GH-1035] Patch by @kachick
-
-Sun Sep 27 23:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (rb_define_class, rb_define_class_id_under): refine
- error messages.
-
- * class.c (rb_define_module, rb_define_module_id_under): ditto,
- and make consistent with class.
-
-Sun Sep 27 18:44:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: removed duplicated message.
-
-Sun Sep 27 15:46:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): add an option to enable/disable
- frozen-string-literal. [Feature #8976]
-
- * compile.c (iseq_compile_each): override compile option by option
- given by pragma.
-
- * iseq.c (rb_iseq_make_compile_option): extract a function to
- overwrite rb_compile_option_t.
-
- * parse.y (parser_set_compile_option_flag): introduce pragma to
- override compile options.
-
- * parse.y (magic_comments): new pragma "frozen-string-literal".
- [Feature #8976]
-
-Sun Sep 27 08:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (delete_field): do not raise NameError for
- existing keys. [Fix GH-1033]
-
-Sun Sep 27 00:34:31 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * 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
-
-Fri Sep 25 10:07:25 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http.rb: removed unused variable. It's removed at r13648.
- [fix GH-1022] Patch by @nkondratyev
-
-Fri Sep 25 09:48:27 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: upgrade to minitest-5.8.1
-
-Fri Sep 25 09:47:12 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * id_table.c: fix typo. [ci skip][fix GH-1031] Patch @davydovanton
-
-Fri Sep 25 07:54:05 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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]
-
-Thu Sep 24 17:25:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (paren_args): fix separator token at `foo::bar()` in
- ripper.
-
-Thu Sep 24 00:00:17 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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]
-
-Wed Sep 23 22:22:38 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * ext/openssl/ossl_pkcs12*: Remove svn commit id macro
-
-Wed Sep 23 01:11:28 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * ext/openssl/*: Remove svn commit id macros to make sync easier
-
-Tue Sep 22 04:20:01 2015 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027]
- patch by voxik.
-
- * test/rinda/test_rinda.rb: ditto
-
-Mon Sep 21 20:53:39 2015 tbpgr <tbpgr@tbpgr.jp>
-
- * test/win32ole/test_win32ole_event.rb: fix typo.
- swbemsink_avairable? => swbemsink_available? [Fix GH-1025]
-
-Sun Sep 20 10:07:35 2015 Anton Davydov <antondavydov.o@gmail.com>
-
- * cont.c (rb_callcc): [DOC] append continuations example across
- methods. [Fix GH-1026]
-
-Sun Sep 20 03:20:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (rb_iseq_free): free rb_iseq_t::body::cc_entries.
-
-Sun Sep 20 02:46:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- Before this patch, only rb_call_info_t data is passed.
- After this patch, above three structs are passed.
-
- This patch improves:
- * data locality (rb_call_info is now read-only data).
- * reduce memory consumption (rb_call_info_with_kwarg,
- rb_calling_info).
-
- * compile.c: use above data.
-
- * insns.def: ditto.
-
- * iseq.c: ditto.
-
- * vm_args.c: ditto.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
- * vm_insnhelper.h: ditto.
-
- * iseq.h: add iseq_compile_data::ci_index and
- iseq_compile_data::ci_kw_index.
-
- * tool/instruction.rb: introduce TS_CALLCACHE operand type.
-
-Sun Sep 20 02:18:10 2015 Tanaka Akira <akr@fsij.org>
-
- * test/lib/envutil.rb: mkfifo command based File.mkfifo method
- definition removed.
-
-Fri Sep 18 20:11:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_s_mkfifo): implement File.mkfifo.
- [Feature #11536]
-
-Fri Sep 18 16:56:19 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * NEWS: add Net::FTP#mlst and Net::FTP#mlsd.
-
-Fri Sep 18 07:39:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/objspace/objspace_dump.c (obj_type): add IMEMO types to the heap
- dump information.
-
-Thu Sep 17 22:33:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * common.mk: fix command error with outside builddir.
-
-Thu Sep 17 17:42:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * common.mk: separated test for test-framework from test-all task.
- They should be invoke at first before tests of test-all.
-
-Thu Sep 17 12:05:54 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don't
- use tricky code, please.
-
-Wed Sep 16 20:49:56 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * encindex.h: fix typo of last #endif comment. [ci skip]
-
-Wed Sep 16 20:39:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (set_const_visibility): fail if the class/module is
- frozen. [ruby-core:70828] [Bug #11532]
-
-Wed Sep 16 17:16:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Sep 16 15:08:17 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * doc/syntax/literals.rdoc (Strings): [DOC] Revise the character
- literal part.
-
-Wed Sep 16 14:55:33 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * doc/syntax/literals.rdoc (Strings): [DOC] Document the full list
- of supported escape sequences in string literals.
-
-Wed Sep 16 14:49:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_setbyte): keep the code range as possible.
-
-Wed Sep 16 13:23:48 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * doc/syntax/literals.rdoc (Strings): mention about ?a literal.
-
-Wed Sep 16 12:06:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * dir.c (glob_helper): check pathtype once again by lstat(2) if
- dp->d_type is DT_UNKNOWN. XFS may return DT_UNKNOWN.
-
-Wed Sep 16 03:49:19 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * test/ruby/test_thread.rb (TestThread#test_mutex_synchronize):
- insert waste loop for invoking preemptive thread context switch.
- [Bug #11496]
-
-Tue Sep 15 19:38:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_objspace_alloc, rb_objspace_free): define always
- regardless ENABLE_VM_OBJSPACE, and free heap pages.
-
-Tue Sep 15 15:15:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_sysinit, rb_w32_readdir): compare by
- encoding index to get rid of encoding initialization before VM
- object space allocation.
-
- * dir.c (fundamental_encoding_p, push_glob): compare by encoding
- index immediately.
-
- * 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().
-
- * encindex.h: separate encoding index constants from internal.h.
-
-Tue Sep 15 13:13:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Tue Sep 15 12:49:10 2015 Jason Barnabe <jason.barnabe@gmail.com>
-
- * 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]
-
-Tue Sep 15 12:44:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_qsort): use BSD-style qsort_r if available.
-
-Mon Sep 14 19:26:34 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames including
- space correctly.
-
-Mon Sep 14 11:12:10 2015 Anton Davydov <antondavydov.o@gmail.com>
-
- * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo, "convertion" to
- "conversion". [Fix GH-1016]
-
-Sun Sep 13 11:03:13 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h: prefix RUBY or RB to global symbols to get
- rid of name conflicts with other headers.
-
- * include/ruby/encoding.h, include/ruby/intern.h: ditto.
-
-Sun Sep 13 09:38:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,
- media_type, charset): new methods to return standard facts.
-
-Sat Sep 12 19:43:49 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear local
- variables here. vm_push_frame() clears.
-
- * vm_insnhelper.c (vm_call_iseq_setup_tailcall): ditto.
-
- * vm_insnhelper.c (vm_push_frame): move check code to
- vm_check_frame().
-
- Reorder initialization timing to reuse same values (sp).
-
- * compile.c (rb_iseq_compile_node): use
- iseq_set_exception_local_table() for ISEQ_TYPE_DEFINED_GUARD.
-
-Sat Sep 12 23:06:51 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (file?, directory?, appendable?, creatable?,
- deletable?, enterable?, renamable?, listable?, directory_makable?,
- purgeable?, readable?, writable?): new methods.
-
-Sat Sep 12 21:27:22 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (FACT_PARSERS): support system dependent facts
- UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime.
-
-Sat Sep 12 19:08:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (rb_w32_dup2): should return the new fd on
- success, while msvcrt returns 0 wrongly.
-
-Sat Sep 12 18:14:11 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError
- when parsing failed.
-
-Sat Sep 12 18:00:35 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "+00:00" to
- get UTC time. Thanks, Wilson Bilkovich.
-
-Sat Sep 12 17:55:24 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD
- specified in RFC 3659.
-
-Sat Sep 12 16:14:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * file.c: access()/eaccess() wrapping methods check more than just uid.
- [fix GH-1007][ci skip] Patch by @eam
-
-Sat Sep 12 16:07:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * README.md: improve markdown rendering for readability.
- [fix GH-1015][ci skip] Patch by @Matrixbirds
-
-Sat Sep 12 14:30:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (save_redirect_fd): make saved FDs close-on-exec not
- to be inherited.
-
- * process.c (run_exec_dup2): restore close-on-exec flags too.
-
- * win32/win32.c (fcntl): implement F_GETFD, F_SETFD, and
- F_DUPFD_CLOEXEC.
-
-Sat Sep 12 05:35:24 2015 Eric Wong <e@80x24.org>
-
- * rational.c (string_to_r_strict): preserve encoding in exception
-
-Fri Sep 11 20:23:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_call_info_t::aux.opt_pc.
-
- * vm_insnhelper.c: introduce shortcut functions for opt_pc == 0
- because opt_pc is always 0 on shortcut function.
-
-Fri Sep 11 17:49:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c: disable ISeq.load. It enabled accidentally at r51794.
-
-Fri Sep 11 11:15:12 2015 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.
-
- * lib/net/ftp.rb (system): remove LF from the return value.
-
-Thu Sep 10 22:48:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Sep 10 22:15:51 2015 Joe Rafaniello <jrafanie@redhat.com>
-
- * 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.
-
- Try to use more consistent language.
- [Fix GH-1008]
-
-Thu Sep 10 15:16:02 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (getmultiline): refactor.
-
-Thu Sep 10 12:17:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Sep 9 18:16:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Wed Sep 9 16:55:45 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (usage, enable_option, disable_option, process_options): new
- option `--disable-did_you_mean`.
-
- * gem_prelude.rb: now requires did_you_mean gem by default if available.
-
-Wed Sep 9 13:38:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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".
-
-Wed Sep 9 11:33:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk (update-gems): use BASERUBY instead of RUNRUBY.
-
-Wed Sep 9 11:08:59 2015 Zachary Scott <zzak@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]
-
-Wed Sep 9 10:05:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/rubygems/test_config.rb: fix broken tests for Windows platform.
-
-Wed Sep 9 07:46:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Tue Sep 8 23:17:36 2015 Yuki Nishijima <mail@yukinishijima.net>
-
- * gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta2.
-
-Tue Sep 8 23:09:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_s_popen): do not wait the child process during being
- killed. [ruby-core:70671] [Bug #11510]
-
-Tue Sep 8 22:18:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gems/bundled_gems: revert because ruby trunk never be able to install
- the did_you_mean gem. retry after enough test.
-
-Tue Sep 8 21:48:22 2015 Yuki Nishijima <mail@yukinishijima.net>
-
- * gems/bundled_gems: Automatically install the did_you_mean gem
- as a bundled gem. [Feature #11252]
-
-Tue Sep 8 17:17:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_call_info_t::blockiseq.
-
- * insns.def (send, invokesuper): pass blockiseq explicitly.
-
- * compile.c: catch up this fix.
-
- * iseq.c: ditto.
-
- * vm_args.c: ditto.
-
- * iseq.c (ISEQ_MINOR_VERSION): 2->3 because instruction spec was
- changed.
-
-Tue Sep 8 15:01:19 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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.
-
-Tue Sep 8 12:05:00 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_read_reparse_point): return correct required
- buffer size for IO_REPARSE_TAG_MOUNT_POINT.
-
-Tue Sep 8 00:14:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_execarg_parent_start1): raise with the target path
- name when open() failed.
-
-Mon Sep 7 23:45:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_exec_fail): raise with the target directory name
- when chdir() failed. pointed out by sorah.
-
-Mon Sep 7 22:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (insert): should use plain strdup() instead of
- ruby_strdup() at startup time, and plain free()ed in cmdglob().
-
-Mon Sep 7 16:49:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (rb_vm_struct): define objspace always regardless
- ENABLE_VM_OBJSPACE.
-
-Mon Sep 7 15:54:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby_atomic.h (ATOMIC_VALUE_CAS): fix typo.
- TODO: make arguments of all CAS macros consistent.
-
-Sun Sep 6 16:07:22 2015 Eric Wong <e@80x24.org>
-
- * ccan/list/list.h: suppress unused argument warnings
- [ccan commit 6aaca17e07588997417a73fac19dcf0ff17ed81b]
-
-Sat Sep 5 11:39:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction
- digits. [ruby-core:70667] [Bug #11509]
-
-Sat Sep 5 08:28:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_equal, rb_hash_eql): [DOC] the orders of each
- hashes are not compared. [Bug #11508]
-
-Fri Sep 4 23:26:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h: fix macro name for VC runtime version,
- RT_VER is only in Makefile.
-
-Fri Sep 4 17:46:17 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/contributing.rdoc: fix configuration option.
- [ci skip] [fix GH-1009]
-
-Fri Sep 4 04:46:54 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_memsize): functions for wrapper object should have
- iseqw_ prefix.
-
-Thu Sep 3 21:12:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/cgi/session.rb (create_new_id): use SHA512 instead of MD5.
- pointed out by SARWAR JAHAN.
-
-Thu Sep 3 20:29:18 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_raw_obj_info): iseq->body->location.first_lineno is Fixnum.
-
-Thu Sep 3 17:54:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (raise_method_missing): "names" should be singular.
- pointed out by Filip Bartuzi.
-
-Thu Sep 3 17:50:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_raw_obj_info): should support IMEMO/iseq.
-
-Thu Sep 3 10:07:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (raise_method_missing): refine error messages when a
- symbol is not given. [Fix GH-1013]
-
-Wed Sep 2 18:49:55 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Wed Sep 2 18:04:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h (GET_PC_COUNT): remove unused macro.
-
-Wed Sep 2 17:18:37 2015 Chris Schneider <chris@christopher-schneider.com>
-
- * process.c (proc_detach): [DOC] fix typo "intent" as "intend" in
- rdoc. [Fix GH-1011]
-
-Wed Sep 2 16:58:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_realpath_internal): use filesystem encoding if the
- argument is in ASCII encodings.
-
- * win32/file.c (rb_readlink): needs the result encoding.
-
-Tue Sep 1 18:37:15 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/thread/test_queue.rb: catch up last commit.
-
-Tue Sep 1 18:16:32 2015 Koichi Sasada <ko1@atdot.net>
-
- * thread_sync.c (queue_do_close): ignore multiple close to allow
- multiple producers.
- https://bugs.ruby-lang.org/issues/10600#note-14
-
-Tue Sep 1 18:06:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * thread_tools.c: rename thread_tools.c to thread_sync.c.
-
-Mon Aug 31 17:04:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (move_refined_method): should insert a write barrier
- from an original class to a created (cloned) method entry.
-
- * test/ruby/test_refinement.rb: add a test.
-
-Sun Aug 30 02:42:22 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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]
-
- * ext/openssl/extconf.rb: check for SSLv3 support in the SSL
- implementation.
-
- * test/openssl/test_ssl.rb (class OpenSSL): Skip tests that need SSLv3
- if there is no support.
-
-Fri Aug 28 16:05:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/*: Update rdoc master(cfffed5)
- https://github.com/rdoc/rdoc/pull/337
- https://github.com/rdoc/rdoc/pull/367
-
-Fri Aug 28 10:16:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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]
-
- * test/ruby/test_settracefunc.rb: add a test.
-
-Thu Aug 27 18:05:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/server.rb: use IO::NULL instead of '/dev/null'
- * test/ruby/test_string.rb: ditto.
-
-Thu Aug 27 15:24:57 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c (iseq_set_sequence): rename variable names
- to make it readable.
-
-Thu Aug 27 07:45:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * thread_tools.c: add Queue#close(exception=false) and
- SizedQueue#close(exception=false).
- [Feature #10600]
-
- Trying to deq from a closed empty queue return nil
- if exception parameter equals to false (default).
-
- If exception parameter is truthy, it raises
- ClosedQueueError (< StopIteration).
- ClosedQueueError inherits StopIteration so that you can write:
-
- loop{ e = q.deq; (using e) }
-
- Trying to close a closed queue raises ClosedQueueError.
-
- Blocking threads to wait deq for Queue and SizedQueue will be
- restarted immediately by returning nil (exception=false) or
- raising a ClosedQueueError (exception=true).
-
- Blocking threads to wait enq for SizedQueue will be
- restarted by raising a ClosedQueueError immediately.
-
- The above specification is not proposed specification, so that
- we need to continue discussion to conclude specification this
- method.
-
- * test/thread/test_queue.rb: add tests originally written by
- John Anderson and modify detailed behavior.
-
-Wed Aug 26 10:52:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
- till the end of string. [ruby-core:70592] [Bug #11488]
-
- * test/ruby/test_m17n.rb (test_include?, test_index): add tests by
- Tom Stuart.
-
-Wed Aug 26 09:26:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id_table.c (list_table_extend, hash_table_extend): remove C99
- features. [ruby-dev:49239] [Bug #11487]
-
-Tue Aug 25 06:34:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (w32_symlink): implement symlink().
-
-Mon Aug 24 16:01:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (rb_locale_encindex): find encoding index without
- making a string object every time. [ruby-core:58160] [Bug #9080]
-
-Sat Aug 22 15:43:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Sat Aug 22 08:23:32 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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]
-
- 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.
-
- Now, ext/thread/thread.c is empty, only for a dummy for
- compatibility.
-
- * thread.c: move a definition of Mutex class to thread_tools.c.
-
- 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.
-
- * common.mk: add dependency from thread.o to thread_tools.c.
-
-Sat Aug 22 05:31:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_opts.h, iseq.c, iseq.h: add compile option to force frozen
- string literals.
- [Feature #11473]
-
- This addition is not specification change, but to try frozen
- string literal world discussed on [Feature #11473].
-
- You can try frozen string literal world using this magical line:
-
- RubyVM::InstructionSequence.compile_option =
- {frozen_string_literal: true}
-
- Note that this is a global compilation option, so that you need to
- compile another script like that:
-
- 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
-
- Details:
- * String literals are deduped by rb_fstring().
- * Dynamic string literals ("...#{xyz}...") is now only frozen,
- not deduped. Maybe you have other ideas.
-
- Now, please do not use this option on your productions :)
- Of course, current specification can be changed.
-
- * compile.c: ditto.
-
- * test/ruby/test_iseq.rb: add a test.
-
-Sat Aug 22 02:53:12 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/psych/*: update to Psych 2.0.14
-
- * test/psych/*: ditto
-
-Fri Aug 21 19:58:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.
- [Feature #11158]
-
- * symbol.c (rb_sym_immortal_count): added to count immortal symbols.
-
- * symbol.h: ditto.
-
- * test/objspace/test_objspace.rb: add a test for this method.
-
- * NEWS: describe about this method.
-
-Fri Aug 21 19:48:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/Makefile.sub ($(LIBRUBY_SO)): needs additional libraries
- for extension libraries to link statically.
- [ruby-core:70499] [Feature #9018]
-
-Fri Aug 21 18:49:22 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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/ruby/test_settracefunc.rb: add tests.
-
-Fri Aug 21 17:32:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
- stable after invoking a block. [Bug #11451]
-
- * test/ruby/test_yield.rb: add a test. This test script is given by
- Alex Dowad.
-
-Fri Aug 21 06:35:50 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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]
-
-Thu Aug 20 22:19:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (basic_obj_respond_to): call respond_to_missing?
- only when redefined. [ruby-core:70460] [Bug #11465]
-
-Thu Aug 20 14:13:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (check_funcall_respond_to): share the behavior with
- rb_obj_respond_to. [ruby-core:70460] [Bug #11465]
-
- * vm_method.c (vm_respond_to): extract from rb_obj_respond_to and
- merge r39881.
-
-Thu Aug 20 08:53:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_obj_respond_to): reuse found method entry
- instead of searching same entry repeatedly.
-
-Thu Aug 20 08:31:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Aug 19 23:59:28 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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.
-
- * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been
- added to the options.
-
-Wed Aug 19 23:55:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_f_spawn): [DOC] elaborate environment variable
- values. [ruby-core:70456] [Bug #11463]
-
-Wed Aug 19 23:48:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (winnt_lstat): check reparse point tags and treat
- supported tags only as symbolic links.
- [ruby-core:70454] [Bug #11462]
-
-Tue Aug 18 20:05:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * thread_pthread.c (reserve_stack): ensure the memory is really
- allocated. [Bug #11457]
-
-Tue Aug 18 17:19:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (IS_BEG): include labeled argument state, which was
- EXPR_LABELARG. [ruby-dev:49221] [Bug #11456]
-
-Tue Aug 18 16:16:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Aug 17 20:56:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Aug 17 11:57:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_each_codepoint): raise an exception at incomplete
- character before EOF when conversion takes place. [Bug #11444]
-
-Sun Aug 16 17:33:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: update latest version of bundled gems.
- It includes minitest-5.8.0 and test-unit 3.1.3.
-
-Sun Aug 16 17:24:10 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * gc.c (gc_mark_children): check if RCLASS_EXT is valid
- before marking. This fixes the following test failure
- introduced in r51126:
-
- make test-all TESTOPTS='--gc-stress ruby/test_refinement.rb'
-
-Sat Aug 15 10:51:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (API#SetValue): data size should
- be in bytes, not in chars. [ruby-core:70365] [Bug #11439]
-
-Sat Aug 15 10:15:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_each_codepoint): read more data when read partially.
- [ruby-core:70379] [Bug #11444]
-
-Sat Aug 15 04:33:39 2015 Eric Wong <e@80x24.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]
-
-Sat Aug 15 04:16:13 2015 Eric Wong <e@80x24.org>
-
- * iseq.c (rb_iseq_mark): reduce NULL checks
-
-Fri Aug 14 18:50:57 2015 Eric Wong <e@80x24.org>
-
- * method.h (METHOD_ENTRY_VISI_SET): cast visi to int
- (METHOD_ENTRY_FLAGS_SET): ditto
-
-Fri Aug 14 18:43:11 2015 Eric Wong <e@80x24.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]
-
-Fri Aug 14 18:40:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (API#SetValue): add terminator
- size, not 1 byte. [ruby-core:70365] [Bug #11439]
-
-Thu Aug 13 22:49:42 2015 Juanito Fatas <katehuang0320@gmail.com>
-
- * lib/timeout.rb (Timeout#timeout): freeze a string message to
- reduce string allocations. [Fix GH-996]
-
-Thu Aug 13 17:42:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
-Thu Aug 13 14:36:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_num_to_dbl): move from num2dbl_with_to_f in math.c.
-
-Thu Aug 13 09:01:25 2015 Eric Wong <e@80x24.org>
-
- * load.c (features_index_add): avoid repeat calculation
-
-Wed Aug 12 21:57:31 2015 Koichi Sasada <ko1@atdot.net>
-
- * id_table.c: IMPL() macro accept op as _opname instead of opname
- because jemalloc seems to replace the word `free' to `je_free'.
-
-Wed Aug 12 21:51:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * id_table.c (mix_id_table_insert): fix memory leak.
-
-Wed Aug 12 21:17:38 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed Aug 12 21:15:27 2015 Eric Wong <e@80x24.org>
-
- * vm_core.h (rb_call_info_kw_arg_bytes): extract from compile.c
- * compile.c (iseq_build_callinfo_from_hash): use above function
-
-Wed Aug 12 18:00:17 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (move_refined_method): same as the last commit.
-
-Wed Aug 12 17:57:53 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c, gc.c vm.c: use ID_TABLE_* instead of ST_*
- (such as ST_CONTINUE) for enum rb_id_table_iterator_result.
-
-Wed Aug 12 17:05:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * id_table.h: introduce ID key table.
- [Feature #11420]
-
- This table only manage ID->VALUE table to reduce overhead of st.
-
- Some functions prefixed rb_id_table_* are provided.
-
- * id_table.c: implement rb_id_table_*.
-
- There are several algorithms to implement it.
-
- Now, there are roughly 4 types:
-
- * st
- * array
- * hash (implemented by Yura Sokolov)
- * mix of array and hash
-
- The macro ID_TABLE_IMPL can choose implementation.
- You can see detailes about them at the head of id_table.c.
-
- 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.
-
- * symbol.c: introduce rb_id_serial_t and rb_id_to_serial()
- to represent ID by serial number.
-
- * internal.h: use id_table for method tables.
-
- * class.c, gc.c, marshal.c, vm.c, vm_method.c: ditto.
-
-Wed Aug 12 05:19:11 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Aug 11 22:59:57 2015 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (Init_Numeric): Fix document for Float::MIN and
- Float::EPSILON.
-
-Tue Aug 11 15:22:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (ALLOCV_N): check integer overflow, as well
- as ruby_xmalloc2. pointed out by Paul <pawlkt AT gmail.com>.
-
-Tue Aug 11 14:57:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_repeated_permutation): fix buffer size, ALLOCV_N
- already multiplies element size.
-
-Tue Aug 11 12:13:20 2015 Jeremy Evans <merch-redmine@jeremyevans.net>
-
- * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised
- in OpenSSL tests. [ruby-core:70020][Bug #11368]
-
-Tue Aug 11 11:54:13 2015 Alexey Lipnyagov <liptonshmidt@gmail.com>
-
- * string.c: Fix documentation for String#slice
- [ruby-core:70298][Bug #11427]
-
-Tue Aug 11 11:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (superclass): make superclass rule optional and allow
- any contents without a terminator. [EXPERIMENTAL]
-
-Tue Aug 11 10:58:42 2015 Juanito Fatas <juanitofatas@gmail.com>
-
- * string.c: [DOC] Make #end_with? example doc symmetry
- with #start_with? [fix GH-992][ci skip]
-
-Tue Aug 11 10:51:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_array.rb: Add test for `Array#flatten` with level 1
- [fix GH-986] Patch @yui-knk
-
-Tue Aug 11 10:48:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Tue Aug 11 10:33:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * vm_method.c: typo fix [fix GH-993][ci skip] Patch by @0x0dea
- * test/ruby/test_refinement.rb: ditto.
-
-Sun Aug 9 14:15:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (Init_vm_objects, rb_vm_fstring_table): use frozen_strings
- table in rb_vm_t. [ruby-core:70274] [Bug #11423]
-
-Sat Aug 8 03:59:51 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * object.c: [DOC] Improve grammar for Module#===
- Patch by @SkyBirdSoar in documenting-ruby/ruby#52:
- https://github.com/documenting-ruby/ruby/pull/52
-
-Sat Aug 8 03:39:33 2015 Zachary Scott <zzak@ruby-lang.org>
-
- * 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 Aug 7 21:04:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_params): turn in_def and in_single into bit
- flags and reduce the size by 2-words.
-
- * parse.y (parser_params): remove redundant prefixes.
-
- * parse.y (yylex): non-pure parser has not been supported since
- merger of ripper. change argument types from void pointers.
-
-Fri Aug 7 17:07:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (method_super_method): uncallable method entry does not
- have the defined class, use the owner instead.
- [ruby-core:70254] [Bug #11419]
-
- * test/ruby/test_method.rb (test_super_method_unbound): add test
- by Akira Matsuda.
-
-Thu Aug 6 10:49:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (rb_alloc_tmp_buffer): round up the size and check the
- range.
-
- * ruby_atomic.h (ATOMIC_VALUE_EXCHANGE, ATOMIC_VALUE_CAS): add
- atomic operations for VALUE.
-
-Thu Aug 6 08:15:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- SSLSocket#sysclose to Ruby.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_close): ditto
-
-Thu Aug 6 07:57:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move nonblock
- enable to SSLSocket#initialize and remove Nonblock module.
-
-Thu Aug 6 07:53:47 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- OpenSSL::SSL::SSLSocket#initialize to Ruby.
-
- * ext/openssl/ossl_ssl.c: ditto
-
-Thu Aug 6 02:25:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (rb_alloc_tmp_buffer): use NODE_ALLOCA to mark locations
- like as builtin alloca. [ruby-core:70251] [Bug #11418]
-
-Wed Aug 5 14:37:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Tue Aug 4 16:53:43 2015 Aaron Patterson <tenderlove@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.
-
- * ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby
- methods.
-
-Tue Aug 4 16:40:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_module.rb: should not expect a method table ordering.
- [Feature #11414]
-
-Tue Aug 04 15:30:04 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_block_clear_env_self): clear by Qfalse instead of Qnil.
- [Bug #11409]
-
- * test/ruby/test_eval.rb: add tests for this issue,
- written by @0x0dea.
- https://github.com/ruby/ruby/pull/988
-
-Tue Aug 4 12:12:14 2015 Eric Wong <e@80x24.org>
-
- * variable.c: wrap long lines
-
-Tue Aug 4 09:32:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * proc.c: Removing duplicate doc [fix GH-987][ci skip]
- Patch by @ronakjangir47
-
-Tue Aug 4 09:21:58 2015 Richard Schneeman <richard.schneeman+foo@gmail.com>
-
- * doc/contributing.rdoc: fixed wrong instructions with OS X
- [fix GH-989][ci skip] Patch by @schneems
-
-Mon Aug 3 10:08:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_memsearch): should match only char boundaries in wide
- character encodings. [ruby-core:70220] [Bug #11413]
-
-Sun Aug 2 07:01:17 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sat Aug 1 17:13:15 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * 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]
-
- * test/net/http/test_httpresponse.rb: tests for the above.
-
-Sat Aug 1 17:05:18 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * lib/net/http/response.rb (Net::HTTPResponse#inflater):
- fix TypeError. An exception object might be nil.
- [ruby-core:68846] [Bug #11058]
-
-Sat Aug 1 09:09:46 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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`.
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Default `options`
- to SSL_OP_ALL
-
-Sat Aug 1 06:54:36 2015 Aaron Patterson <tenderlove@ruby-lang.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
-
-Sat Aug 1 04:06:29 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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/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
-
-Sat Aug 1 03:49:31 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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.
-
-Sat Aug 1 03:43:10 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): create an array
- and use `rb_apply` to clean up calls to `rb_protect`.
-
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
-
-Sat Aug 1 03:27:12 2015 Aaron Patterson <tenderlove@ruby-lang.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.
-
-Sat Aug 1 03:14:07 2015 Aaron Patterson <tenderlove@ruby-lang.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.
-
- * ext/openssl/ossl_ssl.c: call the tmp_dh_callback instead of
- accessing the SSLContext's internals.
-
-Fri Jul 31 23:34:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * .travis.yml: update libssl before running tests.
- Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for figuring out the
- travis settings!
-
-Fri Jul 31 21:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_require_internal): use rb_load_internal0 not to raise
- a exception to be caught.
-
-Thu Jul 30 13:19:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_const_get_0): warn deprecated constant reference.
-
- * variable.c (rb_mod_deprecate_constant): mark constants to be
- warned as deprecated. [Feature #11398]
-
-Thu Jul 30 11:53:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_s_handle_interrupt): make identity hash, to
- compare masking classes just by their IDs.
-
-Thu Jul 30 11:52:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Jul 30 10:42:27 2015 Alex Dowad <alexinbeijing@gmail.com>
-
- * 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]
-
-Thu Jul 30 08:48:42 2015 Eric Wong <e@80x24.org>
-
- * st.c (find_entry): constify st_table*
- (find_packed_index_from): ditto
- (find_packed_index): ditto
- (get_keys): ditto
- (get_values): ditto
-
-Thu Jul 30 04:29:25 2015 Eric Wong <e@80x24.org>
-
- * benchmark/bm_hash_aref_dsym.rb: new benchmark
- * benchmark/bm_hash_aref_dsym_long.rb: ditto
- * benchmark/bm_hash_aref_fix.rb: ditto
-
-Wed Jul 29 21:38:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (any_hash), symbol.c (dsymbol_alloc): fix dynamic symbol
- hash value by restricting in Fixnum range, that is `long`.
-
-Wed Jul 29 17:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_obj_hash): move in order to share with rb_any_hash.
-
-Wed Jul 29 16:00:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_buf_cat): consider empty non-embed string case,
- not to loop infinitely. [ruby-core:70074] [Bug #11383]
-
-Wed Jul 29 15:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Jul 29 14:54:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_sym_hash): return same value as rb_any_hash() of
- Symbol. [Bug #9381]
-
- * hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
- Fixnum, but not a long. [Bug #9381]
-
-Wed Jul 29 11:07:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.
-
-Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com>
-
- * gc.c: document argument passed to finalizer proc.
- [fix GH-976][ci skip] Patch by @alexdowad
-
-Wed Jul 29 10:36:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * io.c (rb_io_extract_modeenc): add option parameter `flags'
- to append extra oflags to normal mode.
- [Feature #11253] [ruby-core:69539]
-
-Wed Jul 29 04:54:47 2015 Eric Wong <e@80x24.org>
-
- * test/rubygems/test_gem_remote_fetcher.rb: pre-generate test key
- [ruby-core:70151] [Bug #11397]
-
-Tue Jul 28 10:32:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (struct RClass): moved from ruby/ruby.h to hide the
- internals.
-
-Tue Jul 28 08:48:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_TYPE_ATTRIBUTE): attribute declaration for
- types.
-
-Tue Jul 28 07:23:03 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Jul 28 03:26:15 2015 Aaron Patterson <tenderlove@ruby-lang.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.
-
- * test/openssl/test_ssl.rb (class OpenSSL): test for change
-
-Mon Jul 27 13:24:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * template/id.h.tmpl (ID2ATTRSET): remove an unused macro.
-
-Mon Jul 27 12:21:15 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/openssl/test_ssl.rb: run tests on non-Unix platforms.
-
-Sun Jul 26 19:21:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_alpn_protocol): fix condition
- to compile, needs ALPN to be available. [Feature #9390]
-
-Sun Jul 26 11:29:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (default_handler, Init_signal): discard SIGSYS, ENOSYS
- should raise a SystemCallError always instead.
-
-Sun Jul 26 10:26:35 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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.
-
- * test/openssl/test_ssl.rb (class OpenSSL): test for change.
-
-Sun Jul 26 10:07:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * test/openssl/test_ssl.rb (class OpenSSL): add test coverage around
- OpenSSL::SSL::SSLContext#servername_cb
-
-Sun Jul 26 09:10:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: update latest version of bundled power_assert.
-
-Sun Jul 26 08:49:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Sun Jul 26 08:33:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/pkey.rb: implement DEFAULT_512 and
- DEFAULT_1024 constants in Ruby.
-
- * 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.
-
- * ext/openssl/ossl_pkey_dh.c (OSSL_PKEY_BN): Remove C definitions of
- DEFAULT_512 and DEFAULT_1024
-
- * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
-
- * test/openssl/test_pkey_dh.rb (class OpenSSL): add test to ensure the
- Ruby definitions are the same as the C definitions were.
-
-Sun Jul 26 08:14:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): support
- specifically setting the tmp_dh_callback to nil.
-
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
-
- * test/openssl/test_pair.rb (module OpenSSL): add a test
-
-Sun Jul 26 07:47:14 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move the default
- tmp_dh_callback Ruby code and set it as a default in `initialize`.
-
- * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_512_GEN):
- move this constant to Ruby.
-
- * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_1024_GEN):
- ditto
-
- * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto
-
- * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): tmp_dh_callback should
- always be set, so we can remove this conditional
-
-Sun Jul 26 06:22:24 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * test/openssl/test_pair.rb: add a test ensuring that the default DH
- callback is used when no DH callback is specified.
-
-Sun Jul 26 04:08:27 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add missing
- instance variables to squash warnings with alpn.
-
-Sun Jul 26 03:42:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move
- OpenSSL::SSL::SSLContext#initialize implementation to pure Ruby.
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): ditto
-
- * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto
-
-Sat Jul 25 21:03:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Jul 25 11:05:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_replace_shared_without_enc): fill the terminator
- of embedded strings in wide char encodings.
-
-Sat Jul 25 06:38:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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
-
- * iseq.h: same for iseq_catch_table::size.
-
- * compile.c: catch up these fix.
-
- * iseq.c: ditto.
-
- * proc.c: ditto.
-
- * vm.c: ditto.
-
- * vm_args.c: ditto.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
-Sat Jul 25 06:00:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_constant_body::line_info_table.
-
- * iseq.c: catch up this fix.
-
-Sat Jul 25 05:56:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_constant_body::param::opt_table and
- rb_iseq_constant_body::param::keyword.
-
- * compile.c: catch up this fix.
-
-Sat Jul 25 04:47:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_constant_body::catch_table.
-
- * compile.c (iseq_set_exception_table): catch up this fix.
-
- * iseq.c: ditto.
-
- * vm.c (vm_exec): ditto.
-
-Fri Jul 24 21:29:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * st.c (EQUAL, st_delete_safe): fix arguments order to compare
- function, searching key is the first and stored key is the
- second always.
-
-Fri Jul 24 21:27:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri Jul 24 20:09:43 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast): ditto
- for Rinda::TestRingServer#test_make_socket_ipv6_multicast.
-
- * test/rinda/test_rinda.rb (test_ring_server_ipv6_multicast): ditto
- for Rinda::TestRingServer#test_ring_server_ipv6_multicast.
-
-Fri Jul 24 16:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (fstr_update_callback): pool bare strings only.
-
- * 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]
-
-Fri Jul 24 16:35:34 2015 yui-knk <spiketeika@gmail.com>
-
- * file.c (rb_file_s_extname): [DOC] add an example.
-
- * 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')
-
-Thu Jul 23 18:50:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_constant_body::local_table and
- rb_iseq_param_keyword::table and
- rb_iseq_param_keyword::default_values.
-
- * compile.c: catch up this fix.
-
- * iseq.c: ditto.
-
-Thu Jul 23 17:30:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_constant_body::iseq_encoded and
- rb_control_frame_t::pc.
-
- * compile.c (rb_iseq_translate_threaded_code): catch up this fix.
-
- * iseq.c: ditto.
-
- * vm_exec.c (vm_exec_core): ditto.
-
-Thu Jul 23 10:25:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h: add raw FL macros, which assume always the
- argument object is not a special constant.
-
- * internal.h (STR_EMBED_P, STR_SHARED_P): valid only for T_STRING.
-
- * string.c: deal with taint flags directly across String instances.
-
-Thu Jul 23 09:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (lambda_body): pop cmdarg stack for lookahead
- token. [ruby-core:70067] [Bug #11380]
-
-Thu Jul 23 04:03:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c: fix tests by not setting the instance
- variable on the frozen ssl instance.
-
-Thu Jul 23 03:32:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356]
-
- * test/openssl/test_pair.rb: test for ECDH callback support
-
-Thu Jul 23 03:29:49 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/openssl/ossl_ssl.c: add ALPN support. [Feature #9390]
-
- * ext/openssl/extconf.rb: detect ALPN support in OpenSSL
-
- * test/openssl/test_ssl.rb: test for ALPN
-
-Wed Jul 22 23:44:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Jul 22 20:17:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: modify layout of rb_iseq_constant_body.
-
- Move frequent accessing fields to upper part.
-
-Wed Jul 22 19:57:47 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove unused declaration of
- iseq_compile_data_ensure_node_stack.
-
-Wed Jul 22 19:52:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: separate rb_iseq_body into rb_iseq_constant_body and
- rb_iseq_variable_body (rb_iseq_t::variable_body).
-
- rb_iseq_variable_body can be modified after compilation.
-
- * compile.c: use rb_iseq_t::variable_body.
-
- * iseq.c: ditto.
-
- * thread.c: ditto.
-
-Wed Jul 22 17:50:35 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/matrix/eigenvalue_decomposition.rb: refine code style.
- [fix GH-959][ci skip] Patch by @bogdanvlviv
-
-Wed Jul 22 15:48:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_range.rb: Add test case for Range#end with
- exclude_end true case. [fix GH-968] Patch by @yui-knk
-
-Wed Jul 22 09:45:31 2015 Maksim Sitnikov <sitnikovme@undev.ru>
-
- * numeric.c (num_coerce): [DOC] fix doc for Numeric#coerce,
- missing '+'. [Fix GH-974]
-
-Wed Jul 22 07:24:18 2015 Koichi Sasada <ko1@atdot.net>
-
- * make rb_iseq_t T_IMEMO object (type is imemo_iseq).
-
- 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.
-
- 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.
-
- This patch is big, but most of difference is replacement of
- iseq->xxx to iseq->body->xxx.
-
- (previous) rb_iseq_t::compile_data is also located to
- rb_iseq_t::compile_data.
- It was moved from rb_iseq_body::compile_data.
-
- Now rb_iseq_t has empty two pointers.
- I will split rb_iseq_body data into static data and dynamic data.
-
- * compile.c: rename some functions/macros.
- Now, we don't need to separate iseq and iseqval (only VALUE).
-
- * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq).
-
- * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq.
-
- * gc.c: check T_IMEMO/iseq.
-
- * internal.h: add imemo_type::imemo_iseq.
-
- * iseq.c: define RubyVM::InstructionSequence as T_OBJECT.
- Methods are implemented by functions named iseqw_....
-
- * load.c (rb_load_internal0): rb_iseq_new_top() returns
- rb_iseq_t (T_IMEMO/iesq).
-
- * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq).
-
- * vm_core.h (GetISeqPtr): removed because it is not T_DATA now.
-
- * vm_core.h (struct rb_iseq_body): remove padding for
- [Bug #10037][ruby-core:63721].
-
-Wed Jul 22 07:15:33 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c (total_i): no need to skip singleton classes.
-
-Wed Jul 22 06:37:54 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_call_info_t::kw_arg,
- rb_control_frame_t::iseq and rb_control_frame_t::block_iseq.
-
- * iseq.c (iseq_free): catch up this fix.
-
- * vm.c: ditto.
-
- * vm_dump.c: ditto.
-
-Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_call_info_t::blockiseq and rb_block_t::iseq.
-
- * vm.c, vm_insnhelper.c: catch up this fix.
-
- * iseq.c (iseq_data_to_ary): constify the first iseq parameter.
-
- * vm_insnhelper.c (vm_make_proc_with_iseq): ditto.
-
-Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: constify rb_method_iseq_t::iseqptr.
-
- * proc.c (rb_method_entry_min_max_arity): catch up this fix.
-
- * vm_insnhelper.c (def_iseq_ptr): constify.
-
-Wed Jul 22 03:37:39 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (internal_object_p): Now a singleton classes appear by
- ObjectSpace.each_object. [Bug #11360]
-
- * test/ruby/test_objectspace.rb: add a test about it.
-
-Tue Jul 21 21:21:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (do_select): replace switch and goto with a loop to
- suppress maybe-uninitialized warnings by gcc6.
-
- * thread.c (set_unblock_function, rb_wait_for_single_fd): ditto.
-
-Tue Jul 21 20:32:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_range.rb: Add test for Range#hash
- [fix GH-969] Patch by @yui-knk
-
-Tue Jul 21 19:43:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * compile.c: constify the first parameter (iseq).
- * iseq_add_mark_object()
- * iseq_add_mark_object_compile_time()
-
- * iseq.c, iseq.h (rb_iseq_add_mark_object): ditto.
-
-Tue Jul 21 16:18:48 2015 Eric Wong <e@80x24.org>
-
- * test/socket/test_nonblock.rb: increase buffer sizes
- to OpenBSD limits. Thanks to Jeremy Evans <code@jeremyevans.net>
- [ruby-core:70058]
-
-Tue Jul 21 16:08:53 2015 Eric Wong <e@80x24.org>
-
- * load.c (ruby_dln_librefs): make static
-
-Tue Jul 21 13:36:54 2015 yuuji.yaginuma <yuuji.yaginuma@gmail.com>
-
- * lib/optparse.rb (complete): [DOC] fix typo. [Fix GH-973]
-
-Tue Jul 21 05:20:21 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Mon Jul 20 15:04:30 2015 Eric Wong <e@80x24.org>
-
- * parse.y (parser_initialize): avoid redundant zero-ing
-
-Mon Jul 20 12:12:05 2015 Eric Wong <e@80x24.org>
-
- * parse.y (struct parser_params): pack: 88 => 256 bytes on 64-bit
- [ruby-core:70034] [Feature #11371]
-
-Sun Jul 19 14:29:18 2015 windwiny <windwiny.ubt@gmail.com>
-
- * ext/pty/pty.c: [DOC] fix example typo, an old name at move from
- PTY.open. [Fix GH-972]
-
-Sat Jul 18 21:29:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (vm_check_ints_blocking): gather common statements at
- the end, and prefer LIKELY for Visual C optimization.
-
-Sat Jul 18 20:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_load_internal0): do not raise any exceptions but
- return the result tag state.
-
- * load.c (rb_load_protect): reduce nested EXEC_TAGs.
-
-Sat Jul 18 19:52:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (run_finalizer): set and restore safe level here to reduce
- nested EXEC_TAGs.
-
-Sat Jul 18 18:45:22 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ruby_cleanup): error_handle() returns exit status to the
- system, not internal error state, do not convert the exit status
- again.
-
-Sat Jul 18 10:29:03 2015 Eric Wong <e@80x24.org>
-
- * test/ruby/test_process.rb: test thread+sigs work after failed exec
-
-Sat Jul 18 07:20:18 2015 Jeremy Evans <code@jeremyevans.net>
-
- * test/socket/test_nonblock: use smaller buffer for sendmsg
- [ruby-core:70016] [Bug #11364]
-
-Sat Jul 18 07:04:24 2015 Eric Wong <e@80x24.org>
-
- * signal.c (trap_handler): cleanup to use RSTRING_GETMEM + memcmp
-
-Sat Jul 18 02:53:06 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Fri Jul 17 23:51:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_eval_cmd): $SAFE=4 has been deprecated.
-
-Fri Jul 17 22:18:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): use enum ruby_tag_type names.
-
- * vm_core.h (ruby_tag_type): move from eval_intern.h for compiling
- break/next/redo/return.
-
-Fri Jul 17 15:39:19 2015 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.
-
- * re.c (rb_reg_expr_str): use ENC_CODERANGE_CLEAN_P.
-
- * string.c (enc_strlen, rb_enc_cr_str_buf_cat, rb_str_scrub):
- ditto.
-
- * string.c (rb_str_enumerate_chars): ditto, and suppress a warning
- by gcc6.
-
-Fri Jul 17 15:36:52 2015 yui-knk <spiketeika@gmail.com>
-
- * test/ruby/test_range.rb (test_first_last): Add test for
- `Range.new`. [Fix GH-971]
-
-Fri Jul 17 15:36:40 2015 yui-knk <spiketeika@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]
-
-Fri Jul 17 09:59:14 2015 Eric Wong <e@80x24.org>
-
- * thread.c (rb_thread_alone): simplify
-
-Fri Jul 17 09:58:32 2015 Eric Wong <e@80x24.org>
-
- * lib/rinda/tuplespace.rb: remove enumerator require
- * test/pathname/test_pathname.rb: ditto
-
-Fri Jul 17 05:33:58 2015 Eric Wong <e@80x24.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
-
-Thu Jul 16 19:12:30 2015 Eric Wong <e@80x24.org>
-
- * thread.c (mutex_alloc): remove needless volatile
-
-Thu Jul 16 22:05:29 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: constify rb_iseq_t::parent_iseq.
-
- rb_iseq_t::local_iseq is not constant data because
- local_iseq::flip_cnt can be modified (commented).
-
- * compile.c: catch up this fix.
-
- * iseq.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
-Thu Jul 16 21:47:47 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * process.c (dup2_with_divert): new function for the above purpose.
-
- * 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.
-
- * thread_win32.c (rb_divert_reserved_fd): always returns 0 because
- of no reserved FDs.
-
- * internal.h (rb_divert_reserved_fd): prototype declaration.
- It is Ruby internal use only.
-
-Thu Jul 16 21:47:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (rb_iseq_disasm): rename rb_iseq_t *iseqdat to iseq
- and VALUE *iseq to code.
-
- * iseq.c (rb_iseq_disasm_insn): ditto.
-
-Thu Jul 16 14:34:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (REWIND_CFP): keep the arguments region inside the valid
- value stack. [ruby-core:69969] [Bug #11352]
-
-Thu Jul 16 11:38:21 2015 Eric Wong <e@80x24.org>
-
- * process.c (close_unless_reserved): declare type of `fd' arg
-
-Thu Jul 16 08:47:29 2015 Eric Wong <e@80x24.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]
-
-Thu Jul 16 02:56:14 2015 Eric Wong <e@80x24.org>
-
- * thread.c (thread_initialize): avoid RSTRING_PTR and NUMT2INT
-
-Thu Jul 16 01:00:46 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/ruby/test_process.rb (test_exec_close_reserved_fd): test for
- [Bug #11353]
-
-Thu Jul 16 00:35:42 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * .gitignore: ignore version.i.
-
-Wed Jul 15 23:40:32 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
- use RUBY (= EnvUtil.rubybin)
-
-Wed Jul 15 23:01:22 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * process.c (close_unless_reserved): new function to close FD unless
- it is reserved for internal communication.
-
- * thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
- to avoid false positive in forked child process.
-
-Wed Jul 15 18:31:18 2015 Eric Wong <e@80x24.org>
-
- * proc.c (proc_mark): remove redundant check
- * vm.c (env_mark): ditto
-
-Wed Jul 15 17:27:40 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Wed Jul 15 16:55:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * encoding.c (enc_autoload): drop dummy encoding flag from
- the loaded encoding index. this flag is used only in this
- source.
-
-Wed Jul 15 14:39:29 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_make_env_each): add comments about env layout.
- Do not use `i' to specify `new_ep'.
-
- * vm.c (rb_proc_create, rb_vm_make_proc_lambda): envval is not used.
-
-Wed Jul 15 08:59:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once
- to get rid of inadvertent side effects.
-
-Wed Jul 15 02:53:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, vm.c: remove rb_proc_t::envval because we can know it via
- rb_proc_t::block::ep.
-
- rb_vm_proc_envval(const rb_proc_t *proc) returns an Env object which
- the Proc object use.
-
- * proc.c: catch up this fix.
-
- * vm_dump.c (rb_vmdebug_proc_dump_raw): ditto.
-
-Wed Jul 15 02:27:22 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h, vm.c: remove rb_env_t::prev_envval because we can know it
- via env->ep.
-
- rb_vm_env_prev_envval(env) returns prev_envval via env->ep.
-
- * 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().
-
- * proc.c: catch up these changes.
-
- * vm_dump.c: ditto.
-
- * vm.c: rename macros.
-
- * 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.
-
-Wed Jul 15 01:09:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: refactoring Proc/Env related code.
-
- * 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.
-
- * vm.c (vm_make_env_each): make an Env object with this layout.
- And also simplify parameters.
-
- * proc.c: catch up this fix.
-
- * vm_core.h: remove rb_env_t::local_size because it is not used.
-
- * vm_dump.c (rb_vmdebug_env_dump_raw): catch up this fix.
-
- * vm_core.h (rb_vm_make_env_object): remove rb_vm_make_env_object()
- because it is only referred from vm.c.
-
- * vm_eval.c (eval_string_with_cref): catch up this fix.
-
-Wed Jul 15 00:03:36 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * gc.c (__has_feature): move into internal.h.
-
- * internal.h (__has_feature): ditto.
-
- * internal.h (__has_extension): new macro.
-
- * internal.h (STATIC_ASSERT): use _Static_assert with
- clang. [ruby-core:69931] [Bug #11343]
-
-Wed Jul 15 00:00:00 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * random.c (fill_random_bytes_syscall): fix compile error with
- clang. [ruby-core:69931] [Bug #11343]
-
-Tue Jul 14 11:22:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
- notify the handler thread of new timeout registration.
-
- * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
- make sleep intervals adaptive than fixed period intervals.
-
- * lib/webrick/server.rb (WEBrick::GenericServer#start): flush
- shutdown pipe.
-
- * lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
- server to stop immediately by sending data via shutdown pipe.
-
-Mon Jul 13 23:58:08 2015 Stefano Tortarolo <stefano.tortarolo@gmail.com>
-
- * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT):
- fix typos in debugger statements. [Fix GH-967]
-
-Mon Jul 13 19:11:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/timeout.rb (timeout): warn as deprecated for a long time.
-
-Mon Jul 13 01:37:27 2015 Zachary Scott <zzak@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.
-
-Sun Jul 12 09:20:02 2015 Shota Fukumori <her@sorah.jp>
-
- * ext/socket/basicsocket.c: [DOC] typo (Errno::AGAIN -> Errno::EAGAIN)
-
- * ext/socket/socket.c: ditto
-
- * ext/socket/tcpserver.c: ditto
-
- * ext/socket/udpsocket.c: ditto
-
- * ext/socket/unixserver.c: ditto
-
- * io.c: ditto
-
-Sun Jul 12 06:42:23 2015 ksss <co000ri@gmail.com>
-
- * test/stringio/test_stringio.rb (test_sysread): add a test for
- StringIO#sysread. [Fix GH-966]
-
-Sat Jul 11 21:16:34 2015 ksss <co000ri@gmail.com>
-
- * ext/stringio/stringio.c (Init_stringio): [DOC] Fix an example,
- StringIO#puts should be set "\n" at last. [Fix GH-965]
-
-Sat Jul 11 12:45:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line
- number and fix caller depth.
-
-Fri Jul 10 22:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Fri Jul 10 17:41:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (is_case_sensitive): get attributes by the file descriptor
- of open directory, instead of using mount point name.
-
-Fri Jul 10 10:46:02 2015 ksss <co000ri@gmail.com>
-
- * ext/stringio/stringio.c (writable): remove unnecessary check for
- deprecated safe level 4. [Fix GH-963]
-
-Thu Jul 9 15:07:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (waitpid): return immediately if interrupted.
- reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]
-
-Thu Jul 9 13:03:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_search_super_method): use CI_SET_FASTPATH().
-
-Thu Jul 9 11:07:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_call_info_t::klass because
- rb_callable_method_entry_t has information about defined class.
-
- * vm_insnhelper.c (vm_search_method): don't set ci->klass because
- it is removed.
-
- * vm_insnhelper.c (rb_equal_opt): ditto.
-
- * vm_insnhelper.c (vm_search_superclass): removed because it is too
- simple to write code directly.
-
- * vm_insnhelper.c (vm_defined): don't use vm_search_superclass().
- This fix avoid searching current callable `me' twice.
-
- * vm_insnhelper.c (vm_search_super_method): ditto.
-
-Thu Jul 9 10:03:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http/responses.rb: Added 308 status to CODE_TO_OBJ list.
- [fix GH-961] Patch by @billinghamj
-
-Thu Jul 9 09:34:14 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (rb_control_frame_t): fix comments (layout index).
-
-Thu Jul 9 09:25:50 2015 Zachary Scott <e@zzak.io>
-
- * parse.y: Improve duplicate key warning with patch by @andremedeiros
- [Fix GH-938] https://github.com/ruby/ruby/pull/938 [Bug #11327]
-
-Wed Jul 8 07:43:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/csv.rb: typo fix [ci skip][fix GH-958] Patch by @henrik
-
-Wed Jul 8 04:42:27 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Jul 7 18:18:41 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * random.c (fill_random_bytes_syscall): fix compile error.
-
-Tue Jul 7 16:47:30 2015 Eric Wong <e@80x24.org>
-
- * compile.c (COMPILE_ERROR): reduce GET_THREAD() calls
-
-Tue Jul 7 16:39:04 2015 Eric Wong <e@80x24.org>
-
- * random.c (fill_random_bytes_syscall): return -1 for error
- * random.c (fill_random_bytes): try urandom on syscall failure
-
-Tue Jul 7 15:02:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Tue Jul 7 14:40:08 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_backtrace.c: remove debug flag introduced accidentally.
-
-Tue Jul 7 12:05:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (cont_free): remove mysterious fflush()
- introduced at r19890, maybe accidentally.
-
-Tue Jul 7 11:45:14 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_method_call): because data->me should be non-NULL,
- do not check data->me
-
- * proc.c (method_inspect): ditto.
-
-Tue Jul 7 11:37:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_iseq_t::orig because rb_iseq_clone()
- no longer exists.
-
- * iseq.c: don't use rb_iseq_t::orig.
-
-Tue Jul 07 11:25:57 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c, internal.h (rb_iseq_clone): removed because we don't need to
- clone iseq any more.
-
- * class.c (clone_method): share iseq between cloned methods. All of
- method dependent information are able to refer from method entry.
-
-Tue Jul 7 04:42:25 2015 Eric Wong <e@80x24.org>
-
- * string.c (Init_String): use rb_str_freeze for String#freeze
- to resize internal buffer
- [ruby-core:69870] [Feature #11330]
-
-Tue Jul 7 04:12:32 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_define_method): remove an unused local variable.
-
-Tue Jul 7 03:57:28 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_iseq_t::defined_method_id because it is not
- needed.
-
- * eval.c (frame_func_id): simplify. rb_callable_method_entry_t
- has enough information.
-
- * eval.c (frame_called_id): ditto.
-
- * iseq.c (prepare_iseq_build): catch up this fix.
-
- * proc.c (rb_mod_define_method): ditto.
-
- * vm.c (vm_define_method): ditto.
-
-Tue Jul 7 03:47:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove a useless declaration.
-
-Tue Jul 7 03:33:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: remove rb_iseq_t::klass to reduce dynamic data.
-
- * internal.h, iseq.c (rb_iseq_klass): remove it because
- rb_iseq_t::klass is removed.
-
- * 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.
-
- * test/ruby/test_method.rb: support super() from Proc.
- Now, [Bug #4881] and [Bug #3136] was solved.
-
- * proc.c (rb_mod_define_method): catch up this change.
-
- * vm.c (vm_define_method): ditto.
-
- * vm_backtrace.c (rb_profile_frames): now, each `frame' objects
- are rb_callable_method_entry_t data or iseq VALUEs.
-
- This fix introduce minor compatibility issue that
- rb_profile_frame_label() always returns
- rb_profile_frame_base_label().
-
- * test/-ext-/debug/test_profile_frames.rb: catch up this change.
-
-Tue Jul 7 01:52:14 2015 Koichi Sasada <ko1@atdot.net>
-
- * cont.c (fiber_init): initialize control frame correctly.
- This fix does not affect any ordinal execution, but
- affects debug prints.
-
-Mon Jul 6 17:59:05 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_search_super_method): do not skip calling
- same methods in super.
- [Bug #3351]
-
- * test/ruby/test_super.rb: fix a test.
-
-Mon Jul 6 17:59:11 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/tk/tcltklib.c: removed deprecated safe level.
-
-Mon Jul 6 17:16:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h, proc.c (rb_method_entry_location): make it static
- and remove prefix `rb_' because it is used only in proc.c.
-
-Mon Jul 6 16:42:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/lib/memory_status.rb: removed redundant path.
-
-Mon Jul 6 01:18:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit/parallel.rb: make @@project_dir one level
- upper as this file had moved one level deeper.
-
-Sun Jul 5 23:54:10 2015 mizokami <suzunatsu@yahoo.com>
-
- * lib/optparse.rb: [DOC] Fix typo.
-
-Sun Jul 5 18:25:37 2015 Eric Wong <e@80x24.org>
-
- * gc.c (gc_profile_record_get): fix spelling error in keys
-
-Sun Jul 5 14:49:01 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * README.md: fix a typo pointed out by raoulvdberge.
- https://github.com/ruby/ruby/pull/953#commitcomment-11998186
-
-Sun Jul 5 12:56:20 2015 Irvi Firqotul Aini <viarc7@gmail.com>
-
- * README.md: Added link HowToReport bugs.
-
-Sun Jul 5 10:51:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Sun Jul 5 09:31:40 2015 Eric Wong <e@80x24.org>
-
- * test/ruby/test_process.rb: test for fd=3 usability in child
-
-Sat Jul 4 19:43:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * Add test case for empty array and first method with args.
- Patch by @yui-knk [fix GH-955]
-
-Sat Jul 4 19:39:08 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * Add test for `Enumerable#sort` with block. Patch by @yui-knk
- [fix GH-954]
-
-Sat Jul 4 14:38:43 2015 Eric Wong <e@80x24.org>
-
- * enum.c (zip_ary): remove volatile, use RB_GC_GUARD
- (zip_i): ditto
-
-Sat Jul 4 10:42:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Jul 4 09:38:52 2015 Eric Wong <e@80x24.org>
-
- * vm.c (rb_vm_mark): reduce branches for always-set VM fields
- (rb_vm_add_root_module): ditto
-
-Fri Jul 03 20:05:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: introduce rb_callable_method_entry_t to remove
- rb_control_frame_t::klass.
- [Bug #11278], [Bug #11279]
-
- rb_method_entry_t data belong to modules/classes.
- rb_method_entry_t::owner points defined module or class.
-
- module M
- def foo; end
- end
-
- In this case, owner is M.
-
- 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.
-
- 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.
-
- For example, there are classes C and D, and includes M,
-
- class C; include M; end
- class D; include M; end
-
- then, two T_ICLASS objects for C's super class and D's super class
- will be created.
-
- 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.
-
- 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).
-
- Now, created rb_callable_method_entry_t are collected when
- the original module M was modified. We can think it is a cache.
-
- We need to select what kind of method entry data is needed.
- To operate definition, then you need to use rb_method_entry_t.
-
- You can access them by the following functions.
-
- * 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);
-
- 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.
-
- * 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);
-
- 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.
-
- * method.h: renamed from rb_method_entry_t::klass to
- rb_method_entry_t::owner.
-
- * internal.h: add rb_classext_struct::callable_m_tbl to cache
- rb_callable_method_entry_t data.
-
- We need to consider about this field again because it is only
- active for T_ICLASS.
-
- * class.c (method_entry_i): ditto.
-
- * class.c (rb_define_attr): rb_method_entry() does not takes
- defined_class_ptr.
-
- * gc.c (mark_method_entry): mark RCLASS_CALLABLE_M_TBL() for T_ICLASS.
-
- * cont.c (fiber_init): rb_control_frame_t::klass is removed.
-
- * proc.c: fix `struct METHOD' data structure because
- rb_callable_method_t has all information.
-
- * vm_core.h: remove several fields.
- * rb_control_frame_t::klass.
- * rb_block_t::klass.
-
- And catch up changes.
-
- * eval.c: catch up changes.
-
- * gc.c: ditto.
-
- * insns.def: ditto.
-
- * vm.c: ditto.
-
- * vm_args.c: ditto.
-
- * vm_backtrace.c: ditto.
-
- * vm_dump.c: ditto.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
- * vm_method.c: ditto.
-
-Fri Jul 3 14:30:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/file.c: some mingw compilers need a tweek for the
- declarations of _wfreopen_s. [Bug #11320]
-
-Fri Jul 3 12:25:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (rb_econv_set_replacement): target encoding name can
- be empty now. [ruby-core:69841] [Bug #11324]
-
-Fri Jul 3 07:21:06 2015 Eric Wong <e@80x24.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]
-
-Fri Jul 3 07:13:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (replace_real_basename): Win32 API does not set errno, get
- the last error by GetLastError() and map to errno. [Bug #10015]
-
-Thu Jul 2 21:32:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (replace_real_basename): show warnings at errors.
- [Bug #10015]
-
-Thu Jul 2 18:39:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: remove `#define RGENGC_OBJ_INFO 1' line introduced to
- debug Bug #11244.
-
-Thu Jul 2 18:34:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_raw_obj_info): separated from rb_obj_info().
- Fill internal object information into passed buffer.
-
- * gc.h: declare rb_raw_obj_info().
-
-Thu Jul 2 16:15:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (replace_real_basename): update path type by the target
- attributes if possible, to improve the performance. [Bug #10015]
-
-Thu Jul 2 14:45:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Thu Jul 2 14:15:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems.rb (Gem.load_path_insert_index): search
- @gem_prelude_index first.
-
- * lib/rubygems/test_case.rb (Gem::TestCase#setup): keep already
- expanded paths to preserve instance variables.
-
-Thu Jul 2 14:12:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): also copy initial load path marks at
- setting load paths encoding.
-
-Thu Jul 2 12:26:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/rubygems/test_gem_server.rb (process_based_port): use
- dynamically chosen port numbers to get rid of conflicts.
-
-Thu Jul 2 11:58:59 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/rubygems/test_gem_specification.rb: skip tests which the
- platform does not permit the filename of its test file.
-
-Thu Jul 2 11:36:20 2015 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.
-
-Thu Jul 2 10:43:36 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Thu Jul 2 10:30:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems/resolver.rb: fixed NameError of Gem::Util::NULL_DEVICE.
-
-Thu Jul 2 09:51:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems/resolver.rb: fix error of null device reference with DOSISH
- platform.
-
-Thu Jul 2 06:49:44 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems: Update to RubyGems HEAD(c202db2).
- this version contains many enhancements see http://git.io/vtNwF
- * test/rubygems: ditto.
-
-Wed Jul 1 23:50:34 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/net/http/test_httpresponse.rb
- (HTTPResponseTest#test_read_body_content_encoding_deflate_uppercase):
- fix a failure without zlib.
-
-Wed Jul 1 10:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
-
-Wed Jul 1 09:30:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Jul 1 09:28:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (struct_member_pos): revert r51080 to fix other
- implicit conversions but cast the return value to fix the
- previous implicit conversion.
-
-Wed Jul 1 08:47:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * struct.c (struct_member_pos): avoid implicit conversion loses
- integer precision: 'long' to 'int'.
-
-Wed Jul 1 05:57:03 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Wed Jul 1 05:43:58 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Tue Jun 30 23:12:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_reopen): FilePathValue() ensures the path
- NUL-terminated and frozen, so it is unnecessary to make it shared.
-
-Tue Jun 30 23:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (check_dirname): ensure path name NUL-terminated for
- SHARABLE_MIDDLE_SUBSTRING.
-
- * io.c (rb_sysopen): ditto.
-
-Tue Jun 30 18:38:16 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/file.c (rb_freopen): need to terminate by NUL.
-
-Tue Jun 30 17:28:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_reopen): freopen(3) with OS encoding path.
- [ruby-core:69780] [Bug #11320]
-
- * win32/file.c (rb_freopen): wrapper of wchar version freopen(3).
- use _wfreopen_s() if available.
-
-Tue Jun 30 08:24:08 2015 Eric Wong <e@80x24.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]
-
-Tue Jun 30 02:47:02 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Mon Jun 29 17:38:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (defineclass): do not quote unprintable characters at
- raising an exception.
-
-Mon Jun 29 16:01:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http/response.rb (inflater): CONTENT_ENCODING can be upper
- case. [ruby-core:69670] [Bug #11285] patched by Andy Chu
-
-Mon Jun 29 14:50:08 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * eval.c (add_activated_refinement): should not include the original
- class.
-
-Mon Jun 29 12:09:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * README.md: tweak styles. [fix GH-945][ci skip] Patch by @bryndyment
-
-Mon Jun 29 07:23:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Mon Jun 29 02:10:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (defineclass): preserve encoding of name in error
- messages for super class mismatch.
-
- * insns.def (defineclass): preserve encoding of name in error
- messages for non-class super.
-
- * insns.def (defineclass): preserve encoding of name in error
- messages when already defined but type mismatch.
-
-Sun Jun 28 12:07:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (rb_define_class_id_under): raise TypeError exception
- same as ruby level class definition when superclass mismatch.
-
-Sun Jun 14 19:02:03 2015 Benoit Daloze <eregontp@gmail.com>
-
- * lib/net/ftp.rb (makeport): close the TCPServer
- when sending the port fails.
-
- * test/net/ftp/test_ftp.rb: test for above.
-
-Fri Jun 26 12:48:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (load_transcoder_entry): fix transcoder loading race
- condition, by waiting in require. [ruby-dev:49106] [Bug #11277]
-
-Fri Jun 26 07:53:56 2015 Eric Wong <e@80x24.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
-
-Thu Jun 25 21:24:28 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/-ext-/popen_deadlock/test_popen_deadlock.rb: test [Bug #11265]
-
- * ext/-test-/popen_deadlock/infinite_loop_dlsym.c: new ext to call
- dlsym(3) infinitely without GVL, used in the above test.
-
- * 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).
-
-Thu Jun 25 19:24:25 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Thu Jun 25 18:25:41 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
- * test/lib/memory_status.rb (Memory::NO_MEMORY_LEAK_ENVS): ditto.
-
-Thu Jun 25 17:32:33 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_method_entry_create): need to call
- method_definition_reset() if def is given.
-
- Actually, `me' is a new object, so we don't need to call it.
- It is just to make sure.
-
- * vm_method.c (method_definition_reset): remove duplicated insertion.
-
- * vm_method.c (rb_method_entry_clone): assign dst->def here,
- not in method_definition_reset().
-
-Thu Jun 25 16:44:54 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c: make a rb_method_definition_t data (def) *after* making
- a rb_method_entry_t data (me).
-
- 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'.
-
- I hope this patch solve #11244.
-
- * vm_method.c: remove `rb_' prefix from some static functions.
-
- * method.h (rb_method_entry_create): constify
-
- * gc.c (mark_method_entry): add checking `def' and
- `def->body.iseq.iseqptr' availability because they can be NULL.
-
-Thu Jun 25 14:14:16 2015 takiy33 <takiy33@gmail.com>
-
- * test/test_prime.rb (test_eratosthenes_works_fine_after_timeout):
- use spaces instead of TABs in ruby codes. [Fix GH-944]
-
-Thu Jun 25 07:08:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info, method_type_name): show method type name in a string
- instead of a number.
-
-Thu Jun 25 06:49:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): show more details for T_IMEMO/imemo_ment.
-
-Thu Jun 25 06:40:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_method_definition_reset): need a WB for
- VM_METHOD_TYPE_ATTRSET.
-
-Thu Jun 25 03:33:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (RGENGC_OBJ_INFO, obj_info): add a macro to enable/disable
- rich obj_info() output.
-
- At the default, the value of RGENGC_OBJ_INFO is
- (RGENGC_DEBUG | RGENGC_CHECK_MODE).
-
- * gc.c (RGENGC_OBJ_INFO): force enable it to debug #11244.
-
- * gc.c (gc_mark_ptr): print more details with obj_info().
-
- * gc.c (gc_mark_children): remove useless debug prints.
-
-Thu Jun 25 02:40:33 2015 Eric Wong <e@80x24.org>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal):
- do not process kwargs in blocking mode
- * test/openssl/test_ssl.rb: test sysread
-
-Wed Jun 24 16:54:11 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_children): add additional debug code for #11244.
-
-Wed Jun 24 16:05:42 2015 Eric Wong <e@80x24.org>
-
- * string.c (rb_str_justify): use RB_GC_GUARD
-
-Wed Jun 24 14:25:17 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_ptr): add a check code for #11244.
-
- It should be removed later. But we can remain this check
- because it is only a branch.
-
-Wed Jun 24 12:49:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_fstring_cstr): new function to make a fstring from
- a string literal.
-
- * internal.h (rb_fstring_lit): new macro to make a fstring from a
- string literal.
-
- * include/ruby/intern.h (rb_strlen_lit): new macro to get the
- length of a string literal, borrowed from mruby/mruby@e4afd53.
-
-Wed Jun 24 12:21:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * re.c: Update documentation for Regexp class.
- [fix GH-937][ci skip] Patch by @davydovanton
-
-Wed Jun 24 09:23:03 2015 Eric Wong <e@80x24.org>
-
- * variable.c (generic_ivar_set): remove FL_ABLE check
- (gen_ivar_copy): ditto
- [ruby-core:69715]
-
-Wed Jun 24 08:28:15 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): reduce stack use
- [ruby-core:69595] [Feature #11263]
-
-Tue Jun 23 14:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_receiver): raise ArgumentError if no receiver
- is available on this exception object. [Feature #10881]
-
-Tue Jun 23 09:48:34 2015 Eric Wong <e@80x24.org>
-
- * dir.c (check_dirname): avoid volatile, use return value
- (dir_s_chroot, dir_s_mkdir, dir_s_rmdir): adjust callers
-
-Tue Jun 23 06:37:10 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Tue Jun 23 04:58:06 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Mon Jun 22 18:08:48 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * test/lib/test/unit.rb (Test::Unit::Parallel#start_watchdog): removed
- because it has been meaningless since r36385. [Bug #11288]
-
- * test/lib/test/unit.rb (Test::Unit::Parallel#_run_parallel): delete
- lines related to the removed start_watchdog method
-
-Sun Jun 21 23:52:46 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention about Array#bsearch_index and Hash#fetch_values.
-
-Sun Jun 21 23:46:27 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: add a reference to a ticket.
-
-Sun Jun 21 20:28:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (roomof): extract from type_roomof, and move from
- bignum.c.
-
-Sun Jun 21 18:32:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby_atomic.h (ATOMIC_PTR_CAS): define by generic CAS macro, not
- via size_t, to suppress a warning by mingw gcc.
-
-Sun Jun 21 05:31:41 2015 Shota Fukumori <her@sorah.jp>
-
- * 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]
-
- * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix.
-
-
-Sat Jun 20 03:56:58 2015 Yusuke Endoh <mame@ruby-lang.org>
-
- * enc/make_encmake.rb: the list of encoding extension libraries must
- not include encinit.c itself. It caused "undefined reference to
- Init_encinit".
-
-Sat Jun 20 02:03:53 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * 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.
-
- * 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 Jun 20 01:10:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention about $SAFE.
-
-Fri Jun 19 14:53:35 2015 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]
-
-Fri Jun 19 13:54:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (rb_mod_define_method): get rid of inadvertent ID
- creations at error.
-
-Fri Jun 19 07:58:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: if no with-ext option is given, default to
- enable everything. [ruby-dev:49108] [Bug #11280]
-
-Fri Jun 19 06:30:07 2015 Koichi Sasada <ko1@atdot.net>
-
- * bootstraptest/test_method.rb: remove a test because $SAFE=2 was
- obsolete.
-
- Please check btest, too.
-
-Thu Jun 18 23:51:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * bin/erb: $SAFE=3 is obsolete.
-
-Thu Jun 18 23:45:11 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * safe.c: removed needless doc related $SAFE=2
-
-Thu Jun 18 23:38:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * thread.c (rb_thread_safe_level): fix document. $SAFE=3 is obsolete.
- [ci skip]
-
-Thu Jun 18 23:25:51 2015 Nobuyoshi Nakada <nobu@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]
-
-Thu Jun 18 23:20:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * include/ruby/ruby.h: $SAFE=2 is now obsolete.
-
- * 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
-
- * test/erb/test_erb.rb, test/fiddle/test_handle.rb
- test/ruby/test_env.rb: removed tests for $SAFE=2.
-
-Thu Jun 18 22:50:07 2015 Yusuke Endoh <mame@ruby-lang.org>
-
- * enc/make_encmake.rb: added --transes and --no-transes options.
-
-Thu Jun 18 18:24:12 2015 Eric Wong <e@80x24.org>
-
- * test/socket/test_unix.rb: replace sleep with select
-
-Thu Jun 18 17:59:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (rb_vm_control_frame_id_and_class): remove useless codes.
- `me' knows ID and owner class.
-
-Thu Jun 18 16:58:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: constify rb_method_alias_struct::original_me and
- rb_method_refined_struct::orig_me.
-
- * class.c (move_refined_method): use RB_OBJ_WRITE() for
- me->def->body.refined.orig_me.
-
-Thu Jun 18 14:35:28 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.
-
-Thu Jun 18 13:32:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_receiver): add NameError#receiver method.
- [Feature #10881]
-
-Thu Jun 18 10:00:06 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * safe.c: removed needless doc related $SAFE=3
-
-Thu Jun 18 09:59:23 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * safe.c: rename old method name for $SAFE=3
-
-Thu Jun 18 06:02:42 2015 Eric Wong <e@80x24.org>
-
- * compile.c (get_exception_sym2type, iseq_build_from_ary_body):
- rely on %+PRIsVALUE instead of calling rb_inspect directly
-
-Wed Jun 17 20:59:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (ENC_MK): needs fake.rb if cross compilation.
- [ruby-dev:49098] [Bug #11272]
-
-Wed Jun 17 20:23:29 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/rbconfig/sizeof/extconf.rb: Check __float80.
-
-Wed Jun 17 15:15:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * safe.c (safe_setter): of course, don't have to warn the limitation of
- $SAFE=3 after it's removed.
-
-Wed Jun 17 14:29:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * include/ruby/ruby.h: $SAFE=3 is now obsolete.
-
- * 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
-
- * 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
-
-Wed Jun 17 12:13:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: added contributor name.
-
-Wed Jun 17 10:57:28 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/csv.rb: accept to use Range object for row selection.
- contributed by Mitsutaka Mimura.
- [Feature #11267][ruby-dev:49091]
-
-Wed Jun 17 09:50:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/servlet.rb (documentation_search, root_search):
- requires json for JSON.dump and fix sporadic failures due to
- the loading order.
-
-Tue Jun 16 19:19:53 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/rbconfig/sizeof/extconf.rb: Check several types defined in C99
- and x86_64 ABI.
-
- * template/sizes.c.tmpl: Relax a pattern for types.
-
-Tue Jun 16 17:37:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/objspace/test_objspace.rb: relax pattern because uncollectible
- flag and marked flag can be false at major GC.
- [Bug #10852]
-
-Tue Jun 16 04:50:44 2015 Eric Wong <e@80x24.org>
-
- * 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 Jun 16 04:38:02 2015 Eric Wong <e@80x24.org>
-
- * 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 Jun 15 14:33:02 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb: Make Set#each and SortedSet#each generate a sized
- enumerator. [GH-931] by kachick (Kenichi Kamiya)
-
- * test/test_set.rb: Import tests from Set into SortedSet. [GH-931]
- by kachick (Kenichi Kamiya)
-
-Mon Jun 15 02:26:34 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP#connect): use connect_nonblock and
- io/wait to eliminate timeout use. fix GH-899
-
-Sat Jun 13 07:21:18 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
-
- * 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]
-
- * test/-ext-/gvl/test_last_thread.rb: new test for the above fix.
-
- * 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.
-
-Mon Jun 15 00:14:33 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/pathname/lib/pathname.rb (descend): Blockless form supported.
- (ascend): Ditto.
- [ruby-core:68820] [Feature #11052] Patch by Piotr Szotkowski.
-
-Sun Jun 14 20:09:25 2015 Tanaka Akira <akr@fsij.org>
-
- * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
- formats.
- [ruby-core:68306] [Misc #10905] Patch by Charles Korn.
-
-Sun Jun 14 18:49:56 2015 Tanaka Akira <akr@fsij.org>
-
- * 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].
-
-Sun Jun 14 17:26:03 2015 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_chunk_while): New method Enumerable#chunk_while.
- [ruby-core:67738] [Feature #10769] proposed by Tsuyoshi Sawada.
-
-Sun Jun 14 17:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_load_ok): try opening file without gvl not to
- lock entire process. [Bug #11060]
-
-Sun Jun 14 10:43:50 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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`.
-
-Sun Jun 14 10:13:55 2015 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rexml/source.rb (REXML::IOSource#scan): Fix a typo in
- document. [fix GH-934]
- Patch by Anton Davydov. Thanks!!!
-
-Sun Jun 14 10:09:48 2015 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rexml/attlistdecl.rb (REXML::AttlistDecl): Fix a typo in
- document. [fix GH-934]
- Patch by Anton Davydov. Thanks!!!
-
-Sun Jun 14 06:24:57 2015 Benoit Daloze <eregontp@gmail.com>
-
- * test/ruby/test_io.rb: add test for IO.binread fd leak.
- See r50881.
-
-Sun Jun 14 05:23:51 2015 Benoit Daloze <eregontp@gmail.com>
-
- * io.c (rb_io_s_binread): close fd if seek offset is invalid.
-
-Sun Jun 14 04:40:32 2015 Benoit Daloze <eregontp@gmail.com>
-
- * test/lib/leakchecker.rb (check): refactor.
-
-Sun Jun 14 04:34:14 2015 Benoit Daloze <eregontp@gmail.com>
-
- * test/lib/leakchecker.rb: Return false for no leaks.
- Otherwise the GC could run for nothing.
-
-Sun Jun 14 04:15:40 2015 Benoit Daloze <eregontp@gmail.com>
-
- * lib/delegate.rb: [DOC] Update SimpleDelegator example. [ci skip]
-
-Sat Jun 13 20:28:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * file.c (rb_stat_ino): get inode from the interval of struct st.
-
- * win32/win32.c (stati64_set_inode): get nFileIndexHigh/Low, and set it
- to the interval of struct st as inode.
- [Feature #11216]
-
- * win32/win32.c (stati64_set_inode_handle): call stati64_set_inode.
-
- * win32/win32.c (rb_w32_fstati64): call stati64_set_inode_handle.
-
- * win32/win32.c (stati64_handle): call stati64_set_inode.
-
-Sat Jun 13 19:44:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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).
-
-Sat Jun 13 17:35:11 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_core.h (rb_thread_t): add th->name.
-
- * vm.c (th_init): initialize th->name.
-
- * thread.c (Init_Thread): add Thread.name and name=. [Feature #11251]
-
- * thread.c (rb_thread_inspect): show thread's name if set.
-
- * thread.c (rb_thread_getname): defined.
-
- * thread.c (rb_thread_setname): ditto.
-
-Sat Jun 13 11:39:43 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/tempfile.rb: Fix typo. [fix GH-933] Patch by @Zorbash
-
-Sat Jun 13 11:38:00 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/openssl/ossl_ocsp.c: fix documentation on ocsp response cert status.
- [fix GH-932] Patch by @chrisholmes
-
-Sat Jun 13 11:35:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.gemspec: Fix require paths for released gem.
- [fix GH-929] Patch by @voxik
- * ext/io/console/io-console.gemspec: ditto.
-
-Sat Jun 13 00:45:08 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Return sized enumerators.
- Patch by Kenichi Kamiya [GH-931]
-
-Sat Jun 13 00:45:06 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Fix with_object with no block given
-
-Sat Jun 13 00:44:59 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Have with_index accept an offset parameter.
- Based on patch by T Yamada. [#11007]
-
-Fri Jun 12 22:21:12 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/test_extlibs.rb (TestExtLibs::check_existence): fix
- error. [Bug #11255] [ruby-dev:49079]
-
-Fri Jun 12 21:17:46 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * pack.c (pack_{un,}pack): new template character `j` and `J`, pointer
- with signed and unsigned integers.
-
- * NEWS: mention about this feature.
- [Feature #11215] [ruby-dev:49015]
-
-Fri Jun 12 21:01:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * file.c (File::SHARE_DELETE): new flag to be able to delete opened file
- on Windows.
-
- * include/win32/win32.c (O_SHARE_DELETE): new pseudo file mode flag.
-
- * win32/win32.c (rb_w32_{w,}open): support above flag. [EXPERIMENTAL]
-
- * NEWS: mention about this feature.
- [Feature #11218] [ruby-dev:49022]
-
-Fri Jun 12 18:21:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: added missing commit message.
-
-Fri Jun 12 18:20:37 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * sample/exyacc.rb: Fix some typos. [fix GH-927] Patch by @davydovanton
- * sample/list.rb: ditto.
- * sample/trick2013/kinaba/remarks.markdown: ditto.
-
-Fri Jun 12 17:34:14 2015 Wojciech Mach <wojtek@wojtekmach.pl>
-
- * hash.c (rb_hash_fetch_values): add `Hash#fetch_values`.
- [Feature #10017] [Fix GH-776]
-
-Fri Jun 12 16:28:17 2015 Radan Skoric <radan.skoric@gmail.com>
-
- * array.c (rb_ary_bsearch_index): Implement Array#bsearch_index
- method, which is similar to bsearch and returns the index or
- nil. [Feature #10730]
-
-Thu Jun 11 19:11:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/zlib/zlib.c: Fix indentation for rdoc.
- [Bug #11221][ruby-core:69465]
-
-Thu Jun 11 16:23:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h (METHOD_ENTRY_BASIC_SET): fix last commit (unbalanced parens).
-
-Thu Jun 11 15:14:16 2015 NARUSE, Yui <naruse@ruby-lang.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.
-
- * thread_pthread.c (SET_THREAD_NAME): don't define if they don't exist.
-
- * thread_pthread.c (native_set_thread_name): run if SET_THREAD_NAME
- is defined.
-
-Thu Jun 11 15:53:31 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h (METHOD_ENTRY_BASIC_SET): should clear last bit.
-
-Thu Jun 11 14:34:45 2015 SHIBATA Hiroshi <hsbt@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
-
-Thu Jun 11 14:18:51 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb: bump version to 2.4.6. It's missing change at r49774.
-
-Thu Jun 11 13:50:19 2015 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]
-
- * array.c (ary_ensure_room_for_unshift, rb_ary_splice): ditto.
-
-Thu Jun 11 13:17:34 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/test_cmath.rb (TestCMath#test_trigonometric_functions): should
- not compare float values (in complex values) by `==`.
-
-Thu Jun 11 08:52:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: embed rb_method_entry_t::attr::flags (5 bits) into
- rb_method_entry_t::flags to make one word spare space.
-
- Add some macros to access these flags.
-
- * vm_method.c: use these macros.
-
- * internal.h: define IMEMO_FL_USHIFT and IMEMO_FL_USER[0-4]
- for T_IMEMO local flags.
-
-Thu Jun 11 08:27:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c: use VM_ASSERT instead of assert().
-
- * vm_args.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
- * vm_method.c: ditto.
-
-Thu Jun 11 08:16:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: define VM_ASSERT() for assertion
- enabled only when (VM_CHECK_MODE > 0).
-
- * vm_insnhelper.c: move definition VM_CHECK_MODE
- from vm_insnhelper.c to vm_core.h.
-
- * vm.c: remove <assert.h>
-
-Thu Jun 11 06:46:07 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (check_frame): check type of cref_or_me first.
-
-Thu Jun 11 04:34:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * test/test_cmath.rb: Add some assertions.
-
-Thu Jun 11 00:34:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/fake.rb.in: expanded macro result may have spaces
- between tokens. [ruby-dev:49047] [Bug #11243]
-
-Wed Jun 10 22:27:32 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * lib/mkmf.rb: revert r50804 because of build failure when specifying
- LDFLAGS during configure, observed on Solaris with GCC 4.6.
- [Bug #11245]
-
-Wed Jun 10 21:59:51 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * README.ja.md: fix markup miss.
-
-Wed Jun 10 11:06:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * template/fake.rb.in: turn into erb template from autoconf
- template to fake more accurately.
-
- * common.mk (fake.rb): needs preprocessed file now.
-
- * version.c (Init_version): add dummy expression to
- RUBY_ENGINE_VERSION.
-
-Tue Jun 9 12:31:25 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Simplify and optimize EratosthenesSieve
-
-Tue Jun 9 11:45:00 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Simplify and optimize EratosthenesSieve
- based on patch by Ajay Kumar. [Fixes GH-921]
-
-Mon Jun 8 05:09:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): print method id for T_IMEMO/ment.
-
-Sun Jun 7 07:05:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * Move test cases from test/ruby/test_complex.rb to test/test_cmath.rb
-
-Sat Jun 6 18:23:41 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: back to share rb_method_definition_t by
- rb_method_entry_t.
-
- 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.
-
- * method.h: move rb_method_definition_t::flags to
- rb_method_entry_t::attr::flags.
-
- 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).
-
- And also add the following access macros to it's fields.
-
- * METHOD_ENTRY_VISI(me)
- * METHOD_ENTRY_BASIC(me)
- * METHOD_ENTRY_SAFE(me)
-
- * vm_method.c (rb_method_definition_addref): added instead of
- rb_method_definition_clone().
-
- Do not create new definition, but increment alias_count.
-
- * class.c (clone_method): catch up this fix.
-
- * class.c (method_entry_i): ditto.
-
- * proc.c (mnew_internal): ditto.
-
- * proc.c (mnew_missing): ditto.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
- * vm_method.c: ditto.
-
-Sat Jun 6 15:59:38 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c: ins_methods_push() needs rb_method_visibility_t type on
- 2nd arg.
-
-Sat Jun 6 15:05:47 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (ins_methods_push): Change type and name of parameters
- to make more clear.
-
-Sat Jun 6 08:52:13 2015 Eric Wong <e@80x24.org>
-
- * test/socket/test_nonblock.rb: try to avoid EMSGSIZE
- [ruby-core:69466]
-
-Sat Jun 6 07:58:30 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: remove struct mark_tbl_arg and pass objspace directly
- to avoid indirect access overhead.
-
-Sat Jun 6 07:08:45 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
-
-Sat Jun 6 01:00:06 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Fri Jun 5 22:37:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (ins_methods_push): change 3rd parameter's type
- from long to rb_method_visibility_t.
-
- * class.c (ins_methods_i): catch up this fix.
-
- * class.c (method_entry_i): cast to st_data_t instead of `long'.
-
-Fri Jun 5 20:37:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: move definition of rb_cref_t to method.h.
-
- * eval_intern.h: move definition of rb_scope_visibility_t
- to method.h.
-
- * method.h: change rb_cref_t::scope_visi from VALUE to
- rb_scope_visibility_t.
- [Bug #11219]
-
- * vm.c (vm_cref_new): accept rb_method_visibility_t directly.
-
- * vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0,
- but METHOD_VISI_UNDEF.
-
- * vm_method.c (rb_scope_visibility_set): don't need to use cast.
-
- * vm_method.c (rb_scope_module_func_set): ditto.
-
-Fri Jun 5 17:27:30 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): avoid msg_control
- ptr if msg_controllen is zero to fix portability problems.
-
-Fri Jun 5 09:17:45 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): fix build error
- from r50776
-
-Fri Jun 5 07:05:58 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Fri Jun 5 06:43:00 2015 Eric Wong <e@80x24.org>
-
- * doc/extension.rdoc: note rb_get_kwargs changes keywords_hash
- [ruby-core:68507]
-
-Fri Jun 5 05:50:29 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_scan_args
- [ruby-core:69439] [Feature #11207]
-
-Fri Jun 5 02:20:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
-Fri Jun 5 01:17:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_defined): no need to use cast.
-
-Fri Jun 5 01:14:02 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_defined): show additional messages on rb_bug().
-
-Fri Jun 5 01:06:02 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_add_method_iseq): use intermediate struct to
- avoid initializing struct with variables.
- [Bug #11217]
-
- * method.h: add a comment about it.
-
-Fri Jun 5 00:55:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: constify rb_method_refined_t::orig_me.
-
- Also constify the following functions.
-
- * rb_resolve_refined_method()
- * rb_method_entry_with_refinements()
- * rb_method_entry_without_refinements()
- * rb_method_entry_copy()'s parameter.
-
- * class.c: catch up this fix.
-
- * vm_insnhelper.c: ditto.
-
- * vm_method.c: ditto.
-
-Thu Jun 4 12:47:54 SGT 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * array.c: Revert r50763. because "reentered" is not typo.
-
-Thu Jun 4 11:12:29 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton
- [fix GH-923]
- * include/ruby/st.h: ditto.
- * include/ruby/util.h: ditto.
-
-Thu Jun 4 10:54:30 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * array.c: fix a typo. Patch by @manish-shrivastava
- [fix GH-922]
-
-Thu Jun 4 09:52:02 2015 Eric Wong <e@80x24.org>
-
- * ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntl
- [ruby-core:69382] [Feature #11190]
-
-Thu Jun 4 07:22:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: introduce rb_method_refined_t for refined method entry.
-
- * class.c (move_refined_method): catch up this fix.
-
- * gc.c (mark_method_entry): ditto.
-
- * vm_eval.c (vm_call0_body): ditto.
-
- * vm_insnhelper.c (vm_call_method): ditto.
-
- * vm_method.c: ditto.
-
-Thu Jun 4 07:12:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Jun 4 05:44:01 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Thu Jun 4 05:13:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (def_iseq_ptr): `iseqval' is not available any more.
-
-Thu Jun 4 04:50:12 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (method_entry_i): mtbl should not have `me' as NULL.
-
-Thu Jun 4 04:28:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (clone_method): do not use me->klass, but use explicitly
- passed argument.
-
-Thu Jun 4 04:10:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
-
- * class.c (clone_method): use renamed name.
-
- * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable
- names.
-
-Wed Jun 3 23:03:50 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c: rename `rb_frame_...' to `rb_scope_...'.
-
- * eval_intern.h: move decl. of rb_scope_visibility_set() to method.h.
-
- * load.c: catch up this fix.
-
-Wed Jun 3 21:14:20 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types.
-
-Wed Jun 3 21:00:47 2015 Tanaka Akira <akr@fsij.org>
-
- * configure.in: Don't check __int128.
-
- * ext/rbconfig/sizeof/extconf.rb: Check __int128.
-
- * ext/rbconfig/sizeof/depend: sizes.c depends on
- ext/rbconfig/sizeof/extconf.rb.
-
- * template/sizes.c.tmpl: Detect check_sizeof.
-
-Wed Jun 3 20:07:07 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (clone_method): remove redundant check for me->def != NULL.
- Now, all `me` have `me->def`.
-
- * proc.c (rb_method_entry_location): ditto.
-
- * vm.c (rb_vm_check_redefinition_opt_method): ditto.
-
- * vm.c (add_opt_method): ditto.
-
- * vm_eval.c (vm_call0_body): ditto.
-
-Wed Jun 3 19:24:12 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: rename enum missing_reason to enum method_missing_reason.
-
- * vm_core.h: use enum method_missing_reason for
- rb_thread_t::method_missing_reason.
-
- * vm_eval.c: catch up this fix.
-
- * vm_insnhelper.c: ditto.
-
-Wed Jun 3 16:17:21 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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
-
- * load.c: remove various NULL checks
-
-Wed Jun 3 11:47:15 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: change fields order to gather frequent access fields.
-
- * vm_insnhelper.c (vm_call_method): add LIKELY().
-
-Wed Jun 03 10:35:45 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: split rb_method_definition_t::flag to several flags.
-
- `flag' contains several categories of attributes and it makes us
- confusion (at least, I had confused).
-
- * 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)
-
- Now, NOEX_NOREDEF is not supported (I'm not sure it is needed).
-
- 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.
-
- * vm_core.h: introduce `enum missing_reason' to represent
- method_missing (NoMethodError) reason.
-
- * eval_intern.h: introduce rb_scope_visibility_t to represent
- scope visibility.
- It has 3 method visibilities (public/private/protected)
- and `module_function`.
-
-Wed Jun 3 08:06:30 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gem/bundled_gems: updated to test-unit 3.1.1 and minitest 5.7.0.
-
-Wed Jun 3 04:48:05 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_defined): check respond_to_missing?
- at defined?(func()).
- [Bug #11212]
-
- * test/ruby/test_defined.rb: add a test for this fix.
-
-Wed Jun 3 04:34:39 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (vm_defined): skip respond_to_missing? when
- a method is available.
- [Bug #11211]
-
- * test/ruby/test_defined.rb: add a test for this fix.
-
-Wed Jun 3 04:14:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * insns.def (defined), vm_insnhelper.c (vm_defined):
- move instruction body to the vm_defined() function.
-
-Wed Jun 3 02:29:25 2015 Benoit Daloze <eregontp@gmail.com>
-
- * test/ruby/test_module.rb: Do not assume class variable order.
- Patch by @enebo.
-
-Wed Jun 3 01:10:38 2015 Yusuke Endoh <mame@tsg.ne.jp>
-
- * vm_method.c (rb_method_definition_set): remove a double assignment.
- Coverity Scan found this bug.
-
-Wed Jun 3 00:04:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_alias): rename parameter names.
-
-Tue Jun 2 23:27:18 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: remove rb_method_iseq_t::iseqval.
- While making a r50728, iseqval is needed (to mark correctly),
- but now just iseqptr is enough.
-
- * class.c: catch up this fix.
-
- * gc.c: ditto.
-
- * proc.c: ditto.
-
- * vm_method.c: ditto.
-
-Tue Jun 2 21:29:28 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (proc_curry): remove a debug line.
-
-Tue Jun 2 12:43:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: make rb_method_entry_t a VALUE.
- Motivation and new data structure are described in [Bug #11203].
-
- This patch also solve the following issues.
-
- * [Bug #11200] Memory leak of method entries
- * [Bug #11046] __callee__ returns incorrect method name in orphan
- proc
-
- * test/ruby/test_method.rb: add a test for [Bug #11046].
-
- * vm_core.h: remove rb_control_frame_t::me. me is located at value
- stack.
-
- * vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
- because method entries are simple VALUEs.
-
- * method.h: Now, all method entries has own independent method
- definitions. Strictly speaking, this change is not essential,
- but for future changes.
-
- * 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.
-
- * vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
- search the current method entry from value stack.
-
- * vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
- assertions.
-
-Tue Jun 2 10:46:36 2015 Eric Wong <e@80x24.org>
-
- * test/socket/test_nonblock.rb: new test for sendmsg_nonblock
-
-Tue Jun 2 09:04:14 2015 Eric Wong <e@80x24.org>
-
- * lib/benchmark.rb: just use Process::CLOCK_MONOTONIC
- [ruby-core:69390]
-
-Mon Jun 1 22:01:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Jun 1 21:18:24 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_children): remove a garbage character
- introduced at the last commit.
-
-Mon Jun 1 19:24:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_method_entry_make): do not show warning message
- when method_entry is an alias.
-
-Mon Jun 1 15:47:16 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: move class related definitions.
-
-Mon Jun 1 15:43:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c: remove needless include pragma for method.h.
-
- * struct.c: ditto.
-
- * vm_method.c: ditto.
-
-Mon Jun 1 05:42:00 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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).
-
- * load.c (load_ext): use it.
-
-Mon Jun 1 04:47:37 2015 Zachary Scott <e@zzak.io>
-
- * ext/date/date_core.c: [DOC] Add comparison of Time and DateTime
- Patch provided by @pixeltrix
-
-Mon Jun 1 04:22:09 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (VM_FRAME_MAGIC_DUMMY): introduce new frame type to
- recognize dummy frame.
-
- * vm.c (th_init): use new frame type.
-
- * vm_args.c (raise_argument_error): ditto.
-
-Mon Jun 1 04:15:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (rb_class_has_methods): added to reduce dependency
- to internal class data structure.
-
- * internal.h: ditto.
-
- * hash.c (has_extra_methods): use added function.
-
-Mon Jun 1 04:11:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c , gc.h (rb_obj_info): export obj_info(VALUE) for debugging.
-
-Mon Jun 1 03:52:55 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_gc.rb: increase timeout seconds for GC stressful
- debugging.
-
-Sun May 31 04:18:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: fix typo of comments.
-
-Sun May 31 03:36:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: add VM_METHOD_TYPE_ALIAS rb_method_definition_t::type
- to fix [Bug #11173].
-
- Now, inter class/method alias creates new method entry
- VM_METHOD_TYPE_ALIAS, which has an original method entry.
-
- * vm_insnhelper.c (find_defined_class_by_owner): added.
- Search corresponding defined_class from owner class/module.
-
- * vm_method.c (rb_method_entry_get_without_cache): return me->klass
- directly for defined_class.
-
- Now, no need to check me->klass any more.
-
- * vm_method.c (method_entry_set0): separated from method_entry_set().
-
- * vm_method.c (rb_alias): make method entry has VM_METHOD_TYPE_ALIAS.
-
- * vm_method.c (release_method_definition): support VM_METHOD_TYPE_ALIAS.
-
- * vm_method.c (rb_hash_method_definition): ditto.
-
- * vm_method.c (rb_method_definition_eq): ditto.
-
- * vm_method.c (release_method_definition): ditto.
-
- * vm_insnhelper.c (vm_call_method): ditto.
-
- * vm_insnhelper.c (vm_method_cfunc_entry): ditto.
-
- * vm_eval.c (vm_call0_body): ditto.
-
- * gc.c (mark_method_entry): ditto.
-
- * proc.c (method_def_iseq): ditto.
-
- * proc.c (method_cref): ditto.
-
- * proc.c (rb_method_entry_min_max_arity): ditto.
-
- * test/ruby/test_alias.rb: add tests.
-
- * test/ruby/test_module.rb: fix a test to catch up current behavior.
-
-Sun May 31 03:34:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (rb_unlink_method_entry): make it static.
-
-Sun May 31 03:26:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h, vm_method.c (rb_free_method_entry): constify a parameter.
-
- * vm_core.h: remove useless declaration about rb_unlink_method_entry().
-
-Sat May 30 18:05:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/tempfile.rb (Remover#call): fixed wrong condition. introduced at
- r50682.
-
-Sat May 30 16:12:35 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
- [ruby-core:69419] [Feature #11198]
-
-Sat May 30 15:59:10 2015 NAKAMURA Usaku <usa@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.
-
-Sat May 30 11:02:55 2015 Martin Englund <martin@englund.nu>
-
- * doc/dtrace_probes.rdoc: change lingering dtrace probe documentation
- from function- to method-
-
-Sat May 30 10:26:09 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * 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
-
-Sat May 30 09:02:51 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sat May 30 09:14:28 2015 Scott Francis <scott.francis@shopify.com>
-
- * cont.c (cont_free): check if ruby_current_thread is still valid.
- [Fix GH-914]
-
-Sat May 30 08:36:04 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sat May 30 08:10:46 2015 Eric Wong <e@80x24.org>
-
- * 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)
-
-Fri May 29 17:39:14 2015 Koichi Sasada <ko1@atdot.net>
-
- * tool/make_hgraph.rb: added.
-
-Fri May 29 14:39:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): out of range NTH_REF is always
- nil.
-
- * parse.y (parse_numvar): check overflow of NTH_REF and range.
- [ruby-core:69393] [Bug #11192]
-
- * util.c (ruby_scan_digits): make public and add length parameter.
-
-Fri May 29 11:18:58 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Fri May 29 10:30:34 2015 Eric Wong <e@80x24.org>
-
- * lib/net/resolv.rb (request): use monotonic clock
- * lib/net/http.rb (begin_transport, end_transport): ditto
- [ruby-core:69384] [Feature #11124]
-
-Fri May 29 04:37:38 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c: add two methods to debug internals.
-
- * ObjectSpace.internal_class_of: return RBASIC_CLASS(obj).
- * ObjectSpace.internal_super_of: return RCLASS_SUPER(cls).
-
- * NEWS: add information about both methods.
-
- * test/objspace/test_objspace.rb: add tests for both methods.
-
-Thu May 28 06:55:53 2015 Anton Davydov <antondavydov.o@gmail.com>
-
- * ext/tk/sample/figmemo_sample.rb (open_file),
- ext/tk/sample/tktextio.rb (TkTextIO): fix typo in messages.
- [Fix GH-916]
-
-Wed May 27 09:50:51 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed May 27 09:27:30 2015 Eric Wong <e@80x24.org>
-
- * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call
- * lib/drb/unix.rb (set_sockopt): ditto
- [ruby-core:69128] [Feature #11137]
-
-Tue May 26 22:10:43 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_method.c (rb_alias): should resolve refined methods.
- [ruby-core:69360] [Bug #11182]
-
-Tue May 26 21:35:13 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): fix condition.
-
-Mon May 25 22:35:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (rel): after the relations is changed,
- @changesets is no longer right.
-
-Mon May 25 11:27:14 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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>
-
- * numeric.c (Numeric#negative?): [DOC] Fix call-seq.
- Patch by @yui-knk. [Fixes GH-908]
-
-Sun May 24 01:35:22 2015 Koichi Sasada <ko1@atdot.net>
-
- * debug.c (ruby_debug_print_id): use rb_id2name() for fprintf().
-
-Sat May 23 18:38:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * man/*.1: updated dates in man pages.
- [ruby-dev:48988] [Bug #11171]
-
-Sat May 23 03:10:58 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write_console): should return the count of
- actually eaten characters, include escape sequences.
-
-Fri May 22 22:36:14 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Remove obsolete Prime.new
- patch by Ajay Kumar. [Fixes GH-891]
-
-Fri May 22 21:13:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Fri May 22 20:56:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * complex.c (f_complex_polar): simple bug reproduced only when y is
- a float but x is not a float.
-
-Fri May 22 19:42:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_spawn_process): do not discard global escape
- status. [ruby-core:69304] [Bug #11166]
-
- * process.c (rb_execarg_spawn): extract the start procedure in a
- parent process with ensuring the end procedure.
-
-Fri May 22 16:48:32 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: added news for net-telnet and rake
-
-Thu May 21 20:27:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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.
-
-Thu May 21 18:00:19 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c: constify.
-
- * iseq.h: ditto.
-
- * method.h: ditto.
-
- * proc.c: ditto.
-
- * vm_method.c: ditto.
-
-Thu May 21 17:44:53 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: fix issues caused by binding created from Method#to_proc.
- [Bug #11163]
-
- * vm.c (vm_cref_new_toplevel): export as rb_vm_cref_new_toplevel().
-
- * test/ruby/test_method.rb: add some assertions.
-
-Thu May 21 17:29:26 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/matrix.rb: added documentation for Matrix#empty and Matrix#/
- [Feature #10070][ruby-dev:48433] Patch by @gogotanaka
-
-Thu May 21 17:02:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: rename functions.
- * method_get_def() -> method_def()
- * method_get_iseq() -> method_def_iseq()
- * method_get_cref() -> method_cref()
-
-Thu May 21 16:52:44 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (rb_method_get_iseq): rename to rb_method_iseq.
-
- * iseq.c: catch up this fix.
-
- * iseq.h: commit ditto.
-
-Thu May 21 15:41:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/telnet.rb: gemify net-telnet.
- [Feature #11083]
- * gems/bundled_gems: added net-telnet to bundled gems.
-
-Thu May 21 15:37:32 2015 Zachary Scott <e@zzak.io>
-
- * vm_method.c: Remove private attribute warning [Bug #10967]
- Patch by @spastorino [Fixes GH-849]
- https://github.com/ruby/ruby/pull/849
-
- * test/ruby/test_module.rb: Update test for changes
-
-Thu May 21 10:59:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (method_proc): rename to method_to_proc.
-
-Thu May 21 10:51:54 2015 Jake Worth <jakeworth82@gmail.com>
-
- * io.c (rb_f_select): [DOC] Fixes for grammar and style.
- [Fix GH-906]
-
-Thu May 21 08:25:19 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Thu May 21 04:11:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (exception_type2symbol): show correct bug message.
-
-Wed May 20 23:19:05 2015 Yusuke Endoh <mame@ruby-lang.org>
-
- * lib/base64.rb: Fix rdoc-formatting for padding argument.
- [fix GH-905][ci skip] Patch by @davydovanton
-
-Wed May 20 13:16:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (DEPRECATED_BY): deprecate warning with preferable
- alternative.
-
- * configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in
- the macro.
-
-Wed May 20 11:23:24 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_dump.c (rb_print_backtrace): return value of libexec's backtrace
- is size_t, so simply cast as int.
-
-Tue May 19 18:54:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_compile_with_option): check source type, must be
- an IO or a String. [ruby-core:69219] [Bug #11159]
-
-Tue May 19 17:15:03 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/benchmark.rb: Update Benchmark documentation and formatting.
- [fix GH-903][ci skip] Patch by @davydovanton
-
-Tue May 19 13:10:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_positive_p): should false on Bignum 0.
- http://twitter.com/rafaelfranca/status/600509783427391488
- [ruby-core:69173] [Feature #11151]
-
-Tue May 19 11:22:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
-Tue May 19 11:18:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_data_typed_object_alloc),
- (rb_data_object_alloc): add old names for source level backward
- compatibilities.
-
- * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add
- aliases for binary level backward compatibilities.
-
-Tue May 19 09:54:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
- casts to fix function overloading in C++.
-
-Tue May 19 09:43:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):
- explicit cast from void* is necessary as implicit cast is
- disallowed in C++.
-
-Mon May 18 15:31:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Mon May 18 13:55:01 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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
-
-Sun May 17 17:21:29 2015 Eric Wong <e@80x24.org>
-
- * lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
- * (set_close_on_exec): use IO#close_on_exec=
- [Feature #11136]
-
-Sun May 17 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_positive_p, num_negative_p): add methods
- Numeric#positive? and Numeric#negative?.
- [ruby-core:69173] [Feature #11151]
-
- * numeric.c (flo_positive_p, flo_negative_p): specialized
- functions for Float.
-
- * complex.c (Init_Complex): Complex do not have positive? and
- negative? methods
-
-Sun May 17 14:57:42 2015 Eric Wong <e@80x24.org>
-
- * lib/webrick/server.rb (accept_client): avoid redundant fcntl call
- [Feature #11137]
-
-Sun May 17 12:13:33 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sun May 17 03:58:59 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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]
-
- * test/ruby/test_autoload.rb: test for fix
-
-Sat May 16 21:41:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * string.c: added documentation for character sequence \' with String#sub
- [Bug #11132][ruby-core:69121][fix GH-900][ci skip] Patch by @shishir127
-
-Sat May 16 21:38:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * enum.c: fix a sample code. Patch by @eagletmt
- [fix GH-901][ci skip]
-
-Sat May 16 21:17:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Sat May 16 19:59:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_accept): simplified.
-
-Fri May 15 18:28:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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>.
-
-Fri May 15 08:24:28 2015 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
-
- * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.
- [fix GH-887] Patch by @martinpovolny
-
-Fri May 15 06:54:19 2015 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * 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]
-
- * test/ruby/test_autoload.rb: Test for change.
-
-Wed Apr 8 19:18:02 2015 Shota Fukumori (sora_h) <her@sorah.jp>
-
- * enum.c (enum_grep_v, grep_i, grep_iter_i, Init_enum):
- Implement Enumerable#grep_v. [Feature #11049]
-
-Thu May 14 15:54:13 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/pathname/lib/pathname.rb: Remove condition of RUBY_VERSION <= 1.9.
- [Feature #11082]
-
-Wed May 13 17:10:37 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * enum.c (enum_to_a): revert r50457.
- it requires recursion check.
- then, it doesn't make performance improvement.
- [Bug #11130] [Feature #9118]
-
-Wed May 13 11:13:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parse_gvar): separate message for gvar without
- non-space characters from message for invalid identifiers.
-
-Tue May 12 22:18:27 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * enum.c (enum_to_a): fix incompatibility introduced in r50457.
- [Bug #11130]
-
- * test/ruby/test_enum.rb: test for above.
-
-Tue May 12 17:08:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * method.h: remove unused declaration.
-
-Mon May 11 10:58:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: Update minitest-5.6.1 and power_assert-0.2.3.
-
-Mon May 11 00:20:31 2015 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.
-
-Sun May 10 21:32:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_mark_children): call dmark function for non-NULL
- pointers only, so that DATA_PTR can be NULL safely now.
-
-Sun May 10 16:23:58 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * proc.c (proc_binding): fix segmentation fault on marking phase.
- envptr of newenvval should not be NULL.
-
- You can reproduce by
- make test-all TESTS='--gc-stress -n test_to_proc_binding ruby/test_method.rb'
-
-Sun May 10 12:41:18 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * ext/zlib/zlib.c (rb_gzreader_external_encoding):
- define GzipReader#external_encoding.
- [Bug #10900]
-
- * test/zlib/test_zlib.rb: test for above.
-
-Sun May 10 11:57:48 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * ext/win32ole/win32ole_variant.c: fix typo "indicies".
- the patch is from davydovanton <antondavydov.o at gmail.com>.
- [fix GH-892]
-
- * lib/rubygems/indexer.rb: ditto.
-
- * test/rubygems/test_gem_indexer.rb: ditto.
-
-Sun May 10 11:44:37 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * 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]
-
- * test/ruby/test_string.rb: test for above.
-
-Sun May 10 11:23:03 2015 Masaki Matsushita <glass.saga@gmail.com>
-
- * 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]
-
-Sat May 9 06:48:36 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
- [Bug #11123]
-
-Fri May 8 22:57:24 2015 takiy33 <takiy33@gmail.com>
-
- * 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]
-
-Fri May 8 15:43:11 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
- is omitted. [ruby-core:69093] [Bug #11128]
-
-Fri May 8 15:05:57 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/syntax/control_expressions.rdoc: fix a missing "a"
- [fix GH-888][ci skip] Patch by @riffraff
-
-Fri May 8 12:11:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_method_call_status): resolve refined method entry
- to check if undefined. [ruby-core:69064] [Bug #11117]
-
-Thu May 7 22:22:59 2015 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
-
-Thu May 7 11:32:57 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * Makefile.in (rbconfig.rb): add rule to make.
-
-Thu May 7 05:14:39 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed May 6 22:49:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_method_call_status): undefined refined method is
- not callable unless using. [ruby-core:69064] [Bug #11117]
-
-Sun May 3 22:40:06 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * ext/-test-/file/fs.c: need to include sys/statvfs.h
- to use statvfs().
-
- * ext/-test-/file/extconf.rb: check the existence of
- sys/statvfs.h
-
-Sun May 3 21:59:48 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/yaml.rb: fix typo. [ci skip][fix GH-890]
- Patch by @miketheman
-
-Sun May 3 10:02:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (linear_object_p, range_include): test if covered for
- linear objects. [ruby-core:69052] [Bug #11113]
-
-Fri May 1 13:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Thu Apr 30 19:51:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Apr 30 17:02:33 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * rational.c: Added documentation for rational literal.
- [Bug #11075][fix GH-885][ci skip] Patch by @shishir127
-
-Thu Apr 30 16:39:44 2015 Nobuyoshi Nakada <nobu@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]
-
-Thu Apr 30 16:22:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (lambda): push and reset cmdarg_stack in lambda body.
- [ruby-core:69017] [Bug #11107]
-
-Sun Apr 26 07:36:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/utf_8.c (code_to_mbclen, code_to_mbc): reject values larger
- than UTF-8 max codepoints. [Feature #11094]
-
-Sat Apr 25 14:26:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_buf_cat): expand later so that the buffer can be
- larger for further use. [Bug #11080] [Bug #11095]
-
-Fri Apr 24 23:48:45 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import version 2.2.3 from
- https://github.com/knu/ruby-electric.el.
-
-Fri Apr 24 10:40:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_{getc,putc}): removed. they are needed for old
- ruby (before 1.8), but not now.
-
-Fri Apr 24 08:40:13 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * win32/win32.c: remove bcc related code.
-
- * include/ruby/win32.h: ditto.
-
-Fri Apr 24 08:21:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * win32/win32.c (rb_acrt_lowio_lock_fh): wrap _pioinfo(i)->lock.
-
- * win32/win32.c (rb_acrt_lowio_unlock_fh): ditto.
-
-Fri Apr 24 06:47:19 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * win32/win32.c (_filbuf): msvc14 doesn't have it, use _fgetc_nolock.
-
- * win32/win32.c (_flsbuf): msvc14 doesn't have it, use _fputc_nolock.
-
- * win32/win32.c (vcruntime_file): define vcruntime_file on msvc14
- because it doesn't export FILE's internal structure.
-
- * win32/win32.c (FILE_COUNT): added to abstract FILE->_cnt.
-
- * win32/win32.c (FILE_READPTR): added to abstract FILE->_ptr.
-
- * win32/win32.c (FILE_FILENO): added to abstract FILE->_file.
-
- * win32/win32.c (init_stdhandle): use FILE_FILENO.
-
- * win32/win32.c (rb_w32_getc): use FILE_COUNT and FILE_READPTR.
-
- * win32/win32.c (rb_w32_putc): ditto.
-
-Fri Apr 24 06:37:07 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * win32/win32.c (dupfd): use _set_osfhnd.
-
- * win32/win32.c (rb_w32_wopen): use _set_osflags.
-
-Thu Apr 24 05:38:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark_roots): fox to work PRINT_ROOT_TICKS.
-
-Fri Apr 24 04:49:05 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * win32/Makefile.sub: MSVC14 have struct timespec.
-
- * win32/rtname.cmd: support vcruntime140.dll.
-
- * time.c (localtime_with_gmtoff_zone): MSVC14 doesn't have tzname and
- daylight but have _tzname and _daylight.
-
-Thu Apr 23 11:35:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Apr 23 10:01:36 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/delegate.rb: fix a typo.
- [fix GH-881][ci skip] Patch by @Zorbash
-
-Wed Apr 22 18:36:50 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/imap.rb (move, uid_move): support the MOVE command defined
- in RFC6851. Patch by ojab ojab.
- [ruby-core:68960] [Feature #11077]
-
-Tue Apr 22 12:42:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * 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 21 20:46:02 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_object.rb: renamed tests to explicitly class name.
- [fix GH-877] Patch by @yui-knk
-
-Tue Apr 21 05:31:00 2015 Eric Wong <e@80x24.org>
-
- * ext/socket/lib/socket.rb (connect_internal): avoid common exceptions
- from connect_nonblock. [ruby-core:68909]
-
-Mon Apr 20 23:46:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_wreadlink): follow the official format of
- REPARSE_DATA_BUFFER structure.
-
-Mon Apr 20 20:23:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk ($(arch)-fake.rb): revert r50354 because bsdmake seems not
- to handle such substitution.
-
- * tool/expand-config.rb: convert path separators here.
-
-Mon Apr 20 16:52:20 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/fake.rb: don't fake libdir. use libdirname instead.
-
-Mon Apr 20 16:49:52 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/mkmf.rb (MakeMakefile#configuration): DESTDIR should never affect
- top_srcdir and builddir.
-
-Mon Apr 20 16:18:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk ($(arch)-fake.rb): fix the path separator up for Windows.
-
-Mon Apr 20 15:02:47 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_wreadlink): fixed a bug that a junction misses
- its drive letter.
-
-Mon Apr 20 12:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/openssl/*: use license instead of licence.
- [fix GH-876][ci skip] Patch by @davydovanton
- * lib/net/https.rb: ditto.
-
-Mon Apr 20 12:42:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.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.
-
-Mon Apr 20 11:10:46 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Sun Apr 19 12:19:17 2015 Chad Brewbaker <crb002@gmail.com>
-
- * ext/{etc,openssl,tk}: Adding parens and comparisons around
- assignments to get rid of Wparentheses warnings. [Fix GH-875]
-
-Sun Apr 19 10:42:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (get_env_cstr): environment variables must be ASCII
- compatible, as dummy encodings and wide char encodings are
- unsupported now.
-
-Sat Apr 18 15:18:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/json/parser/parser.rl: raise with messages in UTF-8
- encoding. [ruby-core:67386] [Bug #10705]
-
-Fri Apr 17 11:58:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (STR_SET_EMBED): clear NOFREE flag at embedding as
- embedded strings no longer refer static strings.
- [ruby-core:68436] [Bug #10942]
-
-Thu Apr 16 05:15:50 2015 Eric Wong <e@80x24.org>
-
- * NEWS: note IO#wait_readable change in r50263
-
-Thu Apr 16 05:09:36 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed Apr 15 18:43:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (rb_tracepoint_new): fix documentation.
- Commented by @emilsoman.
-
-Wed Apr 15 17:36:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_trace.c (rb_tracepoint_new): Add documentation for
- rb_tracepoint_new C level API [ci skip]
- Provided by @emilsoman. [fix GH-869]
-
-Wed Apr 15 10:37:40 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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.
-
-Wed Apr 15 07:51:23 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
-
- * doc/extension.ja.rdoc: Added description of TypedData_XXX.
- Deprecated the old DATA_XXX.
- Reviewed by ko1 and nobu.
- Fixes [ruby-dev:40881] #3064
-
- * doc/extension.rdoc: ditto.
-
-Wed Apr 15 07:34:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (reserve_stack): keep sp safe zone to get rid
- of crash by -fstack-check. [ruby-core:68740] [Bug #11030]
-
-Tue Apr 14 16:03:49 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/merger.rb (versionup): should also increment revision when
- changing teeny.
-
-Tue Apr 14 11:24:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of
- conflict on cygwin. [ruby-core:68877] [Bug #11065]
-
-Tue Apr 14 08:59:04 2015 Zachary Scott <e@zzak.io>
-
- * 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]
-
-Mon Apr 13 22:44:07 2015 Tanaka Akira <akr@fsij.org>
-
- * test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.
-
- * test/ruby/test_io.rb: Use File.mkfifo.
-
- * test/ruby/test_file_exhaustive.rb: Ditto.
-
- * test/ruby/test_process.rb: Ditto.
-
-Mon Apr 13 21:20:20 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * 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.
-
-Sun Apr 12 18:40:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/json/json.gemspec: bump version to 1.8.2.
- * ext/json/lib/json/version.rb: ditto.
-
-Sun Apr 12 18:12:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sun Apr 12 17:35:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/json/*, test/json/*: Reverted r50231. Because it's not
- working with cross-compile environment.
-
-Sun Apr 12 15:34:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (arg): fix segfault by null caused by syntax error.
- [ruby-core:68851] [Bug #10957]
-
-Sun Apr 12 15:11:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sun Apr 12 15:10:18 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/wait/wait.c (io_wait_readable): simply returns that IO is
- readable without blocking, but no longer returns EOF.
-
- * 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]
-
-Sun Apr 12 14:53:23 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rubygems/test_case.rb: fixed json load error for rubygems tests.
-
-Sun Apr 12 14:13:28 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * gc.c: Document require name for ObjectSpace methods.
- [ci skip][fix GH-860] Patch by @schneems
-
-Sun Apr 12 13:54:05 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_io.rb: New test that open(fifo) doesn't block other
- threads.
-
-Sun Apr 12 13:52:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/coverage/coverage.c: Remove extension from require argument.
- [ci skip][fix GH-870] Patch by @yui-knk
-
-Sun Apr 12 10:29:14 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Sun Apr 12 09:57:16 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test a block device on GNU/Linux.
-
-Sun Apr 12 09:24:03 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test a file not owned.
-
-Sun Apr 12 09:05:44 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/fiddle/depend: Fix "Wrong mix of special targets" error with
- OpenBSD make.
-
-Sun Apr 12 09:04:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_file_exhaustive.rb: Windows doesn't support Unix file
- modes.
-
-Sun Apr 12 08:56:44 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/-test-/file/fs.c: OpenBSD needs sys/param.h before sys/mount.h.
-
-Sun Apr 12 08:52:01 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test suid, sgid and sticky file.
-
-Sat Apr 11 23:48:30 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * template/fake.rb.in: Don't assign baseruby, Because it's affect to
- Makefile of native gem like json on bundled gems.
-
-Sat Apr 11 23:33:22 2015 Tanaka Akira <akr@fsij.org>
-
- * file.c (rb_f_test): Consider nsec for "=", "<" and ">" for "test"
- method.
-
-Sat Apr 11 23:26:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/rbinstall.rb: support destdir for native extension gem.
-
-Sat Apr 11 21:02:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_file_exhaustive.rb
- (TestFileExhaustive#test_stat_socket_p): r50226 accidentally missed
- the guard for non-unix environments.
-
-Sat Apr 11 20:14:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Apr 11 15:56:58 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Create sample files lazily.
-
-Sat Apr 11 14:03:47 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test character device using
- /dev/null.
-
-Sat Apr 11 10:59:58 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (append_cppflags, append_cflags, append_ldflags):
- utility methods to append compiler options.
-
-Sat Apr 11 08:22:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rdoc/text.rb: removed duplicated code.
-
-Sat Apr 11 04:46:42 2015 Eric Wong <e@80x24.org>
-
- * lib/net/protocol.rb (rbuf_fill): avoid exception with read_nonblock
- [ruby-core:68787] [Feature #11044]
-
-Fri Apr 10 23:57:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (need_normalization): use getattrlist() if fgetattrlist()
- is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054]
-
-Fri Apr 10 22:29:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (try_compile): pass the given werror flag to try_do
- to check if stderr is empty.
-
- * lib/mkmf.rb (try_cflags, try_ldflags): default werror to true.
-
- * win32/Makefile.sub (WERRORFLAG): remove useless option. VC does
- not make warnings of unknown command option an error.
-
-Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test socket.
-
-Fri Apr 10 19:38:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/objspace/test_objspace.rb: remove debug prints.
-
-Fri Apr 10 19:35:51 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c: add ObjectSpace.count_imemo_objects method
- to count imemo objects for each type.
-
- * test/objspace/test_objspace.rb: add a test.
-
- * NEWS: describe about this addition.
-
-Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test anonymous pipe.
-
-Fri Apr 10 19:31:56 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_file_exhaustive.rb: Test named pipe.
-
-Fri Apr 10 19:10:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * ext/objspace/objspace.c (setup_hash): unify common routine.
-
-Fri Apr 10 18:29:49 2015 Tanaka Akira <akr@fsij.org>
-
- * process.c (rb_execarg_parent_start1): Handle EINTR.
-
-Fri Apr 10 17:27:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (vm_exec): check other events when RETURN is thrown.
- [Bug #10724]
-
- * test/ruby/test_settracefunc.rb: add a test.
-
-Fri Apr 10 11:44:09 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/date/extconf.rb: check warnings.
-
- * lib/mkmf.rb (try_cflags): pass options to try_compile.
-
- * win32/Makefile.sub (WERRORFLAG): make unknown command line
- options an error.
-
-Fri Apr 10 08:00:17 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_process.rb: unfortunately, windows is not POSIX...
- cygwin has mkfifo command, but it does not affect system-wide.
-
-Fri Apr 10 02:18:53 2015 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_process.rb: Use mkfifo command instead of mknod
- command to create a named pipe. mkfifo command is defined by POSIX.
-
-Fri Apr 10 01:29:05 2015 Tanaka Akira <akr@fsij.org>
-
- * 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.
-
-Thu Apr 9 22:19:19 2015 Tanaka Akira <akr@fsij.org>
-
- * process.c (redirect_open): Removed.
-
-Thu Apr 9 21:38:20 2015 Tanaka Akira <akr@fsij.org>
-
- * internal.h (rb_execarg_parent_end): Declared.
-
- * 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.
-
- * io.c (pipe_open): Call rb_execarg_parent_end.
-
- * ext/pty/pty.c (establishShell): Call rb_execarg_parent_end.
-
-Thu Apr 9 20:52:31 2015 Tanaka Akira <akr@fsij.org>
-
- * internal.h (rb_execarg_parent_start): Renamed from rb_execarg_fixup.
-
- * process.c: Follows the above change.
-
- * io.c: Ditto.
-
- * ext/pty/pty.c: Ditto.
-
-Thu Apr 9 20:35:12 2015 Tanaka Akira <akr@fsij.org>
-
- * process.c (fd_clear_cloexec): Extracted from run_exec_dup2.
-
-Thu Apr 9 09:26:47 2015 Eric Wong <e@80x24.org>
-
- * ccan/list/list.h: sync with ccan upstream
- [ccan commit c2fbfe5282ba264f3485586e7efa8a5967f2d386]
-
-Thu Apr 9 08:24:03 2015 Masahiro Tomita <tommy@tmtm.org>
-
- * ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of
- addrinfo. [ruby-dev:48923] [Bug #11051]
-
-Wed Apr 8 17:45:02 2015 Shannon Skipper <shannonskipper@gmail.com>
-
- * version.c (Init_version): the version of the engine or
- interpreter. [Fix GH-858]
-
-Wed Apr 8 16:15:30 2015 Kenta Murata <mrkn@cookpad.com>
-
- * bigdecimal: conform to ruby's license. [ruby-core:68466] [Bug #10952]
-
-Wed Apr 8 14:57:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_wreadlink): should treat junctions like as
- symlinks.
-
-Wed Apr 8 14:03:47 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_symbol.rb: fix syntax error.
-
-Wed Apr 8 13:01:06 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_any_hash): Symbols are compared by the identities
- always. [ruby-core:68767] [Bug #11035]
-
-Tue Apr 7 10:22:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * internal.h: fix typo. Patch by @sferik [fix GH-865]
-
-Mon Apr 6 22:52:35 2015 Tanaka Akira <akr@fsij.org>
-
- * enum.c: Enumerable#chunk and Enumerable#slice_before no longer takes
- the initial_state argument. [Feature #10958]
-
-Mon Apr 6 16:09:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_args.c: protect value stack from calling other methods
- during complex parameter setting process (splat, kw, and so on).
- [Bug #11027]
-
- * vm_core.h: remove rb_thread_t::mark_stack_len.
- With this modification, we don't need to use th->mark_stack_len.
-
- * test/ruby/test_keyword.rb: add a test.
-
- * cont.c (cont_capture): catch up this fix.
-
- * vm.c (rb_thread_mark): ditto.
-
-Mon Apr 6 11:26:42 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/downloader.rb (http_options): prevent content auto decoding
- because this is a downloader.
-
-Sun Apr 5 09:55:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * doc/contributing.rdoc: update Maintainers list.
-
-Sun Apr 5 09:11:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/rbinstall.rb: fix bin script permission of bundled gems.
-
-Sun Apr 5 08:46:08 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/rbinstall.rb: support --program-suffix option.
-
-Sat Apr 4 21:31:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
- * test/rake/*: ditto.
- * tool/rbinstall.rb: ditto.
-
-Sat Apr 4 11:30:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.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.
-
-Sat Apr 4 08:16:43 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http.rb (edit_path): use path which is absolute ftp url
- on using ftp_proxy.
-
-Fri Apr 3 11:43:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (vm_call0_cfunc): update invoker arguments.
-
- * vm_insnhelper.c (vm_call_cfunc_latter): ditto.
-
- * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix
- with rb_.
-
-Thu Apr 2 16:26:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
- * configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
- valid version numbers, not an arbitrary string.
-
-Wed Apr 1 11:09:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (push_glob): remove indirect links of arguments for
- trampoline.
-
-Wed Apr 1 09:59:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Mon Mar 30 22:02:55 2015 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * README.EXT.ja: add redirect [ruby-core:68631]
-
-Mon Mar 30 14:42:41 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (fileattr_to_unixmode, winnt_lstat): deal with
- symbolic link than directory, and set executable bits.
-
-Mon Mar 30 11:27:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sun Mar 29 21:08:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * gc.c (objspace_allrefs_destruct_i): fix a typo.
- [Bug #11013]
-
-Sun Mar 29 11:51:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Mar 28 09:19:41 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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.
-
-Fri Mar 27 16:34:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk: revert using BOOTSTRAPRUBY for enc.mk, as
- enc/depend uses CONFIG. [ruby-core:68647] [Bug #11004]
-
-Thu Mar 26 10:05:13 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * test/test_observer.rb: add tests for Observable module.
- [fix GH-859] Patch by @brightbits
-
-Thu Mar 26 06:35:10 2015 Eric Wong <e@80x24.org>
-
- * README.EXT: add redirect [ruby-core:68631]
-
-Wed Mar 25 16:46:49 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/socket/extconf.rb: Solaris 11 has struct tcp_info.tcpi_ca_state,
- but it is a dummy.
-
- * ext/socket/option.c: Solaris 11 doesn't have u_intN_t.
-
- * ext/socket/option.c: Solaris 11 needs inspect_tcpi_msec.
-
- * ext/socket/raddrinfo.c: Solaris 11 has AF_PACKET but doesn't have
- related macros.
-
-Wed Mar 25 17:03:08 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/file/fs.c (get_fsname): try magic number only if
- f_type is included. [ruby-dev:48913] [Bug #11000]
-
-Wed Mar 25 11:20:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * benchmark/bm_hash_aref_flo.rb: make more realistic data.
- [ruby-core:68632] [[Bug #10999]
-
-Wed Mar 25 10:39:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * .document: removed needless entries.
-
-Wed Mar 25 08:07:28 2015 Eric Wong <e@80x24.org>
-
- * doc/extension.rdoc: fix spelling of filename
- * doc/extension.ja.rdoc: ditto.
-
-Tue Mar 25 06:55:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
- to remove k_inexact_p macro.
-
- * complex.c (k_exact_one_p): remove unused macro k_exact_one_p.
-
-Tue Mar 24 22:23:33 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/extension.rdoc: move from toplevel document and added extname.
- * doc/extension.ja.rdoc: ditto.
-
-Tue Mar 24 22:06:58 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/standard_library.rdoc: strip.
-
-Tue Mar 24 22:06:27 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/standard_library.rdoc: move Thread to Extensions.
-
-Tue Mar 24 21:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/contributing.rdoc: update Maintainers list.
-
-Tue Mar 24 19:10:24 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_writebarrier_generational): fix messages for rb_bug().
- Remove `rb_' prefix.
-
- * gc.c (gc_writebarrier_incremental): ditto.
-
-Tue Mar 24 17:34:01 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * README.ja.md: should be chunibyo.
-
-Tue Mar 24 17:30:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/file/fs.c (get_fsname): return filesystem name by
- statfs/statvfs. [ruby-core:68624] [Bug #10998]
-
-Tue Mar 24 16:46:02 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: now doesn't required spaces just after
- `!`.
-
-Mon Mar 23 23:18:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_close): don't raise on double close for consistent to
- IO#close. [Feature #10950]
-
-Mon Mar 23 21:22:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/file.c (rb_readlink): move from file.c for better buffer
- allocation and the result encoding.
-
- * win32/win32.c (wreadlink, rb_w32_ureadlink): implement readlink().
-
-Mon Mar 23 14:40:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (winnt_stat): stat with following symbolic links.
-
- * win32/win32.c (winnt_lstat): rename old winnt_stat, which does
- not follow symbolic links.
-
-Mon Mar 23 01:44:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (r_symreal): register symbol names as strings first so
- that r_symlink always returns valid names.
- [ruby-core:68587] [Bug #10991]
-
- * marshal.c (r_ivar, r_object0): now need to intern symbol names.
-
- * marshal.c (r_object0): compare with symbol names.
-
-Sun Mar 22 22:07:40 2015 Kouhei Sutou <kou@cozmixng.org>
-
- * doc/etc.rd.ja: Fix wrong coding for Emacs.
-
-Sun Mar 22 09:53:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): add default CONFIGURE name to
- follow r50039.
-
- * 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.
-
-Sun Mar 22 08:09:47 2015 Nobuyoshi Nakada <nobu@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.
-
-Sat Mar 21 15:01:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/console/console.c (console_set_winsize): use handle for
- writing. GetConsoleScreenBufferInfo seems failing on a handle
- for reading.
-
- * 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]
-
-Fri Mar 20 18:41:03 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (respond_to_missing_p): check if the receiver responds to
- the given method by respond_to_missing?.
-
- * proc.c (mnew_missing): create Method object for method_missing.
- [ruby-core:68564] [Bug #10985]
-
-Fri Mar 20 17:43:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * .travis.yml: enabled email notification.
-
-Fri Mar 20 17:39:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * .travis.yml: removed Ruby 1.9.3 build on Travis CI
-
-Fri Mar 20 12:38:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): obj_info() can receive internal objects.
-
- * gc.c (check_rvalue_consistency): obj_info() returns const char *.
-
-Fri Mar 20 12:14:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): show class name and T_DATA type_name.
-
-Thu Mar 19 22:12:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_copy_wb_protected_attribute): `dest' can be WB unprotected.
-
-Thu Mar 19 21:25:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_copy_wb_protected_attribute): demote `dest' object.
-
-Thu Mar 19 16:18:00 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c, internal.h: export rb_gc_verify_internal_consistency().
-
-Thu Mar 19 16:15:24 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): show allocation site if GC_DEBUG is not 0.
-
-Thu Mar 19 16:12:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
-Thu Mar 19 16:08:42 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
-
-Thu Mar 19 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (fill_random_bytes): release the handle in the static
- variable, not a local variable.
-
-Thu Mar 19 06:30:35 2015 Koichi Sasada <ko1@atdot.net>
-
- * object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
- rb_obj_alloc() can return old object in debug.
-
-Thu Mar 19 06:29:28 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/objspace/test_objspace.rb: flag name was changed
- (long_lived -> uncollectible).
-
-Thu Mar 19 05:30:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (iseq_mark): skip some marking if iseq->orig is available.
-
- * iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass
- (done in MEMCPY).
-
-Thu Mar 19 04:55:53 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h (IMEMO_DEBUG): added.
-
- * internal.h: remove unused FL_IMEMO_MARK_V[0-3].
-
- * gc.c (rb_imemo_new_debug): added.
-
- * gc.c (obj_info): show imemo type name.
-
-Thu Mar 19 04:52:26 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (RGENGC_OLD_NEWOBJ_CHECK): add check mechanism.
-
- If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects
- (not new objects) periodically.
-
- Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are
- created.
-
-Thu Mar 19 04:46:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * enum.c (enum_sort_by): add WBs.
-
-Thu Mar 19 03:37:52 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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).
-
- * gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit.
-
- remembered_bit should be TRUE only for old (age == 3) objects.
-
- Actually there are no effect because demoted objects will be
- uncollectible WB unprotected objects (marked at the beginning of
- every minor GC).
-
-Thu Mar 19 02:52:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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".
-
- 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
-
- * remembered_wb_unprotected_objects ->
- uncollectible_wb_unprotected_objects:
- because uncollectible objects does not mean remembered objects.
-
-Wed Mar 18 17:21:12 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- 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".
-
- 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.
-
- To compare these behaviour, I add this new code (but disabled it).
-
-Wed Mar 18 17:14:39 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (RVALUE_PROMOTE_RAW): rename to RVALUE_OLD_LONG_LIVED_SET()
- to make clear.
-
-Wed Mar 18 17:10:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (check_rvalue_consistency): do not need to check is_sweeping().
-
-Wed Mar 18 14:13:22 2015 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm1_gc_wb_ary.rb: run GC to finish "marking" phase.
-
- * benchmark/bm_vm1_gc_wb_obj.rb: ditto.
-
- * benchmark/bm_vm1_gc_wb_ary_promoted.rb: add parameter
- full_mark: false to invoke only minor GC.
-
- * benchmark/bm_vm1_gc_wb_obj_promoted.rb: ditto.
-
-Wed Mar 18 12:07:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * string.c: add a comment about RSTRING_FSTR.
-
-Wed Mar 18 12:01:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Mar 18 05:34:32 2015 Koichi Sasada <ko1@atdot.net>
-
- * string.c: introduce STR_FAKESTR to show string is FAKESTR or not.
-
- * string.c (STR_SET_SHARED): ignore FAKESTR because only Ruby objects
- can use write barrier.
-
-Tue Mar 17 18:59:16 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- * gc.c (rb_gc_writebarrier): added.
-
- * 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).
-
- This patch improve the performance of WB on micro-benchmarks.
-
- 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)
-
-Tue Mar 17 18:51:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm1_gc_wb_ary(_promoted).rb: separate fastpath and
- slowpath for WB.
-
- 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.
-
- To compare fastpath and slowpath, introduce new "promoted" version
- benchmark.
-
- bm_vm1_gc_wb_ary.rb is for fastpath and
- bm_vm1_gc_wb_ary_promoted.rb is for slowpath.
-
- * benchmark/bm_vm1_gc_wb_obj(_promoted).rb: ditto.
-
-Tue Mar 17 17:23:11 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Mon Mar 16 17:43:21 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Mar 14 20:05:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * math.c (math_gamma): optimization for passed small integer.
-
-Sat Mar 14 18:07:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * enum.c: [DOC] Fixes Enumerable#member? documentation
- [fix GH-756][ci skip] Patch by @shamanime
-
-Sat Mar 14 12:23:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): use d_type to reduce lstat system calls.
-
- * 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.
-
- * win32/win32.c (readdir_internal): set d_type.
-
-Sat Mar 14 02:14:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (primary): empty parentheses at cmdarg can be null.
- [ruby-core:68477] [Bug #10957]
-
-Fri Mar 13 15:04:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_close): don't raise on double
- close for consistent to IO#close.
-
-Fri Mar 13 15:03:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_close_read, rb_io_close_write): don't raise after
- close same as IO#close.
-
-Fri Mar 13 12:29:07 2015 Tanaka Akira <akr@fsij.org>
-
- * test/readline/test_readline.rb: Restore environment variables:
- COLUMNS LINES
-
-Fri Mar 13 11:37:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Fri Mar 13 07:02:20 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Fri Mar 13 07:01:38 2015 Eric Wong <e@80x24.org>
-
- * ext/openssl/ossl_ssl.c: predefine wait_*able symbols
-
-Thu Mar 12 22:59:53 2015 Tanaka Akira <akr@fsij.org>
-
- * test/lib/leakchecker.rb: Check environment variables.
-
-Thu Mar 12 05:54:27 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Thu Mar 12 10:53:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h, node.h: move a definition of `struct rb_global_entry'
- and related functions from node.h to internal.h.
-
- * variable.c: remove unused include pragma.
-
- * common.mk: remove unused dependency.
-
-Thu Mar 12 10:32:39 2015 Koichi Sasada <ko1@atdot.net>
-
- * common.mk: remove unused dependency.
-
-Thu Mar 12 08:20:14 2015 Koichi Sasada <ko1@atdot.net>
-
- * load.c: removed unused header file "node.h".
-
- * method.h: ditto.
-
- * symbol.c: ditto.
-
-Thu Mar 12 08:14:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: RGENGC_CHECK_MODE should be 0.
-
-Thu Mar 12 07:44:17 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- Rename NEW_MEMO() to MEMO_NEW().
-
- Move MEMO_FOR and NEW_MEMO_FOR macros from node.h.
-
- Export a rb_imemo_new() function for ext/ripper.
-
- * node.h: remove NODE_MEMO.
-
- * enum.c: catch up these change.
-
- * enumerator.c: ditto.
-
- * load.c: ditto.
-
- * ext/objspace/objspace.c (count_nodes): ditto.
-
- * gc.c (gc_mark_children): mark imemo_memo type.
-
- * parse.y (new_args_gen): use T_IMEMO.
- (I'm not sure it is working correctly...)
-
-Wed Mar 11 22:36:34 2015 Koichi Sasada <ko1@atdot.net>
-
- * eval.c (frame_called_id): it should use vm_ifunc type.
-
- * eval.c (frame_func_id): ditto.
-
-Wed Mar 11 22:27:05 2015 Koichi Sasada <ko1@atdot.net>
-
- * node.h: remove NODE_IFUNC, NEW_IFUNC.
-
- * internal.h: use T_IMEMO for IFUNC.
-
- rename `struct IFUNC' to `struct vm_ifunc' and move the definition
- from vm_insnhelper.h. Add imemo_ifunc.
-
- * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object.
-
- * compile.c: catch up these changes.
-
- * proc.c: ditto.
-
- * vm_core.h (RUBY_VM_IFUNC_P): ditto.
-
- * vm_eval.c (rb_iterate): ditto.
-
- * vm_insnhelper.c: ditto.
-
- * ext/objspace/objspace.c: ditto.
-
-Wed Mar 11 21:53:43 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h, eval_intern.h: move CREF accessors.
-
- List IMEMO supported types in internal.h.
-
-Wed Mar 11 21:45:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h: use T_IMEMO to create THROW_DATA.
-
- Add THROW_DATA_NEW().
-
- * internal.h: move definition of `struct THROW_DATA'
- from vm_insnhelper.h to internal.h.
-
- Rename `THROW_DATA' to `vm_throw_data'.
-
- * eval_intern.h (THROW_DATA_P): move to internal.h.
- THROW_DATA is no longer T_NODE, so check T_IMEMO.
-
- * gc.c (gc_mark_children): mark THROW_DATA.
-
- * vm.c: catch up these changes.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
-Wed Mar 11 21:21:56 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c: use T_IMEMO to create SVAR.
-
- * internal.h, vm_insnhelper.h: move definition `struct SVAR'
- from vm_insnhelper.h to internal.h. And rename it to struct vm_svar.
-
- new imemo_type imemo_svar is added.
-
- * gc.c (gc_mark_children): mark imemo_svar.
-
- * node.c (rb_gc_mark_node): remove useless marking.
-
-Wed Mar 11 19:35:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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.
-
- To insert T_IMEMO, type numbers are modified a little.
-
- * internal.h: define struct RIMemo. Each RIMemo objects
- has imemo_type. We can observe it by the imemo_type() function.
-
- * gc.c (rb_imemo_new): added.
-
- * node.h: remove NODE_CREF and NEW_CREF().
-
- * node.c (rb_gc_mark_node): ditto.
-
- * vm.c (vm_cref_new): use rb_imem_new().
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: use RIMemo objects for CREF.
-
- * ext/objspace/objspace.c: support T_IMEMO.
-
-Wed Mar 11 17:03:20 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: fix memory leak by prepend method.
-
- It is easy to reproduce with such script:
-
- module M; def bar; end; end
- loop{
- Class.new do
- def foo; end
- prepend M
- end
- }
-
- * gc.c (obj_free): free T_ICLASS::m_tbl if it is created by prepend.
- To recognize it, check RICLASS_IS_ORIGIN flag.
-
- * gc.c (gc_mark_children): T_ICLASS objects only need to mark
- T_ICLASS::m_tbl if RICLASS_IS_ORIGIN is set.
-
- * gc.c (obj_memsize_of): count T_ICLASS if RICLASS_IS_ORIGIN is set.
-
- * internal.h (RCLASS_SET_ORIGIN): add to set RCLASS_SET_ORIGIN.
-
- TODO: The word `origin' seems not good name. We need to invent
- another good name.
-
- * class.c: use RCLASS_SET_ORIGIN().
-
- * class.c (class_alloc): zero clear rb_classext_t.
-
-Wed Mar 11 13:28:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check also procstat_getvmmap, which is not
- available on FreeBSD 9. [ruby-core:68468] [Bug #10954]
-
- * vm_dump.c (procstat_vm): use kinfo_getvmmap instead if
- procstat_getvmmap is not available.
-
-Wed Mar 11 09:15:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: define struct MEMO.
-
- * enum.c: use MEMO.
-
- * enumerator.c: ditto.
-
- * load.c: ditto.
-
- * node.h: return (struct MEMO *) pointer.
-
-Wed Mar 11 06:26:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h (THROW_DATA_STATE): return int, not VALUE.
-
- * vm_insnhelper.h (THROW_DATA_STATE_SET): accept int value.
-
-Wed Mar 11 05:06:46 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_eval.c (rb_catch_protect): use THROW_DATA_VAL().
-
-Wed Mar 11 04:56:04 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h: define struct IFUNC.
-
- * vm_eval.c (rb_iterate): use it.
-
- * vm_insnhelper.c (vm_yield_with_cfunc): ditto.
-
-Wed Mar 11 03:52:12 2015 Koichi Sasada <ko1@atdot.net>
-
- * eval_intern.h (THROW_DATA_P): use RB_TYPE_P() instead of
- BUILTIN_TYPE().
-
- * thread.c (thread_join): use THROW_DATA_P().
-
-Wed Mar 11 03:48:01 2015 Koichi Sasada <ko1@atdot.net>
-
- * proc.c: use RUBY_VM_IFUNC_P() to recognize IFUNC or not.
-
- * vm.c: ditto.
-
- * vm_dump.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
- * vm_core.h (RUBY_VM_IFUNC_P): use RB_TYPE_P() instead of
- BUILTIN_TYPE().
-
-Wed Mar 11 03:21:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h: define struct THROW_DATA to represent
- throwing data. Also define accessor functions.
-
- * eval_intern.h: move related changes into vm_insnhelper.h.
- Now these MACROs (functions) are only used in vm*.c.
-
- There is only THROW_DATA_P(err) to check this data type or not.
-
- * vm.c: catch up these changes.
-
- * vm_eval.c: ditto.
-
- * vm_insnhelper.c: ditto.
-
-Wed Mar 11 00:57:00 2015 Rei Odaira <Rei.Odaira@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.
-
-Tue Mar 10 20:03:41 2015 Tanaka Akira <akr@fsij.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.
-
-Tue Mar 10 17:27:27 2015 Koichi Sasada <ko1@atdot.net>
-
- * thread.c (thread_join): Fixnum (except TAG_FATAL) and
- NODE should not be reached here.
-
-Mon Mar 9 21:42:10 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (ep_cref): rename to lep_cref() because it should be
- local ep.
-
-Mon Mar 9 16:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_close): don't raise on double
- close for consistent to IO#close.
-
-Mon Mar 09 06:44:48 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h: define struct SVAR for SVAR.
- This data type is also same layout of NODE (NODE_IF).
-
- * vm_insnhelper.c: catch up this change.
-
-Mon Mar 9 06:43:21 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (lep_svar_set): add WBs.
-
-Mon Mar 9 06:19:06 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: define rb_cref_t and change to use it.
-
- 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.
-
-Mon Mar 9 06:00:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h (COPY_CREF_OMOD): fix translation miss.
-
-Mon Mar 9 04:47:58 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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)
-
- This is process to change CREF data type from NODE.
-
-Sun Mar 8 22:50:57 2015 Tanaka Akira <akr@fsij.org>
-
- * ext/zlib/zlib.c (rb_gzfile_close): Don't raise on double
- close for consistent to IO#close.
-
-Sun Mar 8 16:57:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): match patterns against legacy short names
- too, not only ordinary names. [ruby-core:67954] [Bug #10819]
-
- * win32/dir.h (struct direct): add short name members.
-
- * win32/win32.c (opendir_internal, readdir_internal): ditto.
-
-Sat Mar 7 09:36:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * array.c: document that first element is kept when using
- Array#uniq and #uniq! [fix GH-845][ci skip]
- Patch by @riffraff
-
-Sat Mar 7 09:28:02 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * thread.c: Mutex#owned? is no longer experimental since 2.1.0
- [fix GH-839][ci skip] Patch by @takiy33
-
-Sat Mar 7 09:18:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/merger.rb: Added documentation to version method.
- [fix GH-847][ci skip] Patch by @magikid
-
-Fri Mar 6 22:50:36 2015 Koichi Sasada <ko1@atdot.net>
-
- * class.c (rb_prepend_module): need a WB for klass -> origin.
-
-Fri Mar 6 20:18:38 2015 Koichi Sasada <ko1@atdot.net>
-
- * fix namespace issue on singleton class expressions. [Bug #10943]
-
- * vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored
- to rb_method_definition_t::body.iseq_body.cref.
-
- * 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.
-
- When SVAR is required, then put NODE_IF onto SVAR location,
- and NDOE_IF::nd_reserved points CREF itself.
-
- * vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added.
-
- * vm_insnhelper.c (vm_push_frame): accept CREF.
-
- * method.h, vm_method.c (rb_add_method_iseq): added. This function
- accepts iseq and CREF.
-
- * class.c (clone_method): use rb_add_method_iseq().
-
- * gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref.
-
- * iseq.c: remove CREF related codes.
-
- * insns.def (getinlinecache/setinlinecache): CREF should be cache key
- because a different CREF has a different namespace.
-
- * node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR.
-
- * proc.c: catch up changes.
-
- * struct.c: ditto.
-
- * insns.def: ditto.
-
- * vm_args.c (raise_argument_error): ditto.
-
- * vm_eval.c: ditto.
-
- * test/ruby/test_class.rb: add a test.
-
-Fri Mar 6 18:19:13 2015 Koichi Sasada <ko1@atdot.net>
-
- * 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).
-
- 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.
-
-Fri Mar 6 17:31:29 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_beginendblock.rb: do not change directory.
-
- Run system command in the directory mounted by vboxsf on Windows 7
- and get warning like that "warning: Insecure world writable dir...".
-
-Fri Mar 6 10:31:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri Mar 6 08:45:26 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.
- [Fixes GH-802]
-
-Fri Mar 6 07:33:03 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (obj_info): show node name too.
-
-Fri Mar 6 07:00:44 2015 Koichi Sasada <ko1@atdot.net>
-
- * internal.h: remove struct method_table_wrapper.
- struct method_table_wrapper was introduced to avoid duplicate marking
- for method tables.
-
- 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.
-
- 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.
-
- 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`.
-
- * class.c: ditto.
-
- * eval.c (rb_using_refinement): ditto.
-
- * gc.c: ditto.
-
- * include/ruby/ruby.h: define m_tbl directly. The definition of
- struct RClass should be moved to (srcdir)/internal.h.
-
- * method.h: remove decl of rb_free_m_tbl_wrapper().
-
- * object.c: use RCLASS_M_TBL() directly.
-
-Fri Mar 6 02:50:12 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (replace_real_basename): need to check the return value of
- GLOB_REALLOC().
-
-Fri Mar 6 02:26:03 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * dir.c (replace_real_basename): shouldn't create Ruby object before
- the object system is loaded.
- [ruby-core:68430] [Bug #10941]
-
-Wed Mar 5 16:58:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * hash.c: [DOC] #delete method actually returns nil, if the key
- is not found. [fix GH-844][ci skip] Patch by @ivdma
-
-Wed Mar 5 12:22:23 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * math.c: refactoring: remove unnecessary variable d0 to unify code
- appearance.
-
-Thu Mar 5 11:50:54 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Thu Mar 5 11:16:55 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_refinement.rb: There is no need anymore to suppress
- warnings.
-
-Thu Mar 5 08:31:02 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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 4 12:43:32 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * test/ruby/test_math.rb (assert_float_and_int): Refactor test cases
- by introducing assert_float_and_int. [misc #10810]
-
-Wed Mar 4 11:52:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Mar 4 10:16:57 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * enum.c: Fix typo in slice_after's exception message.
- [fix GH-842][ci skip] Patch by @jsyeo
-
-Wed Mar 4 10:15:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/syntax/methods.rdoc: add some missing spaces and
- fix a grammatical error in method docs.
- [fix GH-843][ci skip] Patch by @nikolas
-
-Wed Mar 4 02:13:06 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (backport_command_string): pick up only
- when the revision exists in trunk.
-
-Wed Mar 4 00:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_io_blocking_region): assigned variables
- inside EXEC_TAG() should be volatile.
-
- * thread.c (rb_thread_s_handle_interrupt): ditto.
-
- * thread.c (exec_recursive): ditto.
-
-Wed Mar 4 00:29:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: now can specify shorten form of commands.
-
-Tue Mar 3 23:41:42 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (Readline.readline): drop untreated control
- characters.
-
-Tue Mar 3 22:25:24 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/lib/envutil.rb (EnvUtil.invoke_ruby): need to rescue because
- Signal.signame may raise exception.
-
-Tue Mar 3 16:57:39 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: use 'b' instead of 's' for showing
- Backport options for merger.rb.
-
-Tue Mar 3 16:55:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: show selected ticket number at prompt.
-
-Tue Mar 3 14:47:30 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * math.c (num2dbl_with_to_f): direct casting from Rational to double.
- [Feature #10909]
-
- * test/ruby/test_math.rb: add tests for the above change.
-
-Tue Mar 3 07:52:20 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * test/ruby/test_symbol.rb: avoid a false positive in AIX.
-
-Tue Mar 3 00:59:39 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Mon Mar 2 15:36:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: do not check _setjmp unless _longjmp is available,
- so that configure results will not be changed by cache.
-
-Mon Mar 2 14:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
- cached variable only if the target type is not available.
-
-Mon Mar 2 13:04:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (sig_signame): return nil if the argument is a valid
- signal number.
-
-Mon Mar 2 12:05:04 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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.
-
-Mon Mar 2 11:43:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_REPLACE_TYPE): restore unsigned type from
- cached variable.
-
-Mon Mar 2 06:01:41 2015 Eric Wong <e@80x24.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
-
-Sun Mar 1 20:21:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_REPLACE_TYPE): restore convertible type from
- cached variable, so that configured results will be stable.
-
-Sun Mar 1 18:10:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_broken_memmem): check before adding the
- result HAVE_MEMMEM macro to confdefs.h, so that configured
- results will be stable.
-
-Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (id2ref): prohibit from accessing internal objects.
- [ruby-core:68348] [Bug #10918]
-
-Sun Mar 1 09:06:11 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (strptime): Support %s.%N.
- [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi.
-
-Sat Feb 28 17:18:39 2015 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]
-
-Sat Feb 28 15:44:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_dump.c (rb_vm_bugreport): get rid of making new strings
- inside signal context.
-
- * variable.c (rb_tmp_class_path): defer making temporary class
- path string.
-
- * variable.c (rb_search_class_path): search class path or return
- Qnil or Qfalse if unnamed, not creating a temporary path.
-
-Sat Feb 28 15:02:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_tmp_class_path): preserve name encoding of an
- anonymous instance of module/class subclass.
-
-Sat Feb 28 08:24:30 2015 Rei Odaira <Rei.Odaira@gmail.com>
-
- * ext/pty/pty.c: AIX supports autopush.
- Patch by Perry Smith [ruby-core:58539] [Bug #9144]
-
-Fri Feb 27 22:00:05 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rubygems: Update to RubyGems 2.4.6 and HEAD(800f2e6).
- Fixed #1159, #1171, #1173 on rubygems/rubygems
- * test/rubygems: ditto.
-
-Fri Feb 27 20:55:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rake: Update to rake (9237e74), typo fix and remove needless
- private syntax.
- * test/rake: ditto.
-
-Fri Feb 27 17:06:44 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: define vm_svar_index.
-
- * vm_insnhelper.c, vm.c, compile.c: use vm_svar_index names.
-
- * iseq.h: remove DEFAULT_SPECIAL_VAR_COUNT.
- use VM_SVAR_FLIPFLOP_START instead.
-
-Fri Feb 27 13:57:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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>.
-
-Wed Feb 25 22:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * spec/default.mspec: use default configuration file name.
- https://github.com/ruby/rubyspec/commit/cc69f337b06362e5607ffa3e3ad40ef7494960cf
-
-Wed Feb 25 22:21:56 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * spec/default.mspec: remove specific version number.
- https://github.com/ruby/rubyspec/commit/7a909e925c1baa9c700bd44af9241aef6e596714
-
-Wed Feb 25 22:04:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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]
-
-Wed Feb 25 18:12:11 2015 Eric Wong <e@80x24.org>
-
- * signal.c (sighandler): preserve errno
- Patch by Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
- [ruby-core:68172] [Bug #10866]
-
-Wed Feb 25 15:59:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (push_pattern, push_glob): make globbed file names same
- encoding to the given pattern.
-
-Wed Feb 25 15:27:16 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/merger.rb: support 2.1+ versioning scheme.
-
-Tue Feb 25 08:49:12 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * lib/cmath.rb (log): raise ArgumentError when more than 2 arguments
- are passed. [ruby-core:66143] [Bug #10487]
-
-Tue Feb 25 02:15:17 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * test/ruby/test_math.rb: Use assert_infinity instead of assert_equal(1.0/0, ...).
-
- * test/ruby/test_math.rb: Add tests for overriding Integer#to_f.
- [ruby-core:67919] [Misc #10809]
-
-Tue Feb 24 22:58:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (nucomp_mul): calculate as rotation in complex plane
- if matrix calculation resulted in NaN.
-
-Tue Feb 24 21:45:39 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * test/ruby/test_math.rb(test_cbrt): Add an assertion for Math.cbrt(1.0/0)
- and move #test_cbrt to more proper place.
-
-Tue Feb 24 19:09:25 2015 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c (lep_svar_place, lep_svar_get): do not create
- additional T_NODE object (svars holder) when only getting
- svars.
-
-Tue Feb 24 11:49:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_zone_name): should be US-ASCII only if all 7-bits,
- otherwise locale encoding. [ruby-core:68230] [Bug #10887]
-
-Tue Feb 24 09:47:07 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (chompped_length): enable smart chomp for all non-dummy
- encoding strings, not only default_rs.
- [ruby-core:68258] [Bug #10893]
-
-Mon Feb 23 23:19:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/vcs.rb (IO.popen): support :chdir option.
-
- * 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]
-
-Mon Feb 23 15:26:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_split_m): raise ArgumentError at broken string
- not RegexpError, as Regexp is not involved in.
- [ruby-core:68229] [Bug #10886]
-
-Mon Feb 23 07:25:29 2015 Benoit Daloze <eregontp@gmail.com>
-
- * time.c: Zone encoding should be US-ASCII if all 7-bits. Fix r46907.
-
- * test/ruby/test_time.rb, test/ruby/test_time_tz.rb: Update tests.
-
-Sun Feb 22 18:33:42 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * common.mk: use ruby organization for rubyspec.
-
-Sun Feb 22 15:56:06 2015 Kazuki Tsujimoto <kazuki@callcc.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]
-
- * vm_core.h, class.c: change accordingly.
-
- * test/ruby/test_refinement.rb: add a test for above.
-
-Sun Feb 22 10:43:37 2015 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_objspace_call_finalizer): control GC execution during
- force firnalizations at the end of interpreter process.
- [Bug #10768]
-
- 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.
-
- 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.
-
-Sun Feb 22 04:07:05 2015 Zachary Scott <e@zzak.io>
-
- * ext/openssl/ossl_asn1.c: [DOC] RDoc formatting fixes for
- ASN1::ObjectId with patch from @vbatts [Fixes GH-834]
-
- * ext/openssl/ossl_bn.c: ditto.
-
-Sat Feb 21 19:51:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (match_aref): RMatch::regexp is Qnil after matching by a
- string since r45451. [ruby-core:68209] [Bug #10877]
-
-Sat Feb 21 16:18:42 2015 Stefan Schuler <mail@stefanschuessler.de>
-
- * compar.c (Init_Comparable): [DOC] Replace camelcase variable name.
- [Fix GH-833]
-
-Fri Feb 20 17:27:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_file_identical_p): fix handle leak, ensure to close
- the handle of the first argument.
-
-Fri Feb 20 17:19:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (different_device_p): compare by volume serial
- numbers, not by path names. [ruby-core:68162] [Bug #10865]
-
-Thu Feb 19 01:58:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Feb 18 10:48:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Feb 18 03:13:52 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * 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
-
-Tue Feb 17 11:47:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
- returned by Kernel#instance_variables are Symbols now.
- [ruby-core:68128] [Bug #10857]
-
-Tue Feb 17 10:59:10 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/syntax/calling_methods.rdoc: Fix documentation for "calling_methods"
- Patch by @sos4nt [fix GH-830][ci skip]
-
-Tue Feb 17 10:53:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Tue Feb 17 10:47:20 2015 Iain Beeston <iain.beeston@gmail.com>
-
- * hash.c: Added docs to explain that #include? and #member? do not
- check member equality
- * lib/set.rb: ditto
-
-Mon Feb 16 20:58:49 2015 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
-
-Sun Feb 15 10:41:23 2015 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * doc/standard_library.rdoc: [DOC] delete removed libraries.
- [misc #10843] [ci skip]
-
-Sat Feb 14 12:20:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (rand_random_number): add a method to return a random
- number like SecureRandom to Random::Formatter.
-
- * lib/securerandom.rb (random_bytes): move to Random::Formatter,
- the base method of the module.
-
-Sat Feb 14 12:01:32 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (random_raw_seed): extract platform dependent random
- seed initialization function as a new method Random.raw_seed.
-
- * lib/securerandom.rb (SecureRandom): use Random.raw_seed.
-
-Sat Feb 14 00:49:37 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/coverage/coverage.c: Add Coverage.peek_result. Allows you to
- capture coverage information without stopping the coverage tool.
- [ruby-core:67940] [Feature #10816]
-
- * test/coverage/test_coverage.rb: test for change.
-
-Fri Feb 13 21:52:05 2015 Yusuke Endoh <mame@tsg.ne.jp>
-
- * string.c (str_discard): does not free for STR_NOFREE string.
- [Bug #10853][ruby-core:68110]
-
- * bootstraptest/test_string.rb: test for above.
-
-Fri Feb 13 21:16:00 2015 Yusuke Endoh <mame@tsg.ne.jp>
-
- * lib/base64.rb: make urlsafe mode user-friendly.
-
- * lib/base64.rb (Base64.urlsafe_encode64): a new option "padding" to
- suppress the padding character ("=").
-
- * lib/base64.rb (Base64.urlsafe_decode64): now it accepts not only
- correctly-padded input but also unpadded input.
- [Feature #10740][ruby-core:67570]
-
- * test/base64/test_base64.rb: Test for above
-
-Fri Feb 13 14:19:06 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/json: merge upstream from flori/json
- change usage of TypedData. [Feature #10739][ruby-core:67564]
-
-Thu Feb 12 18:34:01 2015 multisnow <infinity.blick.winkel@gmail.com>
-
- * ext/openssl/extconf.rb: check RAND_edg to support libressl.
-
- * ext/openssl/ossl_rand.c (ossl_rand_egd): define only if RAND_edg
- is available. [Fix GH-829]
-
-Thu Feb 12 10:46:14 2015 Eric Hodel <drbrain@segment7.net>
-
- * proc.c (proc_call): Improve Proc#call documentation. Patch by
- Hsing-Hui Hsu. [fix GH-761]
-
-Thu Feb 12 04:33:02 2015 Benoit Daloze <eregontp@gmail.com>
-
- * compar.c (cmp_equal): no more error hiding for Comparable#==.
- It now behaves as other Comparable methods. See #7688.
-
- * test/ruby/test_comparable.rb: update related test.
-
-Thu Feb 12 03:28:05 2015 Eric Wong <e@80x24.org>
-
- * lib/set.rb (initialize): internal hash defaults to false
-
- * lib/set.rb (include?): use Hash#[] for optimized dispatch.
- Patch by Ismael Abreu <ismaelga@gmail.com>
- [ruby-core:67664] [Misc #10754]
-
-Wed Feb 11 11:09:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/digest/digest_conf.rb (digest_conf): check for CommonDigest.
-
- * ext/digest/*/*cc.h: for Apple CommonCrypto/CommonDigest.h.
-
- * ext/digest/digest.h (DEFINE_FINISH_FUNC_FROM_FINAL): macro for
- finish functions, by inverting arguments order.
-
- * ext/digest/digest_conf.rb (digest_conf): extract common
- configurations.
-
-Wed Feb 11 11:01:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Wed Feb 11 07:53:35 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_word.rb: use skip method to skip test.
-
-Tue Feb 10 11:38:28 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Tue Feb 10 11:19:11 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (chdir, delete, gettextfile, mdtm, mkdir, nlst,
- putbinaryfile, puttextfile, rename, rmdir, size): support
- Pathname. Patch by Joe Rafaniello. [fix GH-828]
-
-Mon Feb 9 16:36:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): get rid of loading unbundled and
- unexpected libraries. [ruby-core:67977] [Bug #10822]
-
-Sun Feb 8 20:09:37 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/net/http/header.rb: pass header names as symbols.
- Patch by @DamirSvrtan [fix GH-805]
- * test/net/http/test_httpheader.rb: added test.
-
-Sun Feb 8 13:04:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/getaddrinfo.c (get_addr): reject too long hostname to
- get rid of GHOST vulnerability on very old platforms.
-
- * ext/socket/raddrinfo.c (make_hostent_internal): ditto, paranoic
- check for the canonical name.
-
-Sun Feb 8 12:48:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/win32/registry.rb (Win32::Registry::API): use wide
- versions of RegDeleteValue and RegDeleteKey.
- [ruby-core:67958] [Bug #10820]
-
-Sat Feb 7 22:13:08 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_record.rb: remove test using .NET
- Framework 3.5 because it is not included in Windows 8/8.1.
-
-Sat Feb 7 19:25:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (has_magic): always get long path name on Windows even if
- no tilde is there. [ruby-core:68011] [Bug #10819]
-
- * dir.c (replace_real_basename): FindFirstFile ignore redirection
- character, check if exists before call it. cf. [Bug #8597]
-
-Sat Feb 7 13:30:11 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * test/win32ole/test_win32ole_record.rb
- (test_ole_instance_variable_get): correct VT_RECORD type and
- instance variables.
-
-Fri Feb 6 17:47:05 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes when
- dumping objects with custom coders. [ruby-core:66215] [Bug #10496]
-
- * test/psych/test_coder.rb: test for fix
-
-Fri Feb 6 16:58:31 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
- expressions with newlines. tenderlove/psych#222
-
- * test/psych/test_yaml.rb: test for change.
-
-Fri Feb 6 10:31:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Feb 5 22:42:34 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rubygems: Update to RubyGems HEAD(5c3b6f3).
- Fixed #1156, #1142, #1115, #1142, #1139 on rubygems/rubygems
- * test/rubygems: ditto.
-
-Thu Feb 5 13:41:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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_insnhelper.c (ci_missing_reason): return the reason of method
- missing in call info.
-
- * vm_insnhelper.c (vm_call_opt_send): re-apply r49500 with the
- proper missing reason. [Bug #10828]
-
-Thu Feb 5 10:31:46 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * class.c (rb_obj_singleton_methods): should use RTEST() to convert
- VALUE to int.
-
-Thu Feb 5 03:59:33 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * vm_insnhelper.c: Fix symbol leak with +send+ [Bug #10828]
-
-Wed Feb 4 20:26:54 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (Init_win32ole): should not use atexit to
- free allocated hash table to avoid error on Cygwin.
-
-Wed Feb 4 15:34:25 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Wed Feb 4 16:32:40 2015 Matt Hoyle <matt@deployable.co>
-
- * ext/bigdecimal/bigdecimal.c (VpSetPTR): fix a typo, 'expoennt'
- to 'exponent'. [ruby-core:67980] [Bug #10823] [Fix GH-825]
-
-Wed Feb 4 15:55:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Feb 4 11:12:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (probes.stamp): rebuild dtrace dependent objects
- only when `dtrace -G` modifies its input files.
-
-Tue Feb 3 19:27:16 2015 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * Makefile.in (ruby-glommed.o): ditto.
-
- * Makefile.in (ruby-glommed.o): remove excess $(DTRACE_OBJ) because
- it is included in $(OBJS) since r49451.
-
- * Makefile.in (probes.o): should depend on $(DTRACE_DEPENDENT_OBJS)
-
-Tue Feb 3 17:15:45 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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 3 15:23:58 2015 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_method.c (remove_method): When remove refined
- method, raise a NameError if the method is not
- defined in refined class.
-
- But if the method is defined in refined class,
- it should keep refined method and remove original
- method.
-
- Patch by Seiei Higa. [ruby-core:67722] [Bug #10765]
-
-Tue Feb 3 14:04:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (glob_helper): obtain real name with FindFirstFile API
- instead of matching all entries, on Windows.
- [ruby-core:67954] [Bug #10819]
-
-Tue Feb 3 12:26:35 2015 Katsuhiko Nishimra <ktns.87@gmail.com>
-
- * lib/mkmf.rb (configuration): set the default cxxflags, which is
- referred from the default CXXFLAGS, for extension libraries.
- [Fix GH-823]
-
-Tue Feb 3 05:52:00 2015 Aman Gupta <ruby@tmm1.net>
-
- * 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.
-
-Mon Feb 2 10:51:34 2015 Ari Pollak <ajp@aripollak.com>
-
- * 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]
-
-Sun Feb 1 13:46:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb (bin-comm): drop batch file installation.
- Windows 95 support has not been supported already.
- [Feature #10806]
-
-Sat Jan 31 12:06:23 2015 Scott Francis <scott.francis@shopify.com>
-
- * 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]
-
-Fri Jan 30 17:28:29 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * math.c (num2dbl_with_to_f): make faster when Bignum passed by
- direct conversion using rb_big2dbl(). [Feature #10800]
-
-Thu Jan 29 23:30:00 2015 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback function
- for rubies lower than 2.2.0.
-
- * ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto.
-
- * ext/bigdecimal/extconf.rb: check the existences of struct RRational,
- rb_rational_num, and rb_rational_den.
-
- * ext/bigdecimal/bigdecimal.bundle: bump version.
-
-Thu Jan 29 20:28:25 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/make-snapshot: removed md5 digest with package information
-
-Thu Jan 29 10:41:52 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org>
-
- * math.c (Get_Double): direct casting from Fixnum to double.
- [Feature #10785]
-
-Thu Jan 29 02:34:27 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * 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
-
-Thu Jan 29 02:06:09 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Wed Jan 28 21:32:24 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * thread.c: Improve documentation for Thread#value
- [Bug #10694][ruby-core:67324][ci skip]
-
-Tue Jan 27 16:04:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: added `!` command.
-
-Tue Jan 27 15:58:23 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: added history feature for platforms which
- lack readline.
-
-Mon Jan 26 22:09:35 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * .gitignore: ignored temporary file with git.
-
-Mon Jan 26 18:06:03 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * misc/ruby-electric.el: Import version 2.2.2 from
- https://github.com/knu/ruby-electric.el.
-
-Mon Jan 26 11:37:49 2015 Dave Stevens <dave@crowdlab.com>
-
- * string.c (str_make_independent_expand): terminate String when
- moved from heap to embedded. [Fix GH-821].
-
-Sun Jan 25 12:04:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (flatten): no need to call to_ary method on elements
- beyond the given level. [ruby-core:67637] [Bug #10748]
-
-Sun Jan 25 00:42:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Jan 24 19:56:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dln_find.c (dln_find_1): search regular files only. based on
- the patch by Alex Coomans in [ruby-core:67766]. [Bug #10776]
-
-Fri Jan 23 23:57:05 2015 Misumi Rize <r@ayase-e.li>
-
- * 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]
-
-Fri Jan 23 20:00:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_object, marshal_dump): use identity tables for
- arbitrary VALUE keys, because of performance of FLONUM.
- [Bug #10761]
-
- * marshal.c (obj_alloc_by_klass, marshal_load): ditto.
-
-Fri Jan 23 17:12:33 2015 Eric Wong <e@80x24.org>
-
- * benchmark/bm_marshal_dump_flo.rb: new benchmark for [Bug #10761]
-
-Thu Jan 22 18:03:19 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (find_svn_log): use double quotes instead
- of single quotes because cmd.exe doesn't handle them.
-
- * tool/redmine-backporter.rb (done): the 2nd element of matched data
- is the offset of the end of matched string, not length.
-
-Thu Jan 22 16:45:24 2015 Eric Wong <e@80x24.org>
-
- * 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 Jan 21 22:33:51 2015 Akinori MUSHA <knu@iDaemons.org>
-
- * 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.
-
-Wed Jan 21 09:40:52 2015 Zachary Scott <e@zzak.io>
-
- * file.c: Document other cases of missing birthtime on OS with patch
- provided by @sho-h similar to GH-817. [ci skip] [DOC]
-
-Wed Jan 21 09:09:19 2015 Tanaka Akira <akr@fsij.org>
-
- * NEWS: References to tickets added.
- [ruby-core:67701] [Bug #10760] Suggested by Zachary Scott.
-
-Tue Jan 20 22:59:54 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * tool/vcs.rb: fix the exception given remote-url of svn.
-
-Tue Jan 20 12:58:33 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: now can change the page of `ls`.
-
-Tue Jan 20 12:28:37 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (readline): fallback to normal gets on
- Windows because IO.console.getch is not always do as expected.
-
-Tue Jan 20 11:31:07 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: update usage.
-
-Tue Jan 20 11:23:47 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/redmine-backporter.rb (mygets): to support Backspace
- implement gets by itself.
-
-Tue Jan 20 02:54:11 2015 Zachary Scott <e@zzak.io>
-
- * file.c: NotImplementedError is raised if birthtime is unavailable.
- Patch by @y-yagi san and [Fixes GH-817] [ci skip] [DOC]
-
- * ext/pathname/pathname.c: ditto.
-
-Mon Jan 19 22:08:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (include_modules_at): allow to prepend each module up to
- once for each classe. [EXPERIMENTAL]
-
-Sun Jan 18 18:32:20 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * math.c (math_atan2): revive documentation before r49220.
- http://d.hatena.ne.jp/nagachika/20150112/ruby_trunk_changes_49213_49226
-
-Sun Jan 18 15:57:32 2015 Seiei Higa <hanachin@gmail.com>
-
- * 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]
-
-Sun Jan 18 15:50:39 2015 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]
-
-Sun Jan 18 12:56:49 2015 Nobuyoshi Nakada <nobu@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.
-
- * configure.in, enc/Makefile.in (BUILTIN_ENCS, BUILTIN_TRANSES):
- prefix respective directory names to builtin encodings and
- transcoder source names.
-
-Sun Jan 18 11:49:46 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
- variable is passed by reference. [ruby-dev:48803] [Bug #10697]
-
-Sat Jan 17 23:59:15 2015 Nobuyoshi Nakada <nobu@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
-
-Sat Jan 17 23:42:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri Jan 16 18:42:58 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/redmine-backporter.rb: support adding related revisions
- to issues.
-
-Fri Jan 16 17:20:33 2015 Koichi Sasada <ko1@atdot.net>
-
- vm.c, vm_core.h: constify VM_CF_LEP, VM_CF_PREV_EP, VM_CF_BLOCK_PTR
- and rb_vm_control_frame_block_ptr.
-
-Fri Jan 16 15:41:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych.rb: bump version
-
- * ext/psych/psych.gemspec: ditto
-
-Fri Jan 16 15:37:49 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: only dump hash
- subclasses. Thanks Joe Eli McIlvain <joe.eli.mac@gmail.com>
-
- * test/psych/test_hash.rb: test for change
-
-Fri Jan 16 15:35:21 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych.rb: bump version
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: fix line width wrapping
- for long strings. Thanks Jakub Jirutka <jakub@jirutka.cz>
-
- * test/psych/test_string.rb: test for change
-
-Fri Jan 16 11:44:44 2015 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * 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]
-
- * test/ruby/test_settracefunc.rb: add a test.
-
-Thu Jan 15 23:55:15 2015 Tanaka Akira <akr@fsij.org>
-
- * io.c (rb_io_close_m): Don't raise when the IO object is closed.
- [ruby-core:67444] [Feature #10718]
-
-Thu Jan 15 21:34:57 2015 Seiei Higa <hanachin@gmail.com>
-
- * proc.c (rb_obj_singleton_method): Kernel#singleton_method should
- not use refinements, as well as Kernel#method.
- [ruby-core:67603] [Bug #10744]
-
-Thu Jan 15 10:45:04 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_select_bang, ary_reject_bang): linear
- performance. [ruby-core:67418] [Feature #10714]
-
-Wed Jan 14 18:06:06 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * 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
-
-Wed Jan 14 16:45:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/downloader.rb (RubyGems.download): verify downloaded gem
- packages. LowSecurity to allow untrusted certificates now.
-
-Wed Jan 14 15:43:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Tue Jan 13 21:59:24 2015 Michal Papis <mpapis@gmail.com>
-
- * tool/rbinstall.rb (gem): fix changing permissions of installed
- bundled gems. [Fix GH-812]
-
-Tue Jan 13 21:57:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (distclean-local): remove autom4te.cache generated by
- autoconf.
-
- * common.mk (realclean-local): remove id sources and dummy header
- for dtrace. [ruby-core:67562] [Bug #10737]
-
-Tue Jan 13 21:08:22 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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
-
-Tue Jan 13 14:16:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/net/http/test_http.rb: get rid of accessing DNS actually
- for some servers returning wrong results.
- [ruby-core:67454] [Bug #10721]
-
-Mon Jan 12 23:21:57 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * gems/bundled_gems: update test-unit to 3.0.9.
-
-Mon Jan 12 18:35:44 2015 Eric Wong <e@80x24.org>
-
- * 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
-
-Mon Jan 12 18:01:24 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
- CR. should check if substitution occurred too.
- [ruby-dev:48813] [Bug #10732]
-
-Mon Jan 12 16:45:46 2015 Seiei Higa <hanachin@gmail.com>
-
- * 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]
-
-Mon Jan 12 13:53:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * math.c (math_atan2): improve documentation.
- [Feature #10323][ruby-core:65400][ci skip]
-
-Mon Jan 12 13:50:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/bigdecimal/bigdecimal.c: fixes documentation like labeled lists,
- code examples etc. [ruby-core:66730][Bug #10576][ci skip]
-
-Mon Jan 12 13:36:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/optparse.rb: improvements for OptionParser documentation.
- [misc #10608][ruby-core:66901][ci skip]
-
-Mon Jan 12 13:33:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * array.c (rb_ary_each): documented return value.
- [misc #10469][ruby-core:66063]
-
-Sun Jan 11 15:11:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/webrick/test_utils.rb (test_create_listeners): use
- dynamically chosen port number, not hardcoded port number.
- [ruby-core:67508]
-
-Sat Jan 10 12:57:12 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/zlib/zlib.c: fix document of method signatures.
- [Bug #10668][ruby-core:67186][ci skip]
-
-Sat Jan 10 12:32:44 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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]
-
-Sat Jan 10 10:58:55 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * complex.c: removed commented-out code.
-
-Sat Jan 10 10:57:19 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * rational.c: removed commented-out code.
- [Feature #10376][ruby-core:65643]
-
-Sat Jan 10 10:12:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_select_bang): keep the array consistent by
- removing unselected values soon. [ruby-dev:48805] [Bug #10722]
-
-Fri Jan 9 23:20:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/rubygems: Update to RubyGems HEAD(e53c54a).
- * test/rubygems: ditto.
-
-Fri Jan 9 11:13:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (assocs, assoc): eliminate splatting empty literal
- hashes. [ruby-core:67446] [Bug #10719]
-
- * compile.c (compile_array_): support splatted hash in hash type.
-
-Fri Jan 9 10:57:09 2015 Vit Ondruch <vondruch@redhat.com>
-
- * configure.in (RUBY_SETJMP_TYPE): Remove superfluous semicolon
- which causes a syntax error with autoconf 2.63.
- [ruby-core:67429] [Bug #10716]
-
-Fri Jan 9 07:23:32 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: correctly quote non-ascii
- letters. Thanks @jirutka for the patch.
-
- * test/psych/test_string.rb: test for change
-
-Fri Jan 9 07:13:55 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
- subclasses. Fixes github.com/tenderlove/psych/issues/196
-
- * test/psych/test_hash.rb: test for change
-
-Fri Jan 9 06:58:43 2015 Aaron Patterson <aaron@tenderlovemaking.com>
-
- * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
- Fixes github.com/psych/issues/43
-
- * test/psych/test_hash.rb: test for change
-
-Thu Jan 8 17:05:00 2015 Seiei Higa <hanachin@gmail.com>
-
- * vm_method.c (rb_method_entry): if no super class, no original
- method entry. [ruby-core:67389] [Bug #10707]
-
-Thu Jan 8 16:31:43 2015 Seiei Higa <hanachin@gmail.com>
-
- * vm_method.c (rb_export_method): bail out if the original method
- is undefined when the method is refined.
- [ruby-core:67387] [Bug #10706]
-
-Thu Jan 8 12:53:44 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Thu Jan 8 11:39:18 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * .travis.yml: Remove redundant configuration option.
- [fix GH-809] Patch by @gxworld
-
-Thu Jan 8 07:17:14 2015 Eric Wong <e@80x24.org>
-
- * lib/resolv.rb: consider ENETUNREACH as ResolvTimeout
- [ruby-core:67411] [Bug #10712]
-
-Thu Jan 8 00:13:52 2015 Tanaka Akira <akr@fsij.org>
-
- * 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]
-
-Wed Jan 7 19:19:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (dir_initialize): workaround of opendir failure at symlink
- directories on Windows via CIFS.
-
-Wed Jan 7 18:52:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (need_normalization): not only HFS+, CIFS (SMB) is also
- decomposed. [Bug #10704]
-
- * 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.
-
-Tue Jan 6 21:41:04 2015 Tanaka Akira <akr@fsij.org>
-
- * 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.
-
-Tue Jan 6 03:10:54 2015 Koichi Sasada <ko1@atdot.net>
-
- * test/fiddle/test_handle.rb: fix syntax.
-
-Tue Jan 6 00:16:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Jan 5 14:58:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * test/ruby/test_io.rb: added timeout for AIX environment.
- [ruby-core:62983][Bug #9917]
-
-Sun Jan 4 22:33:33 2015 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]
-
-Sun Jan 4 22:32:42 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit.rb (Test::Unit): reorder modules and merge
- each modules.
-
- * test/lib/test/unit.rb (Test::Unit): split the large class into
- each modules.
-
-Sun Jan 4 21:32:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (f_label): return tLABEL value as it is.
- [ruby-core:67315] [Bug #10693]
-
-Sun Jan 4 14:02:37 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit/parallel.rb (run): expand the file name to be
- loaded, so that relative paths work in parallel mode.
-
-Sun Jan 4 13:36:56 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * test/test_tempfile.rb: use assert_file for more descriptive message.
- following r49131.
-
-Sun Jan 4 13:05:09 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * string.c: improve docs for String#<=>. [ruby-core:65399][Feature #10322]
- Patch by gogo tanaka.
-
-Sun Jan 4 12:42:24 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * array.c: improve docs for Array#reject. [ruby-core:65324][misc #10307]
- Patched by Nebu Pookins.
-
-Sun Jan 4 12:24:11 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * string.c: improve docs for String#strip and variations.
- [ruby-core:66081][Bug #10476]
-
-Sun Jan 4 09:21:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/drb/drb.rb: removed unused argument. Patch by @vipulnsward
- [fix GH-515]
-
-Sun Jan 4 09:18:31 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/tempfile.rb: provide default basename parameter.
- [fix GH-523] Patch by @dissolved
- * test/test_tempfile.rb: ditto.
-
-Sun Jan 4 00:43:41 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * README.ja.md: add guidance of mailing list and bugs.r-l.o.
-
-Sat Jan 3 23:56:28 2015 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
-
- * hash.c: fix docs for Hash#invert. [ruby-core:66917] [Bug #10612]
-
-Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_str_new_literal): define on all
- platforms, not only gcc.
-
-Sat Jan 3 18:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
- number as the rest are not used.
-
-Sat Jan 3 18:19:50 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Jan 3 11:50:16 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/openssl/ossl.h: avoid to build failure of Windows environment.
- * ext/openssl/ossl_ssl_session.c: ditto.
-
-Sat Jan 3 11:27:46 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Jan 3 10:38:52 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Jan 3 10:14:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`
- [fix GH-591] Patch by @PiPeep
- * ext/openssl/ossl_ssl_session.c: ditto.
-
-Sat Jan 3 09:54:32 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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.
-
-Sat Jan 3 09:01:43 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * NEWS: added compatibility entry of r49101.
-
-Fri Jan 2 21:06:59 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/net/http.rb (Net::HTTP#send_request): there is no response body
- with HEAD request. Patch by @rodrigosaito [fix GH-520]
-
-Fri Jan 2 21:04:36 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * test/net/http/test_http.rb (_test_send_request__HEAD): Added
- failing test for send_request with HEAD method.
-
-Fri Jan 2 18:41:20 2015 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)
-
-Fri Jan 2 16:18:44 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * test/ruby/test_module.rb: Refactor invalid testcase.
- [fix GH-472][ruby-core:59035][Bug #9240]
-
-Fri Jan 2 15:53:00 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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 Jan 2 15:35:53 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/securerandom.rb: improve syntax and grammar of documentation.
- [fix GH-796][ci skip] Patch by @Erol
-
-Fri Jan 2 15:10:01 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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]
-
-Fri Jan 2 09:08:31 2015 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::DNS::Label::Str#==): Check class equality.
- (Resolv::DNS::Name#initialize): Normalize labels as
- Resolv::DNS::Label::Str objects.
-
-Thu Jan 1 21:41:49 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * doc/regexp.rdoc: fix regexp docs for whitespace character.
- [ruby-dev:48765] [Bug #10624]
-
-Thu Jan 1 17:50:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_rubyoptions.rb: try locale encoding name.
- [ruby-core:67109] [Bug #10643]
-
-Thu Jan 1 11:07:12 2015 Eric Wong <e@80x24.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]
-
-Thu Jan 1 09:14:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Wed Dec 31 17:48:43 2014 Tanaka Akira <akr@fsij.org>
-
- * 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]
-
-Wed Dec 31 16:48:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (gettable_gen): disable warnings of possible reference
- to a local variable defined in a past scope.
- [ruby-core:67162] [Bug #10661]
-
-Wed Dec 31 13:43:48 2014 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
- objects. Label#Str#== is case-insensitive.
-
-Tue Dec 30 16:16:12 2014 Ben Miller <bmiller@rackspace.com>
-
- * lib/resolv.rb (Resolv::DNS::Name#==): DNS is case-insensitive, so the
- comparison should be case-insensitive as well.
- [ruby-core:66498] [Bug #10550]
-
-Tue Dec 30 16:03:45 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/resolv.rb (Resolv::DNS::Name): names with different dots
- should be different.
-
-Tue Dec 30 13:16:56 2014 Martin Duerst <bernhard+git@lsmod.de>
-
- * lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Array
- to avoid error during bootstrap when encodings are not yet defined.
- [Bug #10678]
-
-Tue Dec 30 09:29:26 2014 Bernhard M. Wiedemann <bernhard+git@lsmod.de>
-
- * ext/dbm/dbm.c (Init_dbm): [DOC] as UNIX permissions are octal
- numbers, needs to be prefixed by 0. [Fix GH-800]
-
-Tue Dec 30 08:57:39 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * lib/unicode_normalize.rb: typo fix. [ci skip]
- [ruby-dev:48794][misc #10675]
-
-Mon Dec 29 19:38:01 2014 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * version.h (RUBY_VERSION): 2.3.0 development has started.
-
-Mon Dec 29 18:58:46 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (unescape_nonascii): append escape sequence as-is not
- unescaped character, to get rid of unexpected meta-character.
- [ruby-core:67193] [Bug #10670]
-
-Mon Dec 29 14:27:33 2014 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]
-
-Mon Dec 29 11:18:17 2014 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]
-
-Mon Dec 29 10:37:27 2014 Thiago Lewin <thiago_lewin@yahoo.com.br>
-
- * io.c (rb_f_select): [DOC] workaround for YARD doc. [Fix GH-799]
-
- * process.c (proc_detach): [DOC] fix missing closing parenthesis.
- [Fix GH-799]
-
-Mon Dec 29 07:27:23 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/json, test/json: merge JSON HEAD(17fe8e7)
- https://github.com/flori/json/compare/v1.8.1...17fe8e7
-
-Sun Dec 28 23:49:37 2014 Michal Papis <mpapis@gmail.com>
-
- * 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]
-
-Sun Dec 28 18:19:28 2014 Eric Wong <e@80x24.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]
-
-Sun Dec 28 16:25:12 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
- always. [ruby-core:67153] [Bug #10657]
-
-Sun Dec 28 13:54:26 2014 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Sat Dec 27 20:12:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/json/generator/generator.c (JSON_Generator_State_type): add
- #ifdef for backward compatibility.
-
- * ext/json/parser/parser.rl (JSON_Parser_type): ditto.
-
- * ext/json/generator/generator.h (ZALLOC): add fallback definition.
-
- * ext/json/parser/parser.h (ZALLOC): ditto.
-
-Sat Dec 27 16:54:05 2014 Tanaka Akira <akr@fsij.org>
-
- * process.c: Unused code removed.
- It seems waitpid() is universally available on POSIX platforms.
-
-Sat Dec 27 15:08:27 2014 Eric Wong <e@80x24.org>
-
- * vm_core.h (rb_vm_living_threads_insert): preserve order
- [Bug #10660] [ruby-core:67154] [ruby-core:67159]
-
-Sat Dec 27 13:08:20 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/socket/socket.c: improved document for YARD doc.
- [fix GH-795][ci skip] Patch by @tlewin
-
-Sat Dec 27 10:11:21 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix to invoke correct function
- of tcllib. Patch by @zalt50 [fix GH-787]
-
-Sat Dec 27 10:03:41 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
-
- * 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]
-
-Fri Dec 26 15:32:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tcltklib.c (ip_invoke_core): remove probably duplicate
- dead code.
-
-Fri Dec 26 15:28:27 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tcltklib.c (ip_ruby_cmd_receiver_const_get): simply use
- rb_path2class() to get a class/module from its name.
-
-Fri Dec 26 15:20:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * marshal.c (w_long): append at once by w_nbyte() instead of
- appending byte by byte.
-
-Fri Dec 26 15:13:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/json/parser/parser.rl (unescape_unicode): check if valid
- before bit-or assignments.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
- * ext/nkf/nkf-utf8/nkf.c (nkf_iconv_t): fix a missing semicolon.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
- * process.c (rb_spawn_process): get rid of usage of uninitialized
- variable.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
- * regexec.c (match_at): ditto.
-
- * ext/win32ole/win32ole.c (ole_wc2mb_alloc, ole_vstr2wc, ole_mb2wc):
- ditto.
-
- * dir.c (ruby_glob0): no need to check never-NULL pointer.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
- * win32/file.c (rb_file_expand_path_internal): ditto.
-
- * win32/file.c (code_page_i): handle realloc failure.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
- * win32/stub.c (stub_sysinit): ditto.
-
- * fix printf format conversion specifiers.
- reported by Denis Denisov <denji0k AT gmail.com>.
-
-Fri Dec 26 01:41:40 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
- [Bug #10647] [ruby-dev:48787]
-
-Fri Dec 26 01:24:42 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/downloader.rb: support old versions of ruby.
-
- * tool/downloader.rb: now can download gems by http if openssl is not
- available (this may be danger!)
-
-Fri Dec 26 00:13:48 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_extlibs.rb: check existence of extension libraries
- which not depend on outer libraries. (experimental)
-
-Thu Dec 25 21:58:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/fiddle/extconf.rb: make PIC objects if it will be linked as
- a shared object eventually. [ruby-core:67128]
-
-Thu Dec 25 19:01:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/fiddle/win32/libffi-3.2.1-mswin.patch: support mswin32.
-
-Thu Dec 25 17:30:40 2014 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Thu Dec 25 17:27:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (NET_LUID): include winsock2.h instead of windows.h.
- patch by Jon Forums in [ruby-core:67125]. [Bug #10640]
-
-Thu Dec 25 16:14:10 2014 Nobuyoshi Nakada <nobu@ruby-lang.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.
-
- * 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
-
-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.4.0 b/doc/ChangeLog-2.4.0
deleted file mode 100644
index 1714b7caec..0000000000
--- a/doc/ChangeLog-2.4.0
+++ /dev/null
@@ -1,9492 +0,0 @@
-Mon Nov 7 00:32:45 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
- ignore on Windows because we cannot handle signaled status of child
- ruby process on this platform.
-
-Sun Nov 6 23:36:07 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
- send SIGKILL if the child process doesn't die within 1 second.
-
-Sun Nov 6 21:54:28 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/vcs.rb (export_changelog): generate ChangeLog file from
- vcs's log. [Feature #12283]
-
- * tool/make-snapshot (package): overwrite ChangeLog by generated
- ChangeLog.
-
-Sun Nov 6 21:36:33 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Added entry for RDoc 5.
-
-Sun Nov 6 21:35:37 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: ordered entries and adjust styles.
-
-Sun Nov 6 18:23:31 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Added entry for [Feature #12160][ruby-core:74239]
-
-Sun Nov 6 18:18:25 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * NEWS: Added entry for r56624.
-
-Sun Nov 6 15:53:03 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * configure.in (-Wno-maybe-uninitialized): gcc 6 also shows the same
- warnings as described in r49410.
-
-Sun Nov 6 14:42:50 2016 takkanm <takkanm@gmail.com>
-
- * eval.c (rb_mod_include, rb_mod_prepend): check if arguments are
- given, as well as Kernel#extend. [ruby-dev:49854] [Bug #12887]
- [Fix GH-1470]
-
-Sun Nov 6 11:59:05 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast,
- test_make_socket_ipv6_multicast_hops): skip if IPv6 multicast
- address is not available.
-
-Sun Nov 6 11:53:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/irb.rb (Binding#irb): new method like Binding#pry.
-
-Sun Nov 6 11:48:55 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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 Nov 6 11:49:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/irb.rb (IRB::Irb#run): split from IRB.start.
-
-Sun Nov 6 11:45:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/e2mmap.rb (E2MM.def_exception): remove old definition if
- exists so that works multiple times.
-
-Sun Nov 6 10:03:00 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_optimization.rb (test_tailcall_interrupted_by_sigint):
- don't use sleep to run faster.
-
-Sun Nov 6 09:58:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_exec_fillarg): honor the given path environment
- variable. [ruby-core:53103] [Bug #8004]
-
-Sun Nov 6 01:52:31 2016 Akira Matsuda <ronnie@dio.jp>
-
- * lib/erb.rb: Alias regist_scanner to register_scanner
-
-Sun Nov 6 01:39:36 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * compile.c (tailcallable_p): disable tail call optimization for
- toplevel, eval, and load to avoid SEGV when interrupted by SIGINT.
- [ruby-core:76327] [Bug #12576]
-
-Sun Nov 6 01:28:41 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
- [Bug #12527]
-
- * vm_exec.c: ditto.
-
-Sun Nov 6 00:25:11 2016 Sho Hashimoto <sho.hsmt@gmail.com>
-
- * enumerator.c (InitVM_Enumerator): Enumerator::Lazy#chunk_while
- defined. [Fix GH-1186]
- https://github.com/ruby/ruby/pull/1186
-
-Sun Nov 6 00:22:51 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * vm_eval.c (vm_call0_cfunc_with_frame): pass method id to
- dtrace hook. follow up r56592.
-
-Sun Nov 6 00:06:38 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::LOC::Coord.create): fixed.
- [ruby-core:72567] [Bug #11912] fixed by Eric Wong and Kazuhiro
- NISHIYAMA.
-
-Sun Nov 6 00:03:09 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (-Wimplicit-fallthrough): gcc7 introduces case
- fall through warnings but it is too noisy.
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652
-
-Sat Nov 5 23:58:32 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * numeric.c (rb_int_round): cast to SIGNED_VALUE to suppress
- warnings by -Wsign-compare.
-
-Sat Nov 5 23:48:27 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * file.c (rb_home_dir_of): convert given username into filesystem
- encoding. [ruby-core:76682] [Bug #12652]
- patched by Davis Mosans
-
-Sat Nov 5 23:46:03 2016 Tanaka Akira <akr@fsij.org>
-
- * time.c (vtm_add_offset): Fix yday on last day of year.
- [ruby-core:72878] [Bug #11994] Fixed by Andrew White.
-
-Sat Nov 5 23:30:41 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP.post): new convenience method to send
- a POST request. [ruby-core:75484] [Feature #12375]
-
-Sat Nov 5 23:03:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/net/http.rb (transport_request): other than HTTPContinue
- in 1xx (HTTPInformation) also needs to continue. [Bug #12890]
-
-Sat Nov 5 22:51:06 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/time.rb (make_time): "now" argument as nil works again.
- This is broken since Ruby 2.2.
- Mathieu Jobin pointed a problem.
- https://github.com/ruby/ruby/commit/e4b05d91eb0d48fd172abf015c493bb42d755d07#commitcomment-17421387
-
-Sat Nov 5 22:50:13 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/ipaddr.rb (IPAddr#==): If coercion fails, return false
- instead of passing through the exception. [ruby-core:77451]
- [Bug #12799]
-
- * lib/ipaddr.rb (IPAddr#<=>): If coercion fails, return nil
- instead of passing through the exception. [ruby-core:77451]
- [Bug #12799]
-
-Sat Nov 5 22:11:33 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * vm_trace.c (tracepoint_attr_callee_id, rb_tracearg_callee_id):
- add TracePoint#callee_id. [ruby-core:77241] [Feature #12747]
-
- * cont.c, eval.c, gc.c, include/ruby/intern.h, insns.def, thread.c,
- vm.c, vm_backtrace.c, vm_core.h, vm_eval.c, vm_insnhelper.c, vm_trace.c: ditto.
-
- * test/ruby/test_settracefunc.rb: tests for above.
-
-Sat Nov 5 22:09:48 2016 Kazuki Tsujimoto <kazuki@callcc.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]
-
- * test/ruby/test_settracefunc.rb: change accordingly.
-
-Sat Nov 5 18:49:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_round, int_round): support round-to-nearest-even
- semantics of IEEE 754 to match sprintf behavior, and add `half:`
- optional keyword argument for the old behavior.
- [ruby-core:76273] [Bug #12548]
-
-Sat Nov 5 18:17:54 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/set.rb (Set#compare_by_identity, Set#compare_by_identity?):
- New methods. [Feature #12210]
-
-Sat Nov 5 18:17:08 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0
- Release note: https://github.com/rdoc/rdoc/blob/b825775647f62c5b525e9780a28ff2fbb1d5bf6f/History.rdoc#500--2016-11-05
-
-Sat Nov 5 17:29:06 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/resolv.rb (Resolv::DNS#extract_resources): Use each_resource
- instead of each_answer.
- [ruby-core:75461] [Bug #12372] reported by Rafael Fernandez Lopez.
-
-Sat Nov 5 17:18:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/-test-/file/fs.c (get_atime_p): Updating of file access times
- is enabled or not.
-
-Sat Nov 5 16:28:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (extract_getline_opts): extract chomp option.
- [Feature #12553]
-
-Sat Nov 5 15:58:24 2016 Sho Hashimoto <sho-h@netlab.jp>
-
- * tool/mkconfig.rb: [DOC] add rbconfig documentation.
-
-Sat Nov 5 15:42:52 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/smtp.rb (tlsconnect): support timeout for TLS handshake.
- [ruby-core:76893] [Bug #12678]
-
- * lib/net/protocol.rb (ssl_socket_connect): new method to implement
- timeout for TLS handshake.
-
- * lib/net/http.rb (connect): use Net::Protocol#ssl_socket_connect.
-
-Sat Nov 5 14:17:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (brace_body, do_body): since cmdarg_stack is saved in
- VALUE val, should restore from the same member. on big-endian
- platforms where VALUE is larger than int, it restored 0 in the
- upper word. [ruby-core:77920] [Bug #12900]
-
-Sat Nov 5 13:52:52 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * lib/shellwords.rb (Shellwords#shellsplit): Fix the handling of
- the backslash in double quotes to conform to the standard.
- [ruby-core:63807] [Bug #10055]
-
-Sat Nov 5 12:14:31 2016 Tanaka Akira <akr@fsij.org>
-
- * ext/pathname/pathname.c (Pathname#empty?): New method.
- [ruby-core:76404] [Feature #12596] Proposed by John Backus.
-
-Sat Nov 5 11:53:02 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_refinement.rb (test_refine_alias_in_subclass):
- add a test to check that alias in subclasses can be refined.
- [ruby-core:69374] [Bug #11186]
-
-Sat Nov 5 11:20:57 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * cont.c (cont_new): disable optimization if clang's version is
- 3.8.0. [ruby-core:77894] [Bug #12893]
-
-Sat Nov 5 10:07:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case.
- [ruby-core:77943] [Bug #12903]
-
-Fri Nov 4 17:52:44 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (heap_page_resurrect): do not return tomb_pages when
- page->freelist == NULL.
- [Bug #12670]
-
-Fri Nov 4 16:31:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_dtoa): round to even, instead of rounding to
- nearest. [ruby-core:77864] [Bug #12889]
-
-Fri Nov 4 15:31:00 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: Add compiler version message into rbconfig
- as RbConfig::CONFIG['CC_VERSION_MESSAGE']. [Feature #12896]
-
-Fri Nov 4 13:03:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (rb_int_digits): Fix exception message
- [ruby-core:77502] [Bug #12815]
-
-Fri Nov 4 10:51:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/pathname/pathname.c (path_hash): fix unnormalized Fixnum
- value bug on mingw/mswin.
-
-Fri Nov 4 10:35:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the
- source entry exists first, to fix error for non-existent entry.
- [ruby-core:77885] [Bug #12892]
-
-Thu Nov 3 21:45:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * ext/bigdecimal/bigdecimal.c: Import changes from ruby/bigdecimal
- repository.
-
-Thu Nov 3 15:01:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c: include sys/sysmacros.h for ArchLinux which deprecated
- use of major() and minor() in sys/types.h.
-
-Wed Nov 2 08:45:49 2016 Dmitry Gritsay <unseductable@gmail.com>
-
- * doc/extension.rdoc: set ANYARGS as arguments for func1 and func2.
-
- * doc/extension.rdoc: mention the exception object which is passed
- to func2 as the second argument. [Fix GH-1471]
-
-Wed Nov 2 07:34:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (rb_num_coerce_bit): enable bit operations with
- coercing by non-integer object. [ruby-core:77783] [Bug #12875]
-
-Tue Nov 1 01:31:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ac_cv_func_round): round(3) in x86_64-w64-mingw32
- is not accurate in an edge case. [ruby-core:77794] [Bug #12878]
-
-Mon Oct 31 17:36:04 2016 Code Ahss <aycabta@gmail.com>
-
- * test/test_forwardable.rb (TestForwardable#test_on_private_method):
- add test for [Bug #12782] [Bug #12840]
-
-Mon Oct 31 11:08:51 2016 Samuel Williams <samuel.williams@oriontransfer.co.nz>
-
- * lib/uri/generic.rb (URI::Generic#merge): merge merge0.
- [GH-1469]
-
-Sun Oct 30 15:32:43 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update
- rubygems to 2.6.8.
- Release note of 2.6.8: https://github.com/rubygems/rubygems/commit/9fb8880976f5ab998912898b091d88aa10eb1d4a
-
-Sun Oct 30 06:39:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1254.c: Fix typo. Reported by k-takata at
- https://github.com/k-takata/Onigmo/commit/ceb59cc. Thanks!
-
-Sat Oct 29 19:59:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (cond0): !-operator is a method call, no warning for
- literal in condition. [ruby-core:77801] [Bug #12881]
-
-Sat Oct 29 10:09:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): turn flip-flop in a not-operator
- into a boolean value. fix up r56315
-
-Sat Oct 29 09:39:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (vm_call0_body): follow the original class, not to
- loop the prepended module. [ruby-core:77784] [Bug #12876]
-
-Sat Oct 29 00:14:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/trans/windows-1255-tbl.rb: update mapping from 0xCA to
- U+05BA. [Feature #12877]
-
-Fri Oct 28 23:22:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend: extract transcode_tblgen method calls for libraries
- loaded by dynamically generated names, in single_byte.trans.
-
-Fri Oct 28 16:05:03 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * insns.def (opt_case_dispatch): extract float value only if the
- Float method is not redefined.
-
-Fri Oct 28 15:58:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (RB_OBJ_BUILTIN_TYPE): special-const safe
- BUILTIN_TYPE.
-
-Fri Oct 28 15:20:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (id_finite_p, id_infinite_p, id_rationalize, id_PI):
- initialize static IDs.
-
- * complex.c (FINITE_TYPE_P): extract predicate.
-
- * complex.c (rb_complex_finite_p, rb_complex_infinite_p): use
- dedicated predicates instead of switch by TYPE.
-
-Thu Oct 27 23:28:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_integer_type_p): turn into macro to help
- clang based on old gcc to eliminate CSE.
-
-Thu Oct 27 16:33:47 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (rel): check the exception and show right
- message.
-
-Thu Oct 27 14:57:33 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/socket/lib/socket.rb (UDPSocket#recvfrom_nonblock): [DOC] Remove
- a false statement "If _maxlen_ is omitted, its default value is
- 65536." maxlen, the first parameter, cannot be omitted as the method
- signature indicates. This hasn't changed ever since it was first
- implemented.
-
-Thu Oct 27 09:42:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_convert_to_integer): convert a fixable float to a
- fixnum directly without the conversion method, as well as bignum
- case.
-
- * object.c (rb_convert_to_integer): should not drop the converted
- string.
-
-Wed Oct 26 17:09:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_intern): use prefixed version macro
- RUBY_CONST_ID_CACHE.
-
-Wed Oct 26 11:28:25 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * NEWS: added several entries which (if I remember correctly) are
- added in a year.
-
-Tue Oct 25 12:54:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (mnew_internal): follow the original class, not to loop
- the prepended module. [ruby-core:77591] [Bug #12832]
-
-Mon Oct 24 10:52:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit.rb (Test::Unit::Parallel#deal): update the
- job status after a task finished, to show idling workers.
-
-Mon Oct 24 10:51:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (Init_Complex): undefine methods inherited from
- Comparable, because Complex does not have <=> method.
- [Bug #12866]
-
- * class.c (rb_undef_methods_from): undefine methods defined in
- super from klass.
-
-Mon Oct 24 10:19:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * complex.c (Init_Complex): undefine Complex#clamp, which does not
- work like other Comparable methods, because Complex does not
- have <=> method. patched by Tim Peters <zomg.tim AT gmail.com>
- in [ruby-core:77720]. [Bug #12866]
-
-Sun Oct 23 11:41:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/encoding.h: include "ruby/ruby.h" explicitly for
- enum ruby_fl_type and VALUE.
-
-Sat Oct 22 23:33:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_compile_gen): always append error message to the
- error buffer.
-
-Sat Oct 22 22:33:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_funcall1): check recursion by inverse pair, to
- fix fake infinite recursion. [ruby-core:77713] [Bug #12864]
-
-Sat Oct 22 18:52:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_compact_bang): should return nil if no elements
- is deleted. [ruby-core:77709] [Bug #12863]
-
-Sat Oct 22 10:28:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (DLDFLAGS): fallback to LDFLAGS.
- [ruby-core:72444] [Bug #11863]
-
- * configure.in (LIBRUBY_DLDFLAGS): fallback to DLDFLAGS.
-
- * configure.in (RUBY_APPEND_OPTION, RUBY_PREPEND_OPTION): expand
- the option to be appended/prepended when matching, as well as
- RUBY_APPEND_OPTIONS and RUBY_PREPEND_OPTIONS.
-
-Sat Oct 22 09:52:57 2016 Nobuyoshi Nakada <nobu@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]
-
-Fri Oct 21 16:44:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (do_opendir): retry after GC when the limit for open file
- descriptors reached.
-
-Fri Oct 21 16:06:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (open_load_file): retry after GC when the limit for open
- file descriptors reached.
-
-Fri Oct 21 11:34:17 2016 Pascal Schmid <Lechindianer@users.noreply.github.com>
-
- * string.c (rb_str_sub, rb_str_gsub): [DOC] 'backlash' should read
- 'backslash'. [Fix GH-1461]
-
-Thu Oct 20 17:02:56 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/uri/common.rb: added documentation for deprecated method.
- [Misc #11960][ruby-core:72733][ci skip]
-
-Thu Oct 20 16:57:23 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/digest/digest.c: Add documentation for Digest.
- [Feature #10452][ruby-core:66001][ci skip]
- * remove HMAC from list of digest algorithms,
- * add MD5 in list of digest algorithms,
- * add information about writing a C digest implementation using Digest::Base,
- * add documentation for Digest::Base public methods.
- * ext/digest/md5/md5init.c: add examples for MD5.
- * ext/digest/rmd160/rmd160init.c: add examples for Digest::RMD160.
- * ext/digest/sha1/sha1init.c: add examples for Digest::SHA1.
-
-Thu Oct 20 16:19:51 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/open-uri.rb: Improved documentation grammar for
- open-uri#open option. [Misc #11329][ruby-core:69868][ci skip]
-
-Wed Oct 19 21:48:40 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention refinements with Kernel#send and
- BasicObject#__send__. [Feature #11476]
-
-Wed Oct 19 17:02:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_call_opt_send): enable refinements with
- Kernel#send and BasicObject#__send__. [Feature #11476]
-
-Wed Oct 19 14:22:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * basictest/runner.rb: do not clobber the option by --run-opt with
- RUBYOPT. reported by Allen Hewes <rallenh AT hotmail.com>.
-
-Wed Oct 19 00:09:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * addr2line.c (parse_debug_line_cu): boundary checks for
- compressed debug sections. [ruby-dev:49840] [Bug #12850]
-
-Tue Oct 18 16:36:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (DLDFLAGS): append --compress-debug-sections=zlib
- if available, which reduces the size of LIBRUBY_SO by half or
- more.
-
-Mon Oct 17 16:20:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/configure.bat: add option to enable/disable to install
- static ruby library. defaulted to "no". [Feature #12845]
-
- * configure.in (install-static-library): add option to enable/
- disable to install static ruby library. defaulted to "no" if
- enable-shared. [Feature #12845]
-
- * tool/rbinstall.rb (local-arch-lib): respect the option.
-
-Sun Oct 16 15:09:06 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1254.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1254.
-
-Sat Oct 15 14:17:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_args.c (refine_sym_proc_call): search and call method with
- refinements.
-
- * vm_args.c (vm_caller_setup_arg_block): enable refinements when
- enabled in the caller. [Feature #9451]
-
-Sat Oct 15 00:54:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (proc_exec_cmd): use UTF-8 version aspawn.
- [ruby-dev:49838] [Bug #12841]
-
-Fri Oct 14 22:26:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse/kwargs.rb (OptionParser#define_by_keywords):
- [EXPERIMENTAL] extract command line option definitions from the
- information of keyword arguments.
-
-Fri Oct 14 18:27:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * object.c: Improve documentation for Float conversion.
- [ruby-core:71661][Bug #11736][ci skip]
-
-Fri Oct 14 18:00:20 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/logger.rb: Improve Logger.new option documentation.
- [Feature #12803][ruby-core:77467]
-
-Fri Oct 14 17:20:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (make_switch, parse_in_order): unify underscores
- to hyphens.
-
-Fri Oct 14 10:48:37 2016 Eric Wong <e@80x24.org>
-
- * lib/webrick/utils.rb (TimeoutHandler): use monotonic clock
- (watch): ditto
-
-Thu Oct 13 19:41:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (copy_stream_body): use IO to write to copy to duplex IO.
- http://twitter.com/knu/status/786505317974585344
-
-Thu Oct 13 17:05:57 2016 Dwain Faithfull <dwfaithfull@gmail.com>
-
- * hash.c (rb_hash_compact, rb_hash_compact_bang): Removes nil
- values from the original hash, to port Active Support behavior.
- [Feature #11818]
-
-Thu Oct 13 11:35:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_sort_bang, rb_ary_sort, rb_ary_sort_by_bang):
- [DOC] describe that sort may not be stable.
-
- * enum.c (enum_sort, enum_sort_by): ditto.
-
-Thu Oct 13 11:31:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/rexml/xpath/test_text.rb (test_ancestors): Array#sort may
- not be stable. [ruby-core:76088] [Bug #12509]
-
- * test/rss/test_maker_{0.9,1.0,2.0}.rb (test_items): ditto.
-
-Thu Oct 13 10:37:31 2016 Eric Wong <e@80x24.org>
-
- * doc/extension.rdoc: wording fix
-
-Thu Oct 13 00:39:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/test_array.rb (test_sort_bang_with_freeze): make a
- clone to copy a <=> singleton method, instead of dup. which
- element will be called is not predictable.
- [ruby-core:76088] [Bug #12509]
-
-Thu Oct 13 00:21:27 2016 Simon Soriano <simon0191@gmail.com>
-
- * doc/extension.rdoc: Replace "You can defined hooked variables"
- with "You can define hooked variables". [Fix GH-1460]
-
-Wed Oct 12 21:05:50 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (open_load_file): revert r56385. it introduced incompatibility
- about `DATA.binmode?`.
-
-Wed Oct 12 15:24:53 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * tool/downloader.rb: Removed verification of gem certification.
- Because signed gem is not working on rubygems ecosystem.
- * tool/gem-unpack.rb: ditto.
-
-Tue Oct 11 22:08:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (prep_io): fix typo of struct member name.
- [ruby-core:77550] [Bug #12829]
-
-Tue Oct 11 16:45:24 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/uri/generic.rb (URI.find_proxy): Add an optional argument, env.
-
-Tue Oct 11 16:38:32 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/pp.rb (String#pretty_print): Defined to print a string as
- multiple lines.
- [ruby-core:76800] [Feature#12664] proposed by Petr Chalupa.
-
-Mon Oct 10 15:22:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (open_load_file): bind the open fd to an IO instance
- before waiting FIFO, not to leak the fd if interrupted.
-
-Mon Oct 10 12:40:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (open_load_file): compare with EXEEXT instead of hard
- coded name, and do not match with mere EXEEXT.
-
- * ruby.c (open_load_file): open in binary mode if available, as
- parser deals with EOLs.
-
- * io.c (prep_io): reduce isatty call (and its system call) on
- Cygwin.
-
-Sun Oct 9 23:05:53 2016 Prathamesh Sonpatki <csonpatki@gmail.com>
-
- * array.c, class.c: Fixed documentation where Fixnum was referred
- directly to use Integer, as Fixnum and Bignum are now unified
- into Integer and direct usage is deprecated. [Fix GH-1459]
-
-Sun Oct 9 11:37:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (VM_ASSERT): stringify expr here before expansion in
- RUBY_ASSERT_WHEN.
-
-Sat Oct 8 10:54:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/memory_status/memory_status.c (read_status): use
- Win32 GetProcessMemoryInfo API.
-
- * ext/-test-/memory_status/memory_status.c: get memory sizes by
- mach task_info system call.
-
-Sat Oct 8 09:06:55 2016 Aurelien Jacobs <aurel@gnuage.org>
-
- * 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 Oct 7 20:21:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_prof_setup_new_record): fix the condition to get
- rusage.
-
- * gc.c (gc_profile_dump_major_reason): remove undefined flags.
-
-Fri Oct 7 19:18:33 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/*.c, ext/win32ole/win32ole.h: use RB_INT2FIX instead of
- INT2FIX, and so on.
-
-Fri Oct 7 14:18:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * basictest/test.rb: Adjust spaces in class declarations
- with inheritance. [fix GH-1227] Patch by @adrfer
- * lib/irb/*: ditto.
- * lib/prime.rb: ditto.
- * lib/shell/builtin-command.rb: ditto.
- * object.c: ditto.
- * sample/*.rb: ditto.
- * test/-ext-/method/test_arity.rb: ditto.
-
-Thu Oct 6 17:29:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_require_safe): SyntaxError created by the parser just
- has the message and needs to set up the backtrace.
- [ruby-core:77491] [Bug #12811]
-
- * load.c (rb_load_internal0): load/require is not the main
- script.
-
-Thu Oct 6 13:35:15 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * enum.c: [DOC] Improve doc [ci-skip]
-
-Thu Oct 6 11:38:14 2016 Chris Jones <chris@christopherjones.us>
-
- * ext/readline/extconf.rb: Update error message with correct words.
- [fix GH-1453][ci skip] Patch by @magikid
-
-Thu Oct 6 11:01:49 2016 Tieg Zaharia <tieg.zaharia@gmail.com>
-
- * lib/uri/common.rb (WEB_ENCODINGS_): Update URI::WEB_ENCODINGS_
- hash, and fix documented command to grab it. [Fix GH-1430]
-
-Thu Oct 6 10:37:13 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * enum.c: Add reduce/inject alias note.
- [fix GH-1400][ci skip] Patch by @getaaron
-
-Thu Oct 6 10:30:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (update_coverage): check coverage values, and ignore
- non-fixnum values.
-
-Thu Oct 6 09:19:21 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (fptr_finalize): use dedicated macro RB_INTEGER_TYPE_P.
-
-Wed Oct 5 18:02:44 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http/response.rb: Improve document readability.
- [fix GH-1411][ci skip] Patch by @stz-seongheon
-
-Wed Oct 5 15:43:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (dump_node): flatten statements in NODE_BLOCK.
-
-Wed Oct 5 14:27:36 2016 Byron Bowerman <me@bm5k.com>
-
- * range.c: Add docs for max/min behavior with exclusive range.
- [fix GH-1433][ci skip] Patch by @BM5k
-
-Wed Oct 5 12:57:21 2016 Richard Schneeman <richard.schneeman+foo@gmail.com>
-
- * ext/socket/*.c: Add proper require for example to work.
- [fix GH-1378][ci skip] Patch by @schneems
-
-Wed Oct 5 11:47:19 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * io.c: Fixed equivalent ruby code with core implemention.
- [fix GH-1429][ci skip] Patch by @sos4nt
-
-Wed Oct 5 11:36:21 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/delegate.rb: Added missing spaces and Removed needless spaces.
- [fix GH-1454][ci skip] Patch by @bogdanvlviv
-
-Wed Oct 5 03:24:55 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * enum.c: Make Enumerable#chunk with no block return
- an Enumerator [#2172]
-
-Wed Oct 5 01:19:45 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * internal.h (ST2FIX): new macro to convert st_index_t to Fixnum.
- a hash value of Object might be Bignum, but it causes many troubles
- especially the Object is used as a key of a hash. so I've gave up
- to do so.
-
- * array.c (rb_ary_hash): use above macro.
-
- * bignum.c (rb_big_hash): ditto.
-
- * hash.c (rb_obj_hash, rb_hash_hash): ditto.
-
- * numeric.c (rb_dbl_hash): ditto.
-
- * proc.c (proc_hash): ditto.
-
- * re.c (rb_reg_hash, match_hash): ditto.
-
- * string.c (rb_str_hash_m): ditto.
-
-Tue Oct 4 12:59:44 2016 Koichi ITO <koic.ito@gmail.com>
-
- * array.c (rb_ary_dig): [DOC] update an example of error message
- by Array#dig, because of Integer Unification. [Fix GH-1455]
-
-Tue Oct 4 09:55:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): need more room
- for precision to round. [ruby-core:77475] [Bug #12805]
-
-Tue Oct 4 06:05:46 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regcomp.c (onig_print_compiled_byte_code): make the shown address
- look relative.
-
-Tue Oct 4 05:53:11 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regexec.c (OPCODE_EXEC_HOOK): op is p-1 because p is already
- incremented.
-
- * regexec.c (OPCODE_EXEC_HOOK): use the exact end address.
-
- * regexec.c (match_at): don't call OPCODE_EXEC_HOOK in CASE()
- when it comes from goto fail.
-
-Mon Oct 3 21:24:41 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention Readline.quoting_detection_proc{,=}.
-
-Mon Oct 3 21:19:46 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/logger.rb: [DOC] Fix default value of shift_age.
-
-Mon Oct 3 17:20:05 2016 George Brocklehurst <ruby@georgebrock.com>
-
- * ext/readline/readline.c (readline_s_set_quoting_detection_proc):
- support rl_char_is_quoted_p. [Feature #12659]
-
- * ext/readline/readline.c (readline_s_get_quoting_detection_proc):
- ditto.
-
-Sun Oct 2 08:22:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RB_INT2FIX, RB_LONG2FIX): prefix RB to
- global symbols to get rid of name conflicts with other headers.
-
-Sun Oct 2 07:51:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_hash_m): hash values may be negative.
-
-Sun Oct 2 02:04:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * string.c (rb_str_hash_m): st_index_t is not guaranteed as the same
- size with int, and of course also not guaranteed the value can be
- Fixnum.
-
-Sun Oct 2 02:03:06 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * numeric.c (rb_fix2str): detect unnormalized Fixnum value.
-
-Sat Oct 1 23:08:47 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/date/date_parse.c (date_zone_to_diff): it's nonsence and really
- harm that to use unary minus operator with unsigned value.
- get rid of test failures introduced at r56312.
-
-Sat Oct 1 22:17:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_compile_each): move numeric literal range
- optimization from fixup_nodes() in parse.y.
-
-Sat Oct 1 19:19:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (compile_flip_flop): simplify generated code.
-
- * compile.c (compile_branch_condition): flip-flop can appear only
- in conditional expressions.
-
-Sat Oct 1 02:02:02 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
- errno internally, then should not set it here.
-
-Fri Sep 30 19:06:21 2016 Anton Davydov <mail@davydovanton.com>
-
- * lib/uri/http.rb: Documentation and code style improvements.
- * test/uri/test_http.rb: Added test for coverage.
- [fix GH-1427][ruby-core:77255][Misc #12756]
-
-Fri Sep 30 18:43:20 2016 Jason Yeo <jason@jasonyeo.me>
-
- * doc/syntax/control_expressions.rdoc: Add missing 'as'
- [ci skip][fix GH-1448] Patch by @jsyeo
-
-Thu Sep 29 23:38:04 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/yaml/store.rb (YAML::Store#dump): use table argument instead
- of @table directly.
-
-Thu Sep 29 22:22:22 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/yaml/store.rb (YAML::Store#initialize): Fix arguments.
- [ruby-dev:49821] [Bug #12800]
-
- * test/yaml/test_store.rb: Add tests from test/test_pstore.rb.
-
- * test/yaml/test_store.rb (YAMLStoreTest#test_with_options): Add options test.
-
- * lib/yaml/store.rb (YAML::Store#dump): Revert to to_yaml.
-
- * lib/yaml/store.rb (YAML::Store#empty_marshal_data): Use to_yaml with options.
-
- * lib/yaml/store.rb (YAML::Store#empty_marshal_checksum): Use CHECKSUM_ALGO.
-
-Thu Sep 29 19:34:23 2016 Pete Higgins <pete@peterhiggins.org>
-
- * thread_sync.c (rb_queue_pop, rb_szqueue_push, rb_szqueue_pop):
- Document exception types, ThreadError, raised by Queue and
- SizedQueue. [Fix GH-1451]
-
-Thu Sep 29 19:21:02 2016 Pete Higgins <pete@peterhiggins.org>
-
- * thread_sync.c (Init_thread_sync): Remove confusing doc comments,
- which are picked up by rdoc unexpectedly, from Queue and
- SizedQueue. [Fix GH-1450]
-
-Wed Sep 28 23:14:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pstore.rb (PStore::CHECKSUM_ALGO): find available hashing
- algorithm for checksum. MD5 is not available in FIPS mode.
- [Feature #6943]
-
-Wed Sep 28 13:00:25 2016 ksss <co000ri@gmail.com>
-
- * signal.c (sig_signame): [DOC] Add documentation in the case of
- return nil. [Fix GH-1449]
-
-Wed Sep 28 10:43:27 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * .travis.yml: delete comments. They were outdated.
-
-Wed Sep 28 09:57:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update
- rubygems to 2.6.7.
- Release note of 2.6.7: https://github.com/rubygems/rubygems/commit/60f35bd1d2359fc30301d2d4cd72bc6833e8d12a
-
-Wed Sep 28 00:21:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_warning_s_warn): the argument must be an
- ASCII-compatible string. [ruby-core:77430] [Bug #12793]
-
-Tue Sep 27 23:22:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (symbol, dsym, parser_set_number_literal): set state to
- ENDARG, so that `do` after a literal should be `do_block` and
- bound to the outer method. [ruby-core:72482] [Bug #11873]
-
- * parse.y (parse_ident): revert r56198.
-
- * parse.y (warn_balanced): the state of symbol and numeric
- literals is now EXPR_ENDARG, do not exclude it.
-
-Tue Sep 27 22:59:42 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * NEWS: news about Warning.warn.
-
-Tue Sep 27 18:10:18 2016 Jeremy Evans <code@jeremyevans.net>
-
- * error.c: This makes all warnings raised call Warning.warn, which
- by default does the same thing it does currently
- (rb_write_error_str). You can override Warning.warn to change
- the behavior. [ruby-core:75016] [Feature #12299]
-
-Tue Sep 27 17:35:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (iseqw_s_compile_file): deal with syntax error as well as
- compile, and should not abort when rescued.
-
-Tue Sep 27 12:07:17 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]
-
- * lib/webrick/cookie.rb (parse): ditto.
-
-Mon Sep 26 21:37:21 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * man/erb.1, man/irb.1, man/ri.1, man/ruby.1: Remove Ns before
- punctuation.
-
-Mon Sep 26 16:23:49 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/stringio/stringio.c (strio_seek): Avoid signed integer overflow.
- It's not harmful in practice here, but is still undefined behavior.
-
- * ext/stringio/stringio.c (strio_extend): Check that the new length does
- not exceed LONG_MAX. This fixes the invalid write on the overflow.
-
- * test/stringio/test_stringio.rb (test_write_integer_overflow): Add a
- test case for the above fix in strio_extend().
-
-Mon Sep 26 15:43:34 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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]
-
- * test/ruby/test_exception.rb (test_throw_false): Add a test case for
- this.
-
-Mon Sep 26 14:36:12 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/tempfile.rb: provide default basename parameter for
- Tempfile.create. [Feature #11965] Patch by Yuki Kurihara
- * test/test_tempfile.rb: ditto.
-
-Mon Sep 26 14:10:54 2016 Ary Borenszweig <ary@esperanto.org.ar>
-
- * string.c (lstrip_offset): add a fast path in the case of single
- byte optimizable strings, as well as rstrip_offset.
- [ruby-core:77392] [Feature #12788]
-
-Mon Sep 26 12:00:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gems/bundled_gems: update to minitest-5.9.1.
-
-Mon Sep 26 11:50:03 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * tool/rbinstall.rb (gem): Don't install gemspec if no files will be
- installed for the gem. This happens when the extension library is not
- compiled.
-
-Mon Sep 26 11:06:47 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * string.c (enc_strlen, rb_enc_strlen_cr): Avoid signed integer
- overflow. The result type of a pointer subtraction may have the same
- size as long. This fixes String#size returning an negative value on
- i686-linux environment:
-
- str = "\x00" * ((1<<31)-2))
- str.slice!(-3, 3)
- str.force_encoding("UTF-32BE")
- str << 1234
- p str.size
-
-Sun Sep 25 22:48:06 2016 namusyaka <namusyaka@gmail.com>
-
- * lib/erb.rb (ERB::Compiler::TrimScanner#stag): The :stag accessor
- has already been available because it is defined in parent
- Scanner class. [Fix GH-1445]
-
-Sun Sep 25 19:21:26 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * node.c (dump_array): remove duplicate header of NODE_ARRAY/
- NODE_VALUES.
-
-Sat Sep 24 22:26:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extract_makefile, extmake, configuration): store
- extra libraries to be installed.
-
- * tool/rbinstall.rb (ext-arch): install extra libraries.
-
- * ext/zlib/extconf.rb: install zlib if built.
-
-Sat Sep 24 14:24:55 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * spec/README: update URL.
-
-Sat Sep 24 11:28:22 2016 Koichi ITO <koic.ito@gmail.com>
-
- * fix typos, "a" before "Integer" to "an". [Fix GH-1438]
-
-Sat Sep 24 10:19:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/misc/test_ruby_mode.rb (assert_indent): since write-region
- in Emacs 25.1 no longer displays the "Wrote file" message, shows
- the explicit message to check if successfully finished.
- [ruby-core:77355] [Bug #12785]
-
- * test/misc/test_ruby_mode.rb (EXPR_SAVE): use a numeric prefix
- argument of 0, not to make the previous version into a backup
- file, instead of backup-inhibited.
-
- * test/misc/test_ruby_mode.rb (run_emacs): always save the buffer
- if modified.
-
-Fri Sep 23 23:57:40 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_method.c (make_method_entry_refined): fix wrong use of ||.
-
-Fri Sep 23 21:38:58 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * tool/mdoc2man.rb (Mdoc2Man#parse_macro): Add support for the
- `Lk` macro.
-
- * tool/mdoc2man.rb (Mdoc2Man#shift_arg): A new function to extract
- a possibly quoted argument.
-
-Fri Sep 23 20:36:05 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * eval.c (rb_mod_refine): refine modules as well.
- [ruby-core:76199] [Feature #12534]
-
-Fri Sep 23 20:19:09 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * man/ruby.1: Update the paragraphs in "Rich Libraries" which
- included a dead link.
-
-Fri Sep 23 20:05:27 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * man/ruby.1, man/erb.1, man/irb.1, man/ri.1: Use the `Lk` macro
- for hyperlinks, which has been available since mdocml 1.5.1
- (released more than seven years ago).
-
-Fri Sep 23 15:47:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/forwardable.rb (_delegator_method): allow private methods to
- be delegated, with warnings. [ruby-core:77341] [Bug #12782]
-
-Fri Sep 23 12:15:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_peephole_optimize): enable tail call
- optimization inside a conditional block.
-
-Thu Sep 22 13:00:04 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * gc.c (gc_start_internal): [DOC] methods without arguments
- like r56194. [Bug #12777]
-
-Wed Sep 21 17:43:53 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * process.c (InitVM_process): Support CLOCK_MONOTONIC_RAW_APPROX,
- CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced
- by macOS 10.12.
-
-Wed Sep 21 13:47:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (brace_body, do_body): preserve cmdarg_stack so that
- `do` after cmdarg in a block should be `do_block` and bound to
- the outer method. [ruby-core:72482] [Bug #11873]
-
- * parse.y: `do` after cmdarg in parentheses should be `do_block`
- and bound to the outer method. [ruby-core:72482] [Bug #11873]
-
- * parse.y (brace_body, do_body): extract block bodies.
-
-Tue Sep 20 23:02:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (gc_start_internal): [DOC] add ObjectSpace.garbage_collect
- and fix GC#garbage_collect. [Bug #12777]
-
-Tue Sep 20 21:24:01 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * doc/extension.ja.rdoc: translate r56189 (rb_gc_adjust_memory_usage).
-
-Tue Sep 20 17:52:28 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: Update rake-11.3.0
-
-Tue Sep 20 16:52:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (rb_gc_adjust_memory_usage): notify memory usage to the GC
- engine by extension libraries, to trigger GC. [Feature #12690]
-
-Mon Sep 19 17:05:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (Init_Numeric), bignum.c (Init_Bignum): deprecate
- Fixnum and Bignum. this may be reverted after previews.
- [Feature #12739]
-
-Mon Sep 19 10:36:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (lazy_init_yielder): directly call stored functions.
- [Feature #6183]
-
- * enumerator.c (lazy_add_method): create lazy enumerator which
- uses lazy_init_yielder().
-
-Sun Sep 18 22:48:54 2016 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/rss/rss.rb (RSS::BaseModel): Remove needless codes.
- [Bug #12773][ruby-dev:49813]
- Reported by Kazuhiro NISHIYAMA. Thanks!!!
-
-Sun Sep 18 19:23:47 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * lib/sync.rb: Fix NameError when error.
-
-Sat Sep 17 22:46:02 2016 Koichi ITO <koic.ito@gmail.com>
-
- * vm_insnhelper.c (vm_throw_start): Remove too much ";"
- [fix GH-1432]
-
-Sat Sep 17 19:19:06 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/openssl/test_ssl.rb (test_ctx_options): Fix test failure on
- Ubuntu 16.04. The fix in r56147 was incomplete. This is a cherry-pick
- of the commit b039f3e268c2 at ruby/openssl.
-
-Sat Sep 17 10:49:35 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * doc/extension.ja.rdoc: translate r56130 (rb_check_arity).
-
-Sat Sep 17 02:40:52 2016 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * ext/objspace/objspace_dump.c: Fix stream processing support for heap
- dumps. Full heap dumps should use JSON lines (http://jsonlines.org)
- so that we can process very large heaps without loading the entire
- heap dump in to memory at once.
-
-Fri Sep 16 22:10:31 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * ext/openssl/ossl_ssl.c (ssl_npn_select_cb_common): Fix compile error
- with old version of fcc (Fujitsu C Compiler) on Solaris 10.
- [Bug #12769] [ruby-dev:49809]
-
-Fri Sep 16 21:28:25 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * internal.h (MAYBE_UNUSED): The fallback definition is needed.
- Fix compile error with some non-GCC compilers such as
- Oracle Solaris Studio 12.3 on Solaris 10.
- [Bug #12767] [ruby-dev:49807]
-
- * internal.h (WARN_UNUSED_RESULT): ditto.
-
-Fri Sep 16 21:19:51 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * hash.c (each_pair_i_fast): Fix compile error with old version of
- fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]
-
-Fri Sep 16 19:46:05 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (config.h): fixed compile error with VC introduced
- by previous commit.
-
-Fri Sep 16 14:54:34 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * internal.h (WARN_UNUSED_RESULT): moved to configure.in, to
- actually check its availability rather to check GCC's version.
-
- * configure.in (WARN_UNUSED_RESULT): moved to here.
-
- * configure.in (RUBY_FUNC_ATTRIBUTE): change function declaration
- to return int rather than void, because it makes no sense for a
- warn_unused_result attributed function to return void.
-
- Funny thing however is that it also makes no sense for noreturn
- attributed function to return int. So there is a fundamental
- conflict between them. While I tested this, I confirmed both
- GCC 6 and Clang 3.8 prefers int over void to correctly detect
- necessary attributes under this setup. Maybe subject to change
- in future.
-
- * internal.h (UNINITIALIZED_VAR): renamed to MAYBE_UNUSED, then
- moved to configure.in for the same reason we move
- WARN_UNUSED_RESULT.
-
- * configure.in (MAYBE_UNUSED): moved to here.
-
- * internal.h (__has_attribute): deleted, because it has no use now.
-
- * string.c (rb_str_enumerate_lines): refactor macro rename.
-
- * string.c (rb_str_enumerate_bytes): ditto.
-
- * string.c (rb_str_enumerate_chars): ditto.
-
- * string.c (rb_str_enumerate_codepoints): ditto.
-
- * thread.c (do_select): ditto.
-
- * vm_backtrace.c (rb_debug_inspector_open): ditto.
-
- * vsnprintf.c (BSD_vfprintf): ditto.
-
-Fri Sep 16 14:35:55 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * ChangeLog (add-log-time-format): Not exactly sure when but
- recently (25.x maybe), emacs changed its API to take optional
- two arguments. We have to follow that.
-
-Fri Sep 16 06:43:25 2016 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * lib/uri/generic.rb (def check_password): don't include bad password
- in URI exception output
-
- * test/uri/test_generic.rb (def test_set_component): test for behavior
-
-Thu Sep 15 21:40:03 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * doc/extension.ja.rdoc: Fix file name.
-
-Thu Sep 15 00:59:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * benchmark/: add vnmakarov's benchmarks around hash [ruby-core:75265]
-
-Wed Sep 14 07:02:31 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * hash.c (each_pair_i_fast): use rb_yield_values2 to avoid var args.
-
-Tue Sep 13 21:32:54 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * string.c (STR_HEAP_SIZE, RESIZE_CAPA_TERM, str_new0, rb_str_buf_new,
- str_shared_replace, rb_str_init, str_make_independent_expand,
- rb_str_resize): Avoid overflow by casting the length to size_t. size_t
- should be able to represent LONG_MAX+termlen.
-
- * string.c (rb_str_modify_expand): Check that the new length is in the
- range of long before resizing. Also refactor to use RESIZE_CAPA_TERM
- macro.
-
- * string.c (str_buf_cat): Fix so that it does not create a negative
- length String. Also fix the condition for 'string sizes too big', the
- total length can be up to LONG_MAX.
-
- * string.c (rb_str_plus): Check the resulting String length does not
- exceed LONG_MAX.
-
- * string.c (rb_str_dump): Fix integer overflow. The dump result will be
- longer then the original String.
-
-Tue Sep 13 21:30:53 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow,
- gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed
- value is size_t, not ssize_t.
-
- * iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto.
-
- * sprintf.c (rb_str_format): Ditto.
-
- * thread_win32.c (native_thread_create): Ditto.
-
- * vm.c (get_param): Ditto.
-
- * ext/objspace/objspace_dump.c (dump_append_string_content,
- dump_object): Ditto.
-
- * ext/socket/raddrinfo.c (host_str, port_str): Ditto.
-
-Tue Sep 13 21:27:35 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * string.c (STR_EMBEDDABLE_P): Renamed from STR_EMBEDABLE_P(). And use
- it in more places.
-
-Tue Sep 13 21:23:51 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * README.md: Drop support for BeOS now that Haiku is stable since
- 2.3.0.
-
- * README.ja.md: ditto.
-
-Tue Sep 13 21:11:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (STR_EMBEDABLE_P): extract the predicate macro to tell
- if the given length is capable in an embedded string, and fix
- possible integer overflow.
-
-Tue Sep 13 18:37:08 2016 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_exception.rb: fix thread issues.
- * use Queue instead of a local variable for synchronization.
- * join created thread to solve leaking threads warning.
-
-Tue Sep 13 16:07:26 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * string.c (rb_str_set_len): The buffer overflow check is wrong. The
- space for termlen is allocated outside the capacity returned by
- rb_str_capacity(). This fixes r41920 ("string.c: multi-byte
- terminator", 2013-07-11). [ruby-core:77257] [Bug #12757]
-
- * test/-ext-/string/test_set_len.rb (test_capacity_equals_to_new_size):
- Test for this change. Applying only the test will trigger [BUG].
-
-Tue Sep 13 06:03:34 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (benchmark): fix lib path.
-
-Tue Sep 13 00:39:47 2016 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * class.c (singleton_class_of): Copy superclass serial number to
- singleton class. This improves singleton class IMC hit rates.
- [Feature #12364] [ruby-core:75425]
-
-Mon Sep 12 13:46:23 2016 Anton Davydov <mail@davydovanton.com>
-
- * lib/uri/mailto.rb: Removed needless `return` and use `.` instead of `::`
- with class method.
- * test/uri/test_mailto.rb: Added tests for coverage.
- [fix GH-1426][Misc #12750][ruby-core:77242]
-
-Sun Sep 11 21:30:26 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: News about Module.used_modules.
-
-Sun Sep 11 19:06:49 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write_console): should set written length as the
- return value. [Bug #12748] [ruby-dev:49786]
-
-Fri Sep 9 22:43:29 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * gems/bundled_gems: sort lines.
-
-Fri Sep 9 17:59:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_threadptr_raise): set cause from the called thread,
- but not from the thread to be interrupted.
- [ruby-core:77222] [Bug #12741]
-
-Fri Sep 9 13:50:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * doc/extension.rdoc, doc/extension.ja.rdoc: fix file name.
- pointed out by @takkanm in the RubyKaigi talk.
-
-Fri Sep 9 13:14:53 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * News: Announcing update to Unicode version 9.0.0 [ci skip]
-
-Fri Sep 9 10:10:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_const_search): warn with the actual class/module
- name which defines the deprecated constant.
-
- * variable.c (rb_const_search): raise with the actual class/module
- name which defines the private constant.
-
-Thu Sep 8 17:47:18 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * 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 Sep 8 17:40:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb (gem): use the bindir of each gemspec instead
- of hardcoded 'bin', since rdoc 5.0.0 overrides it.
-
-Thu Sep 8 16:47:03 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * eval.c (rb_mod_s_used_modules): rename Module.used_refinements to
- Module.used_modules. [Feature #7418] [ruby-core:49805]
-
-Thu Sep 8 14:21:48 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/psych.gemspec, lib/rdoc/rdoc.gemspec: Use file list instead of
- git output. It shows warning message when invoke `make install`
- [Bug #12736][ruby-dev:49778]
-
-Thu Sep 8 13:41:46 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * insns.def (setclassvariable, setconstant): warn when self is a
- refinement. [Bug #10103] [ruby-core:64143]
-
-Thu Sep 8 11:29:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * hash.c (rb_hash_transform_values, rb_hash_transform_values_bang):
- Rename map_v to transform_values.
- [Feature #12512] [ruby-core:76095]
-
- * test/ruby/test_hash.rb: ditto.
-
-Thu Sep 8 10:08:35 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * {ext,test}/openssl: Import Ruby/OpenSSL 2.0.0.beta.2. The full commit
- history since v2.0.0.beta.1 can be found at:
- https://github.com/ruby/openssl/compare/v2.0.0.beta.1...v2.0.0.beta.2
-
-Thu Sep 8 07:23:34 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0.beta2
- Fixed ri parse defect with left-hand matched classes.
- https://github.com/rdoc/rdoc/pull/420
-
-Thu Sep 8 01:12:47 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * eval.c (rb_mod_s_used_refinements): new method
- Module.used_refinements. based on the patch by Charlie
- Somerville. [Feature #7418] [ruby-core:49805]
-
-Wed Sep 7 17:50:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/util.h (setenv): remove POSIX-noncompliant
- definition with 2 arguments.
-
-Wed Sep 7 17:35:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * unicode/8.0.0/casefold.h, name2ctype.h, unicode/data/8.0.0:
- removing directories/files related to Unicode version 8.0.0
-
-Wed Sep 7 17:21:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/timeout.rb (Timeout#timeout): add custom error message
- argument. [Feature #11650]
-
-Wed Sep 7 17:13:05 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Updated Unicode version to 9.0.0 [Feature #12513]
-
- * unicode/9.0.0/casefold.h, name2ctype.h, unicode/data/9.0.0:
- new directories/files for Unicode version 9.0.0
-
-Wed Sep 7 16:00:45 2016 Tanaka Akira <akr@fsij.org>
-
- * lib/open-uri.rb: Allow http to https redirection.
- Note that https to http is still forbidden.
- [ruby-core:20485] [Feature #859] by Roman Shterenzon.
-
-Wed Sep 7 14:56:59 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * lib/csv.rb (CSV::{Row,Table}#{each,delete_if}): returns an enumerator
- if no block is given. [ruby-core:75346] [Feature #12347]
-
- * test/csv/test_row.rb: add test for above.
-
- * test/csv/test_table.rb: ditto.
-
-Wed Sep 7 14:50:01 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * gems/bundled_gems: update to power_assert 0.3.1.
-
-Wed Sep 7 12:16:09 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/*, test/psych/*: Update psych-2.1.1
- This version fixed following pull requests.
- https://github.com/tenderlove/psych/pull/284
- https://github.com/tenderlove/psych/pull/276
-
-Wed Sep 7 11:51:06 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0.beta1
- This version is mostly same as r56072. It contains to remove code
- for Ruby 1.8
-
-Tue Sep 6 09:23:06 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/rdoc.gemspec: partly reverted for default gem installer.
- upstream configuration is not working on ruby core repository.
-
-Mon Sep 5 19:35:22 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513)
- https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016--
- https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09
-
-Sun Sep 4 00:17:55 2016 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * proc.c: [DOC] fix Object#define_singleton_method and
- main.define_method return value. [ci skip]
-
-Sat Sep 3 11:28:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread_pthread.c (ruby_init_stack): check stack bounds even if
- get_main_stack succeeded, on the "co-routine" case.
- https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413
-
-Fri Sep 2 16:06:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (MEMO_V1_SET, MEMO_V2_SET): fix typos. use the macro
- parameter, not the local variable.
-
-Fri Sep 2 00:55:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (timestamp_file): move extmk.rb specific tricks
- from lib/mkmf.rb. keep RUBYCOMMONDIR prefix not to conflict
- with a timestamp file in the toplevel.
-
-Thu Sep 1 14:24:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (gems): move dirty hacks for bundled gems from
- mkmf.rb.
-
- * lib/mkmf.rb (create_makefile): yield all configuration strings.
-
-Wed Aug 31 17:39:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (create_makefile): make gem.build_complete file
- under TARGET_SO_DIR and install it only when the gem build
- succeeded. [ruby-core:77057] [Bug #12681]
-
-Wed Aug 31 15:36:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
-
- * lib/mkmf.rb (create_makefile): create target shared object files
- under $(TARGET_SO_DIR) which is $sodir if it is defined with
- $extout. [ruby-core:77058] [Bug #12681]
-
-Wed Aug 31 01:56:55 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * doc/extension.ja.rdoc: [DOC] Fix a typo. [ci skip]
-
-Wed Aug 31 00:52:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: make the gems target directory under the expanded
- name. [ruby-core:77102] [Bug #12714]
-
-Tue Aug 30 15:27:27 2016 Kouhei Yanagita <yanagi@shakenbu.org>
-
- * ext/json/lib/json/add/ostruct.rb (OpenStruct.json_create):
- Correct documentation, fix the name of values. [Fix GH-1421]
-
-Tue Aug 30 14:53:34 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Tue Aug 30 03:38:35 2016 NARUSE, Yui <naruse@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]
-
-Sat Aug 27 10:26:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * array.c (rb_ary_concat_multi): take multiple arguments. based
- on the patch by Satoru Horie. [Feature #12333]
-
- * string.c (rb_str_concat_multi, rb_str_prepend_multi): ditto.
-
-Thu Aug 25 00:42:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/file.c (append_wstr): remove a codepage argument, and use
- INVALID_CODE_PAGE for conversion by econv.
-
- * win32/file.c (append_wstr): exclude the terminator from the
- result length when input len == -1.
-
-Wed Aug 24 22:41:30 2016 Kouhei Sutou <kou@cozmixng.org>
-
- * gc.c (gc_reset_malloc_info): Remove too much ";".
-
-Wed Aug 24 20:07:57 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * include/ruby/defines.h (ALWAYS_INLINE): Add alternative definition.
- Fix compile error with compilers that do not have force inline
- attribute, including old version of fcc on Solaris 10.
- [ruby-dev:49773] [Bug #12701]
-
-Wed Aug 24 16:56:26 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * .gdbinit: follow r55766's VM change.
-
-Wed Aug 24 12:57:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_mod_initialize, rb_class_initialize): [DOC] these
- methods do not invoke module_eval/class_eval, just eval the
- given block under the new module/class but sharing the context
- with the surrounding scope like those methods.
- [ruby-core:77023] [Bug #12696]
-
-Tue Aug 23 10:34:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/psych/test_psych.rb (test_load_file_with_fallback): fix
- Tempfile leak. https://github.com/tenderlove/psych/pull/288
-
-Tue Aug 23 10:15:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_fs_setter): check and convert $; value at
- assignment.
-
-Tue Aug 23 02:09:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_split_m): show $; name in error message when it
- is a wrong object.
-
-Mon Aug 22 16:29:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/csv.rb (CSV#shift): store partial quoted strings in an array
- and join at last, to improve performance with very long quoted
- lines. [ruby-core:76987] [Bug #12691]
-
-Mon Aug 22 14:35:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * man/irb.1: remove useless -width option.
- [ruby-dev:49767] [Bug #12692]
-
-Mon Aug 22 09:02:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (Init_ISeq): undefine allocator of InstructionSequence,
- to get rid of segfaults at method call on uninitialized object.
-
-Sat Aug 21 05:47:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sort): prevent wasteful array duplication.
-
-Sat Aug 20 11:20:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * rubystub.c: generalize win32/stub.c.
-
-Fri Aug 19 11:39:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (primary): allow parenthesised statement as a method
- argument. [Feature #12686]
-
-Fri Aug 19 09:12:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_set_main_stack): TOPLEVEL_BINDING must be built.
- http://www.viva64.com/en/b/0414/#ID0EQ1CI [ruby-core:76973]
-
-Fri Aug 19 01:00:53 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * proc.c (mnew_missing): Remove an unused argument.
- After r51126 rid is not used.
-
-Thu Aug 18 09:26:52 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: bump to test-unit-3.2.1
-
-Thu Aug 18 02:36:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb: skip gems which failed to build extensions.
- [ruby-dev:49764] [Bug #12683]
-
-Wed Aug 17 23:35:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gems/bundled_gems (tk): bump up to 0.1.1.
-
-Wed Aug 17 23:14:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: build gem extensions into separate directories
-
- * tool/rbinstall.rb: install pre-built gem extension files gem
- extension directories. [ruby-core:76931] [Bug #12681]
-
-Tue Aug 16 21:04:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (UNICODE_HDR_DIR): separate unicode header files from
- unicode data files. [ruby-core:76879] [Bug #12677]
-
-Tue Aug 16 11:17:51 2016 Koichi ITO <koic.ito@gmail.com>
-
- * lib/net/http/header.rb: Fix typo. [ci skip][fix GH-1407]
- * transcode.c: ditto.
-
-Tue Aug 16 11:02:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/make-snapshot (package): save generated header files from
- unicode data. [ruby-core:76879] [Bug #12677]
-
-Mon Aug 15 20:31:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (dump_array): show nd_alen field in NODE_ARRAY only in
- the first node. it is nd_end in the rest nodes.
-
-Mon Aug 15 16:41:32 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * appveyor.yml: Update libressl version to 2.3.7.
-
-Mon Aug 15 11:46:50 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb (extmake): extension libraries in gems cannot link
- statically.
-
-Sun Aug 14 22:35:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id_table.c (hash_table_extend): should not shrink the table than
- the previous capacity. [ruby-core:76534] [Bug #12614]
-
-Sun Aug 14 18:51:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gems/bundled_gems: add gemified tk 0.1.0.
- this needs `extract-gems` to build.
-
-Sun Aug 14 14:54:14 2016 Kouhei Sutou <kou@cozmixng.org>
-
- * object.c (InitVM_Object): Update referenced document path.
-
-Sat Aug 13 23:08:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_funcall0, num_funcall1): get rid of infinite
- recursion in fallback methods of Numeric.
-
-Sat Aug 13 11:10:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (command_asgn, arg): fix syntax errors with chained
- assignment with op assign. [Bug #12669]
-
-Sat Aug 13 10:52:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (stmt, arg): rescue modifier in command op assignment
- should be limited to rhs only. [ruby-core:75621] [Bug #12402]
-
-Sat Aug 13 07:51:40 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_val2variant): fix integer conversion in
- cygwin64.
-
-Fri Aug 12 21:05:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/webrick/config.rb (WEBrick::Config::General):
- disable reverse lookup by default. [ruby-core:45514] [Feature #6559]
- Socket.do_not_reverse_lookup is true by default but WEBrick
- overwrote it.
- patch by Eric Hodel [ruby-core:45527]
-
-Fri Aug 12 12:50:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_syntax_error_append): fix newline in syntax error
- message to the beginning, not after file name and line number.
- [Feature #11951]
-
-Thu Aug 11 16:24:23 2016 Ferdinand Niedermann <nerdinand@nerdinand.com>
-
- * compar.c (cmp_clamp): Introduce Comparable#clamp. [Feature #10594]
-
-Thu Aug 11 03:16:59 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/prime.rb: Optimize prime?
- Adapted from patch by Jabari Zakiya [#12665]
-
- * test/test_prime.rb: Improve test
-
-Wed Aug 10 22:37:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (command_rhs, arg_rhs): introduce new rules to reduce
- repeated rules with rescue modifier.
-
-Wed Aug 10 17:26:43 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (command_asgn): rescue modifier in command assignment
- should be limited to rhs only. [ruby-core:75621] [Bug #12402]
-
-Wed Aug 10 15:35:03 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/resolv/resolv.c: needs windows.h for iphlpapi.h on
- cygwin. [ruby-core:76791] [Bug #12663]
-
- * ext/win32/resolv/resolv.c (w32error_make_error): use
- Win32::Resolv::Error, an alias of Win32::Registry::Error.
-
-Tue Aug 9 17:50:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * hash.c (rb_hash_map_v, rb_hash_map_v_bang): implement Hash#map_v and
- Hash#map_v! [Feature #12512] [ruby-core:76095]
-
- * test/ruby/test_hash.rb: add tests for above change.
-
-Tue Aug 9 16:09:03 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_insnhelper.c (vm_getivar): use always_inline because
- gcc7 doesn't inline this without always_inline.
-
-Tue Aug 9 15:41:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/tk: Tk is removed from stdlib. [Feature #8539]
- https://github.com/ruby/tk is the new upstream.
-
-Tue Aug 9 00:12:31 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * doc/maintainers.rdoc: Remove moved file section.
-
-Mon Aug 8 20:56:46 2016 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/sample/excel1.rb, ext/win32ole/sample/excel2.rb,
- ext/win32ole/sample/excel3.rb, ext/win32ole/sample/ie.rb,
- ext/win32ole/sample/ienavi.rb, ext/win32ole/sample/ienavi2.rb: use
- true instead of deprecated TRUE. [ci skip]
-
-Mon Aug 8 12:51:12 2016 Zarko Todorovski <zarko@ca.ibm.com>
-
- * internal.h (RBASIC_CLEAR_CLASS): Reroute ANSI C's strict
- aliasing rule.
- [ruby-core:74427][Bug #12191][ruby-core:76747][Bug #12657]
-
-Sun Aug 7 18:08:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (InitVM_Object): deprecate toplevel constants TRUE,
- FALSE, and NIL. [Feature #12574]
-
-Sun Aug 7 06:48:21 2016 Eric Wong <e@80x24.org>
-
- * 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]
-
-Sat Aug 6 09:35:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * id_table.h (rb_id_table_iterator_result): add dummy sentinel
- member because C standard prohibits a trailing comma.
-
-Sat Aug 6 00:39:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (env_enc_str_new): make string for an environment
- variable name or value.
-
- * hash.c (env_name_new): make environment value string with the
- encoding for its name.
-
-Fri Aug 5 23:18:35 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * hash.c (env_str_new): taint the string. get rid of a test failure
- introduced at r55811.
-
-Fri Aug 5 17:04:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (w32_getenv): call rb_w32_getenv and rb_w32_ugetenv via
- this pointer without further comparisons.
-
-Thu Aug 4 11:54:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (env_assoc): the encoding of the value should be the
- locale, as well as other methods, [], fetch, values, etc.
-
-Wed Aug 3 21:31:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_fragment_enc_error): compile_error is different
- between parser and ripper. [ruby-core:76397] [Bug #12651]
-
-Wed Aug 3 17:15:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_obj_clone2): restrict freeze option to true other
- than false which only has the effect. [Feature #12300]
-
-Wed Aug 3 10:47:07 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: introduce VM_FRAME_RUBYFRAME_P()
- and VM_FRAME_CFRAME_P().
- Most of case, RUBY_VM_NORMAL_ISEQ_P() is no
- longer needed.
-
- * vm_core.h: introduce rb_obj_is_iseq().
-
- * cont.c, vm.c: VM_FRAME_MAGIC_DUMMY with
- VM_FRAME_FLAG_CFRAME.
-
-Wed Aug 3 09:25:16 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: rename macros and make them inline functions.
-
- * rename VM_FRAME_TYPE_FINISH_P() to VM_FRAME_FINISHED_P().
- * rename VM_FRAME_TYPE_BMETHOD_P() to VM_FRAME_BMETHOD_P().
-
-Wed Aug 03 09:15:02 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: introduce VM_FRAME_FLAG_CFRAME to represent cfp->iseq
- type.
-
-Tue Aug 2 21:42:40 2016 Chia-sheng Chen <qitar888@gmail.com>
-
- * math.c (tanh): make faster by the extract form if three
- hyperbolic functions are unavailable. [Feature #12647]
-
-Tue Aug 2 12:37:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/option.c, ext/socket/rubysocket.h (inet_ntop): share
- the fallback definition. [ruby-core:76646] [Bug #12645]
-
-Tue Aug 2 04:07:29 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (set_pioinfo_extra): use more reliable way to search
- the position of pioinfo of VC14, and also support debug library of it.
- patched by davispuh AT gmail.com
- [ruby-core:76644] [Bug #12644]
- this fixes also [Bug #12631]
-
-Mon Aug 1 21:39:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: [EXPERIMENTAL] build extension libraries in
- extracted gems.
-
-Mon Aug 1 16:07:18 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * include/ruby/ruby.h (struct RStruct): no longer.
-
- * internal.h (struct RStruct): moved here.
-
- * struct.c (rb_struct_ptr): a compensation function for the lack
- of RSTRUCT_PTR. But now that we have RSTRUCT_GET/SET, that must
- not be used anyway. I mark this deprecated. Dont use it.
-
-Mon Aug 1 14:50:06 2016 Jeremy Evans <code@jeremyevans.net>
-
- * object.c (rb_obj_clone2): Allow Object#clone to take freeze:
- false keyword argument to not freeze the clone.
- [ruby-core:75017][Feature #12300]
-
- * test/ruby/test_object.rb (TestObject): test for it.
-
-Mon Aug 1 12:16:19 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2.
-
-Sun Jul 31 16:17:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/resolv/resolv.c (get_dns_server_list): [Win32] get DNS
- servers only for connected network devices by GetNetworkParams
- API. [Bug #12604]
-
-Sat Jul 30 12:13:26 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c (String#downcase), NEWS: Mentioned that case mapping for all
- of ISO-8859-1~16 is now supported. [ci skip]
-
-Sat Jul 30 12:00:01 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_2.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-2, by Yushiro Ishii.
-
-Fri Jul 29 20:57:12 2016 chuanshuo <lilijreey@126.com>
-
- * *.c: rename rb_funcall2 to rb_funcallv, except for extensions
- which are/will be/may be gems. [Fix GH-1406]
-
-Fri Jul 29 10:51:34 2016 Koichi Sasada <ko1@atdot.net>
-
- * proc.c (env_write): remove unused function.
-
-Fri Jul 29 10:49:52 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (VM_LOCAL_P): should return an integer value.
- reported at
- http://d.hatena.ne.jp/nagachika/20160728/ruby_trunk_changes_55764_55770
-
-Fri Jul 29 04:23:08 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h (VM_ENV_LOCAL_P): return truthy (0 or not) value.
-
- * vm.c (rb_vm_make_proc_lambda): use VM_ENV_ESCAPED_P() macro.
-
-Fri Jul 29 03:49:04 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm.c, internal.h: remove RubyVM::Env class and all of env objects
- are imemo objects (imemo_env).
-
- * NEWS: describe this change. I believe nobody touch these objects
- because there are no method defined.
-
- * vm_core.h: remove the following definitions.
- * rb_cEnv decl.
- * GetEnvPtr() because Env is no longer T_DATA object.
-
- * vm_core.h (rb_env_t): fix layout for imemo values.
-
- * vm_core.h (vm_assert_env): added.
-
- * vm_core.h (vm_env_new): added.
-
-Thu Jul 28 19:53:21 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_core.h: revisit the structure of frame, block and env.
- [Bug #12628]
-
- This patch introduce many changes.
-
- * Introduce concept of "Block Handler (BH)" to represent
- passed blocks.
-
- * move rb_control_frame_t::flag to ep[0] (as a special local
- variable). This flags represents not only frame type, but also
- env flags such as escaped.
-
- * rename `rb_block_t` to `struct rb_block`.
-
- * Make Proc, Binding and RubyVM::Env objects wb-protected.
-
- Check [Bug #12628] for more details.
-
-Thu Jul 28 15:05:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (ruby_fl_type): use __extension__ to get rid
- of pedantic warning against RUBY_FL_USER19.
- https://github.com/skylightio/skylight-ruby/issues/64
-
- * include/ruby/ruby.h (rb_mul_size_overflow): ditto for use of
- int128.
-
-Wed Jul 27 10:32:59 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1253.c: Remove dead code found by Coverity Scan.
-
-Tue Jul 26 22:43:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (run_finalizer): make saved running finalizer state
- volatile to ensure not to be clobbered by longjmp.
-
-Tue Jul 26 19:26:00 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_insnhelper.c: introduce rb_vm_pop_frame() and use it
- instead of setting rb_thread_t::cfp directly.
-
- * vm_insnhelper.c (vm_pop_frame): return the result of
- finish frame or not.
-
-Tue Jul 26 19:06:39 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (rb_raw_obj_info): support to show Proc obj.
-
-Tue Jul 26 18:55:55 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_mark): add `inline' explicitly.
- I expected to inline this function implicitly at the loop
- (ex: marking T_ARRAY objects) but sometimes it remains as
- normal call.
-
-Tue Jul 26 16:33:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1257.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1257, by Sho Koike.
-
-Tue Jul 26 16:19:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1250.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1250, by Sho Koike.
-
- * ChangeLog: Fixed order of previous two entries.
-
-Tue Jul 26 15:54:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1253.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1253, by Takumi Koyama.
-
-Tue Jul 26 15:30:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1251.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1251, by Shunsuke Sato.
-
-Tue Jul 26 13:04:59 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for
- availability of Unicode data files.
-
-Mon Jul 25 21:33:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * range.c (check_step_domain): check step argument domain by <=>
- method, instead of < and >.
-
-Mon Jul 25 21:11:32 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * doc/maintainers.rdoc: fix filenames.
-
-Mon Jul 25 16:59:00 2016 Koichi Sasada <ko1@atdot.net>
-
- * debug.c (ruby_debug_printf): use rb_raw_obj_info()
- instead of rb_inspect() because it is more robust way
- to see object internal.
-
-Sun Jul 24 16:33:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * regenc.h/c, include/ruby/oniguruma.h, enc/ascii.c, big5.c, cp949.c,
- emacs_mule.c, euc_jp.c, euc_kr.c, euc_tw.c, gb18030.c, gbk.c,
- iso_8859_1|2|3|4|5|6|7|8|9|10|11|13|14|15|16.c, koi8_r.c, koi8_u.c,
- shift_jis.c, unicode.c, us_ascii.c, utf_16|32be|le.c, utf_8.c,
- windows_1250|51|52|53|54|57.c, windows_31j.c, unicode.c:
- Remove conditional compilation macro ONIG_CASE_MAPPING. [Feature #12386].
-
-Sun Jul 24 12:53:42 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/maintainers.rdoc: xmlrpc is bundled gem from Ruby 2.4.
-
-Sun Jul 24 12:07:39 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/maintainers.rdoc: Update OpenSSL maintainer.
-
-Sat Jul 23 22:43:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (Check_Type): inline check for the object type.
-
-Sat Jul 23 04:06:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RTEST, NIL_P): use RUBY prefixed name in
- macros.
-
-Sat Jul 23 01:41:29 2016 Eric Wong <e@80x24.org>
-
- * 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]
-
-Fri Jul 22 19:55:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm.c (vm_set_main_stack): remove unnecessary check. toplevel
- binding must be initialized. [Bug #12611] (N1)
-
- * win32/win32.c (w32_symlink): fix return type. [Bug #12611] (N3)
-
- * string.c (rb_str_split_m): simplify the condition.
- [Bug #12611](N4)
-
-Fri Jul 22 17:13:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c (String#dump): Change escaping of non-ASCII characters in
- UTF-8 to use upper-case four-digit hexadecimal escapes without braces
- where possible [Feature #12419].
-
- * test/ruby/test_string.rb (test_dump): Add tests for above.
-
-Fri Jul 22 10:35:35 2016 Kouhei Sutou <kou@cozmixng.org>
-
- * 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!!!
-
-Fri Jul 22 10:32:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * template/unicode_norm_gen.tmpl: Remove
- UnicodeNormalize::UNICODE_VERSION at origin [Feature #12546].
-
-Fri Jul 22 09:23:51 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * LEGAL: Added entries for files under the USD license.
- [Bug #12598][ruby-core:76428][ci skip]
-
-Fri Jul 22 09:19:57 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * LEGAL: Added entry for `lib/rdoc/generator/template/darkfish/css/fonts.css`
- [Misc #12550][ruby-core:76255][ci skip]
-
-Fri Jul 22 06:28:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (run_finalizer): push and exec tag just once, instead of
- protecting for each finalizer.
-
- * gc.c (gc_start_internal, rb_gc_start): set finalizing flag
- whenever calling deferred finalizers not to recurse.
-
-Thu Jul 21 22:26:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * missing/strl{cat,cpy}.c: Update latest upstream files.
- [Misc #12205][ruby-core:74487]
- * LEGAL: Update license for missing/strl{cat,cpy}.c.
-
-Thu Jul 21 21:53:30 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * LEGAL: added file list with Public domain license.
- [ruby-core:76254][Bug #12549]
-
-Wed Jul 20 17:44:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enumerator.c (lazy_uniq): new method Enumerator::Lazy#uniq.
- [Feature #11090]
-
- * enum.c (enum_uniq): new method Enumerable#uniq.
- [Feature #11090]
-
-Wed Jul 20 17:35:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (rb_hash_add_new_element): add new element or do nothing
- if it is contained already.
-
- * array.c (ary_add_hash, ary_add_hash_by): use
- rb_hash_add_new_element.
-
-Tue Jul 19 18:21:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * lib/unicode_normalize/tables.rb: Remove
- UnicodeNormalize::UNICODE_VERSION (#12546).
-
-Tue Jul 19 15:38:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_local_constants_i): exclude private constants
- when excluding inherited constants too. [Bug #12345]
-
-Sun Jul 17 23:42:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (num_finite_p, num_infinite_p): Add Numeric#finite? and
- Numeric#infinite? [Feature #12039] [ruby-core:73618]
-
- * complex.c (rb_complex_finite_p): Add Complex#finite?
-
- * complex.c (rb_complex_infinite_p): Add Complex#infinite?
-
- * test/ruby/test_bignum.rb: Add test for Integer#finite? and
- Integer#infinite?
-
- * test/ruby/test_fixnum.rb: ditto.
-
- * test/ruby/test_rational.rb: Add test for Rational#finite? and
- Rational#infinite?
-
- * test/ruby/test_complex.rb: Add test for Complex#finite? and
- Complex#infinite?
-
-Sun Jul 17 20:59:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, enc/depend (casefold.h, name2ctype.h): move to
- unicode data directory per version.
-
-Sat Jul 16 06:26:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, enc/Makefile.in: moved timestamp files for
- directories under the specific directory, to get rid of match
- with files under the source directory.
-
-Fri Jul 15 22:05:13 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * string.c (str_buf_cat): Fix potential integer overflow of capa.
- In addition, termlen is used instead of +1.
-
-Fri Jul 15 21:30:38 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * string.c (str_buf_cat): Fix capa size for embed string.
- Fix bug in r55547. [Bug #12536]
-
-Fri Jul 15 18:13:15 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: update latest gems.
-
-Fri Jul 15 17:08:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_strtod): do not underflow only by preceding zeros,
- which may be canceled out by the exponent.
- http://twitter.com/kazuho/status/753829998767714305
-
-Fri Jul 15 09:53:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/unicode/case-folding.rb, tool/enc-unicode.rb: check if
- Unicode versions are consistent with each other.
-
-Fri Jul 15 08:25:15 2016 Jeremy Evans <code@jeremyevans.net>
-
- * string.c (STR_BUF_MIN_SIZE): reduce from 128 to 127
- [ruby-core:76371] [Feature #12025]
- * string.c (rb_str_buf_new): adjust for above reduction
-
-Thu Jul 14 17:26:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (enc/unicode/name2ctype.h): remove stale recipe,
- which did not support Unicode age properties.
-
- * common.mk (enc/unicode/name2ctype.h): update by --header option
- of tool/enc-unicode.rb. enc/unicode/name2ctype.kwd file has not
- been used.
-
- * common.mk (enc/unicode/name2ctype.kwd): rule to create from
- Unicode data files, used only when the target does not exist.
-
-Thu Jul 14 13:10:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/json/lib/json/ext: remove stale directory. bundled
- extension libraries are placed under the directory for each
- architectures, but not mixed with plain text script libraries.
-
-Thu Jul 14 12:48:47 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/json/**/*.rb: merge original files from upstream repository.
- It only fixes styles of frozen string literal.
-
-Wed Jul 13 22:23:03 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/json/json_common_interface_test.rb: use assert_raise instead of
- assert_raises.
-
-Wed Jul 13 22:14:23 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/lib/test/unit.rb: added test files with `_test` suffix for json
- upstream.
- * test/json: merge original test files from json upstream.
-
-Wed Jul 13 18:09:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_9.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-9, by Kazuki Iijima.
-
- * enc/iso_8859_9.c: Exclude dotless i/I with dot from case-insensitive
- matching because they are not a case pair.
-
- * test/ruby/enc/test_iso_8859.rb: Make test coverage for ISO-8859-9
- a bit more complete.
-
-Wed Jul 13 17:21:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1252.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for Windows-1252, by Serina Tai.
-
- * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings.
-
-Wed Jul 13 16:19:14 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_7.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-7, by Kosuke Kurihara.
-
- * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings.
-
-Wed Jul 13 16:08:08 2016 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_gc.rb: add a test.
-
-Wed Jul 13 15:59:59 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * math.c (_USE_MATH_DEFINES): it must be set before including internal.h
- because internal.h includes ruby.h, ruby.h includes win32.h, and
- win32.h includes system's math.h.
- this change is to get rid of a compiler warning (redefinition of
- a macro) introduced at r55641.
-
-Wed Jul 13 15:19:03 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_1.c, enc/iso_8859_4.c: Avoid setting modification flag if
- there is no modification.
-
-Wed Jul 13 14:40:04 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_5.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-5, by Masaru Onodera.
-
- * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings.
-
-Wed Jul 13 14:28:33 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * math.c (rb_math_sqrt): r55646 must use f_signbit.
-
-Wed Jul 13 14:22:50 2016 Koichi Sasada <ko1@atdot.net>
-
- * iseq.c (Init_ISeq): undef ISeq.translate and ISeq.load_iseq
- to prevent calling super classes' methods.
-
- Without this patch, you can write workaround like:
-
- class << RubyVM::InstructionSequence
- def translate; end
- undef translate
- end
-
- * test/ruby/test_iseq.rb: add a test.
-
-Wed Jul 13 14:16:03 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_method.c (method_entry_get_without_cache): check
- undefined method even if ruby_running is FALSE.
-
- We haven't call "undef"ed methods before ruby_running.
- So that this issue does not make troubles.
-
-Wed Jul 13 14:15:22 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/windows_1254.c: Adjust variable/macro names.
-
-Wed Jul 13 13:19:12 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_9.c, enc/windows_1254.c: Split Windows-1254 from
- ISO-8859-9 to be able to implement different case conversions.
-
-Wed Jul 13 13:08:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_7.c, enc/windows_1253.c: Split Windows-1253 from
- ISO-8859-7 to be able to implement different case conversions.
-
-Wed Jul 13 10:50:12 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_13.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-13, by Kanon Shindo.
-
-Wed Jul 13 10:31:39 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_13.c, enc/windows_1257.c: Split Windows-1257 from
- ISO-8859-13 to be able to implement different case conversions.
-
-Wed Jul 13 09:02:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_3.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-3, by Takuya Miyamoto.
-
- * test/ruby/enc/test_case_comprehensive.rb: Extend special treatment
- for Turkic.
-
- * enc/iso_8859_3.c: Exclude dotless i/I with dot from case-insensitive
- matching because they are not a case pair.
-
-Wed Jul 13 08:40:21 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_iso_8859.rb: Exclude dotless i/I with dot from
- case-insensitive matching because they are not a case pair.
-
-Tue Jul 12 23:13:43 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * math.c (rb_math_sqrt): [EXPERIMENTAL] move Complex sqrt support
- from mathn.rb.
-
-Tue Jul 12 01:25:09 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * configure.in, lib/mkmf.rb, win32/Makefile.sub (CSRCFLAG): make the
- compiler option replacable in Makefile.
-
- * win32/Makefile.sub (OUTFLAG, COUTFLAG): ditto.
-
- * win32/Makeile.sub, win32/setup.mak (CC): should not append `-nologo`
- option forcely.
-
-Mon Jul 11 18:05:40 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_1.c: Moved test for lowercase characters without
- uppercase equivalent.
-
-Mon Jul 11 17:49:25 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_4.c, enc/iso_8859_10.c, enc/iso_8859_14.c,
- enc/iso_8859_15.c, enc/iso_8859_16.c: Replace case-by-case code with
- lookup in ENC_ISO_8859_xx_TO_LOWER_CASE table.
-
-Mon Jul 11 16:00:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_each, strio_readlines): convert
- arguments just once before reading, instead of conversions for
- each lines, as r55603.
-
-Sun Jul 10 19:53:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_10.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-10, by Toya Hosokawa.
-
-Sun Jul 10 19:33:47 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Changed testing logic to
- catch unintended modifications of characters that do not have a case
- equivalent in the respective encoding.
- * enc/iso_8859_1.c, enc/iso_8859_15.c: Fixed unintended modifications of
- micro sign and y with diaeresis.
-
-Sun Jul 10 17:05:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_4.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-4, by Kotaro Yoshida.
-
-Sun Jul 10 16:17:47 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Fixed a comment
- (message belongs to last commit). [ci skip]
-
-Sun Jul 10 14:27:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_dtoa): [EXPERIMENTAL] adjust the case that the
- Float value is close to the exact but unrepresentable middle
- value of two values in the given precision, as r55604.
-
-Sun Jul 10 08:57:20 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * thread.c: Fixed implicit conversion error with Apple clang-800.0.31
-
-Sat Jul 9 12:43:09 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/getoptlong.rb: use false instead of FALSE.
-
-Fri Jul 8 21:49:28 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * thread.c (rb_wait_for_single_fd): Clean up fds.revents every time
- before calling ppoll(2). [Bug #12575] [ruby-dev:49725]
-
-Fri Jul 8 14:16:48 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * vm_args.c (vm_caller_setup_arg_block): call rb_sym_to_proc()
- directly to reduce method dispatch overhead.
-
-Fri Jul 8 08:43:31 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * io.c (rb_io_s_read): add description of pipes to the documentation
- of IO.read.
-
-Fri Jul 8 03:54:22 2016 NARUSE, Yui <naruse@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
-
-Fri Jul 8 00:47:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_eval.c (yield_under): change prototype to get argc/argv.
-
- * vm_eval.c (specific_eval): change for above.
-
- * vm_eval.c (rb_obj_instance_exec): avoid object allocation.
-
- * vm_eval.c (rb_mod_module_exec): ditto.
-
-Thu Jul 7 20:08:37 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Thu Jul 7 16:37:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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
-
-Thu Jul 7 16:31:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_io_s_foreach, rb_io_s_readlines): convert arguments
- just once before reading, instead of conversions for each lines.
-
-Wed Jul 6 19:54:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_14.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-14, by Yutaro Tada.
-
-Wed Jul 6 19:24:48 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_1.c, enc/iso_8859_15.c, enc/iso_8859_16.c:
- Align indenting to onigmo convention.
-
-Wed Jul 6 18:59:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_15.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-15, by Maho Harada.
-
-Wed Jul 6 18:34:21 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_16.c, test/ruby/enc/test_case_comprehensive.rb:
- Implement non-ASCII case conversion for ISO-8859-16, by Satoshi Kayama.
-
-Wed Jul 6 14:44:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (create_makefile): store $headers in LOCAL_HDRS for
- depend files.
-
- * ext/digest/digest_conf.rb (digest_conf): add implementation
- specific headers to $header.
-
- * ext/digest/{md5,rmd160,sha1,sha2}/depend: add LOCAL_HDRS to the
- dependencies.
-
-Wed Jul 6 08:59:35 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/http/generic_request.rb (write_header): A Request-Line must
- not contain CR or LF.
-
-Wed Jul 6 07:11:27 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * lib/net/ftp.rb (putline): raise an ArgumentError when
- CR or LF is included in a line.
-
-Tue Jul 5 20:49:30 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/json/*, test/json/*: Update json-2.0.1.
- Changes of 2.0.0: https://github.com/flori/json/blob/f679ebd0c69a94e3e70a897ac9a229f5779c2ee1/CHANGES.md#2015-09-11-200
- Changes of 2.0.1: https://github.com/flori/json/blob/f679ebd0c69a94e3e70a897ac9a229f5779c2ee1/CHANGES.md#2016-07-01-201
- [Feature #12542][ruby-dev:49706][fix GH-1395]
-
-Tue Jul 5 19:39:49 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
- * internal.h: declaration for rb_str_change_terminator_length.
-
- * 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.
-
- * encoding.c (rb_enc_associate_index): rb_str_change_terminator_length
- is used, and it should be called whenever the termlen is changed.
-
- * 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.
-
- * string.c (rb_str_capacity): Use str_capacity.
-
-Tue Jul 5 11:07:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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]
-
- * pack.c (pack_unpack): ditto.
-
-Mon Jul 4 13:56:34 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * process.c: define sig_t if not exist.
- at least Solaris 10 and 11 doesn't have sig_t.
-
-Mon Jul 4 13:08:48 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * random.c (random_ulong_limited): avoid left shift count >= width of
- type on 32bit environment.
-
-Sun Jul 3 18:51:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb, test_regex_casefold.rb,
- test/test_unicode_normalize.rb: Replace UNICODE_VERSION from
- UnicodeNormalize with RbConfig::CONFIG['UNICODE_VERSION'] from
- feature 12460.
-
-Sun Jul 3 06:04:09 2016 Eric Wong <e@80x24.org>
-
- * process.c (disable_child_handler_fork_child): simplify
- [ruby-core:75781] [Misc #12439]
-
-Sun Jul 3 05:25:46 2016 Eric Wong <e@80x24.org>
-
- * tool/asm_parse.rb: add description
- * tool/change_maker.rb: ditto
- * tool/downloader.rb: ditto
- * tool/eval.rb: ditto
- * tool/expand-config.rb: ditto
- * tool/extlibs.rb: ditto
- * tool/fake.rb: ditto
- * tool/file2lastrev.rb: ditto
- * tool/gem-unpack.rb: ditto
- * tool/gen_dummy_probes.rb: ditto
- * tool/gen_ruby_tapset.rb: ditto
- * tool/generic_erb.rb: ditto
- * tool/id2token.rb: ditto
- * tool/ifchange: ditto
- * tool/insns2vm.rb: ditto
- * tool/instruction.rb: ditto
- * tool/jisx0208.rb: ditto
- * tool/merger.rb: ditto
- * tool/mkrunnable.rb: ditto
- * tool/node_name.rb: ditto
- * tool/parse.rb: ditto
- * tool/rbinstall.rb: ditto
- * tool/rbuninstall.rb: ditto
- * tool/rmdirs: ditto
- * tool/runruby.rb: ditto
- * tool/strip-rdoc.rb: ditto
- * tool/vcs.rb: ditto
- * tool/vtlh.rb: ditto
- * tool/ytab.sed: ditto
- * tool/enc-unicode.rb: fix typo
- * tool/mk_call_iseq_optimized.rb: ditto
- * tool/update-deps: ditto
- [ruby-core:76215] [Bug #12539]
- by Noah Gibbs <the.codefolio.guy@gmail.com>
-
-Sat Jul 2 18:04:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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>
-
-Sat Jul 2 04:26:14 2016 NARUSE, Yui <naruse@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]
-
-Sat Jul 2 03:09:27 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Sat Jul 2 02:22:22 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Fri Jul 1 20:20:20 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * string.c: Specify termlen as far as possible.
- Additional fix for [Bug #12536] [ruby-dev:49699].
-
- * string.c (str_new_static): Specify termlen from the given encoding
- when creating a new String object is needed.
-
- * 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.
-
- * string.c (rb_external_str_new_with_enc): Use encoding by using the
- above rb_tainted_str_new_with_enc().
-
-Fri Jul 1 19:38:57 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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]
-
-Fri Jul 1 18:20:00 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * .gdbinit (rb_ps_thread): show the detail of cfunc in ruby level
- backtrace.
-
-Fri Jul 1 13:26:39 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * 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].
-
-Fri Jul 1 12:11:01 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * .gdbinit (rb_count_objects): added gdb version of count_objects().
-
-Fri Jul 1 04:32:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * .gdbinit (rb_ps_thread): show ruby level backtrace.
- Usually you can call `rb_ps` to show ruby level backtraces
- for all living threads.
- Note that it can call with core file like `gcore <pid>`
- and `gdb ruby core.<pid>`.
-
-Thu Jun 30 19:15:13 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * string.c: Fix memory corruptions when using UTF-16/32 strings.
- [Bug #12536] [ruby-dev:49699]
-
- * string.c (rb_str_new_with_class): Use TERM_LEN of the "obj".
-
- * string.c (rb_str_plus, rb_str_justify): Use str_new0 which is aware
- of termlen.
-
- * string.c (str_shared_replace): Copy +termlen bytes instead of +1.
-
- * string.c (rb_str_times): termlen should not be included in capa.
-
- * 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.
-
- * string.c (rb_str_capacity, str_shared_replace, str_buf_cat): ditto.
-
- * string.c (rb_str_drop_bytes, rb_str_setbyte, str_byte_substr): ditto.
-
-Wed Jun 29 22:24:37 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/lib/psych_jars.rb: removed needless file required to JRuby.
-
-Wed Jun 29 22:21:38 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c: The "reuse" behavior of d2i_ functions does
- not work well with OpenSSL 1.0.0t. So avoid it.
-
-Wed Jun 29 15:18:28 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * insns.def (opt_succ): optimize like r55515. (but this argument is
- constant)
-
-Wed Jun 29 12:41:58 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * test/ruby/test_refinement.rb: skip
- test_prepend_after_refine_wb_miss on ARM or MIPS.
- [ruby-core:76031] [Bug #12491]
-
-Wed Jun 29 08:45:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (passed_block): convert passed block symbol to proc.
- based on the patch by Daisuke Sato in [ruby-dev:49695].
- [Bug #12531]
-
-Wed Jun 29 03:34:41 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bignum.c (rb_big2ulong): the old logic seems to try to avoid
- calculating `-(long)(num-1)-1` if `num` is not LONG_MIN. (Note that
- `-LONG_MIN` may be larger than LONG_MAX) But C compilers can
- optimize it into single NEG instruction.
- Therefore those two conditions can be single if-body.
-
- * bignum.c (rb_big2long): ditto.
-
- * bignum.c (rb_big2ull): ditto.
-
- * bignum.c (rb_big2ll): ditto.
-
-Tue Jun 28 22:55:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/pstore.rb (PStore::CHECKSUM_ALGO): extract the algorithm for
- checksum, instead of qualified names for each times.
-
-Tue Jun 28 22:29:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bootstraptest/runner.rb: do not use safe navigation operator.
- this runner may run on older ruby. partially revert r53110
- (GH-1142 patched by @mlarraz).
-
-Tue Jun 28 22:09:09 2016 Akio Tajima <artonx@yahoo.co.jp>
-
- * lib/fileutils.rb: rescue Errno:EACCES for chown.
- [Bug #12520]
-
-Tue Jun 28 18:38:09 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * ext/digest/md5/md5ossl.h: Remove excess semicolons.
- Suppress warning on Solaris with Oracle Solaris Studio 12.
- [ruby-dev:49692] [Bug #12524]
-
- * 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/openssl/ossl_pkey_rsa.c: ditto.
-
-Tue Jun 28 15:56:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/ruby/enc/test_case_comprehensive.rb: noting to test if
- Unicode data files are available.
- [ruby-core:76160] [Bug #12433]
-
- * test/test_unicode_normalize.rb: ditto.
-
-Tue Jun 28 15:20:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/net/http.rb (Net::HTTP#proxy_uri): cache the case no proxy
- is used.
-
-Tue Jun 28 09:56:29 2016 Stefan Schussler <mail@stefanschuessler.de>
-
- * object.c (rb_mod_eqq): [DOC] Fix typo in RDoc. [Fix GH-1393]
-
-Tue Jun 28 02:41:32 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * insns.def (opt_plus): use `- 1` instead of `& (~1)` to allow
- compilers to use x86 LEA instruction (3 operand).
- Even if 3 operand LEA's latency is 3 cycle after SandyBridge,
- it reduces code size and can be faster because of super scalar.
-
- * insns.def (opt_plus): calculate and use rb_int2big.
- On positive Fixnum overflow, `recv - 1 + obj` doesn't carry
- because recv's msb and obj's msb are 0, and resulted msb is 1.
- Therefore simply rshift and cast as signed long works fine.
- On negative Fixnum overflow, it will carry because both arguments'
- msb are 1, and resulted msb is also 1.
- In this case it needs to restore carried sign bit after rshift.
-
-Mon Jun 27 16:58:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb (FileUtils#install): accecpt symbolic mode, as
- well as chmod.
-
- * lib/fileutils.rb (FileUtils#install): add owner and group
- options.
-
-Mon Jun 27 08:56:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (ADD_TRACE): ignore trace instruction on non-positive
- line.
-
- * parse.y (coverage): get rid of ArgumentError when the starting
- line number is not positive. [ruby-core:76141] [Bug #12517]
-
-Sun Jun 26 10:20:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32/lib/Win32API.rb (Win32API#initialize): Cygwin
- 2.5.2-1 (perhaps) seems to no longer append ".dll" suffix
- implicitly.
-
- * ext/win32/lib/win32/resolv.rb (Win32::Resolv): ditto. Fix the
- error reported by yamataka AT u08.itscom.net in
- [ruby-list:50339], and pointed out and patched by cerberus AT
- m3.kcn.ne.jp in [ruby-list:50341].
-
-Sat Jun 25 10:07:52 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/openssl/test_ocsp.rb: Ignore errors caused by bugs that exist in
- LibreSSL >= 2.3.1.
-
-Sat Jun 25 02:33:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (vm_respond_to): try method_missing if respond_to?
- is undefined, as if it is the default definition.
- [ruby-core:75377] [Bug #12353]
-
-Fri Jun 24 17:04:21 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/psych/*, test/psych/*: Update psych 2.1.0
- This version fixed [Bug #11988][ruby-core:72850]
-
-Fri Jun 24 13:12:41 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*:
- Update rubygems 2.6.5 and 2.6.6.
- Release note of 2.6.5: https://github.com/rubygems/rubygems/commit/656f5d94dc888d78d0d00f3598a4fa37391aac80
- Release note of 2.6.6: https://github.com/rubygems/rubygems/commit/ccb9c3300c063f5b5656669972d24a10ef8afbf5
-
-Fri Jun 24 09:17:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (lib/unicode_normalize/tables.rb): should not depend
- on Unicode data files unless ALWAYS_UPDATE_UNICODE=yes, to get
- rid of downloading Unicode data unnecessary. [ruby-dev:49681]
-
- * common.mk (enc/unicode/casefold.h): update Unicode files in a
- sub-make, not to let the header depend on the files always.
-
- * enc/unicode/case-folding.rb: if gperf is not usable, assume the
- existing file is OK.
-
-Tue Jun 21 19:44:54 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_regex_casefold.rb: Add Windows-1251, KOI8-R, and
- KOI8-U to encodings; definitely removed EUC-JP.
-
-Tue Jun 21 19:32:23 2016 Mark St.Godard <markstgodard@gmail.com>
-
- * lib/webrick/httprequest.rb (setup_forwarded_info): Use the first
- value in X-Forwarded-Proto, if header contains multiple comma
- separated values. Some middlewares may add these values to the
- list, not replacing. [Fix GH-1386]
-
-Tue Jun 21 17:17:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_io.rb: Skip test_readpartial_with_not_empty_buffer,
- test_read_buffer_error, test_read_unlocktmp_ensure,
- test_readpartial_unlocktmp_ensure, and
- test_sysread_unlocktmp_ensure on cygwin,
- because these tests repeatedly hang. This makes test_io.rb
- complete in finite time on cygwin.
-
- * ChangeLog: Fix test_in.rb -> test_io.rb (two instances).
-
-Tue Jun 21 16:38:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_casemap): do not put code with side effects
- inside RSTRING_PTR() macro which evaluates the argument multiple
- times.
-
-Tue Jun 21 16:13:45 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_casemap): fix memory leak.
-
-Tue Jun 21 16:12:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_casemap): int is too small for string size.
-
-Tue Jun 21 15:42:22 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_io.rb: Skip test_read_buffer_error on cygwin,
- because this test repeatedly hangs.
-
-Tue Jun 21 15:35:14 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * LEGAL: Added filenames and copyrights for some files in
- enc/trans/JIS.
-
-Tue Jun 21 00:56:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (get_special_folder): fix calling convention of
- SHGetPathFromIDListEx, which should be WINAPI. pointed out by
- @arton at http://twitter.com/arton/status/744884064277016576
-
-Tue Jun 21 00:22:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, include/ruby/defines.h (RUBY_USE_SETJMPEX):
- include setjmpex.h only when using setjmpex() for RUBY_SETJMP.
- the header of mingw32 overrides setjmp() by setjmpex().
-
-Mon Jun 20 18:39:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_io.rb: Skip test_open_fifo_does_not_block_other_threads
- on cygwin. Fifos seem to work okay in cygwin, but this test repeatedly
- hangs.
-
-Mon Jun 20 13:35:06 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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]
-
-Mon Jun 20 12:53:38 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/rubygems/test_gem_remote_fetcher.rb: OpenSSL::PKey::DH#priv_key=
- is not defined when ext/openssl is built with OpenSSL 1.1.0.
- https://github.com/rubygems/rubygems/pull/1648
- [ruby-core:75225] [Feature #12324]
-
-Sun Jun 19 21:25:43 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c: Add OCSP::SingleResponse that represents an
- OCSP SingleResponse structure. Also add two new methods #responses
- and #find_response to OCSP::BasicResponse. A BasicResponse has one or
- more SingleResponse. We have OCSP::BasicResponse#status that returns
- them as an array of arrays, each containing the content of a
- SingleResponse, but this is not useful. When validating an OCSP
- response, we need to look into the each SingleResponse and check their
- validity but it is not simple. For example, when validating for a
- certificate 'cert', the code would be like:
-
- # certid_target is an OpenSSL::OCSP::CertificateId for cert
- basic = res.basic
- result = basic.status.any? do |ary|
- ary[0].cmp(certid_target) &&
- ary[4] <= Time.now && (!ary[5] || Time.now <= ary[5])
- end
-
- Adding OCSP::SingleResponse at the same time allows exposing
- OCSP_check_validity(). With this, the code above can be rewritten as:
-
- basic = res.basic
- single = basic.find_response(certid_target)
- result = single.check_validity
-
- * test/openssl/test_ocsp.rb: Test this.
-
-Sun Jun 19 18:40:19 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspbres_add_status): Allow specifying
- the times (thisUpdate, nextUpdate and revocationTime) with Time
- objects. Currently they accepts only relative seconds from the current
- time. This is inconvenience, especially for revocationTime. When
- Integer is passed, they are still treated as relative times. Since the
- type check is currently done with rb_Integer(), this is a slightly
- incompatible change. Hope no one passes a relative time as String or
- Time object...
- Also, allow passing nil as nextUpdate. It is optional.
-
- * ext/openssl/ruby_missing.h: Define RB_INTEGER_TYPE_P() if not defined.
- openssl gem will be released before Ruby 2.4.0.
-
-Sun Jun 19 18:39:38 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c: Implement OCSP::{CertificateId,Request,
- BasicResponse,Response}#initialize_copy.
- [ruby-core:75504] [Bug #12381]
-
- * test/openssl/test_ocsp.rb: Test them.
-
-Sun Jun 19 18:29:50 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey_dh.c, ext/openssl/ossl_pkey_dsa.c,
- ext/openssl/ossl_pkey_ec.c, ext/openssl/ossl_pkey_rsa.c: Implement
- initialize_copy method for OpenSSL::PKey::*.
- [ruby-core:75504] [Bug #12381]
-
- * test/openssl/test_pkey_dh.rb, test/openssl/test_pkey_dsa.rb,
- test/openssl/test_pkey_ec.rb, test/openssl/test_pkey_rsa.rb: Test they
- actually copy the OpenSSL objects, and modifications to cloned object
- don't affect the original object.
-
-Sun Jun 19 16:55:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/test_dir_m17n.rb: Skip tests with non-UTF-8 encodings
- on cygwin. Cygwin can use the Unicode PUA (private use area) to store
- bytes from non-UTF-8 filenames (see
- https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars),
- but we are not supporting this. [Bug #12443]
-
-Sun Jun 19 15:01:18 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * localeinit.c: Fix filesystem encoding for cygwin to UTF-8 (see
- https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-unusual)
-
-Sun Jun 19 14:31:07 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey.h, ext/openssl/ossl_pkey_dh.c,
- ext/openssl/ossl_pkey_dsa.c, ext/openssl/ossl_pkey_rsa.c: A few days
- ago, OpenSSL changed {DH,DSA,RSA}_get0_*() to take const BIGNUM **.
- https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=fd809cfdbd6e32b6b67b68c59f6d55fbed7a9327
- [ruby-core:75225] [Feature #12324]
-
-Sun Jun 19 11:19:43 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_path_to_class): consider the string length
- instead of a terminator.
-
- * variable.c (rb_path_to_class): search the constant at once
- instead of checking if defined and then getting it.
-
-Sat Jun 18 14:01:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/rubygems/test_gem_installer.rb: Fixed broken test with extension
- build. https://github.com/rubygems/rubygems/pull/1645
-
-Sat Jun 18 13:59:54 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems
- HEAD(2c6d256). It contains to update vendored Molinillo to 0.5.0.
- https://github.com/rubygems/rubygems/pull/1638
-
-Sat Jun 18 10:13:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Jun 18 08:52:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_getline): fix pointer index
- overflow. reported by Guido Vranken <guido AT guidovranken.nl>.
-
-Thu Jun 16 16:35:35 2016 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]
-
-Thu Jun 16 12:17:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_trans): adjust buffer size by processed and rest
- lengths, instead of doubling repeatedly.
-
-Thu Jun 16 11:15:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (tr_trans): consider terminator length and fix heap
- overflow. reported by Guido Vranken <guido AT guidovranken.nl>.
-
-Thu Jun 16 00:02:32 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_verify, ossl_ocspbres_verify):
- Use ossl_clear_error() so that they don't print warnings to stderr and
- leak errors in the OpenSSL error queue. Also, check the return value
- of OCSP_*_verify() correctly. They can return -1 on verification
- failure.
-
-Wed Jun 15 19:52:23 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspreq_sign, ossl_ocspbres_sign): Allow
- specifying hash algorithm used in signing. They are hard coded to use
- SHA-1.
- Based on a patch provided by Tim Shirley <tidoublemy@gmail.com>.
- [ruby-core:70915] [Feature #11552] [GH ruby/openssl#28]
-
- * test/openssl/test_ocsp.rb: Test sign-verify works.
-
-Wed Jun 15 01:46:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c: [DOC] fix rdoc directive, and an example of negative
- value. [ruby-core:76025] [Bug #12487]
-
-Wed Jun 15 01:44:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/mkconfig.rb: provide Unicode Version information as
- RbConfig::CONFIG['UNICODE_VERSION'].
- [ruby-core:75845] [Feature #12460]
-
-Wed Jun 15 00:01:18 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * test/ruby/enc/test_case_comprehensive.rb
- (TestComprehensiveCaseFold::read_data): use \A and \z instead of
- ^ and $ in regexp.
-
-Tue Jun 14 23:43:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/backward.h (rb_cFixnum, rb_cBignum): remove the
- backward compatibility macros, to fail incompatible extension
- libraries early. [Bug #12427]
-
-Tue Jun 14 22:22:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime_with_timespec): limit the result string
- size by the format length, to get rid of unlimited memory use.
-
-Tue Jun 14 22:11:11 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspcid_get_issuer_name_hash,
- ossl_ocspcid_get_issuer_key_hash, ossl_ocspcid_get_hash_algorithm):
- Add accessor methods OCSP::CertificateId#issuer_name_hash,
- #issuer_key_hash, #hash_algorithm.
- Based on a patch provided by Paul Kehrer <paul.l.kehrer@gmail.com>.
- [ruby-core:48062] [Feature #7181]
-
- * test/openssl/test_ocsp.rb: Test these new methods.
-
-Tue Jun 14 22:07:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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 Jun 14 21:40:42 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ocsp.c (ossl_ocspbres_to_der, ossl_ocspcid_to_der):
- Implement #to_der methods for OCSP::BasicResponse and
- OCSP::CertificateId.
-
- (ossl_ocspreq_initialize, ossl_ocspres_initialize): Use GetOCSP*()
- instead of raw DATA_PTR().
-
- (ossl_ocspbres_initialize, ossl_ocspcid_initialize): Allow
- initializing from DER string.
-
- (Init_ossl_ocsp): Define new #to_der methods.
-
- * test/openssl/test_ocsp.rb: Test these changes. Also add missing tests
- for OCSP::{Response,Request}#to_der.
-
-Tue Jun 14 21:35:00 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/openssl_missing.h (DH_set0_pqg, RSA_set0_key):
- DH_set0_pqg() allows 'q' to be NULL. Fix a typo in RSA_set0_key().
- Fixes r55285. [ruby-core:75225] [Feature #12324]
-
-Mon Jun 14 10:19:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * NEWS: describe Integer#digits.
-
-Mon Jun 13 21:09:40 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * thread.c (debug_deadlock_check): show thread lock dependency and
- backtrace [Feature #8214] [ruby-dev:47217]
-
- * thread.c (thread_status_name): show "sleep_forever" instead of
- "sleep" if called from inspect.
-
-Mon Jun 13 20:50:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (reg_named_capture_assign_iter): remove named capture
- conflict warnings. it is just annoying rather than useful.
- [ruby-core:75416] [Bug #12359]
-
-Mon Jun 13 20:04:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (rb_int_digits, rb_fix_digits, rb_int_digits_bigbase):
- Add Integer#digits to extract columns in place-value notation
- [Feature #12447] [ruby-core:75799]
-
- * test/ruby/test_integer.rb: Add tests for the above change.
-
- * test/ruby/test_bignum.rb: ditto.
-
-Mon Jun 13 20:34:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RUBY_INTEGER_UNIFICATION): macro to tell if
- Integer is integrated. [ruby-core:75718][Bug #12427]
-
- * include/ruby/backward.h, internal.h (rb_cFixnum, rb_cBignum):
- fallback to rb_cInteger.
-
- * bignum.c, numeric.c, ext/json/generator/generator.{c,h}: use the
- macro.
-
-Mon Jun 13 16:58:53 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Add tests for full Unicode
- swapcase.
-
-Sun Jun 12 14:48:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Add tests for ASCII-only
- swapcase; store calculated values in hashes.
-
-Sun Jun 12 14:05:45 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_get_auth_tag,
- ossl_cipher_set_auth_tag): Check if the cipher flags retrieved by
- EVP_CIPHER_CTX_flags() includes EVP_CIPH_FLAG_AEAD_CIPHER to see if
- the cipher supports AEAD. AES-GCM was the only supported in OpenSSL
- 1.0.1.
-
- (Init_ossl_cipher): Fix doc; OpenSSL::Cipher::AES.new(128, :GCM) can't
- work.
-
- * ext/openssl/openssl_missing.h: Define EVP_CTRL_AEAD_{GET,SET}_TAG if
- missing. They are added in OpenSSL 1.1.0, and have the same value as
- EVP_CTRL_GCM_{GET,SET}_TAG and EVP_CTRL_CCM_{GET,SET}_TAG.
-
-Sun Jun 12 13:47:42 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/openssl/test_engine.rb (test_openssl_engine_builtin,
- test_openssl_engine_by_id_string): Skip test if 'openssl' engine is
- already loaded. And test the number increased by Engine.load{_by_id,},
- not the total count of loaded engines. Previously, we called
- OpenSSL::Engine.cleanup every time running a test case, but we no
- longer can do it.
- [ruby-core:75225] [Feature #12324]
-
-Sun Jun 12 09:24:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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
-
-Sat Jun 11 23:07:32 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * lib/forwardable.rb (_delegator_method): get rid of a warning which
- causes test failures introduced at r55376.
-
-Sat Jun 11 18:37:58 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
- class description. [ci skip][Bug #12255][ruby-core:74835]
-
-Sat Jun 11 15:19:38 2016 takiy33 <takiy33@users.noreply.github.com>
-
- * lib/net/smtp.rb: [DOC] Remove dead link on documentation for
- Japanese of SMTP. [Fix GH-1380]
-
-Sat Jun 11 15:02:45 2016 Grant Hutchins <github@nertzy.com>
-
- * string.c (rb_str_oct): [DOC] fix typo, hornored -> honored.
- [Fix GH-1379]
-
-Sat Jun 11 14:04:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/objspace/objspace_dump.c: generate valid JSON for dump_all.
-
-Sat Jun 11 13:52:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/forwardable.rb (_delegator_method): remove __send__ call if
- possible, so that more optimizations will be enabled.
-
-Sat Jun 11 11:24:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/iso_8859.h (SHARP_s): name frequently used codepoint.
-
-Sat Jun 11 09:58:45 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_1.c: Revert to older version of code.
-
-Sat Jun 11 09:46:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/iso_8859_1.c: Implement non-ASCII case mapping.
-
- * test/ruby/enc/test_case_comprehensive.rb: Tests for above.
-
- * string.c: Add iso-8859-1 to supported encodings.
-
-Sat Jun 11 09:31:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/forwardable.rb (_delegator_method): leave the backtrace
- untouched during accessor. forwardable.rb does not appear in
- the backtrace during delegated method because of tail-call
- optimization.
-
-Sat Jun 11 01:38:31 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * include/ruby/defines.h (GCC_VERSION_SINCE): Fix logic error by
- adding parentheses. Fix failures of TestMkmf::TestConvertible
- with GCC 3.4.3 on Solaris 10. [Bug #12479] [ruby-dev:49660]
-
-Fri Jun 10 21:54:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/forwardable.rb (Forwardable._delegator_method): extract
- method generator and deal with non-module objects.
- [ruby-dev:49656] [Bug #12478]
-
-Fri Jun 10 17:35:11 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Special-case :ascii option in rb_str_capitalize_bang and
- rb_str_swapcase_bang.
-
-Fri Jun 10 17:12:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Special-case :ascii option in rb_str_upcase_bang (retry).
-
-Fri Jun 10 14:48:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * hash.c (get_env_cstr): ensure NUL-terminated.
- [ruby-dev:49655] [Bug #12475]
-
- * string.c (rb_str_fill_terminator): return the pointer to the
- NUL-terminated content.
-
-Thu Jun 9 21:42:00 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_asn1.c (asn1integer_to_num): Use
- ASN1_ENUMERATED_to_BN() to convert an ASN1_ENUMERATED to a BN.
- Starting from OpenSSL 1.1.0, ASN1_INTEGER_to_BN() rejects
- non-ASN1_INTEGER objects. The format of INTEGER and ENUMERATED are
- almost identical so they behaved in the same way in OpenSSL <= 1.0.2.
- [ruby-core:75225] [Feature #12324]
-
- * test/openssl/test_asn1.rb (test_decode_enumerated): Test that it
- works.
-
-Thu Jun 9 21:10:04 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * tool/ifchange: fix timestamp error when target without
- directory.
-
-Thu Jun 9 19:46:22 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ssl.c: Add define guards for OPENSSL_NO_EC.
- SSL_CTX_set_ecdh_auto() is defined even when ECDH is disabled in
- OpenSSL's configuration. This fixes r55214.
-
- * test/openssl/test_pair.rb (test_ecdh_curves): Skip if the OpenSSL does
- not support ECDH.
-
- * test/openssl/utils.rb (start_server): Ignore error in
- SSLContext#ecdh_curves=.
-
-Thu Jun 9 18:12:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * Makefile.in (un-runnable): fail with proper error message.
- [ruby-core:75905] [Bug #12472]
-
-Thu Jun 9 15:32:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (RBCONFIG): use ifchange tool to see if the content is
- changed and update the timestamp file.
-
- * tool/mkconfig.rb: remove ifchange features.
-
- * tool/ifchange: make target directory if it does not exist with
- its parent directories.
-
- * win32/ifchange.bat: drop support for command.com used on old
- systems.
-
-Thu Jun 9 15:03:35 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check for CRYPTO_malloc() and SSL_new().
- OpenSSL_add_all_digests() and SSL_library_init() are deprecated and
- converted to macros in OpenSSL 1.1.0.
- [ruby-core:75225] [Feature #12324]
-
-Wed Jun 8 23:09:51 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * string.c (rb_str_ascii_casemap): fix compile error.
-
-Wed Jun 8 22:22:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Revert previous commit (possibility of endless loop).
-
-Wed Jun 8 21:57:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Special-case :ascii option in rb_str_upcase_bang.
-
-Wed Jun 8 21:28:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: New static function rb_str_ascii_casemap; special-casing
- :ascii option in rb_str_upcase_bang and rb_str_downcase_bang.
-
- * regenc.c: Fix a bug (wrong use of unnecessary slack at end of string).
-
- * regenc.h -> include/ruby/oniguruma.h: Move declaration of
- onigenc_ascii_only_case_map so that it is visible in string.c.
-
-Wed Jun 8 20:33:44 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * include/ruby/intern.h: Remove excess semicolons in PUREFUNC().
- Fix failure of TestMkmf::TestConvertible on Solaris with
- Oracle Solaris Studio 12. [ruby-dev:49651] [Bug #12470]
- * internal.h: ditto.
-
-Wed Jun 8 16:03:09 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * 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.
-
-Tue Jun 7 21:27:25 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/rubygems/*_{cert,cert_32}.pem: Regenerate test certificates for
- OpenSSL 1.1.0. This is already in upstream.
- https://github.com/rubygems/rubygems/commit/9be5c53939440a61c4bba73cfffbeb5cfadf72be
- [ruby-core:75225] [Feature #12324]
-
-Tue Jun 7 21:27:17 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/open-uri/test_ssl.rb: Regenerate test certificates. The test CA
- certificate was incorrectly generated. A CA certificate must have the
- basic constraints extension with cA bit set to TRUE. OpenSSL <= 1.0.2
- allowed the error when the certificate is in the trusted store but
- OpenSSL 1.1.0 no longer does.
- [ruby-core:75225] [Feature #12324]
-
-Tue Jun 7 21:20:38 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * test/openssl/test_x509name.rb: Don't register OID for 'emailAddress'
- and 'serialNumber'. A recent change in OpenSSL made OBJ_create()
- reject an already existing OID. They were needed to run tests with
- OpenSSL 0.9.6 which is now unsupported.
- https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=52832e470f5fe8c222249ae5b539aeb3c74cdb25
- [ruby-core:75225] [Feature #12324]
-
- * test/openssl/test_ssl_session.rb (test_server_session): Duplicate
- SSL::Session before re-adding to the session store. OpenSSL 1.1.0
- starts rejecting SSL_SESSION once removed by SSL_CTX_remove_session().
- https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=7c2d4fee2547650102cd16d23f8125b76112ae75
-
- * test/openssl/test_pkey_ec.rb (setup): Remove X25519 from @keys. X25519
- is new in OpenSSL 1.1.0 but this is for key agreement and not for
- signing.
-
- * test/openssl/test_pair.rb, test/openssl/test_ssl.rb,
- test/openssl/utils.rb: Set security level to 0 when using aNULL cipher
- suites.
-
- * test/openssl/utils.rb: Use 1024 bits DSA key for client certificates.
-
- * test/openssl/test_engine.rb: Run each test in separate process.
- We can no longer cleanup engines explicitly as ENGINE_cleanup() was
- removed.
- https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=6d4fb1d59e61aacefa25edc4fe5acfe1ac93f743
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_cleanup): Add a note to the
- RDoc for Engine.cleanup.
-
- * ext/openssl/lib/openssl/digest.rb: Don't define constants for DSS,
- DSS1 and SHA(-0) when using with OpenSSL 1.1.0. They are removed.
-
- * test/openssl/test_digest.rb, test/openssl/test_pkey_dsa.rb,
- test/openssl/test_pkey_dsa.rb, test/openssl/test_ssl.rb,
- test/openssl/test_x509cert.rb, test/openssl/test_x509req.rb: Don't
- test unsupported hash functions.
-
-Tue Jun 7 17:49:52 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive: Change test for encodings
- without any non-ASCII case conversions from ASCII-only test
- to full test.
-
-Tue Jun 7 17:18:39 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c (rb_str_upcase_bang, rb_str_capitalize_bang,
- rb_str_swapcase_bang): Switch to use primitive.
-
-Tue Jun 7 16:44:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c (rb_str_downcase_bang): Switch to use primitive except if
- conversion can be done ASCII-only.
-
-Tue Jun 7 16:13:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive: Add regression tests for
- current ASCII-only case conversion.
-
-Tue Jun 7 15:28:38 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive: Fix method name
- (generate_casefold_tests -> generate_case_mapping_tests).
-
-Tue Jun 7 15:05:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * regenc.h/c: Rename onigenc_not_support_case_map to
- onigenc_ascii_only_case_map.
-
- * regenc.h: Add definition of onigenc_single_byte_ascii_only_case_map.
-
- * enc/iso_8859_X.c, windows_125X.c, ascii.c, us-ascii.c, koi8_x.c:
- Replace onigenc_not_support_case_map by
- onigenc_single_byte_ascii_only_case_map.
-
- * enc/big5.c, cp949.c, emacs_mule.c, euc_X.c, gbX.c, shift_jis.c,
- windows_31j.c: Replace onigenc_not_support_case_map by
- onigenc_ascii_only_case_map.
-
-Tue Jun 7 14:57:09 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check for SSL_CTX_set_min_proto_version()
- macro added in OpenSSL 1.1.0. Version-specific methods, such as
- TLSv1_method(), are deprecated in OpenSSL 1.1.0. We need to use
- version-flexible methods (TLS_*method() or SSLv23_*method()) and
- disable other protocol versions as necessary.
- [ruby-core:75225] [Feature #12324]
-
- * ext/openssl/ossl_ssl.c: Use SSL_CTX_set_{min,max}_proto_version() to
- fix the protocol version.
-
-Tue Jun 7 12:55:34 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * regenc.c (onigenc_not_support_case_map): Move to end of file;
- (onigenc_single_byte_ascii_only_case_map): Add new function.
-
-Tue Jun 7 09:26:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * regenc.c (onigenc_not_support_case_map): Rewrite to work correctly
- in ASCII range.
-
-Mon Jun 6 23:00:00 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * appveyor.yml: Update libressl version to 2.3.5.
-
-Mon Jun 6 18:37:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Mon Jun 6 18:36:34 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Added UTF-16BE/LE and UTF-32BE/LE to supported encodings
- for Unicode case mapping.
-
- * test/ruby/enc/test_case_comprehensive.rb: Tests for above
- functionality; fixed an encoding issue in assertion error message.
-
-Mon Jun 6 17:29:35 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Speed up testing for small
- encodings by preselecting codepoints.
-
-Mon Jun 6 17:10:50 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_free): Use EVP_CIPHER_CTX_free()
- to free EVP_CIPHER_CTX allocated by EVP_CIPHER_CTX_new().
- [ruby-core:75225] [Feature #12324]
-
-Mon Jun 6 13:37:08 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c Change rb_str_casemap to use encoding primitive
- case_map instead of directly calling onigenc_unicode_case_map.
-
-Mon Jun 6 13:16:46 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb:
- Remove :lithuanian guard for Unicode case mapping.
-
-Mon Jun 6 10:39:56 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/openssl_missing.h: Include ruby/config.h. r55285 added
- some inline functions but VC does not recognize 'inline' keyword.
-
-Mon Jun 6 09:25:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (thread_start_func_2): report raised exception if
- report_on_exception flag is set. [Feature #6647]
-
-Mon Jun 6 01:36:24 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check existence of SSL_is_server(). This
- function was introduced in OpenSSL 1.0.2.
- [ruby-core:75225] [Feature #12324]
-
- * ext/openssl/openssl_missing.h: Implement SSL_is_server() if missing.
-
- * ext/openssl/ossl_ssl.c (ssl_info_cb): Use SSL_is_server() to see if
- the SSL is server. The state machine in OpenSSL was rewritten and
- SSL_get_state() no longer returns SSL_ST_ACCEPT.
-
- (ossl_ssl_cipher_to_ary, ossl_sslctx_session_get_cb): Add some
- `const`s to suppress warning.
-
-Mon Jun 6 01:18:10 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_asn1.c (decode_bool): Do the same thing as
- d2i_ASN1_BOOLEAN() does by ourselves. This function is removed in
- OpenSSL 1.1.0.
- [ruby-core:75225] [Feature #12324]
-
-Mon Jun 6 00:34:16 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check existence of accessor functions that
- don't exist in OpenSSL 0.9.8. OpenSSL 1.1.0 made most of its
- structures opaque and requires use of these accessor functions.
- [ruby-core:75225] [Feature #12324]
-
- * ext/openssl/openssl_missing.[ch]: Implement them if missing.
-
- * ext/openssl/ossl*.c: Use these accessor functions.
-
- * test/openssl/test_hmac.rb: Add missing test for HMAC#reset.
-
-Mon Jun 6 00:00:13 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/openssl_missing.[ch]: Implement EVP_PKEY_get0_*() and
- {RSA,DSA,EC_KEY,DH}_get0_*() functions.
- OpenSSL 1.1.0 makes EVP_PKEY/RSA/DSA/DH opaque. We used to provide
- setter methods for each parameter of each PKey type, for example
- PKey::RSA#e=, but this is no longer possible because the new API
- RSA_set0_key() requires the 'n' at the same time. This commit adds
- deprecation warning to them and adds PKey::*#set_* methods as direct
- wrapper for those new APIs. For example, 'rsa.e = 3' now needs to be
- rewritten as 'rsa.set_key(rsa.n, 3, rsa.d)'.
- [ruby-core:75225] [Feature #12324]
-
- * ext/openssl/ossl_pkey*.[ch]: Use the new accessor functions. Implement
- RSA#set_{key,factors,crt_params}, DSA#set_{key,pqg}, DH#set_{key,pqg}.
- Emit a warning with rb_warning() when old setter methods are used.
-
- * test/drb/ut_array_drbssl.rb, test/drb/ut_drb_drbssl.rb,
- test/rubygems/test_gem_remote_fetcher.rb: Don't set a priv_key for DH
- object that are used in tmp_dh_callback. Generating a new key pair
- every time should be fine - actually the private exponent is ignored
- in OpenSSL >= 1.0.2f/1.0.1r even if we explicitly set.
- https://www.openssl.org/news/secadv/20160128.txt
-
-Sun Jun 5 22:06:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * configure.in: Fix the timing to detect the appropriate C++ compiler
- in OS X.
-
-Sun Jun 5 21:42:24 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check absence of CRYPTO_lock() to see if the
- OpenSSL has the new threading API. In OpenSSL <= 1.0.2, an application
- had to set locking callbacks to use OpenSSL in a multi-threaded
- environment. OpenSSL 1.1.0 now finds pthreads or Windows threads so we
- don't need to do something special.
- [ruby-core:75225] [Feature #12324]
-
- Also check existence of *_up_ref(). Some structures in OpenSSL have
- a reference counter. We used to increment it with CRYPTO_add() which
- is a part of the old API.
-
- * ext/openssl/openssl_missing.h: Implement *_up_ref() if missing.
-
- * ext/openssl/ossl.c: Don't set locking callbacks if unneeded.
-
- * ext/openssl/ossl_pkey.c, ext/openssl/ossl_ssl.c,
- ext/openssl/ossl_x509cert.c, ext/openssl/ossl_x509crl.c,
- ext/openssl/ossl_x509store.c: Use *_up_ref() instead of CRYPTO_add().
-
-Sun Jun 5 21:38:13 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check if RAND_pseudo_bytes() is usable. It is
- marked as deprecated in OpenSSL 1.1.0.
- [ruby-core:75225] [Feature #12324]
-
- * ext/openssl/ossl_rand.c: Disable Random.pseudo_bytes if
- RAND_pseudo_bytes() is unavailable.
-
- * test/openssl/test_random.rb: Don't test Random.pseudo_bytes if not
- defined.
-
-Sun Jun 5 19:06:40 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * NEWS: Add news about Unicode-wide case mapping for
- String/Symbol#upcase/downcase/swapcase/capitalize(!).
-
-Sun Jun 5 15:24:33 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb:
- Remove :lithuanian guard for Unicode case mapping.
-
-Sun Jun 5 14:46:34 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Remove :lithuanian guard for Unicode case mapping.
-
-Sat Jun 4 10:54:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/crypt.h (struct crypt_data): remove unnecessary member
- "initialized".
-
- * missing/crypt.c (des_setkey_r): nothing to be initialized in
- crypt_data.
-
- * configure.in (struct crypt_data): check for "initialized" in
- struct crypt_data, which may be only in glibc, and isn't on AIX
- at least.
-
-Sat Jun 4 10:38:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c: unify MAX_PATH, _MAX_PATH, and MAXPATHLEN to
- PATH_MAX, except for MAX_PATH in get_special_folder for an API
- limit.
-
-Fri Jun 3 21:27:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (process_options): rb_str_conv_enc() never set encoding
- of the source string, but returns the string itself if the
- conversion failed. then the instance variable does not need to
- be set again.
-
-Fri Jun 3 18:04:37 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (process_options): need to duplicate path before passing it to
- rb_str_conv_enc() because the function might call rb_enc_associate()
- internally. this fixes test failures on Windows introduced at r55260.
-
-Fri Jun 3 17:44:25 2016 Reiner Herrmann <reiner@reiner-h.de>
-
- * lib/mkmf.rb (create_makefile): sort lists of source and object
- files in generated Makefile, unless given by extconf.rb.
- [Fix GH-1367]
-
-Thu Jun 2 21:18:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * win32/win32.c (get_special_folder): use SHGetPathFromIDListEx if
- available instead of old SHGetPathFromIDListW, to check the
- buffer size.
-
-Thu Jun 2 17:05:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (ruby_init_loadpath_safe): remove MAXPATHLEN restriction
- for Windows 10.
-
-Thu Jun 2 16:51:35 2016 Koichi ITO <koic.ito@gmail.com>
-
- * misc/ruby-mode.el (ruby-here-doc-beg-re),
- (ruby-here-doc-beg-match, ruby-parse-partial): Support for
- `squiggly heredoc' syntax in ruby-mode. [Fix GH-1372]
-
-Thu Jun 2 10:24:48 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Raise ArgumentError when invalid string is detected in
- case mapping methods.
-
- * enc/unicode.c: Check for invalid string and signal with negative
- length value.
-
- * test/ruby/enc/test_case_mapping.rb: Add tests for above.
-
- * test/ruby/test_m17n_comb.rb: Add a message to clarify test failure.
-
-Wed Jun 1 21:41:05 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Check existence of ASN1_TIME_adj(). The old
- ASN1_TIME_set() is not Year 2038 ready on sizeof(time_t) == 4
- environment. This function was added in OpenSSL 1.0.0.
- [ruby-core:45552] [Bug #6571]
-
- * ext/openssl/ossl_asn1.c (ossl_time_split): Added. Split the argument
- (Time) into the number of days elapsed since the epoch and the
- remainder seconds to conform to ASN1_TIME_adj().
- (obj_to_asn1utime, obj_to_asn1gtime): Use ossl_time_split() and
- ASN1_*TIME_adj().
-
- * ext/openssl/ossl_asn1.h: Add the function prototype for
- ossl_time_split().
-
- * ext/openssl/ossl_x509.[ch]: Add ossl_x509_time_adjust(). Similarly to
- obj_to_asn1*time(), use X509_time_adj_ex() instead of X509_time_adj().
-
- * ext/openssl/ossl_x509cert.c, ext/openssl/ossl_x509crl.c,
- ext/openssl/ossl_x509revoked.c: Use ossl_x509_time_adjust().
-
-Wed Jun 1 15:58:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: revert r55237. replace crypt, not crypt_r, and
- check if crypt is broken more.
-
- * missing/crypt.c: move crypt_r.c
-
- * string.c (rb_str_crypt): use crypt_r if provided by the system.
-
-Wed Jun 1 14:07:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/crypt_r.c (a64toi): initialize statically and fix out of
- bounds access when salt is not 7bit clean.
-
-Wed Jun 1 11:34:59 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (MISSING): fixed build error introduced at r55237.
-
-Wed Jun 1 09:48:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_crypt): use reentrant crypt_r.
-
-Wed Jun 1 09:37:26 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * missing/crypt.c (des_setkey): void function never returns any value.
-
-Wed Jun 1 09:16:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * crypt.h: separate header file from missing/crypt.c.
-
- * missing/crypt.c (crypt_r, setkey_r, encrypt_r): add reentrant
- versions.
-
-Wed Jun 1 02:25:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * missing/crypt.c: fix size macros to use configured values
- for platforms long is larger than 32bit.
- [ruby-core:75792] [Bug #12446]
-
-Tue May 31 17:28:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser::Completion.candidate): get rid of
- nil as key names. [ruby-core:75773] [Bug #12438]
-
- * lib/optparse.rb (OptionParser#make_switch): char class option
- cannot be NoArgument, default to RequiredArgument.
-
-Tue May 31 00:30:11 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/socket/raddrinfo.c (host_str, port_str): Use StringValueCStr
- instead of (Safe)StringValue, to detect NUL byte in the string.
-
-Mon May 30 22:02:01 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of
- NUM2LONG(). time_t may be larger than long.
- [ruby-core:45552] [Bug #6571]
-
-Mon May 30 21:15:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Document current behavior for other case mapping methods
- on String. [ci skip]
-
-Mon May 30 20:00:25 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Document current situation for String#downcase. [ci skip]
-
-Mon May 30 18:29:28 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): Enable the automatic
- curve selection for ECDH by calling SSL_CTX_set_ecdh_auto(). With
- this a TLS server automatically selects a curve which both the client
- and the server support to use in ECDH. This changes the default
- behavior but users can still disable ECDH by excluding 'ECDH' cipher
- suites from the cipher list (with SSLContext#ciphers=). This commit
- also deprecate #tmp_ecdh_callback=. It was added in Ruby 2.3.0. It
- wraps SSL_CTX_set_tmp_ecdh_callback() which will be removed in OpenSSL
- 1.1.0. Its callback receives two values 'is_export' and 'keylength'
- but both are completely useless for determining a curve to use in
- ECDH. The automatic curve selection was introduced to replace this.
-
- (ossl_sslctx_setup): Deprecate SSLContext#tmp_ecdh_callback=. Emit a
- warning if this is in use.
-
- (ossl_sslctx_set_ecdh_curves): Add SSLContext#ecdh_curves=. Wrap
- SSL_CTX_set1_curves_list(). If it is not available, this falls back
- to SSL_CTX_set_tmp_ecdh().
-
- (Init_ossl_ssl): Define SSLContext#ecdh_curves=.
-
- * ext/openssl/extconf.rb: Check the existence of EC_curve_nist2nid(),
- SSL_CTX_set1_curves_list(), SSL_CTX_set_ecdh_auto() and
- SSL_CTX_set_tmp_ecdh_callback().
-
- * ext/openssl/openssl_missing.[ch]: Implement EC_curve_nist2nid() if
- missing.
-
- * test/openssl/test_pair.rb (test_ecdh_callback): Use
- EnvUtil.suppress_warning to suppress deprecated warning.
-
- (test_ecdh_curves): Test that SSLContext#ecdh_curves= works.
-
- * test/openssl/utils.rb (start_server): Use SSLContext#ecdh_curves=.
-
-Mon May 30 16:28:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/raddrinfo.c (host_str, port_str): use RSTRING_LEN
- instead of strlen, since RSTRING_PTR StringValueCStr may not be
- NUL-terminated when SHARABLE_MIDDLE_SUBSTRING=1. reported by
- @tmtms, http://twitter.com/tmtms/status/736910516229005312
-
-Mon May 30 16:20:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_fill_term): return new pointer reallocated by
- filling terminator.
-
-Mon May 30 14:54:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (enc_subseq): share the return value and
- the buffer as possible.
-
-Mon May 30 14:50:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (str_substr, rb_str_aref): refactor not to create
- unnecessary empty string.
-
- * string.c (str_byte_substr, str_byte_aref): ditto.
-
-Mon May 30 00:09:37 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/-test-/auto_ext.rb: fixed a heedless bug introduced at r55198.
- this change will make RubyCI green.
-
-Sun May 29 22:58:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regexec.c (ONIGENC_IS_MBC_ASCII_WORD): redefine optimized one.
- WORD of Ruby's ascii compatible encoding is always [a-zA-Z0-9_].
-
-Sun May 29 22:44:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regexec.c (match_at): make compilers optimize harder.
-
-Sun May 29 12:08:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/auto_ext.rb (auto_ext): utility method to create
- extension libraries for tests.
-
-Sat May 28 20:40:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * misc/ruby-additional.el (ruby-insert-heredoc-code-block): insert
- here document code block for assert_separately mainly.
-
-Sat May 28 20:34:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/test_unicode_normalize.rb: Add test to check for availability of
- Unicode data file; refactoring; fix an error with tests for destructive
- method (unicode_normalize!).
-
-Sat May 28 19:08:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Add error messages to tests
- for data file availability; refactoring.
-
-Sat May 28 14:00:10 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/lib/openssl/ssl.rb (SSLSocket): Move the implementation of
- SSLSocket#initialize to C. Initialize the SSL (OpenSSL object) in it.
- Currently this is delayed until ossl_ssl_setup(), which is called from
- SSLSocket#accept or #connect. Say we call SSLSocket#hostname= with an
- illegal value. We expect an exception to be raised in #hostname= but
- actually we get it in the later SSLSocket#connect. Because the SSL is
- not ready at #hostname=, the actual call of SSL_set_tlsext_host_name()
- is also delayed.
- This also fixes: [ruby-dev:49376] [Bug #11724]
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_initialize): Added. Almost the same
- as the Ruby version but this instantiate the SSL object at the same
- time.
-
- (ossl_ssl_setup): Adjust to the changes. Just set the underlying IO to
- the SSL.
-
- (ssl_started): Added. Make use of SSL_get_fd(). This returns -1 if not
- yet set by SSL_set_fd().
-
- (ossl_ssl_data_get_struct): Removed. Now GetSSL() checks that the SSL
- exists.
-
- (ossl_ssl_set_session): Don't call ossl_ssl_setup() here as now the
- SSL is already instantiated in #initialize.
-
- (ossl_ssl_shutdown, ossl_start_ssl, ossl_ssl_read_internal,
- ossl_ssl_write_internal, ossl_ssl_stop, ossl_ssl_get_cert,
- ossl_ssl_get_peer_cert, ossl_ssl_get_peer_cert_chain,
- ossl_ssl_get_version, ossl_ssl_get_cipher, ossl_ssl_get_state,
- ossl_ssl_pending, ossl_ssl_session_reused,
- ossl_ssl_get_verify_result, ossl_ssl_get_client_ca_list,
- ossl_ssl_npn_protocol, ossl_ssl_alpn_protocol, ossl_ssl_tmp_key): Use
- GetSSL() instead of ossl_ssl_data_get_struct(). Use ssl_started().
-
- (Init_ossl_ssl): Add method declarations of SSLSocket#{initialize,
- hostname=}.
-
- * ext/openssl/ossl_ssl.h (GetSSL): Check that the SSL is not NULL. It
- should not be NULL because we now set it in #initialize.
-
- * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize): No need
- to check if the SSL is NULL.
-
-Sat May 28 10:47:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: Update latest releases, power_assert-0.3.0,
- test-unit 3.1.9, minitest 5.9.0, did_you_mean 1.0.1
-
-Sat May 28 10:45:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * addr2line.c: drop support for ATARI ST platform. It was
- discontinued more than two decades ago. [fix GH-1350] Patch by
- @cremno
- * include/ruby/ruby.h: ditto.
- * io.c: ditto.
-
-Sat May 28 10:39:47 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Converted exception for
- unavailable Unicode data files to failed assertion.
-
-Sat May 28 10:26:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/cgi/util.rb: added missing quote.
- [fix GH-1363][ci skip] Patch by @dwaller
-
-Fri May 27 17:38:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_local_constants_i): exclude hidden constants.
- [ruby-core:75575] [Bug #12389]
-
-Fri May 27 17:09:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri May 27 15:07:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args): remove nul padding which
- caused syntax error if fmt is not a string literal.
-
- * include/ruby/ruby.h (rb_scan_args_verify): suppress array-bounds
- warnings by old clang.
-
- * include/ruby/ruby.h (rb_scan_args0): make extractor macros
- inline functions, which do not validate the format and are
- unnecessary to be expanded.
-
-Fri May 27 01:00:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * symbol.c (is_identchar): use ISDIGIT instead of rb_enc_isalnum.
- Though rb_enc_isalnum is encoding aware function, its argument here
- is *m, which is a single byte. Therefore ISDIGIT is faster.
-
- * symbol.c (is_special_global_name): ditto.
-
- * symbol.c (rb_enc_symname_type): ditto.
-
-Fri May 27 00:39:40 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args): add nul padding here to
- apply to all references.
-
- * include/ruby/ruby.h (rb_scan_args_verify): move length mismatch
- check outside conditional operators.
-
-Thu May 26 14:21:10 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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]
-
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does
- not check dsa->q.
-
- * 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.
-
-Thu May 26 14:13:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args_count): verify length with
- counting variables together.
-
-Thu May 26 09:45:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_comprehensive.rb: Add set of comprehensive
- (across most Unicode characters; later across most character encodings)
- tests for case mapping.
-
-Thu May 26 05:00:13 2016 Benoit Daloze <eregontp@gmail.com>
-
- * class.c (rb_define_class): Fix documentation.
-
-Wed May 25 20:50:12 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (unescape_nonascii): scan hex up to only 3 characters.
- [Bug #12420] [Bug #12423]
-
-Wed May 25 19:07:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Handle DOTLESS_i by hand because it isn't involved in folding.
-
-Wed May 25 18:30:53 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regparse.c (fetch_token_in_cc): raise error if given octal escaped
- character is too big. [Bug #12420] [Bug #12423]
-
-Wed May 25 17:45:15 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support.
-
-Wed May 25 17:43:30 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/openssl_missing.h, ext/openssl/ossl.h: Remove
- unnecessary 'extern "C"' blocks. We don't use C++ and these headers
- are local to ext/openssl, so there is no need to enclose with it.
-
-Wed May 25 17:42:58 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/extconf.rb: Remove check of OPENSSL_FIPS macro. This is
- unneeded because we can check the macro directly in source code,
- just as we already do for OPENSSL_NO_* macros.
-
- * ext/openssl/ossl.c: Replace occurrences of HAVE_OPENSSL_FIPS with
- OPENSSL_FIPS.
-
-Wed May 25 17:13:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (rb_scan_args): merge code for n_trail.
-
-Wed May 25 17:11:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args_validate): move failed
- condition to the terminal. [ruby-core:75714] [Bug #12426]
-
-Wed May 25 13:13:37 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regcomp.c: remove condition for debug output because prelude
- doesn't use regexp now.
-
-Wed May 25 13:10:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regcomp.c (compile_length_tree): return error code immediately
- if compile_length_tree raised error [Bug #12418]
-
-Wed May 25 08:01:39 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Fix flag error for switch from titlecase to lowercase.
-
- * test/ruby/enc/test_case_mapping.rb: Tests for above error.
-
-Wed May 25 01:13:55 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey_ec.c (ec_key_new_from_group): Create a new
- EC_KEY on given EC group. Extracted from ossl_ec_key_initialize().
- (ossl_ec_key_s_generate): Added. Create a new EC instance and
- generate a random private and public key.
- (ossl_ec_key_initialize): Use ec_key_new_from_group().
- (Init_ossl_ec): Define the new method EC.generate. This change is
- for consistency with other PKey types. [ruby-core:45541] [Bug #6567]
-
- * test/openssl/test_pkey_ec.rb: Test that EC.generate works.
-
-Wed May 25 00:37:16 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_generate_key): Fix up RDoc.
- (Init_ossl_ec): Rename EC#generate_key to EC#generate_key!. Make the
- old name an alias of #generate_key!. This change is for consistency
- with other PKey types. [ruby-core:45541] [Bug #6567]
-
- * test/openssl/test_pkey_ec.rb: Use EC#generate_key! instead of
- EC#generate_key.
-
-Wed May 25 00:23:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args_set): check the arity after
- adjusting argc for an option hash, for optimization in simpler
- cases.
-
-Wed May 25 00:21:52 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (XCFLAGS): merge flags only for ruby itself from
- ruby_cflags.
-
-Tue May 24 22:04:15 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_cipher.c (ossl_cipher_set_key, ossl_cipher_set_iv):
- Reject too long values as well as too short ones. Currently they
- just truncate the input but this would hide bugs and lead to
- unexpected encryption/decryption results.
-
- * test/openssl/test_cipher.rb: Test that Cipher#key= and #iv= reject
- Strings with invalid length.
-
-Tue May 24 21:32:21 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): Use
- ASN1_OCTET_STRING_set() instead of M_ASN1_OCTET_STRING_set(). Macros
- prefixed by "M_" are discouraged to be used from outside OpenSSL
- library[1].
- (ossl_x509ext_get_value): Likewise, use ASN1_STRING_print() instead
- of M_ASN1_OCTET_STRING_print().
- [1] https://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=CHANGES;h=bf61913d7b01212b4d8b2f3c13d71d645914f67c;hb=b6079a7835f61daa9fb2cbf9addfa86049523933#l878
-
- * ext/openssl/ossl.h: Include openssl/asn1.h instead of
- openssl/asn1_mac.h. It just includes openssl/asn1.h and defines some
- additional "M_" macros.
-
-Tue May 24 18:52:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args_verify): verify the format to
- scan if no invalid chars and variable argument length matching,
- at the compile time if possible.
-
-Tue May 24 17:18:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/defines.h (ERRORFUNC, WARNINGFUNC): add fallback
- definitions.
-
-Tue May 24 16:37:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (ruby_cflags): separate from optflags [Bug #12409]
- -fexcess-precision=standard and -fp-model precise are set to this now.
-
- * configure.in (cflags): use ruby_cflags.
-
-Tue May 24 16:20:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ERRORFUNC, WARNINGFUNC): __error__ and __warning__
- attributes take a parenthesized string literal.
-
-Tue May 24 12:35:56 2016 URABE Shyouhei <shyouhei@ruby-lang.org>
-
- * common.mk: sort lines, and add missing dependencies suggested
- by tool/update-deps
-
-Mon May 23 21:33:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/missing.h (isfinite): move from numeric.c.
-
-Mon May 23 21:09:06 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl.c (Init_openssl): Avoid reference to unset global
- variable. ossl_raise() may be called before dOSSL is set. Since
- global variables default to 0 and the default value of dOSSL set in
- Init_openssl() is also Qfalse, there is no real issue but confusing.
- Patch by Bertram Scharpf <software@bertram-scharpf.de>
- [ruby-core:58264] [Bug #9101]
-
-Mon May 23 20:32:16 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_asn1.c, ext/openssl/ossl_bn.c,
- ext/openssl/ossl_cipher.c, ext/openssl/ossl_digest.c
- ext/openssl/ossl_engine.c, ext/openssl/ossl_ns_spki.c
- ext/openssl/ossl_pkcs12.c, ext/openssl/ossl_pkcs7.c
- ext/openssl/ossl_pkey.c, ext/openssl/ossl_pkey_ec.c
- ext/openssl/ossl_rand.c, ext/openssl/ossl_ssl.c
- ext/openssl/ossl_x509attr.c, ext/openssl/ossl_x509cert.c
- ext/openssl/ossl_x509ext.c, ext/openssl/ossl_x509store.c: Use
- StringValueCStr() where NUL-terminated string is expected.
-
-Mon May 23 20:20:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
- cygwin. [Bug #12417][ruby-core:75691]
-
-Mon May 23 19:41:27 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_rand.c (ossl_rand_egd, ossl_rand_egd_bytes):
- RAND_egd{_bytes,}() return -1 on failure, not 0.
- Patch by cremno phobia <cremno@mail.ru>
- [ruby-core:63795] [Bug #10053]
- (ossl_pseudo_bytes): Similar, RAND_pseudo_bytes() may return 0 or
- -1 on failure.
-
-Mon May 23 15:52:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always
- exist. fixed build error on Windows introduced at r55123.
-
-Mon May 23 13:19:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args0): make compile error if the
- format is wrong or does not match with the variable argument
- length if possible.
-
-Mon May 23 12:47:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args0): raise fatal error if
- variable argument length does not match, it is a bug in the code
- which uses rb_scan_args, not a runtime error.
-
-Mon May 23 12:30:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider
- non-finite float values not to raise FloatDomainError.
- [ruby-core:75682] [Bug #12414]
-
-Mon May 23 12:21:18 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * array.c (rb_ary_fill): suppress warnings: 'item' may be used
- uninitialized in this function
-
-Mon May 23 07:41:49 2016 Eric Wong <e@80x24.org>
-
- * dir.c (dir_close): update RDoc for 2.3 #close change
- [ruby-core:75679] [Bug #12413]
-
-Sun May 22 20:01:21 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/timeridconv.rb: use finalizer trick instead of thread.
-
- * test/drb/ut_timerholder.rb: ditto.
-
-Sun May 22 17:25:18 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_options.rb: adjust test class name
- to match file name
-
-Sun May 22 17:24:07 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * rename test/ruby/enc/test_casing_options.rb to test_case_options.rb
- for consistency
-
-Sun May 22 17:06:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * transcode.c (enc_arg, str_transcode_enc_args, econv_args):
- remove volatile, and add GC guards in callers.
- [ruby-core:75664] [Bug #12411]
-
-Sun May 22 16:27:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/-test-/integer/core_ext.c: move testutil/integer.c.
-
- * test/lib/-test-/integer.rb: extract implementation details from
- test/unit/assertions.rb. [Bug #12408]
-
-Sun May 22 14:57:43 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h: Extend OnigEncodingTypeDefine to define a
- new encoding primitive 'case_map' for case mapping
-
- * enc/utf-8.c, utf_16be/le.c, utf_32be/le.c:
- add onigenc_unicode_case_map as case_map primitive
-
- * enc/ascii.c, big5.c, cp949.c, emacs_mule.c, euc_jp/kr/tw.c, gb18030.c,
- gbk.c, iso_8859_1/2/3/4/5/6/7/8/9/10/11/13/14/15/16.c, koi8_r/u.c,
- shift_jis.c, us_ascii.c, windows_1250/1251/1252.c:
- add onigenc_not_support_case_map as case_map primitive
-
-Sun May 22 14:45:45 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * regenc.h/c: Define new function onigenc_not_support_case_map
-
-Sun May 22 12:14:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args): use original rb_scan_args
- when fmt is dynamic.
-
-Sun May 22 11:41:12 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * class.c (rb_scan_args): moved to bottom of the file to make the
- effect of `#undef rb_scan_args` the minimum.
-
- * include/ruby/ruby.h (rb_scan_args): overwrite only if GCC and
- optimized. Visual C++ 14 or later can compile it but make it
- conservative.
-
-Sat May 21 22:45:50 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args): don't use ALWAYS_INLINE with
- `inline`. if gcc needs this duplication, do in ALWAYS_INLINE macro.
-
-Sat May 21 21:11:56 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_scan_args): use __VA_ARGS__ instead of
- va_arg to allow compilers optimize more aggressive.
- https://gustedt.wordpress.com/2011/07/10/avoid-writing-va_arg-functions/
- rb_scan_args is now expected to be statically resolved.
-
-Sun May 22 02:41:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/zlib/zlib.c: remove hacky macro introduced at r30437.
-
- * ext/zlib/zlib.c (gzfile_make_header): cast as long (instead of int).
-
- * ext/zlib/zlib.c (gzfile_make_footer): ditto.
-
-Sat May 21 21:07:18 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (ALWAYS_INLINE): force compilers the function inlined.
-
-Sat May 21 16:16:03 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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]
-
- * ext/openssl/lib/openssl/ssl.rb (sysclose): Update doc.
-
- * test/openssl/test_ssl.rb: Test this.
-
-Sat May 21 14:41:14 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl.c: [DOC] Fix SSL client example. The variable name
- was wrong. Patch by Andreas Tiefenthaler <at@an-ti.eu> (@pxlpnk).
- [GH ruby/openssl#32]
-
-Sat May 21 14:25:38 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey_ec.c: rename PKey::EC#private_key? and
- #public_key? to #private? and #public? for consistency with other
- PKey types. Old names remain as alias. [ruby-core:45541] [Bug #6567]
-
- * test/openssl/test_pkey_ec.rb (test_check_key): check private? and
- public? works correctly.
-
-Sat May 21 12:40:36 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/lib/openssl/buffering.rb (read_nonblock, readpartial):
- Remove impossible EOFError raise. Patch by Zach Anker
- <zanker@squareup.com>. [GH ruby/openssl#23]
-
-Sat May 21 11:18:42 2016 Evgeni Golov <evgeni@golov.de>
-
- * lib/ipaddr.rb: [DOC] fix documentation of IN6MASK to mention
- IPv6. [Fix GH-1349]
-
-Sat May 21 11:12:53 2016 Dan Martinez <dfm@razorwind.org>
-
- * io.c (Init_IO): [DOC] define dummy ARGF instead of ARGF.class to
- re-enable the generation of ARGF documentation. [Fix GH-1358]
-
-Sat May 21 11:07:29 2016 0x01f7 <souk.0x01f7@gmail.com>
-
- * doc/syntax/methods.rdoc (Method Names): add proper closing tag.
- [Fix GH-1356]
-
-Sat May 21 09:26:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SETJMP): fix missing macro definition
- for the configured result. fix up r55021.
-
-Sat May 21 00:36:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * process.c (rb_execarg_commandline): build command line string
- from argument vector in rb_execarg.
- [ruby-core:75611] [Bug #12398]
-
-Fri May 20 23:25:42 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl.c (ossl_pem_passwd_value): Added. Convert the
- argument to String with StringValue() and validate the length is in
- 4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers.
- (ossl_pem_passwd_cb): When reading/writing encrypted PEM format, we
- used to pass the password to PEM_def_callback() directly but it was
- problematic. It is not NUL character safe. And surprisingly, it
- silently truncates the password to 1024 bytes. [GH ruby/openssl#51]
-
- * ext/openssl/ossl.h: Add function prototype declaration of newly
- added ossl_pem_passwd_value().
-
- * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): Use
- ossl_pem_passwd_value() to validate the password String.
-
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize, ossl_dsa_export):
- ditto.
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize,
- ossl_ec_key_to_string): ditto.
-
- * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize, ossl_rsa_export):
- ditto.
-
- * test/openssl/test_pkey_{dsa,ec,rsa}.rb: test this.
-
-Fri May 20 23:45:53 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * id_table.c (list_id_table_init): When unaligned word access is
- prohibited and sizeof(VALUE) is 8 (64-bit machines),
- capa should always be even number for 8-byte word alignment
- of the values of a table. This code assumes that sizeof(ID) is 4,
- sizeof(VALUE) is 8, and xmalloc() returns 8-byte aligned memory.
- This fixes bus error on 64-bit SPARC Solaris 10.
- [Bug #12406][ruby-dev:49631]
-
-Fri May 20 22:30:09 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * symbol.h (rb_id2sym): Use HAVE_BUILTIN___BUILTIN_CONSTANT_P
-
-Fri May 20 22:19:00 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * ext/date/date_core.c: [DOC] fix typos.
- [fix GH-1360] patched by @soundasleep
-
-Fri May 20 21:26:58 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * include/ruby/defines.h (RB_GNUC_EXTENSION, RB_GNUC_EXTENSION_BLOCK):
- macros for skipping __extension__ on non-GCC compilers.
- * eval_error.c (warn_print): use RB_GNUC_EXTENSION_BLOCK instead of
- __extension__ because __extension__ is a GNU extension.
- Fix compile error on Solaris 10 with Oracle Solaris Studio 12.x.
- [Bug #12397] [ruby-dev:49629].
- * internal.h (rb_fstring_cstr, rb_fstring_enc_cstr): ditto
- * include/ruby/encoding.h (rb_enc_str_new, rb_enc_str_new_cstr): ditto
- * include/ruby/intern.h (rb_str_new, rb_str_new_cstr,
- rb_usascii_str_new, rb_utf8_str_new, rb_tainted_str_new_cstr,
- rb_usascii_str_new_cstr, rb_utf8_str_new_cstr,
- rb_external_str_new_cstr, rb_locale_str_new_cstr,
- rb_str_buf_new_cstr, rb_str_cat_cstr, rb_exc_new_cstr): ditto
-
-Fri May 20 21:17:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole.c (fole_missing): make substring or dup to
- share the content if possible.
-
-Fri May 20 19:48:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (NEW_PARTIAL_MEMO_FOR): shrink buffer array not to
- mark non-VALUE fields. fix check_rvalue_consistency abort with
- RGENGC_CHECK_MODE=2.
-
- * internal.h (NEW_CMP_OPT_MEMO): exclude struct cmp_opt_data from
- the valid array range.
-
- * enum.c (slicewhen_i): exclude inverted too.
-
-Thu May 19 21:21:57 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * re.c (rb_reg_match_m_p): [DOC] fix return value in rdoc.
-
- * test/ruby/test_regexp.rb (TestRegexp#test_match_p): add some
- tests from document.
-
-Thu May 19 13:22:44 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto.
-
- * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto.
- (ossl_x509stctx_verify): ditto.
-
- * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations
- of ossl_store_{ctx_,}ex_verify_cb_idx.
-
- * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and
- X509_STORE_get_ex_data.
-
- * 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.
-
-Thu May 19 13:11:35 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): check that the
- argument is an OpenSSL::ASN1::Data before converting to ASN1_TYPE.
- This fixes SEGV on OpenSSL::X509::Attribute#value=(non-asn1-value).
-
- * test/openssl/test_x509attr.rb: add tests for OpenSSL::X509::Attribute.
-
-Thu May 19 12:10:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_match_m_p): fix match against empty string.
- rb_str_offset returns the end when the position exceeds the
- length. fix the range parameter of onig_search.
- [ruby-core:75604] [Bug #12394]
-
-Thu May 19 11:37:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (rb_reg_match_m_p): should return false if no match, as the
- document says. [Feature #8110]
-
-Thu May 19 00:17:01 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (reg_names_iter): specify capacify
-
-Wed May 18 21:29:59 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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.
-
-Wed May 18 19:33:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_match_m_p): Introduce Regexp#match?, which returns
- bool and doesn't save backref.
-
-Wed May 18 16:52:03 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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.
-
-Wed May 18 16:04:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/downloader.rb (Downloader::RubyGems.download): verify gems
- only if RubyGems is 2.4 or later. old RubyGems fails to verify
- almost all of bundled gems.
-
-Wed May 18 14:52:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_modify_expand): check integer overflow.
- [ruby-core:75592] [Bug #12390]
-
-Wed May 18 13:11:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (match_ary_subseq): get subseq of match array without creating
- temporary array.
-
- * re.c (match_ary_aref): get element(s) of match array without creating
- temporary array.
-
- * re.c (match_aref): Use match_ary_subseq with handling irregulars.
-
- * re.c (match_values_at): Use match_ary_aref.
-
-Wed May 18 13:03:07 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_x509cert.c (ossl_x509_verify): X509_verify()
- family may put errors on 0 return (0 means verification failure).
- Clear OpenSSL error queue before return to Ruby. Since the queue is
- thread global, remaining errors in the queue can cause an unexpected
- error in the next OpenSSL operation. [ruby-core:48284] [Bug #7215]
-
- * ext/openssl/ossl_x509crl.c (ossl_x509crl_verify): ditto.
-
- * ext/openssl/ossl_x509req.c (ossl_x509req_verify): ditto.
-
- * ext/openssl/ossl_x509store.c (ossl_x509stctx_verify): ditto.
-
- * ext/openssl/ossl_pkey_dh.c (dh_generate): clear the OpenSSL error
- queue before re-raising exception.
-
- * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto.
-
- * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.
-
- * ext/openssl/ossl_ssl.c (ossl_start_ssl): ditto.
-
- * test/openssl: check that OpenSSL.errors is empty every time after
- running a test case.
-
-Wed May 18 12:07:42 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl.c (ossl_clear_error): Extracted from
- ossl_make_error(). This prints errors in the OpenSSL error queue if
- OpenSSL.debug is true, and clears the queue.
- (ossl_make_error): use ossl_clear_error().
-
- * ext/openssl/ossl.h: add prototype declaration of ossl_make_error().
- (OSSL_BIO_reset) use ossl_clear_error() to clear the queue. Clearing
- silently makes debugging difficult.
-
- * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): ditto.
-
- * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): ditto.
-
- * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_verify): ditto.
-
- * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto.
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize): ditto.
- (ossl_ec_group_initialize): ditto.
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_shutdown): ditto.
-
-Wed May 18 11:53:49 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): Validate the
- arguments before passing to EC_POINT(s)_mul(). Add description of this
- method. [ruby-core:65152] [Bug #10268]
-
- * test/openssl/test_pkey_ec.rb (test_ec_point_mul): Test that
- OpenSSL::PKey::EC::Point#mul works.
-
-Wed May 18 11:19:59 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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.
-
- * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash.
-
- * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash
-
-Wed May 18 10:17:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and
- underlying inline function to check if the object is an
- Integer (Fixnum or Bignum).
-
-Wed May 18 09:52:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sum, hash_sum, hash_sum_i, enum_sum_i, sum_iter):
- Optimize for hashes when each method isn't redefined.
-
-Wed May 18 09:14:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sum, int_range_sum): Extract int_range_sum from
- enum_sum.
-
-Wed May 18 03:16:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (match_values_at): fix regression at r55036.
- MatchData#values_at accepts Range.
-
-Wed May 18 02:02:58 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (match_aref): remove useless condition and call rb_fix2int.
- rb_reg_nth_match handles negative index.
-
-Wed May 18 01:57:43 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (match_values_at): MatchData#values_at supports named captures
- [Feature #9179]
-
- * re.c (namev_to_backref_number): separated.
-
-Wed May 18 00:05:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sum): Optimize for a range from int to int.
-
- * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb,
- and add assertions for some conditions.
-
- * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb.
-
- * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum.
-
-Tue May 17 23:08:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sum): [DOC] Write documentation.
-
-Tue May 17 22:53:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (enum_sum): Implement Enumerable#sum.
-
- * test/ruby/test_enum.rb (test_sum): Test sum for Enumerable.
-
- * test/ruby/test_hash.rb (test_sum): Test sum for Hash.
-
- * test/ruby/test_range.rb (test_sum): Test sum for Range.
-
-Tue May 17 22:11:41 2016 Tanaka Akira <akr@fsij.org>
-
- * object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
- lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
- lib/rubygems/specification.rb, lib/uri/generic.rb,
- bootstraptest/test_eval.rb, basictest/test.rb,
- test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
- test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
- test/csv/test_data_converters.rb, test/date/test_date.rb,
- test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
- test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
- test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
- test/ruby/test_bignum.rb, test/ruby/test_case.rb,
- test/ruby/test_class.rb, test/ruby/test_complex.rb,
- test/ruby/test_enum.rb, test/ruby/test_eval.rb,
- test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
- test/ruby/test_math.rb, test/ruby/test_module.rb,
- test/ruby/test_numeric.rb, test/ruby/test_range.rb,
- test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
- test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
- test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
- test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.
-
-Tue May 17 15:26:10 2016 Tanaka Akira <akr@fsij.org>
-
- * [Feature #12005] Unify Fixnum and Bignum into Integer
-
- * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums.
-
- * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from
- FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.
-
- * vm_core.h: Ditto.
-
- * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead
- of FIXNUM_REDEFINED_OP_FLAG.
-
- * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of
- rb_cFixnum and rb_cBignum.
- (C): Use Integer instead of Fixnum and Bignum.
-
- * numeric.c (fix_succ): Removed.
- (Init_Numeric): Define Fixnum as Integer.
-
- * bignum.c (bignew): Use rb_cInteger instead of rb_cBignum.
- (rb_int_coerce): replaced from rb_big_coerce and return fixnums
- as-is.
- (Init_Bignum): Define Bignum as Integer.
- Don't define ===.
-
- * error.c (builtin_class_name): Return "Integer" for fixnums.
-
- * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum.
-
- * ext/-test-/testutil: New directory to test.
- Currently it provides utilities for fixnum and bignum.
-
- * ext/json/generator/generator.c: Define mInteger_to_json.
-
- * lib/mathn.rb (Fixnum#/): Redefinition removed.
-
-Tue May 17 11:58:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_BUILTIN_SETJMP): declare t as NORETURN
- to suppress warnings by -Wsuggest-attribute=noreturn.
- [ruby-core:75510] [Bug #12383]
-
-Tue May 17 10:40:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SETJMP): needs the header and proper
- arguments for builtin setjmp functions.
-
-Mon May 16 20:00:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.h: Additional uses of ONIG_CASE_MAPPING compilation switch
-
-Mon May 16 19:46:33 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h: Introducing ONIG_CASE_MAPPING compilation
- switch
-
- * include/ruby/oniguruma.h, enc/unicode.h: Using ONIG_CASE_MAPPING
- compilation switch
-
-Mon May 16 19:29:31 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: Update xmlrpc-0.1.1. xmlrpc-0.1.0 didn't allow
- to install on 2.4.0dev.
-
-Mon May 16 13:28:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (FUNC_STDCALL, FUNC_CDECL, FUNC_FASTCALL): set
- macro names explicitly to the old names, which are accidentally
- changed at r54985, for backward compatibilities.
- fiddle also depends on these names to fallback to ANSI names.
- [ruby-core:75494] [Bug #12377]
-
-Mon May 16 11:39:02 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/xmlrpc.rb, lib/xmlrpc/*, test/xmlrpc: XMLRPC is bundled gem
- on Ruby 2.4. It is extracted to https://github.com/ruby/xmlrpc
- [Feature #12160][ruby-core:74239]
- * gems/bundled_gems: ditto.
-
-Mon May 16 06:06:21 2016 Eric Wong <e@80x24.org>
-
- * proc.c: fix RDoc of Proc#===/call/yield/[]
- [Bug #12332]
-
-Sun May 15 20:55:31 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342]
-
- * test/drb/ut_timerholder.rb: ditto.
-
-Sun May 15 16:15:25 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * array.c (rb_ary_entry): extract rb_ary_elt to organize if-conditions
- and check whether is embedded at once.
-
-Sun May 15 10:57:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even
- in the class context. [ruby-core:75505] [Bug #12382]
-
-Sun May 15 03:13:01 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * iseq.h (struct iseq_compile_data): use struct rb_id_table
- instead of st_table.
-
- * iseq.c (prepare_iseq_build): don't allocate ivar_cache_table
- until it has at least one element.
-
- * iseq.c (compile_data_free): free ivar_cache_table only if it
- is allocated.
-
- * compile.c (get_ivar_ic_value): allocate if the table is not
- allocated yet.
-
-Sat May 14 09:04:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat May 14 00:16:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (make_seed_value): append leading-zero-guard and get
- rid of making a local copy of the seed.
-
-Fri May 13 08:46:42 2016 cremno <cremno@mail.ru>
-
- * NEWS: drop FreeBSD < 4 support. [Fix GH-1339]
- The most recent version affected by this is 3.5 and was released
- in 2000.
- https://www.freebsd.org/releases/3.5R/announce.html
- https://en.wikipedia.org/wiki/History_of_FreeBSD#Version_history
-
-Fri May 13 03:12:09 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/defines.h (GCC_VERSION_SINCE): moved from internal.h.
-
-Fri May 13 03:11:20 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (__builtin_constant_p): check.
-
- * internal.h: Use HAVE_BUILTIN___BUILTIN_CONSTANT_P
-
-Fri May 13 03:10:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: use alternative keyword
- to avoid macros conflicts with them.
-
-Thu May 12 01:54:08 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/mkmf.rb (try_func): get rid of conflict of declarations of
- main(). checking local symbol reference does not make sense.
-
-Thu May 12 00:18:19 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/Makefile.sub (HAVE_QSORT_S): use qsort_s only for Visual Studio
- 2012 or later, because VS2010 seems to causes a SEGV in
- test/ruby/test_enum.rb.
-
-Wed May 11 23:59:47 2016 Masaya Tarui <tarui@ruby-lang.org>
-
- * vm_insnhelper.c (vm_getivar): describe fast-path explicit
- (compiler friendly). [Bug #12274].
-
-Wed May 11 21:30:07 2016 Masaya Tarui <tarui@ruby-lang.org>
-
- * compile.c (iseq_compile_each): share InlineCache during same
- instance variable accesses. Reducing memory consumption,
- rising cache hit rate and rising branch prediction hit rate
- are expected. A part of [Bug #12274].
-
- * iseq.h (struct iseq_compile_data): introduce instance
- variable IC table for sharing.
-
- * iseq.c (prepare_iseq_build, compile_data_free):
- construct/destruct above table.
-
-Wed May 11 17:18:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * util.c (ruby_qsort): use qsort_s if available, for Microsoft
- Visual Studio 2005 (msvcr80.dll) and mingw.
-
-Wed May 11 10:33:26 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * COPYING: Remove trailing-whitespaces.
- [ci skip][fix GH-1348]
-
-Tue May 10 21:05:45 2016 Benoit Daloze <eregontp@gmail.com>
-
- * 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]
-
- * test/ruby/test_class.rb: test for above.
-
-Tue May 10 14:57:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (obj_random_bytes): base on bytes method instead of
- rand method, not to call toplevel rand method.
-
-Tue May 10 13:07:28 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (-fexcess-precision=standard): before r54895 -std=c99
- is specified and it implied -fexcess-precision=standard.
- Now with -std=gnu99, it should be explicitly specified.
- https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-
-Mon May 9 10:51:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_atfork_internal): move th to an argument.
-
- * thread.c (rb_thread_atfork): do not repeat GET_THREAD().
-
-Mon May 9 10:46:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): do
- nothing unless working fork is available.
-
- * thread_sync.c (rb_mutex_abandon_all): define only if working
- fork is available.
-
- * thread_sync.c (rb_mutex_abandon_keeping_mutexes): ditto.
-
- * thread_sync.c (rb_mutex_abandon_locking_mutex): ditto.
-
- * thread_win32.c (gvl_init): never used.
-
-Mon May 9 07:18:06 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/{defines,ruby}.h: need to define function attributes
- alternatives in defines.h instead of ruby.h, because they are used
- in oniguruma.h and the header used without including ruby.h at
- encoding library sources.
-
-Mon May 9 06:30:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * include/ruby/ruby.h (CONSTFUNC, PUREFUNC): fixed build errors on
- non-gcc build environments introduced at r54952.
-
-Mon May 9 02:51:51 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * gc.c (rb_gc_unprotect_logging): throw rb_memerror when it cannot
- allocate memory. This is pointed out by Facebook's Infer.
-
- * gc.c (gc_prof_setup_new_record): ditto.
-
- * regparse.c (parse_regexp): ditto.
-
- * util.c (MALLOC): use xmalloc and xfree like above.
-
-Mon May 9 02:39:16 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: check function attribute const and pure,
- and define CONSTFUNC and PUREFUNC if available.
- Note that I don't add those options as default because
- it still shows many false-positive (it seems not to consider
- longjmp).
-
- * vm_eval.c (stack_check): get rb_thread_t* as an argument
- to avoid duplicate call of GET_THREAD().
-
-Sun May 8 21:01:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/openssl/extconf.rb: assume it doesn't have SSLv2 related
- functions when OPENSSL_NO_SSL2 is defined.
- Usually openssl's header and the library (libssl) have the same
- set of functions, but on some environment the library has functions
- whose headers doesn't declare. (openssl/opensslconf.h and libssl.so
- aren't be synchronized)
- To detect such case explicitly check feature macro and remove
- related functions.
-
-Sun May 8 18:51:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_home_dir_of): return the default home path if the
- user name is the current user name, on platforms where struct
- pwd is not supported. a temporary measure against
- [Bug #12226].
-
-Sun May 8 08:51:38 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: add -Wsuggest-attribute=format and suppress warnings.
-
-Sun May 8 08:31:03 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.
-
-Sun May 8 08:19:16 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: add -Werror=implicit-int to avoid missing type of
- function declaration.
-
-Sat May 7 22:22:37 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/ssl.rb: Accept string value for SSLCertName. It is used
- to invoke ssl server with command line.
- [fix GH-1329] Patch by @kerlin
- * test/webrick/test_ssl_server.rb: Added test for GH-1329
-
-Sat May 7 21:55:12 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/webrick/test_ssl_server.rb: Added basic test for `webrick/ssl`
-
-Sat May 7 16:22:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (int_pair_to_real_inclusive): optimize to multiply
- without Bignum.
-
-Sat May 7 07:58:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri May 6 08:16:26 2016 David Silva <david.silva@digital.cabinet-office.gov.uk>
-
- * enum.c (enum_find): [DOC] add more examples to the documentation
- of Enumerable#detect, to show that it equals to Enumerable#find.
- [Fix GH-1340]
-
-Thu May 5 18:08:31 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * test/ruby/test_complexrational.rb: Remove duplicated raise.
-
-Thu May 5 14:41:05 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * string.c (rb_str_sub): Fix a special match variable name.
- [ci skip]
-
-Thu May 5 12:22:17 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (rb_eval_cmd, rb_catch_obj): use TH_JUMP_TAG with the
- same rb_thread_t used for TH_PUSH_TAG, instead of JUMP_TAG with
- the current thread global variable.
-
-Thu May 5 10:49:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * random.c (fill_random_bytes_syscall): use arc4random_buf if
- available.
-
-Wed May 4 23:13:58 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * numeric.c (fix_plus): Remove rb_nucomp_add prototype
- declaration.
-
- * numeric.c (fix_mul): Remove rb_nucomp_mul prototype
- declaration.
-
- * internal.h (rb_nucomp_add, rb_nucomp_mul): add prototype
- declarations.
-
-Wed May 4 18:38:00 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * lib/net/http/header.rb (Net::HTTPHeader#{each_header,each_name,
- each_capitalized_name,each_value,each_capitalized}): Return
- sized enumerators.
-
- * test/net/http/test_httpheader.rb: add test for above.
-
-Wed May 4 17:53:15 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * lib/set.rb (Set#{delete_if,keep_if,collect!,reject!,select!,classify,divide},
- SortedSet#{delete_if,keep_if}): Return sized enumerators.
-
- * test/test_set.rb: add test for above.
-
-Tue May 3 23:25:48 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * numeric.c: [DOC] Update result of 123456789 ** -2.
- [ruby-dev:49606] [Bug #12339]
-
-Tue May 3 23:13:16 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * internal.h (RCOMPLEX_SET_IMAG): undef RCOMPLEX_SET_IMAG
- instead of duplicated undef RCOMPLEX_SET_REAL.
-
-Tue May 3 22:55:07 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * complex.c (rb_complex_set_imag): Fix to properly set imag
- of complex.
-
-Tue May 3 22:19:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (warnflags): use -std=gnu99 instead of
- -std=iso9899:1999. [Feature #12336]
-
-Tue May 3 22:10:09 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (count_utf8_lead_bytes_with_word): Use __builtin_popcount
- only if it can use SSE 4.2 POPCNT whose latency is 3 cycle.
-
- * internal.h (rb_popcount64): use __builtin_popcountll because now
- it is in fast path.
-
-Tue May 3 14:19:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (new_if_gen): set newline flag to NODE_IF to trace all
- if/elsif statements. [ruby-core:67720] [Bug #10763]
-
-Tue May 3 05:35:54 2016 Eric Wong <e@80x24.org>
-
- * process.c (disable_child_handler_fork_child):
- initialize handler for SIGPIPE for !POSIX_SIGNAL
-
-Mon May 2 23:03:42 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c, include/ruby/win32.h (rb_w32_utruncate): implements new
- truncate alternative which accepts UTF-8 path.
-
- * file.c (truncate): use above function.
- [Bug #12340]
-
-Mon May 2 20:59:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (str_coderange): to avoid function call when the string already
- has coderange information.
-
- * re.c (rb_reg_prepare_enc): add shortcut path when the regexp has
- the same encoding of given string.
-
- * re.c (rb_reg_prepare_re): avoid duplicated allocation of
- onig_errmsg_buffer.
-
-
-Mon May 2 12:34:52 2016 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_refinement.rb (test_inspect): Use Integer instead of
- Fixnum.
-
-Mon May 2 06:58:38 2016 Tanaka Akira <akr@fsij.org>
-
- * complex.c: Don't refer rb_cFixnum and rb_cBignum.
- (k_fixnum_p): Use FIXNUM_P.
- (k_bignum_p): Use RB_TYPE_P.
-
-Mon May 2 01:27:59 2016 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_numeric.rb (test_step): Use Integer::FIXNUM_MAX.
-
-Mon May 2 01:15:01 2016 Tanaka Akira <akr@fsij.org>
-
- * test/ruby/test_module.rb (test_name): Use Integer instead of Fixnum.
-
-Mon May 2 01:00:04 2016 Tanaka Akira <akr@fsij.org>
-
- * test/lib/test/unit/assertions.rb (assert_fixnum): Defined.
- (assert_bignum): Defined.
-
- * test/ruby/test_bignum.rb: Use assert_bignum.
-
- * test/ruby/test_integer_comb.rb: Use assert_fixnum and assert_bignum.
-
- * test/ruby/test_optimization.rb: Ditto.
-
-Mon May 2 00:41:53 2016 Tanaka Akira <akr@fsij.org>
-
- * vm_trace.c (recalc_remove_ruby_vm_event_flags): Add a cast to
- avoid signed integer overflow.
-
-Mon May 2 00:06:04 2016 Tanaka Akira <akr@fsij.org>
-
- * test/lib/envutil.rb: Define Integer::{FIXNUM_MIN,FIXNUM_MAX}.
-
- * test/ruby/test_bignum.rb: Use Integer::{FIXNUM_MIN,FIXNUM_MAX}.
-
- * test/ruby/test_bignum.rb: Ditto.
-
- * test/ruby/test_integer_comb.rb: Ditto.
-
- * test/ruby/test_marshal.rb: Ditto.
-
- * test/ruby/test_optimization.rb: Ditto.
-
-Sun May 1 23:59:59 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * array.c (rb_ary_sum): fix for mathn
-
- * test/ruby/test_array.rb (test_sum): ditto.
-
-Sun May 1 23:51:54 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * test/lib/test/unit.rb (Options#non_options): fixed wrong regexp.
- if both positives and negatives were specified, positives had to
- be specified from the beginning.
-
-Sun May 1 21:00:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c: drop Win2K support.
-
-Sun May 1 20:39:47 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * cont.c, hash.c, random.c, win32/win32.c: cleanup some Win9x/ME/NT4
- support leftovers.
- [fix GH-1328] patched by @cremno
-
-Sun May 1 07:30:44 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (search_nonascii): use nlz on big endian environments.
-
- * internal.h (nlz_intptr): defined.
-
-Sun May 1 00:03:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (__builtin_ctz): check.
-
- * configure.in (__builtin_ctzll): check.
-
- * internal.h (rb_popcount32): defined for ntz_int32.
- it can use __builtin_popcount but this function is not used on
- GCC environment because it uses __builtin_ctz.
- When another function uses this, using __builtin_popcount
- should be re-considered.
-
- * internal.h (rb_popcount64): ditto.
-
- * internal.h (ntz_int32): defined for ntz_intptr.
-
- * internal.h (ntz_int64): defined for ntz_intptr.
-
- * internal.h (ntz_intptr): defined as ntz for uintptr_t.
-
- * string.c (search_nonascii): unroll and use ntz.
-
-Sat Apr 30 21:54:13 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (Init_Numeric): Gather Fixnum method definitions.
-
-Sat Apr 30 21:28:14 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_div): Define Integer#/.
-
- * bignum.c (rb_big_div): Don't define Bignum#/.
-
- * lib/mathn.rb (Integer#/): Replace Integer#/ instead of Bignum#/.
-
-Sat Apr 30 21:11:08 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_plus): Define Integer#+.
-
- * bignum.c (rb_big_plus): Don't define Bignum#+.
-
-Sat Apr 30 21:01:20 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_minus): Define Integer#-.
-
- * bignum.c (rb_big_minus): Don't define Bignum#-.
-
-Sat Apr 30 20:53:33 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_mul): Define Integer#*.
-
- * bignum.c (rb_big_mul): Don't define Bignum#*.
-
-Sat Apr 30 20:30:44 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_modulo): Define Integer#%.
-
- * bignum.c (rb_big_modulo): Don't define Bignum#%.
-
-Sat Apr 30 20:17:08 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_equal): Define Integer#==.
-
- * bignum.c (rb_big_eq): Don't define Bignum#==.
-
-Sat Apr 30 19:41:15 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_gt): Define Integer#>.
-
- * bignum.c (rb_big_gt): Don't define Bignum#>.
- Renamed from big_gt.
-
- * internal.h (rb_big_gt): Declared.
-
-Sat Apr 30 19:24:40 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_ge): Define Integer#>=.
-
- * bignum.c (rb_big_ge): Don't define Bignum#>=.
- Renamed from big_ge.
-
- * internal.h (rb_big_ge): Declared.
-
-Sat Apr 30 19:20:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/standard_library.rdoc: Remove obsoleted classes and modules.
-
-Sat Apr 30 19:09:23 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_lt): Define Integer#<.
-
- * bignum.c (rb_big_lt): Don't define Bignum#<.
- Renamed from big_lt.
-
- * internal.h (rb_big_lt): Declared.
-
-Sat Apr 30 18:44:05 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_le): Define Integer#<=.
-
- * bignum.c (rb_big_le): Don't define Bignum#<=.
- Renamed from big_le.
-
- * internal.h (rb_big_le): Declared.
-
-Sat Apr 30 18:11:44 2016 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (Init_Bignum): Define Integer::GMP_VERSION.
-
-Sat Apr 30 16:58:18 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_remainder): Define Integer#remainder.
-
- * bignum.c (rb_big_remainder): Don't define Bignum#remainder.
-
- * internal.h (rb_big_remainder): Declared.
-
-Sat Apr 30 15:29:24 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_uminus): {Fixnum,Bignum}#-@ is unified into
- Integer.
-
- * bignum.c (rb_big_uminus): Don't define Bignum#-@.
-
-Sat Apr 30 14:42:20 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_idiv): {Fixnum,Bignum}#div is unified into
- Integer.
-
- * bignum.c (rb_big_idiv): Don't define Bignum#div.
-
-Sat Apr 30 14:25:55 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_modulo): {Fixnum,Bignum}#modulo is unified into
- Integer.
-
- * bignum.c (rb_big_modulo): Don't define Bignum#modulo.
-
-Sat Apr 30 14:04:30 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_divmod): {Fixnum,Bignum}#divmod is unified into
- Integer.
-
- * bignum.c (rb_big_divmod): Don't define Bignum#divmod.
-
-Sat Apr 30 13:20:00 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_fdiv): {Fixnum,Bignum}#fdiv is unified into
- Integer.
-
- * bignum.c (rb_big_fdiv): Don't define Bignum#fdiv.
-
-Sat Apr 30 12:25:43 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_pow): {Fixnum,Bignum}#** is unified into
- Integer.
-
- * bignum.c (rb_big_pow): Don't define Bignum#**.
-
-Sat Apr 30 12:28:59 2016 Tanaka Akira <akr@fsij.org>
-
- * bignum.c (rb_big_comp): Renamed from rb_big_neg.
-
- * numeric.c (fix_comp): Renamed from fix_rev.
-
-Sat Apr 30 12:25:43 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_comp): {Fixnum,Bignum}#~ is unified into
- Integer.
-
- * bignum.c (rb_big_neg): Don't define Bignum#~.
-
- * internal.h (rb_big_neg): Declared.
-
-Sat Apr 30 12:07:42 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_and): {Fixnum,Bignum}#& is unified into
- Integer.
-
- * bignum.c (rb_big_and): Don't define Bignum#&.
-
-Sat Apr 30 11:56:15 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/thread: removed dummy extension library. thread_sync.c
- provides "thread.rb" already.
-
-Sat Apr 30 11:53:48 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_or): {Fixnum,Bignum}#| is unified into
- Integer.
-
- * bignum.c (rb_big_or): Don't define Bignum#|.
-
-Sat Apr 30 11:18:47 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * vm_trace.c: Fix typos. [ci skip]
-
-Sat Apr 30 10:09:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/pty/pty.c (establishShell): honor USER environment variable
- and login name over uid, one uid can be shared by some login
- names.
-
-Fri Apr 29 22:40:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * doc/maintainers.rdoc (ext/io/nonblock): still maintained, as
- well as ext/io/wait, which is the origin.
-
-Fri Apr 29 21:18:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * doc/maintainers.rdoc (ext/win32): of course, it's still maintained.
-
-Fri Apr 29 21:03:10 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * gems/bundled_gems: Update latest gems, test-unit-3.1.8 and rake-11.1.2.
-
-Fri Apr 29 20:43:02 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/maintainers.rdoc: Update latest maintainers list on Ruby 2.4
-
-Fri Apr 29 19:52:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/maintainers.rdoc: Removed deprecated entries. These are already deleted.
-
-Fri Apr 29 19:48:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/maintainers.rdoc: Removed Ruby 1.8 entries. It's not necessary to
- Ruby 2.4 or later.
-
-Thu Apr 28 17:03:17 2016 Nicholas Maccharoli <nmaccharoli@gmail.com>
-
- * hash.c (rb_hash_update_{block,func}_callback): dry up hash
- update callback code. [Fix GH-1338]
-
-Thu Apr 28 16:52:05 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_prepare_enc): use rb_enc_asciicompat(enc) instead of
- rb_enc_str_asciicompat_p(str) to avoid useless rb_enc_get(str) call.
-
-Thu Apr 28 16:33:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb: [DOC] fix example code. base on the code by
- Semyon Gaivoronskiy in [ruby-core:75224]. [Bug #12323]
-
-Thu Apr 28 09:33:03 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.4.
- Please see entries of 2.6.4 on
- https://github.com/rubygems/rubygems/blob/master/History.txt
-
-Thu Apr 28 04:49:07 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * configure.in (rb_cv_lgamma_r_pm0): check if lgamma_r(+0.0)
- returns positive infinity, in addition to lgamma_r(-0.0).
- AIX returns an incorrect result of negative infinity.
-
- * math.c (ruby_lgamma_r): handle +0.0, in addition to -0.0.
-
-Thu Apr 28 01:11:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c: define _DEFAULT_SOURCE because glibc 2.20 deprecates
- _BSD_SOURCE.
- https://sourceware.org/glibc/wiki/Release/2.20
-
-Thu Apr 28 00:27:55 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_xor): {Fixnum,Bignum}#^ is unified into
- Integer.
-
- * bignum.c (rb_big_xor): Don't define Bignum#^.
-
-Wed Apr 27 20:53:59 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_aref): {Fixnum,Bignum}#[] is unified into
- Integer.
-
- * bignum.c (rb_big_aref): Don't define Bignum#<<.
-
- * internal.h (rb_big_aref): Declared.
-
-Wed Apr 27 16:10:35 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/instruction.rb: fix to follow current implementation.
-
-Wed Apr 27 15:47:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/stringio/stringio.c (strio_s_new): warn if a block is given,
- as well as IO.new.
-
-Wed Apr 27 14:29:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (ruby_only_for_internal_use): raise fatal error when
- deprecated function only for internal use is called, not just a
- warning.
-
-Tue Apr 26 23:42:30 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb (rel): should not raise exceptions even if
- the user input is wrong. only reports the error and continue process.
-
-Tue Apr 26 23:35:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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 Apr 26 21:11:02 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_lshift): {Fixnum,Bignum}#<< is unified into
- Integer.
-
- * bignum.c (rb_big_lshift): Don't define Bignum#<<.
-
-Tue Apr 26 20:59:40 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_rshift): {Fixnum,Bignum}#>> is unified into
- Integer.
-
- * bignum.c (rb_big_rshift): Don't define Bignum#>>.
-
-Tue Apr 26 20:46:16 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_size): {Fixnum,Bignum}#size is unified into Integer.
-
- * bignum.c (rb_big_size_m): Don't define Bignum#size.
-
- * internal.h (rb_big_size_m): Declared.
-
-Tue Apr 26 20:09:08 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (rb_int_bit_length): {Fixnum,Bignum}#bit_length is
- unified into Integer.
-
- * bignum.c (rb_big_bit_length): Don't define Bignum#bit_length.
-
- * internal.h (rb_big_bit_length): Declared.
-
-Tue Apr 26 19:56:16 2016 Tanaka Akira <akr@fsij.org>
-
- * numeric.c (int_abs): Integer#{abs,magnitude} moved from
- Fixnum and Bignum.
-
- * bignum.c (rb_big_abs): Don't define Bignum#{abs,magnitude}.
-
- * internal.h (rb_big_abs): Declared.
-
-Mon Apr 25 14:39:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/rbconfig/sizeof/extconf.rb: just check the existence of each
- types, to reduce configuration time, especially cross-compiling.
-
- * template/sizes.c.tmpl: calculate sizes of checked types at
- compilation time.
-
-Mon Apr 25 11:27:27 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * doc/extension.rdoc: Improvements to english grammars.
- [Bug #12246][ruby-core:74792][ci skip]
-
-Mon Apr 25 11:17:50 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * 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`
-
-Sun Apr 24 23:29:16 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * configure.in: add missing -lm for AIX.
-
-Sun Apr 24 18:33:58 2016 Kazuki Tsujimoto <kazuki@callcc.net>
-
- * vm_insnhelper.c (INLINE): disable r54738 if __NO_INLINE__ is defined.
- It caused "undefined reference to `vm_getivar'".
-
-Sun Apr 24 09:32:12 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * test/ruby/test_array.rb: Add test cases for Array#sum with
- non-numeric objects.
-
-Sun Apr 24 04:21:27 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_insnhelper.c (INLINE): define as `inline` when it is optimized.
- define as `static inline` when it is not optimized to keep
- the symbol generated.
-
- * vm_insnhelper.c (vm_getivar): use `INLINE` to force inline
- so that a compiler inlines it into vm_getinstancevariable
- and optimizes out is_attr and related branches.
-
- * vm_insnhelper.c (vm_getivar): use `inline` to recommend inline.
- Without this vm1_ivar_set is degraded.
-
- benchmark results:
- minimum results in each 5 measurements.
- Execution time (sec)
- name ruby 2.4.0dev (2016-04-23 trunk 54727) [x86_64-linux] ruby 2.4.0dev (2016-04-23 trunk 54733) [x86_64-linux] built-ruby
- loop_whileloop 0.641 0.642 0.646
- vm1_ivar* 1.002 0.999 0.831
- vm1_ivar_set* 0.369 1.106 0.362
-
- Speedup ratio: compare with the result of `ruby 2.4.0dev (2016-04-23
- trunk 54727) [x86_64-linux]' (greater is better)
- name ruby 2.4.0dev (2016-04-23 trunk 54733) [x86_64-linux]
- built-ruby
- loop_whileloop
- 0.998 0.991
- vm1_ivar*
- 1.003 1.205
- vm1_ivar_set*
- 0.334 1.018
-
-Sat Apr 23 18:01:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * vm_insnhelper.c (vm_getivar): specify inline instead of static inline.
- vm_getivar is called by vm_call_ivar and vm_getinstancevariable.
- At least with GCC 4.8 and 5.3 on Linux, they are inlining it into
- vm_call_ivar but not vm_getinstancevariable.
- By `inline`, they correctly inline it and gains performance.
-
- Speedup ratio: compare with the result of `ruby 2.4.0dev (2016-04-23
- trunk 54727) [x86_64-linux]' (greater is better)
- name built-ruby
- loop_whileloop 1.001
- vm1_ivar* 1.189
- vm1_ivar_set* 1.024
-
- Note the `inline`'s meaning is different between old GCC
- and C99. Old GCC's inline means C99's extern inline.
- https://gcc.gnu.org/onlinedocs/gcc/Inline.html
- Since Ruby specify -std=iso9899:1999, it works like C99.
-
-Sat Apr 23 16:11:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_mul_size_overflow): use UNLIKELY
- by user side to improve generality.
-
-Sat Apr 23 16:10:02 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (RB_LIKELY): use prefix in ruby.h.
-
- * intern.h (LIKELY): define with RB_LIKELY.
-
-Sat Apr 23 13:27:25 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * NEWS: Add descriptions for Time#to_time updates.
- [Bug #12271]
-
-Sat Apr 23 13:21:24 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * NEWS: Add descriptions for DateTime#to_time updates.
- [Bug #12189]
-
-Sat Apr 23 11:21:27 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * ext/date/date_core.c (Init_date_core): [DOC] Convert DateTime
- documentation to RDoc from Markdown.
- [ruby-core:75136] [Bug #12311]
-
-Sat Apr 23 09:03:35 2016 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]
-
-Sat Apr 23 01:00:03 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Fri Apr 22 21:00:44 2016 Tanaka Akira <akr@fsij.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.
-
-Fri Apr 22 20:18:40 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_mul_size_overflow): added to handle
- mul overflow efficiently.
-
- * include/ruby/ruby.h (rb_alloc_tmp_buffer2): use rb_mul_size_overflow
- and avoid division where it can define DSIZE_T.
-
- * gc.c (xmalloc2_size): moved from ruby.h and use rb_mul_size_overflow.
-
-Fri Apr 22 20:34:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * time.c (time_asctime): [DOC] add ctime example, not only
- asctime. [ruby-core:75126] [Bug #12310]
-
-Fri Apr 22 18:44:32 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * variable.c: use uint32_t instead of long to avoid confusion about
- the type of ivtbl->numiv.
-
-Fri Apr 22 15:09:27 2016 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]
-
-Fri Apr 22 15:04:56 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/redmine-backporter.rb: the fullpath of merger.rb is too long to
- copy&paste on Windows. show shorter name instead on the platform.
- I'm sure that the user of this command on Windows is only me.
-
-Fri Apr 22 14:52:04 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/merger.rb: remove temporary file.
-
-Fri Apr 22 11:27:03 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http.rb: Improve documentation for SSL requests via GET method.
- [fix GH-1325][ci skip] Patch by @jsyeo
-
-Fri Apr 22 10:51:13 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/ssl.rb: Support to add SSLCiphers option.
- [fix GH-1321] Patch by @rhadoo
-
-Fri Apr 22 10:43:19 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * file.c, win32/file.c: Removed obsoleted safe level checks.
- [fix GH-1327] Patch by @cremno
-
-Fri Apr 22 10:01:48 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * benchmark/bm_so_meteor_contest.rb: fix a typo.
- [fix GH-1330][ci skip] Patch by @sachin21
-
-Fri Apr 22 04:57:01 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * gc.c (rb_alloc_tmp_buffer_with_count): added like xmalloc2 to
- avoid duplicated check of size.
-
- * gc.c (ruby_xmalloc2): added to keep separate layers.
-
- * include/ruby/ruby.h (rb_alloc_tmp_buffer2): added to check
- the size more statically.
-
-Fri Apr 22 04:54:40 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (LIKELY): moved from internal.h.
-
- * include/ruby/ruby.h (UNLIKELY): ditto.
-
-Thu Apr 21 01:44:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * gc.c (objspace_malloc_prepare): remove size check because it is
- used by objspace_xmalloc and objspace_xcalloc.
- objspace_xmalloc introduces its own check in this commit.
- objspace_xcalloc checks with xmalloc2_size (ruby_xmalloc2_size).
-
- * gc.c (objspace_xmalloc0): common xmalloc function.
-
- * gc.c (objspace_xmalloc): introduce its own size check.
-
- * gc.c (objspace_xmalloc2): separated from ruby_xmalloc2 to clarify
- the layer who has the responsibility to check the size.
-
- * gc.c (objspace_xrealloc): remove duplicated size check.
-
- * gc.c (ruby_xmalloc2): use objspace_xmalloc2.
-
- * include/ruby/ruby.h (ruby_xmalloc2_size): follow the size limit
- as SSIZE_MAX. Note that ISO C says size_t is unsigned integer.
-
-Thu Apr 21 12:14:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check if succeeded in creating config.h.
-
- * 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]
-
-Wed Apr 20 17:33:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/cgi/escape/escape.c (cgiesc_unescape): define unescape
- method instead of _unescape, and should pass the optional
- argument to the super method.
-
- * lib/cgi/util.rb (CGI::Util#_unescape): remove intermediate
- method.
-
-Wed Apr 20 15:52:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (syntax_error_initialize): move the default message,
- "compile error", from parse.y. the default parameter should
- belong to the class definition.
-
- * parse.y (yycompile0): use the default parameter.
-
-Wed Apr 20 10:25:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (append_compile_error): use rb_syntax_error_append.
-
- * error.c (rb_syntax_error_append): append messages into a
- SyntaxError exception instance.
-
- * parse.y (yycompile0): make new SyntaxError instance in main
- mode, otherwise error_buffer should be a SyntaxError if error
- has occurred.
-
-Tue Apr 19 17:42:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (err_vcatf): rename, and separate appending message from
- creating a string buffer.
-
- * error.c (rb_syntax_error_append): merge rb_error_vsprintf and
- rb_compile_err_append.
-
- * parse.y (parser_compile_error): use rb_syntax_error_append.
-
-Tue Apr 19 13:46:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (append_compile_error, compile_bug): pass iseq and get
- error info and file from it, not by the thread error info.
-
- * error.c (rb_report_bug_valist): take va_list instead of variadic
- arguments, and just report the bug but not abort.
-
-Tue Apr 19 13:18:12 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/time.rb: revert r54167 because it would break
- backward compatibilities, and it is documented that
- Time.parse does not take into account time zone
- abbreations other than ones described in RFC 822
-
-Tue Apr 19 13:12:03 2016 Naotoshi Seo <sonots@gmail.com>
-
- * ChangeLog: Fix dates of previous commits
-
-Tue Apr 19 12:45:03 2016 Naotoshi Seo <sonots@gmail.com>
-
- * ChangeLog: Add descriptions for logger updates
- * NEWS: Add descriptions for logger updates
-
-Tue Apr 19 12:45:02 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: Add shift_period_suffix option
-
-Tue Apr 19 12:45:01 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: Allow specifying logger parameters in constructor
- such as level, progname, datetime_format, formatter.
-
-Mon Apr 18 16:07:01 2016 Nobuyoshi Nakada <nobu@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]
-
-Mon Apr 18 12:56:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_truncate): add an optional parameter, digits, as
- well as Float#round. [Feature #12245]
-
- * numeric.c (int_truncate): add an optional parameter, digits, as
- well as Integer#round. [Feature #12245]
-
-Sun Apr 17 04:18:56 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * tool/redmine-backporter.rb: revisions are strings.
-
-Sat Apr 16 14:26:49 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * ext/date/date_core.c : remove not used f_getlocal macro.
- After r54553 f_getlocal macro is not used.
-
-Sat Apr 16 14:15:24 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * ext/date/date_core.c : remove not used f_utc6 macro.
- After r54169 f_utc6 macro is not used.
-
-Sat Apr 16 10:00:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * struct.c (struct_make_members_list, rb_struct_s_def): member
- names should be unique. [ruby-core:74971] [Bug #12291]
-
- * struct.c (struct_make_members_list): extract making member name
- list from char* va_list, with creating symbols without
- intermediate IDs.
-
-Sat Apr 16 01:33:27 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * tool/redmine-backporter.rb: sort revisions.
-
-Sat Apr 16 01:16:02 2016 Tanaka Akira <akr@fsij.org>
-
- * array.c (rb_ary_sum): Don't yield same element twice.
- Found by nagachika.
-
-Sat Apr 16 01:03:32 2016 Tanaka Akira <akr@fsij.org>
-
- * array.c (rb_ary_sum): Fix SEGV by [1/2r, 1].sum.
-
-Fri Apr 15 23:52:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * rational.c (rb_rational_plus): rename from rb_rational_add
- to be aligned with rb_fix_plus.
-
- * array.c (rb_ary_sum): ditto.
-
- * internal.h: ditto.
-
-Fri Apr 15 23:42:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * rational.c (rb_rational_add): rename from nurat_add.
-
- * array.c (rb_ary_sum): use rb_rational_add directly.
-
- * test/ruby/test_array.rb (test_sum): add assertions for an array of
- Rational values.
-
-Fri Apr 15 22:31:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * array.c (rb_ary_sum): apply the precision compensated algorithm
- for an array in which Rational and Float values are mixed.
-
- * test/ruby/test_array.rb (test_sum): add assertions for the above
- change.
-
-Fri Apr 15 22:30:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.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]
-
-Fri Apr 15 20:27:16 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/irb/ext/save-history.rb: Fix NoMethodError when method is not defined.
-
-Fri Apr 15 15:38:58 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * common.mk (benchmark): order options for built-ruby and compare-ruby.
-
-Fri Apr 15 14:14:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * test/ruby/test_array.rb (test_sum): add assertions for Rational and
- Complex numbers.
-
-Fri Apr 15 10:07:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/console/console.c (console_key_pressed_p): raise the same
- exception, "unknown virtual key code", for names with nul chars.
- though console_win32_vk() considers the length and can deal with
- nul chars, rb_sprintf() raised at PRIsVALUE previously, so quote
- it if it is unprintable.
-
-Fri Apr 15 09:02:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/console/console.c (rb_sym2str): fallback definition for
- older ruby. [ruby-core:74953] [Bug #12284]
-
-Thu Apr 14 21:46:36 2016 Tanaka Akira <akr@fsij.org>
-
- * array.c (rb_ary_sum): Support the optional argument, init, and
- block.
-
-Thu Apr 14 19:02:41 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/irb/ext/save-history.rb: suppress warning: method redefined;
- discarding old save_history=.
-
-Thu Apr 14 14:58:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tkutil/tkutil.c (tk_hash_kv): the third argument can be
- nil not only an Array. reported by @windwiny at
- https://github.com/ruby/ruby/commit/cdaa94e#commitcomment-17096618
-
-Thu Apr 14 14:28:55 2016 cremno phobia <cremno@mail.ru>
-
- * cont.c (fiber_initialize_machine_stack_context): fix wrong
- _MSC_VER check, should be decimal but not hexadecimal.
- [ruby-core:74936] [Bug #12279]
-
-Wed Apr 13 22:51:38 2016 Tanaka Akira <akr@fsij.org>
-
- * array.c (rb_ary_sum): Array#sum is implemented.
- Kahan's compensated summation algorithm for precise sum of float
- numbers is moved from ary_inject_op in enum.c.
-
- * enum.c (ary_inject_op): Don't specialize for float numbers.
-
- [ruby-core:74569] [Feature #12217] proposed by mrkn.
-
-Wed Apr 13 15:56:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flo_ceil): add an optional parameter, digits, as
- well as Float#round. [Feature #12245]
-
- * numeric.c (flo_floor): add an optional parameter, digits, as
- well as Float#round. [Feature #12245]
-
- * numeric.c (int_ceil): add an optional parameter, digits, as
- well as Integer#round. [Feature #12245]
-
- * numeric.c (int_floor): add an optional parameter, digits, as
- well as Integer#round. [Feature #12245]
-
-Wed Apr 13 14:47:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (Init_File): add alias File.empty? to File.zero?.
- [Feature #9969]
-
-Wed Apr 13 14:36:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (assign_in_cond): allow multiple assignment in
- conditional expression. [Feature #10617]
-
-Wed Apr 13 14:11:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_big_size): add wrapper function of BIGSIZE and
- rename the method function with _m suffix.
-
- * numeric.c (int_round_zero_p): extracted from rb_int_round.
- optimize for Bignum, and convert VALUE returned by Numeric#size
- to long.
-
-Wed Apr 13 12:00:08 2016 Koichi Sasada <ko1@atdot.net>
-
- * test/ruby/test_basicinstructions.rb: add a test to check access
- instance variables on special const objects.
-
- All of such objects are frozen, so that we can not set instance
- variables for them. But we can read instance variables and return
- default value (nil).
-
-Tue Apr 12 20:40:35 2016 Kaneko Yuichiro <spiketeika@gmail.com>
-
- * ext/date/date_core.c (time_to_time): should preserve timezone
- info. [ruby-core:74889] [Bug #12271]
-
-Tue Apr 12 11:51:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (new_label_body): initialize bit fields, since
- compile_data_alloc does not clear the memory. [Bug #12082]
-
-Mon Apr 11 20:18:43 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm_backtrace.c (frame2klass): filter only for imemo_ment.
- T_IMEMO/imemo_iseq can be passed here.
-
-Mon Apr 11 17:43:04 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_optimize): disable tail call optimization in
- rescued, rescue, and ensure blocks.
- [ruby-core:73871] [Bug #12082]
-
-Mon Apr 11 06:54:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (apply2files): apply to a VALUE vector instead of a
- temporary array.
-
-Sun Apr 10 20:54:16 2016 Joe Swatosh <joe.swatosh@gmail.com>
-
- * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix
- API names. [ruby-core:74863] [Bug #12264]
-
-Sun Apr 10 17:47:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (rb_realpath_internal): no argument conversions since
- this internal function does not need to_path and encoding
- conversions, not to be affected by the default internal
- encoding.
-
-Sat Apr 9 10:03:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * load.c (rb_f_load): raise with the original path name before
- encoding conversion.
-
-Sat Apr 9 02:05:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * bignum.c (rb_cstr_parse_inum): [EXPERIMENTAL] new function to
- parse integer in C-string with length. the name and the
- arguments may be changed in the future.
-
- * bignum.c (rb_str_to_inum): preserve encoding of the argument in
- error messages, and no longer needs to copy non-terminated
- strings.
-
- * bignum.c (rb_str2big_{poweroftwo,normal,karatsuba,gmp}): ditto.
-
-Thu Apr 7 19:04:03 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * doc/regexp.rdoc (comments): [DOC] terminators cannot appear in
- comments. [ruby-core:74838] [Bug #12256]
-
-Thu Apr 7 11:24:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/tk/tkutil/tkutil.c (cbsubst_initialize): fix out-of-bound
- access when no arguments given. `p Tk::Event.new` crashed.
-
-Fri Apr 1 01:26:00 2016 Benoit Daloze <eregontp@gmail.com>
-
- * ext/coverage/coverage.c: Fully reset coverage to not persist global state.
- It was returning old file coverages as empty arrays to the user.
- [ruby-core:74596] [Bug #12220]
-
- * ext/coverage/coverage.c (rb_coverages): remove unused static state.
-
- * thread.c: Moved and renamed coverage_clear_result_i to reset_coverage_i.
-
- * test/coverage/test_coverage.rb: improve precision of tests.
-
-Wed Apr 6 22:41:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_lgamma_r_m0): fix the condition for
- lgamma_r(-0.0). [Bug #12249]
-
-Wed Apr 6 17:38:42 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * tool/downloader.rb (RubyGems.download): follow the change of the
- rubygems ssl_certs directory tree introduced by previous commit.
-
-Wed Apr 6 15:00:27 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.3.
- Please see entries of 2.6.3 on
- https://github.com/rubygems/rubygems/blob/master/History.txt
-
-Wed Apr 6 14:13:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (rb_cv_lgamma_r_m0): check if lgamma_r(-0.0)
- returns negative infinity. [Bug #12249]
-
- * math.c (ruby_lgamma_r): define by the configured result.
-
-Wed Apr 6 10:56:15 2016 Anton Davydov <antondavydov.o@gmail.com>
-
- * lib/logger.rb (Logger#level=): remove unnecessary local
- variable.
-
- * lib/logger.rb (Logger#initialize, Logger#reopen): [DOC] mention
- the default values. cherrypicked from [GH-1319].
-
-Wed Apr 6 10:17:53 2016 cremno phobia <cremno@mail.ru>
-
- * math.c (ruby_lgamma_r): missing/lgamma_r.c is used on Windows,
- since msvcrt does not provide it.
-
- * missing/lgamma_r.c (lgamma_r): fix lgamma(-0.0).
- [ruby-core:74823] [Bug #12249]
-
-Wed Apr 6 01:22:55 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
- cf. [Bug #12249]
-
-Wed Apr 6 00:53:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * math.c (ruby_lgamma_r): fix lgamma(-0.0) on mingw and OSX.
-
- * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
- [ruby-core:74817] [Bug #12249]
-
-Tue Apr 5 14:50:28 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c (mime_putc): fix typo.
- [Bug #12202] [ruby-core:74802]
-
-Tue Apr 5 00:06:44 2016 Aeris <aeris@imirhil.fr>
-
- * ext/openssl/ossl_ssl.c (ossl_ssl_tmp_key): Access to ephemeral
- TLS session key in case of forward secrecy cipher. Only
- available since OpenSSL 1.0.2. [Fix GH-1318]
-
- * ext/openssl/extconf.rb: Check for SSL_get_server_tmp_key.
-
-Mon Apr 4 23:37:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Mon Apr 4 17:43:45 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: change default value of
- RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO 0.3 -> 0.2
- RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO 0.8 -> 0.65
-
- These values are same as Ruby 2.0.0.
-
- This change cause GC counts.
- However, generational GC reduced each (minor) GC time and
- increase memory locality. So that not so big impact on my
- benchmarking results.
- (surprisingly, this fix speed up programs on some cases)
-
- You can change these values by environment variables
- if you feel wrong.
-
-Mon Apr 4 17:36:52 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (get_envparam_double): take an upper_bound.
-
- And also take an accept_zero flag which allow to accept zero
- even if lower_bound is set.
-
- * gc.c (ruby_gc_set_params): fix parameters.
-
- RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO set 0.9 as *lower_bound*, so that
- it should be upper_bound.
- Set RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO as lower bound.
-
- Also set lower/upper bound of RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO to
- RUBY_GC_HEAP_FREE_SLOTS_MIN/MAX_RATIO.
-
-Mon Apr 4 16:41:32 2016 Koichi Sasada <ko1@atdot.net>
-
- * vm.c (Init_VM): should pass tokens.
-
-Sun Apr 3 09:34:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (flodivmod): round division if it is a finite number
- and module is required.
-
- * numeric.c (dbl2ival): do not round here.
-
- * numeric.c (flo_ceil): use dbl2ival.
-
- * numeric.c (flo_round): round explicitly.
-
-Sat Apr 2 15:24:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/intern.h (rb_check_arity): returns argc.
-
-Fri Apr 1 20:58:33 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Data generation to implement
- swapcase functionality for titlecase characters. Swapcase isn't defined
- by Unicode, because the purpose/usage of swapcase is unclear anyway.
- The implementation follows a proposal from Nobu, swapping the case of
- each component of a titlecase character individually.
- This means that the titlecase characters have to be decomposed.
-
- * enc/unicode.c: Code using the above data.
-
- * test/ruby/enc/test_case_mapping.rb: Tests for the above.
-
-Fri Apr 1 14:55:28 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * configure.in (AC_CONFIG_FILES): $srcdir/.git can be a file pointing
- the real git_dir, such as when the git working tree is a "linked
- working tree" (a working tree created by git-worktree). So use
- git-rev-parse --git-dir to check if $srcdir is the top-level of a git
- repository, not just checking if the $srcdir/.git directory does exist
- or not. [ruby-core:74759] [Bug #12239]
-
- * tool/change_maker.rb: use tool/vcs.rb to detect VCS. This used to have
- its own VCS detection code, while we have tool/vcs.rb.
-
- * tool/vcs.rb (detect): remove code duplication
-
-Fri Apr 1 04:50:44 2016 Eric Wong <e@80x24.org>
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc):
- enable SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER by default
- [Bug #12126]
-
-Fri Apr 1 01:13:55 2016 Benoit Daloze <eregontp@gmail.com>
-
- * thread.c (update_coverage): Do not track coverage in loaded files
- after Coverage.result. Avoids out-of-bounds access. [Bug #12237]
-
- * ext/coverage/coverage.c (coverage_clear_result_i): document.
-
-Thu Mar 31 19:16:16 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: need to set initial value of GC_HEAP_FREE_SLOTS_GOAL_RATIO.
-
-Thu Mar 31 17:50:27 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: change additional allocation policy.
-
- Introduce new environment variable
- RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO (goal_ratio) to calculate the
- ratio of additional memory.
-
- Before this change, we add pages with the following formula
- (when free_slots < total_pages * RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO):
- next_pages = total_pages * RUBY_GC_HEAP_GROWTH_FACTOR
-
- This addition can allocate too much.
-
- With this change, we increase pages to satisfy the following formula:
- next_free_slots = next_total_slots * goal_ratio
- where
- next_free_slots = free_slots + adding_slots
- next_total_slots = total_slots + adding_slots.
-
- If you want to prepare many free slots, increase this ratio.
-
- If this variable is 0, then simply multiply
- RUBY_GC_HEAP_GROWTH_FACTOR.
-
- * gc.c (get_envparam_double): enable to accept 0.
-
-Thu Mar 31 17:48:25 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_marks_finish): fix syntax error.
-
-Thu Mar 31 16:49:36 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: simplify allocate/free detecting logic at the end of marking.
-
- Before this change, heap_pages_min_slots are calculated at the
- beginning sweeping phase. And this value is used at the end of
- *next* marking phase.
-
- To simplify it, we use this value at the end of this marking phase.
- It means that we don't need to store this value as global state.
-
- Also heap_pages_max_slots is calculated at the begging of sweeping
- phase and used at the end of sweeping phase.
- To simplify this logic, we introduced new global value
- heap_pages_freeable_pages it means extra pages count we can free.
- gc_sweep_step() checks this value and moves empty pages to tomb_heap
- not more than this value.
-
- Because of this fix, heap_pages_swept_slots is no longer needed.
-
- * gc.c (rb_objspace_t::heap_pages): restruct the objspace global
- status.
-
- remove the following fields
- * swept_slots (and heap_pages_swept_slots)
- * min_free_slots (and heap_pages_min_free_slots)
- * max_free_slots (and heap_pages_max_free_slots)
- And add the following filed.
- * freeable_pages (and heap_pages_freeable_pages)
-
- * gc.c (heap_pages_free_unused_pages): unlink tomb heap pages
- because tomb heap should have only freeable pages.
-
- * gc.c (heap_extend_pages): add parameters for future extension.
-
-Thu Mar 31 16:43:02 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: add GC parameters to configure the following values:
- * RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO:
- allocate additional pages when free slots is lower than
- the value (total_slots * (this ratio)).
- * RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO:
- allow to free pages when free slots is greater than
- the value (total_slots * (this ratio)).
-
- Before this change, these values are hard coded.
-
- * gc.c (ruby_gc_params_t): ditto.
-
- * gc.c (ruby_gc_set_params): ditto.
-
-Thu Mar 31 15:59:17 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_verify_heap_page): check the number of zombies.
-
- * gc.c (gc_verify_heap_pages): check also tomb heap.
-
-Thu Mar 31 15:48:18 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c (gc_page_sweep): return free slots count.
-
- * gc.c (gc_sweep_step): use returned free slots count.
-
- * gc.c (gc_sweep_step): change variable name `next'
- to `next_sweep_page'.
-
-Thu Mar 31 11:33:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/date/date_core.c (d_lite_strftime, dt_lite_strftime): [DOC]
- fix indent not to be a big sole verbatim.
-
-Thu Mar 31 11:18:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
- of DateTime. [ruby-core:74729] [Bug #12233]
-
-Thu Mar 31 03:41:02 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: Merge upstream 69f7e74dde.
- fix indent.
-
-Wed Mar 30 16:33:19 2016 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]
-
-Wed Mar 30 09:46:01 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/open-uri.rb: Use `userinfo` for authenticated proxy.
- [fix GH-1148] Patch by @SokichiFujita
- * test/open-uri/test_open-uri.rb: ditto.
- [fix GH-1309] Patch by @jdamick
-
-Wed Mar 30 01:56:06 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
- patched by Anton Sivakov [Bug #12201] [Bug #12202]
-
-Wed Mar 30 01:54:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/redmine-backporter.rb: add given revision to current changesets
- on associating the revision to the related ticket.
-
-Wed Mar 30 01:53:17 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/merger.rb: update revision.h before merge.
-
-Tue Mar 29 19:33:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * addr2line.c: define toupper for its use. fix r54391.
-
-Tue Mar 29 19:23:46 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * include/ruby/ruby.h (rb_isupper, rb_islower, rb_isalpha, rb_isdigit,
- rb_isalnum, rb_isxdigit, rb_isblank, rb_isspace, rb_isblank,
- rb_iscntrl, rb_isprint, rb_ispunct, rb_isgraph,
- rb_tolower, rb_toupper): use inline function to avoid function call.
-
- * include/ruby/ruby.h (rb_isascii): use inline function to clarify
- the logic.
-
-Tue Mar 29 18:56:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/redmine-backporter.rb (backport): show merger.rb's path.
-
- * tool/redmine-backporter.rb (show): show current issue again if no
- ticket number is given.
-
- * tool/redmine-backporter.rb (rel): show error message if current
- bugs.ruby-lang.org doesn't support the API.
-
-Tue Mar 29 18:54:34 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * tool/merger.rb: support to backport header as backport identifier.
- Now you can specify by 'merge revision(s) 49254: [Backport #10738]'.
-
-Tue Mar 29 16:53:44 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6
- special cases in CaseUnfold_11_Table.
-
- * enc/unicode.c: Adjustments for above.
-
- * test/ruby/enc/test_case_mapping.rb: Tests for the above: Some tests in
- test_titlecase activated; test_greek added. A test in test_cherokee fixed.
-
-Tue Mar 29 13:31:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Cleaned up some comments.
-
-Tue Mar 29 13:24:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Removing data for idempotent
- titlecasing.
-
- * enc/unicode.c: Adjust code to data removal.
-
-Tue Mar 29 12:45:18 2016 Laurent Arnoud <laurent@spkdev.net>
-
- * lib/webrick/httpresponse.rb: Move error_body to method. It allow to
- override the body more easily. [fix GH-1307]
- * test/webrick/test_httpresponse.rb: ditto.
-
-Tue Mar 29 06:40:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (rb_compile_err_append): rb_thread_t::base_block is no
- longer used.
-
- * iseq.c (rb_iseq_compile_with_option): ditto, no protection is
- needed.
-
-Tue Mar 29 06:39:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (struct parser_params): move parse_in_eval flag from
- rb_thread_t.
-
- * parse.y (rb_parser_set_context): set parsing context, not only
- mild error flag.
-
- * iseq.c (rb_iseq_compile_with_option): the parser now refers no
- thread local states to be restored.
-
- * vm_eval.c (eval_string_with_cref): ditto.
-
-Mon Mar 28 21:24:02 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * numeric.c (int_pos_p): fix typos.
-
-Mon Mar 28 14:54:49 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Refactoring in preparation for data reduction for
- titlecase.
-
-Mon Mar 28 14:36:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Minor refactoring for I WITH DOT ABOVE.
-
-Mon Mar 28 14:26:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Removed code now covered by data from table.
-
-Mon Mar 28 11:49:21 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Adding comments. [ci skip]
-
-Mon Mar 28 11:30:23 2016 Shinichi Maeshima <netwillnet@gmail.com>
-
- * lib/rubygems.rb: Fix `Gem.find_spec_for_exe` picks oldest gem.
- https://github.com/travis-ci/travis-ci/issues/5798
- https://github.com/rubygems/rubygems/pull/1566
- * test/rubygems/test_gem.rb: ditto.
-
-Mon Mar 28 11:26:31 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.2.
- Please see entries of 2.6.2 on
- https://github.com/rubygems/rubygems/blob/master/History.txt
-
-Mon Mar 28 11:02:31 2016 Hiroshi Shirosaki <h.shirosaki@gmail.com>
-
- * 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]
-
-Mon Mar 28 08:19:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): refactor floating point format of
- Rational by using generic Integer functions.
-
- * sprintf.c (rb_str_format): fix buffer overflow, length must be
- greater than precision. reported by William Bowling <will AT
- wbowling.info>.
-
-Sun Mar 27 12:13:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): convert Rational to floating point
- format by using generic Integer functions, not by methods which
- can be overwritten.
-
-Sat Mar 26 10:55:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (rb_int2str): conversion function to String for
- generic Integer.
-
- * numeric.c (rb_int_round): rounding function for generic
- Integers.
-
- * numeric.c (rb_int_{uminus,plus,minus,mul,idiv,modulo}): basic
- arithmetic functions for generic Integers.
-
- * numeric.c (FIXNUM_{POSITIVE,NEGATIVE,ZERO}_P): predict macros
- only for Fixnum.
-
-Sat Mar 26 06:34:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * localeinit.c (rb_locale_charmap_index): fix prototype.
- patched by Andreas Schwab [Bug #12218]
-
-Fri Mar 25 16:40:48 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: Additional tests title case;
- some not yet activated.
-
-Fri Mar 25 13:38:11 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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]
-
- * ext/openssl/ossl_ssl.c: update #ifdef(s) as above.
-
- * test/openssl/test_ssl.rb: skip NPN tests if NPN is disabled.
-
-Fri Mar 25 11:08:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/uri/http.rb (URI::HTTP#initialize): [DOC] fix example,
- missing mandatory arguments. [ruby-core:74540] [Bug #12215]
-
-Fri Mar 25 01:50:58 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * thread_pthread.c (reserve_stack): fix reserving position where
- the stack growing bottom to top. [Bug #12118]
-
-Fri Mar 25 01:10:42 2016 Sebastian Schuberth <sschuberth@gmail.com>
-
- * lib/mkmf.rb (find_executable0): On Windows, it is actually valid
- to surround individual PATH directory entries with double
- quotes. Remove these before joining the path as otherwise the
- literal quotes would become part of the path, resulting in the
- executable not to be found. [Fix GH-1305]
-
-Thu Mar 24 22:38:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (FMT, FMTV): remove recursive-assignments to get rid
- of undefined behavior. [ruby-core:74532] [Bug #12213]
-
-Thu Mar 24 17:44:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (FMT_PADDING): extract format for padding.
-
- * strftime.c (FMT_PRECISION): extract precision formula.
-
- * strftime.c (FMTV): append formatted string to expand the result.
-
-Thu Mar 24 14:20:21 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (STRFTIME): deal with case conversion flags for
- recursive formats.
-
-Thu Mar 24 12:43:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/date/date_core.c (dt_lite_iso8601): strftimev() always
- returns a String, so append them directly.
-
- * ext/date/date_core.c (d_lite_jisx0301, iso8601_timediv),
- (dt_lite_jisx0301): format by the format string in local buffer
- to prevent intermediate strings from GC.
-
- * ext/date/date_core.c (mk_inspect_raw, mk_inspect): inspect by
- "%+"PRIsVALUE, to prevent intermediate strings from GC.
-
-Thu Mar 24 11:43:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime_with_timespec): remove unnecessary
- check, as `s` equals to `endp` when recursed STRFTIME resized
- the capacity same as the size.
-
-Wed Mar 23 21:48:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (ary_inject_op): put subtract operation out of if-clause.
-
-Wed Mar 23 21:38:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * enum.c (ary_inject_op): Use Kahan's compensated summation algorithm
- for summing up float values.
-
-Wed Mar 23 20:56:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * strftime.c (rb_strftime_with_timespec): append formatted results
- to the given string with expanding, and also deal with NUL chars.
-
- * strftime.c (rb_strftime, rb_strftime_timespec): return formatted
- string, not the length put in the given buffer.
-
- * time.c (rb_strftime_alloc): no longer needs to retry with
- reallocating buffers.
-
- * time.c (time_strftime): no longer needs to split by NUL chars.
-
-Wed Mar 23 14:23:54 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * lib/rdoc/ri/driver.rb (interactive): rescue NotFoundError raised in
- expand_name. (display_name rescues NotFoundError by itself,
- the original logic looks buggy...)
-
-Wed Mar 23 11:44:53 2016 cremno <cremno@mail.ru>
-
- * marshal.c (r_long): cast to `signed char`, which is used
- already, instead of SIGN_EXTEND_CHAR.
-
- * parse.y: SIGN_EXTEND_CHAR is no longer used. [Fix GH-1302]
-
-Wed Mar 23 11:38:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Wed Mar 23 10:39:38 2016 Koichi ITO <koic.ito@gmail.com>
-
- * variable.c: Added documentation about order of `Module#constants`
- [ci skip][Bug #12121][ruby-dev:49505][fix GH-1301]
-
-Tue Mar 22 21:08:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h: Additional flag for characters that are titlecase.
-
- * enc/unicode/case-folding.rb, casefold.h: Using above flag in data.
-
- * enc/unicode.c: Marking capitalized character as unmodified if it is
- already titlecase.
-
- * test/ruby/enc/test_case_mapping.rb: Tests for above functionality.
-
-Tue Mar 22 14:18:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (lambda_body, parser_yylex): warn mismatched indentation
- of lambda block.
-
-Tue Mar 22 11:36:49 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (wmul): wrong condition.
- fixed many test failures on 32bit and LLP64 platforms.
-
-Tue Mar 22 10:31:34 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (wdiv, wmod): wdivmod0() assumes the 3rd and the 4th arguments
- are valid pointers.
- maybe checking them in wdivmod0() is better manner, but I guess that
- passing real dummy pointers may be faster than checking and branching
- in wdivmod0().
- this commit fixes SEGV on 32bit and LLP64 platforms.
-
-Tue Mar 22 10:24:04 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * time.c (divmodv): void function never returns any value.
-
-Tue Mar 22 10:11:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit.rb (Test::Unit::StatusLine#failed): print
- failed messages only if replacing mode, otherwise defer them
- until the end, to get rid of interleaving failures with progress
- messages. refix r54195.
-
-Tue Mar 22 03:45:03 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (MUL_OVERFLOW_FIXWV_P): defined for FIXWV.
-
- * time.c (wmul): use MUL_OVERFLOW_FIXWV_P and only switch.
-
- * time.c (wmul): use mul which has Fixnum optimization.
-
- * time.c (rb_time_magnify): If WIDEVALUE_IS_WIDER, wmul() has the same
- optimized logic, else mul() has also the similar logic for Fixnum.
-
- * time.c (rb_time_unmagnify): almost ditto.
-
-Tue Mar 22 03:10:09 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (divmodv): add the case both arguments are Fixnum.
-
- * time.c (wquo): use quo which has Fixnum optimization.
-
- * time.c (wdivmod0): added for WIDEVALUE_IS_WIDER.
-
- * time.c (wdivmod): use wdivmod0 and divmodv.
- divmodv has Fixnum optimization.
-
- * time.c (wdiv): use wdivmod0 and div to avoid the use of divmodv which
- calls id_quo whose return value is array.
-
- * time.c (wmod): use wdivmod0 and mod to avoid the use of divmodv which
- calls id_quo whose return value is array.
-
-Mon Mar 21 22:32:50 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * internal.h (rb_fix_divmod_fix): like r54213, use FIX2NUM only if
- x == FIXNUM_MIN && y == -1. This must be a rare case and it is
- expected compiler to handle well.
-
-Mon Mar 21 22:15:11 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (mod): Add Fixnum case.
-
- * time.c (quo): c can be Fixnum except a == FIXNUM_MIN && b == -1.
- Such case can be optimized out because quo()'s argument is constant.
-
-Mon Mar 21 22:09:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (rb_fix_mul_fix): multiply converted values, not
- object VALUEs.
-
-Mon Mar 21 20:18:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
- long option.
-
- * cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL): suppress path name
- conversions by msys2. [ruby-dev:49525] [Bug #12199]
-
-Mon Mar 21 19:09:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (enc_succ_alnum_char): try to skip an invalid character
- gap between GREEK CAPITAL RHO and SIGMA.
- [ruby-core:74478] [Bug #12204]
-
-Mon Mar 21 18:55:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (rb_gc_mark_node): NODE_MATCH2 can have nd_args, u3,
- since r54100.
-
-Sun Mar 20 21:17:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * internal.h (rb_int128t2big): declare only when HAVE_INT128_T.
- fixed a compile error with VC++ introduced at r54203.
-
-Sun Mar 20 20:10:14 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * internal.h (DLONG): defined if long is 32bit (and LONG_LONG is 64bit;
- but LONG_LONG is always defined as 64bit), or there's int128_t.
-
- * internal.h (DL2NUM): defined if DLONG is defined.
-
- * internal.h (rb_fix_mul_fix): defined for `Fixnum * Fixnum`.
-
- * insns.def (opt_mul): use rb_fix_mul_fix().
-
- * numeric.c (fix_mul): ditto.
-
- * time.c (mul): ditto.
-
-Sun Mar 20 18:53:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_gt, fix_ge, fix_lt, fix_le): optimize comparisons
- Fixnum against Bignum by rb_big_cmp in inversed order without
- new Bignum instance.
-
-Sun Mar 20 18:44:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (add): remove FIXABLE() which is in LONG2NUM().
-
- * time.c (sub): ditto.
-
- * time.c (mul): ditto.
-
-Sun Mar 20 04:46:02 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bignum.c (rb_big_cmp): reduce the code.
-
- * bignum.c (rb_big_eq): If normalized bignum is still bignum,
- it must be larger than fixnum.
-
-Sat Mar 20 00:58:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * include/ruby/intern.h (rb_big_odd_p, rb_big_even_p): move to
- internal.h so that they are exported only for ruby itself.
-
- * internal.h (rb_big_odd_p, rb_big_even_p): ditto.
-
-Sat Mar 19 21:56:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit.rb (Test::Unit::StatusLine#failed): defer
- failed messages until the end in verbose mode, to get rid of
- interleaving failures with progress messages.
-
-Sat Mar 19 21:53:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (fix_cmp): invert the result as the comparison is
- inverted.
-
-Sat Mar 19 18:32:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (int_to_f): raise NotImplementedError when a receiver
- class is unknown.
-
- * test/-ext-/integer/test_my_integer.rb (test_my_integer_to_f): modify
- a test for the above change.
-
-Sat Mar 19 18:21:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (Bignum#<=>): remove it because they are unified with
- Integer#<=>.
-
- * numeric.c (Integer#<=>, Fixnum#<=>): move <=> method from Fixnum to
- Integer.
-
- * numeric.c (int_cmp): add this method for Integer#<=>.
-
- * test/-ext-/integer/test_my_integer.rb (test_my_integer_cmp): add a
- test to examine Integer#<=> for unknown subclasses.
-
-Sat Mar 19 14:46:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_compile_with_option): make the parser in mild
- error.
-
- * load.c (rb_load_internal0): ditto.
-
- * parse.y (yycompile0): return the error message within the error
- to be raised. [Feature #11951]
-
- * parse.y (parser_compile_error): accumulate error messages in the
- error_buffer.
-
-Sat Mar 19 03:57:13 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * time.c (LOCALTIME): organize #ifdefs.
-
- * time.c (GMTIME): define only ifndef HAVE_STRUCT_TM_TM_GMTOFF.
-
-Sat Mar 19 03:53:31 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (rb_cv_member_struct_tm_tm_gmtoff): For Linux (glibc)
- define _BSD_SOURCE for time.h to define struct tm.tm_gmtoff.
-
- * time.c: define _BSD_SOURCE at the top.
-
-Sat Mar 19 03:00:50 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Fri Mar 19 00:00:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (rb_big_to_f, Bignum#to_f): removed them because they are
- unified with int_to_f and Integer#to_f.
-
- * numeric.c (int_to_f): treat Bignum values directly.
-
-Fri Mar 18 23:41:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (int_to_f, fix_to_f): rename fix_to_f to int_to_f, and add
- treatment for subclasses which don't have definitions of to_f method.
-
- * numeric.c (Integer#to_f, Fixnum#to_f): move to_f method from Fixnum
- to Integer.
-
- * ext/-test-/integer/my_integer.c: define helper class for testing
- to_f method for a subclass of Integer.
-
- * ext/-test-/integer/extconf.rb: ditto.
-
- * ext/-test-/integer/init.c: ditto.
-
- * test/-ext-/integer/test_my_integer.rb: examine to_f method for a
- subclass of Integer.
-
-Fri Mar 18 22:32:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * include/ruby/intern.h (rb_big_hash): Move to internal.h.
-
- * internal.h: ditto.
-
-Fri Mar 18 22:10:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (Bignum#eql?): remove its definition because it is unified
- with Numeric#eql?.
-
- * numeric.c (num_eql): treat Bignum values directly.
-
-Fri Mar 18 21:57:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (rb_big_to_s, Bignum#to_s): remove its definition because
- it is unified with Integer#to_s.
-
- * numeric.c (int_to_s): treat Bignum values directly.
-
-Fri Mar 18 21:30:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (int_to_s): Move from fix_to_s.
-
- * numeric.c (Integer#to_s): Move from Fixnum#to_s.
-
-Fri Mar 18 16:22:24 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
-
- * 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]
-
-Fri Mar 18 12:25:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * gc.c (tick): fix missing close parenthesis. [Fix GH-1291]
-
-Fri Mar 18 10:24:12 2016 Naotoshi Seo <sonots@gmail.com>
-
- * ext/date/date_core.c (datetime_to_time): preserve timezone info
- [Bug #12189] [Fix GH-1295]
-
-Fri Mar 18 10:17:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (rb_big_hash): make it public function to be available in
- other source files, and remove documentation comment for Bignum#hash.
-
- * bignum.c (Bignum#hash): remove its definition because it is unified
- with Object#hash.
-
- * include/ruby/intern.h (rb_big_hash): add a prototype declaration.
-
- * hash.c (any_hash): treat Bignum values directly.
-
-Fri Mar 18 02:35:12 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/time.rb (parse, strptime): Fix Time.parse/strptime does not
- have compatibility with DateTime.parse/strptime in terms of parsing
- timezone [Bug #12190] [Fix GH-1297]
-
-Fri Mar 18 02:17:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (fix_zero_p, fix_even_p, fix_odd_p): remove needless
- functions.
-
-Fri Mar 18 02:15:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * numeric.c (int_even_p): treat Fixnum and Bignum values directly.
-
-Fri Mar 18 02:07:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (Bignum#even?, Bignum#odd?): remove definitions
- because they are unified with Integer#even? and Integer#odd?.
-
- * numeric.c (Fixnum#zero?, Fixnum#even?, Fixnum#odd?): remove
- definitions because they are unified with Numeric#zero?,
- Integer#even?, and Integer#odd?.
-
- * numeric.c (num_zero_p, int_odd_p): treat Fixnum and
- Bignum values directly.
-
- * test/ruby/test_integer.rb (test_odd_p_even_p): remove meaningless
- test case.
-
-Fri Mar 18 01:51:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * bignum.c (rb_big_even_p, rb_big_odd_p): make them public functions
- to be available in other source files.
-
- * include/ruby/intern.h (rb_big_even_p, rb_big_odd_p): add prototype
- declarations.
-
-Fri Mar 18 00:25:56 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (ary_inject_op): Implement the specialized code for sum of
- float numbers.
-
-Fri Mar 18 00:15:05 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp
- created an object which caused extra overhead.
-
-Thu Mar 17 22:21:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
- macro, and expand for each RB_GC_GUARD. [Fix GH-1293]
-
-Thu Mar 17 22:08:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (iseq_specialized_instruction): move specialization
- for opt_newarray_max/min from translation phase.
-
-Thu Mar 17 21:52:09 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * array.c, enum.c: make rdoc format consistent.
-
-Thu Mar 17 21:47:57 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * NEWS: add Array#max, #min, and the optimization. [Feature #12172]
-
-Thu Mar 17 21:45:02 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * compile.c (NODE_CALL): add optimization shortcut for Array#max/min.
- Now `[x, y].max` is optimized so that a temporal array object is not
- created in some condition. [Feature #12172]
-
- * insns.def (opt_newarray_max, opt_newarray_min): added.
-
-Thu Mar 17 21:35:52 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * array.c (rb_ary_max, rb_ary_min): implement Array#max and min with
- arguments. replace super call with rb_nmin_run.
-
- * enum.c (nmin_run): exported (as rb_nmin_run).
-
- * internal.h: added a prototype for rb_nmin_run.
-
-Thu Mar 17 21:24:52 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * array.c (rb_ary_max, rb_ary_min): implement a block by itself instead
- of delegating Enumerable#max/min.
-
-Thu Mar 17 21:09:34 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * array.c (rb_ary_max, rb_ary_min): Array#max and Array#min added.
- [Feature #12172]
-
- * internal.h (OPTIMIZED_CMP): moved from enum.c so that array.c can
- use it.
-
- * test/ruby/test_array.rb (test_max, test_min): tests for Array#max
- and Array#min.
-
- * test/ruby/test_enum.rb (test_max, test_min): revised a bit to test
- Enumerable#max and #min explicitly.
-
-Thu Mar 17 21:02:42 2016 Yusuke Endoh <mame@ruby-lang.org>
-
- * internal.c: struct cmp_opt_data added for refactoring out a data
- structure for CMP_OPTIMIZABLE
-
- * array.c (struct ary_sort_data): use struct cmp_opt_data.
-
- * enum.c (struct min_t, max_t, min_max_t): use struct cmp_opt_data.
-
-Thu Mar 17 20:55:21 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (ary_inject_op): Extracted from enum_inject.
-
-Thu Mar 17 18:39:04 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_inject): Implement the specialized code for sum of
- integers including Bignums.
-
- * internal.h (rb_fix_plus): Declared to be usable from enum_inject.
-
- * numeric.c (rb_fix_plus): Defined.
-
-Thu Mar 17 17:20:28 2016 Anton Davydov <antondavydov.o@gmail.com>
-
- * thread_sync.c: [DOC] Update documentation for Queue class
- description. [Fix GH-1292]
-
-Thu Mar 17 17:14:51 2016 Dinar Valeev <dvaleev@suse.com>
-
- * gc.c (tick): Use __builtin_ppc_get_timebase for POWER arch.
- [Fix GH-1291]
-
-Thu Mar 17 11:51:48 2016 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
-
-Thu Mar 17 12:09:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Fixed two macro definitions.
- * test/ruby/enc/test_case_mapping.rb: Test cases that detected
- the above bugs.
-
-Thu Mar 17 11:36:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/option.c (inspect_tcpi_msec): more accurate condition
- for TCPI msec member inspection function.
- [ruby-core:74388] [Bug #12185]
-
-Thu Mar 17 08:13:43 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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).
-
-Thu Mar 17 07:17:36 2016 Eric Hodel <drbrain@segment7.net>
-
- * marshal.c (r_object0): raise ArgumentError when linking to undefined
- object.
-
-Thu Mar 17 00:45:00 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * test/ruby/test_bignum.rb: Make sure to use Bignum values in the tests.
-
-Wed Mar 16 23:10:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/keywords (alias, undef): symbol literals are allowed.
-
- * parse.y (parse_percent): should parse symbol literals for alias
- and undef. [ruby-dev:47681] [Bug #8851]
-
-Wed Mar 16 21:39:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * enc/trans/JIS: update Unicode's notice. [Bug #11844]
-
-Wed Mar 16 20:03:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * proc.c (proc_binding): proc from symbol can not make a binding.
- [ruby-core:74100] [Bug #12137]
-
-Wed Mar 16 18:42:45 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: Fixed and activated a test for Cherokee.
-
-Wed Mar 16 17:58:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: Fixed a logical error.
-
-Wed Mar 16 17:57:34 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: Adding tests for Cherokee.
- One test not yet working.
- (with Kimihito Matsui)
-
-Wed Mar 16 15:44:05 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: Adding tests for actual Unicode
- case mapping. Fixing some aliasing issues.
- (with Kimihito Matsui)
-
-Tue Mar 15 21:38:28 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_inject): Consider redefinition of Fixnum#+.
- [ruby-dev:49510] [Bug#12178] Reported by usa.
-
-Tue Mar 15 20:32:57 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_inject): Implement the specialized code for :+ operator
- for Fixnums.
-
-Tue Mar 15 20:21:01 2016 Tanaka Akira <akr@fsij.org>
-
- * enum.c (enum_inject): Implement the specialized code for self is an
- array and a symbol operator is given.
-
-Tue Mar 15 16:29:51 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Eliminating common code.
- (with Kimihito Matsui)
-
-Tue Mar 15 16:17:09 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Expansion of some code repetition in preparation for
- elimination of common code pieces.
- (with Kimihito Matsui)
-
-Tue Mar 15 13:49:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Additional macros and code to use mapping data in
- CaseMappingSpecials array.
- (with Kimihito Matsui)
-
-Tue Mar 15 13:41:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h (rb_gc_mark_global_tbl): should be private,
- but was accidentally exported.
-
-Tue Mar 15 12:51:06 2016 Marcus Stollsteimer <sto.mar@web.de>
-
- * doc/extension.ja.rdoc: Fix RDoc markup in doc/extension*.rdoc.
- [ci skip][Bug #12143][ruby-core:74143]
- * doc/extension.rdoc: ditto.
-
-Tue Mar 15 09:56:41 2016 Ian Lunderskov <ian.lunderskov@gmail.com>
-
- * time.c: Minor typo in Time#dst? documentation.
- [ci skip][fix GH-1290]
-
-Tue Mar 15 04:36:41 2016 Charles Oliver Nutter <headius@headius.com>
-
- * test/ruby/test_rubyoptions.rb (test_disable): add tests for
- --disable-gems and --disable-did_you_mean.
-
-Tue Mar 15 03:35:04 2016 Eric Hodel <drbrain@segment7.net>
-
- * marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
-
-Tue Mar 15 01:22:27 2016 Charles Oliver Nutter <headius@headius.com>
-
- * test/ruby/test_rubyoptions.rb: make version matching support
- JRuby's version output.
-
-Mon Mar 14 19:05:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * bignum.c (big2str_2bdigits): reduce div instruction.
-
-Mon Mar 14 18:39:53 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h, enc/unicode.c: Adjusting flag assignments
- and macros to work with unified CaseMappingSpecials array.
- (with Kimihito Matsui)
-
-Mon Mar 14 16:53:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (compile_named_capture_assign): optimize named capture
- assignments, by replacing repeating global variable accesses
- with `dup`, and by returning the matched result instead of
- re-getting it from the MatchData.
-
- * parse.y (reg_named_capture_assign_gen): build just assignment
- nodes for the optimization.
-
-Mon Mar 14 16:02:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * file.c (ruby_is_fd_loadable): now return -1 if loadable but
- may block.
-
- * ruby.c (open_load_file): wait to read by the result of
- ruby_is_fd_loadable, without fstat.
-
-Mon Mar 14 13:38:38 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * numeric.c (fix2str): improve r54092 like rb_int2big().
-
-Mon Mar 14 10:02:23 2016 Eric Wong <e@80x24.org>
-
- * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): document as MT-unsafe
- [ruby-core:73803] [Bug #12069]
-
-Sun Mar 13 09:43:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/win32.h (O_SHARE_DELETE): change to fit Fixnum
- limit. [ruby-core:74285] [Bug #12171]
-
-Sun Mar 13 09:15:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (rb_fix2str): fix edge case, accidentally generated
- wrong Fixnum from LONG_MIN.
-
-Sat Mar 12 09:50:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Mar 12 02:44:48 2016 Tanaka Akira <akr@fsij.org>
-
- * test/lib/test/unit.rb: describe !/REGEXP/ in the help message.
-
-Fri Mar 11 17:03:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/test/unit.rb (Options#non_options): make regexp name
- options prefixed with "!" negative filters.
-
- * common.mk (TEST_EXCLUDES): use negative filter to exclude memory
- leak tests. -x option excludes test files, not test methods.
-
-Fri Mar 11 16:11:27 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Streamlining approach to
- case mapping data not available from case folding by unifying all
- three cases (special title, special upper, special lower).
- * enc/unicode.c: Adjust macro names for above (macros are currently inactive).
- (with Kimihito Matsui)
-
-Thu Mar 10 17:34:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (prepare_iseq_build): enable coverage by coverage_enabled
- option, not by parse_in_eval flag in the thread context.
-
- * iseq.h (rb_compile_option_struct): add coverage_enabled flag.
-
- * parse.y (yycompile0): set coverage_enabled flag if coverage
- array is made.
-
-Thu Mar 10 15:19:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * node.c (dump_option): nd_compile_option is a hidden hash object,
- cannot call inspect on it.
-
-Thu Mar 10 09:49:54 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Wed Mar 9 16:48:45 2016 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix my last commit (syntax error).
-
-Wed Mar 9 16:41:44 2016 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: fix output messages.
-
- * benchmark/memory_wrapper.rb: use respond_to? because
- member? does not work well.
-
-Wed Mar 9 16:20:25 2016 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: support memory usage benchmark.
- use `--measure-target=[target]'.
- Now, we can use the following targets:
- * real (default): real time which returns process time in sec.
- * peak: peak memory usage (physical memory) in bytes.
- * size: last memory usage (physical memory) in bytes.
-
- * benchmark/memory_wrapper.rb: ditto.
-
-Wed Mar 9 15:04:22 2016 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/bm_vm3_gc_old_full.rb: add GC.start benchmark.
-
- * benchmark/bm_vm3_gc_old_immediate.rb: ditto.
-
- * benchmark/bm_vm3_gc_old_lazy.rb: ditto.
-
-Wed Mar 9 14:59:11 2016 Koichi Sasada <ko1@atdot.net>
-
- * benchmark/driver.rb: exit benchmarking if a benchmark process
- receives signals.
-
-Wed Mar 9 13:22:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * test/lib/memory_status.rb: make Memory::Status independent of
- MiniTest::Skip.
-
- * test/lib/test/unit/assertions.rb (assert_no_memory_leak): skip
- if Memory::Status is not available.
-
-Wed Mar 9 09:19:55 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * test/io/wait/test_io_wait.rb (test_wait_readwrite_timeout):
- select(2) in AIX returns "readable" for the write-side fd
- of a pipe, so it is not possible to use a pipe to test
- the read-write timeout of IO#wait on AIX.
-
-Wed Mar 9 03:35:22 2016 Charles Oliver Nutter <headius@headius.com>
-
- * test/ruby/test_require.rb (test_require_with_loaded_features_pop):
- Only remove PATH so threads don't accidentally double-pop.
-
-Wed Mar 9 00:29:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_method.c (rb_alias): the original name should be properly
- available method_added method, set the name before calling the
- hook.
-
-Wed Mar 9 00:07:03 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/logger.rb (Logger::LogDevice#initialize): define using
- keyword arguments.
-
-Tue Mar 8 23:37:07 2016 Charles Oliver Nutter <headius@headius.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.
-
-Tue Mar 8 17:20:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * intern.h (rb_divmod): assume compilers `/` and `%` comply C99
- and reduce branching. If a compiler doesn't comply, add #ifdefs.
-
- * intern.h (rb_div): added for Ruby's behavior.
-
- * intern.h (rb_mod): added for Ruby's behavior.
-
- * insns.def (opt_div): use rb_div.
-
- * insns.def (opt_mod): use rb_mod.
-
- * numeric.c (fixdivmod): removed.
-
- * numeric.c (fix_divide): use rb_div.
-
- * numeric.c (fix_mod): use rb_mod.
-
- * numeric.c (fix_divmod): use rb_divmod.
-
-Tue Mar 8 17:53:09 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * insns.def (opt_mod): show its method name on ZeroDivisionError.
- [Bug #12158]
-
-Tue Mar 8 17:33:38 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write_console): now no need to check
- ERROR_CALL_NOT_IMPLEMENTED because it is for old Win9X.
-
-Tue Mar 8 16:54:29 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
- console supports it natively.
-
-Tue Mar 8 08:13:01 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * test/net/imap/test_imap.rb (test_idle_timeout): Because of the
- timeout specified in "imap.idle(0.2)", there is no guarantee 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).
-
-Tue Mar 8 00:42:22 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * ruby.c (warn_cr_in_shebang): meaningless check on DOSISH platforms.
- fixed a test failure introduced at r53998.
-
-Tue Mar 8 00:27:53 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb: fix method name typo.
- [ruby-core:72513] [Bug #11893] The patch provided by Akira Matsuda.
-
-
-Tue Mar 8 00:25:08 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/tcllib/toolbar.rb: fix method name typo.
- [ruby-core:72511] [Bug #11891] The patch provided by Akira Matsuda.
-
-
-Tue Mar 8 00:21:58 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * ext/tk/lib/tkextlib/blt/tree.rb: fix method name typo.
- [ruby-core:72510] [Bug #11890] The patch provided by Akira Matsuda.
-
-
-Tue Mar 8 00:11:47 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * ext/tk/lib/tk/menubar.rb: fix a typo in font name. [ruby-core:72505]
- [Bug #11886] The patch provided by Akira Matsuda.
-
- * ext/tk/sample/*.rb: ditto.
-
-Mon Mar 7 13:32:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * class.c (rb_define_class, rb_define_class_id_under): raise
- ArgumentError if super is 0, deprecated behavior which has been
- warned long time.
-
-Mon Mar 7 13:28:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * internal.h: move function declarations for class internals from
- include/ruby/intern.h.
-
-Mon Mar 7 10:58:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/win32ole/win32ole_event.c (rescue_callback): use
- rb_write_error_str instead of rb_write_error, to respect
- the encoding and prevent the message from GC.
-
- * internal.h (rb_write_error_str): export.
-
-Mon Mar 7 01:38:41 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Sun Mar 6 22:43:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * io.c (rb_obj_display): [DOC] fix output of Array, as Array#to_s
- is same as Array#inspect since 1.9.
-
-Sat Mar 5 09:50:58 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Sat Mar 5 09:17:54 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Sat Mar 5 07:36:27 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Sat Mar 5 07:14:10 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * 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.
-
-Sat Mar 5 03:07:40 2016 Rei Odaira <Rei.Odaira@gmail.com>
-
- * thread_pthread.c (getstack): __pi_stacksize returned by
- pthread_getthrds_np() is wrong on AIX. Use
- __pi_stackend - __pi_stackaddr instead.
-
-Fri Mar 4 19:19:42 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: use 2 bits with unsigned int for rb_objspace::flags::mode
- because it always returns 0 to 2 (non-negative value).
-
-Fri Mar 4 18:42:08 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: rename "enum gc_stat" to "enum gc_mode"
- because there is a same name (no related) function gc_stat().
-
- Also gc_stat_* are renamed to gc_mode_*,
- gc_stat_transition() to gc_mode_transition(),
- rb_objspace::flags::stat is renamed to rb_objspace::flags::mode.
-
- Change rb_objspace::flags::mode from 2 bits to 3 bits because VC++
- returns negative enum value with 2 bits.
-
- * gc.c (gc_mode): add a macro to access rb_objspace::flags::mode
- with verification code (verification is enabled only on
- RGENGC_CHECK_MODE > 0).
-
- * gc.c (gc_mode_set): same macro for setter.
-
-Fri Mar 4 09:28:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.1.
- Please see entries of 2.6.0 and 2.6.1 on
- https://github.com/rubygems/rubygems/blob/master/History.txt
- [fix GH-1270] Patch by @segiddins
-
-Thu Mar 3 14:09:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (modifiable?, new_ostruct_member!, table!):
- rename methods for internal use with suffixes and make private,
- [ruby-core:71069] [Bug #11587]
-
-Wed Mar 2 16:28:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_eval.c (method_missing): call by found method entry and get
- rid of searching the same method entry twice.
-
- * vm_eval.c (vm_call0_body): calling method_missing method is
- method_missing().
-
-Wed Mar 2 15:13:33 2016 herwinw <herwin@quarantainenet.nl>
-
- * lib/xmlrpc.rb: Removed broken parser named XMLScanStreamParser.
- It's not works with current Ruby version.
- [fix GH-1271][ruby-core:59588][Bug #9369]
- * lib/xmlrpc/config.rb: ditto.
- * lib/xmlrpc/parser.rb: ditto.
-
-Wed Mar 2 15:08:33 2016 herwinw <herwin@quarantainenet.nl>
-
- * lib/xmlrpc.rb: Removed broken parser named XMLTreeParser.
- Required gem of its parser didn't compile on newer Ruby versions.
- [fix GH-1271][ruby-core:59590][Bug #9370]
- * lib/xmlrpc/config.rb: ditto.
- * lib/xmlrpc/parser.rb: ditto.
-
-Tue Mar 1 11:25:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/fileutils.rb: use keyword arguments instead of option
- hashes.
-
-Mon Feb 29 16:50:20 2016 hanachin <hanachin@gmail.com>
-
- * array.c (rb_ary_push_m): [DOC] Remove trailing comma from
- Array#push example, as other Array examples doesn't put trailing
- comma. [Fix GH-1279]
-
-Mon Feb 29 16:31:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * common.mk, tool/mkconfig.rb: set cross_compiling option from
- Makefile, but not from rbconfig.rb, which is just going to be
- created by this command.
-
-Sun Feb 28 23:13:49 2016 C.J. Collier <cjcollier@linuxfoundation.org>
-
- * configure.in: Add summary to end of configure output.
- [Fix GH-1275]
-
-Sun Feb 28 20:23:36 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/drb/drb.rb (error_print): Add verbose failure messages and
- avoid infamous DRb::DRbConnError. [Feature #12101]
-
-Sun Feb 28 13:40:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (nometh_err_initialize): add private_call? parameter.
-
- * error.c (nometh_err_private_call_p): add private_call? method,
- to tell if the exception raised in private form FCALL or VCALL.
- [Feature #12043]
-
- * vm_eval.c (make_no_method_exception): append private_call?
- argument.
-
- * vm_insnhelper.c (ci_missing_reason): copy FCALL flag.
-
-Sun Feb 28 10:19:47 2016 Ryan T. Hosford <tad.hosford@gmail.com>
-
- * array.c (rb_ary_and): clarify that set intersection returns the
- unique elements common to both arrays.
-
- * array.c (rb_ary_or): clarify that union preserves the order from
- the given arrays.
-
-Sat Feb 27 17:05:29 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Reducing size of TitleCase
- table by eliminating duplicates.
- (with Kimihito Matsui)
-
-Fri Feb 26 14:40:48 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (num_step_scan_args): comparison String with Numeric
- should raise TypeError. it is an invalid type, but not a
- mismatch the number of arguments. [ruby-core:62430] [Bug #9810]
-
-Fri Feb 26 14:39:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri Feb 26 12:25:56 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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]
-
-Fri Feb 26 11:21:41 2016 herwinw <herwin@quarantainenet.nl>
-
- * lib/xmlrpc.rb: Removed references to NQXML. It's obsoleted parser.
- [fix GH-1245][ruby-core:59593][Feature #9371]
- * lib/xmlrpc/config.rb: ditto.
- * lib/xmlrpc/parser.rb: ditto.
-
-Fri Feb 26 11:10:19 2016 Rick Salevsky <rsalevsky@suse.com>
-
- * lib/tmpdir.rb: Unify to coding-style for method definition.
- [fix GH-1252]
-
-Fri Feb 26 11:02:04 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * README.md: update markdown syntax for anchor tag.
- [fix GH-1265] Patch by @lukBarros
-
-Fri Feb 26 10:52:29 2016 Alex Boyd <alex@opengroove.org>
-
- * lib/irb.rb: avoid to needless truncation when using back_trace_limit option.
- [fix GH-1205][ruby-core:72773][Bug #11969]
-
-Fri Feb 26 08:11:58 2016 Aaron Patterson <tenderlove@ruby-lang.org>
-
- * gem_prelude.rb: Reduce system calls by activating the `did_you_mean`
- gem before requiring the gem. Activating the gem puts the gem on
- the load path, where simply requiring the file will search every gem
- that's installed until it can find a gem that contains the
- `did_you_mean` file.
-
-Thu Feb 25 19:04:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb: Adding possibility for debugging output
- for TitleCase table in casefold.h.
- (with Kimihito Matsui)
-
-Wed Feb 24 22:31:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h: Rearranging flag assignments and making
- space for titlecase indices; adding additional macros to add or
- extract titlecase index; adding comments for better documentation.
- * enc/unicode.c: Moving some macros to include/ruby/oniguruma.h;
- activating use of titlecase indices.
- (with Kimihito Matsui)
-
-Wed Feb 24 21:03:04 2016 Tanaka Akira <akr@fsij.org>
-
- * random.c (limited_rand): Add a specialized path for when the limit fits
- in 32 bit.
-
-Tue Feb 23 21:52:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Outputting actual titlecase
- data (new table, with indices from other tables).
- * enc/unicode.c: Ignoring titlecase data indices for the moment.
- (with Kimihito Matsui)
-
-Tue Feb 23 15:21:14 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Reading casing data from
- SpecialCasing.txt.
- (with Kimihito Matsui)
-
-Mon Feb 22 18:33:55 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Adding flag for title-case,
- not yet operational.
- (with Kimihito Matsui)
-
-Mon Feb 22 18:17:03 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Fixed bug that avoided inclusion
- of compatibility characters in upper-/lower-case mappings.
- (with Kimihito Matsui)
-
-Sun Feb 21 13:57:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cgi/escape/escape.c: Optimize CGI.unescape performance by C ext
- for ASCII-compatible encodings. [Fix GH-1250]
-
-Sun Feb 21 13:56:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * cgi/escape/escape.c: Optimize CGI.unescapeHTML performance by C
- ext for ASCII-compatible encodings. [Fix GH-1242]
-
-Sat Feb 20 15:38:16 2016 Eric Wong <e@80x24.org>
-
- * doc/extension.rdoc: update paths for defs/ directory
-
-Sat Feb 20 14:44:15 2016 Lucas Buchala <lucasbuchala@gmail.com>
-
- * vm_eval.c (rb_mod_module_eval): [DOC] Fix documentation
- signature for Module#module_eval. [Fix GH-1258]
-
-Sat Feb 20 14:40:44 2016 Adam O'Connor <northband@gmail.com>
-
- * README.md: a few grammatical changes to the main Ruby README.md.
- [Fix GH-1259]
-
-Sat Feb 20 13:04:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sat Feb 20 01:53:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_mod_const_get): make error message at uninterned
- string consistent with symbols. [ruby-dev:49498] [Bug #12089]
-
-Fri Feb 19 23:37:52 2016 Masahiro Tomita <tommy@tmtm.org>
-
- * lib/find.rb (Find#find): raise with the given path name if it
- does not exist. [ruby-dev:49497] [Bug #12087]
-
-Fri Feb 19 12:44:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Activated use of case mapping data in CaseUnfold_11 array.
- (with Kimihito Matsui)
-
-Fri Feb 19 11:08:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/extmk.rb: add cygwin case, nothing excluded.
- [ruby-core:73806] [Bug#12071]
-
-Thu Feb 18 21:32:15 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * man/irb.1: fix output in EXAMPLES.
-
-Thu Feb 18 21:05:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (sym_match_m): delegate to String#match but not
- String#=~. [ruby-core:72864] [Bug #11991]
-
-Thu Feb 18 14:15:38 2016 Shota Fukumori <her@sorah.jp>
-
- * re.c: Add MatchData#named_captures
- [Feature #11999] [ruby-core:72897]
-
- * test/ruby/test_regexp.rb(test_match_data_named_captures): Test for above.
-
- * NEWS: News about MatchData#named_captures.
-
-Wed Feb 17 21:41:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * defs/id.def (predefined): add idLASTLINE and idBACKREF for $_
- and $~ respectively.
-
- * parse.y: use idLASTLINE and idBACKREF instead of rb_intern.
-
-Wed Feb 17 20:23:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_str_init): fix segfault and memory leak, consider
- wide char encoding terminator.
-
-Wed Feb 17 12:14:59 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (rb_str_init): introduce String.new(capacity: size)
- [Feature #12024]
-
-Tue Feb 16 19:10:08 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, casefold.h: Used only first element
- (rather than all) of target in CaseUnfold_11 array.
- (with Kimihito Matsui)
-
-Tue Feb 16 18:24:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * numeric.c (compare_with_zero): fix variable name, rb_cmperr
- requires VALUEs but not an ID.
-
-Tue Feb 16 17:34:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * dir.c (rb_dir_s_empty_p): add Dir.empty? method, which tells the
- argument is the name of an empty directory. [Feature #10121]
-
-Tue Feb 16 09:51:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb (without_destdir): just strip a drive letter
- which is prepended by with_destdir.
- pointed out by @DavidEGrayson.
- https://github.com/ruby/ruby/commit/0e5f9ae#commitcomment-16101763
-
-Tue Feb 16 04:42:13 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * insns.def (opt_plus): simply use LONG2NUM() instead of wrongly
- complex overflow case.
-
- * insns.def (opt_sub): ditto.
-
-Tue Feb 16 02:49:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/rbinstall.rb (without_destdir): compare with the destdir
- after stripping a drive letter, on dosish platforms.
- pointed out by @DavidEGrayson.
- https://github.com/ruby/ruby/commit/d0cf23b#commitcomment-16100407
-
-Mon Feb 15 15:44:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parse_ident): allow keyword arguments just after a
- method where the same name local variable is defined.
- [ruby-core:73816] [Bug#12073]
-
-Mon Feb 15 14:43:28 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb: Added debugging option
- (with Kimihito Matsui)
-
-Sun Feb 14 17:31:50 2016 Lars Kanis <lars@greiz-reinsdorf.de>
-
- * lib/mkmf.rb (with_{cpp,c,ld}flags): copy caller strings not to
- be modified, in append_{cpp,c,ld}flags respectively.
- [Fix GH-1246]
-
-Sun Feb 14 16:18:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (setup_exception): set the cause only if it is explicitly
- given or not set yet. [Bug #12068]
-
-Sat Feb 13 21:44:58 2016 Tanaka Akira <akr@fsij.org>
-
- * hash.c (rb_hash_invert): [DOC] more examples.
-
-Sat Feb 13 17:30:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/uri/generic.rb (URI::Generic#find_proxy): support CIDR in
- no_proxy. [ruby-core:73769] [Feature#12062]
-
-Sat Feb 13 17:11:58 2016 Fabian Wiesel <fabian.wiesel@sap.com>
-
- * lib/uri/generic.rb (find_proxy): exclude white-spaces and allow
- for a leading dot in the domain name in no_proxy.
- [ruby-core:54542] [Feature #8317]
-
-Fri Feb 12 12:20:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * error.c (name_err_initialize, nometh_err_initialize): [DOC] fix
- argument positions. optional parameters except for the message
- are placed at the last.
-
-Fri Feb 12 11:49:49 2016 Anthony Dmitriyev <antstorm@gmail.com>
-
- * net/ftp.rb: add NullSocket#closed? to fix closing not opened
- connection. [Fix GH-1232]
-
-Fri Feb 12 11:17:38 2016 Bogdan <bogdanvlviv@gmail.com>
-
- * re.c (rb_reg_initialize_m): [DOC] fix missing right bracket.
- [Fix GH-1243]
-
-Thu Feb 11 14:57:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (RUBY_CHECK_SIZEOF, RUBY_DEFINT): fix for types
- which are conditionally available depending on architectures
- when universal binary, e.g., __int128.
-
-Thu Feb 11 06:26:18 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (RUBY_DEFINT): use Parameter Expansion.
-
-Thu Feb 11 05:33:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in (int128_t): don't check HAVE_XXX (for example
- HAVE___INT128) because RUBY_CHECK_SIZEOF() don't define it for
- config.h and use of $ac_cv_sizeof___int128 alternates the check.
- (and don't need to define because users shouldn't know that)
-
-Wed Feb 10 12:03:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in (ARFLAGS): check if deterministic mode flag is
- effective, which is on by default on Ubuntu.
-
-Tue Feb 9 16:36:23 2016 Naotoshi Seo <sonots@gmail.com>
-
- * lib/logger.rb: Remove block from Logger.add as it's not needed
- patch provided by Daniel Lobato Garcia [fix GH-1240] [Bug #12054]
-
-Tue Feb 9 14:32:23 2016 Zachary Scott <zzak@ruby-lang.org>
-
- * ext/zlib/zlib.c: Document mtime header behavior with patch by @schneems
- Fixes [GH-1129]: https://github.com/ruby/ruby/pull/1129
-
-Tue Feb 9 13:52:49 2016 Zachary Scott <zzak@ruby-lang.org>
-
- * re.c: Remove deprecated kcode argument from Regexp.new and compile
- patch provided by Dylan Pulliam [Bug #11495]
-
-Mon Feb 8 21:26:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb, enc/unicode/casefold.h: Flags for
- upper/lower conversion added (titlecase and SpecialCasing still missing)
- (with Kimihito Matsui)
-
-Mon Feb 8 20:43:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c, enc/unicode.c: Disassociating ONIGENC_CASE_FOLD flag from
- ONIGENC_CASE_DOWNCASE.
- (with Kimihito Matsui)
-
-Mon Feb 8 13:00:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Shortened macros for enc/unicode/casefold.h to
- single-letter; use flags in casefold.h for logic.
-
- * enc/unicode/case-folding.rb: Added flag for case folding.
- Changed parameter passing.
-
- * enc/unicode/casefold.h: New flags added.
- (with Kimihito Matsui)
-
-Mon Feb 8 10:30:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (feature_option): raise a runtime error if ambiguous
- feature name is given, in the future. [Bug #12050]
-
-Mon Feb 8 09:43:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Removed enc/unicode/casefold.h from automatic build because
- some CI systems don't have gperf. Creation of enc/unicode/casefold.h
- is now possible with make unicode-up. This is intended as a temporary measure.
-
-Sun Feb 7 22:10:08 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Added two more precondition files for enc/unicode/casefold.h
-
- * enc/unicode.c: Added shortening macros for enc/unicode/casefold.h
-
- * enc/unicode/case-folding.rb: Fixed file encoding for CaseFolding.txt
- to ASCII-8BIT (should fix some ci errors). Clarified usage. Created
- class MapItem. Partially implemented class CaseMapping.
- (with Kimihito Matsui)
-
-Sun Feb 7 14:12:32 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb: Fixing parameter passing.
- (with Kimihito Matsui)
-
-Sun Feb 7 11:44:03 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode/case-folding.rb: New classes CaseMapping/CaseMappingDummy
- to pass as parameters; not yet implemented or used.
- (with Kimihito Matsui)
-
-Sun Feb 7 11:16:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: using new option in recipe for enc/unicode/casefold.h
-
- * enc/unicode/case-folding.rb: Correctly specify argument to new option.
- (with Kimihito Matsui)
-
-Sun Feb 7 10:43:27 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- (this commit message applies to the previous commit)
- * common.mk: explicit recipe for enc/unicode/casefold.h
-
- * enc/unicode/case-folding.rb: Adding -m option to prepare for using
- multiple data files.
- (with Kimihito Matsui)
-
-Sat Feb 6 22:30:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/cgi/util.rb (escapeHTML, unescapeHTML): consider
- ASCII-incompatible encodings. [Fix GH-1239]
-
-Sat Feb 6 15:18:28 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_regex_casefold.rb: Added data-based testing for
- String#downcase :fold.
-
- * enc/unicode.c: Fixed a range error (lowest non-ASCII character affected
- by case operations is U+00B5, MICRO SIGN)
-
- * test/ruby/enc/test_case_mapping.rb: Explicit test for case folding of
- MICRO SIGN to Greek mu.
- (with Kimihito Matsui)
-
-Sat Feb 6 14:51:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_regex_casefold.rb: Tests for three case folding
- primitives (mbc_case_fold, get_case_fold_codes_by_str,
- apply_all_case_fold) in the various encodings. Currently only known
- good encodings are tested to avoid test failures. For bug hunting,
- start by adding more encodings with
- generate_test_casefold encoding
- (with Kimihito Matsui)
-
-Sat Feb 6 14:37:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c, test/ruby/enc/test_case_mapping.rb: Implemented :fold
- option for String#downcase by using case folding data from
- regular expression engine, and added a few simple tests.
- (with Kimihito Matsui)
-
-Fri Feb 5 20:08:59 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_case_mapping.rb: added tests for :ascii option.
- (with Kimihito Matsui)
-
-Fri Feb 5 12:22:20 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * insns.def (opt_mult): Use int128_t for overflow detection.
-
- * bignum.c (rb_uint128t2big): added for opt_mult.
-
- * bignum.c (rb_uint128t2big): added for rb_uint128t2big..
-
- * configure.in: define int128_t, uint128_t and related MACROs.
- Initially introduced by r41379 but reverted by r50749.
-
-Thu Feb 4 21:05:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Activated :ascii flag for ASCII-only case conversion
- (with Kimihito Matsui)
-
-Thu Feb 4 17:38:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * re.c (reg_set_source): make source string frozen without
- copying.
-
- * re.c (rb_reg_initialize_m): refactor initialization with
- encoding.
-
-Thu Feb 4 15:35:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * string.c (rb_fstring_enc_new, rb_fstring_enc_cstr): functions to
- make fstring with encoding.
-
-Thu Feb 4 14:42:29 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Added Unicode data file SpecialCasing.txt to be additionally
- downloaded (with Kimihito Matsui)
-
-Thu Feb 4 12:39:08 2016 joker1007 <kakyoin.hierophant@gmail.com>
-
- * cgi/escape/escape.c: Optimize CGI.escape performance by C ext
- for ASCII-compatible encodings. [Fix GH-1238]
-
-Thu Feb 4 11:53:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Introduce two variables (UNICODE_DATA_DIR and
- UNICODE_SRC_DATA_DIR) to eliminate repetitions.
-
-Wed Feb 3 12:13:20 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * string.c (str_new_frozen): if the given string is embeddedable
- but not embedded, embed a new copied string. [Bug #11946]
-
-Wed Feb 3 08:25:38 2016 boshan <boshan@subsplash.com>
-
- * ext/openssl/ossl_pkey.c (Init_ossl_pkey): [DOC] Fix typo
- "encrypted" to "decrypted". [Fix GH-1235]
-
-Wed Feb 3 08:21:32 2016 Seiei Miyagi <hanachin@gmail.com>
-
- * 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]
-
-Wed Feb 3 02:33:39 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c (rb_reg_prepare_enc): use already compiled US-ASCII regexp
- if given string is ASCII only.
- 121.2s to 113.9s on my x86_64-freebsd10.2 Intel Core i5 661
-
-Tue Feb 2 13:02:03 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * re.c: Introduce RREGEXP_PTR.
- patch by dbussink.
- partially merge https://github.com/ruby/ruby/pull/497
-
- * include/ruby/ruby.h: ditto.
-
- * gc.c: ditto.
-
- * ext/strscan/strscan.c: ditto.
-
- * parse.y: ditto.
-
- * string.c: ditto.
-
-Tue Feb 2 09:08:27 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/rubygems/specification.rb: `coding` is effective only first
- line except shebang.
-
- * lib/rubygems/package.rb, lib/rubygems/package/*: ditto.
-
-Mon Feb 1 21:41:58 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * 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
-
-Sun Jan 31 12:33:13 2016 Dan Kreiger <dan@dankreiger.com>
-
- * test/drb/ut_large.rb (multiply, avg, median): add additional
- math operations to DRbLarge. [Fix GH-1086]
-
-Sun Jan 31 12:19:15 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_file_exhaustive.rb (test_lstat): Add lacking test
- for File#lstat. [Fix GH-1231]
-
-Sun Jan 31 12:15:33 2016 Prayag Verma <prayag.verma@gmail.com>
-
- * doc/standard_library.rdoc: fix typo [Fix GH-1230]
- Spelling mistakes -
- outputing > outputting
- publich > publish
-
-Sat Jan 30 15:18:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Fri Jan 29 17:40:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
-Fri Jan 29 17:07:27 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * 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]
-
- * win32/win32.c (rb_w32_read_reparse_point): check the reparse point is
- a volume mount point or not.
-
- * win32/file.c (rb_readlink): follow above change (but this pass won't
- be used).
-
-Fri Jan 29 16:17:07 2016 Lucas Buchala <lucasbuchala@gmail.com>
-
- * enum.c (enum_take_while, enum_drop_while): rename block
- parameter to obj, since they are generic objects. [Fix GH-1226]
-
-Fri Jan 29 14:15:26 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/erb.rb (ERB::Compiler#detect_magic_comment): allow
- frozen-string-literal in comment as well as encoding.
-
- * lib/erb.rb (ERB#def_method): insert def line just before the
- first non-comment and non-empty line, not to leave duplicated
- and stale magic comments.
-
-Fri Jan 29 11:13:33 2016 Jeremy Evans <code@jeremyevans.net>
-
- * lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as
- a buffer to make ERB work with --enable-frozen-string-literal.
- [ruby-core:73561] [Bug #12031]
-
-Fri Jan 29 10:44:56 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http/header.rb: Warn nil variable on HTTP Header.
- It caused to NoMethodError. [fix GH-952][fix GH-641] Patch by @teosz
- * test/net/http/test_httpheader.rb: Added test for nil HTTP Header.
-
-Thu Jan 28 17:31:43 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/socket.c (sock_gethostname): support unlimited size
- hostname.
-
-Wed Jan 27 21:03:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/-ext-/string/test_capacity.rb: Added missing library.
-
-Wed Jan 27 18:53:40 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Fixed bit mask in macro OnigCodePointCount
-
-Wed Jan 27 17:54:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Protect code point count by macro, in order to
- be able to use the remaining bits for flags.
- (with Kimihito Matsui)
-
-Wed Jan 27 16:34:35 2016 boshan <boshan@subsplash.com>
-
- * lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter
- `basename` is optional and defaulted to an empty string since
- [GH-523]. [Fix GH-1225]
-
-Wed Jan 27 16:25:54 2016 Koichi ITO <koic.ito@gmail.com>
-
- * array.c (rb_ary_dig): [DOC] fix the exception class to be raised
- when intermediate object does not have dig method. TypeError
- will be raised now. [Fix GH-1224]
-
-Tue Jan 26 19:36:15 2016 Aggelos Avgerinos <evaggelos.avgerinos@gmail.com>
-
- * array.c (permute0, rpermute0): [DOC] Substitute indexes ->
- indices in documentation for consistency. [Fix GH-1222]
-
-Tue Jan 26 15:21:37 2016 Eric Wong <e@80x24.org>
-
- * compile.c (caller_location): use rb_fstring_cstr for "<compiled>"
- (it is converted to fstring anyways inside rb_iseq_new_with_opt)
- * iseq.c (iseqw_s_compile): ditto
- * iseq.c (rb_iseq_new_main): use rb_fstring_cstr for "<main>"
- * vm.c (Init_VM): ditto, share with with above
- * iseq.c (iseqw_s_compile_file): rb_fstring before rb_io_t->pathv
- share "<main>" with above
- * vm.c (rb_binding_add_dynavars): fstring "<temp>" immediately
-
-Tue Jan 26 15:14:01 2016 Kazuki Yamaguchi <k@rhe.jp>
-
- * 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]
-
-Tue Jan 26 14:26:46 2016 Eric Wong <e@80x24.org>
-
- * signal.c (sig_list): use fstring for hash key
- * test/ruby/test_signal.rb (test_signal_list_dedupe_keys): added
-
-Tue Jan 26 13:08:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * signal.c (rb_f_kill): should immediately deliver reserved
- signals SIGILL and SIGFPE, not only SIGSEGV and SIGBUS.
-
-Tue Jan 26 07:57:28 2016 Joseph Tibbertsma <josephtibbertsma@gmail.com>
-
- * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
- [Fix GH-1221]
-
-Mon Jan 25 17:26:54 2016 Eric Wong <e@80x24.org>
-
- * ruby_assert.h (RUBY_ASSERT_WHEN): fix reference to macro name
- * vm_core.h: include ruby_assert.h before using
- [ruby-core:73371]
-
-Mon Jan 25 15:55:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * symbol.c (sym_check_asciionly): more informative error message
- with the encoding name and the inspected content.
- [ruby-core:73398] [Feature #12016]
-
-Mon Jan 25 09:38:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_string.rb: added testcase for next!, succ and succ!
- [fix GH-1213] Patch by @K0mAtoru
-
-Mon Jan 25 09:32:25 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/httpservlet/filehandler.rb: fix documentation for namespace.
- [fix GH-1219][ci skip] Patch by @leafac
-
-Sun Jan 24 19:34:23 2016 Eric Wong <e@80x24.org>
-
- * vm_insnhelper.c (vm_check_if_namespace): tiny size reduction
-
-Sun Jan 24 18:12:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Simplifying Unicode data file download logic to make
- it more reliable (including additional fix not in r53633) [Bug #12007]
-
-Sun Jan 24 16:54:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/io/wait/wait.c (io_wait_readwrite): [EXPERIMENTAL] allow to
- wait for multiple modes, readable and writable, at once. the
- arguments may change in the future. [Feature #12013]
-
-Sat Jan 23 22:30:59 2016 K0mA <mctj1218@gmail.com>
-
- * test/ruby/test_array.rb (test_keep_if): Add test for
- Array#keep_if separate from Array#select! [Fix GH-1218]
-
-Sat Jan 23 20:54:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * common.mk: revert r53633. It broke rubyci and travis.
- https://travis-ci.org/ruby/ruby/builds/104259623
-
-Sat Jan 23 20:10:29 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * range.c (range_eqq): revert r51585 because rb_call_super() is
- called in range_include() and thus r51585 doesn't work when the
- receiver Range object consists of non linear objects such as Date
- objects.
- [ruby-core:72908] [Bug #12003]
-
-Sat Jan 23 18:37:37 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * ChangeLog: Fixing wrong time on previous commit, and adding
- previous commit message to svn [ci skip]
-
-Sat Jan 23 18:30:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Simplifying Unicode data file download logic to make
- it more reliable [Bug #12007]
-
-Sat Jan 23 16:29:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * tool/downloader.rb: Fixed a logical error, improved documentation
-
-Sat Jan 23 11:42:43 2016 Peter Suschlik <ps@neopoly.de>
-
- * README.md: Use SVG Travis badge over PNG for better quality and
- device support. [Fix GH-1214] [Fix GH-1216]
-
-Sat Jan 23 11:29:16 2016 Pascal Betz <pascal.betz@simplificator.com>
-
- * lib/csv.rb: Update documentation of CSV header converter for
- r45498, [GH-575]. [Fix GH-1215]
-
-Fri Jan 22 17:36:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * vm_core.h (VM_ASSERT): use RUBY_ASSERT instead of rb_bug.
-
- * error.c (rb_assert_failure): assertion with stack dump.
-
- * ruby_assert.h (RUBY_ASSERT): new header for the assertion.
-
-Fri Jan 22 00:25:57 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * regparse.c (fetch_name_with_level): allow non word characters
- at the first character. [Feature #11949]
-
- * regparse.c (fetch_name): ditto.
-
-Thu Jan 21 17:34:01 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
-Thu Jan 21 16:37:50 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * Makefile.in (update-rubyspec): fix r53208 like r53451.
-
-Wed Jan 20 20:58:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * common.mk, Makefile.in: update-config_files is only for Unix
- platforms.
-
-Wed Jan 20 17:13:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/extlibs.rb: add --cache option to change cache directory.
-
-Tue Jan 19 17:03:40 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * common.mk: Added Unicode data file CaseFolding.txt to be additionally
- downloaded (with Kimihito Matsui)
-
-Tue Jan 19 10:09:58 2016 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * lib/shell.rb (Shell.debug_output_exclusive_unlock): remove
- because Mutex#exclusive_unlock was already deleted. [fix GH-1185]
-
-Tue Jan 19 09:38:27 2016 Nick Cox <nick@nickcox.me>
-
- * vm_method.c: fix grammar in respond_to? warning.
- [fix GH-1047]
-
-Mon Jan 18 14:37:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_here_document): an escaped newline is not an
- actual newline, and the rest part should not be dedented.
- [ruby-core:72855] [Bug #11989]
-
-Mon Jan 18 12:04:34 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang
- and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds
-
-Mon Jan 18 11:47:27 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * string.c: fix a typo. [fix GH-1202][ci skip] Patch by @sunboshan
-
-Sun Jan 17 21:15:30 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * configure.in: improve ICC (Intel C Compiler) support.
-
- * configure.in (CXX): The name of icc's c++ compiler is `icpc`.
-
- * configure.in (warnings): Add `-diag-disable=2259` to suppress
- noisy warnings: "non-pointer conversion from "..." to "..." may
- lose significant bits".
-
- * configure.in (optflags): Add `-fp-model precise` like -fno-fast-math.
-
- * lib/mkmf.rb: icc supports -Werror=division-by-zero
- and -Werror=deprecated-declarations, but doesn't support
- -Wdivision-by-zero and -Wdeprecated-declarations.
-
-Sun Jan 17 20:40:10 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Any kind of option is now taking the new code path for
- upcase/downcase/capitalize/swapcase. :lithuanian can be used for
- testing if no specific option is desired.
- * test/ruby/enc/test_case_mapping.rb: Adjusted to above.
- (with Kimihito Matsui)
-
-Sun Jan 17 20:10:10 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Fixed a logical error and some comments.
- * test/ruby/enc/test_case_mapping.rb: Made tests more general.
- (with Kimihito Matsui)
-
-Sun Jan 17 17:41:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Removed artificial expansion for Turkic,
- added hand-coded support for Turkic, fixed logic for swapcase.
- * string.c: Made use of new case mapping code possible from upcase,
- capitalize, and swapcase (with :lithuanian as a guard).
- * test/ruby/enc/test_case_mapping.rb: Adjusted for above.
- (with Kimihito Matsui)
-
-Sun Jan 17 15:30:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sun Jan 17 14:43:01 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_env.rb: [Fix GH-1201]
- * Extract test code for ENV#keep_if from ENV#select_bang
- * Add a test case for ENV#select_bang,keep_if
-
-Sun Jan 17 14:42:25 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_env.rb: [Fix GH-1201]
- * Extract test code for ENV#delete_if from ENV#reject_bang
- * Add a test case for ENV#reject_bang,delete_if
-
-Sun Jan 17 14:40:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ext/socket/option.c (check_size): extract a macro to check
- binary data size, with a consistent message.
-
- * ext/socket/option.c (sockopt_byte): fix error message,
- sizeof(int) differs from sizeof(unsigned char) in general.
-
-Sat Jan 16 21:16:21 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (xstring): reset heredoc indent after dedenting,
- so that following string literal would not be dedented.
- [ruby-core:72857] [Bug #11990]
-
-Sat Jan 16 17:24:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * enc/unicode.c: Artificial mapping to test buffer expansion code.
- * string.c: Fixed buffer expansion logic.
- * test/ruby/enc/test_case_mapping.rb: Tests for above.
- (with Kimihito Matsui)
-
-Sat Jan 16 16:47:14 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ext/openssl/lib/openssl/pkey.rb: Added 2048 bit DH parameter.
- * test/openssl/test_pkey_dh.rb: ditto.
-
-Sat Jan 16 10:51:19 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * enc/unicode.c: fix implicit conversion error with clang. fixup r53548.
- * string.c: ditto.
-
-Sat Jan 16 10:31:00 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * common.mk: test-sample was changed to test-basic.
- [Feature #11982][ruby-core:72823]
- * basictest/runner.rb: ditto. rename from tool/rubytest.rb.
- * basictest/test.rb: ditto. rename from sample/test.rb.
- * defs/gmake.mk: picked from r53540
- * sample/test.rb: backward compatibility for chkbuild.
-
-Sat Jan 16 10:23:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c, enc/unicode.c: New code path as a preparation for Unicode-wide
- case mapping. The code path is currently guarded by the :lithuanian
- option to avoid accidental problems in daily use.
- * test/ruby/enc/test_case_mapping.rb: Test for above.
- * string.c: function 'check_case_options': fixed logical errors
- (with Kimihito Matsui)
-
-Fri Jan 15 20:20:20 2016 Naohisa Goto <ngotogenome@gmail.com>
-
- * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): The value of
- UNALIGNED_WORD_ACCESS should be used to determine whether
- unaligned word access is allowed or not. After this commit,
- ./configure CPPFLAGS="-DUNALIGNED_WORD_ACCESS=0" disables
- unaligned word access even on platforms that support the feature.
-
-Fri Jan 15 16:12:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (string1): reset heredoc indent for each string literal
- so that concatenated string would not be dedented.
- [ruby-core:72857] [Bug #11990]
-
-Thu Jan 14 20:01:00 2016 NARUSE, Yui <naruse@ruby-lang.org>
-
- * 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
-
-Thu Jan 14 17:36:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_f_global_variables): add matched back references
- only, as well as defined? operator.
-
-Thu Jan 14 16:12:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * sprintf.c (rb_str_format): format exact number more exactly.
-
-Thu Jan 14 15:08:43 2016 Tony Arcieri <bascule@gmail.com>
-
- * Remove 512-bit DH group. It's affected by LogJam Attack.
- https://weakdh.org/
- [fix GH-1196][Bug #11968][ruby-core:72766]
-
-Thu Jan 14 11:44:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * variable.c (rb_f_global_variables): add $1..$9 only if $~ is
- set. fix the condition removed at r14014.
-
-Wed Jan 13 17:21:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * .travis.yml: removed commented-out code.
-
-Wed Jan 13 17:14:54 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * .travis.yml: removed osx code. follow up with r53517
-
-Wed Jan 13 16:56:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * iseq.c (rb_iseq_mark): mark parent iseq to prevent dynamically
- generated iseq by eval from GC. [ruby-core:72620] [Bug #11928]
-
-Wed Jan 13 03:42:58 2016 Eric Wong <e@80x24.org>
-
- * class.c (Init_class_hierarchy): resolve name for rb_cObject ASAP
- * object.c (rb_mod_const_set): move name resolution to rb_const_set
- * variable.c (rb_const_set): do class resolution here
- [ruby-core:72807] [Bug #11977]
-
-Wed Jan 13 00:37:12 2016 Satoshi Ohmori <sachin21dev@gmail.com>
-
- * man/ruby.1: fix double word typo. [Fix GH-1194]
-
-Tue Jan 12 21:01:09 2016 Benoit Daloze <eregontp@gmail.com>
-
- * common.mk: update URL and name for the Ruby spec suite.
-
-Tue Jan 12 19:52:19 2016 sorah (Shota Fukumori) <her@sorah.jp>
-
- * lib/forwardable.rb: Convert given accessors to String.
-
- 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.
-
- def_delegator Foo, :some_method
-
- This change is to revert unexpected incompatibility. But this behavior
- may change in the future.
-
-Mon Jan 12 18:41:41 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: made a variable name more grammatically correct
-
-Mon Jan 12 18:34:34 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: minor grammar fix [ci skip]
-
-Mon Jan 12 16:09:09 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * test/ruby/enc/test_casing_options.rb: Tests for option
- parsing/checking for upcase/downcase/capitalize/swapcase
- (see r53503; with Kimihito Matsui)
-
-Mon Jan 12 16:03:03 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * string.c: Added option parsing/checking for upcase/downcase/
- capitalize/swapcase (with Kimihito Matsui)
-
-Mon Jan 11 21:28:28 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * include/ruby/oniguruma.h: Added flags needed for upcase/downcase
- Unicode addition (with Kimihito Matsui)
-
-Mon Jan 11 09:50:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: check if the API version number is consistent with
- the program version number.
-
-Sun Jan 10 20:57:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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]
-
-Sun Jan 10 15:45:10 2016 Nobuyoshi Nakada <nobu@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.
-
-Sun Jan 10 13:41:36 2016 Eric Wong <e@80x24.org>
-
- * io.c (rb_deferr): remove long obsolete global
-
-Sun Jan 10 09:14:42 2016 Eric Wong <e@80x24.org>
-
- * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
- eliminate chomp
- * lib/net/http.rb (connect): eliminate delete
- * lib/net/http/header.rb (basic_encode): ditto
- * lib/net/imap.rb (authenticate): eliminate gsub
- (self.encode_utf7): shorten delete arg
- * lib/net/smtp.rb (base64_encode): eliminate gsub
- * lib/open-uri.rb (OpenURI.open_http): eliminate delete
- * lib/rss/rss.rb: ditto
- * lib/securerandom.rb (base64): ditto
- (urlsafe_base64): eliminate delete!
- * lib/webrick/httpauth/digestauth.rb (split_param_value):
- eliminate chop
- * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete
- (setup_upstream_proxy_authentication): ditto
- [ruby-core:72666] [Feature #11938]
-
-Sat Jan 9 23:19:14 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_hash.rb (test_try_convert): Add test for
- Hash.try_convert. [Fix GH-1190]
-
-Sat Jan 9 23:15:25 2016 Jon Moss <maclover7@users.noreply.github.com>
-
- * ext/openssl/ossl.c: Add missing variables to documentation
- examples. [Fix GH-1189]
-
-Sat Jan 9 18:25:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * symbol.h (is_attrset_id): ASET is an attrset ID. fix
- unexpected safe call instead of an ordinary ASET.
-
-Sat Jan 9 10:44:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in, win32/setup.mak: extract RUBY_PROGRAM_VERSION from
- RUBY_VERSION in version.h instead of RUBY_API_VERSION numbers in
- include/ruby/version.h, and cut it into version numbers.
-
-Sat Jan 9 07:13:33 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: rename PAGE_* to HEAP_PAGE_* because PAGE_SIZE is used
- in Mac OS X.
-
- * test/ruby/test_gc.rb: catch up this fix.
-
-Sat Jan 9 05:45:40 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: PAGE_BITMAP_PLANES (the number of bitmap) is 4, not 3.
-
-Sat Jan 9 05:42:57 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: rename constant names HEAP_* to PAGE_*.
-
- Keys of GC::INTERNAL_CONSTANTS are also renamed.
-
- * test/ruby/test_gc.rb: catch up this fix.
-
-Fri Jan 8 22:30:06 2016 Akinori MUSHA <knu@iDaemons.org>
-
- * doc/regexp.rdoc: [DOC] Elaborate on the \G anchor. [ci skip]
-
-Fri Jan 8 19:49:27 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: remove heap_page::body. Instead of this field,
- heap_page::start field works well.
-
-Fri Jan 8 19:31:52 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: rename rb_heap_t::page_length to rb_heap_t::total_pages.
-
- `page_length' is not clear (we may understand with length of
- a page).
-
-Fri Jan 8 17:07:14 2016 Koichi Sasada <ko1@atdot.net>
-
- * gc.c: remove heap_page::heap. This field is only used to recognize
- whether a page is in a tomb or not. Instead of this field,
- heap_page::flags::in_tomb (1 bit field) is added.
-
- Also type of heap_page::(total|free|final)_slots are changed from
- int to short. 2B is enough for them.
-
-Fri Jan 8 09:33:59 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * iseq.c (rb_iseq_compile_with_option): move variable initialization
- code to avoid maybe-uninitialized warnings by gcc 4.8.
-
-Fri Jan 8 00:03:22 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * enum.c (enum_min, enum_max): do the same optimization as r53454.
-
-Thu Jan 7 22:32:21 2016 Kenta Murata <mrkn@mrkn.jp>
-
- * ruby.h: undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
- and HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P on C++.
- [ruby-core:72736] [Bug #11962]
-
-Thu Jan 7 22:02:21 2016 Shugo Maeda <shugo@ruby-lang.org>
-
- * enum.c (enum_minmax): optimize object comparison in
- Enumerable#minmax.
-
-Thu Jan 7 14:49:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * thread.c (rb_thread_pending_interrupt_p): no pending interrupt
- before initialization.
-
- * thread.c (thread_raise_m, rb_thread_kill): uninitialized thread
- cannot interrupt. [ruby-core:72732] [Bug #11959]
-
-Thu Jan 7 11:34:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * include/ruby/backward.h (ruby_show_copyright_to_die): for source
- code backward compatibility.
-
- * ruby.c (process_options): return Qtrue to exit the process
- successfully.
-
- * version.c (ruby_show_copyright): no longer exit.
-
-Wed Jan 6 17:22:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/optparse.rb (OptionParser#order!): add `into` optional
- keyword argument to store the results. [Feature #11191]
-
-Tue Jan 5 21:44:37 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * ChangeLog: fix wrong class name.
-
-Tue Jan 5 21:43:50 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb(test_chr): added test for String#chr
- [fix GH-1179]
-
-Tue Jan 5 21:32:26 2016 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_numeric.rb (test_nonzero_p): added test for Numeric#nonzero?
- [fix GH-1187]
-
-Tue Jan 5 11:47:23 2016 Damir Gaynetdinov <damir.gaynetdinov@gmail.com>
-
- * doc/marshal.rdoc: Clarify object references example, that the
- reference is same object. [Fix GH-1156]
-
-Tue Jan 5 05:06:51 2016 Eric Wong <e@80x24.org>
-
- * ext/stringio/stringio.c (strio_binmode): implement to set encoding
- * test/stringio/test_stringio.rb (test_binmode): new test
- [ruby-core:72699] [Bug #11945]
-
-Mon Jan 4 15:44:37 2016 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * variable.c (rb_mod_deprecate_constant): [DOC] added
- documentation for Module#deprecate_constant. [ci skip]
-
-Mon Jan 4 15:36:38 2016 Sho Hashimoto <sho-h@ruby-lang.org>
-
- * thread_sync.c: [DOC] remove SizedQueue#close argument.
- [ci skip]
-
-Mon Jan 4 10:14:24 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * test/coverage/test_coverage.rb: ignored test when enabled to coverage.
- It lead to crash with `make test-all`.
-
-Mon Jan 4 08:10:44 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * insns.def (opt_case_dispatch): Move a comment to the
- appropriate position.
- [ci skip]
-
-Sun Jan 3 23:55:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/rubygems/security.rb (DIGEST_ALGORITHM, KEY_ALGORITHM):
- should check same name as the used constants.
- [ruby-core:72674] [Bug #11940]
-
-Sun Jan 3 19:22:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * aclocal.m4: add fallback file for non-aclocal environments.
- [ruby-core:72683] [Bug #11942]
-
-Sun Jan 3 13:56:49 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
-
- * eval_error.c (rb_print_undef): Use `rb_method_visibility_t`
- instead of `int`.
- * eval_intern.h (rb_print_undef): ditto
- * proc.c (mnew_internal): ditto
- * vm_method.c (rb_export_method): ditto
- [Misc #11649] [ruby-core:71311] [fix GH-1078]
-
-Sun Jan 3 12:12:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * acinclude.m4: rename aclocal.m4, which should be generated by
- aclocal. [ruby-core:72675] [Bug #11941]
-
-Sat Jan 2 21:07:55 2016 Eric Wong <e@80x24.org>
-
- * thread_sync.c (queue_do_pop): avoid cast with Qfalse
- (rb_szqueue_push): ditto, use queue_sleep wrapper
-
-Sat Jan 2 16:16:14 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
-
- * lib/erb.rb: Allow ERB subclass to add token easily.
- [Feature #11936]
-
- * test/erb/test_erb.rb: ditto.
-
-Sat Jan 2 14:44:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (regexp): set_yylval_num sets u1, should use nd_tag
- instead of nd_state. [ruby-core:72638] [Bug #11932]
-
-Sat Jan 2 02:27:22 2016 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/ostruct.rb: Fix case of frozen object with initializer.
- Bug revealed by RubySpec [ruby-core:72639]
-
-Fri Jan 1 22:01:52 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
-
- * NEWS: mention CSV's liberal_parsing option.
-
-Fri Jan 1 19:38:23 2016 okkez <okkez000@gmail.com>
-
- * doc/NEWS-2.3.0: fix double words typo.
- [ci skip][fix GH-1183]
-
-Fri Jan 1 15:28:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (remove_unreachable_chunk): decrease count of
- call_info in removed instructions. fix up r53402.
-
-Fri Jan 1 12:05:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * compile.c (remove_unreachable_chunk): remove unreferred label
- to optimize away unreachable chunk.
-
-Fri Jan 1 11:42:57 2016 James Edward Gray II <james@graysoftinc.com>
-
- * lib/csv.rb (CSV): Add a liberal_parsing option.
- Patch by Braden Anderson. [#11839]
- * test/csv/test_features.rb: test liberal_parsing
-
-Fri Jan 1 10:27:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * tool/mkconfig.rb (RbConfig): prefix SDKROOT to oldincludedir
- not includedir, the latter is outside the ruby installation.
- [ruby-core:72496] [Bug #11881]
-
-Fri Jan 1 08:53:02 2016 Yuki Kurihara <co000ri@gmail.com>
-
- * test/ruby/test_lazy_enumerator.rb (test_take_bad_arg): Add test
- code in case of Enumerator::Lazy#take called with negative number.
- [ruby-dev:49467] [Bug #11933]
-
-Fri Jan 1 05:06:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (parser_here_document): update indent for each line in
- indented here document with single-quotes.
- [ruby-core:72479] [Bug #11871]
-
-Fri Jan 1 03:26:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (freeze): define deferred accessors before
- freezing to get rid of an error when just reading frozen
- OpenStruct.
-
-Thu Dec 31 14:36:45 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
-
- * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid
- redefinition [#11901]
-
-Thu Dec 31 02:45:12 2015 NARUSE, Yui <naruse@ruby-lang.org>
-
- * test/ruby/test_module.rb (test_classpath): r53376 may change
- the order of m.constants.
- `make TESTS='-v ruby/test_class.rb ruby/test_module.rb' test-all`
- may fail after that.
- http://rubyci.s3.amazonaws.com/tk2-243-31075/ruby-trunk/log/20151230T164202Z.log.html.gz
-
-Thu Dec 31 02:20:00 2015 Benoit Daloze <eregontp@gmail.com>
-
- * common.mk (help): Fix typo.
-
-Wed Dec 30 20:53:09 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/net/http/responses.rb: Added new response class for 451 status code.
- * lib/net/http.rb: documentation for HTTPUnavailableForLegalReasons
-
-Wed Dec 30 20:45:45 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * lib/webrick/httpstatus.rb: Added HTTP 451 Status Code.
- [fix GH-1167] Patch by @MuhammetDilmac
- https://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00
-
-Wed Dec 30 20:25:52 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/syntax/calling_methods.rdoc: fix old operator for safe navigation
- operator. [ci skip][fix GH-1182] Patch by @dougo
-
-Wed Dec 30 16:43:23 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb (test_ord): Add test for String#ord.
- [Fix GH-1181]
-
-Wed Dec 30 11:28:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * 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.
-
- * lib/forwardable.rb (def_single_delegator): ditto.
-
-Wed Dec 30 11:18:42 2015 Elliot Winkler <elliot.winkler@gmail.com>
-
- * lib/forwardable.rb (def_instance_delegator) fix delegating to
- 'args' and 'block', clashing with local variables in generated
- methods. [ruby-core:72579] [Bug #11916]
-
- * lib/forwardable.rb (def_single_delegator): ditto.
-
-Wed Dec 30 09:58:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * object.c (rb_class_inherited_p): search the corresponding
- ancestor to prepended module from prepending class itself.
- [ruby-core:72493] [Bug #11878]
-
-Wed Dec 30 09:20:00 2015 Yuki Kurihara <co000ri@gmail.com>
-
- * test/stringio/test_io.rb (test_flag): add assertion for error when
- text and binary mode are mixed.
- [ruby-dev:49465] [Feature #11921]
-
-Wed Dec 30 08:43:59 2015 Yuki Kurihara <co000ri@gmail.com>
-
- * test/stringio/test_stringio.rb (test_initialize): add test for
- StringIO#initialize. [ruby-core:72585] [Feature #11920]
-
-Wed Dec 30 05:19:24 2015 Eric Wong <e@80x24.org>
-
- * class.c (struct clone_const_arg): adjust for id_table
- (clone_const): ditto
- (clone_const_i): ditto
- (rb_mod_init_copy): ditto
- (rb_singleton_class_clone_and_attach): ditto
- (rb_include_class_new): ditto
- (include_modules_at): ditto
- * constant.h (rb_free_const_table): ditto
- * gc.c (free_const_entry_i): ditto
- (rb_free_const_table): ditto
- (obj_memsize_of): ditto
- (mark_const_entry_i): ditto
- (mark_const_tbl): ditto
- * internal.h (struct rb_classext_struct): ditto
- * object.c (rb_mod_const_set): resolve class name on assignment
- * variable.c (const_update): replace with const_tbl_update
- (const_tbl_update): new function
- (fc_i): adjust for id_table
- (find_class_path): ditto
- (autoload_const_set): st_update => const_tbl_update
- (rb_const_remove): adjust for id_table
- (sv_i): ditto
- (rb_local_constants_i): ditto
- (rb_local_constants): ditto
- (rb_mod_const_at): ditto
- (rb_mod_const_set): ditto
- (rb_const_lookup): ditto
- [ruby-core:72112] [Feature #11614]
-
-Wed Dec 30 04:10:13 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
-
- * thread_pthread.c (rb_thread_create_timer_thread): destroy attr even
- if pthread_create() failed.
-
-Wed Dec 30 02:55:09 2015 Eric Wong <e@80x24.org>
-
- * thread_pthread.c (setup_communication_pipe): delay setting owner
- (rb_thread_create_timer_thread): until thread creation succeeds
- [ruby-core:72590] [Bug #11922]
-
-Tue Dec 29 19:12:46 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * ruby.c (proc_options): -W command line option should be able to
- override -w in RUBYOPT environment variable.
-
-Tue Dec 29 17:54:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * eval.c (ignored_block): warn if a block is given to `using`,
- which is probably for `Module.new`.
-
-Tue Dec 29 12:48:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * lib/ostruct.rb (OpenStruct): make respond_to? working on
- just-allocated objects for workaround of Psych.
- [ruby-core:72501] [Bug #11884]
-
-Tue Dec 29 10:35:00 2015 Kenta Murata <mrkn@mrkn.jp>
-
- * test/mkmf/test_have_func.rb (test_have_func):
- Add assertion to examine the existence of HAVE_RUBY_INIT.
-
- * test/mkmf/test_have_func.rb (test_not_have_func):
- Add assertion to examine the absence of HAVE_RUBY_INIT.
-
-Tue Dec 29 06:50:42 2015 Eric Wong <e@80x24.org>
-
- * thread_sync.c: static classes
-
-Tue Dec 29 05:30:30 2015 Eric Wong <e@80x24.org>
-
- * 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]
-
-Mon Dec 28 14:55:57 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb (TestString#test_rstrip_bang): Add test
- for String#rstrip!. [Fix GH-1176]
-
-Mon Dec 28 09:18:53 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb (TestString#test_lstrip_bang): Add test
- for String#lstrip!. [Fix GH-1176]
-
-Sun Dec 27 23:32:26 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_variant2val): refactoring.
-
-Sun Dec 27 21:14:42 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c (rb_execarg_parent_start1): need to convert the encoding to
- ospath's one.
-
-Sun Dec 27 20:54:22 2015 NAKAMURA Usaku <usa@ruby-lang.org>
-
- * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
- reported by naruse via twitter.
-
- * process.c (rb_execarg_addopt): need to convert the encoding to
- ospath's one.
-
-Sun Dec 27 20:00:31 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * enc/x_emoji.h: fix dead-link.
-
-Sun Dec 27 19:55:55 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
-
- * doc/NEWS-2.3.0: fix a typo.
-
-Sun Dec 27 18:08:15 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * string.c (rb_str_lstrip_bang, rb_str_rstrip_bang): [DOC] Fix
- ruby-doc comments for String#rstrip! and lstrip!. It looks like
- dropped bang. [Fix GH-1175]
-
-Sun Dec 27 15:14:20 2015 Eric Wong <e@80x24.org>
-
- * io.c (io_getpartial): remove unused kwarg from template
- * test/ruby/test_io.rb (test_readpartial_bad_args): new
- [Bug #11885]
-
-Sun Dec 27 11:50:53 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb (test_rstrip, test_lstrip): Add tests
- for String#lstrip and rstrip. The test cases are used from
- string.c ruby-doc comments. [Fix GH-1174]
-
-Sun Dec 27 11:47:46 2015 Kuniaki IGARASHI <igaiga@gmail.com>
-
- * test/ruby/test_string.rb (test_insert): Add test for
- String#insert. The test cases are written in string.c
- comments as a reference. [Fix GH-1173]
-
-Sun Dec 27 11:03:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * parse.y (show_bitstack): trace stack_type value if yydebug.
-
-Sun Dec 27 10:03:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * enc/depend (enc, trans): fix version dependency, shared object
- files depend on the RUBY_SO_NAME value for runtime link.
-
-Sun Dec 27 09:47:20 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
-
- * ext/win32ole/win32ole.c (ole_vstr2wc, ole_variant2val): fix blank
- string conversion.
- [Bug #11880]
- Thanks Akio Tajima for the patch!
-
-Sun Dec 27 09:34:53 2015 craft4coder <yooobuntu@163.com>
-
- * doc/extension.rdoc: [DOC] `nul` should be uppercase.
- change 'nul' => 'NUL'. [Fix GH-1172]
-
-Sat Dec 26 18:29:01 2015 Kouhei Sutou <kou@cozmixng.org>
-
- * lib/xmlrpc/client.rb: Support SSL options in async methods of
- XMLRPC::Client.
- [Bug #11489]
- Reported by Aleksandar Kostadinov. Thanks!!!
-
-Sat Dec 26 11:26:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * miniinit.c (Init_enc): add some common aliases of built-in
- encodings. [ruby-core:72481] [Bug #11872]
-
-Fri Dec 25 22:43:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
-
- * configure.in: extract RUBY_RELEASE_DAY at generating Makefile.
-
- * version.h (RUBY_RELEASE_DATE): construct from RUBY_RELEASE_YEAR,
- RUBY_RELEASE_MONTH, and RUBY_RELEASE_DAY.
-
-Fri Dec 25 21:33:06 2015 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * version.h (RUBY_VERSION): 2.4.0 development has started.
-
-Fri Dec 25 14:12:12 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
-
- * doc/ChangeLog-2.3.0, ext/tk/lib/tkextlib/SUPPORT_STATUS,
- include/ruby/version.h: minor grammar fixes [ci skip]
-
-Fri Dec 25 08:23:22 2015 Tadashi Saito <tad.a.digger@gmail.com>
-
- * compile.c, cont.c, doc, man: fix common misspelling.
- [ruby-core:72466] [Bug #11870]
-
-
-For the changes before 2.3.0, see doc/ChangeLog-2.3.0
-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
-
-Local variables:
-coding: us-ascii
-add-log-time-format: (lambda (&optional x y)
- (let* ((time (or x (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-2016 b/doc/ChangeLog-2016
deleted file mode 100644
index 14fcba55ab..0000000000
--- a/doc/ChangeLog-2016
+++ /dev/null
@@ -1,6 +0,0 @@
-------------------------------------------------------------------------
-r57181 | matz | 2016-12-26 01:35:51 +0900 (Mon, 26 Dec 2016) | 2 lines
-
-version.h (RUBY_VERSION): 2.5.0 development has started.
-
-------------------------------------------------------------------------
diff --git a/doc/ChangeLog-YARV b/doc/ChangeLog-YARV
index a8b999dff2..529854586c 100644
--- a/doc/ChangeLog-YARV
+++ b/doc/ChangeLog-YARV
@@ -530,7 +530,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
2006-08-17(Thu) 12:23:52 +0900 Koichi Sasada <ko1@atdot.net>
- * eval.c : change initialize routine order ([yarv-dev:1067])
+ * eval.c : change initilize routine order ([yarv-dev:1067])
* yarvcore.c (Init_yarv) : init th->machine_stack_start
@@ -2115,7 +2115,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
2006-02-14(Tue) 18:15:03 +0900 Koichi Sasada <ko1@atdot.net>
- * configure.in : enable pthread by default
+ * configure.in : enable pthread by deafult
* ascii.c : import ruby 1.9 HEAD
@@ -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 referring klass.
+ break'ing, check it before refering 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 position
+ * error.c : fix include file positon
* test/ruby/test_signal.rb : skip test_exit_action on cygwin
@@ -3650,10 +3650,10 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* thread.c (yarv_thread_execute_interrupts) : added
* thread_pthread.h (thread_timer) : set interrupt_flag of
- current running threads
+ current runnning threads
* vm.c (th_invoke_proc) : jump with JUMP_TAG() if some exception
- occurs
+ occurres
* yarv.h : add yarv_set_current_running_thread_raw() for bootstrap
@@ -5617,7 +5617,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* rb/insns2vm.rb : fix category (comment)
- * depend : remove space between target name and colon
+ * depend : remove space betweeen target name and colon
2005-03-04(Fri) 15:55:51 +0900 Koichi Sasada <ko1@atdot.net>
@@ -5783,7 +5783,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada <ko1@atdot.net>
* disasm.c : fix ID to String method
- * compile.c : NODE_SUPER, NODE_ZSUPER check 'popped'
+ * compile.c : NODE_SUPER, NODE_ZSUPER check 'poped'
and NODE_RETURN check outer type
and NODE_DREGX_ONCE supported (temporarily)
@@ -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 unnecessary each
+ * rb/insns2vm.rb : remove unnecesary 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 : implement thread_funcall (temporarily)
+ * vm.c : impliment 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(incomplete)
+ next, redo, return(imcomplete)
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 5da39ff265..51fb5f1c6a 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
@@ -417,7 +417,7 @@ with all sufficient information, see the ChangeLog file.
* FTP
* URI('ftp://example.com/foo').path #=> 'foo'
* URI('ftp://example.com/%2Ffoo').path #=> '/foo'
- * URI::FTP.build([nil, 'example.com', nil, '/foo', 'i']).to_s #=> 'ftp://example.com/%2Ffoo;type=i'
+ * URI::FTP.build([nil, 'example.com', nil, '/foo', 'i').to_s #=> 'ftp://example.com/%2Ffoo;type=i'
* URI merge
* URI('http://a/b/c/d;p?q').merge('?y') == URI('http://a/b/c/d;p?y')
* URI('http://a/b/c/d;p?q').merge('/./g') == URI('http://a/g')
@@ -518,7 +518,7 @@ with all sufficient information, see the ChangeLog file.
New method to set the entity expansion limit. By default the limit is
set to 10000. See the following URL for details.
- https://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
+ http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
* stringio
@@ -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-1.9.2 b/doc/NEWS-1.9.2
index fedb1f6633..9cf58c9aff 100644
--- a/doc/NEWS-1.9.2
+++ b/doc/NEWS-1.9.2
@@ -263,7 +263,7 @@ with all sufficient information, see the ChangeLog file.
New method to set the entity expansion limit. By default the limit is
set to 10000. See the following URL for details.
- https://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
+ http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
* RDoc
diff --git a/doc/NEWS-2.0.0 b/doc/NEWS-2.0.0
index 5c9f5bdc53..9ad7254317 100644
--- a/doc/NEWS-2.0.0
+++ b/doc/NEWS-2.0.0
@@ -497,7 +497,7 @@ with all sufficient information, see the ChangeLog file.
* Dir.mktmpdir uses FileUtils.remove_entry instead of
FileUtils.remove_entry_secure. This means that applications should not
change the permission of the created temporary directory to make
- writable from other users.
+ accessible from other users.
* yaml
* Syck has been removed. YAML now completely depends on libyaml being
diff --git a/doc/NEWS-2.2.0 b/doc/NEWS-2.2.0
deleted file mode 100644
index 5564c606ae..0000000000
--- a/doc/NEWS-2.2.0
+++ /dev/null
@@ -1,361 +0,0 @@
-# -*- 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#read_nonblock and IO#write_nonblock 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/NEWS-2.3.0 b/doc/NEWS-2.3.0
deleted file mode 100644
index 489aba4a89..0000000000
--- a/doc/NEWS-2.3.0
+++ /dev/null
@@ -1,404 +0,0 @@
-# -*- rdoc -*-
-
-= 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 or Redmine
-(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
-
-== Changes since the 2.2.0 release
-
-=== Language changes
-
-* frozen-string-literal pragma:
-
- * 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]
-
-* 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
-
- * 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
-
- * 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
-
- * 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
-
- * Kernel#loop, when stopped by a StopIteration exception, returns
- what the enumerator has returned instead of nil. [Feature #11498]
-
-* Module
- * Module#deprecate_constant [Feature #11398]
-
-* NameError
- * NameError#receiver is added to take the receiver object. [Feature #10881]
-
-* Numeric
-
- * 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
-
- * String#+@ and String#-@ are added to get mutable/frozen strings.
- [Feature #11782]
-
- * String.new now accepts new option parameter `encoding'.
- [Feature #11785]
-
-* 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)
-
-* 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]
-
- * Array#flatten and Array#flatten! no longer try to call #to_ary
- method on elements beyond the given level. [Bug #10748]
-
- * 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]
-
-* 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.
-
-* File::Stat
- * On Windows File::Stat#ino always returned 0, but now returns
- BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low. [Feature #11216]
-
-* 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]
-
-* 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]
-
-* 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]
-
-
-=== Stdlib updates (outstanding ones only)
-
-* Logger
-
- * 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]
-
-* io/wait
- * IO#wait_readable no longer checks FIONREAD, it may be used for
- non-bytestream IO such as listen sockets.
-
-* Net::FTP
- * Net::FTP#mlst is added.
- * Net::FTP#mlsd is added.
-
-* nkf
- * Merge nkf 2.1.4.
-
-* 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.
-
-* OpenSSL
- * OpenSSL::SSL::SSLSocket#accept_nonblock and
- OpenSSL::SSL::SSLSocket#connect_nonblock supports `exception: false`.
- [Feature #10532]
-
-* Pathname
- * Pathname#descend and Pathname#ascend supported blockless form.
- [Feature #11052]
-
-* 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.
-
-=== Stdlib compatibility issues (excluding feature bug fixes)
-
-* ext/coverage/coverage.c
- * Coverage.peek_result: new method to allow coverage to be captured without
- stopping the coverage tool. [Feature #10816]
-
-* Fiddle
- * Fiddle::Function#call releases the GVL. [Feature #11607]
-
-* io-console
- * Update to io-console 0.4.5, and change the license to BSD 2-clause
- "Simplified" License.
-
-* 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]
-
-* lib/drb/drb.rb
- * removed unused argument. https://github.com/ruby/ruby/pull/515
-
-* lib/matrix.rb
- * Add Vector#round. https://github.com/ruby/ruby/pull/802
-
-* lib/webrick/utils.rb
- * removed unused argument. https://github.com/ruby/ruby/pull/356
-
-* Net::FTP
- * Connections are in passive mode per default now. The default mode can
- be changed by Net::FTP.default_passive=. [Feature #11612]
-
-* Net::HTTP
- * default value of Net::HTTP#open_timeout is now 60 (was nil).
-
-* 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:
-
- https://github.com/rdoc/rdoc/blob/master/History.rdoc#421--2015-12-22
-
-* RubyGems
- * Updated to RubyGems 2.5.1. For full release notes see:
-
- 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=2 and $SAFE=3 are obsolete. If $SAFE is set to 2 or larger,
- an ArgumentError is raised. [Feature #5455]
-
-=== C API updates
-
-* 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
- elements used a linear scan. [Feature #10585]
-
-* The Set class got several speed up.
- [Misc #10754], [r52591]
-
-* Socket and I/O-related improvements
-
- * 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]
-
- * 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]
-
- * (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]
-
-* CGI.escapeHTML is optimized with C extension.
- https://github.com/ruby/ruby/pull/1164
diff --git a/doc/NEWS-2.4.0 b/doc/NEWS-2.4.0
deleted file mode 100644
index 28e855cde1..0000000000
--- a/doc/NEWS-2.4.0
+++ /dev/null
@@ -1,397 +0,0 @@
-# -*- rdoc -*-
-
-= NEWS for Ruby 2.4.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 or Redmine
-(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>)
-
-== Changes since the 2.3.0 release
-
-=== Language changes
-
-* Multiple assignment in conditional expression is now allowed.
- [Feature #10617]
-
-* Refinements is enabled at method by Symbol#to_proc. [Feature #9451]
-
-* Refinements is enabled with Kernel#send and BasicObject#__send__.
- [Feature #11476]
-
-* Rescue modifier now applicable to method arguments.
- [Feature #12686]
-
-* Toplevel return is now allowed. [Feature #4840]
-
-=== Core classes updates (outstanding ones only)
-
-* Array
-
- * Array#concat [Feature #12333]
- Now takes multiple arguments.
-
- * Array#max and Array#min. [Feature #12172]
- This may cause a tiny incompatibility: if you redefine
- Enumerable#max and call max to an Array, your redefinition will be
- now ignored. You should also redefine Array#max.
-
- * Array#pack [Feature #12754]
- Now takes optional argument `buffer:' to reuse already allocated buffer.
-
- * Array#sum [Feature #12217]
- This is different from Enumerable#sum in that Array#sum doesn't depend on
- the definition of each method.
-
-* Comparable
-
- * Comparable#clamp. [Feature #10594]
-
-* Dir
-
- * Dir.empty?. [Feature #10121]
-
-* Enumerable
-
- * Enumerable#chunk called without a block now return an Enumerator
- [Feature #2172]
- * Enumerable#sum [Feature #12217]
- * Enumerable#uniq [Feature #11090]
-
-* Enumerator::Lazy
-
- * Enumerator::Lazy#chunk_while [GH-1186]
- * Enumerator::Lazy#uniq [Feature #11090]
-
-* File
-
- * File.empty?. [Feature #9969]
-
-* Float
-
- * Float#ceil, Float#floor, and Float#truncate now take an optional
- digits, as well as Float#round. [Feature #12245]
-
- * Float#round now takes an optional keyword argument, half option, and
- the default behavior is round-up. [Bug #12548] [Bug #12958]
- half option can be one of :even, :up, and :down. [Feature #12953]
-
-* Hash
-
- * Hash#compact and Hash#compact! [Feature #11818]
- * Hash#transform_values and Hash#transform_values! [Feature #12512]
-
-* Integer
-
- * Fixnum and Bignum are unified into Integer [Feature #12005]
-
- * Integer#ceil, Integer#floor, and Integer#truncate now take an optional
- digits, as well as Integer#round. [Feature #12245]
-
- * Integer#digits for extracting columns of place-value notation [Feature #12447]
-
- * Integer#round now takes an optional keyword argument, half option, and the
- default behavior is round-up now. [Bug #12548] [Bug #12958]
- half option can be one of :even, :up, and :down. [Feature #12953]
-
-* IO
-
- * IO#gets, IO#readline, IO#each_line, IO#readlines, IO.foreach now takes
- an optional keyword argument, chomp flag. [Feature #12553]
-
-* Kernel
-
- * Kernel#clone now takes an optional keyword argument, freeze flag.
- [Feature #12300]
-
-* MatchData
-
- * MatchData#named_captures [Feature #11999]
- * MatchData#values_at supports named captures [Feature #9179]
-
-* Module
-
- * Module#refine accepts a module as the argument now. [Feature #12534]
- * Module.used_modules [Feature #7418]
-
-* Numeric
-
- * Numeric#finite?, Numeric#infinite? [Feature #12039]
-
-* Process
-
- * Support CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW, and
- CLOCK_UPTIME_RAW_APPROX which are introduced by macOS 10.12.
-
-* Rational
-
- * Rational#round now takes an optional keyword argument, half option, and
- the default behavior is round-up now. [Bug #12548] [Bug #12958]
- half option can be one of :even, :up, and :down. [Feature #12953]
-
-* Regexp
-
- * meta character \X matches Unicode 9.0 characters with some workarounds
- for UTR #51 Unicode Emoji, Version 4.0 emoji zwj sequences.
-
- * Regexp#match? [Feature #8110]
- This returns bool and doesn't save backref.
-
- * Update to Onigmo 6.0.0.
-
-* Regexp/String: Update Unicode version from 8.0.0 to 9.0.0 [Feature #12513]
-
-* RubyVM::Env
-
- * RubyVM::Env was removed.
-
-* String
-
- * String#casecmp? [Feature #12786]
-
- * String#concat, String#prepend [Feature #12333]
- Now takes multiple arguments.
-
- * String#each_line, String#lines now takes an optional keyword argument,
- chomp flag. [Feature #12553]
-
- * String#match? [Feature #12898]
-
- * String#unpack1 [Feature #12752]
-
- * String#upcase, String#downcase, String#capitalize, String#swapcase and
- their bang variants work for all of Unicode, and are no longer limited
- to ASCII. Supported encodings are UTF-8, UTF-16BE/LE, UTF-32BE/LE, and
- ISO-8859-1~16. Variations are available with options. See the documentation
- of String#downcase for details. [Feature #10085]
-
- * String.new(capacity: size) [Feature #12024]
-
-* StringIO
-
- * StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines now takes
- an optional keyword argument, chomp flag. [Feature #12553]
-
-* Symbol
-
- * Symbol#casecmp? [Feature #12786]
-
- * Symbol#match now returns MatchData. [Bug #11991]
-
- * Symbol#match? [Feature #12898]
-
- * Symbol#upcase, Symbol#downcase, Symbol#capitalize, and Symbol#swapcase now
- work for all of Unicode. See the documentation of String#downcase
- for details. [Feature #10085]
-
-* Thread
-
- * Thread#report_on_exception and Thread.report_on_exception
- [Feature #6647]
-
-* TracePoint
-
- * TracePoint#callee_id [Feature #12747]
-
-* Warning
-
- * New module named Warning is introduced. By default it has only
- one singleton method, named warn. This makes it possible for
- 3rd-party libraries to control the way warnings are handled.
- [Feature #12299]
-
-=== Stdlib updates (outstanding ones only)
-
-* CGI
-
- * Don't allow , as a separator [Bug #12791]
-
-* CSV
-
- * Add a liberal_parsing option. [Feature #11839]
-
-* IPAddr
-
- * IPAddr#== and IPAddr#<=> no longer raise an exception if coercion fails.
- [Bug #12799]
-
-* IRB
-
- * Binding#irb: Start a REPL session like `binding.pry` at r56624.
-
-* Logger
-
- * Allow specifying logger parameters in constructor such
- as level, progname, datetime_format, formatter. [Feature #12224]
- * Add shift_period_suffix option. [Feature #10772]
-
-* Net::HTTP
-
- * New method: Net::HTTP.post [Feature #12375]
-
-* Net::FTP
-
- * Support TLS (RFC 4217).
- * Support hash style options for Net::FTP.new.
- * Add a new optional argument pathname to Net::FTP#status.
- Contributed by soleboxy. [GH-1478] [Feature #12965]
-
-* OpenSSL
-
- * Includes Ruby/OpenSSL 2.0. OpenSSL has been extracted as a Gem and is
- maintained at a separate repository now: https://github.com/ruby/openssl.
- It still remains as a 'default gem'. [Feature #9612]
- Refer to ext/openssl/History.md for the full release note.
-
-* optparse
-
- * Add an into option. [Feature #11191]
-
-* pathname
-
- * New method: Pathname#empty? [Feature #12596]
-
-* Readline
-
- * Readline.quoting_detection_proc and Readline.quoting_detection_proc=
- [Feature #12659]
-
-* REXML
-
- * REXML::Element#[]: If String or Symbol is specified, attribute
- value is returned. Otherwise, Nth child is returned. This is
- backward compatible change.
-
-* set
-
- * New methods: Set#compare_by_identity and Set#compare_by_identity?.
- [Feature #12210]
-
-* WEBrick
-
- * Don't allow , as a separator [Bug #12791]
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* Array#sum and Enumerable#sum are implemented. [Feature #12217]
- Ruby itself has no compatibility problem because Ruby didn't have sum method
- for arrays before Ruby 2.4.
- However many third party gems, activesupport, facets, simple_stats, etc,
- defines sum method. These implementations are mostly compatible but
- there are subtle differences.
- Ruby's sum method should be mostly compatible but it is impossible to
- be perfectly compatible with all of them.
-
-* Fixnum and Bignum are unified into Integer [Feature #12005]
- Fixnum class and Bignum class is removed.
- Integer class is changed from abstract class to concrete class.
- For example, 0 is an instance of Integer: 0.class returns Integer.
- The constants Fixnum and Bignum is bound to Integer.
- So obj.kind_of?(Fixnum) works as obj.kind_of?(Integer).
- At C-level, Fixnum object and Bignum object should be distinguished by
- FIXNUM_P(obj) and RB_TYPE_P(obj, T_BIGNUM).
- RUBY_INTEGER_UNIFICATION can be used to detect this feature at C-level.
- 0.class == Integer can be used to detect this feature at Ruby-level.
- The C-level constants, rb_cFixnum and rb_cBignum, are removed.
- They can cause compilation failure.
-
-* String/Symbol#upcase/downcase/swapcase/capitalize(!) now work for all of
- Unicode, not only for ASCII. [Feature #10085]
- No change is needed if the data is in ASCII anyway or if the limitation
- to ASCII was only tolerated while waiting for a more extensive implementation.
- A change (using the :ascii option) is needed in cases where Unicode data
- is processed, but the operation has to be limited to ASCII only.
- A good example of this are internationalized domain names.
-
-* TRUE / FALSE / NIL
- These constants are now obsoleted. [Feature #12574]
- Use true / false / nil resp. instead.
-
-=== Stdlib compatibility issues (excluding feature bug fixes)
-
-* DateTime
-
- * DateTime#to_time now preserves timezone. [Bug #12189]
-
-* Psych
-
- * Update to Psych 2.2.2
-
-* RDoc
-
- * Update to RDoc 5.0.0
-
-* RubyGems
-
- * Update to RubyGems 2.6.8
-
-* shellwords
-
- * Shellwords.shellwords (shellsplit) treats the backslash as escape
- character only when followed by one of the following characters:
- $ ` " \ <newline>
- [Bug #10055]
-
-* Time
-
- * Time#to_time now preserves timezone. [Bug #12271]
-
-* thread
-
- * the extension library is removed. Till 2.0 it was a pure ruby script
- "thread.rb", which has precedence over "thread.so", and has been provided
- in $LOADED_FEATURES since 2.1.
-
-* Tk
-
- * Tk is removed from stdlib. [Feature #8539]
- https://github.com/ruby/tk is the new upstream.
-
-* XMLRPC
-
- * XMLRPC is removed from stdlib, and bundled as gem. [Feature #12160][ruby-core:74239]
- https://github.com/ruby/xmlrpc is the new upstream.
-
-* Zlib
-
- * Zlib.gzip and Zlib.gunzip [Feature #13020]
-
-=== C API updates
-
-* ruby_show_version() will no longer exits the process, if
- RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0. This will be the default in
- the future.
-
-* rb_gc_adjust_memory_usage() [Feature #12690]
-
-=== Supported platform changes
-
-* FreeBSD < 4 is no longer supported
-
-=== Implementation improvements
-
-* In some condition, `[x, y].max` and `[x, y].min` are optimized
- so that a temporal array is not created. The concrete condition is
- an implementation detail: currently, the array literal must have no
- splat, must have at least one expression but literal, the length must
- be <= 0x100, and Array#max and min must not be redefined. It will work
- in most casual and real-life use case where it is written with intent
- to `Math.max(x, y)`.
-
-* Thread deadlock detection now shows their backtrace and dependency. [Feature #8214]
-
-* st_table (st.c) internal data structure is improved. [Feature #12142]
-
-* Rational is extensively optimized. [Feature #12484]
-
-=== Miscellaneous changes
-
-* ChangeLog is removed from the repository.
- It is generated from commit messages in Subversion by `make dist`.
- Also note that now people should follow Git style commit message.
- The template is written at
- [Short (50 chars or less) summary of changes](https://git-scm.com/book/ch5-2.html).
- [Feature #12283]
diff --git a/doc/contributing.rdoc b/doc/contributing.rdoc
index ebd5904f69..c6ccc68302 100644
--- a/doc/contributing.rdoc
+++ b/doc/contributing.rdoc
@@ -11,7 +11,7 @@ trying out beta releases with your applications.
== How To Report
If you've encountered a bug in Ruby please report it to the redmine issue
-tracker available at {bugs.ruby-lang.org}[https://bugs.ruby-lang.org/]. Do not
+tracker available at {bugs.ruby-lang.org}[http://bugs.ruby-lang.org/]. Do not
report security vulnerabilities here, there is a {separate
channel}[rdoc-label:label-Reporting+Security+Issues] for them.
@@ -25,7 +25,7 @@ on your ticket.
If you aren't already using the latest version, try installing a newer
stable release. See
- {Downloading Ruby}[https://www.ruby-lang.org/en/downloads/].
+ {Downloading Ruby}[http://www.ruby-lang.org/en/downloads/].
* Look to see if anyone already reported your issue, try
{searching on redmine}[https://bugs.ruby-lang.org/projects/ruby-trunk/issues]
for your problem.
@@ -51,7 +51,7 @@ on your ticket.
=== Reporting to downstream distributions
-You can report downstream issues for the following distributions via their bug tracker:
+You can reports downstream issues for the following distributions via their bugtracker:
* {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,17 +61,19 @@ You can report downstream issues for the following distributions via their bug t
=== Platform Maintainers
-For platform specific bugs in Ruby, you can assign your ticket to the current
+For platform specific bugs in Ruby, you can assign your ticket the current
maintainer for a specific platform.
The current active platform maintainers are as follows:
-[mswin64 (Microsoft Windows)]
+[mswin32, mswin64 (Microsoft Windows)]
NAKAMURA Usaku (usa)
[mingw32 (Minimalist GNU for Windows)]
Nobuyoshi Nakada (nobu)
[IA-64 (Debian GNU/Linux)]
TAKANO Mitsuhiro (takano32)
+[Symbian OS]
+ Alexander Zavorine (azov)
[AIX]
Yutaka Kanemoto (kanemoto)
[FreeBSD]
@@ -80,7 +82,7 @@ The current active platform maintainers are as follows:
Naohisa Goto (ngoto)
[RHEL, CentOS]
KOSAKI Motohiro kosaki
-[macOS]
+[Mac OS X]
Kenta Murata (mrkn)
[cygwin, bcc32, djgpp, wince, ...]
none. (Maintainer WANTED)
@@ -92,7 +94,7 @@ affect many users. There is a private mailing list that all security issues
should be reported to and will be handled discretely. Email the
mailto:security@ruby-lang.org list and the problem will be published after
fixes have been released. You can also encrypt the issue using {the PGP public
-key}[https://www.ruby-lang.org/security.asc] for the list.
+key}[http://www.ruby-lang.org/security.asc] for the list.
== Reporting Other Issues
@@ -111,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 will find a lot of issues already requiring attention. What can you do for
+you'll find lots 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 will find lots
+list}[https://bugs.ruby-lang.org/projects/ruby-trunk/issues] you'll find lots
of delinquent bugs that require attention.
You can help by verifying the existing tickets, try to reproduce the reported
@@ -152,7 +154,7 @@ patch.
== How To Request Features
-If there's a new feature that you want to see added to Ruby, you will need to
+If there's a new feature that you want to see added to Ruby, you'll need to
write a convincing proposal and patch to implement the feature.
For new features in CRuby, use the {'Feature'
@@ -172,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 a feature proposal should look something like this:
+A good template for feature proposal should look something like this:
[Abstract]
Summary of your feature
@@ -197,8 +199,7 @@ A good template for a feature proposal should look something like this:
=== Slideshow
-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.
+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.
Slides should be:
@@ -216,8 +217,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 it's 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 its 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
@@ -237,10 +238,26 @@ Each major version of Ruby has a release manager that should be assigned to
handle backport requests. You can find the list of release managers on the
{wiki}[https://bugs.ruby-lang.org/projects/ruby/wiki/ReleaseEngineering].
-=== Branches
+=== Branch Maintainers
-Status and maintainers of branches are listed on the
-{wiki}[https://bugs.ruby-lang.org/projects/ruby/wiki/ReleaseEngineering].
+A branch maintainer maintains a branch and releases a new release of Ruby. The
+branch depends on the associated version of Ruby, such as ruby_1_8_7 for
+version 1.8.7. The current branch maintainers are as follows:
+
+[trunk]
+ unnecessary
+[ruby_2_0_0]
+ Chikanaga Tomoyuki (nagachika)
+[ruby_1_9_3]
+ NAKAMURA Usaku (usa)
+[ruby_1_9_2, ruby_1_9_1]
+ _unmaintained_
+[ruby_1_8]
+ _unmaintained_
+[ruby_1_8_7]
+ _unmaintained_
+[ruby_1_8_6 ...]
+ _unmaintained_
== Running tests
@@ -251,7 +268,7 @@ CRuby uses subversion for source control, you can find installation
instructions and lots of great info to learn subversion on the
{svnbook.red-bean.com}[http://svnbook.red-bean.com/]. For other resources see
the {ruby-core documentation on
-ruby-lang.org}[https://www.ruby-lang.org/en/community/ruby-core/].
+ruby-lang.org}[http://www.ruby-lang.org/en/community/ruby-core/].
This guide will use git for contributing. The {git
homepage}[http://git-scm.com/] has installation instructions with links to
@@ -293,8 +310,8 @@ 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="${HOME}/.rubies/ruby-trunk"
- make up && make install
+ ../configure --prefix=~/.rubies/ruby-trunk
+ make && make install
After adding Ruby to your PATH, you should be ready to run the test suite:
@@ -309,24 +326,12 @@ This is also how you can run a specific test from our build dir:
make test-all TESTS=drb/test_drb.rb
-You can run +test+ and +test-all+ at once by +check+ .
-
- make check
-
-For older versions of Ruby you will need to run the build setup again after
+For older versions of Ruby you'll 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:
git clone git://github.com/ruby/ruby.git --branch ruby_1_9_3
-Once you checked out the source code, you can update the local copy by:
-
- make up
-
-Or, update, build, install and check, by just:
-
- make love
-
== Contributing Documentation
If you're interested in contributing documentation directly to CRuby there is
@@ -431,7 +436,7 @@ 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.
-You will only need a github account if you intend to host your repository
+here. 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
@@ -451,10 +456,11 @@ 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
+on any {publically 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 6a97addaf4..96fe887e4e 100644
--- a/doc/contributors.rdoc
+++ b/doc/contributors.rdoc
@@ -1,6 +1,6 @@
= Contributors to Ruby
-The following list might be incomplete. Feel free to add your name if your
+The following list might be imcomplete. Feel free to add your name if your
patch was accepted into Ruby.
== A
@@ -37,9 +37,6 @@ arton
* He is the distributor of ActiveScriptRuby and experimental 1.9.0-x installers for win32.
* Wrote patches for win32ole, gc.c, tmpdir.rb
-Sergey Avseyev
-* Added IO#pread and IO#pwrite.
-
== B
Daniel Berger
@@ -60,9 +57,6 @@ Oliver M. Bolzer
Alexey Borzenkov
* a patch for mkmf.rb
-Evan Brodie
-* a patch for documentation of Float#round
-
Richard Brown
* a patch for configure.in
@@ -603,15 +597,6 @@ Richard M. Stallman
Robin Stocker
* documentation
-Joshua Stowers
-* a patch for array.c
-
-Marcus Stollsteimer (stomar)
-* committer
-* a maintainer of www.ruby-lang.org
-* patches for cgi (HTML5 tag maker), numeric.c, bigdecimal, ostruct.rb, prime.rb, and others
-* documentation
-
Adam Strzelecki
* a patch for compile.c
diff --git a/doc/dtrace_probes.rdoc b/doc/dtrace_probes.rdoc
index d2cdd56902..a1e0fff3b0 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:::method-entry(class name, method name, file name, line number)
+ ruby:::function-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 "method-entry", and the probe takes four arguments:
+probe name is "function-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:::method-entry".
+ same as "ruby:::function-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:::method-entry".
+ same as "ruby:::function-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:::method-entry".
+ same as "ruby:::function-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 b4ff6ed04e..b36e05c994 100644
--- a/doc/etc.rd.ja
+++ b/doc/etc.rd.ja
@@ -1,4 +1,4 @@
-# etc.rd.ja - -*- mode: rd; coding: utf-8; -*- created at: Fri Jul 14 00:47:15 JST 1995
+# etc.rd.ja - -*- mode: rd; coding: euc-jp; -*- 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
deleted file mode 100644
index 88f300a562..0000000000
--- a/doc/extension.ja.rdoc
+++ /dev/null
@@ -1,1833 +0,0 @@
-# extension.ja.rdoc - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-
-= Rubyの拡張ライブラリの作り方
-
-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_str_append(VALUE str1, VALUE str2) ::
-
- Rubyの文字列str1にRubyの文字列str2を追加する.
-
-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_append(str, rb_sprintf(format, ...)) や
- rb_str_append(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, rb_encoding *enc) ::
-
- 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(int argc, const 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)(ANYARGS), int argc)
-
- void rb_define_singleton_method(VALUE object, const char *name,
- VALUE (*func)(ANYARGS), 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)(ANYARGS), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
- VALUE (*func)(ANYARGS), 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)(ANYARGS), int argc)
-
-関数的メソッド(Kernelモジュールのprivate method)を定義するた
-めの関数は以下の通りです.
-
- void rb_define_global_function(const char *name, VALUE (*func)(ANYARGS), 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は次のように定義されています.
-
- typedef struct rb_data_type_struct 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.ja.rdocのAppendix D
- "世代別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に代入されます.
-
-これらのマクロの使い方はちょっと分かりにくいので,後で説明す
-る例題を参照してください.
-
-== 例: 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クラスを定義する */
- 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ではTypedData_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への参照に値を代入してくれま
-す.
-
-引数の数をチェックするだけならrb_check_arity()が使えます.
-これは引数をリストとして扱いたいときに便利です.
-
-引数を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に代入するマクロ.
-
-=== 型チェック
-
- RB_TYPE_P(value, type)
- TYPE(value)
- FIXNUM_P(value)
- NIL_P(value)
- RB_INTEGER_TYPE_P(value)
- RB_FLOAT_TYPE_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)(ANYARGS), 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)(ANYARGS), int argc) ::
-
- privateメソッドを定義する.引数はrb_define_method()と同じ.
-
-rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc) ::
-
- 特異メソッドを定義する.引数はrb_define_method()と同じ.
-
-rb_check_arity(int argc, int min, int max) ::
-
- 引数の数であるargcがmin..maxの範囲に入っているかをチェックします.
- もしmaxがUNLIMITED_ARGUMENTSなら,上限はチェックしません.
- もしargcが範囲外ならArgumentErrorが発生します.
-
-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)(ANYARGS), VALUE arg1, VALUE (*func2)(ANYARGS), VALUE arg2) ::
-
- 関数func1をarg1を引数に呼び出す.func1の実行中に例外が発生
- した時には func2をarg2を第一引数, 発生した例外オブジェクト
- を第二引数として呼ぶ.戻り値は例外が発生しなかった時はfunc1
- の戻り値, 例外が発生した時にはfunc2の戻り値である.
-
-VALUE rb_ensure(VALUE (*func1)(ANYARGS), VALUE arg1, VALUE (*func2)(ANYARGS), 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) ::
-
- 指定されたフック関数を削除します.
-
-=== メモリ使用量
-
-void rb_gc_adjust_memory_usage(ssize_t diff) ::
-
- 登録された外部のメモリ使用量を調整します.この関数で外部のライブラリが
- どのくらいメモリを使っているのかをGCに伝えることができます.正のdiffで
- この関数を呼び出すとメモリ使用量の増加を意味します.新しいメモリブロッ
- クが確保されたり,ブロックがより大きなサイズで再割り当てされたりした場
- 合などです.負のdiffでこの関数を呼び出すとメモリ使用量の減少を意味しま
- す.メモリブロックが解放されたり,メモリブロックがより小さいサイズで再
- 確保されたりした場合などです.この関数はGCを引き起こすかもしれません.
-
-=== 互換性のためのマクロ
-
-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 関数を利用するようにして下さい.
-
-そのほか,対応についての詳細は extension.rdoc の「Appendix D. Generational
-GC」を参照して下さい.
-
-:enddoc: Local variables:
-:enddoc: fill-column: 60
-:enddoc: end:
diff --git a/doc/extension.rdoc b/doc/extension.rdoc
deleted file mode 100644
index 271ed67f9c..0000000000
--- a/doc/extension.rdoc
+++ /dev/null
@@ -1,1959 +0,0 @@
-# extension.rdoc - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995
-
-= Creating Extension Libraries for Ruby
-
-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_append(VALUE str1, VALUE str2) ::
-
- Appends Ruby string str2 to Ruby string str1.
-
-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_append(str, rb_sprintf(format, ...)) and
- rb_str_append(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, rb_encoding *enc) ::
-
- 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(int argc, const 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)(ANYARGS), int argc)
-
- void rb_define_singleton_method(VALUE object, const char *name,
- VALUE (*func)(ANYARGS), 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)(ANYARGS), int argc)
- void rb_define_protected_method(VALUE klass, const char *name,
- VALUE (*func)(ANYARGS), 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)(ANYARGS), 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)(ANYARGS), 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 define 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.
-
- typedef struct rb_data_type_struct 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 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
-TypedData_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.
-
-You can just check the argument number with rb_check_arity(), this is
-handy in the case you want to treat the arguments as a list.
-
-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
-defs/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
-
- defs/opt_insns_unif.def : instruction unification
- defs/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
-
-RB_TYPE_P(value, type) ::
-
- Is +value+ an internal type (T_NIL, T_FIXNUM, etc.)?
-
-TYPE(value) ::
-
- Internal type (T_NIL, T_FIXNUM, etc.)
-
-FIXNUM_P(value) ::
-
- Is +value+ a Fixnum?
-
-NIL_P(value) ::
-
- Is +value+ nil?
-
-RB_INTEGER_TYPE_P(value) ::
-
- Is +value+ an Integer?
-
-RB_FLOAT_TYPE_P(value) ::
-
- Is +value+ a Float?
-
-void Check_Type(VALUE value, int type) ::
-
- Ensures +value+ is of the given internal +type+ or raises a TypeError
-
-SafeStringValue(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)(ANYARGS), 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)(ANYARGS), 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)(ANYARGS), int argc) ::
-
- Defines a singleton method. Arguments are same as rb_define_method().
-
-rb_check_arity(int argc, int min, int max) ::
-
- Check the number of arguments, argc is in the range of min..max. If
- max is UNLIMITED_ARGUMENTS, upper bound is not checked. If argc is
- out of bounds, an ArgumentError will be raised.
-
-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)(ANYARGS), VALUE arg1, VALUE (*func2)(ANYARGS), VALUE arg2) ::
-
- Calls the function func1, with arg1 as the argument. If an exception
- occurs during func1, it calls func2 with arg2 as the first argument
- and the exception object as the second 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)(ANYARGS), VALUE arg1, VALUE (*func2)(ANYARGS), 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".
-
-=== Threading
-
-As of Ruby 1.9, Ruby supports native 1:1 threading with one kernel
-thread per Ruby Thread object. Currently, there is a GVL (Global VM Lock)
-which prevents simultaneous execution of Ruby code which may be released
-by the rb_thread_call_without_gvl and rb_thread_call_without_gvl2 functions.
-These functions are tricky-to-use and documented in thread.c; do not
-use them before reading comments in thread.c.
-
-void rb_thread_schedule(void) ::
-
- Give the scheduler a hint to pass execution to another thread.
-
-=== Input/Output (IO) on a single file descriptor
-
-int rb_io_wait_readable(int fd) ::
-
- Wait indefinitely for the given FD to become readable, allowing other
- threads to be scheduled. Returns a true value if a read may be
- performed, false if there is an unrecoverable error.
-
-int rb_io_wait_writable(int fd) ::
-
- Like rb_io_wait_readable, but for writability.
-
-int rb_wait_for_single_fd(int fd, int events, struct timeval *timeout) ::
-
- Allows waiting on a single FD for one or multiple events with a
- specified timeout.
-
- +events+ is a mask of any combination of the following values:
-
- * RB_WAITFD_IN - wait for readability of normal data
- * RB_WAITFD_OUT - wait for writability
- * RB_WAITFD_PRI - wait for readability of urgent data
-
- Use a NULL +timeout+ to wait indefinitely.
-
-=== I/O Multiplexing
-
-Ruby supports I/O multiplexing based on the select(2) system call.
-The Linux select_tut(2) manpage
-<http://man7.org/linux/man-pages/man2/select_tut.2.html>
-provides a good overview on how to use select(2), and the Ruby API has
-analogous functions and data structures to the well-known select API.
-Understanding of select(2) is required to understand this section.
-
-typedef struct rb_fdset_t ::
-
- The data structure which wraps the fd_set bitmap used by select(2).
- This allows Ruby to use FD sets larger than that allowed by
- historic limitations on modern platforms.
-
-void rb_fd_init(rb_fdset_t *) ::
-
- Initializes the rb_fdset_t, it must be initialized before other rb_fd_*
- operations. Analogous to calling malloc(3) to allocate an fd_set.
-
-void rb_fd_term(rb_fdset_t *) ::
-
- Destroys the rb_fdset_t, releasing any memory and resources it used.
- It must be reinitialized using rb_fd_init before future use.
- Analogous to calling free(3) to release memory for an fd_set.
-
-void rb_fd_zero(rb_fdset_t *) ::
-
- Clears all FDs from the rb_fdset_t, analogous to FD_ZERO(3).
-
-void rb_fd_set(int fd, rb_fdset_t *) ::
-
- Adds a given FD in the rb_fdset_t, analogous to FD_SET(3).
-
-void rb_fd_clr(int fd, rb_fdset_t *) ::
-
- Removes a given FD from the rb_fdset_t, analogous to FD_CLR(3).
-
-int rb_fd_isset(int fd, const rb_fdset_t *) ::
-
- Returns true if a given FD is set in the rb_fdset_t, false if not.
- Analogous to FD_ISSET(3).
-
-int rb_thread_fd_select(int nfds, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *exceptfds, struct timeval *timeout) ::
-
- Analogous to the select(2) system call, but allows other Ruby
- threads to be scheduled while waiting.
-
- When only waiting on a single FD, favor rb_io_wait_readable,
- rb_io_wait_writable, or rb_wait_for_single_fd functions since
- they can be optimized for specific platforms (currently, only Linux).
-
-=== 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.
-
-=== Memory usage
-
-void rb_gc_adjust_memory_usage(ssize_t diff) ::
-
- Adjusts the amount of registered external memory. You can tell GC how
- much memory is used by an external library by this function. Calling
- this function with positive diff means the memory usage is increased;
- new memory block is allocated or a block is reallocated as larger
- size. Calling this function with negative diff means the memory usage
- is decreased; a memory block is freed or a block is reallocated as
- smaller size. This function may trigger the GC.
-
-=== 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
-(https://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 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 171724b2e5..6a5ff2e236 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 1e70555988..3bc7e05623 100644
--- a/doc/globals.rdoc
+++ b/doc/globals.rdoc
@@ -10,7 +10,7 @@ $':: The string to the right of the last successful match.
$+:: The highest group matched by the last successful match.
$1:: The Nth group of the last successful match. May be > 1.
$~:: The information about the last match in the current scope.
-$=:: This variable is no longer effective. Deprecated.
+$=:: The flag for case insensitive, nil by default.
$/:: The input record separator, newline by default.
$\:: The output record separator for the print and IO#write. Default is nil.
$,:: The output field separator for the print and Array#join.
diff --git a/doc/irb/irb-tools.rd.ja b/doc/irb/irb-tools.rd.ja
index b997f0edea..3c95faeb8a 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/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 85b6536ee4..416dec3906 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -83,6 +83,7 @@ irb起動時に``~/.irbrc''を読み込みます. もし存在しない場合は
できます.
IRB.conf[:IRB_NAME]="irb"
+ IRB.conf[:MATH_MODE]=false
IRB.conf[:USE_TRACER]=false
IRB.conf[:USE_LOADER]=false
IRB.conf[:IGNORE_SIGINT]=true
@@ -206,6 +207,9 @@ irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両
nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non
inspect modeとなる.
+--- conf.math_mode
+ 参照のみ. bcモード(分数, 行列の計算ができます)かどうか?
+
--- conf.use_loader = true/false
load/require時にirbのfile読み込み機能を用いるモードのスイッチ(デフォ
ルトは用いない). このモードはIRB全体に反映される.
@@ -405,3 +409,4 @@ rubyでは, 以下のプログラムはエラーになります.
% comment-end: "\n"
% End:
%
+
diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc
index 382a4e2cbf..82b8004662 100644
--- a/doc/maintainers.rdoc
+++ b/doc/maintainers.rdoc
@@ -34,20 +34,30 @@ Yukihiro Matsumoto (matz)
Zachary Scott (zzak)
-== Standard Library Maintainers
-
-=== Libraries
+== Library Maintainers
[lib/English.rb]
_unmaintained_
[lib/abbrev.rb]
Akinori MUSHA (knu)
[lib/base64.rb]
- Yusuke Endoh (mame)
+ * 1.8: _unmaintained_
+ * 1.9: Yusuke Endoh (mame)
[lib/benchmark.rb]
_unmaintained_
[lib/cgi.rb, lib/cgi/*]
Takeyuki Fujioka (xibbar)
+[lib/complex.rb]
+ * 1.8: _unmaintained_
+ * 1.9: moved into core
+[lib/cmath.rb]
+ * 1.8: 1.9 feature
+ * 1.9: _unmaintained_
+[lib/csv.rb]
+ * 1.8: Hiroshi Nakamura (nahi)
+ * 1.9: James Edward Gray II (jeg2)
+[lib/date.rb, lib/date/*]
+ Tadayoshi Funaba (tadf)
[lib/drb.rb, lib/drb/*]
Masatoshi SEKI (seki)
[lib/debug.rb]
@@ -57,21 +67,45 @@ Zachary Scott (zzak)
[lib/e2mmap.rb]
Keiju ISHITSUKA (keiju)
[lib/erb.rb]
- Masatoshi SEKI (seki), Takashi Kokubun (k0kubun)
+ Masatoshi SEKI (seki)
+[lib/fileutils.rb]
+ _unmaintained_
[lib/find.rb]
Kazuki Tsujimoto (ktsj)
+[lib/finalize.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
[lib/forwardable.rb]
Keiju ISHITSUKA (keiju)
+[lib/ftools.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
+[lib/generator.rb]
+ * 1.8: Akinori MUSHA (knu)
+ * 1.9: moved into core
[lib/getoptlong.rb]
_unmaintained_
+[lib/getopts.rb]
+ * 1.8: Akinori MUSHA (knu)
+ * 1.9: _deprecated_
+[lib/gserver.rb]
+ James Edward Gray II (jeg2)
[lib/ipaddr.rb]
Akinori MUSHA (knu)
[lib/irb.rb, lib/irb/*]
Keiju ISHITSUKA (keiju)
+[lib/jcode.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
[lib/logger.rb]
- Naotoshi Seo (sonots)
+ Hiroshi Nakamura (nahi)
+[lib/mathn.rb]
+ Keiju ISHITSUKA (keiju)
[lib/matrix.rb]
Marc-Andre Lafortune (marcandre)
+[lib/minitest/*]
+ * 1.8: 1.9 feature
+ * 1.9: Ryan Davis (ryan)
[lib/mkmf.rb]
_unmaintained_
[lib/monitor.rb]
@@ -82,12 +116,12 @@ Zachary Scott (zzak)
Shugo Maeda (shugo)
[lib/net/imap.rb]
Shugo Maeda (shugo)
-[lib/net/http.rb, lib/net/https.rb]
+[lib/net/telnet.rb]
+ _unmaintained_
+[lib/net/http.rb, lib/net/https]
NARUSE, Yui (naruse)
[lib/net/pop.rb]
_unmaintained_
-[lib/net/protocol.rb]
- _unmaintained_
[lib/net/smtp.rb]
_unmaintained_
[lib/observer.rb]
@@ -100,6 +134,17 @@ Zachary Scott (zzak)
Nobuyuki Nakada (nobu)
[lib/ostruct.rb]
Marc-Andre Lafortune (marcandre)
+[lib/parsearg.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
+[lib/parsedate.rb]
+ * 1.8: Tadayoshi Funaba (tadf)
+ * 1.9: _deprecated_
+[lib/pathname.rb]
+ Tanaka Akira (akr)
+[lib/ping.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
[lib/pp.rb]
Tanaka Akira (akr)
[lib/prettyprint.rb]
@@ -114,6 +159,16 @@ Zachary Scott (zzak)
_unmaintained_
[lib/racc/*]
Aaron Patterson (tenderlove)
+[lib/rake/*]
+ Eric Hodel (drbrain)
+[lib/rational.rb]
+ * 1.8: _unmaintained_
+ * 1.9: moved into core
+[lib/rdoc/*]
+ Eric Hodel (drbrain)
+[lib/readbytes.rb]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
[lib/resolv-replace.rb]
Tanaka Akira (akr)
[lib/resolv.rb]
@@ -122,11 +177,16 @@ Zachary Scott (zzak)
Kouhei Sutou (kou)
[lib/rinda/*]
Masatoshi SEKI (seki)
-[lib/rss.rb, lib/rss/*]
+[lib/rss/*]
Kouhei Sutou (kou)
[lib/rubygems.rb, lib/ubygems.rb, lib/rubygems/*]
- Eric Hodel (drbrain), Hiroshi SHIBATA (hsbt)
- https://github.com/rubygems/rubygems
+ * 1.8: 1.9 feature
+ * 1.9: Eric Hodel (drbrain)
+[lib/rubyunit.rb, lib/runit/*]
+ * 1.8: _unmaintained_
+ * 1.9: _deprecated_
+[lib/scanf.rb]
+ David A. Black (dblack)
[lib/set.rb]
Akinori MUSHA (knu)
[lib/securerandom.rb]
@@ -137,12 +197,19 @@ Zachary Scott (zzak)
Akinori MUSHA (knu)
[lib/singleton.rb]
Yukihiro Matsumoto (matz)
+[lib/{soap|wsdl|xsd}/*]
+ * 1.8: Hiroshi Nakamura (nahi)
+ * 1.9: _deprecated_
[lib/sync.rb]
Keiju ISHITSUKA (keiju)
[lib/tempfile.rb]
_unmaintained_
+[lib/test/*]
+ Shota Fukumori (sorah)
[lib/tmpdir.rb]
_unmaintained_
+[lib/thread.rb]
+ _unmaintained_
[lib/thwait.rb]
Keiju ISHITSUKA (keiju)
[lib/time.rb]
@@ -155,37 +222,71 @@ Zachary Scott (zzak)
Tanaka Akira (akr)
[lib/un.rb]
WATANABE Hirofumi (eban)
-[lib/unicode_normalize.rb, lib/unicode_normalize/*]
- Martin J. Dürst
[lib/uri.rb, lib/uri/*]
YAMADA, Akira (akira)
[lib/weakref.rb]
_unmaintained_
+[lib/webrick.rb, lib/webrick/*]
+ Hiroshi Nakamura (nahi)
+[lib/xmlrpc/*]
+ Kouhei Sutou (kou)
[lib/yaml.rb, lib/yaml/*]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA (hsbt)
+ Aaron Patterson (tenderlove)
-=== Extensions
+== Extension Maintainers
-[ext/cgi]
- Nobuyoshi Nakada (nobu)
+[ext/Win32API]
+ * 1.8: _unmaintained_
+ * 1.9: merged into dl
+[ext/bigdecimal]
+ Kenta Murata (mrkn)
[ext/continuation]
- Koichi Sasada (ko1)
+ * 1.8: 1.9 feature
+ * 1.9: Koichi Sasada (ko1)
[ext/coverage]
Yusuke Endoh (mame)
+[ext/dbm]
+ _unmaintained_
[ext/digest, ext/digest/*]
Akinori MUSHA (knu)
+[ext/dl]
+ Aaron Patterson (tenderlove)
+[ext/dl/win32]
+ NAKAMURA Usaku (usa)
+[ext/enumerator]
+ * 1.8: Akinori MUSHA (knu)
+ * 1.9: moved into core
+[ext/etc]
+ _unmaintained_
+[ext/fcntl]
+ _unmaintained_
[ext/fiber]
- Koichi Sasada (ko1)
-[ext/io/nonblock]
+ * 1.8: 1.9 feature
+ * 1.9: Koichi Sasada (ko1)
+[ext/fiddle]
+ Aaron Patterson (tenderlove)
+[ext/gdbm]
+ Yukihiro Matsumoto (matz)
+[ext/iconv]
Nobuyuki Nakada (nobu)
[ext/io/wait]
Nobuyuki Nakada (nobu)
+[ext/json]
+ NARUSE, Yui (naruse)
+[ext/mathn/complex]
+ * 1.8: 1.9 feature
+ * 1.9: Keiju ISHITSUKA (keiju)
+[ext/mathn/rational]
+ * 1.8: 1.9 feature
+ * 1.9: Keiju ISHITSUKA (keiju)
[ext/nkf]
NARUSE, Yui (narse)
[ext/objspace]
_unmaintained_
-[ext/pathname]
- Tanaka Akira (akr)
+[ext/openssl]
+ Martin Boßlet (emboss)
+[ext/psych]
+ Aaron Patterson (tenderlove)
[ext/pty]
_unmaintained_
[ext/racc]
@@ -194,100 +295,28 @@ Zachary Scott (zzak)
TAKAO Kouji (kouji)
[ext/ripper]
_unmaintained_
+[ext/sdbm]
+ Yukihiro Matsumoto (matz)
[ext/socket]
* Tanaka Akira (akr)
* API change needs matz's approval
-[ext/syslog]
- Akinori MUSHA (knu)
-[ext/win32]
- NAKAMURA Usaku (usa)
-[ext/win32ole]
- Masaki Suketa (suke)
-
-== Default gems Maintainers
-
-=== Libraries
-
-[lib/cmath.rb]
- _unmaintained_
- https://github.com/ruby/cmath
-[lib/csv.rb]
- James Edward Gray II (jeg2)
- https://github.com/ruby/csv
-[lib/fileutils.rb]
- _unmaintained_
- https://github.com/ruby/fileutils
-[lib/rdoc.rb, lib/rdoc/*]
- Eric Hodel (drbrain), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/rdoc
-[lib/scanf.rb]
- David A. Black (dblack)
- https://github.com/ruby/scanf
-[lib/webrick.rb, lib/webrick/*]
- Eric Wong (normalperson)
- https://bugs.ruby-lang.org/
-
-=== Extensions
-
-[ext/bigdecimal]
- Kenta Murata (mrkn)
- https://github.com/ruby/bigdecimal
-[ext/date]
- _unmaintained_
- https://github.com/ruby/date
-[ext/dbm]
- _unmaintained_
- https://github.com/ruby/dbm
-[ext/etc]
- _unmaintained_
- https://github.com/ruby/etc
-[ext/fcntl]
- _unmaintained_
- https://github.com/ruby/fcntl
-[ext/fiddle]
- Aaron Patterson (tenderlove)
- https://github.com/ruby/fiddle
-[ext/gdbm]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/gdbm
-[ext/io/console]
- Nobuyuki Nakada (nobu)
- https://github.com/ruby/io-console
-[ext/json]
- NARUSE, Yui (naruse), Hiroshi SHIBATA (hsbt)
- https://github.com/flori/json
-[ext/openssl]
- Kazuki Yamaguchi (rhe)
- https://github.com/ruby/openssl
-[ext/psych]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA(hsbt)
- https://github.com/ruby/psych
-[ext/sdbm]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/sdbm
[ext/stringio]
Nobuyuki Nakada (nobu)
- https://github.com/ruby/stringio
[ext/strscan]
_unmaintained_
- https://github.com/ruby/strscan
+[ext/syck]
+ _unmaintained_
+[ext/syslog]
+ Akinori MUSHA (knu)
+[ext/thread]
+ * 1.8: _unmaintained_
+ * 1.9: 1.8 feature
+[ext/tcltklib]
+ _deprecated_
+[ext/tk]
+ Hidetoshi NAGAI (nagai)
+[ext/win32ole]
+ Masaki Suketa (suke)
[ext/zlib]
_unmaintained_
- https://github.com/ruby/zlib
-
-== Bundled gems upstream repositories
-[did_you_mean]
- https://github.com/yuki24/did_you_mean
-[minitest]
- https://github.com/seattlerb/minitest
-[net-telnet]
- https://github.com/ruby/net-telnet
-[power_assert]
- https://github.com/k-tsj/power_assert
-[rake]
- https://github.com/ruby/rake
-[test-unit]
- https://github.com/test-unit/test-unit
-[xmlrpc]
- https://github.com/ruby/xmlrpc
diff --git a/doc/marshal.rdoc b/doc/marshal.rdoc
index a51f1bf873..f97db00a49 100644
--- a/doc/marshal.rdoc
+++ b/doc/marshal.rdoc
@@ -134,8 +134,8 @@ object is encountered again. (The first object has an index of 1).
"@" represents an object link. Following the type byte is a long giving the
index of the object.
-For example, the following stream contains an Array of the same
-<code>"hello"</code> object twice:
+For example, the following stream contains an Array of the object
+<code>"hello"</code> twice:
"\004\b[\a\"\nhello@\006"
diff --git a/doc/pty/README.ja b/doc/pty/README.ja
index 2d83ffa033..9b9d306bf7 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 06c730058d..810f15ce1a 100644
--- a/doc/regexp.rdoc
+++ b/doc/regexp.rdoc
@@ -63,10 +63,9 @@ The following are <i>metacharacters</i> <tt>(</tt>, <tt>)</tt>,
<tt>[</tt>, <tt>]</tt>, <tt>{</tt>, <tt>}</tt>, <tt>.</tt>, <tt>?</tt>,
<tt>+</tt>, <tt>*</tt>. They have a specific meaning when appearing in a
pattern. To match them literally they must be backslash-escaped. To match
-a backslash literally, backslash-escape it: <tt>\\\\</tt>.
+a backslash literally backslash-escape that: <tt>\\\\\\</tt>.
/1 \+ 2 = 3\?/.match('Does 1 + 2 = 3?') #=> #<MatchData "1 + 2 = 3?">
- /a\\\\b/.match('a\\\\b') #=> #<MatchData "a\\b">
Patterns behave like double-quoted strings so can contain the same
backslash escapes.
@@ -129,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\v]/</tt>
-* <tt>/\S/</tt> - A non-whitespace character: <tt>/[^ \t\r\n\f\v]/</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>
POSIX <i>bracket expressions</i> are also similar to character classes.
They provide a portable alternative to the above, with the added benefit
@@ -228,7 +227,7 @@ Capture groups can be referred to by name when defined with the
constructs.
/\$(?<dollars>\d+)\.(?<cents>\d+)/.match("$3.67")
- #=> #<MatchData "$3.67" dollars:"3" cents:"67">
+ => #<MatchData "$3.67" dollars:"3" cents:"67">
/\$(?<dollars>\d+)\.(?<cents>\d+)/.match("$3.67")[:dollars] #=> "3"
Named groups can be backreferenced with <tt>\k<</tt><i>name</i><tt>></tt>,
@@ -471,19 +470,7 @@ characters, <i>anchoring</i> the match to a specific position.
* <tt>\Z</tt> - Matches end of string. If string ends with a newline,
it matches just before newline
* <tt>\z</tt> - Matches end of string
-* <tt>\G</tt> - Matches first matching position:
-
- In methods like <tt>String#gsub</tt> and <tt>String#scan</tt>, it changes on each iteration.
- It initially matches the beginning of subject, and in each following iteration it matches where the last match finished.
-
- " a b c".gsub(/ /, '_') #=> "____a_b_c"
- " a b c".gsub(/\G /, '_') #=> "____a b c"
-
- In methods like <tt>Regexp#match</tt> and <tt>String#match</tt> that take an (optional) offset, it matches where the search begins.
-
- "hello, world".match(/,/, 3) #=> #<MatchData ",">
- "hello, world".match(/\G,/, 3) #=> nil
-
+* <tt>\G</tt> - Matches point where last match finished
* <tt>\b</tt> - Matches word boundaries when outside brackets;
backspace (0x08) when inside brackets
* <tt>\B</tt> - Matches non-word boundaries
@@ -581,9 +568,6 @@ 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
@@ -608,9 +592,9 @@ regexp's encoding can be explicitly fixed by supplying
<tt>Regexp.new</tt>:
r = Regexp.new("a".force_encoding("iso-8859-1"),Regexp::FIXEDENCODING)
- r =~ "a\u3042"
- # raises Encoding::CompatibilityError: incompatible encoding regexp match
- # (ISO-8859-1 regexp with UTF-8 string)
+ r =~"a\u3042"
+ #=> Encoding::CompatibilityError: incompatible encoding regexp match
+ (ISO-8859-1 regexp with UTF-8 string)
== Special global variables
diff --git a/doc/security.rdoc b/doc/security.rdoc
index d7d6464ce1..d8efca0042 100644
--- a/doc/security.rdoc
+++ b/doc/security.rdoc
@@ -7,12 +7,12 @@ This document aims to discuss many of these pitfalls and provide more secure
alternatives where applicable.
Please check the full list of publicly known CVEs and how to correctly report a
-security vulnerability, at: https://www.ruby-lang.org/en/security/
-Japanese version is here: https://www.ruby-lang.org/ja/security/
+security vulnerability, at: http://www.ruby-lang.org/en/security/
+Japanese version is here: http://www.ruby-lang.org/ja/security/
Security vulnerabilities should be reported via an email to
mailto:security@ruby-lang.org ({the PGP public
-key}[https://www.ruby-lang.org/security.asc]), which is a private mailing list.
+key}[http://www.ruby-lang.org/security.asc]), which is a private mailing list.
Reported problems will be published after fixes.
== <code>$SAFE</code>
@@ -66,28 +66,20 @@ 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.
-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.
+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.
== Regular expressions
diff --git a/doc/shell.rd.ja b/doc/shell.rd.ja
index a9507fe92a..053b11fb99 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 ff6f6238d8..448635758b 100644
--- a/doc/standard_library.rdoc
+++ b/doc/standard_library.rdoc
@@ -12,21 +12,28 @@ Abbrev:: Calculates a set of unique abbreviations for a given set of strings
Base64:: Support for encoding and decoding binary data using a Base64 representation
Benchmark:: Provides methods to measure and report the time used to execute code
CGI:: Support for the Common Gateway Interface protocol
-ConditionVariable:: Augments the Mutex class
+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
Delegator:: Provides three abilities to delegate method calls to an object
DRb:: Distributed object system for Ruby
E2MM:: Module for defining custom exceptions with specific messages
English.rb:: Require 'English.rb' to reference global variables with less cryptic names
ERB:: An easy to use but powerful templating system for Ruby
+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 outputting messages
+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
@@ -34,7 +41,8 @@ Net::HTTP:: HTTP client api for Ruby
Net::IMAP:: Ruby client api for Internet Message Access Protocol
Net::POP3:: Ruby client library for POP3
Net::SMTP:: Simple Mail Transfer Protocol client library for Ruby
-Observable:: Provides a mechanism for publish/subscribe pattern in Ruby
+Net::Telnet:: Telnet client library for Ruby
+Observable:: Provides a mechanism for publich/subscribe pattern in Ruby
OpenURI:: An easy-to-use wrapper for Net::HTTP, Net::HTTPS and Net::FTP
Open3:: Provides access to stdin, stdout and stderr when running other programs
OptionParser:: Ruby-oriented class for command-line option analysis
@@ -45,15 +53,19 @@ Prime:: Prime numbers and factorization library
profile.rb:: Runs the Ruby Profiler__
Profiler__:: Provides a way to profile your Ruby application
PStore:: Implements a file based persistence mechanism based on a Hash
-Queue:: Synchronized communication between threads
+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
Resolv:: Thread-aware DNS resolver library in Ruby
REXML:: An XML toolkit for Ruby
Rinda:: The Linda distributed computing paradigm in Ruby
RSS:: Family of libraries that support various formats of XML "feeds"
Gem:: Package management framework for Ruby
+Scanf:: A Ruby implementation of the C function scanf(3)
SecureRandom:: Interface for secure random number generator
Set:: Provides a class to deal with collections of unordered, unique values
Shell:: An idiomatic Ruby interface for common UNIX shell commands
@@ -61,6 +73,8 @@ 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
@@ -70,62 +84,42 @@ TSort:: Topological sorting using Tarjan's algorithm
un.rb:: Utilities to replace common UNIX commands
URI:: A Ruby module providing support for Uniform Resource Identifiers
WeakRef:: Allows a referenced object to be garbage-collected
-YAML:: Ruby client library for the Psych YAML implementation
-
-== Extensions
-
-Coverage:: Provides coverage measurement for Ruby
-Digest:: Provides a framework for message digest libraries
-IO:: Extensions for Ruby IO class, including #wait and ::console
-NKF:: Ruby extension for Network Kanji Filter
-objspace:: Extends ObjectSpace module to add methods for internal statistics
-Pathname:: Representation of the name of a file or directory on the filesystem
-PTY:: Creates and manages pseudo terminals
-Readline:: Provides an interface for GNU Readline and Edit Line (libedit)
-Ripper:: Provides an interface for parsing Ruby programs into S-expressions
-Socket:: Access underlying OS socket implementations
-Syslog:: Ruby interface for the POSIX system logging facility
-WIN32OLE:: Provides an interface for OLE Automation in Ruby
-
-= Default gems
-
-== Libraries
-
-Bundler:: Manage your Ruby application's gem dependencies
-CMath:: Provides Trigonometric and Transcendental functions for complex numbers
-CSV:: Provides an interface to read and write CSV files and data
-FileUtils:: Several file utility methods for copying, moving, removing, etc
-RDoc:: Produces HTML and command-line documentation for Ruby
-Scanf:: A Ruby implementation of the C function scanf(3)
WEBrick:: An HTTP server toolkit for Ruby
+XMLRPC:: Remote Procedure Call over HTTP support for Ruby
+YAML:: Ruby client library for the Psych YAML implementation
== Extensions
BigDecimal:: Provides arbitrary-precision floating point decimal arithmetic
+Coverage:: Provides coverage measurement for Ruby
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
GDBM:: Ruby extension for the GNU dbm (gdbm) library
-IO::console:: Console interface
+IO:: Extensions for Ruby IO class, including #wait and ::console
JSON:: Implements Javascript Object Notation for Ruby
-OpenSSL:: Provides SSL, TLS and general purpose cryptography for Ruby
+NKF:: Ruby extension for Network Kanji Filter
+objspace:: Extends ObjectSpace module to add methods for internal statistics
+OpenSSL:: Provides SSL, TSL and general purpose cryptography for Ruby
+Pathname:: Representation of the name of a file or directory on the filesystem
Psych:: A YAML parser and emitter for Ruby
-SDBM:: Provides a simple file-based key-value store with String keys and values
+PTY:: Creates and manages pseudo terminals
+Readline:: Provides an interface for GNU Readline and Edit Line (libedit)
+Ripper:: Provides an interface for parsing Ruby programs into S-expressions
+SBDM:: Provides a simple file-based key-value store with String keys and values
+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
+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
-= Bundled gems
-== Libraries
-DidYouMean:: "Did you mean?" experience in Ruby
-MiniTest:: A test suite with TDD, BDD, mocking and benchmarking
-Net::Telnet:: Telnet client library for Ruby
-PowerAssert:: Power Assert for Ruby.
-Rake:: Ruby build program with capabilities similar to make
-Test::Unit:: A compatibility layer for MiniTest
-XMLRPC:: Remote Procedure Call over HTTP support for Ruby
+
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc
index 83300cbece..adfe6485a4 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
@@ -409,7 +409,7 @@ You can use multiple assignment to swap two values in-place:
# prints {:new_value=>1, :old_value=>2}
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:
+on the left hand side the extra values are ignored:
a, b = 1, 2, 3
@@ -452,3 +452,4 @@ 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 ec86ef05ee..79c0de59dc 100644
--- a/doc/syntax/calling_methods.rdoc
+++ b/doc/syntax/calling_methods.rdoc
@@ -27,10 +27,6 @@ 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.
@@ -66,7 +62,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
@@ -88,7 +84,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
@@ -250,8 +246,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
@@ -263,7 +259,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.
@@ -290,7 +286,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
@@ -300,9 +296,9 @@ arguments, they will not be gathered by <code>*</code>:
Prints:
- {:arguments=>[1, 2, {"3"=>4}], :keywords=>{:five=>6}}
+ {:arguments=>[1, 2], :keywords=>{"3"=>4, :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
@@ -323,12 +319,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.
@@ -347,6 +343,7 @@ 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 65f7b431e3..0efc1668ad 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
@@ -405,8 +405,8 @@ Use +next+ to skip the rest of the current iteration:
p result # prints [2, nil, 6]
-+next+ accepts an argument that can be used as the result of the current
-block iteration:
++next+ accepts an argument that can be used the result of the current block
+iteration:
result = [1, 2, 3].map do |value|
next value if value.even?
@@ -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 a rarely seen conditional expression. It's primary use is
+The flip-flop is 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,6 +494,7 @@ 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 a2e75616fb..0efc35a59f 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,3 +93,4 @@ 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 b8ed7f7c54..32e10edd30 100644
--- a/doc/syntax/literals.rdoc
+++ b/doc/syntax/literals.rdoc
@@ -83,33 +83,8 @@ 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. 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 escaped characters such as <tt>\n</tt> for newline,
+<tt>\t</tt> for tab, etc.
Double-quote strings allow interpolation of other values using
<tt>#{...}</tt>:
@@ -133,7 +108,7 @@ 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.
@@ -149,23 +124,6 @@ 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
@@ -196,20 +154,6 @@ 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:
@@ -255,11 +199,14 @@ 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
@@ -289,14 +236,6 @@ 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
@@ -344,7 +283,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.
@@ -366,3 +305,4 @@ 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 a47c1a3cbf..648843e753 100644
--- a/doc/syntax/methods.rdoc
+++ b/doc/syntax/methods.rdoc
@@ -29,9 +29,9 @@ 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>).
+ASCII NUL (<code>\x00<code>).
-The following are examples of valid Ruby methods:
+The following are the examples of valid ruby methods:
def hello
"hello"
@@ -45,29 +45,29 @@ 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).
+<code>?</code> (question mark) or <code>=</code> equals sign.
-The bang methods (<code>!</code> at the end of the method name) are called and
+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's core library the
-dangerous method implies that when a method ends with a bang (<code>!</code>),
+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, the 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 the 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
+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 has does not
+modify the receiver. This convention is typically true for ruby core libary but
+may/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 may 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 and the arguments are returned
+assignment methods the return value is ignored, the arguments are returned
instead.
-These are method names for the various Ruby operators. Each of these
-operators accepts only one argument. Following the operator is the typical
+These are method names for the various ruby operators. Each of these
+operators accept only one argument. Following the operator is the typical
use or name of the operator. Creating an alternate meaning for the operator
may lead to confusion as the user expects plus to add things, minus to
subtract things, etc. Additionally, you cannot alter the precedence of the
@@ -109,25 +109,6 @@ 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
@@ -147,18 +128,14 @@ evaluated.
1 + 1 # this expression is never evaluated
end
-Note that for assignment methods the return value will be ignored when using
-the assignment syntax. Instead, the argument will be returned:
+Note that for assignment methods the return value will always be ignored.
+Instead the argument will be returned:
def a=(value)
return 1 + value
end
- p(self.a = 5) # prints 5
-
-The actual return value will be returned when invoking the method directly:
-
- p send(:a=, 5) # prints 6
+ p(a = 5) # prints 5
== Scope
@@ -454,6 +431,7 @@ 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 d5691f8d60..8f424f019f 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,3 +104,4 @@ 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 dd70d4ac21..a82a6f27ed 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,3 +342,4 @@ 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 a9c1d9edf9..62405a78b7 100644
--- a/doc/syntax/refinements.rdoc
+++ b/doc/syntax/refinements.rdoc
@@ -9,6 +9,11 @@ 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
@@ -43,21 +48,15 @@ Activate the refinement with #using:
== Scope
-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 until the end of the eval string.
-
-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.
+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.
-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. 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
@@ -80,7 +79,7 @@ outside the current scope the refinement will be deactivated:
x.foo # prints "C#foo in M"
call_foo(x) #=> raises NoMethodError
-If a method is defined in a scope where a refinement is active, the refinement
+If a method is defined in a scope where a refinement is active the refinement
will be active when the method is called. This example spans multiple files:
c.rb:
@@ -142,26 +141,6 @@ 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
@@ -180,9 +159,9 @@ When not evaluated:
end
# not activated here
-When defining multiple refinements in the same module inside multiple +refine+ blocks,
-all refinements from the same module are active when a refined method
-(any of the +to_json+ methods from the example below) is called:
+When defining multiple refinements in the same module, inside a refine block
+all refinements from the same module are active when a refined method is
+called:
module ToJSON
refine Integer do
@@ -208,6 +187,24 @@ all refinements from the same module are active when a refined method
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
@@ -225,13 +222,12 @@ If no method was found at any point this repeats with the superclass of +C+.
Note that methods in a subclass have priority over refinements in a
superclass. For example, if the method <code>/</code> is defined in a
-refinement for Numeric <code>1 / 2</code> invokes the original Integer#/
-because Integer is a subclass of Numeric and is searched before the refinements
-for the superclass Numeric. Since the method <code>/</code> is also present
-in child +Integer+, the method lookup does not move up to the superclass.
+refinement for Integer <code>1 / 2</code> invokes the original Fixnum#/
+because Fixnum is a subclass of Integer and is searched before the refinements
+for the superclass Integer.
-However, if a method +foo+ is defined on Numeric in a refinement, <code>1.foo</code>
-invokes that method since +foo+ does not exist on Integer.
+If a method +foo+ is defined on Integer in a refinement, <code>1.foo</code>
+invokes that method since +foo+ does not exist on Fixnum.
== +super+
@@ -256,31 +252,15 @@ method lookup.
This behavior may be changed in the future.
-== Refinement inheritance by Module#include
-
-When a module X is included into a module Y, Y inherits refinements from X.
+== Refinements and module inclusion
-For exmaple, C inherits refinements from A and B in the following code:
-
- module A
- refine X do ... end
- refine Y do ... end
- end
- module B
- refine Z do ... end
- end
- module C
- include A
- include B
- end
-
- using C
- # Refinements in A and B are activated here.
-
-Refinements in descendants have higher precedence than those of ancestors.
+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 https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec for the
+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 8385236494..a64785d1c5 100644
--- a/enc/Makefile.in
+++ b/enc/Makefile.in
@@ -1,7 +1,8 @@
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-ECHO1 = $(V:1=@@NULLCMD@)
+n=$(NULLCMD)
+ECHO1 = $(V:1=@$n)
ECHO = $(ECHO1:0=@echo)
encsrcdir = @srcdir@
@@ -20,14 +21,11 @@ TRANSSODIR = $(ENCSODIR)/trans
DLEXT = @DLEXT@
OBJEXT = @OBJEXT@
LIBEXT = @LIBEXT@
-TIMESTAMPDIR = $(EXTOUT)/.timestamp
-ENC_TRANS_D = $(TIMESTAMPDIR)/.enc-trans.time
-ENC_TRANS_SO_D = $(TIMESTAMPDIR)/.enc-trans.so.time
-BUILTIN_ENCS = enc/ascii.c enc/us_ascii.c\
- enc/unicode.c enc/utf_8.c
+BUILTIN_ENCS = ascii.c us_ascii.c\
+ unicode.c utf_8.c
-BUILTIN_TRANSES = enc/trans/newline.trans
+BUILTIN_TRANSES = newline.trans
RUBY_SO_NAME = @RUBY_SO_NAME@
LIBRUBY = @LIBRUBY@
@@ -72,7 +70,7 @@ MAKEDIRS = @MAKEDIRS@
.SUFFIXES: .trans
-all:
+all: make-workdir
make-workdir:
$(Q)$(MAKEDIRS) $(WORKDIRS)
diff --git a/enc/ascii.c b/enc/ascii.c
index 8b32c414fe..72150c037c 100644
--- a/enc/ascii.c
+++ b/enc/ascii.c
@@ -29,13 +29,6 @@
*/
#include "regenc.h"
-#ifdef RUBY
-# include "encindex.h"
-#endif
-
-#ifndef ENCINDEX_ASCII
-# define ENCINDEX_ASCII 0
-#endif
OnigEncodingDefine(ascii, ASCII) = {
onigenc_single_byte_mbc_enc_len,
@@ -54,8 +47,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,
- onigenc_single_byte_ascii_only_case_map,
- ENCINDEX_ASCII,
+ 0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("BINARY", "ASCII-8BIT")
diff --git a/enc/big5.c b/enc/big5.c
index ab4fb69819..27315c4ba9 100644
--- a/enc/big5.c
+++ b/enc/big5.c
@@ -300,7 +300,6 @@ OnigEncodingDefine(big5, BIG5) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
@@ -335,7 +334,6 @@ OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
@@ -370,7 +368,6 @@ OnigEncodingDefine(big5_uao, BIG5_UAO) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/cp949.c b/enc/cp949.c
index bd2c8d21a4..bf1c2637a3 100644
--- a/enc/cp949.c
+++ b/enc/cp949.c
@@ -211,7 +211,6 @@ OnigEncodingDefine(cp949, CP949) = {
onigenc_not_support_get_ctype_code_range,
cp949_left_adjust_char_head,
cp949_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/depend b/enc/depend
index 71345a91fc..d3e1f3c74b 100644
--- a/enc/depend
+++ b/enc/depend
@@ -28,10 +28,8 @@ else
''
end %> <%=CONFIG['LIBS']%> $(EXTLIBS)
-ENCOBJS =<%ENCS.map {|e|%> enc/<%=e%>.$(OBJEXT) \
- <%}%> #
-ENCSOS =<%ENCS.map {|e|%> $(ENCSODIR)/<%=e%>.$(DLEXT) \
- <%}%> #
+ENCOBJS = <%=ENCS.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if ENCS.size>1%>
+ENCSOS = <%=ENCS.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if ENCS.size>1%>
ENCCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
@@ -42,12 +40,9 @@ LIBENC=enc/libenc.$(LIBEXT)
TRANSVPATH = $(srcdir)/enc/trans
-TRANSCSRCS =<%ATRANS.map {|e|%> <%=transvpath % "#{e}.c"%> \
- <%}%> #
-TRANSOBJS =<%TRANS.map {|e|%> enc/<%=e%>.$(OBJEXT) \
- <%}%> #
-TRANSSOS =<%TRANS.map {|e|%> $(ENCSODIR)/<%=e%>.$(DLEXT) \
- <%}%> #
+TRANSCSRCS = <%=ATRANS.map {|e| transvpath % "#{e}.c"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
+TRANSOBJS = <%=TRANS.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
+TRANSSOS = <%=TRANS.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if TRANS.size>1%>
TRANSCLEANLIBS = <%=cleanlibs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
@@ -55,7 +50,6 @@ TRANSCLEANOBJS = <%=cleanobjs.map {|clean|
clean.gsub(/\$\*(\.\w+)?/) {"$(TRANSOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"}
}.join(" ")%>
LIBTRANS=enc/libtrans.$(LIBEXT)
-UNICODE_HDR_DIR = --missing-unicode-header-dir--
encs: all
% if MODULE_TYPE == :static
@@ -80,39 +74,28 @@ $(LIBTRANS): $(TRANSOBJS)
$(Q) $(AR) $(ARFLAGS)$@ $(TRANSOBJS)
@-$(RANLIB) $@ 2> /dev/null || true
-enc trans $(ENCSOS) $(TRANSSOS): config.status
-
srcs: $(TRANSCSRCS)
-$(ENC_TRANS_D):
- $(Q) $(MAKEDIRS) enc/trans
- @exit > $@
-
-$(ENC_TRANS_SO_D):
- $(Q) $(MAKEDIRS) $(TRANSSODIR)
- @exit > $@
-
-$(ENCOBJS) $(TRANSOBJS): $(ENC_TRANS_D)
-$(ENCSOS) $(TRANSSOS): $(ENC_TRANS_SO_D)
-
<%=transvpath_prefix%>.trans<%=transvpath_prefix%>.c:
$(ECHO) generating table from $@
$(Q)$(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<"
% 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"
<%=transvpath % "#{e}.c"%>: <%= transvpath % "#{e}.trans"%>
-% trans = IO.read(File.join($srcdir, "trans", src))
-% src = trans.scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}
-% if src.empty?
-% src = trans.scan(/^\s*transcode_tblgen_\w+\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c.downcase+"-tbl.rb"}
-% end
+% src = [*IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}]
<%=transvpath % "#{e}.c"%>: <%= src.map {|s| transvpath % "#{s}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb
% end
@@ -139,11 +122,13 @@ enc/<%=e%>.$(OBJEXT): <%=deps.map {|n| rule_subst % n}.join(' ')%>
% cmd.sub!(/\$\(DEFFILE\)/) {df}
% cmd.gsub!(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}
% end
+ $(Q)$(MAKEDIRS) "$(@D)"
$(Q)<%=cmd%>
% end
% dependencies.each do |e|
<%="enc/#{e}.$(OBJEXT)"%>: <%="$(encsrcdir)/#{e}.c"%>
+ -$(Q)$(MAKEDIRS) "$(@D)"
$(ECHO) compiling <%= "$(encsrcdir)/#{e}.c"%>
$(Q)<%=COMPILE_C.gsub(/\$(\()?<(\:[^)]+)?(\))?/){"$(encsrcdir)/#{e}.c"}%>
@@ -153,12 +138,12 @@ enc/encdb.$(OBJEXT): encdb.h
enc/trans/transdb.$(OBJEXT): transdb.h
clean:
-% %w[$(ENCSOS) $(LIBENC) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(LIBTRANS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS) $(ENC_TRANS_D) $(ENC_TRANS_SO_D)].each do |clean|
+% %w[$(ENCSOS) $(LIBENC) $(ENCOBJS) $(ENCCLEANOBJS) $(ENCCLEANLIBS) $(TRANSSOS) $(LIBTRANS) $(TRANSOBJS) $(TRANSCLEANOBJS) $(TRANSCLEANLIBS)].each do |clean|
$(Q)$(RM) <%=pathrep[clean]%>
% end
% @ignore_error = $nmake ? '' : ' 2> /dev/null || true'
% unless inplace
- $(Q)$(RM) enc/unicode/*/casefold.h enc/unicode/*/name2ctype.h
+ $(Q)$(RM) enc/unicode/name2ctype.h
$(Q)$(RM) enc/jis/props.h
-$(Q)$(RMDIR) enc/unicode<%=@ignore_error%>
% end
@@ -169,586 +154,10 @@ clean:
clean-srcs:
$(Q)$(RM) <%=pathrep['$(TRANSCSRCS)']%>
-$(Q)$(RMDIR) <%=pathrep['enc/trans']%><%=@ignore_error%>
- $(Q)$(RM) enc/unicode/*/casefold.h enc/unicode/*/name2ctype.h
+ $(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)/encindex.h
-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): onigmo.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): onigmo.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): onigmo.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): backward.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): onigmo.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): backward.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): onigmo.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): backward.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): onigmo.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): onigmo.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): onigmo.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): onigmo.h
-enc/gb18030.$(OBJEXT): oniguruma.h
-enc/gb2312.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/gb2312.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/gb2312.$(OBJEXT): backward.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): onigmo.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): onigmo.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.h
-enc/iso_8859_1.$(OBJEXT): enc/iso_8859_1.c
-enc/iso_8859_1.$(OBJEXT): missing.h
-enc/iso_8859_1.$(OBJEXT): onigmo.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.h
-enc/iso_8859_10.$(OBJEXT): enc/iso_8859_10.c
-enc/iso_8859_10.$(OBJEXT): missing.h
-enc/iso_8859_10.$(OBJEXT): onigmo.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): onigmo.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.h
-enc/iso_8859_13.$(OBJEXT): enc/iso_8859_13.c
-enc/iso_8859_13.$(OBJEXT): missing.h
-enc/iso_8859_13.$(OBJEXT): onigmo.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.h
-enc/iso_8859_14.$(OBJEXT): enc/iso_8859_14.c
-enc/iso_8859_14.$(OBJEXT): missing.h
-enc/iso_8859_14.$(OBJEXT): onigmo.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.h
-enc/iso_8859_15.$(OBJEXT): enc/iso_8859_15.c
-enc/iso_8859_15.$(OBJEXT): missing.h
-enc/iso_8859_15.$(OBJEXT): onigmo.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.h
-enc/iso_8859_16.$(OBJEXT): enc/iso_8859_16.c
-enc/iso_8859_16.$(OBJEXT): missing.h
-enc/iso_8859_16.$(OBJEXT): onigmo.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.h
-enc/iso_8859_2.$(OBJEXT): enc/iso_8859_2.c
-enc/iso_8859_2.$(OBJEXT): missing.h
-enc/iso_8859_2.$(OBJEXT): onigmo.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.h
-enc/iso_8859_3.$(OBJEXT): enc/iso_8859_3.c
-enc/iso_8859_3.$(OBJEXT): missing.h
-enc/iso_8859_3.$(OBJEXT): onigmo.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.h
-enc/iso_8859_4.$(OBJEXT): enc/iso_8859_4.c
-enc/iso_8859_4.$(OBJEXT): missing.h
-enc/iso_8859_4.$(OBJEXT): onigmo.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): onigmo.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): onigmo.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): onigmo.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): onigmo.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.h
-enc/iso_8859_9.$(OBJEXT): enc/iso_8859_9.c
-enc/iso_8859_9.$(OBJEXT): missing.h
-enc/iso_8859_9.$(OBJEXT): onigmo.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): onigmo.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): onigmo.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): backward.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): onigmo.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): backward.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): backward.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/ebcdic.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/trans/ebcdic.$(OBJEXT): $(top_srcdir)/transcode_data.h
-enc/trans/ebcdic.$(OBJEXT): backward.h
-enc/trans/ebcdic.$(OBJEXT): config.h
-enc/trans/ebcdic.$(OBJEXT): defines.h
-enc/trans/ebcdic.$(OBJEXT): enc/trans/ebcdic.c
-enc/trans/ebcdic.$(OBJEXT): intern.h
-enc/trans/ebcdic.$(OBJEXT): missing.h
-enc/trans/ebcdic.$(OBJEXT): st.h
-enc/trans/ebcdic.$(OBJEXT): subst.h
-enc/trans/emoji.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/trans/emoji.$(OBJEXT): $(top_srcdir)/transcode_data.h
-enc/trans/emoji.$(OBJEXT): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): backward.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): $(UNICODE_HDR_DIR)/casefold.h
-enc/unicode.$(OBJEXT): $(UNICODE_HDR_DIR)/name2ctype.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): intern.h
-enc/unicode.$(OBJEXT): missing.h
-enc/unicode.$(OBJEXT): onigmo.h
-enc/unicode.$(OBJEXT): oniguruma.h
-enc/unicode.$(OBJEXT): st.h
-enc/unicode.$(OBJEXT): subst.h
-enc/us_ascii.$(OBJEXT): $(top_srcdir)/encindex.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): onigmo.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/iso_8859.h
-enc/utf_16be.$(OBJEXT): enc/utf_16be.c
-enc/utf_16be.$(OBJEXT): missing.h
-enc/utf_16be.$(OBJEXT): onigmo.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/iso_8859.h
-enc/utf_16le.$(OBJEXT): enc/utf_16le.c
-enc/utf_16le.$(OBJEXT): missing.h
-enc/utf_16le.$(OBJEXT): onigmo.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/iso_8859.h
-enc/utf_32be.$(OBJEXT): enc/utf_32be.c
-enc/utf_32be.$(OBJEXT): missing.h
-enc/utf_32be.$(OBJEXT): onigmo.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/iso_8859.h
-enc/utf_32le.$(OBJEXT): enc/utf_32le.c
-enc/utf_32le.$(OBJEXT): missing.h
-enc/utf_32le.$(OBJEXT): onigmo.h
-enc/utf_32le.$(OBJEXT): oniguruma.h
-enc/utf_8.$(OBJEXT): $(top_srcdir)/encindex.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): onigmo.h
-enc/utf_8.$(OBJEXT): oniguruma.h
-enc/windows_1250.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/windows_1250.$(OBJEXT): config.h
-enc/windows_1250.$(OBJEXT): defines.h
-enc/windows_1250.$(OBJEXT): enc/iso_8859.h
-enc/windows_1250.$(OBJEXT): enc/windows_1250.c
-enc/windows_1250.$(OBJEXT): missing.h
-enc/windows_1250.$(OBJEXT): onigmo.h
-enc/windows_1250.$(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): onigmo.h
-enc/windows_1251.$(OBJEXT): oniguruma.h
-enc/windows_1252.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/windows_1252.$(OBJEXT): config.h
-enc/windows_1252.$(OBJEXT): defines.h
-enc/windows_1252.$(OBJEXT): enc/iso_8859.h
-enc/windows_1252.$(OBJEXT): enc/windows_1252.c
-enc/windows_1252.$(OBJEXT): missing.h
-enc/windows_1252.$(OBJEXT): onigmo.h
-enc/windows_1252.$(OBJEXT): oniguruma.h
-enc/windows_1253.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/windows_1253.$(OBJEXT): config.h
-enc/windows_1253.$(OBJEXT): defines.h
-enc/windows_1253.$(OBJEXT): enc/windows_1253.c
-enc/windows_1253.$(OBJEXT): missing.h
-enc/windows_1253.$(OBJEXT): onigmo.h
-enc/windows_1254.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/windows_1254.$(OBJEXT): config.h
-enc/windows_1254.$(OBJEXT): defines.h
-enc/windows_1254.$(OBJEXT): enc/iso_8859.h
-enc/windows_1254.$(OBJEXT): enc/windows_1254.c
-enc/windows_1254.$(OBJEXT): missing.h
-enc/windows_1254.$(OBJEXT): onigmo.h
-enc/windows_1257.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/windows_1257.$(OBJEXT): config.h
-enc/windows_1257.$(OBJEXT): defines.h
-enc/windows_1257.$(OBJEXT): enc/iso_8859.h
-enc/windows_1257.$(OBJEXT): enc/windows_1257.c
-enc/windows_1257.$(OBJEXT): missing.h
-enc/windows_1257.$(OBJEXT): onigmo.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): backward.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): onigmo.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
deleted file mode 100644
index a3b380a327..0000000000
--- a/enc/ebcdic.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#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/emacs_mule.c b/enc/emacs_mule.c
index f92eb183cf..275c8f47dc 100644
--- a/enc/emacs_mule.c
+++ b/enc/emacs_mule.c
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-#include "regenc.h"
+#include "regint.h"
#define emacsmule_islead(c) ((UChar )(c) < 0x9e)
@@ -334,7 +334,6 @@ OnigEncodingDefine(emacs_mule, Emacs_Mule) = {
onigenc_not_support_get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/encdb.c b/enc/encdb.c
index a41e4edc6d..fa04a5f7f6 100644
--- a/enc/encdb.c
+++ b/enc/encdb.c
@@ -9,8 +9,13 @@
**********************************************************************/
-#include "internal.h"
-
+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);
#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 70c2a1934c..fd3ade0c4b 100644
--- a/enc/encinit.c.erb
+++ b/enc/encinit.c.erb
@@ -8,30 +8,19 @@
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|
-% next if enc == 'encdb'
- init_enc(<%= enc %>);
+ init(Init_<%= enc %>, "enc/<%= enc %>.so");
% end
- provide(transdb, "trans/transdb");
+ init(Init_transdb, "enc/trans/transdb.so");
% TRANS.each do |trans|
% next if trans == 'trans/transdb'
- init_trans(<%= File.basename trans %>);
+ init(Init_trans_<%= File.basename trans %>, "enc/<%= trans %>.so");
% end
}
<%# vim: set ft=eruby sw=2 : -%>
diff --git a/enc/euc_jp.c b/enc/euc_jp.c
index ded051af69..61bb8ba65a 100644
--- a/enc/euc_jp.c
+++ b/enc/euc_jp.c
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include "regenc.h"
+#include "regint.h"
#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
@@ -381,10 +381,8 @@ 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 */
}
@@ -503,9 +501,9 @@ static const OnigCodePoint CR_Cyrillic[] = {
#include "enc/jis/props.h"
static int
-property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
+property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
- const UChar *s = p, *e = end;
+ UChar *s = p, *e = end;
const struct enc_property *prop =
onig_jis_property((const char* )s, (unsigned int )(e - s));
@@ -576,7 +574,6 @@ OnigEncodingDefine(euc_jp, EUC_JP) = {
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/euc_kr.c b/enc/euc_kr.c
index 21d6ab4e1c..55acf00168 100644
--- a/enc/euc_kr.c
+++ b/enc/euc_kr.c
@@ -188,33 +188,7 @@ OnigEncodingDefine(euc_kr, EUC_KR) = {
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
euckr_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("eucKR", "EUC-KR")
-
-#ifndef RUBY
-/* Same with OnigEncodingEUC_KR except the name */
-OnigEncodingDefine(euc_cn, EUC_CN) = {
- euckr_mbc_enc_len,
- "EUC-CN", /* name */
- 2, /* max enc length */
- 1, /* min enc length */
- onigenc_is_mbc_newline_0x0a,
- euckr_mbc_to_code,
- onigenc_mb2_code_to_mbclen,
- euckr_code_to_mbc,
- euckr_mbc_case_fold,
- onigenc_ascii_apply_all_case_fold,
- onigenc_ascii_get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- euckr_is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- euckr_left_adjust_char_head,
- euckr_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
- 0,
- ONIGENC_FLAG_NONE,
-};
-#endif /* RUBY */
diff --git a/enc/euc_tw.c b/enc/euc_tw.c
index 1c5659cb1d..6d193b745e 100644
--- a/enc/euc_tw.c
+++ b/enc/euc_tw.c
@@ -221,7 +221,6 @@ OnigEncodingDefine(euc_tw, EUC_TW) = {
onigenc_not_support_get_ctype_code_range,
euctw_left_adjust_char_head,
euctw_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/gb18030.c b/enc/gb18030.c
index 63d2e633ec..d4184333f5 100644
--- a/enc/gb18030.c
+++ b/enc/gb18030.c
@@ -597,7 +597,7 @@ OnigEncodingDefine(gb18030, GB18030) = {
onigenc_not_support_get_ctype_code_range,
gb18030_left_adjust_char_head,
gb18030_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
+
diff --git a/enc/gbk.c b/enc/gbk.c
index 31032553bf..7be60a0de9 100644
--- a/enc/gbk.c
+++ b/enc/gbk.c
@@ -211,7 +211,6 @@ OnigEncodingDefine(gbk, GBK) = {
onigenc_not_support_get_ctype_code_range,
gbk_left_adjust_char_head,
gbk_is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_2022_jp.h b/enc/iso_2022_jp.h
index 9240130166..399c2f56a5 100644
--- a/enc/iso_2022_jp.h
+++ b/enc/iso_2022_jp.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, stateful encoding */
+/* dummy for unsupported, statefull 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.h b/enc/iso_8859.h
deleted file mode 100644
index 0ec1468661..0000000000
--- a/enc/iso_8859.h
+++ /dev/null
@@ -1 +0,0 @@
-#define SHARP_s 0xdf
diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c
index 7af0888c3e..088b427d1c 100644
--- a/enc/iso_8859_1.c
+++ b/enc/iso_8859_1.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \
((EncISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
@@ -126,7 +125,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
&& (*(p+1) == 0x53 || *(p+1) == 0x73)) { /* SS */
items[1].byte_len = 2;
items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )SHARP_s;
+ items[1].code[0] = (OnigCodePoint )0xdf;
return 2;
}
else
@@ -140,7 +139,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
&& (*(p+1) == 0x73 || *(p+1) == 0x53)) { /* ss */
items[1].byte_len = 2;
items[1].code_len = 1;
- items[1].code[0] = (OnigCodePoint )SHARP_s;
+ items[1].code[0] = (OnigCodePoint )0xdf;
return 2;
}
else
@@ -153,7 +152,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
return 1;
}
else if (0xd0 <= *p && *p <= 0xdf) {
- if (*p == SHARP_s) {
+ if (*p == 0xdf) {
items[0].byte_len = 1;
items[0].code_len = 2;
items[0].code[0] = (OnigCodePoint )'s';
@@ -207,7 +206,7 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end ARG_UNUS
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -227,7 +226,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -255,49 +254,6 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
return FALSE;
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncISO_8859_1_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code += 0x20;
- }
- else if (code == 0xAA || code == 0xBA || code == 0xB5 || code == 0xFF)
- ;
- else if ((EncISO_8859_1_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-1", /* name */
@@ -315,8 +271,17 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
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 cae4be2db0..ab71a5adcf 100644
--- a/enc/iso_8859_10.c
+++ b/enc/iso_8859_10.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_10_TO_LOWER_CASE(c) EncISO_8859_10_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_10_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -215,61 +214,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if (code == 0xBD || code == 0xFF)
- ;
- else if ((EncISO_8859_10_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_10_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_10_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code >= 0xA0 && code <= 0xBF)
- code -= 0x10;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-10", /* name */
@@ -287,7 +240,6 @@ OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_11.c b/enc/iso_8859_11.c
index 85e8f2cdb4..ec9840e127 100644
--- a/enc/iso_8859_11.c
+++ b/enc/iso_8859_11.c
@@ -93,7 +93,6 @@ OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_single_byte_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_13.c b/enc/iso_8859_13.c
index fe1ddd7065..11b3dda1c9 100644
--- a/enc/iso_8859_13.c
+++ b/enc/iso_8859_13.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -159,10 +158,6 @@ 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 },
@@ -208,63 +203,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncISO_8859_13_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_13_TO_LOWER_CASE(code);
- }
- else if (code == 0xB5)
- ;
- else if ((EncISO_8859_13_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xB8 || code == 0xBA || code == 0xBF) {
- code -= 0x10;
- }
- else {
- code -= 0x20;
- }
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-13", /* name */
@@ -282,8 +229,17 @@ OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-13", "ISO-8859-13")
+
+/*
+ * Name: windows-1257
+ * MIBenum: 2257
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/sbcs/1257.mspx
+ * Link: http://en.wikipedia.org/wiki/Windows-1257
+ */
+ENC_REPLICATE("Windows-1257", "ISO-8859-13")
+ENC_ALIAS("CP1257", "Windows-1257")
diff --git a/enc/iso_8859_14.c b/enc/iso_8859_14.c
index 647514a016..2939e89b7b 100644
--- a/enc/iso_8859_14.c
+++ b/enc/iso_8859_14.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_14_TO_LOWER_CASE(c) EncISO_8859_14_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_14_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -131,7 +130,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -217,70 +216,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- /* else if (code == 0xAA || code == 0xBA) ; */
- else if ((EncISO_8859_14_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_14_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_14_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xA2 || code == 0xA5 || code == 0xB1 || code == 0xB3 || code == 0xB5 || code == 0xBE)
- code -= 0x1;
- else if (code == 0xAB)
- code -= 0x5;
- else if (code == 0xFF)
- code -= 0x50;
- else if (code == 0xB9)
- code -= 0x2;
- else if (code == 0xBF)
- code -= 0x4;
- else if (code == 0xB8 || code == 0xBA || code == 0xBC)
- code -= 0x10;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-14", /* name */
@@ -298,7 +242,6 @@ OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_15.c b/enc/iso_8859_15.c
index 377a3afc7b..fdb7ca12d7 100644
--- a/enc/iso_8859_15.c
+++ b/enc/iso_8859_15.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_15_TO_LOWER_CASE(c) EncISO_8859_15_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_15_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -131,7 +130,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -211,67 +210,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if (code == 0xAA || code == 0xBA || code == 0xB5)
- ;
- else if ((EncISO_8859_15_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_15_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_15_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xA8)
- code -= 2;
- else if (code == 0xB8)
- code -= 4;
- else if (code == 0xBD)
- code -= 1;
- else if (code == 0xFF)
- code -= 0x41;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-15", /* name */
@@ -289,7 +236,6 @@ OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c
index 135630eb73..5e53f3b6d0 100644
--- a/enc/iso_8859_16.c
+++ b/enc/iso_8859_16.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_16_TO_LOWER_CASE(c) EncISO_8859_16_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_16_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -213,69 +212,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncISO_8859_16_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_16_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_16_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags&ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xA2 || code == 0xBD)
- code--;
- else if (code == 0xB3 || code == 0xBA || code == 0xBF)
- code -= 0x10;
- else if (code == 0xA8 || code == 0xAE)
- code -= 0x02;
- else if (code == 0xB9)
- code -= 0x07;
- else if (code == 0xB8)
- code -= 0x04;
- else if (code == 0xFF)
- code -= 0x41;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-16", /* name */
@@ -293,7 +238,6 @@ OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_2.c b/enc/iso_8859_2.c
index 3a05c6320d..94613e661b 100644
--- a/enc/iso_8859_2.c
+++ b/enc/iso_8859_2.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -220,53 +219,6 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
return FALSE;
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncISO_8859_2_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_2_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_2_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- if (code >= 0xB1 && code <= 0xBF) {
- flags |= ONIGENC_CASE_MODIFIED;
- code -= 0x10;
- }
- else {
- flags |= ONIGENC_CASE_MODIFIED;
- code -= 0x20;
- }
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-2", /* name */
@@ -284,8 +236,17 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
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 2a343eac63..863a575020 100644
--- a/enc/iso_8859_3.c
+++ b/enc/iso_8859_3.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_3_TO_LOWER_CASE(c) EncISO_8859_3_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_3_CTYPE(code,ctype) \
@@ -56,7 +55,7 @@ static const UChar EncISO_8859_3_ToLowerCaseTable[256] = {
'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
'\240', '\261', '\242', '\243', '\244', '\245', '\266', '\247',
- '\250', '\151', '\272', '\273', '\274', '\255', '\256', '\277',
+ '\250', '\271', '\272', '\273', '\274', '\255', '\256', '\277',
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
'\340', '\341', '\342', '\303', '\344', '\345', '\346', '\347',
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -161,7 +160,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
static const OnigPairCaseFoldCodes CaseFoldMap[] = {
{ 0xa1, 0xb1 },
{ 0xa6, 0xb6 },
- /*{ 0xa9, 0xb9 }, exclude dotless i/I with dot; not a case pair */
+ { 0xa9, 0xb9 },
{ 0xaa, 0xba },
{ 0xab, 0xbb },
{ 0xac, 0xbc },
@@ -220,63 +219,6 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-#define DOTLESS_i (0xB9)
-#define I_WITH_DOT_ABOVE (0xA9)
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if (code == 0xB5)
- ;
- else if ((EncISO_8859_3_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'I')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i';
- else
- code = ENC_ISO_8859_3_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_3_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'i')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I';
- else if (code == DOTLESS_i)
- code = 'I';
- else if (code >= 0xB0 && code <= 0xBF) {
- code -= 0x10;
- }
- else {
- code -= 0x20;
- }
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-3", /* name */
@@ -294,7 +236,6 @@ OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_4.c b/enc/iso_8859_4.c
index e2134e8c0b..48b999e756 100644
--- a/enc/iso_8859_4.c
+++ b/enc/iso_8859_4.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_4_TO_LOWER_CASE(c) EncISO_8859_4_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_4_CTYPE(code,ctype) \
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -167,7 +166,6 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
{ 0xab, 0xbb },
{ 0xac, 0xbc },
{ 0xae, 0xbe },
- { 0xbd, 0xbf },
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
@@ -223,56 +221,6 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncISO_8859_4_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_4_TO_LOWER_CASE(code);
- }
- else if (code == 0xA2)
- ;
- else if ((EncISO_8859_4_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code >= 0xA0 && code <= 0xBF) {
- if (code == 0xBF)
- code -= 0x02;
- else
- code -= 0x10;
- }
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-4", /* name */
@@ -290,7 +238,6 @@ OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_5.c b/enc/iso_8859_5.c
index 6fafc35823..e71a488c4c 100644
--- a/enc/iso_8859_5.c
+++ b/enc/iso_8859_5.c
@@ -209,38 +209,6 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if ((EncISO_8859_5_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_5_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_5_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (0xF1 <= code && code <= 0xFF)
- code -= 0x50;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-5", /* name */
@@ -258,7 +226,6 @@ OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_6.c b/enc/iso_8859_6.c
index 6d852ac8c0..638a181dc2 100644
--- a/enc/iso_8859_6.c
+++ b/enc/iso_8859_6.c
@@ -93,7 +93,6 @@ OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_single_byte_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_7.c b/enc/iso_8859_7.c
index ac973f74ba..8d07cb6310 100644
--- a/enc/iso_8859_7.c
+++ b/enc/iso_8859_7.c
@@ -205,60 +205,6 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == 0xF2) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xD3;
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xF3;
- }
- }
- else if ((EncISO_8859_7_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_ISO_8859_7_TO_LOWER_CASE(code);
- }
- else if (code == 0xC0 || code == 0xE0)
- ;
- else if ((EncISO_8859_7_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xDC) {
- code -= 0x26;
- }
- else if (code >= 0xDD && code <= 0xDF) {
- code -= 0x25;
- }
- else if (code == 0xFC) {
- code -= 0x40;
- }
- else if (code == 0xFD || code == 0xFE) {
- code -= 0x3F;
- }
- else {
- code -= 0x20;
- }
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_single_byte_mbc_enc_len,
@@ -277,8 +223,17 @@ OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-7", "ISO-8859-7")
+
+/*
+ * Name: windows-1253
+ * MIBenum: 2253
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/sbcs/1253.mspx
+ * Link: http://en.wikipedia.org/wiki/Windows-1253
+ */
+ENC_REPLICATE("Windows-1253", "ISO-8859-7")
+ENC_ALIAS("CP1253", "Windows-1253")
diff --git a/enc/iso_8859_8.c b/enc/iso_8859_8.c
index 0a7a29e82e..87a6e7bc9b 100644
--- a/enc/iso_8859_8.c
+++ b/enc/iso_8859_8.c
@@ -93,7 +93,6 @@ OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_single_byte_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/iso_8859_9.c b/enc/iso_8859_9.c
index 004eec310f..211ba3b2f3 100644
--- a/enc/iso_8859_9.c
+++ b/enc/iso_8859_9.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c]
#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \
@@ -62,7 +61,7 @@ static const UChar EncISO_8859_9_ToLowerCaseTable[256] = {
'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327',
- '\370', '\371', '\372', '\373', '\374', '\151', '\376', '\337',
+ '\370', '\371', '\372', '\373', '\374', '\335', '\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',
@@ -111,7 +110,7 @@ mbc_case_fold(OnigCaseFoldType flag,
{
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
*lower++ = 's';
*lower = 's';
(*pp)++;
@@ -130,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
int v;
const UChar* p = *pp;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
(*pp)++;
return TRUE;
}
@@ -188,7 +187,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
{ 0xda, 0xfa },
{ 0xdb, 0xfb },
{ 0xdc, 0xfc },
- /*{ 0xdd, 0xfd }, exclude dotless i/I with dot; not a case pair */
+ { 0xdd, 0xfd },
{ 0xde, 0xfe }
};
@@ -204,68 +203,15 @@ apply_all_case_fold(OnigCaseFoldType flag,
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[],
- OnigEncoding enc ARG_UNUSED)
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[],
+ OnigEncoding enc ARG_UNUSED)
{
return onigenc_get_case_fold_codes_by_str_with_map(
numberof(CaseFoldMap), CaseFoldMap, 1,
flag, p, end, items);
}
-#define DOTLESS_i (0xFD)
-#define I_WITH_DOT_ABOVE (0xDD)
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if (code == 0xAA || code == 0xB5 || code == 0xBA || code == 0xFF)
- ;
- else if ((EncISO_8859_9_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'I')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i';
- else
- code = ENC_ISO_8859_9_TO_LOWER_CASE(code);
- }
- else if ((EncISO_8859_9_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'i')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I';
- else if (code == DOTLESS_i)
- code = 'I';
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-9", /* name */
@@ -283,8 +229,17 @@ OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ISO8859-9", "ISO-8859-9")
+
+/*
+ * Name: windows-1254
+ * MIBenum: 2254
+ * Link: http://www.iana.org/assignments/character-sets
+ * Link: http://www.microsoft.com/globaldev/reference/sbcs/1254.mspx
+ * Link: http://en.wikipedia.org/wiki/Windows-1254
+ */
+ENC_REPLICATE("Windows-1254", "ISO-8859-9")
+ENC_ALIAS("CP1254", "Windows-1254")
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
index 54aa94f8bc..4ae2e1fd23 100644
--- a/enc/jis/props.h.blt
+++ b/enc/jis/props.h.blt
@@ -1,4 +1,4 @@
-/* ANSI-C code produced by gperf version 3.1 */
+/* 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) \
@@ -25,21 +25,20 @@
&& ('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-gperf@gnu.org>."
+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)
#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, size_t n)
+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, (int)n);
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
}
enum onigenc_jis_ctype {
@@ -69,7 +68,7 @@ struct enc_property {
unsigned char ctype;
};
-static const struct enc_property *onig_jis_property(/*const char *str, unsigned int len*/);
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
#line 43 "enc/jis/props.kwd"
struct enc_property;
@@ -108,7 +107,10 @@ static unsigned char gperf_downcase[256] =
#ifndef GPERF_CASE_STRNCMP
#define GPERF_CASE_STRNCMP 1
static int
-gperf_case_strncmp (register const char *s1, register const char *s2, register size_t n)
+gperf_case_strncmp (s1, s2, n)
+ register const char *s1;
+ register const char *s2;
+ register unsigned int n;
{
for (; n > 0;)
{
@@ -125,15 +127,15 @@ gperf_case_strncmp (register const char *s1, register const char *s2, register s
}
#endif
-#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
-onig_jis_property_hash (register const char *str, register size_t len)
+onig_jis_property_hash (str, len)
+ register const char *str;
+ register unsigned int len;
{
static const unsigned char asso_values[] =
{
@@ -151,7 +153,7 @@ onig_jis_property_hash (register const char *str, register size_t len)
1, 13, 13, 13, 1, 13, 1, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13
};
- return (unsigned int)len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
+ return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
}
struct onig_jis_property_pool_t
@@ -173,33 +175,41 @@ static const struct onig_jis_property_pool_t onig_jis_property_pool_contents =
"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 (register const char *str, register size_t len)
+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"
- {gperf_offsetof(onig_jis_property_pool, 5), onigenc_jis_han},
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han},
{-1},
#line 49 "enc/jis/props.kwd"
- {gperf_offsetof(onig_jis_property_pool, 7), onigenc_jis_latin},
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin},
#line 50 "enc/jis/props.kwd"
- {gperf_offsetof(onig_jis_property_pool, 8), onigenc_jis_greek},
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek},
{-1},
#line 46 "enc/jis/props.kwd"
- {gperf_offsetof(onig_jis_property_pool, 10), onigenc_jis_hiragana},
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana},
#line 47 "enc/jis/props.kwd"
- {gperf_offsetof(onig_jis_property_pool, 11), onigenc_jis_katakana},
+ {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana},
#line 51 "enc/jis/props.kwd"
- {gperf_offsetof(onig_jis_property_pool, 12), onigenc_jis_cyrillic}
+ {(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 unsigned int key = onig_jis_property_hash (str, len);
+ register int key = onig_jis_property_hash (str, len);
- if (key <= MAX_HASH_VALUE)
+ if (key <= MAX_HASH_VALUE && key >= 0)
{
register int o = wordlist[key].name;
if (o >= 0)
diff --git a/enc/jis/props.kwd b/enc/jis/props.kwd
index 659cf0aff4..f3235c0100 100644
--- a/enc/jis/props.kwd
+++ b/enc/jis/props.kwd
@@ -3,11 +3,11 @@
#define GPERF_CASE_STRNCMP 1
static inline int
-gperf_case_strncmp(const char *s1, const char *s2, size_t n)
+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, (int)n);
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
}
enum onigenc_jis_ctype {
@@ -37,7 +37,7 @@ struct enc_property {
unsigned char ctype;
};
-static const struct enc_property *onig_jis_property(/*!ANSI{*/const char *str, unsigned int len/*}!ANSI*/);
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
%}
struct enc_property;
diff --git a/enc/jis/props.src b/enc/jis/props.src
index 659cf0aff4..f3235c0100 100644
--- a/enc/jis/props.src
+++ b/enc/jis/props.src
@@ -3,11 +3,11 @@
#define GPERF_CASE_STRNCMP 1
static inline int
-gperf_case_strncmp(const char *s1, const char *s2, size_t n)
+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, (int)n);
+ return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, n);
}
enum onigenc_jis_ctype {
@@ -37,7 +37,7 @@ struct enc_property {
unsigned char ctype;
};
-static const struct enc_property *onig_jis_property(/*!ANSI{*/const char *str, unsigned int len/*}!ANSI*/);
+static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
%}
struct enc_property;
diff --git a/enc/koi8_r.c b/enc/koi8_r.c
index a520975774..85fa72287e 100644
--- a/enc/koi8_r.c
+++ b/enc/koi8_r.c
@@ -214,8 +214,8 @@ OnigEncodingDefine(koi8_r, KOI8_R) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_single_byte_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("CP878", "KOI8-R")
+
diff --git a/enc/koi8_u.c b/enc/koi8_u.c
index 50bb78bd04..0ae449ca21 100644
--- a/enc/koi8_u.c
+++ b/enc/koi8_u.c
@@ -218,7 +218,6 @@ OnigEncodingDefine(koi8_u, KOI8_U) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_single_byte_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index 4ab85f36e3..b917eca0bd 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -9,15 +9,12 @@ 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?
@@ -34,12 +31,6 @@ 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$/
@@ -52,7 +43,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", "encinit.c"]
+ encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS - ["mktable.c"]
encs.each {|e| e.chomp!(".c")}
encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty?
encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
@@ -60,7 +51,7 @@ def target_encodings
deps = Hash.new {[]}
inc_srcs = Hash.new {[]}
default_deps = %w[regenc.h oniguruma.h config.h defines.h]
- encs.delete(db = "encdb")
+ db = encs.delete("encdb")
encs.each do |e|
File.foreach("#$srcdir/#{e}.c") do |l|
if /^\s*#\s*include\s+(?:"([^\"]+)"|<(ruby\/\sw+.h)>)/ =~ l
@@ -100,14 +91,9 @@ 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.delete(db = "transdb")
- trans.unshift(db)
+ trans.unshift(trans.delete("transdb"))
trans.compact!
trans |= atrans
trans.map! {|e| "trans/#{e}"}
@@ -134,9 +120,8 @@ open(ARGV[0], 'wb') {|f|
f.puts mkin, dep
}
if MODULE_TYPE == :static
- filename = "encinit.c.erb"
- erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
- erb.filename = "enc/#{filename}"
+ erb = ERB.new(File.read(File.join($srcdir, "encinit.c.erb")), nil, '%-')
+ erb.filename = "enc/encinit.c.cerb"
tmp = erb.result(binding)
begin
Dir.mkdir 'enc'
diff --git a/enc/mktable.c b/enc/mktable.c
index 4edd5a0ff7..49acf628d0 100644
--- a/enc/mktable.c
+++ b/enc/mktable.c
@@ -2,7 +2,7 @@
mktable.c
**********************************************************************/
/*-
- * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,10 +31,7 @@
#include <stdio.h>
#include <locale.h>
-#ifndef __USE_ISOC99
#define __USE_ISOC99
-#endif
-
#include <ctype.h>
#include "regenc.h"
@@ -1111,13 +1108,11 @@ static int exec(FILE* fp, ENC_INFO* einfo)
#define NCOL 8
int c, val, enc;
- int r;
enc = einfo->num;
- r = fprintf(fp, "static const unsigned short Enc%s_CtypeTable[256] = {\n",
- einfo->name);
- if (r < 0) return -1;
+ fprintf(fp, "static const unsigned short Enc%s_CtypeTable[256] = {\n",
+ einfo->name);
for (c = 0; c < 256; c++) {
val = 0;
@@ -1136,33 +1131,20 @@ static int exec(FILE* fp, ENC_INFO* einfo)
if (IsWord (enc, c)) val |= BIT_CTYPE_WORD;
if (IsAscii (enc, c)) val |= BIT_CTYPE_ASCII;
- if (c % NCOL == 0) {
- r = fputs(" ", fp);
- if (r < 0) return -1;
- }
- r = fprintf(fp, "0x%04x", val);
- if (r < 0) return -1;
-
- if (c != 255) {
- r = fputs(",", fp);
- if (r < 0) return -1;
- }
+ if (c % NCOL == 0) fputs(" ", fp);
+ fprintf(fp, "0x%04x", val);
+ if (c != 255) fputs(",", fp);
if (c != 0 && c % NCOL == (NCOL-1))
- r = fputs("\n", fp);
+ fputs("\n", fp);
else
- r = fputs(" ", fp);
-
- if (r < 0) return -1;
+ fputs(" ", fp);
}
- r = fprintf(fp, "};\n");
- if (r < 0) return -1;
-
+ fprintf(fp, "};\n");
return 0;
}
extern int main(int argc ARG_UNUSED, char* argv[] ARG_UNUSED)
{
- int r;
int i;
FILE* fp = stdout;
@@ -1173,11 +1155,7 @@ extern int main(int argc ARG_UNUSED, char* argv[] ARG_UNUSED)
/* setlocale(LC_ALL, "fr_FR.iso88591"); */
for (i = 0; i < (int )(sizeof(Info)/sizeof(ENC_INFO)); i++) {
- r = exec(fp, &Info[i]);
- if (r < 0) {
- fprintf(stderr, "FAIL exec(): %d\n", r);
- return -1;
- }
+ exec(fp, &Info[i]);
}
return 0;
diff --git a/enc/prelude.rb b/enc/prelude.rb
new file mode 100644
index 0000000000..8ce59f957a
--- /dev/null
+++ b/enc/prelude.rb
@@ -0,0 +1,6 @@
+%w'enc/encdb.so enc/trans/transdb.so'.each do |init|
+ begin
+ require(init)
+ rescue LoadError
+ end
+end
diff --git a/enc/shift_jis.c b/enc/shift_jis.c
index 65fd5102de..cbd3f02051 100644
--- a/enc/shift_jis.c
+++ b/enc/shift_jis.c
@@ -1,9 +1,9 @@
/**********************************************************************
- shift_jis.c - Onigmo (Oniguruma-mod) (regular expression library)
+ sjis.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,524 @@
* SUCH DAMAGE.
*/
-#include "shift_jis.h"
+#include "regint.h"
+static const int EncLen_SJIS[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 2, 2, 2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 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
+};
+
+static const OnigPairCaseFoldCodes CaseFoldMap[] = {
+ /* Fullwidth Alphabet */
+ { 0x8260, 0x8281 },
+ { 0x8261, 0x8282 },
+ { 0x8262, 0x8283 },
+ { 0x8263, 0x8284 },
+ { 0x8264, 0x8285 },
+ { 0x8265, 0x8286 },
+ { 0x8266, 0x8287 },
+ { 0x8267, 0x8288 },
+ { 0x8268, 0x8289 },
+ { 0x8269, 0x828a },
+ { 0x826a, 0x828b },
+ { 0x826b, 0x828c },
+ { 0x826c, 0x828d },
+ { 0x826d, 0x828e },
+ { 0x826e, 0x828f },
+ { 0x826f, 0x8290 },
+ { 0x8270, 0x8291 },
+ { 0x8271, 0x8292 },
+ { 0x8272, 0x8293 },
+ { 0x8273, 0x8294 },
+ { 0x8274, 0x8295 },
+ { 0x8275, 0x8296 },
+ { 0x8276, 0x8297 },
+ { 0x8277, 0x8298 },
+ { 0x8278, 0x8299 },
+ { 0x8279, 0x829a },
+
+ /* Greek */
+ { 0x839f, 0x83bf },
+ { 0x83a0, 0x83c0 },
+ { 0x83a1, 0x83c1 },
+ { 0x83a2, 0x83c2 },
+ { 0x83a3, 0x83c3 },
+ { 0x83a4, 0x83c4 },
+ { 0x83a5, 0x83c5 },
+ { 0x83a6, 0x83c6 },
+ { 0x83a7, 0x83c7 },
+ { 0x83a8, 0x83c8 },
+ { 0x83a9, 0x83c9 },
+ { 0x83aa, 0x83ca },
+ { 0x83ab, 0x83cb },
+ { 0x83ac, 0x83cc },
+ { 0x83ad, 0x83cd },
+ { 0x83ae, 0x83ce },
+ { 0x83af, 0x83cf },
+ { 0x83b0, 0x83d0 },
+ { 0x83b1, 0x83d1 },
+ { 0x83b2, 0x83d2 },
+ { 0x83b3, 0x83d3 },
+ { 0x83b4, 0x83d4 },
+ { 0x83b5, 0x83d5 },
+ { 0x83b6, 0x83d6 },
+
+ /* Cyrillic */
+ { 0x8440, 0x8470 },
+ { 0x8441, 0x8471 },
+ { 0x8442, 0x8472 },
+ { 0x8443, 0x8473 },
+ { 0x8444, 0x8474 },
+ { 0x8445, 0x8475 },
+ { 0x8446, 0x8476 },
+ { 0x8447, 0x8477 },
+ { 0x8448, 0x8478 },
+ { 0x8449, 0x8479 },
+ { 0x844a, 0x847a },
+ { 0x844b, 0x847b },
+ { 0x844c, 0x847c },
+ { 0x844d, 0x847d },
+ { 0x844e, 0x847e },
+ { 0x844f, 0x8480 },
+ { 0x8450, 0x8481 },
+ { 0x8451, 0x8482 },
+ { 0x8452, 0x8483 },
+ { 0x8453, 0x8484 },
+ { 0x8454, 0x8485 },
+ { 0x8455, 0x8486 },
+ { 0x8456, 0x8487 },
+ { 0x8457, 0x8488 },
+ { 0x8458, 0x8489 },
+ { 0x8459, 0x848a },
+ { 0x845a, 0x848b },
+ { 0x845b, 0x848c },
+ { 0x845c, 0x848d },
+ { 0x845d, 0x848e },
+ { 0x845e, 0x848f },
+ { 0x845f, 0x8490 },
+ { 0x8460, 0x8491 },
+};
+
+#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1)
+#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
+
+typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1 } state_t;
+#define A ACCEPT
+#define F FAILURE
+static const signed char trans[][0x100] = {
+ { /* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+ /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F, F, F
+ },
+ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
+ /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+ /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+ /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+ /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+ /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F,
+ /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
+ /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, F, F, F
+ }
+};
+#undef A
+#undef F
+
+static int
+mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
+{
+ int firstbyte = *p++;
+ state_t s;
+ s = trans[0][firstbyte];
+ if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) :
+ ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+ if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_SJIS[firstbyte]-1);
+ s = trans[s][*p++];
+ return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
+ ONIGENC_CONSTRUCT_MBCLEN_INVALID();
+}
+
+static int
+code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
+{
+ if (code < 256) {
+ if (EncLen_SJIS[(int )code] == 1)
+ return 1;
+ else
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
+ }
+ else if (code <= 0xffff) {
+ int low = code & 0xff;
+ if (! SJIS_ISMB_TRAIL(low))
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
+ return 2;
+ }
+ else
+ return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
+}
+
+static OnigCodePoint
+mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
+{
+ int c, i, len;
+ OnigCodePoint n;
+
+ len = mbc_enc_len(p, end, enc);
+ c = *p++;
+ n = c;
+ if (len == 1) return n;
+
+ for (i = 1; i < len; i++) {
+ if (p >= end) break;
+ c = *p++;
+ n <<= 8; n += c;
+ }
+ return n;
+}
+
+static int
+code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
+{
+ UChar *p = buf;
+
+ if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
+ *p++ = (UChar )(code & 0xff);
+
+#if 0
+ if (mbc_enc_len(buf, p, enc) != (p - buf))
+ return REGERR_INVALID_CODE_POINT_VALUE;
+#endif
+ return (int )(p - buf);
+}
+
+static int
+apply_all_case_fold(OnigCaseFoldType flag,
+ OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc)
+{
+ return onigenc_apply_all_case_fold_with_map(
+ numberof(CaseFoldMap), CaseFoldMap, 0,
+ flag, f, arg);
+}
+
+static OnigCodePoint
+get_lower_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0x8260, 0x8279)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code + 0x0021);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x839f, 0x83b6)) {
+ /* Greek */
+ return (OnigCodePoint )(code + 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x8440, 0x8460)) {
+ /* Cyrillic */
+ int d = (code >= 0x844f) ? 1 : 0;
+ return (OnigCodePoint )(code + (0x0030 + d));
+ }
+ return code;
+}
+
+static OnigCodePoint
+get_upper_case(OnigCodePoint code)
+{
+ if (ONIGENC_IS_IN_RANGE(code, 0x8281, 0x829a)) {
+ /* Fullwidth Alphabet */
+ return (OnigCodePoint )(code - 0x0021);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x83bf, 0x83d6)) {
+ /* Greek */
+ return (OnigCodePoint )(code - 0x0020);
+ }
+ else if (ONIGENC_IS_IN_RANGE(code, 0x8470, 0x847e) ||
+ ONIGENC_IS_IN_RANGE(code, 0x8480, 0x8491)) {
+ /* Cyrillic */
+ int d = (code >= 0x8480) ? 1 : 0;
+ return (OnigCodePoint )(code - (0x0030 - d));
+ }
+ return code;
+}
+
+static int
+get_case_fold_codes_by_str(OnigCaseFoldType flag,
+ const OnigUChar* p, const OnigUChar* end,
+ OnigCaseFoldCodeItem items[], OnigEncoding enc)
+{
+ int len;
+ OnigCodePoint code, code_lo, code_up;
+
+ code = mbc_to_code(p, end, enc);
+ if (ONIGENC_IS_ASCII_CODE(code))
+ return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc);
+
+ len = mbc_enc_len(p, end, enc);
+ code_lo = get_lower_case(code);
+ code_up = get_upper_case(code);
+
+ if (code != code_lo) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_lo;
+ return 1;
+ }
+ else if (code != code_up) {
+ items[0].byte_len = len;
+ items[0].code_len = 1;
+ items[0].code[0] = code_up;
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+mbc_case_fold(OnigCaseFoldType flag,
+ const UChar** pp, const UChar* end, UChar* lower,
+ OnigEncoding enc)
+{
+ const UChar* p = *pp;
+
+ if (ONIGENC_IS_MBC_ASCII(p)) {
+ *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
+ (*pp)++;
+ return 1;
+ }
+ else {
+ OnigCodePoint code;
+ int len;
+
+ code = get_lower_case(mbc_to_code(p, end, enc));
+ len = code_to_mbc(code, lower, enc);
+ (*pp) += len;
+ return len; /* return byte length of converted char to lower */
+ }
+}
+
+#if 0
+static int
+is_mbc_ambiguous(OnigCaseFoldType flag,
+ const UChar** pp, const UChar* end)
+{
+ return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
+
+}
+#endif
+
+#if 0
+static int
+is_code_ctype(OnigCodePoint code, unsigned int ctype)
+{
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
+ return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
+ }
+ }
+
+ return FALSE;
+}
+#endif
+
+static UChar*
+left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
+{
+ const UChar *p;
+ int len;
+
+ if (s <= start) return (UChar* )s;
+ p = s;
+
+ if (SJIS_ISMB_TRAIL(*p)) {
+ while (p > start) {
+ if (! SJIS_ISMB_FIRST(*--p)) {
+ p++;
+ break;
+ }
+ }
+ }
+ len = mbc_enc_len(p, end, enc);
+ if (p + len > s) return (UChar* )p;
+ p += len;
+ return (UChar* )(p + ((s - p) & ~1));
+}
+
+static int
+is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc ARG_UNUSED)
+{
+ const UChar c = *s;
+ return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);
+}
+
+
+static const OnigCodePoint CR_Hiragana[] = {
+ 1,
+ 0x829f, 0x82f1
+}; /* CR_Hiragana */
+
+static const OnigCodePoint CR_Katakana[] = {
+ 4,
+ 0x00a6, 0x00af,
+ 0x00b1, 0x00dd,
+ 0x8340, 0x837e,
+ 0x8380, 0x8396,
+}; /* CR_Katakana */
+
+#ifdef ENC_CP932
+static const OnigCodePoint CR_Han[] = {
+ 6,
+ 0x8157, 0x8157,
+ 0x889f, 0x9872, /* Kanji level 1 */
+ 0x989f, 0x9ffc, /* Kanji level 2 */
+ 0xe040, 0xeaa4, /* Kanji level 2 */
+ 0xed40, 0xeeec, /* NEC-selected IBM extended characters (without symbols) */
+ 0xfa5c, 0xfc4b, /* IBM extended characters (without symbols) */
+}; /* CR_Han */
+#else
+static const OnigCodePoint CR_Han[] = {
+ 4,
+ 0x8157, 0x8157,
+ 0x889f, 0x9872, /* Kanji level 1 */
+ 0x989f, 0x9ffc, /* Kanji level 2 */
+ 0xe040, 0xeaa4, /* Kanji level 2 */
+}; /* CR_Han */
+#endif
+
+static const OnigCodePoint CR_Latin[] = {
+ 4,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x8260, 0x8279,
+ 0x8281, 0x829a,
+}; /* CR_Latin */
+
+static const OnigCodePoint CR_Greek[] = {
+ 2,
+ 0x839f, 0x83b6,
+ 0x83bf, 0x83d6,
+}; /* CR_Greek */
+
+static const OnigCodePoint CR_Cyrillic[] = {
+ 3,
+ 0x8440, 0x8460,
+ 0x8470, 0x847f,
+ 0x8480, 0x8491,
+}; /* CR_Cyrillic */
+
+#include "enc/jis/props.h"
+
+static int
+property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+{
+ UChar *s = p, *e = end;
+ const struct enc_property *prop =
+ onig_jis_property((const char* )s, (unsigned int )(e - s));
+
+ if (!prop) {
+ return onigenc_minimum_property_name_to_ctype(enc, s, e);
+ }
+
+ return (int )prop->ctype;
+}
+
+static int
+is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
+{
+ if (ctype <= ONIGENC_MAX_STD_CTYPE) {
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
+ return TRUE;
+ }
+ }
+ }
+ else {
+ ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
+ if (ctype >= (unsigned int )PropertyListNum)
+ return ONIGERR_TYPE_BUG;
+
+ return onig_is_in_code_range((UChar* )PropertyList[ctype], code);
+ }
+
+ return FALSE;
+}
+
+static int
+get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
+ const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
+{
+ if (ctype <= ONIGENC_MAX_STD_CTYPE) {
+ return ONIG_NO_SUPPORT_CONFIG;
+ }
+ else {
+ *sb_out = 0x80;
+
+ ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
+ if (ctype >= (OnigCtype )PropertyListNum)
+ return ONIGERR_TYPE_BUG;
+
+ *ranges = PropertyList[ctype];
+ return 0;
+ }
+}
+
+#ifndef ENC_CP932
OnigEncodingDefine(shift_jis, Shift_JIS) = {
mbc_enc_len,
"Shift_JIS", /* name */
@@ -47,7 +563,6 @@ OnigEncodingDefine(shift_jis, Shift_JIS) = {
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
@@ -65,3 +580,4 @@ OnigEncodingDefine(shift_jis, Shift_JIS) = {
*/
ENC_REPLICATE("MacJapanese", "Shift_JIS")
ENC_ALIAS("MacJapan", "MacJapanese")
+#endif
diff --git a/enc/shift_jis.h b/enc/shift_jis.h
deleted file mode 100644
index d552401595..0000000000
--- a/enc/shift_jis.h
+++ /dev/null
@@ -1,546 +0,0 @@
-/**********************************************************************
- shift_jis.h - Onigmo (Oniguruma-mod) (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * 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"
-
-static const int EncLen_SJIS[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1
-};
-
-static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
-};
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- /* Fullwidth Alphabet */
- { 0x8260, 0x8281 },
- { 0x8261, 0x8282 },
- { 0x8262, 0x8283 },
- { 0x8263, 0x8284 },
- { 0x8264, 0x8285 },
- { 0x8265, 0x8286 },
- { 0x8266, 0x8287 },
- { 0x8267, 0x8288 },
- { 0x8268, 0x8289 },
- { 0x8269, 0x828a },
- { 0x826a, 0x828b },
- { 0x826b, 0x828c },
- { 0x826c, 0x828d },
- { 0x826d, 0x828e },
- { 0x826e, 0x828f },
- { 0x826f, 0x8290 },
- { 0x8270, 0x8291 },
- { 0x8271, 0x8292 },
- { 0x8272, 0x8293 },
- { 0x8273, 0x8294 },
- { 0x8274, 0x8295 },
- { 0x8275, 0x8296 },
- { 0x8276, 0x8297 },
- { 0x8277, 0x8298 },
- { 0x8278, 0x8299 },
- { 0x8279, 0x829a },
-
- /* Greek */
- { 0x839f, 0x83bf },
- { 0x83a0, 0x83c0 },
- { 0x83a1, 0x83c1 },
- { 0x83a2, 0x83c2 },
- { 0x83a3, 0x83c3 },
- { 0x83a4, 0x83c4 },
- { 0x83a5, 0x83c5 },
- { 0x83a6, 0x83c6 },
- { 0x83a7, 0x83c7 },
- { 0x83a8, 0x83c8 },
- { 0x83a9, 0x83c9 },
- { 0x83aa, 0x83ca },
- { 0x83ab, 0x83cb },
- { 0x83ac, 0x83cc },
- { 0x83ad, 0x83cd },
- { 0x83ae, 0x83ce },
- { 0x83af, 0x83cf },
- { 0x83b0, 0x83d0 },
- { 0x83b1, 0x83d1 },
- { 0x83b2, 0x83d2 },
- { 0x83b3, 0x83d3 },
- { 0x83b4, 0x83d4 },
- { 0x83b5, 0x83d5 },
- { 0x83b6, 0x83d6 },
-
- /* Cyrillic */
- { 0x8440, 0x8470 },
- { 0x8441, 0x8471 },
- { 0x8442, 0x8472 },
- { 0x8443, 0x8473 },
- { 0x8444, 0x8474 },
- { 0x8445, 0x8475 },
- { 0x8446, 0x8476 },
- { 0x8447, 0x8477 },
- { 0x8448, 0x8478 },
- { 0x8449, 0x8479 },
- { 0x844a, 0x847a },
- { 0x844b, 0x847b },
- { 0x844c, 0x847c },
- { 0x844d, 0x847d },
- { 0x844e, 0x847e },
- { 0x844f, 0x8480 },
- { 0x8450, 0x8481 },
- { 0x8451, 0x8482 },
- { 0x8452, 0x8483 },
- { 0x8453, 0x8484 },
- { 0x8454, 0x8485 },
- { 0x8455, 0x8486 },
- { 0x8456, 0x8487 },
- { 0x8457, 0x8488 },
- { 0x8458, 0x8489 },
- { 0x8459, 0x848a },
- { 0x845a, 0x848b },
- { 0x845b, 0x848c },
- { 0x845c, 0x848d },
- { 0x845d, 0x848e },
- { 0x845e, 0x848f },
- { 0x845f, 0x8490 },
- { 0x8460, 0x8491 },
-};
-
-#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1)
-#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
-
-typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1 } state_t;
-#define A ACCEPT
-#define F FAILURE
-static const signed char trans[][0x100] = {
- { /* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 8 */ F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* 9 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* a */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F, F, F
- },
- { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 1 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 2 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 3 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 6 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 7 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F,
- /* 8 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* 9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* a */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* b */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
- /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, F, F, F
- }
-};
-#undef A
-#undef F
-
-static int
-mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc ARG_UNUSED)
-{
- int firstbyte = *p++;
- state_t s;
- s = trans[0][firstbyte];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(1) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(EncLen_SJIS[firstbyte]-1);
- s = trans[s][*p++];
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static int
-code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256) {
- if (EncLen_SJIS[(int )code] == 1)
- return 1;
- else
- return ONIGERR_INVALID_CODE_POINT_VALUE;
- }
- else if (code <= 0xffff) {
- int low = code & 0xff;
- if (! SJIS_ISMB_TRAIL(low))
- return ONIGERR_INVALID_CODE_POINT_VALUE;
- return 2;
- }
- else
- return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
-}
-
-static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int c, i, len;
- OnigCodePoint n;
-
- len = mbc_enc_len(p, end, enc);
- c = *p++;
- n = c;
- if (len == 1) return n;
-
- for (i = 1; i < len; i++) {
- if (p >= end) break;
- c = *p++;
- n <<= 8; n += c;
- }
- return n;
-}
-
-static int
-code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
-{
- UChar *p = buf;
-
- if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
- *p++ = (UChar )(code & 0xff);
-
-#if 0
- if (mbc_enc_len(buf, p, enc) != (p - buf))
- return REGERR_INVALID_CODE_POINT_VALUE;
-#endif
- return (int )(p - buf);
-}
-
-static int
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc)
-{
- return onigenc_apply_all_case_fold_with_map(
- numberof(CaseFoldMap), CaseFoldMap, 0,
- flag, f, arg);
-}
-
-static OnigCodePoint
-get_lower_case(OnigCodePoint code)
-{
- if (ONIGENC_IS_IN_RANGE(code, 0x8260, 0x8279)) {
- /* Fullwidth Alphabet */
- return (OnigCodePoint )(code + 0x0021);
- }
- else if (ONIGENC_IS_IN_RANGE(code, 0x839f, 0x83b6)) {
- /* Greek */
- return (OnigCodePoint )(code + 0x0020);
- }
- else if (ONIGENC_IS_IN_RANGE(code, 0x8440, 0x8460)) {
- /* Cyrillic */
- int d = (code >= 0x844f) ? 1 : 0;
- return (OnigCodePoint )(code + (0x0030 + d));
- }
- return code;
-}
-
-static OnigCodePoint
-get_upper_case(OnigCodePoint code)
-{
- if (ONIGENC_IS_IN_RANGE(code, 0x8281, 0x829a)) {
- /* Fullwidth Alphabet */
- return (OnigCodePoint )(code - 0x0021);
- }
- else if (ONIGENC_IS_IN_RANGE(code, 0x83bf, 0x83d6)) {
- /* Greek */
- return (OnigCodePoint )(code - 0x0020);
- }
- else if (ONIGENC_IS_IN_RANGE(code, 0x8470, 0x847e) ||
- ONIGENC_IS_IN_RANGE(code, 0x8480, 0x8491)) {
- /* Cyrillic */
- int d = (code >= 0x8480) ? 1 : 0;
- return (OnigCodePoint )(code - (0x0030 - d));
- }
- return code;
-}
-
-static int
-get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end,
- OnigCaseFoldCodeItem items[], OnigEncoding enc)
-{
- int len;
- OnigCodePoint code, code_lo, code_up;
-
- code = mbc_to_code(p, end, enc);
- if (ONIGENC_IS_ASCII_CODE(code))
- return onigenc_ascii_get_case_fold_codes_by_str(flag, p, end, items, enc);
-
- len = mbc_enc_len(p, end, enc);
- code_lo = get_lower_case(code);
- code_up = get_upper_case(code);
-
- if (code != code_lo) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = code_lo;
- return 1;
- }
- else if (code != code_up) {
- items[0].byte_len = len;
- items[0].code_len = 1;
- items[0].code[0] = code_up;
- return 1;
- }
-
- return 0;
-}
-
-static int
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end, UChar* lower,
- OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
- *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
- }
- else {
- OnigCodePoint code;
- int len;
-
- code = get_lower_case(mbc_to_code(p, end, enc));
- len = code_to_mbc(code, lower, enc);
- (*pp) += len;
- return len; /* return byte length of converted char to lower */
- }
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end)
-{
- return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
-
-}
-#endif
-
-#if 0
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype)
-{
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else {
- if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
- return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
- }
- }
-
- return FALSE;
-}
-#endif
-
-static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc)
-{
- const UChar *p;
- int len;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- if (SJIS_ISMB_TRAIL(*p)) {
- while (p > start) {
- if (! SJIS_ISMB_FIRST(*--p)) {
- p++;
- break;
- }
- }
- }
- len = mbc_enc_len(p, end, enc);
- if (p + len > s) return (UChar* )p;
- p += len;
- return (UChar* )(p + ((s - p) & ~1));
-}
-
-static int
-is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- const UChar c = *s;
- return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);
-}
-
-
-static const OnigCodePoint CR_Hiragana[] = {
- 1,
- 0x829f, 0x82f1
-}; /* CR_Hiragana */
-
-static const OnigCodePoint CR_Katakana[] = {
- 4,
- 0x00a6, 0x00af,
- 0x00b1, 0x00dd,
- 0x8340, 0x837e,
- 0x8380, 0x8396,
-}; /* CR_Katakana */
-
-#ifdef ENC_CP932
-static const OnigCodePoint CR_Han[] = {
- 6,
- 0x8157, 0x8157,
- 0x889f, 0x9872, /* Kanji level 1 */
- 0x989f, 0x9ffc, /* Kanji level 2 */
- 0xe040, 0xeaa4, /* Kanji level 2 */
- 0xed40, 0xeeec, /* NEC-selected IBM extended characters (without symbols) */
- 0xfa5c, 0xfc4b, /* IBM extended characters (without symbols) */
-}; /* CR_Han */
-#else
-static const OnigCodePoint CR_Han[] = {
- 4,
- 0x8157, 0x8157,
- 0x889f, 0x9872, /* Kanji level 1 */
- 0x989f, 0x9ffc, /* Kanji level 2 */
- 0xe040, 0xeaa4, /* Kanji level 2 */
-}; /* CR_Han */
-#endif
-
-static const OnigCodePoint CR_Latin[] = {
- 4,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x8260, 0x8279,
- 0x8281, 0x829a,
-}; /* CR_Latin */
-
-static const OnigCodePoint CR_Greek[] = {
- 2,
- 0x839f, 0x83b6,
- 0x83bf, 0x83d6,
-}; /* CR_Greek */
-
-static const OnigCodePoint CR_Cyrillic[] = {
- 3,
- 0x8440, 0x8460,
- 0x8470, 0x847f,
- 0x8480, 0x8491,
-}; /* CR_Cyrillic */
-
-#include "enc/jis/props.h"
-
-static int
-property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
-{
- const UChar *s = p, *e = end;
- const struct enc_property *prop =
- onig_jis_property((const char* )s, (unsigned int )(e - s));
-
- if (!prop) {
- return onigenc_minimum_property_name_to_ctype(enc, s, e);
- }
-
- return (int )prop->ctype;
-}
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
-{
- if (ctype <= ONIGENC_MAX_STD_CTYPE) {
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else {
- if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
- return TRUE;
- }
- }
- }
- else {
- ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
- if (ctype >= (unsigned int )PropertyListNum)
- return ONIGERR_TYPE_BUG;
-
- return onig_is_in_code_range((UChar* )PropertyList[ctype], code);
- }
-
- return FALSE;
-}
-
-static int
-get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
- const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
-{
- if (ctype <= ONIGENC_MAX_STD_CTYPE) {
- return ONIG_NO_SUPPORT_CONFIG;
- }
- else {
- *sb_out = 0x80;
-
- ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
- if (ctype >= (OnigCtype )PropertyListNum)
- return ONIGERR_TYPE_BUG;
-
- *ranges = PropertyList[ctype];
- return 0;
- }
-}
diff --git a/enc/trans/GB/GB12345%UCS.src b/enc/trans/GB/GB12345%UCS.src
index 9f1daad751..0b4115bed9 100644
--- a/enc/trans/GB/GB12345%UCS.src
+++ b/enc/trans/GB/GB12345%UCS.src
@@ -9,11 +9,62 @@ DST_UNIT_BITS 16
BEGIN_MAP
#
-# The mapping data below was created from a file provided by Unicode, Inc.
-# (The Unicode Consortium). The file was used to create a product supporting
-# Unicode, as explicitly permitted in the file's copyright notice. Please note
-# that Unicode, Inc. never made any claims as to fitness of that file for any
-# particular purpose, and has ceased to publish the file many years ago.
+# This mapping data is made from the mapping data provided by Unicode, Inc.
+# Original notice:
+#
+# Name: GB12345-80 to Unicode table (complete, hex format)
+# Unicode version: 1.1
+# Table version: 0.0d1
+# Table format: Format A
+# Date: 6 December 1993
+# Author: Glenn Adams <glenn@metis.com>
+# John H. Jenkins <John_Jenkins@taligent.com>
+#
+# 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.
+#
+# General notes:
+#
+# This table contains the data Metis and Taligent currently have on how
+# GB12345-90 characters map into Unicode.
+#
+# Format: Three tab-separated columns
+# Column #1 is the GB12345 code (in hex as 0xXXXX)
+# Column #2 is the Unicode (in hex as 0xXXXX)
+# Column #3 the Unicode name (follows a comment sign, '#')
+# The official names for Unicode characters U+4E00
+# to U+9FA5, inclusive, is "CJK UNIFIED IDEOGRAPH-XXXX",
+# where XXXX is the code point. Including all these
+# names in this file increases its size substantially
+# and needlessly. The token "<CJK>" is used for the
+# name of these characters. If necessary, it can be
+# expanded algorithmically by a parser or editor.
+#
+# The entries are in GB12345 order
+#
+# The following algorithms can be used to change the hex form
+# of GB12345 to other standard forms:
+#
+# To change hex to EUC form, add 0x8080
+# To change hex to kuten form, first subtract 0x2020. Then
+# the high and low bytes correspond to the ku and ten of
+# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
+# 0x777E -> 0x575E -> 8794
+#
+# Any comments or problems, contact <John_Jenkins@taligent.com>
#
#
0x2121 = 0x3000
diff --git a/enc/trans/GB/GB2312%UCS.src b/enc/trans/GB/GB2312%UCS.src
index dc222203fd..d196bab535 100644
--- a/enc/trans/GB/GB2312%UCS.src
+++ b/enc/trans/GB/GB2312%UCS.src
@@ -9,11 +9,76 @@ DST_UNIT_BITS 16
BEGIN_MAP
#
-# The mapping data below was created from a file provided by Unicode, Inc.
-# (The Unicode Consortium). The file was used to create a product supporting
-# Unicode, as explicitly permitted in the file's copyright notice. Please note
-# that Unicode, Inc. never made any claims as to fitness of that file for any
-# particular purpose, and has ceased to publish the file many years ago.
+# This mapping data is made from the mapping data provided by Unicode, Inc.
+# Original notice:
+#
+# Name: GB2312-80 to Unicode table (complete, hex format)
+# Unicode version: 3.0
+# Table version: 1.0
+# Table format: Format A
+# Date: 1999 October 8
+#
+# Copyright (c) 1991-1999 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 optical media by Unicode, Inc., the sole
+# remedy for any claim will be exchange of defective media within 90
+# days of receipt.
+#
+# Unicode, Inc. hereby grants the right to freely use the information
+# supplied in this file in the creation of products supporting the
+# Unicode Standard, and to make copies of this file in any form for
+# internal or external distribution as long as this notice remains
+# attached.
+#
+# General notes:
+#
+#
+# This table contains one set of mappings from GB2312-80 into Unicode.
+# Note that these data are *possible* mappings only and may not be the
+# 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 GB2312-80 and Unicode, consult the
+# VENDORS mapping data. Normative information on the mapping between
+# GB2312-80 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 GB2312-80 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.
+#
+#
+# Format: Three tab-separated columns
+# Column #1 is the GB2312 code (in hex as 0xXXXX)
+# Column #2 is the Unicode (in hex as 0xXXXX)
+# Column #3 the Unicode name (follows a comment sign, '#')
+# The official names for Unicode characters U+4E00
+# to U+9FA5, inclusive, is "CJK UNIFIED IDEOGRAPH-XXXX",
+# where XXXX is the code point. Including all these
+# names in this file increases its size substantially
+# and needlessly. The token "<CJK>" is used for the
+# name of these characters. If necessary, it can be
+# expanded algorithmically by a parser or editor.
+#
+# The entries are in GB2312 order
+#
+# The following algorithms can be used to change the hex form
+# of GB2312 to other standard forms:
+#
+# To change hex to EUC form, add 0x8080
+# To change hex to kuten form, first subtract 0x2020. Then
+# the high and low bytes correspond to the ku and ten of
+# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
+# 0x777E -> 0x575E -> 8794
+#
+# Version history
+# 1.0 version updates 0.0d2 version by correcting mapping for 0x212C
+# from U+2225 to U+2016.
#
#
diff --git a/enc/trans/GB/UCS%GB12345.src b/enc/trans/GB/UCS%GB12345.src
index a876bdaca8..8ec8318438 100644
--- a/enc/trans/GB/UCS%GB12345.src
+++ b/enc/trans/GB/UCS%GB12345.src
@@ -9,11 +9,62 @@ DST_UNIT_BITS 16
BEGIN_MAP
#
-# The mapping data below was created from a file provided by Unicode, Inc.
-# (The Unicode Consortium). The file was used to create a product supporting
-# Unicode, as explicitly permitted in the file's copyright notice. Please note
-# that Unicode, Inc. never made any claims as to fitness of that file for any
-# particular purpose, and has ceased to publish the file many years ago.
+# This mapping data is made from the mapping data provided by Unicode, Inc.
+# Original notice:
+#
+# Name: GB12345-80 to Unicode table (complete, hex format)
+# Unicode version: 1.1
+# Table version: 0.0d1
+# Table format: Format A
+# Date: 6 December 1993
+# Author: Glenn Adams <glenn@metis.com>
+# John H. Jenkins <John_Jenkins@taligent.com>
+#
+# 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.
+#
+# General notes:
+#
+# This table contains the data Metis and Taligent currently have on how
+# GB12345-90 characters map into Unicode.
+#
+# Format: Three tab-separated columns
+# Column #1 is the GB12345 code (in hex as 0xXXXX)
+# Column #2 is the Unicode (in hex as 0xXXXX)
+# Column #3 the Unicode name (follows a comment sign, '#')
+# The official names for Unicode characters U+4E00
+# to U+9FA5, inclusive, is "CJK UNIFIED IDEOGRAPH-XXXX",
+# where XXXX is the code point. Including all these
+# names in this file increases its size substantially
+# and needlessly. The token "<CJK>" is used for the
+# name of these characters. If necessary, it can be
+# expanded algorithmically by a parser or editor.
+#
+# The entries are in GB12345 order
+#
+# The following algorithms can be used to change the hex form
+# of GB12345 to other standard forms:
+#
+# To change hex to EUC form, add 0x8080
+# To change hex to kuten form, first subtract 0x2020. Then
+# the high and low bytes correspond to the ku and ten of
+# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
+# 0x777E -> 0x575E -> 8794
+#
+# Any comments or problems, contact <John_Jenkins@taligent.com>
#
#
0x00A4 = 0x2168
diff --git a/enc/trans/GB/UCS%GB2312.src b/enc/trans/GB/UCS%GB2312.src
index 4f4d52a54a..3293fea604 100644
--- a/enc/trans/GB/UCS%GB2312.src
+++ b/enc/trans/GB/UCS%GB2312.src
@@ -9,11 +9,76 @@ DST_UNIT_BITS 16
BEGIN_MAP
#
-# The mapping data below was created from a file provided by Unicode, Inc.
-# (The Unicode Consortium). The file was used to create a product supporting
-# Unicode, as explicitly permitted in the file's copyright notice. Please note
-# that Unicode, Inc. never made any claims as to fitness of that file for any
-# particular purpose, and has ceased to publish the file many years ago.
+# This mapping data is made from the mapping data provided by Unicode, Inc.
+# Original notice:
+#
+# Name: GB2312-80 to Unicode table (complete, hex format)
+# Unicode version: 3.0
+# Table version: 1.0
+# Table format: Format A
+# Date: 1999 October 8
+#
+# Copyright (c) 1991-1999 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 optical media by Unicode, Inc., the sole
+# remedy for any claim will be exchange of defective media within 90
+# days of receipt.
+#
+# Unicode, Inc. hereby grants the right to freely use the information
+# supplied in this file in the creation of products supporting the
+# Unicode Standard, and to make copies of this file in any form for
+# internal or external distribution as long as this notice remains
+# attached.
+#
+# General notes:
+#
+#
+# This table contains one set of mappings from GB2312-80 into Unicode.
+# Note that these data are *possible* mappings only and may not be the
+# 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 GB2312-80 and Unicode, consult the
+# VENDORS mapping data. Normative information on the mapping between
+# GB2312-80 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 GB2312-80 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.
+#
+#
+# Format: Three tab-separated columns
+# Column #1 is the GB2312 code (in hex as 0xXXXX)
+# Column #2 is the Unicode (in hex as 0xXXXX)
+# Column #3 the Unicode name (follows a comment sign, '#')
+# The official names for Unicode characters U+4E00
+# to U+9FA5, inclusive, is "CJK UNIFIED IDEOGRAPH-XXXX",
+# where XXXX is the code point. Including all these
+# names in this file increases its size substantially
+# and needlessly. The token "<CJK>" is used for the
+# name of these characters. If necessary, it can be
+# expanded algorithmically by a parser or editor.
+#
+# The entries are in GB2312 order
+#
+# The following algorithms can be used to change the hex form
+# of GB2312 to other standard forms:
+#
+# To change hex to EUC form, add 0x8080
+# To change hex to kuten form, first subtract 0x2020. Then
+# the high and low bytes correspond to the ku and ten of
+# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
+# 0x777E -> 0x575E -> 8794
+#
+# Version history
+# 1.0 version updates 0.0d2 version by correcting mapping for 0x212C
+# from U+2225 to U+2016.
#
#
0x00A4 = 0x2168
diff --git a/enc/trans/JIS/JISX0201-KANA%UCS.src b/enc/trans/JIS/JISX0201-KANA%UCS.src
index d56b97f7cc..d25b580fed 100644
--- a/enc/trans/JIS/JISX0201-KANA%UCS.src
+++ b/enc/trans/JIS/JISX0201-KANA%UCS.src
@@ -12,16 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -31,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Three tab-separated columns
@@ -41,22 +60,6 @@ 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 7875969b95..c2cacd422e 100644
--- a/enc/trans/JIS/JISX0208@1990%UCS.src
+++ b/enc/trans/JIS/JISX0208@1990%UCS.src
@@ -12,17 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -32,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Four tab-separated columns
@@ -59,22 +77,12 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x7426 -> 0x5406 -> 8406
#
-# 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.
+# 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
#
-# [v0.9, 8 March 1994]
-# First release.
+# Any comments or problems, contact <John_Jenkins@taligent.com>
#
-# 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 aa51257b99..cf4e7ecf62 100644
--- a/enc/trans/JIS/JISX0212%UCS.src
+++ b/enc/trans/JIS/JISX0212%UCS.src
@@ -12,16 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -31,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Three tab-separated columns
@@ -57,11 +76,17 @@ 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
#
@@ -71,24 +96,7 @@ 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 fac6ae8afe..57ae00f23b 100644
--- a/enc/trans/JIS/UCS%JISX0201-KANA.src
+++ b/enc/trans/JIS/UCS%JISX0201-KANA.src
@@ -12,16 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -31,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Three tab-separated columns
@@ -41,23 +60,6 @@ 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 b06e6de231..977171ccda 100644
--- a/enc/trans/JIS/UCS%JISX0208@1990.src
+++ b/enc/trans/JIS/UCS%JISX0208@1990.src
@@ -12,16 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -31,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Four tab-separated columns
@@ -58,22 +77,12 @@ BEGIN_MAP
# the kuten form. For example, 0x2121 -> 0x0101 -> 0101;
# 0x7426 -> 0x5406 -> 8406
#
-# 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.
+# 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
#
-# [v0.9, 8 March 1994]
-# First release.
+# Any comments or problems, contact <John_Jenkins@taligent.com>
#
-# 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 65383a1c9f..f3b2e7089b 100644
--- a/enc/trans/JIS/UCS%JISX0212.src
+++ b/enc/trans/JIS/UCS%JISX0212.src
@@ -12,16 +12,27 @@ 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: 2.0
+# Table version: 0.9
# Table format: Format A
-# Date: 2011 October 14 (header updated: 2015 December 02)
+# 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.
#
# General notes:
#
@@ -31,7 +42,15 @@ 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.
+# 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.
#
#
# Format: Three tab-separated columns
@@ -57,11 +76,17 @@ 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
#
@@ -72,24 +97,6 @@ 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
deleted file mode 100644
index c5b5dfec87..0000000000
--- a/enc/trans/ebcdic.trans
+++ /dev/null
@@ -1,278 +0,0 @@
-#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/single_byte.trans b/enc/trans/single_byte.trans
index cf521bed38..50f568cb94 100644
--- a/enc/trans/single_byte.trans
+++ b/enc/trans/single_byte.trans
@@ -18,12 +18,15 @@
# file name: lower case, hyphens, -tbl.rb suffix (e.g. iso-8859-3-tbl.rb)
# variable name: UPPER case, underscores, _TO_UCS_TBL suffix (e.g. ISO_8859_3_TO_UCS_TBL)
# If the name starts with "ISO-8859", the C1 control code area is added automatically.
- def transcode_tblgen_singlebyte(name)
+ def transcode_tblgen_singlebyte (name)
require(name.downcase + "-tbl")
control1_if_needed = (name =~ /^ISO-8859/) ? CONTROL1_TO_UCS_TBL : []
tbl_to_ucs = control1_if_needed + eval(name.gsub(/-/, '_') + "_TO_UCS_TBL")
- transcode_tblgen(name, "UTF-8", [["{00-7f}", :nomap], *tbl_to_ucs.reject {|a, b| a.length != 2 }], '{00-ff}')
- transcode_tblgen("UTF-8", name, [["{00-7f}", :nomap], *tbl_to_ucs.map {|a,b| [b,a] }])
+ code = ''
+ code << transcode_tblgen(name, "UTF-8", [["{00-7f}", :nomap], *tbl_to_ucs.reject {|a, b| a.length != 2 }], '{00-ff}')
+ code << "\n"
+ code << transcode_tblgen("UTF-8", name, [["{00-7f}", :nomap], *tbl_to_ucs.map {|a,b| [b,a] }])
+ code
end
transcode_tblgen_singlebyte "ISO-8859-1"
diff --git a/enc/trans/windows-1255-tbl.rb b/enc/trans/windows-1255-tbl.rb
index 4d4cafe0d8..9084a56a10 100644
--- a/enc/trans/windows-1255-tbl.rb
+++ b/enc/trans/windows-1255-tbl.rb
@@ -43,7 +43,6 @@ WINDOWS_1255_TO_UCS_TBL = [
["C7",0x5B7],
["C8",0x5B8],
["C9",0x5B9],
- ["CA",0x5BA],
["CB",0x5BB],
["CC",0x5BC],
["CD",0x5BD],
@@ -139,4 +138,4 @@ WINDOWS_1255_TO_UCS_TBL = [
["E1CF",0xFB4C],
["EBCF",0xFB4D],
["F4CF",0xFB4E],
-]
+] \ No newline at end of file
diff --git a/enc/unicode.c b/enc/unicode.c
index c909022989..f0ef89880f 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -2,7 +2,7 @@
unicode.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -137,44 +137,9 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
return 1;
}
-/* macros related to ONIGENC_CASE flags */
-/* defined here because not used in other files */
-#define ONIGENC_CASE_SPECIALS (ONIGENC_CASE_TITLECASE | ONIGENC_CASE_IS_TITLECASE | ONIGENC_CASE_UP_SPECIAL | ONIGENC_CASE_DOWN_SPECIAL)
-
-/* macros for length in CaseMappingSpecials array in enc/unicode/casefold.h */
-#define SpecialsLengthOffset 25 /* needs to be higher than the 22 bits used for Unicode codepoints */
-#define SpecialsLengthExtract(n) ((n) >> SpecialsLengthOffset)
-#define SpecialsCodepointExtract(n) ((n) & ((1 << SpecialsLengthOffset) - 1))
-#define SpecialsLengthEncode(n) ((n) << SpecialsLengthOffset)
-
-#define OnigSpecialIndexMask (((1 << OnigSpecialIndexWidth) - 1) << OnigSpecialIndexShift)
-#define OnigSpecialIndexEncode(n) ((n) << OnigSpecialIndexShift)
-#define OnigSpecialIndexDecode(n) (((n) & OnigSpecialIndexMask) >> OnigSpecialIndexShift)
-
-/* macros to shorten "enc/unicode/casefold.h", undefined immediately after including the file */
-#define U ONIGENC_CASE_UPCASE
-#define D ONIGENC_CASE_DOWNCASE
-#define F ONIGENC_CASE_FOLD
-#define ST ONIGENC_CASE_TITLECASE
-#define SU ONIGENC_CASE_UP_SPECIAL
-#define SL ONIGENC_CASE_DOWN_SPECIAL
-#define IT ONIGENC_CASE_IS_TITLECASE
-#define I(n) OnigSpecialIndexEncode(n)
-#define L(n) SpecialsLengthEncode(n)
-
-#include "casefold.h"
-
-#undef U
-#undef D
-#undef F
-#undef ST
-#undef SU
-#undef SL
-#undef IT
-#undef I
-#undef L
-
-#include "name2ctype.h"
+#include "enc/unicode/casefold.h"
+
+#include "enc/unicode/name2ctype.h"
#define CODE_RANGES_NUM numberof(CodeRanges)
@@ -218,15 +183,17 @@ onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
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, const UChar* name, const UChar* end)
+onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
{
int len;
int ctype;
UChar buf[PROPERTY_NAME_MAX_SIZE];
- const UChar *p;
+ UChar *p;
OnigCodePoint code;
len = 0;
@@ -256,12 +223,6 @@ onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* name, cons
#define onigenc_unicode_unfold2_lookup onigenc_unicode_CaseUnfold_12_lookup
#define onigenc_unicode_unfold3_lookup onigenc_unicode_CaseUnfold_13_lookup
-enum {
- I_WITH_DOT_ABOVE = 0x0130,
- DOTLESS_i = 0x0131,
- DOT_ABOVE = 0x0307
-};
-
extern int
onigenc_unicode_mbc_case_fold(OnigEncoding enc,
OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end,
@@ -278,17 +239,17 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (code == 'I') {
- return ONIGENC_CODE_TO_MBC(enc, DOTLESS_i, fold);
+ if (code == 0x0049) {
+ return ONIGENC_CODE_TO_MBC(enc, 0x0131, fold);
}
- else if (code == I_WITH_DOT_ABOVE) {
- return ONIGENC_CODE_TO_MBC(enc, 'i', fold);
+ else if (code == 0x0130) {
+ return ONIGENC_CODE_TO_MBC(enc, 0x0069, fold);
}
}
#endif
if ((to = onigenc_unicode_fold_lookup(code)) != 0) {
- if (OnigCodePointCount(to->n) == 1) {
+ if (to->n == 1) {
return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold);
}
#if 0
@@ -299,7 +260,7 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc,
#endif
{
rlen = 0;
- for (i = 0; i < OnigCodePointCount(to->n); i++) {
+ for (i = 0; i < to->n; i++) {
len = ONIGENC_CODE_TO_MBC(enc, to->code[i], fold);
fold += len;
rlen += len;
@@ -325,7 +286,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
for (i = 0; i < numberof(CaseUnfold_11); i++) {
p11 = &CaseUnfold_11[i];
- for (j = 0; j < OnigCodePointCount(p11->to.n); j++) {
+ for (j = 0; j < p11->to.n; j++) {
code = p11->from;
r = (*f)(p11->to.code[j], &code, 1, arg);
if (r != 0) return r;
@@ -346,25 +307,25 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- code = DOTLESS_i;
- r = (*f)('I', &code, 1, arg);
+ code = 0x0131;
+ r = (*f)(0x0049, &code, 1, arg);
if (r != 0) return r;
- code = 'I';
- r = (*f)(DOTLESS_i, &code, 1, arg);
+ code = 0x0049;
+ r = (*f)(0x0131, &code, 1, arg);
if (r != 0) return r;
- code = I_WITH_DOT_ABOVE;
- r = (*f)('i', &code, 1, arg);
+ code = 0x0130;
+ r = (*f)(0x0069, &code, 1, arg);
if (r != 0) return r;
- code = 'i';
- r = (*f)(I_WITH_DOT_ABOVE, &code, 1, arg);
+ code = 0x0069;
+ r = (*f)(0x0130, &code, 1, arg);
if (r != 0) return r;
}
else {
#endif
for (i = 0; i < numberof(CaseUnfold_11_Locale); i++) {
p11 = &CaseUnfold_11_Locale[i];
- for (j = 0; j < OnigCodePointCount(p11->to.n); j++) {
+ for (j = 0; j < p11->to.n; j++) {
code = p11->from;
r = (*f)(p11->to.code[j], &code, 1, arg);
if (r != 0) return r;
@@ -390,12 +351,12 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
for (i = 0; i < numberof(CaseUnfold_12); i++) {
- for (j = 0; j < OnigCodePointCount(CaseUnfold_12[i].to.n); j++) {
+ for (j = 0; j < CaseUnfold_12[i].to.n; j++) {
r = (*f)(CaseUnfold_12[i].to.code[j],
(OnigCodePoint* )CaseUnfold_12[i].from, 2, arg);
if (r != 0) return r;
- for (k = 0; k < OnigCodePointCount(CaseUnfold_12[i].to.n); k++) {
+ for (k = 0; k < CaseUnfold_12[i].to.n; k++) {
if (k == j) continue;
r = (*f)(CaseUnfold_12[i].to.code[j],
@@ -409,12 +370,12 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) {
#endif
for (i = 0; i < numberof(CaseUnfold_12_Locale); i++) {
- for (j = 0; j < OnigCodePointCount(CaseUnfold_12_Locale[i].to.n); j++) {
+ for (j = 0; j < CaseUnfold_12_Locale[i].to.n; j++) {
r = (*f)(CaseUnfold_12_Locale[i].to.code[j],
(OnigCodePoint* )CaseUnfold_12_Locale[i].from, 2, arg);
if (r != 0) return r;
- for (k = 0; k < OnigCodePointCount(CaseUnfold_12_Locale[i].to.n); k++) {
+ for (k = 0; k < CaseUnfold_12_Locale[i].to.n; k++) {
if (k == j) continue;
r = (*f)(CaseUnfold_12_Locale[i].to.code[j],
@@ -429,12 +390,12 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
#endif
for (i = 0; i < numberof(CaseUnfold_13); i++) {
- for (j = 0; j < OnigCodePointCount(CaseUnfold_13[i].to.n); j++) {
+ for (j = 0; j < CaseUnfold_13[i].to.n; j++) {
r = (*f)(CaseUnfold_13[i].to.code[j],
(OnigCodePoint* )CaseUnfold_13[i].from, 3, arg);
if (r != 0) return r;
- for (k = 0; k < OnigCodePointCount(CaseUnfold_13[i].to.n); k++) {
+ for (k = 0; k < CaseUnfold_13[i].to.n; k++) {
if (k == j) continue;
r = (*f)(CaseUnfold_13[i].to.code[j],
@@ -448,8 +409,6 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
return 0;
}
-#define CodePointListValidP(x) (OnigCodePointCount((x)->n) <= numberof((x)->code))
-
extern int
onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end,
@@ -467,33 +426,35 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- switch (code) {
- case 'I':
+ if (code == 0x0049) {
items[0].byte_len = len;
items[0].code_len = 1;
- items[0].code[0] = DOTLESS_i;
+ items[0].code[0] = 0x0131;
return 1;
- case I_WITH_DOT_ABOVE:
+ }
+ else if (code == 0x0130) {
items[0].byte_len = len;
items[0].code_len = 1;
- items[0].code[0] = 'i';
+ items[0].code[0] = 0x0069;
return 1;
- case DOTLESS_i:
+ }
+ else if (code == 0x0131) {
items[0].byte_len = len;
items[0].code_len = 1;
- items[0].code[0] = 'I';
+ items[0].code[0] = 0x0049;
return 1;
- case 'i':
+ }
+ else if (code == 0x0069) {
items[0].byte_len = len;
items[0].code_len = 1;
- items[0].code[0] = I_WITH_DOT_ABOVE;
+ items[0].code[0] = 0x0130;
return 1;
}
}
#endif
if ((to = onigenc_unicode_fold_lookup(code)) != 0) {
- if (OnigCodePointCount(to->n) == 1) {
+ if (to->n == 1) {
OnigCodePoint orig_code = code;
items[0].byte_len = len;
@@ -502,9 +463,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
n++;
code = to->code[0];
- if ((to = onigenc_unicode_unfold1_lookup(code)) != 0 &&
- CodePointListValidP(to)) {
- for (i = 0; i < OnigCodePointCount(to->n); i++) {
+ 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;
items[n].code_len = 1;
@@ -518,13 +478,13 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
OnigCodePoint cs[3][4];
int fn, ncs[3];
- for (fn = 0; fn < OnigCodePointCount(to->n); fn++) {
+ for (fn = 0; fn < to->n; fn++) {
cs[fn][0] = to->code[fn];
if ((z3 = onigenc_unicode_unfold1_lookup(cs[fn][0])) != 0) {
- for (i = 0; i < OnigCodePointCount(z3->n); i++) {
+ for (i = 0; i < z3->n; i++) {
cs[fn][i+1] = z3->code[i];
}
- ncs[fn] = OnigCodePointCount(z3->n) + 1;
+ ncs[fn] = z3->n + 1;
}
else
ncs[fn] = 1;
@@ -541,9 +501,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
- if ((z2 = onigenc_unicode_unfold2_lookup(to->code)) != 0 &&
- CodePointListValidP(z2)) {
- for (i = 0; i < OnigCodePointCount(z2->n); i++) {
+ if ((z2 = onigenc_unicode_unfold2_lookup(to->code)) != 0) {
+ for (i = 0; i < z2->n; i++) {
if (z2->code[i] == code) continue;
items[n].byte_len = len;
@@ -567,9 +526,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
- if ((z2 = onigenc_unicode_unfold3_lookup(to->code)) != 0 &&
- CodePointListValidP(z2)) {
- for (i = 0; i < OnigCodePointCount(z2->n); i++) {
+ if ((z2 = onigenc_unicode_unfold3_lookup(to->code)) != 0) {
+ for (i = 0; i < z2->n; i++) {
if (z2->code[i] == code) continue;
items[n].byte_len = len;
@@ -585,9 +543,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
}
else {
- if ((to = onigenc_unicode_unfold1_lookup(code)) != 0 &&
- CodePointListValidP(to)) {
- for (i = 0; i < OnigCodePointCount(to->n); i++) {
+ 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;
items[n].code[0] = to->code[i];
@@ -605,7 +562,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
codes[0] = code;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
if ((to = onigenc_unicode_fold_lookup(code)) != 0
- && OnigCodePointCount(to->n) == 1) {
+ && to->n == 1) {
codes[1] = to->code[0];
}
else
@@ -613,9 +570,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
clen = enclen(enc, p, end);
len += clen;
- if ((z2 = onigenc_unicode_unfold2_lookup(codes)) != 0 &&
- CodePointListValidP(z2)) {
- for (i = 0; i < OnigCodePointCount(z2->n); i++) {
+ 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;
items[n].code[0] = z2->code[i];
@@ -627,7 +583,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
if (p < end) {
code = ONIGENC_MBC_TO_CODE(enc, p, end);
if ((to = onigenc_unicode_fold_lookup(code)) != 0
- && OnigCodePointCount(to->n) == 1) {
+ && to->n == 1) {
codes[2] = to->code[0];
}
else
@@ -635,9 +591,8 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
clen = enclen(enc, p, end);
len += clen;
- if ((z2 = onigenc_unicode_unfold3_lookup(codes)) != 0 &&
- CodePointListValidP(z2)) {
- for (i = 0; i < OnigCodePointCount(z2->n); i++) {
+ 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;
items[n].code[0] = z2->code[i];
@@ -650,154 +605,3 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
return n;
}
-
-/* length in bytes for three characters in UTF-32; e.g. needed for ffi (U+FB03) */
-#define CASE_MAPPING_SLACK 12
-#define MODIFIED (flags |= ONIGENC_CASE_MODIFIED)
-extern int
-onigenc_unicode_case_map(OnigCaseFoldType* flagP,
- const OnigUChar** pp, const OnigUChar* end,
- OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
- int codepoint_length;
-
- to_end -= CASE_MAPPING_SLACK;
- /* copy flags ONIGENC_CASE_UPCASE and ONIGENC_CASE_DOWNCASE over to
- * ONIGENC_CASE_UP_SPECIAL and ONIGENC_CASE_DOWN_SPECIAL */
- flags |= (flags & (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE)) << ONIGENC_CASE_SPECIAL_OFFSET;
-
- while (*pp < end && to <= to_end) {
- codepoint_length = ONIGENC_PRECISE_MBC_ENC_LEN(enc, *pp, end);
- if (codepoint_length < 0)
- return codepoint_length; /* encoding invalid */
- code = ONIGENC_MBC_TO_CODE(enc, *pp, end);
- *pp += codepoint_length;
-
- if (code <= 'z') { /* ASCII comes first */
- if (code >= 'a' && code <= 'z') {
- if (flags & ONIGENC_CASE_UPCASE) {
- MODIFIED;
- if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERI && code == 'i')
- code = I_WITH_DOT_ABOVE;
- else
- code += 'A' - 'a';
- }
- }
- else if (code >= 'A' && code <= 'Z') {
- if (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD)) {
- MODIFIED;
- if (flags & ONIGENC_CASE_FOLD_TURKISH_AZERI && code == 'I')
- code = DOTLESS_i;
- else
- code += 'a' - 'A';
- }
- }
- }
- else if (!(flags & ONIGENC_CASE_ASCII_ONLY) && code >= 0x00B5) { /* deal with non-ASCII; micron sign (U+00B5) is lowest affected */
- const CodePointList3 *folded;
-
- if (code == I_WITH_DOT_ABOVE) {
- if (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD)) {
- MODIFIED;
- code = 'i';
- if (!(flags & ONIGENC_CASE_FOLD_TURKISH_AZERI)) { /* make dot above explicit */
- to += ONIGENC_CODE_TO_MBC(enc, code, to);
- code = DOT_ABOVE;
- }
- }
- }
- else if (code == DOTLESS_i) { /* handle this manually, because it isn't involved in folding */
- if (flags & ONIGENC_CASE_UPCASE) {
- MODIFIED;
- code = 'I';
- }
- }
- else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */
- if ((flags & ONIGENC_CASE_TITLECASE) /* Titlecase needed, */
- && (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_IS_TITLECASE)) { /* but already Titlecase */
- /* already Titlecase, no changes needed */
- }
- else if (flags & OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */
- const OnigCodePoint *next;
- int count;
-
- MODIFIED;
- if (flags & OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_SPECIALS) { /* special */
- const OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
-
- if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_IS_TITLECASE) { /* swapCASE available */
- if ((flags & (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE))
- == (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE)) /* swapCASE needed */
- goto SpecialsCopy;
- else /* swapCASE not needed */
- SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
- }
- if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_TITLECASE) { /* Titlecase available */
- if (flags & ONIGENC_CASE_TITLECASE) /* Titlecase needed, but not yet Titlecase */
- goto SpecialsCopy;
- else /* Titlecase not needed */
- SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
- }
- if (OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_DOWN_SPECIAL) {
- if (!(flags & ONIGENC_CASE_DOWN_SPECIAL))
- SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
- }
- /* here, we know we use ONIGENC_CASE_UP_SPECIAL, and the position is right */
-SpecialsCopy:
- count = SpecialsLengthExtract(*SpecialsStart);
- next = SpecialsStart;
- code = SpecialsCodepointExtract(*next++);
- }
- else { /* no specials */
- count = OnigCodePointCount(folded->n);
- next = folded->code;
- code = *next++;
- }
- if (count == 1)
- ;
- else if (count == 2) {
- to += ONIGENC_CODE_TO_MBC(enc, code, to);
- code = *next;
- }
- else { /* count == 3 */
- to += ONIGENC_CODE_TO_MBC(enc, code, to);
- to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
- code = *next;
- }
- }
- }
- else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0 /* data about character found in CaseUnfold_11_Table */
- && flags & OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */
- MODIFIED;
- code = folded->code[(flags & OnigCaseFoldFlags(folded->n) & ONIGENC_CASE_TITLECASE) ? 1 : 0];
- }
- }
- to += ONIGENC_CODE_TO_MBC(enc, code, to);
- /* switch from titlecase to lowercase for capitalize */
- if (flags & ONIGENC_CASE_TITLECASE)
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE |
- ONIGENC_CASE_UP_SPECIAL | ONIGENC_CASE_DOWN_SPECIAL);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-const char onigenc_unicode_version_string[] =
-#ifdef ONIG_UNICODE_VERSION_STRING
- ONIG_UNICODE_VERSION_STRING
-#endif
- "";
-
-const int onigenc_unicode_version_number[3] = {
-#ifdef ONIG_UNICODE_VERSION_MAJOR
- ONIG_UNICODE_VERSION_MAJOR,
- ONIG_UNICODE_VERSION_MINOR,
- ONIG_UNICODE_VERSION_TEENY,
-#else
- 0
-#endif
-};
diff --git a/enc/unicode/10.0.0/casefold.h b/enc/unicode/10.0.0/casefold.h
deleted file mode 100644
index a8f5a24e24..0000000000
--- a/enc/unicode/10.0.0/casefold.h
+++ /dev/null
@@ -1,7044 +0,0 @@
-/* DO NOT EDIT THIS FILE. */
-/* Generated by enc/unicode/case-folding.rb */
-
-#if defined ONIG_UNICODE_VERSION_STRING && !( \
- ONIG_UNICODE_VERSION_MAJOR == 10 && \
- ONIG_UNICODE_VERSION_MINOR == 0 && \
- ONIG_UNICODE_VERSION_TEENY == 0 && \
- 1)
-# error ONIG_UNICODE_VERSION_STRING mismatch
-#endif
-#define ONIG_UNICODE_VERSION_STRING "10.0.0"
-#define ONIG_UNICODE_VERSION_MAJOR 10
-#define ONIG_UNICODE_VERSION_MINOR 0
-#define ONIG_UNICODE_VERSION_TEENY 0
-
-static const CaseFold_11_Type CaseFold_11_Table[] = {
-#define CaseFold (*(CaseFold_11_Type (*)[1399])(CaseFold_11_Table+0))
- {0x0041, {1|F|D, {0x0061}}},
- {0x0042, {1|F|D, {0x0062}}},
- {0x0043, {1|F|D, {0x0063}}},
- {0x0044, {1|F|D, {0x0064}}},
- {0x0045, {1|F|D, {0x0065}}},
- {0x0046, {1|F|D, {0x0066}}},
- {0x0047, {1|F|D, {0x0067}}},
- {0x0048, {1|F|D, {0x0068}}},
- {0x004a, {1|F|D, {0x006a}}},
- {0x004b, {1|F|D, {0x006b}}},
- {0x004c, {1|F|D, {0x006c}}},
- {0x004d, {1|F|D, {0x006d}}},
- {0x004e, {1|F|D, {0x006e}}},
- {0x004f, {1|F|D, {0x006f}}},
- {0x0050, {1|F|D, {0x0070}}},
- {0x0051, {1|F|D, {0x0071}}},
- {0x0052, {1|F|D, {0x0072}}},
- {0x0053, {1|F|D, {0x0073}}},
- {0x0054, {1|F|D, {0x0074}}},
- {0x0055, {1|F|D, {0x0075}}},
- {0x0056, {1|F|D, {0x0076}}},
- {0x0057, {1|F|D, {0x0077}}},
- {0x0058, {1|F|D, {0x0078}}},
- {0x0059, {1|F|D, {0x0079}}},
- {0x005a, {1|F|D, {0x007a}}},
- {0x00b5, {1|F|SU|I(0), {0x03bc}}},
- {0x00c0, {1|F|D, {0x00e0}}},
- {0x00c1, {1|F|D, {0x00e1}}},
- {0x00c2, {1|F|D, {0x00e2}}},
- {0x00c3, {1|F|D, {0x00e3}}},
- {0x00c4, {1|F|D, {0x00e4}}},
- {0x00c5, {1|F|D, {0x00e5}}},
- {0x00c6, {1|F|D, {0x00e6}}},
- {0x00c7, {1|F|D, {0x00e7}}},
- {0x00c8, {1|F|D, {0x00e8}}},
- {0x00c9, {1|F|D, {0x00e9}}},
- {0x00ca, {1|F|D, {0x00ea}}},
- {0x00cb, {1|F|D, {0x00eb}}},
- {0x00cc, {1|F|D, {0x00ec}}},
- {0x00cd, {1|F|D, {0x00ed}}},
- {0x00ce, {1|F|D, {0x00ee}}},
- {0x00cf, {1|F|D, {0x00ef}}},
- {0x00d0, {1|F|D, {0x00f0}}},
- {0x00d1, {1|F|D, {0x00f1}}},
- {0x00d2, {1|F|D, {0x00f2}}},
- {0x00d3, {1|F|D, {0x00f3}}},
- {0x00d4, {1|F|D, {0x00f4}}},
- {0x00d5, {1|F|D, {0x00f5}}},
- {0x00d6, {1|F|D, {0x00f6}}},
- {0x00d8, {1|F|D, {0x00f8}}},
- {0x00d9, {1|F|D, {0x00f9}}},
- {0x00da, {1|F|D, {0x00fa}}},
- {0x00db, {1|F|D, {0x00fb}}},
- {0x00dc, {1|F|D, {0x00fc}}},
- {0x00dd, {1|F|D, {0x00fd}}},
- {0x00de, {1|F|D, {0x00fe}}},
- {0x00df, {2|F|ST|SU|I(1), {0x0073, 0x0073}}},
- {0x0100, {1|F|D, {0x0101}}},
- {0x0102, {1|F|D, {0x0103}}},
- {0x0104, {1|F|D, {0x0105}}},
- {0x0106, {1|F|D, {0x0107}}},
- {0x0108, {1|F|D, {0x0109}}},
- {0x010a, {1|F|D, {0x010b}}},
- {0x010c, {1|F|D, {0x010d}}},
- {0x010e, {1|F|D, {0x010f}}},
- {0x0110, {1|F|D, {0x0111}}},
- {0x0112, {1|F|D, {0x0113}}},
- {0x0114, {1|F|D, {0x0115}}},
- {0x0116, {1|F|D, {0x0117}}},
- {0x0118, {1|F|D, {0x0119}}},
- {0x011a, {1|F|D, {0x011b}}},
- {0x011c, {1|F|D, {0x011d}}},
- {0x011e, {1|F|D, {0x011f}}},
- {0x0120, {1|F|D, {0x0121}}},
- {0x0122, {1|F|D, {0x0123}}},
- {0x0124, {1|F|D, {0x0125}}},
- {0x0126, {1|F|D, {0x0127}}},
- {0x0128, {1|F|D, {0x0129}}},
- {0x012a, {1|F|D, {0x012b}}},
- {0x012c, {1|F|D, {0x012d}}},
- {0x012e, {1|F|D, {0x012f}}},
- {0x0132, {1|F|D, {0x0133}}},
- {0x0134, {1|F|D, {0x0135}}},
- {0x0136, {1|F|D, {0x0137}}},
- {0x0139, {1|F|D, {0x013a}}},
- {0x013b, {1|F|D, {0x013c}}},
- {0x013d, {1|F|D, {0x013e}}},
- {0x013f, {1|F|D, {0x0140}}},
- {0x0141, {1|F|D, {0x0142}}},
- {0x0143, {1|F|D, {0x0144}}},
- {0x0145, {1|F|D, {0x0146}}},
- {0x0147, {1|F|D, {0x0148}}},
- {0x0149, {2|F|SU|I(5), {0x02bc, 0x006e}}},
- {0x014a, {1|F|D, {0x014b}}},
- {0x014c, {1|F|D, {0x014d}}},
- {0x014e, {1|F|D, {0x014f}}},
- {0x0150, {1|F|D, {0x0151}}},
- {0x0152, {1|F|D, {0x0153}}},
- {0x0154, {1|F|D, {0x0155}}},
- {0x0156, {1|F|D, {0x0157}}},
- {0x0158, {1|F|D, {0x0159}}},
- {0x015a, {1|F|D, {0x015b}}},
- {0x015c, {1|F|D, {0x015d}}},
- {0x015e, {1|F|D, {0x015f}}},
- {0x0160, {1|F|D, {0x0161}}},
- {0x0162, {1|F|D, {0x0163}}},
- {0x0164, {1|F|D, {0x0165}}},
- {0x0166, {1|F|D, {0x0167}}},
- {0x0168, {1|F|D, {0x0169}}},
- {0x016a, {1|F|D, {0x016b}}},
- {0x016c, {1|F|D, {0x016d}}},
- {0x016e, {1|F|D, {0x016f}}},
- {0x0170, {1|F|D, {0x0171}}},
- {0x0172, {1|F|D, {0x0173}}},
- {0x0174, {1|F|D, {0x0175}}},
- {0x0176, {1|F|D, {0x0177}}},
- {0x0178, {1|F|D, {0x00ff}}},
- {0x0179, {1|F|D, {0x017a}}},
- {0x017b, {1|F|D, {0x017c}}},
- {0x017d, {1|F|D, {0x017e}}},
- {0x017f, {1|F|SU|I(7), {0x0073}}},
- {0x0181, {1|F|D, {0x0253}}},
- {0x0182, {1|F|D, {0x0183}}},
- {0x0184, {1|F|D, {0x0185}}},
- {0x0186, {1|F|D, {0x0254}}},
- {0x0187, {1|F|D, {0x0188}}},
- {0x0189, {1|F|D, {0x0256}}},
- {0x018a, {1|F|D, {0x0257}}},
- {0x018b, {1|F|D, {0x018c}}},
- {0x018e, {1|F|D, {0x01dd}}},
- {0x018f, {1|F|D, {0x0259}}},
- {0x0190, {1|F|D, {0x025b}}},
- {0x0191, {1|F|D, {0x0192}}},
- {0x0193, {1|F|D, {0x0260}}},
- {0x0194, {1|F|D, {0x0263}}},
- {0x0196, {1|F|D, {0x0269}}},
- {0x0197, {1|F|D, {0x0268}}},
- {0x0198, {1|F|D, {0x0199}}},
- {0x019c, {1|F|D, {0x026f}}},
- {0x019d, {1|F|D, {0x0272}}},
- {0x019f, {1|F|D, {0x0275}}},
- {0x01a0, {1|F|D, {0x01a1}}},
- {0x01a2, {1|F|D, {0x01a3}}},
- {0x01a4, {1|F|D, {0x01a5}}},
- {0x01a6, {1|F|D, {0x0280}}},
- {0x01a7, {1|F|D, {0x01a8}}},
- {0x01a9, {1|F|D, {0x0283}}},
- {0x01ac, {1|F|D, {0x01ad}}},
- {0x01ae, {1|F|D, {0x0288}}},
- {0x01af, {1|F|D, {0x01b0}}},
- {0x01b1, {1|F|D, {0x028a}}},
- {0x01b2, {1|F|D, {0x028b}}},
- {0x01b3, {1|F|D, {0x01b4}}},
- {0x01b5, {1|F|D, {0x01b6}}},
- {0x01b7, {1|F|D, {0x0292}}},
- {0x01b8, {1|F|D, {0x01b9}}},
- {0x01bc, {1|F|D, {0x01bd}}},
- {0x01c4, {1|F|D|ST|I(8), {0x01c6}}},
- {0x01c5, {1|F|D|IT|SU|I(9), {0x01c6}}},
- {0x01c7, {1|F|D|ST|I(12), {0x01c9}}},
- {0x01c8, {1|F|D|IT|SU|I(13), {0x01c9}}},
- {0x01ca, {1|F|D|ST|I(16), {0x01cc}}},
- {0x01cb, {1|F|D|IT|SU|I(17), {0x01cc}}},
- {0x01cd, {1|F|D, {0x01ce}}},
- {0x01cf, {1|F|D, {0x01d0}}},
- {0x01d1, {1|F|D, {0x01d2}}},
- {0x01d3, {1|F|D, {0x01d4}}},
- {0x01d5, {1|F|D, {0x01d6}}},
- {0x01d7, {1|F|D, {0x01d8}}},
- {0x01d9, {1|F|D, {0x01da}}},
- {0x01db, {1|F|D, {0x01dc}}},
- {0x01de, {1|F|D, {0x01df}}},
- {0x01e0, {1|F|D, {0x01e1}}},
- {0x01e2, {1|F|D, {0x01e3}}},
- {0x01e4, {1|F|D, {0x01e5}}},
- {0x01e6, {1|F|D, {0x01e7}}},
- {0x01e8, {1|F|D, {0x01e9}}},
- {0x01ea, {1|F|D, {0x01eb}}},
- {0x01ec, {1|F|D, {0x01ed}}},
- {0x01ee, {1|F|D, {0x01ef}}},
- {0x01f0, {2|F|SU|I(20), {0x006a, 0x030c}}},
- {0x01f1, {1|F|D|ST|I(22), {0x01f3}}},
- {0x01f2, {1|F|D|IT|SU|I(23), {0x01f3}}},
- {0x01f4, {1|F|D, {0x01f5}}},
- {0x01f6, {1|F|D, {0x0195}}},
- {0x01f7, {1|F|D, {0x01bf}}},
- {0x01f8, {1|F|D, {0x01f9}}},
- {0x01fa, {1|F|D, {0x01fb}}},
- {0x01fc, {1|F|D, {0x01fd}}},
- {0x01fe, {1|F|D, {0x01ff}}},
- {0x0200, {1|F|D, {0x0201}}},
- {0x0202, {1|F|D, {0x0203}}},
- {0x0204, {1|F|D, {0x0205}}},
- {0x0206, {1|F|D, {0x0207}}},
- {0x0208, {1|F|D, {0x0209}}},
- {0x020a, {1|F|D, {0x020b}}},
- {0x020c, {1|F|D, {0x020d}}},
- {0x020e, {1|F|D, {0x020f}}},
- {0x0210, {1|F|D, {0x0211}}},
- {0x0212, {1|F|D, {0x0213}}},
- {0x0214, {1|F|D, {0x0215}}},
- {0x0216, {1|F|D, {0x0217}}},
- {0x0218, {1|F|D, {0x0219}}},
- {0x021a, {1|F|D, {0x021b}}},
- {0x021c, {1|F|D, {0x021d}}},
- {0x021e, {1|F|D, {0x021f}}},
- {0x0220, {1|F|D, {0x019e}}},
- {0x0222, {1|F|D, {0x0223}}},
- {0x0224, {1|F|D, {0x0225}}},
- {0x0226, {1|F|D, {0x0227}}},
- {0x0228, {1|F|D, {0x0229}}},
- {0x022a, {1|F|D, {0x022b}}},
- {0x022c, {1|F|D, {0x022d}}},
- {0x022e, {1|F|D, {0x022f}}},
- {0x0230, {1|F|D, {0x0231}}},
- {0x0232, {1|F|D, {0x0233}}},
- {0x023a, {1|F|D, {0x2c65}}},
- {0x023b, {1|F|D, {0x023c}}},
- {0x023d, {1|F|D, {0x019a}}},
- {0x023e, {1|F|D, {0x2c66}}},
- {0x0241, {1|F|D, {0x0242}}},
- {0x0243, {1|F|D, {0x0180}}},
- {0x0244, {1|F|D, {0x0289}}},
- {0x0245, {1|F|D, {0x028c}}},
- {0x0246, {1|F|D, {0x0247}}},
- {0x0248, {1|F|D, {0x0249}}},
- {0x024a, {1|F|D, {0x024b}}},
- {0x024c, {1|F|D, {0x024d}}},
- {0x024e, {1|F|D, {0x024f}}},
- {0x0345, {1|F|SU|I(26), {0x03b9}}},
- {0x0370, {1|F|D, {0x0371}}},
- {0x0372, {1|F|D, {0x0373}}},
- {0x0376, {1|F|D, {0x0377}}},
- {0x037f, {1|F|D, {0x03f3}}},
- {0x0386, {1|F|D, {0x03ac}}},
- {0x0388, {1|F|D, {0x03ad}}},
- {0x0389, {1|F|D, {0x03ae}}},
- {0x038a, {1|F|D, {0x03af}}},
- {0x038c, {1|F|D, {0x03cc}}},
- {0x038e, {1|F|D, {0x03cd}}},
- {0x038f, {1|F|D, {0x03ce}}},
- {0x0390, {3|F|SU|I(27), {0x03b9, 0x0308, 0x0301}}},
- {0x0391, {1|F|D, {0x03b1}}},
- {0x0392, {1|F|D, {0x03b2}}},
- {0x0393, {1|F|D, {0x03b3}}},
- {0x0394, {1|F|D, {0x03b4}}},
- {0x0395, {1|F|D, {0x03b5}}},
- {0x0396, {1|F|D, {0x03b6}}},
- {0x0397, {1|F|D, {0x03b7}}},
- {0x0398, {1|F|D, {0x03b8}}},
- {0x0399, {1|F|D, {0x03b9}}},
- {0x039a, {1|F|D, {0x03ba}}},
- {0x039b, {1|F|D, {0x03bb}}},
- {0x039c, {1|F|D, {0x03bc}}},
- {0x039d, {1|F|D, {0x03bd}}},
- {0x039e, {1|F|D, {0x03be}}},
- {0x039f, {1|F|D, {0x03bf}}},
- {0x03a0, {1|F|D, {0x03c0}}},
- {0x03a1, {1|F|D, {0x03c1}}},
- {0x03a3, {1|F|D, {0x03c3}}},
- {0x03a4, {1|F|D, {0x03c4}}},
- {0x03a5, {1|F|D, {0x03c5}}},
- {0x03a6, {1|F|D, {0x03c6}}},
- {0x03a7, {1|F|D, {0x03c7}}},
- {0x03a8, {1|F|D, {0x03c8}}},
- {0x03a9, {1|F|D, {0x03c9}}},
- {0x03aa, {1|F|D, {0x03ca}}},
- {0x03ab, {1|F|D, {0x03cb}}},
- {0x03b0, {3|F|SU|I(30), {0x03c5, 0x0308, 0x0301}}},
- {0x03c2, {1|F|SU|I(33), {0x03c3}}},
- {0x03cf, {1|F|D, {0x03d7}}},
- {0x03d0, {1|F|SU|I(34), {0x03b2}}},
- {0x03d1, {1|F|SU|I(35), {0x03b8}}},
- {0x03d5, {1|F|SU|I(36), {0x03c6}}},
- {0x03d6, {1|F|SU|I(37), {0x03c0}}},
- {0x03d8, {1|F|D, {0x03d9}}},
- {0x03da, {1|F|D, {0x03db}}},
- {0x03dc, {1|F|D, {0x03dd}}},
- {0x03de, {1|F|D, {0x03df}}},
- {0x03e0, {1|F|D, {0x03e1}}},
- {0x03e2, {1|F|D, {0x03e3}}},
- {0x03e4, {1|F|D, {0x03e5}}},
- {0x03e6, {1|F|D, {0x03e7}}},
- {0x03e8, {1|F|D, {0x03e9}}},
- {0x03ea, {1|F|D, {0x03eb}}},
- {0x03ec, {1|F|D, {0x03ed}}},
- {0x03ee, {1|F|D, {0x03ef}}},
- {0x03f0, {1|F|SU|I(38), {0x03ba}}},
- {0x03f1, {1|F|SU|I(39), {0x03c1}}},
- {0x03f4, {1|F|D, {0x03b8}}},
- {0x03f5, {1|F|SU|I(40), {0x03b5}}},
- {0x03f7, {1|F|D, {0x03f8}}},
- {0x03f9, {1|F|D, {0x03f2}}},
- {0x03fa, {1|F|D, {0x03fb}}},
- {0x03fd, {1|F|D, {0x037b}}},
- {0x03fe, {1|F|D, {0x037c}}},
- {0x03ff, {1|F|D, {0x037d}}},
- {0x0400, {1|F|D, {0x0450}}},
- {0x0401, {1|F|D, {0x0451}}},
- {0x0402, {1|F|D, {0x0452}}},
- {0x0403, {1|F|D, {0x0453}}},
- {0x0404, {1|F|D, {0x0454}}},
- {0x0405, {1|F|D, {0x0455}}},
- {0x0406, {1|F|D, {0x0456}}},
- {0x0407, {1|F|D, {0x0457}}},
- {0x0408, {1|F|D, {0x0458}}},
- {0x0409, {1|F|D, {0x0459}}},
- {0x040a, {1|F|D, {0x045a}}},
- {0x040b, {1|F|D, {0x045b}}},
- {0x040c, {1|F|D, {0x045c}}},
- {0x040d, {1|F|D, {0x045d}}},
- {0x040e, {1|F|D, {0x045e}}},
- {0x040f, {1|F|D, {0x045f}}},
- {0x0410, {1|F|D, {0x0430}}},
- {0x0411, {1|F|D, {0x0431}}},
- {0x0412, {1|F|D, {0x0432}}},
- {0x0413, {1|F|D, {0x0433}}},
- {0x0414, {1|F|D, {0x0434}}},
- {0x0415, {1|F|D, {0x0435}}},
- {0x0416, {1|F|D, {0x0436}}},
- {0x0417, {1|F|D, {0x0437}}},
- {0x0418, {1|F|D, {0x0438}}},
- {0x0419, {1|F|D, {0x0439}}},
- {0x041a, {1|F|D, {0x043a}}},
- {0x041b, {1|F|D, {0x043b}}},
- {0x041c, {1|F|D, {0x043c}}},
- {0x041d, {1|F|D, {0x043d}}},
- {0x041e, {1|F|D, {0x043e}}},
- {0x041f, {1|F|D, {0x043f}}},
- {0x0420, {1|F|D, {0x0440}}},
- {0x0421, {1|F|D, {0x0441}}},
- {0x0422, {1|F|D, {0x0442}}},
- {0x0423, {1|F|D, {0x0443}}},
- {0x0424, {1|F|D, {0x0444}}},
- {0x0425, {1|F|D, {0x0445}}},
- {0x0426, {1|F|D, {0x0446}}},
- {0x0427, {1|F|D, {0x0447}}},
- {0x0428, {1|F|D, {0x0448}}},
- {0x0429, {1|F|D, {0x0449}}},
- {0x042a, {1|F|D, {0x044a}}},
- {0x042b, {1|F|D, {0x044b}}},
- {0x042c, {1|F|D, {0x044c}}},
- {0x042d, {1|F|D, {0x044d}}},
- {0x042e, {1|F|D, {0x044e}}},
- {0x042f, {1|F|D, {0x044f}}},
- {0x0460, {1|F|D, {0x0461}}},
- {0x0462, {1|F|D, {0x0463}}},
- {0x0464, {1|F|D, {0x0465}}},
- {0x0466, {1|F|D, {0x0467}}},
- {0x0468, {1|F|D, {0x0469}}},
- {0x046a, {1|F|D, {0x046b}}},
- {0x046c, {1|F|D, {0x046d}}},
- {0x046e, {1|F|D, {0x046f}}},
- {0x0470, {1|F|D, {0x0471}}},
- {0x0472, {1|F|D, {0x0473}}},
- {0x0474, {1|F|D, {0x0475}}},
- {0x0476, {1|F|D, {0x0477}}},
- {0x0478, {1|F|D, {0x0479}}},
- {0x047a, {1|F|D, {0x047b}}},
- {0x047c, {1|F|D, {0x047d}}},
- {0x047e, {1|F|D, {0x047f}}},
- {0x0480, {1|F|D, {0x0481}}},
- {0x048a, {1|F|D, {0x048b}}},
- {0x048c, {1|F|D, {0x048d}}},
- {0x048e, {1|F|D, {0x048f}}},
- {0x0490, {1|F|D, {0x0491}}},
- {0x0492, {1|F|D, {0x0493}}},
- {0x0494, {1|F|D, {0x0495}}},
- {0x0496, {1|F|D, {0x0497}}},
- {0x0498, {1|F|D, {0x0499}}},
- {0x049a, {1|F|D, {0x049b}}},
- {0x049c, {1|F|D, {0x049d}}},
- {0x049e, {1|F|D, {0x049f}}},
- {0x04a0, {1|F|D, {0x04a1}}},
- {0x04a2, {1|F|D, {0x04a3}}},
- {0x04a4, {1|F|D, {0x04a5}}},
- {0x04a6, {1|F|D, {0x04a7}}},
- {0x04a8, {1|F|D, {0x04a9}}},
- {0x04aa, {1|F|D, {0x04ab}}},
- {0x04ac, {1|F|D, {0x04ad}}},
- {0x04ae, {1|F|D, {0x04af}}},
- {0x04b0, {1|F|D, {0x04b1}}},
- {0x04b2, {1|F|D, {0x04b3}}},
- {0x04b4, {1|F|D, {0x04b5}}},
- {0x04b6, {1|F|D, {0x04b7}}},
- {0x04b8, {1|F|D, {0x04b9}}},
- {0x04ba, {1|F|D, {0x04bb}}},
- {0x04bc, {1|F|D, {0x04bd}}},
- {0x04be, {1|F|D, {0x04bf}}},
- {0x04c0, {1|F|D, {0x04cf}}},
- {0x04c1, {1|F|D, {0x04c2}}},
- {0x04c3, {1|F|D, {0x04c4}}},
- {0x04c5, {1|F|D, {0x04c6}}},
- {0x04c7, {1|F|D, {0x04c8}}},
- {0x04c9, {1|F|D, {0x04ca}}},
- {0x04cb, {1|F|D, {0x04cc}}},
- {0x04cd, {1|F|D, {0x04ce}}},
- {0x04d0, {1|F|D, {0x04d1}}},
- {0x04d2, {1|F|D, {0x04d3}}},
- {0x04d4, {1|F|D, {0x04d5}}},
- {0x04d6, {1|F|D, {0x04d7}}},
- {0x04d8, {1|F|D, {0x04d9}}},
- {0x04da, {1|F|D, {0x04db}}},
- {0x04dc, {1|F|D, {0x04dd}}},
- {0x04de, {1|F|D, {0x04df}}},
- {0x04e0, {1|F|D, {0x04e1}}},
- {0x04e2, {1|F|D, {0x04e3}}},
- {0x04e4, {1|F|D, {0x04e5}}},
- {0x04e6, {1|F|D, {0x04e7}}},
- {0x04e8, {1|F|D, {0x04e9}}},
- {0x04ea, {1|F|D, {0x04eb}}},
- {0x04ec, {1|F|D, {0x04ed}}},
- {0x04ee, {1|F|D, {0x04ef}}},
- {0x04f0, {1|F|D, {0x04f1}}},
- {0x04f2, {1|F|D, {0x04f3}}},
- {0x04f4, {1|F|D, {0x04f5}}},
- {0x04f6, {1|F|D, {0x04f7}}},
- {0x04f8, {1|F|D, {0x04f9}}},
- {0x04fa, {1|F|D, {0x04fb}}},
- {0x04fc, {1|F|D, {0x04fd}}},
- {0x04fe, {1|F|D, {0x04ff}}},
- {0x0500, {1|F|D, {0x0501}}},
- {0x0502, {1|F|D, {0x0503}}},
- {0x0504, {1|F|D, {0x0505}}},
- {0x0506, {1|F|D, {0x0507}}},
- {0x0508, {1|F|D, {0x0509}}},
- {0x050a, {1|F|D, {0x050b}}},
- {0x050c, {1|F|D, {0x050d}}},
- {0x050e, {1|F|D, {0x050f}}},
- {0x0510, {1|F|D, {0x0511}}},
- {0x0512, {1|F|D, {0x0513}}},
- {0x0514, {1|F|D, {0x0515}}},
- {0x0516, {1|F|D, {0x0517}}},
- {0x0518, {1|F|D, {0x0519}}},
- {0x051a, {1|F|D, {0x051b}}},
- {0x051c, {1|F|D, {0x051d}}},
- {0x051e, {1|F|D, {0x051f}}},
- {0x0520, {1|F|D, {0x0521}}},
- {0x0522, {1|F|D, {0x0523}}},
- {0x0524, {1|F|D, {0x0525}}},
- {0x0526, {1|F|D, {0x0527}}},
- {0x0528, {1|F|D, {0x0529}}},
- {0x052a, {1|F|D, {0x052b}}},
- {0x052c, {1|F|D, {0x052d}}},
- {0x052e, {1|F|D, {0x052f}}},
- {0x0531, {1|F|D, {0x0561}}},
- {0x0532, {1|F|D, {0x0562}}},
- {0x0533, {1|F|D, {0x0563}}},
- {0x0534, {1|F|D, {0x0564}}},
- {0x0535, {1|F|D, {0x0565}}},
- {0x0536, {1|F|D, {0x0566}}},
- {0x0537, {1|F|D, {0x0567}}},
- {0x0538, {1|F|D, {0x0568}}},
- {0x0539, {1|F|D, {0x0569}}},
- {0x053a, {1|F|D, {0x056a}}},
- {0x053b, {1|F|D, {0x056b}}},
- {0x053c, {1|F|D, {0x056c}}},
- {0x053d, {1|F|D, {0x056d}}},
- {0x053e, {1|F|D, {0x056e}}},
- {0x053f, {1|F|D, {0x056f}}},
- {0x0540, {1|F|D, {0x0570}}},
- {0x0541, {1|F|D, {0x0571}}},
- {0x0542, {1|F|D, {0x0572}}},
- {0x0543, {1|F|D, {0x0573}}},
- {0x0544, {1|F|D, {0x0574}}},
- {0x0545, {1|F|D, {0x0575}}},
- {0x0546, {1|F|D, {0x0576}}},
- {0x0547, {1|F|D, {0x0577}}},
- {0x0548, {1|F|D, {0x0578}}},
- {0x0549, {1|F|D, {0x0579}}},
- {0x054a, {1|F|D, {0x057a}}},
- {0x054b, {1|F|D, {0x057b}}},
- {0x054c, {1|F|D, {0x057c}}},
- {0x054d, {1|F|D, {0x057d}}},
- {0x054e, {1|F|D, {0x057e}}},
- {0x054f, {1|F|D, {0x057f}}},
- {0x0550, {1|F|D, {0x0580}}},
- {0x0551, {1|F|D, {0x0581}}},
- {0x0552, {1|F|D, {0x0582}}},
- {0x0553, {1|F|D, {0x0583}}},
- {0x0554, {1|F|D, {0x0584}}},
- {0x0555, {1|F|D, {0x0585}}},
- {0x0556, {1|F|D, {0x0586}}},
- {0x0587, {2|F|ST|SU|I(41), {0x0565, 0x0582}}},
- {0x10a0, {1|F|D, {0x2d00}}},
- {0x10a1, {1|F|D, {0x2d01}}},
- {0x10a2, {1|F|D, {0x2d02}}},
- {0x10a3, {1|F|D, {0x2d03}}},
- {0x10a4, {1|F|D, {0x2d04}}},
- {0x10a5, {1|F|D, {0x2d05}}},
- {0x10a6, {1|F|D, {0x2d06}}},
- {0x10a7, {1|F|D, {0x2d07}}},
- {0x10a8, {1|F|D, {0x2d08}}},
- {0x10a9, {1|F|D, {0x2d09}}},
- {0x10aa, {1|F|D, {0x2d0a}}},
- {0x10ab, {1|F|D, {0x2d0b}}},
- {0x10ac, {1|F|D, {0x2d0c}}},
- {0x10ad, {1|F|D, {0x2d0d}}},
- {0x10ae, {1|F|D, {0x2d0e}}},
- {0x10af, {1|F|D, {0x2d0f}}},
- {0x10b0, {1|F|D, {0x2d10}}},
- {0x10b1, {1|F|D, {0x2d11}}},
- {0x10b2, {1|F|D, {0x2d12}}},
- {0x10b3, {1|F|D, {0x2d13}}},
- {0x10b4, {1|F|D, {0x2d14}}},
- {0x10b5, {1|F|D, {0x2d15}}},
- {0x10b6, {1|F|D, {0x2d16}}},
- {0x10b7, {1|F|D, {0x2d17}}},
- {0x10b8, {1|F|D, {0x2d18}}},
- {0x10b9, {1|F|D, {0x2d19}}},
- {0x10ba, {1|F|D, {0x2d1a}}},
- {0x10bb, {1|F|D, {0x2d1b}}},
- {0x10bc, {1|F|D, {0x2d1c}}},
- {0x10bd, {1|F|D, {0x2d1d}}},
- {0x10be, {1|F|D, {0x2d1e}}},
- {0x10bf, {1|F|D, {0x2d1f}}},
- {0x10c0, {1|F|D, {0x2d20}}},
- {0x10c1, {1|F|D, {0x2d21}}},
- {0x10c2, {1|F|D, {0x2d22}}},
- {0x10c3, {1|F|D, {0x2d23}}},
- {0x10c4, {1|F|D, {0x2d24}}},
- {0x10c5, {1|F|D, {0x2d25}}},
- {0x10c7, {1|F|D, {0x2d27}}},
- {0x10cd, {1|F|D, {0x2d2d}}},
- {0x13f8, {1|F|U, {0x13f0}}},
- {0x13f9, {1|F|U, {0x13f1}}},
- {0x13fa, {1|F|U, {0x13f2}}},
- {0x13fb, {1|F|U, {0x13f3}}},
- {0x13fc, {1|F|U, {0x13f4}}},
- {0x13fd, {1|F|U, {0x13f5}}},
- {0x1c80, {1|F|SU|I(45), {0x0432}}},
- {0x1c81, {1|F|SU|I(46), {0x0434}}},
- {0x1c82, {1|F|SU|I(47), {0x043e}}},
- {0x1c83, {1|F|SU|I(48), {0x0441}}},
- {0x1c84, {1|F|SU|I(49), {0x0442}}},
- {0x1c85, {1|F|SU|I(50), {0x0442}}},
- {0x1c86, {1|F|SU|I(51), {0x044a}}},
- {0x1c87, {1|F|SU|I(52), {0x0463}}},
- {0x1c88, {1|F|SU|I(53), {0xa64b}}},
- {0x1e00, {1|F|D, {0x1e01}}},
- {0x1e02, {1|F|D, {0x1e03}}},
- {0x1e04, {1|F|D, {0x1e05}}},
- {0x1e06, {1|F|D, {0x1e07}}},
- {0x1e08, {1|F|D, {0x1e09}}},
- {0x1e0a, {1|F|D, {0x1e0b}}},
- {0x1e0c, {1|F|D, {0x1e0d}}},
- {0x1e0e, {1|F|D, {0x1e0f}}},
- {0x1e10, {1|F|D, {0x1e11}}},
- {0x1e12, {1|F|D, {0x1e13}}},
- {0x1e14, {1|F|D, {0x1e15}}},
- {0x1e16, {1|F|D, {0x1e17}}},
- {0x1e18, {1|F|D, {0x1e19}}},
- {0x1e1a, {1|F|D, {0x1e1b}}},
- {0x1e1c, {1|F|D, {0x1e1d}}},
- {0x1e1e, {1|F|D, {0x1e1f}}},
- {0x1e20, {1|F|D, {0x1e21}}},
- {0x1e22, {1|F|D, {0x1e23}}},
- {0x1e24, {1|F|D, {0x1e25}}},
- {0x1e26, {1|F|D, {0x1e27}}},
- {0x1e28, {1|F|D, {0x1e29}}},
- {0x1e2a, {1|F|D, {0x1e2b}}},
- {0x1e2c, {1|F|D, {0x1e2d}}},
- {0x1e2e, {1|F|D, {0x1e2f}}},
- {0x1e30, {1|F|D, {0x1e31}}},
- {0x1e32, {1|F|D, {0x1e33}}},
- {0x1e34, {1|F|D, {0x1e35}}},
- {0x1e36, {1|F|D, {0x1e37}}},
- {0x1e38, {1|F|D, {0x1e39}}},
- {0x1e3a, {1|F|D, {0x1e3b}}},
- {0x1e3c, {1|F|D, {0x1e3d}}},
- {0x1e3e, {1|F|D, {0x1e3f}}},
- {0x1e40, {1|F|D, {0x1e41}}},
- {0x1e42, {1|F|D, {0x1e43}}},
- {0x1e44, {1|F|D, {0x1e45}}},
- {0x1e46, {1|F|D, {0x1e47}}},
- {0x1e48, {1|F|D, {0x1e49}}},
- {0x1e4a, {1|F|D, {0x1e4b}}},
- {0x1e4c, {1|F|D, {0x1e4d}}},
- {0x1e4e, {1|F|D, {0x1e4f}}},
- {0x1e50, {1|F|D, {0x1e51}}},
- {0x1e52, {1|F|D, {0x1e53}}},
- {0x1e54, {1|F|D, {0x1e55}}},
- {0x1e56, {1|F|D, {0x1e57}}},
- {0x1e58, {1|F|D, {0x1e59}}},
- {0x1e5a, {1|F|D, {0x1e5b}}},
- {0x1e5c, {1|F|D, {0x1e5d}}},
- {0x1e5e, {1|F|D, {0x1e5f}}},
- {0x1e60, {1|F|D, {0x1e61}}},
- {0x1e62, {1|F|D, {0x1e63}}},
- {0x1e64, {1|F|D, {0x1e65}}},
- {0x1e66, {1|F|D, {0x1e67}}},
- {0x1e68, {1|F|D, {0x1e69}}},
- {0x1e6a, {1|F|D, {0x1e6b}}},
- {0x1e6c, {1|F|D, {0x1e6d}}},
- {0x1e6e, {1|F|D, {0x1e6f}}},
- {0x1e70, {1|F|D, {0x1e71}}},
- {0x1e72, {1|F|D, {0x1e73}}},
- {0x1e74, {1|F|D, {0x1e75}}},
- {0x1e76, {1|F|D, {0x1e77}}},
- {0x1e78, {1|F|D, {0x1e79}}},
- {0x1e7a, {1|F|D, {0x1e7b}}},
- {0x1e7c, {1|F|D, {0x1e7d}}},
- {0x1e7e, {1|F|D, {0x1e7f}}},
- {0x1e80, {1|F|D, {0x1e81}}},
- {0x1e82, {1|F|D, {0x1e83}}},
- {0x1e84, {1|F|D, {0x1e85}}},
- {0x1e86, {1|F|D, {0x1e87}}},
- {0x1e88, {1|F|D, {0x1e89}}},
- {0x1e8a, {1|F|D, {0x1e8b}}},
- {0x1e8c, {1|F|D, {0x1e8d}}},
- {0x1e8e, {1|F|D, {0x1e8f}}},
- {0x1e90, {1|F|D, {0x1e91}}},
- {0x1e92, {1|F|D, {0x1e93}}},
- {0x1e94, {1|F|D, {0x1e95}}},
- {0x1e96, {2|F|SU|I(54), {0x0068, 0x0331}}},
- {0x1e97, {2|F|SU|I(56), {0x0074, 0x0308}}},
- {0x1e98, {2|F|SU|I(58), {0x0077, 0x030a}}},
- {0x1e99, {2|F|SU|I(60), {0x0079, 0x030a}}},
- {0x1e9a, {2|F|SU|I(62), {0x0061, 0x02be}}},
- {0x1e9b, {1|F|SU|I(64), {0x1e61}}},
- {0x1e9e, {2|F|SL|I(65), {0x0073, 0x0073}}},
- {0x1ea0, {1|F|D, {0x1ea1}}},
- {0x1ea2, {1|F|D, {0x1ea3}}},
- {0x1ea4, {1|F|D, {0x1ea5}}},
- {0x1ea6, {1|F|D, {0x1ea7}}},
- {0x1ea8, {1|F|D, {0x1ea9}}},
- {0x1eaa, {1|F|D, {0x1eab}}},
- {0x1eac, {1|F|D, {0x1ead}}},
- {0x1eae, {1|F|D, {0x1eaf}}},
- {0x1eb0, {1|F|D, {0x1eb1}}},
- {0x1eb2, {1|F|D, {0x1eb3}}},
- {0x1eb4, {1|F|D, {0x1eb5}}},
- {0x1eb6, {1|F|D, {0x1eb7}}},
- {0x1eb8, {1|F|D, {0x1eb9}}},
- {0x1eba, {1|F|D, {0x1ebb}}},
- {0x1ebc, {1|F|D, {0x1ebd}}},
- {0x1ebe, {1|F|D, {0x1ebf}}},
- {0x1ec0, {1|F|D, {0x1ec1}}},
- {0x1ec2, {1|F|D, {0x1ec3}}},
- {0x1ec4, {1|F|D, {0x1ec5}}},
- {0x1ec6, {1|F|D, {0x1ec7}}},
- {0x1ec8, {1|F|D, {0x1ec9}}},
- {0x1eca, {1|F|D, {0x1ecb}}},
- {0x1ecc, {1|F|D, {0x1ecd}}},
- {0x1ece, {1|F|D, {0x1ecf}}},
- {0x1ed0, {1|F|D, {0x1ed1}}},
- {0x1ed2, {1|F|D, {0x1ed3}}},
- {0x1ed4, {1|F|D, {0x1ed5}}},
- {0x1ed6, {1|F|D, {0x1ed7}}},
- {0x1ed8, {1|F|D, {0x1ed9}}},
- {0x1eda, {1|F|D, {0x1edb}}},
- {0x1edc, {1|F|D, {0x1edd}}},
- {0x1ede, {1|F|D, {0x1edf}}},
- {0x1ee0, {1|F|D, {0x1ee1}}},
- {0x1ee2, {1|F|D, {0x1ee3}}},
- {0x1ee4, {1|F|D, {0x1ee5}}},
- {0x1ee6, {1|F|D, {0x1ee7}}},
- {0x1ee8, {1|F|D, {0x1ee9}}},
- {0x1eea, {1|F|D, {0x1eeb}}},
- {0x1eec, {1|F|D, {0x1eed}}},
- {0x1eee, {1|F|D, {0x1eef}}},
- {0x1ef0, {1|F|D, {0x1ef1}}},
- {0x1ef2, {1|F|D, {0x1ef3}}},
- {0x1ef4, {1|F|D, {0x1ef5}}},
- {0x1ef6, {1|F|D, {0x1ef7}}},
- {0x1ef8, {1|F|D, {0x1ef9}}},
- {0x1efa, {1|F|D, {0x1efb}}},
- {0x1efc, {1|F|D, {0x1efd}}},
- {0x1efe, {1|F|D, {0x1eff}}},
- {0x1f08, {1|F|D, {0x1f00}}},
- {0x1f09, {1|F|D, {0x1f01}}},
- {0x1f0a, {1|F|D, {0x1f02}}},
- {0x1f0b, {1|F|D, {0x1f03}}},
- {0x1f0c, {1|F|D, {0x1f04}}},
- {0x1f0d, {1|F|D, {0x1f05}}},
- {0x1f0e, {1|F|D, {0x1f06}}},
- {0x1f0f, {1|F|D, {0x1f07}}},
- {0x1f18, {1|F|D, {0x1f10}}},
- {0x1f19, {1|F|D, {0x1f11}}},
- {0x1f1a, {1|F|D, {0x1f12}}},
- {0x1f1b, {1|F|D, {0x1f13}}},
- {0x1f1c, {1|F|D, {0x1f14}}},
- {0x1f1d, {1|F|D, {0x1f15}}},
- {0x1f28, {1|F|D, {0x1f20}}},
- {0x1f29, {1|F|D, {0x1f21}}},
- {0x1f2a, {1|F|D, {0x1f22}}},
- {0x1f2b, {1|F|D, {0x1f23}}},
- {0x1f2c, {1|F|D, {0x1f24}}},
- {0x1f2d, {1|F|D, {0x1f25}}},
- {0x1f2e, {1|F|D, {0x1f26}}},
- {0x1f2f, {1|F|D, {0x1f27}}},
- {0x1f38, {1|F|D, {0x1f30}}},
- {0x1f39, {1|F|D, {0x1f31}}},
- {0x1f3a, {1|F|D, {0x1f32}}},
- {0x1f3b, {1|F|D, {0x1f33}}},
- {0x1f3c, {1|F|D, {0x1f34}}},
- {0x1f3d, {1|F|D, {0x1f35}}},
- {0x1f3e, {1|F|D, {0x1f36}}},
- {0x1f3f, {1|F|D, {0x1f37}}},
- {0x1f48, {1|F|D, {0x1f40}}},
- {0x1f49, {1|F|D, {0x1f41}}},
- {0x1f4a, {1|F|D, {0x1f42}}},
- {0x1f4b, {1|F|D, {0x1f43}}},
- {0x1f4c, {1|F|D, {0x1f44}}},
- {0x1f4d, {1|F|D, {0x1f45}}},
- {0x1f50, {2|F|SU|I(66), {0x03c5, 0x0313}}},
- {0x1f52, {3|F|SU|I(68), {0x03c5, 0x0313, 0x0300}}},
- {0x1f54, {3|F|SU|I(71), {0x03c5, 0x0313, 0x0301}}},
- {0x1f56, {3|F|SU|I(74), {0x03c5, 0x0313, 0x0342}}},
- {0x1f59, {1|F|D, {0x1f51}}},
- {0x1f5b, {1|F|D, {0x1f53}}},
- {0x1f5d, {1|F|D, {0x1f55}}},
- {0x1f5f, {1|F|D, {0x1f57}}},
- {0x1f68, {1|F|D, {0x1f60}}},
- {0x1f69, {1|F|D, {0x1f61}}},
- {0x1f6a, {1|F|D, {0x1f62}}},
- {0x1f6b, {1|F|D, {0x1f63}}},
- {0x1f6c, {1|F|D, {0x1f64}}},
- {0x1f6d, {1|F|D, {0x1f65}}},
- {0x1f6e, {1|F|D, {0x1f66}}},
- {0x1f6f, {1|F|D, {0x1f67}}},
- {0x1f80, {2|F|ST|SU|I(77), {0x1f00, 0x03b9}}},
- {0x1f81, {2|F|ST|SU|I(80), {0x1f01, 0x03b9}}},
- {0x1f82, {2|F|ST|SU|I(83), {0x1f02, 0x03b9}}},
- {0x1f83, {2|F|ST|SU|I(86), {0x1f03, 0x03b9}}},
- {0x1f84, {2|F|ST|SU|I(89), {0x1f04, 0x03b9}}},
- {0x1f85, {2|F|ST|SU|I(92), {0x1f05, 0x03b9}}},
- {0x1f86, {2|F|ST|SU|I(95), {0x1f06, 0x03b9}}},
- {0x1f87, {2|F|ST|SU|I(98), {0x1f07, 0x03b9}}},
- {0x1f88, {2|F|IT|SL|SU|I(101), {0x1f00, 0x03b9}}},
- {0x1f89, {2|F|IT|SL|SU|I(106), {0x1f01, 0x03b9}}},
- {0x1f8a, {2|F|IT|SL|SU|I(111), {0x1f02, 0x03b9}}},
- {0x1f8b, {2|F|IT|SL|SU|I(116), {0x1f03, 0x03b9}}},
- {0x1f8c, {2|F|IT|SL|SU|I(121), {0x1f04, 0x03b9}}},
- {0x1f8d, {2|F|IT|SL|SU|I(126), {0x1f05, 0x03b9}}},
- {0x1f8e, {2|F|IT|SL|SU|I(131), {0x1f06, 0x03b9}}},
- {0x1f8f, {2|F|IT|SL|SU|I(136), {0x1f07, 0x03b9}}},
- {0x1f90, {2|F|ST|SU|I(141), {0x1f20, 0x03b9}}},
- {0x1f91, {2|F|ST|SU|I(144), {0x1f21, 0x03b9}}},
- {0x1f92, {2|F|ST|SU|I(147), {0x1f22, 0x03b9}}},
- {0x1f93, {2|F|ST|SU|I(150), {0x1f23, 0x03b9}}},
- {0x1f94, {2|F|ST|SU|I(153), {0x1f24, 0x03b9}}},
- {0x1f95, {2|F|ST|SU|I(156), {0x1f25, 0x03b9}}},
- {0x1f96, {2|F|ST|SU|I(159), {0x1f26, 0x03b9}}},
- {0x1f97, {2|F|ST|SU|I(162), {0x1f27, 0x03b9}}},
- {0x1f98, {2|F|IT|SL|SU|I(165), {0x1f20, 0x03b9}}},
- {0x1f99, {2|F|IT|SL|SU|I(170), {0x1f21, 0x03b9}}},
- {0x1f9a, {2|F|IT|SL|SU|I(175), {0x1f22, 0x03b9}}},
- {0x1f9b, {2|F|IT|SL|SU|I(180), {0x1f23, 0x03b9}}},
- {0x1f9c, {2|F|IT|SL|SU|I(185), {0x1f24, 0x03b9}}},
- {0x1f9d, {2|F|IT|SL|SU|I(190), {0x1f25, 0x03b9}}},
- {0x1f9e, {2|F|IT|SL|SU|I(195), {0x1f26, 0x03b9}}},
- {0x1f9f, {2|F|IT|SL|SU|I(200), {0x1f27, 0x03b9}}},
- {0x1fa0, {2|F|ST|SU|I(205), {0x1f60, 0x03b9}}},
- {0x1fa1, {2|F|ST|SU|I(208), {0x1f61, 0x03b9}}},
- {0x1fa2, {2|F|ST|SU|I(211), {0x1f62, 0x03b9}}},
- {0x1fa3, {2|F|ST|SU|I(214), {0x1f63, 0x03b9}}},
- {0x1fa4, {2|F|ST|SU|I(217), {0x1f64, 0x03b9}}},
- {0x1fa5, {2|F|ST|SU|I(220), {0x1f65, 0x03b9}}},
- {0x1fa6, {2|F|ST|SU|I(223), {0x1f66, 0x03b9}}},
- {0x1fa7, {2|F|ST|SU|I(226), {0x1f67, 0x03b9}}},
- {0x1fa8, {2|F|IT|SL|SU|I(229), {0x1f60, 0x03b9}}},
- {0x1fa9, {2|F|IT|SL|SU|I(234), {0x1f61, 0x03b9}}},
- {0x1faa, {2|F|IT|SL|SU|I(239), {0x1f62, 0x03b9}}},
- {0x1fab, {2|F|IT|SL|SU|I(244), {0x1f63, 0x03b9}}},
- {0x1fac, {2|F|IT|SL|SU|I(249), {0x1f64, 0x03b9}}},
- {0x1fad, {2|F|IT|SL|SU|I(254), {0x1f65, 0x03b9}}},
- {0x1fae, {2|F|IT|SL|SU|I(259), {0x1f66, 0x03b9}}},
- {0x1faf, {2|F|IT|SL|SU|I(264), {0x1f67, 0x03b9}}},
- {0x1fb2, {2|F|ST|SU|I(269), {0x1f70, 0x03b9}}},
- {0x1fb3, {2|F|ST|SU|I(273), {0x03b1, 0x03b9}}},
- {0x1fb4, {2|F|ST|SU|I(276), {0x03ac, 0x03b9}}},
- {0x1fb6, {2|F|SU|I(280), {0x03b1, 0x0342}}},
- {0x1fb7, {3|F|ST|SU|I(282), {0x03b1, 0x0342, 0x03b9}}},
- {0x1fb8, {1|F|D, {0x1fb0}}},
- {0x1fb9, {1|F|D, {0x1fb1}}},
- {0x1fba, {1|F|D, {0x1f70}}},
- {0x1fbb, {1|F|D, {0x1f71}}},
- {0x1fbc, {2|F|IT|SL|SU|I(288), {0x03b1, 0x03b9}}},
- {0x1fbe, {1|F|SU|I(293), {0x03b9}}},
- {0x1fc2, {2|F|ST|SU|I(294), {0x1f74, 0x03b9}}},
- {0x1fc3, {2|F|ST|SU|I(298), {0x03b7, 0x03b9}}},
- {0x1fc4, {2|F|ST|SU|I(301), {0x03ae, 0x03b9}}},
- {0x1fc6, {2|F|SU|I(305), {0x03b7, 0x0342}}},
- {0x1fc7, {3|F|ST|SU|I(307), {0x03b7, 0x0342, 0x03b9}}},
- {0x1fc8, {1|F|D, {0x1f72}}},
- {0x1fc9, {1|F|D, {0x1f73}}},
- {0x1fca, {1|F|D, {0x1f74}}},
- {0x1fcb, {1|F|D, {0x1f75}}},
- {0x1fcc, {2|F|IT|SL|SU|I(313), {0x03b7, 0x03b9}}},
- {0x1fd2, {3|F|SU|I(318), {0x03b9, 0x0308, 0x0300}}},
- {0x1fd3, {3|F|SU|I(321), {0x03b9, 0x0308, 0x0301}}},
- {0x1fd6, {2|F|SU|I(324), {0x03b9, 0x0342}}},
- {0x1fd7, {3|F|SU|I(326), {0x03b9, 0x0308, 0x0342}}},
- {0x1fd8, {1|F|D, {0x1fd0}}},
- {0x1fd9, {1|F|D, {0x1fd1}}},
- {0x1fda, {1|F|D, {0x1f76}}},
- {0x1fdb, {1|F|D, {0x1f77}}},
- {0x1fe2, {3|F|SU|I(329), {0x03c5, 0x0308, 0x0300}}},
- {0x1fe3, {3|F|SU|I(332), {0x03c5, 0x0308, 0x0301}}},
- {0x1fe4, {2|F|SU|I(335), {0x03c1, 0x0313}}},
- {0x1fe6, {2|F|SU|I(337), {0x03c5, 0x0342}}},
- {0x1fe7, {3|F|SU|I(339), {0x03c5, 0x0308, 0x0342}}},
- {0x1fe8, {1|F|D, {0x1fe0}}},
- {0x1fe9, {1|F|D, {0x1fe1}}},
- {0x1fea, {1|F|D, {0x1f7a}}},
- {0x1feb, {1|F|D, {0x1f7b}}},
- {0x1fec, {1|F|D, {0x1fe5}}},
- {0x1ff2, {2|F|ST|SU|I(342), {0x1f7c, 0x03b9}}},
- {0x1ff3, {2|F|ST|SU|I(346), {0x03c9, 0x03b9}}},
- {0x1ff4, {2|F|ST|SU|I(349), {0x03ce, 0x03b9}}},
- {0x1ff6, {2|F|SU|I(353), {0x03c9, 0x0342}}},
- {0x1ff7, {3|F|ST|SU|I(355), {0x03c9, 0x0342, 0x03b9}}},
- {0x1ff8, {1|F|D, {0x1f78}}},
- {0x1ff9, {1|F|D, {0x1f79}}},
- {0x1ffa, {1|F|D, {0x1f7c}}},
- {0x1ffb, {1|F|D, {0x1f7d}}},
- {0x1ffc, {2|F|IT|SL|SU|I(361), {0x03c9, 0x03b9}}},
- {0x2126, {1|F|D, {0x03c9}}},
- {0x212a, {1|F|D, {0x006b}}},
- {0x212b, {1|F|D, {0x00e5}}},
- {0x2132, {1|F|D, {0x214e}}},
- {0x2160, {1|F|D, {0x2170}}},
- {0x2161, {1|F|D, {0x2171}}},
- {0x2162, {1|F|D, {0x2172}}},
- {0x2163, {1|F|D, {0x2173}}},
- {0x2164, {1|F|D, {0x2174}}},
- {0x2165, {1|F|D, {0x2175}}},
- {0x2166, {1|F|D, {0x2176}}},
- {0x2167, {1|F|D, {0x2177}}},
- {0x2168, {1|F|D, {0x2178}}},
- {0x2169, {1|F|D, {0x2179}}},
- {0x216a, {1|F|D, {0x217a}}},
- {0x216b, {1|F|D, {0x217b}}},
- {0x216c, {1|F|D, {0x217c}}},
- {0x216d, {1|F|D, {0x217d}}},
- {0x216e, {1|F|D, {0x217e}}},
- {0x216f, {1|F|D, {0x217f}}},
- {0x2183, {1|F|D, {0x2184}}},
- {0x24b6, {1|F|D, {0x24d0}}},
- {0x24b7, {1|F|D, {0x24d1}}},
- {0x24b8, {1|F|D, {0x24d2}}},
- {0x24b9, {1|F|D, {0x24d3}}},
- {0x24ba, {1|F|D, {0x24d4}}},
- {0x24bb, {1|F|D, {0x24d5}}},
- {0x24bc, {1|F|D, {0x24d6}}},
- {0x24bd, {1|F|D, {0x24d7}}},
- {0x24be, {1|F|D, {0x24d8}}},
- {0x24bf, {1|F|D, {0x24d9}}},
- {0x24c0, {1|F|D, {0x24da}}},
- {0x24c1, {1|F|D, {0x24db}}},
- {0x24c2, {1|F|D, {0x24dc}}},
- {0x24c3, {1|F|D, {0x24dd}}},
- {0x24c4, {1|F|D, {0x24de}}},
- {0x24c5, {1|F|D, {0x24df}}},
- {0x24c6, {1|F|D, {0x24e0}}},
- {0x24c7, {1|F|D, {0x24e1}}},
- {0x24c8, {1|F|D, {0x24e2}}},
- {0x24c9, {1|F|D, {0x24e3}}},
- {0x24ca, {1|F|D, {0x24e4}}},
- {0x24cb, {1|F|D, {0x24e5}}},
- {0x24cc, {1|F|D, {0x24e6}}},
- {0x24cd, {1|F|D, {0x24e7}}},
- {0x24ce, {1|F|D, {0x24e8}}},
- {0x24cf, {1|F|D, {0x24e9}}},
- {0x2c00, {1|F|D, {0x2c30}}},
- {0x2c01, {1|F|D, {0x2c31}}},
- {0x2c02, {1|F|D, {0x2c32}}},
- {0x2c03, {1|F|D, {0x2c33}}},
- {0x2c04, {1|F|D, {0x2c34}}},
- {0x2c05, {1|F|D, {0x2c35}}},
- {0x2c06, {1|F|D, {0x2c36}}},
- {0x2c07, {1|F|D, {0x2c37}}},
- {0x2c08, {1|F|D, {0x2c38}}},
- {0x2c09, {1|F|D, {0x2c39}}},
- {0x2c0a, {1|F|D, {0x2c3a}}},
- {0x2c0b, {1|F|D, {0x2c3b}}},
- {0x2c0c, {1|F|D, {0x2c3c}}},
- {0x2c0d, {1|F|D, {0x2c3d}}},
- {0x2c0e, {1|F|D, {0x2c3e}}},
- {0x2c0f, {1|F|D, {0x2c3f}}},
- {0x2c10, {1|F|D, {0x2c40}}},
- {0x2c11, {1|F|D, {0x2c41}}},
- {0x2c12, {1|F|D, {0x2c42}}},
- {0x2c13, {1|F|D, {0x2c43}}},
- {0x2c14, {1|F|D, {0x2c44}}},
- {0x2c15, {1|F|D, {0x2c45}}},
- {0x2c16, {1|F|D, {0x2c46}}},
- {0x2c17, {1|F|D, {0x2c47}}},
- {0x2c18, {1|F|D, {0x2c48}}},
- {0x2c19, {1|F|D, {0x2c49}}},
- {0x2c1a, {1|F|D, {0x2c4a}}},
- {0x2c1b, {1|F|D, {0x2c4b}}},
- {0x2c1c, {1|F|D, {0x2c4c}}},
- {0x2c1d, {1|F|D, {0x2c4d}}},
- {0x2c1e, {1|F|D, {0x2c4e}}},
- {0x2c1f, {1|F|D, {0x2c4f}}},
- {0x2c20, {1|F|D, {0x2c50}}},
- {0x2c21, {1|F|D, {0x2c51}}},
- {0x2c22, {1|F|D, {0x2c52}}},
- {0x2c23, {1|F|D, {0x2c53}}},
- {0x2c24, {1|F|D, {0x2c54}}},
- {0x2c25, {1|F|D, {0x2c55}}},
- {0x2c26, {1|F|D, {0x2c56}}},
- {0x2c27, {1|F|D, {0x2c57}}},
- {0x2c28, {1|F|D, {0x2c58}}},
- {0x2c29, {1|F|D, {0x2c59}}},
- {0x2c2a, {1|F|D, {0x2c5a}}},
- {0x2c2b, {1|F|D, {0x2c5b}}},
- {0x2c2c, {1|F|D, {0x2c5c}}},
- {0x2c2d, {1|F|D, {0x2c5d}}},
- {0x2c2e, {1|F|D, {0x2c5e}}},
- {0x2c60, {1|F|D, {0x2c61}}},
- {0x2c62, {1|F|D, {0x026b}}},
- {0x2c63, {1|F|D, {0x1d7d}}},
- {0x2c64, {1|F|D, {0x027d}}},
- {0x2c67, {1|F|D, {0x2c68}}},
- {0x2c69, {1|F|D, {0x2c6a}}},
- {0x2c6b, {1|F|D, {0x2c6c}}},
- {0x2c6d, {1|F|D, {0x0251}}},
- {0x2c6e, {1|F|D, {0x0271}}},
- {0x2c6f, {1|F|D, {0x0250}}},
- {0x2c70, {1|F|D, {0x0252}}},
- {0x2c72, {1|F|D, {0x2c73}}},
- {0x2c75, {1|F|D, {0x2c76}}},
- {0x2c7e, {1|F|D, {0x023f}}},
- {0x2c7f, {1|F|D, {0x0240}}},
- {0x2c80, {1|F|D, {0x2c81}}},
- {0x2c82, {1|F|D, {0x2c83}}},
- {0x2c84, {1|F|D, {0x2c85}}},
- {0x2c86, {1|F|D, {0x2c87}}},
- {0x2c88, {1|F|D, {0x2c89}}},
- {0x2c8a, {1|F|D, {0x2c8b}}},
- {0x2c8c, {1|F|D, {0x2c8d}}},
- {0x2c8e, {1|F|D, {0x2c8f}}},
- {0x2c90, {1|F|D, {0x2c91}}},
- {0x2c92, {1|F|D, {0x2c93}}},
- {0x2c94, {1|F|D, {0x2c95}}},
- {0x2c96, {1|F|D, {0x2c97}}},
- {0x2c98, {1|F|D, {0x2c99}}},
- {0x2c9a, {1|F|D, {0x2c9b}}},
- {0x2c9c, {1|F|D, {0x2c9d}}},
- {0x2c9e, {1|F|D, {0x2c9f}}},
- {0x2ca0, {1|F|D, {0x2ca1}}},
- {0x2ca2, {1|F|D, {0x2ca3}}},
- {0x2ca4, {1|F|D, {0x2ca5}}},
- {0x2ca6, {1|F|D, {0x2ca7}}},
- {0x2ca8, {1|F|D, {0x2ca9}}},
- {0x2caa, {1|F|D, {0x2cab}}},
- {0x2cac, {1|F|D, {0x2cad}}},
- {0x2cae, {1|F|D, {0x2caf}}},
- {0x2cb0, {1|F|D, {0x2cb1}}},
- {0x2cb2, {1|F|D, {0x2cb3}}},
- {0x2cb4, {1|F|D, {0x2cb5}}},
- {0x2cb6, {1|F|D, {0x2cb7}}},
- {0x2cb8, {1|F|D, {0x2cb9}}},
- {0x2cba, {1|F|D, {0x2cbb}}},
- {0x2cbc, {1|F|D, {0x2cbd}}},
- {0x2cbe, {1|F|D, {0x2cbf}}},
- {0x2cc0, {1|F|D, {0x2cc1}}},
- {0x2cc2, {1|F|D, {0x2cc3}}},
- {0x2cc4, {1|F|D, {0x2cc5}}},
- {0x2cc6, {1|F|D, {0x2cc7}}},
- {0x2cc8, {1|F|D, {0x2cc9}}},
- {0x2cca, {1|F|D, {0x2ccb}}},
- {0x2ccc, {1|F|D, {0x2ccd}}},
- {0x2cce, {1|F|D, {0x2ccf}}},
- {0x2cd0, {1|F|D, {0x2cd1}}},
- {0x2cd2, {1|F|D, {0x2cd3}}},
- {0x2cd4, {1|F|D, {0x2cd5}}},
- {0x2cd6, {1|F|D, {0x2cd7}}},
- {0x2cd8, {1|F|D, {0x2cd9}}},
- {0x2cda, {1|F|D, {0x2cdb}}},
- {0x2cdc, {1|F|D, {0x2cdd}}},
- {0x2cde, {1|F|D, {0x2cdf}}},
- {0x2ce0, {1|F|D, {0x2ce1}}},
- {0x2ce2, {1|F|D, {0x2ce3}}},
- {0x2ceb, {1|F|D, {0x2cec}}},
- {0x2ced, {1|F|D, {0x2cee}}},
- {0x2cf2, {1|F|D, {0x2cf3}}},
- {0xa640, {1|F|D, {0xa641}}},
- {0xa642, {1|F|D, {0xa643}}},
- {0xa644, {1|F|D, {0xa645}}},
- {0xa646, {1|F|D, {0xa647}}},
- {0xa648, {1|F|D, {0xa649}}},
- {0xa64a, {1|F|D, {0xa64b}}},
- {0xa64c, {1|F|D, {0xa64d}}},
- {0xa64e, {1|F|D, {0xa64f}}},
- {0xa650, {1|F|D, {0xa651}}},
- {0xa652, {1|F|D, {0xa653}}},
- {0xa654, {1|F|D, {0xa655}}},
- {0xa656, {1|F|D, {0xa657}}},
- {0xa658, {1|F|D, {0xa659}}},
- {0xa65a, {1|F|D, {0xa65b}}},
- {0xa65c, {1|F|D, {0xa65d}}},
- {0xa65e, {1|F|D, {0xa65f}}},
- {0xa660, {1|F|D, {0xa661}}},
- {0xa662, {1|F|D, {0xa663}}},
- {0xa664, {1|F|D, {0xa665}}},
- {0xa666, {1|F|D, {0xa667}}},
- {0xa668, {1|F|D, {0xa669}}},
- {0xa66a, {1|F|D, {0xa66b}}},
- {0xa66c, {1|F|D, {0xa66d}}},
- {0xa680, {1|F|D, {0xa681}}},
- {0xa682, {1|F|D, {0xa683}}},
- {0xa684, {1|F|D, {0xa685}}},
- {0xa686, {1|F|D, {0xa687}}},
- {0xa688, {1|F|D, {0xa689}}},
- {0xa68a, {1|F|D, {0xa68b}}},
- {0xa68c, {1|F|D, {0xa68d}}},
- {0xa68e, {1|F|D, {0xa68f}}},
- {0xa690, {1|F|D, {0xa691}}},
- {0xa692, {1|F|D, {0xa693}}},
- {0xa694, {1|F|D, {0xa695}}},
- {0xa696, {1|F|D, {0xa697}}},
- {0xa698, {1|F|D, {0xa699}}},
- {0xa69a, {1|F|D, {0xa69b}}},
- {0xa722, {1|F|D, {0xa723}}},
- {0xa724, {1|F|D, {0xa725}}},
- {0xa726, {1|F|D, {0xa727}}},
- {0xa728, {1|F|D, {0xa729}}},
- {0xa72a, {1|F|D, {0xa72b}}},
- {0xa72c, {1|F|D, {0xa72d}}},
- {0xa72e, {1|F|D, {0xa72f}}},
- {0xa732, {1|F|D, {0xa733}}},
- {0xa734, {1|F|D, {0xa735}}},
- {0xa736, {1|F|D, {0xa737}}},
- {0xa738, {1|F|D, {0xa739}}},
- {0xa73a, {1|F|D, {0xa73b}}},
- {0xa73c, {1|F|D, {0xa73d}}},
- {0xa73e, {1|F|D, {0xa73f}}},
- {0xa740, {1|F|D, {0xa741}}},
- {0xa742, {1|F|D, {0xa743}}},
- {0xa744, {1|F|D, {0xa745}}},
- {0xa746, {1|F|D, {0xa747}}},
- {0xa748, {1|F|D, {0xa749}}},
- {0xa74a, {1|F|D, {0xa74b}}},
- {0xa74c, {1|F|D, {0xa74d}}},
- {0xa74e, {1|F|D, {0xa74f}}},
- {0xa750, {1|F|D, {0xa751}}},
- {0xa752, {1|F|D, {0xa753}}},
- {0xa754, {1|F|D, {0xa755}}},
- {0xa756, {1|F|D, {0xa757}}},
- {0xa758, {1|F|D, {0xa759}}},
- {0xa75a, {1|F|D, {0xa75b}}},
- {0xa75c, {1|F|D, {0xa75d}}},
- {0xa75e, {1|F|D, {0xa75f}}},
- {0xa760, {1|F|D, {0xa761}}},
- {0xa762, {1|F|D, {0xa763}}},
- {0xa764, {1|F|D, {0xa765}}},
- {0xa766, {1|F|D, {0xa767}}},
- {0xa768, {1|F|D, {0xa769}}},
- {0xa76a, {1|F|D, {0xa76b}}},
- {0xa76c, {1|F|D, {0xa76d}}},
- {0xa76e, {1|F|D, {0xa76f}}},
- {0xa779, {1|F|D, {0xa77a}}},
- {0xa77b, {1|F|D, {0xa77c}}},
- {0xa77d, {1|F|D, {0x1d79}}},
- {0xa77e, {1|F|D, {0xa77f}}},
- {0xa780, {1|F|D, {0xa781}}},
- {0xa782, {1|F|D, {0xa783}}},
- {0xa784, {1|F|D, {0xa785}}},
- {0xa786, {1|F|D, {0xa787}}},
- {0xa78b, {1|F|D, {0xa78c}}},
- {0xa78d, {1|F|D, {0x0265}}},
- {0xa790, {1|F|D, {0xa791}}},
- {0xa792, {1|F|D, {0xa793}}},
- {0xa796, {1|F|D, {0xa797}}},
- {0xa798, {1|F|D, {0xa799}}},
- {0xa79a, {1|F|D, {0xa79b}}},
- {0xa79c, {1|F|D, {0xa79d}}},
- {0xa79e, {1|F|D, {0xa79f}}},
- {0xa7a0, {1|F|D, {0xa7a1}}},
- {0xa7a2, {1|F|D, {0xa7a3}}},
- {0xa7a4, {1|F|D, {0xa7a5}}},
- {0xa7a6, {1|F|D, {0xa7a7}}},
- {0xa7a8, {1|F|D, {0xa7a9}}},
- {0xa7aa, {1|F|D, {0x0266}}},
- {0xa7ab, {1|F|D, {0x025c}}},
- {0xa7ac, {1|F|D, {0x0261}}},
- {0xa7ad, {1|F|D, {0x026c}}},
- {0xa7ae, {1|F|D, {0x026a}}},
- {0xa7b0, {1|F|D, {0x029e}}},
- {0xa7b1, {1|F|D, {0x0287}}},
- {0xa7b2, {1|F|D, {0x029d}}},
- {0xa7b3, {1|F|D, {0xab53}}},
- {0xa7b4, {1|F|D, {0xa7b5}}},
- {0xa7b6, {1|F|D, {0xa7b7}}},
- {0xab70, {1|F|U, {0x13a0}}},
- {0xab71, {1|F|U, {0x13a1}}},
- {0xab72, {1|F|U, {0x13a2}}},
- {0xab73, {1|F|U, {0x13a3}}},
- {0xab74, {1|F|U, {0x13a4}}},
- {0xab75, {1|F|U, {0x13a5}}},
- {0xab76, {1|F|U, {0x13a6}}},
- {0xab77, {1|F|U, {0x13a7}}},
- {0xab78, {1|F|U, {0x13a8}}},
- {0xab79, {1|F|U, {0x13a9}}},
- {0xab7a, {1|F|U, {0x13aa}}},
- {0xab7b, {1|F|U, {0x13ab}}},
- {0xab7c, {1|F|U, {0x13ac}}},
- {0xab7d, {1|F|U, {0x13ad}}},
- {0xab7e, {1|F|U, {0x13ae}}},
- {0xab7f, {1|F|U, {0x13af}}},
- {0xab80, {1|F|U, {0x13b0}}},
- {0xab81, {1|F|U, {0x13b1}}},
- {0xab82, {1|F|U, {0x13b2}}},
- {0xab83, {1|F|U, {0x13b3}}},
- {0xab84, {1|F|U, {0x13b4}}},
- {0xab85, {1|F|U, {0x13b5}}},
- {0xab86, {1|F|U, {0x13b6}}},
- {0xab87, {1|F|U, {0x13b7}}},
- {0xab88, {1|F|U, {0x13b8}}},
- {0xab89, {1|F|U, {0x13b9}}},
- {0xab8a, {1|F|U, {0x13ba}}},
- {0xab8b, {1|F|U, {0x13bb}}},
- {0xab8c, {1|F|U, {0x13bc}}},
- {0xab8d, {1|F|U, {0x13bd}}},
- {0xab8e, {1|F|U, {0x13be}}},
- {0xab8f, {1|F|U, {0x13bf}}},
- {0xab90, {1|F|U, {0x13c0}}},
- {0xab91, {1|F|U, {0x13c1}}},
- {0xab92, {1|F|U, {0x13c2}}},
- {0xab93, {1|F|U, {0x13c3}}},
- {0xab94, {1|F|U, {0x13c4}}},
- {0xab95, {1|F|U, {0x13c5}}},
- {0xab96, {1|F|U, {0x13c6}}},
- {0xab97, {1|F|U, {0x13c7}}},
- {0xab98, {1|F|U, {0x13c8}}},
- {0xab99, {1|F|U, {0x13c9}}},
- {0xab9a, {1|F|U, {0x13ca}}},
- {0xab9b, {1|F|U, {0x13cb}}},
- {0xab9c, {1|F|U, {0x13cc}}},
- {0xab9d, {1|F|U, {0x13cd}}},
- {0xab9e, {1|F|U, {0x13ce}}},
- {0xab9f, {1|F|U, {0x13cf}}},
- {0xaba0, {1|F|U, {0x13d0}}},
- {0xaba1, {1|F|U, {0x13d1}}},
- {0xaba2, {1|F|U, {0x13d2}}},
- {0xaba3, {1|F|U, {0x13d3}}},
- {0xaba4, {1|F|U, {0x13d4}}},
- {0xaba5, {1|F|U, {0x13d5}}},
- {0xaba6, {1|F|U, {0x13d6}}},
- {0xaba7, {1|F|U, {0x13d7}}},
- {0xaba8, {1|F|U, {0x13d8}}},
- {0xaba9, {1|F|U, {0x13d9}}},
- {0xabaa, {1|F|U, {0x13da}}},
- {0xabab, {1|F|U, {0x13db}}},
- {0xabac, {1|F|U, {0x13dc}}},
- {0xabad, {1|F|U, {0x13dd}}},
- {0xabae, {1|F|U, {0x13de}}},
- {0xabaf, {1|F|U, {0x13df}}},
- {0xabb0, {1|F|U, {0x13e0}}},
- {0xabb1, {1|F|U, {0x13e1}}},
- {0xabb2, {1|F|U, {0x13e2}}},
- {0xabb3, {1|F|U, {0x13e3}}},
- {0xabb4, {1|F|U, {0x13e4}}},
- {0xabb5, {1|F|U, {0x13e5}}},
- {0xabb6, {1|F|U, {0x13e6}}},
- {0xabb7, {1|F|U, {0x13e7}}},
- {0xabb8, {1|F|U, {0x13e8}}},
- {0xabb9, {1|F|U, {0x13e9}}},
- {0xabba, {1|F|U, {0x13ea}}},
- {0xabbb, {1|F|U, {0x13eb}}},
- {0xabbc, {1|F|U, {0x13ec}}},
- {0xabbd, {1|F|U, {0x13ed}}},
- {0xabbe, {1|F|U, {0x13ee}}},
- {0xabbf, {1|F|U, {0x13ef}}},
- {0xfb00, {2|F|ST|SU|I(366), {0x0066, 0x0066}}},
- {0xfb01, {2|F|ST|SU|I(370), {0x0066, 0x0069}}},
- {0xfb02, {2|F|ST|SU|I(374), {0x0066, 0x006c}}},
- {0xfb03, {3|F|ST|SU|I(378), {0x0066, 0x0066, 0x0069}}},
- {0xfb04, {3|F|ST|SU|I(384), {0x0066, 0x0066, 0x006c}}},
- {0xfb05, {2|F|ST|SU|I(390), {0x0073, 0x0074}}},
- {0xfb06, {2|F|ST|SU|I(394), {0x0073, 0x0074}}},
- {0xfb13, {2|F|ST|SU|I(398), {0x0574, 0x0576}}},
- {0xfb14, {2|F|ST|SU|I(402), {0x0574, 0x0565}}},
- {0xfb15, {2|F|ST|SU|I(406), {0x0574, 0x056b}}},
- {0xfb16, {2|F|ST|SU|I(410), {0x057e, 0x0576}}},
- {0xfb17, {2|F|ST|SU|I(414), {0x0574, 0x056d}}},
- {0xff21, {1|F|D, {0xff41}}},
- {0xff22, {1|F|D, {0xff42}}},
- {0xff23, {1|F|D, {0xff43}}},
- {0xff24, {1|F|D, {0xff44}}},
- {0xff25, {1|F|D, {0xff45}}},
- {0xff26, {1|F|D, {0xff46}}},
- {0xff27, {1|F|D, {0xff47}}},
- {0xff28, {1|F|D, {0xff48}}},
- {0xff29, {1|F|D, {0xff49}}},
- {0xff2a, {1|F|D, {0xff4a}}},
- {0xff2b, {1|F|D, {0xff4b}}},
- {0xff2c, {1|F|D, {0xff4c}}},
- {0xff2d, {1|F|D, {0xff4d}}},
- {0xff2e, {1|F|D, {0xff4e}}},
- {0xff2f, {1|F|D, {0xff4f}}},
- {0xff30, {1|F|D, {0xff50}}},
- {0xff31, {1|F|D, {0xff51}}},
- {0xff32, {1|F|D, {0xff52}}},
- {0xff33, {1|F|D, {0xff53}}},
- {0xff34, {1|F|D, {0xff54}}},
- {0xff35, {1|F|D, {0xff55}}},
- {0xff36, {1|F|D, {0xff56}}},
- {0xff37, {1|F|D, {0xff57}}},
- {0xff38, {1|F|D, {0xff58}}},
- {0xff39, {1|F|D, {0xff59}}},
- {0xff3a, {1|F|D, {0xff5a}}},
- {0x10400, {1|F|D, {0x10428}}},
- {0x10401, {1|F|D, {0x10429}}},
- {0x10402, {1|F|D, {0x1042a}}},
- {0x10403, {1|F|D, {0x1042b}}},
- {0x10404, {1|F|D, {0x1042c}}},
- {0x10405, {1|F|D, {0x1042d}}},
- {0x10406, {1|F|D, {0x1042e}}},
- {0x10407, {1|F|D, {0x1042f}}},
- {0x10408, {1|F|D, {0x10430}}},
- {0x10409, {1|F|D, {0x10431}}},
- {0x1040a, {1|F|D, {0x10432}}},
- {0x1040b, {1|F|D, {0x10433}}},
- {0x1040c, {1|F|D, {0x10434}}},
- {0x1040d, {1|F|D, {0x10435}}},
- {0x1040e, {1|F|D, {0x10436}}},
- {0x1040f, {1|F|D, {0x10437}}},
- {0x10410, {1|F|D, {0x10438}}},
- {0x10411, {1|F|D, {0x10439}}},
- {0x10412, {1|F|D, {0x1043a}}},
- {0x10413, {1|F|D, {0x1043b}}},
- {0x10414, {1|F|D, {0x1043c}}},
- {0x10415, {1|F|D, {0x1043d}}},
- {0x10416, {1|F|D, {0x1043e}}},
- {0x10417, {1|F|D, {0x1043f}}},
- {0x10418, {1|F|D, {0x10440}}},
- {0x10419, {1|F|D, {0x10441}}},
- {0x1041a, {1|F|D, {0x10442}}},
- {0x1041b, {1|F|D, {0x10443}}},
- {0x1041c, {1|F|D, {0x10444}}},
- {0x1041d, {1|F|D, {0x10445}}},
- {0x1041e, {1|F|D, {0x10446}}},
- {0x1041f, {1|F|D, {0x10447}}},
- {0x10420, {1|F|D, {0x10448}}},
- {0x10421, {1|F|D, {0x10449}}},
- {0x10422, {1|F|D, {0x1044a}}},
- {0x10423, {1|F|D, {0x1044b}}},
- {0x10424, {1|F|D, {0x1044c}}},
- {0x10425, {1|F|D, {0x1044d}}},
- {0x10426, {1|F|D, {0x1044e}}},
- {0x10427, {1|F|D, {0x1044f}}},
- {0x104b0, {1|F|D, {0x104d8}}},
- {0x104b1, {1|F|D, {0x104d9}}},
- {0x104b2, {1|F|D, {0x104da}}},
- {0x104b3, {1|F|D, {0x104db}}},
- {0x104b4, {1|F|D, {0x104dc}}},
- {0x104b5, {1|F|D, {0x104dd}}},
- {0x104b6, {1|F|D, {0x104de}}},
- {0x104b7, {1|F|D, {0x104df}}},
- {0x104b8, {1|F|D, {0x104e0}}},
- {0x104b9, {1|F|D, {0x104e1}}},
- {0x104ba, {1|F|D, {0x104e2}}},
- {0x104bb, {1|F|D, {0x104e3}}},
- {0x104bc, {1|F|D, {0x104e4}}},
- {0x104bd, {1|F|D, {0x104e5}}},
- {0x104be, {1|F|D, {0x104e6}}},
- {0x104bf, {1|F|D, {0x104e7}}},
- {0x104c0, {1|F|D, {0x104e8}}},
- {0x104c1, {1|F|D, {0x104e9}}},
- {0x104c2, {1|F|D, {0x104ea}}},
- {0x104c3, {1|F|D, {0x104eb}}},
- {0x104c4, {1|F|D, {0x104ec}}},
- {0x104c5, {1|F|D, {0x104ed}}},
- {0x104c6, {1|F|D, {0x104ee}}},
- {0x104c7, {1|F|D, {0x104ef}}},
- {0x104c8, {1|F|D, {0x104f0}}},
- {0x104c9, {1|F|D, {0x104f1}}},
- {0x104ca, {1|F|D, {0x104f2}}},
- {0x104cb, {1|F|D, {0x104f3}}},
- {0x104cc, {1|F|D, {0x104f4}}},
- {0x104cd, {1|F|D, {0x104f5}}},
- {0x104ce, {1|F|D, {0x104f6}}},
- {0x104cf, {1|F|D, {0x104f7}}},
- {0x104d0, {1|F|D, {0x104f8}}},
- {0x104d1, {1|F|D, {0x104f9}}},
- {0x104d2, {1|F|D, {0x104fa}}},
- {0x104d3, {1|F|D, {0x104fb}}},
- {0x10c80, {1|F|D, {0x10cc0}}},
- {0x10c81, {1|F|D, {0x10cc1}}},
- {0x10c82, {1|F|D, {0x10cc2}}},
- {0x10c83, {1|F|D, {0x10cc3}}},
- {0x10c84, {1|F|D, {0x10cc4}}},
- {0x10c85, {1|F|D, {0x10cc5}}},
- {0x10c86, {1|F|D, {0x10cc6}}},
- {0x10c87, {1|F|D, {0x10cc7}}},
- {0x10c88, {1|F|D, {0x10cc8}}},
- {0x10c89, {1|F|D, {0x10cc9}}},
- {0x10c8a, {1|F|D, {0x10cca}}},
- {0x10c8b, {1|F|D, {0x10ccb}}},
- {0x10c8c, {1|F|D, {0x10ccc}}},
- {0x10c8d, {1|F|D, {0x10ccd}}},
- {0x10c8e, {1|F|D, {0x10cce}}},
- {0x10c8f, {1|F|D, {0x10ccf}}},
- {0x10c90, {1|F|D, {0x10cd0}}},
- {0x10c91, {1|F|D, {0x10cd1}}},
- {0x10c92, {1|F|D, {0x10cd2}}},
- {0x10c93, {1|F|D, {0x10cd3}}},
- {0x10c94, {1|F|D, {0x10cd4}}},
- {0x10c95, {1|F|D, {0x10cd5}}},
- {0x10c96, {1|F|D, {0x10cd6}}},
- {0x10c97, {1|F|D, {0x10cd7}}},
- {0x10c98, {1|F|D, {0x10cd8}}},
- {0x10c99, {1|F|D, {0x10cd9}}},
- {0x10c9a, {1|F|D, {0x10cda}}},
- {0x10c9b, {1|F|D, {0x10cdb}}},
- {0x10c9c, {1|F|D, {0x10cdc}}},
- {0x10c9d, {1|F|D, {0x10cdd}}},
- {0x10c9e, {1|F|D, {0x10cde}}},
- {0x10c9f, {1|F|D, {0x10cdf}}},
- {0x10ca0, {1|F|D, {0x10ce0}}},
- {0x10ca1, {1|F|D, {0x10ce1}}},
- {0x10ca2, {1|F|D, {0x10ce2}}},
- {0x10ca3, {1|F|D, {0x10ce3}}},
- {0x10ca4, {1|F|D, {0x10ce4}}},
- {0x10ca5, {1|F|D, {0x10ce5}}},
- {0x10ca6, {1|F|D, {0x10ce6}}},
- {0x10ca7, {1|F|D, {0x10ce7}}},
- {0x10ca8, {1|F|D, {0x10ce8}}},
- {0x10ca9, {1|F|D, {0x10ce9}}},
- {0x10caa, {1|F|D, {0x10cea}}},
- {0x10cab, {1|F|D, {0x10ceb}}},
- {0x10cac, {1|F|D, {0x10cec}}},
- {0x10cad, {1|F|D, {0x10ced}}},
- {0x10cae, {1|F|D, {0x10cee}}},
- {0x10caf, {1|F|D, {0x10cef}}},
- {0x10cb0, {1|F|D, {0x10cf0}}},
- {0x10cb1, {1|F|D, {0x10cf1}}},
- {0x10cb2, {1|F|D, {0x10cf2}}},
- {0x118a0, {1|F|D, {0x118c0}}},
- {0x118a1, {1|F|D, {0x118c1}}},
- {0x118a2, {1|F|D, {0x118c2}}},
- {0x118a3, {1|F|D, {0x118c3}}},
- {0x118a4, {1|F|D, {0x118c4}}},
- {0x118a5, {1|F|D, {0x118c5}}},
- {0x118a6, {1|F|D, {0x118c6}}},
- {0x118a7, {1|F|D, {0x118c7}}},
- {0x118a8, {1|F|D, {0x118c8}}},
- {0x118a9, {1|F|D, {0x118c9}}},
- {0x118aa, {1|F|D, {0x118ca}}},
- {0x118ab, {1|F|D, {0x118cb}}},
- {0x118ac, {1|F|D, {0x118cc}}},
- {0x118ad, {1|F|D, {0x118cd}}},
- {0x118ae, {1|F|D, {0x118ce}}},
- {0x118af, {1|F|D, {0x118cf}}},
- {0x118b0, {1|F|D, {0x118d0}}},
- {0x118b1, {1|F|D, {0x118d1}}},
- {0x118b2, {1|F|D, {0x118d2}}},
- {0x118b3, {1|F|D, {0x118d3}}},
- {0x118b4, {1|F|D, {0x118d4}}},
- {0x118b5, {1|F|D, {0x118d5}}},
- {0x118b6, {1|F|D, {0x118d6}}},
- {0x118b7, {1|F|D, {0x118d7}}},
- {0x118b8, {1|F|D, {0x118d8}}},
- {0x118b9, {1|F|D, {0x118d9}}},
- {0x118ba, {1|F|D, {0x118da}}},
- {0x118bb, {1|F|D, {0x118db}}},
- {0x118bc, {1|F|D, {0x118dc}}},
- {0x118bd, {1|F|D, {0x118dd}}},
- {0x118be, {1|F|D, {0x118de}}},
- {0x118bf, {1|F|D, {0x118df}}},
- {0x1e900, {1|F|D, {0x1e922}}},
- {0x1e901, {1|F|D, {0x1e923}}},
- {0x1e902, {1|F|D, {0x1e924}}},
- {0x1e903, {1|F|D, {0x1e925}}},
- {0x1e904, {1|F|D, {0x1e926}}},
- {0x1e905, {1|F|D, {0x1e927}}},
- {0x1e906, {1|F|D, {0x1e928}}},
- {0x1e907, {1|F|D, {0x1e929}}},
- {0x1e908, {1|F|D, {0x1e92a}}},
- {0x1e909, {1|F|D, {0x1e92b}}},
- {0x1e90a, {1|F|D, {0x1e92c}}},
- {0x1e90b, {1|F|D, {0x1e92d}}},
- {0x1e90c, {1|F|D, {0x1e92e}}},
- {0x1e90d, {1|F|D, {0x1e92f}}},
- {0x1e90e, {1|F|D, {0x1e930}}},
- {0x1e90f, {1|F|D, {0x1e931}}},
- {0x1e910, {1|F|D, {0x1e932}}},
- {0x1e911, {1|F|D, {0x1e933}}},
- {0x1e912, {1|F|D, {0x1e934}}},
- {0x1e913, {1|F|D, {0x1e935}}},
- {0x1e914, {1|F|D, {0x1e936}}},
- {0x1e915, {1|F|D, {0x1e937}}},
- {0x1e916, {1|F|D, {0x1e938}}},
- {0x1e917, {1|F|D, {0x1e939}}},
- {0x1e918, {1|F|D, {0x1e93a}}},
- {0x1e919, {1|F|D, {0x1e93b}}},
- {0x1e91a, {1|F|D, {0x1e93c}}},
- {0x1e91b, {1|F|D, {0x1e93d}}},
- {0x1e91c, {1|F|D, {0x1e93e}}},
- {0x1e91d, {1|F|D, {0x1e93f}}},
- {0x1e91e, {1|F|D, {0x1e940}}},
- {0x1e91f, {1|F|D, {0x1e941}}},
- {0x1e920, {1|F|D, {0x1e942}}},
- {0x1e921, {1|F|D, {0x1e943}}},
-#define CaseFold_Locale (*(CaseFold_11_Type (*)[2])(CaseFold_11_Table+1399))
- {0x0049, {1|F|D, {0x0069}}},
- {0x0130, {2|F|D, {0x0069, 0x0307}}},
-};
-
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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 */
-
-/* maximum key range = 3623, duplicates = 0 */
-
-#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[] =
- {
- 1, 3627, 2, 28, 3, 303, 218, 5, 21, 167,
- 2, 199, 194, 7, 3627, 3627, 3627, 3627, 3627, 3627,
- 3627, 3627, 3627, 3627, 3627, 3627, 3627, 28, 3627, 3627,
- 3627, 3627, 3627, 3627, 3627, 282, 3627, 3627, 3627, 3627,
- 3627, 113, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 3627,
- 3627, 318, 3627, 3627, 3627, 3627, 3627, 3627, 3627, 1197,
- 3627, 3627, 149, 73, 513, 1, 3627, 3627, 267, 17,
- 3627, 3627, 3627, 3627, 3627, 286, 3627, 3627, 289, 617,
- 291, 28, 1163, 444, 36, 430, 954, 110, 1767, 5,
- 11, 22, 1761, 486, 1921, 250, 1746, 122, 1905, 163,
- 1716, 262, 1880, 80, 1503, 68, 1704, 157, 1681, 376,
- 1673, 209, 1822, 203, 1406, 498, 1622, 362, 1588, 316,
- 475, 599, 1228, 538, 1160, 585, 1510, 544, 331, 685,
- 1672, 603, 1536, 840, 1684, 786, 1594, 743, 1380, 700,
- 142, 839, 1302, 865, 1173, 1329, 1730, 1043, 1449, 969,
- 1437, 1108, 1360, 925, 1497, 723, 154, 810, 391, 1083,
- 1777, 1047, 436, 1051, 47, 1342, 8, 974, 98, 1318,
- 781, 1314, 148, 1403, 39, 1357, 18, 1265, 11, 928,
- 92, 1205, 2, 1295, 3, 1181, 187, 1151, 385, 1132,
- 107, 1280, 8, 1678, 41, 511, 42, 1655, 78, 294,
- 134, 1857, 17, 784, 2, 1113, 57, 496, 52
- };
- return asso_values[bits_of(code, 2)+81] + asso_values[bits_of(code, 1)+2] + asso_values[bits_of(code, 0)];
-}
-
-static const CodePointList3 *
-onigenc_unicode_CaseFold_11_lookup(const OnigCodePoint code)
-{
- enum
- {
- MIN_CODE_VALUE = 0x41,
- MAX_CODE_VALUE = 0x1e921,
- TOTAL_KEYWORDS = 1401,
- MIN_WORD_LENGTH = 3,
- MAX_WORD_LENGTH = 3,
- MIN_HASH_VALUE = 4,
- MAX_HASH_VALUE = 3626
- };
-
- static const short wordlist[] =
- {
- -1, -1, -1, -1,
- /*0x1ffb*/ 816,
- /*0x1fe7*/ 802,
- /*0x017b*/ 118,
- /*0x1f88*/ 729,
- /*0x0408*/ 305,
- /*0x0108*/ 61,
- /*0x10408*/ 1214,
- /*0x0055*/ 19,
- /*0xab88*/ 1112,
- /*0x1f89*/ 730,
- /*0x0409*/ 306,
- /*0x2c67*/ 916,
- /*0x10409*/ 1215,
- /*0x2c08*/ 873,
- /*0xab89*/ 1113,
- /*0x1ff9*/ 814,
- /*0x2c6f*/ 921,
- /*0x0179*/ 117,
- -1,
- /*0x2c09*/ 874,
- /*0x1f8a*/ 731,
- /*0x040a*/ 307,
- /*0x010a*/ 62,
- /*0x1040a*/ 1216,
- /*0x2c88*/ 931,
- /*0xab8a*/ 1114,
- /*0x1f80*/ 721,
- /*0x0400*/ 297,
- /*0x0100*/ 57,
- /*0x10400*/ 1206,
- /*0x2c0a*/ 875,
- /*0xab80*/ 1104,
- /*0x10c88*/ 1290,
- /*0x00d5*/ 47,
- /*0x1f83*/ 724,
- /*0x0403*/ 300,
- /*0x2c00*/ 865,
- /*0x10403*/ 1209,
- /*0x10c89*/ 1291,
- /*0xab83*/ 1107,
- /*0x1ff3*/ 809,
- /*0x2c8a*/ 932,
- /*0x1e908*/ 1373,
- /*0x00df*/ 56,
- /*0x2c03*/ 868,
- /*0x1fd3*/ 791,
- /*0x0053*/ 17,
- /*0x2c80*/ 927,
- /*0x1e909*/ 1374,
- /*0x10c8a*/ 1292,
- /*0x2183*/ 838,
- -1,
- /*0x017f*/ 120,
- -1,
- /*0xa780*/ 1059,
- /*0x10c80*/ 1282,
- -1,
- /*0x017d*/ 119,
- -1,
- /*0x1e90a*/ 1375,
- /*0x2c7f*/ 926,
- -1, -1,
- /*0x10c83*/ 1285,
- /*0x00dd*/ 54,
- /*0x1e900*/ 1365,
- /*0x1f98*/ 745,
- /*0x0418*/ 321,
- /*0x0118*/ 69,
- /*0x10418*/ 1230,
- /*0x037f*/ 233,
- /*0xab98*/ 1128,
- /*0x00d3*/ 45,
- /*0x1e903*/ 1368,
- -1,
- /*0x1e88*/ 607,
- /*0x2c18*/ 889,
- -1,
- /*0x1f96*/ 743,
- /*0x0416*/ 319,
- /*0x0116*/ 68,
- /*0x10416*/ 1228,
- -1,
- /*0xab96*/ 1126,
- -1, -1,
- /*0x2c75*/ 924,
- /*0x2c98*/ 939,
- /*0x2c16*/ 887,
- -1,
- /*0x1fe3*/ 799,
- -1,
- /*0x1e8a*/ 608,
- -1,
- /*0xa798*/ 1068,
- /*0x10c98*/ 1306,
- /*0x1fd7*/ 793,
- /*0x0057*/ 21,
- /*0x1e80*/ 603,
- /*0x2c96*/ 938,
- /*0x2c63*/ 914,
- -1, -1, -1, -1,
- /*0x1e918*/ 1389,
- /*0xa796*/ 1067,
- /*0x10c96*/ 1304,
- /*0x1f86*/ 727,
- /*0x0406*/ 303,
- /*0x0106*/ 60,
- /*0x10406*/ 1212,
- /*0x13fb*/ 527,
- /*0xab86*/ 1110,
- -1,
- /*0x2c6d*/ 919,
- -1,
- /*0x1e916*/ 1387,
- /*0x2c06*/ 871,
- -1,
- /*0x1f90*/ 737,
- /*0x0410*/ 313,
- /*0x0110*/ 65,
- /*0x10410*/ 1222,
- -1,
- /*0xab90*/ 1120,
- /*0x2ced*/ 978,
- /*0x13f9*/ 525,
- -1,
- /*0x2c86*/ 930,
- /*0x2c10*/ 881,
- -1,
- /*0x1ff7*/ 812,
- -1, -1, -1,
- /*0xa786*/ 1062,
- /*0x10c86*/ 1288,
- /*0x1e98*/ 616,
- -1,
- /*0x1fbb*/ 777,
- /*0x2c90*/ 935,
- /*0x013b*/ 85,
- -1, -1,
- /*0xabbb*/ 1163,
- /*0x1fdb*/ 797,
- /*0x1e906*/ 1371,
- /*0xa790*/ 1065,
- /*0x10c90*/ 1298,
- /*0x1e96*/ 614,
- /*0x1e08*/ 543,
- /*0x1fcb*/ 788,
- /*0x004b*/ 9,
- -1,
- /*0x1f9a*/ 747,
- /*0x041a*/ 323,
- /*0x011a*/ 70,
- /*0x1041a*/ 1232,
- /*0x1e910*/ 1381,
- /*0xab9a*/ 1130,
- /*0x1f92*/ 739,
- /*0x0412*/ 315,
- /*0x0112*/ 66,
- /*0x10412*/ 1224,
- /*0x2c1a*/ 891,
- /*0xab92*/ 1122,
- /*0x13fd*/ 529,
- /*0x1e0a*/ 544,
- /*0x0388*/ 235,
- -1,
- /*0x2c12*/ 883,
- /*0x03d5*/ 273,
- /*0x00db*/ 52,
- /*0x1e00*/ 539,
- /*0x0389*/ 236,
- /*0x2c9a*/ 940,
- -1, -1,
- /*0x00cb*/ 37,
- /*0x1e86*/ 606,
- /*0x03f9*/ 292,
- /*0x2c92*/ 936,
- /*0xa79a*/ 1069,
- /*0x10c9a*/ 1308,
- /*0x1fe9*/ 804,
- /*0x038a*/ 237,
- -1, -1,
- /*0xa792*/ 1066,
- /*0x10c92*/ 1300,
- -1,
- /*0x1e90*/ 611,
- -1,
- /*0x1e91a*/ 1391,
- /*0x2c69*/ 917,
- /*0x0508*/ 425,
- -1, -1,
- /*0x0555*/ 481,
- /*0x1e912*/ 1383,
- /*0x1fa0*/ 753,
- /*0x0420*/ 329,
- /*0x0120*/ 73,
- /*0x10420*/ 1238,
- /*0x03f1*/ 288,
- /*0xaba0*/ 1136,
- /*0x1f9e*/ 751,
- /*0x041e*/ 327,
- /*0x011e*/ 72,
- /*0x1041e*/ 1236,
- /*0x2c20*/ 897,
- /*0xab9e*/ 1134,
- /*0x050a*/ 426,
- /*0x1e18*/ 551,
- -1,
- /*0x03ff*/ 296,
- /*0x2c1e*/ 895,
- /*0x048a*/ 362,
- /*0x0500*/ 421,
- /*0x0208*/ 194,
- /*0x03fd*/ 294,
- /*0x2ca0*/ 943,
- -1,
- /*0x0480*/ 361,
- -1,
- /*0x1e16*/ 550,
- /*0x1e9a*/ 618,
- /*0x2c9e*/ 942,
- /*0xa7a0*/ 1072,
- /*0x10ca0*/ 1314,
- -1,
- /*0x0398*/ 249,
- /*0x1e92*/ 612,
- -1,
- /*0xa79e*/ 1071,
- /*0x10c9e*/ 1312,
- /*0x020a*/ 195,
- /*0x0553*/ 479,
- -1,
- /*0x1e920*/ 1397,
- -1,
- /*0x03f5*/ 290,
- /*0x0200*/ 190,
- /*0x0396*/ 247,
- /*0x104d3*/ 1281,
- /*0x1e91e*/ 1395,
- -1,
- /*0x1f8e*/ 735,
- /*0x040e*/ 311,
- /*0x010e*/ 64,
- /*0x1040e*/ 1220,
- -1,
- /*0xab8e*/ 1118,
- -1, -1,
- /*0x1e06*/ 542,
- -1,
- /*0x2c0e*/ 879,
- /*0x0518*/ 433,
- /*0x1f94*/ 741,
- /*0x0414*/ 317,
- /*0x0114*/ 67,
- /*0x10414*/ 1226,
- /*0x0498*/ 369,
- /*0xab94*/ 1124,
- /*0x2165*/ 827,
- /*0x2167*/ 829,
- /*0x1e10*/ 547,
- /*0x2c8e*/ 934,
- /*0x2c14*/ 885,
- /*0x0516*/ 432,
- /*0x216f*/ 837,
- /*0x1ea0*/ 621,
- /*0x0386*/ 234,
- /*0x2161*/ 823,
- /*0x0496*/ 368,
- /*0x10c8e*/ 1296,
- -1,
- /*0x1e9e*/ 620,
- -1,
- /*0x2c94*/ 937,
- -1,
- /*0x0218*/ 202,
- -1, -1,
- /*0x0390*/ 241,
- /*0x1e90e*/ 1379,
- -1,
- /*0x10c94*/ 1302,
- -1,
- /*0xa77b*/ 1056,
- /*0x1ff6*/ 811,
- /*0x0476*/ 356,
- /*0x0176*/ 115,
- /*0x0216*/ 201,
- -1, -1,
- /*0x03f7*/ 291,
- /*0x1e914*/ 1385,
- -1,
- /*0x0506*/ 424,
- -1,
- /*0x1e1a*/ 552,
- -1, -1,
- /*0xa779*/ 1055,
- -1,
- /*0x01d5*/ 167,
- /*0x1e12*/ 548,
- -1,
- /*0x0189*/ 126,
- /*0x0376*/ 232,
- /*0x0510*/ 429,
- /*0x1fa6*/ 759,
- /*0x0426*/ 335,
- /*0x0126*/ 76,
- /*0x10426*/ 1244,
- /*0x0490*/ 365,
- /*0xaba6*/ 1142,
- /*0x1e8e*/ 610,
- /*0x039a*/ 251,
- /*0x018a*/ 127,
- -1,
- /*0x2c26*/ 903,
- /*0x0206*/ 193,
- -1,
- /*0x0392*/ 243,
- -1,
- /*0x1faf*/ 768,
- /*0x042f*/ 344,
- -1,
- /*0x1e94*/ 613,
- /*0x053b*/ 455,
- /*0xabaf*/ 1151,
- /*0x2ca6*/ 946,
- -1,
- /*0x0210*/ 198,
- -1, -1,
- /*0x104bb*/ 1257,
- /*0x01f1*/ 181,
- /*0xa7a6*/ 1075,
- /*0x10ca6*/ 1320,
- -1,
- /*0x054b*/ 471,
- /*0xa77d*/ 1057,
- /*0x01d3*/ 166,
- /*0x051a*/ 434,
- /*0x1e20*/ 555,
- /*0x04cb*/ 395,
- -1,
- /*0x104cb*/ 1273,
- /*0x049a*/ 370,
- /*0x0512*/ 430,
- /*0x1e1e*/ 554,
- /*0x2163*/ 825,
- /*0x023b*/ 217,
- /*0x10caf*/ 1329,
- /*0x0492*/ 366,
- /*0x1fa4*/ 757,
- /*0x0424*/ 333,
- /*0x0124*/ 75,
- /*0x10424*/ 1242,
- /*0x1ef6*/ 664,
- /*0xaba4*/ 1140,
- -1,
- /*0x03a0*/ 257,
- /*0x0198*/ 137,
- -1,
- /*0x2c24*/ 901,
- /*0x216d*/ 835,
- /*0x021a*/ 203,
- /*0x039e*/ 255,
- /*0x1f9c*/ 749,
- /*0x041c*/ 325,
- /*0x011c*/ 71,
- /*0x1041c*/ 1234,
- /*0x0212*/ 199,
- /*0xab9c*/ 1132,
- /*0x0196*/ 135,
- /*0x2ca4*/ 945,
- -1,
- /*0x1feb*/ 806,
- /*0x2c1c*/ 893,
- -1,
- /*0x1ea6*/ 624,
- -1,
- /*0xa7a4*/ 1074,
- /*0x10ca4*/ 1318,
- /*0x004d*/ 11,
- -1, -1,
- /*0x2c6b*/ 918,
- /*0x0520*/ 437,
- /*0x2c9c*/ 941,
- /*0x1e0e*/ 546,
- -1,
- /*0x01d7*/ 168,
- /*0x04a0*/ 373,
- /*0x051e*/ 436,
- -1,
- /*0xa79c*/ 1070,
- /*0x10c9c*/ 1310,
- /*0x2ceb*/ 977,
- /*0x049e*/ 372,
- -1, -1,
- /*0x1e14*/ 549,
- -1,
- /*0x0186*/ 124,
- -1, -1,
- /*0x1e91c*/ 1393,
- /*0x038e*/ 239,
- -1,
- /*0x00cd*/ 39,
- -1,
- /*0x0220*/ 206,
- -1, -1,
- /*0x10bb*/ 511,
- /*0x0190*/ 131,
- -1,
- /*0x021e*/ 205,
- /*0x24bb*/ 844,
- /*0x0394*/ 245,
- -1,
- /*0x1f84*/ 725,
- /*0x0404*/ 301,
- /*0x0104*/ 59,
- /*0x10404*/ 1210,
- /*0x1ea4*/ 623,
- /*0xab84*/ 1108,
- /*0x01f7*/ 185,
- /*0x0051*/ 15,
- -1,
- /*0x24cb*/ 860,
- /*0x2c04*/ 869,
- -1,
- /*0x1e76*/ 598,
- /*0x050e*/ 428,
- /*0x1f82*/ 723,
- /*0x0402*/ 299,
- /*0x0102*/ 58,
- /*0x10402*/ 1208,
- /*0x048e*/ 364,
- /*0xab82*/ 1106,
- /*0x01db*/ 170,
- /*0x2c84*/ 929,
- -1,
- /*0x2169*/ 831,
- /*0x2c02*/ 867,
- /*0x0514*/ 431,
- /*0x01cb*/ 162,
- -1,
- /*0xa784*/ 1061,
- /*0x10c84*/ 1286,
- /*0x0494*/ 367,
- /*0x118bb*/ 1360,
- -1,
- /*0x00d1*/ 43,
- /*0x1e26*/ 558,
- /*0x2c82*/ 928,
- -1,
- /*0x020e*/ 197,
- -1,
- /*0x1e904*/ 1369,
- -1, -1,
- /*0xa782*/ 1060,
- /*0x10c82*/ 1284,
- -1,
- /*0x1fa7*/ 760,
- /*0x0427*/ 336,
- -1,
- /*0x10427*/ 1245,
- /*0x0214*/ 200,
- /*0xaba7*/ 1143,
- -1,
- /*0x03a6*/ 262,
- /*0x1e902*/ 1367,
- /*0x10a0*/ 484,
- /*0x2c27*/ 904,
- /*0x1f8c*/ 733,
- /*0x040c*/ 309,
- /*0x010c*/ 63,
- /*0x1040c*/ 1218,
- -1,
- /*0xab8c*/ 1116,
- /*0x04f6*/ 416,
- -1, -1, -1,
- /*0x2c0c*/ 877,
- /*0x047e*/ 360,
- /*0x1fa2*/ 755,
- /*0x0422*/ 331,
- /*0x0122*/ 74,
- /*0x10422*/ 1240,
- /*0x1e84*/ 605,
- /*0xaba2*/ 1138,
- /*0x10ca7*/ 1321,
- /*0x01a0*/ 141,
- /*0x2c7e*/ 925,
- /*0x2c8c*/ 933,
- /*0x2c22*/ 899,
- /*0x0526*/ 440,
- /*0x1e24*/ 557,
- /*0x1ff2*/ 808,
- /*0x0472*/ 354,
- /*0x0172*/ 113,
- /*0x04a6*/ 376,
- /*0x10c8c*/ 1294,
- /*0x1e82*/ 604,
- /*0x1f08*/ 669,
- -1,
- /*0x2ca2*/ 944,
- /*0x1f6f*/ 720,
- /*0x2c72*/ 923,
- /*0x118a0*/ 1333,
- /*0x1f09*/ 670,
- /*0x1e1c*/ 553,
- /*0x1e90c*/ 1377,
- /*0xa7a2*/ 1073,
- /*0x10ca2*/ 1316,
- /*0x03a4*/ 260,
- /*0xfb00*/ 1168,
- /*0x1f5f*/ 712,
- /*0x0372*/ 231,
- /*0x2cf2*/ 979,
- /*0x0226*/ 209,
- /*0x1f0a*/ 671,
- -1, -1,
- /*0xfb03*/ 1171,
- /*0x1faa*/ 763,
- /*0x042a*/ 339,
- /*0x012a*/ 78,
- -1,
- /*0x039c*/ 253,
- /*0xabaa*/ 1146,
- /*0x1fae*/ 767,
- /*0x042e*/ 343,
- /*0x012e*/ 80,
- -1,
- /*0x2c2a*/ 907,
- /*0xabae*/ 1150,
- -1,
- /*0x1f5d*/ 711,
- /*0x018e*/ 129,
- -1,
- /*0x2c2e*/ 911,
- /*0x0524*/ 439,
- -1, -1,
- /*0x1e8c*/ 609,
- /*0x2caa*/ 948,
- /*0x04a4*/ 375,
- -1, -1, -1,
- /*0x0194*/ 134,
- /*0x2cae*/ 950,
- /*0xa7aa*/ 1077,
- /*0x10caa*/ 1324,
- /*0x1efe*/ 668,
- /*0x051c*/ 435,
- /*0x1ea2*/ 622,
- -1,
- /*0xa7ae*/ 1081,
- /*0x10cae*/ 1328,
- /*0x049c*/ 371,
- -1, -1, -1,
- /*0x1e04*/ 541,
- /*0x0224*/ 208,
- /*0x1f18*/ 677,
- /*0xfb16*/ 1178,
- /*0x2126*/ 818,
- /*0x1ef2*/ 662,
- /*0x054d*/ 473,
- /*0x1fac*/ 765,
- /*0x042c*/ 341,
- /*0x012c*/ 79,
- -1,
- /*0x04cd*/ 396,
- /*0xabac*/ 1148,
- /*0x104cd*/ 1275,
- /*0x1e02*/ 540,
- /*0x021c*/ 204,
- -1,
- /*0x2c2c*/ 909,
- /*0x01f6*/ 184,
- /*0x10a6*/ 490,
- -1,
- /*0x1fa8*/ 761,
- /*0x0428*/ 337,
- /*0x0128*/ 77,
- /*0x03d1*/ 272,
- /*0x1fb2*/ 769,
- /*0xaba8*/ 1144,
- /*0x0132*/ 81,
- /*0x2cac*/ 949,
- /*0xa726*/ 1019,
- /*0xabb2*/ 1154,
- /*0x2c28*/ 905,
- /*0x1eaa*/ 626,
- /*0xfb06*/ 1174,
- /*0x10af*/ 499,
- /*0xa7ac*/ 1079,
- /*0x10cac*/ 1326,
- -1,
- /*0x1eae*/ 628,
- -1,
- /*0x01a6*/ 144,
- /*0x1f6d*/ 718,
- /*0x2ca8*/ 947,
- -1,
- /*0xa688*/ 1007,
- /*0x0504*/ 423,
- /*0x2cb2*/ 952,
- -1, -1,
- /*0xa7a8*/ 1076,
- /*0x10ca8*/ 1322,
- /*0x0551*/ 477,
- -1,
- /*0xa7b2*/ 1084,
- /*0x10cb2*/ 1332,
- /*0x01af*/ 149,
- /*0x1e0c*/ 545,
- /*0x118a6*/ 1339,
- /*0x104d1*/ 1279,
- /*0x0502*/ 422,
- -1,
- /*0xa68a*/ 1008,
- -1,
- /*0x03a7*/ 263,
- -1,
- /*0x10a4*/ 488,
- /*0x1e7e*/ 602,
- /*0xa680*/ 1003,
- /*0x1e22*/ 556,
- /*0x0204*/ 192,
- -1, -1,
- /*0x118af*/ 1348,
- /*0x216b*/ 833,
- /*0x038c*/ 238,
- /*0xa724*/ 1018,
- /*0x1f3b*/ 694,
- -1, -1,
- /*0x1eac*/ 627,
- -1,
- /*0x1e72*/ 596,
- /*0x1f5b*/ 710,
- /*0x0202*/ 191,
- /*0x03fe*/ 295,
- -1,
- /*0x01a4*/ 143,
- -1,
- /*0x1f4b*/ 702,
- -1, -1,
- /*0x1f1a*/ 679,
- -1,
- /*0x1ea8*/ 625,
- /*0x10cd*/ 523,
- /*0xff26*/ 1185,
- -1,
- /*0x1eb2*/ 630,
- /*0x24cd*/ 862,
- -1,
- /*0x019c*/ 138,
- /*0x050c*/ 427,
- -1,
- /*0x118a4*/ 1337,
- -1, -1,
- /*0x048c*/ 363,
- /*0xa698*/ 1015,
- /*0x1e2a*/ 560,
- /*0x0130*/ 1400,
- /*0xff2f*/ 1194,
- -1,
- /*0xabb0*/ 1152,
- /*0x0522*/ 438,
- /*0x1e2e*/ 562,
- /*0x01cd*/ 163,
- /*0x04fe*/ 420,
- -1,
- /*0x04a2*/ 374,
- /*0xa696*/ 1014,
- -1,
- /*0x1f69*/ 714,
- /*0x1fba*/ 776,
- -1, -1,
- /*0x020c*/ 196,
- /*0x03aa*/ 266,
- /*0xabba*/ 1162,
- /*0x2cb0*/ 951,
- -1, -1,
- /*0x04f2*/ 414,
- -1, -1, -1,
- /*0xa7b0*/ 1082,
- /*0x10cb0*/ 1330,
- /*0x0222*/ 207,
- -1, -1, -1,
- /*0xff24*/ 1183,
- -1,
- /*0x2cba*/ 956,
- -1,
- /*0x1fca*/ 787,
- /*0x004a*/ 8,
- /*0x014a*/ 93,
- -1,
- /*0xa686*/ 1006,
- -1, -1, -1,
- /*0x052a*/ 442,
- /*0x0184*/ 123,
- /*0x1e2c*/ 561,
- -1, -1,
- /*0x04aa*/ 378,
- /*0x052e*/ 444,
- /*0x01d1*/ 165,
- /*0xa690*/ 1011,
- -1, -1,
- /*0x04ae*/ 380,
- /*0x1fb8*/ 774,
- /*0x2cca*/ 964,
- -1,
- /*0x0182*/ 122,
- /*0x1e28*/ 559,
- /*0xabb8*/ 1160,
- -1,
- /*0x00ca*/ 36,
- /*0x1e32*/ 564,
- -1, -1, -1,
- /*0x022a*/ 211,
- /*0x10a7*/ 491,
- /*0x1eb0*/ 629,
- -1, -1, -1,
- /*0x022e*/ 213,
- /*0x1f0e*/ 675,
- /*0xfb14*/ 1176,
- /*0x2cb8*/ 955,
- /*0x03a8*/ 264,
- -1, -1, -1, -1, -1, -1,
- /*0x1eba*/ 634,
- -1,
- /*0xa69a*/ 1016,
- -1, -1,
- /*0x01a7*/ 145,
- /*0x052c*/ 443,
- /*0x10a2*/ 486,
- /*0xa692*/ 1012,
- /*0x1fd9*/ 795,
- /*0x0059*/ 23,
- /*0x04ac*/ 379,
- /*0x1ffa*/ 815,
- /*0x047a*/ 358,
- /*0x1fb6*/ 772,
- /*0xa77e*/ 1058,
- /*0x0136*/ 83,
- /*0xa722*/ 1017,
- -1,
- /*0xabb6*/ 1158,
- /*0x0528*/ 441,
- -1,
- /*0x118a7*/ 1340,
- /*0x1eca*/ 642,
- /*0x0532*/ 446,
- /*0x04a8*/ 377,
- /*0x01fe*/ 189,
- -1,
- /*0x01a2*/ 142,
- /*0x04b2*/ 382,
- /*0x022c*/ 212,
- /*0x104b2*/ 1248,
- /*0x212a*/ 819,
- -1, -1,
- /*0x2cb6*/ 954,
- /*0x00d9*/ 50,
- -1,
- /*0x1fcc*/ 789,
- /*0x004c*/ 10,
- /*0x014c*/ 94,
- /*0x01f2*/ 182,
- /*0xa7b6*/ 1087,
- /*0x1eb8*/ 633,
- /*0x0228*/ 210,
- /*0x118a2*/ 1335,
- -1,
- /*0x10aa*/ 494,
- /*0x0232*/ 215,
- -1, -1, -1, -1,
- /*0x10ae*/ 498,
- -1, -1, -1,
- /*0xa72a*/ 1021,
- -1,
- /*0x2ccc*/ 965,
- /*0xff27*/ 1186,
- /*0x1e30*/ 563,
- -1,
- /*0xa72e*/ 1023,
- -1,
- /*0x00cc*/ 38,
- -1,
- /*0x1fbc*/ 778,
- /*0x1fb4*/ 771,
- -1,
- /*0x0134*/ 82,
- /*0x1f2f*/ 690,
- /*0xabbc*/ 1164,
- /*0xabb4*/ 1156,
- /*0x01ae*/ 148,
- -1,
- /*0x1e3a*/ 568,
- -1, -1,
- /*0x03b0*/ 268,
- -1, -1, -1,
- /*0xff22*/ 1181,
- /*0x1efa*/ 666,
- /*0x118aa*/ 1343,
- /*0x1eb6*/ 632,
- -1,
- /*0x2cbc*/ 957,
- /*0x2cb4*/ 953,
- -1,
- /*0x118ae*/ 1347,
- -1,
- /*0x1fbe*/ 779,
- /*0x10ac*/ 496,
- /*0xa68e*/ 1010,
- /*0xa7b4*/ 1086,
- /*0x2132*/ 821,
- /*0xabbe*/ 1166,
- /*0x1e4a*/ 576,
- -1, -1, -1, -1,
- /*0xa72c*/ 1022,
- -1, -1,
- /*0xa694*/ 1013,
- /*0x10a8*/ 492,
- -1,
- /*0x1ecc*/ 643,
- /*0x04b0*/ 381,
- /*0x10b2*/ 502,
- /*0x104b0*/ 1246,
- /*0x2cbe*/ 958,
- /*0x01ac*/ 147,
- /*0x1f1c*/ 681,
- -1,
- /*0xa728*/ 1020,
- /*0x1e38*/ 567,
- -1,
- /*0x053a*/ 454,
- /*0xa732*/ 1024,
- /*0xff2a*/ 1189,
- /*0x13fa*/ 526,
- /*0x1f6b*/ 716,
- /*0x04ba*/ 386,
- -1,
- /*0x104ba*/ 1256,
- /*0xff2e*/ 1193,
- /*0x0230*/ 214,
- /*0x1f4d*/ 704,
- /*0x118ac*/ 1345,
- /*0x01b2*/ 151,
- -1, -1, -1, -1, -1,
- /*0x1ebc*/ 635,
- /*0x1eb4*/ 631,
- -1, -1, -1,
- /*0x054a*/ 470,
- /*0x023a*/ 216,
- /*0x118a8*/ 1341,
- -1, -1, -1,
- /*0x118b2*/ 1351,
- /*0x104ca*/ 1272,
- -1,
- /*0x1fc8*/ 785,
- /*0x0048*/ 7,
- -1,
- /*0x1fe2*/ 798,
- /*0x0462*/ 346,
- /*0x0162*/ 105,
- /*0xfb04*/ 1172,
- /*0x1e7a*/ 600,
- -1,
- /*0x1e36*/ 566,
- -1,
- /*0x0538*/ 452,
- /*0x1ebe*/ 636,
- /*0x2c62*/ 913,
- -1,
- /*0x024a*/ 226,
- /*0x04b8*/ 385,
- /*0xff2c*/ 1191,
- /*0x104b8*/ 1254,
- -1,
- /*0xfb02*/ 1170,
- /*0x2cc8*/ 963,
- -1, -1,
- /*0x2ce2*/ 976,
- /*0x03fa*/ 293,
- -1,
- /*0x00c8*/ 34,
- -1,
- /*0x1f85*/ 726,
- /*0x0405*/ 302,
- /*0xff28*/ 1187,
- /*0x10405*/ 1211,
- /*0x1e4c*/ 577,
- /*0xab85*/ 1109,
- /*0xff32*/ 1197,
- -1, -1, -1,
- /*0x2c05*/ 870,
- -1,
- /*0x10b0*/ 500,
- -1, -1,
- /*0x1fc4*/ 782,
- /*0x0044*/ 3,
- -1, -1, -1,
- /*0x1fd6*/ 792,
- /*0x0056*/ 20,
- /*0x0156*/ 99,
- -1, -1,
- /*0x0536*/ 450,
- -1,
- /*0x10ba*/ 510,
- /*0x04fa*/ 418,
- /*0x10c85*/ 1287,
- /*0x04b6*/ 384,
- /*0x24ba*/ 843,
- /*0x104b6*/ 1252,
- /*0x1e3c*/ 569,
- /*0x1e34*/ 565,
- -1,
- /*0x2cc4*/ 961,
- /*0xa73a*/ 1028,
- -1,
- /*0x1e905*/ 1370,
- -1,
- /*0x2cd6*/ 970,
- /*0x00c4*/ 30,
- /*0x1ec8*/ 641,
- /*0x1f0c*/ 673,
- -1,
- /*0x1ee2*/ 654,
- /*0x00d6*/ 48,
- -1,
- /*0x054c*/ 472,
- /*0x118b0*/ 1349,
- -1, -1, -1,
- /*0x24ca*/ 859,
- -1,
- /*0x104cc*/ 1274,
- -1,
- /*0xa64a*/ 985,
- /*0x1e3e*/ 570,
- /*0xa74a*/ 1036,
- -1, -1, -1, -1,
- /*0x118ba*/ 1359,
- -1, -1, -1, -1,
- /*0x10b8*/ 508,
- /*0x01ca*/ 161,
- -1,
- /*0x024c*/ 227,
- /*0x24b8*/ 841,
- -1, -1, -1,
- /*0x053c*/ 456,
- /*0x0534*/ 448,
- /*0xa738*/ 1027,
- -1, -1,
- /*0x04bc*/ 387,
- /*0x04b4*/ 383,
- /*0x104bc*/ 1258,
- /*0x104b4*/ 1250,
- /*0x1ec4*/ 639,
- /*0xff30*/ 1195,
- /*0x1fc2*/ 780,
- /*0x0042*/ 1,
- /*0x01b8*/ 155,
- /*0x1ed6*/ 648,
- /*0xa684*/ 1005,
- /*0x0050*/ 14,
- /*0x0150*/ 96,
- /*0x1f2a*/ 685,
- /*0x1fd2*/ 790,
- /*0x0052*/ 16,
- /*0x0152*/ 97,
- -1, -1,
- /*0x1f2e*/ 689,
- /*0xff3a*/ 1205,
- /*0x053e*/ 458,
- -1, -1,
- /*0xa682*/ 1004,
- /*0x118b8*/ 1357,
- /*0x04be*/ 388,
- /*0x2cc2*/ 960,
- /*0x104be*/ 1260,
- -1,
- /*0x10b6*/ 506,
- /*0x2cd0*/ 967,
- -1,
- /*0x00c2*/ 28,
- /*0x24b6*/ 839,
- /*0x2cd2*/ 968,
- /*0x1e48*/ 575,
- /*0x00d0*/ 42,
- -1,
- /*0x1e62*/ 588,
- /*0xa736*/ 1026,
- /*0x00d2*/ 44,
- -1, -1, -1,
- /*0x023e*/ 219,
- /*0x01d9*/ 169,
- /*0x004e*/ 12,
- /*0x014e*/ 95,
- /*0x01fa*/ 187,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x03e2*/ 280,
- /*0x24cc*/ 861,
- -1,
- /*0x1f2c*/ 687,
- -1,
- /*0xa64c*/ 986,
- /*0xff38*/ 1203,
- /*0xa74c*/ 1037,
- -1,
- /*0xa68c*/ 1009,
- /*0x2cce*/ 966,
- /*0x118b6*/ 1355,
- -1, -1,
- /*0x1fc6*/ 783,
- /*0x0046*/ 5,
- /*0x00ce*/ 40,
- /*0x1f28*/ 683,
- -1,
- /*0x1ffc*/ 817,
- /*0x047c*/ 359,
- /*0x1ec2*/ 638,
- -1,
- /*0x1e44*/ 573,
- /*0x0548*/ 468,
- /*0x1ed0*/ 645,
- /*0x10bc*/ 512,
- /*0x10b4*/ 504,
- /*0x1e56*/ 582,
- /*0x1ed2*/ 646,
- /*0x24bc*/ 845,
- /*0x104c8*/ 1270,
- /*0x04e2*/ 406,
- -1, -1,
- /*0x2cc6*/ 962,
- /*0xa73c*/ 1029,
- /*0xa734*/ 1025,
- /*0x1fec*/ 807,
- /*0x046c*/ 351,
- /*0x016c*/ 110,
- /*0x00c6*/ 32,
- -1, -1, -1, -1,
- /*0x03d6*/ 274,
- /*0x01bc*/ 156,
- /*0x0248*/ 225,
- /*0xff36*/ 1201,
- -1, -1,
- /*0x10be*/ 514,
- -1, -1, -1,
- /*0x24be*/ 847,
- /*0x1fea*/ 805,
- /*0x046a*/ 350,
- /*0x016a*/ 109,
- -1,
- /*0x1ece*/ 644,
- /*0xa73e*/ 1030,
- -1,
- /*0x118bc*/ 1361,
- /*0x118b4*/ 1353,
- /*0x1fab*/ 764,
- /*0x042b*/ 340,
- /*0x0544*/ 464,
- /*0x1f81*/ 722,
- /*0x0401*/ 298,
- /*0xabab*/ 1147,
- /*0x10401*/ 1207,
- /*0x0556*/ 482,
- /*0xab81*/ 1105,
- /*0x104c4*/ 1266,
- /*0x2c2b*/ 908,
- -1,
- /*0x04d6*/ 400,
- /*0x2c01*/ 866,
- -1,
- /*0x013f*/ 87,
- -1, -1,
- /*0xabbf*/ 1167,
- -1,
- /*0x1ec6*/ 640,
- /*0x1fe8*/ 803,
- /*0x0468*/ 349,
- /*0x0168*/ 108,
- /*0x118be*/ 1363,
- /*0x1efc*/ 667,
- /*0x0244*/ 222,
- -1,
- /*0xa7ab*/ 1078,
- /*0x10cab*/ 1325,
- -1,
- /*0x1e42*/ 572,
- /*0x10c81*/ 1283,
- -1,
- /*0x2162*/ 824,
- /*0x1e50*/ 579,
- -1,
- /*0xff34*/ 1199,
- -1,
- /*0x1e52*/ 580,
- -1,
- /*0x1c88*/ 538,
- /*0x1e901*/ 1366,
- -1,
- /*0x1eec*/ 659,
- /*0x1fe4*/ 800,
- /*0x0464*/ 347,
- /*0x0164*/ 106,
- -1,
- /*0x03c2*/ 269,
- /*0x24c8*/ 857,
- -1,
- /*0x1f3a*/ 693,
- /*0x03d0*/ 271,
- /*0xa648*/ 984,
- /*0x2c64*/ 915,
- /*0xa748*/ 1035,
- /*0xa662*/ 997,
- -1,
- /*0xa762*/ 1048,
- -1, -1, -1,
- /*0x1eea*/ 658,
- /*0x1c80*/ 530,
- /*0x13fc*/ 528,
- -1,
- /*0x01c8*/ 160,
- /*0x1fa9*/ 762,
- /*0x0429*/ 338,
- /*0x01e2*/ 173,
- /*0x1e4e*/ 578,
- /*0x1c83*/ 533,
- /*0xaba9*/ 1145,
- -1,
- /*0x1f4a*/ 701,
- /*0x0542*/ 462,
- -1,
- /*0x2c29*/ 906,
- -1,
- /*0x0550*/ 476,
- -1, -1,
- /*0x104c2*/ 1264,
- /*0x0552*/ 478,
- /*0x04d0*/ 397,
- -1,
- /*0x104d0*/ 1278,
- -1,
- /*0x04d2*/ 398,
- /*0x10c4*/ 520,
- /*0x104d2*/ 1280,
- -1,
- /*0x1ee8*/ 657,
- /*0x24c4*/ 853,
- /*0x1f38*/ 691,
- /*0x1e46*/ 574,
- /*0x10ca9*/ 1323,
- /*0xa644*/ 982,
- -1,
- /*0xa744*/ 1033,
- /*0x1e7c*/ 601,
- -1,
- /*0xa656*/ 991,
- -1,
- /*0xa756*/ 1042,
- /*0x0460*/ 345,
- /*0x0160*/ 104,
- -1, -1, -1,
- /*0x01c4*/ 157,
- -1, -1, -1,
- /*0x2c60*/ 912,
- /*0x054e*/ 474,
- /*0x1ee4*/ 655,
- -1, -1,
- /*0x1e6c*/ 593,
- /*0x046e*/ 352,
- /*0x016e*/ 111,
- /*0x104ce*/ 1276,
- -1, -1,
- /*0x2ce0*/ 975,
- -1, -1, -1,
- /*0x2c6e*/ 920,
- -1, -1,
- /*0x1f59*/ 709,
- -1,
- /*0x1fe6*/ 801,
- /*0x0466*/ 348,
- /*0x0166*/ 107,
- /*0x03ec*/ 285,
- /*0x1e6a*/ 592,
- /*0x024e*/ 228,
- /*0x0546*/ 466,
- -1, -1,
- /*0x013d*/ 86,
- -1,
- /*0x1c86*/ 536,
- /*0xabbd*/ 1165,
- /*0x104c6*/ 1268,
- -1, -1,
- /*0x04fc*/ 419,
- -1, -1,
- /*0x1fda*/ 796,
- /*0x005a*/ 24,
- /*0x015a*/ 101,
- /*0x03ea*/ 284,
- /*0x1fd8*/ 794,
- /*0x0058*/ 22,
- /*0x0158*/ 100,
- -1,
- /*0x1f4c*/ 703,
- -1,
- /*0x10c2*/ 518,
- /*0x0246*/ 224,
- /*0x03ab*/ 267,
- -1,
- /*0x24c2*/ 851,
- /*0x1e68*/ 591,
- /*0x04ec*/ 411,
- -1,
- /*0xa642*/ 981,
- -1,
- /*0xa742*/ 1032,
- /*0x2cda*/ 972,
- /*0xa650*/ 988,
- /*0x1ee0*/ 653,
- /*0xa750*/ 1039,
- /*0x2cd8*/ 971,
- /*0xa652*/ 989,
- /*0x00da*/ 51,
- /*0xa752*/ 1040,
- /*0x0054*/ 18,
- /*0x0154*/ 98,
- /*0x00d8*/ 49,
- -1,
- /*0x03e8*/ 283,
- -1,
- /*0x04ea*/ 410,
- /*0x2cc0*/ 959,
- /*0x1f3c*/ 695,
- /*0x1eee*/ 660,
- /*0x1e64*/ 589,
- -1, -1,
- /*0x00c0*/ 26,
- -1, -1,
- /*0x015e*/ 103,
- /*0x1fc7*/ 784,
- /*0x0047*/ 6,
- /*0x0147*/ 91,
- /*0x2cd4*/ 969,
- -1, -1,
- /*0x053f*/ 459,
- /*0x1ee6*/ 656,
- /*0x24ce*/ 863,
- /*0x00d4*/ 46,
- -1,
- /*0x03e4*/ 281,
- /*0xa64e*/ 987,
- /*0x104bf*/ 1261,
- /*0xa74e*/ 1038,
- -1, -1,
- /*0x1f3e*/ 697,
- /*0x2cde*/ 974,
- /*0x04e8*/ 409,
- /*0x1fb9*/ 775,
- -1,
- /*0x0139*/ 84,
- -1,
- /*0x00de*/ 55,
- /*0xabb9*/ 1161,
- /*0x1eda*/ 650,
- /*0x00c7*/ 33,
- -1, -1,
- /*0x1ed8*/ 649,
- -1, -1,
- /*0x24c6*/ 855,
- /*0x03a9*/ 265,
- -1, -1,
- /*0xa646*/ 983,
- /*0x216c*/ 834,
- /*0xa746*/ 1034,
- -1,
- /*0x1ec0*/ 637,
- -1,
- /*0x04e4*/ 407,
- -1,
- /*0x015c*/ 102,
- /*0x1fa1*/ 754,
- /*0x0421*/ 330,
- -1,
- /*0x10421*/ 1239,
- -1,
- /*0xaba1*/ 1137,
- -1,
- /*0x1e60*/ 587,
- /*0x1ed4*/ 647,
- /*0x01fc*/ 188,
- /*0x2c21*/ 898,
- /*0x216a*/ 832,
- -1, -1, -1,
- /*0xa66c*/ 1002,
- -1,
- /*0xa76c*/ 1053,
- /*0x2cdc*/ 973,
- -1,
- /*0x212b*/ 820,
- -1,
- /*0x1e6e*/ 594,
- /*0x1ede*/ 652,
- /*0x00dc*/ 53,
- /*0x03e0*/ 279,
- -1, -1,
- /*0x01ec*/ 178,
- /*0x10ca1*/ 1315,
- -1,
- /*0x1f48*/ 699,
- /*0x0045*/ 4,
- /*0x0145*/ 90,
- /*0xa66a*/ 1001,
- /*0x10ab*/ 495,
- /*0xa76a*/ 1052,
- /*0x1e66*/ 590,
- -1,
- /*0x1e921*/ 1398,
- /*0x03ee*/ 286,
- /*0x2168*/ 830,
- -1,
- /*0x1fc3*/ 781,
- /*0x0043*/ 2,
- /*0x0143*/ 89,
- -1,
- /*0x01ea*/ 177,
- /*0x10bf*/ 515,
- /*0xfb05*/ 1173,
- -1,
- /*0x0345*/ 229,
- /*0x24bf*/ 848,
- -1, -1,
- /*0x03e6*/ 282,
- /*0x1e5a*/ 584,
- /*0x04e0*/ 405,
- /*0x00c5*/ 31,
- /*0x0181*/ 121,
- /*0x1e58*/ 583,
- -1, -1, -1,
- /*0xa668*/ 1000,
- /*0x2164*/ 826,
- /*0xa768*/ 1051,
- -1, -1,
- /*0x1edc*/ 651,
- /*0x00c3*/ 29,
- /*0x1e40*/ 571,
- /*0x04ee*/ 412,
- /*0x118ab*/ 1344,
- /*0x03da*/ 276,
- -1, -1,
- /*0x01e8*/ 176,
- /*0x03d8*/ 275,
- -1,
- /*0x1f56*/ 708,
- -1, -1, -1,
- /*0x1e54*/ 581,
- -1,
- /*0x118bf*/ 1364,
- /*0x04e6*/ 408,
- /*0xa664*/ 998,
- /*0x053d*/ 457,
- /*0xa764*/ 1049,
- /*0x1fc9*/ 786,
- /*0x0049*/ 1399,
- /*0x0149*/ 92,
- -1, -1,
- /*0x104bd*/ 1259,
- /*0x1f97*/ 744,
- /*0x0417*/ 320,
- /*0x1e5e*/ 586,
- /*0x10417*/ 1229,
- /*0x01e4*/ 174,
- /*0xab97*/ 1127,
- /*0x10a9*/ 493,
- /*0x1fad*/ 766,
- /*0x042d*/ 342,
- /*0x04da*/ 402,
- /*0x2c17*/ 888,
- -1,
- /*0xabad*/ 1149,
- /*0x04d8*/ 401,
- /*0xff2b*/ 1190,
- -1,
- /*0x023d*/ 218,
- /*0x2c2d*/ 910,
- -1,
- /*0x0540*/ 460,
- /*0x03de*/ 278,
- /*0x00c9*/ 35,
- -1, -1,
- /*0x04c0*/ 389,
- -1,
- /*0x104c0*/ 1262,
- /*0x01a9*/ 146,
- /*0x2160*/ 822,
- /*0x10c97*/ 1305,
- -1, -1,
- /*0x0554*/ 480,
- /*0x1fb3*/ 770,
- -1,
- /*0xa7ad*/ 1080,
- /*0x10cad*/ 1327,
- /*0x04d4*/ 399,
- /*0xabb3*/ 1155,
- /*0x1e917*/ 1388,
- -1, -1, -1,
- /*0x216e*/ 836,
- /*0x118a9*/ 1342,
- -1, -1, -1,
- /*0x1e5c*/ 585,
- -1,
- /*0x0547*/ 467,
- /*0xa660*/ 996,
- /*0x04de*/ 404,
- /*0xa760*/ 1047,
- -1,
- /*0x04c7*/ 393,
- /*0x1f50*/ 705,
- /*0x104c7*/ 1269,
- /*0x2166*/ 828,
- -1,
- /*0x1f52*/ 706,
- /*0xa7b3*/ 1085,
- -1, -1,
- /*0x01e0*/ 172,
- -1,
- /*0x03dc*/ 277,
- -1,
- /*0xa76e*/ 1054,
- /*0x03a1*/ 258,
- /*0x0539*/ 453,
- -1,
- /*0x1e97*/ 615,
- -1, -1, -1, -1,
- /*0x104b9*/ 1255,
- -1,
- /*0x01ee*/ 179,
- /*0x10bd*/ 513,
- /*0xa666*/ 999,
- /*0xff29*/ 1188,
- /*0xa766*/ 1050,
- /*0x24bd*/ 846,
- /*0x1fa5*/ 758,
- /*0x0425*/ 334,
- -1,
- /*0x10425*/ 1243,
- -1,
- /*0xaba5*/ 1141,
- /*0x1fb7*/ 773,
- -1, -1,
- /*0x01e6*/ 175,
- /*0x2c25*/ 902,
- /*0xabb7*/ 1159,
- -1,
- /*0x04dc*/ 403,
- -1,
- /*0xa65a*/ 993,
- -1,
- /*0xa75a*/ 1044,
- -1,
- /*0xa658*/ 992,
- -1,
- /*0xa758*/ 1043,
- /*0x10c0*/ 516,
- -1, -1, -1,
- /*0x24c0*/ 849,
- -1, -1,
- /*0x10ca5*/ 1319,
- /*0xa640*/ 980,
- -1,
- /*0xa740*/ 1031,
- /*0x118bd*/ 1362,
- /*0x1fa3*/ 756,
- /*0x0423*/ 332,
- -1,
- /*0x10423*/ 1241,
- /*0x1c84*/ 534,
- /*0xaba3*/ 1139,
- -1, -1,
- /*0x0545*/ 465,
- /*0xa654*/ 990,
- /*0x2c23*/ 900,
- /*0xa754*/ 1041,
- -1,
- /*0x04c5*/ 392,
- -1,
- /*0x104c5*/ 1267,
- -1, -1,
- /*0x1c82*/ 532,
- /*0x10c7*/ 522,
- /*0x0543*/ 463,
- -1,
- /*0x1f6c*/ 717,
- /*0x24c7*/ 856,
- /*0xa65e*/ 995,
- /*0x04c3*/ 391,
- /*0xa75e*/ 1046,
- /*0x104c3*/ 1265,
- -1,
- /*0x10ca3*/ 1317,
- -1, -1,
- /*0x0245*/ 223,
- /*0x1ff4*/ 810,
- /*0x0474*/ 355,
- /*0x0174*/ 114,
- -1,
- /*0x01de*/ 171,
- -1,
- /*0x10b9*/ 509,
- /*0x01c7*/ 159,
- /*0x1f6a*/ 715,
- /*0xfb01*/ 1169,
- /*0x24b9*/ 842,
- /*0x0243*/ 221,
- -1, -1,
- /*0x0397*/ 248,
- -1, -1,
- /*0x1f2b*/ 686,
- /*0x1f9d*/ 750,
- /*0x041d*/ 326,
- -1,
- /*0x1041d*/ 1235,
- /*0xabb1*/ 1153,
- /*0xab9d*/ 1133,
- /*0x0470*/ 353,
- /*0x0170*/ 112,
- /*0x1f9b*/ 748,
- /*0x041b*/ 324,
- /*0x2c1d*/ 894,
- /*0x1041b*/ 1233,
- /*0x1f3f*/ 698,
- /*0xab9b*/ 1131,
- /*0x10a1*/ 485,
- /*0x2c70*/ 922,
- /*0xabb5*/ 1157,
- /*0x0549*/ 469,
- /*0x2c1b*/ 892,
- /*0xa65c*/ 994,
- /*0x1f68*/ 713,
- /*0xa75c*/ 1045,
- /*0x04c9*/ 394,
- -1,
- /*0x104c9*/ 1271,
- /*0x0370*/ 230,
- /*0x118b9*/ 1358,
- /*0xa7b1*/ 1083,
- /*0x10cb1*/ 1331,
- /*0x10c9d*/ 1311,
- -1,
- /*0x1f99*/ 746,
- /*0x0419*/ 322,
- -1,
- /*0x10419*/ 1231,
- -1,
- /*0xab99*/ 1129,
- /*0x10c9b*/ 1309,
- /*0x00b5*/ 25,
- /*0x1e91d*/ 1394,
- -1,
- /*0x2c19*/ 890,
- -1,
- /*0x1f93*/ 740,
- /*0x0413*/ 316,
- /*0x10c5*/ 521,
- /*0x10413*/ 1225,
- /*0x1e91b*/ 1392,
- /*0xab93*/ 1123,
- /*0x24c5*/ 854,
- -1, -1,
- /*0x118a1*/ 1334,
- /*0x2c13*/ 884,
- /*0x1ef4*/ 663,
- -1,
- /*0x0533*/ 447,
- /*0x10c3*/ 519,
- /*0x0041*/ 0,
- /*0x0141*/ 88,
- /*0x10c99*/ 1307,
- /*0x24c3*/ 852,
- -1,
- /*0x104b3*/ 1249,
- /*0xff39*/ 1204,
- -1,
- /*0x01c5*/ 158,
- /*0x1f29*/ 684,
- -1, -1,
- /*0x1e919*/ 1390,
- -1,
- /*0x10c93*/ 1301,
- /*0x1f8f*/ 736,
- /*0x040f*/ 312,
- -1,
- /*0x1040f*/ 1221,
- /*0x1ef0*/ 661,
- /*0xab8f*/ 1119,
- -1,
- /*0x1e9b*/ 619,
- /*0x03a5*/ 261,
- /*0x1e913*/ 1384,
- /*0x2c0f*/ 880,
- /*0x00c1*/ 27,
- -1, -1, -1,
- /*0x1f8b*/ 732,
- /*0x040b*/ 308,
- /*0xff21*/ 1180,
- /*0x1040b*/ 1217,
- -1,
- /*0xab8b*/ 1115,
- /*0x1f87*/ 728,
- /*0x0407*/ 304,
- /*0xab7b*/ 1099,
- /*0x10407*/ 1213,
- /*0x2c0b*/ 876,
- /*0xab87*/ 1111,
- /*0x0587*/ 483,
- -1,
- /*0x10c8f*/ 1297,
- /*0x1e99*/ 617,
- /*0x2c07*/ 872,
- /*0x004f*/ 13,
- -1, -1, -1,
- /*0x24c9*/ 858,
- -1,
- /*0xab79*/ 1097,
- /*0x1e90f*/ 1380,
- -1,
- /*0x0537*/ 451,
- /*0x03a3*/ 259,
- /*0xa78b*/ 1063,
- /*0x10c8b*/ 1293,
- /*0x10ad*/ 497,
- /*0x1f6e*/ 719,
- -1,
- /*0x104b7*/ 1253,
- -1,
- /*0x10c87*/ 1289,
- -1, -1, -1,
- /*0x1e90b*/ 1376,
- -1, -1,
- /*0x1e74*/ 597,
- /*0x00cf*/ 41,
- /*0x0197*/ 136,
- /*0x1e907*/ 1372,
- -1,
- /*0xab71*/ 1089,
- /*0xab73*/ 1091,
- -1, -1, -1, -1,
- /*0x1f3d*/ 696,
- -1, -1,
- /*0x10b3*/ 503,
- -1,
- /*0xab7f*/ 1103,
- -1,
- /*0x03f4*/ 289,
- /*0x1f9f*/ 752,
- /*0x041f*/ 328,
- /*0xab7d*/ 1101,
- /*0x1041f*/ 1237,
- /*0x1e70*/ 595,
- /*0xab9f*/ 1135,
- -1,
- /*0x118ad*/ 1346,
- -1, -1,
- /*0x2c1f*/ 896,
- -1, -1, -1, -1, -1,
- /*0x01b3*/ 152,
- /*0x039d*/ 254,
- -1, -1, -1, -1,
- /*0x03f0*/ 287,
- /*0xab75*/ 1093,
- -1,
- /*0x039b*/ 252,
- -1, -1, -1,
- /*0x10c9f*/ 1313,
- -1,
- /*0x04f4*/ 415,
- /*0x1f54*/ 707,
- /*0x118b3*/ 1352,
- -1,
- /*0x1ff8*/ 813,
- /*0x0478*/ 357,
- /*0x0178*/ 116,
- -1,
- /*0x1e91f*/ 1396,
- -1, -1, -1,
- /*0x0531*/ 445,
- -1,
- /*0xff2d*/ 1192,
- -1,
- /*0x10a5*/ 489,
- /*0x0399*/ 250,
- -1,
- /*0x104b1*/ 1247,
- -1, -1,
- /*0x10b7*/ 507,
- /*0x04f0*/ 413,
- /*0x0535*/ 449,
- -1,
- /*0x24b7*/ 840,
- /*0x1f95*/ 742,
- /*0x0415*/ 318,
- /*0x0393*/ 244,
- /*0x10415*/ 1227,
- /*0x104b5*/ 1251,
- /*0xab95*/ 1125,
- -1, -1, -1, -1,
- /*0x2c15*/ 886,
- -1,
- /*0x1f39*/ 692,
- /*0xff33*/ 1198,
- -1, -1,
- /*0x01b7*/ 154,
- -1, -1, -1, -1,
- /*0xab77*/ 1095,
- -1,
- /*0x10a3*/ 487,
- -1,
- /*0x1f91*/ 738,
- /*0x0411*/ 314,
- /*0x118a5*/ 1338,
- /*0x10411*/ 1223,
- /*0x10c95*/ 1303,
- /*0xab91*/ 1121,
- -1,
- /*0x038f*/ 240,
- /*0x118b7*/ 1356,
- -1,
- /*0x2c11*/ 882,
- -1, -1, -1,
- /*0x1e915*/ 1386,
- -1,
- /*0x1f8d*/ 734,
- /*0x040d*/ 310,
- /*0x0541*/ 461,
- /*0x1040d*/ 1219,
- -1,
- /*0xab8d*/ 1117,
- -1,
- /*0x04c1*/ 390,
- /*0x1ef8*/ 665,
- /*0x104c1*/ 1263,
- /*0x2c0d*/ 878,
- -1, -1,
- /*0x10c91*/ 1299,
- -1, -1, -1, -1, -1, -1,
- /*0x118a3*/ 1336,
- -1,
- /*0x03cf*/ 270,
- /*0x1e911*/ 1382,
- /*0xff25*/ 1184,
- -1,
- /*0x0241*/ 220,
- -1,
- /*0xa78d*/ 1064,
- /*0x10c8d*/ 1295,
- /*0xff37*/ 1202,
- -1,
- /*0x10b1*/ 501,
- -1, -1, -1,
- /*0x01f4*/ 183,
- -1, -1,
- /*0x1e90d*/ 1378,
- -1, -1, -1, -1,
- /*0x10b5*/ 505,
- -1, -1, -1,
- /*0x13f8*/ 524,
- /*0x054f*/ 475,
- -1, -1, -1,
- /*0x01b1*/ 150,
- /*0x019d*/ 139,
- -1,
- /*0x104cf*/ 1277,
- -1,
- /*0xff23*/ 1182,
- /*0x01f0*/ 180,
- -1, -1, -1, -1, -1,
- /*0x01b5*/ 153,
- -1,
- /*0x039f*/ 256,
- -1, -1,
- /*0x118b1*/ 1350,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x118b5*/ 1354,
- /*0xfb17*/ 1179,
- /*0x1e78*/ 599,
- -1, -1, -1,
- /*0x1f49*/ 700,
- -1,
- /*0x10c1*/ 517,
- -1, -1, -1,
- /*0x24c1*/ 850,
- -1, -1,
- /*0x0193*/ 133,
- -1, -1, -1,
- /*0x1f2d*/ 688,
- -1, -1, -1, -1, -1, -1,
- /*0xff31*/ 1196,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0xff35*/ 1200,
- -1, -1, -1, -1,
- /*0x0395*/ 246,
- -1,
- /*0x018f*/ 130,
- -1, -1, -1, -1, -1, -1,
- /*0x04f8*/ 417,
- -1, -1, -1, -1, -1,
- /*0xab76*/ 1094,
- /*0x24cf*/ 864,
- /*0x018b*/ 128,
- -1, -1, -1, -1, -1,
- /*0x0187*/ 125,
- -1,
- /*0x0391*/ 242,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x01cf*/ 164,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -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,
- /*0x1c85*/ 535,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x01f8*/ 186,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x1f1d*/ 682,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x1f1b*/ 680,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x0191*/ 132,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1f19*/ 678,
- /*0xfb13*/ 1175,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x1f0f*/ 676,
- -1, -1, -1, -1,
- /*0xab7e*/ 1102,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x1f0b*/ 672,
- -1, -1, -1, -1,
- /*0xab72*/ 1090,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1c81*/ 531,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xfb15*/ 1177,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x1f0d*/ 674,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xab7a*/ 1098,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -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*/ 1100,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x1c87*/ 537,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0xab74*/ 1092,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xab70*/ 1088,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -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*/ 1096
- };
-
- if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE)
- {
- register unsigned int key = onigenc_unicode_CaseFold_11_hash(code);
-
- if (key <= MAX_HASH_VALUE)
- {
- 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_11_Type CaseUnfold_11_Table[] = {
-#define CaseUnfold_11 (*(CaseUnfold_11_Type (*)[1266])(CaseUnfold_11_Table+0))
- {0x0061, {1|U, {0x0041}}},
- {0x0062, {1|U, {0x0042}}},
- {0x0063, {1|U, {0x0043}}},
- {0x0064, {1|U, {0x0044}}},
- {0x0065, {1|U, {0x0045}}},
- {0x0066, {1|U, {0x0046}}},
- {0x0067, {1|U, {0x0047}}},
- {0x0068, {1|U, {0x0048}}},
- {0x006a, {1|U, {0x004a}}},
- {0x006b, {2|U, {0x004b, 0x212a}}},
- {0x006c, {1|U, {0x004c}}},
- {0x006d, {1|U, {0x004d}}},
- {0x006e, {1|U, {0x004e}}},
- {0x006f, {1|U, {0x004f}}},
- {0x0070, {1|U, {0x0050}}},
- {0x0071, {1|U, {0x0051}}},
- {0x0072, {1|U, {0x0052}}},
- {0x0073, {2|U, {0x0053, 0x017f}}},
- {0x0074, {1|U, {0x0054}}},
- {0x0075, {1|U, {0x0055}}},
- {0x0076, {1|U, {0x0056}}},
- {0x0077, {1|U, {0x0057}}},
- {0x0078, {1|U, {0x0058}}},
- {0x0079, {1|U, {0x0059}}},
- {0x007a, {1|U, {0x005a}}},
- {0x00e0, {1|U, {0x00c0}}},
- {0x00e1, {1|U, {0x00c1}}},
- {0x00e2, {1|U, {0x00c2}}},
- {0x00e3, {1|U, {0x00c3}}},
- {0x00e4, {1|U, {0x00c4}}},
- {0x00e5, {2|U, {0x00c5, 0x212b}}},
- {0x00e6, {1|U, {0x00c6}}},
- {0x00e7, {1|U, {0x00c7}}},
- {0x00e8, {1|U, {0x00c8}}},
- {0x00e9, {1|U, {0x00c9}}},
- {0x00ea, {1|U, {0x00ca}}},
- {0x00eb, {1|U, {0x00cb}}},
- {0x00ec, {1|U, {0x00cc}}},
- {0x00ed, {1|U, {0x00cd}}},
- {0x00ee, {1|U, {0x00ce}}},
- {0x00ef, {1|U, {0x00cf}}},
- {0x00f0, {1|U, {0x00d0}}},
- {0x00f1, {1|U, {0x00d1}}},
- {0x00f2, {1|U, {0x00d2}}},
- {0x00f3, {1|U, {0x00d3}}},
- {0x00f4, {1|U, {0x00d4}}},
- {0x00f5, {1|U, {0x00d5}}},
- {0x00f6, {1|U, {0x00d6}}},
- {0x00f8, {1|U, {0x00d8}}},
- {0x00f9, {1|U, {0x00d9}}},
- {0x00fa, {1|U, {0x00da}}},
- {0x00fb, {1|U, {0x00db}}},
- {0x00fc, {1|U, {0x00dc}}},
- {0x00fd, {1|U, {0x00dd}}},
- {0x00fe, {1|U, {0x00de}}},
- {0x00ff, {1|U, {0x0178}}},
- {0x0101, {1|U, {0x0100}}},
- {0x0103, {1|U, {0x0102}}},
- {0x0105, {1|U, {0x0104}}},
- {0x0107, {1|U, {0x0106}}},
- {0x0109, {1|U, {0x0108}}},
- {0x010b, {1|U, {0x010a}}},
- {0x010d, {1|U, {0x010c}}},
- {0x010f, {1|U, {0x010e}}},
- {0x0111, {1|U, {0x0110}}},
- {0x0113, {1|U, {0x0112}}},
- {0x0115, {1|U, {0x0114}}},
- {0x0117, {1|U, {0x0116}}},
- {0x0119, {1|U, {0x0118}}},
- {0x011b, {1|U, {0x011a}}},
- {0x011d, {1|U, {0x011c}}},
- {0x011f, {1|U, {0x011e}}},
- {0x0121, {1|U, {0x0120}}},
- {0x0123, {1|U, {0x0122}}},
- {0x0125, {1|U, {0x0124}}},
- {0x0127, {1|U, {0x0126}}},
- {0x0129, {1|U, {0x0128}}},
- {0x012b, {1|U, {0x012a}}},
- {0x012d, {1|U, {0x012c}}},
- {0x012f, {1|U, {0x012e}}},
- {0x0133, {1|U, {0x0132}}},
- {0x0135, {1|U, {0x0134}}},
- {0x0137, {1|U, {0x0136}}},
- {0x013a, {1|U, {0x0139}}},
- {0x013c, {1|U, {0x013b}}},
- {0x013e, {1|U, {0x013d}}},
- {0x0140, {1|U, {0x013f}}},
- {0x0142, {1|U, {0x0141}}},
- {0x0144, {1|U, {0x0143}}},
- {0x0146, {1|U, {0x0145}}},
- {0x0148, {1|U, {0x0147}}},
- {0x014b, {1|U, {0x014a}}},
- {0x014d, {1|U, {0x014c}}},
- {0x014f, {1|U, {0x014e}}},
- {0x0151, {1|U, {0x0150}}},
- {0x0153, {1|U, {0x0152}}},
- {0x0155, {1|U, {0x0154}}},
- {0x0157, {1|U, {0x0156}}},
- {0x0159, {1|U, {0x0158}}},
- {0x015b, {1|U, {0x015a}}},
- {0x015d, {1|U, {0x015c}}},
- {0x015f, {1|U, {0x015e}}},
- {0x0161, {1|U, {0x0160}}},
- {0x0163, {1|U, {0x0162}}},
- {0x0165, {1|U, {0x0164}}},
- {0x0167, {1|U, {0x0166}}},
- {0x0169, {1|U, {0x0168}}},
- {0x016b, {1|U, {0x016a}}},
- {0x016d, {1|U, {0x016c}}},
- {0x016f, {1|U, {0x016e}}},
- {0x0171, {1|U, {0x0170}}},
- {0x0173, {1|U, {0x0172}}},
- {0x0175, {1|U, {0x0174}}},
- {0x0177, {1|U, {0x0176}}},
- {0x017a, {1|U, {0x0179}}},
- {0x017c, {1|U, {0x017b}}},
- {0x017e, {1|U, {0x017d}}},
- {0x0180, {1|U, {0x0243}}},
- {0x0183, {1|U, {0x0182}}},
- {0x0185, {1|U, {0x0184}}},
- {0x0188, {1|U, {0x0187}}},
- {0x018c, {1|U, {0x018b}}},
- {0x0192, {1|U, {0x0191}}},
- {0x0195, {1|U, {0x01f6}}},
- {0x0199, {1|U, {0x0198}}},
- {0x019a, {1|U, {0x023d}}},
- {0x019e, {1|U, {0x0220}}},
- {0x01a1, {1|U, {0x01a0}}},
- {0x01a3, {1|U, {0x01a2}}},
- {0x01a5, {1|U, {0x01a4}}},
- {0x01a8, {1|U, {0x01a7}}},
- {0x01ad, {1|U, {0x01ac}}},
- {0x01b0, {1|U, {0x01af}}},
- {0x01b4, {1|U, {0x01b3}}},
- {0x01b6, {1|U, {0x01b5}}},
- {0x01b9, {1|U, {0x01b8}}},
- {0x01bd, {1|U, {0x01bc}}},
- {0x01bf, {1|U, {0x01f7}}},
- {0x01c6, {2|U|ST, {0x01c4, 0x01c5}}},
- {0x01c9, {2|U|ST, {0x01c7, 0x01c8}}},
- {0x01cc, {2|U|ST, {0x01ca, 0x01cb}}},
- {0x01ce, {1|U, {0x01cd}}},
- {0x01d0, {1|U, {0x01cf}}},
- {0x01d2, {1|U, {0x01d1}}},
- {0x01d4, {1|U, {0x01d3}}},
- {0x01d6, {1|U, {0x01d5}}},
- {0x01d8, {1|U, {0x01d7}}},
- {0x01da, {1|U, {0x01d9}}},
- {0x01dc, {1|U, {0x01db}}},
- {0x01dd, {1|U, {0x018e}}},
- {0x01df, {1|U, {0x01de}}},
- {0x01e1, {1|U, {0x01e0}}},
- {0x01e3, {1|U, {0x01e2}}},
- {0x01e5, {1|U, {0x01e4}}},
- {0x01e7, {1|U, {0x01e6}}},
- {0x01e9, {1|U, {0x01e8}}},
- {0x01eb, {1|U, {0x01ea}}},
- {0x01ed, {1|U, {0x01ec}}},
- {0x01ef, {1|U, {0x01ee}}},
- {0x01f3, {2|U|ST, {0x01f1, 0x01f2}}},
- {0x01f5, {1|U, {0x01f4}}},
- {0x01f9, {1|U, {0x01f8}}},
- {0x01fb, {1|U, {0x01fa}}},
- {0x01fd, {1|U, {0x01fc}}},
- {0x01ff, {1|U, {0x01fe}}},
- {0x0201, {1|U, {0x0200}}},
- {0x0203, {1|U, {0x0202}}},
- {0x0205, {1|U, {0x0204}}},
- {0x0207, {1|U, {0x0206}}},
- {0x0209, {1|U, {0x0208}}},
- {0x020b, {1|U, {0x020a}}},
- {0x020d, {1|U, {0x020c}}},
- {0x020f, {1|U, {0x020e}}},
- {0x0211, {1|U, {0x0210}}},
- {0x0213, {1|U, {0x0212}}},
- {0x0215, {1|U, {0x0214}}},
- {0x0217, {1|U, {0x0216}}},
- {0x0219, {1|U, {0x0218}}},
- {0x021b, {1|U, {0x021a}}},
- {0x021d, {1|U, {0x021c}}},
- {0x021f, {1|U, {0x021e}}},
- {0x0223, {1|U, {0x0222}}},
- {0x0225, {1|U, {0x0224}}},
- {0x0227, {1|U, {0x0226}}},
- {0x0229, {1|U, {0x0228}}},
- {0x022b, {1|U, {0x022a}}},
- {0x022d, {1|U, {0x022c}}},
- {0x022f, {1|U, {0x022e}}},
- {0x0231, {1|U, {0x0230}}},
- {0x0233, {1|U, {0x0232}}},
- {0x023c, {1|U, {0x023b}}},
- {0x023f, {1|U, {0x2c7e}}},
- {0x0240, {1|U, {0x2c7f}}},
- {0x0242, {1|U, {0x0241}}},
- {0x0247, {1|U, {0x0246}}},
- {0x0249, {1|U, {0x0248}}},
- {0x024b, {1|U, {0x024a}}},
- {0x024d, {1|U, {0x024c}}},
- {0x024f, {1|U, {0x024e}}},
- {0x0250, {1|U, {0x2c6f}}},
- {0x0251, {1|U, {0x2c6d}}},
- {0x0252, {1|U, {0x2c70}}},
- {0x0253, {1|U, {0x0181}}},
- {0x0254, {1|U, {0x0186}}},
- {0x0256, {1|U, {0x0189}}},
- {0x0257, {1|U, {0x018a}}},
- {0x0259, {1|U, {0x018f}}},
- {0x025b, {1|U, {0x0190}}},
- {0x025c, {1|U, {0xa7ab}}},
- {0x0260, {1|U, {0x0193}}},
- {0x0261, {1|U, {0xa7ac}}},
- {0x0263, {1|U, {0x0194}}},
- {0x0265, {1|U, {0xa78d}}},
- {0x0266, {1|U, {0xa7aa}}},
- {0x0268, {1|U, {0x0197}}},
- {0x0269, {1|U, {0x0196}}},
- {0x026a, {1|U, {0xa7ae}}},
- {0x026b, {1|U, {0x2c62}}},
- {0x026c, {1|U, {0xa7ad}}},
- {0x026f, {1|U, {0x019c}}},
- {0x0271, {1|U, {0x2c6e}}},
- {0x0272, {1|U, {0x019d}}},
- {0x0275, {1|U, {0x019f}}},
- {0x027d, {1|U, {0x2c64}}},
- {0x0280, {1|U, {0x01a6}}},
- {0x0283, {1|U, {0x01a9}}},
- {0x0287, {1|U, {0xa7b1}}},
- {0x0288, {1|U, {0x01ae}}},
- {0x0289, {1|U, {0x0244}}},
- {0x028a, {1|U, {0x01b1}}},
- {0x028b, {1|U, {0x01b2}}},
- {0x028c, {1|U, {0x0245}}},
- {0x0292, {1|U, {0x01b7}}},
- {0x029d, {1|U, {0xa7b2}}},
- {0x029e, {1|U, {0xa7b0}}},
- {0x0371, {1|U, {0x0370}}},
- {0x0373, {1|U, {0x0372}}},
- {0x0377, {1|U, {0x0376}}},
- {0x037b, {1|U, {0x03fd}}},
- {0x037c, {1|U, {0x03fe}}},
- {0x037d, {1|U, {0x03ff}}},
- {0x03ac, {1|U, {0x0386}}},
- {0x03ad, {1|U, {0x0388}}},
- {0x03ae, {1|U, {0x0389}}},
- {0x03af, {1|U, {0x038a}}},
- {0x03b1, {1|U, {0x0391}}},
- {0x03b2, {2|U, {0x0392, 0x03d0}}},
- {0x03b3, {1|U, {0x0393}}},
- {0x03b4, {1|U, {0x0394}}},
- {0x03b5, {2|U, {0x0395, 0x03f5}}},
- {0x03b6, {1|U, {0x0396}}},
- {0x03b7, {1|U, {0x0397}}},
- {0x03b8, {3|U, {0x0398, 0x03d1, 0x03f4}}},
- {0x03b9, {3|U, {0x0399, 0x0345, 0x1fbe}}},
- {0x03ba, {2|U, {0x039a, 0x03f0}}},
- {0x03bb, {1|U, {0x039b}}},
- {0x03bc, {2|U, {0x039c, 0x00b5}}},
- {0x03bd, {1|U, {0x039d}}},
- {0x03be, {1|U, {0x039e}}},
- {0x03bf, {1|U, {0x039f}}},
- {0x03c0, {2|U, {0x03a0, 0x03d6}}},
- {0x03c1, {2|U, {0x03a1, 0x03f1}}},
- {0x03c3, {2|U, {0x03a3, 0x03c2}}},
- {0x03c4, {1|U, {0x03a4}}},
- {0x03c5, {1|U, {0x03a5}}},
- {0x03c6, {2|U, {0x03a6, 0x03d5}}},
- {0x03c7, {1|U, {0x03a7}}},
- {0x03c8, {1|U, {0x03a8}}},
- {0x03c9, {2|U, {0x03a9, 0x2126}}},
- {0x03ca, {1|U, {0x03aa}}},
- {0x03cb, {1|U, {0x03ab}}},
- {0x03cc, {1|U, {0x038c}}},
- {0x03cd, {1|U, {0x038e}}},
- {0x03ce, {1|U, {0x038f}}},
- {0x03d7, {1|U, {0x03cf}}},
- {0x03d9, {1|U, {0x03d8}}},
- {0x03db, {1|U, {0x03da}}},
- {0x03dd, {1|U, {0x03dc}}},
- {0x03df, {1|U, {0x03de}}},
- {0x03e1, {1|U, {0x03e0}}},
- {0x03e3, {1|U, {0x03e2}}},
- {0x03e5, {1|U, {0x03e4}}},
- {0x03e7, {1|U, {0x03e6}}},
- {0x03e9, {1|U, {0x03e8}}},
- {0x03eb, {1|U, {0x03ea}}},
- {0x03ed, {1|U, {0x03ec}}},
- {0x03ef, {1|U, {0x03ee}}},
- {0x03f2, {1|U, {0x03f9}}},
- {0x03f3, {1|U, {0x037f}}},
- {0x03f8, {1|U, {0x03f7}}},
- {0x03fb, {1|U, {0x03fa}}},
- {0x0430, {1|U, {0x0410}}},
- {0x0431, {1|U, {0x0411}}},
- {0x0432, {2|U, {0x0412, 0x1c80}}},
- {0x0433, {1|U, {0x0413}}},
- {0x0434, {2|U, {0x0414, 0x1c81}}},
- {0x0435, {1|U, {0x0415}}},
- {0x0436, {1|U, {0x0416}}},
- {0x0437, {1|U, {0x0417}}},
- {0x0438, {1|U, {0x0418}}},
- {0x0439, {1|U, {0x0419}}},
- {0x043a, {1|U, {0x041a}}},
- {0x043b, {1|U, {0x041b}}},
- {0x043c, {1|U, {0x041c}}},
- {0x043d, {1|U, {0x041d}}},
- {0x043e, {2|U, {0x041e, 0x1c82}}},
- {0x043f, {1|U, {0x041f}}},
- {0x0440, {1|U, {0x0420}}},
- {0x0441, {2|U, {0x0421, 0x1c83}}},
- {0x0442, {3|U, {0x0422, 0x1c84, 0x1c85}}},
- {0x0443, {1|U, {0x0423}}},
- {0x0444, {1|U, {0x0424}}},
- {0x0445, {1|U, {0x0425}}},
- {0x0446, {1|U, {0x0426}}},
- {0x0447, {1|U, {0x0427}}},
- {0x0448, {1|U, {0x0428}}},
- {0x0449, {1|U, {0x0429}}},
- {0x044a, {2|U, {0x042a, 0x1c86}}},
- {0x044b, {1|U, {0x042b}}},
- {0x044c, {1|U, {0x042c}}},
- {0x044d, {1|U, {0x042d}}},
- {0x044e, {1|U, {0x042e}}},
- {0x044f, {1|U, {0x042f}}},
- {0x0450, {1|U, {0x0400}}},
- {0x0451, {1|U, {0x0401}}},
- {0x0452, {1|U, {0x0402}}},
- {0x0453, {1|U, {0x0403}}},
- {0x0454, {1|U, {0x0404}}},
- {0x0455, {1|U, {0x0405}}},
- {0x0456, {1|U, {0x0406}}},
- {0x0457, {1|U, {0x0407}}},
- {0x0458, {1|U, {0x0408}}},
- {0x0459, {1|U, {0x0409}}},
- {0x045a, {1|U, {0x040a}}},
- {0x045b, {1|U, {0x040b}}},
- {0x045c, {1|U, {0x040c}}},
- {0x045d, {1|U, {0x040d}}},
- {0x045e, {1|U, {0x040e}}},
- {0x045f, {1|U, {0x040f}}},
- {0x0461, {1|U, {0x0460}}},
- {0x0463, {2|U, {0x0462, 0x1c87}}},
- {0x0465, {1|U, {0x0464}}},
- {0x0467, {1|U, {0x0466}}},
- {0x0469, {1|U, {0x0468}}},
- {0x046b, {1|U, {0x046a}}},
- {0x046d, {1|U, {0x046c}}},
- {0x046f, {1|U, {0x046e}}},
- {0x0471, {1|U, {0x0470}}},
- {0x0473, {1|U, {0x0472}}},
- {0x0475, {1|U, {0x0474}}},
- {0x0477, {1|U, {0x0476}}},
- {0x0479, {1|U, {0x0478}}},
- {0x047b, {1|U, {0x047a}}},
- {0x047d, {1|U, {0x047c}}},
- {0x047f, {1|U, {0x047e}}},
- {0x0481, {1|U, {0x0480}}},
- {0x048b, {1|U, {0x048a}}},
- {0x048d, {1|U, {0x048c}}},
- {0x048f, {1|U, {0x048e}}},
- {0x0491, {1|U, {0x0490}}},
- {0x0493, {1|U, {0x0492}}},
- {0x0495, {1|U, {0x0494}}},
- {0x0497, {1|U, {0x0496}}},
- {0x0499, {1|U, {0x0498}}},
- {0x049b, {1|U, {0x049a}}},
- {0x049d, {1|U, {0x049c}}},
- {0x049f, {1|U, {0x049e}}},
- {0x04a1, {1|U, {0x04a0}}},
- {0x04a3, {1|U, {0x04a2}}},
- {0x04a5, {1|U, {0x04a4}}},
- {0x04a7, {1|U, {0x04a6}}},
- {0x04a9, {1|U, {0x04a8}}},
- {0x04ab, {1|U, {0x04aa}}},
- {0x04ad, {1|U, {0x04ac}}},
- {0x04af, {1|U, {0x04ae}}},
- {0x04b1, {1|U, {0x04b0}}},
- {0x04b3, {1|U, {0x04b2}}},
- {0x04b5, {1|U, {0x04b4}}},
- {0x04b7, {1|U, {0x04b6}}},
- {0x04b9, {1|U, {0x04b8}}},
- {0x04bb, {1|U, {0x04ba}}},
- {0x04bd, {1|U, {0x04bc}}},
- {0x04bf, {1|U, {0x04be}}},
- {0x04c2, {1|U, {0x04c1}}},
- {0x04c4, {1|U, {0x04c3}}},
- {0x04c6, {1|U, {0x04c5}}},
- {0x04c8, {1|U, {0x04c7}}},
- {0x04ca, {1|U, {0x04c9}}},
- {0x04cc, {1|U, {0x04cb}}},
- {0x04ce, {1|U, {0x04cd}}},
- {0x04cf, {1|U, {0x04c0}}},
- {0x04d1, {1|U, {0x04d0}}},
- {0x04d3, {1|U, {0x04d2}}},
- {0x04d5, {1|U, {0x04d4}}},
- {0x04d7, {1|U, {0x04d6}}},
- {0x04d9, {1|U, {0x04d8}}},
- {0x04db, {1|U, {0x04da}}},
- {0x04dd, {1|U, {0x04dc}}},
- {0x04df, {1|U, {0x04de}}},
- {0x04e1, {1|U, {0x04e0}}},
- {0x04e3, {1|U, {0x04e2}}},
- {0x04e5, {1|U, {0x04e4}}},
- {0x04e7, {1|U, {0x04e6}}},
- {0x04e9, {1|U, {0x04e8}}},
- {0x04eb, {1|U, {0x04ea}}},
- {0x04ed, {1|U, {0x04ec}}},
- {0x04ef, {1|U, {0x04ee}}},
- {0x04f1, {1|U, {0x04f0}}},
- {0x04f3, {1|U, {0x04f2}}},
- {0x04f5, {1|U, {0x04f4}}},
- {0x04f7, {1|U, {0x04f6}}},
- {0x04f9, {1|U, {0x04f8}}},
- {0x04fb, {1|U, {0x04fa}}},
- {0x04fd, {1|U, {0x04fc}}},
- {0x04ff, {1|U, {0x04fe}}},
- {0x0501, {1|U, {0x0500}}},
- {0x0503, {1|U, {0x0502}}},
- {0x0505, {1|U, {0x0504}}},
- {0x0507, {1|U, {0x0506}}},
- {0x0509, {1|U, {0x0508}}},
- {0x050b, {1|U, {0x050a}}},
- {0x050d, {1|U, {0x050c}}},
- {0x050f, {1|U, {0x050e}}},
- {0x0511, {1|U, {0x0510}}},
- {0x0513, {1|U, {0x0512}}},
- {0x0515, {1|U, {0x0514}}},
- {0x0517, {1|U, {0x0516}}},
- {0x0519, {1|U, {0x0518}}},
- {0x051b, {1|U, {0x051a}}},
- {0x051d, {1|U, {0x051c}}},
- {0x051f, {1|U, {0x051e}}},
- {0x0521, {1|U, {0x0520}}},
- {0x0523, {1|U, {0x0522}}},
- {0x0525, {1|U, {0x0524}}},
- {0x0527, {1|U, {0x0526}}},
- {0x0529, {1|U, {0x0528}}},
- {0x052b, {1|U, {0x052a}}},
- {0x052d, {1|U, {0x052c}}},
- {0x052f, {1|U, {0x052e}}},
- {0x0561, {1|U, {0x0531}}},
- {0x0562, {1|U, {0x0532}}},
- {0x0563, {1|U, {0x0533}}},
- {0x0564, {1|U, {0x0534}}},
- {0x0565, {1|U, {0x0535}}},
- {0x0566, {1|U, {0x0536}}},
- {0x0567, {1|U, {0x0537}}},
- {0x0568, {1|U, {0x0538}}},
- {0x0569, {1|U, {0x0539}}},
- {0x056a, {1|U, {0x053a}}},
- {0x056b, {1|U, {0x053b}}},
- {0x056c, {1|U, {0x053c}}},
- {0x056d, {1|U, {0x053d}}},
- {0x056e, {1|U, {0x053e}}},
- {0x056f, {1|U, {0x053f}}},
- {0x0570, {1|U, {0x0540}}},
- {0x0571, {1|U, {0x0541}}},
- {0x0572, {1|U, {0x0542}}},
- {0x0573, {1|U, {0x0543}}},
- {0x0574, {1|U, {0x0544}}},
- {0x0575, {1|U, {0x0545}}},
- {0x0576, {1|U, {0x0546}}},
- {0x0577, {1|U, {0x0547}}},
- {0x0578, {1|U, {0x0548}}},
- {0x0579, {1|U, {0x0549}}},
- {0x057a, {1|U, {0x054a}}},
- {0x057b, {1|U, {0x054b}}},
- {0x057c, {1|U, {0x054c}}},
- {0x057d, {1|U, {0x054d}}},
- {0x057e, {1|U, {0x054e}}},
- {0x057f, {1|U, {0x054f}}},
- {0x0580, {1|U, {0x0550}}},
- {0x0581, {1|U, {0x0551}}},
- {0x0582, {1|U, {0x0552}}},
- {0x0583, {1|U, {0x0553}}},
- {0x0584, {1|U, {0x0554}}},
- {0x0585, {1|U, {0x0555}}},
- {0x0586, {1|U, {0x0556}}},
- {0x13a0, {1|D, {0xab70}}},
- {0x13a1, {1|D, {0xab71}}},
- {0x13a2, {1|D, {0xab72}}},
- {0x13a3, {1|D, {0xab73}}},
- {0x13a4, {1|D, {0xab74}}},
- {0x13a5, {1|D, {0xab75}}},
- {0x13a6, {1|D, {0xab76}}},
- {0x13a7, {1|D, {0xab77}}},
- {0x13a8, {1|D, {0xab78}}},
- {0x13a9, {1|D, {0xab79}}},
- {0x13aa, {1|D, {0xab7a}}},
- {0x13ab, {1|D, {0xab7b}}},
- {0x13ac, {1|D, {0xab7c}}},
- {0x13ad, {1|D, {0xab7d}}},
- {0x13ae, {1|D, {0xab7e}}},
- {0x13af, {1|D, {0xab7f}}},
- {0x13b0, {1|D, {0xab80}}},
- {0x13b1, {1|D, {0xab81}}},
- {0x13b2, {1|D, {0xab82}}},
- {0x13b3, {1|D, {0xab83}}},
- {0x13b4, {1|D, {0xab84}}},
- {0x13b5, {1|D, {0xab85}}},
- {0x13b6, {1|D, {0xab86}}},
- {0x13b7, {1|D, {0xab87}}},
- {0x13b8, {1|D, {0xab88}}},
- {0x13b9, {1|D, {0xab89}}},
- {0x13ba, {1|D, {0xab8a}}},
- {0x13bb, {1|D, {0xab8b}}},
- {0x13bc, {1|D, {0xab8c}}},
- {0x13bd, {1|D, {0xab8d}}},
- {0x13be, {1|D, {0xab8e}}},
- {0x13bf, {1|D, {0xab8f}}},
- {0x13c0, {1|D, {0xab90}}},
- {0x13c1, {1|D, {0xab91}}},
- {0x13c2, {1|D, {0xab92}}},
- {0x13c3, {1|D, {0xab93}}},
- {0x13c4, {1|D, {0xab94}}},
- {0x13c5, {1|D, {0xab95}}},
- {0x13c6, {1|D, {0xab96}}},
- {0x13c7, {1|D, {0xab97}}},
- {0x13c8, {1|D, {0xab98}}},
- {0x13c9, {1|D, {0xab99}}},
- {0x13ca, {1|D, {0xab9a}}},
- {0x13cb, {1|D, {0xab9b}}},
- {0x13cc, {1|D, {0xab9c}}},
- {0x13cd, {1|D, {0xab9d}}},
- {0x13ce, {1|D, {0xab9e}}},
- {0x13cf, {1|D, {0xab9f}}},
- {0x13d0, {1|D, {0xaba0}}},
- {0x13d1, {1|D, {0xaba1}}},
- {0x13d2, {1|D, {0xaba2}}},
- {0x13d3, {1|D, {0xaba3}}},
- {0x13d4, {1|D, {0xaba4}}},
- {0x13d5, {1|D, {0xaba5}}},
- {0x13d6, {1|D, {0xaba6}}},
- {0x13d7, {1|D, {0xaba7}}},
- {0x13d8, {1|D, {0xaba8}}},
- {0x13d9, {1|D, {0xaba9}}},
- {0x13da, {1|D, {0xabaa}}},
- {0x13db, {1|D, {0xabab}}},
- {0x13dc, {1|D, {0xabac}}},
- {0x13dd, {1|D, {0xabad}}},
- {0x13de, {1|D, {0xabae}}},
- {0x13df, {1|D, {0xabaf}}},
- {0x13e0, {1|D, {0xabb0}}},
- {0x13e1, {1|D, {0xabb1}}},
- {0x13e2, {1|D, {0xabb2}}},
- {0x13e3, {1|D, {0xabb3}}},
- {0x13e4, {1|D, {0xabb4}}},
- {0x13e5, {1|D, {0xabb5}}},
- {0x13e6, {1|D, {0xabb6}}},
- {0x13e7, {1|D, {0xabb7}}},
- {0x13e8, {1|D, {0xabb8}}},
- {0x13e9, {1|D, {0xabb9}}},
- {0x13ea, {1|D, {0xabba}}},
- {0x13eb, {1|D, {0xabbb}}},
- {0x13ec, {1|D, {0xabbc}}},
- {0x13ed, {1|D, {0xabbd}}},
- {0x13ee, {1|D, {0xabbe}}},
- {0x13ef, {1|D, {0xabbf}}},
- {0x13f0, {1|D, {0x13f8}}},
- {0x13f1, {1|D, {0x13f9}}},
- {0x13f2, {1|D, {0x13fa}}},
- {0x13f3, {1|D, {0x13fb}}},
- {0x13f4, {1|D, {0x13fc}}},
- {0x13f5, {1|D, {0x13fd}}},
- {0x1d79, {1|U, {0xa77d}}},
- {0x1d7d, {1|U, {0x2c63}}},
- {0x1e01, {1|U, {0x1e00}}},
- {0x1e03, {1|U, {0x1e02}}},
- {0x1e05, {1|U, {0x1e04}}},
- {0x1e07, {1|U, {0x1e06}}},
- {0x1e09, {1|U, {0x1e08}}},
- {0x1e0b, {1|U, {0x1e0a}}},
- {0x1e0d, {1|U, {0x1e0c}}},
- {0x1e0f, {1|U, {0x1e0e}}},
- {0x1e11, {1|U, {0x1e10}}},
- {0x1e13, {1|U, {0x1e12}}},
- {0x1e15, {1|U, {0x1e14}}},
- {0x1e17, {1|U, {0x1e16}}},
- {0x1e19, {1|U, {0x1e18}}},
- {0x1e1b, {1|U, {0x1e1a}}},
- {0x1e1d, {1|U, {0x1e1c}}},
- {0x1e1f, {1|U, {0x1e1e}}},
- {0x1e21, {1|U, {0x1e20}}},
- {0x1e23, {1|U, {0x1e22}}},
- {0x1e25, {1|U, {0x1e24}}},
- {0x1e27, {1|U, {0x1e26}}},
- {0x1e29, {1|U, {0x1e28}}},
- {0x1e2b, {1|U, {0x1e2a}}},
- {0x1e2d, {1|U, {0x1e2c}}},
- {0x1e2f, {1|U, {0x1e2e}}},
- {0x1e31, {1|U, {0x1e30}}},
- {0x1e33, {1|U, {0x1e32}}},
- {0x1e35, {1|U, {0x1e34}}},
- {0x1e37, {1|U, {0x1e36}}},
- {0x1e39, {1|U, {0x1e38}}},
- {0x1e3b, {1|U, {0x1e3a}}},
- {0x1e3d, {1|U, {0x1e3c}}},
- {0x1e3f, {1|U, {0x1e3e}}},
- {0x1e41, {1|U, {0x1e40}}},
- {0x1e43, {1|U, {0x1e42}}},
- {0x1e45, {1|U, {0x1e44}}},
- {0x1e47, {1|U, {0x1e46}}},
- {0x1e49, {1|U, {0x1e48}}},
- {0x1e4b, {1|U, {0x1e4a}}},
- {0x1e4d, {1|U, {0x1e4c}}},
- {0x1e4f, {1|U, {0x1e4e}}},
- {0x1e51, {1|U, {0x1e50}}},
- {0x1e53, {1|U, {0x1e52}}},
- {0x1e55, {1|U, {0x1e54}}},
- {0x1e57, {1|U, {0x1e56}}},
- {0x1e59, {1|U, {0x1e58}}},
- {0x1e5b, {1|U, {0x1e5a}}},
- {0x1e5d, {1|U, {0x1e5c}}},
- {0x1e5f, {1|U, {0x1e5e}}},
- {0x1e61, {2|U, {0x1e60, 0x1e9b}}},
- {0x1e63, {1|U, {0x1e62}}},
- {0x1e65, {1|U, {0x1e64}}},
- {0x1e67, {1|U, {0x1e66}}},
- {0x1e69, {1|U, {0x1e68}}},
- {0x1e6b, {1|U, {0x1e6a}}},
- {0x1e6d, {1|U, {0x1e6c}}},
- {0x1e6f, {1|U, {0x1e6e}}},
- {0x1e71, {1|U, {0x1e70}}},
- {0x1e73, {1|U, {0x1e72}}},
- {0x1e75, {1|U, {0x1e74}}},
- {0x1e77, {1|U, {0x1e76}}},
- {0x1e79, {1|U, {0x1e78}}},
- {0x1e7b, {1|U, {0x1e7a}}},
- {0x1e7d, {1|U, {0x1e7c}}},
- {0x1e7f, {1|U, {0x1e7e}}},
- {0x1e81, {1|U, {0x1e80}}},
- {0x1e83, {1|U, {0x1e82}}},
- {0x1e85, {1|U, {0x1e84}}},
- {0x1e87, {1|U, {0x1e86}}},
- {0x1e89, {1|U, {0x1e88}}},
- {0x1e8b, {1|U, {0x1e8a}}},
- {0x1e8d, {1|U, {0x1e8c}}},
- {0x1e8f, {1|U, {0x1e8e}}},
- {0x1e91, {1|U, {0x1e90}}},
- {0x1e93, {1|U, {0x1e92}}},
- {0x1e95, {1|U, {0x1e94}}},
- {0x1ea1, {1|U, {0x1ea0}}},
- {0x1ea3, {1|U, {0x1ea2}}},
- {0x1ea5, {1|U, {0x1ea4}}},
- {0x1ea7, {1|U, {0x1ea6}}},
- {0x1ea9, {1|U, {0x1ea8}}},
- {0x1eab, {1|U, {0x1eaa}}},
- {0x1ead, {1|U, {0x1eac}}},
- {0x1eaf, {1|U, {0x1eae}}},
- {0x1eb1, {1|U, {0x1eb0}}},
- {0x1eb3, {1|U, {0x1eb2}}},
- {0x1eb5, {1|U, {0x1eb4}}},
- {0x1eb7, {1|U, {0x1eb6}}},
- {0x1eb9, {1|U, {0x1eb8}}},
- {0x1ebb, {1|U, {0x1eba}}},
- {0x1ebd, {1|U, {0x1ebc}}},
- {0x1ebf, {1|U, {0x1ebe}}},
- {0x1ec1, {1|U, {0x1ec0}}},
- {0x1ec3, {1|U, {0x1ec2}}},
- {0x1ec5, {1|U, {0x1ec4}}},
- {0x1ec7, {1|U, {0x1ec6}}},
- {0x1ec9, {1|U, {0x1ec8}}},
- {0x1ecb, {1|U, {0x1eca}}},
- {0x1ecd, {1|U, {0x1ecc}}},
- {0x1ecf, {1|U, {0x1ece}}},
- {0x1ed1, {1|U, {0x1ed0}}},
- {0x1ed3, {1|U, {0x1ed2}}},
- {0x1ed5, {1|U, {0x1ed4}}},
- {0x1ed7, {1|U, {0x1ed6}}},
- {0x1ed9, {1|U, {0x1ed8}}},
- {0x1edb, {1|U, {0x1eda}}},
- {0x1edd, {1|U, {0x1edc}}},
- {0x1edf, {1|U, {0x1ede}}},
- {0x1ee1, {1|U, {0x1ee0}}},
- {0x1ee3, {1|U, {0x1ee2}}},
- {0x1ee5, {1|U, {0x1ee4}}},
- {0x1ee7, {1|U, {0x1ee6}}},
- {0x1ee9, {1|U, {0x1ee8}}},
- {0x1eeb, {1|U, {0x1eea}}},
- {0x1eed, {1|U, {0x1eec}}},
- {0x1eef, {1|U, {0x1eee}}},
- {0x1ef1, {1|U, {0x1ef0}}},
- {0x1ef3, {1|U, {0x1ef2}}},
- {0x1ef5, {1|U, {0x1ef4}}},
- {0x1ef7, {1|U, {0x1ef6}}},
- {0x1ef9, {1|U, {0x1ef8}}},
- {0x1efb, {1|U, {0x1efa}}},
- {0x1efd, {1|U, {0x1efc}}},
- {0x1eff, {1|U, {0x1efe}}},
- {0x1f00, {1|U, {0x1f08}}},
- {0x1f01, {1|U, {0x1f09}}},
- {0x1f02, {1|U, {0x1f0a}}},
- {0x1f03, {1|U, {0x1f0b}}},
- {0x1f04, {1|U, {0x1f0c}}},
- {0x1f05, {1|U, {0x1f0d}}},
- {0x1f06, {1|U, {0x1f0e}}},
- {0x1f07, {1|U, {0x1f0f}}},
- {0x1f10, {1|U, {0x1f18}}},
- {0x1f11, {1|U, {0x1f19}}},
- {0x1f12, {1|U, {0x1f1a}}},
- {0x1f13, {1|U, {0x1f1b}}},
- {0x1f14, {1|U, {0x1f1c}}},
- {0x1f15, {1|U, {0x1f1d}}},
- {0x1f20, {1|U, {0x1f28}}},
- {0x1f21, {1|U, {0x1f29}}},
- {0x1f22, {1|U, {0x1f2a}}},
- {0x1f23, {1|U, {0x1f2b}}},
- {0x1f24, {1|U, {0x1f2c}}},
- {0x1f25, {1|U, {0x1f2d}}},
- {0x1f26, {1|U, {0x1f2e}}},
- {0x1f27, {1|U, {0x1f2f}}},
- {0x1f30, {1|U, {0x1f38}}},
- {0x1f31, {1|U, {0x1f39}}},
- {0x1f32, {1|U, {0x1f3a}}},
- {0x1f33, {1|U, {0x1f3b}}},
- {0x1f34, {1|U, {0x1f3c}}},
- {0x1f35, {1|U, {0x1f3d}}},
- {0x1f36, {1|U, {0x1f3e}}},
- {0x1f37, {1|U, {0x1f3f}}},
- {0x1f40, {1|U, {0x1f48}}},
- {0x1f41, {1|U, {0x1f49}}},
- {0x1f42, {1|U, {0x1f4a}}},
- {0x1f43, {1|U, {0x1f4b}}},
- {0x1f44, {1|U, {0x1f4c}}},
- {0x1f45, {1|U, {0x1f4d}}},
- {0x1f51, {1|U, {0x1f59}}},
- {0x1f53, {1|U, {0x1f5b}}},
- {0x1f55, {1|U, {0x1f5d}}},
- {0x1f57, {1|U, {0x1f5f}}},
- {0x1f60, {1|U, {0x1f68}}},
- {0x1f61, {1|U, {0x1f69}}},
- {0x1f62, {1|U, {0x1f6a}}},
- {0x1f63, {1|U, {0x1f6b}}},
- {0x1f64, {1|U, {0x1f6c}}},
- {0x1f65, {1|U, {0x1f6d}}},
- {0x1f66, {1|U, {0x1f6e}}},
- {0x1f67, {1|U, {0x1f6f}}},
- {0x1f70, {1|U, {0x1fba}}},
- {0x1f71, {1|U, {0x1fbb}}},
- {0x1f72, {1|U, {0x1fc8}}},
- {0x1f73, {1|U, {0x1fc9}}},
- {0x1f74, {1|U, {0x1fca}}},
- {0x1f75, {1|U, {0x1fcb}}},
- {0x1f76, {1|U, {0x1fda}}},
- {0x1f77, {1|U, {0x1fdb}}},
- {0x1f78, {1|U, {0x1ff8}}},
- {0x1f79, {1|U, {0x1ff9}}},
- {0x1f7a, {1|U, {0x1fea}}},
- {0x1f7b, {1|U, {0x1feb}}},
- {0x1f7c, {1|U, {0x1ffa}}},
- {0x1f7d, {1|U, {0x1ffb}}},
- {0x1fb0, {1|U, {0x1fb8}}},
- {0x1fb1, {1|U, {0x1fb9}}},
- {0x1fd0, {1|U, {0x1fd8}}},
- {0x1fd1, {1|U, {0x1fd9}}},
- {0x1fe0, {1|U, {0x1fe8}}},
- {0x1fe1, {1|U, {0x1fe9}}},
- {0x1fe5, {1|U, {0x1fec}}},
- {0x214e, {1|U, {0x2132}}},
- {0x2170, {1|U, {0x2160}}},
- {0x2171, {1|U, {0x2161}}},
- {0x2172, {1|U, {0x2162}}},
- {0x2173, {1|U, {0x2163}}},
- {0x2174, {1|U, {0x2164}}},
- {0x2175, {1|U, {0x2165}}},
- {0x2176, {1|U, {0x2166}}},
- {0x2177, {1|U, {0x2167}}},
- {0x2178, {1|U, {0x2168}}},
- {0x2179, {1|U, {0x2169}}},
- {0x217a, {1|U, {0x216a}}},
- {0x217b, {1|U, {0x216b}}},
- {0x217c, {1|U, {0x216c}}},
- {0x217d, {1|U, {0x216d}}},
- {0x217e, {1|U, {0x216e}}},
- {0x217f, {1|U, {0x216f}}},
- {0x2184, {1|U, {0x2183}}},
- {0x24d0, {1|U, {0x24b6}}},
- {0x24d1, {1|U, {0x24b7}}},
- {0x24d2, {1|U, {0x24b8}}},
- {0x24d3, {1|U, {0x24b9}}},
- {0x24d4, {1|U, {0x24ba}}},
- {0x24d5, {1|U, {0x24bb}}},
- {0x24d6, {1|U, {0x24bc}}},
- {0x24d7, {1|U, {0x24bd}}},
- {0x24d8, {1|U, {0x24be}}},
- {0x24d9, {1|U, {0x24bf}}},
- {0x24da, {1|U, {0x24c0}}},
- {0x24db, {1|U, {0x24c1}}},
- {0x24dc, {1|U, {0x24c2}}},
- {0x24dd, {1|U, {0x24c3}}},
- {0x24de, {1|U, {0x24c4}}},
- {0x24df, {1|U, {0x24c5}}},
- {0x24e0, {1|U, {0x24c6}}},
- {0x24e1, {1|U, {0x24c7}}},
- {0x24e2, {1|U, {0x24c8}}},
- {0x24e3, {1|U, {0x24c9}}},
- {0x24e4, {1|U, {0x24ca}}},
- {0x24e5, {1|U, {0x24cb}}},
- {0x24e6, {1|U, {0x24cc}}},
- {0x24e7, {1|U, {0x24cd}}},
- {0x24e8, {1|U, {0x24ce}}},
- {0x24e9, {1|U, {0x24cf}}},
- {0x2c30, {1|U, {0x2c00}}},
- {0x2c31, {1|U, {0x2c01}}},
- {0x2c32, {1|U, {0x2c02}}},
- {0x2c33, {1|U, {0x2c03}}},
- {0x2c34, {1|U, {0x2c04}}},
- {0x2c35, {1|U, {0x2c05}}},
- {0x2c36, {1|U, {0x2c06}}},
- {0x2c37, {1|U, {0x2c07}}},
- {0x2c38, {1|U, {0x2c08}}},
- {0x2c39, {1|U, {0x2c09}}},
- {0x2c3a, {1|U, {0x2c0a}}},
- {0x2c3b, {1|U, {0x2c0b}}},
- {0x2c3c, {1|U, {0x2c0c}}},
- {0x2c3d, {1|U, {0x2c0d}}},
- {0x2c3e, {1|U, {0x2c0e}}},
- {0x2c3f, {1|U, {0x2c0f}}},
- {0x2c40, {1|U, {0x2c10}}},
- {0x2c41, {1|U, {0x2c11}}},
- {0x2c42, {1|U, {0x2c12}}},
- {0x2c43, {1|U, {0x2c13}}},
- {0x2c44, {1|U, {0x2c14}}},
- {0x2c45, {1|U, {0x2c15}}},
- {0x2c46, {1|U, {0x2c16}}},
- {0x2c47, {1|U, {0x2c17}}},
- {0x2c48, {1|U, {0x2c18}}},
- {0x2c49, {1|U, {0x2c19}}},
- {0x2c4a, {1|U, {0x2c1a}}},
- {0x2c4b, {1|U, {0x2c1b}}},
- {0x2c4c, {1|U, {0x2c1c}}},
- {0x2c4d, {1|U, {0x2c1d}}},
- {0x2c4e, {1|U, {0x2c1e}}},
- {0x2c4f, {1|U, {0x2c1f}}},
- {0x2c50, {1|U, {0x2c20}}},
- {0x2c51, {1|U, {0x2c21}}},
- {0x2c52, {1|U, {0x2c22}}},
- {0x2c53, {1|U, {0x2c23}}},
- {0x2c54, {1|U, {0x2c24}}},
- {0x2c55, {1|U, {0x2c25}}},
- {0x2c56, {1|U, {0x2c26}}},
- {0x2c57, {1|U, {0x2c27}}},
- {0x2c58, {1|U, {0x2c28}}},
- {0x2c59, {1|U, {0x2c29}}},
- {0x2c5a, {1|U, {0x2c2a}}},
- {0x2c5b, {1|U, {0x2c2b}}},
- {0x2c5c, {1|U, {0x2c2c}}},
- {0x2c5d, {1|U, {0x2c2d}}},
- {0x2c5e, {1|U, {0x2c2e}}},
- {0x2c61, {1|U, {0x2c60}}},
- {0x2c65, {1|U, {0x023a}}},
- {0x2c66, {1|U, {0x023e}}},
- {0x2c68, {1|U, {0x2c67}}},
- {0x2c6a, {1|U, {0x2c69}}},
- {0x2c6c, {1|U, {0x2c6b}}},
- {0x2c73, {1|U, {0x2c72}}},
- {0x2c76, {1|U, {0x2c75}}},
- {0x2c81, {1|U, {0x2c80}}},
- {0x2c83, {1|U, {0x2c82}}},
- {0x2c85, {1|U, {0x2c84}}},
- {0x2c87, {1|U, {0x2c86}}},
- {0x2c89, {1|U, {0x2c88}}},
- {0x2c8b, {1|U, {0x2c8a}}},
- {0x2c8d, {1|U, {0x2c8c}}},
- {0x2c8f, {1|U, {0x2c8e}}},
- {0x2c91, {1|U, {0x2c90}}},
- {0x2c93, {1|U, {0x2c92}}},
- {0x2c95, {1|U, {0x2c94}}},
- {0x2c97, {1|U, {0x2c96}}},
- {0x2c99, {1|U, {0x2c98}}},
- {0x2c9b, {1|U, {0x2c9a}}},
- {0x2c9d, {1|U, {0x2c9c}}},
- {0x2c9f, {1|U, {0x2c9e}}},
- {0x2ca1, {1|U, {0x2ca0}}},
- {0x2ca3, {1|U, {0x2ca2}}},
- {0x2ca5, {1|U, {0x2ca4}}},
- {0x2ca7, {1|U, {0x2ca6}}},
- {0x2ca9, {1|U, {0x2ca8}}},
- {0x2cab, {1|U, {0x2caa}}},
- {0x2cad, {1|U, {0x2cac}}},
- {0x2caf, {1|U, {0x2cae}}},
- {0x2cb1, {1|U, {0x2cb0}}},
- {0x2cb3, {1|U, {0x2cb2}}},
- {0x2cb5, {1|U, {0x2cb4}}},
- {0x2cb7, {1|U, {0x2cb6}}},
- {0x2cb9, {1|U, {0x2cb8}}},
- {0x2cbb, {1|U, {0x2cba}}},
- {0x2cbd, {1|U, {0x2cbc}}},
- {0x2cbf, {1|U, {0x2cbe}}},
- {0x2cc1, {1|U, {0x2cc0}}},
- {0x2cc3, {1|U, {0x2cc2}}},
- {0x2cc5, {1|U, {0x2cc4}}},
- {0x2cc7, {1|U, {0x2cc6}}},
- {0x2cc9, {1|U, {0x2cc8}}},
- {0x2ccb, {1|U, {0x2cca}}},
- {0x2ccd, {1|U, {0x2ccc}}},
- {0x2ccf, {1|U, {0x2cce}}},
- {0x2cd1, {1|U, {0x2cd0}}},
- {0x2cd3, {1|U, {0x2cd2}}},
- {0x2cd5, {1|U, {0x2cd4}}},
- {0x2cd7, {1|U, {0x2cd6}}},
- {0x2cd9, {1|U, {0x2cd8}}},
- {0x2cdb, {1|U, {0x2cda}}},
- {0x2cdd, {1|U, {0x2cdc}}},
- {0x2cdf, {1|U, {0x2cde}}},
- {0x2ce1, {1|U, {0x2ce0}}},
- {0x2ce3, {1|U, {0x2ce2}}},
- {0x2cec, {1|U, {0x2ceb}}},
- {0x2cee, {1|U, {0x2ced}}},
- {0x2cf3, {1|U, {0x2cf2}}},
- {0x2d00, {1|U, {0x10a0}}},
- {0x2d01, {1|U, {0x10a1}}},
- {0x2d02, {1|U, {0x10a2}}},
- {0x2d03, {1|U, {0x10a3}}},
- {0x2d04, {1|U, {0x10a4}}},
- {0x2d05, {1|U, {0x10a5}}},
- {0x2d06, {1|U, {0x10a6}}},
- {0x2d07, {1|U, {0x10a7}}},
- {0x2d08, {1|U, {0x10a8}}},
- {0x2d09, {1|U, {0x10a9}}},
- {0x2d0a, {1|U, {0x10aa}}},
- {0x2d0b, {1|U, {0x10ab}}},
- {0x2d0c, {1|U, {0x10ac}}},
- {0x2d0d, {1|U, {0x10ad}}},
- {0x2d0e, {1|U, {0x10ae}}},
- {0x2d0f, {1|U, {0x10af}}},
- {0x2d10, {1|U, {0x10b0}}},
- {0x2d11, {1|U, {0x10b1}}},
- {0x2d12, {1|U, {0x10b2}}},
- {0x2d13, {1|U, {0x10b3}}},
- {0x2d14, {1|U, {0x10b4}}},
- {0x2d15, {1|U, {0x10b5}}},
- {0x2d16, {1|U, {0x10b6}}},
- {0x2d17, {1|U, {0x10b7}}},
- {0x2d18, {1|U, {0x10b8}}},
- {0x2d19, {1|U, {0x10b9}}},
- {0x2d1a, {1|U, {0x10ba}}},
- {0x2d1b, {1|U, {0x10bb}}},
- {0x2d1c, {1|U, {0x10bc}}},
- {0x2d1d, {1|U, {0x10bd}}},
- {0x2d1e, {1|U, {0x10be}}},
- {0x2d1f, {1|U, {0x10bf}}},
- {0x2d20, {1|U, {0x10c0}}},
- {0x2d21, {1|U, {0x10c1}}},
- {0x2d22, {1|U, {0x10c2}}},
- {0x2d23, {1|U, {0x10c3}}},
- {0x2d24, {1|U, {0x10c4}}},
- {0x2d25, {1|U, {0x10c5}}},
- {0x2d27, {1|U, {0x10c7}}},
- {0x2d2d, {1|U, {0x10cd}}},
- {0xa641, {1|U, {0xa640}}},
- {0xa643, {1|U, {0xa642}}},
- {0xa645, {1|U, {0xa644}}},
- {0xa647, {1|U, {0xa646}}},
- {0xa649, {1|U, {0xa648}}},
- {0xa64b, {2|U, {0xa64a, 0x1c88}}},
- {0xa64d, {1|U, {0xa64c}}},
- {0xa64f, {1|U, {0xa64e}}},
- {0xa651, {1|U, {0xa650}}},
- {0xa653, {1|U, {0xa652}}},
- {0xa655, {1|U, {0xa654}}},
- {0xa657, {1|U, {0xa656}}},
- {0xa659, {1|U, {0xa658}}},
- {0xa65b, {1|U, {0xa65a}}},
- {0xa65d, {1|U, {0xa65c}}},
- {0xa65f, {1|U, {0xa65e}}},
- {0xa661, {1|U, {0xa660}}},
- {0xa663, {1|U, {0xa662}}},
- {0xa665, {1|U, {0xa664}}},
- {0xa667, {1|U, {0xa666}}},
- {0xa669, {1|U, {0xa668}}},
- {0xa66b, {1|U, {0xa66a}}},
- {0xa66d, {1|U, {0xa66c}}},
- {0xa681, {1|U, {0xa680}}},
- {0xa683, {1|U, {0xa682}}},
- {0xa685, {1|U, {0xa684}}},
- {0xa687, {1|U, {0xa686}}},
- {0xa689, {1|U, {0xa688}}},
- {0xa68b, {1|U, {0xa68a}}},
- {0xa68d, {1|U, {0xa68c}}},
- {0xa68f, {1|U, {0xa68e}}},
- {0xa691, {1|U, {0xa690}}},
- {0xa693, {1|U, {0xa692}}},
- {0xa695, {1|U, {0xa694}}},
- {0xa697, {1|U, {0xa696}}},
- {0xa699, {1|U, {0xa698}}},
- {0xa69b, {1|U, {0xa69a}}},
- {0xa723, {1|U, {0xa722}}},
- {0xa725, {1|U, {0xa724}}},
- {0xa727, {1|U, {0xa726}}},
- {0xa729, {1|U, {0xa728}}},
- {0xa72b, {1|U, {0xa72a}}},
- {0xa72d, {1|U, {0xa72c}}},
- {0xa72f, {1|U, {0xa72e}}},
- {0xa733, {1|U, {0xa732}}},
- {0xa735, {1|U, {0xa734}}},
- {0xa737, {1|U, {0xa736}}},
- {0xa739, {1|U, {0xa738}}},
- {0xa73b, {1|U, {0xa73a}}},
- {0xa73d, {1|U, {0xa73c}}},
- {0xa73f, {1|U, {0xa73e}}},
- {0xa741, {1|U, {0xa740}}},
- {0xa743, {1|U, {0xa742}}},
- {0xa745, {1|U, {0xa744}}},
- {0xa747, {1|U, {0xa746}}},
- {0xa749, {1|U, {0xa748}}},
- {0xa74b, {1|U, {0xa74a}}},
- {0xa74d, {1|U, {0xa74c}}},
- {0xa74f, {1|U, {0xa74e}}},
- {0xa751, {1|U, {0xa750}}},
- {0xa753, {1|U, {0xa752}}},
- {0xa755, {1|U, {0xa754}}},
- {0xa757, {1|U, {0xa756}}},
- {0xa759, {1|U, {0xa758}}},
- {0xa75b, {1|U, {0xa75a}}},
- {0xa75d, {1|U, {0xa75c}}},
- {0xa75f, {1|U, {0xa75e}}},
- {0xa761, {1|U, {0xa760}}},
- {0xa763, {1|U, {0xa762}}},
- {0xa765, {1|U, {0xa764}}},
- {0xa767, {1|U, {0xa766}}},
- {0xa769, {1|U, {0xa768}}},
- {0xa76b, {1|U, {0xa76a}}},
- {0xa76d, {1|U, {0xa76c}}},
- {0xa76f, {1|U, {0xa76e}}},
- {0xa77a, {1|U, {0xa779}}},
- {0xa77c, {1|U, {0xa77b}}},
- {0xa77f, {1|U, {0xa77e}}},
- {0xa781, {1|U, {0xa780}}},
- {0xa783, {1|U, {0xa782}}},
- {0xa785, {1|U, {0xa784}}},
- {0xa787, {1|U, {0xa786}}},
- {0xa78c, {1|U, {0xa78b}}},
- {0xa791, {1|U, {0xa790}}},
- {0xa793, {1|U, {0xa792}}},
- {0xa797, {1|U, {0xa796}}},
- {0xa799, {1|U, {0xa798}}},
- {0xa79b, {1|U, {0xa79a}}},
- {0xa79d, {1|U, {0xa79c}}},
- {0xa79f, {1|U, {0xa79e}}},
- {0xa7a1, {1|U, {0xa7a0}}},
- {0xa7a3, {1|U, {0xa7a2}}},
- {0xa7a5, {1|U, {0xa7a4}}},
- {0xa7a7, {1|U, {0xa7a6}}},
- {0xa7a9, {1|U, {0xa7a8}}},
- {0xa7b5, {1|U, {0xa7b4}}},
- {0xa7b7, {1|U, {0xa7b6}}},
- {0xab53, {1|U, {0xa7b3}}},
- {0xff41, {1|U, {0xff21}}},
- {0xff42, {1|U, {0xff22}}},
- {0xff43, {1|U, {0xff23}}},
- {0xff44, {1|U, {0xff24}}},
- {0xff45, {1|U, {0xff25}}},
- {0xff46, {1|U, {0xff26}}},
- {0xff47, {1|U, {0xff27}}},
- {0xff48, {1|U, {0xff28}}},
- {0xff49, {1|U, {0xff29}}},
- {0xff4a, {1|U, {0xff2a}}},
- {0xff4b, {1|U, {0xff2b}}},
- {0xff4c, {1|U, {0xff2c}}},
- {0xff4d, {1|U, {0xff2d}}},
- {0xff4e, {1|U, {0xff2e}}},
- {0xff4f, {1|U, {0xff2f}}},
- {0xff50, {1|U, {0xff30}}},
- {0xff51, {1|U, {0xff31}}},
- {0xff52, {1|U, {0xff32}}},
- {0xff53, {1|U, {0xff33}}},
- {0xff54, {1|U, {0xff34}}},
- {0xff55, {1|U, {0xff35}}},
- {0xff56, {1|U, {0xff36}}},
- {0xff57, {1|U, {0xff37}}},
- {0xff58, {1|U, {0xff38}}},
- {0xff59, {1|U, {0xff39}}},
- {0xff5a, {1|U, {0xff3a}}},
- {0x10428, {1|U, {0x10400}}},
- {0x10429, {1|U, {0x10401}}},
- {0x1042a, {1|U, {0x10402}}},
- {0x1042b, {1|U, {0x10403}}},
- {0x1042c, {1|U, {0x10404}}},
- {0x1042d, {1|U, {0x10405}}},
- {0x1042e, {1|U, {0x10406}}},
- {0x1042f, {1|U, {0x10407}}},
- {0x10430, {1|U, {0x10408}}},
- {0x10431, {1|U, {0x10409}}},
- {0x10432, {1|U, {0x1040a}}},
- {0x10433, {1|U, {0x1040b}}},
- {0x10434, {1|U, {0x1040c}}},
- {0x10435, {1|U, {0x1040d}}},
- {0x10436, {1|U, {0x1040e}}},
- {0x10437, {1|U, {0x1040f}}},
- {0x10438, {1|U, {0x10410}}},
- {0x10439, {1|U, {0x10411}}},
- {0x1043a, {1|U, {0x10412}}},
- {0x1043b, {1|U, {0x10413}}},
- {0x1043c, {1|U, {0x10414}}},
- {0x1043d, {1|U, {0x10415}}},
- {0x1043e, {1|U, {0x10416}}},
- {0x1043f, {1|U, {0x10417}}},
- {0x10440, {1|U, {0x10418}}},
- {0x10441, {1|U, {0x10419}}},
- {0x10442, {1|U, {0x1041a}}},
- {0x10443, {1|U, {0x1041b}}},
- {0x10444, {1|U, {0x1041c}}},
- {0x10445, {1|U, {0x1041d}}},
- {0x10446, {1|U, {0x1041e}}},
- {0x10447, {1|U, {0x1041f}}},
- {0x10448, {1|U, {0x10420}}},
- {0x10449, {1|U, {0x10421}}},
- {0x1044a, {1|U, {0x10422}}},
- {0x1044b, {1|U, {0x10423}}},
- {0x1044c, {1|U, {0x10424}}},
- {0x1044d, {1|U, {0x10425}}},
- {0x1044e, {1|U, {0x10426}}},
- {0x1044f, {1|U, {0x10427}}},
- {0x104d8, {1|U, {0x104b0}}},
- {0x104d9, {1|U, {0x104b1}}},
- {0x104da, {1|U, {0x104b2}}},
- {0x104db, {1|U, {0x104b3}}},
- {0x104dc, {1|U, {0x104b4}}},
- {0x104dd, {1|U, {0x104b5}}},
- {0x104de, {1|U, {0x104b6}}},
- {0x104df, {1|U, {0x104b7}}},
- {0x104e0, {1|U, {0x104b8}}},
- {0x104e1, {1|U, {0x104b9}}},
- {0x104e2, {1|U, {0x104ba}}},
- {0x104e3, {1|U, {0x104bb}}},
- {0x104e4, {1|U, {0x104bc}}},
- {0x104e5, {1|U, {0x104bd}}},
- {0x104e6, {1|U, {0x104be}}},
- {0x104e7, {1|U, {0x104bf}}},
- {0x104e8, {1|U, {0x104c0}}},
- {0x104e9, {1|U, {0x104c1}}},
- {0x104ea, {1|U, {0x104c2}}},
- {0x104eb, {1|U, {0x104c3}}},
- {0x104ec, {1|U, {0x104c4}}},
- {0x104ed, {1|U, {0x104c5}}},
- {0x104ee, {1|U, {0x104c6}}},
- {0x104ef, {1|U, {0x104c7}}},
- {0x104f0, {1|U, {0x104c8}}},
- {0x104f1, {1|U, {0x104c9}}},
- {0x104f2, {1|U, {0x104ca}}},
- {0x104f3, {1|U, {0x104cb}}},
- {0x104f4, {1|U, {0x104cc}}},
- {0x104f5, {1|U, {0x104cd}}},
- {0x104f6, {1|U, {0x104ce}}},
- {0x104f7, {1|U, {0x104cf}}},
- {0x104f8, {1|U, {0x104d0}}},
- {0x104f9, {1|U, {0x104d1}}},
- {0x104fa, {1|U, {0x104d2}}},
- {0x104fb, {1|U, {0x104d3}}},
- {0x10cc0, {1|U, {0x10c80}}},
- {0x10cc1, {1|U, {0x10c81}}},
- {0x10cc2, {1|U, {0x10c82}}},
- {0x10cc3, {1|U, {0x10c83}}},
- {0x10cc4, {1|U, {0x10c84}}},
- {0x10cc5, {1|U, {0x10c85}}},
- {0x10cc6, {1|U, {0x10c86}}},
- {0x10cc7, {1|U, {0x10c87}}},
- {0x10cc8, {1|U, {0x10c88}}},
- {0x10cc9, {1|U, {0x10c89}}},
- {0x10cca, {1|U, {0x10c8a}}},
- {0x10ccb, {1|U, {0x10c8b}}},
- {0x10ccc, {1|U, {0x10c8c}}},
- {0x10ccd, {1|U, {0x10c8d}}},
- {0x10cce, {1|U, {0x10c8e}}},
- {0x10ccf, {1|U, {0x10c8f}}},
- {0x10cd0, {1|U, {0x10c90}}},
- {0x10cd1, {1|U, {0x10c91}}},
- {0x10cd2, {1|U, {0x10c92}}},
- {0x10cd3, {1|U, {0x10c93}}},
- {0x10cd4, {1|U, {0x10c94}}},
- {0x10cd5, {1|U, {0x10c95}}},
- {0x10cd6, {1|U, {0x10c96}}},
- {0x10cd7, {1|U, {0x10c97}}},
- {0x10cd8, {1|U, {0x10c98}}},
- {0x10cd9, {1|U, {0x10c99}}},
- {0x10cda, {1|U, {0x10c9a}}},
- {0x10cdb, {1|U, {0x10c9b}}},
- {0x10cdc, {1|U, {0x10c9c}}},
- {0x10cdd, {1|U, {0x10c9d}}},
- {0x10cde, {1|U, {0x10c9e}}},
- {0x10cdf, {1|U, {0x10c9f}}},
- {0x10ce0, {1|U, {0x10ca0}}},
- {0x10ce1, {1|U, {0x10ca1}}},
- {0x10ce2, {1|U, {0x10ca2}}},
- {0x10ce3, {1|U, {0x10ca3}}},
- {0x10ce4, {1|U, {0x10ca4}}},
- {0x10ce5, {1|U, {0x10ca5}}},
- {0x10ce6, {1|U, {0x10ca6}}},
- {0x10ce7, {1|U, {0x10ca7}}},
- {0x10ce8, {1|U, {0x10ca8}}},
- {0x10ce9, {1|U, {0x10ca9}}},
- {0x10cea, {1|U, {0x10caa}}},
- {0x10ceb, {1|U, {0x10cab}}},
- {0x10cec, {1|U, {0x10cac}}},
- {0x10ced, {1|U, {0x10cad}}},
- {0x10cee, {1|U, {0x10cae}}},
- {0x10cef, {1|U, {0x10caf}}},
- {0x10cf0, {1|U, {0x10cb0}}},
- {0x10cf1, {1|U, {0x10cb1}}},
- {0x10cf2, {1|U, {0x10cb2}}},
- {0x118c0, {1|U, {0x118a0}}},
- {0x118c1, {1|U, {0x118a1}}},
- {0x118c2, {1|U, {0x118a2}}},
- {0x118c3, {1|U, {0x118a3}}},
- {0x118c4, {1|U, {0x118a4}}},
- {0x118c5, {1|U, {0x118a5}}},
- {0x118c6, {1|U, {0x118a6}}},
- {0x118c7, {1|U, {0x118a7}}},
- {0x118c8, {1|U, {0x118a8}}},
- {0x118c9, {1|U, {0x118a9}}},
- {0x118ca, {1|U, {0x118aa}}},
- {0x118cb, {1|U, {0x118ab}}},
- {0x118cc, {1|U, {0x118ac}}},
- {0x118cd, {1|U, {0x118ad}}},
- {0x118ce, {1|U, {0x118ae}}},
- {0x118cf, {1|U, {0x118af}}},
- {0x118d0, {1|U, {0x118b0}}},
- {0x118d1, {1|U, {0x118b1}}},
- {0x118d2, {1|U, {0x118b2}}},
- {0x118d3, {1|U, {0x118b3}}},
- {0x118d4, {1|U, {0x118b4}}},
- {0x118d5, {1|U, {0x118b5}}},
- {0x118d6, {1|U, {0x118b6}}},
- {0x118d7, {1|U, {0x118b7}}},
- {0x118d8, {1|U, {0x118b8}}},
- {0x118d9, {1|U, {0x118b9}}},
- {0x118da, {1|U, {0x118ba}}},
- {0x118db, {1|U, {0x118bb}}},
- {0x118dc, {1|U, {0x118bc}}},
- {0x118dd, {1|U, {0x118bd}}},
- {0x118de, {1|U, {0x118be}}},
- {0x118df, {1|U, {0x118bf}}},
- {0x1e922, {1|U, {0x1e900}}},
- {0x1e923, {1|U, {0x1e901}}},
- {0x1e924, {1|U, {0x1e902}}},
- {0x1e925, {1|U, {0x1e903}}},
- {0x1e926, {1|U, {0x1e904}}},
- {0x1e927, {1|U, {0x1e905}}},
- {0x1e928, {1|U, {0x1e906}}},
- {0x1e929, {1|U, {0x1e907}}},
- {0x1e92a, {1|U, {0x1e908}}},
- {0x1e92b, {1|U, {0x1e909}}},
- {0x1e92c, {1|U, {0x1e90a}}},
- {0x1e92d, {1|U, {0x1e90b}}},
- {0x1e92e, {1|U, {0x1e90c}}},
- {0x1e92f, {1|U, {0x1e90d}}},
- {0x1e930, {1|U, {0x1e90e}}},
- {0x1e931, {1|U, {0x1e90f}}},
- {0x1e932, {1|U, {0x1e910}}},
- {0x1e933, {1|U, {0x1e911}}},
- {0x1e934, {1|U, {0x1e912}}},
- {0x1e935, {1|U, {0x1e913}}},
- {0x1e936, {1|U, {0x1e914}}},
- {0x1e937, {1|U, {0x1e915}}},
- {0x1e938, {1|U, {0x1e916}}},
- {0x1e939, {1|U, {0x1e917}}},
- {0x1e93a, {1|U, {0x1e918}}},
- {0x1e93b, {1|U, {0x1e919}}},
- {0x1e93c, {1|U, {0x1e91a}}},
- {0x1e93d, {1|U, {0x1e91b}}},
- {0x1e93e, {1|U, {0x1e91c}}},
- {0x1e93f, {1|U, {0x1e91d}}},
- {0x1e940, {1|U, {0x1e91e}}},
- {0x1e941, {1|U, {0x1e91f}}},
- {0x1e942, {1|U, {0x1e920}}},
- {0x1e943, {1|U, {0x1e921}}},
-#define CaseUnfold_11_Locale (*(CaseUnfold_11_Type (*)[1])(CaseUnfold_11_Table+1266))
- {0x0069, {1|U, {0x0049}}},
-};
-
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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 = 2216, 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, 2219, 2, 14, 4, 807, 9, 379, 10, 179,
- 70, 161, 2, 3, 411, 4, 2219, 2219, 2219, 2219,
- 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 80,
- 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219, 2219,
- 2219, 2219, 2219, 1, 2219, 2219, 2219, 2219, 2219, 2219,
- 2219, 2219, 2219, 210, 2219, 2219, 2219, 2219, 2219, 2219,
- 2219, 2219, 53, 2219, 7, 8, 306, 607, 169, 844,
- 431, 722, 125, 1047, 489, 1394, 15, 16, 324, 1361,
- 140, 521, 47, 461, 221, 985, 70, 965, 9, 1085,
- 51, 1029, 223, 11, 430, 1168, 122, 1457, 344, 930,
- 91, 711, 31, 651, 157, 772, 224, 876, 262, 900,
- 254, 686, 221, 830, 1335, 755, 432, 623, 1382, 675,
- 1275, 587, 99, 821, 1530, 958, 195, 810, 1518, 739,
- 330, 361, 767, 313, 941, 400, 925, 384, 1142, 295,
- 1295, 242, 1103, 229, 1082, 206, 1066, 104, 1317, 137,
- 1249, 263, 1229, 115, 1154, 71, 135, 60, 1211, 158,
- 1472, 175, 1232, 1, 1345, 27, 1269, 38, 1111, 87,
- 1189, 49, 1256, 503, 1157, 574, 1410, 556, 1200, 787,
- 948, 486, 1316, 797, 1218, 1044, 1282, 1007, 1126, 996,
- 818, 1019, 218, 1072
- };
- return asso_values[bits_of(code, 2)+66] + asso_values[bits_of(code, 1)+4] + asso_values[bits_of(code, 0)];
-}
-
-static const CodePointList3 *
-onigenc_unicode_CaseUnfold_11_lookup(const OnigCodePoint code)
-{
- enum
- {
- MIN_CODE_VALUE = 0x61,
- MAX_CODE_VALUE = 0x1e943,
- TOTAL_KEYWORDS = 1267,
- MIN_WORD_LENGTH = 3,
- MAX_WORD_LENGTH = 3,
- MIN_HASH_VALUE = 3,
- MAX_HASH_VALUE = 2218
- };
-
- static const short wordlist[] =
- {
- -1, -1, -1,
- /*0x13e1*/ 542,
- /*0x0461*/ 339,
- /*0x04e1*/ 399,
- /*0x0061*/ 0,
- -1,
- /*0x104e1*/ 1122,
- /*0x1e61*/ 613,
- /*0x1ee1*/ 672,
- /*0x0161*/ 102,
- /*0x0261*/ 210,
- /*0x2ce1*/ 904,
- -1,
- /*0x049b*/ 364,
- -1, -1,
- /*0x24e1*/ 792,
- /*0x1e1b*/ 578,
- /*0x048b*/ 356,
- /*0x011b*/ 69,
- /*0x021b*/ 178,
- /*0x2c9b*/ 869,
- /*0x1e0b*/ 570,
- /*0x1e8b*/ 634,
- /*0x010b*/ 61,
- /*0x020b*/ 170,
- /*0x2c8b*/ 861,
- /*0x13e3*/ 544,
- /*0x0463*/ 340,
- /*0x04e3*/ 400,
- /*0x0063*/ 2,
- /*0x13a4*/ 481,
- /*0x104e3*/ 1124,
- /*0x1e63*/ 614,
- /*0x1ee3*/ 673,
- /*0x0163*/ 103,
- /*0x0263*/ 211,
- /*0x2ce3*/ 905,
- /*0x13e5*/ 546,
- /*0x0465*/ 341,
- /*0x04e5*/ 401,
- /*0x0065*/ 4,
- /*0x24e3*/ 794,
- /*0x104e5*/ 1126,
- /*0x1e65*/ 615,
- /*0x1ee5*/ 674,
- /*0x0165*/ 104,
- /*0x0265*/ 212,
- /*0xa761*/ 1016,
- /*0x13e9*/ 550,
- /*0x0469*/ 343,
- /*0x04e9*/ 403,
- /*0x0069*/ 1266,
- /*0x24e5*/ 796,
- /*0x104e9*/ 1130,
- /*0x1e69*/ 617,
- /*0x1ee9*/ 676,
- /*0x0169*/ 106,
- /*0x0269*/ 215,
- -1,
- /*0x13db*/ 536,
- /*0x045b*/ 334,
- /*0x04db*/ 396,
- -1,
- /*0x24e9*/ 800,
- /*0x104db*/ 1116,
- /*0x1e5b*/ 610,
- /*0x1edb*/ 669,
- /*0x015b*/ 99,
- /*0x025b*/ 207,
- /*0x2cdb*/ 901,
- /*0x13d9*/ 534,
- /*0x0459*/ 332,
- /*0x04d9*/ 395,
- /*0xa763*/ 1017,
- /*0x24db*/ 786,
- /*0x104d9*/ 1114,
- /*0x1e59*/ 609,
- /*0x1ed9*/ 668,
- /*0x0159*/ 98,
- /*0x0259*/ 206,
- /*0x2cd9*/ 900,
- -1,
- /*0x10ce1*/ 1182,
- -1,
- /*0xa765*/ 1018,
- /*0x24d9*/ 784,
- /*0x13e7*/ 548,
- /*0x0467*/ 342,
- /*0x04e7*/ 402,
- /*0x0067*/ 6,
- /*0x13a2*/ 479,
- /*0x104e7*/ 1128,
- /*0x1e67*/ 616,
- /*0x1ee7*/ 675,
- /*0x0167*/ 105,
- /*0xa769*/ 1020,
- -1, -1,
- /*0x13b8*/ 501,
- /*0x0438*/ 299,
- -1,
- /*0x24e7*/ 798,
- /*0x10438*/ 1089,
- /*0x13d1*/ 526,
- /*0x0451*/ 324,
- /*0x04d1*/ 391,
- /*0xa75b*/ 1013,
- -1,
- /*0x10ce3*/ 1184,
- /*0x1e51*/ 605,
- /*0x1ed1*/ 664,
- /*0x0151*/ 94,
- /*0x0251*/ 200,
- /*0x2cd1*/ 896,
- /*0x13d7*/ 532,
- /*0x0457*/ 330,
- /*0x04d7*/ 394,
- /*0xa759*/ 1012,
- /*0x24d1*/ 776,
- /*0x10ce5*/ 1186,
- /*0x1e57*/ 608,
- /*0x1ed7*/ 667,
- /*0x0157*/ 97,
- /*0x0257*/ 205,
- /*0x2cd7*/ 899,
- -1, -1,
- /*0x0586*/ 476,
- -1,
- /*0x24d7*/ 782,
- /*0x10ce9*/ 1190,
- -1, -1,
- /*0xa767*/ 1019,
- /*0x13da*/ 535,
- /*0x045a*/ 333,
- /*0x13d3*/ 528,
- /*0x0453*/ 326,
- /*0x04d3*/ 392,
- /*0x104da*/ 1115,
- /*0xa661*/ 965,
- /*0x10cdb*/ 1176,
- /*0x1e53*/ 606,
- /*0x1ed3*/ 665,
- /*0x0153*/ 95,
- /*0x0253*/ 202,
- /*0x2cd3*/ 897,
- -1, -1,
- /*0x24da*/ 785,
- /*0xa751*/ 1008,
- /*0x24d3*/ 778,
- /*0x10cd9*/ 1174,
- -1, -1, -1,
- /*0x13a6*/ 483,
- /*0x13dd*/ 538,
- /*0x045d*/ 336,
- /*0x04dd*/ 397,
- /*0x03e1*/ 279,
- /*0xa757*/ 1011,
- /*0x104dd*/ 1118,
- /*0x1e5d*/ 611,
- /*0x1edd*/ 670,
- /*0x015d*/ 100,
- /*0xa663*/ 966,
- /*0x2cdd*/ 902,
- /*0x10ce7*/ 1188,
- -1, -1,
- /*0x0582*/ 472,
- /*0x24dd*/ 788,
- -1,
- /*0x13df*/ 540,
- /*0x045f*/ 338,
- /*0x04df*/ 398,
- /*0xa665*/ 967,
- -1,
- /*0x104df*/ 1120,
- /*0x1e5f*/ 612,
- /*0x1edf*/ 671,
- /*0x015f*/ 101,
- /*0xa753*/ 1009,
- /*0x2cdf*/ 903,
- /*0x10cd1*/ 1166,
- /*0x03e3*/ 280,
- /*0xab53*/ 1046,
- /*0xa669*/ 969,
- /*0x24df*/ 790,
- -1, -1,
- /*0x028a*/ 229,
- /*0x028b*/ 230,
- /*0x13bc*/ 505,
- /*0x043c*/ 303,
- /*0x10cd7*/ 1172,
- /*0x03e5*/ 281,
- /*0x1043c*/ 1093,
- /*0xa65b*/ 962,
- -1, -1,
- /*0x013c*/ 84,
- /*0x023c*/ 190,
- /*0xa75d*/ 1014,
- /*0x13cf*/ 524,
- /*0x044f*/ 322,
- /*0x04cf*/ 390,
- /*0x03e9*/ 283,
- /*0x1044f*/ 1112,
- /*0xa659*/ 961,
- /*0x1e4f*/ 604,
- /*0x1ecf*/ 663,
- /*0x014f*/ 93,
- /*0x024f*/ 198,
- /*0x2ccf*/ 895,
- /*0x10cda*/ 1175,
- -1,
- /*0x10cd3*/ 1168,
- /*0x03db*/ 276,
- /*0x13ae*/ 491,
- /*0xa75f*/ 1015,
- /*0x2c61*/ 848,
- /*0x13a8*/ 485,
- /*0x1042e*/ 1079,
- /*0x017e*/ 116,
- /*0xa667*/ 968,
- /*0x10428*/ 1073,
- /*0x13cd*/ 522,
- /*0x044d*/ 320,
- /*0x03d9*/ 275,
- -1,
- /*0x1044d*/ 1110,
- -1,
- /*0x1e4d*/ 603,
- /*0x1ecd*/ 662,
- /*0x014d*/ 92,
- /*0x024d*/ 197,
- /*0x2ccd*/ 894,
- /*0x10cdd*/ 1178,
- -1,
- /*0x13cb*/ 520,
- /*0x044b*/ 318,
- /*0xa651*/ 957,
- -1,
- /*0x1044b*/ 1108,
- /*0x03e7*/ 282,
- /*0x1e4b*/ 602,
- /*0x1ecb*/ 661,
- /*0x014b*/ 91,
- /*0x024b*/ 196,
- /*0x2ccb*/ 893,
- /*0xa74f*/ 1007,
- /*0x13ac*/ 489,
- /*0xa657*/ 960,
- -1,
- /*0x10cdf*/ 1180,
- /*0x1042c*/ 1077,
- /*0x03b8*/ 252,
- /*0x2c65*/ 849,
- -1,
- /*0x13aa*/ 487,
- /*0x13d5*/ 530,
- /*0x0455*/ 328,
- /*0x04d5*/ 393,
- /*0x1042a*/ 1075,
- -1, -1,
- /*0x1e55*/ 607,
- /*0x1ed5*/ 666,
- /*0x0155*/ 96,
- /*0x118db*/ 1227,
- /*0x2cd5*/ 898,
- -1,
- /*0x03d7*/ 274,
- /*0xa74d*/ 1006,
- /*0xa653*/ 958,
- /*0x24d5*/ 780,
- -1, -1, -1,
- /*0x2c5b*/ 844,
- /*0x118d9*/ 1225,
- -1, -1, -1, -1,
- /*0x10ccf*/ 1164,
- /*0xa74b*/ 1005,
- -1, -1, -1,
- /*0x2c59*/ 842,
- -1,
- /*0x13c9*/ 518,
- /*0x0449*/ 316,
- -1,
- /*0xa65d*/ 963,
- /*0x10449*/ 1106,
- /*0x029e*/ 234,
- /*0x1e49*/ 601,
- /*0x1ec9*/ 660,
- -1,
- /*0x0249*/ 195,
- /*0x2cc9*/ 892,
- /*0x1f61*/ 729,
- -1, -1,
- /*0x0580*/ 470,
- /*0xa755*/ 1010,
- /*0x10ccd*/ 1162,
- -1,
- /*0x13c3*/ 512,
- /*0x0443*/ 310,
- /*0xa65f*/ 964,
- /*0x118d1*/ 1217,
- /*0x10443*/ 1100,
- /*0x03dd*/ 277,
- /*0x1e43*/ 598,
- /*0x1ec3*/ 657,
- /*0x2c38*/ 809,
- -1,
- /*0x2cc3*/ 889,
- /*0x10ccb*/ 1160,
- -1,
- /*0x2c51*/ 834,
- /*0x118d7*/ 1223,
- -1, -1,
- /*0x13c0*/ 509,
- /*0x0440*/ 307,
- /*0x1f63*/ 731,
- -1,
- /*0x10440*/ 1097,
- /*0x03df*/ 278,
- /*0x1f24*/ 706,
- /*0x2c57*/ 840,
- /*0x0140*/ 86,
- /*0x0240*/ 192,
- -1, -1,
- /*0xa749*/ 1004,
- /*0x1f65*/ 733,
- /*0x13a0*/ 477,
- /*0x10cd5*/ 1170,
- /*0xa64f*/ 956,
- /*0x118da*/ 1226,
- -1,
- /*0x118d3*/ 1219,
- -1, -1,
- /*0x1f10*/ 696,
- -1, -1,
- /*0x03bc*/ 256,
- -1,
- /*0x2c5a*/ 843,
- -1,
- /*0x2c53*/ 836,
- /*0xa743*/ 1001,
- /*0x13c1*/ 510,
- /*0x0441*/ 308,
- -1, -1,
- /*0x10441*/ 1098,
- -1,
- /*0x1e41*/ 597,
- /*0x1ec1*/ 656,
- /*0xa64d*/ 955,
- /*0x118dd*/ 1229,
- /*0x2cc1*/ 888,
- -1, -1, -1,
- /*0x1f14*/ 700,
- -1,
- /*0x10cc9*/ 1158,
- -1,
- /*0x01e1*/ 151,
- /*0x2c5d*/ 846,
- /*0x03ae*/ 243,
- /*0xa64b*/ 954,
- -1,
- /*0x13c7*/ 516,
- /*0x0447*/ 314,
- -1,
- /*0x118df*/ 1231,
- /*0x10447*/ 1104,
- /*0x03cd*/ 272,
- /*0x1e47*/ 600,
- /*0x1ec7*/ 659,
- /*0x1f67*/ 735,
- /*0x0247*/ 194,
- /*0x2cc7*/ 891,
- /*0x10cc3*/ 1152,
- /*0x1f22*/ 704,
- -1, -1,
- /*0x0292*/ 232,
- /*0x13c5*/ 514,
- /*0x0445*/ 312,
- /*0x03cb*/ 270,
- /*0xa655*/ 959,
- /*0x10445*/ 1102,
- /*0x01e3*/ 152,
- /*0x1e45*/ 599,
- /*0x1ec5*/ 658,
- /*0xa741*/ 1000,
- /*0x1f51*/ 724,
- /*0x2cc5*/ 890,
- /*0x0561*/ 439,
- /*0x10cc0*/ 1149,
- /*0xff59*/ 1071,
- /*0x03ac*/ 241,
- -1,
- /*0x01e5*/ 153,
- /*0x2c3c*/ 813,
- /*0x118cf*/ 1215,
- -1,
- /*0x1f57*/ 727,
- /*0x051b*/ 428,
- -1, -1, -1, -1,
- /*0x050b*/ 420,
- /*0x01e9*/ 155,
- /*0x2c4f*/ 832,
- -1,
- /*0x1f06*/ 694,
- /*0xa747*/ 1003,
- /*0x13b2*/ 495,
- /*0x0432*/ 293,
- /*0x0584*/ 474,
- /*0xa649*/ 953,
- /*0x10432*/ 1083,
- /*0x0563*/ 441,
- /*0x2d16*/ 931,
- -1,
- /*0x2d1b*/ 936,
- /*0x118cd*/ 1213,
- /*0x1f53*/ 725,
- /*0x10cc1*/ 1150,
- /*0x2d0a*/ 919,
- /*0x2d0b*/ 920,
- /*0xff51*/ 1063,
- /*0xa745*/ 1002,
- /*0x0565*/ 443,
- -1, -1,
- /*0x2c4d*/ 830,
- -1,
- /*0xa643*/ 950,
- /*0x118cb*/ 1211,
- /*0x03c9*/ 268,
- -1,
- /*0xff57*/ 1069,
- -1,
- /*0x0569*/ 447,
- /*0x2d24*/ 945,
- -1,
- /*0x1f26*/ 708,
- /*0x0491*/ 359,
- /*0x2c4b*/ 828,
- /*0x01e7*/ 154,
- /*0x10cc7*/ 1156,
- /*0x1e11*/ 573,
- /*0x1e91*/ 637,
- /*0x0111*/ 64,
- /*0x0211*/ 173,
- /*0x2c91*/ 864,
- /*0xa79b*/ 1036,
- /*0x03c3*/ 262,
- /*0x1f02*/ 690,
- /*0x118d5*/ 1221,
- /*0x2d10*/ 925,
- /*0xff5a*/ 1072,
- /*0x1e924*/ 1234,
- /*0xff53*/ 1065,
- /*0x2d18*/ 933,
- -1,
- /*0x10cc5*/ 1154,
- -1,
- /*0x0280*/ 224,
- /*0x2c55*/ 838,
- /*0x13f3*/ 560,
- /*0x0473*/ 348,
- /*0x04f3*/ 408,
- /*0x0073*/ 17,
- /*0x03c0*/ 260,
- /*0x104f3*/ 1140,
- /*0x1e73*/ 622,
- /*0x1ef3*/ 681,
- /*0x0173*/ 111,
- -1,
- /*0x2cf3*/ 908,
- /*0x0567*/ 445,
- -1,
- /*0x2d14*/ 929,
- /*0x019e*/ 126,
- /*0xa641*/ 949,
- /*0x028c*/ 231,
- /*0x13eb*/ 552,
- /*0x046b*/ 344,
- /*0x04eb*/ 404,
- /*0x006b*/ 9,
- /*0x118c9*/ 1209,
- /*0x104eb*/ 1132,
- /*0x1e6b*/ 618,
- /*0x1eeb*/ 677,
- /*0x016b*/ 107,
- /*0x026b*/ 217,
- /*0x01da*/ 147,
- -1, -1, -1,
- /*0x2c49*/ 826,
- -1, -1,
- /*0x2d22*/ 943,
- /*0x03c1*/ 261,
- -1,
- /*0x048f*/ 358,
- /*0xa647*/ 952,
- /*0x118c3*/ 1203,
- /*0x1f12*/ 698,
- /*0x1e0f*/ 572,
- /*0x1e8f*/ 636,
- /*0x010f*/ 63,
- /*0x020f*/ 172,
- /*0x2c8f*/ 863,
- /*0xa69b*/ 985,
- -1, -1,
- /*0x2c43*/ 820,
- /*0x01dd*/ 149,
- /*0xa68b*/ 977,
- /*0x1e922*/ 1232,
- -1,
- /*0xa645*/ 951,
- -1,
- /*0x118c0*/ 1200,
- -1,
- /*0x03c7*/ 266,
- -1,
- /*0x1e938*/ 1254,
- -1,
- /*0xff4f*/ 1061,
- -1,
- /*0xa76b*/ 1021,
- /*0x2d1e*/ 939,
- /*0x2c40*/ 817,
- /*0x01df*/ 150,
- /*0x2d06*/ 915,
- /*0x0373*/ 236,
- /*0x13ef*/ 556,
- /*0x046f*/ 346,
- /*0x04ef*/ 406,
- /*0x006f*/ 13,
- /*0x03c5*/ 264,
- /*0x104ef*/ 1136,
- /*0x1e6f*/ 620,
- /*0x1eef*/ 679,
- /*0x016f*/ 109,
- /*0x026f*/ 219,
- -1, -1,
- /*0x1f55*/ 726,
- /*0x2d0e*/ 923,
- -1,
- /*0xff4d*/ 1059,
- -1,
- /*0x118c1*/ 1201,
- /*0x13ed*/ 554,
- /*0x046d*/ 345,
- /*0x04ed*/ 405,
- /*0x006d*/ 11,
- -1,
- /*0x104ed*/ 1134,
- /*0x1e6d*/ 619,
- /*0x1eed*/ 678,
- /*0x016d*/ 108,
- /*0x2c41*/ 818,
- /*0xff4b*/ 1057,
- /*0x10ceb*/ 1192,
- -1,
- /*0x13b7*/ 500,
- /*0x0437*/ 298,
- /*0x04b7*/ 378,
- -1,
- /*0x10437*/ 1088,
- /*0x03b2*/ 246,
- /*0x1e37*/ 592,
- /*0x1eb7*/ 651,
- /*0x0137*/ 82,
- /*0x118c7*/ 1207,
- /*0x2cb7*/ 883,
- /*0x2d02*/ 911,
- /*0x0192*/ 122,
- -1,
- /*0x019a*/ 125,
- /*0x01a8*/ 130,
- /*0xa76f*/ 1023,
- /*0x1e926*/ 1236,
- /*0xff55*/ 1067,
- /*0x2c47*/ 824,
- /*0x1fe1*/ 755,
- -1,
- /*0x0481*/ 355,
- /*0x0581*/ 471,
- /*0x1f00*/ 688,
- /*0x118c5*/ 1205,
- /*0x1e01*/ 565,
- /*0x1e81*/ 629,
- /*0x0101*/ 56,
- /*0x0201*/ 165,
- /*0x2c81*/ 856,
- /*0x1f43*/ 721,
- -1, -1,
- /*0xa76d*/ 1022,
- /*0x2c45*/ 822,
- /*0x13b3*/ 496,
- /*0x0433*/ 294,
- /*0x04b3*/ 376,
- -1,
- /*0x10433*/ 1084,
- /*0x057e*/ 468,
- /*0x1e33*/ 590,
- /*0x1eb3*/ 649,
- /*0x0133*/ 80,
- /*0x0233*/ 189,
- /*0x2cb3*/ 881,
- /*0xa737*/ 995,
- /*0x1f40*/ 718,
- -1,
- /*0xff49*/ 1055,
- /*0x10cef*/ 1196,
- -1, -1, -1,
- /*0x1e93c*/ 1258,
- /*0xa66b*/ 970,
- /*0x1fe5*/ 756,
- -1,
- /*0x03f3*/ 288,
- -1,
- /*0x217e*/ 772,
- /*0x1f20*/ 702,
- /*0x2d12*/ 927,
- /*0x13a5*/ 482,
- /*0x2d1a*/ 935,
- /*0x04a5*/ 369,
- /*0x2c32*/ 803,
- /*0xff43*/ 1049,
- /*0x10ced*/ 1194,
- /*0x1e25*/ 583,
- /*0x1ea5*/ 642,
- /*0x0125*/ 74,
- /*0x0225*/ 182,
- /*0x2ca5*/ 874,
- -1,
- /*0x03eb*/ 284,
- -1, -1,
- /*0x1f41*/ 719,
- /*0x0288*/ 227,
- /*0x1e92e*/ 1244,
- -1,
- /*0xa733*/ 993,
- /*0x1e928*/ 1238,
- -1,
- /*0x01c9*/ 139,
- -1,
- /*0x13b5*/ 498,
- /*0x0435*/ 296,
- /*0x04b5*/ 377,
- -1,
- /*0x10435*/ 1086,
- -1,
- /*0x1e35*/ 591,
- /*0x1eb5*/ 650,
- /*0x0135*/ 81,
- /*0x0180*/ 117,
- /*0x2cb5*/ 882,
- /*0x13ad*/ 490,
- -1,
- /*0x04ad*/ 373,
- -1,
- /*0x1042d*/ 1078,
- -1,
- /*0x1e2d*/ 587,
- /*0x1ead*/ 646,
- /*0x012d*/ 78,
- /*0x022d*/ 186,
- /*0x2cad*/ 878,
- -1,
- /*0xa725*/ 987,
- -1, -1,
- /*0x1e92c*/ 1242,
- /*0x018c*/ 121,
- /*0xff41*/ 1047,
- -1,
- /*0x1f45*/ 723,
- -1, -1,
- /*0x2c73*/ 854,
- /*0x1e92a*/ 1240,
- /*0x1fd1*/ 753,
- /*0x13a3*/ 480,
- -1,
- /*0x04a3*/ 368,
- /*0xa66d*/ 971,
- -1,
- /*0x03ef*/ 286,
- /*0x1e23*/ 582,
- /*0x1ea3*/ 641,
- /*0x0123*/ 73,
- /*0x0223*/ 181,
- /*0x2ca3*/ 873,
- /*0xa735*/ 994,
- -1, -1,
- /*0x0585*/ 475,
- /*0xff47*/ 1053,
- -1,
- /*0x1e05*/ 567,
- /*0x1e85*/ 631,
- /*0x0105*/ 58,
- /*0x0205*/ 167,
- /*0x2c85*/ 858,
- /*0xa72d*/ 991,
- /*0x03ed*/ 285,
- /*0x2d00*/ 909,
- /*0x1f04*/ 692,
- /*0x1f32*/ 712,
- -1,
- /*0x13bf*/ 508,
- /*0x043f*/ 306,
- /*0x04bf*/ 382,
- /*0xff45*/ 1051,
- /*0x1043f*/ 1096,
- -1,
- /*0x1e3f*/ 596,
- /*0x1ebf*/ 655,
- /*0x03b7*/ 251,
- /*0x023f*/ 191,
- /*0x2cbf*/ 887,
- -1, -1, -1,
- /*0x2d0c*/ 921,
- -1,
- /*0x13b1*/ 494,
- /*0x0431*/ 292,
- /*0x04b1*/ 375,
- /*0xa723*/ 986,
- /*0x10431*/ 1082,
- /*0x1e943*/ 1265,
- /*0x1e31*/ 589,
- /*0x1eb1*/ 648,
- -1,
- /*0x0231*/ 188,
- /*0x2cb1*/ 880,
- /*0x1f11*/ 697,
- /*0x13c2*/ 511,
- /*0x0442*/ 309,
- /*0x04c2*/ 383,
- -1,
- /*0x10442*/ 1099,
- /*0x13a7*/ 484,
- /*0x2d20*/ 941,
- /*0x04a7*/ 370,
- /*0x0142*/ 87,
- /*0x0242*/ 193,
- /*0x1e940*/ 1262,
- /*0x1e27*/ 584,
- /*0x1ea7*/ 643,
- /*0x0127*/ 75,
- /*0x0227*/ 183,
- /*0x2ca7*/ 875,
- /*0x03b3*/ 247,
- -1,
- /*0xa78c*/ 1031,
- /*0xa73f*/ 999,
- /*0x13f1*/ 558,
- /*0x0471*/ 347,
- /*0x04f1*/ 407,
- /*0x0071*/ 15,
- /*0x1f73*/ 739,
- /*0x104f1*/ 1138,
- /*0x1e71*/ 621,
- /*0x1ef1*/ 680,
- /*0x0171*/ 110,
- /*0x0271*/ 220,
- /*0x13f5*/ 562,
- /*0x0475*/ 349,
- /*0x04f5*/ 409,
- /*0x0075*/ 19,
- -1,
- /*0x104f5*/ 1142,
- /*0x1e75*/ 623,
- /*0x1ef5*/ 682,
- /*0x0175*/ 112,
- /*0x0275*/ 222,
- /*0x00e1*/ 26,
- /*0x1e941*/ 1263,
- /*0x2c37*/ 808,
- /*0x13bd*/ 506,
- /*0x043d*/ 304,
- /*0x04bd*/ 381,
- -1,
- /*0x1043d*/ 1094,
- -1,
- /*0x1e3d*/ 595,
- /*0x1ebd*/ 654,
- -1,
- /*0xa727*/ 988,
- /*0x2cbd*/ 886,
- /*0x13b9*/ 502,
- /*0x0439*/ 300,
- /*0x04b9*/ 379,
- -1,
- /*0x10439*/ 1090,
- /*0x017c*/ 115,
- /*0x1e39*/ 593,
- /*0x1eb9*/ 652,
- -1,
- /*0x13af*/ 492,
- /*0x2cb9*/ 884,
- /*0x04af*/ 374,
- /*0x00e3*/ 28,
- /*0x1042f*/ 1080,
- /*0x03b5*/ 249,
- /*0x1e2f*/ 588,
- /*0x1eaf*/ 647,
- /*0x012f*/ 79,
- /*0x022f*/ 187,
- /*0x2caf*/ 879,
- -1, -1, -1,
- /*0x00e5*/ 30,
- /*0x2c33*/ 804,
- /*0x03ad*/ 242,
- /*0x0583*/ 473,
- -1,
- /*0x10cc2*/ 1151,
- /*0x1e03*/ 566,
- /*0x1e83*/ 630,
- /*0x0103*/ 57,
- /*0x0203*/ 166,
- /*0x2c83*/ 857,
- /*0x00e9*/ 34,
- /*0x0371*/ 235,
- /*0xa73d*/ 998,
- -1,
- /*0x2d1c*/ 937,
- /*0x2d04*/ 913,
- -1, -1, -1,
- /*0x01f3*/ 159,
- /*0xa77c*/ 1025,
- -1,
- /*0x0188*/ 120,
- /*0xa739*/ 996,
- /*0x10cf1*/ 1198,
- -1,
- /*0x0511*/ 423,
- -1, -1, -1, -1,
- /*0x13a9*/ 486,
- /*0xa72f*/ 992,
- /*0x04a9*/ 371,
- /*0x1e932*/ 1248,
- /*0x10429*/ 1074,
- /*0x01eb*/ 156,
- /*0x1e29*/ 585,
- /*0x1ea9*/ 644,
- /*0x0129*/ 76,
- /*0x0229*/ 184,
- /*0x2ca9*/ 876,
- /*0x037c*/ 239,
- -1, -1,
- /*0x2d11*/ 926,
- -1,
- /*0x1f37*/ 717,
- /*0x00e7*/ 32,
- -1, -1,
- /*0x0573*/ 457,
- /*0x2c35*/ 806,
- -1,
- /*0x03bf*/ 259,
- /*0x13ab*/ 488,
- -1,
- /*0x04ab*/ 372,
- -1,
- /*0x1042b*/ 1076,
- -1,
- /*0x1e2b*/ 586,
- /*0x1eab*/ 645,
- /*0x012b*/ 77,
- /*0x022b*/ 185,
- /*0x2cab*/ 877,
- -1,
- /*0x1f01*/ 689,
- /*0x056b*/ 449,
- -1,
- /*0x03b1*/ 245,
- /*0x2173*/ 761,
- -1,
- /*0x2d08*/ 917,
- -1, -1, -1,
- /*0xa791*/ 1032,
- /*0xa729*/ 989,
- -1,
- /*0x13c6*/ 515,
- /*0x0446*/ 313,
- /*0x04c6*/ 385,
- /*0x1f33*/ 713,
- /*0x10446*/ 1103,
- /*0x13a1*/ 478,
- /*0x050f*/ 422,
- /*0x04a1*/ 367,
- /*0x0146*/ 89,
- /*0x01ef*/ 158,
- -1,
- /*0x1e21*/ 581,
- /*0x1ea1*/ 640,
- /*0x0121*/ 72,
- -1,
- /*0x2ca1*/ 872,
- /*0x13c4*/ 513,
- /*0x0444*/ 311,
- /*0x04c4*/ 384,
- -1,
- /*0x10444*/ 1101,
- -1,
- /*0xa72b*/ 990,
- /*0x13f2*/ 559,
- /*0x0144*/ 88,
- /*0x2d0f*/ 924,
- /*0x0072*/ 16,
- /*0x01ed*/ 157,
- /*0x104f2*/ 1139,
- -1, -1,
- /*0x1f25*/ 707,
- /*0x0272*/ 221,
- /*0x13bb*/ 504,
- /*0x043b*/ 302,
- /*0x04bb*/ 380,
- /*0x2c3f*/ 816,
- /*0x1043b*/ 1092,
- -1,
- /*0x1e3b*/ 594,
- /*0x1ebb*/ 653,
- /*0x056f*/ 453,
- /*0x0495*/ 361,
- /*0x2cbb*/ 885,
- -1,
- /*0x03bd*/ 257,
- /*0x1e15*/ 575,
- /*0x1e95*/ 639,
- /*0x0115*/ 66,
- /*0x0215*/ 175,
- /*0x2c95*/ 866,
- -1,
- /*0x2c31*/ 802,
- -1,
- /*0x118c2*/ 1202,
- /*0x1f35*/ 715,
- /*0x03b9*/ 253,
- /*0xa691*/ 980,
- -1,
- /*0x056d*/ 451,
- -1, -1,
- /*0x0493*/ 360,
- -1,
- /*0x2c42*/ 819,
- /*0x03af*/ 244,
- /*0x1e13*/ 574,
- /*0x1e93*/ 638,
- /*0x0113*/ 65,
- /*0x0213*/ 174,
- /*0x2c93*/ 865,
- -1,
- /*0x047b*/ 352,
- /*0x04fb*/ 412,
- -1, -1,
- /*0x104fb*/ 1148,
- /*0x1e7b*/ 626,
- /*0x1efb*/ 685,
- -1,
- /*0xa73b*/ 997,
- -1,
- /*0x10cc6*/ 1155,
- /*0x0479*/ 351,
- /*0x04f9*/ 411,
- /*0x0079*/ 23,
- -1,
- /*0x104f9*/ 1146,
- /*0x1e79*/ 625,
- /*0x1ef9*/ 684,
- -1,
- /*0x1f23*/ 705,
- /*0x0501*/ 415,
- -1, -1,
- /*0x047d*/ 353,
- /*0x04fd*/ 413,
- /*0x0283*/ 225,
- /*0x10cc4*/ 1153,
- /*0x00fe*/ 54,
- /*0x1e7d*/ 627,
- /*0x1efd*/ 686,
- /*0x1f05*/ 693,
- /*0x027d*/ 223,
- /*0x01a5*/ 129,
- /*0x10cf2*/ 1199,
- /*0x0499*/ 363,
- /*0x2c3d*/ 814,
- -1,
- /*0x1e937*/ 1253,
- /*0x1e19*/ 577,
- /*0x2d01*/ 910,
- /*0x0119*/ 68,
- /*0x0219*/ 177,
- /*0x2c99*/ 868,
- -1, -1,
- /*0xa68f*/ 979,
- /*0x2c39*/ 810,
- -1,
- /*0x0477*/ 350,
- /*0x04f7*/ 410,
- /*0x0077*/ 21,
- /*0xa7b7*/ 1045,
- /*0x104f7*/ 1144,
- /*0x1e77*/ 624,
- /*0x1ef7*/ 683,
- /*0x0177*/ 113,
- /*0x1e07*/ 568,
- /*0x1e87*/ 632,
- /*0x0107*/ 59,
- /*0x0207*/ 168,
- /*0x2c87*/ 859,
- -1,
- /*0x1d79*/ 563,
- /*0x1f31*/ 711,
- /*0x0525*/ 433,
- -1, -1,
- /*0x01ad*/ 131,
- /*0x037b*/ 238,
- /*0x13d0*/ 525,
- /*0x0450*/ 323,
- /*0xa781*/ 1027,
- -1,
- /*0x1e933*/ 1249,
- /*0x1d7d*/ 564,
- /*0x1f42*/ 720,
- /*0x047f*/ 354,
- /*0x04ff*/ 414,
- /*0x0250*/ 199,
- -1,
- /*0x1f27*/ 709,
- /*0x1e7f*/ 628,
- /*0x1eff*/ 687,
- /*0x2d25*/ 946,
- /*0x24d0*/ 775,
- /*0x13ce*/ 523,
- /*0x044e*/ 321,
- /*0x04ce*/ 389,
- /*0x03c6*/ 265,
- /*0x1044e*/ 1111,
- /*0x0497*/ 362,
- /*0x037d*/ 240,
- /*0x01a3*/ 128,
- -1,
- /*0x1e17*/ 576,
- /*0x1f71*/ 737,
- /*0x0117*/ 67,
- /*0x0217*/ 176,
- /*0x2c97*/ 867,
- /*0x052d*/ 437,
- -1,
- /*0x1e925*/ 1235,
- -1,
- /*0x0185*/ 119,
- /*0x03c4*/ 263,
- /*0x1f75*/ 741,
- /*0x13cc*/ 521,
- /*0x044c*/ 319,
- /*0x04cc*/ 388,
- -1,
- /*0x1044c*/ 1109,
- /*0x03f2*/ 287,
- /*0xff42*/ 1048,
- -1,
- /*0x13e6*/ 547,
- /*0xa7a5*/ 1041,
- /*0x0377*/ 237,
- /*0x0066*/ 5,
- /*0x2d2d*/ 948,
- /*0x104e6*/ 1127,
- /*0x01bf*/ 137,
- /*0x03bb*/ 255,
- /*0xa77f*/ 1026,
- /*0x0266*/ 213,
- /*0x0523*/ 432,
- /*0x1e935*/ 1251,
- /*0x1f7c*/ 748,
- -1, -1,
- /*0x24e6*/ 797,
- -1,
- /*0xa681*/ 972,
- /*0x007a*/ 24,
- -1,
- /*0x104fa*/ 1147,
- /*0x0505*/ 417,
- /*0x1e92d*/ 1243,
- /*0x017a*/ 114,
- -1,
- /*0xa7b5*/ 1044,
- /*0x118c6*/ 1206,
- -1, -1,
- /*0x2d23*/ 944,
- -1,
- /*0x13c8*/ 517,
- /*0x0448*/ 315,
- /*0x04c8*/ 386,
- -1,
- /*0x10448*/ 1105,
- /*0x2c46*/ 823,
- /*0x10cd0*/ 1165,
- /*0x1f03*/ 691,
- /*0x0148*/ 90,
- /*0x2d05*/ 914,
- /*0x2184*/ 774,
- /*0x118c4*/ 1204,
- /*0x13d8*/ 533,
- /*0x0458*/ 331,
- /*0x03fb*/ 290,
- /*0x13ec*/ 553,
- /*0x1e923*/ 1233,
- /*0x104d8*/ 1113,
- /*0x006c*/ 10,
- -1,
- /*0x104ec*/ 1133,
- /*0x2c44*/ 821,
- /*0x10cce*/ 1163,
- -1,
- /*0x026c*/ 218,
- /*0x2cec*/ 906,
- -1,
- /*0x24d8*/ 783,
- /*0x049d*/ 365,
- -1,
- /*0xa7a3*/ 1040,
- /*0xa77a*/ 1024,
- /*0x1e1d*/ 579,
- /*0x01f5*/ 160,
- /*0x011d*/ 70,
- /*0x021d*/ 179,
- /*0x2c9d*/ 870,
- -1,
- /*0x2c3b*/ 812,
- -1,
- /*0x0527*/ 434,
- /*0xa785*/ 1029,
- -1,
- /*0x10ccc*/ 1161,
- /*0x1e93f*/ 1261,
- -1,
- /*0x01bd*/ 136,
- /*0x13e8*/ 549,
- -1, -1,
- /*0x0068*/ 7,
- /*0x10ce6*/ 1187,
- /*0x104e8*/ 1129,
- -1, -1,
- /*0x0571*/ 455,
- /*0x0268*/ 214,
- /*0x01b9*/ 135,
- /*0x13f0*/ 557,
- /*0x2d27*/ 947,
- /*0x1e931*/ 1247,
- /*0x0070*/ 14,
- /*0x24e8*/ 799,
- /*0x104f0*/ 1137,
- -1,
- /*0x0575*/ 459,
- -1, -1, -1,
- /*0x13dc*/ 537,
- /*0x045c*/ 335,
- -1,
- /*0x1e942*/ 1264,
- -1,
- /*0x104dc*/ 1117,
- /*0x2171*/ 759,
- -1,
- /*0x1e927*/ 1237,
- /*0x025c*/ 208,
- /*0x0076*/ 20,
- /*0x0183*/ 118,
- /*0x104f6*/ 1143,
- /*0x10cc8*/ 1157,
- /*0x0287*/ 226,
- /*0x24dc*/ 787,
- /*0x2175*/ 763,
- /*0x057c*/ 466,
- /*0x13d6*/ 531,
- /*0x0456*/ 329,
- -1,
- /*0x13e0*/ 541,
- /*0xa7a7*/ 1042,
- -1,
- /*0x1f21*/ 703,
- /*0x10cd8*/ 1173,
- /*0x104e0*/ 1121,
- /*0x0256*/ 204,
- /*0x10cec*/ 1193,
- /*0x052f*/ 438,
- /*0x0260*/ 209,
- /*0x03ce*/ 273,
- /*0xa685*/ 974,
- /*0x24d6*/ 781,
- -1,
- /*0x1f44*/ 722,
- /*0x24e0*/ 791,
- /*0x217c*/ 770,
- /*0x13d4*/ 529,
- /*0x0454*/ 327,
- -1, -1,
- /*0x1f72*/ 738,
- /*0x0503*/ 416,
- -1,
- /*0x13ea*/ 551,
- /*0x1e93d*/ 1259,
- /*0x0254*/ 203,
- /*0x006a*/ 8,
- -1,
- /*0x104ea*/ 1131,
- -1,
- /*0x03cc*/ 271,
- /*0x24d4*/ 779,
- /*0x026a*/ 216,
- -1,
- /*0xff46*/ 1052,
- /*0x1e939*/ 1255,
- /*0x13e4*/ 545,
- /*0x1f15*/ 701,
- /*0x10ce8*/ 1189,
- /*0x0064*/ 3,
- /*0x2d03*/ 912,
- /*0x104e4*/ 1125,
- /*0x13b6*/ 499,
- /*0x0436*/ 297,
- /*0x1e92f*/ 1245,
- /*0x118d0*/ 1216,
- /*0x10436*/ 1087,
- -1, -1,
- /*0x10cf0*/ 1197,
- /*0xff44*/ 1050,
- /*0x24e4*/ 795,
- /*0x0078*/ 22,
- /*0x0529*/ 435,
- /*0x104f8*/ 1145,
- /*0x2c50*/ 833,
- -1,
- /*0x1f13*/ 699,
- -1,
- /*0x00f3*/ 44,
- /*0x10cdc*/ 1177,
- /*0x118ce*/ 1214,
- /*0x13ca*/ 519,
- /*0x044a*/ 317,
- /*0x04ca*/ 387,
- -1,
- /*0x1044a*/ 1107,
- -1,
- /*0x1f7b*/ 747,
- /*0x03c8*/ 267,
- /*0x01c6*/ 138,
- /*0x2c4e*/ 831,
- /*0xa783*/ 1028,
- -1, -1,
- /*0x01a1*/ 127,
- /*0x00eb*/ 36,
- /*0x052b*/ 436,
- /*0x10cd6*/ 1171,
- /*0x1f79*/ 745,
- -1,
- /*0x10ce0*/ 1181,
- /*0x118cc*/ 1212,
- /*0x13f4*/ 561,
- /*0x13d2*/ 527,
- /*0x0452*/ 325,
- /*0x0074*/ 18,
- -1,
- /*0x104f4*/ 1141,
- -1,
- /*0x1e929*/ 1239,
- /*0x1f7d*/ 749,
- /*0x2c4c*/ 829,
- /*0x0252*/ 201,
- -1, -1, -1, -1,
- /*0x10cd4*/ 1169,
- /*0x24d2*/ 777,
- /*0x2c66*/ 850,
- -1,
- /*0x13b0*/ 493,
- /*0x0430*/ 291,
- /*0xa7a9*/ 1043,
- /*0x10cea*/ 1191,
- /*0x10430*/ 1081,
- /*0x0521*/ 431,
- -1, -1,
- /*0x0195*/ 123,
- -1,
- /*0x13e2*/ 543,
- /*0x029d*/ 233,
- /*0x1e92b*/ 1241,
- /*0x0062*/ 1,
- /*0x1f77*/ 743,
- /*0x104e2*/ 1123,
- /*0x10ce4*/ 1185,
- /*0x1f07*/ 695,
- -1,
- /*0x118c8*/ 1208,
- -1, -1, -1,
- /*0x0572*/ 456,
- /*0x2d21*/ 942,
- /*0x24e2*/ 793,
- /*0x1fb1*/ 751,
- /*0x00ef*/ 40,
- /*0x048d*/ 357,
- /*0x2c48*/ 825,
- /*0xa683*/ 973,
- /*0x118d8*/ 1224,
- /*0x1e0d*/ 571,
- /*0x1e8d*/ 635,
- /*0x010d*/ 62,
- /*0x020d*/ 171,
- /*0x2c8d*/ 862,
- -1, -1,
- /*0x01fb*/ 162,
- /*0x0515*/ 425,
- /*0x2c58*/ 841,
- /*0x10cca*/ 1159,
- /*0x2172*/ 760,
- /*0x2c6c*/ 853,
- /*0x00ed*/ 38,
- -1,
- /*0x13b4*/ 497,
- /*0x0434*/ 295,
- -1,
- /*0x01f9*/ 161,
- /*0x10434*/ 1085,
- -1, -1, -1, -1,
- /*0xa7a1*/ 1039,
- -1, -1,
- /*0x2d15*/ 930,
- /*0x0513*/ 424,
- -1,
- /*0x01fd*/ 163,
- -1,
- /*0x10cd2*/ 1167,
- /*0x1e09*/ 569,
- /*0x1e89*/ 633,
- /*0x0109*/ 60,
- /*0x0209*/ 169,
- /*0x2c89*/ 860,
- /*0x1e93b*/ 1257,
- /*0x057b*/ 465,
- /*0x0199*/ 124,
- /*0xff50*/ 1062,
- -1,
- /*0x13ee*/ 555,
- /*0x2c68*/ 851,
- -1,
- /*0x006e*/ 12,
- /*0x2d13*/ 928,
- /*0x104ee*/ 1135,
- /*0x1f66*/ 734,
- /*0x0579*/ 463,
- -1, -1,
- /*0x2cee*/ 907,
- -1, -1,
- /*0x118dc*/ 1228,
- /*0xff4e*/ 1060,
- -1,
- /*0x217b*/ 769,
- /*0x10ce2*/ 1183,
- -1,
- /*0x057d*/ 467,
- -1,
- /*0x1f7a*/ 746,
- -1,
- /*0x2c5c*/ 845,
- -1,
- /*0x03b6*/ 250,
- -1,
- /*0x2179*/ 767,
- -1,
- /*0x0519*/ 427,
- /*0x2c76*/ 855,
- /*0x118d6*/ 1222,
- /*0x03f8*/ 289,
- -1,
- /*0x01d0*/ 142,
- /*0xff4c*/ 1058,
- /*0xa793*/ 1033,
- -1, -1,
- /*0x217d*/ 771,
- /*0x01ff*/ 164,
- /*0x2c56*/ 839,
- -1, -1,
- /*0x0577*/ 461,
- /*0x03ca*/ 269,
- -1,
- /*0x0507*/ 418,
- /*0x2d19*/ 934,
- /*0x049f*/ 366,
- /*0x01ce*/ 141,
- /*0x118d4*/ 1220,
- -1,
- /*0x1e1f*/ 580,
- -1,
- /*0x011f*/ 71,
- /*0x021f*/ 180,
- /*0x2c9f*/ 871,
- -1, -1, -1,
- /*0x2c54*/ 837,
- /*0x13de*/ 539,
- /*0x045e*/ 337,
- /*0x2177*/ 765,
- -1,
- /*0x2d07*/ 916,
- /*0x104de*/ 1119,
- /*0x2c6a*/ 852,
- -1, -1,
- /*0x01cc*/ 140,
- /*0x057f*/ 469,
- -1,
- /*0xff48*/ 1054,
- -1,
- /*0xa695*/ 982,
- /*0x24de*/ 789,
- -1, -1,
- /*0xa799*/ 1035,
- -1,
- /*0x10cee*/ 1195,
- -1, -1,
- /*0x0517*/ 426,
- /*0xff58*/ 1070,
- /*0x2c36*/ 807,
- -1, -1, -1, -1,
- /*0x217f*/ 773,
- -1, -1,
- /*0x1f70*/ 736,
- /*0xa693*/ 981,
- /*0x118ca*/ 1210,
- /*0xa787*/ 1030,
- -1, -1, -1,
- /*0x214e*/ 757,
- -1,
- /*0x2d17*/ 932,
- -1, -1,
- /*0x2c4a*/ 827,
- /*0x13be*/ 507,
- /*0x043e*/ 305,
- -1,
- /*0x0566*/ 444,
- /*0x1043e*/ 1095,
- /*0x1f76*/ 742,
- -1, -1,
- /*0x013e*/ 85,
- -1, -1,
- /*0x118d2*/ 1218,
- /*0x13ba*/ 503,
- /*0x043a*/ 301,
- /*0x01d8*/ 146,
- -1,
- /*0x1043a*/ 1091,
- -1,
- /*0x057a*/ 464,
- /*0x1f60*/ 728,
- /*0x013a*/ 83,
- /*0x2c52*/ 835,
- -1, -1,
- /*0x03b4*/ 248,
- -1, -1, -1,
- /*0xa797*/ 1034,
- -1, -1, -1,
- /*0xa699*/ 984,
- -1, -1, -1,
- /*0x10cde*/ 1179,
- -1,
- /*0x217a*/ 768,
- /*0x2c30*/ 801,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x056c*/ 450,
- /*0xa687*/ 975,
- -1, -1,
- /*0xff56*/ 1068,
- /*0x0289*/ 228,
- -1,
- /*0x1f64*/ 732,
- -1, -1, -1,
- /*0x051d*/ 429,
- -1,
- /*0x1f36*/ 716,
- -1, -1, -1, -1, -1, -1,
- /*0x1f78*/ 744,
- -1,
- /*0x01dc*/ 148,
- -1,
- /*0xff54*/ 1066,
- -1,
- /*0x00f1*/ 42,
- -1, -1, -1,
- /*0x2d1d*/ 938,
- -1,
- /*0x0568*/ 446,
- -1, -1, -1,
- /*0x00f5*/ 46,
- /*0x2c34*/ 805,
- -1,
- /*0xa697*/ 983,
- /*0x01d6*/ 145,
- -1, -1,
- /*0x0570*/ 454,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x1f74*/ 740,
- -1, -1,
- /*0x00fc*/ 52,
- -1, -1,
- /*0x01d4*/ 144,
- /*0x0576*/ 460,
- /*0xa79d*/ 1037,
- /*0x2170*/ 758,
- -1, -1, -1, -1, -1, -1,
- /*0xff4a*/ 1056,
- -1, -1,
- /*0x1f30*/ 710,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2176*/ 764,
- -1,
- /*0x1f62*/ 730,
- -1, -1,
- /*0x01b6*/ 134,
- -1, -1, -1, -1, -1,
- /*0xff52*/ 1064,
- -1, -1, -1, -1, -1, -1,
- /*0x056a*/ 448,
- -1, -1, -1, -1, -1,
- /*0x1fd0*/ 752,
- -1, -1, -1, -1, -1,
- /*0x03be*/ 258,
- /*0x0564*/ 442,
- -1, -1, -1, -1,
- /*0x118de*/ 1230,
- -1, -1,
- /*0x1f34*/ 714,
- -1, -1,
- /*0x03ba*/ 254,
- -1,
- /*0x0578*/ 462,
- -1,
- /*0x2c5e*/ 847,
- /*0x01d2*/ 143,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x2178*/ 766,
- /*0x01b0*/ 132,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1e936*/ 1252,
- -1, -1, -1,
- /*0x0574*/ 458,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2c3e*/ 815,
- -1, -1, -1, -1, -1,
- /*0x2174*/ 762,
- -1, -1, -1, -1, -1,
- /*0x2c3a*/ 811,
- -1,
- /*0x00f2*/ 43,
- /*0x0562*/ 440,
- -1, -1, -1, -1,
- /*0x01b4*/ 133,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x050d*/ 421,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x1e930*/ 1246,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2d0d*/ 922,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x00fb*/ 51,
- -1,
- /*0x0509*/ 419,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x00f9*/ 49,
- -1, -1, -1, -1, -1, -1,
- /*0x056e*/ 452,
- -1, -1,
- /*0x2d09*/ 918,
- -1,
- /*0x00fd*/ 53,
- -1, -1, -1,
- /*0x1e934*/ 1250,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1fe0*/ 754,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x051f*/ 430,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x00ff*/ 55,
- -1, -1, -1,
- /*0xa68d*/ 978,
- -1, -1, -1,
- /*0x2d1f*/ 940,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xa689*/ 976,
- -1,
- /*0x00e6*/ 31,
- /*0xa79f*/ 1038,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x00fa*/ 50,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1fb0*/ 750,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x00ec*/ 37,
- -1,
- /*0x1e93e*/ 1260,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x1e93a*/ 1256,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x00e8*/ 33,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x00f0*/ 41,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x00f6*/ 47,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x00e0*/ 25,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x00ea*/ 35,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x00e4*/ 29,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x00f8*/ 48,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x00f4*/ 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,
- /*0x00e2*/ 27,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x00ee*/ 39
- };
-
- if (code <= MAX_CODE_VALUE && code >= MIN_CODE_VALUE)
- {
- register unsigned int key = onigenc_unicode_CaseUnfold_11_hash(code);
-
- if (key <= MAX_HASH_VALUE)
- {
- 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}}},
-};
-
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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)];
-}
-
-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 unsigned int key = onigenc_unicode_CaseUnfold_12_hash(codes);
-
- if (key <= MAX_HASH_VALUE)
- {
- 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}}},
-};
-
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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)];
-}
-
-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 unsigned int key = onigenc_unicode_CaseUnfold_13_hash(codes);
-
- if (key <= MAX_HASH_VALUE)
- {
- register short s = wordlist[key];
-
- if (s >= 0 && code3_equal(codes, CaseUnfold_13_Table[s].from))
- return &CaseUnfold_13_Table[s].to;
- }
- }
- return 0;
-}
-
-static const OnigCodePoint CaseMappingSpecials[] = {
- L(1)|0x039C,
- L(2)|0x0053, 0x0073, L(2)|0x0053, 0x0053,
- L(2)|0x02BC, 0x004E,
- L(1)|0x0053,
- L(1)|0x01C5,
- L(2)|0x0064, 0x017D, L(1)|0x01C4,
- L(1)|0x01C8,
- L(2)|0x006C, 0x004A, L(1)|0x01C7,
- L(1)|0x01CB,
- L(2)|0x006E, 0x004A, L(1)|0x01CA,
- L(2)|0x004A, 0x030C,
- L(1)|0x01F2,
- L(2)|0x0064, 0x005A, L(1)|0x01F1,
- L(1)|0x0399,
- L(3)|0x0399, 0x0308, 0x0301,
- L(3)|0x03A5, 0x0308, 0x0301,
- L(1)|0x03A3,
- L(1)|0x0392,
- L(1)|0x0398,
- L(1)|0x03A6,
- L(1)|0x03A0,
- L(1)|0x039A,
- L(1)|0x03A1,
- L(1)|0x0395,
- L(2)|0x0535, 0x0582, L(2)|0x0535, 0x0552,
- L(1)|0x0412,
- L(1)|0x0414,
- L(1)|0x041E,
- L(1)|0x0421,
- L(1)|0x0422,
- L(1)|0x0422,
- L(1)|0x042A,
- L(1)|0x0462,
- L(1)|0xA64A,
- L(2)|0x0048, 0x0331,
- L(2)|0x0054, 0x0308,
- L(2)|0x0057, 0x030A,
- L(2)|0x0059, 0x030A,
- L(2)|0x0041, 0x02BE,
- L(1)|0x1E60,
- L(1)|0x00DF,
- L(2)|0x03A5, 0x0313,
- L(3)|0x03A5, 0x0313, 0x0300,
- L(3)|0x03A5, 0x0313, 0x0301,
- L(3)|0x03A5, 0x0313, 0x0342,
- L(1)|0x1F88, L(2)|0x1F08, 0x0399,
- L(1)|0x1F89, L(2)|0x1F09, 0x0399,
- L(1)|0x1F8A, L(2)|0x1F0A, 0x0399,
- L(1)|0x1F8B, L(2)|0x1F0B, 0x0399,
- L(1)|0x1F8C, L(2)|0x1F0C, 0x0399,
- L(1)|0x1F8D, L(2)|0x1F0D, 0x0399,
- L(1)|0x1F8E, L(2)|0x1F0E, 0x0399,
- L(1)|0x1F8F, L(2)|0x1F0F, 0x0399,
- L(2)|0x1F00, 0x0399, L(1)|0x1F80, L(2)|0x1F08, 0x0399,
- L(2)|0x1F01, 0x0399, L(1)|0x1F81, L(2)|0x1F09, 0x0399,
- L(2)|0x1F02, 0x0399, L(1)|0x1F82, L(2)|0x1F0A, 0x0399,
- L(2)|0x1F03, 0x0399, L(1)|0x1F83, L(2)|0x1F0B, 0x0399,
- L(2)|0x1F04, 0x0399, L(1)|0x1F84, L(2)|0x1F0C, 0x0399,
- L(2)|0x1F05, 0x0399, L(1)|0x1F85, L(2)|0x1F0D, 0x0399,
- L(2)|0x1F06, 0x0399, L(1)|0x1F86, L(2)|0x1F0E, 0x0399,
- L(2)|0x1F07, 0x0399, L(1)|0x1F87, L(2)|0x1F0F, 0x0399,
- L(1)|0x1F98, L(2)|0x1F28, 0x0399,
- L(1)|0x1F99, L(2)|0x1F29, 0x0399,
- L(1)|0x1F9A, L(2)|0x1F2A, 0x0399,
- L(1)|0x1F9B, L(2)|0x1F2B, 0x0399,
- L(1)|0x1F9C, L(2)|0x1F2C, 0x0399,
- L(1)|0x1F9D, L(2)|0x1F2D, 0x0399,
- L(1)|0x1F9E, L(2)|0x1F2E, 0x0399,
- L(1)|0x1F9F, L(2)|0x1F2F, 0x0399,
- L(2)|0x1F20, 0x0399, L(1)|0x1F90, L(2)|0x1F28, 0x0399,
- L(2)|0x1F21, 0x0399, L(1)|0x1F91, L(2)|0x1F29, 0x0399,
- L(2)|0x1F22, 0x0399, L(1)|0x1F92, L(2)|0x1F2A, 0x0399,
- L(2)|0x1F23, 0x0399, L(1)|0x1F93, L(2)|0x1F2B, 0x0399,
- L(2)|0x1F24, 0x0399, L(1)|0x1F94, L(2)|0x1F2C, 0x0399,
- L(2)|0x1F25, 0x0399, L(1)|0x1F95, L(2)|0x1F2D, 0x0399,
- L(2)|0x1F26, 0x0399, L(1)|0x1F96, L(2)|0x1F2E, 0x0399,
- L(2)|0x1F27, 0x0399, L(1)|0x1F97, L(2)|0x1F2F, 0x0399,
- L(1)|0x1FA8, L(2)|0x1F68, 0x0399,
- L(1)|0x1FA9, L(2)|0x1F69, 0x0399,
- L(1)|0x1FAA, L(2)|0x1F6A, 0x0399,
- L(1)|0x1FAB, L(2)|0x1F6B, 0x0399,
- L(1)|0x1FAC, L(2)|0x1F6C, 0x0399,
- L(1)|0x1FAD, L(2)|0x1F6D, 0x0399,
- L(1)|0x1FAE, L(2)|0x1F6E, 0x0399,
- L(1)|0x1FAF, L(2)|0x1F6F, 0x0399,
- L(2)|0x1F60, 0x0399, L(1)|0x1FA0, L(2)|0x1F68, 0x0399,
- L(2)|0x1F61, 0x0399, L(1)|0x1FA1, L(2)|0x1F69, 0x0399,
- L(2)|0x1F62, 0x0399, L(1)|0x1FA2, L(2)|0x1F6A, 0x0399,
- L(2)|0x1F63, 0x0399, L(1)|0x1FA3, L(2)|0x1F6B, 0x0399,
- L(2)|0x1F64, 0x0399, L(1)|0x1FA4, L(2)|0x1F6C, 0x0399,
- L(2)|0x1F65, 0x0399, L(1)|0x1FA5, L(2)|0x1F6D, 0x0399,
- L(2)|0x1F66, 0x0399, L(1)|0x1FA6, L(2)|0x1F6E, 0x0399,
- L(2)|0x1F67, 0x0399, L(1)|0x1FA7, L(2)|0x1F6F, 0x0399,
- L(2)|0x1FBA, 0x0345, L(2)|0x1FBA, 0x0399,
- L(1)|0x1FBC, L(2)|0x0391, 0x0399,
- L(2)|0x0386, 0x0345, L(2)|0x0386, 0x0399,
- L(2)|0x0391, 0x0342,
- L(3)|0x0391, 0x0342, 0x0345, L(3)|0x0391, 0x0342, 0x0399,
- L(2)|0x03B1, 0x0399, L(1)|0x1FB3, L(2)|0x0391, 0x0399,
- L(1)|0x0399,
- L(2)|0x1FCA, 0x0345, L(2)|0x1FCA, 0x0399,
- L(1)|0x1FCC, L(2)|0x0397, 0x0399,
- L(2)|0x0389, 0x0345, L(2)|0x0389, 0x0399,
- L(2)|0x0397, 0x0342,
- L(3)|0x0397, 0x0342, 0x0345, L(3)|0x0397, 0x0342, 0x0399,
- L(2)|0x03B7, 0x0399, L(1)|0x1FC3, L(2)|0x0397, 0x0399,
- L(3)|0x0399, 0x0308, 0x0300,
- L(3)|0x0399, 0x0308, 0x0301,
- L(2)|0x0399, 0x0342,
- L(3)|0x0399, 0x0308, 0x0342,
- L(3)|0x03A5, 0x0308, 0x0300,
- L(3)|0x03A5, 0x0308, 0x0301,
- L(2)|0x03A1, 0x0313,
- L(2)|0x03A5, 0x0342,
- L(3)|0x03A5, 0x0308, 0x0342,
- L(2)|0x1FFA, 0x0345, L(2)|0x1FFA, 0x0399,
- L(1)|0x1FFC, L(2)|0x03A9, 0x0399,
- L(2)|0x038F, 0x0345, L(2)|0x038F, 0x0399,
- L(2)|0x03A9, 0x0342,
- L(3)|0x03A9, 0x0342, 0x0345, L(3)|0x03A9, 0x0342, 0x0399,
- L(2)|0x03C9, 0x0399, L(1)|0x1FF3, L(2)|0x03A9, 0x0399,
- L(2)|0x0046, 0x0066, L(2)|0x0046, 0x0046,
- L(2)|0x0046, 0x0069, L(2)|0x0046, 0x0049,
- L(2)|0x0046, 0x006C, L(2)|0x0046, 0x004C,
- L(3)|0x0046, 0x0066, 0x0069, L(3)|0x0046, 0x0046, 0x0049,
- L(3)|0x0046, 0x0066, 0x006C, L(3)|0x0046, 0x0046, 0x004C,
- L(2)|0x0053, 0x0074, L(2)|0x0053, 0x0054,
- L(2)|0x0053, 0x0074, L(2)|0x0053, 0x0054,
- L(2)|0x0544, 0x0576, L(2)|0x0544, 0x0546,
- L(2)|0x0544, 0x0565, L(2)|0x0544, 0x0535,
- L(2)|0x0544, 0x056B, L(2)|0x0544, 0x053B,
- L(2)|0x054E, 0x0576, L(2)|0x054E, 0x0546,
- L(2)|0x0544, 0x056D, L(2)|0x0544, 0x053D,
-};
diff --git a/enc/unicode/10.0.0/name2ctype.h b/enc/unicode/10.0.0/name2ctype.h
deleted file mode 100644
index 4a1422d17a..0000000000
--- a/enc/unicode/10.0.0/name2ctype.h
+++ /dev/null
@@ -1,38381 +0,0 @@
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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' */
-#else /* USE_UNICODE_PROPERTIES */
-/* Computed positions: -k'1-3,5-6,12,16,$' */
-#endif /* USE_UNICODE_PROPERTIES */
-
-#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-gperf@gnu.org>."
-#endif
-
-
-
-/* 'NEWLINE': [[:NEWLINE:]] */
-static const OnigCodePoint CR_NEWLINE[] = {
- 1,
- 0x000a, 0x000a,
-}; /* CR_NEWLINE */
-
-/* 'Alpha': [[:Alpha:]] */
-static const OnigCodePoint CR_Alpha[] = {
- 660,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x065f,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08df,
- 0x08e3, 0x08e9,
- 0x08f0, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0971, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09f0, 0x09f1,
- 0x09fc, 0x09fc,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a70, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0af9, 0x0afc,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b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0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103f,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b80, 0x1ba9,
- 0x1bac, 0x1baf,
- 0x1bba, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1d00, 0x1dbf,
- 0x1de7, 0x1df4,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa674, 0xa67b,
- 0xa67f, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 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,
- 0xaa7e, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf5,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabea,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 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,
- 0x1123e, 0x1123e,
- 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,
- 0x11400, 0x11441,
- 0x11443, 0x11445,
- 0x11447, 0x1144a,
- 0x11480, 0x114c1,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115b5,
- 0x115b8, 0x115be,
- 0x115d8, 0x115dd,
- 0x11600, 0x1163e,
- 0x11640, 0x11640,
- 0x11644, 0x11644,
- 0x11680, 0x116b5,
- 0x11700, 0x11719,
- 0x1171d, 0x1172a,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a32,
- 0x11a35, 0x11a3e,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a97,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c3e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d41,
- 0x11d43, 0x11d43,
- 0x11d46, 0x11d47,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9e, 0x1bc9e,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1e947, 0x1e947,
- 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,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alpha */
-
-/* 'Blank': [[:Blank:]] */
-static const OnigCodePoint CR_Blank[] = {
- 8,
- 0x0009, 0x0009,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Blank */
-
-/* 'Cntrl': [[:Cntrl:]] */
-static const OnigCodePoint CR_Cntrl[] = {
- 2,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
-}; /* CR_Cntrl */
-
-/* 'Digit': [[:Digit:]] */
-static const OnigCodePoint CR_Digit[] = {
- 55,
- 0x0030, 0x0039,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0be6, 0x0bef,
- 0x0c66, 0x0c6f,
- 0x0ce6, 0x0cef,
- 0x0d66, 0x0d6f,
- 0x0de6, 0x0def,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f29,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19d9,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0xa620, 0xa629,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xa9f0, 0xa9f9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x104a0, 0x104a9,
- 0x11066, 0x1106f,
- 0x110f0, 0x110f9,
- 0x11136, 0x1113f,
- 0x111d0, 0x111d9,
- 0x112f0, 0x112f9,
- 0x11450, 0x11459,
- 0x114d0, 0x114d9,
- 0x11650, 0x11659,
- 0x116c0, 0x116c9,
- 0x11730, 0x11739,
- 0x118e0, 0x118e9,
- 0x11c50, 0x11c59,
- 0x11d50, 0x11d59,
- 0x16a60, 0x16a69,
- 0x16b50, 0x16b59,
- 0x1d7ce, 0x1d7ff,
- 0x1e950, 0x1e959,
-}; /* CR_Digit */
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 654,
- 0x0021, 0x007e,
- 0x00a1, 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,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 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, 0x09fd,
- 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, 0x0aff,
- 0x0b01, 0x0b03,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d4a, 0x0d4f,
- 0x0d54, 0x0d63,
- 0x0d66, 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, 0x167f,
- 0x1681, 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, 0x1c88,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x200b, 0x2027,
- 0x202a, 0x202e,
- 0x2030, 0x205e,
- 0x2060, 0x2064,
- 0x2066, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20bf,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 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, 0x2e49,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fea,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 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,
- 0xe000, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018e,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x1123e,
- 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,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ee00, 0x1ee03,
- 0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, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Graph */
-
-/* 'Lower': [[:Lower:]] */
-static const OnigCodePoint CR_Lower[] = {
- 640,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037a, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0529, 0x0529,
- 0x052b, 0x052b,
- 0x052d, 0x052d,
- 0x052f, 0x052f,
- 0x0561, 0x0587,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d00, 0x1dbf,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 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2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2cf3, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa699, 0xa699,
- 0xa69b, 0xa69d,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 0xa793, 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,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
- 0x1e922, 0x1e943,
-}; /* CR_Lower */
-
-/* 'Print': [[:Print:]] */
-static const OnigCodePoint CR_Print[] = {
- 651,
- 0x0020, 0x007e,
- 0x00a0, 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,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 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, 0x09fd,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
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12b5,
- 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, 0x1c88,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x2027,
- 0x202a, 0x2064,
- 0x2066, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20bf,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 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, 0x2e49,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fea,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 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,
- 0xe000, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018e,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x1123e,
- 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,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1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6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Print */
-
-/* 'XPosixPunct': [[:Punct:]] */
-static const OnigCodePoint CR_XPosixPunct[] = {
- 167,
- 0x0021, 0x002f,
- 0x003a, 0x0040,
- 0x005b, 0x0060,
- 0x007b, 0x007e,
- 0x00a1, 0x00a1,
- 0x00a7, 0x00a7,
- 0x00ab, 0x00ab,
- 0x00b6, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x09fd, 0x09fd,
- 0x0af0, 0x0af0,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f14, 0x0f14,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1360, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2308, 0x230b,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e49,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa8fc, 0xa8fc,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xaaf0, 0xaaf1,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10102,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 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, 0x111c9,
- 0x111cd, 0x111cd,
- 0x111db, 0x111db,
- 0x111dd, 0x111df,
- 0x11238, 0x1123d,
- 0x112a9, 0x112a9,
- 0x1144b, 0x1144f,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x114c6, 0x114c6,
- 0x115c1, 0x115d7,
- 0x11641, 0x11643,
- 0x11660, 0x1166c,
- 0x1173c, 0x1173e,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x1bc9f, 0x1bc9f,
- 0x1da87, 0x1da8b,
- 0x1e95e, 0x1e95f,
-}; /* CR_XPosixPunct */
-
-/* 'Space': [[:Space:]] */
-static const OnigCodePoint CR_Space[] = {
- 10,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Space */
-
-/* 'Upper': [[:Upper:]] */
-static const OnigCodePoint CR_Upper[] = {
- 632,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0528, 0x0528,
- 0x052a, 0x052a,
- 0x052c, 0x052c,
- 0x052e, 0x052e,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e28,
- 0x1e2a, 0x1e2a,
- 0x1e2c, 0x1e2c,
- 0x1e2e, 0x1e2e,
- 0x1e30, 0x1e30,
- 0x1e32, 0x1e32,
- 0x1e34, 0x1e34,
- 0x1e36, 0x1e36,
- 0x1e38, 0x1e38,
- 0x1e3a, 0x1e3a,
- 0x1e3c, 0x1e3c,
- 0x1e3e, 0x1e3e,
- 0x1e40, 0x1e40,
- 0x1e42, 0x1e42,
- 0x1e44, 0x1e44,
- 0x1e46, 0x1e46,
- 0x1e48, 0x1e48,
- 0x1e4a, 0x1e4a,
- 0x1e4c, 0x1e4c,
- 0x1e4e, 0x1e4e,
- 0x1e50, 0x1e50,
- 0x1e52, 0x1e52,
- 0x1e54, 0x1e54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0x1ed4,
- 0x1ed6, 0x1ed6,
- 0x1ed8, 0x1ed8,
- 0x1eda, 0x1eda,
- 0x1edc, 0x1edc,
- 0x1ede, 0x1ede,
- 0x1ee0, 0x1ee0,
- 0x1ee2, 0x1ee2,
- 0x1ee4, 0x1ee4,
- 0x1ee6, 0x1ee6,
- 0x1ee8, 0x1ee8,
- 0x1eea, 0x1eea,
- 0x1eec, 0x1eec,
- 0x1eee, 0x1eee,
- 0x1ef0, 0x1ef0,
- 0x1ef2, 0x1ef2,
- 0x1ef4, 0x1ef4,
- 0x1ef6, 0x1ef6,
- 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x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a650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa698, 0xa698,
- 0xa69a, 0xa69a,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa792, 0xa792,
- 0xa796, 0xa796,
- 0xa798, 0xa798,
- 0xa79a, 0xa79a,
- 0xa79c, 0xa79c,
- 0xa79e, 0xa79e,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7ae,
- 0xa7b0, 0xa7b4,
- 0xa7b6, 0xa7b6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
- 0x1e900, 0x1e921,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
-}; /* CR_Upper */
-
-/* 'XDigit': [[:XDigit:]] */
-static const OnigCodePoint CR_XDigit[] = {
- 3,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
-}; /* CR_XDigit */
-
-/* 'Word': [[:Word:]] */
-static const OnigCodePoint CR_Word[] = {
- 692,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0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 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 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, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2f,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102e0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 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,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111ca, 0x111cc,
- 0x111d0, 0x111da,
- 0x111dc, 0x111dc,
- 0x11200, 0x11211,
- 0x11213, 0x11237,
- 0x1123e, 0x1123e,
- 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,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a99,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c40,
- 0x11c50, 0x11c59,
- 0x11c72, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9d, 0x1bc9e,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1da00, 0x1da36,
- 0x1da3b, 0x1da6c,
- 0x1da75, 0x1da75,
- 0x1da84, 0x1da84,
- 0x1da9b, 0x1da9f,
- 0x1daa1, 0x1daaf,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 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,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef,
-}; /* CR_Word */
-
-/* 'Alnum': [[:Alnum:]] */
-static const OnigCodePoint CR_Alnum[] = {
- 695,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0345, 0x0345,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0657,
- 0x0659, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06e1, 0x06e8,
- 0x06ed, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x073f,
- 0x074d, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0817,
- 0x081a, 0x082c,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08df,
- 0x08e3, 0x08e9,
- 0x08f0, 0x093b,
- 0x093d, 0x094c,
- 0x094e, 0x0950,
- 0x0955, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x09fc, 0x09fc,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af9, 0x0afc,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 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db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0de6, 0x0def,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ecd, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f20, 0x0f29,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f81,
- 0x0f88, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x1000, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x1049,
- 0x1050, 0x1062,
- 0x1065, 0x1068,
- 0x106e, 0x1086,
- 0x108e, 0x108e,
- 0x1090, 0x1099,
- 0x109c, 0x109d,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x135f,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1713,
- 0x1720, 0x1733,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17b3,
- 0x17b6, 0x17c8,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1b00, 0x1b33,
- 0x1b35, 0x1b43,
- 0x1b45, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b80, 0x1ba9,
- 0x1bac, 0x1be5,
- 0x1be7, 0x1bf1,
- 0x1c00, 0x1c35,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1d00, 0x1dbf,
- 0x1de7, 0x1df4,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa674, 0xa67b,
- 0xa67f, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 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,
- 0xaa7e, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf5,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabea,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 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,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11132,
- 0x11136, 0x1113f,
- 0x11150, 0x11172,
- 0x11176, 0x11176,
- 0x11180, 0x111bf,
- 0x111c1, 0x111c4,
- 0x111d0, 0x111da,
- 0x111dc, 0x111dc,
- 0x11200, 0x11211,
- 0x11213, 0x11234,
- 0x11237, 0x11237,
- 0x1123e, 0x1123e,
- 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,
- 0x11400, 0x11441,
- 0x11443, 0x11445,
- 0x11447, 0x1144a,
- 0x11450, 0x11459,
- 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,
- 0x11700, 0x11719,
- 0x1171d, 0x1172a,
- 0x11730, 0x11739,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a32,
- 0x11a35, 0x11a3e,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a97,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c3e,
- 0x11c40, 0x11c40,
- 0x11c50, 0x11c59,
- 0x11c72, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d41,
- 0x11d43, 0x11d43,
- 0x11d46, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9e, 0x1bc9e,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1e947, 0x1e947,
- 0x1e950, 0x1e959,
- 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,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Alnum */
-
-/* 'ASCII': [[:ASCII:]] */
-static const OnigCodePoint CR_ASCII[] = {
- 1,
- 0x0000, 0x007f,
-}; /* CR_ASCII */
-
-/* 'Punct' */
-static const OnigCodePoint CR_Punct[] = {
- 172,
- 0x0021, 0x0023,
- 0x0025, 0x002a,
- 0x002c, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005b, 0x005d,
- 0x005f, 0x005f,
- 0x007b, 0x007b,
- 0x007d, 0x007d,
- 0x00a1, 0x00a1,
- 0x00a7, 0x00a7,
- 0x00ab, 0x00ab,
- 0x00b6, 0x00b7,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x058a,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x09fd, 0x09fd,
- 0x0af0, 0x0af0,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f14, 0x0f14,
- 0x0f3a, 0x0f3d,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1360, 0x1368,
- 0x1400, 0x1400,
- 0x166d, 0x166e,
- 0x169b, 0x169c,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd3, 0x1cd3,
- 0x2010, 0x2027,
- 0x2030, 0x2043,
- 0x2045, 0x2051,
- 0x2053, 0x205e,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x2308, 0x230b,
- 0x2329, 0x232a,
- 0x2768, 0x2775,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e2e,
- 0x2e30, 0x2e49,
- 0x3001, 0x3003,
- 0x3008, 0x3011,
- 0x3014, 0x301f,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa8fc, 0xa8fc,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xaaf0, 0xaaf1,
- 0xabeb, 0xabeb,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff0a,
- 0xff0c, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3b, 0xff3d,
- 0xff3f, 0xff3f,
- 0xff5b, 0xff5b,
- 0xff5d, 0xff5d,
- 0xff5f, 0xff65,
- 0x10100, 0x10102,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 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, 0x111c9,
- 0x111cd, 0x111cd,
- 0x111db, 0x111db,
- 0x111dd, 0x111df,
- 0x11238, 0x1123d,
- 0x112a9, 0x112a9,
- 0x1144b, 0x1144f,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x114c6, 0x114c6,
- 0x115c1, 0x115d7,
- 0x11641, 0x11643,
- 0x11660, 0x1166c,
- 0x1173c, 0x1173e,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x1bc9f, 0x1bc9f,
- 0x1da87, 0x1da8b,
- 0x1e95e, 0x1e95f,
-}; /* CR_Punct */
-
-#ifdef USE_UNICODE_PROPERTIES
-/* 'Any': - */
-static const OnigCodePoint CR_Any[] = {
- 1,
- 0x0000, 0x10ffff,
-}; /* CR_Any */
-
-/* 'Assigned': - */
-static const OnigCodePoint CR_Assigned[] = {
- 649,
- 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,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 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, 0x09fd,
- 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,
- 0x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x12b8, 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, 0x1c88,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 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, 0x20bf,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 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, 0x2e49,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fea,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 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,
- 0xfdf0, 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, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018e,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x1123e,
- 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,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,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8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Assigned */
-
-/* 'C': Major Category */
-static const OnigCodePoint CR_C[] = {
- 653,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
- 0x00ad, 0x00ad,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x0560, 0x0560,
- 0x0588, 0x0588,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ef,
- 0x05f5, 0x0605,
- 0x061c, 0x061d,
- 0x06dd, 0x06dd,
- 0x070e, 0x070f,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07ff,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d3,
- 0x08e2, 0x08e2,
- 0x0984, 0x0984,
- 0x098d, 0x098e,
- 0x0991, 0x0992,
- 0x09a9, 0x09a9,
- 0x09b1, 0x09b1,
- 0x09b3, 0x09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0e98,
- 0x0ea0, 0x0ea0,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 0x0ea8, 0x0ea9,
- 0x0eac, 0x0eac,
- 0x0eba, 0x0eba,
- 0x0ebe, 0x0ebf,
- 0x0ec5, 0x0ec5,
- 0x0ec7, 0x0ec7,
- 0x0ece, 0x0ecf,
- 0x0eda, 0x0edb,
- 0x0ee0, 0x0eff,
- 0x0f48, 0x0f48,
- 0x0f6d, 0x0f70,
- 0x0f98, 0x0f98,
- 0x0fbd, 0x0fbd,
- 0x0fcd, 0x0fcd,
- 0x0fdb, 0x0fff,
- 0x10c6, 0x10c6,
- 0x10c8, 0x10cc,
- 0x10ce, 0x10cf,
- 0x1249, 0x1249,
- 0x124e, 0x124f,
- 0x1257, 0x1257,
- 0x1259, 0x1259,
- 0x125e, 0x125f,
- 0x1289, 0x1289,
- 0x128e, 0x128f,
- 0x12b1, 0x12b1,
- 0x12b6, 0x12b7,
- 0x12bf, 0x12bf,
- 0x12c1, 0x12c1,
- 0x12c6, 0x12c7,
- 0x12d7, 0x12d7,
- 0x1311, 0x1311,
- 0x1316, 0x1317,
- 0x135b, 0x135c,
- 0x137d, 0x137f,
- 0x139a, 0x139f,
- 0x13f6, 0x13f7,
- 0x13fe, 0x13ff,
- 0x169d, 0x169f,
- 0x16f9, 0x16ff,
- 0x170d, 0x170d,
- 0x1715, 0x171f,
- 0x1737, 0x173f,
- 0x1754, 0x175f,
- 0x176d, 0x176d,
- 0x1771, 0x1771,
- 0x1774, 0x177f,
- 0x17de, 0x17df,
- 0x17ea, 0x17ef,
- 0x17fa, 0x17ff,
- 0x180e, 0x180f,
- 0x181a, 0x181f,
- 0x1878, 0x187f,
- 0x18ab, 0x18af,
- 0x18f6, 0x18ff,
- 0x191f, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196e, 0x196f,
- 0x1975, 0x197f,
- 0x19ac, 0x19af,
- 0x19ca, 0x19cf,
- 0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fb42,
- 0xfb45, 0xfb45,
- 0xfbc2, 0xfbd2,
- 0xfd40, 0xfd4f,
- 0xfd90, 0xfd91,
- 0xfdc8, 0xfdef,
- 0xfdfe, 0xfdff,
- 0xfe1a, 0xfe1f,
- 0xfe53, 0xfe53,
- 0xfe67, 0xfe67,
- 0xfe6c, 0xfe6f,
- 0xfe75, 0xfe75,
- 0xfefd, 0xff00,
- 0xffbf, 0xffc1,
- 0xffc8, 0xffc9,
- 0xffd0, 0xffd1,
- 0xffd8, 0xffd9,
- 0xffdd, 0xffdf,
- 0xffe7, 0xffe7,
- 0xffef, 0xfffb,
- 0xfffe, 0xffff,
- 0x1000c, 0x1000c,
- 0x10027, 0x10027,
- 0x1003b, 0x1003b,
- 0x1003e, 0x1003e,
- 0x1004e, 0x1004f,
- 0x1005e, 0x1007f,
- 0x100fb, 0x100ff,
- 0x10103, 0x10106,
- 0x10134, 0x10136,
- 0x1018f, 0x1018f,
- 0x1019c, 0x1019f,
- 0x101a1, 0x101cf,
- 0x101fe, 0x1027f,
- 0x1029d, 0x1029f,
- 0x102d1, 0x102df,
- 0x102fc, 0x102ff,
- 0x10324, 0x1032c,
- 0x1034b, 0x1034f,
- 0x1037b, 0x1037f,
- 0x1039e, 0x1039e,
- 0x103c4, 0x103c7,
- 0x103d6, 0x103ff,
- 0x1049e, 0x1049f,
- 0x104aa, 0x104af,
- 0x104d4, 0x104d7,
- 0x104fc, 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,
- 0x1089f, 0x108a6,
- 0x108b0, 0x108df,
- 0x108f3, 0x108f3,
- 0x108f6, 0x108fa,
- 0x1091c, 0x1091e,
- 0x1093a, 0x1093e,
- 0x10940, 0x1097f,
- 0x109b8, 0x109bb,
- 0x109d0, 0x109d1,
- 0x10a04, 0x10a04,
- 0x10a07, 0x10a0b,
- 0x10a14, 0x10a14,
- 0x10a18, 0x10a18,
- 0x10a34, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a48, 0x10a4f,
- 0x10a59, 0x10a5f,
- 0x10aa0, 0x10abf,
- 0x10ae7, 0x10aea,
- 0x10af7, 0x10aff,
- 0x10b36, 0x10b38,
- 0x10b56, 0x10b57,
- 0x10b73, 0x10b77,
- 0x10b92, 0x10b98,
- 0x10b9d, 0x10ba8,
- 0x10bb0, 0x10bff,
- 0x10c49, 0x10c7f,
- 0x10cb3, 0x10cbf,
- 0x10cf3, 0x10cf9,
- 0x10d00, 0x10e5f,
- 0x10e7f, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110bd, 0x110bd,
- 0x110c2, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11144, 0x1114f,
- 0x11177, 0x1117f,
- 0x111ce, 0x111cf,
- 0x111e0, 0x111e0,
- 0x111f5, 0x111ff,
- 0x11212, 0x11212,
- 0x1123f, 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, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x1145e, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b8, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171a, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x119ff,
- 0x11a48, 0x11a4f,
- 0x11a84, 0x11a85,
- 0x11a9d, 0x11a9d,
- 0x11aa3, 0x11abf,
- 0x11af9, 0x11bff,
- 0x11c09, 0x11c09,
- 0x11c37, 0x11c37,
- 0x11c46, 0x11c4f,
- 0x11c6d, 0x11c6f,
- 0x11c90, 0x11c91,
- 0x11ca8, 0x11ca8,
- 0x11cb7, 0x11cff,
- 0x11d07, 0x11d07,
- 0x11d0a, 0x11d0a,
- 0x11d37, 0x11d39,
- 0x11d3b, 0x11d3b,
- 0x11d3e, 0x11d3e,
- 0x11d48, 0x11d4f,
- 0x11d5a, 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, 0x16fdf,
- 0x16fe2, 0x16fff,
- 0x187ed, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca0, 0x1cfff,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a1e, 0xe00ff,
- 0xe01f0, 0x10ffff,
-}; /* CR_C */
-
-/* 'Cc': General Category */
-#define CR_Cc CR_Cntrl
-
-/* 'Cf': General Category */
-static const OnigCodePoint CR_Cf[] = {
- 18,
- 0x00ad, 0x00ad,
- 0x0600, 0x0605,
- 0x061c, 0x061c,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x08e2, 0x08e2,
- 0x180e, 0x180e,
- 0x200b, 0x200f,
- 0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x2066, 0x206f,
- 0xfeff, 0xfeff,
- 0xfff9, 0xfffb,
- 0x110bd, 0x110bd,
- 0x1bca0, 0x1bca3,
- 0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
-}; /* CR_Cf */
-
-/* 'Cn': General Category */
-static const OnigCodePoint CR_Cn[] = {
- 649,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x0560, 0x0560,
- 0x0588, 0x0588,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ef,
- 0x05f5, 0x05ff,
- 0x061d, 0x061d,
- 0x070e, 0x070e,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07ff,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d3,
- 0x0984, 0x0984,
- 0x098d, 0x098e,
- 0x0991, 0x0992,
- 0x09a9, 0x09a9,
- 0x09b1, 0x09b1,
- 0x09b3, 0x09b5,
- 0x09ba, 0x09bb,
- 0x09c5, 0x09c6,
- 0x09c9, 0x09ca,
- 0x09cf, 0x09d6,
- 0x09d8, 0x09db,
- 0x09de, 0x09de,
- 0x09e4, 0x09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- 0x0ebe, 0x0ebf,
- 0x0ec5, 0x0ec5,
- 0x0ec7, 0x0ec7,
- 0x0ece, 0x0ecf,
- 0x0eda, 0x0edb,
- 0x0ee0, 0x0eff,
- 0x0f48, 0x0f48,
- 0x0f6d, 0x0f70,
- 0x0f98, 0x0f98,
- 0x0fbd, 0x0fbd,
- 0x0fcd, 0x0fcd,
- 0x0fdb, 0x0fff,
- 0x10c6, 0x10c6,
- 0x10c8, 0x10cc,
- 0x10ce, 0x10cf,
- 0x1249, 0x1249,
- 0x124e, 0x124f,
- 0x1257, 0x1257,
- 0x1259, 0x1259,
- 0x125e, 0x125f,
- 0x1289, 0x1289,
- 0x128e, 0x128f,
- 0x12b1, 0x12b1,
- 0x12b6, 0x12b7,
- 0x12bf, 0x12bf,
- 0x12c1, 0x12c1,
- 0x12c6, 0x12c7,
- 0x12d7, 0x12d7,
- 0x1311, 0x1311,
- 0x1316, 0x1317,
- 0x135b, 0x135c,
- 0x137d, 0x137f,
- 0x139a, 0x139f,
- 0x13f6, 0x13f7,
- 0x13fe, 0x13ff,
- 0x169d, 0x169f,
- 0x16f9, 0x16ff,
- 0x170d, 0x170d,
- 0x1715, 0x171f,
- 0x1737, 0x173f,
- 0x1754, 0x175f,
- 0x176d, 0x176d,
- 0x1771, 0x1771,
- 0x1774, 0x177f,
- 0x17de, 0x17df,
- 0x17ea, 0x17ef,
- 0x17fa, 0x17ff,
- 0x180f, 0x180f,
- 0x181a, 0x181f,
- 0x1878, 0x187f,
- 0x18ab, 0x18af,
- 0x18f6, 0x18ff,
- 0x191f, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196e, 0x196f,
- 0x1975, 0x197f,
- 0x19ac, 0x19af,
- 0x19ca, 0x19cf,
- 0x19db, 0x19dd,
- 0x1a1c, 0x1a1d,
- 0x1a5f, 0x1a5f,
- 0x1a7d, 0x1a7e,
- 0x1a8a, 0x1a8f,
- 0x1a9a, 0x1a9f,
- 0x1aae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,
- 0x2ef4, 0x2eff,
- 0x2fd6, 0x2fef,
- 0x2ffc, 0x2fff,
- 0x3040, 0x3040,
- 0x3097, 0x3098,
- 0x3100, 0x3104,
- 0x312f, 0x3130,
- 0x318f, 0x318f,
- 0x31bb, 0x31bf,
- 0x31e4, 0x31ef,
- 0x321f, 0x321f,
- 0x32ff, 0x32ff,
- 0x4db6, 0x4dbf,
- 0x9feb, 0x9fff,
- 0xa48d, 0xa48f,
- 0xa4c7, 0xa4cf,
- 0xa62c, 0xa63f,
- 0xa6f8, 0xa6ff,
- 0xa7af, 0xa7af,
- 0xa7b8, 0xa7f6,
- 0xa82c, 0xa82f,
- 0xa83a, 0xa83f,
- 0xa878, 0xa87f,
- 0xa8c6, 0xa8cd,
- 0xa8da, 0xa8df,
- 0xa8fe, 0xa8ff,
- 0xa954, 0xa95e,
- 0xa97d, 0xa97f,
- 0xa9ce, 0xa9ce,
- 0xa9da, 0xa9dd,
- 0xa9ff, 0xa9ff,
- 0xaa37, 0xaa3f,
- 0xaa4e, 0xaa4f,
- 0xaa5a, 0xaa5b,
- 0xaac3, 0xaada,
- 0xaaf7, 0xab00,
- 0xab07, 0xab08,
- 0xab0f, 0xab10,
- 0xab17, 0xab1f,
- 0xab27, 0xab27,
- 0xab2f, 0xab2f,
- 0xab66, 0xab6f,
- 0xabee, 0xabef,
- 0xabfa, 0xabff,
- 0xd7a4, 0xd7af,
- 0xd7c7, 0xd7ca,
- 0xd7fc, 0xd7ff,
- 0xfa6e, 0xfa6f,
- 0xfada, 0xfaff,
- 0xfb07, 0xfb12,
- 0xfb18, 0xfb1c,
- 0xfb37, 0xfb37,
- 0xfb3d, 0xfb3d,
- 0xfb3f, 0xfb3f,
- 0xfb42, 0xfb42,
- 0xfb45, 0xfb45,
- 0xfbc2, 0xfbd2,
- 0xfd40, 0xfd4f,
- 0xfd90, 0xfd91,
- 0xfdc8, 0xfdef,
- 0xfdfe, 0xfdff,
- 0xfe1a, 0xfe1f,
- 0xfe53, 0xfe53,
- 0xfe67, 0xfe67,
- 0xfe6c, 0xfe6f,
- 0xfe75, 0xfe75,
- 0xfefd, 0xfefe,
- 0xff00, 0xff00,
- 0xffbf, 0xffc1,
- 0xffc8, 0xffc9,
- 0xffd0, 0xffd1,
- 0xffd8, 0xffd9,
- 0xffdd, 0xffdf,
- 0xffe7, 0xffe7,
- 0xffef, 0xfff8,
- 0xfffe, 0xffff,
- 0x1000c, 0x1000c,
- 0x10027, 0x10027,
- 0x1003b, 0x1003b,
- 0x1003e, 0x1003e,
- 0x1004e, 0x1004f,
- 0x1005e, 0x1007f,
- 0x100fb, 0x100ff,
- 0x10103, 0x10106,
- 0x10134, 0x10136,
- 0x1018f, 0x1018f,
- 0x1019c, 0x1019f,
- 0x101a1, 0x101cf,
- 0x101fe, 0x1027f,
- 0x1029d, 0x1029f,
- 0x102d1, 0x102df,
- 0x102fc, 0x102ff,
- 0x10324, 0x1032c,
- 0x1034b, 0x1034f,
- 0x1037b, 0x1037f,
- 0x1039e, 0x1039e,
- 0x103c4, 0x103c7,
- 0x103d6, 0x103ff,
- 0x1049e, 0x1049f,
- 0x104aa, 0x104af,
- 0x104d4, 0x104d7,
- 0x104fc, 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,
- 0x1089f, 0x108a6,
- 0x108b0, 0x108df,
- 0x108f3, 0x108f3,
- 0x108f6, 0x108fa,
- 0x1091c, 0x1091e,
- 0x1093a, 0x1093e,
- 0x10940, 0x1097f,
- 0x109b8, 0x109bb,
- 0x109d0, 0x109d1,
- 0x10a04, 0x10a04,
- 0x10a07, 0x10a0b,
- 0x10a14, 0x10a14,
- 0x10a18, 0x10a18,
- 0x10a34, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a48, 0x10a4f,
- 0x10a59, 0x10a5f,
- 0x10aa0, 0x10abf,
- 0x10ae7, 0x10aea,
- 0x10af7, 0x10aff,
- 0x10b36, 0x10b38,
- 0x10b56, 0x10b57,
- 0x10b73, 0x10b77,
- 0x10b92, 0x10b98,
- 0x10b9d, 0x10ba8,
- 0x10bb0, 0x10bff,
- 0x10c49, 0x10c7f,
- 0x10cb3, 0x10cbf,
- 0x10cf3, 0x10cf9,
- 0x10d00, 0x10e5f,
- 0x10e7f, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110c2, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11144, 0x1114f,
- 0x11177, 0x1117f,
- 0x111ce, 0x111cf,
- 0x111e0, 0x111e0,
- 0x111f5, 0x111ff,
- 0x11212, 0x11212,
- 0x1123f, 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, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x1145e, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b8, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171a, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x119ff,
- 0x11a48, 0x11a4f,
- 0x11a84, 0x11a85,
- 0x11a9d, 0x11a9d,
- 0x11aa3, 0x11abf,
- 0x11af9, 0x11bff,
- 0x11c09, 0x11c09,
- 0x11c37, 0x11c37,
- 0x11c46, 0x11c4f,
- 0x11c6d, 0x11c6f,
- 0x11c90, 0x11c91,
- 0x11ca8, 0x11ca8,
- 0x11cb7, 0x11cff,
- 0x11d07, 0x11d07,
- 0x11d0a, 0x11d0a,
- 0x11d37, 0x11d39,
- 0x11d3b, 0x11d3b,
- 0x11d3e, 0x11d3e,
- 0x11d48, 0x11d4f,
- 0x11d5a, 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, 0x16fdf,
- 0x16fe2, 0x16fff,
- 0x187ed, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca4, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d128,
- 0x1d1e9, 0x1d1ff,
- 0x1d246, 0x1d2ff,
- 0x1d357, 0x1d35f,
- 0x1d372, 0x1d3ff,
- 0x1d455, 0x1d455,
- 0x1d49d, 0x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 0x1ee73,
- 0x1ee78, 0x1ee78,
- 0x1ee7d, 0x1ee7d,
- 0x1ee7f, 0x1ee7f,
- 0x1ee8a, 0x1ee8a,
- 0x1ee9c, 0x1eea0,
- 0x1eea4, 0x1eea4,
- 0x1eeaa, 0x1eeaa,
- 0x1eebc, 0x1eeef,
- 0x1eef2, 0x1efff,
- 0x1f02c, 0x1f02f,
- 0x1f094, 0x1f09f,
- 0x1f0af, 0x1f0b0,
- 0x1f0c0, 0x1f0c0,
- 0x1f0d0, 0x1f0d0,
- 0x1f0f6, 0x1f0ff,
- 0x1f10d, 0x1f10f,
- 0x1f12f, 0x1f12f,
- 0x1f16c, 0x1f16f,
- 0x1f1ad, 0x1f1e5,
- 0x1f203, 0x1f20f,
- 0x1f23c, 0x1f23f,
- 0x1f249, 0x1f24f,
- 0x1f252, 0x1f25f,
- 0x1f266, 0x1f2ff,
- 0x1f6d5, 0x1f6df,
- 0x1f6ed, 0x1f6ef,
- 0x1f6f9, 0x1f6ff,
- 0x1f774, 0x1f77f,
- 0x1f7d5, 0x1f7ff,
- 0x1f80c, 0x1f80f,
- 0x1f848, 0x1f84f,
- 0x1f85a, 0x1f85f,
- 0x1f888, 0x1f88f,
- 0x1f8ae, 0x1f8ff,
- 0x1f90c, 0x1f90f,
- 0x1f93f, 0x1f93f,
- 0x1f94d, 0x1f94f,
- 0x1f96c, 0x1f97f,
- 0x1f998, 0x1f9bf,
- 0x1f9c1, 0x1f9cf,
- 0x1f9e7, 0x1ffff,
- 0x2a6d7, 0x2a6ff,
- 0x2b735, 0x2b73f,
- 0x2b81e, 0x2b81f,
- 0x2cea2, 0x2ceaf,
- 0x2ebe1, 0x2f7ff,
- 0x2fa1e, 0xe0000,
- 0xe0002, 0xe001f,
- 0xe0080, 0xe00ff,
- 0xe01f0, 0xeffff,
- 0xffffe, 0xfffff,
- 0x10fffe, 0x10ffff,
-}; /* CR_Cn */
-
-/* 'Co': General Category */
-static const OnigCodePoint CR_Co[] = {
- 3,
- 0xe000, 0xf8ff,
- 0xf0000, 0xffffd,
- 0x100000, 0x10fffd,
-}; /* CR_Co */
-
-/* 'Cs': General Category */
-static const OnigCodePoint CR_Cs[] = {
- 1,
- 0xd800, 0xdfff,
-}; /* CR_Cs */
-
-/* 'L': Major Category */
-static const OnigCodePoint CR_L[] = {
- 585,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0620, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06e5, 0x06e6,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x07a5,
- 0x07b1, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0815,
- 0x081a, 0x081a,
- 0x0824, 0x0824,
- 0x0828, 0x0828,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x0971, 0x0980,
- 0x0985, 0x098c,
- 0x098f, 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c90,
- 0x0c92, 0x0ca8,
- 0x0caa, 0x0cb3,
- 0x0cb5, 0x0cb9,
- 0x0cbd, 0x0cbd,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0cf1, 0x0cf2,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d3d,
- 0x0d4e, 0x0d4e,
- 0x0d54, 0x0d56,
- 0x0d5f, 0x0d61,
- 0x0d7a, 0x0d7f,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e46,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f88, 0x0f8c,
- 0x1000, 0x102a,
- 0x103f, 0x103f,
- 0x1050, 0x1055,
- 0x105a, 0x105d,
- 0x1061, 0x1061,
- 0x1065, 0x1066,
- 0x106e, 0x1070,
- 0x1075, 0x1081,
- 0x108e, 0x108e,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16f1, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x1884,
- 0x1887, 0x18a8,
- 0x18aa, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a16,
- 0x1a20, 0x1a54,
- 0x1aa7, 0x1aa7,
- 0x1b05, 0x1b33,
- 0x1b45, 0x1b4b,
- 0x1b83, 0x1ba0,
- 0x1bae, 0x1baf,
- 0x1bba, 0x1be5,
- 0x1c00, 0x1c23,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf1,
- 0x1cf5, 0x1cf6,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2183, 0x2184,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3006,
- 0x3031, 0x3035,
- 0x303b, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6e5,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 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,
- 0xaa7e, 0xaaaf,
- 0xaab1, 0xaab1,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaabd,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaea,
- 0xaaf2, 0xaaf4,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabe2,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb1d,
- 0xfb1f, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 0x10340,
- 0x10342, 0x10349,
- 0x10350, 0x10375,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x10400, 0x1049d,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 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,
- 0x11400, 0x11434,
- 0x11447, 0x1144a,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x11700, 0x11719,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a83,
- 0x11a86, 0x11a89,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_L */
-
-/* 'LC': General Category */
-static const OnigCodePoint CR_LC[] = {
- 126,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00b5, 0x00b5,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x01ba,
- 0x01bc, 0x01bf,
- 0x01c4, 0x0293,
- 0x0295, 0x02af,
- 0x0370, 0x0373,
- 0x0376, 0x0377,
- 0x037b, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0561, 0x0587,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d00, 0x1d2b,
- 0x1d6b, 0x1d77,
- 0x1d79, 0x1d9a,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2183, 0x2184,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2c7b,
- 0x2c7e, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa640, 0xa66d,
- 0xa680, 0xa69b,
- 0xa722, 0xa76f,
- 0xa771, 0xa787,
- 0xa78b, 0xa78e,
- 0xa790, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7fa, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab60, 0xab65,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e900, 0x1e943,
-}; /* CR_LC */
-
-/* 'Ll': General Category */
-static const OnigCodePoint CR_Ll[] = {
- 633,
- 0x0061, 0x007a,
- 0x00b5, 0x00b5,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0138,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018d,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019b,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01aa, 0x01ab,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01ba,
- 0x01bd, 0x01bf,
- 0x01c6, 0x01c6,
- 0x01c9, 0x01c9,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0221, 0x0221,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0239,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0293,
- 0x0295, 0x02af,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037b, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fc,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0529, 0x0529,
- 0x052b, 0x052b,
- 0x052d, 0x052d,
- 0x052f, 0x052f,
- 0x0561, 0x0587,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d00, 0x1d2b,
- 0x1d6b, 0x1d77,
- 0x1d79, 0x1d9a,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0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x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2cf3, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa699, 0xa699,
- 0xa69b, 0xa69b,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa731,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa76f,
- 0xa771, 0xa778,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 0xa78c, 0xa78c,
- 0xa78e, 0xa78e,
- 0xa791, 0xa791,
- 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,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x1d41a, 0x1d433,
- 0x1d44e, 0x1d454,
- 0x1d456, 0x1d467,
- 0x1d482, 0x1d49b,
- 0x1d4b6, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d4cf,
- 0x1d4ea, 0x1d503,
- 0x1d51e, 0x1d537,
- 0x1d552, 0x1d56b,
- 0x1d586, 0x1d59f,
- 0x1d5ba, 0x1d5d3,
- 0x1d5ee, 0x1d607,
- 0x1d622, 0x1d63b,
- 0x1d656, 0x1d66f,
- 0x1d68a, 0x1d6a5,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6e1,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d71b,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d755,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d78f,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7c9,
- 0x1d7cb, 0x1d7cb,
- 0x1e922, 0x1e943,
-}; /* CR_Ll */
-
-/* 'Lm': General Category */
-static const OnigCodePoint CR_Lm[] = {
- 57,
- 0x02b0, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0374, 0x0374,
- 0x037a, 0x037a,
- 0x0559, 0x0559,
- 0x0640, 0x0640,
- 0x06e5, 0x06e6,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x081a, 0x081a,
- 0x0824, 0x0824,
- 0x0828, 0x0828,
- 0x0971, 0x0971,
- 0x0e46, 0x0e46,
- 0x0ec6, 0x0ec6,
- 0x10fc, 0x10fc,
- 0x17d7, 0x17d7,
- 0x1843, 0x1843,
- 0x1aa7, 0x1aa7,
- 0x1c78, 0x1c7d,
- 0x1d2c, 0x1d6a,
- 0x1d78, 0x1d78,
- 0x1d9b, 0x1dbf,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2c7c, 0x2c7d,
- 0x2d6f, 0x2d6f,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3005,
- 0x3031, 0x3035,
- 0x303b, 0x303b,
- 0x309d, 0x309e,
- 0x30fc, 0x30fe,
- 0xa015, 0xa015,
- 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,
- 0x16fe0, 0x16fe1,
-}; /* CR_Lm */
-
-/* 'Lo': General Category */
-static const OnigCodePoint CR_Lo[] = {
- 459,
- 0x00aa, 0x00aa,
- 0x00ba, 0x00ba,
- 0x01bb, 0x01bb,
- 0x01c0, 0x01c3,
- 0x0294, 0x0294,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0620, 0x063f,
- 0x0641, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x07a5,
- 0x07b1, 0x07b1,
- 0x07ca, 0x07ea,
- 0x0800, 0x0815,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x0972, 0x0980,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09bd,
- 0x09ce, 0x09ce,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e1,
- 0x09f0, 0x09f1,
- 0x09fc, 0x09fc,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a72, 0x0a74,
- 0x0a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0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e45,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f88, 0x0f8c,
- 0x1000, 0x102a,
- 0x103f, 0x103f,
- 0x1050, 0x1055,
- 0x105a, 0x105d,
- 0x1061, 0x1061,
- 0x1065, 0x1066,
- 0x106e, 0x1070,
- 0x1075, 0x1081,
- 0x108e, 0x108e,
- 0x10d0, 0x10fa,
- 0x10fd, 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,
- 0x1380, 0x138f,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16f1, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17dc, 0x17dc,
- 0x1820, 0x1842,
- 0x1844, 0x1877,
- 0x1880, 0x1884,
- 0x1887, 0x18a8,
- 0x18aa, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a16,
- 0x1a20, 0x1a54,
- 0x1b05, 0x1b33,
- 0x1b45, 0x1b4b,
- 0x1b83, 0x1ba0,
- 0x1bae, 0x1baf,
- 0x1bba, 0x1be5,
- 0x1c00, 0x1c23,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c77,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf1,
- 0x1cf5, 0x1cf6,
- 0x2135, 0x2138,
- 0x2d30, 0x2d67,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3006, 0x3006,
- 0x303c, 0x303c,
- 0x3041, 0x3096,
- 0x309f, 0x309f,
- 0x30a1, 0x30fa,
- 0x30ff, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa014,
- 0xa016, 0xa48c,
- 0xa4d0, 0xa4f7,
- 0xa500, 0xa60b,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa66e, 0xa66e,
- 0xa6a0, 0xa6e5,
- 0xa78f, 0xa78f,
- 0xa7f7, 0xa7f7,
- 0xa7fb, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 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,
- 0xaa7e, 0xaaaf,
- 0xaab1, 0xaab1,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaabd,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadc,
- 0xaae0, 0xaaea,
- 0xaaf2, 0xaaf2,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabe2,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb1d, 0xfb1d,
- 0xfb1f, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff66, 0xff6f,
- 0xff71, 0xff9d,
- 0xffa0, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 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,
- 0x11400, 0x11434,
- 0x11447, 0x1144a,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x11700, 0x11719,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a83,
- 0x11a86, 0x11a89,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x12000, 0x12399,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f50,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1e800, 0x1e8c4,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Lo */
-
-/* 'Lt': General Category */
-static const OnigCodePoint CR_Lt[] = {
- 10,
- 0x01c5, 0x01c5,
- 0x01c8, 0x01c8,
- 0x01cb, 0x01cb,
- 0x01f2, 0x01f2,
- 0x1f88, 0x1f8f,
- 0x1f98, 0x1f9f,
- 0x1fa8, 0x1faf,
- 0x1fbc, 0x1fbc,
- 0x1fcc, 0x1fcc,
- 0x1ffc, 0x1ffc,
-}; /* CR_Lt */
-
-/* 'Lu': General Category */
-static const OnigCodePoint CR_Lu[] = {
- 627,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c4,
- 0x01c7, 0x01c7,
- 0x01ca, 0x01ca,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f1,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d2, 0x03d4,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0528, 0x0528,
- 0x052a, 0x052a,
- 0x052c, 0x052c,
- 0x052e, 0x052e,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x1e16, 0x1e16,
- 0x1e18, 0x1e18,
- 0x1e1a, 0x1e1a,
- 0x1e1c, 0x1e1c,
- 0x1e1e, 0x1e1e,
- 0x1e20, 0x1e20,
- 0x1e22, 0x1e22,
- 0x1e24, 0x1e24,
- 0x1e26, 0x1e26,
- 0x1e28, 0x1e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0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0x2cf2, 0x2cf2,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa698, 0xa698,
- 0xa69a, 0xa69a,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa792, 0xa792,
- 0xa796, 0xa796,
- 0xa798, 0xa798,
- 0xa79a, 0xa79a,
- 0xa79c, 0xa79c,
- 0xa79e, 0xa79e,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7ae,
- 0xa7b0, 0xa7b4,
- 0xa7b6, 0xa7b6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x1d400, 0x1d419,
- 0x1d434, 0x1d44d,
- 0x1d468, 0x1d481,
- 0x1d49c, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b5,
- 0x1d4d0, 0x1d4e9,
- 0x1d504, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d538, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d56c, 0x1d585,
- 0x1d5a0, 0x1d5b9,
- 0x1d5d4, 0x1d5ed,
- 0x1d608, 0x1d621,
- 0x1d63c, 0x1d655,
- 0x1d670, 0x1d689,
- 0x1d6a8, 0x1d6c0,
- 0x1d6e2, 0x1d6fa,
- 0x1d71c, 0x1d734,
- 0x1d756, 0x1d76e,
- 0x1d790, 0x1d7a8,
- 0x1d7ca, 0x1d7ca,
- 0x1e900, 0x1e921,
-}; /* CR_Lu */
-
-/* 'M': Major Category */
-static const OnigCodePoint CR_M[] = {
- 263,
- 0x0300, 0x036f,
- 0x0483, 0x0489,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x061a,
- 0x064b, 0x065f,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06df, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ea, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x07eb, 0x07f3,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0903,
- 0x093a, 0x093c,
- 0x093e, 0x094f,
- 0x0951, 0x0957,
- 0x0962, 0x0963,
- 0x0981, 0x0983,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a03,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 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0fbc,
- 0x0fc6, 0x0fc6,
- 0x102b, 0x103e,
- 0x1056, 0x1059,
- 0x105e, 0x1060,
- 0x1062, 0x1064,
- 0x1067, 0x106d,
- 0x1071, 0x1074,
- 0x1082, 0x108d,
- 0x108f, 0x108f,
- 0x109a, 0x109d,
- 0x135d, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b4, 0x17d3,
- 0x17dd, 0x17dd,
- 0x180b, 0x180d,
- 0x1885, 0x1886,
- 0x18a9, 0x18a9,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1a17, 0x1a1b,
- 0x1a55, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a7f,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b04,
- 0x1b34, 0x1b44,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1b82,
- 0x1ba1, 0x1bad,
- 0x1be6, 0x1bf3,
- 0x1c24, 0x1c37,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf2, 0x1cf4,
- 0x1cf7, 0x1cf9,
- 0x1dc0, 0x1df9,
- 0x1dfb, 0x1dff,
- 0x20d0, 0x20f0,
- 0x2cef, 0x2cf1,
- 0x2d7f, 0x2d7f,
- 0x2de0, 0x2dff,
- 0x302a, 0x302f,
- 0x3099, 0x309a,
- 0xa66f, 0xa672,
- 0xa674, 0xa67d,
- 0xa69e, 0xa69f,
- 0xa6f0, 0xa6f1,
- 0xa802, 0xa802,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa823, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c5,
- 0xa8e0, 0xa8f1,
- 0xa926, 0xa92d,
- 0xa947, 0xa953,
- 0xa980, 0xa983,
- 0xa9b3, 0xa9c0,
- 0xa9e5, 0xa9e5,
- 0xaa29, 0xaa36,
- 0xaa43, 0xaa43,
- 0xaa4c, 0xaa4d,
- 0xaa7b, 0xaa7d,
- 0xaab0, 0xaab0,
- 0xaab2, 0xaab4,
- 0xaab7, 0xaab8,
- 0xaabe, 0xaabf,
- 0xaac1, 0xaac1,
- 0xaaeb, 0xaaef,
- 0xaaf5, 0xaaf6,
- 0xabe3, 0xabea,
- 0xabec, 0xabed,
- 0xfb1e, 0xfb1e,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2f,
- 0x101fd, 0x101fd,
- 0x102e0, 0x102e0,
- 0x10376, 0x1037a,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10ae5, 0x10ae6,
- 0x11000, 0x11002,
- 0x11038, 0x11046,
- 0x1107f, 0x11082,
- 0x110b0, 0x110ba,
- 0x11100, 0x11102,
- 0x11127, 0x11134,
- 0x11173, 0x11173,
- 0x11180, 0x11182,
- 0x111b3, 0x111c0,
- 0x111ca, 0x111cc,
- 0x1122c, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112ea,
- 0x11300, 0x11303,
- 0x1133c, 0x1133c,
- 0x1133e, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11357, 0x11357,
- 0x11362, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11435, 0x11446,
- 0x114b0, 0x114c3,
- 0x115af, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115dc, 0x115dd,
- 0x11630, 0x11640,
- 0x116ab, 0x116b7,
- 0x1171d, 0x1172b,
- 0x11a01, 0x11a0a,
- 0x11a33, 0x11a39,
- 0x11a3b, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a51, 0x11a5b,
- 0x11a8a, 0x11a99,
- 0x11c2f, 0x11c36,
- 0x11c38, 0x11c3f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d31, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d45,
- 0x11d47, 0x11d47,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0100, 0xe01ef,
-}; /* CR_M */
-
-/* 'Mc': General Category */
-static const OnigCodePoint CR_Mc[] = {
- 160,
- 0x0903, 0x0903,
- 0x093b, 0x093b,
- 0x093e, 0x0940,
- 0x0949, 0x094c,
- 0x094e, 0x094f,
- 0x0982, 0x0983,
- 0x09be, 0x09c0,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09d7, 0x09d7,
- 0x0a03, 0x0a03,
- 0x0a3e, 0x0a40,
- 0x0a83, 0x0a83,
- 0x0abe, 0x0ac0,
- 0x0ac9, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0b02, 0x0b03,
- 0x0b3e, 0x0b3e,
- 0x0b40, 0x0b40,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b57, 0x0b57,
- 0x0bbe, 0x0bbf,
- 0x0bc1, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd7, 0x0bd7,
- 0x0c01, 0x0c03,
- 0x0c41, 0x0c44,
- 0x0c82, 0x0c83,
- 0x0cbe, 0x0cbe,
- 0x0cc0, 0x0cc4,
- 0x0cc7, 0x0cc8,
- 0x0cca, 0x0ccb,
- 0x0cd5, 0x0cd6,
- 0x0d02, 0x0d03,
- 0x0d3e, 0x0d40,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d57, 0x0d57,
- 0x0d82, 0x0d83,
- 0x0dcf, 0x0dd1,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0f3e, 0x0f3f,
- 0x0f7f, 0x0f7f,
- 0x102b, 0x102c,
- 0x1031, 0x1031,
- 0x1038, 0x1038,
- 0x103b, 0x103c,
- 0x1056, 0x1057,
- 0x1062, 0x1064,
- 0x1067, 0x106d,
- 0x1083, 0x1084,
- 0x1087, 0x108c,
- 0x108f, 0x108f,
- 0x109a, 0x109c,
- 0x17b6, 0x17b6,
- 0x17be, 0x17c5,
- 0x17c7, 0x17c8,
- 0x1923, 0x1926,
- 0x1929, 0x192b,
- 0x1930, 0x1931,
- 0x1933, 0x1938,
- 0x1a19, 0x1a1a,
- 0x1a55, 0x1a55,
- 0x1a57, 0x1a57,
- 0x1a61, 0x1a61,
- 0x1a63, 0x1a64,
- 0x1a6d, 0x1a72,
- 0x1b04, 0x1b04,
- 0x1b35, 0x1b35,
- 0x1b3b, 0x1b3b,
- 0x1b3d, 0x1b41,
- 0x1b43, 0x1b44,
- 0x1b82, 0x1b82,
- 0x1ba1, 0x1ba1,
- 0x1ba6, 0x1ba7,
- 0x1baa, 0x1baa,
- 0x1be7, 0x1be7,
- 0x1bea, 0x1bec,
- 0x1bee, 0x1bee,
- 0x1bf2, 0x1bf3,
- 0x1c24, 0x1c2b,
- 0x1c34, 0x1c35,
- 0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf3,
- 0x1cf7, 0x1cf7,
- 0x302e, 0x302f,
- 0xa823, 0xa824,
- 0xa827, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa952, 0xa953,
- 0xa983, 0xa983,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9bd, 0xa9c0,
- 0xaa2f, 0xaa30,
- 0xaa33, 0xaa34,
- 0xaa4d, 0xaa4d,
- 0xaa7b, 0xaa7b,
- 0xaa7d, 0xaa7d,
- 0xaaeb, 0xaaeb,
- 0xaaee, 0xaaef,
- 0xaaf5, 0xaaf5,
- 0xabe3, 0xabe4,
- 0xabe6, 0xabe7,
- 0xabe9, 0xabea,
- 0xabec, 0xabec,
- 0x11000, 0x11000,
- 0x11002, 0x11002,
- 0x11082, 0x11082,
- 0x110b0, 0x110b2,
- 0x110b7, 0x110b8,
- 0x1112c, 0x1112c,
- 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,
- 0x11435, 0x11437,
- 0x11440, 0x11441,
- 0x11445, 0x11445,
- 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,
- 0x11a07, 0x11a08,
- 0x11a39, 0x11a39,
- 0x11a57, 0x11a58,
- 0x11a97, 0x11a97,
- 0x11c2f, 0x11c2f,
- 0x11c3e, 0x11c3e,
- 0x11ca9, 0x11ca9,
- 0x11cb1, 0x11cb1,
- 0x11cb4, 0x11cb4,
- 0x16f51, 0x16f7e,
- 0x1d165, 0x1d166,
- 0x1d16d, 0x1d172,
-}; /* CR_Mc */
-
-/* 'Me': General Category */
-static const OnigCodePoint CR_Me[] = {
- 5,
- 0x0488, 0x0489,
- 0x1abe, 0x1abe,
- 0x20dd, 0x20e0,
- 0x20e2, 0x20e4,
- 0xa670, 0xa672,
-}; /* CR_Me */
-
-/* 'Mn': General Category */
-static const OnigCodePoint CR_Mn[] = {
- 301,
- 0x0300, 0x036f,
- 0x0483, 0x0487,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x061a,
- 0x064b, 0x065f,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06df, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ea, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x07eb, 0x07f3,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0902,
- 0x093a, 0x093a,
- 0x093c, 0x093c,
- 0x0941, 0x0948,
- 0x094d, 0x094d,
- 0x0951, 0x0957,
- 0x0962, 0x0963,
- 0x0981, 0x0981,
- 0x09bc, 0x09bc,
- 0x09c1, 0x09c4,
- 0x09cd, 0x09cd,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a02,
- 0x0a3c, 0x0a3c,
- 0x0a41, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 0x0a81, 0x0a82,
- 0x0abc, 0x0abc,
- 0x0ac1, 0x0ac5,
- 0x0ac7, 0x0ac8,
- 0x0acd, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0afa, 0x0aff,
- 0x0b01, 0x0b01,
- 0x0b3c, 0x0b3c,
- 0x0b3f, 0x0b3f,
- 0x0b41, 0x0b44,
- 0x0b4d, 0x0b4d,
- 0x0b56, 0x0b56,
- 0x0b62, 0x0b63,
- 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,
- 0x0d00, 0x0d01,
- 0x0d3b, 0x0d3c,
- 0x0d41, 0x0d44,
- 0x0d4d, 0x0d4d,
- 0x0d62, 0x0d63,
- 0x0dca, 0x0dca,
- 0x0dd2, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f71, 0x0f7e,
- 0x0f80, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f8d, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x102d, 0x1030,
- 0x1032, 0x1037,
- 0x1039, 0x103a,
- 0x103d, 0x103e,
- 0x1058, 0x1059,
- 0x105e, 0x1060,
- 0x1071, 0x1074,
- 0x1082, 0x1082,
- 0x1085, 0x1086,
- 0x108d, 0x108d,
- 0x109d, 0x109d,
- 0x135d, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b4, 0x17b5,
- 0x17b7, 0x17bd,
- 0x17c6, 0x17c6,
- 0x17c9, 0x17d3,
- 0x17dd, 0x17dd,
- 0x180b, 0x180d,
- 0x1885, 0x1886,
- 0x18a9, 0x18a9,
- 0x1920, 0x1922,
- 0x1927, 0x1928,
- 0x1932, 0x1932,
- 0x1939, 0x193b,
- 0x1a17, 0x1a18,
- 0x1a1b, 0x1a1b,
- 0x1a56, 0x1a56,
- 0x1a58, 0x1a5e,
- 0x1a60, 0x1a60,
- 0x1a62, 0x1a62,
- 0x1a65, 0x1a6c,
- 0x1a73, 0x1a7c,
- 0x1a7f, 0x1a7f,
- 0x1ab0, 0x1abd,
- 0x1b00, 0x1b03,
- 0x1b34, 0x1b34,
- 0x1b36, 0x1b3a,
- 0x1b3c, 0x1b3c,
- 0x1b42, 0x1b42,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1b81,
- 0x1ba2, 0x1ba5,
- 0x1ba8, 0x1ba9,
- 0x1bab, 0x1bad,
- 0x1be6, 0x1be6,
- 0x1be8, 0x1be9,
- 0x1bed, 0x1bed,
- 0x1bef, 0x1bf1,
- 0x1c2c, 0x1c33,
- 0x1c36, 0x1c37,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1ce0,
- 0x1ce2, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf4, 0x1cf4,
- 0x1cf8, 0x1cf9,
- 0x1dc0, 0x1df9,
- 0x1dfb, 0x1dff,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20f0,
- 0x2cef, 0x2cf1,
- 0x2d7f, 0x2d7f,
- 0x2de0, 0x2dff,
- 0x302a, 0x302d,
- 0x3099, 0x309a,
- 0xa66f, 0xa66f,
- 0xa674, 0xa67d,
- 0xa69e, 0xa69f,
- 0xa6f0, 0xa6f1,
- 0xa802, 0xa802,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa825, 0xa826,
- 0xa8c4, 0xa8c5,
- 0xa8e0, 0xa8f1,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 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,
- 0xaabe, 0xaabf,
- 0xaac1, 0xaac1,
- 0xaaec, 0xaaed,
- 0xaaf6, 0xaaf6,
- 0xabe5, 0xabe5,
- 0xabe8, 0xabe8,
- 0xabed, 0xabed,
- 0xfb1e, 0xfb1e,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2f,
- 0x101fd, 0x101fd,
- 0x102e0, 0x102e0,
- 0x10376, 0x1037a,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10ae5, 0x10ae6,
- 0x11001, 0x11001,
- 0x11038, 0x11046,
- 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,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133c, 0x1133c,
- 0x11340, 0x11340,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 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,
- 0x11a01, 0x11a06,
- 0x11a09, 0x11a0a,
- 0x11a33, 0x11a38,
- 0x11a3b, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a51, 0x11a56,
- 0x11a59, 0x11a5b,
- 0x11a8a, 0x11a96,
- 0x11a98, 0x11a99,
- 0x11c30, 0x11c36,
- 0x11c38, 0x11c3d,
- 0x11c3f, 0x11c3f,
- 0x11c92, 0x11ca7,
- 0x11caa, 0x11cb0,
- 0x11cb2, 0x11cb3,
- 0x11cb5, 0x11cb6,
- 0x11d31, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d45,
- 0x11d47, 0x11d47,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0100, 0xe01ef,
-}; /* CR_Mn */
-
-/* 'N': Major Category */
-static const OnigCodePoint CR_N[] = {
- 116,
- 0x0030, 0x0039,
- 0x00b2, 0x00b3,
- 0x00b9, 0x00b9,
- 0x00bc, 0x00be,
- 0x0660, 0x0669,
- 0x06f0, 0x06f9,
- 0x07c0, 0x07c9,
- 0x0966, 0x096f,
- 0x09e6, 0x09ef,
- 0x09f4, 0x09f9,
- 0x0a66, 0x0a6f,
- 0x0ae6, 0x0aef,
- 0x0b66, 0x0b6f,
- 0x0b72, 0x0b77,
- 0x0be6, 0x0bf2,
- 0x0c66, 0x0c6f,
- 0x0c78, 0x0c7e,
- 0x0ce6, 0x0cef,
- 0x0d58, 0x0d5e,
- 0x0d66, 0x0d78,
- 0x0de6, 0x0def,
- 0x0e50, 0x0e59,
- 0x0ed0, 0x0ed9,
- 0x0f20, 0x0f33,
- 0x1040, 0x1049,
- 0x1090, 0x1099,
- 0x1369, 0x137c,
- 0x16ee, 0x16f0,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1810, 0x1819,
- 0x1946, 0x194f,
- 0x19d0, 0x19da,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1b50, 0x1b59,
- 0x1bb0, 0x1bb9,
- 0x1c40, 0x1c49,
- 0x1c50, 0x1c59,
- 0x2070, 0x2070,
- 0x2074, 0x2079,
- 0x2080, 0x2089,
- 0x2150, 0x2182,
- 0x2185, 0x2189,
- 0x2460, 0x249b,
- 0x24ea, 0x24ff,
- 0x2776, 0x2793,
- 0x2cfd, 0x2cfd,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303a,
- 0x3192, 0x3195,
- 0x3220, 0x3229,
- 0x3248, 0x324f,
- 0x3251, 0x325f,
- 0x3280, 0x3289,
- 0x32b1, 0x32bf,
- 0xa620, 0xa629,
- 0xa6e6, 0xa6ef,
- 0xa830, 0xa835,
- 0xa8d0, 0xa8d9,
- 0xa900, 0xa909,
- 0xa9d0, 0xa9d9,
- 0xa9f0, 0xa9f9,
- 0xaa50, 0xaa59,
- 0xabf0, 0xabf9,
- 0xff10, 0xff19,
- 0x10107, 0x10133,
- 0x10140, 0x10178,
- 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,
- 0x11450, 0x11459,
- 0x114d0, 0x114d9,
- 0x11650, 0x11659,
- 0x116c0, 0x116c9,
- 0x11730, 0x1173b,
- 0x118e0, 0x118f2,
- 0x11c50, 0x11c6c,
- 0x11d50, 0x11d59,
- 0x12400, 0x1246e,
- 0x16a60, 0x16a69,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x1d360, 0x1d371,
- 0x1d7ce, 0x1d7ff,
- 0x1e8c7, 0x1e8cf,
- 0x1e950, 0x1e959,
- 0x1f100, 0x1f10c,
-}; /* CR_N */
-
-/* 'Nd': General Category */
-#define CR_Nd CR_Digit
-
-/* 'Nl': General Category */
-static const OnigCodePoint CR_Nl[] = {
- 12,
- 0x16ee, 0x16f0,
- 0x2160, 0x2182,
- 0x2185, 0x2188,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303a,
- 0xa6e6, 0xa6ef,
- 0x10140, 0x10174,
- 0x10341, 0x10341,
- 0x1034a, 0x1034a,
- 0x103d1, 0x103d5,
- 0x12400, 0x1246e,
-}; /* CR_Nl */
-
-/* 'No': General Category */
-static const OnigCodePoint CR_No[] = {
- 60,
- 0x00b2, 0x00b3,
- 0x00b9, 0x00b9,
- 0x00bc, 0x00be,
- 0x09f4, 0x09f9,
- 0x0b72, 0x0b77,
- 0x0bf0, 0x0bf2,
- 0x0c78, 0x0c7e,
- 0x0d58, 0x0d5e,
- 0x0d70, 0x0d78,
- 0x0f2a, 0x0f33,
- 0x1369, 0x137c,
- 0x17f0, 0x17f9,
- 0x19da, 0x19da,
- 0x2070, 0x2070,
- 0x2074, 0x2079,
- 0x2080, 0x2089,
- 0x2150, 0x215f,
- 0x2189, 0x2189,
- 0x2460, 0x249b,
- 0x24ea, 0x24ff,
- 0x2776, 0x2793,
- 0x2cfd, 0x2cfd,
- 0x3192, 0x3195,
- 0x3220, 0x3229,
- 0x3248, 0x324f,
- 0x3251, 0x325f,
- 0x3280, 0x3289,
- 0x32b1, 0x32bf,
- 0xa830, 0xa835,
- 0x10107, 0x10133,
- 0x10175, 0x10178,
- 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,
- 0x11c5a, 0x11c6c,
- 0x16b5b, 0x16b61,
- 0x1d360, 0x1d371,
- 0x1e8c7, 0x1e8cf,
- 0x1f100, 0x1f10c,
-}; /* CR_No */
-
-/* 'P': Major Category */
-#define CR_P CR_Punct
-
-/* 'Pc': General Category */
-static const OnigCodePoint CR_Pc[] = {
- 6,
- 0x005f, 0x005f,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xff3f, 0xff3f,
-}; /* CR_Pc */
-
-/* 'Pd': General Category */
-static const OnigCodePoint CR_Pd[] = {
- 17,
- 0x002d, 0x002d,
- 0x058a, 0x058a,
- 0x05be, 0x05be,
- 0x1400, 0x1400,
- 0x1806, 0x1806,
- 0x2010, 0x2015,
- 0x2e17, 0x2e17,
- 0x2e1a, 0x2e1a,
- 0x2e3a, 0x2e3b,
- 0x2e40, 0x2e40,
- 0x301c, 0x301c,
- 0x3030, 0x3030,
- 0x30a0, 0x30a0,
- 0xfe31, 0xfe32,
- 0xfe58, 0xfe58,
- 0xfe63, 0xfe63,
- 0xff0d, 0xff0d,
-}; /* CR_Pd */
-
-/* 'Pe': General Category */
-static const OnigCodePoint CR_Pe[] = {
- 72,
- 0x0029, 0x0029,
- 0x005d, 0x005d,
- 0x007d, 0x007d,
- 0x0f3b, 0x0f3b,
- 0x0f3d, 0x0f3d,
- 0x169c, 0x169c,
- 0x2046, 0x2046,
- 0x207e, 0x207e,
- 0x208e, 0x208e,
- 0x2309, 0x2309,
- 0x230b, 0x230b,
- 0x232a, 0x232a,
- 0x2769, 0x2769,
- 0x276b, 0x276b,
- 0x276d, 0x276d,
- 0x276f, 0x276f,
- 0x2771, 0x2771,
- 0x2773, 0x2773,
- 0x2775, 0x2775,
- 0x27c6, 0x27c6,
- 0x27e7, 0x27e7,
- 0x27e9, 0x27e9,
- 0x27eb, 0x27eb,
- 0x27ed, 0x27ed,
- 0x27ef, 0x27ef,
- 0x2984, 0x2984,
- 0x2986, 0x2986,
- 0x2988, 0x2988,
- 0x298a, 0x298a,
- 0x298c, 0x298c,
- 0x298e, 0x298e,
- 0x2990, 0x2990,
- 0x2992, 0x2992,
- 0x2994, 0x2994,
- 0x2996, 0x2996,
- 0x2998, 0x2998,
- 0x29d9, 0x29d9,
- 0x29db, 0x29db,
- 0x29fd, 0x29fd,
- 0x2e23, 0x2e23,
- 0x2e25, 0x2e25,
- 0x2e27, 0x2e27,
- 0x2e29, 0x2e29,
- 0x3009, 0x3009,
- 0x300b, 0x300b,
- 0x300d, 0x300d,
- 0x300f, 0x300f,
- 0x3011, 0x3011,
- 0x3015, 0x3015,
- 0x3017, 0x3017,
- 0x3019, 0x3019,
- 0x301b, 0x301b,
- 0x301e, 0x301f,
- 0xfd3e, 0xfd3e,
- 0xfe18, 0xfe18,
- 0xfe36, 0xfe36,
- 0xfe38, 0xfe38,
- 0xfe3a, 0xfe3a,
- 0xfe3c, 0xfe3c,
- 0xfe3e, 0xfe3e,
- 0xfe40, 0xfe40,
- 0xfe42, 0xfe42,
- 0xfe44, 0xfe44,
- 0xfe48, 0xfe48,
- 0xfe5a, 0xfe5a,
- 0xfe5c, 0xfe5c,
- 0xfe5e, 0xfe5e,
- 0xff09, 0xff09,
- 0xff3d, 0xff3d,
- 0xff5d, 0xff5d,
- 0xff60, 0xff60,
- 0xff63, 0xff63,
-}; /* CR_Pe */
-
-/* 'Pf': General Category */
-static const OnigCodePoint CR_Pf[] = {
- 10,
- 0x00bb, 0x00bb,
- 0x2019, 0x2019,
- 0x201d, 0x201d,
- 0x203a, 0x203a,
- 0x2e03, 0x2e03,
- 0x2e05, 0x2e05,
- 0x2e0a, 0x2e0a,
- 0x2e0d, 0x2e0d,
- 0x2e1d, 0x2e1d,
- 0x2e21, 0x2e21,
-}; /* CR_Pf */
-
-/* 'Pi': General Category */
-static const OnigCodePoint CR_Pi[] = {
- 11,
- 0x00ab, 0x00ab,
- 0x2018, 0x2018,
- 0x201b, 0x201c,
- 0x201f, 0x201f,
- 0x2039, 0x2039,
- 0x2e02, 0x2e02,
- 0x2e04, 0x2e04,
- 0x2e09, 0x2e09,
- 0x2e0c, 0x2e0c,
- 0x2e1c, 0x2e1c,
- 0x2e20, 0x2e20,
-}; /* CR_Pi */
-
-/* 'Po': General Category */
-static const OnigCodePoint CR_Po[] = {
- 169,
- 0x0021, 0x0023,
- 0x0025, 0x0027,
- 0x002a, 0x002a,
- 0x002c, 0x002c,
- 0x002e, 0x002f,
- 0x003a, 0x003b,
- 0x003f, 0x0040,
- 0x005c, 0x005c,
- 0x00a1, 0x00a1,
- 0x00a7, 0x00a7,
- 0x00b6, 0x00b7,
- 0x00bf, 0x00bf,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x055a, 0x055f,
- 0x0589, 0x0589,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05f3, 0x05f4,
- 0x0609, 0x060a,
- 0x060c, 0x060d,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x066a, 0x066d,
- 0x06d4, 0x06d4,
- 0x0700, 0x070d,
- 0x07f7, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0970, 0x0970,
- 0x09fd, 0x09fd,
- 0x0af0, 0x0af0,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f14, 0x0f14,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1360, 0x1368,
- 0x166d, 0x166e,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17d8, 0x17da,
- 0x1800, 0x1805,
- 0x1807, 0x180a,
- 0x1944, 0x1945,
- 0x1a1e, 0x1a1f,
- 0x1aa0, 0x1aa6,
- 0x1aa8, 0x1aad,
- 0x1b5a, 0x1b60,
- 0x1bfc, 0x1bff,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd3, 0x1cd3,
- 0x2016, 0x2017,
- 0x2020, 0x2027,
- 0x2030, 0x2038,
- 0x203b, 0x203e,
- 0x2041, 0x2043,
- 0x2047, 0x2051,
- 0x2053, 0x2053,
- 0x2055, 0x205e,
- 0x2cf9, 0x2cfc,
- 0x2cfe, 0x2cff,
- 0x2d70, 0x2d70,
- 0x2e00, 0x2e01,
- 0x2e06, 0x2e08,
- 0x2e0b, 0x2e0b,
- 0x2e0e, 0x2e16,
- 0x2e18, 0x2e19,
- 0x2e1b, 0x2e1b,
- 0x2e1e, 0x2e1f,
- 0x2e2a, 0x2e2e,
- 0x2e30, 0x2e39,
- 0x2e3c, 0x2e3f,
- 0x2e41, 0x2e41,
- 0x2e43, 0x2e49,
- 0x3001, 0x3003,
- 0x303d, 0x303d,
- 0x30fb, 0x30fb,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa673, 0xa673,
- 0xa67e, 0xa67e,
- 0xa6f2, 0xa6f7,
- 0xa874, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa8f8, 0xa8fa,
- 0xa8fc, 0xa8fc,
- 0xa92e, 0xa92f,
- 0xa95f, 0xa95f,
- 0xa9c1, 0xa9cd,
- 0xa9de, 0xa9df,
- 0xaa5c, 0xaa5f,
- 0xaade, 0xaadf,
- 0xaaf0, 0xaaf1,
- 0xabeb, 0xabeb,
- 0xfe10, 0xfe16,
- 0xfe19, 0xfe19,
- 0xfe30, 0xfe30,
- 0xfe45, 0xfe46,
- 0xfe49, 0xfe4c,
- 0xfe50, 0xfe52,
- 0xfe54, 0xfe57,
- 0xfe5f, 0xfe61,
- 0xfe68, 0xfe68,
- 0xfe6a, 0xfe6b,
- 0xff01, 0xff03,
- 0xff05, 0xff07,
- 0xff0a, 0xff0a,
- 0xff0c, 0xff0c,
- 0xff0e, 0xff0f,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff20,
- 0xff3c, 0xff3c,
- 0xff61, 0xff61,
- 0xff64, 0xff65,
- 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, 0x111c9,
- 0x111cd, 0x111cd,
- 0x111db, 0x111db,
- 0x111dd, 0x111df,
- 0x11238, 0x1123d,
- 0x112a9, 0x112a9,
- 0x1144b, 0x1144f,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x114c6, 0x114c6,
- 0x115c1, 0x115d7,
- 0x11641, 0x11643,
- 0x11660, 0x1166c,
- 0x1173c, 0x1173e,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x1bc9f, 0x1bc9f,
- 0x1da87, 0x1da8b,
- 0x1e95e, 0x1e95f,
-}; /* CR_Po */
-
-/* 'Ps': General Category */
-static const OnigCodePoint CR_Ps[] = {
- 75,
- 0x0028, 0x0028,
- 0x005b, 0x005b,
- 0x007b, 0x007b,
- 0x0f3a, 0x0f3a,
- 0x0f3c, 0x0f3c,
- 0x169b, 0x169b,
- 0x201a, 0x201a,
- 0x201e, 0x201e,
- 0x2045, 0x2045,
- 0x207d, 0x207d,
- 0x208d, 0x208d,
- 0x2308, 0x2308,
- 0x230a, 0x230a,
- 0x2329, 0x2329,
- 0x2768, 0x2768,
- 0x276a, 0x276a,
- 0x276c, 0x276c,
- 0x276e, 0x276e,
- 0x2770, 0x2770,
- 0x2772, 0x2772,
- 0x2774, 0x2774,
- 0x27c5, 0x27c5,
- 0x27e6, 0x27e6,
- 0x27e8, 0x27e8,
- 0x27ea, 0x27ea,
- 0x27ec, 0x27ec,
- 0x27ee, 0x27ee,
- 0x2983, 0x2983,
- 0x2985, 0x2985,
- 0x2987, 0x2987,
- 0x2989, 0x2989,
- 0x298b, 0x298b,
- 0x298d, 0x298d,
- 0x298f, 0x298f,
- 0x2991, 0x2991,
- 0x2993, 0x2993,
- 0x2995, 0x2995,
- 0x2997, 0x2997,
- 0x29d8, 0x29d8,
- 0x29da, 0x29da,
- 0x29fc, 0x29fc,
- 0x2e22, 0x2e22,
- 0x2e24, 0x2e24,
- 0x2e26, 0x2e26,
- 0x2e28, 0x2e28,
- 0x2e42, 0x2e42,
- 0x3008, 0x3008,
- 0x300a, 0x300a,
- 0x300c, 0x300c,
- 0x300e, 0x300e,
- 0x3010, 0x3010,
- 0x3014, 0x3014,
- 0x3016, 0x3016,
- 0x3018, 0x3018,
- 0x301a, 0x301a,
- 0x301d, 0x301d,
- 0xfd3f, 0xfd3f,
- 0xfe17, 0xfe17,
- 0xfe35, 0xfe35,
- 0xfe37, 0xfe37,
- 0xfe39, 0xfe39,
- 0xfe3b, 0xfe3b,
- 0xfe3d, 0xfe3d,
- 0xfe3f, 0xfe3f,
- 0xfe41, 0xfe41,
- 0xfe43, 0xfe43,
- 0xfe47, 0xfe47,
- 0xfe59, 0xfe59,
- 0xfe5b, 0xfe5b,
- 0xfe5d, 0xfe5d,
- 0xff08, 0xff08,
- 0xff3b, 0xff3b,
- 0xff5b, 0xff5b,
- 0xff5f, 0xff5f,
- 0xff62, 0xff62,
-}; /* CR_Ps */
-
-/* 'S': Major Category */
-static const OnigCodePoint CR_S[] = {
- 217,
- 0x0024, 0x0024,
- 0x002b, 0x002b,
- 0x003c, 0x003e,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x007c, 0x007c,
- 0x007e, 0x007e,
- 0x00a2, 0x00a6,
- 0x00a8, 0x00a9,
- 0x00ac, 0x00ac,
- 0x00ae, 0x00b1,
- 0x00b4, 0x00b4,
- 0x00b8, 0x00b8,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x02c2, 0x02c5,
- 0x02d2, 0x02df,
- 0x02e5, 0x02eb,
- 0x02ed, 0x02ed,
- 0x02ef, 0x02ff,
- 0x0375, 0x0375,
- 0x0384, 0x0385,
- 0x03f6, 0x03f6,
- 0x0482, 0x0482,
- 0x058d, 0x058f,
- 0x0606, 0x0608,
- 0x060b, 0x060b,
- 0x060e, 0x060f,
- 0x06de, 0x06de,
- 0x06e9, 0x06e9,
- 0x06fd, 0x06fe,
- 0x07f6, 0x07f6,
- 0x09f2, 0x09f3,
- 0x09fa, 0x09fb,
- 0x0af1, 0x0af1,
- 0x0b70, 0x0b70,
- 0x0bf3, 0x0bfa,
- 0x0c7f, 0x0c7f,
- 0x0d4f, 0x0d4f,
- 0x0d79, 0x0d79,
- 0x0e3f, 0x0e3f,
- 0x0f01, 0x0f03,
- 0x0f13, 0x0f13,
- 0x0f15, 0x0f17,
- 0x0f1a, 0x0f1f,
- 0x0f34, 0x0f34,
- 0x0f36, 0x0f36,
- 0x0f38, 0x0f38,
- 0x0fbe, 0x0fc5,
- 0x0fc7, 0x0fcc,
- 0x0fce, 0x0fcf,
- 0x0fd5, 0x0fd8,
- 0x109e, 0x109f,
- 0x1390, 0x1399,
- 0x17db, 0x17db,
- 0x1940, 0x1940,
- 0x19de, 0x19ff,
- 0x1b61, 0x1b6a,
- 0x1b74, 0x1b7c,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x2044, 0x2044,
- 0x2052, 0x2052,
- 0x207a, 0x207c,
- 0x208a, 0x208c,
- 0x20a0, 0x20bf,
- 0x2100, 0x2101,
- 0x2103, 0x2106,
- 0x2108, 0x2109,
- 0x2114, 0x2114,
- 0x2116, 0x2118,
- 0x211e, 0x2123,
- 0x2125, 0x2125,
- 0x2127, 0x2127,
- 0x2129, 0x2129,
- 0x212e, 0x212e,
- 0x213a, 0x213b,
- 0x2140, 0x2144,
- 0x214a, 0x214d,
- 0x214f, 0x214f,
- 0x218a, 0x218b,
- 0x2190, 0x2307,
- 0x230c, 0x2328,
- 0x232b, 0x2426,
- 0x2440, 0x244a,
- 0x249c, 0x24e9,
- 0x2500, 0x2767,
- 0x2794, 0x27c4,
- 0x27c7, 0x27e5,
- 0x27f0, 0x2982,
- 0x2999, 0x29d7,
- 0x29dc, 0x29fb,
- 0x29fe, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 0x2bec, 0x2bef,
- 0x2ce5, 0x2cea,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3004, 0x3004,
- 0x3012, 0x3013,
- 0x3020, 0x3020,
- 0x3036, 0x3037,
- 0x303e, 0x303f,
- 0x309b, 0x309c,
- 0x3190, 0x3191,
- 0x3196, 0x319f,
- 0x31c0, 0x31e3,
- 0x3200, 0x321e,
- 0x322a, 0x3247,
- 0x3250, 0x3250,
- 0x3260, 0x327f,
- 0x328a, 0x32b0,
- 0x32c0, 0x32fe,
- 0x3300, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa490, 0xa4c6,
- 0xa700, 0xa716,
- 0xa720, 0xa721,
- 0xa789, 0xa78a,
- 0xa828, 0xa82b,
- 0xa836, 0xa839,
- 0xaa77, 0xaa79,
- 0xab5b, 0xab5b,
- 0xfb29, 0xfb29,
- 0xfbb2, 0xfbc1,
- 0xfdfc, 0xfdfd,
- 0xfe62, 0xfe62,
- 0xfe64, 0xfe66,
- 0xfe69, 0xfe69,
- 0xff04, 0xff04,
- 0xff0b, 0xff0b,
- 0xff1c, 0xff1e,
- 0xff3e, 0xff3e,
- 0xff40, 0xff40,
- 0xff5c, 0xff5c,
- 0xff5e, 0xff5e,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfffc, 0xfffd,
- 0x10137, 0x1013f,
- 0x10179, 0x10189,
- 0x1018c, 0x1018e,
- 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, 0x1d1e8,
- 0x1d200, 0x1d241,
- 0x1d245, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d6c1, 0x1d6c1,
- 0x1d6db, 0x1d6db,
- 0x1d6fb, 0x1d6fb,
- 0x1d715, 0x1d715,
- 0x1d735, 0x1d735,
- 0x1d74f, 0x1d74f,
- 0x1d76f, 0x1d76f,
- 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, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
-}; /* CR_S */
-
-/* 'Sc': General Category */
-static const OnigCodePoint CR_Sc[] = {
- 17,
- 0x0024, 0x0024,
- 0x00a2, 0x00a5,
- 0x058f, 0x058f,
- 0x060b, 0x060b,
- 0x09f2, 0x09f3,
- 0x09fb, 0x09fb,
- 0x0af1, 0x0af1,
- 0x0bf9, 0x0bf9,
- 0x0e3f, 0x0e3f,
- 0x17db, 0x17db,
- 0x20a0, 0x20bf,
- 0xa838, 0xa838,
- 0xfdfc, 0xfdfc,
- 0xfe69, 0xfe69,
- 0xff04, 0xff04,
- 0xffe0, 0xffe1,
- 0xffe5, 0xffe6,
-}; /* CR_Sc */
-
-/* 'Sk': General Category */
-static const OnigCodePoint CR_Sk[] = {
- 29,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x00a8, 0x00a8,
- 0x00af, 0x00af,
- 0x00b4, 0x00b4,
- 0x00b8, 0x00b8,
- 0x02c2, 0x02c5,
- 0x02d2, 0x02df,
- 0x02e5, 0x02eb,
- 0x02ed, 0x02ed,
- 0x02ef, 0x02ff,
- 0x0375, 0x0375,
- 0x0384, 0x0385,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x309b, 0x309c,
- 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[] = {
- 64,
- 0x002b, 0x002b,
- 0x003c, 0x003e,
- 0x007c, 0x007c,
- 0x007e, 0x007e,
- 0x00ac, 0x00ac,
- 0x00b1, 0x00b1,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x03f6, 0x03f6,
- 0x0606, 0x0608,
- 0x2044, 0x2044,
- 0x2052, 0x2052,
- 0x207a, 0x207c,
- 0x208a, 0x208c,
- 0x2118, 0x2118,
- 0x2140, 0x2144,
- 0x214b, 0x214b,
- 0x2190, 0x2194,
- 0x219a, 0x219b,
- 0x21a0, 0x21a0,
- 0x21a3, 0x21a3,
- 0x21a6, 0x21a6,
- 0x21ae, 0x21ae,
- 0x21ce, 0x21cf,
- 0x21d2, 0x21d2,
- 0x21d4, 0x21d4,
- 0x21f4, 0x22ff,
- 0x2320, 0x2321,
- 0x237c, 0x237c,
- 0x239b, 0x23b3,
- 0x23dc, 0x23e1,
- 0x25b7, 0x25b7,
- 0x25c1, 0x25c1,
- 0x25f8, 0x25ff,
- 0x266f, 0x266f,
- 0x27c0, 0x27c4,
- 0x27c7, 0x27e5,
- 0x27f0, 0x27ff,
- 0x2900, 0x2982,
- 0x2999, 0x29d7,
- 0x29dc, 0x29fb,
- 0x29fe, 0x2aff,
- 0x2b30, 0x2b44,
- 0x2b47, 0x2b4c,
- 0xfb29, 0xfb29,
- 0xfe62, 0xfe62,
- 0xfe64, 0xfe66,
- 0xff0b, 0xff0b,
- 0xff1c, 0xff1e,
- 0xff5c, 0xff5c,
- 0xff5e, 0xff5e,
- 0xffe2, 0xffe2,
- 0xffe9, 0xffec,
- 0x1d6c1, 0x1d6c1,
- 0x1d6db, 0x1d6db,
- 0x1d6fb, 0x1d6fb,
- 0x1d715, 0x1d715,
- 0x1d735, 0x1d735,
- 0x1d74f, 0x1d74f,
- 0x1d76f, 0x1d76f,
- 0x1d789, 0x1d789,
- 0x1d7a9, 0x1d7a9,
- 0x1d7c3, 0x1d7c3,
- 0x1eef0, 0x1eef1,
-}; /* CR_Sm */
-
-/* 'So': General Category */
-static const OnigCodePoint CR_So[] = {
- 173,
- 0x00a6, 0x00a6,
- 0x00a9, 0x00a9,
- 0x00ae, 0x00ae,
- 0x00b0, 0x00b0,
- 0x0482, 0x0482,
- 0x058d, 0x058e,
- 0x060e, 0x060f,
- 0x06de, 0x06de,
- 0x06e9, 0x06e9,
- 0x06fd, 0x06fe,
- 0x07f6, 0x07f6,
- 0x09fa, 0x09fa,
- 0x0b70, 0x0b70,
- 0x0bf3, 0x0bf8,
- 0x0bfa, 0x0bfa,
- 0x0c7f, 0x0c7f,
- 0x0d4f, 0x0d4f,
- 0x0d79, 0x0d79,
- 0x0f01, 0x0f03,
- 0x0f13, 0x0f13,
- 0x0f15, 0x0f17,
- 0x0f1a, 0x0f1f,
- 0x0f34, 0x0f34,
- 0x0f36, 0x0f36,
- 0x0f38, 0x0f38,
- 0x0fbe, 0x0fc5,
- 0x0fc7, 0x0fcc,
- 0x0fce, 0x0fcf,
- 0x0fd5, 0x0fd8,
- 0x109e, 0x109f,
- 0x1390, 0x1399,
- 0x1940, 0x1940,
- 0x19de, 0x19ff,
- 0x1b61, 0x1b6a,
- 0x1b74, 0x1b7c,
- 0x2100, 0x2101,
- 0x2103, 0x2106,
- 0x2108, 0x2109,
- 0x2114, 0x2114,
- 0x2116, 0x2117,
- 0x211e, 0x2123,
- 0x2125, 0x2125,
- 0x2127, 0x2127,
- 0x2129, 0x2129,
- 0x212e, 0x212e,
- 0x213a, 0x213b,
- 0x214a, 0x214a,
- 0x214c, 0x214d,
- 0x214f, 0x214f,
- 0x218a, 0x218b,
- 0x2195, 0x2199,
- 0x219c, 0x219f,
- 0x21a1, 0x21a2,
- 0x21a4, 0x21a5,
- 0x21a7, 0x21ad,
- 0x21af, 0x21cd,
- 0x21d0, 0x21d1,
- 0x21d3, 0x21d3,
- 0x21d5, 0x21f3,
- 0x2300, 0x2307,
- 0x230c, 0x231f,
- 0x2322, 0x2328,
- 0x232b, 0x237b,
- 0x237d, 0x239a,
- 0x23b4, 0x23db,
- 0x23e2, 0x2426,
- 0x2440, 0x244a,
- 0x249c, 0x24e9,
- 0x2500, 0x25b6,
- 0x25b8, 0x25c0,
- 0x25c2, 0x25f7,
- 0x2600, 0x266e,
- 0x2670, 0x2767,
- 0x2794, 0x27bf,
- 0x2800, 0x28ff,
- 0x2b00, 0x2b2f,
- 0x2b45, 0x2b46,
- 0x2b4d, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 0x2bec, 0x2bef,
- 0x2ce5, 0x2cea,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3004, 0x3004,
- 0x3012, 0x3013,
- 0x3020, 0x3020,
- 0x3036, 0x3037,
- 0x303e, 0x303f,
- 0x3190, 0x3191,
- 0x3196, 0x319f,
- 0x31c0, 0x31e3,
- 0x3200, 0x321e,
- 0x322a, 0x3247,
- 0x3250, 0x3250,
- 0x3260, 0x327f,
- 0x328a, 0x32b0,
- 0x32c0, 0x32fe,
- 0x3300, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa490, 0xa4c6,
- 0xa828, 0xa82b,
- 0xa836, 0xa837,
- 0xa839, 0xa839,
- 0xaa77, 0xaa79,
- 0xfdfd, 0xfdfd,
- 0xffe4, 0xffe4,
- 0xffe8, 0xffe8,
- 0xffed, 0xffee,
- 0xfffc, 0xfffd,
- 0x10137, 0x1013f,
- 0x10179, 0x10189,
- 0x1018c, 0x1018e,
- 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, 0x1d1e8,
- 0x1d200, 0x1d241,
- 0x1d245, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d800, 0x1d9ff,
- 0x1da37, 0x1da3a,
- 0x1da6d, 0x1da74,
- 0x1da76, 0x1da83,
- 0x1da85, 0x1da86,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f3fa,
- 0x1f400, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
-}; /* CR_So */
-
-/* 'Z': Major Category */
-static const OnigCodePoint CR_Z[] = {
- 8,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x2000, 0x200a,
- 0x2028, 0x2029,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Z */
-
-/* 'Zl': General Category */
-static const OnigCodePoint CR_Zl[] = {
- 1,
- 0x2028, 0x2028,
-}; /* CR_Zl */
-
-/* 'Zp': General Category */
-static const OnigCodePoint CR_Zp[] = {
- 1,
- 0x2029, 0x2029,
-}; /* CR_Zp */
-
-/* 'Zs': General Category */
-static const OnigCodePoint CR_Zs[] = {
- 7,
- 0x0020, 0x0020,
- 0x00a0, 0x00a0,
- 0x1680, 0x1680,
- 0x2000, 0x200a,
- 0x202f, 0x202f,
- 0x205f, 0x205f,
- 0x3000, 0x3000,
-}; /* CR_Zs */
-
-/* 'Math': Derived Property */
-static const OnigCodePoint CR_Math[] = {
- 138,
- 0x002b, 0x002b,
- 0x003c, 0x003e,
- 0x005e, 0x005e,
- 0x007c, 0x007c,
- 0x007e, 0x007e,
- 0x00ac, 0x00ac,
- 0x00b1, 0x00b1,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x03d0, 0x03d2,
- 0x03d5, 0x03d5,
- 0x03f0, 0x03f1,
- 0x03f4, 0x03f6,
- 0x0606, 0x0608,
- 0x2016, 0x2016,
- 0x2032, 0x2034,
- 0x2040, 0x2040,
- 0x2044, 0x2044,
- 0x2052, 0x2052,
- 0x2061, 0x2064,
- 0x207a, 0x207e,
- 0x208a, 0x208e,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20e6,
- 0x20eb, 0x20ef,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2118, 0x211d,
- 0x2124, 0x2124,
- 0x2128, 0x2129,
- 0x212c, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2138,
- 0x213c, 0x2149,
- 0x214b, 0x214b,
- 0x2190, 0x21a7,
- 0x21a9, 0x21ae,
- 0x21b0, 0x21b1,
- 0x21b6, 0x21b7,
- 0x21bc, 0x21db,
- 0x21dd, 0x21dd,
- 0x21e4, 0x21e5,
- 0x21f4, 0x22ff,
- 0x2308, 0x230b,
- 0x2320, 0x2321,
- 0x237c, 0x237c,
- 0x239b, 0x23b5,
- 0x23b7, 0x23b7,
- 0x23d0, 0x23d0,
- 0x23dc, 0x23e2,
- 0x25a0, 0x25a1,
- 0x25ae, 0x25b7,
- 0x25bc, 0x25c1,
- 0x25c6, 0x25c7,
- 0x25ca, 0x25cb,
- 0x25cf, 0x25d3,
- 0x25e2, 0x25e2,
- 0x25e4, 0x25e4,
- 0x25e7, 0x25ec,
- 0x25f8, 0x25ff,
- 0x2605, 0x2606,
- 0x2640, 0x2640,
- 0x2642, 0x2642,
- 0x2660, 0x2663,
- 0x266d, 0x266f,
- 0x27c0, 0x27ff,
- 0x2900, 0x2aff,
- 0x2b30, 0x2b44,
- 0x2b47, 0x2b4c,
- 0xfb29, 0xfb29,
- 0xfe61, 0xfe66,
- 0xfe68, 0xfe68,
- 0xff0b, 0xff0b,
- 0xff1c, 0xff1e,
- 0xff3c, 0xff3c,
- 0xff3e, 0xff3e,
- 0xff5c, 0xff5c,
- 0xff5e, 0xff5e,
- 0xffe2, 0xffe2,
- 0xffe9, 0xffec,
- 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,
-}; /* CR_Math */
-
-/* 'Alphabetic': Derived Property */
-#define CR_Alphabetic CR_Alpha
-
-/* 'Lowercase': Derived Property */
-#define CR_Lowercase CR_Lower
-
-/* 'Uppercase': Derived Property */
-#define CR_Uppercase CR_Upper
-
-/* 'Cased': Derived Property */
-static const OnigCodePoint CR_Cased[] = {
- 135,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x01ba,
- 0x01bc, 0x01bf,
- 0x01c4, 0x0293,
- 0x0295, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x0370, 0x0373,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0561, 0x0587,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x212f, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x217f,
- 0x2183, 0x2184,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa640, 0xa66d,
- 0xa680, 0xa69d,
- 0xa722, 0xa787,
- 0xa78b, 0xa78e,
- 0xa790, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f8, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e900, 0x1e943,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
-}; /* CR_Cased */
-
-/* 'Case_Ignorable': Derived Property */
-static const OnigCodePoint CR_Case_Ignorable[] = {
- 381,
- 0x0027, 0x0027,
- 0x002e, 0x002e,
- 0x003a, 0x003a,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x00a8, 0x00a8,
- 0x00ad, 0x00ad,
- 0x00af, 0x00af,
- 0x00b4, 0x00b4,
- 0x00b7, 0x00b8,
- 0x02b0, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x0384, 0x0385,
- 0x0387, 0x0387,
- 0x0483, 0x0489,
- 0x0559, 0x0559,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05f4, 0x05f4,
- 0x0600, 0x0605,
- 0x0610, 0x061a,
- 0x061c, 0x061c,
- 0x0640, 0x0640,
- 0x064b, 0x065f,
- 0x0670, 0x0670,
- 0x06d6, 0x06dd,
- 0x06df, 0x06e8,
- 0x06ea, 0x06ed,
- 0x070f, 0x070f,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x07eb, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0816, 0x082d,
- 0x0859, 0x085b,
- 0x08d4, 0x0902,
- 0x093a, 0x093a,
- 0x093c, 0x093c,
- 0x0941, 0x0948,
- 0x094d, 0x094d,
- 0x0951, 0x0957,
- 0x0962, 0x0963,
- 0x0971, 0x0971,
- 0x0981, 0x0981,
- 0x09bc, 0x09bc,
- 0x09c1, 0x09c4,
- 0x09cd, 0x09cd,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a02,
- 0x0a3c, 0x0a3c,
- 0x0a41, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 0x0a81, 0x0a82,
- 0x0abc, 0x0abc,
- 0x0ac1, 0x0ac5,
- 0x0ac7, 0x0ac8,
- 0x0acd, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0afa, 0x0aff,
- 0x0b01, 0x0b01,
- 0x0b3c, 0x0b3c,
- 0x0b3f, 0x0b3f,
- 0x0b41, 0x0b44,
- 0x0b4d, 0x0b4d,
- 0x0b56, 0x0b56,
- 0x0b62, 0x0b63,
- 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,
- 0x0d00, 0x0d01,
- 0x0d3b, 0x0d3c,
- 0x0d41, 0x0d44,
- 0x0d4d, 0x0d4d,
- 0x0d62, 0x0d63,
- 0x0dca, 0x0dca,
- 0x0dd2, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e46, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f71, 0x0f7e,
- 0x0f80, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f8d, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x102d, 0x1030,
- 0x1032, 0x1037,
- 0x1039, 0x103a,
- 0x103d, 0x103e,
- 0x1058, 0x1059,
- 0x105e, 0x1060,
- 0x1071, 0x1074,
- 0x1082, 0x1082,
- 0x1085, 0x1086,
- 0x108d, 0x108d,
- 0x109d, 0x109d,
- 0x10fc, 0x10fc,
- 0x135d, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b4, 0x17b5,
- 0x17b7, 0x17bd,
- 0x17c6, 0x17c6,
- 0x17c9, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dd, 0x17dd,
- 0x180b, 0x180e,
- 0x1843, 0x1843,
- 0x1885, 0x1886,
- 0x18a9, 0x18a9,
- 0x1920, 0x1922,
- 0x1927, 0x1928,
- 0x1932, 0x1932,
- 0x1939, 0x193b,
- 0x1a17, 0x1a18,
- 0x1a1b, 0x1a1b,
- 0x1a56, 0x1a56,
- 0x1a58, 0x1a5e,
- 0x1a60, 0x1a60,
- 0x1a62, 0x1a62,
- 0x1a65, 0x1a6c,
- 0x1a73, 0x1a7c,
- 0x1a7f, 0x1a7f,
- 0x1aa7, 0x1aa7,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b03,
- 0x1b34, 0x1b34,
- 0x1b36, 0x1b3a,
- 0x1b3c, 0x1b3c,
- 0x1b42, 0x1b42,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1b81,
- 0x1ba2, 0x1ba5,
- 0x1ba8, 0x1ba9,
- 0x1bab, 0x1bad,
- 0x1be6, 0x1be6,
- 0x1be8, 0x1be9,
- 0x1bed, 0x1bed,
- 0x1bef, 0x1bf1,
- 0x1c2c, 0x1c33,
- 0x1c36, 0x1c37,
- 0x1c78, 0x1c7d,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1ce0,
- 0x1ce2, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf4, 0x1cf4,
- 0x1cf8, 0x1cf9,
- 0x1d2c, 0x1d6a,
- 0x1d78, 0x1d78,
- 0x1d9b, 0x1df9,
- 0x1dfb, 0x1dff,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x200b, 0x200f,
- 0x2018, 0x2019,
- 0x2024, 0x2024,
- 0x2027, 0x2027,
- 0x202a, 0x202e,
- 0x2060, 0x2064,
- 0x2066, 0x206f,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20f0,
- 0x2c7c, 0x2c7d,
- 0x2cef, 0x2cf1,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d7f,
- 0x2de0, 0x2dff,
- 0x2e2f, 0x2e2f,
- 0x3005, 0x3005,
- 0x302a, 0x302d,
- 0x3031, 0x3035,
- 0x303b, 0x303b,
- 0x3099, 0x309e,
- 0x30fc, 0x30fe,
- 0xa015, 0xa015,
- 0xa4f8, 0xa4fd,
- 0xa60c, 0xa60c,
- 0xa66f, 0xa672,
- 0xa674, 0xa67d,
- 0xa67f, 0xa67f,
- 0xa69c, 0xa69f,
- 0xa6f0, 0xa6f1,
- 0xa700, 0xa721,
- 0xa770, 0xa770,
- 0xa788, 0xa78a,
- 0xa7f8, 0xa7f9,
- 0xa802, 0xa802,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa825, 0xa826,
- 0xa8c4, 0xa8c5,
- 0xa8e0, 0xa8f1,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 0xa9b3, 0xa9b3,
- 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,
- 0xaabe, 0xaabf,
- 0xaac1, 0xaac1,
- 0xaadd, 0xaadd,
- 0xaaec, 0xaaed,
- 0xaaf3, 0xaaf4,
- 0xaaf6, 0xaaf6,
- 0xab5b, 0xab5f,
- 0xabe5, 0xabe5,
- 0xabe8, 0xabe8,
- 0xabed, 0xabed,
- 0xfb1e, 0xfb1e,
- 0xfbb2, 0xfbc1,
- 0xfe00, 0xfe0f,
- 0xfe13, 0xfe13,
- 0xfe20, 0xfe2f,
- 0xfe52, 0xfe52,
- 0xfe55, 0xfe55,
- 0xfeff, 0xfeff,
- 0xff07, 0xff07,
- 0xff0e, 0xff0e,
- 0xff1a, 0xff1a,
- 0xff3e, 0xff3e,
- 0xff40, 0xff40,
- 0xff70, 0xff70,
- 0xff9e, 0xff9f,
- 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,
- 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,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133c, 0x1133c,
- 0x11340, 0x11340,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 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,
- 0x11a01, 0x11a06,
- 0x11a09, 0x11a0a,
- 0x11a33, 0x11a38,
- 0x11a3b, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a51, 0x11a56,
- 0x11a59, 0x11a5b,
- 0x11a8a, 0x11a96,
- 0x11a98, 0x11a99,
- 0x11c30, 0x11c36,
- 0x11c38, 0x11c3d,
- 0x11c3f, 0x11c3f,
- 0x11c92, 0x11ca7,
- 0x11caa, 0x11cb0,
- 0x11cb2, 0x11cb3,
- 0x11cb5, 0x11cb6,
- 0x11d31, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d45,
- 0x11d47, 0x11d47,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16b40, 0x16b43,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0x1f3fb, 0x1f3ff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
-}; /* CR_Case_Ignorable */
-
-/* 'Changes_When_Lowercased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 590,
- 0x0041, 0x005a,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00de,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x014a, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c5,
- 0x01c7, 0x01c8,
- 0x01ca, 0x01cb,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f2,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03cf, 0x03cf,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f4, 0x03f4,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0528, 0x0528,
- 0x052a, 0x052a,
- 0x052c, 0x052c,
- 0x052e, 0x052e,
- 0x0531, 0x0556,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1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2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0x2cf2, 0x2cf2,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa698, 0xa698,
- 0xa69a, 0xa69a,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa792, 0xa792,
- 0xa796, 0xa796,
- 0xa798, 0xa798,
- 0xa79a, 0xa79a,
- 0xa79c, 0xa79c,
- 0xa79e, 0xa79e,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7ae,
- 0xa7b0, 0xa7b4,
- 0xa7b6, 0xa7b6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x1e900, 0x1e921,
-}; /* CR_Changes_When_Lowercased */
-
-/* 'Changes_When_Uppercased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 607,
- 0x0061, 0x007a,
- 0x00b5, 0x00b5,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0137,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018c,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019a,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01b9,
- 0x01bd, 0x01bd,
- 0x01bf, 0x01bf,
- 0x01c5, 0x01c6,
- 0x01c8, 0x01c9,
- 0x01cb, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f0,
- 0x01f2, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0233,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0254,
- 0x0256, 0x0257,
- 0x0259, 0x0259,
- 0x025b, 0x025c,
- 0x0260, 0x0261,
- 0x0263, 0x0263,
- 0x0265, 0x0266,
- 0x0268, 0x026c,
- 0x026f, 0x026f,
- 0x0271, 0x0272,
- 0x0275, 0x0275,
- 0x027d, 0x027d,
- 0x0280, 0x0280,
- 0x0283, 0x0283,
- 0x0287, 0x028c,
- 0x0292, 0x0292,
- 0x029d, 0x029e,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037b, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fb,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0529, 0x0529,
- 0x052b, 0x052b,
- 0x052d, 0x052d,
- 0x052f, 0x052f,
- 0x0561, 0x0587,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d79, 0x1d79,
- 0x1d7d, 0x1d7d,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e35, 0x1e35,
- 0x1e37, 0x1e37,
- 0x1e39, 0x1e39,
- 0x1e3b, 0x1e3b,
- 0x1e3d, 0x1e3d,
- 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41,
- 0x1e43, 0x1e43,
- 0x1e45, 0x1e45,
- 0x1e47, 0x1e47,
- 0x1e49, 0x1e49,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
- 0x1e5d, 0x1e5d,
- 0x1e5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663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa699, 0xa699,
- 0xa69b, 0xa69b,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa72f,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa76f,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 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,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x1e922, 0x1e943,
-}; /* CR_Changes_When_Uppercased */
-
-/* 'Changes_When_Titlecased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 608,
- 0x0061, 0x007a,
- 0x00b5, 0x00b5,
- 0x00df, 0x00f6,
- 0x00f8, 0x00ff,
- 0x0101, 0x0101,
- 0x0103, 0x0103,
- 0x0105, 0x0105,
- 0x0107, 0x0107,
- 0x0109, 0x0109,
- 0x010b, 0x010b,
- 0x010d, 0x010d,
- 0x010f, 0x010f,
- 0x0111, 0x0111,
- 0x0113, 0x0113,
- 0x0115, 0x0115,
- 0x0117, 0x0117,
- 0x0119, 0x0119,
- 0x011b, 0x011b,
- 0x011d, 0x011d,
- 0x011f, 0x011f,
- 0x0121, 0x0121,
- 0x0123, 0x0123,
- 0x0125, 0x0125,
- 0x0127, 0x0127,
- 0x0129, 0x0129,
- 0x012b, 0x012b,
- 0x012d, 0x012d,
- 0x012f, 0x012f,
- 0x0131, 0x0131,
- 0x0133, 0x0133,
- 0x0135, 0x0135,
- 0x0137, 0x0137,
- 0x013a, 0x013a,
- 0x013c, 0x013c,
- 0x013e, 0x013e,
- 0x0140, 0x0140,
- 0x0142, 0x0142,
- 0x0144, 0x0144,
- 0x0146, 0x0146,
- 0x0148, 0x0149,
- 0x014b, 0x014b,
- 0x014d, 0x014d,
- 0x014f, 0x014f,
- 0x0151, 0x0151,
- 0x0153, 0x0153,
- 0x0155, 0x0155,
- 0x0157, 0x0157,
- 0x0159, 0x0159,
- 0x015b, 0x015b,
- 0x015d, 0x015d,
- 0x015f, 0x015f,
- 0x0161, 0x0161,
- 0x0163, 0x0163,
- 0x0165, 0x0165,
- 0x0167, 0x0167,
- 0x0169, 0x0169,
- 0x016b, 0x016b,
- 0x016d, 0x016d,
- 0x016f, 0x016f,
- 0x0171, 0x0171,
- 0x0173, 0x0173,
- 0x0175, 0x0175,
- 0x0177, 0x0177,
- 0x017a, 0x017a,
- 0x017c, 0x017c,
- 0x017e, 0x0180,
- 0x0183, 0x0183,
- 0x0185, 0x0185,
- 0x0188, 0x0188,
- 0x018c, 0x018c,
- 0x0192, 0x0192,
- 0x0195, 0x0195,
- 0x0199, 0x019a,
- 0x019e, 0x019e,
- 0x01a1, 0x01a1,
- 0x01a3, 0x01a3,
- 0x01a5, 0x01a5,
- 0x01a8, 0x01a8,
- 0x01ad, 0x01ad,
- 0x01b0, 0x01b0,
- 0x01b4, 0x01b4,
- 0x01b6, 0x01b6,
- 0x01b9, 0x01b9,
- 0x01bd, 0x01bd,
- 0x01bf, 0x01bf,
- 0x01c4, 0x01c4,
- 0x01c6, 0x01c7,
- 0x01c9, 0x01ca,
- 0x01cc, 0x01cc,
- 0x01ce, 0x01ce,
- 0x01d0, 0x01d0,
- 0x01d2, 0x01d2,
- 0x01d4, 0x01d4,
- 0x01d6, 0x01d6,
- 0x01d8, 0x01d8,
- 0x01da, 0x01da,
- 0x01dc, 0x01dd,
- 0x01df, 0x01df,
- 0x01e1, 0x01e1,
- 0x01e3, 0x01e3,
- 0x01e5, 0x01e5,
- 0x01e7, 0x01e7,
- 0x01e9, 0x01e9,
- 0x01eb, 0x01eb,
- 0x01ed, 0x01ed,
- 0x01ef, 0x01f1,
- 0x01f3, 0x01f3,
- 0x01f5, 0x01f5,
- 0x01f9, 0x01f9,
- 0x01fb, 0x01fb,
- 0x01fd, 0x01fd,
- 0x01ff, 0x01ff,
- 0x0201, 0x0201,
- 0x0203, 0x0203,
- 0x0205, 0x0205,
- 0x0207, 0x0207,
- 0x0209, 0x0209,
- 0x020b, 0x020b,
- 0x020d, 0x020d,
- 0x020f, 0x020f,
- 0x0211, 0x0211,
- 0x0213, 0x0213,
- 0x0215, 0x0215,
- 0x0217, 0x0217,
- 0x0219, 0x0219,
- 0x021b, 0x021b,
- 0x021d, 0x021d,
- 0x021f, 0x021f,
- 0x0223, 0x0223,
- 0x0225, 0x0225,
- 0x0227, 0x0227,
- 0x0229, 0x0229,
- 0x022b, 0x022b,
- 0x022d, 0x022d,
- 0x022f, 0x022f,
- 0x0231, 0x0231,
- 0x0233, 0x0233,
- 0x023c, 0x023c,
- 0x023f, 0x0240,
- 0x0242, 0x0242,
- 0x0247, 0x0247,
- 0x0249, 0x0249,
- 0x024b, 0x024b,
- 0x024d, 0x024d,
- 0x024f, 0x0254,
- 0x0256, 0x0257,
- 0x0259, 0x0259,
- 0x025b, 0x025c,
- 0x0260, 0x0261,
- 0x0263, 0x0263,
- 0x0265, 0x0266,
- 0x0268, 0x026c,
- 0x026f, 0x026f,
- 0x0271, 0x0272,
- 0x0275, 0x0275,
- 0x027d, 0x027d,
- 0x0280, 0x0280,
- 0x0283, 0x0283,
- 0x0287, 0x028c,
- 0x0292, 0x0292,
- 0x029d, 0x029e,
- 0x0345, 0x0345,
- 0x0371, 0x0371,
- 0x0373, 0x0373,
- 0x0377, 0x0377,
- 0x037b, 0x037d,
- 0x0390, 0x0390,
- 0x03ac, 0x03ce,
- 0x03d0, 0x03d1,
- 0x03d5, 0x03d7,
- 0x03d9, 0x03d9,
- 0x03db, 0x03db,
- 0x03dd, 0x03dd,
- 0x03df, 0x03df,
- 0x03e1, 0x03e1,
- 0x03e3, 0x03e3,
- 0x03e5, 0x03e5,
- 0x03e7, 0x03e7,
- 0x03e9, 0x03e9,
- 0x03eb, 0x03eb,
- 0x03ed, 0x03ed,
- 0x03ef, 0x03f3,
- 0x03f5, 0x03f5,
- 0x03f8, 0x03f8,
- 0x03fb, 0x03fb,
- 0x0430, 0x045f,
- 0x0461, 0x0461,
- 0x0463, 0x0463,
- 0x0465, 0x0465,
- 0x0467, 0x0467,
- 0x0469, 0x0469,
- 0x046b, 0x046b,
- 0x046d, 0x046d,
- 0x046f, 0x046f,
- 0x0471, 0x0471,
- 0x0473, 0x0473,
- 0x0475, 0x0475,
- 0x0477, 0x0477,
- 0x0479, 0x0479,
- 0x047b, 0x047b,
- 0x047d, 0x047d,
- 0x047f, 0x047f,
- 0x0481, 0x0481,
- 0x048b, 0x048b,
- 0x048d, 0x048d,
- 0x048f, 0x048f,
- 0x0491, 0x0491,
- 0x0493, 0x0493,
- 0x0495, 0x0495,
- 0x0497, 0x0497,
- 0x0499, 0x0499,
- 0x049b, 0x049b,
- 0x049d, 0x049d,
- 0x049f, 0x049f,
- 0x04a1, 0x04a1,
- 0x04a3, 0x04a3,
- 0x04a5, 0x04a5,
- 0x04a7, 0x04a7,
- 0x04a9, 0x04a9,
- 0x04ab, 0x04ab,
- 0x04ad, 0x04ad,
- 0x04af, 0x04af,
- 0x04b1, 0x04b1,
- 0x04b3, 0x04b3,
- 0x04b5, 0x04b5,
- 0x04b7, 0x04b7,
- 0x04b9, 0x04b9,
- 0x04bb, 0x04bb,
- 0x04bd, 0x04bd,
- 0x04bf, 0x04bf,
- 0x04c2, 0x04c2,
- 0x04c4, 0x04c4,
- 0x04c6, 0x04c6,
- 0x04c8, 0x04c8,
- 0x04ca, 0x04ca,
- 0x04cc, 0x04cc,
- 0x04ce, 0x04cf,
- 0x04d1, 0x04d1,
- 0x04d3, 0x04d3,
- 0x04d5, 0x04d5,
- 0x04d7, 0x04d7,
- 0x04d9, 0x04d9,
- 0x04db, 0x04db,
- 0x04dd, 0x04dd,
- 0x04df, 0x04df,
- 0x04e1, 0x04e1,
- 0x04e3, 0x04e3,
- 0x04e5, 0x04e5,
- 0x04e7, 0x04e7,
- 0x04e9, 0x04e9,
- 0x04eb, 0x04eb,
- 0x04ed, 0x04ed,
- 0x04ef, 0x04ef,
- 0x04f1, 0x04f1,
- 0x04f3, 0x04f3,
- 0x04f5, 0x04f5,
- 0x04f7, 0x04f7,
- 0x04f9, 0x04f9,
- 0x04fb, 0x04fb,
- 0x04fd, 0x04fd,
- 0x04ff, 0x04ff,
- 0x0501, 0x0501,
- 0x0503, 0x0503,
- 0x0505, 0x0505,
- 0x0507, 0x0507,
- 0x0509, 0x0509,
- 0x050b, 0x050b,
- 0x050d, 0x050d,
- 0x050f, 0x050f,
- 0x0511, 0x0511,
- 0x0513, 0x0513,
- 0x0515, 0x0515,
- 0x0517, 0x0517,
- 0x0519, 0x0519,
- 0x051b, 0x051b,
- 0x051d, 0x051d,
- 0x051f, 0x051f,
- 0x0521, 0x0521,
- 0x0523, 0x0523,
- 0x0525, 0x0525,
- 0x0527, 0x0527,
- 0x0529, 0x0529,
- 0x052b, 0x052b,
- 0x052d, 0x052d,
- 0x052f, 0x052f,
- 0x0561, 0x0587,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d79, 0x1d79,
- 0x1d7d, 0x1d7d,
- 0x1e01, 0x1e01,
- 0x1e03, 0x1e03,
- 0x1e05, 0x1e05,
- 0x1e07, 0x1e07,
- 0x1e09, 0x1e09,
- 0x1e0b, 0x1e0b,
- 0x1e0d, 0x1e0d,
- 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11,
- 0x1e13, 0x1e13,
- 0x1e15, 0x1e15,
- 0x1e17, 0x1e17,
- 0x1e19, 0x1e19,
- 0x1e1b, 0x1e1b,
- 0x1e1d, 0x1e1d,
- 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21,
- 0x1e23, 0x1e23,
- 0x1e25, 0x1e25,
- 0x1e27, 0x1e27,
- 0x1e29, 0x1e29,
- 0x1e2b, 0x1e2b,
- 0x1e2d, 0x1e2d,
- 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31,
- 0x1e33, 0x1e33,
- 0x1e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cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2cf3, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 0xa699, 0xa699,
- 0xa69b, 0xa69b,
- 0xa723, 0xa723,
- 0xa725, 0xa725,
- 0xa727, 0xa727,
- 0xa729, 0xa729,
- 0xa72b, 0xa72b,
- 0xa72d, 0xa72d,
- 0xa72f, 0xa72f,
- 0xa733, 0xa733,
- 0xa735, 0xa735,
- 0xa737, 0xa737,
- 0xa739, 0xa739,
- 0xa73b, 0xa73b,
- 0xa73d, 0xa73d,
- 0xa73f, 0xa73f,
- 0xa741, 0xa741,
- 0xa743, 0xa743,
- 0xa745, 0xa745,
- 0xa747, 0xa747,
- 0xa749, 0xa749,
- 0xa74b, 0xa74b,
- 0xa74d, 0xa74d,
- 0xa74f, 0xa74f,
- 0xa751, 0xa751,
- 0xa753, 0xa753,
- 0xa755, 0xa755,
- 0xa757, 0xa757,
- 0xa759, 0xa759,
- 0xa75b, 0xa75b,
- 0xa75d, 0xa75d,
- 0xa75f, 0xa75f,
- 0xa761, 0xa761,
- 0xa763, 0xa763,
- 0xa765, 0xa765,
- 0xa767, 0xa767,
- 0xa769, 0xa769,
- 0xa76b, 0xa76b,
- 0xa76d, 0xa76d,
- 0xa76f, 0xa76f,
- 0xa77a, 0xa77a,
- 0xa77c, 0xa77c,
- 0xa77f, 0xa77f,
- 0xa781, 0xa781,
- 0xa783, 0xa783,
- 0xa785, 0xa785,
- 0xa787, 0xa787,
- 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,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x1e922, 0x1e943,
-}; /* CR_Changes_When_Titlecased */
-
-/* 'Changes_When_Casefolded': Derived Property */
-static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 603,
- 0x0041, 0x005a,
- 0x00b5, 0x00b5,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00df,
- 0x0100, 0x0100,
- 0x0102, 0x0102,
- 0x0104, 0x0104,
- 0x0106, 0x0106,
- 0x0108, 0x0108,
- 0x010a, 0x010a,
- 0x010c, 0x010c,
- 0x010e, 0x010e,
- 0x0110, 0x0110,
- 0x0112, 0x0112,
- 0x0114, 0x0114,
- 0x0116, 0x0116,
- 0x0118, 0x0118,
- 0x011a, 0x011a,
- 0x011c, 0x011c,
- 0x011e, 0x011e,
- 0x0120, 0x0120,
- 0x0122, 0x0122,
- 0x0124, 0x0124,
- 0x0126, 0x0126,
- 0x0128, 0x0128,
- 0x012a, 0x012a,
- 0x012c, 0x012c,
- 0x012e, 0x012e,
- 0x0130, 0x0130,
- 0x0132, 0x0132,
- 0x0134, 0x0134,
- 0x0136, 0x0136,
- 0x0139, 0x0139,
- 0x013b, 0x013b,
- 0x013d, 0x013d,
- 0x013f, 0x013f,
- 0x0141, 0x0141,
- 0x0143, 0x0143,
- 0x0145, 0x0145,
- 0x0147, 0x0147,
- 0x0149, 0x014a,
- 0x014c, 0x014c,
- 0x014e, 0x014e,
- 0x0150, 0x0150,
- 0x0152, 0x0152,
- 0x0154, 0x0154,
- 0x0156, 0x0156,
- 0x0158, 0x0158,
- 0x015a, 0x015a,
- 0x015c, 0x015c,
- 0x015e, 0x015e,
- 0x0160, 0x0160,
- 0x0162, 0x0162,
- 0x0164, 0x0164,
- 0x0166, 0x0166,
- 0x0168, 0x0168,
- 0x016a, 0x016a,
- 0x016c, 0x016c,
- 0x016e, 0x016e,
- 0x0170, 0x0170,
- 0x0172, 0x0172,
- 0x0174, 0x0174,
- 0x0176, 0x0176,
- 0x0178, 0x0179,
- 0x017b, 0x017b,
- 0x017d, 0x017d,
- 0x017f, 0x017f,
- 0x0181, 0x0182,
- 0x0184, 0x0184,
- 0x0186, 0x0187,
- 0x0189, 0x018b,
- 0x018e, 0x0191,
- 0x0193, 0x0194,
- 0x0196, 0x0198,
- 0x019c, 0x019d,
- 0x019f, 0x01a0,
- 0x01a2, 0x01a2,
- 0x01a4, 0x01a4,
- 0x01a6, 0x01a7,
- 0x01a9, 0x01a9,
- 0x01ac, 0x01ac,
- 0x01ae, 0x01af,
- 0x01b1, 0x01b3,
- 0x01b5, 0x01b5,
- 0x01b7, 0x01b8,
- 0x01bc, 0x01bc,
- 0x01c4, 0x01c5,
- 0x01c7, 0x01c8,
- 0x01ca, 0x01cb,
- 0x01cd, 0x01cd,
- 0x01cf, 0x01cf,
- 0x01d1, 0x01d1,
- 0x01d3, 0x01d3,
- 0x01d5, 0x01d5,
- 0x01d7, 0x01d7,
- 0x01d9, 0x01d9,
- 0x01db, 0x01db,
- 0x01de, 0x01de,
- 0x01e0, 0x01e0,
- 0x01e2, 0x01e2,
- 0x01e4, 0x01e4,
- 0x01e6, 0x01e6,
- 0x01e8, 0x01e8,
- 0x01ea, 0x01ea,
- 0x01ec, 0x01ec,
- 0x01ee, 0x01ee,
- 0x01f1, 0x01f2,
- 0x01f4, 0x01f4,
- 0x01f6, 0x01f8,
- 0x01fa, 0x01fa,
- 0x01fc, 0x01fc,
- 0x01fe, 0x01fe,
- 0x0200, 0x0200,
- 0x0202, 0x0202,
- 0x0204, 0x0204,
- 0x0206, 0x0206,
- 0x0208, 0x0208,
- 0x020a, 0x020a,
- 0x020c, 0x020c,
- 0x020e, 0x020e,
- 0x0210, 0x0210,
- 0x0212, 0x0212,
- 0x0214, 0x0214,
- 0x0216, 0x0216,
- 0x0218, 0x0218,
- 0x021a, 0x021a,
- 0x021c, 0x021c,
- 0x021e, 0x021e,
- 0x0220, 0x0220,
- 0x0222, 0x0222,
- 0x0224, 0x0224,
- 0x0226, 0x0226,
- 0x0228, 0x0228,
- 0x022a, 0x022a,
- 0x022c, 0x022c,
- 0x022e, 0x022e,
- 0x0230, 0x0230,
- 0x0232, 0x0232,
- 0x023a, 0x023b,
- 0x023d, 0x023e,
- 0x0241, 0x0241,
- 0x0243, 0x0246,
- 0x0248, 0x0248,
- 0x024a, 0x024a,
- 0x024c, 0x024c,
- 0x024e, 0x024e,
- 0x0345, 0x0345,
- 0x0370, 0x0370,
- 0x0372, 0x0372,
- 0x0376, 0x0376,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x038f,
- 0x0391, 0x03a1,
- 0x03a3, 0x03ab,
- 0x03c2, 0x03c2,
- 0x03cf, 0x03d1,
- 0x03d5, 0x03d6,
- 0x03d8, 0x03d8,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03e2,
- 0x03e4, 0x03e4,
- 0x03e6, 0x03e6,
- 0x03e8, 0x03e8,
- 0x03ea, 0x03ea,
- 0x03ec, 0x03ec,
- 0x03ee, 0x03ee,
- 0x03f0, 0x03f1,
- 0x03f4, 0x03f5,
- 0x03f7, 0x03f7,
- 0x03f9, 0x03fa,
- 0x03fd, 0x042f,
- 0x0460, 0x0460,
- 0x0462, 0x0462,
- 0x0464, 0x0464,
- 0x0466, 0x0466,
- 0x0468, 0x0468,
- 0x046a, 0x046a,
- 0x046c, 0x046c,
- 0x046e, 0x046e,
- 0x0470, 0x0470,
- 0x0472, 0x0472,
- 0x0474, 0x0474,
- 0x0476, 0x0476,
- 0x0478, 0x0478,
- 0x047a, 0x047a,
- 0x047c, 0x047c,
- 0x047e, 0x047e,
- 0x0480, 0x0480,
- 0x048a, 0x048a,
- 0x048c, 0x048c,
- 0x048e, 0x048e,
- 0x0490, 0x0490,
- 0x0492, 0x0492,
- 0x0494, 0x0494,
- 0x0496, 0x0496,
- 0x0498, 0x0498,
- 0x049a, 0x049a,
- 0x049c, 0x049c,
- 0x049e, 0x049e,
- 0x04a0, 0x04a0,
- 0x04a2, 0x04a2,
- 0x04a4, 0x04a4,
- 0x04a6, 0x04a6,
- 0x04a8, 0x04a8,
- 0x04aa, 0x04aa,
- 0x04ac, 0x04ac,
- 0x04ae, 0x04ae,
- 0x04b0, 0x04b0,
- 0x04b2, 0x04b2,
- 0x04b4, 0x04b4,
- 0x04b6, 0x04b6,
- 0x04b8, 0x04b8,
- 0x04ba, 0x04ba,
- 0x04bc, 0x04bc,
- 0x04be, 0x04be,
- 0x04c0, 0x04c1,
- 0x04c3, 0x04c3,
- 0x04c5, 0x04c5,
- 0x04c7, 0x04c7,
- 0x04c9, 0x04c9,
- 0x04cb, 0x04cb,
- 0x04cd, 0x04cd,
- 0x04d0, 0x04d0,
- 0x04d2, 0x04d2,
- 0x04d4, 0x04d4,
- 0x04d6, 0x04d6,
- 0x04d8, 0x04d8,
- 0x04da, 0x04da,
- 0x04dc, 0x04dc,
- 0x04de, 0x04de,
- 0x04e0, 0x04e0,
- 0x04e2, 0x04e2,
- 0x04e4, 0x04e4,
- 0x04e6, 0x04e6,
- 0x04e8, 0x04e8,
- 0x04ea, 0x04ea,
- 0x04ec, 0x04ec,
- 0x04ee, 0x04ee,
- 0x04f0, 0x04f0,
- 0x04f2, 0x04f2,
- 0x04f4, 0x04f4,
- 0x04f6, 0x04f6,
- 0x04f8, 0x04f8,
- 0x04fa, 0x04fa,
- 0x04fc, 0x04fc,
- 0x04fe, 0x04fe,
- 0x0500, 0x0500,
- 0x0502, 0x0502,
- 0x0504, 0x0504,
- 0x0506, 0x0506,
- 0x0508, 0x0508,
- 0x050a, 0x050a,
- 0x050c, 0x050c,
- 0x050e, 0x050e,
- 0x0510, 0x0510,
- 0x0512, 0x0512,
- 0x0514, 0x0514,
- 0x0516, 0x0516,
- 0x0518, 0x0518,
- 0x051a, 0x051a,
- 0x051c, 0x051c,
- 0x051e, 0x051e,
- 0x0520, 0x0520,
- 0x0522, 0x0522,
- 0x0524, 0x0524,
- 0x0526, 0x0526,
- 0x0528, 0x0528,
- 0x052a, 0x052a,
- 0x052c, 0x052c,
- 0x052e, 0x052e,
- 0x0531, 0x0556,
- 0x0587, 0x0587,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1e00, 0x1e00,
- 0x1e02, 0x1e02,
- 0x1e04, 0x1e04,
- 0x1e06, 0x1e06,
- 0x1e08, 0x1e08,
- 0x1e0a, 0x1e0a,
- 0x1e0c, 0x1e0c,
- 0x1e0e, 0x1e0e,
- 0x1e10, 0x1e10,
- 0x1e12, 0x1e12,
- 0x1e14, 0x1e14,
- 0x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- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0x2cf2, 0x2cf2,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 0xa698, 0xa698,
- 0xa69a, 0xa69a,
- 0xa722, 0xa722,
- 0xa724, 0xa724,
- 0xa726, 0xa726,
- 0xa728, 0xa728,
- 0xa72a, 0xa72a,
- 0xa72c, 0xa72c,
- 0xa72e, 0xa72e,
- 0xa732, 0xa732,
- 0xa734, 0xa734,
- 0xa736, 0xa736,
- 0xa738, 0xa738,
- 0xa73a, 0xa73a,
- 0xa73c, 0xa73c,
- 0xa73e, 0xa73e,
- 0xa740, 0xa740,
- 0xa742, 0xa742,
- 0xa744, 0xa744,
- 0xa746, 0xa746,
- 0xa748, 0xa748,
- 0xa74a, 0xa74a,
- 0xa74c, 0xa74c,
- 0xa74e, 0xa74e,
- 0xa750, 0xa750,
- 0xa752, 0xa752,
- 0xa754, 0xa754,
- 0xa756, 0xa756,
- 0xa758, 0xa758,
- 0xa75a, 0xa75a,
- 0xa75c, 0xa75c,
- 0xa75e, 0xa75e,
- 0xa760, 0xa760,
- 0xa762, 0xa762,
- 0xa764, 0xa764,
- 0xa766, 0xa766,
- 0xa768, 0xa768,
- 0xa76a, 0xa76a,
- 0xa76c, 0xa76c,
- 0xa76e, 0xa76e,
- 0xa779, 0xa779,
- 0xa77b, 0xa77b,
- 0xa77d, 0xa77e,
- 0xa780, 0xa780,
- 0xa782, 0xa782,
- 0xa784, 0xa784,
- 0xa786, 0xa786,
- 0xa78b, 0xa78b,
- 0xa78d, 0xa78d,
- 0xa790, 0xa790,
- 0xa792, 0xa792,
- 0xa796, 0xa796,
- 0xa798, 0xa798,
- 0xa79a, 0xa79a,
- 0xa79c, 0xa79c,
- 0xa79e, 0xa79e,
- 0xa7a0, 0xa7a0,
- 0xa7a2, 0xa7a2,
- 0xa7a4, 0xa7a4,
- 0xa7a6, 0xa7a6,
- 0xa7a8, 0xa7a8,
- 0xa7aa, 0xa7ae,
- 0xa7b0, 0xa7b4,
- 0xa7b6, 0xa7b6,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x1e900, 0x1e921,
-}; /* CR_Changes_When_Casefolded */
-
-/* 'Changes_When_Casemapped': Derived Property */
-static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 116,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00b5, 0x00b5,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x0137,
- 0x0139, 0x018c,
- 0x018e, 0x019a,
- 0x019c, 0x01a9,
- 0x01ac, 0x01b9,
- 0x01bc, 0x01bd,
- 0x01bf, 0x01bf,
- 0x01c4, 0x0220,
- 0x0222, 0x0233,
- 0x023a, 0x0254,
- 0x0256, 0x0257,
- 0x0259, 0x0259,
- 0x025b, 0x025c,
- 0x0260, 0x0261,
- 0x0263, 0x0263,
- 0x0265, 0x0266,
- 0x0268, 0x026c,
- 0x026f, 0x026f,
- 0x0271, 0x0272,
- 0x0275, 0x0275,
- 0x027d, 0x027d,
- 0x0280, 0x0280,
- 0x0283, 0x0283,
- 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, 0x03f5,
- 0x03f7, 0x03fb,
- 0x03fd, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0561, 0x0587,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1d79, 0x1d79,
- 0x1d7d, 0x1d7d,
- 0x1e00, 0x1e9b,
- 0x1e9e, 0x1e9e,
- 0x1ea0, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2126, 0x2126,
- 0x212a, 0x212b,
- 0x2132, 0x2132,
- 0x214e, 0x214e,
- 0x2160, 0x217f,
- 0x2183, 0x2184,
- 0x24b6, 0x24e9,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2c70,
- 0x2c72, 0x2c73,
- 0x2c75, 0x2c76,
- 0x2c7e, 0x2ce3,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa640, 0xa66d,
- 0xa680, 0xa69b,
- 0xa722, 0xa72f,
- 0xa732, 0xa76f,
- 0xa779, 0xa787,
- 0xa78b, 0xa78d,
- 0xa790, 0xa793,
- 0xa796, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xab53, 0xab53,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x1e900, 0x1e943,
-}; /* CR_Changes_When_Casemapped */
-
-/* 'ID_Start': Derived Property */
-static const OnigCodePoint CR_ID_Start[] = {
- 585,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0620, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06e5, 0x06e6,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x07a5,
- 0x07b1, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0815,
- 0x081a, 0x081a,
- 0x0824, 0x0824,
- 0x0828, 0x0828,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x0971, 0x0980,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09bd,
- 0x09ce, 0x09ce,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e1,
- 0x09f0, 0x09f1,
- 0x09fc, 0x09fc,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a72, 0x0a74,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d,
- 0x0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e46,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f88, 0x0f8c,
- 0x1000, 0x102a,
- 0x103f, 0x103f,
- 0x1050, 0x1055,
- 0x105a, 0x105d,
- 0x1061, 0x1061,
- 0x1065, 0x1066,
- 0x106e, 0x1070,
- 0x1075, 0x1081,
- 0x108e, 0x108e,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18a8,
- 0x18aa, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a16,
- 0x1a20, 0x1a54,
- 0x1aa7, 0x1aa7,
- 0x1b05, 0x1b33,
- 0x1b45, 0x1b4b,
- 0x1b83, 0x1ba0,
- 0x1bae, 0x1baf,
- 0x1bba, 0x1be5,
- 0x1c00, 0x1c23,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf1,
- 0x1cf5, 0x1cf6,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2118, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309b, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 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,
- 0xaa7e, 0xaaaf,
- 0xaab1, 0xaab1,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaabd,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaea,
- 0xaaf2, 0xaaf4,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabe2,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb1d,
- 0xfb1f, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x10375,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 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,
- 0x11400, 0x11434,
- 0x11447, 0x1144a,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x11700, 0x11719,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a83,
- 0x11a86, 0x11a89,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_ID_Start */
-
-/* 'ID_Continue': Derived Property */
-static const OnigCodePoint CR_ID_Continue[] = {
- 689,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00b7, 0x00b7,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0487,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa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
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f18, 0x0f19,
- 0x0f20, 0x0f29,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x1000, 0x1049,
- 0x1050, 0x109d,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1369, 0x1371,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1ab0, 0x1abd,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2118, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66f,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 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, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2f,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102e0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 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,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111ca, 0x111cc,
- 0x111d0, 0x111da,
- 0x111dc, 0x111dc,
- 0x11200, 0x11211,
- 0x11213, 0x11237,
- 0x1123e, 0x1123e,
- 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,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a99,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c40,
- 0x11c50, 0x11c59,
- 0x11c72, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9d, 0x1bc9e,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1da00, 0x1da36,
- 0x1da3b, 0x1da6c,
- 0x1da75, 0x1da75,
- 0x1da84, 0x1da84,
- 0x1da9b, 0x1da9f,
- 0x1daa1, 0x1daaf,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef,
-}; /* CR_ID_Continue */
-
-/* 'XID_Start': Derived Property */
-static const OnigCodePoint CR_XID_Start[] = {
- 592,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0370, 0x0374,
- 0x0376, 0x0377,
- 0x037b, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0620, 0x064a,
- 0x066e, 0x066f,
- 0x0671, 0x06d3,
- 0x06d5, 0x06d5,
- 0x06e5, 0x06e6,
- 0x06ee, 0x06ef,
- 0x06fa, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x07a5,
- 0x07b1, 0x07b1,
- 0x07ca, 0x07ea,
- 0x07f4, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x0815,
- 0x081a, 0x081a,
- 0x0824, 0x0824,
- 0x0828, 0x0828,
- 0x0840, 0x0858,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x0904, 0x0939,
- 0x093d, 0x093d,
- 0x0950, 0x0950,
- 0x0958, 0x0961,
- 0x0971, 0x0980,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 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bd, 0x0cbd,
- 0x0cde, 0x0cde,
- 0x0ce0, 0x0ce1,
- 0x0cf1, 0x0cf2,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d3d,
- 0x0d4e, 0x0d4e,
- 0x0d54, 0x0d56,
- 0x0d5f, 0x0d61,
- 0x0d7a, 0x0d7f,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e32,
- 0x0e40, 0x0e46,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb2,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f00,
- 0x0f40, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f88, 0x0f8c,
- 0x1000, 0x102a,
- 0x103f, 0x103f,
- 0x1050, 0x1055,
- 0x105a, 0x105d,
- 0x1061, 0x1061,
- 0x1065, 0x1066,
- 0x106e, 0x1070,
- 0x1075, 0x1081,
- 0x108e, 0x108e,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dc,
- 0x1820, 0x1877,
- 0x1880, 0x18a8,
- 0x18aa, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x1a00, 0x1a16,
- 0x1a20, 0x1a54,
- 0x1aa7, 0x1aa7,
- 0x1b05, 0x1b33,
- 0x1b45, 0x1b4b,
- 0x1b83, 0x1ba0,
- 0x1bae, 0x1baf,
- 0x1bba, 0x1be5,
- 0x1c00, 0x1c23,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf1,
- 0x1cf5, 0x1cf6,
- 0x1d00, 0x1dbf,
- 0x1e00, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2118, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x3005, 0x3007,
- 0x3021, 0x3029,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 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,
- 0xaa7e, 0xaaaf,
- 0xaab1, 0xaab1,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaabd,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaea,
- 0xaaf2, 0xaaf4,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabe2,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb1d,
- 0xfb1f, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfc5d,
- 0xfc64, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdf9,
- 0xfe71, 0xfe71,
- 0xfe73, 0xfe73,
- 0xfe77, 0xfe77,
- 0xfe79, 0xfe79,
- 0xfe7b, 0xfe7b,
- 0xfe7d, 0xfe7d,
- 0xfe7f, 0xfefc,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0xff66, 0xff9d,
- 0xffa0, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x10375,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a00,
- 0x10a10, 0x10a13,
- 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,
- 0x11400, 0x11434,
- 0x11447, 0x1144a,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x11700, 0x11719,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a83,
- 0x11a86, 0x11a89,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_XID_Start */
-
-/* 'XID_Continue': Derived Property */
-static const OnigCodePoint CR_XID_Continue[] = {
- 696,
- 0x0030, 0x0039,
- 0x0041, 0x005a,
- 0x005f, 0x005f,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00b5, 0x00b5,
- 0x00b7, 0x00b7,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02c1,
- 0x02c6, 0x02d1,
- 0x02e0, 0x02e4,
- 0x02ec, 0x02ec,
- 0x02ee, 0x02ee,
- 0x0300, 0x0374,
- 0x0376, 0x0377,
- 0x037b, 0x037d,
- 0x037f, 0x037f,
- 0x0386, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03f5,
- 0x03f7, 0x0481,
- 0x0483, 0x0487,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x0559,
- 0x0561, 0x0587,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09f1,
- 0x09fc, 0x09fc,
- 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, 0x0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 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x135f,
- 0x1369, 0x1371,
- 0x1380, 0x138f,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1401, 0x166c,
- 0x166f, 0x167f,
- 0x1681, 0x169a,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1734,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17d3,
- 0x17d7, 0x17d7,
- 0x17dc, 0x17dd,
- 0x17e0, 0x17e9,
- 0x180b, 0x180d,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1946, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x1a00, 0x1a1b,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa7, 0x1aa7,
- 0x1ab0, 0x1abd,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b59,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1bf3,
- 0x1c00, 0x1c37,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fbc,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fcc,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fe0, 0x1fec,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffc,
- 0x203f, 0x2040,
- 0x2054, 0x2054,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20f0,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2118, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x2139,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2ce4,
- 0x2ceb, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d6f,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2dff,
- 0x3005, 0x3007,
- 0x3021, 0x302f,
- 0x3031, 0x3035,
- 0x3038, 0x303c,
- 0x3041, 0x3096,
- 0x3099, 0x309a,
- 0x309d, 0x309f,
- 0x30a1, 0x30fa,
- 0x30fc, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66f,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 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, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab65,
- 0xab70, 0xabea,
- 0xabec, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb28,
- 0xfb2a, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfc5d,
- 0xfc64, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdf9,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2f,
- 0xfe33, 0xfe34,
- 0xfe4d, 0xfe4f,
- 0xfe71, 0xfe71,
- 0xfe73, 0xfe73,
- 0xfe77, 0xfe77,
- 0xfe79, 0xfe79,
- 0xfe7b, 0xfe7b,
- 0xfe7d, 0xfe7d,
- 0xfe7f, 0xfefc,
- 0xff10, 0xff19,
- 0xff21, 0xff3a,
- 0xff3f, 0xff3f,
- 0xff41, 0xff5a,
- 0xff66, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10140, 0x10174,
- 0x101fd, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102e0,
- 0x10300, 0x1031f,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103cf,
- 0x103d1, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 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,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111ca, 0x111cc,
- 0x111d0, 0x111da,
- 0x111dc, 0x111dc,
- 0x11200, 0x11211,
- 0x11213, 0x11237,
- 0x1123e, 0x1123e,
- 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,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a99,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c40,
- 0x11c50, 0x11c59,
- 0x11c72, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9d, 0x1bc9e,
- 0x1d165, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1da00, 0x1da36,
- 0x1da3b, 0x1da6c,
- 0x1da75, 0x1da75,
- 0x1da84, 0x1da84,
- 0x1da9b, 0x1da9f,
- 0x1daa1, 0x1daaf,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
- 0xe0100, 0xe01ef,
-}; /* CR_XID_Continue */
-
-/* 'Default_Ignorable_Code_Point': Derived Property */
-static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
- 17,
- 0x00ad, 0x00ad,
- 0x034f, 0x034f,
- 0x061c, 0x061c,
- 0x115f, 0x1160,
- 0x17b4, 0x17b5,
- 0x180b, 0x180e,
- 0x200b, 0x200f,
- 0x202a, 0x202e,
- 0x2060, 0x206f,
- 0x3164, 0x3164,
- 0xfe00, 0xfe0f,
- 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[] = {
- 319,
- 0x0300, 0x036f,
- 0x0483, 0x0489,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x061a,
- 0x064b, 0x065f,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06df, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ea, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x07eb, 0x07f3,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d4, 0x08e1,
- 0x08e3, 0x0902,
- 0x093a, 0x093a,
- 0x093c, 0x093c,
- 0x0941, 0x0948,
- 0x094d, 0x094d,
- 0x0951, 0x0957,
- 0x0962, 0x0963,
- 0x0981, 0x0981,
- 0x09bc, 0x09bc,
- 0x09be, 0x09be,
- 0x09c1, 0x09c4,
- 0x09cd, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a02,
- 0x0a3c, 0x0a3c,
- 0x0a41, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 0x0a81, 0x0a82,
- 0x0abc, 0x0abc,
- 0x0ac1, 0x0ac5,
- 0x0ac7, 0x0ac8,
- 0x0acd, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0afa, 0x0aff,
- 0x0b01, 0x0b01,
- 0x0b3c, 0x0b3c,
- 0x0b3e, 0x0b3f,
- 0x0b41, 0x0b44,
- 0x0b4d, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b62, 0x0b63,
- 0x0b82, 0x0b82,
- 0x0bbe, 0x0bbe,
- 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,
- 0x0cc6, 0x0cc6,
- 0x0ccc, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0ce2, 0x0ce3,
- 0x0d00, 0x0d01,
- 0x0d3b, 0x0d3c,
- 0x0d3e, 0x0d3e,
- 0x0d41, 0x0d44,
- 0x0d4d, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d62, 0x0d63,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dcf,
- 0x0dd2, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0ddf, 0x0ddf,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f71, 0x0f7e,
- 0x0f80, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f8d, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fc6, 0x0fc6,
- 0x102d, 0x1030,
- 0x1032, 0x1037,
- 0x1039, 0x103a,
- 0x103d, 0x103e,
- 0x1058, 0x1059,
- 0x105e, 0x1060,
- 0x1071, 0x1074,
- 0x1082, 0x1082,
- 0x1085, 0x1086,
- 0x108d, 0x108d,
- 0x109d, 0x109d,
- 0x135d, 0x135f,
- 0x1712, 0x1714,
- 0x1732, 0x1734,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b4, 0x17b5,
- 0x17b7, 0x17bd,
- 0x17c6, 0x17c6,
- 0x17c9, 0x17d3,
- 0x17dd, 0x17dd,
- 0x180b, 0x180d,
- 0x1885, 0x1886,
- 0x18a9, 0x18a9,
- 0x1920, 0x1922,
- 0x1927, 0x1928,
- 0x1932, 0x1932,
- 0x1939, 0x193b,
- 0x1a17, 0x1a18,
- 0x1a1b, 0x1a1b,
- 0x1a56, 0x1a56,
- 0x1a58, 0x1a5e,
- 0x1a60, 0x1a60,
- 0x1a62, 0x1a62,
- 0x1a65, 0x1a6c,
- 0x1a73, 0x1a7c,
- 0x1a7f, 0x1a7f,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b03,
- 0x1b34, 0x1b34,
- 0x1b36, 0x1b3a,
- 0x1b3c, 0x1b3c,
- 0x1b42, 0x1b42,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1b81,
- 0x1ba2, 0x1ba5,
- 0x1ba8, 0x1ba9,
- 0x1bab, 0x1bad,
- 0x1be6, 0x1be6,
- 0x1be8, 0x1be9,
- 0x1bed, 0x1bed,
- 0x1bef, 0x1bf1,
- 0x1c2c, 0x1c33,
- 0x1c36, 0x1c37,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1ce0,
- 0x1ce2, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf4, 0x1cf4,
- 0x1cf8, 0x1cf9,
- 0x1dc0, 0x1df9,
- 0x1dfb, 0x1dff,
- 0x200c, 0x200c,
- 0x20d0, 0x20f0,
- 0x2cef, 0x2cf1,
- 0x2d7f, 0x2d7f,
- 0x2de0, 0x2dff,
- 0x302a, 0x302f,
- 0x3099, 0x309a,
- 0xa66f, 0xa672,
- 0xa674, 0xa67d,
- 0xa69e, 0xa69f,
- 0xa6f0, 0xa6f1,
- 0xa802, 0xa802,
- 0xa806, 0xa806,
- 0xa80b, 0xa80b,
- 0xa825, 0xa826,
- 0xa8c4, 0xa8c5,
- 0xa8e0, 0xa8f1,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 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,
- 0xaabe, 0xaabf,
- 0xaac1, 0xaac1,
- 0xaaec, 0xaaed,
- 0xaaf6, 0xaaf6,
- 0xabe5, 0xabe5,
- 0xabe8, 0xabe8,
- 0xabed, 0xabed,
- 0xfb1e, 0xfb1e,
- 0xfe00, 0xfe0f,
- 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,
- 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,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133c, 0x1133c,
- 0x1133e, 0x1133e,
- 0x11340, 0x11340,
- 0x11357, 0x11357,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 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,
- 0x11a01, 0x11a06,
- 0x11a09, 0x11a0a,
- 0x11a33, 0x11a38,
- 0x11a3b, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a51, 0x11a56,
- 0x11a59, 0x11a5b,
- 0x11a8a, 0x11a96,
- 0x11a98, 0x11a99,
- 0x11c30, 0x11c36,
- 0x11c38, 0x11c3d,
- 0x11c3f, 0x11c3f,
- 0x11c92, 0x11ca7,
- 0x11caa, 0x11cb0,
- 0x11cb2, 0x11cb3,
- 0x11cb5, 0x11cb6,
- 0x11d31, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d45,
- 0x11d47, 0x11d47,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f8f, 0x16f92,
- 0x1bc9d, 0x1bc9e,
- 0x1d165, 0x1d165,
- 0x1d167, 0x1d169,
- 0x1d16e, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1d242, 0x1d244,
- 0x1da00, 0x1da36,
- 0x1da3b, 0x1da6c,
- 0x1da75, 0x1da75,
- 0x1da84, 0x1da84,
- 0x1da9b, 0x1da9f,
- 0x1daa1, 0x1daaf,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
-}; /* CR_Grapheme_Extend */
-
-/* 'Grapheme_Base': Derived Property */
-static const OnigCodePoint CR_Grapheme_Base[] = {
- 791,
- 0x0020, 0x007e,
- 0x00a0, 0x00ac,
- 0x00ae, 0x02ff,
- 0x0370, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0482,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x058d, 0x058f,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0606, 0x060f,
- 0x061b, 0x061b,
- 0x061e, 0x064a,
- 0x0660, 0x066f,
- 0x0671, 0x06d5,
- 0x06de, 0x06de,
- 0x06e5, 0x06e6,
- 0x06e9, 0x06e9,
- 0x06ee, 0x070d,
- 0x0710, 0x0710,
- 0x0712, 0x072f,
- 0x074d, 0x07a5,
- 0x07b1, 0x07b1,
- 0x07c0, 0x07ea,
- 0x07f4, 0x07fa,
- 0x0800, 0x0815,
- 0x081a, 0x081a,
- 0x0824, 0x0824,
- 0x0828, 0x0828,
- 0x0830, 0x083e,
- 0x0840, 0x0858,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x0903, 0x0939,
- 0x093b, 0x093b,
- 0x093d, 0x0940,
- 0x0949, 0x094c,
- 0x094e, 0x0950,
- 0x0958, 0x0961,
- 0x0964, 0x0980,
- 0x0982, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bd, 0x09bd,
- 0x09bf, 0x09c0,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09ce, 0x09ce,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e1,
- 0x09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- 0x0ead, 0x0eb0,
- 0x0eb2, 0x0eb3,
- 0x0ebd, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f17,
- 0x0f1a, 0x0f34,
- 0x0f36, 0x0f36,
- 0x0f38, 0x0f38,
- 0x0f3a, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f7f, 0x0f7f,
- 0x0f85, 0x0f85,
- 0x0f88, 0x0f8c,
- 0x0fbe, 0x0fc5,
- 0x0fc7, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x102c,
- 0x1031, 0x1031,
- 0x1038, 0x1038,
- 0x103b, 0x103c,
- 0x103f, 0x1057,
- 0x105a, 0x105d,
- 0x1061, 0x1070,
- 0x1075, 0x1081,
- 0x1083, 0x1084,
- 0x1087, 0x108c,
- 0x108e, 0x109c,
- 0x109e, 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,
- 0x1360, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1400, 0x169c,
- 0x16a0, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1711,
- 0x1720, 0x1731,
- 0x1735, 0x1736,
- 0x1740, 0x1751,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1780, 0x17b3,
- 0x17b6, 0x17b6,
- 0x17be, 0x17c5,
- 0x17c7, 0x17c8,
- 0x17d4, 0x17dc,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180a,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x1884,
- 0x1887, 0x18a8,
- 0x18aa, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1923, 0x1926,
- 0x1929, 0x192b,
- 0x1930, 0x1931,
- 0x1933, 0x1938,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a16,
- 0x1a19, 0x1a1a,
- 0x1a1e, 0x1a55,
- 0x1a57, 0x1a57,
- 0x1a61, 0x1a61,
- 0x1a63, 0x1a64,
- 0x1a6d, 0x1a72,
- 0x1a80, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b04, 0x1b33,
- 0x1b35, 0x1b35,
- 0x1b3b, 0x1b3b,
- 0x1b3d, 0x1b41,
- 0x1b43, 0x1b4b,
- 0x1b50, 0x1b6a,
- 0x1b74, 0x1b7c,
- 0x1b82, 0x1ba1,
- 0x1ba6, 0x1ba7,
- 0x1baa, 0x1baa,
- 0x1bae, 0x1be5,
- 0x1be7, 0x1be7,
- 0x1bea, 0x1bec,
- 0x1bee, 0x1bee,
- 0x1bf2, 0x1bf3,
- 0x1bfc, 0x1c2b,
- 0x1c34, 0x1c35,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c88,
- 0x1cc0, 0x1cc7,
- 0x1cd3, 0x1cd3,
- 0x1ce1, 0x1ce1,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf7,
- 0x1d00, 0x1dbf,
- 0x1e00, 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, 0x200a,
- 0x2010, 0x2027,
- 0x202f, 0x205f,
- 0x2070, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20bf,
- 0x2100, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 0x2bec, 0x2bef,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cee,
- 0x2cf2, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2e00, 0x2e49,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x3029,
- 0x3030, 0x303f,
- 0x3041, 0x3096,
- 0x309b, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fea,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa66e,
- 0xa673, 0xa673,
- 0xa67e, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa6f2, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa824,
- 0xa827, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c3,
- 0xa8ce, 0xa8d9,
- 0xa8f2, 0xa8fd,
- 0xa900, 0xa925,
- 0xa92e, 0xa946,
- 0xa952, 0xa953,
- 0xa95f, 0xa97c,
- 0xa983, 0xa9b2,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9bd, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9e4,
- 0xa9e6, 0xa9fe,
- 0xaa00, 0xaa28,
- 0xaa2f, 0xaa30,
- 0xaa33, 0xaa34,
- 0xaa40, 0xaa42,
- 0xaa44, 0xaa4b,
- 0xaa4d, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa7d, 0xaaaf,
- 0xaab1, 0xaab1,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaabd,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaaeb,
- 0xaaee, 0xaaf5,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab65,
- 0xab70, 0xabe4,
- 0xabe6, 0xabe7,
- 0xabe9, 0xabec,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb1d,
- 0xfb1f, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xff01, 0xff9d,
- 0xffa0, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfffc, 0xfffd,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018e,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fc,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e1, 0x102fb,
- 0x10300, 0x10323,
- 0x1032d, 0x1034a,
- 0x10350, 0x10375,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x10a00,
- 0x10a10, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a40, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a9f,
- 0x10ac0, 0x10ae4,
- 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, 0x11000,
- 0x11002, 0x11037,
- 0x11047, 0x1104d,
- 0x11052, 0x1106f,
- 0x11082, 0x110b2,
- 0x110b7, 0x110b8,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11103, 0x11126,
- 0x1112c, 0x1112c,
- 0x11136, 0x11143,
- 0x11150, 0x11172,
- 0x11174, 0x11176,
- 0x11182, 0x111b5,
- 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,
- 0x11400, 0x11437,
- 0x11440, 0x11441,
- 0x11445, 0x11445,
- 0x11447, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 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,
- 0x11660, 0x1166c,
- 0x11680, 0x116aa,
- 0x116ac, 0x116ac,
- 0x116ae, 0x116af,
- 0x116b6, 0x116b6,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x11720, 0x11721,
- 0x11726, 0x11726,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a00,
- 0x11a07, 0x11a08,
- 0x11a0b, 0x11a32,
- 0x11a39, 0x11a3a,
- 0x11a3f, 0x11a46,
- 0x11a50, 0x11a50,
- 0x11a57, 0x11a58,
- 0x11a5c, 0x11a83,
- 0x11a86, 0x11a89,
- 0x11a97, 0x11a97,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2f,
- 0x11c3e, 0x11c3e,
- 0x11c40, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11ca9, 0x11ca9,
- 0x11cb1, 0x11cb1,
- 0x11cb4, 0x11cb4,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bc9c,
- 0x1bc9f, 0x1bc9f,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d164,
- 0x1d166, 0x1d166,
- 0x1d16a, 0x1d16d,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1e8,
- 0x1d200, 0x1d241,
- 0x1d245, 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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 0x1f0f5,
- 0x1f100, 0x1f10c,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Grapheme_Base */
-
-/* 'Grapheme_Link': Derived Property */
-static const OnigCodePoint CR_Grapheme_Link[] = {
- 48,
- 0x094d, 0x094d,
- 0x09cd, 0x09cd,
- 0x0a4d, 0x0a4d,
- 0x0acd, 0x0acd,
- 0x0b4d, 0x0b4d,
- 0x0bcd, 0x0bcd,
- 0x0c4d, 0x0c4d,
- 0x0ccd, 0x0ccd,
- 0x0d3b, 0x0d3c,
- 0x0d4d, 0x0d4d,
- 0x0dca, 0x0dca,
- 0x0e3a, 0x0e3a,
- 0x0f84, 0x0f84,
- 0x1039, 0x103a,
- 0x1714, 0x1714,
- 0x1734, 0x1734,
- 0x17d2, 0x17d2,
- 0x1a60, 0x1a60,
- 0x1b44, 0x1b44,
- 0x1baa, 0x1bab,
- 0x1bf2, 0x1bf3,
- 0x2d7f, 0x2d7f,
- 0xa806, 0xa806,
- 0xa8c4, 0xa8c4,
- 0xa953, 0xa953,
- 0xa9c0, 0xa9c0,
- 0xaaf6, 0xaaf6,
- 0xabed, 0xabed,
- 0x10a3f, 0x10a3f,
- 0x11046, 0x11046,
- 0x1107f, 0x1107f,
- 0x110b9, 0x110b9,
- 0x11133, 0x11134,
- 0x111c0, 0x111c0,
- 0x11235, 0x11235,
- 0x112ea, 0x112ea,
- 0x1134d, 0x1134d,
- 0x11442, 0x11442,
- 0x114c2, 0x114c2,
- 0x115bf, 0x115bf,
- 0x1163f, 0x1163f,
- 0x116b6, 0x116b6,
- 0x1172b, 0x1172b,
- 0x11a34, 0x11a34,
- 0x11a47, 0x11a47,
- 0x11a99, 0x11a99,
- 0x11c3f, 0x11c3f,
- 0x11d44, 0x11d45,
-}; /* CR_Grapheme_Link */
-
-/* 'Common': Script */
-static const OnigCodePoint CR_Common[] = {
- 164,
- 0x0000, 0x0040,
- 0x005b, 0x0060,
- 0x007b, 0x00a9,
- 0x00ab, 0x00b9,
- 0x00bb, 0x00bf,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x02b9, 0x02df,
- 0x02e5, 0x02e9,
- 0x02ec, 0x02ff,
- 0x0374, 0x0374,
- 0x037e, 0x037e,
- 0x0385, 0x0385,
- 0x0387, 0x0387,
- 0x0589, 0x0589,
- 0x0605, 0x0605,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0640, 0x0640,
- 0x06dd, 0x06dd,
- 0x08e2, 0x08e2,
- 0x0964, 0x0965,
- 0x0e3f, 0x0e3f,
- 0x0fd5, 0x0fd8,
- 0x10fb, 0x10fb,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x1802, 0x1803,
- 0x1805, 0x1805,
- 0x1cd3, 0x1cd3,
- 0x1ce1, 0x1ce1,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf7,
- 0x2000, 0x200b,
- 0x200e, 0x2064,
- 0x2066, 0x2070,
- 0x2074, 0x207e,
- 0x2080, 0x208e,
- 0x20a0, 0x20bf,
- 0x2100, 0x2125,
- 0x2127, 0x2129,
- 0x212c, 0x2131,
- 0x2133, 0x214d,
- 0x214f, 0x215f,
- 0x2189, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x27ff,
- 0x2900, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 0x2bec, 0x2bef,
- 0x2e00, 0x2e49,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x3004,
- 0x3006, 0x3006,
- 0x3008, 0x3020,
- 0x3030, 0x3037,
- 0x303c, 0x303f,
- 0x309b, 0x309c,
- 0x30a0, 0x30a0,
- 0x30fb, 0x30fc,
- 0x3190, 0x319f,
- 0x31c0, 0x31e3,
- 0x3220, 0x325f,
- 0x327f, 0x32cf,
- 0x3358, 0x33ff,
- 0x4dc0, 0x4dff,
- 0xa700, 0xa721,
- 0xa788, 0xa78a,
- 0xa830, 0xa839,
- 0xa92e, 0xa92e,
- 0xa9cf, 0xa9cf,
- 0xab5b, 0xab5b,
- 0xfd3e, 0xfd3f,
- 0xfe10, 0xfe19,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfeff, 0xfeff,
- 0xff01, 0xff20,
- 0xff3b, 0xff40,
- 0xff5b, 0xff65,
- 0xff70, 0xff70,
- 0xff9e, 0xff9f,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xfffd,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1013f,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fc,
- 0x102e1, 0x102fb,
- 0x1bca0, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d166,
- 0x1d16a, 0x1d17a,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1e8,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f100, 0x1f10c,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f1ff,
- 0x1f201, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
-}; /* CR_Common */
-
-/* 'Latin': Script */
-static const OnigCodePoint CR_Latin[] = {
- 31,
- 0x0041, 0x005a,
- 0x0061, 0x007a,
- 0x00aa, 0x00aa,
- 0x00ba, 0x00ba,
- 0x00c0, 0x00d6,
- 0x00d8, 0x00f6,
- 0x00f8, 0x02b8,
- 0x02e0, 0x02e4,
- 0x1d00, 0x1d25,
- 0x1d2c, 0x1d5c,
- 0x1d62, 0x1d65,
- 0x1d6b, 0x1d77,
- 0x1d79, 0x1dbe,
- 0x1e00, 0x1eff,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x212a, 0x212b,
- 0x2132, 0x2132,
- 0x214e, 0x214e,
- 0x2160, 0x2188,
- 0x2c60, 0x2c7f,
- 0xa722, 0xa787,
- 0xa78b, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa7ff,
- 0xab30, 0xab5a,
- 0xab5c, 0xab64,
- 0xfb00, 0xfb06,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
-}; /* CR_Latin */
-
-/* 'Greek': Script */
-static const OnigCodePoint CR_Greek[] = {
- 36,
- 0x0370, 0x0373,
- 0x0375, 0x0377,
- 0x037a, 0x037d,
- 0x037f, 0x037f,
- 0x0384, 0x0384,
- 0x0386, 0x0386,
- 0x0388, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03e1,
- 0x03f0, 0x03ff,
- 0x1d26, 0x1d2a,
- 0x1d5d, 0x1d61,
- 0x1d66, 0x1d6a,
- 0x1dbf, 0x1dbf,
- 0x1f00, 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,
- 0x2126, 0x2126,
- 0xab65, 0xab65,
- 0x10140, 0x1018e,
- 0x101a0, 0x101a0,
- 0x1d200, 0x1d245,
-}; /* CR_Greek */
-
-/* 'Cyrillic': Script */
-static const OnigCodePoint CR_Cyrillic[] = {
- 8,
- 0x0400, 0x0484,
- 0x0487, 0x052f,
- 0x1c80, 0x1c88,
- 0x1d2b, 0x1d2b,
- 0x1d78, 0x1d78,
- 0x2de0, 0x2dff,
- 0xa640, 0xa69f,
- 0xfe2e, 0xfe2f,
-}; /* CR_Cyrillic */
-
-/* 'Armenian': Script */
-static const OnigCodePoint CR_Armenian[] = {
- 6,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x058a, 0x058a,
- 0x058d, 0x058f,
- 0xfb13, 0xfb17,
-}; /* CR_Armenian */
-
-/* 'Hebrew': Script */
-static const OnigCodePoint CR_Hebrew[] = {
- 9,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfb4f,
-}; /* CR_Hebrew */
-
-/* 'Arabic': Script */
-static const OnigCodePoint CR_Arabic[] = {
- 57,
- 0x0600, 0x0604,
- 0x0606, 0x060b,
- 0x060d, 0x061a,
- 0x061c, 0x061c,
- 0x061e, 0x061e,
- 0x0620, 0x063f,
- 0x0641, 0x064a,
- 0x0656, 0x066f,
- 0x0671, 0x06dc,
- 0x06de, 0x06ff,
- 0x0750, 0x077f,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 0x08e1,
- 0x08e3, 0x08ff,
- 0xfb50, 0xfbc1,
- 0xfbd3, 0xfd3d,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfd,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0x10e60, 0x10e7e,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x1eef0, 0x1eef1,
-}; /* CR_Arabic */
-
-/* 'Syriac': Script */
-static const OnigCodePoint CR_Syriac[] = {
- 4,
- 0x0700, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x074f,
- 0x0860, 0x086a,
-}; /* CR_Syriac */
-
-/* 'Thaana': Script */
-static const OnigCodePoint CR_Thaana[] = {
- 1,
- 0x0780, 0x07b1,
-}; /* CR_Thaana */
-
-/* 'Devanagari': Script */
-static const OnigCodePoint CR_Devanagari[] = {
- 4,
- 0x0900, 0x0950,
- 0x0953, 0x0963,
- 0x0966, 0x097f,
- 0xa8e0, 0xa8fd,
-}; /* CR_Devanagari */
-
-/* 'Bengali': Script */
-static const OnigCodePoint CR_Bengali[] = {
- 14,
- 0x0980, 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, 0x09fd,
-}; /* CR_Bengali */
-
-/* 'Gurmukhi': Script */
-static const OnigCodePoint CR_Gurmukhi[] = {
- 16,
- 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,
-}; /* CR_Gurmukhi */
-
-/* 'Gujarati': Script */
-static const OnigCodePoint CR_Gujarati[] = {
- 14,
- 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, 0x0aff,
-}; /* CR_Gujarati */
-
-/* 'Oriya': Script */
-static const OnigCodePoint CR_Oriya[] = {
- 14,
- 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,
-}; /* CR_Oriya */
-
-/* 'Tamil': Script */
-static const OnigCodePoint CR_Tamil[] = {
- 16,
- 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,
-}; /* CR_Tamil */
-
-/* 'Telugu': Script */
-static const OnigCodePoint CR_Telugu[] = {
- 13,
- 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,
-}; /* CR_Telugu */
-
-/* 'Kannada': Script */
-static const OnigCodePoint CR_Kannada[] = {
- 14,
- 0x0c80, 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,
-}; /* CR_Kannada */
-
-/* 'Malayalam': Script */
-static const OnigCodePoint CR_Malayalam[] = {
- 8,
- 0x0d00, 0x0d03,
- 0x0d05, 0x0d0c,
- 0x0d0e, 0x0d10,
- 0x0d12, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4f,
- 0x0d54, 0x0d63,
- 0x0d66, 0x0d7f,
-}; /* CR_Malayalam */
-
-/* 'Sinhala': Script */
-static const OnigCodePoint CR_Sinhala[] = {
- 13,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0de6, 0x0def,
- 0x0df2, 0x0df4,
- 0x111e1, 0x111f4,
-}; /* CR_Sinhala */
-
-/* 'Thai': Script */
-static const OnigCodePoint CR_Thai[] = {
- 2,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e5b,
-}; /* CR_Thai */
-
-/* 'Lao': Script */
-static const OnigCodePoint CR_Lao[] = {
- 18,
- 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,
-}; /* CR_Lao */
-
-/* 'Tibetan': Script */
-static const OnigCodePoint CR_Tibetan[] = {
- 7,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fd4,
- 0x0fd9, 0x0fda,
-}; /* CR_Tibetan */
-
-/* 'Myanmar': Script */
-static const OnigCodePoint CR_Myanmar[] = {
- 3,
- 0x1000, 0x109f,
- 0xa9e0, 0xa9fe,
- 0xaa60, 0xaa7f,
-}; /* CR_Myanmar */
-
-/* 'Georgian': Script */
-static const OnigCodePoint CR_Georgian[] = {
- 8,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10ff,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
-}; /* CR_Georgian */
-
-/* 'Hangul': Script */
-static const OnigCodePoint CR_Hangul[] = {
- 14,
- 0x1100, 0x11ff,
- 0x302e, 0x302f,
- 0x3131, 0x318e,
- 0x3200, 0x321e,
- 0x3260, 0x327e,
- 0xa960, 0xa97c,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xffa0, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
-}; /* CR_Hangul */
-
-/* 'Ethiopic': Script */
-static const OnigCodePoint CR_Ethiopic[] = {
- 32,
- 0x1200, 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,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
-}; /* CR_Ethiopic */
-
-/* 'Cherokee': Script */
-static const OnigCodePoint CR_Cherokee[] = {
- 3,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0xab70, 0xabbf,
-}; /* CR_Cherokee */
-
-/* 'Canadian_Aboriginal': Script */
-static const OnigCodePoint CR_Canadian_Aboriginal[] = {
- 2,
- 0x1400, 0x167f,
- 0x18b0, 0x18f5,
-}; /* CR_Canadian_Aboriginal */
-
-/* 'Ogham': Script */
-static const OnigCodePoint CR_Ogham[] = {
- 1,
- 0x1680, 0x169c,
-}; /* CR_Ogham */
-
-/* 'Runic': Script */
-static const OnigCodePoint CR_Runic[] = {
- 2,
- 0x16a0, 0x16ea,
- 0x16ee, 0x16f8,
-}; /* CR_Runic */
-
-/* 'Khmer': Script */
-static const OnigCodePoint CR_Khmer[] = {
- 4,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x19e0, 0x19ff,
-}; /* CR_Khmer */
-
-/* 'Mongolian': Script */
-static const OnigCodePoint CR_Mongolian[] = {
- 7,
- 0x1800, 0x1801,
- 0x1804, 0x1804,
- 0x1806, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x11660, 0x1166c,
-}; /* CR_Mongolian */
-
-/* 'Hiragana': Script */
-static const OnigCodePoint CR_Hiragana[] = {
- 4,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x1b001, 0x1b11e,
- 0x1f200, 0x1f200,
-}; /* CR_Hiragana */
-
-/* 'Katakana': Script */
-static const OnigCodePoint CR_Katakana[] = {
- 8,
- 0x30a1, 0x30fa,
- 0x30fd, 0x30ff,
- 0x31f0, 0x31ff,
- 0x32d0, 0x32fe,
- 0x3300, 0x3357,
- 0xff66, 0xff6f,
- 0xff71, 0xff9d,
- 0x1b000, 0x1b000,
-}; /* CR_Katakana */
-
-/* 'Bopomofo': Script */
-static const OnigCodePoint CR_Bopomofo[] = {
- 3,
- 0x02ea, 0x02eb,
- 0x3105, 0x312e,
- 0x31a0, 0x31ba,
-}; /* CR_Bopomofo */
-
-/* 'Han': Script */
-static const OnigCodePoint CR_Han[] = {
- 17,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x3005, 0x3005,
- 0x3007, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303b,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Han */
-
-/* 'Yi': Script */
-static const OnigCodePoint CR_Yi[] = {
- 2,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
-}; /* CR_Yi */
-
-/* 'Old_Italic': Script */
-static const OnigCodePoint CR_Old_Italic[] = {
- 2,
- 0x10300, 0x10323,
- 0x1032d, 0x1032f,
-}; /* CR_Old_Italic */
-
-/* 'Gothic': Script */
-static const OnigCodePoint CR_Gothic[] = {
- 1,
- 0x10330, 0x1034a,
-}; /* CR_Gothic */
-
-/* 'Deseret': Script */
-static const OnigCodePoint CR_Deseret[] = {
- 1,
- 0x10400, 0x1044f,
-}; /* CR_Deseret */
-
-/* 'Inherited': Script */
-static const OnigCodePoint CR_Inherited[] = {
- 27,
- 0x0300, 0x036f,
- 0x0485, 0x0486,
- 0x064b, 0x0655,
- 0x0670, 0x0670,
- 0x0951, 0x0952,
- 0x1ab0, 0x1abe,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1ce0,
- 0x1ce2, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf4, 0x1cf4,
- 0x1cf8, 0x1cf9,
- 0x1dc0, 0x1df9,
- 0x1dfb, 0x1dff,
- 0x200c, 0x200d,
- 0x20d0, 0x20f0,
- 0x302a, 0x302d,
- 0x3099, 0x309a,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe2d,
- 0x101fd, 0x101fd,
- 0x102e0, 0x102e0,
- 0x1d167, 0x1d169,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0xe0100, 0xe01ef,
-}; /* CR_Inherited */
-
-/* 'Tagalog': Script */
-static const OnigCodePoint CR_Tagalog[] = {
- 2,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
-}; /* CR_Tagalog */
-
-/* 'Hanunoo': Script */
-static const OnigCodePoint CR_Hanunoo[] = {
- 1,
- 0x1720, 0x1734,
-}; /* CR_Hanunoo */
-
-/* 'Buhid': Script */
-static const OnigCodePoint CR_Buhid[] = {
- 1,
- 0x1740, 0x1753,
-}; /* CR_Buhid */
-
-/* 'Tagbanwa': Script */
-static const OnigCodePoint CR_Tagbanwa[] = {
- 3,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
-}; /* CR_Tagbanwa */
-
-/* 'Limbu': Script */
-static const OnigCodePoint CR_Limbu[] = {
- 5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x194f,
-}; /* CR_Limbu */
-
-/* 'Tai_Le': Script */
-static const OnigCodePoint CR_Tai_Le[] = {
- 2,
- 0x1950, 0x196d,
- 0x1970, 0x1974,
-}; /* CR_Tai_Le */
-
-/* 'Linear_B': Script */
-static const OnigCodePoint CR_Linear_B[] = {
- 7,
- 0x10000, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
-}; /* CR_Linear_B */
-
-/* 'Ugaritic': Script */
-static const OnigCodePoint CR_Ugaritic[] = {
- 2,
- 0x10380, 0x1039d,
- 0x1039f, 0x1039f,
-}; /* CR_Ugaritic */
-
-/* 'Shavian': Script */
-static const OnigCodePoint CR_Shavian[] = {
- 1,
- 0x10450, 0x1047f,
-}; /* CR_Shavian */
-
-/* 'Osmanya': Script */
-static const OnigCodePoint CR_Osmanya[] = {
- 2,
- 0x10480, 0x1049d,
- 0x104a0, 0x104a9,
-}; /* CR_Osmanya */
-
-/* 'Cypriot': Script */
-static const OnigCodePoint CR_Cypriot[] = {
- 6,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x1083f,
-}; /* CR_Cypriot */
-
-/* 'Braille': Script */
-static const OnigCodePoint CR_Braille[] = {
- 1,
- 0x2800, 0x28ff,
-}; /* CR_Braille */
-
-/* 'Buginese': Script */
-static const OnigCodePoint CR_Buginese[] = {
- 2,
- 0x1a00, 0x1a1b,
- 0x1a1e, 0x1a1f,
-}; /* CR_Buginese */
-
-/* 'Coptic': Script */
-static const OnigCodePoint CR_Coptic[] = {
- 3,
- 0x03e2, 0x03ef,
- 0x2c80, 0x2cf3,
- 0x2cf9, 0x2cff,
-}; /* CR_Coptic */
-
-/* 'New_Tai_Lue': Script */
-static const OnigCodePoint CR_New_Tai_Lue[] = {
- 4,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x19df,
-}; /* CR_New_Tai_Lue */
-
-/* 'Glagolitic': Script */
-static const OnigCodePoint CR_Glagolitic[] = {
- 7,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
-}; /* CR_Glagolitic */
-
-/* 'Tifinagh': Script */
-static const OnigCodePoint CR_Tifinagh[] = {
- 3,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d7f,
-}; /* CR_Tifinagh */
-
-/* 'Syloti_Nagri': Script */
-static const OnigCodePoint CR_Syloti_Nagri[] = {
- 1,
- 0xa800, 0xa82b,
-}; /* CR_Syloti_Nagri */
-
-/* 'Old_Persian': Script */
-static const OnigCodePoint CR_Old_Persian[] = {
- 2,
- 0x103a0, 0x103c3,
- 0x103c8, 0x103d5,
-}; /* CR_Old_Persian */
-
-/* 'Kharoshthi': Script */
-static const OnigCodePoint CR_Kharoshthi[] = {
- 8,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
-}; /* CR_Kharoshthi */
-
-/* 'Balinese': Script */
-static const OnigCodePoint CR_Balinese[] = {
- 2,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
-}; /* CR_Balinese */
-
-/* 'Cuneiform': Script */
-static const OnigCodePoint CR_Cuneiform[] = {
- 4,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
-}; /* CR_Cuneiform */
-
-/* 'Phoenician': Script */
-static const OnigCodePoint CR_Phoenician[] = {
- 2,
- 0x10900, 0x1091b,
- 0x1091f, 0x1091f,
-}; /* CR_Phoenician */
-
-/* 'Phags_Pa': Script */
-static const OnigCodePoint CR_Phags_Pa[] = {
- 1,
- 0xa840, 0xa877,
-}; /* CR_Phags_Pa */
-
-/* 'Nko': Script */
-static const OnigCodePoint CR_Nko[] = {
- 1,
- 0x07c0, 0x07fa,
-}; /* CR_Nko */
-
-/* 'Sundanese': Script */
-static const OnigCodePoint CR_Sundanese[] = {
- 2,
- 0x1b80, 0x1bbf,
- 0x1cc0, 0x1cc7,
-}; /* CR_Sundanese */
-
-/* 'Lepcha': Script */
-static const OnigCodePoint CR_Lepcha[] = {
- 3,
- 0x1c00, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c4f,
-}; /* CR_Lepcha */
-
-/* 'Ol_Chiki': Script */
-static const OnigCodePoint CR_Ol_Chiki[] = {
- 1,
- 0x1c50, 0x1c7f,
-}; /* CR_Ol_Chiki */
-
-/* 'Vai': Script */
-static const OnigCodePoint CR_Vai[] = {
- 1,
- 0xa500, 0xa62b,
-}; /* CR_Vai */
-
-/* 'Saurashtra': Script */
-static const OnigCodePoint CR_Saurashtra[] = {
- 2,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
-}; /* CR_Saurashtra */
-
-/* 'Kayah_Li': Script */
-static const OnigCodePoint CR_Kayah_Li[] = {
- 2,
- 0xa900, 0xa92d,
- 0xa92f, 0xa92f,
-}; /* CR_Kayah_Li */
-
-/* 'Rejang': Script */
-static const OnigCodePoint CR_Rejang[] = {
- 2,
- 0xa930, 0xa953,
- 0xa95f, 0xa95f,
-}; /* CR_Rejang */
-
-/* 'Lycian': Script */
-static const OnigCodePoint CR_Lycian[] = {
- 1,
- 0x10280, 0x1029c,
-}; /* CR_Lycian */
-
-/* 'Carian': Script */
-static const OnigCodePoint CR_Carian[] = {
- 1,
- 0x102a0, 0x102d0,
-}; /* CR_Carian */
-
-/* 'Lydian': Script */
-static const OnigCodePoint CR_Lydian[] = {
- 2,
- 0x10920, 0x10939,
- 0x1093f, 0x1093f,
-}; /* CR_Lydian */
-
-/* 'Cham': Script */
-static const OnigCodePoint CR_Cham[] = {
- 4,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa5f,
-}; /* CR_Cham */
-
-/* 'Tai_Tham': Script */
-static const OnigCodePoint CR_Tai_Tham[] = {
- 5,
- 0x1a20, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
-}; /* CR_Tai_Tham */
-
-/* 'Tai_Viet': Script */
-static const OnigCodePoint CR_Tai_Viet[] = {
- 2,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
-}; /* CR_Tai_Viet */
-
-/* 'Avestan': Script */
-static const OnigCodePoint CR_Avestan[] = {
- 2,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b3f,
-}; /* CR_Avestan */
-
-/* 'Egyptian_Hieroglyphs': Script */
-static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = {
- 1,
- 0x13000, 0x1342e,
-}; /* CR_Egyptian_Hieroglyphs */
-
-/* 'Samaritan': Script */
-static const OnigCodePoint CR_Samaritan[] = {
- 2,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
-}; /* CR_Samaritan */
-
-/* 'Lisu': Script */
-static const OnigCodePoint CR_Lisu[] = {
- 1,
- 0xa4d0, 0xa4ff,
-}; /* CR_Lisu */
-
-/* 'Bamum': Script */
-static const OnigCodePoint CR_Bamum[] = {
- 2,
- 0xa6a0, 0xa6f7,
- 0x16800, 0x16a38,
-}; /* CR_Bamum */
-
-/* 'Javanese': Script */
-static const OnigCodePoint CR_Javanese[] = {
- 3,
- 0xa980, 0xa9cd,
- 0xa9d0, 0xa9d9,
- 0xa9de, 0xa9df,
-}; /* CR_Javanese */
-
-/* 'Meetei_Mayek': Script */
-static const OnigCodePoint CR_Meetei_Mayek[] = {
- 3,
- 0xaae0, 0xaaf6,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
-}; /* CR_Meetei_Mayek */
-
-/* 'Imperial_Aramaic': Script */
-static const OnigCodePoint CR_Imperial_Aramaic[] = {
- 2,
- 0x10840, 0x10855,
- 0x10857, 0x1085f,
-}; /* CR_Imperial_Aramaic */
-
-/* 'Old_South_Arabian': Script */
-static const OnigCodePoint CR_Old_South_Arabian[] = {
- 1,
- 0x10a60, 0x10a7f,
-}; /* CR_Old_South_Arabian */
-
-/* 'Inscriptional_Parthian': Script */
-static const OnigCodePoint CR_Inscriptional_Parthian[] = {
- 2,
- 0x10b40, 0x10b55,
- 0x10b58, 0x10b5f,
-}; /* CR_Inscriptional_Parthian */
-
-/* 'Inscriptional_Pahlavi': Script */
-static const OnigCodePoint CR_Inscriptional_Pahlavi[] = {
- 2,
- 0x10b60, 0x10b72,
- 0x10b78, 0x10b7f,
-}; /* CR_Inscriptional_Pahlavi */
-
-/* 'Old_Turkic': Script */
-static const OnigCodePoint CR_Old_Turkic[] = {
- 1,
- 0x10c00, 0x10c48,
-}; /* CR_Old_Turkic */
-
-/* 'Kaithi': Script */
-static const OnigCodePoint CR_Kaithi[] = {
- 1,
- 0x11080, 0x110c1,
-}; /* CR_Kaithi */
-
-/* 'Batak': Script */
-static const OnigCodePoint CR_Batak[] = {
- 2,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1bff,
-}; /* CR_Batak */
-
-/* 'Brahmi': Script */
-static const OnigCodePoint CR_Brahmi[] = {
- 3,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x1107f,
-}; /* CR_Brahmi */
-
-/* 'Mandaic': Script */
-static const OnigCodePoint CR_Mandaic[] = {
- 2,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
-}; /* CR_Mandaic */
-
-/* 'Chakma': Script */
-static const OnigCodePoint CR_Chakma[] = {
- 2,
- 0x11100, 0x11134,
- 0x11136, 0x11143,
-}; /* CR_Chakma */
-
-/* 'Meroitic_Cursive': Script */
-static const OnigCodePoint CR_Meroitic_Cursive[] = {
- 3,
- 0x109a0, 0x109b7,
- 0x109bc, 0x109cf,
- 0x109d2, 0x109ff,
-}; /* CR_Meroitic_Cursive */
-
-/* 'Meroitic_Hieroglyphs': Script */
-static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
- 1,
- 0x10980, 0x1099f,
-}; /* CR_Meroitic_Hieroglyphs */
-
-/* 'Miao': Script */
-static const OnigCodePoint CR_Miao[] = {
- 3,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
-}; /* CR_Miao */
-
-/* 'Sharada': Script */
-static const OnigCodePoint CR_Sharada[] = {
- 2,
- 0x11180, 0x111cd,
- 0x111d0, 0x111df,
-}; /* CR_Sharada */
-
-/* 'Sora_Sompeng': Script */
-static const OnigCodePoint CR_Sora_Sompeng[] = {
- 2,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
-}; /* CR_Sora_Sompeng */
-
-/* 'Takri': Script */
-static const OnigCodePoint CR_Takri[] = {
- 2,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
-}; /* CR_Takri */
-
-/* '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, 0x1123e,
-}; /* 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 */
-
-/* 'Adlam': Script */
-static const OnigCodePoint CR_Adlam[] = {
- 3,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
-}; /* CR_Adlam */
-
-/* 'Bhaiksuki': Script */
-static const OnigCodePoint CR_Bhaiksuki[] = {
- 4,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
-}; /* CR_Bhaiksuki */
-
-/* 'Marchen': Script */
-static const OnigCodePoint CR_Marchen[] = {
- 3,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
-}; /* CR_Marchen */
-
-/* 'Newa': Script */
-static const OnigCodePoint CR_Newa[] = {
- 3,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
-}; /* CR_Newa */
-
-/* 'Osage': Script */
-static const OnigCodePoint CR_Osage[] = {
- 2,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
-}; /* CR_Osage */
-
-/* 'Tangut': Script */
-static const OnigCodePoint CR_Tangut[] = {
- 3,
- 0x16fe0, 0x16fe0,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
-}; /* CR_Tangut */
-
-/* 'Masaram_Gondi': Script */
-static const OnigCodePoint CR_Masaram_Gondi[] = {
- 7,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
-}; /* CR_Masaram_Gondi */
-
-/* 'Nushu': Script */
-static const OnigCodePoint CR_Nushu[] = {
- 2,
- 0x16fe1, 0x16fe1,
- 0x1b170, 0x1b2fb,
-}; /* CR_Nushu */
-
-/* 'Soyombo': Script */
-static const OnigCodePoint CR_Soyombo[] = {
- 3,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a9c,
- 0x11a9e, 0x11aa2,
-}; /* CR_Soyombo */
-
-/* 'Zanabazar_Square': Script */
-static const OnigCodePoint CR_Zanabazar_Square[] = {
- 1,
- 0x11a00, 0x11a47,
-}; /* CR_Zanabazar_Square */
-
-/* 'White_Space': Binary Property */
-#define CR_White_Space CR_Space
-
-/* 'Bidi_Control': Binary Property */
-static const OnigCodePoint CR_Bidi_Control[] = {
- 4,
- 0x061c, 0x061c,
- 0x200e, 0x200f,
- 0x202a, 0x202e,
- 0x2066, 0x2069,
-}; /* CR_Bidi_Control */
-
-/* 'Join_Control': Binary Property */
-static const OnigCodePoint CR_Join_Control[] = {
- 1,
- 0x200c, 0x200d,
-}; /* CR_Join_Control */
-
-/* 'Dash': Binary Property */
-static const OnigCodePoint CR_Dash[] = {
- 21,
- 0x002d, 0x002d,
- 0x058a, 0x058a,
- 0x05be, 0x05be,
- 0x1400, 0x1400,
- 0x1806, 0x1806,
- 0x2010, 0x2015,
- 0x2053, 0x2053,
- 0x207b, 0x207b,
- 0x208b, 0x208b,
- 0x2212, 0x2212,
- 0x2e17, 0x2e17,
- 0x2e1a, 0x2e1a,
- 0x2e3a, 0x2e3b,
- 0x2e40, 0x2e40,
- 0x301c, 0x301c,
- 0x3030, 0x3030,
- 0x30a0, 0x30a0,
- 0xfe31, 0xfe32,
- 0xfe58, 0xfe58,
- 0xfe63, 0xfe63,
- 0xff0d, 0xff0d,
-}; /* CR_Dash */
-
-/* 'Hyphen': Binary Property */
-static const OnigCodePoint CR_Hyphen[] = {
- 10,
- 0x002d, 0x002d,
- 0x00ad, 0x00ad,
- 0x058a, 0x058a,
- 0x1806, 0x1806,
- 0x2010, 0x2011,
- 0x2e17, 0x2e17,
- 0x30fb, 0x30fb,
- 0xfe63, 0xfe63,
- 0xff0d, 0xff0d,
- 0xff65, 0xff65,
-}; /* CR_Hyphen */
-
-/* 'Quotation_Mark': Binary Property */
-static const OnigCodePoint CR_Quotation_Mark[] = {
- 13,
- 0x0022, 0x0022,
- 0x0027, 0x0027,
- 0x00ab, 0x00ab,
- 0x00bb, 0x00bb,
- 0x2018, 0x201f,
- 0x2039, 0x203a,
- 0x2e42, 0x2e42,
- 0x300c, 0x300f,
- 0x301d, 0x301f,
- 0xfe41, 0xfe44,
- 0xff02, 0xff02,
- 0xff07, 0xff07,
- 0xff62, 0xff63,
-}; /* CR_Quotation_Mark */
-
-/* 'Terminal_Punctuation': Binary Property */
-static const OnigCodePoint CR_Terminal_Punctuation[] = {
- 97,
- 0x0021, 0x0021,
- 0x002c, 0x002c,
- 0x002e, 0x002e,
- 0x003a, 0x003b,
- 0x003f, 0x003f,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x0589, 0x0589,
- 0x05c3, 0x05c3,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x06d4, 0x06d4,
- 0x0700, 0x070a,
- 0x070c, 0x070c,
- 0x07f8, 0x07f9,
- 0x0830, 0x083e,
- 0x085e, 0x085e,
- 0x0964, 0x0965,
- 0x0e5a, 0x0e5b,
- 0x0f08, 0x0f08,
- 0x0f0d, 0x0f12,
- 0x104a, 0x104b,
- 0x1361, 0x1368,
- 0x166d, 0x166e,
- 0x16eb, 0x16ed,
- 0x1735, 0x1736,
- 0x17d4, 0x17d6,
- 0x17da, 0x17da,
- 0x1802, 0x1805,
- 0x1808, 0x1809,
- 0x1944, 0x1945,
- 0x1aa8, 0x1aab,
- 0x1b5a, 0x1b5b,
- 0x1b5d, 0x1b5f,
- 0x1c3b, 0x1c3f,
- 0x1c7e, 0x1c7f,
- 0x203c, 0x203d,
- 0x2047, 0x2049,
- 0x2e2e, 0x2e2e,
- 0x2e3c, 0x2e3c,
- 0x2e41, 0x2e41,
- 0x3001, 0x3002,
- 0xa4fe, 0xa4ff,
- 0xa60d, 0xa60f,
- 0xa6f3, 0xa6f7,
- 0xa876, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa92f, 0xa92f,
- 0xa9c7, 0xa9c9,
- 0xaa5d, 0xaa5f,
- 0xaadf, 0xaadf,
- 0xaaf0, 0xaaf1,
- 0xabeb, 0xabeb,
- 0xfe50, 0xfe52,
- 0xfe54, 0xfe57,
- 0xff01, 0xff01,
- 0xff0c, 0xff0c,
- 0xff0e, 0xff0e,
- 0xff1a, 0xff1b,
- 0xff1f, 0xff1f,
- 0xff61, 0xff61,
- 0xff64, 0xff64,
- 0x1039f, 0x1039f,
- 0x103d0, 0x103d0,
- 0x10857, 0x10857,
- 0x1091f, 0x1091f,
- 0x10a56, 0x10a57,
- 0x10af0, 0x10af5,
- 0x10b3a, 0x10b3f,
- 0x10b99, 0x10b9c,
- 0x11047, 0x1104d,
- 0x110be, 0x110c1,
- 0x11141, 0x11143,
- 0x111c5, 0x111c6,
- 0x111cd, 0x111cd,
- 0x111de, 0x111df,
- 0x11238, 0x1123c,
- 0x112a9, 0x112a9,
- 0x1144b, 0x1144d,
- 0x1145b, 0x1145b,
- 0x115c2, 0x115c5,
- 0x115c9, 0x115d7,
- 0x11641, 0x11642,
- 0x1173c, 0x1173e,
- 0x11a42, 0x11a43,
- 0x11a9b, 0x11a9c,
- 0x11aa1, 0x11aa2,
- 0x11c41, 0x11c43,
- 0x11c71, 0x11c71,
- 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[] = {
- 134,
- 0x005e, 0x005e,
- 0x03d0, 0x03d2,
- 0x03d5, 0x03d5,
- 0x03f0, 0x03f1,
- 0x03f4, 0x03f5,
- 0x2016, 0x2016,
- 0x2032, 0x2034,
- 0x2040, 0x2040,
- 0x2061, 0x2064,
- 0x207d, 0x207e,
- 0x208d, 0x208e,
- 0x20d0, 0x20dc,
- 0x20e1, 0x20e1,
- 0x20e5, 0x20e6,
- 0x20eb, 0x20ef,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210a, 0x2113,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2128, 0x2129,
- 0x212c, 0x212d,
- 0x212f, 0x2131,
- 0x2133, 0x2138,
- 0x213c, 0x213f,
- 0x2145, 0x2149,
- 0x2195, 0x2199,
- 0x219c, 0x219f,
- 0x21a1, 0x21a2,
- 0x21a4, 0x21a5,
- 0x21a7, 0x21a7,
- 0x21a9, 0x21ad,
- 0x21b0, 0x21b1,
- 0x21b6, 0x21b7,
- 0x21bc, 0x21cd,
- 0x21d0, 0x21d1,
- 0x21d3, 0x21d3,
- 0x21d5, 0x21db,
- 0x21dd, 0x21dd,
- 0x21e4, 0x21e5,
- 0x2308, 0x230b,
- 0x23b4, 0x23b5,
- 0x23b7, 0x23b7,
- 0x23d0, 0x23d0,
- 0x23e2, 0x23e2,
- 0x25a0, 0x25a1,
- 0x25ae, 0x25b6,
- 0x25bc, 0x25c0,
- 0x25c6, 0x25c7,
- 0x25ca, 0x25cb,
- 0x25cf, 0x25d3,
- 0x25e2, 0x25e2,
- 0x25e4, 0x25e4,
- 0x25e7, 0x25ec,
- 0x2605, 0x2606,
- 0x2640, 0x2640,
- 0x2642, 0x2642,
- 0x2660, 0x2663,
- 0x266d, 0x266e,
- 0x27c5, 0x27c6,
- 0x27e6, 0x27ef,
- 0x2983, 0x2998,
- 0x29d8, 0x29db,
- 0x29fc, 0x29fd,
- 0xfe61, 0xfe61,
- 0xfe63, 0xfe63,
- 0xfe68, 0xfe68,
- 0xff3c, 0xff3c,
- 0xff3e, 0xff3e,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d6c0,
- 0x1d6c2, 0x1d6da,
- 0x1d6dc, 0x1d6fa,
- 0x1d6fc, 0x1d714,
- 0x1d716, 0x1d734,
- 0x1d736, 0x1d74e,
- 0x1d750, 0x1d76e,
- 0x1d770, 0x1d788,
- 0x1d78a, 0x1d7a8,
- 0x1d7aa, 0x1d7c2,
- 0x1d7c4, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
-}; /* CR_Other_Math */
-
-/* 'Hex_Digit': Binary Property */
-static const OnigCodePoint CR_Hex_Digit[] = {
- 6,
- 0x0030, 0x0039,
- 0x0041, 0x0046,
- 0x0061, 0x0066,
- 0xff10, 0xff19,
- 0xff21, 0xff26,
- 0xff41, 0xff46,
-}; /* CR_Hex_Digit */
-
-/* 'ASCII_Hex_Digit': Binary Property */
-#define CR_ASCII_Hex_Digit CR_XDigit
-
-/* 'Other_Alphabetic': Binary Property */
-static const OnigCodePoint CR_Other_Alphabetic[] = {
- 206,
- 0x0345, 0x0345,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x0610, 0x061a,
- 0x064b, 0x0657,
- 0x0659, 0x065f,
- 0x0670, 0x0670,
- 0x06d6, 0x06dc,
- 0x06e1, 0x06e4,
- 0x06e7, 0x06e8,
- 0x06ed, 0x06ed,
- 0x0711, 0x0711,
- 0x0730, 0x073f,
- 0x07a6, 0x07b0,
- 0x0816, 0x0817,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082c,
- 0x08d4, 0x08df,
- 0x08e3, 0x08e9,
- 0x08f0, 0x0903,
- 0x093a, 0x093b,
- 0x093e, 0x094c,
- 0x094e, 0x094f,
- 0x0955, 0x0957,
- 0x0962, 0x0963,
- 0x0981, 0x0983,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x09d7, 0x09d7,
- 0x09e2, 0x09e3,
- 0x0a01, 0x0a03,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4c,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0abe, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ae2, 0x0ae3,
- 0x0afa, 0x0afc,
- 0x0b01, 0x0b03,
- 0x0b3e, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b56, 0x0b57,
- 0x0b62, 0x0b63,
- 0x0b82, 0x0b82,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0bd7, 0x0bd7,
- 0x0c00, 0x0c03,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4c,
- 0x0c55, 0x0c56,
- 0x0c62, 0x0c63,
- 0x0c81, 0x0c83,
- 0x0cbe, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccc,
- 0x0cd5, 0x0cd6,
- 0x0ce2, 0x0ce3,
- 0x0d00, 0x0d03,
- 0x0d3e, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d57, 0x0d57,
- 0x0d62, 0x0d63,
- 0x0d82, 0x0d83,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e4d, 0x0e4d,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0eb9,
- 0x0ebb, 0x0ebc,
- 0x0ecd, 0x0ecd,
- 0x0f71, 0x0f81,
- 0x0f8d, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x102b, 0x1036,
- 0x1038, 0x1038,
- 0x103b, 0x103e,
- 0x1056, 0x1059,
- 0x105e, 0x1060,
- 0x1062, 0x1062,
- 0x1067, 0x1068,
- 0x1071, 0x1074,
- 0x1082, 0x1086,
- 0x109c, 0x109d,
- 0x135f, 0x135f,
- 0x1712, 0x1713,
- 0x1732, 0x1733,
- 0x1752, 0x1753,
- 0x1772, 0x1773,
- 0x17b6, 0x17c8,
- 0x1885, 0x1886,
- 0x18a9, 0x18a9,
- 0x1920, 0x192b,
- 0x1930, 0x1938,
- 0x1a17, 0x1a1b,
- 0x1a55, 0x1a5e,
- 0x1a61, 0x1a74,
- 0x1b00, 0x1b04,
- 0x1b35, 0x1b43,
- 0x1b80, 0x1b82,
- 0x1ba1, 0x1ba9,
- 0x1bac, 0x1bad,
- 0x1be7, 0x1bf1,
- 0x1c24, 0x1c35,
- 0x1cf2, 0x1cf3,
- 0x1de7, 0x1df4,
- 0x24b6, 0x24e9,
- 0x2de0, 0x2dff,
- 0xa674, 0xa67b,
- 0xa69e, 0xa69f,
- 0xa823, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 0xa926, 0xa92a,
- 0xa947, 0xa952,
- 0xa980, 0xa983,
- 0xa9b4, 0xa9bf,
- 0xaa29, 0xaa36,
- 0xaa43, 0xaa43,
- 0xaa4c, 0xaa4d,
- 0xaab0, 0xaab0,
- 0xaab2, 0xaab4,
- 0xaab7, 0xaab8,
- 0xaabe, 0xaabe,
- 0xaaeb, 0xaaef,
- 0xaaf5, 0xaaf5,
- 0xabe3, 0xabea,
- 0xfb1e, 0xfb1e,
- 0x10376, 0x1037a,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x11000, 0x11002,
- 0x11038, 0x11045,
- 0x11082, 0x11082,
- 0x110b0, 0x110b8,
- 0x11100, 0x11102,
- 0x11127, 0x11132,
- 0x11180, 0x11182,
- 0x111b3, 0x111bf,
- 0x1122c, 0x11234,
- 0x11237, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112e8,
- 0x11300, 0x11303,
- 0x1133e, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134c,
- 0x11357, 0x11357,
- 0x11362, 0x11363,
- 0x11435, 0x11441,
- 0x11443, 0x11445,
- 0x114b0, 0x114c1,
- 0x115af, 0x115b5,
- 0x115b8, 0x115be,
- 0x115dc, 0x115dd,
- 0x11630, 0x1163e,
- 0x11640, 0x11640,
- 0x116ab, 0x116b5,
- 0x1171d, 0x1172a,
- 0x11a01, 0x11a0a,
- 0x11a35, 0x11a39,
- 0x11a3b, 0x11a3e,
- 0x11a51, 0x11a5b,
- 0x11a8a, 0x11a97,
- 0x11c2f, 0x11c36,
- 0x11c38, 0x11c3e,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d31, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d41,
- 0x11d43, 0x11d43,
- 0x11d47, 0x11d47,
- 0x16b30, 0x16b36,
- 0x16f51, 0x16f7e,
- 0x1bc9e, 0x1bc9e,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e947, 0x1e947,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
-}; /* CR_Other_Alphabetic */
-
-/* 'Ideographic': Binary Property */
-static const OnigCodePoint CR_Ideographic[] = {
- 16,
- 0x3006, 0x3007,
- 0x3021, 0x3029,
- 0x3038, 0x303a,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b170, 0x1b2fb,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_Ideographic */
-
-/* 'Diacritic': Binary Property */
-static const OnigCodePoint CR_Diacritic[] = {
- 159,
- 0x005e, 0x005e,
- 0x0060, 0x0060,
- 0x00a8, 0x00a8,
- 0x00af, 0x00af,
- 0x00b4, 0x00b4,
- 0x00b7, 0x00b8,
- 0x02b0, 0x034e,
- 0x0350, 0x0357,
- 0x035d, 0x0362,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x0384, 0x0385,
- 0x0483, 0x0487,
- 0x0559, 0x0559,
- 0x0591, 0x05a1,
- 0x05a3, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c4,
- 0x064b, 0x0652,
- 0x0657, 0x0658,
- 0x06df, 0x06e0,
- 0x06e5, 0x06e6,
- 0x06ea, 0x06ec,
- 0x0730, 0x074a,
- 0x07a6, 0x07b0,
- 0x07eb, 0x07f5,
- 0x0818, 0x0819,
- 0x08e3, 0x08fe,
- 0x093c, 0x093c,
- 0x094d, 0x094d,
- 0x0951, 0x0954,
- 0x0971, 0x0971,
- 0x09bc, 0x09bc,
- 0x09cd, 0x09cd,
- 0x0a3c, 0x0a3c,
- 0x0a4d, 0x0a4d,
- 0x0abc, 0x0abc,
- 0x0acd, 0x0acd,
- 0x0afd, 0x0aff,
- 0x0b3c, 0x0b3c,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a788,
- 0xa7f8, 0xa7f9,
- 0xa8c4, 0xa8c4,
- 0xa8e0, 0xa8f1,
- 0xa92b, 0xa92e,
- 0xa953, 0xa953,
- 0xa9b3, 0xa9b3,
- 0xa9c0, 0xa9c0,
- 0xa9e5, 0xa9e5,
- 0xaa7b, 0xaa7d,
- 0xaabf, 0xaac2,
- 0xaaf6, 0xaaf6,
- 0xab5b, 0xab5f,
- 0xabec, 0xabed,
- 0xfb1e, 0xfb1e,
- 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,
- 0x11442, 0x11442,
- 0x11446, 0x11446,
- 0x114c2, 0x114c3,
- 0x115bf, 0x115c0,
- 0x1163f, 0x1163f,
- 0x116b6, 0x116b7,
- 0x1172b, 0x1172b,
- 0x11a34, 0x11a34,
- 0x11a47, 0x11a47,
- 0x11a99, 0x11a99,
- 0x11c3f, 0x11c3f,
- 0x11d42, 0x11d42,
- 0x11d44, 0x11d45,
- 0x16af0, 0x16af4,
- 0x16f8f, 0x16f9f,
- 0x1d167, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e946,
- 0x1e948, 0x1e94a,
-}; /* CR_Diacritic */
-
-/* 'Extender': Binary Property */
-static const OnigCodePoint CR_Extender[] = {
- 29,
- 0x00b7, 0x00b7,
- 0x02d0, 0x02d1,
- 0x0640, 0x0640,
- 0x07fa, 0x07fa,
- 0x0e46, 0x0e46,
- 0x0ec6, 0x0ec6,
- 0x180a, 0x180a,
- 0x1843, 0x1843,
- 0x1aa7, 0x1aa7,
- 0x1c36, 0x1c36,
- 0x1c7b, 0x1c7b,
- 0x3005, 0x3005,
- 0x3031, 0x3035,
- 0x309d, 0x309e,
- 0x30fc, 0x30fe,
- 0xa015, 0xa015,
- 0xa60c, 0xa60c,
- 0xa9cf, 0xa9cf,
- 0xa9e6, 0xa9e6,
- 0xaa70, 0xaa70,
- 0xaadd, 0xaadd,
- 0xaaf3, 0xaaf4,
- 0xff70, 0xff70,
- 0x1135d, 0x1135d,
- 0x115c6, 0x115c8,
- 0x11a98, 0x11a98,
- 0x16b42, 0x16b43,
- 0x16fe0, 0x16fe1,
- 0x1e944, 0x1e946,
-}; /* CR_Extender */
-
-/* 'Other_Lowercase': Binary Property */
-static const OnigCodePoint CR_Other_Lowercase[] = {
- 20,
- 0x00aa, 0x00aa,
- 0x00ba, 0x00ba,
- 0x02b0, 0x02b8,
- 0x02c0, 0x02c1,
- 0x02e0, 0x02e4,
- 0x0345, 0x0345,
- 0x037a, 0x037a,
- 0x1d2c, 0x1d6a,
- 0x1d78, 0x1d78,
- 0x1d9b, 0x1dbf,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 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[] = {
- 5,
- 0x2160, 0x216f,
- 0x24b6, 0x24cf,
- 0x1f130, 0x1f149,
- 0x1f150, 0x1f169,
- 0x1f170, 0x1f189,
-}; /* CR_Other_Uppercase */
-
-/* 'Noncharacter_Code_Point': Binary Property */
-static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
- 18,
- 0xfdd0, 0xfdef,
- 0xfffe, 0xffff,
- 0x1fffe, 0x1ffff,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xefffe, 0xeffff,
- 0xffffe, 0xfffff,
- 0x10fffe, 0x10ffff,
-}; /* CR_Noncharacter_Code_Point */
-
-/* 'Other_Grapheme_Extend': Binary Property */
-static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
- 23,
- 0x09be, 0x09be,
- 0x09d7, 0x09d7,
- 0x0b3e, 0x0b3e,
- 0x0b57, 0x0b57,
- 0x0bbe, 0x0bbe,
- 0x0bd7, 0x0bd7,
- 0x0cc2, 0x0cc2,
- 0x0cd5, 0x0cd6,
- 0x0d3e, 0x0d3e,
- 0x0d57, 0x0d57,
- 0x0dcf, 0x0dcf,
- 0x0ddf, 0x0ddf,
- 0x200c, 0x200c,
- 0x302e, 0x302f,
- 0xff9e, 0xff9f,
- 0x1133e, 0x1133e,
- 0x11357, 0x11357,
- 0x114b0, 0x114b0,
- 0x114bd, 0x114bd,
- 0x115af, 0x115af,
- 0x1d165, 0x1d165,
- 0x1d16e, 0x1d172,
- 0xe0020, 0xe007f,
-}; /* CR_Other_Grapheme_Extend */
-
-/* 'IDS_Binary_Operator': Binary Property */
-static const OnigCodePoint CR_IDS_Binary_Operator[] = {
- 2,
- 0x2ff0, 0x2ff1,
- 0x2ff4, 0x2ffb,
-}; /* CR_IDS_Binary_Operator */
-
-/* 'IDS_Trinary_Operator': Binary Property */
-static const OnigCodePoint CR_IDS_Trinary_Operator[] = {
- 1,
- 0x2ff2, 0x2ff3,
-}; /* CR_IDS_Trinary_Operator */
-
-/* 'Radical': Binary Property */
-static const OnigCodePoint CR_Radical[] = {
- 3,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
-}; /* CR_Radical */
-
-/* 'Unified_Ideograph': Binary Property */
-static const OnigCodePoint CR_Unified_Ideograph[] = {
- 14,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fea,
- 0xfa0e, 0xfa0f,
- 0xfa11, 0xfa11,
- 0xfa13, 0xfa14,
- 0xfa1f, 0xfa1f,
- 0xfa21, 0xfa21,
- 0xfa23, 0xfa24,
- 0xfa27, 0xfa29,
- 0x20000, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
-}; /* CR_Unified_Ideograph */
-
-/* 'Other_Default_Ignorable_Code_Point': Binary Property */
-static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
- 11,
- 0x034f, 0x034f,
- 0x115f, 0x1160,
- 0x17b4, 0x17b5,
- 0x2065, 0x2065,
- 0x3164, 0x3164,
- 0xffa0, 0xffa0,
- 0xfff0, 0xfff8,
- 0xe0000, 0xe0000,
- 0xe0002, 0xe001f,
- 0xe0080, 0xe00ff,
- 0xe01f0, 0xe0fff,
-}; /* CR_Other_Default_Ignorable_Code_Point */
-
-/* 'Deprecated': Binary Property */
-static const OnigCodePoint CR_Deprecated[] = {
- 8,
- 0x0149, 0x0149,
- 0x0673, 0x0673,
- 0x0f77, 0x0f77,
- 0x0f79, 0x0f79,
- 0x17a3, 0x17a4,
- 0x206a, 0x206f,
- 0x2329, 0x232a,
- 0xe0001, 0xe0001,
-}; /* CR_Deprecated */
-
-/* 'Soft_Dotted': Binary Property */
-static const OnigCodePoint CR_Soft_Dotted[] = {
- 31,
- 0x0069, 0x006a,
- 0x012f, 0x012f,
- 0x0249, 0x0249,
- 0x0268, 0x0268,
- 0x029d, 0x029d,
- 0x02b2, 0x02b2,
- 0x03f3, 0x03f3,
- 0x0456, 0x0456,
- 0x0458, 0x0458,
- 0x1d62, 0x1d62,
- 0x1d96, 0x1d96,
- 0x1da4, 0x1da4,
- 0x1da8, 0x1da8,
- 0x1e2d, 0x1e2d,
- 0x1ecb, 0x1ecb,
- 0x2071, 0x2071,
- 0x2148, 0x2149,
- 0x2c7c, 0x2c7c,
- 0x1d422, 0x1d423,
- 0x1d456, 0x1d457,
- 0x1d48a, 0x1d48b,
- 0x1d4be, 0x1d4bf,
- 0x1d4f2, 0x1d4f3,
- 0x1d526, 0x1d527,
- 0x1d55a, 0x1d55b,
- 0x1d58e, 0x1d58f,
- 0x1d5c2, 0x1d5c3,
- 0x1d5f6, 0x1d5f7,
- 0x1d62a, 0x1d62b,
- 0x1d65e, 0x1d65f,
- 0x1d692, 0x1d693,
-}; /* CR_Soft_Dotted */
-
-/* 'Logical_Order_Exception': Binary Property */
-static const OnigCodePoint CR_Logical_Order_Exception[] = {
- 7,
- 0x0e40, 0x0e44,
- 0x0ec0, 0x0ec4,
- 0x19b5, 0x19b7,
- 0x19ba, 0x19ba,
- 0xaab5, 0xaab6,
- 0xaab9, 0xaab9,
- 0xaabb, 0xaabc,
-}; /* CR_Logical_Order_Exception */
-
-/* 'Other_ID_Start': Binary Property */
-static const OnigCodePoint CR_Other_ID_Start[] = {
- 4,
- 0x1885, 0x1886,
- 0x2118, 0x2118,
- 0x212e, 0x212e,
- 0x309b, 0x309c,
-}; /* CR_Other_ID_Start */
-
-/* 'Other_ID_Continue': Binary Property */
-static const OnigCodePoint CR_Other_ID_Continue[] = {
- 4,
- 0x00b7, 0x00b7,
- 0x0387, 0x0387,
- 0x1369, 0x1371,
- 0x19da, 0x19da,
-}; /* CR_Other_ID_Continue */
-
-/* 'Sentence_Terminal': Binary Property */
-static const OnigCodePoint CR_Sentence_Terminal[] = {
- 68,
- 0x0021, 0x0021,
- 0x002e, 0x002e,
- 0x003f, 0x003f,
- 0x0589, 0x0589,
- 0x061f, 0x061f,
- 0x06d4, 0x06d4,
- 0x0700, 0x0702,
- 0x07f9, 0x07f9,
- 0x0964, 0x0965,
- 0x104a, 0x104b,
- 0x1362, 0x1362,
- 0x1367, 0x1368,
- 0x166e, 0x166e,
- 0x1735, 0x1736,
- 0x1803, 0x1803,
- 0x1809, 0x1809,
- 0x1944, 0x1945,
- 0x1aa8, 0x1aab,
- 0x1b5a, 0x1b5b,
- 0x1b5e, 0x1b5f,
- 0x1c3b, 0x1c3c,
- 0x1c7e, 0x1c7f,
- 0x203c, 0x203d,
- 0x2047, 0x2049,
- 0x2e2e, 0x2e2e,
- 0x2e3c, 0x2e3c,
- 0x3002, 0x3002,
- 0xa4ff, 0xa4ff,
- 0xa60e, 0xa60f,
- 0xa6f3, 0xa6f3,
- 0xa6f7, 0xa6f7,
- 0xa876, 0xa877,
- 0xa8ce, 0xa8cf,
- 0xa92f, 0xa92f,
- 0xa9c8, 0xa9c9,
- 0xaa5d, 0xaa5f,
- 0xaaf0, 0xaaf1,
- 0xabeb, 0xabeb,
- 0xfe52, 0xfe52,
- 0xfe56, 0xfe57,
- 0xff01, 0xff01,
- 0xff0e, 0xff0e,
- 0xff1f, 0xff1f,
- 0xff61, 0xff61,
- 0x10a56, 0x10a57,
- 0x11047, 0x11048,
- 0x110be, 0x110c1,
- 0x11141, 0x11143,
- 0x111c5, 0x111c6,
- 0x111cd, 0x111cd,
- 0x111de, 0x111df,
- 0x11238, 0x11239,
- 0x1123b, 0x1123c,
- 0x112a9, 0x112a9,
- 0x1144b, 0x1144c,
- 0x115c2, 0x115c3,
- 0x115c9, 0x115d7,
- 0x11641, 0x11642,
- 0x1173c, 0x1173e,
- 0x11a42, 0x11a43,
- 0x11a9b, 0x11a9c,
- 0x11c41, 0x11c42,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b38,
- 0x16b44, 0x16b44,
- 0x1bc9f, 0x1bc9f,
- 0x1da88, 0x1da88,
-}; /* CR_Sentence_Terminal */
-
-/* 'Variation_Selector': Binary Property */
-static const OnigCodePoint CR_Variation_Selector[] = {
- 3,
- 0x180b, 0x180d,
- 0xfe00, 0xfe0f,
- 0xe0100, 0xe01ef,
-}; /* CR_Variation_Selector */
-
-/* 'Pattern_White_Space': Binary Property */
-static const OnigCodePoint CR_Pattern_White_Space[] = {
- 5,
- 0x0009, 0x000d,
- 0x0020, 0x0020,
- 0x0085, 0x0085,
- 0x200e, 0x200f,
- 0x2028, 0x2029,
-}; /* CR_Pattern_White_Space */
-
-/* 'Pattern_Syntax': Binary Property */
-static const OnigCodePoint CR_Pattern_Syntax[] = {
- 28,
- 0x0021, 0x002f,
- 0x003a, 0x0040,
- 0x005b, 0x005e,
- 0x0060, 0x0060,
- 0x007b, 0x007e,
- 0x00a1, 0x00a7,
- 0x00a9, 0x00a9,
- 0x00ab, 0x00ac,
- 0x00ae, 0x00ae,
- 0x00b0, 0x00b1,
- 0x00b6, 0x00b6,
- 0x00bb, 0x00bb,
- 0x00bf, 0x00bf,
- 0x00d7, 0x00d7,
- 0x00f7, 0x00f7,
- 0x2010, 0x2027,
- 0x2030, 0x203e,
- 0x2041, 0x2053,
- 0x2055, 0x205e,
- 0x2190, 0x245f,
- 0x2500, 0x2775,
- 0x2794, 0x2bff,
- 0x2e00, 0x2e7f,
- 0x3001, 0x3003,
- 0x3008, 0x3020,
- 0x3030, 0x3030,
- 0xfd3e, 0xfd3f,
- 0xfe45, 0xfe46,
-}; /* CR_Pattern_Syntax */
-
-/* 'Prepended_Concatenation_Mark': Binary Property */
-static const OnigCodePoint CR_Prepended_Concatenation_Mark[] = {
- 5,
- 0x0600, 0x0605,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x08e2, 0x08e2,
- 0x110bd, 0x110bd,
-}; /* CR_Prepended_Concatenation_Mark */
-
-/* 'Regional_Indicator': Binary Property */
-static const OnigCodePoint CR_Regional_Indicator[] = {
- 1,
- 0x1f1e6, 0x1f1ff,
-}; /* CR_Regional_Indicator */
-
-/* 'Emoji': Emoji */
-static const OnigCodePoint CR_Emoji[] = {
- 145,
- 0x0023, 0x0023,
- 0x002a, 0x002a,
- 0x0030, 0x0039,
- 0x00a9, 0x00a9,
- 0x00ae, 0x00ae,
- 0x203c, 0x203c,
- 0x2049, 0x2049,
- 0x2122, 0x2122,
- 0x2139, 0x2139,
- 0x2194, 0x2199,
- 0x21a9, 0x21aa,
- 0x231a, 0x231b,
- 0x2328, 0x2328,
- 0x23cf, 0x23cf,
- 0x23e9, 0x23f3,
- 0x23f8, 0x23fa,
- 0x24c2, 0x24c2,
- 0x25aa, 0x25ab,
- 0x25b6, 0x25b6,
- 0x25c0, 0x25c0,
- 0x25fb, 0x25fe,
- 0x2600, 0x2604,
- 0x260e, 0x260e,
- 0x2611, 0x2611,
- 0x2614, 0x2615,
- 0x2618, 0x2618,
- 0x261d, 0x261d,
- 0x2620, 0x2620,
- 0x2622, 0x2623,
- 0x2626, 0x2626,
- 0x262a, 0x262a,
- 0x262e, 0x262f,
- 0x2638, 0x263a,
- 0x2640, 0x2640,
- 0x2642, 0x2642,
- 0x2648, 0x2653,
- 0x2660, 0x2660,
- 0x2663, 0x2663,
- 0x2665, 0x2666,
- 0x2668, 0x2668,
- 0x267b, 0x267b,
- 0x267f, 0x267f,
- 0x2692, 0x2697,
- 0x2699, 0x2699,
- 0x269b, 0x269c,
- 0x26a0, 0x26a1,
- 0x26aa, 0x26ab,
- 0x26b0, 0x26b1,
- 0x26bd, 0x26be,
- 0x26c4, 0x26c5,
- 0x26c8, 0x26c8,
- 0x26ce, 0x26cf,
- 0x26d1, 0x26d1,
- 0x26d3, 0x26d4,
- 0x26e9, 0x26ea,
- 0x26f0, 0x26f5,
- 0x26f7, 0x26fa,
- 0x26fd, 0x26fd,
- 0x2702, 0x2702,
- 0x2705, 0x2705,
- 0x2708, 0x270d,
- 0x270f, 0x270f,
- 0x2712, 0x2712,
- 0x2714, 0x2714,
- 0x2716, 0x2716,
- 0x271d, 0x271d,
- 0x2721, 0x2721,
- 0x2728, 0x2728,
- 0x2733, 0x2734,
- 0x2744, 0x2744,
- 0x2747, 0x2747,
- 0x274c, 0x274c,
- 0x274e, 0x274e,
- 0x2753, 0x2755,
- 0x2757, 0x2757,
- 0x2763, 0x2764,
- 0x2795, 0x2797,
- 0x27a1, 0x27a1,
- 0x27b0, 0x27b0,
- 0x27bf, 0x27bf,
- 0x2934, 0x2935,
- 0x2b05, 0x2b07,
- 0x2b1b, 0x2b1c,
- 0x2b50, 0x2b50,
- 0x2b55, 0x2b55,
- 0x3030, 0x3030,
- 0x303d, 0x303d,
- 0x3297, 0x3297,
- 0x3299, 0x3299,
- 0x1f004, 0x1f004,
- 0x1f0cf, 0x1f0cf,
- 0x1f170, 0x1f171,
- 0x1f17e, 0x1f17f,
- 0x1f18e, 0x1f18e,
- 0x1f191, 0x1f19a,
- 0x1f1e6, 0x1f1ff,
- 0x1f201, 0x1f202,
- 0x1f21a, 0x1f21a,
- 0x1f22f, 0x1f22f,
- 0x1f232, 0x1f23a,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f321,
- 0x1f324, 0x1f393,
- 0x1f396, 0x1f397,
- 0x1f399, 0x1f39b,
- 0x1f39e, 0x1f3f0,
- 0x1f3f3, 0x1f3f5,
- 0x1f3f7, 0x1f4fd,
- 0x1f4ff, 0x1f53d,
- 0x1f549, 0x1f54e,
- 0x1f550, 0x1f567,
- 0x1f56f, 0x1f570,
- 0x1f573, 0x1f57a,
- 0x1f587, 0x1f587,
- 0x1f58a, 0x1f58d,
- 0x1f590, 0x1f590,
- 0x1f595, 0x1f596,
- 0x1f5a4, 0x1f5a5,
- 0x1f5a8, 0x1f5a8,
- 0x1f5b1, 0x1f5b2,
- 0x1f5bc, 0x1f5bc,
- 0x1f5c2, 0x1f5c4,
- 0x1f5d1, 0x1f5d3,
- 0x1f5dc, 0x1f5de,
- 0x1f5e1, 0x1f5e1,
- 0x1f5e3, 0x1f5e3,
- 0x1f5e8, 0x1f5e8,
- 0x1f5ef, 0x1f5ef,
- 0x1f5f3, 0x1f5f3,
- 0x1f5fa, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f6cb, 0x1f6d2,
- 0x1f6e0, 0x1f6e5,
- 0x1f6e9, 0x1f6e9,
- 0x1f6eb, 0x1f6ec,
- 0x1f6f0, 0x1f6f0,
- 0x1f6f3, 0x1f6f8,
- 0x1f910, 0x1f93a,
- 0x1f93c, 0x1f93e,
- 0x1f940, 0x1f945,
- 0x1f947, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
-}; /* CR_Emoji */
-
-/* 'Emoji_Presentation': Emoji */
-static const OnigCodePoint CR_Emoji_Presentation[] = {
- 75,
- 0x231a, 0x231b,
- 0x23e9, 0x23ec,
- 0x23f0, 0x23f0,
- 0x23f3, 0x23f3,
- 0x25fd, 0x25fe,
- 0x2614, 0x2615,
- 0x2648, 0x2653,
- 0x267f, 0x267f,
- 0x2693, 0x2693,
- 0x26a1, 0x26a1,
- 0x26aa, 0x26ab,
- 0x26bd, 0x26be,
- 0x26c4, 0x26c5,
- 0x26ce, 0x26ce,
- 0x26d4, 0x26d4,
- 0x26ea, 0x26ea,
- 0x26f2, 0x26f3,
- 0x26f5, 0x26f5,
- 0x26fa, 0x26fa,
- 0x26fd, 0x26fd,
- 0x2705, 0x2705,
- 0x270a, 0x270b,
- 0x2728, 0x2728,
- 0x274c, 0x274c,
- 0x274e, 0x274e,
- 0x2753, 0x2755,
- 0x2757, 0x2757,
- 0x2795, 0x2797,
- 0x27b0, 0x27b0,
- 0x27bf, 0x27bf,
- 0x2b1b, 0x2b1c,
- 0x2b50, 0x2b50,
- 0x2b55, 0x2b55,
- 0x1f004, 0x1f004,
- 0x1f0cf, 0x1f0cf,
- 0x1f18e, 0x1f18e,
- 0x1f191, 0x1f19a,
- 0x1f1e6, 0x1f1ff,
- 0x1f201, 0x1f201,
- 0x1f21a, 0x1f21a,
- 0x1f22f, 0x1f22f,
- 0x1f232, 0x1f236,
- 0x1f238, 0x1f23a,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f32d, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f37e, 0x1f393,
- 0x1f3a0, 0x1f3ca,
- 0x1f3cf, 0x1f3d3,
- 0x1f3e0, 0x1f3f0,
- 0x1f3f4, 0x1f3f4,
- 0x1f3f8, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4fc,
- 0x1f4ff, 0x1f53d,
- 0x1f54b, 0x1f54e,
- 0x1f550, 0x1f567,
- 0x1f57a, 0x1f57a,
- 0x1f595, 0x1f596,
- 0x1f5a4, 0x1f5a4,
- 0x1f5fb, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f6cc, 0x1f6cc,
- 0x1f6d0, 0x1f6d2,
- 0x1f6eb, 0x1f6ec,
- 0x1f6f4, 0x1f6f8,
- 0x1f910, 0x1f93a,
- 0x1f93c, 0x1f93e,
- 0x1f940, 0x1f945,
- 0x1f947, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
-}; /* CR_Emoji_Presentation */
-
-/* 'Emoji_Modifier': Emoji */
-static const OnigCodePoint CR_Emoji_Modifier[] = {
- 1,
- 0x1f3fb, 0x1f3ff,
-}; /* CR_Emoji_Modifier */
-
-/* 'Emoji_Modifier_Base': Emoji */
-static const OnigCodePoint CR_Emoji_Modifier_Base[] = {
- 32,
- 0x261d, 0x261d,
- 0x26f9, 0x26f9,
- 0x270a, 0x270d,
- 0x1f385, 0x1f385,
- 0x1f3c2, 0x1f3c4,
- 0x1f3c7, 0x1f3c7,
- 0x1f3ca, 0x1f3cc,
- 0x1f442, 0x1f443,
- 0x1f446, 0x1f450,
- 0x1f466, 0x1f469,
- 0x1f46e, 0x1f46e,
- 0x1f470, 0x1f478,
- 0x1f47c, 0x1f47c,
- 0x1f481, 0x1f483,
- 0x1f485, 0x1f487,
- 0x1f4aa, 0x1f4aa,
- 0x1f574, 0x1f575,
- 0x1f57a, 0x1f57a,
- 0x1f590, 0x1f590,
- 0x1f595, 0x1f596,
- 0x1f645, 0x1f647,
- 0x1f64b, 0x1f64f,
- 0x1f6a3, 0x1f6a3,
- 0x1f6b4, 0x1f6b6,
- 0x1f6c0, 0x1f6c0,
- 0x1f6cc, 0x1f6cc,
- 0x1f918, 0x1f91c,
- 0x1f91e, 0x1f91f,
- 0x1f926, 0x1f926,
- 0x1f930, 0x1f939,
- 0x1f93d, 0x1f93e,
- 0x1f9d1, 0x1f9dd,
-}; /* CR_Emoji_Modifier_Base */
-
-/* 'Emoji_Component': Emoji */
-static const OnigCodePoint CR_Emoji_Component[] = {
- 5,
- 0x0023, 0x0023,
- 0x002a, 0x002a,
- 0x0030, 0x0039,
- 0x1f1e6, 0x1f1ff,
- 0x1f3fb, 0x1f3ff,
-}; /* CR_Emoji_Component */
-
-/* 'Unknown': Script */
-static const OnigCodePoint CR_Unknown[] = {
- 647,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x0560, 0x0560,
- 0x0588, 0x0588,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ef,
- 0x05f5, 0x05ff,
- 0x061d, 0x061d,
- 0x070e, 0x070e,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07ff,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d3,
- 0x0984, 0x0984,
- 0x098d, 0x098e,
- 0x0991, 0x0992,
- 0x09a9, 0x09a9,
- 0x09b1, 0x09b1,
- 0x09b3, 0x09b5,
- 0x09ba, 0x09bb,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ea0,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 0x0ea8, 0x0ea9,
- 0x0eac, 0x0eac,
- 0x0eba, 0x0eba,
- 0x0ebe, 0x0ebf,
- 0x0ec5, 0x0ec5,
- 0x0ec7, 0x0ec7,
- 0x0ece, 0x0ecf,
- 0x0eda, 0x0edb,
- 0x0ee0, 0x0eff,
- 0x0f48, 0x0f48,
- 0x0f6d, 0x0f70,
- 0x0f98, 0x0f98,
- 0x0fbd, 0x0fbd,
- 0x0fcd, 0x0fcd,
- 0x0fdb, 0x0fff,
- 0x10c6, 0x10c6,
- 0x10c8, 0x10cc,
- 0x10ce, 0x10cf,
- 0x1249, 0x1249,
- 0x124e, 0x124f,
- 0x1257, 0x1257,
- 0x1259, 0x1259,
- 0x125e, 0x125f,
- 0x1289, 0x1289,
- 0x128e, 0x128f,
- 0x12b1, 0x12b1,
- 0x12b6, 0x12b7,
- 0x12bf, 0x12bf,
- 0x12c1, 0x12c1,
- 0x12c6, 0x12c7,
- 0x12d7, 0x12d7,
- 0x1311, 0x1311,
- 0x1316, 0x1317,
- 0x135b, 0x135c,
- 0x137d, 0x137f,
- 0x139a, 0x139f,
- 0x13f6, 0x13f7,
- 0x13fe, 0x13ff,
- 0x169d, 0x169f,
- 0x16f9, 0x16ff,
- 0x170d, 0x170d,
- 0x1715, 0x171f,
- 0x1737, 0x173f,
- 0x1754, 0x175f,
- 0x176d, 0x176d,
- 0x1771, 0x1771,
- 0x1774, 0x177f,
- 0x17de, 0x17df,
- 0x17ea, 0x17ef,
- 0x17fa, 0x17ff,
- 0x180f, 0x180f,
- 0x181a, 0x181f,
- 0x1878, 0x187f,
- 0x18ab, 0x18af,
- 0x18f6, 0x18ff,
- 0x191f, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196e, 0x196f,
- 0x1975, 0x197f,
- 0x19ac, 0x19af,
- 0x19ca, 0x19cf,
- 0x19db, 0x19dd,
- 0x1a1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,
- 0x2dcf, 0x2dcf,
- 0x2dd7, 0x2dd7,
- 0x2ddf, 0x2ddf,
- 0x2e4a, 0x2e7f,
- 0x2e9a, 0x2e9a,
- 0x2ef4, 0x2eff,
- 0x2fd6, 0x2fef,
- 0x2ffc, 0x2fff,
- 0x3040, 0x3040,
- 0x3097, 0x3098,
- 0x3100, 0x3104,
- 0x312f, 0x3130,
- 0x318f, 0x318f,
- 0x31bb, 0x31bf,
- 0x31e4, 0x31ef,
- 0x321f, 0x321f,
- 0x32ff, 0x32ff,
- 0x4db6, 0x4dbf,
- 0x9feb, 0x9fff,
- 0xa48d, 0xa48f,
- 0xa4c7, 0xa4cf,
- 0xa62c, 0xa63f,
- 0xa6f8, 0xa6ff,
- 0xa7af, 0xa7af,
- 0xa7b8, 0xa7f6,
- 0xa82c, 0xa82f,
- 0xa83a, 0xa83f,
- 0xa878, 0xa87f,
- 0xa8c6, 0xa8cd,
- 0xa8da, 0xa8df,
- 0xa8fe, 0xa8ff,
- 0xa954, 0xa95e,
- 0xa97d, 0xa97f,
- 0xa9ce, 0xa9ce,
- 0xa9da, 0xa9dd,
- 0xa9ff, 0xa9ff,
- 0xaa37, 0xaa3f,
- 0xaa4e, 0xaa4f,
- 0xaa5a, 0xaa5b,
- 0xaac3, 0xaada,
- 0xaaf7, 0xab00,
- 0xab07, 0xab08,
- 0xab0f, 0xab10,
- 0xab17, 0xab1f,
- 0xab27, 0xab27,
- 0xab2f, 0xab2f,
- 0xab66, 0xab6f,
- 0xabee, 0xabef,
- 0xabfa, 0xabff,
- 0xd7a4, 0xd7af,
- 0xd7c7, 0xd7ca,
- 0xd7fc, 0xf8ff,
- 0xfa6e, 0xfa6f,
- 0xfada, 0xfaff,
- 0xfb07, 0xfb12,
- 0xfb18, 0xfb1c,
- 0xfb37, 0xfb37,
- 0xfb3d, 0xfb3d,
- 0xfb3f, 0xfb3f,
- 0xfb42, 0xfb42,
- 0xfb45, 0xfb45,
- 0xfbc2, 0xfbd2,
- 0xfd40, 0xfd4f,
- 0xfd90, 0xfd91,
- 0xfdc8, 0xfdef,
- 0xfdfe, 0xfdff,
- 0xfe1a, 0xfe1f,
- 0xfe53, 0xfe53,
- 0xfe67, 0xfe67,
- 0xfe6c, 0xfe6f,
- 0xfe75, 0xfe75,
- 0xfefd, 0xfefe,
- 0xff00, 0xff00,
- 0xffbf, 0xffc1,
- 0xffc8, 0xffc9,
- 0xffd0, 0xffd1,
- 0xffd8, 0xffd9,
- 0xffdd, 0xffdf,
- 0xffe7, 0xffe7,
- 0xffef, 0xfff8,
- 0xfffe, 0xffff,
- 0x1000c, 0x1000c,
- 0x10027, 0x10027,
- 0x1003b, 0x1003b,
- 0x1003e, 0x1003e,
- 0x1004e, 0x1004f,
- 0x1005e, 0x1007f,
- 0x100fb, 0x100ff,
- 0x10103, 0x10106,
- 0x10134, 0x10136,
- 0x1018f, 0x1018f,
- 0x1019c, 0x1019f,
- 0x101a1, 0x101cf,
- 0x101fe, 0x1027f,
- 0x1029d, 0x1029f,
- 0x102d1, 0x102df,
- 0x102fc, 0x102ff,
- 0x10324, 0x1032c,
- 0x1034b, 0x1034f,
- 0x1037b, 0x1037f,
- 0x1039e, 0x1039e,
- 0x103c4, 0x103c7,
- 0x103d6, 0x103ff,
- 0x1049e, 0x1049f,
- 0x104aa, 0x104af,
- 0x104d4, 0x104d7,
- 0x104fc, 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,
- 0x1089f, 0x108a6,
- 0x108b0, 0x108df,
- 0x108f3, 0x108f3,
- 0x108f6, 0x108fa,
- 0x1091c, 0x1091e,
- 0x1093a, 0x1093e,
- 0x10940, 0x1097f,
- 0x109b8, 0x109bb,
- 0x109d0, 0x109d1,
- 0x10a04, 0x10a04,
- 0x10a07, 0x10a0b,
- 0x10a14, 0x10a14,
- 0x10a18, 0x10a18,
- 0x10a34, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a48, 0x10a4f,
- 0x10a59, 0x10a5f,
- 0x10aa0, 0x10abf,
- 0x10ae7, 0x10aea,
- 0x10af7, 0x10aff,
- 0x10b36, 0x10b38,
- 0x10b56, 0x10b57,
- 0x10b73, 0x10b77,
- 0x10b92, 0x10b98,
- 0x10b9d, 0x10ba8,
- 0x10bb0, 0x10bff,
- 0x10c49, 0x10c7f,
- 0x10cb3, 0x10cbf,
- 0x10cf3, 0x10cf9,
- 0x10d00, 0x10e5f,
- 0x10e7f, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110c2, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11144, 0x1114f,
- 0x11177, 0x1117f,
- 0x111ce, 0x111cf,
- 0x111e0, 0x111e0,
- 0x111f5, 0x111ff,
- 0x11212, 0x11212,
- 0x1123f, 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, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x1145e, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b8, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171a, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x119ff,
- 0x11a48, 0x11a4f,
- 0x11a84, 0x11a85,
- 0x11a9d, 0x11a9d,
- 0x11aa3, 0x11abf,
- 0x11af9, 0x11bff,
- 0x11c09, 0x11c09,
- 0x11c37, 0x11c37,
- 0x11c46, 0x11c4f,
- 0x11c6d, 0x11c6f,
- 0x11c90, 0x11c91,
- 0x11ca8, 0x11ca8,
- 0x11cb7, 0x11cff,
- 0x11d07, 0x11d07,
- 0x11d0a, 0x11d0a,
- 0x11d37, 0x11d39,
- 0x11d3b, 0x11d3b,
- 0x11d3e, 0x11d3e,
- 0x11d48, 0x11d4f,
- 0x11d5a, 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, 0x16fdf,
- 0x16fe2, 0x16fff,
- 0x187ed, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca4, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d128,
- 0x1d1e9, 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; /* CR_Unknown */
-
-#ifdef USE_UNICODE_AGE_PROPERTIES
-/* 'Age_1_1': Derived Age 1.1 */
-static const OnigCodePoint CR_Age_1_1[] = {
- 288,
- 0x0000, 0x01f5,
- 0x01fa, 0x0217,
- 0x0250, 0x02a8,
- 0x02b0, 0x02de,
- 0x02e0, 0x02e9,
- 0x0300, 0x0345,
- 0x0360, 0x0361,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03d6,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03f3,
- 0x0401, 0x040c,
- 0x040e, 0x044f,
- 0x0451, 0x045c,
- 0x045e, 0x0486,
- 0x0490, 0x04c4,
- 0x04c7, 0x04c8,
- 0x04cb, 0x04cc,
- 0x04d0, 0x04eb,
- 0x04ee, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x0589,
- 0x05b0, 0x05b9,
- 0x05bb, 0x05c3,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0652,
- 0x0660, 0x066d,
- 0x0670, 0x06b7,
- 0x06ba, 0x06be,
- 0x06c0, 0x06ce,
- 0x06d0, 0x06ed,
- 0x06f0, 0x06f9,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 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c, 0x0edd,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10f6,
- 0x10fb, 0x10fb,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1e00, 0x1e9a,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x202e,
- 0x2030, 0x2046,
- 0x206a, 0x2070,
- 0x2074, 0x208e,
- 0x20a0, 0x20aa,
- 0x20d0, 0x20e1,
- 0x2100, 0x2138,
- 0x2153, 0x2182,
- 0x2190, 0x21ea,
- 0x2200, 0x22f1,
- 0x2300, 0x2300,
- 0x2302, 0x237a,
- 0x2400, 0x2424,
- 0x2440, 0x244a,
- 0x2460, 0x24ea,
- 0x2500, 0x2595,
- 0x25a0, 0x25ef,
- 0x2600, 0x2613,
- 0x261a, 0x266f,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2776, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x3000, 0x3037,
- 0x303f, 0x303f,
- 0x3041, 0x3094,
- 0x3099, 0x309e,
- 0x30a1, 0x30fe,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x319f,
- 0x3200, 0x321c,
- 0x3220, 0x3243,
- 0x3260, 0x327b,
- 0x327f, 0x32b0,
- 0x32c0, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x4e00, 0x9fa5,
- 0xe000, 0xfa2d,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1e, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe44,
- 0xfe49, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe72,
- 0xfe74, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xff5e,
- 0xff61, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfffd, 0xffff,
-}; /* CR_Age_1_1 */
-
-/* 'Age_2_0': Derived Age 2.0 */
-static const OnigCodePoint CR_Age_2_0[] = {
- 312,
- 0x0000, 0x01f5,
- 0x01fa, 0x0217,
- 0x0250, 0x02a8,
- 0x02b0, 0x02de,
- 0x02e0, 0x02e9,
- 0x0300, 0x0345,
- 0x0360, 0x0361,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03d6,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03f3,
- 0x0401, 0x040c,
- 0x040e, 0x044f,
- 0x0451, 0x045c,
- 0x045e, 0x0486,
- 0x0490, 0x04c4,
- 0x04c7, 0x04c8,
- 0x04cb, 0x04cc,
- 0x04d0, 0x04eb,
- 0x04ee, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x0589,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0652,
- 0x0660, 0x066d,
- 0x0670, 0x06b7,
- 0x06ba, 0x06be,
- 0x06c0, 0x06ce,
- 0x06d0, 0x06ed,
- 0x06f0, 0x06f9,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a02, 0x0a02,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8b,
- 0x0a8d, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 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, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x202e,
- 0x2030, 0x2046,
- 0x206a, 0x2070,
- 0x2074, 0x208e,
- 0x20a0, 0x20ab,
- 0x20d0, 0x20e1,
- 0x2100, 0x2138,
- 0x2153, 0x2182,
- 0x2190, 0x21ea,
- 0x2200, 0x22f1,
- 0x2300, 0x2300,
- 0x2302, 0x237a,
- 0x2400, 0x2424,
- 0x2440, 0x244a,
- 0x2460, 0x24ea,
- 0x2500, 0x2595,
- 0x25a0, 0x25ef,
- 0x2600, 0x2613,
- 0x261a, 0x266f,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2776, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x3000, 0x3037,
- 0x303f, 0x303f,
- 0x3041, 0x3094,
- 0x3099, 0x309e,
- 0x30a1, 0x30fe,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x319f,
- 0x3200, 0x321c,
- 0x3220, 0x3243,
- 0x3260, 0x327b,
- 0x327f, 0x32b0,
- 0x32c0, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x4e00, 0x9fa5,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1e, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe44,
- 0xfe49, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe72,
- 0xfe74, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xff5e,
- 0xff61, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfffd, 0xffff,
- 0x1fffe, 0x1ffff,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_2_0 */
-
-/* 'Age_2_1': Derived Age 2.1 */
-static const OnigCodePoint CR_Age_2_1[] = {
- 312,
- 0x0000, 0x01f5,
- 0x01fa, 0x0217,
- 0x0250, 0x02a8,
- 0x02b0, 0x02de,
- 0x02e0, 0x02e9,
- 0x0300, 0x0345,
- 0x0360, 0x0361,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03d6,
- 0x03da, 0x03da,
- 0x03dc, 0x03dc,
- 0x03de, 0x03de,
- 0x03e0, 0x03e0,
- 0x03e2, 0x03f3,
- 0x0401, 0x040c,
- 0x040e, 0x044f,
- 0x0451, 0x045c,
- 0x045e, 0x0486,
- 0x0490, 0x04c4,
- 0x04c7, 0x04c8,
- 0x04cb, 0x04cc,
- 0x04d0, 0x04eb,
- 0x04ee, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x0589,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0652,
- 0x0660, 0x066d,
- 0x0670, 0x06b7,
- 0x06ba, 0x06be,
- 0x06c0, 0x06ce,
- 0x06d0, 0x06ed,
- 0x06f0, 0x06f9,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a02, 0x0a02,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8b,
- 0x0a8d, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2,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6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x202e,
- 0x2030, 0x2046,
- 0x206a, 0x2070,
- 0x2074, 0x208e,
- 0x20a0, 0x20ac,
- 0x20d0, 0x20e1,
- 0x2100, 0x2138,
- 0x2153, 0x2182,
- 0x2190, 0x21ea,
- 0x2200, 0x22f1,
- 0x2300, 0x2300,
- 0x2302, 0x237a,
- 0x2400, 0x2424,
- 0x2440, 0x244a,
- 0x2460, 0x24ea,
- 0x2500, 0x2595,
- 0x25a0, 0x25ef,
- 0x2600, 0x2613,
- 0x261a, 0x266f,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2776, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x3000, 0x3037,
- 0x303f, 0x303f,
- 0x3041, 0x3094,
- 0x3099, 0x309e,
- 0x30a1, 0x30fe,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x319f,
- 0x3200, 0x321c,
- 0x3220, 0x3243,
- 0x3260, 0x327b,
- 0x327f, 0x32b0,
- 0x32c0, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x4e00, 0x9fa5,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1e, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe44,
- 0xfe49, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe72,
- 0xfe74, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xff5e,
- 0xff61, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfffc, 0xffff,
- 0x1fffe, 0x1ffff,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_2_1 */
-
-/* 'Age_3_0': Derived Age 3.0 */
-static const OnigCodePoint CR_Age_3_0[] = {
- 369,
- 0x0000, 0x021f,
- 0x0222, 0x0233,
- 0x0250, 0x02ad,
- 0x02b0, 0x02ee,
- 0x0300, 0x034e,
- 0x0360, 0x0362,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03d7,
- 0x03da, 0x03f3,
- 0x0400, 0x0486,
- 0x0488, 0x0489,
- 0x048c, 0x04c4,
- 0x04c7, 0x04c8,
- 0x04cb, 0x04cc,
- 0x04d0, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0655,
- 0x0660, 0x066d,
- 0x0670, 0x06ed,
- 0x06f0, 0x06fe,
- 0x0700, 0x070d,
- 0x070f, 0x072c,
- 0x0730, 0x074a,
- 0x0780, 0x07b0,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a02, 0x0a02,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8b,
- 0x0a8d, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae0,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
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, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d60, 0x0d61,
- 0x0d66, 0x0d6f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fcf,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10f6,
- 0x10fb, 0x10fb,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1206,
- 0x1208, 0x1246,
- 0x1248, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1286,
- 0x1288, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12ae,
- 0x12b0, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12ce,
- 0x12d0, 0x12d6,
- 0x12d8, 0x12ee,
- 0x12f0, 0x130e,
- 0x1310, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x131e,
- 0x1320, 0x1346,
- 0x1348, 0x135a,
- 0x1361, 0x137c,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 0x169c,
- 0x16a0, 0x16f0,
- 0x1780, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2046,
- 0x2048, 0x204d,
- 0x206a, 0x2070,
- 0x2074, 0x208e,
- 0x20a0, 0x20af,
- 0x20d0, 0x20e3,
- 0x2100, 0x213a,
- 0x2153, 0x2183,
- 0x2190, 0x21f3,
- 0x2200, 0x22f1,
- 0x2300, 0x237b,
- 0x237d, 0x239a,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x24ea,
- 0x2500, 0x2595,
- 0x25a0, 0x25f7,
- 0x2600, 0x2613,
- 0x2619, 0x2671,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2776, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x2800, 0x28ff,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303a,
- 0x303e, 0x303f,
- 0x3041, 0x3094,
- 0x3099, 0x309e,
- 0x30a1, 0x30fe,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x3200, 0x321c,
- 0x3220, 0x3243,
- 0x3260, 0x327b,
- 0x327f, 0x32b0,
- 0x32c0, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fa5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4a1,
- 0xa4a4, 0xa4b3,
- 0xa4b5, 0xa4c0,
- 0xa4c2, 0xa4c4,
- 0xa4c6, 0xa4c6,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdf0, 0xfdfb,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe44,
- 0xfe49, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe72,
- 0xfe74, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xff5e,
- 0xff61, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xffff,
- 0x1fffe, 0x1ffff,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_3_0 */
-
-/* 'Age_3_1': Derived Age 3.1 */
-static const OnigCodePoint CR_Age_3_1[] = {
- 402,
- 0x0000, 0x021f,
- 0x0222, 0x0233,
- 0x0250, 0x02ad,
- 0x02b0, 0x02ee,
- 0x0300, 0x034e,
- 0x0360, 0x0362,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03d7,
- 0x03da, 0x03f5,
- 0x0400, 0x0486,
- 0x0488, 0x0489,
- 0x048c, 0x04c4,
- 0x04c7, 0x04c8,
- 0x04cb, 0x04cc,
- 0x04d0, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0655,
- 0x0660, 0x066d,
- 0x0670, 0x06ed,
- 0x06f0, 0x06fe,
- 0x0700, 0x070d,
- 0x070f, 0x072c,
- 0x0730, 0x074a,
- 0x0780, 0x07b0,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a02, 0x0a02,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8b,
- 0x0a8d, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae0,
- 0x0ae6, 0x0aef,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b36, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d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0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fcf,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10f6,
- 0x10fb, 0x10fb,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1206,
- 0x1208, 0x1246,
- 0x1248, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1286,
- 0x1288, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12ae,
- 0x12b0, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12ce,
- 0x12d0, 0x12d6,
- 0x12d8, 0x12ee,
- 0x12f0, 0x130e,
- 0x1310, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x131e,
- 0x1320, 0x1346,
- 0x1348, 0x135a,
- 0x1361, 0x137c,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 0x169c,
- 0x16a0, 0x16f0,
- 0x1780, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2046,
- 0x2048, 0x204d,
- 0x206a, 0x2070,
- 0x2074, 0x208e,
- 0x20a0, 0x20af,
- 0x20d0, 0x20e3,
- 0x2100, 0x213a,
- 0x2153, 0x2183,
- 0x2190, 0x21f3,
- 0x2200, 0x22f1,
- 0x2300, 0x237b,
- 0x237d, 0x239a,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x24ea,
- 0x2500, 0x2595,
- 0x25a0, 0x25f7,
- 0x2600, 0x2613,
- 0x2619, 0x2671,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2767,
- 0x2776, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x2800, 0x28ff,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303a,
- 0x303e, 0x303f,
- 0x3041, 0x3094,
- 0x3099, 0x309e,
- 0x30a1, 0x30fe,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x3200, 0x321c,
- 0x3220, 0x3243,
- 0x3260, 0x327b,
- 0x327f, 0x32b0,
- 0x32c0, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fa5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4a1,
- 0xa4a4, 0xa4b3,
- 0xa4b5, 0xa4c0,
- 0xa4c2, 0xa4c4,
- 0xa4c6, 0xa4c6,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfb,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe44,
- 0xfe49, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe72,
- 0xfe74, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xff5e,
- 0xff61, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0xffff,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10400, 0x10425,
- 0x10428, 0x1044d,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d1dd,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c0,
- 0x1d4c2, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a3,
- 0x1d6a8, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x1fffe, 0x2a6d6,
- 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,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_3_1 */
-
-/* 'Age_3_2': Derived Age 3.2 */
-static const OnigCodePoint CR_Age_3_2[] = {
- 397,
- 0x0000, 0x0220,
- 0x0222, 0x0233,
- 0x0250, 0x02ad,
- 0x02b0, 0x02ee,
- 0x0300, 0x034f,
- 0x0360, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03f6,
- 0x0400, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0655,
- 0x0660, 0x06ed,
- 0x06f0, 0x06fe,
- 0x0700, 0x070d,
- 0x070f, 0x072c,
- 0x0730, 0x074a,
- 0x0780, 0x07b1,
- 0x0901, 0x0903,
- 0x0905, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09bc,
- 0x09be, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a02, 0x0a02,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8b,
- 0x0a8d, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 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x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1206,
- 0x1208, 0x1246,
- 0x1248, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1286,
- 0x1288, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12ae,
- 0x12b0, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12ce,
- 0x12d0, 0x12d6,
- 0x12d8, 0x12ee,
- 0x12f0, 0x130e,
- 0x1310, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x131e,
- 0x1320, 0x1346,
- 0x1348, 0x135a,
- 0x1361, 0x137c,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dc,
- 0x17e0, 0x17e9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18a9,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2052,
- 0x2057, 0x2057,
- 0x205f, 0x2063,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x20a0, 0x20b1,
- 0x20d0, 0x20ea,
- 0x2100, 0x213a,
- 0x213d, 0x214b,
- 0x2153, 0x2183,
- 0x2190, 0x23ce,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x24fe,
- 0x2500, 0x2613,
- 0x2616, 0x2617,
- 0x2619, 0x267d,
- 0x2680, 0x2689,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27d0, 0x27eb,
- 0x27f0, 0x2aff,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31f0, 0x321c,
- 0x3220, 0x3243,
- 0x3251, 0x327b,
- 0x327f, 0x32cb,
- 0x32d0, 0x32fe,
- 0x3300, 0x3376,
- 0x337b, 0x33dd,
- 0x33e0, 0x33fe,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fa5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfc,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe23,
- 0xfe30, 0xfe46,
- 0xfe49, 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, 0xffff,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10400, 0x10425,
- 0x10428, 0x1044d,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d1dd,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c0,
- 0x1d4c2, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a3,
- 0x1d6a8, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x1fffe, 0x2a6d6,
- 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,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_3_2 */
-
-/* 'Age_4_0': Derived Age 4.0 */
-static const OnigCodePoint CR_Age_4_0[] = {
- 412,
- 0x0000, 0x0236,
- 0x0250, 0x0357,
- 0x035d, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x03fb,
- 0x0400, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f5,
- 0x04f8, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05a1,
- 0x05a3, 0x05b9,
- 0x05bb, 0x05c4,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060c, 0x0615,
- 0x061b, 0x061b,
- 0x061f, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x0658,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x074f,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cd,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fa,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c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f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fcf,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10f8,
- 0x10fb, 0x10fb,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1206,
- 0x1208, 0x1246,
- 0x1248, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1286,
- 0x1288, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12ae,
- 0x12b0, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12ce,
- 0x12d0, 0x12d6,
- 0x12d8, 0x12ee,
- 0x12f0, 0x130e,
- 0x1310, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x131e,
- 0x1320, 0x1346,
- 0x1348, 0x135a,
- 0x1361, 0x137c,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 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, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x19e0, 0x19ff,
- 0x1d00, 0x1d6b,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2054,
- 0x2057, 0x2057,
- 0x205f, 0x2063,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x20a0, 0x20b1,
- 0x20d0, 0x20ea,
- 0x2100, 0x213b,
- 0x213d, 0x214b,
- 0x2153, 0x2183,
- 0x2190, 0x23d0,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2617,
- 0x2619, 0x267d,
- 0x2680, 0x2691,
- 0x26a0, 0x26a1,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27d0, 0x27eb,
- 0x27f0, 0x2b0d,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31f0, 0x321e,
- 0x3220, 0x3243,
- 0x3250, 0x327d,
- 0x327f, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fa5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe0f,
- 0xfe20, 0xfe23,
- 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, 0x1013f,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x1039f,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x1083f,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d1dd,
- 0x1d300, 0x1d356,
- 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, 0x1d6a3,
- 0x1d6a8, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x1fffe, 0x2a6d6,
- 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_4_0 */
-
-/* 'Age_4_1': Derived Age 4.1 */
-static const OnigCodePoint CR_Age_4_1[] = {
- 430,
- 0x0000, 0x0241,
- 0x0250, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037a,
- 0x037e, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x0486,
- 0x0488, 0x04ce,
- 0x04d0, 0x04f9,
- 0x0500, 0x050f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05b9,
- 0x05bb, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060b, 0x0615,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x097d, 0x097d,
- 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, 0x09fa,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a74,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b43,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0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0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fd1,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 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, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a1f,
- 0x1d00, 0x1dc3,
- 0x1e00, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2063,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x2094,
- 0x20a0, 0x20b5,
- 0x20d0, 0x20eb,
- 0x2100, 0x214c,
- 0x2153, 0x2183,
- 0x2190, 0x23db,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x269c,
- 0x26a0, 0x26b1,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27c0, 0x27c6,
- 0x27d0, 0x27eb,
- 0x27f0, 0x2b13,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c80, 0x2cea,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2e00, 0x2e17,
- 0x2e1c, 0x2e1d,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31c0, 0x31cf,
- 0x31f0, 0x321e,
- 0x3220, 0x3243,
- 0x3250, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa700, 0xa716,
- 0xa800, 0xa82b,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe23,
- 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,
- 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, 0x1083f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 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, 0x1d7c9,
- 0x1d7ce, 0x1d7ff,
- 0x1fffe, 0x2a6d6,
- 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_4_1 */
-
-/* 'Age_5_0': Derived Age 5.0 */
-static const OnigCodePoint CR_Age_5_0[] = {
- 440,
- 0x0000, 0x036f,
- 0x0374, 0x0375,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x03ce,
- 0x03d0, 0x0486,
- 0x0488, 0x0513,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x060b, 0x0615,
- 0x061b, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x063a,
- 0x0640, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x076d,
- 0x0780, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0970,
- 0x097b, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,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e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6a,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fcf, 0x0fd1,
- 0x1000, 0x1021,
- 0x1023, 0x1027,
- 0x1029, 0x102a,
- 0x102c, 0x1032,
- 0x1036, 0x1039,
- 0x1040, 0x1059,
- 0x10a0, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 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, 0x18a9,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a1f,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1d00, 0x1dca,
- 0x1dfe, 0x1e9b,
- 0x1ea0, 0x1ef9,
- 0x1f00, 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, 0x2063,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x2094,
- 0x20a0, 0x20b5,
- 0x20d0, 0x20ef,
- 0x2100, 0x214e,
- 0x2153, 0x2184,
- 0x2190, 0x23e7,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x269c,
- 0x26a0, 0x26b2,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27c0, 0x27ca,
- 0x27d0, 0x27eb,
- 0x27f0, 0x2b1a,
- 0x2b20, 0x2b23,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2c6c,
- 0x2c74, 0x2c77,
- 0x2c80, 0x2cea,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2e00, 0x2e17,
- 0x2e1c, 0x2e1d,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312c,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31c0, 0x31cf,
- 0x31f0, 0x321e,
- 0x3220, 0x3243,
- 0x3250, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fbb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa700, 0xa71a,
- 0xa720, 0xa721,
- 0xa800, 0xa82b,
- 0xa840, 0xa877,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe23,
- 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,
- 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, 0x1083f,
- 0x10900, 0x10919,
- 0x1091f, 0x1091f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d12a, 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,
- 0x1fffe, 0x2a6d6,
- 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_5_0 */
-
-/* 'Age_5_1': Derived Age 5.1 */
-static const OnigCodePoint CR_Age_5_1[] = {
- 455,
- 0x0000, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0523,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0901, 0x0939,
- 0x093c, 0x094d,
- 0x0950, 0x0954,
- 0x0958, 0x0972,
- 0x097b, 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,
- 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x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fd4,
- 0x1000, 0x1099,
- 0x109e, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1159,
- 0x115f, 0x11a2,
- 0x11a8, 0x11f9,
- 0x1200, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1401, 0x1676,
- 0x1680, 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,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19a9,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19d9,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a1f,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1c00, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1d00, 0x1de6,
- 0x1dfe, 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, 0x2094,
- 0x20a0, 0x20b5,
- 0x20d0, 0x20f0,
- 0x2100, 0x214f,
- 0x2153, 0x2188,
- 0x2190, 0x23e7,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x269d,
- 0x26a0, 0x26bc,
- 0x26c0, 0x26c3,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x2756,
- 0x2758, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27d0, 0x2b4c,
- 0x2b50, 0x2b54,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2c6f,
- 0x2c71, 0x2c7d,
- 0x2c80, 0x2cea,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e30,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x3243,
- 0x3250, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fc3,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa500, 0xa62b,
- 0xa640, 0xa65f,
- 0xa662, 0xa673,
- 0xa67c, 0xa697,
- 0xa700, 0xa78c,
- 0xa7fb, 0xa82b,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa900, 0xa953,
- 0xa95f, 0xa95f,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa5f,
- 0xac00, 0xd7a3,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6a,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 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, 0x1083f,
- 0x10900, 0x10919,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1fffe, 0x2a6d6,
- 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_5_1 */
-
-/* 'Age_5_2': Derived Age 5.2 */
-static const OnigCodePoint CR_Age_5_2[] = {
- 495,
- 0x0000, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0525,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x061f,
- 0x0621, 0x065e,
- 0x0660, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0900, 0x0939,
- 0x093c, 0x094e,
- 0x0950, 0x0955,
- 0x0958, 0x0972,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0aef,
- 0x0af1, 0x0af1,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b63,
- 0x0b66, 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 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f8b,
- 0x0f90, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fd8,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135f, 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, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1c00, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfd, 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, 0x2094,
- 0x20a0, 0x20b8,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23e8,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26cd,
- 0x26cf, 0x26e1,
- 0x26e3, 0x26e3,
- 0x26e8, 0x26ff,
- 0x2701, 0x2704,
- 0x2706, 0x2709,
- 0x270c, 0x2727,
- 0x2729, 0x274b,
- 0x274d, 0x274d,
- 0x274f, 0x2752,
- 0x2756, 0x275e,
- 0x2761, 0x2794,
- 0x2798, 0x27af,
- 0x27b1, 0x27be,
- 0x27c0, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27d0, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d6f,
- 0x2d80, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31b7,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa65f,
- 0xa662, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78c,
- 0xa7fb, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbb1,
- 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,
- 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,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f131, 0x1f131,
- 0x1f13d, 0x1f13d,
- 0x1f13f, 0x1f13f,
- 0x1f142, 0x1f142,
- 0x1f146, 0x1f146,
- 0x1f14a, 0x1f14e,
- 0x1f157, 0x1f157,
- 0x1f15f, 0x1f15f,
- 0x1f179, 0x1f179,
- 0x1f17b, 0x1f17c,
- 0x1f17f, 0x1f17f,
- 0x1f18a, 0x1f18d,
- 0x1f190, 0x1f190,
- 0x1f200, 0x1f200,
- 0x1f210, 0x1f231,
- 0x1f240, 0x1f248,
- 0x1fffe, 0x2a6d6,
- 0x2a700, 0x2b734,
- 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_5_2 */
-
-/* 'Age_6_0': Derived Age 6.0 */
-static const OnigCodePoint CR_Age_6_0[] = {
- 511,
- 0x0000, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0603,
- 0x0606, 0x061b,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 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- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e87, 0x0e88,
- 0x0e8a, 0x0e8a,
- 0x0e8d, 0x0e8d,
- 0x0e94, 0x0e97,
- 0x0e99, 0x0e9f,
- 0x0ea1, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 0x0ea7,
- 0x0eaa, 0x0eab,
- 0x0ead, 0x0eb9,
- 0x0ebb, 0x0ebd,
- 0x0ec0, 0x0ec4,
- 0x0ec6, 0x0ec6,
- 0x0ec8, 0x0ecd,
- 0x0ed0, 0x0ed9,
- 0x0edc, 0x0edd,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10d0, 0x10fc,
- 0x1100, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 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, 0x1baa,
- 0x1bae, 0x1bb9,
- 0x1bc0, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cd0, 0x1cf2,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x2064,
- 0x206a, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x27ca,
- 0x27cc, 0x27cc,
- 0x27ce, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf1,
- 0x2cf9, 0x2d25,
- 0x2d30, 0x2d65,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e31,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcb,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa673,
- 0xa67c, 0xa697,
- 0xa6a0, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaadf,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa2d,
- 0xfa30, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 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,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f169,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f5ff,
- 0x1f601, 0x1f610,
- 0x1f612, 0x1f614,
- 0x1f616, 0x1f616,
- 0x1f618, 0x1f618,
- 0x1f61a, 0x1f61a,
- 0x1f61c, 0x1f61e,
- 0x1f620, 0x1f625,
- 0x1f628, 0x1f62b,
- 0x1f62d, 0x1f62d,
- 0x1f630, 0x1f633,
- 0x1f635, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 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_0 */
-
-/* 'Age_6_1': Derived Age 6.1 */
-static const OnigCodePoint CR_Age_6_1[] = {
- 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,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63,
- 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, 0x20b9,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 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_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,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c0, 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,
-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x0e5b,
- 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, 0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ead, 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,
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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,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6c,
- 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, 0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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 */
-
-/* 'Age_9_0': Derived Age 9.0 */
-static const OnigCodePoint CR_Age_9_0[] = {
- 648,
- 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,
- 0x08b6, 0x08bd,
- 0x08d4, 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, 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6c,
- 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, 0x1c88,
- 0x1cc0, 0x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x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fd5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 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, 0x1018e,
- 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,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x1123e,
- 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,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 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,
- 0x16fe0, 0x16fe0,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0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, 0x1f6d2,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f6,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f910, 0x1f91e,
- 0x1f920, 0x1f927,
- 0x1f930, 0x1f930,
- 0x1f933, 0x1f93e,
- 0x1f940, 0x1f94b,
- 0x1f950, 0x1f95e,
- 0x1f980, 0x1f991,
- 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_9_0 */
-
-/* 'Age_10_0': Derived Age 10.0 */
-static const OnigCodePoint CR_Age_10_0[] = {
- 659,
- 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,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d4, 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, 0x09fd,
- 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, 0x0aff,
- 0x0b01, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3c, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b5c, 0x0b5d,
- 0x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6, 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, 0x1c88,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf9,
- 0x1d00, 0x1df9,
- 0x1dfb, 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, 0x20bf,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd2,
- 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, 0x2e49,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312e,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fea,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ae,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 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, 0x1018e,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x1032d, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 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, 0x1123e,
- 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,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145d,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c36,
- 0x11c38, 0x11c45,
- 0x11c50, 0x11c6c,
- 0x11c70, 0x11c8f,
- 0x11c92, 0x11ca7,
- 0x11ca9, 0x11cb6,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d36,
- 0x11d3a, 0x11d3a,
- 0x11d3c, 0x11d3d,
- 0x11d3f, 0x11d47,
- 0x11d50, 0x11d59,
- 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,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187ec,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 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,
- 0x1e000, 0x1e006,
- 0x1e008, 0x1e018,
- 0x1e01b, 0x1e021,
- 0x1e023, 0x1e024,
- 0x1e026, 0x1e02a,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94a,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 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, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f8,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f94c,
- 0x1f950, 0x1f96b,
- 0x1f980, 0x1f997,
- 0x1f9c0, 0x1f9c0,
- 0x1f9d0, 0x1f9e6,
- 0x1fffe, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 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_10_0 */
-
-#endif /* USE_UNICODE_AGE_PROPERTIES */
-/* 'Grapheme_Cluster_Break_Prepend': Grapheme_Cluster_Break=Prepend */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_Prepend[] = {
- 10,
- 0x0600, 0x0605,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x08e2, 0x08e2,
- 0x0d4e, 0x0d4e,
- 0x110bd, 0x110bd,
- 0x111c2, 0x111c3,
- 0x11a3a, 0x11a3a,
- 0x11a86, 0x11a89,
- 0x11d46, 0x11d46,
-}; /* CR_Grapheme_Cluster_Break_Prepend */
-
-/* 'Grapheme_Cluster_Break_CR': Grapheme_Cluster_Break=CR */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_CR[] = {
- 1,
- 0x000d, 0x000d,
-}; /* CR_Grapheme_Cluster_Break_CR */
-
-/* 'Grapheme_Cluster_Break_LF': Grapheme_Cluster_Break=LF */
-#define CR_Grapheme_Cluster_Break_LF CR_NEWLINE
-
-/* 'Grapheme_Cluster_Break_Control': Grapheme_Cluster_Break=Control */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_Control[] = {
- 19,
- 0x0000, 0x0009,
- 0x000b, 0x000c,
- 0x000e, 0x001f,
- 0x007f, 0x009f,
- 0x00ad, 0x00ad,
- 0x061c, 0x061c,
- 0x180e, 0x180e,
- 0x200b, 0x200b,
- 0x200e, 0x200f,
- 0x2028, 0x202e,
- 0x2060, 0x206f,
- 0xd800, 0xdfff,
- 0xfeff, 0xfeff,
- 0xfff0, 0xfffb,
- 0x1bca0, 0x1bca3,
- 0x1d173, 0x1d17a,
- 0xe0000, 0xe001f,
- 0xe0080, 0xe00ff,
- 0xe01f0, 0xe0fff,
-}; /* CR_Grapheme_Cluster_Break_Control */
-
-/* 'Grapheme_Cluster_Break_Extend': Grapheme_Cluster_Break=Extend */
-#define CR_Grapheme_Cluster_Break_Extend CR_Grapheme_Extend
-
-/* 'Grapheme_Cluster_Break_Regional_Indicator': Grapheme_Cluster_Break=Regional_Indicator */
-#define CR_Grapheme_Cluster_Break_Regional_Indicator CR_Regional_Indicator
-
-/* 'Grapheme_Cluster_Break_SpacingMark': Grapheme_Cluster_Break=SpacingMark */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_SpacingMark[] = {
- 145,
- 0x0903, 0x0903,
- 0x093b, 0x093b,
- 0x093e, 0x0940,
- 0x0949, 0x094c,
- 0x094e, 0x094f,
- 0x0982, 0x0983,
- 0x09bf, 0x09c0,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09cc,
- 0x0a03, 0x0a03,
- 0x0a3e, 0x0a40,
- 0x0a83, 0x0a83,
- 0x0abe, 0x0ac0,
- 0x0ac9, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0b02, 0x0b03,
- 0x0b40, 0x0b40,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0bbf, 0x0bbf,
- 0x0bc1, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcc,
- 0x0c01, 0x0c03,
- 0x0c41, 0x0c44,
- 0x0c82, 0x0c83,
- 0x0cbe, 0x0cbe,
- 0x0cc0, 0x0cc1,
- 0x0cc3, 0x0cc4,
- 0x0cc7, 0x0cc8,
- 0x0cca, 0x0ccb,
- 0x0d02, 0x0d03,
- 0x0d3f, 0x0d40,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d82, 0x0d83,
- 0x0dd0, 0x0dd1,
- 0x0dd8, 0x0dde,
- 0x0df2, 0x0df3,
- 0x0e33, 0x0e33,
- 0x0eb3, 0x0eb3,
- 0x0f3e, 0x0f3f,
- 0x0f7f, 0x0f7f,
- 0x1031, 0x1031,
- 0x103b, 0x103c,
- 0x1056, 0x1057,
- 0x1084, 0x1084,
- 0x17b6, 0x17b6,
- 0x17be, 0x17c5,
- 0x17c7, 0x17c8,
- 0x1923, 0x1926,
- 0x1929, 0x192b,
- 0x1930, 0x1931,
- 0x1933, 0x1938,
- 0x1a19, 0x1a1a,
- 0x1a55, 0x1a55,
- 0x1a57, 0x1a57,
- 0x1a6d, 0x1a72,
- 0x1b04, 0x1b04,
- 0x1b35, 0x1b35,
- 0x1b3b, 0x1b3b,
- 0x1b3d, 0x1b41,
- 0x1b43, 0x1b44,
- 0x1b82, 0x1b82,
- 0x1ba1, 0x1ba1,
- 0x1ba6, 0x1ba7,
- 0x1baa, 0x1baa,
- 0x1be7, 0x1be7,
- 0x1bea, 0x1bec,
- 0x1bee, 0x1bee,
- 0x1bf2, 0x1bf3,
- 0x1c24, 0x1c2b,
- 0x1c34, 0x1c35,
- 0x1ce1, 0x1ce1,
- 0x1cf2, 0x1cf3,
- 0x1cf7, 0x1cf7,
- 0xa823, 0xa824,
- 0xa827, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa952, 0xa953,
- 0xa983, 0xa983,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9bd, 0xa9c0,
- 0xaa2f, 0xaa30,
- 0xaa33, 0xaa34,
- 0xaa4d, 0xaa4d,
- 0xaaeb, 0xaaeb,
- 0xaaee, 0xaaef,
- 0xaaf5, 0xaaf5,
- 0xabe3, 0xabe4,
- 0xabe6, 0xabe7,
- 0xabe9, 0xabea,
- 0xabec, 0xabec,
- 0x11000, 0x11000,
- 0x11002, 0x11002,
- 0x11082, 0x11082,
- 0x110b0, 0x110b2,
- 0x110b7, 0x110b8,
- 0x1112c, 0x1112c,
- 0x11182, 0x11182,
- 0x111b3, 0x111b5,
- 0x111bf, 0x111c0,
- 0x1122c, 0x1122e,
- 0x11232, 0x11233,
- 0x11235, 0x11235,
- 0x112e0, 0x112e2,
- 0x11302, 0x11303,
- 0x1133f, 0x1133f,
- 0x11341, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11362, 0x11363,
- 0x11435, 0x11437,
- 0x11440, 0x11441,
- 0x11445, 0x11445,
- 0x114b1, 0x114b2,
- 0x114b9, 0x114b9,
- 0x114bb, 0x114bc,
- 0x114be, 0x114be,
- 0x114c1, 0x114c1,
- 0x115b0, 0x115b1,
- 0x115b8, 0x115bb,
- 0x115be, 0x115be,
- 0x11630, 0x11632,
- 0x1163b, 0x1163c,
- 0x1163e, 0x1163e,
- 0x116ac, 0x116ac,
- 0x116ae, 0x116af,
- 0x116b6, 0x116b6,
- 0x11720, 0x11721,
- 0x11726, 0x11726,
- 0x11a07, 0x11a08,
- 0x11a39, 0x11a39,
- 0x11a57, 0x11a58,
- 0x11a97, 0x11a97,
- 0x11c2f, 0x11c2f,
- 0x11c3e, 0x11c3e,
- 0x11ca9, 0x11ca9,
- 0x11cb1, 0x11cb1,
- 0x11cb4, 0x11cb4,
- 0x16f51, 0x16f7e,
- 0x1d166, 0x1d166,
- 0x1d16d, 0x1d16d,
-}; /* CR_Grapheme_Cluster_Break_SpacingMark */
-
-/* 'Grapheme_Cluster_Break_L': Grapheme_Cluster_Break=L */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_L[] = {
- 2,
- 0x1100, 0x115f,
- 0xa960, 0xa97c,
-}; /* CR_Grapheme_Cluster_Break_L */
-
-/* 'Grapheme_Cluster_Break_V': Grapheme_Cluster_Break=V */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_V[] = {
- 2,
- 0x1160, 0x11a7,
- 0xd7b0, 0xd7c6,
-}; /* CR_Grapheme_Cluster_Break_V */
-
-/* 'Grapheme_Cluster_Break_T': Grapheme_Cluster_Break=T */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_T[] = {
- 2,
- 0x11a8, 0x11ff,
- 0xd7cb, 0xd7fb,
-}; /* CR_Grapheme_Cluster_Break_T */
-
-/* 'Grapheme_Cluster_Break_LV': Grapheme_Cluster_Break=LV */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_LV[] = {
- 399,
- 0xac00, 0xac00,
- 0xac1c, 0xac1c,
- 0xac38, 0xac38,
- 0xac54, 0xac54,
- 0xac70, 0xac70,
- 0xac8c, 0xac8c,
- 0xaca8, 0xaca8,
- 0xacc4, 0xacc4,
- 0xace0, 0xace0,
- 0xacfc, 0xacfc,
- 0xad18, 0xad18,
- 0xad34, 0xad34,
- 0xad50, 0xad50,
- 0xad6c, 0xad6c,
- 0xad88, 0xad88,
- 0xada4, 0xada4,
- 0xadc0, 0xadc0,
- 0xaddc, 0xaddc,
- 0xadf8, 0xadf8,
- 0xae14, 0xae14,
- 0xae30, 0xae30,
- 0xae4c, 0xae4c,
- 0xae68, 0xae68,
- 0xae84, 0xae84,
- 0xaea0, 0xaea0,
- 0xaebc, 0xaebc,
- 0xaed8, 0xaed8,
- 0xaef4, 0xaef4,
- 0xaf10, 0xaf10,
- 0xaf2c, 0xaf2c,
- 0xaf48, 0xaf48,
- 0xaf64, 0xaf64,
- 0xaf80, 0xaf80,
- 0xaf9c, 0xaf9c,
- 0xafb8, 0xafb8,
- 0xafd4, 0xafd4,
- 0xaff0, 0xaff0,
- 0xb00c, 0xb00c,
- 0xb028, 0xb028,
- 0xb044, 0xb044,
- 0xb060, 0xb060,
- 0xb07c, 0xb07c,
- 0xb098, 0xb098,
- 0xb0b4, 0xb0b4,
- 0xb0d0, 0xb0d0,
- 0xb0ec, 0xb0ec,
- 0xb108, 0xb108,
- 0xb124, 0xb124,
- 0xb140, 0xb140,
- 0xb15c, 0xb15c,
- 0xb178, 0xb178,
- 0xb194, 0xb194,
- 0xb1b0, 0xb1b0,
- 0xb1cc, 0xb1cc,
- 0xb1e8, 0xb1e8,
- 0xb204, 0xb204,
- 0xb220, 0xb220,
- 0xb23c, 0xb23c,
- 0xb258, 0xb258,
- 0xb274, 0xb274,
- 0xb290, 0xb290,
- 0xb2ac, 0xb2ac,
- 0xb2c8, 0xb2c8,
- 0xb2e4, 0xb2e4,
- 0xb300, 0xb300,
- 0xb31c, 0xb31c,
- 0xb338, 0xb338,
- 0xb354, 0xb354,
- 0xb370, 0xb370,
- 0xb38c, 0xb38c,
- 0xb3a8, 0xb3a8,
- 0xb3c4, 0xb3c4,
- 0xb3e0, 0xb3e0,
- 0xb3fc, 0xb3fc,
- 0xb418, 0xb418,
- 0xb434, 0xb434,
- 0xb450, 0xb450,
- 0xb46c, 0xb46c,
- 0xb488, 0xb488,
- 0xb4a4, 0xb4a4,
- 0xb4c0, 0xb4c0,
- 0xb4dc, 0xb4dc,
- 0xb4f8, 0xb4f8,
- 0xb514, 0xb514,
- 0xb530, 0xb530,
- 0xb54c, 0xb54c,
- 0xb568, 0xb568,
- 0xb584, 0xb584,
- 0xb5a0, 0xb5a0,
- 0xb5bc, 0xb5bc,
- 0xb5d8, 0xb5d8,
- 0xb5f4, 0xb5f4,
- 0xb610, 0xb610,
- 0xb62c, 0xb62c,
- 0xb648, 0xb648,
- 0xb664, 0xb664,
- 0xb680, 0xb680,
- 0xb69c, 0xb69c,
- 0xb6b8, 0xb6b8,
- 0xb6d4, 0xb6d4,
- 0xb6f0, 0xb6f0,
- 0xb70c, 0xb70c,
- 0xb728, 0xb728,
- 0xb744, 0xb744,
- 0xb760, 0xb760,
- 0xb77c, 0xb77c,
- 0xb798, 0xb798,
- 0xb7b4, 0xb7b4,
- 0xb7d0, 0xb7d0,
- 0xb7ec, 0xb7ec,
- 0xb808, 0xb808,
- 0xb824, 0xb824,
- 0xb840, 0xb840,
- 0xb85c, 0xb85c,
- 0xb878, 0xb878,
- 0xb894, 0xb894,
- 0xb8b0, 0xb8b0,
- 0xb8cc, 0xb8cc,
- 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, 0xbfb0,
- 0xbfcc, 0xbfcc,
- 0xbfe8, 0xbfe8,
- 0xc004, 0xc004,
- 0xc020, 0xc020,
- 0xc03c, 0xc03c,
- 0xc058, 0xc058,
- 0xc074, 0xc074,
- 0xc090, 0xc090,
- 0xc0ac, 0xc0ac,
- 0xc0c8, 0xc0c8,
- 0xc0e4, 0xc0e4,
- 0xc100, 0xc100,
- 0xc11c, 0xc11c,
- 0xc138, 0xc138,
- 0xc154, 0xc154,
- 0xc170, 0xc170,
- 0xc18c, 0xc18c,
- 0xc1a8, 0xc1a8,
- 0xc1c4, 0xc1c4,
- 0xc1e0, 0xc1e0,
- 0xc1fc, 0xc1fc,
- 0xc218, 0xc218,
- 0xc234, 0xc234,
- 0xc250, 0xc250,
- 0xc26c, 0xc26c,
- 0xc288, 0xc288,
- 0xc2a4, 0xc2a4,
- 0xc2c0, 0xc2c0,
- 0xc2dc, 0xc2dc,
- 0xc2f8, 0xc2f8,
- 0xc314, 0xc314,
- 0xc330, 0xc330,
- 0xc34c, 0xc34c,
- 0xc368, 0xc368,
- 0xc384, 0xc384,
- 0xc3a0, 0xc3a0,
- 0xc3bc, 0xc3bc,
- 0xc3d8, 0xc3d8,
- 0xc3f4, 0xc3f4,
- 0xc410, 0xc410,
- 0xc42c, 0xc42c,
- 0xc448, 0xc448,
- 0xc464, 0xc464,
- 0xc480, 0xc480,
- 0xc49c, 0xc49c,
- 0xc4b8, 0xc4b8,
- 0xc4d4, 0xc4d4,
- 0xc4f0, 0xc4f0,
- 0xc50c, 0xc50c,
- 0xc528, 0xc528,
- 0xc544, 0xc544,
- 0xc560, 0xc560,
- 0xc57c, 0xc57c,
- 0xc598, 0xc598,
- 0xc5b4, 0xc5b4,
- 0xc5d0, 0xc5d0,
- 0xc5ec, 0xc5ec,
- 0xc608, 0xc608,
- 0xc624, 0xc624,
- 0xc640, 0xc640,
- 0xc65c, 0xc65c,
- 0xc678, 0xc678,
- 0xc694, 0xc694,
- 0xc6b0, 0xc6b0,
- 0xc6cc, 0xc6cc,
- 0xc6e8, 0xc6e8,
- 0xc704, 0xc704,
- 0xc720, 0xc720,
- 0xc73c, 0xc73c,
- 0xc758, 0xc758,
- 0xc774, 0xc774,
- 0xc790, 0xc790,
- 0xc7ac, 0xc7ac,
- 0xc7c8, 0xc7c8,
- 0xc7e4, 0xc7e4,
- 0xc800, 0xc800,
- 0xc81c, 0xc81c,
- 0xc838, 0xc838,
- 0xc854, 0xc854,
- 0xc870, 0xc870,
- 0xc88c, 0xc88c,
- 0xc8a8, 0xc8a8,
- 0xc8c4, 0xc8c4,
- 0xc8e0, 0xc8e0,
- 0xc8fc, 0xc8fc,
- 0xc918, 0xc918,
- 0xc934, 0xc934,
- 0xc950, 0xc950,
- 0xc96c, 0xc96c,
- 0xc988, 0xc988,
- 0xc9a4, 0xc9a4,
- 0xc9c0, 0xc9c0,
- 0xc9dc, 0xc9dc,
- 0xc9f8, 0xc9f8,
- 0xca14, 0xca14,
- 0xca30, 0xca30,
- 0xca4c, 0xca4c,
- 0xca68, 0xca68,
- 0xca84, 0xca84,
- 0xcaa0, 0xcaa0,
- 0xcabc, 0xcabc,
- 0xcad8, 0xcad8,
- 0xcaf4, 0xcaf4,
- 0xcb10, 0xcb10,
- 0xcb2c, 0xcb2c,
- 0xcb48, 0xcb48,
- 0xcb64, 0xcb64,
- 0xcb80, 0xcb80,
- 0xcb9c, 0xcb9c,
- 0xcbb8, 0xcbb8,
- 0xcbd4, 0xcbd4,
- 0xcbf0, 0xcbf0,
- 0xcc0c, 0xcc0c,
- 0xcc28, 0xcc28,
- 0xcc44, 0xcc44,
- 0xcc60, 0xcc60,
- 0xcc7c, 0xcc7c,
- 0xcc98, 0xcc98,
- 0xccb4, 0xccb4,
- 0xccd0, 0xccd0,
- 0xccec, 0xccec,
- 0xcd08, 0xcd08,
- 0xcd24, 0xcd24,
- 0xcd40, 0xcd40,
- 0xcd5c, 0xcd5c,
- 0xcd78, 0xcd78,
- 0xcd94, 0xcd94,
- 0xcdb0, 0xcdb0,
- 0xcdcc, 0xcdcc,
- 0xcde8, 0xcde8,
- 0xce04, 0xce04,
- 0xce20, 0xce20,
- 0xce3c, 0xce3c,
- 0xce58, 0xce58,
- 0xce74, 0xce74,
- 0xce90, 0xce90,
- 0xceac, 0xceac,
- 0xcec8, 0xcec8,
- 0xcee4, 0xcee4,
- 0xcf00, 0xcf00,
- 0xcf1c, 0xcf1c,
- 0xcf38, 0xcf38,
- 0xcf54, 0xcf54,
- 0xcf70, 0xcf70,
- 0xcf8c, 0xcf8c,
- 0xcfa8, 0xcfa8,
- 0xcfc4, 0xcfc4,
- 0xcfe0, 0xcfe0,
- 0xcffc, 0xcffc,
- 0xd018, 0xd018,
- 0xd034, 0xd034,
- 0xd050, 0xd050,
- 0xd06c, 0xd06c,
- 0xd088, 0xd088,
- 0xd0a4, 0xd0a4,
- 0xd0c0, 0xd0c0,
- 0xd0dc, 0xd0dc,
- 0xd0f8, 0xd0f8,
- 0xd114, 0xd114,
- 0xd130, 0xd130,
- 0xd14c, 0xd14c,
- 0xd168, 0xd168,
- 0xd184, 0xd184,
- 0xd1a0, 0xd1a0,
- 0xd1bc, 0xd1bc,
- 0xd1d8, 0xd1d8,
- 0xd1f4, 0xd1f4,
- 0xd210, 0xd210,
- 0xd22c, 0xd22c,
- 0xd248, 0xd248,
- 0xd264, 0xd264,
- 0xd280, 0xd280,
- 0xd29c, 0xd29c,
- 0xd2b8, 0xd2b8,
- 0xd2d4, 0xd2d4,
- 0xd2f0, 0xd2f0,
- 0xd30c, 0xd30c,
- 0xd328, 0xd328,
- 0xd344, 0xd344,
- 0xd360, 0xd360,
- 0xd37c, 0xd37c,
- 0xd398, 0xd398,
- 0xd3b4, 0xd3b4,
- 0xd3d0, 0xd3d0,
- 0xd3ec, 0xd3ec,
- 0xd408, 0xd408,
- 0xd424, 0xd424,
- 0xd440, 0xd440,
- 0xd45c, 0xd45c,
- 0xd478, 0xd478,
- 0xd494, 0xd494,
- 0xd4b0, 0xd4b0,
- 0xd4cc, 0xd4cc,
- 0xd4e8, 0xd4e8,
- 0xd504, 0xd504,
- 0xd520, 0xd520,
- 0xd53c, 0xd53c,
- 0xd558, 0xd558,
- 0xd574, 0xd574,
- 0xd590, 0xd590,
- 0xd5ac, 0xd5ac,
- 0xd5c8, 0xd5c8,
- 0xd5e4, 0xd5e4,
- 0xd600, 0xd600,
- 0xd61c, 0xd61c,
- 0xd638, 0xd638,
- 0xd654, 0xd654,
- 0xd670, 0xd670,
- 0xd68c, 0xd68c,
- 0xd6a8, 0xd6a8,
- 0xd6c4, 0xd6c4,
- 0xd6e0, 0xd6e0,
- 0xd6fc, 0xd6fc,
- 0xd718, 0xd718,
- 0xd734, 0xd734,
- 0xd750, 0xd750,
- 0xd76c, 0xd76c,
- 0xd788, 0xd788,
-}; /* CR_Grapheme_Cluster_Break_LV */
-
-/* 'Grapheme_Cluster_Break_LVT': Grapheme_Cluster_Break=LVT */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_LVT[] = {
- 399,
- 0xac01, 0xac1b,
- 0xac1d, 0xac37,
- 0xac39, 0xac53,
- 0xac55, 0xac6f,
- 0xac71, 0xac8b,
- 0xac8d, 0xaca7,
- 0xaca9, 0xacc3,
- 0xacc5, 0xacdf,
- 0xace1, 0xacfb,
- 0xacfd, 0xad17,
- 0xad19, 0xad33,
- 0xad35, 0xad4f,
- 0xad51, 0xad6b,
- 0xad6d, 0xad87,
- 0xad89, 0xada3,
- 0xada5, 0xadbf,
- 0xadc1, 0xaddb,
- 0xaddd, 0xadf7,
- 0xadf9, 0xae13,
- 0xae15, 0xae2f,
- 0xae31, 0xae4b,
- 0xae4d, 0xae67,
- 0xae69, 0xae83,
- 0xae85, 0xae9f,
- 0xaea1, 0xaebb,
- 0xaebd, 0xaed7,
- 0xaed9, 0xaef3,
- 0xaef5, 0xaf0f,
- 0xaf11, 0xaf2b,
- 0xaf2d, 0xaf47,
- 0xaf49, 0xaf63,
- 0xaf65, 0xaf7f,
- 0xaf81, 0xaf9b,
- 0xaf9d, 0xafb7,
- 0xafb9, 0xafd3,
- 0xafd5, 0xafef,
- 0xaff1, 0xb00b,
- 0xb00d, 0xb027,
- 0xb029, 0xb043,
- 0xb045, 0xb05f,
- 0xb061, 0xb07b,
- 0xb07d, 0xb097,
- 0xb099, 0xb0b3,
- 0xb0b5, 0xb0cf,
- 0xb0d1, 0xb0eb,
- 0xb0ed, 0xb107,
- 0xb109, 0xb123,
- 0xb125, 0xb13f,
- 0xb141, 0xb15b,
- 0xb15d, 0xb177,
- 0xb179, 0xb193,
- 0xb195, 0xb1af,
- 0xb1b1, 0xb1cb,
- 0xb1cd, 0xb1e7,
- 0xb1e9, 0xb203,
- 0xb205, 0xb21f,
- 0xb221, 0xb23b,
- 0xb23d, 0xb257,
- 0xb259, 0xb273,
- 0xb275, 0xb28f,
- 0xb291, 0xb2ab,
- 0xb2ad, 0xb2c7,
- 0xb2c9, 0xb2e3,
- 0xb2e5, 0xb2ff,
- 0xb301, 0xb31b,
- 0xb31d, 0xb337,
- 0xb339, 0xb353,
- 0xb355, 0xb36f,
- 0xb371, 0xb38b,
- 0xb38d, 0xb3a7,
- 0xb3a9, 0xb3c3,
- 0xb3c5, 0xb3df,
- 0xb3e1, 0xb3fb,
- 0xb3fd, 0xb417,
- 0xb419, 0xb433,
- 0xb435, 0xb44f,
- 0xb451, 0xb46b,
- 0xb46d, 0xb487,
- 0xb489, 0xb4a3,
- 0xb4a5, 0xb4bf,
- 0xb4c1, 0xb4db,
- 0xb4dd, 0xb4f7,
- 0xb4f9, 0xb513,
- 0xb515, 0xb52f,
- 0xb531, 0xb54b,
- 0xb54d, 0xb567,
- 0xb569, 0xb583,
- 0xb585, 0xb59f,
- 0xb5a1, 0xb5bb,
- 0xb5bd, 0xb5d7,
- 0xb5d9, 0xb5f3,
- 0xb5f5, 0xb60f,
- 0xb611, 0xb62b,
- 0xb62d, 0xb647,
- 0xb649, 0xb663,
- 0xb665, 0xb67f,
- 0xb681, 0xb69b,
- 0xb69d, 0xb6b7,
- 0xb6b9, 0xb6d3,
- 0xb6d5, 0xb6ef,
- 0xb6f1, 0xb70b,
- 0xb70d, 0xb727,
- 0xb729, 0xb743,
- 0xb745, 0xb75f,
- 0xb761, 0xb77b,
- 0xb77d, 0xb797,
- 0xb799, 0xb7b3,
- 0xb7b5, 0xb7cf,
- 0xb7d1, 0xb7eb,
- 0xb7ed, 0xb807,
- 0xb809, 0xb823,
- 0xb825, 0xb83f,
- 0xb841, 0xb85b,
- 0xb85d, 0xb877,
- 0xb879, 0xb893,
- 0xb895, 0xb8af,
- 0xb8b1, 0xb8cb,
- 0xb8cd, 0xb8e7,
- 0xb8e9, 0xb903,
- 0xb905, 0xb91f,
- 0xb921, 0xb93b,
- 0xb93d, 0xb957,
- 0xb959, 0xb973,
- 0xb975, 0xb98f,
- 0xb991, 0xb9ab,
- 0xb9ad, 0xb9c7,
- 0xb9c9, 0xb9e3,
- 0xb9e5, 0xb9ff,
- 0xba01, 0xba1b,
- 0xba1d, 0xba37,
- 0xba39, 0xba53,
- 0xba55, 0xba6f,
- 0xba71, 0xba8b,
- 0xba8d, 0xbaa7,
- 0xbaa9, 0xbac3,
- 0xbac5, 0xbadf,
- 0xbae1, 0xbafb,
- 0xbafd, 0xbb17,
- 0xbb19, 0xbb33,
- 0xbb35, 0xbb4f,
- 0xbb51, 0xbb6b,
- 0xbb6d, 0xbb87,
- 0xbb89, 0xbba3,
- 0xbba5, 0xbbbf,
- 0xbbc1, 0xbbdb,
- 0xbbdd, 0xbbf7,
- 0xbbf9, 0xbc13,
- 0xbc15, 0xbc2f,
- 0xbc31, 0xbc4b,
- 0xbc4d, 0xbc67,
- 0xbc69, 0xbc83,
- 0xbc85, 0xbc9f,
- 0xbca1, 0xbcbb,
- 0xbcbd, 0xbcd7,
- 0xbcd9, 0xbcf3,
- 0xbcf5, 0xbd0f,
- 0xbd11, 0xbd2b,
- 0xbd2d, 0xbd47,
- 0xbd49, 0xbd63,
- 0xbd65, 0xbd7f,
- 0xbd81, 0xbd9b,
- 0xbd9d, 0xbdb7,
- 0xbdb9, 0xbdd3,
- 0xbdd5, 0xbdef,
- 0xbdf1, 0xbe0b,
- 0xbe0d, 0xbe27,
- 0xbe29, 0xbe43,
- 0xbe45, 0xbe5f,
- 0xbe61, 0xbe7b,
- 0xbe7d, 0xbe97,
- 0xbe99, 0xbeb3,
- 0xbeb5, 0xbecf,
- 0xbed1, 0xbeeb,
- 0xbeed, 0xbf07,
- 0xbf09, 0xbf23,
- 0xbf25, 0xbf3f,
- 0xbf41, 0xbf5b,
- 0xbf5d, 0xbf77,
- 0xbf79, 0xbf93,
- 0xbf95, 0xbfaf,
- 0xbfb1, 0xbfcb,
- 0xbfcd, 0xbfe7,
- 0xbfe9, 0xc003,
- 0xc005, 0xc01f,
- 0xc021, 0xc03b,
- 0xc03d, 0xc057,
- 0xc059, 0xc073,
- 0xc075, 0xc08f,
- 0xc091, 0xc0ab,
- 0xc0ad, 0xc0c7,
- 0xc0c9, 0xc0e3,
- 0xc0e5, 0xc0ff,
- 0xc101, 0xc11b,
- 0xc11d, 0xc137,
- 0xc139, 0xc153,
- 0xc155, 0xc16f,
- 0xc171, 0xc18b,
- 0xc18d, 0xc1a7,
- 0xc1a9, 0xc1c3,
- 0xc1c5, 0xc1df,
- 0xc1e1, 0xc1fb,
- 0xc1fd, 0xc217,
- 0xc219, 0xc233,
- 0xc235, 0xc24f,
- 0xc251, 0xc26b,
- 0xc26d, 0xc287,
- 0xc289, 0xc2a3,
- 0xc2a5, 0xc2bf,
- 0xc2c1, 0xc2db,
- 0xc2dd, 0xc2f7,
- 0xc2f9, 0xc313,
- 0xc315, 0xc32f,
- 0xc331, 0xc34b,
- 0xc34d, 0xc367,
- 0xc369, 0xc383,
- 0xc385, 0xc39f,
- 0xc3a1, 0xc3bb,
- 0xc3bd, 0xc3d7,
- 0xc3d9, 0xc3f3,
- 0xc3f5, 0xc40f,
- 0xc411, 0xc42b,
- 0xc42d, 0xc447,
- 0xc449, 0xc463,
- 0xc465, 0xc47f,
- 0xc481, 0xc49b,
- 0xc49d, 0xc4b7,
- 0xc4b9, 0xc4d3,
- 0xc4d5, 0xc4ef,
- 0xc4f1, 0xc50b,
- 0xc50d, 0xc527,
- 0xc529, 0xc543,
- 0xc545, 0xc55f,
- 0xc561, 0xc57b,
- 0xc57d, 0xc597,
- 0xc599, 0xc5b3,
- 0xc5b5, 0xc5cf,
- 0xc5d1, 0xc5eb,
- 0xc5ed, 0xc607,
- 0xc609, 0xc623,
- 0xc625, 0xc63f,
- 0xc641, 0xc65b,
- 0xc65d, 0xc677,
- 0xc679, 0xc693,
- 0xc695, 0xc6af,
- 0xc6b1, 0xc6cb,
- 0xc6cd, 0xc6e7,
- 0xc6e9, 0xc703,
- 0xc705, 0xc71f,
- 0xc721, 0xc73b,
- 0xc73d, 0xc757,
- 0xc759, 0xc773,
- 0xc775, 0xc78f,
- 0xc791, 0xc7ab,
- 0xc7ad, 0xc7c7,
- 0xc7c9, 0xc7e3,
- 0xc7e5, 0xc7ff,
- 0xc801, 0xc81b,
- 0xc81d, 0xc837,
- 0xc839, 0xc853,
- 0xc855, 0xc86f,
- 0xc871, 0xc88b,
- 0xc88d, 0xc8a7,
- 0xc8a9, 0xc8c3,
- 0xc8c5, 0xc8df,
- 0xc8e1, 0xc8fb,
- 0xc8fd, 0xc917,
- 0xc919, 0xc933,
- 0xc935, 0xc94f,
- 0xc951, 0xc96b,
- 0xc96d, 0xc987,
- 0xc989, 0xc9a3,
- 0xc9a5, 0xc9bf,
- 0xc9c1, 0xc9db,
- 0xc9dd, 0xc9f7,
- 0xc9f9, 0xca13,
- 0xca15, 0xca2f,
- 0xca31, 0xca4b,
- 0xca4d, 0xca67,
- 0xca69, 0xca83,
- 0xca85, 0xca9f,
- 0xcaa1, 0xcabb,
- 0xcabd, 0xcad7,
- 0xcad9, 0xcaf3,
- 0xcaf5, 0xcb0f,
- 0xcb11, 0xcb2b,
- 0xcb2d, 0xcb47,
- 0xcb49, 0xcb63,
- 0xcb65, 0xcb7f,
- 0xcb81, 0xcb9b,
- 0xcb9d, 0xcbb7,
- 0xcbb9, 0xcbd3,
- 0xcbd5, 0xcbef,
- 0xcbf1, 0xcc0b,
- 0xcc0d, 0xcc27,
- 0xcc29, 0xcc43,
- 0xcc45, 0xcc5f,
- 0xcc61, 0xcc7b,
- 0xcc7d, 0xcc97,
- 0xcc99, 0xccb3,
- 0xccb5, 0xcccf,
- 0xccd1, 0xcceb,
- 0xcced, 0xcd07,
- 0xcd09, 0xcd23,
- 0xcd25, 0xcd3f,
- 0xcd41, 0xcd5b,
- 0xcd5d, 0xcd77,
- 0xcd79, 0xcd93,
- 0xcd95, 0xcdaf,
- 0xcdb1, 0xcdcb,
- 0xcdcd, 0xcde7,
- 0xcde9, 0xce03,
- 0xce05, 0xce1f,
- 0xce21, 0xce3b,
- 0xce3d, 0xce57,
- 0xce59, 0xce73,
- 0xce75, 0xce8f,
- 0xce91, 0xceab,
- 0xcead, 0xcec7,
- 0xcec9, 0xcee3,
- 0xcee5, 0xceff,
- 0xcf01, 0xcf1b,
- 0xcf1d, 0xcf37,
- 0xcf39, 0xcf53,
- 0xcf55, 0xcf6f,
- 0xcf71, 0xcf8b,
- 0xcf8d, 0xcfa7,
- 0xcfa9, 0xcfc3,
- 0xcfc5, 0xcfdf,
- 0xcfe1, 0xcffb,
- 0xcffd, 0xd017,
- 0xd019, 0xd033,
- 0xd035, 0xd04f,
- 0xd051, 0xd06b,
- 0xd06d, 0xd087,
- 0xd089, 0xd0a3,
- 0xd0a5, 0xd0bf,
- 0xd0c1, 0xd0db,
- 0xd0dd, 0xd0f7,
- 0xd0f9, 0xd113,
- 0xd115, 0xd12f,
- 0xd131, 0xd14b,
- 0xd14d, 0xd167,
- 0xd169, 0xd183,
- 0xd185, 0xd19f,
- 0xd1a1, 0xd1bb,
- 0xd1bd, 0xd1d7,
- 0xd1d9, 0xd1f3,
- 0xd1f5, 0xd20f,
- 0xd211, 0xd22b,
- 0xd22d, 0xd247,
- 0xd249, 0xd263,
- 0xd265, 0xd27f,
- 0xd281, 0xd29b,
- 0xd29d, 0xd2b7,
- 0xd2b9, 0xd2d3,
- 0xd2d5, 0xd2ef,
- 0xd2f1, 0xd30b,
- 0xd30d, 0xd327,
- 0xd329, 0xd343,
- 0xd345, 0xd35f,
- 0xd361, 0xd37b,
- 0xd37d, 0xd397,
- 0xd399, 0xd3b3,
- 0xd3b5, 0xd3cf,
- 0xd3d1, 0xd3eb,
- 0xd3ed, 0xd407,
- 0xd409, 0xd423,
- 0xd425, 0xd43f,
- 0xd441, 0xd45b,
- 0xd45d, 0xd477,
- 0xd479, 0xd493,
- 0xd495, 0xd4af,
- 0xd4b1, 0xd4cb,
- 0xd4cd, 0xd4e7,
- 0xd4e9, 0xd503,
- 0xd505, 0xd51f,
- 0xd521, 0xd53b,
- 0xd53d, 0xd557,
- 0xd559, 0xd573,
- 0xd575, 0xd58f,
- 0xd591, 0xd5ab,
- 0xd5ad, 0xd5c7,
- 0xd5c9, 0xd5e3,
- 0xd5e5, 0xd5ff,
- 0xd601, 0xd61b,
- 0xd61d, 0xd637,
- 0xd639, 0xd653,
- 0xd655, 0xd66f,
- 0xd671, 0xd68b,
- 0xd68d, 0xd6a7,
- 0xd6a9, 0xd6c3,
- 0xd6c5, 0xd6df,
- 0xd6e1, 0xd6fb,
- 0xd6fd, 0xd717,
- 0xd719, 0xd733,
- 0xd735, 0xd74f,
- 0xd751, 0xd76b,
- 0xd76d, 0xd787,
- 0xd789, 0xd7a3,
-}; /* CR_Grapheme_Cluster_Break_LVT */
-
-/* 'Grapheme_Cluster_Break_E_Base': Grapheme_Cluster_Break=E_Base */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_E_Base[] = {
- 31,
- 0x261d, 0x261d,
- 0x26f9, 0x26f9,
- 0x270a, 0x270d,
- 0x1f385, 0x1f385,
- 0x1f3c2, 0x1f3c4,
- 0x1f3c7, 0x1f3c7,
- 0x1f3ca, 0x1f3cc,
- 0x1f442, 0x1f443,
- 0x1f446, 0x1f450,
- 0x1f46e, 0x1f46e,
- 0x1f470, 0x1f478,
- 0x1f47c, 0x1f47c,
- 0x1f481, 0x1f483,
- 0x1f485, 0x1f487,
- 0x1f4aa, 0x1f4aa,
- 0x1f574, 0x1f575,
- 0x1f57a, 0x1f57a,
- 0x1f590, 0x1f590,
- 0x1f595, 0x1f596,
- 0x1f645, 0x1f647,
- 0x1f64b, 0x1f64f,
- 0x1f6a3, 0x1f6a3,
- 0x1f6b4, 0x1f6b6,
- 0x1f6c0, 0x1f6c0,
- 0x1f6cc, 0x1f6cc,
- 0x1f918, 0x1f91c,
- 0x1f91e, 0x1f91f,
- 0x1f926, 0x1f926,
- 0x1f930, 0x1f939,
- 0x1f93d, 0x1f93e,
- 0x1f9d1, 0x1f9dd,
-}; /* CR_Grapheme_Cluster_Break_E_Base */
-
-/* 'Grapheme_Cluster_Break_E_Modifier': Grapheme_Cluster_Break=E_Modifier */
-#define CR_Grapheme_Cluster_Break_E_Modifier CR_Emoji_Modifier
-
-/* 'Grapheme_Cluster_Break_ZWJ': Grapheme_Cluster_Break=ZWJ */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_ZWJ[] = {
- 1,
- 0x200d, 0x200d,
-}; /* CR_Grapheme_Cluster_Break_ZWJ */
-
-/* 'Grapheme_Cluster_Break_Glue_After_Zwj': Grapheme_Cluster_Break=Glue_After_Zwj */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_Glue_After_Zwj[] = {
- 20,
- 0x2640, 0x2640,
- 0x2642, 0x2642,
- 0x2695, 0x2696,
- 0x2708, 0x2708,
- 0x2764, 0x2764,
- 0x1f308, 0x1f308,
- 0x1f33e, 0x1f33e,
- 0x1f373, 0x1f373,
- 0x1f393, 0x1f393,
- 0x1f3a4, 0x1f3a4,
- 0x1f3a8, 0x1f3a8,
- 0x1f3eb, 0x1f3eb,
- 0x1f3ed, 0x1f3ed,
- 0x1f48b, 0x1f48b,
- 0x1f4bb, 0x1f4bc,
- 0x1f527, 0x1f527,
- 0x1f52c, 0x1f52c,
- 0x1f5e8, 0x1f5e8,
- 0x1f680, 0x1f680,
- 0x1f692, 0x1f692,
-}; /* CR_Grapheme_Cluster_Break_Glue_After_Zwj */
-
-/* 'Grapheme_Cluster_Break_E_Base_GAZ': Grapheme_Cluster_Break=E_Base_GAZ */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_E_Base_GAZ[] = {
- 1,
- 0x1f466, 0x1f469,
-}; /* CR_Grapheme_Cluster_Break_E_Base_GAZ */
-
-/* 'In_Basic_Latin': Block */
-#define CR_In_Basic_Latin CR_ASCII
-
-/* 'In_Latin_1_Supplement': Block */
-static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
- 1,
- 0x0080, 0x00ff,
-}; /* CR_In_Latin_1_Supplement */
-
-/* 'In_Latin_Extended_A': Block */
-static const OnigCodePoint CR_In_Latin_Extended_A[] = {
- 1,
- 0x0100, 0x017f,
-}; /* CR_In_Latin_Extended_A */
-
-/* 'In_Latin_Extended_B': Block */
-static const OnigCodePoint CR_In_Latin_Extended_B[] = {
- 1,
- 0x0180, 0x024f,
-}; /* CR_In_Latin_Extended_B */
-
-/* 'In_IPA_Extensions': Block */
-static const OnigCodePoint CR_In_IPA_Extensions[] = {
- 1,
- 0x0250, 0x02af,
-}; /* CR_In_IPA_Extensions */
-
-/* 'In_Spacing_Modifier_Letters': Block */
-static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
- 1,
- 0x02b0, 0x02ff,
-}; /* CR_In_Spacing_Modifier_Letters */
-
-/* 'In_Combining_Diacritical_Marks': Block */
-static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
- 1,
- 0x0300, 0x036f,
-}; /* CR_In_Combining_Diacritical_Marks */
-
-/* 'In_Greek_and_Coptic': Block */
-static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
- 1,
- 0x0370, 0x03ff,
-}; /* CR_In_Greek_and_Coptic */
-
-/* 'In_Cyrillic': Block */
-static const OnigCodePoint CR_In_Cyrillic[] = {
- 1,
- 0x0400, 0x04ff,
-}; /* CR_In_Cyrillic */
-
-/* 'In_Cyrillic_Supplement': Block */
-static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
- 1,
- 0x0500, 0x052f,
-}; /* CR_In_Cyrillic_Supplement */
-
-/* 'In_Armenian': Block */
-static const OnigCodePoint CR_In_Armenian[] = {
- 1,
- 0x0530, 0x058f,
-}; /* CR_In_Armenian */
-
-/* 'In_Hebrew': Block */
-static const OnigCodePoint CR_In_Hebrew[] = {
- 1,
- 0x0590, 0x05ff,
-}; /* CR_In_Hebrew */
-
-/* 'In_Arabic': Block */
-static const OnigCodePoint CR_In_Arabic[] = {
- 1,
- 0x0600, 0x06ff,
-}; /* CR_In_Arabic */
-
-/* 'In_Syriac': Block */
-static const OnigCodePoint CR_In_Syriac[] = {
- 1,
- 0x0700, 0x074f,
-}; /* CR_In_Syriac */
-
-/* 'In_Arabic_Supplement': Block */
-static const OnigCodePoint CR_In_Arabic_Supplement[] = {
- 1,
- 0x0750, 0x077f,
-}; /* CR_In_Arabic_Supplement */
-
-/* 'In_Thaana': Block */
-static const OnigCodePoint CR_In_Thaana[] = {
- 1,
- 0x0780, 0x07bf,
-}; /* CR_In_Thaana */
-
-/* 'In_NKo': Block */
-static const OnigCodePoint CR_In_NKo[] = {
- 1,
- 0x07c0, 0x07ff,
-}; /* CR_In_NKo */
-
-/* 'In_Samaritan': Block */
-static const OnigCodePoint CR_In_Samaritan[] = {
- 1,
- 0x0800, 0x083f,
-}; /* CR_In_Samaritan */
-
-/* 'In_Mandaic': Block */
-static const OnigCodePoint CR_In_Mandaic[] = {
- 1,
- 0x0840, 0x085f,
-}; /* CR_In_Mandaic */
-
-/* 'In_Syriac_Supplement': Block */
-static const OnigCodePoint CR_In_Syriac_Supplement[] = {
- 1,
- 0x0860, 0x086f,
-}; /* CR_In_Syriac_Supplement */
-
-/* 'In_Arabic_Extended_A': Block */
-static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
- 1,
- 0x08a0, 0x08ff,
-}; /* CR_In_Arabic_Extended_A */
-
-/* 'In_Devanagari': Block */
-static const OnigCodePoint CR_In_Devanagari[] = {
- 1,
- 0x0900, 0x097f,
-}; /* CR_In_Devanagari */
-
-/* 'In_Bengali': Block */
-static const OnigCodePoint CR_In_Bengali[] = {
- 1,
- 0x0980, 0x09ff,
-}; /* CR_In_Bengali */
-
-/* 'In_Gurmukhi': Block */
-static const OnigCodePoint CR_In_Gurmukhi[] = {
- 1,
- 0x0a00, 0x0a7f,
-}; /* CR_In_Gurmukhi */
-
-/* 'In_Gujarati': Block */
-static const OnigCodePoint CR_In_Gujarati[] = {
- 1,
- 0x0a80, 0x0aff,
-}; /* CR_In_Gujarati */
-
-/* 'In_Oriya': Block */
-static const OnigCodePoint CR_In_Oriya[] = {
- 1,
- 0x0b00, 0x0b7f,
-}; /* CR_In_Oriya */
-
-/* 'In_Tamil': Block */
-static const OnigCodePoint CR_In_Tamil[] = {
- 1,
- 0x0b80, 0x0bff,
-}; /* CR_In_Tamil */
-
-/* 'In_Telugu': Block */
-static const OnigCodePoint CR_In_Telugu[] = {
- 1,
- 0x0c00, 0x0c7f,
-}; /* CR_In_Telugu */
-
-/* 'In_Kannada': Block */
-static const OnigCodePoint CR_In_Kannada[] = {
- 1,
- 0x0c80, 0x0cff,
-}; /* CR_In_Kannada */
-
-/* 'In_Malayalam': Block */
-static const OnigCodePoint CR_In_Malayalam[] = {
- 1,
- 0x0d00, 0x0d7f,
-}; /* CR_In_Malayalam */
-
-/* 'In_Sinhala': Block */
-static const OnigCodePoint CR_In_Sinhala[] = {
- 1,
- 0x0d80, 0x0dff,
-}; /* CR_In_Sinhala */
-
-/* 'In_Thai': Block */
-static const OnigCodePoint CR_In_Thai[] = {
- 1,
- 0x0e00, 0x0e7f,
-}; /* CR_In_Thai */
-
-/* 'In_Lao': Block */
-static const OnigCodePoint CR_In_Lao[] = {
- 1,
- 0x0e80, 0x0eff,
-}; /* CR_In_Lao */
-
-/* 'In_Tibetan': Block */
-static const OnigCodePoint CR_In_Tibetan[] = {
- 1,
- 0x0f00, 0x0fff,
-}; /* CR_In_Tibetan */
-
-/* 'In_Myanmar': Block */
-static const OnigCodePoint CR_In_Myanmar[] = {
- 1,
- 0x1000, 0x109f,
-}; /* CR_In_Myanmar */
-
-/* 'In_Georgian': Block */
-static const OnigCodePoint CR_In_Georgian[] = {
- 1,
- 0x10a0, 0x10ff,
-}; /* CR_In_Georgian */
-
-/* 'In_Hangul_Jamo': Block */
-static const OnigCodePoint CR_In_Hangul_Jamo[] = {
- 1,
- 0x1100, 0x11ff,
-}; /* CR_In_Hangul_Jamo */
-
-/* 'In_Ethiopic': Block */
-static const OnigCodePoint CR_In_Ethiopic[] = {
- 1,
- 0x1200, 0x137f,
-}; /* CR_In_Ethiopic */
-
-/* 'In_Ethiopic_Supplement': Block */
-static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
- 1,
- 0x1380, 0x139f,
-}; /* CR_In_Ethiopic_Supplement */
-
-/* 'In_Cherokee': Block */
-static const OnigCodePoint CR_In_Cherokee[] = {
- 1,
- 0x13a0, 0x13ff,
-}; /* CR_In_Cherokee */
-
-/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
-static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
- 1,
- 0x1400, 0x167f,
-}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
-
-/* 'In_Ogham': Block */
-static const OnigCodePoint CR_In_Ogham[] = {
- 1,
- 0x1680, 0x169f,
-}; /* CR_In_Ogham */
-
-/* 'In_Runic': Block */
-static const OnigCodePoint CR_In_Runic[] = {
- 1,
- 0x16a0, 0x16ff,
-}; /* CR_In_Runic */
-
-/* 'In_Tagalog': Block */
-static const OnigCodePoint CR_In_Tagalog[] = {
- 1,
- 0x1700, 0x171f,
-}; /* CR_In_Tagalog */
-
-/* 'In_Hanunoo': Block */
-static const OnigCodePoint CR_In_Hanunoo[] = {
- 1,
- 0x1720, 0x173f,
-}; /* CR_In_Hanunoo */
-
-/* 'In_Buhid': Block */
-static const OnigCodePoint CR_In_Buhid[] = {
- 1,
- 0x1740, 0x175f,
-}; /* CR_In_Buhid */
-
-/* 'In_Tagbanwa': Block */
-static const OnigCodePoint CR_In_Tagbanwa[] = {
- 1,
- 0x1760, 0x177f,
-}; /* CR_In_Tagbanwa */
-
-/* 'In_Khmer': Block */
-static const OnigCodePoint CR_In_Khmer[] = {
- 1,
- 0x1780, 0x17ff,
-}; /* CR_In_Khmer */
-
-/* 'In_Mongolian': Block */
-static const OnigCodePoint CR_In_Mongolian[] = {
- 1,
- 0x1800, 0x18af,
-}; /* CR_In_Mongolian */
-
-/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
-static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
- 1,
- 0x18b0, 0x18ff,
-}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
-
-/* 'In_Limbu': Block */
-static const OnigCodePoint CR_In_Limbu[] = {
- 1,
- 0x1900, 0x194f,
-}; /* CR_In_Limbu */
-
-/* 'In_Tai_Le': Block */
-static const OnigCodePoint CR_In_Tai_Le[] = {
- 1,
- 0x1950, 0x197f,
-}; /* CR_In_Tai_Le */
-
-/* 'In_New_Tai_Lue': Block */
-static const OnigCodePoint CR_In_New_Tai_Lue[] = {
- 1,
- 0x1980, 0x19df,
-}; /* CR_In_New_Tai_Lue */
-
-/* 'In_Khmer_Symbols': Block */
-static const OnigCodePoint CR_In_Khmer_Symbols[] = {
- 1,
- 0x19e0, 0x19ff,
-}; /* CR_In_Khmer_Symbols */
-
-/* 'In_Buginese': Block */
-static const OnigCodePoint CR_In_Buginese[] = {
- 1,
- 0x1a00, 0x1a1f,
-}; /* CR_In_Buginese */
-
-/* 'In_Tai_Tham': Block */
-static const OnigCodePoint CR_In_Tai_Tham[] = {
- 1,
- 0x1a20, 0x1aaf,
-}; /* CR_In_Tai_Tham */
-
-/* 'In_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,
- 0x1b00, 0x1b7f,
-}; /* CR_In_Balinese */
-
-/* 'In_Sundanese': Block */
-static const OnigCodePoint CR_In_Sundanese[] = {
- 1,
- 0x1b80, 0x1bbf,
-}; /* CR_In_Sundanese */
-
-/* 'In_Batak': Block */
-static const OnigCodePoint CR_In_Batak[] = {
- 1,
- 0x1bc0, 0x1bff,
-}; /* CR_In_Batak */
-
-/* 'In_Lepcha': Block */
-static const OnigCodePoint CR_In_Lepcha[] = {
- 1,
- 0x1c00, 0x1c4f,
-}; /* CR_In_Lepcha */
-
-/* 'In_Ol_Chiki': Block */
-#define CR_In_Ol_Chiki CR_Ol_Chiki
-
-/* 'In_Cyrillic_Extended_C': Block */
-static const OnigCodePoint CR_In_Cyrillic_Extended_C[] = {
- 1,
- 0x1c80, 0x1c8f,
-}; /* CR_In_Cyrillic_Extended_C */
-
-/* 'In_Sundanese_Supplement': Block */
-static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
- 1,
- 0x1cc0, 0x1ccf,
-}; /* CR_In_Sundanese_Supplement */
-
-/* 'In_Vedic_Extensions': Block */
-static const OnigCodePoint CR_In_Vedic_Extensions[] = {
- 1,
- 0x1cd0, 0x1cff,
-}; /* CR_In_Vedic_Extensions */
-
-/* 'In_Phonetic_Extensions': Block */
-static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
- 1,
- 0x1d00, 0x1d7f,
-}; /* CR_In_Phonetic_Extensions */
-
-/* 'In_Phonetic_Extensions_Supplement': Block */
-static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
- 1,
- 0x1d80, 0x1dbf,
-}; /* CR_In_Phonetic_Extensions_Supplement */
-
-/* 'In_Combining_Diacritical_Marks_Supplement': Block */
-static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
- 1,
- 0x1dc0, 0x1dff,
-}; /* CR_In_Combining_Diacritical_Marks_Supplement */
-
-/* 'In_Latin_Extended_Additional': Block */
-static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
- 1,
- 0x1e00, 0x1eff,
-}; /* CR_In_Latin_Extended_Additional */
-
-/* 'In_Greek_Extended': Block */
-static const OnigCodePoint CR_In_Greek_Extended[] = {
- 1,
- 0x1f00, 0x1fff,
-}; /* CR_In_Greek_Extended */
-
-/* 'In_General_Punctuation': Block */
-static const OnigCodePoint CR_In_General_Punctuation[] = {
- 1,
- 0x2000, 0x206f,
-}; /* CR_In_General_Punctuation */
-
-/* 'In_Superscripts_and_Subscripts': Block */
-static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
- 1,
- 0x2070, 0x209f,
-}; /* CR_In_Superscripts_and_Subscripts */
-
-/* 'In_Currency_Symbols': Block */
-static const OnigCodePoint CR_In_Currency_Symbols[] = {
- 1,
- 0x20a0, 0x20cf,
-}; /* CR_In_Currency_Symbols */
-
-/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
-static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
- 1,
- 0x20d0, 0x20ff,
-}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
-
-/* 'In_Letterlike_Symbols': Block */
-static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
- 1,
- 0x2100, 0x214f,
-}; /* CR_In_Letterlike_Symbols */
-
-/* 'In_Number_Forms': Block */
-static const OnigCodePoint CR_In_Number_Forms[] = {
- 1,
- 0x2150, 0x218f,
-}; /* CR_In_Number_Forms */
-
-/* 'In_Arrows': Block */
-static const OnigCodePoint CR_In_Arrows[] = {
- 1,
- 0x2190, 0x21ff,
-}; /* CR_In_Arrows */
-
-/* 'In_Mathematical_Operators': Block */
-static const OnigCodePoint CR_In_Mathematical_Operators[] = {
- 1,
- 0x2200, 0x22ff,
-}; /* CR_In_Mathematical_Operators */
-
-/* 'In_Miscellaneous_Technical': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
- 1,
- 0x2300, 0x23ff,
-}; /* CR_In_Miscellaneous_Technical */
-
-/* 'In_Control_Pictures': Block */
-static const OnigCodePoint CR_In_Control_Pictures[] = {
- 1,
- 0x2400, 0x243f,
-}; /* CR_In_Control_Pictures */
-
-/* 'In_Optical_Character_Recognition': Block */
-static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
- 1,
- 0x2440, 0x245f,
-}; /* CR_In_Optical_Character_Recognition */
-
-/* 'In_Enclosed_Alphanumerics': Block */
-static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
- 1,
- 0x2460, 0x24ff,
-}; /* CR_In_Enclosed_Alphanumerics */
-
-/* 'In_Box_Drawing': Block */
-static const OnigCodePoint CR_In_Box_Drawing[] = {
- 1,
- 0x2500, 0x257f,
-}; /* CR_In_Box_Drawing */
-
-/* 'In_Block_Elements': Block */
-static const OnigCodePoint CR_In_Block_Elements[] = {
- 1,
- 0x2580, 0x259f,
-}; /* CR_In_Block_Elements */
-
-/* 'In_Geometric_Shapes': Block */
-static const OnigCodePoint CR_In_Geometric_Shapes[] = {
- 1,
- 0x25a0, 0x25ff,
-}; /* CR_In_Geometric_Shapes */
-
-/* 'In_Miscellaneous_Symbols': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
- 1,
- 0x2600, 0x26ff,
-}; /* CR_In_Miscellaneous_Symbols */
-
-/* 'In_Dingbats': Block */
-static const OnigCodePoint CR_In_Dingbats[] = {
- 1,
- 0x2700, 0x27bf,
-}; /* CR_In_Dingbats */
-
-/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
- 1,
- 0x27c0, 0x27ef,
-}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
-
-/* 'In_Supplemental_Arrows_A': Block */
-static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
- 1,
- 0x27f0, 0x27ff,
-}; /* CR_In_Supplemental_Arrows_A */
-
-/* 'In_Braille_Patterns': Block */
-#define CR_In_Braille_Patterns CR_Braille
-
-/* 'In_Supplemental_Arrows_B': Block */
-static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
- 1,
- 0x2900, 0x297f,
-}; /* CR_In_Supplemental_Arrows_B */
-
-/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
- 1,
- 0x2980, 0x29ff,
-}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
-
-/* 'In_Supplemental_Mathematical_Operators': Block */
-static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
- 1,
- 0x2a00, 0x2aff,
-}; /* CR_In_Supplemental_Mathematical_Operators */
-
-/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
- 1,
- 0x2b00, 0x2bff,
-}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
-
-/* 'In_Glagolitic': Block */
-static const OnigCodePoint CR_In_Glagolitic[] = {
- 1,
- 0x2c00, 0x2c5f,
-}; /* CR_In_Glagolitic */
-
-/* 'In_Latin_Extended_C': Block */
-static const OnigCodePoint CR_In_Latin_Extended_C[] = {
- 1,
- 0x2c60, 0x2c7f,
-}; /* CR_In_Latin_Extended_C */
-
-/* 'In_Coptic': Block */
-static const OnigCodePoint CR_In_Coptic[] = {
- 1,
- 0x2c80, 0x2cff,
-}; /* CR_In_Coptic */
-
-/* 'In_Georgian_Supplement': Block */
-static const OnigCodePoint CR_In_Georgian_Supplement[] = {
- 1,
- 0x2d00, 0x2d2f,
-}; /* CR_In_Georgian_Supplement */
-
-/* 'In_Tifinagh': Block */
-static const OnigCodePoint CR_In_Tifinagh[] = {
- 1,
- 0x2d30, 0x2d7f,
-}; /* CR_In_Tifinagh */
-
-/* 'In_Ethiopic_Extended': Block */
-static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
- 1,
- 0x2d80, 0x2ddf,
-}; /* CR_In_Ethiopic_Extended */
-
-/* 'In_Cyrillic_Extended_A': Block */
-static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
- 1,
- 0x2de0, 0x2dff,
-}; /* CR_In_Cyrillic_Extended_A */
-
-/* 'In_Supplemental_Punctuation': Block */
-static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
- 1,
- 0x2e00, 0x2e7f,
-}; /* CR_In_Supplemental_Punctuation */
-
-/* 'In_CJK_Radicals_Supplement': Block */
-static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
- 1,
- 0x2e80, 0x2eff,
-}; /* CR_In_CJK_Radicals_Supplement */
-
-/* 'In_Kangxi_Radicals': Block */
-static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
- 1,
- 0x2f00, 0x2fdf,
-}; /* CR_In_Kangxi_Radicals */
-
-/* 'In_Ideographic_Description_Characters': Block */
-static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
- 1,
- 0x2ff0, 0x2fff,
-}; /* CR_In_Ideographic_Description_Characters */
-
-/* 'In_CJK_Symbols_and_Punctuation': Block */
-static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
- 1,
- 0x3000, 0x303f,
-}; /* CR_In_CJK_Symbols_and_Punctuation */
-
-/* 'In_Hiragana': Block */
-static const OnigCodePoint CR_In_Hiragana[] = {
- 1,
- 0x3040, 0x309f,
-}; /* CR_In_Hiragana */
-
-/* 'In_Katakana': Block */
-static const OnigCodePoint CR_In_Katakana[] = {
- 1,
- 0x30a0, 0x30ff,
-}; /* CR_In_Katakana */
-
-/* 'In_Bopomofo': Block */
-static const OnigCodePoint CR_In_Bopomofo[] = {
- 1,
- 0x3100, 0x312f,
-}; /* CR_In_Bopomofo */
-
-/* 'In_Hangul_Compatibility_Jamo': Block */
-static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
- 1,
- 0x3130, 0x318f,
-}; /* CR_In_Hangul_Compatibility_Jamo */
-
-/* 'In_Kanbun': Block */
-static const OnigCodePoint CR_In_Kanbun[] = {
- 1,
- 0x3190, 0x319f,
-}; /* CR_In_Kanbun */
-
-/* 'In_Bopomofo_Extended': Block */
-static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
- 1,
- 0x31a0, 0x31bf,
-}; /* CR_In_Bopomofo_Extended */
-
-/* 'In_CJK_Strokes': Block */
-static const OnigCodePoint CR_In_CJK_Strokes[] = {
- 1,
- 0x31c0, 0x31ef,
-}; /* CR_In_CJK_Strokes */
-
-/* 'In_Katakana_Phonetic_Extensions': Block */
-static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
- 1,
- 0x31f0, 0x31ff,
-}; /* CR_In_Katakana_Phonetic_Extensions */
-
-/* 'In_Enclosed_CJK_Letters_and_Months': Block */
-static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
- 1,
- 0x3200, 0x32ff,
-}; /* CR_In_Enclosed_CJK_Letters_and_Months */
-
-/* 'In_CJK_Compatibility': Block */
-static const OnigCodePoint CR_In_CJK_Compatibility[] = {
- 1,
- 0x3300, 0x33ff,
-}; /* CR_In_CJK_Compatibility */
-
-/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
-static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
- 1,
- 0x3400, 0x4dbf,
-}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
-
-/* 'In_Yijing_Hexagram_Symbols': Block */
-static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
- 1,
- 0x4dc0, 0x4dff,
-}; /* CR_In_Yijing_Hexagram_Symbols */
-
-/* 'In_CJK_Unified_Ideographs': Block */
-static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
- 1,
- 0x4e00, 0x9fff,
-}; /* CR_In_CJK_Unified_Ideographs */
-
-/* 'In_Yi_Syllables': Block */
-static const OnigCodePoint CR_In_Yi_Syllables[] = {
- 1,
- 0xa000, 0xa48f,
-}; /* CR_In_Yi_Syllables */
-
-/* 'In_Yi_Radicals': Block */
-static const OnigCodePoint CR_In_Yi_Radicals[] = {
- 1,
- 0xa490, 0xa4cf,
-}; /* CR_In_Yi_Radicals */
-
-/* 'In_Lisu': Block */
-#define CR_In_Lisu CR_Lisu
-
-/* 'In_Vai': Block */
-static const OnigCodePoint CR_In_Vai[] = {
- 1,
- 0xa500, 0xa63f,
-}; /* CR_In_Vai */
-
-/* 'In_Cyrillic_Extended_B': Block */
-static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
- 1,
- 0xa640, 0xa69f,
-}; /* CR_In_Cyrillic_Extended_B */
-
-/* 'In_Bamum': Block */
-static const OnigCodePoint CR_In_Bamum[] = {
- 1,
- 0xa6a0, 0xa6ff,
-}; /* CR_In_Bamum */
-
-/* 'In_Modifier_Tone_Letters': Block */
-static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
- 1,
- 0xa700, 0xa71f,
-}; /* CR_In_Modifier_Tone_Letters */
-
-/* 'In_Latin_Extended_D': Block */
-static const OnigCodePoint CR_In_Latin_Extended_D[] = {
- 1,
- 0xa720, 0xa7ff,
-}; /* CR_In_Latin_Extended_D */
-
-/* 'In_Syloti_Nagri': Block */
-static const OnigCodePoint CR_In_Syloti_Nagri[] = {
- 1,
- 0xa800, 0xa82f,
-}; /* CR_In_Syloti_Nagri */
-
-/* 'In_Common_Indic_Number_Forms': Block */
-static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
- 1,
- 0xa830, 0xa83f,
-}; /* CR_In_Common_Indic_Number_Forms */
-
-/* 'In_Phags_pa': Block */
-static const OnigCodePoint CR_In_Phags_pa[] = {
- 1,
- 0xa840, 0xa87f,
-}; /* CR_In_Phags_pa */
-
-/* 'In_Saurashtra': Block */
-static const OnigCodePoint CR_In_Saurashtra[] = {
- 1,
- 0xa880, 0xa8df,
-}; /* CR_In_Saurashtra */
-
-/* 'In_Devanagari_Extended': Block */
-static const OnigCodePoint CR_In_Devanagari_Extended[] = {
- 1,
- 0xa8e0, 0xa8ff,
-}; /* CR_In_Devanagari_Extended */
-
-/* 'In_Kayah_Li': Block */
-static const OnigCodePoint CR_In_Kayah_Li[] = {
- 1,
- 0xa900, 0xa92f,
-}; /* CR_In_Kayah_Li */
-
-/* 'In_Rejang': Block */
-static const OnigCodePoint CR_In_Rejang[] = {
- 1,
- 0xa930, 0xa95f,
-}; /* CR_In_Rejang */
-
-/* 'In_Hangul_Jamo_Extended_A': Block */
-static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
- 1,
- 0xa960, 0xa97f,
-}; /* CR_In_Hangul_Jamo_Extended_A */
-
-/* 'In_Javanese': Block */
-static const OnigCodePoint CR_In_Javanese[] = {
- 1,
- 0xa980, 0xa9df,
-}; /* CR_In_Javanese */
-
-/* 'In_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,
- 0xaa00, 0xaa5f,
-}; /* CR_In_Cham */
-
-/* 'In_Myanmar_Extended_A': Block */
-static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
- 1,
- 0xaa60, 0xaa7f,
-}; /* CR_In_Myanmar_Extended_A */
-
-/* 'In_Tai_Viet': Block */
-static const OnigCodePoint CR_In_Tai_Viet[] = {
- 1,
- 0xaa80, 0xaadf,
-}; /* CR_In_Tai_Viet */
-
-/* 'In_Meetei_Mayek_Extensions': Block */
-static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
- 1,
- 0xaae0, 0xaaff,
-}; /* CR_In_Meetei_Mayek_Extensions */
-
-/* 'In_Ethiopic_Extended_A': Block */
-static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
- 1,
- 0xab00, 0xab2f,
-}; /* CR_In_Ethiopic_Extended_A */
-
-/* 'In_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,
- 0xabc0, 0xabff,
-}; /* CR_In_Meetei_Mayek */
-
-/* 'In_Hangul_Syllables': Block */
-static const OnigCodePoint CR_In_Hangul_Syllables[] = {
- 1,
- 0xac00, 0xd7af,
-}; /* CR_In_Hangul_Syllables */
-
-/* 'In_Hangul_Jamo_Extended_B': Block */
-static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
- 1,
- 0xd7b0, 0xd7ff,
-}; /* CR_In_Hangul_Jamo_Extended_B */
-
-/* 'In_High_Surrogates': Block */
-static const OnigCodePoint CR_In_High_Surrogates[] = {
- 1,
- 0xd800, 0xdb7f,
-}; /* CR_In_High_Surrogates */
-
-/* 'In_High_Private_Use_Surrogates': Block */
-static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
- 1,
- 0xdb80, 0xdbff,
-}; /* CR_In_High_Private_Use_Surrogates */
-
-/* 'In_Low_Surrogates': Block */
-static const OnigCodePoint CR_In_Low_Surrogates[] = {
- 1,
- 0xdc00, 0xdfff,
-}; /* CR_In_Low_Surrogates */
-
-/* 'In_Private_Use_Area': Block */
-static const OnigCodePoint CR_In_Private_Use_Area[] = {
- 1,
- 0xe000, 0xf8ff,
-}; /* CR_In_Private_Use_Area */
-
-/* 'In_CJK_Compatibility_Ideographs': Block */
-static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
- 1,
- 0xf900, 0xfaff,
-}; /* CR_In_CJK_Compatibility_Ideographs */
-
-/* 'In_Alphabetic_Presentation_Forms': Block */
-static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
- 1,
- 0xfb00, 0xfb4f,
-}; /* CR_In_Alphabetic_Presentation_Forms */
-
-/* 'In_Arabic_Presentation_Forms_A': Block */
-static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
- 1,
- 0xfb50, 0xfdff,
-}; /* CR_In_Arabic_Presentation_Forms_A */
-
-/* 'In_Variation_Selectors': Block */
-static const OnigCodePoint CR_In_Variation_Selectors[] = {
- 1,
- 0xfe00, 0xfe0f,
-}; /* CR_In_Variation_Selectors */
-
-/* 'In_Vertical_Forms': Block */
-static const OnigCodePoint CR_In_Vertical_Forms[] = {
- 1,
- 0xfe10, 0xfe1f,
-}; /* CR_In_Vertical_Forms */
-
-/* 'In_Combining_Half_Marks': Block */
-static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
- 1,
- 0xfe20, 0xfe2f,
-}; /* CR_In_Combining_Half_Marks */
-
-/* 'In_CJK_Compatibility_Forms': Block */
-static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
- 1,
- 0xfe30, 0xfe4f,
-}; /* CR_In_CJK_Compatibility_Forms */
-
-/* 'In_Small_Form_Variants': Block */
-static const OnigCodePoint CR_In_Small_Form_Variants[] = {
- 1,
- 0xfe50, 0xfe6f,
-}; /* CR_In_Small_Form_Variants */
-
-/* 'In_Arabic_Presentation_Forms_B': Block */
-static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
- 1,
- 0xfe70, 0xfeff,
-}; /* CR_In_Arabic_Presentation_Forms_B */
-
-/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
-static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
- 1,
- 0xff00, 0xffef,
-}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
-
-/* 'In_Specials': Block */
-static const OnigCodePoint CR_In_Specials[] = {
- 1,
- 0xfff0, 0xffff,
-}; /* CR_In_Specials */
-
-/* 'In_Linear_B_Syllabary': Block */
-static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
- 1,
- 0x10000, 0x1007f,
-}; /* CR_In_Linear_B_Syllabary */
-
-/* 'In_Linear_B_Ideograms': Block */
-static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
- 1,
- 0x10080, 0x100ff,
-}; /* CR_In_Linear_B_Ideograms */
-
-/* 'In_Aegean_Numbers': Block */
-static const OnigCodePoint CR_In_Aegean_Numbers[] = {
- 1,
- 0x10100, 0x1013f,
-}; /* CR_In_Aegean_Numbers */
-
-/* 'In_Ancient_Greek_Numbers': Block */
-static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
- 1,
- 0x10140, 0x1018f,
-}; /* CR_In_Ancient_Greek_Numbers */
-
-/* 'In_Ancient_Symbols': Block */
-static const OnigCodePoint CR_In_Ancient_Symbols[] = {
- 1,
- 0x10190, 0x101cf,
-}; /* CR_In_Ancient_Symbols */
-
-/* 'In_Phaistos_Disc': Block */
-static const OnigCodePoint CR_In_Phaistos_Disc[] = {
- 1,
- 0x101d0, 0x101ff,
-}; /* CR_In_Phaistos_Disc */
-
-/* 'In_Lycian': Block */
-static const OnigCodePoint CR_In_Lycian[] = {
- 1,
- 0x10280, 0x1029f,
-}; /* CR_In_Lycian */
-
-/* 'In_Carian': Block */
-static const OnigCodePoint CR_In_Carian[] = {
- 1,
- 0x102a0, 0x102df,
-}; /* CR_In_Carian */
-
-/* 'In_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,
- 0x10300, 0x1032f,
-}; /* CR_In_Old_Italic */
-
-/* 'In_Gothic': Block */
-static const OnigCodePoint CR_In_Gothic[] = {
- 1,
- 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,
- 0x10380, 0x1039f,
-}; /* CR_In_Ugaritic */
-
-/* 'In_Old_Persian': Block */
-static const OnigCodePoint CR_In_Old_Persian[] = {
- 1,
- 0x103a0, 0x103df,
-}; /* CR_In_Old_Persian */
-
-/* 'In_Deseret': Block */
-#define CR_In_Deseret CR_Deseret
-
-/* 'In_Shavian': Block */
-#define CR_In_Shavian CR_Shavian
-
-/* 'In_Osmanya': Block */
-static const OnigCodePoint CR_In_Osmanya[] = {
- 1,
- 0x10480, 0x104af,
-}; /* CR_In_Osmanya */
-
-/* 'In_Osage': Block */
-static const OnigCodePoint CR_In_Osage[] = {
- 1,
- 0x104b0, 0x104ff,
-}; /* CR_In_Osage */
-
-/* '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,
- 0x10800, 0x1083f,
-}; /* CR_In_Cypriot_Syllabary */
-
-/* 'In_Imperial_Aramaic': Block */
-static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
- 1,
- 0x10840, 0x1085f,
-}; /* CR_In_Imperial_Aramaic */
-
-/* 'In_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,
- 0x10900, 0x1091f,
-}; /* CR_In_Phoenician */
-
-/* 'In_Lydian': Block */
-static const OnigCodePoint CR_In_Lydian[] = {
- 1,
- 0x10920, 0x1093f,
-}; /* CR_In_Lydian */
-
-/* 'In_Meroitic_Hieroglyphs': Block */
-#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
-
-/* 'In_Meroitic_Cursive': Block */
-static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
- 1,
- 0x109a0, 0x109ff,
-}; /* CR_In_Meroitic_Cursive */
-
-/* 'In_Kharoshthi': Block */
-static const OnigCodePoint CR_In_Kharoshthi[] = {
- 1,
- 0x10a00, 0x10a5f,
-}; /* CR_In_Kharoshthi */
-
-/* 'In_Old_South_Arabian': Block */
-#define CR_In_Old_South_Arabian CR_Old_South_Arabian
-
-/* 'In_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,
- 0x10b00, 0x10b3f,
-}; /* CR_In_Avestan */
-
-/* 'In_Inscriptional_Parthian': Block */
-static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
- 1,
- 0x10b40, 0x10b5f,
-}; /* CR_In_Inscriptional_Parthian */
-
-/* 'In_Inscriptional_Pahlavi': Block */
-static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
- 1,
- 0x10b60, 0x10b7f,
-}; /* CR_In_Inscriptional_Pahlavi */
-
-/* 'In_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,
- 0x10e60, 0x10e7f,
-}; /* CR_In_Rumi_Numeral_Symbols */
-
-/* 'In_Brahmi': Block */
-static const OnigCodePoint CR_In_Brahmi[] = {
- 1,
- 0x11000, 0x1107f,
-}; /* CR_In_Brahmi */
-
-/* 'In_Kaithi': Block */
-static const OnigCodePoint CR_In_Kaithi[] = {
- 1,
- 0x11080, 0x110cf,
-}; /* CR_In_Kaithi */
-
-/* 'In_Sora_Sompeng': Block */
-static const OnigCodePoint CR_In_Sora_Sompeng[] = {
- 1,
- 0x110d0, 0x110ff,
-}; /* CR_In_Sora_Sompeng */
-
-/* 'In_Chakma': Block */
-static const OnigCodePoint CR_In_Chakma[] = {
- 1,
- 0x11100, 0x1114f,
-}; /* CR_In_Chakma */
-
-/* 'In_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_Newa': Block */
-static const OnigCodePoint CR_In_Newa[] = {
- 1,
- 0x11400, 0x1147f,
-}; /* CR_In_Newa */
-
-/* '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_Mongolian_Supplement': Block */
-static const OnigCodePoint CR_In_Mongolian_Supplement[] = {
- 1,
- 0x11660, 0x1167f,
-}; /* CR_In_Mongolian_Supplement */
-
-/* '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_Zanabazar_Square': Block */
-static const OnigCodePoint CR_In_Zanabazar_Square[] = {
- 1,
- 0x11a00, 0x11a4f,
-}; /* CR_In_Zanabazar_Square */
-
-/* 'In_Soyombo': Block */
-static const OnigCodePoint CR_In_Soyombo[] = {
- 1,
- 0x11a50, 0x11aaf,
-}; /* CR_In_Soyombo */
-
-/* 'In_Pau_Cin_Hau': Block */
-static const OnigCodePoint CR_In_Pau_Cin_Hau[] = {
- 1,
- 0x11ac0, 0x11aff,
-}; /* CR_In_Pau_Cin_Hau */
-
-/* 'In_Bhaiksuki': Block */
-static const OnigCodePoint CR_In_Bhaiksuki[] = {
- 1,
- 0x11c00, 0x11c6f,
-}; /* CR_In_Bhaiksuki */
-
-/* 'In_Marchen': Block */
-static const OnigCodePoint CR_In_Marchen[] = {
- 1,
- 0x11c70, 0x11cbf,
-}; /* CR_In_Marchen */
-
-/* 'In_Masaram_Gondi': Block */
-static const OnigCodePoint CR_In_Masaram_Gondi[] = {
- 1,
- 0x11d00, 0x11d5f,
-}; /* CR_In_Masaram_Gondi */
-
-/* 'In_Cuneiform': Block */
-static const OnigCodePoint CR_In_Cuneiform[] = {
- 1,
- 0x12000, 0x123ff,
-}; /* CR_In_Cuneiform */
-
-/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
-static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
- 1,
- 0x12400, 0x1247f,
-}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
-
-/* 'In_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,
- 0x16f00, 0x16f9f,
-}; /* CR_In_Miao */
-
-/* 'In_Ideographic_Symbols_and_Punctuation': Block */
-static const OnigCodePoint CR_In_Ideographic_Symbols_and_Punctuation[] = {
- 1,
- 0x16fe0, 0x16fff,
-}; /* CR_In_Ideographic_Symbols_and_Punctuation */
-
-/* 'In_Tangut': Block */
-static const OnigCodePoint CR_In_Tangut[] = {
- 1,
- 0x17000, 0x187ff,
-}; /* CR_In_Tangut */
-
-/* 'In_Tangut_Components': Block */
-static const OnigCodePoint CR_In_Tangut_Components[] = {
- 1,
- 0x18800, 0x18aff,
-}; /* CR_In_Tangut_Components */
-
-/* 'In_Kana_Supplement': Block */
-static const OnigCodePoint CR_In_Kana_Supplement[] = {
- 1,
- 0x1b000, 0x1b0ff,
-}; /* CR_In_Kana_Supplement */
-
-/* 'In_Kana_Extended_A': Block */
-static const OnigCodePoint CR_In_Kana_Extended_A[] = {
- 1,
- 0x1b100, 0x1b12f,
-}; /* CR_In_Kana_Extended_A */
-
-/* 'In_Nushu': Block */
-static const OnigCodePoint CR_In_Nushu[] = {
- 1,
- 0x1b170, 0x1b2ff,
-}; /* CR_In_Nushu */
-
-/* '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,
- 0x1d000, 0x1d0ff,
-}; /* CR_In_Byzantine_Musical_Symbols */
-
-/* 'In_Musical_Symbols': Block */
-static const OnigCodePoint CR_In_Musical_Symbols[] = {
- 1,
- 0x1d100, 0x1d1ff,
-}; /* CR_In_Musical_Symbols */
-
-/* 'In_Ancient_Greek_Musical_Notation': Block */
-static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
- 1,
- 0x1d200, 0x1d24f,
-}; /* CR_In_Ancient_Greek_Musical_Notation */
-
-/* 'In_Tai_Xuan_Jing_Symbols': Block */
-static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
- 1,
- 0x1d300, 0x1d35f,
-}; /* CR_In_Tai_Xuan_Jing_Symbols */
-
-/* 'In_Counting_Rod_Numerals': Block */
-static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
- 1,
- 0x1d360, 0x1d37f,
-}; /* CR_In_Counting_Rod_Numerals */
-
-/* 'In_Mathematical_Alphanumeric_Symbols': Block */
-static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
- 1,
- 0x1d400, 0x1d7ff,
-}; /* CR_In_Mathematical_Alphanumeric_Symbols */
-
-/* 'In_Sutton_SignWriting': Block */
-static const OnigCodePoint CR_In_Sutton_SignWriting[] = {
- 1,
- 0x1d800, 0x1daaf,
-}; /* CR_In_Sutton_SignWriting */
-
-/* 'In_Glagolitic_Supplement': Block */
-static const OnigCodePoint CR_In_Glagolitic_Supplement[] = {
- 1,
- 0x1e000, 0x1e02f,
-}; /* CR_In_Glagolitic_Supplement */
-
-/* 'In_Mende_Kikakui': Block */
-static const OnigCodePoint CR_In_Mende_Kikakui[] = {
- 1,
- 0x1e800, 0x1e8df,
-}; /* CR_In_Mende_Kikakui */
-
-/* 'In_Adlam': Block */
-static const OnigCodePoint CR_In_Adlam[] = {
- 1,
- 0x1e900, 0x1e95f,
-}; /* CR_In_Adlam */
-
-/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
-static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
- 1,
- 0x1ee00, 0x1eeff,
-}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
-
-/* 'In_Mahjong_Tiles': Block */
-static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
- 1,
- 0x1f000, 0x1f02f,
-}; /* CR_In_Mahjong_Tiles */
-
-/* 'In_Domino_Tiles': Block */
-static const OnigCodePoint CR_In_Domino_Tiles[] = {
- 1,
- 0x1f030, 0x1f09f,
-}; /* CR_In_Domino_Tiles */
-
-/* 'In_Playing_Cards': Block */
-static const OnigCodePoint CR_In_Playing_Cards[] = {
- 1,
- 0x1f0a0, 0x1f0ff,
-}; /* CR_In_Playing_Cards */
-
-/* 'In_Enclosed_Alphanumeric_Supplement': Block */
-static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
- 1,
- 0x1f100, 0x1f1ff,
-}; /* CR_In_Enclosed_Alphanumeric_Supplement */
-
-/* 'In_Enclosed_Ideographic_Supplement': Block */
-static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
- 1,
- 0x1f200, 0x1f2ff,
-}; /* CR_In_Enclosed_Ideographic_Supplement */
-
-/* 'In_Miscellaneous_Symbols_and_Pictographs': Block */
-static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Pictographs[] = {
- 1,
- 0x1f300, 0x1f5ff,
-}; /* CR_In_Miscellaneous_Symbols_and_Pictographs */
-
-/* 'In_Emoticons': Block */
-static const OnigCodePoint CR_In_Emoticons[] = {
- 1,
- 0x1f600, 0x1f64f,
-}; /* CR_In_Emoticons */
-
-/* 'In_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 */
-
-/* 'In_Alchemical_Symbols': Block */
-static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
- 1,
- 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,
- 0x20000, 0x2a6df,
-}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
-
-/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
-static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
- 1,
- 0x2a700, 0x2b73f,
-}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
-
-/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
-static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
- 1,
- 0x2b740, 0x2b81f,
-}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
-
-/* 'In_CJK_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_Unified_Ideographs_Extension_F': Block */
-static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_F[] = {
- 1,
- 0x2ceb0, 0x2ebef,
-}; /* CR_In_CJK_Unified_Ideographs_Extension_F */
-
-/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
-static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
- 1,
- 0x2f800, 0x2fa1f,
-}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
-
-/* 'In_Tags': Block */
-static const OnigCodePoint CR_In_Tags[] = {
- 1,
- 0xe0000, 0xe007f,
-}; /* CR_In_Tags */
-
-/* 'In_Variation_Selectors_Supplement': Block */
-static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
- 1,
- 0xe0100, 0xe01ef,
-}; /* CR_In_Variation_Selectors_Supplement */
-
-/* 'In_Supplementary_Private_Use_Area_A': Block */
-static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
- 1,
- 0xf0000, 0xfffff,
-}; /* CR_In_Supplementary_Private_Use_Area_A */
-
-/* 'In_Supplementary_Private_Use_Area_B': Block */
-static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
- 1,
- 0x100000, 0x10ffff,
-}; /* CR_In_Supplementary_Private_Use_Area_B */
-
-/* 'In_No_Block': Block */
-static const OnigCodePoint CR_In_No_Block[] = {
- 47,
- 0x0870, 0x089f,
- 0x1c90, 0x1cbf,
- 0x2fe0, 0x2fef,
- 0x10200, 0x1027f,
- 0x103e0, 0x103ff,
- 0x10570, 0x105ff,
- 0x10780, 0x107ff,
- 0x108b0, 0x108df,
- 0x10940, 0x1097f,
- 0x10aa0, 0x10abf,
- 0x10bb0, 0x10bff,
- 0x10c50, 0x10c7f,
- 0x10d00, 0x10e5f,
- 0x10e80, 0x10fff,
- 0x11250, 0x1127f,
- 0x11380, 0x113ff,
- 0x114e0, 0x1157f,
- 0x116d0, 0x116ff,
- 0x11740, 0x1189f,
- 0x11900, 0x119ff,
- 0x11ab0, 0x11abf,
- 0x11b00, 0x11bff,
- 0x11cc0, 0x11cff,
- 0x11d60, 0x11fff,
- 0x12550, 0x12fff,
- 0x13430, 0x143ff,
- 0x14680, 0x167ff,
- 0x16a70, 0x16acf,
- 0x16b90, 0x16eff,
- 0x16fa0, 0x16fdf,
- 0x18b00, 0x1afff,
- 0x1b130, 0x1b16f,
- 0x1b300, 0x1bbff,
- 0x1bcb0, 0x1cfff,
- 0x1d250, 0x1d2ff,
- 0x1d380, 0x1d3ff,
- 0x1dab0, 0x1dfff,
- 0x1e030, 0x1e7ff,
- 0x1e8e0, 0x1e8ff,
- 0x1e960, 0x1edff,
- 0x1ef00, 0x1efff,
- 0x1fa00, 0x1ffff,
- 0x2a6e0, 0x2a6ff,
- 0x2ebf0, 0x2f7ff,
- 0x2fa20, 0xdffff,
- 0xe0080, 0xe00ff,
- 0xe01f0, 0xeffff,
-}; /* CR_In_No_Block */
-
-#endif /* USE_UNICODE_PROPERTIES */
-static const OnigCodePoint* const CodeRanges[] = {
- CR_NEWLINE,
- CR_Alpha,
- CR_Blank,
- CR_Cntrl,
- CR_Digit,
- CR_Graph,
- CR_Lower,
- CR_Print,
- CR_XPosixPunct,
- CR_Space,
- CR_Upper,
- CR_XDigit,
- CR_Word,
- CR_Alnum,
- CR_ASCII,
- CR_Punct,
-#ifdef USE_UNICODE_PROPERTIES
- CR_Any,
- CR_Assigned,
- CR_C,
- CR_Cc,
- CR_Cf,
- CR_Cn,
- CR_Co,
- CR_Cs,
- CR_L,
- CR_LC,
- CR_Ll,
- CR_Lm,
- CR_Lo,
- CR_Lt,
- CR_Lu,
- CR_M,
- CR_Mc,
- CR_Me,
- CR_Mn,
- CR_N,
- CR_Nd,
- CR_Nl,
- CR_No,
- CR_P,
- CR_Pc,
- CR_Pd,
- CR_Pe,
- CR_Pf,
- CR_Pi,
- CR_Po,
- CR_Ps,
- CR_S,
- CR_Sc,
- CR_Sk,
- CR_Sm,
- CR_So,
- CR_Z,
- CR_Zl,
- CR_Zp,
- CR_Zs,
- CR_Math,
- CR_Alphabetic,
- CR_Lowercase,
- CR_Uppercase,
- CR_Cased,
- CR_Case_Ignorable,
- CR_Changes_When_Lowercased,
- CR_Changes_When_Uppercased,
- CR_Changes_When_Titlecased,
- CR_Changes_When_Casefolded,
- CR_Changes_When_Casemapped,
- CR_ID_Start,
- CR_ID_Continue,
- CR_XID_Start,
- CR_XID_Continue,
- CR_Default_Ignorable_Code_Point,
- CR_Grapheme_Extend,
- CR_Grapheme_Base,
- CR_Grapheme_Link,
- CR_Common,
- CR_Latin,
- CR_Greek,
- CR_Cyrillic,
- CR_Armenian,
- CR_Hebrew,
- CR_Arabic,
- CR_Syriac,
- CR_Thaana,
- CR_Devanagari,
- CR_Bengali,
- CR_Gurmukhi,
- CR_Gujarati,
- CR_Oriya,
- CR_Tamil,
- CR_Telugu,
- CR_Kannada,
- CR_Malayalam,
- CR_Sinhala,
- CR_Thai,
- CR_Lao,
- CR_Tibetan,
- CR_Myanmar,
- CR_Georgian,
- CR_Hangul,
- CR_Ethiopic,
- CR_Cherokee,
- CR_Canadian_Aboriginal,
- CR_Ogham,
- CR_Runic,
- CR_Khmer,
- CR_Mongolian,
- CR_Hiragana,
- CR_Katakana,
- CR_Bopomofo,
- CR_Han,
- CR_Yi,
- CR_Old_Italic,
- CR_Gothic,
- CR_Deseret,
- CR_Inherited,
- CR_Tagalog,
- CR_Hanunoo,
- CR_Buhid,
- CR_Tagbanwa,
- CR_Limbu,
- CR_Tai_Le,
- CR_Linear_B,
- CR_Ugaritic,
- CR_Shavian,
- CR_Osmanya,
- CR_Cypriot,
- CR_Braille,
- CR_Buginese,
- CR_Coptic,
- CR_New_Tai_Lue,
- CR_Glagolitic,
- CR_Tifinagh,
- CR_Syloti_Nagri,
- CR_Old_Persian,
- CR_Kharoshthi,
- CR_Balinese,
- CR_Cuneiform,
- CR_Phoenician,
- CR_Phags_Pa,
- CR_Nko,
- CR_Sundanese,
- CR_Lepcha,
- CR_Ol_Chiki,
- CR_Vai,
- CR_Saurashtra,
- CR_Kayah_Li,
- CR_Rejang,
- CR_Lycian,
- CR_Carian,
- CR_Lydian,
- CR_Cham,
- CR_Tai_Tham,
- CR_Tai_Viet,
- CR_Avestan,
- CR_Egyptian_Hieroglyphs,
- CR_Samaritan,
- CR_Lisu,
- CR_Bamum,
- CR_Javanese,
- CR_Meetei_Mayek,
- CR_Imperial_Aramaic,
- CR_Old_South_Arabian,
- CR_Inscriptional_Parthian,
- CR_Inscriptional_Pahlavi,
- CR_Old_Turkic,
- CR_Kaithi,
- CR_Batak,
- CR_Brahmi,
- CR_Mandaic,
- CR_Chakma,
- CR_Meroitic_Cursive,
- CR_Meroitic_Hieroglyphs,
- CR_Miao,
- 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_Adlam,
- CR_Bhaiksuki,
- CR_Marchen,
- CR_Newa,
- CR_Osage,
- CR_Tangut,
- CR_Masaram_Gondi,
- CR_Nushu,
- CR_Soyombo,
- CR_Zanabazar_Square,
- CR_White_Space,
- CR_Bidi_Control,
- CR_Join_Control,
- CR_Dash,
- CR_Hyphen,
- CR_Quotation_Mark,
- CR_Terminal_Punctuation,
- CR_Other_Math,
- CR_Hex_Digit,
- CR_ASCII_Hex_Digit,
- CR_Other_Alphabetic,
- CR_Ideographic,
- CR_Diacritic,
- CR_Extender,
- CR_Other_Lowercase,
- CR_Other_Uppercase,
- CR_Noncharacter_Code_Point,
- CR_Other_Grapheme_Extend,
- CR_IDS_Binary_Operator,
- CR_IDS_Trinary_Operator,
- CR_Radical,
- CR_Unified_Ideograph,
- CR_Other_Default_Ignorable_Code_Point,
- CR_Deprecated,
- CR_Soft_Dotted,
- CR_Logical_Order_Exception,
- CR_Other_ID_Start,
- CR_Other_ID_Continue,
- CR_Sentence_Terminal,
- CR_Variation_Selector,
- CR_Pattern_White_Space,
- CR_Pattern_Syntax,
- CR_Prepended_Concatenation_Mark,
- CR_Regional_Indicator,
- CR_Emoji,
- CR_Emoji_Presentation,
- CR_Emoji_Modifier,
- CR_Emoji_Modifier_Base,
- CR_Emoji_Component,
- CR_Unknown,
-#ifdef USE_UNICODE_AGE_PROPERTIES
- CR_Age_1_1,
- CR_Age_2_0,
- CR_Age_2_1,
- CR_Age_3_0,
- CR_Age_3_1,
- CR_Age_3_2,
- CR_Age_4_0,
- CR_Age_4_1,
- CR_Age_5_0,
- CR_Age_5_1,
- 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,
- CR_Age_9_0,
- CR_Age_10_0,
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- CR_Grapheme_Cluster_Break_Prepend,
- CR_Grapheme_Cluster_Break_CR,
- CR_Grapheme_Cluster_Break_LF,
- CR_Grapheme_Cluster_Break_Control,
- CR_Grapheme_Cluster_Break_Extend,
- CR_Grapheme_Cluster_Break_Regional_Indicator,
- CR_Grapheme_Cluster_Break_SpacingMark,
- CR_Grapheme_Cluster_Break_L,
- CR_Grapheme_Cluster_Break_V,
- CR_Grapheme_Cluster_Break_T,
- CR_Grapheme_Cluster_Break_LV,
- CR_Grapheme_Cluster_Break_LVT,
- CR_Grapheme_Cluster_Break_E_Base,
- CR_Grapheme_Cluster_Break_E_Modifier,
- CR_Grapheme_Cluster_Break_ZWJ,
- CR_Grapheme_Cluster_Break_Glue_After_Zwj,
- CR_Grapheme_Cluster_Break_E_Base_GAZ,
- CR_In_Basic_Latin,
- CR_In_Latin_1_Supplement,
- CR_In_Latin_Extended_A,
- CR_In_Latin_Extended_B,
- CR_In_IPA_Extensions,
- CR_In_Spacing_Modifier_Letters,
- CR_In_Combining_Diacritical_Marks,
- CR_In_Greek_and_Coptic,
- CR_In_Cyrillic,
- CR_In_Cyrillic_Supplement,
- CR_In_Armenian,
- CR_In_Hebrew,
- CR_In_Arabic,
- CR_In_Syriac,
- CR_In_Arabic_Supplement,
- CR_In_Thaana,
- CR_In_NKo,
- CR_In_Samaritan,
- CR_In_Mandaic,
- CR_In_Syriac_Supplement,
- CR_In_Arabic_Extended_A,
- CR_In_Devanagari,
- CR_In_Bengali,
- CR_In_Gurmukhi,
- CR_In_Gujarati,
- CR_In_Oriya,
- CR_In_Tamil,
- CR_In_Telugu,
- CR_In_Kannada,
- CR_In_Malayalam,
- CR_In_Sinhala,
- CR_In_Thai,
- CR_In_Lao,
- CR_In_Tibetan,
- CR_In_Myanmar,
- CR_In_Georgian,
- CR_In_Hangul_Jamo,
- CR_In_Ethiopic,
- CR_In_Ethiopic_Supplement,
- CR_In_Cherokee,
- CR_In_Unified_Canadian_Aboriginal_Syllabics,
- CR_In_Ogham,
- CR_In_Runic,
- CR_In_Tagalog,
- CR_In_Hanunoo,
- CR_In_Buhid,
- CR_In_Tagbanwa,
- CR_In_Khmer,
- CR_In_Mongolian,
- CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
- CR_In_Limbu,
- CR_In_Tai_Le,
- CR_In_New_Tai_Lue,
- CR_In_Khmer_Symbols,
- CR_In_Buginese,
- CR_In_Tai_Tham,
- CR_In_Combining_Diacritical_Marks_Extended,
- CR_In_Balinese,
- CR_In_Sundanese,
- CR_In_Batak,
- CR_In_Lepcha,
- CR_In_Ol_Chiki,
- CR_In_Cyrillic_Extended_C,
- CR_In_Sundanese_Supplement,
- CR_In_Vedic_Extensions,
- CR_In_Phonetic_Extensions,
- CR_In_Phonetic_Extensions_Supplement,
- CR_In_Combining_Diacritical_Marks_Supplement,
- CR_In_Latin_Extended_Additional,
- CR_In_Greek_Extended,
- CR_In_General_Punctuation,
- CR_In_Superscripts_and_Subscripts,
- CR_In_Currency_Symbols,
- CR_In_Combining_Diacritical_Marks_for_Symbols,
- CR_In_Letterlike_Symbols,
- CR_In_Number_Forms,
- CR_In_Arrows,
- CR_In_Mathematical_Operators,
- CR_In_Miscellaneous_Technical,
- CR_In_Control_Pictures,
- CR_In_Optical_Character_Recognition,
- CR_In_Enclosed_Alphanumerics,
- CR_In_Box_Drawing,
- CR_In_Block_Elements,
- CR_In_Geometric_Shapes,
- CR_In_Miscellaneous_Symbols,
- CR_In_Dingbats,
- CR_In_Miscellaneous_Mathematical_Symbols_A,
- CR_In_Supplemental_Arrows_A,
- CR_In_Braille_Patterns,
- CR_In_Supplemental_Arrows_B,
- CR_In_Miscellaneous_Mathematical_Symbols_B,
- CR_In_Supplemental_Mathematical_Operators,
- CR_In_Miscellaneous_Symbols_and_Arrows,
- CR_In_Glagolitic,
- CR_In_Latin_Extended_C,
- CR_In_Coptic,
- CR_In_Georgian_Supplement,
- CR_In_Tifinagh,
- CR_In_Ethiopic_Extended,
- CR_In_Cyrillic_Extended_A,
- CR_In_Supplemental_Punctuation,
- CR_In_CJK_Radicals_Supplement,
- CR_In_Kangxi_Radicals,
- CR_In_Ideographic_Description_Characters,
- CR_In_CJK_Symbols_and_Punctuation,
- CR_In_Hiragana,
- CR_In_Katakana,
- CR_In_Bopomofo,
- CR_In_Hangul_Compatibility_Jamo,
- CR_In_Kanbun,
- CR_In_Bopomofo_Extended,
- CR_In_CJK_Strokes,
- CR_In_Katakana_Phonetic_Extensions,
- CR_In_Enclosed_CJK_Letters_and_Months,
- CR_In_CJK_Compatibility,
- CR_In_CJK_Unified_Ideographs_Extension_A,
- CR_In_Yijing_Hexagram_Symbols,
- CR_In_CJK_Unified_Ideographs,
- CR_In_Yi_Syllables,
- CR_In_Yi_Radicals,
- CR_In_Lisu,
- CR_In_Vai,
- CR_In_Cyrillic_Extended_B,
- CR_In_Bamum,
- CR_In_Modifier_Tone_Letters,
- CR_In_Latin_Extended_D,
- CR_In_Syloti_Nagri,
- CR_In_Common_Indic_Number_Forms,
- CR_In_Phags_pa,
- CR_In_Saurashtra,
- CR_In_Devanagari_Extended,
- CR_In_Kayah_Li,
- CR_In_Rejang,
- CR_In_Hangul_Jamo_Extended_A,
- CR_In_Javanese,
- CR_In_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,
- CR_In_High_Surrogates,
- CR_In_High_Private_Use_Surrogates,
- CR_In_Low_Surrogates,
- CR_In_Private_Use_Area,
- CR_In_CJK_Compatibility_Ideographs,
- CR_In_Alphabetic_Presentation_Forms,
- CR_In_Arabic_Presentation_Forms_A,
- CR_In_Variation_Selectors,
- CR_In_Vertical_Forms,
- CR_In_Combining_Half_Marks,
- CR_In_CJK_Compatibility_Forms,
- CR_In_Small_Form_Variants,
- CR_In_Arabic_Presentation_Forms_B,
- CR_In_Halfwidth_and_Fullwidth_Forms,
- CR_In_Specials,
- CR_In_Linear_B_Syllabary,
- CR_In_Linear_B_Ideograms,
- CR_In_Aegean_Numbers,
- CR_In_Ancient_Greek_Numbers,
- CR_In_Ancient_Symbols,
- CR_In_Phaistos_Disc,
- CR_In_Lycian,
- CR_In_Carian,
- CR_In_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_Osage,
- 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_Newa,
- CR_In_Tirhuta,
- CR_In_Siddham,
- CR_In_Modi,
- CR_In_Mongolian_Supplement,
- CR_In_Takri,
- CR_In_Ahom,
- CR_In_Warang_Citi,
- CR_In_Zanabazar_Square,
- CR_In_Soyombo,
- CR_In_Pau_Cin_Hau,
- CR_In_Bhaiksuki,
- CR_In_Marchen,
- CR_In_Masaram_Gondi,
- 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_Ideographic_Symbols_and_Punctuation,
- CR_In_Tangut,
- CR_In_Tangut_Components,
- CR_In_Kana_Supplement,
- CR_In_Kana_Extended_A,
- CR_In_Nushu,
- 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_Glagolitic_Supplement,
- CR_In_Mende_Kikakui,
- CR_In_Adlam,
- CR_In_Arabic_Mathematical_Alphabetic_Symbols,
- CR_In_Mahjong_Tiles,
- CR_In_Domino_Tiles,
- CR_In_Playing_Cards,
- CR_In_Enclosed_Alphanumeric_Supplement,
- CR_In_Enclosed_Ideographic_Supplement,
- CR_In_Miscellaneous_Symbols_and_Pictographs,
- CR_In_Emoticons,
- CR_In_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_Unified_Ideographs_Extension_F,
- CR_In_CJK_Compatibility_Ideographs_Supplement,
- CR_In_Tags,
- CR_In_Variation_Selectors_Supplement,
- CR_In_Supplementary_Private_Use_Area_A,
- CR_In_Supplementary_Private_Use_Area_B,
- CR_In_No_Block,
-#endif /* USE_UNICODE_PROPERTIES */
-};
-struct uniname2ctype_struct {
- short name;
- unsigned short ctype;
-};
-#define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str)
-
-#if !1+0
-static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
-#endif
-
-#ifndef USE_UNICODE_PROPERTIES
-#define TOTAL_KEYWORDS 15
-#define MIN_WORD_LENGTH 4
-#define MAX_WORD_LENGTH 11
-#define MIN_HASH_VALUE 6
-#define MAX_HASH_VALUE 20
-/* maximum key range = 15, duplicates = 0 */
-#else /* USE_UNICODE_PROPERTIES */
-#ifndef USE_UNICODE_AGE_PROPERTIES
-#define TOTAL_KEYWORDS 775
-#else /* USE_UNICODE_AGE_PROPERTIES */
-#define TOTAL_KEYWORDS 794
-#endif /* USE_UNICODE_AGE_PROPERTIES */
-#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 44
-#define MIN_HASH_VALUE 10
-#define MAX_HASH_VALUE 6145
-/* maximum key range = 6136, duplicates = 0 */
-#endif /* USE_UNICODE_PROPERTIES */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-uniname2ctype_hash (register const char *str, register size_t len)
-{
-#ifndef USE_UNICODE_PROPERTIES
- static const unsigned char asso_values[] =
-#else /* USE_UNICODE_PROPERTIES */
- static const unsigned short asso_values[] =
-#endif /* USE_UNICODE_PROPERTIES */
- {
-#ifndef USE_UNICODE_PROPERTIES
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 3, 12, 5,
- 4, 21, 21, 10, 21, 1, 21, 21, 11, 21,
- 2, 1, 1, 21, 1, 7, 4, 6, 21, 1,
- 4, 21, 21, 21, 21, 21, 21, 21
-#else /* USE_UNICODE_PROPERTIES */
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
-#ifndef USE_UNICODE_AGE_PROPERTIES
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
-#else /* USE_UNICODE_AGE_PROPERTIES */
- 6146, 6146, 6146, 6146, 6146, 6146, 1, 6146, 2, 1,
- 5, 27, 2, 15, 7, 11, 9, 8, 6146, 6146,
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146, 6146,
- 6146, 6146, 6146, 6146, 6146, 6146, 6146, 5, 1058, 101,
- 332, 9, 777, 1271, 842, 3, 1142, 17, 491, 70,
- 1, 15, 741, 1115, 39, 174, 260, 566, 1127, 1473,
- 502, 1554, 13, 2, 12, 6146, 6146, 6146, 6146, 6146
-#endif /* USE_UNICODE_PROPERTIES */
- };
-#ifndef USE_UNICODE_PROPERTIES
- return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
-#else /* USE_UNICODE_PROPERTIES */
- register unsigned int hval = (unsigned int)len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[15]];
- /*FALLTHROUGH*/
- case 15:
- case 14:
- case 13:
- case 12:
- hval += asso_values[(unsigned char)str[11]];
- /*FALLTHROUGH*/
- case 11:
- case 10:
- case 9:
- case 8:
- case 7:
- case 6:
- hval += asso_values[(unsigned char)str[5]];
- /*FALLTHROUGH*/
- case 5:
- hval += asso_values[(unsigned char)str[4]];
- /*FALLTHROUGH*/
- case 4:
- case 3:
- hval += asso_values[(unsigned char)str[2]];
- /*FALLTHROUGH*/
- case 2:
- hval += asso_values[(unsigned char)str[1]];
- /*FALLTHROUGH*/
- case 1:
- hval += asso_values[(unsigned char)str[0]+2];
- break;
- }
- return hval + asso_values[(unsigned char)str[len - 1]];
-#endif /* USE_UNICODE_PROPERTIES */
-}
-
-struct uniname2ctype_pool_t
- {
-#ifndef USE_UNICODE_PROPERTIES
- char uniname2ctype_pool_str6[sizeof("word")];
- char uniname2ctype_pool_str7[sizeof("print")];
- char uniname2ctype_pool_str8[sizeof("punct")];
- char uniname2ctype_pool_str9[sizeof("alpha")];
- char uniname2ctype_pool_str10[sizeof("alnum")];
- char uniname2ctype_pool_str11[sizeof("xdigit")];
- char uniname2ctype_pool_str12[sizeof("upper")];
- char uniname2ctype_pool_str13[sizeof("ascii")];
- char uniname2ctype_pool_str14[sizeof("cntrl")];
- char uniname2ctype_pool_str15[sizeof("space")];
- char uniname2ctype_pool_str16[sizeof("xposixpunct")];
- char uniname2ctype_pool_str17[sizeof("lower")];
- char uniname2ctype_pool_str18[sizeof("graph")];
- char uniname2ctype_pool_str19[sizeof("digit")];
- char uniname2ctype_pool_str20[sizeof("blank")];
-#else /* USE_UNICODE_PROPERTIES */
- char uniname2ctype_pool_str10[sizeof("yi")];
- char uniname2ctype_pool_str13[sizeof("cn")];
- char uniname2ctype_pool_str14[sizeof("lina")];
- char uniname2ctype_pool_str15[sizeof("yiii")];
- char uniname2ctype_pool_str16[sizeof("lana")];
- char uniname2ctype_pool_str17[sizeof("ci")];
- char uniname2ctype_pool_str19[sizeof("mn")];
- char uniname2ctype_pool_str26[sizeof("z")];
- char uniname2ctype_pool_str28[sizeof("mani")];
- char uniname2ctype_pool_str33[sizeof("lo")];
- char uniname2ctype_pool_str35[sizeof("me")];
- char uniname2ctype_pool_str37[sizeof("loe")];
- char uniname2ctype_pool_str39[sizeof("lao")];
- char uniname2ctype_pool_str40[sizeof("laoo")];
- char uniname2ctype_pool_str41[sizeof("co")];
- char uniname2ctype_pool_str42[sizeof("miao")];
- char uniname2ctype_pool_str47[sizeof("pi")];
- char uniname2ctype_pool_str51[sizeof("inkannada")];
- char uniname2ctype_pool_str52[sizeof("gran")];
- char uniname2ctype_pool_str54[sizeof("innko")];
- char uniname2ctype_pool_str55[sizeof("zzzz")];
- char uniname2ctype_pool_str59[sizeof("pe")];
- char uniname2ctype_pool_str60[sizeof("cari")];
- char uniname2ctype_pool_str61[sizeof("lineara")];
- char uniname2ctype_pool_str66[sizeof("carian")];
- char uniname2ctype_pool_str69[sizeof("mendekikakui")];
- char uniname2ctype_pool_str70[sizeof("geor")];
- char uniname2ctype_pool_str71[sizeof("po")];
- char uniname2ctype_pool_str72[sizeof("grek")];
- char uniname2ctype_pool_str73[sizeof("meeteimayek")];
- char uniname2ctype_pool_str80[sizeof("mark")];
- char uniname2ctype_pool_str82[sizeof("mero")];
- char uniname2ctype_pool_str85[sizeof("kana")];
- char uniname2ctype_pool_str86[sizeof("m")];
- char uniname2ctype_pool_str87[sizeof("mro")];
- char uniname2ctype_pool_str88[sizeof("mroo")];
- char uniname2ctype_pool_str90[sizeof("greek")];
- char uniname2ctype_pool_str93[sizeof("gonm")];
- char uniname2ctype_pool_str97[sizeof("inkharoshthi")];
- char uniname2ctype_pool_str105[sizeof("cakm")];
- char uniname2ctype_pool_str106[sizeof("inmanichaean")];
- char uniname2ctype_pool_str111[sizeof("c")];
- char uniname2ctype_pool_str113[sizeof("inarmenian")];
- char uniname2ctype_pool_str117[sizeof("common")];
- char uniname2ctype_pool_str122[sizeof("inosmanya")];
- char uniname2ctype_pool_str123[sizeof("inmro")];
- char uniname2ctype_pool_str129[sizeof("inmiao")];
- char uniname2ctype_pool_str137[sizeof("mandaic")];
- char uniname2ctype_pool_str142[sizeof("inmyanmar")];
- char uniname2ctype_pool_str143[sizeof("lm")];
- char uniname2ctype_pool_str150[sizeof("prependedconcatenationmark")];
- char uniname2ctype_pool_str153[sizeof("inideographicsymbolsandpunctuation")];
- char uniname2ctype_pool_str154[sizeof("inchakma")];
- char uniname2ctype_pool_str160[sizeof("inkhmer")];
- char uniname2ctype_pool_str161[sizeof("perm")];
- char uniname2ctype_pool_str162[sizeof("connectorpunctuation")];
- char uniname2ctype_pool_str164[sizeof("marc")];
- char uniname2ctype_pool_str167[sizeof("combiningmark")];
- char uniname2ctype_pool_str168[sizeof("merc")];
- char uniname2ctype_pool_str169[sizeof("inrunic")];
- char uniname2ctype_pool_str170[sizeof("incarian")];
- char uniname2ctype_pool_str172[sizeof("incuneiformnumbersandpunctuation")];
- char uniname2ctype_pool_str184[sizeof("inahom")];
- char uniname2ctype_pool_str186[sizeof("incherokee")];
- char uniname2ctype_pool_str191[sizeof("qaai")];
- char uniname2ctype_pool_str193[sizeof("cans")];
- char uniname2ctype_pool_str205[sizeof("lc")];
- char uniname2ctype_pool_str210[sizeof("incuneiform")];
- char uniname2ctype_pool_str213[sizeof("cc")];
- char uniname2ctype_pool_str215[sizeof("armn")];
- char uniname2ctype_pool_str216[sizeof("inavestan")];
- char uniname2ctype_pool_str217[sizeof("armi")];
- char uniname2ctype_pool_str219[sizeof("mc")];
- char uniname2ctype_pool_str223[sizeof("armenian")];
- char uniname2ctype_pool_str227[sizeof("inipaextensions")];
- char uniname2ctype_pool_str238[sizeof("inmarchen")];
- char uniname2ctype_pool_str243[sizeof("pc")];
- char uniname2ctype_pool_str250[sizeof("insharada")];
- char uniname2ctype_pool_str255[sizeof("lineseparator")];
- char uniname2ctype_pool_str256[sizeof("masaramgondi")];
- char uniname2ctype_pool_str259[sizeof("inarrows")];
- char uniname2ctype_pool_str268[sizeof("ri")];
- char uniname2ctype_pool_str270[sizeof("incham")];
- char uniname2ctype_pool_str271[sizeof("latn")];
- char uniname2ctype_pool_str272[sizeof("incyrillic")];
- char uniname2ctype_pool_str273[sizeof("latin")];
- char uniname2ctype_pool_str276[sizeof("inzanabazarsquare")];
- char uniname2ctype_pool_str279[sizeof("insamaritan")];
- char uniname2ctype_pool_str283[sizeof("pcm")];
- char uniname2ctype_pool_str285[sizeof("inmasaramgondi")];
- char uniname2ctype_pool_str288[sizeof("qmark")];
- char uniname2ctype_pool_str289[sizeof("qaac")];
- char uniname2ctype_pool_str291[sizeof("mtei")];
- char uniname2ctype_pool_str295[sizeof("inthai")];
- char uniname2ctype_pool_str300[sizeof("inscriptionalparthian")];
- char uniname2ctype_pool_str301[sizeof("inthaana")];
- char uniname2ctype_pool_str309[sizeof("inkaithi")];
- char uniname2ctype_pool_str311[sizeof("initialpunctuation")];
- char uniname2ctype_pool_str315[sizeof("inkatakana")];
- char uniname2ctype_pool_str317[sizeof("inkhmersymbols")];
- char uniname2ctype_pool_str343[sizeof("insyriac")];
- char uniname2ctype_pool_str344[sizeof("intakri")];
- char uniname2ctype_pool_str345[sizeof("prti")];
- char uniname2ctype_pool_str356[sizeof("arabic")];
- char uniname2ctype_pool_str357[sizeof("mand")];
- char uniname2ctype_pool_str359[sizeof("cs")];
- char uniname2ctype_pool_str361[sizeof("mend")];
- char uniname2ctype_pool_str362[sizeof("zs")];
- char uniname2ctype_pool_str363[sizeof("letter")];
- char uniname2ctype_pool_str365[sizeof("privateuse")];
- char uniname2ctype_pool_str369[sizeof("modi")];
- char uniname2ctype_pool_str370[sizeof("katakana")];
- char uniname2ctype_pool_str377[sizeof("ideo")];
- char uniname2ctype_pool_str383[sizeof("brai")];
- char uniname2ctype_pool_str384[sizeof("xidcontinue")];
- char uniname2ctype_pool_str386[sizeof("inmyanmarextendeda")];
- char uniname2ctype_pool_str387[sizeof("ascii")];
- char uniname2ctype_pool_str389[sizeof("ps")];
- char uniname2ctype_pool_str393[sizeof("inkanaextendeda")];
- char uniname2ctype_pool_str396[sizeof("inmeeteimayek")];
- char uniname2ctype_pool_str399[sizeof("inruminumeralsymbols")];
- char uniname2ctype_pool_str408[sizeof("letternumber")];
- char uniname2ctype_pool_str412[sizeof("knda")];
- char uniname2ctype_pool_str425[sizeof("kannada")];
- char uniname2ctype_pool_str428[sizeof("inoldnortharabian")];
- char uniname2ctype_pool_str430[sizeof("inideographicdescriptioncharacters")];
- char uniname2ctype_pool_str432[sizeof("inmodi")];
- char uniname2ctype_pool_str440[sizeof("incjkcompatibilityforms")];
- char uniname2ctype_pool_str445[sizeof("incjkcompatibilityideographs")];
- char uniname2ctype_pool_str453[sizeof("xidc")];
- char uniname2ctype_pool_str455[sizeof("inmendekikakui")];
- char uniname2ctype_pool_str458[sizeof("brahmi")];
- char uniname2ctype_pool_str480[sizeof("inolditalic")];
- char uniname2ctype_pool_str482[sizeof("inmiscellaneousmathematicalsymbolsa")];
- char uniname2ctype_pool_str486[sizeof("inspecials")];
- char uniname2ctype_pool_str487[sizeof("inemoticons")];
- char uniname2ctype_pool_str488[sizeof("patternwhitespace")];
- char uniname2ctype_pool_str489[sizeof("gothic")];
- char uniname2ctype_pool_str492[sizeof("intransportandmapsymbols")];
- char uniname2ctype_pool_str493[sizeof("l")];
- char uniname2ctype_pool_str509[sizeof("psalterpahlavi")];
- char uniname2ctype_pool_str516[sizeof("vai")];
- char uniname2ctype_pool_str517[sizeof("vaii")];
- char uniname2ctype_pool_str523[sizeof("lt")];
- char uniname2ctype_pool_str524[sizeof("meroiticcursive")];
- char uniname2ctype_pool_str526[sizeof("xids")];
- char uniname2ctype_pool_str530[sizeof("incommonindicnumberforms")];
- char uniname2ctype_pool_str531[sizeof("inmandaic")];
- char uniname2ctype_pool_str533[sizeof("inlineara")];
- char uniname2ctype_pool_str541[sizeof("incjkcompatibilityideographssupplement")];
- char uniname2ctype_pool_str544[sizeof("inlao")];
- char uniname2ctype_pool_str545[sizeof("insundanese")];
- char uniname2ctype_pool_str547[sizeof("mongolian")];
- char uniname2ctype_pool_str552[sizeof("bamum")];
- char uniname2ctype_pool_str554[sizeof("idc")];
- char uniname2ctype_pool_str561[sizeof("inancientsymbols")];
- char uniname2ctype_pool_str573[sizeof("kali")];
- char uniname2ctype_pool_str574[sizeof("grlink")];
- char uniname2ctype_pool_str576[sizeof("grext")];
- char uniname2ctype_pool_str577[sizeof("control")];
- char uniname2ctype_pool_str586[sizeof("inkanasupplement")];
- char uniname2ctype_pool_str591[sizeof("inopticalcharacterrecognition")];
- char uniname2ctype_pool_str596[sizeof("inadlam")];
- char uniname2ctype_pool_str598[sizeof("so")];
- char uniname2ctype_pool_str601[sizeof("inoldsoutharabian")];
- char uniname2ctype_pool_str602[sizeof("sk")];
- char uniname2ctype_pool_str606[sizeof("print")];
- char uniname2ctype_pool_str607[sizeof("idsbinaryoperator")];
- char uniname2ctype_pool_str609[sizeof("palm")];
- char uniname2ctype_pool_str618[sizeof("batk")];
- char uniname2ctype_pool_str619[sizeof("indominotiles")];
- char uniname2ctype_pool_str620[sizeof("intaitham")];
- char uniname2ctype_pool_str622[sizeof("inlycian")];
- char uniname2ctype_pool_str629[sizeof("sora")];
- char uniname2ctype_pool_str636[sizeof("batak")];
- char uniname2ctype_pool_str642[sizeof("inmodifiertoneletters")];
- char uniname2ctype_pool_str657[sizeof("patws")];
- char uniname2ctype_pool_str665[sizeof("inmalayalam")];
- char uniname2ctype_pool_str670[sizeof("incjkstrokes")];
- char uniname2ctype_pool_str681[sizeof("incontrolpictures")];
- char uniname2ctype_pool_str684[sizeof("samr")];
- char uniname2ctype_pool_str689[sizeof("bass")];
- char uniname2ctype_pool_str693[sizeof("samaritan")];
- char uniname2ctype_pool_str699[sizeof("inmusicalsymbols")];
- char uniname2ctype_pool_str700[sizeof("ids")];
- char uniname2ctype_pool_str705[sizeof("pd")];
- char uniname2ctype_pool_str708[sizeof("sm")];
- char uniname2ctype_pool_str715[sizeof("pauc")];
- char uniname2ctype_pool_str716[sizeof("joinc")];
- char uniname2ctype_pool_str725[sizeof("inlinearbideograms")];
- char uniname2ctype_pool_str730[sizeof("idcontinue")];
- char uniname2ctype_pool_str732[sizeof("inancientgreekmusicalnotation")];
- char uniname2ctype_pool_str737[sizeof("inoldturkic")];
- char uniname2ctype_pool_str738[sizeof("alnum")];
- char uniname2ctype_pool_str739[sizeof("inugaritic")];
- char uniname2ctype_pool_str741[sizeof("s")];
- char uniname2ctype_pool_str742[sizeof("inmiscellaneoussymbols")];
- char uniname2ctype_pool_str743[sizeof("n")];
- char uniname2ctype_pool_str748[sizeof("lisu")];
- char uniname2ctype_pool_str751[sizeof("inmiscellaneoussymbolsandarrows")];
- char uniname2ctype_pool_str753[sizeof("insylotinagri")];
- char uniname2ctype_pool_str756[sizeof("inmiscellaneoussymbolsandpictographs")];
- char uniname2ctype_pool_str770[sizeof("sc")];
- char uniname2ctype_pool_str773[sizeof("no")];
- char uniname2ctype_pool_str777[sizeof("ital")];
- char uniname2ctype_pool_str781[sizeof("p")];
- char uniname2ctype_pool_str782[sizeof("xpeo")];
- char uniname2ctype_pool_str785[sizeof("di")];
- char uniname2ctype_pool_str787[sizeof("idst")];
- char uniname2ctype_pool_str788[sizeof("intaile")];
- char uniname2ctype_pool_str791[sizeof("nko")];
- char uniname2ctype_pool_str792[sizeof("nkoo")];
- char uniname2ctype_pool_str793[sizeof("dia")];
- char uniname2ctype_pool_str797[sizeof("inphoenician")];
- char uniname2ctype_pool_str799[sizeof("inlatinextendeda")];
- char uniname2ctype_pool_str802[sizeof("indeseret")];
- char uniname2ctype_pool_str807[sizeof("inlatinextendede")];
- char uniname2ctype_pool_str812[sizeof("incaucasianalbanian")];
- char uniname2ctype_pool_str819[sizeof("insaurashtra")];
- char uniname2ctype_pool_str823[sizeof("inmeeteimayekextensions")];
- char uniname2ctype_pool_str834[sizeof("idstart")];
- char uniname2ctype_pool_str835[sizeof("bali")];
- char uniname2ctype_pool_str837[sizeof("inspacingmodifierletters")];
- char uniname2ctype_pool_str848[sizeof("bengali")];
- char uniname2ctype_pool_str849[sizeof("intamil")];
- char uniname2ctype_pool_str851[sizeof("inmultani")];
- char uniname2ctype_pool_str852[sizeof("vs")];
- char uniname2ctype_pool_str853[sizeof("inlydian")];
- char uniname2ctype_pool_str855[sizeof("balinese")];
- char uniname2ctype_pool_str856[sizeof("lepc")];
- char uniname2ctype_pool_str857[sizeof("cased")];
- char uniname2ctype_pool_str862[sizeof("zinh")];
- char uniname2ctype_pool_str867[sizeof("blank")];
- char uniname2ctype_pool_str870[sizeof("runr")];
- char uniname2ctype_pool_str872[sizeof("patternsyntax")];
- char uniname2ctype_pool_str874[sizeof("bidic")];
- char uniname2ctype_pool_str877[sizeof("xdigit")];
- char uniname2ctype_pool_str881[sizeof("xidstart")];
- char uniname2ctype_pool_str885[sizeof("inphaistosdisc")];
- char uniname2ctype_pool_str897[sizeof("inancientgreeknumbers")];
- char uniname2ctype_pool_str899[sizeof("canadianaboriginal")];
- char uniname2ctype_pool_str903[sizeof("cher")];
- char uniname2ctype_pool_str905[sizeof("plrd")];
- char uniname2ctype_pool_str906[sizeof("sind")];
- char uniname2ctype_pool_str909[sizeof("cherokee")];
- char uniname2ctype_pool_str911[sizeof("phoenician")];
- char uniname2ctype_pool_str918[sizeof("marchen")];
- char uniname2ctype_pool_str919[sizeof("inhiragana")];
- char uniname2ctype_pool_str926[sizeof("inearlydynasticcuneiform")];
- char uniname2ctype_pool_str928[sizeof("graphemebase")];
- char uniname2ctype_pool_str930[sizeof("cham")];
- char uniname2ctype_pool_str931[sizeof("inimperialaramaic")];
- char uniname2ctype_pool_str932[sizeof("kaithi")];
- char uniname2ctype_pool_str935[sizeof("insiddham")];
- char uniname2ctype_pool_str937[sizeof("diacritic")];
- char uniname2ctype_pool_str942[sizeof("chakma")];
- char uniname2ctype_pool_str944[sizeof("graphemelink")];
- char uniname2ctype_pool_str947[sizeof("inkhudawadi")];
- char uniname2ctype_pool_str948[sizeof("inmahajani")];
- char uniname2ctype_pool_str956[sizeof("khojki")];
- char uniname2ctype_pool_str957[sizeof("inogham")];
- char uniname2ctype_pool_str960[sizeof("khar")];
- char uniname2ctype_pool_str966[sizeof("incountingrodnumerals")];
- char uniname2ctype_pool_str975[sizeof("manichaean")];
- char uniname2ctype_pool_str976[sizeof("coptic")];
- char uniname2ctype_pool_str977[sizeof("bamu")];
- char uniname2ctype_pool_str980[sizeof("sterm")];
- char uniname2ctype_pool_str983[sizeof("inethiopic")];
- char uniname2ctype_pool_str985[sizeof("ll")];
- char uniname2ctype_pool_str988[sizeof("inolchiki")];
- char uniname2ctype_pool_str991[sizeof("inlatinextendedc")];
- char uniname2ctype_pool_str996[sizeof("zl")];
- char uniname2ctype_pool_str998[sizeof("adlm")];
- char uniname2ctype_pool_str1016[sizeof("incyrillicsupplement")];
- char uniname2ctype_pool_str1019[sizeof("incyrillicextendeda")];
- char uniname2ctype_pool_str1022[sizeof("incherokeesupplement")];
- char uniname2ctype_pool_str1023[sizeof("decimalnumber")];
- char uniname2ctype_pool_str1025[sizeof("khmr")];
- char uniname2ctype_pool_str1029[sizeof("copt")];
- char uniname2ctype_pool_str1032[sizeof("ahom")];
- char uniname2ctype_pool_str1034[sizeof("runic")];
- char uniname2ctype_pool_str1048[sizeof("intaixuanjingsymbols")];
- char uniname2ctype_pool_str1049[sizeof("insinhala")];
- char uniname2ctype_pool_str1053[sizeof("cprt")];
- char uniname2ctype_pool_str1056[sizeof("imperialaramaic")];
- char uniname2ctype_pool_str1061[sizeof("casedletter")];
- char uniname2ctype_pool_str1065[sizeof("khmer")];
- char uniname2ctype_pool_str1067[sizeof("linb")];
- char uniname2ctype_pool_str1069[sizeof("adlam")];
- char uniname2ctype_pool_str1076[sizeof("ininscriptionalparthian")];
- char uniname2ctype_pool_str1077[sizeof("ininscriptionalpahlavi")];
- char uniname2ctype_pool_str1078[sizeof("sinhala")];
- char uniname2ctype_pool_str1080[sizeof("zanb")];
- char uniname2ctype_pool_str1086[sizeof("incjkunifiedideographsextensiona")];
- char uniname2ctype_pool_str1088[sizeof("multani")];
- char uniname2ctype_pool_str1089[sizeof("quotationmark")];
- char uniname2ctype_pool_str1090[sizeof("incjkunifiedideographsextensione")];
- char uniname2ctype_pool_str1094[sizeof("innabataean")];
- char uniname2ctype_pool_str1098[sizeof("inbhaiksuki")];
- char uniname2ctype_pool_str1100[sizeof("inelbasan")];
- char uniname2ctype_pool_str1103[sizeof("inkanbun")];
- char uniname2ctype_pool_str1104[sizeof("inscriptionalpahlavi")];
- char uniname2ctype_pool_str1107[sizeof("bopo")];
- char uniname2ctype_pool_str1114[sizeof("linearb")];
- char uniname2ctype_pool_str1115[sizeof("incyrillicextendedc")];
- char uniname2ctype_pool_str1116[sizeof("glagolitic")];
- char uniname2ctype_pool_str1119[sizeof("kharoshthi")];
- char uniname2ctype_pool_str1120[sizeof("inoldpersian")];
- char uniname2ctype_pool_str1124[sizeof("goth")];
- char uniname2ctype_pool_str1126[sizeof("math")];
- char uniname2ctype_pool_str1127[sizeof("joincontrol")];
- char uniname2ctype_pool_str1131[sizeof("punct")];
- char uniname2ctype_pool_str1135[sizeof("lu")];
- char uniname2ctype_pool_str1136[sizeof("limb")];
- char uniname2ctype_pool_str1147[sizeof("inmiscellaneoustechnical")];
- char uniname2ctype_pool_str1152[sizeof("han")];
- char uniname2ctype_pool_str1155[sizeof("hani")];
- char uniname2ctype_pool_str1156[sizeof("invai")];
- char uniname2ctype_pool_str1157[sizeof("sundanese")];
- char uniname2ctype_pool_str1158[sizeof("taile")];
- char uniname2ctype_pool_str1160[sizeof("takri")];
- char uniname2ctype_pool_str1161[sizeof("grantha")];
- char uniname2ctype_pool_str1167[sizeof("hano")];
- char uniname2ctype_pool_str1168[sizeof("inhatran")];
- char uniname2ctype_pool_str1172[sizeof("oriya")];
- char uniname2ctype_pool_str1173[sizeof("intirhuta")];
- char uniname2ctype_pool_str1178[sizeof("guru")];
- char uniname2ctype_pool_str1179[sizeof("kthi")];
- char uniname2ctype_pool_str1180[sizeof("saur")];
- char uniname2ctype_pool_str1182[sizeof("incjkunifiedideographsextensionc")];
- char uniname2ctype_pool_str1186[sizeof("hanunoo")];
- char uniname2ctype_pool_str1189[sizeof("paucinhau")];
- char uniname2ctype_pool_str1192[sizeof("takr")];
- char uniname2ctype_pool_str1193[sizeof("hira")];
- char uniname2ctype_pool_str1195[sizeof("inarabic")];
- char uniname2ctype_pool_str1196[sizeof("bopomofo")];
- char uniname2ctype_pool_str1201[sizeof("radical")];
- char uniname2ctype_pool_str1202[sizeof("gurmukhi")];
- char uniname2ctype_pool_str1203[sizeof("inkhojki")];
- char uniname2ctype_pool_str1207[sizeof("arab")];
- char uniname2ctype_pool_str1211[sizeof("limbu")];
- char uniname2ctype_pool_str1218[sizeof("inoldpermic")];
- char uniname2ctype_pool_str1222[sizeof("brah")];
- char uniname2ctype_pool_str1225[sizeof("inoldhungarian")];
- char uniname2ctype_pool_str1227[sizeof("inshorthandformatcontrols")];
- char uniname2ctype_pool_str1229[sizeof("incoptic")];
- char uniname2ctype_pool_str1232[sizeof("sd")];
- char uniname2ctype_pool_str1237[sizeof("sidd")];
- char uniname2ctype_pool_str1243[sizeof("inherited")];
- char uniname2ctype_pool_str1245[sizeof("incjkunifiedideographs")];
- char uniname2ctype_pool_str1249[sizeof("term")];
- char uniname2ctype_pool_str1252[sizeof("incjksymbolsandpunctuation")];
- char uniname2ctype_pool_str1253[sizeof("graphemeextend")];
- char uniname2ctype_pool_str1254[sizeof("dsrt")];
- char uniname2ctype_pool_str1257[sizeof("cntrl")];
- char uniname2ctype_pool_str1259[sizeof("xsux")];
- char uniname2ctype_pool_str1262[sizeof("insyriacsupplement")];
- char uniname2ctype_pool_str1267[sizeof("inbasiclatin")];
- char uniname2ctype_pool_str1275[sizeof("deseret")];
- char uniname2ctype_pool_str1281[sizeof("inenclosedideographicsupplement")];
- char uniname2ctype_pool_str1285[sizeof("bidicontrol")];
- char uniname2ctype_pool_str1288[sizeof("closepunctuation")];
- char uniname2ctype_pool_str1294[sizeof("inlatinextendedadditional")];
- char uniname2ctype_pool_str1296[sizeof("inarabicpresentationformsa")];
- char uniname2ctype_pool_str1298[sizeof("grbase")];
- char uniname2ctype_pool_str1306[sizeof("mong")];
- char uniname2ctype_pool_str1307[sizeof("anatolianhieroglyphs")];
- char uniname2ctype_pool_str1308[sizeof("inenclosedalphanumerics")];
- char uniname2ctype_pool_str1309[sizeof("ingrantha")];
- char uniname2ctype_pool_str1310[sizeof("georgian")];
- char uniname2ctype_pool_str1317[sizeof("osage")];
- char uniname2ctype_pool_str1325[sizeof("inosage")];
- char uniname2ctype_pool_str1326[sizeof("ingeneralpunctuation")];
- char uniname2ctype_pool_str1331[sizeof("saurashtra")];
- char uniname2ctype_pool_str1334[sizeof("inshavian")];
- char uniname2ctype_pool_str1335[sizeof("space")];
- char uniname2ctype_pool_str1336[sizeof("mult")];
- char uniname2ctype_pool_str1340[sizeof("inpalmyrene")];
- char uniname2ctype_pool_str1341[sizeof("inanatolianhieroglyphs")];
- char uniname2ctype_pool_str1344[sizeof("spacingmark")];
- char uniname2ctype_pool_str1348[sizeof("alpha")];
- char uniname2ctype_pool_str1354[sizeof("ingeorgian")];
- char uniname2ctype_pool_str1355[sizeof("intibetan")];
- char uniname2ctype_pool_str1364[sizeof("inlepcha")];
- char uniname2ctype_pool_str1365[sizeof("inbatak")];
- char uniname2ctype_pool_str1367[sizeof("emoji")];
- char uniname2ctype_pool_str1368[sizeof("osma")];
- char uniname2ctype_pool_str1369[sizeof("bhks")];
- char uniname2ctype_pool_str1372[sizeof("inmongolian")];
- char uniname2ctype_pool_str1373[sizeof("variationselector")];
- char uniname2ctype_pool_str1374[sizeof("braille")];
- char uniname2ctype_pool_str1379[sizeof("phli")];
- char uniname2ctype_pool_str1382[sizeof("bhaiksuki")];
- char uniname2ctype_pool_str1388[sizeof("phnx")];
- char uniname2ctype_pool_str1390[sizeof("inblockelements")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1391[sizeof("age=1.1")];
- char uniname2ctype_pool_str1392[sizeof("age=4.1")];
- char uniname2ctype_pool_str1393[sizeof("age=4.0")];
- char uniname2ctype_pool_str1394[sizeof("age=10.0")];
- char uniname2ctype_pool_str1395[sizeof("age=2.1")];
- char uniname2ctype_pool_str1396[sizeof("age=2.0")];
- char uniname2ctype_pool_str1397[sizeof("age=6.1")];
- char uniname2ctype_pool_str1398[sizeof("age=6.0")];
- char uniname2ctype_pool_str1399[sizeof("age=9.0")];
- char uniname2ctype_pool_str1400[sizeof("age=8.0")];
- char uniname2ctype_pool_str1401[sizeof("age=6.2")];
- char uniname2ctype_pool_str1402[sizeof("age=7.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1403[sizeof("inenclosedalphanumericsupplement")];
- char uniname2ctype_pool_str1404[sizeof("innumberforms")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1405[sizeof("age=5.1")];
- char uniname2ctype_pool_str1406[sizeof("age=5.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1407[sizeof("nd")];
- char uniname2ctype_pool_str1408[sizeof("separator")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1409[sizeof("age=5.2")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1411[sizeof("ingurmukhi")];
- char uniname2ctype_pool_str1413[sizeof("incjkunifiedideographsextensiond")];
- char uniname2ctype_pool_str1414[sizeof("taiviet")];
- char uniname2ctype_pool_str1416[sizeof("sinh")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1417[sizeof("age=3.1")];
- char uniname2ctype_pool_str1418[sizeof("age=3.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1420[sizeof("hatran")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1421[sizeof("age=3.2")];
- char uniname2ctype_pool_str1423[sizeof("age=6.3")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1427[sizeof("format")];
- char uniname2ctype_pool_str1429[sizeof("shavian")];
- char uniname2ctype_pool_str1434[sizeof("insinhalaarchaicnumbers")];
- char uniname2ctype_pool_str1435[sizeof("cuneiform")];
- char uniname2ctype_pool_str1439[sizeof("inmyanmarextendedb")];
- char uniname2ctype_pool_str1444[sizeof("punctuation")];
- char uniname2ctype_pool_str1449[sizeof("inarabicextendeda")];
- char uniname2ctype_pool_str1450[sizeof("hatr")];
- char uniname2ctype_pool_str1451[sizeof("inhanunoo")];
- char uniname2ctype_pool_str1453[sizeof("inlatinextendedd")];
- char uniname2ctype_pool_str1455[sizeof("modifierletter")];
- char uniname2ctype_pool_str1456[sizeof("odi")];
- char uniname2ctype_pool_str1458[sizeof("ahex")];
- char uniname2ctype_pool_str1463[sizeof("logicalorderexception")];
- char uniname2ctype_pool_str1464[sizeof("inbyzantinemusicalsymbols")];
- char uniname2ctype_pool_str1469[sizeof("sund")];
- char uniname2ctype_pool_str1470[sizeof("number")];
- char uniname2ctype_pool_str1471[sizeof("insundanesesupplement")];
- char uniname2ctype_pool_str1485[sizeof("incopticepactnumbers")];
- char uniname2ctype_pool_str1490[sizeof("emojimodifier")];
- char uniname2ctype_pool_str1496[sizeof("zp")];
- char uniname2ctype_pool_str1497[sizeof("asciihexdigit")];
- char uniname2ctype_pool_str1500[sizeof("indevanagari")];
- char uniname2ctype_pool_str1508[sizeof("innewa")];
- char uniname2ctype_pool_str1510[sizeof("avestan")];
- char uniname2ctype_pool_str1521[sizeof("insorasompeng")];
- char uniname2ctype_pool_str1535[sizeof("inmiscellaneousmathematicalsymbolsb")];
- char uniname2ctype_pool_str1536[sizeof("inbraillepatterns")];
- char uniname2ctype_pool_str1539[sizeof("nonspacingmark")];
- char uniname2ctype_pool_str1540[sizeof("ingreekandcoptic")];
- char uniname2ctype_pool_str1545[sizeof("xposixpunct")];
- char uniname2ctype_pool_str1553[sizeof("inwarangciti")];
- char uniname2ctype_pool_str1555[sizeof("oidc")];
- char uniname2ctype_pool_str1560[sizeof("terminalpunctuation")];
- char uniname2ctype_pool_str1565[sizeof("cf")];
- char uniname2ctype_pool_str1572[sizeof("lower")];
- char uniname2ctype_pool_str1580[sizeof("inunifiedcanadianaboriginalsyllabics")];
- char uniname2ctype_pool_str1585[sizeof("idsb")];
- char uniname2ctype_pool_str1589[sizeof("inbalinese")];
- char uniname2ctype_pool_str1593[sizeof("induployan")];
- char uniname2ctype_pool_str1594[sizeof("innoblock")];
- char uniname2ctype_pool_str1595[sizeof("pf")];
- char uniname2ctype_pool_str1602[sizeof("inoriya")];
- char uniname2ctype_pool_str1604[sizeof("inkatakanaphoneticextensions")];
- char uniname2ctype_pool_str1606[sizeof("inkayahli")];
- char uniname2ctype_pool_str1607[sizeof("wara")];
- char uniname2ctype_pool_str1608[sizeof("innushu")];
- char uniname2ctype_pool_str1609[sizeof("lepcha")];
- char uniname2ctype_pool_str1611[sizeof("inmeroitichieroglyphs")];
- char uniname2ctype_pool_str1617[sizeof("beng")];
- char uniname2ctype_pool_str1623[sizeof("idstrinaryoperator")];
- char uniname2ctype_pool_str1628[sizeof("oids")];
- char uniname2ctype_pool_str1630[sizeof("regionalindicator")];
- char uniname2ctype_pool_str1631[sizeof("enclosingmark")];
- char uniname2ctype_pool_str1632[sizeof("java")];
- char uniname2ctype_pool_str1636[sizeof("tale")];
- char uniname2ctype_pool_str1638[sizeof("emojimodifierbase")];
- char uniname2ctype_pool_str1645[sizeof("inphoneticextensions")];
- char uniname2ctype_pool_str1647[sizeof("lowercase")];
- char uniname2ctype_pool_str1648[sizeof("inverticalforms")];
- char uniname2ctype_pool_str1650[sizeof("javanese")];
- char uniname2ctype_pool_str1654[sizeof("sentenceterminal")];
- char uniname2ctype_pool_str1655[sizeof("ingreekextended")];
- char uniname2ctype_pool_str1656[sizeof("invariationselectors")];
- char uniname2ctype_pool_str1657[sizeof("cwcm")];
- char uniname2ctype_pool_str1663[sizeof("lyci")];
- char uniname2ctype_pool_str1666[sizeof("avst")];
- char uniname2ctype_pool_str1669[sizeof("lycian")];
- char uniname2ctype_pool_str1671[sizeof("zanabazarsquare")];
- char uniname2ctype_pool_str1672[sizeof("sarb")];
- char uniname2ctype_pool_str1673[sizeof("invedicextensions")];
- char uniname2ctype_pool_str1674[sizeof("inkangxiradicals")];
- char uniname2ctype_pool_str1677[sizeof("intaiviet")];
- char uniname2ctype_pool_str1682[sizeof("mymr")];
- char uniname2ctype_pool_str1690[sizeof("incjkradicalssupplement")];
- char uniname2ctype_pool_str1695[sizeof("myanmar")];
- char uniname2ctype_pool_str1697[sizeof("taml")];
- char uniname2ctype_pool_str1714[sizeof("olower")];
- char uniname2ctype_pool_str1725[sizeof("nl")];
- char uniname2ctype_pool_str1727[sizeof("inethiopicsupplement")];
- char uniname2ctype_pool_str1728[sizeof("olck")];
- char uniname2ctype_pool_str1730[sizeof("inethiopicextendeda")];
- char uniname2ctype_pool_str1736[sizeof("graph")];
- char uniname2ctype_pool_str1737[sizeof("olchiki")];
- char uniname2ctype_pool_str1741[sizeof("inphoneticextensionssupplement")];
- char uniname2ctype_pool_str1743[sizeof("emojicomponent")];
- char uniname2ctype_pool_str1746[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
- char uniname2ctype_pool_str1748[sizeof("ingeometricshapes")];
- char uniname2ctype_pool_str1752[sizeof("invariationselectorssupplement")];
- char uniname2ctype_pool_str1754[sizeof("gujr")];
- char uniname2ctype_pool_str1762[sizeof("sharada")];
- char uniname2ctype_pool_str1766[sizeof("gujarati")];
- char uniname2ctype_pool_str1767[sizeof("nchar")];
- char uniname2ctype_pool_str1772[sizeof("innewtailue")];
- char uniname2ctype_pool_str1774[sizeof("glag")];
- char uniname2ctype_pool_str1780[sizeof("ideographic")];
- char uniname2ctype_pool_str1783[sizeof("shrd")];
- char uniname2ctype_pool_str1785[sizeof("insoyombo")];
- char uniname2ctype_pool_str1789[sizeof("inbamum")];
- char uniname2ctype_pool_str1800[sizeof("inlatin1supplement")];
- char uniname2ctype_pool_str1802[sizeof("dash")];
- char uniname2ctype_pool_str1806[sizeof("indingbats")];
- char uniname2ctype_pool_str1808[sizeof("spaceseparator")];
- char uniname2ctype_pool_str1813[sizeof("phagspa")];
- char uniname2ctype_pool_str1814[sizeof("titlecaseletter")];
- char uniname2ctype_pool_str1815[sizeof("incjkcompatibility")];
- char uniname2ctype_pool_str1818[sizeof("intangut")];
- char uniname2ctype_pool_str1819[sizeof("incombiningdiacriticalmarks")];
- char uniname2ctype_pool_str1821[sizeof("inlisu")];
- char uniname2ctype_pool_str1825[sizeof("siddham")];
- char uniname2ctype_pool_str1829[sizeof("incombiningdiacriticalmarksforsymbols")];
- char uniname2ctype_pool_str1840[sizeof("caucasianalbanian")];
- char uniname2ctype_pool_str1843[sizeof("uideo")];
- char uniname2ctype_pool_str1846[sizeof("indevanagariextended")];
- char uniname2ctype_pool_str1847[sizeof("narb")];
- char uniname2ctype_pool_str1857[sizeof("inbopomofo")];
- char uniname2ctype_pool_str1858[sizeof("incjkunifiedideographsextensionf")];
- char uniname2ctype_pool_str1861[sizeof("inmeroiticcursive")];
- char uniname2ctype_pool_str1866[sizeof("patsyn")];
- char uniname2ctype_pool_str1885[sizeof("insuperscriptsandsubscripts")];
- char uniname2ctype_pool_str1894[sizeof("lydi")];
- char uniname2ctype_pool_str1900[sizeof("lydian")];
- char uniname2ctype_pool_str1903[sizeof("intags")];
- char uniname2ctype_pool_str1909[sizeof("intelugu")];
- char uniname2ctype_pool_str1910[sizeof("intifinagh")];
- char uniname2ctype_pool_str1914[sizeof("ingeometricshapesextended")];
- char uniname2ctype_pool_str1915[sizeof("incombiningdiacriticalmarkssupplement")];
- char uniname2ctype_pool_str1922[sizeof("deva")];
- char uniname2ctype_pool_str1924[sizeof("inprivateusearea")];
- char uniname2ctype_pool_str1932[sizeof("devanagari")];
- char uniname2ctype_pool_str1933[sizeof("noncharactercodepoint")];
- char uniname2ctype_pool_str1934[sizeof("inbrahmi")];
- char uniname2ctype_pool_str1943[sizeof("lowercaseletter")];
- char uniname2ctype_pool_str1944[sizeof("word")];
- char uniname2ctype_pool_str1975[sizeof("caseignorable")];
- char uniname2ctype_pool_str1976[sizeof("inyiradicals")];
- char uniname2ctype_pool_str1979[sizeof("deprecated")];
- char uniname2ctype_pool_str1981[sizeof("thai")];
- char uniname2ctype_pool_str1983[sizeof("thaa")];
- char uniname2ctype_pool_str1985[sizeof("incombiningdiacriticalmarksextended")];
- char uniname2ctype_pool_str1989[sizeof("inmathematicalalphanumericsymbols")];
- char uniname2ctype_pool_str1991[sizeof("thaana")];
- char uniname2ctype_pool_str1995[sizeof("inornamentaldingbats")];
- char uniname2ctype_pool_str1997[sizeof("oldpersian")];
- char uniname2ctype_pool_str1998[sizeof("unassigned")];
- char uniname2ctype_pool_str1999[sizeof("insupplementalarrowsa")];
- char uniname2ctype_pool_str2003[sizeof("inpaucinhau")];
- char uniname2ctype_pool_str2005[sizeof("cwt")];
- char uniname2ctype_pool_str2007[sizeof("tirhuta")];
- char uniname2ctype_pool_str2008[sizeof("mahj")];
- char uniname2ctype_pool_str2013[sizeof("insmallformvariants")];
- char uniname2ctype_pool_str2015[sizeof("tirh")];
- char uniname2ctype_pool_str2017[sizeof("orkh")];
- char uniname2ctype_pool_str2020[sizeof("mahajani")];
- char uniname2ctype_pool_str2047[sizeof("softdotted")];
- char uniname2ctype_pool_str2049[sizeof("inphagspa")];
- char uniname2ctype_pool_str2056[sizeof("inethiopicextended")];
- char uniname2ctype_pool_str2059[sizeof("taitham")];
- char uniname2ctype_pool_str2061[sizeof("assigned")];
- char uniname2ctype_pool_str2068[sizeof("nbat")];
- char uniname2ctype_pool_str2072[sizeof("incyrillicextendedb")];
- char uniname2ctype_pool_str2073[sizeof("khoj")];
- char uniname2ctype_pool_str2076[sizeof("buhd")];
- char uniname2ctype_pool_str2079[sizeof("nabataean")];
- char uniname2ctype_pool_str2084[sizeof("inalphabeticpresentationforms")];
- char uniname2ctype_pool_str2091[sizeof("sorasompeng")];
- char uniname2ctype_pool_str2095[sizeof("insupplementalarrowsc")];
- char uniname2ctype_pool_str2096[sizeof("oldpermic")];
- char uniname2ctype_pool_str2097[sizeof("cyrl")];
- char uniname2ctype_pool_str2101[sizeof("finalpunctuation")];
- char uniname2ctype_pool_str2112[sizeof("meroitichieroglyphs")];
- char uniname2ctype_pool_str2114[sizeof("inarabicsupplement")];
- char uniname2ctype_pool_str2117[sizeof("phlp")];
- char uniname2ctype_pool_str2119[sizeof("inpsalterpahlavi")];
- char uniname2ctype_pool_str2134[sizeof("mlym")];
- char uniname2ctype_pool_str2139[sizeof("incjkunifiedideographsextensionb")];
- char uniname2ctype_pool_str2146[sizeof("palmyrene")];
- char uniname2ctype_pool_str2148[sizeof("insupplementalmathematicaloperators")];
- char uniname2ctype_pool_str2149[sizeof("malayalam")];
- char uniname2ctype_pool_str2154[sizeof("soyo")];
- char uniname2ctype_pool_str2158[sizeof("hex")];
- char uniname2ctype_pool_str2161[sizeof("phag")];
- char uniname2ctype_pool_str2165[sizeof("graphemeclusterbreak=ebase")];
- char uniname2ctype_pool_str2172[sizeof("graphemeclusterbreak=ebasegaz")];
- char uniname2ctype_pool_str2174[sizeof("inhanguljamo")];
- char uniname2ctype_pool_str2176[sizeof("bugi")];
- char uniname2ctype_pool_str2179[sizeof("graphemeclusterbreak=spacingmark")];
- char uniname2ctype_pool_str2182[sizeof("inhanguljamoextendeda")];
- char uniname2ctype_pool_str2187[sizeof("currencysymbol")];
- char uniname2ctype_pool_str2189[sizeof("tamil")];
- char uniname2ctype_pool_str2192[sizeof("graphemeclusterbreak=cr")];
- char uniname2ctype_pool_str2193[sizeof("talu")];
- char uniname2ctype_pool_str2196[sizeof("buginese")];
- char uniname2ctype_pool_str2197[sizeof("telu")];
- char uniname2ctype_pool_str2198[sizeof("ingeorgiansupplement")];
- char uniname2ctype_pool_str2199[sizeof("graphemeclusterbreak=emodifier")];
- char uniname2ctype_pool_str2207[sizeof("graphemeclusterbreak=regionalindicator")];
- char uniname2ctype_pool_str2210[sizeof("inlimbu")];
- char uniname2ctype_pool_str2224[sizeof("inenclosedcjklettersandmonths")];
- char uniname2ctype_pool_str2225[sizeof("tangut")];
- char uniname2ctype_pool_str2229[sizeof("inmathematicaloperators")];
- char uniname2ctype_pool_str2232[sizeof("newa")];
- char uniname2ctype_pool_str2249[sizeof("newtailue")];
- char uniname2ctype_pool_str2252[sizeof("hebr")];
- char uniname2ctype_pool_str2260[sizeof("inbuhid")];
- char uniname2ctype_pool_str2263[sizeof("insuttonsignwriting")];
- char uniname2ctype_pool_str2264[sizeof("syrc")];
- char uniname2ctype_pool_str2271[sizeof("dep")];
- char uniname2ctype_pool_str2276[sizeof("inbassavah")];
- char uniname2ctype_pool_str2286[sizeof("otheridcontinue")];
- char uniname2ctype_pool_str2289[sizeof("inletterlikesymbols")];
- char uniname2ctype_pool_str2296[sizeof("ext")];
- char uniname2ctype_pool_str2300[sizeof("other")];
- char uniname2ctype_pool_str2306[sizeof("inmongoliansupplement")];
- char uniname2ctype_pool_str2307[sizeof("othernumber")];
- char uniname2ctype_pool_str2311[sizeof("injavanese")];
- char uniname2ctype_pool_str2313[sizeof("olditalic")];
- char uniname2ctype_pool_str2327[sizeof("nshu")];
- char uniname2ctype_pool_str2349[sizeof("inarabicpresentationformsb")];
- char uniname2ctype_pool_str2350[sizeof("inlowsurrogates")];
- char uniname2ctype_pool_str2353[sizeof("incombininghalfmarks")];
- char uniname2ctype_pool_str2360[sizeof("inbengali")];
- char uniname2ctype_pool_str2364[sizeof("cwcf")];
- char uniname2ctype_pool_str2369[sizeof("inbuginese")];
- char uniname2ctype_pool_str2372[sizeof("syriac")];
- char uniname2ctype_pool_str2380[sizeof("ethi")];
- char uniname2ctype_pool_str2386[sizeof("otheralphabetic")];
- char uniname2ctype_pool_str2393[sizeof("emojipresentation")];
- char uniname2ctype_pool_str2399[sizeof("inarabicmathematicalalphabeticsymbols")];
- char uniname2ctype_pool_str2408[sizeof("tang")];
- char uniname2ctype_pool_str2409[sizeof("buhid")];
- char uniname2ctype_pool_str2412[sizeof("graphemeclusterbreak=t")];
- char uniname2ctype_pool_str2413[sizeof("extender")];
- char uniname2ctype_pool_str2414[sizeof("graphemeclusterbreak=lvt")];
- char uniname2ctype_pool_str2422[sizeof("tagbanwa")];
- char uniname2ctype_pool_str2423[sizeof("hang")];
- char uniname2ctype_pool_str2433[sizeof("incurrencysymbols")];
- char uniname2ctype_pool_str2449[sizeof("ingujarati")];
- char uniname2ctype_pool_str2451[sizeof("paragraphseparator")];
- char uniname2ctype_pool_str2452[sizeof("tibt")];
- char uniname2ctype_pool_str2461[sizeof("tibetan")];
- char uniname2ctype_pool_str2465[sizeof("ogam")];
- char uniname2ctype_pool_str2467[sizeof("cwl")];
- char uniname2ctype_pool_str2469[sizeof("oalpha")];
- char uniname2ctype_pool_str2473[sizeof("hiragana")];
- char uniname2ctype_pool_str2475[sizeof("surrogate")];
- char uniname2ctype_pool_str2481[sizeof("inbamumsupplement")];
- char uniname2ctype_pool_str2483[sizeof("inrejang")];
- char uniname2ctype_pool_str2484[sizeof("intangutcomponents")];
- char uniname2ctype_pool_str2488[sizeof("hmng")];
- char uniname2ctype_pool_str2489[sizeof("graphemeclusterbreak=extend")];
- char uniname2ctype_pool_str2490[sizeof("graphemeclusterbreak=prepend")];
- char uniname2ctype_pool_str2493[sizeof("bassavah")];
- char uniname2ctype_pool_str2500[sizeof("ingothic")];
- char uniname2ctype_pool_str2507[sizeof("alphabetic")];
- char uniname2ctype_pool_str2509[sizeof("mathsymbol")];
- char uniname2ctype_pool_str2515[sizeof("oupper")];
- char uniname2ctype_pool_str2519[sizeof("oldhungarian")];
- char uniname2ctype_pool_str2523[sizeof("tavt")];
- char uniname2ctype_pool_str2526[sizeof("insupplementalpunctuation")];
- char uniname2ctype_pool_str2539[sizeof("dashpunctuation")];
- char uniname2ctype_pool_str2545[sizeof("inplayingcards")];
- char uniname2ctype_pool_str2550[sizeof("inaegeannumbers")];
- char uniname2ctype_pool_str2573[sizeof("osge")];
- char uniname2ctype_pool_str2576[sizeof("digit")];
- char uniname2ctype_pool_str2579[sizeof("dupl")];
- char uniname2ctype_pool_str2587[sizeof("inlinearbsyllabary")];
- char uniname2ctype_pool_str2589[sizeof("cypriot")];
- char uniname2ctype_pool_str2594[sizeof("wspace")];
- char uniname2ctype_pool_str2601[sizeof("whitespace")];
- char uniname2ctype_pool_str2617[sizeof("cwu")];
- char uniname2ctype_pool_str2618[sizeof("nushu")];
- char uniname2ctype_pool_str2622[sizeof("intagbanwa")];
- char uniname2ctype_pool_str2630[sizeof("sylo")];
- char uniname2ctype_pool_str2643[sizeof("graphemeclusterbreak=l")];
- char uniname2ctype_pool_str2649[sizeof("graphemeclusterbreak=control")];
- char uniname2ctype_pool_str2653[sizeof("oldturkic")];
- char uniname2ctype_pool_str2660[sizeof("changeswhencasemapped")];
- char uniname2ctype_pool_str2678[sizeof("rjng")];
- char uniname2ctype_pool_str2693[sizeof("cyrillic")];
- char uniname2ctype_pool_str2702[sizeof("hangul")];
- char uniname2ctype_pool_str2705[sizeof("modifiersymbol")];
- char uniname2ctype_pool_str2708[sizeof("inalchemicalsymbols")];
- char uniname2ctype_pool_str2710[sizeof("insupplementaryprivateuseareaa")];
- char uniname2ctype_pool_str2717[sizeof("orya")];
- char uniname2ctype_pool_str2751[sizeof("inmahjongtiles")];
- char uniname2ctype_pool_str2758[sizeof("changeswhentitlecased")];
- char uniname2ctype_pool_str2763[sizeof("tifinagh")];
- char uniname2ctype_pool_str2775[sizeof("otherlowercase")];
- char uniname2ctype_pool_str2779[sizeof("inglagolitic")];
- char uniname2ctype_pool_str2791[sizeof("otheridstart")];
- char uniname2ctype_pool_str2792[sizeof("ugar")];
- char uniname2ctype_pool_str2797[sizeof("otherletter")];
- char uniname2ctype_pool_str2823[sizeof("inhangulsyllables")];
- char uniname2ctype_pool_str2829[sizeof("elba")];
- char uniname2ctype_pool_str2834[sizeof("intagalog")];
- char uniname2ctype_pool_str2850[sizeof("otheruppercase")];
- char uniname2ctype_pool_str2879[sizeof("omath")];
- char uniname2ctype_pool_str2883[sizeof("warangciti")];
- char uniname2ctype_pool_str2888[sizeof("sylotinagri")];
- char uniname2ctype_pool_str2890[sizeof("shaw")];
- char uniname2ctype_pool_str2891[sizeof("inpahawhhmong")];
- char uniname2ctype_pool_str2901[sizeof("inhalfwidthandfullwidthforms")];
- char uniname2ctype_pool_str2905[sizeof("inlatinextendedb")];
- char uniname2ctype_pool_str2926[sizeof("osmanya")];
- char uniname2ctype_pool_str2930[sizeof("graphemeclusterbreak=lf")];
- char uniname2ctype_pool_str2932[sizeof("othersymbol")];
- char uniname2ctype_pool_str2953[sizeof("defaultignorablecodepoint")];
- char uniname2ctype_pool_str2967[sizeof("incypriotsyllabary")];
- char uniname2ctype_pool_str2968[sizeof("khudawadi")];
- char uniname2ctype_pool_str2972[sizeof("kayahli")];
- char uniname2ctype_pool_str2984[sizeof("hung")];
- char uniname2ctype_pool_str2987[sizeof("unknown")];
- char uniname2ctype_pool_str2989[sizeof("inyijinghexagramsymbols")];
- char uniname2ctype_pool_str3007[sizeof("elbasan")];
- char uniname2ctype_pool_str3016[sizeof("inbopomofoextended")];
- char uniname2ctype_pool_str3019[sizeof("changeswhenlowercased")];
- char uniname2ctype_pool_str3020[sizeof("otherpunctuation")];
- char uniname2ctype_pool_str3038[sizeof("upper")];
- char uniname2ctype_pool_str3052[sizeof("insupplementalarrowsb")];
- char uniname2ctype_pool_str3066[sizeof("oldnortharabian")];
- char uniname2ctype_pool_str3094[sizeof("changeswhenuppercased")];
- char uniname2ctype_pool_str3113[sizeof("uppercase")];
- char uniname2ctype_pool_str3121[sizeof("ugaritic")];
- char uniname2ctype_pool_str3153[sizeof("otherdefaultignorablecodepoint")];
- char uniname2ctype_pool_str3177[sizeof("othermath")];
- char uniname2ctype_pool_str3180[sizeof("tfng")];
- char uniname2ctype_pool_str3193[sizeof("symbol")];
- char uniname2ctype_pool_str3195[sizeof("hexdigit")];
- char uniname2ctype_pool_str3213[sizeof("any")];
- char uniname2ctype_pool_str3235[sizeof("inhanguljamoextendedb")];
- char uniname2ctype_pool_str3238[sizeof("ethiopic")];
- char uniname2ctype_pool_str3276[sizeof("aghb")];
- char uniname2ctype_pool_str3279[sizeof("graphemeclusterbreak=v")];
- char uniname2ctype_pool_str3280[sizeof("graphemeclusterbreak=lv")];
- char uniname2ctype_pool_str3285[sizeof("soyombo")];
- char uniname2ctype_pool_str3296[sizeof("graphemeclusterbreak=zwj")];
- char uniname2ctype_pool_str3305[sizeof("graphemeclusterbreak=glueafterzwj")];
- char uniname2ctype_pool_str3315[sizeof("sgnw")];
- char uniname2ctype_pool_str3367[sizeof("changeswhencasefolded")];
- char uniname2ctype_pool_str3373[sizeof("ogham")];
- char uniname2ctype_pool_str3409[sizeof("uppercaseletter")];
- char uniname2ctype_pool_str3438[sizeof("inhebrew")];
- char uniname2ctype_pool_str3442[sizeof("inhighprivateusesurrogates")];
- char uniname2ctype_pool_str3448[sizeof("openpunctuation")];
- char uniname2ctype_pool_str3453[sizeof("ogrext")];
- char uniname2ctype_pool_str3454[sizeof("hyphen")];
- char uniname2ctype_pool_str3465[sizeof("tagb")];
- char uniname2ctype_pool_str3496[sizeof("inyisyllables")];
- char uniname2ctype_pool_str3593[sizeof("oldsoutharabian")];
- char uniname2ctype_pool_str3662[sizeof("duployan")];
- char uniname2ctype_pool_str3676[sizeof("hluw")];
- char uniname2ctype_pool_str3689[sizeof("inglagoliticsupplement")];
- char uniname2ctype_pool_str3697[sizeof("insupplementalsymbolsandpictographs")];
- char uniname2ctype_pool_str3763[sizeof("insupplementaryprivateuseareab")];
- char uniname2ctype_pool_str3791[sizeof("inegyptianhieroglyphs")];
- char uniname2ctype_pool_str3960[sizeof("rejang")];
- char uniname2ctype_pool_str3971[sizeof("inhangulcompatibilityjamo")];
- char uniname2ctype_pool_str4036[sizeof("telugu")];
- char uniname2ctype_pool_str4164[sizeof("tglg")];
- char uniname2ctype_pool_str4187[sizeof("tagalog")];
- char uniname2ctype_pool_str4208[sizeof("othergraphemeextend")];
- char uniname2ctype_pool_str4460[sizeof("unifiedideograph")];
- char uniname2ctype_pool_str4464[sizeof("inboxdrawing")];
- char uniname2ctype_pool_str4483[sizeof("pahawhhmong")];
- char uniname2ctype_pool_str4608[sizeof("inhighsurrogates")];
- char uniname2ctype_pool_str4634[sizeof("signwriting")];
- char uniname2ctype_pool_str4678[sizeof("zyyy")];
- char uniname2ctype_pool_str4841[sizeof("egyp")];
- char uniname2ctype_pool_str5170[sizeof("hebrew")];
- char uniname2ctype_pool_str6145[sizeof("egyptianhieroglyphs")];
-#endif /* USE_UNICODE_PROPERTIES */
- };
-static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
- {
-#ifndef USE_UNICODE_PROPERTIES
- "word",
-#else /* USE_UNICODE_PROPERTIES */
- "yi",
- "cn",
- "lina",
- "yiii",
- "lana",
- "ci",
- "mn",
- "z",
- "mani",
- "lo",
- "me",
- "loe",
- "lao",
- "laoo",
- "co",
- "miao",
- "pi",
- "inkannada",
- "gran",
- "innko",
- "zzzz",
- "pe",
- "cari",
- "lineara",
- "carian",
- "mendekikakui",
- "geor",
- "po",
- "grek",
- "meeteimayek",
- "mark",
- "mero",
- "kana",
- "m",
- "mro",
- "mroo",
- "greek",
- "gonm",
- "inkharoshthi",
- "cakm",
- "inmanichaean",
- "c",
- "inarmenian",
- "common",
- "inosmanya",
- "inmro",
- "inmiao",
- "mandaic",
- "inmyanmar",
- "lm",
- "prependedconcatenationmark",
- "inideographicsymbolsandpunctuation",
- "inchakma",
- "inkhmer",
- "perm",
- "connectorpunctuation",
- "marc",
- "combiningmark",
- "merc",
- "inrunic",
- "incarian",
- "incuneiformnumbersandpunctuation",
- "inahom",
- "incherokee",
- "qaai",
- "cans",
- "lc",
- "incuneiform",
- "cc",
- "armn",
- "inavestan",
- "armi",
- "mc",
- "armenian",
- "inipaextensions",
- "inmarchen",
- "pc",
- "insharada",
- "lineseparator",
- "masaramgondi",
- "inarrows",
- "ri",
- "incham",
- "latn",
- "incyrillic",
- "latin",
- "inzanabazarsquare",
- "insamaritan",
- "pcm",
- "inmasaramgondi",
- "qmark",
- "qaac",
- "mtei",
- "inthai",
- "inscriptionalparthian",
- "inthaana",
- "inkaithi",
- "initialpunctuation",
- "inkatakana",
- "inkhmersymbols",
- "insyriac",
- "intakri",
- "prti",
- "arabic",
- "mand",
- "cs",
- "mend",
- "zs",
- "letter",
- "privateuse",
- "modi",
- "katakana",
- "ideo",
- "brai",
- "xidcontinue",
- "inmyanmarextendeda",
- "ascii",
- "ps",
- "inkanaextendeda",
- "inmeeteimayek",
- "inruminumeralsymbols",
- "letternumber",
- "knda",
- "kannada",
- "inoldnortharabian",
- "inideographicdescriptioncharacters",
- "inmodi",
- "incjkcompatibilityforms",
- "incjkcompatibilityideographs",
- "xidc",
- "inmendekikakui",
- "brahmi",
- "inolditalic",
- "inmiscellaneousmathematicalsymbolsa",
- "inspecials",
- "inemoticons",
- "patternwhitespace",
- "gothic",
- "intransportandmapsymbols",
- "l",
- "psalterpahlavi",
- "vai",
- "vaii",
- "lt",
- "meroiticcursive",
- "xids",
- "incommonindicnumberforms",
- "inmandaic",
- "inlineara",
- "incjkcompatibilityideographssupplement",
- "inlao",
- "insundanese",
- "mongolian",
- "bamum",
- "idc",
- "inancientsymbols",
- "kali",
- "grlink",
- "grext",
- "control",
- "inkanasupplement",
- "inopticalcharacterrecognition",
- "inadlam",
- "so",
- "inoldsoutharabian",
- "sk",
-#endif /* USE_UNICODE_PROPERTIES */
- "print",
-#ifndef USE_UNICODE_PROPERTIES
- "punct",
- "alpha",
-#else /* USE_UNICODE_PROPERTIES */
- "idsbinaryoperator",
- "palm",
- "batk",
- "indominotiles",
- "intaitham",
- "inlycian",
- "sora",
- "batak",
- "inmodifiertoneletters",
- "patws",
- "inmalayalam",
- "incjkstrokes",
- "incontrolpictures",
- "samr",
- "bass",
- "samaritan",
- "inmusicalsymbols",
- "ids",
- "pd",
- "sm",
- "pauc",
- "joinc",
- "inlinearbideograms",
- "idcontinue",
- "inancientgreekmusicalnotation",
- "inoldturkic",
-#endif /* USE_UNICODE_PROPERTIES */
- "alnum",
-#ifdef USE_UNICODE_PROPERTIES
- "inugaritic",
- "s",
- "inmiscellaneoussymbols",
- "n",
- "lisu",
- "inmiscellaneoussymbolsandarrows",
- "insylotinagri",
- "inmiscellaneoussymbolsandpictographs",
- "sc",
- "no",
- "ital",
- "p",
- "xpeo",
- "di",
- "idst",
- "intaile",
- "nko",
- "nkoo",
- "dia",
- "inphoenician",
- "inlatinextendeda",
- "indeseret",
- "inlatinextendede",
- "incaucasianalbanian",
- "insaurashtra",
- "inmeeteimayekextensions",
- "idstart",
- "bali",
- "inspacingmodifierletters",
- "bengali",
- "intamil",
- "inmultani",
- "vs",
- "inlydian",
- "balinese",
- "lepc",
- "cased",
- "zinh",
- "blank",
- "runr",
- "patternsyntax",
- "bidic",
-#endif /* USE_UNICODE_PROPERTIES */
- "xdigit",
-#ifndef USE_UNICODE_PROPERTIES
- "upper",
- "ascii",
-#else /* USE_UNICODE_PROPERTIES */
- "xidstart",
- "inphaistosdisc",
- "inancientgreeknumbers",
- "canadianaboriginal",
- "cher",
- "plrd",
- "sind",
- "cherokee",
- "phoenician",
- "marchen",
- "inhiragana",
- "inearlydynasticcuneiform",
- "graphemebase",
- "cham",
- "inimperialaramaic",
- "kaithi",
- "insiddham",
- "diacritic",
- "chakma",
- "graphemelink",
- "inkhudawadi",
- "inmahajani",
- "khojki",
- "inogham",
- "khar",
- "incountingrodnumerals",
- "manichaean",
- "coptic",
- "bamu",
- "sterm",
- "inethiopic",
- "ll",
- "inolchiki",
- "inlatinextendedc",
- "zl",
- "adlm",
- "incyrillicsupplement",
- "incyrillicextendeda",
- "incherokeesupplement",
- "decimalnumber",
- "khmr",
- "copt",
- "ahom",
- "runic",
- "intaixuanjingsymbols",
- "insinhala",
- "cprt",
- "imperialaramaic",
- "casedletter",
- "khmer",
- "linb",
- "adlam",
- "ininscriptionalparthian",
- "ininscriptionalpahlavi",
- "sinhala",
- "zanb",
- "incjkunifiedideographsextensiona",
- "multani",
- "quotationmark",
- "incjkunifiedideographsextensione",
- "innabataean",
- "inbhaiksuki",
- "inelbasan",
- "inkanbun",
- "inscriptionalpahlavi",
- "bopo",
- "linearb",
- "incyrillicextendedc",
- "glagolitic",
- "kharoshthi",
- "inoldpersian",
- "goth",
- "math",
- "joincontrol",
- "punct",
- "lu",
- "limb",
- "inmiscellaneoustechnical",
- "han",
- "hani",
- "invai",
- "sundanese",
- "taile",
- "takri",
- "grantha",
- "hano",
- "inhatran",
- "oriya",
- "intirhuta",
- "guru",
- "kthi",
- "saur",
- "incjkunifiedideographsextensionc",
- "hanunoo",
- "paucinhau",
- "takr",
- "hira",
- "inarabic",
- "bopomofo",
- "radical",
- "gurmukhi",
- "inkhojki",
- "arab",
- "limbu",
- "inoldpermic",
- "brah",
- "inoldhungarian",
- "inshorthandformatcontrols",
- "incoptic",
- "sd",
- "sidd",
- "inherited",
- "incjkunifiedideographs",
- "term",
- "incjksymbolsandpunctuation",
- "graphemeextend",
- "dsrt",
-#endif /* USE_UNICODE_PROPERTIES */
- "cntrl",
-#ifdef USE_UNICODE_PROPERTIES
- "xsux",
- "insyriacsupplement",
- "inbasiclatin",
- "deseret",
- "inenclosedideographicsupplement",
- "bidicontrol",
- "closepunctuation",
- "inlatinextendedadditional",
- "inarabicpresentationformsa",
- "grbase",
- "mong",
- "anatolianhieroglyphs",
- "inenclosedalphanumerics",
- "ingrantha",
- "georgian",
- "osage",
- "inosage",
- "ingeneralpunctuation",
- "saurashtra",
- "inshavian",
-#endif /* USE_UNICODE_PROPERTIES */
- "space",
-#ifdef USE_UNICODE_PROPERTIES
- "mult",
- "inpalmyrene",
- "inanatolianhieroglyphs",
- "spacingmark",
- "alpha",
- "ingeorgian",
- "intibetan",
- "inlepcha",
- "inbatak",
- "emoji",
- "osma",
- "bhks",
- "inmongolian",
- "variationselector",
- "braille",
- "phli",
- "bhaiksuki",
- "phnx",
- "inblockelements",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=1.1",
- "age=4.1",
- "age=4.0",
- "age=10.0",
- "age=2.1",
- "age=2.0",
- "age=6.1",
- "age=6.0",
- "age=9.0",
- "age=8.0",
- "age=6.2",
- "age=7.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "inenclosedalphanumericsupplement",
- "innumberforms",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=5.1",
- "age=5.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "nd",
- "separator",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=5.2",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "ingurmukhi",
- "incjkunifiedideographsextensiond",
- "taiviet",
- "sinh",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=3.1",
- "age=3.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "hatran",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=3.2",
- "age=6.3",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "format",
- "shavian",
- "insinhalaarchaicnumbers",
- "cuneiform",
- "inmyanmarextendedb",
- "punctuation",
- "inarabicextendeda",
- "hatr",
- "inhanunoo",
- "inlatinextendedd",
- "modifierletter",
- "odi",
- "ahex",
- "logicalorderexception",
- "inbyzantinemusicalsymbols",
- "sund",
- "number",
- "insundanesesupplement",
- "incopticepactnumbers",
- "emojimodifier",
- "zp",
- "asciihexdigit",
- "indevanagari",
- "innewa",
- "avestan",
- "insorasompeng",
- "inmiscellaneousmathematicalsymbolsb",
- "inbraillepatterns",
- "nonspacingmark",
- "ingreekandcoptic",
-#endif /* USE_UNICODE_PROPERTIES */
- "xposixpunct",
-#ifdef USE_UNICODE_PROPERTIES
- "inwarangciti",
- "oidc",
- "terminalpunctuation",
- "cf",
-#endif /* USE_UNICODE_PROPERTIES */
- "lower",
-#ifdef USE_UNICODE_PROPERTIES
- "inunifiedcanadianaboriginalsyllabics",
- "idsb",
- "inbalinese",
- "induployan",
- "innoblock",
- "pf",
- "inoriya",
- "inkatakanaphoneticextensions",
- "inkayahli",
- "wara",
- "innushu",
- "lepcha",
- "inmeroitichieroglyphs",
- "beng",
- "idstrinaryoperator",
- "oids",
- "regionalindicator",
- "enclosingmark",
- "java",
- "tale",
- "emojimodifierbase",
- "inphoneticextensions",
- "lowercase",
- "inverticalforms",
- "javanese",
- "sentenceterminal",
- "ingreekextended",
- "invariationselectors",
- "cwcm",
- "lyci",
- "avst",
- "lycian",
- "zanabazarsquare",
- "sarb",
- "invedicextensions",
- "inkangxiradicals",
- "intaiviet",
- "mymr",
- "incjkradicalssupplement",
- "myanmar",
- "taml",
- "olower",
- "nl",
- "inethiopicsupplement",
- "olck",
- "inethiopicextendeda",
-#endif /* USE_UNICODE_PROPERTIES */
- "graph",
-#ifdef USE_UNICODE_PROPERTIES
- "olchiki",
- "inphoneticextensionssupplement",
- "emojicomponent",
- "inunifiedcanadianaboriginalsyllabicsextended",
- "ingeometricshapes",
- "invariationselectorssupplement",
- "gujr",
- "sharada",
- "gujarati",
- "nchar",
- "innewtailue",
- "glag",
- "ideographic",
- "shrd",
- "insoyombo",
- "inbamum",
- "inlatin1supplement",
- "dash",
- "indingbats",
- "spaceseparator",
- "phagspa",
- "titlecaseletter",
- "incjkcompatibility",
- "intangut",
- "incombiningdiacriticalmarks",
- "inlisu",
- "siddham",
- "incombiningdiacriticalmarksforsymbols",
- "caucasianalbanian",
- "uideo",
- "indevanagariextended",
- "narb",
- "inbopomofo",
- "incjkunifiedideographsextensionf",
- "inmeroiticcursive",
- "patsyn",
- "insuperscriptsandsubscripts",
- "lydi",
- "lydian",
- "intags",
- "intelugu",
- "intifinagh",
- "ingeometricshapesextended",
- "incombiningdiacriticalmarkssupplement",
- "deva",
- "inprivateusearea",
- "devanagari",
- "noncharactercodepoint",
- "inbrahmi",
- "lowercaseletter",
- "word",
- "caseignorable",
- "inyiradicals",
- "deprecated",
- "thai",
- "thaa",
- "incombiningdiacriticalmarksextended",
- "inmathematicalalphanumericsymbols",
- "thaana",
- "inornamentaldingbats",
- "oldpersian",
- "unassigned",
- "insupplementalarrowsa",
- "inpaucinhau",
- "cwt",
- "tirhuta",
- "mahj",
- "insmallformvariants",
- "tirh",
- "orkh",
- "mahajani",
- "softdotted",
- "inphagspa",
- "inethiopicextended",
- "taitham",
- "assigned",
- "nbat",
- "incyrillicextendedb",
- "khoj",
- "buhd",
- "nabataean",
- "inalphabeticpresentationforms",
- "sorasompeng",
- "insupplementalarrowsc",
- "oldpermic",
- "cyrl",
- "finalpunctuation",
- "meroitichieroglyphs",
- "inarabicsupplement",
- "phlp",
- "inpsalterpahlavi",
- "mlym",
- "incjkunifiedideographsextensionb",
- "palmyrene",
- "insupplementalmathematicaloperators",
- "malayalam",
- "soyo",
- "hex",
- "phag",
- "graphemeclusterbreak=ebase",
- "graphemeclusterbreak=ebasegaz",
- "inhanguljamo",
- "bugi",
- "graphemeclusterbreak=spacingmark",
- "inhanguljamoextendeda",
- "currencysymbol",
- "tamil",
- "graphemeclusterbreak=cr",
- "talu",
- "buginese",
- "telu",
- "ingeorgiansupplement",
- "graphemeclusterbreak=emodifier",
- "graphemeclusterbreak=regionalindicator",
- "inlimbu",
- "inenclosedcjklettersandmonths",
- "tangut",
- "inmathematicaloperators",
- "newa",
- "newtailue",
- "hebr",
- "inbuhid",
- "insuttonsignwriting",
- "syrc",
- "dep",
- "inbassavah",
- "otheridcontinue",
- "inletterlikesymbols",
- "ext",
- "other",
- "inmongoliansupplement",
- "othernumber",
- "injavanese",
- "olditalic",
- "nshu",
- "inarabicpresentationformsb",
- "inlowsurrogates",
- "incombininghalfmarks",
- "inbengali",
- "cwcf",
- "inbuginese",
- "syriac",
- "ethi",
- "otheralphabetic",
- "emojipresentation",
- "inarabicmathematicalalphabeticsymbols",
- "tang",
- "buhid",
- "graphemeclusterbreak=t",
- "extender",
- "graphemeclusterbreak=lvt",
- "tagbanwa",
- "hang",
- "incurrencysymbols",
- "ingujarati",
- "paragraphseparator",
- "tibt",
- "tibetan",
- "ogam",
- "cwl",
- "oalpha",
- "hiragana",
- "surrogate",
- "inbamumsupplement",
- "inrejang",
- "intangutcomponents",
- "hmng",
- "graphemeclusterbreak=extend",
- "graphemeclusterbreak=prepend",
- "bassavah",
- "ingothic",
- "alphabetic",
- "mathsymbol",
- "oupper",
- "oldhungarian",
- "tavt",
- "insupplementalpunctuation",
- "dashpunctuation",
- "inplayingcards",
- "inaegeannumbers",
- "osge",
-#endif /* USE_UNICODE_PROPERTIES */
- "digit",
-#ifndef USE_UNICODE_PROPERTIES
- "blank"
-#else /* USE_UNICODE_PROPERTIES */
- "dupl",
- "inlinearbsyllabary",
- "cypriot",
- "wspace",
- "whitespace",
- "cwu",
- "nushu",
- "intagbanwa",
- "sylo",
- "graphemeclusterbreak=l",
- "graphemeclusterbreak=control",
- "oldturkic",
- "changeswhencasemapped",
- "rjng",
- "cyrillic",
- "hangul",
- "modifiersymbol",
- "inalchemicalsymbols",
- "insupplementaryprivateuseareaa",
- "orya",
- "inmahjongtiles",
- "changeswhentitlecased",
- "tifinagh",
- "otherlowercase",
- "inglagolitic",
- "otheridstart",
- "ugar",
- "otherletter",
- "inhangulsyllables",
- "elba",
- "intagalog",
- "otheruppercase",
- "omath",
- "warangciti",
- "sylotinagri",
- "shaw",
- "inpahawhhmong",
- "inhalfwidthandfullwidthforms",
- "inlatinextendedb",
- "osmanya",
- "graphemeclusterbreak=lf",
- "othersymbol",
- "defaultignorablecodepoint",
- "incypriotsyllabary",
- "khudawadi",
- "kayahli",
- "hung",
- "unknown",
- "inyijinghexagramsymbols",
- "elbasan",
- "inbopomofoextended",
- "changeswhenlowercased",
- "otherpunctuation",
- "upper",
- "insupplementalarrowsb",
- "oldnortharabian",
- "changeswhenuppercased",
- "uppercase",
- "ugaritic",
- "otherdefaultignorablecodepoint",
- "othermath",
- "tfng",
- "symbol",
- "hexdigit",
- "any",
- "inhanguljamoextendedb",
- "ethiopic",
- "aghb",
- "graphemeclusterbreak=v",
- "graphemeclusterbreak=lv",
- "soyombo",
- "graphemeclusterbreak=zwj",
- "graphemeclusterbreak=glueafterzwj",
- "sgnw",
- "changeswhencasefolded",
- "ogham",
- "uppercaseletter",
- "inhebrew",
- "inhighprivateusesurrogates",
- "openpunctuation",
- "ogrext",
- "hyphen",
- "tagb",
- "inyisyllables",
- "oldsoutharabian",
- "duployan",
- "hluw",
- "inglagoliticsupplement",
- "insupplementalsymbolsandpictographs",
- "insupplementaryprivateuseareab",
- "inegyptianhieroglyphs",
- "rejang",
- "inhangulcompatibilityjamo",
- "telugu",
- "tglg",
- "tagalog",
- "othergraphemeextend",
- "unifiedideograph",
- "inboxdrawing",
- "pahawhhmong",
- "inhighsurrogates",
- "signwriting",
- "zyyy",
- "egyp",
- "hebrew",
- "egyptianhieroglyphs"
-#endif /* USE_UNICODE_PROPERTIES */
- };
-#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
-const struct uniname2ctype_struct *
-uniname2ctype_p (register const char *str, register size_t len)
-{
- static const struct uniname2ctype_struct wordlist[] =
- {
-#ifdef USE_UNICODE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str10), 111},
- {-1}, {-1},
- {uniname2ctype_offset(str13), 21},
- {uniname2ctype_offset(str14), 184},
- {uniname2ctype_offset(str15), 111},
- {uniname2ctype_offset(str16), 152},
- {uniname2ctype_offset(str17), 61},
- {-1},
- {uniname2ctype_offset(str19), 34},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str26), 52},
- {-1},
- {uniname2ctype_offset(str28), 186},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str33), 28},
- {-1},
- {uniname2ctype_offset(str35), 33},
- {-1},
- {uniname2ctype_offset(str37), 241},
- {-1},
- {uniname2ctype_offset(str39), 95},
- {uniname2ctype_offset(str40), 95},
- {uniname2ctype_offset(str41), 22},
- {uniname2ctype_offset(str42), 173},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str47), 44},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str51), 320},
- {uniname2ctype_offset(str52), 181},
- {-1},
- {uniname2ctype_offset(str54), 308},
- {uniname2ctype_offset(str55), 255},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str59), 42},
- {uniname2ctype_offset(str60), 149},
- {uniname2ctype_offset(str61), 184},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str66), 149},
- {-1}, {-1},
- {uniname2ctype_offset(str69), 187},
- {uniname2ctype_offset(str70), 98},
- {uniname2ctype_offset(str71), 45},
- {uniname2ctype_offset(str72), 77},
- {uniname2ctype_offset(str73), 160},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str80), 31},
- {-1},
- {uniname2ctype_offset(str82), 172},
- {-1}, {-1},
- {uniname2ctype_offset(str85), 108},
- {uniname2ctype_offset(str86), 31},
- {uniname2ctype_offset(str87), 189},
- {uniname2ctype_offset(str88), 189},
- {-1},
- {uniname2ctype_offset(str90), 77},
- {-1}, {-1},
- {uniname2ctype_offset(str93), 212},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str97), 484},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str105), 170},
- {uniname2ctype_offset(str106), 487},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str111), 18},
- {-1},
- {uniname2ctype_offset(str113), 302},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str117), 75},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str122), 470},
- {uniname2ctype_offset(str123), 526},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str129), 529},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str137), 169},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str142), 326},
- {uniname2ctype_offset(str143), 27},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str150), 248},
- {-1}, {-1},
- {uniname2ctype_offset(str153), 530},
- {uniname2ctype_offset(str154), 498},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str160), 339},
- {uniname2ctype_offset(str161), 194},
- {uniname2ctype_offset(str162), 40},
- {-1},
- {uniname2ctype_offset(str164), 208},
- {-1}, {-1},
- {uniname2ctype_offset(str167), 31},
- {uniname2ctype_offset(str168), 171},
- {uniname2ctype_offset(str169), 334},
- {uniname2ctype_offset(str170), 461},
- {-1},
- {uniname2ctype_offset(str172), 521},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str184), 512},
- {-1},
- {uniname2ctype_offset(str186), 331},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str191), 115},
- {-1},
- {uniname2ctype_offset(str193), 102},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str205), 25},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str210), 520},
- {-1}, {-1},
- {uniname2ctype_offset(str213), 19},
- {-1},
- {uniname2ctype_offset(str215), 79},
- {uniname2ctype_offset(str216), 488},
- {uniname2ctype_offset(str217), 161},
- {-1},
- {uniname2ctype_offset(str219), 32},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str223), 79},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str227), 296},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str238), 518},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str243), 40},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str250), 500},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str255), 53},
- {uniname2ctype_offset(str256), 212},
- {-1}, {-1},
- {uniname2ctype_offset(str259), 368},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str268), 249},
- {-1},
- {uniname2ctype_offset(str270), 429},
- {uniname2ctype_offset(str271), 76},
- {uniname2ctype_offset(str272), 300},
- {uniname2ctype_offset(str273), 76},
- {-1}, {-1},
- {uniname2ctype_offset(str276), 514},
- {-1}, {-1},
- {uniname2ctype_offset(str279), 309},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str283), 248},
- {-1},
- {uniname2ctype_offset(str285), 519},
- {-1}, {-1},
- {uniname2ctype_offset(str288), 221},
- {uniname2ctype_offset(str289), 129},
- {-1},
- {uniname2ctype_offset(str291), 160},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str295), 323},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str300), 163},
- {uniname2ctype_offset(str301), 307},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str309), 496},
- {-1},
- {uniname2ctype_offset(str311), 44},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str315), 399},
- {-1},
- {uniname2ctype_offset(str317), 345},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str343), 305},
- {uniname2ctype_offset(str344), 511},
- {uniname2ctype_offset(str345), 163},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str356), 81},
- {uniname2ctype_offset(str357), 169},
- {-1},
- {uniname2ctype_offset(str359), 23},
- {-1},
- {uniname2ctype_offset(str361), 187},
- {uniname2ctype_offset(str362), 55},
- {uniname2ctype_offset(str363), 24},
- {-1},
- {uniname2ctype_offset(str365), 22},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str369), 188},
- {uniname2ctype_offset(str370), 108},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str377), 227},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str383), 127},
- {uniname2ctype_offset(str384), 70},
- {-1},
- {uniname2ctype_offset(str386), 430},
- {uniname2ctype_offset(str387), 14},
- {-1},
- {uniname2ctype_offset(str389), 46},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str393), 534},
- {-1}, {-1},
- {uniname2ctype_offset(str396), 436},
- {-1}, {-1},
- {uniname2ctype_offset(str399), 494},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str408), 37},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str412), 91},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str425), 91},
- {-1}, {-1},
- {uniname2ctype_offset(str428), 486},
- {-1},
- {uniname2ctype_offset(str430), 396},
- {-1},
- {uniname2ctype_offset(str432), 509},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str440), 449},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str445), 443},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str453), 70},
- {-1},
- {uniname2ctype_offset(str455), 546},
- {-1}, {-1},
- {uniname2ctype_offset(str458), 168},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str480), 463},
- {-1},
- {uniname2ctype_offset(str482), 379},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str486), 453},
- {uniname2ctype_offset(str487), 555},
- {uniname2ctype_offset(str488), 246},
- {uniname2ctype_offset(str489), 113},
- {-1}, {-1},
- {uniname2ctype_offset(str492), 557},
- {uniname2ctype_offset(str493), 24},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str509), 195},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str516), 144},
- {uniname2ctype_offset(str517), 144},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str523), 29},
- {uniname2ctype_offset(str524), 171},
- {-1},
- {uniname2ctype_offset(str526), 69},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str530), 420},
- {uniname2ctype_offset(str531), 310},
- {-1},
- {uniname2ctype_offset(str533), 474},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str541), 567},
- {-1}, {-1},
- {uniname2ctype_offset(str544), 324},
- {uniname2ctype_offset(str545), 350},
- {-1},
- {uniname2ctype_offset(str547), 106},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str552), 158},
- {-1},
- {uniname2ctype_offset(str554), 68},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str561), 458},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str573), 146},
- {uniname2ctype_offset(str574), 74},
- {-1},
- {uniname2ctype_offset(str576), 72},
- {uniname2ctype_offset(str577), 19},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str586), 533},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str591), 372},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str596), 547},
- {-1},
- {uniname2ctype_offset(str598), 51},
- {-1}, {-1},
- {uniname2ctype_offset(str601), 485},
- {uniname2ctype_offset(str602), 49},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str606), 7},
- {uniname2ctype_offset(str607), 234},
- {-1},
- {uniname2ctype_offset(str609), 192},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str618), 167},
- {uniname2ctype_offset(str619), 550},
- {uniname2ctype_offset(str620), 347},
- {-1},
- {uniname2ctype_offset(str622), 460},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str629), 175},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str636), 167},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str642), 417},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str657), 246},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str665), 321},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str670), 404},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str681), 371},
- {-1}, {-1},
- {uniname2ctype_offset(str684), 156},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str689), 178},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str693), 156},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str699), 539},
- {uniname2ctype_offset(str700), 67},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str705), 41},
- {-1}, {-1},
- {uniname2ctype_offset(str708), 50},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str715), 193},
- {uniname2ctype_offset(str716), 218},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str725), 455},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str730), 68},
- {-1},
- {uniname2ctype_offset(str732), 540},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str737), 492},
- {uniname2ctype_offset(str738), 13},
- {uniname2ctype_offset(str739), 466},
- {-1},
- {uniname2ctype_offset(str741), 47},
- {uniname2ctype_offset(str742), 377},
- {uniname2ctype_offset(str743), 35},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str748), 157},
- {-1}, {-1},
- {uniname2ctype_offset(str751), 385},
- {-1},
- {uniname2ctype_offset(str753), 419},
- {-1}, {-1},
- {uniname2ctype_offset(str756), 554},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str770), 48},
- {-1}, {-1},
- {uniname2ctype_offset(str773), 38},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str777), 112},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str781), 39},
- {uniname2ctype_offset(str782), 134},
- {-1}, {-1},
- {uniname2ctype_offset(str785), 71},
- {-1},
- {uniname2ctype_offset(str787), 235},
- {uniname2ctype_offset(str788), 343},
- {-1}, {-1},
- {uniname2ctype_offset(str791), 140},
- {uniname2ctype_offset(str792), 140},
- {uniname2ctype_offset(str793), 228},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str797), 480},
- {-1},
- {uniname2ctype_offset(str799), 294},
- {-1}, {-1},
- {uniname2ctype_offset(str802), 468},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str807), 434},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str812), 473},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str819), 422},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str823), 432},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str834), 67},
- {uniname2ctype_offset(str835), 136},
- {-1},
- {uniname2ctype_offset(str837), 297},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str848), 85},
- {uniname2ctype_offset(str849), 318},
- {-1},
- {uniname2ctype_offset(str851), 503},
- {uniname2ctype_offset(str852), 245},
- {uniname2ctype_offset(str853), 481},
- {-1},
- {uniname2ctype_offset(str855), 136},
- {uniname2ctype_offset(str856), 142},
- {uniname2ctype_offset(str857), 60},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str862), 115},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str867), 2},
- {-1}, {-1},
- {uniname2ctype_offset(str870), 104},
- {-1},
- {uniname2ctype_offset(str872), 247},
- {-1},
- {uniname2ctype_offset(str874), 217},
- {-1}, {-1},
- {uniname2ctype_offset(str877), 11},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str881), 69},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str885), 459},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str897), 457},
- {-1},
- {uniname2ctype_offset(str899), 102},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str903), 101},
- {-1},
- {uniname2ctype_offset(str905), 173},
- {uniname2ctype_offset(str906), 197},
- {-1}, {-1},
- {uniname2ctype_offset(str909), 101},
- {-1},
- {uniname2ctype_offset(str911), 138},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str918), 208},
- {uniname2ctype_offset(str919), 398},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str926), 522},
- {-1},
- {uniname2ctype_offset(str928), 73},
- {-1},
- {uniname2ctype_offset(str930), 151},
- {uniname2ctype_offset(str931), 476},
- {uniname2ctype_offset(str932), 166},
- {-1}, {-1},
- {uniname2ctype_offset(str935), 508},
- {-1},
- {uniname2ctype_offset(str937), 228},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str942), 170},
- {-1},
- {uniname2ctype_offset(str944), 74},
- {-1}, {-1},
- {uniname2ctype_offset(str947), 504},
- {uniname2ctype_offset(str948), 499},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str956), 183},
- {uniname2ctype_offset(str957), 333},
- {-1}, {-1},
- {uniname2ctype_offset(str960), 135},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str966), 542},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str975), 186},
- {uniname2ctype_offset(str976), 129},
- {uniname2ctype_offset(str977), 158},
- {-1}, {-1},
- {uniname2ctype_offset(str980), 244},
- {-1}, {-1},
- {uniname2ctype_offset(str983), 329},
- {-1},
- {uniname2ctype_offset(str985), 26},
- {-1}, {-1},
- {uniname2ctype_offset(str988), 353},
- {-1}, {-1},
- {uniname2ctype_offset(str991), 387},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str996), 53},
- {-1},
- {uniname2ctype_offset(str998), 206},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1016), 301},
- {-1}, {-1},
- {uniname2ctype_offset(str1019), 392},
- {-1}, {-1},
- {uniname2ctype_offset(str1022), 435},
- {uniname2ctype_offset(str1023), 36},
- {-1},
- {uniname2ctype_offset(str1025), 105},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1029), 129},
- {-1}, {-1},
- {uniname2ctype_offset(str1032), 200},
- {-1},
- {uniname2ctype_offset(str1034), 104},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1048), 541},
- {uniname2ctype_offset(str1049), 322},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1053), 126},
- {-1}, {-1},
- {uniname2ctype_offset(str1056), 161},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1061), 25},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1065), 105},
- {-1},
- {uniname2ctype_offset(str1067), 122},
- {-1},
- {uniname2ctype_offset(str1069), 206},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1076), 489},
- {uniname2ctype_offset(str1077), 490},
- {uniname2ctype_offset(str1078), 93},
- {-1},
- {uniname2ctype_offset(str1080), 215},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1086), 408},
- {-1},
- {uniname2ctype_offset(str1088), 203},
- {uniname2ctype_offset(str1089), 221},
- {uniname2ctype_offset(str1090), 565},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1094), 478},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1098), 517},
- {-1},
- {uniname2ctype_offset(str1100), 472},
- {-1}, {-1},
- {uniname2ctype_offset(str1103), 402},
- {uniname2ctype_offset(str1104), 164},
- {-1}, {-1},
- {uniname2ctype_offset(str1107), 109},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1114), 122},
- {uniname2ctype_offset(str1115), 354},
- {uniname2ctype_offset(str1116), 131},
- {-1}, {-1},
- {uniname2ctype_offset(str1119), 135},
- {uniname2ctype_offset(str1120), 467},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1124), 113},
- {-1},
- {uniname2ctype_offset(str1126), 56},
- {uniname2ctype_offset(str1127), 218},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1131), 15},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1135), 30},
- {uniname2ctype_offset(str1136), 120},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1147), 370},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1152), 110},
- {-1}, {-1},
- {uniname2ctype_offset(str1155), 110},
- {uniname2ctype_offset(str1156), 414},
- {uniname2ctype_offset(str1157), 141},
- {uniname2ctype_offset(str1158), 121},
- {-1},
- {uniname2ctype_offset(str1160), 176},
- {uniname2ctype_offset(str1161), 181},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1167), 117},
- {uniname2ctype_offset(str1168), 479},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1172), 88},
- {uniname2ctype_offset(str1173), 507},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1178), 86},
- {uniname2ctype_offset(str1179), 166},
- {uniname2ctype_offset(str1180), 145},
- {-1},
- {uniname2ctype_offset(str1182), 563},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1186), 117},
- {-1}, {-1},
- {uniname2ctype_offset(str1189), 193},
- {-1}, {-1},
- {uniname2ctype_offset(str1192), 176},
- {uniname2ctype_offset(str1193), 107},
- {-1},
- {uniname2ctype_offset(str1195), 304},
- {uniname2ctype_offset(str1196), 109},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1201), 236},
- {uniname2ctype_offset(str1202), 86},
- {uniname2ctype_offset(str1203), 502},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1207), 81},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1211), 120},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1218), 465},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1222), 168},
- {-1}, {-1},
- {uniname2ctype_offset(str1225), 493},
- {-1},
- {uniname2ctype_offset(str1227), 537},
- {-1},
- {uniname2ctype_offset(str1229), 388},
- {-1}, {-1},
- {uniname2ctype_offset(str1232), 240},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1237), 196},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1243), 115},
- {-1},
- {uniname2ctype_offset(str1245), 410},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1249), 222},
- {-1}, {-1},
- {uniname2ctype_offset(str1252), 397},
- {uniname2ctype_offset(str1253), 72},
- {uniname2ctype_offset(str1254), 114},
- {-1}, {-1},
- {uniname2ctype_offset(str1257), 3},
- {-1},
- {uniname2ctype_offset(str1259), 137},
- {-1}, {-1},
- {uniname2ctype_offset(str1262), 311},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1267), 292},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1275), 114},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1281), 553},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1285), 217},
- {-1}, {-1},
- {uniname2ctype_offset(str1288), 42},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1294), 360},
- {-1},
- {uniname2ctype_offset(str1296), 445},
- {-1},
- {uniname2ctype_offset(str1298), 73},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1306), 106},
- {uniname2ctype_offset(str1307), 201},
- {uniname2ctype_offset(str1308), 373},
- {uniname2ctype_offset(str1309), 505},
- {uniname2ctype_offset(str1310), 98},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1317), 210},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1325), 471},
- {uniname2ctype_offset(str1326), 362},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1331), 145},
- {-1}, {-1},
- {uniname2ctype_offset(str1334), 469},
- {uniname2ctype_offset(str1335), 9},
- {uniname2ctype_offset(str1336), 203},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1340), 477},
- {uniname2ctype_offset(str1341), 524},
- {-1}, {-1},
- {uniname2ctype_offset(str1344), 32},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1348), 1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1354), 327},
- {uniname2ctype_offset(str1355), 325},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1364), 352},
- {uniname2ctype_offset(str1365), 351},
- {-1},
- {uniname2ctype_offset(str1367), 250},
- {uniname2ctype_offset(str1368), 125},
- {uniname2ctype_offset(str1369), 207},
- {-1}, {-1},
- {uniname2ctype_offset(str1372), 340},
- {uniname2ctype_offset(str1373), 245},
- {uniname2ctype_offset(str1374), 127},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1379), 164},
- {-1}, {-1},
- {uniname2ctype_offset(str1382), 207},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1388), 138},
- {-1},
- {uniname2ctype_offset(str1390), 375},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1391), 256},
- {uniname2ctype_offset(str1392), 263},
- {uniname2ctype_offset(str1393), 262},
- {uniname2ctype_offset(str1394), 274},
- {uniname2ctype_offset(str1395), 258},
- {uniname2ctype_offset(str1396), 257},
- {uniname2ctype_offset(str1397), 268},
- {uniname2ctype_offset(str1398), 267},
- {uniname2ctype_offset(str1399), 273},
- {uniname2ctype_offset(str1400), 272},
- {uniname2ctype_offset(str1401), 269},
- {uniname2ctype_offset(str1402), 271},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1403), 552},
- {uniname2ctype_offset(str1404), 367},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1405), 265},
- {uniname2ctype_offset(str1406), 264},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1407), 36},
- {uniname2ctype_offset(str1408), 52},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1409), 266},
- {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1411), 315},
- {-1},
- {uniname2ctype_offset(str1413), 564},
- {uniname2ctype_offset(str1414), 153},
- {-1},
- {uniname2ctype_offset(str1416), 93},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1417), 260},
- {uniname2ctype_offset(str1418), 259},
- {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1420), 202},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1421), 261},
- {-1},
- {uniname2ctype_offset(str1423), 270},
- {-1}, {-1}, {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1427), 20},
- {-1},
- {uniname2ctype_offset(str1429), 124},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1434), 501},
- {uniname2ctype_offset(str1435), 137},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1439), 428},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1444), 39},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1449), 312},
- {uniname2ctype_offset(str1450), 202},
- {uniname2ctype_offset(str1451), 336},
- {-1},
- {uniname2ctype_offset(str1453), 418},
- {-1},
- {uniname2ctype_offset(str1455), 27},
- {uniname2ctype_offset(str1456), 238},
- {-1},
- {uniname2ctype_offset(str1458), 225},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1463), 241},
- {uniname2ctype_offset(str1464), 538},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1469), 141},
- {uniname2ctype_offset(str1470), 35},
- {uniname2ctype_offset(str1471), 355},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1485), 462},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1490), 252},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1496), 54},
- {uniname2ctype_offset(str1497), 225},
- {-1}, {-1},
- {uniname2ctype_offset(str1500), 313},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1508), 506},
- {-1},
- {uniname2ctype_offset(str1510), 154},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1521), 497},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1535), 383},
- {uniname2ctype_offset(str1536), 381},
- {-1}, {-1},
- {uniname2ctype_offset(str1539), 34},
- {uniname2ctype_offset(str1540), 299},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1545), 8},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1553), 513},
- {-1},
- {uniname2ctype_offset(str1555), 243},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1560), 222},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1565), 20},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1572), 6},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1580), 332},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1585), 234},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1589), 349},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1593), 536},
- {uniname2ctype_offset(str1594), 572},
- {uniname2ctype_offset(str1595), 43},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1602), 317},
- {-1},
- {uniname2ctype_offset(str1604), 405},
- {-1},
- {uniname2ctype_offset(str1606), 424},
- {uniname2ctype_offset(str1607), 199},
- {uniname2ctype_offset(str1608), 535},
- {uniname2ctype_offset(str1609), 142},
- {-1},
- {uniname2ctype_offset(str1611), 482},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1617), 85},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1623), 235},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1628), 242},
- {-1},
- {uniname2ctype_offset(str1630), 249},
- {uniname2ctype_offset(str1631), 33},
- {uniname2ctype_offset(str1632), 159},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1636), 121},
- {-1},
- {uniname2ctype_offset(str1638), 253},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1645), 357},
- {-1},
- {uniname2ctype_offset(str1647), 58},
- {uniname2ctype_offset(str1648), 447},
- {-1},
- {uniname2ctype_offset(str1650), 159},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1654), 244},
- {uniname2ctype_offset(str1655), 361},
- {uniname2ctype_offset(str1656), 446},
- {uniname2ctype_offset(str1657), 66},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1663), 148},
- {-1}, {-1},
- {uniname2ctype_offset(str1666), 154},
- {-1}, {-1},
- {uniname2ctype_offset(str1669), 148},
- {-1},
- {uniname2ctype_offset(str1671), 215},
- {uniname2ctype_offset(str1672), 162},
- {uniname2ctype_offset(str1673), 356},
- {uniname2ctype_offset(str1674), 395},
- {-1}, {-1},
- {uniname2ctype_offset(str1677), 431},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1682), 97},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1690), 394},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1695), 97},
- {-1},
- {uniname2ctype_offset(str1697), 89},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1714), 230},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1725), 37},
- {-1},
- {uniname2ctype_offset(str1727), 330},
- {uniname2ctype_offset(str1728), 143},
- {-1},
- {uniname2ctype_offset(str1730), 433},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1736), 5},
- {uniname2ctype_offset(str1737), 143},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1741), 358},
- {-1},
- {uniname2ctype_offset(str1743), 254},
- {-1}, {-1},
- {uniname2ctype_offset(str1746), 341},
- {-1},
- {uniname2ctype_offset(str1748), 376},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1752), 569},
- {-1},
- {uniname2ctype_offset(str1754), 87},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1762), 174},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1766), 87},
- {uniname2ctype_offset(str1767), 232},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1772), 344},
- {-1},
- {uniname2ctype_offset(str1774), 131},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1780), 227},
- {-1}, {-1},
- {uniname2ctype_offset(str1783), 174},
- {-1},
- {uniname2ctype_offset(str1785), 515},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1789), 416},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1800), 293},
- {-1},
- {uniname2ctype_offset(str1802), 219},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1806), 378},
- {-1},
- {uniname2ctype_offset(str1808), 55},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1813), 139},
- {uniname2ctype_offset(str1814), 29},
- {uniname2ctype_offset(str1815), 407},
- {-1}, {-1},
- {uniname2ctype_offset(str1818), 531},
- {uniname2ctype_offset(str1819), 298},
- {-1},
- {uniname2ctype_offset(str1821), 413},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1825), 196},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1829), 365},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1840), 177},
- {-1}, {-1},
- {uniname2ctype_offset(str1843), 237},
- {-1}, {-1},
- {uniname2ctype_offset(str1846), 423},
- {uniname2ctype_offset(str1847), 190},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1857), 400},
- {uniname2ctype_offset(str1858), 566},
- {-1}, {-1},
- {uniname2ctype_offset(str1861), 483},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1866), 247},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1885), 363},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1894), 150},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1900), 150},
- {-1}, {-1},
- {uniname2ctype_offset(str1903), 568},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1909), 319},
- {uniname2ctype_offset(str1910), 390},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1914), 559},
- {uniname2ctype_offset(str1915), 359},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1922), 84},
- {-1},
- {uniname2ctype_offset(str1924), 442},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1932), 84},
- {uniname2ctype_offset(str1933), 232},
- {uniname2ctype_offset(str1934), 495},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1943), 26},
- {uniname2ctype_offset(str1944), 12},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1975), 61},
- {uniname2ctype_offset(str1976), 412},
- {-1}, {-1},
- {uniname2ctype_offset(str1979), 239},
- {-1},
- {uniname2ctype_offset(str1981), 94},
- {-1},
- {uniname2ctype_offset(str1983), 83},
- {-1},
- {uniname2ctype_offset(str1985), 348},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1989), 543},
- {-1},
- {uniname2ctype_offset(str1991), 83},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1995), 556},
- {-1},
- {uniname2ctype_offset(str1997), 134},
- {uniname2ctype_offset(str1998), 21},
- {uniname2ctype_offset(str1999), 380},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2003), 516},
- {-1},
- {uniname2ctype_offset(str2005), 64},
- {-1},
- {uniname2ctype_offset(str2007), 198},
- {uniname2ctype_offset(str2008), 185},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2013), 450},
- {-1},
- {uniname2ctype_offset(str2015), 198},
- {-1},
- {uniname2ctype_offset(str2017), 165},
- {-1}, {-1},
- {uniname2ctype_offset(str2020), 185},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2047), 240},
- {-1},
- {uniname2ctype_offset(str2049), 421},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2056), 391},
- {-1}, {-1},
- {uniname2ctype_offset(str2059), 152},
- {-1},
- {uniname2ctype_offset(str2061), 17},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2068), 191},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2072), 415},
- {uniname2ctype_offset(str2073), 183},
- {-1}, {-1},
- {uniname2ctype_offset(str2076), 118},
- {-1}, {-1},
- {uniname2ctype_offset(str2079), 191},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2084), 444},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2091), 175},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2095), 560},
- {uniname2ctype_offset(str2096), 194},
- {uniname2ctype_offset(str2097), 78},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2101), 43},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str2112), 172},
- {-1},
- {uniname2ctype_offset(str2114), 306},
- {-1}, {-1},
- {uniname2ctype_offset(str2117), 195},
- {-1},
- {uniname2ctype_offset(str2119), 491},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2134), 92},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2139), 562},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2146), 192},
- {-1},
- {uniname2ctype_offset(str2148), 384},
- {uniname2ctype_offset(str2149), 92},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2154), 214},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2158), 224},
- {-1}, {-1},
- {uniname2ctype_offset(str2161), 139},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2165), 287},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2172), 291},
- {-1},
- {uniname2ctype_offset(str2174), 328},
- {-1},
- {uniname2ctype_offset(str2176), 128},
- {-1}, {-1},
- {uniname2ctype_offset(str2179), 281},
- {-1}, {-1},
- {uniname2ctype_offset(str2182), 426},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2187), 48},
- {-1},
- {uniname2ctype_offset(str2189), 89},
- {-1}, {-1},
- {uniname2ctype_offset(str2192), 276},
- {uniname2ctype_offset(str2193), 130},
- {-1}, {-1},
- {uniname2ctype_offset(str2196), 128},
- {uniname2ctype_offset(str2197), 90},
- {uniname2ctype_offset(str2198), 389},
- {uniname2ctype_offset(str2199), 288},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2207), 280},
- {-1}, {-1},
- {uniname2ctype_offset(str2210), 342},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2224), 406},
- {uniname2ctype_offset(str2225), 211},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2229), 369},
- {-1}, {-1},
- {uniname2ctype_offset(str2232), 209},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2249), 130},
- {-1}, {-1},
- {uniname2ctype_offset(str2252), 80},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2260), 337},
- {-1}, {-1},
- {uniname2ctype_offset(str2263), 544},
- {uniname2ctype_offset(str2264), 82},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2271), 239},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2276), 527},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2286), 243},
- {-1}, {-1},
- {uniname2ctype_offset(str2289), 366},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2296), 229},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2300), 18},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2306), 510},
- {uniname2ctype_offset(str2307), 38},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2311), 427},
- {-1},
- {uniname2ctype_offset(str2313), 112},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2327), 213},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2349), 451},
- {uniname2ctype_offset(str2350), 441},
- {-1}, {-1},
- {uniname2ctype_offset(str2353), 448},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2360), 314},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2364), 65},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2369), 346},
- {-1}, {-1},
- {uniname2ctype_offset(str2372), 82},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2380), 100},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2386), 226},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2393), 251},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2399), 548},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2408), 211},
- {uniname2ctype_offset(str2409), 118},
- {-1}, {-1},
- {uniname2ctype_offset(str2412), 284},
- {uniname2ctype_offset(str2413), 229},
- {uniname2ctype_offset(str2414), 286},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2422), 119},
- {uniname2ctype_offset(str2423), 99},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2433), 364},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2449), 316},
- {-1},
- {uniname2ctype_offset(str2451), 54},
- {uniname2ctype_offset(str2452), 96},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2461), 96},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2465), 103},
- {-1},
- {uniname2ctype_offset(str2467), 62},
- {-1},
- {uniname2ctype_offset(str2469), 226},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2473), 107},
- {-1},
- {uniname2ctype_offset(str2475), 23},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2481), 525},
- {-1},
- {uniname2ctype_offset(str2483), 425},
- {uniname2ctype_offset(str2484), 532},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2488), 182},
- {uniname2ctype_offset(str2489), 279},
- {uniname2ctype_offset(str2490), 275},
- {-1}, {-1},
- {uniname2ctype_offset(str2493), 178},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2500), 464},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2507), 57},
- {-1},
- {uniname2ctype_offset(str2509), 50},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2515), 231},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2519), 204},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2523), 153},
- {-1}, {-1},
- {uniname2ctype_offset(str2526), 393},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2539), 41},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2545), 551},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2550), 456},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2573), 210},
- {-1}, {-1},
- {uniname2ctype_offset(str2576), 4},
- {-1}, {-1},
- {uniname2ctype_offset(str2579), 179},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2587), 454},
- {-1},
- {uniname2ctype_offset(str2589), 126},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2594), 216},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2601), 216},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2617), 63},
- {uniname2ctype_offset(str2618), 213},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2622), 338},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2630), 133},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2643), 282},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2649), 278},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2653), 165},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2660), 66},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2678), 147},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2693), 78},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2702), 99},
- {-1}, {-1},
- {uniname2ctype_offset(str2705), 49},
- {-1}, {-1},
- {uniname2ctype_offset(str2708), 558},
- {-1},
- {uniname2ctype_offset(str2710), 570},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2717), 88},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2751), 549},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2758), 64},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2763), 132},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2775), 230},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2779), 386},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2791), 242},
- {uniname2ctype_offset(str2792), 123},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2797), 28},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2823), 437},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2829), 180},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2834), 335},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2850), 231},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str2879), 223},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2883), 199},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2888), 133},
- {-1},
- {uniname2ctype_offset(str2890), 124},
- {uniname2ctype_offset(str2891), 528},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2901), 452},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2905), 295},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2926), 125},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2930), 277},
- {-1},
- {uniname2ctype_offset(str2932), 51},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2953), 71},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2967), 475},
- {uniname2ctype_offset(str2968), 197},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2972), 146},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2984), 204},
- {-1}, {-1},
- {uniname2ctype_offset(str2987), 255},
- {-1},
- {uniname2ctype_offset(str2989), 409},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3007), 180},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3016), 403},
- {-1}, {-1},
- {uniname2ctype_offset(str3019), 62},
- {uniname2ctype_offset(str3020), 45},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3038), 10},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3052), 382},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3066), 190},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3094), 63},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3113), 59},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3121), 123},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3153), 238},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3177), 223},
- {-1}, {-1},
- {uniname2ctype_offset(str3180), 132},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3193), 47},
- {-1},
- {uniname2ctype_offset(str3195), 224},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3213), 16},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3235), 438},
- {-1}, {-1},
- {uniname2ctype_offset(str3238), 100},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3276), 177},
- {-1}, {-1},
- {uniname2ctype_offset(str3279), 283},
- {uniname2ctype_offset(str3280), 285},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3285), 214},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3296), 289},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3305), 290},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3315), 205},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3367), 65},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3373), 103},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3409), 30},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3438), 303},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3442), 440},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3448), 46},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3453), 233},
- {uniname2ctype_offset(str3454), 220},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3465), 119},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3496), 411},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3593), 162},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3662), 179},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3676), 201},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3689), 545},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3697), 561},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str3763), 571},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3791), 523},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-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
- {uniname2ctype_offset(str6), 12},
- {uniname2ctype_offset(str7), 7},
- {uniname2ctype_offset(str8), 15},
- {uniname2ctype_offset(str9), 1},
- {uniname2ctype_offset(str10), 13},
- {uniname2ctype_offset(str11), 11},
- {uniname2ctype_offset(str12), 10},
- {uniname2ctype_offset(str13), 14},
- {uniname2ctype_offset(str14), 3},
- {uniname2ctype_offset(str15), 9},
- {uniname2ctype_offset(str16), 8},
- {uniname2ctype_offset(str17), 6},
- {uniname2ctype_offset(str18), 5},
- {uniname2ctype_offset(str19), 4},
- {uniname2ctype_offset(str20), 2}
-#else /* USE_UNICODE_PROPERTIES */
- {uniname2ctype_offset(str3960), 147},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3971), 401},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str4036), 90},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str4164), 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4187), 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str4208), 233},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4460), 237},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4464), 374},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4483), 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},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4608), 439},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4634), 205},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4678), 75},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4841), 155},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str5170), 80},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str6145), 155}
-#endif /* USE_UNICODE_PROPERTIES */
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register unsigned int key = uniname2ctype_hash (str, len);
-
- if (key <= MAX_HASH_VALUE)
- {
- register int o = wordlist[key].name;
- if (o >= 0)
- {
- register const char *s = o + uniname2ctype_pool;
-
- if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
- return &wordlist[key];
- }
- }
- }
- return 0;
-}
-
-static int
-uniname2ctype(const UChar *name, unsigned int len)
-{
- const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len);
- if (p) return p->ctype;
- return -1;
-}
-#if defined ONIG_UNICODE_VERSION_STRING && !( \
- ONIG_UNICODE_VERSION_MAJOR == 10 && \
- ONIG_UNICODE_VERSION_MINOR == 0 && \
- ONIG_UNICODE_VERSION_TEENY == 0 && \
- 1)
-# error ONIG_UNICODE_VERSION_STRING mismatch
-#endif
-#define ONIG_UNICODE_VERSION_STRING "10.0.0"
-#define ONIG_UNICODE_VERSION_MAJOR 10
-#define ONIG_UNICODE_VERSION_MINOR 0
-#define ONIG_UNICODE_VERSION_TEENY 0
diff --git a/enc/unicode/case-folding.rb b/enc/unicode/case-folding.rb
index 829efefaf1..d93de6581b 100755
--- a/enc/unicode/case-folding.rb
+++ b/enc/unicode/case-folding.rb
@@ -1,47 +1,32 @@
#!/usr/bin/ruby
-require 'stringio'
-# Usage (for case folding only):
+# Usage:
# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
# $ ruby case-folding.rb CaseFolding.txt -o casefold.h
-# or (for case folding and case mapping):
-# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
-# $ wget http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
-# $ wget http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt
-# $ ruby case-folding.rb -m . -o casefold.h
-# using -d or --debug will include UTF-8 characters in comments for debugging
class CaseFolding
module Util
module_function
def hex_seq(v)
- v.map { |i| "0x%04x" % i }.join(", ")
+ v.map {|i| "0x%04x" % i}.join(", ")
end
- def print_table_1(dest, type, mapping_data, data)
+ 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)
- if type=='CaseUnfold_11' and v.length>1
- # reorder CaseUnfold_11 entries to avoid special treatment for U+03B9/U+03BC/U+A64B
- item = mapping_data.map("%04X" % k[0])
- upper = item.upper if item
- v = v.sort_by { |i| ("%04X"%i) == upper ? 0 : 1 }
- end
- ck = @debug ? ' /* ' + Array(k).pack("U*") + ' */' : ''
- cv = @debug ? ' /* ' + Array(v).map{|c|[c].pack("U*")}.join(", ") + ' */' : ''
- dest.print(" {#{sk}#{ck}, {#{v.length}#{mapping_data.flags(k, type, v)}, {#{hex_seq(v)}#{cv}}}},\n")
+ dest.print(" {#{sk}, {#{v.length}, {#{hex_seq(v)}}}},\n")
end
data
end
- def print_table(dest, type, mapping_data, data)
+ 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, type, mapping_data, d))
+ a.concat(print_table_1(dest, d))
end
dest.print("};\n\n")
ret
@@ -50,19 +35,16 @@ class CaseFolding
include Util
- attr_reader :fold, :fold_locale, :unfold, :unfold_locale, :version
+ 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 = [{}, {}, {}]
- @debug = false
- @version = nil
turkic = []
- IO.foreach(filename, mode: "rb") do |line|
- @version ||= line[/-([0-9.]+).txt/, 1]
+ IO.foreach(filename) do |line|
next unless res = pattern.match(line)
ch_from = res[1].to_i(16)
@@ -104,7 +86,7 @@ class CaseFolding
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"
+ 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
@@ -155,55 +137,34 @@ class CaseFolding
src
end
- def display(dest, mapping_data)
+ 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")
- versions = version.scan(/\d+/)
- dest.print("#if defined ONIG_UNICODE_VERSION_STRING && !( \\\n")
- %w[MAJOR MINOR TEENY].zip(versions) do |n, v|
- dest.print(" ONIG_UNICODE_VERSION_#{n} == #{v} && \\\n")
- end
- dest.print(" 1)\n")
- dest.print("# error ONIG_UNICODE_VERSION_STRING mismatch\n")
- dest.print("#endif\n")
- dest.print("#define ONIG_UNICODE_VERSION_STRING #{version.dump}\n")
- %w[MAJOR MINOR TEENY].zip(versions) do |n, v|
- dest.print("#define ONIG_UNICODE_VERSION_#{n} #{v}\n")
- end
- dest.print("\n")
-
# print folding data
# CaseFold + CaseFold_Locale
name = "CaseFold_11"
- data = print_table(dest, name, mapping_data, "CaseFold"=>fold, "CaseFold_Locale"=>fold_locale)
+ 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, mapping_data, name=>unfold[0], "#{name}_Locale"=>unfold_locale[0])
+ 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, mapping_data, name=>unfold[1], "#{name}_Locale"=>unfold_locale[1])
+ 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, mapping_data, name=>unfold[2])
+ data = print_table(dest, name, name=>unfold[2])
dest.print lookup_hash(name, "CodePointList2", data)
-
- # TitleCase
- dest.print mapping_data.specials_output
- end
-
- def debug!
- @debug = true
end
def self.load(*args)
@@ -211,209 +172,25 @@ class CaseFolding
end
end
-class MapItem
- attr_accessor :upper, :lower, :title, :code
-
- def initialize(code, upper, lower, title)
- @code = code
- @upper = upper unless upper == ''
- @lower = lower unless lower == ''
- @title = title unless title == ''
- end
-end
-
-class CaseMapping
- attr_reader :filename, :version
-
- def initialize(mapping_directory)
- @mappings = {}
- @specials = []
- @specials_length = 0
- @version = nil
- IO.foreach(File.join(mapping_directory, 'UnicodeData.txt'), mode: "rb") do |line|
- next if line =~ /^</
- code, _1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11, upper, lower, title = line.chomp.split ';'
- unless upper and lower and title and (upper+lower+title)==''
- @mappings[code] = MapItem.new(code, upper, lower, title)
- end
- end
-
- @filename = File.join(mapping_directory, 'SpecialCasing.txt')
- IO.foreach(@filename, mode: "rb") do |line|
- @version ||= line[/-([0-9.]+).txt/, 1]
- line.chomp!
- line, comment = line.split(/ *#/)
- next if not line or line == ''
- code, lower, title, upper, conditions = line.split(/ *; */)
- unless conditions
- item = @mappings[code]
- item.lower = lower
- item.title = title
- item.upper = upper
- end
- end
- end
-
- def map (from)
- @mappings[from]
- end
-
- def flags(from, type, to)
- # types: CaseFold_11, CaseUnfold_11, CaseUnfold_12, CaseUnfold_13
- flags = ""
- from = Array(from).map {|i| "%04X" % i}.join(" ")
- to = Array(to).map {|i| "%04X" % i}.join(" ")
- item = map(from)
- specials_index = nil
- specials = []
- case type
- when 'CaseFold_11'
- flags += '|F'
- if item
- flags += '|U' if to==item.upper
- flags += '|D' if to==item.lower
- unless item.upper == item.title
- if item.code == item.title
- flags += '|IT'
- swap = case item.code
- when '01C5' then '0064 017D'
- when '01C8' then '006C 004A'
- when '01CB' then '006E 004A'
- when '01F2' then '0064 005A'
- else # Greek
- to.split(' ').first + ' 0399'
- end
- specials << swap
- else
- flags += '|ST'
- specials << item.title
- end
- end
- unless item.lower.nil? or item.lower==from or item.lower==to
- specials << item.lower
- flags += '|SL'
- end
- unless item.upper.nil? or item.upper==from or item.upper==to
- specials << item.upper
- flags += '|SU'
- end
- end
- when 'CaseUnfold_11'
- to = to.split(/ /)
- if item
- case to.first
- when item.upper then flags += '|U'
- when item.lower then flags += '|D'
- else
- raise "Unpredicted case 0 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/."
- end
- unless item.upper == item.title
- if item.code == item.title
- raise "Unpredicted case 1 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/."
- elsif item.title==to[1]
- flags += '|ST'
- else
- raise "Unpredicted case 2 in enc/unicode/case_folding.rb. Please contact https://bugs.ruby-lang.org/."
- end
- end
- end
- end
- unless specials.empty?
- flags += "|I(#{@specials_length})"
- @specials_length += specials.map { |s| s.split(/ /).length }.reduce(:+)
- @specials << specials
- end
- flags
- end
-
- def debug!
- @debug = true
- end
-
- def specials_output
- "static const OnigCodePoint CaseMappingSpecials[] = {\n" +
- @specials.map do |sps|
- ' ' + sps.map do |sp|
- chars = sp.split(/ /)
- ct = ' /* ' + Array(chars).map{|c|[c.to_i(16)].pack("U*")}.join(", ") + ' */' if @debug
- " L(#{chars.length})|#{chars.map {|c| "0x"+c }.join(', ')}#{ct},"
- end.join + "\n"
- end.join + "};\n"
- end
-
- def self.load(*args)
- new(*args)
- end
-end
-
-class CaseMappingDummy
- def flags(from, type, to)
- ""
- end
-
- def titlecase_output() '' end
- def debug!() end
-end
-
if $0 == __FILE__
require 'optparse'
dest = nil
- mapping_directory = nil
- mapping_data = nil
- debug = false
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.on('--mapping-data-directory=DIRECTORY', '-m', 'data DIRECTORY of mapping files') { |directory|
- mapping_directory = directory
- }
- opt.on('--debug', '-d') {
- debug = true
- }
opt.parse!
abort(opt.to_s) if ARGV.size > 1
end
- if mapping_directory
- if ARGV[0]
- warn "Either specify directory or individual file, but not both."
- exit
- end
- filename = File.join(mapping_directory, 'CaseFolding.txt')
- mapping_data = CaseMapping.load(mapping_directory)
- end
- filename ||= ARGV[0] || 'CaseFolding.txt'
+ filename = ARGV[0] || 'CaseFolding.txt'
data = CaseFolding.load(filename)
- if mapping_data and data.version != mapping_data.version
- abort "Unicode data version mismatch\n" \
- " #{filename} = #{data.version}\n" \
- " #{mapping_data.filename} = #{mapping_data.version}"
- end
- mapping_data ||= CaseMappingDummy.new
-
- if debug
- data.debug!
- mapping_data.debug!
- end
- f = StringIO.new
- begin
- data.display(f, mapping_data)
- rescue Errno::ENOENT => e
- raise unless /gperf/ =~ e.message
- warn e.message
- abort unless dest
- File.utime(nil, nil, dest) # assume existing file is OK
- exit
- else
- s = f.string
- end
if dest
open(dest, "wb") do |f|
- f.print(s)
+ data.display(f)
end
else
- STDOUT.print(s)
+ data.display(STDOUT)
end
end
diff --git a/enc/unicode/casefold.h b/enc/unicode/casefold.h
new file mode 100644
index 0000000000..475a20a48e
--- /dev/null
+++ b/enc/unicode/casefold.h
@@ -0,0 +1,5619 @@
+/* DO NOT EDIT THIS FILE. */
+/* Generated by enc/unicode/case-folding.rb */
+
+static const CaseFold_11_Type CaseFold_11_Table[] = {
+#define CaseFold (*(CaseFold_11_Type (*)[1178])(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}}},
+ {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}}},
+ {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}}},
+ {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+1178))
+ {0x0049, {1, {0x0069}}},
+ {0x0130, {2, {0x0069, 0x0307}}},
+};
+
+/* C code produced by gperf version 3.0.3 */
+/* 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 */
+
+/* maximum key range = 1867, duplicates = 0 */
+
+#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[] =
+ {
+ 12, 212, 5, 217, 6, 1878, 173, 13, 2, 11,
+ 123, 5, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878,
+ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878,
+ 1878, 1878, 1878, 220, 1878, 1878, 1878, 1878, 1878, 1878,
+ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 382,
+ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878,
+ 8, 4, 219, 1, 1878, 343, 607, 274, 1202, 305,
+ 1362, 209, 259, 412, 1443, 174, 290, 35, 442, 21,
+ 1434, 70, 1472, 105, 362, 193, 591, 51, 3, 7,
+ 1414, 86, 1391, 371, 1358, 398, 1456, 149, 1266, 245,
+ 1263, 135, 1231, 121, 1096, 446, 932, 323, 1033, 428,
+ 1155, 466, 1084, 991, 1160, 474, 1131, 977, 298, 749,
+ 990, 491, 1010, 482, 1021, 696, 161, 729, 46, 966,
+ 1209, 813, 1043, 616, 848, 917, 1019, 594, 1201, 526,
+ 1127, 540, 943, 900, 171, 774, 1283, 760, 626, 935,
+ 1025, 554, 288, 955, 103, 788, 423, 1113, 24, 1005,
+ 20, 711, 9, 573, 358, 668, 5, 885, 228, 649,
+ 102, 628, 612, 515, 800, 871, 77, 1132, 17, 1072,
+ 1, 1188, 47, 1276, 244, 1326, 887, 1289, 202, 740,
+ 258, 1168, 222
+ };
+ return asso_values[bits_of(code, 2)+65] + asso_values[bits_of(code, 1)] + asso_values[bits_of(code, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#ifdef __GNUC_STDC_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 = 1180,
+ MIN_WORD_LENGTH = 3,
+ MAX_WORD_LENGTH = 3,
+ MIN_HASH_VALUE = 11,
+ MAX_HASH_VALUE = 1877
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x10417*/ 1129,
+ -1, -1,
+ /*0x1ff3*/ 794,
+ /*0x10418*/ 1130,
+ /*0x1f97*/ 729,
+ /*0x0417*/ 320,
+ /*0x2c17*/ 873,
+ /*0x1e97*/ 600,
+ /*0x1f98*/ 730,
+ /*0x0418*/ 321,
+ /*0x2c18*/ 874,
+ /*0x1e98*/ 601,
+ /*0x0118*/ 69,
+ /*0x0218*/ 202,
+ /*0x2c98*/ 924,
+ /*0x1e18*/ 536,
+ /*0x0397*/ 248,
+ /*0x1040e*/ 1120,
+ /*0x0498*/ 369,
+ -1,
+ /*0x0398*/ 249,
+ /*0xa798*/ 1053,
+ /*0x1f8e*/ 720,
+ /*0x040e*/ 311,
+ /*0x2c0e*/ 864,
+ /*0x1e8e*/ 595,
+ /*0x010e*/ 64,
+ /*0x020e*/ 197,
+ /*0x2c8e*/ 919,
+ /*0x1e0e*/ 531,
+ /*0x03f1*/ 288,
+ /*0x1040c*/ 1118,
+ /*0x048e*/ 364,
+ -1,
+ /*0x038e*/ 239,
+ /*0xa698*/ 1000,
+ /*0x1f8c*/ 718,
+ /*0x040c*/ 309,
+ /*0x2c0c*/ 862,
+ /*0x1e8c*/ 594,
+ /*0x010c*/ 63,
+ /*0x020c*/ 196,
+ /*0x2c8c*/ 918,
+ /*0x1e0c*/ 530,
+ -1, -1,
+ /*0x048c*/ 363,
+ /*0x10416*/ 1128,
+ /*0x038c*/ 238,
+ /*0xa68e*/ 995,
+ /*0x2c75*/ 909,
+ /*0x013f*/ 87,
+ /*0x1f96*/ 728,
+ /*0x0416*/ 319,
+ /*0x2c16*/ 872,
+ /*0x1e96*/ 599,
+ /*0x0116*/ 68,
+ /*0x0216*/ 201,
+ /*0x2c96*/ 923,
+ /*0x1e16*/ 535,
+ /*0x03f5*/ 290,
+ -1,
+ /*0x0496*/ 368,
+ /*0xa68c*/ 994,
+ /*0x0396*/ 247,
+ /*0xa796*/ 1052,
+ /*0x10410*/ 1122,
+ -1, -1, -1, -1,
+ /*0x1f90*/ 722,
+ /*0x0410*/ 313,
+ /*0x2c10*/ 866,
+ /*0x1e90*/ 596,
+ /*0x0110*/ 65,
+ /*0x0210*/ 198,
+ /*0x2c90*/ 920,
+ /*0x1e10*/ 532,
+ /*0xa696*/ 999,
+ /*0x2c6f*/ 906,
+ /*0x0490*/ 365,
+ /*0x1041a*/ 1132,
+ /*0x0390*/ 241,
+ /*0xa790*/ 1050,
+ -1, -1,
+ /*0x1f9a*/ 732,
+ /*0x041a*/ 323,
+ /*0x2c1a*/ 876,
+ /*0x1e9a*/ 603,
+ /*0x011a*/ 70,
+ /*0x021a*/ 203,
+ /*0x2c9a*/ 925,
+ /*0x1e1a*/ 537,
+ -1, -1,
+ /*0x049a*/ 370,
+ /*0xa690*/ 996,
+ /*0x039a*/ 251,
+ /*0xa79a*/ 1054,
+ /*0x10412*/ 1124,
+ -1,
+ /*0x1fe9*/ 789,
+ /*0x1fd9*/ 780,
+ /*0x2c69*/ 902,
+ /*0x1f92*/ 724,
+ /*0x0412*/ 315,
+ /*0x2c12*/ 868,
+ /*0x1e92*/ 597,
+ /*0x0112*/ 66,
+ /*0x0212*/ 199,
+ /*0x2c92*/ 921,
+ /*0x1e12*/ 533,
+ /*0xa69a*/ 1001,
+ /*0x0059*/ 23,
+ /*0x0492*/ 366,
+ /*0x10426*/ 1144,
+ /*0x0392*/ 243,
+ /*0xa792*/ 1051,
+ -1, -1,
+ /*0x1fa6*/ 744,
+ /*0x0426*/ 335,
+ /*0x2c26*/ 888,
+ /*0x1ea6*/ 609,
+ /*0x0126*/ 76,
+ /*0x0226*/ 209,
+ /*0x2ca6*/ 931,
+ /*0x1e26*/ 543,
+ /*0x0518*/ 433,
+ /*0x10424*/ 1142,
+ /*0x04a6*/ 376,
+ /*0xa692*/ 997,
+ /*0x03a6*/ 262,
+ /*0xa7a6*/ 1060,
+ /*0x1fa4*/ 742,
+ /*0x0424*/ 333,
+ /*0x2c24*/ 886,
+ /*0x1ea4*/ 608,
+ /*0x0124*/ 75,
+ /*0x0224*/ 208,
+ /*0x2ca4*/ 930,
+ /*0x1e24*/ 542,
+ /*0x050e*/ 428,
+ /*0x10420*/ 1138,
+ /*0x04a4*/ 375,
+ -1,
+ /*0x03a4*/ 260,
+ /*0xa7a4*/ 1059,
+ /*0x1fa0*/ 738,
+ /*0x0420*/ 329,
+ /*0x2c20*/ 882,
+ /*0x1ea0*/ 606,
+ /*0x0120*/ 73,
+ /*0x0220*/ 206,
+ /*0x2ca0*/ 928,
+ /*0x1e20*/ 540,
+ /*0x050c*/ 427,
+ -1,
+ /*0x04a0*/ 373,
+ -1,
+ /*0x03a0*/ 257,
+ /*0xa7a0*/ 1057,
+ -1, -1,
+ /*0x013d*/ 86,
+ /*0x023d*/ 218,
+ -1,
+ /*0x053f*/ 459,
+ /*0x1040a*/ 1116,
+ -1, -1, -1,
+ /*0x0516*/ 432,
+ /*0x1f8a*/ 716,
+ /*0x040a*/ 307,
+ /*0x2c0a*/ 860,
+ /*0x1e8a*/ 593,
+ /*0x010a*/ 62,
+ /*0x020a*/ 195,
+ /*0x2c8a*/ 917,
+ /*0x1e0a*/ 529,
+ /*0x004f*/ 13,
+ /*0x03cf*/ 270,
+ /*0x048a*/ 362,
+ -1,
+ /*0x038a*/ 237,
+ -1,
+ /*0x10414*/ 1126,
+ -1, -1, -1,
+ /*0x0510*/ 429,
+ /*0x1f94*/ 726,
+ /*0x0414*/ 317,
+ /*0x2c14*/ 870,
+ /*0x1e94*/ 598,
+ /*0x0114*/ 67,
+ /*0x0214*/ 200,
+ /*0x2c94*/ 922,
+ /*0x1e14*/ 534,
+ /*0xa68a*/ 993,
+ /*0x1ffb*/ 801,
+ /*0x0494*/ 367,
+ /*0x10406*/ 1112,
+ /*0x0394*/ 245,
+ /*0x017b*/ 118,
+ -1,
+ /*0x051a*/ 434,
+ /*0x1f86*/ 712,
+ /*0x0406*/ 303,
+ /*0x2c06*/ 856,
+ /*0x1e86*/ 591,
+ /*0x0106*/ 60,
+ /*0x0206*/ 193,
+ /*0x2c86*/ 915,
+ /*0x1e06*/ 527,
+ -1, -1,
+ /*0x0197*/ 136,
+ /*0xa694*/ 998,
+ /*0x0386*/ 234,
+ /*0xa786*/ 1047,
+ /*0x0198*/ 137,
+ /*0x2c7f*/ 911,
+ /*0x1f18*/ 662,
+ /*0x017f*/ 120,
+ /*0x0512*/ 430,
+ /*0x1fe7*/ 787,
+ -1,
+ /*0x2c67*/ 901,
+ /*0x00df*/ 56,
+ -1,
+ /*0x01f1*/ 181,
+ /*0x03ff*/ 296,
+ /*0x00dd*/ 54,
+ /*0xa686*/ 991,
+ /*0x018e*/ 129,
+ /*0x1f5f*/ 697,
+ /*0x1f0e*/ 660,
+ /*0x10422*/ 1140,
+ -1,
+ /*0x1f5d*/ 696,
+ /*0x0526*/ 440,
+ /*0x1ff7*/ 797,
+ /*0x1fa2*/ 740,
+ /*0x0422*/ 331,
+ /*0x2c22*/ 884,
+ /*0x1ea2*/ 607,
+ /*0x0122*/ 74,
+ /*0x0222*/ 207,
+ /*0x2ca2*/ 929,
+ /*0x1e22*/ 541,
+ /*0x1f0c*/ 658,
+ /*0x10407*/ 1113,
+ /*0x04a2*/ 374,
+ /*0x03f7*/ 291,
+ /*0x0524*/ 439,
+ /*0xa7a2*/ 1058,
+ /*0x1f87*/ 713,
+ /*0x0407*/ 304,
+ /*0x2c07*/ 857,
+ /*0x017d*/ 119,
+ /*0x0587*/ 483,
+ /*0x1f3f*/ 683,
+ /*0x10bf*/ 515,
+ -1,
+ /*0x0196*/ 135,
+ -1,
+ /*0x10402*/ 1108,
+ /*0x03fd*/ 294,
+ /*0x0520*/ 437,
+ -1, -1,
+ /*0x1f82*/ 708,
+ /*0x0402*/ 299,
+ /*0x2c02*/ 852,
+ /*0x1e82*/ 589,
+ /*0x0102*/ 58,
+ /*0x0202*/ 191,
+ /*0x2c82*/ 913,
+ /*0x1e02*/ 525,
+ -1,
+ /*0x053d*/ 457,
+ -1,
+ /*0x1040b*/ 1117,
+ /*0x0190*/ 131,
+ /*0xa782*/ 1045,
+ /*0x1fd7*/ 778,
+ -1,
+ /*0x1f8b*/ 717,
+ /*0x040b*/ 308,
+ /*0x2c0b*/ 861,
+ /*0x054f*/ 475,
+ -1,
+ /*0x1f6f*/ 705,
+ /*0x050a*/ 426,
+ -1, -1,
+ /*0x0057*/ 21,
+ /*0x10404*/ 1110,
+ /*0xa682*/ 989,
+ -1,
+ /*0xa78b*/ 1048,
+ /*0x1f1a*/ 664,
+ /*0x1f84*/ 710,
+ /*0x0404*/ 301,
+ /*0x2c04*/ 854,
+ /*0x1e84*/ 590,
+ /*0x0104*/ 59,
+ /*0x0204*/ 192,
+ /*0x2c84*/ 914,
+ /*0x1e04*/ 526,
+ -1,
+ /*0x00d9*/ 50,
+ /*0x0514*/ 431,
+ -1, -1,
+ /*0xa784*/ 1046,
+ /*0x01d9*/ 169,
+ /*0x1f69*/ 699,
+ /*0x1f59*/ 694,
+ -1,
+ /*0x1faa*/ 748,
+ /*0x042a*/ 339,
+ /*0x2c2a*/ 892,
+ /*0x1eaa*/ 611,
+ /*0x012a*/ 78,
+ /*0x022a*/ 211,
+ /*0x2caa*/ 933,
+ /*0x1e2a*/ 545,
+ /*0x0506*/ 424,
+ /*0xa684*/ 990,
+ /*0x04aa*/ 378,
+ -1,
+ /*0x03aa*/ 266,
+ /*0xa7aa*/ 1062,
+ /*0x01a6*/ 144,
+ /*0x10400*/ 1106,
+ -1,
+ /*0x10a6*/ 490,
+ -1, -1,
+ /*0x1f80*/ 706,
+ /*0x0400*/ 297,
+ /*0x2c00*/ 850,
+ /*0x1e80*/ 588,
+ /*0x0100*/ 57,
+ /*0x0200*/ 190,
+ /*0x2c80*/ 912,
+ /*0x1e00*/ 524,
+ /*0x01a4*/ 143,
+ -1,
+ /*0x0480*/ 361,
+ /*0x10a4*/ 488,
+ -1,
+ /*0xa780*/ 1044,
+ /*0x10413*/ 1125,
+ /*0x1fe3*/ 784,
+ -1,
+ /*0x2c63*/ 899,
+ -1,
+ /*0x1f93*/ 725,
+ /*0x0413*/ 316,
+ /*0x2c13*/ 869,
+ /*0x01a0*/ 141,
+ /*0x1041c*/ 1134,
+ /*0x0522*/ 438,
+ /*0x10a0*/ 484,
+ -1,
+ /*0xa680*/ 988,
+ /*0x1f9c*/ 734,
+ /*0x041c*/ 325,
+ /*0x2c1c*/ 878,
+ /*0x0393*/ 244,
+ /*0x011c*/ 71,
+ /*0x021c*/ 204,
+ /*0x2c9c*/ 926,
+ /*0x1e1c*/ 538,
+ /*0x1f3d*/ 681,
+ /*0x10bd*/ 513,
+ /*0x049c*/ 371,
+ /*0x00cf*/ 41,
+ /*0x039c*/ 253,
+ /*0xa79c*/ 1055,
+ -1, -1,
+ /*0x01cf*/ 164,
+ -1, -1,
+ /*0x018a*/ 127,
+ -1,
+ /*0x1f0a*/ 656,
+ /*0x1041e*/ 1136,
+ /*0x037f*/ 233,
+ -1,
+ /*0x0502*/ 422,
+ -1,
+ /*0x1f9e*/ 736,
+ /*0x041e*/ 327,
+ /*0x2c1e*/ 880,
+ /*0x1e9e*/ 605,
+ /*0x011e*/ 72,
+ /*0x021e*/ 205,
+ /*0x2c9e*/ 927,
+ /*0x1e1e*/ 539,
+ -1,
+ /*0x10408*/ 1114,
+ /*0x049e*/ 372,
+ /*0x0194*/ 134,
+ /*0x039e*/ 255,
+ /*0xa79e*/ 1056,
+ /*0x1f88*/ 714,
+ /*0x0408*/ 305,
+ /*0x2c08*/ 858,
+ /*0x1e88*/ 592,
+ /*0x0108*/ 61,
+ /*0x0208*/ 194,
+ /*0x2c88*/ 916,
+ /*0x1e08*/ 528,
+ /*0x0535*/ 449,
+ /*0x118bf*/ 1177,
+ -1,
+ /*0x1fdb*/ 782,
+ /*0x0388*/ 235,
+ /*0x0186*/ 124,
+ -1,
+ /*0x0504*/ 423,
+ /*0x1fac*/ 750,
+ /*0x042c*/ 341,
+ /*0x2c2c*/ 894,
+ /*0x1eac*/ 612,
+ /*0x012c*/ 79,
+ /*0x022c*/ 212,
+ /*0x2cac*/ 934,
+ /*0x1e2c*/ 546,
+ -1,
+ /*0x1040d*/ 1119,
+ /*0x04ac*/ 379,
+ /*0xa688*/ 992,
+ -1,
+ /*0xa7ac*/ 1064,
+ /*0x1f8d*/ 719,
+ /*0x040d*/ 310,
+ /*0x2c0d*/ 863,
+ /*0x052a*/ 442,
+ /*0x1fa8*/ 746,
+ /*0x0428*/ 337,
+ /*0x2c28*/ 890,
+ /*0x1ea8*/ 610,
+ /*0x0128*/ 77,
+ /*0x0228*/ 210,
+ /*0x2ca8*/ 932,
+ /*0x1e28*/ 544,
+ -1,
+ /*0xa78d*/ 1049,
+ /*0x04a8*/ 377,
+ /*0x24bf*/ 833,
+ /*0x03a8*/ 264,
+ /*0xa7a8*/ 1061,
+ /*0x01f7*/ 185,
+ /*0x01a2*/ 142,
+ -1, -1,
+ /*0x10a2*/ 486,
+ /*0x0500*/ 421,
+ /*0x1fae*/ 752,
+ /*0x042e*/ 343,
+ /*0x2c2e*/ 896,
+ /*0x1eae*/ 613,
+ /*0x012e*/ 80,
+ /*0x022e*/ 213,
+ /*0x2cae*/ 935,
+ /*0x1e2e*/ 547,
+ /*0x1fb2*/ 754,
+ /*0x0187*/ 125,
+ /*0x04ae*/ 380,
+ /*0x1eb2*/ 615,
+ /*0x0132*/ 81,
+ /*0x0232*/ 215,
+ /*0x2cb2*/ 937,
+ /*0x1e32*/ 549,
+ /*0x1fba*/ 761,
+ -1,
+ /*0x04b2*/ 382,
+ /*0x1eba*/ 619,
+ /*0xff26*/ 1085,
+ /*0x023a*/ 216,
+ /*0x2cba*/ 941,
+ /*0x1e3a*/ 553,
+ /*0x0182*/ 122,
+ /*0x1fb8*/ 759,
+ /*0x04ba*/ 386,
+ /*0x051c*/ 435,
+ /*0x1eb8*/ 618,
+ -1,
+ /*0x118a6*/ 1152,
+ /*0x2cb8*/ 940,
+ /*0x1e38*/ 552,
+ -1,
+ /*0xff24*/ 1083,
+ /*0x04b8*/ 385,
+ -1, -1,
+ /*0x01d7*/ 168,
+ /*0xfb17*/ 1079,
+ /*0x018b*/ 128,
+ -1,
+ /*0x1f0b*/ 657,
+ /*0x00b5*/ 25,
+ /*0x118a4*/ 1150,
+ -1, -1, -1,
+ /*0x01b5*/ 153,
+ /*0x1fec*/ 792,
+ /*0x046c*/ 351,
+ /*0x10b5*/ 505,
+ /*0x1eec*/ 644,
+ /*0x016c*/ 110,
+ /*0x051e*/ 436,
+ /*0x0184*/ 123,
+ /*0x1e6c*/ 578,
+ -1,
+ /*0x118a0*/ 1146,
+ /*0x04ec*/ 411,
+ /*0x1fca*/ 772,
+ /*0x03ec*/ 285,
+ -1,
+ /*0x1eca*/ 627,
+ /*0x014a*/ 93,
+ /*0x024a*/ 226,
+ /*0x2cca*/ 949,
+ /*0x1e4a*/ 561,
+ /*0x0508*/ 425,
+ -1,
+ /*0x118bd*/ 1175,
+ /*0x004a*/ 8,
+ -1, -1,
+ /*0x1fcc*/ 774,
+ /*0x1f2a*/ 670,
+ /*0x10aa*/ 494,
+ /*0x1ecc*/ 628,
+ /*0x014c*/ 94,
+ /*0x024c*/ 227,
+ /*0x2ccc*/ 950,
+ /*0x1e4c*/ 562,
+ -1, -1,
+ /*0x052c*/ 443,
+ /*0x004c*/ 10,
+ -1,
+ /*0xfb16*/ 1078,
+ /*0x1fd6*/ 777,
+ /*0xa726*/ 1004,
+ -1,
+ /*0x1ed6*/ 633,
+ /*0x0156*/ 99,
+ -1,
+ /*0x2cd6*/ 955,
+ /*0x1e56*/ 567,
+ -1, -1,
+ /*0x04d6*/ 400,
+ /*0x0056*/ 20,
+ /*0x03d6*/ 274,
+ -1,
+ /*0x0528*/ 441,
+ /*0xa724*/ 1003,
+ -1, -1,
+ /*0x24bd*/ 831,
+ /*0x1fe2*/ 783,
+ /*0x0462*/ 346,
+ /*0x2c62*/ 898,
+ /*0x1ee2*/ 639,
+ /*0x0162*/ 105,
+ /*0x0193*/ 133,
+ /*0x2ce2*/ 961,
+ /*0x1e62*/ 573,
+ -1,
+ /*0x24cf*/ 849,
+ /*0x04e2*/ 406,
+ -1,
+ /*0x03e2*/ 280,
+ /*0x10415*/ 1127,
+ /*0x019c*/ 138,
+ /*0x052e*/ 444,
+ /*0x1f1c*/ 666,
+ -1,
+ /*0x1f95*/ 727,
+ /*0x0415*/ 318,
+ /*0x2c15*/ 871,
+ /*0x1fc8*/ 770,
+ -1,
+ /*0x0532*/ 446,
+ /*0x1ec8*/ 626,
+ -1,
+ /*0x0248*/ 225,
+ /*0x2cc8*/ 948,
+ /*0x1e48*/ 560,
+ /*0x10401*/ 1107,
+ /*0x0395*/ 246,
+ /*0x053a*/ 454,
+ /*0x0048*/ 7,
+ -1,
+ /*0x1f81*/ 707,
+ /*0x0401*/ 298,
+ /*0x2c01*/ 851,
+ /*0xff22*/ 1081,
+ /*0x2165*/ 812,
+ /*0x1feb*/ 791,
+ /*0x0538*/ 452,
+ /*0x2c6b*/ 903,
+ /*0x2161*/ 808,
+ /*0x1fc4*/ 767,
+ -1,
+ /*0x2ceb*/ 962,
+ /*0x1ec4*/ 624,
+ /*0x118a2*/ 1148,
+ /*0x0244*/ 222,
+ /*0x2cc4*/ 946,
+ /*0x1e44*/ 558,
+ -1, -1,
+ /*0x1fd3*/ 776,
+ /*0x0044*/ 3,
+ /*0x1fea*/ 790,
+ /*0x046a*/ 350,
+ /*0x1f08*/ 654,
+ /*0x1eea*/ 643,
+ /*0x016a*/ 109,
+ -1,
+ /*0x00db*/ 52,
+ /*0x1e6a*/ 577,
+ /*0xa77b*/ 1041,
+ /*0x0053*/ 17,
+ /*0x04ea*/ 410,
+ /*0x01db*/ 170,
+ /*0x03ea*/ 284,
+ /*0x1f5b*/ 695,
+ -1, -1,
+ /*0x01ac*/ 147,
+ -1,
+ /*0x1f2c*/ 672,
+ /*0x10ac*/ 496,
+ /*0x054a*/ 470,
+ /*0x1fe8*/ 788,
+ /*0x0468*/ 349,
+ -1,
+ /*0x1ee8*/ 642,
+ /*0x0168*/ 108,
+ -1, -1,
+ /*0x1e68*/ 576,
+ -1, -1,
+ /*0x04e8*/ 409,
+ /*0x1f0d*/ 659,
+ /*0x03e8*/ 283,
+ /*0x054c*/ 472,
+ /*0xff35*/ 1100,
+ /*0x1f28*/ 668,
+ /*0x10a8*/ 492,
+ -1, -1,
+ /*0x1fe4*/ 785,
+ /*0x0464*/ 347,
+ /*0x2c64*/ 900,
+ /*0x1ee4*/ 640,
+ /*0x0164*/ 106,
+ /*0x118b5*/ 1167,
+ -1,
+ /*0x1e64*/ 574,
+ /*0x0556*/ 482,
+ -1,
+ /*0x04e4*/ 407,
+ /*0xa722*/ 1002,
+ /*0x03e4*/ 281,
+ -1,
+ /*0x01ae*/ 148,
+ /*0x216f*/ 822,
+ /*0x1f2e*/ 674,
+ /*0x10ae*/ 498,
+ -1, -1,
+ /*0xff2a*/ 1089,
+ -1,
+ /*0x01b2*/ 151,
+ -1,
+ /*0xa77d*/ 1042,
+ /*0x10b2*/ 502,
+ -1,
+ /*0xfb14*/ 1076,
+ /*0x1fbc*/ 763,
+ -1,
+ /*0x118aa*/ 1156,
+ /*0x1ebc*/ 620,
+ /*0x1f3a*/ 678,
+ /*0x10ba*/ 510,
+ /*0x2cbc*/ 942,
+ /*0x1e3c*/ 554,
+ -1, -1,
+ /*0x04bc*/ 387,
+ /*0x01b8*/ 155,
+ /*0x2169*/ 816,
+ /*0x1f38*/ 676,
+ /*0x10b8*/ 508,
+ /*0xfb06*/ 1074,
+ /*0x0460*/ 345,
+ /*0x2c60*/ 897,
+ /*0x1ee0*/ 638,
+ /*0x0160*/ 104,
+ /*0x0548*/ 468,
+ /*0x2ce0*/ 960,
+ /*0x1e60*/ 572,
+ -1, -1,
+ /*0x04e0*/ 405,
+ -1,
+ /*0x03e0*/ 279,
+ -1, -1, -1,
+ /*0x2126*/ 803,
+ -1,
+ /*0x1fbe*/ 764,
+ -1,
+ /*0x01ec*/ 178,
+ /*0x1ebe*/ 621,
+ /*0x1f6c*/ 702,
+ /*0x023e*/ 219,
+ /*0x2cbe*/ 943,
+ /*0x1e3e*/ 555,
+ /*0x00ca*/ 36,
+ /*0x0544*/ 464,
+ /*0x04be*/ 388,
+ /*0x1ffc*/ 802,
+ /*0x047c*/ 359,
+ /*0x01ca*/ 161,
+ /*0x1efc*/ 652,
+ /*0x1f4a*/ 686,
+ -1, -1,
+ /*0x1e7c*/ 586,
+ /*0x0553*/ 479,
+ /*0x1fb6*/ 757,
+ /*0x04fc*/ 419,
+ /*0x00cc*/ 38,
+ /*0x1eb6*/ 617,
+ /*0x0136*/ 83,
+ -1,
+ /*0x2cb6*/ 939,
+ /*0x1e36*/ 551,
+ /*0xa72a*/ 1006,
+ /*0x1f4c*/ 688,
+ /*0x04b6*/ 384,
+ /*0x1fd2*/ 775,
+ -1, -1,
+ /*0x1ed2*/ 631,
+ /*0x0152*/ 97,
+ /*0x00d6*/ 48,
+ /*0x2cd2*/ 953,
+ /*0x1e52*/ 565,
+ -1, -1,
+ /*0x04d2*/ 398,
+ /*0x0052*/ 16,
+ /*0x1f56*/ 693,
+ -1, -1, -1,
+ /*0xfb02*/ 1070,
+ /*0x1ed0*/ 630,
+ /*0x0150*/ 96,
+ -1,
+ /*0x2cd0*/ 952,
+ /*0x1e50*/ 564,
+ -1, -1,
+ /*0x04d0*/ 397,
+ /*0x0050*/ 14,
+ /*0x03d0*/ 271,
+ -1,
+ /*0x1fda*/ 781,
+ /*0x01e2*/ 173,
+ -1,
+ /*0x1eda*/ 635,
+ /*0x015a*/ 101,
+ /*0xff2c*/ 1091,
+ /*0x2cda*/ 957,
+ /*0x1e5a*/ 569,
+ -1,
+ /*0xa66c*/ 987,
+ /*0x04da*/ 402,
+ /*0x005a*/ 24,
+ /*0x03da*/ 276,
+ -1,
+ /*0x2c6d*/ 904,
+ /*0x118ac*/ 1158,
+ -1,
+ /*0x00c8*/ 34,
+ /*0x2ced*/ 963,
+ /*0xfb04*/ 1072,
+ /*0xa64a*/ 970,
+ -1,
+ /*0x01c8*/ 160,
+ /*0xff28*/ 1087,
+ /*0x1f48*/ 684,
+ /*0x1fc2*/ 765,
+ -1, -1,
+ /*0x1ec2*/ 623,
+ -1,
+ /*0x053c*/ 456,
+ /*0x2cc2*/ 945,
+ /*0x1e42*/ 557,
+ /*0x118a8*/ 1154,
+ /*0xa64c*/ 971,
+ /*0x0181*/ 121,
+ /*0x0042*/ 1,
+ /*0x03c2*/ 269,
+ -1,
+ /*0x00c4*/ 30,
+ -1, -1,
+ /*0x1f6b*/ 701,
+ /*0xff2e*/ 1093,
+ /*0x01c4*/ 157,
+ -1,
+ /*0x2167*/ 814,
+ /*0x10c4*/ 520,
+ /*0xa656*/ 976,
+ /*0x00d3*/ 45,
+ -1,
+ /*0xff32*/ 1097,
+ -1,
+ /*0x118ae*/ 1160,
+ /*0x01d3*/ 166,
+ -1,
+ /*0x01ea*/ 177,
+ /*0xfb00*/ 1068,
+ /*0x1f6a*/ 700,
+ /*0xff3a*/ 1105,
+ -1,
+ /*0x118b2*/ 1164,
+ -1,
+ /*0x053e*/ 458,
+ /*0x0145*/ 90,
+ /*0x0245*/ 223,
+ -1,
+ /*0xa662*/ 982,
+ /*0xff38*/ 1103,
+ /*0x118ba*/ 1172,
+ /*0x04c5*/ 392,
+ /*0x0045*/ 4,
+ -1, -1,
+ /*0xa72c*/ 1007,
+ -1,
+ /*0xfb13*/ 1075,
+ /*0x01e8*/ 176,
+ /*0x118b8*/ 1170,
+ /*0x1f68*/ 698,
+ -1, -1, -1,
+ /*0x0536*/ 450,
+ /*0x046e*/ 352,
+ /*0x2c6e*/ 905,
+ /*0x1eee*/ 645,
+ /*0x016e*/ 111,
+ /*0xa648*/ 969,
+ -1,
+ /*0x1e6e*/ 579,
+ -1,
+ /*0xa728*/ 1005,
+ /*0x04ee*/ 412,
+ /*0x0552*/ 478,
+ /*0x03ee*/ 286,
+ /*0x01e4*/ 174,
+ /*0x1fe6*/ 786,
+ /*0x0466*/ 348,
+ /*0x1ff9*/ 799,
+ /*0x1ee6*/ 641,
+ /*0x0166*/ 107,
+ -1,
+ /*0x0179*/ 117,
+ /*0x1e66*/ 575,
+ /*0x24ba*/ 828,
+ -1,
+ /*0x04e6*/ 408,
+ /*0x0550*/ 476,
+ /*0x03e6*/ 282,
+ /*0xa644*/ 967,
+ /*0x03f9*/ 292,
+ /*0xa72e*/ 1008,
+ -1,
+ /*0x24b8*/ 826,
+ /*0x1ece*/ 629,
+ /*0x014e*/ 95,
+ /*0x024e*/ 228,
+ /*0x2cce*/ 951,
+ /*0x1e4e*/ 563,
+ /*0xa732*/ 1009,
+ -1,
+ /*0xa66a*/ 986,
+ /*0x004e*/ 12,
+ /*0x01bc*/ 156,
+ -1,
+ /*0x1f3c*/ 680,
+ /*0x10bc*/ 512,
+ /*0xa73a*/ 1013,
+ /*0x1fc6*/ 768,
+ -1, -1,
+ /*0x1ec6*/ 625,
+ -1,
+ /*0x0246*/ 224,
+ /*0x2cc6*/ 947,
+ /*0x1e46*/ 559,
+ /*0xa738*/ 1012,
+ -1,
+ /*0x01e0*/ 172,
+ /*0x0046*/ 5,
+ /*0x212a*/ 804,
+ -1,
+ /*0xa668*/ 985,
+ /*0x1fa9*/ 747,
+ /*0x0429*/ 338,
+ /*0x2c29*/ 891,
+ /*0x0542*/ 462,
+ -1,
+ /*0x24ca*/ 844,
+ /*0x1ed4*/ 632,
+ /*0x0154*/ 98,
+ -1,
+ /*0x2cd4*/ 954,
+ /*0x1e54*/ 566,
+ -1,
+ /*0x03a9*/ 265,
+ /*0x04d4*/ 399,
+ /*0x0054*/ 18,
+ /*0x1f3e*/ 682,
+ /*0x10be*/ 514,
+ /*0xa76c*/ 1038,
+ /*0xa664*/ 983,
+ /*0x24cc*/ 846,
+ -1,
+ /*0x04cd*/ 396,
+ /*0x004d*/ 11,
+ /*0x1fd8*/ 779,
+ /*0x01fc*/ 188,
+ -1,
+ /*0x1ed8*/ 634,
+ /*0x0158*/ 100,
+ /*0xa74a*/ 1021,
+ /*0x2cd8*/ 956,
+ /*0x1e58*/ 568,
+ -1,
+ /*0x2163*/ 810,
+ /*0x04d8*/ 401,
+ /*0x0058*/ 22,
+ /*0x03d8*/ 275,
+ /*0x10b6*/ 506,
+ /*0x1ec0*/ 622,
+ /*0x0545*/ 465,
+ /*0x00d2*/ 44,
+ /*0x2cc0*/ 944,
+ /*0x1e40*/ 556,
+ /*0xa74c*/ 1022,
+ -1,
+ /*0x04c0*/ 389,
+ /*0x1fb4*/ 756,
+ /*0x1f52*/ 691,
+ -1,
+ /*0x1eb4*/ 616,
+ /*0x0134*/ 82,
+ -1,
+ /*0x2cb4*/ 938,
+ /*0x1e34*/ 550,
+ /*0x00d0*/ 42,
+ -1,
+ /*0x04b4*/ 383,
+ /*0xa756*/ 1027,
+ -1,
+ /*0x1fb7*/ 758,
+ -1,
+ /*0x1f50*/ 690,
+ /*0xa660*/ 981,
+ /*0x1eb0*/ 614,
+ /*0x0130*/ 1179,
+ /*0x0230*/ 214,
+ /*0x2cb0*/ 936,
+ /*0x1e30*/ 548,
+ /*0x00da*/ 51,
+ -1,
+ /*0x04b0*/ 381,
+ -1,
+ /*0x03b0*/ 268,
+ /*0xa7b0*/ 1066,
+ /*0x24c8*/ 842,
+ -1,
+ /*0xa762*/ 1033,
+ /*0x1ede*/ 637,
+ /*0x015e*/ 103,
+ /*0x1fb9*/ 760,
+ /*0x2cde*/ 959,
+ /*0x1e5e*/ 571,
+ -1,
+ /*0x0139*/ 84,
+ /*0x04de*/ 404,
+ -1,
+ /*0x03de*/ 278,
+ /*0x1f6d*/ 703,
+ /*0x1fc7*/ 769,
+ /*0x0345*/ 229,
+ /*0x1fbb*/ 762,
+ /*0x054e*/ 474,
+ /*0x0147*/ 91,
+ /*0x00c2*/ 28,
+ /*0x013b*/ 85,
+ /*0x023b*/ 217,
+ /*0x24c4*/ 838,
+ /*0xa748*/ 1020,
+ /*0x04c7*/ 393,
+ /*0x0047*/ 6,
+ -1,
+ /*0x10c2*/ 518,
+ /*0x1fab*/ 749,
+ /*0x042b*/ 340,
+ /*0x2c2b*/ 893,
+ /*0x0055*/ 19,
+ /*0x03d5*/ 273,
+ -1,
+ /*0x0546*/ 466,
+ -1, -1,
+ /*0xa652*/ 974,
+ /*0x1fc3*/ 766,
+ -1,
+ /*0x03ab*/ 267,
+ /*0xa7ab*/ 1063,
+ /*0x0143*/ 89,
+ /*0x0243*/ 221,
+ -1,
+ /*0xa744*/ 1018,
+ -1, -1,
+ /*0x04c3*/ 391,
+ /*0x0043*/ 2,
+ -1,
+ /*0xa650*/ 973,
+ /*0x0554*/ 480,
+ -1,
+ /*0x00c5*/ 31,
+ -1, -1,
+ /*0xa76a*/ 1037,
+ -1,
+ /*0x01c5*/ 158,
+ /*0x054d*/ 473,
+ -1,
+ /*0x10c5*/ 521,
+ -1, -1,
+ /*0xa65a*/ 978,
+ /*0x118bc*/ 1174,
+ /*0x1ff2*/ 793,
+ /*0x0472*/ 354,
+ /*0x2c72*/ 908,
+ /*0x1ef2*/ 647,
+ /*0x0172*/ 113,
+ -1,
+ /*0x2cf2*/ 964,
+ /*0x1e72*/ 581,
+ /*0x2132*/ 806,
+ -1,
+ /*0x04f2*/ 414,
+ /*0xa768*/ 1036,
+ /*0x1faf*/ 753,
+ /*0x042f*/ 344,
+ -1,
+ /*0x01ee*/ 179,
+ /*0x0540*/ 460,
+ /*0x1f6e*/ 704,
+ -1,
+ /*0x10427*/ 1145,
+ -1,
+ /*0xfb15*/ 1077,
+ -1,
+ /*0xa642*/ 966,
+ /*0x1fa7*/ 745,
+ /*0x0427*/ 336,
+ /*0x2c27*/ 889,
+ /*0x0534*/ 448,
+ -1,
+ /*0x01e6*/ 175,
+ /*0xa764*/ 1034,
+ -1,
+ /*0x118be*/ 1176,
+ -1, -1,
+ /*0x24bc*/ 830,
+ /*0x03a7*/ 263,
+ /*0xfb01*/ 1069,
+ -1,
+ /*0x00ce*/ 40,
+ /*0x0537*/ 451,
+ -1,
+ /*0xff36*/ 1101,
+ -1,
+ /*0x1edc*/ 636,
+ /*0x015c*/ 102,
+ -1,
+ /*0x2cdc*/ 958,
+ /*0x1e5c*/ 570,
+ /*0x216c*/ 819,
+ -1,
+ /*0x04dc*/ 403,
+ /*0x118b6*/ 1168,
+ /*0x03dc*/ 277,
+ -1,
+ /*0x1fcb*/ 773,
+ /*0x00c6*/ 32,
+ -1,
+ /*0xa73c*/ 1014,
+ /*0x1fb3*/ 755,
+ /*0x0539*/ 453,
+ /*0x0470*/ 353,
+ /*0x2c70*/ 907,
+ /*0x1ef0*/ 646,
+ /*0x0170*/ 112,
+ /*0x04cb*/ 395,
+ /*0x004b*/ 9,
+ /*0x1e70*/ 580,
+ /*0x24be*/ 832,
+ /*0x0547*/ 467,
+ /*0x04f0*/ 413,
+ /*0x053b*/ 455,
+ /*0x03f0*/ 287,
+ /*0xa760*/ 1032,
+ /*0x00d4*/ 46,
+ /*0x0555*/ 481,
+ /*0x01a9*/ 146,
+ -1,
+ /*0x1f29*/ 669,
+ /*0x10a9*/ 493,
+ -1,
+ /*0x1f54*/ 692,
+ /*0x00cd*/ 39,
+ /*0x1fad*/ 751,
+ /*0x042d*/ 342,
+ /*0x2c2d*/ 895,
+ -1,
+ /*0x01cd*/ 163,
+ /*0x24b6*/ 824,
+ /*0x1f4d*/ 689,
+ /*0x10cd*/ 523,
+ /*0xa73e*/ 1015,
+ -1,
+ /*0x0543*/ 463,
+ /*0x00d8*/ 49,
+ /*0xa666*/ 984,
+ /*0xa7ad*/ 1065,
+ /*0x047e*/ 360,
+ /*0x2c7e*/ 910,
+ /*0x1efe*/ 653,
+ -1,
+ /*0xa7b1*/ 1067,
+ -1,
+ /*0x1e7e*/ 587,
+ -1,
+ /*0x00c0*/ 26,
+ /*0x04fe*/ 420,
+ /*0x2162*/ 809,
+ /*0x03fe*/ 295,
+ -1,
+ /*0xa64e*/ 972,
+ /*0xa736*/ 1011,
+ -1,
+ /*0x10c0*/ 516,
+ -1, -1,
+ /*0x1ff4*/ 795,
+ /*0x0474*/ 355,
+ -1,
+ /*0x1ef4*/ 648,
+ /*0x0174*/ 114,
+ -1,
+ /*0xa752*/ 1025,
+ /*0x1e74*/ 582,
+ /*0x10b4*/ 504,
+ /*0x10403*/ 1109,
+ /*0x04f4*/ 415,
+ /*0xa646*/ 968,
+ /*0x03f4*/ 289,
+ /*0x1fc9*/ 771,
+ /*0x1f83*/ 709,
+ /*0x0403*/ 300,
+ /*0x2c03*/ 853,
+ /*0x0149*/ 92,
+ /*0x01b7*/ 154,
+ -1,
+ /*0xa750*/ 1024,
+ /*0x10b7*/ 507,
+ /*0x10b0*/ 500,
+ /*0x04c9*/ 394,
+ /*0x0049*/ 1178,
+ /*0x0141*/ 88,
+ /*0x0241*/ 220,
+ -1,
+ /*0x00de*/ 55,
+ /*0xa654*/ 975,
+ /*0x216b*/ 818,
+ /*0x04c1*/ 390,
+ /*0x0041*/ 0,
+ /*0x01de*/ 171,
+ /*0xa75a*/ 1029,
+ -1,
+ /*0x24c2*/ 836,
+ -1,
+ /*0x10425*/ 1143,
+ -1,
+ /*0x1f39*/ 677,
+ /*0x10b9*/ 509,
+ /*0x00c7*/ 33,
+ /*0x1fa5*/ 743,
+ /*0x0425*/ 334,
+ /*0x2c25*/ 887,
+ /*0x216a*/ 817,
+ /*0x01c7*/ 159,
+ /*0x00d5*/ 47,
+ /*0xa658*/ 977,
+ /*0x10c7*/ 522,
+ /*0x1f3b*/ 679,
+ /*0x10bb*/ 511,
+ /*0x01d5*/ 167,
+ -1,
+ /*0x03a5*/ 261,
+ /*0x0372*/ 231,
+ -1, -1,
+ /*0xa742*/ 1017,
+ /*0xa640*/ 965,
+ /*0x054b*/ 471,
+ -1,
+ /*0x1f2b*/ 671,
+ /*0x10ab*/ 495,
+ /*0x0533*/ 447,
+ /*0x00c3*/ 29,
+ /*0x2168*/ 815,
+ -1, -1,
+ /*0x10423*/ 1141,
+ /*0x24c5*/ 839,
+ -1,
+ /*0x10421*/ 1139,
+ /*0x10c3*/ 519,
+ /*0x1fa3*/ 741,
+ /*0x0423*/ 332,
+ /*0x2c23*/ 885,
+ /*0x1fa1*/ 739,
+ /*0x0421*/ 330,
+ /*0x2c21*/ 883,
+ -1, -1, -1, -1, -1,
+ /*0x2164*/ 811,
+ /*0x03a3*/ 259,
+ /*0x1ff6*/ 796,
+ /*0x0476*/ 356,
+ /*0x03a1*/ 258,
+ /*0x1ef6*/ 649,
+ /*0x0176*/ 115,
+ -1,
+ /*0x0531*/ 445,
+ /*0x1e76*/ 583,
+ -1, -1,
+ /*0x04f6*/ 416,
+ /*0xa65e*/ 980,
+ /*0x01f2*/ 182,
+ /*0x1ffa*/ 800,
+ /*0x047a*/ 358,
+ -1,
+ /*0x1efa*/ 651,
+ -1,
+ /*0x0051*/ 15,
+ /*0x03d1*/ 272,
+ /*0x1e7a*/ 585,
+ /*0xff29*/ 1088,
+ -1,
+ /*0x04fa*/ 418,
+ /*0x01af*/ 149,
+ /*0x03fa*/ 293,
+ /*0x1f2f*/ 675,
+ /*0x10af*/ 499,
+ /*0x0370*/ 230,
+ /*0xa76e*/ 1039,
+ -1,
+ /*0x118a9*/ 1155,
+ -1, -1, -1,
+ /*0x24ce*/ 848,
+ /*0x01a7*/ 145,
+ -1, -1,
+ /*0x10a7*/ 491,
+ -1,
+ /*0x2160*/ 807,
+ -1,
+ /*0xa766*/ 1035,
+ -1,
+ /*0xa779*/ 1040,
+ -1,
+ /*0x0549*/ 469,
+ /*0x00dc*/ 53,
+ -1,
+ /*0x1ff8*/ 798,
+ /*0x0478*/ 357,
+ /*0x24c6*/ 840,
+ /*0x1ef8*/ 650,
+ /*0x0178*/ 116,
+ /*0x0541*/ 461,
+ -1,
+ /*0x1e78*/ 584,
+ /*0xa74e*/ 1023,
+ -1,
+ /*0x04f8*/ 417,
+ -1,
+ /*0x00cb*/ 37,
+ -1, -1, -1,
+ /*0xff34*/ 1099,
+ /*0x01cb*/ 162,
+ -1,
+ /*0x1f4b*/ 687,
+ -1,
+ /*0x01b3*/ 152,
+ /*0x01f0*/ 180,
+ -1,
+ /*0x10b3*/ 503,
+ /*0xa746*/ 1019,
+ /*0x118b4*/ 1166,
+ /*0x1041d*/ 1135,
+ /*0x24cd*/ 847,
+ /*0xff37*/ 1102,
+ /*0xff30*/ 1095,
+ /*0x10405*/ 1111,
+ /*0x1f9d*/ 735,
+ /*0x041d*/ 326,
+ /*0x2c1d*/ 879,
+ -1,
+ /*0x1f85*/ 711,
+ /*0x0405*/ 302,
+ /*0x2c05*/ 855,
+ /*0x118b7*/ 1169,
+ /*0x118b0*/ 1162,
+ -1, -1,
+ /*0xa754*/ 1026,
+ /*0x039d*/ 254,
+ -1, -1,
+ /*0x1f2d*/ 673,
+ /*0x10ad*/ 497,
+ /*0xff39*/ 1104,
+ /*0x01b1*/ 150,
+ /*0x24c0*/ 834,
+ -1,
+ /*0x10b1*/ 501,
+ -1, -1, -1, -1,
+ /*0x01fe*/ 189,
+ /*0x118b9*/ 1171,
+ /*0x1041b*/ 1133,
+ -1, -1,
+ /*0xa758*/ 1028,
+ -1,
+ /*0x1f9b*/ 733,
+ /*0x041b*/ 324,
+ /*0x2c1b*/ 877,
+ /*0x1e9b*/ 604,
+ /*0xa65c*/ 979,
+ /*0x118bb*/ 1173,
+ -1,
+ /*0xff2b*/ 1090,
+ -1,
+ /*0xa740*/ 1016,
+ /*0x24b7*/ 825,
+ -1,
+ /*0x039b*/ 252,
+ /*0x01f4*/ 183,
+ /*0x0551*/ 477,
+ /*0x216d*/ 820,
+ -1,
+ /*0x118ab*/ 1157,
+ /*0x10419*/ 1131,
+ -1,
+ /*0xa734*/ 1010,
+ /*0x00c9*/ 35,
+ -1,
+ /*0x1f99*/ 731,
+ /*0x0419*/ 322,
+ /*0x2c19*/ 875,
+ /*0x1e99*/ 602,
+ -1,
+ /*0x1f49*/ 685,
+ /*0x00c1*/ 27,
+ /*0x24b9*/ 827,
+ -1, -1, -1, -1,
+ /*0x0399*/ 250,
+ -1,
+ /*0x10c1*/ 517,
+ /*0x1040f*/ 1121,
+ /*0x24c7*/ 841,
+ -1,
+ /*0x24bb*/ 829,
+ -1,
+ /*0x1f8f*/ 721,
+ /*0x040f*/ 312,
+ /*0x2c0f*/ 865,
+ -1,
+ /*0x10409*/ 1115,
+ /*0xa75e*/ 1031,
+ -1, -1, -1,
+ /*0x1f89*/ 715,
+ /*0x0409*/ 306,
+ /*0x2c09*/ 859,
+ /*0x038f*/ 240,
+ -1,
+ /*0x0376*/ 232,
+ /*0xff2f*/ 1094,
+ /*0x10a5*/ 489,
+ /*0x1041f*/ 1137,
+ -1, -1,
+ /*0x24c3*/ 837,
+ /*0x0389*/ 236,
+ /*0x1f9f*/ 737,
+ /*0x041f*/ 328,
+ /*0x2c1f*/ 881,
+ /*0x118af*/ 1161,
+ -1,
+ /*0xff27*/ 1086,
+ -1, -1, -1, -1, -1,
+ /*0x10411*/ 1123,
+ /*0x039f*/ 256,
+ -1, -1,
+ /*0x118a7*/ 1153,
+ /*0x1f91*/ 723,
+ /*0x0411*/ 314,
+ /*0x2c11*/ 867,
+ /*0x2183*/ 823,
+ -1,
+ /*0x216e*/ 821,
+ -1, -1, -1, -1,
+ /*0x10a3*/ 487,
+ -1,
+ /*0x0391*/ 242,
+ /*0x10a1*/ 485,
+ -1, -1, -1, -1, -1,
+ /*0x2166*/ 813,
+ /*0x01f6*/ 184,
+ -1,
+ /*0x00d1*/ 43,
+ -1,
+ /*0xff33*/ 1098,
+ -1, -1,
+ /*0x01d1*/ 165,
+ -1, -1, -1, -1, -1,
+ /*0x01fa*/ 187,
+ /*0x118b3*/ 1165,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff2d*/ 1092,
+ -1, -1, -1, -1,
+ /*0xff31*/ 1096,
+ -1, -1, -1, -1,
+ /*0x118ad*/ 1159,
+ -1, -1, -1, -1,
+ /*0x118b1*/ 1163,
+ -1, -1,
+ /*0x24cb*/ 845,
+ -1, -1, -1,
+ /*0x01f8*/ 186,
+ -1, -1, -1, -1,
+ /*0xa75c*/ 1030,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x019d*/ 139,
+ -1,
+ /*0x1f1d*/ 667,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff25*/ 1084,
+ -1, -1, -1, -1, -1,
+ /*0xa77e*/ 1043,
+ -1, -1, -1,
+ /*0x118a5*/ 1151,
+ -1, -1,
+ /*0x1f1b*/ 665,
+ -1, -1,
+ /*0x24c9*/ 843,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x24c1*/ 835,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff23*/ 1082,
+ -1, -1,
+ /*0xff21*/ 1080,
+ /*0x1f19*/ 663,
+ -1, -1, -1, -1, -1,
+ /*0x118a3*/ 1149,
+ /*0x212b*/ 805,
+ -1,
+ /*0x118a1*/ 1147,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x018f*/ 130,
+ -1,
+ /*0x1f0f*/ 661,
+ -1, -1, -1, -1, -1, -1,
+ /*0x0189*/ 126,
+ -1,
+ /*0x1f09*/ 655,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0x019f*/ 140,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x0191*/ 132,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0xfb03*/ 1071,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -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*/ 1073
+ };
+
+ 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_11_Type CaseUnfold_11_Table[] = {
+#define CaseUnfold_11 (*(CaseUnfold_11_Type (*)[1054])(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}}},
+ {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}}},
+ {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}}},
+ {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}}},
+ {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+1054))
+ {0x0069, {1, {0x0049}}},
+};
+
+/* C code produced by gperf version 3.0.3 */
+/* 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 = 1907, 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, 1915, 4, 12, 199, 716, 4, 230, 6, 134,
+ 355, 116, 9, 3, 7, 13, 1915, 1915, 1915, 1915,
+ 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915,
+ 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915,
+ 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915, 1915,
+ 1915, 1915, 1915, 40, 1915, 1915, 1915, 1915, 1915, 1915,
+ 1915, 1915, 21, 1915, 2, 1, 11, 49, 50, 667,
+ 131, 651, 26, 872, 251, 1136, 24, 42, 295, 1145,
+ 111, 27, 47, 12, 812, 806, 107, 786, 21, 1070,
+ 13, 967, 41, 5, 523, 1152, 71, 1077, 73, 948,
+ 14, 601, 10, 575, 15, 764, 1, 929, 27, 1057,
+ 23, 498, 15, 918, 1208, 753, 1211, 512, 1180, 736,
+ 1082, 711, 441, 898, 410, 1028, 277, 887, 238, 684,
+ 336, 425, 740, 406, 1016, 360, 972, 382, 1006, 354,
+ 1168, 302, 999, 286, 901, 252, 546, 106, 1159, 148,
+ 1121, 224, 1061, 132, 1152, 182, 871, 210, 1163, 235,
+ 1183, 371, 1197, 64, 954, 90, 339, 79, 604, 168,
+ 982, 159, 448, 328, 525, 634, 195, 620, 261, 852,
+ 934, 312, 210, 836, 668, 983, 586, 823, 460, 955,
+ 1176, 697, 119, 998
+ };
+ return asso_values[bits_of(code, 2)+66] + asso_values[bits_of(code, 1)+4] + asso_values[bits_of(code, 0)];
+}
+
+#ifdef __GNUC__
+__inline
+#ifdef __GNUC_STDC_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 = 1055,
+ MIN_WORD_LENGTH = 3,
+ MAX_WORD_LENGTH = 3,
+ MIN_HASH_VALUE = 8,
+ MAX_HASH_VALUE = 1914
+ };
+
+ static const short wordlist[] =
+ {
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x1e1b*/ 490,
+ /*0x049b*/ 362,
+ /*0x011b*/ 69,
+ /*0x2c9b*/ 781,
+ /*0x021b*/ 178,
+ /*0x051b*/ 426,
+ /*0x1e91*/ 549,
+ /*0x1e11*/ 485,
+ /*0x0491*/ 357,
+ /*0x0111*/ 64,
+ /*0x2c91*/ 776,
+ /*0x0211*/ 173,
+ /*0x0511*/ 421,
+ /*0xa79b*/ 948,
+ /*0x1f24*/ 618,
+ /*0x1f00*/ 600,
+ /*0x1f11*/ 609,
+ /*0x0580*/ 468,
+ /*0x1f22*/ 616,
+ /*0x1f26*/ 620,
+ /*0xa791*/ 944,
+ /*0x1e8f*/ 548,
+ /*0x1e0f*/ 484,
+ /*0x048f*/ 356,
+ /*0x010f*/ 63,
+ /*0x2c8f*/ 775,
+ /*0x020f*/ 172,
+ /*0x050f*/ 420,
+ /*0xa69b*/ 897,
+ -1,
+ /*0x1f06*/ 606,
+ -1,
+ /*0x0586*/ 474,
+ -1, -1,
+ /*0xa691*/ 892,
+ /*0x1e8b*/ 546,
+ /*0x1e0b*/ 482,
+ /*0x048b*/ 354,
+ /*0x010b*/ 61,
+ /*0x2c8b*/ 773,
+ /*0x020b*/ 170,
+ /*0x050b*/ 418,
+ /*0x1e81*/ 541,
+ /*0x1e01*/ 477,
+ /*0x0481*/ 353,
+ /*0x0101*/ 56,
+ /*0x2c81*/ 768,
+ /*0x0201*/ 165,
+ /*0x0501*/ 413,
+ /*0xa68f*/ 891,
+ /*0x1f10*/ 608,
+ -1,
+ /*0x1f01*/ 601,
+ /*0x1f02*/ 602,
+ /*0x0581*/ 469,
+ /*0x0582*/ 470,
+ /*0xa781*/ 939,
+ /*0x1ee1*/ 584,
+ /*0x1e61*/ 525,
+ /*0x04e1*/ 397,
+ /*0x0161*/ 102,
+ /*0x2ce1*/ 816,
+ /*0x0261*/ 210,
+ /*0x0561*/ 437,
+ /*0xa68b*/ 889,
+ /*0x0461*/ 337,
+ -1,
+ /*0x1f61*/ 641,
+ -1, -1, -1,
+ /*0xa681*/ 884,
+ /*0x1ee5*/ 586,
+ /*0x1e65*/ 527,
+ /*0x04e5*/ 399,
+ /*0x0165*/ 104,
+ /*0x1f20*/ 614,
+ /*0x0265*/ 212,
+ /*0x0565*/ 441,
+ -1,
+ /*0x0465*/ 339,
+ -1,
+ /*0x1f65*/ 645,
+ /*0x1ee3*/ 585,
+ /*0x1e63*/ 526,
+ /*0x04e3*/ 398,
+ /*0x0163*/ 103,
+ /*0x2ce3*/ 817,
+ /*0x0263*/ 211,
+ /*0x0563*/ 439,
+ -1,
+ /*0x0463*/ 338,
+ -1,
+ /*0x1f63*/ 643,
+ -1, -1, -1,
+ /*0x2c61*/ 760,
+ /*0x24e1*/ 704,
+ /*0x1ed1*/ 576,
+ /*0x1e51*/ 517,
+ /*0x04d1*/ 389,
+ /*0x0151*/ 94,
+ /*0x2cd1*/ 808,
+ /*0x0251*/ 200,
+ /*0x1fe1*/ 667,
+ /*0xa761*/ 928,
+ /*0x0451*/ 322,
+ -1,
+ /*0x1f51*/ 636,
+ /*0x1f14*/ 612,
+ -1,
+ /*0x2c65*/ 761,
+ /*0x24e5*/ 708,
+ -1,
+ /*0x017e*/ 116,
+ -1, -1,
+ /*0x057e*/ 466,
+ -1,
+ /*0x1fe5*/ 668,
+ /*0xa765*/ 930,
+ -1,
+ /*0x03ae*/ 241,
+ /*0x24e3*/ 706,
+ /*0x1ed7*/ 579,
+ /*0x1e57*/ 520,
+ /*0x04d7*/ 392,
+ /*0x0157*/ 97,
+ /*0x2cd7*/ 811,
+ /*0x0257*/ 205,
+ /*0x03ac*/ 239,
+ /*0xa763*/ 929,
+ /*0x0457*/ 328,
+ /*0x1f04*/ 604,
+ /*0x1f57*/ 639,
+ /*0x0584*/ 472,
+ /*0x0280*/ 223,
+ -1,
+ /*0x2c51*/ 746,
+ /*0x24d1*/ 688,
+ /*0x1ed3*/ 577,
+ /*0x1e53*/ 518,
+ /*0x04d3*/ 390,
+ /*0x0153*/ 95,
+ /*0x2cd3*/ 809,
+ /*0x0253*/ 202,
+ /*0x1fd1*/ 665,
+ /*0xa751*/ 920,
+ /*0x0453*/ 324,
+ /*0x028a*/ 228,
+ /*0x1f53*/ 637,
+ /*0x1ee9*/ 588,
+ /*0x1e69*/ 529,
+ /*0x04e9*/ 401,
+ /*0x0169*/ 106,
+ -1,
+ /*0x0269*/ 215,
+ /*0x0569*/ 445,
+ -1,
+ /*0x0469*/ 341,
+ /*0x1ee7*/ 587,
+ /*0x1e67*/ 528,
+ /*0x04e7*/ 400,
+ /*0x0167*/ 105,
+ /*0x2c57*/ 752,
+ /*0x24d7*/ 694,
+ /*0x0567*/ 443,
+ /*0x028b*/ 229,
+ /*0x0467*/ 340,
+ /*0xa661*/ 877,
+ /*0x1f67*/ 647,
+ /*0x03e1*/ 277,
+ -1,
+ /*0xa757*/ 923,
+ /*0x1ed9*/ 580,
+ /*0x1e59*/ 521,
+ /*0x04d9*/ 393,
+ /*0x0159*/ 98,
+ /*0x2cd9*/ 812,
+ /*0x0259*/ 206,
+ /*0x2c53*/ 748,
+ /*0x24d3*/ 690,
+ /*0x0459*/ 330,
+ -1,
+ /*0xa665*/ 879,
+ -1,
+ /*0x03e5*/ 279,
+ -1, -1,
+ /*0xa753*/ 921,
+ -1,
+ /*0x2cee*/ 819,
+ /*0x24e9*/ 712,
+ /*0x056e*/ 450,
+ -1,
+ /*0xa663*/ 878,
+ /*0x029e*/ 232,
+ /*0x03e3*/ 278,
+ -1,
+ /*0x10428*/ 982,
+ /*0xa769*/ 932,
+ /*0x24e7*/ 710,
+ /*0x1edb*/ 581,
+ /*0x1e5b*/ 522,
+ /*0x04db*/ 394,
+ /*0x015b*/ 99,
+ /*0x2cdb*/ 813,
+ /*0x025b*/ 207,
+ /*0x0574*/ 456,
+ /*0xa767*/ 931,
+ /*0x045b*/ 332,
+ /*0xa651*/ 869,
+ /*0x1f74*/ 652,
+ /*0x1042e*/ 988,
+ /*0x2c59*/ 754,
+ /*0x24d9*/ 696,
+ /*0x1ed5*/ 578,
+ /*0x1e55*/ 519,
+ /*0x04d5*/ 391,
+ /*0x0155*/ 96,
+ /*0x2cd5*/ 810,
+ /*0x1042c*/ 986,
+ /*0x01a8*/ 130,
+ /*0xa759*/ 924,
+ /*0x0455*/ 326,
+ /*0x1042a*/ 984,
+ /*0x1f55*/ 638,
+ /*0x1edd*/ 582,
+ /*0x1e5d*/ 523,
+ /*0x04dd*/ 395,
+ /*0x015d*/ 100,
+ /*0x2cdd*/ 814,
+ /*0x0180*/ 117,
+ /*0x013e*/ 85,
+ -1,
+ /*0x045d*/ 334,
+ -1,
+ /*0xa657*/ 872,
+ /*0x043e*/ 303,
+ /*0x03d7*/ 272,
+ -1,
+ /*0x217e*/ 684,
+ /*0x2c5b*/ 756,
+ /*0x24db*/ 698,
+ /*0x1ecf*/ 575,
+ /*0x1e4f*/ 516,
+ /*0x04cf*/ 388,
+ /*0x014f*/ 93,
+ /*0x2ccf*/ 807,
+ /*0x024f*/ 198,
+ -1,
+ /*0xa75b*/ 925,
+ /*0x044f*/ 320,
+ /*0xa653*/ 870,
+ /*0x0061*/ 0,
+ -1,
+ /*0x2c55*/ 750,
+ /*0x24d5*/ 692,
+ -1,
+ /*0x0570*/ 452,
+ -1, -1,
+ /*0x019a*/ 125,
+ /*0x1f70*/ 648,
+ /*0xa669*/ 881,
+ /*0xa755*/ 922,
+ /*0x03e9*/ 281,
+ /*0x2c5d*/ 758,
+ /*0x24dd*/ 700,
+ /*0x0065*/ 4,
+ /*0x2c3e*/ 727,
+ -1,
+ /*0x013c*/ 84,
+ /*0xa667*/ 880,
+ /*0x023c*/ 190,
+ /*0x03e7*/ 280,
+ /*0xa75d*/ 926,
+ /*0x043c*/ 301,
+ /*0x1ecd*/ 574,
+ /*0x1e4d*/ 515,
+ /*0x0063*/ 2,
+ /*0x014d*/ 92,
+ /*0x2ccd*/ 806,
+ /*0x024d*/ 197,
+ /*0x2c4f*/ 744,
+ /*0x01e1*/ 151,
+ /*0x044d*/ 318,
+ /*0xa659*/ 873,
+ -1,
+ /*0x03d9*/ 273,
+ -1, -1,
+ /*0x019e*/ 126,
+ /*0xa74f*/ 919,
+ /*0x1ecb*/ 573,
+ /*0x1e4b*/ 514,
+ -1,
+ /*0x014b*/ 91,
+ /*0x2ccb*/ 805,
+ /*0x024b*/ 196,
+ /*0x01e5*/ 153,
+ /*0xa78c*/ 943,
+ /*0x044b*/ 316,
+ -1,
+ /*0x1ef3*/ 593,
+ /*0x1e73*/ 534,
+ /*0x04f3*/ 406,
+ /*0x0173*/ 111,
+ /*0x2cf3*/ 820,
+ /*0x2c3c*/ 725,
+ /*0x0573*/ 455,
+ /*0x01e3*/ 152,
+ /*0x0473*/ 346,
+ -1,
+ /*0x1f73*/ 651,
+ /*0xa65b*/ 874,
+ -1,
+ /*0x03db*/ 274,
+ /*0x2c4d*/ 742,
+ -1,
+ /*0x1eeb*/ 589,
+ /*0x1e6b*/ 530,
+ /*0x04eb*/ 402,
+ /*0x016b*/ 107,
+ -1,
+ /*0x026b*/ 216,
+ /*0x056b*/ 447,
+ /*0xa74d*/ 918,
+ /*0x046b*/ 342,
+ /*0xa655*/ 871,
+ -1,
+ /*0x0140*/ 86,
+ /*0x2174*/ 674,
+ /*0x0240*/ 192,
+ /*0x2c4b*/ 740,
+ /*0x118d1*/ 1039,
+ /*0x0440*/ 305,
+ /*0x0564*/ 440,
+ /*0x1f40*/ 630,
+ -1,
+ /*0xa65d*/ 875,
+ /*0x1f64*/ 644,
+ /*0x03dd*/ 275,
+ /*0xa74b*/ 917,
+ /*0x2c73*/ 766,
+ /*0x03be*/ 256,
+ /*0x1ec9*/ 572,
+ /*0x1e49*/ 513,
+ -1,
+ /*0x0069*/ 1054,
+ /*0x2cc9*/ 804,
+ /*0x0249*/ 195,
+ /*0x1ec5*/ 570,
+ /*0x1e45*/ 511,
+ /*0x0449*/ 314,
+ -1,
+ /*0x2cc5*/ 802,
+ /*0xa64f*/ 868,
+ /*0x0067*/ 6,
+ -1,
+ /*0x0445*/ 310,
+ /*0x118d7*/ 1045,
+ /*0x1f45*/ 635,
+ /*0x1edf*/ 583,
+ /*0x1e5f*/ 524,
+ /*0x04df*/ 396,
+ /*0x015f*/ 101,
+ /*0x2cdf*/ 815,
+ /*0x2c40*/ 729,
+ /*0xa76b*/ 933,
+ -1,
+ /*0x045f*/ 336,
+ /*0x24e4*/ 707,
+ -1,
+ /*0x1ec7*/ 571,
+ /*0x1e47*/ 512,
+ /*0x0288*/ 226,
+ /*0x118d3*/ 1041,
+ /*0x2cc7*/ 803,
+ /*0x0247*/ 194,
+ /*0x01e9*/ 155,
+ -1,
+ /*0x0447*/ 312,
+ /*0x2170*/ 670,
+ /*0x03bc*/ 254,
+ /*0x006e*/ 12,
+ /*0x2c49*/ 738,
+ -1, -1,
+ /*0x01e7*/ 154,
+ -1,
+ /*0xa64d*/ 867,
+ /*0x2c45*/ 734,
+ /*0x03cd*/ 270,
+ -1,
+ /*0xa749*/ 916,
+ -1, -1,
+ /*0x1ec3*/ 569,
+ /*0x1e43*/ 510,
+ /*0x0074*/ 18,
+ /*0xa745*/ 914,
+ /*0x2cc3*/ 801,
+ -1,
+ /*0x24df*/ 702,
+ /*0x013a*/ 83,
+ /*0x0443*/ 308,
+ /*0xa64b*/ 866,
+ /*0x1f43*/ 633,
+ /*0x03cb*/ 268,
+ /*0x043a*/ 299,
+ /*0x118d9*/ 1047,
+ /*0xa75f*/ 927,
+ -1,
+ /*0x2c47*/ 736,
+ -1, -1,
+ /*0x1ec1*/ 568,
+ /*0x1e41*/ 509,
+ /*0x03f3*/ 286,
+ /*0x028c*/ 230,
+ /*0x2cc1*/ 800,
+ -1,
+ /*0xa747*/ 915,
+ -1,
+ /*0x0441*/ 306,
+ -1,
+ /*0x1f41*/ 631,
+ -1, -1, -1, -1, -1,
+ /*0xa66b*/ 882,
+ /*0x2173*/ 673,
+ /*0x03eb*/ 282,
+ /*0x1043e*/ 1004,
+ -1,
+ /*0x2c43*/ 732,
+ /*0x118db*/ 1049,
+ -1,
+ /*0x0438*/ 297,
+ /*0x2c3a*/ 723,
+ /*0x03c0*/ 258,
+ /*0xff51*/ 972,
+ -1,
+ /*0x056a*/ 446,
+ /*0xa743*/ 913,
+ -1, -1,
+ /*0x1044f*/ 1021,
+ /*0x0070*/ 14,
+ -1,
+ /*0x118d5*/ 1043,
+ -1,
+ /*0x017a*/ 114,
+ /*0x01dd*/ 149,
+ /*0x2c41*/ 730,
+ /*0x057a*/ 462,
+ /*0xa649*/ 865,
+ -1,
+ /*0x03c9*/ 266,
+ /*0x1f7a*/ 658,
+ -1,
+ /*0x118dd*/ 1051,
+ /*0xa645*/ 863,
+ /*0xa741*/ 912,
+ /*0x03c5*/ 262,
+ -1, -1,
+ /*0xff57*/ 978,
+ -1,
+ /*0x0188*/ 120,
+ /*0x2c38*/ 721,
+ -1,
+ /*0x1043c*/ 1002,
+ /*0xa65f*/ 876,
+ -1,
+ /*0x03df*/ 276,
+ -1,
+ /*0x2c6a*/ 764,
+ /*0x118cf*/ 1037,
+ -1, -1,
+ /*0x1044d*/ 1019,
+ -1,
+ /*0xff53*/ 974,
+ /*0xa647*/ 864,
+ -1,
+ /*0x03c7*/ 264,
+ /*0x1ead*/ 558,
+ /*0x1e2d*/ 499,
+ /*0x04ad*/ 371,
+ /*0x012d*/ 78,
+ /*0x2cad*/ 790,
+ /*0x022d*/ 186,
+ /*0x052d*/ 435,
+ -1, -1, -1,
+ /*0x1044b*/ 1017,
+ /*0xa77a*/ 936,
+ /*0x0073*/ 17,
+ -1,
+ /*0x1eb3*/ 561,
+ /*0x1e33*/ 502,
+ /*0x04b3*/ 374,
+ /*0x0133*/ 80,
+ /*0x2cb3*/ 793,
+ /*0x0233*/ 189,
+ -1,
+ /*0xa643*/ 862,
+ /*0x0433*/ 292,
+ /*0x03c3*/ 260,
+ /*0x1f33*/ 625,
+ /*0x118cd*/ 1035,
+ /*0x018c*/ 121,
+ /*0x03ba*/ 252,
+ /*0x006b*/ 9,
+ /*0x2d1b*/ 848,
+ /*0xff59*/ 980,
+ /*0x2cec*/ 818,
+ /*0x026c*/ 217,
+ /*0x056c*/ 448,
+ /*0x2d24*/ 857,
+ /*0x2d00*/ 821,
+ /*0x2d11*/ 838,
+ /*0x2d18*/ 845,
+ /*0x2d22*/ 855,
+ /*0x0064*/ 3,
+ /*0xa641*/ 861,
+ /*0x118cb*/ 1033,
+ /*0x03c1*/ 259,
+ /*0x01f3*/ 159,
+ /*0x10440*/ 1006,
+ /*0x2d16*/ 843,
+ -1, -1,
+ /*0x2d0a*/ 831,
+ /*0xa72d*/ 903,
+ /*0x2d06*/ 827,
+ /*0x2d0f*/ 836,
+ -1,
+ /*0x0250*/ 199,
+ /*0x2c33*/ 716,
+ -1,
+ /*0x0450*/ 321,
+ -1,
+ /*0x03b8*/ 250,
+ /*0x01eb*/ 156,
+ -1, -1,
+ /*0x10449*/ 1015,
+ /*0xa733*/ 905,
+ -1,
+ /*0x2d1a*/ 847,
+ /*0x2d0b*/ 832,
+ /*0x2c6c*/ 765,
+ /*0x10445*/ 1011,
+ -1, -1,
+ /*0x2d10*/ 837,
+ /*0xff55*/ 976,
+ /*0x2d01*/ 822,
+ /*0x2d02*/ 823,
+ /*0x118c0*/ 1022,
+ -1,
+ /*0x1ea5*/ 554,
+ /*0x1e25*/ 495,
+ /*0x04a5*/ 367,
+ /*0x0125*/ 74,
+ /*0x2ca5*/ 786,
+ /*0x0225*/ 182,
+ /*0x0525*/ 431,
+ -1,
+ /*0x01c9*/ 139,
+ -1,
+ /*0x1f25*/ 619,
+ /*0x2c50*/ 745,
+ /*0x24d0*/ 687,
+ /*0x10447*/ 1013,
+ /*0xa7a5*/ 953,
+ /*0x217a*/ 680,
+ /*0x118c9*/ 1031,
+ /*0x0578*/ 460,
+ /*0x2d1e*/ 851,
+ /*0x1fd0*/ 664,
+ /*0x2d20*/ 853,
+ /*0x1f78*/ 656,
+ /*0x118c5*/ 1027,
+ /*0xff4f*/ 970,
+ -1,
+ /*0x01df*/ 150,
+ /*0x1ea3*/ 553,
+ /*0x1e23*/ 494,
+ /*0x04a3*/ 366,
+ /*0x0123*/ 73,
+ /*0x2ca3*/ 785,
+ /*0x0223*/ 181,
+ /*0x0523*/ 430,
+ /*0x118df*/ 1053,
+ /*0x0266*/ 213,
+ /*0x0566*/ 442,
+ /*0x1f23*/ 617,
+ /*0x10443*/ 1009,
+ /*0x03ad*/ 240,
+ /*0x1f66*/ 646,
+ /*0xa7a3*/ 952,
+ /*0x1043a*/ 1000,
+ -1, -1,
+ /*0x118c7*/ 1029,
+ /*0x1eef*/ 591,
+ /*0x1e6f*/ 532,
+ /*0x04ef*/ 404,
+ /*0x016f*/ 109,
+ /*0xa725*/ 899,
+ /*0x026f*/ 218,
+ /*0x056f*/ 451,
+ /*0x03b3*/ 245,
+ /*0x046f*/ 344,
+ /*0x2d14*/ 841,
+ -1,
+ /*0x10441*/ 1007,
+ /*0xff4d*/ 968,
+ /*0x2d0e*/ 835,
+ /*0x1eed*/ 590,
+ /*0x1e6d*/ 531,
+ /*0x04ed*/ 403,
+ /*0x016d*/ 108,
+ -1, -1,
+ /*0x056d*/ 449,
+ -1,
+ /*0x046d*/ 343,
+ /*0x118c3*/ 1025,
+ /*0x2c66*/ 762,
+ /*0x24e6*/ 709,
+ /*0x006a*/ 8,
+ /*0x10438*/ 998,
+ /*0xff4b*/ 966,
+ -1,
+ /*0xa723*/ 898,
+ /*0x1e85*/ 543,
+ /*0x1e05*/ 479,
+ /*0x2d04*/ 825,
+ /*0x0105*/ 58,
+ /*0x2c85*/ 770,
+ /*0x0205*/ 167,
+ /*0x0505*/ 415,
+ /*0x007a*/ 24,
+ -1, -1,
+ /*0x1f05*/ 605,
+ /*0x118c1*/ 1023,
+ /*0x0585*/ 473,
+ -1,
+ /*0xa785*/ 941,
+ /*0x0373*/ 234,
+ /*0x1e83*/ 542,
+ /*0x1e03*/ 478,
+ /*0xa76f*/ 935,
+ /*0x0103*/ 57,
+ /*0x2c83*/ 769,
+ /*0x0203*/ 166,
+ /*0x0503*/ 414,
+ /*0x0576*/ 458,
+ -1, -1,
+ /*0x1f03*/ 603,
+ /*0x1f76*/ 654,
+ /*0x0583*/ 471,
+ /*0xa685*/ 886,
+ /*0xa783*/ 940,
+ -1,
+ /*0xa76d*/ 934,
+ /*0x1ebf*/ 567,
+ /*0x1e3f*/ 508,
+ /*0x04bf*/ 380,
+ -1,
+ /*0x2cbf*/ 799,
+ /*0x023f*/ 191,
+ -1, -1,
+ /*0x043f*/ 304,
+ -1, -1, -1,
+ /*0xa683*/ 885,
+ /*0x1efd*/ 598,
+ /*0x1e7d*/ 539,
+ /*0x04fd*/ 411,
+ /*0xff49*/ 964,
+ /*0x03f8*/ 287,
+ /*0x027d*/ 222,
+ /*0x057d*/ 465,
+ /*0x1042d*/ 987,
+ /*0x047d*/ 351,
+ /*0xff45*/ 960,
+ /*0x1f7d*/ 661,
+ /*0x2c76*/ 767,
+ -1, -1,
+ /*0x1eb7*/ 563,
+ /*0x1e37*/ 504,
+ /*0x04b7*/ 376,
+ /*0x0137*/ 82,
+ /*0x2cb7*/ 795,
+ /*0x2178*/ 678,
+ /*0x1d7d*/ 476,
+ /*0x10433*/ 993,
+ /*0x0437*/ 296,
+ -1,
+ /*0x1f37*/ 629,
+ -1,
+ /*0x006c*/ 10,
+ /*0x2c3f*/ 728,
+ -1, -1,
+ /*0x01ad*/ 131,
+ /*0xff47*/ 962,
+ -1, -1, -1, -1,
+ /*0xa73f*/ 911,
+ -1,
+ /*0x03ef*/ 284,
+ /*0x1eb5*/ 562,
+ /*0x1e35*/ 503,
+ /*0x04b5*/ 375,
+ /*0x0135*/ 81,
+ /*0x2cb5*/ 794,
+ -1,
+ /*0x04c2*/ 381,
+ /*0x0142*/ 87,
+ /*0x0435*/ 294,
+ /*0x0242*/ 193,
+ /*0x1f35*/ 627,
+ /*0xa66d*/ 883,
+ /*0x0442*/ 307,
+ /*0x03ed*/ 283,
+ /*0x1f42*/ 632,
+ /*0x2c37*/ 720,
+ /*0xff43*/ 958,
+ /*0x1eb1*/ 560,
+ /*0x1e31*/ 501,
+ /*0x04b1*/ 373,
+ -1,
+ /*0x2cb1*/ 792,
+ /*0x0231*/ 188,
+ -1,
+ /*0xa737*/ 907,
+ /*0x0431*/ 290,
+ -1,
+ /*0x1f31*/ 623,
+ /*0x1ea7*/ 555,
+ /*0x1e27*/ 496,
+ /*0x04a7*/ 368,
+ /*0x0127*/ 75,
+ /*0x2ca7*/ 787,
+ /*0x0227*/ 183,
+ /*0x0527*/ 432,
+ /*0xff41*/ 956,
+ -1,
+ /*0x2d08*/ 829,
+ /*0x1f27*/ 621,
+ /*0x01d0*/ 142,
+ /*0x2c35*/ 718,
+ -1,
+ /*0xa7a7*/ 954,
+ /*0x00e1*/ 26,
+ /*0x2c42*/ 731,
+ /*0x2184*/ 686,
+ -1,
+ /*0x118d0*/ 1038,
+ /*0x0078*/ 22,
+ /*0xa735*/ 906,
+ /*0x1e95*/ 551,
+ /*0x1e15*/ 487,
+ /*0x0495*/ 359,
+ /*0x0115*/ 66,
+ /*0x2c95*/ 778,
+ /*0x0215*/ 175,
+ /*0x0515*/ 423,
+ /*0x2c31*/ 714,
+ /*0x00e5*/ 30,
+ -1,
+ /*0x1f15*/ 613,
+ -1,
+ /*0x2176*/ 676,
+ /*0x03bf*/ 257,
+ /*0x0283*/ 224,
+ /*0x1fb1*/ 663,
+ /*0x0066*/ 5,
+ -1,
+ /*0x01a5*/ 129,
+ /*0x00e3*/ 28,
+ /*0x1e93*/ 550,
+ /*0x1e13*/ 486,
+ /*0x0493*/ 358,
+ /*0x0113*/ 65,
+ /*0x2c93*/ 777,
+ /*0x0213*/ 174,
+ /*0x0513*/ 422,
+ /*0xa727*/ 900,
+ -1,
+ /*0xa695*/ 894,
+ /*0x1f13*/ 611,
+ /*0x2d0c*/ 833,
+ /*0x006f*/ 13,
+ -1,
+ /*0xa793*/ 945,
+ -1,
+ /*0x1f12*/ 610,
+ /*0x1ef9*/ 596,
+ /*0x1e79*/ 537,
+ /*0x04f9*/ 409,
+ /*0x03b7*/ 249,
+ /*0x217d*/ 683,
+ -1,
+ /*0x0579*/ 461,
+ /*0x01a3*/ 128,
+ /*0x0479*/ 349,
+ /*0x006d*/ 11,
+ /*0x1f79*/ 657,
+ /*0x00fe*/ 54,
+ /*0xa693*/ 893,
+ /*0x1ef5*/ 594,
+ /*0x1e75*/ 535,
+ /*0x04f5*/ 407,
+ /*0x0175*/ 112,
+ -1,
+ /*0x0275*/ 221,
+ /*0x0575*/ 457,
+ /*0x1d79*/ 475,
+ /*0x0475*/ 347,
+ -1,
+ /*0x1f75*/ 653,
+ -1, -1,
+ /*0x01ef*/ 158,
+ -1,
+ /*0x03b5*/ 247,
+ /*0x1ef1*/ 592,
+ /*0x1e71*/ 533,
+ /*0x04f1*/ 405,
+ /*0x0171*/ 110,
+ -1,
+ /*0x0271*/ 219,
+ /*0x0571*/ 453,
+ -1,
+ /*0x0471*/ 345,
+ -1,
+ /*0x1f71*/ 649,
+ /*0x01ed*/ 157,
+ -1, -1,
+ /*0x0076*/ 20,
+ -1,
+ /*0x03b1*/ 243,
+ -1, -1, -1,
+ /*0x1e87*/ 544,
+ /*0x1e07*/ 480,
+ /*0x00e9*/ 34,
+ /*0x0107*/ 59,
+ /*0x2c87*/ 771,
+ /*0x0207*/ 168,
+ /*0x0507*/ 416,
+ /*0x045a*/ 331,
+ /*0x0185*/ 119,
+ -1,
+ /*0x1f07*/ 607,
+ /*0x00e7*/ 32,
+ -1, -1,
+ /*0xa787*/ 942,
+ /*0x1ebd*/ 566,
+ /*0x1e3d*/ 507,
+ /*0x04bd*/ 379,
+ /*0x1043f*/ 1005,
+ /*0x2cbd*/ 798,
+ /*0xff50*/ 971,
+ -1, -1,
+ /*0x043d*/ 302,
+ /*0x0183*/ 118,
+ -1,
+ /*0x1eb9*/ 564,
+ /*0x1e39*/ 505,
+ /*0x04b9*/ 377,
+ /*0xa687*/ 887,
+ /*0x2cb9*/ 796,
+ /*0x04ce*/ 387,
+ -1, -1,
+ /*0x0439*/ 298,
+ -1, -1,
+ /*0x044e*/ 319,
+ /*0x00ee*/ 39,
+ /*0x2c5a*/ 755,
+ /*0x24da*/ 697,
+ /*0x01bf*/ 137,
+ -1, -1, -1,
+ /*0x10437*/ 997,
+ /*0x1eaf*/ 559,
+ /*0x1e2f*/ 500,
+ /*0x04af*/ 372,
+ /*0x012f*/ 79,
+ /*0x2caf*/ 791,
+ /*0x022f*/ 187,
+ /*0x052f*/ 436,
+ /*0x00f4*/ 45,
+ /*0x01fd*/ 163,
+ /*0x2c3d*/ 726,
+ -1,
+ /*0x1ea9*/ 556,
+ /*0x1e29*/ 497,
+ /*0x04a9*/ 369,
+ /*0x0129*/ 76,
+ /*0x2ca9*/ 788,
+ /*0x0229*/ 184,
+ /*0x0529*/ 433,
+ /*0xa73d*/ 910,
+ -1,
+ /*0x2c39*/ 722,
+ /*0x0272*/ 220,
+ /*0x0572*/ 454,
+ /*0x2c4e*/ 743,
+ /*0x10435*/ 995,
+ /*0xa7a9*/ 955,
+ /*0x1f72*/ 650,
+ /*0x0292*/ 231,
+ /*0x10442*/ 1008,
+ /*0xa739*/ 908,
+ /*0x1ea1*/ 552,
+ /*0x1e21*/ 493,
+ /*0x04a1*/ 365,
+ /*0x0121*/ 72,
+ /*0x2ca1*/ 784,
+ /*0x2179*/ 679,
+ /*0x0521*/ 429,
+ /*0x1efb*/ 597,
+ /*0x1e7b*/ 538,
+ /*0x04fb*/ 410,
+ /*0x1f21*/ 615,
+ /*0x10431*/ 991,
+ /*0x0562*/ 438,
+ /*0x057b*/ 463,
+ /*0xa7a1*/ 951,
+ /*0x047b*/ 350,
+ /*0x1f62*/ 642,
+ /*0x1f7b*/ 659,
+ /*0x2175*/ 675,
+ /*0xa72f*/ 904,
+ /*0x1e19*/ 489,
+ /*0x0499*/ 361,
+ /*0x0119*/ 68,
+ /*0x2c99*/ 780,
+ /*0x0219*/ 177,
+ /*0x0519*/ 425,
+ /*0x04c6*/ 383,
+ /*0x0146*/ 89,
+ /*0x00f0*/ 41,
+ /*0x118c2*/ 1024,
+ /*0xa729*/ 901,
+ -1,
+ /*0x0446*/ 311,
+ /*0xa799*/ 947,
+ /*0x2171*/ 671,
+ /*0x1ef7*/ 595,
+ /*0x1e77*/ 536,
+ /*0x04f7*/ 408,
+ /*0x0177*/ 113,
+ /*0x0268*/ 214,
+ /*0x0568*/ 444,
+ /*0x0577*/ 459,
+ -1,
+ /*0x0477*/ 348,
+ -1,
+ /*0x1f77*/ 655,
+ -1,
+ /*0x24e2*/ 705,
+ /*0xa699*/ 896,
+ -1,
+ /*0x1eff*/ 599,
+ /*0x1e7f*/ 540,
+ /*0x04ff*/ 412,
+ /*0x04cc*/ 386,
+ /*0x03bd*/ 255,
+ -1,
+ /*0x057f*/ 467,
+ /*0x0287*/ 225,
+ /*0x047f*/ 352,
+ /*0x044c*/ 317,
+ /*0x04c8*/ 384,
+ /*0x0148*/ 90,
+ -1, -1,
+ /*0x2c46*/ 735,
+ /*0x03b9*/ 251,
+ /*0x0448*/ 313,
+ /*0x0195*/ 123,
+ /*0x03ce*/ 271,
+ -1,
+ /*0x04c4*/ 382,
+ /*0x0144*/ 88,
+ /*0x2d2d*/ 860,
+ /*0x0079*/ 23,
+ /*0x2c68*/ 763,
+ /*0x24e8*/ 711,
+ /*0x0444*/ 309,
+ -1,
+ /*0x1f44*/ 634,
+ /*0x00f3*/ 44,
+ /*0x1ebb*/ 565,
+ /*0x1e3b*/ 506,
+ /*0x04bb*/ 378,
+ /*0x214e*/ 669,
+ /*0x2cbb*/ 797,
+ /*0x03af*/ 242,
+ /*0x0075*/ 19,
+ -1,
+ /*0x043b*/ 300,
+ -1, -1,
+ /*0x2c4c*/ 741,
+ -1,
+ /*0x0192*/ 122,
+ -1,
+ /*0x00eb*/ 36,
+ -1,
+ /*0x2d1c*/ 849,
+ /*0x2c48*/ 737,
+ /*0xa77f*/ 938,
+ -1,
+ /*0x03f2*/ 285,
+ /*0x0071*/ 15,
+ /*0x037d*/ 238,
+ /*0x01f9*/ 161,
+ -1,
+ /*0x00e4*/ 29,
+ -1,
+ /*0x2c44*/ 733,
+ /*0x1eab*/ 557,
+ /*0x1e2b*/ 498,
+ /*0x04ab*/ 370,
+ /*0x012b*/ 77,
+ /*0x2cab*/ 789,
+ /*0x022b*/ 185,
+ /*0x052b*/ 434,
+ /*0x2172*/ 672,
+ /*0x01f5*/ 160,
+ /*0x0256*/ 204,
+ -1,
+ /*0x2c3b*/ 724,
+ /*0x0456*/ 327,
+ /*0x03fb*/ 288,
+ /*0x1e17*/ 488,
+ /*0x0497*/ 360,
+ /*0x0117*/ 67,
+ /*0x2c97*/ 779,
+ /*0x0217*/ 176,
+ /*0x0517*/ 424,
+ /*0xa73b*/ 909,
+ /*0x1e1f*/ 492,
+ /*0x049f*/ 364,
+ /*0x011f*/ 71,
+ /*0x2c9f*/ 783,
+ /*0x021f*/ 180,
+ /*0x051f*/ 428,
+ /*0xa797*/ 946,
+ /*0x217b*/ 681,
+ /*0xff42*/ 957,
+ /*0x03c6*/ 263,
+ -1, -1,
+ /*0x0436*/ 295,
+ /*0xa79f*/ 950,
+ /*0x1f36*/ 628,
+ /*0x1043d*/ 1003,
+ -1, -1, -1,
+ /*0x2d25*/ 858,
+ -1,
+ /*0xa697*/ 895,
+ /*0x01da*/ 147,
+ /*0x2c56*/ 751,
+ /*0x24d6*/ 693,
+ -1,
+ /*0x10439*/ 999,
+ -1,
+ /*0xa72b*/ 902,
+ /*0x1044e*/ 1020,
+ /*0x118da*/ 1048,
+ -1, -1, -1, -1,
+ /*0x2177*/ 677,
+ /*0x03cc*/ 269,
+ -1,
+ /*0x01bd*/ 136,
+ -1, -1, -1, -1,
+ /*0x03c8*/ 265,
+ /*0x2c36*/ 719,
+ /*0x2d23*/ 856,
+ /*0x1042f*/ 989,
+ -1,
+ /*0x0254*/ 203,
+ /*0x01b9*/ 135,
+ /*0x217f*/ 685,
+ /*0x0454*/ 325,
+ /*0x01ce*/ 141,
+ /*0x03c4*/ 261,
+ /*0x0072*/ 16,
+ -1, -1,
+ /*0x10429*/ 983,
+ /*0x1e89*/ 545,
+ /*0x1e09*/ 481,
+ /*0x118ce*/ 1036,
+ /*0x0109*/ 60,
+ /*0x2c89*/ 772,
+ /*0x0209*/ 169,
+ /*0x0509*/ 417,
+ /*0x03bb*/ 253,
+ -1,
+ /*0x1e8d*/ 547,
+ /*0x1e0d*/ 483,
+ /*0x048d*/ 355,
+ /*0x010d*/ 62,
+ /*0x2c8d*/ 774,
+ /*0x020d*/ 171,
+ /*0x050d*/ 419,
+ /*0x0062*/ 1,
+ /*0x1e1d*/ 491,
+ /*0x049d*/ 363,
+ /*0x011d*/ 70,
+ /*0x2c9d*/ 782,
+ /*0x021d*/ 179,
+ /*0x051d*/ 427,
+ -1,
+ /*0x0458*/ 329,
+ /*0x2c54*/ 749,
+ /*0x24d4*/ 691,
+ /*0x00ea*/ 35,
+ /*0x0252*/ 201,
+ /*0xa689*/ 888,
+ /*0xa79d*/ 949,
+ /*0x0452*/ 323,
+ /*0x025c*/ 208,
+ -1,
+ /*0x04ca*/ 385,
+ /*0x045c*/ 333,
+ -1,
+ /*0x2d05*/ 826,
+ /*0xa68d*/ 890,
+ /*0x00fa*/ 50,
+ /*0x044a*/ 315,
+ /*0x01a1*/ 127,
+ /*0x10446*/ 1012,
+ /*0x017c*/ 115,
+ /*0x0068*/ 7,
+ /*0x0077*/ 21,
+ /*0x057c*/ 464,
+ -1,
+ /*0x01fb*/ 162,
+ -1,
+ /*0x1f7c*/ 660,
+ -1,
+ /*0x0434*/ 293,
+ /*0x2d03*/ 824,
+ /*0x1f34*/ 626,
+ /*0x045e*/ 335,
+ /*0x2c58*/ 753,
+ /*0x24d8*/ 695,
+ -1, -1,
+ /*0x0199*/ 124,
+ /*0x03b6*/ 248,
+ -1,
+ /*0x2c52*/ 747,
+ /*0x24d2*/ 689,
+ /*0x01c6*/ 138,
+ /*0x0260*/ 209,
+ /*0x2c5c*/ 757,
+ /*0x24dc*/ 699,
+ /*0x1044c*/ 1018,
+ /*0x0371*/ 233,
+ /*0x1f60*/ 640,
+ /*0x2c4a*/ 739,
+ /*0x118c6*/ 1028,
+ -1, -1,
+ /*0x10448*/ 1014,
+ -1, -1, -1,
+ /*0x0430*/ 289,
+ /*0xff5a*/ 981,
+ /*0x1f30*/ 622,
+ /*0x0432*/ 291,
+ /*0x2c34*/ 717,
+ /*0x1f32*/ 624,
+ /*0x10444*/ 1010,
+ /*0x2c5e*/ 759,
+ /*0x24de*/ 701,
+ /*0xa77c*/ 937,
+ -1,
+ /*0x01ff*/ 164,
+ /*0x01cc*/ 140,
+ -1, -1, -1, -1, -1,
+ /*0x1043b*/ 1001,
+ -1,
+ /*0x118cc*/ 1034,
+ -1,
+ /*0x24e0*/ 703,
+ -1,
+ /*0x00ec*/ 37,
+ -1, -1,
+ /*0x118c8*/ 1030,
+ -1,
+ /*0x1fe0*/ 666,
+ -1,
+ /*0xff4e*/ 969,
+ /*0x2c30*/ 713,
+ -1, -1,
+ /*0x2c32*/ 715,
+ -1,
+ /*0x118c4*/ 1026,
+ -1, -1,
+ /*0x1fb0*/ 662,
+ -1, -1, -1, -1, -1, -1,
+ /*0x1042b*/ 985,
+ -1, -1, -1, -1, -1,
+ /*0x0289*/ 227,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x03ca*/ 267,
+ -1, -1,
+ /*0x2d27*/ 859,
+ -1,
+ /*0x10436*/ 996,
+ -1,
+ /*0x01d6*/ 145,
+ -1, -1, -1, -1,
+ /*0x03b4*/ 246,
+ -1, -1,
+ /*0x118d6*/ 1044,
+ -1, -1,
+ /*0x00f8*/ 48,
+ -1, -1, -1, -1,
+ /*0x217c*/ 682,
+ -1,
+ /*0x2d15*/ 842,
+ /*0x037b*/ 236,
+ -1,
+ /*0x01b6*/ 134,
+ -1, -1, -1, -1, -1, -1,
+ /*0xff46*/ 961,
+ /*0x00e6*/ 31,
+ -1, -1, -1, -1, -1, -1,
+ /*0x03b2*/ 244,
+ -1,
+ /*0x2d13*/ 840,
+ -1, -1, -1, -1, -1,
+ /*0x2d12*/ 839,
+ /*0x00ef*/ 40,
+ -1,
+ /*0x0377*/ 235,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0xff4c*/ 967,
+ -1, -1, -1,
+ /*0x00ed*/ 38,
+ /*0x01d4*/ 144,
+ -1,
+ /*0xff48*/ 963,
+ -1, -1, -1, -1, -1,
+ /*0x118d4*/ 1042,
+ -1, -1, -1,
+ /*0xff44*/ 959,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0x1044a*/ 1016,
+ -1, -1, -1, -1, -1, -1,
+ /*0x01d8*/ 146,
+ -1,
+ /*0x00f6*/ 47,
+ -1, -1,
+ /*0x10434*/ 994,
+ -1,
+ /*0x01d2*/ 143,
+ /*0x118d8*/ 1046,
+ -1, -1,
+ /*0x01dc*/ 148,
+ -1,
+ /*0x2d07*/ 828,
+ -1,
+ /*0x118d2*/ 1040,
+ -1, -1, -1,
+ /*0x118dc*/ 1050,
+ -1, -1, -1, -1,
+ /*0x118ca*/ 1032,
+ -1,
+ /*0xff56*/ 977,
+ -1,
+ /*0x01b4*/ 133,
+ -1, -1,
+ /*0x00fd*/ 53,
+ -1,
+ /*0x10430*/ 990,
+ -1, -1,
+ /*0x10432*/ 992,
+ -1, -1,
+ /*0x118de*/ 1052,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0x01b0*/ 132,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1,
+ /*0xff54*/ 975,
+ -1, -1,
+ /*0x2d21*/ 854,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x2d19*/ 846,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0xff58*/ 979,
+ -1, -1, -1, -1, -1, -1,
+ /*0xff52*/ 973,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0xff4a*/ 965,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x037c*/ 237,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x00f9*/ 49,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x00f5*/ 46,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x00f1*/ 42,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ /*0x2d17*/ 844,
+ -1, -1, -1, -1, -1, -1,
+ /*0x2d1f*/ 852,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1,
+ /*0x00f2*/ 43,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x2d09*/ 830,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x2d0d*/ 834,
+ -1,
+ /*0x00e2*/ 27,
+ /*0x00fb*/ 51,
+ -1, -1, -1,
+ /*0x2d1d*/ 850,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ /*0x00e8*/ 33,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x00ff*/ 55,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1,
+ /*0x00fc*/ 52,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1,
+ -1, -1,
+ /*0x00e0*/ 25
+ };
+
+ 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}}},
+};
+
+/* C code produced by gperf version 3.0.3 */
+/* 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
+#ifdef __GNUC_STDC_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}}},
+};
+
+/* C code produced by gperf version 3.0.3 */
+/* 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
+#ifdef __GNUC_STDC_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
new file mode 100644
index 0000000000..80b79abc3e
--- /dev/null
+++ b/enc/unicode/name2ctype.h
@@ -0,0 +1,32679 @@
+/* C code produced by gperf version 3.0.3 */
+/* 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' */
+#else /* USE_UNICODE_PROPERTIES */
+/* Computed positions: -k'1-3,5-6,12,16,$' */
+#endif /* USE_UNICODE_PROPERTIES */
+
+#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
+
+
+#define long size_t
+
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 600,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e,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+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 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,
+ 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,
+ 0x16f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1ee52,
+ 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,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 8,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 50,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0de6, 0x0def,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 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[] = {
+ 605,
+ 0x0021, 0x007e,
+ 0x00a1, 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, 0x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+ 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, 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ower[] = {
+ 633,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0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cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69d,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745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 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 602,
+ 0x0020, 0x007e,
+ 0x00a0, 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, 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f,
+ 0xab64, 0xab65,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 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, 0xfffd,
+ 0x10000, 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,
+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e,
+ 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,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 155,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0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2d70,
+ 0x2e00, 0x2e2e,
+ 0x2e30, 0x2e42,
+ 0x3001, 0x3003,
+ 0x3008, 0x3011,
+ 0x3014, 0x301f,
+ 0x3030, 0x3030,
+ 0x303d, 0x303d,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 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,
+ 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[] = {
+ 10,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 627,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04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a698,
+ 0xa69a, 0xa69a,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x118a0, 0x118bf,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 629,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 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000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 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,
+ 0x1107f, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
+ 0x11180, 0x111c4,
+ 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,
+ 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,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d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ee5d,
+ 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,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 630,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0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x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1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+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 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,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11150, 0x11172,
+ 0x11176, 0x11176,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 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,
+ 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,
+ 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,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0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
+#ifdef USE_UNICODE_PROPERTIES
+/* 'Any': - */
+static const OnigCodePoint CR_Any[] = {
+ 1,
+ 0x0000, 0x10ffff,
+}; /* CR_Any */
+
+/* 'Assigned': - */
+static const OnigCodePoint CR_Assigned[] = {
+ 600,
+ 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,
+ 0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+ 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,
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0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 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, 0xfffd,
+ 0x10000, 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, 0x116c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e,
+ 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,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Assigned */
+
+/* 'C': Major Category */
+static const OnigCodePoint CR_C[] = {
+ 603,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+ 0x00ad, 0x00ad,
+ 0x0378, 0x0379,
+ 0x0380, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0530, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058c,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
+ 0x06dd, 0x06dd,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08b3, 0x08e3,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,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0x102ff,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 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,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107e,
+ 0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 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, 0x1189f,
+ 0x118f3, 0x118fe,
+ 0x11900, 0x11abf,
+ 0x11af9, 0x11fff,
+ 0x12399, 0x123ff,
+ 0x1246f, 0x1246f,
+ 0x12475, 0x12fff,
+ 0x1342f, 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, 0x1bbff,
+ 0x1bc6b, 0x1bc6f,
+ 0x1bc7d, 0x1bc7f,
+ 0x1bc89, 0x1bc8f,
+ 0x1bc9a, 0x1bc9b,
+ 0x1bca0, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d173, 0x1d17a,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1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 0x202e,
+ 0x2060, 0x2064,
+ 0x2066, 0x206f,
+ 0xfeff, 0xfeff,
+ 0xfff9, 0xfffb,
+ 0x110bd, 0x110bd,
+ 0x1bca0, 0x1bca3,
+ 0x1d173, 0x1d17a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Cf */
+
+/* 'Cn': General Category */
+static const OnigCodePoint CR_Cn[] = {
+ 600,
+ 0x0378, 0x0379,
+ 0x0380, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0530, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058c,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x061d, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08b3, 0x08e3,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 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x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f9, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191f, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae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b3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe2e, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xfefe,
+ 0xff00, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfff8,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 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,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107e,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 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, 0x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x1f37e, 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,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Cn */
+
+/* 'Co': General Category */
+static const OnigCodePoint CR_Co[] = {
+ 3,
+ 0xe000, 0xf8ff,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Co */
+
+/* 'Cs': General Category */
+static const OnigCodePoint CR_Cs[] = {
+ 1,
+ 0xd800, 0xdfff,
+}; /* CR_Cs */
+
+/* 'L': Major Category */
+static const OnigCodePoint CR_L[] = {
+ 537,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+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,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 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, 0x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xa78b, 0xa78e,
+ 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,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
+/* 'Ll': General Category */
+static const OnigCodePoint CR_Ll[] = {
+ 625,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02af,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x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653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 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x1d7cb, 0x1d7cb,
+}; /* CR_Ll */
+
+/* 'Lm': General Category */
+static const OnigCodePoint CR_Lm[] = {
+ 56,
+ 0x02b0, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0374, 0x0374,
+ 0x037a, 0x037a,
+ 0x0559, 0x0559,
+ 0x0640, 0x0640,
+ 0x06e5, 0x06e6,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0971, 0x0971,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x10fc, 0x10fc,
+ 0x17d7, 0x17d7,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c78, 0x1c7d,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2c7c, 0x2c7d,
+ 0x2d6f, 0x2d6f,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x303b, 0x303b,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 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[] = {
+ 417,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x01bb, 0x01bb,
+ 0x01c0, 0x01c3,
+ 0x0294, 0x0294,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x063f,
+ 0x0641, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x0800, 0x0815,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08b2,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0972, 0x0980,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a72, 0x0a74,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8,
+ 0x0aaa, 0x0ab0,
+ 0x0ab2, 0x0ab3,
+ 0x0ab5, 0x0ab9,
+ 0x0abd, 0x0abd,
+ 0x0ad0, 0x0ad0,
+ 0x0ae0, 0x0ae1,
+ 0x0b05,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94, 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb0,
+ 0x0eb2, 0x0eb3,
+ 0x0ebd, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f88, 0x0f8c,
+ 0x1000, 0x102a,
+ 0x103f, 0x103f,
+ 0x1050, 0x1055,
+ 0x105a, 0x105d,
+ 0x1061, 0x1061,
+ 0x1065, 0x1066,
+ 0x106e, 0x1070,
+ 0x1075, 0x1081,
+ 0x108e, 0x108e,
+ 0x10d0, 0x10fa,
+ 0x10fd, 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,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16f1, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1842,
+ 0x1844, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1950, 0x196d,
+ 0x1970, 0x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340,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 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,
+ 0x118ff, 0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1d,
+}; /* CR_Lo */
+
+/* 'Lt': General Category */
+static const OnigCodePoint CR_Lt[] = {
+ 10,
+ 0x01c5, 0x01c5,
+ 0x01c8, 0x01c8,
+ 0x01cb, 0x01cb,
+ 0x01f2, 0x01f2,
+ 0x1f88, 0x1f8f,
+ 0x1f98, 0x1f9f,
+ 0x1fa8, 0x1faf,
+ 0x1fbc, 0x1fbc,
+ 0x1fcc, 0x1fcc,
+ 0x1ffc, 0x1ffc,
+}; /* CR_Lt */
+
+/* 'Lu': General Category */
+static const OnigCodePoint CR_Lu[] = {
+ 622,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 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0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
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4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Lu */
+
+/* 'M': Major Category */
+static const OnigCodePoint CR_M[] = {
+ 229,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x0903,
+ 0x093a, 0x093c,
+ 0x093e, 0x094f,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0983,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09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a69f, 0xa69f,
+ 0xa6f0, 0xa6f1,
+ 0xa802, 0xa802,
+ 0xa806, 0xa806,
+ 0xa80b, 0xa80b,
+ 0xa823, 0xa827,
+ 0xa880, 0xa881,
+ 0xa8b4, 0xa8c4,
+ 0xa8e0, 0xa8f1,
+ 0xa926, 0xa92d,
+ 0xa947, 0xa953,
+ 0xa980, 0xa983,
+ 0xa9b3, 0xa9c0,
+ 0xa9e5, 0xa9e5,
+ 0xaa29, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4d,
+ 0xaa7b, 0xaa7d,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
+ 0xabe3, 0xabea,
+ 0xabec, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe2d,
+ 0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
+ 0x11000, 0x11002,
+ 0x11038, 0x11046,
+ 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,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, 0xaa34,
+ 0xaa4d, 0xaa4d,
+ 0xaa7b, 0xaa7b,
+ 0xaa7d, 0xaa7d,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabe4,
+ 0xabe6, 0xabe7,
+ 0xabe9, 0xabea,
+ 0xabec, 0xabec,
+ 0x11000, 0x11000,
+ 0x11002, 0x11002,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 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,
+ 0x16f51, 0x16f7e,
+ 0x1d165, 0x1d166,
+ 0x1d16d, 0x1d172,
+}; /* CR_Mc */
+
+/* 'Me': General Category */
+static const OnigCodePoint CR_Me[] = {
+ 5,
+ 0x0488, 0x0489,
+ 0x1abe, 0x1abe,
+ 0x20dd, 0x20e0,
+ 0x20e2, 0x20e4,
+ 0xa670, 0xa672,
+}; /* CR_Me */
+
+/* 'Mn': General Category */
+static const OnigCodePoint CR_Mn[] = {
+ 255,
+ 0x0300, 0x036f,
+ 0x0483, 0x0487,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf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 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4c,
+ 0xaa7c, 0xaa7c,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe2d,
+ 0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x10376, 0x1037a,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10ae5, 0x10ae6,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 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[] = {
+ 105,
+ 0x0030, 0x0039,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x09f4, 0x09f9,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0b72, 0x0b77,
+ 0x0be6, 0x0bf2,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7e,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d75,
+ 0x0de6, 0x0def,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f33,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x1369, 0x137c,
+ 0x16ee, 0x16f0,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19da,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x2182,
+ 0x2185, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa620, 0xa629,
+ 0xa6e6, 0xa6ef,
+ 0xa830, 0xa835,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xa9f0, 0xa9f9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x10107, 0x10133,
+ 0x10140, 0x10178,
+ 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,
+ 0x118e0, 0x118f2,
+ 0x12400, 0x1246e,
+ 0x16a60, 0x16a69,
+ 0x16b50, 0x16b59,
+ 0x16b5b, 0x16b61,
+ 0x1d360, 0x1d371,
+ 0x1d7ce, 0x1d7ff,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
+}; /* CR_N */
+
+/* 'Nd': General Category */
+#define CR_Nd CR_Digit
+
+/* 'Nl': General Category */
+static const OnigCodePoint CR_Nl[] = {
+ 12,
+ 0x16ee, 0x16f0,
+ 0x2160, 0x2182,
+ 0x2185, 0x2188,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0xa6e6, 0xa6ef,
+ 0x10140, 0x10174,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x12400, 0x1246e,
+}; /* CR_Nl */
+
+/* 'No': General Category */
+static const OnigCodePoint CR_No[] = {
+ 52,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x09f4, 0x09f9,
+ 0x0b72, 0x0b77,
+ 0x0bf0, 0x0bf2,
+ 0x0c78, 0x0c7e,
+ 0x0d70, 0x0d75,
+ 0x0f2a, 0x0f33,
+ 0x1369, 0x137c,
+ 0x17f0, 0x17f9,
+ 0x19da, 0x19da,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x215f,
+ 0x2189, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa830, 0xa835,
+ 0x10107, 0x10133,
+ 0x10175, 0x10178,
+ 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,
+ 0x1e8c7, 0x1e8cf,
+ 0x1f100, 0x1f10c,
+}; /* CR_No */
+
+/* 'P': Major Category */
+#define CR_P CR_Punct
+
+/* 'Pc': General Category */
+static const OnigCodePoint CR_Pc[] = {
+ 6,
+ 0x005f, 0x005f,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xff3f, 0xff3f,
+}; /* CR_Pc */
+
+/* 'Pd': General Category */
+static const OnigCodePoint CR_Pd[] = {
+ 17,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Pd */
+
+/* 'Pe': General Category */
+static const OnigCodePoint CR_Pe[] = {
+ 72,
+ 0x0029, 0x0029,
+ 0x005d, 0x005d,
+ 0x007d, 0x007d,
+ 0x0f3b, 0x0f3b,
+ 0x0f3d, 0x0f3d,
+ 0x169c, 0x169c,
+ 0x2046, 0x2046,
+ 0x207e, 0x207e,
+ 0x208e, 0x208e,
+ 0x2309, 0x2309,
+ 0x230b, 0x230b,
+ 0x232a, 0x232a,
+ 0x2769, 0x2769,
+ 0x276b, 0x276b,
+ 0x276d, 0x276d,
+ 0x276f, 0x276f,
+ 0x2771, 0x2771,
+ 0x2773, 0x2773,
+ 0x2775, 0x2775,
+ 0x27c6, 0x27c6,
+ 0x27e7, 0x27e7,
+ 0x27e9, 0x27e9,
+ 0x27eb, 0x27eb,
+ 0x27ed, 0x27ed,
+ 0x27ef, 0x27ef,
+ 0x2984, 0x2984,
+ 0x2986, 0x2986,
+ 0x2988, 0x2988,
+ 0x298a, 0x298a,
+ 0x298c, 0x298c,
+ 0x298e, 0x298e,
+ 0x2990, 0x2990,
+ 0x2992, 0x2992,
+ 0x2994, 0x2994,
+ 0x2996, 0x2996,
+ 0x2998, 0x2998,
+ 0x29d9, 0x29d9,
+ 0x29db, 0x29db,
+ 0x29fd, 0x29fd,
+ 0x2e23, 0x2e23,
+ 0x2e25, 0x2e25,
+ 0x2e27, 0x2e27,
+ 0x2e29, 0x2e29,
+ 0x3009, 0x3009,
+ 0x300b, 0x300b,
+ 0x300d, 0x300d,
+ 0x300f, 0x300f,
+ 0x3011, 0x3011,
+ 0x3015, 0x3015,
+ 0x3017, 0x3017,
+ 0x3019, 0x3019,
+ 0x301b, 0x301b,
+ 0x301e, 0x301f,
+ 0xfd3e, 0xfd3e,
+ 0xfe18, 0xfe18,
+ 0xfe36, 0xfe36,
+ 0xfe38, 0xfe38,
+ 0xfe3a, 0xfe3a,
+ 0xfe3c, 0xfe3c,
+ 0xfe3e, 0xfe3e,
+ 0xfe40, 0xfe40,
+ 0xfe42, 0xfe42,
+ 0xfe44, 0xfe44,
+ 0xfe48, 0xfe48,
+ 0xfe5a, 0xfe5a,
+ 0xfe5c, 0xfe5c,
+ 0xfe5e, 0xfe5e,
+ 0xff09, 0xff09,
+ 0xff3d, 0xff3d,
+ 0xff5d, 0xff5d,
+ 0xff60, 0xff60,
+ 0xff63, 0xff63,
+}; /* CR_Pe */
+
+/* 'Pf': General Category */
+static const OnigCodePoint CR_Pf[] = {
+ 10,
+ 0x00bb, 0x00bb,
+ 0x2019, 0x2019,
+ 0x201d, 0x201d,
+ 0x203a, 0x203a,
+ 0x2e03, 0x2e03,
+ 0x2e05, 0x2e05,
+ 0x2e0a, 0x2e0a,
+ 0x2e0d, 0x2e0d,
+ 0x2e1d, 0x2e1d,
+ 0x2e21, 0x2e21,
+}; /* CR_Pf */
+
+/* 'Pi': General Category */
+static const OnigCodePoint CR_Pi[] = {
+ 11,
+ 0x00ab, 0x00ab,
+ 0x2018, 0x2018,
+ 0x201b, 0x201c,
+ 0x201f, 0x201f,
+ 0x2039, 0x2039,
+ 0x2e02, 0x2e02,
+ 0x2e04, 0x2e04,
+ 0x2e09, 0x2e09,
+ 0x2e0c, 0x2e0c,
+ 0x2e1c, 0x2e1c,
+ 0x2e20, 0x2e20,
+}; /* CR_Pi */
+
+/* 'Po': General Category */
+static const OnigCodePoint CR_Po[] = {
+ 151,
+ 0x0021, 0x0023,
+ 0x0025, 0x0027,
+ 0x002a, 0x002a,
+ 0x002c, 0x002c,
+ 0x002e, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005c, 0x005c,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x0589,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x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 0xfe30, 0xfe30,
+ 0xfe45, 0xfe46,
+ 0xfe49, 0xfe4c,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xfe5f, 0xfe61,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff07,
+ 0xff0a, 0xff0a,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3c, 0xff3c,
+ 0xff61, 0xff61,
+ 0xff64, 0xff65,
+ 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,
+ 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[] = {
+ 75,
+ 0x0028, 0x0028,
+ 0x005b, 0x005b,
+ 0x007b, 0x007b,
+ 0x0f3a, 0x0f3a,
+ 0x0f3c, 0x0f3c,
+ 0x169b, 0x169b,
+ 0x201a, 0x201a,
+ 0x201e, 0x201e,
+ 0x2045, 0x2045,
+ 0x207d, 0x207d,
+ 0x208d, 0x208d,
+ 0x2308, 0x2308,
+ 0x230a, 0x230a,
+ 0x2329, 0x2329,
+ 0x2768, 0x2768,
+ 0x276a, 0x276a,
+ 0x276c, 0x276c,
+ 0x276e, 0x276e,
+ 0x2770, 0x2770,
+ 0x2772, 0x2772,
+ 0x2774, 0x2774,
+ 0x27c5, 0x27c5,
+ 0x27e6, 0x27e6,
+ 0x27e8, 0x27e8,
+ 0x27ea, 0x27ea,
+ 0x27ec, 0x27ec,
+ 0x27ee, 0x27ee,
+ 0x2983, 0x2983,
+ 0x2985, 0x2985,
+ 0x2987, 0x2987,
+ 0x2989, 0x2989,
+ 0x298b, 0x298b,
+ 0x298d, 0x298d,
+ 0x298f, 0x298f,
+ 0x2991, 0x2991,
+ 0x2993, 0x2993,
+ 0x2995, 0x2995,
+ 0x2997, 0x2997,
+ 0x29d8, 0x29d8,
+ 0x29da, 0x29da,
+ 0x29fc, 0x29fc,
+ 0x2e22, 0x2e22,
+ 0x2e24, 0x2e24,
+ 0x2e26, 0x2e26,
+ 0x2e28, 0x2e28,
+ 0x2e42, 0x2e42,
+ 0x3008, 0x3008,
+ 0x300a, 0x300a,
+ 0x300c, 0x300c,
+ 0x300e, 0x300e,
+ 0x3010, 0x3010,
+ 0x3014, 0x3014,
+ 0x3016, 0x3016,
+ 0x3018, 0x3018,
+ 0x301a, 0x301a,
+ 0x301d, 0x301d,
+ 0xfd3f, 0xfd3f,
+ 0xfe17, 0xfe17,
+ 0xfe35, 0xfe35,
+ 0xfe37, 0xfe37,
+ 0xfe39, 0xfe39,
+ 0xfe3b, 0xfe3b,
+ 0xfe3d, 0xfe3d,
+ 0xfe3f, 0xfe3f,
+ 0xfe41, 0xfe41,
+ 0xfe43, 0xfe43,
+ 0xfe47, 0xfe47,
+ 0xfe59, 0xfe59,
+ 0xfe5b, 0xfe5b,
+ 0xfe5d, 0xfe5d,
+ 0xff08, 0xff08,
+ 0xff3b, 0xff3b,
+ 0xff5b, 0xff5b,
+ 0xff5f, 0xff5f,
+ 0xff62, 0xff62,
+}; /* CR_Ps */
+
+/* 'S': Major Category */
+static const OnigCodePoint CR_S[] = {
+ 210,
+ 0x0024, 0x0024,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
+ 0x00ac, 0x00ac,
+ 0x00ae, 0x00b1,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x03f6, 0x03f6,
+ 0x0482, 0x0482,
+ 0x058d, 0x058f,
+ 0x0606, 0x0608,
+ 0x060b, 0x060b,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09f2, 0x09f3,
+ 0x09fa, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 0x0bfa,
+ 0x0c7f, 0x0c7f,
+ 0x0d79, 0x0d79,
+ 0x0e3f, 0x0e3f,
+ 0x0f01, 0x0f03,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
+ 0x0f1a, 0x0f1f,
+ 0x0f34, 0x0f34,
+ 0x0f36, 0x0f36,
+ 0x0f38, 0x0f38,
+ 0x0fbe, 0x0fc5,
+ 0x0fc7, 0x0fcc,
+ 0x0fce, 0x0fcf,
+ 0x0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x17db, 0x17db,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x20a0, 0x20bd,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2118,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x2140, 0x2144,
+ 0x214a, 0x214d,
+ 0x214f, 0x214f,
+ 0x2190, 0x2307,
+ 0x230c, 0x2328,
+ 0x232b, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x2767,
+ 0x2794, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x2982,
+ 0x2999, 0x29d7,
+ 0x29dc, 0x29fb,
+ 0x29fe, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x309b, 0x309c,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff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0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0bf,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0f5,
+ 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,
+}; /* CR_S */
+
+/* 'Sc': General Category */
+static const OnigCodePoint CR_Sc[] = {
+ 17,
+ 0x0024, 0x0024,
+ 0x00a2, 0x00a5,
+ 0x058f, 0x058f,
+ 0x060b, 0x060b,
+ 0x09f2, 0x09f3,
+ 0x09fb, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0bf9, 0x0bf9,
+ 0x0e3f, 0x0e3f,
+ 0x17db, 0x17db,
+ 0x20a0, 0x20bd,
+ 0xa838, 0xa838,
+ 0xfdfc, 0xfdfc,
+ 0xfe69, 0xfe69,
+ 0xff04, 0xff04,
+ 0xffe0, 0xffe1,
+ 0xffe5, 0xffe6,
+}; /* CR_Sc */
+
+/* 'Sk': General Category */
+static const OnigCodePoint CR_Sk[] = {
+ 28,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x309b, 0x309c,
+ 0xa700, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,
+ 0xab5b, 0xab5b,
+ 0xfbb2, 0xfbc1,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xffe3, 0xffe3,
+}; /* CR_Sk */
+
+/* 'Sm': General Category */
+static const OnigCodePoint CR_Sm[] = {
+ 64,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03f6, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x2118, 0x2118,
+ 0x2140, 0x2144,
+ 0x214b, 0x214b,
+ 0x2190, 0x2194,
+ 0x219a, 0x219b,
+ 0x21a0, 0x21a0,
+ 0x21a3, 0x21a3,
+ 0x21a6, 0x21a6,
+ 0x21ae, 0x21ae,
+ 0x21ce, 0x21cf,
+ 0x21d2, 0x21d2,
+ 0x21d4, 0x21d4,
+ 0x21f4, 0x22ff,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b3,
+ 0x23dc, 0x23e1,
+ 0x25b7, 0x25b7,
+ 0x25c1, 0x25c1,
+ 0x25f8, 0x25ff,
+ 0x266f, 0x266f,
+ 0x27c0, 0x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0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2117,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x214a, 0x214a,
+ 0x214c, 0x214d,
+ 0x214f, 0x214f,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21ad,
+ 0x21af, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21f3,
+ 0x2300, 0x2307,
+ 0x230c, 0x231f,
+ 0x2322, 0x2328,
+ 0x232b, 0x237b,
+ 0x237d, 0x239a,
+ 0x23b4, 0x23db,
+ 0x23e2, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x25b6,
+ 0x25b8, 0x25c0,
+ 0x25c2, 0x25f7,
+ 0x2600, 0x266e,
+ 0x2670, 0x2767,
+ 0x2794, 0x27bf,
+ 0x2800, 0x28ff,
+ 0x2b00, 0x2b2f,
+ 0x2b45, 0x2b46,
+ 0x2b4d, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa490, 0xa4c6,
+ 0xa828, 0xa82b,
+ 0xa836, 0xa837,
+ 0xa839, 0xa839,
+ 0xaa77, 0xaa79,
+ 0xfdfd, 0xfdfd,
+ 0xffe4, 0xffe4,
+ 0xffe8, 0xffe8,
+ 0xffed, 0xffee,
+ 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,
+ 0x1d16a, 0x1d16c,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d200, 0x1d241,
+ 0x1d245, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0bf,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0f5,
+ 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,
+}; /* CR_So */
+
+/* 'Z': Major Category */
+static const OnigCodePoint CR_Z[] = {
+ 8,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Z */
+
+/* 'Zl': General Category */
+static const OnigCodePoint CR_Zl[] = {
+ 1,
+ 0x2028, 0x2028,
+}; /* CR_Zl */
+
+/* 'Zp': General Category */
+static const OnigCodePoint CR_Zp[] = {
+ 1,
+ 0x2029, 0x2029,
+}; /* CR_Zp */
+
+/* 'Zs': General Category */
+static const OnigCodePoint CR_Zs[] = {
+ 7,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Zs */
+
+/* 'Math': Derived Property */
+static const OnigCodePoint CR_Math[] = {
+ 138,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x2061, 0x2064,
+ 0x207a, 0x207e,
+ 0x208a, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2118, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x2149,
+ 0x214b, 0x214b,
+ 0x2190, 0x21a7,
+ 0x21a9, 0x21ae,
+ 0x21b0, 0x21b1,
+ 0x21b6, 0x21b7,
+ 0x21bc, 0x21db,
+ 0x21dd, 0x21dd,
+ 0x21e4, 0x21e5,
+ 0x21f4, 0x22ff,
+ 0x2308, 0x230b,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b5,
+ 0x23b7, 0x23b7,
+ 0x23d0, 0x23d0,
+ 0x23dc, 0x23e2,
+ 0x25a0, 0x25a1,
+ 0x25ae, 0x25b7,
+ 0x25bc, 0x25c1,
+ 0x25c6, 0x25c7,
+ 0x25ca, 0x25cb,
+ 0x25cf, 0x25d3,
+ 0x25e2, 0x25e2,
+ 0x25e4, 0x25e4,
+ 0x25e7, 0x25ec,
+ 0x25f8, 0x25ff,
+ 0x2605, 0x2606,
+ 0x2640, 0x2640,
+ 0x2642, 0x2642,
+ 0x2660, 0x2663,
+ 0x266d, 0x266f,
+ 0x27c0, 0x27ff,
+ 0x2900, 0x2aff,
+ 0x2b30, 0x2b44,
+ 0x2b47, 0x2b4c,
+ 0xfb29, 0xfb29,
+ 0xfe61, 0xfe66,
+ 0xfe68, 0xfe68,
+ 0xff0b, 0xff0b,
+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ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Math */
+
+/* 'Alphabetic': Derived Property */
+#define CR_Alphabetic CR_Alpha
+
+/* 'Lowercase': Derived Property */
+#define CR_Lowercase CR_Lower
+
+/* 'Uppercase': Derived Property */
+#define CR_Uppercase CR_Upper
+
+/* 'Cased': Derived Property */
+static const OnigCodePoint CR_Cased[] = {
+ 127,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 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4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
+}; /* CR_Cased */
+
+/* 'Case_Ignorable': Derived Property */
+static const OnigCodePoint CR_Case_Ignorable[] = {
+ 335,
+ 0x0027, 0x0027,
+ 0x002e, 0x002e,
+ 0x003a, 0x003a,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00ad, 0x00ad,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0387, 0x0387,
+ 0x0483, 0x0489,
+ 0x0559, 0x0559,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05f4, 0x05f4,
+ 0x0600, 0x0605,
+ 0x0610, 0x061a,
+ 0x061c, 0x061c,
+ 0x0640, 0x0640,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dd,
+ 0x06df, 0x06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0xff40,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 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,
+ 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,
+}; /* CR_Case_Ignorable */
+
+/* 'Changes_When_Lowercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Lowercased[] = {
+ 585,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a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,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa698, 0xa698,
+ 0xa69a, 0xa69a,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 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[] = {
+ 599,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c5, 0x01c6,
+ 0x01c8, 0x01c9,
+ 0x01cb, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f2, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026c,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0287, 0x028c,
+ 0x0292, 0x0292,
+ 0x029e, 0x029e,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,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, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 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,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x118c0, 0x118df,
+}; /* CR_Changes_When_Uppercased */
+
+/* 'Changes_When_Titlecased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Titlecased[] = {
+ 600,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x01c4,
+ 0x01c6, 0x01c7,
+ 0x01c9, 0x01ca,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f1,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026c,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0287, 0x028c,
+ 0x0292, 0x0292,
+ 0x029e, 0x029e,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
+ 0x0561, 0x0587,
+ 0x1d79, 0x1d79,
+ 0x1d7d, 0x1d7d,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1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 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa699, 0xa699,
+ 0xa69b, 0xa69b,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 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,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x118c0, 0x118df,
+}; /* CR_Changes_When_Titlecased */
+
+/* 'Changes_When_Casefolded': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casefolded[] = {
+ 596,
+ 0x0041, 0x005a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00df,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x0149, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x017f, 0x017f,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0345, 0x0345,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03c2, 0x03c2,
+ 0x03cf, 0x03d1,
+ 0x03d5, 0x03d6,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+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 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa796, 0xa796,
+ 0xa798, 0xa798,
+ 0xa79a, 0xa79a,
+ 0xa79c, 0xa79c,
+ 0xa79e, 0xa79e,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 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[] = {
+ 107,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x0137,
+ 0x0139, 0x018c,
+ 0x018e, 0x019a,
+ 0x019c, 0x01a9,
+ 0x01ac, 0x01b9,
+ 0x01bc, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x0220,
+ 0x0222, 0x0233,
+ 0x023a, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025c,
+ 0x0260, 0x0261,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026c,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 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, 0x03f5,
+ 0x03f7, 0x03fb,
+ 0x03fd, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d79, 0x1d79,
+ 0x1d7d, 0x1d7d,
+ 0x1e00, 0x1e9b,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2126, 0x2126,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x217f,
+ 0x2183, 0x2184,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c70,
+ 0x2c72, 0x2c73,
+ 0x2c75, 0x2c76,
+ 0x2c7e, 0x2ce3,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa69b,
+ 0xa722, 0xa72f,
+ 0xa732, 0xa76f,
+ 0xa779, 0xa787,
+ 0xa78b, 0xa78d,
+ 0xa790, 0xa793,
+ 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[] = {
+ 538,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08b2,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0980,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a72, 0x0a74,
+ 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 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 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,
+ 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,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,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0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08b2,
+ 0x08e4, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a,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, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 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,
+ 0x1107f, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
+ 0x11180, 0x111c4,
+ 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,
+ 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,
+ 0x1d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0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_ID_Continue */
+
+/* 'XID_Start': Derived Property */
+static const OnigCodePoint CR_XID_Start[] = {
+ 545,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef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4,
+ 0x0ec6, 0x0ec6,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f88, 0x0f8c,
+ 0x1000, 0x102a,
+ 0x103f, 0x103f,
+ 0x1050, 0x1055,
+ 0x105a, 0x105d,
+ 0x1061, 0x1061,
+ 0x1065, 0x1066,
+ 0x106e, 0x1070,
+ 0x1075, 0x1081,
+ 0x108e, 0x108e,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1aa7, 0x1aa7,
+ 0x1b05, 0x1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
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 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,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0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, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_XID_Start */
+
+/* 'XID_Continue': Derived Property */
+static const OnigCodePoint CR_XID_Continue[] = {
+ 633,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x037f, 0x037f,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038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0f00,
+ 0x0f18, 0x0f19,
+ 0x0f20, 0x0f29,
+ 0x0f35, 0x0f35,
+ 0x0f37, 0x0f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1369, 0x1371,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x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0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 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,
+ 0x1107f, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11150, 0x11173,
+ 0x11176, 0x11176,
+ 0x11180, 0x111c4,
+ 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,
+ 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,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49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, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_XID_Continue */
+
+/* 'Default_Ignorable_Code_Point': Derived Property */
+static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
+ 17,
+ 0x00ad, 0x00ad,
+ 0x034f, 0x034f,
+ 0x061c, 0x061c,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x180b, 0x180e,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x206f,
+ 0x3164, 0x3164,
+ 0xfe00, 0xfe0f,
+ 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[] = {
+ 272,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6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7c, 0xaa7c,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 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,
+ 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,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
+ 0xe0100, 0xe01ef,
+}; /* CR_Grapheme_Extend */
+
+/* 'Grapheme_Base': Derived Property */
+static const OnigCodePoint CR_Grapheme_Base[] = {
+ 724,
+ 0x0020, 0x007e,
+ 0x00a0, 0x00ac,
+ 0x00ae, 0x02ff,
+ 0x0370, 0x0377,
+ 0x037a, 0x037f,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0482,
+ 0x048a, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058d, 0x058f,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0606, 0x060f,
+ 0x061b, 0x061b,
+ 0x061e, 0x064a,
+ 0x0660, 0x066f,
+ 0x0671, 0x06d5,
+ 0x06de, 0x06de,
+ 0x06e5, 0x06e6,
+ 0x06e9, 0x06e9,
+ 0x06ee, 0x070d,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0830, 0x083e,
+ 0x0840, 0x0858,
+ 0x085e, 0x085e,
+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d0, 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,
+ 0x1360, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1735, 0x1736,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17b6,
+ 0x17be, 0x17c5,
+ 0x17c7, 0x17c8,
+ 0x17d4, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180a,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1923, 0x1926,
+ 0x1929, 0x192b,
+ 0x1930, 0x1931,
+ 0x1933, 0x1938,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a16,
+ 0x1a19, 0x1a1a,
+ 0x1a1e, 0x1a55,
+ 0x1a57, 0x1a57,
+ 0x1a61, 0x1a61,
+ 0x1a63, 0x1a64,
+ 0x1a6d, 0x1a72,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b04, 0x1b33,
+ 0x1b35, 0x1b35,
+ 0x1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f,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffc, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018c,
+ 0x10190, 0x1019b,
+ 0x101a0, 0x101a0,
+ 0x101d0, 0x101fc,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 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, 0x1089e,
+ 0x108a7, 0x108af,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a40, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a9f,
+ 0x10ac0, 0x10ae4,
+ 0x10aeb, 0x10af6,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b91,
+ 0x10b99, 0x10b9c,
+ 0x10ba9, 0x10baf,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x11000,
+ 0x11002, 0x11037,
+ 0x11047, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11082, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11150, 0x11172,
+ 0x11174, 0x11176,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 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,
+ 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,
+ 0x1d166, 0x1d166,
+ 0x1d16a, 0x1d16d,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d200, 0x1d241,
+ 0x1d245, 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,
+ 0x1d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 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,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Grapheme_Base */
+
+/* 'Grapheme_Link': Derived Property */
+static const OnigCodePoint CR_Grapheme_Link[] = {
+ 40,
+ 0x094d, 0x094d,
+ 0x09cd, 0x09cd,
+ 0x0a4d, 0x0a4d,
+ 0x0acd, 0x0acd,
+ 0x0b4d, 0x0b4d,
+ 0x0bcd, 0x0bcd,
+ 0x0c4d, 0x0c4d,
+ 0x0ccd, 0x0ccd,
+ 0x0d4d, 0x0d4d,
+ 0x0dca, 0x0dca,
+ 0x0e3a, 0x0e3a,
+ 0x0f84, 0x0f84,
+ 0x1039, 0x103a,
+ 0x1714, 0x1714,
+ 0x1734, 0x1734,
+ 0x17d2, 0x17d2,
+ 0x1a60, 0x1a60,
+ 0x1b44, 0x1b44,
+ 0x1baa, 0x1bab,
+ 0x1bf2, 0x1bf3,
+ 0x2d7f, 0x2d7f,
+ 0xa806, 0xa806,
+ 0xa8c4, 0xa8c4,
+ 0xa953, 0xa953,
+ 0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
+ 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[] = {
+ 165,
+ 0x0000, 0x0040,
+ 0x005b, 0x0060,
+ 0x007b, 0x00a9,
+ 0x00ab, 0x00b9,
+ 0x00bb, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02b9, 0x02df,
+ 0x02e5, 0x02e9,
+ 0x02ec, 0x02ff,
+ 0x0374, 0x0374,
+ 0x037e, 0x037e,
+ 0x0385, 0x0385,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x0605, 0x0605,
+ 0x060c, 0x060c,
+ 0x061b, 0x061c,
+ 0x061f, 0x061f,
+ 0x0640, 0x0640,
+ 0x0660, 0x0669,
+ 0x06dd, 0x06dd,
+ 0x0964, 0x0965,
+ 0x0e3f, 0x0e3f,
+ 0x0fd5, 0x0fd8,
+ 0x10fb, 0x10fb,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x1802, 0x1803,
+ 0x1805, 0x1805,
+ 0x1cd3, 0x1cd3,
+ 0x1ce1, 0x1ce1,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x2000, 0x200b,
+ 0x200e, 0x2064,
+ 0x2066, 0x2070,
+ 0x2074, 0x207e,
+ 0x2080, 0x208e,
+ 0x20a0, 0x20bd,
+ 0x2100, 0x2125,
+ 0x2127, 0x2129,
+ 0x212c, 0x2131,
+ 0x2133, 0x214d,
+ 0x214f, 0x215f,
+ 0x2189, 0x2189,
+ 0x2190, 0x23fa,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x27ff,
+ 0x2900, 0x2b73,
+ 0x2b76, 0x2b95,
+ 0x2b98, 0x2bb9,
+ 0x2bbd, 0x2bc8,
+ 0x2bca, 0x2bd1,
+ 0x2e00, 0x2e42,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x3004,
+ 0x3006, 0x3006,
+ 0x3008, 0x3020,
+ 0x3030, 0x3037,
+ 0x303c, 0x303f,
+ 0x309b, 0x309c,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fc,
+ 0x3190, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3220, 0x325f,
+ 0x327f, 0x32cf,
+ 0x3358, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa700, 0xa721,
+ 0xa788, 0xa78a,
+ 0xa830, 0xa839,
+ 0xa92e, 0xa92e,
+ 0xa9cf, 0xa9cf,
+ 0xab5b, 0xab5b,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff20,
+ 0xff3b, 0xff40,
+ 0xff5b, 0xff65,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1013f,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 0x102e1, 0x102fb,
+ 0x1bca0, 0x1bca3,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d166,
+ 0x1d16a, 0x1d17a,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x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f810, 0x1f847,
+ 0x1f850, 0x1f859,
+ 0x1f860, 0x1f887,
+ 0x1f890, 0x1f8ad,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Common */
+
+/* 'Latin': Script */
+static const OnigCodePoint CR_Latin[] = {
+ 33,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02b8,
+ 0x02e0, 0x02e4,
+ 0x1d00, 0x1d25,
+ 0x1d2c, 0x1d5c,
+ 0x1d62, 0x1d65,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1dbe,
+ 0x1e00, 0x1eff,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x2c60, 0x2c7f,
+ 0xa722, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa7ad,
+ 0xa7b0, 0xa7b1,
+ 0xa7f7, 0xa7ff,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab64,
+ 0xfb00, 0xfb06,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+}; /* CR_Latin */
+
+/* 'Greek': Script */
+static const OnigCodePoint CR_Greek[] = {
+ 36,
+ 0x0370, 0x0373,
+ 0x0375, 0x0377,
+ 0x037a, 0x037d,
+ 0x037f, 0x037f,
+ 0x0384, 0x0384,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03e1,
+ 0x03f0, 0x03ff,
+ 0x1d26, 0x1d2a,
+ 0x1d5d, 0x1d61,
+ 0x1d66, 0x1d6a,
+ 0x1dbf, 0x1dbf,
+ 0x1f00, 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,
+ 0x2126, 0x2126,
+ 0xab65, 0xab65,
+ 0x10140, 0x1018c,
+ 0x101a0, 0x101a0,
+ 0x1d200, 0x1d245,
+}; /* CR_Greek */
+
+/* 'Cyrillic': Script */
+static const OnigCodePoint CR_Cyrillic[] = {
+ 7,
+ 0x0400, 0x0484,
+ 0x0487, 0x052f,
+ 0x1d2b, 0x1d2b,
+ 0x1d78, 0x1d78,
+ 0x2de0, 0x2dff,
+ 0xa640, 0xa69d,
+ 0xa69f, 0xa69f,
+}; /* CR_Cyrillic */
+
+/* 'Armenian': Script */
+static const OnigCodePoint CR_Armenian[] = {
+ 6,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x058a, 0x058a,
+ 0x058d, 0x058f,
+ 0xfb13, 0xfb17,
+}; /* CR_Armenian */
+
+/* 'Hebrew': Script */
+static const OnigCodePoint CR_Hebrew[] = {
+ 9,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfb4f,
+}; /* CR_Hebrew */
+
+/* 'Arabic': Script */
+static const OnigCodePoint CR_Arabic[] = {
+ 55,
+ 0x0600, 0x0604,
+ 0x0606, 0x060b,
+ 0x060d, 0x061a,
+ 0x061e, 0x061e,
+ 0x0620, 0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0x074a,
+ 0x074d, 0x074f,
+}; /* CR_Syriac */
+
+/* 'Thaana': Script */
+static const OnigCodePoint CR_Thaana[] = {
+ 1,
+ 0x0780, 0x07b1,
+}; /* CR_Thaana */
+
+/* 'Devanagari': Script */
+static const OnigCodePoint CR_Devanagari[] = {
+ 4,
+ 0x0900, 0x0950,
+ 0x0953, 0x0963,
+ 0x0966, 0x097f,
+ 0xa8e0, 0xa8fb,
+}; /* CR_Devanagari */
+
+/* 'Bengali': Script */
+static const OnigCodePoint CR_Bengali[] = {
+ 14,
+ 0x0980, 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,
+}; /* CR_Bengali */
+
+/* 'Gurmukhi': Script */
+static const OnigCodePoint CR_Gurmukhi[] = {
+ 16,
+ 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,
+}; /* CR_Gurmukhi */
+
+/* 'Gujarati': Script */
+static const OnigCodePoint CR_Gujarati[] = {
+ 13,
+ 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,
+}; /* CR_Gujarati */
+
+/* 'Oriya': Script */
+static const OnigCodePoint CR_Oriya[] = {
+ 14,
+ 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,
+}; /* CR_Oriya */
+
+/* 'Tamil': Script */
+static const OnigCodePoint CR_Tamil[] = {
+ 16,
+ 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,
+}; /* CR_Tamil */
+
+/* 'Telugu': Script */
+static const OnigCodePoint CR_Telugu[] = {
+ 13,
+ 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,
+}; /* CR_Telugu */
+
+/* 'Kannada': Script */
+static const OnigCodePoint CR_Kannada[] = {
+ 14,
+ 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,
+}; /* CR_Kannada */
+
+/* 'Malayalam': Script */
+static const OnigCodePoint CR_Malayalam[] = {
+ 11,
+ 0x0d01, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+}; /* CR_Malayalam */
+
+/* 'Sinhala': Script */
+static const OnigCodePoint CR_Sinhala[] = {
+ 13,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0de6, 0x0def,
+ 0x0df2, 0x0df4,
+ 0x111e1, 0x111f4,
+}; /* CR_Sinhala */
+
+/* 'Thai': Script */
+static const OnigCodePoint CR_Thai[] = {
+ 2,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e5b,
+}; /* CR_Thai */
+
+/* 'Lao': Script */
+static const OnigCodePoint CR_Lao[] = {
+ 18,
+ 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,
+}; /* CR_Lao */
+
+/* 'Tibetan': Script */
+static const OnigCodePoint CR_Tibetan[] = {
+ 7,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x0fd9, 0x0fda,
+}; /* CR_Tibetan */
+
+/* 'Myanmar': Script */
+static const OnigCodePoint CR_Myanmar[] = {
+ 3,
+ 0x1000, 0x109f,
+ 0xa9e0, 0xa9fe,
+ 0xaa60, 0xaa7f,
+}; /* CR_Myanmar */
+
+/* 'Georgian': Script */
+static const OnigCodePoint CR_Georgian[] = {
+ 8,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x10ff,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+}; /* CR_Georgian */
+
+/* 'Hangul': Script */
+static const OnigCodePoint CR_Hangul[] = {
+ 14,
+ 0x1100, 0x11ff,
+ 0x302e, 0x302f,
+ 0x3131, 0x318e,
+ 0x3200, 0x321e,
+ 0x3260, 0x327e,
+ 0xa960, 0xa97c,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+}; /* CR_Hangul */
+
+/* 'Ethiopic': Script */
+static const OnigCodePoint CR_Ethiopic[] = {
+ 32,
+ 0x1200, 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,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+}; /* CR_Ethiopic */
+
+/* 'Cherokee': Script */
+static const OnigCodePoint CR_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13f4,
+}; /* CR_Cherokee */
+
+/* 'Canadian_Aboriginal': Script */
+static const OnigCodePoint CR_Canadian_Aboriginal[] = {
+ 2,
+ 0x1400, 0x167f,
+ 0x18b0, 0x18f5,
+}; /* CR_Canadian_Aboriginal */
+
+/* 'Ogham': Script */
+static const OnigCodePoint CR_Ogham[] = {
+ 1,
+ 0x1680, 0x169c,
+}; /* CR_Ogham */
+
+/* 'Runic': Script */
+static const OnigCodePoint CR_Runic[] = {
+ 2,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f8,
+}; /* CR_Runic */
+
+/* 'Khmer': Script */
+static const OnigCodePoint CR_Khmer[] = {
+ 4,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x19e0, 0x19ff,
+}; /* CR_Khmer */
+
+/* 'Mongolian': Script */
+static const OnigCodePoint CR_Mongolian[] = {
+ 6,
+ 0x1800, 0x1801,
+ 0x1804, 0x1804,
+ 0x1806, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+}; /* CR_Mongolian */
+
+/* 'Hiragana': Script */
+static const OnigCodePoint CR_Hiragana[] = {
+ 4,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x1b001, 0x1b001,
+ 0x1f200, 0x1f200,
+}; /* CR_Hiragana */
+
+/* 'Katakana': Script */
+static const OnigCodePoint CR_Katakana[] = {
+ 8,
+ 0x30a1, 0x30fa,
+ 0x30fd, 0x30ff,
+ 0x31f0, 0x31ff,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3357,
+ 0xff66, 0xff6f,
+ 0xff71, 0xff9d,
+ 0x1b000, 0x1b000,
+}; /* CR_Katakana */
+
+/* 'Bopomofo': Script */
+static const OnigCodePoint CR_Bopomofo[] = {
+ 3,
+ 0x02ea, 0x02eb,
+ 0x3105, 0x312d,
+ 0x31a0, 0x31ba,
+}; /* CR_Bopomofo */
+
+/* 'Han': Script */
+static const OnigCodePoint CR_Han[] = {
+ 15,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x3005, 0x3005,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303b,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Han */
+
+/* 'Yi': Script */
+static const OnigCodePoint CR_Yi[] = {
+ 2,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+}; /* CR_Yi */
+
+/* 'Old_Italic': Script */
+static const OnigCodePoint CR_Old_Italic[] = {
+ 1,
+ 0x10300, 0x10323,
+}; /* CR_Old_Italic */
+
+/* 'Gothic': Script */
+static const OnigCodePoint CR_Gothic[] = {
+ 1,
+ 0x10330, 0x1034a,
+}; /* CR_Gothic */
+
+/* 'Deseret': Script */
+static const OnigCodePoint CR_Deseret[] = {
+ 1,
+ 0x10400, 0x1044f,
+}; /* CR_Deseret */
+
+/* 'Inherited': Script */
+static const OnigCodePoint CR_Inherited[] = {
+ 27,
+ 0x0300, 0x036f,
+ 0x0485, 0x0486,
+ 0x064b, 0x0655,
+ 0x0670, 0x0670,
+ 0x0951, 0x0952,
+ 0x1ab0, 0x1abe,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1ce0,
+ 0x1ce2, 0x1ce8,
+ 0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
+ 0x1cf8, 0x1cf9,
+ 0x1dc0, 0x1df5,
+ 0x1dfc, 0x1dff,
+ 0x200c, 0x200d,
+ 0x20d0, 0x20f0,
+ 0x302a, 0x302d,
+ 0x3099, 0x309a,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe2d,
+ 0x101fd, 0x101fd,
+ 0x102e0, 0x102e0,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0xe0100, 0xe01ef,
+}; /* CR_Inherited */
+
+/* 'Tagalog': Script */
+static const OnigCodePoint CR_Tagalog[] = {
+ 2,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+}; /* CR_Tagalog */
+
+/* 'Hanunoo': Script */
+static const OnigCodePoint CR_Hanunoo[] = {
+ 1,
+ 0x1720, 0x1734,
+}; /* CR_Hanunoo */
+
+/* 'Buhid': Script */
+static const OnigCodePoint CR_Buhid[] = {
+ 1,
+ 0x1740, 0x1753,
+}; /* CR_Buhid */
+
+/* 'Tagbanwa': Script */
+static const OnigCodePoint CR_Tagbanwa[] = {
+ 3,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+}; /* CR_Tagbanwa */
+
+/* 'Limbu': Script */
+static const OnigCodePoint CR_Limbu[] = {
+ 5,
+ 0x1900, 0x191e,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x194f,
+}; /* CR_Limbu */
+
+/* 'Tai_Le': Script */
+static const OnigCodePoint CR_Tai_Le[] = {
+ 2,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+}; /* CR_Tai_Le */
+
+/* 'Linear_B': Script */
+static const OnigCodePoint CR_Linear_B[] = {
+ 7,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+}; /* CR_Linear_B */
+
+/* 'Ugaritic': Script */
+static const OnigCodePoint CR_Ugaritic[] = {
+ 2,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+}; /* CR_Ugaritic */
+
+/* 'Shavian': Script */
+static const OnigCodePoint CR_Shavian[] = {
+ 1,
+ 0x10450, 0x1047f,
+}; /* CR_Shavian */
+
+/* 'Osmanya': Script */
+static const OnigCodePoint CR_Osmanya[] = {
+ 2,
+ 0x10480, 0x1049d,
+ 0x104a0, 0x104a9,
+}; /* CR_Osmanya */
+
+/* 'Cypriot': Script */
+static const OnigCodePoint CR_Cypriot[] = {
+ 6,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+}; /* CR_Cypriot */
+
+/* 'Braille': Script */
+static const OnigCodePoint CR_Braille[] = {
+ 1,
+ 0x2800, 0x28ff,
+}; /* CR_Braille */
+
+/* 'Buginese': Script */
+static const OnigCodePoint CR_Buginese[] = {
+ 2,
+ 0x1a00, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+}; /* CR_Buginese */
+
+/* 'Coptic': Script */
+static const OnigCodePoint CR_Coptic[] = {
+ 3,
+ 0x03e2, 0x03ef,
+ 0x2c80, 0x2cf3,
+ 0x2cf9, 0x2cff,
+}; /* CR_Coptic */
+
+/* 'New_Tai_Lue': Script */
+static const OnigCodePoint CR_New_Tai_Lue[] = {
+ 4,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x19df,
+}; /* CR_New_Tai_Lue */
+
+/* 'Glagolitic': Script */
+static const OnigCodePoint CR_Glagolitic[] = {
+ 2,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+}; /* CR_Glagolitic */
+
+/* 'Tifinagh': Script */
+static const OnigCodePoint CR_Tifinagh[] = {
+ 3,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d7f,
+}; /* CR_Tifinagh */
+
+/* 'Syloti_Nagri': Script */
+static const OnigCodePoint CR_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82b,
+}; /* CR_Syloti_Nagri */
+
+/* 'Old_Persian': Script */
+static const OnigCodePoint CR_Old_Persian[] = {
+ 2,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103d5,
+}; /* CR_Old_Persian */
+
+/* 'Kharoshthi': Script */
+static const OnigCodePoint CR_Kharoshthi[] = {
+ 8,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+}; /* CR_Kharoshthi */
+
+/* 'Balinese': Script */
+static const OnigCodePoint CR_Balinese[] = {
+ 2,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+}; /* CR_Balinese */
+
+/* 'Cuneiform': Script */
+static const OnigCodePoint CR_Cuneiform[] = {
+ 3,
+ 0x12000, 0x12398,
+ 0x12400, 0x1246e,
+ 0x12470, 0x12474,
+}; /* CR_Cuneiform */
+
+/* 'Phoenician': Script */
+static const OnigCodePoint CR_Phoenician[] = {
+ 2,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x1091f,
+}; /* CR_Phoenician */
+
+/* 'Phags_Pa': Script */
+static const OnigCodePoint CR_Phags_Pa[] = {
+ 1,
+ 0xa840, 0xa877,
+}; /* CR_Phags_Pa */
+
+/* 'Nko': Script */
+static const OnigCodePoint CR_Nko[] = {
+ 1,
+ 0x07c0, 0x07fa,
+}; /* CR_Nko */
+
+/* 'Sundanese': Script */
+static const OnigCodePoint CR_Sundanese[] = {
+ 2,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
+}; /* CR_Sundanese */
+
+/* 'Lepcha': Script */
+static const OnigCodePoint CR_Lepcha[] = {
+ 3,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c4f,
+}; /* CR_Lepcha */
+
+/* 'Ol_Chiki': Script */
+static const OnigCodePoint CR_Ol_Chiki[] = {
+ 1,
+ 0x1c50, 0x1c7f,
+}; /* CR_Ol_Chiki */
+
+/* 'Vai': Script */
+static const OnigCodePoint CR_Vai[] = {
+ 1,
+ 0xa500, 0xa62b,
+}; /* CR_Vai */
+
+/* 'Saurashtra': Script */
+static const OnigCodePoint CR_Saurashtra[] = {
+ 2,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+}; /* CR_Saurashtra */
+
+/* 'Kayah_Li': Script */
+static const OnigCodePoint CR_Kayah_Li[] = {
+ 2,
+ 0xa900, 0xa92d,
+ 0xa92f, 0xa92f,
+}; /* CR_Kayah_Li */
+
+/* 'Rejang': Script */
+static const OnigCodePoint CR_Rejang[] = {
+ 2,
+ 0xa930, 0xa953,
+ 0xa95f, 0xa95f,
+}; /* CR_Rejang */
+
+/* 'Lycian': Script */
+static const OnigCodePoint CR_Lycian[] = {
+ 1,
+ 0x10280, 0x1029c,
+}; /* CR_Lycian */
+
+/* 'Carian': Script */
+static const OnigCodePoint CR_Carian[] = {
+ 1,
+ 0x102a0, 0x102d0,
+}; /* CR_Carian */
+
+/* 'Lydian': Script */
+static const OnigCodePoint CR_Lydian[] = {
+ 2,
+ 0x10920, 0x10939,
+ 0x1093f, 0x1093f,
+}; /* CR_Lydian */
+
+/* 'Cham': Script */
+static const OnigCodePoint CR_Cham[] = {
+ 4,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa5f,
+}; /* CR_Cham */
+
+/* 'Tai_Tham': Script */
+static const OnigCodePoint CR_Tai_Tham[] = {
+ 5,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+}; /* CR_Tai_Tham */
+
+/* 'Tai_Viet': Script */
+static const OnigCodePoint CR_Tai_Viet[] = {
+ 2,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadf,
+}; /* CR_Tai_Viet */
+
+/* 'Avestan': Script */
+static const OnigCodePoint CR_Avestan[] = {
+ 2,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b3f,
+}; /* CR_Avestan */
+
+/* 'Egyptian_Hieroglyphs': Script */
+static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342e,
+}; /* CR_Egyptian_Hieroglyphs */
+
+/* 'Samaritan': Script */
+static const OnigCodePoint CR_Samaritan[] = {
+ 2,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+}; /* CR_Samaritan */
+
+/* 'Lisu': Script */
+static const OnigCodePoint CR_Lisu[] = {
+ 1,
+ 0xa4d0, 0xa4ff,
+}; /* CR_Lisu */
+
+/* 'Bamum': Script */
+static const OnigCodePoint CR_Bamum[] = {
+ 2,
+ 0xa6a0, 0xa6f7,
+ 0x16800, 0x16a38,
+}; /* CR_Bamum */
+
+/* 'Javanese': Script */
+static const OnigCodePoint CR_Javanese[] = {
+ 3,
+ 0xa980, 0xa9cd,
+ 0xa9d0, 0xa9d9,
+ 0xa9de, 0xa9df,
+}; /* CR_Javanese */
+
+/* 'Meetei_Mayek': Script */
+static const OnigCodePoint CR_Meetei_Mayek[] = {
+ 3,
+ 0xaae0, 0xaaf6,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+}; /* CR_Meetei_Mayek */
+
+/* 'Imperial_Aramaic': Script */
+static const OnigCodePoint CR_Imperial_Aramaic[] = {
+ 2,
+ 0x10840, 0x10855,
+ 0x10857, 0x1085f,
+}; /* CR_Imperial_Aramaic */
+
+/* 'Old_South_Arabian': Script */
+static const OnigCodePoint CR_Old_South_Arabian[] = {
+ 1,
+ 0x10a60, 0x10a7f,
+}; /* CR_Old_South_Arabian */
+
+/* 'Inscriptional_Parthian': Script */
+static const OnigCodePoint CR_Inscriptional_Parthian[] = {
+ 2,
+ 0x10b40, 0x10b55,
+ 0x10b58, 0x10b5f,
+}; /* CR_Inscriptional_Parthian */
+
+/* 'Inscriptional_Pahlavi': Script */
+static const OnigCodePoint CR_Inscriptional_Pahlavi[] = {
+ 2,
+ 0x10b60, 0x10b72,
+ 0x10b78, 0x10b7f,
+}; /* CR_Inscriptional_Pahlavi */
+
+/* 'Old_Turkic': Script */
+static const OnigCodePoint CR_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c48,
+}; /* CR_Old_Turkic */
+
+/* 'Kaithi': Script */
+static const OnigCodePoint CR_Kaithi[] = {
+ 1,
+ 0x11080, 0x110c1,
+}; /* CR_Kaithi */
+
+/* 'Batak': Script */
+static const OnigCodePoint CR_Batak[] = {
+ 2,
+ 0x1bc0, 0x1bf3,
+ 0x1bfc, 0x1bff,
+}; /* CR_Batak */
+
+/* 'Brahmi': Script */
+static const OnigCodePoint CR_Brahmi[] = {
+ 3,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x1107f, 0x1107f,
+}; /* CR_Brahmi */
+
+/* 'Mandaic': Script */
+static const OnigCodePoint CR_Mandaic[] = {
+ 2,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+}; /* CR_Mandaic */
+
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 3,
+ 0x11180, 0x111c8,
+ 0x111cd, 0x111cd,
+ 0x111d0, 0x111da,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
+/* '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[] = {
+ 4,
+ 0x061c, 0x061c,
+ 0x200e, 0x200f,
+ 0x202a, 0x202e,
+ 0x2066, 0x2069,
+}; /* CR_Bidi_Control */
+
+/* 'Join_Control': Binary Property */
+static const OnigCodePoint CR_Join_Control[] = {
+ 1,
+ 0x200c, 0x200d,
+}; /* CR_Join_Control */
+
+/* 'Dash': Binary Property */
+static const OnigCodePoint CR_Dash[] = {
+ 21,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2053, 0x2053,
+ 0x207b, 0x207b,
+ 0x208b, 0x208b,
+ 0x2212, 0x2212,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x2e40, 0x2e40,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Dash */
+
+/* 'Hyphen': Binary Property */
+static const OnigCodePoint CR_Hyphen[] = {
+ 10,
+ 0x002d, 0x002d,
+ 0x00ad, 0x00ad,
+ 0x058a, 0x058a,
+ 0x1806, 0x1806,
+ 0x2010, 0x2011,
+ 0x2e17, 0x2e17,
+ 0x30fb, 0x30fb,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+ 0xff65, 0xff65,
+}; /* CR_Hyphen */
+
+/* 'Quotation_Mark': Binary Property */
+static const OnigCodePoint CR_Quotation_Mark[] = {
+ 13,
+ 0x0022, 0x0022,
+ 0x0027, 0x0027,
+ 0x00ab, 0x00ab,
+ 0x00bb, 0x00bb,
+ 0x2018, 0x201f,
+ 0x2039, 0x203a,
+ 0x2e42, 0x2e42,
+ 0x300c, 0x300f,
+ 0x301d, 0x301f,
+ 0xfe41, 0xfe44,
+ 0xff02, 0xff02,
+ 0xff07, 0xff07,
+ 0xff62, 0xff63,
+}; /* CR_Quotation_Mark */
+
+/* 'Terminal_Punctuation': Binary Property */
+static const OnigCodePoint CR_Terminal_Punctuation[] = {
+ 86,
+ 0x0021, 0x0021,
+ 0x002c, 0x002c,
+ 0x002e, 0x002e,
+ 0x003a, 0x003b,
+ 0x003f, 0x003f,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x05c3, 0x05c3,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070a,
+ 0x070c, 0x070c,
+ 0x07f8, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0e5a, 0x0e5b,
+ 0x0f08, 0x0f08,
+ 0x0f0d, 0x0f12,
+ 0x104a, 0x104b,
+ 0x1361, 0x1368,
+ 0x166d, 0x166e,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17da, 0x17da,
+ 0x1802, 0x1805,
+ 0x1808, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5d, 0x1b5f,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
+ 0x2e41, 0x2e41,
+ 0x3001, 0x3002,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa6f3, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c7, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0e,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0xff64, 0xff64,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x10a56, 0x10a57,
+ 0x10af0, 0x10af5,
+ 0x10b3a, 0x10b3f,
+ 0x10b99, 0x10b9c,
+ 0x11047, 0x1104d,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+ 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[] = {
+ 134,
+ 0x005e, 0x005e,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2061, 0x2064,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21a7,
+ 0x21a9, 0x21ad,
+ 0x21b0, 0x21b1,
+ 0x21b6, 0x21b7,
+ 0x21bc, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21db,
+ 0x21dd, 0x21dd,
+ 0x21e4, 0x21e5,
+ 0x2308, 0x230b,
+ 0x23b4, 0x23b5,
+ 0x23b7, 0x23b7,
+ 0x23d0, 0x23d0,
+ 0x23e2, 0x23e2,
+ 0x25a0, 0x25a1,
+ 0x25ae, 0x25b6,
+ 0x25bc, 0x25c0,
+ 0x25c6, 0x25c7,
+ 0x25ca, 0x25cb,
+ 0x25cf, 0x25d3,
+ 0x25e2, 0x25e2,
+ 0x25e4, 0x25e4,
+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b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+}; /* CR_Other_Math */
+
+/* 'Hex_Digit': Binary Property */
+static const OnigCodePoint CR_Hex_Digit[] = {
+ 6,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+ 0xff10, 0xff19,
+ 0xff21, 0xff26,
+ 0xff41, 0xff46,
+}; /* CR_Hex_Digit */
+
+/* 'ASCII_Hex_Digit': Binary Property */
+#define CR_ASCII_Hex_Digit CR_XDigit
+
+/* 'Other_Alphabetic': Binary Property */
+static const OnigCodePoint CR_Other_Alphabetic[] = {
+ 178,
+ 0x0345, 0x0345,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x0657,
+ 0x0659, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06e1, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ed, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x073f,
+ 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a4d,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabea,
+ 0xfb1e, 0xfb1e,
+ 0x10376, 0x1037a,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11045,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 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 */
+static const OnigCodePoint CR_Ideographic[] = {
+ 11,
+ 0x3006, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Ideographic */
+
+/* 'Diacritic': Binary Property */
+static const OnigCodePoint CR_Diacritic[] = {
+ 145,
+ 0x005e, 0x005e,
+ 0x0060,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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[] = {
+ 26,
+ 0x00b7, 0x00b7,
+ 0x02d0, 0x02d1,
+ 0x0640, 0x0640,
+ 0x07fa, 0x07fa,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c36, 0x1c36,
+ 0x1c7b, 0x1c7b,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 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[] = {
+ 20,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x02b0, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x037a, 0x037a,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 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[] = {
+ 5,
+ 0x2160, 0x216f,
+ 0x24b6, 0x24cf,
+ 0x1f130, 0x1f149,
+ 0x1f150, 0x1f169,
+ 0x1f170, 0x1f189,
+}; /* CR_Other_Uppercase */
+
+/* 'Noncharacter_Code_Point': Binary Property */
+static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
+ 18,
+ 0xfdd0, 0xfdef,
+ 0xfffe, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Noncharacter_Code_Point */
+
+/* 'Other_Grapheme_Extend': Binary Property */
+static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
+ 22,
+ 0x09be, 0x09be,
+ 0x09d7, 0x09d7,
+ 0x0b3e, 0x0b3e,
+ 0x0b57, 0x0b57,
+ 0x0bbe, 0x0bbe,
+ 0x0bd7, 0x0bd7,
+ 0x0cc2, 0x0cc2,
+ 0x0cd5, 0x0cd6,
+ 0x0d3e, 0x0d3e,
+ 0x0d57, 0x0d57,
+ 0x0dcf, 0x0dcf,
+ 0x0ddf, 0x0ddf,
+ 0x200c, 0x200d,
+ 0x302e, 0x302f,
+ 0xff9e, 0xff9f,
+ 0x1133e, 0x1133e,
+ 0x11357, 0x11357,
+ 0x114b0, 0x114b0,
+ 0x114bd, 0x114bd,
+ 0x115af, 0x115af,
+ 0x1d165, 0x1d165,
+ 0x1d16e, 0x1d172,
+}; /* CR_Other_Grapheme_Extend */
+
+/* 'IDS_Binary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Binary_Operator[] = {
+ 2,
+ 0x2ff0, 0x2ff1,
+ 0x2ff4, 0x2ffb,
+}; /* CR_IDS_Binary_Operator */
+
+/* 'IDS_Trinary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Trinary_Operator[] = {
+ 1,
+ 0x2ff2, 0x2ff3,
+}; /* CR_IDS_Trinary_Operator */
+
+/* 'Radical': Binary Property */
+static const OnigCodePoint CR_Radical[] = {
+ 3,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+}; /* CR_Radical */
+
+/* 'Unified_Ideograph': Binary Property */
+static const OnigCodePoint CR_Unified_Ideograph[] = {
+ 12,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xfa0e, 0xfa0f,
+ 0xfa11, 0xfa11,
+ 0xfa13, 0xfa14,
+ 0xfa1f, 0xfa1f,
+ 0xfa21, 0xfa21,
+ 0xfa23, 0xfa24,
+ 0xfa27, 0xfa29,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+}; /* CR_Unified_Ideograph */
+
+/* 'Other_Default_Ignorable_Code_Point': Binary Property */
+static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
+ 11,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x2065, 0x2065,
+ 0x3164, 0x3164,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0xe0000, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xe0fff,
+}; /* CR_Other_Default_Ignorable_Code_Point */
+
+/* 'Deprecated': Binary Property */
+static const OnigCodePoint CR_Deprecated[] = {
+ 9,
+ 0x0149, 0x0149,
+ 0x0673, 0x0673,
+ 0x0f77, 0x0f77,
+ 0x0f79, 0x0f79,
+ 0x17a3, 0x17a4,
+ 0x206a, 0x206f,
+ 0x2329, 0x232a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Deprecated */
+
+/* 'Soft_Dotted': Binary Property */
+static const OnigCodePoint CR_Soft_Dotted[] = {
+ 31,
+ 0x0069, 0x006a,
+ 0x012f, 0x012f,
+ 0x0249, 0x0249,
+ 0x0268, 0x0268,
+ 0x029d, 0x029d,
+ 0x02b2, 0x02b2,
+ 0x03f3, 0x03f3,
+ 0x0456, 0x0456,
+ 0x0458, 0x0458,
+ 0x1d62, 0x1d62,
+ 0x1d96, 0x1d96,
+ 0x1da4, 0x1da4,
+ 0x1da8, 0x1da8,
+ 0x1e2d, 0x1e2d,
+ 0x1ecb, 0x1ecb,
+ 0x2071, 0x2071,
+ 0x2148, 0x2149,
+ 0x2c7c, 0x2c7c,
+ 0x1d422, 0x1d423,
+ 0x1d456, 0x1d457,
+ 0x1d48a, 0x1d48b,
+ 0x1d4be, 0x1d4bf,
+ 0x1d4f2, 0x1d4f3,
+ 0x1d526, 0x1d527,
+ 0x1d55a, 0x1d55b,
+ 0x1d58e, 0x1d58f,
+ 0x1d5c2, 0x1d5c3,
+ 0x1d5f6, 0x1d5f7,
+ 0x1d62a, 0x1d62b,
+ 0x1d65e, 0x1d65f,
+ 0x1d692, 0x1d693,
+}; /* CR_Soft_Dotted */
+
+/* 'Logical_Order_Exception': Binary Property */
+static const OnigCodePoint CR_Logical_Order_Exception[] = {
+ 5,
+ 0x0e40, 0x0e44,
+ 0x0ec0, 0x0ec4,
+ 0xaab5, 0xaab6,
+ 0xaab9, 0xaab9,
+ 0xaabb, 0xaabc,
+}; /* CR_Logical_Order_Exception */
+
+/* 'Other_ID_Start': Binary Property */
+static const OnigCodePoint CR_Other_ID_Start[] = {
+ 3,
+ 0x2118, 0x2118,
+ 0x212e, 0x212e,
+ 0x309b, 0x309c,
+}; /* CR_Other_ID_Start */
+
+/* 'Other_ID_Continue': Binary Property */
+static const OnigCodePoint CR_Other_ID_Continue[] = {
+ 4,
+ 0x00b7, 0x00b7,
+ 0x0387, 0x0387,
+ 0x1369, 0x1371,
+ 0x19da, 0x19da,
+}; /* CR_Other_ID_Continue */
+
+/* 'STerm': Binary Property */
+static const OnigCodePoint CR_STerm[] = {
+ 60,
+ 0x0021, 0x0021,
+ 0x002e, 0x002e,
+ 0x003f, 0x003f,
+ 0x0589, 0x0589,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x0702,
+ 0x07f9, 0x07f9,
+ 0x0964, 0x0965,
+ 0x104a, 0x104b,
+ 0x1362, 0x1362,
+ 0x1367, 0x1368,
+ 0x166e, 0x166e,
+ 0x1735, 0x1736,
+ 0x1803, 0x1803,
+ 0x1809, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5e, 0x1b5f,
+ 0x1c3b, 0x1c3c,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x2e3c, 0x2e3c,
+ 0x3002, 0x3002,
+ 0xa4ff, 0xa4ff,
+ 0xa60e, 0xa60f,
+ 0xa6f3, 0xa6f3,
+ 0xa6f7, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c8, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe52, 0xfe52,
+ 0xfe56, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0e, 0xff0e,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0x10a56, 0x10a57,
+ 0x11047, 0x11048,
+ 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 */
+static const OnigCodePoint CR_Variation_Selector[] = {
+ 3,
+ 0x180b, 0x180d,
+ 0xfe00, 0xfe0f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Variation_Selector */
+
+/* 'Pattern_White_Space': Binary Property */
+static const OnigCodePoint CR_Pattern_White_Space[] = {
+ 5,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x200e, 0x200f,
+ 0x2028, 0x2029,
+}; /* CR_Pattern_White_Space */
+
+/* 'Pattern_Syntax': Binary Property */
+static const OnigCodePoint CR_Pattern_Syntax[] = {
+ 28,
+ 0x0021, 0x002f,
+ 0x003a, 0x0040,
+ 0x005b, 0x005e,
+ 0x0060, 0x0060,
+ 0x007b, 0x007e,
+ 0x00a1, 0x00a7,
+ 0x00a9, 0x00a9,
+ 0x00ab, 0x00ac,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b1,
+ 0x00b6, 0x00b6,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x2010, 0x2027,
+ 0x2030, 0x203e,
+ 0x2041, 0x2053,
+ 0x2055, 0x205e,
+ 0x2190, 0x245f,
+ 0x2500, 0x2775,
+ 0x2794, 0x2bff,
+ 0x2e00, 0x2e7f,
+ 0x3001, 0x3003,
+ 0x3008, 0x3020,
+ 0x3030, 0x3030,
+ 0xfd3e, 0xfd3f,
+ 0xfe45, 0xfe46,
+}; /* CR_Pattern_Syntax */
+
+/* 'Unknown': Script */
+static const OnigCodePoint CR_Unknown[] = {
+ 598,
+ 0x0378, 0x0379,
+ 0x0380, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0530, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058c,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x061d, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08b3, 0x08e3,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a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 0x0eac,
+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f9, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191f, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f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
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe2e, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xfefe,
+ 0xff00, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfff8,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018d, 0x1018f,
+ 0x1019c, 0x1019f,
+ 0x101a1, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102df,
+ 0x102fc, 0x102ff,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1034f,
+ 0x1037b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 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,
+ 0x1089f, 0x108a6,
+ 0x108b0, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10aa0, 0x10abf,
+ 0x10ae7, 0x10aea,
+ 0x10af7, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b92, 0x10b98,
+ 0x10b9d, 0x10ba8,
+ 0x10bb0, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107e,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 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,
+ 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x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 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,
+ 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,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e,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x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20aa,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xe000, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+}; /* CR_Age_1_1 */
+
+/* 'Age_2_0': Derived Age 2.0 */
+static const OnigCodePoint CR_Age_2_0[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 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0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ab,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_2_0 */
+
+/* 'Age_2_1': Derived Age 2.1 */
+static const OnigCodePoint CR_Age_2_1[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0652,
+ 0x0660, 0x066d,
+ 0x0670, 0x06b7,
+ 0x06ba, 0x06be,
+ 0x06c0, 0x06ce,
+ 0x06d0, 0x06ed,
+ 0x06f0, 0x06f9,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c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0x0fb9,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f6,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ac,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3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static const OnigCodePoint CR_Age_3_0[] = {
+ 369,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f3,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f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 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_0 */
+
+/* 'Age_3_1': Derived Age 3.1 */
+static const OnigCodePoint CR_Age_3_1[] = {
+ 402,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f5,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0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12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2046,
+ 0x2048, 0x204d,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20af,
+ 0x20d0, 0x20e3,
+ 0x2100, 0x213a,
+ 0x2153, 0x2183,
+ 0x2190, 0x21f3,
+ 0x2200, 0x22f1,
+ 0x2300, 0x237b,
+ 0x237d, 0x239a,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25f7,
+ 0x2600, 0x2613,
+ 0x2619, 0x2671,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767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0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xffff,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10400, 0x10425,
+ 0x10428, 0x1044d,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_1 */
+
+/* 'Age_3_2': Derived Age 3.2 */
+static const OnigCodePoint CR_Age_3_2[] = {
+ 397,
+ 0x0000, 0x0220,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034f,
+ 0x0360, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03f6,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b1,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 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ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6a,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fcf, 0x0fcf,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f8,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 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4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_2 */
+
+/* 'Age_4_0': Derived Age 4.0 */
+static const OnigCodePoint CR_Age_4_0[] = {
+ 412,
+ 0x0000, 0x0236,
+ 0x0250, 0x0357,
+ 0x035d, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03fb,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1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11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x19e0, 0x19ff,
+ 0x1d00, 0x1d6b,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2054,
+ 0x2057, 0x2057,
+ 0x205f, 0x2063,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20b1,
+ 0x20d0, 0x20ea,
+ 0x2100, 0x213b,
+ 0x213d, 0x214b,
+ 0x2153, 0x2183,
+ 0x2190, 0x23d0,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2617,
+ 0x2619, 0x267d,
+ 0x2680, 0x2691,
+ 0x26a0, 0x26a1,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x27d0, 0x27eb,
+ 0x27f0, 0x2b0d,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31f0, 0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x327d,
+ 0x327f, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fa5,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe23,
+ 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, 0x1013f,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d300, 0x1d356,
+ 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, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_0 */
+
+/* 'Age_4_1': Derived Age 4.1 */
+static const OnigCodePoint CR_Age_4_1[] = {
+ 430,
+ 0x0000, 0x0241,
+ 0x0250, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05b9,
+ 0x05bb, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060b, 0x0615,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x063a,
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70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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, 0x1083f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 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, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_1 */
+
+/* 'Age_5_0': Derived Age 5.0 */
+static const OnigCodePoint CR_Age_5_0[] = {
+ 440,
+ 0x0000, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x0513,
+ 0x0531,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c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19a9,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1d00, 0x1dca,
+ 0x1dfe, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0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303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31c0, 0x31cf,
+ 0x31f0, 0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fbb,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa700, 0xa71a,
+ 0xa720, 0xa721,
+ 0xa800, 0xa82b,
+ 0xa840, 0xa877,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x1091f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 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,
+ 0x1fffe, 0x2a6d6,
+ 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_5_0 */
+
+/* 'Age_5_1': Derived Age 5.1 */
+static const OnigCodePoint CR_Age_5_1[] = {
+ 455,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0523,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0972,
+ 0x097b, 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, 0x09fa,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a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, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x1000, 0x1099,
+ 0x109e, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+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0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1fffe, 0x2a6d6,
+ 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_5_1 */
+
+/* 'Age_5_2': Derived Age 5.2 */
+static const OnigCodePoint CR_Age_5_2[] = {
+ 495,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384,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fbe, 0x0fcc,
+ 0x0fce, 0x0fd8,
+ 0x1000, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 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, 0x1baa,
+ 0x1bae, 0x1bb9,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cd0, 0x1cf2,
+ 0x1d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d0, 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,
+ 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,
+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ffe, 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_5_2 */
+
+/* 'Age_6_0': Derived Age 6.0 */
+static const OnigCodePoint CR_Age_6_0[] = {
+ 511,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0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 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,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f169,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f5ff,
+ 0x1f601, 0x1f610,
+ 0x1f612, 0x1f614,
+ 0x1f616, 0x1f616,
+ 0x1f618, 0x1f618,
+ 0x1f61a, 0x1f61a,
+ 0x1f61c, 0x1f61e,
+ 0x1f620, 0x1f625,
+ 0x1f628, 0x1f62b,
+ 0x1f62d, 0x1f62d,
+ 0x1f630, 0x1f633,
+ 0x1f635, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 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_0 */
+
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 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,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, 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, 0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fe30, 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, 0x1ee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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_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, 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,
+ 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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100, 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,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dc,
+ 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,
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 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,
+ 0x0a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ea7, 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,
+ 0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xfad9,
+ 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,
+ 0x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x1f380, 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
+
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
+
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
+
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
+
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_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,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
+ 0x2de0, 0x2dff,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
+ 0x31f0, 0x31ff,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+static const OnigCodePoint CR_In_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_In_Kayah_Li */
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_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,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_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,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
+ 0xfe00, 0xfe0f,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_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,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 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,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_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,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_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,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_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,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_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_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_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,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_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,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 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,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_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,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_and_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_and_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_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 */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 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,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
+ 0xe0100, 0xe01ef,
+}; /* CR_In_Variation_Selectors_Supplement */
+
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
+
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
+ 1,
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 40,
+ 0x0860, 0x089f,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xab70, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x104ff,
+ 0x10570, 0x105ff,
+ 0x10780, 0x107ff,
+ 0x108b0, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10aa0, 0x10abf,
+ 0x10bb0, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11250, 0x112af,
+ 0x11380, 0x1147f,
+ 0x114e0, 0x1157f,
+ 0x11660, 0x1167f,
+ 0x116d0, 0x1189f,
+ 0x11900, 0x11abf,
+ 0x11b00, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a70, 0x16acf,
+ 0x16b90, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1bbff,
+ 0x1bcb0, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1e7ff,
+ 0x1e8e0, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f900, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
+
+static const OnigCodePoint* const CodeRanges[] = {
+ CR_NEWLINE,
+ CR_Alpha,
+ CR_Blank,
+ CR_Cntrl,
+ CR_Digit,
+ CR_Graph,
+ CR_Lower,
+ CR_Print,
+ CR_Punct,
+ CR_Space,
+ CR_Upper,
+ CR_XDigit,
+ CR_Word,
+ CR_Alnum,
+ CR_ASCII,
+#ifdef USE_UNICODE_PROPERTIES
+ CR_Any,
+ CR_Assigned,
+ CR_C,
+ CR_Cc,
+ CR_Cf,
+ CR_Cn,
+ CR_Co,
+ CR_Cs,
+ CR_L,
+ CR_LC,
+ CR_Ll,
+ CR_Lm,
+ CR_Lo,
+ CR_Lt,
+ CR_Lu,
+ CR_M,
+ CR_Mc,
+ CR_Me,
+ CR_Mn,
+ CR_N,
+ CR_Nd,
+ CR_Nl,
+ CR_No,
+ CR_P,
+ CR_Pc,
+ CR_Pd,
+ CR_Pe,
+ CR_Pf,
+ CR_Pi,
+ CR_Po,
+ CR_Ps,
+ CR_S,
+ CR_Sc,
+ CR_Sk,
+ CR_Sm,
+ CR_So,
+ CR_Z,
+ CR_Zl,
+ CR_Zp,
+ CR_Zs,
+ CR_Math,
+ CR_Alphabetic,
+ CR_Lowercase,
+ CR_Uppercase,
+ CR_Cased,
+ CR_Case_Ignorable,
+ CR_Changes_When_Lowercased,
+ CR_Changes_When_Uppercased,
+ CR_Changes_When_Titlecased,
+ CR_Changes_When_Casefolded,
+ CR_Changes_When_Casemapped,
+ CR_ID_Start,
+ CR_ID_Continue,
+ CR_XID_Start,
+ CR_XID_Continue,
+ CR_Default_Ignorable_Code_Point,
+ CR_Grapheme_Extend,
+ CR_Grapheme_Base,
+ CR_Grapheme_Link,
+ CR_Common,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+ CR_Armenian,
+ CR_Hebrew,
+ CR_Arabic,
+ CR_Syriac,
+ CR_Thaana,
+ CR_Devanagari,
+ CR_Bengali,
+ CR_Gurmukhi,
+ CR_Gujarati,
+ CR_Oriya,
+ CR_Tamil,
+ CR_Telugu,
+ CR_Kannada,
+ CR_Malayalam,
+ CR_Sinhala,
+ CR_Thai,
+ CR_Lao,
+ CR_Tibetan,
+ CR_Myanmar,
+ CR_Georgian,
+ CR_Hangul,
+ CR_Ethiopic,
+ CR_Cherokee,
+ CR_Canadian_Aboriginal,
+ CR_Ogham,
+ CR_Runic,
+ CR_Khmer,
+ CR_Mongolian,
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Bopomofo,
+ CR_Han,
+ CR_Yi,
+ CR_Old_Italic,
+ CR_Gothic,
+ CR_Deseret,
+ CR_Inherited,
+ CR_Tagalog,
+ CR_Hanunoo,
+ CR_Buhid,
+ CR_Tagbanwa,
+ CR_Limbu,
+ CR_Tai_Le,
+ CR_Linear_B,
+ CR_Ugaritic,
+ CR_Shavian,
+ CR_Osmanya,
+ CR_Cypriot,
+ CR_Braille,
+ CR_Buginese,
+ CR_Coptic,
+ CR_New_Tai_Lue,
+ CR_Glagolitic,
+ CR_Tifinagh,
+ CR_Syloti_Nagri,
+ CR_Old_Persian,
+ CR_Kharoshthi,
+ CR_Balinese,
+ CR_Cuneiform,
+ CR_Phoenician,
+ CR_Phags_Pa,
+ CR_Nko,
+ CR_Sundanese,
+ CR_Lepcha,
+ CR_Ol_Chiki,
+ CR_Vai,
+ CR_Saurashtra,
+ CR_Kayah_Li,
+ CR_Rejang,
+ CR_Lycian,
+ CR_Carian,
+ CR_Lydian,
+ CR_Cham,
+ CR_Tai_Tham,
+ CR_Tai_Viet,
+ CR_Avestan,
+ CR_Egyptian_Hieroglyphs,
+ CR_Samaritan,
+ CR_Lisu,
+ CR_Bamum,
+ CR_Javanese,
+ CR_Meetei_Mayek,
+ CR_Imperial_Aramaic,
+ CR_Old_South_Arabian,
+ CR_Inscriptional_Parthian,
+ CR_Inscriptional_Pahlavi,
+ CR_Old_Turkic,
+ CR_Kaithi,
+ CR_Batak,
+ CR_Brahmi,
+ CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ 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,
+ CR_Dash,
+ CR_Hyphen,
+ CR_Quotation_Mark,
+ CR_Terminal_Punctuation,
+ CR_Other_Math,
+ CR_Hex_Digit,
+ CR_ASCII_Hex_Digit,
+ CR_Other_Alphabetic,
+ CR_Ideographic,
+ CR_Diacritic,
+ CR_Extender,
+ CR_Other_Lowercase,
+ CR_Other_Uppercase,
+ CR_Noncharacter_Code_Point,
+ CR_Other_Grapheme_Extend,
+ CR_IDS_Binary_Operator,
+ CR_IDS_Trinary_Operator,
+ CR_Radical,
+ CR_Unified_Ideograph,
+ CR_Other_Default_Ignorable_Code_Point,
+ CR_Deprecated,
+ CR_Soft_Dotted,
+ CR_Logical_Order_Exception,
+ CR_Other_ID_Start,
+ CR_Other_ID_Continue,
+ CR_STerm,
+ CR_Variation_Selector,
+ 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,
+ CR_Age_3_0,
+ CR_Age_3_1,
+ CR_Age_3_2,
+ CR_Age_4_0,
+ CR_Age_4_1,
+ CR_Age_5_0,
+ CR_Age_5_1,
+ 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,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Combining_Diacritical_Marks_Extended,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_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,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_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_Emoticons,
+ 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,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
+#endif /* USE_UNICODE_PROPERTIES */
+};
+struct uniname2ctype_struct {
+ int name, ctype;
+};
+
+static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
+
+#ifndef USE_UNICODE_PROPERTIES
+#define TOTAL_KEYWORDS 14
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 6
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 19
+/* maximum key range = 14, duplicates = 0 */
+#else /* USE_UNICODE_PROPERTIES */
+#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 4322
+/* maximum key range = 4320, duplicates = 0 */
+#endif /* USE_UNICODE_PROPERTIES */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+uniname2ctype_hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+#ifndef USE_UNICODE_PROPERTIES
+ static const unsigned char asso_values[] =
+#else /* USE_UNICODE_PROPERTIES */
+ static const unsigned short asso_values[] =
+#endif /* USE_UNICODE_PROPERTIES */
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 3, 11, 5,
+ 4, 20, 20, 9, 20, 1, 20, 20, 10, 20,
+ 2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
+ 4, 20, 20, 20, 20, 20, 20, 20
+#else /* USE_UNICODE_PROPERTIES */
+ 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
+ return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
+#else /* USE_UNICODE_PROPERTIES */
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[15]];
+ /*FALLTHROUGH*/
+ case 15:
+ case 14:
+ case 13:
+ case 12:
+ hval += asso_values[(unsigned char)str[11]];
+ /*FALLTHROUGH*/
+ case 11:
+ case 10:
+ case 9:
+ case 8:
+ case 7:
+ case 6:
+ hval += asso_values[(unsigned char)str[5]];
+ /*FALLTHROUGH*/
+ case 5:
+ hval += asso_values[(unsigned char)str[4]];
+ /*FALLTHROUGH*/
+ case 4:
+ case 3:
+ hval += asso_values[(unsigned char)str[2]];
+ /*FALLTHROUGH*/
+ case 2:
+ hval += asso_values[(unsigned char)str[1]];
+ /*FALLTHROUGH*/
+ case 1:
+ hval += asso_values[(unsigned char)str[0]];
+ break;
+ }
+ return hval + asso_values[(unsigned char)str[len - 1]];
+#endif /* USE_UNICODE_PROPERTIES */
+}
+
+struct uniname2ctype_pool_t
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ char uniname2ctype_pool_str6[sizeof("word")];
+ char uniname2ctype_pool_str7[sizeof("print")];
+ char uniname2ctype_pool_str8[sizeof("punct")];
+ char uniname2ctype_pool_str9[sizeof("alpha")];
+ char uniname2ctype_pool_str10[sizeof("alnum")];
+ char uniname2ctype_pool_str11[sizeof("xdigit")];
+ char uniname2ctype_pool_str12[sizeof("upper")];
+ char uniname2ctype_pool_str13[sizeof("ascii")];
+ char uniname2ctype_pool_str14[sizeof("cntrl")];
+ char uniname2ctype_pool_str15[sizeof("space")];
+ char uniname2ctype_pool_str16[sizeof("lower")];
+ char uniname2ctype_pool_str17[sizeof("graph")];
+ char uniname2ctype_pool_str18[sizeof("digit")];
+ char uniname2ctype_pool_str19[sizeof("blank")];
+#else /* USE_UNICODE_PROPERTIES */
+ char uniname2ctype_pool_str3[sizeof("n")];
+ char uniname2ctype_pool_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_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_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_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_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 =
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ "word",
+ "print",
+ "punct",
+ "alpha",
+ "alnum",
+ "xdigit",
+ "upper",
+#else /* USE_UNICODE_PROPERTIES */
+ "n",
+ "cn",
+ "mn",
+ "c",
+ "m",
+ "ci",
+ "z",
+ "cc",
+ "mc",
+ "mani",
+ "inmanichaean",
+ "qaai",
+ "zzzz",
+ "qaac",
+ "incham",
+ "sc",
+ "sm",
+ "mandaic",
+ "incuneiform",
+ "cans",
+ "me",
+ "inarmenian",
+#endif /* USE_UNICODE_PROPERTIES */
+ "ascii",
+#ifdef USE_UNICODE_PROPERTIES
+ "s",
+ "insamaritan",
+ "cs",
+ "zs",
+ "inavestan",
+ "incommonindicnumberforms",
+ "incuneiformnumbersandpunctuation",
+ "inthai",
+ "inipaextensions",
+ "mtei",
+ "inspecials",
+ "initialpunctuation",
+ "inancientsymbols",
+ "inthaana",
+ "inmiscellaneousmathematicalsymbolsa",
+ "lc",
+ "inmusicalsymbols",
+ "lm",
+ "taile",
+ "sterm",
+ "lina",
+ "inlycian",
+ "inmyanmarextendeda",
+ "lana",
+ "alnum",
+ "intaitham",
+ "incontrolpictures",
+ "inmiscellaneoussymbols",
+ "inmalayalam",
+ "intransportandmapsymbols",
+ "inmiscellaneoussymbolsandarrows",
+ "inlineara",
+ "inmiscellaneoussymbolsandpictographs",
+ "taiviet",
+ "cwcm",
+ "sinhala",
+ "latn",
+ "latin",
+ "ital",
+ "intamil",
+ "taml",
+ "inlatinextendedc",
+ "intaile",
+ "tale",
+ "inlatinextendeda",
+ "inlinearbideograms",
+ "newtailue",
+ "l",
+ "nl",
+ "inmeeteimayekextensions",
+ "zl",
+ "lt",
+ "inrunic",
+ "incarian",
+ "armn",
+ "cari",
+ "armi",
+ "inlatinextendede",
+ "incyrillic",
+ "armenian",
+ "inmyanmar",
+ "innewtailue",
+ "carian",
+ "merc",
+ "arabic",
+ "inmiscellaneoustechnical",
+ "insyriac",
+ "samr",
+ "zinh",
+ "han",
+ "samaritan",
+ "hani",
+ "cwt",
+ "incherokee",
+ "insharada",
+ "cham",
+ "manichaean",
+ "inmahajani",
+#endif /* USE_UNICODE_PROPERTIES */
+ "cntrl",
+#ifdef USE_UNICODE_PROPERTIES
+ "sinh",
+ "inruminumeralsymbols",
+ "inethiopic",
+ "tamil",
+ "miao",
+ "inenclosedalphanumerics",
+ "term",
+ "chakma",
+ "insinhala",
+ "shavian",
+ "inosmanya",
+ "inlatinextendedadditional",
+ "osma",
+ "ll",
+ "thai",
+ "math",
+ "thaa",
+ "inenclosedalphanumericsupplement",
+ "ethi",
+ "connectorpunctuation",
+ "inlowsurrogates",
+ "insinhalaarchaicnumbers",
+ "taitham",
+ "thaana",
+ "lineara",
+ "di",
+ "idc",
+ "meroiticcursive",
+ "mand",
+ "inmodi",
+ "inmandaic",
+ "cwl",
+ "asciihexdigit",
+ "dia",
+ "terminalpunctuation",
+ "mend",
+ "sind",
+ "wara",
+ "inwarangciti",
+ "inideographicdescriptioncharacters",
+ "inemoticons",
+ "ids",
+ "insundanese",
+ "pi",
+ "indominotiles",
+ "pc",
+ "loe",
+ "titlecaseletter",
+ "inopticalcharacterrecognition",
+ "idst",
+ "shaw",
+ "cwcf",
+ "idcontinue",
+ "inphaistosdisc",
+ "pe",
+ "indeseret",
+ "inspacingmodifierletters",
+ "inlydian",
+ "ps",
+ "hira",
+ "whitespace",
+ "inscriptionalparthian",
+ "cher",
+ "inmathematicalalphanumericsymbols",
+ "incoptic",
+ "inhiragana",
+ "inenclosedcjklettersandmonths",
+#endif /* USE_UNICODE_PROPERTIES */
+ "space",
+#ifdef USE_UNICODE_PROPERTIES
+ "oriya",
+ "mero",
+ "mahj",
+ "tirh",
+ "sora",
+ "inscriptionalpahlavi",
+ "inarrows",
+ "mahajani",
+ "joinc",
+ "incopticepactnumbers",
+ "hano",
+ "palm",
+ "intirhuta",
+ "patws",
+ "inolchiki",
+ "inlepcha",
+ "no",
+ "lepc",
+ "inogham",
+ "co",
+ "innko",
+ "alpha",
+ "psalterpahlavi",
+ "inmro",
+ "inpalmyrene",
+ "common",
+ "cf",
+ "inmiao",
+ "so",
+ "diacritic",
+ "insundanesesupplement",
+ "intifinagh",
+ "tifinagh",
+ "odi",
+ "oidc",
+ "modi",
+ "decimalnumber",
+ "letter",
+ "dash",
+ "insylotinagri",
+ "inolditalic",
+ "wspace",
+ "dsrt",
+ "ideo",
+ "siddham",
+ "perm",
+ "oids",
+ "inmahjongtiles",
+ "lo",
+ "lineseparator",
+ "imperialaramaic",
+ "idstart",
+ "inlao",
+ "sharada",
+ "lao",
+ "laoo",
+ "mongolian",
+ "oalpha",
+ "inimperialaramaic",
+ "nchar",
+ "inlatin1supplement",
+ "prti",
+ "cprt",
+ "nd",
+ "deseret",
+ "inoldturkic",
+ "radical",
+ "canadianaboriginal",
+ "inmodifiertoneletters",
+ "incaucasianalbanian",
+ "coptic",
+ "casedletter",
+ "sd",
+ "inphoenician",
+ "sidd",
+ "privateuse",
+ "sundanese",
+ "inancientgreekmusicalnotation",
+ "insiddham",
+ "cased",
+ "print",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "copt",
+ "inancientgreeknumbers",
+ "saurashtra",
+ "mro",
+ "mroo",
+ "inalphabeticpresentationforms",
+ "lowercase",
+ "phli",
+ "patternwhitespace",
+ "inenclosedideographicsupplement",
+ "spaceseparator",
+ "inmathematicaloperators",
+ "omath",
+ "lisu",
+ "inpsalterpahlavi",
+ "olditalic",
+ "hanunoo",
+ "inherited",
+ "lepcha",
+ "p",
+ "inmongolian",
+ "zp",
+ "finalpunctuation",
+ "otheridcontinue",
+ "shrd",
+ "ingrantha",
+ "talu",
+ "otheralphabetic",
+ "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",
+ "inbasiclatin",
+ "format",
+ "innumberforms",
+ "inugaritic",
+ "separator",
+ "idsbinaryoperator",
+ "tagbanwa",
+ "bass",
+ "saur",
+ "nbat",
+ "intaixuanjingsymbols",
+ "joincontrol",
+ "otheridstart",
+ "inbyzantinemusicalsymbols",
+ "intags",
+ "nabataean",
+ "insuperscriptsandsubscripts",
+ "intibetan",
+ "insaurashtra",
+ "othersymbol",
+ "ext",
+ "inarabicpresentationformsa",
+ "inmiscellaneousmathematicalsymbolsb",
+ "otherlowercase",
+ "phoenician",
+#endif /* USE_UNICODE_PROPERTIES */
+ "lower",
+#ifndef USE_UNICODE_PROPERTIES
+ "graph",
+#else /* USE_UNICODE_PROPERTIES */
+ "linb",
+ "po",
+ "inmyanmarextendedb",
+ "limb",
+ "inbraillepatterns",
+ "tibt",
+ "cuneiform",
+ "bali",
+ "oldpersian",
+ "oldpermic",
+ "pf",
+ "word",
+ "tibetan",
+ "incyrillicsupplement",
+ "elba",
+ "insupplementalmathematicaloperators",
+ "inbalinese",
+ "bengali",
+ "caseignorable",
+ "incountingrodnumerals",
+ "other",
+ "tirhuta",
+ "othernumber",
+ "balinese",
+ "elbasan",
+ "inunifiedcanadianaboriginalsyllabics",
+ "lowercaseletter",
+ "ethiopic",
+ "gran",
+ "ingurmukhi",
+ "sund",
+ "inethiopicsupplement",
+ "inoldpersian",
+ "inoldpermic",
+ "othermath",
+ "unassigned",
+ "hmng",
+ "narb",
+ "brai",
+ "hang",
+ "insorasompeng",
+ "arab",
+ "plrd",
+ "ingujarati",
+ "brahmi",
+ "runr",
+ "ahex",
+ "mong",
+ "pauc",
+ "sarb",
+ "ogam",
+ "olower",
+ "pd",
+ "number",
+ "inbrahmi",
+ "otherletter",
+ "ingothic",
+ "phagspa",
+ "inletterlikesymbols",
+ "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 */
+ "xidstart",
+ "inrejang",
+ "malayalam",
+ "idstrinaryoperator",
+ "invai",
+ "vai",
+ "vaii",
+ "hiragana",
+ "ingeorgian",
+ "braille",
+ "geor",
+ "brah",
+ "glagolitic",
+ "inkannada",
+ "cakm",
+ "kana",
+ "hebr",
+ "inshavian",
+ "vs",
+ "inchakma",
+ "ogham",
+ "sylotinagri",
+ "inunifiedcanadianaboriginalsyllabicsextended",
+ "inmeroitichieroglyphs",
+ "grantha",
+ "graphemebase",
+ "mathsymbol",
+ "mymr",
+ "insupplementaryprivateuseareaa",
+ "mendekikakui",
+ "incjkcompatibilityforms",
+ "inhalfwidthandfullwidthforms",
+ "incjkcompatibilityideographs",
+ "inkaithi",
+ "avst",
+ "inarabicsupplement",
+ "takri",
+ "syrc",
+ "meeteimayek",
+ "myanmar",
+ "avestan",
+ "inhanguljamoextendeda",
+ "goth",
+ "inkatakana",
+ "incyrillicextendeda",
+ "alphabetic",
+ "syriac",
+ "ideographic",
+ "incjkstrokes",
+ "inlinearbsyllabary",
+ "tavt",
+ "intaiviet",
+ "incjkcompatibilityideographssupplement",
+ "inmeeteimayek",
+ "kali",
+ "inyiradicals",
+ "lu",
+ "inoriya",
+ "hebrew",
+ "extender",
+ "inhighprivateusesurrogates",
+ "limbu",
+ "inbuhid",
+ "inethiopicextendeda",
+ "xidcontinue",
+ "inyijinghexagramsymbols",
+ "logicalorderexception",
+ "inhebrew",
+ "cyrl",
+ "osmanya",
+ "phnx",
+ "incombiningdiacriticalmarks",
+ "inkanasupplement",
+ "inlisu",
+ "changeswhencasemapped",
+ "incombiningdiacriticalmarksforsymbols",
+ "cwu",
+ "phag",
+ "insmallformvariants",
+ "inpahawhhmong",
+ "otheruppercase",
+ "intelugu",
+ "incombiningdiacriticalmarkssupplement",
+ "ingeometricshapesextended",
+ "xpeo",
+ "bamu",
+ "inbamum",
+ "mark",
+ "dupl",
+ "graph",
+ "dashpunctuation",
+ "patternsyntax",
+ "changeswhentitlecased",
+ "inkharoshthi",
+ "inkhmer",
+ "java",
+ "sylo",
+ "ugaritic",
+ "otherdefaultignorablecodepoint",
+ "softdotted",
+ "uideo",
+ "inphoneticextensions",
+ "injavanese",
+ "invariationselectors",
+ "kaithi",
+ "cyrillic",
+ "intakri",
+ "takr",
+ "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",
+ "invedicextensions",
+ "graphemeextend",
+ "kannada",
+ "inbuginese",
+ "olck",
+ "meroitichieroglyphs",
+ "ugar",
+ "intagalog",
+ "inbamumsupplement",
+ "olchiki",
+ "incurrencysymbols",
+ "tagb",
+ "inaegeannumbers",
+ "intagbanwa",
+ "uppercase",
+ "defaultignorablecodepoint",
+ "glag",
+ "inkatakanaphoneticextensions",
+ "changeswhencasefolded",
+ "inpaucinhau",
+ "inprivateusearea",
+ "paucinhau",
+ "spacingmark",
+ "khmr",
+ "khar",
+ "inarabicpresentationformsb",
+ "changeswhenlowercased",
+ "tglg",
+ "inethiopicextended",
+ "incombiningdiacriticalmarksextended",
+ "oupper",
+ "incjksymbolsandpunctuation",
+ "bopo",
+ "punctuation",
+ "combiningmark",
+ "inplayingcards",
+ "inbopomofo",
+ "hyphen",
+ "inkhojki",
+ "nko",
+ "nkoo",
+ "enclosingmark",
+ "openpunctuation",
+ "currencysymbol",
+ "inverticalforms",
+ "hex",
+ "modifiersymbol",
+ "inlatinextendedb",
+ "kharoshthi",
+ "cherokee",
+ "pahawhhmong",
+ "cypriot",
+ "incypriotsyllabary",
+ "palmyrene",
+ "upper",
+ "aghb",
+ "georgian",
+ "gujr",
+ "grbase",
+ "gujarati",
+ "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",
+ "incyrillicextendedb",
+ "innoblock",
+ "any",
+ "xsux",
+ "bugi",
+ "inkhudawadi",
+ "telugu",
+ "changeswhenuppercased",
+ "grek",
+ "guru",
+ "paragraphseparator",
+ "buginese",
+ "inyisyllables",
+ "egyp",
+ "khudawadi",
+ "unknown",
+ "bassavah",
+ "inegyptianhieroglyphs",
+ "buhid",
+ "inkayahli",
+ "inmeroiticcursive",
+ "incjkcompatibility",
+ "oldsoutharabian",
+ "quotationmark",
+ "inhangulcompatibilityjamo",
+ "qmark",
+ "incjkunifiedideographsextensionc",
+ "sk",
+ "incjkunifiedideographsextensiona",
+ "incjkunifiedideographs",
+ "katakana",
+ "kayahli",
+ "duployan",
+ "incjkunifiedideographsextensiond",
+ "inbopomofoextended",
+ "khojki",
+ "zyyy",
+ "egyptianhieroglyphs",
+ "incjkunifiedideographsextensionb",
+ "batak",
+ "blank",
+ "inboxdrawing",
+ "greek",
+ "gurmukhi",
+ "grlink",
+ "graphemelink"
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
+#ifdef __GNUC__
+__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct uniname2ctype_struct *
+uniname2ctype_p (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const struct uniname2ctype_struct wordlist[] =
+ {
+#ifdef USE_UNICODE_PROPERTIES
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3, 34},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(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_str13, 17},
+ {-1},
+ {(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_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_str46, 47},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str48, 49},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str51, 168},
+ {-1}, {-1}, {-1},
+ {(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_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_str69, 265},
+ {-1}, {-1},
+ {(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},
+ {-1},
+ {(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_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_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_str153, 13},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str155, 302},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str157, 325},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str161, 331},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str163, 276},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str166, 488},
+ {-1}, {-1}, {-1},
+ {(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_str175, 485},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str183, 152},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 65},
+ {-1}, {-1}, {-1},
+ {(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_str203, 75},
+ {-1},
+ {(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_str208, 273},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 88},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-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_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_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_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_str252, 28},
+ {-1}, {-1},
+ {(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_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_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_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_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_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_str335, 169},
+ {-1},
+ {(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_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_str382, 451},
+ {-1}, {-1}, {-1},
+ {(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_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_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_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_str423, 196},
+ {-1},
+ {(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_str441, 486},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 66},
+ {-1}, {-1},
+ {(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_str468, 481},
+ {-1},
+ {(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_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_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_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_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_str570, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str571, 171},
+ {-1},
+ {(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_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_str587, 163},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(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_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_str608, 307},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str609, 37},
+ {-1},
+ {(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_str614, 21},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 264},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 1},
+ {-1},
+ {(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_str627, 74},
+ {-1}, {-1},
+ {(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_str640, 50},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(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_str699, 226},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str700, 187},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str703, 35},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str705, 23},
+ {-1}, {-1},
+ {(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_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_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_str749, 428},
+ {-1}, {-1}, {-1},
+ {(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_str763, 125},
+ {-1}, {-1}, {-1},
+ {(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_str779, 371},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str783, 425},
+ {-1}, {-1}, {-1},
+ {(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_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_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_str830, 440},
+ {-1},
+ {(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_str838, 410},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str845, 144},
+ {-1}, {-1},
+ {(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_str858, 57},
+ {-1}, {-1},
+ {(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_str866, 484},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 54},
+ {-1},
+ {(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_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_str932, 454},
+ {-1},
+ {(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},
+#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},
+#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},
+#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},
+#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},
+#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},
+#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_str972, 18},
+ {-1},
+ {(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_str982, 103},
+ {-1},
+ {(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_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_str1017, 475},
+ {-1},
+ {(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_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_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_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_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_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_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_str1080, 42},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 12},
+ {-1},
+ {(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_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_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_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_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_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_str1151, 140},
+ {-1},
+ {(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_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_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_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_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_str1206, 105},
+ {-1}, {-1}, {-1}, {-1},
+ {(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},
+ {(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_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_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_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_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_str1283, 71},
+ {-1},
+ {(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_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_str1317, 329},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 26},
+ {-1}, {-1},
+ {(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_str1324, 8},
+ {-1}, {-1},
+ {(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_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_str1368, 390},
+ {-1}, {-1}, {-1}, {-1},
+ {(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_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_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_str1420, 68},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1421, 379},
+ {-1}, {-1},
+ {(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_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_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_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_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_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_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_str1495, 433},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1498, 180},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1500, 72},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1502, 49},
+ {-1}, {-1},
+ {(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_str1516, 402},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1518, 405},
+ {-1}, {-1},
+ {(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_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_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_str1542, 353},
+ {-1},
+ {(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_str1555, 358},
+ {-1},
+ {(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_str1564, 495},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(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_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_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_str1598, 393},
+ {-1},
+ {(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_str1606, 292},
+ {-1},
+ {(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_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_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_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_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_str1656, 467},
+ {-1}, {-1}, {-1}, {-1},
+ {(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_str1665, 313},
+ {-1}, {-1}, {-1}, {-1},
+ {(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}, {-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_str1689, 370},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1692, 30},
+ {-1},
+ {(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_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_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_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_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_str1744, 165},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1747, 77},
+ {-1},
+ {(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_str1765, 149},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1772, 347},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1775, 312},
+ {-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_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_str1804, 174},
+ {-1}, {-1},
+ {(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_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_str1831, 268},
+ {-1}, {-1}, {-1},
+ {(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_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_str1859, 71},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(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_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_str1878, 464},
+ {-1},
+ {(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_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_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_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_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_str1971, 115},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1976, 345},
+ {-1}, {-1}, {-1},
+ {(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_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_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_str2021, 203},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2028, 452},
+ {-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_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_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_str2080, 100},
+ {-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_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_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},
+ {(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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-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_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_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_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}, {-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_str2406, 228},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2417, 349},
+ {-1}, {-1}, {-1},
+ {(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_str2449, 166},
+ {-1}, {-1}, {-1}, {-1},
+ {(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}, {-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_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_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}, {-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_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}, {-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_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},
+ {-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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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_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_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}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-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_str3112, 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},
+ {(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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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_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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-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_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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {(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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-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_str4322, 73}
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = uniname2ctype_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + uniname2ctype_pool;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
+
+static int
+uniname2ctype(const UChar *name, unsigned int len)
+{
+ const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len);
+ if (p) return p->ctype;
+ return -1;
+}
diff --git a/enc/unicode/name2ctype.h.blt b/enc/unicode/name2ctype.h.blt
new file mode 100644
index 0000000000..2e80edf525
--- /dev/null
+++ b/enc/unicode/name2ctype.h.blt
@@ -0,0 +1,28722 @@
+/* C code produced by gperf version 3.0.3 */
+/* 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' */
+#else /* USE_UNICODE_PROPERTIES */
+/* Computed positions: -k'1-3,5-6,12,16,$' */
+#endif /* USE_UNICODE_PROPERTIES */
+
+#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
+
+
+#define long size_t
+
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,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43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0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x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 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2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d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 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d00, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 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,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527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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,
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ffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0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xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17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 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+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,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x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004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x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0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06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,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 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 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+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OnigCodePoint CR_Any[] = {
+ 1,
+ 0x0000, 0x10ffff,
+}; /* CR_Any */
+
+/* 'Assigned': - */
+static const OnigCodePoint CR_Assigned[] = {
+ 539,
+ 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,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0, 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, 0x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0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0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x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Assigned */
+
+/* 'C': Major Category */
+static const OnigCodePoint CR_C[] = {
+ 541,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+ 0x00ad, 0x00ad,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
+ 0x06dd, 0x06dd,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+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 0xabfa, 0xabff,
+ 0xd7a4, 0xd7af,
+ 0xd7c7, 0xd7ca,
+ 0xd7fc, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d173, 0x1d17a,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+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ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_C */
+
+/* 'Cc': General Category */
+#define CR_Cc CR_Cntrl
+
+/* 'Cf': General Category */
+static const OnigCodePoint CR_Cf[] = {
+ 14,
+ 0x00ad, 0x00ad,
+ 0x0600, 0x0604,
+ 0x06dd, 0x06dd,
+ 0x070f, 0x070f,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x2064,
+ 0x206a, 0x206f,
+ 0xfeff, 0xfeff,
+ 0xfff9, 0xfffb,
+ 0x110bd, 0x110bd,
+ 0x1d173, 0x1d17a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Cf */
+
+/* 'Cn': General Category */
+static const OnigCodePoint CR_Cn[] = {
+ 539,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x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+ 0xff00, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfff8,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0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x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Cn */
+
+/* 'Co': General Category */
+static const OnigCodePoint CR_Co[] = {
+ 3,
+ 0xe000, 0xf8ff,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Co */
+
+/* 'Cs': General Category */
+static const OnigCodePoint CR_Cs[] = {
+ 1,
+ 0xd800, 0xdfff,
+}; /* CR_Cs */
+
+/* 'L': Major Category */
+static const OnigCodePoint CR_L[] = {
+ 486,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x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 0x0ec6,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f88, 0x0f8c,
+ 0x1000, 0x102a,
+ 0x103f, 0x103f,
+ 0x1050, 0x1055,
+ 0x105a, 0x105d,
+ 0x1061, 0x1061,
+ 0x1065, 0x1066,
+ 0x106e, 0x1070,
+ 0x1075, 0x1081,
+ 0x108e, 0x108e,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1aa7, 0x1aa7,
+ 0x1b05, 0x1b33,
+ 0x1b45, 0x1b4b,
+ 0x1b83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e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabe2,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb1d,
+ 0xfb1f, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 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ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_L */
+
+/* 'LC': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 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1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
+/* 'Ll': General Category */
+static const OnigCodePoint CR_Ll[] = {
+ 611,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02af,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x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xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa771, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Ll */
+
+/* 'Lm': General Category */
+static const OnigCodePoint CR_Lm[] = {
+ 52,
+ 0x02b0, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0374, 0x0374,
+ 0x037a, 0x037a,
+ 0x0559, 0x0559,
+ 0x0640, 0x0640,
+ 0x06e5, 0x06e6,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0971, 0x0971,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x10fc, 0x10fc,
+ 0x17d7, 0x17d7,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c78, 0x1c7d,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2c7c, 0x2c7d,
+ 0x2d6f, 0x2d6f,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x303b, 0x303b,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa4f8, 0xa4fd,
+ 0xa60c, 0xa60c,
+ 0xa67f, 0xa67f,
+ 0xa717, 0xa71f,
+ 0xa770, 0xa770,
+ 0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
+}; /* CR_Lm */
+
+/* 'Lo': General Category */
+static const OnigCodePoint CR_Lo[] = {
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x01bb, 0x01bb,
+ 0x01c0, 0x01c3,
+ 0x0294, 0x0294,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x063f,
+ 0x0641, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x0800, 0x0815,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x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38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff66, 0xff6f,
+ 0xff71, 0xff9d,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10450, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x13000, 0x1342e,
+ 0x16800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lt */
+
+/* 'Lu': General Category */
+static const OnigCodePoint CR_Lu[] = {
+ 608,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 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a646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Lu */
+
+/* 'M': Major Category */
+static const OnigCodePoint CR_M[] = {
+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x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11046,
+ 0x11080, 0x11082,
+ 0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_M */
+
+/* 'Mc': General Category */
+static const OnigCodePoint CR_Mc[] = {
+ 126,
+ 0x0903, 0x0903,
+ 0x093b, 0x093b,
+ 0x093e, 0x0940,
+ 0x0949, 0x094c,
+ 0x094e, 0x094f,
+ 0x0982, 0x0983,
+ 0x09be, 0x09c0,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09d7, 0x09d7,
+ 0x0a03, 0x0a03,
+ 0x0a3e, 0x0a40,
+ 0x0a83, 0x0a83,
+ 0x0abe, 0x0ac0,
+ 0x0ac9, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0b02, 0x0b03,
+ 0x0b3e, 0x0b3e,
+ 0x0b40, 0x0b40,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b57, 0x0b57,
+ 0x0bbe, 0x0bbf,
+ 0x0bc1, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd7, 0x0bd7,
+ 0x0c01, 0x0c03,
+ 0x0c41, 0x0c44,
+ 0x0c82, 0x0c83,
+ 0x0cbe, 0x0cbe,
+ 0x0cc0, 0x0cc4,
+ 0x0cc7,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 0xa880, 0xa881,
+ 0xa8b4, 0xa8c3,
+ 0xa952, 0xa953,
+ 0xa983, 0xa983,
+ 0xa9b4, 0xa9b5,
+ 0xa9ba, 0xa9bb,
+ 0xa9bd, 0xa9c0,
+ 0xaa2f, 0xaa30,
+ 0xaa33, 0xaa34,
+ 0xaa4d, 0xaa4d,
+ 0xaa7b, 0xaa7b,
+ 0xaaeb, 0xaaeb,
+ 0xaaee, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabe4,
+ 0xabe6, 0xabe7,
+ 0xabe9, 0xabea,
+ 0xabec, 0xabec,
+ 0x11000, 0x11000,
+ 0x11002, 0x11002,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
+ 0x1d165, 0x1d166,
+ 0x1d16d, 0x1d172,
+}; /* CR_Mc */
+
+/* 'Me': General Category */
+static const OnigCodePoint CR_Me[] = {
+ 4,
+ 0x0488, 0x0489,
+ 0x20dd, 0x20e0,
+ 0x20e2, 0x20e4,
+ 0xa670, 0xa672,
+}; /* CR_Me */
+
+/* 'Mn': General Category */
+static const OnigCodePoint CR_Mn[] = {
+ 220,
+ 0x0300, 0x036f,
+ 0x0483, 0x0487,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,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0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Mn */
+
+/* 'N': Major Category */
+static const OnigCodePoint CR_N[] = {
+ 88,
+ 0x0030, 0x0039,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x09f4, 0x09f9,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0b72, 0x0b77,
+ 0x0be6, 0x0bf2,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7e,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d75,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f33,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x1369, 0x137c,
+ 0x16ee, 0x16f0,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19da,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x2182,
+ 0x2185, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa620, 0xa629,
+ 0xa6e6, 0xa6ef,
+ 0xa830, 0xa835,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x10107, 0x10133,
+ 0x10140, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x104a0, 0x104a9,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x12400, 0x12462,
+ 0x1d360, 0x1d371,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f100, 0x1f10a,
+}; /* CR_N */
+
+/* 'Nd': General Category */
+#define CR_Nd CR_Digit
+
+/* 'Nl': General Category */
+static const OnigCodePoint CR_Nl[] = {
+ 12,
+ 0x16ee, 0x16f0,
+ 0x2160, 0x2182,
+ 0x2185, 0x2188,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0xa6e6, 0xa6ef,
+ 0x10140, 0x10174,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x12400, 0x12462,
+}; /* CR_Nl */
+
+/* 'No': General Category */
+static const OnigCodePoint CR_No[] = {
+ 42,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x09f4, 0x09f9,
+ 0x0b72, 0x0b77,
+ 0x0bf0, 0x0bf2,
+ 0x0c78, 0x0c7e,
+ 0x0d70, 0x0d75,
+ 0x0f2a, 0x0f33,
+ 0x1369, 0x137c,
+ 0x17f0, 0x17f9,
+ 0x19da, 0x19da,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x215f,
+ 0x2189, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa830, 0xa835,
+ 0x10107, 0x10133,
+ 0x10175, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x11065,
+ 0x1d360, 0x1d371,
+ 0x1f100, 0x1f10a,
+}; /* CR_No */
+
+/* 'P': Major Category */
+#define CR_P CR_Punct
+
+/* 'Pc': General Category */
+static const OnigCodePoint CR_Pc[] = {
+ 6,
+ 0x005f, 0x005f,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xff3f, 0xff3f,
+}; /* CR_Pc */
+
+/* 'Pd': General Category */
+static const OnigCodePoint CR_Pd[] = {
+ 16,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Pd */
+
+/* 'Pe': General Category */
+static const OnigCodePoint CR_Pe[] = {
+ 70,
+ 0x0029, 0x0029,
+ 0x005d, 0x005d,
+ 0x007d, 0x007d,
+ 0x0f3b, 0x0f3b,
+ 0x0f3d, 0x0f3d,
+ 0x169c, 0x169c,
+ 0x2046, 0x2046,
+ 0x207e, 0x207e,
+ 0x208e, 0x208e,
+ 0x232a, 0x232a,
+ 0x2769, 0x2769,
+ 0x276b, 0x276b,
+ 0x276d, 0x276d,
+ 0x276f, 0x276f,
+ 0x2771, 0x2771,
+ 0x2773, 0x2773,
+ 0x2775, 0x2775,
+ 0x27c6, 0x27c6,
+ 0x27e7, 0x27e7,
+ 0x27e9, 0x27e9,
+ 0x27eb, 0x27eb,
+ 0x27ed, 0x27ed,
+ 0x27ef, 0x27ef,
+ 0x2984, 0x2984,
+ 0x2986, 0x2986,
+ 0x2988, 0x2988,
+ 0x298a, 0x298a,
+ 0x298c, 0x298c,
+ 0x298e, 0x298e,
+ 0x2990, 0x2990,
+ 0x2992, 0x2992,
+ 0x2994, 0x2994,
+ 0x2996, 0x2996,
+ 0x2998, 0x2998,
+ 0x29d9, 0x29d9,
+ 0x29db, 0x29db,
+ 0x29fd, 0x29fd,
+ 0x2e23, 0x2e23,
+ 0x2e25, 0x2e25,
+ 0x2e27, 0x2e27,
+ 0x2e29, 0x2e29,
+ 0x3009, 0x3009,
+ 0x300b, 0x300b,
+ 0x300d, 0x300d,
+ 0x300f, 0x300f,
+ 0x3011, 0x3011,
+ 0x3015, 0x3015,
+ 0x3017, 0x3017,
+ 0x3019, 0x3019,
+ 0x301b, 0x301b,
+ 0x301e, 0x301f,
+ 0xfd3f, 0xfd3f,
+ 0xfe18, 0xfe18,
+ 0xfe36, 0xfe36,
+ 0xfe38, 0xfe38,
+ 0xfe3a, 0xfe3a,
+ 0xfe3c, 0xfe3c,
+ 0xfe3e, 0xfe3e,
+ 0xfe40, 0xfe40,
+ 0xfe42, 0xfe42,
+ 0xfe44, 0xfe44,
+ 0xfe48, 0xfe48,
+ 0xfe5a, 0xfe5a,
+ 0xfe5c, 0xfe5c,
+ 0xfe5e, 0xfe5e,
+ 0xff09, 0xff09,
+ 0xff3d, 0xff3d,
+ 0xff5d, 0xff5d,
+ 0xff60, 0xff60,
+ 0xff63, 0xff63,
+}; /* CR_Pe */
+
+/* 'Pf': General Category */
+static const OnigCodePoint CR_Pf[] = {
+ 10,
+ 0x00bb, 0x00bb,
+ 0x2019, 0x2019,
+ 0x201d, 0x201d,
+ 0x203a, 0x203a,
+ 0x2e03, 0x2e03,
+ 0x2e05, 0x2e05,
+ 0x2e0a, 0x2e0a,
+ 0x2e0d, 0x2e0d,
+ 0x2e1d, 0x2e1d,
+ 0x2e21, 0x2e21,
+}; /* CR_Pf */
+
+/* 'Pi': General Category */
+static const OnigCodePoint CR_Pi[] = {
+ 11,
+ 0x00ab, 0x00ab,
+ 0x2018, 0x2018,
+ 0x201b, 0x201c,
+ 0x201f, 0x201f,
+ 0x2039, 0x2039,
+ 0x2e02, 0x2e02,
+ 0x2e04, 0x2e04,
+ 0x2e09, 0x2e09,
+ 0x2e0c, 0x2e0c,
+ 0x2e1c, 0x2e1c,
+ 0x2e20, 0x2e20,
+}; /* CR_Pi */
+
+/* 'Po': General Category */
+static const OnigCodePoint CR_Po[] = {
+ 135,
+ 0x0021, 0x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10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Po */
+
+/* 'Ps': General Category */
+static const OnigCodePoint CR_Ps[] = {
+ 72,
+ 0x0028, 0x0028,
+ 0x005b, 0x005b,
+ 0x007b, 0x007b,
+ 0x0f3a, 0x0f3a,
+ 0x0f3c, 0x0f3c,
+ 0x169b, 0x169b,
+ 0x201a, 0x201a,
+ 0x201e, 0x201e,
+ 0x2045, 0x2045,
+ 0x207d, 0x207d,
+ 0x208d, 0x208d,
+ 0x2329, 0x2329,
+ 0x2768, 0x2768,
+ 0x276a, 0x276a,
+ 0x276c, 0x276c,
+ 0x276e, 0x276e,
+ 0x2770, 0x2770,
+ 0x2772, 0x2772,
+ 0x2774, 0x2774,
+ 0x27c5, 0x27c5,
+ 0x27e6, 0x27e6,
+ 0x27e8, 0x27e8,
+ 0x27ea, 0x27ea,
+ 0x27ec, 0x27ec,
+ 0x27ee, 0x27ee,
+ 0x2983, 0x2983,
+ 0x2985, 0x2985,
+ 0x2987, 0x2987,
+ 0x2989, 0x2989,
+ 0x298b, 0x298b,
+ 0x298d, 0x298d,
+ 0x298f, 0x298f,
+ 0x2991, 0x2991,
+ 0x2993, 0x2993,
+ 0x2995, 0x2995,
+ 0x2997, 0x2997,
+ 0x29d8, 0x29d8,
+ 0x29da, 0x29da,
+ 0x29fc, 0x29fc,
+ 0x2e22, 0x2e22,
+ 0x2e24, 0x2e24,
+ 0x2e26, 0x2e26,
+ 0x2e28, 0x2e28,
+ 0x3008, 0x3008,
+ 0x300a, 0x300a,
+ 0x300c, 0x300c,
+ 0x300e, 0x300e,
+ 0x3010, 0x3010,
+ 0x3014, 0x3014,
+ 0x3016, 0x3016,
+ 0x3018, 0x3018,
+ 0x301a, 0x301a,
+ 0x301d, 0x301d,
+ 0xfd3e, 0xfd3e,
+ 0xfe17, 0xfe17,
+ 0xfe35, 0xfe35,
+ 0xfe37, 0xfe37,
+ 0xfe39, 0xfe39,
+ 0xfe3b, 0xfe3b,
+ 0xfe3d, 0xfe3d,
+ 0xfe3f, 0xfe3f,
+ 0xfe41, 0xfe41,
+ 0xfe43, 0xfe43,
+ 0xfe47, 0xfe47,
+ 0xfe59, 0xfe59,
+ 0xfe5b, 0xfe5b,
+ 0xfe5d, 0xfe5d,
+ 0xff08, 0xff08,
+ 0xff3b, 0xff3b,
+ 0xff5b, 0xff5b,
+ 0xff5f, 0xff5f,
+ 0xff62, 0xff62,
+}; /* CR_Ps */
+
+/* 'S': Major Category */
+static const OnigCodePoint CR_S[] = {
+ 198,
+ 0x0024, 0x0024,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
+ 0x00ac, 0x00ac,
+ 0x00ae, 0x00b1,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x03f6, 0x03f6,
+ 0x0482, 0x0482,
+ 0x058f, 0x058f,
+ 0x0606, 0x0608,
+ 0x060b, 0x060b,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09f2, 0x09f3,
+ 0x09fa, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 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x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x309b, 0x309c,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa490, 0xa4c6,
+ 0xa700, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,
+ 0xa828, 0xa82b,
+ 0xa836, 0xa839,
+ 0xaa77, 0xaa79,
+ 0xfb29, 0xfb29,
+ 0xfbb2, 0xfbc1,
+ 0xfdfc, 0xfdfd,
+ 0xfe62, 0xfe62,
+ 0xfe64, 0xfe66,
+ 0xfe69, 0xfe69,
+ 0xff04, 0xff04,
+ 0xff0b, 0xff0b,
+ 0xff1c, 0xff1e,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xff5c, 0xff5c,
+ 0xff5e, 0xff5e,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffc, 0xfffd,
+ 0x10137, 0x1013f,
+ 0x10179, 0x10189,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d164,
+ 0x1d16a, 0x1d16c,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d200, 0x1d241,
+ 0x1d245, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d6c1, 0x1d6c1,
+ 0x1d6db, 0x1d6db,
+ 0x1d6fb, 0x1d6fb,
+ 0x1d715, 0x1d715,
+ 0x1d735, 0x1d735,
+ 0x1d74f, 0x1d74f,
+ 0x1d76f, 0x1d76f,
+ 0x1d789, 0x1d789,
+ 0x1d7a9, 0x1d7a9,
+ 0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 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,
+}; /* CR_S */
+
+/* 'Sc': General Category */
+static const OnigCodePoint CR_Sc[] = {
+ 17,
+ 0x0024, 0x0024,
+ 0x00a2, 0x00a5,
+ 0x058f, 0x058f,
+ 0x060b, 0x060b,
+ 0x09f2, 0x09f3,
+ 0x09fb, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0bf9, 0x0bf9,
+ 0x0e3f, 0x0e3f,
+ 0x17db, 0x17db,
+ 0x20a0, 0x20b9,
+ 0xa838, 0xa838,
+ 0xfdfc, 0xfdfc,
+ 0xfe69, 0xfe69,
+ 0xff04, 0xff04,
+ 0xffe0, 0xffe1,
+ 0xffe5, 0xffe6,
+}; /* CR_Sc */
+
+/* 'Sk': General Category */
+static const OnigCodePoint CR_Sk[] = {
+ 27,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x309b, 0x309c,
+ 0xa700, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,
+ 0xfbb2, 0xfbc1,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xffe3, 0xffe3,
+}; /* CR_Sk */
+
+/* 'Sm': General Category */
+static const OnigCodePoint CR_Sm[] = {
+ 65,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03f6, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x2118, 0x2118,
+ 0x2140, 0x2144,
+ 0x214b, 0x214b,
+ 0x2190, 0x2194,
+ 0x219a, 0x219b,
+ 0x21a0, 0x21a0,
+ 0x21a3, 0x21a3,
+ 0x21a6, 0x21a6,
+ 0x21ae, 0x21ae,
+ 0x21ce, 0x21cf,
+ 0x21d2, 0x21d2,
+ 0x21d4, 0x21d4,
+ 0x21f4, 0x22ff,
+ 0x2308, 0x230b,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b3,
+ 0x23dc, 0x23e1,
+ 0x25b7, 0x25b7,
+ 0x25c1, 0x25c1,
+ 0x25f8, 0x25ff,
+ 0x266f, 0x266f,
+ 0x27c0, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x27ff,
+ 0x2900, 0x2982,
+ 0x2999, 0x29d7,
+ 0x29dc, 0x29fb,
+ 0x29fe, 0x2aff,
+ 0x2b30, 0x2b44,
+ 0x2b47, 0x2b4c,
+ 0xfb29, 0xfb29,
+ 0xfe62, 0xfe62,
+ 0xfe64, 0xfe66,
+ 0xff0b, 0xff0b,
+ 0xff1c, 0xff1e,
+ 0xff5c, 0xff5c,
+ 0xff5e, 0xff5e,
+ 0xffe2, 0xffe2,
+ 0xffe9, 0xffec,
+ 0x1d6c1, 0x1d6c1,
+ 0x1d6db, 0x1d6db,
+ 0x1d6fb, 0x1d6fb,
+ 0x1d715, 0x1d715,
+ 0x1d735, 0x1d735,
+ 0x1d74f, 0x1d74f,
+ 0x1d76f, 0x1d76f,
+ 0x1d789, 0x1d789,
+ 0x1d7a9, 0x1d7a9,
+ 0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Sm */
+
+/* 'So': General Category */
+static const OnigCodePoint CR_So[] = {
+ 153,
+ 0x00a6, 0x00a6,
+ 0x00a9, 0x00a9,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b0,
+ 0x0482, 0x0482,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09fa, 0x09fa,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 0x0bf8,
+ 0x0bfa, 0x0bfa,
+ 0x0c7f, 0x0c7f,
+ 0x0d79, 0x0d79,
+ 0x0f01, 0x0f03,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
+ 0x0f1a, 0x0f1f,
+ 0x0f34, 0x0f34,
+ 0x0f36, 0x0f36,
+ 0x0f38, 0x0f38,
+ 0x0fbe, 0x0fc5,
+ 0x0fc7, 0x0fcc,
+ 0x0fce, 0x0fcf,
+ 0x0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2117,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x214a, 0x214a,
+ 0x214c, 0x214d,
+ 0x214f, 0x214f,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21ad,
+ 0x21af, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21f3,
+ 0x2300, 0x2307,
+ 0x230c, 0x231f,
+ 0x2322, 0x2328,
+ 0x232b, 0x237b,
+ 0x237d, 0x239a,
+ 0x23b4, 0x23db,
+ 0x23e2, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x25b6,
+ 0x25b8, 0x25c0,
+ 0x25c2, 0x25f7,
+ 0x2600, 0x266e,
+ 0x2670, 0x26ff,
+ 0x2701, 0x2767,
+ 0x2794, 0x27bf,
+ 0x2800, 0x28ff,
+ 0x2b00, 0x2b2f,
+ 0x2b45, 0x2b46,
+ 0x2b50, 0x2b59,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa490, 0xa4c6,
+ 0xa828, 0xa82b,
+ 0xa836, 0xa837,
+ 0xa839, 0xa839,
+ 0xaa77, 0xaa79,
+ 0xfdfd, 0xfdfd,
+ 0xffe4, 0xffe4,
+ 0xffe8, 0xffe8,
+ 0xffed, 0xffee,
+ 0xfffc, 0xfffd,
+ 0x10137, 0x1013f,
+ 0x10179, 0x10189,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d164,
+ 0x1d16a, 0x1d16c,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d200, 0x1d241,
+ 0x1d245, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 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,
+}; /* CR_So */
+
+/* 'Z': Major Category */
+static const OnigCodePoint CR_Z[] = {
+ 9,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Z */
+
+/* 'Zl': General Category */
+static const OnigCodePoint CR_Zl[] = {
+ 1,
+ 0x2028, 0x2028,
+}; /* CR_Zl */
+
+/* 'Zp': General Category */
+static const OnigCodePoint CR_Zp[] = {
+ 1,
+ 0x2029, 0x2029,
+}; /* CR_Zp */
+
+/* 'Zs': General Category */
+static const OnigCodePoint CR_Zs[] = {
+ 8,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Zs */
+
+/* 'Math': Derived Property */
+static const OnigCodePoint CR_Math[] = {
+ 138,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x2061, 0x2064,
+ 0x207a, 0x207e,
+ 0x208a, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2118, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x2149,
+ 0x214b, 0x214b,
+ 0x2190, 0x21a7,
+ 0x21a9, 0x21ae,
+ 0x21b0, 0x21b1,
+ 0x21b6, 0x21b7,
+ 0x21bc, 0x21db,
+ 0x21dd, 0x21dd,
+ 0x21e4, 0x21e5,
+ 0x21f4, 0x22ff,
+ 0x2308, 0x230b,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b5,
+ 0x23b7, 0x23b7,
+ 0x23d0, 0x23d0,
+ 0x23dc, 0x23e2,
+ 0x25a0, 0x25a1,
+ 0x25ae, 0x25b7,
+ 0x25bc, 0x25c1,
+ 0x25c6, 0x25c7,
+ 0x25ca, 0x25cb,
+ 0x25cf, 0x25d3,
+ 0x25e2, 0x25e2,
+ 0x25e4, 0x25e4,
+ 0x25e7, 0x25ec,
+ 0x25f8, 0x25ff,
+ 0x2605, 0x2606,
+ 0x2640, 0x2640,
+ 0x2642, 0x2642,
+ 0x2660, 0x2663,
+ 0x266d, 0x266f,
+ 0x27c0, 0x27ff,
+ 0x2900, 0x2aff,
+ 0x2b30, 0x2b44,
+ 0x2b47, 0x2b4c,
+ 0xfb29, 0xfb29,
+ 0xfe61, 0xfe66,
+ 0xfe68, 0xfe68,
+ 0xff0b, 0xff0b,
+ 0xff1c, 0xff1e,
+ 0xff3c, 0xff3c,
+ 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 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Math */
+
+/* 'Alphabetic': Derived Property */
+#define CR_Alphabetic CR_Alpha
+
+/* 'Lowercase': Derived Property */
+#define CR_Lowercase CR_Lower
+
+/* 'Uppercase': Derived Property */
+#define CR_Uppercase CR_Upper
+
+/* 'Cased': Derived Property */
+static const OnigCodePoint CR_Cased[] = {
+ 119,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0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+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_Cased */
+
+/* 'Case_Ignorable': Derived Property */
+static const OnigCodePoint CR_Case_Ignorable[] = {
+ 295,
+ 0x0027, 0x0027,
+ 0x002e, 0x002e,
+ 0x003a, 0x003a,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00ad, 0x00ad,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0387, 0x0387,
+ 0x0483, 0x0489,
+ 0x0559, 0x0559,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05f4, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0610, 0x061a,
+ 0x0640, 0x0640,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dd,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x070f, 0x070f,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0816, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0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0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
+ 0x1d167, 0x1d169,
+ 0x1d173, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Case_Ignorable */
+
+/* 'Changes_When_Lowercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Lowercased[] = {
+ 571,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
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0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Lowercased */
+
+/* 'Changes_When_Uppercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Uppercased[] = {
+ 586,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c5, 0x01c6,
+ 0x01c8, 0x01c9,
+ 0x01cb, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f2, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 0x04fb,
+ 0x04fd, 0x04fd,
+ 0x04ff, 0x04ff,
+ 0x0501, 0x0501,
+ 0x0503, 0x0503,
+ 0x0505, 0x0505,
+ 0x0507, 0x0507,
+ 0x0509, 0x0509,
+ 0x050b, 0x050b,
+ 0x050d, 0x050d,
+ 0x050f, 0x050f,
+ 0x0511, 0x0511,
+ 0x0513, 0x0513,
+ 0x0515, 0x0515,
+ 0x0517, 0x0517,
+ 0x0519, 0x0519,
+ 0x051b, 0x051b,
+ 0x051d, 0x051d,
+ 0x051f, 0x051f,
+ 0x0521, 0x0521,
+ 0x0523, 0x0523,
+ 0x0525, 0x0525,
+ 0x0527, 0x0527,
+ 0x0561, 0x0587,
+ 0x1d79, 0x1d79,
+ 0x1d7d, 0x1d7d,
+ 0x1e01, 0x1e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, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Uppercased */
+
+/* 'Changes_When_Titlecased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Titlecased[] = {
+ 587,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x01c4,
+ 0x01c6, 0x01c7,
+ 0x01c9, 0x01ca,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f1,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 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a737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Titlecased */
+
+/* 'Changes_When_Casefolded': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casefolded[] = {
+ 582,
+ 0x0041, 0x005a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00df,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x0149, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x017f, 0x017f,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0345, 0x0345,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03c2, 0x03c2,
+ 0x03cf, 0x03d1,
+ 0x03d5, 0x03d6,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0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+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Casefolded */
+
+/* 'Changes_When_Casemapped': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casemapped[] = {
+ 104,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x0137,
+ 0x0139, 0x018c,
+ 0x018e, 0x019a,
+ 0x019c, 0x01a9,
+ 0x01ac, 0x01b9,
+ 0x01bc, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x0220,
+ 0x0222, 0x0233,
+ 0x023a, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03d1,
+ 0x03d5, 0x03f2,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03fb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ff41, 0xff5a,
+ 0x10400, 0x1044f,
+}; /* CR_Changes_When_Casemapped */
+
+/* 'ID_Start': Derived Property */
+static const OnigCodePoint CR_ID_Start[] = {
+ 488,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 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fbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x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ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_ID_Start */
+
+/* 'ID_Continue': Derived Property */
+static const OnigCodePoint CR_ID_Continue[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x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10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1369, 0x1371,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 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xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x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
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 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xfe7d, 0xfe7d,
+ 0xfe7f, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xff9d,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1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, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_XID_Start */
+
+/* 'XID_Continue': Derived Property */
+static const OnigCodePoint CR_XID_Continue[] = {
+ 571,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 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+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1369, 0x1371,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1cf6,
+ 0x1d00, 0x1de6,
+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, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfc5d,
+ 0xfc64, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdf9,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe71, 0xfe71,
+ 0xfe73, 0xfe73,
+ 0xfe77, 0xfe77,
+ 0xfe79, 0xfe79,
+ 0xfe7b, 0xfe7b,
+ 0xfe7d, 0xfe7d,
+ 0xfe7f, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+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{
+ 15,
+ 0x00ad, 0x00ad,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x180b, 0x180d,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x206f,
+ 0x3164, 0x3164,
+ 0xfe00, 0xfe0f,
+ 0xfeff, 0xfeff,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0x1d173, 0x1d17a,
+ 0xe0000, 0xe0fff,
+}; /* CR_Default_Ignorable_Code_Point */
+
+/* 'Grapheme_Extend': Derived Property */
+static const OnigCodePoint CR_Grapheme_Extend[] = {
+ 232,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09be,
+ 0x09c1, 0x09c4,
+ 0x09cd, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a02,
+ 0x0a3c, 0x0a3c,
+ 0x0a41, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,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x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d165, 0x1d165,
+ 0x1d167, 0x1d169,
+ 0x1d16e, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Grapheme_Extend */
+
+/* 'Grapheme_Base': Derived Property */
+static const OnigCodePoint CR_Grapheme_Base[] = {
+ 643,
+ 0x0020, 0x007e,
+ 0x00a0, 0x00ac,
+ 0x00ae, 0x02ff,
+ 0x0370, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0482,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0606, 0x060f,
+ 0x061b, 0x061b,
+ 0x061e, 0x064a,
+ 0x0660, 0x066f,
+ 0x0671, 0x06d5,
+ 0x06de, 0x06de,
+ 0x06e5, 0x06e6,
+ 0x06e9, 0x06e9,
+ 0x06ee, 0x070d,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0830, 0x083e,
+ 0x0840, 0x0858,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0903, 0x0939,
+ 0x093b, 0x093b,
+ 0x093d, 0x0940,
+ 0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 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,
+ 0x1360, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1735, 0x1736,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17b6,
+ 0x17be, 0x17c5,
+ 0x17c7, 0x17c8,
+ 0x17d4, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180a,
+ 0x180e, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1923, 0x1926,
+ 0x1929, 0x192b,
+ 0x1930, 0x1931,
+ 0x1933, 0x1938,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a16,
+ 0x1a19, 0x1a1b,
+ 0x1a1e, 0x1a55,
+ 0x1a57, 0x1a57,
+ 0x1a61, 0x1a61,
+ 0x1a63, 0x1a64,
+ 0x1a6d, 0x1a72,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b04, 0x1b33,
+ 0x1b35, 0x1b35,
+ 0x1b3b, 0x1b3b,
+ 0x1b3d, 0x1b41,
+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, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 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, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a40, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x11000,
+ 0x11002, 0x11037,
+ 0x11047, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11082, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
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0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Grapheme_Base */
+
+/* 'Grapheme_Link': Derived Property */
+static const OnigCodePoint CR_Grapheme_Link[] = {
+ 33,
+ 0x094d, 0x094d,
+ 0x09cd, 0x09cd,
+ 0x0a4d, 0x0a4d,
+ 0x0acd, 0x0acd,
+ 0x0b4d, 0x0b4d,
+ 0x0bcd, 0x0bcd,
+ 0x0c4d, 0x0c4d,
+ 0x0ccd, 0x0ccd,
+ 0x0d4d, 0x0d4d,
+ 0x0dca, 0x0dca,
+ 0x0e3a, 0x0e3a,
+ 0x0f84, 0x0f84,
+ 0x1039, 0x103a,
+ 0x1714, 0x1714,
+ 0x1734, 0x1734,
+ 0x17d2, 0x17d2,
+ 0x1a60, 0x1a60,
+ 0x1b44, 0x1b44,
+ 0x1baa, 0x1bab,
+ 0x1bf2, 0x1bf3,
+ 0x2d7f, 0x2d7f,
+ 0xa806, 0xa806,
+ 0xa8c4, 0xa8c4,
+ 0xa953, 0xa953,
+ 0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
+ 0xabed, 0xabed,
+ 0x10a3f, 0x10a3f,
+ 0x11046, 0x11046,
+ 0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
+}; /* CR_Grapheme_Link */
+
+/* 'Common': Script */
+static const OnigCodePoint CR_Common[] = {
+ 157,
+ 0x0000, 0x0040,
+ 0x005b, 0x0060,
+ 0x007b, 0x00a9,
+ 0x00ab, 0x00b9,
+ 0x00bb, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02b9, 0x02df,
+ 0x02e5, 0x02e9,
+ 0x02ec, 0x02ff,
+ 0x0374, 0x0374,
+ 0x037e, 0x037e,
+ 0x0385, 0x0385,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0640, 0x0640,
+ 0x0660, 0x0669,
+ 0x06dd, 0x06dd,
+ 0x0964, 0x0965,
+ 0x0e3f, 0x0e3f,
+ 0x0fd5, 0x0fd8,
+ 0x10fb, 0x10fb,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x1802, 0x1803,
+ 0x1805, 0x1805,
+ 0x1cd3, 0x1cd3,
+ 0x1ce1, 0x1ce1,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x2000, 0x200b,
+ 0x200e, 0x2064,
+ 0x206a, 0x2070,
+ 0x2074, 0x207e,
+ 0x2080, 0x208e,
+ 0x20a0, 0x20b9,
+ 0x2100, 0x2125,
+ 0x2127, 0x2129,
+ 0x212c, 0x2131,
+ 0x2133, 0x214d,
+ 0x214f, 0x215f,
+ 0x2189, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x27ff,
+ 0x2900, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2e00, 0x2e3b,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x3004,
+ 0x3006, 0x3006,
+ 0x3008, 0x3020,
+ 0x3030, 0x3037,
+ 0x303c, 0x303f,
+ 0x309b, 0x309c,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fc,
+ 0x3190, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3220, 0x325f,
+ 0x327f, 0x32cf,
+ 0x3358, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa700, 0xa721,
+ 0xa788, 0xa78a,
+ 0xa830, 0xa839,
+ 0xfd3e, 0xfd3f,
+ 0xfdfd, 0xfdfd,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0x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 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,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Common */
+
+/* 'Latin': Script */
+static const OnigCodePoint CR_Latin[] = {
+ 30,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02b8,
+ 0x02e0, 0x02e4,
+ 0x1d00, 0x1d25,
+ 0x1d2c, 0x1d5c,
+ 0x1d62, 0x1d65,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1dbe,
+ 0x1e00, 0x1eff,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x2c60, 0x2c7f,
+ 0xa722, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
+ 0xfb00, 0xfb06,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+}; /* CR_Latin */
+
+/* 'Greek': Script */
+static const OnigCodePoint CR_Greek[] = {
+ 33,
+ 0x0370, 0x0373,
+ 0x0375, 0x0377,
+ 0x037a, 0x037d,
+ 0x0384, 0x0384,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03e1,
+ 0x03f0, 0x03ff,
+ 0x1d26, 0x1d2a,
+ 0x1d5d, 0x1d61,
+ 0x1d66, 0x1d6a,
+ 0x1dbf, 0x1dbf,
+ 0x1f00, 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,
+ 0x2126, 0x2126,
+ 0x10140, 0x1018a,
+ 0x1d200, 0x1d245,
+}; /* CR_Greek */
+
+/* 'Cyrillic': Script */
+static const OnigCodePoint CR_Cyrillic[] = {
+ 7,
+ 0x0400, 0x0484,
+ 0x0487, 0x0527,
+ 0x1d2b, 0x1d2b,
+ 0x1d78, 0x1d78,
+ 0x2de0, 0x2dff,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
+}; /* CR_Cyrillic */
+
+/* 'Armenian': Script */
+static const OnigCodePoint CR_Armenian[] = {
+ 6,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x058a, 0x058a,
+ 0x058f, 0x058f,
+ 0xfb13, 0xfb17,
+}; /* CR_Armenian */
+
+/* 'Hebrew': Script */
+static const OnigCodePoint CR_Hebrew[] = {
+ 9,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0xfb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x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Arabic */
+
+/* 'Syriac': Script */
+static const OnigCodePoint CR_Syriac[] = {
+ 3,
+ 0x0700, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x074f,
+}; /* CR_Syriac */
+
+/* 'Thaana': Script */
+static const OnigCodePoint CR_Thaana[] = {
+ 1,
+ 0x0780, 0x07b1,
+}; /* CR_Thaana */
+
+/* 'Devanagari': Script */
+static const OnigCodePoint CR_Devanagari[] = {
+ 5,
+ 0x0900, 0x0950,
+ 0x0953, 0x0963,
+ 0x0966, 0x0977,
+ 0x0979, 0x097f,
+ 0xa8e0, 0xa8fb,
+}; /* CR_Devanagari */
+
+/* 'Bengali': Script */
+static const OnigCodePoint CR_Bengali[] = {
+ 14,
+ 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,
+}; /* CR_Bengali */
+
+/* 'Gurmukhi': Script */
+static const OnigCodePoint CR_Gurmukhi[] = {
+ 16,
+ 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,
+}; /* CR_Gurmukhi */
+
+/* 'Gujarati': Script */
+static const OnigCodePoint CR_Gujarati[] = {
+ 13,
+ 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,
+}; /* CR_Gujarati */
+
+/* 'Oriya': Script */
+static const OnigCodePoint CR_Oriya[] = {
+ 14,
+ 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,
+}; /* CR_Oriya */
+
+/* 'Tamil': Script */
+static const OnigCodePoint CR_Tamil[] = {
+ 16,
+ 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,
+}; /* CR_Tamil */
+
+/* 'Telugu': Script */
+static const OnigCodePoint CR_Telugu[] = {
+ 14,
+ 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,
+}; /* CR_Telugu */
+
+/* 'Kannada': Script */
+static const OnigCodePoint CR_Kannada[] = {
+ 14,
+ 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,
+}; /* CR_Kannada */
+
+/* 'Malayalam': Script */
+static const OnigCodePoint CR_Malayalam[] = {
+ 11,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+}; /* CR_Malayalam */
+
+/* 'Sinhala': Script */
+static const OnigCodePoint CR_Sinhala[] = {
+ 11,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+}; /* CR_Sinhala */
+
+/* 'Thai': Script */
+static const OnigCodePoint CR_Thai[] = {
+ 2,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e5b,
+}; /* CR_Thai */
+
+/* 'Lao': Script */
+static const OnigCodePoint CR_Lao[] = {
+ 18,
+ 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,
+}; /* CR_Lao */
+
+/* 'Tibetan': Script */
+static const OnigCodePoint CR_Tibetan[] = {
+ 7,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x0fd9, 0x0fda,
+}; /* CR_Tibetan */
+
+/* 'Myanmar': Script */
+static const OnigCodePoint CR_Myanmar[] = {
+ 2,
+ 0x1000, 0x109f,
+ 0xaa60, 0xaa7b,
+}; /* CR_Myanmar */
+
+/* 'Georgian': Script */
+static const OnigCodePoint CR_Georgian[] = {
+ 8,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x10ff,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+}; /* CR_Georgian */
+
+/* 'Hangul': Script */
+static const OnigCodePoint CR_Hangul[] = {
+ 14,
+ 0x1100, 0x11ff,
+ 0x302e, 0x302f,
+ 0x3131, 0x318e,
+ 0x3200, 0x321e,
+ 0x3260, 0x327e,
+ 0xa960, 0xa97c,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+}; /* CR_Hangul */
+
+/* 'Ethiopic': Script */
+static const OnigCodePoint CR_Ethiopic[] = {
+ 32,
+ 0x1200, 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,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+}; /* CR_Ethiopic */
+
+/* 'Cherokee': Script */
+static const OnigCodePoint CR_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13f4,
+}; /* CR_Cherokee */
+
+/* 'Canadian_Aboriginal': Script */
+static const OnigCodePoint CR_Canadian_Aboriginal[] = {
+ 2,
+ 0x1400, 0x167f,
+ 0x18b0, 0x18f5,
+}; /* CR_Canadian_Aboriginal */
+
+/* 'Ogham': Script */
+static const OnigCodePoint CR_Ogham[] = {
+ 1,
+ 0x1680, 0x169c,
+}; /* CR_Ogham */
+
+/* 'Runic': Script */
+static const OnigCodePoint CR_Runic[] = {
+ 2,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+}; /* CR_Runic */
+
+/* 'Khmer': Script */
+static const OnigCodePoint CR_Khmer[] = {
+ 4,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x19e0, 0x19ff,
+}; /* CR_Khmer */
+
+/* 'Mongolian': Script */
+static const OnigCodePoint CR_Mongolian[] = {
+ 6,
+ 0x1800, 0x1801,
+ 0x1804, 0x1804,
+ 0x1806, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+}; /* CR_Mongolian */
+
+/* 'Hiragana': Script */
+static const OnigCodePoint CR_Hiragana[] = {
+ 4,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x1b001, 0x1b001,
+ 0x1f200, 0x1f200,
+}; /* CR_Hiragana */
+
+/* 'Katakana': Script */
+static const OnigCodePoint CR_Katakana[] = {
+ 8,
+ 0x30a1, 0x30fa,
+ 0x30fd, 0x30ff,
+ 0x31f0, 0x31ff,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3357,
+ 0xff66, 0xff6f,
+ 0xff71, 0xff9d,
+ 0x1b000, 0x1b000,
+}; /* CR_Katakana */
+
+/* 'Bopomofo': Script */
+static const OnigCodePoint CR_Bopomofo[] = {
+ 3,
+ 0x02ea, 0x02eb,
+ 0x3105, 0x312d,
+ 0x31a0, 0x31ba,
+}; /* CR_Bopomofo */
+
+/* 'Han': Script */
+static const OnigCodePoint CR_Han[] = {
+ 15,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x3005, 0x3005,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303b,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Han */
+
+/* 'Yi': Script */
+static const OnigCodePoint CR_Yi[] = {
+ 2,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+}; /* CR_Yi */
+
+/* 'Old_Italic': Script */
+static const OnigCodePoint CR_Old_Italic[] = {
+ 2,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+}; /* CR_Old_Italic */
+
+/* 'Gothic': Script */
+static const OnigCodePoint CR_Gothic[] = {
+ 1,
+ 0x10330, 0x1034a,
+}; /* CR_Gothic */
+
+/* 'Deseret': Script */
+static const OnigCodePoint CR_Deseret[] = {
+ 1,
+ 0x10400, 0x1044f,
+}; /* CR_Deseret */
+
+/* 'Inherited': Script */
+static const OnigCodePoint CR_Inherited[] = {
+ 25,
+ 0x0300, 0x036f,
+ 0x0485, 0x0486,
+ 0x064b, 0x0655,
+ 0x065f, 0x065f,
+ 0x0670, 0x0670,
+ 0x0951, 0x0952,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1ce0,
+ 0x1ce2, 0x1ce8,
+ 0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
+ 0x1dc0, 0x1de6,
+ 0x1dfc, 0x1dff,
+ 0x200c, 0x200d,
+ 0x20d0, 0x20f0,
+ 0x302a, 0x302d,
+ 0x3099, 0x309a,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0x101fd, 0x101fd,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0xe0100, 0xe01ef,
+}; /* CR_Inherited */
+
+/* 'Tagalog': Script */
+static const OnigCodePoint CR_Tagalog[] = {
+ 2,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+}; /* CR_Tagalog */
+
+/* 'Hanunoo': Script */
+static const OnigCodePoint CR_Hanunoo[] = {
+ 1,
+ 0x1720, 0x1734,
+}; /* CR_Hanunoo */
+
+/* 'Buhid': Script */
+static const OnigCodePoint CR_Buhid[] = {
+ 1,
+ 0x1740, 0x1753,
+}; /* CR_Buhid */
+
+/* 'Tagbanwa': Script */
+static const OnigCodePoint CR_Tagbanwa[] = {
+ 3,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+}; /* CR_Tagbanwa */
+
+/* 'Limbu': Script */
+static const OnigCodePoint CR_Limbu[] = {
+ 5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x194f,
+}; /* CR_Limbu */
+
+/* 'Tai_Le': Script */
+static const OnigCodePoint CR_Tai_Le[] = {
+ 2,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+}; /* CR_Tai_Le */
+
+/* 'Linear_B': Script */
+static const OnigCodePoint CR_Linear_B[] = {
+ 7,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+}; /* CR_Linear_B */
+
+/* 'Ugaritic': Script */
+static const OnigCodePoint CR_Ugaritic[] = {
+ 2,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+}; /* CR_Ugaritic */
+
+/* 'Shavian': Script */
+static const OnigCodePoint CR_Shavian[] = {
+ 1,
+ 0x10450, 0x1047f,
+}; /* CR_Shavian */
+
+/* 'Osmanya': Script */
+static const OnigCodePoint CR_Osmanya[] = {
+ 2,
+ 0x10480, 0x1049d,
+ 0x104a0, 0x104a9,
+}; /* CR_Osmanya */
+
+/* 'Cypriot': Script */
+static const OnigCodePoint CR_Cypriot[] = {
+ 6,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+}; /* CR_Cypriot */
+
+/* 'Braille': Script */
+static const OnigCodePoint CR_Braille[] = {
+ 1,
+ 0x2800, 0x28ff,
+}; /* CR_Braille */
+
+/* 'Buginese': Script */
+static const OnigCodePoint CR_Buginese[] = {
+ 2,
+ 0x1a00, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+}; /* CR_Buginese */
+
+/* 'Coptic': Script */
+static const OnigCodePoint CR_Coptic[] = {
+ 3,
+ 0x03e2, 0x03ef,
+ 0x2c80, 0x2cf3,
+ 0x2cf9, 0x2cff,
+}; /* CR_Coptic */
+
+/* 'New_Tai_Lue': Script */
+static const OnigCodePoint CR_New_Tai_Lue[] = {
+ 4,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x19df,
+}; /* CR_New_Tai_Lue */
+
+/* 'Glagolitic': Script */
+static const OnigCodePoint CR_Glagolitic[] = {
+ 2,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+}; /* CR_Glagolitic */
+
+/* 'Tifinagh': Script */
+static const OnigCodePoint CR_Tifinagh[] = {
+ 3,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d7f,
+}; /* CR_Tifinagh */
+
+/* 'Syloti_Nagri': Script */
+static const OnigCodePoint CR_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82b,
+}; /* CR_Syloti_Nagri */
+
+/* 'Old_Persian': Script */
+static const OnigCodePoint CR_Old_Persian[] = {
+ 2,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103d5,
+}; /* CR_Old_Persian */
+
+/* 'Kharoshthi': Script */
+static const OnigCodePoint CR_Kharoshthi[] = {
+ 8,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+}; /* CR_Kharoshthi */
+
+/* 'Balinese': Script */
+static const OnigCodePoint CR_Balinese[] = {
+ 2,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+}; /* CR_Balinese */
+
+/* 'Cuneiform': Script */
+static const OnigCodePoint CR_Cuneiform[] = {
+ 3,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+}; /* CR_Cuneiform */
+
+/* 'Phoenician': Script */
+static const OnigCodePoint CR_Phoenician[] = {
+ 2,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x1091f,
+}; /* CR_Phoenician */
+
+/* 'Phags_Pa': Script */
+static const OnigCodePoint CR_Phags_Pa[] = {
+ 1,
+ 0xa840, 0xa877,
+}; /* CR_Phags_Pa */
+
+/* 'Nko': Script */
+static const OnigCodePoint CR_Nko[] = {
+ 1,
+ 0x07c0, 0x07fa,
+}; /* CR_Nko */
+
+/* 'Sundanese': Script */
+static const OnigCodePoint CR_Sundanese[] = {
+ 2,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
+}; /* CR_Sundanese */
+
+/* 'Lepcha': Script */
+static const OnigCodePoint CR_Lepcha[] = {
+ 3,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c4f,
+}; /* CR_Lepcha */
+
+/* 'Ol_Chiki': Script */
+static const OnigCodePoint CR_Ol_Chiki[] = {
+ 1,
+ 0x1c50, 0x1c7f,
+}; /* CR_Ol_Chiki */
+
+/* 'Vai': Script */
+static const OnigCodePoint CR_Vai[] = {
+ 1,
+ 0xa500, 0xa62b,
+}; /* CR_Vai */
+
+/* 'Saurashtra': Script */
+static const OnigCodePoint CR_Saurashtra[] = {
+ 2,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+}; /* CR_Saurashtra */
+
+/* 'Kayah_Li': Script */
+static const OnigCodePoint CR_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_Kayah_Li */
+
+/* 'Rejang': Script */
+static const OnigCodePoint CR_Rejang[] = {
+ 2,
+ 0xa930, 0xa953,
+ 0xa95f, 0xa95f,
+}; /* CR_Rejang */
+
+/* 'Lycian': Script */
+static const OnigCodePoint CR_Lycian[] = {
+ 1,
+ 0x10280, 0x1029c,
+}; /* CR_Lycian */
+
+/* 'Carian': Script */
+static const OnigCodePoint CR_Carian[] = {
+ 1,
+ 0x102a0, 0x102d0,
+}; /* CR_Carian */
+
+/* 'Lydian': Script */
+static const OnigCodePoint CR_Lydian[] = {
+ 2,
+ 0x10920, 0x10939,
+ 0x1093f, 0x1093f,
+}; /* CR_Lydian */
+
+/* 'Cham': Script */
+static const OnigCodePoint CR_Cham[] = {
+ 4,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa5f,
+}; /* CR_Cham */
+
+/* 'Tai_Tham': Script */
+static const OnigCodePoint CR_Tai_Tham[] = {
+ 5,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+}; /* CR_Tai_Tham */
+
+/* 'Tai_Viet': Script */
+static const OnigCodePoint CR_Tai_Viet[] = {
+ 2,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadf,
+}; /* CR_Tai_Viet */
+
+/* 'Avestan': Script */
+static const OnigCodePoint CR_Avestan[] = {
+ 2,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b3f,
+}; /* CR_Avestan */
+
+/* 'Egyptian_Hieroglyphs': Script */
+static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342e,
+}; /* CR_Egyptian_Hieroglyphs */
+
+/* 'Samaritan': Script */
+static const OnigCodePoint CR_Samaritan[] = {
+ 2,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+}; /* CR_Samaritan */
+
+/* 'Lisu': Script */
+static const OnigCodePoint CR_Lisu[] = {
+ 1,
+ 0xa4d0, 0xa4ff,
+}; /* CR_Lisu */
+
+/* 'Bamum': Script */
+static const OnigCodePoint CR_Bamum[] = {
+ 2,
+ 0xa6a0, 0xa6f7,
+ 0x16800, 0x16a38,
+}; /* CR_Bamum */
+
+/* 'Javanese': Script */
+static const OnigCodePoint CR_Javanese[] = {
+ 3,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+}; /* CR_Javanese */
+
+/* 'Meetei_Mayek': Script */
+static const OnigCodePoint CR_Meetei_Mayek[] = {
+ 3,
+ 0xaae0, 0xaaf6,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+}; /* CR_Meetei_Mayek */
+
+/* 'Imperial_Aramaic': Script */
+static const OnigCodePoint CR_Imperial_Aramaic[] = {
+ 2,
+ 0x10840, 0x10855,
+ 0x10857, 0x1085f,
+}; /* CR_Imperial_Aramaic */
+
+/* 'Old_South_Arabian': Script */
+static const OnigCodePoint CR_Old_South_Arabian[] = {
+ 1,
+ 0x10a60, 0x10a7f,
+}; /* CR_Old_South_Arabian */
+
+/* 'Inscriptional_Parthian': Script */
+static const OnigCodePoint CR_Inscriptional_Parthian[] = {
+ 2,
+ 0x10b40, 0x10b55,
+ 0x10b58, 0x10b5f,
+}; /* CR_Inscriptional_Parthian */
+
+/* 'Inscriptional_Pahlavi': Script */
+static const OnigCodePoint CR_Inscriptional_Pahlavi[] = {
+ 2,
+ 0x10b60, 0x10b72,
+ 0x10b78, 0x10b7f,
+}; /* CR_Inscriptional_Pahlavi */
+
+/* 'Old_Turkic': Script */
+static const OnigCodePoint CR_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c48,
+}; /* CR_Old_Turkic */
+
+/* 'Kaithi': Script */
+static const OnigCodePoint CR_Kaithi[] = {
+ 1,
+ 0x11080, 0x110c1,
+}; /* CR_Kaithi */
+
+/* 'Batak': Script */
+static const OnigCodePoint CR_Batak[] = {
+ 2,
+ 0x1bc0, 0x1bf3,
+ 0x1bfc, 0x1bff,
+}; /* CR_Batak */
+
+/* 'Brahmi': Script */
+static const OnigCodePoint CR_Brahmi[] = {
+ 2,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+}; /* CR_Brahmi */
+
+/* 'Mandaic': Script */
+static const OnigCodePoint CR_Mandaic[] = {
+ 2,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+}; /* CR_Mandaic */
+
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
+/* 'White_Space': Binary Property */
+#define CR_White_Space CR_Space
+
+/* 'Bidi_Control': Binary Property */
+static const OnigCodePoint CR_Bidi_Control[] = {
+ 2,
+ 0x200e, 0x200f,
+ 0x202a, 0x202e,
+}; /* CR_Bidi_Control */
+
+/* 'Join_Control': Binary Property */
+static const OnigCodePoint CR_Join_Control[] = {
+ 1,
+ 0x200c, 0x200d,
+}; /* CR_Join_Control */
+
+/* 'Dash': Binary Property */
+static const OnigCodePoint CR_Dash[] = {
+ 20,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2053, 0x2053,
+ 0x207b, 0x207b,
+ 0x208b, 0x208b,
+ 0x2212, 0x2212,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Dash */
+
+/* 'Hyphen': Binary Property */
+static const OnigCodePoint CR_Hyphen[] = {
+ 10,
+ 0x002d, 0x002d,
+ 0x00ad, 0x00ad,
+ 0x058a, 0x058a,
+ 0x1806, 0x1806,
+ 0x2010, 0x2011,
+ 0x2e17, 0x2e17,
+ 0x30fb, 0x30fb,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+ 0xff65, 0xff65,
+}; /* CR_Hyphen */
+
+/* 'Quotation_Mark': Binary Property */
+static const OnigCodePoint CR_Quotation_Mark[] = {
+ 12,
+ 0x0022, 0x0022,
+ 0x0027, 0x0027,
+ 0x00ab, 0x00ab,
+ 0x00bb, 0x00bb,
+ 0x2018, 0x201f,
+ 0x2039, 0x203a,
+ 0x300c, 0x300f,
+ 0x301d, 0x301f,
+ 0xfe41, 0xfe44,
+ 0xff02, 0xff02,
+ 0xff07, 0xff07,
+ 0xff62, 0xff63,
+}; /* CR_Quotation_Mark */
+
+/* 'Terminal_Punctuation': Binary Property */
+static const OnigCodePoint CR_Terminal_Punctuation[] = {
+ 70,
+ 0x0021, 0x0021,
+ 0x002c, 0x002c,
+ 0x002e, 0x002e,
+ 0x003a, 0x003b,
+ 0x003f, 0x003f,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x05c3, 0x05c3,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070a,
+ 0x070c, 0x070c,
+ 0x07f8, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0e5a, 0x0e5b,
+ 0x0f08, 0x0f08,
+ 0x0f0d, 0x0f12,
+ 0x104a, 0x104b,
+ 0x1361, 0x1368,
+ 0x166d, 0x166e,
+ 0x16eb, 0x16ed,
+ 0x17d4, 0x17d6,
+ 0x17da, 0x17da,
+ 0x1802, 0x1805,
+ 0x1808, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5d, 0x1b5f,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x3001, 0x3002,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa6f3, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c7, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0e,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0xff64, 0xff64,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x10b3a, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+ 0x12470, 0x12473,
+}; /* CR_Terminal_Punctuation */
+
+/* 'Other_Math': Binary Property */
+static const OnigCodePoint CR_Other_Math[] = {
+ 133,
+ 0x005e, 0x005e,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2061, 0x2064,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21a7,
+ 0x21a9, 0x21ad,
+ 0x21b0, 0x21b1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
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+}; /* CR_Other_Math */
+
+/* 'Hex_Digit': Binary Property */
+static const OnigCodePoint CR_Hex_Digit[] = {
+ 6,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+ 0xff10, 0xff19,
+ 0xff21, 0xff26,
+ 0xff41, 0xff46,
+}; /* CR_Hex_Digit */
+
+/* 'ASCII_Hex_Digit': Binary Property */
+#define CR_ASCII_Hex_Digit CR_XDigit
+
+/* 'Other_Alphabetic': Binary Property */
+static const OnigCodePoint CR_Other_Alphabetic[] = {
+ 158,
+ 0x0345, 0x0345,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x0657,
+ 0x0659, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06e1, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ed, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x073f,
+ 0x07a6, 0x07b0,
+ 0x0816, 0x0817,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082c,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x0903,
+ 0x093a, 0x093b,
+ 0x093e, 0x094c,
+ 0x094e, 0x094f,
+ 0x0955, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0983,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09d7, 0x09d7,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a03,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4c,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0abe, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acc,
+ 0x0ae2, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b3e, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4c,
+ 0x0b56, 0x0b57,
+ 0x0b62, 0x0b63,
+ 0x0b82, 0x0b82,
+ 0x0bbe, 0x0bc2,
+ 0x0bc6, 0x0bc8,
+ 0x0bca, 0x0bcc,
+ 0x0bd7, 0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1b82,
+ 0x1ba1, 0x1ba9,
+ 0x1bac, 0x1bad,
+ 0x1be7, 0x1bf1,
+ 0x1c24, 0x1c35,
+ 0x1cf2, 0x1cf3,
+ 0x24b6, 0x24e9,
+ 0x2de0, 0x2dff,
+ 0xa674, 0xa67b,
+ 0xa69f, 0xa69f,
+ 0xa823, 0xa827,
+ 0xa880, 0xa881,
+ 0xa8b4, 0xa8c3,
+ 0xa926, 0xa92a,
+ 0xa947, 0xa952,
+ 0xa980, 0xa983,
+ 0xa9b4, 0xa9bf,
+ 0xaa29, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4d,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabea,
+ 0xfb1e, 0xfb1e,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11045,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
+}; /* CR_Other_Alphabetic */
+
+/* 'Ideographic': Binary Property */
+static const OnigCodePoint CR_Ideographic[] = {
+ 11,
+ 0x3006, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Ideographic */
+
+/* 'Diacritic': Binary Property */
+static const OnigCodePoint CR_Diacritic[] = {
+ 125,
+ 0x005e, 0x005e,
+ 0x0060, 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 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+}; /* CR_Diacritic */
+
+/* 'Extender': Binary Property */
+static const OnigCodePoint CR_Extender[] = {
+ 22,
+ 0x00b7, 0x00b7,
+ 0x02d0, 0x02d1,
+ 0x0640, 0x0640,
+ 0x07fa, 0x07fa,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c36, 0x1c36,
+ 0x1c7b, 0x1c7b,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa60c, 0xa60c,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+}; /* CR_Extender */
+
+/* 'Other_Lowercase': Binary Property */
+static const OnigCodePoint CR_Other_Lowercase[] = {
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x02b0, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x037a, 0x037a,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2170, 0x217f,
+ 0x24d0, 0x24e9,
+ 0x2c7c, 0x2c7d,
+ 0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
+}; /* CR_Other_Lowercase */
+
+/* 'Other_Uppercase': Binary Property */
+static const OnigCodePoint CR_Other_Uppercase[] = {
+ 2,
+ 0x2160, 0x216f,
+ 0x24b6, 0x24cf,
+}; /* CR_Other_Uppercase */
+
+/* 'Noncharacter_Code_Point': Binary Property */
+static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
+ 18,
+ 0xfdd0, 0xfdef,
+ 0xfffe, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Noncharacter_Code_Point */
+
+/* 'Other_Grapheme_Extend': Binary Property */
+static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
+ 17,
+ 0x09be, 0x09be,
+ 0x09d7, 0x09d7,
+ 0x0b3e, 0x0b3e,
+ 0x0b57, 0x0b57,
+ 0x0bbe, 0x0bbe,
+ 0x0bd7, 0x0bd7,
+ 0x0cc2, 0x0cc2,
+ 0x0cd5, 0x0cd6,
+ 0x0d3e, 0x0d3e,
+ 0x0d57, 0x0d57,
+ 0x0dcf, 0x0dcf,
+ 0x0ddf, 0x0ddf,
+ 0x200c, 0x200d,
+ 0x302e, 0x302f,
+ 0xff9e, 0xff9f,
+ 0x1d165, 0x1d165,
+ 0x1d16e, 0x1d172,
+}; /* CR_Other_Grapheme_Extend */
+
+/* 'IDS_Binary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Binary_Operator[] = {
+ 2,
+ 0x2ff0, 0x2ff1,
+ 0x2ff4, 0x2ffb,
+}; /* CR_IDS_Binary_Operator */
+
+/* 'IDS_Trinary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Trinary_Operator[] = {
+ 1,
+ 0x2ff2, 0x2ff3,
+}; /* CR_IDS_Trinary_Operator */
+
+/* 'Radical': Binary Property */
+static const OnigCodePoint CR_Radical[] = {
+ 3,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+}; /* CR_Radical */
+
+/* 'Unified_Ideograph': Binary Property */
+static const OnigCodePoint CR_Unified_Ideograph[] = {
+ 12,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xfa0e, 0xfa0f,
+ 0xfa11, 0xfa11,
+ 0xfa13, 0xfa14,
+ 0xfa1f, 0xfa1f,
+ 0xfa21, 0xfa21,
+ 0xfa23, 0xfa24,
+ 0xfa27, 0xfa29,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+}; /* CR_Unified_Ideograph */
+
+/* 'Other_Default_Ignorable_Code_Point': Binary Property */
+static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
+ 11,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x2065, 0x2069,
+ 0x3164, 0x3164,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0xe0000, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xe0fff,
+}; /* CR_Other_Default_Ignorable_Code_Point */
+
+/* 'Deprecated': Binary Property */
+static const OnigCodePoint CR_Deprecated[] = {
+ 9,
+ 0x0149, 0x0149,
+ 0x0673, 0x0673,
+ 0x0f77, 0x0f77,
+ 0x0f79, 0x0f79,
+ 0x17a3, 0x17a4,
+ 0x206a, 0x206f,
+ 0x2329, 0x232a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Deprecated */
+
+/* 'Soft_Dotted': Binary Property */
+static const OnigCodePoint CR_Soft_Dotted[] = {
+ 31,
+ 0x0069, 0x006a,
+ 0x012f, 0x012f,
+ 0x0249, 0x0249,
+ 0x0268, 0x0268,
+ 0x029d, 0x029d,
+ 0x02b2, 0x02b2,
+ 0x03f3, 0x03f3,
+ 0x0456, 0x0456,
+ 0x0458, 0x0458,
+ 0x1d62, 0x1d62,
+ 0x1d96, 0x1d96,
+ 0x1da4, 0x1da4,
+ 0x1da8, 0x1da8,
+ 0x1e2d, 0x1e2d,
+ 0x1ecb, 0x1ecb,
+ 0x2071, 0x2071,
+ 0x2148, 0x2149,
+ 0x2c7c, 0x2c7c,
+ 0x1d422, 0x1d423,
+ 0x1d456, 0x1d457,
+ 0x1d48a, 0x1d48b,
+ 0x1d4be, 0x1d4bf,
+ 0x1d4f2, 0x1d4f3,
+ 0x1d526, 0x1d527,
+ 0x1d55a, 0x1d55b,
+ 0x1d58e, 0x1d58f,
+ 0x1d5c2, 0x1d5c3,
+ 0x1d5f6, 0x1d5f7,
+ 0x1d62a, 0x1d62b,
+ 0x1d65e, 0x1d65f,
+ 0x1d692, 0x1d693,
+}; /* CR_Soft_Dotted */
+
+/* 'Logical_Order_Exception': Binary Property */
+static const OnigCodePoint CR_Logical_Order_Exception[] = {
+ 5,
+ 0x0e40, 0x0e44,
+ 0x0ec0, 0x0ec4,
+ 0xaab5, 0xaab6,
+ 0xaab9, 0xaab9,
+ 0xaabb, 0xaabc,
+}; /* CR_Logical_Order_Exception */
+
+/* 'Other_ID_Start': Binary Property */
+static const OnigCodePoint CR_Other_ID_Start[] = {
+ 3,
+ 0x2118, 0x2118,
+ 0x212e, 0x212e,
+ 0x309b, 0x309c,
+}; /* CR_Other_ID_Start */
+
+/* 'Other_ID_Continue': Binary Property */
+static const OnigCodePoint CR_Other_ID_Continue[] = {
+ 4,
+ 0x00b7, 0x00b7,
+ 0x0387, 0x0387,
+ 0x1369, 0x1371,
+ 0x19da, 0x19da,
+}; /* CR_Other_ID_Continue */
+
+/* 'STerm': Binary Property */
+static const OnigCodePoint CR_STerm[] = {
+ 50,
+ 0x0021, 0x0021,
+ 0x002e, 0x002e,
+ 0x003f, 0x003f,
+ 0x055c, 0x055c,
+ 0x055e, 0x055e,
+ 0x0589, 0x0589,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x0702,
+ 0x07f9, 0x07f9,
+ 0x0964, 0x0965,
+ 0x104a, 0x104b,
+ 0x1362, 0x1362,
+ 0x1367, 0x1368,
+ 0x166e, 0x166e,
+ 0x1735, 0x1736,
+ 0x1803, 0x1803,
+ 0x1809, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5e, 0x1b5f,
+ 0x1c3b, 0x1c3c,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x3002, 0x3002,
+ 0xa4ff, 0xa4ff,
+ 0xa60e, 0xa60f,
+ 0xa6f3, 0xa6f3,
+ 0xa6f7, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c8, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe52, 0xfe52,
+ 0xfe56, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0e, 0xff0e,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0x10a56, 0x10a57,
+ 0x11047, 0x11048,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+}; /* CR_STerm */
+
+/* 'Variation_Selector': Binary Property */
+static const OnigCodePoint CR_Variation_Selector[] = {
+ 3,
+ 0x180b, 0x180d,
+ 0xfe00, 0xfe0f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Variation_Selector */
+
+/* 'Pattern_White_Space': Binary Property */
+static const OnigCodePoint CR_Pattern_White_Space[] = {
+ 5,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x200e, 0x200f,
+ 0x2028, 0x2029,
+}; /* CR_Pattern_White_Space */
+
+/* 'Pattern_Syntax': Binary Property */
+static const OnigCodePoint CR_Pattern_Syntax[] = {
+ 28,
+ 0x0021, 0x002f,
+ 0x003a, 0x0040,
+ 0x005b, 0x005e,
+ 0x0060, 0x0060,
+ 0x007b, 0x007e,
+ 0x00a1, 0x00a7,
+ 0x00a9, 0x00a9,
+ 0x00ab, 0x00ac,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b1,
+ 0x00b6, 0x00b6,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x2010, 0x2027,
+ 0x2030, 0x203e,
+ 0x2041, 0x2053,
+ 0x2055, 0x205e,
+ 0x2190, 0x245f,
+ 0x2500, 0x2775,
+ 0x2794, 0x2bff,
+ 0x2e00, 0x2e7f,
+ 0x3001, 0x3003,
+ 0x3008, 0x3020,
+ 0x3030, 0x3030,
+ 0xfd3e, 0xfd3f,
+ 0xfe45, 0xfe46,
+}; /* CR_Pattern_Syntax */
+
+/* 'Unknown': Script */
+static const OnigCodePoint CR_Unknown[] = {
+ 537,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x0605, 0x0605,
+ 0x061c, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+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
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455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x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_Unknown */
+
+/* 'Age_1_1': Derived Age 1.1 */
+static const OnigCodePoint CR_Age_1_1[] = {
+ 288,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x05b0, 0x05b9,
+ 0x05bb, 0x05c3,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0652,
+ 0x0660, 0x066d,
+ 0x0670, 0x06b7,
+ 0x06ba, 0x06be,
+ 0x06c0, 0x06ce,
+ 0x06d0, 0x06ed,
+ 0x06f0, 0x06f9,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0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x11a2,
+ 0x11a8, 0x11f9,
+ 0x1e00, 0x1e9a,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20aa,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xe000, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+}; /* CR_Age_1_1 */
+
+/* 'Age_2_0': Derived Age 2.0 */
+static const OnigCodePoint CR_Age_2_0[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,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0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ab,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32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02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0652,
+ 0x0660, 0x066d,
+ 0x0670, 0x06b7,
+ 0x06ba, 0x06be,
+ 0x06c0, 0x06ce,
+ 0x06d0, 0x06ed,
+ 0x06f0, 0x06f9,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0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ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_2_1 */
+
+/* 'Age_3_0': Derived Age 3.0 */
+static const OnigCodePoint CR_Age_3_0[] = {
+ 369,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f3,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 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12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2046,
+ 0x2048, 0x204d,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20af,
+ 0x20d0, 0x20e3,
+ 0x2100, 0x213a,
+ 0x2153, 0x2183,
+ 0x2190, 0x21f3,
+ 0x2200, 0x22f1,
+ 0x2300, 0x237b,
+ 0x237d, 0x239a,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25f7,
+ 0x2600, 0x2613,
+ 0x2619, 0x2671,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2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0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_0 */
+
+/* 'Age_3_1': Derived Age 3.1 */
+static const OnigCodePoint CR_Age_3_1[] = {
+ 402,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f5,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06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, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_1 */
+
+/* 'Age_3_2': Derived Age 3.2 */
+static const OnigCodePoint CR_Age_3_2[] = {
+ 397,
+ 0x0000, 0x0220,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034f,
+ 0x0360, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03f6,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b1,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0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,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2052,
+ 0x2057, 0x2057,
+ 0x205f, 0x2063,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20b1,
+ 0x20d0, 0x20ea,
+ 0x2100, 0x213a,
+ 0x213d, 0x214b,
+ 0x2153, 0x2183,
+ 0x2190, 0x23ce,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24fe,
+ 0x2500, 0x2613,
+ 0x2616, 0x2617,
+ 0x2619, 0x267d,
+ 0x2680, 0x2689,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2794,
+ 0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x10400, 0x10425,
+ 0x10428, 0x1044d,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_2 */
+
+/* 'Age_4_0': Derived Age 4.0 */
+static const OnigCodePoint CR_Age_4_0[] = {
+ 412,
+ 0x0000, 0x0236,
+ 0x0250, 0x0357,
+ 0x035d, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 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 0x0fcc,
+ 0x0fcf, 0x0fcf,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f8,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x19e0, 0x19ff,
+ 0x1d00, 0x1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+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fa5,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe23,
+ 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, 0x1013f,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d300, 0x1d356,
+ 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, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_0 */
+
+/* 'Age_4_1': Derived Age 4.1 */
+static const OnigCodePoint CR_Age_4_1[] = {
+ 430,
+ 0x0000, 0x0241,
+ 0x0250, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531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c,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19a9,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+ 0x1d00, 0x1dc3,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+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0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fbb,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa700, 0xa716,
+ 0xa800, 0xa82b,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
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_5_0': Derived Age 5.0 */
+static const OnigCodePoint CR_Age_5_0[] = {
+ 440,
+ 0x0000, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x0513,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060b, 0x0615,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x076d,
+ 0x0780, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x097b, 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, 0x09fa,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x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
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fcf, 0x0fd1,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19a9,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+ 0x1b00, 0x1b4b,
+ 0x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 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x1091f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 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,
+ 0x1fffe, 0x2a6d6,
+ 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_5_0 */
+
+/* 'Age_5_1': Derived Age 5.1 */
+static const OnigCodePoint CR_Age_5_1[] = {
+ 455,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0523,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0972,
+ 0x097b, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+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 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa5f,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 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, 0x1083f,
+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dfffe, 0xdffff,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_5_1 */
+
+/* 'Age_5_2': Derived Age 5.2 */
+static const OnigCodePoint CR_Age_5_2[] = {
+ 495,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0525,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0900, 0x0939,
+ 0x093c, 0x094e,
+ 0x0950, 0x0955,
+ 0x0958, 0x0972,
+ 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, 0x0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0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd8,
+ 0x1000, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 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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, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 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,
+ 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,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f131, 0x1f131,
+ 0x1f13d, 0x1f13d,
+ 0x1f13f, 0x1f13f,
+ 0x1f142, 0x1f142,
+ 0x1f146, 0x1f146,
+ 0x1f14a, 0x1f14e,
+ 0x1f157, 0x1f157,
+ 0x1f15f, 0x1f15f,
+ 0x1f179, 0x1f179,
+ 0x1f17b, 0x1f17c,
+ 0x1f17f, 0x1f17f,
+ 0x1f18a, 0x1f18d,
+ 0x1f190, 0x1f190,
+ 0x1f200, 0x1f200,
+ 0x1f210, 0x1f231,
+ 0x1f240, 0x1f248,
+ 0x1fffe, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 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_5_2 */
+
+/* 'Age_6_0': Derived Age 6.0 */
+static const OnigCodePoint CR_Age_6_0[] = {
+ 511,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09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adf,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 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,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a,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ff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_0 */
+
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 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,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
+ 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, 0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38, 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, 0x1d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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_1 */
+
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
+
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
+
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
+
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
+
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
+ 0x2de0, 0x2dff,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
+ 0x31f0, 0x31ff,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
+ 0xfe00, 0xfe0f,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
+ 0xe0100, 0xe01ef,
+}; /* CR_In_Variation_Selectors_Supplement */
+
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
+
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
+ 1,
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
+
+static const OnigCodePoint* const CodeRanges[] = {
+ CR_NEWLINE,
+ CR_Alpha,
+ CR_Blank,
+ CR_Cntrl,
+ CR_Digit,
+ CR_Graph,
+ CR_Lower,
+ CR_Print,
+ CR_Punct,
+ CR_Space,
+ CR_Upper,
+ CR_XDigit,
+ CR_Word,
+ CR_Alnum,
+ CR_ASCII,
+#ifdef USE_UNICODE_PROPERTIES
+ CR_Any,
+ CR_Assigned,
+ CR_C,
+ CR_Cc,
+ CR_Cf,
+ CR_Cn,
+ CR_Co,
+ CR_Cs,
+ CR_L,
+ CR_LC,
+ CR_Ll,
+ CR_Lm,
+ CR_Lo,
+ CR_Lt,
+ CR_Lu,
+ CR_M,
+ CR_Mc,
+ CR_Me,
+ CR_Mn,
+ CR_N,
+ CR_Nd,
+ CR_Nl,
+ CR_No,
+ CR_P,
+ CR_Pc,
+ CR_Pd,
+ CR_Pe,
+ CR_Pf,
+ CR_Pi,
+ CR_Po,
+ CR_Ps,
+ CR_S,
+ CR_Sc,
+ CR_Sk,
+ CR_Sm,
+ CR_So,
+ CR_Z,
+ CR_Zl,
+ CR_Zp,
+ CR_Zs,
+ CR_Math,
+ CR_Alphabetic,
+ CR_Lowercase,
+ CR_Uppercase,
+ CR_Cased,
+ CR_Case_Ignorable,
+ CR_Changes_When_Lowercased,
+ CR_Changes_When_Uppercased,
+ CR_Changes_When_Titlecased,
+ CR_Changes_When_Casefolded,
+ CR_Changes_When_Casemapped,
+ CR_ID_Start,
+ CR_ID_Continue,
+ CR_XID_Start,
+ CR_XID_Continue,
+ CR_Default_Ignorable_Code_Point,
+ CR_Grapheme_Extend,
+ CR_Grapheme_Base,
+ CR_Grapheme_Link,
+ CR_Common,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+ CR_Armenian,
+ CR_Hebrew,
+ CR_Arabic,
+ CR_Syriac,
+ CR_Thaana,
+ CR_Devanagari,
+ CR_Bengali,
+ CR_Gurmukhi,
+ CR_Gujarati,
+ CR_Oriya,
+ CR_Tamil,
+ CR_Telugu,
+ CR_Kannada,
+ CR_Malayalam,
+ CR_Sinhala,
+ CR_Thai,
+ CR_Lao,
+ CR_Tibetan,
+ CR_Myanmar,
+ CR_Georgian,
+ CR_Hangul,
+ CR_Ethiopic,
+ CR_Cherokee,
+ CR_Canadian_Aboriginal,
+ CR_Ogham,
+ CR_Runic,
+ CR_Khmer,
+ CR_Mongolian,
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Bopomofo,
+ CR_Han,
+ CR_Yi,
+ CR_Old_Italic,
+ CR_Gothic,
+ CR_Deseret,
+ CR_Inherited,
+ CR_Tagalog,
+ CR_Hanunoo,
+ CR_Buhid,
+ CR_Tagbanwa,
+ CR_Limbu,
+ CR_Tai_Le,
+ CR_Linear_B,
+ CR_Ugaritic,
+ CR_Shavian,
+ CR_Osmanya,
+ CR_Cypriot,
+ CR_Braille,
+ CR_Buginese,
+ CR_Coptic,
+ CR_New_Tai_Lue,
+ CR_Glagolitic,
+ CR_Tifinagh,
+ CR_Syloti_Nagri,
+ CR_Old_Persian,
+ CR_Kharoshthi,
+ CR_Balinese,
+ CR_Cuneiform,
+ CR_Phoenician,
+ CR_Phags_Pa,
+ CR_Nko,
+ CR_Sundanese,
+ CR_Lepcha,
+ CR_Ol_Chiki,
+ CR_Vai,
+ CR_Saurashtra,
+ CR_Kayah_Li,
+ CR_Rejang,
+ CR_Lycian,
+ CR_Carian,
+ CR_Lydian,
+ CR_Cham,
+ CR_Tai_Tham,
+ CR_Tai_Viet,
+ CR_Avestan,
+ CR_Egyptian_Hieroglyphs,
+ CR_Samaritan,
+ CR_Lisu,
+ CR_Bamum,
+ CR_Javanese,
+ CR_Meetei_Mayek,
+ CR_Imperial_Aramaic,
+ CR_Old_South_Arabian,
+ CR_Inscriptional_Parthian,
+ CR_Inscriptional_Pahlavi,
+ CR_Old_Turkic,
+ CR_Kaithi,
+ CR_Batak,
+ CR_Brahmi,
+ CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
+ CR_White_Space,
+ CR_Bidi_Control,
+ CR_Join_Control,
+ CR_Dash,
+ CR_Hyphen,
+ CR_Quotation_Mark,
+ CR_Terminal_Punctuation,
+ CR_Other_Math,
+ CR_Hex_Digit,
+ CR_ASCII_Hex_Digit,
+ CR_Other_Alphabetic,
+ CR_Ideographic,
+ CR_Diacritic,
+ CR_Extender,
+ CR_Other_Lowercase,
+ CR_Other_Uppercase,
+ CR_Noncharacter_Code_Point,
+ CR_Other_Grapheme_Extend,
+ CR_IDS_Binary_Operator,
+ CR_IDS_Trinary_Operator,
+ CR_Radical,
+ CR_Unified_Ideograph,
+ CR_Other_Default_Ignorable_Code_Point,
+ CR_Deprecated,
+ CR_Soft_Dotted,
+ CR_Logical_Order_Exception,
+ CR_Other_ID_Start,
+ CR_Other_ID_Continue,
+ CR_STerm,
+ CR_Variation_Selector,
+ CR_Pattern_White_Space,
+ CR_Pattern_Syntax,
+ CR_Unknown,
+ CR_Age_1_1,
+ CR_Age_2_0,
+ CR_Age_2_1,
+ CR_Age_3_0,
+ CR_Age_3_1,
+ CR_Age_3_2,
+ CR_Age_4_0,
+ CR_Age_4_1,
+ CR_Age_5_0,
+ CR_Age_5_1,
+ CR_Age_5_2,
+ CR_Age_6_0,
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
+#endif /* USE_UNICODE_PROPERTIES */
+};
+struct uniname2ctype_struct {
+ int name, ctype;
+};
+
+static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
+
+#ifndef USE_UNICODE_PROPERTIES
+#define TOTAL_KEYWORDS 14
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 6
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 19
+/* maximum key range = 14, duplicates = 0 */
+#else /* USE_UNICODE_PROPERTIES */
+#define TOTAL_KEYWORDS 625
+#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 */
+#endif /* USE_UNICODE_PROPERTIES */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+uniname2ctype_hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+#ifndef USE_UNICODE_PROPERTIES
+ static const unsigned char asso_values[] =
+#else /* USE_UNICODE_PROPERTIES */
+ static const unsigned short asso_values[] =
+#endif /* USE_UNICODE_PROPERTIES */
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 3, 11, 5,
+ 4, 20, 20, 9, 20, 1, 20, 20, 10, 20,
+ 2, 20, 1, 20, 1, 7, 4, 6, 20, 1,
+ 4, 20, 20, 20, 20, 20, 20, 20
+#else /* USE_UNICODE_PROPERTIES */
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 1, 4168, 13, 1,
+ 3, 28, 31, 10, 27, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168,
+ 4168, 4168, 4168, 4168, 4168, 4168, 4168, 13, 854, 14,
+ 443, 19, 7, 570, 335, 4, 66, 1159, 102, 34,
+ 1, 178, 474, 1, 192, 2, 64, 1117, 491, 264,
+ 256, 1305, 3, 4168, 4168, 4168, 4168, 4168
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+#ifndef USE_UNICODE_PROPERTIES
+ return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
+#else /* USE_UNICODE_PROPERTIES */
+ register int hval = len;
+
+ switch (hval)
+ {
+ default:
+ hval += asso_values[(unsigned char)str[15]];
+ /*FALLTHROUGH*/
+ case 15:
+ case 14:
+ case 13:
+ case 12:
+ hval += asso_values[(unsigned char)str[11]];
+ /*FALLTHROUGH*/
+ case 11:
+ case 10:
+ case 9:
+ case 8:
+ case 7:
+ case 6:
+ hval += asso_values[(unsigned char)str[5]];
+ /*FALLTHROUGH*/
+ case 5:
+ hval += asso_values[(unsigned char)str[4]];
+ /*FALLTHROUGH*/
+ case 4:
+ case 3:
+ hval += asso_values[(unsigned char)str[2]];
+ /*FALLTHROUGH*/
+ case 2:
+ hval += asso_values[(unsigned char)str[1]];
+ /*FALLTHROUGH*/
+ case 1:
+ hval += asso_values[(unsigned char)str[0]];
+ break;
+ }
+ return hval + asso_values[(unsigned char)str[len - 1]];
+#endif /* USE_UNICODE_PROPERTIES */
+}
+
+struct uniname2ctype_pool_t
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ char uniname2ctype_pool_str6[sizeof("word")];
+ char uniname2ctype_pool_str7[sizeof("print")];
+ char uniname2ctype_pool_str8[sizeof("punct")];
+ char uniname2ctype_pool_str9[sizeof("alpha")];
+ char uniname2ctype_pool_str10[sizeof("alnum")];
+ char uniname2ctype_pool_str11[sizeof("xdigit")];
+ char uniname2ctype_pool_str12[sizeof("upper")];
+ char uniname2ctype_pool_str13[sizeof("ascii")];
+ char uniname2ctype_pool_str14[sizeof("cntrl")];
+ char uniname2ctype_pool_str15[sizeof("space")];
+ char uniname2ctype_pool_str16[sizeof("lower")];
+ char uniname2ctype_pool_str17[sizeof("graph")];
+ char uniname2ctype_pool_str18[sizeof("digit")];
+ char uniname2ctype_pool_str19[sizeof("blank")];
+#else /* USE_UNICODE_PROPERTIES */
+ char uniname2ctype_pool_str3[sizeof("n")];
+ char uniname2ctype_pool_str5[sizeof("s")];
+ char uniname2ctype_pool_str7[sizeof("z")];
+ char uniname2ctype_pool_str9[sizeof("zs")];
+ char uniname2ctype_pool_str16[sizeof("zzzz")];
+ char uniname2ctype_pool_str18[sizeof("cn")];
+ char uniname2ctype_pool_str20[sizeof("cs")];
+ char uniname2ctype_pool_str24[sizeof("ci")];
+ char uniname2ctype_pool_str29[sizeof("c")];
+ char uniname2ctype_pool_str30[sizeof("cf")];
+ char uniname2ctype_pool_str32[sizeof("sc")];
+ char uniname2ctype_pool_str34[sizeof("cans")];
+ char uniname2ctype_pool_str35[sizeof("qaai")];
+ char uniname2ctype_pool_str38[sizeof("mn")];
+ char uniname2ctype_pool_str42[sizeof("ascii")];
+ char uniname2ctype_pool_str44[sizeof("cc")];
+ char uniname2ctype_pool_str45[sizeof("qaac")];
+ char uniname2ctype_pool_str49[sizeof("inavestan")];
+ char uniname2ctype_pool_str52[sizeof("inspecials")];
+ char uniname2ctype_pool_str62[sizeof("inipaextensions")];
+ char uniname2ctype_pool_str64[sizeof("mc")];
+ char uniname2ctype_pool_str66[sizeof("insamaritan")];
+ char uniname2ctype_pool_str69[sizeof("m")];
+ char uniname2ctype_pool_str72[sizeof("sm")];
+ char uniname2ctype_pool_str74[sizeof("me")];
+ char uniname2ctype_pool_str82[sizeof("inarmenian")];
+ char uniname2ctype_pool_str84[sizeof("incuneiform")];
+ char uniname2ctype_pool_str86[sizeof("mandaic")];
+ char uniname2ctype_pool_str90[sizeof("inancientsymbols")];
+ char uniname2ctype_pool_str92[sizeof("incuneiformnumbersandpunctuation")];
+ char uniname2ctype_pool_str96[sizeof("inthai")];
+ char uniname2ctype_pool_str99[sizeof("inmusicalsymbols")];
+ char uniname2ctype_pool_str100[sizeof("inmiscellaneoussymbols")];
+ char uniname2ctype_pool_str106[sizeof("incham")];
+ char uniname2ctype_pool_str109[sizeof("inmiscellaneoussymbolsandarrows")];
+ char uniname2ctype_pool_str113[sizeof("initialpunctuation")];
+ char uniname2ctype_pool_str114[sizeof("inmiscellaneoussymbolsandpictographs")];
+ char uniname2ctype_pool_str116[sizeof("inthaana")];
+ char uniname2ctype_pool_str124[sizeof("taile")];
+ char uniname2ctype_pool_str125[sizeof("mtei")];
+ char uniname2ctype_pool_str132[sizeof("lc")];
+ char uniname2ctype_pool_str133[sizeof("lana")];
+ char uniname2ctype_pool_str134[sizeof("inlycian")];
+ char uniname2ctype_pool_str135[sizeof("intransportandmapsymbols")];
+ char uniname2ctype_pool_str136[sizeof("incontrolpictures")];
+ char uniname2ctype_pool_str142[sizeof("sinhala")];
+ char uniname2ctype_pool_str151[sizeof("incommonindicnumberforms")];
+ char uniname2ctype_pool_str156[sizeof("inmiscellaneousmathematicalsymbolsa")];
+ char uniname2ctype_pool_str158[sizeof("sterm")];
+ char uniname2ctype_pool_str167[sizeof("inmyanmarextendeda")];
+ char uniname2ctype_pool_str172[sizeof("lm")];
+ char uniname2ctype_pool_str175[sizeof("taiviet")];
+ char uniname2ctype_pool_str179[sizeof("inlinearbideograms")];
+ char uniname2ctype_pool_str180[sizeof("intaitham")];
+ char uniname2ctype_pool_str184[sizeof("latn")];
+ char uniname2ctype_pool_str186[sizeof("latin")];
+ char uniname2ctype_pool_str187[sizeof("ital")];
+ char uniname2ctype_pool_str189[sizeof("alnum")];
+ char uniname2ctype_pool_str199[sizeof("inmalayalam")];
+ char uniname2ctype_pool_str201[sizeof("intaile")];
+ char uniname2ctype_pool_str202[sizeof("tale")];
+ char uniname2ctype_pool_str205[sizeof("l")];
+ char uniname2ctype_pool_str207[sizeof("nl")];
+ char uniname2ctype_pool_str209[sizeof("zl")];
+ char uniname2ctype_pool_str216[sizeof("intamil")];
+ char uniname2ctype_pool_str217[sizeof("taml")];
+ char uniname2ctype_pool_str218[sizeof("inlatinextendeda")];
+ char uniname2ctype_pool_str220[sizeof("inlatinextendedc")];
+ char uniname2ctype_pool_str223[sizeof("inrunic")];
+ char uniname2ctype_pool_str224[sizeof("incarian")];
+ char uniname2ctype_pool_str225[sizeof("insyriac")];
+ char uniname2ctype_pool_str227[sizeof("cari")];
+ char uniname2ctype_pool_str230[sizeof("inmeeteimayekextensions")];
+ char uniname2ctype_pool_str231[sizeof("osma")];
+ char uniname2ctype_pool_str232[sizeof("lt")];
+ char uniname2ctype_pool_str233[sizeof("miao")];
+ char uniname2ctype_pool_str234[sizeof("insharada")];
+ char uniname2ctype_pool_str239[sizeof("incyrillic")];
+ char uniname2ctype_pool_str240[sizeof("carian")];
+ char uniname2ctype_pool_str244[sizeof("armn")];
+ char uniname2ctype_pool_str245[sizeof("samr")];
+ char uniname2ctype_pool_str247[sizeof("armi")];
+ char uniname2ctype_pool_str248[sizeof("inideographicdescriptioncharacters")];
+ char uniname2ctype_pool_str252[sizeof("inosmanya")];
+ char uniname2ctype_pool_str253[sizeof("armenian")];
+ char uniname2ctype_pool_str254[sizeof("inmyanmar")];
+ char uniname2ctype_pool_str255[sizeof("samaritan")];
+ char uniname2ctype_pool_str256[sizeof("arabic")];
+ char uniname2ctype_pool_str259[sizeof("incherokee")];
+ char uniname2ctype_pool_str261[sizeof("connectorpunctuation")];
+ char uniname2ctype_pool_str263[sizeof("merc")];
+ char uniname2ctype_pool_str264[sizeof("inmiscellaneoustechnical")];
+ char uniname2ctype_pool_str268[sizeof("inenclosedalphanumerics")];
+ char uniname2ctype_pool_str279[sizeof("inemoticons")];
+ char uniname2ctype_pool_str281[sizeof("joinc")];
+ char uniname2ctype_pool_str288[sizeof("cntrl")];
+ char uniname2ctype_pool_str301[sizeof("inenclosedcjklettersandmonths")];
+ char uniname2ctype_pool_str303[sizeof("cwcf")];
+ char uniname2ctype_pool_str304[sizeof("inruminumeralsymbols")];
+ char uniname2ctype_pool_str308[sizeof("ll")];
+ char uniname2ctype_pool_str313[sizeof("term")];
+ char uniname2ctype_pool_str316[sizeof("inlatinextendedadditional")];
+ char uniname2ctype_pool_str320[sizeof("tamil")];
+ char uniname2ctype_pool_str321[sizeof("loe")];
+ char uniname2ctype_pool_str329[sizeof("newtailue")];
+ char uniname2ctype_pool_str330[sizeof("cwcm")];
+ char uniname2ctype_pool_str339[sizeof("inenclosedalphanumericsupplement")];
+ char uniname2ctype_pool_str346[sizeof("sinh")];
+ char uniname2ctype_pool_str347[sizeof("zinh")];
+ char uniname2ctype_pool_str349[sizeof("meroiticcursive")];
+ char uniname2ctype_pool_str353[sizeof("han")];
+ char uniname2ctype_pool_str357[sizeof("hani")];
+ char uniname2ctype_pool_str358[sizeof("inopticalcharacterrecognition")];
+ char uniname2ctype_pool_str359[sizeof("no")];
+ char uniname2ctype_pool_str360[sizeof("so")];
+ char uniname2ctype_pool_str364[sizeof("innewtailue")];
+ char uniname2ctype_pool_str365[sizeof("insinhala")];
+ char uniname2ctype_pool_str367[sizeof("innko")];
+ char uniname2ctype_pool_str372[sizeof("co")];
+ char uniname2ctype_pool_str375[sizeof("shavian")];
+ char uniname2ctype_pool_str378[sizeof("terminalpunctuation")];
+ char uniname2ctype_pool_str386[sizeof("intaixuanjingsymbols")];
+ char uniname2ctype_pool_str387[sizeof("inethiopic")];
+ char uniname2ctype_pool_str389[sizeof("sora")];
+ char uniname2ctype_pool_str398[sizeof("inarrows")];
+ char uniname2ctype_pool_str400[sizeof("cham")];
+ char uniname2ctype_pool_str403[sizeof("inlowsurrogates")];
+ char uniname2ctype_pool_str405[sizeof("oriya")];
+ char uniname2ctype_pool_str406[sizeof("ext")];
+ char uniname2ctype_pool_str409[sizeof("cwt")];
+ char uniname2ctype_pool_str412[sizeof("common")];
+ char uniname2ctype_pool_str414[sizeof("inmiao")];
+ char uniname2ctype_pool_str420[sizeof("thai")];
+ char uniname2ctype_pool_str425[sizeof("intifinagh")];
+ char uniname2ctype_pool_str426[sizeof("ethi")];
+ char uniname2ctype_pool_str427[sizeof("mero")];
+ char uniname2ctype_pool_str428[sizeof("chakma")];
+ char uniname2ctype_pool_str429[sizeof("thaa")];
+ char uniname2ctype_pool_str430[sizeof("inscriptionalparthian")];
+ char uniname2ctype_pool_str432[sizeof("tifinagh")];
+ char uniname2ctype_pool_str436[sizeof("titlecaseletter")];
+ char uniname2ctype_pool_str445[sizeof("thaana")];
+ char uniname2ctype_pool_str449[sizeof("asciihexdigit")];
+ char uniname2ctype_pool_str450[sizeof("math")];
+ char uniname2ctype_pool_str453[sizeof("di")];
+ char uniname2ctype_pool_str454[sizeof("ids")];
+ char uniname2ctype_pool_str460[sizeof("lo")];
+ char uniname2ctype_pool_str468[sizeof("inlao")];
+ char uniname2ctype_pool_str470[sizeof("taitham")];
+ char uniname2ctype_pool_str474[sizeof("lao")];
+ char uniname2ctype_pool_str475[sizeof("laoo")];
+ char uniname2ctype_pool_str476[sizeof("dia")];
+ char uniname2ctype_pool_str478[sizeof("idc")];
+ char uniname2ctype_pool_str480[sizeof("ps")];
+ char uniname2ctype_pool_str481[sizeof("insundanese")];
+ char uniname2ctype_pool_str484[sizeof("pi")];
+ char uniname2ctype_pool_str485[sizeof("cwl")];
+ char uniname2ctype_pool_str490[sizeof("pf")];
+ char uniname2ctype_pool_str495[sizeof("mand")];
+ char uniname2ctype_pool_str496[sizeof("insylotinagri")];
+ char uniname2ctype_pool_str497[sizeof("vs")];
+ char uniname2ctype_pool_str503[sizeof("mongolian")];
+ char uniname2ctype_pool_str504[sizeof("pc")];
+ char uniname2ctype_pool_str506[sizeof("inmandaic")];
+ char uniname2ctype_pool_str509[sizeof("invai")];
+ char uniname2ctype_pool_str511[sizeof("lineseparator")];
+ char uniname2ctype_pool_str514[sizeof("pe")];
+ char uniname2ctype_pool_str515[sizeof("vai")];
+ char uniname2ctype_pool_str516[sizeof("vaii")];
+ char uniname2ctype_pool_str517[sizeof("idst")];
+ char uniname2ctype_pool_str520[sizeof("indominotiles")];
+ char uniname2ctype_pool_str521[sizeof("inshavian")];
+ char uniname2ctype_pool_str522[sizeof("inspacingmodifierletters")];
+ char uniname2ctype_pool_str524[sizeof("format")];
+ char uniname2ctype_pool_str528[sizeof("inphaistosdisc")];
+ char uniname2ctype_pool_str531[sizeof("hano")];
+ char uniname2ctype_pool_str532[sizeof("space")];
+ char uniname2ctype_pool_str542[sizeof("indeseret")];
+ char uniname2ctype_pool_str545[sizeof("inolchiki")];
+ char uniname2ctype_pool_str548[sizeof("hira")];
+ char uniname2ctype_pool_str553[sizeof("joincontrol")];
+ char uniname2ctype_pool_str555[sizeof("idcontinue")];
+ char uniname2ctype_pool_str558[sizeof("inmahjongtiles")];
+ char uniname2ctype_pool_str560[sizeof("patws")];
+ char uniname2ctype_pool_str563[sizeof("inlydian")];
+ char uniname2ctype_pool_str564[sizeof("cher")];
+ char uniname2ctype_pool_str568[sizeof("inhiragana")];
+ char uniname2ctype_pool_str572[sizeof("inogham")];
+ char uniname2ctype_pool_str574[sizeof("avst")];
+ char uniname2ctype_pool_str575[sizeof("inscriptionalpahlavi")];
+ char uniname2ctype_pool_str579[sizeof("incoptic")];
+ char uniname2ctype_pool_str587[sizeof("java")];
+ char uniname2ctype_pool_str589[sizeof("inmathematicalalphanumericsymbols")];
+ char uniname2ctype_pool_str594[sizeof("letter")];
+ char uniname2ctype_pool_str604[sizeof("injavanese")];
+ char uniname2ctype_pool_str608[sizeof("avestan")];
+ char uniname2ctype_pool_str612[sizeof("age=1.1")];
+ char uniname2ctype_pool_str613[sizeof("lepc")];
+ char uniname2ctype_pool_str614[sizeof("age=2.1")];
+ char uniname2ctype_pool_str616[sizeof("inlepcha")];
+ char uniname2ctype_pool_str617[sizeof("javanese")];
+ char uniname2ctype_pool_str618[sizeof("shaw")];
+ char uniname2ctype_pool_str619[sizeof("finalpunctuation")];
+ char uniname2ctype_pool_str620[sizeof("alpha")];
+ char uniname2ctype_pool_str621[sizeof("age=5.1")];
+ char uniname2ctype_pool_str622[sizeof("inmongolian")];
+ char uniname2ctype_pool_str623[sizeof("age=5.2")];
+ char uniname2ctype_pool_str626[sizeof("age=2.0")];
+ char uniname2ctype_pool_str627[sizeof("ahex")];
+ char uniname2ctype_pool_str630[sizeof("ingeneralpunctuation")];
+ char uniname2ctype_pool_str631[sizeof("oids")];
+ char uniname2ctype_pool_str632[sizeof("odi")];
+ char uniname2ctype_pool_str633[sizeof("age=5.0")];
+ char uniname2ctype_pool_str636[sizeof("tavt")];
+ char uniname2ctype_pool_str637[sizeof("intaiviet")];
+ char uniname2ctype_pool_str638[sizeof("age=6.1")];
+ char uniname2ctype_pool_str639[sizeof("age=3.1")];
+ char uniname2ctype_pool_str640[sizeof("insundanesesupplement")];
+ char uniname2ctype_pool_str641[sizeof("age=3.2")];
+ char uniname2ctype_pool_str642[sizeof("age=4.1")];
+ char uniname2ctype_pool_str643[sizeof("oidc")];
+ char uniname2ctype_pool_str646[sizeof("tfng")];
+ char uniname2ctype_pool_str647[sizeof("insmallformvariants")];
+ char uniname2ctype_pool_str648[sizeof("ideo")];
+ char uniname2ctype_pool_str649[sizeof("intags")];
+ char uniname2ctype_pool_str650[sizeof("age=6.0")];
+ char uniname2ctype_pool_str651[sizeof("age=3.0")];
+ char uniname2ctype_pool_str653[sizeof("whitespace")];
+ char uniname2ctype_pool_str654[sizeof("age=4.0")];
+ char uniname2ctype_pool_str655[sizeof("inolditalic")];
+ char uniname2ctype_pool_str660[sizeof("oalpha")];
+ char uniname2ctype_pool_str668[sizeof("ingujarati")];
+ char uniname2ctype_pool_str672[sizeof("control")];
+ char uniname2ctype_pool_str679[sizeof("diacritic")];
+ char uniname2ctype_pool_str682[sizeof("tagbanwa")];
+ char uniname2ctype_pool_str690[sizeof("inphoenician")];
+ char uniname2ctype_pool_str701[sizeof("ininscriptionalparthian")];
+ char uniname2ctype_pool_str703[sizeof("ininscriptionalpahlavi")];
+ char uniname2ctype_pool_str704[sizeof("coptic")];
+ char uniname2ctype_pool_str705[sizeof("dsrt")];
+ char uniname2ctype_pool_str706[sizeof("inmodifiertoneletters")];
+ char uniname2ctype_pool_str709[sizeof("xids")];
+ char uniname2ctype_pool_str713[sizeof("hanunoo")];
+ char uniname2ctype_pool_str715[sizeof("inoldturkic")];
+ char uniname2ctype_pool_str721[sizeof("xidc")];
+ char uniname2ctype_pool_str725[sizeof("idstart")];
+ char uniname2ctype_pool_str729[sizeof("inimperialaramaic")];
+ char uniname2ctype_pool_str730[sizeof("invariationselectors")];
+ char uniname2ctype_pool_str734[sizeof("copt")];
+ char uniname2ctype_pool_str737[sizeof("caseignorable")];
+ char uniname2ctype_pool_str738[sizeof("prti")];
+ char uniname2ctype_pool_str739[sizeof("nchar")];
+ char uniname2ctype_pool_str746[sizeof("deseret")];
+ char uniname2ctype_pool_str747[sizeof("decimalnumber")];
+ char uniname2ctype_pool_str748[sizeof("cprt")];
+ char uniname2ctype_pool_str750[sizeof("inlatin1supplement")];
+ char uniname2ctype_pool_str771[sizeof("imperialaramaic")];
+ char uniname2ctype_pool_str776[sizeof("privateuse")];
+ char uniname2ctype_pool_str777[sizeof("casedletter")];
+ char uniname2ctype_pool_str778[sizeof("lowercase")];
+ char uniname2ctype_pool_str780[sizeof("spaceseparator")];
+ char uniname2ctype_pool_str784[sizeof("radical")];
+ char uniname2ctype_pool_str787[sizeof("mong")];
+ char uniname2ctype_pool_str788[sizeof("canadianaboriginal")];
+ char uniname2ctype_pool_str792[sizeof("letternumber")];
+ char uniname2ctype_pool_str796[sizeof("insorasompeng")];
+ char uniname2ctype_pool_str797[sizeof("dash")];
+ char uniname2ctype_pool_str798[sizeof("wspace")];
+ char uniname2ctype_pool_str799[sizeof("ogam")];
+ char uniname2ctype_pool_str802[sizeof("invariationselectorssupplement")];
+ char uniname2ctype_pool_str803[sizeof("print")];
+ char uniname2ctype_pool_str811[sizeof("otheridcontinue")];
+ char uniname2ctype_pool_str815[sizeof("ingurmukhi")];
+ char uniname2ctype_pool_str818[sizeof("closepunctuation")];
+ char uniname2ctype_pool_str823[sizeof("olditalic")];
+ char uniname2ctype_pool_str824[sizeof("noncharactercodepoint")];
+ char uniname2ctype_pool_str826[sizeof("sharada")];
+ char uniname2ctype_pool_str827[sizeof("ingeometricshapes")];
+ char uniname2ctype_pool_str830[sizeof("otheralphabetic")];
+ char uniname2ctype_pool_str831[sizeof("patternwhitespace")];
+ char uniname2ctype_pool_str832[sizeof("po")];
+ char uniname2ctype_pool_str833[sizeof("rjng")];
+ char uniname2ctype_pool_str835[sizeof("ingreekandcoptic")];
+ char uniname2ctype_pool_str841[sizeof("xdigit")];
+ char uniname2ctype_pool_str850[sizeof("gothic")];
+ char uniname2ctype_pool_str851[sizeof("inoldsoutharabian")];
+ char uniname2ctype_pool_str852[sizeof("xidstart")];
+ char uniname2ctype_pool_str854[sizeof("inrejang")];
+ char uniname2ctype_pool_str860[sizeof("idsbinaryoperator")];
+ char uniname2ctype_pool_str867[sizeof("olower")];
+ char uniname2ctype_pool_str869[sizeof("hex")];
+ char uniname2ctype_pool_str870[sizeof("inenclosedideographicsupplement")];
+ char uniname2ctype_pool_str874[sizeof("inalphabeticpresentationforms")];
+ char uniname2ctype_pool_str879[sizeof("inbasiclatin")];
+ char uniname2ctype_pool_str884[sizeof("othersymbol")];
+ char uniname2ctype_pool_str889[sizeof("nd")];
+ char uniname2ctype_pool_str890[sizeof("sd")];
+ char uniname2ctype_pool_str900[sizeof("omath")];
+ char uniname2ctype_pool_str901[sizeof("separator")];
+ char uniname2ctype_pool_str907[sizeof("inarabic")];
+ char uniname2ctype_pool_str912[sizeof("xidcontinue")];
+ char uniname2ctype_pool_str913[sizeof("otheridstart")];
+ char uniname2ctype_pool_str914[sizeof("grext")];
+ char uniname2ctype_pool_str917[sizeof("otherlowercase")];
+ char uniname2ctype_pool_str919[sizeof("phli")];
+ char uniname2ctype_pool_str920[sizeof("cased")];
+ char uniname2ctype_pool_str923[sizeof("hang")];
+ char uniname2ctype_pool_str931[sizeof("xpeo")];
+ char uniname2ctype_pool_str933[sizeof("lower")];
+ char uniname2ctype_pool_str936[sizeof("modifierletter")];
+ char uniname2ctype_pool_str938[sizeof("inphoneticextensions")];
+ char uniname2ctype_pool_str939[sizeof("inarabicpresentationformsa")];
+ char uniname2ctype_pool_str943[sizeof("innumberforms")];
+ char uniname2ctype_pool_str945[sizeof("oldpersian")];
+ char uniname2ctype_pool_str946[sizeof("incyrillicextendeda")];
+ char uniname2ctype_pool_str947[sizeof("inverticalforms")];
+ char uniname2ctype_pool_str949[sizeof("p")];
+ char uniname2ctype_pool_str950[sizeof("inbyzantinemusicalsymbols")];
+ char uniname2ctype_pool_str951[sizeof("inmathematicaloperators")];
+ char uniname2ctype_pool_str952[sizeof("intibetan")];
+ char uniname2ctype_pool_str953[sizeof("zp")];
+ char uniname2ctype_pool_str956[sizeof("ingeorgian")];
+ char uniname2ctype_pool_str960[sizeof("inbraillepatterns")];
+ char uniname2ctype_pool_str962[sizeof("lepcha")];
+ char uniname2ctype_pool_str963[sizeof("geor")];
+ char uniname2ctype_pool_str964[sizeof("invedicextensions")];
+ char uniname2ctype_pool_str965[sizeof("linb")];
+ char uniname2ctype_pool_str966[sizeof("other")];
+ char uniname2ctype_pool_str970[sizeof("deva")];
+ char uniname2ctype_pool_str972[sizeof("indevanagari")];
+ char uniname2ctype_pool_str973[sizeof("othernumber")];
+ char uniname2ctype_pool_str974[sizeof("bamum")];
+ char uniname2ctype_pool_str976[sizeof("shrd")];
+ char uniname2ctype_pool_str977[sizeof("bali")];
+ char uniname2ctype_pool_str981[sizeof("devanagari")];
+ char uniname2ctype_pool_str983[sizeof("extender")];
+ char uniname2ctype_pool_str988[sizeof("inherited")];
+ char uniname2ctype_pool_str989[sizeof("glagolitic")];
+ char uniname2ctype_pool_str990[sizeof("tibt")];
+ char uniname2ctype_pool_str994[sizeof("inbalinese")];
+ char uniname2ctype_pool_str996[sizeof("ingothic")];
+ char uniname2ctype_pool_str997[sizeof("inmiscellaneousmathematicalsymbolsb")];
+ char uniname2ctype_pool_str998[sizeof("limb")];
+ char uniname2ctype_pool_str1000[sizeof("bengali")];
+ char uniname2ctype_pool_str1003[sizeof("phoenician")];
+ char uniname2ctype_pool_str1004[sizeof("insuperscriptsandsubscripts")];
+ char uniname2ctype_pool_str1006[sizeof("inmeroitichieroglyphs")];
+ char uniname2ctype_pool_str1007[sizeof("tibetan")];
+ char uniname2ctype_pool_str1010[sizeof("inphoneticextensionssupplement")];
+ char uniname2ctype_pool_str1016[sizeof("balinese")];
+ char uniname2ctype_pool_str1021[sizeof("lowercaseletter")];
+ char uniname2ctype_pool_str1031[sizeof("indingbats")];
+ char uniname2ctype_pool_str1035[sizeof("inprivateusearea")];
+ char uniname2ctype_pool_str1039[sizeof("assigned")];
+ char uniname2ctype_pool_str1044[sizeof("patternsyntax")];
+ char uniname2ctype_pool_str1051[sizeof("inhangulsyllables")];
+ char uniname2ctype_pool_str1065[sizeof("sarb")];
+ char uniname2ctype_pool_str1067[sizeof("brai")];
+ char uniname2ctype_pool_str1069[sizeof("insupplementalmathematicaloperators")];
+ char uniname2ctype_pool_str1070[sizeof("phnx")];
+ char uniname2ctype_pool_str1072[sizeof("ingreekextended")];
+ char uniname2ctype_pool_str1074[sizeof("otherletter")];
+ char uniname2ctype_pool_str1076[sizeof("arab")];
+ char uniname2ctype_pool_str1078[sizeof("inlatinextendedd")];
+ char uniname2ctype_pool_str1081[sizeof("word")];
+ char uniname2ctype_pool_str1084[sizeof("inphagspa")];
+ char uniname2ctype_pool_str1087[sizeof("inblockelements")];
+ char uniname2ctype_pool_str1092[sizeof("ethiopic")];
+ char uniname2ctype_pool_str1094[sizeof("inethiopicextendeda")];
+ char uniname2ctype_pool_str1107[sizeof("brahmi")];
+ char uniname2ctype_pool_str1110[sizeof("logicalorderexception")];
+ char uniname2ctype_pool_str1114[sizeof("inoldpersian")];
+ char uniname2ctype_pool_str1129[sizeof("inletterlikesymbols")];
+ char uniname2ctype_pool_str1133[sizeof("sorasompeng")];
+ char uniname2ctype_pool_str1135[sizeof("hiragana")];
+ char uniname2ctype_pool_str1142[sizeof("inhanguljamoextendeda")];
+ char uniname2ctype_pool_str1147[sizeof("othermath")];
+ char uniname2ctype_pool_str1150[sizeof("digit")];
+ char uniname2ctype_pool_str1151[sizeof("goth")];
+ char uniname2ctype_pool_str1156[sizeof("ogham")];
+ char uniname2ctype_pool_str1162[sizeof("sundanese")];
+ char uniname2ctype_pool_str1170[sizeof("saurashtra")];
+ char uniname2ctype_pool_str1173[sizeof("linearb")];
+ char uniname2ctype_pool_str1179[sizeof("graphemebase")];
+ char uniname2ctype_pool_str1185[sizeof("inunifiedcanadianaboriginalsyllabics")];
+ char uniname2ctype_pool_str1186[sizeof("cuneiform")];
+ char uniname2ctype_pool_str1188[sizeof("inkannada")];
+ char uniname2ctype_pool_str1190[sizeof("kana")];
+ char uniname2ctype_pool_str1195[sizeof("inancientgreeknumbers")];
+ char uniname2ctype_pool_str1196[sizeof("incjkstrokes")];
+ char uniname2ctype_pool_str1198[sizeof("inglagolitic")];
+ char uniname2ctype_pool_str1202[sizeof("inancientgreekmusicalnotation")];
+ char uniname2ctype_pool_str1212[sizeof("inchakma")];
+ char uniname2ctype_pool_str1215[sizeof("plrd")];
+ char uniname2ctype_pool_str1219[sizeof("inbrahmi")];
+ char uniname2ctype_pool_str1224[sizeof("cakm")];
+ char uniname2ctype_pool_str1225[sizeof("incjkcompatibilityforms")];
+ char uniname2ctype_pool_str1229[sizeof("lisu")];
+ char uniname2ctype_pool_str1230[sizeof("incjkcompatibilityideographs")];
+ char uniname2ctype_pool_str1231[sizeof("intagalog")];
+ char uniname2ctype_pool_str1244[sizeof("inkaithi")];
+ char uniname2ctype_pool_str1245[sizeof("insupplementalarrowsa")];
+ char uniname2ctype_pool_str1249[sizeof("takri")];
+ char uniname2ctype_pool_str1253[sizeof("ideographic")];
+ char uniname2ctype_pool_str1256[sizeof("hexdigit")];
+ char uniname2ctype_pool_str1259[sizeof("glag")];
+ char uniname2ctype_pool_str1261[sizeof("softdotted")];
+ char uniname2ctype_pool_str1262[sizeof("variationselector")];
+ char uniname2ctype_pool_str1264[sizeof("inkatakana")];
+ char uniname2ctype_pool_str1265[sizeof("meeteimayek")];
+ char uniname2ctype_pool_str1274[sizeof("otherpunctuation")];
+ char uniname2ctype_pool_str1279[sizeof("inhanguljamo")];
+ char uniname2ctype_pool_str1282[sizeof("kali")];
+ char uniname2ctype_pool_str1289[sizeof("braille")];
+ char uniname2ctype_pool_str1298[sizeof("incombininghalfmarks")];
+ char uniname2ctype_pool_str1300[sizeof("talu")];
+ char uniname2ctype_pool_str1302[sizeof("incjkcompatibilityideographssupplement")];
+ char uniname2ctype_pool_str1306[sizeof("telu")];
+ char uniname2ctype_pool_str1307[sizeof("idsb")];
+ char uniname2ctype_pool_str1310[sizeof("tglg")];
+ char uniname2ctype_pool_str1313[sizeof("inmeeteimayek")];
+ char uniname2ctype_pool_str1315[sizeof("yi")];
+ char uniname2ctype_pool_str1318[sizeof("phagspa")];
+ char uniname2ctype_pool_str1321[sizeof("yiii")];
+ char uniname2ctype_pool_str1323[sizeof("inarabicmathematicalalphabeticsymbols")];
+ char uniname2ctype_pool_str1328[sizeof("saur")];
+ char uniname2ctype_pool_str1330[sizeof("ogrext")];
+ char uniname2ctype_pool_str1334[sizeof("bidic")];
+ char uniname2ctype_pool_str1341[sizeof("inkanasupplement")];
+ char uniname2ctype_pool_str1343[sizeof("runic")];
+ char uniname2ctype_pool_str1344[sizeof("inalchemicalsymbols")];
+ char uniname2ctype_pool_str1350[sizeof("georgian")];
+ char uniname2ctype_pool_str1351[sizeof("inugaritic")];
+ char uniname2ctype_pool_str1354[sizeof("insaurashtra")];
+ char uniname2ctype_pool_str1356[sizeof("inhighprivateusesurrogates")];
+ char uniname2ctype_pool_str1362[sizeof("pd")];
+ char uniname2ctype_pool_str1372[sizeof("incountingrodnumerals")];
+ char uniname2ctype_pool_str1377[sizeof("inarabicextendeda")];
+ char uniname2ctype_pool_str1389[sizeof("inkharoshthi")];
+ char uniname2ctype_pool_str1393[sizeof("idstrinaryoperator")];
+ char uniname2ctype_pool_str1396[sizeof("phag")];
+ char uniname2ctype_pool_str1398[sizeof("brah")];
+ char uniname2ctype_pool_str1402[sizeof("mark")];
+ char uniname2ctype_pool_str1404[sizeof("hebr")];
+ char uniname2ctype_pool_str1411[sizeof("inkhmersymbols")];
+ char uniname2ctype_pool_str1413[sizeof("dep")];
+ char uniname2ctype_pool_str1416[sizeof("inkhmer")];
+ char uniname2ctype_pool_str1422[sizeof("deprecated")];
+ char uniname2ctype_pool_str1424[sizeof("rejang")];
+ char uniname2ctype_pool_str1429[sizeof("lyci")];
+ char uniname2ctype_pool_str1431[sizeof("intakri")];
+ char uniname2ctype_pool_str1432[sizeof("takr")];
+ char uniname2ctype_pool_str1435[sizeof("incyrillicsupplement")];
+ char uniname2ctype_pool_str1436[sizeof("changeswhencasefolded")];
+ char uniname2ctype_pool_str1438[sizeof("indevanagariextended")];
+ char uniname2ctype_pool_str1442[sizeof("lycian")];
+ char uniname2ctype_pool_str1443[sizeof("inbengali")];
+ char uniname2ctype_pool_str1448[sizeof("beng")];
+ char uniname2ctype_pool_str1450[sizeof("graph")];
+ char uniname2ctype_pool_str1452[sizeof("inyijinghexagramsymbols")];
+ char uniname2ctype_pool_str1457[sizeof("olck")];
+ char uniname2ctype_pool_str1460[sizeof("inarabicsupplement")];
+ char uniname2ctype_pool_str1462[sizeof("inbuginese")];
+ char uniname2ctype_pool_str1463[sizeof("changeswhencasemapped")];
+ char uniname2ctype_pool_str1468[sizeof("olchiki")];
+ char uniname2ctype_pool_str1478[sizeof("inaegeannumbers")];
+ char uniname2ctype_pool_str1479[sizeof("mlym")];
+ char uniname2ctype_pool_str1480[sizeof("alphabetic")];
+ char uniname2ctype_pool_str1492[sizeof("sylotinagri")];
+ char uniname2ctype_pool_str1498[sizeof("changeswhentitlecased")];
+ char uniname2ctype_pool_str1504[sizeof("tagalog")];
+ char uniname2ctype_pool_str1505[sizeof("tagb")];
+ char uniname2ctype_pool_str1506[sizeof("runr")];
+ char uniname2ctype_pool_str1510[sizeof("malayalam")];
+ char uniname2ctype_pool_str1512[sizeof("inoriya")];
+ char uniname2ctype_pool_str1516[sizeof("intagbanwa")];
+ char uniname2ctype_pool_str1517[sizeof("syrc")];
+ char uniname2ctype_pool_str1519[sizeof("nko")];
+ char uniname2ctype_pool_str1520[sizeof("nkoo")];
+ char uniname2ctype_pool_str1523[sizeof("inethiopicextended")];
+ char uniname2ctype_pool_str1525[sizeof("kaithi")];
+ char uniname2ctype_pool_str1530[sizeof("mathsymbol")];
+ char uniname2ctype_pool_str1531[sizeof("inyiradicals")];
+ char uniname2ctype_pool_str1536[sizeof("insupplementaryprivateuseareaa")];
+ char uniname2ctype_pool_str1540[sizeof("osmanya")];
+ char uniname2ctype_pool_str1546[sizeof("syriac")];
+ char uniname2ctype_pool_str1548[sizeof("otherdefaultignorablecodepoint")];
+ char uniname2ctype_pool_str1561[sizeof("number")];
+ char uniname2ctype_pool_str1565[sizeof("inlinearbsyllabary")];
+ char uniname2ctype_pool_str1566[sizeof("kthi")];
+ char uniname2ctype_pool_str1567[sizeof("sund")];
+ char uniname2ctype_pool_str1569[sizeof("mymr")];
+ char uniname2ctype_pool_str1571[sizeof("incombiningdiacriticalmarks")];
+ char uniname2ctype_pool_str1578[sizeof("enclosingmark")];
+ char uniname2ctype_pool_str1581[sizeof("incombiningdiacriticalmarksforsymbols")];
+ char uniname2ctype_pool_str1583[sizeof("inethiopicsupplement")];
+ char uniname2ctype_pool_str1590[sizeof("unassigned")];
+ char uniname2ctype_pool_str1591[sizeof("sylo")];
+ char uniname2ctype_pool_str1595[sizeof("combiningmark")];
+ char uniname2ctype_pool_str1598[sizeof("myanmar")];
+ char uniname2ctype_pool_str1605[sizeof("graphemeextend")];
+ char uniname2ctype_pool_str1606[sizeof("bidicontrol")];
+ char uniname2ctype_pool_str1609[sizeof("inhalfwidthandfullwidthforms")];
+ char uniname2ctype_pool_str1617[sizeof("cyrl")];
+ char uniname2ctype_pool_str1620[sizeof("knda")];
+ char uniname2ctype_pool_str1634[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
+ char uniname2ctype_pool_str1635[sizeof("xsux")];
+ char uniname2ctype_pool_str1636[sizeof("modifiersymbol")];
+ char uniname2ctype_pool_str1643[sizeof("incombiningdiacriticalmarkssupplement")];
+ char uniname2ctype_pool_str1645[sizeof("inhanunoo")];
+ char uniname2ctype_pool_str1648[sizeof("inbuhid")];
+ char uniname2ctype_pool_str1649[sizeof("kannada")];
+ char uniname2ctype_pool_str1658[sizeof("inhebrew")];
+ char uniname2ctype_pool_str1662[sizeof("grbase")];
+ char uniname2ctype_pool_str1664[sizeof("spacingmark")];
+ char uniname2ctype_pool_str1670[sizeof("inkatakanaphoneticextensions")];
+ char uniname2ctype_pool_str1676[sizeof("hangul")];
+ char uniname2ctype_pool_str1683[sizeof("incjksymbolsandpunctuation")];
+ char uniname2ctype_pool_str1688[sizeof("bopo")];
+ char uniname2ctype_pool_str1692[sizeof("orya")];
+ char uniname2ctype_pool_str1699[sizeof("inbopomofo")];
+ char uniname2ctype_pool_str1701[sizeof("kharoshthi")];
+ char uniname2ctype_pool_str1703[sizeof("khar")];
+ char uniname2ctype_pool_str1709[sizeof("changeswhenlowercased")];
+ char uniname2ctype_pool_str1724[sizeof("khmr")];
+ char uniname2ctype_pool_str1725[sizeof("punct")];
+ char uniname2ctype_pool_str1729[sizeof("symbol")];
+ char uniname2ctype_pool_str1732[sizeof("cherokee")];
+ char uniname2ctype_pool_str1737[sizeof("cyrillic")];
+ char uniname2ctype_pool_str1759[sizeof("inkangxiradicals")];
+ char uniname2ctype_pool_str1761[sizeof("hebrew")];
+ char uniname2ctype_pool_str1780[sizeof("inarabicpresentationformsb")];
+ char uniname2ctype_pool_str1787[sizeof("incyrillicextendedb")];
+ char uniname2ctype_pool_str1790[sizeof("ugaritic")];
+ char uniname2ctype_pool_str1829[sizeof("incurrencysymbols")];
+ char uniname2ctype_pool_str1831[sizeof("meroitichieroglyphs")];
+ char uniname2ctype_pool_str1835[sizeof("inhighsurrogates")];
+ char uniname2ctype_pool_str1853[sizeof("nonspacingmark")];
+ char uniname2ctype_pool_str1858[sizeof("lydi")];
+ char uniname2ctype_pool_str1864[sizeof("patsyn")];
+ char uniname2ctype_pool_str1868[sizeof("orkh")];
+ char uniname2ctype_pool_str1871[sizeof("lydian")];
+ char uniname2ctype_pool_str1896[sizeof("ugar")];
+ char uniname2ctype_pool_str1899[sizeof("othergraphemeextend")];
+ char uniname2ctype_pool_str1900[sizeof("inlatinextendedb")];
+ char uniname2ctype_pool_str1904[sizeof("bopomofo")];
+ char uniname2ctype_pool_str1917[sizeof("khmer")];
+ char uniname2ctype_pool_str1925[sizeof("uideo")];
+ char uniname2ctype_pool_str1932[sizeof("otheruppercase")];
+ char uniname2ctype_pool_str1944[sizeof("grek")];
+ char uniname2ctype_pool_str1949[sizeof("gujr")];
+ char uniname2ctype_pool_str1970[sizeof("gujarati")];
+ char uniname2ctype_pool_str1983[sizeof("inhanguljamoextendedb")];
+ char uniname2ctype_pool_str1988[sizeof("defaultignorablecodepoint")];
+ char uniname2ctype_pool_str2005[sizeof("inplayingcards")];
+ char uniname2ctype_pool_str2022[sizeof("bamu")];
+ char uniname2ctype_pool_str2028[sizeof("inkanbun")];
+ char uniname2ctype_pool_str2033[sizeof("incjkradicalssupplement")];
+ char uniname2ctype_pool_str2046[sizeof("cypriot")];
+ char uniname2ctype_pool_str2051[sizeof("inbamum")];
+ char uniname2ctype_pool_str2053[sizeof("inmeroiticcursive")];
+ char uniname2ctype_pool_str2055[sizeof("oldturkic")];
+ char uniname2ctype_pool_str2086[sizeof("insupplementalarrowsb")];
+ char uniname2ctype_pool_str2087[sizeof("surrogate")];
+ char uniname2ctype_pool_str2094[sizeof("batk")];
+ char uniname2ctype_pool_str2102[sizeof("inbatak")];
+ char uniname2ctype_pool_str2119[sizeof("inlimbu")];
+ char uniname2ctype_pool_str2123[sizeof("incypriotsyllabary")];
+ char uniname2ctype_pool_str2129[sizeof("dashpunctuation")];
+ char uniname2ctype_pool_str2130[sizeof("innoblock")];
+ char uniname2ctype_pool_str2141[sizeof("hyphen")];
+ char uniname2ctype_pool_str2162[sizeof("insupplementalpunctuation")];
+ char uniname2ctype_pool_str2165[sizeof("ingeorgiansupplement")];
+ char uniname2ctype_pool_str2178[sizeof("oupper")];
+ char uniname2ctype_pool_str2189[sizeof("paragraphseparator")];
+ char uniname2ctype_pool_str2194[sizeof("inbamumsupplement")];
+ char uniname2ctype_pool_str2299[sizeof("uppercase")];
+ char uniname2ctype_pool_str2313[sizeof("currencysymbol")];
+ char uniname2ctype_pool_str2322[sizeof("sk")];
+ char uniname2ctype_pool_str2338[sizeof("lu")];
+ char uniname2ctype_pool_str2342[sizeof("openpunctuation")];
+ char uniname2ctype_pool_str2349[sizeof("inlisu")];
+ char uniname2ctype_pool_str2371[sizeof("qmark")];
+ char uniname2ctype_pool_str2372[sizeof("egyp")];
+ char uniname2ctype_pool_str2377[sizeof("insupplementaryprivateuseareab")];
+ char uniname2ctype_pool_str2379[sizeof("limbu")];
+ char uniname2ctype_pool_str2400[sizeof("inegyptianhieroglyphs")];
+ char uniname2ctype_pool_str2401[sizeof("unifiedideograph")];
+ char uniname2ctype_pool_str2413[sizeof("intelugu")];
+ char uniname2ctype_pool_str2429[sizeof("katakana")];
+ char uniname2ctype_pool_str2442[sizeof("inhangulcompatibilityjamo")];
+ char uniname2ctype_pool_str2454[sizeof("upper")];
+ char uniname2ctype_pool_str2495[sizeof("inkayahli")];
+ char uniname2ctype_pool_str2515[sizeof("cwu")];
+ char uniname2ctype_pool_str2523[sizeof("incjkcompatibility")];
+ char uniname2ctype_pool_str2542[sizeof("uppercaseletter")];
+ char uniname2ctype_pool_str2549[sizeof("bugi")];
+ char uniname2ctype_pool_str2588[sizeof("buginese")];
+ char uniname2ctype_pool_str2627[sizeof("any")];
+ char uniname2ctype_pool_str2651[sizeof("inyisyllables")];
+ char uniname2ctype_pool_str2671[sizeof("inbopomofoextended")];
+ char uniname2ctype_pool_str2710[sizeof("inboxdrawing")];
+ char uniname2ctype_pool_str2724[sizeof("changeswhenuppercased")];
+ char uniname2ctype_pool_str2727[sizeof("unknown")];
+ char uniname2ctype_pool_str2737[sizeof("quotationmark")];
+ char uniname2ctype_pool_str2753[sizeof("buhd")];
+ char uniname2ctype_pool_str2785[sizeof("punctuation")];
+ char uniname2ctype_pool_str2888[sizeof("oldsoutharabian")];
+ char uniname2ctype_pool_str2925[sizeof("kayahli")];
+ char uniname2ctype_pool_str2940[sizeof("incjkunifiedideographs")];
+ char uniname2ctype_pool_str2961[sizeof("incjkunifiedideographsextensiona")];
+ char uniname2ctype_pool_str2962[sizeof("incjkunifiedideographsextensionc")];
+ char uniname2ctype_pool_str2995[sizeof("telugu")];
+ char uniname2ctype_pool_str3000[sizeof("guru")];
+ char uniname2ctype_pool_str3104[sizeof("greek")];
+ char uniname2ctype_pool_str3189[sizeof("grlink")];
+ char uniname2ctype_pool_str3197[sizeof("buhid")];
+ char uniname2ctype_pool_str3254[sizeof("batak")];
+ char uniname2ctype_pool_str3292[sizeof("blank")];
+ char uniname2ctype_pool_str3391[sizeof("incjkunifiedideographsextensiond")];
+ char uniname2ctype_pool_str3459[sizeof("graphemelink")];
+ char uniname2ctype_pool_str3480[sizeof("egyptianhieroglyphs")];
+ char uniname2ctype_pool_str3802[sizeof("incjkunifiedideographsextensionb")];
+ char uniname2ctype_pool_str3922[sizeof("zyyy")];
+ char uniname2ctype_pool_str4167[sizeof("gurmukhi")];
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
+ {
+#ifndef USE_UNICODE_PROPERTIES
+ "word",
+ "print",
+ "punct",
+ "alpha",
+ "alnum",
+ "xdigit",
+ "upper",
+#else /* USE_UNICODE_PROPERTIES */
+ "n",
+ "s",
+ "z",
+ "zs",
+ "zzzz",
+ "cn",
+ "cs",
+ "ci",
+ "c",
+ "cf",
+ "sc",
+ "cans",
+ "qaai",
+ "mn",
+#endif /* USE_UNICODE_PROPERTIES */
+ "ascii",
+#ifdef USE_UNICODE_PROPERTIES
+ "cc",
+ "qaac",
+ "inavestan",
+ "inspecials",
+ "inipaextensions",
+ "mc",
+ "insamaritan",
+ "m",
+ "sm",
+ "me",
+ "inarmenian",
+ "incuneiform",
+ "mandaic",
+ "inancientsymbols",
+ "incuneiformnumbersandpunctuation",
+ "inthai",
+ "inmusicalsymbols",
+ "inmiscellaneoussymbols",
+ "incham",
+ "inmiscellaneoussymbolsandarrows",
+ "initialpunctuation",
+ "inmiscellaneoussymbolsandpictographs",
+ "inthaana",
+ "taile",
+ "mtei",
+ "lc",
+ "lana",
+ "inlycian",
+ "intransportandmapsymbols",
+ "incontrolpictures",
+ "sinhala",
+ "incommonindicnumberforms",
+ "inmiscellaneousmathematicalsymbolsa",
+ "sterm",
+ "inmyanmarextendeda",
+ "lm",
+ "taiviet",
+ "inlinearbideograms",
+ "intaitham",
+ "latn",
+ "latin",
+ "ital",
+ "alnum",
+ "inmalayalam",
+ "intaile",
+ "tale",
+ "l",
+ "nl",
+ "zl",
+ "intamil",
+ "taml",
+ "inlatinextendeda",
+ "inlatinextendedc",
+ "inrunic",
+ "incarian",
+ "insyriac",
+ "cari",
+ "inmeeteimayekextensions",
+ "osma",
+ "lt",
+ "miao",
+ "insharada",
+ "incyrillic",
+ "carian",
+ "armn",
+ "samr",
+ "armi",
+ "inideographicdescriptioncharacters",
+ "inosmanya",
+ "armenian",
+ "inmyanmar",
+ "samaritan",
+ "arabic",
+ "incherokee",
+ "connectorpunctuation",
+ "merc",
+ "inmiscellaneoustechnical",
+ "inenclosedalphanumerics",
+ "inemoticons",
+ "joinc",
+#endif /* USE_UNICODE_PROPERTIES */
+ "cntrl",
+#ifdef USE_UNICODE_PROPERTIES
+ "inenclosedcjklettersandmonths",
+ "cwcf",
+ "inruminumeralsymbols",
+ "ll",
+ "term",
+ "inlatinextendedadditional",
+ "tamil",
+ "loe",
+ "newtailue",
+ "cwcm",
+ "inenclosedalphanumericsupplement",
+ "sinh",
+ "zinh",
+ "meroiticcursive",
+ "han",
+ "hani",
+ "inopticalcharacterrecognition",
+ "no",
+ "so",
+ "innewtailue",
+ "insinhala",
+ "innko",
+ "co",
+ "shavian",
+ "terminalpunctuation",
+ "intaixuanjingsymbols",
+ "inethiopic",
+ "sora",
+ "inarrows",
+ "cham",
+ "inlowsurrogates",
+ "oriya",
+ "ext",
+ "cwt",
+ "common",
+ "inmiao",
+ "thai",
+ "intifinagh",
+ "ethi",
+ "mero",
+ "chakma",
+ "thaa",
+ "inscriptionalparthian",
+ "tifinagh",
+ "titlecaseletter",
+ "thaana",
+ "asciihexdigit",
+ "math",
+ "di",
+ "ids",
+ "lo",
+ "inlao",
+ "taitham",
+ "lao",
+ "laoo",
+ "dia",
+ "idc",
+ "ps",
+ "insundanese",
+ "pi",
+ "cwl",
+ "pf",
+ "mand",
+ "insylotinagri",
+ "vs",
+ "mongolian",
+ "pc",
+ "inmandaic",
+ "invai",
+ "lineseparator",
+ "pe",
+ "vai",
+ "vaii",
+ "idst",
+ "indominotiles",
+ "inshavian",
+ "inspacingmodifierletters",
+ "format",
+ "inphaistosdisc",
+ "hano",
+#endif /* USE_UNICODE_PROPERTIES */
+ "space",
+#ifdef USE_UNICODE_PROPERTIES
+ "indeseret",
+ "inolchiki",
+ "hira",
+ "joincontrol",
+ "idcontinue",
+ "inmahjongtiles",
+ "patws",
+ "inlydian",
+ "cher",
+ "inhiragana",
+ "inogham",
+ "avst",
+ "inscriptionalpahlavi",
+ "incoptic",
+ "java",
+ "inmathematicalalphanumericsymbols",
+ "letter",
+ "injavanese",
+ "avestan",
+ "age=1.1",
+ "lepc",
+ "age=2.1",
+ "inlepcha",
+ "javanese",
+ "shaw",
+ "finalpunctuation",
+ "alpha",
+ "age=5.1",
+ "inmongolian",
+ "age=5.2",
+ "age=2.0",
+ "ahex",
+ "ingeneralpunctuation",
+ "oids",
+ "odi",
+ "age=5.0",
+ "tavt",
+ "intaiviet",
+ "age=6.1",
+ "age=3.1",
+ "insundanesesupplement",
+ "age=3.2",
+ "age=4.1",
+ "oidc",
+ "tfng",
+ "insmallformvariants",
+ "ideo",
+ "intags",
+ "age=6.0",
+ "age=3.0",
+ "whitespace",
+ "age=4.0",
+ "inolditalic",
+ "oalpha",
+ "ingujarati",
+ "control",
+ "diacritic",
+ "tagbanwa",
+ "inphoenician",
+ "ininscriptionalparthian",
+ "ininscriptionalpahlavi",
+ "coptic",
+ "dsrt",
+ "inmodifiertoneletters",
+ "xids",
+ "hanunoo",
+ "inoldturkic",
+ "xidc",
+ "idstart",
+ "inimperialaramaic",
+ "invariationselectors",
+ "copt",
+ "caseignorable",
+ "prti",
+ "nchar",
+ "deseret",
+ "decimalnumber",
+ "cprt",
+ "inlatin1supplement",
+ "imperialaramaic",
+ "privateuse",
+ "casedletter",
+ "lowercase",
+ "spaceseparator",
+ "radical",
+ "mong",
+ "canadianaboriginal",
+ "letternumber",
+ "insorasompeng",
+ "dash",
+ "wspace",
+ "ogam",
+ "invariationselectorssupplement",
+ "print",
+ "otheridcontinue",
+ "ingurmukhi",
+ "closepunctuation",
+ "olditalic",
+ "noncharactercodepoint",
+ "sharada",
+ "ingeometricshapes",
+ "otheralphabetic",
+ "patternwhitespace",
+ "po",
+ "rjng",
+ "ingreekandcoptic",
+ "xdigit",
+ "gothic",
+ "inoldsoutharabian",
+ "xidstart",
+ "inrejang",
+ "idsbinaryoperator",
+ "olower",
+ "hex",
+ "inenclosedideographicsupplement",
+ "inalphabeticpresentationforms",
+ "inbasiclatin",
+ "othersymbol",
+ "nd",
+ "sd",
+ "omath",
+ "separator",
+ "inarabic",
+ "xidcontinue",
+ "otheridstart",
+ "grext",
+ "otherlowercase",
+ "phli",
+ "cased",
+ "hang",
+ "xpeo",
+#endif /* USE_UNICODE_PROPERTIES */
+ "lower",
+#ifndef USE_UNICODE_PROPERTIES
+ "graph",
+#else /* USE_UNICODE_PROPERTIES */
+ "modifierletter",
+ "inphoneticextensions",
+ "inarabicpresentationformsa",
+ "innumberforms",
+ "oldpersian",
+ "incyrillicextendeda",
+ "inverticalforms",
+ "p",
+ "inbyzantinemusicalsymbols",
+ "inmathematicaloperators",
+ "intibetan",
+ "zp",
+ "ingeorgian",
+ "inbraillepatterns",
+ "lepcha",
+ "geor",
+ "invedicextensions",
+ "linb",
+ "other",
+ "deva",
+ "indevanagari",
+ "othernumber",
+ "bamum",
+ "shrd",
+ "bali",
+ "devanagari",
+ "extender",
+ "inherited",
+ "glagolitic",
+ "tibt",
+ "inbalinese",
+ "ingothic",
+ "inmiscellaneousmathematicalsymbolsb",
+ "limb",
+ "bengali",
+ "phoenician",
+ "insuperscriptsandsubscripts",
+ "inmeroitichieroglyphs",
+ "tibetan",
+ "inphoneticextensionssupplement",
+ "balinese",
+ "lowercaseletter",
+ "indingbats",
+ "inprivateusearea",
+ "assigned",
+ "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",
+ "sundanese",
+ "saurashtra",
+ "linearb",
+ "graphemebase",
+ "inunifiedcanadianaboriginalsyllabics",
+ "cuneiform",
+ "inkannada",
+ "kana",
+ "inancientgreeknumbers",
+ "incjkstrokes",
+ "inglagolitic",
+ "inancientgreekmusicalnotation",
+ "inchakma",
+ "plrd",
+ "inbrahmi",
+ "cakm",
+ "incjkcompatibilityforms",
+ "lisu",
+ "incjkcompatibilityideographs",
+ "intagalog",
+ "inkaithi",
+ "insupplementalarrowsa",
+ "takri",
+ "ideographic",
+ "hexdigit",
+ "glag",
+ "softdotted",
+ "variationselector",
+ "inkatakana",
+ "meeteimayek",
+ "otherpunctuation",
+ "inhanguljamo",
+ "kali",
+ "braille",
+ "incombininghalfmarks",
+ "talu",
+ "incjkcompatibilityideographssupplement",
+ "telu",
+ "idsb",
+ "tglg",
+ "inmeeteimayek",
+ "yi",
+ "phagspa",
+ "yiii",
+ "inarabicmathematicalalphabeticsymbols",
+ "saur",
+ "ogrext",
+ "bidic",
+ "inkanasupplement",
+ "runic",
+ "inalchemicalsymbols",
+ "georgian",
+ "inugaritic",
+ "insaurashtra",
+ "inhighprivateusesurrogates",
+ "pd",
+ "incountingrodnumerals",
+ "inarabicextendeda",
+ "inkharoshthi",
+ "idstrinaryoperator",
+ "phag",
+ "brah",
+ "mark",
+ "hebr",
+ "inkhmersymbols",
+ "dep",
+ "inkhmer",
+ "deprecated",
+ "rejang",
+ "lyci",
+ "intakri",
+ "takr",
+ "incyrillicsupplement",
+ "changeswhencasefolded",
+ "indevanagariextended",
+ "lycian",
+ "inbengali",
+ "beng",
+ "graph",
+ "inyijinghexagramsymbols",
+ "olck",
+ "inarabicsupplement",
+ "inbuginese",
+ "changeswhencasemapped",
+ "olchiki",
+ "inaegeannumbers",
+ "mlym",
+ "alphabetic",
+ "sylotinagri",
+ "changeswhentitlecased",
+ "tagalog",
+ "tagb",
+ "runr",
+ "malayalam",
+ "inoriya",
+ "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",
+ "inkatakanaphoneticextensions",
+ "hangul",
+ "incjksymbolsandpunctuation",
+ "bopo",
+ "orya",
+ "inbopomofo",
+ "kharoshthi",
+ "khar",
+ "changeswhenlowercased",
+ "khmr",
+ "punct",
+ "symbol",
+ "cherokee",
+ "cyrillic",
+ "inkangxiradicals",
+ "hebrew",
+ "inarabicpresentationformsb",
+ "incyrillicextendedb",
+ "ugaritic",
+ "incurrencysymbols",
+ "meroitichieroglyphs",
+ "inhighsurrogates",
+ "nonspacingmark",
+ "lydi",
+ "patsyn",
+ "orkh",
+ "lydian",
+ "ugar",
+ "othergraphemeextend",
+ "inlatinextendedb",
+ "bopomofo",
+ "khmer",
+ "uideo",
+ "otheruppercase",
+ "grek",
+ "gujr",
+ "gujarati",
+ "inhanguljamoextendedb",
+ "defaultignorablecodepoint",
+ "inplayingcards",
+ "bamu",
+ "inkanbun",
+ "incjkradicalssupplement",
+ "cypriot",
+ "inbamum",
+ "inmeroiticcursive",
+ "oldturkic",
+ "insupplementalarrowsb",
+ "surrogate",
+ "batk",
+ "inbatak",
+ "inlimbu",
+ "incypriotsyllabary",
+ "dashpunctuation",
+ "innoblock",
+ "hyphen",
+ "insupplementalpunctuation",
+ "ingeorgiansupplement",
+ "oupper",
+ "paragraphseparator",
+ "inbamumsupplement",
+ "uppercase",
+ "currencysymbol",
+ "sk",
+ "lu",
+ "openpunctuation",
+ "inlisu",
+ "qmark",
+ "egyp",
+ "insupplementaryprivateuseareab",
+ "limbu",
+ "inegyptianhieroglyphs",
+ "unifiedideograph",
+ "intelugu",
+ "katakana",
+ "inhangulcompatibilityjamo",
+ "upper",
+ "inkayahli",
+ "cwu",
+ "incjkcompatibility",
+ "uppercaseletter",
+ "bugi",
+ "buginese",
+ "any",
+ "inyisyllables",
+ "inbopomofoextended",
+ "inboxdrawing",
+ "changeswhenuppercased",
+ "unknown",
+ "quotationmark",
+ "buhd",
+ "punctuation",
+ "oldsoutharabian",
+ "kayahli",
+ "incjkunifiedideographs",
+ "incjkunifiedideographsextensiona",
+ "incjkunifiedideographsextensionc",
+ "telugu",
+ "guru",
+ "greek",
+ "grlink",
+ "buhid",
+ "batak",
+ "blank",
+ "incjkunifiedideographsextensiond",
+ "graphemelink",
+ "egyptianhieroglyphs",
+ "incjkunifiedideographsextensionb",
+ "zyyy",
+ "gurmukhi"
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+#define uniname2ctype_pool ((const char *) &uniname2ctype_pool_contents)
+#ifdef __GNUC__
+__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
+const struct uniname2ctype_struct *
+uniname2ctype_p (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const struct uniname2ctype_struct wordlist[] =
+ {
+#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},
+ {-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},
+ {-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},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str42, 14},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str44, 18},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str45, 128},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str49, 401},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str52, 377},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str62, 226},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str64, 31},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str66, 239},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str69, 30},
+ {-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},
+ {-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},
+ {-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},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str96, 252},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str151, 347},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str156, 306},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str158, 204},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str167, 356},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str172, 26},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str175, 152},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str179, 379},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str180, 276},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str184, 75},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str186, 75},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str187, 111},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str189, 13},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str199, 250},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str201, 272},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str202, 120},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str205, 23},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str207, 36},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str209, 52},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str216, 247},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str217, 88},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str218, 224},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str220, 314},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str223, 263},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str224, 385},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str225, 235},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str227, 148},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str247, 160},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str248, 323},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str252, 392},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str253, 78},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str254, 255},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str255, 155},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str256, 80},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str259, 260},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str261, 39},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str279, 431},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str281, 178},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str288, 3},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str301, 333},
+ {-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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str316, 287},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str349, 170},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str353, 109},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str357, 109},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str358, 299},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str359, 37},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str360, 50},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str364, 273},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str365, 251},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str367, 238},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str372, 21},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str375, 123},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str378, 182},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str386, 421},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str387, 258},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str389, 174},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str398, 295},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str400, 150},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str403, 365},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str405, 87},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str406, 189},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str409, 63},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str412, 74},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str414, 416},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str420, 93},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str425, 317},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str426, 99},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str427, 171},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str428, 169},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str429, 82},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str430, 162},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str432, 131},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str436, 28},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str445, 82},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str449, 185},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str450, 55},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str453, 70},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str454, 66},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str460, 27},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str468, 253},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str470, 151},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str474, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str475, 94},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str476, 188},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str478, 67},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str480, 45},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str481, 278},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str484, 43},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str485, 61},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str490, 42},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str495, 168},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str496, 346},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str497, 205},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str503, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str504, 39},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str506, 240},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str509, 341},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str524, 19},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str528, 383},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str531, 116},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str532, 9},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str542, 390},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str545, 281},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str555, 67},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str558, 425},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str560, 206},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str563, 396},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str564, 100},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str568, 325},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str572, 262},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str574, 153},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str575, 163},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str579, 315},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str587, 158},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str608, 153},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str612, 209},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str613, 141},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str614, 211},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str616, 280},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str617, 158},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str618, 123},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str619, 42},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str620, 1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str621, 218},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str622, 269},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str623, 219},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str646, 131},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str647, 374},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str648, 187},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str649, 438},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str650, 220},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str651, 212},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str653, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str654, 215},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str655, 386},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str660, 186},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str668, 245},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str672, 18},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str679, 188},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str709, 68},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str713, 116},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str715, 404},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str721, 69},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str725, 66},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str729, 394},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str730, 370},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str734, 128},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str737, 60},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str738, 162},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str739, 192},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str746, 113},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str747, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str748, 125},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str750, 223},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str771, 160},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str776, 21},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str777, 24},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str778, 57},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str780, 54},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str784, 196},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str787, 105},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str788, 101},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str792, 36},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str796, 408},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str797, 179},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str798, 176},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str799, 102},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str818, 41},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str823, 111},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str824, 192},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str826, 173},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str827, 303},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str830, 186},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str831, 206},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str832, 44},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str833, 146},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str835, 229},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str841, 11},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str850, 112},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str851, 400},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str852, 68},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str854, 352},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str869, 184},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str870, 429},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str874, 368},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str879, 222},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str884, 50},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str889, 35},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str890, 200},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str900, 183},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str901, 51},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str907, 234},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str912, 69},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str913, 202},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str914, 71},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str917, 190},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str933, 6},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str936, 26},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str938, 284},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str939, 369},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str943, 294},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str945, 133},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str946, 319},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str947, 371},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str949, 38},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str950, 418},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str951, 296},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str952, 254},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str953, 53},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-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},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str981, 83},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str983, 189},
+ {-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},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1000, 84},
+ {-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},
+ {-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},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1021, 25},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1031, 305},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1035, 366},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1039, 16},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1044, 207},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1051, 361},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1065, 161},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1067, 126},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1069, 311},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1070, 137},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1072, 288},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1074, 27},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1076, 80},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1078, 345},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1081, 12},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1084, 348},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1087, 302},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1092, 99},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1094, 359},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1107, 167},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1110, 201},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1114, 389},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1129, 293},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1133, 174},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1135, 106},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1142, 353},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1147, 183},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1150, 4},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1151, 112},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1156, 102},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1162, 140},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1170, 144},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1188, 249},
+ {-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},
+ {-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},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1261, 200},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1262, 205},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1264, 326},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1265, 159},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1274, 44},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1279, 257},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1282, 145},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1289, 126},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1298, 372},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1300, 129},
+ {-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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1310, 115},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1313, 360},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1315, 110},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1318, 138},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1321, 110},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1323, 424},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1328, 144},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1330, 193},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1334, 177},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1341, 417},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1343, 103},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1344, 433},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1350, 97},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1351, 388},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1354, 349},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1356, 364},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1362, 40},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1372, 422},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1377, 241},
+ {-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},
+ {-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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1404, 79},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1411, 274},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1413, 199},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1416, 268},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1422, 199},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1424, 146},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1429, 147},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1431, 411},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1432, 175},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1435, 231},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1436, 64},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1438, 350},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1442, 147},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1443, 243},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1448, 84},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1450, 5},
+ {-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},
+ {-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},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1468, 142},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1478, 380},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1479, 91},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1480, 56},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1519, 139},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1520, 139},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1523, 318},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1525, 165},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1530, 49},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1531, 339},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1536, 440},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1540, 124},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1546, 81},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1548, 198},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1561, 34},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1565, 378},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1566, 165},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1567, 140},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1569, 96},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1571, 228},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1578, 32},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1581, 292},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1598, 96},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1605, 71},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1606, 177},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1609, 376},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1617, 77},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1620, 90},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1634, 270},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1635, 136},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1636, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1643, 286},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1645, 265},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1676, 98},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1683, 324},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1688, 108},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1703, 134},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1709, 61},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1724, 104},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1725, 8},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1729, 46},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1732, 100},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1737, 77},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-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}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1780, 375},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1787, 342},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1790, 122},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1829, 291},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1831, 171},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1835, 363},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1853, 33},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1917, 104},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1925, 197},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1932, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1944, 76},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1949, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1970, 86},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1983, 362},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str1988, 70},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2005, 427},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2022, 157},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2028, 329},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2033, 321},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2046, 125},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2051, 343},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2053, 398},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2055, 164},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2086, 309},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2087, 22},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2094, 166},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2102, 279},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2119, 271},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2123, 393},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2129, 40},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2130, 442},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2141, 180},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2162, 320},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2165, 316},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2178, 191},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2189, 53},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2194, 415},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2299, 58},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2313, 47},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2322, 48},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2338, 29},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2342, 45},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2349, 340},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2371, 181},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2372, 154},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2377, 441},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2379, 119},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2400, 414},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2401, 197},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2413, 248},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2454, 10},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2542, 29},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2549, 127},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2588, 127},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2627, 15},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2651, 338},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2671, 330},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2710, 301},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2724, 62},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2727, 208},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2737, 181},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2753, 117},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2785, 38},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2961, 335},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2962, 435},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str2995, 89},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3000, 85},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3104, 76},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3189, 73},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3197, 117},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3254, 166},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str3292, 2},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-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},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-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}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {-1},
+ {(int)(long)&((struct uniname2ctype_pool_t *)0)->uniname2ctype_pool_str4167, 85}
+#endif /* USE_UNICODE_PROPERTIES */
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = uniname2ctype_hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register int o = wordlist[key].name;
+ if (o >= 0)
+ {
+ register const char *s = o + uniname2ctype_pool;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &wordlist[key];
+ }
+ }
+ }
+ return 0;
+}
+
+static int
+uniname2ctype(const UChar *name, unsigned int len)
+{
+ const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len);
+ if (p) return p->ctype;
+ return -1;
+}
diff --git a/enc/unicode/name2ctype.kwd b/enc/unicode/name2ctype.kwd
new file mode 100644
index 0000000000..ff94d68b3b
--- /dev/null
+++ b/enc/unicode/name2ctype.kwd
@@ -0,0 +1,26550 @@
+%{
+#define long size_t
+
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 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xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x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x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32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5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x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, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d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 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+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683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800,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10107, 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,
+ 0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e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 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+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x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0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,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f37,
+ 0x0f39, 0x0f39,
+ 0x0f3e, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f84,
+ 0x0f86, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fc6, 0x0fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60,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
+ 0xaaf2, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xabec, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514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6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_Word */
+
+/* 'Alnum': [[:Alnum:]] */
+static const OnigCodePoint CR_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093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, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1be5,
+ 0x1be7, 0x1bf1,
+ 0x1c00, 0x1c35,
+ 0x1c40, 0x1c49,
+ 0x1c4d, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+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xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11132,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b5,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
+#ifdef USE_UNICODE_PROPERTIES
+/* 'Any': - */
+static const OnigCodePoint CR_Any[] = {
+ 1,
+ 0x0000, 0x10ffff,
+}; /* CR_Any */
+
+/* 'Assigned': - */
+static const OnigCodePoint CR_Assigned[] = {
+ 539,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 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ffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
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, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Assigned */
+
+/* 'C': Major Category */
+static const OnigCodePoint CR_C[] = {
+ 541,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+ 0x00ad, 0x00ad,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x0605,
+ 0x061c, 0x061d,
+ 0x06dd, 0x06dd,
+ 0x070e, 0x070f,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+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 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aff,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
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110bd, 0x110bd,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d173, 0x1d17a,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+ 0x1d7cc, 0x1d7cd,
+ 0x1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 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_C */
+
+/* 'Cc': General Category */
+#define CR_Cc CR_Cntrl
+
+/* 'Cf': General Category */
+static const OnigCodePoint CR_Cf[] = {
+ 14,
+ 0x00ad, 0x00ad,
+ 0x0600, 0x0604,
+ 0x06dd, 0x06dd,
+ 0x070f, 0x070f,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x2064,
+ 0x206a, 0x206f,
+ 0xfeff, 0xfeff,
+ 0xfff9, 0xfffb,
+ 0x110bd, 0x110bd,
+ 0x1d173, 0x1d17a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Cf */
+
+/* 'Cn': General Category */
+static const OnigCodePoint CR_Cn[] = {
+ 539,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x0605, 0x0605,
+ 0x061c, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07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004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,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*/
+static const OnigCodePoint CR_Co[] = {
+ 3,
+ 0xe000, 0xf8ff,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Co */
+
+/* 'Cs': General Category */
+static const OnigCodePoint CR_Cs[] = {
+ 1,
+ 0xd800, 0xdfff,
+}; /* CR_Cs */
+
+/* 'L': Major Category */
+static const OnigCodePoint CR_L[] = {
+ 486,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+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 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+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1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
+/* 'Ll': General Category */
+static const OnigCodePoint CR_Ll[] = {
+ 611,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02af,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04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0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa771, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7fa, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Ll */
+
+/* 'Lm': General Category */
+static const OnigCodePoint CR_Lm[] = {
+ 52,
+ 0x02b0, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0374, 0x0374,
+ 0x037a, 0x037a,
+ 0x0559, 0x0559,
+ 0x0640, 0x0640,
+ 0x06e5, 0x06e6,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0971, 0x0971,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x10fc, 0x10fc,
+ 0x17d7, 0x17d7,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c78, 0x1c7d,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2c7c, 0x2c7d,
+ 0x2d6f, 0x2d6f,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x303b, 0x303b,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa4f8, 0xa4fd,
+ 0xa60c, 0xa60c,
+ 0xa67f, 0xa67f,
+ 0xa717, 0xa71f,
+ 0xa770, 0xa770,
+ 0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
+}; /* CR_Lm */
+
+/* 'Lo': General Category */
+static const OnigCodePoint CR_Lo[] = {
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x01bb, 0x01bb,
+ 0x01c0, 0x01c3,
+ 0x0294, 0x0294,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x063f,
+ 0x0641, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x0800, 0x0815,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0972, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0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a0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10450, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Lo */
+
+/* 'Lt': General Category */
+static const OnigCodePoint CR_Lt[] = {
+ 10,
+ 0x01c5, 0x01c5,
+ 0x01c8, 0x01c8,
+ 0x01cb, 0x01cb,
+ 0x01f2, 0x01f2,
+ 0x1f88, 0x1f8f,
+ 0x1f98, 0x1f9f,
+ 0x1fa8, 0x1faf,
+ 0x1fbc, 0x1fbc,
+ 0x1fcc, 0x1fcc,
+ 0x1ffc, 0x1ffc,
+}; /* CR_Lt */
+
+/* 'Lu': General Category */
+static const OnigCodePoint CR_Lu[] = {
+ 608,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 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a662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Lu */
+
+/* 'M': Major Category */
+static const OnigCodePoint CR_M[] = {
+ 204,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06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+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabe4,
+ 0xabe6, 0xabe7,
+ 0xabe9, 0xabea,
+ 0xabec, 0xabec,
+ 0x11000, 0x11000,
+ 0x11002, 0x11002,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
+ 0x1d165, 0x1d166,
+ 0x1d16d, 0x1d172,
+}; /* CR_Mc */
+
+/* 'Me': General Category */
+static const OnigCodePoint CR_Me[] = {
+ 4,
+ 0x0488, 0x0489,
+ 0x20dd, 0x20e0,
+ 0x20e2, 0x20e4,
+ 0xa670, 0xa672,
+}; /* CR_Me */
+
+/* 'Mn': General Category */
+static const OnigCodePoint CR_Mn[] = {
+ 220,
+ 0x0300, 0x036f,
+ 0x0483, 0x0487,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc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0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Mn */
+
+/* 'N': Major Category */
+static const OnigCodePoint CR_N[] = {
+ 88,
+ 0x0030, 0x0039,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x09f4, 0x09f9,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0b72, 0x0b77,
+ 0x0be6, 0x0bf2,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7e,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d75,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f33,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x1369, 0x137c,
+ 0x16ee, 0x16f0,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19da,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x2182,
+ 0x2185, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa620, 0xa629,
+ 0xa6e6, 0xa6ef,
+ 0xa830, 0xa835,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x10107, 0x10133,
+ 0x10140, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x104a0, 0x104a9,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x12400, 0x12462,
+ 0x1d360, 0x1d371,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f100, 0x1f10a,
+}; /* CR_N */
+
+/* 'Nd': General Category */
+#define CR_Nd CR_Digit
+
+/* 'Nl': General Category */
+static const OnigCodePoint CR_Nl[] = {
+ 12,
+ 0x16ee, 0x16f0,
+ 0x2160, 0x2182,
+ 0x2185, 0x2188,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0xa6e6, 0xa6ef,
+ 0x10140, 0x10174,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x12400, 0x12462,
+}; /* CR_Nl */
+
+/* 'No': General Category */
+static const OnigCodePoint CR_No[] = {
+ 42,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x09f4, 0x09f9,
+ 0x0b72, 0x0b77,
+ 0x0bf0, 0x0bf2,
+ 0x0c78, 0x0c7e,
+ 0x0d70, 0x0d75,
+ 0x0f2a, 0x0f33,
+ 0x1369, 0x137c,
+ 0x17f0, 0x17f9,
+ 0x19da, 0x19da,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x215f,
+ 0x2189, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa830, 0xa835,
+ 0x10107, 0x10133,
+ 0x10175, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x11065,
+ 0x1d360, 0x1d371,
+ 0x1f100, 0x1f10a,
+}; /* CR_No */
+
+/* 'P': Major Category */
+#define CR_P CR_Punct
+
+/* 'Pc': General Category */
+static const OnigCodePoint CR_Pc[] = {
+ 6,
+ 0x005f, 0x005f,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xff3f, 0xff3f,
+}; /* CR_Pc */
+
+/* 'Pd': General Category */
+static const OnigCodePoint CR_Pd[] = {
+ 16,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Pd */
+
+/* 'Pe': General Category */
+static const OnigCodePoint CR_Pe[] = {
+ 70,
+ 0x0029, 0x0029,
+ 0x005d, 0x005d,
+ 0x007d, 0x007d,
+ 0x0f3b, 0x0f3b,
+ 0x0f3d, 0x0f3d,
+ 0x169c, 0x169c,
+ 0x2046, 0x2046,
+ 0x207e, 0x207e,
+ 0x208e, 0x208e,
+ 0x232a, 0x232a,
+ 0x2769, 0x2769,
+ 0x276b, 0x276b,
+ 0x276d, 0x276d,
+ 0x276f, 0x276f,
+ 0x2771, 0x2771,
+ 0x2773, 0x2773,
+ 0x2775, 0x2775,
+ 0x27c6, 0x27c6,
+ 0x27e7, 0x27e7,
+ 0x27e9, 0x27e9,
+ 0x27eb, 0x27eb,
+ 0x27ed, 0x27ed,
+ 0x27ef, 0x27ef,
+ 0x2984, 0x2984,
+ 0x2986, 0x2986,
+ 0x2988, 0x2988,
+ 0x298a, 0x298a,
+ 0x298c, 0x298c,
+ 0x298e, 0x298e,
+ 0x2990, 0x2990,
+ 0x2992, 0x2992,
+ 0x2994, 0x2994,
+ 0x2996, 0x2996,
+ 0x2998, 0x2998,
+ 0x29d9, 0x29d9,
+ 0x29db, 0x29db,
+ 0x29fd, 0x29fd,
+ 0x2e23, 0x2e23,
+ 0x2e25, 0x2e25,
+ 0x2e27, 0x2e27,
+ 0x2e29, 0x2e29,
+ 0x3009, 0x3009,
+ 0x300b, 0x300b,
+ 0x300d, 0x300d,
+ 0x300f, 0x300f,
+ 0x3011, 0x3011,
+ 0x3015, 0x3015,
+ 0x3017, 0x3017,
+ 0x3019, 0x3019,
+ 0x301b, 0x301b,
+ 0x301e, 0x301f,
+ 0xfd3f, 0xfd3f,
+ 0xfe18, 0xfe18,
+ 0xfe36, 0xfe36,
+ 0xfe38, 0xfe38,
+ 0xfe3a, 0xfe3a,
+ 0xfe3c, 0xfe3c,
+ 0xfe3e, 0xfe3e,
+ 0xfe40, 0xfe40,
+ 0xfe42, 0xfe42,
+ 0xfe44, 0xfe44,
+ 0xfe48, 0xfe48,
+ 0xfe5a, 0xfe5a,
+ 0xfe5c, 0xfe5c,
+ 0xfe5e, 0xfe5e,
+ 0xff09, 0xff09,
+ 0xff3d, 0xff3d,
+ 0xff5d, 0xff5d,
+ 0xff60, 0xff60,
+ 0xff63, 0xff63,
+}; /* CR_Pe */
+
+/* 'Pf': General Category */
+static const OnigCodePoint CR_Pf[] = {
+ 10,
+ 0x00bb, 0x00bb,
+ 0x2019, 0x2019,
+ 0x201d, 0x201d,
+ 0x203a, 0x203a,
+ 0x2e03, 0x2e03,
+ 0x2e05, 0x2e05,
+ 0x2e0a, 0x2e0a,
+ 0x2e0d, 0x2e0d,
+ 0x2e1d, 0x2e1d,
+ 0x2e21, 0x2e21,
+}; /* CR_Pf */
+
+/* 'Pi': General Category */
+static const OnigCodePoint CR_Pi[] = {
+ 11,
+ 0x00ab, 0x00ab,
+ 0x2018, 0x2018,
+ 0x201b, 0x201c,
+ 0x201f, 0x201f,
+ 0x2039, 0x2039,
+ 0x2e02, 0x2e02,
+ 0x2e04, 0x2e04,
+ 0x2e09, 0x2e09,
+ 0x2e0c, 0x2e0c,
+ 0x2e1c, 0x2e1c,
+ 0x2e20, 0x2e20,
+}; /* CR_Pi */
+
+/* 'Po': General Category */
+static const OnigCodePoint CR_Po[] = {
+ 135,
+ 0x0021, 0x0023,
+ 0x0025, 0x0027,
+ 0x002a, 0x002a,
+ 0x002c, 0x002c,
+ 0x002e, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005c, 0x005c,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0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 0x2e1b, 0x2e1b,
+ 0x2e1e, 0x2e1f,
+ 0x2e2a, 0x2e2e,
+ 0x2e30, 0x2e39,
+ 0x3001, 0x3003,
+ 0x303d, 0x303d,
+ 0x30fb, 0x30fb,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe10, 0xfe16,
+ 0xfe19, 0xfe19,
+ 0xfe30, 0xfe30,
+ 0xfe45, 0xfe46,
+ 0xfe49, 0xfe4c,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xfe5f, 0xfe61,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff07,
+ 0xff0a, 0xff0a,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3c, 0xff3c,
+ 0xff61, 0xff61,
+ 0xff64, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Po */
+
+/* 'Ps': General Category */
+static const OnigCodePoint CR_Ps[] = {
+ 72,
+ 0x0028, 0x0028,
+ 0x005b, 0x005b,
+ 0x007b, 0x007b,
+ 0x0f3a, 0x0f3a,
+ 0x0f3c, 0x0f3c,
+ 0x169b, 0x169b,
+ 0x201a, 0x201a,
+ 0x201e, 0x201e,
+ 0x2045, 0x2045,
+ 0x207d, 0x207d,
+ 0x208d, 0x208d,
+ 0x2329, 0x2329,
+ 0x2768, 0x2768,
+ 0x276a, 0x276a,
+ 0x276c, 0x276c,
+ 0x276e, 0x276e,
+ 0x2770, 0x2770,
+ 0x2772, 0x2772,
+ 0x2774, 0x2774,
+ 0x27c5, 0x27c5,
+ 0x27e6, 0x27e6,
+ 0x27e8, 0x27e8,
+ 0x27ea, 0x27ea,
+ 0x27ec, 0x27ec,
+ 0x27ee, 0x27ee,
+ 0x2983, 0x2983,
+ 0x2985, 0x2985,
+ 0x2987, 0x2987,
+ 0x2989, 0x2989,
+ 0x298b, 0x298b,
+ 0x298d, 0x298d,
+ 0x298f, 0x298f,
+ 0x2991, 0x2991,
+ 0x2993, 0x2993,
+ 0x2995, 0x2995,
+ 0x2997, 0x2997,
+ 0x29d8, 0x29d8,
+ 0x29da, 0x29da,
+ 0x29fc, 0x29fc,
+ 0x2e22, 0x2e22,
+ 0x2e24, 0x2e24,
+ 0x2e26, 0x2e26,
+ 0x2e28, 0x2e28,
+ 0x3008, 0x3008,
+ 0x300a, 0x300a,
+ 0x300c, 0x300c,
+ 0x300e, 0x300e,
+ 0x3010, 0x3010,
+ 0x3014, 0x3014,
+ 0x3016, 0x3016,
+ 0x3018, 0x3018,
+ 0x301a, 0x301a,
+ 0x301d, 0x301d,
+ 0xfd3e, 0xfd3e,
+ 0xfe17, 0xfe17,
+ 0xfe35, 0xfe35,
+ 0xfe37, 0xfe37,
+ 0xfe39, 0xfe39,
+ 0xfe3b, 0xfe3b,
+ 0xfe3d, 0xfe3d,
+ 0xfe3f, 0xfe3f,
+ 0xfe41, 0xfe41,
+ 0xfe43, 0xfe43,
+ 0xfe47, 0xfe47,
+ 0xfe59, 0xfe59,
+ 0xfe5b, 0xfe5b,
+ 0xfe5d, 0xfe5d,
+ 0xff08, 0xff08,
+ 0xff3b, 0xff3b,
+ 0xff5b, 0xff5b,
+ 0xff5f, 0xff5f,
+ 0xff62, 0xff62,
+}; /* CR_Ps */
+
+/* 'S': Major Category */
+static const OnigCodePoint CR_S[] = {
+ 198,
+ 0x0024, 0x0024,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
+ 0x00ac, 0x00ac,
+ 0x00ae, 0x00b1,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x03f6, 0x03f6,
+ 0x0482, 0x0482,
+ 0x058f, 0x058f,
+ 0x0606, 0x0608,
+ 0x060b, 0x060b,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09f2, 0x09f3,
+ 0x09fa, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 0x0bfa,
+ 0x0c7f, 0x0c7f,
+ 0x0d79, 0x0d79,
+ 0x0e3f, 0x0e3f,
+ 0x0f01, 0x0f03,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
+ 0x0f1a, 0x0f1f,
+ 0x0f34, 0x0f34,
+ 0x0f36, 0x0f36,
+ 0x0f38, 0x0f38,
+ 0x0fbe, 0x0fc5,
+ 0x0fc7, 0x0fcc,
+ 0x0fce, 0x0fcf,
+ 0x0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x17db, 0x17db,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x20a0, 0x20b9,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2118,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x2140, 0x2144,
+ 0x214a, 0x214d,
+ 0x214f, 0x214f,
+ 0x2190, 0x2328,
+ 0x232b, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x26ff,
+ 0x2701, 0x2767,
+ 0x2794, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x2982,
+ 0x2999, 0x29d7,
+ 0x29dc, 0x29fb,
+ 0x29fe, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x309b, 0x309c,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,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0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 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,
+}; /* CR_S */
+
+/* 'Sc': General Category */
+static const OnigCodePoint CR_Sc[] = {
+ 17,
+ 0x0024, 0x0024,
+ 0x00a2, 0x00a5,
+ 0x058f, 0x058f,
+ 0x060b, 0x060b,
+ 0x09f2, 0x09f3,
+ 0x09fb, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0bf9, 0x0bf9,
+ 0x0e3f, 0x0e3f,
+ 0x17db, 0x17db,
+ 0x20a0, 0x20b9,
+ 0xa838, 0xa838,
+ 0xfdfc, 0xfdfc,
+ 0xfe69, 0xfe69,
+ 0xff04, 0xff04,
+ 0xffe0, 0xffe1,
+ 0xffe5, 0xffe6,
+}; /* CR_Sc */
+
+/* 'Sk': General Category */
+static const OnigCodePoint CR_Sk[] = {
+ 27,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x309b, 0x309c,
+ 0xa700, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,
+ 0xfbb2, 0xfbc1,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xffe3, 0xffe3,
+}; /* CR_Sk */
+
+/* 'Sm': General Category */
+static const OnigCodePoint CR_Sm[] = {
+ 65,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03f6, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x2118, 0x2118,
+ 0x2140, 0x2144,
+ 0x214b, 0x214b,
+ 0x2190, 0x2194,
+ 0x219a, 0x219b,
+ 0x21a0, 0x21a0,
+ 0x21a3, 0x21a3,
+ 0x21a6, 0x21a6,
+ 0x21ae, 0x21ae,
+ 0x21ce, 0x21cf,
+ 0x21d2, 0x21d2,
+ 0x21d4, 0x21d4,
+ 0x21f4, 0x22ff,
+ 0x2308, 0x230b,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b3,
+ 0x23dc, 0x23e1,
+ 0x25b7, 0x25b7,
+ 0x25c1, 0x25c1,
+ 0x25f8, 0x25ff,
+ 0x266f, 0x266f,
+ 0x27c0, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x27ff,
+ 0x2900, 0x2982,
+ 0x2999, 0x29d7,
+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1b6a,
+ 0x1b74, 0x1b7c,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2117,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x214a, 0x214a,
+ 0x214c, 0x214d,
+ 0x214f, 0x214f,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21ad,
+ 0x21af, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21f3,
+ 0x2300, 0x2307,
+ 0x230c, 0x231f,
+ 0x2322, 0x2328,
+ 0x232b, 0x237b,
+ 0x237d, 0x239a,
+ 0x23b4, 0x23db,
+ 0x23e2, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x25b6,
+ 0x25b8, 0x25c0,
+ 0x25c2, 0x25f7,
+ 0x2600, 0x266e,
+ 0x2670, 0x26ff,
+ 0x2701, 0x2767,
+ 0x2794, 0x27bf,
+ 0x2800, 0x28ff,
+ 0x2b00, 0x2b2f,
+ 0x2b45, 0x2b46,
+ 0x2b50, 0x2b59,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+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So */
+
+/* 'Z': Major Category */
+static const OnigCodePoint CR_Z[] = {
+ 9,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Z */
+
+/* 'Zl': General Category */
+static const OnigCodePoint CR_Zl[] = {
+ 1,
+ 0x2028, 0x2028,
+}; /* CR_Zl */
+
+/* 'Zp': General Category */
+static const OnigCodePoint CR_Zp[] = {
+ 1,
+ 0x2029, 0x2029,
+}; /* CR_Zp */
+
+/* 'Zs': General Category */
+static const OnigCodePoint CR_Zs[] = {
+ 8,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Zs */
+
+/* 'Math': Derived Property */
+static const OnigCodePoint CR_Math[] = {
+ 138,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x2061, 0x2064,
+ 0x207a, 0x207e,
+ 0x208a, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 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ase': Derived Property */
+#define CR_Uppercase CR_Upper
+
+/* 'Cased': Derived Property */
+static const OnigCodePoint CR_Cased[] = {
+ 119,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1dbf,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,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x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_Cased */
+
+/* 'Case_Ignorable': Derived Property */
+static const OnigCodePoint CR_Case_Ignorable[] = {
+ 295,
+ 0x0027, 0x0027,
+ 0x002e, 0x002e,
+ 0x003a, 0x003a,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00ad, 0x00ad,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0387, 0x0387,
+ 0x0483, 0x0489,
+ 0x0559, 0x0559,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05f4, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0610, 0x061a,
+ 0x0640, 0x0640,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dd,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x070f, 0x070f,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0816, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0971, 0x0971,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc,
+ 0x09c1, 0x09c4,
+ 0x09cd, 0x09cd,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a02,
+ 0x0a3c, 0x0a3c,
+ 0x0a41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, 0xaa4c,
+ 0xaa70, 0xaa70,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaadd, 0xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfbb2, 0xfbc1,
+ 0xfe00, 0xfe0f,
+ 0xfe13, 0xfe13,
+ 0xfe20, 0xfe26,
+ 0xfe52, 0xfe52,
+ 0xfe55, 0xfe55,
+ 0xfeff, 0xfeff,
+ 0xff07, 0xff07,
+ 0xff0e, 0xff0e,
+ 0xff1a, 0xff1a,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe3, 0xffe3,
+ 0xfff9, 0xfffb,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
+ 0x1d167, 0x1d169,
+ 0x1d173, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Case_Ignorable */
+
+/* 'Changes_When_Lowercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Lowercased[] = {
+ 571,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+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+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Lowercased */
+
+/* 'Changes_When_Uppercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Uppercased[] = {
+ 586,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c5, 0x01c6,
+ 0x01c8, 0x01c9,
+ 0x01cb, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f2, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04c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+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Uppercased */
+
+/* 'Changes_When_Titlecased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Titlecased[] = {
+ 587,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x01c4,
+ 0x01c6, 0x01c7,
+ 0x01c9, 0x01ca,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f1,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
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 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Titlecased */
+
+/* 'Changes_When_Casefolded': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casefolded[] = {
+ 582,
+ 0x0041, 0x005a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00df,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x0149, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x017f, 0x017f,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0345, 0x0345,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03c2, 0x03c2,
+ 0x03cf, 0x03d1,
+ 0x03d5, 0x03d6,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 0x0531, 0x0556,
+ 0x0587, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+ 0x1e04, 0x1e04,
+ 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08,
+ 0x1e0a, 0x1e0a,
+ 0x1e0c, 0x1e0c,
+ 0x1e0e, 0x1e0e,
+ 0x1e10, 0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 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Casefolded */
+
+/* 'Changes_When_Casemapped': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casemapped[] = {
+ 104,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x0137,
+ 0x0139, 0x018c,
+ 0x018e, 0x019a,
+ 0x019c, 0x01a9,
+ 0x01ac, 0x01b9,
+ 0x01bc, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x0220,
+ 0x0222, 0x0233,
+ 0x023a, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03d1,
+ 0x03d5, 0x03f2,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03fb,
+ 0x03fd, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d79, 0x1d79,
+ 0x1d7d, 0x1d7d,
+ 0x1e00, 0x1e9b,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2126, 0x2126,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x217f,
+ 0x2183, 0x2184,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c70,
+ 0x2c72, 0x2c73,
+ 0x2c75, 0x2c76,
+ 0x2c7e, 0x2ce3,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa72f,
+ 0xa732, 0xa76f,
+ 0xa779, 0xa787,
+ 0xa78b, 0xa78d,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+}; /* CR_Changes_When_Casemapped */
+
+/* 'ID_Start': Derived Property */
+static const OnigCodePoint CR_ID_Start[] = {
+ 488,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35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1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1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 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_ID_Start */
+
+/* 'ID_Continue': Derived Property */
+static const OnigCodePoint CR_ID_Continue[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0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 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9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 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_ID_Continue */
+
+/* 'XID_Start': Derived Property */
+static const OnigCodePoint CR_XID_Start[] = {
+ 495,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+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
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x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, 0x2fa1d,
+}; /* CR_XID_Start */
+
+/* 'XID_Continue': Derived Property */
+static const OnigCodePoint CR_XID_Continue[] = {
+ 571,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+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 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe71, 0xfe71,
+ 0xfe73, 0xfe73,
+ 0xfe77, 0xfe77,
+ 0xfe79, 0xfe79,
+ 0xfe7b, 0xfe7b,
+ 0xfe7d, 0xfe7d,
+ 0xfe7f, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_XID_Continue */
+
+/* 'Default_Ignorable_Code_Point': Derived Property */
+static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
+ 15,
+ 0x00ad, 0x00ad,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x180b, 0x180d,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x206f,
+ 0x3164, 0x3164,
+ 0xfe00, 0xfe0f,
+ 0xfeff, 0xfeff,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0x1d173, 0x1d17a,
+ 0xe0000, 0xe0fff,
+}; /* CR_Default_Ignorable_Code_Point */
+
+/* 'Grapheme_Extend': Derived Property */
+static const OnigCodePoint CR_Grapheme_Extend[] = {
+ 232,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09be,
+ 0x09c1, 0x09c4,
+ 0x09cd, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a02,
+ 0x0a3c, 0x0a3c,
+ 0x0a41, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a82,
+ 0x0abc, 0x0abc,
+ 0x0ac1, 0x0ac5,
+ 0x0ac7, 0x0ac8,
+ 0x0acd, 0x0acd,
+ 0x0ae2, 0x0ae3,
+ 0x0b01, 0x0b01,
+ 0x0b3c, 0x0b3c,
+ 0x0b3e, 0x0b3f,
+ 0x0b41, 0x0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, 0xa80b,
+ 0xa825, 0xa826,
+ 0xa8c4, 0xa8c4,
+ 0xa8e0, 0xa8f1,
+ 0xa926, 0xa92d,
+ 0xa947, 0xa951,
+ 0xa980, 0xa982,
+ 0xa9b3, 0xa9b3,
+ 0xa9b6, 0xa9b9,
+ 0xa9bc, 0xa9bc,
+ 0xaa29, 0xaa2e,
+ 0xaa31, 0xaa32,
+ 0xaa35, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4c,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xff9e, 0xff9f,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d165, 0x1d165,
+ 0x1d167, 0x1d169,
+ 0x1d16e, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Grapheme_Extend */
+
+/* 'Grapheme_Base': Derived Property */
+static const OnigCodePoint CR_Grapheme_Base[] = {
+ 643,
+ 0x0020, 0x007e,
+ 0x00a0, 0x00ac,
+ 0x00ae, 0x02ff,
+ 0x0370, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0482,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0606, 0x060f,
+ 0x061b, 0x061b,
+ 0x061e, 0x064a,
+ 0x0660, 0x066f,
+ 0x0671, 0x06d5,
+ 0x06de, 0x06de,
+ 0x06e5, 0x06e6,
+ 0x06e9, 0x06e9,
+ 0x06ee, 0x070d,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0830, 0x083e,
+ 0x0840, 0x0858,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0903, 0x0939,
+ 0x093b, 0x093b,
+ 0x093d, 0x0940,
+ 0x0949, 0x094c,
+ 0x094e, 0x0950,
+ 0x0958, 0x0961,
+ 0x0964, 0x0977,
+ 0x0979, 0x097f,
+ 0x0982, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09bf, 0x09c0,
+ 0x09c7, 0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x1034a,
+ 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, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a40, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x11000,
+ 0x11002, 0x11037,
+ 0x11047, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11082, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0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1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Grapheme_Base */
+
+/* 'Grapheme_Link': Derived Property */
+static const OnigCodePoint CR_Grapheme_Link[] = {
+ 33,
+ 0x094d, 0x094d,
+ 0x09cd, 0x09cd,
+ 0x0a4d, 0x0a4d,
+ 0x0acd, 0x0acd,
+ 0x0b4d, 0x0b4d,
+ 0x0bcd, 0x0bcd,
+ 0x0c4d, 0x0c4d,
+ 0x0ccd, 0x0ccd,
+ 0x0d4d, 0x0d4d,
+ 0x0dca, 0x0dca,
+ 0x0e3a, 0x0e3a,
+ 0x0f84, 0x0f84,
+ 0x1039, 0x103a,
+ 0x1714, 0x1714,
+ 0x1734, 0x1734,
+ 0x17d2, 0x17d2,
+ 0x1a60, 0x1a60,
+ 0x1b44, 0x1b44,
+ 0x1baa, 0x1bab,
+ 0x1bf2, 0x1bf3,
+ 0x2d7f, 0x2d7f,
+ 0xa806, 0xa806,
+ 0xa8c4, 0xa8c4,
+ 0xa953, 0xa953,
+ 0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
+ 0xabed, 0xabed,
+ 0x10a3f, 0x10a3f,
+ 0x11046, 0x11046,
+ 0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
+}; /* CR_Grapheme_Link */
+
+/* 'Common': Script */
+static const OnigCodePoint CR_Common[] = {
+ 157,
+ 0x0000, 0x0040,
+ 0x005b, 0x0060,
+ 0x007b, 0x00a9,
+ 0x00ab, 0x00b9,
+ 0x00bb, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02b9, 0x02df,
+ 0x02e5, 0x02e9,
+ 0x02ec, 0x02ff,
+ 0x0374, 0x0374,
+ 0x037e, 0x037e,
+ 0x0385, 0x0385,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0640, 0x0640,
+ 0x0660, 0x0669,
+ 0x06dd, 0x06dd,
+ 0x0964, 0x0965,
+ 0x0e3f, 0x0e3f,
+ 0x0fd5, 0x0fd8,
+ 0x10fb, 0x10fb,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x1802, 0x1803,
+ 0x1805, 0x1805,
+ 0x1cd3, 0x1cd3,
+ 0x1ce1, 0x1ce1,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x2000, 0x200b,
+ 0x200e, 0x2064,
+ 0x206a, 0x2070,
+ 0x2074, 0x207e,
+ 0x2080, 0x208e,
+ 0x20a0, 0x20b9,
+ 0x2100, 0x2125,
+ 0x2127, 0x2129,
+ 0x212c, 0x2131,
+ 0x2133, 0x214d,
+ 0x214f, 0x215f,
+ 0x2189, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x27ff,
+ 0x2900, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2e00, 0x2e3b,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x3004,
+ 0x3006, 0x3006,
+ 0x3008, 0x3020,
+ 0x3030, 0x3037,
+ 0x303c, 0x303f,
+ 0x309b, 0x309c,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fc,
+ 0x3190, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3220, 0x325f,
+ 0x327f, 0x32cf,
+ 0x3358, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa700, 0xa721,
+ 0xa788, 0xa78a,
+ 0xa830, 0xa839,
+ 0xfd3e, 0xfd3f,
+ 0xfdfd, 0xfdfd,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff20,
+ 0xff3b, 0xff40,
+ 0xff5b, 0xff65,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1013f,
+ 0x10190, 0x1019b,
+ 0x101d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 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Common */
+
+/* 'Latin': Script */
+static const OnigCodePoint CR_Latin[] = {
+ 30,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02b8,
+ 0x02e0, 0x02e4,
+ 0x1d00, 0x1d25,
+ 0x1d2c, 0x1d5c,
+ 0x1d62, 0x1d65,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1dbe,
+ 0x1e00, 0x1eff,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x2c60, 0x2c7f,
+ 0xa722, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
+ 0xfb00, 0xfb06,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+}; /* CR_Latin */
+
+/* 'Greek': Script */
+static const OnigCodePoint CR_Greek[] = {
+ 33,
+ 0x0370, 0x0373,
+ 0x0375, 0x0377,
+ 0x037a, 0x037d,
+ 0x0384, 0x0384,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03e1,
+ 0x03f0, 0x03ff,
+ 0x1d26, 0x1d2a,
+ 0x1d5d, 0x1d61,
+ 0x1d66, 0x1d6a,
+ 0x1dbf, 0x1dbf,
+ 0x1f00, 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,
+ 0x2126, 0x2126,
+ 0x10140, 0x1018a,
+ 0x1d200, 0x1d245,
+}; /* CR_Greek */
+
+/* 'Cyrillic': Script */
+static const OnigCodePoint CR_Cyrillic[] = {
+ 7,
+ 0x0400, 0x0484,
+ 0x0487, 0x0527,
+ 0x1d2b, 0x1d2b,
+ 0x1d78, 0x1d78,
+ 0x2de0, 0x2dff,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
+}; /* CR_Cyrillic */
+
+/* 'Armenian': Script */
+static const OnigCodePoint CR_Armenian[] = {
+ 6,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x058a, 0x058a,
+ 0x058f, 0x058f,
+ 0xfb13, 0xfb17,
+}; /* CR_Armenian */
+
+/* 'Hebrew': Script */
+static const OnigCodePoint CR_Hebrew[] = {
+ 9,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfb4f,
+}; /* CR_Hebrew */
+
+/* 'Arabic': Script */
+static const OnigCodePoint CR_Arabic[] = {
+ 56,
+ 0x0600, 0x0604,
+ 0x0606, 0x060b,
+ 0x060d, 0x061a,
+ 0x061e, 0x061e,
+ 0x0620,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0700, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x074f,
+}; /* CR_Syriac */
+
+/* 'Thaana': Script */
+static const OnigCodePoint CR_Thaana[] = {
+ 1,
+ 0x0780, 0x07b1,
+}; /* CR_Thaana */
+
+/* 'Devanagari': Script */
+static const OnigCodePoint CR_Devanagari[] = {
+ 5,
+ 0x0900, 0x0950,
+ 0x0953, 0x0963,
+ 0x0966, 0x0977,
+ 0x0979, 0x097f,
+ 0xa8e0, 0xa8fb,
+}; /* CR_Devanagari */
+
+/* 'Bengali': Script */
+static const OnigCodePoint CR_Bengali[] = {
+ 14,
+ 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,
+}; /* CR_Bengali */
+
+/* 'Gurmukhi': Script */
+static const OnigCodePoint CR_Gurmukhi[] = {
+ 16,
+ 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,
+}; /* CR_Gurmukhi */
+
+/* 'Gujarati': Script */
+static const OnigCodePoint CR_Gujarati[] = {
+ 13,
+ 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,
+}; /* CR_Gujarati */
+
+/* 'Oriya': Script */
+static const OnigCodePoint CR_Oriya[] = {
+ 14,
+ 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,
+}; /* CR_Oriya */
+
+/* 'Tamil': Script */
+static const OnigCodePoint CR_Tamil[] = {
+ 16,
+ 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,
+}; /* CR_Tamil */
+
+/* 'Telugu': Script */
+static const OnigCodePoint CR_Telugu[] = {
+ 14,
+ 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,
+}; /* CR_Telugu */
+
+/* 'Kannada': Script */
+static const OnigCodePoint CR_Kannada[] = {
+ 14,
+ 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,
+}; /* CR_Kannada */
+
+/* 'Malayalam': Script */
+static const OnigCodePoint CR_Malayalam[] = {
+ 11,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+}; /* CR_Malayalam */
+
+/* 'Sinhala': Script */
+static const OnigCodePoint CR_Sinhala[] = {
+ 11,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+}; /* CR_Sinhala */
+
+/* 'Thai': Script */
+static const OnigCodePoint CR_Thai[] = {
+ 2,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e5b,
+}; /* CR_Thai */
+
+/* 'Lao': Script */
+static const OnigCodePoint CR_Lao[] = {
+ 18,
+ 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,
+}; /* CR_Lao */
+
+/* 'Tibetan': Script */
+static const OnigCodePoint CR_Tibetan[] = {
+ 7,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x0fd9, 0x0fda,
+}; /* CR_Tibetan */
+
+/* 'Myanmar': Script */
+static const OnigCodePoint CR_Myanmar[] = {
+ 2,
+ 0x1000, 0x109f,
+ 0xaa60, 0xaa7b,
+}; /* CR_Myanmar */
+
+/* 'Georgian': Script */
+static const OnigCodePoint CR_Georgian[] = {
+ 8,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x10ff,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+}; /* CR_Georgian */
+
+/* 'Hangul': Script */
+static const OnigCodePoint CR_Hangul[] = {
+ 14,
+ 0x1100, 0x11ff,
+ 0x302e, 0x302f,
+ 0x3131, 0x318e,
+ 0x3200, 0x321e,
+ 0x3260, 0x327e,
+ 0xa960, 0xa97c,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+}; /* CR_Hangul */
+
+/* 'Ethiopic': Script */
+static const OnigCodePoint CR_Ethiopic[] = {
+ 32,
+ 0x1200, 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,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+}; /* CR_Ethiopic */
+
+/* 'Cherokee': Script */
+static const OnigCodePoint CR_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13f4,
+}; /* CR_Cherokee */
+
+/* 'Canadian_Aboriginal': Script */
+static const OnigCodePoint CR_Canadian_Aboriginal[] = {
+ 2,
+ 0x1400, 0x167f,
+ 0x18b0, 0x18f5,
+}; /* CR_Canadian_Aboriginal */
+
+/* 'Ogham': Script */
+static const OnigCodePoint CR_Ogham[] = {
+ 1,
+ 0x1680, 0x169c,
+}; /* CR_Ogham */
+
+/* 'Runic': Script */
+static const OnigCodePoint CR_Runic[] = {
+ 2,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+}; /* CR_Runic */
+
+/* 'Khmer': Script */
+static const OnigCodePoint CR_Khmer[] = {
+ 4,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x19e0, 0x19ff,
+}; /* CR_Khmer */
+
+/* 'Mongolian': Script */
+static const OnigCodePoint CR_Mongolian[] = {
+ 6,
+ 0x1800, 0x1801,
+ 0x1804, 0x1804,
+ 0x1806, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+}; /* CR_Mongolian */
+
+/* 'Hiragana': Script */
+static const OnigCodePoint CR_Hiragana[] = {
+ 4,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x1b001, 0x1b001,
+ 0x1f200, 0x1f200,
+}; /* CR_Hiragana */
+
+/* 'Katakana': Script */
+static const OnigCodePoint CR_Katakana[] = {
+ 8,
+ 0x30a1, 0x30fa,
+ 0x30fd, 0x30ff,
+ 0x31f0, 0x31ff,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3357,
+ 0xff66, 0xff6f,
+ 0xff71, 0xff9d,
+ 0x1b000, 0x1b000,
+}; /* CR_Katakana */
+
+/* 'Bopomofo': Script */
+static const OnigCodePoint CR_Bopomofo[] = {
+ 3,
+ 0x02ea, 0x02eb,
+ 0x3105, 0x312d,
+ 0x31a0, 0x31ba,
+}; /* CR_Bopomofo */
+
+/* 'Han': Script */
+static const OnigCodePoint CR_Han[] = {
+ 15,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x3005, 0x3005,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303b,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Han */
+
+/* 'Yi': Script */
+static const OnigCodePoint CR_Yi[] = {
+ 2,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+}; /* CR_Yi */
+
+/* 'Old_Italic': Script */
+static const OnigCodePoint CR_Old_Italic[] = {
+ 2,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+}; /* CR_Old_Italic */
+
+/* 'Gothic': Script */
+static const OnigCodePoint CR_Gothic[] = {
+ 1,
+ 0x10330, 0x1034a,
+}; /* CR_Gothic */
+
+/* 'Deseret': Script */
+static const OnigCodePoint CR_Deseret[] = {
+ 1,
+ 0x10400, 0x1044f,
+}; /* CR_Deseret */
+
+/* 'Inherited': Script */
+static const OnigCodePoint CR_Inherited[] = {
+ 25,
+ 0x0300, 0x036f,
+ 0x0485, 0x0486,
+ 0x064b, 0x0655,
+ 0x065f, 0x065f,
+ 0x0670, 0x0670,
+ 0x0951, 0x0952,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1ce0,
+ 0x1ce2, 0x1ce8,
+ 0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
+ 0x1dc0, 0x1de6,
+ 0x1dfc, 0x1dff,
+ 0x200c, 0x200d,
+ 0x20d0, 0x20f0,
+ 0x302a, 0x302d,
+ 0x3099, 0x309a,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0x101fd, 0x101fd,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0xe0100, 0xe01ef,
+}; /* CR_Inherited */
+
+/* 'Tagalog': Script */
+static const OnigCodePoint CR_Tagalog[] = {
+ 2,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+}; /* CR_Tagalog */
+
+/* 'Hanunoo': Script */
+static const OnigCodePoint CR_Hanunoo[] = {
+ 1,
+ 0x1720, 0x1734,
+}; /* CR_Hanunoo */
+
+/* 'Buhid': Script */
+static const OnigCodePoint CR_Buhid[] = {
+ 1,
+ 0x1740, 0x1753,
+}; /* CR_Buhid */
+
+/* 'Tagbanwa': Script */
+static const OnigCodePoint CR_Tagbanwa[] = {
+ 3,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+}; /* CR_Tagbanwa */
+
+/* 'Limbu': Script */
+static const OnigCodePoint CR_Limbu[] = {
+ 5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x194f,
+}; /* CR_Limbu */
+
+/* 'Tai_Le': Script */
+static const OnigCodePoint CR_Tai_Le[] = {
+ 2,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+}; /* CR_Tai_Le */
+
+/* 'Linear_B': Script */
+static const OnigCodePoint CR_Linear_B[] = {
+ 7,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+}; /* CR_Linear_B */
+
+/* 'Ugaritic': Script */
+static const OnigCodePoint CR_Ugaritic[] = {
+ 2,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+}; /* CR_Ugaritic */
+
+/* 'Shavian': Script */
+static const OnigCodePoint CR_Shavian[] = {
+ 1,
+ 0x10450, 0x1047f,
+}; /* CR_Shavian */
+
+/* 'Osmanya': Script */
+static const OnigCodePoint CR_Osmanya[] = {
+ 2,
+ 0x10480, 0x1049d,
+ 0x104a0, 0x104a9,
+}; /* CR_Osmanya */
+
+/* 'Cypriot': Script */
+static const OnigCodePoint CR_Cypriot[] = {
+ 6,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+}; /* CR_Cypriot */
+
+/* 'Braille': Script */
+static const OnigCodePoint CR_Braille[] = {
+ 1,
+ 0x2800, 0x28ff,
+}; /* CR_Braille */
+
+/* 'Buginese': Script */
+static const OnigCodePoint CR_Buginese[] = {
+ 2,
+ 0x1a00, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+}; /* CR_Buginese */
+
+/* 'Coptic': Script */
+static const OnigCodePoint CR_Coptic[] = {
+ 3,
+ 0x03e2, 0x03ef,
+ 0x2c80, 0x2cf3,
+ 0x2cf9, 0x2cff,
+}; /* CR_Coptic */
+
+/* 'New_Tai_Lue': Script */
+static const OnigCodePoint CR_New_Tai_Lue[] = {
+ 4,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x19df,
+}; /* CR_New_Tai_Lue */
+
+/* 'Glagolitic': Script */
+static const OnigCodePoint CR_Glagolitic[] = {
+ 2,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+}; /* CR_Glagolitic */
+
+/* 'Tifinagh': Script */
+static const OnigCodePoint CR_Tifinagh[] = {
+ 3,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d7f,
+}; /* CR_Tifinagh */
+
+/* 'Syloti_Nagri': Script */
+static const OnigCodePoint CR_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82b,
+}; /* CR_Syloti_Nagri */
+
+/* 'Old_Persian': Script */
+static const OnigCodePoint CR_Old_Persian[] = {
+ 2,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103d5,
+}; /* CR_Old_Persian */
+
+/* 'Kharoshthi': Script */
+static const OnigCodePoint CR_Kharoshthi[] = {
+ 8,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+}; /* CR_Kharoshthi */
+
+/* 'Balinese': Script */
+static const OnigCodePoint CR_Balinese[] = {
+ 2,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+}; /* CR_Balinese */
+
+/* 'Cuneiform': Script */
+static const OnigCodePoint CR_Cuneiform[] = {
+ 3,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+}; /* CR_Cuneiform */
+
+/* 'Phoenician': Script */
+static const OnigCodePoint CR_Phoenician[] = {
+ 2,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x1091f,
+}; /* CR_Phoenician */
+
+/* 'Phags_Pa': Script */
+static const OnigCodePoint CR_Phags_Pa[] = {
+ 1,
+ 0xa840, 0xa877,
+}; /* CR_Phags_Pa */
+
+/* 'Nko': Script */
+static const OnigCodePoint CR_Nko[] = {
+ 1,
+ 0x07c0, 0x07fa,
+}; /* CR_Nko */
+
+/* 'Sundanese': Script */
+static const OnigCodePoint CR_Sundanese[] = {
+ 2,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
+}; /* CR_Sundanese */
+
+/* 'Lepcha': Script */
+static const OnigCodePoint CR_Lepcha[] = {
+ 3,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c4f,
+}; /* CR_Lepcha */
+
+/* 'Ol_Chiki': Script */
+static const OnigCodePoint CR_Ol_Chiki[] = {
+ 1,
+ 0x1c50, 0x1c7f,
+}; /* CR_Ol_Chiki */
+
+/* 'Vai': Script */
+static const OnigCodePoint CR_Vai[] = {
+ 1,
+ 0xa500, 0xa62b,
+}; /* CR_Vai */
+
+/* 'Saurashtra': Script */
+static const OnigCodePoint CR_Saurashtra[] = {
+ 2,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+}; /* CR_Saurashtra */
+
+/* 'Kayah_Li': Script */
+static const OnigCodePoint CR_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_Kayah_Li */
+
+/* 'Rejang': Script */
+static const OnigCodePoint CR_Rejang[] = {
+ 2,
+ 0xa930, 0xa953,
+ 0xa95f, 0xa95f,
+}; /* CR_Rejang */
+
+/* 'Lycian': Script */
+static const OnigCodePoint CR_Lycian[] = {
+ 1,
+ 0x10280, 0x1029c,
+}; /* CR_Lycian */
+
+/* 'Carian': Script */
+static const OnigCodePoint CR_Carian[] = {
+ 1,
+ 0x102a0, 0x102d0,
+}; /* CR_Carian */
+
+/* 'Lydian': Script */
+static const OnigCodePoint CR_Lydian[] = {
+ 2,
+ 0x10920, 0x10939,
+ 0x1093f, 0x1093f,
+}; /* CR_Lydian */
+
+/* 'Cham': Script */
+static const OnigCodePoint CR_Cham[] = {
+ 4,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa5f,
+}; /* CR_Cham */
+
+/* 'Tai_Tham': Script */
+static const OnigCodePoint CR_Tai_Tham[] = {
+ 5,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+}; /* CR_Tai_Tham */
+
+/* 'Tai_Viet': Script */
+static const OnigCodePoint CR_Tai_Viet[] = {
+ 2,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadf,
+}; /* CR_Tai_Viet */
+
+/* 'Avestan': Script */
+static const OnigCodePoint CR_Avestan[] = {
+ 2,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b3f,
+}; /* CR_Avestan */
+
+/* 'Egyptian_Hieroglyphs': Script */
+static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342e,
+}; /* CR_Egyptian_Hieroglyphs */
+
+/* 'Samaritan': Script */
+static const OnigCodePoint CR_Samaritan[] = {
+ 2,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+}; /* CR_Samaritan */
+
+/* 'Lisu': Script */
+static const OnigCodePoint CR_Lisu[] = {
+ 1,
+ 0xa4d0, 0xa4ff,
+}; /* CR_Lisu */
+
+/* 'Bamum': Script */
+static const OnigCodePoint CR_Bamum[] = {
+ 2,
+ 0xa6a0, 0xa6f7,
+ 0x16800, 0x16a38,
+}; /* CR_Bamum */
+
+/* 'Javanese': Script */
+static const OnigCodePoint CR_Javanese[] = {
+ 3,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+}; /* CR_Javanese */
+
+/* 'Meetei_Mayek': Script */
+static const OnigCodePoint CR_Meetei_Mayek[] = {
+ 3,
+ 0xaae0, 0xaaf6,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+}; /* CR_Meetei_Mayek */
+
+/* 'Imperial_Aramaic': Script */
+static const OnigCodePoint CR_Imperial_Aramaic[] = {
+ 2,
+ 0x10840, 0x10855,
+ 0x10857, 0x1085f,
+}; /* CR_Imperial_Aramaic */
+
+/* 'Old_South_Arabian': Script */
+static const OnigCodePoint CR_Old_South_Arabian[] = {
+ 1,
+ 0x10a60, 0x10a7f,
+}; /* CR_Old_South_Arabian */
+
+/* 'Inscriptional_Parthian': Script */
+static const OnigCodePoint CR_Inscriptional_Parthian[] = {
+ 2,
+ 0x10b40, 0x10b55,
+ 0x10b58, 0x10b5f,
+}; /* CR_Inscriptional_Parthian */
+
+/* 'Inscriptional_Pahlavi': Script */
+static const OnigCodePoint CR_Inscriptional_Pahlavi[] = {
+ 2,
+ 0x10b60, 0x10b72,
+ 0x10b78, 0x10b7f,
+}; /* CR_Inscriptional_Pahlavi */
+
+/* 'Old_Turkic': Script */
+static const OnigCodePoint CR_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c48,
+}; /* CR_Old_Turkic */
+
+/* 'Kaithi': Script */
+static const OnigCodePoint CR_Kaithi[] = {
+ 1,
+ 0x11080, 0x110c1,
+}; /* CR_Kaithi */
+
+/* 'Batak': Script */
+static const OnigCodePoint CR_Batak[] = {
+ 2,
+ 0x1bc0, 0x1bf3,
+ 0x1bfc, 0x1bff,
+}; /* CR_Batak */
+
+/* 'Brahmi': Script */
+static const OnigCodePoint CR_Brahmi[] = {
+ 2,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+}; /* CR_Brahmi */
+
+/* 'Mandaic': Script */
+static const OnigCodePoint CR_Mandaic[] = {
+ 2,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+}; /* CR_Mandaic */
+
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
+/* 'White_Space': Binary Property */
+#define CR_White_Space CR_Space
+
+/* 'Bidi_Control': Binary Property */
+static const OnigCodePoint CR_Bidi_Control[] = {
+ 2,
+ 0x200e, 0x200f,
+ 0x202a, 0x202e,
+}; /* CR_Bidi_Control */
+
+/* 'Join_Control': Binary Property */
+static const OnigCodePoint CR_Join_Control[] = {
+ 1,
+ 0x200c, 0x200d,
+}; /* CR_Join_Control */
+
+/* 'Dash': Binary Property */
+static const OnigCodePoint CR_Dash[] = {
+ 20,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2053, 0x2053,
+ 0x207b, 0x207b,
+ 0x208b, 0x208b,
+ 0x2212, 0x2212,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Dash */
+
+/* 'Hyphen': Binary Property */
+static const OnigCodePoint CR_Hyphen[] = {
+ 10,
+ 0x002d, 0x002d,
+ 0x00ad, 0x00ad,
+ 0x058a, 0x058a,
+ 0x1806, 0x1806,
+ 0x2010, 0x2011,
+ 0x2e17, 0x2e17,
+ 0x30fb, 0x30fb,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+ 0xff65, 0xff65,
+}; /* CR_Hyphen */
+
+/* 'Quotation_Mark': Binary Property */
+static const OnigCodePoint CR_Quotation_Mark[] = {
+ 12,
+ 0x0022, 0x0022,
+ 0x0027, 0x0027,
+ 0x00ab, 0x00ab,
+ 0x00bb, 0x00bb,
+ 0x2018, 0x201f,
+ 0x2039, 0x203a,
+ 0x300c, 0x300f,
+ 0x301d, 0x301f,
+ 0xfe41, 0xfe44,
+ 0xff02, 0xff02,
+ 0xff07, 0xff07,
+ 0xff62, 0xff63,
+}; /* CR_Quotation_Mark */
+
+/* 'Terminal_Punctuation': Binary Property */
+static const OnigCodePoint CR_Terminal_Punctuation[] = {
+ 70,
+ 0x0021, 0x0021,
+ 0x002c, 0x002c,
+ 0x002e, 0x002e,
+ 0x003a, 0x003b,
+ 0x003f, 0x003f,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x05c3, 0x05c3,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070a,
+ 0x070c, 0x070c,
+ 0x07f8, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0e5a, 0x0e5b,
+ 0x0f08, 0x0f08,
+ 0x0f0d, 0x0f12,
+ 0x104a, 0x104b,
+ 0x1361, 0x1368,
+ 0x166d, 0x166e,
+ 0x16eb, 0x16ed,
+ 0x17d4, 0x17d6,
+ 0x17da, 0x17da,
+ 0x1802, 0x1805,
+ 0x1808, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5d, 0x1b5f,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x3001, 0x3002,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa6f3, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c7, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaadf, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0e,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0xff64, 0xff64,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x10b3a, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+ 0x12470, 0x12473,
+}; /* CR_Terminal_Punctuation */
+
+/* 'Other_Math': Binary Property */
+static const OnigCodePoint CR_Other_Math[] = {
+ 133,
+ 0x005e, 0x005e,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2061, 0x2064,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21a7,
+ 0x21a9, 0x21ad,
+ 0x21b0, 0x21b1,
+ 0x21b6, 0x21b7,
+ 0x21bc, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21db,
+ 0x21dd, 0x21dd,
+ 0x21e4, 0x21e5,
+ 0x23b4, 0x23b5,
+ 0x23b7, 0x23b7,
+ 0x23d0, 0x23d0,
+ 0x23e2, 0x23e2,
+ 0x25a0, 0x25a1,
+ 0x25ae, 0x25b6,
+ 0x25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24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+}; /* CR_Other_Math */
+
+/* 'Hex_Digit': Binary Property */
+static const OnigCodePoint CR_Hex_Digit[] = {
+ 6,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+ 0xff10, 0xff19,
+ 0xff21, 0xff26,
+ 0xff41, 0xff46,
+}; /* CR_Hex_Digit */
+
+/* 'ASCII_Hex_Digit': Binary Property */
+#define CR_ASCII_Hex_Digit CR_XDigit
+
+/* 'Other_Alphabetic': Binary Property */
+static const OnigCodePoint CR_Other_Alphabetic[] = {
+ 158,
+ 0x0345, 0x0345,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x0657,
+ 0x0659, 0x065f,
+ 0x0670, 0x0670,
+ 0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 0xa947, 0xa952,
+ 0xa980, 0xa983,
+ 0xa9b4, 0xa9bf,
+ 0xaa29, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4d,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabea,
+ 0xfb1e, 0xfb1e,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11045,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
+}; /* CR_Other_Alphabetic */
+
+/* 'Ideographic': Binary Property */
+static const OnigCodePoint CR_Ideographic[] = {
+ 11,
+ 0x3006, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Ideographic */
+
+/* 'Diacritic': Binary Property */
+static const OnigCodePoint CR_Diacritic[] = {
+ 125,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x034e,
+ 0x0350, 0x0357,
+ 0x035d, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0483, 0x0487,
+ 0x0559, 0x0559,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05bd,
+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+ 0x180a, 0x180a,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c36, 0x1c36,
+ 0x1c7b, 0x1c7b,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa60c, 0xa60c,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+}; /* CR_Extender */
+
+/* 'Other_Lowercase': Binary Property */
+static const OnigCodePoint CR_Other_Lowercase[] = {
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x02b0, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x037a, 0x037a,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2170, 0x217f,
+ 0x24d0, 0x24e9,
+ 0x2c7c, 0x2c7d,
+ 0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
+}; /* CR_Other_Lowercase */
+
+/* 'Other_Uppercase': Binary Property */
+static const OnigCodePoint CR_Other_Uppercase[] = {
+ 2,
+ 0x2160, 0x216f,
+ 0x24b6, 0x24cf,
+}; /* CR_Other_Uppercase */
+
+/* 'Noncharacter_Code_Point': Binary Property */
+static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
+ 18,
+ 0xfdd0, 0xfdef,
+ 0xfffe, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Noncharacter_Code_Point */
+
+/* 'Other_Grapheme_Extend': Binary Property */
+static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
+ 17,
+ 0x09be, 0x09be,
+ 0x09d7, 0x09d7,
+ 0x0b3e, 0x0b3e,
+ 0x0b57, 0x0b57,
+ 0x0bbe, 0x0bbe,
+ 0x0bd7, 0x0bd7,
+ 0x0cc2, 0x0cc2,
+ 0x0cd5, 0x0cd6,
+ 0x0d3e, 0x0d3e,
+ 0x0d57, 0x0d57,
+ 0x0dcf, 0x0dcf,
+ 0x0ddf, 0x0ddf,
+ 0x200c, 0x200d,
+ 0x302e, 0x302f,
+ 0xff9e, 0xff9f,
+ 0x1d165, 0x1d165,
+ 0x1d16e, 0x1d172,
+}; /* CR_Other_Grapheme_Extend */
+
+/* 'IDS_Binary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Binary_Operator[] = {
+ 2,
+ 0x2ff0, 0x2ff1,
+ 0x2ff4, 0x2ffb,
+}; /* CR_IDS_Binary_Operator */
+
+/* 'IDS_Trinary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Trinary_Operator[] = {
+ 1,
+ 0x2ff2, 0x2ff3,
+}; /* CR_IDS_Trinary_Operator */
+
+/* 'Radical': Binary Property */
+static const OnigCodePoint CR_Radical[] = {
+ 3,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+}; /* CR_Radical */
+
+/* 'Unified_Ideograph': Binary Property */
+static const OnigCodePoint CR_Unified_Ideograph[] = {
+ 12,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xfa0e, 0xfa0f,
+ 0xfa11, 0xfa11,
+ 0xfa13, 0xfa14,
+ 0xfa1f, 0xfa1f,
+ 0xfa21, 0xfa21,
+ 0xfa23, 0xfa24,
+ 0xfa27, 0xfa29,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+}; /* CR_Unified_Ideograph */
+
+/* 'Other_Default_Ignorable_Code_Point': Binary Property */
+static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
+ 11,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x2065, 0x2069,
+ 0x3164, 0x3164,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0xe0000, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xe0fff,
+}; /* CR_Other_Default_Ignorable_Code_Point */
+
+/* 'Deprecated': Binary Property */
+static const OnigCodePoint CR_Deprecated[] = {
+ 9,
+ 0x0149, 0x0149,
+ 0x0673, 0x0673,
+ 0x0f77, 0x0f77,
+ 0x0f79, 0x0f79,
+ 0x17a3, 0x17a4,
+ 0x206a, 0x206f,
+ 0x2329, 0x232a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Deprecated */
+
+/* 'Soft_Dotted': Binary Property */
+static const OnigCodePoint CR_Soft_Dotted[] = {
+ 31,
+ 0x0069, 0x006a,
+ 0x012f, 0x012f,
+ 0x0249, 0x0249,
+ 0x0268, 0x0268,
+ 0x029d, 0x029d,
+ 0x02b2, 0x02b2,
+ 0x03f3, 0x03f3,
+ 0x0456, 0x0456,
+ 0x0458, 0x0458,
+ 0x1d62, 0x1d62,
+ 0x1d96, 0x1d96,
+ 0x1da4, 0x1da4,
+ 0x1da8, 0x1da8,
+ 0x1e2d, 0x1e2d,
+ 0x1ecb, 0x1ecb,
+ 0x2071, 0x2071,
+ 0x2148, 0x2149,
+ 0x2c7c, 0x2c7c,
+ 0x1d422, 0x1d423,
+ 0x1d456, 0x1d457,
+ 0x1d48a, 0x1d48b,
+ 0x1d4be, 0x1d4bf,
+ 0x1d4f2, 0x1d4f3,
+ 0x1d526, 0x1d527,
+ 0x1d55a, 0x1d55b,
+ 0x1d58e, 0x1d58f,
+ 0x1d5c2, 0x1d5c3,
+ 0x1d5f6, 0x1d5f7,
+ 0x1d62a, 0x1d62b,
+ 0x1d65e, 0x1d65f,
+ 0x1d692, 0x1d693,
+}; /* CR_Soft_Dotted */
+
+/* 'Logical_Order_Exception': Binary Property */
+static const OnigCodePoint CR_Logical_Order_Exception[] = {
+ 5,
+ 0x0e40, 0x0e44,
+ 0x0ec0, 0x0ec4,
+ 0xaab5, 0xaab6,
+ 0xaab9, 0xaab9,
+ 0xaabb, 0xaabc,
+}; /* CR_Logical_Order_Exception */
+
+/* 'Other_ID_Start': Binary Property */
+static const OnigCodePoint CR_Other_ID_Start[] = {
+ 3,
+ 0x2118, 0x2118,
+ 0x212e, 0x212e,
+ 0x309b, 0x309c,
+}; /* CR_Other_ID_Start */
+
+/* 'Other_ID_Continue': Binary Property */
+static const OnigCodePoint CR_Other_ID_Continue[] = {
+ 4,
+ 0x00b7, 0x00b7,
+ 0x0387, 0x0387,
+ 0x1369, 0x1371,
+ 0x19da, 0x19da,
+}; /* CR_Other_ID_Continue */
+
+/* 'STerm': Binary Property */
+static const OnigCodePoint CR_STerm[] = {
+ 50,
+ 0x0021, 0x0021,
+ 0x002e, 0x002e,
+ 0x003f, 0x003f,
+ 0x055c, 0x055c,
+ 0x055e, 0x055e,
+ 0x0589, 0x0589,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x0702,
+ 0x07f9, 0x07f9,
+ 0x0964, 0x0965,
+ 0x104a, 0x104b,
+ 0x1362, 0x1362,
+ 0x1367, 0x1368,
+ 0x166e, 0x166e,
+ 0x1735, 0x1736,
+ 0x1803, 0x1803,
+ 0x1809, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5e, 0x1b5f,
+ 0x1c3b, 0x1c3c,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x3002, 0x3002,
+ 0xa4ff, 0xa4ff,
+ 0xa60e, 0xa60f,
+ 0xa6f3, 0xa6f3,
+ 0xa6f7, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c8, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe52, 0xfe52,
+ 0xfe56, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0e, 0xff0e,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0x10a56, 0x10a57,
+ 0x11047, 0x11048,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+}; /* CR_STerm */
+
+/* 'Variation_Selector': Binary Property */
+static const OnigCodePoint CR_Variation_Selector[] = {
+ 3,
+ 0x180b, 0x180d,
+ 0xfe00, 0xfe0f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Variation_Selector */
+
+/* 'Pattern_White_Space': Binary Property */
+static const OnigCodePoint CR_Pattern_White_Space[] = {
+ 5,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x200e, 0x200f,
+ 0x2028, 0x2029,
+}; /* CR_Pattern_White_Space */
+
+/* 'Pattern_Syntax': Binary Property */
+static const OnigCodePoint CR_Pattern_Syntax[] = {
+ 28,
+ 0x0021, 0x002f,
+ 0x003a, 0x0040,
+ 0x005b, 0x005e,
+ 0x0060, 0x0060,
+ 0x007b, 0x007e,
+ 0x00a1, 0x00a7,
+ 0x00a9, 0x00a9,
+ 0x00ab, 0x00ac,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b1,
+ 0x00b6, 0x00b6,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x2010, 0x2027,
+ 0x2030, 0x203e,
+ 0x2041, 0x2053,
+ 0x2055, 0x205e,
+ 0x2190, 0x245f,
+ 0x2500, 0x2775,
+ 0x2794, 0x2bff,
+ 0x2e00, 0x2e7f,
+ 0x3001, 0x3003,
+ 0x3008, 0x3020,
+ 0x3030, 0x3030,
+ 0xfd3e, 0xfd3f,
+ 0xfe45, 0xfe46,
+}; /* CR_Pattern_Syntax */
+
+/* 'Unknown': Script */
+static const OnigCodePoint CR_Unknown[] = {
+ 537,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x0605, 0x0605,
+ 0x061c, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04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, 0xf8ff,
+ 0xfa6e, 0xfa6f,
+ 0xfada, 0xfaff,
+ 0xfb07, 0xfb12,
+ 0xfb18, 0xfb1c,
+ 0xfb37, 0xfb37,
+ 0xfb3d, 0xfb3d,
+ 0xfb3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xfefe,
+ 0xff00, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfff8,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d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,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_Unknown */
+
+/* 'Age_1_1': Derived Age 1.1 */
+static const OnigCodePoint CR_Age_1_1[] = {
+ 288,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 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80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20aa,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xe000, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+}; /* CR_Age_1_1 */
+
+/* 'Age_2_0': Derived Age 2.0 */
+static const OnigCodePoint CR_Age_2_0[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x0591, 0x05a1,
+ 0x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f80, 0x1fb4,
+ 0x1fb6, 0x1fc4,
+ 0x1fc6, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fdd, 0x1fef,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffe,
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ab,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_2_0 */
+
+/* 'Age_2_1': Derived Age 2.1 */
+static const OnigCodePoint CR_Age_2_1[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0652,
+ 0x0660, 0x066d,
+ 0x0670, 0x06b7,
+ 0x06ba, 0x06be,
+ 0x06c0, 0x06ce,
+ 0x06d0, 0x06ed,
+ 0x06f0, 0x06f9,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0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, 0x10f6,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ac,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 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0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f3,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0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ff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_0 */
+
+/* 'Age_3_1': Derived Age 3.1 */
+static const OnigCodePoint CR_Age_3_1[] = {
+ 402,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f5,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 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310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2046,
+ 0x2048, 0x204d,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20af,
+ 0x20d0, 0x20e3,
+ 0x2100, 0x213a,
+ 0x2153, 0x2183,
+ 0x2190, 0x21f3,
+ 0x2200, 0x22f1,
+ 0x2300, 0x237b,
+ 0x237d, 0x239a,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25f7,
+ 0x2600, 0x2613,
+ 0x2619, 0x2671,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+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0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xffff,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10400, 0x10425,
+ 0x10428, 0x1044d,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_1 */
+
+/* 'Age_3_2': Derived Age 3.2 */
+static const OnigCodePoint CR_Age_3_2[] = {
+ 397,
+ 0x0000, 0x0220,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034f,
+ 0x0360, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03f6,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b1,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38,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 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6a,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fcf, 0x0fcf,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f8,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 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4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_2 */
+
+/* 'Age_4_0': Derived Age 4.0 */
+static const OnigCodePoint CR_Age_4_0[] = {
+ 412,
+ 0x0000, 0x0236,
+ 0x0250, 0x0357,
+ 0x035d, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03fb,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c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1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x19e0, 0x19ff,
+ 0x1d00, 0x1d6b,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2054,
+ 0x2057, 0x2057,
+ 0x205f, 0x2063,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20b1,
+ 0x20d0, 0x20ea,
+ 0x2100, 0x213b,
+ 0x213d, 0x214b,
+ 0x2153, 0x2183,
+ 0x2190, 0x23d0,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2617,
+ 0x2619, 0x267d,
+ 0x2680, 0x2691,
+ 0x26a0, 0x26a1,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x27d0, 0x27eb,
+ 0x27f0, 0x2b0d,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31f0, 0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x327d,
+ 0x327f, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fa5,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe23,
+ 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, 0x1013f,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d300, 0x1d356,
+ 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, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_0 */
+
+/* 'Age_4_1': Derived Age 4.1 */
+static const OnigCodePoint CR_Age_4_1[] = {
+ 430,
+ 0x0000, 0x0241,
+ 0x0250, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05b9,
+ 0x05bb, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060b, 0x0615,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x065e,
+ 0x0660, 0x070d,
+ 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b13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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, 0x1083f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 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, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_1 */
+
+/* 'Age_5_0': Derived Age 5.0 */
+static const OnigCodePoint CR_Age_5_0[] = {
+ 440,
+ 0x0000, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x0513,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x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159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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, 0x18a9,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19a9,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1d00, 0x1dca,
+ 0x1dfe, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,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,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31c0, 0x31cf,
+ 0x31f0, 0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fbb,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa700, 0xa71a,
+ 0xa720, 0xa721,
+ 0xa800, 0xa82b,
+ 0xa840, 0xa877,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x1091f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 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,
+ 0x1fffe, 0x2a6d6,
+ 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_5_0 */
+
+/* 'Age_5_1': Derived Age 5.1 */
+static const OnigCodePoint CR_Age_5_1[] = {
+ 455,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0523,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0972,
+ 0x097b, 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, 0x09fa,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0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x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x1000, 0x1099,
+ 0x109e, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0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 0xfb46, 0xfbb1,
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1fffe, 0x2a6d6,
+ 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_5_1 */
+
+/* 'Age_5_2': Derived Age 5.2 */
+static const OnigCodePoint CR_Age_5_2[] = {
+ 495,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x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 0x1000, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 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, 0x1baa,
+ 0x1bae, 0x1bb9,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cd0, 0x1cf2,
+ 0x1d00, 0x1de6,
+ 0x1dfd, 0x1f15,
+ 0x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xfe20, 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,
+ 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,
+ 0x11080, 0x110c1,
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 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_5_2 */
+
+/* 'Age_6_0': Derived Age 6.0 */
+static const OnigCodePoint CR_Age_6_0[] = {
+ 511,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0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9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 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,
+ 0x19b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00, 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,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f169,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f5ff,
+ 0x1f601, 0x1f610,
+ 0x1f612, 0x1f614,
+ 0x1f616, 0x1f616,
+ 0x1f618, 0x1f618,
+ 0x1f61a, 0x1f61a,
+ 0x1f61c, 0x1f61e,
+ 0x1f620, 0x1f625,
+ 0x1f628, 0x1f62b,
+ 0x1f62d, 0x1f62d,
+ 0x1f630, 0x1f633,
+ 0x1f635, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 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_0 */
+
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 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, 0x0a8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f71, 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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xfe68, 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, 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f700, 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_1 */
+
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
+
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
+
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
+
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
+
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
+ 0x2de0, 0x2dff,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
+ 0x31f0, 0x31ff,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
+ 0xfe00, 0xfe0f,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
+ 0xe0100, 0xe01ef,
+}; /* CR_In_Variation_Selectors_Supplement */
+
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
+
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
+ 1,
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
+
+static const OnigCodePoint* const CodeRanges[] = {
+ CR_NEWLINE,
+ CR_Alpha,
+ CR_Blank,
+ CR_Cntrl,
+ CR_Digit,
+ CR_Graph,
+ CR_Lower,
+ CR_Print,
+ CR_Punct,
+ CR_Space,
+ CR_Upper,
+ CR_XDigit,
+ CR_Word,
+ CR_Alnum,
+ CR_ASCII,
+#ifdef USE_UNICODE_PROPERTIES
+ CR_Any,
+ CR_Assigned,
+ CR_C,
+ CR_Cc,
+ CR_Cf,
+ CR_Cn,
+ CR_Co,
+ CR_Cs,
+ CR_L,
+ CR_LC,
+ CR_Ll,
+ CR_Lm,
+ CR_Lo,
+ CR_Lt,
+ CR_Lu,
+ CR_M,
+ CR_Mc,
+ CR_Me,
+ CR_Mn,
+ CR_N,
+ CR_Nd,
+ CR_Nl,
+ CR_No,
+ CR_P,
+ CR_Pc,
+ CR_Pd,
+ CR_Pe,
+ CR_Pf,
+ CR_Pi,
+ CR_Po,
+ CR_Ps,
+ CR_S,
+ CR_Sc,
+ CR_Sk,
+ CR_Sm,
+ CR_So,
+ CR_Z,
+ CR_Zl,
+ CR_Zp,
+ CR_Zs,
+ CR_Math,
+ CR_Alphabetic,
+ CR_Lowercase,
+ CR_Uppercase,
+ CR_Cased,
+ CR_Case_Ignorable,
+ CR_Changes_When_Lowercased,
+ CR_Changes_When_Uppercased,
+ CR_Changes_When_Titlecased,
+ CR_Changes_When_Casefolded,
+ CR_Changes_When_Casemapped,
+ CR_ID_Start,
+ CR_ID_Continue,
+ CR_XID_Start,
+ CR_XID_Continue,
+ CR_Default_Ignorable_Code_Point,
+ CR_Grapheme_Extend,
+ CR_Grapheme_Base,
+ CR_Grapheme_Link,
+ CR_Common,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+ CR_Armenian,
+ CR_Hebrew,
+ CR_Arabic,
+ CR_Syriac,
+ CR_Thaana,
+ CR_Devanagari,
+ CR_Bengali,
+ CR_Gurmukhi,
+ CR_Gujarati,
+ CR_Oriya,
+ CR_Tamil,
+ CR_Telugu,
+ CR_Kannada,
+ CR_Malayalam,
+ CR_Sinhala,
+ CR_Thai,
+ CR_Lao,
+ CR_Tibetan,
+ CR_Myanmar,
+ CR_Georgian,
+ CR_Hangul,
+ CR_Ethiopic,
+ CR_Cherokee,
+ CR_Canadian_Aboriginal,
+ CR_Ogham,
+ CR_Runic,
+ CR_Khmer,
+ CR_Mongolian,
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Bopomofo,
+ CR_Han,
+ CR_Yi,
+ CR_Old_Italic,
+ CR_Gothic,
+ CR_Deseret,
+ CR_Inherited,
+ CR_Tagalog,
+ CR_Hanunoo,
+ CR_Buhid,
+ CR_Tagbanwa,
+ CR_Limbu,
+ CR_Tai_Le,
+ CR_Linear_B,
+ CR_Ugaritic,
+ CR_Shavian,
+ CR_Osmanya,
+ CR_Cypriot,
+ CR_Braille,
+ CR_Buginese,
+ CR_Coptic,
+ CR_New_Tai_Lue,
+ CR_Glagolitic,
+ CR_Tifinagh,
+ CR_Syloti_Nagri,
+ CR_Old_Persian,
+ CR_Kharoshthi,
+ CR_Balinese,
+ CR_Cuneiform,
+ CR_Phoenician,
+ CR_Phags_Pa,
+ CR_Nko,
+ CR_Sundanese,
+ CR_Lepcha,
+ CR_Ol_Chiki,
+ CR_Vai,
+ CR_Saurashtra,
+ CR_Kayah_Li,
+ CR_Rejang,
+ CR_Lycian,
+ CR_Carian,
+ CR_Lydian,
+ CR_Cham,
+ CR_Tai_Tham,
+ CR_Tai_Viet,
+ CR_Avestan,
+ CR_Egyptian_Hieroglyphs,
+ CR_Samaritan,
+ CR_Lisu,
+ CR_Bamum,
+ CR_Javanese,
+ CR_Meetei_Mayek,
+ CR_Imperial_Aramaic,
+ CR_Old_South_Arabian,
+ CR_Inscriptional_Parthian,
+ CR_Inscriptional_Pahlavi,
+ CR_Old_Turkic,
+ CR_Kaithi,
+ CR_Batak,
+ CR_Brahmi,
+ CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
+ CR_White_Space,
+ CR_Bidi_Control,
+ CR_Join_Control,
+ CR_Dash,
+ CR_Hyphen,
+ CR_Quotation_Mark,
+ CR_Terminal_Punctuation,
+ CR_Other_Math,
+ CR_Hex_Digit,
+ CR_ASCII_Hex_Digit,
+ CR_Other_Alphabetic,
+ CR_Ideographic,
+ CR_Diacritic,
+ CR_Extender,
+ CR_Other_Lowercase,
+ CR_Other_Uppercase,
+ CR_Noncharacter_Code_Point,
+ CR_Other_Grapheme_Extend,
+ CR_IDS_Binary_Operator,
+ CR_IDS_Trinary_Operator,
+ CR_Radical,
+ CR_Unified_Ideograph,
+ CR_Other_Default_Ignorable_Code_Point,
+ CR_Deprecated,
+ CR_Soft_Dotted,
+ CR_Logical_Order_Exception,
+ CR_Other_ID_Start,
+ CR_Other_ID_Continue,
+ CR_STerm,
+ CR_Variation_Selector,
+ CR_Pattern_White_Space,
+ CR_Pattern_Syntax,
+ CR_Unknown,
+ CR_Age_1_1,
+ CR_Age_2_0,
+ CR_Age_2_1,
+ CR_Age_3_0,
+ CR_Age_3_1,
+ CR_Age_3_2,
+ CR_Age_4_0,
+ CR_Age_4_1,
+ CR_Age_5_0,
+ CR_Age_5_1,
+ CR_Age_5_2,
+ CR_Age_6_0,
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
+#endif /* USE_UNICODE_PROPERTIES */
+};
+struct uniname2ctype_struct {
+ int name, ctype;
+};
+
+static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
+%}
+struct uniname2ctype_struct;
+%%
+alpha, 1
+blank, 2
+cntrl, 3
+digit, 4
+graph, 5
+lower, 6
+print, 7
+punct, 8
+space, 9
+upper, 10
+xdigit, 11
+word, 12
+alnum, 13
+ascii, 14
+#ifdef USE_UNICODE_PROPERTIES
+any, 15
+assigned, 16
+c, 17
+cc, 18
+cf, 19
+cn, 20
+co, 21
+cs, 22
+l, 23
+lc, 24
+ll, 25
+lm, 26
+lo, 27
+lt, 28
+lu, 29
+m, 30
+mc, 31
+me, 32
+mn, 33
+n, 34
+nd, 35
+nl, 36
+no, 37
+p, 38
+pc, 39
+pd, 40
+pe, 41
+pf, 42
+pi, 43
+po, 44
+ps, 45
+s, 46
+sc, 47
+sk, 48
+sm, 49
+so, 50
+z, 51
+zl, 52
+zp, 53
+zs, 54
+math, 55
+alphabetic, 56
+lowercase, 57
+uppercase, 58
+cased, 59
+caseignorable, 60
+changeswhenlowercased, 61
+changeswhenuppercased, 62
+changeswhentitlecased, 63
+changeswhencasefolded, 64
+changeswhencasemapped, 65
+idstart, 66
+idcontinue, 67
+xidstart, 68
+xidcontinue, 69
+defaultignorablecodepoint, 70
+graphemeextend, 71
+graphemebase, 72
+graphemelink, 73
+common, 74
+latin, 75
+greek, 76
+cyrillic, 77
+armenian, 78
+hebrew, 79
+arabic, 80
+syriac, 81
+thaana, 82
+devanagari, 83
+bengali, 84
+gurmukhi, 85
+gujarati, 86
+oriya, 87
+tamil, 88
+telugu, 89
+kannada, 90
+malayalam, 91
+sinhala, 92
+thai, 93
+lao, 94
+tibetan, 95
+myanmar, 96
+georgian, 97
+hangul, 98
+ethiopic, 99
+cherokee, 100
+canadianaboriginal, 101
+ogham, 102
+runic, 103
+khmer, 104
+mongolian, 105
+hiragana, 106
+katakana, 107
+bopomofo, 108
+han, 109
+yi, 110
+olditalic, 111
+gothic, 112
+deseret, 113
+inherited, 114
+tagalog, 115
+hanunoo, 116
+buhid, 117
+tagbanwa, 118
+limbu, 119
+taile, 120
+linearb, 121
+ugaritic, 122
+shavian, 123
+osmanya, 124
+cypriot, 125
+braille, 126
+buginese, 127
+coptic, 128
+newtailue, 129
+glagolitic, 130
+tifinagh, 131
+sylotinagri, 132
+oldpersian, 133
+kharoshthi, 134
+balinese, 135
+cuneiform, 136
+phoenician, 137
+phagspa, 138
+nko, 139
+sundanese, 140
+lepcha, 141
+olchiki, 142
+vai, 143
+saurashtra, 144
+kayahli, 145
+rejang, 146
+lycian, 147
+carian, 148
+lydian, 149
+cham, 150
+taitham, 151
+taiviet, 152
+avestan, 153
+egyptianhieroglyphs, 154
+samaritan, 155
+lisu, 156
+bamum, 157
+javanese, 158
+meeteimayek, 159
+imperialaramaic, 160
+oldsoutharabian, 161
+inscriptionalparthian, 162
+inscriptionalpahlavi, 163
+oldturkic, 164
+kaithi, 165
+batak, 166
+brahmi, 167
+mandaic, 168
+chakma, 169
+meroiticcursive, 170
+meroitichieroglyphs, 171
+miao, 172
+sharada, 173
+sorasompeng, 174
+takri, 175
+whitespace, 176
+bidicontrol, 177
+joincontrol, 178
+dash, 179
+hyphen, 180
+quotationmark, 181
+terminalpunctuation, 182
+othermath, 183
+hexdigit, 184
+asciihexdigit, 185
+otheralphabetic, 186
+ideographic, 187
+diacritic, 188
+extender, 189
+otherlowercase, 190
+otheruppercase, 191
+noncharactercodepoint, 192
+othergraphemeextend, 193
+idsbinaryoperator, 194
+idstrinaryoperator, 195
+radical, 196
+unifiedideograph, 197
+otherdefaultignorablecodepoint, 198
+deprecated, 199
+softdotted, 200
+logicalorderexception, 201
+otheridstart, 202
+otheridcontinue, 203
+sterm, 204
+variationselector, 205
+patternwhitespace, 206
+patternsyntax, 207
+unknown, 208
+ahex, 185
+bidic, 177
+ci, 60
+cwcf, 64
+cwcm, 65
+cwl, 61
+cwt, 63
+cwu, 62
+dep, 199
+di, 70
+dia, 188
+ext, 189
+grbase, 72
+grext, 71
+grlink, 73
+hex, 184
+idc, 67
+ideo, 187
+ids, 66
+idsb, 194
+idst, 195
+joinc, 178
+loe, 201
+nchar, 192
+oalpha, 186
+odi, 198
+ogrext, 193
+oidc, 203
+oids, 202
+olower, 190
+omath, 183
+oupper, 191
+patsyn, 207
+patws, 206
+qmark, 181
+sd, 200
+term, 182
+uideo, 197
+vs, 205
+wspace, 176
+xidc, 69
+xids, 68
+other, 17
+control, 18
+format, 19
+unassigned, 20
+privateuse, 21
+surrogate, 22
+letter, 23
+casedletter, 24
+lowercaseletter, 25
+modifierletter, 26
+otherletter, 27
+titlecaseletter, 28
+uppercaseletter, 29
+mark, 30
+combiningmark, 30
+spacingmark, 31
+enclosingmark, 32
+nonspacingmark, 33
+number, 34
+decimalnumber, 35
+letternumber, 36
+othernumber, 37
+punctuation, 38
+connectorpunctuation, 39
+dashpunctuation, 40
+closepunctuation, 41
+finalpunctuation, 42
+initialpunctuation, 43
+otherpunctuation, 44
+openpunctuation, 45
+symbol, 46
+currencysymbol, 47
+modifiersymbol, 48
+mathsymbol, 49
+othersymbol, 50
+separator, 51
+lineseparator, 52
+paragraphseparator, 53
+spaceseparator, 54
+arab, 80
+armi, 160
+armn, 78
+avst, 153
+bali, 135
+bamu, 157
+batk, 166
+beng, 84
+bopo, 108
+brah, 167
+brai, 126
+bugi, 127
+buhd, 117
+cakm, 169
+cans, 101
+cari, 148
+cher, 100
+copt, 128
+qaac, 128
+cprt, 125
+cyrl, 77
+deva, 83
+dsrt, 113
+egyp, 154
+ethi, 99
+geor, 97
+glag, 130
+goth, 112
+grek, 76
+gujr, 86
+guru, 85
+hang, 98
+hani, 109
+hano, 116
+hebr, 79
+hira, 106
+ital, 111
+java, 158
+kali, 145
+kana, 107
+khar, 134
+khmr, 104
+knda, 90
+kthi, 165
+lana, 151
+laoo, 94
+latn, 75
+lepc, 141
+limb, 119
+linb, 121
+lyci, 147
+lydi, 149
+mand, 168
+merc, 170
+mero, 171
+mlym, 91
+mong, 105
+mtei, 159
+mymr, 96
+nkoo, 139
+ogam, 102
+olck, 142
+orkh, 164
+orya, 87
+osma, 124
+phag, 138
+phli, 163
+phnx, 137
+plrd, 172
+prti, 162
+rjng, 146
+runr, 103
+samr, 155
+sarb, 161
+saur, 144
+shaw, 123
+shrd, 173
+sinh, 92
+sora, 174
+sund, 140
+sylo, 132
+syrc, 81
+tagb, 118
+takr, 175
+tale, 120
+talu, 129
+taml, 88
+tavt, 152
+telu, 89
+tfng, 131
+tglg, 115
+thaa, 82
+tibt, 95
+ugar, 122
+vaii, 143
+xpeo, 133
+xsux, 136
+yiii, 110
+zinh, 114
+qaai, 114
+zyyy, 74
+zzzz, 208
+age=1.1, 209
+age=2.0, 210
+age=2.1, 211
+age=3.0, 212
+age=3.1, 213
+age=3.2, 214
+age=4.0, 215
+age=4.1, 216
+age=5.0, 217
+age=5.1, 218
+age=5.2, 219
+age=6.0, 220
+age=6.1, 221
+inbasiclatin, 222
+inlatin1supplement, 223
+inlatinextendeda, 224
+inlatinextendedb, 225
+inipaextensions, 226
+inspacingmodifierletters, 227
+incombiningdiacriticalmarks, 228
+ingreekandcoptic, 229
+incyrillic, 230
+incyrillicsupplement, 231
+inarmenian, 232
+inhebrew, 233
+inarabic, 234
+insyriac, 235
+inarabicsupplement, 236
+inthaana, 237
+innko, 238
+insamaritan, 239
+inmandaic, 240
+inarabicextendeda, 241
+indevanagari, 242
+inbengali, 243
+ingurmukhi, 244
+ingujarati, 245
+inoriya, 246
+intamil, 247
+intelugu, 248
+inkannada, 249
+inmalayalam, 250
+insinhala, 251
+inthai, 252
+inlao, 253
+intibetan, 254
+inmyanmar, 255
+ingeorgian, 256
+inhanguljamo, 257
+inethiopic, 258
+inethiopicsupplement, 259
+incherokee, 260
+inunifiedcanadianaboriginalsyllabics, 261
+inogham, 262
+inrunic, 263
+intagalog, 264
+inhanunoo, 265
+inbuhid, 266
+intagbanwa, 267
+inkhmer, 268
+inmongolian, 269
+inunifiedcanadianaboriginalsyllabicsextended, 270
+inlimbu, 271
+intaile, 272
+innewtailue, 273
+inkhmersymbols, 274
+inbuginese, 275
+intaitham, 276
+inbalinese, 277
+insundanese, 278
+inbatak, 279
+inlepcha, 280
+inolchiki, 281
+insundanesesupplement, 282
+invedicextensions, 283
+inphoneticextensions, 284
+inphoneticextensionssupplement, 285
+incombiningdiacriticalmarkssupplement, 286
+inlatinextendedadditional, 287
+ingreekextended, 288
+ingeneralpunctuation, 289
+insuperscriptsandsubscripts, 290
+incurrencysymbols, 291
+incombiningdiacriticalmarksforsymbols, 292
+inletterlikesymbols, 293
+innumberforms, 294
+inarrows, 295
+inmathematicaloperators, 296
+inmiscellaneoustechnical, 297
+incontrolpictures, 298
+inopticalcharacterrecognition, 299
+inenclosedalphanumerics, 300
+inboxdrawing, 301
+inblockelements, 302
+ingeometricshapes, 303
+inmiscellaneoussymbols, 304
+indingbats, 305
+inmiscellaneousmathematicalsymbolsa, 306
+insupplementalarrowsa, 307
+inbraillepatterns, 308
+insupplementalarrowsb, 309
+inmiscellaneousmathematicalsymbolsb, 310
+insupplementalmathematicaloperators, 311
+inmiscellaneoussymbolsandarrows, 312
+inglagolitic, 313
+inlatinextendedc, 314
+incoptic, 315
+ingeorgiansupplement, 316
+intifinagh, 317
+inethiopicextended, 318
+incyrillicextendeda, 319
+insupplementalpunctuation, 320
+incjkradicalssupplement, 321
+inkangxiradicals, 322
+inideographicdescriptioncharacters, 323
+incjksymbolsandpunctuation, 324
+inhiragana, 325
+inkatakana, 326
+inbopomofo, 327
+inhangulcompatibilityjamo, 328
+inkanbun, 329
+inbopomofoextended, 330
+incjkstrokes, 331
+inkatakanaphoneticextensions, 332
+inenclosedcjklettersandmonths, 333
+incjkcompatibility, 334
+incjkunifiedideographsextensiona, 335
+inyijinghexagramsymbols, 336
+incjkunifiedideographs, 337
+inyisyllables, 338
+inyiradicals, 339
+inlisu, 340
+invai, 341
+incyrillicextendedb, 342
+inbamum, 343
+inmodifiertoneletters, 344
+inlatinextendedd, 345
+insylotinagri, 346
+incommonindicnumberforms, 347
+inphagspa, 348
+insaurashtra, 349
+indevanagariextended, 350
+inkayahli, 351
+inrejang, 352
+inhanguljamoextendeda, 353
+injavanese, 354
+incham, 355
+inmyanmarextendeda, 356
+intaiviet, 357
+inmeeteimayekextensions, 358
+inethiopicextendeda, 359
+inmeeteimayek, 360
+inhangulsyllables, 361
+inhanguljamoextendedb, 362
+inhighsurrogates, 363
+inhighprivateusesurrogates, 364
+inlowsurrogates, 365
+inprivateusearea, 366
+incjkcompatibilityideographs, 367
+inalphabeticpresentationforms, 368
+inarabicpresentationformsa, 369
+invariationselectors, 370
+inverticalforms, 371
+incombininghalfmarks, 372
+incjkcompatibilityforms, 373
+insmallformvariants, 374
+inarabicpresentationformsb, 375
+inhalfwidthandfullwidthforms, 376
+inspecials, 377
+inlinearbsyllabary, 378
+inlinearbideograms, 379
+inaegeannumbers, 380
+inancientgreeknumbers, 381
+inancientsymbols, 382
+inphaistosdisc, 383
+inlycian, 384
+incarian, 385
+inolditalic, 386
+ingothic, 387
+inugaritic, 388
+inoldpersian, 389
+indeseret, 390
+inshavian, 391
+inosmanya, 392
+incypriotsyllabary, 393
+inimperialaramaic, 394
+inphoenician, 395
+inlydian, 396
+inmeroitichieroglyphs, 397
+inmeroiticcursive, 398
+inkharoshthi, 399
+inoldsoutharabian, 400
+inavestan, 401
+ininscriptionalparthian, 402
+ininscriptionalpahlavi, 403
+inoldturkic, 404
+inruminumeralsymbols, 405
+inbrahmi, 406
+inkaithi, 407
+insorasompeng, 408
+inchakma, 409
+insharada, 410
+intakri, 411
+incuneiform, 412
+incuneiformnumbersandpunctuation, 413
+inegyptianhieroglyphs, 414
+inbamumsupplement, 415
+inmiao, 416
+inkanasupplement, 417
+inbyzantinemusicalsymbols, 418
+inmusicalsymbols, 419
+inancientgreekmusicalnotation, 420
+intaixuanjingsymbols, 421
+incountingrodnumerals, 422
+inmathematicalalphanumericsymbols, 423
+inarabicmathematicalalphabeticsymbols, 424
+inmahjongtiles, 425
+indominotiles, 426
+inplayingcards, 427
+inenclosedalphanumericsupplement, 428
+inenclosedideographicsupplement, 429
+inmiscellaneoussymbolsandpictographs, 430
+inemoticons, 431
+intransportandmapsymbols, 432
+inalchemicalsymbols, 433
+incjkunifiedideographsextensionb, 434
+incjkunifiedideographsextensionc, 435
+incjkunifiedideographsextensiond, 436
+incjkcompatibilityideographssupplement, 437
+intags, 438
+invariationselectorssupplement, 439
+insupplementaryprivateuseareaa, 440
+insupplementaryprivateuseareab, 441
+innoblock, 442
+#endif /* USE_UNICODE_PROPERTIES */
+%%
+static int
+uniname2ctype(const UChar *name, unsigned int len)
+{
+ const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len);
+ if (p) return p->ctype;
+ return -1;
+}
diff --git a/enc/unicode/name2ctype.src b/enc/unicode/name2ctype.src
new file mode 100644
index 0000000000..ff94d68b3b
--- /dev/null
+++ b/enc/unicode/name2ctype.src
@@ -0,0 +1,26550 @@
+%{
+#define long size_t
+
+/* 'NEWLINE': [[:NEWLINE:]] */
+static const OnigCodePoint CR_NEWLINE[] = {
+ 1,
+ 0x000a, 0x000a,
+}; /* CR_NEWLINE */
+
+/* 'Alpha': [[:Alpha:]] */
+static const OnigCodePoint CR_Alpha[] = {
+ 540,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x065f,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+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0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0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R_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a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+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1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, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0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
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 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0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x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+ 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,
+ 0x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eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27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 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,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0x2cca,
+ 0x2ccc, 0x2ccc,
+ 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0x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e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x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fc6,
+ 0x1000, 0x1049,
+ 0x1050, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b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xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d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R_Alnum[] = {
+ 566,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
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xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11066, 0x1106f,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,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ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alnum */
+
+/* 'ASCII': [[:ASCII:]] */
+static const OnigCodePoint CR_ASCII[] = {
+ 1,
+ 0x0000, 0x007f,
+}; /* CR_ASCII */
+
+#ifdef USE_UNICODE_PROPERTIES
+/* 'Any': - */
+static const OnigCodePoint CR_Any[] = {
+ 1,
+ 0x0000, 0x10ffff,
+}; /* CR_Any */
+
+/* 'Assigned': - */
+static const OnigCodePoint CR_Assigned[] = {
+ 539,
+ 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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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,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
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Assigned */
+
+/* 'C': Major Category */
+static const OnigCodePoint CR_C[] = {
+ 541,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+ 0x00ad, 0x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e2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfffb,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10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1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_C */
+
+/* 'Cc': General Category */
+#define CR_Cc CR_Cntrl
+
+/* 'Cf': General Category */
+static const OnigCodePoint CR_Cf[] = {
+ 14,
+ 0x00ad, 0x00ad,
+ 0x0600, 0x0604,
+ 0x06dd, 0x06dd,
+ 0x070f, 0x070f,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x2064,
+ 0x206a, 0x206f,
+ 0xfeff, 0xfeff,
+ 0xfff9, 0xfffb,
+ 0x110bd, 0x110bd,
+ 0x1d173, 0x1d17a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Cf */
+
+/* 'Cn': General Category */
+static const OnigCodePoint CR_Cn[] = {
+ 539,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x0605, 0x0605,
+ 0x061c, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+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x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246,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 0x1ee9c, 0x1eea0,
+ 0x1eea4, 0x1eea4,
+ 0x1eeaa, 0x1eeaa,
+ 0x1eebc, 0x1eeef,
+ 0x1eef2, 0x1efff,
+ 0x1f02c, 0x1f02f,
+ 0x1f094, 0x1f09f,
+ 0x1f0af, 0x1f0b0,
+ 0x1f0bf, 0x1f0c0,
+ 0x1f0d0, 0x1f0d0,
+ 0x1f0e0, 0x1f0ff,
+ 0x1f10b, 0x1f10f,
+ 0x1f12f, 0x1f12f,
+ 0x1f16c, 0x1f16f,
+ 0x1f19b, 0x1f1e5,
+ 0x1f203, 0x1f20f,
+ 0x1f23b, 0x1f23f,
+ 0x1f249, 0x1f24f,
+ 0x1f252, 0x1f2ff,
+ 0x1f321, 0x1f32f,
+ 0x1f336, 0x1f336,
+ 0x1f37d, 0x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Cn */
+
+/* 'Co': General Category */
+static const OnigCodePoint CR_Co[] = {
+ 3,
+ 0xe000, 0xf8ff,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Co */
+
+/* 'Cs': General Category */
+static const OnigCodePoint CR_Cs[] = {
+ 1,
+ 0xd800, 0xdfff,
+}; /* CR_Cs */
+
+/* 'L': Major Category */
+static const OnigCodePoint CR_L[] = {
+ 486,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+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
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1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 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_LC */
+
+/* 'Ll': General Category */
+static const OnigCodePoint CR_Ll[] = {
+ 611,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02af,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x04db,
+ 0x04dd, 0x04dd,
+ 0x04df, 0x04df,
+ 0x04e1, 0x04e1,
+ 0x04e3, 0x04e3,
+ 0x04e5, 0x04e5,
+ 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9,
+ 0x04eb, 0x04eb,
+ 0x04ed, 0x04ed,
+ 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1,
+ 0x04f3, 0x04f3,
+ 0x04f5, 0x04f5,
+ 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9,
+ 0x04fb, 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 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,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622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Ll */
+
+/* 'Lm': General Category */
+static const OnigCodePoint CR_Lm[] = {
+ 52,
+ 0x02b0, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0374, 0x0374,
+ 0x037a, 0x037a,
+ 0x0559, 0x0559,
+ 0x0640, 0x0640,
+ 0x06e5, 0x06e6,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0971, 0x0971,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x10fc, 0x10fc,
+ 0x17d7, 0x17d7,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c78, 0x1c7d,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2c7c, 0x2c7d,
+ 0x2d6f, 0x2d6f,
+ 0x2e2f, 0x2e2f,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x303b, 0x303b,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa4f8, 0xa4fd,
+ 0xa60c, 0xa60c,
+ 0xa67f, 0xa67f,
+ 0xa717, 0xa71f,
+ 0xa770, 0xa770,
+ 0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0x16f93, 0x16f9f,
+}; /* CR_Lm */
+
+/* 'Lo': General Category */
+static const OnigCodePoint CR_Lo[] = {
+ 371,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x01bb, 0x01bb,
+ 0x01c0, 0x01c3,
+ 0x0294, 0x0294,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x063f,
+ 0x0641, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x0800, 0x0815,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0972, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a59, 0x0a5c,
+ 0x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,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10450, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x1b000, 0x1b001,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Lo */
+
+/* 'Lt': General Category */
+static const OnigCodePoint CR_Lt[] = {
+ 10,
+ 0x01c5, 0x01c5,
+ 0x01c8, 0x01c8,
+ 0x01cb, 0x01cb,
+ 0x01f2, 0x01f2,
+ 0x1f88, 0x1f8f,
+ 0x1f98, 0x1f9f,
+ 0x1fa8, 0x1faf,
+ 0x1fbc, 0x1fbc,
+ 0x1fcc, 0x1fcc,
+ 0x1ffc, 0x1ffc,
+}; /* CR_Lt */
+
+/* 'Lu': General Category */
+static const OnigCodePoint CR_Lu[] = {
+ 608,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1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xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Lu */
+
+/* 'M': Major Category */
+static const OnigCodePoint CR_M[] = {
+ 204,
+ 0x0300, 0x036f,
+ 0x0483, 0x0489,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x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cf4,
+ 0x1dc0, 0x1de6,
+ 0x1dfc, 0x1dff,
+ 0x20d0, 0x20f0,
+ 0x2cef, 0x2cf1,
+ 0x2d7f, 0x2d7f,
+ 0x2de0, 0x2dff,
+ 0x302a, 0x302f,
+ 0x3099, 0x309a,
+ 0xa66f, 0xa672,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
+ 0xa6f0, 0xa6f1,
+ 0xa802, 0xa802,
+ 0xa806, 0xa806,
+ 0xa80b, 0xa80b,
+ 0xa823, 0xa827,
+ 0xa880, 0xa881,
+ 0xa8b4, 0xa8c4,
+ 0xa8e0, 0xa8f1,
+ 0xa926, 0xa92d,
+ 0xa947, 0xa953,
+ 0xa980, 0xa983,
+ 0xa9b3, 0xa9c0,
+ 0xaa29, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4d,
+ 0xaa7b, 0xaa7b,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf6,
+ 0xabe3, 0xabea,
+ 0xabec, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11046,
+ 0x11080, 0x11082,
+ 0x110b0, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x11134,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111c0,
+ 0x116ab, 0x116b7,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
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0x11082,
+ 0x110b0, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x1112c, 0x1112c,
+ 0x11182, 0x11182,
+ 0x111b3, 0x111b5,
+ 0x111bf, 0x111c0,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x16f51, 0x16f7e,
+ 0x1d165, 0x1d166,
+ 0x1d16d, 0x1d172,
+}; /* CR_Mc */
+
+/* 'Me': General Category */
+static const OnigCodePoint CR_Me[] = {
+ 4,
+ 0x0488, 0x0489,
+ 0x20dd, 0x20e0,
+ 0x20e2, 0x20e4,
+ 0xa670, 0xa672,
+}; /* CR_Me */
+
+/* 'Mn': General Category */
+static const OnigCodePoint CR_Mn[] = {
+ 220,
+ 0x0300, 0x036f,
+ 0x0483, 0x0487,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06df, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc,
+ 0x09c1, 0x09c4,
+ 0x09cd, 0x09cd,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a02,
+ 0x0a3c, 0x0a3c,
+ 0x0a41, 0x0a42,
+ 0x0a47, 0x0a48,
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099, 0x309a,
+ 0xa66f, 0xa66f,
+ 0xa674, 0xa67d,
+ 0xa69f, 0xa69f,
+ 0xa6f0, 0xa6f1,
+ 0xa802, 0xa802,
+ 0xa806, 0xa806,
+ 0xa80b, 0xa80b,
+ 0xa825, 0xa826,
+ 0xa8c4, 0xa8c4,
+ 0xa8e0, 0xa8f1,
+ 0xa926, 0xa92d,
+ 0xa947, 0xa951,
+ 0xa980, 0xa982,
+ 0xa9b3, 0xa9b3,
+ 0xa9b6, 0xa9b9,
+ 0xa9bc, 0xa9bc,
+ 0xaa29, 0xaa2e,
+ 0xaa31, 0xaa32,
+ 0xaa35, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4c,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Mn */
+
+/* 'N': Major Category */
+static const OnigCodePoint CR_N[] = {
+ 88,
+ 0x0030, 0x0039,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x09f4, 0x09f9,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0b72, 0x0b77,
+ 0x0be6, 0x0bf2,
+ 0x0c66, 0x0c6f,
+ 0x0c78, 0x0c7e,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d75,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f33,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x1369, 0x137c,
+ 0x16ee, 0x16f0,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19da,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x2182,
+ 0x2185, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa620, 0xa629,
+ 0xa6e6, 0xa6ef,
+ 0xa830, 0xa835,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x10107, 0x10133,
+ 0x10140, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x104a0, 0x104a9,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x12400, 0x12462,
+ 0x1d360, 0x1d371,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f100, 0x1f10a,
+}; /* CR_N */
+
+/* 'Nd': General Category */
+#define CR_Nd CR_Digit
+
+/* 'Nl': General Category */
+static const OnigCodePoint CR_Nl[] = {
+ 12,
+ 0x16ee, 0x16f0,
+ 0x2160, 0x2182,
+ 0x2185, 0x2188,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0xa6e6, 0xa6ef,
+ 0x10140, 0x10174,
+ 0x10341, 0x10341,
+ 0x1034a, 0x1034a,
+ 0x103d1, 0x103d5,
+ 0x12400, 0x12462,
+}; /* CR_Nl */
+
+/* 'No': General Category */
+static const OnigCodePoint CR_No[] = {
+ 42,
+ 0x00b2, 0x00b3,
+ 0x00b9, 0x00b9,
+ 0x00bc, 0x00be,
+ 0x09f4, 0x09f9,
+ 0x0b72, 0x0b77,
+ 0x0bf0, 0x0bf2,
+ 0x0c78, 0x0c7e,
+ 0x0d70, 0x0d75,
+ 0x0f2a, 0x0f33,
+ 0x1369, 0x137c,
+ 0x17f0, 0x17f9,
+ 0x19da, 0x19da,
+ 0x2070, 0x2070,
+ 0x2074, 0x2079,
+ 0x2080, 0x2089,
+ 0x2150, 0x215f,
+ 0x2189, 0x2189,
+ 0x2460, 0x249b,
+ 0x24ea, 0x24ff,
+ 0x2776, 0x2793,
+ 0x2cfd, 0x2cfd,
+ 0x3192, 0x3195,
+ 0x3220, 0x3229,
+ 0x3248, 0x324f,
+ 0x3251, 0x325f,
+ 0x3280, 0x3289,
+ 0x32b1, 0x32bf,
+ 0xa830, 0xa835,
+ 0x10107, 0x10133,
+ 0x10175, 0x10178,
+ 0x1018a, 0x1018a,
+ 0x10320, 0x10323,
+ 0x10858, 0x1085f,
+ 0x10916, 0x1091b,
+ 0x10a40, 0x10a47,
+ 0x10a7d, 0x10a7e,
+ 0x10b58, 0x10b5f,
+ 0x10b78, 0x10b7f,
+ 0x10e60, 0x10e7e,
+ 0x11052, 0x11065,
+ 0x1d360, 0x1d371,
+ 0x1f100, 0x1f10a,
+}; /* CR_No */
+
+/* 'P': Major Category */
+#define CR_P CR_Punct
+
+/* 'Pc': General Category */
+static const OnigCodePoint CR_Pc[] = {
+ 6,
+ 0x005f, 0x005f,
+ 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xff3f, 0xff3f,
+}; /* CR_Pc */
+
+/* 'Pd': General Category */
+static const OnigCodePoint CR_Pd[] = {
+ 16,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Pd */
+
+/* 'Pe': General Category */
+static const OnigCodePoint CR_Pe[] = {
+ 70,
+ 0x0029, 0x0029,
+ 0x005d, 0x005d,
+ 0x007d, 0x007d,
+ 0x0f3b, 0x0f3b,
+ 0x0f3d, 0x0f3d,
+ 0x169c, 0x169c,
+ 0x2046, 0x2046,
+ 0x207e, 0x207e,
+ 0x208e, 0x208e,
+ 0x232a, 0x232a,
+ 0x2769, 0x2769,
+ 0x276b, 0x276b,
+ 0x276d, 0x276d,
+ 0x276f, 0x276f,
+ 0x2771, 0x2771,
+ 0x2773, 0x2773,
+ 0x2775, 0x2775,
+ 0x27c6, 0x27c6,
+ 0x27e7, 0x27e7,
+ 0x27e9, 0x27e9,
+ 0x27eb, 0x27eb,
+ 0x27ed, 0x27ed,
+ 0x27ef, 0x27ef,
+ 0x2984, 0x2984,
+ 0x2986, 0x2986,
+ 0x2988, 0x2988,
+ 0x298a, 0x298a,
+ 0x298c, 0x298c,
+ 0x298e, 0x298e,
+ 0x2990, 0x2990,
+ 0x2992, 0x2992,
+ 0x2994, 0x2994,
+ 0x2996, 0x2996,
+ 0x2998, 0x2998,
+ 0x29d9, 0x29d9,
+ 0x29db, 0x29db,
+ 0x29fd, 0x29fd,
+ 0x2e23, 0x2e23,
+ 0x2e25, 0x2e25,
+ 0x2e27, 0x2e27,
+ 0x2e29, 0x2e29,
+ 0x3009, 0x3009,
+ 0x300b, 0x300b,
+ 0x300d, 0x300d,
+ 0x300f, 0x300f,
+ 0x3011, 0x3011,
+ 0x3015, 0x3015,
+ 0x3017, 0x3017,
+ 0x3019, 0x3019,
+ 0x301b, 0x301b,
+ 0x301e, 0x301f,
+ 0xfd3f, 0xfd3f,
+ 0xfe18, 0xfe18,
+ 0xfe36, 0xfe36,
+ 0xfe38, 0xfe38,
+ 0xfe3a, 0xfe3a,
+ 0xfe3c, 0xfe3c,
+ 0xfe3e, 0xfe3e,
+ 0xfe40, 0xfe40,
+ 0xfe42, 0xfe42,
+ 0xfe44, 0xfe44,
+ 0xfe48, 0xfe48,
+ 0xfe5a, 0xfe5a,
+ 0xfe5c, 0xfe5c,
+ 0xfe5e, 0xfe5e,
+ 0xff09, 0xff09,
+ 0xff3d, 0xff3d,
+ 0xff5d, 0xff5d,
+ 0xff60, 0xff60,
+ 0xff63, 0xff63,
+}; /* CR_Pe */
+
+/* 'Pf': General Category */
+static const OnigCodePoint CR_Pf[] = {
+ 10,
+ 0x00bb, 0x00bb,
+ 0x2019, 0x2019,
+ 0x201d, 0x201d,
+ 0x203a, 0x203a,
+ 0x2e03, 0x2e03,
+ 0x2e05, 0x2e05,
+ 0x2e0a, 0x2e0a,
+ 0x2e0d, 0x2e0d,
+ 0x2e1d, 0x2e1d,
+ 0x2e21, 0x2e21,
+}; /* CR_Pf */
+
+/* 'Pi': General Category */
+static const OnigCodePoint CR_Pi[] = {
+ 11,
+ 0x00ab, 0x00ab,
+ 0x2018, 0x2018,
+ 0x201b, 0x201c,
+ 0x201f, 0x201f,
+ 0x2039, 0x2039,
+ 0x2e02, 0x2e02,
+ 0x2e04, 0x2e04,
+ 0x2e09, 0x2e09,
+ 0x2e0c, 0x2e0c,
+ 0x2e1c, 0x2e1c,
+ 0x2e20, 0x2e20,
+}; /* CR_Pi */
+
+/* 'Po': General Category */
+static const OnigCodePoint CR_Po[] = {
+ 135,
+ 0x0021, 0x0023,
+ 0x0025, 0x0027,
+ 0x002a, 0x002a,
+ 0x002c, 0x002c,
+ 0x002e, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005c, 0x005c,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00b6, 0x00b7,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x0589,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+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0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe10, 0xfe16,
+ 0xfe19, 0xfe19,
+ 0xfe30, 0xfe30,
+ 0xfe45, 0xfe46,
+ 0xfe49, 0xfe4c,
+ 0xfe50, 0xfe52,
+ 0xfe54, 0xfe57,
+ 0xfe5f, 0xfe61,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff07,
+ 0xff0a, 0xff0a,
+ 0xff0c, 0xff0c,
+ 0xff0e, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3c, 0xff3c,
+ 0xff61, 0xff61,
+ 0xff64, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Po */
+
+/* 'Ps': General Category */
+static const OnigCodePoint CR_Ps[] = {
+ 72,
+ 0x0028, 0x0028,
+ 0x005b, 0x005b,
+ 0x007b, 0x007b,
+ 0x0f3a, 0x0f3a,
+ 0x0f3c, 0x0f3c,
+ 0x169b, 0x169b,
+ 0x201a, 0x201a,
+ 0x201e, 0x201e,
+ 0x2045, 0x2045,
+ 0x207d, 0x207d,
+ 0x208d, 0x208d,
+ 0x2329, 0x2329,
+ 0x2768, 0x2768,
+ 0x276a, 0x276a,
+ 0x276c, 0x276c,
+ 0x276e, 0x276e,
+ 0x2770, 0x2770,
+ 0x2772, 0x2772,
+ 0x2774, 0x2774,
+ 0x27c5, 0x27c5,
+ 0x27e6, 0x27e6,
+ 0x27e8, 0x27e8,
+ 0x27ea, 0x27ea,
+ 0x27ec, 0x27ec,
+ 0x27ee, 0x27ee,
+ 0x2983, 0x2983,
+ 0x2985, 0x2985,
+ 0x2987, 0x2987,
+ 0x2989, 0x2989,
+ 0x298b, 0x298b,
+ 0x298d, 0x298d,
+ 0x298f, 0x298f,
+ 0x2991, 0x2991,
+ 0x2993, 0x2993,
+ 0x2995, 0x2995,
+ 0x2997, 0x2997,
+ 0x29d8, 0x29d8,
+ 0x29da, 0x29da,
+ 0x29fc, 0x29fc,
+ 0x2e22, 0x2e22,
+ 0x2e24, 0x2e24,
+ 0x2e26, 0x2e26,
+ 0x2e28, 0x2e28,
+ 0x3008, 0x3008,
+ 0x300a, 0x300a,
+ 0x300c, 0x300c,
+ 0x300e, 0x300e,
+ 0x3010, 0x3010,
+ 0x3014, 0x3014,
+ 0x3016, 0x3016,
+ 0x3018, 0x3018,
+ 0x301a, 0x301a,
+ 0x301d, 0x301d,
+ 0xfd3e, 0xfd3e,
+ 0xfe17, 0xfe17,
+ 0xfe35, 0xfe35,
+ 0xfe37, 0xfe37,
+ 0xfe39, 0xfe39,
+ 0xfe3b, 0xfe3b,
+ 0xfe3d, 0xfe3d,
+ 0xfe3f, 0xfe3f,
+ 0xfe41, 0xfe41,
+ 0xfe43, 0xfe43,
+ 0xfe47, 0xfe47,
+ 0xfe59, 0xfe59,
+ 0xfe5b, 0xfe5b,
+ 0xfe5d, 0xfe5d,
+ 0xff08, 0xff08,
+ 0xff3b, 0xff3b,
+ 0xff5b, 0xff5b,
+ 0xff5f, 0xff5f,
+ 0xff62, 0xff62,
+}; /* CR_Ps */
+
+/* 'S': Major Category */
+static const OnigCodePoint CR_S[] = {
+ 198,
+ 0x0024, 0x0024,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00a2, 0x00a6,
+ 0x00a8, 0x00a9,
+ 0x00ac, 0x00ac,
+ 0x00ae, 0x00b1,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x03f6, 0x03f6,
+ 0x0482, 0x0482,
+ 0x058f, 0x058f,
+ 0x0606, 0x0608,
+ 0x060b, 0x060b,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09f2, 0x09f3,
+ 0x09fa, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 0x0bfa,
+ 0x0c7f, 0x0c7f,
+ 0x0d79, 0x0d79,
+ 0x0e3f, 0x0e3f,
+ 0x0f01, 0x0f03,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
+ 0x0f1a, 0x0f1f,
+ 0x0f34, 0x0f34,
+ 0x0f36, 0x0f36,
+ 0x0f38, 0x0f38,
+ 0x0fbe, 0x0fc5,
+ 0x0fc7, 0x0fcc,
+ 0x0fce, 0x0fcf,
+ 0x0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x17db, 0x17db,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x20a0, 0x20b9,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2118,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x2140, 0x2144,
+ 0x214a, 0x214d,
+ 0x214f, 0x214f,
+ 0x2190, 0x2328,
+ 0x232b, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x26ff,
+ 0x2701, 0x2767,
+ 0x2794, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x2982,
+ 0x2999, 0x29d7,
+ 0x29dc, 0x29fb,
+ 0x29fe, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x309b, 0x309c,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa490, 0xa4c6,
+ 0xa700,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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,
+}; /* CR_S */
+
+/* 'Sc': General Category */
+static const OnigCodePoint CR_Sc[] = {
+ 17,
+ 0x0024, 0x0024,
+ 0x00a2, 0x00a5,
+ 0x058f, 0x058f,
+ 0x060b, 0x060b,
+ 0x09f2, 0x09f3,
+ 0x09fb, 0x09fb,
+ 0x0af1, 0x0af1,
+ 0x0bf9, 0x0bf9,
+ 0x0e3f, 0x0e3f,
+ 0x17db, 0x17db,
+ 0x20a0, 0x20b9,
+ 0xa838, 0xa838,
+ 0xfdfc, 0xfdfc,
+ 0xfe69, 0xfe69,
+ 0xff04, 0xff04,
+ 0xffe0, 0xffe1,
+ 0xffe5, 0xffe6,
+}; /* CR_Sc */
+
+/* 'Sk': General Category */
+static const OnigCodePoint CR_Sk[] = {
+ 27,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b8, 0x00b8,
+ 0x02c2, 0x02c5,
+ 0x02d2, 0x02df,
+ 0x02e5, 0x02eb,
+ 0x02ed, 0x02ed,
+ 0x02ef, 0x02ff,
+ 0x0375, 0x0375,
+ 0x0384, 0x0385,
+ 0x1fbd, 0x1fbd,
+ 0x1fbf, 0x1fc1,
+ 0x1fcd, 0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x309b, 0x309c,
+ 0xa700, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,
+ 0xfbb2, 0xfbc1,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xffe3, 0xffe3,
+}; /* CR_Sk */
+
+/* 'Sm': General Category */
+static const OnigCodePoint CR_Sm[] = {
+ 65,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03f6, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x207a, 0x207c,
+ 0x208a, 0x208c,
+ 0x2118, 0x2118,
+ 0x2140, 0x2144,
+ 0x214b, 0x214b,
+ 0x2190, 0x2194,
+ 0x219a, 0x219b,
+ 0x21a0, 0x21a0,
+ 0x21a3, 0x21a3,
+ 0x21a6, 0x21a6,
+ 0x21ae, 0x21ae,
+ 0x21ce, 0x21cf,
+ 0x21d2, 0x21d2,
+ 0x21d4, 0x21d4,
+ 0x21f4, 0x22ff,
+ 0x2308, 0x230b,
+ 0x2320, 0x2321,
+ 0x237c, 0x237c,
+ 0x239b, 0x23b3,
+ 0x23dc, 0x23e1,
+ 0x25b7, 0x25b7,
+ 0x25c1, 0x25c1,
+ 0x25f8, 0x25ff,
+ 0x266f, 0x266f,
+ 0x27c0, 0x27c4,
+ 0x27c7, 0x27e5,
+ 0x27f0, 0x27ff,
+ 0x2900, 0x2982,
+ 0x2999, 0x29d7,
+ 0x29dc, 0x29fb,
+ 0x29fe, 0x2aff,
+ 0x2b30, 0x2b44,
+ 0x2b47, 0x2b4c,
+ 0xfb29, 0xfb29,
+ 0xfe62, 0xfe62,
+ 0xfe64, 0xfe66,
+ 0xff0b, 0xff0b,
+ 0xff1c, 0xff1e,
+ 0xff5c, 0xff5c,
+ 0xff5e, 0xff5e,
+ 0xffe2, 0xffe2,
+ 0xffe9, 0xffec,
+ 0x1d6c1, 0x1d6c1,
+ 0x1d6db, 0x1d6db,
+ 0x1d6fb, 0x1d6fb,
+ 0x1d715, 0x1d715,
+ 0x1d735, 0x1d735,
+ 0x1d74f, 0x1d74f,
+ 0x1d76f, 0x1d76f,
+ 0x1d789, 0x1d789,
+ 0x1d7a9, 0x1d7a9,
+ 0x1d7c3, 0x1d7c3,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Sm */
+
+/* 'So': General Category */
+static const OnigCodePoint CR_So[] = {
+ 153,
+ 0x00a6, 0x00a6,
+ 0x00a9, 0x00a9,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b0,
+ 0x0482, 0x0482,
+ 0x060e, 0x060f,
+ 0x06de, 0x06de,
+ 0x06e9, 0x06e9,
+ 0x06fd, 0x06fe,
+ 0x07f6, 0x07f6,
+ 0x09fa, 0x09fa,
+ 0x0b70, 0x0b70,
+ 0x0bf3, 0x0bf8,
+ 0x0bfa, 0x0bfa,
+ 0x0c7f, 0x0c7f,
+ 0x0d79, 0x0d79,
+ 0x0f01, 0x0f03,
+ 0x0f13, 0x0f13,
+ 0x0f15, 0x0f17,
+ 0x0f1a, 0x0f1f,
+ 0x0f34, 0x0f34,
+ 0x0f36, 0x0f36,
+ 0x0f38, 0x0f38,
+ 0x0fbe, 0x0fc5,
+ 0x0fc7, 0x0fcc,
+ 0x0fce, 0x0fcf,
+ 0x0fd5, 0x0fd8,
+ 0x109e, 0x109f,
+ 0x1390, 0x1399,
+ 0x1940, 0x1940,
+ 0x19de, 0x19ff,
+ 0x1b61, 0x1b6a,
+ 0x1b74, 0x1b7c,
+ 0x2100, 0x2101,
+ 0x2103, 0x2106,
+ 0x2108, 0x2109,
+ 0x2114, 0x2114,
+ 0x2116, 0x2117,
+ 0x211e, 0x2123,
+ 0x2125, 0x2125,
+ 0x2127, 0x2127,
+ 0x2129, 0x2129,
+ 0x212e, 0x212e,
+ 0x213a, 0x213b,
+ 0x214a, 0x214a,
+ 0x214c, 0x214d,
+ 0x214f, 0x214f,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21ad,
+ 0x21af, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21f3,
+ 0x2300, 0x2307,
+ 0x230c, 0x231f,
+ 0x2322, 0x2328,
+ 0x232b, 0x237b,
+ 0x237d, 0x239a,
+ 0x23b4, 0x23db,
+ 0x23e2, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x249c, 0x24e9,
+ 0x2500, 0x25b6,
+ 0x25b8, 0x25c0,
+ 0x25c2, 0x25f7,
+ 0x2600, 0x266e,
+ 0x2670, 0x26ff,
+ 0x2701, 0x2767,
+ 0x2794, 0x27bf,
+ 0x2800, 0x28ff,
+ 0x2b00, 0x2b2f,
+ 0x2b45, 0x2b46,
+ 0x2b50, 0x2b59,
+ 0x2ce5, 0x2cea,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3004, 0x3004,
+ 0x3012, 0x3013,
+ 0x3020, 0x3020,
+ 0x3036, 0x3037,
+ 0x303e, 0x303f,
+ 0x3190, 0x3191,
+ 0x3196, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3200, 0x321e,
+ 0x322a, 0x3247,
+ 0x3250, 0x3250,
+ 0x3260, 0x327f,
+ 0x328a, 0x32b0,
+ 0x32c0, 0x32fe,
+ 0x3300, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa490, 0xa4c6,
+ 0xa828, 0xa82b,
+ 0xa836, 0xa837,
+ 0xa839, 0xa839,
+ 0xaa77, 0xaa79,
+ 0xfdfd, 0xfdfd,
+ 0xffe4, 0xffe4,
+ 0xffe8, 0xffe8,
+ 0xffed, 0xffee,
+ 0xfffc, 0xfffd,
+ 0x10137, 0x1013f,
+ 0x10179, 0x10189,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d164,
+ 0x1d16a, 0x1d16c,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d200, 0x1d241,
+ 0x1d245, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 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,
+}; /* CR_So */
+
+/* 'Z': Major Category */
+static const OnigCodePoint CR_Z[] = {
+ 9,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Z */
+
+/* 'Zl': General Category */
+static const OnigCodePoint CR_Zl[] = {
+ 1,
+ 0x2028, 0x2028,
+}; /* CR_Zl */
+
+/* 'Zp': General Category */
+static const OnigCodePoint CR_Zp[] = {
+ 1,
+ 0x2029, 0x2029,
+}; /* CR_Zp */
+
+/* 'Zs': General Category */
+static const OnigCodePoint CR_Zs[] = {
+ 8,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Zs */
+
+/* 'Math': Derived Property */
+static const OnigCodePoint CR_Math[] = {
+ 138,
+ 0x002b, 0x002b,
+ 0x003c, 0x003e,
+ 0x005e, 0x005e,
+ 0x007c, 0x007c,
+ 0x007e, 0x007e,
+ 0x00ac, 0x00ac,
+ 0x00b1, 0x00b1,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f6,
+ 0x0606, 0x0608,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2044, 0x2044,
+ 0x2052, 0x2052,
+ 0x2061, 0x2064,
+ 0x207a, 0x207e,
+ 0x208a, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2118, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x2149,
+ 0x214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
+ 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,
+}; /* CR_Math */
+
+/* 'Alphabetic': Derived Property */
+#define CR_Alphabetic CR_Alpha
+
+/* 'Lowercase': Derived Property */
+#define CR_Lowercase CR_Lower
+
+/* 'Uppercase': Derived Property */
+#define CR_Uppercase CR_Upper
+
+/* 'Cased': Derived Property */
+static const OnigCodePoint CR_Cased[] = {
+ 119,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 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R_Case_Ignorable[] = {
+ 295,
+ 0x0027, 0x0027,
+ 0x002e, 0x002e,
+ 0x003a, 0x003a,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00ad, 0x00ad,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0387, 0x0387,
+ 0x0483, 0x0489,
+ 0x0559, 0x0559,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05f4, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0610, 0x061a,
+ 0x0640, 0x0640,
+ 0x064b, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dd,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x070f, 0x070f,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0816, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951, 0x0957,
+ 0x0962, 0x0963,
+ 0x0971, 0x0971,
+ 0x0981, 0x0981,
+ 0x09bc, 0x09bc,
+ 0x09c1, 0x09c4,
+ 0x09cd, 0x09cd,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a02,
+ 0x0a3c, 0x0a3c,
+ 0x0a41, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a82,
+ 0x0abc, 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xaadd,
+ 0xaaec, 0xaaed,
+ 0xaaf3, 0xaaf4,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfbb2, 0xfbc1,
+ 0xfe00, 0xfe0f,
+ 0xfe13, 0xfe13,
+ 0xfe20, 0xfe26,
+ 0xfe52, 0xfe52,
+ 0xfe55, 0xfe55,
+ 0xfeff, 0xfeff,
+ 0xff07, 0xff07,
+ 0xff0e, 0xff0e,
+ 0xff1a, 0xff1a,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe3, 0xffe3,
+ 0xfff9, 0xfffb,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x110bd, 0x110bd,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f9f,
+ 0x1d167, 0x1d169,
+ 0x1d173, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Case_Ignorable */
+
+/* 'Changes_When_Lowercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Lowercased[] = {
+ 571,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+ 0x04f4, 0x04f4,
+ 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8,
+ 0x04fa, 0x04fa,
+ 0x04fc, 0x04fc,
+ 0x04fe, 0x04fe,
+ 0x0500, 0x0500,
+ 0x0502, 0x0502,
+ 0x0504, 0x0504,
+ 0x0506, 0x0506,
+ 0x0508, 0x0508,
+ 0x050a, 0x050a,
+ 0x050c, 0x050c,
+ 0x050e, 0x050e,
+ 0x0510, 0x0510,
+ 0x0512, 0x0512,
+ 0x0514, 0x0514,
+ 0x0516, 0x0516,
+ 0x0518, 0x0518,
+ 0x051a, 0x051a,
+ 0x051c, 0x051c,
+ 0x051e, 0x051e,
+ 0x0520, 0x0520,
+ 0x0522, 0x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a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Lowercased */
+
+/* 'Changes_When_Uppercased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Uppercased[] = {
+ 586,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c5, 0x01c6,
+ 0x01c8, 0x01c9,
+ 0x01cb, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f2, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
+ 0x0493, 0x0493,
+ 0x0495, 0x0495,
+ 0x0497, 0x0497,
+ 0x0499, 0x0499,
+ 0x049b, 0x049b,
+ 0x049d, 0x049d,
+ 0x049f, 0x049f,
+ 0x04a1, 0x04a1,
+ 0x04a3, 0x04a3,
+ 0x04a5, 0x04a5,
+ 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9,
+ 0x04ab, 0x04ab,
+ 0x04ad, 0x04ad,
+ 0x04af, 0x04af,
+ 0x04b1, 0x04b1,
+ 0x04b3, 0x04b3,
+ 0x04b5, 0x04b5,
+ 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9,
+ 0x04bb, 0x04bb,
+ 0x04bd, 0x04bd,
+ 0x04bf, 0x04bf,
+ 0x04c2, 0x04c2,
+ 0x04c4, 0x04c4,
+ 0x04c6, 0x04c6,
+ 0x04c8, 0x04c8,
+ 0x04ca, 0x04ca,
+ 0x04cc, 0x04cc,
+ 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1,
+ 0x04d3, 0x04d3,
+ 0x04d5, 0x04d5,
+ 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9,
+ 0x04db, 0x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
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Uppercased */
+
+/* 'Changes_When_Titlecased': Derived Property */
+static const OnigCodePoint CR_Changes_When_Titlecased[] = {
+ 587,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0137,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018c,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019a,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01b9,
+ 0x01bd, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x01c4,
+ 0x01c6, 0x01c7,
+ 0x01c9, 0x01ca,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f1,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0233,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037b, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f2,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fb,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 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a643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa72f,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa76f,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+}; /* CR_Changes_When_Titlecased */
+
+/* 'Changes_When_Casefolded': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casefolded[] = {
+ 582,
+ 0x0041, 0x005a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00df,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x0149, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x017f, 0x017f,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c5,
+ 0x01c7, 0x01c8,
+ 0x01ca, 0x01cb,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f2,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0345, 0x0345,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03c2, 0x03c2,
+ 0x03cf, 0x03d1,
+ 0x03d5, 0x03d6,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 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a722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+}; /* CR_Changes_When_Casefolded */
+
+/* 'Changes_When_Casemapped': Derived Property */
+static const OnigCodePoint CR_Changes_When_Casemapped[] = {
+ 104,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x0137,
+ 0x0139, 0x018c,
+ 0x018e, 0x019a,
+ 0x019c, 0x01a9,
+ 0x01ac, 0x01b9,
+ 0x01bc, 0x01bd,
+ 0x01bf, 0x01bf,
+ 0x01c4, 0x0220,
+ 0x0222, 0x0233,
+ 0x023a, 0x0254,
+ 0x0256, 0x0257,
+ 0x0259, 0x0259,
+ 0x025b, 0x025b,
+ 0x0260, 0x0260,
+ 0x0263, 0x0263,
+ 0x0265, 0x0266,
+ 0x0268, 0x0269,
+ 0x026b, 0x026b,
+ 0x026f, 0x026f,
+ 0x0271, 0x0272,
+ 0x0275, 0x0275,
+ 0x027d, 0x027d,
+ 0x0280, 0x0280,
+ 0x0283, 0x0283,
+ 0x0288, 0x028c,
+ 0x0292, 0x0292,
+ 0x0345, 0x0345,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03d1,
+ 0x03d5, 0x03f2,
+ 0x03f4, 0x03f5,
+ 0x03f7, 0x03fb,
+ 0x03fd, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d79, 0x1d79,
+ 0x1d7d, 0x1d7d,
+ 0x1e00, 0x1e9b,
+ 0x1e9e, 0x1e9e,
+ 0x1ea0, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2126, 0x2126,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x217f,
+ 0x2183, 0x2184,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2c70,
+ 0x2c72, 0x2c73,
+ 0x2c75, 0x2c76,
+ 0x2c7e, 0x2ce3,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa72f,
+ 0xa732, 0xa76f,
+ 0xa779, 0xa787,
+ 0xa78b, 0xa78d,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+}; /* CR_Changes_When_Casemapped */
+
+/* 'ID_Start': Derived Property */
+static const OnigCodePoint CR_ID_Start[] = {
+ 488,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x0671, 0x06d3,
+ 0x06d5, 0x06d5,
+ 0x06e5, 0x06e6,
+ 0x06ee, 0x06ef,
+ 0x06fa, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07ca, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0904, 0x0939,
+ 0x093d, 0x093d,
+ 0x0950, 0x0950,
+ 0x0958, 0x0961,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09f0, 0x09f1,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a72, 0x0a74,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a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10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 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,
+ 0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{
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0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+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400,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,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_ID_Continue */
+
+/* 'XID_Start': Derived Property */
+static const OnigCodePoint CR_XID_Start[] = {
+ 495,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2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 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb0,
+ 0x0eb2, 0x0eb2,
+ 0x0ebd, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f88, 0x0f8c,
+ 0x1000, 0x102a,
+ 0x103f, 0x103f,
+ 0x1050, 0x1055,
+ 0x105a, 0x105d,
+ 0x1061, 0x1061,
+ 0x1065, 0x1066,
+ 0x106e, 0x1070,
+ 0x1075, 0x1081,
+ 0x108e, 0x108e,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1711,
+ 0x1720, 0x1731,
+ 0x1740, 0x1751,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1780, 0x17b3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a8,
+ 0x18aa, 0x18aa,
+ 0x18b0, 0x18f5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0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11003, 0x11037,
+ 0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,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+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00b7, 0x00b7,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0487,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06df, 0x06e8,
+ 0x06ea, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0840, 0x085b,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09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 0x203f, 0x2040,
+ 0x2054, 0x2054,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20f0,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2118, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d6f,
+ 0x2d7f, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0x2de0, 0x2dff,
+ 0x3005, 0x3007,
+ 0x3021, 0x302f,
+ 0x3031, 0x3035,
+ 0x3038, 0x303c,
+ 0x3041, 0x3096,
+ 0x3099, 0x309a,
+ 0x309d, 0x309f,
+ 0x30a1, 0x30fa,
+ 0x30fc, 0x30ff,
+ 0x3105, 0x312d,
+ 0x3131, 0x318e,
+ 0x31a0, 0x31ba,
+ 0x31f0, 0x31ff,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xa000, 0xa48c,
+ 0xa4d0, 0xa4fd,
+ 0xa500, 0xa60c,
+ 0xa610, 0xa62b,
+ 0xa640, 0xa66f,
+ 0xa674, 0xa67d,
+ 0xa67f, 0xa697,
+ 0xa69f, 0xa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0xfe79, 0xfe79,
+ 0xfe7b, 0xfe7b,
+ 0xfe7d, 0xfe7d,
+ 0xfe7f, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0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ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0100, 0xe01ef,
+}; /* CR_XID_Continue */
+
+/* 'Default_Ignorable_Code_Point': Derived Property */
+static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = {
+ 15,
+ 0x00ad, 0x00ad,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x180b, 0x180d,
+ 0x200b, 0x200f,
+ 0x202a, 0x202e,
+ 0x2060, 0x206f,
+ 0x3164, 0x3164,
+ 0xfe00, 0xfe0f,
+ 0xfeff, 0xfeff,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0x1d173, 0x1d17a,
+ 0xe0000, 0xe0fff,
+}; /* CR_Default_Ignorable_Code_Point */
+
+/* 'Grapheme_Extend': Derived Property */
+static const OnigCodePoint CR_Grapheme_Extend[] = {
+ 232,
+ 0x0300, 0x036f,
+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b3,
+ 0xa9b6, 0xa9b9,
+ 0xa9bc, 0xa9bc,
+ 0xaa29, 0xaa2e,
+ 0xaa31, 0xaa32,
+ 0xaa35, 0xaa36,
+ 0xaa43, 0xaa43,
+ 0xaa4c, 0xaa4c,
+ 0xaab0, 0xaab0,
+ 0xaab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabf,
+ 0xaac1, 0xaac1,
+ 0xaaec, 0xaaed,
+ 0xaaf6, 0xaaf6,
+ 0xabe5, 0xabe5,
+ 0xabe8, 0xabe8,
+ 0xabed, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xff9e, 0xff9f,
+ 0x101fd, 0x101fd,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x11001, 0x11001,
+ 0x11038, 0x11046,
+ 0x11080, 0x11081,
+ 0x110b3, 0x110b6,
+ 0x110b9, 0x110ba,
+ 0x11100, 0x11102,
+ 0x11127, 0x1112b,
+ 0x1112d, 0x11134,
+ 0x11180, 0x11181,
+ 0x111b6, 0x111be,
+ 0x116ab, 0x116ab,
+ 0x116ad, 0x116ad,
+ 0x116b0, 0x116b5,
+ 0x116b7, 0x116b7,
+ 0x16f8f, 0x16f92,
+ 0x1d165, 0x1d165,
+ 0x1d167, 0x1d169,
+ 0x1d16e, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0xe0100, 0xe01ef,
+}; /* CR_Grapheme_Extend */
+
+/* 'Grapheme_Base': Derived Property */
+static const OnigCodePoint CR_Grapheme_Base[] = {
+ 643,
+ 0x0020, 0x007e,
+ 0x00a0, 0x00ac,
+ 0x00ae, 0x02ff,
+ 0x0370, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0482,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0606, 0x060f,
+ 0x061b, 0x061b,
+ 0x061e, 0x064a,
+ 0x0660, 0x066f,
+ 0x0671, 0x06d5,
+ 0x06de, 0x06de,
+ 0x06e5, 0x06e6,
+ 0x06e9, 0x06e9,
+ 0x06ee, 0x070d,
+ 0x0710, 0x0710,
+ 0x0712, 0x072f,
+ 0x074d, 0x07a5,
+ 0x07b1, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07fa,
+ 0x0800, 0x0815,
+ 0x081a, 0x081a,
+ 0x0824, 0x0824,
+ 0x0828, 0x0828,
+ 0x0830, 0x083e,
+ 0x0840, 0x0858,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x0903, 0x0939,
+ 0x093b, 0x093b,
+ 0x093d, 0x0940,
+ 0x0949, 0x094c,
+ 0x094e, 0x0950,
+ 0x0958, 0x0961,
+ 0x0964, 0x0977,
+ 0x0979, 0x097f,
+ 0x0982, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09bd,
+ 0x09bf, 0x09c0,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e1,
+ 0x09e6, 0x09fb,
+ 0x0a03, 0x0a03,
+ 0x0a05, 0x0a0a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, 0xabe4,
+ 0xabe6, 0xabe7,
+ 0xabe9, 0xabec,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb1d,
+ 0xfb1f, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff01, 0xff9d,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffc, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 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, 0x10a00,
+ 0x10a10, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a40, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x11000,
+ 0x11002, 0x11037,
+ 0x11047, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11082, 0x110b2,
+ 0x110b7, 0x110b8,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11103, 0x11126,
+ 0x1112c, 0x1112c,
+ 0x11136, 0x11143,
+ 0x11182, 0x111b5,
+ 0x111bf, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116aa,
+ 0x116ac, 0x116ac,
+ 0x116ae, 0x116af,
+ 0x116b6, 0x116b6,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d164,
+ 0x1d166, 0x1d166,
+ 0x1d16a, 0x1d16d,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0x1d1ae, 0x1d1dd,
+ 0x1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, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Grapheme_Base */
+
+/* 'Grapheme_Link': Derived Property */
+static const OnigCodePoint CR_Grapheme_Link[] = {
+ 33,
+ 0x094d, 0x094d,
+ 0x09cd, 0x09cd,
+ 0x0a4d, 0x0a4d,
+ 0x0acd, 0x0acd,
+ 0x0b4d, 0x0b4d,
+ 0x0bcd, 0x0bcd,
+ 0x0c4d, 0x0c4d,
+ 0x0ccd, 0x0ccd,
+ 0x0d4d, 0x0d4d,
+ 0x0dca, 0x0dca,
+ 0x0e3a, 0x0e3a,
+ 0x0f84, 0x0f84,
+ 0x1039, 0x103a,
+ 0x1714, 0x1714,
+ 0x1734, 0x1734,
+ 0x17d2, 0x17d2,
+ 0x1a60, 0x1a60,
+ 0x1b44, 0x1b44,
+ 0x1baa, 0x1bab,
+ 0x1bf2, 0x1bf3,
+ 0x2d7f, 0x2d7f,
+ 0xa806, 0xa806,
+ 0xa8c4, 0xa8c4,
+ 0xa953, 0xa953,
+ 0xa9c0, 0xa9c0,
+ 0xaaf6, 0xaaf6,
+ 0xabed, 0xabed,
+ 0x10a3f, 0x10a3f,
+ 0x11046, 0x11046,
+ 0x110b9, 0x110b9,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b6,
+}; /* CR_Grapheme_Link */
+
+/* 'Common': Script */
+static const OnigCodePoint CR_Common[] = {
+ 157,
+ 0x0000, 0x0040,
+ 0x005b, 0x0060,
+ 0x007b, 0x00a9,
+ 0x00ab, 0x00b9,
+ 0x00bb, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x02b9, 0x02df,
+ 0x02e5, 0x02e9,
+ 0x02ec, 0x02ff,
+ 0x0374, 0x0374,
+ 0x037e, 0x037e,
+ 0x0385, 0x0385,
+ 0x0387, 0x0387,
+ 0x0589, 0x0589,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0640, 0x0640,
+ 0x0660, 0x0669,
+ 0x06dd, 0x06dd,
+ 0x0964, 0x0965,
+ 0x0e3f, 0x0e3f,
+ 0x0fd5, 0x0fd8,
+ 0x10fb, 0x10fb,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x1802, 0x1803,
+ 0x1805, 0x1805,
+ 0x1cd3, 0x1cd3,
+ 0x1ce1, 0x1ce1,
+ 0x1ce9, 0x1cec,
+ 0x1cee, 0x1cf3,
+ 0x1cf5, 0x1cf6,
+ 0x2000, 0x200b,
+ 0x200e, 0x2064,
+ 0x206a, 0x2070,
+ 0x2074, 0x207e,
+ 0x2080, 0x208e,
+ 0x20a0, 0x20b9,
+ 0x2100, 0x2125,
+ 0x2127, 0x2129,
+ 0x212c, 0x2131,
+ 0x2133, 0x214d,
+ 0x214f, 0x215f,
+ 0x2189, 0x2189,
+ 0x2190, 0x23f3,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x26ff,
+ 0x2701, 0x27ff,
+ 0x2900, 0x2b4c,
+ 0x2b50, 0x2b59,
+ 0x2e00, 0x2e3b,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x3004,
+ 0x3006, 0x3006,
+ 0x3008, 0x3020,
+ 0x3030, 0x3037,
+ 0x303c, 0x303f,
+ 0x309b, 0x309c,
+ 0x30a0, 0x30a0,
+ 0x30fb, 0x30fc,
+ 0x3190, 0x319f,
+ 0x31c0, 0x31e3,
+ 0x3220, 0x325f,
+ 0x327f, 0x32cf,
+ 0x3358, 0x33ff,
+ 0x4dc0, 0x4dff,
+ 0xa700, 0xa721,
+ 0xa788, 0xa78a,
+ 0xa830, 0xa839,
+ 0xfd3e, 0xfd3f,
+ 0xfdfd, 0xfdfd,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff20,
+ 0xff3b, 0xff40,
+ 0xff5b, 0xff65,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1013f,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fc,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d166,
+ 0x1d16a, 0x1d17a,
+ 0x1d183, 0x1d184,
+ 0x1d18c, 0x1d1a9,
+ 0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f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Common */
+
+/* 'Latin': Script */
+static const OnigCodePoint CR_Latin[] = {
+ 30,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02b8,
+ 0x02e0, 0x02e4,
+ 0x1d00, 0x1d25,
+ 0x1d2c, 0x1d5c,
+ 0x1d62, 0x1d65,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1dbe,
+ 0x1e00, 0x1eff,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x212a, 0x212b,
+ 0x2132, 0x2132,
+ 0x214e, 0x214e,
+ 0x2160, 0x2188,
+ 0x2c60, 0x2c7f,
+ 0xa722, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7ff,
+ 0xfb00, 0xfb06,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+}; /* CR_Latin */
+
+/* 'Greek': Script */
+static const OnigCodePoint CR_Greek[] = {
+ 33,
+ 0x0370, 0x0373,
+ 0x0375, 0x0377,
+ 0x037a, 0x037d,
+ 0x0384, 0x0384,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03e1,
+ 0x03f0, 0x03ff,
+ 0x1d26, 0x1d2a,
+ 0x1d5d, 0x1d61,
+ 0x1d66, 0x1d6a,
+ 0x1dbf, 0x1dbf,
+ 0x1f00, 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,
+ 0x2126, 0x2126,
+ 0x10140, 0x1018a,
+ 0x1d200, 0x1d245,
+}; /* CR_Greek */
+
+/* 'Cyrillic': Script */
+static const OnigCodePoint CR_Cyrillic[] = {
+ 7,
+ 0x0400, 0x0484,
+ 0x0487, 0x0527,
+ 0x1d2b, 0x1d2b,
+ 0x1d78, 0x1d78,
+ 0x2de0, 0x2dff,
+ 0xa640, 0xa697,
+ 0xa69f, 0xa69f,
+}; /* CR_Cyrillic */
+
+/* 'Armenian': Script */
+static const OnigCodePoint CR_Armenian[] = {
+ 6,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x058a, 0x058a,
+ 0x058f, 0x058f,
+ 0xfb13, 0xfb17,
+}; /* CR_Armenian */
+
+/* 'Hebrew': Script */
+static const OnigCodePoint CR_Hebrew[] = {
+ 9,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfb4f,
+}; /* CR_Hebrew */
+
+/* 'Arabic': Script */
+static const OnigCodePoint CR_Arabic[] = {
+ 56,
+ 0x0600, 0x0604,
+ 0x0606, 0x060b,
+ 0x060d, 0x061a,
+ 0x061e, 0x061e,
+ 0x0620, 0x063f,
+ 0x0641, 0x064a,
+ 0x0656, 0x065e,
+ 0x066a, 0x066f,
+ 0x0671, 0x06dc,
+ 0x06de, 0x06ff,
+ 0x0750, 0x077f,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0xfb50, 0xfbc1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfc,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0x10e60, 0x10e7e,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+}; /* CR_Arabic */
+
+/* 'Syriac': Script */
+static const OnigCodePoint CR_Syriac[] = {
+ 3,
+ 0x0700, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x074f,
+}; /* CR_Syriac */
+
+/* 'Thaana': Script */
+static const OnigCodePoint CR_Thaana[] = {
+ 1,
+ 0x0780, 0x07b1,
+}; /* CR_Thaana */
+
+/* 'Devanagari': Script */
+static const OnigCodePoint CR_Devanagari[] = {
+ 5,
+ 0x0900, 0x0950,
+ 0x0953, 0x0963,
+ 0x0966, 0x0977,
+ 0x0979, 0x097f,
+ 0xa8e0, 0xa8fb,
+}; /* CR_Devanagari */
+
+/* 'Bengali': Script */
+static const OnigCodePoint CR_Bengali[] = {
+ 14,
+ 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,
+}; /* CR_Bengali */
+
+/* 'Gurmukhi': Script */
+static const OnigCodePoint CR_Gurmukhi[] = {
+ 16,
+ 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,
+}; /* CR_Gurmukhi */
+
+/* 'Gujarati': Script */
+static const OnigCodePoint CR_Gujarati[] = {
+ 13,
+ 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,
+}; /* CR_Gujarati */
+
+/* 'Oriya': Script */
+static const OnigCodePoint CR_Oriya[] = {
+ 14,
+ 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,
+}; /* CR_Oriya */
+
+/* 'Tamil': Script */
+static const OnigCodePoint CR_Tamil[] = {
+ 16,
+ 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,
+}; /* CR_Tamil */
+
+/* 'Telugu': Script */
+static const OnigCodePoint CR_Telugu[] = {
+ 14,
+ 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,
+}; /* CR_Telugu */
+
+/* 'Kannada': Script */
+static const OnigCodePoint CR_Kannada[] = {
+ 14,
+ 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,
+}; /* CR_Kannada */
+
+/* 'Malayalam': Script */
+static const OnigCodePoint CR_Malayalam[] = {
+ 11,
+ 0x0d02, 0x0d03,
+ 0x0d05, 0x0d0c,
+ 0x0d0e, 0x0d10,
+ 0x0d12, 0x0d3a,
+ 0x0d3d, 0x0d44,
+ 0x0d46, 0x0d48,
+ 0x0d4a, 0x0d4e,
+ 0x0d57, 0x0d57,
+ 0x0d60, 0x0d63,
+ 0x0d66, 0x0d75,
+ 0x0d79, 0x0d7f,
+}; /* CR_Malayalam */
+
+/* 'Sinhala': Script */
+static const OnigCodePoint CR_Sinhala[] = {
+ 11,
+ 0x0d82, 0x0d83,
+ 0x0d85, 0x0d96,
+ 0x0d9a, 0x0db1,
+ 0x0db3, 0x0dbb,
+ 0x0dbd, 0x0dbd,
+ 0x0dc0, 0x0dc6,
+ 0x0dca, 0x0dca,
+ 0x0dcf, 0x0dd4,
+ 0x0dd6, 0x0dd6,
+ 0x0dd8, 0x0ddf,
+ 0x0df2, 0x0df4,
+}; /* CR_Sinhala */
+
+/* 'Thai': Script */
+static const OnigCodePoint CR_Thai[] = {
+ 2,
+ 0x0e01, 0x0e3a,
+ 0x0e40, 0x0e5b,
+}; /* CR_Thai */
+
+/* 'Lao': Script */
+static const OnigCodePoint CR_Lao[] = {
+ 18,
+ 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,
+}; /* CR_Lao */
+
+/* 'Tibetan': Script */
+static const OnigCodePoint CR_Tibetan[] = {
+ 7,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x0fd9, 0x0fda,
+}; /* CR_Tibetan */
+
+/* 'Myanmar': Script */
+static const OnigCodePoint CR_Myanmar[] = {
+ 2,
+ 0x1000, 0x109f,
+ 0xaa60, 0xaa7b,
+}; /* CR_Myanmar */
+
+/* 'Georgian': Script */
+static const OnigCodePoint CR_Georgian[] = {
+ 8,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x10ff,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+}; /* CR_Georgian */
+
+/* 'Hangul': Script */
+static const OnigCodePoint CR_Hangul[] = {
+ 14,
+ 0x1100, 0x11ff,
+ 0x302e, 0x302f,
+ 0x3131, 0x318e,
+ 0x3200, 0x321e,
+ 0x3260, 0x327e,
+ 0xa960, 0xa97c,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xffa0, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+}; /* CR_Hangul */
+
+/* 'Ethiopic': Script */
+static const OnigCodePoint CR_Ethiopic[] = {
+ 32,
+ 0x1200, 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,
+ 0x2d80, 0x2d96,
+ 0x2da0, 0x2da6,
+ 0x2da8, 0x2dae,
+ 0x2db0, 0x2db6,
+ 0x2db8, 0x2dbe,
+ 0x2dc0, 0x2dc6,
+ 0x2dc8, 0x2dce,
+ 0x2dd0, 0x2dd6,
+ 0x2dd8, 0x2dde,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+}; /* CR_Ethiopic */
+
+/* 'Cherokee': Script */
+static const OnigCodePoint CR_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13f4,
+}; /* CR_Cherokee */
+
+/* 'Canadian_Aboriginal': Script */
+static const OnigCodePoint CR_Canadian_Aboriginal[] = {
+ 2,
+ 0x1400, 0x167f,
+ 0x18b0, 0x18f5,
+}; /* CR_Canadian_Aboriginal */
+
+/* 'Ogham': Script */
+static const OnigCodePoint CR_Ogham[] = {
+ 1,
+ 0x1680, 0x169c,
+}; /* CR_Ogham */
+
+/* 'Runic': Script */
+static const OnigCodePoint CR_Runic[] = {
+ 2,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+}; /* CR_Runic */
+
+/* 'Khmer': Script */
+static const OnigCodePoint CR_Khmer[] = {
+ 4,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x19e0, 0x19ff,
+}; /* CR_Khmer */
+
+/* 'Mongolian': Script */
+static const OnigCodePoint CR_Mongolian[] = {
+ 6,
+ 0x1800, 0x1801,
+ 0x1804, 0x1804,
+ 0x1806, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+}; /* CR_Mongolian */
+
+/* 'Hiragana': Script */
+static const OnigCodePoint CR_Hiragana[] = {
+ 4,
+ 0x3041, 0x3096,
+ 0x309d, 0x309f,
+ 0x1b001, 0x1b001,
+ 0x1f200, 0x1f200,
+}; /* CR_Hiragana */
+
+/* 'Katakana': Script */
+static const OnigCodePoint CR_Katakana[] = {
+ 8,
+ 0x30a1, 0x30fa,
+ 0x30fd, 0x30ff,
+ 0x31f0, 0x31ff,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3357,
+ 0xff66, 0xff6f,
+ 0xff71, 0xff9d,
+ 0x1b000, 0x1b000,
+}; /* CR_Katakana */
+
+/* 'Bopomofo': Script */
+static const OnigCodePoint CR_Bopomofo[] = {
+ 3,
+ 0x02ea, 0x02eb,
+ 0x3105, 0x312d,
+ 0x31a0, 0x31ba,
+}; /* CR_Bopomofo */
+
+/* 'Han': Script */
+static const OnigCodePoint CR_Han[] = {
+ 15,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x3005, 0x3005,
+ 0x3007, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303b,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Han */
+
+/* 'Yi': Script */
+static const OnigCodePoint CR_Yi[] = {
+ 2,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+}; /* CR_Yi */
+
+/* 'Old_Italic': Script */
+static const OnigCodePoint CR_Old_Italic[] = {
+ 2,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+}; /* CR_Old_Italic */
+
+/* 'Gothic': Script */
+static const OnigCodePoint CR_Gothic[] = {
+ 1,
+ 0x10330, 0x1034a,
+}; /* CR_Gothic */
+
+/* 'Deseret': Script */
+static const OnigCodePoint CR_Deseret[] = {
+ 1,
+ 0x10400, 0x1044f,
+}; /* CR_Deseret */
+
+/* 'Inherited': Script */
+static const OnigCodePoint CR_Inherited[] = {
+ 25,
+ 0x0300, 0x036f,
+ 0x0485, 0x0486,
+ 0x064b, 0x0655,
+ 0x065f, 0x065f,
+ 0x0670, 0x0670,
+ 0x0951, 0x0952,
+ 0x1cd0, 0x1cd2,
+ 0x1cd4, 0x1ce0,
+ 0x1ce2, 0x1ce8,
+ 0x1ced, 0x1ced,
+ 0x1cf4, 0x1cf4,
+ 0x1dc0, 0x1de6,
+ 0x1dfc, 0x1dff,
+ 0x200c, 0x200d,
+ 0x20d0, 0x20f0,
+ 0x302a, 0x302d,
+ 0x3099, 0x309a,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0x101fd, 0x101fd,
+ 0x1d167, 0x1d169,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0xe0100, 0xe01ef,
+}; /* CR_Inherited */
+
+/* 'Tagalog': Script */
+static const OnigCodePoint CR_Tagalog[] = {
+ 2,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+}; /* CR_Tagalog */
+
+/* 'Hanunoo': Script */
+static const OnigCodePoint CR_Hanunoo[] = {
+ 1,
+ 0x1720, 0x1734,
+}; /* CR_Hanunoo */
+
+/* 'Buhid': Script */
+static const OnigCodePoint CR_Buhid[] = {
+ 1,
+ 0x1740, 0x1753,
+}; /* CR_Buhid */
+
+/* 'Tagbanwa': Script */
+static const OnigCodePoint CR_Tagbanwa[] = {
+ 3,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+}; /* CR_Tagbanwa */
+
+/* 'Limbu': Script */
+static const OnigCodePoint CR_Limbu[] = {
+ 5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x194f,
+}; /* CR_Limbu */
+
+/* 'Tai_Le': Script */
+static const OnigCodePoint CR_Tai_Le[] = {
+ 2,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+}; /* CR_Tai_Le */
+
+/* 'Linear_B': Script */
+static const OnigCodePoint CR_Linear_B[] = {
+ 7,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+}; /* CR_Linear_B */
+
+/* 'Ugaritic': Script */
+static const OnigCodePoint CR_Ugaritic[] = {
+ 2,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+}; /* CR_Ugaritic */
+
+/* 'Shavian': Script */
+static const OnigCodePoint CR_Shavian[] = {
+ 1,
+ 0x10450, 0x1047f,
+}; /* CR_Shavian */
+
+/* 'Osmanya': Script */
+static const OnigCodePoint CR_Osmanya[] = {
+ 2,
+ 0x10480, 0x1049d,
+ 0x104a0, 0x104a9,
+}; /* CR_Osmanya */
+
+/* 'Cypriot': Script */
+static const OnigCodePoint CR_Cypriot[] = {
+ 6,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+}; /* CR_Cypriot */
+
+/* 'Braille': Script */
+static const OnigCodePoint CR_Braille[] = {
+ 1,
+ 0x2800, 0x28ff,
+}; /* CR_Braille */
+
+/* 'Buginese': Script */
+static const OnigCodePoint CR_Buginese[] = {
+ 2,
+ 0x1a00, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+}; /* CR_Buginese */
+
+/* 'Coptic': Script */
+static const OnigCodePoint CR_Coptic[] = {
+ 3,
+ 0x03e2, 0x03ef,
+ 0x2c80, 0x2cf3,
+ 0x2cf9, 0x2cff,
+}; /* CR_Coptic */
+
+/* 'New_Tai_Lue': Script */
+static const OnigCodePoint CR_New_Tai_Lue[] = {
+ 4,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x19df,
+}; /* CR_New_Tai_Lue */
+
+/* 'Glagolitic': Script */
+static const OnigCodePoint CR_Glagolitic[] = {
+ 2,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+}; /* CR_Glagolitic */
+
+/* 'Tifinagh': Script */
+static const OnigCodePoint CR_Tifinagh[] = {
+ 3,
+ 0x2d30, 0x2d67,
+ 0x2d6f, 0x2d70,
+ 0x2d7f, 0x2d7f,
+}; /* CR_Tifinagh */
+
+/* 'Syloti_Nagri': Script */
+static const OnigCodePoint CR_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82b,
+}; /* CR_Syloti_Nagri */
+
+/* 'Old_Persian': Script */
+static const OnigCodePoint CR_Old_Persian[] = {
+ 2,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103d5,
+}; /* CR_Old_Persian */
+
+/* 'Kharoshthi': Script */
+static const OnigCodePoint CR_Kharoshthi[] = {
+ 8,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+}; /* CR_Kharoshthi */
+
+/* 'Balinese': Script */
+static const OnigCodePoint CR_Balinese[] = {
+ 2,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+}; /* CR_Balinese */
+
+/* 'Cuneiform': Script */
+static const OnigCodePoint CR_Cuneiform[] = {
+ 3,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+}; /* CR_Cuneiform */
+
+/* 'Phoenician': Script */
+static const OnigCodePoint CR_Phoenician[] = {
+ 2,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x1091f,
+}; /* CR_Phoenician */
+
+/* 'Phags_Pa': Script */
+static const OnigCodePoint CR_Phags_Pa[] = {
+ 1,
+ 0xa840, 0xa877,
+}; /* CR_Phags_Pa */
+
+/* 'Nko': Script */
+static const OnigCodePoint CR_Nko[] = {
+ 1,
+ 0x07c0, 0x07fa,
+}; /* CR_Nko */
+
+/* 'Sundanese': Script */
+static const OnigCodePoint CR_Sundanese[] = {
+ 2,
+ 0x1b80, 0x1bbf,
+ 0x1cc0, 0x1cc7,
+}; /* CR_Sundanese */
+
+/* 'Lepcha': Script */
+static const OnigCodePoint CR_Lepcha[] = {
+ 3,
+ 0x1c00, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c4f,
+}; /* CR_Lepcha */
+
+/* 'Ol_Chiki': Script */
+static const OnigCodePoint CR_Ol_Chiki[] = {
+ 1,
+ 0x1c50, 0x1c7f,
+}; /* CR_Ol_Chiki */
+
+/* 'Vai': Script */
+static const OnigCodePoint CR_Vai[] = {
+ 1,
+ 0xa500, 0xa62b,
+}; /* CR_Vai */
+
+/* 'Saurashtra': Script */
+static const OnigCodePoint CR_Saurashtra[] = {
+ 2,
+ 0xa880, 0xa8c4,
+ 0xa8ce, 0xa8d9,
+}; /* CR_Saurashtra */
+
+/* 'Kayah_Li': Script */
+static const OnigCodePoint CR_Kayah_Li[] = {
+ 1,
+ 0xa900, 0xa92f,
+}; /* CR_Kayah_Li */
+
+/* 'Rejang': Script */
+static const OnigCodePoint CR_Rejang[] = {
+ 2,
+ 0xa930, 0xa953,
+ 0xa95f, 0xa95f,
+}; /* CR_Rejang */
+
+/* 'Lycian': Script */
+static const OnigCodePoint CR_Lycian[] = {
+ 1,
+ 0x10280, 0x1029c,
+}; /* CR_Lycian */
+
+/* 'Carian': Script */
+static const OnigCodePoint CR_Carian[] = {
+ 1,
+ 0x102a0, 0x102d0,
+}; /* CR_Carian */
+
+/* 'Lydian': Script */
+static const OnigCodePoint CR_Lydian[] = {
+ 2,
+ 0x10920, 0x10939,
+ 0x1093f, 0x1093f,
+}; /* CR_Lydian */
+
+/* 'Cham': Script */
+static const OnigCodePoint CR_Cham[] = {
+ 4,
+ 0xaa00, 0xaa36,
+ 0xaa40, 0xaa4d,
+ 0xaa50, 0xaa59,
+ 0xaa5c, 0xaa5f,
+}; /* CR_Cham */
+
+/* 'Tai_Tham': Script */
+static const OnigCodePoint CR_Tai_Tham[] = {
+ 5,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+}; /* CR_Tai_Tham */
+
+/* 'Tai_Viet': Script */
+static const OnigCodePoint CR_Tai_Viet[] = {
+ 2,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaadf,
+}; /* CR_Tai_Viet */
+
+/* 'Avestan': Script */
+static const OnigCodePoint CR_Avestan[] = {
+ 2,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b3f,
+}; /* CR_Avestan */
+
+/* 'Egyptian_Hieroglyphs': Script */
+static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342e,
+}; /* CR_Egyptian_Hieroglyphs */
+
+/* 'Samaritan': Script */
+static const OnigCodePoint CR_Samaritan[] = {
+ 2,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+}; /* CR_Samaritan */
+
+/* 'Lisu': Script */
+static const OnigCodePoint CR_Lisu[] = {
+ 1,
+ 0xa4d0, 0xa4ff,
+}; /* CR_Lisu */
+
+/* 'Bamum': Script */
+static const OnigCodePoint CR_Bamum[] = {
+ 2,
+ 0xa6a0, 0xa6f7,
+ 0x16800, 0x16a38,
+}; /* CR_Bamum */
+
+/* 'Javanese': Script */
+static const OnigCodePoint CR_Javanese[] = {
+ 3,
+ 0xa980, 0xa9cd,
+ 0xa9cf, 0xa9d9,
+ 0xa9de, 0xa9df,
+}; /* CR_Javanese */
+
+/* 'Meetei_Mayek': Script */
+static const OnigCodePoint CR_Meetei_Mayek[] = {
+ 3,
+ 0xaae0, 0xaaf6,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+}; /* CR_Meetei_Mayek */
+
+/* 'Imperial_Aramaic': Script */
+static const OnigCodePoint CR_Imperial_Aramaic[] = {
+ 2,
+ 0x10840, 0x10855,
+ 0x10857, 0x1085f,
+}; /* CR_Imperial_Aramaic */
+
+/* 'Old_South_Arabian': Script */
+static const OnigCodePoint CR_Old_South_Arabian[] = {
+ 1,
+ 0x10a60, 0x10a7f,
+}; /* CR_Old_South_Arabian */
+
+/* 'Inscriptional_Parthian': Script */
+static const OnigCodePoint CR_Inscriptional_Parthian[] = {
+ 2,
+ 0x10b40, 0x10b55,
+ 0x10b58, 0x10b5f,
+}; /* CR_Inscriptional_Parthian */
+
+/* 'Inscriptional_Pahlavi': Script */
+static const OnigCodePoint CR_Inscriptional_Pahlavi[] = {
+ 2,
+ 0x10b60, 0x10b72,
+ 0x10b78, 0x10b7f,
+}; /* CR_Inscriptional_Pahlavi */
+
+/* 'Old_Turkic': Script */
+static const OnigCodePoint CR_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c48,
+}; /* CR_Old_Turkic */
+
+/* 'Kaithi': Script */
+static const OnigCodePoint CR_Kaithi[] = {
+ 1,
+ 0x11080, 0x110c1,
+}; /* CR_Kaithi */
+
+/* 'Batak': Script */
+static const OnigCodePoint CR_Batak[] = {
+ 2,
+ 0x1bc0, 0x1bf3,
+ 0x1bfc, 0x1bff,
+}; /* CR_Batak */
+
+/* 'Brahmi': Script */
+static const OnigCodePoint CR_Brahmi[] = {
+ 2,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+}; /* CR_Brahmi */
+
+/* 'Mandaic': Script */
+static const OnigCodePoint CR_Mandaic[] = {
+ 2,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+}; /* CR_Mandaic */
+
+/* 'Chakma': Script */
+static const OnigCodePoint CR_Chakma[] = {
+ 2,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+}; /* CR_Chakma */
+
+/* 'Meroitic_Cursive': Script */
+static const OnigCodePoint CR_Meroitic_Cursive[] = {
+ 2,
+ 0x109a0, 0x109b7,
+ 0x109be, 0x109bf,
+}; /* CR_Meroitic_Cursive */
+
+/* 'Meroitic_Hieroglyphs': Script */
+static const OnigCodePoint CR_Meroitic_Hieroglyphs[] = {
+ 1,
+ 0x10980, 0x1099f,
+}; /* CR_Meroitic_Hieroglyphs */
+
+/* 'Miao': Script */
+static const OnigCodePoint CR_Miao[] = {
+ 3,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+}; /* CR_Miao */
+
+/* 'Sharada': Script */
+static const OnigCodePoint CR_Sharada[] = {
+ 2,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+}; /* CR_Sharada */
+
+/* 'Sora_Sompeng': Script */
+static const OnigCodePoint CR_Sora_Sompeng[] = {
+ 2,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+}; /* CR_Sora_Sompeng */
+
+/* 'Takri': Script */
+static const OnigCodePoint CR_Takri[] = {
+ 2,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+}; /* CR_Takri */
+
+/* 'White_Space': Binary Property */
+#define CR_White_Space CR_Space
+
+/* 'Bidi_Control': Binary Property */
+static const OnigCodePoint CR_Bidi_Control[] = {
+ 2,
+ 0x200e, 0x200f,
+ 0x202a, 0x202e,
+}; /* CR_Bidi_Control */
+
+/* 'Join_Control': Binary Property */
+static const OnigCodePoint CR_Join_Control[] = {
+ 1,
+ 0x200c, 0x200d,
+}; /* CR_Join_Control */
+
+/* 'Dash': Binary Property */
+static const OnigCodePoint CR_Dash[] = {
+ 20,
+ 0x002d, 0x002d,
+ 0x058a, 0x058a,
+ 0x05be, 0x05be,
+ 0x1400, 0x1400,
+ 0x1806, 0x1806,
+ 0x2010, 0x2015,
+ 0x2053, 0x2053,
+ 0x207b, 0x207b,
+ 0x208b, 0x208b,
+ 0x2212, 0x2212,
+ 0x2e17, 0x2e17,
+ 0x2e1a, 0x2e1a,
+ 0x2e3a, 0x2e3b,
+ 0x301c, 0x301c,
+ 0x3030, 0x3030,
+ 0x30a0, 0x30a0,
+ 0xfe31, 0xfe32,
+ 0xfe58, 0xfe58,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+}; /* CR_Dash */
+
+/* 'Hyphen': Binary Property */
+static const OnigCodePoint CR_Hyphen[] = {
+ 10,
+ 0x002d, 0x002d,
+ 0x00ad, 0x00ad,
+ 0x058a, 0x058a,
+ 0x1806, 0x1806,
+ 0x2010, 0x2011,
+ 0x2e17, 0x2e17,
+ 0x30fb, 0x30fb,
+ 0xfe63, 0xfe63,
+ 0xff0d, 0xff0d,
+ 0xff65, 0xff65,
+}; /* CR_Hyphen */
+
+/* 'Quotation_Mark': Binary Property */
+static const OnigCodePoint CR_Quotation_Mark[] = {
+ 12,
+ 0x0022, 0x0022,
+ 0x0027, 0x0027,
+ 0x00ab, 0x00ab,
+ 0x00bb, 0x00bb,
+ 0x2018, 0x201f,
+ 0x2039, 0x203a,
+ 0x300c, 0x300f,
+ 0x301d, 0x301f,
+ 0xfe41, 0xfe44,
+ 0xff02, 0xff02,
+ 0xff07, 0xff07,
+ 0xff62, 0xff63,
+}; /* CR_Quotation_Mark */
+
+/* 'Terminal_Punctuation': Binary Property */
+static const OnigCodePoint CR_Terminal_Punctuation[] = {
+ 70,
+ 0x0021, 0x0021,
+ 0x002c, 0x002c,
+ 0x002e, 0x002e,
+ 0x003a, 0x003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x1104d,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+ 0x12470, 0x12473,
+}; /* CR_Terminal_Punctuation */
+
+/* 'Other_Math': Binary Property */
+static const OnigCodePoint CR_Other_Math[] = {
+ 133,
+ 0x005e, 0x005e,
+ 0x03d0, 0x03d2,
+ 0x03d5, 0x03d5,
+ 0x03f0, 0x03f1,
+ 0x03f4, 0x03f5,
+ 0x2016, 0x2016,
+ 0x2032, 0x2034,
+ 0x2040, 0x2040,
+ 0x2061, 0x2064,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x20d0, 0x20dc,
+ 0x20e1, 0x20e1,
+ 0x20e5, 0x20e6,
+ 0x20eb, 0x20ef,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2128, 0x2129,
+ 0x212c, 0x212d,
+ 0x212f, 0x2131,
+ 0x2133, 0x2138,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x2195, 0x2199,
+ 0x219c, 0x219f,
+ 0x21a1, 0x21a2,
+ 0x21a4, 0x21a5,
+ 0x21a7, 0x21a7,
+ 0x21a9, 0x21ad,
+ 0x21b0, 0x21b1,
+ 0x21b6, 0x21b7,
+ 0x21bc, 0x21cd,
+ 0x21d0, 0x21d1,
+ 0x21d3, 0x21d3,
+ 0x21d5, 0x21db,
+ 0x21dd, 0x21dd,
+ 0x21e4, 0x21e5,
+ 0x23b4, 0x23b5,
+ 0x23b7, 0x23b7,
+ 0x23d0, 0x23d0,
+ 0x23e2, 0x23e2,
+ 0x25a0, 0x25a1,
+ 0x25ae, 0x25b6,
+ 0x25bc, 0x25c0,
+ 0x25c6, 0x25c7,
+ 0x25ca, 0x25cb,
+ 0x25cf, 0x25d3,
+ 0x25e2, 0x25e2,
+ 0x25e4, 0x25e4,
+ 0x25e7, 0x25ec,
+ 0x2605, 0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x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+}; /* CR_Other_Math */
+
+/* 'Hex_Digit': Binary Property */
+static const OnigCodePoint CR_Hex_Digit[] = {
+ 6,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+ 0xff10, 0xff19,
+ 0xff21, 0xff26,
+ 0xff41, 0xff46,
+}; /* CR_Hex_Digit */
+
+/* 'ASCII_Hex_Digit': Binary Property */
+#define CR_ASCII_Hex_Digit CR_XDigit
+
+/* 'Other_Alphabetic': Binary Property */
+static const OnigCodePoint CR_Other_Alphabetic[] = {
+ 158,
+ 0x0345, 0x0345,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x0610, 0x061a,
+ 0x064b, 0x0657,
+ 0x0659, 0x065f,
+ 0x0670, 0x0670,
+ 0x06d6, 0x06dc,
+ 0x06e1, 0x06e4,
+ 0x06e7, 0x06e8,
+ 0x06ed, 0x06ed,
+ 0x0711, 0x0711,
+ 0x0730, 0x073f,
+ 0x07a6, 0x07b0,
+ 0x0816, 0x0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aab2, 0xaab4,
+ 0xaab7, 0xaab8,
+ 0xaabe, 0xaabe,
+ 0xaaeb, 0xaaef,
+ 0xaaf5, 0xaaf5,
+ 0xabe3, 0xabea,
+ 0xfb1e, 0xfb1e,
+ 0x10a01, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a0f,
+ 0x11000, 0x11002,
+ 0x11038, 0x11045,
+ 0x11082, 0x11082,
+ 0x110b0, 0x110b8,
+ 0x11100, 0x11102,
+ 0x11127, 0x11132,
+ 0x11180, 0x11182,
+ 0x111b3, 0x111bf,
+ 0x116ab, 0x116b5,
+ 0x16f51, 0x16f7e,
+}; /* CR_Other_Alphabetic */
+
+/* 'Ideographic': Binary Property */
+static const OnigCodePoint CR_Ideographic[] = {
+ 11,
+ 0x3006, 0x3007,
+ 0x3021, 0x3029,
+ 0x3038, 0x303a,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Ideographic */
+
+/* 'Diacritic': Binary Property */
+static const OnigCodePoint CR_Diacritic[] = {
+ 125,
+ 0x005e, 0x005e,
+ 0x0060, 0x0060,
+ 0x00a8, 0x00a8,
+ 0x00af, 0x00af,
+ 0x00b4, 0x00b4,
+ 0x00b7, 0x00b8,
+ 0x02b0, 0x034e,
+ 0x0350, 0x0357,
+ 0x035d, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x0384, 0x0385,
+ 0x0483, 0x0487,
+ 0x0559, 0x0559,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c4,
+ 0x064b, 0x0652,
+ 0x0657, 0x0658,
+ 0x06df, 0x06e0,
+ 0x06e5, 0x06e6,
+ 0x06ea, 0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0x1fcf,
+ 0x1fdd, 0x1fdf,
+ 0x1fed, 0x1fef,
+ 0x1ffd, 0x1ffe,
+ 0x2cef, 0x2cf1,
+ 0x2e2f, 0x2e2f,
+ 0x302a, 0x302f,
+ 0x3099, 0x309c,
+ 0x30fc, 0x30fc,
+ 0xa66f, 0xa66f,
+ 0xa67c, 0xa67d,
+ 0xa67f, 0xa67f,
+ 0xa6f0, 0xa6f1,
+ 0xa717, 0xa721,
+ 0xa788, 0xa788,
+ 0xa7f8, 0xa7f9,
+ 0xa8c4, 0xa8c4,
+ 0xa8e0, 0xa8f1,
+ 0xa92b, 0xa92e,
+ 0xa953, 0xa953,
+ 0xa9b3, 0xa9b3,
+ 0xa9c0, 0xa9c0,
+ 0xaa7b, 0xaa7b,
+ 0xaabf, 0xaac2,
+ 0xaaf6, 0xaaf6,
+ 0xabec, 0xabed,
+ 0xfb1e, 0xfb1e,
+ 0xfe20, 0xfe26,
+ 0xff3e, 0xff3e,
+ 0xff40, 0xff40,
+ 0xff70, 0xff70,
+ 0xff9e, 0xff9f,
+ 0xffe3, 0xffe3,
+ 0x110b9, 0x110ba,
+ 0x11133, 0x11134,
+ 0x111c0, 0x111c0,
+ 0x116b6, 0x116b7,
+ 0x16f8f, 0x16f9f,
+ 0x1d167, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+}; /* CR_Diacritic */
+
+/* 'Extender': Binary Property */
+static const OnigCodePoint CR_Extender[] = {
+ 22,
+ 0x00b7, 0x00b7,
+ 0x02d0, 0x02d1,
+ 0x0640, 0x0640,
+ 0x07fa, 0x07fa,
+ 0x0e46, 0x0e46,
+ 0x0ec6, 0x0ec6,
+ 0x180a, 0x180a,
+ 0x1843, 0x1843,
+ 0x1aa7, 0x1aa7,
+ 0x1c36, 0x1c36,
+ 0x1c7b, 0x1c7b,
+ 0x3005, 0x3005,
+ 0x3031, 0x3035,
+ 0x309d, 0x309e,
+ 0x30fc, 0x30fe,
+ 0xa015, 0xa015,
+ 0xa60c, 0xa60c,
+ 0xa9cf, 0xa9cf,
+ 0xaa70, 0xaa70,
+ 0xaadd, 0xaadd,
+ 0xaaf3, 0xaaf4,
+ 0xff70, 0xff70,
+}; /* CR_Extender */
+
+/* 'Other_Lowercase': Binary Property */
+static const OnigCodePoint CR_Other_Lowercase[] = {
+ 18,
+ 0x00aa, 0x00aa,
+ 0x00ba, 0x00ba,
+ 0x02b0, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x037a, 0x037a,
+ 0x1d2c, 0x1d6a,
+ 0x1d78, 0x1d78,
+ 0x1d9b, 0x1dbf,
+ 0x2071, 0x2071,
+ 0x207f, 0x207f,
+ 0x2090, 0x209c,
+ 0x2170, 0x217f,
+ 0x24d0, 0x24e9,
+ 0x2c7c, 0x2c7d,
+ 0xa770, 0xa770,
+ 0xa7f8, 0xa7f9,
+}; /* CR_Other_Lowercase */
+
+/* 'Other_Uppercase': Binary Property */
+static const OnigCodePoint CR_Other_Uppercase[] = {
+ 2,
+ 0x2160, 0x216f,
+ 0x24b6, 0x24cf,
+}; /* CR_Other_Uppercase */
+
+/* 'Noncharacter_Code_Point': Binary Property */
+static const OnigCodePoint CR_Noncharacter_Code_Point[] = {
+ 18,
+ 0xfdd0, 0xfdef,
+ 0xfffe, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0xeffff,
+ 0xffffe, 0xfffff,
+ 0x10fffe, 0x10ffff,
+}; /* CR_Noncharacter_Code_Point */
+
+/* 'Other_Grapheme_Extend': Binary Property */
+static const OnigCodePoint CR_Other_Grapheme_Extend[] = {
+ 17,
+ 0x09be, 0x09be,
+ 0x09d7, 0x09d7,
+ 0x0b3e, 0x0b3e,
+ 0x0b57, 0x0b57,
+ 0x0bbe, 0x0bbe,
+ 0x0bd7, 0x0bd7,
+ 0x0cc2, 0x0cc2,
+ 0x0cd5, 0x0cd6,
+ 0x0d3e, 0x0d3e,
+ 0x0d57, 0x0d57,
+ 0x0dcf, 0x0dcf,
+ 0x0ddf, 0x0ddf,
+ 0x200c, 0x200d,
+ 0x302e, 0x302f,
+ 0xff9e, 0xff9f,
+ 0x1d165, 0x1d165,
+ 0x1d16e, 0x1d172,
+}; /* CR_Other_Grapheme_Extend */
+
+/* 'IDS_Binary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Binary_Operator[] = {
+ 2,
+ 0x2ff0, 0x2ff1,
+ 0x2ff4, 0x2ffb,
+}; /* CR_IDS_Binary_Operator */
+
+/* 'IDS_Trinary_Operator': Binary Property */
+static const OnigCodePoint CR_IDS_Trinary_Operator[] = {
+ 1,
+ 0x2ff2, 0x2ff3,
+}; /* CR_IDS_Trinary_Operator */
+
+/* 'Radical': Binary Property */
+static const OnigCodePoint CR_Radical[] = {
+ 3,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+}; /* CR_Radical */
+
+/* 'Unified_Ideograph': Binary Property */
+static const OnigCodePoint CR_Unified_Ideograph[] = {
+ 12,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fcc,
+ 0xfa0e, 0xfa0f,
+ 0xfa11, 0xfa11,
+ 0xfa13, 0xfa14,
+ 0xfa1f, 0xfa1f,
+ 0xfa21, 0xfa21,
+ 0xfa23, 0xfa24,
+ 0xfa27, 0xfa29,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+}; /* CR_Unified_Ideograph */
+
+/* 'Other_Default_Ignorable_Code_Point': Binary Property */
+static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = {
+ 11,
+ 0x034f, 0x034f,
+ 0x115f, 0x1160,
+ 0x17b4, 0x17b5,
+ 0x2065, 0x2069,
+ 0x3164, 0x3164,
+ 0xffa0, 0xffa0,
+ 0xfff0, 0xfff8,
+ 0xe0000, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xe0fff,
+}; /* CR_Other_Default_Ignorable_Code_Point */
+
+/* 'Deprecated': Binary Property */
+static const OnigCodePoint CR_Deprecated[] = {
+ 9,
+ 0x0149, 0x0149,
+ 0x0673, 0x0673,
+ 0x0f77, 0x0f77,
+ 0x0f79, 0x0f79,
+ 0x17a3, 0x17a4,
+ 0x206a, 0x206f,
+ 0x2329, 0x232a,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+}; /* CR_Deprecated */
+
+/* 'Soft_Dotted': Binary Property */
+static const OnigCodePoint CR_Soft_Dotted[] = {
+ 31,
+ 0x0069, 0x006a,
+ 0x012f, 0x012f,
+ 0x0249, 0x0249,
+ 0x0268, 0x0268,
+ 0x029d, 0x029d,
+ 0x02b2, 0x02b2,
+ 0x03f3, 0x03f3,
+ 0x0456, 0x0456,
+ 0x0458, 0x0458,
+ 0x1d62, 0x1d62,
+ 0x1d96, 0x1d96,
+ 0x1da4, 0x1da4,
+ 0x1da8, 0x1da8,
+ 0x1e2d, 0x1e2d,
+ 0x1ecb, 0x1ecb,
+ 0x2071, 0x2071,
+ 0x2148, 0x2149,
+ 0x2c7c, 0x2c7c,
+ 0x1d422, 0x1d423,
+ 0x1d456, 0x1d457,
+ 0x1d48a, 0x1d48b,
+ 0x1d4be, 0x1d4bf,
+ 0x1d4f2, 0x1d4f3,
+ 0x1d526, 0x1d527,
+ 0x1d55a, 0x1d55b,
+ 0x1d58e, 0x1d58f,
+ 0x1d5c2, 0x1d5c3,
+ 0x1d5f6, 0x1d5f7,
+ 0x1d62a, 0x1d62b,
+ 0x1d65e, 0x1d65f,
+ 0x1d692, 0x1d693,
+}; /* CR_Soft_Dotted */
+
+/* 'Logical_Order_Exception': Binary Property */
+static const OnigCodePoint CR_Logical_Order_Exception[] = {
+ 5,
+ 0x0e40, 0x0e44,
+ 0x0ec0, 0x0ec4,
+ 0xaab5, 0xaab6,
+ 0xaab9, 0xaab9,
+ 0xaabb, 0xaabc,
+}; /* CR_Logical_Order_Exception */
+
+/* 'Other_ID_Start': Binary Property */
+static const OnigCodePoint CR_Other_ID_Start[] = {
+ 3,
+ 0x2118, 0x2118,
+ 0x212e, 0x212e,
+ 0x309b, 0x309c,
+}; /* CR_Other_ID_Start */
+
+/* 'Other_ID_Continue': Binary Property */
+static const OnigCodePoint CR_Other_ID_Continue[] = {
+ 4,
+ 0x00b7, 0x00b7,
+ 0x0387, 0x0387,
+ 0x1369, 0x1371,
+ 0x19da, 0x19da,
+}; /* CR_Other_ID_Continue */
+
+/* 'STerm': Binary Property */
+static const OnigCodePoint CR_STerm[] = {
+ 50,
+ 0x0021, 0x0021,
+ 0x002e, 0x002e,
+ 0x003f, 0x003f,
+ 0x055c, 0x055c,
+ 0x055e, 0x055e,
+ 0x0589, 0x0589,
+ 0x061f, 0x061f,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x0702,
+ 0x07f9, 0x07f9,
+ 0x0964, 0x0965,
+ 0x104a, 0x104b,
+ 0x1362, 0x1362,
+ 0x1367, 0x1368,
+ 0x166e, 0x166e,
+ 0x1735, 0x1736,
+ 0x1803, 0x1803,
+ 0x1809, 0x1809,
+ 0x1944, 0x1945,
+ 0x1aa8, 0x1aab,
+ 0x1b5a, 0x1b5b,
+ 0x1b5e, 0x1b5f,
+ 0x1c3b, 0x1c3c,
+ 0x1c7e, 0x1c7f,
+ 0x203c, 0x203d,
+ 0x2047, 0x2049,
+ 0x2e2e, 0x2e2e,
+ 0x3002, 0x3002,
+ 0xa4ff, 0xa4ff,
+ 0xa60e, 0xa60f,
+ 0xa6f3, 0xa6f3,
+ 0xa6f7, 0xa6f7,
+ 0xa876, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa92f, 0xa92f,
+ 0xa9c8, 0xa9c9,
+ 0xaa5d, 0xaa5f,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfe52, 0xfe52,
+ 0xfe56, 0xfe57,
+ 0xff01, 0xff01,
+ 0xff0e, 0xff0e,
+ 0xff1f, 0xff1f,
+ 0xff61, 0xff61,
+ 0x10a56, 0x10a57,
+ 0x11047, 0x11048,
+ 0x110be, 0x110c1,
+ 0x11141, 0x11143,
+ 0x111c5, 0x111c6,
+}; /* CR_STerm */
+
+/* 'Variation_Selector': Binary Property */
+static const OnigCodePoint CR_Variation_Selector[] = {
+ 3,
+ 0x180b, 0x180d,
+ 0xfe00, 0xfe0f,
+ 0xe0100, 0xe01ef,
+}; /* CR_Variation_Selector */
+
+/* 'Pattern_White_Space': Binary Property */
+static const OnigCodePoint CR_Pattern_White_Space[] = {
+ 5,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x200e, 0x200f,
+ 0x2028, 0x2029,
+}; /* CR_Pattern_White_Space */
+
+/* 'Pattern_Syntax': Binary Property */
+static const OnigCodePoint CR_Pattern_Syntax[] = {
+ 28,
+ 0x0021, 0x002f,
+ 0x003a, 0x0040,
+ 0x005b, 0x005e,
+ 0x0060, 0x0060,
+ 0x007b, 0x007e,
+ 0x00a1, 0x00a7,
+ 0x00a9, 0x00a9,
+ 0x00ab, 0x00ac,
+ 0x00ae, 0x00ae,
+ 0x00b0, 0x00b1,
+ 0x00b6, 0x00b6,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x00d7, 0x00d7,
+ 0x00f7, 0x00f7,
+ 0x2010, 0x2027,
+ 0x2030, 0x203e,
+ 0x2041, 0x2053,
+ 0x2055, 0x205e,
+ 0x2190, 0x245f,
+ 0x2500, 0x2775,
+ 0x2794, 0x2bff,
+ 0x2e00, 0x2e7f,
+ 0x3001, 0x3003,
+ 0x3008, 0x3020,
+ 0x3030, 0x3030,
+ 0xfd3e, 0xfd3f,
+ 0xfe45, 0xfe46,
+}; /* CR_Pattern_Syntax */
+
+/* 'Unknown': Script */
+static const OnigCodePoint CR_Unknown[] = {
+ 537,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0528, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058e,
+ 0x0590, 0x0590,
+ 0x05c8, 0x05cf,
+ 0x05eb, 0x05ef,
+ 0x05f5, 0x05ff,
+ 0x0605, 0x0605,
+ 0x061c, 0x061d,
+ 0x070e, 0x070e,
+ 0x074b, 0x074c,
+ 0x07b2, 0x07bf,
+ 0x07fb, 0x07ff,
+ 0x082e, 0x082f,
+ 0x083f, 0x083f,
+ 0x085c, 0x085d,
+ 0x085f, 0x089f,
+ 0x08a1, 0x08a1,
+ 0x08ad, 0x08e3,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0980, 0x0980,
+ 0x0984, 0x0984,
+ 0x098d, 0x098e,
+ 0x0991, 0x0992,
+ 0x09a9, 0x09a9,
+ 0x09b1, 0x09b1,
+ 0x09b3, 0x09b5,
+ 0x09ba, 0x09bb,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b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+ 0x0eba, 0x0eba,
+ 0x0ebe, 0x0ebf,
+ 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f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3f, 0xfb3f,
+ 0xfb42, 0xfb42,
+ 0xfb45, 0xfb45,
+ 0xfbc2, 0xfbd2,
+ 0xfd40, 0xfd4f,
+ 0xfd90, 0xfd91,
+ 0xfdc8, 0xfdef,
+ 0xfdfe, 0xfdff,
+ 0xfe1a, 0xfe1f,
+ 0xfe27, 0xfe2f,
+ 0xfe53, 0xfe53,
+ 0xfe67, 0xfe67,
+ 0xfe6c, 0xfe6f,
+ 0xfe75, 0xfe75,
+ 0xfefd, 0xfefe,
+ 0xff00, 0xff00,
+ 0xffbf, 0xffc1,
+ 0xffc8, 0xffc9,
+ 0xffd0, 0xffd1,
+ 0xffd8, 0xffd9,
+ 0xffdd, 0xffdf,
+ 0xffe7, 0xffe7,
+ 0xffef, 0xfff8,
+ 0xfffe, 0xffff,
+ 0x1000c, 0x1000c,
+ 0x10027, 0x10027,
+ 0x1003b, 0x1003b,
+ 0x1003e, 0x1003e,
+ 0x1004e, 0x1004f,
+ 0x1005e, 0x1007f,
+ 0x100fb, 0x100ff,
+ 0x10103, 0x10106,
+ 0x10134, 0x10136,
+ 0x1018b, 0x1018f,
+ 0x1019c, 0x101cf,
+ 0x101fe, 0x1027f,
+ 0x1029d, 0x1029f,
+ 0x102d1, 0x102ff,
+ 0x1031f, 0x1031f,
+ 0x10324, 0x1032f,
+ 0x1034b, 0x1037f,
+ 0x1039e, 0x1039e,
+ 0x103c4, 0x103c7,
+ 0x103d6, 0x103ff,
+ 0x1049e, 0x1049f,
+ 0x104aa, 0x107ff,
+ 0x10806, 0x10807,
+ 0x10809, 0x10809,
+ 0x10836, 0x10836,
+ 0x10839, 0x1083b,
+ 0x1083d, 0x1083e,
+ 0x10856, 0x10856,
+ 0x10860, 0x108ff,
+ 0x1091c, 0x1091e,
+ 0x1093a, 0x1093e,
+ 0x10940, 0x1097f,
+ 0x109b8, 0x109bd,
+ 0x109c0, 0x109ff,
+ 0x10a04, 0x10a04,
+ 0x10a07, 0x10a0b,
+ 0x10a14, 0x10a14,
+ 0x10a18, 0x10a18,
+ 0x10a34, 0x10a37,
+ 0x10a3b, 0x10a3e,
+ 0x10a48, 0x10a4f,
+ 0x10a59, 0x10a5f,
+ 0x10a80, 0x10aff,
+ 0x10b36, 0x10b38,
+ 0x10b56, 0x10b57,
+ 0x10b73, 0x10b77,
+ 0x10b80, 0x10bff,
+ 0x10c49, 0x10e5f,
+ 0x10e7f, 0x10fff,
+ 0x1104e, 0x11051,
+ 0x11070, 0x1107f,
+ 0x110c2, 0x110cf,
+ 0x110e9, 0x110ef,
+ 0x110fa, 0x110ff,
+ 0x11135, 0x11135,
+ 0x11144, 0x1117f,
+ 0x111c9, 0x111cf,
+ 0x111da, 0x1167f,
+ 0x116b8, 0x116bf,
+ 0x116ca, 0x11fff,
+ 0x1236f, 0x123ff,
+ 0x12463, 0x1246f,
+ 0x12474, 0x12fff,
+ 0x1342f, 0x167ff,
+ 0x16a39, 0x16eff,
+ 0x16f45, 0x16f4f,
+ 0x16f7f, 0x16f8e,
+ 0x16fa0, 0x1afff,
+ 0x1b002, 0x1cfff,
+ 0x1d0f6, 0x1d0ff,
+ 0x1d127, 0x1d128,
+ 0x1d1de, 0x1d1ff,
+ 0x1d246, 0x1d2ff,
+ 0x1d357, 0x1d35f,
+ 0x1d372, 0x1d3ff,
+ 0x1d455, 0x1d455,
+ 0x1d49d, 0x1d49d,
+ 0x1d4a0, 0x1d4a1,
+ 0x1d4a3, 0x1d4a4,
+ 0x1d4a7, 0x1d4a8,
+ 0x1d4ad, 0x1d4ad,
+ 0x1d4ba, 0x1d4ba,
+ 0x1d4bc, 0x1d4bc,
+ 0x1d4c4, 0x1d4c4,
+ 0x1d506, 0x1d506,
+ 0x1d50b, 0x1d50c,
+ 0x1d515, 0x1d515,
+ 0x1d51d, 0x1d51d,
+ 0x1d53a, 0x1d53a,
+ 0x1d53f, 0x1d53f,
+ 0x1d545, 0x1d545,
+ 0x1d547, 0x1d549,
+ 0x1d551, 0x1d551,
+ 0x1d6a6, 0x1d6a7,
+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x1f37f,
+ 0x1f394, 0x1f39f,
+ 0x1f3c5, 0x1f3c5,
+ 0x1f3cb, 0x1f3df,
+ 0x1f3f1, 0x1f3ff,
+ 0x1f43f, 0x1f43f,
+ 0x1f441, 0x1f441,
+ 0x1f4f8, 0x1f4f8,
+ 0x1f4fd, 0x1f4ff,
+ 0x1f53e, 0x1f53f,
+ 0x1f544, 0x1f54f,
+ 0x1f568, 0x1f5fa,
+ 0x1f641, 0x1f644,
+ 0x1f650, 0x1f67f,
+ 0x1f6c6, 0x1f6ff,
+ 0x1f774, 0x1ffff,
+ 0x2a6d7, 0x2a6ff,
+ 0x2b735, 0x2b73f,
+ 0x2b81e, 0x2f7ff,
+ 0x2fa1e, 0xe0000,
+ 0xe0002, 0xe001f,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_Unknown */
+
+/* 'Age_1_1': Derived Age 1.1 */
+static const OnigCodePoint CR_Age_1_1[] = {
+ 288,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 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
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20aa,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xe000, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+}; /* CR_Age_1_1 */
+
+/* 'Age_2_0': Derived Age 2.0 */
+static const OnigCodePoint CR_Age_2_0[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04eb,
+ 0x04ee, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x0589,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
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,
+ 0x2000, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ab,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffd, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_2_0 */
+
+/* 'Age_2_1': Derived Age 2.1 */
+static const OnigCodePoint CR_Age_2_1[] = {
+ 312,
+ 0x0000, 0x01f5,
+ 0x01fa, 0x0217,
+ 0x0250, 0x02a8,
+ 0x02b0, 0x02de,
+ 0x02e0, 0x02e9,
+ 0x0300, 0x0345,
+ 0x0360, 0x0361,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d6,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03f3,
+ 0x0401, 0x040c,
+ 0x040e, 0x044f,
+ 0x0451, 0x045c,
+ 0x045e, 0x0486,
+ 0x0490, 0x04c4,
+ 0x04c7, 0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1f15,
+ 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, 0x202e,
+ 0x2030, 0x2046,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20ac,
+ 0x20d0, 0x20e1,
+ 0x2100, 0x2138,
+ 0x2153, 0x2182,
+ 0x2190, 0x21ea,
+ 0x2200, 0x22f1,
+ 0x2300, 0x2300,
+ 0x2302, 0x237a,
+ 0x2400, 0x2424,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25ef,
+ 0x2600, 0x2613,
+ 0x261a, 0x266f,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x3000, 0x3037,
+ 0x303f, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x319f,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe,
+ 0x4e00, 0x9fa5,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1e, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe20, 0xfe23,
+ 0xfe30, 0xfe44,
+ 0xfe49, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe72,
+ 0xfe74, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xff5e,
+ 0xff61, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfffc, 0xffff,
+ 0x1fffe, 0x1ffff,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_2_1 */
+
+/* 'Age_3_0': Derived Age 3.0 */
+static const OnigCodePoint CR_Age_3_0[] = {
+ 369,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f3,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0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0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6a,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fcf, 0x0fcf,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f6,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2046,
+ 0x2048, 0x204d,
+ 0x206a, 0x2070,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20af,
+ 0x20d0, 0x20e3,
+ 0x2100, 0x213a,
+ 0x2153, 0x2183,
+ 0x2190, 0x21f3,
+ 0x2200, 0x22f1,
+ 0x2300, 0x237b,
+ 0x237d, 0x239a,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24ea,
+ 0x2500, 0x2595,
+ 0x25a0, 0x25f7,
+ 0x2600, 0x2613,
+ 0x2619, 0x2671,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2767,
+ 0x2776, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x2800, 0x28ff,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303a,
+ 0x303e, 0x303f,
+ 0x3041, 0x3094,
+ 0x3099, 0x309e,
+ 0x30a1, 0x30fe,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x3200, 0x321c,
+ 0x3220, 0x3243,
+ 0x3260, 0x327b,
+ 0x327f, 0x32b0,
+ 0x32c0, 0x32cb,
+ 0x32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_0 */
+
+/* 'Age_3_1': Derived Age 3.1 */
+static const OnigCodePoint CR_Age_3_1[] = {
+ 402,
+ 0x0000, 0x021f,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034e,
+ 0x0360, 0x0362,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03d7,
+ 0x03da, 0x03f5,
+ 0x0400, 0x0486,
+ 0x0488, 0x0489,
+ 0x048c, 0x04c4,
+ 0x04c7, 0x04c8,
+ 0x04cb, 0x04cc,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x066d,
+ 0x0670, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b0,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd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d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c0,
+ 0x1d4c2, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_1 */
+
+/* 'Age_3_2': Derived Age 3.2 */
+static const OnigCodePoint CR_Age_3_2[] = {
+ 397,
+ 0x0000, 0x0220,
+ 0x0222, 0x0233,
+ 0x0250, 0x02ad,
+ 0x02b0, 0x02ee,
+ 0x0300, 0x034f,
+ 0x0360, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03f6,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x060c, 0x060c,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x0655,
+ 0x0660, 0x06ed,
+ 0x06f0, 0x06fe,
+ 0x0700, 0x070d,
+ 0x070f, 0x072c,
+ 0x0730, 0x074a,
+ 0x0780, 0x07b1,
+ 0x0901, 0x0903,
+ 0x0905, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09bc,
+ 0x09be, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cd,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fa,
+ 0x0a02, 0x0a02,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x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a,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fcf, 0x0fcf,
+ 0x1000, 0x1021,
+ 0x1023, 0x1027,
+ 0x1029, 0x102a,
+ 0x102c, 0x1032,
+ 0x1036, 0x1039,
+ 0x1040, 0x1059,
+ 0x10a0, 0x10c5,
+ 0x10d0, 0x10f8,
+ 0x10fb, 0x10fb,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1206,
+ 0x1208, 0x1246,
+ 0x1248, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1286,
+ 0x1288, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12ae,
+ 0x12b0, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12ce,
+ 0x12d0, 0x12d6,
+ 0x12d8, 0x12ee,
+ 0x12f0, 0x130e,
+ 0x1310, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x131e,
+ 0x1320, 0x1346,
+ 0x1348, 0x135a,
+ 0x1361, 0x137c,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dc,
+ 0x17e0, 0x17e9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18a9,
+ 0x1e00, 0x1e9b,
+ 0x1ea0, 0x1ef9,
+ 0x1f00, 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, 0x2052,
+ 0x2057, 0x2057,
+ 0x205f, 0x2063,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20b1,
+ 0x20d0, 0x20ea,
+ 0x2100, 0x213a,
+ 0x213d, 0x214b,
+ 0x2153, 0x2183,
+ 0x2190, 0x23ce,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x24fe,
+ 0x2500, 0x2613,
+ 0x2616, 0x2617,
+ 0x2619, 0x267d,
+ 0x2680, 0x2689,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x27d0, 0x27eb,
+ 0x27f0, 0x2aff,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31f0, 0x321c,
+ 0x3220, 0x3243,
+ 0x3251, 0x327b,
+ 0x327f, 0x32cb,
+ 0x32d0, 0x32fe,
+ 0x3300, 0x3376,
+ 0x337b, 0x33dd,
+ 0x33e0, 0x33fe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1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_3_2 */
+
+/* 'Age_4_0': Derived Age 4.0 */
+static const OnigCodePoint CR_Age_4_0[] = {
+ 412,
+ 0x0000, 0x0236,
+ 0x0250, 0x0357,
+ 0x035d, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x03fb,
+ 0x0400, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f5,
+ 0x04f8, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05a1,
+ 0x05a3, 0x05b9,
+ 0x05bb, 0x05c4,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060c, 0x0615,
+ 0x061b, 0x061b,
+ 0x061f, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x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 0x2057, 0x2057,
+ 0x205f, 0x2063,
+ 0x206a, 0x2071,
+ 0x2074, 0x208e,
+ 0x20a0, 0x20b1,
+ 0x20d0, 0x20ea,
+ 0x2100, 0x213b,
+ 0x213d, 0x214b,
+ 0x2153, 0x2183,
+ 0x2190, 0x23d0,
+ 0x2400, 0x2426,
+ 0x2440, 0x244a,
+ 0x2460, 0x2617,
+ 0x2619, 0x267d,
+ 0x2680, 0x2691,
+ 0x26a0, 0x26a1,
+ 0x2701, 0x2704,
+ 0x2706, 0x2709,
+ 0x270c, 0x2727,
+ 0x2729, 0x274b,
+ 0x274d, 0x274d,
+ 0x274f, 0x2752,
+ 0x2756, 0x2756,
+ 0x2758, 0x275e,
+ 0x2761, 0x2794,
+ 0x2798, 0x27af,
+ 0x27b1, 0x27be,
+ 0x27d0, 0x27eb,
+ 0x27f0, 0x2b0d,
+ 0x2e80, 0x2e99,
+ 0x2e9b, 0x2ef3,
+ 0x2f00, 0x2fd5,
+ 0x2ff0, 0x2ffb,
+ 0x3000, 0x303f,
+ 0x3041, 0x3096,
+ 0x3099, 0x30ff,
+ 0x3105, 0x312c,
+ 0x3131, 0x318e,
+ 0x3190, 0x31b7,
+ 0x31f0, 0x321e,
+ 0x3220, 0x3243,
+ 0x3250, 0x327d,
+ 0x327f, 0x32fe,
+ 0x3300, 0x4db5,
+ 0x4dc0, 0x9fa5,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe23,
+ 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, 0x1013f,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x1039f,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x1083f,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d300, 0x1d356,
+ 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, 0x1d6a3,
+ 0x1d6a8, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_0 */
+
+/* 'Age_4_1': Derived Age 4.1 */
+static const OnigCodePoint CR_Age_4_1[] = {
+ 430,
+ 0x0000, 0x0241,
+ 0x0250, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037a,
+ 0x037e, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x04ce,
+ 0x04d0, 0x04f9,
+ 0x0500, 0x050f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05b9,
+ 0x05bb, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060b, 0x0615,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x063a,
+ 0x0640, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x076d,
+ 0x0780, 0x07b1,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0970,
+ 0x097d, 0x097d,
+ 0x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fbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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, 0x1083f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d12a, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 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, 0x1d7c9,
+ 0x1d7ce, 0x1d7ff,
+ 0x1fffe, 0x2a6d6,
+ 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_4_1 */
+
+/* 'Age_5_0': Derived Age 5.0 */
+static const OnigCodePoint CR_Age_5_0[] = {
+ 440,
+ 0x0000, 0x036f,
+ 0x0374, 0x0375,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03ce,
+ 0x03d0, 0x0486,
+ 0x0488, 0x0513,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x060b, 0x0615,
+ 0x061b, 0x061b,
+ 0x061e, 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4db5,
+ 0x4dc0, 0x9fbb,
+ 0xa000, 0xa48c,
+ 0xa490, 0xa4c6,
+ 0xa700, 0xa71a,
+ 0xa720, 0xa721,
+ 0xa800, 0xa82b,
+ 0xa840, 0xa877,
+ 0xac00, 0xd7a3,
+ 0xd800, 0xfa2d,
+ 0xfa30, 0xfa6a,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdd0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe23,
+ 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,
+ 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,
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 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_5_0 */
+
+/* 'Age_5_1': Derived Age 5.1 */
+static const OnigCodePoint CR_Age_5_1[] = {
+ 455,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0523,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x061f,
+ 0x0621, 0x065e,
+ 0x0660, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0901, 0x0939,
+ 0x093c, 0x094d,
+ 0x0950, 0x0954,
+ 0x0958, 0x0972,
+ 0x097b, 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, 0x09fa,
+ 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,
+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ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f8b,
+ 0x0f90, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fd4,
+ 0x1000, 0x1099,
+ 0x109e, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1159,
+ 0x115f, 0x11a2,
+ 0x11a8, 0x11f9,
+ 0x1200, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x1676,
+ 0x1680, 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,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19a9,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a1f,
+ 0x1b00, 0x1b4b,
+ 0x1b50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
+ 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, 0x1083f,
+ 0x10900, 0x10919,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1fffe, 0x2a6d6,
+ 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_5_1 */
+
+/* 'Age_5_2': Derived Age 5.2 */
+static const OnigCodePoint CR_Age_5_2[] = {
+ 495,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0525,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0,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, 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,
+ 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,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1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xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_5_2 */
+
+/* 'Age_6_0': Derived Age 6.0 */
+static const OnigCodePoint CR_Age_6_0[] = {
+ 511,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0603,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0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ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edd,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10d0, 0x10fc,
+ 0x1100, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 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,
+ 0x1aa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46, 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,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f169,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f5ff,
+ 0x1f601, 0x1f610,
+ 0x1f612, 0x1f614,
+ 0x1f616, 0x1f616,
+ 0x1f618, 0x1f618,
+ 0x1f61a, 0x1f61a,
+ 0x1f61c, 0x1f61e,
+ 0x1f620, 0x1f625,
+ 0x1f628, 0x1f62b,
+ 0x1f62d, 0x1f62d,
+ 0x1f630, 0x1f633,
+ 0x1f635, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 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_0 */
+
+/* 'Age_6_1': Derived Age 6.1 */
+static const OnigCodePoint CR_Age_6_1[] = {
+ 549,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 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, 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,
+ 0x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 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, 0x116b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+ 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_1 */
+
+/* 'In_Basic_Latin': Block */
+#define CR_In_Basic_Latin CR_ASCII
+
+/* 'In_Latin_1_Supplement': Block */
+static const OnigCodePoint CR_In_Latin_1_Supplement[] = {
+ 1,
+ 0x0080, 0x00ff,
+}; /* CR_In_Latin_1_Supplement */
+
+/* 'In_Latin_Extended_A': Block */
+static const OnigCodePoint CR_In_Latin_Extended_A[] = {
+ 1,
+ 0x0100, 0x017f,
+}; /* CR_In_Latin_Extended_A */
+
+/* 'In_Latin_Extended_B': Block */
+static const OnigCodePoint CR_In_Latin_Extended_B[] = {
+ 1,
+ 0x0180, 0x024f,
+}; /* CR_In_Latin_Extended_B */
+
+/* 'In_IPA_Extensions': Block */
+static const OnigCodePoint CR_In_IPA_Extensions[] = {
+ 1,
+ 0x0250, 0x02af,
+}; /* CR_In_IPA_Extensions */
+
+/* 'In_Spacing_Modifier_Letters': Block */
+static const OnigCodePoint CR_In_Spacing_Modifier_Letters[] = {
+ 1,
+ 0x02b0, 0x02ff,
+}; /* CR_In_Spacing_Modifier_Letters */
+
+/* 'In_Combining_Diacritical_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks[] = {
+ 1,
+ 0x0300, 0x036f,
+}; /* CR_In_Combining_Diacritical_Marks */
+
+/* 'In_Greek_and_Coptic': Block */
+static const OnigCodePoint CR_In_Greek_and_Coptic[] = {
+ 1,
+ 0x0370, 0x03ff,
+}; /* CR_In_Greek_and_Coptic */
+
+/* 'In_Cyrillic': Block */
+static const OnigCodePoint CR_In_Cyrillic[] = {
+ 1,
+ 0x0400, 0x04ff,
+}; /* CR_In_Cyrillic */
+
+/* 'In_Cyrillic_Supplement': Block */
+static const OnigCodePoint CR_In_Cyrillic_Supplement[] = {
+ 1,
+ 0x0500, 0x052f,
+}; /* CR_In_Cyrillic_Supplement */
+
+/* 'In_Armenian': Block */
+static const OnigCodePoint CR_In_Armenian[] = {
+ 1,
+ 0x0530, 0x058f,
+}; /* CR_In_Armenian */
+
+/* 'In_Hebrew': Block */
+static const OnigCodePoint CR_In_Hebrew[] = {
+ 1,
+ 0x0590, 0x05ff,
+}; /* CR_In_Hebrew */
+
+/* 'In_Arabic': Block */
+static const OnigCodePoint CR_In_Arabic[] = {
+ 1,
+ 0x0600, 0x06ff,
+}; /* CR_In_Arabic */
+
+/* 'In_Syriac': Block */
+static const OnigCodePoint CR_In_Syriac[] = {
+ 1,
+ 0x0700, 0x074f,
+}; /* CR_In_Syriac */
+
+/* 'In_Arabic_Supplement': Block */
+static const OnigCodePoint CR_In_Arabic_Supplement[] = {
+ 1,
+ 0x0750, 0x077f,
+}; /* CR_In_Arabic_Supplement */
+
+/* 'In_Thaana': Block */
+static const OnigCodePoint CR_In_Thaana[] = {
+ 1,
+ 0x0780, 0x07bf,
+}; /* CR_In_Thaana */
+
+/* 'In_NKo': Block */
+static const OnigCodePoint CR_In_NKo[] = {
+ 1,
+ 0x07c0, 0x07ff,
+}; /* CR_In_NKo */
+
+/* 'In_Samaritan': Block */
+static const OnigCodePoint CR_In_Samaritan[] = {
+ 1,
+ 0x0800, 0x083f,
+}; /* CR_In_Samaritan */
+
+/* 'In_Mandaic': Block */
+static const OnigCodePoint CR_In_Mandaic[] = {
+ 1,
+ 0x0840, 0x085f,
+}; /* CR_In_Mandaic */
+
+/* 'In_Arabic_Extended_A': Block */
+static const OnigCodePoint CR_In_Arabic_Extended_A[] = {
+ 1,
+ 0x08a0, 0x08ff,
+}; /* CR_In_Arabic_Extended_A */
+
+/* 'In_Devanagari': Block */
+static const OnigCodePoint CR_In_Devanagari[] = {
+ 1,
+ 0x0900, 0x097f,
+}; /* CR_In_Devanagari */
+
+/* 'In_Bengali': Block */
+static const OnigCodePoint CR_In_Bengali[] = {
+ 1,
+ 0x0980, 0x09ff,
+}; /* CR_In_Bengali */
+
+/* 'In_Gurmukhi': Block */
+static const OnigCodePoint CR_In_Gurmukhi[] = {
+ 1,
+ 0x0a00, 0x0a7f,
+}; /* CR_In_Gurmukhi */
+
+/* 'In_Gujarati': Block */
+static const OnigCodePoint CR_In_Gujarati[] = {
+ 1,
+ 0x0a80, 0x0aff,
+}; /* CR_In_Gujarati */
+
+/* 'In_Oriya': Block */
+static const OnigCodePoint CR_In_Oriya[] = {
+ 1,
+ 0x0b00, 0x0b7f,
+}; /* CR_In_Oriya */
+
+/* 'In_Tamil': Block */
+static const OnigCodePoint CR_In_Tamil[] = {
+ 1,
+ 0x0b80, 0x0bff,
+}; /* CR_In_Tamil */
+
+/* 'In_Telugu': Block */
+static const OnigCodePoint CR_In_Telugu[] = {
+ 1,
+ 0x0c00, 0x0c7f,
+}; /* CR_In_Telugu */
+
+/* 'In_Kannada': Block */
+static const OnigCodePoint CR_In_Kannada[] = {
+ 1,
+ 0x0c80, 0x0cff,
+}; /* CR_In_Kannada */
+
+/* 'In_Malayalam': Block */
+static const OnigCodePoint CR_In_Malayalam[] = {
+ 1,
+ 0x0d00, 0x0d7f,
+}; /* CR_In_Malayalam */
+
+/* 'In_Sinhala': Block */
+static const OnigCodePoint CR_In_Sinhala[] = {
+ 1,
+ 0x0d80, 0x0dff,
+}; /* CR_In_Sinhala */
+
+/* 'In_Thai': Block */
+static const OnigCodePoint CR_In_Thai[] = {
+ 1,
+ 0x0e00, 0x0e7f,
+}; /* CR_In_Thai */
+
+/* 'In_Lao': Block */
+static const OnigCodePoint CR_In_Lao[] = {
+ 1,
+ 0x0e80, 0x0eff,
+}; /* CR_In_Lao */
+
+/* 'In_Tibetan': Block */
+static const OnigCodePoint CR_In_Tibetan[] = {
+ 1,
+ 0x0f00, 0x0fff,
+}; /* CR_In_Tibetan */
+
+/* 'In_Myanmar': Block */
+static const OnigCodePoint CR_In_Myanmar[] = {
+ 1,
+ 0x1000, 0x109f,
+}; /* CR_In_Myanmar */
+
+/* 'In_Georgian': Block */
+static const OnigCodePoint CR_In_Georgian[] = {
+ 1,
+ 0x10a0, 0x10ff,
+}; /* CR_In_Georgian */
+
+/* 'In_Hangul_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo[] = {
+ 1,
+ 0x1100, 0x11ff,
+}; /* CR_In_Hangul_Jamo */
+
+/* 'In_Ethiopic': Block */
+static const OnigCodePoint CR_In_Ethiopic[] = {
+ 1,
+ 0x1200, 0x137f,
+}; /* CR_In_Ethiopic */
+
+/* 'In_Ethiopic_Supplement': Block */
+static const OnigCodePoint CR_In_Ethiopic_Supplement[] = {
+ 1,
+ 0x1380, 0x139f,
+}; /* CR_In_Ethiopic_Supplement */
+
+/* 'In_Cherokee': Block */
+static const OnigCodePoint CR_In_Cherokee[] = {
+ 1,
+ 0x13a0, 0x13ff,
+}; /* CR_In_Cherokee */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics[] = {
+ 1,
+ 0x1400, 0x167f,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics */
+
+/* 'In_Ogham': Block */
+static const OnigCodePoint CR_In_Ogham[] = {
+ 1,
+ 0x1680, 0x169f,
+}; /* CR_In_Ogham */
+
+/* 'In_Runic': Block */
+static const OnigCodePoint CR_In_Runic[] = {
+ 1,
+ 0x16a0, 0x16ff,
+}; /* CR_In_Runic */
+
+/* 'In_Tagalog': Block */
+static const OnigCodePoint CR_In_Tagalog[] = {
+ 1,
+ 0x1700, 0x171f,
+}; /* CR_In_Tagalog */
+
+/* 'In_Hanunoo': Block */
+static const OnigCodePoint CR_In_Hanunoo[] = {
+ 1,
+ 0x1720, 0x173f,
+}; /* CR_In_Hanunoo */
+
+/* 'In_Buhid': Block */
+static const OnigCodePoint CR_In_Buhid[] = {
+ 1,
+ 0x1740, 0x175f,
+}; /* CR_In_Buhid */
+
+/* 'In_Tagbanwa': Block */
+static const OnigCodePoint CR_In_Tagbanwa[] = {
+ 1,
+ 0x1760, 0x177f,
+}; /* CR_In_Tagbanwa */
+
+/* 'In_Khmer': Block */
+static const OnigCodePoint CR_In_Khmer[] = {
+ 1,
+ 0x1780, 0x17ff,
+}; /* CR_In_Khmer */
+
+/* 'In_Mongolian': Block */
+static const OnigCodePoint CR_In_Mongolian[] = {
+ 1,
+ 0x1800, 0x18af,
+}; /* CR_In_Mongolian */
+
+/* 'In_Unified_Canadian_Aboriginal_Syllabics_Extended': Block */
+static const OnigCodePoint CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended[] = {
+ 1,
+ 0x18b0, 0x18ff,
+}; /* CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended */
+
+/* 'In_Limbu': Block */
+static const OnigCodePoint CR_In_Limbu[] = {
+ 1,
+ 0x1900, 0x194f,
+}; /* CR_In_Limbu */
+
+/* 'In_Tai_Le': Block */
+static const OnigCodePoint CR_In_Tai_Le[] = {
+ 1,
+ 0x1950, 0x197f,
+}; /* CR_In_Tai_Le */
+
+/* 'In_New_Tai_Lue': Block */
+static const OnigCodePoint CR_In_New_Tai_Lue[] = {
+ 1,
+ 0x1980, 0x19df,
+}; /* CR_In_New_Tai_Lue */
+
+/* 'In_Khmer_Symbols': Block */
+static const OnigCodePoint CR_In_Khmer_Symbols[] = {
+ 1,
+ 0x19e0, 0x19ff,
+}; /* CR_In_Khmer_Symbols */
+
+/* 'In_Buginese': Block */
+static const OnigCodePoint CR_In_Buginese[] = {
+ 1,
+ 0x1a00, 0x1a1f,
+}; /* CR_In_Buginese */
+
+/* 'In_Tai_Tham': Block */
+static const OnigCodePoint CR_In_Tai_Tham[] = {
+ 1,
+ 0x1a20, 0x1aaf,
+}; /* CR_In_Tai_Tham */
+
+/* 'In_Balinese': Block */
+static const OnigCodePoint CR_In_Balinese[] = {
+ 1,
+ 0x1b00, 0x1b7f,
+}; /* CR_In_Balinese */
+
+/* 'In_Sundanese': Block */
+static const OnigCodePoint CR_In_Sundanese[] = {
+ 1,
+ 0x1b80, 0x1bbf,
+}; /* CR_In_Sundanese */
+
+/* 'In_Batak': Block */
+static const OnigCodePoint CR_In_Batak[] = {
+ 1,
+ 0x1bc0, 0x1bff,
+}; /* CR_In_Batak */
+
+/* 'In_Lepcha': Block */
+static const OnigCodePoint CR_In_Lepcha[] = {
+ 1,
+ 0x1c00, 0x1c4f,
+}; /* CR_In_Lepcha */
+
+/* 'In_Ol_Chiki': Block */
+#define CR_In_Ol_Chiki CR_Ol_Chiki
+
+/* 'In_Sundanese_Supplement': Block */
+static const OnigCodePoint CR_In_Sundanese_Supplement[] = {
+ 1,
+ 0x1cc0, 0x1ccf,
+}; /* CR_In_Sundanese_Supplement */
+
+/* 'In_Vedic_Extensions': Block */
+static const OnigCodePoint CR_In_Vedic_Extensions[] = {
+ 1,
+ 0x1cd0, 0x1cff,
+}; /* CR_In_Vedic_Extensions */
+
+/* 'In_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions[] = {
+ 1,
+ 0x1d00, 0x1d7f,
+}; /* CR_In_Phonetic_Extensions */
+
+/* 'In_Phonetic_Extensions_Supplement': Block */
+static const OnigCodePoint CR_In_Phonetic_Extensions_Supplement[] = {
+ 1,
+ 0x1d80, 0x1dbf,
+}; /* CR_In_Phonetic_Extensions_Supplement */
+
+/* 'In_Combining_Diacritical_Marks_Supplement': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_Supplement[] = {
+ 1,
+ 0x1dc0, 0x1dff,
+}; /* CR_In_Combining_Diacritical_Marks_Supplement */
+
+/* 'In_Latin_Extended_Additional': Block */
+static const OnigCodePoint CR_In_Latin_Extended_Additional[] = {
+ 1,
+ 0x1e00, 0x1eff,
+}; /* CR_In_Latin_Extended_Additional */
+
+/* 'In_Greek_Extended': Block */
+static const OnigCodePoint CR_In_Greek_Extended[] = {
+ 1,
+ 0x1f00, 0x1fff,
+}; /* CR_In_Greek_Extended */
+
+/* 'In_General_Punctuation': Block */
+static const OnigCodePoint CR_In_General_Punctuation[] = {
+ 1,
+ 0x2000, 0x206f,
+}; /* CR_In_General_Punctuation */
+
+/* 'In_Superscripts_and_Subscripts': Block */
+static const OnigCodePoint CR_In_Superscripts_and_Subscripts[] = {
+ 1,
+ 0x2070, 0x209f,
+}; /* CR_In_Superscripts_and_Subscripts */
+
+/* 'In_Currency_Symbols': Block */
+static const OnigCodePoint CR_In_Currency_Symbols[] = {
+ 1,
+ 0x20a0, 0x20cf,
+}; /* CR_In_Currency_Symbols */
+
+/* 'In_Combining_Diacritical_Marks_for_Symbols': Block */
+static const OnigCodePoint CR_In_Combining_Diacritical_Marks_for_Symbols[] = {
+ 1,
+ 0x20d0, 0x20ff,
+}; /* CR_In_Combining_Diacritical_Marks_for_Symbols */
+
+/* 'In_Letterlike_Symbols': Block */
+static const OnigCodePoint CR_In_Letterlike_Symbols[] = {
+ 1,
+ 0x2100, 0x214f,
+}; /* CR_In_Letterlike_Symbols */
+
+/* 'In_Number_Forms': Block */
+static const OnigCodePoint CR_In_Number_Forms[] = {
+ 1,
+ 0x2150, 0x218f,
+}; /* CR_In_Number_Forms */
+
+/* 'In_Arrows': Block */
+static const OnigCodePoint CR_In_Arrows[] = {
+ 1,
+ 0x2190, 0x21ff,
+}; /* CR_In_Arrows */
+
+/* 'In_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Mathematical_Operators[] = {
+ 1,
+ 0x2200, 0x22ff,
+}; /* CR_In_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Technical': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Technical[] = {
+ 1,
+ 0x2300, 0x23ff,
+}; /* CR_In_Miscellaneous_Technical */
+
+/* 'In_Control_Pictures': Block */
+static const OnigCodePoint CR_In_Control_Pictures[] = {
+ 1,
+ 0x2400, 0x243f,
+}; /* CR_In_Control_Pictures */
+
+/* 'In_Optical_Character_Recognition': Block */
+static const OnigCodePoint CR_In_Optical_Character_Recognition[] = {
+ 1,
+ 0x2440, 0x245f,
+}; /* CR_In_Optical_Character_Recognition */
+
+/* 'In_Enclosed_Alphanumerics': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumerics[] = {
+ 1,
+ 0x2460, 0x24ff,
+}; /* CR_In_Enclosed_Alphanumerics */
+
+/* 'In_Box_Drawing': Block */
+static const OnigCodePoint CR_In_Box_Drawing[] = {
+ 1,
+ 0x2500, 0x257f,
+}; /* CR_In_Box_Drawing */
+
+/* 'In_Block_Elements': Block */
+static const OnigCodePoint CR_In_Block_Elements[] = {
+ 1,
+ 0x2580, 0x259f,
+}; /* CR_In_Block_Elements */
+
+/* 'In_Geometric_Shapes': Block */
+static const OnigCodePoint CR_In_Geometric_Shapes[] = {
+ 1,
+ 0x25a0, 0x25ff,
+}; /* CR_In_Geometric_Shapes */
+
+/* 'In_Miscellaneous_Symbols': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols[] = {
+ 1,
+ 0x2600, 0x26ff,
+}; /* CR_In_Miscellaneous_Symbols */
+
+/* 'In_Dingbats': Block */
+static const OnigCodePoint CR_In_Dingbats[] = {
+ 1,
+ 0x2700, 0x27bf,
+}; /* CR_In_Dingbats */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_A': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_A[] = {
+ 1,
+ 0x27c0, 0x27ef,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_A */
+
+/* 'In_Supplemental_Arrows_A': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_A[] = {
+ 1,
+ 0x27f0, 0x27ff,
+}; /* CR_In_Supplemental_Arrows_A */
+
+/* 'In_Braille_Patterns': Block */
+#define CR_In_Braille_Patterns CR_Braille
+
+/* 'In_Supplemental_Arrows_B': Block */
+static const OnigCodePoint CR_In_Supplemental_Arrows_B[] = {
+ 1,
+ 0x2900, 0x297f,
+}; /* CR_In_Supplemental_Arrows_B */
+
+/* 'In_Miscellaneous_Mathematical_Symbols_B': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Mathematical_Symbols_B[] = {
+ 1,
+ 0x2980, 0x29ff,
+}; /* CR_In_Miscellaneous_Mathematical_Symbols_B */
+
+/* 'In_Supplemental_Mathematical_Operators': Block */
+static const OnigCodePoint CR_In_Supplemental_Mathematical_Operators[] = {
+ 1,
+ 0x2a00, 0x2aff,
+}; /* CR_In_Supplemental_Mathematical_Operators */
+
+/* 'In_Miscellaneous_Symbols_and_Arrows': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_and_Arrows[] = {
+ 1,
+ 0x2b00, 0x2bff,
+}; /* CR_In_Miscellaneous_Symbols_and_Arrows */
+
+/* 'In_Glagolitic': Block */
+static const OnigCodePoint CR_In_Glagolitic[] = {
+ 1,
+ 0x2c00, 0x2c5f,
+}; /* CR_In_Glagolitic */
+
+/* 'In_Latin_Extended_C': Block */
+static const OnigCodePoint CR_In_Latin_Extended_C[] = {
+ 1,
+ 0x2c60, 0x2c7f,
+}; /* CR_In_Latin_Extended_C */
+
+/* 'In_Coptic': Block */
+static const OnigCodePoint CR_In_Coptic[] = {
+ 1,
+ 0x2c80, 0x2cff,
+}; /* CR_In_Coptic */
+
+/* 'In_Georgian_Supplement': Block */
+static const OnigCodePoint CR_In_Georgian_Supplement[] = {
+ 1,
+ 0x2d00, 0x2d2f,
+}; /* CR_In_Georgian_Supplement */
+
+/* 'In_Tifinagh': Block */
+static const OnigCodePoint CR_In_Tifinagh[] = {
+ 1,
+ 0x2d30, 0x2d7f,
+}; /* CR_In_Tifinagh */
+
+/* 'In_Ethiopic_Extended': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended[] = {
+ 1,
+ 0x2d80, 0x2ddf,
+}; /* CR_In_Ethiopic_Extended */
+
+/* 'In_Cyrillic_Extended_A': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_A[] = {
+ 1,
+ 0x2de0, 0x2dff,
+}; /* CR_In_Cyrillic_Extended_A */
+
+/* 'In_Supplemental_Punctuation': Block */
+static const OnigCodePoint CR_In_Supplemental_Punctuation[] = {
+ 1,
+ 0x2e00, 0x2e7f,
+}; /* CR_In_Supplemental_Punctuation */
+
+/* 'In_CJK_Radicals_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Radicals_Supplement[] = {
+ 1,
+ 0x2e80, 0x2eff,
+}; /* CR_In_CJK_Radicals_Supplement */
+
+/* 'In_Kangxi_Radicals': Block */
+static const OnigCodePoint CR_In_Kangxi_Radicals[] = {
+ 1,
+ 0x2f00, 0x2fdf,
+}; /* CR_In_Kangxi_Radicals */
+
+/* 'In_Ideographic_Description_Characters': Block */
+static const OnigCodePoint CR_In_Ideographic_Description_Characters[] = {
+ 1,
+ 0x2ff0, 0x2fff,
+}; /* CR_In_Ideographic_Description_Characters */
+
+/* 'In_CJK_Symbols_and_Punctuation': Block */
+static const OnigCodePoint CR_In_CJK_Symbols_and_Punctuation[] = {
+ 1,
+ 0x3000, 0x303f,
+}; /* CR_In_CJK_Symbols_and_Punctuation */
+
+/* 'In_Hiragana': Block */
+static const OnigCodePoint CR_In_Hiragana[] = {
+ 1,
+ 0x3040, 0x309f,
+}; /* CR_In_Hiragana */
+
+/* 'In_Katakana': Block */
+static const OnigCodePoint CR_In_Katakana[] = {
+ 1,
+ 0x30a0, 0x30ff,
+}; /* CR_In_Katakana */
+
+/* 'In_Bopomofo': Block */
+static const OnigCodePoint CR_In_Bopomofo[] = {
+ 1,
+ 0x3100, 0x312f,
+}; /* CR_In_Bopomofo */
+
+/* 'In_Hangul_Compatibility_Jamo': Block */
+static const OnigCodePoint CR_In_Hangul_Compatibility_Jamo[] = {
+ 1,
+ 0x3130, 0x318f,
+}; /* CR_In_Hangul_Compatibility_Jamo */
+
+/* 'In_Kanbun': Block */
+static const OnigCodePoint CR_In_Kanbun[] = {
+ 1,
+ 0x3190, 0x319f,
+}; /* CR_In_Kanbun */
+
+/* 'In_Bopomofo_Extended': Block */
+static const OnigCodePoint CR_In_Bopomofo_Extended[] = {
+ 1,
+ 0x31a0, 0x31bf,
+}; /* CR_In_Bopomofo_Extended */
+
+/* 'In_CJK_Strokes': Block */
+static const OnigCodePoint CR_In_CJK_Strokes[] = {
+ 1,
+ 0x31c0, 0x31ef,
+}; /* CR_In_CJK_Strokes */
+
+/* 'In_Katakana_Phonetic_Extensions': Block */
+static const OnigCodePoint CR_In_Katakana_Phonetic_Extensions[] = {
+ 1,
+ 0x31f0, 0x31ff,
+}; /* CR_In_Katakana_Phonetic_Extensions */
+
+/* 'In_Enclosed_CJK_Letters_and_Months': Block */
+static const OnigCodePoint CR_In_Enclosed_CJK_Letters_and_Months[] = {
+ 1,
+ 0x3200, 0x32ff,
+}; /* CR_In_Enclosed_CJK_Letters_and_Months */
+
+/* 'In_CJK_Compatibility': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility[] = {
+ 1,
+ 0x3300, 0x33ff,
+}; /* CR_In_CJK_Compatibility */
+
+/* 'In_CJK_Unified_Ideographs_Extension_A': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_A[] = {
+ 1,
+ 0x3400, 0x4dbf,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_A */
+
+/* 'In_Yijing_Hexagram_Symbols': Block */
+static const OnigCodePoint CR_In_Yijing_Hexagram_Symbols[] = {
+ 1,
+ 0x4dc0, 0x4dff,
+}; /* CR_In_Yijing_Hexagram_Symbols */
+
+/* 'In_CJK_Unified_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs[] = {
+ 1,
+ 0x4e00, 0x9fff,
+}; /* CR_In_CJK_Unified_Ideographs */
+
+/* 'In_Yi_Syllables': Block */
+static const OnigCodePoint CR_In_Yi_Syllables[] = {
+ 1,
+ 0xa000, 0xa48f,
+}; /* CR_In_Yi_Syllables */
+
+/* 'In_Yi_Radicals': Block */
+static const OnigCodePoint CR_In_Yi_Radicals[] = {
+ 1,
+ 0xa490, 0xa4cf,
+}; /* CR_In_Yi_Radicals */
+
+/* 'In_Lisu': Block */
+#define CR_In_Lisu CR_Lisu
+
+/* 'In_Vai': Block */
+static const OnigCodePoint CR_In_Vai[] = {
+ 1,
+ 0xa500, 0xa63f,
+}; /* CR_In_Vai */
+
+/* 'In_Cyrillic_Extended_B': Block */
+static const OnigCodePoint CR_In_Cyrillic_Extended_B[] = {
+ 1,
+ 0xa640, 0xa69f,
+}; /* CR_In_Cyrillic_Extended_B */
+
+/* 'In_Bamum': Block */
+static const OnigCodePoint CR_In_Bamum[] = {
+ 1,
+ 0xa6a0, 0xa6ff,
+}; /* CR_In_Bamum */
+
+/* 'In_Modifier_Tone_Letters': Block */
+static const OnigCodePoint CR_In_Modifier_Tone_Letters[] = {
+ 1,
+ 0xa700, 0xa71f,
+}; /* CR_In_Modifier_Tone_Letters */
+
+/* 'In_Latin_Extended_D': Block */
+static const OnigCodePoint CR_In_Latin_Extended_D[] = {
+ 1,
+ 0xa720, 0xa7ff,
+}; /* CR_In_Latin_Extended_D */
+
+/* 'In_Syloti_Nagri': Block */
+static const OnigCodePoint CR_In_Syloti_Nagri[] = {
+ 1,
+ 0xa800, 0xa82f,
+}; /* CR_In_Syloti_Nagri */
+
+/* 'In_Common_Indic_Number_Forms': Block */
+static const OnigCodePoint CR_In_Common_Indic_Number_Forms[] = {
+ 1,
+ 0xa830, 0xa83f,
+}; /* CR_In_Common_Indic_Number_Forms */
+
+/* 'In_Phags_pa': Block */
+static const OnigCodePoint CR_In_Phags_pa[] = {
+ 1,
+ 0xa840, 0xa87f,
+}; /* CR_In_Phags_pa */
+
+/* 'In_Saurashtra': Block */
+static const OnigCodePoint CR_In_Saurashtra[] = {
+ 1,
+ 0xa880, 0xa8df,
+}; /* CR_In_Saurashtra */
+
+/* 'In_Devanagari_Extended': Block */
+static const OnigCodePoint CR_In_Devanagari_Extended[] = {
+ 1,
+ 0xa8e0, 0xa8ff,
+}; /* CR_In_Devanagari_Extended */
+
+/* 'In_Kayah_Li': Block */
+#define CR_In_Kayah_Li CR_Kayah_Li
+
+/* 'In_Rejang': Block */
+static const OnigCodePoint CR_In_Rejang[] = {
+ 1,
+ 0xa930, 0xa95f,
+}; /* CR_In_Rejang */
+
+/* 'In_Hangul_Jamo_Extended_A': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_A[] = {
+ 1,
+ 0xa960, 0xa97f,
+}; /* CR_In_Hangul_Jamo_Extended_A */
+
+/* 'In_Javanese': Block */
+static const OnigCodePoint CR_In_Javanese[] = {
+ 1,
+ 0xa980, 0xa9df,
+}; /* CR_In_Javanese */
+
+/* 'In_Cham': Block */
+static const OnigCodePoint CR_In_Cham[] = {
+ 1,
+ 0xaa00, 0xaa5f,
+}; /* CR_In_Cham */
+
+/* 'In_Myanmar_Extended_A': Block */
+static const OnigCodePoint CR_In_Myanmar_Extended_A[] = {
+ 1,
+ 0xaa60, 0xaa7f,
+}; /* CR_In_Myanmar_Extended_A */
+
+/* 'In_Tai_Viet': Block */
+static const OnigCodePoint CR_In_Tai_Viet[] = {
+ 1,
+ 0xaa80, 0xaadf,
+}; /* CR_In_Tai_Viet */
+
+/* 'In_Meetei_Mayek_Extensions': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek_Extensions[] = {
+ 1,
+ 0xaae0, 0xaaff,
+}; /* CR_In_Meetei_Mayek_Extensions */
+
+/* 'In_Ethiopic_Extended_A': Block */
+static const OnigCodePoint CR_In_Ethiopic_Extended_A[] = {
+ 1,
+ 0xab00, 0xab2f,
+}; /* CR_In_Ethiopic_Extended_A */
+
+/* 'In_Meetei_Mayek': Block */
+static const OnigCodePoint CR_In_Meetei_Mayek[] = {
+ 1,
+ 0xabc0, 0xabff,
+}; /* CR_In_Meetei_Mayek */
+
+/* 'In_Hangul_Syllables': Block */
+static const OnigCodePoint CR_In_Hangul_Syllables[] = {
+ 1,
+ 0xac00, 0xd7af,
+}; /* CR_In_Hangul_Syllables */
+
+/* 'In_Hangul_Jamo_Extended_B': Block */
+static const OnigCodePoint CR_In_Hangul_Jamo_Extended_B[] = {
+ 1,
+ 0xd7b0, 0xd7ff,
+}; /* CR_In_Hangul_Jamo_Extended_B */
+
+/* 'In_High_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Surrogates[] = {
+ 1,
+ 0xd800, 0xdb7f,
+}; /* CR_In_High_Surrogates */
+
+/* 'In_High_Private_Use_Surrogates': Block */
+static const OnigCodePoint CR_In_High_Private_Use_Surrogates[] = {
+ 1,
+ 0xdb80, 0xdbff,
+}; /* CR_In_High_Private_Use_Surrogates */
+
+/* 'In_Low_Surrogates': Block */
+static const OnigCodePoint CR_In_Low_Surrogates[] = {
+ 1,
+ 0xdc00, 0xdfff,
+}; /* CR_In_Low_Surrogates */
+
+/* 'In_Private_Use_Area': Block */
+static const OnigCodePoint CR_In_Private_Use_Area[] = {
+ 1,
+ 0xe000, 0xf8ff,
+}; /* CR_In_Private_Use_Area */
+
+/* 'In_CJK_Compatibility_Ideographs': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs[] = {
+ 1,
+ 0xf900, 0xfaff,
+}; /* CR_In_CJK_Compatibility_Ideographs */
+
+/* 'In_Alphabetic_Presentation_Forms': Block */
+static const OnigCodePoint CR_In_Alphabetic_Presentation_Forms[] = {
+ 1,
+ 0xfb00, 0xfb4f,
+}; /* CR_In_Alphabetic_Presentation_Forms */
+
+/* 'In_Arabic_Presentation_Forms_A': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_A[] = {
+ 1,
+ 0xfb50, 0xfdff,
+}; /* CR_In_Arabic_Presentation_Forms_A */
+
+/* 'In_Variation_Selectors': Block */
+static const OnigCodePoint CR_In_Variation_Selectors[] = {
+ 1,
+ 0xfe00, 0xfe0f,
+}; /* CR_In_Variation_Selectors */
+
+/* 'In_Vertical_Forms': Block */
+static const OnigCodePoint CR_In_Vertical_Forms[] = {
+ 1,
+ 0xfe10, 0xfe1f,
+}; /* CR_In_Vertical_Forms */
+
+/* 'In_Combining_Half_Marks': Block */
+static const OnigCodePoint CR_In_Combining_Half_Marks[] = {
+ 1,
+ 0xfe20, 0xfe2f,
+}; /* CR_In_Combining_Half_Marks */
+
+/* 'In_CJK_Compatibility_Forms': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Forms[] = {
+ 1,
+ 0xfe30, 0xfe4f,
+}; /* CR_In_CJK_Compatibility_Forms */
+
+/* 'In_Small_Form_Variants': Block */
+static const OnigCodePoint CR_In_Small_Form_Variants[] = {
+ 1,
+ 0xfe50, 0xfe6f,
+}; /* CR_In_Small_Form_Variants */
+
+/* 'In_Arabic_Presentation_Forms_B': Block */
+static const OnigCodePoint CR_In_Arabic_Presentation_Forms_B[] = {
+ 1,
+ 0xfe70, 0xfeff,
+}; /* CR_In_Arabic_Presentation_Forms_B */
+
+/* 'In_Halfwidth_and_Fullwidth_Forms': Block */
+static const OnigCodePoint CR_In_Halfwidth_and_Fullwidth_Forms[] = {
+ 1,
+ 0xff00, 0xffef,
+}; /* CR_In_Halfwidth_and_Fullwidth_Forms */
+
+/* 'In_Specials': Block */
+static const OnigCodePoint CR_In_Specials[] = {
+ 1,
+ 0xfff0, 0xffff,
+}; /* CR_In_Specials */
+
+/* 'In_Linear_B_Syllabary': Block */
+static const OnigCodePoint CR_In_Linear_B_Syllabary[] = {
+ 1,
+ 0x10000, 0x1007f,
+}; /* CR_In_Linear_B_Syllabary */
+
+/* 'In_Linear_B_Ideograms': Block */
+static const OnigCodePoint CR_In_Linear_B_Ideograms[] = {
+ 1,
+ 0x10080, 0x100ff,
+}; /* CR_In_Linear_B_Ideograms */
+
+/* 'In_Aegean_Numbers': Block */
+static const OnigCodePoint CR_In_Aegean_Numbers[] = {
+ 1,
+ 0x10100, 0x1013f,
+}; /* CR_In_Aegean_Numbers */
+
+/* 'In_Ancient_Greek_Numbers': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Numbers[] = {
+ 1,
+ 0x10140, 0x1018f,
+}; /* CR_In_Ancient_Greek_Numbers */
+
+/* 'In_Ancient_Symbols': Block */
+static const OnigCodePoint CR_In_Ancient_Symbols[] = {
+ 1,
+ 0x10190, 0x101cf,
+}; /* CR_In_Ancient_Symbols */
+
+/* 'In_Phaistos_Disc': Block */
+static const OnigCodePoint CR_In_Phaistos_Disc[] = {
+ 1,
+ 0x101d0, 0x101ff,
+}; /* CR_In_Phaistos_Disc */
+
+/* 'In_Lycian': Block */
+static const OnigCodePoint CR_In_Lycian[] = {
+ 1,
+ 0x10280, 0x1029f,
+}; /* CR_In_Lycian */
+
+/* 'In_Carian': Block */
+static const OnigCodePoint CR_In_Carian[] = {
+ 1,
+ 0x102a0, 0x102df,
+}; /* CR_In_Carian */
+
+/* 'In_Old_Italic': Block */
+static const OnigCodePoint CR_In_Old_Italic[] = {
+ 1,
+ 0x10300, 0x1032f,
+}; /* CR_In_Old_Italic */
+
+/* 'In_Gothic': Block */
+static const OnigCodePoint CR_In_Gothic[] = {
+ 1,
+ 0x10330, 0x1034f,
+}; /* CR_In_Gothic */
+
+/* 'In_Ugaritic': Block */
+static const OnigCodePoint CR_In_Ugaritic[] = {
+ 1,
+ 0x10380, 0x1039f,
+}; /* CR_In_Ugaritic */
+
+/* 'In_Old_Persian': Block */
+static const OnigCodePoint CR_In_Old_Persian[] = {
+ 1,
+ 0x103a0, 0x103df,
+}; /* CR_In_Old_Persian */
+
+/* 'In_Deseret': Block */
+#define CR_In_Deseret CR_Deseret
+
+/* 'In_Shavian': Block */
+#define CR_In_Shavian CR_Shavian
+
+/* 'In_Osmanya': Block */
+static const OnigCodePoint CR_In_Osmanya[] = {
+ 1,
+ 0x10480, 0x104af,
+}; /* CR_In_Osmanya */
+
+/* 'In_Cypriot_Syllabary': Block */
+static const OnigCodePoint CR_In_Cypriot_Syllabary[] = {
+ 1,
+ 0x10800, 0x1083f,
+}; /* CR_In_Cypriot_Syllabary */
+
+/* 'In_Imperial_Aramaic': Block */
+static const OnigCodePoint CR_In_Imperial_Aramaic[] = {
+ 1,
+ 0x10840, 0x1085f,
+}; /* CR_In_Imperial_Aramaic */
+
+/* 'In_Phoenician': Block */
+static const OnigCodePoint CR_In_Phoenician[] = {
+ 1,
+ 0x10900, 0x1091f,
+}; /* CR_In_Phoenician */
+
+/* 'In_Lydian': Block */
+static const OnigCodePoint CR_In_Lydian[] = {
+ 1,
+ 0x10920, 0x1093f,
+}; /* CR_In_Lydian */
+
+/* 'In_Meroitic_Hieroglyphs': Block */
+#define CR_In_Meroitic_Hieroglyphs CR_Meroitic_Hieroglyphs
+
+/* 'In_Meroitic_Cursive': Block */
+static const OnigCodePoint CR_In_Meroitic_Cursive[] = {
+ 1,
+ 0x109a0, 0x109ff,
+}; /* CR_In_Meroitic_Cursive */
+
+/* 'In_Kharoshthi': Block */
+static const OnigCodePoint CR_In_Kharoshthi[] = {
+ 1,
+ 0x10a00, 0x10a5f,
+}; /* CR_In_Kharoshthi */
+
+/* 'In_Old_South_Arabian': Block */
+#define CR_In_Old_South_Arabian CR_Old_South_Arabian
+
+/* 'In_Avestan': Block */
+static const OnigCodePoint CR_In_Avestan[] = {
+ 1,
+ 0x10b00, 0x10b3f,
+}; /* CR_In_Avestan */
+
+/* 'In_Inscriptional_Parthian': Block */
+static const OnigCodePoint CR_In_Inscriptional_Parthian[] = {
+ 1,
+ 0x10b40, 0x10b5f,
+}; /* CR_In_Inscriptional_Parthian */
+
+/* 'In_Inscriptional_Pahlavi': Block */
+static const OnigCodePoint CR_In_Inscriptional_Pahlavi[] = {
+ 1,
+ 0x10b60, 0x10b7f,
+}; /* CR_In_Inscriptional_Pahlavi */
+
+/* 'In_Old_Turkic': Block */
+static const OnigCodePoint CR_In_Old_Turkic[] = {
+ 1,
+ 0x10c00, 0x10c4f,
+}; /* CR_In_Old_Turkic */
+
+/* 'In_Rumi_Numeral_Symbols': Block */
+static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
+ 1,
+ 0x10e60, 0x10e7f,
+}; /* CR_In_Rumi_Numeral_Symbols */
+
+/* 'In_Brahmi': Block */
+static const OnigCodePoint CR_In_Brahmi[] = {
+ 1,
+ 0x11000, 0x1107f,
+}; /* CR_In_Brahmi */
+
+/* 'In_Kaithi': Block */
+static const OnigCodePoint CR_In_Kaithi[] = {
+ 1,
+ 0x11080, 0x110cf,
+}; /* CR_In_Kaithi */
+
+/* 'In_Sora_Sompeng': Block */
+static const OnigCodePoint CR_In_Sora_Sompeng[] = {
+ 1,
+ 0x110d0, 0x110ff,
+}; /* CR_In_Sora_Sompeng */
+
+/* 'In_Chakma': Block */
+static const OnigCodePoint CR_In_Chakma[] = {
+ 1,
+ 0x11100, 0x1114f,
+}; /* CR_In_Chakma */
+
+/* 'In_Sharada': Block */
+static const OnigCodePoint CR_In_Sharada[] = {
+ 1,
+ 0x11180, 0x111df,
+}; /* CR_In_Sharada */
+
+/* 'In_Takri': Block */
+static const OnigCodePoint CR_In_Takri[] = {
+ 1,
+ 0x11680, 0x116cf,
+}; /* CR_In_Takri */
+
+/* 'In_Cuneiform': Block */
+static const OnigCodePoint CR_In_Cuneiform[] = {
+ 1,
+ 0x12000, 0x123ff,
+}; /* CR_In_Cuneiform */
+
+/* 'In_Cuneiform_Numbers_and_Punctuation': Block */
+static const OnigCodePoint CR_In_Cuneiform_Numbers_and_Punctuation[] = {
+ 1,
+ 0x12400, 0x1247f,
+}; /* CR_In_Cuneiform_Numbers_and_Punctuation */
+
+/* 'In_Egyptian_Hieroglyphs': Block */
+static const OnigCodePoint CR_In_Egyptian_Hieroglyphs[] = {
+ 1,
+ 0x13000, 0x1342f,
+}; /* CR_In_Egyptian_Hieroglyphs */
+
+/* 'In_Bamum_Supplement': Block */
+static const OnigCodePoint CR_In_Bamum_Supplement[] = {
+ 1,
+ 0x16800, 0x16a3f,
+}; /* CR_In_Bamum_Supplement */
+
+/* 'In_Miao': Block */
+static const OnigCodePoint CR_In_Miao[] = {
+ 1,
+ 0x16f00, 0x16f9f,
+}; /* CR_In_Miao */
+
+/* 'In_Kana_Supplement': Block */
+static const OnigCodePoint CR_In_Kana_Supplement[] = {
+ 1,
+ 0x1b000, 0x1b0ff,
+}; /* CR_In_Kana_Supplement */
+
+/* 'In_Byzantine_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Byzantine_Musical_Symbols[] = {
+ 1,
+ 0x1d000, 0x1d0ff,
+}; /* CR_In_Byzantine_Musical_Symbols */
+
+/* 'In_Musical_Symbols': Block */
+static const OnigCodePoint CR_In_Musical_Symbols[] = {
+ 1,
+ 0x1d100, 0x1d1ff,
+}; /* CR_In_Musical_Symbols */
+
+/* 'In_Ancient_Greek_Musical_Notation': Block */
+static const OnigCodePoint CR_In_Ancient_Greek_Musical_Notation[] = {
+ 1,
+ 0x1d200, 0x1d24f,
+}; /* CR_In_Ancient_Greek_Musical_Notation */
+
+/* 'In_Tai_Xuan_Jing_Symbols': Block */
+static const OnigCodePoint CR_In_Tai_Xuan_Jing_Symbols[] = {
+ 1,
+ 0x1d300, 0x1d35f,
+}; /* CR_In_Tai_Xuan_Jing_Symbols */
+
+/* 'In_Counting_Rod_Numerals': Block */
+static const OnigCodePoint CR_In_Counting_Rod_Numerals[] = {
+ 1,
+ 0x1d360, 0x1d37f,
+}; /* CR_In_Counting_Rod_Numerals */
+
+/* 'In_Mathematical_Alphanumeric_Symbols': Block */
+static const OnigCodePoint CR_In_Mathematical_Alphanumeric_Symbols[] = {
+ 1,
+ 0x1d400, 0x1d7ff,
+}; /* CR_In_Mathematical_Alphanumeric_Symbols */
+
+/* 'In_Arabic_Mathematical_Alphabetic_Symbols': Block */
+static const OnigCodePoint CR_In_Arabic_Mathematical_Alphabetic_Symbols[] = {
+ 1,
+ 0x1ee00, 0x1eeff,
+}; /* CR_In_Arabic_Mathematical_Alphabetic_Symbols */
+
+/* 'In_Mahjong_Tiles': Block */
+static const OnigCodePoint CR_In_Mahjong_Tiles[] = {
+ 1,
+ 0x1f000, 0x1f02f,
+}; /* CR_In_Mahjong_Tiles */
+
+/* 'In_Domino_Tiles': Block */
+static const OnigCodePoint CR_In_Domino_Tiles[] = {
+ 1,
+ 0x1f030, 0x1f09f,
+}; /* CR_In_Domino_Tiles */
+
+/* 'In_Playing_Cards': Block */
+static const OnigCodePoint CR_In_Playing_Cards[] = {
+ 1,
+ 0x1f0a0, 0x1f0ff,
+}; /* CR_In_Playing_Cards */
+
+/* 'In_Enclosed_Alphanumeric_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Alphanumeric_Supplement[] = {
+ 1,
+ 0x1f100, 0x1f1ff,
+}; /* CR_In_Enclosed_Alphanumeric_Supplement */
+
+/* 'In_Enclosed_Ideographic_Supplement': Block */
+static const OnigCodePoint CR_In_Enclosed_Ideographic_Supplement[] = {
+ 1,
+ 0x1f200, 0x1f2ff,
+}; /* CR_In_Enclosed_Ideographic_Supplement */
+
+/* 'In_Miscellaneous_Symbols_And_Pictographs': Block */
+static const OnigCodePoint CR_In_Miscellaneous_Symbols_And_Pictographs[] = {
+ 1,
+ 0x1f300, 0x1f5ff,
+}; /* CR_In_Miscellaneous_Symbols_And_Pictographs */
+
+/* 'In_Emoticons': Block */
+static const OnigCodePoint CR_In_Emoticons[] = {
+ 1,
+ 0x1f600, 0x1f64f,
+}; /* CR_In_Emoticons */
+
+/* 'In_Transport_And_Map_Symbols': Block */
+static const OnigCodePoint CR_In_Transport_And_Map_Symbols[] = {
+ 1,
+ 0x1f680, 0x1f6ff,
+}; /* CR_In_Transport_And_Map_Symbols */
+
+/* 'In_Alchemical_Symbols': Block */
+static const OnigCodePoint CR_In_Alchemical_Symbols[] = {
+ 1,
+ 0x1f700, 0x1f77f,
+}; /* CR_In_Alchemical_Symbols */
+
+/* 'In_CJK_Unified_Ideographs_Extension_B': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_B[] = {
+ 1,
+ 0x20000, 0x2a6df,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_B */
+
+/* 'In_CJK_Unified_Ideographs_Extension_C': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_C[] = {
+ 1,
+ 0x2a700, 0x2b73f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_C */
+
+/* 'In_CJK_Unified_Ideographs_Extension_D': Block */
+static const OnigCodePoint CR_In_CJK_Unified_Ideographs_Extension_D[] = {
+ 1,
+ 0x2b740, 0x2b81f,
+}; /* CR_In_CJK_Unified_Ideographs_Extension_D */
+
+/* 'In_CJK_Compatibility_Ideographs_Supplement': Block */
+static const OnigCodePoint CR_In_CJK_Compatibility_Ideographs_Supplement[] = {
+ 1,
+ 0x2f800, 0x2fa1f,
+}; /* CR_In_CJK_Compatibility_Ideographs_Supplement */
+
+/* 'In_Tags': Block */
+static const OnigCodePoint CR_In_Tags[] = {
+ 1,
+ 0xe0000, 0xe007f,
+}; /* CR_In_Tags */
+
+/* 'In_Variation_Selectors_Supplement': Block */
+static const OnigCodePoint CR_In_Variation_Selectors_Supplement[] = {
+ 1,
+ 0xe0100, 0xe01ef,
+}; /* CR_In_Variation_Selectors_Supplement */
+
+/* 'In_Supplementary_Private_Use_Area_A': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_A[] = {
+ 1,
+ 0xf0000, 0xfffff,
+}; /* CR_In_Supplementary_Private_Use_Area_A */
+
+/* 'In_Supplementary_Private_Use_Area_B': Block */
+static const OnigCodePoint CR_In_Supplementary_Private_Use_Area_B[] = {
+ 1,
+ 0x100000, 0x10ffff,
+}; /* CR_In_Supplementary_Private_Use_Area_B */
+
+/* 'In_No_Block': Block */
+static const OnigCodePoint CR_In_No_Block[] = {
+ 36,
+ 0x0860, 0x089f,
+ 0x1ab0, 0x1aff,
+ 0x1c80, 0x1cbf,
+ 0x2fe0, 0x2fef,
+ 0xa9e0, 0xa9ff,
+ 0xab30, 0xabbf,
+ 0x10200, 0x1027f,
+ 0x102e0, 0x102ff,
+ 0x10350, 0x1037f,
+ 0x103e0, 0x103ff,
+ 0x104b0, 0x107ff,
+ 0x10860, 0x108ff,
+ 0x10940, 0x1097f,
+ 0x10a80, 0x10aff,
+ 0x10b80, 0x10bff,
+ 0x10c50, 0x10e5f,
+ 0x10e80, 0x10fff,
+ 0x11150, 0x1117f,
+ 0x111e0, 0x1167f,
+ 0x116d0, 0x11fff,
+ 0x12480, 0x12fff,
+ 0x13430, 0x167ff,
+ 0x16a40, 0x16eff,
+ 0x16fa0, 0x1afff,
+ 0x1b100, 0x1cfff,
+ 0x1d250, 0x1d2ff,
+ 0x1d380, 0x1d3ff,
+ 0x1d800, 0x1edff,
+ 0x1ef00, 0x1efff,
+ 0x1f650, 0x1f67f,
+ 0x1f780, 0x1ffff,
+ 0x2a6e0, 0x2a6ff,
+ 0x2b820, 0x2f7ff,
+ 0x2fa20, 0xdffff,
+ 0xe0080, 0xe00ff,
+ 0xe01f0, 0xeffff,
+}; /* CR_In_No_Block */
+#endif /* USE_UNICODE_PROPERTIES */
+
+static const OnigCodePoint* const CodeRanges[] = {
+ CR_NEWLINE,
+ CR_Alpha,
+ CR_Blank,
+ CR_Cntrl,
+ CR_Digit,
+ CR_Graph,
+ CR_Lower,
+ CR_Print,
+ CR_Punct,
+ CR_Space,
+ CR_Upper,
+ CR_XDigit,
+ CR_Word,
+ CR_Alnum,
+ CR_ASCII,
+#ifdef USE_UNICODE_PROPERTIES
+ CR_Any,
+ CR_Assigned,
+ CR_C,
+ CR_Cc,
+ CR_Cf,
+ CR_Cn,
+ CR_Co,
+ CR_Cs,
+ CR_L,
+ CR_LC,
+ CR_Ll,
+ CR_Lm,
+ CR_Lo,
+ CR_Lt,
+ CR_Lu,
+ CR_M,
+ CR_Mc,
+ CR_Me,
+ CR_Mn,
+ CR_N,
+ CR_Nd,
+ CR_Nl,
+ CR_No,
+ CR_P,
+ CR_Pc,
+ CR_Pd,
+ CR_Pe,
+ CR_Pf,
+ CR_Pi,
+ CR_Po,
+ CR_Ps,
+ CR_S,
+ CR_Sc,
+ CR_Sk,
+ CR_Sm,
+ CR_So,
+ CR_Z,
+ CR_Zl,
+ CR_Zp,
+ CR_Zs,
+ CR_Math,
+ CR_Alphabetic,
+ CR_Lowercase,
+ CR_Uppercase,
+ CR_Cased,
+ CR_Case_Ignorable,
+ CR_Changes_When_Lowercased,
+ CR_Changes_When_Uppercased,
+ CR_Changes_When_Titlecased,
+ CR_Changes_When_Casefolded,
+ CR_Changes_When_Casemapped,
+ CR_ID_Start,
+ CR_ID_Continue,
+ CR_XID_Start,
+ CR_XID_Continue,
+ CR_Default_Ignorable_Code_Point,
+ CR_Grapheme_Extend,
+ CR_Grapheme_Base,
+ CR_Grapheme_Link,
+ CR_Common,
+ CR_Latin,
+ CR_Greek,
+ CR_Cyrillic,
+ CR_Armenian,
+ CR_Hebrew,
+ CR_Arabic,
+ CR_Syriac,
+ CR_Thaana,
+ CR_Devanagari,
+ CR_Bengali,
+ CR_Gurmukhi,
+ CR_Gujarati,
+ CR_Oriya,
+ CR_Tamil,
+ CR_Telugu,
+ CR_Kannada,
+ CR_Malayalam,
+ CR_Sinhala,
+ CR_Thai,
+ CR_Lao,
+ CR_Tibetan,
+ CR_Myanmar,
+ CR_Georgian,
+ CR_Hangul,
+ CR_Ethiopic,
+ CR_Cherokee,
+ CR_Canadian_Aboriginal,
+ CR_Ogham,
+ CR_Runic,
+ CR_Khmer,
+ CR_Mongolian,
+ CR_Hiragana,
+ CR_Katakana,
+ CR_Bopomofo,
+ CR_Han,
+ CR_Yi,
+ CR_Old_Italic,
+ CR_Gothic,
+ CR_Deseret,
+ CR_Inherited,
+ CR_Tagalog,
+ CR_Hanunoo,
+ CR_Buhid,
+ CR_Tagbanwa,
+ CR_Limbu,
+ CR_Tai_Le,
+ CR_Linear_B,
+ CR_Ugaritic,
+ CR_Shavian,
+ CR_Osmanya,
+ CR_Cypriot,
+ CR_Braille,
+ CR_Buginese,
+ CR_Coptic,
+ CR_New_Tai_Lue,
+ CR_Glagolitic,
+ CR_Tifinagh,
+ CR_Syloti_Nagri,
+ CR_Old_Persian,
+ CR_Kharoshthi,
+ CR_Balinese,
+ CR_Cuneiform,
+ CR_Phoenician,
+ CR_Phags_Pa,
+ CR_Nko,
+ CR_Sundanese,
+ CR_Lepcha,
+ CR_Ol_Chiki,
+ CR_Vai,
+ CR_Saurashtra,
+ CR_Kayah_Li,
+ CR_Rejang,
+ CR_Lycian,
+ CR_Carian,
+ CR_Lydian,
+ CR_Cham,
+ CR_Tai_Tham,
+ CR_Tai_Viet,
+ CR_Avestan,
+ CR_Egyptian_Hieroglyphs,
+ CR_Samaritan,
+ CR_Lisu,
+ CR_Bamum,
+ CR_Javanese,
+ CR_Meetei_Mayek,
+ CR_Imperial_Aramaic,
+ CR_Old_South_Arabian,
+ CR_Inscriptional_Parthian,
+ CR_Inscriptional_Pahlavi,
+ CR_Old_Turkic,
+ CR_Kaithi,
+ CR_Batak,
+ CR_Brahmi,
+ CR_Mandaic,
+ CR_Chakma,
+ CR_Meroitic_Cursive,
+ CR_Meroitic_Hieroglyphs,
+ CR_Miao,
+ CR_Sharada,
+ CR_Sora_Sompeng,
+ CR_Takri,
+ CR_White_Space,
+ CR_Bidi_Control,
+ CR_Join_Control,
+ CR_Dash,
+ CR_Hyphen,
+ CR_Quotation_Mark,
+ CR_Terminal_Punctuation,
+ CR_Other_Math,
+ CR_Hex_Digit,
+ CR_ASCII_Hex_Digit,
+ CR_Other_Alphabetic,
+ CR_Ideographic,
+ CR_Diacritic,
+ CR_Extender,
+ CR_Other_Lowercase,
+ CR_Other_Uppercase,
+ CR_Noncharacter_Code_Point,
+ CR_Other_Grapheme_Extend,
+ CR_IDS_Binary_Operator,
+ CR_IDS_Trinary_Operator,
+ CR_Radical,
+ CR_Unified_Ideograph,
+ CR_Other_Default_Ignorable_Code_Point,
+ CR_Deprecated,
+ CR_Soft_Dotted,
+ CR_Logical_Order_Exception,
+ CR_Other_ID_Start,
+ CR_Other_ID_Continue,
+ CR_STerm,
+ CR_Variation_Selector,
+ CR_Pattern_White_Space,
+ CR_Pattern_Syntax,
+ CR_Unknown,
+ CR_Age_1_1,
+ CR_Age_2_0,
+ CR_Age_2_1,
+ CR_Age_3_0,
+ CR_Age_3_1,
+ CR_Age_3_2,
+ CR_Age_4_0,
+ CR_Age_4_1,
+ CR_Age_5_0,
+ CR_Age_5_1,
+ CR_Age_5_2,
+ CR_Age_6_0,
+ CR_Age_6_1,
+ CR_In_Basic_Latin,
+ CR_In_Latin_1_Supplement,
+ CR_In_Latin_Extended_A,
+ CR_In_Latin_Extended_B,
+ CR_In_IPA_Extensions,
+ CR_In_Spacing_Modifier_Letters,
+ CR_In_Combining_Diacritical_Marks,
+ CR_In_Greek_and_Coptic,
+ CR_In_Cyrillic,
+ CR_In_Cyrillic_Supplement,
+ CR_In_Armenian,
+ CR_In_Hebrew,
+ CR_In_Arabic,
+ CR_In_Syriac,
+ CR_In_Arabic_Supplement,
+ CR_In_Thaana,
+ CR_In_NKo,
+ CR_In_Samaritan,
+ CR_In_Mandaic,
+ CR_In_Arabic_Extended_A,
+ CR_In_Devanagari,
+ CR_In_Bengali,
+ CR_In_Gurmukhi,
+ CR_In_Gujarati,
+ CR_In_Oriya,
+ CR_In_Tamil,
+ CR_In_Telugu,
+ CR_In_Kannada,
+ CR_In_Malayalam,
+ CR_In_Sinhala,
+ CR_In_Thai,
+ CR_In_Lao,
+ CR_In_Tibetan,
+ CR_In_Myanmar,
+ CR_In_Georgian,
+ CR_In_Hangul_Jamo,
+ CR_In_Ethiopic,
+ CR_In_Ethiopic_Supplement,
+ CR_In_Cherokee,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics,
+ CR_In_Ogham,
+ CR_In_Runic,
+ CR_In_Tagalog,
+ CR_In_Hanunoo,
+ CR_In_Buhid,
+ CR_In_Tagbanwa,
+ CR_In_Khmer,
+ CR_In_Mongolian,
+ CR_In_Unified_Canadian_Aboriginal_Syllabics_Extended,
+ CR_In_Limbu,
+ CR_In_Tai_Le,
+ CR_In_New_Tai_Lue,
+ CR_In_Khmer_Symbols,
+ CR_In_Buginese,
+ CR_In_Tai_Tham,
+ CR_In_Balinese,
+ CR_In_Sundanese,
+ CR_In_Batak,
+ CR_In_Lepcha,
+ CR_In_Ol_Chiki,
+ CR_In_Sundanese_Supplement,
+ CR_In_Vedic_Extensions,
+ CR_In_Phonetic_Extensions,
+ CR_In_Phonetic_Extensions_Supplement,
+ CR_In_Combining_Diacritical_Marks_Supplement,
+ CR_In_Latin_Extended_Additional,
+ CR_In_Greek_Extended,
+ CR_In_General_Punctuation,
+ CR_In_Superscripts_and_Subscripts,
+ CR_In_Currency_Symbols,
+ CR_In_Combining_Diacritical_Marks_for_Symbols,
+ CR_In_Letterlike_Symbols,
+ CR_In_Number_Forms,
+ CR_In_Arrows,
+ CR_In_Mathematical_Operators,
+ CR_In_Miscellaneous_Technical,
+ CR_In_Control_Pictures,
+ CR_In_Optical_Character_Recognition,
+ CR_In_Enclosed_Alphanumerics,
+ CR_In_Box_Drawing,
+ CR_In_Block_Elements,
+ CR_In_Geometric_Shapes,
+ CR_In_Miscellaneous_Symbols,
+ CR_In_Dingbats,
+ CR_In_Miscellaneous_Mathematical_Symbols_A,
+ CR_In_Supplemental_Arrows_A,
+ CR_In_Braille_Patterns,
+ CR_In_Supplemental_Arrows_B,
+ CR_In_Miscellaneous_Mathematical_Symbols_B,
+ CR_In_Supplemental_Mathematical_Operators,
+ CR_In_Miscellaneous_Symbols_and_Arrows,
+ CR_In_Glagolitic,
+ CR_In_Latin_Extended_C,
+ CR_In_Coptic,
+ CR_In_Georgian_Supplement,
+ CR_In_Tifinagh,
+ CR_In_Ethiopic_Extended,
+ CR_In_Cyrillic_Extended_A,
+ CR_In_Supplemental_Punctuation,
+ CR_In_CJK_Radicals_Supplement,
+ CR_In_Kangxi_Radicals,
+ CR_In_Ideographic_Description_Characters,
+ CR_In_CJK_Symbols_and_Punctuation,
+ CR_In_Hiragana,
+ CR_In_Katakana,
+ CR_In_Bopomofo,
+ CR_In_Hangul_Compatibility_Jamo,
+ CR_In_Kanbun,
+ CR_In_Bopomofo_Extended,
+ CR_In_CJK_Strokes,
+ CR_In_Katakana_Phonetic_Extensions,
+ CR_In_Enclosed_CJK_Letters_and_Months,
+ CR_In_CJK_Compatibility,
+ CR_In_CJK_Unified_Ideographs_Extension_A,
+ CR_In_Yijing_Hexagram_Symbols,
+ CR_In_CJK_Unified_Ideographs,
+ CR_In_Yi_Syllables,
+ CR_In_Yi_Radicals,
+ CR_In_Lisu,
+ CR_In_Vai,
+ CR_In_Cyrillic_Extended_B,
+ CR_In_Bamum,
+ CR_In_Modifier_Tone_Letters,
+ CR_In_Latin_Extended_D,
+ CR_In_Syloti_Nagri,
+ CR_In_Common_Indic_Number_Forms,
+ CR_In_Phags_pa,
+ CR_In_Saurashtra,
+ CR_In_Devanagari_Extended,
+ CR_In_Kayah_Li,
+ CR_In_Rejang,
+ CR_In_Hangul_Jamo_Extended_A,
+ CR_In_Javanese,
+ CR_In_Cham,
+ CR_In_Myanmar_Extended_A,
+ CR_In_Tai_Viet,
+ CR_In_Meetei_Mayek_Extensions,
+ CR_In_Ethiopic_Extended_A,
+ CR_In_Meetei_Mayek,
+ CR_In_Hangul_Syllables,
+ CR_In_Hangul_Jamo_Extended_B,
+ CR_In_High_Surrogates,
+ CR_In_High_Private_Use_Surrogates,
+ CR_In_Low_Surrogates,
+ CR_In_Private_Use_Area,
+ CR_In_CJK_Compatibility_Ideographs,
+ CR_In_Alphabetic_Presentation_Forms,
+ CR_In_Arabic_Presentation_Forms_A,
+ CR_In_Variation_Selectors,
+ CR_In_Vertical_Forms,
+ CR_In_Combining_Half_Marks,
+ CR_In_CJK_Compatibility_Forms,
+ CR_In_Small_Form_Variants,
+ CR_In_Arabic_Presentation_Forms_B,
+ CR_In_Halfwidth_and_Fullwidth_Forms,
+ CR_In_Specials,
+ CR_In_Linear_B_Syllabary,
+ CR_In_Linear_B_Ideograms,
+ CR_In_Aegean_Numbers,
+ CR_In_Ancient_Greek_Numbers,
+ CR_In_Ancient_Symbols,
+ CR_In_Phaistos_Disc,
+ CR_In_Lycian,
+ CR_In_Carian,
+ CR_In_Old_Italic,
+ CR_In_Gothic,
+ CR_In_Ugaritic,
+ CR_In_Old_Persian,
+ CR_In_Deseret,
+ CR_In_Shavian,
+ CR_In_Osmanya,
+ CR_In_Cypriot_Syllabary,
+ CR_In_Imperial_Aramaic,
+ CR_In_Phoenician,
+ CR_In_Lydian,
+ CR_In_Meroitic_Hieroglyphs,
+ CR_In_Meroitic_Cursive,
+ CR_In_Kharoshthi,
+ CR_In_Old_South_Arabian,
+ CR_In_Avestan,
+ CR_In_Inscriptional_Parthian,
+ CR_In_Inscriptional_Pahlavi,
+ CR_In_Old_Turkic,
+ CR_In_Rumi_Numeral_Symbols,
+ CR_In_Brahmi,
+ CR_In_Kaithi,
+ CR_In_Sora_Sompeng,
+ CR_In_Chakma,
+ CR_In_Sharada,
+ CR_In_Takri,
+ CR_In_Cuneiform,
+ CR_In_Cuneiform_Numbers_and_Punctuation,
+ CR_In_Egyptian_Hieroglyphs,
+ CR_In_Bamum_Supplement,
+ CR_In_Miao,
+ CR_In_Kana_Supplement,
+ CR_In_Byzantine_Musical_Symbols,
+ CR_In_Musical_Symbols,
+ CR_In_Ancient_Greek_Musical_Notation,
+ CR_In_Tai_Xuan_Jing_Symbols,
+ CR_In_Counting_Rod_Numerals,
+ CR_In_Mathematical_Alphanumeric_Symbols,
+ CR_In_Arabic_Mathematical_Alphabetic_Symbols,
+ CR_In_Mahjong_Tiles,
+ CR_In_Domino_Tiles,
+ CR_In_Playing_Cards,
+ CR_In_Enclosed_Alphanumeric_Supplement,
+ CR_In_Enclosed_Ideographic_Supplement,
+ CR_In_Miscellaneous_Symbols_And_Pictographs,
+ CR_In_Emoticons,
+ CR_In_Transport_And_Map_Symbols,
+ CR_In_Alchemical_Symbols,
+ CR_In_CJK_Unified_Ideographs_Extension_B,
+ CR_In_CJK_Unified_Ideographs_Extension_C,
+ CR_In_CJK_Unified_Ideographs_Extension_D,
+ CR_In_CJK_Compatibility_Ideographs_Supplement,
+ CR_In_Tags,
+ CR_In_Variation_Selectors_Supplement,
+ CR_In_Supplementary_Private_Use_Area_A,
+ CR_In_Supplementary_Private_Use_Area_B,
+ CR_In_No_Block,
+#endif /* USE_UNICODE_PROPERTIES */
+};
+struct uniname2ctype_struct {
+ int name, ctype;
+};
+
+static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int);
+%}
+struct uniname2ctype_struct;
+%%
+alpha, 1
+blank, 2
+cntrl, 3
+digit, 4
+graph, 5
+lower, 6
+print, 7
+punct, 8
+space, 9
+upper, 10
+xdigit, 11
+word, 12
+alnum, 13
+ascii, 14
+#ifdef USE_UNICODE_PROPERTIES
+any, 15
+assigned, 16
+c, 17
+cc, 18
+cf, 19
+cn, 20
+co, 21
+cs, 22
+l, 23
+lc, 24
+ll, 25
+lm, 26
+lo, 27
+lt, 28
+lu, 29
+m, 30
+mc, 31
+me, 32
+mn, 33
+n, 34
+nd, 35
+nl, 36
+no, 37
+p, 38
+pc, 39
+pd, 40
+pe, 41
+pf, 42
+pi, 43
+po, 44
+ps, 45
+s, 46
+sc, 47
+sk, 48
+sm, 49
+so, 50
+z, 51
+zl, 52
+zp, 53
+zs, 54
+math, 55
+alphabetic, 56
+lowercase, 57
+uppercase, 58
+cased, 59
+caseignorable, 60
+changeswhenlowercased, 61
+changeswhenuppercased, 62
+changeswhentitlecased, 63
+changeswhencasefolded, 64
+changeswhencasemapped, 65
+idstart, 66
+idcontinue, 67
+xidstart, 68
+xidcontinue, 69
+defaultignorablecodepoint, 70
+graphemeextend, 71
+graphemebase, 72
+graphemelink, 73
+common, 74
+latin, 75
+greek, 76
+cyrillic, 77
+armenian, 78
+hebrew, 79
+arabic, 80
+syriac, 81
+thaana, 82
+devanagari, 83
+bengali, 84
+gurmukhi, 85
+gujarati, 86
+oriya, 87
+tamil, 88
+telugu, 89
+kannada, 90
+malayalam, 91
+sinhala, 92
+thai, 93
+lao, 94
+tibetan, 95
+myanmar, 96
+georgian, 97
+hangul, 98
+ethiopic, 99
+cherokee, 100
+canadianaboriginal, 101
+ogham, 102
+runic, 103
+khmer, 104
+mongolian, 105
+hiragana, 106
+katakana, 107
+bopomofo, 108
+han, 109
+yi, 110
+olditalic, 111
+gothic, 112
+deseret, 113
+inherited, 114
+tagalog, 115
+hanunoo, 116
+buhid, 117
+tagbanwa, 118
+limbu, 119
+taile, 120
+linearb, 121
+ugaritic, 122
+shavian, 123
+osmanya, 124
+cypriot, 125
+braille, 126
+buginese, 127
+coptic, 128
+newtailue, 129
+glagolitic, 130
+tifinagh, 131
+sylotinagri, 132
+oldpersian, 133
+kharoshthi, 134
+balinese, 135
+cuneiform, 136
+phoenician, 137
+phagspa, 138
+nko, 139
+sundanese, 140
+lepcha, 141
+olchiki, 142
+vai, 143
+saurashtra, 144
+kayahli, 145
+rejang, 146
+lycian, 147
+carian, 148
+lydian, 149
+cham, 150
+taitham, 151
+taiviet, 152
+avestan, 153
+egyptianhieroglyphs, 154
+samaritan, 155
+lisu, 156
+bamum, 157
+javanese, 158
+meeteimayek, 159
+imperialaramaic, 160
+oldsoutharabian, 161
+inscriptionalparthian, 162
+inscriptionalpahlavi, 163
+oldturkic, 164
+kaithi, 165
+batak, 166
+brahmi, 167
+mandaic, 168
+chakma, 169
+meroiticcursive, 170
+meroitichieroglyphs, 171
+miao, 172
+sharada, 173
+sorasompeng, 174
+takri, 175
+whitespace, 176
+bidicontrol, 177
+joincontrol, 178
+dash, 179
+hyphen, 180
+quotationmark, 181
+terminalpunctuation, 182
+othermath, 183
+hexdigit, 184
+asciihexdigit, 185
+otheralphabetic, 186
+ideographic, 187
+diacritic, 188
+extender, 189
+otherlowercase, 190
+otheruppercase, 191
+noncharactercodepoint, 192
+othergraphemeextend, 193
+idsbinaryoperator, 194
+idstrinaryoperator, 195
+radical, 196
+unifiedideograph, 197
+otherdefaultignorablecodepoint, 198
+deprecated, 199
+softdotted, 200
+logicalorderexception, 201
+otheridstart, 202
+otheridcontinue, 203
+sterm, 204
+variationselector, 205
+patternwhitespace, 206
+patternsyntax, 207
+unknown, 208
+ahex, 185
+bidic, 177
+ci, 60
+cwcf, 64
+cwcm, 65
+cwl, 61
+cwt, 63
+cwu, 62
+dep, 199
+di, 70
+dia, 188
+ext, 189
+grbase, 72
+grext, 71
+grlink, 73
+hex, 184
+idc, 67
+ideo, 187
+ids, 66
+idsb, 194
+idst, 195
+joinc, 178
+loe, 201
+nchar, 192
+oalpha, 186
+odi, 198
+ogrext, 193
+oidc, 203
+oids, 202
+olower, 190
+omath, 183
+oupper, 191
+patsyn, 207
+patws, 206
+qmark, 181
+sd, 200
+term, 182
+uideo, 197
+vs, 205
+wspace, 176
+xidc, 69
+xids, 68
+other, 17
+control, 18
+format, 19
+unassigned, 20
+privateuse, 21
+surrogate, 22
+letter, 23
+casedletter, 24
+lowercaseletter, 25
+modifierletter, 26
+otherletter, 27
+titlecaseletter, 28
+uppercaseletter, 29
+mark, 30
+combiningmark, 30
+spacingmark, 31
+enclosingmark, 32
+nonspacingmark, 33
+number, 34
+decimalnumber, 35
+letternumber, 36
+othernumber, 37
+punctuation, 38
+connectorpunctuation, 39
+dashpunctuation, 40
+closepunctuation, 41
+finalpunctuation, 42
+initialpunctuation, 43
+otherpunctuation, 44
+openpunctuation, 45
+symbol, 46
+currencysymbol, 47
+modifiersymbol, 48
+mathsymbol, 49
+othersymbol, 50
+separator, 51
+lineseparator, 52
+paragraphseparator, 53
+spaceseparator, 54
+arab, 80
+armi, 160
+armn, 78
+avst, 153
+bali, 135
+bamu, 157
+batk, 166
+beng, 84
+bopo, 108
+brah, 167
+brai, 126
+bugi, 127
+buhd, 117
+cakm, 169
+cans, 101
+cari, 148
+cher, 100
+copt, 128
+qaac, 128
+cprt, 125
+cyrl, 77
+deva, 83
+dsrt, 113
+egyp, 154
+ethi, 99
+geor, 97
+glag, 130
+goth, 112
+grek, 76
+gujr, 86
+guru, 85
+hang, 98
+hani, 109
+hano, 116
+hebr, 79
+hira, 106
+ital, 111
+java, 158
+kali, 145
+kana, 107
+khar, 134
+khmr, 104
+knda, 90
+kthi, 165
+lana, 151
+laoo, 94
+latn, 75
+lepc, 141
+limb, 119
+linb, 121
+lyci, 147
+lydi, 149
+mand, 168
+merc, 170
+mero, 171
+mlym, 91
+mong, 105
+mtei, 159
+mymr, 96
+nkoo, 139
+ogam, 102
+olck, 142
+orkh, 164
+orya, 87
+osma, 124
+phag, 138
+phli, 163
+phnx, 137
+plrd, 172
+prti, 162
+rjng, 146
+runr, 103
+samr, 155
+sarb, 161
+saur, 144
+shaw, 123
+shrd, 173
+sinh, 92
+sora, 174
+sund, 140
+sylo, 132
+syrc, 81
+tagb, 118
+takr, 175
+tale, 120
+talu, 129
+taml, 88
+tavt, 152
+telu, 89
+tfng, 131
+tglg, 115
+thaa, 82
+tibt, 95
+ugar, 122
+vaii, 143
+xpeo, 133
+xsux, 136
+yiii, 110
+zinh, 114
+qaai, 114
+zyyy, 74
+zzzz, 208
+age=1.1, 209
+age=2.0, 210
+age=2.1, 211
+age=3.0, 212
+age=3.1, 213
+age=3.2, 214
+age=4.0, 215
+age=4.1, 216
+age=5.0, 217
+age=5.1, 218
+age=5.2, 219
+age=6.0, 220
+age=6.1, 221
+inbasiclatin, 222
+inlatin1supplement, 223
+inlatinextendeda, 224
+inlatinextendedb, 225
+inipaextensions, 226
+inspacingmodifierletters, 227
+incombiningdiacriticalmarks, 228
+ingreekandcoptic, 229
+incyrillic, 230
+incyrillicsupplement, 231
+inarmenian, 232
+inhebrew, 233
+inarabic, 234
+insyriac, 235
+inarabicsupplement, 236
+inthaana, 237
+innko, 238
+insamaritan, 239
+inmandaic, 240
+inarabicextendeda, 241
+indevanagari, 242
+inbengali, 243
+ingurmukhi, 244
+ingujarati, 245
+inoriya, 246
+intamil, 247
+intelugu, 248
+inkannada, 249
+inmalayalam, 250
+insinhala, 251
+inthai, 252
+inlao, 253
+intibetan, 254
+inmyanmar, 255
+ingeorgian, 256
+inhanguljamo, 257
+inethiopic, 258
+inethiopicsupplement, 259
+incherokee, 260
+inunifiedcanadianaboriginalsyllabics, 261
+inogham, 262
+inrunic, 263
+intagalog, 264
+inhanunoo, 265
+inbuhid, 266
+intagbanwa, 267
+inkhmer, 268
+inmongolian, 269
+inunifiedcanadianaboriginalsyllabicsextended, 270
+inlimbu, 271
+intaile, 272
+innewtailue, 273
+inkhmersymbols, 274
+inbuginese, 275
+intaitham, 276
+inbalinese, 277
+insundanese, 278
+inbatak, 279
+inlepcha, 280
+inolchiki, 281
+insundanesesupplement, 282
+invedicextensions, 283
+inphoneticextensions, 284
+inphoneticextensionssupplement, 285
+incombiningdiacriticalmarkssupplement, 286
+inlatinextendedadditional, 287
+ingreekextended, 288
+ingeneralpunctuation, 289
+insuperscriptsandsubscripts, 290
+incurrencysymbols, 291
+incombiningdiacriticalmarksforsymbols, 292
+inletterlikesymbols, 293
+innumberforms, 294
+inarrows, 295
+inmathematicaloperators, 296
+inmiscellaneoustechnical, 297
+incontrolpictures, 298
+inopticalcharacterrecognition, 299
+inenclosedalphanumerics, 300
+inboxdrawing, 301
+inblockelements, 302
+ingeometricshapes, 303
+inmiscellaneoussymbols, 304
+indingbats, 305
+inmiscellaneousmathematicalsymbolsa, 306
+insupplementalarrowsa, 307
+inbraillepatterns, 308
+insupplementalarrowsb, 309
+inmiscellaneousmathematicalsymbolsb, 310
+insupplementalmathematicaloperators, 311
+inmiscellaneoussymbolsandarrows, 312
+inglagolitic, 313
+inlatinextendedc, 314
+incoptic, 315
+ingeorgiansupplement, 316
+intifinagh, 317
+inethiopicextended, 318
+incyrillicextendeda, 319
+insupplementalpunctuation, 320
+incjkradicalssupplement, 321
+inkangxiradicals, 322
+inideographicdescriptioncharacters, 323
+incjksymbolsandpunctuation, 324
+inhiragana, 325
+inkatakana, 326
+inbopomofo, 327
+inhangulcompatibilityjamo, 328
+inkanbun, 329
+inbopomofoextended, 330
+incjkstrokes, 331
+inkatakanaphoneticextensions, 332
+inenclosedcjklettersandmonths, 333
+incjkcompatibility, 334
+incjkunifiedideographsextensiona, 335
+inyijinghexagramsymbols, 336
+incjkunifiedideographs, 337
+inyisyllables, 338
+inyiradicals, 339
+inlisu, 340
+invai, 341
+incyrillicextendedb, 342
+inbamum, 343
+inmodifiertoneletters, 344
+inlatinextendedd, 345
+insylotinagri, 346
+incommonindicnumberforms, 347
+inphagspa, 348
+insaurashtra, 349
+indevanagariextended, 350
+inkayahli, 351
+inrejang, 352
+inhanguljamoextendeda, 353
+injavanese, 354
+incham, 355
+inmyanmarextendeda, 356
+intaiviet, 357
+inmeeteimayekextensions, 358
+inethiopicextendeda, 359
+inmeeteimayek, 360
+inhangulsyllables, 361
+inhanguljamoextendedb, 362
+inhighsurrogates, 363
+inhighprivateusesurrogates, 364
+inlowsurrogates, 365
+inprivateusearea, 366
+incjkcompatibilityideographs, 367
+inalphabeticpresentationforms, 368
+inarabicpresentationformsa, 369
+invariationselectors, 370
+inverticalforms, 371
+incombininghalfmarks, 372
+incjkcompatibilityforms, 373
+insmallformvariants, 374
+inarabicpresentationformsb, 375
+inhalfwidthandfullwidthforms, 376
+inspecials, 377
+inlinearbsyllabary, 378
+inlinearbideograms, 379
+inaegeannumbers, 380
+inancientgreeknumbers, 381
+inancientsymbols, 382
+inphaistosdisc, 383
+inlycian, 384
+incarian, 385
+inolditalic, 386
+ingothic, 387
+inugaritic, 388
+inoldpersian, 389
+indeseret, 390
+inshavian, 391
+inosmanya, 392
+incypriotsyllabary, 393
+inimperialaramaic, 394
+inphoenician, 395
+inlydian, 396
+inmeroitichieroglyphs, 397
+inmeroiticcursive, 398
+inkharoshthi, 399
+inoldsoutharabian, 400
+inavestan, 401
+ininscriptionalparthian, 402
+ininscriptionalpahlavi, 403
+inoldturkic, 404
+inruminumeralsymbols, 405
+inbrahmi, 406
+inkaithi, 407
+insorasompeng, 408
+inchakma, 409
+insharada, 410
+intakri, 411
+incuneiform, 412
+incuneiformnumbersandpunctuation, 413
+inegyptianhieroglyphs, 414
+inbamumsupplement, 415
+inmiao, 416
+inkanasupplement, 417
+inbyzantinemusicalsymbols, 418
+inmusicalsymbols, 419
+inancientgreekmusicalnotation, 420
+intaixuanjingsymbols, 421
+incountingrodnumerals, 422
+inmathematicalalphanumericsymbols, 423
+inarabicmathematicalalphabeticsymbols, 424
+inmahjongtiles, 425
+indominotiles, 426
+inplayingcards, 427
+inenclosedalphanumericsupplement, 428
+inenclosedideographicsupplement, 429
+inmiscellaneoussymbolsandpictographs, 430
+inemoticons, 431
+intransportandmapsymbols, 432
+inalchemicalsymbols, 433
+incjkunifiedideographsextensionb, 434
+incjkunifiedideographsextensionc, 435
+incjkunifiedideographsextensiond, 436
+incjkcompatibilityideographssupplement, 437
+intags, 438
+invariationselectorssupplement, 439
+insupplementaryprivateuseareaa, 440
+insupplementaryprivateuseareab, 441
+innoblock, 442
+#endif /* USE_UNICODE_PROPERTIES */
+%%
+static int
+uniname2ctype(const UChar *name, unsigned int len)
+{
+ const struct uniname2ctype_struct *p = uniname2ctype_p((const char *)name, len);
+ if (p) return p->ctype;
+ return -1;
+}
diff --git a/enc/us_ascii.c b/enc/us_ascii.c
index 08f9072c43..18d0685040 100644
--- a/enc/us_ascii.c
+++ b/enc/us_ascii.c
@@ -1,11 +1,4 @@
#include "regenc.h"
-#ifdef RUBY
-# include "encindex.h"
-#endif
-
-#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)
@@ -32,8 +25,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,
- onigenc_single_byte_ascii_only_case_map,
- ENCINDEX_US_ASCII,
+ 0,
ONIGENC_FLAG_NONE,
};
ENC_ALIAS("ASCII", "US-ASCII")
diff --git a/enc/utf_16_32.h b/enc/utf_16_32.h
index 9f9216d8ff..da58d1b23c 100644
--- a/enc/utf_16_32.h
+++ b/enc/utf_16_32.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, stateful encoding */
+/* dummy for unsupported, statefull 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 f9dd7119d6..a61ae00863 100644
--- a/enc/utf_16be.c
+++ b/enc/utf_16be.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#if 0
static const int EncLen_UTF16[] = {
@@ -184,7 +183,7 @@ utf16be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
int c, v;
p++;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
}
@@ -249,7 +248,6 @@ OnigEncodingDefine(utf_16be, UTF_16BE) = {
onigenc_utf16_32_get_ctype_code_range,
utf16be_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match,
- onigenc_unicode_case_map,
0,
ONIGENC_FLAG_UNICODE,
};
diff --git a/enc/utf_16le.c b/enc/utf_16le.c
index 2c8438d0be..7d176e710e 100644
--- a/enc/utf_16le.c
+++ b/enc/utf_16le.c
@@ -28,7 +28,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#if 0
static const int EncLen_UTF16[] = {
@@ -178,7 +177,7 @@ utf16le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,
if (*(p+1) == 0) {
int c, v;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
}
@@ -242,7 +241,6 @@ OnigEncodingDefine(utf_16le, UTF_16LE) = {
onigenc_utf16_32_get_ctype_code_range,
utf16le_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match,
- onigenc_unicode_case_map,
0,
ONIGENC_FLAG_UNICODE,
};
diff --git a/enc/utf_32be.c b/enc/utf_32be.c
index 17841e52a4..43c07e2e8f 100644
--- a/enc/utf_32be.c
+++ b/enc/utf_32be.c
@@ -28,25 +28,12 @@
*/
#include "regenc.h"
-#include "iso_8859.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,
- OnigEncoding enc)
+utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
+ OnigEncoding enc ARG_UNUSED)
{
- 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);
- }
+ return 4;
}
static int
@@ -139,7 +126,7 @@ utf32be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
int c, v;
p += 3;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
}
@@ -199,8 +186,8 @@ OnigEncodingDefine(utf_32be, UTF_32BE) = {
onigenc_utf16_32_get_ctype_code_range,
utf32be_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match,
- onigenc_unicode_case_map,
0,
ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("UCS-4BE", "UTF-32BE")
+
diff --git a/enc/utf_32le.c b/enc/utf_32le.c
index 18b798f102..31693eed05 100644
--- a/enc/utf_32le.c
+++ b/enc/utf_32le.c
@@ -28,25 +28,12 @@
*/
#include "regenc.h"
-#include "iso_8859.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,
- OnigEncoding enc)
+utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
+ OnigEncoding enc ARG_UNUSED)
{
- 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);
- }
+ return 4;
}
static int
@@ -139,7 +126,7 @@ utf32le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* e
if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) {
int c, v;
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
+ if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
}
@@ -199,7 +186,6 @@ OnigEncodingDefine(utf_32le, UTF_32LE) = {
onigenc_utf16_32_get_ctype_code_range,
utf32le_left_adjust_char_head,
onigenc_always_false_is_allowed_reverse_match,
- onigenc_unicode_case_map,
0,
ONIGENC_FLAG_UNICODE,
};
diff --git a/enc/utf_7.h b/enc/utf_7.h
index 823b317740..fa9f06b1b3 100644
--- a/enc/utf_7.h
+++ b/enc/utf_7.h
@@ -1,5 +1,5 @@
#include "regenc.h"
-/* dummy for unsupported, stateful encoding */
+/* dummy for unsupported, statefull encoding */
ENC_DUMMY("UTF-7");
ENC_ALIAS("CP65000", "UTF-7");
diff --git a/enc/utf_8.c b/enc/utf_8.c
index cdf2510d84..b8f38e9d58 100644
--- a/enc/utf_8.c
+++ b/enc/utf_8.c
@@ -28,22 +28,15 @@
*/
#include "regenc.h"
-#ifdef RUBY
-# include "encindex.h"
-#endif
-
-#ifndef ENCINDEX_UTF_8
-# define ENCINDEX_UTF_8 0
-#endif
#define USE_INVALID_CODE_SCHEME
#ifdef USE_INVALID_CODE_SCHEME
/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
-# define INVALID_CODE_FE 0xfffffffe
-# define INVALID_CODE_FF 0xffffffff
+#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)
@@ -304,7 +297,9 @@ 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 <= VALID_CODE_LIMIT) return 4;
+ else if ((code & 0xffe00000) == 0) return 4;
+ else if ((code & 0xfc000000) == 0) return 5;
+ else if ((code & 0x80000000) == 0) return 6;
#ifdef USE_INVALID_CODE_SCHEME
else if (code == INVALID_CODE_FE) return 1;
else if (code == INVALID_CODE_FF) return 1;
@@ -333,11 +328,24 @@ 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 <= VALID_CODE_LIMIT) {
+ else if ((code & 0xffe00000) == 0) {
*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;
@@ -417,7 +425,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigEncodingDefine(utf_8, UTF_8) = {
mbc_enc_len,
"UTF-8", /* name */
- 4, /* max byte length */
+ 6, /* max byte length */
1, /* min byte length */
is_mbc_newline,
mbc_to_code,
@@ -431,8 +439,7 @@ OnigEncodingDefine(utf_8, UTF_8) = {
get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- onigenc_unicode_case_map,
- ENCINDEX_UTF_8,
+ 0,
ONIGENC_FLAG_UNICODE,
};
ENC_ALIAS("CP65001", "UTF-8")
@@ -447,3 +454,4 @@ ENC_ALIAS("CP65001", "UTF-8")
ENC_REPLICATE("UTF8-MAC", "UTF-8")
ENC_ALIAS("UTF-8-MAC", "UTF8-MAC")
ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */
+
diff --git a/enc/windows_1250.c b/enc/windows_1250.c
deleted file mode 100644
index d2cf7b16bc..0000000000
--- a/enc/windows_1250.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/**********************************************************************
- windows_1250.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"
-#include "iso_8859.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, 0x00a0,
-};
-
-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);
-}
-
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncCP1250_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_CP1250_TO_LOWER_CASE(code);
- }
- else if (code == 0xB5)
- ;
- else if ((EncCP1250_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xB9)
- code = 0xA5;
- else if (code == 0xBE)
- code = 0xBC;
- else if (code >= 0x8A && code <= 0xBF && code!=0xB9)
- code -= 0x10;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-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,
- case_map,
- 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 fcd0f1015d..191d631b88 100644
--- a/enc/windows_1251.c
+++ b/enc/windows_1251.c
@@ -1,5 +1,5 @@
/**********************************************************************
- windows_1251.c - Oniguruma (regular expression library)
+ cp1251.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
@@ -180,51 +180,9 @@ cp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if ((EncCP1251_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_CP1251_TO_LOWER_CASE(code);
- }
- else if (code == 0xB5)
- ;
- else if ((EncCP1251_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if ((0x61 <= code && code <= 0x7A) || (0xE0 <= code && code <= 0xFF))
- code -= 0x20;
- else if (code == 0xA2 || code == 0xB3 || code == 0xBE)
- code -= 0x01;
- else if (code == 0x83)
- code = 0x81;
- else if (code == 0xBC)
- code = 0xA3;
- else if (code == 0xB4)
- code = 0xA5;
- else
- code -= 0x10;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
OnigEncodingDefine(windows_1251, Windows_1251) = {
onigenc_single_byte_mbc_enc_len,
- "Windows-1251",/* name */
+ "Windows-1251", /* name */
1, /* max enc length */
1, /* min enc length */
onigenc_is_mbc_newline_0x0a,
@@ -239,7 +197,6 @@ OnigEncodingDefine(windows_1251, Windows_1251) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
- case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/windows_1252.c b/enc/windows_1252.c
deleted file mode 100644
index 5f90c15601..0000000000
--- a/enc/windows_1252.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/**********************************************************************
- windows_1252.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"
-#include "iso_8859.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);
-}
-
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_CP1252_TO_LOWER_CASE(code);
- }
- else if (code == 0x83 || code == 0xAA || code == 0xBA || code == 0xB5)
- ;
- else if ((EncCP1252_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0x9A || code == 0x9C || code == 0x9E)
- code -= 0x10;
- else if (code == 0xFF)
- code -= 0x60;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-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,
- case_map,
- 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/enc/windows_1253.c b/enc/windows_1253.c
deleted file mode 100644
index 9e9c63a581..0000000000
--- a/enc/windows_1253.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/**********************************************************************
- windows_1253.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Name: windows-1253
- * MIBenum: 2253
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1253.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1253
- */
-
-#include "regenc.h"
-
-#define ENC_CP1253_TO_LOWER_CASE(c) EncCP1253_ToLowerCaseTable[c]
-#define ENC_IS_CP1253_CTYPE(code,ctype) \
- ((EncCP1253_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncCP1253_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', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\334', '\243', '\244', '\245', '\246', '\247',
- '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
- '\260', '\261', '\262', '\263', '\264', '\354', '\334', '\267',
- '\335', '\336', '\337', '\273', '\374', '\275', '\375', '\376',
- '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
- '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
- '\360', '\361', '\322', '\363', '\364', '\365', '\366', '\367',
- '\370', '\371', '\372', '\373', '\334', '\335', '\336', '\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 EncCP1253_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,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0284, 0x01a0, 0x34a2, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0,
- 0x00a0, 0x00a0, 0x0000, 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0,
- 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x34a2, 0x01a0,
- 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x10a0, 0x34a2, 0x34a2,
- 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,
- 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 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, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
- 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x0000
-};
-
-static int
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower,
- OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- *lower = ENC_CP1253_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- (*pp)++;
- v = (EncCP1253_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- if (*p == 0xc0 || *p == 0xe0)
- return FALSE;
- else
- return TRUE;
- }
-
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_CP1253_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 0xb6, 0xdc },
- { 0xb8, 0xdd },
- { 0xb9, 0xde },
- { 0xba, 0xdf },
- { 0xbc, 0xfc },
- { 0xbe, 0xfd },
- { 0xbf, 0xfe },
-
- { 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 },
- { 0xd7, 0xf7 },
- { 0xd8, 0xf8 },
- { 0xd9, 0xf9 },
- { 0xda, 0xfa },
- { 0xdb, 0xfb }
-};
-
-static int
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- numberof(CaseFoldMap), CaseFoldMap, 0,
- flag, f, arg);
-}
-
-static int
-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(
- numberof(CaseFoldMap), CaseFoldMap, 0,
- flag, p, end, items);
-}
-
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == 0xF2) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xD3;
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xF3;
- }
- }
- else if (code == 0xB5) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xCC;
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = 0xEC;
- }
- }
- else if (code == 0xC0 || code == 0xE0 || code == 0xB6)
- ;
- else if ((EncCP1253_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code = ENC_CP1253_TO_LOWER_CASE(code);
- }
- else if ((EncCP1253_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 0xDC)
- code = 0xA2;
- else if (code >= 0xDD && code <= 0xDF)
- code -= 0x25;
- else if (code == 0xFC)
- code = 0xBC;
- else if (code == 0xFD || code == 0xFE)
- code -= 0x3F;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-OnigEncodingDefine(windows_1253, Windows_1253) = {
- onigenc_single_byte_mbc_enc_len,
- "Windows-1253", /* 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,
- mbc_case_fold,
- apply_all_case_fold,
- get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match,
- case_map,
- 0,
- ONIGENC_FLAG_NONE,
-};
-ENC_ALIAS("CP1253", "Windows-1253")
diff --git a/enc/windows_1254.c b/enc/windows_1254.c
deleted file mode 100644
index 9ae66978a2..0000000000
--- a/enc/windows_1254.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/**********************************************************************
- windows_1254.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Name: windows-1254
- * MIBenum: 2254
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1254.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1254
- */
-
-#include "regenc.h"
-#include "iso_8859.h"
-
-#define ENC_CP1254_TO_LOWER_CASE(c) EncCP1254_ToLowerCaseTable[c]
-#define ENC_IS_CP1254_CTYPE(code,ctype) \
- ((EncCP1254_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
-
-static const UChar EncCP1254_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', '\216', '\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', '\257',
- '\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', '\327',
- '\370', '\371', '\372', '\373', '\374', '\151', '\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 EncCP1254_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,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x34a2, 0x0008, 0x34a2, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x30e2, 0x0008, 0x30e2, 0x0008, 0x0008, 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
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower,
- OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_CP1254_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncCP1254_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xdf etc.. are lower case letter, but can't convert. */
- if (*p >= 0xaa && *p <= 0xba)
- return FALSE;
- else
- return TRUE;
- }
-
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static int
-is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
-{
- if (code < 256)
- return ENC_IS_CP1254_CTYPE(code, ctype);
- else
- return FALSE;
-}
-
-static const OnigPairCaseFoldCodes CaseFoldMap[] = {
- { 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
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- numberof(CaseFoldMap), CaseFoldMap, 1,
- flag, f, arg);
-}
-
-static int
-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(
- numberof(CaseFoldMap), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-#define DOTLESS_i (0xFD)
-#define I_WITH_DOT_ABOVE (0xDD)
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if ((EncCP1254_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'I')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i';
- else
- code = ENC_CP1254_TO_LOWER_CASE(code);
- }
- else if (code == 0x83 || code == 0xAA || code == 0xBA || code == 0xB5)
- ;
- else if ((EncCP1254_CtypeTable[code] & BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'i')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I';
- else if (code == DOTLESS_i)
- code = 'I';
- else if (code == 0x9A || code == 0x9C || code == 0x9E)
- code -= 0x10;
- else if (code == 0xFF)
- code -= 0x60;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-OnigEncodingDefine(windows_1254, Windows_1254) = {
- onigenc_single_byte_mbc_enc_len,
- "Windows-1254", /* 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,
- mbc_case_fold,
- apply_all_case_fold,
- get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match,
- case_map,
- 0,
- ONIGENC_FLAG_NONE,
-};
-ENC_ALIAS("CP1254", "Windows-1254")
diff --git a/enc/windows_1257.c b/enc/windows_1257.c
deleted file mode 100644
index 936a94ac76..0000000000
--- a/enc/windows_1257.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/**********************************************************************
- windows_1257.c - Oniguruma (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "regenc.h"
-#include "iso_8859.h"
-
-/*
- * Name: windows-1257
- * MIBenum: 2257
- * Link: http://www.iana.org/assignments/character-sets
- * Link: http://www.microsoft.com/globaldev/reference/sbcs/1257.mspx
- * Link: http://en.wikipedia.org/wiki/Windows-1257
- */
-
-#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', '\212', '\213', '\214', '\215', '\216', '\217',
- '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
- '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
- '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
- '\270', '\251', '\272', '\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', '\327',
- '\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,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
- 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,
- 0x34a2, 0x00a0, 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2,
- 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x01a0, 0x30e2, 0x00a0, 0x01a0,
- 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x30e2,
- 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, 0x01a0
-};
-
-static int
-mbc_case_fold(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end ARG_UNUSED,
- UChar* lower, OnigEncoding enc ARG_UNUSED)
-{
- const UChar* p = *pp;
-
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- *lower++ = 's';
- *lower = 's';
- (*pp)++;
- return 2;
- }
-
- *lower = ENC_CP1252_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1;
-}
-
-#if 0
-static int
-is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
-{
- int v;
- const UChar* p = *pp;
-
- if (*p == SHARP_s && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
- (*pp)++;
- return TRUE;
- }
-
- (*pp)++;
- v = (EncCP1252_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));
- if ((v | BIT_CTYPE_LOWER) != 0) {
- /* 0xdf, 0xb5 are lower case letter, but can't convert. */
- if (*p == 0xb5)
- return FALSE;
- else
- return TRUE;
- }
-
- return (v != 0 ? TRUE : FALSE);
-}
-#endif
-
-static int
-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[] = {
- { 0xa8, 0xb8 },
- { 0xaa, 0xba },
- { 0xaf, 0xbf },
-
- { 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
-apply_all_case_fold(OnigCaseFoldType flag,
- OnigApplyAllCaseFoldFunc f, void* arg,
- OnigEncoding enc ARG_UNUSED)
-{
- return onigenc_apply_all_case_fold_with_map(
- numberof(CaseFoldMap), CaseFoldMap, 1,
- flag, f, arg);
-}
-
-static int
-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(
- numberof(CaseFoldMap), CaseFoldMap, 1,
- flag, p, end, items);
-}
-
-#define DOTLESS_i (0xB9)
-#define I_WITH_DOT_ABOVE (0xA9)
-static int
-case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
- if (code == SHARP_s) {
- if (flags & ONIGENC_CASE_UPCASE) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 'S';
- code = (flags & ONIGENC_CASE_TITLECASE) ? 's' : 'S';
- }
- else if (flags & ONIGENC_CASE_FOLD) {
- flags |= ONIGENC_CASE_MODIFIED;
- *to++ = 's';
- code = 's';
- }
- }
- else if (code == 0xB5)
- ;
- else if ((EncCP1252_CtypeTable[code] & BIT_CTYPE_UPPER)
- && (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'I')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? DOTLESS_i : 'i';
- else
- code = ENC_CP1252_TO_LOWER_CASE(code);
- }
- else if ((EncCP1252_CtypeTable[code]&BIT_CTYPE_LOWER)
- && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- if (code == 'i')
- code = flags & ONIGENC_CASE_FOLD_TURKISH_AZERI ? I_WITH_DOT_ABOVE : 'I';
- else if (code == DOTLESS_i)
- code = 'I';
- else if (code >= 0xB0 && code <= 0xBF)
- code -= 0x10;
- else
- code -= 0x20;
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
-
-OnigEncodingDefine(windows_1257, Windows_1257) = {
- onigenc_single_byte_mbc_enc_len,
- "Windows-1257", /* 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,
- mbc_case_fold,
- apply_all_case_fold,
- get_case_fold_codes_by_str,
- onigenc_minimum_property_name_to_ctype,
- is_code_ctype,
- onigenc_not_support_get_ctype_code_range,
- onigenc_single_byte_left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match,
- case_map,
- 0,
- ONIGENC_FLAG_NONE,
-};
-ENC_ALIAS("CP1257", "Windows-1257")
diff --git a/enc/windows_31j.c b/enc/windows_31j.c
index e3a468f414..c4193819d4 100644
--- a/enc/windows_31j.c
+++ b/enc/windows_31j.c
@@ -1,5 +1,5 @@
/**********************************************************************
- windows_31j.c - Onigmo (Oniguruma-mod) (regular expression library)
+ cp932.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
@@ -29,11 +29,11 @@
*/
#define ENC_CP932
-#include "shift_jis.h"
+#include "shift_jis.c"
OnigEncodingDefine(windows_31j, Windows_31J) = {
mbc_enc_len,
- "Windows-31J", /* name */
+ "Windows-31J", /* name */
2, /* max byte length */
1, /* min byte length */
onigenc_is_mbc_newline_0x0a,
@@ -48,7 +48,6 @@ OnigEncodingDefine(windows_31j, Windows_31J) = {
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
- onigenc_ascii_only_case_map,
0,
ONIGENC_FLAG_NONE,
};
diff --git a/enc/x_emoji.h b/enc/x_emoji.h
index 23efa1dd9e..92c9bccafd 100644
--- a/enc/x_emoji.h
+++ b/enc/x_emoji.h
@@ -2,8 +2,8 @@
/*
* Name: UTF8-DoCoMo, SJIS-DoCoMo
- * Link: https://www.nttdocomo.co.jp/english/service/developer/make/content/pictograph/basic/index.html
- * Link: https://www.nttdocomo.co.jp/english/service/developer/make/content/pictograph/extention/index.html
+ * Link: http://www.nttdocomo.co.jp/english/service/imode/make/content/pictograph/basic/index.html
+ * Link: http://www.nttdocomo.co.jp/english/service/imode/make/content/pictograph/extention/index.html
*/
ENC_REPLICATE("UTF8-DoCoMo", "UTF-8")
ENC_REPLICATE("SJIS-DoCoMo", "Windows-31J")
diff --git a/encindex.h b/encindex.h
deleted file mode 100644
index 658b60a9fd..0000000000
--- a/encindex.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**********************************************************************
-
- 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
-
-int rb_enc_find_index2(const char *name, long len);
-
-#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 2043a69598..e3a0978253 100644
--- a/encoding.c
+++ b/encoding.c
@@ -9,19 +9,13 @@
**********************************************************************/
+#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 "ruby_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
@@ -77,21 +71,21 @@ 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, 0,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ {0, 0, enc_memsize,},
+ NULL, NULL, 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)
{
@@ -519,7 +513,7 @@ enc_ascii_compatible_p(VALUE enc)
}
/*
- * Returns non-zero when the encoding is Unicode series other than UTF-7 else 0.
+ * Returns 1 when the encoding is Unicode series other than UTF-7 else 0.
*/
int
rb_enc_unicode_p(rb_encoding *enc)
@@ -585,6 +579,9 @@ rb_encdb_set_unicode(int index)
((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)
{
@@ -643,6 +640,13 @@ 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)
{
@@ -650,8 +654,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) {
@@ -664,11 +668,11 @@ load_encoding(const char *name)
ruby_verbose = Qfalse;
ruby_debug = Qfalse;
errinfo = rb_errinfo();
- loaded = rb_require_internal(enclib, rb_safe_level());
+ loaded = rb_protect(require_enc, enclib, 0);
ruby_verbose = verbose;
ruby_debug = debug;
rb_set_errinfo(errinfo);
- if (loaded < 0 || 1 < loaded) return -1;
+ if (NIL_P(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;
@@ -691,7 +695,6 @@ enc_autoload(rb_encoding *enc)
i = enc->ruby_encoding_index;
enc_register_at(i & ENC_INDEX_MASK, rb_enc_name(enc), base);
((rb_raw_encoding *)enc)->ruby_encoding_index = i;
- i &= ENC_INDEX_MASK;
}
else {
i = load_encoding(rb_enc_name(enc));
@@ -724,17 +727,6 @@ rb_enc_find_index(const char *name)
return i;
}
-int
-rb_enc_find_index2(const char *name, long len)
-{
- char buf[ENCODING_NAMELEN_MAX+1];
-
- if (len > ENCODING_NAMELEN_MAX) return -1;
- memcpy(buf, name, len);
- buf[len] = '\0';
- return rb_enc_find_index(buf);
-}
-
rb_encoding *
rb_enc_find(const char *name)
{
@@ -767,19 +759,6 @@ 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)
{
@@ -795,11 +774,17 @@ rb_enc_get_index(VALUE obj)
default:
case T_STRING:
case T_REGEXP:
- i = enc_get_index_str(obj);
+ i = ENCODING_GET_INLINED(obj);
+ if (i == ENCODING_INLINE_MAX) {
+ VALUE iv;
+
+ iv = rb_ivar_get(obj, rb_id_encoding());
+ i = NUM2INT(iv);
+ }
break;
case T_FILE:
- tmp = rb_funcallv(obj, rb_intern("internal_encoding"), 0, 0);
- if (NIL_P(tmp)) obj = rb_funcallv(obj, rb_intern("external_encoding"), 0, 0);
+ tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
+ if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
else obj = tmp;
if (NIL_P(obj)) break;
case T_DATA:
@@ -854,8 +839,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_change_terminator_length(obj, oldtermlen, termlen);
+ if (oldtermlen < termlen && RB_TYPE_P(obj, T_STRING)) {
+ rb_str_fill_terminator(obj, termlen);
}
enc_set_index(obj, idx);
return obj;
@@ -873,19 +858,6 @@ 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)
{
@@ -897,12 +869,24 @@ rb_enc_check(VALUE str1, VALUE str2)
return enc;
}
-static rb_encoding*
-enc_compatible_latter(VALUE str1, VALUE str2, int idx1, int idx2)
+rb_encoding*
+rb_enc_compatible(VALUE str1, VALUE str2)
{
+ int idx1, idx2;
+ rb_encoding *enc1, *enc2;
int isstr1, isstr2;
- rb_encoding *enc1 = rb_enc_from_index(idx1);
- rb_encoding *enc2 = rb_enc_from_index(idx2);
+
+ 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);
isstr2 = RB_TYPE_P(str2, T_STRING);
if (isstr2 && RSTRING_LEN(str2) == 0)
@@ -952,39 +936,6 @@ enc_compatible_latter(VALUE str1, VALUE str2, int idx1, int idx2)
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)
{
@@ -1042,8 +993,7 @@ 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;
- int l;
+ unsigned int c, l;
if (e <= p)
return -1;
if (rb_enc_asciicompat(enc)) {
@@ -1152,7 +1102,7 @@ enc_inspect(VALUE self)
static VALUE
enc_name(VALUE self)
{
- return rb_fstring_cstr(rb_enc_name((rb_encoding*)DATA_PTR(self)));
+ return rb_usascii_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self)));
}
static int
@@ -1284,17 +1234,9 @@ 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_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", 0);
return enc_name(self);
}
@@ -1302,13 +1244,6 @@ 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);
}
@@ -1357,14 +1292,16 @@ rb_usascii_encindex(void)
return ENCINDEX_US_ASCII;
}
-int rb_locale_charmap_index(void);
-
int
rb_locale_encindex(void)
{
- int idx = rb_locale_charmap_index();
+ VALUE charmap = rb_locale_charmap(rb_cEncoding);
+ int idx;
- if (idx < 0) idx = ENCINDEX_ASCII;
+ if (NIL_P(charmap))
+ idx = ENCINDEX_US_ASCII;
+ else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0)
+ idx = ENCINDEX_ASCII;
if (rb_enc_registered("locale") < 0) {
# if defined _WIN32
@@ -1405,6 +1342,8 @@ 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)
{
@@ -1596,6 +1535,34 @@ 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)
{
@@ -1651,7 +1618,8 @@ 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_fstring_cstr((char *)name);
+ VALUE str = rb_usascii_str_new2((char *)name);
+ OBJ_FREEZE(str);
rb_ary_push(ary, str);
return ST_CONTINUE;
}
@@ -1693,7 +1661,8 @@ 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_fstring_cstr(rb_enc_name(enc));
+ str = rb_usascii_str_new2(rb_enc_name(enc));
+ OBJ_FREEZE(str);
rb_ary_store(ary, idx, str);
}
key = rb_usascii_str_new2((char *)name);
@@ -1730,7 +1699,7 @@ rb_enc_aliases(VALUE klass)
* optionally, aliases:
*
* Encoding::ISO_8859_1.name
- * #=> "ISO-8859-1"
+ * #=> #<Encoding:ISO-8859-1>
*
* Encoding::ISO_8859_1.names
* #=> ["ISO-8859-1", "ISO8859-1"]
@@ -1933,7 +1902,7 @@ Init_Encoding(void)
int i;
rb_cEncoding = rb_define_class("Encoding", rb_cObject);
- rb_define_alloc_func(rb_cEncoding, enc_s_alloc);
+ rb_undef_alloc_func(rb_cEncoding);
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);
@@ -1955,7 +1924,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); /* in localeinit.c */
+ rb_define_singleton_method(rb_cEncoding, "locale_charmap", rb_locale_charmap, 0);
list = rb_ary_new2(enc_table.count);
RBASIC_CLEAR_CLASS(list);
@@ -1965,12 +1934,38 @@ 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 */
+#define ctype_test(c, ctype) \
+ (rb_isascii(c) && ONIGENC_IS_ASCII_CODE_CTYPE((c), (ctype)))
+
+int rb_isalnum(int c) { return ctype_test(c, ONIGENC_CTYPE_ALNUM); }
+int rb_isalpha(int c) { return ctype_test(c, ONIGENC_CTYPE_ALPHA); }
+int rb_isblank(int c) { return ctype_test(c, ONIGENC_CTYPE_BLANK); }
+int rb_iscntrl(int c) { return ctype_test(c, ONIGENC_CTYPE_CNTRL); }
+int rb_isdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_DIGIT); }
+int rb_isgraph(int c) { return ctype_test(c, ONIGENC_CTYPE_GRAPH); }
+int rb_islower(int c) { return ctype_test(c, ONIGENC_CTYPE_LOWER); }
+int rb_isprint(int c) { return ctype_test(c, ONIGENC_CTYPE_PRINT); }
+int rb_ispunct(int c) { return ctype_test(c, ONIGENC_CTYPE_PUNCT); }
+int rb_isspace(int c) { return ctype_test(c, ONIGENC_CTYPE_SPACE); }
+int rb_isupper(int c) { return ctype_test(c, ONIGENC_CTYPE_UPPER); }
+int rb_isxdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_XDIGIT); }
+
+int
+rb_tolower(int c)
+{
+ return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) : c;
+}
+
+int
+rb_toupper(int c)
+{
+ return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) : c;
+}
+
void
rb_enc_foreach_name(int (*func)(st_data_t name, st_data_t idx, st_data_t arg), st_data_t arg)
{
diff --git a/enum.c b/enum.c
index 86e6125e25..7920b93c55 100644
--- a/enum.c
+++ b/enum.c
@@ -9,24 +9,25 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/util.h"
+#include "node.h"
#include "id.h"
-#include "symbol.h"
+#include "internal.h"
-#include <assert.h>
+VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
VALUE rb_mEnumerable;
static ID id_next;
static ID id_div;
+static ID id_call;
+static ID id_size;
#define id_each idEach
#define id_eqq idEqq
#define id_cmp idCmp
#define id_lshift idLTLT
-#define id_call idCall
-#define id_size idSize
VALUE
rb_enum_values_pack(int argc, const VALUE *argv)
@@ -40,36 +41,16 @@ rb_enum_values_pack(int argc, const VALUE *argv)
i = rb_enum_values_pack(argc, argv); \
} while (0)
-static VALUE
-enum_yield(int argc, VALUE ary)
-{
- if (argc > 1)
- return rb_yield_force_blockarg(ary);
- if (argc == 1)
- return rb_yield(ary);
- return rb_yield_values2(0, 0);
-}
-
-static VALUE
-enum_yield_array(VALUE ary)
-{
- long len = RARRAY_LEN(ary);
-
- if (len > 1)
- return rb_yield_force_blockarg(ary);
- if (len == 1)
- return rb_yield(RARRAY_AREF(ary, 0));
- return rb_yield_values2(0, 0);
-}
+#define enum_yield rb_yield_values2
static VALUE
grep_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcallv(memo->v1, id_eqq, 1, &i)) == RTEST(memo->u3.value)) {
- rb_ary_push(memo->v2, i);
+ if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
+ rb_ary_push(memo->u2.value, i);
}
return Qnil;
}
@@ -77,11 +58,11 @@ grep_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
grep_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (RTEST(rb_funcallv(memo->v1, id_eqq, 1, &i)) == RTEST(memo->u3.value)) {
- rb_ary_push(memo->v2, enum_yield(argc, i));
+ if (RTEST(rb_funcall(memo->u1.value, id_eqq, 1, i))) {
+ rb_ary_push(memo->u2.value, rb_yield(i));
}
return Qnil;
}
@@ -108,76 +89,22 @@ static VALUE
enum_grep(VALUE obj, VALUE pat)
{
VALUE ary = rb_ary_new();
- struct MEMO *memo = MEMO_NEW(pat, ary, Qtrue);
+ NODE *memo = NEW_MEMO(pat, ary, 0);
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);
-
- return ary;
-}
-
-#define COUNT_BIGNUM IMEMO_FL_USER0
-#define MEMO_V3_SET(m, v) RB_OBJ_WRITE((m), &(m)->u3.value, (v))
-
-static void
-imemo_count_up(struct MEMO *memo)
-{
- if (memo->flags & COUNT_BIGNUM) {
- MEMO_V3_SET(memo, rb_int_succ(memo->u3.value));
- }
- else if (++memo->u3.cnt == 0) {
- /* overflow */
- unsigned long buf[2] = {0, 1};
- MEMO_V3_SET(memo, rb_big_unpack(buf, 2));
- memo->flags |= COUNT_BIGNUM;
- }
-}
-
-static VALUE
-imemo_count_value(struct MEMO *memo)
-{
- if (memo->flags & COUNT_BIGNUM) {
- return memo->u3.value;
- }
- else {
- return ULONG2NUM(memo->u3.cnt);
- }
-}
-
static VALUE
count_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- struct MEMO *memo = MEMO_CAST(memop);
+ NODE *memo = RNODE(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo->v1)) {
- imemo_count_up(memo);
+ if (rb_equal(i, memo->u1.value)) {
+ memo->u3.cnt++;
}
return Qnil;
}
@@ -185,10 +112,10 @@ count_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
count_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- struct MEMO *memo = MEMO_CAST(memop);
+ NODE *memo = RNODE(memop);
- if (RTEST(rb_yield_values2(argc, argv))) {
- imemo_count_up(memo);
+ if (RTEST(enum_yield(argc, argv))) {
+ memo->u3.cnt++;
}
return Qnil;
}
@@ -196,9 +123,9 @@ count_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
count_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- struct MEMO *memo = MEMO_CAST(memop);
+ NODE *memo = RNODE(memop);
- imemo_count_up(memo);
+ memo->u3.cnt++;
return Qnil;
}
@@ -224,7 +151,7 @@ static VALUE
enum_count(int argc, VALUE *argv, VALUE obj)
{
VALUE item = Qnil;
- struct MEMO *memo;
+ NODE *memo;
rb_block_call_func *func;
if (argc == 0) {
@@ -243,9 +170,9 @@ enum_count(int argc, VALUE *argv, VALUE obj)
func = count_i;
}
- memo = MEMO_NEW(item, 0, 0);
+ memo = NEW_MEMO(item, 0, 0);
rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
- return imemo_count_value(memo);
+ return INT2NUM(memo->u3.cnt);
}
static VALUE
@@ -253,9 +180,9 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
ENUM_WANT_SVALUE();
- if (RTEST(enum_yield(argc, i))) {
- struct MEMO *memo = MEMO_CAST(memop);
- MEMO_V1_SET(memo, i);
+ if (RTEST(rb_yield(i))) {
+ NODE *memo = RNODE(memop);
+ memo->u1.value = i;
memo->u3.cnt = 1;
rb_iter_break();
}
@@ -276,12 +203,7 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
*
* If no block is given, an enumerator is returned instead.
*
- * (1..100).detect => #<Enumerator: 1..100:detect>
- * (1..100).find => #<Enumerator: 1..100:find>
- *
* (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
- * (1..10).find { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
- * (1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
* (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
*
*/
@@ -289,18 +211,18 @@ find_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
enum_find(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
VALUE if_none;
rb_scan_args(argc, argv, "01", &if_none);
RETURN_ENUMERATOR(obj, argc, argv);
- memo = MEMO_NEW(Qundef, 0, 0);
+ memo = NEW_MEMO(Qundef, 0, 0);
rb_block_call(obj, id_each, 0, 0, find_i, (VALUE)memo);
if (memo->u3.cnt) {
- return memo->v1;
+ return memo->u1.value;
}
if (!NIL_P(if_none)) {
- return rb_funcallv(if_none, id_call, 0, 0);
+ return rb_funcall(if_none, id_call, 0, 0);
}
return Qnil;
}
@@ -308,28 +230,28 @@ enum_find(int argc, VALUE *argv, VALUE obj)
static VALUE
find_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- struct MEMO *memo = MEMO_CAST(memop);
+ NODE *memo = RNODE(memop);
ENUM_WANT_SVALUE();
- if (rb_equal(i, memo->v2)) {
- MEMO_V1_SET(memo, imemo_count_value(memo));
+ if (rb_equal(i, memo->u2.value)) {
+ memo->u1.value = UINT2NUM(memo->u3.cnt);
rb_iter_break();
}
- imemo_count_up(memo);
+ memo->u3.cnt++;
return Qnil;
}
static VALUE
find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
{
- struct MEMO *memo = MEMO_CAST(memop);
+ NODE *memo = RNODE(memop);
- if (RTEST(rb_yield_values2(argc, argv))) {
- MEMO_V1_SET(memo, imemo_count_value(memo));
+ if (RTEST(enum_yield(argc, argv))) {
+ memo->u1.value = UINT2NUM(memo->u3.cnt);
rb_iter_break();
}
- imemo_count_up(memo);
+ memo->u3.cnt++;
return Qnil;
}
@@ -355,7 +277,7 @@ find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
static VALUE
enum_find_index(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo; /* [return value, current index, ] */
+ NODE *memo; /* [return value, current index, ] */
VALUE condition_value = Qnil;
rb_block_call_func *func;
@@ -371,9 +293,9 @@ enum_find_index(int argc, VALUE *argv, VALUE obj)
func = find_index_i;
}
- memo = MEMO_NEW(Qnil, condition_value, 0);
+ memo = NEW_MEMO(Qnil, condition_value, 0);
rb_block_call(obj, id_each, 0, 0, func, (VALUE)memo);
- return memo->v1;
+ return memo->u1.value;
}
static VALUE
@@ -381,7 +303,7 @@ find_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
- if (RTEST(enum_yield(argc, i))) {
+ if (RTEST(rb_yield(i))) {
rb_ary_push(ary, i);
}
return Qnil;
@@ -390,25 +312,9 @@ find_all_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE
enum_size(VALUE self, VALUE args, VALUE eobj)
{
- return rb_check_funcall_default(self, id_size, 0, 0, Qnil);
-}
-
-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));
+ VALUE r;
+ r = rb_check_funcall(self, id_size, 0, 0);
+ return (r == Qundef) ? Qnil : r;
}
/*
@@ -449,7 +355,7 @@ reject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
- if (!RTEST(enum_yield(argc, i))) {
+ if (!RTEST(rb_yield(i))) {
rb_ary_push(ary, i);
}
return Qnil;
@@ -461,7 +367,7 @@ reject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
* enum.reject -> an_enumerator
*
* Returns an array for all elements of +enum+ for which the given
- * +block+ returns <code>false</code>.
+ * +block+ returns false.
*
* If no block is given, an Enumerator is returned instead.
*
@@ -488,7 +394,7 @@ enum_reject(VALUE obj)
static VALUE
collect_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
- rb_ary_push(ary, rb_yield_values2(argc, argv));
+ rb_ary_push(ary, enum_yield(argc, argv));
return Qnil;
}
@@ -523,13 +429,11 @@ static VALUE
enum_collect(VALUE obj)
{
VALUE ary;
- int min_argc, max_argc;
RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
ary = rb_ary_new();
- min_argc = rb_block_min_max_arity(&max_argc);
- rb_lambda_call(obj, id_each, 0, 0, collect_i, min_argc, max_argc, ary);
+ rb_block_call(obj, id_each, 0, 0, collect_i, ary);
return ary;
}
@@ -539,7 +443,7 @@ flat_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
VALUE tmp;
- i = rb_yield_values2(argc, argv);
+ i = enum_yield(argc, argv);
tmp = rb_check_array_type(i);
if (NIL_P(tmp)) {
@@ -647,15 +551,16 @@ enum_to_h(int argc, VALUE *argv, VALUE obj)
static VALUE
inject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
- struct MEMO *memo = MEMO_CAST(p);
+ NODE *memo = RNODE(p);
ENUM_WANT_SVALUE();
- if (memo->v1 == Qundef) {
- MEMO_V1_SET(memo, i);
+ if (memo->u2.argc == 0) {
+ memo->u2.argc = 1;
+ memo->u1.value = i;
}
else {
- MEMO_V1_SET(memo, rb_yield_values(2, memo->v1, i));
+ memo->u1.value = rb_yield_values(2, memo->u1.value, i);
}
return Qnil;
}
@@ -663,83 +568,27 @@ inject_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
static VALUE
inject_op_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
- struct MEMO *memo = MEMO_CAST(p);
+ NODE *memo = RNODE(p);
VALUE name;
ENUM_WANT_SVALUE();
- if (memo->v1 == Qundef) {
- MEMO_V1_SET(memo, i);
+ if (memo->u2.argc == 0) {
+ memo->u2.argc = 1;
+ memo->u1.value = i;
}
else if (SYMBOL_P(name = memo->u3.value)) {
- const ID mid = SYM2ID(name);
- MEMO_V1_SET(memo, rb_funcallv(memo->v1, mid, 1, &i));
+ memo->u1.value = rb_funcall(memo->u1.value, SYM2ID(name), 1, i);
}
else {
VALUE args[2];
args[0] = name;
args[1] = i;
- MEMO_V1_SET(memo, rb_f_send(numberof(args), args, memo->v1));
+ memo->u1.value = rb_f_send(numberof(args), args, memo->u1.value);
}
return Qnil;
}
-static VALUE
-ary_inject_op(VALUE ary, VALUE init, VALUE op)
-{
- ID id;
- VALUE v, e;
- long i, n;
-
- if (RARRAY_LEN(ary) == 0)
- return init == Qundef ? Qnil : init;
-
- if (init == Qundef) {
- v = RARRAY_AREF(ary, 0);
- i = 1;
- if (RARRAY_LEN(ary) == 1)
- return v;
- }
- else {
- v = init;
- i = 0;
- }
-
- id = SYM2ID(op);
- if (id == idPLUS) {
- if (RB_INTEGER_TYPE_P(v) &&
- rb_method_basic_definition_p(rb_cInteger, idPLUS) &&
- rb_obj_respond_to(v, idPLUS, FALSE)) {
- n = 0;
- for (; i < RARRAY_LEN(ary); i++) {
- e = RARRAY_AREF(ary, i);
- if (FIXNUM_P(e)) {
- n += FIX2LONG(e); /* should not overflow long type */
- if (!FIXABLE(n)) {
- v = rb_big_plus(ULONG2NUM(n), v);
- n = 0;
- }
- }
- else if (RB_TYPE_P(e, T_BIGNUM))
- v = rb_big_plus(e, v);
- else
- goto not_integer;
- }
- if (n != 0)
- v = rb_fix_plus(LONG2FIX(n), v);
- return v;
-
- not_integer:
- if (n != 0)
- v = rb_fix_plus(LONG2FIX(n), v);
- }
- }
- for (; i < RARRAY_LEN(ary); i++) {
- v = rb_funcallv_public(v, id, 1, &RARRAY_CONST_PTR(ary)[i]);
- }
- return v;
-}
-
/*
* call-seq:
* enum.inject(initial, sym) -> obj
@@ -755,9 +604,6 @@ ary_inject_op(VALUE ary, VALUE init, VALUE op)
* operation, specified by a block or a symbol that names a
* method or operator.
*
- * The <i>inject</i> and <i>reduce</i> methods are aliases. There
- * is no performance benefit to either.
- *
* If you specify a block, then for each element in <i>enum</i>
* the block is passed an accumulator value (<i>memo</i>) and the element.
* If you specify a symbol instead, then each element in the collection
@@ -789,14 +635,13 @@ ary_inject_op(VALUE ary, VALUE init, VALUE op)
static VALUE
enum_inject(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *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()) {
@@ -804,7 +649,8 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
}
id = rb_check_id(&init);
op = id ? ID2SYM(id) : init;
- init = Qundef;
+ argc = 0;
+ init = Qnil;
iter = inject_op_i;
break;
case 2:
@@ -816,32 +662,23 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
iter = inject_op_i;
break;
}
-
- if (iter == inject_op_i &&
- SYMBOL_P(op) &&
- RB_TYPE_P(obj, T_ARRAY) &&
- rb_method_basic_definition_p(CLASS_OF(obj), id_each)) {
- return ary_inject_op(obj, init, op);
- }
-
- memo = MEMO_NEW(init, Qnil, op);
+ memo = NEW_MEMO(init, argc, op);
rb_block_call(obj, id_each, 0, 0, iter, (VALUE)memo);
- if (memo->v1 == Qundef) return Qnil;
- return memo->v1;
+ return memo->u1.value;
}
static VALUE
partition_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
{
- struct MEMO *memo = MEMO_CAST(arys);
+ NODE *memo = RNODE(arys);
VALUE ary;
ENUM_WANT_SVALUE();
- if (RTEST(enum_yield(argc, i))) {
- ary = memo->v1;
+ if (RTEST(rb_yield(i))) {
+ ary = memo->u1.value;
}
else {
- ary = memo->v2;
+ ary = memo->u2.value;
}
rb_ary_push(ary, i);
return Qnil;
@@ -865,14 +702,14 @@ partition_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arys))
static VALUE
enum_partition(VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
- memo = MEMO_NEW(rb_ary_new(), rb_ary_new(), 0);
+ memo = NEW_MEMO(rb_ary_new(), rb_ary_new(), 0);
rb_block_call(obj, id_each, 0, 0, partition_i, (VALUE)memo);
- return rb_assoc_new(memo->v1, memo->v2);
+ return rb_assoc_new(memo->u1.value, memo->u2.value);
}
static VALUE
@@ -883,7 +720,7 @@ group_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
ENUM_WANT_SVALUE();
- group = enum_yield(argc, i);
+ group = rb_yield(i);
values = rb_hash_aref(hash, group);
if (!RB_TYPE_P(values, T_ARRAY)) {
values = rb_ary_new3(1, i);
@@ -927,10 +764,10 @@ enum_group_by(VALUE obj)
static VALUE
first_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, params))
{
- struct MEMO *memo = MEMO_CAST(params);
+ NODE *memo = RNODE(params);
ENUM_WANT_SVALUE();
- MEMO_V1_SET(memo, i);
+ memo->u1.value = i;
rb_iter_break();
UNREACHABLE;
@@ -951,22 +788,21 @@ 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)
{
- struct MEMO *memo;
+ NODE *memo;
rb_check_arity(argc, 0, 1);
if (argc > 0) {
return enum_take(obj, argv[0]);
}
else {
- memo = MEMO_NEW(Qnil, 0, 0);
+ memo = NEW_MEMO(Qnil, 0, 0);
rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)memo);
- return memo->v1;
+ return memo->u1.value;
}
}
@@ -976,48 +812,41 @@ enum_first(int argc, VALUE *argv, VALUE obj)
* enum.sort -> array
* enum.sort { |a, b| block } -> array
*
- * Returns an array containing the items in <i>enum</i> sorted.
+ * Returns an array containing the items in <i>enum</i> sorted,
+ * either according to their own <code><=></code> method, or by using
+ * the results of the supplied block. The block should return -1, 0, or
+ * +1 depending on the comparison between <i>a</i> and <i>b</i>. As of
+ * Ruby 1.8, the method <code>Enumerable#sort_by</code> implements a
+ * built-in Schwartzian Transform, useful when key computation or
+ * comparison is expensive.
*
- * Comparisons for the sort will be done using the items' own
- * <code><=></code> operator or using an optional code block.
- *
- * 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+.
- *
- * The result is not guaranteed to be stable. When the comparison of two
- * elements returns +0+, the order of the elements is unpredictable.
- *
- * %w(rhea kea flea).sort #=> ["flea", "kea", "rhea"]
+ * %w(rhea kea flea).sort #=> ["flea", "kea", "rhea"]
* (1..10).sort { |a, b| b <=> a } #=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
- *
- * See also Enumerable#sort_by. It implements a Schwartzian transform
- * which is useful when key computation or comparison is expensive.
*/
static VALUE
enum_sort(VALUE obj)
{
- return rb_ary_sort_bang(enum_to_a(0, 0, obj));
+ return rb_ary_sort(enum_to_a(0, 0, obj));
}
#define SORT_BY_BUFSIZE 16
struct sort_by_data {
- const VALUE ary;
- const VALUE buf;
+ VALUE ary;
+ 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 *)&MEMO_CAST(_data)->v1;
+ struct sort_by_data *data = (struct sort_by_data *)&RNODE(_data)->u1;
VALUE ary = data->ary;
VALUE v;
ENUM_WANT_SVALUE();
- v = enum_yield(argc, i);
+ v = rb_yield(i);
if (RBASIC(ary)->klass) {
rb_raise(rb_eRuntimeError, "sort_by reentered");
@@ -1039,7 +868,6 @@ sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
static int
sort_by_cmp(const void *ap, const void *bp, void *data)
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
VALUE a;
VALUE b;
VALUE ary = (VALUE)data;
@@ -1051,7 +879,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
a = *(VALUE *)ap;
b = *(VALUE *)bp;
- return OPTIMIZED_CMP(a, b, cmp_opt);
+ return rb_cmpint(rb_funcall(a, id_cmp, 1, b), a, b);
}
/*
@@ -1062,12 +890,9 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* Sorts <i>enum</i> using a set of keys generated by mapping the
* values in <i>enum</i> through the given block.
*
- * The result is not guaranteed to be stable. When two keys are equal,
- * the order of the corresponding elements is unpredictable.
- *
* If no block is given, an enumerator is returned instead.
*
- * %w{apple pear fig}.sort_by { |word| word.length }
+ * %w{apple pear fig}.sort_by { |word| word.length}
* #=> ["fig", "pear", "apple"]
*
* The current implementation of <code>sort_by</code> generates an
@@ -1112,7 +937,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* This still generates many unnecessary <code>Time</code> objects. A
* more efficient technique is to cache the sort keys (modification
* times in this case) before the sort. Perl users often call this
- * approach a Schwartzian transform, after Randal Schwartz. We
+ * approach a Schwartzian Transform, after Randal Schwartz. We
* construct a temporary array, where each element is an array
* containing our sort key along with the filename. We sort this array,
* and then extract the filename from the result.
@@ -1132,7 +957,7 @@ static VALUE
enum_sort_by(VALUE obj)
{
VALUE ary, buf;
- struct MEMO *memo;
+ NODE *memo;
long i;
struct sort_by_data *data;
@@ -1147,11 +972,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 = MEMO_NEW(0, 0, 0);
+ memo = NEW_MEMO(0, 0, 0);
OBJ_INFECT(memo, obj);
- data = (struct sort_by_data *)&memo->v1;
- RB_OBJ_WRITE(memo, &data->ary, ary);
- RB_OBJ_WRITE(memo, &data->buf, buf);
+ data = (struct sort_by_data *)&memo->u1;
+ data->ary = ary;
+ data->buf = buf;
data->n = 0;
rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
ary = data->ary;
@@ -1178,39 +1003,30 @@ enum_sort_by(VALUE obj)
return ary;
}
-#define ENUMFUNC(name) argc ? name##_eqq : rb_block_given_p() ? name##_iter_i : name##_i
-
-#define MEMO_ENUM_NEW(v1) (rb_check_arity(argc, 0, 1), MEMO_NEW((v1), (argc ? *argv : 0), 0))
+#define ENUMFUNC(name) rb_block_given_p() ? name##_iter_i : name##_i
#define DEFINE_ENUMFUNCS(name) \
-static VALUE enum_##name##_func(VALUE result, struct MEMO *memo); \
+static VALUE enum_##name##_func(VALUE result, NODE *memo); \
\
static VALUE \
name##_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
- return enum_##name##_func(rb_enum_values_pack(argc, argv), MEMO_CAST(memo)); \
+ return enum_##name##_func(rb_enum_values_pack(argc, argv), RNODE(memo)); \
} \
\
static VALUE \
name##_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
{ \
- return enum_##name##_func(rb_yield_values2(argc, argv), MEMO_CAST(memo)); \
-} \
-\
-static VALUE \
-name##_eqq(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo)) \
-{ \
- ENUM_WANT_SVALUE(); \
- return enum_##name##_func(rb_funcallv(MEMO_CAST(memo)->v2, id_eqq, 1, &i), MEMO_CAST(memo)); \
+ return enum_##name##_func(enum_yield(argc, argv), RNODE(memo)); \
} \
\
static VALUE \
-enum_##name##_func(VALUE result, struct MEMO *memo)
+enum_##name##_func(VALUE result, NODE *memo)
DEFINE_ENUMFUNCS(all)
{
if (!RTEST(result)) {
- MEMO_V1_SET(memo, Qfalse);
+ memo->u1.value = Qfalse;
rb_iter_break();
}
return Qnil;
@@ -1219,7 +1035,6 @@ DEFINE_ENUMFUNCS(all)
/*
* call-seq:
* enum.all? [{ |obj| block } ] -> true or false
- * enum.all?(pattern) -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns
@@ -1228,30 +1043,24 @@ DEFINE_ENUMFUNCS(all)
* cause #all? to return +true+ when none of the collection members are
* +false+ or +nil+.
*
- * If instead a pattern is supplied, the method returns whether
- * <code>pattern === element</code> for every collection member.
- *
* %w[ant bear cat].all? { |word| word.length >= 3 } #=> true
* %w[ant bear cat].all? { |word| word.length >= 4 } #=> false
- * %w[ant bear cat].all?(/t/) #=> false
- * [1, 2i, 3.14].all?(Numeric) #=> true
* [nil, true, 99].all? #=> false
- * [].all? #=> true
*
*/
static VALUE
-enum_all(int argc, VALUE *argv, VALUE obj)
+enum_all(VALUE obj)
{
- struct MEMO *memo = MEMO_ENUM_NEW(Qtrue);
+ NODE *memo = NEW_MEMO(Qtrue, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(all), (VALUE)memo);
- return memo->v1;
+ return memo->u1.value;
}
DEFINE_ENUMFUNCS(any)
{
if (RTEST(result)) {
- MEMO_V1_SET(memo, Qtrue);
+ memo->u1.value = Qtrue;
rb_iter_break();
}
return Qnil;
@@ -1260,7 +1069,6 @@ DEFINE_ENUMFUNCS(any)
/*
* call-seq:
* enum.any? [{ |obj| block }] -> true or false
- * enum.any?(pattern) -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block ever returns a value other
@@ -1269,34 +1077,28 @@ DEFINE_ENUMFUNCS(any)
* will cause #any? to return +true+ if at least one of the collection
* members is not +false+ or +nil+.
*
- * If instead a pattern is supplied, the method returns whether
- * <code>pattern === element</code> for any collection member.
- *
* %w[ant bear cat].any? { |word| word.length >= 3 } #=> true
* %w[ant bear cat].any? { |word| word.length >= 4 } #=> true
- * %w[ant bear cat].any?(/d/) #=> false
- * [nil, true, 99].any?(Integer) #=> true
* [nil, true, 99].any? #=> true
- * [].any? #=> false
*
*/
static VALUE
-enum_any(int argc, VALUE *argv, VALUE obj)
+enum_any(VALUE obj)
{
- struct MEMO *memo = MEMO_ENUM_NEW(Qfalse);
+ NODE *memo = NEW_MEMO(Qfalse, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(any), (VALUE)memo);
- return memo->v1;
+ return memo->u1.value;
}
DEFINE_ENUMFUNCS(one)
{
if (RTEST(result)) {
- if (memo->v1 == Qundef) {
- MEMO_V1_SET(memo, Qtrue);
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = Qtrue;
}
- else if (memo->v1 == Qtrue) {
- MEMO_V1_SET(memo, Qfalse);
+ else if (memo->u1.value == Qtrue) {
+ memo->u1.value = Qfalse;
rb_iter_break();
}
}
@@ -1308,31 +1110,22 @@ struct nmin_data {
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 VALUE
-cmpint_reenter_check(struct nmin_data *data, VALUE val)
-{
- if (RBASIC(data->buf)->klass) {
- rb_raise(rb_eRuntimeError, "%s reentered", data->method);
- }
- return val;
-}
-
static int
nmin_cmp(const void *ap, const void *bp, void *_data)
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
struct nmin_data *data = (struct nmin_data *)_data;
VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
-#define rb_cmpint(cmp, a, b) rb_cmpint(cmpint_reenter_check(data, (cmp)), a, b)
- return OPTIMIZED_CMP(a, b, cmp_opt);
-#undef rb_cmpint
+ 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
@@ -1341,10 +1134,13 @@ 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);
- cmpint_reenter_check(data, cmp);
+ 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)
{
@@ -1354,7 +1150,6 @@ nmin_filter(struct nmin_data *data)
long numelts;
long left, right;
- long store_index;
long i, j;
@@ -1380,6 +1175,7 @@ nmin_filter(struct nmin_data *data)
while (1) {
long pivot_index = left + (right-left)/2;
+ long store_index;
long num_pivots = 1;
SWAP(pivot_index, right);
@@ -1423,7 +1219,6 @@ nmin_filter(struct nmin_data *data)
#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);
}
@@ -1432,25 +1227,11 @@ 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 = enum_yield(argc, 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, rb_yield(i));
rb_ary_push(data->buf, i);
data->curlen++;
@@ -1462,8 +1243,8 @@ nmin_i(VALUE i, VALUE *_data, int argc, VALUE *argv)
return Qnil;
}
-VALUE
-rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
+static VALUE
+nmin_run(VALUE obj, VALUE num, int by, int rev)
{
VALUE result;
struct nmin_data data;
@@ -1478,7 +1259,6 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
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;
@@ -1486,17 +1266,7 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
data.by = by;
data.method = rev ? (by ? "max_by" : "max")
: (by ? "min_by" : "min");
- if (ary) {
- long i;
- for (i = 0; i < RARRAY_LEN(obj); i++) {
- VALUE args[1];
- args[0] = RARRAY_AREF(obj, i);
- nmin_i(obj, (VALUE*)&data, 1, args);
- }
- }
- else {
- rb_block_call(obj, id_each, 0, 0, nmin_i, (VALUE)&data);
- }
+ rb_block_call(obj, id_each, 0, 0, nmin_i, (VALUE)&data);
nmin_filter(&data);
result = data.buf;
if (by) {
@@ -1514,10 +1284,7 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
ruby_qsort(RARRAY_PTR(result), RARRAY_LEN(result), sizeof(VALUE),
data.cmpfunc, (void *)&data);
}
- if (rev) {
- rb_ary_reverse(result);
- }
- RBASIC_SET_CLASS(result, rb_cArray);
+ *((VALUE *)&RBASIC(result)->klass) = rb_cArray;
return result;
}
@@ -1525,7 +1292,6 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
/*
* call-seq:
* enum.one? [{ |obj| block }] -> true or false
- * enum.one?(pattern) -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block returns <code>true</code>
@@ -1533,27 +1299,21 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
* <code>true</code> only if exactly one of the collection members is
* true.
*
- * If instead a pattern is supplied, the method returns whether
- * <code>pattern === element</code> for exactly one collection member.
- *
* %w{ant bear cat}.one? { |word| word.length == 4 } #=> true
* %w{ant bear cat}.one? { |word| word.length > 4 } #=> false
* %w{ant bear cat}.one? { |word| word.length < 4 } #=> false
- * %w{ant bear cat}.one?(/t/) #=> false
* [ nil, true, 99 ].one? #=> false
* [ nil, true, false ].one? #=> true
- * [ nil, true, 99 ].one?(Integer) #=> true
- * [].one? #=> false
*
*/
static VALUE
-enum_one(int argc, VALUE *argv, VALUE obj)
+enum_one(VALUE obj)
{
- struct MEMO *memo = MEMO_ENUM_NEW(Qundef);
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
VALUE result;
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(one), (VALUE)memo);
- result = memo->v1;
+ result = memo->u1.value;
if (result == Qundef) return Qfalse;
return result;
}
@@ -1561,7 +1321,7 @@ enum_one(int argc, VALUE *argv, VALUE obj)
DEFINE_ENUMFUNCS(none)
{
if (RTEST(result)) {
- MEMO_V1_SET(memo, Qfalse);
+ memo->u1.value = Qfalse;
rb_iter_break();
}
return Qnil;
@@ -1570,51 +1330,41 @@ DEFINE_ENUMFUNCS(none)
/*
* call-seq:
* enum.none? [{ |obj| block }] -> true or false
- * enum.none?(pattern) -> true or false
*
* Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns <code>true</code>
* for all elements. If the block is not given, <code>none?</code> will return
* <code>true</code> only if none of the collection members is true.
*
- * If instead a pattern is supplied, the method returns whether
- * <code>pattern === element</code> for none of the collection members.
- *
* %w{ant bear cat}.none? { |word| word.length == 5 } #=> true
* %w{ant bear cat}.none? { |word| word.length >= 4 } #=> false
- * %w{ant bear cat}.none?(/d/) #=> true
- * [1, 3.14, 42].none?(Float) #=> false
* [].none? #=> true
* [nil].none? #=> true
* [nil, false].none? #=> true
- * [nil, false, true].none? #=> false
*/
static VALUE
-enum_none(int argc, VALUE *argv, VALUE obj)
+enum_none(VALUE obj)
{
- struct MEMO *memo = MEMO_ENUM_NEW(Qtrue);
+ NODE *memo = NEW_MEMO(Qtrue, 0, 0);
rb_block_call(obj, id_each, 0, 0, ENUMFUNC(none), (VALUE)memo);
- return memo->v1;
+ return memo->u1.value;
}
-struct min_t {
- VALUE min;
- struct cmp_opt_data cmp_opt;
-};
-
static VALUE
min_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct min_t *memo = MEMO_FOR(struct min_t, args);
+ VALUE cmp;
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (memo->min == Qundef) {
- memo->min = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- if (OPTIMIZED_CMP(i, memo->min, memo->cmp_opt) < 0) {
- memo->min = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1624,17 +1374,17 @@ static VALUE
min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
VALUE cmp;
- struct min_t *memo = MEMO_FOR(struct min_t, args);
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (memo->min == Qundef) {
- memo->min = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_yield_values(2, i, memo->min);
- if (rb_cmpint(cmp, i, memo->min) < 0) {
- memo->min = i;
+ cmp = rb_yield_values(2, i, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) < 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1644,11 +1394,11 @@ min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
/*
* call-seq:
* enum.min -> obj
- * enum.min { |a, b| block } -> obj
+ * enum.min {| a,b | block } -> obj
* enum.min(n) -> array
- * enum.min(n) { |a, b| block } -> array
+ * enum.min(n) {| a,b | block } -> array
*
- * Returns the object in _enum_ with the minimum value. The
+ * Returns the object in <i>enum</i> with the minimum value. The
* first form assumes all objects implement <code>Comparable</code>;
* the second uses the block to return <em>a <=> b</em>.
*
@@ -1657,59 +1407,51 @@ min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
* a.min { |a, b| a.length <=> b.length } #=> "dog"
*
* If the +n+ argument is given, minimum +n+ elements are returned
- * as a sorted array.
+ * as an 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(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo;
- struct min_t *m = NEW_CMP_OPT_MEMO(struct min_t, memo);
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
VALUE result;
VALUE num;
rb_scan_args(argc, argv, "01", &num);
if (!NIL_P(num))
- return rb_nmin_run(obj, num, 0, 0, 0);
+ return nmin_run(obj, num, 0, 0);
- m->min = Qundef;
- m->cmp_opt.opt_methods = 0;
- m->cmp_opt.opt_inited = 0;
if (rb_block_given_p()) {
- rb_block_call(obj, id_each, 0, 0, min_ii, memo);
+ rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)memo);
}
else {
- rb_block_call(obj, id_each, 0, 0, min_i, memo);
+ rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)memo);
}
- result = m->min;
+ result = memo->u1.value;
if (result == Qundef) return Qnil;
return result;
}
-struct max_t {
- VALUE max;
- struct cmp_opt_data cmp_opt;
-};
-
static VALUE
max_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct max_t *memo = MEMO_FOR(struct max_t, args);
+ NODE *memo = RNODE(args);
+ VALUE cmp;
ENUM_WANT_SVALUE();
- if (memo->max == Qundef) {
- memo->max = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- if (OPTIMIZED_CMP(i, memo->max, memo->cmp_opt) > 0) {
- memo->max = i;
+ cmp = rb_funcall(i, id_cmp, 1, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1718,18 +1460,18 @@ max_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct max_t *memo = MEMO_FOR(struct max_t, args);
+ NODE *memo = RNODE(args);
VALUE cmp;
ENUM_WANT_SVALUE();
- if (memo->max == Qundef) {
- memo->max = i;
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = i;
}
else {
- cmp = rb_yield_values(2, i, memo->max);
- if (rb_cmpint(cmp, i, memo->max) > 0) {
- memo->max = i;
+ cmp = rb_yield_values(2, i, memo->u1.value);
+ if (rb_cmpint(cmp, i, memo->u1.value) > 0) {
+ memo->u1.value = i;
}
}
return Qnil;
@@ -1737,10 +1479,10 @@ max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
/*
* call-seq:
- * enum.max -> obj
- * enum.max { |a, b| block } -> obj
- * enum.max(n) -> array
- * enum.max(n) { |a, b| block } -> array
+ * 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>;
@@ -1751,37 +1493,32 @@ max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
* 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.
+ * as an array.
*
* 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]
+ * a.max(2) #=> ["dog", "horse"]
+ * a.max(2) {|a, b| a.length <=> b.length } #=> ["horse", "albatross"]
*/
static VALUE
enum_max(int argc, VALUE *argv, VALUE obj)
{
- VALUE memo;
- struct max_t *m = NEW_CMP_OPT_MEMO(struct max_t, memo);
+ NODE *memo = NEW_MEMO(Qundef, 0, 0);
VALUE result;
VALUE num;
rb_scan_args(argc, argv, "01", &num);
if (!NIL_P(num))
- return rb_nmin_run(obj, num, 0, 1, 0);
+ return nmin_run(obj, num, 0, 1);
- m->max = Qundef;
- m->cmp_opt.opt_methods = 0;
- m->cmp_opt.opt_inited = 0;
if (rb_block_given_p()) {
rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)memo);
}
else {
rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)memo);
}
- result = m->max;
+ result = memo->u1.value;
if (result == Qundef) return Qnil;
return result;
}
@@ -1790,9 +1527,10 @@ struct minmax_t {
VALUE min;
VALUE max;
VALUE last;
- struct cmp_opt_data cmp_opt;
};
+STATIC_ASSERT(minmax_t, sizeof(struct minmax_t) <= sizeof(NODE) - offsetof(NODE, u1));
+
static void
minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
{
@@ -1803,11 +1541,11 @@ minmax_i_update(VALUE i, VALUE j, struct minmax_t *memo)
memo->max = j;
}
else {
- n = OPTIMIZED_CMP(i, memo->min, memo->cmp_opt);
+ n = rb_cmpint(rb_funcall(i, id_cmp, 1, memo->min), i, memo->min);
if (n < 0) {
memo->min = i;
}
- n = OPTIMIZED_CMP(j, memo->max, memo->cmp_opt);
+ n = rb_cmpint(rb_funcall(j, id_cmp, 1, memo->max), j, memo->max);
if (n > 0) {
memo->max = j;
}
@@ -1817,7 +1555,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 = MEMO_FOR(struct minmax_t, _memo);
+ struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
VALUE j;
@@ -1830,7 +1568,7 @@ minmax_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
j = memo->last;
memo->last = Qundef;
- n = OPTIMIZED_CMP(j, i, memo->cmp_opt);
+ n = rb_cmpint(rb_funcall(j, id_cmp, 1, i), j, i);
if (n == 0)
i = j;
else if (n < 0) {
@@ -1869,7 +1607,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 = MEMO_FOR(struct minmax_t, _memo);
+ struct minmax_t *memo = (struct minmax_t *)&RNODE(_memo)->u1.value;
int n;
VALUE j;
@@ -1902,7 +1640,7 @@ minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
* enum.minmax -> [min, max]
* enum.minmax { |a, b| block } -> [min, max]
*
- * Returns a two element array which contains the minimum and the
+ * Returns two elements 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>.
@@ -1915,46 +1653,45 @@ minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
static VALUE
enum_minmax(VALUE obj)
{
- VALUE memo;
- struct minmax_t *m = NEW_CMP_OPT_MEMO(struct minmax_t, memo);
+ NODE *memo = NEW_MEMO(Qundef, Qundef, Qundef);
+ struct minmax_t *m = (struct minmax_t *)&memo->u1.value;
+ VALUE ary = rb_ary_new3(2, Qnil, Qnil);
m->min = Qundef;
m->last = Qundef;
- m->cmp_opt.opt_methods = 0;
- m->cmp_opt.opt_inited = 0;
if (rb_block_given_p()) {
- rb_block_call(obj, id_each, 0, 0, minmax_ii, memo);
+ rb_block_call(obj, id_each, 0, 0, minmax_ii, (VALUE)memo);
if (m->last != Qundef)
minmax_ii_update(m->last, m->last, m);
}
else {
- rb_block_call(obj, id_each, 0, 0, minmax_i, memo);
+ rb_block_call(obj, id_each, 0, 0, minmax_i, (VALUE)memo);
if (m->last != Qundef)
minmax_i_update(m->last, m->last, m);
}
if (m->min != Qundef) {
- return rb_assoc_new(m->min, m->max);
+ rb_ary_store(ary, 0, m->min);
+ rb_ary_store(ary, 1, m->max);
}
- return rb_assoc_new(Qnil, Qnil);
+ return ary;
}
static VALUE
min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
VALUE v;
ENUM_WANT_SVALUE();
- v = enum_yield(argc, i);
- if (memo->v1 == Qundef) {
- MEMO_V1_SET(memo, v);
- MEMO_V2_SET(memo, i);
+ v = rb_yield(i);
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
- else if (OPTIMIZED_CMP(v, memo->v1, cmp_opt) < 0) {
- 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;
}
return Qnil;
}
@@ -1975,8 +1712,7 @@ min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
* 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.
+ * as an array.
*
* a = %w[albatross dog horse]
* p a.min_by(2) {|x| x.length } #=> ["dog", "horse"]
@@ -1985,7 +1721,7 @@ min_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
enum_min_by(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
VALUE num;
rb_scan_args(argc, argv, "01", &num);
@@ -1993,30 +1729,29 @@ enum_min_by(int argc, VALUE *argv, VALUE obj)
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
if (!NIL_P(num))
- return rb_nmin_run(obj, num, 1, 0, 0);
+ return nmin_run(obj, num, 1, 0);
- memo = MEMO_NEW(Qundef, Qnil, 0);
+ memo = NEW_MEMO(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, min_by_i, (VALUE)memo);
- return memo->v2;
+ return memo->u2.value;
}
static VALUE
max_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
VALUE v;
ENUM_WANT_SVALUE();
- v = enum_yield(argc, i);
- if (memo->v1 == Qundef) {
- MEMO_V1_SET(memo, v);
- MEMO_V2_SET(memo, i);
+ v = rb_yield(i);
+ if (memo->u1.value == Qundef) {
+ memo->u1.value = v;
+ memo->u2.value = i;
}
- else if (OPTIMIZED_CMP(v, memo->v1, cmp_opt) > 0) {
- 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;
}
return Qnil;
}
@@ -2036,12 +1771,11 @@ 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.
+ * If the +n+ argument is given, minimum +n+ elements are returned
+ * as an array.
*
* a = %w[albatross dog horse]
- * a.max_by(2) {|x| x.length } #=> ["albatross", "horse"]
+ * a.max_by(2) {|x| x.length } #=> ["horse", "albatross"]
*
* enum.max_by(n) can be used to implement weighted random sampling.
* Following example implements and use Enumerable#wsample.
@@ -2092,7 +1826,7 @@ max_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
enum_max_by(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
VALUE num;
rb_scan_args(argc, argv, "01", &num);
@@ -2100,11 +1834,11 @@ enum_max_by(int argc, VALUE *argv, VALUE obj)
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
if (!NIL_P(num))
- return rb_nmin_run(obj, num, 1, 1, 0);
+ return nmin_run(obj, num, 1, 1);
- memo = MEMO_NEW(Qundef, Qnil, 0);
+ memo = NEW_MEMO(Qundef, Qnil, 0);
rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo);
- return memo->v2;
+ return memo->u2.value;
}
struct minmax_by_t {
@@ -2119,8 +1853,6 @@ struct minmax_by_t {
static void
minmax_by_i_update(VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *memo)
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
-
if (memo->min_bv == Qundef) {
memo->min_bv = v1;
memo->max_bv = v2;
@@ -2128,11 +1860,11 @@ minmax_by_i_update(VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *m
memo->max = i2;
}
else {
- if (OPTIMIZED_CMP(v1, memo->min_bv, cmp_opt) < 0) {
+ if (rb_cmpint(rb_funcall(v1, id_cmp, 1, memo->min_bv), v1, memo->min_bv) < 0) {
memo->min_bv = v1;
memo->min = i1;
}
- if (OPTIMIZED_CMP(v2, memo->max_bv, cmp_opt) > 0) {
+ if (rb_cmpint(rb_funcall(v2, id_cmp, 1, memo->max_bv), v2, memo->max_bv) > 0) {
memo->max_bv = v2;
memo->max = i2;
}
@@ -2142,14 +1874,13 @@ minmax_by_i_update(VALUE v1, VALUE v2, VALUE i1, VALUE i2, struct minmax_by_t *m
static VALUE
minmax_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
struct minmax_by_t *memo = MEMO_FOR(struct minmax_by_t, _memo);
VALUE vi, vj, j;
int n;
ENUM_WANT_SVALUE();
- vi = enum_yield(argc, i);
+ vi = rb_yield(i);
if (memo->last_bv == Qundef) {
memo->last_bv = vi;
@@ -2160,7 +1891,7 @@ minmax_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
j = memo->last;
memo->last_bv = Qundef;
- n = OPTIMIZED_CMP(vj, vi, cmp_opt);
+ n = rb_cmpint(rb_funcall(vj, id_cmp, 1, vi), vj, vi);
if (n == 0) {
i = j;
vi = vj;
@@ -2219,10 +1950,10 @@ enum_minmax_by(VALUE obj)
static VALUE
member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
{
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
- if (rb_equal(rb_enum_values_pack(argc, argv), memo->v1)) {
- MEMO_V2_SET(memo, Qtrue);
+ if (rb_equal(rb_enum_values_pack(argc, argv), memo->u1.value)) {
+ memo->u2.value = Qtrue;
rb_iter_break();
}
return Qnil;
@@ -2238,28 +1969,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)
{
- struct MEMO *memo = MEMO_NEW(val, Qfalse, 0);
+ NODE *memo = NEW_MEMO(val, Qfalse, 0);
rb_block_call(obj, id_each, 0, 0, member_i, (VALUE)memo);
- return memo->v2;
+ return memo->u2.value;
}
static VALUE
each_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
{
- struct MEMO *m = MEMO_CAST(memo);
- VALUE n = imemo_count_value(m);
+ long n = RNODE(memo)->u3.cnt++;
- imemo_count_up(m);
- return rb_yield_values(2, rb_enum_values_pack(argc, argv), n);
+ return rb_yield_values(2, rb_enum_values_pack(argc, argv), INT2NUM(n));
}
/*
@@ -2284,11 +2011,11 @@ each_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memo))
static VALUE
enum_each_with_index(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- memo = MEMO_NEW(0, 0, 0);
+ memo = NEW_MEMO(0, 0, 0);
rb_block_call(obj, id_each, argc, argv, each_with_index_i, (VALUE)memo);
return obj;
}
@@ -2334,7 +2061,7 @@ static VALUE
each_val_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, p))
{
ENUM_WANT_SVALUE();
- enum_yield(argc, i);
+ rb_yield(i);
return Qnil;
}
@@ -2375,29 +2102,14 @@ enum_each_entry(int argc, VALUE *argv, VALUE obj)
return obj;
}
-static VALUE
-add_int(VALUE x, long n)
-{
- const VALUE y = LONG2NUM(n);
- if (RB_INTEGER_TYPE_P(x)) return rb_int_plus(x, y);
- return rb_funcallv(x, '+', 1, &y);
-}
-
-static VALUE
-div_int(VALUE x, long n)
-{
- const VALUE y = LONG2NUM(n);
- if (RB_INTEGER_TYPE_P(x)) return rb_int_idiv(x, y);
- return rb_funcallv(x, id_div, 1, &y);
-}
-
#define dont_recycle_block_arg(arity) ((arity) == 1 || (arity) < 0)
+#define nd_no_recycle u2.value
static VALUE
each_slice_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
{
- struct MEMO *memo = MEMO_CAST(m);
- VALUE ary = memo->v1;
+ NODE *memo = RNODE(m);
+ VALUE ary = memo->u1.value;
VALUE v = Qnil;
long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
@@ -2407,8 +2119,8 @@ each_slice_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
if (RARRAY_LEN(ary) == size) {
v = rb_yield(ary);
- if (memo->v2) {
- MEMO_V1_SET(memo, rb_ary_new2(size));
+ if (memo->nd_no_recycle) {
+ memo->u1.value = rb_ary_new2(size);
}
else {
rb_ary_clear(ary);
@@ -2428,8 +2140,8 @@ enum_each_slice_size(VALUE obj, VALUE args, VALUE eobj)
size = enum_size(obj, 0, 0);
if (size == Qnil) return Qnil;
- n = add_int(size, slice_size-1);
- return div_int(n, slice_size);
+ n = rb_funcall(size, '+', 1, LONG2NUM(slice_size-1));
+ return rb_funcall(n, id_div, 1, LONG2FIX(slice_size));
}
/*
@@ -2453,17 +2165,16 @@ enum_each_slice(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
VALUE ary;
- struct MEMO *memo;
+ NODE *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);
arity = rb_block_arity();
- memo = MEMO_NEW(ary, dont_recycle_block_arg(arity), size);
+ memo = NEW_MEMO(ary, dont_recycle_block_arg(arity), size);
rb_block_call(obj, id_each, 0, 0, each_slice_i, (VALUE)memo);
- ary = memo->v1;
+ ary = memo->u1.value;
if (RARRAY_LEN(ary) > 0) rb_yield(ary);
return Qnil;
@@ -2472,8 +2183,8 @@ enum_each_slice(VALUE obj, VALUE n)
static VALUE
each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
- VALUE ary = memo->v1;
+ NODE *memo = RNODE(args);
+ VALUE ary = memo->u1.value;
VALUE v = Qnil;
long size = memo->u3.cnt;
ENUM_WANT_SVALUE();
@@ -2483,7 +2194,7 @@ each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
}
rb_ary_push(ary, i);
if (RARRAY_LEN(ary) == size) {
- if (memo->v2) {
+ if (memo->nd_no_recycle) {
ary = rb_ary_dup(ary);
}
v = rb_yield(ary);
@@ -2494,8 +2205,6 @@ each_cons_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
enum_each_cons_size(VALUE obj, VALUE args, VALUE eobj)
{
- struct cmp_opt_data cmp_opt = { 0, 0 };
- const VALUE zero = LONG2FIX(0);
VALUE n, size;
long cons_size = NUM2LONG(RARRAY_AREF(args, 0));
if (cons_size <= 0) rb_raise(rb_eArgError, "invalid size");
@@ -2503,8 +2212,8 @@ enum_each_cons_size(VALUE obj, VALUE args, VALUE eobj)
size = enum_size(obj, 0, 0);
if (size == Qnil) return Qnil;
- n = add_int(size, 1 - cons_size);
- return (OPTIMIZED_CMP(n, zero, cmp_opt) == -1) ? zero : n;
+ n = rb_funcall(size, '+', 1, LONG2NUM(1 - cons_size));
+ return (rb_cmpint(rb_funcall(n, id_cmp, 1, LONG2FIX(0)), n, LONG2FIX(0)) == -1) ? LONG2FIX(0) : n;
}
/*
@@ -2532,14 +2241,13 @@ static VALUE
enum_each_cons(VALUE obj, VALUE n)
{
long size = NUM2LONG(n);
- struct MEMO *memo;
+ NODE *memo;
int arity;
if (size <= 0) rb_raise(rb_eArgError, "invalid size");
RETURN_SIZED_ENUMERATOR(obj, 1, &n, enum_each_cons_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);
+ memo = NEW_MEMO(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;
@@ -2579,11 +2287,11 @@ enum_each_with_object(VALUE obj, VALUE memo)
static VALUE
zip_ary(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
- struct MEMO *memo = (struct MEMO *)memoval;
- VALUE result = memo->v1;
- VALUE args = memo->v2;
+ NODE *memo = (NODE *)memoval;
+ volatile VALUE result = memo->u1.value;
+ volatile VALUE args = memo->u2.value;
long n = memo->u3.cnt++;
- VALUE tmp;
+ volatile VALUE tmp;
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
@@ -2599,21 +2307,18 @@ zip_ary(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
}
}
if (NIL_P(result)) {
- enum_yield_array(tmp);
+ rb_yield(tmp);
}
else {
rb_ary_push(result, tmp);
}
-
- RB_GC_GUARD(args);
-
return Qnil;
}
static VALUE
call_next(VALUE *v)
{
- return v[0] = rb_funcallv(v[1], id_next, 0, 0);
+ return v[0] = rb_funcall(v[1], id_next, 0, 0);
}
static VALUE
@@ -2625,10 +2330,10 @@ call_stop(VALUE *v)
static VALUE
zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
{
- struct MEMO *memo = (struct MEMO *)memoval;
- VALUE result = memo->v1;
- VALUE args = memo->v2;
- VALUE tmp;
+ NODE *memo = (NODE *)memoval;
+ volatile VALUE result = memo->u1.value;
+ volatile VALUE args = memo->u2.value;
+ volatile VALUE tmp;
int i;
tmp = rb_ary_new2(RARRAY_LEN(args) + 1);
@@ -2650,14 +2355,11 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
}
}
if (NIL_P(result)) {
- enum_yield_array(tmp);
+ rb_yield(tmp);
}
else {
rb_ary_push(result, tmp);
}
-
- RB_GC_GUARD(args);
-
return Qnil;
}
@@ -2683,10 +2385,6 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
* [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
@@ -2694,7 +2392,7 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
{
int i;
ID conv;
- struct MEMO *memo;
+ NODE *memo;
VALUE result = Qnil;
VALUE args = rb_ary_new4(argc, argv);
int allary = TRUE;
@@ -2709,22 +2407,20 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
argv[i] = ary;
}
if (!allary) {
- static const VALUE sym_each = STATIC_ID2SYM(id_each);
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 %"PRIsVALUE" (must respond to :each)",
- rb_obj_class(argv[i]));
+ rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)",
+ rb_obj_classname(argv[i]));
}
- argv[i] = rb_funcallv(argv[i], conv, 1, &sym_each);
+ argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
}
}
if (!rb_block_given_p()) {
result = rb_ary_new();
}
-
- /* TODO: use NODE_DOT2 as memo(v, v, -) */
- memo = MEMO_NEW(result, args, 0);
+ /* use NODE_DOT2 as memo(v, v, -) */
+ memo = rb_node_newnode(NODE_DOT2, result, args, 0);
rb_block_call(obj, id_each, 0, 0, allary ? zip_ary : zip_i, (VALUE)memo);
return result;
@@ -2733,8 +2429,8 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
static VALUE
take_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
- rb_ary_push(memo->v1, rb_enum_values_pack(argc, argv));
+ NODE *memo = RNODE(args);
+ rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
if (--memo->u3.cnt == 0) rb_iter_break();
return Qnil;
}
@@ -2754,7 +2450,7 @@ take_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
static VALUE
enum_take(VALUE obj, VALUE n)
{
- struct MEMO *memo;
+ NODE *memo;
VALUE result;
long len = NUM2LONG(n);
@@ -2764,7 +2460,7 @@ enum_take(VALUE obj, VALUE n)
if (len == 0) return rb_ary_new2(0);
result = rb_ary_new2(len);
- memo = MEMO_NEW(result, 0, len);
+ memo = NEW_MEMO(result, 0, len);
rb_block_call(obj, id_each, 0, 0, take_i, (VALUE)memo);
return result;
}
@@ -2773,14 +2469,14 @@ enum_take(VALUE obj, VALUE n)
static VALUE
take_while_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
- if (!RTEST(rb_yield_values2(argc, argv))) rb_iter_break();
+ if (!RTEST(enum_yield(argc, argv))) rb_iter_break();
rb_ary_push(ary, rb_enum_values_pack(argc, argv));
return Qnil;
}
/*
* call-seq:
- * enum.take_while { |obj| block } -> array
+ * enum.take_while { |arr| block } -> array
* enum.take_while -> an_enumerator
*
* Passes elements to the block until the block returns +nil+ or +false+,
@@ -2807,9 +2503,9 @@ enum_take_while(VALUE obj)
static VALUE
drop_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
if (memo->u3.cnt == 0) {
- rb_ary_push(memo->v1, rb_enum_values_pack(argc, argv));
+ rb_ary_push(memo->u1.value, rb_enum_values_pack(argc, argv));
}
else {
memo->u3.cnt--;
@@ -2833,7 +2529,7 @@ static VALUE
enum_drop(VALUE obj, VALUE n)
{
VALUE result;
- struct MEMO *memo;
+ NODE *memo;
long len = NUM2LONG(n);
if (len < 0) {
@@ -2841,7 +2537,7 @@ enum_drop(VALUE obj, VALUE n)
}
result = rb_ary_new();
- memo = MEMO_NEW(result, 0, len);
+ memo = NEW_MEMO(result, 0, len);
rb_block_call(obj, id_each, 0, 0, drop_i, (VALUE)memo);
return result;
}
@@ -2850,21 +2546,21 @@ enum_drop(VALUE obj, VALUE n)
static VALUE
drop_while_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
{
- struct MEMO *memo = MEMO_CAST(args);
+ NODE *memo = RNODE(args);
ENUM_WANT_SVALUE();
- if (!memo->u3.state && !RTEST(enum_yield(argc, i))) {
+ if (!memo->u3.state && !RTEST(rb_yield(i))) {
memo->u3.state = TRUE;
}
if (memo->u3.state) {
- rb_ary_push(memo->v1, i);
+ rb_ary_push(memo->u1.value, i);
}
return Qnil;
}
/*
* call-seq:
- * enum.drop_while { |obj| block } -> array
+ * enum.drop_while { |arr| block } -> array
* enum.drop_while -> an_enumerator
*
* Drops elements up to, but not including, the first element for
@@ -2882,11 +2578,11 @@ static VALUE
enum_drop_while(VALUE obj)
{
VALUE result;
- struct MEMO *memo;
+ NODE *memo;
RETURN_ENUMERATOR(obj, 0, 0);
result = rb_ary_new();
- memo = MEMO_NEW(result, 0, FALSE);
+ memo = NEW_MEMO(result, 0, FALSE);
rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)memo);
return result;
}
@@ -2896,30 +2592,27 @@ cycle_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
ENUM_WANT_SVALUE();
- rb_ary_push(ary, argc > 1 ? i : rb_ary_new_from_values(argc, argv));
- enum_yield(argc, i);
+ rb_ary_push(ary, i);
+ rb_yield(i);
return Qnil;
}
static VALUE
enum_cycle_size(VALUE self, VALUE args, VALUE eobj)
{
- long mul = 0;
+ long mul;
VALUE n = Qnil;
- VALUE size;
+ VALUE size = enum_size(self, args, 0);
+
+ if (size == Qnil) return Qnil;
if (args && (RARRAY_LEN(args) > 0)) {
n = RARRAY_AREF(args, 0);
- if (!NIL_P(n)) mul = NUM2LONG(n);
}
-
- size = enum_size(self, args, 0);
- if (NIL_P(size) || FIXNUM_ZERO_P(size)) return size;
-
- if (NIL_P(n)) return DBL2NUM(INFINITY);
+ if (n == Qnil) return DBL2NUM(INFINITY);
+ mul = NUM2LONG(n);
if (mul <= 0) return INT2FIX(0);
- n = LONG2FIX(mul);
- return rb_funcallv(size, '*', 1, &n);
+ return rb_funcall(size, '*', 1, LONG2FIX(mul));
}
/*
@@ -2967,7 +2660,7 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
if (len == 0) return Qnil;
while (n < 0 || 0 < --n) {
for (i=0; i<len; i++) {
- enum_yield_array(RARRAY_AREF(ary, i));
+ rb_yield(RARRAY_AREF(ary, i));
}
}
return Qnil;
@@ -2975,6 +2668,7 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
struct chunk_arg {
VALUE categorize;
+ VALUE state;
VALUE prev_value;
VALUE prev_elts;
VALUE yielder;
@@ -2990,21 +2684,21 @@ chunk_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
ENUM_WANT_SVALUE();
- v = rb_funcallv(argp->categorize, id_call, 1, &i);
+ 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);
if (v == alone) {
if (!NIL_P(argp->prev_value)) {
- s = rb_assoc_new(argp->prev_value, argp->prev_elts);
- rb_funcallv(argp->yielder, id_lshift, 1, &s);
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = argp->prev_elts = Qnil;
}
- v = rb_assoc_new(v, rb_ary_new3(1, i));
- rb_funcallv(argp->yielder, id_lshift, 1, &v);
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(v, rb_ary_new3(1, i)));
}
else if (NIL_P(v) || v == separator) {
if (!NIL_P(argp->prev_value)) {
- v = rb_assoc_new(argp->prev_value, argp->prev_elts);
- rb_funcallv(argp->yielder, id_lshift, 1, &v);
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = argp->prev_elts = Qnil;
}
}
@@ -3021,8 +2715,7 @@ chunk_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
rb_ary_push(argp->prev_elts, i);
}
else {
- s = rb_assoc_new(argp->prev_value, argp->prev_elts);
- rb_funcallv(argp->yielder, id_lshift, 1, &s);
+ rb_funcall(argp->yielder, id_lshift, 1, rb_assoc_new(argp->prev_value, argp->prev_elts));
argp->prev_value = v;
argp->prev_elts = rb_ary_new3(1, i);
}
@@ -3040,22 +2733,25 @@ 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)) {
- arg = rb_assoc_new(memo->prev_value, memo->prev_elts);
- rb_funcallv(memo->yielder, id_lshift, 1, &arg);
- }
+ if (!NIL_P(memo->prev_elts))
+ rb_funcall(memo->yielder, id_lshift, 1, rb_assoc_new(memo->prev_value, memo->prev_elts));
return Qnil;
}
/*
* call-seq:
* enum.chunk { |elt| ... } -> an_enumerator
+ * enum.chunk(initial_state) { |elt, state| ... } -> an_enumerator
*
* Enumerates over the items, chunking them together based on the return
* value of the block.
@@ -3139,18 +2835,27 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* }
* }
*
- * If no block is given, an enumerator to `chunk` is returned instead.
+ * 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(VALUE enumerable)
+enum_chunk(int argc, VALUE *argv, VALUE enumerable)
{
+ VALUE initial_state;
VALUE enumerator;
- RETURN_SIZED_ENUMERATOR(enumerable, 0, 0, enum_size);
+ 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;
}
@@ -3159,6 +2864,7 @@ enum_chunk(VALUE enumerable)
struct slicebefore_arg {
VALUE sep_pred;
VALUE sep_pat;
+ VALUE state;
VALUE prev_elts;
VALUE yielder;
};
@@ -3172,12 +2878,14 @@ slicebefore_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _argp))
ENUM_WANT_SVALUE();
if (!NIL_P(argp->sep_pat))
- header_p = rb_funcallv(argp->sep_pat, id_eqq, 1, &i);
+ 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_funcallv(argp->sep_pred, id_call, 1, &i);
+ header_p = rb_funcall(argp->sep_pred, id_call, 2, i, argp->state);
if (RTEST(header_p)) {
if (!NIL_P(argp->prev_elts))
- rb_funcallv(argp->yielder, id_lshift, 1, &argp->prev_elts);
+ rb_funcall(argp->yielder, id_lshift, 1, argp->prev_elts);
argp->prev_elts = rb_ary_new3(1, i);
}
else {
@@ -3200,13 +2908,17 @@ 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))
- rb_funcallv(memo->yielder, id_lshift, 1, &memo->prev_elts);
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
return Qnil;
}
@@ -3214,6 +2926,7 @@ 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.
@@ -3230,9 +2943,10 @@ 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 +to_a+, +map+, etc., are also usable.
+ * such as map, etc., are also usable.
*
* For example, iteration over ChangeLog entries can be implemented as
* follows:
@@ -3263,7 +2977,7 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* If the block needs to maintain state over multiple elements,
* local variables can be used.
* For example, three or more consecutive increasing numbers can be squashed
- * as follows (see +chunk_while+ for a better way):
+ * as follows:
*
* a = [0, 2, 3, 4, 6, 7, 9]
* prev = a[0]
@@ -3275,34 +2989,33 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* }.join(",")
* #=> "0,2-4,6,7,9"
*
- * 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.
+ * 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.
*
* # Word wrapping. This assumes all characters have same width.
* def wordwrap(words, maxwidth)
- * 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 }
+ * # 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
* }
* end
* text = (1..20).to_a.join(" ")
* enum = wordwrap(text.split(/\s+/), 10)
* puts "-"*10
- * enum.each { |ws| puts ws.join(" ") } # first enumeration.
- * puts "-"*10
- * enum.each { |ws| puts ws.join(" ") } # second enumeration generates same result as the first.
+ * enum.each { |ws| puts ws.join(" ") }
* puts "-"*10
* #=> ----------
* # 1 2 3 4 5
@@ -3312,13 +3025,6 @@ 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.
@@ -3342,10 +3048,9 @@ 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|
- * emp = true
- * f.slice_before { |line|
- * prevemp = emp
- * emp = line == "\n"
+ * f.slice_before(emp: true) { |line, h|
+ * prevemp = h[:emp]
+ * h[:emp] = line == "\n"
* prevemp && line.start_with?("From ")
* }.each { |mail|
* mail.pop if mail.last == "\n"
@@ -3360,10 +3065,11 @@ enum_slice_before(int argc, VALUE *argv, VALUE enumerable)
VALUE enumerator;
if (rb_block_given_p()) {
- if (argc != 0)
- rb_error_arity(argc, 0, 0);
+ VALUE initial_state;
+ rb_scan_args(argc, argv, "01", &initial_state);
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;
@@ -3402,16 +3108,16 @@ sliceafter_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
}
if (NIL_P(memo->pred)) {
- split_p = RTEST(rb_funcallv(memo->pat, id_eqq, 1, &i));
+ split_p = RTEST(rb_funcall(memo->pat, id_eqq, 1, i));
UPDATE_MEMO;
}
else {
- split_p = RTEST(rb_funcallv(memo->pred, id_call, 1, &i));
+ split_p = RTEST(rb_funcall(memo->pred, id_call, 1, i));
UPDATE_MEMO;
}
if (split_p) {
- rb_funcallv(memo->yielder, id_lshift, 1, &memo->prev_elts);
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
UPDATE_MEMO;
memo->prev_elts = Qnil;
}
@@ -3436,7 +3142,7 @@ sliceafter_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
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_funcallv(memo->yielder, id_lshift, 1, &memo->prev_elts);
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
return Qnil;
}
@@ -3484,7 +3190,7 @@ enum_slice_after(int argc, VALUE *argv, VALUE enumerable)
if (rb_block_given_p()) {
if (0 < argc)
- rb_raise(rb_eArgError, "both pattern and block are given");
+ rb_raise(rb_eArgError, "both pattan and block are given");
pred = rb_block_proc();
}
else {
@@ -3500,515 +3206,6 @@ enum_slice_after(int argc, VALUE *argv, VALUE enumerable)
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 {
- VALUE args[2];
- args[0] = memo->prev_elt;
- args[1] = i;
- split_p = RTEST(rb_funcallv(memo->pred, id_call, 2, args));
- UPDATE_MEMO;
-
- if (memo->inverted)
- split_p = !split_p;
-
- if (split_p) {
- rb_funcallv(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_PARTIAL_MEMO_FOR(struct slicewhen_arg, arg, inverted);
-
- 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_funcallv(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 <code>true</code>.
- *
- * 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"]]
- *
- * Enumerable#chunk_while does the same, except splitting when the block
- * returns <code>false</code> instead of <code>true</code>.
- */
-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 <code>false</code>.
- *
- * 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]]
- *
- * Enumerable#slice_when does the same, except splitting when the block
- * returns <code>true</code> instead of <code>false</code>.
- */
-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;
-}
-
-struct enum_sum_memo {
- VALUE v, r;
- long n;
- double f, c;
- int block_given;
- int float_value;
-};
-
-static void
-sum_iter(VALUE i, struct enum_sum_memo *memo)
-{
- const int unused = (assert(memo != NULL), 0);
-
- long n = memo->n;
- VALUE v = memo->v;
- VALUE r = memo->r;
- double f = memo->f;
- double c = memo->c;
-
- if (memo->block_given)
- i = rb_yield(i);
-
- if (memo->float_value)
- goto float_value;
-
- if (FIXNUM_P(v) || RB_TYPE_P(v, T_BIGNUM) || RB_TYPE_P(v, T_RATIONAL)) {
- if (FIXNUM_P(i)) {
- n += FIX2LONG(i); /* should not overflow long type */
- if (!FIXABLE(n)) {
- v = rb_big_plus(LONG2NUM(n), v);
- n = 0;
- }
- }
- else if (RB_TYPE_P(i, T_BIGNUM))
- v = rb_big_plus(i, v);
- else if (RB_TYPE_P(i, T_RATIONAL)) {
- if (r == Qundef)
- r = i;
- else
- r = rb_rational_plus(r, i);
- }
- else {
- if (n != 0) {
- v = rb_fix_plus(LONG2FIX(n), v);
- n = 0;
- }
- if (r != Qundef) {
- /* r can be an Integer when mathn is loaded */
- if (FIXNUM_P(r))
- v = rb_fix_plus(r, v);
- else if (RB_TYPE_P(r, T_BIGNUM))
- v = rb_big_plus(r, v);
- else
- v = rb_rational_plus(r, v);
- r = Qundef;
- }
- if (RB_FLOAT_TYPE_P(i)) {
- f = NUM2DBL(v);
- c = 0.0;
- memo->float_value = 1;
- goto float_value;
- }
- else
- goto some_value;
- }
- }
- else if (RB_FLOAT_TYPE_P(v)) {
- /*
- * Kahan-Babuska balancing compensated summation algorithm
- * See http://link.springer.com/article/10.1007/s00607-005-0139-x
- */
- double x, t;
-
- float_value:
- if (RB_FLOAT_TYPE_P(i))
- x = RFLOAT_VALUE(i);
- else if (FIXNUM_P(i))
- x = FIX2LONG(i);
- else if (RB_TYPE_P(i, T_BIGNUM))
- x = rb_big2dbl(i);
- else if (RB_TYPE_P(i, T_RATIONAL))
- x = rb_num2dbl(i);
- else {
- v = DBL2NUM(f);
- memo->float_value = 0;
- goto some_value;
- }
-
- if (isnan(f)) return;
- if (isnan(x)) {
- memo->v = i;
- memo->f = x;
- return;
- }
- if (isinf(x)) {
- if (isinf(f) && signbit(x) != signbit(f)) {
- memo->f = NAN;
- memo->v = DBL2NUM(f);
- }
- else {
- memo->f = x;
- memo->v = i;
- }
- return;
- }
- if (isinf(f)) return;
-
- t = f + x;
- if (fabs(f) >= fabs(x))
- c += ((f - t) + x);
- else
- c += ((x - t) + f);
- f = t;
- }
- else {
- some_value:
- v = rb_funcallv(v, idPLUS, 1, &i);
- }
-
- memo->v = v;
- memo->n = n;
- memo->r = r;
- memo->f = f;
- memo->c = c;
- (void)unused;
-}
-
-static VALUE
-enum_sum_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
-{
- ENUM_WANT_SVALUE();
- sum_iter(i, (struct enum_sum_memo *) args);
- return Qnil;
-}
-
-static int
-hash_sum_i(VALUE key, VALUE value, VALUE arg)
-{
- sum_iter(rb_assoc_new(key, value), (struct enum_sum_memo *) arg);
- return ST_CONTINUE;
-}
-
-static void
-hash_sum(VALUE hash, struct enum_sum_memo *memo)
-{
- assert(RB_TYPE_P(hash, T_HASH));
- assert(memo != NULL);
-
- rb_hash_foreach(hash, hash_sum_i, (VALUE)memo);
-}
-
-static VALUE
-int_range_sum(VALUE beg, VALUE end, int excl, VALUE init)
-{
- if (excl) {
- if (FIXNUM_P(end))
- end = LONG2FIX(FIX2LONG(end) - 1);
- else
- end = rb_big_minus(end, LONG2FIX(1));
- }
-
- if (rb_int_ge(end, beg)) {
- VALUE a;
- a = rb_int_plus(rb_int_minus(end, beg), LONG2FIX(1));
- a = rb_int_mul(a, rb_int_plus(end, beg));
- a = rb_int_idiv(a, LONG2FIX(2));
- return rb_int_plus(init, a);
- }
-
- return init;
-}
-
-/*
- * call-seq:
- * enum.sum(init=0) -> number
- * enum.sum(init=0) {|e| expr } -> number
- *
- * Returns the sum of elements in an Enumerable.
- *
- * If a block is given, the block is applied to each element
- * before addition.
- *
- * If <i>enum</i> is empty, it returns <i>init</i>.
- *
- * For example:
- *
- * { 1 => 10, 2 => 20 }.sum {|k, v| k * v } #=> 50
- * (1..10).sum #=> 55
- * (1..10).sum {|v| v * 2 } #=> 110
- * [Object.new].each.sum #=> TypeError
- *
- * This method can be used for non-numeric objects by
- * explicit <i>init</i> argument.
- *
- * { 1 => 10, 2 => 20 }.sum([]) #=> [1, 10, 2, 20]
- * "a\nb\nc".each_line.lazy.map(&:chomp).sum("") #=> "abc"
- *
- * Enumerable#sum method may not respect method redefinition of "+"
- * methods such as Integer#+.
- */
-static VALUE
-enum_sum(int argc, VALUE* argv, VALUE obj)
-{
- struct enum_sum_memo memo;
- VALUE beg, end;
- int excl;
-
- if (rb_scan_args(argc, argv, "01", &memo.v) == 0)
- memo.v = LONG2FIX(0);
-
- memo.block_given = rb_block_given_p();
-
- memo.n = 0;
- memo.r = Qundef;
-
- if ((memo.float_value = RB_FLOAT_TYPE_P(memo.v))) {
- memo.f = RFLOAT_VALUE(memo.v);
- memo.c = 0.0;
- }
-
- if (RTEST(rb_range_values(obj, &beg, &end, &excl))) {
- if (!memo.block_given && !memo.float_value &&
- (FIXNUM_P(beg) || RB_TYPE_P(beg, T_BIGNUM)) &&
- (FIXNUM_P(end) || RB_TYPE_P(end, T_BIGNUM))) {
- return int_range_sum(beg, end, excl, memo.v);
- }
- }
-
- if (RB_TYPE_P(obj, T_HASH) &&
- rb_method_basic_definition_p(CLASS_OF(obj), id_each))
- hash_sum(obj, &memo);
- else
- rb_block_call(obj, id_each, 0, 0, enum_sum_i, (VALUE)&memo);
-
- if (memo.float_value) {
- return DBL2NUM(memo.f + memo.c);
- }
- else {
- if (memo.n != 0)
- memo.v = rb_fix_plus(LONG2FIX(memo.n), memo.v);
- if (memo.r != Qundef) {
- /* r can be an Integer when mathn is loaded */
- if (FIXNUM_P(memo.r))
- memo.v = rb_fix_plus(memo.r, memo.v);
- else if (RB_TYPE_P(memo.r, T_BIGNUM))
- memo.v = rb_big_plus(memo.r, memo.v);
- else
- memo.v = rb_rational_plus(memo.r, memo.v);
- }
- return memo.v;
- }
-}
-
-static VALUE
-uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
-{
- ENUM_WANT_SVALUE();
- rb_hash_add_new_element(hash, i, i);
- return Qnil;
-}
-
-static VALUE
-uniq_iter(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
-{
- ENUM_WANT_SVALUE();
- rb_hash_add_new_element(hash, rb_yield_values2(argc, argv), i);
- return Qnil;
-}
-
-/*
- * call-seq:
- * enum.uniq -> new_ary
- * enum.uniq { |item| ... } -> new_ary
- *
- * Returns a new array by removing duplicate values in +self+.
- *
- * See also Array#uniq.
- */
-
-static VALUE
-enum_uniq(VALUE obj)
-{
- VALUE hash, ret;
- rb_block_call_func *const func =
- rb_block_given_p() ? uniq_iter : uniq_func;
-
- hash = rb_obj_hide(rb_hash_new());
- rb_block_call(obj, id_each, 0, 0, func, hash);
- ret = rb_hash_values(hash);
- rb_hash_clear(hash);
- return ret;
-}
-
/*
* The <code>Enumerable</code> mixin provides collection classes with
* several traversal and searching methods, and with the ability to
@@ -4035,7 +3232,6 @@ 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);
@@ -4052,10 +3248,10 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "partition", enum_partition, 0);
rb_define_method(rb_mEnumerable, "group_by", enum_group_by, 0);
rb_define_method(rb_mEnumerable, "first", enum_first, -1);
- rb_define_method(rb_mEnumerable, "all?", enum_all, -1);
- rb_define_method(rb_mEnumerable, "any?", enum_any, -1);
- rb_define_method(rb_mEnumerable, "one?", enum_one, -1);
- rb_define_method(rb_mEnumerable, "none?", enum_none, -1);
+ rb_define_method(rb_mEnumerable, "all?", enum_all, 0);
+ 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, -1);
rb_define_method(rb_mEnumerable, "max", enum_max, -1);
rb_define_method(rb_mEnumerable, "minmax", enum_minmax, 0);
@@ -4076,14 +3272,12 @@ 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, 0);
+ rb_define_method(rb_mEnumerable, "chunk", enum_chunk, -1);
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);
- rb_define_method(rb_mEnumerable, "sum", enum_sum, -1);
- rb_define_method(rb_mEnumerable, "uniq", enum_uniq, 0);
id_next = rb_intern("next");
+ id_call = rb_intern("call");
+ id_size = rb_intern("size");
id_div = rb_intern("div");
}
diff --git a/enumerator.c b/enumerator.c
index 419f34f9e5..eaa3d73464 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -12,6 +12,8 @@
************************************************/
+#include "ruby/ruby.h"
+#include "node.h"
#include "internal.h"
/*
@@ -118,7 +120,6 @@ struct enumerator {
VALUE feedvalue;
VALUE stop_exc;
VALUE size;
- VALUE procs;
rb_enumerator_size_func *size_fn;
};
@@ -126,26 +127,12 @@ static VALUE rb_cGenerator, rb_cYielder;
struct generator {
VALUE proc;
- VALUE obj;
};
struct yielder {
VALUE proc;
};
-typedef struct MEMO *lazyenum_proc_func(VALUE, struct MEMO *, VALUE, long);
-typedef VALUE lazyenum_size_func(VALUE, VALUE);
-typedef struct {
- lazyenum_proc_func *proc;
- lazyenum_size_func *size;
-} lazyenum_funcs;
-
-struct proc_entry {
- VALUE proc;
- VALUE memo;
- const lazyenum_funcs *fn;
-};
-
static VALUE generator_allocate(VALUE klass);
static VALUE generator_init(VALUE obj, VALUE proc);
@@ -164,7 +151,6 @@ enumerator_mark(void *p)
rb_gc_mark(ptr->feedvalue);
rb_gc_mark(ptr->stop_exc);
rb_gc_mark(ptr->size);
- rb_gc_mark(ptr->procs);
}
#define enumerator_free RUBY_TYPED_DEFAULT_FREE
@@ -172,7 +158,7 @@ enumerator_mark(void *p)
static size_t
enumerator_memsize(const void *p)
{
- return sizeof(struct enumerator);
+ return p ? sizeof(struct enumerator) : 0;
}
static const rb_data_type_t enumerator_data_type = {
@@ -182,7 +168,7 @@ static const rb_data_type_t enumerator_data_type = {
enumerator_free,
enumerator_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct enumerator *
@@ -197,41 +183,6 @@ enumerator_ptr(VALUE obj)
return ptr;
}
-static void
-proc_entry_mark(void *p)
-{
- struct proc_entry *ptr = p;
- rb_gc_mark(ptr->proc);
- rb_gc_mark(ptr->memo);
-}
-
-#define proc_entry_free RUBY_TYPED_DEFAULT_FREE
-
-static size_t
-proc_entry_memsize(const void *p)
-{
- return p ? sizeof(struct proc_entry) : 0;
-}
-
-static const rb_data_type_t proc_entry_data_type = {
- "proc_entry",
- {
- proc_entry_mark,
- proc_entry_free,
- proc_entry_memsize,
- },
-};
-
-static struct proc_entry *
-proc_entry_ptr(VALUE proc_entry)
-{
- struct proc_entry *ptr;
-
- TypedData_Get_Struct(proc_entry, struct proc_entry, &proc_entry_data_type, ptr);
-
- return ptr;
-}
-
/*
* call-seq:
* obj.to_enum(method = :each, *args) -> enum
@@ -544,9 +495,9 @@ enumerator_each(int argc, VALUE *argv, VALUE obj)
static VALUE
enumerator_with_index_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- struct MEMO *memo = (struct MEMO *)m;
- VALUE idx = memo->v1;
- MEMO_V1_SET(memo, rb_int_succ(idx));
+ NODE *memo = (NODE *)m;
+ VALUE idx = memo->u1.value;
+ memo->u1.value = rb_int_succ(idx);
if (argc <= 1)
return rb_yield_values(2, val, idx);
@@ -586,7 +537,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)MEMO_NEW(memo, 0, 0));
+ return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)NEW_MEMO(memo, 0, 0));
}
/*
@@ -981,7 +932,6 @@ enumerator_rewind(VALUE obj)
return obj;
}
-static struct generator *generator_ptr(VALUE obj);
static VALUE append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args);
static VALUE
@@ -1004,25 +954,6 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
return str;
}
- if (e->procs) {
- long i;
-
- eobj = generator_ptr(e->obj)->obj;
- /* In case procs chained enumerator traversing all proc entries manually */
- if (rb_obj_class(eobj) == cname) {
- str = rb_inspect(eobj);
- }
- else {
- str = rb_sprintf("#<%"PRIsVALUE": %+"PRIsVALUE">", rb_class_path(cname), eobj);
- }
- for (i = 0; i < RARRAY_LEN(e->procs); i++) {
- str = rb_sprintf("#<%"PRIsVALUE": %"PRIsVALUE, cname, str);
- append_method(RARRAY_AREF(e->procs, i), str, e->meth, e->args);
- rb_str_buf_cat2(str, ">");
- }
- return str;
- }
-
eobj = rb_attr_get(obj, id_receiver);
if (NIL_P(eobj)) {
eobj = e->obj;
@@ -1111,23 +1042,6 @@ enumerator_size(VALUE obj)
const VALUE *argv = NULL;
VALUE size;
- if (e->procs) {
- struct generator *g = generator_ptr(e->obj);
- VALUE receiver = rb_check_funcall(g->obj, id_size, 0, 0);
- long i = 0;
-
- for (i = 0; i < RARRAY_LEN(e->procs); i++) {
- VALUE proc = RARRAY_AREF(e->procs, i);
- struct proc_entry *entry = proc_entry_ptr(proc);
- lazyenum_size_func *size_fn = entry->fn->size;
- if (!size_fn) {
- return Qnil;
- }
- receiver = (*size_fn)(proc, receiver);
- }
- return receiver;
- }
-
if (e->size_fn) {
return (*e->size_fn)(e->obj, e->args, obj);
}
@@ -1155,7 +1069,7 @@ yielder_mark(void *p)
static size_t
yielder_memsize(const void *p)
{
- return sizeof(struct yielder);
+ return p ? sizeof(struct yielder) : 0;
}
static const rb_data_type_t yielder_data_type = {
@@ -1165,7 +1079,7 @@ static const rb_data_type_t yielder_data_type = {
yielder_free,
yielder_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct yielder *
@@ -1255,7 +1169,6 @@ generator_mark(void *p)
{
struct generator *ptr = p;
rb_gc_mark(ptr->proc);
- rb_gc_mark(ptr->obj);
}
#define generator_free RUBY_TYPED_DEFAULT_FREE
@@ -1263,7 +1176,7 @@ generator_mark(void *p)
static size_t
generator_memsize(const void *p)
{
- return sizeof(struct generator);
+ return p ? sizeof(struct generator) : 0;
}
static const rb_data_type_t generator_data_type = {
@@ -1273,7 +1186,7 @@ static const rb_data_type_t generator_data_type = {
generator_free,
generator_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct generator *
@@ -1334,8 +1247,8 @@ generator_initialize(int argc, VALUE *argv, VALUE obj)
if (!rb_obj_is_proc(proc))
rb_raise(rb_eTypeError,
- "wrong argument type %"PRIsVALUE" (expected Proc)",
- rb_obj_class(proc));
+ "wrong argument type %s (expected Proc)",
+ rb_obj_classname(proc));
if (rb_block_given_p()) {
rb_warn("given block not used");
@@ -1420,14 +1333,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);
- nargv[0] = m;
+ args = rb_ary_tmp_new(len);
+ rb_ary_push(args, m);
if (argc > 0) {
- MEMCPY(nargv + 1, argv, VALUE, argc);
+ rb_ary_cat(args, argv, argc);
}
- result = rb_yield_values2(len, nargv);
- ALLOCV_END(args);
+ result = rb_yield_values2(len, RARRAY_CONST_PTR(args));
+ RB_GC_GUARD(args);
}
if (result == Qundef) rb_iter_break();
return Qnil;
@@ -1440,86 +1353,6 @@ lazy_init_block_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
return Qnil;
}
-#define memo_value v2
-#define memo_flags u3.state
-#define LAZY_MEMO_BREAK 1
-#define LAZY_MEMO_PACKED 2
-#define LAZY_MEMO_BREAK_P(memo) ((memo)->memo_flags & LAZY_MEMO_BREAK)
-#define LAZY_MEMO_PACKED_P(memo) ((memo)->memo_flags & LAZY_MEMO_PACKED)
-#define LAZY_MEMO_SET_BREAK(memo) ((memo)->memo_flags |= LAZY_MEMO_BREAK)
-#define LAZY_MEMO_SET_VALUE(memo, value) MEMO_V2_SET(memo, value)
-#define LAZY_MEMO_SET_PACKED(memo) ((memo)->memo_flags |= LAZY_MEMO_PACKED)
-#define LAZY_MEMO_RESET_PACKED(memo) ((memo)->memo_flags &= ~LAZY_MEMO_PACKED)
-
-static VALUE
-lazy_init_yielder(VALUE val, VALUE m, int argc, VALUE *argv)
-{
- VALUE yielder = RARRAY_AREF(m, 0);
- VALUE procs_array = RARRAY_AREF(m, 1);
- VALUE memos = rb_attr_get(yielder, id_memo);
- long i = 0;
- struct MEMO *result;
- int cont = 1;
-
- result = MEMO_NEW(Qnil, rb_enum_values_pack(argc, argv),
- argc > 1 ? LAZY_MEMO_PACKED : 0);
-
- for (i = 0; i < RARRAY_LEN(procs_array); i++) {
- VALUE proc = RARRAY_AREF(procs_array, i);
- struct proc_entry *entry = proc_entry_ptr(proc);
- if (!(*entry->fn->proc)(proc, result, memos, i)) {
- cont = 0;
- break;
- }
- }
-
- if (cont) {
- rb_funcall2(yielder, id_yield, 1, &(result->memo_value));
- }
- if (LAZY_MEMO_BREAK_P(result)) {
- rb_iter_break();
- }
- return result->memo_value;
-}
-
-static VALUE
-lazy_init_block(VALUE val, VALUE m, int argc, VALUE *argv)
-{
- VALUE procs = RARRAY_AREF(m, 1);
-
- rb_ivar_set(val, id_memo, rb_ary_new2(RARRAY_LEN(procs)));
- rb_block_call(RARRAY_AREF(m, 0), id_each, 0, 0,
- lazy_init_yielder, rb_ary_new3(2, val, procs));
- return Qnil;
-}
-
-static VALUE
-lazy_generator_init(VALUE enumerator, VALUE procs)
-{
- VALUE generator;
- VALUE obj;
- struct generator *gen_ptr;
- struct enumerator *e = enumerator_ptr(enumerator);
-
- if (RARRAY_LEN(procs) > 0) {
- struct generator *old_gen_ptr = generator_ptr(e->obj);
- obj = old_gen_ptr->obj;
- }
- else {
- obj = enumerator;
- }
-
- generator = generator_allocate(rb_cGenerator);
-
- rb_block_call(generator, id_initialize, 0, 0,
- lazy_init_block, rb_ary_new3(2, obj, procs));
-
- gen_ptr = generator_ptr(generator);
- gen_ptr->obj = obj;
-
- return generator;
-}
-
/*
* call-seq:
* Lazy.new(obj, size=nil) { |yielder, *values| ... }
@@ -1570,10 +1403,11 @@ lazy_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static void
-lazy_set_args(VALUE lazy, VALUE args)
+static VALUE
+lazy_set_method(VALUE lazy, VALUE args, rb_enumerator_size_func *size_fn)
{
ID id = rb_frame_this_func();
+ struct enumerator *e = enumerator_ptr(lazy);
rb_ivar_set(lazy, id_method, ID2SYM(id));
if (NIL_P(args)) {
/* Qfalse indicates that the arguments are empty */
@@ -1582,63 +1416,16 @@ lazy_set_args(VALUE lazy, VALUE args)
else {
rb_ivar_set(lazy, id_arguments, args);
}
-}
-
-static VALUE
-lazy_set_method(VALUE lazy, VALUE args, rb_enumerator_size_func *size_fn)
-{
- struct enumerator *e = enumerator_ptr(lazy);
- lazy_set_args(lazy, args);
e->size_fn = size_fn;
return lazy;
}
-static VALUE
-lazy_add_method(VALUE obj, int argc, VALUE *argv, VALUE args, VALUE memo,
- const lazyenum_funcs *fn)
-{
- struct enumerator *new_e;
- VALUE new_obj;
- VALUE new_generator;
- VALUE new_procs;
- struct enumerator *e = enumerator_ptr(obj);
- struct proc_entry *entry;
- VALUE entry_obj = TypedData_Make_Struct(rb_cObject, struct proc_entry,
- &proc_entry_data_type, entry);
- if (rb_block_given_p()) {
- entry->proc = rb_block_proc();
- }
- entry->fn = fn;
- entry->memo = args;
-
- lazy_set_args(entry_obj, memo);
-
- new_procs = RTEST(e->procs) ? rb_ary_dup(e->procs) : rb_ary_new();
- new_generator = lazy_generator_init(obj, new_procs);
- rb_ary_push(new_procs, entry_obj);
-
- new_obj = enumerator_init_copy(enumerator_allocate(rb_cLazy), obj);
- new_e = DATA_PTR(new_obj);
- new_e->obj = new_generator;
- new_e->procs = new_procs;
-
- if (argc > 0) {
- new_e->meth = rb_to_id(*argv++);
- --argc;
- }
- else {
- new_e->meth = id_each;
- }
- new_e->args = rb_ary_new4(argc, argv);
- return new_obj;
-}
-
/*
* call-seq:
* e.lazy -> lazy_enumerator
*
* Returns a lazy enumerator, whose methods map/collect,
- * flat_map/collect_concat, select/find_all, reject, grep, grep_v, zip, take,
+ * flat_map/collect_concat, select/find_all, reject, grep, 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.
@@ -1720,45 +1507,14 @@ lazy_to_enum(int argc, VALUE *argv, VALUE self)
}
static VALUE
-lazyenum_yield(VALUE proc_entry, struct MEMO *result)
-{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- return rb_proc_call_with_block(entry->proc, 1, &result->memo_value, Qnil);
-}
-
-static VALUE
-lazyenum_yield_values(VALUE proc_entry, struct MEMO *result)
-{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- int argc = 1;
- const VALUE *argv = &result->memo_value;
- if (LAZY_MEMO_PACKED_P(result)) {
- const VALUE args = *argv;
- argc = RARRAY_LENINT(args);
- argv = RARRAY_CONST_PTR(args);
- }
- return rb_proc_call_with_block(entry->proc, argc, argv, Qnil);
-}
-
-static struct MEMO *
-lazy_map_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+lazy_map_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- VALUE value = lazyenum_yield_values(proc_entry, result);
- LAZY_MEMO_SET_VALUE(result, value);
- LAZY_MEMO_RESET_PACKED(result);
- return result;
-}
+ VALUE result = rb_yield_values2(argc - 1, &argv[1]);
-static VALUE
-lazy_map_size(VALUE entry, VALUE receiver)
-{
- return receiver;
+ rb_funcall(argv[0], id_yield, 1, result);
+ return Qnil;
}
-static const lazyenum_funcs lazy_map_funcs = {
- lazy_map_proc, lazy_map_size,
-};
-
static VALUE
lazy_map(VALUE obj)
{
@@ -1766,13 +1522,15 @@ lazy_map(VALUE obj)
rb_raise(rb_eArgError, "tried to call lazy map without a block");
}
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_map_funcs);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_map_func, 0),
+ Qnil, lazy_receiver_size);
}
static VALUE
lazy_flat_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, yielder))
{
- return rb_funcallv(yielder, id_yield, argc, argv);
+ return rb_funcall2(yielder, id_yield, argc, argv);
}
static VALUE
@@ -1799,7 +1557,7 @@ lazy_flat_map_to_ary(VALUE obj, VALUE yielder)
}
static VALUE
-lazy_flat_map_proc(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
+lazy_flat_map_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
VALUE result = rb_yield_values2(argc - 1, &argv[1]);
if (RB_TYPE_P(result, T_ARRAY)) {
@@ -1850,21 +1608,20 @@ lazy_flat_map(VALUE obj)
}
return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
- lazy_flat_map_proc, 0),
+ lazy_flat_map_func, 0),
Qnil, 0);
}
-static struct MEMO *
-lazy_select_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_select_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- VALUE chain = lazyenum_yield(proc_entry, result);
- if (!RTEST(chain)) return 0;
- return result;
-}
+ VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
-static const lazyenum_funcs lazy_select_funcs = {
- lazy_select_proc, 0,
-};
+ if (RTEST(rb_yield(element))) {
+ return rb_funcall(argv[0], id_yield, 1, element);
+ }
+ return Qnil;
+}
static VALUE
lazy_select(VALUE obj)
@@ -1873,20 +1630,21 @@ lazy_select(VALUE obj)
rb_raise(rb_eArgError, "tried to call lazy select without a block");
}
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_select_funcs);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_select_func, 0),
+ Qnil, 0);
}
-static struct MEMO *
-lazy_reject_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_reject_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- VALUE chain = lazyenum_yield(proc_entry, result);
- if (RTEST(chain)) return 0;
- return result;
-}
+ VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
-static const lazyenum_funcs lazy_reject_funcs = {
- lazy_reject_proc, 0,
-};
+ if (!RTEST(rb_yield(element))) {
+ return rb_funcall(argv[0], id_yield, 1, element);
+ }
+ return Qnil;
+}
static VALUE
lazy_reject(VALUE obj)
@@ -1895,78 +1653,41 @@ lazy_reject(VALUE obj)
rb_raise(rb_eArgError, "tried to call lazy reject without a block");
}
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_reject_funcs);
-}
-
-static struct MEMO *
-lazy_grep_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE chain = rb_funcall(entry->memo, id_eqq, 1, result->memo_value);
- if (!RTEST(chain)) return 0;
- return result;
-}
-
-static struct MEMO *
-lazy_grep_iter_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE value, chain = rb_funcall(entry->memo, id_eqq, 1, result->memo_value);
-
- if (!RTEST(chain)) return 0;
- value = rb_proc_call_with_block(entry->proc, 1, &(result->memo_value), Qnil);
- LAZY_MEMO_SET_VALUE(result, value);
- LAZY_MEMO_RESET_PACKED(result);
-
- return result;
-}
-
-static const lazyenum_funcs lazy_grep_iter_funcs = {
- lazy_grep_iter_proc, 0,
-};
-
-static const lazyenum_funcs lazy_grep_funcs = {
- lazy_grep_proc, 0,
-};
-
-static VALUE
-lazy_grep(VALUE obj, VALUE pattern)
-{
- const lazyenum_funcs *const funcs = rb_block_given_p() ?
- &lazy_grep_iter_funcs : &lazy_grep_funcs;
- return lazy_add_method(obj, 0, 0, pattern, rb_ary_new3(1, pattern), funcs);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_reject_func, 0),
+ Qnil, 0);
}
static VALUE
-lazy_grep_v_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
+lazy_grep_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)) {
+ 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))
+lazy_grep_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)) {
+ if (RTEST(result)) {
rb_funcall(argv[0], id_yield, 1, rb_yield(i));
}
return Qnil;
}
static VALUE
-lazy_grep_v(VALUE obj, VALUE pattern)
+lazy_grep(VALUE obj, VALUE pattern)
{
return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
rb_block_given_p() ?
- lazy_grep_v_iter : lazy_grep_v_func,
+ lazy_grep_iter : lazy_grep_func,
pattern),
rb_ary_new3(1, pattern), 0);
}
@@ -2052,8 +1773,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 %"PRIsVALUE" (must respond to :each)",
- rb_obj_class(argv[i]));
+ rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)",
+ rb_obj_classname(argv[i]));
}
}
ary = rb_ary_new4(argc, argv);
@@ -2068,90 +1789,80 @@ lazy_zip(int argc, VALUE *argv, VALUE obj)
ary, lazy_receiver_size);
}
-static struct MEMO *
-lazy_take_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_take_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
long remain;
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE memo = rb_ary_entry(memos, memo_index);
-
+ VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo)) {
- memo = entry->memo;
+ memo = args;
}
- remain = NUM2LONG(memo);
- if (remain == 0) {
- LAZY_MEMO_SET_BREAK(result);
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ if ((remain = NUM2LONG(memo)-1) == 0) {
+ return Qundef;
}
else {
- if (--remain == 0) LAZY_MEMO_SET_BREAK(result);
- rb_ary_store(memos, memo_index, LONG2NUM(remain));
+ rb_ivar_set(argv[0], id_memo, LONG2NUM(remain));
+ return Qnil;
}
- return result;
}
static VALUE
-lazy_take_size(VALUE entry, VALUE receiver)
+lazy_take_size(VALUE generator, VALUE args, VALUE lazy)
{
- long len = NUM2LONG(RARRAY_AREF(rb_ivar_get(entry, id_arguments), 0));
+ VALUE receiver = lazy_size(lazy);
+ long len = NUM2LONG(RARRAY_AREF(rb_ivar_get(lazy, id_arguments), 0));
if (NIL_P(receiver) || (FIXNUM_P(receiver) && FIX2LONG(receiver) < len))
return receiver;
return LONG2NUM(len);
}
-static const lazyenum_funcs lazy_take_funcs = {
- lazy_take_proc, lazy_take_size,
-};
-
static VALUE
lazy_take(VALUE obj, VALUE n)
{
long len = NUM2LONG(n);
- int argc = 0;
- VALUE argv[2];
+ VALUE lazy;
if (len < 0) {
rb_raise(rb_eArgError, "attempt to take negative size");
}
-
if (len == 0) {
- argv[0] = sym_cycle;
- argv[1] = INT2NUM(0);
- argc = 2;
+ VALUE len = INT2FIX(0);
+ lazy = lazy_to_enum_i(obj, sym_cycle, 1, &len, 0);
}
-
- return lazy_add_method(obj, argc, argv, n, rb_ary_new3(1, n), &lazy_take_funcs);
+ else {
+ lazy = rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_take_func, n);
+ }
+ return lazy_set_method(lazy, rb_ary_new3(1, n), lazy_take_size);
}
-static struct MEMO *
-lazy_take_while_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_take_while_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
- VALUE take = lazyenum_yield_values(proc_entry, result);
- if (!RTEST(take)) {
- LAZY_MEMO_SET_BREAK(result);
- return 0;
- }
- return result;
+ VALUE result = rb_yield_values2(argc - 1, &argv[1]);
+ if (!RTEST(result)) return Qundef;
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
+ return Qnil;
}
-static const lazyenum_funcs lazy_take_while_funcs = {
- lazy_take_while_proc, 0,
-};
-
static VALUE
lazy_take_while(VALUE obj)
{
if (!rb_block_given_p()) {
rb_raise(rb_eArgError, "tried to call lazy take_while without a block");
}
-
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_take_while_funcs);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_take_while_func, 0),
+ Qnil, 0);
}
static VALUE
-lazy_drop_size(VALUE proc_entry, VALUE receiver)
+lazy_drop_size(VALUE generator, VALUE args, VALUE lazy)
{
- long len = NUM2LONG(RARRAY_AREF(rb_ivar_get(proc_entry, id_arguments), 0));
+ long len = NUM2LONG(RARRAY_AREF(rb_ivar_get(lazy, id_arguments), 0));
+ VALUE receiver = lazy_size(lazy);
if (NIL_P(receiver))
return receiver;
if (FIXNUM_P(receiver)) {
@@ -2161,117 +1872,58 @@ lazy_drop_size(VALUE proc_entry, VALUE receiver)
return rb_funcall(receiver, '-', 1, LONG2NUM(len));
}
-static struct MEMO *
-lazy_drop_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_drop_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
long remain;
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE memo = rb_ary_entry(memos, memo_index);
-
+ VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo)) {
- memo = entry->memo;
+ memo = args;
}
- remain = NUM2LONG(memo);
- if (remain > 0) {
- --remain;
- rb_ary_store(memos, memo_index, LONG2NUM(remain));
- return 0;
+ if ((remain = NUM2LONG(memo)) == 0) {
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
}
-
- return result;
+ else {
+ rb_ivar_set(argv[0], id_memo, LONG2NUM(--remain));
+ }
+ return Qnil;
}
-static const lazyenum_funcs lazy_drop_funcs = {
- lazy_drop_proc, lazy_drop_size,
-};
-
static VALUE
lazy_drop(VALUE obj, VALUE n)
{
long len = NUM2LONG(n);
- VALUE argv[2];
- argv[0] = sym_each;
- argv[1] = n;
if (len < 0) {
rb_raise(rb_eArgError, "attempt to drop negative size");
}
-
- return lazy_add_method(obj, 2, argv, n, rb_ary_new3(1, n), &lazy_drop_funcs);
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_drop_func, n),
+ rb_ary_new3(1, n), lazy_drop_size);
}
-static struct MEMO *
-lazy_drop_while_proc(VALUE proc_entry, struct MEMO* result, VALUE memos, long memo_index)
+static VALUE
+lazy_drop_while_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, args))
{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE memo = rb_ary_entry(memos, memo_index);
-
- if (NIL_P(memo)) {
- memo = entry->memo;
+ VALUE memo = rb_attr_get(argv[0], id_memo);
+ if (NIL_P(memo) && !RTEST(rb_yield_values2(argc - 1, &argv[1]))) {
+ rb_ivar_set(argv[0], id_memo, memo = Qtrue);
}
-
- if (!RTEST(memo)) {
- VALUE drop = lazyenum_yield_values(proc_entry, result);
- if (RTEST(drop)) return 0;
- rb_ary_store(memos, memo_index, Qtrue);
+ if (memo == Qtrue) {
+ rb_funcall2(argv[0], id_yield, argc - 1, argv + 1);
}
- return result;
+ return Qnil;
}
-static const lazyenum_funcs lazy_drop_while_funcs = {
- lazy_drop_while_proc, 0,
-};
-
static VALUE
lazy_drop_while(VALUE obj)
{
if (!rb_block_given_p()) {
rb_raise(rb_eArgError, "tried to call lazy drop_while without a block");
}
-
- return lazy_add_method(obj, 0, 0, Qfalse, Qnil, &lazy_drop_while_funcs);
-}
-
-static VALUE
-lazy_uniq_i(VALUE i, int argc, const VALUE *argv, VALUE yielder)
-{
- VALUE hash;
-
- hash = rb_attr_get(yielder, id_memo);
- if (NIL_P(hash)) {
- hash = rb_obj_hide(rb_hash_new());
- rb_ivar_set(yielder, id_memo, hash);
- }
-
- if (rb_hash_add_new_element(hash, i, Qfalse))
- return Qnil;
- return rb_funcallv(yielder, id_yield, argc, argv);
-}
-
-static VALUE
-lazy_uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
-{
- VALUE yielder = (--argc, *argv++);
- i = rb_enum_values_pack(argc, argv);
- return lazy_uniq_i(i, argc, argv, yielder);
-}
-
-static VALUE
-lazy_uniq_iter(RB_BLOCK_CALL_FUNC_ARGLIST(i, m))
-{
- VALUE yielder = (--argc, *argv++);
- i = rb_yield_values2(argc, argv);
- return lazy_uniq_i(i, argc, argv, yielder);
-}
-
-static VALUE
-lazy_uniq(VALUE obj)
-{
- rb_block_call_func *const func =
- rb_block_given_p() ? lazy_uniq_iter : lazy_uniq_func;
return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
- func, 0),
- 0, 0);
+ lazy_drop_while_func, 0),
+ Qnil, 0);
}
static VALUE
@@ -2379,7 +2031,6 @@ 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);
@@ -2389,9 +2040,6 @@ InitVM_Enumerator(void)
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_method(rb_cLazy, "chunk_while", lazy_super, -1);
- rb_define_method(rb_cLazy, "uniq", lazy_uniq, 0);
rb_define_alias(rb_cLazy, "force", "to_a");
diff --git a/error.c b/error.c
index 079f01d6a6..3c2b60ba3b 100644
--- a/error.c
+++ b/error.c
@@ -9,9 +9,10 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/st.h"
-#include "ruby_assert.h"
+#include "ruby/encoding.h"
+#include "internal.h"
#include "vm_core.h"
#include <stdio.h>
@@ -24,15 +25,6 @@
#include <unistd.h>
#endif
-#if defined __APPLE__
-# include <AvailabilityMacros.h>
-#endif
-
-/*!
- * \defgroup exception Exception handlings
- * \{
- */
-
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
@@ -45,17 +37,9 @@
#define WEXITSTATUS(status) (status)
#endif
-VALUE rb_iseqw_local_variables(VALUE iseqval);
-VALUE rb_iseqw_new(const rb_iseq_t *);
-int rb_str_end_with_asciichar(VALUE str, int c);
-
VALUE rb_eEAGAIN;
VALUE rb_eEWOULDBLOCK;
VALUE rb_eEINPROGRESS;
-VALUE rb_mWarning;
-VALUE rb_cWarningBuffer;
-
-static ID id_warn;
extern const char ruby_description[];
@@ -65,6 +49,9 @@ static const char REPORTBUG_MSG[] =
" or extension libraries.\n" \
"Bug reports are welcome.\n" \
""
+#if defined __APPLE__
+ "Don't forget to include the above Crash Report log file.\n"
+#endif
"For details: http://www.ruby-lang.org/bugreport.html\n\n" \
;
@@ -94,9 +81,10 @@ err_position_0(char *buf, long len, const char *file, int line)
}
static VALUE
-err_vcatf(VALUE str, const char *pre, const char *file, int line,
- const char *fmt, va_list args)
+compile_snprintf(rb_encoding *enc, const char *pre, const char *file, int line, const char *fmt, va_list args)
{
+ VALUE str = rb_enc_str_new(0, 0, enc);
+
if (file) {
rb_str_cat2(str, file);
if (line) rb_str_catf(str, ":%d", line);
@@ -107,214 +95,162 @@ err_vcatf(VALUE str, const char *pre, const char *file, int line,
return str;
}
-VALUE
-rb_syntax_error_append(VALUE exc, VALUE file, int line, int column,
- rb_encoding *enc, const char *fmt, va_list args)
-{
- const char *fn = NIL_P(file) ? NULL : RSTRING_PTR(file);
- if (!exc) {
- VALUE mesg = rb_enc_str_new(0, 0, enc);
- err_vcatf(mesg, NULL, fn, line, fmt, args);
- rb_str_cat2(mesg, "\n");
- rb_write_error_str(mesg);
+static void
+compile_err_append(VALUE mesg)
+{
+ rb_thread_t *th = GET_THREAD();
+ VALUE err = th->errinfo;
+ rb_block_t *prev_base_block = th->base_block;
+ th->base_block = 0;
+ /* base_block should be zero while normal Ruby execution */
+ /* after this line, any Ruby code *can* run */
+
+ if (th->mild_compile_error) {
+ if (RTEST(err)) {
+ VALUE str = rb_obj_as_string(err);
+
+ rb_str_cat2(str, "\n");
+ rb_str_append(str, mesg);
+ mesg = str;
+ }
+ err = rb_exc_new3(rb_eSyntaxError, mesg);
+ th->errinfo = err;
}
else {
- VALUE mesg;
- if (NIL_P(exc)) {
- mesg = rb_enc_str_new(0, 0, enc);
- exc = rb_class_new_instance(1, &mesg, rb_eSyntaxError);
+ if (!RTEST(err)) {
+ err = rb_exc_new2(rb_eSyntaxError, "compile error");
+ th->errinfo = err;
}
- else {
- mesg = rb_attr_get(exc, idMesg);
- if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
- rb_str_cat_cstr(mesg, "\n");
- }
- err_vcatf(mesg, NULL, fn, line, fmt, args);
+ rb_str_cat2(mesg, "\n");
+ rb_write_error_str(mesg);
}
- return exc;
+ /* returned to the parser world */
+ th->base_block = prev_base_block;
}
void
-ruby_deprecated_internal_feature(const char *func)
+rb_compile_error_with_enc(const char *file, int line, void *enc, const char *fmt, ...)
{
- rb_print_backtrace();
- rb_fatal("%s is only for internal use and deprecated; do not use", func);
-}
-
-/*
- * call-seq:
- * warn(msg) -> nil
- *
- * Writes warning message +msg+ to $stderr, followed by a newline
- * if the message does not end in a newline. This method is called
- * by Ruby for all emitted warnings.
- */
+ va_list args;
+ VALUE str;
-static VALUE
-rb_warning_s_warn(VALUE mod, VALUE str)
-{
- Check_Type(str, T_STRING);
- rb_must_asciicompat(str);
- rb_write_error_str(str);
- return Qnil;
+ va_start(args, fmt);
+ str = compile_snprintf(enc, NULL, file, line, fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
-/*
- * Document-module: Warning
- *
- * The Warning module contains a single method named #warn, and the
- * module extends itself, making <code>Warning.warn</code> available.
- * Warning.warn is called for all warnings issued by Ruby.
- * By default, warnings are printed to $stderr.
- *
- * By overriding Warning.warn, you can change how warnings are
- * handled by Ruby, either filtering some warnings, and/or outputting
- * warnings somewhere other than $stderr. When Warning.warn is
- * overridden, super can be called to get the default behavior of
- * printing the warning to $stderr.
- */
-
-VALUE
-rb_warning_warn(VALUE mod, VALUE str)
+void
+rb_compile_error(const char *file, int line, const char *fmt, ...)
{
- return rb_funcallv(mod, id_warn, 1, &str);
+ va_list args;
+ VALUE str;
+
+ va_start(args, fmt);
+ str = compile_snprintf(NULL, NULL, file, line, fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
-static void
-rb_write_warning_str(VALUE str)
+void
+rb_compile_error_append(const char *fmt, ...)
{
- rb_warning_warn(rb_mWarning, str);
+ va_list args;
+ VALUE str;
+
+ va_start(args, fmt);
+ str = rb_vsprintf(fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
-static VALUE
-warn_vsprintf(rb_encoding *enc, const char *file, int line, const char *fmt, va_list args)
+static void
+compile_warn_print(const char *file, int line, const char *fmt, va_list args)
{
- VALUE str = rb_enc_str_new(0, 0, enc);
+ VALUE str;
- err_vcatf(str, "warning: ", file, line, fmt, args);
- return rb_str_cat2(str, "\n");
+ str = compile_snprintf(NULL, "warning: ", file, line, fmt, args);
+ rb_str_cat2(str, "\n");
+ rb_write_error_str(str);
}
void
rb_compile_warn(const char *file, int line, const char *fmt, ...)
{
- VALUE str;
va_list args;
if (NIL_P(ruby_verbose)) return;
va_start(args, fmt);
- str = warn_vsprintf(NULL, file, line, fmt, args);
+ compile_warn_print(file, line, fmt, args);
va_end(args);
- rb_write_warning_str(str);
}
/* rb_compile_warning() reports only in verbose mode */
void
rb_compile_warning(const char *file, int line, const char *fmt, ...)
{
- VALUE str;
va_list args;
if (!RTEST(ruby_verbose)) return;
va_start(args, fmt);
- str = warn_vsprintf(NULL, file, line, fmt, args);
+ compile_warn_print(file, line, fmt, args);
va_end(args);
- rb_write_warning_str(str);
}
-static VALUE
-warning_string(rb_encoding *enc, const char *fmt, va_list args)
+static void
+warn_print(const char *fmt, va_list args)
{
- int line;
- const char *file = rb_source_location_cstr(&line);
- return warn_vsprintf(enc, file, line, fmt, args);
-}
+ VALUE str = rb_str_new(0, 0);
+ VALUE file = rb_sourcefilename();
-#define with_warning_string(mesg, enc, fmt) \
- VALUE mesg; \
- va_list args; va_start(args, fmt); \
- mesg = warning_string(enc, fmt, args); \
- va_end(args);
-
-void
-rb_warn(const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- rb_write_warning_str(mesg);
- }
+ 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, ": ");
}
-}
-void
-rb_enc_warn(rb_encoding *enc, const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- with_warning_string(mesg, enc, fmt) {
- rb_write_warning_str(mesg);
- }
- }
+ rb_str_cat2(str, "warning: ");
+ rb_str_vcatf(str, fmt, args);
+ rb_str_cat2(str, "\n");
+ rb_write_error_str(str);
}
-/* rb_warning() reports only in verbose mode */
void
-rb_warning(const char *fmt, ...)
+rb_warn(const char *fmt, ...)
{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- rb_write_warning_str(mesg);
- }
- }
-}
+ va_list args;
-VALUE
-rb_warning_string(const char *fmt, ...)
-{
- with_warning_string(mesg, 0, fmt) {
- }
- return mesg;
+ if (NIL_P(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ warn_print(fmt, args);
+ va_end(args);
}
-#if 0
+/* rb_warning() reports only in verbose mode */
void
-rb_enc_warning(rb_encoding *enc, const char *fmt, ...)
+rb_warning(const char *fmt, ...)
{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, enc, fmt) {
- rb_write_warning_str(mesg);
- }
- }
-}
-#endif
+ va_list args;
-static inline int
-end_with_asciichar(VALUE str, int c)
-{
- return RB_TYPE_P(str, T_STRING) &&
- rb_str_end_with_asciichar(str, c);
-}
+ if (!RTEST(ruby_verbose)) return;
-static VALUE
-warning_write(int argc, VALUE *argv, VALUE buf)
-{
- while (argc-- > 0) {
- rb_str_append(buf, *argv++);
- }
- return buf;
+ va_start(args, fmt);
+ warn_print(fmt, args);
+ va_end(args);
}
/*
* call-seq:
* warn(msg, ...) -> nil
*
- * If warnings have been disabled (for example with the
- * <code>-W0</code> flag), does nothing. Otherwise,
- * converts each of the messages to strings, appends a newline
- * character to the string if the string does not end in a newline,
- * and calls <code>Warning.warn</code> with the string.
+ * Displays each of the given messages followed by a record separator on
+ * STDERR unless warnings have been disabled (for example with the
+ * <code>-W0</code> flag).
*
* warn("warning 1", "warning 2")
*
@@ -327,59 +263,8 @@ warning_write(int argc, VALUE *argv, VALUE buf)
static VALUE
rb_warn_m(int argc, VALUE *argv, VALUE exc)
{
- VALUE opts, location = Qnil;
-
- if (!NIL_P(ruby_verbose) && argc > 0 &&
- (argc = rb_scan_args(argc, argv, "*:", NULL, &opts)) > 0) {
- VALUE str = argv[0], uplevel = Qnil;
- if (!NIL_P(opts)) {
- static ID kwds[1];
- if (!kwds[0]) {
- CONST_ID(kwds[0], "uplevel");
- }
- rb_get_kwargs(opts, kwds, 0, 1, &uplevel);
- if (uplevel == Qundef) {
- uplevel = Qnil;
- }
- else if (!NIL_P(uplevel)) {
- VALUE args[2];
- long lev = NUM2LONG(uplevel);
- if (lev < 0) {
- rb_raise(rb_eArgError, "negative level (%ld)", lev);
- }
- args[0] = LONG2NUM(lev + 1);
- args[1] = INT2FIX(1);
- location = rb_vm_thread_backtrace_locations(2, args, GET_THREAD()->self);
- if (!NIL_P(location)) {
- location = rb_ary_entry(location, 0);
- }
- }
- }
- if (argc > 1 || !NIL_P(uplevel) || !end_with_asciichar(str, '\n')) {
- VALUE path;
- if (NIL_P(uplevel)) {
- str = rb_str_tmp_new(0);
- }
- else if (NIL_P(location) ||
- NIL_P(path = rb_funcall(location, rb_intern("path"), 0))) {
- str = rb_str_new_cstr("warning: ");
- }
- else {
- str = rb_sprintf("%s:%ld: warning: ",
- rb_string_value_ptr(&path),
- NUM2LONG(rb_funcall(location, rb_intern("lineno"), 0)));
- }
- RBASIC_SET_CLASS(str, rb_cWarningBuffer);
- rb_io_puts(argc, argv, str);
- RBASIC_SET_CLASS(str, rb_cString);
- }
- if (exc == rb_mWarning) {
- rb_must_asciicompat(str);
- rb_write_error_str(str);
- }
- else {
- rb_write_warning_str(str);
- }
+ if (!NIL_P(ruby_verbose) && argc > 0) {
+ rb_io_puts(argc, argv, rb_stderr);
}
return Qnil;
}
@@ -423,82 +308,8 @@ bug_report_file(const char *file, int line)
return NULL;
}
-FUNC_MINIMIZED(static void bug_important_message(FILE *out, const char *const msg, size_t len));
-
static void
-bug_important_message(FILE *out, const char *const msg, size_t len)
-{
- const char *const endmsg = msg + len;
- const char *p = msg;
-
- if (!len) return;
- if (isatty(fileno(out))) {
- static const char red[] = "\033[;31;1;7m";
- static const char green[] = "\033[;32;7m";
- static const char reset[] = "\033[m";
- const char *e = strchr(p, '\n');
- const int w = (int)(e - p);
- do {
- int i = (int)(e - p);
- fputs(*p == ' ' ? green : red, out);
- fwrite(p, 1, e - p, out);
- for (; i < w; ++i) fputc(' ', out);
- fputs(reset, out);
- fputc('\n', out);
- } while ((p = e + 1) < endmsg && (e = strchr(p, '\n')) != 0 && e > p + 1);
- }
- fwrite(p, 1, endmsg - p, out);
-}
-
-static void
-preface_dump(FILE *out)
-{
-#if defined __APPLE__
- static const char msg[] = ""
- "-- Crash Report log information "
- "--------------------------------------------\n"
- " See Crash Report log file under the one of following:\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
- " * ~/Library/Logs/CrashReporter\n"
- " * /Library/Logs/CrashReporter\n"
-# endif
- " * ~/Library/Logs/DiagnosticReports\n"
- " * /Library/Logs/DiagnosticReports\n"
- " for more details.\n"
- "Don't forget to include the above Crash Report log file in bug reports.\n"
- "\n";
- const size_t msglen = sizeof(msg) - 1;
-#else
- const char *msg = NULL;
- const size_t msglen = 0;
-#endif
- bug_important_message(out, msg, msglen);
-}
-
-static void
-postscript_dump(FILE *out)
-{
-#if defined __APPLE__
- static const char msg[] = ""
- "[IMPORTANT]"
- /*" ------------------------------------------------"*/
- "\n""Don't forget to include the Crash Report log file under\n"
-# if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
- "CrashReporter or "
-# endif
- "DiagnosticReports directory in bug reports.\n"
- /*"------------------------------------------------------------\n"*/
- "\n";
- const size_t msglen = sizeof(msg) - 1;
-#else
- const char *msg = NULL;
- const size_t msglen = 0;
-#endif
- bug_important_message(out, msg, msglen);
-}
-
-static void
-bug_report_begin_valist(FILE *out, const char *fmt, va_list args)
+bug_report_begin(FILE *out, const char *fmt, va_list args)
{
char buf[REPORT_BUG_BUFSIZ];
@@ -507,13 +318,12 @@ bug_report_begin_valist(FILE *out, const char *fmt, va_list args)
fputs(buf, out);
snprintf(buf, sizeof(buf), "\n%s\n\n", ruby_description);
fputs(buf, out);
- preface_dump(out);
}
#define bug_report_begin(out, fmt) do { \
va_list args; \
va_start(args, fmt); \
- bug_report_begin_valist(out, fmt, args); \
+ bug_report_begin(out, fmt, args); \
va_end(args); \
} while (0)
@@ -528,8 +338,7 @@ bug_report_end(FILE *out)
(*reporter->func)(out, reporter->data);
}
}
- fputs(REPORTBUG_MSG, out);
- postscript_dump(out);
+ fprintf(out, REPORTBUG_MSG);
}
#define report_bug(file, line, fmt, ctx) do { \
@@ -541,15 +350,6 @@ bug_report_end(FILE *out)
} \
} while (0) \
-#define report_bug_valist(file, line, fmt, ctx, args) do { \
- FILE *out = bug_report_file(file, line); \
- if (out) { \
- bug_report_begin_valist(out, fmt, args); \
- rb_vm_bugreport(ctx); \
- bug_report_end(out); \
- } \
-} while (0) \
-
NORETURN(static void die(void));
static void
die(void)
@@ -567,8 +367,9 @@ rb_bug(const char *fmt, ...)
const char *file = NULL;
int line = 0;
- if (GET_EC()) {
- file = rb_source_location_cstr(&line);
+ if (GET_THREAD()) {
+ file = rb_sourcefile();
+ line = rb_sourceline();
}
report_bug(file, line, fmt, NULL);
@@ -582,8 +383,9 @@ rb_bug_context(const void *ctx, const char *fmt, ...)
const char *file = NULL;
int line = 0;
- if (GET_EC()) {
- file = rb_source_location_cstr(&line);
+ if (GET_THREAD()) {
+ file = rb_sourcefile();
+ line = rb_sourceline();
}
report_bug(file, line, fmt, ctx);
@@ -638,22 +440,11 @@ rb_async_bug_errno(const char *mesg, int errno_arg)
}
void
-rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
+rb_compile_bug(const char *file, int line, const char *fmt, ...)
{
- report_bug_valist(RSTRING_PTR(file), line, fmt, NULL, args);
-}
+ report_bug(file, line, fmt, NULL);
-void
-rb_assert_failure(const char *file, int line, const char *name, const char *expr)
-{
- FILE *out = stderr;
- fprintf(out, "Assertion Failed: %s:%d:", file, line);
- if (name) fprintf(out, "%s:", name);
- fprintf(out, "%s\n%s\n\n", expr, ruby_description);
- preface_dump(out);
- rb_vm_bugreport(NULL);
- bug_report_end(out);
- die();
+ abort();
}
static const char builtin_types[][10] = {
@@ -679,11 +470,12 @@ static const char builtin_types[][10] = {
"false",
"Symbol", /* :symbol */
"Fixnum",
- "undef", /* internal use: #undef; should not happen */
+ "", /* 0x16 */
"", /* 0x17 */
"", /* 0x18 */
"", /* 0x19 */
- "Memo", /* internal use: general memo */
+ "", /* 0x1a */
+ "undef", /* internal use: #undef; should not happen */
"Node", /* internal use: syntax tree node */
"iClass", /* internal use: mixed-in module holder */
};
@@ -698,8 +490,9 @@ rb_builtin_type_name(int t)
return 0;
}
-static const char *
-builtin_class_name(VALUE x)
+#define builtin_class_name rb_builtin_class_name
+const char *
+rb_builtin_class_name(VALUE x)
{
const char *etype;
@@ -707,7 +500,7 @@ builtin_class_name(VALUE x)
etype = "nil";
}
else if (FIXNUM_P(x)) {
- etype = "Integer";
+ etype = "Fixnum";
}
else if (SYMBOL_P(x)) {
etype = "Symbol";
@@ -719,74 +512,32 @@ 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;
}
-NORETURN(static void unexpected_type(VALUE, int, int));
-#define UNDEF_LEAKED "undef leaked to the Ruby space"
-
-static void
-unexpected_type(VALUE x, int xt, int t)
-{
- const char *tname = rb_builtin_type_name(t);
- VALUE mesg, exc = rb_eFatal;
-
- if (tname) {
- const char *cname = builtin_class_name(x);
- if (cname)
- mesg = rb_sprintf("wrong argument type %s (expected %s)",
- cname, tname);
- else
- mesg = rb_sprintf("wrong argument type %"PRIsVALUE" (expected %s)",
- rb_obj_class(x), tname);
- exc = rb_eTypeError;
- }
- else if (xt > T_MASK && xt <= 0x3f) {
- mesg = rb_sprintf("unknown type 0x%x (0x%x given, probably comes"
- " from extension library for ruby 1.8)", t, xt);
- }
- else {
- mesg = rb_sprintf("unknown type 0x%x (0x%x given)", t, xt);
- }
- rb_exc_raise(rb_exc_new_str(exc, mesg));
-}
-
void
rb_check_type(VALUE x, int t)
{
int xt;
if (x == Qundef) {
- rb_bug(UNDEF_LEAKED);
+ rb_bug("undef leaked to the Ruby space");
}
xt = TYPE(x);
if (xt != t || (xt == T_DATA && RTYPEDDATA_P(x))) {
- unexpected_type(x, xt, t);
- }
-}
-
-void
-rb_unexpected_type(VALUE x, int t)
-{
- if (x == Qundef) {
- rb_bug(UNDEF_LEAKED);
+ const char *tname = rb_builtin_type_name(t);
+ if (tname) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
+ builtin_class_name(x), tname);
+ }
+ if (xt > T_MASK && xt <= 0x3f) {
+ rb_fatal("unknown type 0x%x (0x%x given, probably comes from extension library for ruby 1.8)", t, xt);
+ }
+ rb_bug("unknown type 0x%x (0x%x given)", t, xt);
}
-
- unexpected_type(x, TYPE(x), t);
}
int
@@ -813,23 +564,19 @@ 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);
- 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);
+ rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
}
if (!RTYPEDDATA_P(obj)) {
- goto wrong_type;
+ etype = rb_obj_classname(obj);
+ rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
}
else if (!rb_typeddata_inherited_p(RTYPEDDATA_TYPE(obj), data_type)) {
etype = RTYPEDDATA_TYPE(obj)->wrap_struct_name;
- goto wrong_datatype;
+ rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name);
}
return DATA_PTR(obj);
}
@@ -842,7 +589,6 @@ VALUE rb_eSignal;
VALUE rb_eFatal;
VALUE rb_eStandardError;
VALUE rb_eRuntimeError;
-VALUE rb_eFrozenError;
VALUE rb_eTypeError;
VALUE rb_eArgError;
VALUE rb_eIndexError;
@@ -865,22 +611,12 @@ 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_key, id_args, id_Errno, id_errno, id_i_path;
-static ID id_receiver, id_iseq, id_local_variables;
-static ID id_private_call_p, id_top, id_bottom;
-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, id_new, 1, rb_str_new(ptr, len));
+ return rb_funcall(etype, rb_intern("new"), 1, rb_str_new(ptr, len));
}
VALUE
@@ -893,7 +629,7 @@ VALUE
rb_exc_new_str(VALUE etype, VALUE str)
{
StringValue(str);
- return rb_funcall(etype, id_new, 1, str);
+ return rb_funcall(etype, rb_intern("new"), 1, str);
}
/*
@@ -910,8 +646,8 @@ exc_initialize(int argc, VALUE *argv, VALUE exc)
VALUE arg;
rb_scan_args(argc, argv, "01", &arg);
- rb_ivar_set(exc, id_mesg, arg);
- rb_ivar_set(exc, id_bt, Qnil);
+ rb_iv_set(exc, "mesg", arg);
+ rb_iv_set(exc, "bt", Qnil);
return exc;
}
@@ -953,111 +689,26 @@ exc_exception(int argc, VALUE *argv, VALUE self)
static VALUE
exc_to_s(VALUE exc)
{
- VALUE mesg = rb_attr_get(exc, idMesg);
+ VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
return rb_String(mesg);
}
-/* FIXME: Include eval_error.c */
-void rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse);
-
-VALUE
-rb_get_message(VALUE exc)
-{
- VALUE e = rb_check_funcall(exc, id_message, 0, 0);
- if (e == Qundef) return Qnil;
- if (!RB_TYPE_P(e, T_STRING)) e = rb_check_string_type(e);
- return e;
-}
-
-/*
- * call-seq:
- * Exception.to_tty? -> true or false
- *
- * Returns +true+ if exception messages will be sent to a tty.
- */
-static VALUE
-exc_s_to_tty_p(VALUE self)
-{
- return rb_stderr_tty_p() ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * exception.full_message(highlight: bool, order: [:top or :bottom]) -> string
- *
- * Returns formatted string of _exception_.
- * The returned string is formatted using the same format that Ruby uses
- * when printing an uncaught exceptions to stderr.
- *
- * If _highlight_ is +true+ the default error handler will send the
- * messages to a tty.
- *
- * _order_ must be either of +:top+ or +:bottom+, and places the error
- * message and the innermost backtrace come at the top or the bottom.
- *
- * The default values of these options depend on <code>$stderr</code>
- * and its +tty?+ at the timing of a call.
- */
-
-static VALUE
-exc_full_message(int argc, VALUE *argv, VALUE exc)
-{
- VALUE opt, str, emesg, errat;
- enum {kw_highlight, kw_order, kw_max_};
- static ID kw[kw_max_];
- VALUE args[kw_max_] = {Qnil, Qnil};
-
- rb_scan_args(argc, argv, "0:", &opt);
- if (!NIL_P(opt)) {
- if (!kw[0]) {
-#define INIT_KW(n) kw[kw_##n] = rb_intern_const(#n)
- INIT_KW(highlight);
- INIT_KW(order);
-#undef INIT_KW
- }
- rb_get_kwargs(opt, kw, 0, kw_max_, args);
- switch (args[kw_highlight]) {
- default:
- rb_raise(rb_eArgError, "expected true or false as "
- "highlight: %+"PRIsVALUE, args[kw_highlight]);
- case Qundef: args[kw_highlight] = Qnil; break;
- case Qtrue: case Qfalse: case Qnil: break;
- }
- if (args[kw_order] == Qundef) {
- args[kw_order] = Qnil;
- }
- else {
- ID id = rb_check_id(&args[kw_order]);
- if (id == id_bottom) args[kw_order] = Qtrue;
- else if (id == id_top) args[kw_order] = Qfalse;
- else {
- rb_raise(rb_eArgError, "expected :top or :down as "
- "order: %+"PRIsVALUE, args[kw_order]);
- }
- }
- }
- str = rb_str_new2("");
- errat = rb_get_backtrace(exc);
- emesg = rb_get_message(exc);
-
- rb_error_write(exc, emesg, errat, str, args[kw_highlight], args[kw_order]);
- return str;
-}
-
/*
* call-seq:
* exception.message -> string
*
* Returns the result of invoking <code>exception.to_s</code>.
- * Normally this returns the exception's message or name.
+ * Normally this returns the exception's message or name. By
+ * supplying a to_str method, exceptions are agreeing to
+ * be used where Strings are expected.
*/
static VALUE
exc_message(VALUE exc)
{
- return rb_funcallv(exc, idTo_s, 0, 0);
+ return rb_funcall(exc, rb_intern("to_s"), 0, 0);
}
/*
@@ -1120,55 +771,38 @@ exc_inspect(VALUE exc)
static VALUE
exc_backtrace(VALUE exc)
{
+ ID bt;
VALUE obj;
- obj = rb_attr_get(exc, id_bt);
+ CONST_ID(bt, "bt");
+ obj = rb_attr_get(exc, bt);
if (rb_backtrace_p(obj)) {
obj = rb_backtrace_to_str_ary(obj);
- /* rb_ivar_set(exc, id_bt, obj); */
+ /* rb_iv_set(exc, "bt", obj); */
}
return obj;
}
-VALUE
-rb_get_backtrace(VALUE exc)
-{
- ID mid = id_backtrace;
- VALUE info;
- if (rb_method_basic_definition_p(CLASS_OF(exc), id_backtrace)) {
- VALUE klass = rb_eException;
- rb_execution_context_t *ec = GET_EC();
- if (NIL_P(exc))
- return Qnil;
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_CALL, exc, mid, mid, klass, Qundef);
- info = exc_backtrace(exc);
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_RETURN, exc, mid, mid, klass, info);
- }
- else {
- info = rb_funcallv(exc, mid, 0, 0);
- }
- if (NIL_P(info)) return Qnil;
- return rb_check_backtrace(info);
-}
-
/*
* call-seq:
* exception.backtrace_locations -> array
*
* Returns any backtrace associated with the exception. This method is
* similar to Exception#backtrace, but the backtrace is an array of
- * Thread::Backtrace::Location.
+ * Thread::Backtrace::Location.
*
* Now, this method is not affected by Exception#set_backtrace().
*/
static VALUE
exc_backtrace_locations(VALUE exc)
{
+ ID bt_locations;
VALUE obj;
- obj = rb_attr_get(exc, id_bt_locations);
+ CONST_ID(bt_locations, "bt_locations");
+ obj = rb_attr_get(exc, bt_locations);
if (!NIL_P(obj)) {
obj = rb_backtrace_to_location_ary(obj);
}
@@ -1210,7 +844,7 @@ rb_check_backtrace(VALUE bt)
static VALUE
exc_set_backtrace(VALUE exc, VALUE bt)
{
- return rb_ivar_set(exc, id_bt, rb_check_backtrace(bt));
+ return rb_iv_set(exc, "bt", rb_check_backtrace(bt));
}
VALUE
@@ -1228,16 +862,20 @@ rb_exc_set_backtrace(VALUE exc, VALUE bt)
* information.
*/
-static VALUE
+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)
{
- return rb_check_funcall(obj, idException, 0, 0);
+ ID id_exception;
+ CONST_ID(id_exception, "exception");
+ return rb_check_funcall(obj, id_exception, 0, 0);
}
/*
@@ -1253,14 +891,19 @@ 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 state;
+ 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, &state);
- if (state || obj == Qundef) {
+ obj = rb_protect(try_convert_to_exception, obj, &status);
+ if (status || obj == Qundef) {
rb_set_errinfo(Qnil);
return Qfalse;
}
@@ -1332,14 +975,14 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
status = INT2FIX(EXIT_SUCCESS);
}
rb_call_super(argc, argv);
- rb_ivar_set(exc, id_status, status);
+ rb_iv_set(exc, "status", status);
return exc;
}
/*
* call-seq:
- * system_exit.status -> integer
+ * system_exit.status -> fixnum
*
* Return the status value associated with this system exit.
*/
@@ -1347,7 +990,7 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
static VALUE
exit_status(VALUE exc)
{
- return rb_attr_get(exc, id_status);
+ return rb_attr_get(exc, rb_intern("status"));
}
@@ -1361,7 +1004,7 @@ exit_status(VALUE exc)
static VALUE
exit_success_p(VALUE exc)
{
- VALUE status_val = rb_attr_get(exc, id_status);
+ VALUE status_val = rb_attr_get(exc, rb_intern("status"));
int status;
if (NIL_P(status_val))
@@ -1405,7 +1048,7 @@ rb_name_error_str(VALUE str, const char *fmt, ...)
/*
* call-seq:
- * NameError.new([msg, *, name]) -> name_error
+ * NameError.new(msg [, name]) -> name_error
*
* Construct a new NameError exception. If given the <i>name</i>
* parameter may subsequently be examined using the <code>NameError.name</code>
@@ -1416,18 +1059,10 @@ 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_ivar_set(self, id_name, name);
- {
- const rb_execution_context_t *ec = GET_EC();
- rb_control_frame_t *cfp =
- rb_vm_get_ruby_level_next_cfp(ec, RUBY_VM_PREVIOUS_CONTROL_FRAME(ec->cfp));
- if (cfp) iseqw = rb_iseqw_new(cfp->iseq);
- }
- rb_ivar_set(self, id_iseq, iseqw);
+ rb_iv_set(self, "name", name);
return self;
}
@@ -1441,36 +1076,12 @@ name_err_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
name_err_name(VALUE self)
{
- 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;
+ return rb_attr_get(self, rb_intern("name"));
}
/*
* call-seq:
- * NoMethodError.new([msg, *, name [, args]]) -> no_method_error
+ * NoMethodError.new(msg, name [, args]) -> no_method_error
*
* Construct a NoMethodError exception for a method of the given name
* called with the given arguments. The name may be accessed using
@@ -1481,21 +1092,14 @@ name_err_local_variables(VALUE self)
static VALUE
nometh_err_initialize(int argc, VALUE *argv, VALUE self)
{
- VALUE priv = (argc > 3) && (--argc, RTEST(argv[argc])) ? Qtrue : Qfalse;
VALUE args = (argc > 2) ? argv[--argc] : Qnil;
name_err_initialize(argc, argv, self);
- rb_ivar_set(self, id_args, args);
- rb_ivar_set(self, id_private_call_p, RTEST(priv) ? Qtrue : Qfalse);
+ rb_iv_set(self, "args", args);
return self;
}
/* :nodoc: */
-enum {
- NAME_ERR_MESG__MESG,
- NAME_ERR_MESG__RECV,
- NAME_ERR_MESG__NAME,
- NAME_ERR_MESG_COUNT
-};
+#define NAME_ERR_MESG_COUNT 3
static void
name_err_mesg_mark(void *p)
@@ -1509,7 +1113,7 @@ name_err_mesg_mark(void *p)
static size_t
name_err_mesg_memsize(const void *p)
{
- return NAME_ERR_MESG_COUNT * sizeof(VALUE);
+ return p ? (NAME_ERR_MESG_COUNT * sizeof(VALUE)) : 0;
}
static const rb_data_type_t name_err_mesg_data_type = {
@@ -1519,34 +1123,26 @@ static const rb_data_type_t name_err_mesg_data_type = {
name_err_mesg_free,
name_err_mesg_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
/* :nodoc: */
VALUE
-rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
+rb_name_err_mesg_new(VALUE obj, 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);
-
- ptr[NAME_ERR_MESG__MESG] = mesg;
- ptr[NAME_ERR_MESG__RECV] = recv;
- ptr[NAME_ERR_MESG__NAME] = method;
- RTYPEDDATA_DATA(result) = ptr;
+ 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);
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)
@@ -1574,25 +1170,23 @@ name_err_mesg_to_str(VALUE obj)
VALUE *ptr, mesg;
TypedData_Get_Struct(obj, VALUE, &name_err_mesg_data_type, ptr);
- mesg = ptr[NAME_ERR_MESG__MESG];
+ mesg = ptr[0];
if (NIL_P(mesg)) return Qnil;
else {
- struct RString s_str, d_str;
- VALUE c, s, d = 0, args[4];
- int state = 0, singleton = 0;
- rb_encoding *usascii = rb_usascii_encoding();
+ const char *desc = 0;
+ VALUE d = 0, args[NAME_ERR_MESG_COUNT];
+ int state = 0;
-#define FAKE_CSTR(v, str) rb_setup_fake_str((v), (str), rb_strlen_lit(str), usascii)
- obj = ptr[NAME_ERR_MESG__RECV];
+ obj = ptr[1];
switch (obj) {
case Qnil:
- d = FAKE_CSTR(&d_str, "nil");
+ desc = "nil";
break;
case Qtrue:
- d = FAKE_CSTR(&d_str, "true");
+ desc = "true";
break;
case Qfalse:
- d = FAKE_CSTR(&d_str, "false");
+ desc = "false";
break;
default:
d = rb_protect(rb_inspect, obj, &state);
@@ -1601,22 +1195,18 @@ name_err_mesg_to_str(VALUE obj)
if (NIL_P(d) || RSTRING_LEN(d) > 65) {
d = rb_any_to_s(obj);
}
- singleton = (RSTRING_LEN(d) > 0 && RSTRING_PTR(d)[0] == '#');
- d = QUOTE(d);
+ desc = RSTRING_PTR(d);
break;
}
- if (!singleton) {
- s = FAKE_CSTR(&s_str, ":");
- c = rb_class_name(CLASS_OF(obj));
+ 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)));
}
- else {
- c = s = FAKE_CSTR(&s_str, "");
- }
- 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);
+ args[0] = mesg;
+ args[1] = ptr[2];
+ args[2] = d;
+ mesg = rb_f_sprintf(NAME_ERR_MESG_COUNT, args);
}
return mesg;
}
@@ -1637,29 +1227,6 @@ 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
@@ -1669,13 +1236,7 @@ name_err_receiver(VALUE self)
static VALUE
nometh_err_args(VALUE self)
{
- return rb_attr_get(self, id_args);
-}
-
-static VALUE
-nometh_err_private_call_p(VALUE self)
-{
- return rb_attr_get(self, id_private_call_p);
+ return rb_attr_get(self, rb_intern("args"));
}
void
@@ -1687,70 +1248,6 @@ rb_invalid_str(const char *str, const char *type)
}
/*
- * call-seq:
- * key_error.receiver -> object
- *
- * Return the receiver associated with this KeyError exception.
- */
-
-static VALUE
-key_err_receiver(VALUE self)
-{
- VALUE recv;
-
- recv = rb_ivar_lookup(self, id_receiver, Qundef);
- if (recv != Qundef) return recv;
- rb_raise(rb_eArgError, "no receiver is available");
-}
-
-/*
- * call-seq:
- * key_error.key -> object
- *
- * Return the key caused this KeyError exception.
- */
-
-static VALUE
-key_err_key(VALUE self)
-{
- VALUE key;
-
- key = rb_ivar_lookup(self, id_key, Qundef);
- if (key != Qundef) return key;
- rb_raise(rb_eArgError, "no key is available");
-}
-
-VALUE
-rb_key_err_new(VALUE mesg, VALUE recv, VALUE key)
-{
- VALUE exc = rb_obj_alloc(rb_eKeyError);
- rb_ivar_set(exc, id_mesg, mesg);
- rb_ivar_set(exc, id_bt, Qnil);
- rb_ivar_set(exc, id_key, key);
- rb_ivar_set(exc, id_receiver, recv);
- return exc;
-}
-
-/*
- * call-seq:
- * SyntaxError.new([msg]) -> syntax_error
- *
- * Construct a SyntaxError exception.
- */
-
-static VALUE
-syntax_error_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE mesg;
- if (argc == 0) {
- mesg = rb_fstring_cstr("compile error");
- argc = 1;
- argv = &mesg;
- }
- return rb_call_super(argc, argv);
-}
-
-/*
* Document-module: Errno
*
* Ruby exception objects are subclasses of <code>Exception</code>.
@@ -1793,19 +1290,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 defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- break;
- case EWOULDBLOCK:
+#if EAGAIN != EWOULDBLOCK
+ 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));
@@ -1849,7 +1346,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
char *strerror();
#endif
const char *err;
- VALUE mesg, error, func, errmsg;
+ VALUE mesg, error, func;
VALUE klass = rb_obj_class(self);
if (klass == rb_eSystemCallError) {
@@ -1869,29 +1366,37 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
}
else {
rb_scan_args(argc, argv, "02", &mesg, &func);
- error = rb_const_get(klass, id_Errno);
+ error = rb_const_get(klass, rb_intern("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)) rb_str_catf(errmsg, " @ %"PRIsVALUE, func);
- rb_str_catf(errmsg, " - %"PRIsVALUE, str);
- OBJ_INFECT(errmsg, 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());
}
- mesg = errmsg;
-
rb_call_super(1, &mesg);
- rb_ivar_set(self, id_errno, error);
+ rb_iv_set(self, "errno", error);
return self;
}
/*
* call-seq:
- * system_call_error.errno -> integer
+ * system_call_error.errno -> fixnum
*
* Return this SystemCallError's error number.
*/
@@ -1899,7 +1404,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
syserr_errno(VALUE self)
{
- return rb_attr_get(self, id_errno);
+ return rb_attr_get(self, rb_intern("errno"));
}
/*
@@ -1914,17 +1419,20 @@ 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, id_errno)) return Qfalse;
+ if (!rb_respond_to(exc, en)) return Qfalse;
}
else if (self == rb_eSystemCallError) return Qtrue;
- num = rb_attr_get(exc, id_errno);
+ num = rb_attr_get(exc, rb_intern("errno"));
if (NIL_P(num)) {
- num = rb_funcallv(exc, id_errno, 0, 0);
+ num = rb_funcall(exc, en, 0, 0);
}
- e = rb_const_get(self, id_Errno);
+ e = rb_const_get(self, rb_intern("Errno"));
if (FIXNUM_P(num) ? num == e : rb_equal(num, e))
return Qtrue;
return Qfalse;
@@ -2024,7 +1532,7 @@ syserr_eqq(VALUE self, VALUE exc)
*
* <em>raises the exception:</em>
*
- * ArgumentError: wrong number of arguments (given 2, expected 1)
+ * ArgumentError: wrong number of arguments (2 for 1)
*
* Ex: passing an argument that is not acceptable:
*
@@ -2132,7 +1640,7 @@ syserr_eqq(VALUE self, VALUE exc)
*
* Since constant names must start with a capital:
*
- * Integer.const_set :answer, 42
+ * Fixnum.const_set :answer, 42
*
* <em>raises the exception:</em>
*
@@ -2153,22 +1661,17 @@ syserr_eqq(VALUE self, VALUE exc)
*/
/*
- * Document-class: FrozenError
+ * Document-class: RuntimeError
*
- * Raised when there is an attempt to modify a frozen object.
+ * A generic error class raised when an invalid operation is attempted.
*
* [1, 2, 3].freeze << 4
*
* <em>raises the exception:</em>
*
- * FrozenError: can't modify frozen Array
- */
-
-/*
- * Document-class: RuntimeError
+ * RuntimeError: can't modify frozen array
*
- * A generic error class raised when an invalid operation is attempted.
- * Kernel#raise will raise a RuntimeError if no Exception class is
+ * Kernel.raise will raise a RuntimeError if no Exception class is
* specified.
*
* raise "ouch"
@@ -2234,7 +1737,7 @@ syserr_eqq(VALUE self, VALUE exc)
/*
* Document-class: fatal
*
- * fatal is an Exception that is raised when Ruby has encountered a fatal
+ * fatal is an Exception that is raised when ruby has encountered a fatal
* error and must exit. You are not able to rescue fatal.
*/
@@ -2290,19 +1793,14 @@ syserr_eqq(VALUE self, VALUE exc)
* * LoadError
* * NotImplementedError
* * SyntaxError
- * * SecurityError
* * SignalException
* * Interrupt
* * StandardError -- default for +rescue+
* * ArgumentError
- * * UncaughtThrowError
- * * EncodingError
- * * FiberError
- * * IOError
- * * EOFError
* * IndexError
- * * KeyError
* * StopIteration
+ * * IOError
+ * * EOFError
* * LocalJumpError
* * NameError
* * NoMethodError
@@ -2310,14 +1808,14 @@ syserr_eqq(VALUE self, VALUE exc)
* * FloatDomainError
* * RegexpError
* * RuntimeError -- default for +raise+
- * * FrozenError
+ * * SecurityError
* * SystemCallError
* * Errno::*
+ * * SystemStackError
* * ThreadError
* * TypeError
* * ZeroDivisionError
* * SystemExit
- * * SystemStackError
* * fatal -- impossible to rescue
*/
@@ -2326,13 +1824,11 @@ Init_Exception(void)
{
rb_eException = rb_define_class("Exception", rb_cObject);
rb_define_singleton_method(rb_eException, "exception", rb_class_new_instance, -1);
- rb_define_singleton_method(rb_eException, "to_tty?", exc_s_to_tty_p, 0);
rb_define_method(rb_eException, "exception", exc_exception, -1);
rb_define_method(rb_eException, "initialize", exc_initialize, -1);
rb_define_method(rb_eException, "==", exc_equal, 1);
rb_define_method(rb_eException, "to_s", exc_to_s, 0);
rb_define_method(rb_eException, "message", exc_message, 0);
- rb_define_method(rb_eException, "full_message", exc_full_message, -1);
rb_define_method(rb_eException, "inspect", exc_inspect, 0);
rb_define_method(rb_eException, "backtrace", exc_backtrace, 0);
rb_define_method(rb_eException, "backtrace_locations", exc_backtrace_locations, 0);
@@ -2353,13 +1849,10 @@ Init_Exception(void)
rb_eArgError = rb_define_class("ArgumentError", rb_eStandardError);
rb_eIndexError = rb_define_class("IndexError", rb_eStandardError);
rb_eKeyError = rb_define_class("KeyError", rb_eIndexError);
- rb_define_method(rb_eKeyError, "receiver", key_err_receiver, 0);
- rb_define_method(rb_eKeyError, "key", key_err_key, 0);
rb_eRangeError = rb_define_class("RangeError", rb_eStandardError);
rb_eScriptError = rb_define_class("ScriptError", rb_eException);
rb_eSyntaxError = rb_define_class("SyntaxError", rb_eScriptError);
- rb_define_method(rb_eSyntaxError, "initialize", syntax_error_initialize, -1);
rb_eLoadError = rb_define_class("LoadError", rb_eScriptError);
/* the path failed to load */
@@ -2370,9 +1863,8 @@ Init_Exception(void)
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);
@@ -2380,10 +1872,8 @@ Init_Exception(void)
rb_eNoMethodError = rb_define_class("NoMethodError", rb_eNameError);
rb_define_method(rb_eNoMethodError, "initialize", nometh_err_initialize, -1);
rb_define_method(rb_eNoMethodError, "args", nometh_err_args, 0);
- rb_define_method(rb_eNoMethodError, "private_call?", nometh_err_private_call_p, 0);
rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError);
- rb_eFrozenError = rb_define_class("FrozenError", rb_eRuntimeError);
rb_eSecurityError = rb_define_class("SecurityError", rb_eException);
rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException);
rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);
@@ -2397,32 +1887,7 @@ Init_Exception(void)
rb_mErrno = rb_define_module("Errno");
- rb_mWarning = rb_define_module("Warning");
- rb_define_method(rb_mWarning, "warn", rb_warning_s_warn, 1);
- rb_extend_object(rb_mWarning, rb_mWarning);
-
- rb_cWarningBuffer = rb_define_class_under(rb_mWarning, "buffer", rb_cString);
- rb_define_method(rb_cWarningBuffer, "write", warning_write, -1);
-
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_key = rb_intern_const("key");
- id_args = rb_intern_const("args");
- id_receiver = rb_intern_const("receiver");
- id_private_call_p = rb_intern_const("private_call?");
- 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_warn = rb_intern_const("warn");
- id_top = rb_intern_const("top");
- id_bottom = rb_intern_const("bottom");
- id_iseq = rb_make_internal_id();
}
void
@@ -2456,7 +1921,7 @@ static void
raise_loaderror(VALUE path, VALUE mesg)
{
VALUE err = rb_exc_new3(rb_eLoadError, mesg);
- rb_ivar_set(err, id_i_path, path);
+ rb_ivar_set(err, rb_intern("@path"), path);
rb_exc_raise(err);
}
@@ -2488,8 +1953,8 @@ void
rb_notimplement(void)
{
rb_raise(rb_eNotImpError,
- "%"PRIsVALUE"() function is unimplemented on this machine",
- rb_id2str(rb_frame_this_func()));
+ "%s() function is unimplemented on this machine",
+ rb_id2name(rb_frame_this_func()));
}
void
@@ -2629,104 +2094,24 @@ rb_mod_syserr_fail_str(VALUE mod, int e, VALUE mesg)
rb_exc_raise(exc);
}
-static void
-syserr_warning(VALUE mesg, int err)
-{
- rb_str_set_len(mesg, RSTRING_LEN(mesg)-1);
- rb_str_catf(mesg, ": %s\n", strerror(err));
- rb_write_warning_str(mesg);
-}
-
-#if 0
-void
-rb_sys_warn(const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- int errno_save = errno;
- with_warning_string(mesg, 0, fmt) {
- syserr_warning(mesg, errno_save);
- }
- errno = errno_save;
- }
-}
-
-void
-rb_syserr_warn(int err, const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- syserr_warning(mesg, err);
- }
- }
-}
-
-void
-rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- int errno_save = errno;
- with_warning_string(mesg, enc, fmt) {
- syserr_warning(mesg, errno_save);
- }
- errno = errno_save;
- }
-}
-
-void
-rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...)
-{
- if (!NIL_P(ruby_verbose)) {
- with_warning_string(mesg, enc, fmt) {
- syserr_warning(mesg, err);
- }
- }
-}
-#endif
-
void
rb_sys_warning(const char *fmt, ...)
{
- if (RTEST(ruby_verbose)) {
- int errno_save = errno;
- with_warning_string(mesg, 0, fmt) {
- syserr_warning(mesg, errno_save);
- }
- errno = errno_save;
- }
-}
+ char buf[BUFSIZ];
+ va_list args;
+ int errno_save;
-#if 0
-void
-rb_syserr_warning(int err, const char *fmt, ...)
-{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- syserr_warning(mesg, err);
- }
- }
-}
-#endif
+ errno_save = errno;
-void
-rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...)
-{
- if (RTEST(ruby_verbose)) {
- int errno_save = errno;
- with_warning_string(mesg, enc, fmt) {
- syserr_warning(mesg, errno_save);
- }
- errno = errno_save;
- }
-}
+ if (!RTEST(ruby_verbose)) return;
-void
-rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...)
-{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, enc, fmt) {
- syserr_warning(mesg, err);
- }
- }
+ snprintf(buf, BUFSIZ, "warning: %s", fmt);
+ snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
+
+ va_start(args, fmt);
+ warn_print(buf, args);
+ va_end(args);
+ errno = errno_save;
}
void
@@ -2741,26 +2126,7 @@ rb_load_fail(VALUE path, const char *err)
void
rb_error_frozen(const char *what)
{
- rb_raise(rb_eFrozenError, "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_eFrozenError, "can't modify frozen %"PRIsVALUE", created at %"PRIsVALUE":%"PRIsVALUE,
- CLASS_OF(frozen_obj), path, line);
- }
- else {
- rb_raise(rb_eFrozenError, "can't modify frozen %"PRIsVALUE,
- CLASS_OF(frozen_obj));
- }
+ rb_raise(rb_eRuntimeError, "can't modify frozen %s", what);
}
#undef rb_check_frozen
@@ -2805,7 +2171,3 @@ Init_syserr(void)
#undef defined_error
#undef undefined_error
}
-
-/*!
- * \}
- */
diff --git a/eval.c b/eval.c
index 9e6f9295c7..1dabe2e24b 100644
--- a/eval.c
+++ b/eval.c
@@ -11,11 +11,12 @@
**********************************************************************/
-#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"
@@ -24,11 +25,6 @@ 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"
@@ -38,37 +34,38 @@ static ID id_cause;
(!SPECIAL_CONST_P(obj) && \
(BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE))
-/*!
- * Initializes the Ruby VM and builtin libraries.
+/* Initializes the Ruby VM and builtin libraries.
* @retval 0 if succeeded.
* @retval non-zero an error occurred.
*/
int
ruby_setup(void)
{
- enum ruby_tag_type state;
+ static int initialized = 0;
+ int state;
- if (GET_VM())
+ if (initialized)
return 0;
+ initialized = 1;
ruby_init_stack((void *)&state);
Init_BareVM();
Init_heap();
Init_vm_objects();
+ Init_frozen_strings();
- EC_PUSH_TAG(GET_EC());
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
rb_call_inits();
ruby_prog_init();
GET_VM()->running = 1;
}
- EC_POP_TAG();
+ POP_TAG();
return state;
}
-/*!
- * Calls ruby_setup() and check error.
+/* Calls ruby_setup() and check error.
*
* Prints errors and calls exit(3) if an error occurred.
*/
@@ -77,8 +74,7 @@ ruby_init(void)
{
int state = ruby_setup();
if (state) {
- if (RTEST(ruby_debug))
- error_print(GET_EC());
+ error_print();
exit(EXIT_FAILURE);
}
}
@@ -96,12 +92,12 @@ ruby_init(void)
void *
ruby_options(int argc, char **argv)
{
- enum ruby_tag_type state;
+ int state;
void *volatile iseq = 0;
ruby_init_stack((void *)&iseq);
- EC_PUSH_TAG(GET_EC());
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(GET_THREAD(), iseq = ruby_process_options(argc, argv));
}
else {
@@ -109,18 +105,18 @@ ruby_options(int argc, char **argv)
state = error_handle(state);
iseq = (void *)INT2FIX(state);
}
- EC_POP_TAG();
+ POP_TAG();
return iseq;
}
static void
ruby_finalize_0(void)
{
- EC_PUSH_TAG(GET_EC());
- if (EC_EXEC_TAG() == TAG_NONE) {
+ PUSH_TAG();
+ if (EXEC_TAG() == 0) {
rb_trap_exit();
}
- EC_POP_TAG();
+ POP_TAG();
rb_exec_end_proc();
rb_clear_trace_func();
}
@@ -129,7 +125,7 @@ static void
ruby_finalize_1(void)
{
ruby_sig_finalize();
- GET_EC()->errinfo = Qnil;
+ GET_THREAD()->errinfo = Qnil;
rb_gc_call_finalizer_at_exit();
}
@@ -164,60 +160,70 @@ ruby_cleanup(volatile int ex)
volatile VALUE errs[2];
rb_thread_t *th = GET_THREAD();
int nerr;
- volatile int sysex = EXIT_SUCCESS;
- volatile int step = 0;
rb_threadptr_interrupt(th);
rb_threadptr_check_signal(th);
- EC_PUSH_TAG(th->ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th->ec); });
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
+ SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th); });
+ }
+ POP_TAG();
- step_0: step++;
- errs[1] = th->ec->errinfo;
- if (THROW_DATA_P(th->ec->errinfo)) th->ec->errinfo = Qnil;
- th->ec->safe_level = 0;
- ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]);
+ errs[1] = th->errinfo;
+ th->safe_level = 0;
+ ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]);
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, ruby_finalize_0());
+ }
+ POP_TAG();
- step_1: step++;
- /* protect from Thread#raise */
- th->status = THREAD_KILLED;
+ /* protect from Thread#raise */
+ th->status = THREAD_KILLED;
- errs[0] = th->ec->errinfo;
+ errs[0] = th->errinfo;
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all());
}
- else {
- switch (step) {
- case 0: goto step_0;
- case 1: goto step_1;
- }
- if (ex == 0) ex = state;
+ else if (ex == 0) {
+ ex = state;
}
- th->ec->errinfo = errs[1];
- sysex = error_handle(ex);
+ 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
state = 0;
for (nerr = 0; nerr < numberof(errs); ++nerr) {
- VALUE err = ATOMIC_VALUE_EXCHANGE(errs[nerr], Qnil);
+ VALUE err = errs[nerr];
if (!RTEST(err)) continue;
- /* th->ec->errinfo contains a NODE while break'ing */
- if (THROW_DATA_P(err)) continue;
+ /* th->errinfo contains a NODE while break'ing */
+ if (RB_TYPE_P(err, T_NODE)) continue;
if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
- sysex = sysexit_status(err);
+ ex = sysexit_status(err);
break;
}
else if (rb_obj_is_kind_of(err, rb_eSignal)) {
- VALUE sig = rb_ivar_get(err, id_signo);
+ VALUE sig = rb_iv_get(err, "signo");
state = NUM2INT(sig);
break;
}
- else if (sysex == EXIT_SUCCESS) {
- sysex = EXIT_FAILURE;
+ else if (ex == EXIT_SUCCESS) {
+ ex = EXIT_FAILURE;
}
}
@@ -225,30 +231,31 @@ ruby_cleanup(volatile int ex)
/* unlock again if finalizer took mutexes. */
rb_threadptr_unlock_all_locking_mutexes(GET_THREAD());
- EC_POP_TAG();
- rb_thread_stop_timer_thread();
+ POP_TAG();
+ rb_thread_stop_timer_thread(1);
ruby_vm_destruct(GET_VM());
if (state) ruby_default_signal(state);
- return sysex;
+ return ex;
}
static int
ruby_exec_internal(void *n)
{
volatile int state;
- rb_iseq_t *iseq = (rb_iseq_t *)n;
- rb_thread_t * volatile th = GET_THREAD();
+ VALUE iseq = (VALUE)n;
+ rb_thread_t *th = GET_THREAD();
if (!n) return 0;
- EC_PUSH_TAG(th->ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
SAVE_ROOT_JMPBUF(th, {
+ th->base_block = 0;
rb_iseq_eval_main(iseq);
});
}
- EC_POP_TAG();
+ POP_TAG();
return state;
}
@@ -330,15 +337,15 @@ static VALUE
rb_mod_nesting(void)
{
VALUE ary = rb_ary_new();
- const rb_cref_t *cref = rb_vm_cref();
+ const NODE *cref = rb_vm_cref();
- while (cref && CREF_NEXT(cref)) {
- VALUE klass = CREF_CLASS(cref);
- if (!CREF_PUSHED_BY_EVAL(cref) &&
+ while (cref && cref->nd_next) {
+ VALUE klass = cref->nd_clss;
+ if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
!NIL_P(klass)) {
rb_ary_push(ary, klass);
}
- cref = CREF_NEXT(cref);
+ cref = cref->nd_next;
}
return ary;
}
@@ -368,7 +375,7 @@ rb_mod_nesting(void)
static VALUE
rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
{
- const rb_cref_t *cref = rb_vm_cref();
+ const NODE *cref = rb_vm_cref();
VALUE klass;
VALUE cbase = 0;
void *data = 0;
@@ -378,15 +385,15 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
}
while (cref) {
- klass = CREF_CLASS(cref);
- if (!CREF_PUSHED_BY_EVAL(cref) &&
+ klass = cref->nd_clss;
+ if (!(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) &&
!NIL_P(klass)) {
- data = rb_mod_const_at(CREF_CLASS(cref), data);
+ data = rb_mod_const_at(cref->nd_clss, data);
if (!cbase) {
cbase = klass;
}
}
- cref = CREF_NEXT(cref);
+ cref = cref->nd_next;
}
if (cbase) {
@@ -395,12 +402,6 @@ rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
return rb_const_list(data);
}
-/*!
- * Asserts that \a klass is not a frozen class.
- * \param[in] klass a \c Module object
- * \exception RuntimeError if \a klass is not a class or frozen.
- * \ingroup class
- */
void
rb_frozen_class_p(VALUE klass)
{
@@ -443,13 +444,16 @@ rb_frozen_class_p(VALUE klass)
}
}
-NORETURN(static void rb_longjmp(rb_execution_context_t *, int, volatile VALUE, VALUE));
+NORETURN(static void rb_longjmp(int, volatile VALUE, VALUE));
static VALUE get_errinfo(void);
-static VALUE get_ec_errinfo(const rb_execution_context_t *ec);
+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;
@@ -466,191 +470,155 @@ exc_setup_cause(VALUE exc, VALUE cause)
#endif
if (!NIL_P(cause) && cause != exc) {
rb_ivar_set(exc, id_cause, cause);
- if (!rb_ivar_defined(cause, id_cause)) {
- rb_ivar_set(cause, id_cause, Qnil);
- }
}
return exc;
}
-static inline VALUE
-exc_setup_message(const rb_execution_context_t *ec, VALUE mesg, VALUE *cause)
+static inline int
+sysstack_error_p(VALUE exc)
+{
+ return exc == sysstack_error || (!SPECIAL_CONST_P(exc) && RBASIC_CLASS(exc) == rb_eSysStackError);
+}
+
+static void
+setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause)
{
+ VALUE e;
+ const char *file = 0;
+ volatile int line = 0;
int nocause = 0;
if (NIL_P(mesg)) {
- mesg = ec->errinfo;
- if (INTERNAL_EXCEPTION_P(mesg)) EC_JUMP_TAG(ec, TAG_FATAL);
+ 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;
}
- if (*cause == Qundef) {
- if (nocause) {
- *cause = Qnil;
- }
- else if (!rb_ivar_defined(mesg, id_cause)) {
- *cause = get_ec_errinfo(ec);
- }
- }
- return mesg;
-}
-
-static void
-setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
-{
- VALUE e;
- const char *file = 0;
- int line;
-
- file = rb_source_location_cstr(&line);
- if ((file && !NIL_P(mesg)) || (cause != Qundef)) {
- volatile int state = 0;
-
- EC_PUSH_TAG(ec);
- if (EC_EXEC_TAG() == TAG_NONE && !(state = rb_ec_set_raised(ec))) {
- VALUE bt = rb_get_backtrace(mesg);
- if (!NIL_P(bt) || cause == Qundef) {
- if (OBJ_FROZEN(mesg)) {
- mesg = rb_obj_dup(mesg);
+ if (cause == Qundef) {
+ cause = nocause ? Qnil : get_thread_errinfo(th);
+ }
+ exc_setup_cause(mesg, cause);
+
+ file = rb_sourcefile();
+ if (file) line = rb_sourceline();
+ if (file && !NIL_P(mesg)) {
+ VALUE at;
+ if (sysstack_error_p(mesg)) {
+ if (NIL_P(rb_attr_get(mesg, idBt))) {
+ at = rb_vm_backtrace_object();
+ if (mesg == sysstack_error) {
+ VALUE ruby_vm_sysstack_error_copy(void);
+ mesg = ruby_vm_sysstack_error_copy();
}
- }
- if (cause != Qundef && !THROW_DATA_P(cause)) {
- exc_setup_cause(mesg, cause);
- }
- if (NIL_P(bt)) {
- VALUE at = rb_ec_backtrace_object(ec);
+ rb_ivar_set(mesg, idBt, at);
rb_ivar_set(mesg, idBt_locations, at);
- set_backtrace(mesg, at);
}
- rb_ec_reset_raised(ec);
}
- EC_POP_TAG();
- if (state) goto fatal;
+ else if (NIL_P(get_backtrace(mesg))) {
+ 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);
+ }
}
if (!NIL_P(mesg)) {
- ec->errinfo = mesg;
+ th->errinfo = mesg;
}
- if (RTEST(ruby_debug) && !NIL_P(e = ec->errinfo) &&
+ if (RTEST(ruby_debug) && !NIL_P(e = th->errinfo) &&
!rb_obj_is_kind_of(e, rb_eSystemExit)) {
- enum ruby_tag_type state;
+ int status;
mesg = e;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- ec->errinfo = Qnil;
+ PUSH_TAG();
+ if ((status = EXEC_TAG()) == 0) {
+ th->errinfo = Qnil;
e = rb_obj_as_string(mesg);
- ec->errinfo = mesg;
+ th->errinfo = mesg;
if (file && line) {
- e = rb_sprintf("Exception `%"PRIsVALUE"' at %s:%d - %"PRIsVALUE"\n",
- rb_obj_class(mesg), file, line, e);
+ warn_printf("Exception `%"PRIsVALUE"' at %s:%d - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, line, e);
}
else if (file) {
- e = rb_sprintf("Exception `%"PRIsVALUE"' at %s - %"PRIsVALUE"\n",
- rb_obj_class(mesg), file, e);
+ warn_printf("Exception `%"PRIsVALUE"' at %s - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), file, e);
}
else {
- e = rb_sprintf("Exception `%"PRIsVALUE"' - %"PRIsVALUE"\n",
- rb_obj_class(mesg), e);
+ warn_printf("Exception `%"PRIsVALUE"' - %"PRIsVALUE"\n",
+ rb_obj_class(mesg), e);
}
- warn_print_str(e);
}
- EC_POP_TAG();
- if (state == TAG_FATAL && ec->errinfo == exception_error) {
- ec->errinfo = mesg;
+ POP_TAG();
+ if (status == TAG_FATAL && th->errinfo == exception_error) {
+ th->errinfo = mesg;
}
- else if (state) {
- rb_ec_reset_raised(ec);
- EC_JUMP_TAG(ec, state);
+ else if (status) {
+ rb_threadptr_reset_raised(th);
+ JUMP_TAG(status);
}
}
- if (rb_ec_set_raised(ec)) {
- fatal:
- ec->errinfo = exception_error;
- rb_ec_reset_raised(ec);
- EC_JUMP_TAG(ec, TAG_FATAL);
+ if (rb_threadptr_set_raised(th)) {
+ th->errinfo = exception_error;
+ rb_threadptr_reset_raised(th);
+ JUMP_TAG(TAG_FATAL);
}
if (tag != TAG_FATAL) {
- RUBY_DTRACE_HOOK(RAISE, rb_obj_classname(ec->errinfo));
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_RAISE, ec->cfp->self, 0, 0, 0, mesg);
- }
-}
-
-/*! \private */
-void
-rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause)
-{
- if (cause == Qundef) {
- cause = get_ec_errinfo(ec);
- }
- if (cause != mesg) {
- rb_ivar_set(mesg, id_cause, cause);
+ if (RUBY_DTRACE_RAISE_ENABLED()) {
+ RUBY_DTRACE_RAISE(rb_obj_classname(th->errinfo),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_RAISE, th->cfp->self, 0, 0, mesg);
}
}
static void
-rb_longjmp(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
+rb_longjmp(int tag, volatile VALUE mesg, VALUE cause)
{
- mesg = exc_setup_message(ec, mesg, &cause);
- setup_exception(ec, tag, mesg, cause);
- rb_ec_raised_clear(ec);
- EC_JUMP_TAG(ec, tag);
+ rb_thread_t *th = GET_THREAD();
+ setup_exception(th, tag, mesg, cause);
+ rb_thread_raised_clear(th);
+ JUMP_TAG(tag);
}
static VALUE make_exception(int argc, const VALUE *argv, int isstr);
-/*!
- * Raises an exception in the current thread.
- * \param[in] mesg an Exception class or an \c Exception object.
- * \exception always raises an instance of the given exception class or
- * the given \c Exception object.
- * \ingroup exception
- */
void
rb_exc_raise(VALUE mesg)
{
if (!NIL_P(mesg)) {
mesg = make_exception(1, &mesg, FALSE);
}
- rb_longjmp(GET_EC(), TAG_RAISE, mesg, Qundef);
+ rb_longjmp(TAG_RAISE, mesg, Qundef);
}
-/*!
- * Raises a fatal error in the current thread.
- *
- * Same as rb_exc_raise() but raises a fatal error, which Ruby codes
- * cannot rescue.
- * \ingroup exception
- */
void
rb_exc_fatal(VALUE mesg)
{
if (!NIL_P(mesg)) {
mesg = make_exception(1, &mesg, FALSE);
}
- rb_longjmp(GET_EC(), TAG_FATAL, mesg, Qnil);
+ rb_longjmp(TAG_FATAL, mesg, Qnil);
}
-/*!
- * Raises an \c Interrupt exception.
- * \ingroup exception
- */
void
rb_interrupt(void)
{
rb_raise(rb_eInterrupt, "%s", "");
}
-enum {raise_opt_cause, raise_max_opt}; /*< \private */
+enum {raise_opt_cause, raise_max_opt};
static int
-extract_raise_opts(int argc, const VALUE *argv, VALUE *opts)
+extract_raise_opts(int argc, VALUE *argv, VALUE *opts)
{
int i;
if (argc > 0) {
@@ -721,6 +689,7 @@ static VALUE
make_exception(int argc, const VALUE *argv, int isstr)
{
VALUE mesg, exc;
+ ID exception;
int n;
mesg = Qnil;
@@ -746,7 +715,9 @@ make_exception(int argc, const VALUE *argv, int isstr)
exc = argv[0];
n = 1;
exception_call:
- mesg = rb_check_funcall(exc, idException, n, argv+1);
+ if (sysstack_error_p(exc)) return exc;
+ CONST_ID(exception, "exception");
+ mesg = rb_check_funcall(exc, exception, n, argv+1);
if (mesg == Qundef) {
rb_raise(rb_eTypeError, "exception class/object expected");
}
@@ -765,91 +736,57 @@ make_exception(int argc, const VALUE *argv, int isstr)
return mesg;
}
-/*!
- * Make an \c Exception object from the list of arguments in a manner
- * similar to \c Kernel\#raise.
- *
- * \param[in] argc the number of arguments
- * \param[in] argv a pointer to the array of arguments.
- *
- * The first form of this function takes a \c String argument. Then
- * it returns a \c RuntimeError whose error message is the given value.
- *
- * The second from of this function takes an \c Exception object. Then
- * it just returns the given value.
- *
- * The last form takes an exception class, an optional error message and
- * an optional array of backtrace. Then it passes the optional arguments
- * to \c #exception method of the exception class.
- *
- * \return the exception object, or \c Qnil if \c argc is 0.
- * \ingroup exception
- */
VALUE
rb_make_exception(int argc, const VALUE *argv)
{
return make_exception(argc, argv, TRUE);
}
-/*! \private
- * \todo can be static?
- */
void
rb_raise_jump(VALUE mesg, VALUE cause)
{
- rb_execution_context_t *ec = GET_EC();
- const rb_control_frame_t *cfp = ec->cfp;
- const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
- VALUE klass = me->owner;
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ VALUE klass = cfp->me->klass;
VALUE self = cfp->self;
- ID mid = me->called_id;
+ ID mid = cfp->me->called_id;
+
+ th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
- rb_vm_pop_frame(ec);
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_RETURN, self, me->def->original_id, mid, klass, Qnil);
+ setup_exception(th, TAG_RAISE, mesg, cause);
- rb_longjmp(ec, TAG_RAISE, mesg, cause);
+ rb_thread_raised_clear(th);
+ JUMP_TAG(TAG_RAISE);
}
-/*!
- * Continues the exception caught by rb_protect() and rb_eval_string_protect().
- *
- * This function never return to the caller.
- * \param[in] the value of \c *state which the protect function has set to the
- * their last parameter.
- * \ingroup exception
- */
void
rb_jump_tag(int tag)
{
- if (UNLIKELY(tag < TAG_RETURN || tag > TAG_FATAL)) {
- unknown_longjmp_status(tag);
- }
- EC_JUMP_TAG(GET_EC(), tag);
+ JUMP_TAG(tag);
}
-/*! Determines if the current method is given a block.
- * \retval zero if not given
- * \retval non-zero if given
- * \ingroup defmethod
- */
int
rb_block_given_p(void)
{
- if (rb_vm_frame_block_handler(GET_EC()->cfp) == VM_BLOCK_HANDLER_NONE) {
- return FALSE;
+ rb_thread_t *th = GET_THREAD();
+
+ if (rb_vm_control_frame_block_ptr(th->cfp)) {
+ return TRUE;
}
else {
- return TRUE;
+ return FALSE;
}
}
+int
+rb_iterator_p(void)
+{
+ return rb_block_given_p();
+}
+
VALUE rb_eThreadError;
-/*! Declares that the current method needs a block.
- *
- * Raises a \c LocalJumpError if not given a block.
- * \ingroup defmethod
- */
void
rb_need_block(void)
{
@@ -858,41 +795,19 @@ rb_need_block(void)
}
}
-/*! An equivalent of \c rescue clause.
- *
- * Equivalent to <code>begin .. rescue err_type .. end</code>
- *
- * \param[in] b_proc a function which potentially raises an exception.
- * \param[in] data1 the argument of \a b_proc
- * \param[in] r_proc a function which rescues an exception in \a b_proc.
- * \param[in] data2 the first argument of \a r_proc
- * \param[in] ... 1 or more exception classes. Must be terminated by \c (VALUE)0.
- *
- * First it calls the function \a b_proc, with \a data1 as the argument.
- * When \a b_proc raises an exception, it calls \a r_proc with \a data2 and
- * the exception object if the exception is a kind of one of the given
- * exception classes.
- *
- * \return the return value of \a b_proc if no exception occurs,
- * or the return value of \a r_proc if otherwise.
- * \sa rb_rescue
- * \sa rb_ensure
- * \sa rb_protect
- * \ingroup exception
- */
VALUE
rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
VALUE (* r_proc) (ANYARGS), VALUE data2, ...)
{
- enum ruby_tag_type state;
- rb_execution_context_t * volatile ec = GET_EC();
- rb_control_frame_t *volatile cfp = ec->cfp;
+ int state;
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
volatile VALUE result = Qfalse;
- volatile VALUE e_info = ec->errinfo;
+ volatile VALUE e_info = th->errinfo;
va_list args;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ TH_PUSH_TAG(th);
+ if ((state = TH_EXEC_TAG()) == 0) {
retry_entry:
result = (*b_proc) (data1);
}
@@ -900,13 +815,13 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
/* escape from r_proc */
if (state == TAG_RETRY) {
state = 0;
- ec->errinfo = Qnil;
+ th->errinfo = Qnil;
result = Qfalse;
goto retry_entry;
}
}
else {
- rb_vm_rewind_cfp(ec, cfp);
+ rb_vm_rewind_cfp(th, cfp);
if (state == TAG_RAISE) {
int handle = FALSE;
@@ -914,7 +829,7 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
va_init_list(args, data2);
while ((eclass = va_arg(args, VALUE)) != 0) {
- if (rb_obj_is_kind_of(ec->errinfo, eclass)) {
+ if (rb_obj_is_kind_of(th->errinfo, eclass)) {
handle = TRUE;
break;
}
@@ -925,33 +840,19 @@ rb_rescue2(VALUE (* b_proc) (ANYARGS), VALUE data1,
result = Qnil;
state = 0;
if (r_proc) {
- result = (*r_proc) (data2, ec->errinfo);
+ result = (*r_proc) (data2, th->errinfo);
}
- ec->errinfo = e_info;
+ th->errinfo = e_info;
}
}
}
- EC_POP_TAG();
+ TH_POP_TAG();
if (state)
- EC_JUMP_TAG(ec, state);
+ JUMP_TAG(state);
return result;
}
-/*! An equivalent of \c rescue clause.
- *
- * Equivalent to <code>begin .. rescue .. end</code>.
- *
- * It is same as
- * \code{cpp}
- * rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, (VALUE)0);
- * \endcode
- *
- * \sa rb_rescue2
- * \sa rb_ensure
- * \sa rb_protect
- * \ingroup exception
- */
VALUE
rb_rescue(VALUE (* b_proc)(ANYARGS), VALUE data1,
VALUE (* r_proc)(ANYARGS), VALUE data2)
@@ -960,163 +861,160 @@ rb_rescue(VALUE (* b_proc)(ANYARGS), VALUE data1,
(VALUE)0);
}
-/*! Protects a function call from potential global escapes from the function.
- *
- * Such global escapes include exceptions, \c Kernel\#throw, \c break in
- * an iterator, for example.
- * It first 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.
- * \ingroup exception
- * \sa rb_rescue
- * \sa rb_rescue2
- * \sa rb_ensure
- */
VALUE
-rb_protect(VALUE (* proc) (VALUE), VALUE data, int *pstate)
+rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
{
volatile VALUE result = Qnil;
- volatile enum ruby_tag_type state;
- rb_execution_context_t * volatile ec = GET_EC();
- rb_control_frame_t *volatile cfp = ec->cfp;
+ volatile int status;
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
struct rb_vm_protect_tag protect_tag;
rb_jmpbuf_t org_jmpbuf;
- protect_tag.prev = ec->protect_tag;
+ protect_tag.prev = th->protect_tag;
- EC_PUSH_TAG(ec);
- ec->protect_tag = &protect_tag;
- MEMCPY(&org_jmpbuf, &rb_ec_thread_ptr(ec)->root_jmpbuf, rb_jmpbuf_t, 1);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- SAVE_ROOT_JMPBUF(rb_ec_thread_ptr(ec), result = (*proc) (data));
+ TH_PUSH_TAG(th);
+ th->protect_tag = &protect_tag;
+ MEMCPY(&org_jmpbuf, &(th)->root_jmpbuf, rb_jmpbuf_t, 1);
+ if ((status = TH_EXEC_TAG()) == 0) {
+ SAVE_ROOT_JMPBUF(th, result = (*proc) (data));
}
else {
- rb_vm_rewind_cfp(ec, cfp);
+ rb_vm_rewind_cfp(th, cfp);
+ }
+ MEMCPY(&(th)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
+ th->protect_tag = protect_tag.prev;
+ TH_POP_TAG();
+
+ if (state) {
+ *state = status;
}
- MEMCPY(&rb_ec_thread_ptr(ec)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
- ec->protect_tag = protect_tag.prev;
- EC_POP_TAG();
- if (pstate != NULL) *pstate = state;
return result;
}
-/*!
- * An equivalent to \c ensure clause.
- *
- * Equivalent to <code>begin .. ensure .. end</code>.
- *
- * Calls the function \a b_proc with \a data1 as the argument,
- * then calls \a e_proc with \a data2 when execution terminated.
- * \return The return value of \a b_proc if no exception occurred,
- * or \c Qnil if otherwise.
- * \sa rb_rescue
- * \sa rb_rescue2
- * \sa rb_protect
- * \ingroup exception
- */
VALUE
rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE data2)
{
int state;
volatile VALUE result = Qnil;
- VALUE errinfo;
- rb_execution_context_t * volatile ec = GET_EC();
+ volatile VALUE errinfo;
+ rb_thread_t *const th = GET_THREAD();
rb_ensure_list_t ensure_list;
ensure_list.entry.marker = 0;
ensure_list.entry.e_proc = e_proc;
ensure_list.entry.data2 = data2;
- ensure_list.next = ec->ensure_list;
- ec->ensure_list = &ensure_list;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ ensure_list.next = th->ensure_list;
+ th->ensure_list = &ensure_list;
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
result = (*b_proc) (data1);
}
- EC_POP_TAG();
- errinfo = ec->errinfo;
- if (!NIL_P(errinfo) && !RB_TYPE_P(errinfo, T_OBJECT)) {
- ec->errinfo = Qnil;
- }
- ec->ensure_list=ensure_list.next;
+ POP_TAG();
+ /* TODO: fix me */
+ /* retval = prot_tag ? prot_tag->retval : Qnil; */ /* save retval */
+ errinfo = th->errinfo;
+ th->ensure_list=ensure_list.next;
(*ensure_list.entry.e_proc)(ensure_list.entry.data2);
- ec->errinfo = errinfo;
+ th->errinfo = errinfo;
if (state)
- EC_JUMP_TAG(ec, state);
+ JUMP_TAG(state);
return result;
}
-static ID
-frame_func_id(const rb_control_frame_t *cfp)
+static const rb_method_entry_t *
+method_entry_of_iseq(rb_control_frame_t *cfp, rb_iseq_t *iseq)
{
- const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp_limit;
- if (me) {
- return me->def->original_id;
+ 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);
}
- else {
- return 0;
+ 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;
+ }
+ 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;
}
+ return 0;
}
static ID
frame_called_id(rb_control_frame_t *cfp)
{
- const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
-
- if (me) {
- return me->called_id;
+ const rb_method_entry_t *me_local;
+ rb_iseq_t *iseq = cfp->iseq;
+ if (cfp->me) {
+ return cfp->me->called_id;
}
- else {
- return 0;
+ 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;
}
+ return 0;
}
-/*!
- * The original name of the current method.
- *
- * The function returns the original name of the method even if
- * an alias of the method is called.
- * The function can also return 0 if it is not in a method. This
- * case can happen in a toplevel of a source file, for example.
- *
- * \returns the ID of the name or 0
- * \sa rb_frame_callee
- * \ingroup defmethod
- */
ID
rb_frame_this_func(void)
{
- return frame_func_id(GET_EC()->cfp);
+ return frame_func_id(GET_THREAD()->cfp);
}
-/*!
- * The name of the current method.
- *
- * The function returns the alias if an alias of the method is called.
- * The function can also return 0 if it is not in a method. This
- * case can happen in a toplevel of a source file, for example.
- *
- * \returns the ID of the name or 0.
- * \sa rb_frame_this_func
- * \ingroup defmethod
- */
ID
rb_frame_callee(void)
{
- return frame_called_id(GET_EC()->cfp);
+ return frame_called_id(GET_THREAD()->cfp);
}
static rb_control_frame_t *
-previous_frame(const rb_execution_context_t *ec)
+previous_frame(rb_thread_t *th)
{
- rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(ec->cfp);
+ rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
/* check if prev_cfp can be accessible */
- if ((void *)(ec->vm_stack + ec->vm_stack_size) == (void *)(prev_cfp)) {
+ if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
return 0;
}
return prev_cfp;
@@ -1125,7 +1023,7 @@ previous_frame(const rb_execution_context_t *ec)
static ID
prev_frame_callee(void)
{
- rb_control_frame_t *prev_cfp = previous_frame(GET_EC());
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
if (!prev_cfp) return 0;
return frame_called_id(prev_cfp);
}
@@ -1133,30 +1031,11 @@ prev_frame_callee(void)
static ID
prev_frame_func(void)
{
- rb_control_frame_t *prev_cfp = previous_frame(GET_EC());
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
if (!prev_cfp) return 0;
return frame_func_id(prev_cfp);
}
-/*!
- * \private
- * Returns the ID of the last method in the call stack.
- * \sa rb_frame_this_func
- * \ingroup defmethod
- */
-ID
-rb_frame_last_func(void)
-{
- const rb_execution_context_t *ec = GET_EC();
- const rb_control_frame_t *cfp = ec->cfp;
- ID mid;
-
- while (!(mid = frame_func_id(cfp)) &&
- (cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
- !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(ec, cfp)));
- return mid;
-}
-
/*
* call-seq:
* append_features(mod) -> mod
@@ -1196,7 +1075,6 @@ rb_mod_include(int argc, VALUE *argv, VALUE module)
CONST_ID(id_append_features, "append_features");
CONST_ID(id_included, "included");
- rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
for (i = 0; i < argc; i++)
Check_Type(argv[i], T_MODULE);
while (argc--) {
@@ -1244,8 +1122,6 @@ rb_mod_prepend(int argc, VALUE *argv, VALUE module)
CONST_ID(id_prepend_features, "prepend_features");
CONST_ID(id_prepended, "prepended");
-
- rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
for (i = 0; i < argc; i++)
Check_Type(argv[i], T_MODULE);
while (argc--) {
@@ -1255,57 +1131,32 @@ rb_mod_prepend(int argc, VALUE *argv, VALUE module)
return module;
}
-static void
-ensure_class_or_module(VALUE obj)
-{
- if (!RB_TYPE_P(obj, T_CLASS) && !RB_TYPE_P(obj, T_MODULE)) {
- rb_raise(rb_eTypeError,
- "wrong argument type %"PRIsVALUE" (expected Class or Module)",
- rb_obj_class(obj));
- }
-}
-
static VALUE
-hidden_identity_hash_new(void)
+hidden_identity_hash_new()
{
- VALUE hash = rb_ident_hash_new();
+ VALUE hash = rb_hash_new();
+ rb_funcall(hash, rb_intern("compare_by_identity"), 0);
RBASIC_CLEAR_CLASS(hash); /* hide from ObjectSpace */
return hash;
}
-static VALUE
-refinement_superclass(VALUE superclass)
-{
- if (RB_TYPE_P(superclass, T_MODULE)) {
- /* FIXME: Should ancestors of superclass be used here? */
- return rb_include_class_new(superclass, rb_cBasicObject);
- }
- else {
- return superclass;
- }
-}
-
-/*!
- * \private
- * \todo can be static?
- */
void
-rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
+rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
{
VALUE iclass, c, superclass = klass;
- ensure_class_or_module(klass);
+ Check_Type(klass, T_CLASS);
Check_Type(module, T_MODULE);
- if (NIL_P(CREF_REFINEMENTS(cref))) {
- CREF_REFINEMENTS_SET(cref, hidden_identity_hash_new());
+ if (NIL_P(cref->nd_refinements)) {
+ RB_OBJ_WRITE(cref, &cref->nd_refinements, hidden_identity_hash_new());
}
else {
- if (CREF_OMOD_SHARED(cref)) {
- CREF_REFINEMENTS_SET(cref, rb_hash_dup(CREF_REFINEMENTS(cref)));
- CREF_OMOD_SHARED_UNSET(cref);
+ if (cref->flags & NODE_FL_CREF_OMOD_SHARED) {
+ RB_OBJ_WRITE(cref, &cref->nd_refinements, rb_hash_dup(cref->nd_refinements));
+ cref->flags &= ~NODE_FL_CREF_OMOD_SHARED;
}
- if (!NIL_P(c = rb_hash_lookup(CREF_REFINEMENTS(cref), klass))) {
+ if (!NIL_P(c = rb_hash_lookup(cref->nd_refinements, klass))) {
superclass = c;
while (c && RB_TYPE_P(c, T_ICLASS)) {
if (RBASIC(c)->klass == module) {
@@ -1317,12 +1168,11 @@ rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
}
}
FL_SET(module, RMODULE_IS_OVERLAID);
- superclass = refinement_superclass(superclass);
c = iclass = rb_include_class_new(module, superclass);
RCLASS_REFINED_CLASS(c) = klass;
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(c)) =
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: check unprotecting */
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(c)) =
+ RCLASS_M_TBL_WRAPPER(OBJ_WB_UNPROTECT(module));
module = RCLASS_SUPER(module);
while (module && module != klass) {
@@ -1331,20 +1181,20 @@ rb_using_refinement(rb_cref_t *cref, VALUE klass, VALUE module)
RCLASS_REFINED_CLASS(c) = klass;
module = RCLASS_SUPER(module);
}
- rb_hash_aset(CREF_REFINEMENTS(cref), klass, iclass);
+ rb_hash_aset(cref->nd_refinements, klass, iclass);
}
static int
using_refinement(VALUE klass, VALUE module, VALUE arg)
{
- rb_cref_t *cref = (rb_cref_t *) arg;
+ NODE *cref = (NODE *) arg;
rb_using_refinement(cref, klass, module);
return ST_CONTINUE;
}
static void
-using_module_recursive(const rb_cref_t *cref, VALUE klass)
+using_module_recursive(NODE *cref, VALUE klass)
{
ID id_refinements;
VALUE super, module, refinements;
@@ -1373,19 +1223,14 @@ using_module_recursive(const rb_cref_t *cref, VALUE klass)
rb_hash_foreach(refinements, using_refinement, (VALUE) cref);
}
-/*!
- * \private
- * \todo can be static?
- */
void
-rb_using_module(const rb_cref_t *cref, VALUE module)
+rb_using_module(NODE *cref, VALUE module)
{
Check_Type(module, T_MODULE);
using_module_recursive(cref, module);
rb_clear_method_cache_by_class(rb_cObject);
}
-/*! \private */
VALUE
rb_refinement_module_get_refined_class(VALUE module)
{
@@ -1412,11 +1257,10 @@ add_activated_refinement(VALUE activated_refinements,
}
}
FL_SET(refinement, RMODULE_IS_OVERLAID);
- superclass = refinement_superclass(superclass);
c = iclass = rb_include_class_new(refinement, superclass);
RCLASS_REFINED_CLASS(c) = klass;
refinement = RCLASS_SUPER(refinement);
- while (refinement && refinement != klass) {
+ while (refinement) {
FL_SET(refinement, RMODULE_IS_OVERLAID);
c = RCLASS_SET_SUPER(c, rb_include_class_new(refinement, RCLASS_SUPER(c)));
RCLASS_REFINED_CLASS(c) = klass;
@@ -1425,13 +1269,15 @@ 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(mod) { block } -> module
+ * refine(klass) { block } -> module
*
- * Refine <i>mod</i> in the receiver.
+ * Refine <i>klass</i> in the receiver.
*
- * Returns a module, where refined methods are defined.
+ * Returns an overlaid module.
*/
static VALUE
@@ -1442,16 +1288,16 @@ rb_mod_refine(VALUE module, VALUE klass)
id_refined_class, id_defined_at;
VALUE refinements, activated_refinements;
rb_thread_t *th = GET_THREAD();
- VALUE block_handler = rb_vm_frame_block_handler(th->ec->cfp);
+ rb_block_t *block = rb_vm_control_frame_block_ptr(th->cfp);
- if (block_handler == VM_BLOCK_HANDLER_NONE) {
- rb_raise(rb_eArgError, "no block given");
+ if (!block) {
+ rb_raise(rb_eArgError, "no block given");
}
- if (vm_block_handler_type(block_handler) != block_handler_type_iseq) {
- rb_raise(rb_eArgError, "can't pass a Proc as a block to Module#refine");
+ if (block->proc) {
+ rb_raise(rb_eArgError,
+ "can't pass a Proc as a block to Module#refine");
}
-
- ensure_class_or_module(klass);
+ Check_Type(klass, T_CLASS);
CONST_ID(id_refinements, "__refinements__");
refinements = rb_attr_get(module, id_refinements);
if (NIL_P(refinements)) {
@@ -1467,9 +1313,8 @@ rb_mod_refine(VALUE module, VALUE klass)
}
refinement = rb_hash_lookup(refinements, klass);
if (NIL_P(refinement)) {
- VALUE superclass = refinement_superclass(klass);
refinement = rb_module_new();
- RCLASS_SET_SUPER(refinement, superclass);
+ RCLASS_SET_SUPER(refinement, klass);
FL_SET(refinement, RMODULE_IS_REFINEMENT);
CONST_ID(id_refined_class, "__refined_class__");
rb_ivar_set(refinement, id_refined_class, klass);
@@ -1482,17 +1327,6 @@ rb_mod_refine(VALUE module, VALUE klass)
return refinement;
}
-static void
-ignored_block(VALUE module, const char *klass)
-{
- const char *anon = "";
- Check_Type(module, T_MODULE);
- if (!RTEST(rb_search_class_path(module))) {
- anon = ", maybe for Module.new";
- }
- rb_warn("%s""using doesn't call the given block""%s.", klass, anon);
-}
-
/*
* call-seq:
* using(module) -> self
@@ -1504,7 +1338,8 @@ ignored_block(VALUE module, const char *klass)
static VALUE
mod_using(VALUE self, VALUE module)
{
- rb_control_frame_t *prev_cfp = previous_frame(GET_EC());
+ NODE *cref = rb_vm_cref();
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
if (prev_frame_func()) {
rb_raise(rb_eRuntimeError,
@@ -1513,89 +1348,17 @@ mod_using(VALUE self, VALUE module)
if (prev_cfp && prev_cfp->self != self) {
rb_raise(rb_eRuntimeError, "Module#using is not called on self");
}
- if (rb_block_given_p()) {
- ignored_block(module, "Module#");
- }
- rb_using_module(rb_vm_cref_replace_with_duplicated_cref(), module);
+ rb_using_module(cref, module);
return self;
}
-static int
-used_modules_i(VALUE _, VALUE mod, VALUE ary)
-{
- ID id_defined_at;
- CONST_ID(id_defined_at, "__defined_at__");
- while (FL_TEST(rb_class_of(mod), RMODULE_IS_REFINEMENT)) {
- rb_ary_push(ary, rb_attr_get(rb_class_of(mod), id_defined_at));
- mod = RCLASS_SUPER(mod);
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * used_modules -> array
- *
- * Returns an array of all modules used in the current scope. The ordering
- * of modules in the resulting array is not defined.
- *
- * module A
- * refine Object do
- * end
- * end
- *
- * module B
- * refine Object do
- * end
- * end
- *
- * using A
- * using B
- * p Module.used_modules
- *
- * <em>produces:</em>
- *
- * [B, A]
- */
-static VALUE
-rb_mod_s_used_modules(void)
-{
- const rb_cref_t *cref = rb_vm_cref();
- VALUE ary = rb_ary_new();
-
- while(cref) {
- if(!NIL_P(CREF_REFINEMENTS(cref))) {
- rb_hash_foreach(CREF_REFINEMENTS(cref), used_modules_i, ary);
- }
- cref = CREF_NEXT(cref);
- }
-
- return rb_funcall(ary, rb_intern("uniq"), 0);
-}
-
-/*!
- * Calls \c #initialize method of \a obj with the given arguments.
- *
- * It also forwards the given block to \c #initialize if given.
- *
- * \param[in] obj the receiver object
- * \param[in] argc the number of arguments
- * \param[in] argv a pointer to the array of arguments
- * \ingroup object
- */
void
rb_obj_call_init(VALUE obj, int argc, const VALUE *argv)
{
- PASS_PASSED_BLOCK_HANDLER();
- rb_funcallv(obj, idInitialize, argc, argv);
+ PASS_PASSED_BLOCK();
+ rb_funcall2(obj, idInitialize, argc, argv);
}
-/*!
- * Extend the object with the module.
- *
- * Same as \c Module\#extend_object.
- * \ingroup class
- */
void
rb_extend_object(VALUE obj, VALUE module)
{
@@ -1712,34 +1475,32 @@ top_include(int argc, VALUE *argv, VALUE self)
static VALUE
top_using(VALUE self, VALUE module)
{
- const rb_cref_t *cref = rb_vm_cref();
- rb_control_frame_t *prev_cfp = previous_frame(GET_EC());
+ NODE *cref = rb_vm_cref();
+ rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
- if (CREF_NEXT(cref) || (prev_cfp && rb_vm_frame_method_entry(prev_cfp))) {
- rb_raise(rb_eRuntimeError, "main.using is permitted only at toplevel");
- }
- if (rb_block_given_p()) {
- ignored_block(module, "main.");
+ if (cref->nd_next || (prev_cfp && prev_cfp->me)) {
+ rb_raise(rb_eRuntimeError,
+ "main.using is permitted only at toplevel");
}
- rb_using_module(rb_vm_cref_replace_with_duplicated_cref(), module);
+ rb_using_module(cref, module);
return self;
}
-static const VALUE *
-errinfo_place(const rb_execution_context_t *ec)
+static VALUE *
+errinfo_place(rb_thread_t *th)
{
- const rb_control_frame_t *cfp = ec->cfp;
- const rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(ec);
+ rb_control_frame_t *cfp = th->cfp;
+ rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
- if (VM_FRAME_RUBYFRAME_P(cfp)) {
- if (cfp->iseq->body->type == ISEQ_TYPE_RESCUE) {
- return &cfp->ep[VM_ENV_INDEX_LAST_LVAR];
+ if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
+ if (cfp->iseq->type == ISEQ_TYPE_RESCUE) {
+ return &cfp->ep[-2];
}
- else if (cfp->iseq->body->type == ISEQ_TYPE_ENSURE &&
- !THROW_DATA_P(cfp->ep[VM_ENV_INDEX_LAST_LVAR]) &&
- !FIXNUM_P(cfp->ep[VM_ENV_INDEX_LAST_LVAR])) {
- return &cfp->ep[VM_ENV_INDEX_LAST_LVAR];
+ else if (cfp->iseq->type == ISEQ_TYPE_ENSURE &&
+ !RB_TYPE_P(cfp->ep[-2], T_NODE) &&
+ !FIXNUM_P(cfp->ep[-2])) {
+ return &cfp->ep[-2];
}
}
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
@@ -1748,21 +1509,21 @@ errinfo_place(const rb_execution_context_t *ec)
}
static VALUE
-get_ec_errinfo(const rb_execution_context_t *ec)
+get_thread_errinfo(rb_thread_t *th)
{
- const VALUE *ptr = errinfo_place(ec);
+ VALUE *ptr = errinfo_place(th);
if (ptr) {
return *ptr;
}
else {
- return ec->errinfo;
+ return th->errinfo;
}
}
static VALUE
get_errinfo(void)
{
- return get_ec_errinfo(GET_EC());
+ return get_thread_errinfo(GET_THREAD());
}
static VALUE
@@ -1771,33 +1532,45 @@ errinfo_getter(ID id)
return get_errinfo();
}
-/*! The current exception in the current thread.
- *
- * Same as \c $! in Ruby.
- * \return the current exception or \c Qnil
- * \ingroup exception
- */
+#if 0
+static void
+errinfo_setter(VALUE val, ID id, VALUE *var)
+{
+ if (!NIL_P(val) && !rb_obj_is_kind_of(val, rb_eException)) {
+ rb_raise(rb_eTypeError, "assigning non-exception to $!");
+ }
+ else {
+ VALUE *ptr = errinfo_place(GET_THREAD());
+ if (ptr) {
+ *ptr = val;
+ }
+ else {
+ rb_raise(rb_eRuntimeError, "errinfo_setter: not in rescue clause.");
+ }
+ }
+}
+#endif
+
VALUE
rb_errinfo(void)
{
- return GET_EC()->errinfo;
+ rb_thread_t *th = GET_THREAD();
+ return th->errinfo;
}
-/*! Sets the current exception (\c $!) to the given value
- *
- * \param[in] err an \c Exception object or \c Qnil.
- * \exception TypeError if \a err is neither an exception nor \c nil.
- * \note this function does not raise the exception.
- * Use \c rb_raise() when you want to raise.
- * \ingroup exception
- */
void
rb_set_errinfo(VALUE err)
{
if (!NIL_P(err) && !rb_obj_is_kind_of(err, rb_eException)) {
rb_raise(rb_eTypeError, "assigning non-exception to $!");
}
- GET_EC()->errinfo = err;
+ GET_THREAD()->errinfo = err;
+}
+
+VALUE
+rb_rubylevel_errinfo(void)
+{
+ return get_errinfo();
}
static VALUE
@@ -1805,7 +1578,7 @@ errat_getter(ID id)
{
VALUE err = get_errinfo();
if (!NIL_P(err)) {
- return rb_get_backtrace(err);
+ return get_backtrace(err);
}
else {
return Qnil;
@@ -1911,8 +1684,6 @@ Init_eval(void)
rb_define_private_method(rb_cModule, "prepend_features", rb_mod_prepend_features, 1);
rb_define_private_method(rb_cModule, "refine", rb_mod_refine, 1);
rb_define_private_method(rb_cModule, "using", mod_using, 1);
- rb_define_singleton_method(rb_cModule, "used_modules",
- rb_mod_s_used_modules, 0);
rb_undef_method(rb_cClass, "refine");
rb_undef_method(rb_cClass, "module_function");
@@ -1934,9 +1705,4 @@ Init_eval(void)
rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
rb_vm_register_special_exception(ruby_error_reenter, rb_eFatal, "exception reentered");
- rb_vm_register_special_exception(ruby_error_stackfatal, rb_eFatal, "machine stack overflow in critical region");
-
- 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 cd7a607eaa..0c323c21c7 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -3,65 +3,62 @@
* included by eval.c
*/
-#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-#define write_warn(str, x) RB_GNUC_EXTENSION_BLOCK( \
- NIL_P(str) ? \
- warn_print(x) : (void)( \
- (__builtin_constant_p(x)) ? \
- rb_str_concat((str), rb_str_new((x), (long)strlen(x))) : \
- rb_str_concat((str), rb_str_new2(x)) \
- ) \
- )
-#define warn_print(x) RB_GNUC_EXTENSION_BLOCK( \
- (__builtin_constant_p(x)) ? \
- rb_write_error2((x), (long)strlen(x)) : \
- rb_write_error(x) \
-)
-#else
-#define write_warn(str, x) NIL_P(str) ? rb_write_error((x)) : (void)rb_str_concat((str), rb_str_new2(x))
-#define warn_print(x) rb_write_error(x)
-#endif
+static void
+warn_printf(const char *fmt, ...)
+{
+ VALUE str;
+ va_list args;
-#define write_warn2(str,x,l) NIL_P(str) ? warn_print2(x,l) : (void)rb_str_concat((str), rb_str_new((x),(l)))
-#define warn_print2(x,l) rb_write_error2((x),(l))
+ va_init_list(args, fmt);
+ str = rb_vsprintf(fmt, args);
+ va_end(args);
+ rb_write_error_str(str);
+}
-#define write_warn_str(str,x) NIL_P(str) ? rb_write_error_str(x) : (void)rb_str_concat((str), (x))
+#define warn_print(x) rb_write_error(x)
+#define warn_print2(x,l) rb_write_error2((x),(l))
#define warn_print_str(x) rb_write_error_str(x)
-static VALUE error_pos_str(void);
-
static void
-error_pos(const VALUE str)
+error_pos(void)
{
- VALUE pos = error_pos_str();
- if (!NIL_P(pos)) {
- write_warn_str(str, pos);
- }
-}
+ const char *sourcefile = rb_sourcefile();
+ int sourceline = rb_sourceline();
-static VALUE
-error_pos_str(void)
-{
- int sourceline;
- VALUE sourcefile = rb_source_location(&sourceline);
-
- if (!NIL_P(sourcefile)) {
+ if (sourcefile) {
ID caller_name;
if (sourceline == 0) {
- return rb_sprintf("%"PRIsVALUE": ", sourcefile);
+ warn_printf("%s", sourcefile);
}
else if ((caller_name = rb_frame_callee()) != 0) {
- return rb_sprintf("%"PRIsVALUE":%d:in `%"PRIsVALUE"': ",
- sourcefile, sourceline,
- rb_id2str(caller_name));
+ warn_printf("%s:%d:in `%s'", sourcefile, sourceline,
+ rb_id2name(caller_name));
}
else {
- return rb_sprintf("%"PRIsVALUE":%d: ", sourcefile, sourceline);
+ warn_printf("%s:%d", sourcefile, sourceline);
}
}
- return Qnil;
}
+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
set_backtrace(VALUE info, VALUE bt)
{
@@ -76,62 +73,86 @@ set_backtrace(VALUE info, VALUE bt)
bt = rb_backtrace_to_str_ary(bt);
}
}
- rb_check_funcall(info, set_backtrace, 1, &bt);
+ rb_funcall(info, rb_intern("set_backtrace"), 1, bt);
}
static void
-error_print(rb_execution_context_t *ec)
+error_print(void)
{
- rb_ec_error_print(ec, ec->errinfo);
-}
-
-#define CSI_BEGIN "\033["
-#define CSI_SGR "m"
+ volatile VALUE errat = Qundef;
+ rb_thread_t *th = GET_THREAD();
+ VALUE errinfo = th->errinfo;
+ int raised_flag = th->raised_flag;
+ volatile VALUE eclass = Qundef, e = Qundef;
+ const char *volatile einfo;
+ volatile long elen;
-static const char underline[] = CSI_BEGIN"1;4"CSI_SGR;
-static const char bold[] = CSI_BEGIN"1"CSI_SGR;
-static const char reset[] = CSI_BEGIN""CSI_SGR;
+ if (NIL_P(errinfo))
+ return;
+ rb_thread_raised_clear(th);
-static void
-print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int colored)
-{
- const char *einfo = "";
- long elen = 0;
- VALUE mesg;
+ TH_PUSH_TAG(th);
+ if (TH_EXEC_TAG() == 0) {
+ errat = get_backtrace(errinfo);
+ }
+ else if (errat == Qundef) {
+ errat = Qnil;
+ }
+ else if (eclass == Qundef || e != Qundef) {
+ goto error;
+ }
+ else {
+ goto no_message;
+ }
+ if (NIL_P(errat)) {
+ const char *file = rb_sourcefile();
+ int line = rb_sourceline();
+ if (!file)
+ warn_printf("%d", line);
+ else if (!line)
+ warn_printf("%s", file);
+ else
+ warn_printf("%s:%d", file, line);
+ }
+ else if (RARRAY_LEN(errat) == 0) {
+ error_pos();
+ }
+ else {
+ VALUE mesg = RARRAY_AREF(errat, 0);
- if (emesg != Qundef) {
- if (NIL_P(errat) || RARRAY_LEN(errat) == 0 ||
- NIL_P(mesg = RARRAY_AREF(errat, 0))) {
- error_pos(str);
- }
+ if (NIL_P(mesg))
+ error_pos();
else {
- write_warn_str(str, mesg);
- write_warn(str, ": ");
- }
-
- if (colored) write_warn(str, bold);
-
- if (!NIL_P(emesg)) {
- einfo = RSTRING_PTR(emesg);
- elen = RSTRING_LEN(emesg);
+ warn_print_str(mesg);
}
}
+ eclass = CLASS_OF(errinfo);
+ if (eclass != Qundef &&
+ (e = rb_check_funcall(errinfo, rb_intern("message"), 0, 0)) != Qundef &&
+ (RB_TYPE_P(e, T_STRING) || !NIL_P(e = rb_check_string_type(e)))) {
+ einfo = RSTRING_PTR(e);
+ elen = RSTRING_LEN(e);
+ }
+ else {
+ no_message:
+ einfo = "";
+ elen = 0;
+ }
if (eclass == rb_eRuntimeError && elen == 0) {
- if (colored) write_warn(str, underline);
- write_warn(str, "unhandled exception\n");
+ warn_print(": unhandled exception\n");
}
else {
VALUE epath;
epath = rb_class_name(eclass);
if (elen == 0) {
- if (colored) write_warn(str, underline);
- write_warn_str(str, epath);
- write_warn(str, "\n");
+ warn_print(": ");
+ warn_print_str(epath);
+ warn_print("\n");
}
else {
- const char *tail = 0;
+ char *tail = 0;
long len = elen;
if (RSTRING_PTR(epath)[0] == '#')
@@ -140,195 +161,111 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
len = tail - einfo;
tail++; /* skip newline */
}
- write_warn_str(str, tail ? rb_str_subseq(emesg, 0, len) : emesg);
+ warn_print(": ");
+ warn_print2(einfo, len);
if (epath) {
- write_warn(str, " (");
- if (colored) write_warn(str, underline);
- write_warn_str(str, epath);
- if (colored) write_warn(str, reset);
- if (colored) write_warn(str, bold);
- write_warn(str, ")\n");
+ warn_print(" (");
+ warn_print_str(epath);
+ warn_print(")\n");
}
if (tail) {
- write_warn_str(str, rb_str_subseq(emesg, tail - einfo, elen - len - 1));
+ warn_print2(tail, elen - len - 1);
}
- if (tail ? einfo[elen-1] != '\n' : !epath) write_warn2(str, "\n", 1);
+ if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
}
}
- if (colored) write_warn(str, reset);
-}
-static void
-print_backtrace(const VALUE eclass, const VALUE errat, const VALUE str, int reverse)
-{
if (!NIL_P(errat)) {
long i;
long len = RARRAY_LEN(errat);
int skip = eclass == rb_eSysStackError;
- const int threshold = 1000000000;
- int width = ((int)log10((double)(len > threshold ?
- ((len - 1) / threshold) :
- len - 1)) +
- (len < threshold ? 0 : 9) + 1);
#define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
#define TRACE_HEAD 8
#define TRACE_TAIL 5
for (i = 1; i < len; i++) {
- VALUE line = RARRAY_AREF(errat, reverse ? len - i : i);
+ VALUE line = RARRAY_AREF(errat, i);
if (RB_TYPE_P(line, T_STRING)) {
- VALUE bt = rb_str_new_cstr("\t");
- if (reverse) rb_str_catf(bt, "%*ld: ", width, len - i);
- write_warn_str(str, rb_str_catf(bt, "from %"PRIsVALUE"\n", line));
+ warn_printf("\tfrom %"PRIsVALUE"\n", line);
}
if (skip && i == TRACE_HEAD && len > TRACE_MAX) {
- write_warn_str(str, rb_sprintf("\t ... %ld levels...\n",
- len - TRACE_HEAD - TRACE_TAIL));
+ warn_printf("\t ... %ld levels...\n",
+ len - TRACE_HEAD - TRACE_TAIL);
i = len - TRACE_TAIL;
}
}
}
+ error:
+ TH_POP_TAG();
+ th->errinfo = errinfo;
+ rb_thread_raised_set(th, raised_flag);
}
void
-rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse)
+ruby_error_print(void)
{
- volatile VALUE eclass;
-
- if (NIL_P(errinfo))
- return;
-
- if (errat == Qundef) {
- errat = Qnil;
- }
- eclass = CLASS_OF(errinfo);
- if (NIL_P(reverse) || NIL_P(highlight)) {
- VALUE tty = (VALUE)rb_stderr_tty_p();
- if (NIL_P(reverse)) reverse = tty;
- if (NIL_P(highlight)) highlight = tty;
- }
- if (reverse) {
- static const char traceback[] = "Traceback "
- "(most recent call last):\n";
- const int bold_part = rb_strlen_lit("Traceback");
- char buff[sizeof(traceback)+sizeof(bold)+sizeof(reset)-2], *p = buff;
- const char *msg = traceback;
- long len = sizeof(traceback) - 1;
- if (highlight) {
-#define APPEND(s, l) (memcpy(p, s, l), p += (l))
- APPEND(bold, sizeof(bold)-1);
- APPEND(traceback, bold_part);
- APPEND(reset, sizeof(reset)-1);
- APPEND(traceback + bold_part, sizeof(traceback)-bold_part-1);
-#undef APPEND
- len = p - (msg = buff);
- }
- write_warn2(str, msg, len);
- print_backtrace(eclass, errat, str, TRUE);
- print_errinfo(eclass, errat, emesg, str, highlight!=0);
- }
- else {
- print_errinfo(eclass, errat, emesg, str, highlight!=0);
- print_backtrace(eclass, errat, str, FALSE);
- }
+ error_print();
}
-VALUE rb_get_message(VALUE exc);
-
-void
-rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo)
+static const char *
+method_scope_name(int scope)
{
- volatile int raised_flag = ec->raised_flag;
- volatile VALUE errat = Qundef;
- volatile VALUE emesg = Qundef;
-
- if (NIL_P(errinfo))
- return;
- rb_ec_raised_clear(ec);
+ const char *v;
- EC_PUSH_TAG(ec);
- if (EC_EXEC_TAG() == TAG_NONE) {
- errat = rb_get_backtrace(errinfo);
- }
- if (emesg == Qundef) {
- emesg = Qnil;
- emesg = rb_get_message(errinfo);
+ switch (scope) {
+ default:
+ case NOEX_PUBLIC: v = ""; break;
+ case NOEX_PRIVATE: v = " private"; break;
+ case NOEX_PROTECTED: v = " protected"; break;
}
-
- rb_error_write(errinfo, emesg, errat, Qnil, Qnil, Qnil);
-
- EC_POP_TAG();
- ec->errinfo = errinfo;
- rb_ec_raised_set(ec, raised_flag);
+ return v;
}
-#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, rb_method_visibility_t visi)
+rb_print_undef(VALUE klass, ID id, int scope)
{
- 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_err_raise_str(mesg, klass, ID2SYM(id));
+ const char *v = method_scope_name(scope);
+ 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));
}
void
rb_print_undef_str(VALUE klass, VALUE name)
{
- const int is_mod = RB_TYPE_P(klass, T_MODULE);
- rb_name_err_raise_str(undef_mesg(""), klass, 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));
}
-#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)
+rb_print_inaccessible(VALUE klass, ID id, int scope)
{
- 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));
+ const char *v = method_scope_name(scope);
+ rb_name_error(id, "method `%"PRIsVALUE"' for %s `% "PRIsVALUE"' is %s",
+ QUOTE_ID(id),
+ (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class",
+ rb_class_name(klass),
+ v);
}
static int
sysexit_status(VALUE err)
{
- VALUE st = rb_ivar_get(err, id_status);
+ VALUE st = rb_iv_get(err, "status");
return NUM2INT(st);
}
-#define unknown_longjmp_status(status) \
- rb_bug("Unknown longjmp status %d", status)
-
static int
error_handle(int ex)
{
int status = EXIT_FAILURE;
- rb_execution_context_t *ec = GET_EC();
+ rb_thread_t *th = GET_THREAD();
- if (rb_ec_set_raised(ec))
+ if (rb_threadptr_set_raised(th))
return EXIT_FAILURE;
switch (ex & TAG_MASK) {
case 0:
@@ -336,51 +273,51 @@ error_handle(int ex)
break;
case TAG_RETURN:
- error_pos(Qnil);
- warn_print("unexpected return\n");
+ error_pos();
+ warn_print(": unexpected return\n");
break;
case TAG_NEXT:
- error_pos(Qnil);
- warn_print("unexpected next\n");
+ error_pos();
+ warn_print(": unexpected next\n");
break;
case TAG_BREAK:
- error_pos(Qnil);
- warn_print("unexpected break\n");
+ error_pos();
+ warn_print(": unexpected break\n");
break;
case TAG_REDO:
- error_pos(Qnil);
- warn_print("unexpected redo\n");
+ error_pos();
+ warn_print(": unexpected redo\n");
break;
case TAG_RETRY:
- error_pos(Qnil);
- warn_print("retry outside of rescue clause\n");
+ error_pos();
+ warn_print(": retry outside of rescue clause\n");
break;
case TAG_THROW:
/* TODO: fix me */
- error_pos(Qnil);
- warn_print("unexpected throw\n");
+ error_pos();
+ warn_printf(": unexpected throw\n");
break;
case TAG_RAISE: {
- VALUE errinfo = ec->errinfo;
+ VALUE errinfo = GET_THREAD()->errinfo;
if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
status = sysexit_status(errinfo);
}
else if (rb_obj_is_instance_of(errinfo, rb_eSignal) &&
- rb_ivar_get(errinfo, id_signo) != INT2FIX(SIGSEGV)) {
+ rb_iv_get(errinfo, "signo") != INT2FIX(SIGSEGV)) {
/* no message when exiting by signal */
}
else {
- rb_ec_error_print(ec, errinfo);
+ error_print();
}
break;
}
case TAG_FATAL:
- error_print(ec);
+ error_print();
break;
default:
- unknown_longjmp_status(ex);
+ rb_bug("Unknown longjmp status %d", ex);
break;
}
- rb_ec_reset_raised(ec);
+ rb_threadptr_reset_raised(th);
return status;
}
diff --git a/eval_intern.h b/eval_intern.h
index 420f3d3b36..c457deb8db 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -4,24 +4,15 @@
#include "ruby/ruby.h"
#include "vm_core.h"
-static inline void
-vm_passed_block_handler_set(rb_execution_context_t *ec, VALUE block_handler)
-{
- vm_block_handler_verify(block_handler);
- ec->passed_block_handler = block_handler;
-}
-
-static inline void
-pass_passed_block_handler(rb_execution_context_t *ec)
-{
- VALUE block_handler = rb_vm_frame_block_handler(ec->cfp);
- vm_block_handler_verify(block_handler);
- vm_passed_block_handler_set(ec, block_handler);
- VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_PASSED);
-}
+#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_HANDLER_EC(ec) pass_passed_block_handler(ec)
-#define PASS_PASSED_BLOCK_HANDLER() pass_passed_block_handler(GET_EC())
+#define PASS_PASSED_BLOCK() do { \
+ rb_thread_t * const __th__ = GET_THREAD(); \
+ PASS_PASSED_BLOCK_TH(__th__); \
+} while (0)
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -98,7 +89,7 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
} \
__except (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW ? \
- (rb_ec_raised_set(GET_EC(), RAISED_STACKOVERFLOW), \
+ (rb_thread_raised_set(GET_THREAD(), RAISED_STACKOVERFLOW), \
raise(SIGSEGV), \
EXCEPTION_EXECUTE_HANDLER) : \
EXCEPTION_CONTINUE_SEARCH) { \
@@ -128,145 +119,100 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
rb_fiber_start(); \
} while (0)
-#define EC_PUSH_TAG(ec) do { \
- rb_execution_context_t * const _ec = (ec); \
+#define TH_PUSH_TAG(th) do { \
+ rb_thread_t * const _th = (th); \
struct rb_vm_tag _tag; \
- _tag.state = TAG_NONE; \
- _tag.tag = Qundef; \
- _tag.prev = _ec->tag;
+ _tag.tag = 0; \
+ _tag.prev = _th->tag;
-#define EC_POP_TAG() \
- _ec->tag = _tag.prev; \
+#define TH_POP_TAG() \
+ _th->tag = _tag.prev; \
} while (0)
-#define EC_TMPPOP_TAG() \
- _ec->tag = _tag.prev
+#define TH_TMPPOP_TAG() \
+ _th->tag = _tag.prev
-#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag)
+#define TH_REPUSH_TAG() (void)(_th->tag = &_tag)
-#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || __clang__
-/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings.
- * This macro also prevents Clang from dumping core in EC_EXEC_TAG().
- * (I confirmed Clang 4.0.1 and 5.0.0.)
- */
+#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))
-# define VAR_NOCLOBBERED(var) volatile var
#else
# define VAR_FROM_MEMORY(var) (var)
# define VAR_INITIALIZED(var) ((void)&(var))
-# define VAR_NOCLOBBERED(var) var
#endif
-#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \
- defined(__clang__)
-# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
- _Pragma("GCC diagnostic push"); \
- _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\""); \
- typeof(expr) unaligned_member_access_result = (expr); \
- _Pragma("GCC diagnostic pop"); \
- unaligned_member_access_result; \
-})
-#else
-# define UNALIGNED_MEMBER_ACCESS(expr) expr
-#endif
-#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
-
-#undef RB_OBJ_WRITE
-#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
-
-/* clear ec->tag->state, and return the value */
+/* clear th->state, and return the value */
static inline int
-rb_ec_tag_state(const rb_execution_context_t *ec)
+rb_threadptr_tag_state(rb_thread_t *th)
{
- enum ruby_tag_type state = ec->tag->state;
- ec->tag->state = TAG_NONE;
+ int state = th->state;
+ th->state = 0;
return state;
}
-NORETURN(static inline void rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st));
+NORETURN(static inline void rb_threadptr_tag_jump(rb_thread_t *, int));
static inline void
-rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st)
+rb_threadptr_tag_jump(rb_thread_t *th, int st)
{
- ec->tag->state = st;
- ruby_longjmp(ec->tag->buf, 1);
+ th->state = st;
+ ruby_longjmp(th->tag->buf, 1);
}
/*
setjmp() in assignment expression rhs is undefined behavior
[ISO/IEC 9899:1999] 7.13.1.1
*/
-#define EC_EXEC_TAG() \
- (ruby_setjmp(_tag.buf) ? rb_ec_tag_state(VAR_FROM_MEMORY(_ec)) : (EC_REPUSH_TAG(), 0))
-
-#define EC_JUMP_TAG(ec, st) rb_ec_tag_jump(ec, st)
-
-#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc)
-
-/* 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;
-}
+#define TH_EXEC_TAG() \
+ (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0))
-static inline void
-CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
-{
- RB_OBJ_WRITE(cref, &cref->refinements, refs);
-}
+#define EXEC_TAG() \
+ TH_EXEC_TAG()
-static inline int
-CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
-{
- return cref->flags & CREF_FL_PUSHED_BY_EVAL;
-}
+#define TH_JUMP_TAG(th, st) rb_threadptr_tag_jump(th, st)
-static inline void
-CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
-{
- cref->flags |= CREF_FL_PUSHED_BY_EVAL;
-}
+#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), (st))
-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;
-}
+#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc)
-static inline void
-CREF_OMOD_SHARED_UNSET(rb_cref_t *cref)
-{
- cref->flags &= ~CREF_FL_OMOD_SHARED;
-}
+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))
void rb_thread_cleanup(void);
void rb_thread_wait_other_threads(void);
@@ -276,13 +222,12 @@ enum {
RAISED_STACKOVERFLOW = 2,
RAISED_NOMEMORY = 4
};
-#define rb_ec_raised_set(ec, f) ((ec)->raised_flag |= (f))
-#define rb_ec_raised_reset(ec, f) ((ec)->raised_flag &= ~(f))
-#define rb_ec_raised_p(ec, f) (((ec)->raised_flag & (f)) != 0)
-#define rb_ec_raised_clear(ec) ((ec)->raised_flag = 0)
-int rb_ec_set_raised(rb_execution_context_t *ec);
-int rb_ec_reset_raised(rb_execution_context_t *ec);
-int rb_ec_stack_check(rb_execution_context_t *ec);
+int rb_threadptr_set_raised(rb_thread_t *th);
+int rb_threadptr_reset_raised(rb_thread_t *th);
+#define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f))
+#define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f))
+#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, const VALUE *argv, VALUE self);
VALUE rb_make_exception(int argc, const VALUE *argv);
@@ -291,26 +236,22 @@ NORETURN(void rb_method_name_error(VALUE, VALUE));
NORETURN(void rb_fiber_start(void));
-NORETURN(void rb_print_undef(VALUE, ID, rb_method_visibility_t));
+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_print_inaccessible(VALUE, ID, int));
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
-#if 0
NORETURN(void rb_vm_jump_tag_but_local_jump(int));
-#endif
+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);
-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, VALUE block_handler, VALUE filename);
+NODE *rb_vm_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);
+VALUE rb_vm_top_self();
VALUE rb_vm_cbase(void);
-/* vm_backtrace.c */
-VALUE rb_ec_backtrace_object(const rb_execution_context_t *ec);
-VALUE rb_ec_backtrace_str_ary(const rb_execution_context_t *ec, long lev, long n);
-
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
# ifdef HAVE_MBLEN
# define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE))
diff --git a/eval_jump.c b/eval_jump.c
index 9ea69736cf..5443ed224e 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -94,11 +94,10 @@ rb_mark_end_proc(void)
}
static void
-exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
+exec_end_procs_chain(struct end_proc_data *volatile *procs)
{
struct end_proc_data volatile endproc;
struct end_proc_data *link;
- VALUE errinfo = *errp;
while ((link = *procs) != 0) {
*procs = link->next;
@@ -106,35 +105,35 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
xfree(link);
rb_set_safe_level_force(endproc.safe);
(*endproc.func) (endproc.data);
- *errp = errinfo;
}
}
void
rb_exec_end_proc(void)
{
- enum ruby_tag_type state;
+ int status;
volatile int safe = rb_safe_level();
- rb_execution_context_t * volatile ec = GET_EC();
- volatile VALUE errinfo = ec->errinfo;
+ rb_thread_t *th = GET_THREAD();
+ volatile VALUE errinfo = th->errinfo;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ PUSH_TAG();
+ if ((status = EXEC_TAG()) == 0) {
again:
- exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo);
- exec_end_procs_chain(&end_procs, &ec->errinfo);
+ exec_end_procs_chain(&ephemeral_end_procs);
+ exec_end_procs_chain(&end_procs);
}
else {
- EC_TMPPOP_TAG();
- error_handle(state);
- if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo;
- EC_REPUSH_TAG();
+ VAR_INITIALIZED(th);
+ TH_TMPPOP_TAG();
+ error_handle(status);
+ if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
+ TH_REPUSH_TAG();
goto again;
}
- EC_POP_TAG();
+ POP_TAG();
rb_set_safe_level_force(safe);
- ec->errinfo = errinfo;
+ th->errinfo = errinfo;
}
void
diff --git a/ext/-test-/array/resize/depend b/ext/-test-/array/resize/depend
deleted file mode 100644
index 177c527db2..0000000000
--- a/ext/-test-/array/resize/depend
+++ /dev/null
@@ -1,12 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-resize.o: $(RUBY_EXTCONF_H)
-resize.o: $(arch_hdrdir)/ruby/config.h
-resize.o: $(hdrdir)/ruby/backward.h
-resize.o: $(hdrdir)/ruby/defines.h
-resize.o: $(hdrdir)/ruby/intern.h
-resize.o: $(hdrdir)/ruby/missing.h
-resize.o: $(hdrdir)/ruby/ruby.h
-resize.o: $(hdrdir)/ruby/st.h
-resize.o: $(hdrdir)/ruby/subst.h
-resize.o: resize.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/array/resize/extconf.rb b/ext/-test-/array/resize/extconf.rb
index bc827e1170..6500a878fc 100644
--- a/ext/-test-/array/resize/extconf.rb
+++ b/ext/-test-/array/resize/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/array/resize")
diff --git a/ext/-test-/auto_ext.rb b/ext/-test-/auto_ext.rb
deleted file mode 100644
index 71606a9dd1..0000000000
--- a/ext/-test-/auto_ext.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: false
-def auto_ext(feat = $0[%r[/ext/(-test-/.*)/extconf.rb\z], 1], inc: false)
- $INCFLAGS << " -I$(topdir) -I$(top_srcdir)" if inc
- $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(feat)
-end
diff --git a/ext/-test-/bignum/big2str.c b/ext/-test-/bignum/big2str.c
index ec4bde2915..ce71fe37e2 100644
--- a/ext/-test-/bignum/big2str.c
+++ b/ext/-test-/bignum/big2str.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/bigzero.c b/ext/-test-/bignum/bigzero.c
index 35117db7ae..a3bf8af459 100644
--- a/ext/-test-/bignum/bigzero.c
+++ b/ext/-test-/bignum/bigzero.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/depend b/ext/-test-/bignum/depend
index 60e711489c..c65482236a 100644
--- a/ext/-test-/bignum/depend
+++ b/ext/-test-/bignum/depend
@@ -1,115 +1,7 @@
-big2str.o: big2str.c
-div.o: div.c
-intpack.o: intpack.c
-mul.o: mul.c
-str2big.o: str2big.c
+$(OBJS): $(HDRS) $(ruby_headers)
-# AUTOGENERATED DEPENDENCIES START
-big2str.o: $(RUBY_EXTCONF_H)
-big2str.o: $(arch_hdrdir)/ruby/config.h
-big2str.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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
+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
diff --git a/ext/-test-/bignum/div.c b/ext/-test-/bignum/div.c
index a1db21dc30..2853ebef1c 100644
--- a/ext/-test-/bignum/div.c
+++ b/ext/-test-/bignum/div.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/extconf.rb b/ext/-test-/bignum/extconf.rb
index d786b15db9..e8c1febc82 100644
--- a/ext/-test-/bignum/extconf.rb
+++ b/ext/-test-/bignum/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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-/bignum")
diff --git a/ext/-test-/bignum/intpack.c b/ext/-test-/bignum/intpack.c
index 2d19442cf2..b7435b2025 100644
--- a/ext/-test-/bignum/intpack.c
+++ b/ext/-test-/bignum/intpack.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bignum/mul.c b/ext/-test-/bignum/mul.c
index b922f34437..c0514a5a0d 100644
--- a/ext/-test-/bignum/mul.c
+++ b/ext/-test-/bignum/mul.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
@@ -54,8 +55,8 @@ mul_gmp(VALUE x, VALUE y)
void
Init_mul(VALUE klass)
{
- rb_define_const(rb_cInteger, "SIZEOF_BDIGIT", INT2NUM(SIZEOF_BDIGIT));
- rb_define_const(rb_cInteger, "BITSPERDIG", INT2NUM(SIZEOF_BDIGIT * 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 bc79ef0329..0fdcb53290 100644
--- a/ext/-test-/bignum/str2big.c
+++ b/ext/-test-/bignum/str2big.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
static VALUE
diff --git a/ext/-test-/bug-3571/bug.c b/ext/-test-/bug-3571/bug.c
index a64f054740..87a5df0588 100644
--- a/ext/-test-/bug-3571/bug.c
+++ b/ext/-test-/bug-3571/bug.c
@@ -16,7 +16,7 @@ bug_start(VALUE self, VALUE hash)
}
void
-Init_bug_3571(void)
+Init_bug(void)
{
VALUE mBug = rb_define_module("Bug");
rb_define_module_function(mBug, "start", bug_start, 0);
diff --git a/ext/-test-/bug-3571/extconf.rb b/ext/-test-/bug-3571/extconf.rb
index 7e76ebded6..6390fce219 100644
--- a/ext/-test-/bug-3571/extconf.rb
+++ b/ext/-test-/bug-3571/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/bug_3571")
+create_makefile("-test-/bug-3571/bug")
diff --git a/ext/-test-/bug-3662/bug.c b/ext/-test-/bug-3662/bug.c
new file mode 100644
index 0000000000..9375dace10
--- /dev/null
+++ b/ext/-test-/bug-3662/bug.c
@@ -0,0 +1,16 @@
+#include <ruby.h>
+
+static VALUE
+bug_funcall(int argc, VALUE *argv, VALUE self)
+{
+ if (argc < 1) rb_raise(rb_eArgError, "not enough argument");
+ return rb_funcall2(self, rb_to_id(*argv), argc-1, argv+1);
+}
+
+void
+Init_bug(void)
+{
+ VALUE mBug = rb_define_module("Bug");
+ rb_define_module_function(mBug, "funcall", bug_funcall, -1);
+ rb_define_module_function(mBug, "notimplement", rb_f_notimplement, -1);
+}
diff --git a/ext/-test-/bug-3662/extconf.rb b/ext/-test-/bug-3662/extconf.rb
new file mode 100644
index 0000000000..7a1b73023c
--- /dev/null
+++ b/ext/-test-/bug-3662/extconf.rb
@@ -0,0 +1 @@
+create_makefile("-test-/bug-3662/bug")
diff --git a/ext/-test-/bug-5832/bug.c b/ext/-test-/bug-5832/bug.c
index a2c3965640..67be5844b6 100644
--- a/ext/-test-/bug-5832/bug.c
+++ b/ext/-test-/bug-5832/bug.c
@@ -7,7 +7,7 @@ bug_funcall_callback(VALUE self, VALUE obj)
}
void
-Init_bug_5832(void)
+Init_bug(void)
{
VALUE mBug = rb_define_module("Bug");
rb_define_module_function(mBug, "funcall_callback", bug_funcall_callback, 1);
diff --git a/ext/-test-/bug-5832/extconf.rb b/ext/-test-/bug-5832/extconf.rb
index b8452b4f8f..55a4b7d93f 100644
--- a/ext/-test-/bug-5832/extconf.rb
+++ b/ext/-test-/bug-5832/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/bug_5832")
+create_makefile("-test-/bug-5832/bug")
diff --git a/ext/-test-/bug_reporter/extconf.rb b/ext/-test-/bug_reporter/extconf.rb
index d9d49bb23e..0fccd81a41 100644
--- a/ext/-test-/bug_reporter/extconf.rb
+++ b/ext/-test-/bug_reporter/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/bug_reporter")
+create_makefile("-test-/bug_reporter/bug_reporter")
diff --git a/ext/-test-/class/depend b/ext/-test-/class/depend
deleted file mode 100644
index 40f3d7ab6d..0000000000
--- a/ext/-test-/class/depend
+++ /dev/null
@@ -1,23 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-class2name.o: $(RUBY_EXTCONF_H)
-class2name.o: $(arch_hdrdir)/ruby/config.h
-class2name.o: $(hdrdir)/ruby/backward.h
-class2name.o: $(hdrdir)/ruby/defines.h
-class2name.o: $(hdrdir)/ruby/intern.h
-class2name.o: $(hdrdir)/ruby/missing.h
-class2name.o: $(hdrdir)/ruby/ruby.h
-class2name.o: $(hdrdir)/ruby/st.h
-class2name.o: $(hdrdir)/ruby/subst.h
-class2name.o: class2name.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby/backward.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-/class/extconf.rb b/ext/-test-/class/extconf.rb
index d786b15db9..a07d660b87 100644
--- a/ext/-test-/class/extconf.rb
+++ b/ext/-test-/class/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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-/class")
diff --git a/ext/-test-/debug/depend b/ext/-test-/debug/depend
index 392677239a..d5a2ef9a52 100644
--- a/ext/-test-/debug/depend
+++ b/ext/-test-/debug/depend
@@ -1,35 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby/backward.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/backward.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/backward.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
+init.o: $(HDRS) $(ruby_headers)
+inspector.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
+profile_frames.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
diff --git a/ext/-test-/debug/extconf.rb b/ext/-test-/debug/extconf.rb
index ca51178a18..8f7922e1a6 100644
--- a/ext/-test-/debug/extconf.rb
+++ b/ext/-test-/debug/extconf.rb
@@ -1,3 +1,6 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext
+$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-/debug")
diff --git a/ext/-test-/dln/empty/depend b/ext/-test-/dln/empty/depend
deleted file mode 100644
index 99151fa055..0000000000
--- a/ext/-test-/dln/empty/depend
+++ /dev/null
@@ -1,3 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-empty.o: empty.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/dln/empty/extconf.rb b/ext/-test-/dln/empty/extconf.rb
deleted file mode 100644
index 20310b6dde..0000000000
--- a/ext/-test-/dln/empty/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: false
-create_makefile("-test-/dln/empty")
diff --git a/ext/-test-/exception/depend b/ext/-test-/exception/depend
index 9e5ccff274..79b6c53f50 100644
--- a/ext/-test-/exception/depend
+++ b/ext/-test-/exception/depend
@@ -1,48 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-dataerror.o: $(RUBY_EXTCONF_H)
-dataerror.o: $(arch_hdrdir)/ruby/config.h
-dataerror.o: $(hdrdir)/ruby/backward.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/backward.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/onigmo.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/backward.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/backward.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
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/-test-/exception/ensured.c b/ext/-test-/exception/ensured.c
index 7dcc9b78ef..365e1f4f79 100644
--- a/ext/-test-/exception/ensured.c
+++ b/ext/-test-/exception/ensured.c
@@ -18,22 +18,8 @@ ensured(VALUE module, VALUE object)
return rb_ensure(begin, object, ensure, object);
}
-static VALUE
-exc_raise(VALUE exc)
-{
- rb_exc_raise(exc);
- return Qnil;
-}
-
-static VALUE
-ensure_raise(VALUE module, VALUE object, VALUE exc)
-{
- return rb_ensure(rb_yield, object, exc_raise, exc);
-}
-
void
Init_ensured(VALUE klass)
{
rb_define_module_function(klass, "ensured", ensured, 1);
- rb_define_module_function(klass, "ensure_raise", ensure_raise, 2);
}
diff --git a/ext/-test-/exception/extconf.rb b/ext/-test-/exception/extconf.rb
index ca51178a18..0faf6d53ed 100644
--- a/ext/-test-/exception/extconf.rb
+++ b/ext/-test-/exception/extconf.rb
@@ -1,3 +1,6 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext
+$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+inits = $srcs.map {|s| File.basename(s, ".*")}
+inits.delete("init")
+inits.map! {|s|"X(#{s})"}
+$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\""
+create_makefile("-test-/exception")
diff --git a/ext/-test-/fatal/extconf.rb b/ext/-test-/fatal/extconf.rb
index d5849c0733..e0cfeb2095 100644
--- a/ext/-test-/fatal/extconf.rb
+++ b/ext/-test-/fatal/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/fatal/rb_fatal")
diff --git a/ext/-test-/file/depend b/ext/-test-/file/depend
index 0eea6063dd..7555a235b5 100644
--- a/ext/-test-/file/depend
+++ b/ext/-test-/file/depend
@@ -1,41 +1,2 @@
-# AUTOGENERATED DEPENDENCIES START
-fs.o: $(RUBY_EXTCONF_H)
-fs.o: $(arch_hdrdir)/ruby/config.h
-fs.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.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/backward.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/onigmo.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
+init.o: $(HDRS) $(ruby_headers)
+stat.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/io.h $(hdrdir)/ruby/encoding.h $(hdrdir)/oniguruma.h
diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb
index 9027ed1c3e..4e134dd1bf 100644
--- a/ext/-test-/file/extconf.rb
+++ b/ext/-test-/file/extconf.rb
@@ -1,18 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-
-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
-
-auto_ext(inc: true)
+$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-/file")
diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c
index c9c3473257..4a41bf33b9 100644
--- a/ext/-test-/file/fs.c
+++ b/ext/-test-/file/fs.c
@@ -1,102 +1,55 @@
#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>
+#ifdef __linux__
+# define HAVE_GETMNTENT
#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
+#ifdef HAVE_GETMNTENT
+# include <stdio.h>
+# include <mntent.h>
#endif
VALUE
get_fsname(VALUE self, VALUE str)
{
-#ifdef STATFS
- statfs_t st;
-# define CSTR(s) rb_str_new_cstr(s)
+#ifdef HAVE_GETMNTENT
+ const char *path;
+ struct mntent mntbuf;
+ static const int buflen = 4096;
+ char *buf = alloca(buflen);
+ int len = 0;
+ FILE *fp;
+#define FSNAME_LEN 100
+ char name[FSNAME_LEN] = "";
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;
-}
+ path = RSTRING_PTR(str);
+ fp = setmntent("/etc/mtab", "r");
+ if (!fp) rb_sys_fail("setmntent(/etb/mtab)");;
-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);
+ while (getmntent_r(fp, &mntbuf, buf, buflen)) {
+ int i;
+ char *mnt_dir = mntbuf.mnt_dir;
+ for (i=0; mnt_dir[i]; i++) {
+ if (mnt_dir[i] != path[i]) {
+ goto next_entry;
+ }
+ }
+ if (i >= len) {
+ len = i;
+ strlcpy(name, mntbuf.mnt_type, FSNAME_LEN);
+ }
+next_entry:
+ ;
}
-# 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
+ endmntent(fp);
+
+ if (!len) rb_sys_fail("no matching entry");;
+ return rb_str_new_cstr(name);
+#else
return Qnil;
+#endif
}
void
@@ -104,5 +57,4 @@ 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/extconf.rb b/ext/-test-/float/extconf.rb
index d786b15db9..0a9a299aa5 100644
--- a/ext/-test-/float/extconf.rb
+++ b/ext/-test-/float/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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-/funcall/extconf.rb b/ext/-test-/funcall/extconf.rb
index 39d6134cba..8a9179ab2f 100644
--- a/ext/-test-/funcall/extconf.rb
+++ b/ext/-test-/funcall/extconf.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: false
require 'mkmf'
-create_makefile("-test-/funcall")
+create_makefile("-test-/funcall/funcall")
diff --git a/ext/-test-/funcall/funcall.c b/ext/-test-/funcall/funcall.c
deleted file mode 100644
index 4e13c952e5..0000000000
--- a/ext/-test-/funcall/funcall.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "ruby.h"
-
-VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
-
-static VALUE
-with_funcall2(int argc, VALUE *argv, VALUE self)
-{
- return rb_funcallv(self, rb_intern("target"), argc, argv);
-}
-
-static VALUE
-with_funcall_passing_block(int argc, VALUE *argv, VALUE self)
-{
- return rb_funcall_passing_block(self, rb_intern("target"), argc, argv);
-}
-
-static VALUE
-extra_args_name(VALUE self)
-{
- /*
- * at least clang 5.x gets tripped by the extra 0 arg
- * [ruby-core:85266] [Bug #14425]
- */
- return rb_funcall(self, rb_intern("name"), 0, 0);
-}
-
-void
-Init_funcall(void)
-{
- VALUE cTestFuncall = rb_path2class("TestFuncall");
- VALUE cRelay = rb_define_module_under(cTestFuncall, "Relay");
-
- rb_define_singleton_method(cRelay,
- "with_funcall2",
- with_funcall2,
- -1);
- rb_define_singleton_method(cRelay,
- "with_funcall_passing_block",
- with_funcall_passing_block,
- -1);
- rb_define_singleton_method(cTestFuncall, "extra_args_name",
- extra_args_name,
- 0);
-}
diff --git a/ext/-test-/funcall/passing_block.c b/ext/-test-/funcall/passing_block.c
new file mode 100644
index 0000000000..0200f80369
--- /dev/null
+++ b/ext/-test-/funcall/passing_block.c
@@ -0,0 +1,30 @@
+#include "ruby.h"
+
+VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
+
+static VALUE
+with_funcall2(int argc, VALUE *argv, VALUE self)
+{
+ return rb_funcall2(self, rb_intern("target"), argc, argv);
+}
+
+static VALUE
+with_funcall_passing_block(int argc, VALUE *argv, VALUE self)
+{
+ return rb_funcall_passing_block(self, rb_intern("target"), argc, argv);
+}
+
+void
+Init_funcall(void)
+{
+ VALUE cRelay = rb_path2class("TestFuncall::Relay");
+
+ rb_define_singleton_method(cRelay,
+ "with_funcall2",
+ with_funcall2,
+ -1);
+ rb_define_singleton_method(cRelay,
+ "with_funcall_passing_block",
+ with_funcall_passing_block,
+ -1);
+}
diff --git a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c
deleted file mode 100644
index f3071d5768..0000000000
--- a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#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/depend b/ext/-test-/gvl/call_without_gvl/depend
deleted file mode 100644
index 1f7443898d..0000000000
--- a/ext/-test-/gvl/call_without_gvl/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-call_without_gvl.o: $(RUBY_EXTCONF_H)
-call_without_gvl.o: $(arch_hdrdir)/ruby/config.h
-call_without_gvl.o: $(hdrdir)/ruby/backward.h
-call_without_gvl.o: $(hdrdir)/ruby/defines.h
-call_without_gvl.o: $(hdrdir)/ruby/intern.h
-call_without_gvl.o: $(hdrdir)/ruby/missing.h
-call_without_gvl.o: $(hdrdir)/ruby/ruby.h
-call_without_gvl.o: $(hdrdir)/ruby/st.h
-call_without_gvl.o: $(hdrdir)/ruby/subst.h
-call_without_gvl.o: $(hdrdir)/ruby/thread.h
-call_without_gvl.o: call_without_gvl.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/gvl/call_without_gvl/extconf.rb b/ext/-test-/gvl/call_without_gvl/extconf.rb
deleted file mode 100644
index 56181b6773..0000000000
--- a/ext/-test-/gvl/call_without_gvl/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# 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
deleted file mode 100644
index 10d4aec6e7..0000000000
--- a/ext/-test-/hash/delete.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#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
deleted file mode 100644
index d786b15db9..0000000000
--- a/ext/-test-/hash/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
diff --git a/ext/-test-/hash/init.c b/ext/-test-/hash/init.c
deleted file mode 100644
index 9f6cbde652..0000000000
--- a/ext/-test-/hash/init.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#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-/integer/core_ext.c b/ext/-test-/integer/core_ext.c
deleted file mode 100644
index 510ba4a1e6..0000000000
--- a/ext/-test-/integer/core_ext.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "internal.h"
-
-static VALUE
-int_bignum_p(VALUE self)
-{
- return RB_TYPE_P(self, T_BIGNUM) ? Qtrue : Qfalse;
-}
-
-static VALUE
-int_fixnum_p(VALUE self)
-{
- return FIXNUM_P(self) ? Qtrue : Qfalse;
-}
-
-static VALUE
-rb_int_to_bignum(VALUE x)
-{
- if (FIXNUM_P(x))
- x = rb_int2big(FIX2LONG(x));
- return x;
-}
-
-static VALUE
-positive_pow(VALUE x, VALUE y)
-{
- return rb_int_positive_pow(NUM2LONG(x), NUM2ULONG(y));
-}
-
-void
-Init_core_ext(VALUE klass)
-{
- rb_define_method(rb_cInteger, "bignum?", int_bignum_p, 0);
- rb_define_method(rb_cInteger, "fixnum?", int_fixnum_p, 0);
- rb_define_method(rb_cInteger, "to_bignum", rb_int_to_bignum, 0);
- rb_define_method(rb_cInteger, "positive_pow", positive_pow, 1);
-}
diff --git a/ext/-test-/integer/depend b/ext/-test-/integer/depend
deleted file mode 100644
index 48f04d9ca0..0000000000
--- a/ext/-test-/integer/depend
+++ /dev/null
@@ -1,40 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-core_ext.o: $(RUBY_EXTCONF_H)
-core_ext.o: $(arch_hdrdir)/ruby/config.h
-core_ext.o: $(hdrdir)/ruby/backward.h
-core_ext.o: $(hdrdir)/ruby/defines.h
-core_ext.o: $(hdrdir)/ruby/encoding.h
-core_ext.o: $(hdrdir)/ruby/intern.h
-core_ext.o: $(hdrdir)/ruby/io.h
-core_ext.o: $(hdrdir)/ruby/missing.h
-core_ext.o: $(hdrdir)/ruby/onigmo.h
-core_ext.o: $(hdrdir)/ruby/oniguruma.h
-core_ext.o: $(hdrdir)/ruby/ruby.h
-core_ext.o: $(hdrdir)/ruby/st.h
-core_ext.o: $(hdrdir)/ruby/subst.h
-core_ext.o: $(top_srcdir)/include/ruby.h
-core_ext.o: $(top_srcdir)/internal.h
-core_ext.o: core_ext.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby/backward.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
-my_integer.o: $(RUBY_EXTCONF_H)
-my_integer.o: $(arch_hdrdir)/ruby/config.h
-my_integer.o: $(hdrdir)/ruby/backward.h
-my_integer.o: $(hdrdir)/ruby/defines.h
-my_integer.o: $(hdrdir)/ruby/intern.h
-my_integer.o: $(hdrdir)/ruby/missing.h
-my_integer.o: $(hdrdir)/ruby/ruby.h
-my_integer.o: $(hdrdir)/ruby/st.h
-my_integer.o: $(hdrdir)/ruby/subst.h
-my_integer.o: $(top_srcdir)/include/ruby.h
-my_integer.o: my_integer.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/integer/extconf.rb b/ext/-test-/integer/extconf.rb
deleted file mode 100644
index d786b15db9..0000000000
--- a/ext/-test-/integer/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
diff --git a/ext/-test-/integer/init.c b/ext/-test-/integer/init.c
deleted file mode 100644
index fc256ea16b..0000000000
--- a/ext/-test-/integer/init.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "ruby.h"
-
-#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
-
-void
-Init_integer(void)
-{
- VALUE mBug = rb_define_module("Bug");
- VALUE klass = rb_define_class_under(mBug, "Integer", rb_cObject);
- TEST_INIT_FUNCS(init);
-}
diff --git a/ext/-test-/integer/my_integer.c b/ext/-test-/integer/my_integer.c
deleted file mode 100644
index d86474bd7d..0000000000
--- a/ext/-test-/integer/my_integer.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "ruby.h"
-
-static VALUE
-my_integer_s_new(VALUE klass)
-{
- return Data_Wrap_Struct(klass, 0, 0, 0);
-}
-
-void
-Init_my_integer(VALUE klass)
-{
- VALUE cMyInteger;
-
- cMyInteger = rb_define_class_under(klass, "MyInteger", rb_cInteger);
- rb_define_singleton_method(cMyInteger, "new", my_integer_s_new, 0);
-}
diff --git a/ext/-test-/iseq_load/extconf.rb b/ext/-test-/iseq_load/extconf.rb
deleted file mode 100644
index 5858870138..0000000000
--- a/ext/-test-/iseq_load/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: false
-create_makefile("-test-/iseq_load")
diff --git a/ext/-test-/iseq_load/iseq_load.c b/ext/-test-/iseq_load/iseq_load.c
deleted file mode 100644
index b4b9a8aa3d..0000000000
--- a/ext/-test-/iseq_load/iseq_load.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#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 d786b15db9..0ba99691bd 100644
--- a/ext/-test-/iter/extconf.rb
+++ b/ext/-test-/iter/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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-/iter")
diff --git a/ext/-test-/load/dot.dot/depend b/ext/-test-/load/dot.dot/depend
deleted file mode 100644
index a0445e288b..0000000000
--- a/ext/-test-/load/dot.dot/depend
+++ /dev/null
@@ -1,3 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-dot.dot.o: dot.dot.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/load/dot.dot/extconf.rb b/ext/-test-/load/dot.dot/extconf.rb
index 13ebb1ffb4..6287db6bd8 100644
--- a/ext/-test-/load/dot.dot/extconf.rb
+++ b/ext/-test-/load/dot.dot/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/load/dot.dot")
+create_makefile("-test-/load/dot.dot/dot.dot")
diff --git a/ext/-test-/load/protect/extconf.rb b/ext/-test-/load/protect/extconf.rb
deleted file mode 100644
index 83c080de9c..0000000000
--- a/ext/-test-/load/protect/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile('-test-/load/protect')
diff --git a/ext/-test-/load/protect/protect.c b/ext/-test-/load/protect/protect.c
deleted file mode 100644
index ccfbbb9ea0..0000000000
--- a/ext/-test-/load/protect/protect.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <ruby.h>
-
-static VALUE
-load_protect(int argc, VALUE *argv, VALUE self)
-{
- int state;
- VALUE path, wrap;
- rb_scan_args(argc, argv, "11", &path, &wrap);
- rb_load_protect(path, RTEST(wrap), &state);
- if (state) rb_jump_tag(state);
- return Qnil;
-}
-
-void
-Init_protect(void)
-{
- VALUE mod = rb_define_module("Bug");
- rb_define_singleton_method(mod, "load_protect", load_protect, -1);
-}
diff --git a/ext/-test-/marshal/compat/extconf.rb b/ext/-test-/marshal/compat/extconf.rb
index 9bf44b473a..bb11ebfb8c 100644
--- a/ext/-test-/marshal/compat/extconf.rb
+++ b/ext/-test-/marshal/compat/extconf.rb
@@ -1,2 +1 @@
-# 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
deleted file mode 100644
index cb3f825dbd..0000000000
--- a/ext/-test-/marshal/internal_ivar/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# 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
deleted file mode 100644
index 299da27f23..0000000000
--- a/ext/-test-/marshal/internal_ivar/internal_ivar.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#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 b7886b9eea..c662b23dd5 100644
--- a/ext/-test-/marshal/usr/extconf.rb
+++ b/ext/-test-/marshal/usr/extconf.rb
@@ -1,2 +1 @@
-# 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 0c9e079af2..b30bd52c13 100644
--- a/ext/-test-/marshal/usr/usrmarshal.c
+++ b/ext/-test-/marshal/usr/usrmarshal.c
@@ -1,38 +1,23 @@
#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 TypedData_Make_Struct(klass, int, &usrmarshal_type, p);
+ return Data_Make_Struct(klass, int, 0, RUBY_DEFAULT_FREE, p);
}
static VALUE
usr_init(VALUE self, VALUE val)
{
- int *ptr = Check_TypedStruct(self, &usrmarshal_type);
- *ptr = NUM2INT(val);
+ *(int *)DATA_PTR(self) = NUM2INT(val);
return self;
}
static VALUE
usr_value(VALUE self)
{
- int *ptr = Check_TypedStruct(self, &usrmarshal_type);
- int val = *ptr;
+ int val = *(int *)DATA_PTR(self);
return INT2NUM(val);
}
diff --git a/ext/-test-/memory_status/extconf.rb b/ext/-test-/memory_status/extconf.rb
deleted file mode 100644
index 1c1096d8f4..0000000000
--- a/ext/-test-/memory_status/extconf.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-case RUBY_PLATFORM
-when /darwin/
- ok = true
-when /mswin/, /mingw/
- func = "GetProcessMemoryInfo(0, 0, 0)"
- hdr = "psapi.h"
- ok = have_func(func, hdr) || have_library("psapi", func, hdr)
-end
-
-if ok
- create_makefile("-test-/memory_status")
-end
diff --git a/ext/-test-/memory_status/memory_status.c b/ext/-test-/memory_status/memory_status.c
deleted file mode 100644
index 23c4806472..0000000000
--- a/ext/-test-/memory_status/memory_status.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "ruby.h"
-#ifdef __APPLE__
-# include <mach/mach.h>
-# include <mach/message.h>
-# include <mach/kern_return.h>
-# include <mach/task_info.h>
-#elif defined _WIN32
-# include <psapi.h>
-#endif
-
-static VALUE cMemoryStatus;
-
-static VALUE
-read_status(VALUE self)
-{
- VALUE size = INT2FIX(0);
-#if defined __APPLE__
- VALUE rss;
- kern_return_t error;
-# if defined MACH_TASK_BASIC_INFO
- const task_flavor_t flavor = MACH_TASK_BASIC_INFO;
- mach_msg_type_number_t out_count = MACH_TASK_BASIC_INFO_COUNT;
- mach_task_basic_info_data_t taskinfo;
-# else
- const task_flavor_t flavor = TASK_BASIC_INFO;
- mach_msg_type_number_t out_count = TASK_BASIC_INFO_COUNT;
- task_basic_info_data_t taskinfo;
-# endif
-
- taskinfo.virtual_size = 0;
- taskinfo.resident_size = 0;
- error = task_info(mach_task_self(), flavor,
- (task_info_t)&taskinfo, &out_count);
- if (error != KERN_SUCCESS) return Qnil;
- size = ULL2NUM(taskinfo.virtual_size);
- rss = ULL2NUM(taskinfo.resident_size);
- rb_struct_aset(self, INT2FIX(1), rss);
-#elif defined _WIN32
- VALUE peak;
- PROCESS_MEMORY_COUNTERS c;
- c.cb = sizeof(c);
- if (!GetProcessMemoryInfo(GetCurrentProcess(), &c, c.cb))
- return Qnil;
- size = SIZET2NUM(c.PagefileUsage);
- peak = SIZET2NUM(c.PeakWorkingSetSize);
- rb_struct_aset(self, INT2FIX(1), peak);
-#endif
- rb_struct_aset(self, INT2FIX(0), size);
- return self;
-}
-
-void
-Init_memory_status(void)
-{
- VALUE mMemory = rb_define_module("Memory");
- cMemoryStatus =
- rb_struct_define_under(mMemory, "Status", "size",
-#if defined __APPLE__
- "rss",
-#elif defined _WIN32
- "peak",
-#endif
- (char *)NULL);
- rb_define_method(cMemoryStatus, "_update", read_status, 0);
-}
diff --git a/ext/-test-/method/extconf.rb b/ext/-test-/method/extconf.rb
index ca51178a18..658b7af1f1 100644
--- a/ext/-test-/method/extconf.rb
+++ b/ext/-test-/method/extconf.rb
@@ -1,3 +1,6 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext
+$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-/method")
diff --git a/ext/-test-/notimplement/bug.c b/ext/-test-/notimplement/bug.c
deleted file mode 100644
index 8e9cae707a..0000000000
--- a/ext/-test-/notimplement/bug.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <ruby.h>
-
-static VALUE
-bug_funcall(int argc, VALUE *argv, VALUE self)
-{
- if (argc < 1) rb_raise(rb_eArgError, "not enough argument");
- return rb_funcallv(self, rb_to_id(*argv), argc-1, argv+1);
-}
-
-void
-Init_notimplement(void)
-{
- VALUE mBug = rb_define_module("Bug");
- rb_define_module_function(mBug, "funcall", bug_funcall, -1);
- rb_define_module_function(mBug, "notimplement", rb_f_notimplement, -1);
-}
diff --git a/ext/-test-/notimplement/extconf.rb b/ext/-test-/notimplement/extconf.rb
deleted file mode 100644
index 54403cd7ce..0000000000
--- a/ext/-test-/notimplement/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: false
-create_makefile("-test-/notimplement")
diff --git a/ext/-test-/num2int/extconf.rb b/ext/-test-/num2int/extconf.rb
index 425f261f58..2bc820e480 100644
--- a/ext/-test-/num2int/extconf.rb
+++ b/ext/-test-/num2int/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/num2int")
+create_makefile("-test-/num2int/num2int")
diff --git a/ext/-test-/path_to_class/extconf.rb b/ext/-test-/path_to_class/extconf.rb
index d465b36d9c..e1072b1443 100644
--- a/ext/-test-/path_to_class/extconf.rb
+++ b/ext/-test-/path_to_class/extconf.rb
@@ -1,7 +1,6 @@
-# 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(' ')}\""
-create_makefile("-test-/path_to_class")
+create_makefile("-test-/path_to_class/path_to_class")
diff --git a/ext/-test-/popen_deadlock/extconf.rb b/ext/-test-/popen_deadlock/extconf.rb
deleted file mode 100644
index 24a7d79931..0000000000
--- a/ext/-test-/popen_deadlock/extconf.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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
deleted file mode 100644
index 1d95a7cc9a..0000000000
--- a/ext/-test-/popen_deadlock/infinite_loop_dlsym.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#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 58fbd3b461..aa29b593f4 100644
--- a/ext/-test-/postponed_job/extconf.rb
+++ b/ext/-test-/postponed_job/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile('-test-/postponed_job')
diff --git a/ext/-test-/printf/extconf.rb b/ext/-test-/printf/extconf.rb
index fb8fa8de36..7b96da0c85 100644
--- a/ext/-test-/printf/extconf.rb
+++ b/ext/-test-/printf/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/printf")
diff --git a/ext/-test-/printf/printf.c b/ext/-test-/printf/printf.c
index e793bb7a48..336f918986 100644
--- a/ext/-test-/printf/printf.c
+++ b/ext/-test-/printf/printf.c
@@ -2,6 +2,14 @@
#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);
@@ -20,7 +28,7 @@ printf_test_q(VALUE self, VALUE obj)
}
static char *
-uint_to_str(char *p, char *e, unsigned int x)
+utoa(char *p, char *e, unsigned int x)
{
char *e0 = e;
if (e <= p) return p;
@@ -71,12 +79,12 @@ printf_test_call(int argc, VALUE *argv, VALUE self)
*p++ = '0';
}
if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("width"))))) {
- p = uint_to_str(p, format + sizeof(format), NUM2UINT(v));
+ p = utoa(p, format + sizeof(format), NUM2UINT(v));
}
if (!NIL_P(v = rb_hash_aref(opt, ID2SYM(rb_intern("prec"))))) {
*p++ = '.';
if (FIXNUM_P(v))
- p = uint_to_str(p, format + sizeof(format), NUM2UINT(v));
+ p = utoa(p, format + sizeof(format), NUM2UINT(v));
}
}
*p++ = cnv;
@@ -90,20 +98,13 @@ printf_test_call(int argc, VALUE *argv, VALUE self)
return rb_assoc_new(result, rb_usascii_str_new_cstr(format));
}
-static VALUE
-snprintf_count(VALUE self, VALUE str)
-{
- int n = ruby_snprintf(NULL, 0, "%s", StringValueCStr(str));
- return INT2FIX(n);
-}
-
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);
rb_define_singleton_method(m, "call", printf_test_call, -1);
- rb_define_singleton_method(m, "sncount", snprintf_count, 1);
}
diff --git a/ext/-test-/proc/extconf.rb b/ext/-test-/proc/extconf.rb
deleted file mode 100644
index d786b15db9..0000000000
--- a/ext/-test-/proc/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
diff --git a/ext/-test-/proc/init.c b/ext/-test-/proc/init.c
deleted file mode 100644
index 814c55d98b..0000000000
--- a/ext/-test-/proc/init.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#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
deleted file mode 100644
index fe44a2246c..0000000000
--- a/ext/-test-/proc/receiver.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#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
deleted file mode 100644
index dbe8af08f1..0000000000
--- a/ext/-test-/proc/super.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#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 4f7c4e4900..a43589042b 100644
--- a/ext/-test-/rational/depend
+++ b/ext/-test-/rational/depend
@@ -1,22 +1,3 @@
$(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/backward.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/onigmo.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 28c5d690c1..bd658def46 100644
--- a/ext/-test-/rational/extconf.rb
+++ b/ext/-test-/rational/extconf.rb
@@ -1,4 +1,3 @@
-# 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 772546fca8..63ca849816 100644
--- a/ext/-test-/rational/rat.c
+++ b/ext/-test-/rational/rat.c
@@ -1,3 +1,4 @@
+#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 13828113f0..92b28657f0 100644
--- a/ext/-test-/recursion/extconf.rb
+++ b/ext/-test-/recursion/extconf.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: false
require 'mkmf'
create_makefile("-test-/recursion")
diff --git a/ext/-test-/regexp/extconf.rb b/ext/-test-/regexp/extconf.rb
deleted file mode 100644
index ca51178a18..0000000000
--- a/ext/-test-/regexp/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext
diff --git a/ext/-test-/regexp/init.c b/ext/-test-/regexp/init.c
deleted file mode 100644
index 906abe940f..0000000000
--- a/ext/-test-/regexp/init.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "ruby.h"
-
-#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
-
-void
-Init_regexp(void)
-{
- VALUE mBug = rb_define_module("Bug");
- VALUE klass = rb_define_class_under(mBug, "Regexp", rb_cRegexp);
- TEST_INIT_FUNCS(init);
-}
diff --git a/ext/-test-/regexp/parse_depth_limit.c b/ext/-test-/regexp/parse_depth_limit.c
deleted file mode 100644
index 8e08a5c789..0000000000
--- a/ext/-test-/regexp/parse_depth_limit.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <ruby.h>
-#include <ruby/onigmo.h>
-
-static VALUE
-get_parse_depth_limit(VALUE self)
-{
- unsigned int depth = onig_get_parse_depth_limit();
- return UINT2NUM(depth);
-}
-
-static VALUE
-set_parse_depth_limit(VALUE self, VALUE depth)
-{
- onig_set_parse_depth_limit(NUM2UINT(depth));
- return depth;
-}
-
-void
-Init_parse_depth_limit(VALUE klass)
-{
- rb_define_singleton_method(klass, "parse_depth_limit", get_parse_depth_limit, 0);
- rb_define_singleton_method(klass, "parse_depth_limit=", set_parse_depth_limit, 1);
-}
diff --git a/ext/-test-/scan_args/extconf.rb b/ext/-test-/scan_args/extconf.rb
deleted file mode 100755
index 6cae9c2779..0000000000
--- a/ext/-test-/scan_args/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile("-test-/scan_args")
diff --git a/ext/-test-/scan_args/scan_args.c b/ext/-test-/scan_args/scan_args.c
deleted file mode 100644
index dca353f643..0000000000
--- a/ext/-test-/scan_args/scan_args.c
+++ /dev/null
@@ -1,286 +0,0 @@
-#include <ruby.h>
-
-#ifndef numberof
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-#endif
-
-static VALUE
-scan_args_lead(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[2];
- int n = rb_scan_args(argc, argv, "1", args+1);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[2];
- int n = rb_scan_args(argc, argv, "01", args+1);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "11", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-/* var */
-static VALUE
-scan_args_var(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[2];
- int n = rb_scan_args(argc, argv, "*", args+1);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_var(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "1*", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_var(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "01*", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_var(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "11*", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-/* trail */
-static VALUE
-scan_args_opt_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "011", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "111", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_var_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "*1", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_var_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "1*1", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_var_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "01*1", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_var_trail(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[5];
- int n = rb_scan_args(argc, argv, "11*1", args+1, args+2, args+3, args+4);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-/* hash */
-static VALUE
-scan_args_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[2];
- int n = rb_scan_args(argc, argv, ":", args+1);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "1:", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "01:", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "11:", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_var_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n = rb_scan_args(argc, argv, "*:", args+1, args+2);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_var_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "1*:", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_var_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "01*:", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_var_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[5];
- int n = rb_scan_args(argc, argv, "11*:", args+1, args+2, args+3, args+4);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "011:", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[5];
- int n = rb_scan_args(argc, argv, "111:", args+1, args+2, args+3, args+4);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_var_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args(argc, argv, "*1:", args+1, args+2, args+3);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_var_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[5];
- int n = rb_scan_args(argc, argv, "1*1:", args+1, args+2, args+3, args+4);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_opt_var_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[5];
- int n = rb_scan_args(argc, argv, "01*1:", args+1, args+2, args+3, args+4);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-static VALUE
-scan_args_lead_opt_var_trail_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[6];
- int n = rb_scan_args(argc, argv, "11*1:", args+1, args+2, args+3, args+4, args+5);
- args[0] = INT2NUM(n);
- return rb_ary_new_from_values(numberof(args), args);
-}
-
-void
-Init_scan_args(void)
-{
- VALUE module = rb_define_module("Bug");
- module = rb_define_module_under(module, "ScanArgs");
- rb_define_singleton_method(module, "lead", scan_args_lead, -1);
- rb_define_singleton_method(module, "opt", scan_args_opt, -1);
- rb_define_singleton_method(module, "lead_opt", scan_args_lead_opt, -1);
- rb_define_singleton_method(module, "var", scan_args_var, -1);
- rb_define_singleton_method(module, "lead_var", scan_args_lead_var, -1);
- rb_define_singleton_method(module, "opt_var", scan_args_opt_var, -1);
- rb_define_singleton_method(module, "lead_opt_var", scan_args_lead_opt_var, -1);
- rb_define_singleton_method(module, "opt_trail", scan_args_opt_trail, -1);
- rb_define_singleton_method(module, "lead_opt_trail", scan_args_lead_opt_trail, -1);
- rb_define_singleton_method(module, "var_trail", scan_args_var_trail, -1);
- rb_define_singleton_method(module, "lead_var_trail", scan_args_lead_var_trail, -1);
- rb_define_singleton_method(module, "opt_var_trail", scan_args_opt_var_trail, -1);
- rb_define_singleton_method(module, "lead_opt_var_trail", scan_args_lead_opt_var_trail, -1);
- rb_define_singleton_method(module, "hash", scan_args_hash, -1);
- rb_define_singleton_method(module, "lead_hash", scan_args_lead_hash, -1);
- rb_define_singleton_method(module, "opt_hash", scan_args_opt_hash, -1);
- rb_define_singleton_method(module, "lead_opt_hash", scan_args_lead_opt_hash, -1);
- rb_define_singleton_method(module, "var_hash", scan_args_var_hash, -1);
- rb_define_singleton_method(module, "lead_var_hash", scan_args_lead_var_hash, -1);
- rb_define_singleton_method(module, "opt_var_hash", scan_args_opt_var_hash, -1);
- rb_define_singleton_method(module, "lead_opt_var_hash", scan_args_lead_opt_var_hash, -1);
- rb_define_singleton_method(module, "opt_trail_hash", scan_args_opt_trail_hash, -1);
- rb_define_singleton_method(module, "lead_opt_trail_hash", scan_args_lead_opt_trail_hash, -1);
- rb_define_singleton_method(module, "var_trail_hash", scan_args_var_trail_hash, -1);
- rb_define_singleton_method(module, "lead_var_trail_hash", scan_args_lead_var_trail_hash, -1);
- rb_define_singleton_method(module, "opt_var_trail_hash", scan_args_opt_var_trail_hash, -1);
- rb_define_singleton_method(module, "lead_opt_var_trail_hash", scan_args_lead_opt_var_trail_hash, -1);
-}
-
diff --git a/ext/-test-/st/foreach/extconf.rb b/ext/-test-/st/foreach/extconf.rb
deleted file mode 100644
index a7346203c4..0000000000
--- a/ext/-test-/st/foreach/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# 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
deleted file mode 100644
index 209b535503..0000000000
--- a/ext/-test-/st/foreach/foreach.c
+++ /dev/null
@@ -1,175 +0,0 @@
-#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->bins != NULL) 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->bins == NULL) 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->bins != NULL) 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->bins == NULL) 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->bins != NULL) 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->bins == NULL) 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 27d28a0a77..867fd75d2a 100644
--- a/ext/-test-/st/numhash/extconf.rb
+++ b/ext/-test-/st/numhash/extconf.rb
@@ -1,2 +1 @@
-# 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 fc35f476cd..d4dbd1a0ce 100644
--- a/ext/-test-/st/numhash/numhash.c
+++ b/ext/-test-/st/numhash/numhash.c
@@ -7,29 +7,16 @@ 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 TypedData_Wrap_Struct(klass, &numhash_type, 0);
+ return Data_Wrap_Struct(klass, 0, numhash_free, 0);
}
static VALUE
numhash_init(VALUE self)
{
- st_table *tbl = (st_table *)Check_TypedStruct(self, &numhash_type);
+ st_table *tbl = (st_table *)DATA_PTR(self);
if (tbl) st_free_table(tbl);
DATA_PTR(self) = st_init_numtable();
return self;
@@ -39,9 +26,8 @@ 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(tbl, (st_data_t)key, &data))
+ if (st_lookup((st_table *)DATA_PTR(self), (st_data_t)key, &data))
return (VALUE)data;
return Qnil;
}
@@ -49,10 +35,9 @@ 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(tbl, (st_data_t)key, (st_data_t)data);
+ st_insert((st_table *)DATA_PTR(self), (st_data_t)key, (st_data_t)data);
return self;
}
@@ -68,7 +53,7 @@ numhash_i(st_data_t key, st_data_t value, st_data_t arg)
static VALUE
numhash_each(VALUE self)
{
- st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
+ st_table *table = DATA_PTR(self);
st_data_t data = (st_data_t)self;
return st_foreach_check(table, numhash_i, data, data) ? Qtrue : Qfalse;
}
@@ -91,8 +76,7 @@ update_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
static VALUE
numhash_update(VALUE self, VALUE key)
{
- st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
- if (st_update(table, (st_data_t)key, update_func, 0))
+ if (st_update((st_table *)DATA_PTR(self), (st_data_t)key, update_func, 0))
return Qtrue;
else
return Qfalse;
@@ -107,16 +91,14 @@ numhash_update(VALUE self, VALUE key)
static VALUE
numhash_size(VALUE self)
{
- st_table *table = (st_table *)Check_TypedStruct(self, &numhash_type);
- return ST2NUM(table->num_entries);
+ return ST2NUM(((st_table *)DATA_PTR(self))->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(table, &k, &val, (st_data_t)self)) {
+ if (st_delete_safe((st_table *)DATA_PTR(self), &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 5152b24229..96dbae43ab 100644
--- a/ext/-test-/st/update/extconf.rb
+++ b/ext/-test-/st/update/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/st/update")
diff --git a/ext/-test-/string/capacity.c b/ext/-test-/string/capacity.c
deleted file mode 100644
index f5277bf4e6..0000000000
--- a/ext/-test-/string/capacity.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "ruby.h"
-#include "internal.h"
-
-static VALUE
-bug_str_capacity(VALUE klass, VALUE str)
-{
- return
- STR_EMBED_P(str) ? INT2FIX(RSTRING_EMBED_LEN_MAX) : \
- STR_SHARED_P(str) ? INT2FIX(0) : \
- LONG2FIX(RSTRING(str)->as.heap.aux.capa);
-}
-
-void
-Init_string_capacity(VALUE klass)
-{
- rb_define_singleton_method(klass, "capacity", bug_str_capacity, 1);
-}
diff --git a/ext/-test-/string/coderange.c b/ext/-test-/string/coderange.c
index df83fb5d44..b93172d72d 100644
--- a/ext/-test-/string/coderange.c
+++ b/ext/-test-/string/coderange.c
@@ -36,7 +36,7 @@ str_coderange_scan(VALUE str)
}
void
-Init_string_coderange(VALUE klass)
+Init_coderange(VALUE klass)
{
sym_7bit = ID2SYM(rb_intern("7bit"));
sym_valid = ID2SYM(rb_intern("valid"));
diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c
index 2a41b932db..c2ed410b41 100644
--- a/ext/-test-/string/cstr.c
+++ b/ext/-test-/string/cstr.c
@@ -1,4 +1,5 @@
-#include "internal.h"
+#include "ruby.h"
+#include "ruby/encoding.h"
static VALUE
bug_str_cstr_term(VALUE str)
@@ -8,7 +9,9 @@ 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);
@@ -16,131 +19,8 @@ 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_unterminated_substring(VALUE str, VALUE vbeg, VALUE vlen)
-{
- long beg = NUM2LONG(vbeg);
- long len = NUM2LONG(vlen);
- rb_str_modify(str);
- if (len < 0) rb_raise(rb_eArgError, "negative length: %ld", len);
- if (RSTRING_LEN(str) < beg) rb_raise(rb_eIndexError, "beg: %ld", beg);
- if (RSTRING_LEN(str) < beg + len) rb_raise(rb_eIndexError, "end: %ld", beg + len);
- str = rb_str_new_shared(str);
- if (STR_EMBED_P(str)) {
- RSTRING(str)->basic.flags &= ~RSTRING_EMBED_LEN_MASK;
- RSTRING(str)->basic.flags |= len << RSTRING_EMBED_LEN_SHIFT;
- memmove(RSTRING(str)->as.ary, RSTRING(str)->as.ary + beg, len);
- }
- else {
- RSTRING(str)->as.heap.ptr += beg;
- RSTRING(str)->as.heap.len = len;
- }
- return str;
-}
-
-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_string_cstr(VALUE klass)
+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_method(klass, "unterminated_substring", bug_str_unterminated_substring, 2);
- 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 71e995a523..86617ff289 100644
--- a/ext/-test-/string/depend
+++ b/ext/-test-/string/depend
@@ -1,198 +1,5 @@
-# AUTOGENERATED DEPENDENCIES START
-capacity.o: $(RUBY_EXTCONF_H)
-capacity.o: $(arch_hdrdir)/ruby/config.h
-capacity.o: $(hdrdir)/ruby/backward.h
-capacity.o: $(hdrdir)/ruby/defines.h
-capacity.o: $(hdrdir)/ruby/encoding.h
-capacity.o: $(hdrdir)/ruby/intern.h
-capacity.o: $(hdrdir)/ruby/io.h
-capacity.o: $(hdrdir)/ruby/missing.h
-capacity.o: $(hdrdir)/ruby/onigmo.h
-capacity.o: $(hdrdir)/ruby/oniguruma.h
-capacity.o: $(hdrdir)/ruby/ruby.h
-capacity.o: $(hdrdir)/ruby/st.h
-capacity.o: $(hdrdir)/ruby/subst.h
-capacity.o: $(top_srcdir)/include/ruby.h
-capacity.o: $(top_srcdir)/internal.h
-capacity.o: capacity.c
-coderange.o: $(RUBY_EXTCONF_H)
-coderange.o: $(arch_hdrdir)/ruby/config.h
-coderange.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.h
-cstr.o: $(hdrdir)/ruby/defines.h
-cstr.o: $(hdrdir)/ruby/encoding.h
-cstr.o: $(hdrdir)/ruby/intern.h
-cstr.o: $(hdrdir)/ruby/io.h
-cstr.o: $(hdrdir)/ruby/missing.h
-cstr.o: $(hdrdir)/ruby/onigmo.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: $(top_srcdir)/internal.h
-cstr.o: cstr.c
-ellipsize.o: $(RUBY_EXTCONF_H)
-ellipsize.o: $(arch_hdrdir)/ruby/config.h
-ellipsize.o: $(hdrdir)/ruby/backward.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/backward.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/onigmo.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/backward.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/onigmo.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
-fstring.o: $(RUBY_EXTCONF_H)
-fstring.o: $(arch_hdrdir)/ruby/config.h
-fstring.o: $(hdrdir)/ruby/backward.h
-fstring.o: $(hdrdir)/ruby/defines.h
-fstring.o: $(hdrdir)/ruby/intern.h
-fstring.o: $(hdrdir)/ruby/missing.h
-fstring.o: $(hdrdir)/ruby/ruby.h
-fstring.o: $(hdrdir)/ruby/st.h
-fstring.o: $(hdrdir)/ruby/subst.h
-fstring.o: $(top_srcdir)/include/ruby.h
-fstring.o: fstring.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby/backward.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/backward.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
-new.o: $(RUBY_EXTCONF_H)
-new.o: $(arch_hdrdir)/ruby/config.h
-new.o: $(hdrdir)/ruby/backward.h
-new.o: $(hdrdir)/ruby/defines.h
-new.o: $(hdrdir)/ruby/encoding.h
-new.o: $(hdrdir)/ruby/intern.h
-new.o: $(hdrdir)/ruby/io.h
-new.o: $(hdrdir)/ruby/missing.h
-new.o: $(hdrdir)/ruby/onigmo.h
-new.o: $(hdrdir)/ruby/oniguruma.h
-new.o: $(hdrdir)/ruby/ruby.h
-new.o: $(hdrdir)/ruby/st.h
-new.o: $(hdrdir)/ruby/subst.h
-new.o: $(top_srcdir)/include/ruby.h
-new.o: $(top_srcdir)/internal.h
-new.o: new.c
-nofree.o: $(RUBY_EXTCONF_H)
-nofree.o: $(arch_hdrdir)/ruby/config.h
-nofree.o: $(hdrdir)/ruby/backward.h
-nofree.o: $(hdrdir)/ruby/defines.h
-nofree.o: $(hdrdir)/ruby/intern.h
-nofree.o: $(hdrdir)/ruby/missing.h
-nofree.o: $(hdrdir)/ruby/ruby.h
-nofree.o: $(hdrdir)/ruby/st.h
-nofree.o: $(hdrdir)/ruby/subst.h
-nofree.o: $(top_srcdir)/include/ruby.h
-nofree.o: nofree.c
-normalize.o: $(RUBY_EXTCONF_H)
-normalize.o: $(arch_hdrdir)/ruby/config.h
-normalize.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.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/onigmo.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
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
qsort.o: $(hdrdir)/ruby/util.h
-qsort.o: $(top_srcdir)/include/ruby.h
-qsort.o: qsort.c
-rb_str_dup.o: $(RUBY_EXTCONF_H)
-rb_str_dup.o: $(arch_hdrdir)/ruby/config.h
-rb_str_dup.o: $(hdrdir)/ruby.h
-rb_str_dup.o: $(hdrdir)/ruby/backward.h
-rb_str_dup.o: $(hdrdir)/ruby/defines.h
-rb_str_dup.o: $(hdrdir)/ruby/intern.h
-rb_str_dup.o: $(hdrdir)/ruby/missing.h
-rb_str_dup.o: $(hdrdir)/ruby/ruby.h
-rb_str_dup.o: $(hdrdir)/ruby/st.h
-rb_str_dup.o: $(hdrdir)/ruby/subst.h
-rb_str_dup.o: rb_str_dup.c
-set_len.o: $(RUBY_EXTCONF_H)
-set_len.o: $(arch_hdrdir)/ruby/config.h
-set_len.o: $(hdrdir)/ruby/backward.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
+normalize.o: $(top_srcdir)/internal.h
diff --git a/ext/-test-/string/ellipsize.c b/ext/-test-/string/ellipsize.c
index 6034408724..0451519492 100644
--- a/ext/-test-/string/ellipsize.c
+++ b/ext/-test-/string/ellipsize.c
@@ -7,7 +7,7 @@ bug_str_ellipsize(VALUE str, VALUE len)
}
void
-Init_string_ellipsize(VALUE klass)
+Init_ellipsize(VALUE klass)
{
rb_define_method(klass, "ellipsize", bug_str_ellipsize, 1);
}
diff --git a/ext/-test-/string/enc_associate.c b/ext/-test-/string/enc_associate.c
index 594d8a43a4..d6614fb298 100644
--- a/ext/-test-/string/enc_associate.c
+++ b/ext/-test-/string/enc_associate.c
@@ -7,16 +7,8 @@ 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_string_enc_associate(VALUE klass)
+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/enc_str_buf_cat.c b/ext/-test-/string/enc_str_buf_cat.c
index 9ac4a298be..5d583c65dc 100644
--- a/ext/-test-/string/enc_str_buf_cat.c
+++ b/ext/-test-/string/enc_str_buf_cat.c
@@ -8,7 +8,7 @@ enc_str_buf_cat(VALUE str, VALUE str2)
}
void
-Init_string_enc_str_buf_cat(VALUE klass)
+Init_enc_str_buf_cat(VALUE klass)
{
rb_define_method(klass, "enc_str_buf_cat", enc_str_buf_cat, 1);
}
diff --git a/ext/-test-/string/extconf.rb b/ext/-test-/string/extconf.rb
index d786b15db9..10d33cbab9 100644
--- a/ext/-test-/string/extconf.rb
+++ b/ext/-test-/string/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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")
diff --git a/ext/-test-/string/fstring.c b/ext/-test-/string/fstring.c
deleted file mode 100644
index 30120b42f6..0000000000
--- a/ext/-test-/string/fstring.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "ruby.h"
-
-VALUE rb_fstring(VALUE str);
-
-VALUE
-bug_s_fstring(VALUE self, VALUE str)
-{
- return rb_fstring(str);
-}
-
-void
-Init_string_fstring(VALUE klass)
-{
- rb_define_singleton_method(klass, "fstring", bug_s_fstring, 1);
-}
diff --git a/ext/-test-/string/init.c b/ext/-test-/string/init.c
index a74245c8d7..0b3e4a6ff2 100644
--- a/ext/-test-/string/init.c
+++ b/ext/-test-/string/init.c
@@ -1,6 +1,6 @@
#include "ruby.h"
-#define init(n) {void Init_string_##n(VALUE klass); Init_string_##n(klass);}
+#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
void
Init_string(void)
diff --git a/ext/-test-/string/modify.c b/ext/-test-/string/modify.c
index 945febc7e3..ddd2efd8f0 100644
--- a/ext/-test-/string/modify.c
+++ b/ext/-test-/string/modify.c
@@ -15,7 +15,7 @@ bug_str_modify_expand(VALUE str, VALUE expand)
}
void
-Init_string_modify(VALUE klass)
+Init_modify(VALUE klass)
{
rb_define_method(klass, "modify!", bug_str_modify, 0);
rb_define_method(klass, "modify_expand!", bug_str_modify_expand, 1);
diff --git a/ext/-test-/string/new.c b/ext/-test-/string/new.c
deleted file mode 100644
index 60625b8300..0000000000
--- a/ext/-test-/string/new.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "ruby.h"
-#include "ruby/encoding.h"
-
-static VALUE
-bug_str_buf_new(VALUE self, VALUE len)
-{
- return rb_str_buf_new(NUM2LONG(len));
-}
-
-static VALUE
-bug_external_str_new(VALUE self, VALUE len, VALUE enc)
-{
- return rb_external_str_new_with_enc(NULL, NUM2LONG(len), rb_to_encoding(enc));
-}
-
-void
-Init_string_new(VALUE klass)
-{
- rb_define_singleton_method(klass, "buf_new", bug_str_buf_new, 1);
- rb_define_singleton_method(klass, "external_new", bug_external_str_new, 2);
-}
diff --git a/ext/-test-/string/nofree.c b/ext/-test-/string/nofree.c
deleted file mode 100644
index fdf810c741..0000000000
--- a/ext/-test-/string/nofree.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "ruby.h"
-
-VALUE
-bug_str_nofree(VALUE self)
-{
- return rb_str_new_cstr("abcdef");
-}
-
-void
-Init_string_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 0ba1797631..22bb6d7887 100644
--- a/ext/-test-/string/normalize.c
+++ b/ext/-test-/string/normalize.c
@@ -1,3 +1,4 @@
+#include "ruby.h"
#include "internal.h"
#ifdef __APPLE__
@@ -11,7 +12,7 @@ normalize_ospath(VALUE str)
#endif
void
-Init_string_normalize(VALUE klass)
+Init_normalize(VALUE klass)
{
rb_define_method(klass, "normalize_ospath", normalize_ospath, 0);
}
diff --git a/ext/-test-/string/qsort.c b/ext/-test-/string/qsort.c
index fb7ea3d8cb..0b34936d38 100644
--- a/ext/-test-/string/qsort.c
+++ b/ext/-test-/string/qsort.c
@@ -55,7 +55,7 @@ bug_str_qsort_bang(int argc, VALUE *argv, VALUE str)
}
void
-Init_string_qsort(VALUE klass)
+Init_qsort(VALUE klass)
{
rb_define_method(klass, "qsort!", bug_str_qsort_bang, -1);
}
diff --git a/ext/-test-/string/rb_str_dup.c b/ext/-test-/string/rb_str_dup.c
deleted file mode 100644
index a0bd65820f..0000000000
--- a/ext/-test-/string/rb_str_dup.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "ruby.h"
-
-VALUE rb_str_dup(VALUE str);
-
-static VALUE
-bug_rb_str_dup(VALUE self, VALUE str)
-{
- rb_check_type(str, T_STRING);
- return rb_str_dup(str);
-}
-
-static VALUE
-bug_shared_string_p(VALUE self, VALUE str)
-{
- rb_check_type(str, T_STRING);
- return RB_FL_TEST(str, RUBY_ELTS_SHARED) && RB_FL_TEST(str, RSTRING_NOEMBED) ? Qtrue : Qfalse;
-}
-
-static VALUE
-bug_sharing_with_shared_p(VALUE self, VALUE str)
-{
- rb_check_type(str, T_STRING);
- if (bug_shared_string_p(self, str)) {
- return bug_shared_string_p(self, RSTRING(str)->as.heap.aux.shared);
- }
- return Qfalse;
-}
-
-void
-Init_string_rb_str_dup(VALUE klass)
-{
- rb_define_singleton_method(klass, "rb_str_dup", bug_rb_str_dup, 1);
- rb_define_singleton_method(klass, "shared_string?", bug_shared_string_p, 1);
- rb_define_singleton_method(klass, "sharing_with_shared?", bug_sharing_with_shared_p, 1);
-}
diff --git a/ext/-test-/string/set_len.c b/ext/-test-/string/set_len.c
index 219cea404c..3c7d19d778 100644
--- a/ext/-test-/string/set_len.c
+++ b/ext/-test-/string/set_len.c
@@ -8,7 +8,7 @@ bug_str_set_len(VALUE str, VALUE len)
}
void
-Init_string_set_len(VALUE klass)
+Init_set_len(VALUE klass)
{
rb_define_method(klass, "set_len", bug_str_set_len, 1);
}
diff --git a/ext/-test-/struct/depend b/ext/-test-/struct/depend
deleted file mode 100644
index 58ededbff9..0000000000
--- a/ext/-test-/struct/depend
+++ /dev/null
@@ -1,46 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-duplicate.o: $(RUBY_EXTCONF_H)
-duplicate.o: $(arch_hdrdir)/ruby/config.h
-duplicate.o: $(hdrdir)/ruby/backward.h
-duplicate.o: $(hdrdir)/ruby/defines.h
-duplicate.o: $(hdrdir)/ruby/intern.h
-duplicate.o: $(hdrdir)/ruby/missing.h
-duplicate.o: $(hdrdir)/ruby/ruby.h
-duplicate.o: $(hdrdir)/ruby/st.h
-duplicate.o: $(hdrdir)/ruby/subst.h
-duplicate.o: $(top_srcdir)/include/ruby.h
-duplicate.o: duplicate.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby/backward.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
-len.o: $(RUBY_EXTCONF_H)
-len.o: $(arch_hdrdir)/ruby/config.h
-len.o: $(hdrdir)/ruby/backward.h
-len.o: $(hdrdir)/ruby/defines.h
-len.o: $(hdrdir)/ruby/intern.h
-len.o: $(hdrdir)/ruby/missing.h
-len.o: $(hdrdir)/ruby/ruby.h
-len.o: $(hdrdir)/ruby/st.h
-len.o: $(hdrdir)/ruby/subst.h
-len.o: $(top_srcdir)/include/ruby.h
-len.o: len.c
-member.o: $(RUBY_EXTCONF_H)
-member.o: $(arch_hdrdir)/ruby/config.h
-member.o: $(hdrdir)/ruby/backward.h
-member.o: $(hdrdir)/ruby/defines.h
-member.o: $(hdrdir)/ruby/intern.h
-member.o: $(hdrdir)/ruby/missing.h
-member.o: $(hdrdir)/ruby/ruby.h
-member.o: $(hdrdir)/ruby/st.h
-member.o: $(hdrdir)/ruby/subst.h
-member.o: $(top_srcdir)/include/ruby.h
-member.o: member.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/struct/duplicate.c b/ext/-test-/struct/duplicate.c
deleted file mode 100644
index 596d32aad8..0000000000
--- a/ext/-test-/struct/duplicate.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#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
index d786b15db9..0e4f9551f2 100644
--- a/ext/-test-/struct/extconf.rb
+++ b/ext/-test-/struct/extconf.rb
@@ -1,3 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
+$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/len.c b/ext/-test-/struct/len.c
deleted file mode 100644
index 6153c720b2..0000000000
--- a/ext/-test-/struct/len.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "ruby.h"
-
-static VALUE
-bug_struct_len(VALUE obj)
-{
- return LONG2NUM(RSTRUCT_LEN(obj));
-}
-
-void
-Init_len(VALUE klass)
-{
- rb_define_method(klass, "rstruct_len", bug_struct_len, 0);
-}
diff --git a/ext/-test-/symbol/extconf.rb b/ext/-test-/symbol/extconf.rb
index ecebdb7d6b..fc00ec9abf 100644
--- a/ext/-test-/symbol/extconf.rb
+++ b/ext/-test-/symbol/extconf.rb
@@ -1,4 +1,7 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
+$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")
-auto_ext
+create_makefile("-test-/symbol")
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
index 20cf2fa079..3b7cf15899 100644
--- a/ext/-test-/symbol/init.c
+++ b/ext/-test-/symbol/init.c
@@ -8,24 +8,11 @@ sym_find(VALUE dummy, VALUE sym)
return rb_check_symbol(&sym);
}
-static VALUE
-sym_pinneddown_p(VALUE dummy, VALUE sym)
-{
- ID id = rb_check_id(&sym);
- if (!id) return Qnil;
-#ifdef ULL2NUM
- return ULL2NUM(id);
-#else
- return ULONG2NUM(id);
-#endif
-}
-
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-/thread_fd_close/depend b/ext/-test-/thread_fd_close/depend
deleted file mode 100644
index 7bc04c3db3..0000000000
--- a/ext/-test-/thread_fd_close/depend
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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/backward.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/onigmo.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
deleted file mode 100644
index 0d9694539c..0000000000
--- a/ext/-test-/thread_fd_close/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# 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
deleted file mode 100644
index 4fd967c5b3..0000000000
--- a/ext/-test-/thread_fd_close/thread_fd_close.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#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
deleted file mode 100644
index d786b15db9..0000000000
--- a/ext/-test-/time/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
-auto_ext(inc: true)
diff --git a/ext/-test-/time/init.c b/ext/-test-/time/init.c
deleted file mode 100644
index 91f8bf825b..0000000000
--- a/ext/-test-/time/init.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "ruby.h"
-
-#define init(n) {void Init_time_##n(VALUE klass); Init_time_##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
deleted file mode 100644
index 6f894417b6..0000000000
--- a/ext/-test-/time/new.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#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_time_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 5b2b2f7369..8d4e5ab343 100644
--- a/ext/-test-/tracepoint/depend
+++ b/ext/-test-/tracepoint/depend
@@ -1,24 +1 @@
-# AUTOGENERATED DEPENDENCIES START
-gc_hook.o: $(RUBY_EXTCONF_H)
-gc_hook.o: $(arch_hdrdir)/ruby/config.h
-gc_hook.o: $(hdrdir)/ruby/backward.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/backward.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
+tracepoint.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
diff --git a/ext/-test-/tracepoint/extconf.rb b/ext/-test-/tracepoint/extconf.rb
index 2b7258d072..c0c2399eb4 100644
--- a/ext/-test-/tracepoint/extconf.rb
+++ b/ext/-test-/tracepoint/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/tracepoint")
diff --git a/ext/-test-/typeddata/extconf.rb b/ext/-test-/typeddata/extconf.rb
index 731701111b..02e3e41c8b 100644
--- a/ext/-test-/typeddata/extconf.rb
+++ b/ext/-test-/typeddata/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/typeddata")
+create_makefile("-test-/typeddata/typeddata")
diff --git a/ext/-test-/typeddata/typeddata.c b/ext/-test-/typeddata/typeddata.c
index ae060960cd..1c5d677713 100644
--- a/ext/-test-/typeddata/typeddata.c
+++ b/ext/-test-/typeddata/typeddata.c
@@ -2,43 +2,19 @@
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
deleted file mode 100644
index 6cfbfafa9e..0000000000
--- a/ext/-test-/vm/at_exit.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#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/depend b/ext/-test-/vm/depend
deleted file mode 100644
index dd56dd0e0d..0000000000
--- a/ext/-test-/vm/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-at_exit.o: $(RUBY_EXTCONF_H)
-at_exit.o: $(arch_hdrdir)/ruby/config.h
-at_exit.o: $(hdrdir)/ruby/backward.h
-at_exit.o: $(hdrdir)/ruby/defines.h
-at_exit.o: $(hdrdir)/ruby/intern.h
-at_exit.o: $(hdrdir)/ruby/missing.h
-at_exit.o: $(hdrdir)/ruby/ruby.h
-at_exit.o: $(hdrdir)/ruby/st.h
-at_exit.o: $(hdrdir)/ruby/subst.h
-at_exit.o: $(hdrdir)/ruby/vm.h
-at_exit.o: at_exit.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/vm/extconf.rb b/ext/-test-/vm/extconf.rb
deleted file mode 100644
index 614ec960d8..0000000000
--- a/ext/-test-/vm/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-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 edd2f88dcf..b94e507631 100644
--- a/ext/-test-/wait_for_single_fd/depend
+++ b/ext/-test-/wait_for_single_fd/depend
@@ -1,16 +1,4 @@
-# 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/backward.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/onigmo.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
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h \
+ $(hdrdir)/ruby/io.h
diff --git a/ext/-test-/wait_for_single_fd/extconf.rb b/ext/-test-/wait_for_single_fd/extconf.rb
index 931662c040..1a28b23da3 100644
--- a/ext/-test-/wait_for_single_fd/extconf.rb
+++ b/ext/-test-/wait_for_single_fd/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/wait_for_single_fd")
+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
index 6d706fbfe7..8941272ea7 100644
--- a/ext/-test-/win32/console/attribute.c
+++ b/ext/-test-/win32/console/attribute.c
@@ -2,38 +2,30 @@
static VALUE rb_cConsoleScreenBufferInfo;
-static HANDLE
-io_handle(VALUE io)
-{
- 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");
- return h;
-}
-
static VALUE
console_info(VALUE io)
{
- HANDLE h = io_handle(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.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)
{
- HANDLE h = io_handle(io);
+ int fd = NUM2INT(rb_funcallv(io, rb_intern("fileno"), 0, 0));
+ HANDLE h = (HANDLE)rb_w32_get_osfhandle(fd);
- SetConsoleTextAttribute(h, (WORD)NUM2INT(attr));
+ if (h == (HANDLE)-1) rb_raise(rb_eIOError, "invalid io");
+ SetConsoleTextAttribute(h, NUM2INT(attr));
return Qnil;
}
diff --git a/ext/-test-/win32/console/extconf.rb b/ext/-test-/win32/console/extconf.rb
index 5162172890..4de9fa7e4f 100644
--- a/ext/-test-/win32/console/extconf.rb
+++ b/ext/-test-/win32/console/extconf.rb
@@ -1,5 +1,8 @@
-# frozen_string_literal: false
if $mingw or $mswin
- require_relative "../../auto_ext.rb"
- auto_ext
+ $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/dln/depend b/ext/-test-/win32/dln/depend
deleted file mode 100644
index c3f14db4f7..0000000000
--- a/ext/-test-/win32/dln/depend
+++ /dev/null
@@ -1,9 +0,0 @@
-$(TARGET_SO): $(DLNTESTLIB)
-
-$(DLNTESTLIB): dlntest.dll
-
-dlntest.dll: libdlntest.o libdlntest.def
- $(ECHO) linking shared-object $(@F)
- -$(Q)$(RM) $@
- -$(Q)$(MAKEDIRS) $(@D)
- $(Q) $(DLNTEST_LDSHARED)
diff --git a/ext/-test-/dln/empty/empty.c b/ext/-test-/win32/dln/empty/empty.c
index c4f94f1644..c4f94f1644 100644
--- a/ext/-test-/dln/empty/empty.c
+++ b/ext/-test-/win32/dln/empty/empty.c
diff --git a/ext/-test-/win32/dln/empty/extconf.rb b/ext/-test-/win32/dln/empty/extconf.rb
new file mode 100644
index 0000000000..a4efed90c9
--- /dev/null
+++ b/ext/-test-/win32/dln/empty/extconf.rb
@@ -0,0 +1,3 @@
+if $mingw or $mswin
+ create_makefile("-test-/win32/dln/empty")
+end
diff --git a/ext/-test-/win32/dln/extconf.rb b/ext/-test-/win32/dln/extconf.rb
index d72b6a868c..57cee23b40 100644
--- a/ext/-test-/win32/dln/extconf.rb
+++ b/ext/-test-/win32/dln/extconf.rb
@@ -1,33 +1,37 @@
-# frozen_string_literal: false
if $mingw or $mswin
- dlntestlib = "dlntest.#{$LIBEXT}"
- $LOCAL_LIBS << " #{dlntestlib}"
- $srcs = ["dlntest.c"]
$objs = ["dlntest.o"]
- testdll = "dlntest.dll"
+ testdll = "$(topdir)/dlntest.dll"
$cleanfiles << testdll
$cleanfiles << "dlntest.#{$LIBEXT}"
config_string('cleanobjs') {|t| $cleanfiles.concat(t.gsub(/\$\*/, 'dlntest').split)}
- create_makefile("-test-/win32/dln") do |m|
- m << "\n""DLNTESTLIB = #{dlntestlib}\n"
+ create_makefile("-test-/win32/dln")
+ m = File.read("Makefile")
+ dlntestlib = "dlntest.#{$LIBEXT}"
+ m.sub!(/^OBJS =.*/) {"#{$&} #{dlntestlib}"}
+ FileUtils.rm_f(RbConfig.expand(testdll.dup))
+ open("Makefile", "wb") do |mf|
+ mf.puts m, "\n"
+ sodir = $extout ? "$(RUBYARCHDIR)/" : ''
+ mf.print "#{sodir}$(DLLIB): #{dlntestlib}"
+ mf.puts
+ mf.puts "#{dlntestlib}: $(topdir)/dlntest.dll"
+ mf.puts
if $mingw
- m << "\n"
- m << "dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def\n"
- m << "dlntest.dll: DLDFLAGS += -Wl,--out-implib,$(DLNTESTLIB)\n"
+ mf.puts "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def"
+ mf.puts "$(topdir)/dlntest.dll: DLDFLAGS += -Wl,--out-implib,#{dlntestlib}"
end
- m
- end
- m = File.read("Makefile")
- m.sub!(/(.*)\$\(DLNTEST_LDSHARED\)$/) do
- pre = $1
- link_so = LINK_SO.gsub(/^/) {pre}
+ mf.puts depend_rules("$(topdir)/dlntest.dll: libdlntest.o libdlntest.def")
+ mf.puts "\t$(ECHO) linking shared-object $(@F)\n"
+ mf.print "\t-$(Q)$(RM) $@\n"
+ mf.print "\t-$(Q)$(MAKEDIRS) $(@D)\n" if $extout
+ link_so = LINK_SO.gsub(/^/, "\t$(Q) ")
link_so.sub!(/\$\(LOCAL_LIBS\)/, '')
link_so.gsub!(/-\$\(arch\)/, '')
link_so.gsub!(/:.so=/, ':.dll=')
link_so.sub!(/\$\(OBJS\)/, "libdlntest.#{$OBJEXT}")
link_so.sub!(/\$\(DEFFILE\)/, "$(srcdir)/libdlntest.def")
- link_so
- end and File.binwrite("Makefile", m)
- FileUtils.rm_f(RbConfig.expand(testdll.dup))
+ mf.puts link_so
+ mf.puts
+ end
end
diff --git a/ext/-test-/win32/fd_setsize/extconf.rb b/ext/-test-/win32/fd_setsize/extconf.rb
index caa4b85a1b..ed40f8b1d7 100644
--- a/ext/-test-/win32/fd_setsize/extconf.rb
+++ b/ext/-test-/win32/fd_setsize/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
if $mingw or $mswin
create_makefile("-test-/win32/fd_setsize")
end
diff --git a/ext/.document b/ext/.document
index 6a491576a1..2e6fc78879 100644
--- a/ext/.document
+++ b/ext/.document
@@ -13,6 +13,12 @@ digest/md5/md5init.c
digest/rmd160/rmd160init.c
digest/sha1/sha1init.c
digest/sha2/sha2init.c
+dl/cfunc.c
+dl/cptr.c
+dl/dl.c
+dl/handle.c
+dl/lib
+dl/win32/lib
etc/etc.c
fcntl/fcntl.c
fiber/fiber.c
@@ -23,13 +29,17 @@ fiddle/function.c
fiddle/pointer.c
fiddle/handle.c
fiddle/lib
+fiddle/win32/lib
gdbm/gdbm.c
io/console/console.c
io/nonblock/nonblock.c
+io/wait/lib
io/wait/wait.c
-json/generator/generator.c
+json/ext/generator/generator.c
+json/ext/parser/parser.c
json/lib
-json/parser/parser.c
+mathn/complex/complex.c
+mathn/rational/rational.c
nkf/lib
nkf/nkf.c
objspace/objspace.c
@@ -45,10 +55,10 @@ openssl/ossl_config.c
openssl/ossl_digest.c
openssl/ossl_engine.c
openssl/ossl_hmac.c
-openssl/ossl_kdf.c
openssl/ossl_ns_spki.c
openssl/ossl_ocsp.c
openssl/ossl_pkcs12.c
+openssl/ossl_pkcs5.c
openssl/ossl_pkcs7.c
openssl/ossl_pkey.c
openssl/ossl_pkey_dh.c
@@ -69,23 +79,25 @@ openssl/ossl_x509revoked.c
openssl/ossl_x509store.c
pathname/lib
pathname/pathname.c
+psych/emitter.c
psych/lib
+psych/parser.c
psych/psych.c
-psych/psych_emitter.c
-psych/psych_parser.c
-psych/psych_to_ruby.c
-psych/psych_yaml_tree.c
+psych/to_ruby.c
+psych/yaml_tree.c
pty/lib
pty/pty.c
racc/cparse/cparse.c
readline/readline.c
ripper/lib
+ripper/ripper.c
sdbm/init.c
socket
stringio/stringio.c
strscan/strscan.c
syslog/syslog.c
syslog/lib
+thread/thread.c
win32ole/lib
win32ole/*.c
zlib/zlib.c
diff --git a/ext/Setup b/ext/Setup
index ac79c86f84..5deb604151 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -1,36 +1,22 @@
#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
#nkf
-#objspace
#openssl
-#pathname
-#psych
#pty
#racc/cparse
-#rbconfig/sizeof
#readline
#ripper
#sdbm
@@ -38,6 +24,6 @@
#stringio
#strscan
#syslog
-#win32
+#tk
#win32ole
#zlib
diff --git a/ext/Setup.atheos b/ext/Setup.atheos
index 90a7d01348..662ca57af1 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
@@ -25,5 +25,6 @@ socket
stringio
strscan
syslog
+#tk
#win32ole
zlib
diff --git a/ext/Setup.emx b/ext/Setup.emx
new file mode 100644
index 0000000000..6c80812ac0
--- /dev/null
+++ b/ext/Setup.emx
@@ -0,0 +1,32 @@
+# 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
new file mode 100644
index 0000000000..28eafb5082
--- /dev/null
+++ b/ext/Setup.nacl
@@ -0,0 +1,48 @@
+# #option nodynamic
+#
+# #Win32API
+# bigdecimal
+# continuation
+# coverage
+# date
+# #dbm
+# digest/bubblebabble
+# digest
+# digest/md5
+# digest/rmd160
+# digest/sha1
+# digest/sha2
+# dl
+# dl/callback
+# #dl/win32
+# etc
+# fcntl
+# fiber
+# #fiddle
+# #gdbm
+# #iconv
+# io/console
+# io/nonblock
+# io/wait
+# #json
+# json/generator
+# json/parser
+# mathn/complex
+# mathn/rational
+# nkf
+# objspace
+# #openssl
+# pathname
+# #psych
+# #pty
+# racc/cparse
+# #readline
+# ripper
+# #sdbm
+# #socket
+# stringio
+# strscan
+# #syslog
+# #tk
+# #tk/tkutil
+# #zlib
diff --git a/ext/Setup.nt b/ext/Setup.nt
index fb5989b87f..3936d2ed29 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
@@ -26,5 +26,6 @@ socket
stringio
strscan
#syslog
+#tk
win32ole
#zlib
diff --git a/ext/bigdecimal/README b/ext/bigdecimal/README
new file mode 100644
index 0000000000..7a4362826c
--- /dev/null
+++ b/ext/bigdecimal/README
@@ -0,0 +1,60 @@
+
+ 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 cdd00388d4..08febb5585 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -4,6 +4,13 @@
*
* 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 */
@@ -62,7 +69,6 @@ static ID id_ceil;
static ID id_floor;
static ID id_to_r;
static ID id_eq;
-static ID id_half;
/* 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
@@ -103,33 +109,6 @@ static ID id_half;
# 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
-
-#define BIGDECIMAL_POSITIVE_P(bd) ((bd)->sign > 0)
-#define BIGDECIMAL_NEGATIVE_P(bd) ((bd)->sign < 0)
-
/*
* ================== Ruby Interface part ==========================
*/
@@ -141,16 +120,12 @@ rb_rational_den(VALUE rat)
static VALUE
BigDecimal_version(VALUE self)
{
- /*
- * 1.0.0: Ruby 1.8.0
- * 1.0.1: Ruby 1.8.1
- * 1.1.0: Ruby 1.9.3
- */
-#ifndef RUBY_BIGDECIMAL_VERSION
-# error RUBY_BIGDECIMAL_VERSION is not defined
-#endif
- rb_warning("BigDecimal.ver is deprecated; use BigDecimal::VERSION instead.");
- return rb_str_new2(RUBY_BIGDECIMAL_VERSION);
+ /*
+ * 1.0.0: Ruby 1.8.0
+ * 1.0.1: Ruby 1.8.1
+ * 1.1.0: Ruby 1.9.3
+ */
+ return rb_str_new2("1.1.0");
}
/*
@@ -180,14 +155,14 @@ static size_t
BigDecimal_memsize(const void *ptr)
{
const Real *pv = ptr;
- return (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT));
+ return pv ? (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT)) : 0;
}
static const rb_data_type_t BigDecimal_data_type = {
"BigDecimal",
{ 0, BigDecimal_delete, BigDecimal_memsize, },
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
#endif
};
@@ -235,7 +210,6 @@ static inline VALUE BigDecimal_div2(VALUE, VALUE, VALUE);
static Real*
GetVpValueWithPrec(VALUE v, long prec, int must)
{
- ENTER(1);
Real *pv;
VALUE num, bg;
char szD[128];
@@ -248,11 +222,6 @@ 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(1, NULL);
- VpDtoV(pv, d);
- return pv;
- }
if (d != 0.0) {
v = rb_funcall(v, id_to_r, 0);
goto again;
@@ -293,15 +262,13 @@ again:
#ifdef ENABLE_NUMERIC_STRING
case T_STRING:
- StringValueCStr(v);
- rb_check_safe_obj(v);
- return VpCreateRbObject(RSTRING_LEN(v) + VpBaseFig() + 1,
+ SafeStringValue(v);
+ return VpCreateRbObject(strlen(RSTRING_PTR(v)) + VpBaseFig() + 1,
RSTRING_PTR(v));
#endif /* ENABLE_NUMERIC_STRING */
case T_BIGNUM:
bg = rb_big2str(v, 10);
- PUSH(bg);
return VpCreateRbObject(strlen(RSTRING_PTR(bg)) + VpBaseFig() + 1,
RSTRING_PTR(bg));
default:
@@ -342,18 +309,15 @@ BigDecimal_double_fig(VALUE self)
return INT2FIX(VpDblFig());
}
-/* call-seq:
- * big_decimal.precs -> array
- *
- * Returns an Array of two Integer values.
+/* call-seq:
+ * precs
*
- * The first value is the current number of significant digits in the
- * BigDecimal. The second value is the maximum number of significant digits
- * for the BigDecimal.
+ * Returns an Array of two Integer values.
*
- * BigDecimal('5').precs #=> [9, 18]
+ * The first value is the current number of significant digits in the
+ * BigDecimal. The second value is the maximum number of significant digits
+ * for the BigDecimal.
*/
-
static VALUE
BigDecimal_prec(VALUE self)
{
@@ -389,7 +353,7 @@ BigDecimal_hash(VALUE self)
hash ^= rb_memhash(p->frac, sizeof(BDIGIT)*p->Prec);
hash += p->exponent;
}
- return ST2FIX(hash);
+ return INT2FIX(hash);
}
/*
@@ -397,10 +361,10 @@ BigDecimal_hash(VALUE self)
*
* Method used to provide marshalling support.
*
- * inf = BigDecimal('Infinity')
- * #=> Infinity
+ * inf = BigDecimal.new('Infinity')
+ * => #<BigDecimal:1e16fa8,'Infinity',9(9)>
* BigDecimal._load(inf._dump)
- * #=> Infinity
+ * => #<BigDecimal:1df8dc8,'Infinity',9(9)>
*
* See the Marshal module.
*/
@@ -435,8 +399,8 @@ BigDecimal_load(VALUE self, VALUE str)
unsigned char ch;
unsigned long m=0;
- pch = (unsigned char *)StringValueCStr(str);
- rb_check_safe_obj(str);
+ SafeStringValue(str);
+ pch = (unsigned char *)RSTRING_PTR(str);
/* First get max prec */
while((*pch) != (unsigned char)'\0' && (ch = *pch++) != (unsigned char)':') {
if(!ISDIGIT(ch)) {
@@ -454,55 +418,6 @@ BigDecimal_load(VALUE self, VALUE str)
}
static unsigned short
-check_rounding_mode_option(VALUE const opts)
-{
- VALUE mode;
- char const *s;
- long l;
-
- assert(RB_TYPE_P(opts, T_HASH));
-
- if (NIL_P(opts))
- goto noopt;
-
- mode = rb_hash_lookup2(opts, ID2SYM(id_half), Qundef);
- if (mode == Qundef || NIL_P(mode))
- goto noopt;
-
- if (SYMBOL_P(mode))
- mode = rb_sym2str(mode);
- else if (!RB_TYPE_P(mode, T_STRING)) {
- VALUE str_mode = rb_check_string_type(mode);
- if (NIL_P(str_mode)) goto invalid;
- mode = str_mode;
- }
- s = RSTRING_PTR(mode);
- l = RSTRING_LEN(mode);
- switch (l) {
- case 2:
- if (strncasecmp(s, "up", 2) == 0)
- return VP_ROUND_HALF_UP;
- break;
- case 4:
- if (strncasecmp(s, "even", 4) == 0)
- return VP_ROUND_HALF_EVEN;
- else if (strncasecmp(s, "down", 4) == 0)
- return VP_ROUND_HALF_DOWN;
- break;
- default:
- break;
- }
- invalid:
- if (NIL_P(mode))
- rb_raise(rb_eArgError, "invalid rounding mode: nil");
- else
- rb_raise(rb_eArgError, "invalid rounding mode: %"PRIsVALUE, mode);
-
- noopt:
- return VpGetRoundMode();
-}
-
-static unsigned short
check_rounding_mode(VALUE const v)
{
unsigned short sw;
@@ -530,7 +445,8 @@ check_rounding_mode(VALUE const v)
break;
}
- sw = NUM2USHORT(v);
+ Check_Type(v, T_FIXNUM);
+ sw = (unsigned short)FIX2UINT(v);
if (!VpIsRoundMode(sw)) {
rb_raise(rb_eArgError, "invalid rounding mode");
}
@@ -583,7 +499,8 @@ BigDecimal_mode(int argc, VALUE *argv, VALUE self)
unsigned long f,fo;
rb_scan_args(argc, argv, "11", &which, &val);
- f = (unsigned long)NUM2INT(which);
+ Check_Type(which, T_FIXNUM);
+ f = (unsigned long)FIX2INT(which);
if (f & VP_EXCEPTION_ALL) {
/* Exception mode setting */
@@ -624,7 +541,7 @@ BigDecimal_mode(int argc, VALUE *argv, VALUE self)
fo = VpSetRoundMode(sw);
return INT2FIX(fo);
}
- rb_raise(rb_eTypeError, "first argument for BigDecimal.mode invalid");
+ rb_raise(rb_eTypeError, "first argument for BigDecimal#mode invalid");
return Qnil;
}
@@ -650,12 +567,13 @@ GetAddSubPrec(Real *a, Real *b)
}
static SIGNED_VALUE
-GetPrecisionInt(VALUE v)
+GetPositiveInt(VALUE v)
{
SIGNED_VALUE n;
- n = NUM2INT(v);
+ Check_Type(v, T_FIXNUM);
+ n = FIX2INT(v);
if (n < 0) {
- rb_raise(rb_eArgError, "negative precision");
+ rb_raise(rb_eArgError, "argument must be positive");
}
return n;
}
@@ -663,17 +581,17 @@ GetPrecisionInt(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);
- RTYPEDDATA_DATA(obj) = pv;
- pv->obj = obj;
+ pv->obj = TypedData_Wrap_Struct(klass, &BigDecimal_data_type, pv);
return pv;
}
VP_EXPORT Real *
VpCreateRbObject(size_t mx, const char *str)
{
- return VpNewRbClass(mx, str, rb_cBigDecimal);
+ Real *pv = VpAlloc(mx,str);
+ pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
+ return pv;
}
#define VpAllocReal(prec) (Real *)VpMemAlloc(offsetof(Real, frac) + (prec) * sizeof(BDIGIT))
@@ -695,7 +613,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)
{
@@ -716,7 +634,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)
{
@@ -742,9 +660,9 @@ BigDecimal_check_num(Real *p)
static VALUE BigDecimal_split(VALUE self);
-/* Returns the value as an Integer.
+/* Returns the value as an integer (Fixnum or Bignum).
*
- * If the BigDecimal is infinity or NaN, raises FloatDomainError.
+ * If the BigNumber is infinity or NaN, raises FloatDomainError.
*/
static VALUE
BigDecimal_to_i(VALUE self)
@@ -764,12 +682,12 @@ BigDecimal_to_i(VALUE self)
}
else {
VALUE a = BigDecimal_split(self);
- VALUE digits = RARRAY_AREF(a, 1);
+ VALUE digits = RARRAY_PTR(a)[1];
VALUE numerator = rb_funcall(digits, rb_intern("to_i"), 0);
VALUE ret;
ssize_t dpower = e - (ssize_t)RSTRING_LEN(digits);
- if (BIGDECIMAL_NEGATIVE_P(p)) {
+ if (VpGetSign(p) < 0) {
numerator = rb_funcall(numerator, '*', 1, INT2FIX(-1));
}
if (dpower < 0) {
@@ -824,17 +742,17 @@ BigDecimal_to_f(VALUE self)
overflow:
VpException(VP_EXCEPTION_OVERFLOW, "BigDecimal to Float conversion", 0);
- if (BIGDECIMAL_NEGATIVE_P(p))
- return rb_float_new(VpGetDoubleNegInf());
- else
+ if (p->sign >= 0)
return rb_float_new(VpGetDoublePosInf());
+ else
+ return rb_float_new(VpGetDoubleNegInf());
underflow:
VpException(VP_EXCEPTION_UNDERFLOW, "BigDecimal to Float conversion", 0);
- if (BIGDECIMAL_NEGATIVE_P(p))
- return rb_float_new(-0.0);
- else
+ if (p->sign >= 0)
return rb_float_new(0.0);
+ else
+ return rb_float_new(-0.0);
}
@@ -853,7 +771,7 @@ BigDecimal_to_r(VALUE self)
sign = VpGetSign(p);
power = VpExponent10(p);
a = BigDecimal_split(self);
- digits = RARRAY_AREF(a, 1);
+ digits = RARRAY_PTR(a)[1];
denomi_power = power - RSTRING_LEN(digits);
numerator = rb_funcall(digits, rb_intern("to_i"), 0);
@@ -880,8 +798,8 @@ BigDecimal_to_r(VALUE self)
* be coerced into a BigDecimal value.
*
* e.g.
- * a = BigDecimal("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.
@@ -912,14 +830,13 @@ BigDecimal_coerce(VALUE self, VALUE other)
}
/*
- * call-seq:
- * +big_decimal -> big_decimal
+ * call-seq: +@
*
* Return self.
*
- * +BigDecimal('5') #=> 0.5e1
+ * e.g.
+ * b = +a # b == a
*/
-
static VALUE
BigDecimal_uplus(VALUE self)
{
@@ -940,8 +857,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)
@@ -985,7 +902,7 @@ BigDecimal_add(VALUE self, VALUE r)
}
/* call-seq:
- * a - b -> bigdecimal
+ * value - digits -> bigdecimal
*
* Subtract the specified value.
*
@@ -1169,7 +1086,7 @@ BigDecimal_comp(VALUE self, VALUE r)
*
* Values may be coerced to perform the comparison:
*
- * BigDecimal('1.0') == 1.0 #=> true
+ * BigDecimal.new('1.0') == 1.0 -> true
*/
static VALUE
BigDecimal_eq(VALUE self, VALUE r)
@@ -1230,14 +1147,14 @@ BigDecimal_ge(VALUE self, VALUE r)
}
/*
- * call-seq:
- * -big_decimal -> big_decimal
+ * call-seq: -@
*
- * Return the negation of self.
+ * Return the negation of self.
*
- * -BigDecimal('5') #=> -0.5e1
+ * e.g.
+ * b = -a
+ * b == a * -1
*/
-
static VALUE
BigDecimal_neg(VALUE self)
{
@@ -1261,8 +1178,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)
@@ -1325,14 +1242,25 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
return Qnil;
}
-/* call-seq:
- * a / b -> bigdecimal
- * quo(value) -> bigdecimal
- *
- * Divide by the specified value.
- *
- * See BigDecimal#div.
- */
+ /* call-seq:
+ * div(value, digits)
+ * quo(value)
+ *
+ * Divide by the specified value.
+ *
+ * e.g.
+ * c = a.div(b,n)
+ *
+ * digits:: If specified and less than the number of significant digits of the
+ * result, the result is rounded to that number of digits, according to
+ * BigDecimal.mode.
+ *
+ * If digits is 0, the result is the same as the / operator. If not, the
+ * result is an integer BigDecimal, by analogy with Float#div.
+ *
+ * The alias quo is provided since <code>div(value, 0)</code> is the same as
+ * computing the quotient; see BigDecimal#divmod.
+ */
static VALUE
BigDecimal_div(VALUE self, VALUE r)
/* For c = self/r: with round operation */
@@ -1504,10 +1432,7 @@ BigDecimal_divremain(VALUE self, VALUE r, Real **dv, Real **rv)
return Qnil;
}
-/* call-seq:
- * remainder(value)
- *
- * Returns the remainder from dividing by the value.
+/* Returns the remainder from dividing by the value.
*
* x.remainder(y) means x-y*(x/y).truncate
*/
@@ -1521,24 +1446,21 @@ BigDecimal_remainder(VALUE self, VALUE r) /* remainder */
return ToValue(rv);
}
-/* call-seq:
- * divmod(value)
- *
- * Divides by the specified value, and returns the quotient and modulus
+/* 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("42")
- * b = BigDecimal("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.
@@ -1575,7 +1497,7 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
}
/* div in BigDecimal sense */
- ix = GetPrecisionInt(n);
+ ix = GetPositiveInt(n);
if (ix == 0) {
return BigDecimal_div(self, b);
}
@@ -1585,7 +1507,7 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
size_t mx = ix + VpBaseFig()*2;
size_t pl = VpSetPrecLimit(0);
- GUARD_OBJ(cv, VpCreateRbObject(mx + VpBaseFig(), "0"));
+ GUARD_OBJ(cv, VpCreateRbObject(mx, "0"));
GUARD_OBJ(av, GetVpValue(self, 1));
GUARD_OBJ(bv, GetVpValue(b, 1));
mx = av->Prec + bv->Prec + 2;
@@ -1598,37 +1520,6 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
}
}
- /*
- * Document-method: BigDecimal#div
- *
- * call-seq:
- * div(value, digits) -> bigdecimal or integer
- *
- * Divide by the specified value.
- *
- * digits:: If specified and less than the number of significant digits of the
- * result, the result is rounded to that number of digits, according
- * to BigDecimal.mode.
- *
- * If digits is 0, the result is the same as for the / operator
- * or #quo.
- *
- * If digits is not specified, the result is an integer,
- * by analogy with Float#div; see also BigDecimal#divmod.
- *
- * Examples:
- *
- * a = BigDecimal("4")
- * b = BigDecimal("3")
- *
- * a.div(b, 3) # => 0.133e1
- *
- * a.div(b, 0) # => 0.1333333333333333333e1
- * a / b # => 0.1333333333333333333e1
- * a.quo(b) # => 0.1333333333333333333e1
- *
- * a.div(b) # => 1
- */
static VALUE
BigDecimal_div3(int argc, VALUE *argv, VALUE self)
{
@@ -1644,7 +1535,7 @@ BigDecimal_add2(VALUE self, VALUE b, VALUE n)
{
ENTER(2);
Real *cv;
- SIGNED_VALUE mx = GetPrecisionInt(n);
+ SIGNED_VALUE mx = GetPositiveInt(n);
if (mx == 0) return BigDecimal_add(self, b);
else {
size_t pl = VpSetPrecLimit(0);
@@ -1656,7 +1547,7 @@ BigDecimal_add2(VALUE self, VALUE b, VALUE n)
}
}
-/* call-seq:
+/*
* sub(value, digits) -> bigdecimal
*
* Subtract the specified value.
@@ -1665,8 +1556,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
@@ -1674,7 +1565,7 @@ BigDecimal_sub2(VALUE self, VALUE b, VALUE n)
{
ENTER(2);
Real *cv;
- SIGNED_VALUE mx = GetPrecisionInt(n);
+ SIGNED_VALUE mx = GetPositiveInt(n);
if (mx == 0) return BigDecimal_sub(self, b);
else {
size_t pl = VpSetPrecLimit(0);
@@ -1692,7 +1583,7 @@ BigDecimal_mult2(VALUE self, VALUE b, VALUE n)
{
ENTER(2);
Real *cv;
- SIGNED_VALUE mx = GetPrecisionInt(n);
+ SIGNED_VALUE mx = GetPositiveInt(n);
if (mx == 0) return BigDecimal_mult(self, b);
else {
size_t pl = VpSetPrecLimit(0);
@@ -1704,16 +1595,12 @@ BigDecimal_mult2(VALUE self, VALUE b, VALUE n)
}
}
-/*
- * call-seq:
- * big_decimal.abs -> big_decimal
+/* Returns the absolute value.
*
- * Returns the absolute value, as a BigDecimal.
+ * BigDecimal('5').abs -> 5
*
- * BigDecimal('5').abs #=> 0.5e1
- * BigDecimal('-3').abs #=> 0.3e1
+ * BigDecimal('-3').abs -> 3
*/
-
static VALUE
BigDecimal_abs(VALUE self)
{
@@ -1746,14 +1633,14 @@ BigDecimal_sqrt(VALUE self, VALUE nFig)
GUARD_OBJ(a, GetVpValue(self, 1));
mx = a->Prec * (VpBaseFig() + 1);
- n = GetPrecisionInt(nFig) + VpDblFig() + BASE_FIG;
+ n = GetPositiveInt(nFig) + VpDblFig() + BASE_FIG;
if (mx <= n) mx = n;
GUARD_OBJ(c, VpCreateRbObject(mx, "0"));
VpSqrt(c, a);
return ToValue(c);
}
-/* Return the integer part of the number, as a BigDecimal.
+/* Return the integer part of the number.
*/
static VALUE
BigDecimal_fix(VALUE self)
@@ -1772,12 +1659,10 @@ BigDecimal_fix(VALUE self)
/* call-seq:
* round(n, mode)
*
- * Round to the nearest integer (by default), returning the result as a
- * BigDecimal.
+ * Round to the nearest 1 (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.
@@ -1808,21 +1693,13 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
iLoc = 0;
break;
case 1:
- if (RB_TYPE_P(vLoc, T_HASH)) {
- sw = check_rounding_mode_option(vLoc);
- }
- else {
- iLoc = NUM2INT(vLoc);
- }
+ Check_Type(vLoc, T_FIXNUM);
+ iLoc = FIX2INT(vLoc);
break;
case 2:
- iLoc = NUM2INT(vLoc);
- if (RB_TYPE_P(vRound, T_HASH)) {
- sw = check_rounding_mode_option(vRound);
- }
- else {
- sw = check_rounding_mode(vRound);
- }
+ Check_Type(vLoc, T_FIXNUM);
+ iLoc = FIX2INT(vLoc);
+ sw = check_rounding_mode(vRound);
break;
default:
break;
@@ -1843,12 +1720,10 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
/* call-seq:
* truncate(n)
*
- * Truncate to the nearest integer (by default), returning the result as a
- * BigDecimal.
+ * Truncate to the nearest 1, 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.
@@ -1872,7 +1747,8 @@ BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
iLoc = 0;
}
else {
- iLoc = NUM2INT(vLoc);
+ Check_Type(vLoc, T_FIXNUM);
+ iLoc = FIX2INT(vLoc);
}
GUARD_OBJ(a, GetVpValue(self, 1));
@@ -1886,7 +1762,7 @@ BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
return ToValue(c);
}
-/* Return the fractional part of the number, as a BigDecimal.
+/* Return the fractional part of the number.
*/
static VALUE
BigDecimal_frac(VALUE self)
@@ -1932,7 +1808,8 @@ BigDecimal_floor(int argc, VALUE *argv, VALUE self)
iLoc = 0;
}
else {
- iLoc = NUM2INT(vLoc);
+ Check_Type(vLoc, T_FIXNUM);
+ iLoc = FIX2INT(vLoc);
}
GUARD_OBJ(a, GetVpValue(self, 1));
@@ -1978,7 +1855,8 @@ BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
if (rb_scan_args(argc, argv, "01", &vLoc) == 0) {
iLoc = 0;
} else {
- iLoc = NUM2INT(vLoc);
+ Check_Type(vLoc, T_FIXNUM);
+ iLoc = FIX2INT(vLoc);
}
GUARD_OBJ(a, GetVpValue(self, 1));
@@ -2016,35 +1894,34 @@ BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
*
* Examples:
*
- * BigDecimal('-123.45678901234567890').to_s('5F')
- * #=> '-123.45678 90123 45678 9'
+ * BigDecimal.new('-123.45678901234567890').to_s('5F')
+ * #=> '-123.45678 90123 45678 9'
*
- * BigDecimal('123.45678901234567890').to_s('+8F')
- * #=> '+123.45678901 23456789'
+ * BigDecimal.new('123.45678901234567890').to_s('+8F')
+ * #=> '+123.45678901 23456789'
*
- * BigDecimal('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)
{
ENTER(5);
- int fmt = 0; /* 0: E format, 1: F format */
- int fPlus = 0; /* 0: default, 1: set ' ' before digits, 2: set '+' before digits. */
+ int fmt = 0; /* 0:E format */
+ int fPlus = 0; /* =0:default,=1: set ' ' before digits ,set '+' before digits. */
Real *vp;
volatile VALUE str;
char *psz;
char ch;
size_t nc, mc = 0;
- SIGNED_VALUE m;
VALUE f;
GUARD_OBJ(vp, GetVpValue(self, 1));
if (rb_scan_args(argc, argv, "01", &f) == 1) {
if (RB_TYPE_P(f, T_STRING)) {
- psz = StringValueCStr(f);
- rb_check_safe_obj(f);
+ SafeStringValue(f);
+ psz = RSTRING_PTR(f);
if (*psz == ' ') {
fPlus = 1;
psz++;
@@ -2067,11 +1944,7 @@ BigDecimal_to_s(int argc, VALUE *argv, VALUE self)
}
}
else {
- m = NUM2INT(f);
- if (m <= 0) {
- rb_raise(rb_eArgError, "argument must be positive");
- }
- mc = (size_t)m;
+ mc = (size_t)GetPositiveInt(f);
}
}
if (fmt) {
@@ -2168,8 +2041,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("1234.5678").inspect
- * #=> "0.12345678e4"
+ * 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
@@ -2180,16 +2053,23 @@ BigDecimal_inspect(VALUE self)
{
ENTER(5);
Real *vp;
- volatile VALUE str;
+ volatile VALUE obj;
size_t nc;
+ char *psz, *tmp;
GUARD_OBJ(vp, GetVpValue(self, 1));
nc = VpNumOfChars(vp, "E");
-
- str = rb_str_new(0, nc);
- VpToString(vp, RSTRING_PTR(str), 0, 0);
- rb_str_resize(str, strlen(RSTRING_PTR(str)));
- return str;
+ nc += (nc + 9) / 10;
+
+ obj = rb_str_new(0, nc+256);
+ psz = RSTRING_PTR(obj);
+ sprintf(psz, "#<BigDecimal:%"PRIxVALUE",'", self);
+ tmp = psz + strlen(psz);
+ VpToString(vp, tmp, 10, 0);
+ tmp += strlen(tmp);
+ sprintf(tmp, "',%"PRIuSIZE"(%"PRIuSIZE")>", VpPrec(vp)*VpBaseFig(), VpMaxPrec(vp)*VpBaseFig());
+ rb_str_resize(obj, strlen(psz));
+ return obj;
}
static VALUE BigMath_s_exp(VALUE, VALUE, VALUE);
@@ -2316,7 +2196,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)
@@ -2399,7 +2279,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
if (is_negative(vexp)) {
y = VpCreateRbObject(n, "#0");
RB_GC_GUARD(y->obj);
- if (BIGDECIMAL_NEGATIVE_P(x)) {
+ if (VpGetSign(x) < 0) {
if (is_integer(vexp)) {
if (is_even(vexp)) {
/* (-0) ** (-even_integer) -> Infinity */
@@ -2438,7 +2318,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
if (VpIsInf(x)) {
if (is_negative(vexp)) {
- if (BIGDECIMAL_NEGATIVE_P(x)) {
+ if (VpGetSign(x) < 0) {
if (is_integer(vexp)) {
if (is_even(vexp)) {
/* (-Infinity) ** (-even_integer) -> +0 */
@@ -2460,7 +2340,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
else {
y = VpCreateRbObject(n, "0#");
- if (BIGDECIMAL_NEGATIVE_P(x)) {
+ if (VpGetSign(x) < 0) {
if (is_integer(vexp)) {
if (is_even(vexp)) {
VpSetPosInf(y);
@@ -2501,7 +2381,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
return ToValue(y);
}
- else if (BIGDECIMAL_NEGATIVE_P(x) && is_even(vexp)) {
+ else if (VpGetSign(x) < 0 && is_even(vexp)) {
return ToValue(VpCreateRbObject(n, "-0"));
}
else {
@@ -2519,7 +2399,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
return ToValue(y);
}
- else if (BIGDECIMAL_NEGATIVE_P(x) && is_even(vexp)) {
+ else if (VpGetSign(x) < 0 && is_even(vexp)) {
return ToValue(VpCreateRbObject(n, "-0"));
}
else {
@@ -2548,11 +2428,9 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
/* call-seq:
- * a ** n -> bigdecimal
+ * big_decimal ** exp -> big_decimal
*
- * Returns the value raised to the power of n.
- *
- * See BigDecimal#power.
+ * It is a synonym of BigDecimal#power(exp).
*/
static VALUE
BigDecimal_power_op(VALUE self, VALUE exp)
@@ -2579,7 +2457,7 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
* If it is a String, spaces are ignored and unrecognized characters
* terminate the value.
*
- * digits:: The number of significant digits, as an Integer. If omitted or 0,
+ * digits:: The number of significant digits, as a Fixnum. If omitted or 0,
* the number of significant digits is determined from the initial
* value.
*
@@ -2588,10 +2466,10 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
*
* ==== Exceptions
*
- * TypeError:: If the +initial+ type is neither Integer, Float,
+ * TypeError:: If the +initial+ type is neither Fixnum, Bignum, Float,
* Rational, nor BigDecimal, this exception is raised.
*
- * TypeError:: If the +digits+ is not an Integer, 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.
@@ -2600,13 +2478,6 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
* value is omitted, this exception is raised.
*/
static VALUE
-BigDecimal_s_new(int argc, VALUE *argv, VALUE self)
-{
- rb_warning("BigDecimal.new is deprecated; use Kernel.BigDecimal method instead.");
- return rb_call_super(argc, argv);
-}
-
-static VALUE
BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
{
ENTER(1);
@@ -2628,7 +2499,7 @@ BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
/* :nodoc:
*
- * private method for dup and clone the provided BigDecimal +other+
+ * private method to dup and clone the provided BigDecimal +other+
*/
static VALUE
BigDecimal_initialize_copy(VALUE self, VALUE other)
@@ -2642,25 +2513,18 @@ BigDecimal_initialize_copy(VALUE self, VALUE other)
return self;
}
-static VALUE
-BigDecimal_clone(VALUE self)
-{
- return self;
-}
-
static Real *
BigDecimal_new(int argc, VALUE *argv)
{
size_t mf;
VALUE nFig;
VALUE iniValue;
- double d;
if (rb_scan_args(argc, argv, "11", &iniValue, &nFig) == 1) {
mf = 0;
}
else {
- mf = GetPrecisionInt(nFig);
+ mf = GetPositiveInt(nFig);
}
switch (TYPE(iniValue)) {
@@ -2676,12 +2540,6 @@ BigDecimal_new(int argc, VALUE *argv)
return GetVpValue(iniValue, 1);
case T_FLOAT:
- d = RFLOAT_VALUE(iniValue);
- if (!isfinite(d)) {
- Real *pv = VpCreateRbObject(1, NULL);
- VpDtoV(pv, d);
- return pv;
- }
if (mf > DBL_DIG+1) {
rb_raise(rb_eArgError, "precision too large.");
}
@@ -2709,13 +2567,11 @@ BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
{
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);
- RTYPEDDATA_DATA(obj) = pv;
- return pv->obj = obj;
+ pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
+ return pv->obj;
}
/* call-seq:
@@ -2739,7 +2595,8 @@ BigDecimal_limit(int argc, VALUE *argv, VALUE self)
if (rb_scan_args(argc, argv, "01", &nFig) == 1) {
int nf;
if (NIL_P(nFig)) return nCur;
- nf = NUM2INT(nFig);
+ Check_Type(nFig, T_FIXNUM);
+ nf = FIX2INT(nFig);
if (nf < 0) {
rb_raise(rb_eArgError, "argument must be positive");
}
@@ -2780,9 +2637,9 @@ BigDecimal_sign(VALUE self)
* BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false)
* BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
*
- * BigDecimal(BigDecimal('Infinity'))
- * BigDecimal(BigDecimal('-Infinity'))
- * BigDecimal(BigDecimal('NaN'))
+ * BigDecimal.new(BigDecimal('Infinity'))
+ * BigDecimal.new(BigDecimal('-Infinity'))
+ * BigDecimal(BigDecimal.new('NaN'))
* end
*
* For use with the BigDecimal::EXCEPTION_*
@@ -2876,13 +2733,13 @@ 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 almost same as one in the
+ /* TODO: the following switch statement is almostly the same as one in the
* BigDecimalCmp function. */
switch (TYPE(x)) {
case T_DATA:
if (!is_kind_of_BigDecimal(x)) break;
vx = DATA_PTR(x);
- negative = BIGDECIMAL_NEGATIVE_P(vx);
+ negative = VpGetSign(vx) < 0;
infinite = VpIsPosInf(vx) || VpIsNegInf(vx);
nan = VpIsNaN(vx);
break;
@@ -2935,7 +2792,7 @@ BigMath_s_exp(VALUE klass, VALUE x, VALUE vprec)
x = vx->obj;
n = prec + rmpd_double_figures();
- negative = BIGDECIMAL_NEGATIVE_P(vx);
+ negative = VpGetSign(vx) < 0;
if (negative) {
VpSetSign(vx, 1);
}
@@ -3014,14 +2871,14 @@ 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 almost same as one in the
+ /* TODO: the following switch statement is almostly the same as one in the
* BigDecimalCmp function. */
switch (TYPE(x)) {
case T_DATA:
if (!is_kind_of_BigDecimal(x)) break;
vx = DATA_PTR(x);
zero = VpIsZero(vx);
- negative = BIGDECIMAL_NEGATIVE_P(vx);
+ negative = VpGetSign(vx) < 0;
infinite = VpIsPosInf(vx) || VpIsNegInf(vx);
nan = VpIsNaN(vx);
break;
@@ -3169,15 +3026,15 @@ get_vp_value:
*
* require 'bigdecimal'
*
- * sum = BigDecimal("0")
+ * sum = BigDecimal.new("0")
* 10_000.times do
- * sum = sum + BigDecimal("0.0001")
+ * sum = sum + BigDecimal.new("0.0001")
* end
* print sum #=> 0.1E1
*
* Similarly:
*
- * (BigDecimal("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") #=> true
+ * (BigDecimal.new("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") #=> true
*
* (1.2 - 1.0) == 0.2 #=> false
*
@@ -3191,8 +3048,8 @@ get_vp_value:
* BigDecimal sometimes needs to return infinity, for example if you divide
* a value by zero.
*
- * BigDecimal("1.0") / BigDecimal("0.0") #=> Infinity
- * BigDecimal("-1.0") / BigDecimal("0.0") #=> -Infinity
+ * BigDecimal.new("1.0") / BigDecimal.new("0.0") #=> Infinity
+ * BigDecimal.new("-1.0") / BigDecimal.new("0.0") #=> -Infinity
*
* You can represent infinite numbers to BigDecimal using the strings
* <code>'Infinity'</code>, <code>'+Infinity'</code> and
@@ -3205,13 +3062,13 @@ get_vp_value:
*
* Example:
*
- * BigDecimal("0.0") / BigDecimal("0.0") #=> NaN
+ * BigDecimal.new("0.0") / BigDecimal.new("0.0") #=> NaN
*
* You can also create undefined values.
*
* NaN is never considered to be the same as any other value, even NaN itself:
*
- * n = BigDecimal('NaN')
+ * n = BigDecimal.new('NaN')
* n == 0.0 #=> false
* n == n #=> false
*
@@ -3224,11 +3081,11 @@ get_vp_value:
* If the value which is too small to be represented is negative, a BigDecimal
* value of negative zero is returned.
*
- * BigDecimal("1.0") / BigDecimal("-Infinity") #=> -0.0
+ * BigDecimal.new("1.0") / BigDecimal.new("-Infinity") #=> -0.0
*
* If the value is positive, a value of positive zero is returned.
*
- * BigDecimal("1.0") / BigDecimal("Infinity") #=> 0.0
+ * BigDecimal.new("1.0") / BigDecimal.new("Infinity") #=> 0.0
*
* (See BigDecimal.mode for how to specify limits of precision.)
*
@@ -3238,25 +3095,13 @@ get_vp_value:
* Note also that in mathematics, there is no particular concept of negative
* or positive zero; true mathematical zero has no sign.
*
- * == bigdecimal/util
- *
- * When you require +bigdecimal/util+, the #to_d method will be
- * available on BigDecimal and the native Integer, Float, Rational,
- * and String classes:
- *
- * require 'bigdecimal/util'
- *
- * 42.to_d # => 0.42e2
- * 0.5.to_d # => 0.5e0
- * (2/3r).to_d(3) # => 0.667e0
- * "0.5".to_d # => 0.5e0
- *
* == License
*
* Copyright (C) 2002 by Shigeo Kobayashi <shigeo@tinyforest.gr.jp>.
*
- * BigDecimal is released under the Ruby and 2-clause BSD licenses.
- * See LICENSE.txt for details.
+ * 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.
*
* Maintained by mrkn <mrkn@mrkn.jp> and ruby-core members.
*
@@ -3283,7 +3128,6 @@ Init_bigdecimal(void)
rb_define_global_function("BigDecimal", BigDecimal_global_new, -1);
/* Class methods */
- rb_define_singleton_method(rb_cBigDecimal, "new", BigDecimal_s_new, -1);
rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1);
rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1);
rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0);
@@ -3296,14 +3140,6 @@ Init_bigdecimal(void)
/* Constants definition */
-#ifndef RUBY_BIGDECIMAL_VERSION
-# error RUBY_BIGDECIMAL_VERSION is not defined
-#endif
- /*
- * The version of bigdecimal library
- */
- rb_define_const(rb_cBigDecimal, "VERSION", rb_str_new2(RUBY_BIGDECIMAL_VERSION));
-
/*
* Base value used in internal calculations. On a 32 bit system, BASE
* is 10000, indicating that calculation is done in groups of 4 digits.
@@ -3346,7 +3182,7 @@ Init_bigdecimal(void)
rb_define_const(rb_cBigDecimal, "EXCEPTION_OVERFLOW", INT2FIX(VP_EXCEPTION_OVERFLOW));
/*
- * 0x10: Determines what happens when a division by zero is performed.
+ * 0x01: Determines what happens when a division by zero is performed.
* See BigDecimal.mode.
*/
rb_define_const(rb_cBigDecimal, "EXCEPTION_ZERODIVIDE", INT2FIX(VP_EXCEPTION_ZERODIVIDE));
@@ -3440,8 +3276,7 @@ Init_bigdecimal(void)
rb_define_method(rb_cBigDecimal, "modulo", BigDecimal_mod, 1);
rb_define_method(rb_cBigDecimal, "remainder", BigDecimal_remainder, 1);
rb_define_method(rb_cBigDecimal, "divmod", BigDecimal_divmod, 1);
- rb_define_method(rb_cBigDecimal, "clone", BigDecimal_clone, 0);
- rb_define_method(rb_cBigDecimal, "dup", BigDecimal_clone, 0);
+ /* rb_define_method(rb_cBigDecimal, "dup", BigDecimal_dup, 0); */
rb_define_method(rb_cBigDecimal, "to_f", BigDecimal_to_f, 0);
rb_define_method(rb_cBigDecimal, "abs", BigDecimal_abs, 0);
rb_define_method(rb_cBigDecimal, "sqrt", BigDecimal_sqrt, 1);
@@ -3489,7 +3324,6 @@ Init_bigdecimal(void)
id_floor = rb_intern_const("floor");
id_to_r = rb_intern_const("to_r");
id_eq = rb_intern_const("==");
- id_half = rb_intern_const("half");
}
/*
@@ -3517,14 +3351,7 @@ static Real *VpPt5; /* constant 0.5 */
#define MemCmp(x,y,z) memcmp(x,y,z)
#define StrCmp(x,y) strcmp(x,y)
-enum op_sw {
- OP_SW_ADD = 1, /* + */
- OP_SW_SUB, /* - */
- OP_SW_MULT, /* * */
- OP_SW_DIV /* / */
-};
-
-static int VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw);
+static int VpIsDefOP(Real *c,Real *a,Real *b,int sw);
static int AddExponent(Real *a, SIGNED_VALUE n);
static BDIGIT VpAddAbs(Real *a,Real *b,Real *c);
static BDIGIT VpSubAbs(Real *a,Real *b,Real *c);
@@ -3551,7 +3378,7 @@ VpMemAlloc(size_t mb)
return p;
}
-VP_EXPORT void *
+ VP_EXPORT void *
VpMemRealloc(void *ptr, size_t mb)
{
void *p = xrealloc(ptr, mb);
@@ -3569,12 +3396,12 @@ VpFree(Real *pv)
#ifdef BIGDECIMAL_DEBUG
gnAlloc--; /* Decrement allocation count */
if (gnAlloc == 0) {
- printf(" *************** All memories allocated freed ****************\n");
- /*getchar();*/
+ printf(" *************** All memories allocated freed ****************");
+ getchar();
}
if (gnAlloc < 0) {
printf(" ??????????? Too many memory free calls(%d) ?????????????\n", gnAlloc);
- /*getchar();*/
+ getchar();
}
#endif /* BIGDECIMAL_DEBUG */
}
@@ -3604,7 +3431,7 @@ VpGetException (void)
return RMPD_EXCEPTION_MODE_DEFAULT;
}
- return NUM2USHORT(vmode);
+ return (unsigned short)FIX2UINT(vmode);
}
static void
@@ -3674,7 +3501,7 @@ VpGetRoundMode(void)
return RMPD_ROUNDING_MODE_DEFAULT;
}
- return NUM2USHORT(vmode);
+ return (unsigned short)FIX2INT(vmode);
}
VP_EXPORT int
@@ -3811,7 +3638,7 @@ VpException(unsigned short f, const char *str,int always)
/* Throw exception or returns 0,when resulting c is Inf or NaN */
/* sw=1:+ 2:- 3:* 4:/ */
static int
-VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
+VpIsDefOP(Real *c,Real *a,Real *b,int sw)
{
if (VpIsNaN(a) || VpIsNaN(b)) {
/* at least a or b is NaN */
@@ -3822,7 +3649,7 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
if (VpIsInf(a)) {
if (VpIsInf(b)) {
switch(sw) {
- case OP_SW_ADD: /* + */
+ case 1: /* + */
if (VpGetSign(a) == VpGetSign(b)) {
VpSetInf(c, VpGetSign(a));
goto Inf;
@@ -3831,7 +3658,7 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
VpSetNaN(c);
goto NaN;
}
- case OP_SW_SUB: /* - */
+ case 2: /* - */
if (VpGetSign(a) != VpGetSign(b)) {
VpSetInf(c, VpGetSign(a));
goto Inf;
@@ -3840,10 +3667,12 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
VpSetNaN(c);
goto NaN;
}
- case OP_SW_MULT: /* * */
+ break;
+ case 3: /* * */
VpSetInf(c, VpGetSign(a)*VpGetSign(b));
goto Inf;
- case OP_SW_DIV: /* / */
+ break;
+ case 4: /* / */
VpSetNaN(c);
goto NaN;
}
@@ -3852,18 +3681,18 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
}
/* Inf op Finite */
switch(sw) {
- case OP_SW_ADD: /* + */
- case OP_SW_SUB: /* - */
+ case 1: /* + */
+ case 2: /* - */
VpSetInf(c, VpGetSign(a));
break;
- case OP_SW_MULT: /* * */
+ case 3: /* * */
if (VpIsZero(b)) {
VpSetNaN(c);
goto NaN;
}
VpSetInf(c, VpGetSign(a)*VpGetSign(b));
break;
- case OP_SW_DIV: /* / */
+ case 4: /* / */
VpSetInf(c, VpGetSign(a)*VpGetSign(b));
}
goto Inf;
@@ -3871,20 +3700,20 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
if (VpIsInf(b)) {
switch(sw) {
- case OP_SW_ADD: /* + */
+ case 1: /* + */
VpSetInf(c, VpGetSign(b));
break;
- case OP_SW_SUB: /* - */
+ case 2: /* - */
VpSetInf(c, -VpGetSign(b));
break;
- case OP_SW_MULT: /* * */
+ case 3: /* * */
if (VpIsZero(a)) {
VpSetNaN(c);
goto NaN;
}
VpSetInf(c, VpGetSign(a)*VpGetSign(b));
break;
- case OP_SW_DIV: /* / */
+ case 4: /* / */
VpSetZero(c, VpGetSign(a)*VpGetSign(b));
}
goto Inf;
@@ -3892,13 +3721,7 @@ VpIsDefOP(Real *c, Real *a, Real *b, enum op_sw sw)
return 1; /* Results OK */
Inf:
- if (VpIsPosInf(c)) {
- return VpException(VP_EXCEPTION_INFINITY, "Computation results to 'Infinity'", 0);
- }
- else {
- return VpException(VP_EXCEPTION_INFINITY, "Computation results to '-Infinity'", 0);
- }
-
+ return VpException(VP_EXCEPTION_INFINITY, "Computation results to 'Infinity'", 0);
NaN:
return VpException(VP_EXCEPTION_NaN, "Computation results to 'NaN'", 0);
}
@@ -3973,12 +3796,12 @@ VpInit(BDIGIT BaseVal)
#ifdef BIGDECIMAL_DEBUG
if (gfDebug) {
- printf("VpInit: BaseVal = %"PRIuBDIGIT"\n", BaseVal);
- printf("\tBASE = %"PRIuBDIGIT"\n", BASE);
- printf("\tHALF_BASE = %"PRIuBDIGIT"\n", HALF_BASE);
- printf("\tBASE1 = %"PRIuBDIGIT"\n", BASE1);
- printf("\tBASE_FIG = %u\n", BASE_FIG);
- printf("\tDBLE_FIG = %d\n", DBLE_FIG);
+ printf("VpInit: BaseVal = %lu\n", BaseVal);
+ printf(" BASE = %lu\n", BASE);
+ printf(" HALF_BASE = %lu\n", HALF_BASE);
+ printf(" BASE1 = %lu\n", BASE1);
+ printf(" BASE_FIG = %u\n", BASE_FIG);
+ printf(" DBLE_FIG = %d\n", DBLE_FIG);
}
#endif /* BIGDECIMAL_DEBUG */
@@ -4005,7 +3828,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto overflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (eb - mb > 0) goto overflow;
+ if (mb < eb) goto overflow;
}
}
else if (n < 0) {
@@ -4014,7 +3837,7 @@ AddExponent(Real *a, SIGNED_VALUE n)
goto underflow;
mb = m*(SIGNED_VALUE)BASE_FIG;
eb = e*(SIGNED_VALUE)BASE_FIG;
- if (mb - eb > 0) goto underflow;
+ if (mb > eb) goto underflow;
}
a->exponent = m;
return 1;
@@ -4045,8 +3868,7 @@ overflow:
VP_EXPORT Real *
VpAlloc(size_t mx, const char *szVal)
{
- const char *orig_szVal = szVal;
- size_t i, ni, ipn, ipf, nf, ipe, ne, dot_seen, exp_seen, nalloc;
+ size_t i, ni, ipn, ipf, nf, ipe, ne, nalloc;
char v, *psz;
int sign=1;
Real *vp = NULL;
@@ -4057,28 +3879,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 */
@@ -4088,42 +3910,43 @@ VpAlloc(size_t mx, const char *szVal)
i = 0;
ipn = 0;
while ((psz[i] = szVal[ipn]) != 0) {
- 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;
+ 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;
}
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[] */
@@ -4133,55 +3956,46 @@ 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;
- dot_seen = 0;
- exp_seen = 0;
if (v) {
- /* other than digit nor \0 */
- if (szVal[i] == '.') { /* xxx. */
- dot_seen = 1;
- ++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':
- exp_seen = 1;
- ++i;
- ipe = i;
- v = szVal[i];
- if ((v == '-') || (v == '+')) ++i;
- while ((v=szVal[i]) != 0) {
- if (!ISDIGIT(v)) break;
- ++i;
- ++ne;
- }
- break;
- default:
- break;
- }
- }
- if (((ni == 0 || dot_seen) && nf == 0) || (exp_seen && ne == 0)) {
- VALUE str = rb_str_new2(orig_szVal);
- rb_raise(rb_eArgError, "invalid value for BigDecimal(): \"%"PRIsVALUE"\"", str);
- }
+ /* 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[] */
if (mx == 0) mx = 1;
@@ -4249,7 +4063,7 @@ VpAsgn(Real *c, Real *a, int isw)
/*
* c = a + b when operation = 1 or 2
- * c = a - b when operation = -1 or -2.
+ * = a - b when operation = -1 or -2.
* Returns number of significant digits of c
*/
VP_EXPORT size_t
@@ -4268,7 +4082,7 @@ VpAddSub(Real *c, Real *a, Real *b, int operation)
}
#endif /* BIGDECIMAL_DEBUG */
- if (!VpIsDefOP(c, a, b, (operation > 0) ? OP_SW_ADD : OP_SW_SUB)) return 0; /* No significant digits */
+ if (!VpIsDefOP(c, a, b, (operation > 0) ? 1 : 2)) return 0; /* No significant digits */
/* check if a or b is zero */
if (VpIsZero(a)) {
@@ -4382,7 +4196,7 @@ end_if:
}
/*
- * Addition of two values with variable precision
+ * Addition of two variable precisional variables
* a and b assuming abs(a)>abs(b).
* c = abs(a) + abs(b) ; where |a|>=|b|
*/
@@ -4604,7 +4418,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->exponent);
+ assert(a->exponent >= b->expoennt);
c->frac[0] = 0;
*av = *bv = 0;
@@ -4724,7 +4538,7 @@ VpMult(Real *c, Real *a, Real *b)
}
#endif /* BIGDECIMAL_DEBUG */
- if (!VpIsDefOP(c, a, b, OP_SW_MULT)) return 0; /* No significant digit */
+ if (!VpIsDefOP(c, a, b, 3)) return 0; /* No significant digit */
if (VpIsZero(a) || VpIsZero(b)) {
/* at least a or b is zero */
@@ -4836,7 +4650,7 @@ Exit:
/*
* c = a / b, remainder = r
*/
-VP_EXPORT size_t
+ VP_EXPORT size_t
VpDivd(Real *c, Real *r, Real *a, Real *b)
{
size_t word_a, word_b, word_c, word_r;
@@ -4854,14 +4668,14 @@ VpDivd(Real *c, Real *r, Real *a, Real *b)
#endif /*BIGDECIMAL_DEBUG */
VpSetNaN(r);
- if (!VpIsDefOP(c, a, b, OP_SW_DIV)) goto Exit;
+ if (!VpIsDefOP(c, a, b, 4)) goto Exit;
if (VpIsZero(a) && VpIsZero(b)) {
VpSetNaN(c);
- return VpException(VP_EXCEPTION_NaN, "Computation results to 'NaN'", 0);
+ return VpException(VP_EXCEPTION_NaN, "(VpDivd) 0/0 not defined(NaN)", 0);
}
if (VpIsZero(b)) {
VpSetInf(c, VpGetSign(a) * VpGetSign(b));
- return VpException(VP_EXCEPTION_ZERODIVIDE, "Divide by zero", 0);
+ return VpException(VP_EXCEPTION_ZERODIVIDE, "(VpDivd) Divide by zero", 0);
}
if (VpIsZero(a)) {
/* numerator a is zero */
@@ -5028,11 +4842,11 @@ out_side:
space_error:
#ifdef BIGDECIMAL_DEBUG
if (gfDebug) {
- 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);
+ 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);
}
#endif /* BIGDECIMAL_DEBUG */
rb_bug("ERROR(VpDivd): space for remainder too small.");
@@ -5141,7 +4955,7 @@ VpComp(Real *a, Real *b)
goto Exit;
}
- /* a and b have same exponent, then compare their significand. */
+ /* a and b have same exponent, then compare significand. */
mx = (a->Prec < b->Prec) ? a->Prec : b->Prec;
ind = 0;
while (ind < mx) {
@@ -5182,8 +4996,8 @@ Exit:
* % ... VP variable. To print '%', use '%%'.
* \n ... new line
* \b ... backspace
- * \t ... tab
- * Note: % must not appear more than once
+ * ... tab
+ * Note: % must must not appear more than once
* a ... VP variable to be printed
*/
#ifdef BIGDECIMAL_ENABLE_VPRINT
@@ -5193,6 +5007,24 @@ VPrint(FILE *fp, const char *cntl_chr, Real *a)
size_t i, j, nc, nd, ZeroSup, sep = 10;
BDIGIT m, e, nn;
+ /* Check if NaN & Inf. */
+ if (VpIsNaN(a)) {
+ fprintf(fp, SZ_NaN);
+ return 8;
+ }
+ if (VpIsPosInf(a)) {
+ fprintf(fp, SZ_INF);
+ return 8;
+ }
+ if (VpIsNegInf(a)) {
+ fprintf(fp, SZ_NINF);
+ return 9;
+ }
+ if (VpIsZero(a)) {
+ fprintf(fp, "0.0");
+ return 3;
+ }
+
j = 0;
nd = nc = 0; /* nd : number of digits in fraction part(every 10 digits, */
/* nd<=10). */
@@ -5201,20 +5033,8 @@ VPrint(FILE *fp, const char *cntl_chr, Real *a)
while (*(cntl_chr + j)) {
if (*(cntl_chr + j) == '%' && *(cntl_chr + j + 1) != '%') {
nc = 0;
- if (VpIsNaN(a)) {
- fprintf(fp, SZ_NaN);
- nc += 8;
- }
- else if (VpIsPosInf(a)) {
- fprintf(fp, SZ_INF);
- nc += 8;
- }
- else if (VpIsNegInf(a)) {
- fprintf(fp, SZ_NINF);
- nc += 9;
- }
- else if (!VpIsZero(a)) {
- if (BIGDECIMAL_NEGATIVE_P(a)) {
+ if (!VpIsZero(a)) {
+ if (VpGetSign(a) < 0) {
fprintf(fp, "-");
++nc;
}
@@ -5303,7 +5123,7 @@ VpFormatSt(char *psz, size_t fFmt)
if (!ch) break;
if (ISSPACE(ch) || ch=='-' || ch=='+') continue;
if (ch == '.') { nf = 0; continue; }
- if (ch == 'E' || ch == 'e') break;
+ if (ch == 'E') break;
if (++nf > fFmt) {
memmove(psz + i + 1, psz + i, ie - i + 1);
@@ -5352,7 +5172,7 @@ VpSzMantissa(Real *a,char *psz)
ZeroSup = 1; /* Flag not to print the leading zeros as 0.00xxxxEnn */
if (!VpIsZero(a)) {
- if (BIGDECIMAL_NEGATIVE_P(a)) *psz++ = '-';
+ if (VpGetSign(a) < 0) *psz++ = '-';
n = a->Prec;
for (i = 0; i < n; ++i) {
m = BASE1;
@@ -5380,7 +5200,7 @@ VpSzMantissa(Real *a,char *psz)
VP_EXPORT int
VpToSpecialString(Real *a,char *psz,int fPlus)
-/* fPlus = 0: default, 1: set ' ' before digits, 2: set '+' before digits. */
+ /* fPlus =0:default, =1: set ' ' before digits , =2: set '+' before digits. */
{
if (VpIsNaN(a)) {
sprintf(psz,SZ_NaN);
@@ -5415,7 +5235,7 @@ VpToSpecialString(Real *a,char *psz,int fPlus)
VP_EXPORT void
VpToString(Real *a, char *psz, size_t fFmt, int fPlus)
-/* fPlus = 0: default, 1: set ' ' before digits, 2: set '+' before digits. */
+/* fPlus =0:default, =1: set ' ' before digits , =2:set '+' before digits. */
{
size_t i, n, ZeroSup;
BDIGIT shift, m, e, nn;
@@ -5426,7 +5246,7 @@ VpToString(Real *a, char *psz, size_t fFmt, int fPlus)
ZeroSup = 1; /* Flag not to print the leading zeros as 0.00xxxxEnn */
- if (BIGDECIMAL_NEGATIVE_P(a)) *psz++ = '-';
+ if (VpGetSign(a) < 0) *psz++ = '-';
else if (fPlus == 1) *psz++ = ' ';
else if (fPlus == 2) *psz++ = '+';
@@ -5457,13 +5277,13 @@ VpToString(Real *a, char *psz, size_t fFmt, int fPlus)
while (psz[-1] == '0') {
*(--psz) = 0;
}
- sprintf(psz, "e%"PRIdSIZE, ex);
+ sprintf(psz, "E%"PRIdSIZE, ex);
if (fFmt) VpFormatSt(pszSav, fFmt);
}
VP_EXPORT void
VpToFString(Real *a, char *psz, size_t fFmt, int fPlus)
-/* fPlus = 0: default, 1: set ' ' before digits, 2: set '+' before digits. */
+/* fPlus =0:default,=1: set ' ' before digits ,set '+' before digits. */
{
size_t i, n;
BDIGIT m, e, nn;
@@ -5472,7 +5292,7 @@ VpToFString(Real *a, char *psz, size_t fFmt, int fPlus)
if (VpToSpecialString(a, psz, fPlus)) return;
- if (BIGDECIMAL_NEGATIVE_P(a)) *psz++ = '-';
+ if (VpGetSign(a) < 0) *psz++ = '-';
else if (fPlus == 1) *psz++ = ' ';
else if (fPlus == 2) *psz++ = '+';
@@ -5894,22 +5714,21 @@ VpSqrt(Real *y, Real *x)
ssize_t nr;
double val;
- /* Zero or +Infinity ? */
- if (VpIsZero(x) || VpIsPosInf(x)) {
- VpAsgn(y,x,1);
+ /* Zero, NaN or Infinity ? */
+ if (!VpHasVal(x)) {
+ if (VpIsZero(x) || VpGetSign(x) > 0) {
+ VpAsgn(y,x,1);
+ goto Exit;
+ }
+ VpSetNaN(y);
+ return VpException(VP_EXCEPTION_OP, "(VpSqrt) SQRT(NaN or negative value)", 0);
goto Exit;
}
/* Negative ? */
- if (BIGDECIMAL_NEGATIVE_P(x)) {
+ if (VpGetSign(x) < 0) {
VpSetNaN(y);
- return VpException(VP_EXCEPTION_OP, "sqrt of negative value", 0);
- }
-
- /* NaN ? */
- if (VpIsNaN(x)) {
- VpSetNaN(y);
- return VpException(VP_EXCEPTION_OP, "sqrt of 'NaN'(Not a Number)", 0);
+ return VpException(VP_EXCEPTION_OP, "(VpSqrt) SQRT(negative value)", 0);
}
/* One ? */
@@ -5988,12 +5807,17 @@ Exit:
}
/*
+ *
+ * nf: digit position for operation.
+ *
+ */
+VP_EXPORT int
+VpMidRound(Real *y, unsigned short f, ssize_t nf)
+/*
* Round relatively from the decimal point.
* f: rounding mode
* nf: digit location to round from the decimal point.
*/
-VP_EXPORT int
-VpMidRound(Real *y, unsigned short f, ssize_t nf)
{
/* fracf: any positive digit under rounding position? */
/* fracf_1further: any positive digits under one further than the rounding position? */
@@ -6095,10 +5919,10 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf)
if (v > 5 || (v == 5 && fracf_1further)) ++div;
break;
case VP_ROUND_CEIL:
- if (fracf && BIGDECIMAL_POSITIVE_P(y)) ++div;
+ if (fracf && (VpGetSign(y) > 0)) ++div;
break;
case VP_ROUND_FLOOR:
- if (fracf && BIGDECIMAL_NEGATIVE_P(y)) ++div;
+ if (fracf && (VpGetSign(y) < 0)) ++div;
break;
case VP_ROUND_HALF_EVEN: /* Banker's rounding */
if (v > 5) ++div;
@@ -6217,10 +6041,10 @@ VpInternalRound(Real *c, size_t ixDigit, BDIGIT vPrev, BDIGIT v)
if (v >= 6) f = 1;
break;
case VP_ROUND_CEIL:
- if (v && BIGDECIMAL_POSITIVE_P(c)) f = 1;
+ if (v && (VpGetSign(c) > 0)) f = 1;
break;
case VP_ROUND_FLOOR:
- if (v && BIGDECIMAL_NEGATIVE_P(c)) f = 1;
+ if (v && (VpGetSign(c) < 0)) f = 1;
break;
case VP_ROUND_HALF_EVEN: /* Banker's rounding */
/* as per VP_ROUND_HALF_DOWN, because this is the last digit of precision,
@@ -6357,7 +6181,7 @@ VpPower(Real *y, Real *x, SIGNED_VALUE n)
if (x->exponent == 1 && x->Prec == 1 && x->frac[0] == 1) {
/* abs(x) = 1 */
VpSetOne(y);
- if (BIGDECIMAL_POSITIVE_P(x)) goto Exit;
+ if (VpGetSign(x) > 0) goto Exit;
if ((n % 2) == 0) goto Exit;
VpSetSign(y, -1);
goto Exit;
@@ -6402,7 +6226,7 @@ Exit:
if (gfDebug) {
VPrint(stdout, "VpPower y=%\n", y);
VPrint(stdout, "VpPower x=%\n", x);
- printf(" n=%"PRIdVALUE"\n", n);
+ printf(" n=%d\n", n);
}
#endif /* BIGDECIMAL_DEBUG */
VpFree(w2);
@@ -6437,10 +6261,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"]=%"PRIuBDIGIT"\n", i, v->frac[i]);
+ printf(" Frac[%"PRIuSIZE"]=%lu\n", i, v->frac[i]);
printf(" Prec. =%"PRIuSIZE"\n", v->Prec);
printf(" Exp. =%"PRIdVALUE"\n", v->exponent);
- printf(" BASE =%"PRIuBDIGIT"\n", BASE);
+ printf(" BASE =%lu\n", BASE);
return 3;
}
}
diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec
index c8c90870ea..e4f58c1adf 100644
--- a/ext/bigdecimal/bigdecimal.gemspec
+++ b/ext/bigdecimal/bigdecimal.gemspec
@@ -1,26 +1,23 @@
-# coding: utf-8
-
-bigdecimal_version = '1.3.4'
+# -*- ruby -*-
+_VERSION = "1.2.5"
+date = %w$Date:: $[1]
Gem::Specification.new do |s|
- s.name = "bigdecimal"
- s.version = bigdecimal_version
- s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"]
- s.email = ["mrkn@mrkn.jp"]
-
- s.summary = "Arbitrary-precision decimal floating-point number library."
- s.description = "This library provides arbitrary-precision decimal floating-point number class."
- s.homepage = "https://github.com/ruby/bigdecimal"
- s.license = "ruby"
-
- s.require_paths = %w[lib]
- s.extensions = %w[ext/bigdecimal/extconf.rb]
- s.files = %w[
+ s.name = "bigdecimal"
+ s.version = _VERSION
+ s.date = date
+ 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.files = %w[
bigdecimal.gemspec
- ext/bigdecimal/bigdecimal.c
- ext/bigdecimal/bigdecimal.h
- ext/bigdecimal/depend
- ext/bigdecimal/extconf.rb
+ bigdecimal.c
+ bigdecimal.h
+ README
+ depend extconf.rb
lib/bigdecimal/jacobian.rb
lib/bigdecimal/ludcmp.rb
lib/bigdecimal/math.rb
@@ -30,10 +27,5 @@ Gem::Specification.new do |s|
sample/nlsolve.rb
sample/pi.rb
]
-
- s.add_development_dependency "rake", "~> 10.0"
- s.add_development_dependency "rake-compiler", ">= 0.9"
- s.add_development_dependency "rake-compiler-dock", ">= 0.6.1"
- s.add_development_dependency "minitest", "~> 4.7.5"
- s.add_development_dependency "pry"
+ s.extensions = %w[extconf.rb]
end
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index e53a752aa5..9d3e0fcd29 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -4,13 +4,18 @@
*
* 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
#define RUBY_BIG_DECIMAL_H 1
-#define RUBY_NO_OLD_COMPATIBILITY
-
#include "ruby/ruby.h"
#include <float.h>
@@ -38,35 +43,13 @@
# 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
@@ -92,62 +75,6 @@ llabs(LONG_LONG const x)
}
#endif
-#ifndef HAVE_FINITE
-static int
-finite(double)
-{
- return !isnan(n) && !isinf(n);
-}
-#endif
-
-#ifndef isfinite
-# ifndef HAVE_ISFINITE
-# define HAVE_ISFINITE 1
-# define isfinite(x) finite(x)
-# endif
-#endif
-
-#ifndef FIX_CONST_VALUE_PTR
-# 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
-#endif
-
-#ifndef HAVE_RB_ARRAY_CONST_PTR
-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);
-}
-#endif
-
-#ifndef RARRAY_CONST_PTR
-# define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
-#endif
-
-#ifndef RARRAY_AREF
-# define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i])
-#endif
-
-#ifndef HAVE_RB_SYM2STR
-static inline VALUE
-rb_sym2str(VALUE sym)
-{
- return rb_id2str(SYM2ID(sym));
-}
-#endif
-
-#ifndef ST2FIX
-# undef RB_ST2FIX
-# define RB_ST2FIX(h) LONG2FIX((long)(h))
-# define ST2FIX(h) RB_ST2FIX(h)
-#endif
-
#ifdef vabs
# undef vabs
#endif
@@ -240,11 +167,11 @@ extern VALUE rb_cBigDecimal;
typedef struct {
VALUE obj; /* Back pointer(VALUE) for Ruby object. */
size_t MaxPrec; /* Maximum precision size */
- /* This is the actual size of frac[] */
+ /* This is the actual size of pfrac[] */
/*(frac[0] to frac[MaxPrec] are available). */
size_t Prec; /* Current precision size. */
- /* This indicates how much the */
- /* array frac[] is actually used. */
+ /* This indicates how much the. */
+ /* the array frac[] is actually used. */
SIGNED_VALUE exponent; /* Exponent part. */
short sign; /* Attributes of the value. */
/*
diff --git a/ext/bigdecimal/depend b/ext/bigdecimal/depend
index 6783192b30..0a83c1f17f 100644
--- a/ext/bigdecimal/depend
+++ b/ext/bigdecimal/depend
@@ -1,13 +1 @@
-# 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/ruby.h
-bigdecimal.o: $(hdrdir)/ruby/st.h
-bigdecimal.o: $(hdrdir)/ruby/subst.h
-bigdecimal.o: $(hdrdir)/ruby/util.h
-bigdecimal.o: bigdecimal.c
-bigdecimal.o: bigdecimal.h
-# AUTOGENERATED DEPENDENCIES END
+bigdecimal.o: bigdecimal.c bigdecimal.h $(HDRS) $(ruby_headers) $(hdrdir)/ruby/util.h
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index e565da891a..d6be3e584e 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,35 +1,6 @@
-# frozen_string_literal: false
require 'mkmf'
-gemspec_name = gemspec_path = nil
-unless ['', '../../'].any? {|dir|
- gemspec_name = "#{dir}bigdecimal.gemspec"
- gemspec_path = File.expand_path("../#{gemspec_name}", __FILE__)
- File.file?(gemspec_path)
- }
- $stderr.puts "Unable to find bigdecimal.gemspec"
- abort
-end
-
-bigdecimal_version =
- IO.readlines(gemspec_path)
- .grep(/\Abigdecimal_version\s+=\s+/)[0][/\'([\d\.]+)\'/, 1]
-
-$defs << %Q[-DRUBY_BIGDECIMAL_VERSION=\\"#{bigdecimal_version}\\"]
-
-alias __have_macro__ have_macro
-
have_func("labs", "stdlib.h")
have_func("llabs", "stdlib.h")
-have_func("finite", "math.h")
-have_func("isfinite", "math.h")
-
-have_type("struct RRational", "ruby.h")
-have_func("rb_rational_num", "ruby.h")
-have_func("rb_rational_den", "ruby.h")
-have_func("rb_array_const_ptr", "ruby.h")
-have_func("rb_sym2str", "ruby.h")
-create_makefile('bigdecimal') {|mf|
- mf << "\nall:\n\nextconf.h: $(srcdir)/#{gemspec_name}\n"
-}
+create_makefile('bigdecimal')
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 9cad06c09b..d56caab0d3 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# require 'bigdecimal/jacobian'
#
diff --git a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
index dd265e482a..6cbe29b6da 100644
--- a/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
+++ b/ext/bigdecimal/lib/bigdecimal/ludcmp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'bigdecimal'
#
diff --git a/ext/bigdecimal/lib/bigdecimal/math.rb b/ext/bigdecimal/lib/bigdecimal/math.rb
index 0b9d0648bb..4a4fcc2b06 100644
--- a/ext/bigdecimal/lib/bigdecimal/math.rb
+++ b/ext/bigdecimal/lib/bigdecimal/math.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'bigdecimal'
#
@@ -26,7 +25,7 @@ require 'bigdecimal'
# include BigMath
#
# a = BigDecimal((PI(100)/2).to_s)
-# puts sin(a,100) # => 0.99999999999999999999......e0
+# puts sin(a,100) # => 0.10000000000000000000......E1
#
module BigMath
module_function
@@ -37,8 +36,8 @@ module BigMath
# Computes the square root of +decimal+ to the specified number of digits of
# precision, +numeric+.
#
- # BigMath.sqrt(BigDecimal('2'), 16).to_s
- # #=> "0.1414213562373095048801688724e1"
+ # BigMath.sqrt(BigDecimal.new('2'), 16).to_s
+ # #=> "0.1414213562373095048801688724E1"
#
def sqrt(x, prec)
x.sqrt(prec)
@@ -53,7 +52,7 @@ module BigMath
# If +decimal+ is Infinity or NaN, returns NaN.
#
# BigMath.sin(BigMath.PI(5)/4, 5).to_s
- # #=> "0.70710678118654752440082036563292800375e0"
+ # #=> "0.70710678118654752440082036563292800375E0"
#
def sin(x, prec)
raise ArgumentError, "Zero or negative precision for sin" if prec <= 0
@@ -97,7 +96,7 @@ module BigMath
# If +decimal+ is Infinity or NaN, returns NaN.
#
# BigMath.cos(BigMath.PI(4), 16).to_s
- # #=> "-0.999999999999999999999999999999856613163740061349e0"
+ # #=> "-0.999999999999999999999999999999856613163740061349E0"
#
def cos(x, prec)
raise ArgumentError, "Zero or negative precision for cos" if prec <= 0
@@ -140,8 +139,8 @@ module BigMath
#
# If +decimal+ is NaN, returns NaN.
#
- # BigMath.atan(BigDecimal('-1'), 16).to_s
- # #=> "-0.785398163397448309615660845819878471907514682065e0"
+ # BigMath.atan(BigDecimal.new('-1'), 16).to_s
+ # #=> "-0.785398163397448309615660845819878471907514682065E0"
#
def atan(x, prec)
raise ArgumentError, "Zero or negative precision for atan" if prec <= 0
@@ -178,7 +177,7 @@ module BigMath
# +numeric+.
#
# BigMath.PI(10).to_s
- # #=> "0.3141592653589793238462643388813853786957412e1"
+ # #=> "0.3141592653589793238462643388813853786957412E1"
#
def PI(prec)
raise ArgumentError, "Zero or negative precision for PI" if prec <= 0
@@ -223,7 +222,7 @@ module BigMath
# digits of precision, +numeric+.
#
# BigMath.E(10).to_s
- # #=> "0.271828182845904523536028752390026306410273e1"
+ # #=> "0.271828182845904523536028752390026306410273E1"
#
def E(prec)
raise ArgumentError, "Zero or negative precision for E" if prec <= 0
diff --git a/ext/bigdecimal/lib/bigdecimal/newton.rb b/ext/bigdecimal/lib/bigdecimal/newton.rb
index 85bacb7f2e..db1a5ad99e 100644
--- a/ext/bigdecimal/lib/bigdecimal/newton.rb
+++ b/ext/bigdecimal/lib/bigdecimal/newton.rb
@@ -1,4 +1,3 @@
-# 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 911fa6fe3a..82c82c8e1e 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -1,79 +1,71 @@
-# frozen_string_literal: false
+# BigDecimal extends the native Integer class to provide the #to_d method.
#
-#--
-# bigdecimal/util extends various native classes to provide the #to_d method,
-# and provides BigDecimal#to_d and BigDecimal#to_digits.
-#++
-
-
+# When you require the BigDecimal library in your application, this methodwill
+# be available on Integer objects.
class Integer < Numeric
# call-seq:
# int.to_d -> bigdecimal
#
- # Returns the value of +int+ as a BigDecimal.
+ # Convert +int+ to a BigDecimal and return it.
#
# require 'bigdecimal'
# require 'bigdecimal/util'
#
- # 42.to_d # => 0.42e2
- #
- # See also BigDecimal::new.
+ # 42.to_d
+ # # => #<BigDecimal:1008ef070,'0.42E2',9(36)>
#
def to_d
BigDecimal(self)
end
end
-
+# BigDecimal extends the native Float class to provide the #to_d method.
+#
+# When you require BigDecimal in your application, this method will be
+# available on Float objects.
class Float < Numeric
# call-seq:
- # float.to_d -> bigdecimal
- # float.to_d(precision) -> bigdecimal
+ # flt.to_d -> bigdecimal
#
- # Returns the value of +float+ as a BigDecimal.
- # The +precision+ parameter is used to determine the number of
- # significant digits for the result (the default is Float::DIG).
+ # Convert +flt+ to a BigDecimal and return it.
#
# require 'bigdecimal'
# require 'bigdecimal/util'
#
- # 0.5.to_d # => 0.5e0
- # 1.234.to_d(2) # => 0.12e1
- #
- # See also BigDecimal::new.
+ # 0.5.to_d
+ # # => #<BigDecimal:1dc69e0,'0.5E0',9(18)>
#
def to_d(precision=nil)
BigDecimal(self, precision || Float::DIG)
end
end
-
+# BigDecimal extends the native String class to provide the #to_d method.
+#
+# When you require BigDecimal in your application, this method will be
+# available on String objects.
class String
# call-seq:
- # str.to_d -> bigdecimal
+ # string.to_d -> bigdecimal
#
- # Returns the result of interpreting leading characters in +str+
- # as a BigDecimal.
+ # Convert +string+ to a BigDecimal and return it.
#
# require 'bigdecimal'
# require 'bigdecimal/util'
#
- # "0.5".to_d # => 0.5e0
- # "123.45e1".to_d # => 0.12345e4
- # "45.67 degrees".to_d # => 0.4567e2
- #
- # See also BigDecimal::new.
+ # "0.5".to_d
+ # # => #<BigDecimal:1dc69e0,'0.5E0',9(18)>
#
def to_d
- begin
- BigDecimal(self)
- rescue ArgumentError
- BigDecimal(0)
- end
+ BigDecimal(self)
end
end
-
+# BigDecimal extends the native Numeric class to provide the #to_digits and
+# #to_d methods.
+#
+# When you require BigDecimal in your application, this method will be
+# available on BigDecimal objects.
class BigDecimal < Numeric
# call-seq:
# a.to_digits -> string
@@ -81,11 +73,12 @@ class BigDecimal < Numeric
# Converts a BigDecimal to a String of the form "nnnnnn.mmm".
# This method is deprecated; use BigDecimal#to_s("F") instead.
#
+ # require 'bigdecimal'
# require 'bigdecimal/util'
#
- # d = BigDecimal("3.14")
- # d.to_digits # => "3.14"
- #
+ # d = BigDecimal.new("3.14")
+ # d.to_digits
+ # # => "3.14"
def to_digits
if self.nan? || self.infinite? || self.zero?
self.to_s
@@ -100,35 +93,35 @@ class BigDecimal < Numeric
# a.to_d -> bigdecimal
#
# Returns self.
- #
- # require 'bigdecimal/util'
- #
- # d = BigDecimal("3.14")
- # d.to_d # => 0.314e1
- #
def to_d
self
end
end
-
+# BigDecimal extends the native Rational class to provide the #to_d method.
+#
+# When you require BigDecimal in your application, this method will be
+# available on Rational objects.
class Rational < Numeric
# call-seq:
- # rat.to_d(precision) -> bigdecimal
+ # r.to_d(precision) -> bigdecimal
#
- # Returns the value as a BigDecimal.
+ # Converts a Rational to a BigDecimal.
#
- # The required +precision+ parameter is used to determine the number of
- # significant digits for the result.
- #
- # require 'bigdecimal'
- # require 'bigdecimal/util'
- #
- # Rational(22, 7).to_d(3) # => 0.314e1
- #
- # See also BigDecimal::new.
+ # The required +precision+ parameter is used to determine the amount of
+ # significant digits for the result. See BigDecimal#div for more information,
+ # as it is used along with the #denominator and the +precision+ for
+ # parameters.
#
+ # r = (22/7.0).to_r
+ # # => (7077085128725065/2251799813685248)
+ # r.to_d(3)
+ # # => #<BigDecimal:1a44d08,'0.314E1',18(36)>
def to_d(precision)
- BigDecimal(self, precision)
+ if precision <= 0
+ raise ArgumentError, "negative precision"
+ end
+ num = self.numerator
+ BigDecimal(num).div(self.denominator, precision)
end
end
diff --git a/ext/bigdecimal/sample/linear.rb b/ext/bigdecimal/sample/linear.rb
index 3b23269f8a..a33255f591 100644
--- a/ext/bigdecimal/sample/linear.rb
+++ b/ext/bigdecimal/sample/linear.rb
@@ -1,5 +1,4 @@
#!/usr/local/bin/ruby
-# frozen_string_literal: false
#
# linear.rb
diff --git a/ext/bigdecimal/sample/nlsolve.rb b/ext/bigdecimal/sample/nlsolve.rb
index b1dd08e0a3..7fa921c2c3 100644
--- a/ext/bigdecimal/sample/nlsolve.rb
+++ b/ext/bigdecimal/sample/nlsolve.rb
@@ -1,5 +1,4 @@
#!/usr/local/bin/ruby
-# frozen_string_literal: false
#
# nlsolve.rb
diff --git a/ext/bigdecimal/sample/pi.rb b/ext/bigdecimal/sample/pi.rb
index ea9663896c..2f7dd27d60 100644
--- a/ext/bigdecimal/sample/pi.rb
+++ b/ext/bigdecimal/sample/pi.rb
@@ -1,5 +1,4 @@
#!/usr/local/bin/ruby
-# frozen_string_literal: false
#
# pi.rb
diff --git a/ext/cgi/escape/depend b/ext/cgi/escape/depend
deleted file mode 100644
index 099bb3f14b..0000000000
--- a/ext/cgi/escape/depend
+++ /dev/null
@@ -1,16 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-escape.o: $(RUBY_EXTCONF_H)
-escape.o: $(arch_hdrdir)/ruby/config.h
-escape.o: $(hdrdir)/ruby/backward.h
-escape.o: $(hdrdir)/ruby/defines.h
-escape.o: $(hdrdir)/ruby/encoding.h
-escape.o: $(hdrdir)/ruby/intern.h
-escape.o: $(hdrdir)/ruby/missing.h
-escape.o: $(hdrdir)/ruby/onigmo.h
-escape.o: $(hdrdir)/ruby/oniguruma.h
-escape.o: $(hdrdir)/ruby/ruby.h
-escape.o: $(hdrdir)/ruby/st.h
-escape.o: $(hdrdir)/ruby/subst.h
-escape.o: $(top_srcdir)/include/ruby.h
-escape.o: escape.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
deleted file mode 100644
index ced1b182eb..0000000000
--- a/ext/cgi/escape/escape.c
+++ /dev/null
@@ -1,422 +0,0 @@
-#include "ruby.h"
-#include "ruby/encoding.h"
-
-RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
-RUBY_EXTERN const char ruby_hexdigits[];
-RUBY_EXTERN const signed char ruby_digit36_to_number_table[];
-#define lower_hexdigits (ruby_hexdigits+0)
-#define upper_hexdigits (ruby_hexdigits+16)
-#define char_to_number(c) ruby_digit36_to_number_table[(unsigned char)(c)]
-
-static VALUE rb_cCGI, rb_mUtil, rb_mEscape;
-static ID id_accept_charset;
-
-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, beg = 0;
- VALUE dest = 0;
- 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 (!dest) {
- 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 (dest) {
- rb_str_cat(dest, cstr + beg, len - beg);
- preserve_original_state(str, dest);
- return dest;
- }
- else {
- return rb_str_dup(str);
- }
-}
-
-static VALUE
-optimized_unescape_html(VALUE str)
-{
- enum {UNICODE_MAX = 0x10ffff};
- rb_encoding *enc = rb_enc_get(str);
- unsigned long charlimit = (strcasecmp(rb_enc_name(enc), "UTF-8") == 0 ? UNICODE_MAX :
- strcasecmp(rb_enc_name(enc), "ISO-8859-1") == 0 ? 256 :
- 128);
- long i, len, beg = 0;
- size_t clen, plen;
- int overflow;
- const char *cstr;
- char buf[6];
- VALUE dest = 0;
-
- len = RSTRING_LEN(str);
- cstr = RSTRING_PTR(str);
-
- for (i = 0; i < len; i++) {
- unsigned long cc;
- char c = cstr[i];
- if (c != '&') continue;
- plen = i - beg;
- if (++i >= len) break;
- c = (unsigned char)cstr[i];
-#define MATCH(s) (len - i >= (int)rb_strlen_lit(s) && \
- memcmp(&cstr[i], s, rb_strlen_lit(s)) == 0 && \
- (i += rb_strlen_lit(s) - 1, 1))
- switch (c) {
- case 'a':
- ++i;
- if (MATCH("pos;")) {
- c = '\'';
- }
- else if (MATCH("mp;")) {
- c = '&';
- }
- else continue;
- break;
- case 'q':
- ++i;
- if (MATCH("uot;")) {
- c = '"';
- }
- else continue;
- break;
- case 'g':
- ++i;
- if (MATCH("t;")) {
- c = '>';
- }
- else continue;
- break;
- case 'l':
- ++i;
- if (MATCH("t;")) {
- c = '<';
- }
- else continue;
- break;
- case '#':
- if (len - ++i >= 2 && ISDIGIT(cstr[i])) {
- cc = ruby_scan_digits(&cstr[i], len-i, 10, &clen, &overflow);
- }
- else if ((cstr[i] == 'x' || cstr[i] == 'X') && len - ++i >= 2 && ISXDIGIT(cstr[i])) {
- cc = ruby_scan_digits(&cstr[i], len-i, 16, &clen, &overflow);
- }
- else continue;
- i += clen;
- if (overflow || cc >= charlimit || cstr[i] != ';') continue;
- if (!dest) {
- dest = rb_str_buf_new(len);
- }
- rb_str_cat(dest, cstr + beg, plen);
- if (charlimit > 256) {
- rb_str_cat(dest, buf, rb_enc_mbcput((OnigCodePoint)cc, buf, enc));
- }
- else {
- c = (unsigned char)cc;
- rb_str_cat(dest, &c, 1);
- }
- beg = i + 1;
- continue;
- default:
- --i;
- continue;
- }
- if (!dest) {
- dest = rb_str_buf_new(len);
- }
- rb_str_cat(dest, cstr + beg, plen);
- rb_str_cat(dest, &c, 1);
- beg = i + 1;
- }
-
- if (dest) {
- rb_str_cat(dest, cstr + beg, len - beg);
- preserve_original_state(str, dest);
- return dest;
- }
- else {
- return rb_str_dup(str);
- }
-}
-
-static unsigned char
-url_unreserved_char(unsigned char c)
-{
- switch (c) {
- case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j':
- case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J':
- case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
- case '-': case '.': case '_': case '~':
- return 1;
- default:
- break;
- }
- return 0;
-}
-
-static VALUE
-optimized_escape(VALUE str)
-{
- long i, len, beg = 0;
- VALUE dest = 0;
- const char *cstr;
- char buf[4] = {'%'};
-
- len = RSTRING_LEN(str);
- cstr = RSTRING_PTR(str);
-
- for (i = 0; i < len; ++i) {
- const unsigned char c = (unsigned char)cstr[i];
- if (!url_unreserved_char(c)) {
- if (!dest) {
- dest = rb_str_buf_new(len);
- }
-
- rb_str_cat(dest, cstr + beg, i - beg);
- beg = i + 1;
-
- if (c == ' ') {
- rb_str_cat_cstr(dest, "+");
- }
- else {
- buf[1] = upper_hexdigits[(c >> 4) & 0xf];
- buf[2] = upper_hexdigits[c & 0xf];
- rb_str_cat(dest, buf, 3);
- }
- }
- }
-
- if (dest) {
- rb_str_cat(dest, cstr + beg, len - beg);
- preserve_original_state(str, dest);
- return dest;
- }
- else {
- return rb_str_dup(str);
- }
-}
-
-static VALUE
-optimized_unescape(VALUE str, VALUE encoding)
-{
- long i, len, beg = 0;
- VALUE dest = 0;
- const char *cstr;
- rb_encoding *enc = rb_to_encoding(encoding);
- int cr, origenc, encidx = rb_enc_to_index(enc);
-
- len = RSTRING_LEN(str);
- cstr = RSTRING_PTR(str);
-
- for (i = 0; i < len; ++i) {
- char buf[1];
- const char c = cstr[i];
- int clen = 0;
- if (c == '%') {
- if (i + 3 > len) break;
- if (!ISXDIGIT(cstr[i+1])) continue;
- if (!ISXDIGIT(cstr[i+2])) continue;
- buf[0] = ((char_to_number(cstr[i+1]) << 4)
- | char_to_number(cstr[i+2]));
- clen = 2;
- }
- else if (c == '+') {
- buf[0] = ' ';
- }
- else {
- continue;
- }
-
- if (!dest) {
- dest = rb_str_buf_new(len);
- }
-
- rb_str_cat(dest, cstr + beg, i - beg);
- i += clen;
- beg = i + 1;
-
- rb_str_cat(dest, buf, 1);
- }
-
- if (dest) {
- rb_str_cat(dest, cstr + beg, len - beg);
- preserve_original_state(str, dest);
- cr = ENC_CODERANGE_UNKNOWN;
- }
- else {
- dest = rb_str_dup(str);
- cr = ENC_CODERANGE(str);
- }
- origenc = rb_enc_get_index(str);
- if (origenc != encidx) {
- rb_enc_associate_index(dest, encidx);
- if (!ENC_CODERANGE_CLEAN_P(rb_enc_str_coderange(dest))) {
- rb_enc_associate_index(dest, origenc);
- if (cr != ENC_CODERANGE_UNKNOWN)
- ENC_CODERANGE_SET(dest, cr);
- }
- }
- return dest;
-}
-
-/*
- * 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);
- }
-}
-
-/*
- * call-seq:
- * CGI.unescapeHTML(string) -> string
- *
- * Returns HTML-unescaped string.
- *
- */
-static VALUE
-cgiesc_unescape_html(VALUE self, VALUE str)
-{
- StringValue(str);
-
- if (rb_enc_str_asciicompat_p(str)) {
- return optimized_unescape_html(str);
- }
- else {
- return rb_call_super(1, &str);
- }
-}
-
-/*
- * call-seq:
- * CGI.escape(string) -> string
- *
- * Returns URL-escaped string.
- *
- */
-static VALUE
-cgiesc_escape(VALUE self, VALUE str)
-{
- StringValue(str);
-
- if (rb_enc_str_asciicompat_p(str)) {
- return optimized_escape(str);
- }
- else {
- return rb_call_super(1, &str);
- }
-}
-
-static VALUE
-accept_charset(int argc, VALUE *argv, VALUE self)
-{
- if (argc > 0)
- return argv[0];
- return rb_cvar_get(CLASS_OF(self), id_accept_charset);
-}
-
-/*
- * call-seq:
- * CGI.unescape(string, encoding=@@accept_charset) -> string
- *
- * Returns URL-unescaped string.
- *
- */
-static VALUE
-cgiesc_unescape(int argc, VALUE *argv, VALUE self)
-{
- VALUE str = (rb_check_arity(argc, 1, 2), argv[0]);
-
- StringValue(str);
-
- if (rb_enc_str_asciicompat_p(str)) {
- VALUE enc = accept_charset(argc-1, argv+1, self);
- return optimized_unescape(str, enc);
- }
- else {
- return rb_call_super(argc, argv);
- }
-}
-
-void
-Init_escape(void)
-{
- id_accept_charset = rb_intern_const("@@accept_charset");
- InitVM(escape);
-}
-
-void
-InitVM_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_define_method(rb_mEscape, "unescapeHTML", cgiesc_unescape_html, 1);
- rb_define_method(rb_mEscape, "escape", cgiesc_escape, 1);
- rb_define_method(rb_mEscape, "unescape", cgiesc_unescape, -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
deleted file mode 100644
index 16e8ff224d..0000000000
--- a/ext/cgi/escape/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'mkmf'
-
-create_makefile 'cgi/escape'
diff --git a/ext/continuation/continuation.c b/ext/continuation/continuation.c
index c678371cca..ae69b66cd8 100644
--- a/ext/continuation/continuation.c
+++ b/ext/continuation/continuation.c
@@ -1,13 +1,8 @@
-#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/depend b/ext/continuation/depend
deleted file mode 100644
index 9e47f27f3a..0000000000
--- a/ext/continuation/depend
+++ /dev/null
@@ -1,12 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-continuation.o: $(RUBY_EXTCONF_H)
-continuation.o: $(arch_hdrdir)/ruby/config.h
-continuation.o: $(hdrdir)/ruby/backward.h
-continuation.o: $(hdrdir)/ruby/defines.h
-continuation.o: $(hdrdir)/ruby/intern.h
-continuation.o: $(hdrdir)/ruby/missing.h
-continuation.o: $(hdrdir)/ruby/ruby.h
-continuation.o: $(hdrdir)/ruby/st.h
-continuation.o: $(hdrdir)/ruby/subst.h
-continuation.o: continuation.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/continuation/extconf.rb b/ext/continuation/extconf.rb
index 6d54ec01a5..17e2d056db 100644
--- a/ext/continuation/extconf.rb
+++ b/ext/continuation/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
create_makefile('continuation')
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
index f46955aae2..93cb2a5c9e 100644
--- a/ext/coverage/coverage.c
+++ b/ext/coverage/coverage.c
@@ -10,10 +10,8 @@
#include "ruby.h"
#include "vm_core.h"
-#include "gc.h"
-static int current_mode;
-static VALUE me2counter = Qnil;
+static VALUE rb_coverages = Qundef;
/*
* call-seq:
@@ -22,249 +20,58 @@ static VALUE me2counter = Qnil;
* Enables coverage measurement.
*/
static VALUE
-rb_coverage_start(int argc, VALUE *argv, VALUE klass)
+rb_coverage_start(VALUE klass)
{
- VALUE coverages, opt;
- int mode;
-
- rb_scan_args(argc, argv, "01", &opt);
-
- if (argc == 0) {
- mode = 0; /* compatible mode */
- }
- else if (opt == ID2SYM(rb_intern("all"))) {
- mode = COVERAGE_TARGET_LINES | COVERAGE_TARGET_BRANCHES | COVERAGE_TARGET_METHODS;
- }
- else {
- mode = 0;
- opt = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
-
- if (RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("lines")))))
- mode |= COVERAGE_TARGET_LINES;
- if (RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("branches")))))
- mode |= COVERAGE_TARGET_BRANCHES;
- if (RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("methods")))))
- mode |= COVERAGE_TARGET_METHODS;
- if (mode == 0) {
- rb_raise(rb_eRuntimeError, "no measuring target is specified");
+ if (!RTEST(rb_get_coverages())) {
+ if (rb_coverages == Qundef) {
+ rb_coverages = rb_hash_new();
+ rb_obj_hide(rb_coverages);
}
- }
-
- if (mode & COVERAGE_TARGET_METHODS) {
- me2counter = rb_hash_new_compare_by_id();
- }
- else {
- me2counter = Qnil;
- }
-
- coverages = rb_get_coverages();
- if (!RTEST(coverages)) {
- coverages = rb_hash_new();
- rb_obj_hide(coverages);
- current_mode = mode;
- if (mode == 0) mode = COVERAGE_TARGET_LINES;
- rb_set_coverages(coverages, mode, me2counter);
- }
- else if (current_mode != mode) {
- rb_raise(rb_eRuntimeError, "cannot change the measuring target during coverage measurement");
+ rb_set_coverages(rb_coverages);
}
return Qnil;
}
-static VALUE
-branch_coverage(VALUE branches)
-{
- VALUE ret = rb_hash_new();
- VALUE structure = rb_ary_dup(RARRAY_AREF(branches, 0));
- VALUE counters = rb_ary_dup(RARRAY_AREF(branches, 1));
- int i, j;
- long id = 0;
-
- for (i = 0; i < RARRAY_LEN(structure); i++) {
- VALUE branches = RARRAY_AREF(structure, i);
- VALUE base_type = RARRAY_AREF(branches, 0);
- VALUE base_first_lineno = RARRAY_AREF(branches, 1);
- VALUE base_first_column = RARRAY_AREF(branches, 2);
- VALUE base_last_lineno = RARRAY_AREF(branches, 3);
- VALUE base_last_column = RARRAY_AREF(branches, 4);
- VALUE children = rb_hash_new();
- rb_hash_aset(ret, rb_ary_new_from_args(6, base_type, LONG2FIX(id++), base_first_lineno, base_first_column, base_last_lineno, base_last_column), children);
- for (j = 5; j < RARRAY_LEN(branches); j += 6) {
- VALUE target_label = RARRAY_AREF(branches, j);
- VALUE target_first_lineno = RARRAY_AREF(branches, j + 1);
- VALUE target_first_column = RARRAY_AREF(branches, j + 2);
- VALUE target_last_lineno = RARRAY_AREF(branches, j + 3);
- VALUE target_last_column = RARRAY_AREF(branches, j + 4);
- int idx = FIX2INT(RARRAY_AREF(branches, j + 5));
- rb_hash_aset(children, rb_ary_new_from_args(6, target_label, LONG2FIX(id++), target_first_lineno, target_first_column, target_last_lineno, target_last_column), RARRAY_AREF(counters, idx));
- }
- }
-
- return ret;
-}
-
static int
-method_coverage_i(void *vstart, void *vend, size_t stride, void *data)
-{
- /*
- * ObjectSpace.each_object(Module){|mod|
- * mod.instance_methods.each{|mid|
- * m = mod.instance_method(mid)
- * if loc = m.source_location
- * p [m.name, loc, $g_method_cov_counts[m]]
- * end
- * }
- * }
- */
- VALUE ncoverages = *(VALUE*)data, v;
-
- for (v = (VALUE)vstart; v != (VALUE)vend; v += stride) {
- if (RB_TYPE_P(v, T_IMEMO) && imemo_type(v) == imemo_ment) {
- const rb_method_entry_t *me = (rb_method_entry_t *) v;
- VALUE path, first_lineno, first_column, last_lineno, last_column;
- VALUE data[5], ncoverage, methods;
- VALUE methods_id = ID2SYM(rb_intern("methods"));
- VALUE klass;
- const rb_method_entry_t *me2 = rb_resolve_me_location(me, data);
- if (me != me2) continue;
- klass = me->owner;
- if (RB_TYPE_P(klass, T_ICLASS)) {
- rb_bug("T_ICLASS");
- }
- path = data[0];
- first_lineno = data[1];
- first_column = data[2];
- last_lineno = data[3];
- last_column = data[4];
- if (FIX2LONG(first_lineno) <= 0) continue;
- ncoverage = rb_hash_aref(ncoverages, path);
- if (NIL_P(ncoverage)) continue;
- methods = rb_hash_aref(ncoverage, methods_id);
-
- {
- VALUE method_id = ID2SYM(me->def->original_id);
- VALUE rcount = rb_hash_aref(me2counter, (VALUE) me);
- VALUE key = rb_ary_new_from_args(6, klass, method_id, first_lineno, first_column, last_lineno, last_column);
- VALUE rcount2 = rb_hash_aref(methods, key);
-
- if (NIL_P(rcount)) rcount = LONG2FIX(0);
- if (NIL_P(rcount2)) rcount2 = LONG2FIX(0);
- if (!POSFIXABLE(FIX2LONG(rcount) + FIX2LONG(rcount2))) {
- rcount = LONG2FIX(FIXNUM_MAX);
- }
- else {
- rcount = LONG2FIX(FIX2LONG(rcount) + FIX2LONG(rcount2));
- }
- rb_hash_aset(methods, key, rcount);
- }
- }
- }
- return 0;
-}
-
-static int
-coverage_peek_result_i(st_data_t key, st_data_t val, st_data_t h)
+coverage_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;
- if (current_mode == 0) {
- /* compatible mode */
- VALUE lines = rb_ary_dup(RARRAY_AREF(coverage, COVERAGE_INDEX_LINES));
- rb_ary_freeze(lines);
- coverage = lines;
- }
- else {
- VALUE h = rb_hash_new();
-
- if (current_mode & COVERAGE_TARGET_LINES) {
- VALUE lines = RARRAY_AREF(coverage, COVERAGE_INDEX_LINES);
- lines = rb_ary_dup(lines);
- rb_ary_freeze(lines);
- rb_hash_aset(h, ID2SYM(rb_intern("lines")), lines);
- }
-
- if (current_mode & COVERAGE_TARGET_BRANCHES) {
- VALUE branches = RARRAY_AREF(coverage, COVERAGE_INDEX_BRANCHES);
- rb_hash_aset(h, ID2SYM(rb_intern("branches")), branch_coverage(branches));
- }
-
- if (current_mode & COVERAGE_TARGET_METHODS) {
- rb_hash_aset(h, ID2SYM(rb_intern("methods")), rb_hash_new());
- }
-
- coverage = h;
- }
-
+ coverage = rb_ary_dup(coverage);
+ rb_ary_clear((VALUE)val);
+ rb_ary_freeze(coverage);
rb_hash_aset(coverages, path, coverage);
return ST_CONTINUE;
}
/*
* call-seq:
- * Coverage.peek_result => hash
- *
- * Returns a hash that contains filename as key and coverage array as value.
+ * Coverage.result => hash
*
- * {
- * "file.rb" => [1, 2, nil],
- * ...
- * }
+ * Returns a hash that contains filename as key and coverage array as value
+ * and disables coverage measurement.
*/
static VALUE
-rb_coverage_peek_result(VALUE klass)
+rb_coverage_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_peek_result_i, ncoverages);
-
- if (current_mode & COVERAGE_TARGET_METHODS) {
- rb_objspace_each_objects(method_coverage_i, &ncoverages);
- }
-
+ st_foreach(RHASH_TBL(coverages), coverage_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);
rb_reset_coverages();
- me2counter = Qnil;
return ncoverages;
}
-/*
- * call-seq:
- * Coverage.running? => bool
- *
- * Returns true if coverage stats are currently being collected (after
- * Coverage.start call, but before Coverage.result call)
- */
-static VALUE
-rb_coverage_running(VALUE klass)
-{
- VALUE coverages = rb_get_coverages();
- return RTEST(coverages) ? Qtrue : Qfalse;
-}
-
/* Coverage provides coverage measurement feature for Ruby.
* This feature is experimental, so these APIs may be changed in future.
*
* = Usage
*
- * 1. require "coverage"
+ * 1. require "coverage.so"
* 2. do Coverage.start
* 3. require or load Ruby source file
* 4. Coverage.result will return a hash that contains filename as key and
@@ -287,7 +94,7 @@ rb_coverage_running(VALUE klass)
* end
* [EOF]
*
- * require "coverage"
+ * require "coverage.so"
* Coverage.start
* require "foo.rb"
* p Coverage.result #=> {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]}
@@ -296,9 +103,7 @@ void
Init_coverage(void)
{
VALUE rb_mCoverage = rb_define_module("Coverage");
- rb_define_module_function(rb_mCoverage, "start", rb_coverage_start, -1);
+ 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_define_module_function(rb_mCoverage, "running?", rb_coverage_running, 0);
- rb_global_variable(&me2counter);
+ rb_gc_register_address(&rb_coverages);
}
diff --git a/ext/coverage/depend b/ext/coverage/depend
index b6871fc9cb..ad0ac1cdfa 100644
--- a/ext/coverage/depend
+++ b/ext/coverage/depend
@@ -9,36 +9,3 @@ $(OBJS): $(HDRS) $(ruby_headers) \
$(top_srcdir)/thread_pthread.h \
$(top_srcdir)/internal.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/backward.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/onigmo.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_assert.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 3a6f530a92..769f85b6ef 100644
--- a/ext/coverage/extconf.rb
+++ b/ext/coverage/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
$VPATH << '$(topdir)' << '$(top_srcdir)'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
diff --git a/ext/date/date.gemspec b/ext/date/date.gemspec
deleted file mode 100644
index 9d5de998b7..0000000000
--- a/ext/date/date.gemspec
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "date"
- s.version = '1.0.0'
- s.date = '2017-12-11'
- s.summary = "A subclass of Object includes Comparable module for handling dates."
- s.description = "A subclass of Object includes Comparable module for handling dates."
-
- s.require_path = %w{lib}
- s.files = [
- "lib/date.rb", "ext/date/date_core.c", "ext/date/date_parse.c", "ext/date/date_strftime.c",
- "ext/date/date_strptime.c", "ext/date/date_tmx.h", "ext/date/extconf.rb", "ext/date/prereq.mk",
- "ext/date/zonetab.h", "ext/date/zonetab.list"
- ]
- s.extensions = "ext/date/extconf.rb"
- s.required_ruby_version = ">= 2.4.0"
-
- s.authors = ["Tadayoshi Funaba"]
- s.email = [nil]
- s.homepage = "https://github.com/ruby/date"
- s.license = "BSD-2-Clause"
-
- s.add_development_dependency "rake-compiler"
-end
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index c250633426..7ed21db5fc 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -4,7 +4,6 @@
#include "ruby.h"
#include "ruby/encoding.h"
-#include "ruby/util.h"
#include <math.h>
#include <time.h>
#if defined(HAVE_SYS_TIME_H)
@@ -51,18 +50,18 @@ static double positive_inf, negative_inf;
#define f_add3(x,y,z) f_add(f_add(x, y), z)
#define f_sub3(x,y,z) f_sub(f_sub(x, y), z)
-inline static int
+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)
- return 1;
+ c = 1;
else if (c < 0)
- return -1;
- return 0;
+ c = -1;
+ return INT2FIX(c);
}
- return rb_cmpint(rb_funcallv(x, id_cmp, 1, &y), x, y);
+ return rb_funcall(x, id_cmp, 1, y);
}
inline static VALUE
@@ -287,20 +286,20 @@ union DateData {
#define get_d1(x)\
union DateData *dat;\
- TypedData_Get_Struct(x, union DateData, &d_lite_type, dat);
+ Data_Get_Struct(x, union DateData, dat);
#define get_d1a(x)\
union DateData *adat;\
- TypedData_Get_Struct(x, union DateData, &d_lite_type, adat);
+ Data_Get_Struct(x, union DateData, adat);
#define get_d1b(x)\
union DateData *bdat;\
- TypedData_Get_Struct(x, union DateData, &d_lite_type, bdat);
+ Data_Get_Struct(x, union DateData, bdat);
#define get_d2(x,y)\
union DateData *adat, *bdat;\
- TypedData_Get_Struct(x, union DateData, &d_lite_type, adat);\
- TypedData_Get_Struct(y, union DateData, &d_lite_type, bdat);
+ Data_Get_Struct(x, union DateData, adat);\
+ Data_Get_Struct(y, union DateData, bdat);
inline static VALUE
canon(VALUE x)
@@ -314,9 +313,9 @@ canon(VALUE x)
}
#ifndef USE_PACK
-#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
+#define set_to_simple(x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
+ (x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -325,9 +324,9 @@ canon(VALUE x)
(x)->flags = _flags;\
}
#else
-#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
+#define set_to_simple(x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
+ (x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -337,13 +336,13 @@ canon(VALUE x)
#endif
#ifndef USE_PACK
-#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
+#define set_to_complex(x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
+ (x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->df = _df;\
- RB_OBJ_WRITE((obj), &(x)->sf, canon(_sf));\
+ (x)->sf = canon(_sf);\
(x)->of = _of;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -355,13 +354,13 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = _flags;\
}
#else
-#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
+#define set_to_complex(x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
+ (x)->nth = canon(_nth);\
(x)->jd = _jd;\
(x)->df = _df;\
- RB_OBJ_WRITE((obj), &(x)->sf, canon(_sf));\
+ (x)->sf = canon(_sf);\
(x)->of = _of;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
@@ -371,9 +370,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
#endif
#ifndef USE_PACK
-#define copy_simple_to_complex(obj, x, y) \
+#define copy_simple_to_complex(x, y) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
+ (x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->df = 0;\
(x)->sf = INT2FIX(0);\
@@ -388,12 +387,12 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = (y)->flags;\
}
#else
-#define copy_simple_to_complex(obj, x, y) \
+#define copy_simple_to_complex(x, y) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
+ (x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->df = 0;\
- RB_OBJ_WRITE((obj), &(x)->sf, INT2FIX(0));\
+ (x)->sf = INT2FIX(0);\
(x)->of = 0;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -403,9 +402,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
#endif
#ifndef USE_PACK
-#define copy_complex_to_simple(obj, x, y) \
+#define copy_complex_to_simple(x, y) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
+ (x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -414,9 +413,9 @@ _year, _mon, _mday, _hour, _min, _sec, _flags) \
(x)->flags = (y)->flags;\
}
#else
-#define copy_complex_to_simple(obj, x, y) \
+#define copy_complex_to_simple(x, y) \
{\
- RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
+ (x)->nth = (y)->nth;\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
@@ -1121,13 +1120,11 @@ m_virtual_sg(union DateData *x)
}
inline static void
-canonicalize_s_jd(VALUE obj, union DateData *x)
+canonicalize_s_jd(union DateData *x)
{
int j = x->s.jd;
- VALUE nth = x->s.nth;
assert(have_jd_p(x));
- canonicalize_jd(nth, x->s.jd);
- RB_OBJ_WRITE(obj, &x->s.nth, nth);
+ canonicalize_jd(x->s.nth, x->s.jd);
if (x->s.jd != j)
x->flags &= ~HAVE_CIVIL;
}
@@ -1217,13 +1214,11 @@ get_c_time(union DateData *x)
}
inline static void
-canonicalize_c_jd(VALUE obj, union DateData *x)
+canonicalize_c_jd(union DateData *x)
{
int j = x->c.jd;
- VALUE nth = x->c.nth;
assert(have_jd_p(x));
- canonicalize_jd(nth, x->c.jd);
- RB_OBJ_WRITE(obj, &x->c.nth, nth);
+ canonicalize_jd(x->c.nth, x->c.jd);
if (x->c.jd != j)
x->flags &= ~HAVE_CIVIL;
}
@@ -1360,8 +1355,10 @@ encode_year(VALUE nth, int y, double style,
static void
decode_jd(VALUE jd, VALUE *nth, int *rjd)
{
+ assert(FIXNUM_P(jd) || RB_TYPE_P(jd, T_BIGNUM));
*nth = f_idiv(jd, INT2FIX(CM_PERIOD));
if (f_zero_p(*nth)) {
+ assert(FIXNUM_P(jd));
*rjd = FIX2INT(jd);
return;
}
@@ -1400,15 +1397,15 @@ guess_style(VALUE y, double sg) /* -/+oo or zero */
}
inline static void
-m_canonicalize_jd(VALUE obj, union DateData *x)
+m_canonicalize_jd(union DateData *x)
{
if (simple_dat_p(x)) {
get_s_jd(x);
- canonicalize_s_jd(obj, x);
+ canonicalize_s_jd(x);
}
else {
get_c_jd(x);
- canonicalize_c_jd(obj, x);
+ canonicalize_c_jd(x);
}
}
@@ -1977,13 +1974,6 @@ 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,
@@ -2357,7 +2347,8 @@ offset_to_sec(VALUE vof, int *rof)
return 1;
}
default:
- expect_numeric(vof);
+ if (!k_numeric_p(vof))
+ rb_raise(rb_eTypeError, "expected numeric");
vof = f_to_r(vof);
#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(vof))
@@ -2462,7 +2453,7 @@ date_s__valid_jd_p(int argc, VALUE *argv, VALUE klass)
*
* Date.valid_jd?(2451944) #=> true
*
- * See also ::jd.
+ * See also jd.
*/
static VALUE
date_s_valid_jd_p(int argc, VALUE *argv, VALUE klass)
@@ -2551,7 +2542,7 @@ date_s__valid_civil_p(int argc, VALUE *argv, VALUE klass)
* Date.valid_date?(2001,2,3) #=> true
* Date.valid_date?(2001,2,29) #=> false
*
- * See also ::jd and ::civil.
+ * See also jd and civil.
*/
static VALUE
date_s_valid_civil_p(int argc, VALUE *argv, VALUE klass)
@@ -2632,7 +2623,7 @@ date_s__valid_ordinal_p(int argc, VALUE *argv, VALUE klass)
* Date.valid_ordinal?(2001,34) #=> true
* Date.valid_ordinal?(2001,366) #=> false
*
- * See also ::jd and ::ordinal.
+ * See also jd and ordinal.
*/
static VALUE
date_s_valid_ordinal_p(int argc, VALUE *argv, VALUE klass)
@@ -2714,7 +2705,7 @@ date_s__valid_commercial_p(int argc, VALUE *argv, VALUE klass)
* Date.valid_commercial?(2001,5,6) #=> true
* Date.valid_commercial?(2001,5,8) #=> false
*
- * See also ::jd and ::commercial.
+ * See also jd and commercial.
*/
static VALUE
date_s_valid_commercial_p(int argc, VALUE *argv, VALUE klass)
@@ -2931,31 +2922,17 @@ date_s_gregorian_leap_p(VALUE klass, VALUE y)
}
static void
-d_lite_gc_mark(void *ptr)
+d_lite_gc_mark(union DateData *dat)
{
- 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 +2943,9 @@ d_simple_new_internal(VALUE klass,
struct SimpleDateData *dat;
VALUE obj;
- 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);
+ 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);
assert(have_jd_p(dat) || have_civil_p(dat));
@@ -2987,9 +2964,9 @@ d_complex_new_internal(VALUE klass,
struct ComplexDateData *dat;
VALUE obj;
- obj = TypedData_Make_Struct(klass, struct ComplexDateData,
- &d_lite_type, dat);
- set_to_complex(obj, dat, nth, jd, df, sf, of, sg,
+ obj = Data_Make_Struct(klass, struct ComplexDateData,
+ d_lite_gc_mark, -1, dat);
+ set_to_complex(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));
@@ -3131,7 +3108,7 @@ wholenum_p(VALUE x)
inline static VALUE
to_integer(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x))
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
return x;
return f_to_i(x);
}
@@ -3262,7 +3239,7 @@ static VALUE d_lite_plus(VALUE, VALUE);
* Date.jd(2451945) #=> #<Date: 2001-02-04 ...>
* Date.jd(0) #=> #<Date: -4712-01-01 ...>
*
- * See also ::new.
+ * See also new.
*/
static VALUE
date_s_jd(int argc, VALUE *argv, VALUE klass)
@@ -3312,7 +3289,7 @@ date_s_jd(int argc, VALUE *argv, VALUE klass)
* Date.ordinal(2001,34) #=> #<Date: 2001-02-03 ...>
* Date.ordinal(2001,-1) #=> #<Date: 2001-12-31 ...>
*
- * See also ::jd and ::new.
+ * See also jd and new.
*/
static VALUE
date_s_ordinal(int argc, VALUE *argv, VALUE klass)
@@ -3380,7 +3357,7 @@ date_s_ordinal(int argc, VALUE *argv, VALUE klass)
* Date.new(2001,2,3) #=> #<Date: 2001-02-03 ...>
* Date.new(2001,2,-1) #=> #<Date: 2001-02-28 ...>
*
- * See also ::jd.
+ * See also jd.
*/
static VALUE
date_s_civil(int argc, VALUE *argv, VALUE klass)
@@ -3457,7 +3434,7 @@ date_s_civil(int argc, VALUE *argv, VALUE klass)
* Date.commercial(2002) #=> #<Date: 2001-12-31 ...>
* Date.commercial(2001,5,6) #=> #<Date: 2001-02-03 ...>
*
- * See also ::jd and ::new.
+ * See also jd and new.
*/
static VALUE
date_s_commercial(int argc, VALUE *argv, VALUE klass)
@@ -3631,9 +3608,9 @@ static void set_sg(union DateData *, double);
* call-seq:
* Date.today([start=Date::ITALY]) -> date
*
- * Creates a date object denoting the present day.
+ * Date.today #=> #<Date: 2011-06-11 ..>
*
- * Date.today #=> #<Date: 2011-06-11 ...>
+ * Creates a date object denoting the present day.
*/
static VALUE
date_s_today(int argc, VALUE *argv, VALUE klass)
@@ -3728,8 +3705,7 @@ static VALUE
rt_complete_frags(VALUE klass, VALUE hash)
{
static VALUE tab = Qnil;
- int g;
- long e;
+ int g, e;
VALUE k, a, d;
if (NIL_P(tab)) {
@@ -3826,19 +3802,19 @@ rt_complete_frags(VALUE klass, VALUE hash)
}
{
- long i, eno = 0, idx = 0;
+ int i, eno = 0, idx = 0;
- for (i = 0; i < RARRAY_LEN(tab); i++) {
+ for (i = 0; i < RARRAY_LENINT(tab); i++) {
VALUE x, a;
- x = RARRAY_AREF(tab, i);
- a = RARRAY_AREF(x, 1);
+ x = RARRAY_PTR(tab)[i];
+ a = RARRAY_PTR(x)[1];
{
- long j, n = 0;
+ int j, n = 0;
- for (j = 0; j < RARRAY_LEN(a); j++)
- if (!NIL_P(ref_hash0(RARRAY_AREF(a, j))))
+ for (j = 0; j < RARRAY_LENINT(a); j++)
+ if (!NIL_P(ref_hash0(RARRAY_PTR(a)[j])))
n++;
if (n > eno) {
eno = n;
@@ -3850,15 +3826,15 @@ rt_complete_frags(VALUE klass, VALUE hash)
g = 0;
else {
g = 1;
- k = RARRAY_AREF(RARRAY_AREF(tab, idx), 0);
- a = RARRAY_AREF(RARRAY_AREF(tab, idx), 1);
+ k = RARRAY_PTR(RARRAY_PTR(tab)[idx])[0];
+ a = RARRAY_PTR(RARRAY_PTR(tab)[idx])[1];
e = eno;
}
}
d = Qnil;
- if (g && !NIL_P(k) && (RARRAY_LEN(a) - e)) {
+ if (g && !NIL_P(k) && (RARRAY_LENINT(a) - e)) {
if (k == sym("ordinal")) {
if (NIL_P(ref_hash("year"))) {
if (NIL_P(d))
@@ -3869,10 +3845,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("yday", INT2FIX(1));
}
else if (k == sym("civil")) {
- long i;
+ int i;
- for (i = 0; i < RARRAY_LEN(a); i++) {
- VALUE e = RARRAY_AREF(a, i);
+ for (i = 0; i < RARRAY_LENINT(a); i++) {
+ VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
break;
@@ -3886,10 +3862,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("mday", INT2FIX(1));
}
else if (k == sym("commercial")) {
- long i;
+ int i;
- for (i = 0; i < RARRAY_LEN(a); i++) {
- VALUE e = RARRAY_AREF(a, i);
+ for (i = 0; i < RARRAY_LENINT(a); i++) {
+ VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
break;
@@ -3910,10 +3886,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
ref_hash("wday"))));
}
else if (k == sym("wnum0")) {
- long i;
+ int i;
- for (i = 0; i < RARRAY_LEN(a); i++) {
- VALUE e = RARRAY_AREF(a, i);
+ for (i = 0; i < RARRAY_LENINT(a); i++) {
+ VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
break;
@@ -3927,10 +3903,10 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("wday", INT2FIX(0));
}
else if (k == sym("wnum1")) {
- long i;
+ int i;
- for (i = 0; i < RARRAY_LEN(a); i++) {
- VALUE e = RARRAY_AREF(a, i);
+ for (i = 0; i < RARRAY_LENINT(a); i++) {
+ VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
break;
@@ -4236,7 +4212,7 @@ date_s__strptime_internal(int argc, VALUE *argv, VALUE klass,
* Date._strptime('2001-02-03', '%Y-%m-%d')
* #=> {:year=>2001, :mon=>2, :mday=>3}
*
- * See also strptime(3) and #strftime.
+ * See also strptime(3) and strftime.
*/
static VALUE
date_s__strptime(int argc, VALUE *argv, VALUE klass)
@@ -4246,7 +4222,7 @@ date_s__strptime(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * Date.strptime([string='-4712-01-01'[, format='%F'[, start=Date::ITALY]]]) -> date
+ * Date.strptime([string='-4712-01-01'[, format='%F'[, start=ITALY]]]) -> date
*
* Parses the given representation of date and time with the given
* template, and creates a date object. strptime does not support
@@ -4260,7 +4236,7 @@ date_s__strptime(int argc, VALUE *argv, VALUE klass)
* Date.strptime('2001 05 6', '%Y %W %u') #=> #<Date: 2001-02-03 ...>
* Date.strptime('sat3feb01', '%a%d%b%y') #=> #<Date: 2001-02-03 ...>
*
- * See also strptime(3) and #strftime.
+ * See also strptime(3) and strftime.
*/
static VALUE
date_s_strptime(int argc, VALUE *argv, VALUE klass)
@@ -4340,7 +4316,7 @@ date_s__parse(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * Date.parse(string='-4712-01-01'[, comp=true[, start=Date::ITALY]]) -> date
+ * Date.parse(string='-4712-01-01'[, comp=true[, start=ITALY]]) -> date
*
* Parses the given representation of date and time, and creates a
* date object. This method does not function as a validator.
@@ -4400,7 +4376,7 @@ date_s__iso8601(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.iso8601(string='-4712-01-01'[, start=Date::ITALY]) -> date
+ * Date.iso8601(string='-4712-01-01'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some typical ISO 8601 formats.
@@ -4443,7 +4419,7 @@ date_s__rfc3339(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=Date::ITALY]) -> date
+ * Date.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some typical RFC 3339 formats.
@@ -4484,7 +4460,7 @@ date_s__xmlschema(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.xmlschema(string='-4712-01-01'[, start=Date::ITALY]) -> date
+ * Date.xmlschema(string='-4712-01-01'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some typical XML Schema formats.
@@ -4526,8 +4502,8 @@ date_s__rfc2822(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=Date::ITALY]) -> date
- * Date.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=Date::ITALY]) -> date
+ * Date.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) -> date
+ * Date.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some typical RFC 2822 formats.
@@ -4569,7 +4545,7 @@ date_s__httpdate(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=Date::ITALY]) -> date
+ * Date.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some RFC 2616 format.
@@ -4611,7 +4587,7 @@ date_s__jisx0301(VALUE klass, VALUE str)
/*
* call-seq:
- * Date.jisx0301(string='-4712-01-01'[, start=Date::ITALY]) -> date
+ * Date.jisx0301(string='-4712-01-01'[, start=ITALY]) -> date
*
* Creates a new Date object by parsing from a string according to
* some typical JIS X 0301 formats.
@@ -4648,7 +4624,6 @@ dup_obj(VALUE self)
{
get_d1b(new);
bdat->s = adat->s;
- RB_OBJ_WRITTEN(new, Qundef, bdat->s.nth);
return new;
}
}
@@ -4657,8 +4632,6 @@ 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;
}
}
@@ -4673,7 +4646,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(new, &bdat->c, &adat->s);
+ copy_simple_to_complex(&bdat->c, &adat->s);
bdat->c.flags |= HAVE_DF | COMPLEX_DAT;
return new;
}
@@ -4683,8 +4656,6 @@ 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;
}
}
@@ -4743,14 +4714,14 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
decode_jd(jd, &nth, &rjd);
if (!df && f_zero_p(sf) && !of) {
- set_to_simple(self, &dat->s, nth, rjd, sg, 0, 0, 0, HAVE_JD);
+ set_to_simple(&dat->s, nth, rjd, sg, 0, 0, 0, HAVE_JD);
}
else {
if (!complex_dat_p(dat))
rb_raise(rb_eArgError,
"cannot load complex into simple");
- set_to_complex(self, &dat->c, nth, rjd, df, sf, of, sg,
+ set_to_complex(&dat->c, nth, rjd, df, sf, of, sg,
0, 0, 0, 0, 0, 0, HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
}
@@ -5254,7 +5225,7 @@ d_lite_zone(VALUE self)
* call-seq:
* d.julian? -> bool
*
- * Returns true if the date is before the day of calendar reform.
+ * Retruns true if the date is before the day of calendar reform.
*
* Date.new(1582,10,15).julian? #=> false
* (Date.new(1582,10,15) - 1).julian? #=> true
@@ -5270,7 +5241,7 @@ d_lite_julian_p(VALUE self)
* call-seq:
* d.gregorian? -> bool
*
- * Returns true if the date is on or after the day of calendar reform.
+ * Retunrs true if the date is on or after the day of calendar reform.
*
* Date.new(1582,10,15).gregorian? #=> true
* (Date.new(1582,10,15) - 1).gregorian? #=> false
@@ -5380,7 +5351,7 @@ dup_obj_with_new_start(VALUE obj, double sg)
* call-seq:
* d.new_start([start=Date::ITALY]) -> date
*
- * Duplicates self and resets its day of calendar reform.
+ * Duplicates self and resets its the day of calendar reform.
*
* d = Date.new(1582,10,15)
* d.new_start(Date::JULIAN) #=> #<Date: 1582-10-05 ...>
@@ -5498,9 +5469,9 @@ d_lite_new_offset(int argc, VALUE *argv, VALUE self)
* call-seq:
* d + other -> date
*
- * Returns a date object pointing +other+ days after self. The other
- * should be a numeric value. If the other is a fractional number,
- * assumes its precision is at most nanosecond.
+ * Returns a date object pointing other days after self. The other
+ * should be a numeric value. If the other is flonum, assumes its
+ * precision is at most nanosecond.
*
* Date.new(2001,2,3) + 1 #=> #<Date: 2001-02-04 ...>
* DateTime.new(2001,2,3) + Rational(1,2)
@@ -5722,7 +5693,8 @@ d_lite_plus(VALUE self, VALUE other)
}
break;
default:
- expect_numeric(other);
+ if (!k_numeric_p(other))
+ rb_raise(rb_eTypeError, "expected numeric");
other = f_to_r(other);
#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(other))
@@ -5883,8 +5855,8 @@ minus_dd(VALUE self, VALUE other)
*
* Returns the difference between the two dates if the other is a date
* object. If the other is a numeric value, returns a date object
- * pointing +other+ days before self. If the other is a fractional number,
- * assumes its precision is at most nanosecond.
+ * pointing other days before self. If the other is flonum, assumes
+ * its precision is at most nanosecond.
*
* Date.new(2001,2,3) - 1 #=> #<Date: 2001-02-02 ...>
* DateTime.new(2001,2,3) - Rational(1,2)
@@ -5906,7 +5878,8 @@ d_lite_minus(VALUE self, VALUE other)
case T_FLOAT:
return d_lite_plus(self, DBL2NUM(-RFLOAT_VALUE(other)));
default:
- expect_numeric(other);
+ if (!k_numeric_p(other))
+ rb_raise(rb_eTypeError, "expected numeric");
/* fall through */
case T_BIGNUM:
case T_RATIONAL:
@@ -5965,24 +5938,12 @@ d_lite_next(VALUE self)
* call-seq:
* d >> n -> date
*
- * Returns a date object pointing +n+ months after self.
- * The argument +n+ should be a numeric value.
- *
- * Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
- * Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
+ * Returns a date object pointing n months after self. The n should
+ * be a numeric value.
*
- * When the same day does not exist for the corresponding month,
- * the last day of the month is used instead:
- *
- * Date.new(2001,1,28) >> 1 #=> #<Date: 2001-02-28 ...>
- * Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
- *
- * This also results in the following, possibly unexpected, behavior:
- *
- * Date.new(2001,1,31) >> 2 #=> #<Date: 2001-03-31 ...>
- * Date.new(2001,1,31) >> 1 >> 1 #=> #<Date: 2001-03-28 ...>
- *
- * Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
+ * Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
+ * Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
+ * Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
*/
static VALUE
d_lite_rshift(VALUE self, VALUE other)
@@ -6027,29 +5988,16 @@ d_lite_rshift(VALUE self, VALUE other)
* call-seq:
* d << n -> date
*
- * Returns a date object pointing +n+ months before self.
- * The argument +n+ should be a numeric value.
- *
- * Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
- * Date.new(2001,2,3) << -2 #=> #<Date: 2001-04-03 ...>
+ * Returns a date object pointing n months before self. The n should
+ * be a numeric value.
*
- * When the same day does not exist for the corresponding month,
- * the last day of the month is used instead:
- *
- * Date.new(2001,3,28) << 1 #=> #<Date: 2001-02-28 ...>
- * Date.new(2001,3,31) << 1 #=> #<Date: 2001-02-28 ...>
- *
- * This also results in the following, possibly unexpected, behavior:
- *
- * Date.new(2001,3,31) << 2 #=> #<Date: 2001-01-31 ...>
- * Date.new(2001,3,31) << 1 << 1 #=> #<Date: 2001-01-28 ...>
- *
- * Date.new(2001,3,31) << 1 << -1 #=> #<Date: 2001-03-28 ...>
+ * Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
+ * Date.new(2001,1,31) << 11 #=> #<Date: 2000-02-29 ...>
+ * Date.new(2001,2,3) << -1 #=> #<Date: 2001-03-03 ...>
*/
static VALUE
d_lite_lshift(VALUE self, VALUE other)
{
- expect_numeric(other);
return d_lite_rshift(self, f_negate(other));
}
@@ -6057,9 +6005,7 @@ d_lite_lshift(VALUE self, VALUE other)
* call-seq:
* d.next_month([n=1]) -> date
*
- * This method is equivalent to d >> n.
- *
- * See Date#>> for examples.
+ * This method is equivalent to d >> n
*/
static VALUE
d_lite_next_month(int argc, VALUE *argv, VALUE self)
@@ -6076,9 +6022,7 @@ d_lite_next_month(int argc, VALUE *argv, VALUE self)
* call-seq:
* d.prev_month([n=1]) -> date
*
- * This method is equivalent to d << n.
- *
- * See Date#<< for examples.
+ * This method is equivalent to d << n
*/
static VALUE
d_lite_prev_month(int argc, VALUE *argv, VALUE self)
@@ -6095,13 +6039,7 @@ d_lite_prev_month(int argc, VALUE *argv, VALUE self)
* call-seq:
* d.next_year([n=1]) -> date
*
- * This method is equivalent to d >> (n * 12).
- *
- * Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
- * Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
- * Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
- *
- * See also Date#>>.
+ * This method is equivalent to d >> (n * 12)
*/
static VALUE
d_lite_next_year(int argc, VALUE *argv, VALUE self)
@@ -6118,13 +6056,7 @@ d_lite_next_year(int argc, VALUE *argv, VALUE self)
* call-seq:
* d.prev_year([n=1]) -> date
*
- * This method is equivalent to d << (n * 12).
- *
- * Date.new(2001,2,3).prev_year #=> #<Date: 2000-02-03 ...>
- * Date.new(2008,2,29).prev_year #=> #<Date: 2007-02-28 ...>
- * Date.new(2008,2,29).prev_year(4) #=> #<Date: 2004-02-29 ...>
- *
- * See also Date#<<.
+ * This method is equivalent to d << (n * 12)
*/
static VALUE
d_lite_prev_year(int argc, VALUE *argv, VALUE self)
@@ -6154,7 +6086,6 @@ static VALUE
d_lite_step(int argc, VALUE *argv, VALUE self)
{
VALUE limit, step, date;
- int c;
rb_scan_args(argc, argv, "11", &limit, &step);
@@ -6169,22 +6100,25 @@ d_lite_step(int argc, VALUE *argv, VALUE self)
RETURN_ENUMERATOR(self, argc, argv);
date = self;
- c = f_cmp(step, INT2FIX(0));
- if (c < 0) {
+ switch (FIX2INT(f_cmp(step, INT2FIX(0)))) {
+ case -1:
while (FIX2INT(d_lite_cmp(date, limit)) >= 0) {
rb_yield(date);
date = d_lite_plus(date, step);
}
- }
- else if (c == 0) {
+ break;
+ case 0:
while (1)
rb_yield(date);
- }
- else /* if (c > 0) */ {
+ break;
+ case 1:
while (FIX2INT(d_lite_cmp(date, limit)) <= 0) {
rb_yield(date);
date = d_lite_plus(date, step);
}
+ break;
+ default:
+ abort();
}
return self;
}
@@ -6239,9 +6173,9 @@ cmp_gen(VALUE self, VALUE other)
get_d1(self);
if (k_numeric_p(other))
- return INT2FIX(f_cmp(m_ajd(dat), other));
+ return f_cmp(m_ajd(dat), other);
else if (k_date_p(other))
- return INT2FIX(f_cmp(m_ajd(dat), f_ajd(other)));
+ return f_cmp(m_ajd(dat), f_ajd(other));
return rb_num_coerce_cmp(self, other, rb_intern("<=>"));
}
@@ -6256,8 +6190,8 @@ cmp_dd(VALUE self, VALUE other)
int a_jd, b_jd,
a_df, b_df;
- m_canonicalize_jd(self, adat);
- m_canonicalize_jd(other, bdat);
+ m_canonicalize_jd(adat);
+ m_canonicalize_jd(bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
if (f_eqeq_p(a_nth, b_nth)) {
@@ -6310,11 +6244,11 @@ cmp_dd(VALUE self, VALUE other)
* should be a date object or a numeric value as an astronomical
* Julian day number.
*
- * Date.new(2001,2,3) <=> Date.new(2001,2,4) #=> -1
- * Date.new(2001,2,3) <=> Date.new(2001,2,3) #=> 0
- * Date.new(2001,2,3) <=> Date.new(2001,2,2) #=> 1
- * Date.new(2001,2,3) <=> Object.new #=> nil
- * Date.new(2001,2,3) <=> Rational(4903887,2) #=> 0
+ * Date.new(2001,2,3) <=> Date.new(2001,2,4) #=> -1
+ * Date.new(2001,2,3) <=> Date.new(2001,2,3) #=> 0
+ * Date.new(2001,2,3) <=> Date.new(2001,2,2) #=> 1
+ * Date.new(2001,2,3) <=> Object.new #=> nil
+ * Date.new(2001,2,3) <=> Rational(4903887,2)#=> 0
*
* See also Comparable.
*/
@@ -6335,8 +6269,8 @@ d_lite_cmp(VALUE self, VALUE other)
VALUE a_nth, b_nth;
int a_jd, b_jd;
- m_canonicalize_jd(self, adat);
- m_canonicalize_jd(other, bdat);
+ m_canonicalize_jd(adat);
+ m_canonicalize_jd(bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
if (f_eqeq_p(a_nth, b_nth)) {
@@ -6407,8 +6341,8 @@ d_lite_equal(VALUE self, VALUE other)
VALUE a_nth, b_nth;
int a_jd, b_jd;
- m_canonicalize_jd(self, adat);
- m_canonicalize_jd(other, bdat);
+ m_canonicalize_jd(adat);
+ m_canonicalize_jd(bdat);
a_nth = m_nth(adat);
b_nth = m_nth(bdat);
a_jd = m_local_jd(adat);
@@ -6442,7 +6376,7 @@ d_lite_hash(VALUE self)
h[2] = m_df(dat);
h[3] = m_sf(dat);
v = rb_memhash(h, sizeof(h));
- return ST2FIX(v);
+ return LONG2FIX(v);
}
#include "date_tmx.h"
@@ -6454,8 +6388,8 @@ static VALUE strftimev(const char *, VALUE,
* call-seq:
* d.to_s -> string
*
- * Returns a string in an ISO 8601 format. (This method doesn't use the
- * expanded representations.)
+ * Returns a string in an ISO 8601 format (This method doesn't use the
+ * expanded representations).
*
* Date.new(2001,2,3).to_s #=> "2001-02-03"
*/
@@ -6467,40 +6401,54 @@ d_lite_to_s(VALUE self)
#ifndef NDEBUG
static VALUE
-mk_inspect_raw(union DateData *x, VALUE klass)
+mk_inspect_flags(union DateData *x)
{
- char flags[5];
-
- flags[0] = (x->flags & COMPLEX_DAT) ? 'C' : 'S';
- flags[1] = (x->flags & HAVE_JD) ? 'j' : '-';
- flags[2] = (x->flags & HAVE_DF) ? 'd' : '-';
- flags[3] = (x->flags & HAVE_CIVIL) ? 'c' : '-';
- flags[4] = (x->flags & HAVE_TIME) ? 't' : '-';
- flags[5] = '\0';
+ return rb_enc_sprintf(rb_usascii_encoding(),
+ "%c%c%c%c%c",
+ (x->flags & COMPLEX_DAT) ? 'C' : 'S',
+ (x->flags & HAVE_JD) ? 'j' : '-',
+ (x->flags & HAVE_DF) ? 'd' : '-',
+ (x->flags & HAVE_CIVIL) ? 'c' : '-',
+ (x->flags & HAVE_TIME) ? 't' : '-');
+}
+static VALUE
+mk_inspect_raw(union DateData *x, const char *klass)
+{
if (simple_dat_p(x)) {
+ VALUE nth, flags;
+
+ RB_GC_GUARD(nth) = f_inspect(x->s.nth);
+ RB_GC_GUARD(flags) = mk_inspect_flags(x);
+
return rb_enc_sprintf(rb_usascii_encoding(),
- "#<%"PRIsVALUE": "
- "(%+"PRIsVALUE"th,%dj),+0s,%.0fj; "
+ "#<%s: "
+ "(%sth,%dj),+0s,%.0fj; "
"%dy%dm%dd; %s>",
- klass,
- x->s.nth, x->s.jd, x->s.sg,
+ klass ? klass : "?",
+ RSTRING_PTR(nth), x->s.jd, x->s.sg,
#ifndef USE_PACK
x->s.year, x->s.mon, x->s.mday,
#else
x->s.year,
EX_MON(x->s.pc), EX_MDAY(x->s.pc),
#endif
- flags);
+ RSTRING_PTR(flags));
}
else {
+ VALUE nth, sf, flags;
+
+ RB_GC_GUARD(nth) = f_inspect(x->c.nth);
+ RB_GC_GUARD(sf) = f_inspect(x->c.sf);
+ RB_GC_GUARD(flags) = mk_inspect_flags(x);
+
return rb_enc_sprintf(rb_usascii_encoding(),
- "#<%"PRIsVALUE": "
- "(%+"PRIsVALUE"th,%dj,%ds,%+"PRIsVALUE"n),"
- "%+ds,%.0fj; "
+ "#<%s: "
+ "(%sth,%dj,%ds,%sn),%+ds,%.0fj; "
"%dy%dm%dd %dh%dm%ds; %s>",
- klass,
- x->c.nth, x->c.jd, x->c.df, x->c.sf,
+ klass ? klass : "?",
+ RSTRING_PTR(nth), x->c.jd, x->c.df,
+ RSTRING_PTR(sf),
x->c.of, x->c.sg,
#ifndef USE_PACK
x->c.year, x->c.mon, x->c.mday,
@@ -6511,7 +6459,7 @@ mk_inspect_raw(union DateData *x, VALUE klass)
EX_HOUR(x->c.pc), EX_MIN(x->c.pc),
EX_SEC(x->c.pc),
#endif
- flags);
+ RSTRING_PTR(flags));
}
}
@@ -6519,18 +6467,23 @@ static VALUE
d_lite_inspect_raw(VALUE self)
{
get_d1(self);
- return mk_inspect_raw(dat, rb_obj_class(self));
+ return mk_inspect_raw(dat, rb_obj_classname(self));
}
#endif
static VALUE
-mk_inspect(union DateData *x, VALUE klass, VALUE to_s)
+mk_inspect(union DateData *x, const char *klass, const char *to_s)
{
+ VALUE jd, sf;
+
+ RB_GC_GUARD(jd) = f_inspect(m_real_jd(x));
+ RB_GC_GUARD(sf) = f_inspect(m_sf(x));
+
return rb_enc_sprintf(rb_usascii_encoding(),
- "#<%"PRIsVALUE": %"PRIsVALUE" "
- "((%+"PRIsVALUE"j,%ds,%+"PRIsVALUE"n),%+ds,%.0fj)>",
- klass, to_s,
- m_real_jd(x), m_df(x), m_sf(x),
+ "#<%s: %s ((%sj,%ds,%sn),%+ds,%.0fj)>",
+ klass ? klass : "?",
+ to_s ? to_s : "?",
+ RSTRING_PTR(jd), m_df(x), RSTRING_PTR(sf),
m_of(x), m_sg(x));
}
@@ -6549,7 +6502,12 @@ static VALUE
d_lite_inspect(VALUE self)
{
get_d1(self);
- return mk_inspect(dat, rb_obj_class(self), self);
+ {
+ VALUE to_s;
+
+ RB_GC_GUARD(to_s) = f_to_s(self);
+ return mk_inspect(dat, rb_obj_classname(self), RSTRING_PTR(to_s));
+ }
}
#include <errno.h>
@@ -6638,7 +6596,7 @@ tmx_m_zone(union DateData *x)
return RSTRING_PTR(m_zone(x));
}
-static const struct tmx_funcs tmx_funcs = {
+static struct tmx_funcs tmx_funcs = {
(VALUE (*)(void *))m_real_year,
(int (*)(void *))m_yday,
(int (*)(void *))m_mon,
@@ -6727,32 +6685,32 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
* call-seq:
* d.strftime([format='%F']) -> string
*
- * Formats date according to the directives in the given format
- * string.
- * The directives begin with a percent (%) character.
- * Any text not listed as a directive will be passed through to the
- * output string.
+ * Formats date according to the directives in the given format
+ * string.
+ * The directives begins with a percent (%) character.
+ * Any text not listed as a directive will be passed through to the
+ * output string.
*
- * A directive consists of a percent (%) character,
- * zero or more flags, an optional minimum field width,
- * an optional modifier, and a conversion specifier
- * as follows.
+ * The directive consists of a percent (%) character,
+ * zero or more flags, optional minimum field width,
+ * optional modifier and a conversion specifier
+ * as follows.
*
* %<flags><width><modifier><conversion>
*
- * Flags:
+ * Flags:
* - don't pad a numerical output.
* _ use spaces for padding.
* 0 use zeros for padding.
* ^ upcase the result string.
* # change case.
*
- * The minimum field width specifies the minimum width.
+ * The minimum field width specifies the minimum width.
*
- * The modifiers are "E", "O", ":", "::" and ":::".
- * "E" and "O" are ignored. No effect to result currently.
+ * The modifiers are "E", "O", ":", "::" and ":::".
+ * "E" and "O" are ignored. No effect to result currently.
*
- * Format directives:
+ * Format directives:
*
* Date (Year, Month, Day):
* %Y - Year with century (can be negative, 4 digits at least)
@@ -6800,7 +6758,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 - Equivalent to %:z (e.g. +09:00)
+ * %Z - Time zone abbreviation name or something similar information.
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -6845,24 +6803,23 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
* %T - 24-hour time (%H:%M:%S)
* %+ - date(1) (%a %b %e %H:%M:%S %Z %Y)
*
- * This method is similar to the strftime() function defined in ISO C
- * and POSIX.
- * Several directives (%a, %A, %b, %B, %c, %p, %r, %x, %X, %E*, %O* and %Z)
- * are locale dependent in the function.
- * However, this method is locale independent.
- * So, the result may differ even if the same format string is used in other
- * systems such as C.
- * It is good practice to avoid %x and %X because there are corresponding
- * locale independent representations, %D and %T.
+ * This method is similar to strftime() function defined in ISO C and POSIX.
+ * Several directives (%a, %A, %b, %B, %c, %p, %r, %x, %X, %E*, %O* and %Z)
+ * are locale dependent in the function.
+ * However this method is locale independent.
+ * So, the result may differ even if a same format string is used in other
+ * systems such as C.
+ * It is good practice to avoid %x and %X because there are corresponding
+ * locale independent representations, %D and %T.
*
- * Examples:
+ * Examples:
*
* d = DateTime.new(2007,11,19,8,37,48,"-06:00")
* #=> #<DateTime: 2007-11-19T08:37:48-0600 ...>
* d.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007"
* d.strftime("at %I:%M%p") #=> "at 08:37AM"
*
- * Various ISO 8601 formats:
+ * Various ISO 8601 formats:
* %Y%m%d => 20071119 Calendar date (basic)
* %F => 2007-11-19 Calendar date (extended)
* %Y-%m => 2007-11 Calendar date, reduced accuracy, specific month
@@ -6898,7 +6855,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
* %GW%V%uT%H%M%z => 2007W471T0837-0600 Week date and local time and difference from UTC (basic)
* %G-W%V-%uT%R%:z => 2007-W47-1T08:37-06:00 Week date and local time and difference from UTC (extended)
*
- * See also strftime(3) and ::strptime.
+ * See also strftime(3) and strptime.
*/
static VALUE
d_lite_strftime(int argc, VALUE *argv, VALUE self)
@@ -6918,7 +6875,6 @@ strftimev(const char *fmt, VALUE self,
(*func)(self, &tmx);
len = date_strftime_alloc(&buf, fmt, &tmx);
- RB_GC_GUARD(self);
str = rb_usascii_str_new(buf, len);
if (buf != buffer) xfree(buf);
return str;
@@ -6992,40 +6948,30 @@ d_lite_httpdate(VALUE self)
return strftimev("%a, %d %b %Y %T GMT", dup, set_tmx);
}
-enum {
- DECIMAL_SIZE_OF_LONG = DECIMAL_SIZE_OF_BITS(CHAR_BIT*sizeof(long)),
- JISX0301_DATE_SIZE = DECIMAL_SIZE_OF_LONG+8
-};
+static VALUE
+jisx0301_date(VALUE jd, VALUE y)
+{
+ VALUE a[2];
-static const char *
-jisx0301_date_format(char *fmt, size_t size, VALUE jd, VALUE y)
-{
- if (FIXNUM_P(jd)) {
- long d = FIX2INT(jd);
- long s;
- char c;
- if (d < 2405160)
- return "%Y-%m-%d";
- if (d < 2419614) {
- c = 'M';
- s = 1867;
- }
- else if (d < 2424875) {
- c = 'T';
- s = 1911;
- }
- else if (d < 2447535) {
- c = 'S';
- s = 1925;
- }
- else {
- c = 'H';
- s = 1988;
- }
- snprintf(fmt, size, "%c%02ld" ".%%m.%%d", c, FIX2INT(y) - s);
- return fmt;
+ if (f_lt_p(jd, INT2FIX(2405160)))
+ return rb_usascii_str_new2("%Y-%m-%d");
+ if (f_lt_p(jd, INT2FIX(2419614))) {
+ a[0] = rb_usascii_str_new2("M%02d" ".%%m.%%d");
+ a[1] = f_sub(y, INT2FIX(1867));
}
- return "%Y-%m-%d";
+ else if (f_lt_p(jd, INT2FIX(2424875))) {
+ a[0] = rb_usascii_str_new2("T%02d" ".%%m.%%d");
+ a[1] = f_sub(y, INT2FIX(1911));
+ }
+ else if (f_lt_p(jd, INT2FIX(2447535))) {
+ a[0] = rb_usascii_str_new2("S%02d" ".%%m.%%d");
+ a[1] = f_sub(y, INT2FIX(1925));
+ }
+ else {
+ a[0] = rb_usascii_str_new2("H%02d" ".%%m.%%d");
+ a[1] = f_sub(y, INT2FIX(1988));
+ }
+ return rb_f_sprintf(2, a);
}
/*
@@ -7039,14 +6985,12 @@ jisx0301_date_format(char *fmt, size_t size, VALUE jd, VALUE y)
static VALUE
d_lite_jisx0301(VALUE self)
{
- char fmtbuf[JISX0301_DATE_SIZE];
- const char *fmt;
+ VALUE s;
get_d1(self);
- fmt = jisx0301_date_format(fmtbuf, sizeof(fmtbuf),
- m_real_local_jd(dat),
- m_real_year(dat));
- return strftimev(fmt, self, set_tmx);
+ s = jisx0301_date(m_real_local_jd(dat),
+ m_real_year(dat));
+ return strftimev(RSTRING_PTR(s), self, set_tmx);
}
#ifndef NDEBUG
@@ -7117,29 +7061,29 @@ d_lite_marshal_load(VALUE self, VALUE a)
if (RARRAY_LEN(a) == 2) {
- ajd = f_sub(RARRAY_AREF(a, 0), half_days_in_day);
+ ajd = f_sub(RARRAY_PTR(a)[0], half_days_in_day);
of = INT2FIX(0);
- sg = RARRAY_AREF(a, 1);
+ sg = RARRAY_PTR(a)[1];
if (!k_numeric_p(sg))
sg = DBL2NUM(RTEST(sg) ? GREGORIAN : JULIAN);
}
else {
- ajd = RARRAY_AREF(a, 0);
- of = RARRAY_AREF(a, 1);
- sg = RARRAY_AREF(a, 2);
+ ajd = RARRAY_PTR(a)[0];
+ of = RARRAY_PTR(a)[1];
+ sg = RARRAY_PTR(a)[2];
}
old_to_new(ajd, of, sg,
&nth, &jd, &df, &sf, &rof, &rsg);
if (!df && f_zero_p(sf) && !rof) {
- set_to_simple(self, &dat->s, nth, jd, rsg, 0, 0, 0, HAVE_JD);
+ set_to_simple(&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(self, &dat->c, nth, jd, df, sf, rof, rsg,
+ set_to_complex(&dat->c, nth, jd, df, sf, rof, rsg,
0, 0, 0, 0, 0, 0,
HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
@@ -7151,20 +7095,20 @@ d_lite_marshal_load(VALUE self, VALUE a)
int jd, df, of;
double sg;
- 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));
+ 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]);
if (!df && f_zero_p(sf) && !of) {
- set_to_simple(self, &dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
+ set_to_simple(&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(self, &dat->c, nth, jd, df, sf, of, sg,
+ set_to_complex(&dat->c, nth, jd, df, sf, of, sg,
0, 0, 0, 0, 0, 0,
HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
@@ -7200,7 +7144,7 @@ date_s__load(VALUE klass, VALUE s)
* call-seq:
* DateTime.jd([jd=0[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]) -> datetime
*
- * Creates a DateTime object denoting the given chronological Julian
+ * Creates a datetime object denoting the given chronological Julian
* day number.
*
* DateTime.jd(2451944) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
@@ -7268,7 +7212,7 @@ datetime_s_jd(int argc, VALUE *argv, VALUE klass)
* call-seq:
* DateTime.ordinal([year=-4712[, yday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]) -> datetime
*
- * Creates a DateTime object denoting the given ordinal date.
+ * Creates a date-time object denoting the given ordinal date.
*
* DateTime.ordinal(2001,34) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
* DateTime.ordinal(2001,34,4,5,6,'+7')
@@ -7344,7 +7288,7 @@ datetime_s_ordinal(int argc, VALUE *argv, VALUE klass)
* DateTime.civil([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) -> datetime
* DateTime.new([year=-4712[, month=1[, mday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) -> datetime
*
- * Creates a DateTime object denoting the given calendar date.
+ * Creates a date-time object denoting the given calendar date.
*
* DateTime.new(2001,2,3) #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
* DateTime.new(2001,2,3,4,5,6,'+7')
@@ -7442,7 +7386,7 @@ datetime_s_civil(int argc, VALUE *argv, VALUE klass)
* call-seq:
* DateTime.commercial([cwyear=-4712[, cweek=1[, cwday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) -> datetime
*
- * Creates a DateTime object denoting the given week date.
+ * Creates a date-time object denoting the given week date.
*
* DateTime.commercial(2001) #=> #<DateTime: 2001-01-01T00:00:00+00:00 ...>
* DateTime.commercial(2002) #=> #<DateTime: 2001-12-31T00:00:00+00:00 ...>
@@ -7659,7 +7603,7 @@ datetime_s_nth_kday(int argc, VALUE *argv, VALUE klass)
* call-seq:
* DateTime.now([start=Date::ITALY]) -> datetime
*
- * Creates a DateTime object denoting the present time.
+ * Creates a date-time object denoting the present time.
*
* DateTime.now #=> #<DateTime: 2011-06-11T21:20:44+09:00 ...>
*/
@@ -7708,8 +7652,8 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass)
s = 59;
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
of = tm.tm_gmtoff;
-#elif defined(HAVE_TIMEZONE)
-#ifdef HAVE_ALTZONE
+#elif defined(HAVE_VAR_TIMEZONE)
+#ifdef HAVE_VAR_ALTZONE
of = (long)-((tm.tm_isdst > 0) ? altzone : timezone);
#else
of = (long)-timezone;
@@ -7862,7 +7806,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
* template, and returns a hash of parsed elements. _strptime does
* not support specification of flags and width unlike strftime.
*
- * See also strptime(3) and #strftime.
+ * See also strptime(3) and strftime.
*/
static VALUE
datetime_s__strptime(int argc, VALUE *argv, VALUE klass)
@@ -7872,10 +7816,10 @@ datetime_s__strptime(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=Date::ITALY]]]) -> datetime
+ * DateTime.strptime([string='-4712-01-01T00:00:00+00:00'[, format='%FT%T%z'[ ,start=ITALY]]]) -> datetime
*
* Parses the given representation of date and time with the given
- * template, and creates a DateTime object. strptime does not support
+ * template, and creates a date object. strptime does not support
* specification of flags and width unlike strftime.
*
* DateTime.strptime('2001-02-03T04:05:06+07:00', '%Y-%m-%dT%H:%M:%S%z')
@@ -7895,7 +7839,7 @@ datetime_s__strptime(int argc, VALUE *argv, VALUE klass)
* DateTime.strptime('sat3feb014pm+7', '%a%d%b%y%H%p%z')
* #=> #<DateTime: 2001-02-03T16:00:00+07:00 ...>
*
- * See also strptime(3) and #strftime.
+ * See also strptime(3) and strftime.
*/
static VALUE
datetime_s_strptime(int argc, VALUE *argv, VALUE klass)
@@ -7925,10 +7869,10 @@ datetime_s_strptime(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=Date::ITALY]]) -> datetime
+ * DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=ITALY]]) -> datetime
*
* Parses the given representation of date and time, and creates a
- * DateTime object. This method does not function as a validator.
+ * date object. This method does not function as a validator.
*
* If the optional second argument is true and the detected year is in
* the range "00" to "99", makes it full.
@@ -7968,9 +7912,9 @@ datetime_s_parse(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.iso8601(string='-4712-01-01T00:00:00+00:00'[, start=Date::ITALY]) -> datetime
+ * DateTime.iso8601(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some typical ISO 8601 formats.
*
* DateTime.iso8601('2001-02-03T04:05:06+07:00')
@@ -8002,9 +7946,9 @@ datetime_s_iso8601(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=Date::ITALY]) -> datetime
+ * DateTime.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some typical RFC 3339 formats.
*
* DateTime.rfc3339('2001-02-03T04:05:06+07:00')
@@ -8032,9 +7976,9 @@ datetime_s_rfc3339(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.xmlschema(string='-4712-01-01T00:00:00+00:00'[, start=Date::ITALY]) -> datetime
+ * DateTime.xmlschema(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some typical XML Schema formats.
*
* DateTime.xmlschema('2001-02-03T04:05:06+07:00')
@@ -8062,10 +8006,10 @@ datetime_s_xmlschema(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=Date::ITALY]) -> datetime
- * DateTime.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=Date::ITALY]) -> datetime
+ * DateTime.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) -> datetime
+ * DateTime.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some typical RFC 2822 formats.
*
* DateTime.rfc2822('Sat, 3 Feb 2001 04:05:06 +0700')
@@ -8093,9 +8037,9 @@ datetime_s_rfc2822(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=Date::ITALY]) -> datetime
+ * DateTime.httpdate(string='Mon, 01 Jan -4712 00:00:00 GMT'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some RFC 2616 format.
*
* DateTime.httpdate('Sat, 03 Feb 2001 04:05:06 GMT')
@@ -8123,9 +8067,9 @@ datetime_s_httpdate(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * DateTime.jisx0301(string='-4712-01-01T00:00:00+00:00'[, start=Date::ITALY]) -> datetime
+ * DateTime.jisx0301(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) -> datetime
*
- * Creates a new DateTime object by parsing from a string according to
+ * Creates a new Date object by parsing from a string according to
* some typical JIS X 0301 formats.
*
* DateTime.jisx0301('H13.02.03T04:05:06+07:00')
@@ -8155,8 +8099,8 @@ datetime_s_jisx0301(int argc, VALUE *argv, VALUE klass)
* call-seq:
* dt.to_s -> string
*
- * Returns a string in an ISO 8601 format. (This method doesn't use the
- * expanded representations.)
+ * Returns a string in an ISO 8601 format (This method doesn't use the
+ * expanded representations).
*
* DateTime.new(2001,2,3,4,5,6,'-7').to_s
* #=> "2001-02-03T04:05:06-07:00"
@@ -8171,20 +8115,20 @@ dt_lite_to_s(VALUE self)
* call-seq:
* dt.strftime([format='%FT%T%:z']) -> string
*
- * Formats date according to the directives in the given format
- * string.
- * The directives begin with a percent (%) character.
- * Any text not listed as a directive will be passed through to the
- * output string.
+ * Formats date according to the directives in the given format
+ * string.
+ * The directives begins with a percent (%) character.
+ * Any text not listed as a directive will be passed through to the
+ * output string.
*
- * A directive consists of a percent (%) character,
- * zero or more flags, an optional minimum field width,
- * an optional modifier, and a conversion specifier
- * as follows.
+ * The directive consists of a percent (%) character,
+ * zero or more flags, optional minimum field width,
+ * optional modifier and a conversion specifier
+ * as follows.
*
* %<flags><width><modifier><conversion>
*
- * Flags:
+ * Flags:
* - don't pad a numerical output.
* _ use spaces for padding.
* 0 use zeros for padding.
@@ -8192,12 +8136,12 @@ dt_lite_to_s(VALUE self)
* # change case.
* : use colons for %z.
*
- * The minimum field width specifies the minimum width.
+ * The minimum field width specifies the minimum width.
*
- * The modifiers are "E" and "O".
- * They are ignored.
+ * The modifier is "E" and "O".
+ * They are ignored.
*
- * Format directives:
+ * Format directives:
*
* Date (Year, Month, Day):
* %Y - Year with century (can be negative, 4 digits at least)
@@ -8245,7 +8189,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 - Equivalent to %:z (e.g. +09:00)
+ * %Z - Time zone abbreviation name or something similar information.
*
* Weekday:
* %A - The full weekday name (``Sunday'')
@@ -8290,24 +8234,23 @@ dt_lite_to_s(VALUE self)
* %T - 24-hour time (%H:%M:%S)
* %+ - date(1) (%a %b %e %H:%M:%S %Z %Y)
*
- * This method is similar to the strftime() function defined in ISO C
- * and POSIX.
- * Several directives (%a, %A, %b, %B, %c, %p, %r, %x, %X, %E*, %O* and %Z)
- * are locale dependent in the function.
- * However, this method is locale independent.
- * So, the result may differ even if the same format string is used in other
- * systems such as C.
- * It is good practice to avoid %x and %X because there are corresponding
- * locale independent representations, %D and %T.
+ * This method is similar to strftime() function defined in ISO C and POSIX.
+ * Several directives (%a, %A, %b, %B, %c, %p, %r, %x, %X, %E*, %O* and %Z)
+ * are locale dependent in the function.
+ * However this method is locale independent.
+ * So, the result may differ even if a same format string is used in other
+ * systems such as C.
+ * It is good practice to avoid %x and %X because there are corresponding
+ * locale independent representations, %D and %T.
*
- * Examples:
+ * Examples:
*
* d = DateTime.new(2007,11,19,8,37,48,"-06:00")
* #=> #<DateTime: 2007-11-19T08:37:48-0600 ...>
* d.strftime("Printed on %m/%d/%Y") #=> "Printed on 11/19/2007"
* d.strftime("at %I:%M%p") #=> "at 08:37AM"
*
- * Various ISO 8601 formats:
+ * Various ISO 8601 formats:
* %Y%m%d => 20071119 Calendar date (basic)
* %F => 2007-11-19 Calendar date (extended)
* %Y-%m => 2007-11 Calendar date, reduced accuracy, specific month
@@ -8343,7 +8286,7 @@ dt_lite_to_s(VALUE self)
* %GW%V%uT%H%M%z => 2007W471T0837-0600 Week date and local time and difference from UTC (basic)
* %G-W%V-%uT%R%:z => 2007-W47-1T08:37-06:00 Week date and local time and difference from UTC (extended)
*
- * See also strftime(3) and ::strptime.
+ * See also strftime(3) and strptime.
*/
static VALUE
dt_lite_strftime(int argc, VALUE *argv, VALUE self)
@@ -8353,19 +8296,26 @@ dt_lite_strftime(int argc, VALUE *argv, VALUE self)
}
static VALUE
-iso8601_timediv(VALUE self, long n)
+iso8601_timediv(VALUE self, VALUE n)
{
- static const char timefmt[] = "T%H:%M:%S";
- static const char zone[] = "%:z";
- char fmt[sizeof(timefmt) + sizeof(zone) + rb_strlen_lit(".%N") +
- DECIMAL_SIZE_OF_LONG];
- char *p = fmt;
+ VALUE fmt;
+
+ n = to_integer(n);
+ fmt = rb_usascii_str_new2("T%H:%M:%S");
+ if (f_gt_p(n, INT2FIX(0))) {
+ VALUE argv[3];
+
+ get_d1(self);
- memcpy(p, timefmt, sizeof(timefmt)-1);
- p += sizeof(timefmt)-1;
- if (n > 0) p += snprintf(p, fmt+sizeof(fmt)-p, ".%%%ldN", n);
- memcpy(p, zone, sizeof(zone));
- return strftimev(fmt, self, set_tmx);
+ argv[0] = rb_usascii_str_new2(".%0*d");
+ argv[1] = n;
+ argv[2] = f_round(f_quo(m_sf_in_sec(dat),
+ f_quo(INT2FIX(1),
+ f_expt(INT2FIX(10), n))));
+ rb_str_append(fmt, rb_f_sprintf(3, argv));
+ }
+ rb_str_append(fmt, rb_usascii_str_new2("%:z"));
+ return strftimev(RSTRING_PTR(fmt), self, set_tmx);
}
/*
@@ -8373,8 +8323,8 @@ iso8601_timediv(VALUE self, long n)
* dt.iso8601([n=0]) -> string
* dt.xmlschema([n=0]) -> string
*
- * This method is equivalent to strftime('%FT%T%:z').
- * The optional argument +n+ is the number of digits for fractional seconds.
+ * This method is equivalent to strftime('%FT%T'). The optional
+ * argument n is length of fractional seconds.
*
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').iso8601(9)
* #=> "2001-02-03T04:05:06.123456789+07:00"
@@ -8382,22 +8332,23 @@ iso8601_timediv(VALUE self, long n)
static VALUE
dt_lite_iso8601(int argc, VALUE *argv, VALUE self)
{
- long n = 0;
+ VALUE n;
- rb_check_arity(argc, 0, 1);
- if (argc >= 1)
- n = NUM2LONG(argv[0]);
+ rb_scan_args(argc, argv, "01", &n);
- return rb_str_append(strftimev("%Y-%m-%d", self, set_tmx),
- iso8601_timediv(self, n));
+ if (argc < 1)
+ n = INT2FIX(0);
+
+ return f_add(strftimev("%Y-%m-%d", self, set_tmx),
+ iso8601_timediv(self, n));
}
/*
* call-seq:
* dt.rfc3339([n=0]) -> string
*
- * This method is equivalent to strftime('%FT%T%:z').
- * The optional argument +n+ is the number of digits for fractional seconds.
+ * This method is equivalent to strftime('%FT%T'). The optional
+ * argument n is length of fractional seconds.
*
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').rfc3339(9)
* #=> "2001-02-03T04:05:06.123456789+07:00"
@@ -8412,8 +8363,8 @@ dt_lite_rfc3339(int argc, VALUE *argv, VALUE self)
* call-seq:
* dt.jisx0301([n=0]) -> string
*
- * Returns a string in a JIS X 0301 format.
- * The optional argument +n+ is the number of digits for fractional seconds.
+ * Returns a string in a JIS X 0301 format. The optional argument n
+ * is length of fractional seconds.
*
* DateTime.parse('2001-02-03T04:05:06.123456789+07:00').jisx0301(9)
* #=> "H13.02.03T04:05:06.123456789+07:00"
@@ -8421,32 +8372,41 @@ dt_lite_rfc3339(int argc, VALUE *argv, VALUE self)
static VALUE
dt_lite_jisx0301(int argc, VALUE *argv, VALUE self)
{
- long n = 0;
+ VALUE n, s;
- rb_check_arity(argc, 0, 1);
- if (argc >= 1)
- n = NUM2LONG(argv[0]);
+ rb_scan_args(argc, argv, "01", &n);
+
+ if (argc < 1)
+ n = INT2FIX(0);
- return rb_str_append(d_lite_jisx0301(self),
- iso8601_timediv(self, n));
+ {
+ get_d1(self);
+ s = jisx0301_date(m_real_local_jd(dat),
+ m_real_year(dat));
+ return rb_str_append(strftimev(RSTRING_PTR(s), self, set_tmx),
+ iso8601_timediv(self, n));
+ }
}
/* conversions */
+#define f_getlocal(x) rb_funcall(x, rb_intern("getlocal"), 0)
#define f_subsec(x) rb_funcall(x, rb_intern("subsec"), 0)
#define f_utc_offset(x) rb_funcall(x, rb_intern("utc_offset"), 0)
#define f_local3(x,y,m,d) rb_funcall(x, rb_intern("local"), 3, y, m, d)
+#define f_utc6(x,y,m,d,h,min,s) rb_funcall(x, rb_intern("utc"), 6,\
+ y, m, d, h, min, s)
/*
* call-seq:
* t.to_time -> time
*
- * Returns self.
+ * Returns a copy of self as local mode.
*/
static VALUE
time_to_time(VALUE self)
{
- return self;
+ return f_getlocal(self);
}
/*
@@ -8541,7 +8501,7 @@ date_to_time(VALUE self)
* call-seq:
* d.to_date -> self
*
- * Returns self.
+ * Returns self;
*/
static VALUE
date_to_date(VALUE self)
@@ -8574,7 +8534,7 @@ date_to_datetime(VALUE self)
get_d1b(new);
bdat->c = adat->c;
bdat->c.df = 0;
- RB_OBJ_WRITE(new, &bdat->c.sf, INT2FIX(0));
+ bdat->c.sf = INT2FIX(0);
#ifndef USE_PACK
bdat->c.hour = 0;
bdat->c.min = 0;
@@ -8598,24 +8558,21 @@ date_to_datetime(VALUE self)
static VALUE
datetime_to_time(VALUE self)
{
- volatile VALUE dup = dup_obj(self);
+ volatile VALUE dup = dup_obj_with_new_offset(self, 0);
{
VALUE t;
get_d1(dup);
- t = rb_funcall(rb_cTime,
- rb_intern("new"),
- 7,
+ t = f_utc6(rb_cTime,
m_real_year(dat),
INT2FIX(m_mon(dat)),
INT2FIX(m_mday(dat)),
INT2FIX(m_hour(dat)),
INT2FIX(m_min(dat)),
f_add(INT2FIX(m_sec(dat)),
- m_sf_in_sec(dat)),
- INT2FIX(m_of(dat)));
- return t;
+ m_sf_in_sec(dat)));
+ return f_getlocal(t);
}
}
@@ -8643,7 +8600,7 @@ datetime_to_date(VALUE self)
VALUE new = d_lite_s_alloc_simple(cDate);
{
get_d1b(new);
- copy_complex_to_simple(new, &bdat->s, &adat->c)
+ copy_complex_to_simple(&bdat->s, &adat->c)
bdat->s.jd = m_local_jd(adat);
bdat->s.flags &= ~(HAVE_DF | HAVE_TIME | COMPLEX_DAT);
return new;
@@ -9043,13 +9000,13 @@ Init_date_core(void)
/*
* date and datetime class - Tadayoshi Funaba 1998-2011
*
- * 'date' provides two classes: Date and DateTime.
+ * 'date' provides two classes Date and DateTime.
*
- * == Terms and Definitions
+ * == Terms and definitions
*
* Some terms and definitions are based on ISO 8601 and JIS X 0301.
*
- * === Calendar Date
+ * === calendar date
*
* The calendar date is a particular day of a calendar year,
* identified by its ordinal number within a calendar month within
@@ -9057,33 +9014,33 @@ Init_date_core(void)
*
* In those classes, this is so-called "civil".
*
- * === Ordinal Date
+ * === ordinal date
*
* The ordinal date is a particular day of a calendar year identified
* by its ordinal number within the year.
*
* In those classes, this is so-called "ordinal".
*
- * === Week Date
+ * === week date
*
* The week date is a date identified by calendar week and day numbers.
*
* 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 is so-called "commercial".
+ * In those classes, this so-called "commercial".
*
- * === Julian Day Number
+ * === julian day number
*
- * The Julian day number is in elapsed days since noon (Greenwich Mean
- * Time) on January 1, 4713 BCE (in the Julian calendar).
+ * The Julian day number is in elapsed days since noon (Greenwich mean
+ * time) on January 1, 4713 BCE (in the Julian calendar).
*
- * In this document, the astronomical Julian day number is the 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
+ * 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
* midnight on local time.
*
* In this document, when the term "Julian day number" simply appears,
@@ -9092,72 +9049,66 @@ Init_date_core(void)
*
* In those classes, those are so-called "ajd" and "jd".
*
- * === Modified Julian Day Number
+ * === modified julian day number
*
* The modified Julian day number is in elapsed days since midnight
- * (Coordinated Universal Time) on November 17, 1858 CE (in the
+ * (Coordinated universal time) on November 17, 1858 CE (in the
* Gregorian calendar).
*
* In this document, the astronomical modified Julian day number is
- * the 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
* appears, it just refers to "chronological modified Julian day
* number", not the original.
*
- * In those classes, those are so-called "amjd" and "mjd".
+ * In those classes, this is so-called "mjd".
+ *
*
* == Date
*
- * A subclass of Object that includes the Comparable module and
- * easily handles date.
+ * A subclass of Object includes Comparable module, easily handles
+ * date.
*
- * A Date object is created with Date::new, Date::jd, Date::ordinal,
+ * Date object is created with Date::new, Date::jd, Date::ordinal,
* Date::commercial, Date::parse, Date::strptime, Date::today,
- * Time#to_date, etc.
+ * Time#to_date or etc.
*
* 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.
*
- * The concept of a date object can be represented as a tuple
+ * The concept of this date object can be represented as a tuple
* 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
- * Caesar. The new style is the Gregorian calendar, which is the
+ * Caersar. 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.
* The offset in this class is usually zero, and cannot be
* specified directly.
*
- * A Date object can be created with an optional argument,
- * the day of calendar reform as a Julian day number, which
- * should be 2298874 to 2426355 or negative/positive infinity.
- * The default value is +Date::ITALY+ (2299161=1582-10-15).
- * See also sample/cal.rb.
+ * An optional argument the day of calendar reform (start) as a
+ * Julian day number, which should be 2298874 to 2426355 or -/+oo.
+ * The default value is Date::ITALY (2299161=1582-10-15). See
+ * also sample/cal.rb.
*
* $ ruby sample/cal.rb -c it 10 1582
* October 1582
@@ -9174,7 +9125,7 @@ Init_date_core(void)
* 17 18 19 20 21 22 23
* 24 25 26 27 28 29 30
*
- * A Date object has various methods. See each reference.
+ * Date object has various methods. See each reference.
*
* d = Date.parse('3rd Feb 2001')
* #=> #<Date: 2001-02-03 ...>
@@ -9185,6 +9136,66 @@ 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);
@@ -9222,12 +9233,12 @@ Init_date_core(void)
rb_define_const(cDate, "ENGLAND", INT2FIX(ENGLAND));
/* The Julian day number of the day of calendar reform for the
- * proleptic Julian calendar.
+ * proleptic Julian calendar
*/
rb_define_const(cDate, "JULIAN", DBL2NUM(JULIAN));
/* The Julian day number of the day of calendar reform for the
- * proleptic Gregorian calendar.
+ * proleptic Gregorian calendar
*/
rb_define_const(cDate, "GREGORIAN", DBL2NUM(GREGORIAN));
@@ -9432,145 +9443,7 @@ 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
- *
- * 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.
- *
- * A DateTime object is created with DateTime::new, DateTime::jd,
- * DateTime::ordinal, DateTime::commercial, DateTime::parse,
- * DateTime::strptime, DateTime::now, Time#to_datetime, 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 a
- * 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 ...>
- *
- * The offset 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
- * negative/positive infinity.
- * The default value is +Date::ITALY+ (2299161=1582-10-15).
- *
- * A 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 the
- * {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 there's no way
- * to express this with Time objects. 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 is 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.
- */
+ /* datetime */
cDateTime = rb_define_class("DateTime", cDate);
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index b74230d291..239e2643b0 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -7,9 +7,6 @@
#include "ruby/re.h"
#include <ctype.h>
-RUBY_EXTERN VALUE rb_int_positive_pow(long x, unsigned long y);
-RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
-
/* #define TIGHT_PARSER */
#define sizeof_array(o) (sizeof o / sizeof o[0])
@@ -47,12 +44,12 @@ RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int bas
#define cstr2num(s) rb_cstr_to_inum(s, 10, 0)
#define str2num(s) rb_str_to_inum(s, 10, 0)
-static const char abbr_days[][4] = {
+static const char *abbr_days[] = {
"sun", "mon", "tue", "wed",
"thu", "fri", "sat"
};
-static const char abbr_months[][4] = {
+static const char *abbr_months[] = {
"jan", "feb", "mar", "apr", "may", "jun",
"jul", "aug", "sep", "oct", "nov", "dec"
};
@@ -71,7 +68,6 @@ static const char abbr_months[][4] = {
static void
s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
- VALUE vbuf = 0;
VALUE c = Qnil;
if (!RB_TYPE_P(m, T_STRING))
@@ -168,11 +164,10 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCV_N(char, vbuf, ep - bp + 1);
+ buf = ALLOCA_N(char, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
iy = cstr2num(buf);
- ALLOCV_END(vbuf);
}
set_hash("year", iy);
}
@@ -194,11 +189,10 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCV_N(char, vbuf, ep - bp + 1);
+ buf = ALLOCA_N(char, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
im = cstr2num(buf);
- ALLOCV_END(vbuf);
}
set_hash("mon", im);
}
@@ -217,11 +211,10 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
char *buf;
- buf = ALLOCV_N(char, vbuf, ep - bp + 1);
+ buf = ALLOCA_N(char, ep - bp + 1);
memcpy(buf, bp, ep - bp);
buf[ep - bp] = '\0';
id = cstr2num(buf);
- ALLOCV_END(vbuf);
}
set_hash("mday", id);
}
@@ -340,20 +333,93 @@ subx(VALUE str, VALUE rep, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
}
#endif
-#include "zonetab.h"
+struct zone {
+ const char *name;
+ int offset;
+};
-static int
-str_end_with(const char *s, long l, const char *w)
-{
- int n = (int)strlen(w);
- return (l >= n && strncmp(s - n, w, n) == 0);
-}
+static struct zone zones_source[] = {
+ {"ut", 0*3600}, {"gmt", 0*3600}, {"est", -5*3600}, {"edt", -4*3600},
+ {"cst", -6*3600}, {"cdt", -5*3600}, {"mst", -7*3600}, {"mdt", -6*3600},
+ {"pst", -8*3600}, {"pdt", -7*3600},
+ {"a", 1*3600}, {"b", 2*3600}, {"c", 3*3600}, {"d", 4*3600},
+ {"e", 5*3600}, {"f", 6*3600}, {"g", 7*3600}, {"h", 8*3600},
+ {"i", 9*3600}, {"k", 10*3600}, {"l", 11*3600}, {"m", 12*3600},
+ {"n", -1*3600}, {"o", -2*3600}, {"p", -3*3600}, {"q", -4*3600},
+ {"r", -5*3600}, {"s", -6*3600}, {"t", -7*3600}, {"u", -8*3600},
+ {"v", -9*3600}, {"w", -10*3600}, {"x", -11*3600}, {"y", -12*3600},
+ {"z", 0*3600},
+
+ {"utc", 0*3600}, {"wet", 0*3600},
+ {"at", -2*3600}, {"brst",-2*3600}, {"ndt", -(2*3600+1800)},
+ {"art", -3*3600}, {"adt", -3*3600}, {"brt", -3*3600}, {"clst",-3*3600},
+ {"nst", -(3*3600+1800)},
+ {"ast", -4*3600}, {"clt", -4*3600},
+ {"akdt",-8*3600}, {"ydt", -8*3600},
+ {"akst",-9*3600}, {"hadt",-9*3600}, {"hdt", -9*3600}, {"yst", -9*3600},
+ {"ahst",-10*3600},{"cat",-10*3600}, {"hast",-10*3600},{"hst",-10*3600},
+ {"nt", -11*3600},
+ {"idlw",-12*3600},
+ {"bst", 1*3600}, {"cet", 1*3600}, {"fwt", 1*3600}, {"met", 1*3600},
+ {"mewt", 1*3600}, {"mez", 1*3600}, {"swt", 1*3600}, {"wat", 1*3600},
+ {"west", 1*3600},
+ {"cest", 2*3600}, {"eet", 2*3600}, {"fst", 2*3600}, {"mest", 2*3600},
+ {"mesz", 2*3600}, {"sast", 2*3600}, {"sst", 2*3600},
+ {"bt", 3*3600}, {"eat", 3*3600}, {"eest", 3*3600}, {"msk", 3*3600},
+ {"msd", 4*3600}, {"zp4", 4*3600},
+ {"zp5", 5*3600}, {"ist", (5*3600+1800)},
+ {"zp6", 6*3600},
+ {"wast", 7*3600},
+ {"cct", 8*3600}, {"sgt", 8*3600}, {"wadt", 8*3600},
+ {"jst", 9*3600}, {"kst", 9*3600},
+ {"east",10*3600}, {"gst", 10*3600},
+ {"eadt",11*3600},
+ {"idle",12*3600}, {"nzst",12*3600}, {"nzt", 12*3600},
+ {"nzdt",13*3600},
+
+ {"afghanistan", 16200}, {"alaskan", -32400},
+ {"arab", 10800}, {"arabian", 14400},
+ {"arabic", 10800}, {"atlantic", -14400},
+ {"aus central", 34200}, {"aus eastern", 36000},
+ {"azores", -3600}, {"canada central", -21600},
+ {"cape verde", -3600}, {"caucasus", 14400},
+ {"cen. australia", 34200}, {"central america", -21600},
+ {"central asia", 21600}, {"central europe", 3600},
+ {"central european", 3600}, {"central pacific", 39600},
+ {"central", -21600}, {"china", 28800},
+ {"dateline", -43200}, {"e. africa", 10800},
+ {"e. australia", 36000}, {"e. europe", 7200},
+ {"e. south america", -10800}, {"eastern", -18000},
+ {"egypt", 7200}, {"ekaterinburg", 18000},
+ {"fiji", 43200}, {"fle", 7200},
+ {"greenland", -10800}, {"greenwich", 0},
+ {"gtb", 7200}, {"hawaiian", -36000},
+ {"india", 19800}, {"iran", 12600},
+ {"jerusalem", 7200}, {"korea", 32400},
+ {"mexico", -21600}, {"mid-atlantic", -7200},
+ {"mountain", -25200}, {"myanmar", 23400},
+ {"n. central asia", 21600}, {"nepal", 20700},
+ {"new zealand", 43200}, {"newfoundland", -12600},
+ {"north asia east", 28800}, {"north asia", 25200},
+ {"pacific sa", -14400}, {"pacific", -28800},
+ {"romance", 3600}, {"russian", 10800},
+ {"sa eastern", -10800}, {"sa pacific", -18000},
+ {"sa western", -14400}, {"samoa", -39600},
+ {"se asia", 25200}, {"malay peninsula", 28800},
+ {"south africa", 7200}, {"sri lanka", 21600},
+ {"taipei", 28800}, {"tasmania", 36000},
+ {"tokyo", 32400}, {"tonga", 46800},
+ {"us eastern", -18000}, {"us mountain", -25200},
+ {"vladivostok", 36000}, {"w. australia", 28800},
+ {"w. central africa", 3600}, {"w. europe", 3600},
+ {"west asia", 18000}, {"west pacific", 36000},
+ {"yakutsk", 32400}
+};
VALUE
date_zone_to_diff(VALUE str)
{
VALUE offset = Qnil;
- VALUE vbuf = 0;
long l, i;
char *s, *dest, *d;
@@ -362,7 +428,7 @@ date_zone_to_diff(VALUE str)
l = RSTRING_LEN(str);
s = RSTRING_PTR(str);
- dest = d = ALLOCV_N(char, vbuf, l + 1);
+ dest = d = ALLOCA_N(char, l + 1);
for (i = 0; i < l; i++) {
if (isspace((unsigned char)s[i]) || s[i] == '\0') {
@@ -383,96 +449,162 @@ date_zone_to_diff(VALUE str)
--d;
*d = '\0';
}
- l = d - dest;
- s = dest;
+ str = rb_str_new2(dest);
{
- static const char STD[] = " standard time";
- static const char DST1[] = " daylight time";
- static const char DST2[] = " dst";
+#define STD " standard time"
+#define DST " daylight time"
+ char *ss, *ds;
+ long sl, dl;
int dst = 0;
- if (str_end_with(d, l, STD)) {
- l -= sizeof(STD) - 1;
+ sl = RSTRING_LEN(str) - (sizeof STD - 1);
+ ss = RSTRING_PTR(str) + sl;
+ dl = RSTRING_LEN(str) - (sizeof DST - 1);
+ ds = RSTRING_PTR(str) + dl;
+
+ if (sl >= 0 && strcmp(ss, STD) == 0) {
+ str = rb_str_new(RSTRING_PTR(str), sl);
}
- else if (str_end_with(d, l, DST1)) {
- l -= sizeof(DST1) - 1;
+ else if (dl >= 0 && strcmp(ds, DST) == 0) {
+ str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
- else if (str_end_with(d, l, DST2)) {
- l -= sizeof(DST2) - 1;
- dst = 1;
+#undef STD
+#undef DST
+ else {
+#define DST " dst"
+ char *ds;
+ long dl;
+
+ dl = RSTRING_LEN(str) - (sizeof DST - 1);
+ ds = RSTRING_PTR(str) + dl;
+
+ if (dl >= 0 && strcmp(ds, DST) == 0) {
+ str = rb_str_new(RSTRING_PTR(str), dl);
+ dst = 1;
+ }
+#undef DST
}
{
- const struct zone *z = zonetab(s, (unsigned int)l);
- if (z) {
- int d = z->offset;
+ static VALUE zones = Qnil;
+
+ if (NIL_P(zones)) {
+ int i;
+
+ zones = rb_hash_new();
+ rb_gc_register_mark_object(zones);
+ for (i = 0; i < (int)sizeof_array(zones_source); i++) {
+ VALUE name = rb_str_new2(zones_source[i].name);
+ VALUE offset = INT2FIX(zones_source[i].offset);
+ rb_hash_aset(zones, name, offset);
+ }
+ }
+
+ offset = f_aref(zones, str);
+ if (!NIL_P(offset)) {
if (dst)
- d += 3600;
- offset = INT2FIX(d);
+ offset = f_add(offset, INT2FIX(3600));
goto ok;
}
}
{
- char *p;
- int sign = 0;
- long hour = 0, min = 0, sec = 0;
+ char *s, *p;
+ VALUE sign;
+ VALUE hour = Qnil, min = Qnil, sec = Qnil;
+ VALUE str_orig;
+
+ s = RSTRING_PTR(str);
+ str_orig = str;
- if (l > 3 &&
- (strncmp(s, "gmt", 3) == 0 ||
- strncmp(s, "utc", 3) == 0)) {
+ if (strncmp(s, "gmt", 3) == 0 ||
+ strncmp(s, "utc", 3) == 0)
s += 3;
- l -= 3;
- }
if (issign(*s)) {
- sign = *s == '-';
+ sign = rb_str_new(s, 1);
s++;
- l--;
- hour = STRTOUL(s, &p, 10);
- if (*p == ':') {
+ str = rb_str_new2(s);
+
+ if (p = strchr(s, ':')) {
+ hour = rb_str_new(s, p - s);
s = ++p;
- min = STRTOUL(s, &p, 10);
- if (*p == ':') {
+ if (p = strchr(s, ':')) {
+ min = rb_str_new(s, p - s);
s = ++p;
- sec = STRTOUL(s, &p, 10);
+ if (p = strchr(s, ':')) {
+ sec = rb_str_new(s, p - s);
+ }
+ else
+ sec = rb_str_new2(s);
}
+ else
+ min = rb_str_new2(s);
+ RB_GC_GUARD(str_orig);
goto num;
}
- if (*p == ',' || *p == '.') {
- char *e = 0;
- p++;
- min = STRTOUL(p, &e, 10) * 3600;
- if (sign) {
- hour = -hour;
- min = -min;
- }
- offset = rb_rational_new(INT2FIX(min),
- rb_int_positive_pow(10, (int)(e - p)));
- offset = f_add(INT2FIX(hour * 3600), offset);
- goto ok;
+ if (strpbrk(RSTRING_PTR(str), ",.")) {
+ char *a, *b;
+
+ a = ALLOCA_N(char, RSTRING_LEN(str) + 1);
+ strcpy(a, RSTRING_PTR(str));
+ b = strpbrk(a, ",.");
+ *b = '\0';
+ b++;
+
+ hour = cstr2num(a);
+ min = f_mul(rb_rational_new2
+ (cstr2num(b),
+ f_expt(INT2FIX(10),
+ LONG2NUM((long)strlen(b)))),
+ INT2FIX(60));
+ goto num;
}
- else if (l > 2) {
- size_t n;
- int ov;
-
- if (l >= 1)
- hour = ruby_scan_digits(&s[0], 2 - l % 2, 10, &n, &ov);
- if (l >= 3)
- min = ruby_scan_digits(&s[2 - l % 2], 2, 10, &n, &ov);
- if (l >= 5)
- sec = ruby_scan_digits(&s[4 - l % 2], 2, 10, &n, &ov);
+ {
+ const char *cs = RSTRING_PTR(str);
+ long cl = RSTRING_LEN(str);
+
+ if (cl % 2) {
+ if (cl >= 1)
+ hour = rb_str_new(&cs[0], 1);
+ if (cl >= 3)
+ min = rb_str_new(&cs[1], 2);
+ if (cl >= 5)
+ sec = rb_str_new(&cs[3], 2);
+ }
+ else {
+ if (cl >= 2)
+ hour = rb_str_new(&cs[0], 2);
+ if (cl >= 4)
+ min = rb_str_new(&cs[2], 2);
+ if (cl >= 6)
+ sec = rb_str_new(&cs[4], 2);
+ }
goto num;
}
num:
- sec += min * 60 + hour * 3600;
- if (sign) sec = -sec;
- offset = INT2FIX(sec);
+ if (NIL_P(hour))
+ offset = INT2FIX(0);
+ else {
+ if (RB_TYPE_P(hour, T_STRING))
+ hour = str2num(hour);
+ offset = f_mul(hour, INT2FIX(3600));
+ }
+ if (!NIL_P(min)) {
+ if (RB_TYPE_P(min, T_STRING))
+ min = str2num(min);
+ offset = f_add(offset, f_mul(min, INT2FIX(60)));
+ }
+ if (!NIL_P(sec))
+ offset = f_add(offset, str2num(sec));
+ if (!NIL_P(sign) &&
+ RSTRING_LEN(sign) == 1 &&
+ *RSTRING_PTR(sign) == '-')
+ offset = f_negate(offset);
}
}
}
RB_GC_GUARD(str);
ok:
- ALLOCV_END(vbuf);
return offset;
}
@@ -1843,8 +1975,7 @@ parse_ddd_cb(VALUE m, VALUE hash)
set_hash("zone", s5);
if (*cs5 == '[') {
- VALUE vbuf = 0;
- char *buf = ALLOCV_N(char, vbuf, l5 + 1);
+ char *buf = ALLOCA_N(char, l5 + 1);
char *s1, *s2, *s3;
VALUE zone;
@@ -1866,7 +1997,6 @@ 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 9d8167b612..20931a3124 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, const size_t maxsize, const char *format,
+date_strftime_with_tmx(char *s, size_t maxsize, const char *format,
const struct tmx *tmx)
{
char *endp = s + maxsize;
@@ -575,12 +575,7 @@ date_strftime_with_tmx(char *s, const size_t maxsize, const char *format,
case '5': case '6': case '7': case '8': case '9':
{
char *e;
- unsigned long prec = strtoul(format, &e, 10);
- if (prec > INT_MAX || prec > maxsize) {
- errno = ERANGE;
- return 0;
- }
- precision = (int)prec;
+ precision = (int)strtoul(format, &e, 10);
format = e - 1;
goto again;
}
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index 4f93219317..e318af19f3 100644
--- a/ext/date/date_strptime.c
+++ b/ext/date/date_strptime.c
@@ -103,12 +103,10 @@ read_digits(const char *s, VALUE *n, size_t width)
return l;
}
else {
- VALUE vbuf = 0;
- char *s2 = ALLOCV_N(char, vbuf, l + 1);
+ char *s2 = ALLOCA_N(char, l + 1);
memcpy(s2, s, l);
s2[l] = '\0';
*n = rb_cstr_to_inum(s2, 10, 0);
- ALLOCV_END(vbuf);
return l;
}
}
diff --git a/ext/date/date_tmx.h b/ext/date/date_tmx.h
index 993a15327d..ed06501228 100644
--- a/ext/date/date_tmx.h
+++ b/ext/date/date_tmx.h
@@ -23,7 +23,7 @@ struct tmx_funcs {
};
struct tmx {
void *dat;
- const struct tmx_funcs *funcs;
+ struct tmx_funcs *funcs;
};
#define tmx_attr(x) (tmx->funcs->x)(tmx->dat)
diff --git a/ext/date/depend b/ext/date/depend
index 864fcc5302..3a13fcc9a9 100644
--- a/ext/date/depend
+++ b/ext/date/depend
@@ -1,63 +1,7 @@
-# AUTOGENERATED DEPENDENCIES START
-date_core.o: $(RUBY_EXTCONF_H)
-date_core.o: $(arch_hdrdir)/ruby/config.h
-date_core.o: $(hdrdir)/ruby/backward.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/onigmo.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: $(hdrdir)/ruby/util.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/backward.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/onigmo.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_parse.o: zonetab.h
-date_parse.o: zonetab.list
-date_strftime.o: $(RUBY_EXTCONF_H)
-date_strftime.o: $(arch_hdrdir)/ruby/config.h
-date_strftime.o: $(hdrdir)/ruby/backward.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
+$(OBJS): $(ruby_headers)
+date_core.o: date_tmx.h $(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/oniguruma.h
date_strftime.o: date_tmx.h
-date_strptime.o: $(RUBY_EXTCONF_H)
-date_strptime.o: $(arch_hdrdir)/ruby/config.h
-date_strptime.o: $(hdrdir)/ruby/backward.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/onigmo.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
+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
+
+
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index 8938df13b3..9f7d3e8f0b 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,9 +1,2 @@
-# frozen_string_literal: true
require 'mkmf'
-
-config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
-
-have_var("timezone", "time.h")
-have_var("altzone", "time.h")
-
create_makefile('date_core')
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index 9170a99ae9..83234f458b 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# date.rb: Written by Tadayoshi Funaba 1998-2011
require 'date_core'
@@ -15,26 +14,26 @@ class Date
protected :d
- def zero?() false end
- def finite?() false end
- def infinite?() d.nonzero? end
- def nan?() d.zero? end
+ def zero? () false end
+ def finite? () false end
+ def infinite? () d.nonzero? end
+ def nan? () d.zero? end
def abs() self.class.new end
- def -@() self.class.new(-d) end
- def +@() self.class.new(+d) end
+ def -@ () self.class.new(-d) end
+ def +@ () self.class.new(+d) end
- def <=>(other)
+ def <=> (other)
case other
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 +42,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/prereq.mk b/ext/date/prereq.mk
deleted file mode 100644
index c0c55d2c27..0000000000
--- a/ext/date/prereq.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-.SUFFIXES: .list
-
-.list.h:
- gperf -E -C -c -P -p -j1 -i 1 -g -o -t -N $(*F) $< \
- | sed -f $(top_srcdir)/tool/gperf.sed \
- > $(@F)
-
-zonetab.h: zonetab.list
diff --git a/ext/date/zonetab.h b/ext/date/zonetab.h
deleted file mode 100644
index 2dfa9b988a..0000000000
--- a/ext/date/zonetab.h
+++ /dev/null
@@ -1,895 +0,0 @@
-/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -E -C -c -P -p -j1 -i 1 -g -o -t -N zonetab zonetab.list */
-/* Computed positions: -k'1-4,$' */
-
-#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-gperf@gnu.org>."
-#endif
-
-#define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)
-#line 1 "zonetab.list"
-
-struct zone {
- int name;
- int offset;
-};
-static const struct zone *zonetab();
-#line 9 "zonetab.list"
-struct zone;
-/* maximum key range = 434, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (register const char *str, register size_t len)
-{
- static const unsigned short asso_values[] =
- {
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 19, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 2, 4, 439, 439, 439,
- 439, 439, 8, 6, 3, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 7, 63, 53,
- 2, 4, 32, 110, 88, 78, 90, 68, 47, 108,
- 10, 73, 81, 124, 3, 1, 4, 77, 116, 88,
- 15, 96, 45, 5, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
- 439, 439, 439, 439, 439, 439, 439
- };
- register unsigned int hval = (unsigned int)len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[3]];
- /*FALLTHROUGH*/
- case 3:
- hval += asso_values[(unsigned char)str[2]];
- /*FALLTHROUGH*/
- case 2:
- hval += asso_values[(unsigned char)str[1]];
- /*FALLTHROUGH*/
- case 1:
- hval += asso_values[(unsigned char)str[0]+1];
- break;
- }
- return (unsigned int)hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-struct stringpool_t
- {
- char stringpool_str5[sizeof("r")];
- char stringpool_str6[sizeof("s")];
- char stringpool_str7[sizeof("d")];
- char stringpool_str14[sizeof("cst")];
- char stringpool_str15[sizeof("cdt")];
- char stringpool_str16[sizeof("sst")];
- char stringpool_str17[sizeof("cet")];
- char stringpool_str18[sizeof("msd")];
- char stringpool_str19[sizeof("cest")];
- char stringpool_str20[sizeof("cat")];
- char stringpool_str22[sizeof("mst")];
- char stringpool_str23[sizeof("mdt")];
- char stringpool_str24[sizeof("sast")];
- char stringpool_str25[sizeof("met")];
- char stringpool_str27[sizeof("mest")];
- char stringpool_str30[sizeof("wet")];
- char stringpool_str31[sizeof("dateline")];
- char stringpool_str32[sizeof("west")];
- char stringpool_str33[sizeof("wat")];
- char stringpool_str35[sizeof("wast")];
- char stringpool_str36[sizeof("wadt")];
- char stringpool_str37[sizeof("e")];
- char stringpool_str38[sizeof("central europe")];
- char stringpool_str39[sizeof("central asia")];
- char stringpool_str40[sizeof("west asia")];
- char stringpool_str41[sizeof("cen. australia")];
- char stringpool_str42[sizeof("central america")];
- char stringpool_str44[sizeof("est")];
- char stringpool_str45[sizeof("edt")];
- char stringpool_str46[sizeof("central european")];
- char stringpool_str47[sizeof("eet")];
- char stringpool_str48[sizeof("se asia")];
- char stringpool_str49[sizeof("eest")];
- char stringpool_str50[sizeof("eat")];
- char stringpool_str51[sizeof("z")];
- char stringpool_str52[sizeof("east")];
- char stringpool_str53[sizeof("eadt")];
- char stringpool_str54[sizeof("sa eastern")];
- char stringpool_str55[sizeof("w. europe")];
- char stringpool_str56[sizeof("c")];
- char stringpool_str57[sizeof("yst")];
- char stringpool_str58[sizeof("ydt")];
- char stringpool_str59[sizeof("kst")];
- char stringpool_str60[sizeof("clt")];
- char stringpool_str61[sizeof("eastern")];
- char stringpool_str62[sizeof("clst")];
- char stringpool_str63[sizeof("bt")];
- char stringpool_str64[sizeof("w. australia")];
- char stringpool_str65[sizeof("bst")];
- char stringpool_str66[sizeof("cct")];
- char stringpool_str67[sizeof("brt")];
- char stringpool_str69[sizeof("brst")];
- char stringpool_str71[sizeof("a")];
- char stringpool_str72[sizeof("e. europe")];
- char stringpool_str73[sizeof("at")];
- char stringpool_str74[sizeof("central")];
- char stringpool_str75[sizeof("ast")];
- char stringpool_str76[sizeof("adt")];
- char stringpool_str77[sizeof("art")];
- char stringpool_str78[sizeof("e. africa")];
- char stringpool_str79[sizeof("e. south america")];
- char stringpool_str80[sizeof("jst")];
- char stringpool_str81[sizeof("e. australia")];
- char stringpool_str82[sizeof("t")];
- char stringpool_str83[sizeof("nt")];
- char stringpool_str84[sizeof("n")];
- char stringpool_str85[sizeof("nst")];
- char stringpool_str86[sizeof("ndt")];
- char stringpool_str87[sizeof("canada central")];
- char stringpool_str88[sizeof("central pacific")];
- char stringpool_str89[sizeof("west pacific")];
- char stringpool_str90[sizeof("hst")];
- char stringpool_str91[sizeof("hdt")];
- char stringpool_str93[sizeof("malay peninsula")];
- char stringpool_str95[sizeof("zp6")];
- char stringpool_str97[sizeof("russian")];
- char stringpool_str98[sizeof("hast")];
- char stringpool_str99[sizeof("hadt")];
- char stringpool_str100[sizeof("gst")];
- char stringpool_str101[sizeof("zp5")];
- char stringpool_str102[sizeof("ist")];
- char stringpool_str103[sizeof("swt")];
- char stringpool_str104[sizeof("w")];
- char stringpool_str105[sizeof("zp4")];
- char stringpool_str107[sizeof("mez")];
- char stringpool_str108[sizeof("cape verde")];
- char stringpool_str109[sizeof("mesz")];
- char stringpool_str110[sizeof("greenland")];
- char stringpool_str112[sizeof("x")];
- char stringpool_str114[sizeof("mewt")];
- char stringpool_str115[sizeof("w. central africa")];
- char stringpool_str116[sizeof("k")];
- char stringpool_str117[sizeof("b")];
- char stringpool_str119[sizeof("m")];
- char stringpool_str120[sizeof("sri lanka")];
- char stringpool_str122[sizeof("fst")];
- char stringpool_str124[sizeof("iran")];
- char stringpool_str125[sizeof("sgt")];
- char stringpool_str126[sizeof("ut")];
- char stringpool_str128[sizeof("q")];
- char stringpool_str129[sizeof("nzt")];
- char stringpool_str131[sizeof("nzst")];
- char stringpool_str132[sizeof("nzdt")];
- char stringpool_str133[sizeof("myanmar")];
- char stringpool_str135[sizeof("alaskan")];
- char stringpool_str136[sizeof("pst")];
- char stringpool_str137[sizeof("pdt")];
- char stringpool_str138[sizeof("sa western")];
- char stringpool_str139[sizeof("korea")];
- char stringpool_str142[sizeof("y")];
- char stringpool_str143[sizeof("f")];
- char stringpool_str144[sizeof("akst")];
- char stringpool_str145[sizeof("akdt")];
- char stringpool_str148[sizeof("caucasus")];
- char stringpool_str150[sizeof("msk")];
- char stringpool_str151[sizeof("idle")];
- char stringpool_str153[sizeof("arabian")];
- char stringpool_str155[sizeof("o")];
- char stringpool_str156[sizeof("l")];
- char stringpool_str157[sizeof("mid-atlantic")];
- char stringpool_str160[sizeof("us eastern")];
- char stringpool_str164[sizeof("ahst")];
- char stringpool_str167[sizeof("h")];
- char stringpool_str168[sizeof("fle")];
- char stringpool_str169[sizeof("i")];
- char stringpool_str170[sizeof("north asia")];
- char stringpool_str171[sizeof("n. central asia")];
- char stringpool_str172[sizeof("north asia east")];
- char stringpool_str174[sizeof("sa pacific")];
- char stringpool_str177[sizeof("south africa")];
- char stringpool_str181[sizeof("aus eastern")];
- char stringpool_str182[sizeof("atlantic")];
- char stringpool_str186[sizeof("mexico")];
- char stringpool_str188[sizeof("mountain")];
- char stringpool_str190[sizeof("china")];
- char stringpool_str191[sizeof("azores")];
- char stringpool_str192[sizeof("india")];
- char stringpool_str194[sizeof("u")];
- char stringpool_str195[sizeof("arabic")];
- char stringpool_str196[sizeof("greenwich")];
- char stringpool_str197[sizeof("new zealand")];
- char stringpool_str198[sizeof("hawaiian")];
- char stringpool_str199[sizeof("g")];
- char stringpool_str200[sizeof("romance")];
- char stringpool_str203[sizeof("arab")];
- char stringpool_str204[sizeof("samoa")];
- char stringpool_str205[sizeof("v")];
- char stringpool_str206[sizeof("p")];
- char stringpool_str207[sizeof("gmt")];
- char stringpool_str208[sizeof("tasmania")];
- char stringpool_str209[sizeof("fwt")];
- char stringpool_str211[sizeof("newfoundland")];
- char stringpool_str217[sizeof("nepal")];
- char stringpool_str218[sizeof("aus central")];
- char stringpool_str221[sizeof("gtb")];
- char stringpool_str223[sizeof("vladivostok")];
- char stringpool_str229[sizeof("utc")];
- char stringpool_str233[sizeof("ekaterinburg")];
- char stringpool_str265[sizeof("us mountain")];
- char stringpool_str269[sizeof("jerusalem")];
- char stringpool_str272[sizeof("yakutsk")];
- char stringpool_str279[sizeof("pacific sa")];
- char stringpool_str282[sizeof("tonga")];
- char stringpool_str314[sizeof("afghanistan")];
- char stringpool_str319[sizeof("idlw")];
- char stringpool_str322[sizeof("pacific")];
- char stringpool_str327[sizeof("taipei")];
- char stringpool_str328[sizeof("egypt")];
- char stringpool_str392[sizeof("tokyo")];
- char stringpool_str438[sizeof("fiji")];
- };
-static const struct stringpool_t stringpool_contents =
- {
- "r",
- "s",
- "d",
- "cst",
- "cdt",
- "sst",
- "cet",
- "msd",
- "cest",
- "cat",
- "mst",
- "mdt",
- "sast",
- "met",
- "mest",
- "wet",
- "dateline",
- "west",
- "wat",
- "wast",
- "wadt",
- "e",
- "central europe",
- "central asia",
- "west asia",
- "cen. australia",
- "central america",
- "est",
- "edt",
- "central european",
- "eet",
- "se asia",
- "eest",
- "eat",
- "z",
- "east",
- "eadt",
- "sa eastern",
- "w. europe",
- "c",
- "yst",
- "ydt",
- "kst",
- "clt",
- "eastern",
- "clst",
- "bt",
- "w. australia",
- "bst",
- "cct",
- "brt",
- "brst",
- "a",
- "e. europe",
- "at",
- "central",
- "ast",
- "adt",
- "art",
- "e. africa",
- "e. south america",
- "jst",
- "e. australia",
- "t",
- "nt",
- "n",
- "nst",
- "ndt",
- "canada central",
- "central pacific",
- "west pacific",
- "hst",
- "hdt",
- "malay peninsula",
- "zp6",
- "russian",
- "hast",
- "hadt",
- "gst",
- "zp5",
- "ist",
- "swt",
- "w",
- "zp4",
- "mez",
- "cape verde",
- "mesz",
- "greenland",
- "x",
- "mewt",
- "w. central africa",
- "k",
- "b",
- "m",
- "sri lanka",
- "fst",
- "iran",
- "sgt",
- "ut",
- "q",
- "nzt",
- "nzst",
- "nzdt",
- "myanmar",
- "alaskan",
- "pst",
- "pdt",
- "sa western",
- "korea",
- "y",
- "f",
- "akst",
- "akdt",
- "caucasus",
- "msk",
- "idle",
- "arabian",
- "o",
- "l",
- "mid-atlantic",
- "us eastern",
- "ahst",
- "h",
- "fle",
- "i",
- "north asia",
- "n. central asia",
- "north asia east",
- "sa pacific",
- "south africa",
- "aus eastern",
- "atlantic",
- "mexico",
- "mountain",
- "china",
- "azores",
- "india",
- "u",
- "arabic",
- "greenwich",
- "new zealand",
- "hawaiian",
- "g",
- "romance",
- "arab",
- "samoa",
- "v",
- "p",
- "gmt",
- "tasmania",
- "fwt",
- "newfoundland",
- "nepal",
- "aus central",
- "gtb",
- "vladivostok",
- "utc",
- "ekaterinburg",
- "us mountain",
- "jerusalem",
- "yakutsk",
- "pacific sa",
- "tonga",
- "afghanistan",
- "idlw",
- "pacific",
- "taipei",
- "egypt",
- "tokyo",
- "fiji"
- };
-#define stringpool ((const char *) &stringpool_contents)
-const struct zone *
-zonetab (register const char *str, register size_t len)
-{
- enum
- {
- TOTAL_KEYWORDS = 170,
- MIN_WORD_LENGTH = 1,
- MAX_WORD_LENGTH = 17,
- MIN_HASH_VALUE = 5,
- MAX_HASH_VALUE = 438
- };
-
- static const struct zone wordlist[] =
- {
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 37 "zonetab.list"
- {gperf_offsetof(stringpool, 5), -5*3600},
-#line 38 "zonetab.list"
- {gperf_offsetof(stringpool, 6), -6*3600},
-#line 24 "zonetab.list"
- {gperf_offsetof(stringpool, 7), 4*3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 15 "zonetab.list"
- {gperf_offsetof(stringpool, 14), -6*3600},
-#line 16 "zonetab.list"
- {gperf_offsetof(stringpool, 15), -5*3600},
-#line 85 "zonetab.list"
- {gperf_offsetof(stringpool, 16), 2*3600},
-#line 71 "zonetab.list"
- {gperf_offsetof(stringpool, 17), 1*3600},
-#line 90 "zonetab.list"
- {gperf_offsetof(stringpool, 18), 4*3600},
-#line 79 "zonetab.list"
- {gperf_offsetof(stringpool, 19), 2*3600},
-#line 65 "zonetab.list"
- {gperf_offsetof(stringpool, 20),-10*3600},
- {-1},
-#line 17 "zonetab.list"
- {gperf_offsetof(stringpool, 22), -7*3600},
-#line 18 "zonetab.list"
- {gperf_offsetof(stringpool, 23), -6*3600},
-#line 84 "zonetab.list"
- {gperf_offsetof(stringpool, 24), 2*3600},
-#line 73 "zonetab.list"
- {gperf_offsetof(stringpool, 25), 1*3600},
- {-1},
-#line 82 "zonetab.list"
- {gperf_offsetof(stringpool, 27), 2*3600},
- {-1}, {-1},
-#line 47 "zonetab.list"
- {gperf_offsetof(stringpool, 30), 0*3600},
-#line 128 "zonetab.list"
- {gperf_offsetof(stringpool, 31), -43200},
-#line 78 "zonetab.list"
- {gperf_offsetof(stringpool, 32), 1*3600},
-#line 77 "zonetab.list"
- {gperf_offsetof(stringpool, 33), 1*3600},
- {-1},
-#line 95 "zonetab.list"
- {gperf_offsetof(stringpool, 35), 7*3600},
-#line 98 "zonetab.list"
- {gperf_offsetof(stringpool, 36), 8*3600},
-#line 25 "zonetab.list"
- {gperf_offsetof(stringpool, 37), 5*3600},
-#line 123 "zonetab.list"
- {gperf_offsetof(stringpool, 38), 3600},
-#line 122 "zonetab.list"
- {gperf_offsetof(stringpool, 39), 21600},
-#line 178 "zonetab.list"
- {gperf_offsetof(stringpool, 40), 18000},
-#line 120 "zonetab.list"
- {gperf_offsetof(stringpool, 41), 34200},
-#line 121 "zonetab.list"
- {gperf_offsetof(stringpool, 42), -21600},
- {-1},
-#line 13 "zonetab.list"
- {gperf_offsetof(stringpool, 44), -5*3600},
-#line 14 "zonetab.list"
- {gperf_offsetof(stringpool, 45), -4*3600},
-#line 124 "zonetab.list"
- {gperf_offsetof(stringpool, 46), 3600},
-#line 80 "zonetab.list"
- {gperf_offsetof(stringpool, 47), 2*3600},
-#line 164 "zonetab.list"
- {gperf_offsetof(stringpool, 48), 25200},
-#line 88 "zonetab.list"
- {gperf_offsetof(stringpool, 49), 3*3600},
-#line 87 "zonetab.list"
- {gperf_offsetof(stringpool, 50), 3*3600},
-#line 45 "zonetab.list"
- {gperf_offsetof(stringpool, 51), 0*3600},
-#line 101 "zonetab.list"
- {gperf_offsetof(stringpool, 52),10*3600},
-#line 103 "zonetab.list"
- {gperf_offsetof(stringpool, 53),11*3600},
-#line 160 "zonetab.list"
- {gperf_offsetof(stringpool, 54), -10800},
-#line 177 "zonetab.list"
- {gperf_offsetof(stringpool, 55), 3600},
-#line 23 "zonetab.list"
- {gperf_offsetof(stringpool, 56), 3*3600},
-#line 63 "zonetab.list"
- {gperf_offsetof(stringpool, 57), -9*3600},
-#line 59 "zonetab.list"
- {gperf_offsetof(stringpool, 58), -8*3600},
-#line 100 "zonetab.list"
- {gperf_offsetof(stringpool, 59), 9*3600},
-#line 57 "zonetab.list"
- {gperf_offsetof(stringpool, 60), -4*3600},
-#line 133 "zonetab.list"
- {gperf_offsetof(stringpool, 61), -18000},
-#line 54 "zonetab.list"
- {gperf_offsetof(stringpool, 62),-3*3600},
-#line 86 "zonetab.list"
- {gperf_offsetof(stringpool, 63), 3*3600},
-#line 175 "zonetab.list"
- {gperf_offsetof(stringpool, 64), 28800},
-#line 70 "zonetab.list"
- {gperf_offsetof(stringpool, 65), 1*3600},
-#line 96 "zonetab.list"
- {gperf_offsetof(stringpool, 66), 8*3600},
-#line 53 "zonetab.list"
- {gperf_offsetof(stringpool, 67), -3*3600},
- {-1},
-#line 49 "zonetab.list"
- {gperf_offsetof(stringpool, 69),-2*3600},
- {-1},
-#line 21 "zonetab.list"
- {gperf_offsetof(stringpool, 71), 1*3600},
-#line 131 "zonetab.list"
- {gperf_offsetof(stringpool, 72), 7200},
-#line 48 "zonetab.list"
- {gperf_offsetof(stringpool, 73), -2*3600},
-#line 126 "zonetab.list"
- {gperf_offsetof(stringpool, 74), -21600},
-#line 56 "zonetab.list"
- {gperf_offsetof(stringpool, 75), -4*3600},
-#line 52 "zonetab.list"
- {gperf_offsetof(stringpool, 76), -3*3600},
-#line 51 "zonetab.list"
- {gperf_offsetof(stringpool, 77), -3*3600},
-#line 129 "zonetab.list"
- {gperf_offsetof(stringpool, 78), 10800},
-#line 132 "zonetab.list"
- {gperf_offsetof(stringpool, 79), -10800},
-#line 99 "zonetab.list"
- {gperf_offsetof(stringpool, 80), 9*3600},
-#line 130 "zonetab.list"
- {gperf_offsetof(stringpool, 81), 36000},
-#line 39 "zonetab.list"
- {gperf_offsetof(stringpool, 82), -7*3600},
-#line 68 "zonetab.list"
- {gperf_offsetof(stringpool, 83), -11*3600},
-#line 33 "zonetab.list"
- {gperf_offsetof(stringpool, 84), -1*3600},
-#line 55 "zonetab.list"
- {gperf_offsetof(stringpool, 85), -(3*3600+1800)},
-#line 50 "zonetab.list"
- {gperf_offsetof(stringpool, 86), -(2*3600+1800)},
-#line 117 "zonetab.list"
- {gperf_offsetof(stringpool, 87), -21600},
-#line 125 "zonetab.list"
- {gperf_offsetof(stringpool, 88), 39600},
-#line 179 "zonetab.list"
- {gperf_offsetof(stringpool, 89), 36000},
-#line 67 "zonetab.list"
- {gperf_offsetof(stringpool, 90),-10*3600},
-#line 62 "zonetab.list"
- {gperf_offsetof(stringpool, 91), -9*3600},
- {-1},
-#line 165 "zonetab.list"
- {gperf_offsetof(stringpool, 93), 28800},
- {-1},
-#line 94 "zonetab.list"
- {gperf_offsetof(stringpool, 95), 6*3600},
- {-1},
-#line 159 "zonetab.list"
- {gperf_offsetof(stringpool, 97), 10800},
-#line 66 "zonetab.list"
- {gperf_offsetof(stringpool, 98),-10*3600},
-#line 61 "zonetab.list"
- {gperf_offsetof(stringpool, 99),-9*3600},
-#line 102 "zonetab.list"
- {gperf_offsetof(stringpool, 100), 10*3600},
-#line 92 "zonetab.list"
- {gperf_offsetof(stringpool, 101), 5*3600},
-#line 93 "zonetab.list"
- {gperf_offsetof(stringpool, 102), (5*3600+1800)},
-#line 76 "zonetab.list"
- {gperf_offsetof(stringpool, 103), 1*3600},
-#line 42 "zonetab.list"
- {gperf_offsetof(stringpool, 104), -10*3600},
-#line 91 "zonetab.list"
- {gperf_offsetof(stringpool, 105), 4*3600},
- {-1},
-#line 75 "zonetab.list"
- {gperf_offsetof(stringpool, 107), 1*3600},
-#line 118 "zonetab.list"
- {gperf_offsetof(stringpool, 108), -3600},
-#line 83 "zonetab.list"
- {gperf_offsetof(stringpool, 109), 2*3600},
-#line 138 "zonetab.list"
- {gperf_offsetof(stringpool, 110), -10800},
- {-1},
-#line 43 "zonetab.list"
- {gperf_offsetof(stringpool, 112), -11*3600},
- {-1},
-#line 74 "zonetab.list"
- {gperf_offsetof(stringpool, 114), 1*3600},
-#line 176 "zonetab.list"
- {gperf_offsetof(stringpool, 115), 3600},
-#line 30 "zonetab.list"
- {gperf_offsetof(stringpool, 116), 10*3600},
-#line 22 "zonetab.list"
- {gperf_offsetof(stringpool, 117), 2*3600},
- {-1},
-#line 32 "zonetab.list"
- {gperf_offsetof(stringpool, 119), 12*3600},
-#line 167 "zonetab.list"
- {gperf_offsetof(stringpool, 120), 21600},
- {-1},
-#line 81 "zonetab.list"
- {gperf_offsetof(stringpool, 122), 2*3600},
- {-1},
-#line 143 "zonetab.list"
- {gperf_offsetof(stringpool, 124), 12600},
-#line 97 "zonetab.list"
- {gperf_offsetof(stringpool, 125), 8*3600},
-#line 11 "zonetab.list"
- {gperf_offsetof(stringpool, 126), 0*3600},
- {-1},
-#line 36 "zonetab.list"
- {gperf_offsetof(stringpool, 128), -4*3600},
-#line 106 "zonetab.list"
- {gperf_offsetof(stringpool, 129), 12*3600},
- {-1},
-#line 105 "zonetab.list"
- {gperf_offsetof(stringpool, 131),12*3600},
-#line 107 "zonetab.list"
- {gperf_offsetof(stringpool, 132),13*3600},
-#line 149 "zonetab.list"
- {gperf_offsetof(stringpool, 133), 23400},
- {-1},
-#line 109 "zonetab.list"
- {gperf_offsetof(stringpool, 135), -32400},
-#line 19 "zonetab.list"
- {gperf_offsetof(stringpool, 136), -8*3600},
-#line 20 "zonetab.list"
- {gperf_offsetof(stringpool, 137), -7*3600},
-#line 162 "zonetab.list"
- {gperf_offsetof(stringpool, 138), -14400},
-#line 145 "zonetab.list"
- {gperf_offsetof(stringpool, 139), 32400},
- {-1}, {-1},
-#line 44 "zonetab.list"
- {gperf_offsetof(stringpool, 142), -12*3600},
-#line 26 "zonetab.list"
- {gperf_offsetof(stringpool, 143), 6*3600},
-#line 60 "zonetab.list"
- {gperf_offsetof(stringpool, 144),-9*3600},
-#line 58 "zonetab.list"
- {gperf_offsetof(stringpool, 145),-8*3600},
- {-1}, {-1},
-#line 119 "zonetab.list"
- {gperf_offsetof(stringpool, 148), 14400},
- {-1},
-#line 89 "zonetab.list"
- {gperf_offsetof(stringpool, 150), 3*3600},
-#line 104 "zonetab.list"
- {gperf_offsetof(stringpool, 151),12*3600},
- {-1},
-#line 111 "zonetab.list"
- {gperf_offsetof(stringpool, 153), 14400},
- {-1},
-#line 34 "zonetab.list"
- {gperf_offsetof(stringpool, 155), -2*3600},
-#line 31 "zonetab.list"
- {gperf_offsetof(stringpool, 156), 11*3600},
-#line 147 "zonetab.list"
- {gperf_offsetof(stringpool, 157), -7200},
- {-1}, {-1},
-#line 172 "zonetab.list"
- {gperf_offsetof(stringpool, 160), -18000},
- {-1}, {-1}, {-1},
-#line 64 "zonetab.list"
- {gperf_offsetof(stringpool, 164),-10*3600},
- {-1}, {-1},
-#line 28 "zonetab.list"
- {gperf_offsetof(stringpool, 167), 8*3600},
-#line 137 "zonetab.list"
- {gperf_offsetof(stringpool, 168), 7200},
-#line 29 "zonetab.list"
- {gperf_offsetof(stringpool, 169), 9*3600},
-#line 155 "zonetab.list"
- {gperf_offsetof(stringpool, 170), 25200},
-#line 150 "zonetab.list"
- {gperf_offsetof(stringpool, 171), 21600},
-#line 154 "zonetab.list"
- {gperf_offsetof(stringpool, 172), 28800},
- {-1},
-#line 161 "zonetab.list"
- {gperf_offsetof(stringpool, 174), -18000},
- {-1}, {-1},
-#line 166 "zonetab.list"
- {gperf_offsetof(stringpool, 177), 7200},
- {-1}, {-1}, {-1},
-#line 115 "zonetab.list"
- {gperf_offsetof(stringpool, 181), 36000},
-#line 113 "zonetab.list"
- {gperf_offsetof(stringpool, 182), -14400},
- {-1}, {-1}, {-1},
-#line 146 "zonetab.list"
- {gperf_offsetof(stringpool, 186), -21600},
- {-1},
-#line 148 "zonetab.list"
- {gperf_offsetof(stringpool, 188), -25200},
- {-1},
-#line 127 "zonetab.list"
- {gperf_offsetof(stringpool, 190), 28800},
-#line 116 "zonetab.list"
- {gperf_offsetof(stringpool, 191), -3600},
-#line 142 "zonetab.list"
- {gperf_offsetof(stringpool, 192), 19800},
- {-1},
-#line 40 "zonetab.list"
- {gperf_offsetof(stringpool, 194), -8*3600},
-#line 112 "zonetab.list"
- {gperf_offsetof(stringpool, 195), 10800},
-#line 139 "zonetab.list"
- {gperf_offsetof(stringpool, 196), 0},
-#line 152 "zonetab.list"
- {gperf_offsetof(stringpool, 197), 43200},
-#line 141 "zonetab.list"
- {gperf_offsetof(stringpool, 198), -36000},
-#line 27 "zonetab.list"
- {gperf_offsetof(stringpool, 199), 7*3600},
-#line 158 "zonetab.list"
- {gperf_offsetof(stringpool, 200), 3600},
- {-1}, {-1},
-#line 110 "zonetab.list"
- {gperf_offsetof(stringpool, 203), 10800},
-#line 163 "zonetab.list"
- {gperf_offsetof(stringpool, 204), -39600},
-#line 41 "zonetab.list"
- {gperf_offsetof(stringpool, 205), -9*3600},
-#line 35 "zonetab.list"
- {gperf_offsetof(stringpool, 206), -3*3600},
-#line 12 "zonetab.list"
- {gperf_offsetof(stringpool, 207), 0*3600},
-#line 169 "zonetab.list"
- {gperf_offsetof(stringpool, 208), 36000},
-#line 72 "zonetab.list"
- {gperf_offsetof(stringpool, 209), 1*3600},
- {-1},
-#line 153 "zonetab.list"
- {gperf_offsetof(stringpool, 211), -12600},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 151 "zonetab.list"
- {gperf_offsetof(stringpool, 217), 20700},
-#line 114 "zonetab.list"
- {gperf_offsetof(stringpool, 218), 34200},
- {-1}, {-1},
-#line 140 "zonetab.list"
- {gperf_offsetof(stringpool, 221), 7200},
- {-1},
-#line 174 "zonetab.list"
- {gperf_offsetof(stringpool, 223), 36000},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 46 "zonetab.list"
- {gperf_offsetof(stringpool, 229), 0*3600},
- {-1}, {-1}, {-1},
-#line 135 "zonetab.list"
- {gperf_offsetof(stringpool, 233), 18000},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
-#line 173 "zonetab.list"
- {gperf_offsetof(stringpool, 265), -25200},
- {-1}, {-1}, {-1},
-#line 144 "zonetab.list"
- {gperf_offsetof(stringpool, 269), 7200},
- {-1}, {-1},
-#line 180 "zonetab.list"
- {gperf_offsetof(stringpool, 272), 32400},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 156 "zonetab.list"
- {gperf_offsetof(stringpool, 279), -14400},
- {-1}, {-1},
-#line 171 "zonetab.list"
- {gperf_offsetof(stringpool, 282), 46800},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
-#line 108 "zonetab.list"
- {gperf_offsetof(stringpool, 314), 16200},
- {-1}, {-1}, {-1}, {-1},
-#line 69 "zonetab.list"
- {gperf_offsetof(stringpool, 319),-12*3600},
- {-1}, {-1},
-#line 157 "zonetab.list"
- {gperf_offsetof(stringpool, 322), -28800},
- {-1}, {-1}, {-1}, {-1},
-#line 168 "zonetab.list"
- {gperf_offsetof(stringpool, 327), 28800},
-#line 134 "zonetab.list"
- {gperf_offsetof(stringpool, 328), 7200},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 170 "zonetab.list"
- {gperf_offsetof(stringpool, 392), 32400},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 136 "zonetab.list"
- {gperf_offsetof(stringpool, 438), 43200}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register unsigned int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE)
- {
- register int o = wordlist[key].name;
- if (o >= 0)
- {
- register const char *s = o + stringpool;
-
- if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
- return &wordlist[key];
- }
- }
- }
- return 0;
-}
-#line 181 "zonetab.list"
-
diff --git a/ext/date/zonetab.list b/ext/date/zonetab.list
deleted file mode 100644
index 3a4d121d2e..0000000000
--- a/ext/date/zonetab.list
+++ /dev/null
@@ -1,181 +0,0 @@
-%{
-struct zone {
- int name;
- int offset;
-};
-static const struct zone *zonetab();
-%}
-
-struct zone;
-%%
-ut, 0*3600
-gmt, 0*3600
-est, -5*3600
-edt, -4*3600
-cst, -6*3600
-cdt, -5*3600
-mst, -7*3600
-mdt, -6*3600
-pst, -8*3600
-pdt, -7*3600
-a, 1*3600
-b, 2*3600
-c, 3*3600
-d, 4*3600
-e, 5*3600
-f, 6*3600
-g, 7*3600
-h, 8*3600
-i, 9*3600
-k, 10*3600
-l, 11*3600
-m, 12*3600
-n, -1*3600
-o, -2*3600
-p, -3*3600
-q, -4*3600
-r, -5*3600
-s, -6*3600
-t, -7*3600
-u, -8*3600
-v, -9*3600
-w, -10*3600
-x, -11*3600
-y, -12*3600
-z, 0*3600
-utc, 0*3600
-wet, 0*3600
-at, -2*3600
-brst,-2*3600
-ndt, -(2*3600+1800)
-art, -3*3600
-adt, -3*3600
-brt, -3*3600
-clst,-3*3600
-nst, -(3*3600+1800)
-ast, -4*3600
-clt, -4*3600
-akdt,-8*3600
-ydt, -8*3600
-akst,-9*3600
-hadt,-9*3600
-hdt, -9*3600
-yst, -9*3600
-ahst,-10*3600
-cat,-10*3600
-hast,-10*3600
-hst,-10*3600
-nt, -11*3600
-idlw,-12*3600
-bst, 1*3600
-cet, 1*3600
-fwt, 1*3600
-met, 1*3600
-mewt, 1*3600
-mez, 1*3600
-swt, 1*3600
-wat, 1*3600
-west, 1*3600
-cest, 2*3600
-eet, 2*3600
-fst, 2*3600
-mest, 2*3600
-mesz, 2*3600
-sast, 2*3600
-sst, 2*3600
-bt, 3*3600
-eat, 3*3600
-eest, 3*3600
-msk, 3*3600
-msd, 4*3600
-zp4, 4*3600
-zp5, 5*3600
-ist, (5*3600+1800)
-zp6, 6*3600
-wast, 7*3600
-cct, 8*3600
-sgt, 8*3600
-wadt, 8*3600
-jst, 9*3600
-kst, 9*3600
-east,10*3600
-gst, 10*3600
-eadt,11*3600
-idle,12*3600
-nzst,12*3600
-nzt, 12*3600
-nzdt,13*3600
-afghanistan, 16200
-alaskan, -32400
-arab, 10800
-arabian, 14400
-arabic, 10800
-atlantic, -14400
-aus central, 34200
-aus eastern, 36000
-azores, -3600
-canada central, -21600
-cape verde, -3600
-caucasus, 14400
-cen. australia, 34200
-central america, -21600
-central asia, 21600
-central europe, 3600
-central european, 3600
-central pacific, 39600
-central, -21600
-china, 28800
-dateline, -43200
-e. africa, 10800
-e. australia, 36000
-e. europe, 7200
-e. south america, -10800
-eastern, -18000
-egypt, 7200
-ekaterinburg, 18000
-fiji, 43200
-fle, 7200
-greenland, -10800
-greenwich, 0
-gtb, 7200
-hawaiian, -36000
-india, 19800
-iran, 12600
-jerusalem, 7200
-korea, 32400
-mexico, -21600
-mid-atlantic, -7200
-mountain, -25200
-myanmar, 23400
-n. central asia, 21600
-nepal, 20700
-new zealand, 43200
-newfoundland, -12600
-north asia east, 28800
-north asia, 25200
-pacific sa, -14400
-pacific, -28800
-romance, 3600
-russian, 10800
-sa eastern, -10800
-sa pacific, -18000
-sa western, -14400
-samoa, -39600
-se asia, 25200
-malay peninsula, 28800
-south africa, 7200
-sri lanka, 21600
-taipei, 28800
-tasmania, 36000
-tokyo, 32400
-tonga, 46800
-us eastern, -18000
-us mountain, -25200
-vladivostok, 36000
-w. australia, 28800
-w. central africa, 3600
-w. europe, 3600
-west asia, 18000
-west pacific, 36000
-yakutsk, 32400
-%%
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 4ac6898848..527d6518d0 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -24,7 +24,7 @@
#define DSIZE_TYPE TYPEOF_DATUM_DSIZE
#if SIZEOF_DATUM_DSIZE > SIZEOF_INT
# define RSTRING_DSIZE(s) RSTRING_LEN(s)
-# define TOO_LONG(n) ((void)(n),0)
+# define TOO_LONG(n) 0
#else
# define RSTRING_DSIZE(s) RSTRING_LENINT(s)
# define TOO_LONG(n) ((long)(+(DSIZE_TYPE)(n)) != (n))
@@ -46,7 +46,8 @@ closed_dbm(void)
}
#define GetDBM(obj, dbmp) do {\
- TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
+ Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
@@ -56,31 +57,14 @@ closed_dbm(void)
} while (0)
static void
-free_dbm(void *ptr)
+free_dbm(struct dbmdata *dbmp)
{
- struct dbmdata *dbmp = ptr;
- if (dbmp->di_dbm)
- dbm_close(dbmp->di_dbm);
- xfree(dbmp);
-}
-
-static size_t
-memsize_dbm(const void *ptr)
-{
- const struct dbmdata *dbmp = ptr;
- size_t size = sizeof(*dbmp);
- if (dbmp->di_dbm)
- size += DBM_SIZEOF_DBM;
- return size;
+ if (dbmp) {
+ if (dbmp->di_dbm) dbm_close(dbmp->di_dbm);
+ xfree(dbmp);
+ }
}
-static const rb_data_type_t dbm_type = {
- "dbm",
- {0, free_dbm, memsize_dbm,},
- 0, 0,
- RUBY_TYPED_FREE_IMMEDIATELY,
-};
-
/*
* call-seq:
* dbm.close
@@ -110,7 +94,9 @@ fdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
+ Data_Get_Struct(obj, struct dbmdata, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -120,9 +106,7 @@ fdbm_closed(VALUE obj)
static VALUE
fdbm_alloc(VALUE klass)
{
- struct dbmdata *dbmp;
-
- return TypedData_Make_Struct(klass, struct dbmdata, &dbm_type, dbmp);
+ return Data_Wrap_Struct(klass, 0, free_dbm, 0);
}
/*
@@ -141,12 +125,12 @@ fdbm_alloc(VALUE klass)
static VALUE
fdbm_initialize(int argc, VALUE *argv, VALUE obj)
{
- VALUE file, vmode, vflags;
+ volatile VALUE file;
+ VALUE vmode, vflags;
DBM *dbm;
struct dbmdata *dbmp;
int mode, flags = 0;
- TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
if (rb_scan_args(argc, argv, "12", &file, &vmode, &vflags) == 1) {
mode = 0666; /* default value */
}
@@ -188,24 +172,24 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
}
if (dbm) {
- /*
- * History of dbm_pagfno() and dbm_dirfno() in ndbm and its compatibles.
- * (dbm_pagfno() and dbm_dirfno() is not standardized.)
- *
- * 1986: 4.3BSD provides ndbm.
- * It provides dbm_pagfno() and dbm_dirfno() as macros.
- * 1991: gdbm-1.5 provides them as functions.
- * They returns a same descriptor.
- * (Earlier releases may have the functions too.)
- * 1991: Net/2 provides Berkeley DB.
- * It doesn't provide dbm_pagfno() and dbm_dirfno().
- * 1992: 4.4BSD Alpha provides Berkeley DB with dbm_dirfno() as a function.
- * dbm_pagfno() is a macro as DBM_PAGFNO_NOT_AVAILABLE.
- * 1997: Berkeley DB 2.0 is released by Sleepycat Software, Inc.
- * It defines dbm_pagfno() and dbm_dirfno() as macros.
- * 2011: gdbm-1.9 creates a separate dir file.
- * dbm_pagfno() and dbm_dirfno() returns different descriptors.
- */
+ /*
+ * History of dbm_pagfno() and dbm_dirfno() in ndbm and its compatibles.
+ * (dbm_pagfno() and dbm_dirfno() is not standardized.)
+ *
+ * 1986: 4.3BSD provides ndbm.
+ * It provides dbm_pagfno() and dbm_dirfno() as macros.
+ * 1991: gdbm-1.5 provides them as functions.
+ * They returns a same descriptor.
+ * (Earlier releases may have the functions too.)
+ * 1991: Net/2 provides Berkeley DB.
+ * It doesn't provide dbm_pagfno() and dbm_dirfno().
+ * 1992: 4.4BSD Alpha provides Berkeley DB with dbm_dirfno() as a function.
+ * dbm_pagfno() is a macro as DBM_PAGFNO_NOT_AVAILABLE.
+ * 1997: Berkeley DB 2.0 is released by Sleepycat Software, Inc.
+ * It defines dbm_pagfno() and dbm_dirfno() as macros.
+ * 2011: gdbm-1.9 creates a separate dir file.
+ * dbm_pagfno() and dbm_dirfno() returns different descriptors.
+ */
#if defined(HAVE_DBM_PAGFNO)
rb_fd_fix_cloexec(dbm_pagfno(dbm));
#endif
@@ -214,8 +198,8 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
#endif
#if defined(RUBYDBM_DB_HEADER) && defined(HAVE_TYPE_DBC)
- /* Disable Berkeley DB error messages such as:
- * DB->put: attempt to modify a read-only database */
+ /* Disable Berkeley DB error messages such as:
+ * DB->put: attempt to modify a read-only database */
((DBC*)dbm)->dbp->set_errfile(((DBC*)dbm)->dbp, NULL);
#endif
}
@@ -225,8 +209,8 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
rb_sys_fail_str(file);
}
- if (dbmp->di_dbm)
- dbm_close(dbmp->di_dbm);
+ dbmp = ALLOC(struct dbmdata);
+ DATA_PTR(obj) = dbmp;
dbmp->di_dbm = dbm;
dbmp->di_size = -1;
@@ -244,7 +228,7 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = fdbm_alloc(klass);
+ VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
if (NIL_P(fdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -336,6 +320,8 @@ fdbm_key(VALUE obj, VALUE valstr)
ExportStringValue(valstr);
len = RSTRING_LEN(valstr);
if (TOO_LONG(len)) return Qnil;
+ val.dptr = RSTRING_PTR(valstr);
+ val.dsize = (DSIZE_TYPE)len;
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
@@ -502,8 +488,8 @@ fdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- int status = 0;
- long i, n;
+ int i, status = 0;
+ long n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -522,7 +508,7 @@ fdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_AREF(ary, i);
+ keystr = RARRAY_PTR(ary)[i];
key.dptr = RSTRING_PTR(keystr);
key.dsize = (DSIZE_TYPE)RSTRING_LEN(keystr);
if (dbm_delete(dbm, key)) {
@@ -593,13 +579,11 @@ 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]");
}
- ptr = RARRAY_CONST_PTR(pair);
- fdbm_store(dbm, ptr[0], ptr[1]);
+ fdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
return Qnil;
}
@@ -1030,7 +1014,7 @@ fdbm_reject(VALUE obj)
* == Example
*
* require 'dbm'
- * db = DBM.open('rfcs', 0666, DBM::WRCREAT)
+ * db = DBM.open('rfcs', 666, 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/dbm.gemspec b/ext/dbm/dbm.gemspec
deleted file mode 100644
index 9f3333a2b1..0000000000
--- a/ext/dbm/dbm.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "dbm"
- s.version = '1.0.0'
- s.date = '2017-02-08'
- s.summary = "Provides a wrapper for the UNIX-style Database Manager Library"
- s.description = "Provides a wrapper for the UNIX-style Database Manager Library"
-
- s.require_path = %w{lib}
- s.files = %w{ext/dbm/extconf.rb ext/dbm/dbm.c}
- s.extensions = %w{ext/dbm/extconf.rb}
- s.required_ruby_version = ">= 2.3.0"
-
- s.authors = ["Yukihiro Matsumoto"]
- s.email = ["matz@ruby-lang.org"]
- s.homepage = "https://github.com/ruby/dbm"
- s.license = "BSD-2-Clause"
-
- s.add_development_dependency "rake-compiler"
- s.add_development_dependency "test-unit"
-end
diff --git a/ext/dbm/depend b/ext/dbm/depend
deleted file mode 100644
index b0de2ae2ee..0000000000
--- a/ext/dbm/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-dbm.o: $(RUBY_EXTCONF_H)
-dbm.o: $(arch_hdrdir)/ruby/config.h
-dbm.o: $(hdrdir)/ruby/backward.h
-dbm.o: $(hdrdir)/ruby/defines.h
-dbm.o: $(hdrdir)/ruby/intern.h
-dbm.o: $(hdrdir)/ruby/missing.h
-dbm.o: $(hdrdir)/ruby/ruby.h
-dbm.o: $(hdrdir)/ruby/st.h
-dbm.o: $(hdrdir)/ruby/subst.h
-dbm.o: $(top_srcdir)/include/ruby.h
-dbm.o: dbm.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 514aa3f8b0..68070c9970 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# configure option:
# --with-dbm-type=COMMA-SEPARATED-NDBM-TYPES
#
@@ -268,23 +267,6 @@ 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 8f436908d3..4bccd221b8 100644
--- a/ext/digest/bubblebabble/bubblebabble.c
+++ b/ext/digest/bubblebabble/bubblebabble.c
@@ -11,8 +11,8 @@
************************************************/
-#include <ruby/ruby.h>
-#include "../digest.h"
+#include "ruby.h"
+#include "digest.h"
static ID id_digest;
@@ -101,7 +101,7 @@ rb_digest_s_bubblebabble(VALUE klass, VALUE str)
static VALUE
rb_digest_class_s_bubblebabble(int argc, VALUE *argv, VALUE klass)
{
- return bubblebabble_str_new(rb_funcallv(klass, id_digest, argc, argv));
+ return bubblebabble_str_new(rb_funcall2(klass, id_digest, argc, argv));
}
/* Document-method: Digest::Instance#bubblebabble
diff --git a/ext/digest/bubblebabble/depend b/ext/digest/bubblebabble/depend
index c0550f3180..d13a156ce1 100644
--- a/ext/digest/bubblebabble/depend
+++ b/ext/digest/bubblebabble/depend
@@ -1,14 +1 @@
-# AUTOGENERATED DEPENDENCIES START
-bubblebabble.o: $(RUBY_EXTCONF_H)
-bubblebabble.o: $(arch_hdrdir)/ruby/config.h
-bubblebabble.o: $(hdrdir)/ruby/backward.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
+bubblebabble.o: bubblebabble.c $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
diff --git a/ext/digest/bubblebabble/extconf.rb b/ext/digest/bubblebabble/extconf.rb
index 21feed57fb..53cb83934a 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 8e3b4691e8..2fbc6d9adf 100644
--- a/ext/digest/depend
+++ b/ext/digest/depend
@@ -1,14 +1 @@
-# AUTOGENERATED DEPENDENCIES START
-digest.o: $(RUBY_EXTCONF_H)
-digest.o: $(arch_hdrdir)/ruby/config.h
-digest.o: $(hdrdir)/ruby/backward.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
+digest.o: digest.c digest.h $(HDRS) $(ruby_headers)
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index 9838ed33de..2231452c42 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -77,8 +77,8 @@ RUBY_EXTERN void Init_digest_base(void);
*
* Different digest algorithms (or hash functions) are available:
*
- * MD5::
- * See RFC 1321 The MD5 Message-Digest Algorithm
+ * HMAC::
+ * See FIPS PUB 198 The Keyed-Hash Message Authentication Code (HMAC).
* RIPEMD-160::
* As Digest::RMD160.
* See http://homes.esat.kuleuven.be/~bosselae/ripemd160.html.
@@ -124,8 +124,6 @@ hexencode_str_new(VALUE str_digest)
p[i + i + 1] = hex[byte & 0x0f];
}
- RB_GC_GUARD(str_digest);
-
return str;
}
@@ -486,7 +484,7 @@ rb_digest_class_s_digest(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_digest_class_s_hexdigest(int argc, VALUE *argv, VALUE klass)
{
- return hexencode_str_new(rb_funcallv(klass, id_digest, argc, argv));
+ return hexencode_str_new(rb_funcall2(klass, id_digest, argc, argv));
}
/* :nodoc: */
@@ -501,40 +499,6 @@ rb_digest_class_init(VALUE self)
*
* This abstract class provides a common interface to message digest
* implementation classes written in C.
- *
- * ==Write a Digest subclass in C
- * Digest::Base provides a common interface to message digest
- * classes written in C. These classes must provide a struct
- * of type rb_digest_metadata_t:
- * typedef int (*rb_digest_hash_init_func_t)(void *);
- * typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
- * typedef int (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
- *
- * typedef struct {
- * int api_version;
- * size_t digest_len;
- * size_t block_len;
- * size_t ctx_size;
- * rb_digest_hash_init_func_t init_func;
- * rb_digest_hash_update_func_t update_func;
- * rb_digest_hash_finish_func_t finish_func;
- * } rb_digest_metadata_t;
- *
- * This structure must be set as an instance variable named +metadata+
- * (without the +@+ in front of the name). By example:
- * static const rb_digest_metadata_t sha1 = {
- * RUBY_DIGEST_API_VERSION,
- * SHA1_DIGEST_LENGTH,
- * SHA1_BLOCK_LENGTH,
- * sizeof(SHA1_CTX),
- * (rb_digest_hash_init_func_t)SHA1_Init,
- * (rb_digest_hash_update_func_t)SHA1_Update,
- * (rb_digest_hash_finish_func_t)SHA1_Finish,
- * };
- *
- *
- * rb_ivar_set(cDigest_SHA1, rb_intern("metadata"),
- * Data_Wrap_Struct(0, 0, 0, (void *)&sha1));
*/
static rb_digest_metadata_t *
@@ -554,8 +518,6 @@ 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) {
@@ -573,13 +535,6 @@ 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)
{
@@ -601,10 +556,11 @@ rb_digest_base_alloc(VALUE klass)
algo = get_digest_base_metadata(klass);
- obj = rb_data_typed_object_zalloc(klass, algo->ctx_size, &digest_type);
- pctx = RTYPEDDATA_DATA(obj);
+ pctx = xmalloc(algo->ctx_size);
algo_init(algo, pctx);
+ obj = Data_Wrap_Struct(klass, 0, xfree, pctx);
+
return obj;
}
@@ -620,21 +576,15 @@ 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");
- TypedData_Get_Struct(obj, void, &digest_type, pctx1);
- TypedData_Get_Struct(copy, void, &digest_type, pctx2);
+ Data_Get_Struct(obj, void, pctx1);
+ Data_Get_Struct(copy, void, pctx2);
memcpy(pctx2, pctx1, algo->ctx_size);
return copy;
}
-/*
- * call-seq: digest_base.reset -> digest_base
- *
- * Reset the digest to its initial state and return +self+.
- */
+/* :nodoc: */
static VALUE
rb_digest_base_reset(VALUE self)
{
@@ -643,20 +593,14 @@ rb_digest_base_reset(VALUE self)
algo = get_digest_base_metadata(rb_obj_class(self));
- TypedData_Get_Struct(self, void, &digest_type, pctx);
+ Data_Get_Struct(self, void, pctx);
algo_init(algo, pctx);
return self;
}
-/*
- * call-seq:
- * digest_base.update(string) -> digest_base
- * digest_base << string -> digest_base
- *
- * Update the digest using given _string_ and return +self+.
- */
+/* :nodoc: */
static VALUE
rb_digest_base_update(VALUE self, VALUE str)
{
@@ -665,11 +609,10 @@ rb_digest_base_update(VALUE self, VALUE str)
algo = get_digest_base_metadata(rb_obj_class(self));
- TypedData_Get_Struct(self, void, &digest_type, pctx);
+ Data_Get_Struct(self, void, pctx);
StringValue(str);
algo->update_func(pctx, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
- RB_GC_GUARD(str);
return self;
}
@@ -684,7 +627,7 @@ rb_digest_base_finish(VALUE self)
algo = get_digest_base_metadata(rb_obj_class(self));
- TypedData_Get_Struct(self, void, &digest_type, pctx);
+ Data_Get_Struct(self, void, pctx);
str = rb_str_new(0, algo->digest_len);
algo->finish_func(pctx, (unsigned char *)RSTRING_PTR(str));
@@ -695,11 +638,7 @@ rb_digest_base_finish(VALUE self)
return str;
}
-/*
- * call-seq: digest_base.digest_length -> Integer
- *
- * Return the length of the hash value in bytes.
- */
+/* :nodoc: */
static VALUE
rb_digest_base_digest_length(VALUE self)
{
@@ -710,11 +649,7 @@ rb_digest_base_digest_length(VALUE self)
return INT2NUM(algo->digest_len);
}
-/*
- * call-seq: digest_base.block_length -> Integer
- *
- * Return the block length of the digest in bytes.
- */
+/* :nodoc: */
static VALUE
rb_digest_base_block_length(VALUE self)
{
diff --git a/ext/digest/digest.h b/ext/digest/digest.h
index 30359ad348..85848d5682 100644
--- a/ext/digest/digest.h
+++ b/ext/digest/digest.h
@@ -30,22 +30,3 @@ 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
deleted file mode 100644
index 915b61877f..0000000000
--- a/ext/digest/digest_conf.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: false
-
-# Copy from ext/openssl/extconf.rb
-def find_openssl_library
- if $mswin || $mingw
- # required for static OpenSSL libraries
- have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
- have_library("crypt32")
- end
-
- return false unless have_header("openssl/ssl.h")
-
- ret = have_library("crypto", "CRYPTO_malloc") &&
- have_library("ssl", "SSL_new")
- return ret if ret
-
- if $mswin
- # OpenSSL >= 1.1.0: libcrypto.lib and libssl.lib.
- if have_library("libcrypto", "CRYPTO_malloc") &&
- have_library("libssl", "SSL_new")
- return true
- end
-
- # OpenSSL <= 1.0.2: libeay32.lib and ssleay32.lib.
- if have_library("libeay32", "CRYPTO_malloc") &&
- have_library("ssleay32", "SSL_new")
- return true
- end
-
- # LibreSSL: libcrypto-##.lib and libssl-##.lib, where ## is the ABI version
- # number. We have to find the version number out by scanning libpath.
- libpath = $LIBPATH.dup
- libpath |= ENV["LIB"].split(File::PATH_SEPARATOR)
- libpath.map! { |d| d.tr(File::ALT_SEPARATOR, File::SEPARATOR) }
-
- ret = [
- ["crypto", "CRYPTO_malloc"],
- ["ssl", "SSL_new"]
- ].all? do |base, func|
- result = false
- libs = ["lib#{base}-[0-9][0-9]", "lib#{base}-[0-9][0-9][0-9]"]
- libs = Dir.glob(libs.map{|l| libpath.map{|d| File.join(d, l + ".*")}}.flatten).map{|path| File.basename(path, ".*")}.uniq
- libs.each do |lib|
- result = have_library(lib, func)
- break if result
- end
- result
- end
- return ret if ret
- end
- return false
-end
-
-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"
- $headers << "#{name}cc.h"
- return :commondigest
- end
- end
-
- dir_config("openssl")
- pkg_config("openssl")
- require File.expand_path('../../openssl/deprecation', __FILE__)
- if find_openssl_library
- 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"
- $headers << "#{name}ossl.h"
- return :ossl
- end
- end
- end
- $objs << "#{name}.#{$OBJEXT}"
- return
-end
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index a8c68850a2..a20ca8d68f 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -1,4 +1,3 @@
-# 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 ba0637af32..5f7ebc2237 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -1,10 +1,6 @@
-# frozen_string_literal: false
require 'digest.so'
module Digest
- # A mutex for Digest().
- REQUIRE_MUTEX = Thread::Mutex.new
-
def self.const_missing(name) # :nodoc:
case name
when :SHA256, :SHA384, :SHA512
@@ -80,30 +76,15 @@ end
# call-seq:
# Digest(name) -> digest_subclass
#
-# Returns a Digest subclass by +name+ in a thread-safe manner even
-# when on-demand loading is involved.
+# Returns a Digest subclass by +name+.
#
# require 'digest'
#
# Digest("MD5")
# # => Digest::MD5
#
-# Digest(:SHA256)
-# # => Digest::SHA256
-#
-# Digest(:Foo)
+# Digest("Foo")
# # => LoadError: library not found for class Digest::Foo -- digest/foo
def Digest(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
+ Digest.const_get(name)
end
diff --git a/ext/digest/md5/depend b/ext/digest/md5/depend
index 03c4cc8640..ca30d310e9 100644
--- a/ext/digest/md5/depend
+++ b/ext/digest/md5/depend
@@ -1,18 +1,3 @@
md5.o: md5.c md5.h $(srcdir)/../defs.h
-md5init.o: $(LOCAL_HDRS)
-
-# AUTOGENERATED DEPENDENCIES START
-md5init.o: $(RUBY_EXTCONF_H)
-md5init.o: $(arch_hdrdir)/ruby/config.h
-md5init.o: $(hdrdir)/ruby/backward.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
-# AUTOGENERATED DEPENDENCIES END
+md5init.o: md5init.c md5.h $(srcdir)/../digest.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
+md5ossl.o: md5ossl.h
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index dead9a228b..5a57fd3eea 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -1,16 +1,25 @@
# -*- 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}" ]
-digest_conf("md5")
+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
have_header("sys/cdefs.h")
diff --git a/ext/digest/md5/md5.c b/ext/digest/md5/md5.c
index 19fe54a693..4ff280bb0a 100644
--- a/ext/digest/md5/md5.c
+++ b/ext/digest/md5/md5.c
@@ -61,7 +61,7 @@
*/
#include <string.h>
int
-main(void)
+main()
{
static const char *const test[7*2] = {
"", "d41d8cd98f00b204e9800998ecf8427e",
@@ -102,7 +102,7 @@ main(void)
#ifdef COMPUTE_T_VALUES
#include <math.h>
int
-main(void)
+main()
{
int i;
for (i = 1; i <= 64; ++i) {
diff --git a/ext/digest/md5/md5.h b/ext/digest/md5/md5.h
index 1b3383c5ee..a0faa25e48 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
diff --git a/ext/digest/md5/md5cc.h b/ext/digest/md5/md5cc.h
deleted file mode 100644
index 35652eac6a..0000000000
--- a/ext/digest/md5/md5cc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#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 fdd8b36c5d..3591782f6e 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -1,12 +1,9 @@
/* $RoughId: md5init.c,v 1.2 2001/07/13 19:49:10 knu Exp $ */
/* $Id$ */
-#include <ruby/ruby.h>
-#include "../digest.h"
-#if defined(MD5_USE_OPENSSL)
+#include "digest.h"
+#if defined(HAVE_OPENSSL_MD5_H)
#include "md5ossl.h"
-#elif defined(MD5_USE_COMMONDIGEST)
-#include "md5cc.h"
#else
#include "md5.h"
#endif
@@ -22,32 +19,12 @@ static const rb_digest_metadata_t md5 = {
};
/*
- * Document-class: Digest::MD5 < Digest::Base
* A class for calculating message digests using the MD5
* Message-Digest Algorithm by RSA Data Security, Inc., described in
* RFC1321.
- *
- * MD5 calculates a digest of 128 bits (16 bytes).
- *
- * == Examples
- * require 'digest'
- *
- * # Compute a complete digest
- * Digest::MD5.hexdigest 'abc' #=> "90015098..."
- *
- * # Compute digest by chunks
- * md5 = Digest::MD5.new # =>#<Digest::MD5>
- * md5.update "ab"
- * md5 << "c" # alias for #update
- * md5.hexdigest # => "90015098..."
- *
- * # Use the same object to compute another digest
- * md5.reset
- * md5 << "message"
- * md5.hexdigest # => "78e73102..."
*/
void
-Init_md5(void)
+Init_md5()
{
VALUE mDigest, cDigest_Base, cDigest_MD5;
@@ -61,8 +38,6 @@ Init_md5(void)
cDigest_MD5 = rb_define_class_under(mDigest, "MD5", cDigest_Base);
-#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));
+ rb_ivar_set(cDigest_MD5, rb_intern("metadata"),
+ Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&md5));
}
diff --git a/ext/digest/md5/md5ossl.c b/ext/digest/md5/md5ossl.c
new file mode 100644
index 0000000000..d94ae2cd2f
--- /dev/null
+++ b/ext/digest/md5/md5ossl.c
@@ -0,0 +1,9 @@
+/* $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 94aa7ae77b..1680c4f5c9 100644
--- a/ext/digest/md5/md5ossl.h
+++ b/ext/digest/md5/md5ossl.h
@@ -8,8 +8,6 @@
#define MD5_BLOCK_LENGTH MD5_CBLOCK
-static DEFINE_FINISH_FUNC_FROM_FINAL(MD5)
-#undef MD5_Finish
-#define MD5_Finish rb_digest_MD5_finish
+void MD5_Finish(MD5_CTX *pctx, unsigned char *digest);
#endif
diff --git a/ext/digest/rmd160/depend b/ext/digest/rmd160/depend
index 2dfeecf034..c5524be459 100644
--- a/ext/digest/rmd160/depend
+++ b/ext/digest/rmd160/depend
@@ -1,18 +1,3 @@
-rmd160.o: rmd160.c rmd160.h $(srcdir)/../defs.h
-rmd160init.o: $(LOCAL_HDRS)
-
-# AUTOGENERATED DEPENDENCIES START
-rmd160init.o: $(RUBY_EXTCONF_H)
-rmd160init.o: $(arch_hdrdir)/ruby/config.h
-rmd160init.o: $(hdrdir)/ruby/backward.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
-# AUTOGENERATED DEPENDENCIES END
+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
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index a02ba56169..d487d6da80 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -1,16 +1,24 @@
# -*- 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}" ]
-digest_conf("rmd160", "ripemd", "RIPEMD160")
+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
have_header("sys/cdefs.h")
diff --git a/ext/digest/rmd160/rmd160.h b/ext/digest/rmd160/rmd160.h
index 6324709d96..098fa05a88 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) */
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index 10d9370163..c214ca9f33 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -1,9 +1,8 @@
/* $RoughId: rmd160init.c,v 1.3 2001/07/13 20:00:43 knu Exp $ */
/* $Id$ */
-#include <ruby/ruby.h>
-#include "../digest.h"
-#if defined(RMD160_USE_OPENSSL)
+#include "digest.h"
+#if defined(HAVE_OPENSSL_RIPEMD_H)
#include "rmd160ossl.h"
#else
#include "rmd160.h"
@@ -20,32 +19,12 @@ static const rb_digest_metadata_t rmd160 = {
};
/*
- * Document-class: Digest::RMD160 < Digest::Base
* A class for calculating message digests using RIPEMD-160
* cryptographic hash function, designed by Hans Dobbertin, Antoon
* Bosselaers, and Bart Preneel.
- *
- * RMD160 calculates a digest of 160 bits (20 bytes).
- *
- * == Examples
- * require 'digest'
- *
- * # Compute a complete digest
- * Digest::RMD160.hexdigest 'abc' #=> "8eb208f7..."
- *
- * # Compute digest by chunks
- * rmd160 = Digest::RMD160.new # =>#<Digest::RMD160>
- * rmd160.update "ab"
- * rmd160 << "c" # alias for #update
- * rmd160.hexdigest # => "8eb208f7..."
- *
- * # Use the same object to compute another digest
- * rmd160.reset
- * rmd160 << "message"
- * rmd160.hexdigest # => "1dddbe1b..."
*/
void
-Init_rmd160(void)
+Init_rmd160()
{
VALUE mDigest, cDigest_Base, cDigest_RMD160;
@@ -59,8 +38,6 @@ Init_rmd160(void)
cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base);
-#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));
+ rb_ivar_set(cDigest_RMD160, rb_intern("metadata"),
+ Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&rmd160));
}
diff --git a/ext/digest/rmd160/rmd160ossl.c b/ext/digest/rmd160/rmd160ossl.c
new file mode 100644
index 0000000000..f24e63e3d8
--- /dev/null
+++ b/ext/digest/rmd160/rmd160ossl.c
@@ -0,0 +1,8 @@
+/* $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 e6bf5ea8d0..3df38a01c0 100644
--- a/ext/digest/rmd160/rmd160ossl.h
+++ b/ext/digest/rmd160/rmd160ossl.h
@@ -14,7 +14,6 @@
#define RMD160_BLOCK_LENGTH RIPEMD160_CBLOCK
#define RMD160_DIGEST_LENGTH RIPEMD160_DIGEST_LENGTH
-static DEFINE_FINISH_FUNC_FROM_FINAL(RIPEMD160)
-#define RMD160_Finish rb_digest_RIPEMD160_finish
+void RMD160_Finish(RMD160_CTX *ctx, char *buf);
#endif
diff --git a/ext/digest/sha1/depend b/ext/digest/sha1/depend
index 5139f44ff4..6b6ee6a0bf 100644
--- a/ext/digest/sha1/depend
+++ b/ext/digest/sha1/depend
@@ -1,18 +1,3 @@
sha1.o: sha1.c sha1.h $(srcdir)/../defs.h
-sha1init.o: $(LOCAL_HDRS)
-
-# AUTOGENERATED DEPENDENCIES START
-sha1init.o: $(RUBY_EXTCONF_H)
-sha1init.o: $(arch_hdrdir)/ruby/config.h
-sha1init.o: $(hdrdir)/ruby/backward.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
-# AUTOGENERATED DEPENDENCIES END
+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)
diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb
index 0ff4158bef..d7e52fe731 100644
--- a/ext/digest/sha1/extconf.rb
+++ b/ext/digest/sha1/extconf.rb
@@ -1,16 +1,24 @@
# -*- 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}" ]
-digest_conf("sha1", "sha", nil, %w[SHA])
+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
have_header("sys/cdefs.h")
diff --git a/ext/digest/sha1/sha1.h b/ext/digest/sha1/sha1.h
index 2accc46d46..6f1c388cf2 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];
diff --git a/ext/digest/sha1/sha1cc.h b/ext/digest/sha1/sha1cc.h
deleted file mode 100644
index 2ed8d646ab..0000000000
--- a/ext/digest/sha1/sha1cc.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#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 e12d297699..d52eef58b3 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -1,12 +1,9 @@
/* $RoughId: sha1init.c,v 1.2 2001/07/13 19:49:10 knu Exp $ */
/* $Id$ */
-#include <ruby/ruby.h>
-#include "../digest.h"
-#if defined(SHA1_USE_OPENSSL)
+#include "digest.h"
+#if defined(HAVE_OPENSSL_SHA_H)
#include "sha1ossl.h"
-#elif defined(SHA1_USE_COMMONDIGEST)
-#include "sha1cc.h"
#else
#include "sha1.h"
#endif
@@ -22,34 +19,12 @@ static const rb_digest_metadata_t sha1 = {
};
/*
- * Document-class: Digest::SHA1 < Digest::Base
* A class for calculating message digests using the SHA-1 Secure Hash
* Algorithm by NIST (the US' National Institute of Standards and
* Technology), described in FIPS PUB 180-1.
- *
- * See Digest::Instance for digest API.
- *
- * SHA-1 calculates a digest of 160 bits (20 bytes).
- *
- * == Examples
- * require 'digest'
- *
- * # Compute a complete digest
- * Digest::SHA1.hexdigest 'abc' #=> "a9993e36..."
- *
- * # Compute digest by chunks
- * sha1 = Digest::SHA1.new # =>#<Digest::SHA1>
- * sha1.update "ab"
- * sha1 << "c" # alias for #update
- * sha1.hexdigest # => "a9993e36..."
- *
- * # Use the same object to compute another digest
- * sha1.reset
- * sha1 << "message"
- * sha1.hexdigest # => "6f9b9af3..."
*/
void
-Init_sha1(void)
+Init_sha1()
{
VALUE mDigest, cDigest_Base, cDigest_SHA1;
@@ -63,8 +38,6 @@ Init_sha1(void)
cDigest_SHA1 = rb_define_class_under(mDigest, "SHA1", cDigest_Base);
-#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));
+ rb_ivar_set(cDigest_SHA1, rb_intern("metadata"),
+ Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha1));
}
diff --git a/ext/digest/sha1/sha1ossl.c b/ext/digest/sha1/sha1ossl.c
new file mode 100644
index 0000000000..452cf35084
--- /dev/null
+++ b/ext/digest/sha1/sha1ossl.c
@@ -0,0 +1,10 @@
+/* $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 599efe9a2f..8f9984cc64 100644
--- a/ext/digest/sha1/sha1ossl.h
+++ b/ext/digest/sha1/sha1ossl.h
@@ -15,8 +15,6 @@
#endif
#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH
-static DEFINE_FINISH_FUNC_FROM_FINAL(SHA1)
-#undef SHA1_Finish
-#define SHA1_Finish rb_digest_SHA1_finish
+void SHA1_Finish(SHA1_CTX *ctx, char *buf);
#endif
diff --git a/ext/digest/sha2/depend b/ext/digest/sha2/depend
index 1152fe4dac..7373f46fc2 100644
--- a/ext/digest/sha2/depend
+++ b/ext/digest/sha2/depend
@@ -1,18 +1,3 @@
-sha2.o: sha2.c sha2.h $(srcdir)/../defs.h
-sha2init.o: $(LOCAL_HDRS)
-
-# AUTOGENERATED DEPENDENCIES START
-sha2init.o: $(RUBY_EXTCONF_H)
-sha2init.o: $(arch_hdrdir)/ruby/config.h
-sha2init.o: $(hdrdir)/ruby/backward.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
-# AUTOGENERATED DEPENDENCIES END
+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)
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index 5c7f76c7f3..5ab2d35af5 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -1,21 +1,33 @@
# -*- 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}" ]
-unless digest_conf("sha2", "sha", %w[SHA256 SHA512])
+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
have_type("u_int8_t")
+ $objs << "sha2.#{$OBJEXT}"
end
have_header("sys/cdefs.h")
$preload = %w[digest]
-create_makefile("digest/sha2")
+if have_type("uint64_t", "defs.h", $defs.join(' '))
+ create_makefile("digest/sha2")
+end
diff --git a/ext/digest/sha2/lib/sha2.rb b/ext/digest/sha2/lib/sha2.rb
index 61a0734850..58d12e9b09 100644
--- a/ext/digest/sha2/lib/sha2.rb
+++ b/ext/digest/sha2/lib/sha2.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# sha2.rb - defines Digest::SHA2 class which wraps up the SHA256,
# SHA384, and SHA512 classes.
@@ -17,45 +16,11 @@ module Digest
#
# A meta digest provider class for SHA256, SHA384 and SHA512.
#
- # FIPS 180-2 describes SHA2 family of digest algorithms. It defines
- # three algorithms:
- # * one which works on chunks of 512 bits and returns a 256-bit
- # digest (SHA256),
- # * one which works on chunks of 1024 bits and returns a 384-bit
- # digest (SHA384),
- # * and one which works on chunks of 1024 bits and returns a 512-bit
- # digest (SHA512).
- #
- # ==Examples
- # require 'digest'
- #
- # # Compute a complete digest
- # Digest::SHA2.hexdigest 'abc' # => "ba7816bf8..."
- # Digest::SHA2.new(256).hexdigest 'abc' # => "ba7816bf8..."
- # Digest::SHA256.hexdigest 'abc' # => "ba7816bf8..."
- #
- # Digest::SHA2.new(384).hexdigest 'abc' # => "cb00753f4..."
- # Digest::SHA384.hexdigest 'abc' # => "cb00753f4..."
- #
- # Digest::SHA2.new(512).hexdigest 'abc' # => "ddaf35a19..."
- # Digest::SHA512.hexdigest 'abc' # => "ddaf35a19..."
- #
- # # Compute digest by chunks
- # sha2 = Digest::SHA2.new # =>#<Digest::SHA2:256>
- # sha2.update "ab"
- # sha2 << "c" # alias for #update
- # sha2.hexdigest # => "ba7816bf8..."
- #
- # # Use the same object to compute another digest
- # sha2.reset
- # sha2 << "message"
- # sha2.hexdigest # => "ab530a13e..."
- #
class SHA2 < Digest::Class
# call-seq:
# Digest::SHA2.new(bitlen = 256) -> digest_obj
#
- # Create a new SHA2 hash object with a given bit length.
+ # Creates a new SHA2 hash object with a given bit length.
#
# Valid bit lengths are 256, 384 and 512.
def initialize(bitlen = 256)
@@ -75,7 +40,7 @@ module Digest
# call-seq:
# digest_obj.reset -> digest_obj
#
- # Reset the digest to the initial state and return self.
+ # Resets the digest to the initial state and returns self.
def reset
@sha2.reset
self
@@ -85,7 +50,7 @@ module Digest
# digest_obj.update(string) -> digest_obj
# digest_obj << string -> digest_obj
#
- # Update the digest using a given _string_ and return self.
+ # Updates the digest using a given _string_ and returns self.
def update(str)
@sha2.update(str)
self
@@ -101,7 +66,7 @@ module Digest
# call-seq:
# digest_obj.block_length -> Integer
#
- # Return the block length of the digest in bytes.
+ # Returns the block length of the digest in bytes.
#
# Digest::SHA256.new.block_length * 8
# # => 512
@@ -116,7 +81,7 @@ module Digest
# call-seq:
# digest_obj.digest_length -> Integer
#
- # Return the length of the hash value (the digest) in bytes.
+ # Returns the length of the hash value of the digest in bytes.
#
# Digest::SHA256.new.digest_length * 8
# # => 256
diff --git a/ext/digest/sha2/sha2.c b/ext/digest/sha2/sha2.c
index c86eab37a0..d0629a2b64 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
- * equivalent.
+ * equivilent.
*
* If your system does not define the above, then you can do so by
* hand like this:
diff --git a/ext/digest/sha2/sha2cc.h b/ext/digest/sha2/sha2cc.h
deleted file mode 100644
index 3f99604465..0000000000
--- a/ext/digest/sha2/sha2cc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#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 9fd8ece7fe..13df4bcb78 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -1,12 +1,9 @@
/* $RoughId: sha2init.c,v 1.3 2001/07/13 20:00:43 knu Exp $ */
/* $Id$ */
-#include <ruby/ruby.h>
-#include "../digest.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
@@ -32,7 +29,7 @@ FOREACH_BITLEN(DEFINE_ALGO_METADATA)
* Standards and Technology), described in FIPS PUB 180-2.
*/
void
-Init_sha2(void)
+Init_sha2()
{
VALUE mDigest, cDigest_Base;
ID id_metadata;
@@ -44,7 +41,7 @@ Init_sha2(void)
rb_require("digest");
- id_metadata = rb_intern_const("metadata");
+ id_metadata = rb_intern("metadata");
mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
@@ -53,9 +50,7 @@ Init_sha2(void)
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
\
rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
- Data_Wrap_Struct(0, 0, 0, (void *)&sha##bitlen));
+ Data_Wrap_Struct(rb_cObject, 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
new file mode 100644
index 0000000000..34353be8b8
--- /dev/null
+++ b/ext/digest/sha2/sha2ossl.c
@@ -0,0 +1,13 @@
+#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 8dd0530107..4229d14cf9 100644
--- a/ext/digest/sha2/sha2ossl.h
+++ b/ext/digest/sha2/sha2ossl.h
@@ -8,20 +8,10 @@
#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;
-#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)
+void SHA256_Finish(SHA256_CTX *ctx, char *buf);
+void SHA384_Finish(SHA384_CTX *ctx, char *buf);
+void SHA512_Finish(SHA512_CTX *ctx, char *buf);
#endif
diff --git a/ext/dl/callback/depend b/ext/dl/callback/depend
new file mode 100644
index 0000000000..c3b4fef1db
--- /dev/null
+++ b/ext/dl/callback/depend
@@ -0,0 +1,15 @@
+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
new file mode 100644
index 0000000000..f3b79b0a33
--- /dev/null
+++ b/ext/dl/callback/extconf.rb
@@ -0,0 +1,14 @@
+require 'mkmf'
+
+begin
+ 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
new file mode 100644
index 0000000000..e94a196247
--- /dev/null
+++ b/ext/dl/callback/mkcallback.rb
@@ -0,0 +1,242 @@
+#!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
new file mode 100644
index 0000000000..1f4958bbdc
--- /dev/null
+++ b/ext/dl/cfunc.c
@@ -0,0 +1,677 @@
+/* -*- 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
new file mode 100644
index 0000000000..7a82c7c3e0
--- /dev/null
+++ b/ext/dl/cptr.c
@@ -0,0 +1,669 @@
+/* -*- 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);
+ }
+ }
+ xfree(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;
+
+ TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
+ return rb_sprintf("#<%"PRIsVALUE":%p ptr=%p size=%ld free=%p>",
+ rb_obj_class(self), data, data->ptr, data->size, data->free);
+}
+
+/*
+ * 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
new file mode 100644
index 0000000000..d0a3ab8ef0
--- /dev/null
+++ b/ext/dl/depend
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..7ad77dd6b2
--- /dev/null
+++ b/ext/dl/dl.c
@@ -0,0 +1,569 @@
+/*
+ * 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(NUM2SIZET(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, NUM2SIZET(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
new file mode 100644
index 0000000000..f8380a8471
--- /dev/null
+++ b/ext/dl/dl.h
@@ -0,0 +1,217 @@
+#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
new file mode 100644
index 0000000000..53e73c3a8b
--- /dev/null
+++ b/ext/dl/extconf.rb
@@ -0,0 +1,48 @@
+require 'mkmf'
+
+if RbConfig::CONFIG['GCC'] == 'yes'
+ flag = " -fno-defer-pop"
+ if have_macro("__clang__")
+ $LDFLAGS << flag if try_ldflags(flag)
+ else
+ $CFLAGS << flag
+ end
+ $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
new file mode 100644
index 0000000000..6b90e089ee
--- /dev/null
+++ b/ext/dl/handle.c
@@ -0,0 +1,431 @@
+/* -*- 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);
+ }
+ xfree(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
new file mode 100644
index 0000000000..8e615ae718
--- /dev/null
+++ b/ext/dl/lib/dl.rb
@@ -0,0 +1,15 @@
+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
new file mode 100644
index 0000000000..1722d3c6b9
--- /dev/null
+++ b/ext/dl/lib/dl/callback.rb
@@ -0,0 +1,112 @@
+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
new file mode 100644
index 0000000000..e70e0f1dc1
--- /dev/null
+++ b/ext/dl/lib/dl/cparser.rb
@@ -0,0 +1,156 @@
+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
new file mode 100644
index 0000000000..543711f651
--- /dev/null
+++ b/ext/dl/lib/dl/func.rb
@@ -0,0 +1,251 @@
+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
new file mode 100644
index 0000000000..6f157ccf28
--- /dev/null
+++ b/ext/dl/lib/dl/import.rb
@@ -0,0 +1,268 @@
+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
new file mode 100644
index 0000000000..7fbc802b0f
--- /dev/null
+++ b/ext/dl/lib/dl/pack.rb
@@ -0,0 +1,128 @@
+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
new file mode 100644
index 0000000000..dc22378fcb
--- /dev/null
+++ b/ext/dl/lib/dl/stack.rb
@@ -0,0 +1,116 @@
+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
new file mode 100644
index 0000000000..e2d91a6d14
--- /dev/null
+++ b/ext/dl/lib/dl/struct.rb
@@ -0,0 +1,236 @@
+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
new file mode 100644
index 0000000000..d5724e407b
--- /dev/null
+++ b/ext/dl/lib/dl/types.rb
@@ -0,0 +1,71 @@
+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
new file mode 100644
index 0000000000..147d9d120a
--- /dev/null
+++ b/ext/dl/lib/dl/value.rb
@@ -0,0 +1,114 @@
+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 2d986c5913..a73a18465a 100644
--- a/ext/etc/depend
+++ b/ext/etc/depend
@@ -1,22 +1,9 @@
+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
-# AUTOGENERATED DEPENDENCIES START
-etc.o: $(RUBY_EXTCONF_H)
-etc.o: $(arch_hdrdir)/ruby/config.h
-etc.o: $(hdrdir)/ruby/backward.h
-etc.o: $(hdrdir)/ruby/defines.h
-etc.o: $(hdrdir)/ruby/encoding.h
-etc.o: $(hdrdir)/ruby/intern.h
-etc.o: $(hdrdir)/ruby/io.h
-etc.o: $(hdrdir)/ruby/missing.h
-etc.o: $(hdrdir)/ruby/onigmo.h
-etc.o: $(hdrdir)/ruby/oniguruma.h
-etc.o: $(hdrdir)/ruby/ruby.h
-etc.o: $(hdrdir)/ruby/st.h
-etc.o: $(hdrdir)/ruby/subst.h
-etc.o: $(top_srcdir)/include/ruby.h
-etc.o: constdefs.h
-etc.o: etc.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 2dd4ed673e..6168ed1510 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -30,10 +30,6 @@
#include <sys/utsname.h>
#endif
-#ifdef HAVE_SCHED_GETAFFINITY
-#include <sched.h>
-#endif
-
static VALUE sPasswd;
#ifdef HAVE_GETGRENT
static VALUE sGroup;
@@ -81,15 +77,8 @@ etc_getlogin(VALUE obj)
login = getenv("USER");
#endif
- 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);
- }
-
+ if (login)
+ return rb_tainted_str_new2(login);
return Qnil;
}
@@ -215,10 +204,9 @@ etc_getpwnam(VALUE obj, VALUE nam)
{
#ifdef HAVE_GETPWENT
struct passwd *pwd;
- const char *p = StringValueCStr(nam);
- rb_check_safe_obj(nam);
- pwd = getpwnam(p);
+ SafeStringValue(nam);
+ pwd = getpwnam(RSTRING_PTR(nam));
if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %"PRIsVALUE, nam);
return setup_passwd(pwd);
#else
@@ -242,7 +230,7 @@ passwd_iterate(void)
struct passwd *pw;
setpwent();
- while ((pw = getpwent()) != 0) {
+ while (pw = getpwent()) {
rb_yield(setup_passwd(pw));
}
return Qnil;
@@ -288,7 +276,7 @@ etc_passwd(VALUE obj)
if (rb_block_given_p()) {
each_passwd();
}
- else if ((pw = getpwent()) != 0) {
+ else if (pw = getpwent()) {
return setup_passwd(pw);
}
#endif
@@ -370,7 +358,7 @@ etc_getpwent(VALUE obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if ((pw = getpwent()) != 0) {
+ if (pw = getpwent()) {
return setup_passwd(pw);
}
#endif
@@ -459,10 +447,9 @@ etc_getgrnam(VALUE obj, VALUE nam)
{
#ifdef HAVE_GETGRENT
struct group *grp;
- const char *p = StringValueCStr(nam);
- rb_check_safe_obj(nam);
- grp = getgrnam(p);
+ SafeStringValue(nam);
+ grp = getgrnam(RSTRING_PTR(nam));
if (grp == 0) rb_raise(rb_eArgError, "can't find group for %"PRIsVALUE, nam);
return setup_group(grp);
#else
@@ -487,7 +474,7 @@ group_iterate(void)
struct group *pw;
setgrent();
- while ((pw = getgrent()) != 0) {
+ while (pw = getgrent()) {
rb_yield(setup_group(pw));
}
return Qnil;
@@ -529,7 +516,7 @@ etc_group(VALUE obj)
if (rb_block_given_p()) {
each_group();
}
- else if ((grp = getgrent()) != 0) {
+ else if (grp = getgrent()) {
return setup_group(grp);
}
#endif
@@ -608,7 +595,7 @@ etc_getgrent(VALUE obj)
#ifdef HAVE_GETGRENT
struct group *gr;
- if ((gr = getgrent()) != 0) {
+ if (gr = getgrent()) {
return setup_group(gr);
}
#endif
@@ -627,9 +614,8 @@ VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
* Returns system configuration directory.
*
* This is typically "/etc", but is modified by the prefix used when Ruby was
- * compiled. For example, if Ruby is built and installed in /usr/local,
- * returns "/usr/local/etc" on other platforms than Windows.
- * On Windows, this always returns the directory provided by the system.
+ * compiled. For example, if Ruby is built and installed in /usr/local, returns
+ * "/usr/local/etc".
*/
static VALUE
etc_sysconfdir(VALUE obj)
@@ -654,28 +640,7 @@ etc_systmpdir(void)
if (!len) return Qnil;
tmpdir = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
#else
- 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;
- if (len > sizeof(path)) tmpstr = 0;
- }
-# endif
- tmpdir = rb_filesystem_str_new(tmpstr, tmplen);
-# if defined _CS_DARWIN_USER_TEMP_DIR
- if (!tmpstr) {
- confstr(_CS_DARWIN_USER_TEMP_DIR, RSTRING_PTR(tmpdir), len);
- }
-# endif
+ tmpdir = rb_filesystem_str_new_cstr("/tmp");
#endif
FL_UNSET(tmpdir, FL_TAINT);
return tmpdir;
@@ -813,7 +778,10 @@ etc_uname(VALUE obj)
* 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
+ *
+ * # Number of processors.
+ * # It is not standardized.
+ * Etc.sysconf(Etc::SC_NPROCESSORS_ONLN) #=> 4
*
*/
static VALUE
@@ -923,119 +891,6 @@ io_pathconf(VALUE io, VALUE arg)
#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.
@@ -1091,7 +946,6 @@ Init_etc(void)
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/etc.gemspec b/ext/etc/etc.gemspec
deleted file mode 100644
index a6a018c2a1..0000000000
--- a/ext/etc/etc.gemspec
+++ /dev/null
@@ -1,42 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "etc"
- spec.version = "1.0.0"
- spec.date = '2017-12-13'
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Provides access to information typically stored in UNIX /etc directory.}
- spec.description = %q{Provides access to information typically stored in UNIX /etc directory.}
- spec.homepage = "https://github.com/ruby/etc"
- spec.license = "BSD-2-Clause"
-
- spec.files = %w[
- .gitignore
- .travis.yml
- Gemfile
- LICENSE.txt
- README.md
- Rakefile
- bin/console
- bin/setup
- etc.gemspec
- ext/etc/etc.c
- ext/etc/extconf.rb
- ext/etc/mkconstants.rb
- test/etc/test_etc.rb
- ]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.extensions = %w{ext/etc/extconf.rb}
-
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "rake-compiler"
- spec.add_development_dependency "test-unit"
-end
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index 20a7dd00d6..c6b41a4c92 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'mkmf'
headers = []
@@ -12,10 +11,8 @@ have_func("uname((struct utsname *)NULL)", headers)
have_func("getlogin")
have_func("getpwent")
have_func("getgrent")
-if (sysconfdir = RbConfig::CONFIG["sysconfdir"] and
- !RbConfig.expand(sysconfdir.dup, "prefix"=>"", "DESTDIR"=>"").empty?)
- $defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
-end
+sysconfdir = RbConfig.expand(RbConfig::CONFIG["sysconfdir"].dup, "prefix"=>"", "DESTDIR"=>"")
+$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
have_func("sysconf")
have_func("confstr")
diff --git a/ext/etc/mkconstants.rb b/ext/etc/mkconstants.rb
index 18f34c9875..c9fddfd132 100644
--- a/ext/etc/mkconstants.rb
+++ b/ext/etc/mkconstants.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'optparse'
require 'erb'
diff --git a/ext/extmk.rb b/ext/extmk.rb
index e83a0e5d8c..3a240aad0b 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -1,27 +1,31 @@
#! /usr/local/bin/ruby
# -*- mode: ruby; coding: us-ascii -*-
-# frozen_string_literal: false
# :stopdoc:
$extension = nil
$extstatic = nil
$force_static = nil
+$install = nil
$destdir = nil
$dryrun = false
+$clean = nil
$nodynamic = nil
+$extinit = nil
$extobjs = []
$extflags = ""
$extlibs = nil
$extpath = nil
+$ignore = nil
$message = nil
$command_output = nil
-$subconfigure = false
+$configure_only = false
$progname = $0
alias $PROGRAM_NAME $0
alias $0 $progname
$extlist = []
+$compiled = {}
DUMMY_SIGNATURE = "***DUMMY MAKEFILE***"
@@ -45,6 +49,11 @@ elsif !File.chardev?(@null = "/dev/null")
@null = "nul"
end
+def sysquote(x)
+ @quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ @quote ? x.quote : x
+end
+
def verbose?
$mflags.defined?("V") == "1"
end
@@ -74,14 +83,11 @@ 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
- s = m[/^EXTSO[ \t]*=[ \t](.*)/, 1] and $extso = s.split
if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
return keep
end
installrb = {}
- m.scan(/^(?:do-)?install-rb-default:.*[ \t](\S+)(?:[ \t].*)?\n\1:[ \t]*(\S+)/) {installrb[$2] = $1}
+ m.scan(/^install-rb-default:.*[ \t](\S+)(?:[ \t].*)?\n\1:[ \t]*(\S+)/) {installrb[$2] = $1}
oldrb = installrb.keys.sort
newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort
if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
@@ -102,7 +108,7 @@ def extract_makefile(makefile, keep = true)
srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].map {|fn| File.basename(fn)}.sort
if !srcs.empty?
old_srcs = m[/^ORIG_SRCS[ \t]*=[ \t](.*)/, 1] or return false
- (old_srcs.split - srcs).empty? or return false
+ old_srcs.split.sort == srcs or return false
end
$target = target
$extconf_h = m[/^RUBY_EXTCONF_H[ \t]*=[ \t]*(\S+)/, 1]
@@ -121,20 +127,25 @@ def extract_makefile(makefile, keep = true)
end
$objs = (m[/^OBJS[ \t]*=[ \t](.*)/, 1] || "").split
$srcs = (m[/^SRCS[ \t]*=[ \t](.*)/, 1] || "").split
- $headers = (m[/^LOCAL_HDRS[ \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
end
-def extmake(target, basedir = 'ext', maybestatic = true)
+def extmake(target)
+ unless $configure_only || verbose?
+ print "#{$message} #{target}\n"
+ $stdout.flush
+ end
+
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}/#{basedir}/#{d}/extconf.rb")
+ if File.exist?("#{$top_srcdir}/ext/#{d}/extconf.rb")
parent = (/^all:\s*install/ =~ IO.read("#{d}/Makefile") rescue false)
break
end
@@ -152,16 +163,16 @@ def extmake(target, basedir = 'ext', maybestatic = true)
$topdir = prefix + $topdir
$target = target
$mdir = target
- $srcdir = File.join($top_srcdir, basedir, $mdir)
+ $srcdir = File.join($top_srcdir, "ext", $mdir)
$preload = nil
$objs = []
$srcs = []
- $extso = []
+ $compiled[target] = false
makefile = "./Makefile"
static = $static
$static = nil if noinstall = File.fnmatch?("-*", target)
ok = parent && File.exist?(makefile)
- if parent
+ if parent && !$ignore
rbconfig0 = RbConfig::CONFIG
mkconfig0 = CONFIG
rbconfig = {
@@ -171,7 +182,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
}
mkconfig = {
"hdrdir" => ($hdrdir == top_srcdir) ? top_srcdir : "$(top_srcdir)/include",
- "srcdir" => "$(top_srcdir)/#{basedir}/#{$mdir}",
+ "srcdir" => "$(top_srcdir)/ext/#{$mdir}",
"topdir" => $topdir,
}
rbconfig0.each_pair {|key, val| rbconfig[key] ||= val.dup}
@@ -190,19 +201,21 @@ def extmake(target, basedir = 'ext', maybestatic = true)
$extconf_h = nil
ok &&= extract_makefile(makefile)
old_objs = $objs
- old_cleanfiles = $distcleanfiles | $cleanfiles
+ old_cleanfiles = $distcleanfiles
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
!(t = modified?(makefile, MTIMES)) ||
[conf, "#{$srcdir}/depend"].any? {|f| modified?(f, [t])})
then
ok = false
- if verbose?
- print "#{conf}\n" if conf
- else
- print "#{$message} #{target}\n"
+ if $configure_only
+ if verbose?
+ print "#{conf}\n" if conf
+ else
+ print "#{$message} #{target}\n"
+ end
+ $stdout.flush
end
- $stdout.flush
init_mkmf
Logging::logfile 'mkmf.log'
rm_f makefile
@@ -229,35 +242,50 @@ def extmake(target, basedir = 'ext', maybestatic = true)
end
end
ok &&= File.open(makefile){|f| s = f.gets and !s[DUMMY_SIGNATURE]}
- unless ok
- mf = ["# #{DUMMY_SIGNATURE}\n", *dummy_makefile(CONFIG["srcdir"])].join("")
+ 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
atomic_write_open(makefile) do |f|
- f.print(mf)
+ f.puts "# " + DUMMY_SIGNATURE
+ f.print(*dummy_makefile(CONFIG["srcdir"]))
end
- return true if !error and target.start_with?("-")
-
- message = nil
+ mess = "Failed to configure #{target}. It will not be installed.\n"
if error
- loc = error.backtrace_locations[0]
- message = "#{loc.absolute_path}:#{loc.lineno}: #{error.message}"
- if Logging.log_opened?
- Logging::message("#{message}\n\t#{error.backtrace.join("\n\t")}\n")
- end
+ mess = "#{error}\n#{mess}"
end
- return [parent, message]
+ Logging::message(mess) if Logging.log_opened?
+ print(mess)
+ $stdout.flush
+ return true
end
- args = $mflags
+ args = sysquote($mflags)
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
- args += ["DESTDIR=" + relative_from($destdir, "../"+prefix)]
+ args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
end
if $static and ok and !$objs.empty? and !noinstall
- args += ["static"]
- $extlist.push [(maybestatic ? $static : false), target, $target, $preload]
+ args += ["static"] unless $clean
+ $extlist.push [$static, target, $target, $preload]
end
- FileUtils.rm_f(old_cleanfiles - $distcleanfiles - $cleanfiles)
+ FileUtils.rm_f(old_cleanfiles - $distcleanfiles)
FileUtils.rm_f(old_objs - $objs)
+ unless $configure_only or system($make, *args)
+ $ignore or $continue or return false
+ end
+ $compiled[target] = true
+ if $clean
+ FileUtils.rm_f("mkmf.log")
+ if $clean != true
+ FileUtils.rm_f([makefile, $extconf_h || "extconf.h"])
+ end
+ end
if $static
$extflags ||= ""
$extlibs ||= []
@@ -265,7 +293,7 @@ def extmake(target, basedir = 'ext', maybestatic = true)
unless $mswin
$extflags = split_libs($extflags, $DLDFLAGS, $LDFLAGS).uniq.join(" ")
end
- $extlibs = merge_libs($extlibs, split_libs($libs, $LOCAL_LIBS).map {|lib| lib.sub(/\A\.\//, "ext/#{target}/")})
+ $extlibs = merge_libs($extlibs, split_libs($libs), split_libs($LOCAL_LIBS))
$extpath |= $LIBPATH
end
ensure
@@ -299,6 +327,10 @@ def extmake(target, basedir = 'ext', maybestatic = true)
true
end
+def compiled?(target)
+ $compiled[target]
+end
+
def parse_args()
$mflags = []
$makeflags = [] # for make command to build ruby, so quoted
@@ -342,9 +374,6 @@ def parse_args()
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)
@@ -353,7 +382,6 @@ def parse_args()
$optparser.warn(e)
abort $optparser.to_s
end
- $command_output or abort "--command-output option is mandatory"
$destdir ||= ''
@@ -389,10 +417,18 @@ parse_args()
if target = ARGV.shift and /^[a-z-]+$/ =~ target
$mflags.push(target)
case target
- when /^(dist|real)?(clean)$/, /^install\b/
- abort "#{target} is obsolete"
+ when /^(dist|real)?(clean)$/
+ target = $2
+ $ignore ||= true
+ $clean = $1 ? $1[0] : true
+ when /^install\b/
+ $install = true
+ $ignore ||= true
+ $mflags.unshift("INSTALL_PROG=install -c -p -m 0755",
+ "INSTALL_DATA=install -c -p -m 0644",
+ "MAKEDIRS=mkdir -p") if $dryrun
when /configure/
- $subconfigure = !ARGV.empty?
+ $configure_only = true
end
end
unless $message
@@ -411,15 +447,12 @@ elsif sep = config_string('BUILD_FILE_SEPARATOR')
else
$ruby = '$(topdir)/miniruby' + EXEEXT
end
-$ruby = [$ruby]
-$ruby << "-I'$(topdir)'"
+$ruby << " -I'$(topdir)'"
unless CROSS_COMPILING
- $ruby << "-I'$(top_srcdir)/lib'"
- $ruby << "-I'$(extout)/$(arch)'" << "-I'$(extout)/common'" if $extout
+ $ruby << " -I'$(top_srcdir)/lib'"
+ $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
ENV["RUBYLIB"] = "-"
end
-topruby = $ruby
-$ruby = topruby.join(' ')
$mflags << "ruby=#$ruby"
MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}
@@ -459,40 +492,26 @@ for dir in ["ext", File::join($top_srcdir, "ext")]
end
end unless $extstatic
-@gemname = nil
-if ARGV[0]
- ext_prefix, exts = ARGV.shift.split('/', 2)
- $extension = [exts] if exts
- @gemname = exts if ext_prefix == 'gems'
-end
-ext_prefix = "#{$top_srcdir}/#{ext_prefix || 'ext'}"
+ext_prefix = "#{$top_srcdir}/ext"
exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t}
-default_exclude_exts =
- case
- when $cygwin
- %w''
- when $mswin, $mingw
- %w'pty syslog'
- else
- %w'*win32*'
- end
-mandatory_exts = {}
-withes, withouts = [["--with", nil], ["--without", default_exclude_exts]].collect {|w, d|
+withes, withouts = %w[--with --without].collect {|w|
if !(w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
- d ? proc {|c1| d.any?(&c1)} : proc {true}
+ nil
elsif (w = w.grep(String)).empty?
proc {true}
else
- w = w.collect {|o| o.split(/,/)}.flatten
- w.collect! {|o| o == '+' ? d : o}.flatten!
- proc {|c1| w.any?(&c1)}
+ proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)}
end
}
+if withes
+ withouts ||= proc {true}
+else
+ withes = proc {false}
+ withouts ||= withes
+end
cond = proc {|ext, *|
- withes.call(proc {|n|
- !n or (mandatory_exts[ext] = true if File.fnmatch(n, ext))
- }) and
- !withouts.call(proc {|n| File.fnmatch(n, ext)})
+ cond1 = proc {|n| File.fnmatch(n, ext)}
+ withes.call(cond1) or !withouts.call(cond1)
}
($extension || %w[*]).each do |e|
e = e.sub(/\A(?:\.\/)+/, '')
@@ -507,63 +526,25 @@ cond = proc {|ext, *|
exts.delete_if {|d| File.fnmatch?("-*", d)}
end
end
-ext_prefix = File.basename(ext_prefix)
-
-extend Module.new {
- def timestamp_file(name, target_prefix = nil)
- if @gemname and name == '$(TARGET_SO_DIR)'
- name = "$(arch)/gems/#{@gemname}#{target_prefix}"
- end
- super.sub(%r[/\.extout\.(?:-\.)?], '/.')
- end
- def configuration(srcdir)
- super << "EXTSO #{['=', $extso].join(' ')}\n"
+if $extout
+ extout = RbConfig.expand("#{$extout}", RbConfig::CONFIG.merge("topdir"=>$topdir))
+ unless $ignore
+ FileUtils.mkpath(extout)
end
-
- def create_makefile(*args, &block)
- return super unless @gemname
- super(*args) do |conf|
- conf.find do |s|
- s.sub!(/^(TARGET_SO_DIR *= *)\$\(RUBYARCHDIR\)/) {
- "TARGET_GEM_DIR = $(extout)/gems/$(arch)/#{@gemname}\n"\
- "#{$1}$(TARGET_GEM_DIR)$(target_prefix)"
- }
- end
- conf.any? {|s| /^TARGET *= *\S/ =~ s} and conf << %{
-
-# default target
-all:
-
-build_complete = $(TARGET_GEM_DIR)/gem.build_complete
-install-so: build_complete
-build_complete: $(build_complete)
-$(build_complete): $(TARGET_SO)
- $(Q) $(TOUCH) $@
-
-clean-so::
- -$(Q)$(RM) $(build_complete)
-}
- conf
- end
- end
-}
+end
dir = Dir.pwd
-FileUtils::makedirs(ext_prefix)
-Dir::chdir(ext_prefix)
+FileUtils::makedirs('ext')
+Dir::chdir('ext')
hdrdir = $hdrdir
$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
-extso = []
-fails = []
exts.each do |d|
$static = $force_static ? true : $static_ext[d]
- if !$nodynamic or $static
- result = extmake(d, ext_prefix, !@gemname) or abort
- extso |= $extso
- fails << [d, result] unless result == true
+ if $ignore or !$nodynamic or $static
+ extmake(d) or abort
end
end
@@ -576,18 +557,36 @@ extinit = Struct.new(:c, :o) {
super("#{src}.c", "#{src}.#{$OBJEXT}")
end
}.new("extinit")
+if $ignore
+ FileUtils.rm_f(extinit.to_a) if $clean
+ Dir.chdir ".."
+ if $clean
+ Dir.rmdir('ext') rescue nil
+ if $extout
+ FileUtils.rm_rf([extout+"/common", extout+"/include/ruby", extout+"/rdoc"])
+ FileUtils.rm_rf(extout+"/"+CONFIG["arch"])
+ if $clean != true
+ FileUtils.rm_rf(extout+"/include/"+CONFIG["arch"])
+ FileUtils.rm_f($mflags.defined?("INSTALLED_LIST")||ENV["INSTALLED_LIST"]||".installed.list")
+ Dir.rmdir(extout+"/include") rescue nil
+ Dir.rmdir(extout) rescue nil
+ end
+ end
+ end
+ exit
+end
+$extinit ||= ""
$extobjs ||= []
$extpath ||= []
$extflags ||= ""
$extlibs ||= []
-extinits = []
unless $extlist.empty?
+ $extinit << "\n" unless $extinit.empty?
list = $extlist.dup
built = []
while e = list.shift
- static, target, feature, required = e
- next unless static
+ _, target, feature, required = e
if required and !(required -= built).empty?
l = list.size
if (while l > 0; break true if required.include?(list[l-=1][1]) end)
@@ -596,11 +595,30 @@ unless $extlist.empty?
next
end
base = File.basename(feature)
- extinits << feature
+ $extinit << " init(Init_#{base}, \"#{feature}.so\");\n"
$extobjs << format("ext/%s/%s.%s", target, base, $LIBEXT)
built << target
end
+ src = %{\
+#include "ruby/ruby.h"
+
+#define init(func, name) { \\
+ extern void func(void); \\
+ ruby_init_ext(name, func); \\
+}
+
+void ruby_init_ext(const char *name, void (*init)(void));
+
+void Init_ext(void)\n{\n#$extinit}
+}
+ if !modified?(extinit.c, MTIMES) || IO.read(extinit.c) != src
+ 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 = [
@@ -608,9 +626,9 @@ unless $extlist.empty?
['SETUP', $setup],
['EXTLIBS', $extlibs.join(' ')], ['EXTLDFLAGS', $extflags]
].map {|n, v|
- "#{n}=#{v}" if v &&= v[/\S(?:.*\S)?/]
+ "#{n}=#{v}" if v and !(v = v.strip).empty?
}.compact
- puts(*conf) unless $subconfigure
+ puts(*conf)
$stdout.flush
$mflags.concat(conf)
$makeflags.concat(conf)
@@ -632,11 +650,22 @@ unless $destdir.to_s.empty?
end
$makeflags.uniq!
+if $nmake == ?b
+ unless (vars = $mflags.grep(/\A\w+=/n)).empty?
+ open(mkf = "libruby.mk", "wb") do |tmf|
+ tmf.puts("!include Makefile")
+ tmf.puts
+ tmf.puts(*vars.map {|v| v.sub(/\=/, " = ")})
+ tmf.puts("PRE_LIBRUBY_UPDATE = del #{mkf}")
+ end
+ $mflags.unshift("-f#{mkf}")
+ vars.each {|flag| flag.sub!(/\A/, "-D")}
+ end
+end
$mflags.unshift("topdir=#$topdir")
ENV.delete("RUBYOPT")
-exts.map! {|d| "#{ext_prefix}/#{d}/."}
-FileUtils.makedirs(File.dirname($command_output))
-begin
+if $configure_only and $command_output
+ exts.map! {|d| "ext/#{d}/."}
atomic_write_open($command_output) do |mf|
mf.puts "V = 0"
mf.puts "Q1 = $(V:1=)"
@@ -661,36 +690,25 @@ begin
puts
end
- mf.macro "ruby", topruby
- mf.macro "RUBY", ["$(ruby)"]
mf.macro "extensions", exts
mf.macro "EXTOBJS", $extlist.empty? ? ["dmyext.#{$OBJEXT}"] : ["ext/extinit.#{$OBJEXT}", *$extobjs]
mf.macro "EXTLIBS", $extlibs
- mf.macro "EXTSO", extso
mf.macro "EXTLDFLAGS", $extflags.split
- mf.macro "EXTINITS", extinits
submakeopts = []
if enable_config("shared", $enable_shared)
- submakeopts << 'DLDOBJS="$(EXTOBJS) $(EXTENCS)"'
- submakeopts << 'EXTOBJS='
+ submakeopts << 'DLDOBJS="$(EXTOBJS) $(ENCOBJS)"'
submakeopts << 'EXTSOLIBS="$(EXTLIBS)"'
submakeopts << 'LIBRUBY_SO_UPDATE=$(LIBRUBY_EXTS)'
else
- submakeopts << 'EXTOBJS="$(EXTOBJS) $(EXTENCS)"'
+ submakeopts << 'EXTOBJS="$(EXTOBJS) $(ENCOBJS)"'
submakeopts << 'EXTLIBS="$(EXTLIBS)"'
end
submakeopts << 'EXTLDFLAGS="$(EXTLDFLAGS)"'
- submakeopts << 'EXTINITS="$(EXTINITS)"'
- submakeopts << 'UPDATE_LIBRARIES="$(UPDATE_LIBRARIES)"'
- submakeopts << 'SHOWFLAGS='
mf.macro "SUBMAKEOPTS", submakeopts
- mf.macro "NOTE_MESG", %w[$(RUBY) $(top_srcdir)/tool/colorize.rb skip]
- mf.macro "NOTE_NAME", %w[$(RUBY) $(top_srcdir)/tool/colorize.rb fail]
mf.puts
targets = %w[all install static install-so install-rb clean distclean realclean]
targets.each do |tgt|
mf.puts "#{tgt}: $(extensions:/.=/#{tgt})"
- mf.puts "#{tgt}: note" unless /clean\z/ =~ tgt
end
mf.puts
mf.puts "clean:\n\t-$(Q)$(RM) ext/extinit.#{$OBJEXT}"
@@ -698,16 +716,14 @@ begin
mf.puts
mf.puts "#{rubies.join(' ')}: $(extensions:/.=/#{$force_static ? 'static' : 'all'})"
submake = "$(Q)$(MAKE) $(MFLAGS) $(SUBMAKEOPTS)"
- mf.puts "all static: #{rubies.join(' ')}\n"
+ mf.puts "all static: $(EXTOBJS)\n\t#{submake} #{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'}"
+ mf.puts "#{rubies.join(' ')}: $(EXTOBJS)"
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) EXTINITS=\"$(EXTINITS)\" $@" if $static
mf.puts
if $gnumake == "yes"
submake = "$(MAKE) -C $(@D)"
@@ -721,37 +737,32 @@ begin
mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
end
end
- mf.puts "\n""extso:\n"
- mf.puts "\t@echo EXTSO=$(EXTSO)"
-
- mf.puts "\n""note:\n"
- unless fails.empty?
- abandon = false
- mf.puts "note: note-body\n"
- mf.puts "note-body:: note-header\n"
- mf.puts "note-header:\n"
- mf.puts %Q<\t@$(NOTE_MESG) "*** Following extensions are not compiled:">
- mf.puts "note-body:: note-header\n"
- fails.each do |ext, (parent, err)|
- abandon ||= mandatory_exts[ext]
- mf.puts %Q<\t@$(NOTE_NAME) "#{ext}:">
- if parent
- mf.puts %Q<\t@echo "\tCould not be configured. It will not be installed.">
- err and err.scan(/.+/) do |ee|
- mf.puts %Q<\t@echo "\t#{ee.gsub(/["`$^]/, '\\\\\\&')}">
- end
- mf.puts %Q<\t@echo "\tCheck #{ext_prefix}/#{ext}/mkmf.log for more details.">
- else
- mf.puts %Q<\t@echo "\tSkipped because its parent was not configured.">
- end
- end
- mf.puts "note:\n"
- mf.puts %Q<\t@$(NOTE_MESG) "*** Fix the problems, then remove these directories and try again if you want.">
- if abandon
- mf.puts "\t""@exit 1"
+ end
+elsif $command_output
+ message = "making #{rubies.join(', ')}"
+ message = "echo #{message}"
+ $mflags.concat(rubies)
+ $makeflags.concat(rubies)
+ cmd = $makeflags.map {|ss|ss.sub(/.*[$(){};\s].*/, %q['\&'])}.join(' ')
+ open($command_output, 'wb') do |ff|
+ case $command_output
+ when /\.sh\z/
+ ff.puts message, "rm -f \"$0\"; exec \"$@\" #{cmd}"
+ when /\.bat\z/
+ ["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |ss|
+ ff.print ss, "\r\n"
end
+ else
+ ff.puts cmd
end
+ ff.chmod(0755)
end
+elsif !$configure_only
+ message = "making #{rubies.join(', ')}"
+ puts message
+ $stdout.flush
+ $mflags.concat(rubies)
+ system($make, *sysquote($mflags)) or exit($?.exitstatus)
end
# :startdoc:
diff --git a/ext/fcntl/depend b/ext/fcntl/depend
deleted file mode 100644
index 61d7dc20ee..0000000000
--- a/ext/fcntl/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-fcntl.o: $(RUBY_EXTCONF_H)
-fcntl.o: $(arch_hdrdir)/ruby/config.h
-fcntl.o: $(hdrdir)/ruby/backward.h
-fcntl.o: $(hdrdir)/ruby/defines.h
-fcntl.o: $(hdrdir)/ruby/intern.h
-fcntl.o: $(hdrdir)/ruby/missing.h
-fcntl.o: $(hdrdir)/ruby/ruby.h
-fcntl.o: $(hdrdir)/ruby/st.h
-fcntl.o: $(hdrdir)/ruby/subst.h
-fcntl.o: $(top_srcdir)/include/ruby.h
-fcntl.o: fcntl.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/fcntl/extconf.rb b/ext/fcntl/extconf.rb
index 6998f77483..8b717d4a5b 100644
--- a/ext/fcntl/extconf.rb
+++ b/ext/fcntl/extconf.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: true
require 'mkmf'
create_makefile('fcntl')
diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c
index c93694c431..3538d94948 100644
--- a/ext/fcntl/fcntl.c
+++ b/ext/fcntl/fcntl.c
@@ -62,13 +62,13 @@ pack up your own arguments to pass as args for locking functions, etc.
*
*/
void
-Init_fcntl(void)
+Init_fcntl()
{
VALUE mFcntl = rb_define_module("Fcntl");
#ifdef F_DUPFD
/* Document-const: F_DUPFD
*
- * Duplicate a file descriptor to the minimum unused file descriptor
+ * Duplicate a file descriptor to the mimimum unused file descriptor
* greater than or equal to the argument.
*
* The close-on-exec flag of the duplicated file descriptor is set.
diff --git a/ext/fcntl/fcntl.gemspec b/ext/fcntl/fcntl.gemspec
deleted file mode 100644
index 2bdefa0888..0000000000
--- a/ext/fcntl/fcntl.gemspec
+++ /dev/null
@@ -1,26 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "fcntl"
- spec.version = "1.0.0"
- spec.date = '2017-12-11'
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = "Loads constants defined in the OS fcntl.h C header file"
- spec.description = "Loads constants defined in the OS fcntl.h C header file"
- spec.homepage = "https://github.com/ruby/fcntl"
- spec.license = "BSD-2-Clause"
-
- spec.files = ["ext/fcntl/extconf.rb", "ext/fcntl/fcntl.c"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.extensions = "ext/fcntl/extconf.rb"
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler", "~> 1.14"
- spec.add_development_dependency "rake", "~> 12"
- spec.add_development_dependency "rake-compiler"
-end
diff --git a/ext/fiber/depend b/ext/fiber/depend
deleted file mode 100644
index 85cac2f03c..0000000000
--- a/ext/fiber/depend
+++ /dev/null
@@ -1 +0,0 @@
-fiber.o: fiber.c
diff --git a/ext/fiber/extconf.rb b/ext/fiber/extconf.rb
index 7f11e0dafa..904ab94a9c 100644
--- a/ext/fiber/extconf.rb
+++ b/ext/fiber/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
create_makefile('fiber')
diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index 1a80b2b02a..e0f7e4b12d 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -1,7 +1,4 @@
#include <fiddle.h>
-#include <ruby/thread.h>
-
-int ruby_thread_has_gvl_p(void); /* from internal.h */
VALUE cFiddleClosure;
@@ -42,13 +39,14 @@ closure_memsize(const void * ptr)
fiddle_closure * cls = (fiddle_closure *)ptr;
size_t size = 0;
- size += sizeof(*cls);
+ if (ptr) {
+ 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;
}
@@ -57,19 +55,10 @@ const rb_data_type_t closure_data_type = {
{0, dealloc, closure_memsize,},
};
-struct callback_args {
- ffi_cif *cif;
- void *resp;
- void **args;
- void *ctx;
-};
-
-static void *
-with_gvl_callback(void *ptr)
+void
+callback(ffi_cif *cif, void *resp, void **args, void *ctx)
{
- struct callback_args *x = ptr;
-
- VALUE self = (VALUE)x->ctx;
+ VALUE self = (VALUE)ctx;
VALUE rbargs = rb_iv_get(self, "@args");
VALUE ctype = rb_iv_get(self, "@ctype");
int argc = RARRAY_LENINT(rbargs);
@@ -81,52 +70,52 @@ with_gvl_callback(void *ptr)
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
for (i = 0; i < argc; i++) {
- type = NUM2INT(RARRAY_AREF(rbargs, i));
+ type = NUM2INT(RARRAY_PTR(rbargs)[i]);
switch (type) {
case TYPE_VOID:
argc = 0;
break;
case TYPE_INT:
- rb_ary_push(params, INT2NUM(*(int *)x->args[i]));
+ rb_ary_push(params, INT2NUM(*(int *)args[i]));
break;
case -TYPE_INT:
- rb_ary_push(params, UINT2NUM(*(unsigned int *)x->args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned int *)args[i]));
break;
case TYPE_VOIDP:
rb_ary_push(params,
rb_funcall(cPointer, rb_intern("[]"), 1,
- PTR2NUM(*(void **)x->args[i])));
+ PTR2NUM(*(void **)args[i])));
break;
case TYPE_LONG:
- rb_ary_push(params, LONG2NUM(*(long *)x->args[i]));
+ rb_ary_push(params, LONG2NUM(*(long *)args[i]));
break;
case -TYPE_LONG:
- rb_ary_push(params, ULONG2NUM(*(unsigned long *)x->args[i]));
+ rb_ary_push(params, ULONG2NUM(*(unsigned long *)args[i]));
break;
case TYPE_CHAR:
- rb_ary_push(params, INT2NUM(*(signed char *)x->args[i]));
+ rb_ary_push(params, INT2NUM(*(signed char *)args[i]));
break;
case -TYPE_CHAR:
- rb_ary_push(params, UINT2NUM(*(unsigned char *)x->args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned char *)args[i]));
break;
case TYPE_SHORT:
- rb_ary_push(params, INT2NUM(*(signed short *)x->args[i]));
+ rb_ary_push(params, INT2NUM(*(signed short *)args[i]));
break;
case -TYPE_SHORT:
- rb_ary_push(params, UINT2NUM(*(unsigned short *)x->args[i]));
+ rb_ary_push(params, UINT2NUM(*(unsigned short *)args[i]));
break;
case TYPE_DOUBLE:
- rb_ary_push(params, rb_float_new(*(double *)x->args[i]));
+ rb_ary_push(params, rb_float_new(*(double *)args[i]));
break;
case TYPE_FLOAT:
- rb_ary_push(params, rb_float_new(*(float *)x->args[i]));
+ rb_ary_push(params, rb_float_new(*(float *)args[i]));
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- rb_ary_push(params, LL2NUM(*(LONG_LONG *)x->args[i]));
+ rb_ary_push(params, LL2NUM(*(LONG_LONG *)args[i]));
break;
case -TYPE_LONG_LONG:
- rb_ary_push(params, ULL2NUM(*(unsigned LONG_LONG *)x->args[i]));
+ rb_ary_push(params, ULL2NUM(*(unsigned LONG_LONG *)args[i]));
break;
#endif
default:
@@ -134,7 +123,7 @@ with_gvl_callback(void *ptr)
}
}
- ret = rb_funcall2(self, rb_intern("call"), argc, RARRAY_CONST_PTR(params));
+ ret = rb_funcall2(self, rb_intern("call"), argc, RARRAY_PTR(params));
RB_GC_GUARD(params);
type = NUM2INT(ctype);
@@ -142,59 +131,41 @@ with_gvl_callback(void *ptr)
case TYPE_VOID:
break;
case TYPE_LONG:
- *(long *)x->resp = NUM2LONG(ret);
+ *(long *)resp = NUM2LONG(ret);
break;
case -TYPE_LONG:
- *(unsigned long *)x->resp = NUM2ULONG(ret);
+ *(unsigned long *)resp = NUM2ULONG(ret);
break;
case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
- *(ffi_sarg *)x->resp = NUM2INT(ret);
+ *(ffi_sarg *)resp = NUM2INT(ret);
break;
case -TYPE_CHAR:
case -TYPE_SHORT:
case -TYPE_INT:
- *(ffi_arg *)x->resp = NUM2UINT(ret);
+ *(ffi_arg *)resp = NUM2UINT(ret);
break;
case TYPE_VOIDP:
- *(void **)x->resp = NUM2PTR(ret);
+ *(void **)resp = NUM2PTR(ret);
break;
case TYPE_DOUBLE:
- *(double *)x->resp = NUM2DBL(ret);
+ *(double *)resp = NUM2DBL(ret);
break;
case TYPE_FLOAT:
- *(float *)x->resp = (float)NUM2DBL(ret);
+ *(float *)resp = (float)NUM2DBL(ret);
break;
#if HAVE_LONG_LONG
case TYPE_LONG_LONG:
- *(LONG_LONG *)x->resp = NUM2LL(ret);
+ *(LONG_LONG *)resp = NUM2LL(ret);
break;
case -TYPE_LONG_LONG:
- *(unsigned LONG_LONG *)x->resp = NUM2ULL(ret);
+ *(unsigned LONG_LONG *)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
@@ -239,7 +210,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_AREF(args, i));
+ int type = NUM2INT(RARRAY_PTR(args)[i]);
cl->argv[i] = INT2FFI_TYPE(type);
}
cl->argv[argc] = NULL;
@@ -289,7 +260,7 @@ to_i(VALUE self)
}
void
-Init_fiddle_closure(void)
+Init_fiddle_closure()
{
#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 d0a8be6180..1e870e2285 100644
--- a/ext/fiddle/closure.h
+++ b/ext/fiddle/closure.h
@@ -3,6 +3,6 @@
#include <fiddle.h>
-void Init_fiddle_closure(void);
+void Init_fiddle_closure();
#endif
diff --git a/ext/fiddle/conversions.h b/ext/fiddle/conversions.h
index cbc610bad2..d0a08d6bc0 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) (LONG2NUM((long)(x)))
+# 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) (LL2NUM((LONG_LONG)(x)))
+# define PTR2NUM(x) (ULL2NUM((unsigned long long)(x)))
# define NUM2PTR(x) ((void*)(NUM2ULL(x)))
#endif
diff --git a/ext/fiddle/depend b/ext/fiddle/depend
index 7209469260..e786dc71d2 100644
--- a/ext/fiddle/depend
+++ b/ext/fiddle/depend
@@ -1,156 +1,4 @@
-PWD =
-
-CONFIGURE_LIBFFI = \
- $(LIBFFI_CONFIGURE) --disable-shared \
- --host=$(LIBFFI_ARCH) --enable-builddir=$(arch) \
- CC="$(CC)" CFLAGS="$(LIBFFI_CFLAGS)" \
- LD="$(LD)" LDFLAGS="$(LIBFFI_LDFLAGS)"
-
-$(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):
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG)
-
-clean-none:
-clean-libffi:
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) clean
-
-distclean-none:
-distclean-libffi:
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) distclean
- $(Q) $(RM) $(LIBFFI_DIR)/local.exp
- $(Q) $(RUBY) -rfileutils -e "FileUtils.rmdir(Dir.glob(ARGV[0]+'/**/{,.*/}'), :parents=>true)" $(LIBFFI_DIR)
-
-realclean-none:
-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
-
-# AUTOGENERATED DEPENDENCIES START
-closure.o: $(RUBY_EXTCONF_H)
-closure.o: $(arch_hdrdir)/ruby/config.h
-closure.o: $(hdrdir)/ruby/backward.h
-closure.o: $(hdrdir)/ruby/defines.h
-closure.o: $(hdrdir)/ruby/encoding.h
-closure.o: $(hdrdir)/ruby/intern.h
-closure.o: $(hdrdir)/ruby/io.h
-closure.o: $(hdrdir)/ruby/missing.h
-closure.o: $(hdrdir)/ruby/onigmo.h
-closure.o: $(hdrdir)/ruby/oniguruma.h
-closure.o: $(hdrdir)/ruby/ruby.h
-closure.o: $(hdrdir)/ruby/st.h
-closure.o: $(hdrdir)/ruby/subst.h
-closure.o: $(hdrdir)/ruby/thread.h
-closure.o: $(top_srcdir)/include/ruby.h
-closure.o: $(top_srcdir)/internal.h
-closure.o: closure.c
-closure.o: closure.h
-closure.o: conversions.h
-closure.o: fiddle.h
-closure.o: function.h
-conversions.o: $(RUBY_EXTCONF_H)
-conversions.o: $(arch_hdrdir)/ruby/config.h
-conversions.o: $(hdrdir)/ruby/backward.h
-conversions.o: $(hdrdir)/ruby/defines.h
-conversions.o: $(hdrdir)/ruby/intern.h
-conversions.o: $(hdrdir)/ruby/missing.h
-conversions.o: $(hdrdir)/ruby/ruby.h
-conversions.o: $(hdrdir)/ruby/st.h
-conversions.o: $(hdrdir)/ruby/subst.h
-conversions.o: $(top_srcdir)/include/ruby.h
-conversions.o: closure.h
-conversions.o: conversions.c
-conversions.o: conversions.h
-conversions.o: fiddle.h
-conversions.o: function.h
-fiddle.o: $(RUBY_EXTCONF_H)
-fiddle.o: $(arch_hdrdir)/ruby/config.h
-fiddle.o: $(hdrdir)/ruby/backward.h
-fiddle.o: $(hdrdir)/ruby/defines.h
-fiddle.o: $(hdrdir)/ruby/intern.h
-fiddle.o: $(hdrdir)/ruby/missing.h
-fiddle.o: $(hdrdir)/ruby/ruby.h
-fiddle.o: $(hdrdir)/ruby/st.h
-fiddle.o: $(hdrdir)/ruby/subst.h
-fiddle.o: $(top_srcdir)/include/ruby.h
-fiddle.o: closure.h
-fiddle.o: conversions.h
-fiddle.o: fiddle.c
-fiddle.o: fiddle.h
-fiddle.o: function.h
-function.o: $(RUBY_EXTCONF_H)
-function.o: $(arch_hdrdir)/ruby/config.h
-function.o: $(hdrdir)/ruby/backward.h
-function.o: $(hdrdir)/ruby/defines.h
-function.o: $(hdrdir)/ruby/intern.h
-function.o: $(hdrdir)/ruby/missing.h
-function.o: $(hdrdir)/ruby/ruby.h
-function.o: $(hdrdir)/ruby/st.h
-function.o: $(hdrdir)/ruby/subst.h
-function.o: $(hdrdir)/ruby/thread.h
-function.o: $(top_srcdir)/include/ruby.h
-function.o: closure.h
-function.o: conversions.h
-function.o: fiddle.h
-function.o: function.c
-function.o: function.h
-handle.o: $(RUBY_EXTCONF_H)
-handle.o: $(arch_hdrdir)/ruby/config.h
-handle.o: $(hdrdir)/ruby/backward.h
-handle.o: $(hdrdir)/ruby/defines.h
-handle.o: $(hdrdir)/ruby/intern.h
-handle.o: $(hdrdir)/ruby/missing.h
-handle.o: $(hdrdir)/ruby/ruby.h
-handle.o: $(hdrdir)/ruby/st.h
-handle.o: $(hdrdir)/ruby/subst.h
-handle.o: $(top_srcdir)/include/ruby.h
-handle.o: closure.h
-handle.o: conversions.h
-handle.o: fiddle.h
-handle.o: function.h
-handle.o: handle.c
-pointer.o: $(RUBY_EXTCONF_H)
-pointer.o: $(arch_hdrdir)/ruby/config.h
-pointer.o: $(hdrdir)/ruby/backward.h
-pointer.o: $(hdrdir)/ruby/defines.h
-pointer.o: $(hdrdir)/ruby/encoding.h
-pointer.o: $(hdrdir)/ruby/intern.h
-pointer.o: $(hdrdir)/ruby/io.h
-pointer.o: $(hdrdir)/ruby/missing.h
-pointer.o: $(hdrdir)/ruby/onigmo.h
-pointer.o: $(hdrdir)/ruby/oniguruma.h
-pointer.o: $(hdrdir)/ruby/ruby.h
-pointer.o: $(hdrdir)/ruby/st.h
-pointer.o: $(hdrdir)/ruby/subst.h
-pointer.o: $(top_srcdir)/include/ruby.h
-pointer.o: closure.h
-pointer.o: conversions.h
-pointer.o: fiddle.h
-pointer.o: function.h
-pointer.o: pointer.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2c333001e5..466d77e6dd 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -1,111 +1,26 @@
-# frozen_string_literal: true
require 'mkmf'
# :stopdoc:
-bundle = enable_config('bundled-libffi')
-if ! bundle
- dir_config 'libffi'
+dir_config 'libffi'
- pkg_config("libffi") and
- ver = pkg_config("libffi", "modversion")
+pkg_config("libffi")
+if ver = pkg_config("libffi", "modversion")
+ 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
- if have_header(ffi_header = 'ffi.h')
- true
- elsif have_header(ffi_header = 'ffi/ffi.h')
+unless have_header('ffi.h')
+ if have_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
- 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)".dup, 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}".dup)
- 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)".dup, 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
+ raise "ffi.h is missing. Please install libffi."
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
-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 }})
+unless have_library('ffi') || have_library('libffi')
+ raise "libffi is missing. Please install libffi."
end
have_header 'sys/mman.h'
@@ -124,7 +39,7 @@ elsif have_header "windows.h"
end
end
-have_const('FFI_STDCALL', ffi_header)
+have_const('FFI_STDCALL', 'ffi.h') || have_const('FFI_STDCALL', 'ffi/ffi.h')
config = File.read(RbConfig.expand(File.join($arch_hdrdir, "ruby/config.h")))
types = {"SIZE_T"=>"SSIZE_T", "PTRDIFF_T"=>nil, "INTPTR_T"=>nil}
@@ -140,44 +55,6 @@ types.each do |type, signed|
end
end
-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_arg = "-C $(LIBFFI_DIR)\n"
- else
- submake_pre = "cd $(LIBFFI_DIR) && #{config_string("exec")}".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_PRE = #{submake_pre}
- SUBMAKE_ARG = #{submake_arg}
- LIBFFI_CLEAN = libffi
- MK
-end
-
-if libffi
- $LIBPATH.pop
-end
+create_makefile 'fiddle'
# :startdoc:
diff --git a/ext/fiddle/extlibs b/ext/fiddle/extlibs
deleted file mode 100644
index 290b814590..0000000000
--- a/ext/fiddle/extlibs
+++ /dev/null
@@ -1,5 +0,0 @@
-http://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz \
- md5:83b89587607e3eb65c70d361f13bab43 \
- sha512:980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 \
- #
- win32/libffi-3.2.1-mswin.patch -p0
diff --git a/ext/fiddle/fiddle.gemspec b/ext/fiddle/fiddle.gemspec
deleted file mode 100644
index b29f4ec788..0000000000
--- a/ext/fiddle/fiddle.gemspec
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |spec|
- spec.name = "fiddle"
- spec.version = '1.0.0'
- spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
- spec.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"]
-
- spec.summary = %q{A libffi wrapper for Ruby.}
- spec.description = %q{A libffi wrapper for Ruby.}
- spec.homepage = "https://github.com/ruby/fiddle"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/fiddle/closure.c", "ext/fiddle/closure.h", "ext/fiddle/conversions.c", "ext/fiddle/conversions.h", "ext/fiddle/extconf.rb", "ext/fiddle/extlibs", "ext/fiddle/fiddle.c", "ext/fiddle/fiddle.h", "ext/fiddle/function.c", "ext/fiddle/function.h", "ext/fiddle/handle.c", "ext/fiddle/pointer.c", "ext/fiddle/win32/fficonfig.h", "ext/fiddle/win32/libffi-3.2.1-mswin.patch", "ext/fiddle/win32/libffi-config.rb", "ext/fiddle/win32/libffi.mk.tmpl", "fiddle.gemspec", "lib/fiddle.rb", "lib/fiddle/closure.rb", "lib/fiddle/cparser.rb", "lib/fiddle/function.rb", "lib/fiddle/import.rb", "lib/fiddle/pack.rb", "lib/fiddle/struct.rb", "lib/fiddle/types.rb", "lib/fiddle/value.rb"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "rake-compiler"
-end
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h
index d2583c1cbf..b37c37bc65 100644
--- a/ext/fiddle/fiddle.h
+++ b/ext/fiddle/fiddle.h
@@ -104,6 +104,11 @@
#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 8e280567db..50366bb87f 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -1,5 +1,4 @@
#include <fiddle.h>
-#include <ruby/thread.h>
#ifdef PRIsVALUE
# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
@@ -15,16 +14,12 @@ 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)", \
+ name" is so large that it can cause integer overflow (%d)", \
(len)); \
}
@@ -42,11 +37,12 @@ function_memsize(const void *p)
/* const */ffi_cif *ptr = (ffi_cif *)p;
size_t size = 0;
- size += sizeof(*ptr);
+ if (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;
}
@@ -91,34 +87,16 @@ static VALUE
initialize(int argc, VALUE argv[], VALUE self)
{
ffi_cif * cif;
- ffi_type **arg_types, *rtype;
+ ffi_type **arg_types;
ffi_status result;
- VALUE ptr, args, ret_type, abi, kwds, ary;
- int i, len;
- int nabi;
- void *cfunc;
+ VALUE ptr, args, ret_type, abi, kwds;
+ int i;
rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds);
- 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);
+ if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI);
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);
+ Check_Max_Args("args", RARRAY_LENINT(args));
rb_iv_set(self, "@ptr", ptr);
rb_iv_set(self, "@args", args);
@@ -129,15 +107,20 @@ initialize(int argc, VALUE argv[], VALUE self)
TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);
- arg_types = xcalloc(len + 1, sizeof(ffi_type *));
+ arg_types = xcalloc(RARRAY_LEN(args) + 1, sizeof(ffi_type *));
for (i = 0; i < RARRAY_LEN(args); i++) {
- int type = NUM2INT(RARRAY_AREF(args, i));
+ int type = NUM2INT(RARRAY_PTR(args)[i]);
arg_types[i] = INT2FFI_TYPE(type);
}
- arg_types[len] = NULL;
+ arg_types[RARRAY_LEN(args)] = NULL;
- result = ffi_prep_cif(cif, nabi, len, rtype, arg_types);
+ result = ffi_prep_cif (
+ cif,
+ NUM2INT(abi),
+ RARRAY_LENINT(args),
+ INT2FFI_TYPE(NUM2INT(ret_type)),
+ arg_types);
if (result)
rb_raise(rb_eRuntimeError, "error creating CIF %d", result);
@@ -145,28 +128,13 @@ 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)
{
- struct nogvl_ffi_call_args args = { 0 };
+ ffi_cif * cif;
+ fiddle_generic retval;
fiddle_generic *generic_args;
+ void **values;
VALUE cfunc, types, cPointer;
int i;
VALUE alloc_buffer = 0;
@@ -176,11 +144,12 @@ function_call(int argc, VALUE argv[], VALUE self)
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
Check_Max_Args("number of arguments", argc);
- if (argc != (i = RARRAY_LENINT(types))) {
- rb_error_arity(argc, i, i);
+ if(argc != RARRAY_LENINT(types)) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
+ argc, RARRAY_LENINT(types));
}
- TypedData_Get_Struct(self, ffi_cif, &function_data_type, args.cif);
+ TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);
if (rb_safe_level() >= 1) {
for (i = 0; i < argc; i++) {
@@ -193,15 +162,13 @@ function_call(int argc, VALUE argv[], VALUE self)
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));
+ values = (void **)((char *)generic_args + (size_t)argc * sizeof(fiddle_generic));
for (i = 0; i < argc; i++) {
- VALUE type = RARRAY_AREF(types, i);
+ VALUE type = RARRAY_PTR(types)[i];
VALUE src = argv[i];
- int argtype = FIX2INT(type);
- if (argtype == TYPE_VOIDP) {
+ if(NUM2INT(type) == TYPE_VOIDP) {
if(NIL_P(src)) {
src = INT2FIX(0);
} else if(cPointer != CLASS_OF(src)) {
@@ -210,13 +177,12 @@ function_call(int argc, VALUE argv[], VALUE self)
src = rb_Integer(src);
}
- VALUE2GENERIC(argtype, src, &generic_args[i]);
- args.values[i] = (void *)&generic_args[i];
+ VALUE2GENERIC(NUM2INT(type), src, &generic_args[i]);
+ values[i] = (void *)&generic_args[i];
}
- args.values[argc] = NULL;
- args.fn = NUM2PTR(cfunc);
+ values[argc] = NULL;
- (void)rb_thread_call_without_gvl(nogvl_ffi_call, &args, 0, 0);
+ ffi_call(cif, NUM2PTR(rb_Integer(cfunc)), &retval, values);
rb_funcall(mFiddle, rb_intern("last_error="), 1, INT2NUM(errno));
#if defined(_WIN32)
@@ -225,7 +191,7 @@ function_call(int argc, VALUE argv[], VALUE self)
ALLOCV_END(alloc_buffer);
- return GENERIC2VALUE(rb_iv_get(self, "@return_type"), args.retval);
+ return GENERIC2VALUE(rb_iv_get(self, "@return_type"), retval);
}
void
@@ -258,7 +224,7 @@ Init_fiddle_function(void)
*
* === ABI check
*
- * @libc = Fiddle.dlopen "/lib/libc.so.6"
+ * @libc = DL.dlopen "/lib/libc.so.6"
* #=> #<Fiddle::Handle:0x00000001d7a8d8>
* f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
* #=> #<Fiddle::Function:0x00000001d8ee00>
@@ -290,9 +256,7 @@ Init_fiddle_function(void)
/*
* Document-method: call
*
- * 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.
+ * Calls the constructed Function, with +args+
*
* For an example see Fiddle::Function
*
diff --git a/ext/fiddle/function.h b/ext/fiddle/function.h
index 829e592c8a..e5465ab64f 100644
--- a/ext/fiddle/function.h
+++ b/ext/fiddle/function.h
@@ -3,6 +3,6 @@
#include <fiddle.h>
-void Init_fiddle_function(void);
+void Init_fiddle_function();
#endif
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index e727ccfd00..36970a2248 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -1,8 +1,6 @@
#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 {
@@ -48,7 +46,7 @@ fiddle_handle_free(void *ptr)
static size_t
fiddle_handle_memsize(const void *ptr)
{
- return sizeof(struct dl_handle);
+ return ptr ? sizeof(struct dl_handle) : 0;
}
static const rb_data_type_t fiddle_handle_data_type = {
@@ -145,17 +143,19 @@ rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 1:
- clib = NIL_P(lib) ? NULL : SafeStringValueCStr(lib);
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 2:
- clib = NIL_P(lib) ? NULL : SafeStringValueCStr(lib);
+ clib = NIL_P(lib) ? NULL : StringValuePtr(lib);
cflag = NUM2INT(flag);
break;
default:
rb_bug("rb_fiddle_handle_new");
}
+ rb_secure(2);
+
#if defined(_WIN32)
if( !clib ){
HANDLE rb_libruby_handle(void);
@@ -170,7 +170,6 @@ 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
}
@@ -264,7 +263,7 @@ rb_fiddle_handle_to_i(VALUE self)
return PTR2NUM(fiddle_handle);
}
-static VALUE fiddle_handle_sym(void *handle, VALUE symbol);
+static VALUE fiddle_handle_sym(void *handle, const char *symbol);
/*
* Document-method: sym
@@ -283,7 +282,7 @@ rb_fiddle_handle_sym(VALUE self, VALUE sym)
rb_raise(rb_eFiddleError, "closed handle");
}
- return fiddle_handle_sym(fiddle_handle->ptr, sym);
+ return fiddle_handle_sym(fiddle_handle->ptr, StringValueCStr(sym));
}
#ifndef RTLD_NEXT
@@ -306,21 +305,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, sym);
+ return fiddle_handle_sym(RTLD_NEXT, StringValueCStr(sym));
}
static VALUE
-fiddle_handle_sym(void *handle, VALUE symbol)
+fiddle_handle_sym(void *handle, const char *name)
{
#if defined(HAVE_DLERROR)
const char *err;
-# define CHECK_DLERROR if ((err = dlerror()) != 0) { func = 0; }
+# define CHECK_DLERROR if( err = dlerror() ){ func = 0; }
#else
# define CHECK_DLERROR
#endif
void (*func)();
- const char *name = SafeStringValueCStr(symbol);
+ rb_secure(2);
#ifdef HAVE_DLERROR
dlerror();
#endif
@@ -368,7 +367,7 @@ fiddle_handle_sym(void *handle, VALUE symbol)
}
#endif
if( !func ){
- rb_raise(rb_eFiddleError, "unknown symbol \"%"PRIsVALUE"\"", symbol);
+ rb_raise(rb_eFiddleError, "unknown symbol \"%s\"", name);
}
return PTR2NUM(func);
diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb
index e9aa7e50ae..ae6e299637 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 c865a63c20..beb90ecbe5 100644
--- a/ext/fiddle/lib/fiddle/closure.rb
+++ b/ext/fiddle/lib/fiddle/closure.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Fiddle
class Closure
diff --git a/ext/fiddle/lib/fiddle/cparser.rb b/ext/fiddle/lib/fiddle/cparser.rb
index cd0a64fef5..43fb184a12 100644
--- a/ext/fiddle/lib/fiddle/cparser.rb
+++ b/ext/fiddle/lib/fiddle/cparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Fiddle
# A mixin that provides methods for parsing C struct and prototype signatures.
#
@@ -8,20 +7,13 @@ module Fiddle
# include Fiddle::CParser
# #=> Object
#
- # 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]]
+ # parse_ctype('int increment(int)')
+ # #=> ["increment", Fiddle::TYPE_INT, [Fiddle::TYPE_INT]]
#
module CParser
# Parses a C struct's members
#
# Example:
- # require 'fiddle/import'
#
# include Fiddle::CParser
# #=> Object
@@ -29,33 +21,37 @@ 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 = split_arguments(signature, /[,;]/)
+ if( signature.is_a?(String) )
+ signature = signature.split(/\s*,\s*/)
end
mems = []
tys = []
signature.each{|msig|
- 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}")
+ 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
@@ -67,7 +63,6 @@ module Fiddle
# be looked up.
#
# Example:
- # require 'fiddle/import'
#
# include Fiddle::CParser
# #=> Object
@@ -75,21 +70,22 @@ 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 ||= {}
- 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)}]
+ 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
@@ -104,7 +100,6 @@ module Fiddle
# value will be the C type to be looked up.
#
# Example:
- # require 'fiddle/import'
#
# include Fiddle::CParser
# #=> Object
@@ -112,68 +107,64 @@ module Fiddle
# parse_ctype('int')
# #=> Fiddle::TYPE_INT
#
- # parse_ctype('double diff')
+ # parse_ctype('double')
# #=> Fiddle::TYPE_DOUBLE
#
- # parse_ctype('unsigned char byte')
+ # parse_ctype('unsigned char')
# #=> -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 /^(?:(?:signed\s+)?long\s+long(?:\s+int\s+)?|int64_t)(?:\s+\w+)?$/
+ 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\s+long\s+long(?:\s+int\s+)?|uint64_t)(?:\s+\w+)?$/
+ when "unsigned long long"
if( defined?(TYPE_LONG_LONG) )
return -TYPE_LONG_LONG
else
raise(RuntimeError, "unsupported type: #{ty}")
end
- 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+)?$/
+ when "float"
return TYPE_FLOAT
- when /^double(?:\s+\w+)?$/
+ when "double"
return TYPE_DOUBLE
- when /^size_t(?:\s+\w+)?$/
+ when "size_t"
return TYPE_SIZE_T
- when /^ssize_t(?:\s+\w+)?$/
+ when "ssize_t"
return TYPE_SSIZE_T
- when /^ptrdiff_t(?:\s+\w+)?$/
+ when "ptrdiff_t"
return TYPE_PTRDIFF_T
- when /^intptr_t(?:\s+\w+)?$/
+ when "intptr_t"
return TYPE_INTPTR_T
- when /^uintptr_t(?:\s+\w+)?$/
+ when "uintptr_t"
return TYPE_UINTPTR_T
- when /\*/, /\[[\s\d]*\]/
+ when /\*/, /\[\s*\]/
return TYPE_VOIDP
else
- ty = ty.split(' ', 2)[0]
if( tymap[ty] )
return parse_ctype(tymap[ty], tymap)
else
@@ -181,17 +172,5 @@ 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 dd5e04e417..ab7496e944 100644
--- a/ext/fiddle/lib/fiddle/function.rb
+++ b/ext/fiddle/lib/fiddle/function.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 59ab3ee6f7..34f5d7f81c 100644
--- a/ext/fiddle/lib/fiddle/import.rb
+++ b/ext/fiddle/lib/fiddle/import.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'fiddle'
require 'fiddle/struct'
require 'fiddle/cparser'
@@ -63,9 +62,6 @@ module Fiddle
include CParser
extend Importer
- attr_reader :type_alias
- private :type_alias
-
# Creates an array of handlers for the given +libs+, can be an instance of
# Fiddle::Handle, Fiddle::Importer, or will create a new instance of
# Fiddle::Handle using Fiddle.dlopen
@@ -105,7 +101,7 @@ module Fiddle
def sizeof(ty)
case ty
when String
- ty = parse_ctype(ty, type_alias).abs()
+ ty = parse_ctype(ty, @type_alias).abs()
case ty
when TYPE_CHAR
return SIZEOF_CHAR
@@ -163,7 +159,7 @@ module Fiddle
# Creates a global method from the given C +signature+.
def extern(signature, *opts)
- symname, ctype, argtype = parse_signature(signature, type_alias)
+ 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(/@.+/,'')
@@ -187,7 +183,7 @@ module Fiddle
# Creates a global method from the given C +signature+ using the given
# +opts+ as bind parameters with the given block.
def bind(signature, *opts, &blk)
- name, ctype, argtype = parse_signature(signature, type_alias)
+ name, ctype, argtype = parse_signature(signature, @type_alias)
h = parse_bind_options(opts)
case h[:callback_type]
when :bind, nil
@@ -216,7 +212,7 @@ module Fiddle
#
# MyStruct = struct ['int i', 'char c']
def struct(signature)
- tys, mems = parse_struct_signature(signature, type_alias)
+ tys, mems = parse_struct_signature(signature, @type_alias)
Fiddle::CStructBuilder.create(CStruct, tys, mems)
end
@@ -224,7 +220,7 @@ module Fiddle
#
# MyUnion = union ['int i', 'char c']
def union(signature)
- tys, mems = parse_struct_signature(signature, type_alias)
+ tys, mems = parse_struct_signature(signature, @type_alias)
Fiddle::CStructBuilder.create(CUnion, tys, mems)
end
@@ -260,7 +256,7 @@ module Fiddle
#
# Will raise an error if no handlers are open.
def handler
- (@handler ||= nil) or raise "call dlload before importing symbols and functions"
+ @handler or raise "call dlload before importing symbols and functions"
end
# Returns a new Fiddle::Pointer instance at the memory address of the given
diff --git a/ext/fiddle/lib/fiddle/pack.rb b/ext/fiddle/lib/fiddle/pack.rb
index 3c9e3c8ad7..e4e9542cc0 100644
--- a/ext/fiddle/lib/fiddle/pack.rb
+++ b/ext/fiddle/lib/fiddle/pack.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'fiddle'
module Fiddle
@@ -101,7 +100,7 @@ module Fiddle
private
def parse_types(types)
- @template = "".dup
+ @template = ""
addr = 0
types.each{|t|
orig_addr = addr
diff --git a/ext/fiddle/lib/fiddle/struct.rb b/ext/fiddle/lib/fiddle/struct.rb
index 7c0dedb39f..695a4d2247 100644
--- a/ext/fiddle/lib/fiddle/struct.rb
+++ b/ext/fiddle/lib/fiddle/struct.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 8dc811d3e4..02c1d25a37 100644
--- a/ext/fiddle/lib/fiddle/types.rb
+++ b/ext/fiddle/lib/fiddle/types.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 a043b9b066..8d71e47ce6 100644
--- a/ext/fiddle/lib/fiddle/value.rb
+++ b/ext/fiddle/lib/fiddle/value.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'fiddle'
module Fiddle
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 932bc576c5..a09daf77ea 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -72,7 +72,7 @@ static size_t
fiddle_ptr_memsize(const void *ptr)
{
const struct ptr_data *data = ptr;
- return sizeof(*data) + data->size;
+ return data ? sizeof(*data) + data->size : 0;
}
static const rb_data_type_t fiddle_ptr_data_type = {
diff --git a/ext/fiddle/win32/fficonfig.h b/ext/fiddle/win32/fficonfig.h
deleted file mode 100755
index 776808159c..0000000000
--- a/ext/fiddle/win32/fficonfig.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#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
deleted file mode 100644
index f9100e703d..0000000000
--- a/ext/fiddle/win32/libffi-3.2.1-mswin.patch
+++ /dev/null
@@ -1,191 +0,0 @@
-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
deleted file mode 100755
index 6abc9b2c02..0000000000
--- a/ext/fiddle/win32/libffi-config.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/ruby
-# frozen_string_literal: true
-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
deleted file mode 100755
index 2a16e8efec..0000000000
--- a/ext/fiddle/win32/libffi.mk.tmpl
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- 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/depend b/ext/gdbm/depend
deleted file mode 100644
index 98def40879..0000000000
--- a/ext/gdbm/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-gdbm.o: $(RUBY_EXTCONF_H)
-gdbm.o: $(arch_hdrdir)/ruby/config.h
-gdbm.o: $(hdrdir)/ruby/backward.h
-gdbm.o: $(hdrdir)/ruby/defines.h
-gdbm.o: $(hdrdir)/ruby/intern.h
-gdbm.o: $(hdrdir)/ruby/missing.h
-gdbm.o: $(hdrdir)/ruby/ruby.h
-gdbm.o: $(hdrdir)/ruby/st.h
-gdbm.o: $(hdrdir)/ruby/subst.h
-gdbm.o: $(top_srcdir)/include/ruby.h
-gdbm.o: gdbm.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/gdbm/extconf.rb b/ext/gdbm/extconf.rb
index d1908ffa5c..5a09492e5e 100644
--- a/ext/gdbm/extconf.rb
+++ b/ext/gdbm/extconf.rb
@@ -1,19 +1,7 @@
-# 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 85e2b33f31..851afea497 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -101,7 +101,8 @@ closed_dbm(void)
}
#define GetDBM(obj, dbmp) do {\
- TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\
+ Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ if ((dbmp) == 0) closed_dbm();\
if ((dbmp)->di_dbm == 0) closed_dbm();\
} while (0)
@@ -111,31 +112,14 @@ closed_dbm(void)
} while (0)
static void
-free_dbm(void *ptr)
+free_dbm(struct dbmdata *dbmp)
{
- struct dbmdata *dbmp = ptr;
- if (dbmp->di_dbm)
- gdbm_close(dbmp->di_dbm);
- xfree(dbmp);
-}
-
-static size_t
-memsize_dbm(const void *ptr)
-{
- const struct dbmdata *dbmp = ptr;
- size_t size = sizeof(*dbmp);
- if (dbmp->di_dbm)
- size += DBM_SIZEOF_DBM;
- return size;
+ if (dbmp) {
+ if (dbmp->di_dbm) gdbm_close(dbmp->di_dbm);
+ xfree(dbmp);
+ }
}
-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
@@ -165,7 +149,9 @@ fgdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
+ Data_Get_Struct(obj, struct dbmdata, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -175,9 +161,7 @@ fgdbm_closed(VALUE obj)
static VALUE
fgdbm_s_alloc(VALUE klass)
{
- struct dbmdata *dbmp;
-
- return TypedData_Make_Struct(klass, struct dbmdata, &dbm_type, dbmp);
+ return Data_Wrap_Struct(klass, 0, free_dbm, 0);
}
/*
@@ -211,7 +195,6 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
struct dbmdata *dbmp;
int mode, flags = 0;
- TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
if (rb_scan_args(argc, argv, "12", &file, &vmode, &vflags) == 1) {
mode = 0666; /* default value */
}
@@ -225,7 +208,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
if (!NIL_P(vflags))
flags = NUM2INT(vflags);
- FilePathValue(file);
+ SafeStringValue(file);
#ifdef GDBM_CLOEXEC
/* GDBM_CLOEXEC is available since gdbm 1.10. */
@@ -265,8 +248,9 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
rb_raise(rb_eGDBMError, "%s", gdbm_strerror(gdbm_errno));
}
- if (dbmp->di_dbm)
- gdbm_close(dbmp->di_dbm);
+ dbmp = ALLOC(struct dbmdata);
+ free_dbm(DATA_PTR(obj));
+ DATA_PTR(obj) = dbmp;
dbmp->di_dbm = dbm;
dbmp->di_size = -1;
@@ -295,7 +279,7 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fgdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = fgdbm_s_alloc(klass);
+ VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
if (NIL_P(fgdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -330,7 +314,7 @@ rb_gdbm_fetch2(GDBM_FILE dbm, VALUE keystr)
datum key;
long len;
- ExportStringValue(keystr);
+ StringValue(keystr);
len = RSTRING_LEN(keystr);
if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
@@ -446,7 +430,7 @@ fgdbm_key(VALUE obj, VALUE valstr)
GDBM_FILE dbm;
VALUE keystr, valstr2;
- ExportStringValue(valstr);
+ StringValue(valstr);
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -534,7 +518,7 @@ rb_gdbm_delete(VALUE obj, VALUE keystr)
long len;
rb_gdbm_modify(obj);
- ExportStringValue(keystr);
+ StringValue(keystr);
len = RSTRING_LEN(keystr);
if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
@@ -610,8 +594,7 @@ fgdbm_delete_if(VALUE obj)
GDBM_FILE dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- long i;
- int status = 0, n;
+ int i, status = 0, n;
rb_gdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -630,7 +613,7 @@ fgdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++)
- rb_gdbm_delete(obj, RARRAY_AREF(ary, i));
+ rb_gdbm_delete(obj, RARRAY_PTR(ary)[i]);
if (status) rb_jump_tag(status);
if (n > 0) dbmp->di_size = n - (int)RARRAY_LEN(ary);
rb_ary_clear(ary);
@@ -721,8 +704,8 @@ fgdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
GDBM_FILE dbm;
rb_gdbm_modify(obj);
- ExportStringValue(keystr);
- ExportStringValue(valstr);
+ StringValue(keystr);
+ StringValue(valstr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LENINT(keystr);
@@ -743,13 +726,11 @@ 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]");
}
- ptr = RARRAY_CONST_PTR(pair);
- fgdbm_store(dbm, ptr[0], ptr[1]);
+ fgdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
return Qnil;
}
@@ -987,7 +968,7 @@ fgdbm_has_key(VALUE obj, VALUE keystr)
GDBM_FILE dbm;
long len;
- ExportStringValue(keystr);
+ StringValue(keystr);
len = RSTRING_LENINT(keystr);
if (TOO_LONG(len)) return Qfalse;
key.dptr = RSTRING_PTR(keystr);
@@ -1014,7 +995,7 @@ fgdbm_has_value(VALUE obj, VALUE valstr)
GDBM_FILE dbm;
VALUE keystr, valstr2;
- ExportStringValue(valstr);
+ StringValue(valstr);
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
diff --git a/ext/gdbm/gdbm.gemspec b/ext/gdbm/gdbm.gemspec
deleted file mode 100644
index 753888e4b8..0000000000
--- a/ext/gdbm/gdbm.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "gdbm"
- spec.version = "2.0.0"
- spec.date = '2017-04-28'
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = "Ruby extension for GNU dbm."
- spec.description = "Ruby extension for GNU dbm."
- spec.homepage = "https://github.com/ruby/gdbm"
- spec.license = "BSD-2-Clause"
-
- spec.files = ["ext/gdbm/extconf.rb", "ext/gdbm/gdbm.c"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.extensions = ["ext/gdbm/extconf.rb"]
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler", "~> 1.14"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rake-compiler"
- spec.add_development_dependency "test-unit"
-end
diff --git a/ext/io/console/buildgem.sh b/ext/io/console/buildgem.sh
deleted file mode 100755
index 65fe545e1e..0000000000
--- a/ext/io/console/buildgem.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/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 04cf9e3f9c..de5ca82558 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -3,7 +3,17 @@
* 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>
@@ -14,11 +24,9 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
-#ifndef RARRAY_CONST_PTR
-# define RARRAY_CONST_PTR(ary) RARRAY_PTR(ary)
-#endif
-#ifndef HAVE_RB_FUNCALLV
-# define rb_funcallv rb_funcall2
+
+#ifndef RB_TYPE_P
+#define RB_TYPE_P(obj, type) (TYPE(obj) == type)
#endif
#if defined HAVE_TERMIOS_H
@@ -56,7 +64,11 @@ 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
@@ -79,33 +91,11 @@ getattr(int fd, conmode *t)
#define SET_LAST_ERROR (0)
#endif
-static ID id_getc, id_console, id_close, id_min, id_time;
-#if ENABLE_IO_GETPASS
-static ID id_gets;
+#ifndef InitVM
+#define InitVM(ext) {void InitVM_##ext(void);InitVM_##ext();}
#endif
-#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
-
-#ifndef HAVE_RB_SYM2STR
-# define rb_sym2str(sym) rb_id2str(SYM2ID(sym))
-#endif
+static ID id_getc, id_console;
typedef struct {
int vmin;
@@ -117,10 +107,26 @@ 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(id_min));
- VALUE vtime = rb_hash_aref(vopts, ID2SYM(id_time));
+ VALUE vmin = rb_hash_aref(vopts, ID2SYM(rb_intern("min")));
+ VALUE vtime = rb_hash_aref(vopts, ID2SYM(rb_intern("time")));
/* default values by `stty raw` */
opts->vmin = 1;
opts->vtime = 0;
@@ -226,8 +232,15 @@ 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)
{
@@ -238,6 +251,7 @@ get_write_fd(const rb_io_t *fptr)
return ofptr->fd;
}
#define GetWriteFD(fptr) get_write_fd(fptr)
+#endif
#define FD_PER_IO 2
@@ -290,7 +304,8 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void
}
if (status) {
if (status == -1) {
- rb_syserr_fail(error, 0);
+ errno = error;
+ rb_sys_fail(0);
}
rb_jump_tag(status);
}
@@ -307,14 +322,6 @@ ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void
*
* will read and return a line without echo back and line editing.
*
- * The parameter +min+ specifies the minimum number of bytes that
- * should be received when a read operation is performed. (default: 1)
- *
- * The parameter +time+ specifies the timeout in _seconds_ with a
- * precision of 1/10 of a second. (default: 0)
- *
- * Refer to the manual page of termios for further details.
- *
* You must require 'io/console' to use this method.
*/
static VALUE
@@ -332,8 +339,6 @@ console_raw(int argc, VALUE *argv, VALUE io)
*
* If the terminal mode needs to be back, use io.raw { ... }.
*
- * See IO#raw for details on the parameters.
- *
* You must require 'io/console' to use this method.
*/
static VALUE
@@ -398,7 +403,7 @@ console_set_cooked(VALUE io)
static VALUE
getc_call(VALUE io)
{
- return rb_funcallv(io, id_getc, 0, 0);
+ return rb_funcall2(io, id_getc, 0, 0);
}
/*
@@ -407,8 +412,6 @@ getc_call(VALUE io)
*
* Reads and returns a character in raw mode.
*
- * See IO#raw for details on the parameters.
- *
* You must require 'io/console' to use this method.
*/
static VALUE
@@ -543,25 +546,18 @@ console_set_winsize(VALUE io, VALUE size)
#if defined _WIN32
HANDLE wh;
int newrow, newcol;
- BOOL ret;
#endif
VALUE row, col, xpixel, ypixel;
- const VALUE *sz;
+#if defined TIOCSWINSZ
int fd;
- long sizelen;
+#endif
GetOpenFile(io, fptr);
size = rb_Array(size);
- 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);
+ rb_scan_args((int)RARRAY_LEN(size), RARRAY_PTR(size), "22",
+ &row, &col, &xpixel, &ypixel);
#if defined TIOCSWINSZ
+ fd = GetWriteFD(fptr);
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);
@@ -571,32 +567,24 @@ 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(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");
+ 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");
+ }
+ 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");
+ }
}
- ws.dwSize.X = newcol;
- ret = SetConsoleScreenBufferSize(wh, ws.dwSize);
ws.srWindow.Left = 0;
ws.srWindow.Top = 0;
- ws.srWindow.Right = newcol-1;
- ws.srWindow.Bottom = newrow-1;
- if (!SetConsoleWindowInfo(wh, TRUE, &ws.srWindow)) {
- rb_syserr_fail(LAST_ERROR, "SetConsoleWindowInfo");
- }
- /* retry when shrinking buffer after shrunk window */
- if (!ret && !SetConsoleScreenBufferSize(wh, ws.dwSize)) {
- rb_syserr_fail(LAST_ERROR, "SetConsoleScreenBufferInfo");
- }
- /* remove scrollbar if possible */
- if (!SetConsoleWindowInfo(wh, TRUE, &ws.srWindow)) {
- rb_syserr_fail(LAST_ERROR, "SetConsoleWindowInfo");
+ ws.srWindow.Right = newcol;
+ ws.srWindow.Bottom = newrow;
+ if (!(SetConsoleWindowInfo(wh, FALSE, &ws.srWindow) || SET_LAST_ERROR)) {
+ rb_sys_fail("SetConsoleWindowInfo");
}
#endif
return io;
@@ -680,143 +668,30 @@ 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;
- const char *kn;
- if (SYMBOL_P(k)) {
- k = rb_sym2str(k);
- kn = RSTRING_PTR(k);
- }
- else {
- kn = StringValuePtr(k);
- }
- t = console_win32_vk(kn, 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(int argc, VALUE *argv, VALUE klass)
+console_dev(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) ||
- (!(fptr = RFILE(con)->fptr) || GetReadFD(fptr) == -1)) {
- rb_const_remove(klass, id_console);
- con = 0;
- }
- }
- 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 (RB_TYPE_P(con, T_FILE)) {
+ if ((fptr = RFILE(con)->fptr) && GetReadFD(fptr) != -1)
+ return con;
}
+ rb_mod_remove_const(klass, ID2SYM(id_console));
}
- if (!con) {
+ {
VALUE args[2];
#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H || defined HAVE_SGTTY_H
# define CONSOLE_DEVICE "/dev/tty"
@@ -854,19 +729,25 @@ console_dev(int argc, VALUE *argv, 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;
}
@@ -879,101 +760,17 @@ console_dev(int argc, VALUE *argv, VALUE klass)
static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{
- return rb_funcallv(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);
+ return rb_funcall2(io, rb_intern("getc"), argc, argv);
}
/*
- * 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);
}
@@ -993,20 +790,9 @@ 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_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);
+ rb_define_singleton_method(rb_cIO, "console", console_dev, 0);
{
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 821b28d3fc..e786dc71d2 100644
--- a/ext/io/console/depend
+++ b/ext/io/console/depend
@@ -1,37 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-console.o: $(RUBY_EXTCONF_H)
-console.o: $(arch_hdrdir)/ruby/config.h
-console.o: $(hdrdir)/ruby/backward.h
-console.o: $(hdrdir)/ruby/defines.h
-console.o: $(hdrdir)/ruby/encoding.h
-console.o: $(hdrdir)/ruby/intern.h
-console.o: $(hdrdir)/ruby/io.h
-console.o: $(hdrdir)/ruby/missing.h
-console.o: $(hdrdir)/ruby/onigmo.h
-console.o: $(hdrdir)/ruby/oniguruma.h
-console.o: $(hdrdir)/ruby/ruby.h
-console.o: $(hdrdir)/ruby/st.h
-console.o: $(hdrdir)/ruby/subst.h
-console.o: $(top_srcdir)/include/ruby.h
-console.o: console.c
-# AUTOGENERATED DEPENDENCIES END
-
-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 -f $(top_srcdir)/tool/gperf.sed \
- ) > $(@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)
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb
index be536dff9f..bbd1235986 100644
--- a/ext/io/console/extconf.rb
+++ b/ext/io/console/extconf.rb
@@ -1,13 +1,10 @@
-# frozen_string_literal: false
require 'mkmf'
ok = true
hdr = nil
case
when macro_defined?("_WIN32", "")
- # 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}"
+ have_func("rb_w32_map_errno", "ruby.h")
when hdr = %w"termios.h termio.h".find {|h| have_header(h)}
have_func("cfmakeraw", hdr)
when have_header(hdr = "sgtty.h")
@@ -15,15 +12,15 @@ 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") if hdr
- have_func("rb_funcallv")
- have_func("rb_sym2str")
- # 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"
- }
+ 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")
end
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index 1256162468..f71e1b9b8f 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -1,5 +1,5 @@
# -*- ruby -*-
-_VERSION = "0.4.6"
+_VERSION = "0.4.2"
date = %w$Date:: $[1]
Gem::Specification.new do |s|
@@ -10,15 +10,12 @@ Gem::Specification.new do |s|
s.email = "nobu@ruby-lang.org"
s.description = "add console capabilities to IO instances."
s.required_ruby_version = ">= 2.0.0"
- s.homepage = "https://github.com/ruby/io-console"
+ s.homepage = "http://www.ruby-lang.org"
s.authors = ["Nobu Nakada"]
- s.require_path = %[lib]
- s.files = %w[ext/io/console/console.c ext/io/console/extconf.rb lib/console/size.rb ext/io/console/win32_vk.inc]
- s.extensions = %w[ext/io/console/extconf.rb]
- s.license = "BSD-2-Clause"
+ s.require_path = %[.]
+ s.files = %w[console.c extconf.rb lib/console/size.rb]
+ s.extensions = %w[extconf.rb]
+ s.licenses = "ruby"
s.cert_chain = %w[certs/nobu.pem]
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
-
- s.add_development_dependency 'rake-compiler'
- s.add_development_dependency 'rake-compiler-dock', ">= 0.6.1"
end
diff --git a/ext/io/console/lib/console/size.rb b/ext/io/console/lib/console/size.rb
index 14b9a74b22..519bc3be6d 100644
--- a/ext/io/console/lib/console/size.rb
+++ b/ext/io/console/lib/console/size.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# fallback to console window size
def IO.default_console_size
[
@@ -10,7 +9,7 @@ end
begin
require 'io/console'
rescue LoadError
- class << IO
+ class IO
alias console_size default_console_size
end
else
diff --git a/ext/io/console/win32_vk.chksum b/ext/io/console/win32_vk.chksum
deleted file mode 100644
index bc9fff7560..0000000000
--- a/ext/io/console/win32_vk.chksum
+++ /dev/null
@@ -1 +0,0 @@
-src="win32_vk.list", len=3269, checksum=34076
diff --git a/ext/io/console/win32_vk.inc b/ext/io/console/win32_vk.inc
deleted file mode 100644
index cbec7bef15..0000000000
--- a/ext/io/console/win32_vk.inc
+++ /dev/null
@@ -1,1391 +0,0 @@
-#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
-/* ANSI-C code produced by gperf version 3.1 */
-/* 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-gperf@gnu.org>."
-#endif
-
-#define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)
-#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 (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
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (register const char *str, register size_t 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 unsigned int hval = (unsigned int)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 (unsigned int)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)
-const struct vktable *
-console_win32_vk (register const char *str, register size_t 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"
- {gperf_offsetof(stringpool, 12), VK_UP},
-#line 52 "win32_vk.list"
- {gperf_offsetof(stringpool, 13), VK_APPS},
-#line 159 "win32_vk.list"
- {gperf_offsetof(stringpool, 14), VK_CRSEL},
-#line 34 "win32_vk.list"
- {gperf_offsetof(stringpool, 15), VK_SPACE},
-#line 95 "win32_vk.list"
- {gperf_offsetof(stringpool, 16), VK_SCROLL},
-#line 29 "win32_vk.list"
- {gperf_offsetof(stringpool, 17), VK_ESCAPE},
-#line 9 "win32_vk.list"
- {gperf_offsetof(stringpool, 18), VK_CANCEL},
-#line 32 "win32_vk.list"
- {gperf_offsetof(stringpool, 19), VK_ACCEPT},
-#line 66 "win32_vk.list"
- {gperf_offsetof(stringpool, 20), VK_SEPARATOR},
-#line 43 "win32_vk.list"
- {gperf_offsetof(stringpool, 21), VK_SELECT},
-#line 18 "win32_vk.list"
- {gperf_offsetof(stringpool, 22), VK_CONTROL},
-#line 166 "win32_vk.list"
- {gperf_offsetof(stringpool, 23), VK_OEM_CLEAR},
-#line 145 "win32_vk.list"
- {gperf_offsetof(stringpool, 24), VK_OEM_RESET},
-#line 155 "win32_vk.list"
- {gperf_offsetof(stringpool, 25), VK_OEM_AUTO},
-#line 151 "win32_vk.list"
- {gperf_offsetof(stringpool, 26), VK_OEM_CUSEL},
- {-1},
-#line 22 "win32_vk.list"
- {gperf_offsetof(stringpool, 28), VK_KANA},
-#line 127 "win32_vk.list"
- {gperf_offsetof(stringpool, 29), VK_OEM_PLUS},
-#line 35 "win32_vk.list"
- {gperf_offsetof(stringpool, 30), VK_PRIOR},
-#line 152 "win32_vk.list"
- {gperf_offsetof(stringpool, 31), VK_OEM_ATTN},
-#line 20 "win32_vk.list"
- {gperf_offsetof(stringpool, 32), VK_PAUSE},
-#line 13 "win32_vk.list"
- {gperf_offsetof(stringpool, 33), VK_BACK},
-#line 144 "win32_vk.list"
- {gperf_offsetof(stringpool, 34), VK_PACKET},
-#line 105 "win32_vk.list"
- {gperf_offsetof(stringpool, 35), VK_RCONTROL},
-#line 104 "win32_vk.list"
- {gperf_offsetof(stringpool, 36), VK_LCONTROL},
-#line 37 "win32_vk.list"
- {gperf_offsetof(stringpool, 37), VK_END},
-#line 38 "win32_vk.list"
- {gperf_offsetof(stringpool, 38), VK_HOME},
-#line 44 "win32_vk.list"
- {gperf_offsetof(stringpool, 39), VK_PRINT},
-#line 94 "win32_vk.list"
- {gperf_offsetof(stringpool, 40), VK_NUMLOCK},
-#line 39 "win32_vk.list"
- {gperf_offsetof(stringpool, 41), VK_LEFT},
-#line 25 "win32_vk.list"
- {gperf_offsetof(stringpool, 42), VK_JUNJA},
-#line 19 "win32_vk.list"
- {gperf_offsetof(stringpool, 43), VK_MENU},
-#line 150 "win32_vk.list"
- {gperf_offsetof(stringpool, 44), VK_OEM_WSCTRL},
-#line 156 "win32_vk.list"
- {gperf_offsetof(stringpool, 45), VK_OEM_ENLW},
-#line 36 "win32_vk.list"
- {gperf_offsetof(stringpool, 46), VK_NEXT},
-#line 51 "win32_vk.list"
- {gperf_offsetof(stringpool, 47), VK_RWIN},
-#line 50 "win32_vk.list"
- {gperf_offsetof(stringpool, 48), VK_LWIN},
-#line 21 "win32_vk.list"
- {gperf_offsetof(stringpool, 49), VK_CAPITAL},
-#line 49 "win32_vk.list"
- {gperf_offsetof(stringpool, 50), VK_HELP},
-#line 164 "win32_vk.list"
- {gperf_offsetof(stringpool, 51), VK_NONAME},
-#line 8 "win32_vk.list"
- {gperf_offsetof(stringpool, 52), VK_RBUTTON},
-#line 7 "win32_vk.list"
- {gperf_offsetof(stringpool, 53), VK_LBUTTON},
-#line 96 "win32_vk.list"
- {gperf_offsetof(stringpool, 54), VK_OEM_NEC_EQUAL},
- {-1},
-#line 47 "win32_vk.list"
- {gperf_offsetof(stringpool, 56), VK_INSERT},
-#line 27 "win32_vk.list"
- {gperf_offsetof(stringpool, 57), VK_HANJA},
- {-1}, {-1},
-#line 46 "win32_vk.list"
- {gperf_offsetof(stringpool, 60), VK_SNAPSHOT},
-#line 158 "win32_vk.list"
- {gperf_offsetof(stringpool, 61), VK_ATTN},
-#line 14 "win32_vk.list"
- {gperf_offsetof(stringpool, 62), VK_TAB},
-#line 157 "win32_vk.list"
- {gperf_offsetof(stringpool, 63), VK_OEM_BACKTAB},
-#line 143 "win32_vk.list"
- {gperf_offsetof(stringpool, 64), VK_ICO_CLEAR},
-#line 30 "win32_vk.list"
- {gperf_offsetof(stringpool, 65), VK_CONVERT},
-#line 16 "win32_vk.list"
- {gperf_offsetof(stringpool, 66), VK_RETURN},
-#line 146 "win32_vk.list"
- {gperf_offsetof(stringpool, 67), VK_OEM_JUMP},
- {-1}, {-1}, {-1},
-#line 111 "win32_vk.list"
- {gperf_offsetof(stringpool, 71), VK_BROWSER_STOP},
-#line 26 "win32_vk.list"
- {gperf_offsetof(stringpool, 72), VK_FINAL},
-#line 163 "win32_vk.list"
- {gperf_offsetof(stringpool, 73), VK_ZOOM},
-#line 28 "win32_vk.list"
- {gperf_offsetof(stringpool, 74), VK_KANJI},
-#line 48 "win32_vk.list"
- {gperf_offsetof(stringpool, 75), VK_DELETE},
-#line 128 "win32_vk.list"
- {gperf_offsetof(stringpool, 76), VK_OEM_COMMA},
-#line 67 "win32_vk.list"
- {gperf_offsetof(stringpool, 77), VK_SUBTRACT},
- {-1},
-#line 10 "win32_vk.list"
- {gperf_offsetof(stringpool, 79), VK_MBUTTON},
-#line 78 "win32_vk.list"
- {gperf_offsetof(stringpool, 80), VK_F9},
-#line 17 "win32_vk.list"
- {gperf_offsetof(stringpool, 81), VK_SHIFT},
-#line 103 "win32_vk.list"
- {gperf_offsetof(stringpool, 82), VK_RSHIFT},
-#line 102 "win32_vk.list"
- {gperf_offsetof(stringpool, 83), VK_LSHIFT},
-#line 65 "win32_vk.list"
- {gperf_offsetof(stringpool, 84), VK_ADD},
-#line 31 "win32_vk.list"
- {gperf_offsetof(stringpool, 85), VK_NONCONVERT},
-#line 160 "win32_vk.list"
- {gperf_offsetof(stringpool, 86), VK_EXSEL},
-#line 126 "win32_vk.list"
- {gperf_offsetof(stringpool, 87), VK_OEM_1},
-#line 138 "win32_vk.list"
- {gperf_offsetof(stringpool, 88), VK_OEM_AX},
-#line 108 "win32_vk.list"
- {gperf_offsetof(stringpool, 89), VK_BROWSER_BACK},
-#line 137 "win32_vk.list"
- {gperf_offsetof(stringpool, 90), VK_OEM_8},
-#line 129 "win32_vk.list"
- {gperf_offsetof(stringpool, 91), VK_OEM_MINUS},
-#line 162 "win32_vk.list"
- {gperf_offsetof(stringpool, 92), VK_PLAY},
-#line 131 "win32_vk.list"
- {gperf_offsetof(stringpool, 93), VK_OEM_2},
-#line 15 "win32_vk.list"
- {gperf_offsetof(stringpool, 94), VK_CLEAR},
-#line 99 "win32_vk.list"
- {gperf_offsetof(stringpool, 95), VK_OEM_FJ_TOUROKU},
-#line 147 "win32_vk.list"
- {gperf_offsetof(stringpool, 96), VK_OEM_PA1},
-#line 140 "win32_vk.list"
- {gperf_offsetof(stringpool, 97), VK_ICO_HELP},
-#line 112 "win32_vk.list"
- {gperf_offsetof(stringpool, 98), VK_BROWSER_SEARCH},
-#line 53 "win32_vk.list"
- {gperf_offsetof(stringpool, 99), VK_SLEEP},
- {-1},
-#line 70 "win32_vk.list"
- {gperf_offsetof(stringpool, 101), VK_F1},
-#line 148 "win32_vk.list"
- {gperf_offsetof(stringpool, 102), VK_OEM_PA2},
-#line 154 "win32_vk.list"
- {gperf_offsetof(stringpool, 103), VK_OEM_COPY},
-#line 77 "win32_vk.list"
- {gperf_offsetof(stringpool, 104), VK_F8},
-#line 88 "win32_vk.list"
- {gperf_offsetof(stringpool, 105), VK_F19},
-#line 41 "win32_vk.list"
- {gperf_offsetof(stringpool, 106), VK_RIGHT},
-#line 71 "win32_vk.list"
- {gperf_offsetof(stringpool, 107), VK_F2},
-#line 135 "win32_vk.list"
- {gperf_offsetof(stringpool, 108), VK_OEM_6},
-#line 87 "win32_vk.list"
- {gperf_offsetof(stringpool, 109), VK_F18},
- {-1},
-#line 117 "win32_vk.list"
- {gperf_offsetof(stringpool, 111), VK_VOLUME_UP},
- {-1}, {-1},
-#line 120 "win32_vk.list"
- {gperf_offsetof(stringpool, 114), VK_MEDIA_STOP},
-#line 130 "win32_vk.list"
- {gperf_offsetof(stringpool, 115), VK_OEM_PERIOD},
- {-1},
-#line 161 "win32_vk.list"
- {gperf_offsetof(stringpool, 117), VK_EREOF},
- {-1}, {-1}, {-1},
-#line 114 "win32_vk.list"
- {gperf_offsetof(stringpool, 121), VK_BROWSER_HOME},
-#line 75 "win32_vk.list"
- {gperf_offsetof(stringpool, 122), VK_F6},
- {-1},
-#line 110 "win32_vk.list"
- {gperf_offsetof(stringpool, 124), VK_BROWSER_REFRESH},
- {-1},
-#line 165 "win32_vk.list"
- {gperf_offsetof(stringpool, 126), VK_PA1},
-#line 142 "win32_vk.list"
- {gperf_offsetof(stringpool, 127), VK_PROCESSKEY},
-#line 68 "win32_vk.list"
- {gperf_offsetof(stringpool, 128), VK_DECIMAL},
-#line 132 "win32_vk.list"
- {gperf_offsetof(stringpool, 129), VK_OEM_3},
-#line 107 "win32_vk.list"
- {gperf_offsetof(stringpool, 130), VK_RMENU},
-#line 106 "win32_vk.list"
- {gperf_offsetof(stringpool, 131), VK_LMENU},
-#line 98 "win32_vk.list"
- {gperf_offsetof(stringpool, 132), VK_OEM_FJ_MASSHOU},
-#line 54 "win32_vk.list"
- {gperf_offsetof(stringpool, 133), VK_NUMPAD0},
-#line 24 "win32_vk.list"
- {gperf_offsetof(stringpool, 134), VK_HANGUL},
-#line 63 "win32_vk.list"
- {gperf_offsetof(stringpool, 135), VK_NUMPAD9},
-#line 23 "win32_vk.list"
- {gperf_offsetof(stringpool, 136), VK_HANGEUL},
-#line 134 "win32_vk.list"
- {gperf_offsetof(stringpool, 137), VK_OEM_5},
-#line 149 "win32_vk.list"
- {gperf_offsetof(stringpool, 138), VK_OEM_PA3},
-#line 115 "win32_vk.list"
- {gperf_offsetof(stringpool, 139), VK_VOLUME_MUTE},
-#line 133 "win32_vk.list"
- {gperf_offsetof(stringpool, 140), VK_OEM_4},
-#line 122 "win32_vk.list"
- {gperf_offsetof(stringpool, 141), VK_LAUNCH_MAIL},
-#line 97 "win32_vk.list"
- {gperf_offsetof(stringpool, 142), VK_OEM_FJ_JISHO},
-#line 72 "win32_vk.list"
- {gperf_offsetof(stringpool, 143), VK_F3},
-#line 101 "win32_vk.list"
- {gperf_offsetof(stringpool, 144), VK_OEM_FJ_ROYA},
-#line 100 "win32_vk.list"
- {gperf_offsetof(stringpool, 145), VK_OEM_FJ_LOYA},
- {-1},
-#line 42 "win32_vk.list"
- {gperf_offsetof(stringpool, 147), VK_DOWN},
- {-1},
-#line 153 "win32_vk.list"
- {gperf_offsetof(stringpool, 149), VK_OEM_FINISH},
- {-1},
-#line 74 "win32_vk.list"
- {gperf_offsetof(stringpool, 151), VK_F5},
- {-1},
-#line 136 "win32_vk.list"
- {gperf_offsetof(stringpool, 153), VK_OEM_7},
-#line 73 "win32_vk.list"
- {gperf_offsetof(stringpool, 154), VK_F4},
-#line 86 "win32_vk.list"
- {gperf_offsetof(stringpool, 155), VK_F17},
-#line 55 "win32_vk.list"
- {gperf_offsetof(stringpool, 156), VK_NUMPAD1},
-#line 141 "win32_vk.list"
- {gperf_offsetof(stringpool, 157), VK_ICO_00},
- {-1},
-#line 62 "win32_vk.list"
- {gperf_offsetof(stringpool, 159), VK_NUMPAD8},
- {-1}, {-1},
-#line 56 "win32_vk.list"
- {gperf_offsetof(stringpool, 162), VK_NUMPAD2},
- {-1},
-#line 124 "win32_vk.list"
- {gperf_offsetof(stringpool, 164), VK_LAUNCH_APP1},
-#line 109 "win32_vk.list"
- {gperf_offsetof(stringpool, 165), VK_BROWSER_FORWARD},
- {-1},
-#line 76 "win32_vk.list"
- {gperf_offsetof(stringpool, 167), VK_F7},
- {-1}, {-1},
-#line 125 "win32_vk.list"
- {gperf_offsetof(stringpool, 170), VK_LAUNCH_APP2},
-#line 64 "win32_vk.list"
- {gperf_offsetof(stringpool, 171), VK_MULTIPLY},
- {-1}, {-1},
-#line 45 "win32_vk.list"
- {gperf_offsetof(stringpool, 174), VK_EXECUTE},
- {-1},
-#line 113 "win32_vk.list"
- {gperf_offsetof(stringpool, 176), VK_BROWSER_FAVORITES},
-#line 60 "win32_vk.list"
- {gperf_offsetof(stringpool, 177), VK_NUMPAD6},
- {-1},
-#line 85 "win32_vk.list"
- {gperf_offsetof(stringpool, 179), VK_F16},
- {-1}, {-1},
-#line 79 "win32_vk.list"
- {gperf_offsetof(stringpool, 182), VK_F10},
- {-1}, {-1},
-#line 116 "win32_vk.list"
- {gperf_offsetof(stringpool, 185), VK_VOLUME_DOWN},
- {-1}, {-1},
-#line 89 "win32_vk.list"
- {gperf_offsetof(stringpool, 188), VK_F20},
-#line 119 "win32_vk.list"
- {gperf_offsetof(stringpool, 189), VK_MEDIA_PREV_TRACK},
- {-1},
-#line 33 "win32_vk.list"
- {gperf_offsetof(stringpool, 191), VK_MODECHANGE},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 83 "win32_vk.list"
- {gperf_offsetof(stringpool, 197), VK_F14},
-#line 57 "win32_vk.list"
- {gperf_offsetof(stringpool, 198), VK_NUMPAD3},
-#line 11 "win32_vk.list"
- {gperf_offsetof(stringpool, 199), VK_XBUTTON1},
- {-1}, {-1}, {-1},
-#line 93 "win32_vk.list"
- {gperf_offsetof(stringpool, 203), VK_F24},
- {-1},
-#line 12 "win32_vk.list"
- {gperf_offsetof(stringpool, 205), VK_XBUTTON2},
-#line 59 "win32_vk.list"
- {gperf_offsetof(stringpool, 206), VK_NUMPAD5},
- {-1}, {-1},
-#line 58 "win32_vk.list"
- {gperf_offsetof(stringpool, 209), VK_NUMPAD4},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 121 "win32_vk.list"
- {gperf_offsetof(stringpool, 215), VK_MEDIA_PLAY_PAUSE},
- {-1},
-#line 123 "win32_vk.list"
- {gperf_offsetof(stringpool, 217), VK_LAUNCH_MEDIA_SELECT},
-#line 80 "win32_vk.list"
- {gperf_offsetof(stringpool, 218), VK_F11},
- {-1},
-#line 139 "win32_vk.list"
- {gperf_offsetof(stringpool, 220), VK_OEM_102},
-#line 118 "win32_vk.list"
- {gperf_offsetof(stringpool, 221), VK_MEDIA_NEXT_TRACK},
-#line 61 "win32_vk.list"
- {gperf_offsetof(stringpool, 222), VK_NUMPAD7},
- {-1},
-#line 90 "win32_vk.list"
- {gperf_offsetof(stringpool, 224), VK_F21},
- {-1},
-#line 82 "win32_vk.list"
- {gperf_offsetof(stringpool, 226), VK_F13},
- {-1}, {-1},
-#line 81 "win32_vk.list"
- {gperf_offsetof(stringpool, 229), VK_F12},
- {-1}, {-1},
-#line 92 "win32_vk.list"
- {gperf_offsetof(stringpool, 232), VK_F23},
- {-1}, {-1},
-#line 91 "win32_vk.list"
- {gperf_offsetof(stringpool, 235), VK_F22},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 84 "win32_vk.list"
- {gperf_offsetof(stringpool, 242), VK_F15},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
-#line 69 "win32_vk.list"
- {gperf_offsetof(stringpool, 256), VK_DIVIDE}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register unsigned int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE)
- {
- 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
deleted file mode 100644
index 7909a4d1f0..0000000000
--- a/ext/io/console/win32_vk.list
+++ /dev/null
@@ -1,166 +0,0 @@
-%{
-struct vktable {short ofs; unsigned short vk;};
-static const struct vktable *console_win32_vk(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
-%}
-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/depend b/ext/io/nonblock/depend
index 4402898de6..e786dc71d2 100644
--- a/ext/io/nonblock/depend
+++ b/ext/io/nonblock/depend
@@ -1,17 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-nonblock.o: $(RUBY_EXTCONF_H)
-nonblock.o: $(arch_hdrdir)/ruby/config.h
-nonblock.o: $(hdrdir)/ruby/backward.h
-nonblock.o: $(hdrdir)/ruby/defines.h
-nonblock.o: $(hdrdir)/ruby/encoding.h
-nonblock.o: $(hdrdir)/ruby/intern.h
-nonblock.o: $(hdrdir)/ruby/io.h
-nonblock.o: $(hdrdir)/ruby/missing.h
-nonblock.o: $(hdrdir)/ruby/onigmo.h
-nonblock.o: $(hdrdir)/ruby/oniguruma.h
-nonblock.o: $(hdrdir)/ruby/ruby.h
-nonblock.o: $(hdrdir)/ruby/st.h
-nonblock.o: $(hdrdir)/ruby/subst.h
-nonblock.o: $(top_srcdir)/include/ruby.h
-nonblock.o: nonblock.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/io/nonblock/extconf.rb b/ext/io/nonblock/extconf.rb
index d813a01e7c..aecdc16cea 100644
--- a/ext/io/nonblock/extconf.rb
+++ b/ext/io/nonblock/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
target = "io/nonblock"
diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c
index 1c0bdc68e7..ccd8728a31 100644
--- a/ext/io/nonblock/nonblock.c
+++ b/ext/io/nonblock/nonblock.c
@@ -1,6 +1,6 @@
/**********************************************************************
- io/nonblock.c -
+ io/wait.c -
$Author$
created at: Tue Jul 14 21:53:18 2009
@@ -50,22 +50,21 @@ rb_io_nonblock_p(VALUE io)
#endif
#ifdef F_SETFL
-static int
+static void
io_nonblock_set(int fd, int f, int nb)
{
if (nb) {
if ((f & O_NONBLOCK) != 0)
- return 0;
+ return;
f |= O_NONBLOCK;
}
else {
if ((f & O_NONBLOCK) == 0)
- return 0;
+ return;
f &= ~O_NONBLOCK;
}
if (fcntl(fd, F_SETFL, f) == -1)
rb_sys_fail(0);
- return 1;
}
/*
@@ -80,10 +79,7 @@ rb_io_nonblock_set(VALUE io, VALUE nb)
{
rb_io_t *fptr;
GetOpenFile(io, fptr);
- if (RTEST(nb))
- rb_io_set_nonblock(fptr);
- else
- io_nonblock_set(fptr->fd, io_nonblock_mode(fptr->fd), RTEST(nb));
+ io_nonblock_set(fptr->fd, io_nonblock_mode(fptr->fd), RTEST(nb));
return io;
}
@@ -122,8 +118,7 @@ rb_io_nonblock_block(int argc, VALUE *argv, VALUE io)
f = io_nonblock_mode(fptr->fd);
restore[0] = fptr->fd;
restore[1] = f;
- if (!io_nonblock_set(fptr->fd, f, nb))
- return rb_yield(io);
+ io_nonblock_set(fptr->fd, f, nb);
return rb_ensure(rb_yield, io, io_nonblock_restore, (VALUE)restore);
}
#else
diff --git a/ext/io/wait/depend b/ext/io/wait/depend
index f509dcd8a4..e786dc71d2 100644
--- a/ext/io/wait/depend
+++ b/ext/io/wait/depend
@@ -1,17 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-wait.o: $(RUBY_EXTCONF_H)
-wait.o: $(arch_hdrdir)/ruby/config.h
-wait.o: $(hdrdir)/ruby/backward.h
-wait.o: $(hdrdir)/ruby/defines.h
-wait.o: $(hdrdir)/ruby/encoding.h
-wait.o: $(hdrdir)/ruby/intern.h
-wait.o: $(hdrdir)/ruby/io.h
-wait.o: $(hdrdir)/ruby/missing.h
-wait.o: $(hdrdir)/ruby/onigmo.h
-wait.o: $(hdrdir)/ruby/oniguruma.h
-wait.o: $(hdrdir)/ruby/ruby.h
-wait.o: $(hdrdir)/ruby/st.h
-wait.o: $(hdrdir)/ruby/subst.h
-wait.o: $(top_srcdir)/include/ruby.h
-wait.o: wait.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb
index b5d36c3fe3..eed3543124 100644
--- a/ext/io/wait/extconf.rb
+++ b/ext/io/wait/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
target = "io/wait"
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index f7a7508eeb..d8bb55fc47 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -44,30 +44,6 @@ 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
@@ -86,7 +62,7 @@ io_nread(VALUE io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
len = rb_io_read_pending(fptr);
- if (len > 0) return INT2FIX(len);
+ if (len > 0) return 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);
@@ -105,40 +81,57 @@ static VALUE
io_ready_p(VALUE io)
{
rb_io_t *fptr;
- struct timeval tv = {0, 0};
+ ioctl_arg n;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
if (rb_io_read_pending(fptr)) return Qtrue;
- if (wait_for_single_fd(fptr, RB_WAITFD_IN, &tv))
- return Qtrue;
+ if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qnil;
+ if (ioctl(fptr->fd, FIONREAD, &n)) return Qnil;
+ if (n > 0) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * io.wait_readable -> IO, true or nil
- * io.wait_readable(timeout) -> IO, true or nil
+ * 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
*
- * Waits until IO is readable without blocking and returns +self+, or
- * +nil+ when times out.
- * Returns +true+ immediately when buffered data is available.
+ * Waits until input is available or times out and returns self or nil when
+ * EOF is reached.
*/
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);
- tv = get_timeout(argc, argv, &timerec);
- if (rb_io_read_pending(fptr)) return Qtrue;
- if (wait_for_single_fd(fptr, RB_WAITFD_IN, tv)) {
- return io;
+ rb_scan_args(argc, argv, "01", &timeout);
+ if (NIL_P(timeout)) {
+ tv = NULL;
}
+ else {
+ timerec = rb_time_interval(timeout);
+ tv = &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;
return Qnil;
}
@@ -147,94 +140,34 @@ io_wait_readable(int argc, VALUE *argv, VALUE io)
* io.wait_writable -> IO
* io.wait_writable(timeout) -> IO or nil
*
- * Waits until IO is writable without blocking and returns +self+ or
- * +nil+ when times out.
+ * Waits until IO writable is available or times out and returns self or
+ * nil when EOF is reached.
*/
static VALUE
io_wait_writable(int argc, VALUE *argv, VALUE io)
{
rb_io_t *fptr;
+ int i;
+ VALUE timeout;
struct timeval timerec;
struct timeval *tv;
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
- tv = get_timeout(argc, argv, &timerec);
- if (wait_for_single_fd(fptr, RB_WAITFD_OUT, tv)) {
- return io;
+ rb_scan_args(argc, argv, "01", &timeout);
+ if (NIL_P(timeout)) {
+ tv = NULL;
}
- return Qnil;
-}
-
-static int
-wait_mode_sym(VALUE mode)
-{
- if (mode == ID2SYM(rb_intern("r"))) {
- return RB_WAITFD_IN;
- }
- if (mode == ID2SYM(rb_intern("read"))) {
- return RB_WAITFD_IN;
- }
- if (mode == ID2SYM(rb_intern("readable"))) {
- return RB_WAITFD_IN;
- }
- if (mode == ID2SYM(rb_intern("w"))) {
- return RB_WAITFD_OUT;
- }
- if (mode == ID2SYM(rb_intern("write"))) {
- return RB_WAITFD_OUT;
- }
- if (mode == ID2SYM(rb_intern("writable"))) {
- return RB_WAITFD_OUT;
- }
- if (mode == ID2SYM(rb_intern("rw"))) {
- return RB_WAITFD_IN|RB_WAITFD_OUT;
- }
- if (mode == ID2SYM(rb_intern("read_write"))) {
- return RB_WAITFD_IN|RB_WAITFD_OUT;
- }
- if (mode == ID2SYM(rb_intern("readable_writable"))) {
- return RB_WAITFD_IN|RB_WAITFD_OUT;
+ else {
+ timerec = rb_time_interval(timeout);
+ tv = &timerec;
}
- rb_raise(rb_eArgError, "unsupported mode: %"PRIsVALUE, mode);
- return 0;
-}
-/*
- * call-seq:
- * io.wait(timeout = nil, mode = :read) -> IO, true or nil
- *
- * Waits until IO is readable or writable without blocking and returns
- * +self+, or +nil+ when times out.
- * Returns +true+ immediately when buffered data is available.
- * Optional parameter +mode+ is one of +:read+, +:write+, or
- * +:read_write+.
- */
-
-static VALUE
-io_wait_readwrite(int argc, VALUE *argv, VALUE io)
-{
- rb_io_t *fptr;
- struct timeval timerec;
- struct timeval *tv = NULL;
- int event = 0;
- int i;
-
- GetOpenFile(io, fptr);
- for (i = 0; i < argc; ++i) {
- if (SYMBOL_P(argv[i])) {
- event |= wait_mode_sym(argv[i]);
- }
- else {
- *(tv = &timerec) = rb_time_interval(argv[i]);
- }
- }
- /* rb_time_interval() and might_mode() might convert the argument */
+ 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 (!event) event = RB_WAITFD_IN;
- if ((event & RB_WAITFD_IN) && rb_io_read_pending(fptr))
- return Qtrue;
- if (wait_for_single_fd(fptr, event, tv))
+ if (i & RB_WAITFD_OUT)
return io;
return Qnil;
}
@@ -244,11 +177,11 @@ io_wait_readwrite(int argc, VALUE *argv, VALUE io)
*/
void
-Init_wait(void)
+Init_wait()
{
rb_define_method(rb_cIO, "nread", io_nread, 0);
rb_define_method(rb_cIO, "ready?", io_ready_p, 0);
- rb_define_method(rb_cIO, "wait", io_wait_readwrite, -1);
+ rb_define_method(rb_cIO, "wait", io_wait_readable, -1);
rb_define_method(rb_cIO, "wait_readable", io_wait_readable, -1);
rb_define_method(rb_cIO, "wait_writable", io_wait_writable, -1);
}
diff --git a/ext/json/extconf.rb b/ext/json/extconf.rb
index 7595d58a98..850798c643 100644
--- a/ext/json/extconf.rb
+++ b/ext/json/extconf.rb
@@ -1,2 +1,3 @@
require 'mkmf'
create_makefile('json')
+
diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h
index dc8f406b5b..1e860eb790 100644
--- a/ext/json/fbuffer/fbuffer.h
+++ b/ext/json/fbuffer/fbuffer.h
@@ -12,6 +12,9 @@
#define RFLOAT_VALUE(val) (RFLOAT(val)->value)
#endif
+#ifndef RARRAY_PTR
+#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
+#endif
#ifndef RARRAY_LEN
#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
#endif
@@ -178,7 +181,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb)
static VALUE fbuffer_to_s(FBuffer *fb)
{
- VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));
+ VALUE result = rb_str_new(FBUFFER_PAIR(fb));
fbuffer_free(fb);
FORCE_UTF8(result);
return result;
diff --git a/ext/json/generator/depend b/ext/json/generator/depend
index 54e8ae3eb4..593a8fbb54 100644
--- a/ext/json/generator/depend
+++ b/ext/json/generator/depend
@@ -1,23 +1,2 @@
$(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/backward.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/onigmo.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/generator.c b/ext/json/generator/generator.c
index 2bf8074562..1b9652df24 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -7,20 +7,14 @@ static ID i_encoding, i_encode;
#endif
static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
- mHash, mArray,
-#ifdef RUBY_INTEGER_UNIFICATION
- mInteger,
-#else
- mFixnum, mBignum,
-#endif
- mFloat, mString, mString_Extend,
+ mHash, mArray, mFixnum, mBignum, mFloat, mString, mString_Extend,
mTrueClass, mFalseClass, mNilClass, eGeneratorError,
eNestingError, CRegexp_MULTILINE, CJSON_SAFE_STATE_PROTOTYPE,
i_SAFE_STATE_PROTOTYPE;
static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before,
i_object_nl, i_array_nl, i_max_nesting, i_allow_nan, i_ascii_only,
- i_pack, i_unpack, i_create_id, i_extend, i_key_p,
+ i_quirks_mode, i_pack, i_unpack, i_create_id, i_extend, i_key_p,
i_aref, i_send, i_respond_to_p, i_match, i_keys, i_depth,
i_buffer_initial_length, i_dup;
@@ -222,7 +216,6 @@ static void convert_UTF8_to_JSON_ASCII(FBuffer *buffer, VALUE string)
unicode_escape_to_buffer(buffer, buf, (UTF16)((ch & halfMask) + UNI_SUR_LOW_START));
}
}
- RB_GC_GUARD(string);
}
/* Converts string to a JSON string in FBuffer buffer, where only the
@@ -308,7 +301,7 @@ static char *fstrndup(const char *ptr, unsigned long len) {
char *result;
if (len <= 0) return NULL;
result = ALLOC_N(char, len);
- memcpy(result, ptr, len);
+ memccpy(result, ptr, 0, len);
return result;
}
@@ -349,18 +342,6 @@ static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self) {
GENERATE_JSON(array);
}
-#ifdef RUBY_INTEGER_UNIFICATION
-/*
- * call-seq: to_json(*)
- *
- * Returns a JSON string representation for this Integer number.
- */
-static VALUE mInteger_to_json(int argc, VALUE *argv, VALUE self)
-{
- GENERATE_JSON(integer);
-}
-
-#else
/*
* call-seq: to_json(*)
*
@@ -380,7 +361,6 @@ static VALUE mBignum_to_json(int argc, VALUE *argv, VALUE self)
{
GENERATE_JSON(bignum);
}
-#endif
/*
* call-seq: to_json(*)
@@ -506,9 +486,8 @@ static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self)
return cState_partial_generate(state, string);
}
-static void State_free(void *ptr)
+static void State_free(JSON_Generator_State *state)
{
- 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);
@@ -520,37 +499,17 @@ static void State_free(void *ptr)
ruby_xfree(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 JSON_Generator_State *State_allocate()
+{
+ JSON_Generator_State *state = ALLOC(JSON_Generator_State);
+ MEMZERO(state, JSON_Generator_State, 1);
+ return state;
+}
static VALUE cState_s_allocate(VALUE klass)
{
- JSON_Generator_State *state;
- return TypedData_Make_Struct(klass, JSON_Generator_State,
- &JSON_Generator_State_type, state);
+ JSON_Generator_State *state = State_allocate();
+ return Data_Wrap_Struct(klass, NULL, State_free, state);
}
/*
@@ -642,6 +601,8 @@ static VALUE cState_configure(VALUE self, VALUE opts)
state->allow_nan = RTEST(tmp);
tmp = rb_hash_aref(opts, ID2SYM(i_ascii_only));
state->ascii_only = RTEST(tmp);
+ tmp = rb_hash_aref(opts, ID2SYM(i_quirks_mode));
+ state->quirks_mode = RTEST(tmp);
return self;
}
@@ -675,6 +636,7 @@ static VALUE cState_to_h(VALUE self)
rb_hash_aset(result, ID2SYM(i_array_nl), rb_str_new(state->array_nl, state->array_nl_len));
rb_hash_aset(result, ID2SYM(i_allow_nan), state->allow_nan ? Qtrue : Qfalse);
rb_hash_aset(result, ID2SYM(i_ascii_only), state->ascii_only ? Qtrue : Qfalse);
+ rb_hash_aset(result, ID2SYM(i_quirks_mode), state->quirks_mode ? Qtrue : Qfalse);
rb_hash_aset(result, ID2SYM(i_max_nesting), LONG2FIX(state->max_nesting));
rb_hash_aset(result, ID2SYM(i_depth), LONG2FIX(state->depth));
rb_hash_aset(result, ID2SYM(i_buffer_initial_length), LONG2FIX(state->buffer_initial_length));
@@ -684,7 +646,7 @@ static VALUE cState_to_h(VALUE self)
/*
* call-seq: [](name)
*
-* Returns the value returned by method +name+.
+* Return the value returned by method +name+.
*/
static VALUE cState_aref(VALUE self, VALUE name)
{
@@ -699,7 +661,7 @@ static VALUE cState_aref(VALUE self, VALUE name)
/*
* call-seq: []=(name, value)
*
-* Sets the attribute name to value.
+* Set the attribute name to value.
*/
static VALUE cState_aset(VALUE self, VALUE name, VALUE value)
{
@@ -842,15 +804,6 @@ static void generate_json_bignum(FBuffer *buffer, VALUE Vstate, JSON_Generator_S
fbuffer_append_str(buffer, tmp);
}
-#ifdef RUBY_INTEGER_UNIFICATION
-static void generate_json_integer(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
-{
- if (FIXNUM_P(obj))
- generate_json_fixnum(buffer, Vstate, state, obj);
- else
- generate_json_bignum(buffer, Vstate, state, obj);
-}
-#endif
static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
{
double value = RFLOAT_VALUE(obj);
@@ -884,9 +837,9 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
generate_json_false(buffer, Vstate, state, obj);
} else if (obj == Qtrue) {
generate_json_true(buffer, Vstate, state, obj);
- } else if (FIXNUM_P(obj)) {
+ } else if (klass == rb_cFixnum) {
generate_json_fixnum(buffer, Vstate, state, obj);
- } else if (RB_TYPE_P(obj, T_BIGNUM)) {
+ } else if (klass == rb_cBignum) {
generate_json_bignum(buffer, Vstate, state, obj);
} else if (klass == rb_cFloat) {
generate_json_float(buffer, Vstate, state, obj);
@@ -897,7 +850,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_string(buffer, Vstate, state, tmp);
+ generate_json(buffer, Vstate, state, tmp);
}
}
@@ -918,7 +871,6 @@ 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);
@@ -941,6 +893,21 @@ static VALUE cState_partial_generate(VALUE self, VALUE obj)
}
/*
+ * This function returns true if string is either a JSON array or JSON object.
+ * It might suffer from false positives, e. g. syntactically incorrect JSON in
+ * the string or certain UTF-8 characters on the right hand side.
+ */
+static int isArrayOrObject(VALUE string)
+{
+ long string_len = RSTRING_LEN(string);
+ char *p = RSTRING_PTR(string), *q = p + string_len - 1;
+ if (string_len < 2) return 0;
+ for (; p < q && isspace((unsigned char)*p); p++);
+ for (; q > p && isspace((unsigned char)*q); q--);
+ return (*p == '[' && *q == ']') || (*p == '{' && *q == '}');
+}
+
+/*
* call-seq: generate(obj)
*
* Generates a valid JSON document from object +obj+ and returns the
@@ -951,7 +918,9 @@ static VALUE cState_generate(VALUE self, VALUE obj)
{
VALUE result = cState_partial_generate(self, obj);
GET_STATE(self);
- (void)state;
+ if (!state->quirks_mode && !isArrayOrObject(result)) {
+ rb_raise(eGeneratorError, "only generation of JSON objects or arrays allowed");
+ }
return result;
}
@@ -970,6 +939,8 @@ static VALUE cState_generate(VALUE self, VALUE obj)
* * *allow_nan*: true if NaN, Infinity, and -Infinity should be
* generated, otherwise an exception is thrown, if these values are
* encountered. This options defaults to false.
+ * * *quirks_mode*: Enables quirks_mode for parser, that is for example
+ * generating single JSON values instead of documents is possible.
* * *buffer_initial_length*: sets the initial length of the generator's
* internal buffer.
*/
@@ -987,7 +958,7 @@ static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
/*
* call-seq: initialize_copy(orig)
*
- * Initializes this object from orig if it can be duplicated/cloned and returns
+ * Initializes this object from orig if it to be duplicated/cloned and returns
* it.
*/
static VALUE cState_init_copy(VALUE obj, VALUE orig)
@@ -995,8 +966,8 @@ static VALUE cState_init_copy(VALUE obj, VALUE orig)
JSON_Generator_State *objState, *origState;
if (obj == orig) return obj;
- GET_STATE_TO(obj, objState);
- GET_STATE_TO(orig, origState);
+ Data_Get_Struct(obj, JSON_Generator_State, objState);
+ Data_Get_Struct(orig, JSON_Generator_State, origState);
if (!objState) rb_raise(rb_eArgError, "unallocated JSON::State");
MEMCPY(objState, origState, JSON_Generator_State, 1);
@@ -1035,7 +1006,7 @@ static VALUE cState_from_state_s(VALUE self, VALUE opts)
/*
* call-seq: indent()
*
- * Returns the string that is used to indent levels in the JSON text.
+ * This string is used to indent levels in the JSON text.
*/
static VALUE cState_indent(VALUE self)
{
@@ -1046,7 +1017,7 @@ static VALUE cState_indent(VALUE self)
/*
* call-seq: indent=(indent)
*
- * Sets the string that is used to indent levels in the JSON text.
+ * This string is used to indent levels in the JSON text.
*/
static VALUE cState_indent_set(VALUE self, VALUE indent)
{
@@ -1062,7 +1033,7 @@ static VALUE cState_indent_set(VALUE self, VALUE indent)
}
} else {
if (state->indent) ruby_xfree(state->indent);
- state->indent = fstrndup(RSTRING_PTR(indent), len);
+ state->indent = strdup(RSTRING_PTR(indent));
state->indent_len = len;
}
return Qnil;
@@ -1071,7 +1042,7 @@ static VALUE cState_indent_set(VALUE self, VALUE indent)
/*
* call-seq: space()
*
- * Returns the string that is used to insert a space between the tokens in a JSON
+ * This string is used to insert a space between the tokens in a JSON
* string.
*/
static VALUE cState_space(VALUE self)
@@ -1083,7 +1054,7 @@ static VALUE cState_space(VALUE self)
/*
* call-seq: space=(space)
*
- * Sets _space_ to the string that is used to insert a space between the tokens in a JSON
+ * This string is used to insert a space between the tokens in a JSON
* string.
*/
static VALUE cState_space_set(VALUE self, VALUE space)
@@ -1100,7 +1071,7 @@ static VALUE cState_space_set(VALUE self, VALUE space)
}
} else {
if (state->space) ruby_xfree(state->space);
- state->space = fstrndup(RSTRING_PTR(space), len);
+ state->space = strdup(RSTRING_PTR(space));
state->space_len = len;
}
return Qnil;
@@ -1109,7 +1080,7 @@ static VALUE cState_space_set(VALUE self, VALUE space)
/*
* call-seq: space_before()
*
- * Returns the string that is used to insert a space before the ':' in JSON objects.
+ * This string is used to insert a space before the ':' in JSON objects.
*/
static VALUE cState_space_before(VALUE self)
{
@@ -1120,7 +1091,7 @@ static VALUE cState_space_before(VALUE self)
/*
* call-seq: space_before=(space_before)
*
- * Sets the string that is used to insert a space before the ':' in JSON objects.
+ * This string is used to insert a space before the ':' in JSON objects.
*/
static VALUE cState_space_before_set(VALUE self, VALUE space_before)
{
@@ -1136,7 +1107,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 = fstrndup(RSTRING_PTR(space_before), len);
+ state->space_before = strdup(RSTRING_PTR(space_before));
state->space_before_len = len;
}
return Qnil;
@@ -1173,7 +1144,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 = fstrndup(RSTRING_PTR(object_nl), len);
+ state->object_nl = strdup(RSTRING_PTR(object_nl));
state->object_nl_len = len;
}
return Qnil;
@@ -1208,7 +1179,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 = fstrndup(RSTRING_PTR(array_nl), len);
+ state->array_nl = strdup(RSTRING_PTR(array_nl));
state->array_nl_len = len;
}
return Qnil;
@@ -1277,6 +1248,29 @@ static VALUE cState_ascii_only_p(VALUE self)
}
/*
+ * call-seq: quirks_mode?
+ *
+ * Returns true, if quirks mode is enabled. Otherwise returns false.
+ */
+static VALUE cState_quirks_mode_p(VALUE self)
+{
+ GET_STATE(self);
+ return state->quirks_mode ? Qtrue : Qfalse;
+}
+
+/*
+ * call-seq: quirks_mode=(enable)
+ *
+ * If set to true, enables the quirks_mode mode.
+ */
+static VALUE cState_quirks_mode_set(VALUE self, VALUE enable)
+{
+ GET_STATE(self);
+ state->quirks_mode = RTEST(enable);
+ return Qnil;
+}
+
+/*
* call-seq: depth
*
* This integer returns the current depth of data structure nesting.
@@ -1304,7 +1298,7 @@ static VALUE cState_depth_set(VALUE self, VALUE depth)
/*
* call-seq: buffer_initial_length
*
- * This integer returns the current initial length of the buffer.
+ * This integer returns the current inital length of the buffer.
*/
static VALUE cState_buffer_initial_length(VALUE self)
{
@@ -1333,7 +1327,7 @@ static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_l
/*
*
*/
-void Init_generator(void)
+void Init_generator()
{
rb_require("json/common");
@@ -1364,6 +1358,9 @@ void Init_generator(void)
rb_define_method(cState, "check_circular?", cState_check_circular_p, 0);
rb_define_method(cState, "allow_nan?", cState_allow_nan_p, 0);
rb_define_method(cState, "ascii_only?", cState_ascii_only_p, 0);
+ rb_define_method(cState, "quirks_mode?", cState_quirks_mode_p, 0);
+ rb_define_method(cState, "quirks_mode", cState_quirks_mode_p, 0);
+ rb_define_method(cState, "quirks_mode=", cState_quirks_mode_set, 1);
rb_define_method(cState, "depth", cState_depth, 0);
rb_define_method(cState, "depth=", cState_depth_set, 1);
rb_define_method(cState, "buffer_initial_length", cState_buffer_initial_length, 0);
@@ -1383,15 +1380,10 @@ void Init_generator(void)
rb_define_method(mHash, "to_json", mHash_to_json, -1);
mArray = rb_define_module_under(mGeneratorMethods, "Array");
rb_define_method(mArray, "to_json", mArray_to_json, -1);
-#ifdef RUBY_INTEGER_UNIFICATION
- mInteger = rb_define_module_under(mGeneratorMethods, "Integer");
- rb_define_method(mInteger, "to_json", mInteger_to_json, -1);
-#else
mFixnum = rb_define_module_under(mGeneratorMethods, "Fixnum");
rb_define_method(mFixnum, "to_json", mFixnum_to_json, -1);
mBignum = rb_define_module_under(mGeneratorMethods, "Bignum");
rb_define_method(mBignum, "to_json", mBignum_to_json, -1);
-#endif
mFloat = rb_define_module_under(mGeneratorMethods, "Float");
rb_define_method(mFloat, "to_json", mFloat_to_json, -1);
mString = rb_define_module_under(mGeneratorMethods, "String");
@@ -1420,6 +1412,7 @@ void Init_generator(void)
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_ascii_only = rb_intern("ascii_only");
+ i_quirks_mode = rb_intern("quirks_mode");
i_depth = rb_intern("depth");
i_buffer_initial_length = rb_intern("buffer_initial_length");
i_pack = rb_intern("pack");
diff --git a/ext/json/generator/generator.h b/ext/json/generator/generator.h
index c367a6209a..b58cc4bc2f 100644
--- a/ext/json/generator/generator.h
+++ b/ext/json/generator/generator.h
@@ -1,6 +1,7 @@
#ifndef _GENERATOR_H_
#define _GENERATOR_H_
+#include <string.h>
#include <math.h>
#include <ctype.h>
@@ -22,7 +23,7 @@
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
-/* unicode definitions */
+/* unicode defintions */
#define UNI_STRICT_CONVERSION 1
@@ -72,16 +73,14 @@ typedef struct JSON_Generator_StateStruct {
long max_nesting;
char allow_nan;
char ascii_only;
+ char quirks_mode;
long depth;
long buffer_initial_length;
} JSON_Generator_State;
-#define GET_STATE_TO(self, state) \
- TypedData_Get_Struct(self, JSON_Generator_State, &JSON_Generator_State_type, state)
-
#define GET_STATE(self) \
JSON_Generator_State *state; \
- GET_STATE_TO(self, state)
+ Data_Get_Struct(self, JSON_Generator_State, state)
#define GENERATE_JSON(type) \
FBuffer *buffer; \
@@ -90,19 +89,15 @@ typedef struct JSON_Generator_StateStruct {
\
rb_scan_args(argc, argv, "01", &Vstate); \
Vstate = cState_from_state_s(cState, Vstate); \
- TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
+ Data_Get_Struct(Vstate, JSON_Generator_State, state); \
buffer = cState_prepare_buffer(Vstate); \
generate_json_##type(buffer, Vstate, state, self); \
return fbuffer_to_s(buffer)
static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self);
-#ifdef RUBY_INTEGER_UNIFICATION
-static VALUE mInteger_to_json(int argc, VALUE *argv, VALUE self);
-#else
static VALUE mFixnum_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mBignum_to_json(int argc, VALUE *argv, VALUE self);
-#endif
static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self);
static VALUE mString_included_s(VALUE self, VALUE modul);
static VALUE mString_to_json(int argc, VALUE *argv, VALUE self);
@@ -113,7 +108,8 @@ 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(void *state);
+static void State_free(JSON_Generator_State *state);
+static JSON_Generator_State *State_allocate();
static VALUE cState_s_allocate(VALUE klass);
static VALUE cState_configure(VALUE self, VALUE opts);
static VALUE cState_to_h(VALUE self);
@@ -124,9 +120,6 @@ static void generate_json_string(FBuffer *buffer, VALUE Vstate, JSON_Generator_S
static void generate_json_null(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
static void generate_json_false(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
static void generate_json_true(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
-#ifdef RUBY_INTEGER_UNIFICATION
-static void generate_json_integer(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
-#endif
static void generate_json_fixnum(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
static void generate_json_bignum(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
static void generate_json_float(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj);
@@ -151,21 +144,5 @@ 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
deleted file mode 100644
index b8f3009a9c..0000000000
--- a/ext/json/json.gemspec
+++ /dev/null
Binary files differ
diff --git a/ext/json/lib/json.rb b/ext/json/lib/json.rb
index b5a6912415..24aa385c91 100644
--- a/ext/json/lib/json.rb
+++ b/ext/json/lib/json.rb
@@ -1,4 +1,3 @@
-#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 539daeeaf5..0ef69f12e0 100644
--- a/ext/json/lib/json/add/bigdecimal.rb
+++ b/ext/json/lib/json/add/bigdecimal.rb
@@ -1,4 +1,3 @@
-#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 28ef734daf..d7ebebf5f7 100644
--- a/ext/json/lib/json/add/complex.rb
+++ b/ext/json/lib/json/add/complex.rb
@@ -1,19 +1,13 @@
-#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,
@@ -22,7 +16,6 @@ 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 bfb017c460..77d9dc0b20 100644
--- a/ext/json/lib/json/add/core.rb
+++ b/ext/json/lib/json/add/core.rb
@@ -1,4 +1,3 @@
-#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 25523561a5..4288237db1 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 38b0e86ab8..5ea42ea656 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 a107e5b3c4..e6ad257abf 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 e064c85ff4..da81e107a7 100644
--- a/ext/json/lib/json/add/ostruct.rb
+++ b/ext/json/lib/json/add/ostruct.rb
@@ -1,13 +1,13 @@
-#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
- # <tt>t</tt> serialized by <tt>to_json</tt>.
+ # <tt>v</tt> serialized by <tt>to_json</tt>.
def self.json_create(object)
new(object['t'] || object[:t])
end
diff --git a/ext/json/lib/json/add/range.rb b/ext/json/lib/json/add/range.rb
index 93529fb1c4..e61e553cdb 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 356940b225..867cd92f05 100644
--- a/ext/json/lib/json/add/rational.rb
+++ b/ext/json/lib/json/add/rational.rb
@@ -1,18 +1,13 @@
-#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,
@@ -21,7 +16,6 @@ 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 a93866b05a..2fcbb6fb14 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 e8395ed42f..6847cde99b 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 74b13a423f..03dc9a56a5 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 b73acc4086..338209d899 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 method_defined?(:tv_nsec)
+ if instance_methods.include?(: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 7cc852916c..8fbaa2baad 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -1,15 +1,14 @@
-#frozen_string_literal: false
require 'json/version'
require 'json/generic_object'
module JSON
class << self
- # If _object_ is string-like, parse the string and return the parsed
- # result as a Ruby data structure. Otherwise generate a JSON text from the
- # Ruby data structure object and return it.
+ # If _object_ is string-like, parse the string and return the parsed result
+ # as a Ruby data structure. Otherwise generate a JSON text from the Ruby
+ # data structure object and return it.
#
- # The _opts_ argument is passed through to generate/parse respectively.
- # See generate and parse for their documentation.
+ # The _opts_ argument is passed through to generate/parse respectively. See
+ # generate and parse for their documentation.
def [](object, opts = {})
if object.respond_to? :to_str
JSON.parse(object.to_str, opts)
@@ -25,7 +24,7 @@ module JSON
# Set the JSON parser class _parser_ to be used by JSON.
def parser=(parser) # :nodoc:
@parser = parser
- remove_const :Parser if const_defined?(:Parser, false)
+ remove_const :Parser if JSON.const_defined_in?(self, :Parser)
const_set :Parser, parser
end
@@ -36,8 +35,8 @@ module JSON
def deep_const_get(path) # :nodoc:
path.to_s.split(/::/).inject(Object) do |p, c|
case
- when c.empty? then p
- when p.const_defined?(c, true) then p.const_get(c)
+ when c.empty? then p
+ when JSON.const_defined_in?(p, c) then p.const_get(c)
else
begin
p.const_missing(c)
@@ -139,17 +138,17 @@ module JSON
# _opts_ can have the following
# keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
- # structures. Disable depth checking with :max_nesting => false. It
- # defaults to 100.
+ # structures. Disable depth checking with :max_nesting => false. It defaults
+ # to 100.
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- # defiance of RFC 7159 to be parsed by the Parser. This option defaults
+ # defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to false.
# * *symbolize_names*: If set to true, returns symbols for the names
# (keys) in a JSON object. Otherwise strings are returned. Strings are
# 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 false.
+ # defaults to true.
# * *object_class*: Defaults to Hash
# * *array_class*: Defaults to Array
def parse(source, opts = {})
@@ -162,20 +161,20 @@ module JSON
#
# _opts_ can have the following keys:
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
- # structures. Enable depth checking with :max_nesting => anInteger. The
- # parse! methods defaults to not doing max depth checking: This can be
- # dangerous if someone wants to fill up your stack.
+ # structures. Enable depth checking with :max_nesting => anInteger. The parse!
+ # methods defaults to not doing max depth checking: This can be dangerous
+ # if someone wants to fill up your stack.
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
- # defiance of RFC 7159 to be parsed by the Parser. This option defaults
+ # defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to true.
# * *create_additions*: If set to false, the Parser doesn't create
# additions even if a matching class and create_id was found. This option
- # defaults to false.
+ # defaults to true.
def parse!(source, opts = {})
opts = {
:max_nesting => false,
:allow_nan => true
- }.merge(opts)
+ }.update(opts)
Parser.new(source, opts).parse
end
@@ -296,13 +295,13 @@ module JSON
# The global default options for the JSON.load method:
# :max_nesting: false
# :allow_nan: true
- # :allow_blank: true
+ # :quirks_mode: true
attr_accessor :load_default_options
end
self.load_default_options = {
:max_nesting => false,
:allow_nan => true,
- :allow_blank => true,
+ :quirks_mode => true,
:create_additions => true,
}
@@ -329,7 +328,7 @@ module JSON
elsif source.respond_to?(:read)
source = source.read
end
- if opts[:allow_blank] && (source.nil? || source.empty?)
+ if opts[:quirks_mode] && (source.nil? || source.empty?)
source = 'null'
end
result = parse(source, opts)
@@ -358,12 +357,13 @@ module JSON
# The global default options for the JSON.dump method:
# :max_nesting: false
# :allow_nan: true
- # :allow_blank: true
+ # :quirks_mode: true
attr_accessor :dump_default_options
end
self.dump_default_options = {
:max_nesting => false,
:allow_nan => true,
+ :quirks_mode => true,
}
# Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
@@ -390,7 +390,7 @@ module JSON
end
end
opts = JSON.dump_default_options
- opts = opts.merge(:max_nesting => limit) if limit
+ limit and opts.update(:max_nesting => limit)
result = generate(obj, opts)
if anIO
anIO.write result
@@ -402,9 +402,37 @@ module JSON
raise ArgumentError, "exceed depth limit"
end
- # Encodes string using Ruby's _String.encode_
- def self.iconv(to, from, string)
- string.encode(to, from)
+ # Swap consecutive bytes of _string_ in place.
+ def self.swap!(string) # :nodoc:
+ 0.upto(string.size / 2) do |i|
+ break unless string[2 * i + 1]
+ string[2 * i], string[2 * i + 1] = string[2 * i + 1], string[2 * i]
+ end
+ string
+ end
+
+ # Shortuct for iconv.
+ if ::String.method_defined?(:encode)
+ # Encodes string using Ruby's _String.encode_
+ def self.iconv(to, from, string)
+ string.encode(to, from)
+ end
+ else
+ require 'iconv'
+ # Encodes string using _iconv_ library
+ def self.iconv(to, from, string)
+ Iconv.conv(to, from, string)
+ end
+ end
+
+ if ::Object.method(:const_defined?).arity == 1
+ def self.const_defined_in?(modul, constant)
+ modul.const_defined?(constant)
+ end
+ else
+ def self.const_defined_in?(modul, constant)
+ modul.const_defined?(constant, false)
+ end
end
end
diff --git a/ext/json/lib/json/ext.rb b/ext/json/lib/json/ext.rb
index 7264a857fa..c5f813181d 100644
--- a/ext/json/lib/json/ext.rb
+++ b/ext/json/lib/json/ext.rb
@@ -1,3 +1,9 @@
+if ENV['SIMPLECOV_COVERAGE'].to_i == 1
+ require 'simplecov'
+ SimpleCov.start do
+ add_filter "/tests/"
+ end
+end
require 'json/common'
module JSON
diff --git a/ext/json/lib/json/generic_object.rb b/ext/json/lib/json/generic_object.rb
index 108309db26..8b8fd53bef 100644
--- a/ext/json/lib/json/generic_object.rb
+++ b/ext/json/lib/json/generic_object.rb
@@ -1,4 +1,3 @@
-#frozen_string_literal: false
require 'ostruct'
module JSON
@@ -49,12 +48,12 @@ module JSON
end
def [](name)
- __send__(name)
- end unless method_defined?(:[])
+ table[name.to_sym]
+ end
def []=(name, value)
- __send__("#{name}=", value)
- end unless method_defined?(:[]=)
+ __send__ "#{name}=", value
+ end
def |(other)
self.class[other.to_hash.merge(to_hash)]
diff --git a/ext/json/lib/json/version.rb b/ext/json/lib/json/version.rb
index b65ed87f98..47cdcd607c 100644
--- a/ext/json/lib/json/version.rb
+++ b/ext/json/lib/json/version.rb
@@ -1,7 +1,6 @@
-# frozen_string_literal: false
module JSON
# JSON version
- VERSION = '2.1.0'
+ VERSION = '1.8.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 2ffd904475..d188844670 100644
--- a/ext/json/parser/depend
+++ b/ext/json/parser/depend
@@ -1,22 +1,2 @@
$(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/backward.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/onigmo.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 f7360d46b2..ae4f861c79 100644
--- a/ext/json/parser/extconf.rb
+++ b/ext/json/parser/extconf.rb
@@ -1,6 +1,3 @@
-# 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 d2e4eb6686..29335541d4 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -3,28 +3,6 @@
#include "../fbuffer/fbuffer.h"
#include "parser.h"
-#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING rb_utf8_encoding(),
-# 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] = {
@@ -50,16 +28,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) | (unsigned char)b;
+ result = (result << 4) | 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;
}
@@ -89,21 +67,28 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
return len;
}
+#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;
+#else
+static ID i_iconv;
+#endif
+
static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan, i_symbolize_names,
- i_object_class, i_array_class, i_decimal_class, i_key_p,
- i_deep_const_get, i_match, i_match_string, i_aset, i_aref,
- i_leftshift, i_new;
+ i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
+ i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
+ i_match_string, i_aset, i_aref, i_leftshift;
-#line 125 "parser.rl"
+#line 110 "parser.rl"
-#line 107 "parser.c"
+#line 92 "parser.c"
enum {JSON_object_start = 1};
enum {JSON_object_first_final = 27};
enum {JSON_object_error = 0};
@@ -111,30 +96,30 @@ enum {JSON_object_error = 0};
enum {JSON_object_en_main = 1};
-#line 166 "parser.rl"
+#line 151 "parser.rl"
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
VALUE last_name = Qnil;
VALUE object_class = json->object_class;
- if (json->max_nesting && current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
}
*result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
-#line 131 "parser.c"
+#line 116 "parser.c"
{
cs = JSON_object_start;
}
-#line 181 "parser.rl"
+#line 166 "parser.rl"
-#line 138 "parser.c"
+#line 123 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -162,7 +147,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 148 "parser.rl"
+#line 133 "parser.rl"
{
char *np;
json->parsing_name = 1;
@@ -175,7 +160,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 179 "parser.c"
+#line 164 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -242,10 +227,10 @@ case 8:
goto st8;
goto st0;
tr11:
-#line 133 "parser.rl"
+#line 118 "parser.rl"
{
VALUE v = Qnil;
- char *np = JSON_parse_value(json, p, pe, &v, current_nesting);
+ char *np = JSON_parse_value(json, p, pe, &v);
if (np == NULL) {
p--; {p++; cs = 9; goto _out;}
} else {
@@ -262,7 +247,7 @@ st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 266 "parser.c"
+#line 251 "parser.c"
switch( (*p) ) {
case 13: goto st9;
case 32: goto st9;
@@ -351,14 +336,14 @@ case 18:
goto st9;
goto st18;
tr4:
-#line 156 "parser.rl"
+#line 141 "parser.rl"
{ p--; {p++; cs = 27; goto _out;} }
goto st27;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 362 "parser.c"
+#line 347 "parser.c"
goto st0;
st19:
if ( ++p == pe )
@@ -456,7 +441,7 @@ case 26:
_out: {}
}
-#line 182 "parser.rl"
+#line 167 "parser.rl"
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
@@ -481,358 +466,281 @@ case 26:
-#line 485 "parser.c"
+#line 470 "parser.c"
enum {JSON_value_start = 1};
-enum {JSON_value_first_final = 29};
+enum {JSON_value_first_final = 21};
enum {JSON_value_error = 0};
enum {JSON_value_en_main = 1};
-#line 282 "parser.rl"
+#line 271 "parser.rl"
-static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
-#line 501 "parser.c"
+#line 486 "parser.c"
{
cs = JSON_value_start;
}
-#line 289 "parser.rl"
+#line 278 "parser.rl"
-#line 508 "parser.c"
+#line 493 "parser.c"
{
if ( p == pe )
goto _test_eof;
switch ( cs )
{
-st1:
- if ( ++p == pe )
- goto _test_eof1;
case 1:
switch( (*p) ) {
- case 13: goto st1;
- case 32: goto st1;
- case 34: goto tr2;
- case 45: goto tr3;
- case 47: goto st6;
- case 73: goto st10;
- case 78: goto st17;
- case 91: goto tr7;
- case 102: goto st19;
- case 110: goto st23;
- case 116: goto st26;
- case 123: goto tr11;
+ case 34: goto tr0;
+ case 45: goto tr2;
+ case 73: goto st2;
+ case 78: goto st9;
+ case 91: goto tr5;
+ case 102: goto st11;
+ case 110: goto st15;
+ case 116: goto st18;
+ case 123: goto tr9;
}
- if ( (*p) > 10 ) {
- if ( 48 <= (*p) && (*p) <= 57 )
- goto tr3;
- } else if ( (*p) >= 9 )
- goto st1;
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto tr2;
goto st0;
st0:
cs = 0;
goto _out;
-tr2:
-#line 234 "parser.rl"
+tr0:
+#line 219 "parser.rl"
{
char *np = JSON_parse_string(json, p, pe, result);
- if (np == NULL) { p--; {p++; cs = 29; goto _out;} } else {p = (( np))-1;}
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
}
- goto st29;
-tr3:
-#line 239 "parser.rl"
+ goto st21;
+tr2:
+#line 224 "parser.rl"
{
char *np;
- if(pe > p + 8 && !strncmp(MinusInfinity, p, 9)) {
+ if(pe > p + 9 - json->quirks_mode && !strncmp(MinusInfinity, p, 9)) {
if (json->allow_nan) {
*result = CMinusInfinity;
{p = (( p + 10))-1;}
- p--; {p++; cs = 29; goto _out;}
+ p--; {p++; cs = 21; goto _out;}
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
}
}
np = JSON_parse_float(json, p, pe, result);
if (np != NULL) {p = (( np))-1;}
np = JSON_parse_integer(json, p, pe, result);
if (np != NULL) {p = (( np))-1;}
- p--; {p++; cs = 29; goto _out;}
+ p--; {p++; cs = 21; goto _out;}
}
- goto st29;
-tr7:
-#line 257 "parser.rl"
+ goto st21;
+tr5:
+#line 242 "parser.rl"
{
char *np;
- np = JSON_parse_array(json, p, pe, result, current_nesting + 1);
- if (np == NULL) { p--; {p++; cs = 29; goto _out;} } else {p = (( np))-1;}
+ json->current_nesting++;
+ np = JSON_parse_array(json, p, pe, result);
+ json->current_nesting--;
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
}
- goto st29;
-tr11:
-#line 263 "parser.rl"
+ goto st21;
+tr9:
+#line 250 "parser.rl"
{
char *np;
- np = JSON_parse_object(json, p, pe, result, current_nesting + 1);
- if (np == NULL) { p--; {p++; cs = 29; goto _out;} } else {p = (( np))-1;}
+ json->current_nesting++;
+ np = JSON_parse_object(json, p, pe, result);
+ json->current_nesting--;
+ if (np == NULL) { p--; {p++; cs = 21; goto _out;} } else {p = (( np))-1;}
}
- goto st29;
-tr25:
-#line 227 "parser.rl"
+ goto st21;
+tr16:
+#line 212 "parser.rl"
{
if (json->allow_nan) {
*result = CInfinity;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
}
}
- goto st29;
-tr27:
-#line 220 "parser.rl"
+ goto st21;
+tr18:
+#line 205 "parser.rl"
{
if (json->allow_nan) {
*result = CNaN;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
}
}
- goto st29;
-tr31:
-#line 214 "parser.rl"
+ goto st21;
+tr22:
+#line 199 "parser.rl"
{
*result = Qfalse;
}
- goto st29;
-tr34:
-#line 211 "parser.rl"
+ goto st21;
+tr25:
+#line 196 "parser.rl"
{
*result = Qnil;
}
- goto st29;
-tr37:
-#line 217 "parser.rl"
+ goto st21;
+tr28:
+#line 202 "parser.rl"
{
*result = Qtrue;
}
- goto st29;
-st29:
- if ( ++p == pe )
- goto _test_eof29;
-case 29:
-#line 269 "parser.rl"
- { p--; {p++; cs = 29; goto _out;} }
-#line 628 "parser.c"
- switch( (*p) ) {
- case 13: goto st29;
- case 32: goto st29;
- case 47: goto st2;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st29;
+ goto st21;
+st21:
+ if ( ++p == pe )
+ goto _test_eof21;
+case 21:
+#line 258 "parser.rl"
+ { p--; {p++; cs = 21; goto _out;} }
+#line 608 "parser.c"
goto st0;
st2:
if ( ++p == pe )
goto _test_eof2;
case 2:
- switch( (*p) ) {
- case 42: goto st3;
- case 47: goto st5;
- }
+ if ( (*p) == 110 )
+ goto st3;
goto st0;
st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
- if ( (*p) == 42 )
+ if ( (*p) == 102 )
goto st4;
- goto st3;
+ goto st0;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
- switch( (*p) ) {
- case 42: goto st4;
- case 47: goto st29;
- }
- goto st3;
+ if ( (*p) == 105 )
+ goto st5;
+ goto st0;
st5:
if ( ++p == pe )
goto _test_eof5;
case 5:
- if ( (*p) == 10 )
- goto st29;
- goto st5;
+ if ( (*p) == 110 )
+ goto st6;
+ goto st0;
st6:
if ( ++p == pe )
goto _test_eof6;
case 6:
- switch( (*p) ) {
- case 42: goto st7;
- case 47: goto st9;
- }
+ if ( (*p) == 105 )
+ goto st7;
goto st0;
st7:
if ( ++p == pe )
goto _test_eof7;
case 7:
- if ( (*p) == 42 )
+ if ( (*p) == 116 )
goto st8;
- goto st7;
+ goto st0;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
- switch( (*p) ) {
- case 42: goto st8;
- case 47: goto st1;
- }
- goto st7;
+ if ( (*p) == 121 )
+ goto tr16;
+ goto st0;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
- if ( (*p) == 10 )
- goto st1;
- goto st9;
+ if ( (*p) == 97 )
+ goto st10;
+ goto st0;
st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
- if ( (*p) == 110 )
- goto st11;
+ if ( (*p) == 78 )
+ goto tr18;
goto st0;
st11:
if ( ++p == pe )
goto _test_eof11;
case 11:
- if ( (*p) == 102 )
+ if ( (*p) == 97 )
goto st12;
goto st0;
st12:
if ( ++p == pe )
goto _test_eof12;
case 12:
- if ( (*p) == 105 )
+ if ( (*p) == 108 )
goto st13;
goto st0;
st13:
if ( ++p == pe )
goto _test_eof13;
case 13:
- if ( (*p) == 110 )
+ if ( (*p) == 115 )
goto st14;
goto st0;
st14:
if ( ++p == pe )
goto _test_eof14;
case 14:
- if ( (*p) == 105 )
- goto st15;
+ if ( (*p) == 101 )
+ goto tr22;
goto st0;
st15:
if ( ++p == pe )
goto _test_eof15;
case 15:
- if ( (*p) == 116 )
+ if ( (*p) == 117 )
goto st16;
goto st0;
st16:
if ( ++p == pe )
goto _test_eof16;
case 16:
- if ( (*p) == 121 )
- goto tr25;
+ if ( (*p) == 108 )
+ goto st17;
goto st0;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
- if ( (*p) == 97 )
- goto st18;
+ if ( (*p) == 108 )
+ goto tr25;
goto st0;
st18:
if ( ++p == pe )
goto _test_eof18;
case 18:
- if ( (*p) == 78 )
- goto tr27;
+ if ( (*p) == 114 )
+ goto st19;
goto st0;
st19:
if ( ++p == pe )
goto _test_eof19;
case 19:
- if ( (*p) == 97 )
+ if ( (*p) == 117 )
goto st20;
goto st0;
st20:
if ( ++p == pe )
goto _test_eof20;
case 20:
- if ( (*p) == 108 )
- goto st21;
- goto st0;
-st21:
- if ( ++p == pe )
- goto _test_eof21;
-case 21:
- if ( (*p) == 115 )
- goto st22;
- goto st0;
-st22:
- if ( ++p == pe )
- goto _test_eof22;
-case 22:
if ( (*p) == 101 )
- goto tr31;
- goto st0;
-st23:
- if ( ++p == pe )
- goto _test_eof23;
-case 23:
- if ( (*p) == 117 )
- goto st24;
- goto st0;
-st24:
- if ( ++p == pe )
- goto _test_eof24;
-case 24:
- if ( (*p) == 108 )
- goto st25;
- goto st0;
-st25:
- if ( ++p == pe )
- goto _test_eof25;
-case 25:
- if ( (*p) == 108 )
- goto tr34;
- goto st0;
-st26:
- if ( ++p == pe )
- goto _test_eof26;
-case 26:
- if ( (*p) == 114 )
- goto st27;
- goto st0;
-st27:
- if ( ++p == pe )
- goto _test_eof27;
-case 27:
- if ( (*p) == 117 )
- goto st28;
- goto st0;
-st28:
- if ( ++p == pe )
- goto _test_eof28;
-case 28:
- if ( (*p) == 101 )
- goto tr37;
+ goto tr28;
goto st0;
}
- _test_eof1: cs = 1; goto _test_eof;
- _test_eof29: cs = 29; goto _test_eof;
+ _test_eof21: cs = 21; goto _test_eof;
_test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof;
@@ -852,20 +760,12 @@ case 28:
_test_eof18: cs = 18; goto _test_eof;
_test_eof19: cs = 19; goto _test_eof;
_test_eof20: cs = 20; goto _test_eof;
- _test_eof21: cs = 21; goto _test_eof;
- _test_eof22: cs = 22; goto _test_eof;
- _test_eof23: cs = 23; goto _test_eof;
- _test_eof24: cs = 24; goto _test_eof;
- _test_eof25: cs = 25; goto _test_eof;
- _test_eof26: cs = 26; goto _test_eof;
- _test_eof27: cs = 27; goto _test_eof;
- _test_eof28: cs = 28; goto _test_eof;
_test_eof: {}
_out: {}
}
-#line 290 "parser.rl"
+#line 279 "parser.rl"
if (cs >= JSON_value_first_final) {
return p;
@@ -875,7 +775,7 @@ case 28:
}
-#line 879 "parser.c"
+#line 779 "parser.c"
enum {JSON_integer_start = 1};
enum {JSON_integer_first_final = 3};
enum {JSON_integer_error = 0};
@@ -883,7 +783,7 @@ enum {JSON_integer_error = 0};
enum {JSON_integer_en_main = 1};
-#line 306 "parser.rl"
+#line 295 "parser.rl"
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -891,15 +791,15 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
int cs = EVIL;
-#line 895 "parser.c"
+#line 795 "parser.c"
{
cs = JSON_integer_start;
}
-#line 313 "parser.rl"
+#line 302 "parser.rl"
json->memo = p;
-#line 903 "parser.c"
+#line 803 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -933,14 +833,14 @@ case 3:
goto st0;
goto tr4;
tr4:
-#line 303 "parser.rl"
+#line 292 "parser.rl"
{ p--; {p++; cs = 4; goto _out;} }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
-#line 944 "parser.c"
+#line 844 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -959,7 +859,7 @@ case 5:
_out: {}
}
-#line 315 "parser.rl"
+#line 304 "parser.rl"
if (cs >= JSON_integer_first_final) {
long len = p - json->memo;
@@ -974,7 +874,7 @@ case 5:
}
-#line 978 "parser.c"
+#line 878 "parser.c"
enum {JSON_float_start = 1};
enum {JSON_float_first_final = 8};
enum {JSON_float_error = 0};
@@ -982,7 +882,7 @@ enum {JSON_float_error = 0};
enum {JSON_float_en_main = 1};
-#line 340 "parser.rl"
+#line 329 "parser.rl"
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -990,15 +890,15 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
int cs = EVIL;
-#line 994 "parser.c"
+#line 894 "parser.c"
{
cs = JSON_float_start;
}
-#line 347 "parser.rl"
+#line 336 "parser.rl"
json->memo = p;
-#line 1002 "parser.c"
+#line 902 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1056,14 +956,14 @@ case 8:
goto st0;
goto tr9;
tr9:
-#line 334 "parser.rl"
+#line 323 "parser.rl"
{ p--; {p++; cs = 9; goto _out;} }
goto st9;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 1067 "parser.c"
+#line 967 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -1124,20 +1024,14 @@ case 7:
_out: {}
}
-#line 349 "parser.rl"
+#line 338 "parser.rl"
if (cs >= JSON_float_first_final) {
long len = p - json->memo;
fbuffer_clear(json->fbuffer);
fbuffer_append(json->fbuffer, json->memo, len);
fbuffer_append_char(json->fbuffer, '\0');
- if (NIL_P(json->decimal_class)) {
- *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
- } else {
- VALUE text;
- text = rb_str_new2(FBUFFER_PTR(json->fbuffer));
- *result = rb_funcall(json->decimal_class, i_new, 1, text);
- }
+ *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
return p + 1;
} else {
return NULL;
@@ -1146,7 +1040,7 @@ case 7:
-#line 1150 "parser.c"
+#line 1044 "parser.c"
enum {JSON_array_start = 1};
enum {JSON_array_first_final = 17};
enum {JSON_array_error = 0};
@@ -1154,28 +1048,28 @@ enum {JSON_array_error = 0};
enum {JSON_array_en_main = 1};
-#line 398 "parser.rl"
+#line 381 "parser.rl"
-static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
VALUE array_class = json->array_class;
- if (json->max_nesting && current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
}
*result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
-#line 1172 "parser.c"
+#line 1066 "parser.c"
{
cs = JSON_array_start;
}
-#line 411 "parser.rl"
+#line 394 "parser.rl"
-#line 1179 "parser.c"
+#line 1073 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1214,10 +1108,10 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 375 "parser.rl"
+#line 358 "parser.rl"
{
VALUE v = Qnil;
- char *np = JSON_parse_value(json, p, pe, &v, current_nesting);
+ char *np = JSON_parse_value(json, p, pe, &v);
if (np == NULL) {
p--; {p++; cs = 3; goto _out;}
} else {
@@ -1234,7 +1128,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 1238 "parser.c"
+#line 1132 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -1334,14 +1228,14 @@ case 12:
goto st3;
goto st12;
tr4:
-#line 390 "parser.rl"
+#line 373 "parser.rl"
{ p--; {p++; cs = 17; goto _out;} }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
-#line 1345 "parser.c"
+#line 1239 "parser.c"
goto st0;
st13:
if ( ++p == pe )
@@ -1397,12 +1291,12 @@ case 16:
_out: {}
}
-#line 412 "parser.rl"
+#line 395 "parser.rl"
if(cs >= JSON_array_first_final) {
return p + 1;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return NULL;
}
}
@@ -1442,21 +1336,13 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
break;
case 'u':
if (pe > stringEnd - 4) {
- rb_enc_raise(
- EXC_ENCODING eParserError,
- "%u: incomplete unicode character escape sequence at '%s'", __LINE__, p
- );
+ return Qnil;
} else {
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
pe++;
- if (pe > stringEnd - 6) {
- rb_enc_raise(
- EXC_ENCODING eParserError,
- "%u: incomplete surrogate pair at '%s'", __LINE__, p
- );
- }
+ if (pe > stringEnd - 6) return Qnil;
if (pe[0] == '\\' && pe[1] == 'u') {
UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
@@ -1486,7 +1372,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
}
-#line 1490 "parser.c"
+#line 1376 "parser.c"
enum {JSON_string_start = 1};
enum {JSON_string_first_final = 8};
enum {JSON_string_error = 0};
@@ -1494,7 +1380,7 @@ enum {JSON_string_error = 0};
enum {JSON_string_en_main = 1};
-#line 519 "parser.rl"
+#line 494 "parser.rl"
static int
@@ -1516,15 +1402,15 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = rb_str_buf_new(0);
-#line 1520 "parser.c"
+#line 1406 "parser.c"
{
cs = JSON_string_start;
}
-#line 540 "parser.rl"
+#line 515 "parser.rl"
json->memo = p;
-#line 1528 "parser.c"
+#line 1414 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1549,7 +1435,7 @@ case 2:
goto st0;
goto st2;
tr2:
-#line 505 "parser.rl"
+#line 480 "parser.rl"
{
*result = json_string_unescape(*result, json->memo + 1, p);
if (NIL_P(*result)) {
@@ -1560,14 +1446,14 @@ tr2:
{p = (( p + 1))-1;}
}
}
-#line 516 "parser.rl"
+#line 491 "parser.rl"
{ p--; {p++; cs = 8; goto _out;} }
goto st8;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
-#line 1571 "parser.c"
+#line 1457 "parser.c"
goto st0;
st3:
if ( ++p == pe )
@@ -1643,7 +1529,7 @@ case 7:
_out: {}
}
-#line 542 "parser.rl"
+#line 517 "parser.rl"
if (json->create_additions && RTEST(match_string = json->match_string)) {
VALUE klass;
@@ -1658,8 +1544,6 @@ case 7:
if (json->symbolize_names && json->parsing_name) {
*result = rb_str_intern(*result);
- } else {
- rb_str_resize(*result, RSTRING_LEN(*result));
}
if (cs >= JSON_string_first_final) {
return p + 1;
@@ -1682,16 +1566,41 @@ case 7:
static VALUE convert_encoding(VALUE source)
{
+ 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
- rb_encoding *enc = rb_enc_get(source);
- if (enc == rb_ascii8bit_encoding()) {
- if (OBJ_FROZEN(source)) {
- source = rb_str_dup(source);
+ {
+ VALUE encoding = rb_funcall(source, i_encoding, 0);
+ if (encoding == CEncoding_ASCII_8BIT) {
+ 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);
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
+ } 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);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
+ } else {
+ source = rb_str_dup(source);
+ FORCE_UTF8(source);
+ }
+ } else {
+ source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
+ }
+ }
+#else
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32be"), source);
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16be"), source);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32le"), source);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16le"), source);
}
- FORCE_UTF8(source);
- } else {
- source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
- }
#endif
return source;
}
@@ -1714,12 +1623,11 @@ static VALUE convert_encoding(VALUE source)
* defiance of RFC 4627 to be parsed by the Parser. This option defaults to
* false.
* * *symbolize_names*: If set to true, returns symbols for the names
- * (keys) in a JSON object. Otherwise strings are returned, which is
- * also the default. It's not possible to use this option in
- * conjunction with the *create_additions* option.
+ * (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 matching class and create_id was found. This option
- * defaults to false.
+ * additions even if a matchin class and create_id was found. This option
+ * defaults to true.
* * *object_class*: Defaults to Hash
* * *array_class*: Defaults to Array
*/
@@ -1731,18 +1639,12 @@ 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);
@@ -1767,17 +1669,19 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->symbolize_names = 0;
}
+ tmp = ID2SYM(i_quirks_mode);
+ if (option_given_p(opts, tmp)) {
+ VALUE quirks_mode = rb_hash_aref(opts, tmp);
+ json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
+ } else {
+ json->quirks_mode = 0;
+ }
tmp = ID2SYM(i_create_additions);
if (option_given_p(opts, tmp)) {
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
} else {
json->create_additions = 0;
}
- if (json->symbolize_names && json->create_additions) {
- rb_raise(rb_eArgError,
- "options :symbolize_names and :create_additions cannot be "
- " used in conjunction");
- }
tmp = ID2SYM(i_create_id);
if (option_given_p(opts, tmp)) {
json->create_id = rb_hash_aref(opts, tmp);
@@ -1796,12 +1700,6 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->array_class = Qnil;
}
- tmp = ID2SYM(i_decimal_class);
- if (option_given_p(opts, tmp)) {
- json->decimal_class = rb_hash_aref(opts, tmp);
- } else {
- json->decimal_class = Qnil;
- }
tmp = ID2SYM(i_match_string);
if (option_given_p(opts, tmp)) {
VALUE match_string = rb_hash_aref(opts, tmp);
@@ -1809,9 +1707,7 @@ 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;
@@ -1819,9 +1715,12 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
json->create_id = rb_funcall(mJSON, i_create_id, 0);
json->object_class = Qnil;
json->array_class = Qnil;
- json->decimal_class = Qnil;
}
- source = convert_encoding(StringValue(source));
+ source = rb_convert_type(source, T_STRING, "String", "to_str");
+ if (!json->quirks_mode) {
+ source = convert_encoding(StringValue(source));
+ }
+ json->current_nesting = 0;
StringValue(source);
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
@@ -1830,7 +1729,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
}
-#line 1834 "parser.c"
+#line 1733 "parser.c"
enum {JSON_start = 1};
enum {JSON_first_final = 10};
enum {JSON_error = 0};
@@ -1838,33 +1737,201 @@ enum {JSON_error = 0};
enum {JSON_en_main = 1};
-#line 742 "parser.rl"
+#line 740 "parser.rl"
-/*
- * call-seq: parse()
- *
- * Parses the current JSON text _source_ and returns the complete data
- * structure as a result.
- */
-static VALUE cParser_parse(VALUE self)
+static VALUE cParser_parse_strict(VALUE self)
{
- char *p, *pe;
- int cs = EVIL;
- VALUE result = Qnil;
- GET_PARSER;
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
-#line 1859 "parser.c"
+#line 1752 "parser.c"
{
cs = JSON_start;
}
-#line 758 "parser.rl"
- p = json->source;
- pe = p + json->len;
+#line 750 "parser.rl"
+ p = json->source;
+ pe = p + json->len;
+
+#line 1761 "parser.c"
+ {
+ if ( p == pe )
+ goto _test_eof;
+ switch ( cs )
+ {
+st1:
+ if ( ++p == pe )
+ goto _test_eof1;
+case 1:
+ switch( (*p) ) {
+ case 13: goto st1;
+ case 32: goto st1;
+ case 47: goto st2;
+ case 91: goto tr3;
+ case 123: goto tr4;
+ }
+ if ( 9 <= (*p) && (*p) <= 10 )
+ goto st1;
+ goto st0;
+st0:
+cs = 0;
+ goto _out;
+st2:
+ if ( ++p == pe )
+ goto _test_eof2;
+case 2:
+ switch( (*p) ) {
+ case 42: goto st3;
+ case 47: goto st5;
+ }
+ goto st0;
+st3:
+ if ( ++p == pe )
+ goto _test_eof3;
+case 3:
+ if ( (*p) == 42 )
+ goto st4;
+ goto st3;
+st4:
+ if ( ++p == pe )
+ goto _test_eof4;
+case 4:
+ switch( (*p) ) {
+ case 42: goto st4;
+ case 47: goto st1;
+ }
+ goto st3;
+st5:
+ if ( ++p == pe )
+ goto _test_eof5;
+case 5:
+ if ( (*p) == 10 )
+ goto st1;
+ goto st5;
+tr3:
+#line 729 "parser.rl"
+ {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_array(json, p, pe, &result);
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
+ }
+ goto st10;
+tr4:
+#line 722 "parser.rl"
+ {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_object(json, p, pe, &result);
+ if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
+ }
+ goto st10;
+st10:
+ if ( ++p == pe )
+ goto _test_eof10;
+case 10:
+#line 1838 "parser.c"
+ switch( (*p) ) {
+ case 13: goto st10;
+ case 32: goto st10;
+ case 47: goto st6;
+ }
+ if ( 9 <= (*p) && (*p) <= 10 )
+ goto st10;
+ goto st0;
+st6:
+ if ( ++p == pe )
+ goto _test_eof6;
+case 6:
+ switch( (*p) ) {
+ case 42: goto st7;
+ case 47: goto st9;
+ }
+ goto st0;
+st7:
+ if ( ++p == pe )
+ goto _test_eof7;
+case 7:
+ if ( (*p) == 42 )
+ goto st8;
+ goto st7;
+st8:
+ if ( ++p == pe )
+ goto _test_eof8;
+case 8:
+ switch( (*p) ) {
+ case 42: goto st8;
+ case 47: goto st10;
+ }
+ goto st7;
+st9:
+ if ( ++p == pe )
+ goto _test_eof9;
+case 9:
+ if ( (*p) == 10 )
+ goto st10;
+ goto st9;
+ }
+ _test_eof1: cs = 1; goto _test_eof;
+ _test_eof2: cs = 2; goto _test_eof;
+ _test_eof3: cs = 3; goto _test_eof;
+ _test_eof4: cs = 4; goto _test_eof;
+ _test_eof5: cs = 5; goto _test_eof;
+ _test_eof10: cs = 10; goto _test_eof;
+ _test_eof6: cs = 6; goto _test_eof;
+ _test_eof7: cs = 7; goto _test_eof;
+ _test_eof8: cs = 8; goto _test_eof;
+ _test_eof9: cs = 9; goto _test_eof;
+
+ _test_eof: {}
+ _out: {}
+ }
+
+#line 753 "parser.rl"
+
+ if (cs >= JSON_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+
+
+#line 1907 "parser.c"
+enum {JSON_quirks_mode_start = 1};
+enum {JSON_quirks_mode_first_final = 10};
+enum {JSON_quirks_mode_error = 0};
+
+enum {JSON_quirks_mode_en_main = 1};
+
+
+#line 778 "parser.rl"
+
-#line 1868 "parser.c"
+static VALUE cParser_parse_quirks_mode(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+
+#line 1926 "parser.c"
+ {
+ cs = JSON_quirks_mode_start;
+ }
+
+#line 788 "parser.rl"
+ p = json->source;
+ pe = p + json->len;
+
+#line 1935 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1898,9 +1965,9 @@ st0:
cs = 0;
goto _out;
tr2:
-#line 734 "parser.rl"
+#line 770 "parser.rl"
{
- char *np = JSON_parse_value(json, p, pe, &result, 0);
+ char *np = JSON_parse_value(json, p, pe, &result);
if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;}
}
goto st10;
@@ -1908,7 +1975,7 @@ st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 1912 "parser.c"
+#line 1979 "parser.c"
switch( (*p) ) {
case 13: goto st10;
case 32: goto st10;
@@ -1997,57 +2064,61 @@ case 9:
_out: {}
}
-#line 761 "parser.rl"
+#line 791 "parser.rl"
- if (cs >= JSON_first_final && p == pe) {
- return result;
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+/*
+ * call-seq: parse()
+ *
+ * Parses the current JSON text _source_ and returns the complete data
+ * structure as a result.
+ */
+static VALUE cParser_parse(VALUE self)
+{
+ GET_PARSER;
+
+ if (json->quirks_mode) {
+ return cParser_parse_quirks_mode(self);
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- return Qnil;
+ return cParser_parse_strict(self);
}
}
-static void JSON_mark(void *ptr)
+
+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)
{
- JSON_Parser *json = ptr;
rb_gc_mark_maybe(json->Vsource);
rb_gc_mark_maybe(json->create_id);
rb_gc_mark_maybe(json->object_class);
rb_gc_mark_maybe(json->array_class);
- rb_gc_mark_maybe(json->decimal_class);
rb_gc_mark_maybe(json->match_string);
}
-static void JSON_free(void *ptr)
+static void JSON_free(JSON_Parser *json)
{
- 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;
- VALUE obj = TypedData_Make_Struct(klass, JSON_Parser, &JSON_Parser_type, json);
- json->fbuffer = fbuffer_alloc(0);
- return obj;
+ JSON_Parser *json = JSON_allocate();
+ return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
}
/*
@@ -2062,7 +2133,19 @@ static VALUE cParser_source(VALUE self)
return rb_str_dup(json->Vsource);
}
-void Init_parser(void)
+/*
+ * call-seq: quirks_mode?()
+ *
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
+ */
+static VALUE cParser_quirks_mode_p(VALUE self)
+{
+ GET_PARSER;
+ return json->quirks_mode ? Qtrue : Qfalse;
+}
+
+
+void Init_parser()
{
rb_require("json/common");
mJSON = rb_define_module("JSON");
@@ -2074,6 +2157,7 @@ void Init_parser(void)
rb_define_method(cParser, "initialize", cParser_initialize, -1);
rb_define_method(cParser, "parse", cParser_parse, 0);
rb_define_method(cParser, "source", cParser_source, 0);
+ rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
CNaN = rb_const_get(mJSON, rb_intern("NaN"));
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
@@ -2087,9 +2171,9 @@ void Init_parser(void)
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_symbolize_names = rb_intern("symbolize_names");
+ i_quirks_mode = rb_intern("quirks_mode");
i_object_class = rb_intern("object_class");
i_array_class = rb_intern("array_class");
- i_decimal_class = rb_intern("decimal_class");
i_match = rb_intern("match");
i_match_string = rb_intern("match_string");
i_key_p = rb_intern("key?");
@@ -2097,7 +2181,18 @@ void Init_parser(void)
i_aset = rb_intern("[]=");
i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
- i_new = rb_intern("new");
+#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");
+#else
+ i_iconv = rb_intern("iconv");
+#endif
}
/*
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index e6cf779024..b192064c09 100644
--- a/ext/json/parser/parser.h
+++ b/ext/json/parser/parser.h
@@ -34,12 +34,13 @@ typedef struct JSON_ParserStruct {
char *memo;
VALUE create_id;
int max_nesting;
+ int current_nesting;
int allow_nan;
int parsing_name;
int symbolize_names;
+ int quirks_mode;
VALUE object_class;
VALUE array_class;
- VALUE decimal_class;
int create_additions;
VALUE match_string;
FBuffer *fbuffer;
@@ -50,42 +51,27 @@ typedef struct JSON_ParserStruct {
if (!json->Vsource) rb_raise(rb_eTypeError, "uninitialized instance")
#define GET_PARSER_INIT \
JSON_Parser *json; \
- TypedData_Get_Struct(self, JSON_Parser, &JSON_Parser_type, json)
+ Data_Get_Struct(self, JSON_Parser, json)
#define MinusInfinity "-Infinity"
#define EVIL 0x666
static UTF32 unescape_unicode(const unsigned char *p);
static int convert_UTF32_to_UTF8(char *buf, UTF32 ch);
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
-static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
+static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result);
+static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result);
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result);
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result);
-static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
+static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result);
static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd);
static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result);
static VALUE convert_encoding(VALUE source);
static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self);
static VALUE cParser_parse(VALUE self);
-static void JSON_mark(void *json);
-static void JSON_free(void *json);
+static JSON_Parser *JSON_allocate();
+static void JSON_mark(JSON_Parser *json);
+static void JSON_free(JSON_Parser *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 29900a4a4a..ab8d318173 100644
--- a/ext/json/parser/parser.rl
+++ b/ext/json/parser/parser.rl
@@ -1,28 +1,6 @@
#include "../fbuffer/fbuffer.h"
#include "parser.h"
-#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING rb_utf8_encoding(),
-# 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] = {
@@ -48,16 +26,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) | (unsigned char)b;
+ result = (result << 4) | 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;
}
@@ -87,14 +65,21 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
return len;
}
+#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;
+#else
+static ID i_iconv;
+#endif
+
static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
- i_chr, i_max_nesting, i_allow_nan, i_symbolize_names,
- i_object_class, i_array_class, i_decimal_class, i_key_p,
- i_deep_const_get, i_match, i_match_string, i_aset, i_aref,
- i_leftshift, i_new;
+ i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, i_quirks_mode,
+ i_object_class, i_array_class, i_key_p, i_deep_const_get, i_match,
+ i_match_string, i_aset, i_aref, i_leftshift;
%%{
machine JSON_common;
@@ -132,7 +117,7 @@ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
action parse_value {
VALUE v = Qnil;
- char *np = JSON_parse_value(json, fpc, pe, &v, current_nesting);
+ char *np = JSON_parse_value(json, fpc, pe, &v);
if (np == NULL) {
fhold; fbreak;
} else {
@@ -165,14 +150,14 @@ static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
) @exit;
}%%
-static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
VALUE last_name = Qnil;
VALUE object_class = json->object_class;
- if (json->max_nesting && current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
}
*result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
@@ -221,14 +206,14 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
if (json->allow_nan) {
*result = CNaN;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
}
}
action parse_infinity {
if (json->allow_nan) {
*result = CInfinity;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
}
}
action parse_string {
@@ -238,13 +223,13 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
action parse_number {
char *np;
- if(pe > fpc + 8 && !strncmp(MinusInfinity, fpc, 9)) {
+ if(pe > fpc + 9 - json->quirks_mode && !strncmp(MinusInfinity, fpc, 9)) {
if (json->allow_nan) {
*result = CMinusInfinity;
fexec p + 10;
fhold; fbreak;
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
}
}
np = JSON_parse_float(json, fpc, pe, result);
@@ -256,19 +241,23 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
action parse_array {
char *np;
- np = JSON_parse_array(json, fpc, pe, result, current_nesting + 1);
+ json->current_nesting++;
+ np = JSON_parse_array(json, fpc, pe, result);
+ json->current_nesting--;
if (np == NULL) { fhold; fbreak; } else fexec np;
}
action parse_object {
char *np;
- np = JSON_parse_object(json, fpc, pe, result, current_nesting + 1);
+ json->current_nesting++;
+ np = JSON_parse_object(json, fpc, pe, result);
+ json->current_nesting--;
if (np == NULL) { fhold; fbreak; } else fexec np;
}
action exit { fhold; fbreak; }
-main := ignore* (
+main := (
Vnull @parse_null |
Vfalse @parse_false |
Vtrue @parse_true |
@@ -278,10 +267,10 @@ main := ignore* (
begin_string >parse_string |
begin_array >parse_array |
begin_object >parse_object
- ) ignore* %*exit;
+ ) %*exit;
}%%
-static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
@@ -352,13 +341,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
fbuffer_clear(json->fbuffer);
fbuffer_append(json->fbuffer, json->memo, len);
fbuffer_append_char(json->fbuffer, '\0');
- if (NIL_P(json->decimal_class)) {
- *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
- } else {
- VALUE text;
- text = rb_str_new2(FBUFFER_PTR(json->fbuffer));
- *result = rb_funcall(json->decimal_class, i_new, 1, text);
- }
+ *result = rb_float_new(rb_cstr_to_dbl(FBUFFER_PTR(json->fbuffer), 1));
return p + 1;
} else {
return NULL;
@@ -374,7 +357,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
action parse_value {
VALUE v = Qnil;
- char *np = JSON_parse_value(json, fpc, pe, &v, current_nesting);
+ char *np = JSON_parse_value(json, fpc, pe, &v);
if (np == NULL) {
fhold; fbreak;
} else {
@@ -397,13 +380,13 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
end_array @exit;
}%%
-static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
+static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
VALUE array_class = json->array_class;
- if (json->max_nesting && current_nesting > json->max_nesting) {
- rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
+ if (json->max_nesting && json->current_nesting > json->max_nesting) {
+ rb_raise(eNestingError, "nesting of %d is too deep", json->current_nesting);
}
*result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
@@ -413,7 +396,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_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
return NULL;
}
}
@@ -453,21 +436,13 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
break;
case 'u':
if (pe > stringEnd - 4) {
- rb_enc_raise(
- EXC_ENCODING eParserError,
- "%u: incomplete unicode character escape sequence at '%s'", __LINE__, p
- );
+ return Qnil;
} else {
UTF32 ch = unescape_unicode((unsigned char *) ++pe);
pe += 3;
if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
pe++;
- if (pe > stringEnd - 6) {
- rb_enc_raise(
- EXC_ENCODING eParserError,
- "%u: incomplete surrogate pair at '%s'", __LINE__, p
- );
- }
+ if (pe > stringEnd - 6) return Qnil;
if (pe[0] == '\\' && pe[1] == 'u') {
UTF32 sur = unescape_unicode((unsigned char *) pe + 2);
ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
@@ -553,8 +528,6 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
if (json->symbolize_names && json->parsing_name) {
*result = rb_str_intern(*result);
- } else {
- rb_str_resize(*result, RSTRING_LEN(*result));
}
if (cs >= JSON_string_first_final) {
return p + 1;
@@ -577,16 +550,41 @@ 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);
+ 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
- rb_encoding *enc = rb_enc_get(source);
- if (enc == rb_ascii8bit_encoding()) {
- if (OBJ_FROZEN(source)) {
- source = rb_str_dup(source);
+ {
+ VALUE encoding = rb_funcall(source, i_encoding, 0);
+ if (encoding == CEncoding_ASCII_8BIT) {
+ 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);
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16BE);
+ } 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);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_funcall(source, i_encode, 2, CEncoding_UTF_8, CEncoding_UTF_16LE);
+ } else {
+ source = rb_str_dup(source);
+ FORCE_UTF8(source);
+ }
+ } else {
+ source = rb_funcall(source, i_encode, 1, CEncoding_UTF_8);
+ }
+ }
+#else
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32be"), source);
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16be"), source);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-32le"), source);
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_funcall(mJSON, i_iconv, 3, rb_str_new2("utf-8"), rb_str_new2("utf-16le"), source);
}
- FORCE_UTF8(source);
- } else {
- source = rb_str_conv_enc(source, rb_enc_get(source), rb_utf8_encoding());
- }
#endif
return source;
}
@@ -609,12 +607,11 @@ static VALUE convert_encoding(VALUE source)
* defiance of RFC 4627 to be parsed by the Parser. This option defaults to
* false.
* * *symbolize_names*: If set to true, returns symbols for the names
- * (keys) in a JSON object. Otherwise strings are returned, which is
- * also the default. It's not possible to use this option in
- * conjunction with the *create_additions* option.
+ * (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 matching class and create_id was found. This option
- * defaults to false.
+ * additions even if a matchin class and create_id was found. This option
+ * defaults to true.
* * *object_class*: Defaults to Hash
* * *array_class*: Defaults to Array
*/
@@ -626,18 +623,12 @@ 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);
@@ -662,17 +653,19 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->symbolize_names = 0;
}
+ tmp = ID2SYM(i_quirks_mode);
+ if (option_given_p(opts, tmp)) {
+ VALUE quirks_mode = rb_hash_aref(opts, tmp);
+ json->quirks_mode = RTEST(quirks_mode) ? 1 : 0;
+ } else {
+ json->quirks_mode = 0;
+ }
tmp = ID2SYM(i_create_additions);
if (option_given_p(opts, tmp)) {
json->create_additions = RTEST(rb_hash_aref(opts, tmp));
} else {
json->create_additions = 0;
}
- if (json->symbolize_names && json->create_additions) {
- rb_raise(rb_eArgError,
- "options :symbolize_names and :create_additions cannot be "
- " used in conjunction");
- }
tmp = ID2SYM(i_create_id);
if (option_given_p(opts, tmp)) {
json->create_id = rb_hash_aref(opts, tmp);
@@ -691,12 +684,6 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
} else {
json->array_class = Qnil;
}
- tmp = ID2SYM(i_decimal_class);
- if (option_given_p(opts, tmp)) {
- json->decimal_class = rb_hash_aref(opts, tmp);
- } else {
- json->decimal_class = Qnil;
- }
tmp = ID2SYM(i_match_string);
if (option_given_p(opts, tmp)) {
VALUE match_string = rb_hash_aref(opts, tmp);
@@ -704,9 +691,7 @@ 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;
@@ -714,9 +699,12 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
json->create_id = rb_funcall(mJSON, i_create_id, 0);
json->object_class = Qnil;
json->array_class = Qnil;
- json->decimal_class = Qnil;
}
- source = convert_encoding(StringValue(source));
+ source = rb_convert_type(source, T_STRING, "String", "to_str");
+ if (!json->quirks_mode) {
+ source = convert_encoding(StringValue(source));
+ }
+ json->current_nesting = 0;
StringValue(source);
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
@@ -731,8 +719,56 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
include JSON_common;
+ action parse_object {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_object(json, fpc, pe, &result);
+ if (np == NULL) { fhold; fbreak; } else fexec np;
+ }
+
+ action parse_array {
+ char *np;
+ json->current_nesting = 1;
+ np = JSON_parse_array(json, fpc, pe, &result);
+ if (np == NULL) { fhold; fbreak; } else fexec np;
+ }
+
+ main := ignore* (
+ begin_object >parse_object |
+ begin_array >parse_array
+ ) ignore*;
+}%%
+
+static VALUE cParser_parse_strict(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+ %% write init;
+ p = json->source;
+ pe = p + json->len;
+ %% write exec;
+
+ if (cs >= JSON_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+
+%%{
+ machine JSON_quirks_mode;
+
+ write data;
+
+ include JSON_common;
+
action parse_value {
- char *np = JSON_parse_value(json, fpc, pe, &result, 0);
+ char *np = JSON_parse_value(json, fpc, pe, &result);
if (np == NULL) { fhold; fbreak; } else fexec np;
}
@@ -741,6 +777,26 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
) ignore*;
}%%
+static VALUE cParser_parse_quirks_mode(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+ %% write init;
+ p = json->source;
+ pe = p + json->len;
+ %% write exec;
+
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
+ return result;
+ } else {
+ rb_raise(eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
/*
* call-seq: parse()
*
@@ -749,65 +805,43 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
*/
static VALUE cParser_parse(VALUE self)
{
- char *p, *pe;
- int cs = EVIL;
- VALUE result = Qnil;
GET_PARSER;
- %% write init;
- p = json->source;
- pe = p + json->len;
- %% write exec;
-
- if (cs >= JSON_first_final && p == pe) {
- return result;
+ if (json->quirks_mode) {
+ return cParser_parse_quirks_mode(self);
} else {
- rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
- return Qnil;
+ return cParser_parse_strict(self);
}
}
-static void JSON_mark(void *ptr)
+
+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)
{
- JSON_Parser *json = ptr;
rb_gc_mark_maybe(json->Vsource);
rb_gc_mark_maybe(json->create_id);
rb_gc_mark_maybe(json->object_class);
rb_gc_mark_maybe(json->array_class);
- rb_gc_mark_maybe(json->decimal_class);
rb_gc_mark_maybe(json->match_string);
}
-static void JSON_free(void *ptr)
+static void JSON_free(JSON_Parser *json)
{
- 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;
- VALUE obj = TypedData_Make_Struct(klass, JSON_Parser, &JSON_Parser_type, json);
- json->fbuffer = fbuffer_alloc(0);
- return obj;
+ JSON_Parser *json = JSON_allocate();
+ return Data_Wrap_Struct(klass, JSON_mark, JSON_free, json);
}
/*
@@ -822,7 +856,19 @@ static VALUE cParser_source(VALUE self)
return rb_str_dup(json->Vsource);
}
-void Init_parser(void)
+/*
+ * call-seq: quirks_mode?()
+ *
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
+ */
+static VALUE cParser_quirks_mode_p(VALUE self)
+{
+ GET_PARSER;
+ return json->quirks_mode ? Qtrue : Qfalse;
+}
+
+
+void Init_parser()
{
rb_require("json/common");
mJSON = rb_define_module("JSON");
@@ -834,6 +880,7 @@ void Init_parser(void)
rb_define_method(cParser, "initialize", cParser_initialize, -1);
rb_define_method(cParser, "parse", cParser_parse, 0);
rb_define_method(cParser, "source", cParser_source, 0);
+ rb_define_method(cParser, "quirks_mode?", cParser_quirks_mode_p, 0);
CNaN = rb_const_get(mJSON, rb_intern("NaN"));
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
@@ -847,9 +894,9 @@ void Init_parser(void)
i_max_nesting = rb_intern("max_nesting");
i_allow_nan = rb_intern("allow_nan");
i_symbolize_names = rb_intern("symbolize_names");
+ i_quirks_mode = rb_intern("quirks_mode");
i_object_class = rb_intern("object_class");
i_array_class = rb_intern("array_class");
- i_decimal_class = rb_intern("decimal_class");
i_match = rb_intern("match");
i_match_string = rb_intern("match_string");
i_key_p = rb_intern("key?");
@@ -857,7 +904,18 @@ void Init_parser(void)
i_aset = rb_intern("[]=");
i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
- i_new = rb_intern("new");
+#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");
+#else
+ i_iconv = rb_intern("iconv");
+#endif
}
/*
diff --git a/ext/mathn/complex/complex.c b/ext/mathn/complex/complex.c
new file mode 100644
index 0000000000..dce494959f
--- /dev/null
+++ b/ext/mathn/complex/complex.c
@@ -0,0 +1,7 @@
+extern void nucomp_canonicalization(int);
+
+void
+Init_complex(void)
+{
+ nucomp_canonicalization(1);
+}
diff --git a/ext/mathn/complex/extconf.rb b/ext/mathn/complex/extconf.rb
new file mode 100644
index 0000000000..d4d14ffcb8
--- /dev/null
+++ b/ext/mathn/complex/extconf.rb
@@ -0,0 +1,3 @@
+require "mkmf"
+
+create_makefile "mathn/complex"
diff --git a/ext/mathn/rational/extconf.rb b/ext/mathn/rational/extconf.rb
new file mode 100644
index 0000000000..ba76306b7b
--- /dev/null
+++ b/ext/mathn/rational/extconf.rb
@@ -0,0 +1,3 @@
+require "mkmf"
+
+create_makefile "mathn/rational"
diff --git a/ext/mathn/rational/rational.c b/ext/mathn/rational/rational.c
new file mode 100644
index 0000000000..2ac5999946
--- /dev/null
+++ b/ext/mathn/rational/rational.c
@@ -0,0 +1,7 @@
+extern void nurat_canonicalization(int);
+
+void
+Init_rational(void)
+{
+ nurat_canonicalization(1);
+}
diff --git a/ext/nkf/depend b/ext/nkf/depend
index 4ea8544a95..f368cd51d7 100644
--- a/ext/nkf/depend
+++ b/ext/nkf/depend
@@ -1,24 +1,6 @@
-# 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/backward.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/onigmo.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
+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
diff --git a/ext/nkf/extconf.rb b/ext/nkf/extconf.rb
index f41f6b11dc..710662f19c 100644
--- a/ext/nkf/extconf.rb
+++ b/ext/nkf/extconf.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: false
require 'mkmf'
create_makefile('nkf')
diff --git a/ext/nkf/lib/kconv.rb b/ext/nkf/lib/kconv.rb
index f52b755288..f8c1ae8f59 100644
--- a/ext/nkf/lib/kconv.rb
+++ b/ext/nkf/lib/kconv.rb
@@ -1,4 +1,3 @@
-# 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 b58c437d3c..65d2c190ec 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.4"
-#define NKF_RELEASE_DATE "2015-12-12"
+#define NKF_VERSION "2.1.3"
+#define NKF_RELEASE_DATE "2013-11-22"
#define COPY_RIGHT \
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
- "Copyright (C) 1996-2015, The nkf Project."
+ "Copyright (C) 1996-2013, 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(void)
+nkf_locale_charmap()
{
#ifdef HAVE_LANGINFO_H
return nl_langinfo(CODESET);
@@ -802,7 +802,7 @@ nkf_locale_charmap(void)
}
static nkf_encoding*
-nkf_locale_encoding(void)
+nkf_locale_encoding()
{
nkf_encoding *enc = 0;
const char *encname = nkf_locale_charmap();
@@ -813,13 +813,13 @@ nkf_locale_encoding(void)
#endif /* DEFAULT_CODE_LOCALE */
static nkf_encoding*
-nkf_utf8_encoding(void)
+nkf_utf8_encoding()
{
return &nkf_encoding_table[UTF_8];
}
static nkf_encoding*
-nkf_default_encoding(void)
+nkf_default_encoding()
{
nkf_encoding *enc = 0;
#ifdef DEFAULT_CODE_LOCALE
@@ -3575,7 +3575,6 @@ 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){
@@ -3834,8 +3833,8 @@ fold_conv(nkf_char c2, nkf_char c1)
f_prev = c1;
f_line = 0;
fold_state = CR;
- } else if ((f_prev == c1)
- || (f_prev == LF)
+ } else if ((f_prev == c1 && !fold_preserve_f)
+ || (f_prev == LF && fold_preserve_f)
) { /* duplicate newline */
if (f_line) {
f_line = 0;
@@ -5436,8 +5435,8 @@ mime_putc(nkf_char c)
mimeout_state.buf[mimeout_state.count++] = (char)c;
if (mimeout_state.count>MIMEOUT_BUF_LENGTH) {
eof_mime();
- for (j=0;j<mimeout_state.count;j++) {
- (*o_mputc)(mimeout_state.buf[j]);
+ for (i=0;i<mimeout_state.count;i++) {
+ (*o_mputc)(mimeout_state.buf[i]);
base64_count++;
}
mimeout_state.count = 0;
@@ -5491,7 +5490,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)
@@ -5710,9 +5709,9 @@ module_connection(void)
if (nkf_enc_unicode_p(output_encoding))
output_mode = UTF_8;
- if (x0201_f == NKF_UNSPECIFIED) {
- x0201_f = X0201_DEFAULT;
- }
+ if (x0201_f == NKF_UNSPECIFIED) {
+ x0201_f = X0201_DEFAULT;
+ }
/* replace continuation module, from output side */
diff --git a/ext/nkf/nkf-utf8/utf8tbl.c b/ext/nkf/nkf-utf8/utf8tbl.c
index 3821c59468..e493c6beb5 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.c
+++ b/ext/nkf/nkf-utf8/utf8tbl.c
@@ -1,5 +1,5 @@
/*
- * utf8tbl.c - Conversion Table for nkf
+ * utf8tbl.c - Convertion Table for nkf
*
*/
diff --git a/ext/nkf/nkf-utf8/utf8tbl.h b/ext/nkf/nkf-utf8/utf8tbl.h
index 54a34271dd..96b61ed5a4 100644
--- a/ext/nkf/nkf-utf8/utf8tbl.h
+++ b/ext/nkf/nkf-utf8/utf8tbl.h
@@ -1,5 +1,5 @@
/*
- * utf8tbl.h - Header file for Conversion Table
+ * utf8tbl.h - Header file for Convertion Table
*
*/
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index c958c91753..2f36866ac4 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -137,7 +137,8 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
{
VALUE tmp;
reinit();
- nkf_split_options(StringValueCStr(opt));
+ StringValue(opt);
+ nkf_split_options(RSTRING_PTR(opt));
if (!output_encoding) rb_raise(rb_eArgError, "no output encoding given");
switch (nkf_enc_to_index(output_encoding)) {
@@ -152,7 +153,8 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
incsize = INCSIZE;
input_ctr = 0;
- input = (unsigned char *)StringValuePtr(src);
+ StringValue(src);
+ input = (unsigned char *)RSTRING_PTR(src);
i_len = RSTRING_LENINT(src);
tmp = rb_str_new(0, i_len*3 + 10);
@@ -193,7 +195,8 @@ rb_nkf_guess(VALUE obj, VALUE src)
reinit();
input_ctr = 0;
- input = (unsigned char *)StringValuePtr(src);
+ StringValue(src);
+ input = (unsigned char *)RSTRING_PTR(src);
i_len = RSTRING_LENINT(src);
guess_f = TRUE;
@@ -475,7 +478,7 @@ rb_nkf_guess(VALUE obj, VALUE src)
*/
void
-Init_nkf(void)
+Init_nkf()
{
VALUE mNKF = rb_define_module("NKF");
diff --git a/ext/objspace/depend b/ext/objspace/depend
index 642265618c..270bd911d3 100644
--- a/ext/objspace/depend
+++ b/ext/objspace/depend
@@ -1,75 +1,14 @@
-# AUTOGENERATED DEPENDENCIES START
-object_tracing.o: $(RUBY_EXTCONF_H)
-object_tracing.o: $(arch_hdrdir)/ruby/config.h
-object_tracing.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.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/onigmo.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: $(top_srcdir)/symbol.h
-objspace.o: objspace.c
-objspace.o: {$(VPATH)}id.h
-objspace_dump.o: $(RUBY_EXTCONF_H)
-objspace_dump.o: $(arch_hdrdir)/ruby/config.h
-objspace_dump.o: $(hdrdir)/ruby/backward.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/onigmo.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_assert.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
+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
diff --git a/ext/objspace/extconf.rb b/ext/objspace/extconf.rb
index d0c2dbd02b..23a42c4c20 100644
--- a/ext/objspace/extconf.rb
+++ b/ext/objspace/extconf.rb
@@ -1,4 +1,2 @@
-# frozen_string_literal: true
$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 611d059b9e..975518c654 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -13,9 +13,10 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/debug.h"
#include "objspace.h"
+#include "internal.h"
struct traceobj_arg {
int running;
@@ -356,7 +357,7 @@ allocation_sourcefile(VALUE self, VALUE obj)
}
/*
- * call-seq: allocation_sourceline(object) -> integer
+ * call-seq: allocation_sourceline(object) -> string
*
* Returns the original line from source for from the given +object+.
*
@@ -439,7 +440,7 @@ allocation_method_id(VALUE self, VALUE obj)
}
/*
- * call-seq: allocation_generation(object) -> integer or nil
+ * call-seq: allocation_generation(object) -> Fixnum
*
* Returns garbage collector generation for the given +object+.
*
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index d5e86353f1..88ebfca20e 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -12,13 +12,13 @@
**********************************************************************/
-#include "internal.h"
+#include <ruby/ruby.h>
#include <ruby/st.h>
#include <ruby/io.h>
#include <ruby/re.h>
#include "node.h"
#include "gc.h"
-#include "symbol.h"
+#include "internal.h"
/*
* call-seq:
@@ -31,9 +31,6 @@
* 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
@@ -57,11 +54,13 @@ 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);
@@ -123,26 +122,6 @@ 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)
{
@@ -185,7 +164,6 @@ 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);
@@ -203,7 +181,7 @@ type2sym(enum ruby_value_type i)
*
* Note that this information is incomplete. You need to deal with
* this information as only a *HINT*. Especially, total size of
- * T_DATA may be wrong.
+ * T_DATA may not right size.
*
* It returns a hash as:
* {:TOTAL=>1461154, :T_CLASS=>158280, :T_MODULE=>20672, :T_STRING=>527249, ...}
@@ -224,7 +202,12 @@ 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 = setup_hash(argc, 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");
+ }
for (i = 0; i <= T_MASK; i++) {
counts[i] = 0;
@@ -232,6 +215,13 @@ count_objects_size(int argc, VALUE *argv, VALUE os)
rb_objspace_each_objects(cos_i, &counts[0]);
+ if (hash == Qnil) {
+ hash = rb_hash_new();
+ }
+ else if (!RHASH_EMPTY_P(hash)) {
+ st_foreach(RHASH_TBL(hash), set_zero_i, hash);
+ }
+
for (i = 0; i <= T_MASK; i++) {
if (counts[i]) {
VALUE type = type2sym(i);
@@ -243,77 +233,6 @@ 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);
-
- 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)
{
@@ -357,8 +276,13 @@ static VALUE
count_nodes(int argc, VALUE *argv, VALUE os)
{
size_t nodes[NODE_LAST+1];
- enum node_type i;
- VALUE hash = setup_hash(argc, argv);
+ 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");
+ }
for (i = 0; i <= NODE_LAST; i++) {
nodes[i] = 0;
@@ -366,18 +290,24 @@ count_nodes(int argc, VALUE *argv, VALUE os)
rb_objspace_each_objects(cn_i, &nodes[0]);
+ if (hash == Qnil) {
+ hash = rb_hash_new();
+ }
+ else if (!RHASH_EMPTY_P(hash)) {
+ st_foreach(RHASH_TBL(hash), set_zero_i, hash);
+ }
+
for (i=0; i<NODE_LAST; i++) {
if (nodes[i] != 0) {
VALUE node;
switch (i) {
-#define COUNT_NODE(n) case n: node = ID2SYM(rb_intern(#n)); goto set
+#define COUNT_NODE(n) case n: node = ID2SYM(rb_intern(#n)); break;
COUNT_NODE(NODE_SCOPE);
COUNT_NODE(NODE_BLOCK);
COUNT_NODE(NODE_IF);
- COUNT_NODE(NODE_UNLESS);
COUNT_NODE(NODE_CASE);
- COUNT_NODE(NODE_CASE2);
COUNT_NODE(NODE_WHEN);
+ COUNT_NODE(NODE_OPT_N);
COUNT_NODE(NODE_WHILE);
COUNT_NODE(NODE_UNTIL);
COUNT_NODE(NODE_ITER);
@@ -398,18 +328,18 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_DASGN_CURR);
COUNT_NODE(NODE_GASGN);
COUNT_NODE(NODE_IASGN);
+ COUNT_NODE(NODE_IASGN2);
COUNT_NODE(NODE_CDECL);
COUNT_NODE(NODE_CVASGN);
+ COUNT_NODE(NODE_CVDECL);
COUNT_NODE(NODE_OP_ASGN1);
COUNT_NODE(NODE_OP_ASGN2);
COUNT_NODE(NODE_OP_ASGN_AND);
COUNT_NODE(NODE_OP_ASGN_OR);
COUNT_NODE(NODE_OP_CDECL);
COUNT_NODE(NODE_CALL);
- COUNT_NODE(NODE_OPCALL);
COUNT_NODE(NODE_FCALL);
COUNT_NODE(NODE_VCALL);
- COUNT_NODE(NODE_QCALL);
COUNT_NODE(NODE_SUPER);
COUNT_NODE(NODE_ZSUPER);
COUNT_NODE(NODE_ARRAY);
@@ -436,6 +366,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_DXSTR);
COUNT_NODE(NODE_EVSTR);
COUNT_NODE(NODE_DREGX);
+ COUNT_NODE(NODE_DREGX_ONCE);
COUNT_NODE(NODE_ARGS);
COUNT_NODE(NODE_ARGS_AUX);
COUNT_NODE(NODE_OPT_ARG);
@@ -444,6 +375,8 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ARGSCAT);
COUNT_NODE(NODE_ARGSPUSH);
COUNT_NODE(NODE_SPLAT);
+ COUNT_NODE(NODE_TO_ARY);
+ COUNT_NODE(NODE_BLOCK_ARG);
COUNT_NODE(NODE_BLOCK_PASS);
COUNT_NODE(NODE_DEFN);
COUNT_NODE(NODE_DEFS);
@@ -455,6 +388,7 @@ 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);
@@ -466,15 +400,17 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ERRINFO);
COUNT_NODE(NODE_DEFINED);
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);
COUNT_NODE(NODE_LAMBDA);
#undef COUNT_NODE
- case NODE_LAST: break;
+ default: node = INT2FIX(i);
}
- UNREACHABLE;
- set:
rb_hash_aset(hash, node, SIZET2NUM(nodes[i]));
}
}
@@ -548,87 +484,21 @@ cto_i(void *vstart, void *vend, size_t stride, void *data)
static VALUE
count_tdata_objects(int argc, VALUE *argv, VALUE self)
{
- VALUE hash = setup_hash(argc, argv);
- rb_objspace_each_objects(cto_i, (void *)hash);
- return hash;
-}
-
-static ID imemo_type_ids[IMEMO_MASK+1];
-
-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);
- }
+ VALUE hash;
- rb_hash_aset(hash, key, counter);
- }
+ if (rb_scan_args(argc, argv, "01", &hash) == 1) {
+ if (!RB_TYPE_P(hash, T_HASH))
+ rb_raise(rb_eTypeError, "non-hash given");
}
- 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");
- imemo_type_ids[8] = rb_intern("imemo_alloc");
- imemo_type_ids[9] = rb_intern("imemo_parser_strterm");
+ if (hash == Qnil) {
+ hash = rb_hash_new();
+ }
+ else if (!RHASH_EMPTY_P(hash)) {
+ st_foreach(RHASH_TBL(hash), set_zero_i, hash);
}
- rb_objspace_each_objects(count_imemo_objects_i, (void *)hash);
+ rb_objspace_each_objects(cto_i, (void *)hash);
return hash;
}
@@ -649,7 +519,7 @@ iow_size(const void *ptr)
static const rb_data_type_t iow_data_type = {
"ObjectSpace::InternalObjectWrapper",
{iow_mark, 0, iow_size,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE rb_mInternalObjectWrapper;
@@ -657,7 +527,7 @@ static VALUE rb_mInternalObjectWrapper;
static VALUE
iow_newobj(VALUE obj)
{
- return TypedData_Wrap_Struct(rb_mInternalObjectWrapper, &iow_data_type, (void *)obj);
+ return rb_data_typed_object_alloc(rb_mInternalObjectWrapper, (void *)obj, &iow_data_type);
}
/* Returns the type of the internal object. */
@@ -802,7 +672,8 @@ 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_ident_hash_new();
+ category_objects = data->last_category_objects = rb_hash_new();
+ rb_funcall(category_objects, rb_intern("compare_by_identity"), 0);
if (!NIL_P(rb_hash_lookup(data->categories, category_str))) {
rb_bug("reachable_object_from_root_i: category should insert at once");
}
@@ -838,82 +709,16 @@ static VALUE
reachable_objects_from_root(VALUE self)
{
struct rofr_data data;
- VALUE hash = data.categories = rb_ident_hash_new();
+ VALUE hash = data.categories = rb_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 (OBJ_BUILTIN_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);
@@ -945,17 +750,12 @@ 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 19ba1f2e8b..cb8f943d97 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -12,16 +12,17 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.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;
-static VALUE sym_full;
struct dump_config {
VALUE type;
@@ -32,10 +33,8 @@ struct dump_config {
VALUE cur_obj;
VALUE cur_obj_klass;
size_t cur_obj_references;
- int full_heap;
};
-PRINTF_ARGS(static void dump_append(struct dump_config *, const char *, ...), 2, 3);
static void
dump_append(struct dump_config *dc, const char *format, ...)
{
@@ -54,9 +53,8 @@ dump_append(struct dump_config *dc, const char *format, ...)
static void
dump_append_string_value(struct dump_config *dc, VALUE obj)
{
- long i;
- char c;
- const char *value;
+ int i;
+ char c, *value;
dump_append(dc, "\"");
for (i = 0, value = RSTRING_PTR(obj); i < RSTRING_LEN(obj); i++) {
@@ -93,19 +91,11 @@ 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)
{
switch (BUILTIN_TYPE(obj)) {
-#define CASE_TYPE(type) case T_##type: return #type
+#define CASE_TYPE(type) case T_##type: return #type; break
CASE_TYPE(NONE);
CASE_TYPE(NIL);
CASE_TYPE(OBJECT);
@@ -128,7 +118,6 @@ 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);
@@ -138,32 +127,6 @@ 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;
@@ -180,41 +143,6 @@ 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\":%"PRIuSIZE, rb_str_capacity(obj));
-
- if (is_ascii_string(obj)) {
- dump_append(dc, ", \"value\":");
- dump_append_string_value(dc, obj);
- }
-}
-
-static const char *
-imemo_name(int imemo)
-{
- switch(imemo) {
-#define TYPE_STR(t) case(imemo_##t): return #t
- TYPE_STR(env);
- TYPE_STR(cref);
- TYPE_STR(svar);
- TYPE_STR(throw_data);
- TYPE_STR(ifunc);
- TYPE_STR(memo);
- TYPE_STR(ment);
- TYPE_STR(iseq);
- TYPE_STR(alloc);
- TYPE_STR(ast);
- TYPE_STR(parser_strterm);
- default:
- return "unknown";
-#undef TYPE_STR
- }
-}
-
-static void
dump_object(VALUE obj, struct dump_config *dc)
{
size_t memsize;
@@ -223,11 +151,6 @@ 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);
@@ -243,16 +166,8 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, ", \"frozen\":true");
switch (BUILTIN_TYPE(obj)) {
- case T_NONE:
- dump_append(dc, "}\n");
- return;
-
- case T_IMEMO:
- dump_append(dc, ", \"imemo_type\":\"%s\"", imemo_name(imemo_type(obj)));
- break;
-
- case T_SYMBOL:
- dump_append_string_content(dc, rb_sym2str(obj));
+ case T_NODE:
+ dump_append(dc, ", \"node_type\":\"%s\"", ruby_node_name(nd_type(obj)));
break;
case T_STRING:
@@ -264,15 +179,23 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, ", \"fstring\":true");
if (STR_SHARED_P(obj))
dump_append(dc, ", \"shared\":true");
- else
- dump_append_string_content(dc, obj);
+ else {
+ 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);
+ }
+ }
if (!ENCODING_IS_ASCII8BIT(obj))
dump_append(dc, ", \"encoding\":\"%s\"", rb_enc_name(rb_enc_from_index(ENCODING_GET(obj))));
break;
case T_HASH:
- dump_append(dc, ", \"size\":%"PRIuSIZE, (size_t)RHASH_SIZE(obj));
+ dump_append(dc, ", \"size\":%ld", RHASH_SIZE(obj));
if (FL_TEST(obj, HASH_PROC_DEFAULT))
dump_append(dc, ", \"default\":\"%p\"", (void *)RHASH_IFNONE(obj));
break;
@@ -301,7 +224,7 @@ dump_object(VALUE obj, struct dump_config *dc)
break;
case T_OBJECT:
- dump_append(dc, ", \"ivars\":%u", ROBJECT_NUMIV(obj));
+ dump_append(dc, ", \"ivars\":%ld", ROBJECT_NUMIV(obj));
break;
case T_FILE:
@@ -346,11 +269,10 @@ dump_object(VALUE obj, struct dump_config *dc)
static int
heap_i(void *vstart, void *vend, size_t stride, void *data)
{
- struct dump_config *dc = (struct dump_config *)data;
VALUE v = (VALUE)vstart;
for (; v != (VALUE)vend; v += stride) {
- if (dc->full_heap || RBASIC(v)->flags)
- dump_object(v, dc);
+ if (RBASIC(v)->flags)
+ dump_object(v, data);
}
return 0;
}
@@ -376,15 +298,9 @@ dump_output(struct dump_config *dc, VALUE opts, VALUE output, const char *filena
{
VALUE tmp;
- dc->full_heap = 0;
-
- if (RTEST(opts)) {
+ if (RTEST(opts))
output = rb_hash_aref(opts, sym_output);
- if (Qtrue == rb_hash_lookup2(opts, sym_full, Qfalse))
- dc->full_heap = 1;
- }
-
if (output == sym_stdout) {
dc->stream = stdout;
dc->string = Qnil;
@@ -417,7 +333,7 @@ static VALUE
dump_result(struct dump_config *dc, VALUE output)
{
if (output == sym_string) {
- return rb_str_resurrect(dc->string);
+ return dc->string;
}
else if (output == sym_file) {
rb_io_flush(dc->string);
@@ -509,7 +425,6 @@ Init_objspace_dump(VALUE rb_mObjSpace)
sym_stdout = ID2SYM(rb_intern("stdout"));
sym_string = ID2SYM(rb_intern("string"));
sym_file = ID2SYM(rb_intern("file"));
- sym_full = ID2SYM(rb_intern("full"));
/* force create static IDs */
rb_obj_gc_flags(rb_mObjSpace, 0, 0);
diff --git a/ext/openssl/History.md b/ext/openssl/History.md
deleted file mode 100644
index db5050014e..0000000000
--- a/ext/openssl/History.md
+++ /dev/null
@@ -1,339 +0,0 @@
-Version 2.1.2
-=============
-
-Merged changes in 2.0.9.
-
-
-Version 2.1.1
-=============
-
-Merged changes in 2.0.8.
-
-
-Version 2.1.0
-=============
-
-Notable changes
----------------
-
-* Support for OpenSSL versions before 1.0.1 and LibreSSL versions before 2.5
- is removed.
- [[GitHub #86]](https://github.com/ruby/openssl/pull/86)
-* OpenSSL::BN#negative?, #+@, and #-@ are added.
-* OpenSSL::SSL::SSLSocket#connect raises a more informative exception when
- certificate verification fails.
- [[GitHub #99]](https://github.com/ruby/openssl/pull/99)
-* OpenSSL::KDF module is newly added. In addition to PBKDF2-HMAC that has moved
- from OpenSSL::PKCS5, scrypt and HKDF are supported.
- [[GitHub #109]](https://github.com/ruby/openssl/pull/109)
- [[GitHub #173]](https://github.com/ruby/openssl/pull/173)
-* OpenSSL.fips_mode is added. We had the setter, but not the getter.
- [[GitHub #125]](https://github.com/ruby/openssl/pull/125)
-* OpenSSL::OCSP::Request#signed? is added.
-* OpenSSL::ASN1 handles the indefinite length form better. OpenSSL::ASN1.decode
- no longer wrongly treats the end-of-contents octets as part of the content.
- OpenSSL::ASN1::ASN1Data#infinite_length is renamed to #indefinite_length.
- [[GitHub #98]](https://github.com/ruby/openssl/pull/98)
-* OpenSSL::X509::Name#add_entry now accepts two additional keyword arguments
- 'loc' and 'set'.
- [[GitHub #94]](https://github.com/ruby/openssl/issues/94)
-* OpenSSL::SSL::SSLContext#min_version= and #max_version= are added to replace
- #ssl_version= that was built on top of the deprecated OpenSSL C API. Use of
- that method and the constant OpenSSL::SSL::SSLContext::METHODS is now
- deprecated.
- [[GitHub #142]](https://github.com/ruby/openssl/pull/142)
-* OpenSSL::X509::Name#to_utf8 is added.
- [[GitHub #26]](https://github.com/ruby/openssl/issues/26)
- [[GitHub #143]](https://github.com/ruby/openssl/pull/143)
-* OpenSSL::X509::{Extension,Attribute,Certificate,CRL,Revoked,Request} can be
- compared with == operator.
- [[GitHub #161]](https://github.com/ruby/openssl/pull/161)
-* TLS Fallback Signaling Cipher Suite Value (SCSV) support is added.
- [[GitHub #165]](https://github.com/ruby/openssl/pull/165)
-* Build failure with OpenSSL 1.1 built with no-deprecated is fixed.
- [[GitHub #160]](https://github.com/ruby/openssl/pull/160)
-* OpenSSL::Buffering#write accepts an arbitrary number of arguments.
- [[Feature #9323]](https://bugs.ruby-lang.org/issues/9323)
- [[GitHub #162]](https://github.com/ruby/openssl/pull/162)
-* OpenSSL::PKey::RSA#sign_pss and #verify_pss are added. They perform RSA-PSS
- signature and verification.
- [[GitHub #75]](https://github.com/ruby/openssl/issues/75)
- [[GitHub #76]](https://github.com/ruby/openssl/pull/76)
- [[GitHub #169]](https://github.com/ruby/openssl/pull/169)
-* OpenSSL::SSL::SSLContext#add_certificate is added.
- [[GitHub #167]](https://github.com/ruby/openssl/pull/167)
-* OpenSSL::PKey::EC::Point#to_octet_string is added.
- OpenSSL::PKey::EC::Point.new can now take String as the second argument.
- [[GitHub #177]](https://github.com/ruby/openssl/pull/177)
-
-
-Version 2.0.9
-=============
-
-Security fixes
---------------
-
-* OpenSSL::X509::Name#<=> could incorrectly return 0 (= equal) for non-equal
- objects. CVE-2018-16395 is assigned for this issue.
- https://hackerone.com/reports/387250
-
-Bug fixes
----------
-
-* Fixed OpenSSL::PKey::*.{new,generate} immediately aborting if the thread is
- interrupted.
- [[Bug #14882]](https://bugs.ruby-lang.org/issues/14882)
- [[GitHub #205]](https://github.com/ruby/openssl/pull/205)
-* Fixed OpenSSL::X509::Name#to_s failing with OpenSSL::X509::NameError if
- called against an empty instance.
- [[GitHub #200]](https://github.com/ruby/openssl/issues/200)
- [[GitHub #211]](https://github.com/ruby/openssl/pull/211)
-
-
-Version 2.0.8
-=============
-
-Bug fixes
----------
-
-* OpenSSL::Cipher#pkcs5_keyivgen raises an error when a negative iteration
- count is given.
- [[GitHub #184]](https://github.com/ruby/openssl/pull/184)
-* Fixed build with LibreSSL 2.7.
- [[GitHub #192]](https://github.com/ruby/openssl/issues/192)
- [[GitHub #193]](https://github.com/ruby/openssl/pull/193)
-
-
-Version 2.0.7
-=============
-
-Bug fixes
----------
-
-* OpenSSL::Cipher#auth_data= could segfault if called against a non-AEAD cipher.
- [[Bug #14024]](https://bugs.ruby-lang.org/issues/14024)
-* OpenSSL::X509::Certificate#public_key= (and similar methods) could segfault
- when an instance of OpenSSL::PKey::PKey with no public key components is
- passed.
- [[Bug #14087]](https://bugs.ruby-lang.org/issues/14087)
- [[GitHub #168]](https://github.com/ruby/openssl/pull/168)
-
-
-Version 2.0.6
-=============
-
-Bug fixes
----------
-
-* The session_remove_cb set to an OpenSSL::SSL::SSLContext is no longer called
- during GC.
-* A possible deadlock in OpenSSL::SSL::SSLSocket#sysread is fixed.
- [[GitHub #139]](https://github.com/ruby/openssl/pull/139)
-* OpenSSL::BN#hash could return an unnormalized fixnum value on Windows.
- [[Bug #13877]](https://bugs.ruby-lang.org/issues/13877)
-* OpenSSL::SSL::SSLSocket#sysread and #sysread_nonblock set the length of the
- destination buffer String to 0 on error.
- [[GitHub #153]](https://github.com/ruby/openssl/pull/153)
-* Possible deadlock is fixed. This happened only when built with older versions
- of OpenSSL (before 1.1.0) or LibreSSL.
- [[GitHub #155]](https://github.com/ruby/openssl/pull/155)
-
-
-Version 2.0.5
-=============
-
-Bug fixes
----------
-
-* Reading a PEM/DER-encoded private key or certificate from an IO object did
- not work properly on mswin platforms.
- [[ruby/openssl#128]](https://github.com/ruby/openssl/issues/128)
-* Broken length check in the PEM passphrase callback is fixed.
-* It failed to compile when OpenSSL is configured without TLS 1.0 support.
-
-
-Version 2.0.4
-=============
-
-Bug fixes
----------
-
-* It now compiles with LibreSSL without renaming on Windows (mswin).
-* A workaround for the error queue leak of X509_load_cert_crl_file() that
- causes random errors is added.
- [[Bug #11033]](https://bugs.ruby-lang.org/issues/11033)
-
-
-Version 2.0.3
-=============
-
-Bug fixes
----------
-
-* OpenSSL::ASN1::Constructive#each which was broken by 2.0.0 is fixed.
- [[ruby/openssl#96]](https://github.com/ruby/openssl/pull/96)
-* Fixed build with static OpenSSL libraries on Windows.
- [[Bug #13080]](https://bugs.ruby-lang.org/issues/13080)
-* OpenSSL::X509::Name#eql? which was broken by 2.0.0 is fixed.
-
-
-Version 2.0.2
-=============
-
-Bug fixes
----------
-
-* Fix build with early 0.9.8 series which did not have SSL_CTX_clear_options().
- [ruby-core:78693]
-
-
-Version 2.0.1
-=============
-
-Bug fixes
----------
-
-* A GC issue around OpenSSL::BN is fixed.
- [[ruby/openssl#87]](https://github.com/ruby/openssl/issues/87)
-* OpenSSL::ASN1 now parses BER encoding of GeneralizedTime without seconds.
- [[ruby/openssl#88]](https://github.com/ruby/openssl/pull/88)
-
-
-Version 2.0.0
-=============
-
-This is the first release of openssl gem, formerly a standard library of Ruby,
-ext/openssl. This is the successor of the version included in Ruby 2.3.
-
-Compatibility notes
--------------------
-
-* Support for OpenSSL version 0.9.6 and 0.9.7 is completely removed. openssl gem
- still works with OpenSSL 0.9.8, but users are strongly encouraged to upgrade
- to at least 1.0.1, as OpenSSL < 1.0.1 will not receive any security fixes from
- the OpenSSL development team.
-
-Supported platforms
--------------------
-
-* OpenSSL 1.0.0, 1.0.1, 1.0.2, 1.1.0
-* OpenSSL < 0.9.8 is no longer supported.
-* LibreSSL 2.3, 2.4, 2.5
-* Ruby 2.3, 2.4
-
-Notable changes
----------------
-
-* Add support for OpenSSL 1.1.0.
- [[Feature #12324]](https://bugs.ruby-lang.org/issues/12324)
-* Add support for LibreSSL
-
-* OpenSSL::Cipher
-
- - OpenSSL::Cipher#key= and #iv= reject too long inputs. They used to truncate
- silently. [[Bug #12561]](https://bugs.ruby-lang.org/issues/12561)
-
- - OpenSSL::Cipher#iv_len= is added. It allows changing IV (nonce) length if
- using AEAD ciphers.
- [[Bug #8667]](https://bugs.ruby-lang.org/issues/8667),
- [[Bug #10420]](https://bugs.ruby-lang.org/issues/10420),
- [[GH ruby/ruby#569]](https://github.com/ruby/ruby/pull/569),
- [[GH ruby/openssl#58]](https://github.com/ruby/openssl/pull/58)
-
- - OpenSSL::Cipher#auth_tag_len= is added. This sets the authentication tag
- length to be generated by an AEAD cipher.
-
-* OpenSSL::OCSP
-
- - Accessor methods are added to OpenSSL::OCSP::CertificateId.
- [[Feature #7181]](https://bugs.ruby-lang.org/issues/7181)
-
- - OpenSSL::OCSP::Request and BasicResponse can be signed with non-SHA-1 hash
- algorithm. [[Feature #11552]](https://bugs.ruby-lang.org/issues/11552)
-
- - OpenSSL::OCSP::CertificateId and BasicResponse can be encoded into DER.
-
- - A new class OpenSSL::OCSP::SingleResponse is added for convenience.
-
- - OpenSSL::OCSP::BasicResponse#add_status accepts absolute times. They used to
- accept only relative seconds from the current time.
-
-* OpenSSL::PKey
-
- - OpenSSL::PKey::EC follows the general PKey interface.
- [[Bug #6567]](https://bugs.ruby-lang.org/issues/6567)
-
- - OpenSSL::PKey.read raises OpenSSL::PKey::PKeyError instead of ArgumentError
- for consistency with OpenSSL::PKey::{DH,DSA,RSA,EC}#new.
- [[Bug #11774]](https://bugs.ruby-lang.org/issues/11774),
- [[GH ruby/openssl#55]](https://github.com/ruby/openssl/pull/55)
-
- - OpenSSL::PKey::EC::Group retrieved by OpenSSL::PKey::EC#group is no longer
- linked with the EC key. Modifications to the EC::Group have no effect on the
- key. [[GH ruby/openssl#71]](https://github.com/ruby/openssl/pull/71)
-
- - OpenSSL::PKey::EC::Point#to_bn allows specifying the point conversion form
- by the optional argument.
-
-* OpenSSL::SSL
-
- - OpenSSL::SSL::SSLSocket#tmp_key is added. A client can call it after the
- connection is established to retrieve the ephemeral key.
- [[GH ruby/ruby#1318]](https://github.com/ruby/ruby/pull/1318)
-
- - The automatic ephemeral ECDH curve selection is enabled by default when
- built with OpenSSL >= 1.0.2 or LibreSSL.
-
- - OpenSSL::SSL::SSLContext#security_level= is added. You can set the "security
- level" of the SSL context. This is effective only when built with OpenSSL
- 1.1.0.
-
- - A new option 'verify_hostname' is added to OpenSSL::SSL::SSLContext. When it
- is enabled, and the SNI hostname is also set, the hostname verification on
- the server certificate is automatically performed. It is now enabled by
- OpenSSL::SSL::SSLContext#set_params.
- [[GH ruby/openssl#60]](https://github.com/ruby/openssl/pull/60)
-
-Removals
---------
-
-* OpenSSL::Engine
-
- - OpenSSL::Engine.cleanup does nothing when built with OpenSSL 1.1.0.
-
-* OpenSSL::SSL
-
- - OpenSSL::PKey::DH::DEFAULT_512 is removed. Hence servers no longer use
- 512-bit DH group by default. It is considered too weak nowadays.
- [[Bug #11968]](https://bugs.ruby-lang.org/issues/11968),
- [[GH ruby/ruby#1196]](https://github.com/ruby/ruby/pull/1196)
-
- - RC4 cipher suites are removed from OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.
- RC4 is now considered to be weak.
- [[GH ruby/openssl#50]](https://github.com/ruby/openssl/pull/50)
-
-Deprecations
-------------
-
-* OpenSSL::PKey
-
- - OpenSSL::PKey::RSA#n=, #e=, #d=, #p=, #q=, #dmp1=, #dmq1=, #iqmp=,
- OpenSSL::PKey::DSA#p=, #q=, #g=, #priv_key=, #pub_key=,
- OpenSSL::PKey::DH#p=, #g=, #priv_key= and #pub_key= are deprecated. They are
- disabled when built with OpenSSL 1.1.0, due to its API change. Instead,
- OpenSSL::PKey::RSA#set_key, #set_factors, #set_crt_params,
- OpenSSL::PKey::DSA#set_pqg, #set_key, OpenSSL::PKey::DH#set_pqg and #set_key
- are added.
-
-* OpenSSL::Random
-
- - OpenSSL::Random.pseudo_bytes is deprecated, and not defined when built with
- OpenSSL 1.1.0. Use OpenSSL::Random.random_bytes instead.
-
-* OpenSSL::SSL
-
- - OpenSSL::SSL::SSLContext#tmp_ecdh_callback is deprecated, as the underlying
- API SSL_CTX_set_tmp_ecdh_callback() is removed in OpenSSL 1.1.0. It was
- first added in Ruby 2.3.0. To specify the curve to be used in ephemeral
- ECDH, use OpenSSL::SSL::SSLContext#ecdh_curves=. The automatic curve
- selection is also now enabled by default when built with a capable OpenSSL.
diff --git a/ext/openssl/depend b/ext/openssl/depend
index 021c6d99a8..23bebd8cc8 100644
--- a/ext/openssl/depend
+++ b/ext/openssl/depend
@@ -1,1154 +1,6 @@
-# AUTOGENERATED DEPENDENCIES START
-openssl_missing.o: $(RUBY_EXTCONF_H)
-openssl_missing.o: $(arch_hdrdir)/ruby/config.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/backward.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/onigmo.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
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h \
+ $(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_kdf.h
-ossl.o: ossl_ns_spki.h
-ossl.o: ossl_ocsp.h
-ossl.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_asn1.o: ossl_ns_spki.h
-ossl_asn1.o: ossl_ocsp.h
-ossl_asn1.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_bio.o: ossl_ns_spki.h
-ossl_bio.o: ossl_ocsp.h
-ossl_bio.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_bn.o: ossl_ns_spki.h
-ossl_bn.o: ossl_ocsp.h
-ossl_bn.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_cipher.o: ossl_ns_spki.h
-ossl_cipher.o: ossl_ocsp.h
-ossl_cipher.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_config.o: ossl_ns_spki.h
-ossl_config.o: ossl_ocsp.h
-ossl_config.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_digest.o: ossl_ns_spki.h
-ossl_digest.o: ossl_ocsp.h
-ossl_digest.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_engine.o: ossl_ns_spki.h
-ossl_engine.o: ossl_ocsp.h
-ossl_engine.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_hmac.o: ossl_ns_spki.h
-ossl_hmac.o: ossl_ocsp.h
-ossl_hmac.o: ossl_pkcs12.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_kdf.o: $(RUBY_EXTCONF_H)
-ossl_kdf.o: $(arch_hdrdir)/ruby/config.h
-ossl_kdf.o: $(hdrdir)/ruby/backward.h
-ossl_kdf.o: $(hdrdir)/ruby/defines.h
-ossl_kdf.o: $(hdrdir)/ruby/encoding.h
-ossl_kdf.o: $(hdrdir)/ruby/intern.h
-ossl_kdf.o: $(hdrdir)/ruby/io.h
-ossl_kdf.o: $(hdrdir)/ruby/missing.h
-ossl_kdf.o: $(hdrdir)/ruby/onigmo.h
-ossl_kdf.o: $(hdrdir)/ruby/oniguruma.h
-ossl_kdf.o: $(hdrdir)/ruby/ruby.h
-ossl_kdf.o: $(hdrdir)/ruby/st.h
-ossl_kdf.o: $(hdrdir)/ruby/subst.h
-ossl_kdf.o: $(hdrdir)/ruby/thread.h
-ossl_kdf.o: $(top_srcdir)/include/ruby.h
-ossl_kdf.o: openssl_missing.h
-ossl_kdf.o: ossl.h
-ossl_kdf.o: ossl_asn1.h
-ossl_kdf.o: ossl_bio.h
-ossl_kdf.o: ossl_bn.h
-ossl_kdf.o: ossl_cipher.h
-ossl_kdf.o: ossl_config.h
-ossl_kdf.o: ossl_digest.h
-ossl_kdf.o: ossl_engine.h
-ossl_kdf.o: ossl_hmac.h
-ossl_kdf.o: ossl_kdf.c
-ossl_kdf.o: ossl_kdf.h
-ossl_kdf.o: ossl_ns_spki.h
-ossl_kdf.o: ossl_ocsp.h
-ossl_kdf.o: ossl_pkcs12.h
-ossl_kdf.o: ossl_pkcs7.h
-ossl_kdf.o: ossl_pkey.h
-ossl_kdf.o: ossl_rand.h
-ossl_kdf.o: ossl_ssl.h
-ossl_kdf.o: ossl_version.h
-ossl_kdf.o: ossl_x509.h
-ossl_kdf.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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.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_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_pkcs7.o: $(RUBY_EXTCONF_H)
-ossl_pkcs7.o: $(arch_hdrdir)/ruby/config.h
-ossl_pkcs7.o: $(hdrdir)/ruby/backward.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/onigmo.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_kdf.h
-ossl_pkcs7.o: ossl_ns_spki.h
-ossl_pkcs7.o: ossl_ocsp.h
-ossl_pkcs7.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_pkey.o: ossl_ns_spki.h
-ossl_pkey.o: ossl_ocsp.h
-ossl_pkey.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.h
-ossl_rand.o: ossl_ns_spki.h
-ossl_rand.o: ossl_ocsp.h
-ossl_rand.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_ssl.o: ossl_ns_spki.h
-ossl_ssl.o: ossl_ocsp.h
-ossl_ssl.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.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_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/backward.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/onigmo.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_kdf.h
-ossl_x509.o: ossl_ns_spki.h
-ossl_x509.o: ossl_ocsp.h
-ossl_x509.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509attr.o: ossl_ns_spki.h
-ossl_x509attr.o: ossl_ocsp.h
-ossl_x509attr.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509cert.o: ossl_ns_spki.h
-ossl_x509cert.o: ossl_ocsp.h
-ossl_x509cert.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509crl.o: ossl_ns_spki.h
-ossl_x509crl.o: ossl_ocsp.h
-ossl_x509crl.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509ext.o: ossl_ns_spki.h
-ossl_x509ext.o: ossl_ocsp.h
-ossl_x509ext.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509name.o: ossl_ns_spki.h
-ossl_x509name.o: ossl_ocsp.h
-ossl_x509name.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509req.o: ossl_ns_spki.h
-ossl_x509req.o: ossl_ocsp.h
-ossl_x509req.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509revoked.o: ossl_ns_spki.h
-ossl_x509revoked.o: ossl_ocsp.h
-ossl_x509revoked.o: ossl_pkcs12.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/backward.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/onigmo.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_kdf.h
-ossl_x509store.o: ossl_ns_spki.h
-ossl_x509store.o: ossl_ocsp.h
-ossl_x509store.o: ossl_pkcs12.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 1d51d065a9..39ebfa0d37 100644
--- a/ext/openssl/deprecation.rb
+++ b/ext/openssl/deprecation.rb
@@ -1,8 +1,10 @@
-# frozen_string_literal: false
module OpenSSL
def self.deprecated_warning_flag
unless flag = (@deprecated_warning_flag ||= nil)
if try_compile("", flag = "-Werror=deprecated-declarations")
+ if with_config("broken-apple-openssl")
+ flag = "-Wno-deprecated-declarations"
+ end
$warnflags << " #{flag}"
else
flag = ""
@@ -13,11 +15,7 @@ module OpenSSL
end
def self.check_func(func, header)
- have_func(func, header, deprecated_warning_flag)
- end
-
- def self.check_func_or_macro(func, header)
- check_func(func, header) or
- have_macro(func, header) && $defs.push("-DHAVE_#{func.upcase}")
+ have_func(func, header, deprecated_warning_flag) and
+ have_header(header, nil, deprecated_warning_flag)
end
end
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 4f218562b1..e272cba092 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -1,14 +1,18 @@
# -*- 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 licensed under the same licence as Ruby.
+ This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
+
+= Version
+ $Id$
=end
require "mkmf"
@@ -19,155 +23,138 @@ dir_config("kerberos")
Logging::message "=== OpenSSL for Ruby configurator ===\n"
-# Add -Werror=deprecated-declarations to $warnflags if available
-OpenSSL.deprecated_warning_flag
-
##
# Adds -DOSSL_DEBUG for compilation and some more targets when GCC is used
# To turn it on, use: --with-debug or --enable-debug
#
if with_config("debug") or enable_config("debug")
- $defs.push("-DOSSL_DEBUG")
+ $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end
Logging::message "=== Checking for system dependent stuff... ===\n"
have_library("nsl", "t_open")
have_library("socket", "socket")
-if $mswin || $mingw
- have_library("ws2_32")
-end
+have_header("assert.h")
Logging::message "=== Checking for required stuff... ===\n"
-result = pkg_config("openssl") && have_header("openssl/ssl.h")
-
-def find_openssl_library
- if $mswin || $mingw
- # required for static OpenSSL libraries
- have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
- have_library("crypt32")
- end
-
- return false unless have_header("openssl/ssl.h")
-
- ret = have_library("crypto", "CRYPTO_malloc") &&
- have_library("ssl", "SSL_new")
- return ret if ret
-
- if $mswin
- # OpenSSL >= 1.1.0: libcrypto.lib and libssl.lib.
- if have_library("libcrypto", "CRYPTO_malloc") &&
- have_library("libssl", "SSL_new")
- return true
- end
-
- # OpenSSL <= 1.0.2: libeay32.lib and ssleay32.lib.
- if have_library("libeay32", "CRYPTO_malloc") &&
- have_library("ssleay32", "SSL_new")
- return true
- end
-
- # LibreSSL: libcrypto-##.lib and libssl-##.lib, where ## is the ABI version
- # number. We have to find the version number out by scanning libpath.
- libpath = $LIBPATH.dup
- libpath |= ENV["LIB"].split(File::PATH_SEPARATOR)
- libpath.map! { |d| d.tr(File::ALT_SEPARATOR, File::SEPARATOR) }
-
- ret = [
- ["crypto", "CRYPTO_malloc"],
- ["ssl", "SSL_new"]
- ].all? do |base, func|
- result = false
- libs = ["lib#{base}-[0-9][0-9]", "lib#{base}-[0-9][0-9][0-9]"]
- libs = Dir.glob(libs.map{|l| libpath.map{|d| File.join(d, l + ".*")}}.flatten).map{|path| File.basename(path, ".*")}.uniq
- libs.each do |lib|
- result = have_library(lib, func)
- break if result
- end
- result
- end
- return ret if ret
- end
- return false
+if $mingw
+ have_library("wsock32")
+ have_library("gdi32")
end
+result = pkg_config("openssl") && have_header("openssl/ssl.h")
+
unless result
- unless find_openssl_library
+ result = have_header("openssl/ssl.h")
+ result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "OpenSSL_add_all_digests")}
+ result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_library_init")}
+ unless result
Logging::message "=== Checking for required stuff failed. ===\n"
Logging::message "Makefile wasn't created. Fix the errors above.\n"
- raise "OpenSSL library could not be found. You might want to use " \
- "--with-openssl-dir=<dir> option to specify the prefix where OpenSSL " \
- "is installed."
+ exit 1
end
end
-unless checking_for("OpenSSL version is 1.0.1 or later") {
- try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10001000L", "openssl/opensslv.h") }
- raise "OpenSSL >= 1.0.1 or LibreSSL is required"
+unless have_header("openssl/conf_api.h")
+ raise "OpenSSL 0.9.6 or later required."
end
-
-Logging::message "=== Checking for OpenSSL features... ===\n"
-# compile options
-have_func("RAND_egd")
-engines = %w{builtin_engines openbsd_dev_crypto dynamic 4758cca aep atalla chil
- cswift nuron sureware ubsec padlock capi gmp gost cryptodev aesni}
-engines.each { |name|
- OpenSSL.check_func_or_macro("ENGINE_load_#{name}", "openssl/engine.h")
-}
-
-if ($mswin || $mingw) && have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
- $defs.push("-DNOCRYPT")
+unless OpenSSL.check_func("SSL_library_init()", "openssl/ssl.h")
+ raise "Ignore OpenSSL broken by Apple.\nPlease use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')"
end
-# added in 1.0.2
-have_func("EC_curve_nist2nid")
-have_func("X509_REVOKED_dup")
-have_func("X509_STORE_CTX_get0_store")
-have_func("SSL_CTX_set_alpn_select_cb")
-OpenSSL.check_func_or_macro("SSL_CTX_set1_curves_list", "openssl/ssl.h")
-OpenSSL.check_func_or_macro("SSL_CTX_set_ecdh_auto", "openssl/ssl.h")
-OpenSSL.check_func_or_macro("SSL_get_server_tmp_key", "openssl/ssl.h")
-have_func("SSL_is_server")
-
-# added in 1.1.0
-if !have_struct_member("SSL", "ctx", "openssl/ssl.h") ||
- try_static_assert("LIBRESSL_VERSION_NUMBER >= 0x2070000fL", "openssl/opensslv.h")
- $defs.push("-DHAVE_OPAQUE_OPENSSL")
-end
-have_func("CRYPTO_lock") || $defs.push("-DHAVE_OPENSSL_110_THREADING_API")
-have_func("BN_GENCB_new")
-have_func("BN_GENCB_free")
-have_func("BN_GENCB_get_arg")
-have_func("EVP_MD_CTX_new")
-have_func("EVP_MD_CTX_free")
-have_func("HMAC_CTX_new")
-have_func("HMAC_CTX_free")
-OpenSSL.check_func("RAND_pseudo_bytes", "openssl/rand.h") # deprecated
+Logging::message "=== Checking for OpenSSL features... ===\n"
+have_func("ERR_peek_last_error")
+have_func("ASN1_put_eoc")
+have_func("BN_mod_add")
+have_func("BN_mod_sqr")
+have_func("BN_mod_sub")
+have_func("BN_pseudo_rand_range")
+have_func("BN_rand_range")
+have_func("CONF_get1_default_config_file")
+have_func("EVP_CIPHER_CTX_copy")
+have_func("EVP_CIPHER_CTX_set_padding")
+have_func("EVP_CipherFinal_ex")
+have_func("EVP_CipherInit_ex")
+have_func("EVP_DigestFinal_ex")
+have_func("EVP_DigestInit_ex")
+have_func("EVP_MD_CTX_cleanup")
+have_func("EVP_MD_CTX_create")
+have_func("EVP_MD_CTX_destroy")
+have_func("EVP_MD_CTX_init")
+have_func("HMAC_CTX_cleanup")
+have_func("HMAC_CTX_copy")
+have_func("HMAC_CTX_init")
+have_func("PEM_def_callback")
+have_func("PKCS5_PBKDF2_HMAC")
+have_func("PKCS5_PBKDF2_HMAC_SHA1")
+have_func("X509V3_set_nconf")
+have_func("X509V3_EXT_nconf_nid")
+have_func("X509_CRL_add0_revoked")
+have_func("X509_CRL_set_issuer_name")
+have_func("X509_CRL_set_version")
+have_func("X509_CRL_sort")
+have_func("X509_NAME_hash_old")
have_func("X509_STORE_get_ex_data")
have_func("X509_STORE_set_ex_data")
-have_func("X509_CRL_get0_signature")
-have_func("X509_REQ_get0_signature")
-have_func("X509_REVOKED_get0_serialNumber")
-have_func("X509_REVOKED_get0_revocationDate")
-have_func("X509_get0_tbs_sigalg")
-have_func("X509_STORE_CTX_get0_untrusted")
-have_func("X509_STORE_CTX_get0_cert")
-have_func("X509_STORE_CTX_get0_chain")
-have_func("OCSP_SINGLERESP_get0_id")
-have_func("SSL_CTX_get_ciphers")
-have_func("X509_up_ref")
-have_func("X509_CRL_up_ref")
-have_func("X509_STORE_up_ref")
-have_func("SSL_SESSION_up_ref")
-have_func("EVP_PKEY_up_ref")
-OpenSSL.check_func_or_macro("SSL_CTX_set_tmp_ecdh_callback", "openssl/ssl.h") # removed
-OpenSSL.check_func_or_macro("SSL_CTX_set_min_proto_version", "openssl/ssl.h")
-have_func("SSL_CTX_get_security_level")
-have_func("X509_get0_notBefore")
-have_func("SSL_SESSION_get_protocol_version")
-have_func("EVP_PBE_scrypt")
+have_func("OBJ_NAME_do_all_sorted")
+have_func("SSL_SESSION_get_id")
+have_func("SSL_SESSION_cmp")
+have_func("OPENSSL_cleanse")
+have_func("SSLv2_method")
+have_func("SSLv2_server_method")
+have_func("SSLv2_client_method")
+have_func("TLSv1_1_method")
+have_func("TLSv1_1_server_method")
+have_func("TLSv1_1_client_method")
+have_func("TLSv1_2_method")
+have_func("TLSv1_2_server_method")
+have_func("TLSv1_2_client_method")
+have_macro("OPENSSL_NPN_NEGOTIATED", ['openssl/ssl.h']) && $defs.push("-DHAVE_OPENSSL_NPN_NEGOTIATED")
+unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
+ have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
+end
+if have_header("openssl/engine.h")
+ have_func("ENGINE_add")
+ have_func("ENGINE_load_builtin_engines")
+ have_func("ENGINE_load_openbsd_dev_crypto")
+ have_func("ENGINE_get_digest")
+ have_func("ENGINE_get_cipher")
+ have_func("ENGINE_cleanup")
+ have_func("ENGINE_load_dynamic")
+ have_func("ENGINE_load_4758cca")
+ have_func("ENGINE_load_aep")
+ have_func("ENGINE_load_atalla")
+ have_func("ENGINE_load_chil")
+ have_func("ENGINE_load_cswift")
+ have_func("ENGINE_load_nuron")
+ have_func("ENGINE_load_sureware")
+ have_func("ENGINE_load_ubsec")
+ have_func("ENGINE_load_padlock")
+ have_func("ENGINE_load_capi")
+ have_func("ENGINE_load_gmp")
+ have_func("ENGINE_load_gost")
+ have_func("ENGINE_load_cryptodev")
+ have_func("ENGINE_load_aesni")
+end
+have_func("DH_generate_parameters_ex")
+have_func("DSA_generate_parameters_ex")
+have_func("RSA_generate_key_ex")
+if checking_for('OpenSSL version is 0.9.7 or later') {
+ try_static_assert('OPENSSL_VERSION_NUMBER >= 0x00907000L', 'openssl/opensslv.h')
+ }
+ have_header("openssl/ocsp.h")
+end
+have_struct_member("CRYPTO_THREADID", "ptr", "openssl/crypto.h")
+have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h")
+have_struct_member("EVP_CIPHER_CTX", "engine", "openssl/evp.h")
+have_struct_member("X509_ATTRIBUTE", "single", "openssl/x509.h")
+have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS")
+have_macro("EVP_CTRL_GCM_GET_TAG", ['openssl/evp.h']) && $defs.push("-DHAVE_AUTHENTICATED_ENCRYPTION")
Logging::message "=== Checking done. ===\n"
create_header
-create_makefile("openssl")
+create_makefile("openssl") {|conf|
+ conf << "THREAD_MODEL = #{CONFIG["THREAD_MODEL"]}\n"
+}
Logging::message "Done.\n"
diff --git a/ext/openssl/lib/openssl.rb b/ext/openssl/lib/openssl.rb
index 0914282920..19a4382d0d 100644
--- a/ext/openssl/lib/openssl.rb
+++ b/ext/openssl/lib/openssl.rb
@@ -1,22 +1,24 @@
-# 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 licensed under the same licence as Ruby.
+ This program is licenced 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'
require 'openssl/x509'
require 'openssl/ssl'
-require 'openssl/pkcs5'
diff --git a/ext/openssl/lib/openssl/bn.rb b/ext/openssl/lib/openssl/bn.rb
index 8d1ebefb6e..0e19c20d34 100644
--- a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -1,6 +1,7 @@
-# frozen_string_literal: false
#--
#
+# $RCSfile$
+#
# = Ruby-space definitions that completes C-space funcs for BN
#
# = Info
@@ -9,27 +10,23 @@
# All rights reserved.
#
# = Licence
-# This program is licensed under the same licence as Ruby.
+# This program is licenced 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
##
-#--
# Add double dispatch to Integer
-#++
+#
class Integer
# Casts an Integer as an OpenSSL::BN
#
@@ -38,3 +35,4 @@ 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 935f61f0ef..1223c5de15 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -1,14 +1,18 @@
# 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 licensed under the same licence as Ruby.
+# This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.)
+#
+#= Version
+# $Id$
#++
##
@@ -63,7 +67,7 @@ module OpenSSL::Buffering
end
##
- # Consumes _size_ bytes from the buffer
+ # Consumes +size+ bytes from the buffer
def consume_rbuff(size=nil)
if @rbuffer.empty?
@@ -79,7 +83,7 @@ module OpenSSL::Buffering
public
##
- # Reads _size_ bytes from the stream. If _buf_ is provided it must
+ # Reads +size+ bytes from the stream. If +buf+ is provided it must
# reference a string which will receive the data.
#
# See IO#read for full details.
@@ -106,7 +110,7 @@ module OpenSSL::Buffering
end
##
- # Reads at most _maxlen_ bytes from the stream. If _buf_ is provided it
+ # Reads at most +maxlen+ bytes from the stream. If +buf+ is provided it
# must reference a string which will receive the data.
#
# See IO#readpartial for full details.
@@ -132,11 +136,12 @@ module OpenSSL::Buffering
buf.replace(ret)
ret = buf
end
+ raise EOFError if ret.empty?
ret
end
##
- # Reads at most _maxlen_ bytes in the non-blocking manner.
+ # Reads at most +maxlen+ bytes in the non-blocking manner.
#
# When no data can be read without blocking it raises
# OpenSSL::SSL::SSLError extended by IO::WaitReadable or IO::WaitWritable.
@@ -163,11 +168,6 @@ module OpenSSL::Buffering
# Note that one reason that read_nonblock writes to the underlying IO is
# when the peer requests a new TLS/SSL handshake. See openssl the FAQ for
# more details. http://www.openssl.org/support/faq.html
- #
- # By specifying a keyword argument _exception_ to +false+, you can indicate
- # that read_nonblock should not raise an IO::Wait*able exception, but
- # return the symbol +:wait_writable+ or +:wait_readable+ instead. At EOF,
- # it will return +nil+ instead of raising EOFError.
def read_nonblock(maxlen, buf=nil, exception: true)
if maxlen == 0
@@ -186,15 +186,16 @@ module OpenSSL::Buffering
buf.replace(ret)
ret = buf
end
+ raise EOFError if ret.empty?
ret
end
##
- # Reads the next "line" from the stream. Lines are separated by _eol_. If
- # _limit_ is provided the result will not be longer than the given number of
+ # Reads the next "line+ from the stream. Lines are separated by +eol+. If
+ # +limit+ is provided the result will not be longer than the given number of
# bytes.
#
- # _eol_ may be a String or Regexp.
+ # +eol+ may be a String or Regexp.
#
# Unlike IO#gets the line read will not be assigned to +$_+.
#
@@ -212,7 +213,7 @@ module OpenSSL::Buffering
else
size = idx ? idx+eol.size : nil
end
- if size && limit && limit >= 0
+ if limit and limit >= 0
size = [size, limit].min
end
consume_rbuff(size)
@@ -220,7 +221,7 @@ module OpenSSL::Buffering
##
# Executes the block for every line in the stream where lines are separated
- # by _eol_.
+ # by +eol+.
#
# See also #gets
@@ -232,7 +233,7 @@ module OpenSSL::Buffering
alias each_line each
##
- # Reads lines from the stream which are separated by _eol_.
+ # Reads lines from the stream which are separated by +eol+.
#
# See also #gets
@@ -245,7 +246,7 @@ module OpenSSL::Buffering
end
##
- # Reads a line from the stream which is separated by _eol_.
+ # Reads a line from the stream which is separated by +eol+.
#
# Raises EOFError if at end of file.
@@ -281,7 +282,7 @@ module OpenSSL::Buffering
end
##
- # Pushes character _c_ back onto the stream such that a subsequent buffered
+ # Pushes character +c+ back onto the stream such that a subsequent buffered
# character read will return it.
#
# Unlike IO#getc multiple bytes may be pushed back onto the stream.
@@ -308,7 +309,7 @@ module OpenSSL::Buffering
private
##
- # Writes _s_ to the buffer. When the buffer is full or #sync is true the
+ # Writes +s+ to the buffer. When the buffer is full or #sync is true the
# buffer is flushed to the underlying socket.
def do_write(s)
@@ -336,18 +337,16 @@ module OpenSSL::Buffering
public
##
- # Writes _s_ to the stream. If the argument is not a String it will be
- # converted using +.to_s+ method. Returns the number of bytes written.
+ # Writes +s+ to the stream. If the argument is not a string it will be
+ # converted using String#to_s. Returns the number of bytes written.
- def write(*s)
- s.inject(0) do |written, str|
- do_write(str)
- written + str.bytesize
- end
+ def write(s)
+ do_write(s)
+ s.bytesize
end
##
- # Writes _s_ in the non-blocking manner.
+ # Writes +str+ in the non-blocking manner.
#
# If there is buffered data, it is flushed first. This may block.
#
@@ -378,10 +377,6 @@ module OpenSSL::Buffering
# Note that one reason that write_nonblock reads from the underlying IO
# is when the peer requests a new TLS/SSL handshake. See the openssl FAQ
# for more details. http://www.openssl.org/support/faq.html
- #
- # By specifying a keyword argument _exception_ to +false+, you can indicate
- # that write_nonblock should not raise an IO::Wait*able exception, but
- # return the symbol +:wait_writable+ or +:wait_readable+ instead.
def write_nonblock(s, exception: true)
flush
@@ -389,16 +384,16 @@ module OpenSSL::Buffering
end
##
- # Writes _s_ to the stream. _s_ will be converted to a String using
- # +.to_s+ method.
+ # Writes +s+ to the stream. +s+ will be converted to a String using
+ # String#to_s.
- def <<(s)
+ def << (s)
do_write(s)
self
end
##
- # Writes _args_ to the stream along with a record separator.
+ # Writes +args+ to the stream along with a record separator.
#
# See IO#puts for full details.
@@ -418,7 +413,7 @@ module OpenSSL::Buffering
end
##
- # Writes _args_ to the stream.
+ # Writes +args+ to the stream.
#
# See IO#print for full details.
diff --git a/ext/openssl/lib/openssl/cipher.rb b/ext/openssl/lib/openssl/cipher.rb
index af721b3a80..b3340ff52a 100644
--- a/ext/openssl/lib/openssl/cipher.rb
+++ b/ext/openssl/lib/openssl/cipher.rb
@@ -1,5 +1,7 @@
-# frozen_string_literal: false
#--
+#
+# $RCSfile$
+#
# = Ruby-space predefined Cipher subclasses
#
# = Info
@@ -8,8 +10,12 @@
# All rights reserved.
#
# = Licence
-# This program is licensed under the same licence as Ruby.
+# This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
#++
module OpenSSL
@@ -18,7 +24,7 @@ module OpenSSL
klass = Class.new(Cipher){
define_method(:initialize){|*args|
cipher_name = args.inject(name){|n, arg| "#{n}-#{arg}" }
- super(cipher_name.downcase)
+ super(cipher_name)
}
}
const_set(name, klass)
@@ -26,42 +32,34 @@ module OpenSSL
%w(128 192 256).each{|keylen|
klass = Class.new(Cipher){
- define_method(:initialize){|mode = "CBC"|
- super("aes-#{keylen}-#{mode}".downcase)
+ define_method(:initialize){|mode|
+ mode ||= "CBC"
+ cipher_name = "AES-#{keylen}-#{mode}"
+ super(cipher_name)
}
}
const_set("AES#{keylen}", klass)
}
- # call-seq:
- # cipher.random_key -> key
- #
- # Generate a random key with OpenSSL::Random.random_bytes and sets it to
- # the cipher, and returns it.
- #
- # You must call #encrypt or #decrypt before calling this method.
+ # Generate, set, and return a random key.
+ # You must call cipher.encrypt or cipher.decrypt before calling this method.
def random_key
str = OpenSSL::Random.random_bytes(self.key_len)
self.key = str
+ return str
end
- # call-seq:
- # cipher.random_iv -> iv
- #
- # Generate a random IV with OpenSSL::Random.random_bytes and sets it to the
- # cipher, and returns it.
- #
- # You must call #encrypt or #decrypt before calling this method.
+ # Generate, set, and return a random iv.
+ # You must call cipher.encrypt or cipher.decrypt before calling this method.
def random_iv
str = OpenSSL::Random.random_bytes(self.iv_len)
self.iv = str
+ return str
end
- # Deprecated.
- #
- # This class is only provided for backwards compatibility.
- # Use OpenSSL::Cipher.
- class Cipher < Cipher; end
- deprecate_constant :Cipher
+ # This class is only provided for backwards compatibility. Use OpenSSL::Cipher in the future.
+ class Cipher < Cipher
+ # add warning
+ end
end # Cipher
end # OpenSSL
diff --git a/ext/openssl/lib/openssl/config.rb b/ext/openssl/lib/openssl/config.rb
index 48d8be0069..5716d59fd6 100644
--- a/ext/openssl/lib/openssl/config.rb
+++ b/ext/openssl/lib/openssl/config.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
=begin
= Ruby-space definitions that completes C-space funcs for Config
@@ -6,7 +5,7 @@
Copyright (C) 2010 Hiroshi Nakamura <nahi@ruby-lang.org>
= Licence
- This program is licensed under the same licence as Ruby.
+ This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
=end
@@ -30,8 +29,7 @@ module OpenSSL
class << self
##
- # Parses a given _string_ as a blob that contains configuration for
- # OpenSSL.
+ # Parses a given +string+ as a blob that contains configuration for openssl.
#
# If the source of the IO is a file, then consider using #parse_config.
def parse(string)
@@ -47,7 +45,7 @@ module OpenSSL
alias load new
##
- # Parses the configuration data read from _io_, see also #parse.
+ # Parses the configuration data read from +io+, see also #parse.
#
# Raises a ConfigError on invalid configuration data.
def parse_config(io)
@@ -237,7 +235,7 @@ module OpenSSL
#
# This can be used in contexts like OpenSSL::X509::ExtensionFactory.config=
#
- # If the optional _filename_ parameter is provided, then it is read in and
+ # If the optional +filename+ parameter is provided, then it is read in and
# parsed via #parse_config.
#
# This can raise IO exceptions based on the access, or availability of the
@@ -256,7 +254,7 @@ module OpenSSL
end
##
- # Gets the value of _key_ from the given _section_
+ # Gets the value of +key+ from the given +section+
#
# Given the following configurating file being loaded:
#
@@ -266,8 +264,8 @@ module OpenSSL
# #=> [ default ]
# # foo=bar
#
- # You can get a specific value from the config if you know the _section_
- # and _key_ like so:
+ # You can get a specific value from the config if you know the +section+
+ # and +key+ like so:
#
# config.get_value('default','foo')
# #=> "bar"
@@ -298,7 +296,7 @@ module OpenSSL
end
##
- # Set the target _key_ with a given _value_ under a specific _section_.
+ # Set the target +key+ with a given +value+ under a specific +section+.
#
# Given the following configurating file being loaded:
#
@@ -308,7 +306,7 @@ module OpenSSL
# #=> [ default ]
# # foo=bar
#
- # You can set the value of _foo_ under the _default_ section to a new
+ # You can set the value of +foo+ under the +default+ section to a new
# value:
#
# config.add_value('default', 'foo', 'buzz')
@@ -323,7 +321,7 @@ module OpenSSL
end
##
- # Get a specific _section_ from the current configuration
+ # Get a specific +section+ from the current configuration
#
# Given the following configurating file being loaded:
#
@@ -352,7 +350,7 @@ module OpenSSL
end
##
- # Sets a specific _section_ name with a Hash _pairs_.
+ # Sets a specific +section+ name with a Hash +pairs+
#
# Given the following configuration being created:
#
@@ -366,7 +364,7 @@ module OpenSSL
# # baz=buz
#
# It's important to note that this will essentially merge any of the keys
- # in _pairs_ with the existing _section_. For example:
+ # in +pairs+ with the existing +section+. For example:
#
# config['default']
# #=> {"foo"=>"bar", "baz"=>"buz"}
diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb
index b6744de6bd..a7b641fd22 100644
--- a/ext/openssl/lib/openssl/digest.rb
+++ b/ext/openssl/lib/openssl/digest.rb
@@ -1,5 +1,7 @@
-# frozen_string_literal: false
#--
+#
+# $RCSfile$
+#
# = Ruby-space predefined Digest subclasses
#
# = Info
@@ -8,19 +10,23 @@
# All rights reserved.
#
# = Licence
-# This program is licensed under the same licence as Ruby.
+# This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
#++
module OpenSSL
class Digest
- alg = %w(MD2 MD4 MD5 MDC2 RIPEMD160 SHA1 SHA224 SHA256 SHA384 SHA512)
- if OPENSSL_VERSION_NUMBER < 0x10100000
- alg += %w(DSS DSS1 SHA)
+ alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1)
+ if OPENSSL_VERSION_NUMBER > 0x00908000
+ alg += %w(SHA224 SHA256 SHA384 SHA512)
end
- # Return the hash value computed with _name_ Digest. _name_ is either the
+ # Return the +data+ hash computed with +name+ Digest. +name+ is either the
# long name or short name of a supported digest algorithm.
#
# === Examples
@@ -50,13 +56,19 @@ module OpenSSL
# Deprecated.
#
# This class is only provided for backwards compatibility.
- # Use OpenSSL::Digest instead.
- class Digest < Digest; end # :nodoc:
- deprecate_constant :Digest
+ class Digest < Digest # :nodoc:
+ # Deprecated.
+ #
+ # See OpenSSL::Digest.new
+ def initialize(*args)
+ warn('Digest::Digest is deprecated; use Digest')
+ super(*args)
+ end
+ end
end # Digest
- # Returns a Digest subclass by _name_
+ # Returns a Digest subclass by +name+.
#
# require 'openssl'
#
@@ -73,3 +85,4 @@ module OpenSSL
module_function :Digest
end # OpenSSL
+
diff --git a/ext/openssl/lib/openssl/pkcs5.rb b/ext/openssl/lib/openssl/pkcs5.rb
deleted file mode 100644
index 959447df5e..0000000000
--- a/ext/openssl/lib/openssl/pkcs5.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: false
-#--
-# Ruby/OpenSSL Project
-# Copyright (C) 2017 Ruby/OpenSSL Project Authors
-#++
-
-module OpenSSL
- module PKCS5
- module_function
-
- # OpenSSL::PKCS5.pbkdf2_hmac has been renamed to OpenSSL::KDF.pbkdf2_hmac.
- # This method is provided for backwards compatibility.
- def pbkdf2_hmac(pass, salt, iter, keylen, digest)
- OpenSSL::KDF.pbkdf2_hmac(pass, salt: salt, iterations: iter,
- length: keylen, hash: digest)
- end
-
- def pbkdf2_hmac_sha1(pass, salt, iter, keylen)
- pbkdf2_hmac(pass, salt, iter, keylen, "sha1")
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/pkey.rb b/ext/openssl/lib/openssl/pkey.rb
deleted file mode 100644
index 8a547c340d..0000000000
--- a/ext/openssl/lib/openssl/pkey.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: false
-#--
-# Ruby/OpenSSL Project
-# Copyright (C) 2017 Ruby/OpenSSL Project Authors
-#++
-
-module OpenSSL::PKey
- if defined?(EC)
- class EC::Point
- # :call-seq:
- # point.to_bn([conversion_form]) -> OpenSSL::BN
- #
- # Returns the octet string representation of the EC point as an instance of
- # OpenSSL::BN.
- #
- # If _conversion_form_ is not given, the _point_conversion_form_ attribute
- # set to the group is used.
- #
- # See #to_octet_string for more information.
- def to_bn(conversion_form = group.point_conversion_form)
- OpenSSL::BN.new(to_octet_string(conversion_form), 2)
- end
- end
- end
-end
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 6a6f2b9431..fb1045381f 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -1,142 +1,88 @@
-# 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 licensed under the same licence as Ruby.
+ This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
+
+= Version
+ $Id$
=end
require "openssl/buffering"
-require "io/nonblock"
+require "fcntl"
module OpenSSL
module SSL
class SSLContext
- DEFAULT_PARAMS = { # :nodoc:
- :min_version => OpenSSL::SSL::TLS1_VERSION,
+ DEFAULT_PARAMS = {
+ :ssl_version => "SSLv23",
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
- :verify_hostname => true,
+ :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
- opts |= OpenSSL::SSL::OP_NO_COMPRESSION
- opts
+ 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)
}.call
}
- if defined?(OpenSSL::PKey::DH)
- DEFAULT_2048 = OpenSSL::PKey::DH.new <<-_end_of_pem_
------BEGIN DH PARAMETERS-----
-MIIBCAKCAQEA7E6kBrYiyvmKAMzQ7i8WvwVk9Y/+f8S7sCTN712KkK3cqd1jhJDY
-JbrYeNV3kUIKhPxWHhObHKpD1R84UpL+s2b55+iMd6GmL7OYmNIT/FccKhTcveab
-VBmZT86BZKYyf45hUF9FOuUM9xPzuK3Vd8oJQvfYMCd7LPC0taAEljQLR4Edf8E6
-YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
-1bNveX5wInh5GDx1FGhKBZ+s1H+aedudCm7sCgRwv8lKWYGiHzObSma8A86KG+MD
-7Lo5JquQ3DlBodj3IDyPrxIv96lvRPFtAwIBAg==
------END DH PARAMETERS-----
- _end_of_pem_
- private_constant :DEFAULT_2048
-
- DEFAULT_TMP_DH_CALLBACK = lambda { |ctx, is_export, keylen| # :nodoc:
- warn "using default DH parameters." if $VERBOSE
- DEFAULT_2048
- }
- end
-
- if !(OpenSSL::OPENSSL_VERSION.start_with?("OpenSSL") &&
- OpenSSL::OPENSSL_VERSION_NUMBER >= 0x10100000)
- DEFAULT_PARAMS.merge!(
- 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
- }.join(":"),
- )
- end
-
- DEFAULT_CERT_STORE = OpenSSL::X509::Store.new # :nodoc:
+ DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
DEFAULT_CERT_STORE.set_default_paths
- DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
-
- # 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
-
- # 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
-
- # call-seq:
- # SSLContext.new -> ctx
- # SSLContext.new(:TLSv1) -> ctx
- # SSLContext.new("SSLv23") -> ctx
- #
- # Creates a new SSL context.
- #
- # If an argument is given, #ssl_version= is called with the value. Note
- # that this form is deprecated. New applications should use #min_version=
- # and #max_version= as necessary.
- def initialize(version = nil)
- self.options |= OpenSSL::SSL::OP_ALL
- self.ssl_version = version if version
+ if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
+ DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
end
##
- # call-seq:
- # ctx.set_params(params = {}) -> params
- #
- # Sets saner defaults optimized for the use with HTTP-like protocols.
- #
- # If a Hash _params_ is given, the parameters are overridden with it.
- # The keys in _params_ must be assignment methods on SSLContext.
+ # Sets the parameters for this SSL context to the values in +params+.
+ # The keys in +params+ must be assignment methods on SSLContext.
#
# If the verify_mode is not VERIFY_NONE and ca_file, ca_path and
# cert_store are not set then the system default certificate store is
# used.
+
def set_params(params={})
params = DEFAULT_PARAMS.merge(params)
- self.options = params.delete(:options) # set before min_version/max_version
params.each{|name, value| self.__send__("#{name}=", value) }
if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
unless self.ca_file or self.ca_path or self.cert_store
@@ -145,88 +91,6 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
end
return params
end
-
- # call-seq:
- # ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION
- # ctx.min_version = :TLS1_2
- # ctx.min_version = nil
- #
- # Sets the lower bound on the supported SSL/TLS protocol version. The
- # version may be specified by an integer constant named
- # OpenSSL::SSL::*_VERSION, a Symbol, or +nil+ which means "any version".
- #
- # Be careful that you don't overwrite OpenSSL::SSL::OP_NO_{SSL,TLS}v*
- # options by #options= once you have called #min_version= or
- # #max_version=.
- #
- # === Example
- # ctx = OpenSSL::SSL::SSLContext.new
- # ctx.min_version = OpenSSL::SSL::TLS1_1_VERSION
- # ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
- #
- # sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)
- # sock.connect # Initiates a connection using either TLS 1.1 or TLS 1.2
- def min_version=(version)
- set_minmax_proto_version(version, @max_proto_version ||= nil)
- @min_proto_version = version
- end
-
- # call-seq:
- # ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
- # ctx.max_version = :TLS1_2
- # ctx.max_version = nil
- #
- # Sets the upper bound of the supported SSL/TLS protocol version. See
- # #min_version= for the possible values.
- def max_version=(version)
- set_minmax_proto_version(@min_proto_version ||= nil, version)
- @max_proto_version = version
- end
-
- # call-seq:
- # ctx.ssl_version = :TLSv1
- # ctx.ssl_version = "SSLv23"
- #
- # Sets the SSL/TLS protocol version for the context. This forces
- # connections to use only the specified protocol version. This is
- # deprecated and only provided for backwards compatibility. Use
- # #min_version= and #max_version= instead.
- #
- # === History
- # As the name hints, this used to call the SSL_CTX_set_ssl_version()
- # function which sets the SSL method used for connections created from
- # the context. As of Ruby/OpenSSL 2.1, this accessor method is
- # implemented to call #min_version= and #max_version= instead.
- def ssl_version=(meth)
- meth = meth.to_s if meth.is_a?(Symbol)
- if /(?<type>_client|_server)\z/ =~ meth
- meth = $`
- if $VERBOSE
- warn "#{caller(1, 1)[0]}: method type #{type.inspect} is ignored"
- end
- end
- version = METHODS_MAP[meth.intern] or
- raise ArgumentError, "unknown SSL method `%s'" % meth
- set_minmax_proto_version(version, version)
- @min_proto_version = @max_proto_version = version
- end
-
- METHODS_MAP = {
- SSLv23: 0,
- SSLv2: OpenSSL::SSL::SSL2_VERSION,
- SSLv3: OpenSSL::SSL::SSL3_VERSION,
- TLSv1: OpenSSL::SSL::TLS1_VERSION,
- TLSv1_1: OpenSSL::SSL::TLS1_1_VERSION,
- TLSv1_2: OpenSSL::SSL::TLS1_2_VERSION,
- }.freeze
- private_constant :METHODS_MAP
-
- # The list of available SSL/TLS methods. This constant is only provided
- # for backwards compatibility.
- METHODS = METHODS_MAP.flat_map { |name,|
- [name, :"#{name}_client", :"#{name}_server"]
- }.freeze
- deprecate_constant :METHODS
end
module SocketForwarder
@@ -259,6 +123,15 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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|
@@ -269,7 +142,8 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
case san.tag
when 2 # dNSName in GeneralName (RFC5280)
should_verify_common_name = false
- return true if verify_hostname(hostname, san.value)
+ reg = Regexp.escape(san.value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
when 7 # iPAddress in GeneralName (RFC5280)
should_verify_common_name = false
# follows GENERAL_NAME_print() in x509v3/v3_alt.c
@@ -284,7 +158,8 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
if should_verify_common_name
cert.subject.to_a.each{|oid, value|
if oid == "CN"
- return true if verify_hostname(hostname, value)
+ reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
+ return true if /\A#{reg}\z/i =~ hostname
end
}
end
@@ -292,148 +167,23 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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
- attr_reader :hostname
-
- # The underlying IO object.
- attr_reader :io
- alias :to_io :io
-
- # The SSLContext object used in this connection.
- attr_reader :context
-
- # Whether to close the underlying socket as well, when the SSL/TLS
- # connection is shut down. This defaults to +false+.
- attr_accessor :sync_close
-
- # 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
-
- # call-seq:
- # ssl.post_connection_check(hostname) -> true
- #
- # Perform hostname verification following RFC 6125.
- #
- # 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
return true
end
- # call-seq:
- # ssl.session -> aSession
- #
- # Returns the SSLSession object currently used, or nil if the session is
- # not established.
def session
SSL::Session.new(self)
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::SSL::SSLContext::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
##
@@ -444,8 +194,8 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
attr_accessor :start_immediately
# Creates a new instance of SSLServer.
- # * _srv_ is an instance of TCPServer.
- # * _ctx_ is an instance of OpenSSL::SSL::SSLContext.
+ # * +srv+ is an instance of TCPServer.
+ # * +ctx+ is an instance of OpenSSL::SSL::SSLContext.
def initialize(svr, ctx)
@svr = svr
@ctx = ctx
diff --git a/ext/openssl/lib/openssl/x509.rb b/ext/openssl/lib/openssl/x509.rb
index 98358f90da..31a4381db4 100644
--- a/ext/openssl/lib/openssl/x509.rb
+++ b/ext/openssl/lib/openssl/x509.rb
@@ -1,5 +1,7 @@
-# frozen_string_literal: false
#--
+#
+# $RCSfile$
+#
# = Ruby-space definitions that completes C-space funcs for X509 and subclasses
#
# = Info
@@ -8,8 +10,12 @@
# All rights reserved.
#
# = Licence
-# This program is licensed under the same licence as Ruby.
+# This program is licenced under the same licence as Ruby.
# (See the file 'LICENCE'.)
+#
+# = Version
+# $Id$
+#
#++
module OpenSSL
@@ -41,11 +47,6 @@ module OpenSSL
end
class Extension
- def ==(other)
- return false unless Extension === other
- to_der == other.to_der
- end
-
def to_s # "oid = critical, value"
str = self.oid
str << " = "
@@ -69,7 +70,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 = /
@@ -144,32 +145,12 @@ module OpenSSL
end
def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
- if str.start_with?("/")
- # /A=B/C=D format
- ary = str[1..-1].split("/").map { |i| i.split("=", 2) }
- else
- # Comma-separated
- ary = str.split(",").map { |i| i.strip.split("=", 2) }
- end
+ ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
self.new(ary, template)
end
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 Attribute
- def ==(other)
- return false unless Attribute === other
- to_der == other.to_der
- end
end
class StoreContext
@@ -177,39 +158,5 @@ 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
-
- class CRL
- def ==(other)
- return false unless CRL === other
- to_der == other.to_der
- end
- end
-
- class Revoked
- def ==(other)
- return false unless Revoked === other
- to_der == other.to_der
- end
- end
-
- class Request
- def ==(other)
- return false unless Request === other
- to_der == other.to_der
- end
- end
end
end
diff --git a/ext/openssl/openssl.gemspec b/ext/openssl/openssl.gemspec
deleted file mode 100644
index 7a6c14422f..0000000000
--- a/ext/openssl/openssl.gemspec
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- encoding: utf-8 -*-
-# stub: openssl 2.1.2 ruby lib
-# stub: ext/openssl/extconf.rb
-
-Gem::Specification.new do |s|
- s.name = "openssl".freeze
- s.version = "2.1.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
- s.metadata = { "msys2_mingw_dependencies" => "openssl" } if s.respond_to? :metadata=
- s.require_paths = ["lib".freeze]
- s.authors = ["Martin Bosslet".freeze, "SHIBATA Hiroshi".freeze, "Zachary Scott".freeze, "Kazuki Yamaguchi".freeze]
- s.date = "2018-10-17"
- s.description = "It wraps the OpenSSL library.".freeze
- s.email = ["ruby-core@ruby-lang.org".freeze]
- s.extensions = ["ext/openssl/extconf.rb".freeze]
- s.extra_rdoc_files = ["CONTRIBUTING.md".freeze, "README.md".freeze, "History.md".freeze]
- s.files = ["BSDL".freeze, "CONTRIBUTING.md".freeze, "History.md".freeze, "LICENSE.txt".freeze, "README.md".freeze, "ext/openssl/deprecation.rb".freeze, "ext/openssl/extconf.rb".freeze, "ext/openssl/openssl_missing.c".freeze, "ext/openssl/openssl_missing.h".freeze, "ext/openssl/ossl.c".freeze, "ext/openssl/ossl.h".freeze, "ext/openssl/ossl_asn1.c".freeze, "ext/openssl/ossl_asn1.h".freeze, "ext/openssl/ossl_bio.c".freeze, "ext/openssl/ossl_bio.h".freeze, "ext/openssl/ossl_bn.c".freeze, "ext/openssl/ossl_bn.h".freeze, "ext/openssl/ossl_cipher.c".freeze, "ext/openssl/ossl_cipher.h".freeze, "ext/openssl/ossl_config.c".freeze, "ext/openssl/ossl_config.h".freeze, "ext/openssl/ossl_digest.c".freeze, "ext/openssl/ossl_digest.h".freeze, "ext/openssl/ossl_engine.c".freeze, "ext/openssl/ossl_engine.h".freeze, "ext/openssl/ossl_hmac.c".freeze, "ext/openssl/ossl_hmac.h".freeze, "ext/openssl/ossl_kdf.c".freeze, "ext/openssl/ossl_kdf.h".freeze, "ext/openssl/ossl_ns_spki.c".freeze, "ext/openssl/ossl_ns_spki.h".freeze, "ext/openssl/ossl_ocsp.c".freeze, "ext/openssl/ossl_ocsp.h".freeze, "ext/openssl/ossl_pkcs12.c".freeze, "ext/openssl/ossl_pkcs12.h".freeze, "ext/openssl/ossl_pkcs7.c".freeze, "ext/openssl/ossl_pkcs7.h".freeze, "ext/openssl/ossl_pkey.c".freeze, "ext/openssl/ossl_pkey.h".freeze, "ext/openssl/ossl_pkey_dh.c".freeze, "ext/openssl/ossl_pkey_dsa.c".freeze, "ext/openssl/ossl_pkey_ec.c".freeze, "ext/openssl/ossl_pkey_rsa.c".freeze, "ext/openssl/ossl_rand.c".freeze, "ext/openssl/ossl_rand.h".freeze, "ext/openssl/ossl_ssl.c".freeze, "ext/openssl/ossl_ssl.h".freeze, "ext/openssl/ossl_ssl_session.c".freeze, "ext/openssl/ossl_version.h".freeze, "ext/openssl/ossl_x509.c".freeze, "ext/openssl/ossl_x509.h".freeze, "ext/openssl/ossl_x509attr.c".freeze, "ext/openssl/ossl_x509cert.c".freeze, "ext/openssl/ossl_x509crl.c".freeze, "ext/openssl/ossl_x509ext.c".freeze, "ext/openssl/ossl_x509name.c".freeze, "ext/openssl/ossl_x509req.c".freeze, "ext/openssl/ossl_x509revoked.c".freeze, "ext/openssl/ossl_x509store.c".freeze, "ext/openssl/ruby_missing.h".freeze, "lib/openssl.rb".freeze, "lib/openssl/bn.rb".freeze, "lib/openssl/buffering.rb".freeze, "lib/openssl/cipher.rb".freeze, "lib/openssl/config.rb".freeze, "lib/openssl/digest.rb".freeze, "lib/openssl/pkcs5.rb".freeze, "lib/openssl/pkey.rb".freeze, "lib/openssl/ssl.rb".freeze, "lib/openssl/x509.rb".freeze]
- s.homepage = "https://github.com/ruby/openssl".freeze
- s.licenses = ["Ruby".freeze]
- s.rdoc_options = ["--main".freeze, "README.md".freeze]
- s.required_ruby_version = Gem::Requirement.new(">= 2.3.0".freeze)
- s.rubygems_version = "3.0.0.beta1".freeze
- s.summary = "OpenSSL provides SSL, TLS and general purpose cryptography.".freeze
-
- 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<rake>.freeze, [">= 0"])
- s.add_development_dependency(%q<rake-compiler>.freeze, [">= 0"])
- s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.0"])
- s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
- else
- s.add_dependency(%q<rake>.freeze, [">= 0"])
- s.add_dependency(%q<rake-compiler>.freeze, [">= 0"])
- s.add_dependency(%q<test-unit>.freeze, ["~> 3.0"])
- s.add_dependency(%q<rdoc>.freeze, [">= 0"])
- end
- else
- s.add_dependency(%q<rake>.freeze, [">= 0"])
- s.add_dependency(%q<rake-compiler>.freeze, [">= 0"])
- s.add_dependency(%q<test-unit>.freeze, ["~> 3.0"])
- s.add_dependency(%q<rdoc>.freeze, [">= 0"])
- end
-end
diff --git a/ext/openssl/openssl_missing.c b/ext/openssl/openssl_missing.c
index b36ef0288e..b5efaaf15d 100644
--- a/ext/openssl/openssl_missing.c
+++ b/ext/openssl/openssl_missing.c
@@ -1,106 +1,356 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include RUBY_EXTCONF_H
-#include <string.h> /* memcpy() */
-#if !defined(OPENSSL_NO_ENGINE)
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
# include <openssl/engine.h>
#endif
-#if !defined(OPENSSL_NO_HMAC)
-# include <openssl/hmac.h>
-#endif
#include <openssl/x509_vfy.h>
+#if !defined(OPENSSL_NO_HMAC)
+#include <string.h> /* memcpy() */
+#include <openssl/hmac.h>
+
#include "openssl_missing.h"
-/* added in 1.0.2 */
-#if !defined(OPENSSL_NO_EC)
-#if !defined(HAVE_EC_CURVE_NIST2NID)
-static struct {
- const char *name;
- int nid;
-} nist_curves[] = {
- {"B-163", NID_sect163r2},
- {"B-233", NID_sect233r1},
- {"B-283", NID_sect283r1},
- {"B-409", NID_sect409r1},
- {"B-571", NID_sect571r1},
- {"K-163", NID_sect163k1},
- {"K-233", NID_sect233k1},
- {"K-283", NID_sect283k1},
- {"K-409", NID_sect409k1},
- {"K-571", NID_sect571k1},
- {"P-192", NID_X9_62_prime192v1},
- {"P-224", NID_secp224r1},
- {"P-256", NID_X9_62_prime256v1},
- {"P-384", NID_secp384r1},
- {"P-521", NID_secp521r1}
-};
+#if !defined(HAVE_HMAC_CTX_COPY)
+void
+HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
+{
+ if (!out || !in) return;
+ memcpy(out, in, sizeof(HMAC_CTX));
+
+ EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
+ EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
+ EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
+}
+#endif /* HAVE_HMAC_CTX_COPY */
+#endif /* NO_HMAC */
-int
-ossl_EC_curve_nist2nid(const char *name)
+#if !defined(HAVE_X509_STORE_SET_EX_DATA)
+int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data)
{
- size_t i;
- for (i = 0; i < (sizeof(nist_curves) / sizeof(nist_curves[0])); i++) {
- if (!strcmp(nist_curves[i].name, name))
- return nist_curves[i].nid;
- }
- return NID_undef;
+ 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
-/*** added in 1.1.0 ***/
-#if !defined(HAVE_HMAC_CTX_NEW)
-HMAC_CTX *
-ossl_HMAC_CTX_new(void)
+#if !defined(HAVE_EVP_MD_CTX_CREATE)
+EVP_MD_CTX *
+EVP_MD_CTX_create(void)
{
- HMAC_CTX *ctx = OPENSSL_malloc(sizeof(HMAC_CTX));
- if (!ctx)
- return NULL;
- HMAC_CTX_init(ctx);
+ EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof(EVP_MD_CTX));
+ if (!ctx) return NULL;
+
+ memset(ctx, 0, sizeof(EVP_MD_CTX));
+
return ctx;
}
#endif
-#if !defined(HAVE_HMAC_CTX_FREE)
+#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
+int
+EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
+{
+ /* FIXME!!! */
+ memset(ctx, 0, sizeof(EVP_MD_CTX));
+
+ return 1;
+}
+#endif
+
+#if !defined(HAVE_EVP_MD_CTX_DESTROY)
void
-ossl_HMAC_CTX_free(HMAC_CTX *ctx)
+EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
{
- if (ctx) {
- HMAC_CTX_cleanup(ctx);
- OPENSSL_free(ctx);
- }
+ EVP_MD_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
}
#endif
-#if !defined(HAVE_X509_CRL_GET0_SIGNATURE)
+#if !defined(HAVE_EVP_MD_CTX_INIT)
void
-ossl_X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
- const X509_ALGOR **palg)
+EVP_MD_CTX_init(EVP_MD_CTX *ctx)
{
- if (psig != NULL)
- *psig = crl->signature;
- if (palg != NULL)
- *palg = crl->sig_alg;
+ memset(ctx, 0, sizeof(EVP_MD_CTX));
}
#endif
-#if !defined(HAVE_X509_REQ_GET0_SIGNATURE)
+#if !defined(HAVE_HMAC_CTX_INIT)
void
-ossl_X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
- const X509_ALGOR **palg)
+HMAC_CTX_init(HMAC_CTX *ctx)
+{
+ EVP_MD_CTX_init(&ctx->i_ctx);
+ EVP_MD_CTX_init(&ctx->o_ctx);
+ EVP_MD_CTX_init(&ctx->md_ctx);
+}
+#endif
+
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
+void
+HMAC_CTX_cleanup(HMAC_CTX *ctx)
+{
+ EVP_MD_CTX_cleanup(&ctx->i_ctx);
+ EVP_MD_CTX_cleanup(&ctx->o_ctx);
+ EVP_MD_CTX_cleanup(&ctx->md_ctx);
+ memset(ctx, 0, sizeof(HMAC_CTX));
+}
+#endif
+
+#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
+/*
+ * this function does not exist in OpenSSL yet... or ever?.
+ * a future version may break this function.
+ * tested on 0.9.7d.
+ */
+int
+EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
+{
+ memcpy(out, in, sizeof(EVP_CIPHER_CTX));
+
+#if defined(HAVE_ENGINE_ADD) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
+ if (in->engine) ENGINE_add(out->engine);
+ if (in->cipher_data) {
+ out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
+ memcpy(out->cipher_data, in->cipher_data, in->cipher->ctx_size);
+ }
+#endif
+
+ return 1;
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_VERSION)
+int
+X509_CRL_set_version(X509_CRL *x, long version)
+{
+ if (x == NULL || x->crl == NULL) return 0;
+ if (x->crl->version == NULL) {
+ x->crl->version = M_ASN1_INTEGER_new();
+ if (x->crl->version == NULL) return 0;
+ }
+ return ASN1_INTEGER_set(x->crl->version, version);
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
+int
+X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name)
+{
+ if (x == NULL || x->crl == NULL) return 0;
+ return X509_NAME_set(&x->crl->issuer, name);
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SORT)
+int
+X509_CRL_sort(X509_CRL *c)
{
- if (psig != NULL)
- *psig = req->signature;
- if (palg != NULL)
- *palg = req->sig_alg;
+ int i;
+ X509_REVOKED *r;
+ /* sort the data so it will be written in serial
+ * number order */
+ sk_X509_REVOKED_sort(c->crl->revoked);
+ for (i=0; i<sk_X509_REVOKED_num(c->crl->revoked); i++) {
+ r=sk_X509_REVOKED_value(c->crl->revoked, i);
+ r->sequence=i;
+ }
+ return 1;
}
#endif
+
+#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
+static int
+OSSL_X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b)
+{
+ return(ASN1_STRING_cmp(
+ (ASN1_STRING *)(*a)->serialNumber,
+ (ASN1_STRING *)(*b)->serialNumber));
+}
+
+int
+X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
+{
+ X509_CRL_INFO *inf;
+
+ inf = crl->crl;
+ if (!inf->revoked)
+ inf->revoked = sk_X509_REVOKED_new(OSSL_X509_REVOKED_cmp);
+ if (!inf->revoked || !sk_X509_REVOKED_push(inf->revoked, rev))
+ return 0;
+ return 1;
+}
+#endif
+
+#if !defined(HAVE_BN_MOD_SQR)
+int
+BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
+{
+ if (!BN_sqr(r, (BIGNUM*)a, ctx)) return 0;
+ return BN_mod(r, r, m, ctx);
+}
+#endif
+
+#if !defined(HAVE_BN_MOD_ADD) || !defined(HAVE_BN_MOD_SUB)
+int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
+{
+ if (!BN_mod(r,m,d,ctx)) return 0;
+ if (!r->neg) return 1;
+ return (d->neg ? BN_sub : BN_add)(r, r, d);
+}
+#endif
+
+#if !defined(HAVE_BN_MOD_ADD)
+int
+BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
+{
+ if (!BN_add(r, a, b)) return 0;
+ return BN_nnmod(r, r, m, ctx);
+}
+#endif
+
+#if !defined(HAVE_BN_MOD_SUB)
+int
+BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
+{
+ if (!BN_sub(r, a, b)) return 0;
+ return BN_nnmod(r, r, m, ctx);
+}
+#endif
+
+#if !defined(HAVE_BN_RAND_RANGE) || !defined(HAVE_BN_PSEUDO_RAND_RANGE)
+static int
+bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
+{
+ int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
+ int n;
+
+ if (range->neg || BN_is_zero(range)) return 0;
+
+ n = BN_num_bits(range);
+
+ if (n == 1) {
+ if (!BN_zero(r)) return 0;
+ } else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
+ do {
+ if (!bn_rand(r, n + 1, -1, 0)) return 0;
+ if (BN_cmp(r ,range) >= 0) {
+ if (!BN_sub(r, r, range)) return 0;
+ if (BN_cmp(r, range) >= 0)
+ if (!BN_sub(r, r, range)) return 0;
+ }
+ } while (BN_cmp(r, range) >= 0);
+ } else {
+ do {
+ if (!bn_rand(r, n, -1, 0)) return 0;
+ } while (BN_cmp(r, range) >= 0);
+ }
+
+ return 1;
+}
+#endif
+
+#if !defined(HAVE_BN_RAND_RANGE)
+int
+BN_rand_range(BIGNUM *r, BIGNUM *range)
+{
+ return bn_rand_range(0, r, range);
+}
+#endif
+
+#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
+int
+BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
+{
+ return bn_rand_range(1, r, range);
+}
+#endif
+
+#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
+#define OPENSSL_CONF "openssl.cnf"
+char *
+CONF_get1_default_config_file(void)
+{
+ char *file;
+ int len;
+
+ file = getenv("OPENSSL_CONF");
+ if (file) return BUF_strdup(file);
+ len = strlen(X509_get_default_cert_area());
+#ifndef OPENSSL_SYS_VMS
+ len++;
+#endif
+ len += strlen(OPENSSL_CONF);
+ file = OPENSSL_malloc(len + 1);
+ if (!file) return NULL;
+ strcpy(file,X509_get_default_cert_area());
+#ifndef OPENSSL_SYS_VMS
+ strcat(file,"/");
+#endif
+ strcat(file,OPENSSL_CONF);
+
+ return file;
+}
+#endif
+
+#if !defined(HAVE_PEM_DEF_CALLBACK)
+#define OSSL_PASS_MIN_LENGTH 4
+int
+PEM_def_callback(char *buf, int num, int w, void *key)
+{
+ int i,j;
+ const char *prompt;
+
+ if (key) {
+ i = strlen(key);
+ i = (i > num) ? num : i;
+ memcpy(buf, key, i);
+ return i;
+ }
+
+ prompt = EVP_get_pw_prompt();
+ if (prompt == NULL) prompt = "Enter PEM pass phrase:";
+ for (;;) {
+ i = EVP_read_pw_string(buf, num, prompt, w);
+ if (i != 0) {
+ memset(buf, 0, (unsigned int)num);
+ return(-1);
+ }
+ j = strlen(buf);
+ if (j < OSSL_PASS_MIN_LENGTH) {
+ fprintf(stderr,
+ "phrase is too short, needs to be at least %d chars\n",
+ OSSL_PASS_MIN_LENGTH);
+ }
+ else break;
+ }
+ return j;
+}
+#endif
+
+#if !defined(HAVE_ASN1_PUT_EOC)
+int
+ASN1_put_eoc(unsigned char **pp)
+{
+ unsigned char *p = *pp;
+ *p++ = 0;
+ *p++ = 0;
+ *pp = p;
+ return 2;
+}
+#endif
+
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 69a7df71d0..3635f88b73 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -1,222 +1,198 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_OPENSSL_MISSING_H_)
#define _OSSL_OPENSSL_MISSING_H_
-#include "ruby/config.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
-/* added in 1.0.2 */
-#if !defined(OPENSSL_NO_EC)
-#if !defined(HAVE_EC_CURVE_NIST2NID)
-int ossl_EC_curve_nist2nid(const char *);
-# define EC_curve_nist2nid ossl_EC_curve_nist2nid
+#ifndef TYPEDEF_D2I_OF
+typedef char *d2i_of_void();
#endif
+#ifndef TYPEDEF_I2D_OF
+typedef int i2d_of_void();
#endif
-#if !defined(HAVE_X509_REVOKED_DUP)
-# define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((i2d_of_void *)i2d_X509_REVOKED, \
- (d2i_of_void *)d2i_X509_REVOKED, (char *)(rev))
+/*
+ * These functions are not included in headers of OPENSSL <= 0.9.6b
+ */
+
+#if !defined(PEM_read_bio_DSAPublicKey)
+# define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
+ (d2i_of_void *)d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,(bp),(void **)(x),(cb),(u))
#endif
-#if !defined(HAVE_X509_STORE_CTX_GET0_STORE)
-# define X509_STORE_CTX_get0_store(x) ((x)->ctx)
+#if !defined(PEM_write_bio_DSAPublicKey)
+# define PEM_write_bio_DSAPublicKey(bp,x) \
+ PEM_ASN1_write_bio((i2d_of_void *)i2d_DSAPublicKey,\
+ PEM_STRING_DSA_PUBLIC,\
+ (bp),(char *)(x), NULL, NULL, 0, NULL, NULL)
#endif
-#if !defined(HAVE_SSL_IS_SERVER)
-# define SSL_is_server(s) ((s)->server)
+#if !defined(DSAPrivateKey_dup)
+# define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, \
+ (d2i_of_void *)d2i_DSAPrivateKey,(char *)(dsa))
#endif
-/* added in 1.1.0 */
-#if !defined(HAVE_BN_GENCB_NEW)
-# define BN_GENCB_new() ((BN_GENCB *)OPENSSL_malloc(sizeof(BN_GENCB)))
+#if !defined(DSAPublicKey_dup)
+# define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPublicKey, \
+ (d2i_of_void *)d2i_DSAPublicKey,(char *)(dsa))
#endif
-#if !defined(HAVE_BN_GENCB_FREE)
-# define BN_GENCB_free(cb) OPENSSL_free(cb)
+#if !defined(X509_REVOKED_dup)
+# define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((i2d_of_void *)i2d_X509_REVOKED, \
+ (d2i_of_void *)d2i_X509_REVOKED, (char *)(rev))
#endif
-#if !defined(HAVE_BN_GENCB_GET_ARG)
-# define BN_GENCB_get_arg(cb) (cb)->arg
+#if !defined(PKCS7_SIGNER_INFO_dup)
+# define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_SIGNER_INFO, \
+ (d2i_of_void *)d2i_PKCS7_SIGNER_INFO, (char *)(si))
#endif
-#if !defined(HAVE_EVP_MD_CTX_NEW)
-# define EVP_MD_CTX_new EVP_MD_CTX_create
+#if !defined(PKCS7_RECIP_INFO_dup)
+# define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_RECIP_INFO, \
+ (d2i_of_void *)d2i_PKCS7_RECIP_INFO, (char *)(ri))
#endif
-#if !defined(HAVE_EVP_MD_CTX_FREE)
-# define EVP_MD_CTX_free EVP_MD_CTX_destroy
+#if !defined(HAVE_HMAC_CTX_INIT)
+void HMAC_CTX_init(HMAC_CTX *ctx);
#endif
-#if !defined(HAVE_HMAC_CTX_NEW)
-HMAC_CTX *ossl_HMAC_CTX_new(void);
-# define HMAC_CTX_new ossl_HMAC_CTX_new
+#if !defined(HAVE_HMAC_CTX_COPY)
+void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
#endif
-#if !defined(HAVE_HMAC_CTX_FREE)
-void ossl_HMAC_CTX_free(HMAC_CTX *);
-# define HMAC_CTX_free ossl_HMAC_CTX_free
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
+void HMAC_CTX_cleanup(HMAC_CTX *ctx);
#endif
-#if !defined(HAVE_X509_STORE_GET_EX_DATA)
-# define X509_STORE_get_ex_data(x, idx) \
- CRYPTO_get_ex_data(&(x)->ex_data, (idx))
+#if !defined(HAVE_EVP_MD_CTX_CREATE)
+EVP_MD_CTX *EVP_MD_CTX_create(void);
#endif
-#if !defined(HAVE_X509_STORE_SET_EX_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))
+#if !defined(HAVE_EVP_MD_CTX_INIT)
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+#endif
+
+#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
#endif
-#if !defined(HAVE_X509_CRL_GET0_SIGNATURE)
-void ossl_X509_CRL_get0_signature(const X509_CRL *, const ASN1_BIT_STRING **, const X509_ALGOR **);
-# define X509_CRL_get0_signature ossl_X509_CRL_get0_signature
+#if !defined(HAVE_EVP_MD_CTX_DESTROY)
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
#endif
-#if !defined(HAVE_X509_REQ_GET0_SIGNATURE)
-void ossl_X509_REQ_get0_signature(const X509_REQ *, const ASN1_BIT_STRING **, const X509_ALGOR **);
-# define X509_REQ_get0_signature ossl_X509_REQ_get0_signature
+#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
+int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
#endif
-#if !defined(HAVE_X509_REVOKED_GET0_SERIALNUMBER)
-# define X509_REVOKED_get0_serialNumber(x) ((x)->serialNumber)
+#if !defined(HAVE_EVP_DIGESTINIT_EX)
+# define EVP_DigestInit_ex(ctx, md, engine) EVP_DigestInit((ctx), (md))
+#endif
+#if !defined(HAVE_EVP_DIGESTFINAL_EX)
+# define EVP_DigestFinal_ex(ctx, buf, len) EVP_DigestFinal((ctx), (buf), (len))
#endif
-#if !defined(HAVE_X509_REVOKED_GET0_REVOCATIONDATE)
-# define X509_REVOKED_get0_revocationDate(x) ((x)->revocationDate)
+#if !defined(HAVE_EVP_CIPHERINIT_EX)
+# define EVP_CipherInit_ex(ctx, type, impl, key, iv, enc) EVP_CipherInit((ctx), (type), (key), (iv), (enc))
+#endif
+#if !defined(HAVE_EVP_CIPHERFINAL_EX)
+# define EVP_CipherFinal_ex(ctx, outm, outl) EVP_CipherFinal((ctx), (outm), (outl))
#endif
-#if !defined(HAVE_X509_GET0_TBS_SIGALG)
-# define X509_get0_tbs_sigalg(x) ((x)->cert_info->signature)
+#if !defined(EVP_CIPHER_name)
+# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
#endif
-#if !defined(HAVE_X509_STORE_CTX_GET0_UNTRUSTED)
-# define X509_STORE_CTX_get0_untrusted(x) ((x)->untrusted)
+#if !defined(EVP_MD_name)
+# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e))
#endif
-#if !defined(HAVE_X509_STORE_CTX_GET0_CERT)
-# define X509_STORE_CTX_get0_cert(x) ((x)->cert)
+#if !defined(HAVE_EVP_HMAC_INIT_EX)
+# define HMAC_Init_ex(ctx, key, len, digest, engine) HMAC_Init((ctx), (key), (len), (digest))
#endif
-#if !defined(HAVE_X509_STORE_CTX_GET0_CHAIN)
-# define X509_STORE_CTX_get0_chain(ctx) X509_STORE_CTX_get_chain(ctx)
+#if !defined(PKCS7_is_detached)
+# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
#endif
-#if !defined(HAVE_OCSP_SINGLERESP_GET0_ID)
-# define OCSP_SINGLERESP_get0_id(s) ((s)->certId)
+#if !defined(PKCS7_type_is_encrypted)
+# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
#endif
-#if !defined(HAVE_SSL_CTX_GET_CIPHERS)
-# define SSL_CTX_get_ciphers(ctx) ((ctx)->cipher_list)
+#if !defined(HAVE_OPENSSL_CLEANSE)
+#define OPENSSL_cleanse(p, l) memset((p), 0, (l))
#endif
-#if !defined(HAVE_X509_UP_REF)
-# define X509_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509)
+#if !defined(HAVE_X509_STORE_GET_EX_DATA)
+void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
#endif
-#if !defined(HAVE_X509_CRL_UP_REF)
-# define X509_CRL_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_CRL);
+#if !defined(HAVE_X509_STORE_SET_EX_DATA)
+int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
#endif
-#if !defined(HAVE_X509_STORE_UP_REF)
-# define X509_STORE_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_STORE);
+#if !defined(HAVE_X509_CRL_SET_VERSION)
+int X509_CRL_set_version(X509_CRL *x, long version);
#endif
-#if !defined(HAVE_SSL_SESSION_UP_REF)
-# define SSL_SESSION_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
+#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
#endif
-#if !defined(HAVE_EVP_PKEY_UP_REF)
-# define EVP_PKEY_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_EVP_PKEY);
+#if !defined(HAVE_X509_CRL_SORT)
+int X509_CRL_sort(X509_CRL *c);
#endif
-#if !defined(HAVE_OPAQUE_OPENSSL)
-#define IMPL_PKEY_GETTER(_type, _name) \
-static inline _type *EVP_PKEY_get0_##_type(EVP_PKEY *pkey) { \
- return pkey->pkey._name; }
-#define IMPL_KEY_ACCESSOR2(_type, _group, a1, a2, _fail_cond) \
-static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2) { \
- if (a1) *a1 = obj->a1; \
- if (a2) *a2 = obj->a2; } \
-static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
- if (_fail_cond) return 0; \
- BN_clear_free(obj->a1); obj->a1 = a1; \
- BN_clear_free(obj->a2); obj->a2 = a2; \
- return 1; }
-#define IMPL_KEY_ACCESSOR3(_type, _group, a1, a2, a3, _fail_cond) \
-static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2, const BIGNUM **a3) { \
- if (a1) *a1 = obj->a1; \
- if (a2) *a2 = obj->a2; \
- if (a3) *a3 = obj->a3; } \
-static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2, BIGNUM *a3) { \
- if (_fail_cond) return 0; \
- BN_clear_free(obj->a1); obj->a1 = a1; \
- BN_clear_free(obj->a2); obj->a2 = a2; \
- BN_clear_free(obj->a3); obj->a3 = a3; \
- return 1; }
+#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
+#endif
-#if !defined(OPENSSL_NO_RSA)
-IMPL_PKEY_GETTER(RSA, rsa)
-IMPL_KEY_ACCESSOR3(RSA, key, n, e, d, (n == obj->n || e == obj->e || (obj->d && d == obj->d)))
-IMPL_KEY_ACCESSOR2(RSA, factors, p, q, (p == obj->p || q == obj->q))
-IMPL_KEY_ACCESSOR3(RSA, crt_params, dmp1, dmq1, iqmp, (dmp1 == obj->dmp1 || dmq1 == obj->dmq1 || iqmp == obj->iqmp))
+#if !defined(HAVE_BN_MOD_SQR)
+int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
#endif
-#if !defined(OPENSSL_NO_DSA)
-IMPL_PKEY_GETTER(DSA, dsa)
-IMPL_KEY_ACCESSOR2(DSA, key, pub_key, priv_key, (pub_key == obj->pub_key || (obj->priv_key && priv_key == obj->priv_key)))
-IMPL_KEY_ACCESSOR3(DSA, pqg, p, q, g, (p == obj->p || q == obj->q || g == obj->g))
+#if !defined(HAVE_BN_MOD_ADD)
+int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
#endif
-#if !defined(OPENSSL_NO_DH)
-IMPL_PKEY_GETTER(DH, dh)
-IMPL_KEY_ACCESSOR2(DH, key, pub_key, priv_key, (pub_key == obj->pub_key || (obj->priv_key && priv_key == obj->priv_key)))
-IMPL_KEY_ACCESSOR3(DH, pqg, p, q, g, (p == obj->p || obj->q && q == obj->q || g == obj->g))
-static inline ENGINE *DH_get0_engine(DH *dh) { return dh->engine; }
+#if !defined(HAVE_BN_MOD_SUB)
+int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
#endif
-#if !defined(OPENSSL_NO_EC)
-IMPL_PKEY_GETTER(EC_KEY, ec)
+#if !defined(HAVE_BN_RAND_RANGE)
+int BN_rand_range(BIGNUM *r, BIGNUM *range);
#endif
-#undef IMPL_PKEY_GETTER
-#undef IMPL_KEY_ACCESSOR2
-#undef IMPL_KEY_ACCESSOR3
-#endif /* HAVE_OPAQUE_OPENSSL */
+#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
+int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
+#endif
+
+#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
+char *CONF_get1_default_config_file(void);
+#endif
-#if !defined(EVP_CTRL_AEAD_GET_TAG)
-# define EVP_CTRL_AEAD_GET_TAG EVP_CTRL_GCM_GET_TAG
-# define EVP_CTRL_AEAD_SET_TAG EVP_CTRL_GCM_SET_TAG
-# define EVP_CTRL_AEAD_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
+#if !defined(HAVE_PEM_DEF_CALLBACK)
+int PEM_def_callback(char *buf, int num, int w, void *key);
#endif
-#if !defined(HAVE_X509_GET0_NOTBEFORE)
-# define X509_get0_notBefore(x) X509_get_notBefore(x)
-# define X509_get0_notAfter(x) X509_get_notAfter(x)
-# define X509_CRL_get0_lastUpdate(x) X509_CRL_get_lastUpdate(x)
-# define X509_CRL_get0_nextUpdate(x) X509_CRL_get_nextUpdate(x)
-# define X509_set1_notBefore(x, t) X509_set_notBefore(x, t)
-# define X509_set1_notAfter(x, t) X509_set_notAfter(x, t)
-# define X509_CRL_set1_lastUpdate(x, t) X509_CRL_set_lastUpdate(x, t)
-# define X509_CRL_set1_nextUpdate(x, t) X509_CRL_set_nextUpdate(x, t)
+#if !defined(HAVE_ASN1_PUT_EOC)
+int ASN1_put_eoc(unsigned char **pp);
#endif
-#if !defined(HAVE_SSL_SESSION_GET_PROTOCOL_VERSION)
-# define SSL_SESSION_get_protocol_version(s) ((s)->ssl_version)
+#if defined(__cplusplus)
+}
#endif
+
#endif /* _OSSL_OPENSSL_MISSING_H_ */
+
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 38e650e1a3..8b25c02990 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -1,15 +1,49 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
#include <stdarg.h> /* for ossl_raise */
-#include <ruby/thread_native.h> /* for OpenSSL < 1.1.0 locks */
+
+/*
+ * String to HEXString conversion
+ */
+int
+string2hex(const unsigned char *buf, int buf_len, char **hexbuf, int *hexbuf_len)
+{
+ static const char hex[]="0123456789abcdef";
+ int i, len;
+
+ 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;
+ }
+ return len;
+ }
+ if (!(*hexbuf = OPENSSL_malloc(len + 1))) {
+ return -1;
+ }
+ for (i = 0; i < buf_len; i++) {
+ (*hexbuf)[2 * i] = hex[((unsigned char)buf[i]) >> 4];
+ (*hexbuf)[2 * i + 1] = hex[buf[i] & 0x0f];
+ }
+ (*hexbuf)[2 * i] = '\0';
+
+ if (hexbuf_len) {
+ *hexbuf_len = len;
+ }
+ return len;
+}
/*
* Data Conversion
@@ -44,7 +78,7 @@ STACK_OF(type) * \
ossl_protect_##name##_ary2sk(VALUE ary, int *status) \
{ \
return (STACK_OF(type)*)rb_protect( \
- (VALUE (*)(VALUE))ossl_##name##_ary2sk0, \
+ (VALUE(*)_((VALUE)))ossl_##name##_ary2sk0, \
ary, \
status); \
} \
@@ -64,7 +98,7 @@ OSSL_IMPL_ARY2SK(x509, X509, cX509Cert, DupX509CertPtr)
#define OSSL_IMPL_SK2ARY(name, type) \
VALUE \
-ossl_##name##_sk2ary(const STACK_OF(type) *sk) \
+ossl_##name##_sk2ary(STACK_OF(type) *sk) \
{ \
type *t; \
int i, num; \
@@ -92,112 +126,47 @@ OSSL_IMPL_SK2ARY(x509crl, X509_CRL)
OSSL_IMPL_SK2ARY(x509name, X509_NAME)
static VALUE
-ossl_str_new_i(VALUE size)
+ossl_str_new(int size)
{
- return rb_str_new(NULL, (long)size);
-}
-
-VALUE
-ossl_str_new(const char *ptr, long len, int *pstate)
-{
- VALUE str;
- int state;
-
- str = rb_protect(ossl_str_new_i, len, &state);
- if (pstate)
- *pstate = state;
- if (state) {
- if (!pstate)
- rb_set_errinfo(Qnil);
- return Qnil;
- }
- if (ptr)
- memcpy(RSTRING_PTR(str), ptr, len);
- return str;
+ return rb_str_new(0, size);
}
VALUE
ossl_buf2str(char *buf, int len)
{
VALUE str;
- int state;
+ int status = 0;
- str = ossl_str_new(buf, len, &state);
+ str = rb_protect((VALUE(*)_((VALUE)))ossl_str_new, len, &status);
+ if(!NIL_P(str)) memcpy(RSTRING_PTR(str), buf, len);
OPENSSL_free(buf);
- if (state)
- rb_jump_tag(state);
- return str;
-}
-
-void
-ossl_bin2hex(unsigned char *in, char *out, size_t inlen)
-{
- const char *hex = "0123456789abcdef";
- size_t i;
+ if(status) rb_jump_tag(status);
- assert(inlen <= LONG_MAX / 2);
- for (i = 0; i < inlen; i++) {
- unsigned char p = in[i];
-
- out[i * 2 + 0] = hex[p >> 4];
- out[i * 2 + 1] = hex[p & 0x0f];
- }
+ return str;
}
/*
* our default PEM callback
*/
-VALUE
-ossl_pem_passwd_value(VALUE pass)
-{
- if (NIL_P(pass))
- return Qnil;
-
- StringValue(pass);
-
- /* PEM_BUFSIZE is currently used as the second argument of pem_password_cb,
- * that is +max_len+ of ossl_pem_passwd_cb() */
- if (RSTRING_LEN(pass) > PEM_BUFSIZE)
- ossl_raise(eOSSLError, "password must not be longer than %d bytes", PEM_BUFSIZE);
-
- return pass;
-}
-
static VALUE
ossl_pem_passwd_cb0(VALUE flag)
{
- VALUE pass = rb_yield(flag);
- if (NIL_P(pass))
- return Qnil;
- StringValue(pass);
+ VALUE pass;
+
+ pass = rb_yield(flag);
+ SafeStringValue(pass);
+
return pass;
}
int
-ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd_)
+ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd)
{
- long len;
- int status;
- VALUE rflag, pass = (VALUE)pwd_;
-
- if (RTEST(pass)) {
- /* PEM_def_callback(buf, max_len, flag, StringValueCStr(pass)) does not
- * work because it does not allow NUL characters and truncates to 1024
- * bytes silently if the input is over 1024 bytes */
- if (RB_TYPE_P(pass, T_STRING)) {
- len = RSTRING_LEN(pass);
- if (len <= max_len) {
- memcpy(buf, RSTRING_PTR(pass), len);
- return (int)len;
- }
- }
- OSSL_Debug("passed data is not valid String???");
- return -1;
- }
+ int len, status = 0;
+ VALUE rflag, pass;
- if (!rb_block_given_p()) {
- return PEM_def_callback(buf, max_len, flag, NULL);
- }
+ if (pwd || !rb_block_given_p())
+ return PEM_def_callback(buf, max_len, flag, pwd);
while (1) {
/*
@@ -212,17 +181,77 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd_)
rb_set_errinfo(Qnil);
return -1;
}
- if (NIL_P(pass))
- return -1;
- len = RSTRING_LEN(pass);
+ len = RSTRING_LENINT(pass);
+ if (len < 4) { /* 4 is OpenSSL hardcoded limit */
+ rb_warning("password must be longer than 4 bytes");
+ continue;
+ }
if (len > max_len) {
- rb_warning("password must not be longer than %d bytes", max_len);
+ rb_warning("password must be shorter then %d bytes", max_len-1);
continue;
}
memcpy(buf, RSTRING_PTR(pass), len);
break;
}
- return (int)len;
+ return len;
+}
+
+/*
+ * Verify callback
+ */
+int ossl_verify_cb_idx;
+
+VALUE
+ossl_call_verify_cb_proc(struct ossl_verify_cb_args *args)
+{
+ return rb_funcall(args->proc, rb_intern("call"), 2,
+ args->preverify_ok, args->store_ctx);
+}
+
+int
+ossl_verify_cb(int ok, X509_STORE_CTX *ctx)
+{
+ VALUE proc, rctx, ret;
+ 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)
+ return ok;
+ if (!NIL_P(proc)) {
+ ret = Qfalse;
+ rctx = rb_protect((VALUE(*)(VALUE))ossl_x509stctx_new,
+ (VALUE)ctx, &state);
+ if (state) {
+ rb_set_errinfo(Qnil);
+ rb_warn("StoreContext initialization failure");
+ }
+ else {
+ args.proc = proc;
+ args.preverify_ok = ok ? Qtrue : Qfalse;
+ args.store_ctx = rctx;
+ ret = rb_protect((VALUE(*)(VALUE))ossl_call_verify_cb_proc, (VALUE)&args, &state);
+ if (state) {
+ rb_set_errinfo(Qnil);
+ rb_warn("exception in verify_callback is ignored");
+ }
+ ossl_x509stctx_clear_ptr(rctx);
+ }
+ if (ret == Qtrue) {
+ X509_STORE_CTX_set_error(ctx, X509_V_OK);
+ ok = 1;
+ }
+ else{
+ if (X509_STORE_CTX_get_error(ctx) == X509_V_OK) {
+ X509_STORE_CTX_set_error(ctx, X509_V_ERR_CERT_REJECTED);
+ }
+ ok = 0;
+ }
+ }
+
+ return ok;
}
/*
@@ -238,7 +267,7 @@ VALUE eOSSLError;
/*
* Convert to DER string
*/
-static ID ossl_s_to_der;
+ID ossl_s_to_der;
VALUE
ossl_to_der(VALUE obj)
@@ -266,15 +295,22 @@ static VALUE
ossl_make_error(VALUE exc, const char *fmt, va_list args)
{
VALUE str = Qnil;
- unsigned long e;
+ const char *msg;
+ long e;
+#ifdef HAVE_ERR_PEEK_LAST_ERROR
+ e = ERR_peek_last_error();
+#else
+ e = ERR_peek_error();
+#endif
if (fmt) {
str = rb_vsprintf(fmt, args);
}
- e = ERR_peek_last_error();
if (e) {
- const char *msg = ERR_reason_error_string(e);
-
+ if (dOSSL == Qtrue) /* FULL INFO */
+ msg = ERR_error_string(e, NULL);
+ else
+ msg = ERR_reason_error_string(e);
if (NIL_P(str)) {
if (msg) str = rb_str_new_cstr(msg);
}
@@ -282,8 +318,13 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
if (RSTRING_LEN(str)) rb_str_cat2(str, ": ");
rb_str_cat2(str, msg ? msg : "(null)");
}
- ossl_clear_error();
}
+ if (dOSSL == Qtrue){ /* show all errors on the stack */
+ while ((e = ERR_get_error()) != 0){
+ rb_warn("error on stack: %s", ERR_error_string(e, NULL));
+ }
+ }
+ ERR_clear_error();
if (NIL_P(str)) str = rb_str_new(0, 0);
return rb_exc_new3(exc, str);
@@ -300,32 +341,15 @@ ossl_raise(VALUE exc, const char *fmt, ...)
rb_exc_raise(err);
}
-void
-ossl_clear_error(void)
+VALUE
+ossl_exc_new(VALUE exc, const char *fmt, ...)
{
- if (dOSSL == Qtrue) {
- unsigned long e;
- const char *file, *data, *errstr;
- int line, flags;
-
- while ((e = ERR_get_error_line_data(&file, &line, &data, &flags))) {
- errstr = ERR_error_string(e, NULL);
- if (!errstr)
- errstr = "(null)";
-
- if (flags & ERR_TXT_STRING) {
- if (!data)
- data = "(null)";
- rb_warn("error on stack: %s (%s)", errstr, data);
- }
- else {
- rb_warn("error on stack: %s", errstr);
- }
- }
- }
- else {
- ERR_clear_error();
- }
+ va_list args;
+ VALUE err;
+ va_start(args, fmt);
+ err = ossl_make_error(exc, fmt, args);
+ va_end(args);
+ return err;
}
/*
@@ -334,11 +358,10 @@ ossl_clear_error(void)
*
* See any remaining errors held in queue.
*
- * Any errors you see here are probably due to a bug in Ruby's OpenSSL
- * implementation.
+ * Any errors you see here are probably due to a bug in ruby's OpenSSL implementation.
*/
VALUE
-ossl_get_errors(void)
+ossl_get_errors()
{
VALUE ary;
long e;
@@ -386,35 +409,28 @@ ossl_debug_get(VALUE self)
* call-seq:
* OpenSSL.debug = boolean -> boolean
*
- * Turns on or off debug mode. With debug mode, all erros added to the OpenSSL
- * error queue will be printed to stderr.
+ * Turns on or off CRYPTO_MEM_CHECK.
+ * Also shows some debugging message on stderr.
*/
static VALUE
ossl_debug_set(VALUE self, VALUE val)
{
- dOSSL = RTEST(val) ? Qtrue : Qfalse;
-
+ VALUE old = dOSSL;
+ dOSSL = val;
+
+ if (old != dOSSL) {
+ if (dOSSL == Qtrue) {
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+ fprintf(stderr, "OSSL_DEBUG: IS NOW ON!\n");
+ } else if (old == Qtrue) {
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF);
+ fprintf(stderr, "OSSL_DEBUG: IS NOW OFF!\n");
+ }
+ }
return val;
}
/*
- * call-seq
- * OpenSSL.fips_mode -> true | false
- */
-static VALUE
-ossl_fips_mode_get(VALUE self)
-{
-
-#ifdef OPENSSL_FIPS
- VALUE enabled;
- enabled = FIPS_mode() ? Qtrue : Qfalse;
- return enabled;
-#else
- return Qfalse;
-#endif
-}
-
-/*
* call-seq:
* OpenSSL.fips_mode = boolean -> boolean
*
@@ -423,14 +439,15 @@ ossl_fips_mode_get(VALUE self)
* so otherwise will result in an error.
*
* === Examples
- * OpenSSL.fips_mode = true # turn FIPS mode on
- * OpenSSL.fips_mode = false # and off again
+ *
+ * OpenSSL.fips_mode = true # turn FIPS mode on
+ * OpenSSL.fips_mode = false # and off again
*/
static VALUE
ossl_fips_mode_set(VALUE self, VALUE enabled)
{
-#ifdef OPENSSL_FIPS
+#ifdef HAVE_OPENSSL_FIPS
if (RTEST(enabled)) {
int mode = FIPS_mode();
if(!mode && !FIPS_mode_set(1)) /* turning on twice leads to an error */
@@ -447,123 +464,44 @@ ossl_fips_mode_set(VALUE self, VALUE enabled)
#endif
}
-#if defined(OSSL_DEBUG)
-#if !defined(LIBRESSL_VERSION_NUMBER) && \
- (OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_NO_CRYPTO_MDEBUG) || \
- defined(CRYPTO_malloc_debug_init))
-/*
- * call-seq:
- * OpenSSL.mem_check_start -> nil
- *
- * Calls CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON). Starts tracking memory
- * allocations. See also OpenSSL.print_mem_leaks.
- *
- * This is available only when built with a capable OpenSSL and --enable-debug
- * configure option.
- */
-static VALUE
-mem_check_start(VALUE self)
-{
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
- return Qnil;
-}
-
-/*
- * call-seq:
- * OpenSSL.print_mem_leaks -> true | false
- *
- * For debugging the Ruby/OpenSSL library. Calls CRYPTO_mem_leaks_fp(stderr).
- * Prints detected memory leaks to standard error. This cleans the global state
- * up thus you cannot use any methods of the library after calling this.
- *
- * Returns +true+ if leaks detected, +false+ otherwise.
- *
- * This is available only when built with a capable OpenSSL and --enable-debug
- * configure option.
- *
- * === Example
- * OpenSSL.mem_check_start
- * NOT_GCED = OpenSSL::PKey::RSA.new(256)
- *
- * END {
- * GC.start
- * OpenSSL.print_mem_leaks # will print the leakage
- * }
- */
-static VALUE
-print_mem_leaks(VALUE self)
-{
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
- int ret;
-#endif
-
- BN_CTX_free(ossl_bn_ctx);
- ossl_bn_ctx = NULL;
-
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
- ret = CRYPTO_mem_leaks_fp(stderr);
- if (ret < 0)
- ossl_raise(eOSSLError, "CRYPTO_mem_leaks_fp");
- return ret ? Qfalse : Qtrue;
-#else
- CRYPTO_mem_leaks_fp(stderr);
- return Qnil;
-#endif
-}
-#endif
-#endif
-
-#if !defined(HAVE_OPENSSL_110_THREADING_API)
/**
* Stores locks needed for OpenSSL thread safety
*/
-struct CRYPTO_dynlock_value {
- rb_nativethread_lock_t lock;
- rb_nativethread_id_t owner;
- size_t count;
-};
+#include "ruby/thread_native.h"
+static rb_nativethread_lock_t *ossl_locks;
static void
-ossl_lock_init(struct CRYPTO_dynlock_value *l)
+ossl_lock_unlock(int mode, rb_nativethread_lock_t *lock)
{
- rb_nativethread_lock_initialize(&l->lock);
- l->count = 0;
+ if (mode & CRYPTO_LOCK) {
+ rb_nativethread_lock_lock(lock);
+ } else {
+ rb_nativethread_lock_unlock(lock);
+ }
}
static void
-ossl_lock_unlock(int mode, struct CRYPTO_dynlock_value *l)
+ossl_lock_callback(int mode, int type, const char *file, int line)
{
- if (mode & CRYPTO_LOCK) {
- /* TODO: rb_nativethread_id_t is not necessarily compared with ==. */
- rb_nativethread_id_t tid = rb_nativethread_self();
- if (l->count && l->owner == tid) {
- l->count++;
- return;
- }
- rb_nativethread_lock_lock(&l->lock);
- l->owner = tid;
- l->count = 1;
- } else {
- if (!--l->count)
- rb_nativethread_lock_unlock(&l->lock);
- }
+ ossl_lock_unlock(mode, &ossl_locks[type]);
}
+struct CRYPTO_dynlock_value {
+ rb_nativethread_lock_t lock;
+};
+
static struct CRYPTO_dynlock_value *
ossl_dyn_create_callback(const char *file, int line)
{
- /* Do not use xmalloc() here, since it may raise NoMemoryError */
- struct CRYPTO_dynlock_value *dynlock =
- OPENSSL_malloc(sizeof(struct CRYPTO_dynlock_value));
- if (dynlock)
- ossl_lock_init(dynlock);
+ struct CRYPTO_dynlock_value *dynlock = (struct CRYPTO_dynlock_value *)OPENSSL_malloc((int)sizeof(struct CRYPTO_dynlock_value));
+ rb_nativethread_lock_initialize(&dynlock->lock);
return dynlock;
}
static void
ossl_dyn_lock_callback(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)
{
- ossl_lock_unlock(mode, l);
+ ossl_lock_unlock(mode, &l->lock);
}
static void
@@ -573,40 +511,50 @@ ossl_dyn_destroy_callback(struct CRYPTO_dynlock_value *l, const char *file, int
OPENSSL_free(l);
}
+#ifdef HAVE_CRYPTO_THREADID_PTR
static void ossl_threadid_func(CRYPTO_THREADID *id)
{
/* register native thread id */
CRYPTO_THREADID_set_pointer(id, (void *)rb_nativethread_self());
}
-
-static struct CRYPTO_dynlock_value *ossl_locks;
-
-static void
-ossl_lock_callback(int mode, int type, const char *file, int line)
+#else
+static unsigned long ossl_thread_id(void)
{
- ossl_lock_unlock(mode, &ossl_locks[type]);
+ /* before OpenSSL 1.0, this is 'unsigned long' */
+ return (unsigned long)rb_nativethread_self();
}
+#endif
static void Init_ossl_locks(void)
{
int i;
int num_locks = CRYPTO_num_locks();
- ossl_locks = ALLOC_N(struct CRYPTO_dynlock_value, num_locks);
- for (i = 0; i < num_locks; i++)
- ossl_lock_init(&ossl_locks[i]);
+ if ((unsigned)num_locks >= INT_MAX / (int)sizeof(VALUE)) {
+ rb_raise(rb_eRuntimeError, "CRYPTO_num_locks() is too big: %d", num_locks);
+ }
+ ossl_locks = (rb_nativethread_lock_t *) OPENSSL_malloc(num_locks * (int)sizeof(rb_nativethread_lock_t));
+ if (!ossl_locks) {
+ rb_raise(rb_eNoMemError, "CRYPTO_num_locks() is too big: %d", num_locks);
+ }
+ for (i = 0; i < num_locks; i++) {
+ rb_nativethread_lock_initialize(&ossl_locks[i]);
+ }
+#ifdef HAVE_CRYPTO_THREADID_PTR
CRYPTO_THREADID_set_callback(ossl_threadid_func);
+#else
+ CRYPTO_set_id_callback(ossl_thread_id);
+#endif
CRYPTO_set_locking_callback(ossl_lock_callback);
CRYPTO_set_dynlock_create_callback(ossl_dyn_create_callback);
CRYPTO_set_dynlock_lock_callback(ossl_dyn_lock_callback);
CRYPTO_set_dynlock_destroy_callback(ossl_dyn_destroy_callback);
}
-#endif /* !HAVE_OPENSSL_110_THREADING_API */
/*
* OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
- * OpenSSL[https://www.openssl.org/] library.
+ * OpenSSL[http://www.openssl.org/] library.
*
* = Examples
*
@@ -652,12 +600,10 @@ static void Init_ossl_locks(void)
*
* key2 = OpenSSL::PKey::RSA.new File.read 'private_key.pem'
* key2.public? # => true
- * key2.private? # => true
*
* or
*
* key3 = OpenSSL::PKey::RSA.new File.read 'public_key.pem'
- * key3.public? # => true
* key3.private? # => false
*
* === Loading an Encrypted Key
@@ -667,7 +613,6 @@ static void Init_ossl_locks(void)
* loading the key:
*
* key4_pem = File.read 'private.secure.pem'
- * pass_phrase = 'my secure pass phrase goes here'
* key4 = OpenSSL::PKey::RSA.new key4_pem, pass_phrase
*
* == RSA Encryption
@@ -832,7 +777,6 @@ static void Init_ossl_locks(void)
* This example creates a self-signed certificate using an RSA key and a SHA1
* signature.
*
- * key = OpenSSL::PKey::RSA.new 2048
* name = OpenSSL::X509::Name.parse 'CN=nobody/DC=example'
*
* cert = OpenSSL::X509::Certificate.new
@@ -902,9 +846,8 @@ static void Init_ossl_locks(void)
* not readable by other users.
*
* ca_key = OpenSSL::PKey::RSA.new 2048
- * pass_phrase = 'my secure pass phrase goes here'
*
- * cipher = OpenSSL::Cipher.new 'AES-128-CBC'
+ * cipher = OpenSSL::Cipher::Cipher.new 'AES-128-CBC'
*
* open 'ca_key.pem', 'w', 0400 do |io|
* io.write ca_key.export(cipher, pass_phrase)
@@ -1057,21 +1000,15 @@ static void Init_ossl_locks(void)
* SSLSocket#connect must be called to initiate the SSL handshake and start
* encryption. A key and certificate are not required for the client socket.
*
- * Note that SSLSocket#close doesn't close the underlying socket by default. Set
- * SSLSocket#sync_close to true if you want.
- *
* require 'socket'
*
- * tcp_socket = TCPSocket.new 'localhost', 5000
- * ssl_client = OpenSSL::SSL::SSLSocket.new tcp_socket, context
- * ssl_client.sync_close = true
+ * tcp_client = TCPSocket.new 'localhost', 5000
+ * ssl_client = OpenSSL::SSL::SSLSocket.new client_socket, context
* ssl_client.connect
*
* ssl_client.puts "hello server!"
* puts ssl_client.gets
*
- * ssl_client.close # shutdown the TLS connection and close tcp_socket
- *
* === Peer Verification
*
* An unverified SSL connection does not provide much security. For enhanced
@@ -1085,8 +1022,8 @@ static void Init_ossl_locks(void)
*
* require 'socket'
*
- * tcp_socket = TCPSocket.new 'localhost', 5000
- * ssl_client = OpenSSL::SSL::SSLSocket.new tcp_socket, context
+ * tcp_client = TCPSocket.new 'localhost', 5000
+ * ssl_client = OpenSSL::SSL::SSLSocket.new client_socket, context
* ssl_client.connect
*
* ssl_client.puts "hello server!"
@@ -1097,9 +1034,8 @@ static void Init_ossl_locks(void)
*
*/
void
-Init_openssl(void)
+Init_openssl()
{
-#undef rb_intern
/*
* Init timezone info
*/
@@ -1110,14 +1046,25 @@ Init_openssl(void)
/*
* Init all digests, ciphers
*/
-#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
- if (!OPENSSL_init_ssl(0, NULL))
- rb_raise(rb_eRuntimeError, "OPENSSL_init_ssl");
-#else
+ /* CRYPTO_malloc_init(); */
+ /* ENGINE_load_builtin_engines(); */
OpenSSL_add_ssl_algorithms();
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
SSL_load_error_strings();
+
+ /*
+ * FIXME:
+ * On unload do:
+ */
+#if 0
+ CONF_modules_unload(1);
+ destroy_ui_method();
+ EVP_cleanup();
+ ENGINE_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ ERR_remove_state(0);
+ ERR_free_strings();
#endif
/*
@@ -1139,11 +1086,7 @@ Init_openssl(void)
/*
* Version of OpenSSL the ruby OpenSSL extension is running with
*/
-#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
- rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(OpenSSL_version(OPENSSL_VERSION)));
-#else
rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION)));
-#endif
/*
* Version number of OpenSSL the ruby OpenSSL extension was built with
@@ -1152,17 +1095,13 @@ Init_openssl(void)
rb_define_const(mOSSL, "OPENSSL_VERSION_NUMBER", INT2NUM(OPENSSL_VERSION_NUMBER));
/*
- * Boolean indicating whether OpenSSL is FIPS-capable or not
+ * Boolean indicating whether OpenSSL is FIPS-enabled or not
*/
- rb_define_const(mOSSL, "OPENSSL_FIPS",
-#ifdef OPENSSL_FIPS
- Qtrue
+#ifdef HAVE_OPENSSL_FIPS
+ rb_define_const(mOSSL, "OPENSSL_FIPS", Qtrue);
#else
- Qfalse
+ rb_define_const(mOSSL, "OPENSSL_FIPS", Qfalse);
#endif
- );
-
- rb_define_module_function(mOSSL, "fips_mode", ossl_fips_mode_get, 0);
rb_define_module_function(mOSSL, "fips_mode=", ossl_fips_mode_set, 1);
/*
@@ -1173,6 +1112,12 @@ Init_openssl(void)
rb_global_variable(&eOSSLError);
/*
+ * 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)
+ ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
+
+ /*
* Init debug core
*/
dOSSL = Qfalse;
@@ -1187,9 +1132,7 @@ Init_openssl(void)
*/
ossl_s_to_der = rb_intern("to_der");
-#if !defined(HAVE_OPENSSL_110_THREADING_API)
Init_ossl_locks();
-#endif
/*
* Init components
@@ -1202,6 +1145,7 @@ Init_openssl(void)
Init_ossl_ns_spki();
Init_ossl_pkcs12();
Init_ossl_pkcs7();
+ Init_ossl_pkcs5();
Init_ossl_pkey();
Init_ossl_rand();
Init_ossl_ssl();
@@ -1209,41 +1153,16 @@ Init_openssl(void)
Init_ossl_ocsp();
Init_ossl_engine();
Init_ossl_asn1();
- Init_ossl_kdf();
+}
#if defined(OSSL_DEBUG)
- /*
- * For debugging Ruby/OpenSSL. Enable only when built with --enable-debug
- */
-#if !defined(LIBRESSL_VERSION_NUMBER) && \
- (OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_NO_CRYPTO_MDEBUG) || \
- defined(CRYPTO_malloc_debug_init))
- rb_define_module_function(mOSSL, "mem_check_start", mem_check_start, 0);
- rb_define_module_function(mOSSL, "print_mem_leaks", print_mem_leaks, 0);
-
-#if defined(CRYPTO_malloc_debug_init) /* <= 1.0.2 */
- CRYPTO_malloc_debug_init();
-#endif
-
-#if defined(V_CRYPTO_MDEBUG_ALL) /* <= 1.0.2 */
- CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
-#endif
-
-#if OPENSSL_VERSION_NUMBER < 0x10100000 /* <= 1.0.2 */
- {
- int i;
- /*
- * See crypto/ex_data.c; call def_get_class() immediately to avoid
- * allocations. 15 is the maximum number that is used as the class index
- * in OpenSSL 1.0.2.
- */
- for (i = 0; i <= 15; i++) {
- if (CRYPTO_get_ex_new_index(i, 0, (void *)"ossl-mdebug-dummy", 0, 0, 0) < 0)
- rb_raise(rb_eRuntimeError, "CRYPTO_get_ex_new_index for "
- "class index %d failed", i);
- }
- }
-#endif
-#endif
-#endif
+/*
+ * Check if all symbols are OK with 'make LDSHARED=gcc all'
+ */
+int
+main(int argc, char *argv[])
+{
+ return 0;
}
+#endif /* OSSL_DEBUG */
+
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 5a15839cb4..c843c06f5c 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_H_)
@@ -12,14 +13,49 @@
#include RUBY_EXTCONF_H
-#include <assert.h>
-#include <errno.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if 0
+ mOSSL = rb_define_module("OpenSSL");
+ mX509 = rb_define_module_under(mOSSL, "X509");
+#endif
+
+/*
+* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
+*/
+#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
+# undef RFILE
+#endif
#include <ruby.h>
#include <ruby/io.h>
#include <ruby/thread.h>
+
+/*
+ * Check the OpenSSL version
+ * The only supported are:
+ * OpenSSL >= 0.9.7
+ */
#include <openssl/opensslv.h>
+
+#ifdef HAVE_ASSERT_H
+# include <assert.h>
+#else
+# define assert(condition)
+#endif
+
+#if defined(_WIN32)
+# include <openssl/e_os2.h>
+# define OSSL_NO_CONF_API 1
+# if !defined(OPENSSL_SYS_WIN32)
+# define OPENSSL_SYS_WIN32 1
+# endif
+# include <winsock2.h>
+#endif
+#include <errno.h>
#include <openssl/err.h>
-#include <openssl/asn1.h>
+#include <openssl/asn1_mac.h>
#include <openssl/x509v3.h>
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
@@ -28,18 +64,21 @@
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
-#include <openssl/crypto.h>
-#if !defined(OPENSSL_NO_ENGINE)
+#undef X509_NAME
+#undef PKCS7_SIGNER_INFO
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
+# define OSSL_ENGINE_ENABLED
# include <openssl/engine.h>
#endif
-#if !defined(OPENSSL_NO_OCSP)
+#if defined(HAVE_OPENSSL_OCSP_H)
+# define OSSL_OCSP_ENABLED
# include <openssl/ocsp.h>
#endif
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-#include <openssl/dsa.h>
-#include <openssl/evp.h>
-#include <openssl/dh.h>
+
+/* OpenSSL requires passwords for PEM-encoded files to be at least four
+ * characters long
+ */
+#define OSSL_MIN_PWD_LEN 4
/*
* Common Module
@@ -61,29 +100,41 @@ extern VALUE eOSSLError;
}\
} while (0)
+#define OSSL_Check_Instance(obj, klass) do {\
+ if (!rb_obj_is_instance_of((obj), (klass))) {\
+ ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\
+ rb_obj_class(obj), (klass));\
+ }\
+} while (0)
+
+#define OSSL_Check_Same_Class(obj1, obj2) do {\
+ if (!rb_obj_is_instance_of((obj1), rb_obj_class(obj2))) {\
+ ossl_raise(rb_eTypeError, "wrong argument type");\
+ }\
+} while (0)
+
/*
- * Type conversions
+ * Compatibility
*/
-#if !defined(NUM2UINT64T) /* in case Ruby starts to provide */
-# if SIZEOF_LONG == 8
-# define NUM2UINT64T(x) ((uint64_t)NUM2ULONG(x))
-# elif defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
-# define NUM2UINT64T(x) ((uint64_t)NUM2ULL(x))
-# else
-# error "unknown platform; no 64-bit width integer"
-# endif
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#define STACK _STACK
#endif
/*
+ * String to HEXString conversion
+ */
+int string2hex(const unsigned char *, int, char **, int *);
+
+/*
* Data Conversion
*/
+STACK_OF(X509) *ossl_x509_ary2sk0(VALUE);
STACK_OF(X509) *ossl_x509_ary2sk(VALUE);
STACK_OF(X509) *ossl_protect_x509_ary2sk(VALUE,int*);
-VALUE ossl_x509_sk2ary(const STACK_OF(X509) *certs);
-VALUE ossl_x509crl_sk2ary(const STACK_OF(X509_CRL) *crl);
-VALUE ossl_x509name_sk2ary(const STACK_OF(X509_NAME) *names);
+VALUE ossl_x509_sk2ary(STACK_OF(X509) *certs);
+VALUE ossl_x509crl_sk2ary(STACK_OF(X509_CRL) *crl);
+VALUE ossl_x509name_sk2ary(STACK_OF(X509_NAME) *names);
VALUE ossl_buf2str(char *buf, int len);
-VALUE ossl_str_new(const char *, long, int *);
#define ossl_str_adjust(str, p) \
do{\
long len = RSTRING_LEN(str);\
@@ -91,42 +142,44 @@ do{\
assert(newlen <= len);\
rb_str_set_len((str), newlen);\
}while(0)
-/*
- * Convert binary string to hex string. The caller is responsible for
- * ensuring out has (2 * len) bytes of capacity.
- */
-void ossl_bin2hex(unsigned char *in, char *out, size_t len);
/*
- * Our default PEM callback
+ * our default PEM callback
*/
-/* Convert the argument to String and validate the length. Note this may raise. */
-VALUE ossl_pem_passwd_value(VALUE);
-/* Can be casted to pem_password_cb. If a password (String) is passed as the
- * "arbitrary data" (typically the last parameter of PEM_{read,write}_
- * functions), uses the value. If not, but a block is given, yields to it.
- * If not either, fallbacks to PEM_def_callback() which reads from stdin. */
int ossl_pem_passwd_cb(char *, int, int, void *);
/*
* Clear BIO* with this in PEM/DER fallback scenarios to avoid decoding
* errors piling up in OpenSSL::Errors
*/
-#define OSSL_BIO_reset(bio) do { \
- (void)BIO_reset((bio)); \
- ossl_clear_error(); \
-} while (0)
+#define OSSL_BIO_reset(bio) (void)BIO_reset((bio)); \
+ ERR_clear_error();
/*
* ERRor messages
*/
+#define OSSL_ErrMsg() ERR_reason_error_string(ERR_get_error())
NORETURN(void ossl_raise(VALUE, const char *, ...));
-/* Clear OpenSSL error queue. If dOSSL is set, rb_warn() them. */
-void ossl_clear_error(void);
+VALUE ossl_exc_new(VALUE, const char *, ...);
+
+/*
+ * Verify callback
+ */
+extern int ossl_verify_cb_idx;
+
+struct ossl_verify_cb_args {
+ VALUE proc;
+ VALUE preverify_ok;
+ VALUE store_ctx;
+};
+
+VALUE ossl_call_verify_cb_proc(struct ossl_verify_cb_args *);
+int ossl_verify_cb(int, X509_STORE_CTX *);
/*
* String to DER String
*/
+extern ID ossl_s_to_der;
VALUE ossl_to_der(VALUE);
VALUE ossl_to_der_if_possible(VALUE);
@@ -144,9 +197,20 @@ extern VALUE dOSSL;
} \
} while (0)
+#define OSSL_Warning(fmt, ...) do { \
+ OSSL_Debug((fmt), ##__VA_ARGS__); \
+ rb_warning((fmt), ##__VA_ARGS__); \
+} while (0)
+
+#define OSSL_Warn(fmt, ...) do { \
+ OSSL_Debug((fmt), ##__VA_ARGS__); \
+ rb_warn((fmt), ##__VA_ARGS__); \
+} while (0)
#else
void ossl_debug(const char *, ...);
#define OSSL_Debug ossl_debug
+#define OSSL_Warning rb_warning
+#define OSSL_Warn rb_warn
#endif
/*
@@ -165,14 +229,19 @@ void ossl_debug(const char *, ...);
#include "ossl_ocsp.h"
#include "ossl_pkcs12.h"
#include "ossl_pkcs7.h"
+#include "ossl_pkcs5.h"
#include "ossl_pkey.h"
#include "ossl_rand.h"
#include "ossl_ssl.h"
#include "ossl_version.h"
#include "ossl_x509.h"
#include "ossl_engine.h"
-#include "ossl_kdf.h"
void Init_openssl(void);
+#if defined(__cplusplus)
+}
+#endif
+
#endif /* _OSSL_H_ */
+
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 7b6c973803..65ae71e861 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -1,28 +1,41 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
+#if defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+#elif !defined(NT) && !defined(_WIN32)
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+#endif
+
+static VALUE join_der(VALUE enumerable);
static VALUE ossl_asn1_decode0(unsigned char **pp, long length, long *offset,
int depth, int yield, long *num_read);
static VALUE ossl_asn1_initialize(int argc, VALUE *argv, VALUE self);
+static VALUE ossl_asn1eoc_initialize(VALUE self);
/*
* DATE conversion
*/
VALUE
-asn1time_to_time(const ASN1_TIME *time)
+asn1time_to_time(ASN1_TIME *time)
{
struct tm tm;
VALUE argv[6];
int count;
+ if (!time || !time->data) return Qnil;
memset(&tm, 0, sizeof(struct tm));
switch (time->type) {
@@ -44,15 +57,9 @@ asn1time_to_time(const ASN1_TIME *time)
}
break;
case V_ASN1_GENERALIZEDTIME:
- count = sscanf((const char *)time->data, "%4d%2d%2d%2d%2d%2dZ",
- &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min,
- &tm.tm_sec);
- if (count == 5) {
- tm.tm_sec = 0;
- }
- else if (count != 6) {
- ossl_raise(rb_eTypeError, "bad GENERALIZEDTIME format: \"%s\"",
- time->data);
+ if (sscanf((const char *)time->data, "%4d%2d%2d%2d%2d%2dZ", &tm.tm_year, &tm.tm_mon,
+ &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
+ ossl_raise(rb_eTypeError, "bad GENERALIZEDTIME format" );
}
break;
default:
@@ -69,57 +76,83 @@ asn1time_to_time(const ASN1_TIME *time)
return rb_funcall2(rb_cTime, rb_intern("utc"), 6, argv);
}
-void
-ossl_time_split(VALUE time, time_t *sec, int *days)
-{
- VALUE num = rb_Integer(time);
+/*
+ * This function is not exported in Ruby's *.h
+ */
+extern struct timeval rb_time_timeval(VALUE);
- if (FIXNUM_P(num)) {
- time_t t = FIX2LONG(num);
- *sec = t % 86400;
- *days = rb_long2int(t / 86400);
- }
- else {
- *days = NUM2INT(rb_funcall(num, rb_intern("/"), 1, INT2FIX(86400)));
- *sec = NUM2TIMET(rb_funcall(num, rb_intern("%"), 1, INT2FIX(86400)));
- }
+time_t
+time_to_time_t(VALUE time)
+{
+ return (time_t)NUM2LONG(rb_Integer(time));
}
/*
* STRING conversion
*/
VALUE
-asn1str_to_str(const ASN1_STRING *str)
+asn1str_to_str(ASN1_STRING *str)
{
return rb_str_new((const char *)str->data, str->length);
}
/*
* ASN1_INTEGER conversions
+ * TODO: Make a decision what's the right way to do this.
*/
+#define DO_IT_VIA_RUBY 0
VALUE
-asn1integer_to_num(const ASN1_INTEGER *ai)
+asn1integer_to_num(ASN1_INTEGER *ai)
{
BIGNUM *bn;
+#if DO_IT_VIA_RUBY
+ char *txt;
+#endif
VALUE num;
if (!ai) {
ossl_raise(rb_eTypeError, "ASN1_INTEGER is NULL!");
}
- if (ai->type == V_ASN1_ENUMERATED)
- /* const_cast: workaround for old OpenSSL */
- bn = ASN1_ENUMERATED_to_BN((ASN1_ENUMERATED *)ai, NULL);
- else
- bn = ASN1_INTEGER_to_BN(ai, NULL);
-
- if (!bn)
+ if (!(bn = ASN1_INTEGER_to_BN(ai, NULL))) {
+ ossl_raise(eOSSLError, NULL);
+ }
+#if DO_IT_VIA_RUBY
+ if (!(txt = BN_bn2dec(bn))) {
+ BN_free(bn);
ossl_raise(eOSSLError, NULL);
+ }
+ num = rb_cstr_to_inum(txt, 10, Qtrue);
+ OPENSSL_free(txt);
+#else
num = ossl_bn_new(bn);
+#endif
BN_free(bn);
return num;
}
+#if DO_IT_VIA_RUBY
+ASN1_INTEGER *
+num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
+{
+ BIGNUM *bn = NULL;
+
+ if (RTEST(rb_obj_is_kind_of(obj, cBN))) {
+ bn = GetBNPtr(obj);
+ } else {
+ obj = rb_String(obj);
+ if (!BN_dec2bn(&bn, StringValuePtr(obj))) {
+ ossl_raise(eOSSLError, NULL);
+ }
+ }
+ if (!(ai = BN_to_ASN1_INTEGER(bn, ai))) {
+ BN_free(bn);
+ ossl_raise(eOSSLError, NULL);
+ }
+ BN_free(bn);
+ return ai;
+}
+#else
ASN1_INTEGER *
num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
{
@@ -135,6 +168,7 @@ num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
return ai;
}
+#endif
/********/
/*
@@ -144,13 +178,13 @@ num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
#define ossl_asn1_get_tag(o) rb_attr_get((o),sivTAG)
#define ossl_asn1_get_tagging(o) rb_attr_get((o),sivTAGGING)
#define ossl_asn1_get_tag_class(o) rb_attr_get((o),sivTAG_CLASS)
-#define ossl_asn1_get_indefinite_length(o) rb_attr_get((o),sivINDEFINITE_LENGTH)
+#define ossl_asn1_get_infinite_length(o) rb_attr_get((o),sivINFINITE_LENGTH)
#define ossl_asn1_set_value(o,v) rb_ivar_set((o),sivVALUE,(v))
#define ossl_asn1_set_tag(o,v) rb_ivar_set((o),sivTAG,(v))
#define ossl_asn1_set_tagging(o,v) rb_ivar_set((o),sivTAGGING,(v))
#define ossl_asn1_set_tag_class(o,v) rb_ivar_set((o),sivTAG_CLASS,(v))
-#define ossl_asn1_set_indefinite_length(o,v) rb_ivar_set((o),sivINDEFINITE_LENGTH,(v))
+#define ossl_asn1_set_infinite_length(o,v) rb_ivar_set((o),sivINFINITE_LENGTH,(v))
VALUE mASN1;
VALUE eASN1Error;
@@ -174,10 +208,22 @@ VALUE cASN1ObjectId; /* OBJECT IDENTIFIER */
VALUE cASN1UTCTime, cASN1GeneralizedTime; /* TIME */
VALUE cASN1Sequence, cASN1Set; /* CONSTRUCTIVE */
-static VALUE sym_IMPLICIT, sym_EXPLICIT;
-static VALUE sym_UNIVERSAL, sym_APPLICATION, sym_CONTEXT_SPECIFIC, sym_PRIVATE;
-static ID sivVALUE, sivTAG, sivTAG_CLASS, sivTAGGING, sivINDEFINITE_LENGTH, sivUNUSED_BITS;
-static ID id_each;
+static ID sIMPLICIT, sEXPLICIT;
+static ID sUNIVERSAL, sAPPLICATION, sCONTEXT_SPECIFIC, sPRIVATE;
+static ID sivVALUE, sivTAG, sivTAG_CLASS, sivTAGGING, sivINFINITE_LENGTH, sivUNUSED_BITS;
+
+/*
+ * We need to implement these for backward compatibility
+ * reasons, behavior of ASN1_put_object and ASN1_object_size
+ * for infinite length values is different in OpenSSL <= 0.9.7
+ */
+#if OPENSSL_VERSION_NUMBER < 0x00908000L
+#define ossl_asn1_object_size(cons, len, tag) (cons) == 2 ? (len) + ASN1_object_size((cons), 0, (tag)) : ASN1_object_size((cons), (len), (tag))
+#define ossl_asn1_put_object(pp, cons, len, tag, xc) (cons) == 2 ? ASN1_put_object((pp), (cons), 0, (tag), (xc)) : ASN1_put_object((pp), (cons), (len), (tag), (xc))
+#else
+#define ossl_asn1_object_size(cons, len, tag) ASN1_object_size((cons), (len), (tag))
+#define ossl_asn1_put_object(pp, cons, len, tag, xc) ASN1_put_object((pp), (cons), (len), (tag), (xc))
+#endif
/*
* Ruby to ASN1 converters
@@ -188,7 +234,11 @@ obj_to_asn1bool(VALUE obj)
if (NIL_P(obj))
ossl_raise(rb_eTypeError, "Can't convert nil into Boolean");
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+ return RTEST(obj) ? 0xff : 0x100;
+#else
return RTEST(obj) ? 0xff : 0x0;
+#endif
}
static ASN1_INTEGER*
@@ -202,15 +252,13 @@ obj_to_asn1bstr(VALUE obj, long unused_bits)
{
ASN1_BIT_STRING *bstr;
- if (unused_bits < 0 || unused_bits > 7)
- ossl_raise(eASN1Error, "unused_bits for a bitstring value must be in "\
- "the range 0 to 7");
+ if(unused_bits < 0) unused_bits = 0;
StringValue(obj);
if(!(bstr = ASN1_BIT_STRING_new()))
ossl_raise(eASN1Error, NULL);
ASN1_BIT_STRING_set(bstr, (unsigned char *)RSTRING_PTR(obj), RSTRING_LENINT(obj));
bstr->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */
- bstr->flags |= ASN1_STRING_FLAG_BITS_LEFT | unused_bits;
+ bstr->flags |= ASN1_STRING_FLAG_BITS_LEFT|(unused_bits&0x07);
return bstr;
}
@@ -246,40 +294,36 @@ obj_to_asn1obj(VALUE obj)
{
ASN1_OBJECT *a1obj;
- StringValueCStr(obj);
+ StringValue(obj);
a1obj = OBJ_txt2obj(RSTRING_PTR(obj), 0);
if(!a1obj) a1obj = OBJ_txt2obj(RSTRING_PTR(obj), 1);
- if(!a1obj) ossl_raise(eASN1Error, "invalid OBJECT ID %"PRIsVALUE, obj);
+ if(!a1obj) ossl_raise(eASN1Error, "invalid OBJECT ID");
return a1obj;
}
-static ASN1_UTCTIME *
+static ASN1_UTCTIME*
obj_to_asn1utime(VALUE time)
{
time_t sec;
ASN1_UTCTIME *t;
- int off_days;
-
- ossl_time_split(time, &sec, &off_days);
- if (!(t = ASN1_UTCTIME_adj(NULL, sec, off_days, 0)))
- ossl_raise(eASN1Error, NULL);
+ sec = time_to_time_t(time);
+ if(!(t = ASN1_UTCTIME_set(NULL, sec)))
+ ossl_raise(eASN1Error, NULL);
return t;
}
-static ASN1_GENERALIZEDTIME *
+static ASN1_GENERALIZEDTIME*
obj_to_asn1gtime(VALUE time)
{
time_t sec;
ASN1_GENERALIZEDTIME *t;
- int off_days;
-
- ossl_time_split(time, &sec, &off_days);
- if (!(t = ASN1_GENERALIZEDTIME_adj(NULL, sec, off_days, 0)))
- ossl_raise(eASN1Error, NULL);
+ sec = time_to_time_t(time);
+ if(!(t =ASN1_GENERALIZEDTIME_set(NULL, sec)))
+ ossl_raise(eASN1Error, NULL);
return t;
}
@@ -304,14 +348,14 @@ obj_to_asn1derstr(VALUE obj)
static VALUE
decode_bool(unsigned char* der, long length)
{
- const unsigned char *p = der;
+ int val;
+ const unsigned char *p;
- if (length != 3)
- ossl_raise(eASN1Error, "invalid length for BOOLEAN");
- if (p[0] != 1 || p[1] != 1)
- ossl_raise(eASN1Error, "invalid BOOLEAN");
+ p = der;
+ if((val = d2i_ASN1_BOOLEAN(NULL, &p, length)) < 0)
+ ossl_raise(eASN1Error, NULL);
- return p[2] ? Qtrue : Qfalse;
+ return val ? Qtrue : Qfalse;
}
static VALUE
@@ -325,7 +369,7 @@ decode_int(unsigned char* der, long length)
p = der;
if(!(ai = d2i_ASN1_INTEGER(NULL, &p, length)))
ossl_raise(eASN1Error, NULL);
- ret = rb_protect((VALUE (*)(VALUE))asn1integer_to_num,
+ ret = rb_protect((VALUE(*)_((VALUE)))asn1integer_to_num,
(VALUE)ai, &status);
ASN1_INTEGER_free(ai);
if(status) rb_jump_tag(status);
@@ -365,7 +409,7 @@ decode_enum(unsigned char* der, long length)
p = der;
if(!(ai = d2i_ASN1_ENUMERATED(NULL, &p, length)))
ossl_raise(eASN1Error, NULL);
- ret = rb_protect((VALUE (*)(VALUE))asn1integer_to_num,
+ ret = rb_protect((VALUE(*)_((VALUE)))asn1integer_to_num,
(VALUE)ai, &status);
ASN1_ENUMERATED_free(ai);
if(status) rb_jump_tag(status);
@@ -427,7 +471,7 @@ decode_time(unsigned char* der, long length)
p = der;
if(!(time = d2i_ASN1_TIME(NULL, &p, length)))
ossl_raise(eASN1Error, NULL);
- ret = rb_protect((VALUE (*)(VALUE))asn1time_to_time,
+ ret = rb_protect((VALUE(*)_((VALUE)))asn1time_to_time,
(VALUE)time, &status);
ASN1_TIME_free(time);
if(status) rb_jump_tag(status);
@@ -498,7 +542,7 @@ ossl_asn1_get_asn1type(VALUE obj)
VALUE value, rflag;
void *ptr;
void (*free_func)();
- int tag;
+ int tag, flag;
tag = ossl_asn1_default_tag(obj);
value = ossl_asn1_get_value(obj);
@@ -514,7 +558,8 @@ ossl_asn1_get_asn1type(VALUE obj)
break;
case V_ASN1_BIT_STRING:
rflag = rb_attr_get(obj, sivUNUSED_BITS);
- ptr = obj_to_asn1bstr(value, NUM2INT(rflag));
+ flag = NIL_P(rflag) ? -1 : NUM2INT(rflag);
+ ptr = obj_to_asn1bstr(value, flag);
free_func = ASN1_BIT_STRING_free;
break;
case V_ASN1_NULL:
@@ -572,14 +617,17 @@ ossl_asn1_default_tag(VALUE obj)
VALUE tmp_class, tag;
tmp_class = CLASS_OF(obj);
- while (!NIL_P(tmp_class)) {
+ while (tmp_class) {
tag = rb_hash_lookup(class_tag_map, tmp_class);
- if (tag != Qnil)
- return NUM2INT(tag);
- tmp_class = rb_class_superclass(tmp_class);
+ if (tag != Qnil) {
+ return NUM2INT(tag);
+ }
+ tmp_class = rb_class_superclass(tmp_class);
}
+ ossl_raise(eASN1Error, "universal tag for %"PRIsVALUE" not found",
+ rb_obj_class(obj));
- return -1;
+ return -1; /* dummy */
}
static int
@@ -595,46 +643,74 @@ ossl_asn1_tag(VALUE obj)
}
static int
+ossl_asn1_is_explicit(VALUE obj)
+{
+ VALUE s;
+ int ret = -1;
+
+ s = ossl_asn1_get_tagging(obj);
+ if(NIL_P(s)) return 0;
+ else if(SYMBOL_P(s)){
+ if (SYM2ID(s) == sIMPLICIT)
+ ret = 0;
+ else if (SYM2ID(s) == sEXPLICIT)
+ ret = 1;
+ }
+ if(ret < 0){
+ ossl_raise(eASN1Error, "invalid tag default");
+ }
+
+ return ret;
+}
+
+static int
ossl_asn1_tag_class(VALUE obj)
{
VALUE s;
+ int ret = -1;
s = ossl_asn1_get_tag_class(obj);
- if (NIL_P(s) || s == sym_UNIVERSAL)
- return V_ASN1_UNIVERSAL;
- else if (s == sym_APPLICATION)
- return V_ASN1_APPLICATION;
- else if (s == sym_CONTEXT_SPECIFIC)
- return V_ASN1_CONTEXT_SPECIFIC;
- else if (s == sym_PRIVATE)
- return V_ASN1_PRIVATE;
- else
+ if(NIL_P(s)) ret = V_ASN1_UNIVERSAL;
+ else if(SYMBOL_P(s)){
+ if (SYM2ID(s) == sUNIVERSAL)
+ ret = V_ASN1_UNIVERSAL;
+ else if (SYM2ID(s) == sAPPLICATION)
+ ret = V_ASN1_APPLICATION;
+ else if (SYM2ID(s) == sCONTEXT_SPECIFIC)
+ ret = V_ASN1_CONTEXT_SPECIFIC;
+ else if (SYM2ID(s) == sPRIVATE)
+ ret = V_ASN1_PRIVATE;
+ }
+ if(ret < 0){
ossl_raise(eASN1Error, "invalid tag class");
+ }
+
+ return ret;
}
static VALUE
ossl_asn1_class2sym(int tc)
{
if((tc & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
- return sym_PRIVATE;
+ return ID2SYM(sPRIVATE);
else if((tc & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
- return sym_CONTEXT_SPECIFIC;
+ return ID2SYM(sCONTEXT_SPECIFIC);
else if((tc & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
- return sym_APPLICATION;
+ return ID2SYM(sAPPLICATION);
else
- return sym_UNIVERSAL;
+ return ID2SYM(sUNIVERSAL);
}
/*
* call-seq:
* OpenSSL::ASN1::ASN1Data.new(value, tag, tag_class) => ASN1Data
*
- * _value_: Please have a look at Constructive and Primitive to see how Ruby
+ * +value+: Please have a look at Constructive and Primitive to see how Ruby
* types are mapped to ASN.1 types and vice versa.
*
- * _tag_: An Integer indicating the tag number.
+ * +tag+: A +Number+ indicating the tag number.
*
- * _tag_class_: A Symbol indicating the tag class. Please cf. ASN1 for
+ * +tag_class+: A +Symbol+ indicating the tag class. Please cf. ASN1 for
* possible values.
*
* == Example
@@ -646,85 +722,73 @@ ossl_asn1data_initialize(VALUE self, VALUE value, VALUE tag, VALUE tag_class)
{
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
+ if((SYM2ID(tag_class) == sUNIVERSAL) && NUM2INT(tag) > 31)
+ ossl_raise(eASN1Error, "tag number for Universal too large");
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tag_class(self, tag_class);
- ossl_asn1_set_indefinite_length(self, Qfalse);
+ ossl_asn1_set_infinite_length(self, Qfalse);
return self;
}
static VALUE
-to_der_internal(VALUE self, int constructed, int indef_len, VALUE body)
+join_der_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, str))
{
- int encoding = constructed ? indef_len ? 2 : 1 : 0;
- int tag_class = ossl_asn1_tag_class(self);
- int tag_number = ossl_asn1_tag(self);
- int default_tag_number = ossl_asn1_default_tag(self);
- int body_length, total_length;
- VALUE str;
- unsigned char *p;
+ i = ossl_to_der_if_possible(i);
+ StringValue(i);
+ rb_str_append(str, i);
+ return Qnil;
+}
- body_length = RSTRING_LENINT(body);
- if (ossl_asn1_get_tagging(self) == sym_EXPLICIT) {
- int inner_length, e_encoding = indef_len ? 2 : 1;
-
- if (default_tag_number == -1)
- ossl_raise(eASN1Error, "explicit tagging of unknown tag");
-
- inner_length = ASN1_object_size(encoding, body_length, default_tag_number);
- total_length = ASN1_object_size(e_encoding, inner_length, tag_number);
- str = rb_str_new(NULL, total_length);
- p = (unsigned char *)RSTRING_PTR(str);
- /* Put explicit tag */
- ASN1_put_object(&p, e_encoding, inner_length, tag_number, tag_class);
- /* Append inner object */
- ASN1_put_object(&p, encoding, body_length, default_tag_number, V_ASN1_UNIVERSAL);
- memcpy(p, RSTRING_PTR(body), body_length);
- p += body_length;
- if (indef_len) {
- ASN1_put_eoc(&p); /* For inner object */
- ASN1_put_eoc(&p); /* For wrapper object */
- }
- }
- else {
- total_length = ASN1_object_size(encoding, body_length, tag_number);
- str = rb_str_new(NULL, total_length);
- p = (unsigned char *)RSTRING_PTR(str);
- ASN1_put_object(&p, encoding, body_length, tag_number, tag_class);
- memcpy(p, RSTRING_PTR(body), body_length);
- p += body_length;
- if (indef_len)
- ASN1_put_eoc(&p);
- }
- assert(p - (unsigned char *)RSTRING_PTR(str) == total_length);
+static VALUE
+join_der(VALUE enumerable)
+{
+ VALUE str = rb_str_new(0, 0);
+ rb_block_call(enumerable, rb_intern("each"), 0, 0, join_der_i, str);
return str;
}
-static VALUE ossl_asn1prim_to_der(VALUE);
-static VALUE ossl_asn1cons_to_der(VALUE);
/*
* call-seq:
* asn1.to_der => DER-encoded String
*
* Encodes this ASN1Data into a DER-encoded String value. The result is
- * DER-encoded except for the possibility of indefinite length forms.
- * Indefinite length forms are not allowed in strict DER, so strictly speaking
- * the result of such an encoding would be a BER-encoding.
+ * DER-encoded except for the possibility of infinite length encodings.
+ * Infinite length encodings are not allowed in strict DER, so strictly
+ * speaking the result of such an encoding would be a BER-encoding.
*/
static VALUE
ossl_asn1data_to_der(VALUE self)
{
- VALUE value = ossl_asn1_get_value(self);
+ VALUE value, der, inf_length;
+ int tag, tag_class, is_cons = 0;
+ long length;
+ unsigned char *p;
- if (rb_obj_is_kind_of(value, rb_cArray))
- return ossl_asn1cons_to_der(self);
- else {
- if (RTEST(ossl_asn1_get_indefinite_length(self)))
- ossl_raise(eASN1Error, "indefinite length form cannot be used " \
- "with primitive encoding");
- return ossl_asn1prim_to_der(self);
+ value = ossl_asn1_get_value(self);
+ if(rb_obj_is_kind_of(value, rb_cArray)){
+ is_cons = 1;
+ value = join_der(value);
}
+ StringValue(value);
+
+ tag = ossl_asn1_tag(self);
+ tag_class = ossl_asn1_tag_class(self);
+ inf_length = ossl_asn1_get_infinite_length(self);
+ if (inf_length == Qtrue) {
+ is_cons = 2;
+ }
+ if((length = ossl_asn1_object_size(is_cons, RSTRING_LENINT(value), tag)) <= 0)
+ ossl_raise(eASN1Error, NULL);
+ der = rb_str_new(0, length);
+ p = (unsigned char *)RSTRING_PTR(der);
+ ossl_asn1_put_object(&p, is_cons, RSTRING_LENINT(value), tag, tag_class);
+ memcpy(p, RSTRING_PTR(value), RSTRING_LEN(value));
+ p += RSTRING_LEN(value);
+ ossl_str_adjust(der, p);
+
+ return der;
}
static VALUE
@@ -737,7 +801,7 @@ int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag,
p = *pp;
- if(tc == sym_UNIVERSAL && tag < ossl_asn1_info_size) {
+ if(tc == sUNIVERSAL && tag < ossl_asn1_info_size) {
switch(tag){
case V_ASN1_EOC:
value = decode_eoc(p, hlen+length);
@@ -779,14 +843,13 @@ int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag,
*pp += hlen + length;
*num_read = hlen + length;
- if (tc == sym_UNIVERSAL &&
- tag < ossl_asn1_info_size && ossl_asn1_info[tag].klass) {
+ if (tc == sUNIVERSAL && tag < ossl_asn1_info_size && ossl_asn1_info[tag].klass) {
VALUE klass = *ossl_asn1_info[tag].klass;
VALUE args[4];
args[0] = value;
args[1] = INT2NUM(tag);
args[2] = Qnil;
- args[3] = tc;
+ args[3] = ID2SYM(tc);
asn1data = rb_obj_alloc(klass);
ossl_asn1_initialize(4, args, asn1data);
if(tag == V_ASN1_BIT_STRING){
@@ -795,7 +858,7 @@ int_ossl_asn1_decode0_prim(unsigned char **pp, long length, long hlen, int tag,
}
else {
asn1data = rb_obj_alloc(cASN1Data);
- ossl_asn1data_initialize(asn1data, value, INT2NUM(tag), tc);
+ ossl_asn1data_initialize(asn1data, value, INT2NUM(tag), ID2SYM(tc));
}
return asn1data;
@@ -807,48 +870,62 @@ int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length,
int tag, VALUE tc, long *num_read)
{
VALUE value, asn1data, ary;
- int indefinite;
- long available_len, off = *offset;
+ int infinite;
+ long off = *offset;
- indefinite = (j == 0x21);
+ infinite = (j == 0x21);
ary = rb_ary_new();
- available_len = indefinite ? max_len : length;
- while (available_len > 0) {
+ while (length > 0 || infinite) {
long inner_read = 0;
- value = ossl_asn1_decode0(pp, available_len, &off, depth + 1, yield, &inner_read);
+ value = ossl_asn1_decode0(pp, max_len, &off, depth + 1, yield, &inner_read);
*num_read += inner_read;
- available_len -= inner_read;
+ max_len -= inner_read;
+ rb_ary_push(ary, value);
+ if (length > 0)
+ length -= inner_read;
- if (indefinite &&
- ossl_asn1_tag(value) == V_ASN1_EOC &&
- ossl_asn1_get_tag_class(value) == sym_UNIVERSAL) {
+ if (infinite &&
+ NUM2INT(ossl_asn1_get_tag(value)) == V_ASN1_EOC &&
+ SYM2ID(ossl_asn1_get_tag_class(value)) == sUNIVERSAL) {
break;
}
- rb_ary_push(ary, value);
}
- if (tc == sym_UNIVERSAL) {
+ if (tc == sUNIVERSAL) {
VALUE args[4];
- if (tag == V_ASN1_SEQUENCE || tag == V_ASN1_SET)
- asn1data = rb_obj_alloc(*ossl_asn1_info[tag].klass);
- else
- asn1data = rb_obj_alloc(cASN1Constructive);
+ int not_sequence_or_set;
+
+ not_sequence_or_set = tag != V_ASN1_SEQUENCE && tag != V_ASN1_SET;
+
+ if (not_sequence_or_set) {
+ if (infinite) {
+ asn1data = rb_obj_alloc(cASN1Constructive);
+ }
+ else {
+ ossl_raise(eASN1Error, "invalid non-infinite tag");
+ return Qnil;
+ }
+ }
+ else {
+ VALUE klass = *ossl_asn1_info[tag].klass;
+ asn1data = rb_obj_alloc(klass);
+ }
args[0] = ary;
args[1] = INT2NUM(tag);
args[2] = Qnil;
- args[3] = tc;
+ args[3] = ID2SYM(tc);
ossl_asn1_initialize(4, args, asn1data);
}
else {
asn1data = rb_obj_alloc(cASN1Data);
- ossl_asn1data_initialize(asn1data, ary, INT2NUM(tag), tc);
+ ossl_asn1data_initialize(asn1data, ary, INT2NUM(tag), ID2SYM(tc));
}
- if (indefinite)
- ossl_asn1_set_indefinite_length(asn1data, Qtrue);
+ if (infinite)
+ ossl_asn1_set_infinite_length(asn1data, Qtrue);
else
- ossl_asn1_set_indefinite_length(asn1data, Qfalse);
+ ossl_asn1_set_infinite_length(asn1data, Qfalse);
*offset = off;
return asn1data;
@@ -872,13 +949,13 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, int depth,
if(j & 0x80) ossl_raise(eASN1Error, NULL);
if(len > length) ossl_raise(eASN1Error, "value is too short");
if((tc & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
- tag_class = sym_PRIVATE;
+ tag_class = sPRIVATE;
else if((tc & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
- tag_class = sym_CONTEXT_SPECIFIC;
+ tag_class = sCONTEXT_SPECIFIC;
else if((tc & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
- tag_class = sym_APPLICATION;
+ tag_class = sAPPLICATION;
else
- tag_class = sym_UNIVERSAL;
+ tag_class = sUNIVERSAL;
hlen = p - start;
@@ -897,12 +974,11 @@ 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 - hlen, len, &off, depth, yield, j, tag, tag_class, &inner_read);
+ asn1data = int_ossl_asn1_decode0_cons(pp, length, len, &off, depth, yield, j, tag, tag_class, &inner_read);
inner_read += hlen;
}
else {
- if ((j & 0x01) && (len == 0))
- ossl_raise(eASN1Error, "indefinite length for primitive value");
+ if ((j & 0x01) && (len == 0)) ossl_raise(eASN1Error, "Infinite length for primitive value");
asn1data = int_ossl_asn1_decode0_prim(pp, len, hlen, tag, tag_class, &inner_read);
off += hlen + len;
}
@@ -934,13 +1010,13 @@ int_ossl_decode_sanity_check(long len, long read, long offset)
*
* If a block is given, it prints out each of the elements encountered.
* Block parameters are (in that order):
- * * depth: The recursion depth, plus one with each constructed value being encountered (Integer)
- * * offset: Current byte offset (Integer)
- * * header length: Combined length in bytes of the Tag and Length headers. (Integer)
- * * length: The overall remaining length of the entire data (Integer)
+ * * depth: The recursion depth, plus one with each constructed value being encountered (Number)
+ * * offset: Current byte offset (Number)
+ * * header length: Combined length in bytes of the Tag and Length headers. (Number)
+ * * length: The overall remaining length of the entire data (Number)
* * constructed: Whether this value is constructed or not (Boolean)
* * tag_class: Current tag class (Symbol)
- * * tag: The current tag number (Integer)
+ * * tag: The current tag (Number)
*
* == Example
* der = File.binread('asn1data.der')
@@ -953,7 +1029,7 @@ static VALUE
ossl_asn1_traverse(VALUE self, VALUE obj)
{
unsigned char *p;
- VALUE tmp;
+ volatile VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
@@ -961,7 +1037,6 @@ 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;
}
@@ -970,9 +1045,9 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
* call-seq:
* OpenSSL::ASN1.decode(der) -> ASN1Data
*
- * Decodes a BER- or DER-encoded value and creates an ASN1Data instance. _der_
- * may be a String or any object that features a +.to_der+ method transforming
- * it into a BER-/DER-encoded String+
+ * Decodes a BER- or DER-encoded value and creates an ASN1Data instance. +der+
+ * may be a +String+ or any object that features a +#to_der+ method transforming
+ * it into a BER-/DER-encoded +String+.
*
* == Example
* der = File.binread('asn1data')
@@ -983,7 +1058,7 @@ ossl_asn1_decode(VALUE self, VALUE obj)
{
VALUE ret;
unsigned char *p;
- VALUE tmp;
+ volatile VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
@@ -991,7 +1066,6 @@ 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;
}
@@ -1000,9 +1074,9 @@ ossl_asn1_decode(VALUE self, VALUE obj)
* call-seq:
* OpenSSL::ASN1.decode_all(der) -> Array of ASN1Data
*
- * Similar to #decode with the difference that #decode expects one
- * distinct value represented in _der_. #decode_all on the contrary
- * decodes a sequence of sequential BER/DER values lined up in _der_
+ * Similar to +decode+ with the difference that +decode+ expects one
+ * distinct value represented in +der+. +decode_all+ on the contrary
+ * decodes a sequence of sequential BER/DER values lined up in +der+
* and returns them as an array.
*
* == Example
@@ -1015,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;
- VALUE tmp;
+ volatile VALUE tmp;
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
@@ -1030,26 +1104,25 @@ 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;
}
/*
* call-seq:
- * OpenSSL::ASN1::Primitive.new(value [, tag, tagging, tag_class ]) => Primitive
+ * OpenSSL::ASN1::Primitive.new( value [, tag, tagging, tag_class ]) => Primitive
*
- * _value_: is mandatory.
+ * +value+: is mandatory.
*
- * _tag_: optional, may be specified for tagged values. If no _tag_ is
+ * +tag+: optional, may be specified for tagged values. If no +tag+ is
* specified, the UNIVERSAL tag corresponding to the Primitive sub-class
* is used by default.
*
- * _tagging_: may be used as an encoding hint to encode a value either
+ * +tagging+: may be used as an encoding hint to encode a value either
* explicitly or implicitly, see ASN1 for possible values.
*
- * _tag_class_: if _tag_ and _tagging_ are +nil+ then this is set to
- * +:UNIVERSAL+ by default. If either _tag_ or _tagging_ are set then
+ * +tag_class+: if +tag+ and +tagging+ are +nil+ then this is set to
+ * +:UNIVERSAL+ by default. If either +tag+ or +tagging+ are set then
* +:CONTEXT_SPECIFIC+ is used as the default. For possible values please
* cf. ASN1.
*
@@ -1062,37 +1135,34 @@ static VALUE
ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE value, tag, tagging, tag_class;
- int default_tag;
rb_scan_args(argc, argv, "13", &value, &tag, &tagging, &tag_class);
- default_tag = ossl_asn1_default_tag(self);
-
- if (default_tag == -1 || argc > 1) {
+ if(argc > 1){
if(NIL_P(tag))
ossl_raise(eASN1Error, "must specify tag number");
if(!NIL_P(tagging) && !SYMBOL_P(tagging))
ossl_raise(eASN1Error, "invalid tagging method");
if(NIL_P(tag_class)) {
if (NIL_P(tagging))
- tag_class = sym_UNIVERSAL;
+ tag_class = ID2SYM(sUNIVERSAL);
else
- tag_class = sym_CONTEXT_SPECIFIC;
+ tag_class = ID2SYM(sCONTEXT_SPECIFIC);
}
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
+ if(!NIL_P(tagging) && SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
+ ossl_raise(eASN1Error, "tag number for Universal too large");
}
else{
- tag = INT2NUM(default_tag);
+ tag = INT2NUM(ossl_asn1_default_tag(self));
tagging = Qnil;
- tag_class = sym_UNIVERSAL;
+ tag_class = ID2SYM(sUNIVERSAL);
}
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tagging(self, tagging);
ossl_asn1_set_tag_class(self, tag_class);
- ossl_asn1_set_indefinite_length(self, Qfalse);
- if (default_tag == V_ASN1_BIT_STRING)
- rb_ivar_set(self, sivUNUSED_BITS, INT2FIX(0));
+ ossl_asn1_set_infinite_length(self, Qfalse);
return self;
}
@@ -1100,66 +1170,83 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_asn1eoc_initialize(VALUE self) {
VALUE tag, tagging, tag_class, value;
- tag = INT2FIX(0);
+ tag = INT2NUM(ossl_asn1_default_tag(self));
tagging = Qnil;
- tag_class = sym_UNIVERSAL;
+ tag_class = ID2SYM(sUNIVERSAL);
value = rb_str_new("", 0);
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tagging(self, tagging);
ossl_asn1_set_tag_class(self, tag_class);
- ossl_asn1_set_indefinite_length(self, Qfalse);
+ ossl_asn1_set_infinite_length(self, Qfalse);
return self;
}
-static VALUE
-ossl_asn1eoc_to_der(VALUE self)
+static int
+ossl_i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
+{
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+ if(!a) return 0;
+ if(a->type == V_ASN1_BOOLEAN)
+ return i2d_ASN1_BOOLEAN(a->value.boolean, pp);
+#endif
+ return i2d_ASN1_TYPE(a, pp);
+}
+
+static void
+ossl_ASN1_TYPE_free(ASN1_TYPE *a)
{
- return rb_str_new("\0\0", 2);
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+ if(!a) return;
+ if(a->type == V_ASN1_BOOLEAN){
+ OPENSSL_free(a);
+ return;
+ }
+#endif
+ ASN1_TYPE_free(a);
}
/*
* call-seq:
* asn1.to_der => DER-encoded String
*
- * See ASN1Data#to_der for details.
+ * See ASN1Data#to_der for details. *
*/
static VALUE
ossl_asn1prim_to_der(VALUE self)
{
ASN1_TYPE *asn1;
- long alllen, bodylen;
- unsigned char *p0, *p1;
- int j, tag, tc, state;
+ int tn, tc, explicit;
+ long len, reallen;
+ unsigned char *buf, *p;
VALUE str;
- if (ossl_asn1_default_tag(self) == -1) {
- str = ossl_asn1_get_value(self);
- return to_der_internal(self, 0, 0, StringValue(str));
- }
-
+ tn = NUM2INT(ossl_asn1_get_tag(self));
+ tc = ossl_asn1_tag_class(self);
+ explicit = ossl_asn1_is_explicit(self);
asn1 = ossl_asn1_get_asn1type(self);
- alllen = i2d_ASN1_TYPE(asn1, NULL);
- if (alllen < 0) {
- ASN1_TYPE_free(asn1);
- ossl_raise(eASN1Error, "i2d_ASN1_TYPE");
+
+ len = ossl_asn1_object_size(1, ossl_i2d_ASN1_TYPE(asn1, NULL), tn);
+ if(!(buf = OPENSSL_malloc(len))){
+ ossl_ASN1_TYPE_free(asn1);
+ ossl_raise(eASN1Error, "cannot alloc buffer");
}
- str = ossl_str_new(NULL, alllen, &state);
- if (state) {
- ASN1_TYPE_free(asn1);
- rb_jump_tag(state);
+ p = buf;
+ if (tc == V_ASN1_UNIVERSAL) {
+ ossl_i2d_ASN1_TYPE(asn1, &p);
+ } else if (explicit) {
+ ossl_asn1_put_object(&p, 1, ossl_i2d_ASN1_TYPE(asn1, NULL), tn, tc);
+ ossl_i2d_ASN1_TYPE(asn1, &p);
+ } else {
+ ossl_i2d_ASN1_TYPE(asn1, &p);
+ *buf = tc | tn | (*buf & V_ASN1_CONSTRUCTED);
}
- p0 = p1 = (unsigned char *)RSTRING_PTR(str);
- i2d_ASN1_TYPE(asn1, &p0);
- ASN1_TYPE_free(asn1);
- assert(p0 - p1 == alllen);
-
- /* Strip header since to_der_internal() wants only the payload */
- j = ASN1_get_object((const unsigned char **)&p1, &bodylen, &tag, &tc, alllen);
- if (j & 0x80)
- ossl_raise(eASN1Error, "ASN1_get_object"); /* should not happen */
+ ossl_ASN1_TYPE_free(asn1);
+ reallen = p - buf;
+ assert(reallen <= len);
+ str = ossl_buf2str((char *)buf, rb_long2int(reallen)); /* buf will be free in ossl_buf2str */
- return to_der_internal(self, 0, 0, rb_str_drop_bytes(str, alllen - bodylen));
+ return str;
}
/*
@@ -1171,41 +1258,92 @@ ossl_asn1prim_to_der(VALUE self)
static VALUE
ossl_asn1cons_to_der(VALUE self)
{
- VALUE ary, str;
- long i;
- int indef_len;
-
- indef_len = RTEST(ossl_asn1_get_indefinite_length(self));
- ary = rb_convert_type(ossl_asn1_get_value(self), T_ARRAY, "Array", "to_a");
- str = rb_str_new(NULL, 0);
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE item = RARRAY_AREF(ary, i);
-
- if (indef_len && rb_obj_is_kind_of(item, cASN1EndOfContent)) {
- if (i != RARRAY_LEN(ary) - 1)
- ossl_raise(eASN1Error, "illegal EOC octets in value");
-
- /*
- * EOC is not really part of the content, but we required to add one
- * at the end in the past.
- */
- break;
+ int tag, tn, tc, explicit, constructed = 1;
+ int found_prim = 0, seq_len;
+ long length;
+ unsigned char *p;
+ VALUE value, str, inf_length;
+
+ tn = NUM2INT(ossl_asn1_get_tag(self));
+ tc = ossl_asn1_tag_class(self);
+ inf_length = ossl_asn1_get_infinite_length(self);
+ if (inf_length == Qtrue) {
+ VALUE ary, example;
+ constructed = 2;
+ if (CLASS_OF(self) == cASN1Sequence ||
+ CLASS_OF(self) == cASN1Set) {
+ tag = ossl_asn1_default_tag(self);
+ }
+ else { /* must be a constructive encoding of a primitive value */
+ ary = ossl_asn1_get_value(self);
+ if (!rb_obj_is_kind_of(ary, rb_cArray))
+ ossl_raise(eASN1Error, "Constructive value must be an Array");
+ /* Recursively descend until a primitive value is found.
+ The overall value of the entire constructed encoding
+ is of the type of the first primitive encoding to be
+ found. */
+ while (!found_prim){
+ example = rb_ary_entry(ary, 0);
+ if (rb_obj_is_kind_of(example, cASN1Primitive)){
+ found_prim = 1;
+ }
+ else {
+ /* example is another ASN1Constructive */
+ if (!rb_obj_is_kind_of(example, cASN1Constructive)){
+ ossl_raise(eASN1Error, "invalid constructed encoding");
+ return Qnil; /* dummy */
+ }
+ ary = ossl_asn1_get_value(example);
+ }
+ }
+ tag = ossl_asn1_default_tag(example);
}
+ }
+ else {
+ if (CLASS_OF(self) == cASN1Constructive)
+ ossl_raise(eASN1Error, "Constructive shall only be used with infinite length");
+ tag = ossl_asn1_default_tag(self);
+ }
+ explicit = ossl_asn1_is_explicit(self);
+ value = join_der(ossl_asn1_get_value(self));
+
+ seq_len = ossl_asn1_object_size(constructed, RSTRING_LENINT(value), tag);
+ length = ossl_asn1_object_size(constructed, seq_len, tn);
+ str = rb_str_new(0, length);
+ p = (unsigned char *)RSTRING_PTR(str);
+ if(tc == V_ASN1_UNIVERSAL)
+ ossl_asn1_put_object(&p, constructed, RSTRING_LENINT(value), tn, tc);
+ else{
+ if(explicit){
+ ossl_asn1_put_object(&p, constructed, seq_len, tn, tc);
+ ossl_asn1_put_object(&p, constructed, RSTRING_LENINT(value), tag, V_ASN1_UNIVERSAL);
+ }
+ else{
+ ossl_asn1_put_object(&p, constructed, RSTRING_LENINT(value), tn, tc);
+ }
+ }
+ memcpy(p, RSTRING_PTR(value), RSTRING_LEN(value));
+ p += RSTRING_LEN(value);
- item = ossl_to_der_if_possible(item);
- StringValue(item);
- rb_str_append(str, item);
+ /* In this case we need an additional EOC (one for the explicit part and
+ * one for the Constructive itself. The EOC for the Constructive is
+ * supplied by the user, but that for the "explicit wrapper" must be
+ * added here.
+ */
+ if (explicit && inf_length == Qtrue) {
+ ASN1_put_eoc(&p);
}
+ ossl_str_adjust(str, p);
- return to_der_internal(self, 1, indef_len, str);
+ return str;
}
/*
* call-seq:
* asn1_ary.each { |asn1| block } => asn1_ary
*
- * Calls the given block once for each element in self, passing that element
- * as parameter _asn1_. If no block is given, an enumerator is returned
+ * Calls <i>block</i> once for each element in +self+, passing that element
+ * as parameter +asn1+. If no block is given, an enumerator is returned
* instead.
*
* == Example
@@ -1216,28 +1354,27 @@ ossl_asn1cons_to_der(VALUE self)
static VALUE
ossl_asn1cons_each(VALUE self)
{
- rb_block_call(ossl_asn1_get_value(self), id_each, 0, 0, 0, 0);
-
+ rb_ary_each(ossl_asn1_get_value(self));
return self;
}
/*
* call-seq:
- * OpenSSL::ASN1::ObjectId.register(object_id, short_name, long_name)
+ * 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
+ * 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 OpenSSL::ASN1::ASN1Error if it fails.
+ * Returns +true+ if successful. Raises an ASN1Error otherwise.
*
*/
static VALUE
ossl_asn1obj_s_register(VALUE self, VALUE oid, VALUE sn, VALUE ln)
{
- StringValueCStr(oid);
- StringValueCStr(sn);
- StringValueCStr(ln);
+ StringValue(oid);
+ StringValue(sn);
+ StringValue(ln);
if(!OBJ_create(RSTRING_PTR(oid), RSTRING_PTR(sn), RSTRING_PTR(ln)))
ossl_raise(eASN1Error, NULL);
@@ -1245,12 +1382,13 @@ ossl_asn1obj_s_register(VALUE self, VALUE oid, VALUE sn, VALUE ln)
return Qtrue;
}
-/*
- * call-seq:
- * oid.sn -> string
- * oid.short_name -> string
+/* 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
*/
static VALUE
ossl_asn1obj_get_sn(VALUE self)
@@ -1259,18 +1397,19 @@ ossl_asn1obj_get_sn(VALUE self)
int nid;
val = ossl_asn1_get_value(self);
- if ((nid = OBJ_txt2nid(StringValueCStr(val))) != NID_undef)
+ if ((nid = OBJ_txt2nid(StringValuePtr(val))) != NID_undef)
ret = rb_str_new2(OBJ_nid2sn(nid));
return ret;
}
-/*
- * call-seq:
- * oid.ln -> string
- * oid.long_name -> string
+/* Document-method: OpenSSL::ASN1::ObjectId#ln
+ *
+ * The long name of the ObjectId, as defined in +openssl/objects.h+.
+ */
+/* Document-method: OpenSSL::ASN1::ObjectId.long_name
*
- * The long name of the ObjectId, as defined in <openssl/objects.h>.
+ * #long_name is an alias to #ln
*/
static VALUE
ossl_asn1obj_get_ln(VALUE self)
@@ -1279,54 +1418,29 @@ ossl_asn1obj_get_ln(VALUE self)
int nid;
val = ossl_asn1_get_value(self);
- if ((nid = OBJ_txt2nid(StringValueCStr(val))) != NID_undef)
+ if ((nid = OBJ_txt2nid(StringValuePtr(val))) != NID_undef)
ret = rb_str_new2(OBJ_nid2ln(nid));
return ret;
}
-static VALUE
-asn1obj_get_oid_i(VALUE vobj)
-{
- ASN1_OBJECT *a1obj = (void *)vobj;
- VALUE str;
- int len;
-
- str = rb_usascii_str_new(NULL, 127);
- len = OBJ_obj2txt(RSTRING_PTR(str), RSTRING_LENINT(str), a1obj, 1);
- if (len <= 0 || len == INT_MAX)
- ossl_raise(eASN1Error, "OBJ_obj2txt");
- if (len > RSTRING_LEN(str)) {
- /* +1 is for the \0 terminator added by OBJ_obj2txt() */
- rb_str_resize(str, len + 1);
- len = OBJ_obj2txt(RSTRING_PTR(str), len + 1, a1obj, 1);
- if (len <= 0)
- ossl_raise(eASN1Error, "OBJ_obj2txt");
- }
- rb_str_set_len(str, len);
- return str;
-}
-
-/*
- * call-seq:
- * oid.oid -> string
+/* Document-method: OpenSSL::ASN1::ObjectId#oid
*
- * Returns a String representing the Object Identifier in the dot notation,
- * e.g. "1.2.3.4.5"
+ * The object identifier as a String.
*/
static VALUE
ossl_asn1obj_get_oid(VALUE self)
{
- VALUE str;
+ VALUE val;
ASN1_OBJECT *a1obj;
- int state;
+ char buf[128];
- a1obj = obj_to_asn1obj(ossl_asn1_get_value(self));
- str = rb_protect(asn1obj_get_oid_i, (VALUE)a1obj, &state);
+ val = ossl_asn1_get_value(self);
+ a1obj = obj_to_asn1obj(val);
+ OBJ_obj2txt(buf, sizeof(buf), a1obj, 1);
ASN1_OBJECT_free(a1obj);
- if (state)
- rb_jump_tag(state);
- return str;
+
+ return rb_str_new2(buf);
}
#define OSSL_ASN1_IMPL_FACTORY_METHOD(klass) \
@@ -1358,29 +1472,27 @@ OSSL_ASN1_IMPL_FACTORY_METHOD(Set)
OSSL_ASN1_IMPL_FACTORY_METHOD(EndOfContent)
void
-Init_ossl_asn1(void)
+Init_ossl_asn1()
{
-#undef rb_intern
VALUE ary;
int i;
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
- sym_UNIVERSAL = ID2SYM(rb_intern_const("UNIVERSAL"));
- sym_CONTEXT_SPECIFIC = ID2SYM(rb_intern_const("CONTEXT_SPECIFIC"));
- sym_APPLICATION = ID2SYM(rb_intern_const("APPLICATION"));
- sym_PRIVATE = ID2SYM(rb_intern_const("PRIVATE"));
- sym_EXPLICIT = ID2SYM(rb_intern_const("EXPLICIT"));
- sym_IMPLICIT = ID2SYM(rb_intern_const("IMPLICIT"));
+ sUNIVERSAL = rb_intern("UNIVERSAL");
+ sCONTEXT_SPECIFIC = rb_intern("CONTEXT_SPECIFIC");
+ sAPPLICATION = rb_intern("APPLICATION");
+ sPRIVATE = rb_intern("PRIVATE");
+ sEXPLICIT = rb_intern("EXPLICIT");
+ sIMPLICIT = rb_intern("IMPLICIT");
sivVALUE = rb_intern("@value");
sivTAG = rb_intern("@tag");
sivTAGGING = rb_intern("@tagging");
sivTAG_CLASS = rb_intern("@tag_class");
- sivINDEFINITE_LENGTH = rb_intern("@indefinite_length");
+ sivINFINITE_LENGTH = rb_intern("@infinite_length");
sivUNUSED_BITS = rb_intern("@unused_bits");
/*
@@ -1406,21 +1518,24 @@ Init_ossl_asn1(void)
* == ASN.1 class hierarchy
*
* The base class representing ASN.1 structures is ASN1Data. ASN1Data offers
- * attributes to read and set the _tag_, the _tag_class_ and finally the
- * _value_ of a particular ASN.1 item. Upon parsing, any tagged values
+ * attributes to read and set the +tag+, the +tag_class+ and finally the
+ * +value+ of a particular ASN.1 item. Upon parsing, any tagged values
* (implicit or explicit) will be represented by ASN1Data instances because
* their "real type" can only be determined using out-of-band information
* from the ASN.1 type declaration. Since this information is normally
* known when encoding a type, all sub-classes of ASN1Data offer an
- * additional attribute _tagging_ that allows to encode a value implicitly
+ * additional attribute +tagging+ that allows to encode a value implicitly
* (+:IMPLICIT+) or explicitly (+:EXPLICIT+).
*
* === Constructive
*
* Constructive is, as its name implies, the base class for all
* constructed encodings, i.e. those that consist of several values,
- * opposed to "primitive" encodings with just one single value. The value of
- * an Constructive is always an Array.
+ * opposed to "primitive" encodings with just one single value.
+ * Primitive values that are encoded with "infinite length" are typically
+ * constructed (their values come in multiple chunks) and are therefore
+ * represented by instances of Constructive. The value of an Constructive
+ * is always an Array.
*
* ==== ASN1::Set and ASN1::Sequence
*
@@ -1437,18 +1552,18 @@ Init_ossl_asn1(void)
* Please cf. Primitive documentation for details on sub-classes and
* their respective mappings of ASN.1 data types to Ruby objects.
*
- * == Possible values for _tagging_
+ * == Possible values for +tagging+
*
* When constructing an ASN1Data object the ASN.1 type definition may
* require certain elements to be either implicitly or explicitly tagged.
- * This can be achieved by setting the _tagging_ attribute manually for
+ * This can be achieved by setting the +tagging+ attribute manually for
* sub-classes of ASN1Data. Use the symbol +:IMPLICIT+ for implicit
* tagging and +:EXPLICIT+ if the element requires explicit tagging.
*
- * == Possible values for _tag_class_
+ * == Possible values for +tag_class+
*
* It is possible to create arbitrary ASN1Data objects that also support
- * a PRIVATE or APPLICATION tag class. Possible values for the _tag_class_
+ * a PRIVATE or APPLICATION tag class. Possible values for the +tag_class+
* attribute are:
* * +:UNIVERSAL+ (the default for untagged values)
* * +:CONTEXT_SPECIFIC+ (the default for tagged values)
@@ -1550,9 +1665,9 @@ Init_ossl_asn1(void)
*
* An implicitly 1-tagged INTEGER value will be parsed as an
* ASN1Data with
- * * _tag_ equal to 1
- * * _tag_class_ equal to +:CONTEXT_SPECIFIC+
- * * _value_ equal to a String that carries the raw encoding
+ * * +tag+ equal to 1
+ * * +tag_class+ equal to +:CONTEXT_SPECIFIC+
+ * * +value+ equal to a +String+ that carries the raw encoding
* of the INTEGER.
* This implies that a subsequent decoding step is required to
* completely decode implicitly tagged values.
@@ -1561,9 +1676,9 @@ Init_ossl_asn1(void)
*
* An explicitly 1-tagged INTEGER value will be parsed as an
* ASN1Data with
- * * _tag_ equal to 1
- * * _tag_class_ equal to +:CONTEXT_SPECIFIC+
- * * _value_ equal to an Array with one single element, an
+ * * +tag+ equal to 1
+ * * +tag_class+ equal to +:CONTEXT_SPECIFIC+
+ * * +value+ equal to an +Array+ with one single element, an
* instance of OpenSSL::ASN1::Integer, i.e. the inner element
* is the non-tagged primitive value, and the tagging is represented
* in the outer ASN1Data
@@ -1574,13 +1689,13 @@ Init_ossl_asn1(void)
* der = seq.to_der
* asn1 = OpenSSL::ASN1.decode(der)
* # pp asn1 => #<OpenSSL::ASN1::Sequence:0x87326e0
- * # @indefinite_length=false,
+ * # @infinite_length=false,
* # @tag=16,
* # @tag_class=:UNIVERSAL,
* # @tagging=nil,
* # @value=
* # [#<OpenSSL::ASN1::ASN1Data:0x87326f4
- * # @indefinite_length=false,
+ * # @infinite_length=false,
* # @tag=0,
* # @tag_class=:CONTEXT_SPECIFIC,
* # @value="\x01">]>
@@ -1597,18 +1712,18 @@ Init_ossl_asn1(void)
* der = seq.to_der
* asn1 = OpenSSL::ASN1.decode(der)
* # pp asn1 => #<OpenSSL::ASN1::Sequence:0x87326e0
- * # @indefinite_length=false,
+ * # @infinite_length=false,
* # @tag=16,
* # @tag_class=:UNIVERSAL,
* # @tagging=nil,
* # @value=
* # [#<OpenSSL::ASN1::ASN1Data:0x87326f4
- * # @indefinite_length=false,
+ * # @infinite_length=false,
* # @tag=0,
* # @tag_class=:CONTEXT_SPECIFIC,
* # @value=
* # [#<OpenSSL::ASN1::Integer:0x85bf308
- * # @indefinite_length=false,
+ * # @infinite_length=false,
* # @tag=2,
* # @tag_class=:UNIVERSAL
* # @tagging=nil,
@@ -1624,92 +1739,90 @@ Init_ossl_asn1(void)
*/
rb_attr(cASN1Data, rb_intern("value"), 1, 1, 0);
/*
- * An Integer representing the tag number of this ASN1Data. Never +nil+.
+ * A +Number+ representing the tag number of this ASN1Data. Never +nil+.
*/
rb_attr(cASN1Data, rb_intern("tag"), 1, 1, 0);
/*
- * A Symbol representing the tag class of this ASN1Data. Never +nil+.
+ * A +Symbol+ representing the tag class of this ASN1Data. Never +nil+.
* See ASN1Data for possible values.
*/
rb_attr(cASN1Data, rb_intern("tag_class"), 1, 1, 0);
/*
- * Never +nil+. A boolean value indicating whether the encoding uses
- * indefinite length (in the case of parsing) or whether an indefinite
- * length form shall be used (in the encoding case).
- * In DER, every value uses definite length form. But in scenarios where
- * large amounts of data need to be transferred it might be desirable to
- * have some kind of streaming support available.
+ * Never +nil+. A +Boolean+ indicating whether the encoding was infinite
+ * length (in the case of parsing) or whether an infinite length encoding
+ * shall be used (in the encoding case).
+ * In DER, every value has a finite length associated with it. But in
+ * scenarios where large amounts of data need to be transferred it
+ * might be desirable to have some kind of streaming support available.
* For example, huge OCTET STRINGs are preferably sent in smaller-sized
* chunks, each at a time.
* This is possible in BER by setting the length bytes of an encoding
* to zero and by this indicating that the following value will be
- * sent in chunks. Indefinite length encodings are always constructed.
+ * sent in chunks. Infinite length encodings are always constructed.
* The end of such a stream of chunks is indicated by sending a EOC
- * (End of Content) tag. SETs and SEQUENCEs may use an indefinite length
+ * (End of Content) tag. SETs and SEQUENCEs may use an infinite length
* encoding, but also primitive types such as e.g. OCTET STRINGS or
* BIT STRINGS may leverage this functionality (cf. ITU-T X.690).
*/
- rb_attr(cASN1Data, rb_intern("indefinite_length"), 1, 1, 0);
- rb_define_alias(cASN1Data, "infinite_length", "indefinite_length");
- rb_define_alias(cASN1Data, "infinite_length=", "indefinite_length=");
+ rb_attr(cASN1Data, rb_intern("infinite_length"), 1, 1, 0);
rb_define_method(cASN1Data, "initialize", ossl_asn1data_initialize, 3);
rb_define_method(cASN1Data, "to_der", ossl_asn1data_to_der, 0);
/* Document-class: OpenSSL::ASN1::Primitive
*
* The parent class for all primitive encodings. Attributes are the same as
- * for ASN1Data, with the addition of _tagging_.
- * Primitive values can never be encoded with indefinite length form, thus
- * it is not possible to set the _indefinite_length_ attribute for Primitive
- * and its sub-classes.
+ * for ASN1Data, with the addition of +tagging+.
+ * Primitive values can never be infinite length encodings, thus it is not
+ * possible to set the +infinite_length+ attribute for Primitive and its
+ * sub-classes.
*
* == Primitive sub-classes and their mapping to Ruby classes
- * * OpenSSL::ASN1::EndOfContent <=> _value_ is always +nil+
- * * OpenSSL::ASN1::Boolean <=> _value_ is +true+ or +false+
- * * OpenSSL::ASN1::Integer <=> _value_ is an OpenSSL::BN
- * * OpenSSL::ASN1::BitString <=> _value_ is a String
- * * OpenSSL::ASN1::OctetString <=> _value_ is a String
- * * OpenSSL::ASN1::Null <=> _value_ is always +nil+
- * * OpenSSL::ASN1::Object <=> _value_ is a String
- * * OpenSSL::ASN1::Enumerated <=> _value_ is an OpenSSL::BN
- * * OpenSSL::ASN1::UTF8String <=> _value_ is a String
- * * OpenSSL::ASN1::NumericString <=> _value_ is a String
- * * OpenSSL::ASN1::PrintableString <=> _value_ is a String
- * * OpenSSL::ASN1::T61String <=> _value_ is a String
- * * OpenSSL::ASN1::VideotexString <=> _value_ is a String
- * * OpenSSL::ASN1::IA5String <=> _value_ is a String
- * * OpenSSL::ASN1::UTCTime <=> _value_ is a Time
- * * OpenSSL::ASN1::GeneralizedTime <=> _value_ is a Time
- * * OpenSSL::ASN1::GraphicString <=> _value_ is a String
- * * OpenSSL::ASN1::ISO64String <=> _value_ is a String
- * * OpenSSL::ASN1::GeneralString <=> _value_ is a String
- * * OpenSSL::ASN1::UniversalString <=> _value_ is a String
- * * OpenSSL::ASN1::BMPString <=> _value_ is a String
+ * * OpenSSL::ASN1::EndOfContent <=> +value+ is always +nil+
+ * * OpenSSL::ASN1::Boolean <=> +value+ is a +Boolean+
+ * * OpenSSL::ASN1::Integer <=> +value+ is a +Number+
+ * * OpenSSL::ASN1::BitString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::OctetString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::Null <=> +value+ is always +nil+
+ * * OpenSSL::ASN1::Object <=> +value+ is a +String+
+ * * OpenSSL::ASN1::Enumerated <=> +value+ is a +Number+
+ * * OpenSSL::ASN1::UTF8String <=> +value+ is a +String+
+ * * OpenSSL::ASN1::NumericString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::PrintableString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::T61String <=> +value+ is a +String+
+ * * OpenSSL::ASN1::VideotexString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::IA5String <=> +value+ is a +String+
+ * * OpenSSL::ASN1::UTCTime <=> +value+ is a +Time+
+ * * OpenSSL::ASN1::GeneralizedTime <=> +value+ is a +Time+
+ * * OpenSSL::ASN1::GraphicString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::ISO64String <=> +value+ is a +String+
+ * * OpenSSL::ASN1::GeneralString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::UniversalString <=> +value+ is a +String+
+ * * OpenSSL::ASN1::BMPString <=> +value+ is a +String+
*
* == OpenSSL::ASN1::BitString
*
* === Additional attributes
- * _unused_bits_: if the underlying BIT STRING's
- * length is a multiple of 8 then _unused_bits_ is 0. Otherwise
- * _unused_bits_ indicates the number of bits that are to be ignored in
- * the final octet of the BitString's _value_.
+ * +unused_bits+: if the underlying BIT STRING's
+ * length is a multiple of 8 then +unused_bits+ is 0. Otherwise
+ * +unused_bits+ indicates the number of bits that are to be ignored in
+ * the final octet of the +BitString+'s +value+.
*
* == 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
+ * 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.
*
* === Additional attributes
- * * _sn_: the short name as defined in <openssl/objects.h>.
- * * _ln_: the long name as defined in <openssl/objects.h>.
- * * _oid_: the object identifier as a String, e.g. "1.2.3.4.5"
- * * _short_name_: alias for _sn_.
- * * _long_name_: alias for _ln_.
+ * * +sn+: the short name as defined in <openssl/objects.h>.
+ * * +ln+: the long name as defined in <openssl/objects.h>.
+ * * +oid+: the object identifier as a +String+, e.g. "1.2.3.4.5"
+ * * +short_name+: alias for +sn+.
+ * * +long_name+: alias for +ln+.
*
* == Examples
* With the Exception of OpenSSL::ASN1::EndOfContent, each Primitive class
- * constructor takes at least one parameter, the _value_.
+ * constructor takes at least one parameter, the +value+.
*
* === Creating EndOfContent
* eoc = OpenSSL::ASN1::EndOfContent.new
@@ -1723,20 +1836,19 @@ Init_ossl_asn1(void)
/*
* May be used as a hint for encoding a value either implicitly or
* explicitly by setting it either to +:IMPLICIT+ or to +:EXPLICIT+.
- * _tagging_ is not set when a ASN.1 structure is parsed using
+ * +tagging+ is not set when a ASN.1 structure is parsed using
* OpenSSL::ASN1.decode.
*/
rb_attr(cASN1Primitive, rb_intern("tagging"), 1, 1, Qtrue);
- rb_undef_method(cASN1Primitive, "indefinite_length=");
rb_undef_method(cASN1Primitive, "infinite_length=");
rb_define_method(cASN1Primitive, "initialize", ossl_asn1_initialize, -1);
rb_define_method(cASN1Primitive, "to_der", ossl_asn1prim_to_der, 0);
/* Document-class: OpenSSL::ASN1::Constructive
*
- * The parent class for all constructed encodings. The _value_ attribute
- * of a Constructive is always an Array. Attributes are the same as
- * for ASN1Data, with the addition of _tagging_.
+ * The parent class for all constructed encodings. The +value+ attribute
+ * of a Constructive is always an +Array+. Attributes are the same as
+ * for ASN1Data, with the addition of +tagging+.
*
* == SET and SEQUENCE
*
@@ -1758,13 +1870,48 @@ Init_ossl_asn1(void)
* int = OpenSSL::ASN1::Integer.new(1)
* str = OpenSSL::ASN1::PrintableString.new('abc')
* set = OpenSSL::ASN1::Set.new( [ int, str ] )
+ *
+ * == Infinite length primitive values
+ *
+ * The only case where Constructive is used directly is for infinite
+ * length encodings of primitive values. These encodings are always
+ * constructed, with the contents of the +value+ +Array+ being either
+ * UNIVERSAL non-infinite length partial encodings of the actual value
+ * or again constructive encodings with infinite length (i.e. infinite
+ * length primitive encodings may be constructed recursively with another
+ * infinite length value within an already infinite length value). Each
+ * partial encoding must be of the same UNIVERSAL type as the overall
+ * encoding. The value of the overall encoding consists of the
+ * concatenation of each partial encoding taken in sequence. The +value+
+ * array of the outer infinite length value must end with a
+ * OpenSSL::ASN1::EndOfContent instance.
+ *
+ * Please note that it is not possible to encode Constructive without
+ * the +infinite_length+ attribute being set to +true+, use
+ * OpenSSL::ASN1::Sequence or OpenSSL::ASN1::Set in these cases instead.
+ *
+ * === Example - Infinite length OCTET STRING
+ * partial1 = OpenSSL::ASN1::OctetString.new("\x01")
+ * partial2 = OpenSSL::ASN1::OctetString.new("\x02")
+ * inf_octets = OpenSSL::ASN1::Constructive.new( [ partial1,
+ * partial2,
+ * OpenSSL::ASN1::EndOfContent.new ],
+ * OpenSSL::ASN1::OCTET_STRING,
+ * nil,
+ * :UNIVERSAL )
+ * # The real value of inf_octets is "\x01\x02", i.e. the concatenation
+ * # of partial1 and partial2
+ * inf_octets.infinite_length = true
+ * der = inf_octets.to_der
+ * asn1 = OpenSSL::ASN1.decode(der)
+ * puts asn1.infinite_length # => true
*/
cASN1Constructive = rb_define_class_under(mASN1,"Constructive", cASN1Data);
rb_include_module(cASN1Constructive, rb_mEnumerable);
/*
* May be used as a hint for encoding a value either implicitly or
* explicitly by setting it either to +:IMPLICIT+ or to +:EXPLICIT+.
- * _tagging_ is not set when a ASN.1 structure is parsed using
+ * +tagging+ is not set when a ASN.1 structure is parsed using
* OpenSSL::ASN1.decode.
*/
rb_attr(cASN1Constructive, rb_intern("tagging"), 1, 1, Qtrue);
@@ -1821,7 +1968,6 @@ do{\
rb_attr(cASN1BitString, rb_intern("unused_bits"), 1, 1, 0);
rb_define_method(cASN1EndOfContent, "initialize", ossl_asn1eoc_initialize, 0);
- rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0);
class_tag_map = rb_hash_new();
rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC));
@@ -1848,6 +1994,4 @@ do{\
rb_hash_aset(class_tag_map, cASN1UniversalString, INT2NUM(V_ASN1_UNIVERSALSTRING));
rb_hash_aset(class_tag_map, cASN1BMPString, INT2NUM(V_ASN1_BMPSTRING));
rb_global_variable(&class_tag_map);
-
- id_each = rb_intern_const("each");
}
diff --git a/ext/openssl/ossl_asn1.h b/ext/openssl/ossl_asn1.h
index 939a96ce74..718f43f068 100644
--- a/ext/openssl/ossl_asn1.h
+++ b/ext/openssl/ossl_asn1.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_ASN1_H_)
@@ -13,22 +14,18 @@
/*
* ASN1_DATE conversions
*/
-VALUE asn1time_to_time(const ASN1_TIME *);
-/* Splits VALUE to seconds and offset days. VALUE is typically a Time or an
- * Integer. This is used when updating ASN1_*TIME with ASN1_TIME_adj() or
- * X509_time_adj_ex(). We can't use ASN1_TIME_set() and X509_time_adj() because
- * they have the Year 2038 issue on sizeof(time_t) == 4 environment */
-void ossl_time_split(VALUE, time_t *, int *);
+VALUE asn1time_to_time(ASN1_TIME *);
+time_t time_to_time_t(VALUE);
/*
* ASN1_STRING conversions
*/
-VALUE asn1str_to_str(const ASN1_STRING *);
+VALUE asn1str_to_str(ASN1_STRING *);
/*
* ASN1_INTEGER conversions
*/
-VALUE asn1integer_to_num(const ASN1_INTEGER *);
+VALUE asn1integer_to_num(ASN1_INTEGER *);
ASN1_INTEGER *num_to_asn1integer(VALUE, ASN1_INTEGER *);
/*
diff --git a/ext/openssl/ossl_bio.c b/ext/openssl/ossl_bio.c
index 42833d901a..e150de0ad9 100644
--- a/ext/openssl/ossl_bio.c
+++ b/ext/openssl/ossl_bio.c
@@ -1,42 +1,87 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
BIO *
-ossl_obj2bio(volatile VALUE *pobj)
+ossl_obj2bio(VALUE obj)
{
- VALUE obj = *pobj;
BIO *bio;
- if (RB_TYPE_P(obj, T_FILE))
- obj = rb_funcallv(obj, rb_intern("read"), 0, NULL);
- StringValue(obj);
- bio = BIO_new_mem_buf(RSTRING_PTR(obj), RSTRING_LENINT(obj));
- if (!bio)
- ossl_raise(eOSSLError, "BIO_new_mem_buf");
- *pobj = obj;
+ if (RB_TYPE_P(obj, T_FILE)) {
+ rb_io_t *fptr;
+ FILE *fp;
+ int fd;
+
+ GetOpenFile(obj, fptr);
+ rb_io_check_readable(fptr);
+ if ((fd = rb_cloexec_dup(FPTR_TO_FD(fptr))) < 0){
+ rb_sys_fail(0);
+ }
+ rb_update_max_fd(fd);
+ if (!(fp = fdopen(fd, "r"))){
+ close(fd);
+ rb_sys_fail(0);
+ }
+ if (!(bio = BIO_new_fp(fp, BIO_CLOSE))){
+ fclose(fp);
+ ossl_raise(eOSSLError, NULL);
+ }
+ }
+ else {
+ StringValue(obj);
+ bio = BIO_new_mem_buf(RSTRING_PTR(obj), RSTRING_LENINT(obj));
+ if (!bio) ossl_raise(eOSSLError, NULL);
+ }
+
return bio;
}
+BIO *
+ossl_protect_obj2bio(VALUE obj, int *status)
+{
+ BIO *ret = NULL;
+ ret = (BIO*)rb_protect((VALUE(*)_((VALUE)))ossl_obj2bio, obj, status);
+ return ret;
+}
+
VALUE
-ossl_membio2str(BIO *bio)
+ossl_membio2str0(BIO *bio)
{
VALUE ret;
- int state;
BUF_MEM *buf;
BIO_get_mem_ptr(bio, &buf);
- ret = ossl_str_new(buf->data, buf->length, &state);
+ ret = rb_str_new(buf->data, buf->length);
+
+ return ret;
+}
+
+VALUE
+ossl_protect_membio2str(BIO *bio, int *status)
+{
+ return rb_protect((VALUE(*)_((VALUE)))ossl_membio2str0, (VALUE)bio, status);
+}
+
+VALUE
+ossl_membio2str(BIO *bio)
+{
+ VALUE ret;
+ int status = 0;
+
+ ret = ossl_protect_membio2str(bio, &status);
BIO_free(bio);
- if (state)
- rb_jump_tag(state);
+ if(status) rb_jump_tag(status);
return ret;
}
diff --git a/ext/openssl/ossl_bio.h b/ext/openssl/ossl_bio.h
index da68c5e5a2..2d8f675c5b 100644
--- a/ext/openssl/ossl_bio.h
+++ b/ext/openssl/ossl_bio.h
@@ -1,16 +1,21 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_BIO_H_)
#define _OSSL_BIO_H_
-BIO *ossl_obj2bio(volatile VALUE *);
+BIO *ossl_obj2bio(VALUE);
+BIO *ossl_protect_obj2bio(VALUE,int*);
+VALUE ossl_membio2str0(BIO*);
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 4666ce6c2f..bdaf077b5f 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -1,54 +1,39 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Technorama team <oss-ruby@technorama.net>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
/* modified by Michal Rokos <m.rokos@sh.cvut.cz> */
#include "ossl.h"
-#define NewBN(klass) \
- TypedData_Wrap_Struct((klass), &ossl_bn_type, 0)
-#define SetBN(obj, bn) do { \
+#define WrapBN(klass, obj, bn) do { \
if (!(bn)) { \
ossl_raise(rb_eRuntimeError, "BN wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (bn); \
+ (obj) = Data_Wrap_Struct((klass), 0, BN_clear_free, (bn)); \
} while (0)
#define GetBN(obj, bn) do { \
- TypedData_Get_Struct((obj), BIGNUM, &ossl_bn_type, (bn)); \
+ Data_Get_Struct((obj), BIGNUM, (bn)); \
if (!(bn)) { \
ossl_raise(rb_eRuntimeError, "BN wasn't initialized!"); \
} \
} while (0)
-static void
-ossl_bn_free(void *ptr)
-{
- BN_clear_free(ptr);
-}
-
-static const rb_data_type_t ossl_bn_type = {
- "OpenSSL/BN",
- {
- 0, ossl_bn_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
+#define SafeGetBN(obj, bn) do { \
+ OSSL_Check_Kind((obj), cBN); \
+ GetBN((obj), (bn)); \
+} while (0)
/*
* Classes
*/
VALUE cBN;
-
-/* Document-class: OpenSSL::BNError
- *
- * Generic Error for all of OpenSSL::BN (big num)
- */
VALUE eBNError;
/*
@@ -60,90 +45,36 @@ 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);
}
- SetBN(obj, newbn);
+ WrapBN(cBN, obj, newbn);
return obj;
}
-static BIGNUM *
-integer_to_bnptr(VALUE obj, BIGNUM *orig)
-{
- BIGNUM *bn;
-
- if (FIXNUM_P(obj)) {
- long i;
- unsigned char bin[sizeof(long)];
- long n = FIX2LONG(obj);
- unsigned long un = labs(n);
-
- for (i = sizeof(long) - 1; 0 <= i; i--) {
- bin[i] = un & 0xff;
- un >>= 8;
- }
-
- bn = BN_bin2bn(bin, sizeof(bin), orig);
- if (!bn)
- ossl_raise(eBNError, "BN_bin2bn");
- if (n < 0)
- BN_set_negative(bn, 1);
- }
- else { /* assuming Bignum */
- size_t len = rb_absint_size(obj, NULL);
- unsigned char *bin;
- VALUE buf;
- 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(obj, bin, len, 1, 0, INTEGER_PACK_BIG_ENDIAN);
-
- bn = BN_bin2bn(bin, (int)len, orig);
- ALLOCV_END(buf);
- if (!bn)
- ossl_raise(eBNError, "BN_bin2bn");
- if (sign < 0)
- BN_set_negative(bn, 1);
- }
-
- return bn;
-}
-
-static VALUE
-try_convert_to_bn(VALUE obj)
-{
- BIGNUM *bn;
- VALUE newobj = Qnil;
-
- if (rb_obj_is_kind_of(obj, cBN))
- return obj;
- if (RB_INTEGER_TYPE_P(obj)) {
- newobj = NewBN(cBN); /* Handle potential mem leaks */
- bn = integer_to_bnptr(obj, NULL);
- SetBN(newobj, bn);
- }
-
- return newobj;
-}
-
BIGNUM *
-ossl_bn_value_ptr(volatile VALUE *ptr)
+GetBNPtr(VALUE obj)
{
- VALUE tmp;
- BIGNUM *bn;
+ BIGNUM *bn = NULL;
- tmp = try_convert_to_bn(*ptr);
- if (NIL_P(tmp))
+ if (RTEST(rb_obj_is_kind_of(obj, cBN))) {
+ GetBN(obj, bn);
+ } else switch (TYPE(obj)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ obj = rb_String(obj);
+ if (!BN_dec2bn(&bn, StringValuePtr(obj))) {
+ ossl_raise(eBNError, NULL);
+ }
+ WrapBN(cBN, obj, bn); /* Handle potencial mem leaks */
+ break;
+ case T_NIL:
+ break;
+ default:
ossl_raise(rb_eTypeError, "Cannot convert into OpenSSL::BN");
- GetBN(tmp, bn);
- *ptr = tmp;
-
+ }
return bn;
}
@@ -161,25 +92,23 @@ static VALUE
ossl_bn_alloc(VALUE klass)
{
BIGNUM *bn;
- VALUE obj = NewBN(klass);
+ VALUE obj;
if (!(bn = BN_new())) {
ossl_raise(eBNError, NULL);
}
- SetBN(obj, bn);
+ WrapBN(klass, obj, bn);
return obj;
}
/*
* call-seq:
- * 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.
+ * BN.new => aBN
+ * BN.new(bn) => aBN
+ * BN.new(integer) => aBN
+ * BN.new(string) => aBN
+ * BN.new(string, 0 | 2 | 10 | 16) => aBN
*/
static VALUE
ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
@@ -192,13 +121,45 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
base = NUM2INT(bs);
}
- if (RB_INTEGER_TYPE_P(str)) {
- GetBN(self, bn);
- integer_to_bnptr(str, bn);
+ if (RB_TYPE_P(str, T_FIXNUM)) {
+ long i;
+ unsigned char bin[sizeof(long)];
+ long n = FIX2LONG(str);
+ unsigned long un = labs(n);
+ for (i = sizeof(long) - 1; 0 <= i; i--) {
+ bin[i] = un&0xff;
+ un >>= 8;
+ }
+
+ GetBN(self, bn);
+ if (!BN_bin2bn(bin, sizeof(bin), bn)) {
+ ossl_raise(eBNError, NULL);
+ }
+ if (n < 0) BN_set_negative(bn, 1);
return self;
}
+ else if (RB_TYPE_P(str, T_BIGNUM)) {
+ size_t len = rb_absint_size(str, NULL);
+ unsigned char *bin;
+ VALUE buf;
+ 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)len, bn)) {
+ ALLOCV_END(buf);
+ ossl_raise(eBNError, NULL);
+ }
+ ALLOCV_END(buf);
+ if (sign < 0) BN_set_negative(bn, 1);
+ return self;
+ }
if (RTEST(rb_obj_is_kind_of(str, cBN))) {
BIGNUM *other;
@@ -210,25 +171,26 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+ StringValue(str);
GetBN(self, bn);
switch (base) {
case 0:
- if (!BN_mpi2bn((unsigned char *)StringValuePtr(str), RSTRING_LENINT(str), bn)) {
+ if (!BN_mpi2bn((unsigned char *)RSTRING_PTR(str), RSTRING_LENINT(str), bn)) {
ossl_raise(eBNError, NULL);
}
break;
case 2:
- if (!BN_bin2bn((unsigned char *)StringValuePtr(str), RSTRING_LENINT(str), bn)) {
+ if (!BN_bin2bn((unsigned char *)RSTRING_PTR(str), RSTRING_LENINT(str), bn)) {
ossl_raise(eBNError, NULL);
}
break;
case 10:
- if (!BN_dec2bn(&bn, StringValueCStr(str))) {
+ if (!BN_dec2bn(&bn, RSTRING_PTR(str))) {
ossl_raise(eBNError, NULL);
}
break;
case 16:
- if (!BN_hex2bn(&bn, StringValueCStr(str))) {
+ if (!BN_hex2bn(&bn, RSTRING_PTR(str))) {
ossl_raise(eBNError, NULL);
}
break;
@@ -244,12 +206,12 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
* bn.to_s(base) => string
*
* === Parameters
- * * _base_ - Integer
- * Valid values:
- * * 0 - MPI
- * * 2 - binary
- * * 10 - the default
- * * 16 - hex
+ * * +base+ - integer
+ * * * Valid values:
+ * * * * 0 - MPI
+ * * * * 2 - binary
+ * * * * 10 - the default
+ * * * * 16 - hex
*/
static VALUE
ossl_bn_to_s(int argc, VALUE *argv, VALUE self)
@@ -339,6 +301,11 @@ ossl_bn_coerce(VALUE self, VALUE other)
}
#define BIGNUM_BOOL1(func) \
+ /* \
+ * call-seq: \
+ * bn.##func -> true | false \
+ * \
+ */ \
static VALUE \
ossl_bn_##func(VALUE self) \
{ \
@@ -349,51 +316,22 @@ ossl_bn_coerce(VALUE self, VALUE other)
} \
return Qfalse; \
}
-
-/*
- * Document-method: OpenSSL::BN#zero?
- * call-seq:
- * bn.zero? => true | false
- */
BIGNUM_BOOL1(is_zero)
-
-/*
- * Document-method: OpenSSL::BN#one?
- * call-seq:
- * bn.one? => true | false
- */
BIGNUM_BOOL1(is_one)
-
-/*
- * Document-method: OpenSSL::BN#odd?
- * call-seq:
- * bn.odd? => true | false
- */
BIGNUM_BOOL1(is_odd)
-/*
- * call-seq:
- * bn.negative? => true | false
- */
-static VALUE
-ossl_bn_is_negative(VALUE self)
-{
- BIGNUM *bn;
-
- GetBN(self, bn);
- if (BN_is_zero(bn))
- return Qfalse;
- return BN_is_negative(bn) ? Qtrue : Qfalse;
-}
-
#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(rb_obj_class(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -401,25 +339,23 @@ ossl_bn_is_negative(VALUE self)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-
-/*
- * Document-method: OpenSSL::BN#sqr
- * call-seq:
- * 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(rb_obj_class(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -427,32 +363,24 @@ BIGNUM_1c(sqr)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-
-/*
- * Document-method: OpenSSL::BN#+
- * call-seq:
- * bn + bn2 => aBN
- */
BIGNUM_2(add)
-
-/*
- * Document-method: OpenSSL::BN#-
- * call-seq:
- * 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(rb_obj_class(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -460,69 +388,28 @@ BIGNUM_2(sub)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-
-/*
- * Document-method: OpenSSL::BN#*
- * call-seq:
- * bn * bn2 => aBN
- */
BIGNUM_2c(mul)
-
-/*
- * Document-method: OpenSSL::BN#%
- * call-seq:
- * bn % bn2 => aBN
- */
BIGNUM_2c(mod)
-
-/*
- * Document-method: OpenSSL::BN#**
- * call-seq:
- * bn ** bn2 => aBN
- */
BIGNUM_2c(exp)
-
-/*
- * Document-method: OpenSSL::BN#gcd
- * call-seq:
- * bn.gcd(bn2) => aBN
- */
BIGNUM_2c(gcd)
-
-/*
- * Document-method: OpenSSL::BN#mod_sqr
- * call-seq:
- * bn.mod_sqr(bn2) => aBN
- */
BIGNUM_2c(mod_sqr)
-
-/*
- * Document-method: OpenSSL::BN#mod_inverse
- * call-seq:
- * bn.mod_inverse(bn2) => aBN
- */
BIGNUM_2c(mod_inverse)
/*
* call-seq:
* bn1 / bn2 => [result, remainder]
- *
- * Division of OpenSSL::BN instances
*/
static VALUE
ossl_bn_div(VALUE self, VALUE other)
{
BIGNUM *bn1, *bn2 = GetBNPtr(other), *r1, *r2;
- VALUE klass, obj1, obj2;
+ VALUE obj1, obj2;
GetBN(self, bn1);
- klass = rb_obj_class(self);
- obj1 = NewBN(klass);
- obj2 = NewBN(klass);
if (!(r1 = BN_new())) {
ossl_raise(eBNError, NULL);
}
@@ -535,13 +422,18 @@ ossl_bn_div(VALUE self, VALUE other)
BN_free(r2);
ossl_raise(eBNError, NULL);
}
- SetBN(obj1, r1);
- SetBN(obj2, r2);
+ WrapBN(CLASS_OF(self), obj1, r1);
+ WrapBN(CLASS_OF(self), 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) \
{ \
@@ -549,7 +441,6 @@ ossl_bn_div(VALUE self, VALUE other)
BIGNUM *bn3 = GetBNPtr(other2), *result; \
VALUE obj; \
GetBN(self, bn1); \
- obj = NewBN(rb_obj_class(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -557,39 +448,20 @@ ossl_bn_div(VALUE self, VALUE other)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
-
-/*
- * Document-method: OpenSSL::BN#mod_add
- * call-seq:
- * bn.mod_add(bn1, bn2) -> aBN
- */
BIGNUM_3c(mod_add)
-
-/*
- * Document-method: OpenSSL::BN#mod_sub
- * call-seq:
- * bn.mod_sub(bn1, bn2) -> aBN
- */
BIGNUM_3c(mod_sub)
-
-/*
- * Document-method: OpenSSL::BN#mod_mul
- * call-seq:
- * bn.mod_mul(bn1, bn2) -> aBN
- */
BIGNUM_3c(mod_mul)
-
-/*
- * Document-method: OpenSSL::BN#mod_exp
- * call-seq:
- * 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) \
{ \
@@ -600,33 +472,13 @@ BIGNUM_3c(mod_exp)
} \
return self; \
}
-
-/*
- * Document-method: OpenSSL::BN#set_bit!
- * call-seq:
- * bn.set_bit!(bit) -> self
- */
BIGNUM_BIT(set_bit)
-
-/*
- * Document-method: OpenSSL::BN#clear_bit!
- * call-seq:
- * bn.clear_bit!(bit) -> self
- */
BIGNUM_BIT(clear_bit)
-
-/*
- * Document-method: OpenSSL::BN#mask_bit!
- * call-seq:
- * bn.mask_bit!(bit) -> self
- */
BIGNUM_BIT(mask_bits)
/*
* call-seq:
- * bn.bit_set?(bit) => true | false
- *
- * Tests bit _bit_ in _bn_ and returns +true+ if set, +false+ if not set.
+ * bn.bit_set?(bit) => true | false
*/
static VALUE
ossl_bn_is_bit_set(VALUE self, VALUE bit)
@@ -643,6 +495,11 @@ 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) \
{ \
@@ -651,7 +508,6 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
VALUE obj; \
b = NUM2INT(bits); \
GetBN(self, bn); \
- obj = NewBN(rb_obj_class(self)); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -659,25 +515,18 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(CLASS_OF(self), 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) \
{ \
@@ -689,22 +538,15 @@ BIGNUM_SHIFT(rshift)
ossl_raise(eBNError, NULL); \
return self; \
}
-
-/*
- * Document-method: OpenSSL::BN#lshift!
- * call-seq:
- * bn.lshift!(bits) -> self
- */
BIGNUM_SELF_SHIFT(lshift)
-
-/*
- * Document-method: OpenSSL::BN#rshift!
- * call-seq:
- * 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) \
{ \
@@ -720,7 +562,6 @@ BIGNUM_SELF_SHIFT(rshift)
top = NUM2INT(fill); \
} \
b = NUM2INT(bits); \
- obj = NewBN(klass); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -728,28 +569,23 @@ BIGNUM_SELF_SHIFT(rshift)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(klass, 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 = NewBN(klass); \
+ VALUE obj; \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -757,39 +593,21 @@ BIGNUM_RAND(pseudo_rand)
BN_free(result); \
ossl_raise(eBNError, NULL); \
} \
- SetBN(obj, result); \
+ WrapBN(klass, obj, result); \
return obj; \
}
-
-/*
- * Document-method: OpenSSL::BN.rand_range
- * call-seq:
- * BN.rand_range(range) -> aBN
- *
- */
BIGNUM_RAND_RANGE(rand)
-
-/*
- * Document-method: OpenSSL::BN.pseudo_rand_range
- * call-seq:
- * BN.pseudo_rand_range(range) -> aBN
- *
- */
BIGNUM_RAND_RANGE(pseudo_rand)
/*
* call-seq:
* BN.generate_prime(bits, [, safe [, add [, rem]]]) => bn
*
- * Generates a random prime number of bit length _bits_. If _safe_ is set to
- * +true+, generates a safe prime. If _add_ is specified, generates a prime that
- * fulfills condition <tt>p % add = rem</tt>.
- *
* === Parameters
- * * _bits_ - integer
- * * _safe_ - boolean
- * * _add_ - BN
- * * _rem_ - BN
+ * * +bits+ - integer
+ * * +safe+ - boolean
+ * * +add+ - BN
+ * * +rem+ - BN
*/
static VALUE
ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
@@ -809,40 +627,32 @@ 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);
}
- if (!BN_generate_prime_ex(result, num, safe, add, rem, NULL)) {
+ if (!BN_generate_prime(result, num, safe, add, rem, NULL, NULL)) {
BN_free(result);
ossl_raise(eBNError, NULL);
}
- SetBN(obj, result);
+ WrapBN(klass, obj, result);
return obj;
}
#define BIGNUM_NUM(func) \
+ /* \
+ * call-seq: \
+ * bn.##func -> integer \
+ * \
+ */ \
static VALUE \
ossl_bn_##func(VALUE self) \
{ \
BIGNUM *bn; \
GetBN(self, bn); \
- return INT2NUM(BN_##func(bn)); \
+ return INT2FIX(BN_##func(bn)); \
}
-
-/*
- * Document-method: OpenSSL::BN#num_bytes
- * call-seq:
- * bn.num_bytes => integer
- */
BIGNUM_NUM(num_bytes)
-
-/*
- * Document-method: OpenSSL::BN#num_bits
- * call-seq:
- * bn.num_bits => integer
- */
BIGNUM_NUM(num_bits)
static VALUE
@@ -863,151 +673,38 @@ ossl_bn_copy(VALUE self, VALUE other)
return self;
}
-/*
- * call-seq:
- * +bn -> aBN
- */
-static VALUE
-ossl_bn_uplus(VALUE self)
-{
- return self;
-}
-
-/*
- * call-seq:
- * -bn -> aBN
- */
-static VALUE
-ossl_bn_uminus(VALUE self)
-{
- VALUE obj;
- BIGNUM *bn1, *bn2;
-
- GetBN(self, bn1);
- obj = NewBN(cBN);
- bn2 = BN_dup(bn1);
- if (!bn2)
- ossl_raise(eBNError, "BN_dup");
- SetBN(obj, bn2);
- BN_set_negative(bn2, !BN_is_negative(bn2));
-
- return obj;
-}
-
#define BIGNUM_CMP(func) \
+ /* \
+ * call-seq: \
+ * bn.##func(bn2) -> integer \
+ * \
+ */ \
static VALUE \
ossl_bn_##func(VALUE self, VALUE other) \
{ \
BIGNUM *bn1, *bn2 = GetBNPtr(other); \
GetBN(self, bn1); \
- return INT2NUM(BN_##func(bn1, bn2)); \
+ return INT2FIX(BN_##func(bn1, bn2)); \
}
-
-/*
- * Document-method: OpenSSL::BN#cmp
- * call-seq:
- * bn.cmp(bn2) => integer
- */
-/*
- * Document-method: OpenSSL::BN#<=>
- * call-seq:
- * bn <=> bn2 => integer
- */
BIGNUM_CMP(cmp)
-
-/*
- * Document-method: OpenSSL::BN#ucmp
- * call-seq:
- * 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_eq(VALUE self, VALUE other)
+ossl_bn_eql(VALUE self, VALUE other)
{
- BIGNUM *bn1, *bn2;
-
- GetBN(self, bn1);
- other = try_convert_to_bn(other);
- if (NIL_P(other))
- return Qfalse;
- GetBN(other, bn2);
-
- if (!BN_cmp(bn1, bn2)) {
+ if (ossl_bn_cmp(self, other) == INT2FIX(0)) {
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>bn</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 tmp, hash;
- unsigned char *buf;
- int len;
-
- GetBN(self, bn);
- len = BN_num_bytes(bn);
- buf = ALLOCV(tmp, len);
- if (BN_bn2bin(bn, buf) != len) {
- ALLOCV_END(tmp);
- ossl_raise(eBNError, "BN_bn2bin");
- }
-
- hash = ST2FIX(rb_memhash(buf, len));
- ALLOCV_END(tmp);
-
- return hash;
-}
-
-/*
* call-seq:
* bn.prime? => true | false
* bn.prime?(checks) => true | false
*
- * Performs a Miller-Rabin probabilistic primality test with _checks_
- * iterations. If _checks_ is not specified, a number of iterations is used
- * that yields a false positive rate of at most 2^-80 for random input.
- *
* === Parameters
- * * _checks_ - integer
+ * * +checks+ - integer
*/
static VALUE
ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
@@ -1020,7 +717,7 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
checks = NUM2INT(vchecks);
}
GetBN(self, bn);
- switch (BN_is_prime_ex(bn, checks, ossl_bn_ctx, NULL)) {
+ switch (BN_is_prime(bn, checks, NULL, ossl_bn_ctx, NULL)) {
case 1:
return Qtrue;
case 0:
@@ -1038,12 +735,9 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
* bn.prime_fasttest?(checks) => true | false
* bn.prime_fasttest?(checks, trial_div) => true | false
*
- * Performs a Miller-Rabin primality test. This is same as #prime? except this
- * first attempts trial divisions with some small primes.
- *
* === Parameters
- * * _checks_ - integer
- * * _trial_div_ - boolean
+ * * +checks+ - integer
+ * * +trial_div+ - boolean
*/
static VALUE
ossl_bn_is_prime_fasttest(int argc, VALUE *argv, VALUE self)
@@ -1062,7 +756,7 @@ ossl_bn_is_prime_fasttest(int argc, VALUE *argv, VALUE self)
if (vtrivdiv == Qfalse) {
do_trial_division = 0;
}
- switch (BN_is_prime_fasttest_ex(bn, checks, ossl_bn_ctx, do_trial_division, NULL)) {
+ switch (BN_is_prime_fasttest(bn, checks, NULL, ossl_bn_ctx, NULL, do_trial_division)) {
case 1:
return Qtrue;
case 0:
@@ -1079,11 +773,10 @@ 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(void)
+Init_ossl_bn()
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
if (!(ossl_bn_ctx = BN_CTX_new())) {
@@ -1097,7 +790,7 @@ Init_ossl_bn(void)
rb_define_alloc_func(cBN, ossl_bn_alloc);
rb_define_method(cBN, "initialize", ossl_bn_initialize, -1);
- rb_define_method(cBN, "initialize_copy", ossl_bn_copy, 1);
+ rb_define_copy_func(cBN, ossl_bn_copy);
rb_define_method(cBN, "copy", ossl_bn_copy, 1);
/* swap (=coerce?) */
@@ -1106,9 +799,6 @@ Init_ossl_bn(void)
rb_define_method(cBN, "num_bits", ossl_bn_num_bits, 0);
/* num_bits_word */
- rb_define_method(cBN, "+@", ossl_bn_uplus, 0);
- rb_define_method(cBN, "-@", ossl_bn_uminus, 0);
-
rb_define_method(cBN, "+", ossl_bn_add, 1);
rb_define_method(cBN, "-", ossl_bn_sub, 1);
rb_define_method(cBN, "*", ossl_bn_mul, 1);
@@ -1135,14 +825,12 @@ Init_ossl_bn(void)
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_method(cBN, "hash", ossl_bn_hash, 0);
- rb_define_method(cBN, "==", ossl_bn_eq, 1);
- rb_define_alias(cBN, "===", "==");
+ rb_define_alias(cBN, "==", "eql?");
+ rb_define_alias(cBN, "===", "eql?");
rb_define_method(cBN, "zero?", ossl_bn_is_zero, 0);
rb_define_method(cBN, "one?", ossl_bn_is_one, 0);
/* is_word */
rb_define_method(cBN, "odd?", ossl_bn_is_odd, 0);
- rb_define_method(cBN, "negative?", ossl_bn_is_negative, 0);
/* zero
* one
@@ -1157,7 +845,6 @@ Init_ossl_bn(void)
rb_define_singleton_method(cBN, "generate_prime", ossl_bn_s_generate_prime, -1);
rb_define_method(cBN, "prime?", ossl_bn_is_prime, -1);
- rb_define_method(cBN, "prime_fasttest?", ossl_bn_is_prime_fasttest, -1);
rb_define_method(cBN, "set_bit!", ossl_bn_set_bit, 1);
rb_define_method(cBN, "clear_bit!", ossl_bn_clear_bit, 1);
@@ -1199,4 +886,11 @@ Init_ossl_bn(void)
/* RECiProcal
* MONTgomery */
+
+ /*
+ * TODO:
+ * Where to belong these?
+ */
+ 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 a19ba19487..d6c396227b 100644
--- a/ext/openssl/ossl_bn.h
+++ b/ext/openssl/ossl_bn.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_BN_H_)
@@ -15,11 +16,10 @@ extern VALUE eBNError;
extern BN_CTX *ossl_bn_ctx;
-#define GetBNPtr(obj) ossl_bn_value_ptr(&(obj))
-
VALUE ossl_bn_new(const BIGNUM *);
-BIGNUM *ossl_bn_value_ptr(volatile VALUE *);
+BIGNUM *GetBNPtr(VALUE);
void Init_ossl_bn(void);
#endif /* _OSS_BN_H_ */
+
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 0840c84a71..1cd185e69c 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -1,74 +1,54 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewCipher(klass) \
- TypedData_Wrap_Struct((klass), &ossl_cipher_type, 0)
-#define AllocCipher(obj, ctx) do { \
- (ctx) = EVP_CIPHER_CTX_new(); \
- if (!(ctx)) \
- ossl_raise(rb_eRuntimeError, NULL); \
- RTYPEDDATA_DATA(obj) = (ctx); \
-} while (0)
+#define WrapCipher(obj, klass, ctx) \
+ (obj) = Data_Wrap_Struct((klass), 0, ossl_cipher_free, (ctx))
+#define MakeCipher(obj, klass, ctx) \
+ (obj) = Data_Make_Struct((klass), EVP_CIPHER_CTX, 0, ossl_cipher_free, (ctx))
+#define AllocCipher(obj, ctx) \
+ memset(DATA_PTR(obj) = (ctx) = ALLOC(EVP_CIPHER_CTX), 0, sizeof(EVP_CIPHER_CTX))
#define GetCipherInit(obj, ctx) do { \
- TypedData_Get_Struct((obj), EVP_CIPHER_CTX, &ossl_cipher_type, (ctx)); \
+ Data_Get_Struct((obj), EVP_CIPHER_CTX, (ctx)); \
} while (0)
#define GetCipher(obj, ctx) do { \
GetCipherInit((obj), (ctx)); \
if (!(ctx)) { \
- ossl_raise(rb_eRuntimeError, "Cipher not initialized!"); \
+ ossl_raise(rb_eRuntimeError, "Cipher not inititalized!"); \
} \
} while (0)
+#define SafeGetCipher(obj, ctx) do { \
+ OSSL_Check_Kind((obj), cCipher); \
+ GetCipher((obj), (ctx)); \
+} while (0)
/*
* Classes
*/
VALUE cCipher;
VALUE eCipherError;
-static ID id_auth_tag_len, id_key_set;
static VALUE ossl_cipher_alloc(VALUE klass);
-static void ossl_cipher_free(void *ptr);
-
-static const rb_data_type_t ossl_cipher_type = {
- "OpenSSL/Cipher",
- {
- 0, ossl_cipher_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
/*
* PUBLIC
*/
const EVP_CIPHER *
-ossl_evp_get_cipherbyname(VALUE obj)
+GetCipherPtr(VALUE obj)
{
- if (rb_obj_is_kind_of(obj, cCipher)) {
- EVP_CIPHER_CTX *ctx;
-
- GetCipher(obj, ctx);
-
- return EVP_CIPHER_CTX_cipher(ctx);
- }
- else {
- const EVP_CIPHER *cipher;
+ EVP_CIPHER_CTX *ctx;
- StringValueCStr(obj);
- cipher = EVP_get_cipherbyname(RSTRING_PTR(obj));
- if (!cipher)
- ossl_raise(rb_eArgError,
- "unsupported cipher algorithm: %"PRIsVALUE, obj);
+ SafeGetCipher(obj, ctx);
- return cipher;
- }
+ return EVP_CIPHER_CTX_cipher(ctx);
}
VALUE
@@ -79,6 +59,7 @@ ossl_cipher_new(const EVP_CIPHER *cipher)
ret = ossl_cipher_alloc(cCipher);
AllocCipher(ret, ctx);
+ EVP_CIPHER_CTX_init(ctx);
if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, -1) != 1)
ossl_raise(eCipherError, NULL);
@@ -89,22 +70,29 @@ ossl_cipher_new(const EVP_CIPHER *cipher)
* PRIVATE
*/
static void
-ossl_cipher_free(void *ptr)
+ossl_cipher_free(EVP_CIPHER_CTX *ctx)
{
- EVP_CIPHER_CTX_free(ptr);
+ if (ctx) {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ ruby_xfree(ctx);
+ }
}
static VALUE
ossl_cipher_alloc(VALUE klass)
{
- return NewCipher(klass);
+ VALUE obj;
+
+ WrapCipher(obj, klass, 0);
+
+ return obj;
}
/*
* call-seq:
* Cipher.new(string) -> cipher
*
- * The string must be a valid cipher name like "AES-128-CBC" or "3DES".
+ * The string must contain a valid cipher name like "AES-128-CBC" or "3DES".
*
* A list of cipher names is available by calling OpenSSL::Cipher.ciphers.
*/
@@ -114,17 +102,26 @@ 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 = StringValueCStr(str);
+ name = StringValuePtr(str);
GetCipherInit(self, ctx);
if (ctx) {
- ossl_raise(rb_eRuntimeError, "Cipher already initialized!");
+ ossl_raise(rb_eRuntimeError, "Cipher already inititalized!");
}
AllocCipher(self, ctx);
+ EVP_CIPHER_CTX_init(ctx);
if (!(cipher = EVP_get_cipherbyname(name))) {
- ossl_raise(rb_eRuntimeError, "unsupported cipher algorithm (%"PRIsVALUE")", str);
+ ossl_raise(rb_eRuntimeError, "unsupported cipher algorithm (%s)", name);
}
- if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, -1) != 1)
+ /*
+ * 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)
ossl_raise(eCipherError, NULL);
return self;
@@ -142,20 +139,23 @@ ossl_cipher_copy(VALUE self, VALUE other)
if (!ctx1) {
AllocCipher(self, ctx1);
}
- GetCipher(other, ctx2);
+ SafeGetCipher(other, ctx2);
if (EVP_CIPHER_CTX_copy(ctx1, ctx2) != 1)
ossl_raise(eCipherError, NULL);
return self;
}
+#ifdef HAVE_OBJ_NAME_DO_ALL_SORTED
static void*
add_cipher_name_to_ary(const OBJ_NAME *name, VALUE ary)
{
rb_ary_push(ary, rb_str_new2(name->name));
return NULL;
}
+#endif
+#ifdef HAVE_OBJ_NAME_DO_ALL_SORTED
/*
* call-seq:
* OpenSSL::Cipher.ciphers -> array[string...]
@@ -174,6 +174,9 @@ ossl_s_ciphers(VALUE self)
return ary;
}
+#else
+#define ossl_s_ciphers rb_f_notimplement
+#endif
/*
* call-seq:
@@ -237,9 +240,6 @@ 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;
}
@@ -251,7 +251,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
*
* Make sure to call Cipher#encrypt or Cipher#decrypt before using any of the
* following methods:
- * * [#key=, #iv=, #random_key, #random_iv, #pkcs5_keyivgen]
+ * * [key=, iv=, random_key, random_iv, pkcs5_keyivgen]
*
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 1).
*/
@@ -269,7 +269,7 @@ ossl_cipher_encrypt(int argc, VALUE *argv, VALUE self)
*
* Make sure to call Cipher#encrypt or Cipher#decrypt before using any of the
* following methods:
- * * [#key=, #iv=, #random_key, #random_iv, #pkcs5_keyivgen]
+ * * [key=, iv=, random_key, random_iv, pkcs5_keyivgen]
*
* Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 0).
*/
@@ -281,20 +281,20 @@ ossl_cipher_decrypt(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * cipher.pkcs5_keyivgen(pass, salt = nil, iterations = 2048, digest = "MD5") -> nil
+ * cipher.pkcs5_keyivgen(pass [, salt [, iterations [, digest]]] ) -> nil
*
* Generates and sets the key/IV based on a password.
*
- * *WARNING*: This method is only PKCS5 v1.5 compliant when using RC2, RC4-40,
+ * WARNING: This method is only PKCS5 v1.5 compliant when using RC2, RC4-40,
* or DES with MD5 or SHA1. Using anything else (like AES) will generate the
* key/iv using an OpenSSL specific method. This method is deprecated and
* should no longer be used. Use a PKCS5 v2 key generation method from
* OpenSSL::PKCS5 instead.
*
* === Parameters
- * * _salt_ must be an 8 byte string if provided.
- * * _iterations_ is an integer with a default of 2048.
- * * _digest_ is a Digest object that defaults to 'MD5'
+ * +salt+ must be an 8 byte string if provided.
+ * +iterations+ is a integer with a default of 2048.
+ * +digest+ is a Digest object that defaults to 'MD5'
*
* A minimum of 1000 iterations is recommended.
*
@@ -317,9 +317,7 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
salt = (unsigned char *)RSTRING_PTR(vsalt);
}
iter = NIL_P(viter) ? 2048 : NUM2INT(viter);
- if (iter <= 0)
- rb_raise(rb_eArgError, "iterations must be a positive integer");
- digest = NIL_P(vdigest) ? EVP_md5() : ossl_evp_get_digestbyname(vdigest);
+ digest = NIL_P(vdigest) ? EVP_md5() : GetDigestPtr(vdigest);
GetCipher(self, ctx);
EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), digest, salt,
(unsigned char *)RSTRING_PTR(vpass), RSTRING_LENINT(vpass), iter, key, iv);
@@ -328,71 +326,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;
- int limit = INT_MAX / 2 + 1;
- long out_len = 0;
-
- do {
- int in_part_len = in_len > limit ? limit : (int)in_len;
-
- 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 -= limit) > 0);
-
- if (out_len_ptr)
- *out_len_ptr = out_len;
-
- return 1;
-}
-
/*
* call-seq:
* cipher.update(data [, buffer]) -> string or buffer
*
* Encrypts data in a streaming fashion. Hand consecutive blocks of data
- * to the #update method in order to encrypt it. Returns the encrypted
+ * to the +update+ method in order to encrypt it. Returns the encrypted
* data chunk. When done, the output of Cipher#final should be additionally
* added to the result.
*
- * If _buffer_ is given, the encryption/decryption result will be written to
- * it. _buffer_ will be resized automatically.
+ * === Parameters
+ * +data+ is a nonempty string.
+ * +buffer+ is an optional string to store the result.
*/
static VALUE
ossl_cipher_update(int argc, VALUE *argv, VALUE self)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
- long in_len, out_len;
+ int 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_LEN(data)) == 0)
+ if ((in_len = RSTRING_LENINT(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);
@@ -401,7 +366,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
rb_str_resize(str, out_len);
}
- if (!ossl_cipher_update_long(ctx, (unsigned char *)RSTRING_PTR(str), &out_len, in, in_len))
+ if (!EVP_CipherUpdate(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);
@@ -416,7 +381,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
* Returns the remaining data held in the cipher object. Further calls to
* Cipher#update or Cipher#final will return garbage. This call should always
* be made as the last call of an encryption or decryption operation, after
- * having fed the entire plaintext or ciphertext to the Cipher instance.
+ * after having fed the entire plaintext or ciphertext to the Cipher instance.
*
* If an authenticated cipher was used, a CipherError is raised if the tag
* could not be authenticated successfully. Only call this method after
@@ -472,19 +437,15 @@ static VALUE
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
- int key_len;
StringValue(key);
GetCipher(self, ctx);
- key_len = EVP_CIPHER_CTX_key_length(ctx);
- if (RSTRING_LEN(key) != key_len)
- ossl_raise(rb_eArgError, "key must be %d bytes", key_len);
+ if (RSTRING_LEN(key) < EVP_CIPHER_CTX_key_length(ctx))
+ ossl_raise(eCipherError, "key length too short");
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);
+ ossl_raise(eCipherError, NULL);
return key;
}
@@ -500,22 +461,20 @@ ossl_cipher_set_key(VALUE self, VALUE key)
* Cipher#random_iv to create a secure random IV.
*
* Only call this method after calling Cipher#encrypt or Cipher#decrypt.
+ *
+ * If not explicitly set, the OpenSSL default of an all-zeroes ("\\0") IV is
+ * used.
*/
static VALUE
ossl_cipher_set_iv(VALUE self, VALUE iv)
{
EVP_CIPHER_CTX *ctx;
- int iv_len = 0;
StringValue(iv);
GetCipher(self, ctx);
- if (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)
- iv_len = (int)(VALUE)EVP_CIPHER_CTX_get_app_data(ctx);
- if (!iv_len)
- iv_len = EVP_CIPHER_CTX_iv_length(ctx);
- if (RSTRING_LEN(iv) != iv_len)
- ossl_raise(rb_eArgError, "iv must be %d bytes", iv_len);
+ if (RSTRING_LEN(iv) < EVP_CIPHER_CTX_iv_length(ctx))
+ ossl_raise(eCipherError, "iv length too short");
if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, (unsigned char *)RSTRING_PTR(iv), -1) != 1)
ossl_raise(eCipherError, NULL);
@@ -523,23 +482,7 @@ ossl_cipher_set_iv(VALUE self, VALUE iv)
return iv;
}
-/*
- * call-seq:
- * cipher.authenticated? -> true | false
- *
- * Indicated whether this Cipher instance uses an Authenticated Encryption
- * mode.
- */
-static VALUE
-ossl_cipher_is_authenticated(VALUE self)
-{
- EVP_CIPHER_CTX *ctx;
-
- GetCipher(self, ctx);
-
- return (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER) ? Qtrue : Qfalse;
-}
-
+#ifdef HAVE_AUTHENTICATED_ENCRYPTION
/*
* call-seq:
* cipher.auth_data = string -> string
@@ -563,80 +506,104 @@ ossl_cipher_set_auth_data(VALUE self, VALUE data)
{
EVP_CIPHER_CTX *ctx;
unsigned char *in;
- long in_len, out_len;
+ int in_len;
+ int out_len;
StringValue(data);
in = (unsigned char *) RSTRING_PTR(data);
- in_len = RSTRING_LEN(data);
+ in_len = RSTRING_LENINT(data);
GetCipher(self, ctx);
- if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER))
- ossl_raise(eCipherError, "AEAD not supported by this cipher");
- if (!ossl_cipher_update_long(ctx, NULL, &out_len, in, in_len))
+ if (!EVP_CipherUpdate(ctx, NULL, &out_len, in, in_len))
ossl_raise(eCipherError, "couldn't set additional authenticated data");
return data;
}
+#define ossl_is_gcm(nid) (nid) == NID_aes_128_gcm || \
+ (nid) == NID_aes_192_gcm || \
+ (nid) == NID_aes_256_gcm
+
+static VALUE
+ossl_get_gcm_auth_tag(EVP_CIPHER_CTX *ctx, int len)
+{
+ unsigned char *tag;
+ VALUE ret;
+
+ tag = ALLOC_N(unsigned char, len);
+
+ if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, len, tag))
+ ossl_raise(eCipherError, "retrieving the authentication tag failed");
+
+ ret = rb_str_new((const char *) tag, len);
+ xfree(tag);
+ return ret;
+}
+
/*
* call-seq:
- * cipher.auth_tag(tag_len = 16) -> String
+ * cipher.auth_tag([ tag_len ] -> string
*
* Gets the authentication tag generated by Authenticated Encryption Cipher
* modes (GCM for example). This tag may be stored along with the ciphertext,
* then set on the decryption cipher to authenticate the contents of the
- * ciphertext against changes. If the optional integer parameter _tag_len_ is
- * given, the returned tag will be _tag_len_ bytes long. If the parameter is
- * omitted, the default length of 16 bytes or the length previously set by
- * #auth_tag_len= will be used. For maximum security, the longest possible
- * should be chosen.
+ * ciphertext against changes. If the optional integer parameter +tag_len+ is
+ * given, the returned tag will be +tag_len+ bytes long. If the parameter is
+ * omitted, the maximum length of 16 bytes will be returned. For maximum
+ * security, the default of 16 bytes should be chosen.
*
* The tag may only be retrieved after calling Cipher#final.
*/
static VALUE
ossl_cipher_get_auth_tag(int argc, VALUE *argv, VALUE self)
{
- VALUE vtag_len, ret;
+ VALUE vtag_len;
EVP_CIPHER_CTX *ctx;
- int tag_len = 16;
+ int nid, tag_len;
- rb_scan_args(argc, argv, "01", &vtag_len);
- if (NIL_P(vtag_len))
- vtag_len = rb_attr_get(self, id_auth_tag_len);
- if (!NIL_P(vtag_len))
+ if (rb_scan_args(argc, argv, "01", &vtag_len) == 0) {
+ tag_len = 16;
+ } else {
tag_len = NUM2INT(vtag_len);
+ }
GetCipher(self, ctx);
+ nid = EVP_CIPHER_CTX_nid(ctx);
- if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER))
+ if (ossl_is_gcm(nid)) {
+ return ossl_get_gcm_auth_tag(ctx, tag_len);
+ } else {
ossl_raise(eCipherError, "authentication tag not supported by this cipher");
+ return Qnil; /* dummy */
+ }
+}
- ret = rb_str_new(NULL, tag_len);
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, tag_len, RSTRING_PTR(ret)))
- ossl_raise(eCipherError, "retrieving the authentication tag failed");
-
- return ret;
+static inline void
+ossl_set_gcm_auth_tag(EVP_CIPHER_CTX *ctx, unsigned char *tag, int tag_len)
+{
+ if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, tag_len, tag))
+ ossl_raise(eCipherError, "unable to set GCM tag");
}
/*
* call-seq:
* cipher.auth_tag = string -> string
*
- * Sets the authentication tag to verify the integrity of the ciphertext.
- * This can be called only when the cipher supports AE. The tag must be set
- * after calling Cipher#decrypt, Cipher#key= and Cipher#iv=, but before
- * calling Cipher#final. After all decryption is performed, the tag is
- * verified automatically in the call to Cipher#final.
- *
- * For OCB mode, the tag length must be supplied with #auth_tag_len=
- * beforehand.
+ * Sets the authentication tag to verify the contents of the
+ * ciphertext. The tag must be set after calling Cipher#decrypt,
+ * Cipher#key= and Cipher#iv=, but before assigning the associated
+ * authenticated data using Cipher#auth_data= and of course, before
+ * decrypting any of the ciphertext. After all decryption is
+ * performed, the tag is verified automatically in the call to
+ * Cipher#final.
*/
static VALUE
ossl_cipher_set_auth_tag(VALUE self, VALUE vtag)
{
EVP_CIPHER_CTX *ctx;
+ int nid;
unsigned char *tag;
int tag_len;
@@ -645,74 +612,45 @@ ossl_cipher_set_auth_tag(VALUE self, VALUE vtag)
tag_len = RSTRING_LENINT(vtag);
GetCipher(self, ctx);
- if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER))
- ossl_raise(eCipherError, "authentication tag not supported by this cipher");
+ nid = EVP_CIPHER_CTX_nid(ctx);
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, tag))
- ossl_raise(eCipherError, "unable to set AEAD tag");
+ if (ossl_is_gcm(nid)) {
+ ossl_set_gcm_auth_tag(ctx, tag, tag_len);
+ } else {
+ ossl_raise(eCipherError, "authentication tag not supported by this cipher");
+ }
return vtag;
}
/*
* call-seq:
- * cipher.auth_tag_len = Integer -> Integer
+ * cipher.authenticated? -> boolean
*
- * Sets the length of the authentication tag to be generated or to be given for
- * AEAD ciphers that requires it as in input parameter. Note that not all AEAD
- * ciphers support this method.
- *
- * In OCB mode, the length must be supplied both when encrypting and when
- * decrypting, and must be before specifying an IV.
- */
-static VALUE
-ossl_cipher_set_auth_tag_len(VALUE self, VALUE vlen)
-{
- int tag_len = NUM2INT(vlen);
- EVP_CIPHER_CTX *ctx;
-
- GetCipher(self, ctx);
- if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER))
- ossl_raise(eCipherError, "AEAD not supported by this cipher");
-
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, NULL))
- ossl_raise(eCipherError, "unable to set authentication tag length");
-
- /* for #auth_tag */
- rb_ivar_set(self, id_auth_tag_len, INT2NUM(tag_len));
-
- return vlen;
-}
-
-/*
- * call-seq:
- * cipher.iv_len = integer -> integer
- *
- * Sets the IV/nonce length of the Cipher. Normally block ciphers don't allow
- * changing the IV length, but some make use of IV for 'nonce'. You may need
- * this for interoperability with other applications.
+ * Indicated whether this Cipher instance uses an Authenticated Encryption
+ * mode.
*/
static VALUE
-ossl_cipher_set_iv_length(VALUE self, VALUE iv_length)
+ossl_cipher_is_authenticated(VALUE self)
{
- int len = NUM2INT(iv_length);
EVP_CIPHER_CTX *ctx;
+ int nid;
GetCipher(self, ctx);
- if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER))
- ossl_raise(eCipherError, "cipher does not support AEAD");
-
- if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, len, NULL))
- ossl_raise(eCipherError, "unable to set IV length");
+ nid = EVP_CIPHER_CTX_nid(ctx);
- /*
- * EVP_CIPHER_CTX_iv_length() returns the default length. So we need to save
- * the length somewhere. Luckily currently we aren't using app_data.
- */
- EVP_CIPHER_CTX_set_app_data(ctx, (void *)(VALUE)len);
-
- return iv_length;
+ if (ossl_is_gcm(nid)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
}
+#else
+#define ossl_cipher_set_auth_data rb_f_notimplement
+#define ossl_cipher_get_auth_tag rb_f_notimplement
+#define ossl_cipher_set_auth_tag rb_f_notimplement
+#define ossl_cipher_is_authenticated rb_f_notimplement
+#endif
/*
* call-seq:
@@ -739,6 +677,7 @@ ossl_cipher_set_key_length(VALUE self, VALUE key_length)
return key_length;
}
+#if defined(HAVE_EVP_CIPHER_CTX_SET_PADDING)
/*
* call-seq:
* cipher.padding = integer -> integer
@@ -760,6 +699,18 @@ ossl_cipher_set_padding(VALUE self, VALUE padding)
ossl_raise(eCipherError, NULL);
return padding;
}
+#else
+#define ossl_cipher_set_padding rb_f_notimplement
+#endif
+
+#define CIPHER_0ARG_INT(func) \
+ static VALUE \
+ ossl_cipher_##func(VALUE self) \
+ { \
+ EVP_CIPHER_CTX *ctx; \
+ GetCipher(self, ctx); \
+ return INT2NUM(EVP_CIPHER_##func(EVP_CIPHER_CTX_cipher(ctx))); \
+ }
/*
* call-seq:
@@ -767,52 +718,21 @@ ossl_cipher_set_padding(VALUE self, VALUE padding)
*
* Returns the key length in bytes of the Cipher.
*/
-static VALUE
-ossl_cipher_key_length(VALUE self)
-{
- EVP_CIPHER_CTX *ctx;
-
- GetCipher(self, ctx);
-
- return INT2NUM(EVP_CIPHER_CTX_key_length(ctx));
-}
-
+CIPHER_0ARG_INT(key_length)
/*
* call-seq:
* cipher.iv_len -> integer
*
* Returns the expected length in bytes for an IV for this Cipher.
*/
-static VALUE
-ossl_cipher_iv_length(VALUE self)
-{
- EVP_CIPHER_CTX *ctx;
- int len = 0;
-
- GetCipher(self, ctx);
- if (EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_FLAG_AEAD_CIPHER)
- len = (int)(VALUE)EVP_CIPHER_CTX_get_app_data(ctx);
- if (!len)
- len = EVP_CIPHER_CTX_iv_length(ctx);
-
- return INT2NUM(len);
-}
-
+CIPHER_0ARG_INT(iv_length)
/*
* call-seq:
* cipher.block_size -> integer
*
* Returns the size in bytes of the blocks on which this Cipher operates on.
*/
-static VALUE
-ossl_cipher_block_size(VALUE self)
-{
- EVP_CIPHER_CTX *ctx;
-
- GetCipher(self, ctx);
-
- return INT2NUM(EVP_CIPHER_CTX_block_size(ctx));
-}
+CIPHER_0ARG_INT(block_size)
/*
* INIT
@@ -821,8 +741,7 @@ void
Init_ossl_cipher(void)
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
/* Document-class: OpenSSL::Cipher
@@ -921,10 +840,12 @@ Init_ossl_cipher(void)
* you absolutely need it</b>
*
* Because of this, you will end up with a mode that explicitly requires
- * an IV in any case. Although the IV can be seen as public information,
- * i.e. it may be transmitted in public once generated, it should still
- * stay unpredictable to prevent certain kinds of attacks. Therefore,
- * ideally
+ * an IV in any case. Note that for backwards compatibility reasons,
+ * setting an IV is not explicitly mandated by the Cipher API. If not
+ * set, OpenSSL itself defaults to an all-zeroes IV ("\\0", not the
+ * character). Although the IV can be seen as public information, i.e.
+ * it may be transmitted in public once generated, it should still stay
+ * unpredictable to prevent certain kinds of attacks. Therefore, ideally
*
* <b>Always create a secure random IV for every encryption of your
* Cipher</b>
@@ -933,16 +854,16 @@ Init_ossl_cipher(void)
* of the IV as a nonce (number used once) - it's public but random and
* unpredictable. A secure random IV can be created as follows
*
- * cipher = ...
- * cipher.encrypt
- * key = cipher.random_key
- * iv = cipher.random_iv # also sets the generated IV on the Cipher
+ * cipher = ...
+ * cipher.encrypt
+ * key = cipher.random_key
+ * iv = cipher.random_iv # also sets the generated IV on the Cipher
*
- * Although the key is generally a random value, too, it is a bad choice
- * as an IV. There are elaborate ways how an attacker can take advantage
- * of such an IV. As a general rule of thumb, exposing the key directly
- * or indirectly should be avoided at all cost and exceptions only be
- * made with good reason.
+ * Although the key is generally a random value, too, it is a bad choice
+ * as an IV. There are elaborate ways how an attacker can take advantage
+ * of such an IV. As a general rule of thumb, exposing the key directly
+ * or indirectly should be avoided at all cost and exceptions only be
+ * made with good reason.
*
* === Calling Cipher#final
*
@@ -996,48 +917,35 @@ Init_ossl_cipher(void)
* could otherwise be exploited to modify ciphertexts in ways beneficial to
* potential attackers.
*
- * An associated data is used where there is additional information, such as
- * headers or some metadata, that must be also authenticated but not
- * necessarily need to be encrypted. If no associated data is needed for
- * encryption and later decryption, the OpenSSL library still requires a
- * value to be set - "" may be used in case none is available.
- *
- * An example using the GCM (Galois/Counter Mode). You have 16 bytes _key_,
- * 12 bytes (96 bits) _nonce_ and the associated data _auth_data_. Be sure
- * not to reuse the _key_ and _nonce_ pair. Reusing an nonce ruins the
- * security guarantees of GCM mode.
+ * If no associated data is needed for encryption and later decryption,
+ * the OpenSSL library still requires a value to be set - "" may be used in
+ * case none is available. An example using the GCM (Galois Counter Mode):
*
- * cipher = OpenSSL::Cipher::AES.new(128, :GCM).encrypt
- * cipher.key = key
- * cipher.iv = nonce
- * cipher.auth_data = auth_data
+ * cipher = OpenSSL::Cipher::AES.new(128, :GCM)
+ * cipher.encrypt
+ * key = cipher.random_key
+ * iv = cipher.random_iv
+ * cipher.auth_data = ""
*
* encrypted = cipher.update(data) + cipher.final
- * tag = cipher.auth_tag # produces 16 bytes tag by default
- *
- * Now you are the receiver. You know the _key_ and have received _nonce_,
- * _auth_data_, _encrypted_ and _tag_ through an untrusted network. Note
- * that GCM accepts an arbitrary length tag between 1 and 16 bytes. You may
- * additionally need to check that the received tag has the correct length,
- * or you allow attackers to forge a valid single byte tag for the tampered
- * ciphertext with a probability of 1/256.
+ * tag = cipher.auth_tag
*
- * raise "tag is truncated!" unless tag.bytesize == 16
- * decipher = OpenSSL::Cipher::AES.new(128, :GCM).decrypt
+ * decipher = OpenSSL::Cipher::AES.new(128, :GCM)
+ * decipher.decrypt
* decipher.key = key
- * decipher.iv = nonce
+ * decipher.iv = iv
* decipher.auth_tag = tag
- * decipher.auth_data = auth_data
+ * decipher.auth_data = ""
*
- * decrypted = decipher.update(encrypted) + decipher.final
+ * plain = decipher.update(encrypted) + decipher.final
*
- * puts data == decrypted #=> true
+ * puts data == plain #=> true
*/
cCipher = rb_define_class_under(mOSSL, "Cipher", rb_cObject);
eCipherError = rb_define_class_under(cCipher, "CipherError", eOSSLError);
rb_define_alloc_func(cCipher, ossl_cipher_alloc);
- rb_define_method(cCipher, "initialize_copy", ossl_cipher_copy, 1);
+ rb_define_copy_func(cCipher, ossl_cipher_copy);
rb_define_module_function(cCipher, "ciphers", ossl_s_ciphers, 0);
rb_define_method(cCipher, "initialize", ossl_cipher_initialize, 1);
rb_define_method(cCipher, "reset", ossl_cipher_reset, 0);
@@ -1051,16 +959,12 @@ Init_ossl_cipher(void)
rb_define_method(cCipher, "auth_data=", ossl_cipher_set_auth_data, 1);
rb_define_method(cCipher, "auth_tag=", ossl_cipher_set_auth_tag, 1);
rb_define_method(cCipher, "auth_tag", ossl_cipher_get_auth_tag, -1);
- rb_define_method(cCipher, "auth_tag_len=", ossl_cipher_set_auth_tag_len, 1);
rb_define_method(cCipher, "authenticated?", ossl_cipher_is_authenticated, 0);
rb_define_method(cCipher, "key_len=", ossl_cipher_set_key_length, 1);
rb_define_method(cCipher, "key_len", ossl_cipher_key_length, 0);
rb_define_method(cCipher, "iv=", ossl_cipher_set_iv, 1);
- rb_define_method(cCipher, "iv_len=", ossl_cipher_set_iv_length, 1);
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_auth_tag_len = rb_intern_const("auth_tag_len");
- id_key_set = rb_intern_const("key_set");
}
+
diff --git a/ext/openssl/ossl_cipher.h b/ext/openssl/ossl_cipher.h
index 2392d41c6a..bed4fa853b 100644
--- a/ext/openssl/ossl_cipher.h
+++ b/ext/openssl/ossl_cipher.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_CIPHER_H_)
@@ -13,8 +14,9 @@
extern VALUE cCipher;
extern VALUE eCipherError;
-const EVP_CIPHER *ossl_evp_get_cipherbyname(VALUE);
+const EVP_CIPHER *GetCipherPtr(VALUE);
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 28392e208c..140f5c3ad0 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -26,13 +27,13 @@ VALUE eConfigError;
*/
/*
- * DupConfigPtr is a public C-level function for getting OpenSSL CONF struct
+ * GetConfigPtr 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 *
-DupConfigPtr(VALUE obj)
+GetConfigPtr(VALUE obj)
{
CONF *conf;
VALUE str;
@@ -41,7 +42,7 @@ DupConfigPtr(VALUE obj)
OSSL_Check_Kind(obj, cConfig);
str = rb_funcall(obj, rb_intern("to_s"), 0);
- bio = ossl_obj2bio(&str);
+ bio = ossl_obj2bio(str);
conf = NCONF_new(NULL);
if(!conf){
BIO_free(bio);
@@ -50,10 +51,9 @@ DupConfigPtr(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);
+ if (eline <= 0) ossl_raise(eConfigError, "wrong config format");
+ else ossl_raise(eConfigError, "error in line %d", eline);
+ ossl_raise(eConfigError, NULL);
}
BIO_free(bio);
@@ -69,15 +69,9 @@ DupConfigPtr(VALUE obj)
* INIT
*/
void
-Init_ossl_config(void)
+Init_ossl_config()
{
char *default_config_file;
-
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
eConfigError = rb_define_class_under(mOSSL, "ConfigError", eOSSLError);
cConfig = rb_define_class_under(mOSSL, "Config", rb_cObject);
diff --git a/ext/openssl/ossl_config.h b/ext/openssl/ossl_config.h
index 627d297ba3..cb226b27e5 100644
--- a/ext/openssl/ossl_config.h
+++ b/ext/openssl/ossl_config.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_CONFIG_H_)
@@ -13,7 +14,9 @@
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 112ce33647..7e5e7ff1ab 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.c
@@ -1,20 +1,25 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
#define GetDigest(obj, ctx) do { \
- TypedData_Get_Struct((obj), EVP_MD_CTX, &ossl_digest_type, (ctx)); \
+ Data_Get_Struct((obj), EVP_MD_CTX, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \
} \
} while (0)
+#define SafeGetDigest(obj, ctx) do { \
+ OSSL_Check_Kind((obj), cDigest); \
+ GetDigest((obj), (ctx)); \
+} while (0)
/*
* Classes
@@ -24,25 +29,11 @@ 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
*/
const EVP_MD *
-ossl_evp_get_digestbyname(VALUE obj)
+GetDigestPtr(VALUE obj)
{
const EVP_MD *md;
ASN1_OBJECT *oid = NULL;
@@ -57,11 +48,11 @@ ossl_evp_get_digestbyname(VALUE obj)
ASN1_OBJECT_free(oid);
}
if(!md)
- ossl_raise(rb_eRuntimeError, "Unsupported digest algorithm (%"PRIsVALUE").", obj);
+ ossl_raise(rb_eRuntimeError, "Unsupported digest algorithm (%s).", name);
} else {
EVP_MD_CTX *ctx;
- GetDigest(obj, ctx);
+ SafeGetDigest(obj, ctx);
md = EVP_MD_CTX_md(ctx);
}
@@ -76,13 +67,10 @@ ossl_digest_new(const EVP_MD *md)
EVP_MD_CTX *ctx;
ret = ossl_digest_alloc(cDigest);
- ctx = EVP_MD_CTX_new();
- if (!ctx)
- ossl_raise(eDigestError, "EVP_MD_CTX_new");
- RTYPEDDATA_DATA(ret) = ctx;
-
- if (!EVP_DigestInit_ex(ctx, md, NULL))
- ossl_raise(eDigestError, "Digest initialization failed");
+ GetDigest(ret, ctx);
+ if (EVP_DigestInit_ex(ctx, md, NULL) != 1) {
+ ossl_raise(eDigestError, "Digest initialization failed.");
+ }
return ret;
}
@@ -93,7 +81,15 @@ ossl_digest_new(const EVP_MD *md)
static VALUE
ossl_digest_alloc(VALUE klass)
{
- return TypedData_Wrap_Struct(klass, &ossl_digest_type, 0);
+ EVP_MD_CTX *ctx;
+ VALUE obj;
+
+ 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);
+
+ return obj;
}
VALUE ossl_digest_update(VALUE, VALUE);
@@ -102,18 +98,19 @@ VALUE ossl_digest_update(VALUE, VALUE);
* call-seq:
* Digest.new(string [, data]) -> Digest
*
- * Creates a Digest instance based on _string_, which is either the ln
+ * Creates a Digest instance based on +string+, which is either the ln
* (long name) or sn (short name) of a supported digest algorithm.
- *
- * If _data_ (a String) is given, it is used as the initial input to the
+ * If +data+ (a +String+) is given, it is used as the initial input to the
* Digest instance, i.e.
- *
* digest = OpenSSL::Digest.new('sha256', 'digestdata')
- *
- * is equivalent to
- *
+ * is equal to
* digest = OpenSSL::Digest.new('sha256')
* digest.update('digestdata')
+ *
+ * === Example
+ * digest = OpenSSL::Digest.new('sha1')
+ *
+ *
*/
static VALUE
ossl_digest_initialize(int argc, VALUE *argv, VALUE self)
@@ -123,19 +120,14 @@ ossl_digest_initialize(int argc, VALUE *argv, VALUE self)
VALUE type, data;
rb_scan_args(argc, argv, "11", &type, &data);
- md = ossl_evp_get_digestbyname(type);
+ md = GetDigestPtr(type);
if (!NIL_P(data)) StringValue(data);
- TypedData_Get_Struct(self, EVP_MD_CTX, &ossl_digest_type, ctx);
- if (!ctx) {
- RTYPEDDATA_DATA(self) = ctx = EVP_MD_CTX_new();
- if (!ctx)
- ossl_raise(eDigestError, "EVP_MD_CTX_new");
+ GetDigest(self, ctx);
+ if (EVP_DigestInit_ex(ctx, md, NULL) != 1) {
+ ossl_raise(eDigestError, "Digest initialization failed.");
}
- if (!EVP_DigestInit_ex(ctx, md, NULL))
- ossl_raise(eDigestError, "Digest initialization failed");
-
if (!NIL_P(data)) return ossl_digest_update(self, data);
return self;
}
@@ -148,13 +140,8 @@ ossl_digest_copy(VALUE self, VALUE other)
rb_check_frozen(self);
if (self == other) return self;
- TypedData_Get_Struct(self, EVP_MD_CTX, &ossl_digest_type, ctx1);
- if (!ctx1) {
- RTYPEDDATA_DATA(self) = ctx1 = EVP_MD_CTX_new();
- if (!ctx1)
- ossl_raise(eDigestError, "EVP_MD_CTX_new");
- }
- GetDigest(other, ctx2);
+ GetDigest(self, ctx1);
+ SafeGetDigest(other, ctx2);
if (!EVP_MD_CTX_copy(ctx1, ctx2)) {
ossl_raise(eDigestError, NULL);
@@ -205,9 +192,7 @@ ossl_digest_update(VALUE self, VALUE data)
StringValue(data);
GetDigest(self, ctx);
-
- if (!EVP_DigestUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data)))
- ossl_raise(eDigestError, "EVP_DigestUpdate");
+ EVP_DigestUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data));
return self;
}
@@ -222,21 +207,19 @@ ossl_digest_finish(int argc, VALUE *argv, VALUE self)
{
EVP_MD_CTX *ctx;
VALUE str;
- int out_len;
- GetDigest(self, ctx);
rb_scan_args(argc, argv, "01", &str);
- out_len = EVP_MD_CTX_size(ctx);
+
+ GetDigest(self, ctx);
if (NIL_P(str)) {
- str = rb_str_new(NULL, out_len);
+ str = rb_str_new(NULL, EVP_MD_CTX_size(ctx));
} else {
StringValue(str);
- rb_str_resize(str, out_len);
+ rb_str_resize(str, EVP_MD_CTX_size(ctx));
}
- if (!EVP_DigestFinal_ex(ctx, (unsigned char *)RSTRING_PTR(str), NULL))
- ossl_raise(eDigestError, "EVP_DigestFinal_ex");
+ EVP_DigestFinal_ex(ctx, (unsigned char *)RSTRING_PTR(str), NULL);
return str;
}
@@ -245,7 +228,7 @@ ossl_digest_finish(int argc, VALUE *argv, VALUE self)
* call-seq:
* digest.name -> string
*
- * Returns the sn of this Digest algorithm.
+ * Returns the sn of this Digest instance.
*
* === Example
* digest = OpenSSL::Digest::SHA512.new
@@ -311,13 +294,12 @@ ossl_digest_block_length(VALUE self)
* INIT
*/
void
-Init_ossl_digest(void)
+Init_ossl_digest()
{
rb_require("digest");
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
/* Document-class: OpenSSL::Digest
@@ -444,7 +426,7 @@ Init_ossl_digest(void)
rb_define_alloc_func(cDigest, ossl_digest_alloc);
rb_define_method(cDigest, "initialize", ossl_digest_initialize, -1);
- rb_define_method(cDigest, "initialize_copy", ossl_digest_copy, 1);
+ rb_define_copy_func(cDigest, ossl_digest_copy);
rb_define_method(cDigest, "reset", ossl_digest_reset, 0);
rb_define_method(cDigest, "update", ossl_digest_update, 1);
rb_define_alias(cDigest, "<<", "update");
diff --git a/ext/openssl/ossl_digest.h b/ext/openssl/ossl_digest.h
index 50bf5666a3..8cc5b1bc56 100644
--- a/ext/openssl/ossl_digest.h
+++ b/ext/openssl/ossl_digest.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_DIGEST_H_)
@@ -13,8 +14,9 @@
extern VALUE cDigest;
extern VALUE eDigestError;
-const EVP_MD *ossl_evp_get_digestbyname(VALUE);
+const EVP_MD *GetDigestPtr(VALUE);
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 5ca0d4ca3f..f99a30dfc3 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -1,30 +1,33 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#if !defined(OPENSSL_NO_ENGINE)
+#if defined(OSSL_ENGINE_ENABLED)
-#define NewEngine(klass) \
- TypedData_Wrap_Struct((klass), &ossl_engine_type, 0)
-#define SetEngine(obj, engine) do { \
+#define WrapEngine(klass, obj, engine) do { \
if (!(engine)) { \
ossl_raise(rb_eRuntimeError, "ENGINE wasn't initialized."); \
} \
- RTYPEDDATA_DATA(obj) = (engine); \
+ (obj) = Data_Wrap_Struct((klass), 0, ENGINE_free, (engine)); \
} while(0)
#define GetEngine(obj, engine) do { \
- TypedData_Get_Struct((obj), ENGINE, &ossl_engine_type, (engine)); \
+ Data_Get_Struct((obj), ENGINE, (engine)); \
if (!(engine)) { \
ossl_raise(rb_eRuntimeError, "ENGINE wasn't initialized."); \
} \
} while (0)
+#define SafeGetEngine(obj, engine) do { \
+ OSSL_Check_Kind((obj), cEngine); \
+ GetPKCS7((obj), (engine)); \
+} while (0)
/*
* Classes
@@ -46,47 +49,22 @@ VALUE eEngineError;
/*
* Private
*/
-#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
-#define OSSL_ENGINE_LOAD_IF_MATCH(engine_name, x) \
-do{\
- if(!strcmp(#engine_name, RSTRING_PTR(name))){\
- if (OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_##x, NULL))\
- return Qtrue;\
- else\
- ossl_raise(eEngineError, "OPENSSL_init_crypto"); \
- }\
-}while(0)
-#else
-#define OSSL_ENGINE_LOAD_IF_MATCH(engine_name, x) \
+#define OSSL_ENGINE_LOAD_IF_MATCH(x) \
do{\
- if(!strcmp(#engine_name, RSTRING_PTR(name))){\
- ENGINE_load_##engine_name();\
+ if(!strcmp(#x, RSTRING_PTR(name))){\
+ ENGINE_load_##x();\
return Qtrue;\
}\
}while(0)
-#endif
-
-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:
- * OpenSSL::Engine.load(name = nil)
+ * load(enginename = nil)
*
- * This method loads engines. If _name_ is nil, then all builtin engines are
- * loaded. Otherwise, the given _name_, as a String, is loaded if available to
- * your runtime, and returns true. If _name_ is not found, then nil is
+ * This method loads engines. If +name+ is nil, then all builtin engines are
+ * loaded. Otherwise, the given +name+, as a string, is loaded if available to
+ * your runtime, and returns true. If +name+ is not found, then nil is
* returned.
*
*/
@@ -103,84 +81,82 @@ ossl_engine_s_load(int argc, VALUE *argv, VALUE klass)
ENGINE_load_builtin_engines();
return Qtrue;
}
- StringValueCStr(name);
+ StringValue(name);
#ifndef OPENSSL_NO_STATIC_ENGINE
#if HAVE_ENGINE_LOAD_DYNAMIC
- OSSL_ENGINE_LOAD_IF_MATCH(dynamic, DYNAMIC);
+ OSSL_ENGINE_LOAD_IF_MATCH(dynamic);
#endif
#if HAVE_ENGINE_LOAD_4758CCA
- OSSL_ENGINE_LOAD_IF_MATCH(4758cca, 4758CCA);
+ OSSL_ENGINE_LOAD_IF_MATCH(4758cca);
#endif
#if HAVE_ENGINE_LOAD_AEP
- OSSL_ENGINE_LOAD_IF_MATCH(aep, AEP);
+ OSSL_ENGINE_LOAD_IF_MATCH(aep);
#endif
#if HAVE_ENGINE_LOAD_ATALLA
- OSSL_ENGINE_LOAD_IF_MATCH(atalla, ATALLA);
+ OSSL_ENGINE_LOAD_IF_MATCH(atalla);
#endif
#if HAVE_ENGINE_LOAD_CHIL
- OSSL_ENGINE_LOAD_IF_MATCH(chil, CHIL);
+ OSSL_ENGINE_LOAD_IF_MATCH(chil);
#endif
#if HAVE_ENGINE_LOAD_CSWIFT
- OSSL_ENGINE_LOAD_IF_MATCH(cswift, CSWIFT);
+ OSSL_ENGINE_LOAD_IF_MATCH(cswift);
#endif
#if HAVE_ENGINE_LOAD_NURON
- OSSL_ENGINE_LOAD_IF_MATCH(nuron, NURON);
+ OSSL_ENGINE_LOAD_IF_MATCH(nuron);
#endif
#if HAVE_ENGINE_LOAD_SUREWARE
- OSSL_ENGINE_LOAD_IF_MATCH(sureware, SUREWARE);
+ OSSL_ENGINE_LOAD_IF_MATCH(sureware);
#endif
#if HAVE_ENGINE_LOAD_UBSEC
- OSSL_ENGINE_LOAD_IF_MATCH(ubsec, UBSEC);
+ OSSL_ENGINE_LOAD_IF_MATCH(ubsec);
#endif
#if HAVE_ENGINE_LOAD_PADLOCK
- OSSL_ENGINE_LOAD_IF_MATCH(padlock, PADLOCK);
+ OSSL_ENGINE_LOAD_IF_MATCH(padlock);
#endif
#if HAVE_ENGINE_LOAD_CAPI
- OSSL_ENGINE_LOAD_IF_MATCH(capi, CAPI);
+ OSSL_ENGINE_LOAD_IF_MATCH(capi);
#endif
#if HAVE_ENGINE_LOAD_GMP
- OSSL_ENGINE_LOAD_IF_MATCH(gmp, GMP);
+ OSSL_ENGINE_LOAD_IF_MATCH(gmp);
#endif
#if HAVE_ENGINE_LOAD_GOST
- OSSL_ENGINE_LOAD_IF_MATCH(gost, GOST);
+ OSSL_ENGINE_LOAD_IF_MATCH(gost);
#endif
#if HAVE_ENGINE_LOAD_CRYPTODEV
- OSSL_ENGINE_LOAD_IF_MATCH(cryptodev, CRYPTODEV);
+ OSSL_ENGINE_LOAD_IF_MATCH(cryptodev);
#endif
#if HAVE_ENGINE_LOAD_AESNI
- OSSL_ENGINE_LOAD_IF_MATCH(aesni, AESNI);
+ OSSL_ENGINE_LOAD_IF_MATCH(aesni);
#endif
#endif
#ifdef HAVE_ENGINE_LOAD_OPENBSD_DEV_CRYPTO
- OSSL_ENGINE_LOAD_IF_MATCH(openbsd_dev_crypto, OPENBSD_DEV_CRYPTO);
+ OSSL_ENGINE_LOAD_IF_MATCH(openbsd_dev_crypto);
#endif
- OSSL_ENGINE_LOAD_IF_MATCH(openssl, OPENSSL);
- rb_warning("no such builtin loader for `%"PRIsVALUE"'", name);
+ OSSL_ENGINE_LOAD_IF_MATCH(openssl);
+ rb_warning("no such builtin loader for `%s'", RSTRING_PTR(name));
return Qnil;
#endif /* HAVE_ENGINE_LOAD_BUILTIN_ENGINES */
}
-/*
+/* Document-method: OpenSSL::Engine.cleanup
* call-seq:
- * OpenSSL::Engine.cleanup
+ * OpenSSL::Engine.cleanup
*
* It is only necessary to run cleanup when engines are loaded via
* OpenSSL::Engine.load. However, running cleanup before exit is recommended.
*
- * Note that this is needed and works only in OpenSSL < 1.1.0.
+ * See also, https://www.openssl.org/docs/crypto/engine.html
*/
static VALUE
ossl_engine_s_cleanup(VALUE self)
{
-#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000
+#if defined(HAVE_ENGINE_CLEANUP)
ENGINE_cleanup();
#endif
return Qnil;
}
-/*
- * call-seq:
- * OpenSSL::Engine.engines -> [engine, ...]
+/* Document-method: OpenSSL::Engine.engines
*
* Returns an array of currently loaded engines.
*/
@@ -192,28 +168,28 @@ 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);
- SetEngine(obj, e);
+ WrapEngine(klass, obj, e);
rb_ary_push(ary, obj);
}
return ary;
}
-/*
+/* Document-method: OpenSSL::Engine.by_id
+ *
* call-seq:
- * OpenSSL::Engine.by_id(name) -> engine
+ * by_id(name) -> engine
*
- * Fetches the engine as specified by the _id_ String.
+ * Fetch the engine as specified by the +id+ String
*
* OpenSSL::Engine.by_id("openssl")
* => #<OpenSSL::Engine id="openssl" name="Software engine support">
*
- * See OpenSSL::Engine.engines for the currently loaded engines.
+ * See OpenSSL::Engine.engines for the currently loaded engines
*/
static VALUE
ossl_engine_s_by_id(VALUE klass, VALUE id)
@@ -221,27 +197,38 @@ ossl_engine_s_by_id(VALUE klass, VALUE id)
ENGINE *e;
VALUE obj;
- StringValueCStr(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);
- SetEngine(obj, e);
+ WrapEngine(klass, obj, e);
if(rb_block_given_p()) rb_yield(obj);
if(!ENGINE_init(e))
ossl_raise(eEngineError, NULL);
ENGINE_ctrl(e, ENGINE_CTRL_SET_PASSWORD_CALLBACK,
0, NULL, (void(*)(void))ossl_pem_passwd_cb);
- ossl_clear_error();
+ ERR_clear_error();
return obj;
}
-/*
- * call-seq:
- * engine.id -> string
+static VALUE
+ossl_engine_s_alloc(VALUE klass)
+{
+ ENGINE *e;
+ VALUE obj;
+
+ if (!(e = ENGINE_new())) {
+ ossl_raise(eEngineError, NULL);
+ }
+ WrapEngine(klass, obj, e);
+
+ return obj;
+}
+
+/* Document-method: OpenSSL::Engine#id
*
- * Gets the id for this engine.
+ * Get the id for this engine
*
* OpenSSL::Engine.load
* OpenSSL::Engine.engines #=> [#<OpenSSL::Engine#>, ...]
@@ -256,11 +243,9 @@ ossl_engine_get_id(VALUE self)
return rb_str_new2(ENGINE_get_id(e));
}
-/*
- * call-seq:
- * engine.name -> string
+/* Document-method: OpenSSL::Engine#name
*
- * Get the descriptive name for this engine.
+ * Get the descriptive name for this engine
*
* OpenSSL::Engine.load
* OpenSSL::Engine.engines #=> [#<OpenSSL::Engine#>, ...]
@@ -276,9 +261,7 @@ ossl_engine_get_name(VALUE self)
return rb_str_new2(ENGINE_get_name(e));
}
-/*
- * call-seq:
- * engine.finish -> nil
+/* Document-method: OpenSSL::Engine#finish
*
* Releases all internal structural references for this engine.
*
@@ -295,14 +278,16 @@ ossl_engine_finish(VALUE self)
return Qnil;
}
-/*
+#if defined(HAVE_ENGINE_GET_CIPHER)
+/* Document-method: OpenSSL::Engine#cipher
+ *
* call-seq:
* engine.cipher(name) -> OpenSSL::Cipher
*
- * Returns a new instance of OpenSSL::Cipher by _name_, if it is available in
- * this engine.
+ * This returns an OpenSSL::Cipher by +name+, if it is available in this
+ * engine.
*
- * An EngineError will be raised if the cipher is unavailable.
+ * A EngineError will be raised if the cipher is unavailable.
*
* e = OpenSSL::Engine.by_id("openssl")
* => #<OpenSSL::Engine id="openssl" name="Software engine support">
@@ -315,10 +300,12 @@ ossl_engine_get_cipher(VALUE self, VALUE name)
{
ENGINE *e;
const EVP_CIPHER *ciph, *tmp;
+ char *s;
int nid;
- tmp = EVP_get_cipherbyname(StringValueCStr(name));
- if(!tmp) ossl_raise(eEngineError, "no such cipher `%"PRIsVALUE"'", name);
+ s = StringValuePtr(name);
+ tmp = EVP_get_cipherbyname(s);
+ if(!tmp) ossl_raise(eEngineError, "no such cipher `%s'", s);
nid = EVP_CIPHER_nid(tmp);
GetEngine(self, e);
ciph = ENGINE_get_cipher(e, nid);
@@ -326,12 +313,17 @@ ossl_engine_get_cipher(VALUE self, VALUE name)
return ossl_cipher_new(ciph);
}
+#else
+#define ossl_engine_get_cipher rb_f_notimplement
+#endif
-/*
+#if defined(HAVE_ENGINE_GET_DIGEST)
+/* Document-method: OpenSSL::Engine#digest
+ *
* call-seq:
* engine.digest(name) -> OpenSSL::Digest
*
- * Returns a new instance of OpenSSL::Digest by _name_.
+ * This returns an OpenSSL::Digest by +name+.
*
* Will raise an EngineError if the digest is unavailable.
*
@@ -347,10 +339,12 @@ ossl_engine_get_digest(VALUE self, VALUE name)
{
ENGINE *e;
const EVP_MD *md, *tmp;
+ char *s;
int nid;
- tmp = EVP_get_digestbyname(StringValueCStr(name));
- if(!tmp) ossl_raise(eEngineError, "no such digest `%"PRIsVALUE"'", name);
+ s = StringValuePtr(name);
+ tmp = EVP_get_digestbyname(s);
+ if(!tmp) ossl_raise(eEngineError, "no such digest `%s'", s);
nid = EVP_MD_nid(tmp);
GetEngine(self, e);
md = ENGINE_get_digest(e, nid);
@@ -358,12 +352,16 @@ ossl_engine_get_digest(VALUE self, VALUE name)
return ossl_digest_new(md);
}
+#else
+#define ossl_engine_get_digest rb_f_notimplement
+#endif
-/*
+/* Document-method: OpenSSL::Engine#load_private_key
+ *
* call-seq:
* engine.load_private_key(id = nil, data = nil) -> OpenSSL::PKey
*
- * Loads the given private key identified by _id_ and _data_.
+ * Loads the given private key by +id+ and +data+.
*
* An EngineError is raised of the OpenSSL::PKey is unavailable.
*
@@ -377,10 +375,14 @@ ossl_engine_load_privkey(int argc, VALUE *argv, VALUE self)
char *sid, *sdata;
rb_scan_args(argc, argv, "02", &id, &data);
- sid = NIL_P(id) ? NULL : StringValueCStr(id);
- sdata = NIL_P(data) ? NULL : StringValueCStr(data);
+ sid = NIL_P(id) ? NULL : StringValuePtr(id);
+ sdata = NIL_P(data) ? NULL : StringValuePtr(data);
GetEngine(self, e);
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+ pkey = ENGINE_load_private_key(e, sid, sdata);
+#else
pkey = ENGINE_load_private_key(e, sid, NULL, sdata);
+#endif
if (!pkey) ossl_raise(eEngineError, NULL);
obj = ossl_pkey_new(pkey);
OSSL_PKEY_SET_PRIVATE(obj);
@@ -388,11 +390,12 @@ ossl_engine_load_privkey(int argc, VALUE *argv, VALUE self)
return obj;
}
-/*
+/* Document-method: OpenSSL::Engine#load_public_key
+ *
* call-seq:
* engine.load_public_key(id = nil, data = nil) -> OpenSSL::PKey
*
- * Loads the given public key identified by _id_ and _data_.
+ * Loads the given private key by +id+ and +data+.
*
* An EngineError is raised of the OpenSSL::PKey is unavailable.
*
@@ -406,24 +409,29 @@ ossl_engine_load_pubkey(int argc, VALUE *argv, VALUE self)
char *sid, *sdata;
rb_scan_args(argc, argv, "02", &id, &data);
- sid = NIL_P(id) ? NULL : StringValueCStr(id);
- sdata = NIL_P(data) ? NULL : StringValueCStr(data);
+ sid = NIL_P(id) ? NULL : StringValuePtr(id);
+ sdata = NIL_P(data) ? NULL : StringValuePtr(data);
GetEngine(self, e);
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+ pkey = ENGINE_load_public_key(e, sid, sdata);
+#else
pkey = ENGINE_load_public_key(e, sid, NULL, sdata);
+#endif
if (!pkey) ossl_raise(eEngineError, NULL);
return ossl_pkey_new(pkey);
}
-/*
+/* Document-method: OpenSSL::Engine#set_default
+ *
* call-seq:
* engine.set_default(flag)
*
- * Set the defaults for this engine with the given _flag_.
+ * Set the defaults for this engine with the given +flag+.
*
* These flags are used to control combinations of algorithm methods.
*
- * _flag_ can be one of the following, other flags are available depending on
+ * +flag+ can be one of the following, other flags are available depending on
* your OS.
*
* [All flags] 0xFFFF
@@ -443,13 +451,14 @@ ossl_engine_set_default(VALUE self, VALUE flag)
return Qtrue;
}
-/*
+/* Document-method: OpenSSL::Engine#ctrl_cmd
+ *
* call-seq:
* engine.ctrl_cmd(command, value = nil) -> engine
*
- * Sends the given _command_ to this engine.
+ * Send the given +command+ to this engine.
*
- * Raises an EngineError if the command fails.
+ * Raises an EngineError if the +command+ fails.
*/
static VALUE
ossl_engine_ctrl_cmd(int argc, VALUE *argv, VALUE self)
@@ -460,8 +469,10 @@ ossl_engine_ctrl_cmd(int argc, VALUE *argv, VALUE self)
GetEngine(self, e);
rb_scan_args(argc, argv, "11", &cmd, &val);
- ret = ENGINE_ctrl_cmd_string(e, StringValueCStr(cmd),
- NIL_P(val) ? NULL : StringValueCStr(val), 0);
+ StringValue(cmd);
+ if (!NIL_P(val)) StringValue(val);
+ ret = ENGINE_ctrl_cmd_string(e, RSTRING_PTR(cmd),
+ NIL_P(val) ? NULL : RSTRING_PTR(val), 0);
if (!ret) ossl_raise(eEngineError, NULL);
return self;
@@ -479,9 +490,7 @@ ossl_engine_cmd_flag_to_name(int flag)
}
}
-/*
- * call-seq:
- * engine.cmds -> [["name", "description", "flags"], ...]
+/* Document-method: OpenSSL::Engine#cmds
*
* Returns an array of command definitions for the current engine
*/
@@ -507,11 +516,9 @@ ossl_engine_get_cmds(VALUE self)
return ary;
}
-/*
- * call-seq:
- * engine.inspect -> string
+/* Document-method: OpenSSL::Engine#inspect
*
- * Pretty prints this engine.
+ * Pretty print this engine
*/
static VALUE
ossl_engine_inspect(VALUE self)
@@ -526,21 +533,17 @@ ossl_engine_inspect(VALUE self)
#define DefEngineConst(x) rb_define_const(cEngine, #x, INT2NUM(ENGINE_##x))
void
-Init_ossl_engine(void)
+Init_ossl_engine()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
cEngine = rb_define_class_under(mOSSL, "Engine", rb_cObject);
eEngineError = rb_define_class_under(cEngine, "EngineError", eOSSLError);
- rb_undef_alloc_func(cEngine);
+ rb_define_alloc_func(cEngine, ossl_engine_s_alloc);
rb_define_singleton_method(cEngine, "load", ossl_engine_s_load, -1);
rb_define_singleton_method(cEngine, "cleanup", ossl_engine_s_cleanup, 0);
rb_define_singleton_method(cEngine, "engines", ossl_engine_s_engines, 0);
rb_define_singleton_method(cEngine, "by_id", ossl_engine_s_by_id, 1);
+ rb_undef_method(CLASS_OF(cEngine), "new");
rb_define_method(cEngine, "id", ossl_engine_get_id, 0);
rb_define_method(cEngine, "name", ossl_engine_get_name, 0);
@@ -564,14 +567,18 @@ Init_ossl_engine(void)
#ifdef ENGINE_METHOD_BN_MOD_EXP_CRT
DefEngineConst(METHOD_BN_MOD_EXP_CRT);
#endif
+#ifdef ENGINE_METHOD_CIPHERS
DefEngineConst(METHOD_CIPHERS);
+#endif
+#ifdef ENGINE_METHOD_DIGESTS
DefEngineConst(METHOD_DIGESTS);
+#endif
DefEngineConst(METHOD_ALL);
DefEngineConst(METHOD_NONE);
}
#else
void
-Init_ossl_engine(void)
+Init_ossl_engine()
{
}
#endif
diff --git a/ext/openssl/ossl_engine.h b/ext/openssl/ossl_engine.h
index cd548beea3..ea2f256912 100644
--- a/ext/openssl/ossl_engine.h
+++ b/ext/openssl/ossl_engine.h
@@ -1,11 +1,12 @@
/*
+ * $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 licensed under the same licence as Ruby.
+ * This program is licenced 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 564dcab522..b1e853dde3 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -1,24 +1,29 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(OPENSSL_NO_HMAC)
#include "ossl.h"
-#define NewHMAC(klass) \
- TypedData_Wrap_Struct((klass), &ossl_hmac_type, 0)
+#define MakeHMAC(obj, klass, ctx) \
+ (obj) = Data_Make_Struct((klass), HMAC_CTX, 0, ossl_hmac_free, (ctx))
#define GetHMAC(obj, ctx) do { \
- TypedData_Get_Struct((obj), HMAC_CTX, &ossl_hmac_type, (ctx)); \
+ Data_Get_Struct((obj), HMAC_CTX, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "HMAC wasn't initialized"); \
} \
} while (0)
+#define SafeGetHMAC(obj, ctx) do { \
+ OSSL_Check_Kind((obj), cHMAC); \
+ GetHMAC((obj), (ctx)); \
+} while (0)
/*
* Classes
@@ -34,30 +39,20 @@ VALUE eHMACError;
* Private
*/
static void
-ossl_hmac_free(void *ctx)
+ossl_hmac_free(HMAC_CTX *ctx)
{
- HMAC_CTX_free(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)
{
- VALUE obj;
HMAC_CTX *ctx;
+ VALUE obj;
- obj = NewHMAC(klass);
- ctx = HMAC_CTX_new();
- if (!ctx)
- ossl_raise(eHMACError, NULL);
- RTYPEDDATA_DATA(obj) = ctx;
+ MakeHMAC(obj, klass, ctx);
+ HMAC_CTX_init(ctx);
return obj;
}
@@ -105,8 +100,8 @@ ossl_hmac_initialize(VALUE self, VALUE key, VALUE digest)
StringValue(key);
GetHMAC(self, ctx);
- HMAC_Init_ex(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
- ossl_evp_get_digestbyname(digest), NULL);
+ HMAC_Init(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
+ GetDigestPtr(digest));
return self;
}
@@ -120,10 +115,9 @@ ossl_hmac_copy(VALUE self, VALUE other)
if (self == other) return self;
GetHMAC(self, ctx1);
- GetHMAC(other, ctx2);
+ SafeGetHMAC(other, ctx2);
- if (!HMAC_CTX_copy(ctx1, ctx2))
- ossl_raise(eHMACError, "HMAC_CTX_copy");
+ HMAC_CTX_copy(ctx1, ctx2);
return self;
}
@@ -131,7 +125,7 @@ ossl_hmac_copy(VALUE self, VALUE other)
* call-seq:
* hmac.update(string) -> self
*
- * Returns _hmac_ updated with the message to be authenticated.
+ * Returns +self+ updated with the message to be authenticated.
* Can be called repeatedly with chunks of the message.
*
* === Example
@@ -158,21 +152,18 @@ ossl_hmac_update(VALUE self, VALUE data)
}
static void
-hmac_final(HMAC_CTX *ctx, unsigned char *buf, unsigned int *buf_len)
+hmac_final(HMAC_CTX *ctx, unsigned char **buf, unsigned int *buf_len)
{
- HMAC_CTX *final;
-
- final = HMAC_CTX_new();
- if (!final)
- ossl_raise(eHMACError, "HMAC_CTX_new");
+ HMAC_CTX final;
- if (!HMAC_CTX_copy(final, ctx)) {
- HMAC_CTX_free(final);
- ossl_raise(eHMACError, "HMAC_CTX_copy");
+ HMAC_CTX_copy(&final, ctx);
+ if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
+ HMAC_CTX_cleanup(&final);
+ OSSL_Debug("Allocating %d mem", HMAC_size(&final));
+ ossl_raise(eHMACError, "Cannot allocate memory for hmac");
}
-
- HMAC_Final(final, buf, buf_len);
- HMAC_CTX_free(final);
+ HMAC_Final(&final, *buf, buf_len);
+ HMAC_CTX_cleanup(&final);
}
/*
@@ -182,25 +173,26 @@ hmac_final(HMAC_CTX *ctx, unsigned char *buf, unsigned int *buf_len)
* Returns the authentication code an instance represents as a binary string.
*
* === Example
- * instance = OpenSSL::HMAC.new('key', OpenSSL::Digest.new('sha1'))
- * #=> f42bb0eeb018ebbd4597ae7213711ec60760843f
- * instance.digest
- * #=> "\xF4+\xB0\xEE\xB0\x18\xEB\xBDE\x97\xAEr\x13q\x1E\xC6\a`\x84?"
+ *
+ * instance = OpenSSL::HMAC.new('key', OpenSSL::Digest.new('sha1'))
+ * #=> f42bb0eeb018ebbd4597ae7213711ec60760843f
+ * instance.digest
+ * #=> "\xF4+\xB0\xEE\xB0\x18\xEB\xBDE\x97\xAEr\x13q\x1E\xC6\a`\x84?"
+ *
*/
static VALUE
ossl_hmac_digest(VALUE self)
{
HMAC_CTX *ctx;
+ unsigned char *buf;
unsigned int buf_len;
- VALUE ret;
+ VALUE digest;
GetHMAC(self, ctx);
- ret = rb_str_new(NULL, EVP_MAX_MD_SIZE);
- hmac_final(ctx, (unsigned char *)RSTRING_PTR(ret), &buf_len);
- assert(buf_len <= EVP_MAX_MD_SIZE);
- rb_str_set_len(ret, buf_len);
+ hmac_final(ctx, &buf, &buf_len);
+ digest = ossl_buf2str((char *)buf, buf_len);
- return ret;
+ return digest;
}
/*
@@ -209,28 +201,34 @@ ossl_hmac_digest(VALUE self)
*
* Returns the authentication code an instance represents as a hex-encoded
* string.
+ *
*/
static VALUE
ossl_hmac_hexdigest(VALUE self)
{
HMAC_CTX *ctx;
- unsigned char buf[EVP_MAX_MD_SIZE];
+ unsigned char *buf;
+ char *hexbuf;
unsigned int buf_len;
- VALUE ret;
+ VALUE hexdigest;
GetHMAC(self, ctx);
- hmac_final(ctx, buf, &buf_len);
- ret = rb_str_new(NULL, buf_len * 2);
- ossl_bin2hex(buf, RSTRING_PTR(ret), buf_len);
+ hmac_final(ctx, &buf, &buf_len);
+ if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * (int)buf_len) {
+ OPENSSL_free(buf);
+ ossl_raise(eHMACError, "Memory alloc error");
+ }
+ OPENSSL_free(buf);
+ hexdigest = ossl_buf2str(hexbuf, 2 * buf_len);
- return ret;
+ return hexdigest;
}
/*
* call-seq:
* hmac.reset -> self
*
- * Returns _hmac_ as it was when it was first initialized, with all processed
+ * Returns +self+ as it was when it was first initialized, with all processed
* data cleared from it.
*
* === Example
@@ -251,7 +249,7 @@ ossl_hmac_reset(VALUE self)
HMAC_CTX *ctx;
GetHMAC(self, ctx);
- HMAC_Init_ex(ctx, NULL, 0, NULL, NULL);
+ HMAC_Init(ctx, NULL, 0, NULL);
return self;
}
@@ -260,16 +258,16 @@ ossl_hmac_reset(VALUE self)
* call-seq:
* HMAC.digest(digest, key, data) -> aString
*
- * Returns the authentication code as a binary string. The _digest_ parameter
- * specifies the digest algorithm to use. This may be a String representing
- * the algorithm name or an instance of OpenSSL::Digest.
+ * Returns the authentication code as a binary string. The +digest+ parameter
+ * must be an instance of OpenSSL::Digest.
*
* === Example
*
* key = 'key'
* data = 'The quick brown fox jumps over the lazy dog'
+ * digest = OpenSSL::Digest.new('sha1')
*
- * hmac = OpenSSL::HMAC.digest('sha1', key, data)
+ * hmac = OpenSSL::HMAC.digest(digest, key, data)
* #=> "\xDE|\x9B\x85\xB8\xB7\x8A\xA6\xBC\x8Az6\xF7\n\x90p\x1C\x9D\xB4\xD9"
*
*/
@@ -281,9 +279,8 @@ ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data)
StringValue(key);
StringValue(data);
- buf = HMAC(ossl_evp_get_digestbyname(digest), RSTRING_PTR(key),
- RSTRING_LENINT(key), (unsigned char *)RSTRING_PTR(data),
- RSTRING_LEN(data), NULL, &buf_len);
+ buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LENINT(key),
+ (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
return rb_str_new((const char *)buf, buf_len);
}
@@ -292,79 +289,51 @@ ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data)
* call-seq:
* HMAC.hexdigest(digest, key, data) -> aString
*
- * Returns the authentication code as a hex-encoded string. The _digest_
- * parameter specifies the digest algorithm to use. This may be a String
- * representing the algorithm name or an instance of OpenSSL::Digest.
+ * Returns the authentication code as a hex-encoded string. The +digest+
+ * parameter must be an instance of OpenSSL::Digest.
*
* === Example
*
* key = 'key'
* data = 'The quick brown fox jumps over the lazy dog'
+ * digest = OpenSSL::Digest.new('sha1')
*
- * hmac = OpenSSL::HMAC.hexdigest('sha1', key, data)
+ * hmac = OpenSSL::HMAC.hexdigest(digest, key, data)
* #=> "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"
*
*/
static VALUE
ossl_hmac_s_hexdigest(VALUE klass, VALUE digest, VALUE key, VALUE data)
{
- unsigned char buf[EVP_MAX_MD_SIZE];
+ unsigned char *buf;
+ char *hexbuf;
unsigned int buf_len;
- VALUE ret;
+ VALUE hexdigest;
StringValue(key);
StringValue(data);
- if (!HMAC(ossl_evp_get_digestbyname(digest), RSTRING_PTR(key),
- RSTRING_LENINT(key), (unsigned char *)RSTRING_PTR(data),
- RSTRING_LEN(data), buf, &buf_len))
- ossl_raise(eHMACError, "HMAC");
-
- ret = rb_str_new(NULL, buf_len * 2);
- ossl_bin2hex(buf, RSTRING_PTR(ret), buf_len);
+ buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LENINT(key),
+ (unsigned char *)RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
+ if (string2hex(buf, buf_len, &hexbuf, NULL) != 2 * (int)buf_len) {
+ ossl_raise(eHMACError, "Cannot convert buf to hexbuf");
+ }
+ hexdigest = ossl_buf2str(hexbuf, 2 * buf_len);
- return ret;
+ return hexdigest;
}
/*
* INIT
*/
void
-Init_ossl_hmac(void)
+Init_ossl_hmac()
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ /* :nodoc: */
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
- /*
- * Document-class: OpenSSL::HMAC
- *
- * OpenSSL::HMAC allows computing Hash-based Message Authentication Code
- * (HMAC). It is a type of message authentication code (MAC) involving a
- * hash function in combination with a key. HMAC can be used to verify the
- * integrity of a message as well as the authenticity.
- *
- * OpenSSL::HMAC has a similar interface to OpenSSL::Digest.
- *
- * === HMAC-SHA256 using one-shot interface
- *
- * key = "key"
- * data = "message-to-be-authenticated"
- * mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
- * #=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
- *
- * === HMAC-SHA256 using incremental interface
- *
- * data1 = File.read("file1")
- * data2 = File.read("file2")
- * key = "key"
- * digest = OpenSSL::Digest::SHA256.new
- * hmac = OpenSSL::HMAC.new(key, digest)
- * hmac << data1
- * hmac << data2
- * mac = hmac.digest
- */
eHMACError = rb_define_class_under(mOSSL, "HMACError", eOSSLError);
cHMAC = rb_define_class_under(mOSSL, "HMAC", rb_cObject);
@@ -374,7 +343,7 @@ Init_ossl_hmac(void)
rb_define_singleton_method(cHMAC, "hexdigest", ossl_hmac_s_hexdigest, 3);
rb_define_method(cHMAC, "initialize", ossl_hmac_initialize, 2);
- rb_define_method(cHMAC, "initialize_copy", ossl_hmac_copy, 1);
+ rb_define_copy_func(cHMAC, ossl_hmac_copy);
rb_define_method(cHMAC, "reset", ossl_hmac_reset, 0);
rb_define_method(cHMAC, "update", ossl_hmac_update, 1);
@@ -388,7 +357,7 @@ Init_ossl_hmac(void)
#else /* NO_HMAC */
# warning >>> OpenSSL is compiled without HMAC support <<<
void
-Init_ossl_hmac(void)
+Init_ossl_hmac()
{
rb_warning("HMAC is not available: OpenSSL is compiled without HMAC.");
}
diff --git a/ext/openssl/ossl_hmac.h b/ext/openssl/ossl_hmac.h
index 7c51f4722d..1a2978b39a 100644
--- a/ext/openssl/ossl_hmac.h
+++ b/ext/openssl/ossl_hmac.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_HMAC_H_)
diff --git a/ext/openssl/ossl_kdf.c b/ext/openssl/ossl_kdf.c
deleted file mode 100644
index ee124718b5..0000000000
--- a/ext/openssl/ossl_kdf.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Ruby/OpenSSL Project
- * Copyright (C) 2007, 2017 Ruby/OpenSSL Project Authors
- */
-#include "ossl.h"
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
-# include <openssl/kdf.h>
-#endif
-
-static VALUE mKDF, eKDF;
-
-/*
- * call-seq:
- * KDF.pbkdf2_hmac(pass, salt:, iterations:, length:, hash:) -> aString
- *
- * PKCS #5 PBKDF2 (Password-Based Key Derivation Function 2) in combination
- * with HMAC. Takes _pass_, _salt_ and _iterations_, and then derives a key
- * of _length_ bytes.
- *
- * For more information about PBKDF2, see RFC 2898 Section 5.2
- * (https://tools.ietf.org/html/rfc2898#section-5.2).
- *
- * === Parameters
- * pass :: The passphrase.
- * salt :: The salt. Salts prevent attacks based on dictionaries of common
- * passwords and attacks based on rainbow tables. It is a public
- * value that can be safely stored along with the password (e.g.
- * if the derived value is used for password storage).
- * iterations :: The iteration count. This provides the ability to tune the
- * algorithm. It is better to use the highest count possible for
- * the maximum resistance to brute-force attacks.
- * length :: The desired length of the derived key in octets.
- * hash :: The hash algorithm used with HMAC for the PRF. May be a String
- * representing the algorithm name, or an instance of
- * OpenSSL::Digest.
- */
-static VALUE
-kdf_pbkdf2_hmac(int argc, VALUE *argv, VALUE self)
-{
- VALUE pass, salt, opts, kwargs[4], str;
- static ID kwargs_ids[4];
- int iters, len;
- const EVP_MD *md;
-
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("salt");
- kwargs_ids[1] = rb_intern_const("iterations");
- kwargs_ids[2] = rb_intern_const("length");
- kwargs_ids[3] = rb_intern_const("hash");
- }
- rb_scan_args(argc, argv, "1:", &pass, &opts);
- rb_get_kwargs(opts, kwargs_ids, 4, 0, kwargs);
-
- StringValue(pass);
- salt = StringValue(kwargs[0]);
- iters = NUM2INT(kwargs[1]);
- len = NUM2INT(kwargs[2]);
- md = ossl_evp_get_digestbyname(kwargs[3]);
-
- str = rb_str_new(0, len);
- if (!PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LENINT(pass),
- (unsigned char *)RSTRING_PTR(salt),
- RSTRING_LENINT(salt), iters, md, len,
- (unsigned char *)RSTRING_PTR(str)))
- ossl_raise(eKDF, "PKCS5_PBKDF2_HMAC");
-
- return str;
-}
-
-#if defined(HAVE_EVP_PBE_SCRYPT)
-/*
- * call-seq:
- * KDF.scrypt(pass, salt:, N:, r:, p:, length:) -> aString
- *
- * Derives a key from _pass_ using given parameters with the scrypt
- * password-based key derivation function. The result can be used for password
- * storage.
- *
- * scrypt is designed to be memory-hard and more secure against brute-force
- * attacks using custom hardwares than alternative KDFs such as PBKDF2 or
- * bcrypt.
- *
- * The keyword arguments _N_, _r_ and _p_ can be used to tune scrypt. RFC 7914
- * (published on 2016-08, https://tools.ietf.org/html/rfc7914#section-2) states
- * that using values r=8 and p=1 appears to yield good results.
- *
- * See RFC 7914 (https://tools.ietf.org/html/rfc7914) for more information.
- *
- * === Parameters
- * pass :: Passphrase.
- * salt :: Salt.
- * N :: CPU/memory cost parameter. This must be a power of 2.
- * r :: Block size parameter.
- * p :: Parallelization parameter.
- * length :: Length in octets of the derived key.
- *
- * === Example
- * pass = "password"
- * salt = SecureRandom.random_bytes(16)
- * dk = OpenSSL::KDF.scrypt(pass, salt: salt, N: 2**14, r: 8, p: 1, length: 32)
- * p dk #=> "\xDA\xE4\xE2...\x7F\xA1\x01T"
- */
-static VALUE
-kdf_scrypt(int argc, VALUE *argv, VALUE self)
-{
- VALUE pass, salt, opts, kwargs[5], str;
- static ID kwargs_ids[5];
- size_t len;
- uint64_t N, r, p, maxmem;
-
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("salt");
- kwargs_ids[1] = rb_intern_const("N");
- kwargs_ids[2] = rb_intern_const("r");
- kwargs_ids[3] = rb_intern_const("p");
- kwargs_ids[4] = rb_intern_const("length");
- }
- rb_scan_args(argc, argv, "1:", &pass, &opts);
- rb_get_kwargs(opts, kwargs_ids, 5, 0, kwargs);
-
- StringValue(pass);
- salt = StringValue(kwargs[0]);
- N = NUM2UINT64T(kwargs[1]);
- r = NUM2UINT64T(kwargs[2]);
- p = NUM2UINT64T(kwargs[3]);
- len = NUM2LONG(kwargs[4]);
- /*
- * OpenSSL uses 32MB by default (if zero is specified), which is too small.
- * Let's not limit memory consumption but just let malloc() fail inside
- * OpenSSL. The amount is controllable by other parameters.
- */
- maxmem = SIZE_MAX;
-
- str = rb_str_new(0, len);
- if (!EVP_PBE_scrypt(RSTRING_PTR(pass), RSTRING_LEN(pass),
- (unsigned char *)RSTRING_PTR(salt), RSTRING_LEN(salt),
- N, r, p, maxmem, (unsigned char *)RSTRING_PTR(str), len))
- ossl_raise(eKDF, "EVP_PBE_scrypt");
-
- return str;
-}
-#endif
-
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
-/*
- * call-seq:
- * KDF.hkdf(ikm, salt:, info:, length:, hash:) -> String
- *
- * HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as specified in
- * {RFC 5869}[https://tools.ietf.org/html/rfc5869].
- *
- * New in OpenSSL 1.1.0.
- *
- * === Parameters
- * _ikm_::
- * The input keying material.
- * _salt_::
- * The salt.
- * _info_::
- * The context and application specific information.
- * _length_::
- * The output length in octets. Must be <= <tt>255 * HashLen</tt>, where
- * HashLen is the length of the hash function output in octets.
- * _hash_::
- * The hash function.
- */
-static VALUE
-kdf_hkdf(int argc, VALUE *argv, VALUE self)
-{
- VALUE ikm, salt, info, opts, kwargs[4], str;
- static ID kwargs_ids[4];
- int saltlen, ikmlen, infolen;
- size_t len;
- const EVP_MD *md;
- EVP_PKEY_CTX *pctx;
-
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("salt");
- kwargs_ids[1] = rb_intern_const("info");
- kwargs_ids[2] = rb_intern_const("length");
- kwargs_ids[3] = rb_intern_const("hash");
- }
- rb_scan_args(argc, argv, "1:", &ikm, &opts);
- rb_get_kwargs(opts, kwargs_ids, 4, 0, kwargs);
-
- StringValue(ikm);
- ikmlen = RSTRING_LENINT(ikm);
- salt = StringValue(kwargs[0]);
- saltlen = RSTRING_LENINT(salt);
- info = StringValue(kwargs[1]);
- infolen = RSTRING_LENINT(info);
- len = (size_t)NUM2LONG(kwargs[2]);
- if (len > LONG_MAX)
- rb_raise(rb_eArgError, "length must be non-negative");
- md = ossl_evp_get_digestbyname(kwargs[3]);
-
- str = rb_str_new(NULL, (long)len);
- pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL);
- if (!pctx)
- ossl_raise(eKDF, "EVP_PKEY_CTX_new_id");
- if (EVP_PKEY_derive_init(pctx) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_derive_init");
- }
- if (EVP_PKEY_CTX_set_hkdf_md(pctx, md) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_CTX_set_hkdf_md");
- }
- if (EVP_PKEY_CTX_set1_hkdf_salt(pctx, (unsigned char *)RSTRING_PTR(salt),
- saltlen) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_CTX_set_hkdf_salt");
- }
- if (EVP_PKEY_CTX_set1_hkdf_key(pctx, (unsigned char *)RSTRING_PTR(ikm),
- ikmlen) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_CTX_set_hkdf_key");
- }
- if (EVP_PKEY_CTX_add1_hkdf_info(pctx, (unsigned char *)RSTRING_PTR(info),
- infolen) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_CTX_set_hkdf_info");
- }
- if (EVP_PKEY_derive(pctx, (unsigned char *)RSTRING_PTR(str), &len) <= 0) {
- EVP_PKEY_CTX_free(pctx);
- ossl_raise(eKDF, "EVP_PKEY_derive");
- }
- rb_str_set_len(str, (long)len);
- EVP_PKEY_CTX_free(pctx);
-
- return str;
-}
-#endif
-
-void
-Init_ossl_kdf(void)
-{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
- /*
- * Document-module: OpenSSL::KDF
- *
- * Provides functionality of various KDFs (key derivation function).
- *
- * KDF is typically used for securely deriving arbitrary length symmetric
- * keys to be used with an OpenSSL::Cipher from passwords. Another use case
- * is for storing passwords: Due to the ability to tweak the effort of
- * computation by increasing the iteration count, computation can be slowed
- * down artificially in order to render possible attacks infeasible.
- *
- * Currently, OpenSSL::KDF provides implementations for the following KDF:
- *
- * * PKCS #5 PBKDF2 (Password-Based Key Derivation Function 2) in
- * combination with HMAC
- * * scrypt
- * * HKDF
- *
- * == Examples
- * === Generating a 128 bit key for a Cipher (e.g. AES)
- * pass = "secret"
- * salt = OpenSSL::Random.random_bytes(16)
- * iter = 20_000
- * key_len = 16
- * key = OpenSSL::KDF.pbkdf2_hmac(pass, salt: salt, iterations: iter,
- * length: key_len, hash: "sha1")
- *
- * === Storing Passwords
- * pass = "secret"
- * # store this with the generated value
- * salt = OpenSSL::Random.random_bytes(16)
- * iter = 20_000
- * hash = OpenSSL::Digest::SHA256.new
- * len = hash.digest_length
- * # the final value to be stored
- * value = OpenSSL::KDF.pbkdf2_hmac(pass, salt: salt, iterations: iter,
- * length: len, hash: hash)
- *
- * == Important Note on Checking Passwords
- * When comparing passwords provided by the user with previously stored
- * values, a common mistake made is comparing the two values using "==".
- * Typically, "==" short-circuits on evaluation, and is therefore
- * vulnerable to timing attacks. The proper way is to use a method that
- * always takes the same amount of time when comparing two values, thus
- * not leaking any information to potential attackers. To compare two
- * values, the following could be used:
- *
- * def eql_time_cmp(a, b)
- * unless a.length == b.length
- * return false
- * end
- * cmp = b.bytes
- * result = 0
- * a.bytes.each_with_index {|c,i|
- * result |= c ^ cmp[i]
- * }
- * result == 0
- * end
- *
- * Please note that the premature return in case of differing lengths
- * typically does not leak valuable information - when using PBKDF2, the
- * length of the values to be compared is of fixed size.
- */
- mKDF = rb_define_module_under(mOSSL, "KDF");
- /*
- * Generic exception class raised if an error occurs in OpenSSL::KDF module.
- */
- eKDF = rb_define_class_under(mKDF, "KDFError", eOSSLError);
-
- rb_define_module_function(mKDF, "pbkdf2_hmac", kdf_pbkdf2_hmac, -1);
-#if defined(HAVE_EVP_PBE_SCRYPT)
- rb_define_module_function(mKDF, "scrypt", kdf_scrypt, -1);
-#endif
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
- rb_define_module_function(mKDF, "hkdf", kdf_hkdf, -1);
-#endif
-}
diff --git a/ext/openssl/ossl_kdf.h b/ext/openssl/ossl_kdf.h
deleted file mode 100644
index b6503f8d9d..0000000000
--- a/ext/openssl/ossl_kdf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if !defined(OSSL_KDF_H)
-#define OSSL_KDF_H
-
-void Init_ossl_kdf(void);
-
-#endif
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index 6f61e61bf5..b80984cfee 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -1,24 +1,23 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewSPKI(klass) \
- TypedData_Wrap_Struct((klass), &ossl_netscape_spki_type, 0)
-#define SetSPKI(obj, spki) do { \
+#define WrapSPKI(klass, obj, spki) do { \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (spki); \
+ (obj) = Data_Wrap_Struct((klass), 0, NETSCAPE_SPKI_free, (spki)); \
} while (0)
#define GetSPKI(obj, spki) do { \
- TypedData_Get_Struct((obj), NETSCAPE_SPKI, &ossl_netscape_spki_type, (spki)); \
+ Data_Get_Struct((obj), NETSCAPE_SPKI, (spki)); \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
@@ -38,32 +37,16 @@ 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);
}
- SetSPKI(obj, spki);
+ WrapSPKI(klass, obj, spki);
return obj;
}
@@ -73,7 +56,7 @@ ossl_spki_alloc(VALUE klass)
* SPKI.new([request]) => spki
*
* === Parameters
- * * _request_ - optional raw request, either in PEM or DER format.
+ * * +request+ - optional raw request, either in PEM or DER format.
*/
static VALUE
ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
@@ -86,15 +69,15 @@ ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
StringValue(buffer);
- if (!(spki = NETSCAPE_SPKI_b64_decode(RSTRING_PTR(buffer), RSTRING_LENINT(buffer)))) {
- ossl_clear_error();
+ if (!(spki = NETSCAPE_SPKI_b64_decode(RSTRING_PTR(buffer), -1))) {
p = (unsigned char *)RSTRING_PTR(buffer);
if (!(spki = d2i_NETSCAPE_SPKI(NULL, &p, RSTRING_LEN(buffer)))) {
ossl_raise(eSPKIError, NULL);
}
}
NETSCAPE_SPKI_free(DATA_PTR(self));
- SetSPKI(self, spki);
+ DATA_PTR(self) = spki;
+ ERR_clear_error();
return self;
}
@@ -159,6 +142,8 @@ ossl_spki_print(VALUE self)
{
NETSCAPE_SPKI *spki;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetSPKI(self, spki);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -168,8 +153,11 @@ ossl_spki_print(VALUE self)
BIO_free(out);
ossl_raise(eSPKIError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
/*
@@ -198,7 +186,7 @@ ossl_spki_get_public_key(VALUE self)
* spki.public_key = pub => pkey
*
* === Parameters
- * * _pub_ - the public key to be set for this instance
+ * * +pub+ - the public key to be set for this instance
*
* Sets the public key to be associated with the SPKI, an instance of
* OpenSSL::PKey. This should be the public key corresponding to the
@@ -208,13 +196,12 @@ static VALUE
ossl_spki_set_public_key(VALUE self, VALUE key)
{
NETSCAPE_SPKI *spki;
- EVP_PKEY *pkey;
GetSPKI(self, spki);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- if (!NETSCAPE_SPKI_set_pubkey(spki, pkey))
- ossl_raise(eSPKIError, "NETSCAPE_SPKI_set_pubkey");
+ if (!NETSCAPE_SPKI_set_pubkey(spki, GetPKeyPtr(key))) { /* NO NEED TO DUP */
+ ossl_raise(eSPKIError, NULL);
+ }
+
return key;
}
@@ -244,7 +231,7 @@ ossl_spki_get_challenge(VALUE self)
* spki.challenge = str => string
*
* === Parameters
- * * _str_ - the challenge string to be set for this instance
+ * * +str+ - the challenge string to be set for this instance
*
* Sets the challenge to be associated with the SPKI. May be used by the
* server, e.g. to prevent replay.
@@ -269,8 +256,8 @@ ossl_spki_set_challenge(VALUE self, VALUE str)
* spki.sign(key, digest) => spki
*
* === Parameters
- * * _key_ - the private key to be used for signing this instance
- * * _digest_ - the digest to be used for signing this instance
+ * * +key+ - the private key to be used for signing this instance
+ * * +digest+ - the digest to be used for signing this instance
*
* To sign an SPKI, the private key corresponding to the public key set
* for this instance should be used, in addition to a digest algorithm in
@@ -285,7 +272,7 @@ ossl_spki_sign(VALUE self, VALUE key, VALUE digest)
const EVP_MD *md;
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ md = GetDigestPtr(digest);
GetSPKI(self, spki);
if (!NETSCAPE_SPKI_sign(spki, pkey, md)) {
ossl_raise(eSPKIError, NULL);
@@ -299,7 +286,7 @@ ossl_spki_sign(VALUE self, VALUE key, VALUE digest)
* spki.verify(key) => boolean
*
* === Parameters
- * * _key_ - the public key to be used for verifying the SPKI signature
+ * * +key+ - the public key to be used for verifying the SPKI signature
*
* Returns +true+ if the signature is valid, +false+ otherwise. To verify an
* SPKI, the public key contained within the SPKI should be used.
@@ -308,25 +295,22 @@ static VALUE
ossl_spki_verify(VALUE self, VALUE key)
{
NETSCAPE_SPKI *spki;
- EVP_PKEY *pkey;
GetSPKI(self, spki);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- switch (NETSCAPE_SPKI_verify(spki, pkey)) {
- case 0:
- ossl_clear_error();
+ switch (NETSCAPE_SPKI_verify(spki, GetPKeyPtr(key))) { /* NO NEED TO DUP */
+ case 0:
return Qfalse;
- case 1:
+ case 1:
return Qtrue;
- default:
- ossl_raise(eSPKIError, "NETSCAPE_SPKI_verify");
+ default:
+ ossl_raise(eSPKIError, NULL);
}
+ return Qnil; /* dummy */
}
/* Document-class: OpenSSL::Netscape::SPKI
*
- * A Simple Public Key Infrastructure implementation (pronounced "spooky").
+ * A Simple Public Key Infrastructure implementation (pronounced "spookey").
* The structure is defined as
* PublicKeyAndChallenge ::= SEQUENCE {
* spki SubjectPublicKeyInfo,
@@ -352,7 +336,7 @@ ossl_spki_verify(VALUE self, VALUE key)
* spki.public_key = key.public_key
* spki.sign(key, OpenSSL::Digest::SHA256.new)
* #send a request containing this to a server generating a certificate
- * === Verifying an SPKI request
+ * === Verifiying an SPKI request
* request = #...
* spki = OpenSSL::Netscape::SPKI.new request
* unless spki.verify(spki.public_key)
@@ -376,11 +360,10 @@ ossl_spki_verify(VALUE self, VALUE key)
*/
void
-Init_ossl_ns_spki(void)
+Init_ossl_ns_spki()
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
mNetscape = rb_define_module_under(mOSSL, "Netscape");
@@ -403,3 +386,4 @@ Init_ossl_ns_spki(void)
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 62ba8cb163..9977035a9c 100644
--- a/ext/openssl/ossl_ns_spki.h
+++ b/ext/openssl/ossl_ns_spki.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_NS_SPKI_H_)
@@ -17,3 +18,4 @@ 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 c0237791da..c959379324 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -1,158 +1,85 @@
/*
+ * $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 licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#if !defined(OPENSSL_NO_OCSP)
+#if defined(OSSL_OCSP_ENABLED)
-#define NewOCSPReq(klass) \
- TypedData_Wrap_Struct((klass), &ossl_ocsp_request_type, 0)
-#define SetOCSPReq(obj, req) do { \
+#define WrapOCSPReq(klass, obj, req) do { \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
- RTYPEDDATA_DATA(obj) = (req); \
+ (obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
} while (0)
#define GetOCSPReq(obj, req) do { \
- TypedData_Get_Struct((obj), OCSP_REQUEST, &ossl_ocsp_request_type, (req)); \
+ Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPReq(obj, req) do { \
+ OSSL_Check_Kind((obj), cOCSPReq); \
+ GetOCSPReq((obj), (req)); \
+} while (0)
-#define NewOCSPRes(klass) \
- TypedData_Wrap_Struct((klass), &ossl_ocsp_response_type, 0)
-#define SetOCSPRes(obj, res) do { \
+#define WrapOCSPRes(klass, obj, res) do { \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
- RTYPEDDATA_DATA(obj) = (res); \
+ (obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \
} while (0)
#define GetOCSPRes(obj, res) do { \
- TypedData_Get_Struct((obj), OCSP_RESPONSE, &ossl_ocsp_response_type, (res)); \
+ Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPRes(obj, res) do { \
+ OSSL_Check_Kind((obj), cOCSPRes); \
+ GetOCSPRes((obj), (res)); \
+} while (0)
-#define NewOCSPBasicRes(klass) \
- TypedData_Wrap_Struct((klass), &ossl_ocsp_basicresp_type, 0)
-#define SetOCSPBasicRes(obj, res) do { \
+#define WrapOCSPBasicRes(klass, obj, res) do { \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
- RTYPEDDATA_DATA(obj) = (res); \
+ (obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
} while (0)
#define GetOCSPBasicRes(obj, res) do { \
- TypedData_Get_Struct((obj), OCSP_BASICRESP, &ossl_ocsp_basicresp_type, (res)); \
+ Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
-
-#define NewOCSPSingleRes(klass) \
- TypedData_Wrap_Struct((klass), &ossl_ocsp_singleresp_type, 0)
-#define SetOCSPSingleRes(obj, res) do { \
- if(!(res)) ossl_raise(rb_eRuntimeError, "SingleResponse wasn't initialized!"); \
- RTYPEDDATA_DATA(obj) = (res); \
-} while (0)
-#define GetOCSPSingleRes(obj, res) do { \
- TypedData_Get_Struct((obj), OCSP_SINGLERESP, &ossl_ocsp_singleresp_type, (res)); \
- if(!(res)) ossl_raise(rb_eRuntimeError, "SingleResponse wasn't initialized!"); \
+#define SafeGetOCSPBasicRes(obj, res) do { \
+ OSSL_Check_Kind((obj), cOCSPBasicRes); \
+ GetOCSPBasicRes((obj), (res)); \
} while (0)
-#define NewOCSPCertId(klass) \
- TypedData_Wrap_Struct((klass), &ossl_ocsp_certid_type, 0)
-#define SetOCSPCertId(obj, cid) do { \
+#define WrapOCSPCertId(klass, obj, cid) do { \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
- RTYPEDDATA_DATA(obj) = (cid); \
+ (obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \
} while (0)
#define GetOCSPCertId(obj, cid) do { \
- TypedData_Get_Struct((obj), OCSP_CERTID, &ossl_ocsp_certid_type, (cid)); \
+ Data_Get_Struct((obj), OCSP_CERTID, (cid)); \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPCertId(obj, cid) do { \
+ OSSL_Check_Kind((obj), cOCSPCertId); \
+ GetOCSPCertId((obj), (cid)); \
+} while (0)
VALUE mOCSP;
VALUE eOCSPError;
VALUE cOCSPReq;
VALUE cOCSPRes;
VALUE cOCSPBasicRes;
-VALUE cOCSPSingleRes;
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_singleresp_free(void *ptr)
-{
- OCSP_SINGLERESP_free(ptr);
-}
-
-static const rb_data_type_t ossl_ocsp_singleresp_type = {
- "OpenSSL/OCSP/SINGLERESP",
- {
- 0, ossl_ocsp_singleresp_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 = NewOCSPCertId(cOCSPCertId);
- SetOCSPCertId(obj, cid);
+ VALUE obj;
+ WrapOCSPCertId(cOCSPCertId, obj, cid);
return obj;
}
@@ -165,60 +92,39 @@ ossl_ocspreq_alloc(VALUE klass)
OCSP_REQUEST *req;
VALUE obj;
- obj = NewOCSPReq(klass);
if (!(req = OCSP_REQUEST_new()))
ossl_raise(eOCSPError, NULL);
- SetOCSPReq(obj, req);
+ WrapOCSPReq(klass, obj, req);
return obj;
}
-static VALUE
-ossl_ocspreq_initialize_copy(VALUE self, VALUE other)
-{
- OCSP_REQUEST *req, *req_old, *req_new;
-
- rb_check_frozen(self);
- GetOCSPReq(self, req_old);
- GetOCSPReq(other, req);
-
- req_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_REQUEST), req);
- if (!req_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- SetOCSPReq(self, req_new);
- OCSP_REQUEST_free(req_old);
-
- return self;
-}
-
/*
* 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.
+ * from a +request_der+ string.
*/
static VALUE
ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg;
- OCSP_REQUEST *req, *req_new;
const unsigned char *p;
rb_scan_args(argc, argv, "01", &arg);
if(!NIL_P(arg)){
- GetOCSPReq(self, req);
+ OCSP_REQUEST *req = DATA_PTR(self), *x;
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
- p = (unsigned char *)RSTRING_PTR(arg);
- req_new = d2i_OCSP_REQUEST(NULL, &p, RSTRING_LEN(arg));
- if (!req_new)
- ossl_raise(eOCSPError, "d2i_OCSP_REQUEST");
- SetOCSPReq(self, req_new);
- OCSP_REQUEST_free(req);
+ p = (unsigned char*)RSTRING_PTR(arg);
+ x = d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg));
+ DATA_PTR(self) = req;
+ if(!x){
+ ossl_raise(eOCSPError, "cannot load DER encoded request");
+ }
}
return self;
@@ -228,7 +134,7 @@ ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE 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
+ * 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
@@ -261,7 +167,7 @@ ossl_ocspreq_add_nonce(int argc, VALUE *argv, VALUE self)
* call-seq:
* request.check_nonce(response) -> result
*
- * Checks the nonce validity for this request and _response_.
+ * Checks the nonce validity for this request and +response+.
*
* The return value is one of the following:
*
@@ -271,7 +177,7 @@ ossl_ocspreq_add_nonce(int argc, VALUE *argv, VALUE self)
* 2 :: nonces both absent.
* 3 :: nonce present in response only.
*
- * For most responses, clients can check _result_ > 0. If a responder doesn't
+ * 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.
*/
@@ -284,7 +190,7 @@ ossl_ocspreq_check_nonce(VALUE self, VALUE basic_resp)
int res;
GetOCSPReq(self, req);
- GetOCSPBasicRes(basic_resp, bs);
+ SafeGetOCSPBasicRes(basic_resp, bs);
res = OCSP_check_nonce(req, bs);
return INT2NUM(res);
@@ -294,24 +200,19 @@ ossl_ocspreq_check_nonce(VALUE self, VALUE basic_resp)
* call-seq:
* request.add_certid(certificate_id) -> request
*
- * Adds _certificate_id_ to the request.
+ * Adds +certificate_id+ to the request.
*/
static VALUE
ossl_ocspreq_add_certid(VALUE self, VALUE certid)
{
OCSP_REQUEST *req;
- OCSP_CERTID *id, *id_new;
+ OCSP_CERTID *id;
GetOCSPReq(self, req);
GetOCSPCertId(certid, id);
-
- 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");
- }
+ if(!OCSP_request_add0_id(req, OCSP_CERTID_dup(id)))
+ ossl_raise(eOCSPError, NULL);
return self;
}
@@ -337,10 +238,9 @@ 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);
- SetOCSPCertId(tmp, id);
+ WrapOCSPCertId(cOCSPCertId, tmp, id);
rb_ary_push(ary, tmp);
}
@@ -349,64 +249,49 @@ ossl_ocspreq_get_certid(VALUE self)
/*
* call-seq:
- * request.sign(cert, key, certs = nil, flags = 0, digest = nil) -> self
+ * 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 _cert_, _key_ and optional _digest_. If
- * _digest_ is not specified, SHA-1 is used. _certs_ is an optional Array of
- * additional certificates which are included in the request in addition to
- * the signer certificate. Note that if _certs_ is +nil+ or not given, flag
- * OpenSSL::OCSP::NOCERTS is enabled. Pass an empty array to include only the
- * signer certificate.
- *
- * _flags_ is a bitwise OR of the following constants:
- *
- * OpenSSL::OCSP::NOCERTS::
- * Don't include any certificates in the request. _certs_ will be ignored.
+ * 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)
{
- VALUE signer_cert, signer_key, certs, flags, digest;
+ VALUE signer_cert, signer_key, certs, flags;
OCSP_REQUEST *req;
X509 *signer;
EVP_PKEY *key;
- STACK_OF(X509) *x509s = NULL;
- unsigned long flg = 0;
- const EVP_MD *md;
+ STACK_OF(X509) *x509s;
+ unsigned long flg;
int ret;
- rb_scan_args(argc, argv, "23", &signer_cert, &signer_key, &certs, &flags, &digest);
- GetOCSPReq(self, req);
+ rb_scan_args(argc, argv, "22", &signer_cert, &signer_key, &certs, &flags);
signer = GetX509CertPtr(signer_cert);
key = GetPrivPKeyPtr(signer_key);
- if (!NIL_P(flags))
- flg = NUM2INT(flags);
- if (NIL_P(digest))
- md = EVP_sha1();
- else
- md = ossl_evp_get_digestbyname(digest);
- if (NIL_P(certs))
- flg |= OCSP_NOCERTS;
- else
- x509s = ossl_x509_ary2sk(certs);
-
- ret = OCSP_request_sign(req, signer, key, md, x509s, flg);
+ flg = NIL_P(flags) ? 0 : NUM2INT(flags);
+ if(NIL_P(certs)){
+ x509s = sk_X509_new_null();
+ flags |= OCSP_NOCERTS;
+ }
+ else x509s = ossl_x509_ary2sk(certs);
+ GetOCSPReq(self, req);
+ ret = OCSP_request_sign(req, signer, key, EVP_sha1(), x509s, flg);
sk_X509_pop_free(x509s, X509_free);
- if (!ret) ossl_raise(eOCSPError, NULL);
+ if(!ret) ossl_raise(eOCSPError, NULL);
return self;
}
/*
* call-seq:
- * request.verify(certificates, store, flags = 0) -> true or false
+ * request.verify(certificates, store) -> true or false
+ * request.verify(certificates, store, flags) -> true or false
*
- * Verifies this request using the given _certificates_ and _store_.
- * _certificates_ is an array of OpenSSL::X509::Certificate, _store_ is an
- * OpenSSL::X509::Store.
- *
- * Note that +false+ is returned if the request does not have a signature.
- * Use #signed? to check whether the request is signed or not.
+ * Verifies this request using the given +certificates+ and X509 +store+.
*/
static VALUE
@@ -419,16 +304,15 @@ ossl_ocspreq_verify(int argc, VALUE *argv, VALUE self)
int flg, result;
rb_scan_args(argc, argv, "21", &certs, &store, &flags);
- GetOCSPReq(self, req);
x509st = GetX509StorePtr(store);
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
x509s = ossl_x509_ary2sk(certs);
+ GetOCSPReq(self, req);
result = OCSP_request_verify(req, x509s, x509st, flg);
sk_X509_pop_free(x509s, X509_free);
- if (result <= 0)
- ossl_clear_error();
+ if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
- return result > 0 ? Qtrue : Qfalse;
+ return result ? Qtrue : Qfalse;
}
/*
@@ -456,29 +340,13 @@ ossl_ocspreq_to_der(VALUE self)
}
/*
- * call-seq:
- * request.signed? -> true or false
- *
- * Returns +true+ if the request is signed, +false+ otherwise. Note that the
- * validity of the signature is *not* checked. Use #verify to verify that.
- */
-static VALUE
-ossl_ocspreq_signed_p(VALUE self)
-{
- OCSP_REQUEST *req;
-
- GetOCSPReq(self, req);
- return OCSP_request_is_signed(req) ? Qtrue : Qfalse;
-}
-
-/*
* OCSP::Response
*/
/* call-seq:
* OpenSSL::OCSP::Response.create(status, basic_response = nil) -> response
*
- * Creates an OpenSSL::OCSP::Response from _status_ and _basic_response_.
+ * Creates an OpenSSL::OCSP::Response from +status+ and +basic_response+.
*/
static VALUE
@@ -491,10 +359,9 @@ 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);
- SetOCSPRes(obj, res);
+ WrapOCSPRes(klass, obj, res);
return obj;
}
@@ -505,60 +372,39 @@ ossl_ocspres_alloc(VALUE klass)
OCSP_RESPONSE *res;
VALUE obj;
- obj = NewOCSPRes(klass);
if(!(res = OCSP_RESPONSE_new()))
ossl_raise(eOCSPError, NULL);
- SetOCSPRes(obj, res);
+ WrapOCSPRes(klass, obj, res);
return obj;
}
-static VALUE
-ossl_ocspres_initialize_copy(VALUE self, VALUE other)
-{
- OCSP_RESPONSE *res, *res_old, *res_new;
-
- rb_check_frozen(self);
- GetOCSPRes(self, res_old);
- GetOCSPRes(other, res);
-
- res_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_RESPONSE), res);
- if (!res_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- SetOCSPRes(self, res_new);
- OCSP_RESPONSE_free(res_old);
-
- return self;
-}
-
/*
* 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.
+ * from a +response_der+ string.
*/
static VALUE
ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg;
- OCSP_RESPONSE *res, *res_new;
const unsigned char *p;
rb_scan_args(argc, argv, "01", &arg);
if(!NIL_P(arg)){
- GetOCSPRes(self, res);
+ OCSP_RESPONSE *res = DATA_PTR(self), *x;
arg = ossl_to_der_if_possible(arg);
StringValue(arg);
p = (unsigned char *)RSTRING_PTR(arg);
- res_new = d2i_OCSP_RESPONSE(NULL, &p, RSTRING_LEN(arg));
- if (!res_new)
- ossl_raise(eOCSPError, "d2i_OCSP_RESPONSE");
- SetOCSPRes(self, res_new);
- OCSP_RESPONSE_free(res);
+ x = d2i_OCSP_RESPONSE(&res, &p, RSTRING_LEN(arg));
+ DATA_PTR(self) = res;
+ if(!x){
+ ossl_raise(eOCSPError, "cannot load DER encoded response");
+ }
}
return self;
@@ -617,10 +463,9 @@ ossl_ocspres_get_basic(VALUE self)
VALUE ret;
GetOCSPRes(self, res);
- ret = NewOCSPBasicRes(cOCSPBasicRes);
if(!(bs = OCSP_response_get1_basic(res)))
return Qnil;
- SetOCSPBasicRes(ret, bs);
+ WrapOCSPBasicRes(cOCSPBasicRes, ret, bs);
return ret;
}
@@ -661,61 +506,23 @@ ossl_ocspbres_alloc(VALUE klass)
OCSP_BASICRESP *bs;
VALUE obj;
- obj = NewOCSPBasicRes(klass);
if(!(bs = OCSP_BASICRESP_new()))
ossl_raise(eOCSPError, NULL);
- SetOCSPBasicRes(obj, bs);
+ WrapOCSPBasicRes(klass, obj, bs);
return obj;
}
-static VALUE
-ossl_ocspbres_initialize_copy(VALUE self, VALUE other)
-{
- OCSP_BASICRESP *bs, *bs_old, *bs_new;
-
- rb_check_frozen(self);
- GetOCSPBasicRes(self, bs_old);
- GetOCSPBasicRes(other, bs);
-
- bs_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_BASICRESP), bs);
- if (!bs_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- SetOCSPBasicRes(self, bs_new);
- OCSP_BASICRESP_free(bs_old);
-
- return self;
-}
-
/*
* call-seq:
- * OpenSSL::OCSP::BasicResponse.new(der_string = nil) -> basic_response
+ * OpenSSL::OCSP::BasicResponse.new(*) -> basic_response
*
- * Creates a new BasicResponse. If _der_string_ is given, decodes _der_string_
- * as DER.
+ * Creates a new BasicResponse and ignores all arguments.
*/
static VALUE
ossl_ocspbres_initialize(int argc, VALUE *argv, VALUE self)
{
- VALUE arg;
- OCSP_BASICRESP *res, *res_new;
- const unsigned char *p;
-
- rb_scan_args(argc, argv, "01", &arg);
- if (!NIL_P(arg)) {
- GetOCSPBasicRes(self, res);
- arg = ossl_to_der_if_possible(arg);
- StringValue(arg);
- p = (unsigned char *)RSTRING_PTR(arg);
- res_new = d2i_OCSP_BASICRESP(NULL, &p, RSTRING_LEN(arg));
- if (!res_new)
- ossl_raise(eOCSPError, "d2i_OCSP_BASICRESP");
- SetOCSPBasicRes(self, res_new);
- OCSP_BASICRESP_free(res);
- }
-
return self;
}
@@ -723,7 +530,7 @@ ossl_ocspbres_initialize(int argc, VALUE *argv, VALUE self)
* call-seq:
* basic_response.copy_nonce(request) -> Integer
*
- * Copies the nonce from _request_ into this response. Returns 1 on success
+ * Copies the nonce from +request+ into this response. Returns 1 on success
* and 0 on failure.
*/
@@ -735,7 +542,7 @@ ossl_ocspbres_copy_nonce(VALUE self, VALUE request)
int ret;
GetOCSPBasicRes(self, bs);
- GetOCSPReq(request, req);
+ SafeGetOCSPReq(request, req);
ret = OCSP_copy_nonce(bs, req);
return INT2NUM(ret);
@@ -745,7 +552,7 @@ ossl_ocspbres_copy_nonce(VALUE self, VALUE request)
* call-seq:
* basic_response.add_nonce(nonce = nil)
*
- * Adds _nonce_ to this response. If no nonce was provided a random nonce
+ * Adds +nonce+ to this response. If no nonce was provided a random nonce
* will be added.
*/
@@ -771,49 +578,22 @@ ossl_ocspbres_add_nonce(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-add_status_convert_time(VALUE obj)
-{
- ASN1_TIME *time;
-
- if (RB_INTEGER_TYPE_P(obj))
- time = X509_gmtime_adj(NULL, NUM2INT(obj));
- else
- time = ossl_x509_time_adjust(NULL, obj);
-
- if (!time)
- ossl_raise(eOCSPError, NULL);
-
- return (VALUE)time;
-}
-
/*
* call-seq:
* basic_response.add_status(certificate_id, status, reason, revocation_time, this_update, next_update, extensions) -> basic_response
*
- * Adds a certificate status for _certificate_id_. _status_ is the status, and
- * must be one of these:
- *
- * - OpenSSL::OCSP::V_CERTSTATUS_GOOD
- * - OpenSSL::OCSP::V_CERTSTATUS_REVOKED
- * - OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN
- *
- * _reason_ and _revocation_time_ can be given only when _status_ is
- * OpenSSL::OCSP::V_CERTSTATUS_REVOKED. _reason_ describes the reason for the
- * revocation, and must be one of OpenSSL::OCSP::REVOKED_STATUS_* constants.
- * _revocation_time_ is the time when the certificate is revoked.
+ * Adds a validation +status+ (0 for revoked, 1 for success) to this
+ * response for +certificate_id+. +reason+ describes the reason for the
+ * revocation, if any.
*
- * _this_update_ and _next_update_ indicate the time at which ths status is
- * verified to be correct and the time at or before which newer information
- * will be available, respectively. _next_update_ is optional.
+ * 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_ is an Array of OpenSSL::X509::Extension to be included in the
- * SingleResponse. This is also optional.
- *
- * Note that the times, _revocation_time_, _this_update_ and _next_update_
- * can be specified in either of Integer or Time object. If they are Integer, it
- * is treated as the relative seconds from the current time.
+ * +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,
@@ -822,37 +602,36 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
OCSP_BASICRESP *bs;
OCSP_SINGLERESP *single;
OCSP_CERTID *id;
- ASN1_TIME *ths = NULL, *nxt = NULL, *rev = NULL;
- int st, rsn = 0, error = 0, rstatus = 0;
- long i;
+ int st, rsn;
+ ASN1_TIME *ths, *nxt, *rev;
+ int error, i, rstatus = 0;
VALUE tmp;
- GetOCSPBasicRes(self, bs);
- GetOCSPCertId(cid, id);
st = NUM2INT(status);
- if (!NIL_P(ext)) { /* All ext's members must be X509::Extension */
- ext = rb_check_array_type(ext);
+ rsn = NIL_P(status) ? 0 : NUM2INT(reason);
+ if(!NIL_P(ext)){
+ /* All ary's members should be X509Extension */
+ Check_Type(ext, T_ARRAY);
for (i = 0; i < RARRAY_LEN(ext); i++)
- OSSL_Check_Kind(RARRAY_AREF(ext, i), cX509Ext);
- }
-
- if (st == V_OCSP_CERTSTATUS_REVOKED) {
- rsn = NUM2INT(reason);
- tmp = rb_protect(add_status_convert_time, revtime, &rstatus);
- if (rstatus) goto err;
- rev = (ASN1_TIME *)tmp;
+ OSSL_Check_Kind(RARRAY_PTR(ext)[i], cX509Ext);
}
- tmp = rb_protect(add_status_convert_time, thisupd, &rstatus);
- if (rstatus) goto err;
- ths = (ASN1_TIME *)tmp;
-
- if (!NIL_P(nextupd)) {
- tmp = rb_protect(add_status_convert_time, nextupd, &rstatus);
- if (rstatus) goto err;
- nxt = (ASN1_TIME *)tmp;
+ error = 0;
+ ths = nxt = rev = NULL;
+ if(!NIL_P(revtime)){
+ tmp = rb_protect(rb_Integer, revtime, &rstatus);
+ if(rstatus) goto err;
+ rev = X509_gmtime_adj(NULL, NUM2INT(tmp));
}
+ tmp = rb_protect(rb_Integer, thisupd, &rstatus);
+ if(rstatus) goto err;
+ ths = X509_gmtime_adj(NULL, NUM2INT(tmp));
+ tmp = rb_protect(rb_Integer, nextupd, &rstatus);
+ if(rstatus) goto err;
+ nxt = X509_gmtime_adj(NULL, NUM2INT(tmp));
+ GetOCSPBasicRes(self, bs);
+ SafeGetOCSPCertId(cid, id);
if(!(single = OCSP_basic_add1_status(bs, id, st, rsn, rev, ths, nxt))){
error = 1;
goto err;
@@ -860,13 +639,16 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
if(!NIL_P(ext)){
X509_EXTENSION *x509ext;
-
+ sk_X509_EXTENSION_pop_free(single->singleExtensions, X509_EXTENSION_free);
+ single->singleExtensions = NULL;
for(i = 0; i < RARRAY_LEN(ext); i++){
- x509ext = GetX509ExtPtr(RARRAY_AREF(ext, i));
+ x509ext = DupX509ExtPtr(RARRAY_PTR(ext)[i]);
if(!OCSP_SINGLERESP_add_ext(single, x509ext, -1)){
+ X509_EXTENSION_free(x509ext);
error = 1;
goto err;
}
+ X509_EXTENSION_free(x509ext);
}
}
@@ -885,13 +667,11 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
* 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::Extension.
- *
- * This should be superseded by BasicResponse#responses and #find_response that
- * return SingleResponse.
+ * CertificateId, the status (0 for success, 1 for revoked), 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)
{
@@ -915,7 +695,7 @@ ossl_ocspbres_get_status(VALUE self)
status = OCSP_single_get0_status(single, &reason, &revtime,
&thisupd, &nextupd);
if(status < 0) continue;
- if(!(cid = OCSP_CERTID_dup((OCSP_CERTID *)OCSP_SINGLERESP_get0_id(single)))) /* FIXME */
+ if(!(cid = OCSP_CERTID_dup(single->certId)))
ossl_raise(eOCSPError, NULL);
ary = rb_ary_new();
rb_ary_push(ary, ossl_ocspcertid_new(cid));
@@ -937,519 +717,76 @@ ossl_ocspbres_get_status(VALUE self)
return ret;
}
-static VALUE ossl_ocspsres_new(OCSP_SINGLERESP *);
-
/*
* call-seq:
- * basic_response.responses -> Array of SingleResponse
+ * 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
*
- * Returns an Array of SingleResponse for this BasicResponse.
- */
-
-static VALUE
-ossl_ocspbres_get_responses(VALUE self)
-{
- OCSP_BASICRESP *bs;
- VALUE ret;
- int count, i;
-
- GetOCSPBasicRes(self, bs);
- count = OCSP_resp_count(bs);
- ret = rb_ary_new2(count);
-
- for (i = 0; i < count; i++) {
- OCSP_SINGLERESP *sres, *sres_new;
-
- sres = OCSP_resp_get0(bs, i);
- sres_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_SINGLERESP), sres);
- if (!sres_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- rb_ary_push(ret, ossl_ocspsres_new(sres_new));
- }
-
- return ret;
-}
-
-
-/*
- * call-seq:
- * basic_response.find_response(certificate_id) -> SingleResponse | nil
- *
- * Returns a SingleResponse whose CertId matches with _certificate_id_, or +nil+
- * if this BasicResponse does not contain it.
- */
-static VALUE
-ossl_ocspbres_find_response(VALUE self, VALUE target)
-{
- OCSP_BASICRESP *bs;
- OCSP_SINGLERESP *sres, *sres_new;
- OCSP_CERTID *id;
- int n;
-
- GetOCSPCertId(target, id);
- GetOCSPBasicRes(self, bs);
-
- if ((n = OCSP_resp_find(bs, id, -1)) == -1)
- return Qnil;
-
- sres = OCSP_resp_get0(bs, n);
- sres_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_SINGLERESP), sres);
- if (!sres_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- return ossl_ocspsres_new(sres_new);
-}
-
-/*
- * call-seq:
- * basic_response.sign(cert, key, certs = nil, flags = 0, digest = nil) -> self
- *
- * Signs this OCSP response using the _cert_, _key_ and optional _digest_. This
- * behaves in the similar way as OpenSSL::OCSP::Request#sign.
- *
- * _flags_ can include:
- * OpenSSL::OCSP::NOCERTS:: don't include certificates
- * OpenSSL::OCSP::NOTIME:: don't set producedAt
- * OpenSSL::OCSP::RESPID_KEY:: use signer's public key hash as responderID
+ * 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)
{
- VALUE signer_cert, signer_key, certs, flags, digest;
+ VALUE signer_cert, signer_key, certs, flags;
OCSP_BASICRESP *bs;
X509 *signer;
EVP_PKEY *key;
- STACK_OF(X509) *x509s = NULL;
- unsigned long flg = 0;
- const EVP_MD *md;
+ STACK_OF(X509) *x509s;
+ unsigned long flg;
int ret;
- rb_scan_args(argc, argv, "23", &signer_cert, &signer_key, &certs, &flags, &digest);
- GetOCSPBasicRes(self, bs);
+ rb_scan_args(argc, argv, "22", &signer_cert, &signer_key, &certs, &flags);
signer = GetX509CertPtr(signer_cert);
key = GetPrivPKeyPtr(signer_key);
- if (!NIL_P(flags))
- flg = NUM2INT(flags);
- if (NIL_P(digest))
- md = EVP_sha1();
- else
- md = ossl_evp_get_digestbyname(digest);
- if (NIL_P(certs))
+ flg = NIL_P(flags) ? 0 : NUM2INT(flags);
+ if(NIL_P(certs)){
+ x509s = sk_X509_new_null();
flg |= OCSP_NOCERTS;
- else
+ }
+ else{
x509s = ossl_x509_ary2sk(certs);
-
- ret = OCSP_basic_sign(bs, signer, key, md, x509s, flg);
+ }
+ GetOCSPBasicRes(self, bs);
+ ret = OCSP_basic_sign(bs, signer, key, EVP_sha1(), x509s, flg);
sk_X509_pop_free(x509s, X509_free);
- if (!ret) ossl_raise(eOCSPError, NULL);
+ if(!ret) ossl_raise(eOCSPError, NULL);
return self;
}
/*
* call-seq:
- * basic_response.verify(certificates, store, flags = 0) -> true or false
+ * 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_ and
- * _store_. This works in the similar way as OpenSSL::OCSP::Request#verify.
+ * Verifies the signature of the response using the given +certificates+,
+ * +store+ and +flags+.
*/
static VALUE
ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self)
{
- VALUE certs, store, flags;
+ VALUE certs, store, flags, result;
OCSP_BASICRESP *bs;
STACK_OF(X509) *x509s;
X509_STORE *x509st;
- int flg, result;
+ int flg;
rb_scan_args(argc, argv, "21", &certs, &store, &flags);
- GetOCSPBasicRes(self, bs);
x509st = GetX509StorePtr(store);
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
x509s = ossl_x509_ary2sk(certs);
-#if (OPENSSL_VERSION_NUMBER < 0x1000202fL) || defined(LIBRESSL_VERSION_NUMBER)
- /*
- * OpenSSL had a bug that it doesn't use the certificates in x509s for
- * verifying the chain. This can be a problem when the response is signed by
- * a certificate issued by an intermediate CA.
- *
- * root_ca
- * |
- * intermediate_ca
- * |-------------|
- * end_entity ocsp_signer
- *
- * When the certificate hierarchy is like this, and the response contains
- * only ocsp_signer certificate, the following code wrongly fails.
- *
- * store = OpenSSL::X509::Store.new; store.add_cert(root_ca)
- * basic_response.verify([intermediate_ca], store)
- *
- * So add the certificates in x509s to the embedded certificates list first.
- *
- * This is fixed in OpenSSL 0.9.8zg, 1.0.0s, 1.0.1n, 1.0.2b. But it still
- * exists in LibreSSL 2.1.10, 2.2.9, 2.3.6, 2.4.1.
- */
- if (!(flg & (OCSP_NOCHAIN | OCSP_NOVERIFY)) &&
- sk_X509_num(x509s) && sk_X509_num(bs->certs)) {
- int i;
-
- bs = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_BASICRESP), bs);
- if (!bs) {
- sk_X509_pop_free(x509s, X509_free);
- ossl_raise(eOCSPError, "ASN1_item_dup");
- }
-
- for (i = 0; i < sk_X509_num(x509s); i++) {
- if (!OCSP_basic_add1_cert(bs, sk_X509_value(x509s, i))) {
- sk_X509_pop_free(x509s, X509_free);
- OCSP_BASICRESP_free(bs);
- ossl_raise(eOCSPError, "OCSP_basic_add1_cert");
- }
- }
- result = OCSP_basic_verify(bs, x509s, x509st, flg);
- OCSP_BASICRESP_free(bs);
- }
- else {
- result = OCSP_basic_verify(bs, x509s, x509st, flg);
- }
-#else
- result = OCSP_basic_verify(bs, x509s, x509st, flg);
-#endif
+ GetOCSPBasicRes(self, bs);
+ result = OCSP_basic_verify(bs, x509s, x509st, flg) > 0 ? Qtrue : Qfalse;
sk_X509_pop_free(x509s, X509_free);
- if (result <= 0)
- ossl_clear_error();
-
- return result > 0 ? Qtrue : Qfalse;
-}
-
-/*
- * call-seq:
- * basic_response.to_der -> String
- *
- * Encodes this basic response into a DER-encoded string.
- */
-static VALUE
-ossl_ocspbres_to_der(VALUE self)
-{
- OCSP_BASICRESP *res;
- VALUE str;
- long len;
- unsigned char *p;
-
- GetOCSPBasicRes(self, res);
- if ((len = i2d_OCSP_BASICRESP(res, NULL)) <= 0)
- ossl_raise(eOCSPError, NULL);
- str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
- if (i2d_OCSP_BASICRESP(res, &p) <= 0)
- ossl_raise(eOCSPError, NULL);
- ossl_str_adjust(str, p);
-
- return str;
-}
-
-/*
- * OCSP::SingleResponse
- */
-static VALUE
-ossl_ocspsres_new(OCSP_SINGLERESP *sres)
-{
- VALUE obj;
-
- obj = NewOCSPSingleRes(cOCSPSingleRes);
- SetOCSPSingleRes(obj, sres);
-
- return obj;
-}
-
-static VALUE
-ossl_ocspsres_alloc(VALUE klass)
-{
- OCSP_SINGLERESP *sres;
- VALUE obj;
-
- obj = NewOCSPSingleRes(klass);
- if (!(sres = OCSP_SINGLERESP_new()))
- ossl_raise(eOCSPError, NULL);
- SetOCSPSingleRes(obj, sres);
-
- return obj;
-}
-
-/*
- * call-seq:
- * OpenSSL::OCSP::SingleResponse.new(der_string) -> SingleResponse
- *
- * Creates a new SingleResponse from _der_string_.
- */
-static VALUE
-ossl_ocspsres_initialize(VALUE self, VALUE arg)
-{
- OCSP_SINGLERESP *res, *res_new;
- const unsigned char *p;
-
- arg = ossl_to_der_if_possible(arg);
- StringValue(arg);
- GetOCSPSingleRes(self, res);
-
- p = (unsigned char*)RSTRING_PTR(arg);
- res_new = d2i_OCSP_SINGLERESP(NULL, &p, RSTRING_LEN(arg));
- if (!res_new)
- ossl_raise(eOCSPError, "d2i_OCSP_SINGLERESP");
- SetOCSPSingleRes(self, res_new);
- OCSP_SINGLERESP_free(res);
-
- return self;
-}
-
-static VALUE
-ossl_ocspsres_initialize_copy(VALUE self, VALUE other)
-{
- OCSP_SINGLERESP *sres, *sres_old, *sres_new;
-
- rb_check_frozen(self);
- GetOCSPSingleRes(self, sres_old);
- GetOCSPSingleRes(other, sres);
-
- sres_new = ASN1_item_dup(ASN1_ITEM_rptr(OCSP_SINGLERESP), sres);
- if (!sres_new)
- ossl_raise(eOCSPError, "ASN1_item_dup");
-
- SetOCSPSingleRes(self, sres_new);
- OCSP_SINGLERESP_free(sres_old);
-
- return self;
-}
-
-/*
- * call-seq:
- * single_response.check_validity(nsec = 0, maxsec = -1) -> true | false
- *
- * Checks the validity of thisUpdate and nextUpdate fields of this
- * SingleResponse. This checks the current time is within the range thisUpdate
- * to nextUpdate.
- *
- * It is possible that the OCSP request takes a few seconds or the time is not
- * accurate. To avoid rejecting a valid response, this method allows the times
- * to be within _nsec_ seconds of the current time.
- *
- * Some responders don't set the nextUpdate field. This may cause a very old
- * response to be considered valid. The _maxsec_ parameter can be used to limit
- * the age of responses.
- */
-static VALUE
-ossl_ocspsres_check_validity(int argc, VALUE *argv, VALUE self)
-{
- OCSP_SINGLERESP *sres;
- ASN1_GENERALIZEDTIME *this_update, *next_update;
- VALUE nsec_v, maxsec_v;
- int nsec, maxsec, status, ret;
-
- rb_scan_args(argc, argv, "02", &nsec_v, &maxsec_v);
- nsec = NIL_P(nsec_v) ? 0 : NUM2INT(nsec_v);
- maxsec = NIL_P(maxsec_v) ? -1 : NUM2INT(maxsec_v);
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, NULL, NULL, &this_update, &next_update);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
-
- ret = OCSP_check_validity(this_update, next_update, nsec, maxsec);
-
- if (ret)
- return Qtrue;
- else {
- ossl_clear_error();
- return Qfalse;
- }
-}
-
-/*
- * call-seq:
- * single_response.certid -> CertificateId
- *
- * Returns the CertificateId for which this SingleResponse is.
- */
-static VALUE
-ossl_ocspsres_get_certid(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- OCSP_CERTID *id;
-
- GetOCSPSingleRes(self, sres);
- id = OCSP_CERTID_dup((OCSP_CERTID *)OCSP_SINGLERESP_get0_id(sres)); /* FIXME */
-
- return ossl_ocspcertid_new(id);
-}
-
-/*
- * call-seq:
- * single_response.cert_status -> Integer
- *
- * Returns the status of the certificate identified by the certid.
- * The return value may be one of these constant:
- *
- * - V_CERTSTATUS_GOOD
- * - V_CERTSTATUS_REVOKED
- * - V_CERTSTATUS_UNKNOWN
- *
- * When the status is V_CERTSTATUS_REVOKED, the time at which the certificate
- * was revoked can be retrieved by #revocation_time.
- */
-static VALUE
-ossl_ocspsres_get_cert_status(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- int status;
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, NULL, NULL, NULL, NULL);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
-
- return INT2NUM(status);
-}
-
-/*
- * call-seq:
- * single_response.this_update -> Time
- */
-static VALUE
-ossl_ocspsres_get_this_update(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- int status;
- ASN1_GENERALIZEDTIME *time;
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, NULL, NULL, &time, NULL);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
- if (!time)
- return Qnil;
+ if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
- return asn1time_to_time(time);
+ return result;
}
/*
- * call-seq:
- * single_response.next_update -> Time | nil
- */
-static VALUE
-ossl_ocspsres_get_next_update(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- int status;
- ASN1_GENERALIZEDTIME *time;
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, NULL, NULL, NULL, &time);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
- if (!time)
- return Qnil;
-
- return asn1time_to_time(time);
-}
-
-/*
- * call-seq:
- * single_response.revocation_time -> Time | nil
- */
-static VALUE
-ossl_ocspsres_get_revocation_time(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- int status;
- ASN1_GENERALIZEDTIME *time;
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, NULL, &time, NULL, NULL);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
- if (status != V_OCSP_CERTSTATUS_REVOKED)
- ossl_raise(eOCSPError, "certificate is not revoked");
- if (!time)
- return Qnil;
-
- return asn1time_to_time(time);
-}
-
-/*
- * call-seq:
- * single_response.revocation_reason -> Integer | nil
- */
-static VALUE
-ossl_ocspsres_get_revocation_reason(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- int status, reason;
-
- GetOCSPSingleRes(self, sres);
- status = OCSP_single_get0_status(sres, &reason, NULL, NULL, NULL);
- if (status < 0)
- ossl_raise(eOCSPError, "OCSP_single_get0_status");
- if (status != V_OCSP_CERTSTATUS_REVOKED)
- ossl_raise(eOCSPError, "certificate is not revoked");
-
- return INT2NUM(reason);
-}
-
-/*
- * call-seq:
- * single_response.extensions -> Array of X509::Extension
- */
-static VALUE
-ossl_ocspsres_get_extensions(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- X509_EXTENSION *ext;
- int count, i;
- VALUE ary;
-
- GetOCSPSingleRes(self, sres);
-
- count = OCSP_SINGLERESP_get_ext_count(sres);
- ary = rb_ary_new2(count);
- for (i = 0; i < count; i++) {
- ext = OCSP_SINGLERESP_get_ext(sres, i);
- rb_ary_push(ary, ossl_x509ext_new(ext)); /* will dup */
- }
-
- return ary;
-}
-
-/*
- * call-seq:
- * single_response.to_der -> String
- *
- * Encodes this SingleResponse into a DER-encoded string.
- */
-static VALUE
-ossl_ocspsres_to_der(VALUE self)
-{
- OCSP_SINGLERESP *sres;
- VALUE str;
- long len;
- unsigned char *p;
-
- GetOCSPSingleRes(self, sres);
- if ((len = i2d_OCSP_SINGLERESP(sres, NULL)) <= 0)
- ossl_raise(eOCSPError, NULL);
- str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
- if (i2d_OCSP_SINGLERESP(sres, &p) <= 0)
- ossl_raise(eOCSPError, NULL);
- ossl_str_adjust(str, p);
-
- return str;
-}
-
-
-/*
* OCSP::CertificateId
*/
static VALUE
@@ -1458,78 +795,48 @@ ossl_ocspcid_alloc(VALUE klass)
OCSP_CERTID *id;
VALUE obj;
- obj = NewOCSPCertId(klass);
if(!(id = OCSP_CERTID_new()))
ossl_raise(eOCSPError, NULL);
- SetOCSPCertId(obj, id);
+ WrapOCSPCertId(klass, obj, id);
return obj;
}
-static VALUE
-ossl_ocspcid_initialize_copy(VALUE self, VALUE other)
-{
- OCSP_CERTID *cid, *cid_old, *cid_new;
-
- rb_check_frozen(self);
- GetOCSPCertId(self, cid_old);
- GetOCSPCertId(other, cid);
-
- cid_new = OCSP_CERTID_dup(cid);
- if (!cid_new)
- ossl_raise(eOCSPError, "OCSP_CERTID_dup");
-
- SetOCSPCertId(self, cid_new);
- OCSP_CERTID_free(cid_old);
-
- return self;
-}
-
/*
* call-seq:
* OpenSSL::OCSP::CertificateId.new(subject, issuer, digest = nil) -> certificate_id
- * OpenSSL::OCSP::CertificateId.new(der_string) -> certificate_id
- *
- * Creates a new OpenSSL::OCSP::CertificateId for the given _subject_ and
- * _issuer_ X509 certificates. The _digest_ is a digest algorithm that is used
- * to compute the hash values. This defaults to SHA-1.
*
- * If only one argument is given, decodes it as DER representation of a
- * 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)
{
OCSP_CERTID *id, *newid;
+ X509 *x509s, *x509i;
VALUE subject, issuer, digest;
+ const EVP_MD *md;
- GetOCSPCertId(self, id);
- if (rb_scan_args(argc, argv, "12", &subject, &issuer, &digest) == 1) {
- VALUE arg;
- const unsigned char *p;
-
- arg = ossl_to_der_if_possible(subject);
- StringValue(arg);
- p = (unsigned char *)RSTRING_PTR(arg);
- newid = d2i_OCSP_CERTID(NULL, &p, RSTRING_LEN(arg));
- if (!newid)
- ossl_raise(eOCSPError, "d2i_OCSP_CERTID");
+ if (rb_scan_args(argc, argv, "21", &subject, &issuer, &digest) == 0) {
+ return self;
}
- else {
- X509 *x509s, *x509i;
- const EVP_MD *md;
- x509s = GetX509CertPtr(subject); /* NO NEED TO DUP */
- x509i = GetX509CertPtr(issuer); /* NO NEED TO DUP */
- md = !NIL_P(digest) ? ossl_evp_get_digestbyname(digest) : NULL;
+ x509s = GetX509CertPtr(subject); /* NO NEED TO DUP */
+ x509i = GetX509CertPtr(issuer); /* NO NEED TO DUP */
+ if (!NIL_P(digest)) {
+ md = GetDigestPtr(digest);
newid = OCSP_cert_to_id(md, x509s, x509i);
- if (!newid)
- ossl_raise(eOCSPError, "OCSP_cert_to_id");
+ } else {
+ newid = OCSP_cert_to_id(NULL, x509s, x509i);
}
-
- SetOCSPCertId(self, newid);
+ if(!newid)
+ ossl_raise(eOCSPError, NULL);
+ GetOCSPCertId(self, id);
OCSP_CERTID_free(id);
+ RDATA(self)->data = newid;
return self;
}
@@ -1538,7 +845,7 @@ ossl_ocspcid_initialize(int argc, VALUE *argv, VALUE self)
* call-seq:
* certificate_id.cmp(other) -> true or false
*
- * Compares this certificate id with _other_ and returns +true+ if they are the
+ * Compares this certificate id with +other+ and returns true if they are the
* same.
*/
static VALUE
@@ -1548,7 +855,7 @@ ossl_ocspcid_cmp(VALUE self, VALUE other)
int result;
GetOCSPCertId(self, id);
- GetOCSPCertId(other, id2);
+ SafeGetOCSPCertId(other, id2);
result = OCSP_id_cmp(id, id2);
return (result == 0) ? Qtrue : Qfalse;
@@ -1558,7 +865,7 @@ ossl_ocspcid_cmp(VALUE self, VALUE other)
* call-seq:
* certificate_id.cmp_issuer(other) -> true or false
*
- * Compares this certificate id's issuer with _other_ and returns +true+ if
+ * Compares this certificate id's issuer with +other+ and returns true if
* they are the same.
*/
@@ -1569,7 +876,7 @@ ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
int result;
GetOCSPCertId(self, id);
- GetOCSPCertId(other, id2);
+ SafeGetOCSPCertId(other, id2);
result = OCSP_id_issuer_cmp(id, id2);
return (result == 0) ? Qtrue : Qfalse;
@@ -1577,130 +884,24 @@ ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
/*
* call-seq:
- * certificate_id.serial -> Integer
+ * certificate_id.get_serial -> Integer
*
- * Returns the serial number of the certificate for which status is being
- * requested.
+ * Returns the serial number of the issuing certificate.
*/
-static VALUE
-ossl_ocspcid_get_serial(VALUE self)
-{
- OCSP_CERTID *id;
- ASN1_INTEGER *serial;
-
- GetOCSPCertId(self, id);
- OCSP_id_get0_info(NULL, NULL, NULL, &serial, id);
- return asn1integer_to_num(serial);
-}
-
-/*
- * call-seq:
- * certificate_id.issuer_name_hash -> String
- *
- * Returns the issuerNameHash of this certificate ID, the hash of the
- * issuer's distinguished name calculated with the hashAlgorithm.
- */
static VALUE
-ossl_ocspcid_get_issuer_name_hash(VALUE self)
-{
- OCSP_CERTID *id;
- ASN1_OCTET_STRING *name_hash;
- VALUE ret;
-
- GetOCSPCertId(self, id);
- OCSP_id_get0_info(&name_hash, NULL, NULL, NULL, id);
-
- ret = rb_str_new(NULL, name_hash->length * 2);
- ossl_bin2hex(name_hash->data, RSTRING_PTR(ret), name_hash->length);
-
- return ret;
-}
-
-/*
- * call-seq:
- * certificate_id.issuer_key_hash -> String
- *
- * Returns the issuerKeyHash of this certificate ID, the hash of the issuer's
- * public key.
- */
-static VALUE
-ossl_ocspcid_get_issuer_key_hash(VALUE self)
-{
- OCSP_CERTID *id;
- ASN1_OCTET_STRING *key_hash;
- VALUE ret;
-
- GetOCSPCertId(self, id);
- OCSP_id_get0_info(NULL, NULL, &key_hash, NULL, id);
-
- ret = rb_str_new(NULL, key_hash->length * 2);
- ossl_bin2hex(key_hash->data, RSTRING_PTR(ret), key_hash->length);
-
- return ret;
-}
-
-/*
- * call-seq:
- * certificate_id.hash_algorithm -> String
- *
- * Returns the ln (long name) of the hash algorithm used to generate
- * the issuerNameHash and the issuerKeyHash values.
- */
-static VALUE
-ossl_ocspcid_get_hash_algorithm(VALUE self)
-{
- OCSP_CERTID *id;
- ASN1_OBJECT *oid;
- BIO *out;
-
- GetOCSPCertId(self, id);
- OCSP_id_get0_info(NULL, &oid, NULL, NULL, id);
-
- if (!(out = BIO_new(BIO_s_mem())))
- ossl_raise(eOCSPError, "BIO_new");
-
- if (!i2a_ASN1_OBJECT(out, oid)) {
- BIO_free(out);
- ossl_raise(eOCSPError, "i2a_ASN1_OBJECT");
- }
- return ossl_membio2str(out);
-}
-
-/*
- * call-seq:
- * certificate_id.to_der -> String
- *
- * Encodes this certificate identifier into a DER-encoded string.
- */
-static VALUE
-ossl_ocspcid_to_der(VALUE self)
+ossl_ocspcid_get_serial(VALUE self)
{
OCSP_CERTID *id;
- VALUE str;
- long len;
- unsigned char *p;
GetOCSPCertId(self, id);
- if ((len = i2d_OCSP_CERTID(id, NULL)) <= 0)
- ossl_raise(eOCSPError, NULL);
- str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
- if (i2d_OCSP_CERTID(id, &p) <= 0)
- ossl_raise(eOCSPError, NULL);
- ossl_str_adjust(str, p);
- return str;
+ return asn1integer_to_num(id->serialNumber);
}
void
-Init_ossl_ocsp(void)
+Init_ossl_ocsp()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
/*
* OpenSSL::OCSP implements Online Certificate Status Protocol requests
* and responses.
@@ -1770,7 +971,7 @@ Init_ossl_ocsp(void)
* store = OpenSSL::X509::Store.new
* store.set_default_paths
*
- * unless response_basic.verify [], store then
+ * unless response.verify [], store then
* raise 'response is not signed by a trusted certificate'
* end
*
@@ -1786,28 +987,27 @@ Init_ossl_ocsp(void)
*
* p request.check_nonce basic_response #=> value from -1 to 3
*
- * Then extract the status information for the certificate from the basic
- * response.
+ * 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
*
- * single_response = basic_response.find_response(certificate_id)
+ * Then check the various fields.
*
- * unless single_response
- * raise 'basic_response does not have the status for the certificiate'
+ * unless response_certificate_id == certificate_id then
+ * raise 'certificate id mismatch'
* end
*
- * Then check the validity. A status issued in the future must be rejected.
+ * now = Time.now
*
- * unless single_response.check_validity
- * raise 'this_update is in the future or next_update time has passed'
+ * if this_update > now then
+ * raise 'update date is in the future'
* end
*
- * case single_response.cert_status
- * when OpenSSL::OCSP::V_CERTSTATUS_GOOD
- * puts 'certificate is still valid'
- * when OpenSSL::OCSP::V_CERTSTATUS_REVOKED
- * puts "certificate has been revoked at #{single_response.revocation_time}"
- * when OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN
- * puts 'responder doesn't know about the certificate'
+ * if now > next_update then
+ * raise 'next update time has passed'
* end
*/
@@ -1828,13 +1028,11 @@ Init_ossl_ocsp(void)
cOCSPReq = rb_define_class_under(mOCSP, "Request", rb_cObject);
rb_define_alloc_func(cOCSPReq, ossl_ocspreq_alloc);
- rb_define_method(cOCSPReq, "initialize_copy", ossl_ocspreq_initialize_copy, 1);
rb_define_method(cOCSPReq, "initialize", ossl_ocspreq_initialize, -1);
rb_define_method(cOCSPReq, "add_nonce", ossl_ocspreq_add_nonce, -1);
rb_define_method(cOCSPReq, "check_nonce", ossl_ocspreq_check_nonce, 1);
rb_define_method(cOCSPReq, "add_certid", ossl_ocspreq_add_certid, 1);
rb_define_method(cOCSPReq, "certid", ossl_ocspreq_get_certid, 0);
- rb_define_method(cOCSPReq, "signed?", ossl_ocspreq_signed_p, 0);
rb_define_method(cOCSPReq, "sign", ossl_ocspreq_sign, -1);
rb_define_method(cOCSPReq, "verify", ossl_ocspreq_verify, -1);
rb_define_method(cOCSPReq, "to_der", ossl_ocspreq_to_der, 0);
@@ -1847,7 +1045,6 @@ Init_ossl_ocsp(void)
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);
- rb_define_method(cOCSPRes, "initialize_copy", ossl_ocspres_initialize_copy, 1);
rb_define_method(cOCSPRes, "initialize", ossl_ocspres_initialize, -1);
rb_define_method(cOCSPRes, "status", ossl_ocspres_status, 0);
rb_define_method(cOCSPRes, "status_string", ossl_ocspres_status_string, 0);
@@ -1862,36 +1059,13 @@ Init_ossl_ocsp(void)
cOCSPBasicRes = rb_define_class_under(mOCSP, "BasicResponse", rb_cObject);
rb_define_alloc_func(cOCSPBasicRes, ossl_ocspbres_alloc);
- rb_define_method(cOCSPBasicRes, "initialize_copy", ossl_ocspbres_initialize_copy, 1);
rb_define_method(cOCSPBasicRes, "initialize", ossl_ocspbres_initialize, -1);
rb_define_method(cOCSPBasicRes, "copy_nonce", ossl_ocspbres_copy_nonce, 1);
rb_define_method(cOCSPBasicRes, "add_nonce", ossl_ocspbres_add_nonce, -1);
rb_define_method(cOCSPBasicRes, "add_status", ossl_ocspbres_add_status, 7);
rb_define_method(cOCSPBasicRes, "status", ossl_ocspbres_get_status, 0);
- rb_define_method(cOCSPBasicRes, "responses", ossl_ocspbres_get_responses, 0);
- rb_define_method(cOCSPBasicRes, "find_response", ossl_ocspbres_find_response, 1);
rb_define_method(cOCSPBasicRes, "sign", ossl_ocspbres_sign, -1);
rb_define_method(cOCSPBasicRes, "verify", ossl_ocspbres_verify, -1);
- rb_define_method(cOCSPBasicRes, "to_der", ossl_ocspbres_to_der, 0);
-
- /*
- * An OpenSSL::OCSP::SingleResponse represents an OCSP SingleResponse
- * structure, which contains the basic information of the status of the
- * certificate.
- */
- cOCSPSingleRes = rb_define_class_under(mOCSP, "SingleResponse", rb_cObject);
- rb_define_alloc_func(cOCSPSingleRes, ossl_ocspsres_alloc);
- rb_define_method(cOCSPSingleRes, "initialize_copy", ossl_ocspsres_initialize_copy, 1);
- rb_define_method(cOCSPSingleRes, "initialize", ossl_ocspsres_initialize, 1);
- rb_define_method(cOCSPSingleRes, "check_validity", ossl_ocspsres_check_validity, -1);
- rb_define_method(cOCSPSingleRes, "certid", ossl_ocspsres_get_certid, 0);
- rb_define_method(cOCSPSingleRes, "cert_status", ossl_ocspsres_get_cert_status, 0);
- rb_define_method(cOCSPSingleRes, "this_update", ossl_ocspsres_get_this_update, 0);
- rb_define_method(cOCSPSingleRes, "next_update", ossl_ocspsres_get_next_update, 0);
- rb_define_method(cOCSPSingleRes, "revocation_time", ossl_ocspsres_get_revocation_time, 0);
- rb_define_method(cOCSPSingleRes, "revocation_reason", ossl_ocspsres_get_revocation_reason, 0);
- rb_define_method(cOCSPSingleRes, "extensions", ossl_ocspsres_get_extensions, 0);
- rb_define_method(cOCSPSingleRes, "to_der", ossl_ocspsres_to_der, 0);
/*
* An OpenSSL::OCSP::CertificateId identifies a certificate to the CA so
@@ -1900,15 +1074,10 @@ Init_ossl_ocsp(void)
cOCSPCertId = rb_define_class_under(mOCSP, "CertificateId", rb_cObject);
rb_define_alloc_func(cOCSPCertId, ossl_ocspcid_alloc);
- rb_define_method(cOCSPCertId, "initialize_copy", ossl_ocspcid_initialize_copy, 1);
rb_define_method(cOCSPCertId, "initialize", ossl_ocspcid_initialize, -1);
rb_define_method(cOCSPCertId, "cmp", ossl_ocspcid_cmp, 1);
rb_define_method(cOCSPCertId, "cmp_issuer", ossl_ocspcid_cmp_issuer, 1);
rb_define_method(cOCSPCertId, "serial", ossl_ocspcid_get_serial, 0);
- rb_define_method(cOCSPCertId, "issuer_name_hash", ossl_ocspcid_get_issuer_name_hash, 0);
- rb_define_method(cOCSPCertId, "issuer_key_hash", ossl_ocspcid_get_issuer_key_hash, 0);
- rb_define_method(cOCSPCertId, "hash_algorithm", ossl_ocspcid_get_hash_algorithm, 0);
- rb_define_method(cOCSPCertId, "to_der", ossl_ocspcid_to_der, 0);
/* Internal error in issuer */
rb_define_const(mOCSP, "RESPONSE_STATUS_INTERNALERROR", INT2NUM(OCSP_RESPONSE_STATUS_INTERNALERROR));
@@ -2010,9 +1179,10 @@ Init_ossl_ocsp(void)
/* The responder ID is based on the public key. */
rb_define_const(mOCSP, "V_RESPID_KEY", INT2NUM(V_OCSP_RESPID_KEY));
}
-#else
+
+#else /* ! OSSL_OCSP_ENABLED */
void
-Init_ossl_ocsp(void)
+Init_ossl_ocsp()
{
}
#endif
diff --git a/ext/openssl/ossl_ocsp.h b/ext/openssl/ossl_ocsp.h
index 21e2c99a2e..65b4f2e23f 100644
--- a/ext/openssl/ossl_ocsp.h
+++ b/ext/openssl/ossl_ocsp.h
@@ -1,17 +1,18 @@
/*
+ * $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 licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_OCSP_H_)
#define _OSSL_OCSP_H_
-#if !defined(OPENSSL_NO_OCSP)
+#if defined(OSSL_OCSP_ENABLED)
extern VALUE mOCSP;
extern VALUE cOPCSReq;
extern VALUE cOPCSRes;
diff --git a/ext/openssl/ossl_pkcs12.c b/ext/openssl/ossl_pkcs12.c
index 4566334481..8a5f816082 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -1,22 +1,25 @@
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
+ * $Id$
*/
#include "ossl.h"
-#define NewPKCS12(klass) \
- TypedData_Wrap_Struct((klass), &ossl_pkcs12_type, 0)
-
-#define SetPKCS12(obj, p12) do { \
+#define WrapPKCS12(klass, obj, p12) do { \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
- RTYPEDDATA_DATA(obj) = (p12); \
+ (obj) = Data_Wrap_Struct((klass), 0, PKCS12_free, (p12)); \
} while (0)
#define GetPKCS12(obj, p12) do { \
- TypedData_Get_Struct((obj), PKCS12, &ossl_pkcs12_type, (p12)); \
+ Data_Get_Struct((obj), PKCS12, (p12)); \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
} while (0)
+#define SafeGetPKCS12(obj, p12) do { \
+ OSSL_Check_Kind((obj), cPKCS12); \
+ GetPKCS12((obj), (p12)); \
+} while (0)
+
#define ossl_pkcs12_set_key(o,v) rb_iv_set((o), "@key", (v))
#define ossl_pkcs12_set_cert(o,v) rb_iv_set((o), "@certificate", (v))
#define ossl_pkcs12_set_ca_certs(o,v) rb_iv_set((o), "@ca_certs", (v))
@@ -33,71 +36,37 @@ 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);
- SetPKCS12(obj, p12);
+ WrapPKCS12(klass, obj, p12);
return obj;
}
-static VALUE
-ossl_pkcs12_initialize_copy(VALUE self, VALUE other)
-{
- PKCS12 *p12, *p12_old, *p12_new;
-
- rb_check_frozen(self);
- GetPKCS12(self, p12_old);
- GetPKCS12(other, p12);
-
- p12_new = ASN1_dup((i2d_of_void *)i2d_PKCS12, (d2i_of_void *)d2i_PKCS12, (char *)p12);
- if (!p12_new)
- ossl_raise(ePKCS12Error, "ASN1_dup");
-
- SetPKCS12(self, p12_new);
- PKCS12_free(p12_old);
-
- return self;
-}
-
/*
* call-seq:
* PKCS12.create(pass, name, key, cert [, ca, [, key_pbe [, cert_pbe [, key_iter [, mac_iter [, keytype]]]]]])
*
* === Parameters
- * * _pass_ - string
- * * _name_ - A string describing the key.
- * * _key_ - Any PKey.
- * * _cert_ - A X509::Certificate.
- * * The public_key portion of the certificate must contain a valid public key.
- * * The not_before and not_after fields must be filled in.
- * * _ca_ - An optional array of X509::Certificate's.
- * * _key_pbe_ - string
- * * _cert_pbe_ - string
- * * _key_iter_ - integer
- * * _mac_iter_ - integer
- * * _keytype_ - An integer representing an MSIE specific extension.
+ * * +pass+ - string
+ * * +name+ - A string describing the key.
+ * * +key+ - Any PKey.
+ * * +cert+ - A X509::Certificate.
+ * * * The public_key portion of the certificate must contain a valid public key.
+ * * * The not_before and not_after fields must be filled in.
+ * * +ca+ - An optional array of X509::Certificate's.
+ * * +key_pbe+ - string
+ * * +cert_pbe+ - string
+ * * +key_iter+ - integer
+ * * +mac_iter+ - integer
+ * * +keytype+ - An integer representing an MSIE specific extension.
*
- * Any optional arguments may be supplied as +nil+ to preserve the OpenSSL defaults.
+ * Any optional arguments may be supplied as nil to preserve the OpenSSL defaults.
*
* See the OpenSSL documentation for PKCS12_create().
*/
@@ -114,18 +83,19 @@ ossl_pkcs12_s_create(int argc, VALUE *argv, VALUE self)
PKCS12 *p12;
rb_scan_args(argc, argv, "46", &pass, &name, &pkey, &cert, &ca, &key_nid, &cert_nid, &key_iter, &mac_iter, &keytype);
- passphrase = NIL_P(pass) ? NULL : StringValueCStr(pass);
- friendlyname = NIL_P(name) ? NULL : StringValueCStr(name);
+ passphrase = NIL_P(pass) ? NULL : StringValuePtr(pass);
+ 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(StringValueCStr(key_nid))) == NID_undef)
- ossl_raise(rb_eArgError, "Unknown PBE algorithm %"PRIsVALUE, key_nid);
+ if ((nkey = OBJ_txt2nid(StringValuePtr(key_nid))) == NID_undef)
+ ossl_raise(rb_eArgError, "Unknown PBE algorithm %s", StringValuePtr(key_nid));
}
if (!NIL_P(cert_nid)) {
- if ((ncert = OBJ_txt2nid(StringValueCStr(cert_nid))) == NID_undef)
- ossl_raise(rb_eArgError, "Unknown PBE algorithm %"PRIsVALUE, cert_nid);
+ if ((ncert = OBJ_txt2nid(StringValuePtr(cert_nid))) == NID_undef)
+ ossl_raise(rb_eArgError, "Unknown PBE algorithm %s", StringValuePtr(cert_nid));
}
if (!NIL_P(key_iter))
kiter = NUM2INT(key_iter);
@@ -134,13 +104,11 @@ 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);
- SetPKCS12(obj, p12);
+ WrapPKCS12(cPKCS12, obj, p12);
ossl_pkcs12_set_key(obj, pkey);
ossl_pkcs12_set_cert(obj, cert);
@@ -156,8 +124,8 @@ ossl_pkcs12_s_create(int argc, VALUE *argv, VALUE self)
* PKCS12.new(str, pass) -> pkcs12
*
* === Parameters
- * * _str_ - Must be a DER encoded PKCS12 string.
- * * _pass_ - string
+ * * +str+ - Must be a DER encoded PKCS12 string.
+ * * +pass+ - string
*/
static VALUE
ossl_pkcs12_initialize(int argc, VALUE *argv, VALUE self)
@@ -172,30 +140,24 @@ ossl_pkcs12_initialize(int argc, VALUE *argv, VALUE self)
PKCS12 *pkcs = DATA_PTR(self);
if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) return self;
- passphrase = NIL_P(pass) ? NULL : StringValueCStr(pass);
- in = ossl_obj2bio(&arg);
+ passphrase = NIL_P(pass) ? NULL : StringValuePtr(pass);
+ in = ossl_obj2bio(arg);
d2i_PKCS12_bio(in, &pkcs);
DATA_PTR(self) = pkcs;
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();
- if (key) {
- pkey = rb_protect((VALUE (*)(VALUE))ossl_pkey_new, (VALUE)key, &st);
- if (st) goto err;
- }
- if (x509) {
- cert = rb_protect((VALUE (*)(VALUE))ossl_x509_new, (VALUE)x509, &st);
- if (st) goto err;
- }
- if (x509s) {
- ca = rb_protect((VALUE (*)(VALUE))ossl_x509_sk2ary, (VALUE)x509s, &st);
- if (st) goto err;
+ pkey = rb_protect((VALUE(*)_((VALUE)))ossl_pkey_new, (VALUE)key,
+ &st); /* NO DUP */
+ if(st) goto err;
+ cert = rb_protect((VALUE(*)_((VALUE)))ossl_x509_new, (VALUE)x509, &st);
+ if(st) goto err;
+ if(x509s){
+ ca =
+ rb_protect((VALUE(*)_((VALUE)))ossl_x509_sk2ary, (VALUE)x509s, &st);
+ if(st) goto err;
}
err:
@@ -230,14 +192,8 @@ ossl_pkcs12_to_der(VALUE self)
}
void
-Init_ossl_pkcs12(void)
+Init_ossl_pkcs12()
{
-#undef rb_intern
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
/*
* Defines a file format commonly used to store private keys with
* accompanying public key certificates, protected with a password-based
@@ -248,7 +204,6 @@ Init_ossl_pkcs12(void)
rb_define_singleton_method(cPKCS12, "create", ossl_pkcs12_s_create, -1);
rb_define_alloc_func(cPKCS12, ossl_pkcs12_s_allocate);
- rb_define_method(cPKCS12, "initialize_copy", ossl_pkcs12_initialize_copy, 1);
rb_attr(cPKCS12, rb_intern("key"), 1, 0, Qfalse);
rb_attr(cPKCS12, rb_intern("certificate"), 1, 0, Qfalse);
rb_attr(cPKCS12, rb_intern("ca_certs"), 1, 0, Qfalse);
diff --git a/ext/openssl/ossl_pkcs12.h b/ext/openssl/ossl_pkcs12.h
index fe4f15ef60..24d25d00bb 100644
--- a/ext/openssl/ossl_pkcs12.h
+++ b/ext/openssl/ossl_pkcs12.h
@@ -1,6 +1,7 @@
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
+ * $Id$
*/
#if !defined(_OSSL_PKCS12_H_)
#define _OSSL_PKCS12_H_
@@ -11,3 +12,4 @@ 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
new file mode 100644
index 0000000000..3b615e4828
--- /dev/null
+++ b/ext/openssl/ossl_pkcs5.c
@@ -0,0 +1,189 @@
+/*
+ * $Id$
+ * Copyright (C) 2007 Technorama Ltd. <oss-ruby@technorama.net>
+ */
+#include "ossl.h"
+
+VALUE mPKCS5;
+VALUE ePKCS5;
+
+#ifdef HAVE_PKCS5_PBKDF2_HMAC
+/*
+ * call-seq:
+ * PKCS5.pbkdf2_hmac(pass, salt, iter, keylen, digest) => string
+ *
+ * === Parameters
+ * * +pass+ - string
+ * * +salt+ - string - should be at least 8 bytes long.
+ * * +iter+ - integer - should be greater than 1000. 20000 is better.
+ * * +keylen+ - integer
+ * * +digest+ - a string or OpenSSL::Digest object.
+ *
+ * Available in OpenSSL 0.9.4.
+ *
+ * Digests other than SHA1 may not be supported by other cryptography libraries.
+ */
+static VALUE
+ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE keylen, VALUE digest)
+{
+ VALUE str;
+ const EVP_MD *md;
+ int len = NUM2INT(keylen);
+
+ StringValue(pass);
+ StringValue(salt);
+ md = GetDigestPtr(digest);
+
+ str = rb_str_new(0, len);
+
+ if (PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LENINT(pass),
+ (unsigned char *)RSTRING_PTR(salt), RSTRING_LENINT(salt),
+ NUM2INT(iter), md, len,
+ (unsigned char *)RSTRING_PTR(str)) != 1)
+ ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC");
+
+ return str;
+}
+#else
+#define ossl_pkcs5_pbkdf2_hmac rb_f_notimplement
+#endif
+
+
+#ifdef HAVE_PKCS5_PBKDF2_HMAC_SHA1
+/*
+ * call-seq:
+ * PKCS5.pbkdf2_hmac_sha1(pass, salt, iter, keylen) => string
+ *
+ * === Parameters
+ * * +pass+ - string
+ * * +salt+ - string - should be at least 8 bytes long.
+ * * +iter+ - integer - should be greater than 1000. 20000 is better.
+ * * +keylen+ - integer
+ *
+ * This method is available in almost any version of OpenSSL.
+ *
+ * Conforms to rfc2898.
+ */
+static VALUE
+ossl_pkcs5_pbkdf2_hmac_sha1(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE keylen)
+{
+ VALUE str;
+ int len = NUM2INT(keylen);
+
+ StringValue(pass);
+ StringValue(salt);
+
+ str = rb_str_new(0, len);
+
+ if (PKCS5_PBKDF2_HMAC_SHA1(RSTRING_PTR(pass), RSTRING_LENINT(pass),
+ (const unsigned char *)RSTRING_PTR(salt), RSTRING_LENINT(salt), NUM2INT(iter),
+ len, (unsigned char *)RSTRING_PTR(str)) != 1)
+ ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC_SHA1");
+
+ return str;
+}
+#else
+#define ossl_pkcs5_pbkdf2_hmac_sha1 rb_f_notimplement
+#endif
+
+void
+Init_ossl_pkcs5()
+{
+ /*
+ * Password-based Encryption
+ *
+ */
+
+ #if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+ #endif
+
+ /* Document-class: OpenSSL::PKCS5
+ *
+ * Provides password-based encryption functionality based on PKCS#5.
+ * Typically used for securely deriving arbitrary length symmetric keys
+ * to be used with an OpenSSL::Cipher from passwords. Another use case
+ * is for storing passwords: Due to the ability to tweak the effort of
+ * computation by increasing the iteration count, computation can be
+ * slowed down artificially in order to render possible attacks infeasible.
+ *
+ * PKCS5 offers support for PBKDF2 with an OpenSSL::Digest::SHA1-based
+ * HMAC, or an arbitrary Digest if the underlying version of OpenSSL
+ * already supports it (>= 0.9.4).
+ *
+ * === Parameters
+ * ==== Password
+ * Typically an arbitrary String that represents the password to be used
+ * for deriving a key.
+ * ==== Salt
+ * Prevents attacks based on dictionaries of common passwords. It is a
+ * public value that can be safely stored along with the password (e.g.
+ * if PBKDF2 is used for password storage). For maximum security, a fresh,
+ * random salt should be generated for each stored password. According
+ * to PKCS#5, a salt should be at least 8 bytes long.
+ * ==== Iteration Count
+ * Allows to tweak the length that the actual computation will take. The
+ * larger the iteration count, the longer it will take.
+ * ==== Key Length
+ * Specifies the length in bytes of the output that will be generated.
+ * Typically, the key length should be larger than or equal to the output
+ * length of the underlying digest function, otherwise an attacker could
+ * simply try to brute-force the key. According to PKCS#5, security is
+ * limited by the output length of the underlying digest function, i.e.
+ * security is not improved if a key length strictly larger than the
+ * digest output length is chosen. Therefore, when using PKCS5 for
+ * password storage, it suffices to store values equal to the digest
+ * output length, nothing is gained by storing larger values.
+ *
+ * == Examples
+ * === Generating a 128 bit key for a Cipher (e.g. AES)
+ * pass = "secret"
+ * salt = OpenSSL::Random.random_bytes(16)
+ * iter = 20000
+ * key_len = 16
+ * key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(pass, salt, iter, key_len)
+ *
+ * === Storing Passwords
+ * pass = "secret"
+ * salt = OpenSSL::Random.random_bytes(16) #store this with the generated value
+ * iter = 20000
+ * digest = OpenSSL::Digest::SHA256.new
+ * len = digest.digest_length
+ * #the final value to be stored
+ * value = OpenSSL::PKCS5.pbkdf2_hmac(pass, salt, iter, len, digest)
+ *
+ * === Important Note on Checking Passwords
+ * When comparing passwords provided by the user with previously stored
+ * values, a common mistake made is comparing the two values using "==".
+ * Typically, "==" short-circuits on evaluation, and is therefore
+ * vulnerable to timing attacks. The proper way is to use a method that
+ * always takes the same amount of time when comparing two values, thus
+ * not leaking any information to potential attackers. To compare two
+ * values, the following could be used:
+ * def eql_time_cmp(a, b)
+ * unless a.length == b.length
+ * return false
+ * end
+ * cmp = b.bytes.to_a
+ * result = 0
+ * a.bytes.each_with_index {|c,i|
+ * result |= c ^ cmp[i]
+ * }
+ * result == 0
+ * end
+ * Please note that the premature return in case of differing lengths
+ * typically does not leak valuable information - when using PKCS#5, the
+ * length of the values to be compared is of fixed size.
+ */
+
+ mPKCS5 = rb_define_module_under(mOSSL, "PKCS5");
+ /* Document-class: OpenSSL::PKCS5::PKCS5Error
+ *
+ * Generic Exception class that is raised if an error occurs during a
+ * computation.
+ */
+ ePKCS5 = rb_define_class_under(mPKCS5, "PKCS5Error", eOSSLError);
+
+ rb_define_module_function(mPKCS5, "pbkdf2_hmac", ossl_pkcs5_pbkdf2_hmac, 5);
+ rb_define_module_function(mPKCS5, "pbkdf2_hmac_sha1", ossl_pkcs5_pbkdf2_hmac_sha1, 4);
+}
diff --git a/ext/openssl/ossl_pkcs5.h b/ext/openssl/ossl_pkcs5.h
new file mode 100644
index 0000000000..a3b132bc50
--- /dev/null
+++ b/ext/openssl/ossl_pkcs5.h
@@ -0,0 +1,6 @@
+#if !defined(_OSSL_PKCS5_H_)
+#define _OSSL_PKCS5_H_
+
+void Init_ossl_pkcs5(void);
+
+#endif /* _OSSL_PKCS5_H_ */
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 79ba0bdf48..bd5dc78947 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -1,58 +1,65 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewPKCS7(klass) \
- TypedData_Wrap_Struct((klass), &ossl_pkcs7_type, 0)
-#define SetPKCS7(obj, pkcs7) do { \
+#define WrapPKCS7(klass, obj, pkcs7) do { \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
- RTYPEDDATA_DATA(obj) = (pkcs7); \
+ (obj) = Data_Wrap_Struct((klass), 0, PKCS7_free, (pkcs7)); \
} while (0)
#define GetPKCS7(obj, pkcs7) do { \
- TypedData_Get_Struct((obj), PKCS7, &ossl_pkcs7_type, (pkcs7)); \
+ Data_Get_Struct((obj), PKCS7, (pkcs7)); \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
} while (0)
+#define SafeGetPKCS7(obj, pkcs7) do { \
+ OSSL_Check_Kind((obj), cPKCS7); \
+ GetPKCS7((obj), (pkcs7)); \
+} while (0)
-#define NewPKCS7si(klass) \
- TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)
-#define SetPKCS7si(obj, p7si) do { \
+#define WrapPKCS7si(klass, obj, p7si) do { \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
- RTYPEDDATA_DATA(obj) = (p7si); \
+ (obj) = Data_Wrap_Struct((klass), 0, PKCS7_SIGNER_INFO_free, (p7si)); \
} while (0)
#define GetPKCS7si(obj, p7si) do { \
- TypedData_Get_Struct((obj), PKCS7_SIGNER_INFO, &ossl_pkcs7_signer_info_type, (p7si)); \
+ Data_Get_Struct((obj), PKCS7_SIGNER_INFO, (p7si)); \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
} while (0)
+#define SafeGetPKCS7si(obj, p7si) do { \
+ OSSL_Check_Kind((obj), cPKCS7Signer); \
+ GetPKCS7si((obj), (p7si)); \
+} while (0)
-#define NewPKCS7ri(klass) \
- TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)
-#define SetPKCS7ri(obj, p7ri) do { \
+#define WrapPKCS7ri(klass, obj, p7ri) do { \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
- RTYPEDDATA_DATA(obj) = (p7ri); \
+ (obj) = Data_Wrap_Struct((klass), 0, PKCS7_RECIP_INFO_free, (p7ri)); \
} while (0)
#define GetPKCS7ri(obj, p7ri) do { \
- TypedData_Get_Struct((obj), PKCS7_RECIP_INFO, &ossl_pkcs7_recip_info_type, (p7ri)); \
+ Data_Get_Struct((obj), PKCS7_RECIP_INFO, (p7ri)); \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
} while (0)
+#define SafeGetPKCS7ri(obj, p7ri) do { \
+ OSSL_Check_Kind((obj), cPKCS7Recipient); \
+ GetPKCS7ri((obj), (p7ri)); \
+} while (0)
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
@@ -69,78 +76,19 @@ 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)
*/
-static PKCS7_SIGNER_INFO *
-ossl_PKCS7_SIGNER_INFO_dup(const PKCS7_SIGNER_INFO *si)
-{
- return (PKCS7_SIGNER_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_SIGNER_INFO,
- (d2i_of_void *)d2i_PKCS7_SIGNER_INFO,
- (char *)si);
-}
-
-static PKCS7_RECIP_INFO *
-ossl_PKCS7_RECIP_INFO_dup(const PKCS7_RECIP_INFO *si)
-{
- return (PKCS7_RECIP_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_RECIP_INFO,
- (d2i_of_void *)d2i_PKCS7_RECIP_INFO,
- (char *)si);
-}
-
static VALUE
ossl_pkcs7si_new(PKCS7_SIGNER_INFO *p7si)
{
PKCS7_SIGNER_INFO *pkcs7;
VALUE obj;
- obj = NewPKCS7si(cPKCS7Signer);
- pkcs7 = p7si ? ossl_PKCS7_SIGNER_INFO_dup(p7si) : PKCS7_SIGNER_INFO_new();
+ pkcs7 = p7si ? PKCS7_SIGNER_INFO_dup(p7si) : PKCS7_SIGNER_INFO_new();
if (!pkcs7) ossl_raise(ePKCS7Error, NULL);
- SetPKCS7si(obj, pkcs7);
+ WrapPKCS7si(cPKCS7Signer, obj, pkcs7);
return obj;
}
@@ -150,8 +98,8 @@ DupPKCS7SignerPtr(VALUE obj)
{
PKCS7_SIGNER_INFO *p7si, *pkcs7;
- GetPKCS7si(obj, p7si);
- if (!(pkcs7 = ossl_PKCS7_SIGNER_INFO_dup(p7si))) {
+ SafeGetPKCS7si(obj, p7si);
+ if (!(pkcs7 = PKCS7_SIGNER_INFO_dup(p7si))) {
ossl_raise(ePKCS7Error, NULL);
}
@@ -164,10 +112,9 @@ ossl_pkcs7ri_new(PKCS7_RECIP_INFO *p7ri)
PKCS7_RECIP_INFO *pkcs7;
VALUE obj;
- obj = NewPKCS7ri(cPKCS7Recipient);
- pkcs7 = p7ri ? ossl_PKCS7_RECIP_INFO_dup(p7ri) : PKCS7_RECIP_INFO_new();
+ pkcs7 = p7ri ? PKCS7_RECIP_INFO_dup(p7ri) : PKCS7_RECIP_INFO_new();
if (!pkcs7) ossl_raise(ePKCS7Error, NULL);
- SetPKCS7ri(obj, pkcs7);
+ WrapPKCS7ri(cPKCS7Recipient, obj, pkcs7);
return obj;
}
@@ -177,8 +124,8 @@ DupPKCS7RecipientPtr(VALUE obj)
{
PKCS7_RECIP_INFO *p7ri, *pkcs7;
- GetPKCS7ri(obj, p7ri);
- if (!(pkcs7 = ossl_PKCS7_RECIP_INFO_dup(p7ri))) {
+ SafeGetPKCS7ri(obj, p7ri);
+ if (!(pkcs7 = PKCS7_RECIP_INFO_dup(p7ri))) {
ossl_raise(ePKCS7Error, NULL);
}
@@ -196,14 +143,13 @@ ossl_pkcs7_s_read_smime(VALUE klass, VALUE arg)
PKCS7 *pkcs7;
VALUE ret, data;
- ret = NewPKCS7(cPKCS7);
- in = ossl_obj2bio(&arg);
+ 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;
- SetPKCS7(ret, pkcs7);
+ WrapPKCS7(cPKCS7, ret, pkcs7);
ossl_pkcs7_set_data(ret, data);
ossl_pkcs7_set_err_string(ret, Qnil);
@@ -226,10 +172,10 @@ ossl_pkcs7_s_write_smime(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "12", &pkcs7, &data, &flags);
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
if(NIL_P(data)) data = ossl_pkcs7_get_data(pkcs7);
- GetPKCS7(pkcs7, p7);
+ SafeGetPKCS7(pkcs7, p7);
if(!NIL_P(data) && PKCS7_is_detached(p7))
flg |= PKCS7_DETACHED;
- in = NIL_P(data) ? NULL : ossl_obj2bio(&data);
+ in = NIL_P(data) ? NULL : ossl_obj2bio(data);
if(!(out = BIO_new(BIO_s_mem()))){
BIO_free(in);
ossl_raise(ePKCS7Error, NULL);
@@ -265,8 +211,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);
+ in = ossl_obj2bio(data);
if(NIL_P(certs)) x509s = NULL;
else{
x509s = ossl_protect_x509_ary2sk(certs, &status);
@@ -280,7 +225,7 @@ ossl_pkcs7_s_sign(int argc, VALUE *argv, VALUE klass)
sk_X509_pop_free(x509s, X509_free);
ossl_raise(ePKCS7Error, NULL);
}
- SetPKCS7(ret, pkcs7);
+ WrapPKCS7(cPKCS7, ret, pkcs7);
ossl_pkcs7_set_data(ret, data);
ossl_pkcs7_set_err_string(ret, Qnil);
BIO_free(in);
@@ -319,10 +264,9 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
#endif
}
- else ciph = ossl_evp_get_cipherbyname(cipher);
+ else ciph = GetCipherPtr(cipher); /* NO NEED TO DUP */
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
- ret = NewPKCS7(cPKCS7);
- in = ossl_obj2bio(&data);
+ in = ossl_obj2bio(data);
x509s = ossl_protect_x509_ary2sk(certs, &status);
if(status){
BIO_free(in);
@@ -334,7 +278,7 @@ ossl_pkcs7_s_encrypt(int argc, VALUE *argv, VALUE klass)
ossl_raise(ePKCS7Error, NULL);
}
BIO_free(in);
- SetPKCS7(ret, p7);
+ WrapPKCS7(cPKCS7, ret, p7);
ossl_pkcs7_set_data(ret, data);
sk_X509_pop_free(x509s, X509_free);
@@ -347,11 +291,10 @@ ossl_pkcs7_alloc(VALUE klass)
PKCS7 *pkcs7;
VALUE obj;
- obj = NewPKCS7(klass);
if (!(pkcs7 = PKCS7_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- SetPKCS7(obj, pkcs7);
+ WrapPKCS7(klass, obj, pkcs7);
return obj;
}
@@ -373,7 +316,7 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
if(rb_scan_args(argc, argv, "01", &arg) == 0)
return self;
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
+ in = ossl_obj2bio(arg);
p7 = PEM_read_bio_PKCS7(in, &pkcs, NULL, NULL);
if (!p7) {
OSSL_BIO_reset(in);
@@ -402,7 +345,7 @@ ossl_pkcs7_copy(VALUE self, VALUE other)
if (self == other) return self;
GetPKCS7(self, a);
- GetPKCS7(other, b);
+ SafeGetPKCS7(other, b);
pkcs7 = PKCS7_dup(b);
if (!pkcs7) {
@@ -433,13 +376,12 @@ ossl_pkcs7_sym2typeid(VALUE sym)
{ "digest", NID_pkcs7_digest },
};
- if (SYMBOL_P(sym)) sym = rb_sym2str(sym);
+ 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 \"%"PRIsVALUE"\"", sym);
+ 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;
@@ -525,7 +467,7 @@ ossl_pkcs7_set_cipher(VALUE self, VALUE cipher)
PKCS7 *pkcs7;
GetPKCS7(self, pkcs7);
- if (!PKCS7_set_cipher(pkcs7, ossl_evp_get_cipherbyname(cipher))) {
+ if (!PKCS7_set_cipher(pkcs7, GetCipherPtr(cipher))) {
ossl_raise(ePKCS7Error, NULL);
}
@@ -760,12 +702,10 @@ 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);
+ in = NIL_P(indata) ? NULL : ossl_obj2bio(indata);
if(NIL_P(certs)) x509s = NULL;
else{
x509s = ossl_protect_x509_ary2sk(certs, &status);
@@ -774,6 +714,8 @@ 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);
@@ -781,13 +723,13 @@ ossl_pkcs7_verify(int argc, VALUE *argv, VALUE self)
}
ok = PKCS7_verify(p7, x509s, x509st, in, out, flg);
BIO_free(in);
- sk_X509_pop_free(x509s, X509_free);
- if (ok < 0) ossl_raise(ePKCS7Error, "PKCS7_verify");
- msg = ERR_reason_error_string(ERR_peek_error());
+ if (ok < 0) ossl_raise(ePKCS7Error, NULL);
+ msg = ERR_reason_error_string(ERR_get_error());
ossl_pkcs7_set_err_string(self, msg ? rb_str_new2(msg) : Qnil);
- ossl_clear_error();
+ 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;
}
@@ -827,12 +769,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)
@@ -844,7 +786,7 @@ ossl_pkcs7_add_data(VALUE self, VALUE data)
ossl_pkcs7_set_data(self, Qnil);
err:
- BIO_free_all(out);
+ BIO_free(out);
BIO_free(in);
if(ERR_peek_error()){
ossl_raise(ePKCS7Error, NULL);
@@ -902,11 +844,10 @@ ossl_pkcs7si_alloc(VALUE klass)
PKCS7_SIGNER_INFO *p7si;
VALUE obj;
- obj = NewPKCS7si(klass);
if (!(p7si = PKCS7_SIGNER_INFO_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- SetPKCS7si(obj, p7si);
+ WrapPKCS7si(klass, obj, p7si);
return obj;
}
@@ -921,7 +862,7 @@ ossl_pkcs7si_initialize(VALUE self, VALUE cert, VALUE key, VALUE digest)
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ md = GetDigestPtr(digest);
GetPKCS7si(self, p7si);
if (!(PKCS7_SIGNER_INFO_set(p7si, x509, pkey, (EVP_MD*)md))) {
ossl_raise(ePKCS7Error, NULL);
@@ -982,11 +923,10 @@ ossl_pkcs7ri_alloc(VALUE klass)
PKCS7_RECIP_INFO *p7ri;
VALUE obj;
- obj = NewPKCS7ri(klass);
if (!(p7ri = PKCS7_RECIP_INFO_new())) {
ossl_raise(ePKCS7Error, NULL);
}
- SetPKCS7ri(obj, p7ri);
+ WrapPKCS7ri(klass, obj, p7ri);
return obj;
}
@@ -1040,14 +980,8 @@ ossl_pkcs7ri_get_enc_key(VALUE self)
* INIT
*/
void
-Init_ossl_pkcs7(void)
+Init_ossl_pkcs7()
{
-#undef rb_intern
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
-#endif
-
cPKCS7 = rb_define_class_under(mOSSL, "PKCS7", rb_cObject);
ePKCS7Error = rb_define_class_under(cPKCS7, "PKCS7Error", eOSSLError);
rb_define_singleton_method(cPKCS7, "read_smime", ossl_pkcs7_s_read_smime, 1);
@@ -1057,7 +991,7 @@ Init_ossl_pkcs7(void)
rb_attr(cPKCS7, rb_intern("data"), 1, 0, Qfalse);
rb_attr(cPKCS7, rb_intern("error_string"), 1, 1, Qfalse);
rb_define_alloc_func(cPKCS7, ossl_pkcs7_alloc);
- rb_define_method(cPKCS7, "initialize_copy", ossl_pkcs7_copy, 1);
+ rb_define_copy_func(cPKCS7, ossl_pkcs7_copy);
rb_define_method(cPKCS7, "initialize", ossl_pkcs7_initialize, -1);
rb_define_method(cPKCS7, "type=", ossl_pkcs7_set_type, 1);
rb_define_method(cPKCS7, "type", ossl_pkcs7_get_type, 0);
diff --git a/ext/openssl/ossl_pkcs7.h b/ext/openssl/ossl_pkcs7.h
index 139e00d640..371c421103 100644
--- a/ext/openssl/ossl_pkcs7.h
+++ b/ext/openssl/ossl_pkcs7.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_PKCS7_H_)
@@ -18,3 +19,4 @@ 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 e1fffb2446..878b221270 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
@@ -15,26 +16,25 @@
VALUE mPKey;
VALUE cPKey;
VALUE ePKeyError;
-static ID id_private_q;
+ID id_private_q;
/*
* callback for generating keys
*/
-static VALUE
-call_check_ints0(VALUE arg)
+void
+ossl_generate_cb(int p, int n, void *arg)
{
- rb_thread_check_ints();
- return Qnil;
-}
+ VALUE ary;
-static void *
-call_check_ints(void *arg)
-{
- int state;
- rb_protect(call_check_ints0, Qnil, &state);
- return (void *)(VALUE)state;
+ ary = rb_ary_new2(2);
+ rb_ary_store(ary, 0, INT2NUM(p));
+ rb_ary_store(ary, 1, INT2NUM(n));
+
+ rb_yield(ary);
}
+#if HAVE_BN_GENCB
+/* OpenSSL 2nd version of GN generation callback */
int
ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
{
@@ -42,7 +42,7 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
struct ossl_generate_cb_arg *arg;
int state;
- arg = (struct ossl_generate_cb_arg *)BN_GENCB_get_arg(cb);
+ arg = (struct ossl_generate_cb_arg *)cb->arg;
if (arg->yield) {
ary = rb_ary_new2(2);
rb_ary_store(ary, 0, INT2NUM(p));
@@ -53,18 +53,11 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
*/
rb_protect(rb_yield, ary, &state);
if (state) {
+ arg->stop = 1;
arg->state = state;
- return 0;
- }
- }
- if (arg->interrupted) {
- arg->interrupted = 0;
- state = (int)(VALUE)rb_thread_call_with_gvl(call_check_ints, NULL);
- if (state) {
- arg->state = state;
- return 0;
}
}
+ if (arg->stop) return 0;
return 1;
}
@@ -72,36 +65,20 @@ void
ossl_generate_cb_stop(void *ptr)
{
struct ossl_generate_cb_arg *arg = (struct ossl_generate_cb_arg *)ptr;
- arg->interrupted = 1;
-}
-
-static void
-ossl_evp_pkey_free(void *ptr)
-{
- EVP_PKEY_free(ptr);
+ arg->stop = 1;
}
+#endif
/*
* Public
*/
-const rb_data_type_t ossl_evp_pkey_type = {
- "OpenSSL/EVP_PKEY",
- {
- 0, ossl_evp_pkey_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
-
-static VALUE
-pkey_new0(EVP_PKEY *pkey)
+VALUE
+ossl_pkey_new(EVP_PKEY *pkey)
{
- VALUE obj;
- int type;
-
- if (!pkey || (type = EVP_PKEY_base_id(pkey)) == EVP_PKEY_NONE)
- ossl_raise(rb_eRuntimeError, "pkey is empty");
-
- switch (type) {
+ if (!pkey) {
+ ossl_raise(ePKeyError, "Cannot make new key from NULL.");
+ }
+ switch (EVP_PKEY_type(pkey->type)) {
#if !defined(OPENSSL_NO_RSA)
case EVP_PKEY_RSA:
return ossl_rsa_new(pkey);
@@ -114,123 +91,91 @@ pkey_new0(EVP_PKEY *pkey)
case EVP_PKEY_DH:
return ossl_dh_new(pkey);
#endif
-#if !defined(OPENSSL_NO_EC)
+#if !defined(OPENSSL_NO_EC) && (OPENSSL_VERSION_NUMBER >= 0x0090802fL)
case EVP_PKEY_EC:
return ossl_ec_new(pkey);
#endif
default:
- obj = NewPKey(cPKey);
- SetPKey(obj, pkey);
- return obj;
+ ossl_raise(ePKeyError, "unsupported key type");
}
+
+ UNREACHABLE;
}
VALUE
-ossl_pkey_new(EVP_PKEY *pkey)
+ossl_pkey_new_from_file(VALUE filename)
{
- VALUE obj;
- int status;
+ FILE *fp;
+ EVP_PKEY *pkey;
- obj = rb_protect((VALUE (*)(VALUE))pkey_new0, (VALUE)pkey, &status);
- if (status) {
- EVP_PKEY_free(pkey);
- rb_jump_tag(status);
+ SafeStringValue(filename);
+ if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
+ ossl_raise(ePKeyError, "%s", strerror(errno));
}
+ rb_fd_fix_cloexec(fileno(fp));
- return obj;
+ pkey = PEM_read_PrivateKey(fp, NULL, ossl_pem_passwd_cb, NULL);
+ fclose(fp);
+ if (!pkey) {
+ ossl_raise(ePKeyError, NULL);
+ }
+
+ return ossl_pkey_new(pkey);
}
/*
* call-seq:
- * OpenSSL::PKey.read(string [, pwd ]) -> PKey
- * OpenSSL::PKey.read(io [, pwd ]) -> PKey
- *
- * Reads a DER or PEM encoded string from _string_ or _io_ and returns an
- * instance of the appropriate PKey class.
+ * OpenSSL::PKey.read(string [, pwd ] ) -> PKey
+ * OpenSSL::PKey.read(file [, pwd ]) -> PKey
*
* === Parameters
- * * _string+ is a DER- or PEM-encoded string containing an arbitrary private
- * or public key.
- * * _io_ is an instance of IO containing a DER- or PEM-encoded
- * arbitrary private or public key.
- * * _pwd_ is an optional password in case _string_ or _io_ is an encrypted
- * PEM resource.
+ * * +string+ is a DER- or PEM-encoded string containing an arbitrary private
+ * or public key.
+ * * +file+ is an instance of +File+ containing a DER- or PEM-encoded
+ * arbitrary private or public key.
+ * * +pwd+ is an optional password in case +string+ or +file+ is an encrypted
+ * PEM resource.
*/
static VALUE
ossl_pkey_new_from_data(int argc, VALUE *argv, VALUE self)
{
- EVP_PKEY *pkey;
- BIO *bio;
- VALUE data, pass;
+ EVP_PKEY *pkey;
+ BIO *bio;
+ VALUE data, pass;
+ char *passwd = NULL;
- rb_scan_args(argc, argv, "11", &data, &pass);
- pass = ossl_pem_passwd_value(pass);
+ rb_scan_args(argc, argv, "11", &data, &pass);
- bio = ossl_obj2bio(&data);
- if (!(pkey = d2i_PrivateKey_bio(bio, NULL))) {
+ bio = ossl_obj2bio(data);
+ if (!(pkey = d2i_PrivateKey_bio(bio, NULL))) {
OSSL_BIO_reset(bio);
- if (!(pkey = PEM_read_bio_PrivateKey(bio, NULL, ossl_pem_passwd_cb, (void *)pass))) {
+ if (!NIL_P(pass)) {
+ passwd = StringValuePtr(pass);
+ }
+ if (!(pkey = PEM_read_bio_PrivateKey(bio, NULL, ossl_pem_passwd_cb, passwd))) {
OSSL_BIO_reset(bio);
if (!(pkey = d2i_PUBKEY_bio(bio, NULL))) {
OSSL_BIO_reset(bio);
- pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, (void *)pass);
+ if (!NIL_P(pass)) {
+ passwd = StringValuePtr(pass);
+ }
+ pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, passwd);
}
}
}
BIO_free(bio);
if (!pkey)
- ossl_raise(ePKeyError, "Could not parse PKey");
-
+ ossl_raise(rb_eArgError, "Could not parse PKey");
return ossl_pkey_new(pkey);
}
-void
-ossl_pkey_check_public_key(const EVP_PKEY *pkey)
-{
- void *ptr;
- const BIGNUM *n, *e, *pubkey;
-
- if (EVP_PKEY_missing_parameters(pkey))
- ossl_raise(ePKeyError, "parameters missing");
-
- /* OpenSSL < 1.1.0 takes non-const pointer */
- ptr = EVP_PKEY_get0((EVP_PKEY *)pkey);
- switch (EVP_PKEY_base_id(pkey)) {
- case EVP_PKEY_RSA:
- RSA_get0_key(ptr, &n, &e, NULL);
- if (n && e)
- return;
- break;
- case EVP_PKEY_DSA:
- DSA_get0_key(ptr, &pubkey, NULL);
- if (pubkey)
- return;
- break;
- case EVP_PKEY_DH:
- DH_get0_key(ptr, &pubkey, NULL);
- if (pubkey)
- return;
- break;
-#if !defined(OPENSSL_NO_EC)
- case EVP_PKEY_EC:
- if (EC_KEY_get0_public_key(ptr))
- return;
- break;
-#endif
- default:
- /* unsupported type; assuming ok */
- return;
- }
- ossl_raise(ePKeyError, "public key missing");
-}
-
EVP_PKEY *
GetPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- GetPKey(obj, pkey);
+ SafeGetPKey(obj, pkey);
return pkey;
}
@@ -240,10 +185,10 @@ GetPrivPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- if (rb_funcallv(obj, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
- GetPKey(obj, pkey);
+ SafeGetPKey(obj, pkey);
return pkey;
}
@@ -253,8 +198,22 @@ DupPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- GetPKey(obj, pkey);
- EVP_PKEY_up_ref(pkey);
+ SafeGetPKey(obj, pkey);
+ CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
+
+ return pkey;
+}
+
+EVP_PKEY *
+DupPrivPKeyPtr(VALUE obj)
+{
+ EVP_PKEY *pkey;
+
+ if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
+ ossl_raise(rb_eArgError, "Private key is needed.");
+ }
+ SafeGetPKey(obj, pkey);
+ CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
return pkey;
}
@@ -268,11 +227,10 @@ ossl_pkey_alloc(VALUE klass)
EVP_PKEY *pkey;
VALUE obj;
- obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
ossl_raise(ePKeyError, NULL);
}
- SetPKey(obj, pkey);
+ WrapPKey(klass, obj, pkey);
return obj;
}
@@ -282,13 +240,13 @@ ossl_pkey_alloc(VALUE klass)
* PKeyClass.new -> self
*
* Because PKey is an abstract class, actually calling this method explicitly
- * will raise a NotImplementedError.
+ * will raise a +NotImplementedError+.
*/
static VALUE
ossl_pkey_initialize(VALUE self)
{
if (rb_obj_is_instance_of(self, cPKey)) {
- ossl_raise(rb_eTypeError, "OpenSSL::PKey::PKey can't be instantiated directly");
+ ossl_raise(rb_eNotImpError, "OpenSSL::PKey::PKey is an abstract class.");
}
return self;
}
@@ -297,10 +255,10 @@ ossl_pkey_initialize(VALUE self)
* call-seq:
* pkey.sign(digest, data) -> String
*
- * To sign the String _data_, _digest_, an instance of OpenSSL::Digest, must
- * be provided. The return value is again a String containing the signature.
+ * To sign the +String+ +data+, +digest+, an instance of OpenSSL::Digest, must
+ * be provided. The return value is again a +String+ containing the signature.
* A PKeyError is raised should errors occur.
- * Any previous state of the Digest instance is irrelevant to the signature
+ * Any previous state of the +Digest+ instance is irrelevant to the signature
* outcome, the digest instance is reset to its initial state during the
* operation.
*
@@ -314,32 +272,21 @@ static VALUE
ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
{
EVP_PKEY *pkey;
- const EVP_MD *md;
- EVP_MD_CTX *ctx;
+ EVP_MD_CTX ctx;
unsigned int buf_len;
VALUE str;
- int result;
- pkey = GetPrivPKeyPtr(self);
- md = ossl_evp_get_digestbyname(digest);
- StringValue(data);
- str = rb_str_new(0, EVP_PKEY_size(pkey));
-
- ctx = EVP_MD_CTX_new();
- if (!ctx)
- ossl_raise(ePKeyError, "EVP_MD_CTX_new");
- if (!EVP_SignInit_ex(ctx, md, NULL)) {
- EVP_MD_CTX_free(ctx);
- ossl_raise(ePKeyError, "EVP_SignInit_ex");
- }
- if (!EVP_SignUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data))) {
- EVP_MD_CTX_free(ctx);
- ossl_raise(ePKeyError, "EVP_SignUpdate");
+ if (rb_funcall(self, id_private_q, 0, NULL) != Qtrue) {
+ ossl_raise(rb_eArgError, "Private key is needed.");
}
- result = EVP_SignFinal(ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey);
- EVP_MD_CTX_free(ctx);
- if (!result)
- ossl_raise(ePKeyError, "EVP_SignFinal");
+ GetPKey(self, pkey);
+ EVP_SignInit(&ctx, GetDigestPtr(digest));
+ 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))
+ ossl_raise(ePKeyError, NULL);
+ assert((long)buf_len <= RSTRING_LEN(str));
rb_str_set_len(str, buf_len);
return str;
@@ -349,12 +296,12 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
* call-seq:
* pkey.verify(digest, signature, data) -> String
*
- * To verify the String _signature_, _digest_, an instance of
+ * To verify the +String+ +signature+, +digest+, an instance of
* OpenSSL::Digest, must be provided to re-compute the message digest of the
- * original _data_, also a String. The return value is +true+ if the
+ * original +data+, also a +String+. The return value is +true+ if the
* signature is valid, +false+ otherwise. A PKeyError is raised should errors
* occur.
- * Any previous state of the Digest instance is irrelevant to the validation
+ * Any previous state of the +Digest+ instance is irrelevant to the validation
* outcome, the digest instance is reset to its initial state during the
* operation.
*
@@ -370,51 +317,35 @@ static VALUE
ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
{
EVP_PKEY *pkey;
- const EVP_MD *md;
- EVP_MD_CTX *ctx;
- int siglen, result;
+ EVP_MD_CTX ctx;
+ int result;
GetPKey(self, pkey);
- ossl_pkey_check_public_key(pkey);
- md = ossl_evp_get_digestbyname(digest);
StringValue(sig);
- siglen = RSTRING_LENINT(sig);
StringValue(data);
-
- ctx = EVP_MD_CTX_new();
- if (!ctx)
- ossl_raise(ePKeyError, "EVP_MD_CTX_new");
- if (!EVP_VerifyInit_ex(ctx, md, NULL)) {
- EVP_MD_CTX_free(ctx);
- ossl_raise(ePKeyError, "EVP_VerifyInit_ex");
- }
- if (!EVP_VerifyUpdate(ctx, RSTRING_PTR(data), RSTRING_LEN(data))) {
- EVP_MD_CTX_free(ctx);
- ossl_raise(ePKeyError, "EVP_VerifyUpdate");
- }
- result = EVP_VerifyFinal(ctx, (unsigned char *)RSTRING_PTR(sig), siglen, pkey);
- EVP_MD_CTX_free(ctx);
+ EVP_VerifyInit(&ctx, GetDigestPtr(digest));
+ EVP_VerifyUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
+ result = EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey);
+ EVP_MD_CTX_cleanup(&ctx);
switch (result) {
case 0:
- ossl_clear_error();
return Qfalse;
case 1:
return Qtrue;
default:
- ossl_raise(ePKeyError, "EVP_VerifyFinal");
+ ossl_raise(ePKeyError, NULL);
}
+ return Qnil; /* dummy */
}
/*
* INIT
*/
void
-Init_ossl_pkey(void)
+Init_ossl_pkey()
{
-#undef rb_intern
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
/* Document-module: OpenSSL::PKey
@@ -426,7 +357,7 @@ Init_ossl_pkey(void)
* algorithm consists of two parts: a public key that may be distributed
* to others and a private key that needs to remain secret.
*
- * Messages encrypted with a public key can only be decrypted by
+ * Messages encrypted with a public key can only be encrypted by
* recipients that are in possession of the associated private key.
* Since public key algorithms are considerably slower than symmetric
* key algorithms (cf. OpenSSL::Cipher) they are often used to establish
@@ -505,3 +436,4 @@ Init_ossl_pkey(void)
Init_ossl_dh();
Init_ossl_ec();
}
+
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index a2a9fc0df3..686e956ee5 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_PKEY_H_)
@@ -13,41 +14,48 @@
extern VALUE mPKey;
extern VALUE cPKey;
extern VALUE ePKeyError;
-extern const rb_data_type_t ossl_evp_pkey_type;
+extern ID id_private_q;
#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 NewPKey(klass) \
- TypedData_Wrap_Struct((klass), &ossl_evp_pkey_type, 0)
-#define SetPKey(obj, pkey) do { \
+#define WrapPKey(klass, obj, pkey) do { \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (pkey); \
+ (obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)
#define GetPKey(obj, pkey) do {\
- TypedData_Get_Struct((obj), EVP_PKEY, &ossl_evp_pkey_type, (pkey)); \
+ Data_Get_Struct((obj), EVP_PKEY, (pkey));\
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \
} while (0)
+#define SafeGetPKey(obj, pkey) do { \
+ OSSL_Check_Kind((obj), cPKey); \
+ GetPKey((obj), (pkey)); \
+} while (0)
+void ossl_generate_cb(int, int, void *);
+#define HAVE_BN_GENCB defined(HAVE_RSA_GENERATE_KEY_EX) || defined(HAVE_DH_GENERATE_PARAMETERS_EX) || defined(HAVE_DSA_GENERATE_PARAMETERS_EX)
+#if HAVE_BN_GENCB
struct ossl_generate_cb_arg {
int yield;
- int interrupted;
+ int stop;
int state;
};
int ossl_generate_cb_2(int p, int n, BN_GENCB *cb);
void ossl_generate_cb_stop(void *ptr);
+#endif
VALUE ossl_pkey_new(EVP_PKEY *);
-void ossl_pkey_check_public_key(const EVP_PKEY *);
+VALUE ossl_pkey_new_from_file(VALUE);
EVP_PKEY *GetPKeyPtr(VALUE);
EVP_PKEY *DupPKeyPtr(VALUE);
EVP_PKEY *GetPrivPKeyPtr(VALUE);
+EVP_PKEY *DupPrivPKeyPtr(VALUE);
void Init_ossl_pkey(void);
/*
@@ -73,6 +81,8 @@ 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);
@@ -89,153 +99,53 @@ extern VALUE eEC_POINT;
VALUE ossl_ec_new(EVP_PKEY *);
void Init_ossl_ec(void);
-#define OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, _name, _get) \
+
+#define OSSL_PKEY_BN(keytype, name) \
/* \
* call-seq: \
- * _keytype##.##_name -> aBN \
+ * key.##name -> aBN \
*/ \
-static VALUE ossl_##_keytype##_get_##_name(VALUE self) \
+static VALUE ossl_##keytype##_get_##name(VALUE self) \
{ \
- _type *obj; \
- const BIGNUM *bn; \
+ EVP_PKEY *pkey; \
+ BIGNUM *bn; \
\
- Get##_type(self, obj); \
- _get; \
+ GetPKey(self, pkey); \
+ bn = pkey->pkey.keytype->name; \
if (bn == NULL) \
return Qnil; \
return ossl_bn_new(bn); \
-}
-
-#define OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a1, \
- _type##_get0_##_group(obj, &bn, NULL, NULL)) \
- OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a2, \
- _type##_get0_##_group(obj, NULL, &bn, NULL)) \
- OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a3, \
- _type##_get0_##_group(obj, NULL, NULL, &bn))
-
-#define OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a1, \
- _type##_get0_##_group(obj, &bn, NULL)) \
- OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a2, \
- _type##_get0_##_group(obj, NULL, &bn))
-
-#define OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3) \
+} \
/* \
* call-seq: \
- * _keytype##.set_##_group(a1, a2, a3) -> self \
+ * key.##name = bn -> bn \
*/ \
-static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2, VALUE v3) \
+static VALUE ossl_##keytype##_set_##name(VALUE self, VALUE bignum) \
{ \
- _type *obj; \
- BIGNUM *bn1 = NULL, *orig_bn1 = NIL_P(v1) ? NULL : GetBNPtr(v1);\
- BIGNUM *bn2 = NULL, *orig_bn2 = NIL_P(v2) ? NULL : GetBNPtr(v2);\
- BIGNUM *bn3 = NULL, *orig_bn3 = NIL_P(v3) ? NULL : GetBNPtr(v3);\
- \
- Get##_type(self, obj); \
- if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \
- orig_bn2 && !(bn2 = BN_dup(orig_bn2)) || \
- orig_bn3 && !(bn3 = BN_dup(orig_bn3))) { \
- BN_clear_free(bn1); \
- BN_clear_free(bn2); \
- BN_clear_free(bn3); \
- ossl_raise(eBNError, NULL); \
- } \
- \
- if (!_type##_set0_##_group(obj, bn1, bn2, bn3)) { \
- BN_clear_free(bn1); \
- BN_clear_free(bn2); \
- BN_clear_free(bn3); \
- ossl_raise(ePKeyError, #_type"_set0_"#_group); \
- } \
- return self; \
-}
-
-#define OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2) \
-/* \
- * call-seq: \
- * _keytype##.set_##_group(a1, a2) -> self \
- */ \
-static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2) \
-{ \
- _type *obj; \
- BIGNUM *bn1 = NULL, *orig_bn1 = NIL_P(v1) ? NULL : GetBNPtr(v1);\
- BIGNUM *bn2 = NULL, *orig_bn2 = NIL_P(v2) ? NULL : GetBNPtr(v2);\
- \
- Get##_type(self, obj); \
- if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \
- orig_bn2 && !(bn2 = BN_dup(orig_bn2))) { \
- BN_clear_free(bn1); \
- BN_clear_free(bn2); \
- ossl_raise(eBNError, NULL); \
- } \
- \
- if (!_type##_set0_##_group(obj, bn1, bn2)) { \
- BN_clear_free(bn1); \
- BN_clear_free(bn2); \
- ossl_raise(ePKeyError, #_type"_set0_"#_group); \
- } \
- return self; \
-}
-
-#define OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, _name) \
-/* \
- * call-seq: \
- * _keytype##.##_name = bn -> bn \
- */ \
-static VALUE ossl_##_keytype##_set_##_name(VALUE self, VALUE bignum) \
-{ \
- _type *obj; \
+ EVP_PKEY *pkey; \
BIGNUM *bn; \
\
- rb_warning("#"#_name"= is deprecated; use #set_"#_group); \
- Get##_type(self, obj); \
+ GetPKey(self, pkey); \
if (NIL_P(bignum)) { \
- BN_clear_free(obj->_name); \
- obj->_name = NULL; \
+ BN_clear_free(pkey->pkey.keytype->name); \
+ pkey->pkey.keytype->name = NULL; \
return Qnil; \
} \
\
bn = GetBNPtr(bignum); \
- if (obj->_name == NULL) \
- obj->_name = BN_new(); \
- if (obj->_name == NULL) \
+ if (pkey->pkey.keytype->name == NULL) \
+ pkey->pkey.keytype->name = BN_new(); \
+ if (pkey->pkey.keytype->name == NULL) \
ossl_raise(eBNError, NULL); \
- if (BN_copy(obj->_name, bn) == NULL) \
+ if (BN_copy(pkey->pkey.keytype->name, bn) == NULL) \
ossl_raise(eBNError, NULL); \
return bignum; \
}
-#if defined(HAVE_OPAQUE_OPENSSL) /* OpenSSL 1.1.0 */
-#define OSSL_PKEY_BN_DEF3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3)
-
-#define OSSL_PKEY_BN_DEF2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2)
-
#define DEF_OSSL_PKEY_BN(class, keytype, name) \
- rb_define_method((class), #name, ossl_##keytype##_get_##name, 0)
-
-#else
-#define OSSL_PKEY_BN_DEF3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3) \
- OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a1) \
- OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a2) \
- OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a3)
-
-#define OSSL_PKEY_BN_DEF2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2) \
- OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a1) \
- OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a2)
-
-#define DEF_OSSL_PKEY_BN(class, keytype, name) do { \
- rb_define_method((class), #name, ossl_##keytype##_get_##name, 0);\
+do { \
+ rb_define_method((class), #name, ossl_##keytype##_get_##name, 0); \
rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\
} while (0)
-#endif /* HAVE_OPAQUE_OPENSSL */
#endif /* _OSSL_PKEY_H_ */
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 31f3b8e726..011b6f00b4 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -1,27 +1,32 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
-#include "ossl.h"
-
#if !defined(OPENSSL_NO_DH)
+#include "ossl.h"
+
#define GetPKeyDH(obj, pkey) do { \
GetPKey((obj), (pkey)); \
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) { /* PARANOIA? */ \
+ if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DH) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A DH!") ; \
} \
} while (0)
-#define GetDH(obj, dh) do { \
- EVP_PKEY *_pkey; \
- GetPKeyDH((obj), _pkey); \
- (dh) = EVP_PKEY_get0_DH(_pkey); \
-} while (0)
+
+#define DH_HAS_PRIVATE(dh) ((dh)->priv_key)
+
+#ifdef OSSL_ENGINE_ENABLED
+# define DH_PRIVATE(dh) (DH_HAS_PRIVATE(dh) || (dh)->engine)
+#else
+# define DH_PRIVATE(dh) DH_HAS_PRIVATE(dh)
+#endif
+
/*
* Classes
@@ -41,7 +46,6 @@ dh_instance(VALUE klass, DH *dh)
if (!dh) {
return Qfalse;
}
- obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -49,7 +53,7 @@ dh_instance(VALUE klass, DH *dh)
EVP_PKEY_free(pkey);
return Qfalse;
}
- SetPKey(obj, pkey);
+ WrapPKey(klass, obj, pkey);
return obj;
}
@@ -62,11 +66,10 @@ ossl_dh_new(EVP_PKEY *pkey)
if (!pkey) {
obj = dh_instance(cDH, DH_new());
} else {
- obj = NewPKey(cDH);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) {
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) {
ossl_raise(rb_eTypeError, "Not a DH key!");
}
- SetPKey(obj, pkey);
+ WrapPKey(cDH, obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eDHError, NULL);
@@ -78,6 +81,7 @@ ossl_dh_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_DH_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
struct dh_blocking_gen_arg {
DH *dh;
int size;
@@ -93,28 +97,27 @@ dh_blocking_gen(void *arg)
gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
return 0;
}
+#endif
static DH *
dh_generate(int size, int gen)
{
- struct ossl_generate_cb_arg cb_arg = { 0 };
+#if defined(HAVE_DH_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
struct dh_blocking_gen_arg gen_arg;
DH *dh = DH_new();
- BN_GENCB *cb = BN_GENCB_new();
- if (!dh || !cb) {
- DH_free(dh);
- BN_GENCB_free(cb);
- return NULL;
- }
+ if (!dh) return 0;
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
if (rb_block_given_p())
cb_arg.yield = 1;
- BN_GENCB_set(cb, ossl_generate_cb_2, &cb_arg);
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
gen_arg.dh = dh;
gen_arg.size = size;
gen_arg.gen = gen;
- gen_arg.cb = cb;
+ gen_arg.cb = &cb;
if (cb_arg.yield == 1) {
/* we cannot release GVL when callback proc is supplied */
dh_blocking_gen(&gen_arg);
@@ -123,20 +126,21 @@ dh_generate(int size, int gen)
rb_thread_call_without_gvl(dh_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
}
- BN_GENCB_free(cb);
if (!gen_arg.result) {
DH_free(dh);
- if (cb_arg.state) {
- /* Clear OpenSSL error queue before re-raising. */
- ossl_clear_error();
- rb_jump_tag(cb_arg.state);
- }
- return NULL;
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
+ return 0;
}
+#else
+ DH *dh;
+
+ dh = DH_generate_parameters(size, gen, rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
+ if (!dh) return 0;
+#endif
if (!DH_generate_key(dh)) {
DH_free(dh);
- return NULL;
+ return 0;
}
return dh;
@@ -150,8 +154,8 @@ dh_generate(int size, int gen)
* components alike.
*
* === Parameters
- * * _size_ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
- * * _generator_ is a small number > 1, typically 2 or 5.
+ * * +size+ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
+ * * +generator+ is a small number > 1, typically 2 or 5.
*
*/
static VALUE
@@ -175,21 +179,19 @@ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
}
/*
- * call-seq:
- * DH.new -> dh
- * DH.new(string) -> dh
- * DH.new(size [, generator]) -> dh
+ * call-seq:
+ * DH.new([size [, generator] | string]) -> dh
*
* Either generates a DH instance from scratch or by reading already existing
- * DH parameters from _string_. Note that when reading a DH instance from
+ * DH parameters from +string+. Note that when reading a DH instance from
* data that was encoded from a DH instance by using DH#to_pem or DH#to_der
* the result will *not* contain a public/private key pair yet. This needs to
* be generated using DH#generate_key! first.
*
* === Parameters
- * * _size_ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
- * * _generator_ is a small number > 1, typically 2 or 5.
- * * _string_ contains the DER or PEM encoded key.
+ * * +size+ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
+ * * +generator+ is a small number > 1, typically 2 or 5.
+ * * +string+ contains the DER or PEM encoded key.
*
* === Examples
* DH.new # -> dh
@@ -212,17 +214,17 @@ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
if(rb_scan_args(argc, argv, "02", &arg, &gen) == 0) {
dh = DH_new();
}
- else if (RB_INTEGER_TYPE_P(arg)) {
+ else if (FIXNUM_P(arg)) {
if (!NIL_P(gen)) {
g = NUM2INT(gen);
}
- if (!(dh = dh_generate(NUM2INT(arg), g))) {
+ if (!(dh = dh_generate(FIX2INT(arg), g))) {
ossl_raise(eDHError, NULL);
}
}
else {
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
+ in = ossl_obj2bio(arg);
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
if (!dh){
OSSL_BIO_reset(in);
@@ -240,39 +242,6 @@ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-ossl_dh_initialize_copy(VALUE self, VALUE other)
-{
- EVP_PKEY *pkey;
- DH *dh, *dh_other;
- const BIGNUM *pub, *priv;
-
- GetPKey(self, pkey);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
- ossl_raise(eDHError, "DH already initialized");
- GetDH(other, dh_other);
-
- dh = DHparams_dup(dh_other);
- if (!dh)
- ossl_raise(eDHError, "DHparams_dup");
- EVP_PKEY_assign_DH(pkey, dh);
-
- DH_get0_key(dh_other, &pub, &priv);
- if (pub) {
- BIGNUM *pub2 = BN_dup(pub);
- BIGNUM *priv2 = BN_dup(priv);
-
- if (!pub2 || priv && !priv2) {
- BN_clear_free(pub2);
- BN_clear_free(priv2);
- ossl_raise(eDHError, "BN_dup");
- }
- DH_set0_key(dh, pub2, priv2);
- }
-
- return self;
-}
-
/*
* call-seq:
* dh.public? -> true | false
@@ -283,13 +252,11 @@ ossl_dh_initialize_copy(VALUE self, VALUE other)
static VALUE
ossl_dh_is_public(VALUE self)
{
- DH *dh;
- const BIGNUM *bn;
+ EVP_PKEY *pkey;
- GetDH(self, dh);
- DH_get0_key(dh, &bn, NULL);
+ GetPKeyDH(self, pkey);
- return bn ? Qtrue : Qfalse;
+ return (pkey->pkey.dh->pub_key) ? Qtrue : Qfalse;
}
/*
@@ -302,17 +269,11 @@ ossl_dh_is_public(VALUE self)
static VALUE
ossl_dh_is_private(VALUE self)
{
- DH *dh;
- const BIGNUM *bn;
+ EVP_PKEY *pkey;
- GetDH(self, dh);
- DH_get0_key(dh, NULL, &bn);
+ GetPKeyDH(self, pkey);
-#if !defined(OPENSSL_NO_ENGINE)
- return (bn || DH_get0_engine(dh)) ? Qtrue : Qfalse;
-#else
- return bn ? Qtrue : Qfalse;
-#endif
+ return (DH_PRIVATE(pkey->pkey.dh)) ? Qtrue : Qfalse;
}
/*
@@ -328,15 +289,15 @@ ossl_dh_is_private(VALUE self)
static VALUE
ossl_dh_export(VALUE self)
{
- DH *dh;
+ EVP_PKEY *pkey;
BIO *out;
VALUE str;
- GetDH(self, dh);
+ GetPKeyDH(self, pkey);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eDHError, NULL);
}
- if (!PEM_write_bio_DHparams(out, dh)) {
+ if (!PEM_write_bio_DHparams(out, pkey->pkey.dh)) {
BIO_free(out);
ossl_raise(eDHError, NULL);
}
@@ -357,17 +318,17 @@ ossl_dh_export(VALUE self)
static VALUE
ossl_dh_to_der(VALUE self)
{
- DH *dh;
+ EVP_PKEY *pkey;
unsigned char *p;
long len;
VALUE str;
- GetDH(self, dh);
- if((len = i2d_DHparams(dh, NULL)) <= 0)
+ GetPKeyDH(self, pkey);
+ if((len = i2d_DHparams(pkey->pkey.dh, NULL)) <= 0)
ossl_raise(eDHError, NULL);
str = rb_str_new(0, len);
p = (unsigned char *)RSTRING_PTR(str);
- if(i2d_DHparams(dh, &p) < 0)
+ if(i2d_DHparams(pkey->pkey.dh, &p) < 0)
ossl_raise(eDHError, NULL);
ossl_str_adjust(str, p);
@@ -385,20 +346,17 @@ ossl_dh_to_der(VALUE self)
static VALUE
ossl_dh_get_params(VALUE self)
{
- DH *dh;
+ EVP_PKEY *pkey;
VALUE hash;
- const BIGNUM *p, *q, *g, *pub_key, *priv_key;
- GetDH(self, dh);
- DH_get0_pqg(dh, &p, &q, &g);
- DH_get0_key(dh, &pub_key, &priv_key);
+ GetPKeyDH(self, pkey);
hash = rb_hash_new();
- rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(p));
- rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(q));
- rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(g));
- rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pub_key));
- rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(priv_key));
+
+ rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(pkey->pkey.dh->p));
+ rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(pkey->pkey.dh->g));
+ rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pkey->pkey.dh->pub_key));
+ rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(pkey->pkey.dh->priv_key));
return hash;
}
@@ -414,15 +372,15 @@ ossl_dh_get_params(VALUE self)
static VALUE
ossl_dh_to_text(VALUE self)
{
- DH *dh;
+ EVP_PKEY *pkey;
BIO *out;
VALUE str;
- GetDH(self, dh);
+ GetPKeyDH(self, pkey);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eDHError, NULL);
}
- if (!DHparams_print(out, dh)) {
+ if (!DHparams_print(out, pkey->pkey.dh)) {
BIO_free(out);
ossl_raise(eDHError, NULL);
}
@@ -436,7 +394,7 @@ ossl_dh_to_text(VALUE self)
* dh.public_key -> aDH
*
* Returns a new DH instance that carries just the public information, i.e.
- * the prime _p_ and the generator _g_, but no public/private key yet. Such
+ * the prime +p+ and the generator +g+, but no public/private key yet. Such
* a pair may be generated using DH#generate_key!. The "public key" needed
* for a key exchange with DH#compute_key is considered as per-session
* information and may be retrieved with DH#pub_key once a key pair has
@@ -455,12 +413,13 @@ ossl_dh_to_text(VALUE self)
static VALUE
ossl_dh_to_public_key(VALUE self)
{
- DH *orig_dh, *dh;
+ EVP_PKEY *pkey;
+ DH *dh;
VALUE obj;
- GetDH(self, orig_dh);
- dh = DHparams_dup(orig_dh); /* err check perfomed by dh_instance */
- obj = dh_instance(rb_obj_class(self), dh);
+ GetPKeyDH(self, pkey);
+ dh = DHparams_dup(pkey->pkey.dh); /* err check perfomed by dh_instance */
+ obj = dh_instance(CLASS_OF(self), dh);
if (obj == Qfalse) {
DH_free(dh);
ossl_raise(eDHError, NULL);
@@ -481,9 +440,12 @@ static VALUE
ossl_dh_check_params(VALUE self)
{
DH *dh;
+ EVP_PKEY *pkey;
int codes;
- GetDH(self, dh);
+ GetPKeyDH(self, pkey);
+ dh = pkey->pkey.dh;
+
if (!DH_check(dh, &codes)) {
return Qfalse;
}
@@ -511,8 +473,11 @@ static VALUE
ossl_dh_generate_key(VALUE self)
{
DH *dh;
+ EVP_PKEY *pkey;
+
+ GetPKeyDH(self, pkey);
+ dh = pkey->pkey.dh;
- GetDH(self, dh);
if (!DH_generate_key(dh))
ossl_raise(eDHError, "Failed to generate key");
return self;
@@ -526,21 +491,20 @@ ossl_dh_generate_key(VALUE self)
* See DH_compute_key() for further information.
*
* === Parameters
- * * _pub_bn_ is a OpenSSL::BN, *not* the DH instance returned by
- * DH#public_key as that contains the DH parameters only.
+ * * +pub_bn+ is a OpenSSL::BN, *not* the DH instance returned by
+ * DH#public_key as that contains the DH parameters only.
*/
static VALUE
ossl_dh_compute_key(VALUE self, VALUE pub)
{
DH *dh;
- const BIGNUM *pub_key, *dh_p;
+ EVP_PKEY *pkey;
+ BIGNUM *pub_key;
VALUE str;
int len;
- GetDH(self, dh);
- DH_get0_pqg(dh, &dh_p, NULL, NULL);
- if (!dh_p)
- ossl_raise(eDHError, "incomplete DH");
+ GetPKeyDH(self, pkey);
+ dh = pkey->pkey.dh;
pub_key = GetBNPtr(pub);
len = DH_size(dh);
str = rb_str_new(0, len);
@@ -552,33 +516,83 @@ ossl_dh_compute_key(VALUE self, VALUE pub)
return str;
}
+OSSL_PKEY_BN(dh, p)
+OSSL_PKEY_BN(dh, g)
+OSSL_PKEY_BN(dh, pub_key)
+OSSL_PKEY_BN(dh, priv_key)
+
/*
- * Document-method: OpenSSL::PKey::DH#set_pqg
- * call-seq:
- * dh.set_pqg(p, q, g) -> self
- *
- * Sets _p_, _q_, _g_ to the DH instance.
+ * -----BEGIN DH PARAMETERS-----
+ * MEYCQQD0zXHljRg/mJ9PYLACLv58Cd8VxBxxY7oEuCeURMiTqEhMym16rhhKgZG2
+ * zk2O9uUIBIxSj+NKMURHGaFKyIvLAgEC
+ * -----END DH PARAMETERS-----
*/
-OSSL_PKEY_BN_DEF3(dh, DH, pqg, p, q, g)
+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;
+
/*
- * Document-method: OpenSSL::PKey::DH#set_key
- * call-seq:
- * dh.set_key(pub_key, priv_key) -> self
- *
- * Sets _pub_key_ and _priv_key_ for the DH instance. _priv_key_ may be +nil+.
+ * -----BEGIN DH PARAMETERS-----
+ * MIGHAoGBAJ0lOVy0VIr/JebWn0zDwY2h+rqITFOpdNr6ugsgvkDXuucdcChhYExJ
+ * AV/ZD2AWPbrTqV76mGRgJg4EddgT1zG0jq3rnFdMj2XzkBYx3BVvfR0Arnby0RHR
+ * T4h7KZ/2zmjvV+eF8kBUHBJAojUlzxKj4QeO2x20FP9X5xmNUXeDAgEC
+ * -----END DH PARAMETERS-----
*/
-OSSL_PKEY_BN_DEF2(dh, DH, key, pub_key, priv_key)
+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(void)
+Init_ossl_dh()
{
#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
mPKey = rb_define_module_under(mOSSL, "PKey");
- cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
- ePKeyError = rb_define_class_under(mPKey, "PKeyError", eOSSLError);
#endif
/* Document-class: OpenSSL::PKey::DHError
@@ -595,15 +609,15 @@ Init_ossl_dh(void)
* on.
*
* === Accessor methods for the Diffie-Hellman parameters
- * DH#p::
- * The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
- * DH#g::
- * The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
- * DH#pub_key::
- * The per-session public key (an OpenSSL::BN) matching the private key.
- * This needs to be passed to DH#compute_key.
- * DH#priv_key::
- * The per-session private key, an OpenSSL::BN.
+ * * DH#p
+ * The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
+ * * DH#g
+ * The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
+ * * DH#pub_key
+ * The per-session public key (an OpenSSL::BN) matching the private key.
+ * This needs to be passed to DH#compute_key.
+ * * DH#priv_key
+ * The per-session private key, an OpenSSL::BN.
*
* === Example of a key exchange
* dh1 = OpenSSL::PKey::DH.new(2048)
@@ -618,7 +632,6 @@ Init_ossl_dh(void)
cDH = rb_define_class_under(mPKey, "DH", cPKey);
rb_define_singleton_method(cDH, "generate", ossl_dh_s_generate, -1);
rb_define_method(cDH, "initialize", ossl_dh_initialize, -1);
- rb_define_method(cDH, "initialize_copy", ossl_dh_initialize_copy, 1);
rb_define_method(cDH, "public?", ossl_dh_is_public, 0);
rb_define_method(cDH, "private?", ossl_dh_is_private, 0);
rb_define_method(cDH, "to_text", ossl_dh_to_text, 0);
@@ -632,19 +645,22 @@ Init_ossl_dh(void)
rb_define_method(cDH, "compute_key", ossl_dh_compute_key, 1);
DEF_OSSL_PKEY_BN(cDH, dh, p);
- DEF_OSSL_PKEY_BN(cDH, dh, q);
DEF_OSSL_PKEY_BN(cDH, dh, g);
DEF_OSSL_PKEY_BN(cDH, dh, pub_key);
DEF_OSSL_PKEY_BN(cDH, dh, priv_key);
- rb_define_method(cDH, "set_pqg", ossl_dh_set_pqg, 3);
- rb_define_method(cDH, "set_key", ossl_dh_set_key, 2);
-
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(void)
+Init_ossl_dh()
{
}
#endif /* NO_DH */
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 56cc9dd4f1..823b9b66e5 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -1,41 +1,26 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
-#include "ossl.h"
-
#if !defined(OPENSSL_NO_DSA)
+#include "ossl.h"
+
#define GetPKeyDSA(obj, pkey) do { \
GetPKey((obj), (pkey)); \
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DSA) { /* PARANOIA? */ \
+ if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_DSA) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A DSA!"); \
} \
} while (0)
-#define GetDSA(obj, dsa) do { \
- EVP_PKEY *_pkey; \
- GetPKeyDSA((obj), _pkey); \
- (dsa) = EVP_PKEY_get0_DSA(_pkey); \
-} while (0)
-static inline int
-DSA_HAS_PRIVATE(DSA *dsa)
-{
- const BIGNUM *bn;
- DSA_get0_key(dsa, NULL, &bn);
- return !!bn;
-}
-
-static inline int
-DSA_PRIVATE(VALUE obj, DSA *dsa)
-{
- return DSA_HAS_PRIVATE(dsa) || OSSL_PKEY_IS_PRIVATE(obj);
-}
+#define DSA_HAS_PRIVATE(dsa) ((dsa)->priv_key)
+#define DSA_PRIVATE(obj,dsa) (DSA_HAS_PRIVATE(dsa)||OSSL_PKEY_IS_PRIVATE(obj))
/*
* Classes
@@ -55,7 +40,6 @@ dsa_instance(VALUE klass, DSA *dsa)
if (!dsa) {
return Qfalse;
}
- obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -63,7 +47,7 @@ dsa_instance(VALUE klass, DSA *dsa)
EVP_PKEY_free(pkey);
return Qfalse;
}
- SetPKey(obj, pkey);
+ WrapPKey(klass, obj, pkey);
return obj;
}
@@ -76,11 +60,10 @@ ossl_dsa_new(EVP_PKEY *pkey)
if (!pkey) {
obj = dsa_instance(cDSA, DSA_new());
} else {
- obj = NewPKey(cDSA);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DSA) {
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DSA) {
ossl_raise(rb_eTypeError, "Not a DSA key!");
}
- SetPKey(obj, pkey);
+ WrapPKey(cDSA, obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eDSAError, NULL);
@@ -92,9 +75,12 @@ ossl_dsa_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_DSA_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
struct dsa_blocking_gen_arg {
DSA *dsa;
int size;
+ unsigned char* seed;
+ int seed_len;
int *counter;
unsigned long *h;
BN_GENCB *cb;
@@ -105,35 +91,40 @@ static void *
dsa_blocking_gen(void *arg)
{
struct dsa_blocking_gen_arg *gen = (struct dsa_blocking_gen_arg *)arg;
- gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, NULL, 0,
- gen->counter, gen->h, gen->cb);
+ gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, gen->seed, gen->seed_len, gen->counter, gen->h, gen->cb);
return 0;
}
+#endif
static DSA *
dsa_generate(int size)
{
- struct ossl_generate_cb_arg cb_arg = { 0 };
+#if defined(HAVE_DSA_GENERATE_PARAMETERS_EX) && HAVE_BN_GENCB
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
struct dsa_blocking_gen_arg gen_arg;
DSA *dsa = DSA_new();
- BN_GENCB *cb = BN_GENCB_new();
- int counter;
+ unsigned char seed[20];
+ int seed_len = 20, counter;
unsigned long h;
- if (!dsa || !cb) {
+ if (!dsa) return 0;
+ if (!RAND_bytes(seed, seed_len)) {
DSA_free(dsa);
- BN_GENCB_free(cb);
- return NULL;
+ return 0;
}
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
if (rb_block_given_p())
cb_arg.yield = 1;
- BN_GENCB_set(cb, ossl_generate_cb_2, &cb_arg);
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
gen_arg.dsa = dsa;
gen_arg.size = size;
+ gen_arg.seed = seed;
+ gen_arg.seed_len = seed_len;
gen_arg.counter = &counter;
gen_arg.h = &h;
- gen_arg.cb = cb;
+ gen_arg.cb = &cb;
if (cb_arg.yield == 1) {
/* we cannot release GVL when callback proc is supplied */
dsa_blocking_gen(&gen_arg);
@@ -141,24 +132,28 @@ dsa_generate(int size)
/* there's a chance to unblock */
rb_thread_call_without_gvl(dsa_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
}
-
- BN_GENCB_free(cb);
if (!gen_arg.result) {
DSA_free(dsa);
- if (cb_arg.state) {
- /* Clear OpenSSL error queue before re-raising. By the way, the
- * documentation of DSA_generate_parameters_ex() says the error code
- * can be obtained by ERR_get_error(), but the default
- * implementation, dsa_builtin_paramgen() doesn't put any error... */
- ossl_clear_error();
- rb_jump_tag(cb_arg.state);
- }
- return NULL;
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
+ return 0;
}
+#else
+ DSA *dsa;
+ unsigned char seed[20];
+ int seed_len = 20, counter;
+ unsigned long h;
+
+ if (!RAND_bytes(seed, seed_len)) {
+ return 0;
+ }
+ dsa = DSA_generate_parameters(size, seed, seed_len, &counter, &h,
+ rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
+ if(!dsa) return 0;
+#endif
if (!DSA_generate_key(dsa)) {
DSA_free(dsa);
- return NULL;
+ return 0;
}
return dsa;
@@ -172,7 +167,7 @@ dsa_generate(int size)
* from scratch.
*
* === Parameters
- * * _size_ is an integer representing the desired key size.
+ * * +size+ is an integer representing the desired key size.
*
*/
static VALUE
@@ -191,16 +186,14 @@ ossl_dsa_s_generate(VALUE klass, VALUE size)
/*
* call-seq:
- * DSA.new -> dsa
- * DSA.new(size) -> dsa
- * DSA.new(string [, pass]) -> dsa
+ * DSA.new([size | string [, pass]) -> dsa
*
- * Creates a new DSA instance by reading an existing key from _string_.
+ * Creates a new DSA instance by reading an existing key from +string+.
*
* === Parameters
- * * _size_ is an integer representing the desired key size.
- * * _string_ contains a DER or PEM encoded key.
- * * _pass_ is a string that contains an optional password.
+ * * +size+ is an integer representing the desired key size.
+ * * +string+ contains a DER or PEM encoded key.
+ * * +pass+ is a string that contains an optional password.
*
* === Examples
* DSA.new -> dsa
@@ -215,22 +208,23 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
EVP_PKEY *pkey;
DSA *dsa;
BIO *in;
+ char *passwd = NULL;
VALUE arg, pass;
GetPKey(self, pkey);
if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) {
dsa = DSA_new();
}
- else if (RB_INTEGER_TYPE_P(arg)) {
- if (!(dsa = dsa_generate(NUM2INT(arg)))) {
+ else if (FIXNUM_P(arg)) {
+ if (!(dsa = dsa_generate(FIX2INT(arg)))) {
ossl_raise(eDSAError, NULL);
}
}
else {
- pass = ossl_pem_passwd_value(pass);
+ if (!NIL_P(pass)) passwd = StringValuePtr(pass);
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
- dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, (void *)pass);
+ in = ossl_obj2bio(arg);
+ dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
if (!dsa) {
OSSL_BIO_reset(in);
dsa = PEM_read_bio_DSA_PUBKEY(in, NULL, NULL, NULL);
@@ -245,14 +239,11 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
}
if (!dsa) {
OSSL_BIO_reset(in);
-#define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
- (d2i_of_void *)d2i_DSAPublicKey, PEM_STRING_DSA_PUBLIC, (bp), (void **)(x), (cb), (u))
dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL);
-#undef PEM_read_bio_DSAPublicKey
}
BIO_free(in);
if (!dsa) {
- ossl_clear_error();
+ ERR_clear_error();
ossl_raise(eDSAError, "Neither PUB key nor PRIV key");
}
}
@@ -264,26 +255,6 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-ossl_dsa_initialize_copy(VALUE self, VALUE other)
-{
- EVP_PKEY *pkey;
- DSA *dsa, *dsa_new;
-
- GetPKey(self, pkey);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
- ossl_raise(eDSAError, "DSA already initialized");
- GetDSA(other, dsa);
-
- dsa_new = ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, (d2i_of_void *)d2i_DSAPrivateKey, (char *)dsa);
- if (!dsa_new)
- ossl_raise(eDSAError, "ASN1_dup");
-
- EVP_PKEY_assign_DSA(pkey, dsa_new);
-
- return self;
-}
-
/*
* call-seq:
* dsa.public? -> true | false
@@ -294,13 +265,11 @@ ossl_dsa_initialize_copy(VALUE self, VALUE other)
static VALUE
ossl_dsa_is_public(VALUE self)
{
- DSA *dsa;
- const BIGNUM *bn;
+ EVP_PKEY *pkey;
- GetDSA(self, dsa);
- DSA_get0_key(dsa, &bn, NULL);
+ GetPKeyDSA(self, pkey);
- return bn ? Qtrue : Qfalse;
+ return (pkey->pkey.dsa->pub_key) ? Qtrue : Qfalse;
}
/*
@@ -313,11 +282,11 @@ ossl_dsa_is_public(VALUE self)
static VALUE
ossl_dsa_is_private(VALUE self)
{
- DSA *dsa;
+ EVP_PKEY *pkey;
- GetDSA(self, dsa);
+ GetPKeyDSA(self, pkey);
- return DSA_PRIVATE(self, dsa) ? Qtrue : Qfalse;
+ return (DSA_PRIVATE(self, pkey->pkey.dsa)) ? Qtrue : Qfalse;
}
/*
@@ -329,8 +298,8 @@ ossl_dsa_is_private(VALUE self)
* Encodes this DSA to its PEM encoding.
*
* === Parameters
- * * _cipher_ is an OpenSSL::Cipher.
- * * _password_ is a string containing your password.
+ * * +cipher+ is an OpenSSL::Cipher.
+ * * +password+ is a string containing your password.
*
* === Examples
* DSA.to_pem -> aString
@@ -340,28 +309,34 @@ ossl_dsa_is_private(VALUE self)
static VALUE
ossl_dsa_export(int argc, VALUE *argv, VALUE self)
{
- DSA *dsa;
+ EVP_PKEY *pkey;
BIO *out;
const EVP_CIPHER *ciph = NULL;
+ char *passwd = NULL;
VALUE cipher, pass, str;
- GetDSA(self, dsa);
+ GetPKeyDSA(self, pkey);
rb_scan_args(argc, argv, "02", &cipher, &pass);
if (!NIL_P(cipher)) {
- ciph = ossl_evp_get_cipherbyname(cipher);
- pass = ossl_pem_passwd_value(pass);
+ ciph = GetCipherPtr(cipher);
+ 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");
+ passwd = RSTRING_PTR(pass);
+ }
}
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eDSAError, NULL);
}
- if (DSA_HAS_PRIVATE(dsa)) {
- if (!PEM_write_bio_DSAPrivateKey(out, dsa, ciph, NULL, 0,
- ossl_pem_passwd_cb, (void *)pass)){
+ if (DSA_HAS_PRIVATE(pkey->pkey.dsa)) {
+ if (!PEM_write_bio_DSAPrivateKey(out, pkey->pkey.dsa, ciph,
+ NULL, 0, ossl_pem_passwd_cb, passwd)){
BIO_free(out);
ossl_raise(eDSAError, NULL);
}
} else {
- if (!PEM_write_bio_DSA_PUBKEY(out, dsa)) {
+ if (!PEM_write_bio_DSA_PUBKEY(out, pkey->pkey.dsa)) {
BIO_free(out);
ossl_raise(eDSAError, NULL);
}
@@ -381,29 +356,28 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_dsa_to_der(VALUE self)
{
- DSA *dsa;
- int (*i2d_func)(DSA *, unsigned char **);
+ EVP_PKEY *pkey;
+ int (*i2d_func)_((DSA*, unsigned char**));
unsigned char *p;
long len;
VALUE str;
- GetDSA(self, dsa);
- if(DSA_HAS_PRIVATE(dsa))
- i2d_func = (int (*)(DSA *,unsigned char **))i2d_DSAPrivateKey;
+ GetPKeyDSA(self, pkey);
+ if(DSA_HAS_PRIVATE(pkey->pkey.dsa))
+ i2d_func = (int(*)_((DSA*,unsigned char**)))i2d_DSAPrivateKey;
else
i2d_func = i2d_DSA_PUBKEY;
- if((len = i2d_func(dsa, NULL)) <= 0)
+ if((len = i2d_func(pkey->pkey.dsa, NULL)) <= 0)
ossl_raise(eDSAError, NULL);
str = rb_str_new(0, len);
p = (unsigned char *)RSTRING_PTR(str);
- if(i2d_func(dsa, &p) < 0)
+ if(i2d_func(pkey->pkey.dsa, &p) < 0)
ossl_raise(eDSAError, NULL);
ossl_str_adjust(str, p);
return str;
}
-
/*
* call-seq:
* dsa.params -> hash
@@ -415,20 +389,18 @@ ossl_dsa_to_der(VALUE self)
static VALUE
ossl_dsa_get_params(VALUE self)
{
- DSA *dsa;
+ EVP_PKEY *pkey;
VALUE hash;
- const BIGNUM *p, *q, *g, *pub_key, *priv_key;
- GetDSA(self, dsa);
- DSA_get0_pqg(dsa, &p, &q, &g);
- DSA_get0_key(dsa, &pub_key, &priv_key);
+ GetPKeyDSA(self, pkey);
hash = rb_hash_new();
- rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(p));
- rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(q));
- rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(g));
- rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pub_key));
- rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(priv_key));
+
+ rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(pkey->pkey.dsa->p));
+ rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(pkey->pkey.dsa->q));
+ rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(pkey->pkey.dsa->g));
+ rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pkey->pkey.dsa->pub_key));
+ rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(pkey->pkey.dsa->priv_key));
return hash;
}
@@ -444,15 +416,15 @@ ossl_dsa_get_params(VALUE self)
static VALUE
ossl_dsa_to_text(VALUE self)
{
- DSA *dsa;
+ EVP_PKEY *pkey;
BIO *out;
VALUE str;
- GetDSA(self, dsa);
+ GetPKeyDSA(self, pkey);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eDSAError, NULL);
}
- if (!DSA_print(out, dsa, 0)) { /* offset = 0 */
+ if (!DSA_print(out, pkey->pkey.dsa, 0)) { /* offset = 0 */
BIO_free(out);
ossl_raise(eDSAError, NULL);
}
@@ -487,11 +459,8 @@ ossl_dsa_to_public_key(VALUE self)
GetPKeyDSA(self, pkey);
/* err check performed by dsa_instance */
-#define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup( \
- (i2d_of_void *)i2d_DSAPublicKey, (d2i_of_void *)d2i_DSAPublicKey, (char *)(dsa))
- dsa = DSAPublicKey_dup(EVP_PKEY_get0_DSA(pkey));
-#undef DSAPublicKey_dup
- obj = dsa_instance(rb_obj_class(self), dsa);
+ dsa = DSAPublicKey_dup(pkey->pkey.dsa);
+ obj = dsa_instance(CLASS_OF(self), dsa);
if (obj == Qfalse) {
DSA_free(dsa);
ossl_raise(eDSAError, NULL);
@@ -499,16 +468,18 @@ ossl_dsa_to_public_key(VALUE self)
return obj;
}
+#define ossl_dsa_buf_size(pkey) (DSA_size((pkey)->pkey.dsa)+16)
+
/*
* call-seq:
* dsa.syssign(string) -> aString
*
- * Computes and returns the DSA signature of _string_, where _string_ is
+ * Computes and returns the DSA signature of +string+, where +string+ is
* expected to be an already-computed message digest of the original input
* data. The signature is issued using the private key of this DSA instance.
*
* === Parameters
- * * _string_ is a message digest of the original input data to be signed.
+ * * +string+ is a message digest of the original input data to be signed
*
* === Example
* dsa = OpenSSL::PKey::DSA.new(2048)
@@ -521,22 +492,19 @@ ossl_dsa_to_public_key(VALUE self)
static VALUE
ossl_dsa_sign(VALUE self, VALUE data)
{
- DSA *dsa;
- const BIGNUM *dsa_q;
+ EVP_PKEY *pkey;
unsigned int buf_len;
VALUE str;
- GetDSA(self, dsa);
- DSA_get0_pqg(dsa, NULL, &dsa_q, NULL);
- if (!dsa_q)
- ossl_raise(eDSAError, "incomplete DSA");
- if (!DSA_PRIVATE(self, dsa))
- ossl_raise(eDSAError, "Private DSA key needed!");
+ GetPKeyDSA(self, pkey);
StringValue(data);
- str = rb_str_new(0, DSA_size(dsa));
+ if (!DSA_PRIVATE(self, pkey->pkey.dsa)) {
+ ossl_raise(eDSAError, "Private DSA key needed!");
+ }
+ 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),
- &buf_len, dsa)) { /* type is ignored (0) */
+ &buf_len, pkey->pkey.dsa)) { /* type is ignored (0) */
ossl_raise(eDSAError, NULL);
}
rb_str_set_len(str, buf_len);
@@ -549,11 +517,11 @@ ossl_dsa_sign(VALUE self, VALUE data)
* dsa.sysverify(digest, sig) -> true | false
*
* Verifies whether the signature is valid given the message digest input. It
- * does so by validating _sig_ using the public key of this DSA instance.
+ * does so by validating +sig+ using the public key of this DSA instance.
*
* === Parameters
- * * _digest_ is a message digest of the original input data to be signed
- * * _sig_ is a DSA signature value
+ * * +digest+ is a message digest of the original input data to be signed
+ * * +sig+ is a DSA signature value
*
* === Example
* dsa = OpenSSL::PKey::DSA.new(2048)
@@ -566,15 +534,15 @@ ossl_dsa_sign(VALUE self, VALUE data)
static VALUE
ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
{
- DSA *dsa;
+ EVP_PKEY *pkey;
int ret;
- GetDSA(self, dsa);
+ GetPKeyDSA(self, pkey);
StringValue(digest);
StringValue(sig);
/* type is ignored (0) */
ret = DSA_verify(0, (unsigned char *)RSTRING_PTR(digest), RSTRING_LENINT(digest),
- (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), dsa);
+ (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey->pkey.dsa);
if (ret < 0) {
ossl_raise(eDSAError, NULL);
}
@@ -585,33 +553,21 @@ ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
return Qfalse;
}
-/*
- * Document-method: OpenSSL::PKey::DSA#set_pqg
- * call-seq:
- * dsa.set_pqg(p, q, g) -> self
- *
- * Sets _p_, _q_, _g_ to the DSA instance.
- */
-OSSL_PKEY_BN_DEF3(dsa, DSA, pqg, p, q, g)
-/*
- * Document-method: OpenSSL::PKey::DSA#set_key
- * call-seq:
- * dsa.set_key(pub_key, priv_key) -> self
- *
- * Sets _pub_key_ and _priv_key_ for the DSA instance. _priv_key_ may be +nil+.
- */
-OSSL_PKEY_BN_DEF2(dsa, DSA, key, pub_key, priv_key)
+OSSL_PKEY_BN(dsa, p)
+OSSL_PKEY_BN(dsa, q)
+OSSL_PKEY_BN(dsa, g)
+OSSL_PKEY_BN(dsa, pub_key)
+OSSL_PKEY_BN(dsa, priv_key)
/*
* INIT
*/
void
-Init_ossl_dsa(void)
+Init_ossl_dsa()
{
#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
mPKey = rb_define_module_under(mOSSL, "PKey");
- cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
- ePKeyError = rb_define_class_under(mPKey, "PKeyError", eOSSLError);
#endif
/* Document-class: OpenSSL::PKey::DSAError
@@ -627,12 +583,17 @@ Init_ossl_dsa(void)
* DSA, the Digital Signature Algorithm, is specified in NIST's
* FIPS 186-3. It is an asymmetric public key algorithm that may be used
* similar to e.g. RSA.
+ * Please note that for OpenSSL versions prior to 1.0.0 the digest
+ * algorithms OpenSSL::Digest::DSS (equivalent to SHA) or
+ * OpenSSL::Digest::DSS1 (equivalent to SHA-1) must be used for issuing
+ * signatures with a DSA key using OpenSSL::PKey#sign.
+ * Starting with OpenSSL 1.0.0, digest algorithms are no longer restricted,
+ * any Digest may be used for signing.
*/
cDSA = rb_define_class_under(mPKey, "DSA", cPKey);
rb_define_singleton_method(cDSA, "generate", ossl_dsa_s_generate, 1);
rb_define_method(cDSA, "initialize", ossl_dsa_initialize, -1);
- rb_define_method(cDSA, "initialize_copy", ossl_dsa_initialize_copy, 1);
rb_define_method(cDSA, "public?", ossl_dsa_is_public, 0);
rb_define_method(cDSA, "private?", ossl_dsa_is_private, 0);
@@ -650,15 +611,13 @@ Init_ossl_dsa(void)
DEF_OSSL_PKEY_BN(cDSA, dsa, g);
DEF_OSSL_PKEY_BN(cDSA, dsa, pub_key);
DEF_OSSL_PKEY_BN(cDSA, dsa, priv_key);
- rb_define_method(cDSA, "set_pqg", ossl_dsa_set_pqg, 3);
- rb_define_method(cDSA, "set_key", ossl_dsa_set_key, 2);
rb_define_method(cDSA, "params", ossl_dsa_get_params, 0);
}
#else /* defined NO_DSA */
void
-Init_ossl_dsa(void)
+Init_ossl_dsa()
{
}
#endif /* NO_DSA */
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 8bb611248b..5e419bd167 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -4,41 +4,89 @@
#include "ossl.h"
-#if !defined(OPENSSL_NO_EC)
+#if !defined(OPENSSL_NO_EC) && (OPENSSL_VERSION_NUMBER >= 0x0090802fL)
+
+typedef struct {
+ EC_GROUP *group;
+ int dont_free;
+} ossl_ec_group;
+
+typedef struct {
+ EC_POINT *point;
+ int dont_free;
+} ossl_ec_point;
+
#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)); \
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_EC) { \
+ if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_EC) { \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A EC PKEY!"); \
} \
} while (0)
-#define GetEC(obj, key) do { \
- EVP_PKEY *_pkey; \
- GetPKeyEC(obj, _pkey); \
- (key) = EVP_PKEY_get0_EC_KEY(_pkey); \
-} while (0)
-#define GetECGroup(obj, group) do { \
- TypedData_Get_Struct(obj, EC_GROUP, &ossl_ec_group_type, group); \
- if ((group) == NULL) \
- ossl_raise(eEC_GROUP, "EC_GROUP is not initialized"); \
+#define SafeGet_ec_group(obj, group) do { \
+ OSSL_Check_Kind((obj), cEC_GROUP); \
+ Data_Get_Struct((obj), ossl_ec_group, (group)); \
+} while(0)
+
+#define Get_EC_KEY(obj, key) do { \
+ EVP_PKEY *pkey; \
+ GetPKeyEC((obj), pkey); \
+ (key) = pkey->pkey.ec; \
+} while(0)
+
+#define Require_EC_KEY(obj, key) do { \
+ Get_EC_KEY((obj), (key)); \
+ if ((key) == NULL) \
+ ossl_raise(eECError, "EC_KEY is not initialized"); \
+} while(0)
+
+#define SafeRequire_EC_KEY(obj, key) do { \
+ OSSL_Check_Kind((obj), cEC); \
+ Require_EC_KEY((obj), (key)); \
} while (0)
-#define GetECPoint(obj, point) do { \
- TypedData_Get_Struct(obj, EC_POINT, &ossl_ec_point_type, point); \
+#define Get_EC_GROUP(obj, g) do { \
+ ossl_ec_group *ec_group; \
+ Data_Get_Struct((obj), ossl_ec_group, ec_group); \
+ if (ec_group == NULL) \
+ ossl_raise(eEC_GROUP, "missing ossl_ec_group structure"); \
+ (g) = ec_group->group; \
+} while(0)
+
+#define Require_EC_GROUP(obj, group) do { \
+ Get_EC_GROUP((obj), (group)); \
+ if ((group) == NULL) \
+ ossl_raise(eEC_GROUP, "EC_GROUP is not initialized"); \
+} while(0)
+
+#define SafeRequire_EC_GROUP(obj, group) do { \
+ OSSL_Check_Kind((obj), cEC_GROUP); \
+ Require_EC_GROUP((obj), (group)); \
+} while(0)
+
+#define Get_EC_POINT(obj, p) do { \
+ ossl_ec_point *ec_point; \
+ Data_Get_Struct((obj), ossl_ec_point, ec_point); \
+ if (ec_point == NULL) \
+ ossl_raise(eEC_POINT, "missing ossl_ec_point structure"); \
+ (p) = ec_point->point; \
+} while(0)
+
+#define Require_EC_POINT(obj, point) do { \
+ Get_EC_POINT((obj), (point)); \
if ((point) == NULL) \
- ossl_raise(eEC_POINT, "EC_POINT is not initialized"); \
-} while (0)
-#define GetECPointGroup(obj, group) do { \
- VALUE _group = rb_attr_get(obj, id_i_group); \
- GetECGroup(_group, group); \
-} while (0)
+ ossl_raise(eEC_POINT, "EC_POINT is not initialized"); \
+} while(0)
+
+#define SafeRequire_EC_POINT(obj, point) do { \
+ OSSL_Check_Kind((obj), cEC_POINT); \
+ Require_EC_POINT((obj), (point)); \
+} while(0)
VALUE cEC;
VALUE eECError;
@@ -58,11 +106,6 @@ static ID ID_uncompressed;
static ID ID_compressed;
static ID ID_hybrid;
-static ID id_i_group;
-
-static VALUE ec_group_new(const EC_GROUP *group);
-static VALUE ec_point_new(const EC_POINT *point, const EC_GROUP *group);
-
static VALUE ec_instance(VALUE klass, EC_KEY *ec)
{
EVP_PKEY *pkey;
@@ -71,7 +114,6 @@ static VALUE ec_instance(VALUE klass, EC_KEY *ec)
if (!ec) {
return Qfalse;
}
- obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -79,7 +121,7 @@ static VALUE ec_instance(VALUE klass, EC_KEY *ec)
EVP_PKEY_free(pkey);
return Qfalse;
}
- SetPKey(obj, pkey);
+ WrapPKey(klass, obj, pkey);
return obj;
}
@@ -91,11 +133,10 @@ VALUE ossl_ec_new(EVP_PKEY *pkey)
if (!pkey) {
obj = ec_instance(cEC, EC_KEY_new());
} else {
- obj = NewPKey(cEC);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_EC) {
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_EC) {
ossl_raise(rb_eTypeError, "Not a EC key!");
}
- SetPKey(obj, pkey);
+ WrapPKey(cEC, obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eECError, NULL);
@@ -104,196 +145,168 @@ VALUE ossl_ec_new(EVP_PKEY *pkey)
return obj;
}
-/*
- * Creates a new EC_KEY on the EC group obj. arg can be an EC::Group or a String
- * representing an OID.
- */
-static EC_KEY *
-ec_key_new_from_group(VALUE arg)
-{
- EC_KEY *ec;
-
- if (rb_obj_is_kind_of(arg, cEC_GROUP)) {
- EC_GROUP *group;
-
- GetECGroup(arg, group);
- if (!(ec = EC_KEY_new()))
- ossl_raise(eECError, NULL);
-
- if (!EC_KEY_set_group(ec, group)) {
- EC_KEY_free(ec);
- ossl_raise(eECError, NULL);
- }
- } else {
- int nid = OBJ_sn2nid(StringValueCStr(arg));
-
- if (nid == NID_undef)
- ossl_raise(eECError, "invalid curve name");
-
- if (!(ec = EC_KEY_new_by_curve_name(nid)))
- ossl_raise(eECError, NULL);
-
- EC_KEY_set_asn1_flag(ec, OPENSSL_EC_NAMED_CURVE);
- EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED);
- }
-
- return ec;
-}
-
-/*
- * call-seq:
- * EC.generate(ec_group) -> ec
- * EC.generate(string) -> ec
- *
- * Creates a new EC instance with a new random private and public key.
- */
-static VALUE
-ossl_ec_key_s_generate(VALUE klass, VALUE arg)
-{
- EC_KEY *ec;
- VALUE obj;
-
- ec = ec_key_new_from_group(arg);
-
- obj = ec_instance(klass, ec);
- if (obj == Qfalse) {
- EC_KEY_free(ec);
- ossl_raise(eECError, NULL);
- }
- if (!EC_KEY_generate_key(ec))
- ossl_raise(eECError, "EC_KEY_generate_key");
-
- return obj;
-}
-
-/*
- * call-seq:
- * OpenSSL::PKey::EC.new
- * OpenSSL::PKey::EC.new(ec_key)
- * OpenSSL::PKey::EC.new(ec_group)
- * OpenSSL::PKey::EC.new("secp112r1")
- * OpenSSL::PKey::EC.new(pem_string [, pwd])
- * OpenSSL::PKey::EC.new(der_string)
+/* call-seq:
+ * OpenSSL::PKey::EC.new()
+ * OpenSSL::PKey::EC.new(ec_key)
+ * OpenSSL::PKey::EC.new(ec_group)
+ * OpenSSL::PKey::EC.new("secp112r1")
+ * OpenSSL::PKey::EC.new(pem_string)
+ * OpenSSL::PKey::EC.new(pem_string [, pwd])
+ * OpenSSL::PKey::EC.new(der_string)
*
- * Creates a new EC object from given arguments.
+ * See the OpenSSL documentation for:
+ * EC_KEY_*
*/
static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self)
{
EVP_PKEY *pkey;
- EC_KEY *ec;
+ EC_KEY *ec = NULL;
VALUE arg, pass;
+ VALUE group = Qnil;
+ char *passwd = NULL;
GetPKey(self, pkey);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
+ if (pkey->pkey.ec)
ossl_raise(eECError, "EC_KEY already initialized");
rb_scan_args(argc, argv, "02", &arg, &pass);
if (NIL_P(arg)) {
- if (!(ec = EC_KEY_new()))
- ossl_raise(eECError, NULL);
- } else if (rb_obj_is_kind_of(arg, cEC)) {
- EC_KEY *other_ec = NULL;
-
- GetEC(arg, other_ec);
- if (!(ec = EC_KEY_dup(other_ec)))
- ossl_raise(eECError, NULL);
- } else if (rb_obj_is_kind_of(arg, cEC_GROUP)) {
- ec = ec_key_new_from_group(arg);
+ ec = EC_KEY_new();
} else {
- BIO *in;
+ if (rb_obj_is_kind_of(arg, cEC)) {
+ EC_KEY *other_ec = NULL;
+
+ SafeRequire_EC_KEY(arg, other_ec);
+ ec = EC_KEY_dup(other_ec);
+ } else if (rb_obj_is_kind_of(arg, cEC_GROUP)) {
+ ec = EC_KEY_new();
+ group = arg;
+ } else {
+ BIO *in = ossl_obj2bio(arg);
- pass = ossl_pem_passwd_value(pass);
- in = ossl_obj2bio(&arg);
+ if (!NIL_P(pass)) {
+ passwd = StringValuePtr(pass);
+ }
+ ec = PEM_read_bio_ECPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
+ if (!ec) {
+ OSSL_BIO_reset(in);
+ ec = PEM_read_bio_EC_PUBKEY(in, NULL, ossl_pem_passwd_cb, passwd);
+ }
+ if (!ec) {
+ OSSL_BIO_reset(in);
+ ec = d2i_ECPrivateKey_bio(in, NULL);
+ }
+ if (!ec) {
+ OSSL_BIO_reset(in);
+ ec = d2i_EC_PUBKEY_bio(in, NULL);
+ }
- ec = PEM_read_bio_ECPrivateKey(in, NULL, ossl_pem_passwd_cb, (void *)pass);
- if (!ec) {
- OSSL_BIO_reset(in);
- ec = PEM_read_bio_EC_PUBKEY(in, NULL, ossl_pem_passwd_cb, (void *)pass);
- }
- if (!ec) {
- OSSL_BIO_reset(in);
- ec = d2i_ECPrivateKey_bio(in, NULL);
- }
- if (!ec) {
- OSSL_BIO_reset(in);
- ec = d2i_EC_PUBKEY_bio(in, NULL);
- }
- BIO_free(in);
+ BIO_free(in);
- if (!ec) {
- ossl_clear_error();
- ec = ec_key_new_from_group(arg);
- }
+ if (ec == NULL) {
+ const char *name = StringValueCStr(arg);
+ int nid = OBJ_sn2nid(name);
+
+ (void)ERR_get_error();
+ if (nid == NID_undef)
+ ossl_raise(eECError, "unknown curve name (%s)\n", name);
+
+ if ((ec = EC_KEY_new_by_curve_name(nid)) == NULL)
+ ossl_raise(eECError, "unable to create curve (%s)\n", name);
+
+ EC_KEY_set_asn1_flag(ec, OPENSSL_EC_NAMED_CURVE);
+ EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED);
+ }
+ }
}
+ if (ec == NULL)
+ ossl_raise(eECError, NULL);
+
if (!EVP_PKEY_assign_EC_KEY(pkey, ec)) {
EC_KEY_free(ec);
ossl_raise(eECError, "EVP_PKEY_assign_EC_KEY");
}
- return self;
-}
+ rb_iv_set(self, "@group", Qnil);
-static VALUE
-ossl_ec_key_initialize_copy(VALUE self, VALUE other)
-{
- EVP_PKEY *pkey;
- EC_KEY *ec, *ec_new;
-
- GetPKey(self, pkey);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
- ossl_raise(eECError, "EC already initialized");
- GetEC(other, ec);
-
- ec_new = EC_KEY_dup(ec);
- if (!ec_new)
- ossl_raise(eECError, "EC_KEY_dup");
- if (!EVP_PKEY_assign_EC_KEY(pkey, ec_new)) {
- EC_KEY_free(ec_new);
- ossl_raise(eECError, "EVP_PKEY_assign_EC_KEY");
- }
+ if (!NIL_P(group))
+ rb_funcall(self, rb_intern("group="), 1, arg);
return self;
}
/*
- * call-seq:
- * key.group => group
+ * call-seq:
+ * key.group => group
*
- * Returns the EC::Group that the key is associated with. Modifying the returned
- * group does not affect _key_.
+ * Returns a constant <code>OpenSSL::EC::Group</code> that is tied to the key.
+ * Modifying the returned group can make the key invalid.
*/
-static VALUE
-ossl_ec_key_get_group(VALUE self)
+static VALUE ossl_ec_key_get_group(VALUE self)
{
+ VALUE group_v;
EC_KEY *ec;
- const EC_GROUP *group;
+ ossl_ec_group *ec_group;
+ EC_GROUP *group;
+
+ Require_EC_KEY(self, ec);
- GetEC(self, ec);
- group = EC_KEY_get0_group(ec);
- if (!group)
- return Qnil;
+ group_v = rb_iv_get(self, "@group");
+ if (!NIL_P(group_v))
+ return group_v;
- return ec_group_new(group);
+ if ((group = (EC_GROUP *)EC_KEY_get0_group(ec)) != NULL) {
+ group_v = rb_obj_alloc(cEC_GROUP);
+ SafeGet_ec_group(group_v, ec_group);
+ ec_group->group = group;
+ ec_group->dont_free = 1;
+ rb_iv_set(group_v, "@key", self);
+ rb_iv_set(self, "@group", group_v);
+ return group_v;
+ }
+
+ return Qnil;
}
/*
- * call-seq:
- * key.group = group
+ * call-seq:
+ * key.group = group => group
+ *
+ * Returns the same object passed, not the group object associated with the key.
+ * If you wish to access the group object tied to the key call key.group after setting
+ * the group.
+ *
+ * Setting the group will immediately destroy any previously assigned group object.
+ * The group is internally copied by OpenSSL. Modifying the original group after
+ * assignment will not effect the internal key structure.
+ * (your changes may be lost). BE CAREFUL.
*
- * Sets the EC::Group for the key. The group structure is internally copied so
- * modification to _group_ after assigning to a key has no effect on the key.
+ * EC_KEY_set_group calls EC_GROUP_free(key->group) then EC_GROUP_dup(), not EC_GROUP_copy.
+ * This documentation is accurate for OpenSSL 0.9.8b.
*/
-static VALUE
-ossl_ec_key_set_group(VALUE self, VALUE group_v)
+static VALUE ossl_ec_key_set_group(VALUE self, VALUE group_v)
{
+ VALUE old_group_v;
EC_KEY *ec;
EC_GROUP *group;
- GetEC(self, ec);
- GetECGroup(group_v, group);
+ Require_EC_KEY(self, ec);
+ SafeRequire_EC_GROUP(group_v, group);
+
+ old_group_v = rb_iv_get(self, "@group");
+ if (!NIL_P(old_group_v)) {
+ ossl_ec_group *old_ec_group;
+ SafeGet_ec_group(old_group_v, old_ec_group);
+
+ old_ec_group->group = NULL;
+ old_ec_group->dont_free = 0;
+ rb_iv_set(old_group_v, "@key", Qnil);
+ }
+
+ rb_iv_set(self, "@group", Qnil);
if (EC_KEY_set_group(ec, group) != 1)
ossl_raise(eECError, "EC_KEY_set_group");
@@ -312,7 +325,8 @@ static VALUE ossl_ec_key_get_private_key(VALUE self)
EC_KEY *ec;
const BIGNUM *bn;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
+
if ((bn = EC_KEY_get0_private_key(ec)) == NULL)
return Qnil;
@@ -330,7 +344,7 @@ static VALUE ossl_ec_key_set_private_key(VALUE self, VALUE private_key)
EC_KEY *ec;
BIGNUM *bn = NULL;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
if (!NIL_P(private_key))
bn = GetBNPtr(private_key);
@@ -347,6 +361,26 @@ static VALUE ossl_ec_key_set_private_key(VALUE self, VALUE private_key)
return private_key;
}
+
+static VALUE ossl_ec_point_dup(const EC_POINT *point, VALUE group_v)
+{
+ VALUE obj;
+ const EC_GROUP *group;
+ ossl_ec_point *new_point;
+
+ obj = rb_obj_alloc(cEC_POINT);
+ Data_Get_Struct(obj, ossl_ec_point, new_point);
+
+ SafeRequire_EC_GROUP(group_v, group);
+
+ new_point->point = EC_POINT_dup(point, group);
+ if (new_point->point == NULL)
+ ossl_raise(eEC_POINT, "EC_POINT_dup");
+ rb_iv_set(obj, "@group", group_v);
+
+ return obj;
+}
+
/*
* call-seq:
* key.public_key => OpenSSL::PKey::EC::Point
@@ -357,12 +391,18 @@ static VALUE ossl_ec_key_get_public_key(VALUE self)
{
EC_KEY *ec;
const EC_POINT *point;
+ VALUE group;
+
+ Require_EC_KEY(self, ec);
- GetEC(self, ec);
if ((point = EC_KEY_get0_public_key(ec)) == NULL)
return Qnil;
- return ec_point_new(point, EC_KEY_get0_group(ec));
+ group = rb_funcall(self, rb_intern("group"), 0);
+ if (NIL_P(group))
+ ossl_raise(eECError, "EC_KEY_get0_get0_group (has public_key but no group???");
+
+ return ossl_ec_point_dup(point, group);
}
/*
@@ -376,9 +416,9 @@ static VALUE ossl_ec_key_set_public_key(VALUE self, VALUE public_key)
EC_KEY *ec;
EC_POINT *point = NULL;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
if (!NIL_P(public_key))
- GetECPoint(public_key, point);
+ SafeRequire_EC_POINT(public_key, point);
switch (EC_KEY_set_public_key(ec, point)) {
case 1:
@@ -395,34 +435,32 @@ static VALUE ossl_ec_key_set_public_key(VALUE self, VALUE public_key)
/*
* call-seq:
- * key.public? => true or false
+ * key.public_key? => true or false
*
- * Returns whether this EC instance has a public key. The public key
- * (EC::Point) can be retrieved with EC#public_key.
+ * Both public_key? and private_key? may return false at the same time unlike other PKey classes.
*/
-static VALUE ossl_ec_key_is_public(VALUE self)
+static VALUE ossl_ec_key_is_public_key(VALUE self)
{
EC_KEY *ec;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
- return EC_KEY_get0_public_key(ec) ? Qtrue : Qfalse;
+ return (EC_KEY_get0_public_key(ec) ? Qtrue : Qfalse);
}
/*
* call-seq:
- * key.private? => true or false
+ * key.private_key? => true or false
*
- * Returns whether this EC instance has a private key. The private key (BN) can
- * be retrieved with EC#private_key.
+ * Both public_key? and private_key? may return false at the same time unlike other PKey classes.
*/
-static VALUE ossl_ec_key_is_private(VALUE self)
+static VALUE ossl_ec_key_is_private_key(VALUE self)
{
EC_KEY *ec;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
- return EC_KEY_get0_private_key(ec) ? Qtrue : Qfalse;
+ return (EC_KEY_get0_private_key(ec) ? Qtrue : Qfalse);
}
static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int format)
@@ -431,10 +469,10 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
BIO *out;
int i = -1;
int private = 0;
+ char *password = NULL;
VALUE str;
- const EVP_CIPHER *cipher = NULL;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
if (EC_KEY_get0_public_key(ec) == NULL)
ossl_raise(eECError, "can't export - no public key set");
@@ -445,18 +483,26 @@ 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 = ossl_evp_get_cipherbyname(ciph);
- pass = ossl_pem_passwd_value(pass);
- }
-
if (!(out = BIO_new(BIO_s_mem())))
ossl_raise(eECError, "BIO_new(BIO_s_mem())");
switch(format) {
case EXPORT_PEM:
if (private) {
- i = PEM_write_bio_ECPrivateKey(out, ec, cipher, NULL, 0, ossl_pem_passwd_cb, (void *)pass);
+ 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);
}
@@ -490,10 +536,12 @@ static VALUE ossl_ec_key_to_string(VALUE self, VALUE ciph, VALUE pass, int forma
* key.export([cipher, pass_phrase]) => String
* key.to_pem([cipher, pass_phrase]) => String
*
- * Outputs the EC key in PEM encoding. If _cipher_ and _pass_phrase_ are given
- * they will be used to encrypt the key. _cipher_ must be an OpenSSL::Cipher
- * instance. Note that encryption will only be effective for a private key,
- * public keys will always be encoded in plain text.
+ * Outputs the EC key in PEM encoding. If +cipher+ and +pass_phrase+ are
+ * given they will be used to encrypt the key. +cipher+ must be an
+ * OpenSSL::Cipher::Cipher instance. Note that encryption will only be
+ * effective for a private key, public keys will always be encoded in plain
+ * text.
+ *
*/
static VALUE ossl_ec_key_export(int argc, VALUE *argv, VALUE self)
{
@@ -525,7 +573,7 @@ static VALUE ossl_ec_key_to_text(VALUE self)
BIO *out;
VALUE str;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eECError, "BIO_new(BIO_s_mem())");
}
@@ -540,23 +588,16 @@ static VALUE ossl_ec_key_to_text(VALUE self)
/*
* call-seq:
- * key.generate_key! => self
- *
- * Generates a new random private and public key.
- *
- * See also the OpenSSL documentation for EC_KEY_generate_key()
+ * key.generate_key => self
*
- * === Example
- * ec = OpenSSL::PKey::EC.new("prime256v1")
- * p ec.private_key # => nil
- * ec.generate_key!
- * p ec.private_key # => #<OpenSSL::BN XXXXXX>
+ * See the OpenSSL documentation for EC_KEY_generate_key()
*/
static VALUE ossl_ec_key_generate_key(VALUE self)
{
EC_KEY *ec;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
+
if (EC_KEY_generate_key(ec) != 1)
ossl_raise(eECError, "EC_KEY_generate_key");
@@ -575,7 +616,8 @@ static VALUE ossl_ec_key_check_key(VALUE self)
{
EC_KEY *ec;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
+
if (EC_KEY_check_key(ec) != 1)
ossl_raise(eECError, "EC_KEY_check_key");
@@ -595,8 +637,8 @@ static VALUE ossl_ec_key_dh_compute_key(VALUE self, VALUE pubkey)
int buf_len;
VALUE str;
- GetEC(self, ec);
- GetECPoint(pubkey, point);
+ Require_EC_KEY(self, ec);
+ SafeRequire_EC_POINT(pubkey, point);
/* BUG: need a way to figure out the maximum string size */
buf_len = 1024;
@@ -625,16 +667,17 @@ static VALUE ossl_ec_key_dsa_sign_asn1(VALUE self, VALUE data)
unsigned int buf_len;
VALUE str;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
StringValue(data);
if (EC_KEY_get0_private_key(ec) == NULL)
ossl_raise(eECError, "Private EC key needed!");
- str = rb_str_new(0, ECDSA_size(ec));
+ str = rb_str_new(0, ECDSA_size(ec) + 16);
if (ECDSA_sign(0, (unsigned char *) RSTRING_PTR(data), RSTRING_LENINT(data), (unsigned char *) RSTRING_PTR(str), &buf_len, ec) != 1)
- ossl_raise(eECError, "ECDSA_sign");
- rb_str_set_len(str, buf_len);
+ ossl_raise(eECError, "ECDSA_sign");
+
+ rb_str_resize(str, buf_len);
return str;
}
@@ -649,7 +692,7 @@ static VALUE ossl_ec_key_dsa_verify_asn1(VALUE self, VALUE data, VALUE sig)
{
EC_KEY *ec;
- GetEC(self, ec);
+ Require_EC_KEY(self, ec);
StringValue(data);
StringValue(sig);
@@ -664,72 +707,47 @@ static VALUE ossl_ec_key_dsa_verify_asn1(VALUE self, VALUE data, VALUE sig)
UNREACHABLE;
}
-/*
- * OpenSSL::PKey::EC::Group
- */
-static void
-ossl_ec_group_free(void *ptr)
-{
- EC_GROUP_clear_free(ptr);
-}
-
-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)
+static void ossl_ec_group_free(ossl_ec_group *ec_group)
{
- return TypedData_Wrap_Struct(klass, &ossl_ec_group_type, NULL);
+ if (!ec_group->dont_free && ec_group->group)
+ EC_GROUP_clear_free(ec_group->group);
+ ruby_xfree(ec_group);
}
-static VALUE
-ec_group_new(const EC_GROUP *group)
+static VALUE ossl_ec_group_alloc(VALUE klass)
{
+ ossl_ec_group *ec_group;
VALUE obj;
- EC_GROUP *group_new;
- obj = ossl_ec_group_alloc(cEC_GROUP);
- group_new = EC_GROUP_dup(group);
- if (!group_new)
- ossl_raise(eEC_GROUP, "EC_GROUP_dup");
- RTYPEDDATA_DATA(obj) = group_new;
+ obj = Data_Make_Struct(klass, ossl_ec_group, 0, ossl_ec_group_free, ec_group);
return obj;
}
-/*
- * call-seq:
- * OpenSSL::PKey::EC::Group.new(ec_group)
- * OpenSSL::PKey::EC::Group.new(pem_or_der_encoded)
- * OpenSSL::PKey::EC::Group.new(ec_method)
- * OpenSSL::PKey::EC::Group.new(:GFp, bignum_p, bignum_a, bignum_b)
- * OpenSSL::PKey::EC::Group.new(:GF2m, bignum_p, bignum_a, bignum_b)
- *
- * Creates a new EC::Group object.
- *
- * _ec_method_ is a symbol that represents an EC_METHOD. Currently the following
- * are supported:
- *
- * * :GFp_simple
- * * :GFp_mont
- * * :GFp_nist
- * * :GF2m_simple
- *
- * If the first argument is :GFp or :GF2m, creates a new curve with given
- * parameters.
+/* call-seq:
+ * OpenSSL::PKey::EC::Group.new("secp112r1")
+ * OpenSSL::PKey::EC::Group.new(ec_group)
+ * OpenSSL::PKey::EC::Group.new(pem_string)
+ * OpenSSL::PKey::EC::Group.new(der_string)
+ * OpenSSL::PKey::EC::Group.new(pem_file)
+ * OpenSSL::PKey::EC::Group.new(der_file)
+ * OpenSSL::PKey::EC::Group.new(:GFp_simple)
+ * OpenSSL::PKey::EC::Group.new(:GFp_mult)
+ * OpenSSL::PKey::EC::Group.new(:GFp_nist)
+ * OpenSSL::PKey::EC::Group.new(:GF2m_simple)
+ * OpenSSL::PKey::EC::Group.new(:GFp, bignum_p, bignum_a, bignum_b)
+ * OpenSSL::PKey::EC::Group.new(:GF2m, bignum_p, bignum_a, bignum_b)
+ *
+ * See the OpenSSL documentation for EC_GROUP_*
*/
static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE arg1, arg2, arg3, arg4;
- EC_GROUP *group;
+ ossl_ec_group *ec_group;
+ EC_GROUP *group = NULL;
- TypedData_Get_Struct(self, EC_GROUP, &ossl_ec_group_type, group);
- if (group)
+ Data_Get_Struct(self, ossl_ec_group, ec_group);
+ if (ec_group->group != NULL)
ossl_raise(rb_eRuntimeError, "EC_GROUP is already initialized");
switch (rb_scan_args(argc, argv, "13", &arg1, &arg2, &arg3, &arg4)) {
@@ -759,11 +777,11 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
} else if (rb_obj_is_kind_of(arg1, cEC_GROUP)) {
const EC_GROUP *arg1_group;
- GetECGroup(arg1, arg1_group);
+ SafeRequire_EC_GROUP(arg1, arg1_group);
if ((group = EC_GROUP_dup(arg1_group)) == NULL)
ossl_raise(eEC_GROUP, "EC_GROUP_dup");
} else {
- BIO *in = ossl_obj2bio(&arg1);
+ BIO *in = ossl_obj2bio(arg1);
group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
if (!group) {
@@ -777,13 +795,13 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
const char *name = StringValueCStr(arg1);
int nid = OBJ_sn2nid(name);
- ossl_clear_error(); /* ignore errors in d2i_ECPKParameters_bio() */
+ (void)ERR_get_error();
if (nid == NID_undef)
- ossl_raise(eEC_GROUP, "unknown curve name (%"PRIsVALUE")", arg1);
+ ossl_raise(eEC_GROUP, "unknown curve name (%s)", name);
group = EC_GROUP_new_by_curve_name(nid);
if (group == NULL)
- ossl_raise(eEC_GROUP, "unable to create curve (%"PRIsVALUE")", arg1);
+ ossl_raise(eEC_GROUP, "unable to create curve (%s)", name);
EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
EC_GROUP_set_point_conversion_form(group, POINT_CONVERSION_UNCOMPRESSED);
@@ -822,43 +840,23 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
if (group == NULL)
ossl_raise(eEC_GROUP, "");
- RTYPEDDATA_DATA(self) = group;
-
- return self;
-}
-static VALUE
-ossl_ec_group_initialize_copy(VALUE self, VALUE other)
-{
- EC_GROUP *group, *group_new;
-
- TypedData_Get_Struct(self, EC_GROUP, &ossl_ec_group_type, group_new);
- if (group_new)
- ossl_raise(eEC_GROUP, "EC::Group already initialized");
- GetECGroup(other, group);
-
- group_new = EC_GROUP_dup(group);
- if (!group_new)
- ossl_raise(eEC_GROUP, "EC_GROUP_dup");
- RTYPEDDATA_DATA(self) = group_new;
+ ec_group->group = group;
return self;
}
-/*
- * call-seq:
- * group1.eql?(group2) => true | false
- * group1 == group2 => true | false
+/* call-seq:
+ * group1.eql?(group2) => true | false
+ * group1 == group2 => true | false
*
- * Returns +true+ if the two groups use the same curve and have the same
- * parameters, +false+ otherwise.
*/
static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
{
EC_GROUP *group1 = NULL, *group2 = NULL;
- GetECGroup(a, group1);
- GetECGroup(b, group2);
+ Require_EC_GROUP(a, group1);
+ SafeRequire_EC_GROUP(b, group2);
if (EC_GROUP_cmp(group1, group2, ossl_bn_ctx) == 1)
return Qfalse;
@@ -866,35 +864,27 @@ static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
return Qtrue;
}
-/*
- * call-seq:
- * group.generator => ec_point
+/* call-seq:
+ * group.generator => ec_point
*
- * Returns the generator of the group.
- *
- * See the OpenSSL documentation for EC_GROUP_get0_generator()
+ * See the OpenSSL documentation for EC_GROUP_get0_generator()
*/
static VALUE ossl_ec_group_get_generator(VALUE self)
{
- EC_GROUP *group;
- const EC_POINT *generator;
+ VALUE point_obj;
+ EC_GROUP *group = NULL;
+
+ Require_EC_GROUP(self, group);
- GetECGroup(self, group);
- generator = EC_GROUP_get0_generator(group);
- if (!generator)
- return Qnil;
+ point_obj = ossl_ec_point_dup(EC_GROUP_get0_generator(group), self);
- return ec_point_new(generator, group);
+ return point_obj;
}
-/*
- * call-seq:
- * group.set_generator(generator, order, cofactor) => self
- *
- * Sets the curve parameters. _generator_ must be an instance of EC::Point that
- * is on the curve. _order_ and _cofactor_ are integers.
+/* call-seq:
+ * group.set_generator(generator, order, cofactor) => self
*
- * See the OpenSSL documentation for EC_GROUP_set_generator()
+ * See the OpenSSL documentation for EC_GROUP_set_generator()
*/
static VALUE ossl_ec_group_set_generator(VALUE self, VALUE generator, VALUE order, VALUE cofactor)
{
@@ -902,8 +892,8 @@ static VALUE ossl_ec_group_set_generator(VALUE self, VALUE generator, VALUE orde
const EC_POINT *point;
const BIGNUM *o, *co;
- GetECGroup(self, group);
- GetECPoint(generator, point);
+ Require_EC_GROUP(self, group);
+ SafeRequire_EC_POINT(generator, point);
o = GetBNPtr(order);
co = GetBNPtr(cofactor);
@@ -913,13 +903,10 @@ static VALUE ossl_ec_group_set_generator(VALUE self, VALUE generator, VALUE orde
return self;
}
-/*
- * call-seq:
- * group.get_order => order_bn
- *
- * Returns the order of the group.
+/* call-seq:
+ * group.get_order => order_bn
*
- * See the OpenSSL documentation for EC_GROUP_get_order()
+ * See the OpenSSL documentation for EC_GROUP_get_order()
*/
static VALUE ossl_ec_group_get_order(VALUE self)
{
@@ -927,7 +914,7 @@ static VALUE ossl_ec_group_get_order(VALUE self)
BIGNUM *bn;
EC_GROUP *group = NULL;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
bn_obj = ossl_bn_new(NULL);
bn = GetBNPtr(bn_obj);
@@ -938,13 +925,10 @@ static VALUE ossl_ec_group_get_order(VALUE self)
return bn_obj;
}
-/*
- * call-seq:
- * group.get_cofactor => cofactor_bn
- *
- * Returns the cofactor of the group.
+/* call-seq:
+ * group.get_cofactor => cofactor_bn
*
- * See the OpenSSL documentation for EC_GROUP_get_cofactor()
+ * See the OpenSSL documentation for EC_GROUP_get_cofactor()
*/
static VALUE ossl_ec_group_get_cofactor(VALUE self)
{
@@ -952,7 +936,7 @@ static VALUE ossl_ec_group_get_cofactor(VALUE self)
BIGNUM *bn;
EC_GROUP *group = NULL;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
bn_obj = ossl_bn_new(NULL);
bn = GetBNPtr(bn_obj);
@@ -963,20 +947,17 @@ static VALUE ossl_ec_group_get_cofactor(VALUE self)
return bn_obj;
}
-/*
- * call-seq:
- * group.curve_name => String
- *
- * Returns the curve name (sn).
+/* call-seq:
+ * group.curve_name => String
*
- * See the OpenSSL documentation for EC_GROUP_get_curve_name()
+ * See the OpenSSL documentation for EC_GROUP_get_curve_name()
*/
static VALUE ossl_ec_group_get_curve_name(VALUE self)
{
EC_GROUP *group = NULL;
int nid;
- GetECGroup(self, group);
+ Get_EC_GROUP(self, group);
if (group == NULL)
return Qnil;
@@ -986,14 +967,10 @@ static VALUE ossl_ec_group_get_curve_name(VALUE self)
return rb_str_new2(OBJ_nid2sn(nid));
}
-/*
- * call-seq:
- * EC.builtin_curves => [[sn, comment], ...]
- *
- * Obtains a list of all predefined curves by the OpenSSL. Curve names are
- * returned as sn.
+/* call-seq:
+ * EC.builtin_curves => [[name, comment], ...]
*
- * See the OpenSSL documentation for EC_get_builtin_curves().
+ * See the OpenSSL documentation for EC_builtin_curves()
*/
static VALUE ossl_s_builtin_curves(VALUE self)
{
@@ -1023,56 +1000,43 @@ static VALUE ossl_s_builtin_curves(VALUE self)
return ret;
}
-/*
- * call-seq:
- * group.asn1_flag -> Integer
+/* call-seq:
+ * group.asn1_flag => Fixnum
*
- * Returns the flags set on the group.
- *
- * See also #asn1_flag=.
+ * See the OpenSSL documentation for EC_GROUP_get_asn1_flag()
*/
static VALUE ossl_ec_group_get_asn1_flag(VALUE self)
{
EC_GROUP *group = NULL;
int flag;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
+
flag = EC_GROUP_get_asn1_flag(group);
- return INT2NUM(flag);
+ return INT2FIX(flag);
}
-/*
- * call-seq:
- * group.asn1_flag = flags
- *
- * Sets flags on the group. The flag value is used to determine how to encode
- * the group: encode explicit parameters or named curve using an OID.
- *
- * The flag value can be either of:
- *
- * * EC::NAMED_CURVE
- * * EC::EXPLICIT_CURVE
+/* call-seq:
+ * group.asn1_flag = Fixnum => Fixnum
*
- * See the OpenSSL documentation for EC_GROUP_set_asn1_flag().
+ * See the OpenSSL documentation for EC_GROUP_set_asn1_flag()
*/
static VALUE ossl_ec_group_set_asn1_flag(VALUE self, VALUE flag_v)
{
EC_GROUP *group = NULL;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
+
EC_GROUP_set_asn1_flag(group, NUM2INT(flag_v));
return flag_v;
}
-/*
- * call-seq:
- * group.point_conversion_form -> Symbol
+/* call-seq:
+ * group.point_conversion_form => :uncompressed | :compressed | :hybrid
*
- * Returns the form how EC::Point data is encoded as ASN.1.
- *
- * See also #point_conversion_form=.
+ * See the OpenSSL documentation for EC_GROUP_get_point_conversion_form()
*/
static VALUE ossl_ec_group_get_point_conversion_form(VALUE self)
{
@@ -1080,7 +1044,8 @@ static VALUE ossl_ec_group_get_point_conversion_form(VALUE self)
point_conversion_form_t form;
VALUE ret;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
+
form = EC_GROUP_get_point_conversion_form(group);
switch (form) {
@@ -1093,67 +1058,46 @@ static VALUE ossl_ec_group_get_point_conversion_form(VALUE self)
return ID2SYM(ret);
}
-static point_conversion_form_t
-parse_point_conversion_form_symbol(VALUE sym)
-{
- ID id = SYM2ID(sym);
-
- if (id == ID_uncompressed)
- return POINT_CONVERSION_UNCOMPRESSED;
- else if (id == ID_compressed)
- return POINT_CONVERSION_COMPRESSED;
- else if (id == ID_hybrid)
- return POINT_CONVERSION_HYBRID;
- else
- ossl_raise(rb_eArgError, "unsupported point conversion form %+"PRIsVALUE
- " (expected :compressed, :uncompressed, or :hybrid)", sym);
-}
-
-/*
- * call-seq:
- * group.point_conversion_form = form
+/* call-seq:
+ * group.point_conversion_form = form => form
*
- * Sets the form how EC::Point data is encoded as ASN.1 as defined in X9.62.
- *
- * _format_ can be one of these:
- *
- * +:compressed+::
- * Encoded as z||x, where z is an octet indicating which solution of the
- * equation y is. z will be 0x02 or 0x03.
- * +:uncompressed+::
- * Encoded as z||x||y, where z is an octet 0x04.
- * +:hybrid+::
- * Encodes as z||x||y, where z is an octet indicating which solution of the
- * equation y is. z will be 0x06 or 0x07.
- *
- * See the OpenSSL documentation for EC_GROUP_set_point_conversion_form()
+ * See the OpenSSL documentation for EC_GROUP_set_point_conversion_form()
*/
-static VALUE
-ossl_ec_group_set_point_conversion_form(VALUE self, VALUE form_v)
+static VALUE ossl_ec_group_set_point_conversion_form(VALUE self, VALUE form_v)
{
- EC_GROUP *group;
+ EC_GROUP *group = NULL;
point_conversion_form_t form;
+ ID form_id = SYM2ID(form_v);
- GetECGroup(self, group);
- form = parse_point_conversion_form_symbol(form_v);
+ Require_EC_GROUP(self, group);
+
+ if (form_id == ID_uncompressed) {
+ form = POINT_CONVERSION_UNCOMPRESSED;
+ } else if (form_id == ID_compressed) {
+ form = POINT_CONVERSION_COMPRESSED;
+ } else if (form_id == ID_hybrid) {
+ form = POINT_CONVERSION_HYBRID;
+ } else {
+ ossl_raise(rb_eArgError, "form must be :compressed, :uncompressed, or :hybrid");
+ }
EC_GROUP_set_point_conversion_form(group, form);
return form_v;
}
-/*
- * call-seq:
- * group.seed => String or nil
+/* call-seq:
+ * group.seed => String or nil
*
- * See the OpenSSL documentation for EC_GROUP_get0_seed()
+ * See the OpenSSL documentation for EC_GROUP_get0_seed()
*/
static VALUE ossl_ec_group_get_seed(VALUE self)
{
EC_GROUP *group = NULL;
size_t seed_len;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
+
seed_len = EC_GROUP_get_seed_len(group);
if (seed_len == 0)
@@ -1162,17 +1106,16 @@ static VALUE ossl_ec_group_get_seed(VALUE self)
return rb_str_new((const char *)EC_GROUP_get0_seed(group), seed_len);
}
-/*
- * call-seq:
- * group.seed = seed => seed
+/* call-seq:
+ * group.seed = seed => seed
*
- * See the OpenSSL documentation for EC_GROUP_set_seed()
+ * See the OpenSSL documentation for EC_GROUP_set_seed()
*/
static VALUE ossl_ec_group_set_seed(VALUE self, VALUE seed)
{
EC_GROUP *group = NULL;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
StringValue(seed);
if (EC_GROUP_set_seed(group, (unsigned char *)RSTRING_PTR(seed), RSTRING_LEN(seed)) != (size_t)RSTRING_LEN(seed))
@@ -1183,17 +1126,16 @@ static VALUE ossl_ec_group_set_seed(VALUE self, VALUE seed)
/* get/set curve GFp, GF2m */
-/*
- * call-seq:
- * group.degree => integer
+/* call-seq:
+ * group.degree => Fixnum
*
- * See the OpenSSL documentation for EC_GROUP_get_degree()
+ * See the OpenSSL documentation for EC_GROUP_get_degree()
*/
static VALUE ossl_ec_group_get_degree(VALUE self)
{
EC_GROUP *group = NULL;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
return INT2NUM(EC_GROUP_get_degree(group));
}
@@ -1205,7 +1147,7 @@ static VALUE ossl_ec_group_to_string(VALUE self, int format)
int i = -1;
VALUE str;
- GetECGroup(self, group);
+ Get_EC_GROUP(self, group);
if (!(out = BIO_new(BIO_s_mem())))
ossl_raise(eEC_GROUP, "BIO_new(BIO_s_mem())");
@@ -1232,9 +1174,8 @@ static VALUE ossl_ec_group_to_string(VALUE self, int format)
return str;
}
-/*
- * call-seq:
- * group.to_pem => String
+/* call-seq:
+ * group.to_pem => String
*
* See the OpenSSL documentation for PEM_write_bio_ECPKParameters()
*/
@@ -1243,22 +1184,20 @@ static VALUE ossl_ec_group_to_pem(VALUE self)
return ossl_ec_group_to_string(self, EXPORT_PEM);
}
-/*
- * call-seq:
- * group.to_der => String
+/* call-seq:
+ * group.to_der => String
*
- * See the OpenSSL documentation for i2d_ECPKParameters_bio()
+ * See the OpenSSL documentation for i2d_ECPKParameters_bio()
*/
static VALUE ossl_ec_group_to_der(VALUE self)
{
return ossl_ec_group_to_string(self, EXPORT_DER);
}
-/*
- * call-seq:
- * group.to_text => String
+/* call-seq:
+ * group.to_text => String
*
- * See the OpenSSL documentation for ECPKParameters_print()
+ * See the OpenSSL documentation for ECPKParameters_print()
*/
static VALUE ossl_ec_group_to_text(VALUE self)
{
@@ -1266,7 +1205,7 @@ static VALUE ossl_ec_group_to_text(VALUE self)
BIO *out;
VALUE str;
- GetECGroup(self, group);
+ Require_EC_GROUP(self, group);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eEC_GROUP, "BIO_new(BIO_s_mem())");
}
@@ -1280,149 +1219,121 @@ static VALUE ossl_ec_group_to_text(VALUE self)
}
-/*
- * OpenSSL::PKey::EC::Point
- */
-static void
-ossl_ec_point_free(void *ptr)
-{
- EC_POINT_clear_free(ptr);
-}
-
-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)
+static void ossl_ec_point_free(ossl_ec_point *ec_point)
{
- return TypedData_Wrap_Struct(klass, &ossl_ec_point_type, NULL);
+ if (!ec_point->dont_free && ec_point->point)
+ EC_POINT_clear_free(ec_point->point);
+ ruby_xfree(ec_point);
}
-static VALUE
-ec_point_new(const EC_POINT *point, const EC_GROUP *group)
+static VALUE ossl_ec_point_alloc(VALUE klass)
{
- EC_POINT *point_new;
+ ossl_ec_point *ec_point;
VALUE obj;
- obj = ossl_ec_point_alloc(cEC_POINT);
- point_new = EC_POINT_dup(point, group);
- if (!point_new)
- ossl_raise(eEC_POINT, "EC_POINT_dup");
- RTYPEDDATA_DATA(obj) = point_new;
- rb_ivar_set(obj, id_i_group, ec_group_new(group));
+ obj = Data_Make_Struct(klass, ossl_ec_point, 0, ossl_ec_point_free, ec_point);
return obj;
}
-static VALUE ossl_ec_point_initialize_copy(VALUE, VALUE);
/*
- * call-seq:
- * OpenSSL::PKey::EC::Point.new(point)
- * OpenSSL::PKey::EC::Point.new(group [, encoded_point])
- *
- * Creates a new instance of OpenSSL::PKey::EC::Point. If the only argument is
- * an instance of EC::Point, a copy is returned. Otherwise, creates a point
- * that belongs to _group_.
+ * call-seq:
+ * OpenSSL::PKey::EC::Point.new(point)
+ * OpenSSL::PKey::EC::Point.new(group)
+ * OpenSSL::PKey::EC::Point.new(group, bn)
*
- * _encoded_point_ is the octet string representation of the point. This
- * must be either a String or an OpenSSL::BN.
+ * See the OpenSSL documentation for EC_POINT_*
*/
static VALUE ossl_ec_point_initialize(int argc, VALUE *argv, VALUE self)
{
- EC_POINT *point;
- VALUE group_v, arg2;
- const EC_GROUP *group;
+ ossl_ec_point *ec_point;
+ EC_POINT *point = NULL;
+ VALUE arg1, arg2;
+ VALUE group_v = Qnil;
+ const EC_GROUP *group = NULL;
- TypedData_Get_Struct(self, EC_POINT, &ossl_ec_point_type, point);
- if (point)
- rb_raise(eEC_POINT, "EC_POINT already initialized");
+ Data_Get_Struct(self, ossl_ec_point, ec_point);
+ if (ec_point->point)
+ ossl_raise(eEC_POINT, "EC_POINT already initialized");
- rb_scan_args(argc, argv, "11", &group_v, &arg2);
- if (rb_obj_is_kind_of(group_v, cEC_POINT)) {
- if (argc != 1)
- rb_raise(rb_eArgError, "invalid second argument");
- return ossl_ec_point_initialize_copy(self, group_v);
- }
+ switch (rb_scan_args(argc, argv, "11", &arg1, &arg2)) {
+ case 1:
+ if (rb_obj_is_kind_of(arg1, cEC_POINT)) {
+ const EC_POINT *arg_point;
- GetECGroup(group_v, group);
- if (argc == 1) {
- point = EC_POINT_new(group);
- if (!point)
- ossl_raise(eEC_POINT, "EC_POINT_new");
- }
- else {
- if (rb_obj_is_kind_of(arg2, cBN)) {
- point = EC_POINT_bn2point(group, GetBNPtr(arg2), NULL, ossl_bn_ctx);
- if (!point)
- ossl_raise(eEC_POINT, "EC_POINT_bn2point");
- }
- else {
- StringValue(arg2);
- point = EC_POINT_new(group);
- if (!point)
- ossl_raise(eEC_POINT, "EC_POINT_new");
- if (!EC_POINT_oct2point(group, point,
- (unsigned char *)RSTRING_PTR(arg2),
- RSTRING_LEN(arg2), ossl_bn_ctx)) {
- EC_POINT_free(point);
- ossl_raise(eEC_POINT, "EC_POINT_oct2point");
- }
- }
- }
+ group_v = rb_iv_get(arg1, "@group");
+ SafeRequire_EC_GROUP(group_v, group);
+ SafeRequire_EC_POINT(arg1, arg_point);
- RTYPEDDATA_DATA(self) = point;
- rb_ivar_set(self, id_i_group, group_v);
+ point = EC_POINT_dup(arg_point, group);
+ } else if (rb_obj_is_kind_of(arg1, cEC_GROUP)) {
+ group_v = arg1;
+ SafeRequire_EC_GROUP(group_v, group);
- return self;
-}
+ point = EC_POINT_new(group);
+ } else {
+ ossl_raise(eEC_POINT, "wrong argument type: must be OpenSSL::PKey::EC::Point or OpenSSL::Pkey::EC::Group");
+ }
-static VALUE
-ossl_ec_point_initialize_copy(VALUE self, VALUE other)
-{
- EC_POINT *point, *point_new;
- EC_GROUP *group;
- VALUE group_v;
+ break;
+ case 2:
+ if (!rb_obj_is_kind_of(arg1, cEC_GROUP))
+ ossl_raise(rb_eArgError, "1st argument must be OpenSSL::PKey::EC::Group");
+ group_v = arg1;
+ SafeRequire_EC_GROUP(group_v, group);
+
+ if (rb_obj_is_kind_of(arg2, cBN)) {
+ const BIGNUM *bn = GetBNPtr(arg2);
+
+ point = EC_POINT_bn2point(group, bn, NULL, ossl_bn_ctx);
+ } else {
+ BIO *in = ossl_obj2bio(arg1);
+
+/* BUG: finish me */
+
+ BIO_free(in);
+
+ if (point == NULL) {
+ ossl_raise(eEC_POINT, "unknown type for 2nd arg");
+ }
+ }
+ break;
+ default:
+ ossl_raise(rb_eArgError, "wrong number of arguments");
+ }
+
+ if (point == NULL)
+ ossl_raise(eEC_POINT, NULL);
- TypedData_Get_Struct(self, EC_POINT, &ossl_ec_point_type, point_new);
- if (point_new)
- ossl_raise(eEC_POINT, "EC::Point already initialized");
- GetECPoint(other, point);
+ if (NIL_P(group_v))
+ ossl_raise(rb_eRuntimeError, "missing group (internal error)");
- group_v = rb_obj_dup(rb_attr_get(other, id_i_group));
- GetECGroup(group_v, group);
+ ec_point->point = point;
- point_new = EC_POINT_dup(point, group);
- if (!point_new)
- ossl_raise(eEC_POINT, "EC_POINT_dup");
- RTYPEDDATA_DATA(self) = point_new;
- rb_ivar_set(self, id_i_group, group_v);
+ rb_iv_set(self, "@group", group_v);
return self;
}
/*
- * call-seq:
- * point1.eql?(point2) => true | false
- * point1 == point2 => true | false
+ * call-seq:
+ * point1.eql?(point2) => true | false
+ * point1 == point2 => true | false
+ *
*/
static VALUE ossl_ec_point_eql(VALUE a, VALUE b)
{
EC_POINT *point1, *point2;
- VALUE group_v1 = rb_attr_get(a, id_i_group);
- VALUE group_v2 = rb_attr_get(b, id_i_group);
+ VALUE group_v1 = rb_iv_get(a, "@group");
+ VALUE group_v2 = rb_iv_get(b, "@group");
const EC_GROUP *group;
if (ossl_ec_group_eql(group_v1, group_v2) == Qfalse)
return Qfalse;
- GetECPoint(a, point1);
- GetECPoint(b, point2);
- GetECGroup(group_v1, group);
+ Require_EC_POINT(a, point1);
+ SafeRequire_EC_POINT(b, point2);
+ SafeRequire_EC_GROUP(group_v1, group);
if (EC_POINT_cmp(group, point1, point2, ossl_bn_ctx) == 1)
return Qfalse;
@@ -1431,16 +1342,18 @@ static VALUE ossl_ec_point_eql(VALUE a, VALUE b)
}
/*
- * call-seq:
- * point.infinity? => true | false
+ * call-seq:
+ * point.infinity? => true | false
+ *
*/
static VALUE ossl_ec_point_is_at_infinity(VALUE self)
{
EC_POINT *point;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
- GetECPoint(self, point);
- GetECPointGroup(self, group);
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
switch (EC_POINT_is_at_infinity(group, point)) {
case 1: return Qtrue;
@@ -1452,16 +1365,18 @@ static VALUE ossl_ec_point_is_at_infinity(VALUE self)
}
/*
- * call-seq:
- * point.on_curve? => true | false
+ * call-seq:
+ * point.on_curve? => true | false
+ *
*/
static VALUE ossl_ec_point_is_on_curve(VALUE self)
{
EC_POINT *point;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
- GetECPoint(self, point);
- GetECPointGroup(self, group);
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
switch (EC_POINT_is_on_curve(group, point, ossl_bn_ctx)) {
case 1: return Qtrue;
@@ -1473,16 +1388,18 @@ static VALUE ossl_ec_point_is_on_curve(VALUE self)
}
/*
- * call-seq:
- * point.make_affine! => self
+ * call-seq:
+ * point.make_affine! => self
+ *
*/
static VALUE ossl_ec_point_make_affine(VALUE self)
{
EC_POINT *point;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
- GetECPoint(self, point);
- GetECPointGroup(self, group);
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
if (EC_POINT_make_affine(group, point, ossl_bn_ctx) != 1)
ossl_raise(cEC_POINT, "EC_POINT_make_affine");
@@ -1491,16 +1408,18 @@ static VALUE ossl_ec_point_make_affine(VALUE self)
}
/*
- * call-seq:
- * point.invert! => self
+ * call-seq:
+ * point.invert! => self
+ *
*/
static VALUE ossl_ec_point_invert(VALUE self)
{
EC_POINT *point;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
- GetECPoint(self, point);
- GetECPointGroup(self, group);
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
if (EC_POINT_invert(group, point, ossl_bn_ctx) != 1)
ossl_raise(cEC_POINT, "EC_POINT_invert");
@@ -1509,16 +1428,18 @@ static VALUE ossl_ec_point_invert(VALUE self)
}
/*
- * call-seq:
- * point.set_to_infinity! => self
+ * call-seq:
+ * point.set_to_infinity! => self
+ *
*/
static VALUE ossl_ec_point_set_to_infinity(VALUE self)
{
EC_POINT *point;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
- GetECPoint(self, point);
- GetECPointGroup(self, group);
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
if (EC_POINT_set_to_infinity(group, point) != 1)
ossl_raise(cEC_POINT, "EC_POINT_set_to_infinity");
@@ -1527,153 +1448,123 @@ static VALUE ossl_ec_point_set_to_infinity(VALUE self)
}
/*
- * call-seq:
- * point.to_octet_string(conversion_form) -> String
- *
- * Returns the octet string representation of the elliptic curve point.
- *
- * _conversion_form_ specifies how the point is converted. Possible values are:
+ * call-seq:
+ * point.to_bn => OpenSSL::BN
*
- * - +:compressed+
- * - +:uncompressed+
- * - +:hybrid+
+ * See the OpenSSL documentation for EC_POINT_point2bn()
*/
-static VALUE
-ossl_ec_point_to_octet_string(VALUE self, VALUE conversion_form)
+static VALUE ossl_ec_point_to_bn(VALUE self)
{
EC_POINT *point;
+ VALUE bn_obj;
+ VALUE group_v = rb_iv_get(self, "@group");
const EC_GROUP *group;
point_conversion_form_t form;
- VALUE str;
- size_t len;
-
- GetECPoint(self, point);
- GetECPointGroup(self, group);
- form = parse_point_conversion_form_symbol(conversion_form);
-
- len = EC_POINT_point2oct(group, point, form, NULL, 0, ossl_bn_ctx);
- if (!len)
- ossl_raise(eEC_POINT, "EC_POINT_point2oct");
- str = rb_str_new(NULL, (long)len);
- if (!EC_POINT_point2oct(group, point, form,
- (unsigned char *)RSTRING_PTR(str), len,
- ossl_bn_ctx))
- ossl_raise(eEC_POINT, "EC_POINT_point2oct");
- return str;
+ BIGNUM *bn;
+
+ Require_EC_POINT(self, point);
+ SafeRequire_EC_GROUP(group_v, group);
+
+ form = EC_GROUP_get_point_conversion_form(group);
+
+ bn_obj = rb_obj_alloc(cBN);
+ bn = GetBNPtr(bn_obj);
+
+ if (EC_POINT_point2bn(group, point, form, bn, ossl_bn_ctx) == NULL)
+ ossl_raise(eEC_POINT, "EC_POINT_point2bn");
+
+ return bn_obj;
}
/*
- * call-seq:
- * point.mul(bn1 [, bn2]) => point
- * point.mul(bns, points [, bn2]) => point
- *
- * Performs elliptic curve point multiplication.
- *
- * The first form calculates <tt>bn1 * point + bn2 * G</tt>, where +G+ is the
- * generator of the group of _point_. _bn2_ may be omitted, and in that case,
- * the result is just <tt>bn1 * point</tt>.
- *
- * The second form calculates <tt>bns[0] * point + bns[1] * points[0] + ...
- * + bns[-1] * points[-1] + bn2 * G</tt>. _bn2_ may be omitted. _bns_ must be
- * an array of OpenSSL::BN. _points_ must be an array of
- * OpenSSL::PKey::EC::Point. Please note that <tt>points[0]</tt> is not
- * multiplied by <tt>bns[0]</tt>, but <tt>bns[1]</tt>.
+ * call-seq:
+ * point.mul(bn) => point
+ * point.mul(bn, bn) => point
+ * point.mul([bn], [point]) => point
+ * point.mul([bn], [point], bn) => point
*/
static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self)
{
- EC_POINT *point_self, *point_result;
+ EC_POINT *point1, *point2;
const EC_GROUP *group;
- VALUE group_v = rb_attr_get(self, id_i_group);
- VALUE arg1, arg2, arg3, result;
- const BIGNUM *bn_g = NULL;
+ VALUE group_v = rb_iv_get(self, "@group");
+ VALUE bn_v1, bn_v2, r, points_v;
+ BIGNUM *bn1 = NULL, *bn2 = NULL;
- GetECPoint(self, point_self);
- GetECGroup(group_v, group);
+ Require_EC_POINT(self, point1);
+ SafeRequire_EC_GROUP(group_v, group);
- result = rb_obj_alloc(cEC_POINT);
- ossl_ec_point_initialize(1, &group_v, result);
- GetECPoint(result, point_result);
+ r = rb_obj_alloc(cEC_POINT);
+ ossl_ec_point_initialize(1, &group_v, r);
+ Require_EC_POINT(r, point2);
- rb_scan_args(argc, argv, "12", &arg1, &arg2, &arg3);
- if (!RB_TYPE_P(arg1, T_ARRAY)) {
- BIGNUM *bn = GetBNPtr(arg1);
+ argc = rb_scan_args(argc, argv, "12", &bn_v1, &points_v, &bn_v2);
- if (!NIL_P(arg2))
- bn_g = GetBNPtr(arg2);
- if (EC_POINT_mul(group, point_result, bn_g, point_self, bn, ossl_bn_ctx) != 1)
- ossl_raise(eEC_POINT, NULL);
+ if (rb_obj_is_kind_of(bn_v1, cBN)) {
+ bn1 = GetBNPtr(bn_v1);
+ if (argc >= 2) {
+ bn2 = GetBNPtr(points_v);
+ }
+ if (EC_POINT_mul(group, point2, bn2, point1, bn1, ossl_bn_ctx) != 1)
+ ossl_raise(eEC_POINT, "Multiplication failed");
} else {
- /*
- * bignums | arg1[0] | arg1[1] | arg1[2] | ...
- * points | self | arg2[0] | arg2[1] | ...
- */
- long i, num;
- VALUE bns_tmp, tmp_p, tmp_b;
- const EC_POINT **points;
- const BIGNUM **bignums;
-
- Check_Type(arg1, T_ARRAY);
- Check_Type(arg2, T_ARRAY);
- if (RARRAY_LEN(arg1) != RARRAY_LEN(arg2) + 1) /* arg2 must be 1 larger */
- ossl_raise(rb_eArgError, "bns must be 1 longer than points; see the documentation");
-
- num = RARRAY_LEN(arg1);
- bns_tmp = rb_ary_tmp_new(num);
- bignums = ALLOCV_N(const BIGNUM *, tmp_b, num);
- for (i = 0; i < num; i++) {
- VALUE item = RARRAY_AREF(arg1, i);
- bignums[i] = GetBNPtr(item);
- rb_ary_push(bns_tmp, item);
- }
+ size_t i, points_len, bignums_len;
+ const EC_POINT **points;
+ const BIGNUM **bignums;
- points = ALLOCV_N(const EC_POINT *, tmp_p, num);
- points[0] = point_self; /* self */
- for (i = 0; i < num - 1; i++)
- GetECPoint(RARRAY_AREF(arg2, i), points[i + 1]);
+ Check_Type(bn_v1, T_ARRAY);
+ bignums_len = RARRAY_LEN(bn_v1);
+ bignums = (const BIGNUM **)OPENSSL_malloc(bignums_len * (int)sizeof(BIGNUM *));
- if (!NIL_P(arg3))
- bn_g = GetBNPtr(arg3);
+ for (i = 0; i < bignums_len; ++i) {
+ bignums[i] = GetBNPtr(rb_ary_entry(bn_v1, i));
+ }
- if (EC_POINTs_mul(group, point_result, bn_g, num, points, bignums, ossl_bn_ctx) != 1) {
- ALLOCV_END(tmp_b);
- ALLOCV_END(tmp_p);
- ossl_raise(eEC_POINT, NULL);
- }
+ if (!rb_obj_is_kind_of(points_v, rb_cArray)) {
+ OPENSSL_free((void *)bignums);
+ rb_raise(rb_eTypeError, "Argument2 must be an array");
+ }
- ALLOCV_END(tmp_b);
- ALLOCV_END(tmp_p);
+ rb_ary_unshift(points_v, self);
+ points_len = RARRAY_LEN(points_v);
+ points = (const EC_POINT **)OPENSSL_malloc(points_len * (int)sizeof(EC_POINT *));
+
+ for (i = 0; i < points_len; ++i) {
+ Get_EC_POINT(rb_ary_entry(points_v, i), points[i]);
+ }
+
+ if (argc >= 3) {
+ bn2 = GetBNPtr(bn_v2);
+ }
+ if (EC_POINTs_mul(group, point2, bn2, points_len, points, bignums, ossl_bn_ctx) != 1) {
+ OPENSSL_free((void *)bignums);
+ OPENSSL_free((void *)points);
+ ossl_raise(eEC_POINT, "Multiplication failed");
+ }
+ OPENSSL_free((void *)bignums);
+ OPENSSL_free((void *)points);
}
- return result;
+ return r;
+}
+
+static void no_copy(VALUE klass)
+{
+ rb_undef_method(klass, "copy");
+ rb_undef_method(klass, "clone");
+ rb_undef_method(klass, "dup");
+ rb_undef_method(klass, "initialize_copy");
}
-void Init_ossl_ec(void)
+void Init_ossl_ec()
{
-#undef rb_intern
-#if 0
+#ifdef DONT_NEED_RDOC_WORKAROUND
+ mOSSL = rb_define_module("OpenSSL");
mPKey = rb_define_module_under(mOSSL, "PKey");
- cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- ePKeyError = rb_define_class_under(mPKey, "PKeyError", eOSSLError);
#endif
eECError = rb_define_class_under(mPKey, "ECError", ePKeyError);
- /*
- * Document-class: OpenSSL::PKey::EC
- *
- * OpenSSL::PKey::EC provides access to Elliptic Curve Digital Signature
- * Algorithm (ECDSA) and Elliptic Curve Diffie-Hellman (ECDH).
- *
- * === Key exchange
- * ec1 = OpenSSL::PKey::EC.generate("prime256v1")
- * ec2 = OpenSSL::PKey::EC.generate("prime256v1")
- * # ec1 and ec2 have own private key respectively
- * shared_key1 = ec1.dh_compute_key(ec2.public_key)
- * shared_key2 = ec2.dh_compute_key(ec1.public_key)
- *
- * p shared_key1 == shared_key2 #=> true
- */
cEC = rb_define_class_under(mPKey, "EC", cPKey);
cEC_GROUP = rb_define_class_under(cEC, "Group", rb_cObject);
cEC_POINT = rb_define_class_under(cEC, "Point", rb_cObject);
@@ -1691,16 +1582,13 @@ void Init_ossl_ec(void)
ID_compressed = rb_intern("compressed");
ID_hybrid = rb_intern("hybrid");
- rb_define_const(cEC, "NAMED_CURVE", INT2NUM(OPENSSL_EC_NAMED_CURVE));
-#if defined(OPENSSL_EC_EXPLICIT_CURVE)
- rb_define_const(cEC, "EXPLICIT_CURVE", INT2NUM(OPENSSL_EC_EXPLICIT_CURVE));
+#ifdef OPENSSL_EC_NAMED_CURVE
+ rb_define_const(cEC, "NAMED_CURVE", ULONG2NUM(OPENSSL_EC_NAMED_CURVE));
#endif
rb_define_singleton_method(cEC, "builtin_curves", ossl_s_builtin_curves, 0);
- rb_define_singleton_method(cEC, "generate", ossl_ec_key_s_generate, 1);
rb_define_method(cEC, "initialize", ossl_ec_key_initialize, -1);
- rb_define_method(cEC, "initialize_copy", ossl_ec_key_initialize_copy, 1);
/* copy/dup/cmp */
rb_define_method(cEC, "group", ossl_ec_key_get_group, 0);
@@ -1709,10 +1597,8 @@ void Init_ossl_ec(void)
rb_define_method(cEC, "private_key=", ossl_ec_key_set_private_key, 1);
rb_define_method(cEC, "public_key", ossl_ec_key_get_public_key, 0);
rb_define_method(cEC, "public_key=", ossl_ec_key_set_public_key, 1);
- rb_define_method(cEC, "private?", ossl_ec_key_is_private, 0);
- rb_define_method(cEC, "public?", ossl_ec_key_is_public, 0);
- rb_define_alias(cEC, "private_key?", "private?");
- rb_define_alias(cEC, "public_key?", "public?");
+ rb_define_method(cEC, "private_key?", ossl_ec_key_is_private_key, 0);
+ rb_define_method(cEC, "public_key?", ossl_ec_key_is_public_key, 0);
/* rb_define_method(cEC, "", ossl_ec_key_get_, 0);
rb_define_method(cEC, "=", ossl_ec_key_set_ 1);
set/get enc_flags
@@ -1720,8 +1606,7 @@ void Init_ossl_ec(void)
set/get asn1_flag (can use ruby to call self.group.asn1_flag)
set/get precompute_mult
*/
- rb_define_method(cEC, "generate_key!", ossl_ec_key_generate_key, 0);
- rb_define_alias(cEC, "generate_key", "generate_key!");
+ rb_define_method(cEC, "generate_key", ossl_ec_key_generate_key, 0);
rb_define_method(cEC, "check_key", ossl_ec_key_check_key, 0);
rb_define_method(cEC, "dh_compute_key", ossl_ec_key_dh_compute_key, 1);
@@ -1737,7 +1622,6 @@ void Init_ossl_ec(void)
rb_define_alloc_func(cEC_GROUP, ossl_ec_group_alloc);
rb_define_method(cEC_GROUP, "initialize", ossl_ec_group_initialize, -1);
- rb_define_method(cEC_GROUP, "initialize_copy", ossl_ec_group_initialize_copy, 1);
rb_define_method(cEC_GROUP, "eql?", ossl_ec_group_eql, 1);
rb_define_alias(cEC_GROUP, "==", "eql?");
/* copy/dup/cmp */
@@ -1773,7 +1657,6 @@ void Init_ossl_ec(void)
rb_define_alloc_func(cEC_POINT, ossl_ec_point_alloc);
rb_define_method(cEC_POINT, "initialize", ossl_ec_point_initialize, -1);
- rb_define_method(cEC_POINT, "initialize_copy", ossl_ec_point_initialize_copy, 1);
rb_attr(cEC_POINT, rb_intern("group"), 1, 0, 0);
rb_define_method(cEC_POINT, "eql?", ossl_ec_point_eql, 1);
rb_define_alias(cEC_POINT, "==", "eql?");
@@ -1785,14 +1668,16 @@ void Init_ossl_ec(void)
rb_define_method(cEC_POINT, "set_to_infinity!", ossl_ec_point_set_to_infinity, 0);
/* all the other methods */
- rb_define_method(cEC_POINT, "to_octet_string", ossl_ec_point_to_octet_string, 1);
+ rb_define_method(cEC_POINT, "to_bn", ossl_ec_point_to_bn, 0);
rb_define_method(cEC_POINT, "mul", ossl_ec_point_mul, -1);
- id_i_group = rb_intern("@group");
+ no_copy(cEC);
+ no_copy(cEC_GROUP);
+ no_copy(cEC_POINT);
}
#else /* defined NO_EC */
-void Init_ossl_ec(void)
+void Init_ossl_ec()
{
}
#endif /* NO_EC */
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 4800fb2710..4c346a042f 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -1,42 +1,26 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
-#include "ossl.h"
-
#if !defined(OPENSSL_NO_RSA)
+#include "ossl.h"
+
#define GetPKeyRSA(obj, pkey) do { \
GetPKey((obj), (pkey)); \
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA) { /* PARANOIA? */ \
+ if (EVP_PKEY_type((pkey)->type) != EVP_PKEY_RSA) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A RSA!") ; \
} \
} while (0)
-#define GetRSA(obj, rsa) do { \
- EVP_PKEY *_pkey; \
- GetPKeyRSA((obj), _pkey); \
- (rsa) = EVP_PKEY_get0_RSA(_pkey); \
-} while (0)
-
-static inline int
-RSA_HAS_PRIVATE(RSA *rsa)
-{
- const BIGNUM *p, *q;
-
- RSA_get0_factors(rsa, &p, &q);
- return p && q; /* d? why? */
-}
-static inline int
-RSA_PRIVATE(VALUE obj, RSA *rsa)
-{
- return RSA_HAS_PRIVATE(rsa) || OSSL_PKEY_IS_PRIVATE(obj);
-}
+#define RSA_HAS_PRIVATE(rsa) ((rsa)->p && (rsa)->q)
+#define RSA_PRIVATE(obj,rsa) (RSA_HAS_PRIVATE(rsa)||OSSL_PKEY_IS_PRIVATE(obj))
/*
* Classes
@@ -56,7 +40,6 @@ rsa_instance(VALUE klass, RSA *rsa)
if (!rsa) {
return Qfalse;
}
- obj = NewPKey(klass);
if (!(pkey = EVP_PKEY_new())) {
return Qfalse;
}
@@ -64,7 +47,7 @@ rsa_instance(VALUE klass, RSA *rsa)
EVP_PKEY_free(pkey);
return Qfalse;
}
- SetPKey(obj, pkey);
+ WrapPKey(klass, obj, pkey);
return obj;
}
@@ -78,11 +61,10 @@ ossl_rsa_new(EVP_PKEY *pkey)
obj = rsa_instance(cRSA, RSA_new());
}
else {
- obj = NewPKey(cRSA);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA) {
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_RSA) {
ossl_raise(rb_eTypeError, "Not a RSA key!");
}
- SetPKey(obj, pkey);
+ WrapPKey(cRSA, obj, pkey);
}
if (obj == Qfalse) {
ossl_raise(eRSAError, NULL);
@@ -94,6 +76,7 @@ ossl_rsa_new(EVP_PKEY *pkey)
/*
* Private
*/
+#if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB
struct rsa_blocking_gen_arg {
RSA *rsa;
BIGNUM *e;
@@ -109,41 +92,42 @@ rsa_blocking_gen(void *arg)
gen->result = RSA_generate_key_ex(gen->rsa, gen->size, gen->e, gen->cb);
return 0;
}
+#endif
static RSA *
rsa_generate(int size, unsigned long exp)
{
+#if defined(HAVE_RSA_GENERATE_KEY_EX) && HAVE_BN_GENCB
int i;
- struct ossl_generate_cb_arg cb_arg = { 0 };
+ BN_GENCB cb;
+ struct ossl_generate_cb_arg cb_arg;
struct rsa_blocking_gen_arg gen_arg;
RSA *rsa = RSA_new();
BIGNUM *e = BN_new();
- BN_GENCB *cb = BN_GENCB_new();
- if (!rsa || !e || !cb) {
- RSA_free(rsa);
- BN_free(e);
- BN_GENCB_free(cb);
- return NULL;
+ if (!rsa || !e) {
+ if (e) BN_free(e);
+ if (rsa) RSA_free(rsa);
+ return 0;
}
for (i = 0; i < (int)sizeof(exp) * 8; ++i) {
if (exp & (1UL << i)) {
if (BN_set_bit(e, i) == 0) {
BN_free(e);
RSA_free(rsa);
- BN_GENCB_free(cb);
- return NULL;
+ return 0;
}
}
}
+ memset(&cb_arg, 0, sizeof(struct ossl_generate_cb_arg));
if (rb_block_given_p())
cb_arg.yield = 1;
- BN_GENCB_set(cb, ossl_generate_cb_2, &cb_arg);
+ BN_GENCB_set(&cb, ossl_generate_cb_2, &cb_arg);
gen_arg.rsa = rsa;
gen_arg.e = e;
gen_arg.size = size;
- gen_arg.cb = cb;
+ gen_arg.cb = &cb;
if (cb_arg.yield == 1) {
/* we cannot release GVL when callback proc is supplied */
rsa_blocking_gen(&gen_arg);
@@ -151,20 +135,18 @@ rsa_generate(int size, unsigned long exp)
/* there's a chance to unblock */
rb_thread_call_without_gvl(rsa_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
}
-
- BN_GENCB_free(cb);
- BN_free(e);
if (!gen_arg.result) {
+ BN_free(e);
RSA_free(rsa);
- if (cb_arg.state) {
- /* must clear OpenSSL error stack */
- ossl_clear_error();
- rb_jump_tag(cb_arg.state);
- }
- return NULL;
+ if (cb_arg.state) rb_jump_tag(cb_arg.state);
+ return 0;
}
+ BN_free(e);
return rsa;
+#else
+ return RSA_generate_key(size, exp, rb_block_given_p() ? ossl_generate_cb : NULL, NULL);
+#endif
}
/*
@@ -172,8 +154,8 @@ rsa_generate(int size, unsigned long exp)
* RSA.generate(size) => RSA instance
* RSA.generate(size, exponent) => RSA instance
*
- * Generates an RSA keypair. _size_ is an integer representing the desired key
- * size. Keys smaller than 1024 should be considered insecure. _exponent_ is
+ * Generates an RSA keypair. +size+ is an integer representing the desired key
+ * size. Keys smaller than 1024 should be considered insecure. +exponent+ is
* an odd number normally 3, 17, or 65537.
*/
static VALUE
@@ -203,12 +185,12 @@ ossl_rsa_s_generate(int argc, VALUE *argv, VALUE klass)
* RSA.new(encoded_key) => RSA instance
* RSA.new(encoded_key, pass_phrase) => RSA instance
*
- * Generates or loads an RSA keypair. If an integer _key_size_ is given it
+ * Generates or loads an RSA keypair. If an integer +key_size+ is given it
* represents the desired key size. Keys less than 1024 bits should be
* considered insecure.
*
- * A key can instead be loaded from an _encoded_key_ which must be PEM or DER
- * encoded. A _pass_phrase_ can be used to decrypt the key. If none is given
+ * A key can instead be loaded from an +encoded_key+ which must be PEM or DER
+ * encoded. A +pass_phrase+ can be used to decrypt the key. If none is given
* OpenSSL will prompt for the pass phrase.
*
* = Examples
@@ -223,21 +205,22 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
EVP_PKEY *pkey;
RSA *rsa;
BIO *in;
+ char *passwd = NULL;
VALUE arg, pass;
GetPKey(self, pkey);
if(rb_scan_args(argc, argv, "02", &arg, &pass) == 0) {
rsa = RSA_new();
}
- else if (RB_INTEGER_TYPE_P(arg)) {
- rsa = rsa_generate(NUM2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2ULONG(pass));
+ else if (FIXNUM_P(arg)) {
+ rsa = rsa_generate(FIX2INT(arg), NIL_P(pass) ? RSA_F4 : NUM2ULONG(pass));
if (!rsa) ossl_raise(eRSAError, NULL);
}
else {
- pass = ossl_pem_passwd_value(pass);
+ if (!NIL_P(pass)) passwd = StringValuePtr(pass);
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
- rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ossl_pem_passwd_cb, (void *)pass);
+ in = ossl_obj2bio(arg);
+ rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd);
if (!rsa) {
OSSL_BIO_reset(in);
rsa = PEM_read_bio_RSA_PUBKEY(in, NULL, NULL, NULL);
@@ -271,43 +254,22 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-ossl_rsa_initialize_copy(VALUE self, VALUE other)
-{
- EVP_PKEY *pkey;
- RSA *rsa, *rsa_new;
-
- GetPKey(self, pkey);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
- ossl_raise(eRSAError, "RSA already initialized");
- GetRSA(other, rsa);
-
- rsa_new = ASN1_dup((i2d_of_void *)i2d_RSAPrivateKey, (d2i_of_void *)d2i_RSAPrivateKey, (char *)rsa);
- if (!rsa_new)
- ossl_raise(eRSAError, "ASN1_dup");
-
- EVP_PKEY_assign_RSA(pkey, rsa_new);
-
- return self;
-}
-
/*
* call-seq:
* rsa.public? => true
*
- * The return value is always +true+ since every private key is also a public
+ * The return value is always true since every private key is also a public
* key.
*/
static VALUE
ossl_rsa_is_public(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
- GetRSA(self, rsa);
+ GetPKeyRSA(self, pkey);
/*
* This method should check for n and e. BUG.
*/
- (void)rsa;
return Qtrue;
}
@@ -320,11 +282,11 @@ ossl_rsa_is_public(VALUE self)
static VALUE
ossl_rsa_is_private(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
- GetRSA(self, rsa);
+ GetPKeyRSA(self, pkey);
- return RSA_PRIVATE(self, rsa) ? Qtrue : Qfalse;
+ return (RSA_PRIVATE(self, pkey->pkey.rsa)) ? Qtrue : Qfalse;
}
/*
@@ -333,37 +295,43 @@ ossl_rsa_is_private(VALUE self)
* rsa.to_pem([cipher, pass_phrase]) => PEM-format String
* rsa.to_s([cipher, pass_phrase]) => PEM-format String
*
- * Outputs this keypair in PEM encoding. If _cipher_ and _pass_phrase_ are
- * given they will be used to encrypt the key. _cipher_ must be an
- * OpenSSL::Cipher instance.
+ * Outputs this keypair in PEM encoding. If +cipher+ and +pass_phrase+ are
+ * given they will be used to encrypt the key. +cipher+ must be an
+ * OpenSSL::Cipher::Cipher instance.
*/
static VALUE
ossl_rsa_export(int argc, VALUE *argv, VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
BIO *out;
const EVP_CIPHER *ciph = NULL;
+ char *passwd = NULL;
VALUE cipher, pass, str;
- GetRSA(self, rsa);
+ GetPKeyRSA(self, pkey);
rb_scan_args(argc, argv, "02", &cipher, &pass);
if (!NIL_P(cipher)) {
- ciph = ossl_evp_get_cipherbyname(cipher);
- pass = ossl_pem_passwd_value(pass);
+ ciph = GetCipherPtr(cipher);
+ 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");
+ passwd = RSTRING_PTR(pass);
+ }
}
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eRSAError, NULL);
}
- if (RSA_HAS_PRIVATE(rsa)) {
- if (!PEM_write_bio_RSAPrivateKey(out, rsa, ciph, NULL, 0,
- ossl_pem_passwd_cb, (void *)pass)) {
+ if (RSA_HAS_PRIVATE(pkey->pkey.rsa)) {
+ if (!PEM_write_bio_RSAPrivateKey(out, pkey->pkey.rsa, ciph,
+ NULL, 0, ossl_pem_passwd_cb, passwd)) {
BIO_free(out);
ossl_raise(eRSAError, NULL);
}
} else {
- if (!PEM_write_bio_RSA_PUBKEY(out, rsa)) {
+ if (!PEM_write_bio_RSA_PUBKEY(out, pkey->pkey.rsa)) {
BIO_free(out);
ossl_raise(eRSAError, NULL);
}
@@ -382,54 +350,53 @@ ossl_rsa_export(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_rsa_to_der(VALUE self)
{
- RSA *rsa;
- int (*i2d_func)(const RSA *, unsigned char **);
+ EVP_PKEY *pkey;
+ int (*i2d_func)_((const RSA*, unsigned char**));
unsigned char *p;
long len;
VALUE str;
- GetRSA(self, rsa);
- if (RSA_HAS_PRIVATE(rsa))
+ GetPKeyRSA(self, pkey);
+ if(RSA_HAS_PRIVATE(pkey->pkey.rsa))
i2d_func = i2d_RSAPrivateKey;
else
- i2d_func = (int (*)(const RSA *, unsigned char **))i2d_RSA_PUBKEY;
- if((len = i2d_func(rsa, NULL)) <= 0)
+ i2d_func = (int (*)(const RSA*, unsigned char**))i2d_RSA_PUBKEY;
+ if((len = i2d_func(pkey->pkey.rsa, NULL)) <= 0)
ossl_raise(eRSAError, NULL);
str = rb_str_new(0, len);
p = (unsigned char *)RSTRING_PTR(str);
- if(i2d_func(rsa, &p) < 0)
+ if(i2d_func(pkey->pkey.rsa, &p) < 0)
ossl_raise(eRSAError, NULL);
ossl_str_adjust(str, p);
return str;
}
+#define ossl_rsa_buf_size(pkey) (RSA_size((pkey)->pkey.rsa)+16)
+
/*
* call-seq:
* rsa.public_encrypt(string) => String
* rsa.public_encrypt(string, padding) => String
*
- * Encrypt _string_ with the public key. _padding_ defaults to PKCS1_PADDING.
+ * Encrypt +string+ with the public key. +padding+ defaults to PKCS1_PADDING.
* The encrypted string output can be decrypted using #private_decrypt.
*/
static VALUE
ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
{
- RSA *rsa;
- const BIGNUM *rsa_n;
+ EVP_PKEY *pkey;
int buf_len, pad;
VALUE str, buffer, padding;
- GetRSA(self, rsa);
- RSA_get0_key(rsa, &rsa_n, NULL, NULL);
- if (!rsa_n)
- ossl_raise(eRSAError, "incomplete RSA");
+ GetPKeyRSA(self, pkey);
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
- str = rb_str_new(0, RSA_size(rsa));
+ str = rb_str_new(0, ossl_rsa_buf_size(pkey));
buf_len = RSA_public_encrypt(RSTRING_LENINT(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), rsa, pad);
+ (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -441,27 +408,24 @@ ossl_rsa_public_encrypt(int argc, VALUE *argv, VALUE self)
* rsa.public_decrypt(string) => String
* rsa.public_decrypt(string, padding) => String
*
- * Decrypt _string_, which has been encrypted with the private key, with the
- * public key. _padding_ defaults to PKCS1_PADDING.
+ * Decrypt +string+, which has been encrypted with the private key, with the
+ * public key. +padding+ defaults to PKCS1_PADDING.
*/
static VALUE
ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
{
- RSA *rsa;
- const BIGNUM *rsa_n;
+ EVP_PKEY *pkey;
int buf_len, pad;
VALUE str, buffer, padding;
- GetRSA(self, rsa);
- RSA_get0_key(rsa, &rsa_n, NULL, NULL);
- if (!rsa_n)
- ossl_raise(eRSAError, "incomplete RSA");
+ GetPKeyRSA(self, pkey);
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
- str = rb_str_new(0, RSA_size(rsa));
+ str = rb_str_new(0, ossl_rsa_buf_size(pkey));
buf_len = RSA_public_decrypt(RSTRING_LENINT(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), rsa, pad);
+ (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -473,29 +437,27 @@ ossl_rsa_public_decrypt(int argc, VALUE *argv, VALUE self)
* rsa.private_encrypt(string) => String
* rsa.private_encrypt(string, padding) => String
*
- * Encrypt _string_ with the private key. _padding_ defaults to PKCS1_PADDING.
+ * Encrypt +string+ with the private key. +padding+ defaults to PKCS1_PADDING.
* The encrypted string output can be decrypted using #public_decrypt.
*/
static VALUE
ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
{
- RSA *rsa;
- const BIGNUM *rsa_n;
+ EVP_PKEY *pkey;
int buf_len, pad;
VALUE str, buffer, padding;
- GetRSA(self, rsa);
- RSA_get0_key(rsa, &rsa_n, NULL, NULL);
- if (!rsa_n)
- ossl_raise(eRSAError, "incomplete RSA");
- if (!RSA_PRIVATE(self, rsa))
+ GetPKeyRSA(self, pkey);
+ 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);
- str = rb_str_new(0, RSA_size(rsa));
+ str = rb_str_new(0, ossl_rsa_buf_size(pkey));
buf_len = RSA_private_encrypt(RSTRING_LENINT(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), rsa, pad);
+ (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -507,29 +469,27 @@ ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self)
* rsa.private_decrypt(string) => String
* rsa.private_decrypt(string, padding) => String
*
- * Decrypt _string_, which has been encrypted with the public key, with the
- * private key. _padding_ defaults to PKCS1_PADDING.
+ * Decrypt +string+, which has been encrypted with the public key, with the
+ * private key. +padding+ defaults to PKCS1_PADDING.
*/
static VALUE
ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)
{
- RSA *rsa;
- const BIGNUM *rsa_n;
+ EVP_PKEY *pkey;
int buf_len, pad;
VALUE str, buffer, padding;
- GetRSA(self, rsa);
- RSA_get0_key(rsa, &rsa_n, NULL, NULL);
- if (!rsa_n)
- ossl_raise(eRSAError, "incomplete RSA");
- if (!RSA_PRIVATE(self, rsa))
+ GetPKeyRSA(self, pkey);
+ 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);
- str = rb_str_new(0, RSA_size(rsa));
+ str = rb_str_new(0, ossl_rsa_buf_size(pkey));
buf_len = RSA_private_decrypt(RSTRING_LENINT(buffer), (unsigned char *)RSTRING_PTR(buffer),
- (unsigned char *)RSTRING_PTR(str), rsa, pad);
+ (unsigned char *)RSTRING_PTR(str), pkey->pkey.rsa,
+ pad);
if (buf_len < 0) ossl_raise(eRSAError, NULL);
rb_str_set_len(str, buf_len);
@@ -538,196 +498,6 @@ ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * rsa.sign_pss(digest, data, salt_length:, mgf1_hash:) -> String
- *
- * Signs _data_ using the Probabilistic Signature Scheme (RSA-PSS) and returns
- * the calculated signature.
- *
- * RSAError will be raised if an error occurs.
- *
- * See #verify_pss for the verification operation.
- *
- * === Parameters
- * _digest_::
- * A String containing the message digest algorithm name.
- * _data_::
- * A String. The data to be signed.
- * _salt_length_::
- * The length in octets of the salt. Two special values are reserved:
- * +:digest+ means the digest length, and +:max+ means the maximum possible
- * length for the combination of the private key and the selected message
- * digest algorithm.
- * _mgf1_hash_::
- * The hash algorithm used in MGF1 (the currently supported mask generation
- * function (MGF)).
- *
- * === Example
- * data = "Sign me!"
- * pkey = OpenSSL::PKey::RSA.new(2048)
- * signature = pkey.sign_pss("SHA256", data, salt_length: :max, mgf1_hash: "SHA256")
- * pub_key = pkey.public_key
- * puts pub_key.verify_pss("SHA256", signature, data,
- * salt_length: :auto, mgf1_hash: "SHA256") # => true
- */
-static VALUE
-ossl_rsa_sign_pss(int argc, VALUE *argv, VALUE self)
-{
- VALUE digest, data, options, kwargs[2], signature;
- static ID kwargs_ids[2];
- EVP_PKEY *pkey;
- EVP_PKEY_CTX *pkey_ctx;
- const EVP_MD *md, *mgf1md;
- EVP_MD_CTX *md_ctx;
- size_t buf_len;
- int salt_len;
-
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("salt_length");
- kwargs_ids[1] = rb_intern_const("mgf1_hash");
- }
- rb_scan_args(argc, argv, "2:", &digest, &data, &options);
- rb_get_kwargs(options, kwargs_ids, 2, 0, kwargs);
- if (kwargs[0] == ID2SYM(rb_intern("max")))
- salt_len = -2; /* RSA_PSS_SALTLEN_MAX_SIGN */
- else if (kwargs[0] == ID2SYM(rb_intern("digest")))
- salt_len = -1; /* RSA_PSS_SALTLEN_DIGEST */
- else
- salt_len = NUM2INT(kwargs[0]);
- mgf1md = ossl_evp_get_digestbyname(kwargs[1]);
-
- pkey = GetPrivPKeyPtr(self);
- buf_len = EVP_PKEY_size(pkey);
- md = ossl_evp_get_digestbyname(digest);
- StringValue(data);
- signature = rb_str_new(NULL, (long)buf_len);
-
- md_ctx = EVP_MD_CTX_new();
- if (!md_ctx)
- goto err;
-
- if (EVP_DigestSignInit(md_ctx, &pkey_ctx, md, NULL, pkey) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, salt_len) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, mgf1md) != 1)
- goto err;
-
- if (EVP_DigestSignUpdate(md_ctx, RSTRING_PTR(data), RSTRING_LEN(data)) != 1)
- goto err;
-
- if (EVP_DigestSignFinal(md_ctx, (unsigned char *)RSTRING_PTR(signature), &buf_len) != 1)
- goto err;
-
- rb_str_set_len(signature, (long)buf_len);
-
- EVP_MD_CTX_free(md_ctx);
- return signature;
-
- err:
- EVP_MD_CTX_free(md_ctx);
- ossl_raise(eRSAError, NULL);
-}
-
-/*
- * call-seq:
- * rsa.verify_pss(digest, signature, data, salt_length:, mgf1_hash:) -> true | false
- *
- * Verifies _data_ using the Probabilistic Signature Scheme (RSA-PSS).
- *
- * The return value is +true+ if the signature is valid, +false+ otherwise.
- * RSAError will be raised if an error occurs.
- *
- * See #sign_pss for the signing operation and an example code.
- *
- * === Parameters
- * _digest_::
- * A String containing the message digest algorithm name.
- * _data_::
- * A String. The data to be signed.
- * _salt_length_::
- * The length in octets of the salt. Two special values are reserved:
- * +:digest+ means the digest length, and +:auto+ means automatically
- * determining the length based on the signature.
- * _mgf1_hash_::
- * The hash algorithm used in MGF1.
- */
-static VALUE
-ossl_rsa_verify_pss(int argc, VALUE *argv, VALUE self)
-{
- VALUE digest, signature, data, options, kwargs[2];
- static ID kwargs_ids[2];
- EVP_PKEY *pkey;
- EVP_PKEY_CTX *pkey_ctx;
- const EVP_MD *md, *mgf1md;
- EVP_MD_CTX *md_ctx;
- int result, salt_len;
-
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("salt_length");
- kwargs_ids[1] = rb_intern_const("mgf1_hash");
- }
- rb_scan_args(argc, argv, "3:", &digest, &signature, &data, &options);
- rb_get_kwargs(options, kwargs_ids, 2, 0, kwargs);
- if (kwargs[0] == ID2SYM(rb_intern("auto")))
- salt_len = -2; /* RSA_PSS_SALTLEN_AUTO */
- else if (kwargs[0] == ID2SYM(rb_intern("digest")))
- salt_len = -1; /* RSA_PSS_SALTLEN_DIGEST */
- else
- salt_len = NUM2INT(kwargs[0]);
- mgf1md = ossl_evp_get_digestbyname(kwargs[1]);
-
- GetPKey(self, pkey);
- md = ossl_evp_get_digestbyname(digest);
- StringValue(signature);
- StringValue(data);
-
- md_ctx = EVP_MD_CTX_new();
- if (!md_ctx)
- goto err;
-
- if (EVP_DigestVerifyInit(md_ctx, &pkey_ctx, md, NULL, pkey) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, RSA_PKCS1_PSS_PADDING) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkey_ctx, salt_len) != 1)
- goto err;
-
- if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, mgf1md) != 1)
- goto err;
-
- if (EVP_DigestVerifyUpdate(md_ctx, RSTRING_PTR(data), RSTRING_LEN(data)) != 1)
- goto err;
-
- result = EVP_DigestVerifyFinal(md_ctx,
- (unsigned char *)RSTRING_PTR(signature),
- RSTRING_LEN(signature));
-
- switch (result) {
- case 0:
- ossl_clear_error();
- EVP_MD_CTX_free(md_ctx);
- return Qfalse;
- case 1:
- EVP_MD_CTX_free(md_ctx);
- return Qtrue;
- default:
- goto err;
- }
-
- err:
- EVP_MD_CTX_free(md_ctx);
- ossl_raise(eRSAError, NULL);
-}
-
-/*
- * call-seq:
* rsa.params => hash
*
* THIS METHOD IS INSECURE, PRIVATE INFORMATION CAN LEAK OUT!!!
@@ -740,24 +510,21 @@ ossl_rsa_verify_pss(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_rsa_get_params(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
VALUE hash;
- const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;
- GetRSA(self, rsa);
- RSA_get0_key(rsa, &n, &e, &d);
- RSA_get0_factors(rsa, &p, &q);
- RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp);
+ GetPKeyRSA(self, pkey);
hash = rb_hash_new();
- rb_hash_aset(hash, rb_str_new2("n"), ossl_bn_new(n));
- rb_hash_aset(hash, rb_str_new2("e"), ossl_bn_new(e));
- rb_hash_aset(hash, rb_str_new2("d"), ossl_bn_new(d));
- rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(p));
- rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(q));
- rb_hash_aset(hash, rb_str_new2("dmp1"), ossl_bn_new(dmp1));
- rb_hash_aset(hash, rb_str_new2("dmq1"), ossl_bn_new(dmq1));
- rb_hash_aset(hash, rb_str_new2("iqmp"), ossl_bn_new(iqmp));
+
+ rb_hash_aset(hash, rb_str_new2("n"), ossl_bn_new(pkey->pkey.rsa->n));
+ rb_hash_aset(hash, rb_str_new2("e"), ossl_bn_new(pkey->pkey.rsa->e));
+ rb_hash_aset(hash, rb_str_new2("d"), ossl_bn_new(pkey->pkey.rsa->d));
+ rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(pkey->pkey.rsa->p));
+ rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(pkey->pkey.rsa->q));
+ rb_hash_aset(hash, rb_str_new2("dmp1"), ossl_bn_new(pkey->pkey.rsa->dmp1));
+ rb_hash_aset(hash, rb_str_new2("dmq1"), ossl_bn_new(pkey->pkey.rsa->dmq1));
+ rb_hash_aset(hash, rb_str_new2("iqmp"), ossl_bn_new(pkey->pkey.rsa->iqmp));
return hash;
}
@@ -775,15 +542,15 @@ ossl_rsa_get_params(VALUE self)
static VALUE
ossl_rsa_to_text(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
BIO *out;
VALUE str;
- GetRSA(self, rsa);
+ GetPKeyRSA(self, pkey);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eRSAError, NULL);
}
- if (!RSA_print(out, rsa, 0)) { /* offset = 0 */
+ if (!RSA_print(out, pkey->pkey.rsa, 0)) { /* offset = 0 */
BIO_free(out);
ossl_raise(eRSAError, NULL);
}
@@ -807,8 +574,8 @@ ossl_rsa_to_public_key(VALUE self)
GetPKeyRSA(self, pkey);
/* err check performed by rsa_instance */
- rsa = RSAPublicKey_dup(EVP_PKEY_get0_RSA(pkey));
- obj = rsa_instance(rb_obj_class(self), rsa);
+ rsa = RSAPublicKey_dup(pkey->pkey.rsa);
+ obj = rsa_instance(CLASS_OF(self), rsa);
if (obj == Qfalse) {
RSA_free(rsa);
ossl_raise(eRSAError, NULL);
@@ -822,11 +589,11 @@ ossl_rsa_to_public_key(VALUE self)
static VALUE
ossl_rsa_blinding_on(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
- GetRSA(self, rsa);
+ GetPKeyRSA(self, pkey);
- if (RSA_blinding_on(rsa, ossl_bn_ctx) != 1) {
+ if (RSA_blinding_on(pkey->pkey.rsa, ossl_bn_ctx) != 1) {
ossl_raise(eRSAError, NULL);
}
return self;
@@ -835,54 +602,35 @@ ossl_rsa_blinding_on(VALUE self)
static VALUE
ossl_rsa_blinding_off(VALUE self)
{
- RSA *rsa;
+ EVP_PKEY *pkey;
- GetRSA(self, rsa);
- RSA_blinding_off(rsa);
+ GetPKeyRSA(self, pkey);
+ RSA_blinding_off(pkey->pkey.rsa);
return self;
}
*/
-/*
- * Document-method: OpenSSL::PKey::RSA#set_key
- * call-seq:
- * rsa.set_key(n, e, d) -> self
- *
- * Sets _n_, _e_, _d_ for the RSA instance.
- */
-OSSL_PKEY_BN_DEF3(rsa, RSA, key, n, e, d)
-/*
- * Document-method: OpenSSL::PKey::RSA#set_factors
- * call-seq:
- * rsa.set_factors(p, q) -> self
- *
- * Sets _p_, _q_ for the RSA instance.
- */
-OSSL_PKEY_BN_DEF2(rsa, RSA, factors, p, q)
-/*
- * Document-method: OpenSSL::PKey::RSA#set_crt_params
- * call-seq:
- * rsa.set_crt_params(dmp1, dmq1, iqmp) -> self
- *
- * Sets _dmp1_, _dmq1_, _iqmp_ for the RSA instance. They are calculated by
- * <tt>d mod (p - 1)</tt>, <tt>d mod (q - 1)</tt> and <tt>q^(-1) mod p</tt>
- * respectively.
- */
-OSSL_PKEY_BN_DEF3(rsa, RSA, crt_params, dmp1, dmq1, iqmp)
+OSSL_PKEY_BN(rsa, n)
+OSSL_PKEY_BN(rsa, e)
+OSSL_PKEY_BN(rsa, d)
+OSSL_PKEY_BN(rsa, p)
+OSSL_PKEY_BN(rsa, q)
+OSSL_PKEY_BN(rsa, dmp1)
+OSSL_PKEY_BN(rsa, dmq1)
+OSSL_PKEY_BN(rsa, iqmp)
/*
* INIT
*/
-#define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
+#define DefRSAConst(x) rb_define_const(cRSA, #x,INT2FIX(RSA_##x))
void
-Init_ossl_rsa(void)
+Init_ossl_rsa()
{
#if 0
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL and mPKey */
mPKey = rb_define_module_under(mOSSL, "PKey");
- cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
- ePKeyError = rb_define_class_under(mPKey, "PKeyError", eOSSLError);
#endif
/* Document-class: OpenSSL::PKey::RSAError
@@ -896,7 +644,7 @@ Init_ossl_rsa(void)
/* Document-class: OpenSSL::PKey::RSA
*
* RSA is an asymmetric public key algorithm that has been formalized in
- * RFC 3447. It is in widespread use in public key infrastructures (PKI)
+ * RFC 3447. It is in widespread use in public key infrastuctures (PKI)
* where certificates (cf. OpenSSL::X509::Certificate) often are issued
* on the basis of a public/private RSA key pair. RSA is used in a wide
* field of applications such as secure (symmetric) key exchange, e.g.
@@ -907,7 +655,6 @@ Init_ossl_rsa(void)
rb_define_singleton_method(cRSA, "generate", ossl_rsa_s_generate, -1);
rb_define_method(cRSA, "initialize", ossl_rsa_initialize, -1);
- rb_define_method(cRSA, "initialize_copy", ossl_rsa_initialize_copy, 1);
rb_define_method(cRSA, "public?", ossl_rsa_is_public, 0);
rb_define_method(cRSA, "private?", ossl_rsa_is_private, 0);
@@ -921,8 +668,6 @@ Init_ossl_rsa(void)
rb_define_method(cRSA, "public_decrypt", ossl_rsa_public_decrypt, -1);
rb_define_method(cRSA, "private_encrypt", ossl_rsa_private_encrypt, -1);
rb_define_method(cRSA, "private_decrypt", ossl_rsa_private_decrypt, -1);
- rb_define_method(cRSA, "sign_pss", ossl_rsa_sign_pss, -1);
- rb_define_method(cRSA, "verify_pss", ossl_rsa_verify_pss, -1);
DEF_OSSL_PKEY_BN(cRSA, rsa, n);
DEF_OSSL_PKEY_BN(cRSA, rsa, e);
@@ -932,9 +677,6 @@ Init_ossl_rsa(void)
DEF_OSSL_PKEY_BN(cRSA, rsa, dmp1);
DEF_OSSL_PKEY_BN(cRSA, rsa, dmq1);
DEF_OSSL_PKEY_BN(cRSA, rsa, iqmp);
- rb_define_method(cRSA, "set_key", ossl_rsa_set_key, 3);
- rb_define_method(cRSA, "set_factors", ossl_rsa_set_factors, 2);
- rb_define_method(cRSA, "set_crt_params", ossl_rsa_set_crt_params, 3);
rb_define_method(cRSA, "params", ossl_rsa_get_params, 0);
@@ -952,7 +694,8 @@ Init_ossl_rsa(void)
#else /* defined NO_RSA */
void
-Init_ossl_rsa(void)
+Init_ossl_rsa()
{
}
#endif /* NO_RSA */
+
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index c95857060a..270a4b7437 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.c
@@ -1,22 +1,37 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
- *
* All rights reserved.
- *
- * This program is licensed under the same licence as Ruby.
+ */
+/*
+ * This program is licenced 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)
@@ -31,23 +46,6 @@ 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, 0.0)
- * OpenSSL::Random.seed(ary.join)
*/
static VALUE
ossl_rand_add(VALUE self, VALUE str, VALUE entropy)
@@ -62,14 +60,13 @@ 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)
{
- rb_check_safe_obj(filename);
+ SafeStringValue(filename);
- if(!RAND_load_file(StringValueCStr(filename), -1)) {
+ if(!RAND_load_file(RSTRING_PTR(filename), -1)) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -79,16 +76,12 @@ 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)
{
- rb_check_safe_obj(filename);
-
- if (RAND_write_file(StringValueCStr(filename)) == -1) {
+ SafeStringValue(filename);
+ if (RAND_write_file(RSTRING_PTR(filename)) == -1) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -96,48 +89,27 @@ ossl_rand_write_file(VALUE self, VALUE filename)
/*
* call-seq:
- * random_bytes(length) -> string
+ * random_bytes(length) -> aString
*
- * Generates a 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);
- ret = RAND_bytes((unsigned char *)RSTRING_PTR(str), n);
- if (ret == 0) {
- ossl_raise(eRandomError, "RAND_bytes");
- } else if (ret == -1) {
- ossl_raise(eRandomError, "RAND_bytes is not supported");
+ if (!RAND_bytes((unsigned char *)RSTRING_PTR(str), n)) {
+ ossl_raise(eRandomError, NULL);
}
return str;
}
-#if defined(HAVE_RAND_PSEUDO_BYTES)
/*
* call-seq:
- * pseudo_bytes(length) -> string
- *
- * Generates a String with _length_ number of pseudo-random bytes.
+ * pseudo_bytes(length) -> aString
*
- * 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)
@@ -146,27 +118,24 @@ ossl_rand_pseudo_bytes(VALUE self, VALUE len)
int n = NUM2INT(len);
str = rb_str_new(0, n);
- if (RAND_pseudo_bytes((unsigned char *)RSTRING_PTR(str), n) < 1) {
+ if (!RAND_pseudo_bytes((unsigned char *)RSTRING_PTR(str), n)) {
ossl_raise(eRandomError, NULL);
}
return str;
}
-#endif
-#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)
{
- rb_check_safe_obj(filename);
+ SafeStringValue(filename);
- if (RAND_egd(StringValueCStr(filename)) == -1) {
+ if(!RAND_egd(RSTRING_PTR(filename))) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -176,30 +145,25 @@ 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)
{
int n = NUM2INT(len);
- rb_check_safe_obj(filename);
+ SafeStringValue(filename);
- if (RAND_egd_bytes(StringValueCStr(filename), n) == -1) {
+ if (!RAND_egd_bytes(RSTRING_PTR(filename), n)) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
}
-#endif /* HAVE_RAND_EGD */
/*
* call-seq:
* status? => true | false
*
- * Return +true+ if the PRNG has been seeded with enough data, +false+ otherwise.
+ * Return true if the PRNG has been seeded with enough data, false otherwise.
*/
static VALUE
ossl_rand_status(VALUE self)
@@ -207,32 +171,32 @@ 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(void)
+Init_ossl_rand()
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
mRandom = rb_define_module_under(mOSSL, "Random");
eRandomError = rb_define_class_under(mRandom, "RandomError", eOSSLError);
- 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);
-#if defined(HAVE_RAND_PSEUDO_BYTES)
- rb_define_module_function(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
-#endif
-#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);
+ 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)
}
+
diff --git a/ext/openssl/ossl_rand.h b/ext/openssl/ossl_rand.h
index 8f77a3b239..ce2ae0d129 100644
--- a/ext/openssl/ossl_rand.h
+++ b/ext/openssl/ossl_rand.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_RAND_H_)
@@ -16,3 +17,4 @@ 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 a85be17f07..d37e51c857 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1,4 +1,5 @@
/*
+ * $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>
@@ -6,11 +7,15 @@
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h> /* for read(), and write() */
+#endif
+
#define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
#ifdef _WIN32
@@ -19,382 +24,349 @@
# 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;
-static VALUE mSSLExtConfig;
-static VALUE eSSLError;
+VALUE eSSLError;
VALUE cSSLContext;
VALUE cSSLSocket;
static VALUE eSSLErrorWaitReadable;
static VALUE eSSLErrorWaitWritable;
-static ID id_call, ID_callback_state, id_tmp_dh_callback, id_tmp_ecdh_callback,
- id_npn_protocols_encoded;
-static VALUE sym_exception, sym_wait_readable, sym_wait_writable;
-
-static ID id_i_cert_store, id_i_ca_file, id_i_ca_path, id_i_verify_mode,
- id_i_verify_depth, id_i_verify_callback, id_i_client_ca,
- id_i_renegotiation_cb, id_i_cert, id_i_key, id_i_extra_chain_cert,
- id_i_client_cert_cb, id_i_tmp_ecdh_callback, id_i_timeout,
- id_i_session_id_context, id_i_session_get_cb, id_i_session_new_cb,
- id_i_session_remove_cb, id_i_npn_select_cb, id_i_npn_protocols,
- id_i_alpn_select_cb, id_i_alpn_protocols, id_i_servername_cb,
- id_i_verify_hostname;
-static ID id_i_io, id_i_context, id_i_hostname;
-
-static int ossl_ssl_ex_vcb_idx;
-static int ossl_ssl_ex_ptr_idx;
-static int ossl_sslctx_ex_ptr_idx;
-#if !defined(HAVE_X509_STORE_UP_REF)
-static int ossl_sslctx_ex_store_p;
+#define ossl_sslctx_set_cert(o,v) rb_iv_set((o),"@cert",(v))
+#define ossl_sslctx_set_key(o,v) rb_iv_set((o),"@key",(v))
+#define ossl_sslctx_set_client_ca(o,v) rb_iv_set((o),"@client_ca",(v))
+#define ossl_sslctx_set_ca_file(o,v) rb_iv_set((o),"@ca_file",(v))
+#define ossl_sslctx_set_ca_path(o,v) rb_iv_set((o),"@ca_path",(v))
+#define ossl_sslctx_set_timeout(o,v) rb_iv_set((o),"@timeout",(v))
+#define ossl_sslctx_set_verify_mode(o,v) rb_iv_set((o),"@verify_mode",(v))
+#define ossl_sslctx_set_verify_dep(o,v) rb_iv_set((o),"@verify_depth",(v))
+#define ossl_sslctx_set_verify_cb(o,v) rb_iv_set((o),"@verify_callback",(v))
+#define ossl_sslctx_set_options(o,v) rb_iv_set((o),"@options",(v))
+#define ossl_sslctx_set_cert_store(o,v) rb_iv_set((o),"@cert_store",(v))
+#define ossl_sslctx_set_extra_cert(o,v) rb_iv_set((o),"@extra_chain_cert",(v))
+#define ossl_sslctx_set_client_cert_cb(o,v) rb_iv_set((o),"@client_cert_cb",(v))
+#define ossl_sslctx_set_tmp_dh_cb(o,v) rb_iv_set((o),"@tmp_dh_callback",(v))
+#define ossl_sslctx_set_sess_id_ctx(o, v) rb_iv_set((o),"@session_id_context",(v))
+
+#define ossl_sslctx_get_cert(o) rb_iv_get((o),"@cert")
+#define ossl_sslctx_get_key(o) rb_iv_get((o),"@key")
+#define ossl_sslctx_get_client_ca(o) rb_iv_get((o),"@client_ca")
+#define ossl_sslctx_get_ca_file(o) rb_iv_get((o),"@ca_file")
+#define ossl_sslctx_get_ca_path(o) rb_iv_get((o),"@ca_path")
+#define ossl_sslctx_get_timeout(o) rb_iv_get((o),"@timeout")
+#define ossl_sslctx_get_verify_mode(o) rb_iv_get((o),"@verify_mode")
+#define ossl_sslctx_get_verify_dep(o) rb_iv_get((o),"@verify_depth")
+#define ossl_sslctx_get_verify_cb(o) rb_iv_get((o),"@verify_callback")
+#define ossl_sslctx_get_options(o) rb_iv_get((o),"@options")
+#define ossl_sslctx_get_cert_store(o) rb_iv_get((o),"@cert_store")
+#define ossl_sslctx_get_extra_cert(o) rb_iv_get((o),"@extra_chain_cert")
+#define ossl_sslctx_get_client_cert_cb(o) rb_iv_get((o),"@client_cert_cb")
+#define ossl_sslctx_get_tmp_dh_cb(o) rb_iv_get((o),"@tmp_dh_callback")
+#define ossl_sslctx_get_sess_id_ctx(o) rb_iv_get((o),"@session_id_context")
+
+static const char *ossl_sslctx_attrs[] = {
+ "cert", "key", "client_ca", "ca_file", "ca_path",
+ "timeout", "verify_mode", "verify_depth", "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))
+
+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 VALUE sym_exception;
+
+/*
+ * SSLContext class
+ */
+static const struct {
+ const char *name;
+ SSL_METHOD *(*func)(void);
+} ossl_ssl_method_tab[] = {
+#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
+ OSSL_SSL_METHOD_ENTRY(TLSv1),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_server),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_client),
+#if defined(HAVE_TLSV1_2_METHOD) && defined(HAVE_TLSV1_2_SERVER_METHOD) && \
+ defined(HAVE_TLSV1_2_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2_server),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_2_client),
#endif
+#if defined(HAVE_TLSV1_1_METHOD) && defined(HAVE_TLSV1_1_SERVER_METHOD) && \
+ defined(HAVE_TLSV1_1_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1_server),
+ OSSL_SSL_METHOD_ENTRY(TLSv1_1_client),
+#endif
+#if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \
+ defined(HAVE_SSLV2_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(SSLv2),
+ OSSL_SSL_METHOD_ENTRY(SSLv2_server),
+ OSSL_SSL_METHOD_ENTRY(SSLv2_client),
+#endif
+ OSSL_SSL_METHOD_ENTRY(SSLv3),
+ OSSL_SSL_METHOD_ENTRY(SSLv3_server),
+ OSSL_SSL_METHOD_ENTRY(SSLv3_client),
+ 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 void
-ossl_sslctx_free(void *ptr)
+ossl_sslctx_free(SSL_CTX *ctx)
{
- SSL_CTX *ctx = ptr;
-#if !defined(HAVE_X509_STORE_UP_REF)
- if (ctx && SSL_CTX_get_ex_data(ctx, ossl_sslctx_ex_store_p))
+ if(ctx && SSL_CTX_get_ex_data(ctx, ossl_ssl_ex_store_p)== (void*)1)
ctx->cert_store = NULL;
-#endif
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 = 0 |
- SSL_MODE_ENABLE_PARTIAL_WRITE |
- SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER |
- SSL_MODE_RELEASE_BUFFERS;
- VALUE obj;
+ long mode = SSL_MODE_ENABLE_PARTIAL_WRITE;
- obj = TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 0);
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
- ctx = SSL_CTX_new(TLS_method());
-#else
- ctx = SSL_CTX_new(SSLv23_method());
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ mode |= SSL_MODE_RELEASE_BUFFERS;
#endif
+
+ ctx = SSL_CTX_new(SSLv23_method());
if (!ctx) {
ossl_raise(eSSLError, "SSL_CTX_new");
}
SSL_CTX_set_mode(ctx, mode);
- RTYPEDDATA_DATA(obj) = ctx;
- SSL_CTX_set_ex_data(ctx, ossl_sslctx_ex_ptr_idx, (void *)obj);
-
-#if !defined(OPENSSL_NO_EC) && defined(HAVE_SSL_CTX_SET_ECDH_AUTO)
- /* We use SSL_CTX_set1_curves_list() to specify the curve used in ECDH. It
- * allows to specify multiple curve names and OpenSSL will select
- * automatically from them. In OpenSSL 1.0.2, the automatic selection has to
- * be enabled explicitly. But OpenSSL 1.1.0 removed the knob and it is
- * always enabled. To uniform the behavior, we enable the automatic
- * selection also in 1.0.2. Users can still disable ECDH by removing ECDH
- * cipher suites by SSLContext#ciphers=. */
- if (!SSL_CTX_set_ecdh_auto(ctx, 1))
- ossl_raise(eSSLError, "SSL_CTX_set_ecdh_auto");
-#endif
-
- return obj;
+ return Data_Wrap_Struct(klass, 0, ossl_sslctx_free, ctx);
}
-static int
-parse_proto_version(VALUE str)
+/*
+ * call-seq:
+ * ctx.ssl_version = :TLSv1
+ * ctx.ssl_version = "SSLv23_client"
+ *
+ * You can get a list of valid versions with OpenSSL::SSL::SSLContext::METHODS
+ */
+static VALUE
+ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method)
{
+ SSL_METHOD *method = NULL;
+ const char *s;
int i;
- static const struct {
- const char *name;
- int version;
- } map[] = {
- { "SSL2", SSL2_VERSION },
- { "SSL3", SSL3_VERSION },
- { "TLS1", TLS1_VERSION },
- { "TLS1_1", TLS1_1_VERSION },
- { "TLS1_2", TLS1_2_VERSION },
-#ifdef TLS1_3_VERSION
- { "TLS1_3", TLS1_3_VERSION },
-#endif
- };
- if (NIL_P(str))
- return 0;
- if (RB_INTEGER_TYPE_P(str))
- return NUM2INT(str);
+ SSL_CTX *ctx;
+ if (RB_TYPE_P(ssl_method, T_SYMBOL))
+ s = rb_id2name(SYM2ID(ssl_method));
+ else
+ s = StringValuePtr(ssl_method);
+ 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();
+ break;
+ }
+ }
+ if (!method) {
+ ossl_raise(rb_eArgError, "unknown SSL method `%s'.", s);
+ }
+ Data_Get_Struct(self, SSL_CTX, ctx);
+ if (SSL_CTX_set_ssl_version(ctx, method) != 1) {
+ ossl_raise(eSSLError, "SSL_CTX_set_ssl_version");
+ }
- if (SYMBOL_P(str))
- str = rb_sym2str(str);
- StringValue(str);
- for (i = 0; i < numberof(map); i++)
- if (!strncmp(map[i].name, RSTRING_PTR(str), RSTRING_LEN(str)))
- return map[i].version;
- rb_raise(rb_eArgError, "unrecognized version %+"PRIsVALUE, str);
+ return ssl_method;
}
/*
* call-seq:
- * ctx.set_minmax_proto_version(min, max) -> nil
+ * SSLContext.new => ctx
+ * SSLContext.new(:TLSv1) => ctx
+ * SSLContext.new("SSLv23_client") => ctx
*
- * Sets the minimum and maximum supported protocol versions. See #min_version=
- * and #max_version=.
+ * You can get a list of valid methods with OpenSSL::SSL::SSLContext::METHODS
*/
static VALUE
-ossl_sslctx_set_minmax_proto_version(VALUE self, VALUE min_v, VALUE max_v)
+ossl_sslctx_initialize(int argc, VALUE *argv, VALUE self)
{
- SSL_CTX *ctx;
- int min, max;
-
- GetSSLCTX(self, ctx);
- min = parse_proto_version(min_v);
- max = parse_proto_version(max_v);
-
-#ifdef HAVE_SSL_CTX_SET_MIN_PROTO_VERSION
- if (!SSL_CTX_set_min_proto_version(ctx, min))
- ossl_raise(eSSLError, "SSL_CTX_set_min_proto_version");
- if (!SSL_CTX_set_max_proto_version(ctx, max))
- ossl_raise(eSSLError, "SSL_CTX_set_max_proto_version");
-#else
- {
- unsigned long sum = 0, opts = 0;
- int i;
- static const struct {
- int ver;
- unsigned long opts;
- } options_map[] = {
- { SSL2_VERSION, SSL_OP_NO_SSLv2 },
- { SSL3_VERSION, SSL_OP_NO_SSLv3 },
- { TLS1_VERSION, SSL_OP_NO_TLSv1 },
- { TLS1_1_VERSION, SSL_OP_NO_TLSv1_1 },
- { TLS1_2_VERSION, SSL_OP_NO_TLSv1_2 },
-# if defined(TLS1_3_VERSION)
- { TLS1_3_VERSION, SSL_OP_NO_TLSv1_3 },
-# endif
- };
+ VALUE ssl_method;
+ int i;
- for (i = 0; i < numberof(options_map); i++) {
- sum |= options_map[i].opts;
- if (min && min > options_map[i].ver || max && max < options_map[i].ver)
- opts |= options_map[i].opts;
- }
- SSL_CTX_clear_options(ctx, sum);
- SSL_CTX_set_options(ctx, opts);
+ 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);
}
-#endif
+ if (rb_scan_args(argc, argv, "01", &ssl_method) == 0){
+ return self;
+ }
+ ossl_sslctx_set_ssl_version(self, ssl_method);
- return Qnil;
+ return self;
}
static VALUE
ossl_call_client_cert_cb(VALUE obj)
{
- VALUE ctx_obj, cb, ary, cert, key;
-
- ctx_obj = rb_attr_get(obj, id_i_context);
- cb = rb_attr_get(ctx_obj, id_i_client_cert_cb);
- if (NIL_P(cb))
- return Qnil;
+ VALUE cb, ary, cert, key;
+ SSL *ssl;
- ary = rb_funcallv(cb, id_call, 1, &obj);
+ Data_Get_Struct(obj, SSL, ssl);
+ cb = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_client_cert_cb_idx);
+ if (NIL_P(cb)) return Qfalse;
+ ary = rb_funcall(cb, rb_intern("call"), 1, obj);
Check_Type(ary, T_ARRAY);
GetX509CertPtr(cert = rb_ary_entry(ary, 0));
- GetPrivPKeyPtr(key = rb_ary_entry(ary, 1));
+ GetPKeyPtr(key = rb_ary_entry(ary, 1));
+ ossl_ssl_set_x509(obj, cert);
+ ossl_ssl_set_key(obj, key);
- return rb_ary_new3(2, cert, key);
+ return Qtrue;
}
static int
ossl_client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
{
- VALUE obj, ret;
+ VALUE obj, success;
obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- ret = rb_protect(ossl_call_client_cert_cb, obj, NULL);
- if (NIL_P(ret))
- return 0;
-
- *x509 = DupX509CertPtr(RARRAY_AREF(ret, 0));
- *pkey = DupPKeyPtr(RARRAY_AREF(ret, 1));
+ success = rb_protect((VALUE(*)_((VALUE)))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));
return 1;
}
-#if !defined(OPENSSL_NO_DH) || \
- !defined(OPENSSL_NO_EC) && defined(HAVE_SSL_CTX_SET_TMP_ECDH_CALLBACK)
-struct tmp_dh_callback_args {
- VALUE ssl_obj;
- ID id;
- int type;
- int is_export;
- int keylength;
-};
-
-static EVP_PKEY *
-ossl_call_tmp_dh_callback(struct tmp_dh_callback_args *args)
+#if !defined(OPENSSL_NO_DH)
+static VALUE
+ossl_call_tmp_dh_callback(VALUE *args)
{
+ SSL *ssl;
VALUE cb, dh;
EVP_PKEY *pkey;
- cb = rb_funcall(args->ssl_obj, args->id, 0);
- if (NIL_P(cb))
- return NULL;
- dh = rb_funcall(cb, id_call, 3, args->ssl_obj, INT2NUM(args->is_export),
- INT2NUM(args->keylength));
+ Data_Get_Struct(args[0], SSL, ssl);
+ cb = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_tmp_dh_callback_idx);
+ if (NIL_P(cb)) return Qfalse;
+ dh = rb_funcall(cb, rb_intern("call"), 3, args[0], args[1], args[2]);
pkey = GetPKeyPtr(dh);
- if (EVP_PKEY_base_id(pkey) != args->type)
- return NULL;
+ if (EVP_PKEY_type(pkey->type) != EVP_PKEY_DH) return Qfalse;
+ ossl_ssl_set_tmp_dh(args[0], dh);
- return pkey;
+ return Qtrue;
}
-#endif
-#if !defined(OPENSSL_NO_DH)
-static DH *
+static DH*
ossl_tmp_dh_callback(SSL *ssl, int is_export, int keylength)
{
- VALUE rb_ssl;
- EVP_PKEY *pkey;
- struct tmp_dh_callback_args args;
- int state;
-
- rb_ssl = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- args.ssl_obj = rb_ssl;
- args.id = id_tmp_dh_callback;
- args.is_export = is_export;
- args.keylength = keylength;
- args.type = EVP_PKEY_DH;
-
- pkey = (EVP_PKEY *)rb_protect((VALUE (*)(VALUE))ossl_call_tmp_dh_callback,
- (VALUE)&args, &state);
- if (state) {
- rb_ivar_set(rb_ssl, ID_callback_state, INT2NUM(state));
- return NULL;
- }
- if (!pkey)
- return NULL;
+ VALUE args[3], success;
- return EVP_PKEY_get0_DH(pkey);
-}
-#endif /* OPENSSL_NO_DH */
-
-#if !defined(OPENSSL_NO_EC) && defined(HAVE_SSL_CTX_SET_TMP_ECDH_CALLBACK)
-static EC_KEY *
-ossl_tmp_ecdh_callback(SSL *ssl, int is_export, int keylength)
-{
- VALUE rb_ssl;
- EVP_PKEY *pkey;
- struct tmp_dh_callback_args args;
- int state;
-
- rb_ssl = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- args.ssl_obj = rb_ssl;
- args.id = id_tmp_ecdh_callback;
- args.is_export = is_export;
- args.keylength = keylength;
- args.type = EVP_PKEY_EC;
-
- pkey = (EVP_PKEY *)rb_protect((VALUE (*)(VALUE))ossl_call_tmp_dh_callback,
- (VALUE)&args, &state);
- if (state) {
- rb_ivar_set(rb_ssl, ID_callback_state, INT2NUM(state));
- return NULL;
- }
- if (!pkey)
- return NULL;
+ 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;
- return EVP_PKEY_get0_EC_KEY(pkey);
+ return GetPKeyPtr(ossl_ssl_get_tmp_dh(args[0]))->pkey.dh;
}
-#endif
-static VALUE
-call_verify_certificate_identity(VALUE ctx_v)
+static DH*
+ossl_default_tmp_dh_callback(SSL *ssl, int is_export, int keylength)
{
- X509_STORE_CTX *ctx = (X509_STORE_CTX *)ctx_v;
- SSL *ssl;
- VALUE ssl_obj, hostname, cert_obj;
-
- ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- hostname = rb_attr_get(ssl_obj, id_i_hostname);
+ rb_warning("using default DH parameters.");
- if (!RTEST(hostname)) {
- rb_warning("verify_hostname requires hostname to be set");
- return Qtrue;
+ switch(keylength){
+ case 512:
+ return OSSL_DEFAULT_DH_512;
+ case 1024:
+ return OSSL_DEFAULT_DH_1024;
}
-
- cert_obj = ossl_x509_new(X509_STORE_CTX_get_current_cert(ctx));
- return rb_funcall(mSSL, rb_intern("verify_certificate_identity"), 2,
- cert_obj, hostname);
+ return NULL;
}
+#endif /* OPENSSL_NO_DH */
static int
ossl_ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
{
- VALUE cb, ssl_obj, sslctx_obj, verify_hostname, ret;
+ VALUE cb;
SSL *ssl;
- int status;
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);
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- sslctx_obj = rb_attr_get(ssl_obj, id_i_context);
- verify_hostname = rb_attr_get(sslctx_obj, id_i_verify_hostname);
-
- if (preverify_ok && RTEST(verify_hostname) && !SSL_is_server(ssl) &&
- !X509_STORE_CTX_get_error_depth(ctx)) {
- ret = rb_protect(call_verify_certificate_identity, (VALUE)ctx, &status);
- if (status) {
- rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(status));
- return 0;
- }
- preverify_ok = ret == Qtrue;
- }
-
- return ossl_verify_cb_call(cb, preverify_ok, ctx);
+ X509_STORE_CTX_set_ex_data(ctx, ossl_verify_cb_idx, (void*)cb);
+ return ossl_verify_cb(preverify_ok, ctx);
}
static VALUE
ossl_call_session_get_cb(VALUE ary)
{
- VALUE ssl_obj, cb;
+ VALUE ssl_obj, sslctx_obj, cb;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
- cb = rb_funcall(ssl_obj, rb_intern("session_get_cb"), 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");
if (NIL_P(cb)) return Qnil;
- return rb_funcallv(cb, id_call, 1, &ary);
+ return rb_funcall(cb, rb_intern("call"), 1, ary);
}
+/* this method is currently only called for servers (in OpenSSL <= 0.9.8e) */
static SSL_SESSION *
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
-ossl_sslctx_session_get_cb(SSL *ssl, const unsigned char *buf, int len, int *copy)
-#else
ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
-#endif
{
VALUE ary, ssl_obj, ret_obj;
SSL_SESSION *sess;
+ void *ptr;
int state = 0;
OSSL_Debug("SSL SESSION get callback entered");
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ return NULL;
+ ssl_obj = (VALUE)ptr;
ary = rb_ary_new2(2);
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new((const char *)buf, len));
- ret_obj = rb_protect(ossl_call_session_get_cb, ary, &state);
+ ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_get_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return NULL;
@@ -402,7 +374,7 @@ ossl_sslctx_session_get_cb(SSL *ssl, unsigned char *buf, int len, int *copy)
if (!rb_obj_is_instance_of(ret_obj, cSSLSession))
return NULL;
- GetSSLSession(ret_obj, sess);
+ SafeGetSSLSession(ret_obj, sess);
*copy = 1;
return sess;
@@ -411,15 +383,17 @@ 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, cb;
+ VALUE ssl_obj, sslctx_obj, cb;
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
- cb = rb_funcall(ssl_obj, rb_intern("session_new_cb"), 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");
if (NIL_P(cb)) return Qnil;
- return rb_funcallv(cb, id_call, 1, &ary);
+ return rb_funcall(cb, rb_intern("call"), 1, ary);
}
/* return 1 normal. return 0 removes the session */
@@ -427,20 +401,23 @@ static int
ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
{
VALUE ary, ssl_obj, sess_obj;
+ void *ptr;
int state = 0;
OSSL_Debug("SSL SESSION new callback entered");
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ return 1;
+ ssl_obj = (VALUE)ptr;
sess_obj = rb_obj_alloc(cSSLSession);
- SSL_SESSION_up_ref(sess);
+ CRYPTO_add(&sess->references, 1, CRYPTO_LOCK_SSL_SESSION);
DATA_PTR(sess_obj) = sess;
ary = rb_ary_new2(2);
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);
- rb_protect(ossl_call_session_new_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
@@ -463,37 +440,33 @@ ossl_call_session_remove_cb(VALUE ary)
Check_Type(ary, T_ARRAY);
sslctx_obj = rb_ary_entry(ary, 0);
- cb = rb_attr_get(sslctx_obj, id_i_session_remove_cb);
+ cb = rb_iv_get(sslctx_obj, "@session_remove_cb");
if (NIL_P(cb)) return Qnil;
- return rb_funcallv(cb, id_call, 1, &ary);
+ return rb_funcall(cb, rb_intern("call"), 1, ary);
}
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
{
VALUE ary, sslctx_obj, sess_obj;
+ void *ptr;
int state = 0;
- /*
- * This callback is also called for all sessions in the internal store
- * when SSL_CTX_free() is called.
- */
- if (rb_during_gc())
- return;
-
OSSL_Debug("SSL SESSION remove callback entered");
- sslctx_obj = (VALUE)SSL_CTX_get_ex_data(ctx, ossl_sslctx_ex_ptr_idx);
+ if ((ptr = SSL_CTX_get_ex_data(ctx, ossl_ssl_ex_ptr_idx)) == NULL)
+ return;
+ sslctx_obj = (VALUE)ptr;
sess_obj = rb_obj_alloc(cSSLSession);
- SSL_SESSION_up_ref(sess);
+ CRYPTO_add(&sess->references, 1, CRYPTO_LOCK_SSL_SESSION);
DATA_PTR(sess_obj) = sess;
ary = rb_ary_new2(2);
rb_ary_push(ary, sslctx_obj);
rb_ary_push(ary, sess_obj);
- rb_protect(ossl_call_session_remove_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
if (state) {
/*
the SSL_CTX is frozen, nowhere to save state.
@@ -509,7 +482,7 @@ ossl_sslctx_add_extra_chain_cert_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
X509 *x509;
SSL_CTX *ctx;
- GetSSLCTX(arg, ctx);
+ Data_Get_Struct(arg, SSL_CTX, ctx);
x509 = DupX509CertPtr(i);
if(!SSL_CTX_add_extra_chain_cert(ctx, x509)){
ossl_raise(eSSLError, NULL);
@@ -520,6 +493,7 @@ ossl_sslctx_add_extra_chain_cert_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
static VALUE ossl_sslctx_setup(VALUE self);
+#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
static VALUE
ossl_call_servername_cb(VALUE ary)
{
@@ -528,23 +502,22 @@ ossl_call_servername_cb(VALUE ary)
Check_Type(ary, T_ARRAY);
ssl_obj = rb_ary_entry(ary, 0);
- sslctx_obj = rb_attr_get(ssl_obj, id_i_context);
- cb = rb_attr_get(sslctx_obj, id_i_servername_cb);
+ sslctx_obj = rb_iv_get(ssl_obj, "@context");
+ if (NIL_P(sslctx_obj)) return Qnil;
+ cb = rb_iv_get(sslctx_obj, "@servername_cb");
if (NIL_P(cb)) return Qnil;
- ret_obj = rb_funcallv(cb, id_call, 1, &ary);
+ ret_obj = rb_funcall(cb, rb_intern("call"), 1, ary);
if (rb_obj_is_kind_of(ret_obj, cSSLContext)) {
SSL *ssl;
SSL_CTX *ctx2;
ossl_sslctx_setup(ret_obj);
- GetSSL(ssl_obj, ssl);
- GetSSLCTX(ret_obj, ctx2);
+ Data_Get_Struct(ssl_obj, SSL, ssl);
+ Data_Get_Struct(ret_obj, SSL_CTX, ctx2);
SSL_set_SSL_CTX(ssl, ctx2);
- rb_ivar_set(ssl_obj, id_i_context, ret_obj);
} else if (!NIL_P(ret_obj)) {
- ossl_raise(rb_eArgError, "servername_cb must return an "
- "OpenSSL::SSL::SSLContext object or nil");
+ ossl_raise(rb_eArgError, "servername_cb must return an OpenSSL::SSL::SSLContext object or nil");
}
return ret_obj;
@@ -554,18 +527,21 @@ static int
ssl_servername_cb(SSL *ssl, int *ad, void *arg)
{
VALUE ary, ssl_obj;
+ void *ptr;
int state = 0;
const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
if (!servername)
return SSL_TLSEXT_ERR_OK;
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
+ ssl_obj = (VALUE)ptr;
ary = rb_ary_new2(2);
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new2(servername));
- rb_protect(ossl_call_servername_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return SSL_TLSEXT_ERR_ALERT_FATAL;
@@ -573,22 +549,27 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
return SSL_TLSEXT_ERR_OK;
}
+#endif
static void
ssl_renegotiation_cb(const SSL *ssl)
{
VALUE ssl_obj, sslctx_obj, cb;
+ void *ptr;
+
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ ossl_raise(eSSLError, "SSL object could not be retrieved");
+ ssl_obj = (VALUE)ptr;
- ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
- sslctx_obj = rb_attr_get(ssl_obj, id_i_context);
- cb = rb_attr_get(sslctx_obj, id_i_renegotiation_cb);
+ sslctx_obj = rb_iv_get(ssl_obj, "@context");
+ if (NIL_P(sslctx_obj)) return;
+ cb = rb_iv_get(sslctx_obj, "@renegotiation_cb");
if (NIL_P(cb)) return;
- rb_funcallv(cb, id_call, 1, &ssl_obj);
+ (void) rb_funcall(cb, rb_intern("call"), 1, ssl_obj);
}
-#if !defined(OPENSSL_NO_NEXTPROTONEG) || \
- defined(HAVE_SSL_CTX_SET_ALPN_SELECT_CB)
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
static VALUE
ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
{
@@ -603,81 +584,20 @@ ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
return Qnil;
}
-static VALUE
-ssl_encode_npn_protocols(VALUE protocols)
+static void
+ssl_npn_encode_protocols(VALUE sslctx, VALUE protocols)
{
- VALUE encoded = rb_str_new(NULL, 0);
+ VALUE encoded = rb_str_new2("");
rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);
- return encoded;
-}
-
-struct npn_select_cb_common_args {
- VALUE cb;
- const unsigned char *in;
- unsigned inlen;
-};
-
-static VALUE
-npn_select_cb_common_i(VALUE tmp)
-{
- struct npn_select_cb_common_args *args = (void *)tmp;
- const unsigned char *in = args->in, *in_end = in + args->inlen;
- unsigned char l;
- long len;
- VALUE selected, protocols = rb_ary_new();
-
- /* 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_funcallv(args->cb, id_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");
- }
-
- return selected;
-}
-
-static int
-ssl_npn_select_cb_common(SSL *ssl, VALUE cb, const unsigned char **out,
- unsigned char *outlen, const unsigned char *in,
- unsigned int inlen)
-{
- VALUE selected;
- int status;
- struct npn_select_cb_common_args args;
-
- args.cb = cb;
- args.in = in;
- args.inlen = inlen;
-
- selected = rb_protect(npn_select_cb_common_i, (VALUE)&args, &status);
- if (status) {
- VALUE ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
-
- rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(status));
- return SSL_TLSEXT_ERR_ALERT_FATAL;
- }
-
- *out = (unsigned char *)RSTRING_PTR(selected);
- *outlen = (unsigned char)RSTRING_LEN(selected);
-
- return SSL_TLSEXT_ERR_OK;
+ StringValueCStr(encoded);
+ rb_iv_set(sslctx, "@_protocols", encoded);
}
-#endif
-#ifndef OPENSSL_NO_NEXTPROTONEG
static int
-ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen,
- void *arg)
+ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)
{
- VALUE protocols = (VALUE)arg;
+ VALUE sslctx_obj = (VALUE) arg;
+ VALUE protocols = rb_iv_get(sslctx_obj, "@_protocols");
*out = (const unsigned char *) RSTRING_PTR(protocols);
*outlen = RSTRING_LENINT(protocols);
@@ -686,155 +606,100 @@ ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen,
}
static int
-ssl_npn_select_cb(SSL *ssl, unsigned char **out, unsigned char *outlen,
- const unsigned char *in, unsigned int inlen, void *arg)
+ssl_npn_select_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
{
- VALUE sslctx_obj, cb;
+ int i = 0;
+ VALUE sslctx_obj, cb, protocols, selected;
sslctx_obj = (VALUE) arg;
- cb = rb_attr_get(sslctx_obj, id_i_npn_select_cb);
-
- return ssl_npn_select_cb_common(ssl, cb, (const unsigned char **)out,
- outlen, in, inlen);
-}
-#endif
-
-#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;
+ 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;
+ }
- sslctx_obj = (VALUE) arg;
- cb = rb_attr_get(sslctx_obj, id_i_alpn_select_cb);
+ selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
+ StringValue(selected);
+ *out = (unsigned char *) StringValuePtr(selected);
+ *outlen = RSTRING_LENINT(selected);
- return ssl_npn_select_cb_common(ssl, cb, out, outlen, in, inlen);
+ return SSL_TLSEXT_ERR_OK;
}
#endif
-/* This function may serve as the entry point to support further callbacks. */
+/* This function may serve as the entry point to support further
+ * callbacks. */
static void
ssl_info_cb(const SSL *ssl, int where, int val)
{
- int is_server = SSL_is_server((SSL *)ssl);
+ int state = SSL_state(ssl);
- if (is_server && where & SSL_CB_HANDSHAKE_START) {
+ if ((where & SSL_CB_HANDSHAKE_START) &&
+ (state & SSL_ST_ACCEPT)) {
ssl_renegotiation_cb(ssl);
}
}
/*
- * Gets various OpenSSL options.
- */
-static VALUE
-ossl_sslctx_get_options(VALUE self)
-{
- SSL_CTX *ctx;
- GetSSLCTX(self, ctx);
- /*
- * Do explicit cast because SSL_CTX_get_options() returned (signed) long in
- * OpenSSL before 1.1.0.
- */
- return ULONG2NUM((unsigned long)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, NUM2ULONG(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.
- * However, it is not thread-safe and must be called before creating
- * SSLSocket objects in a multi-threaded program.
+ * Normally you do not need to call this method (unless you are writing an
+ * extension in C).
*/
static VALUE
ossl_sslctx_setup(VALUE self)
{
SSL_CTX *ctx;
X509 *cert = NULL, *client_ca = NULL;
+ X509_STORE *store;
EVP_PKEY *key = NULL;
char *ca_path = NULL, *ca_file = NULL;
- int verify_mode;
- long i;
+ int i, verify_mode;
VALUE val;
if(OBJ_FROZEN(self)) return Qnil;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
#if !defined(OPENSSL_NO_DH)
- SSL_CTX_set_tmp_dh_callback(ctx, ossl_tmp_dh_callback);
-#endif
-
-#if !defined(OPENSSL_NO_EC)
- /* We added SSLContext#tmp_ecdh_callback= in Ruby 2.3.0,
- * but SSL_CTX_set_tmp_ecdh_callback() was removed in OpenSSL 1.1.0. */
- if (RTEST(rb_attr_get(self, id_i_tmp_ecdh_callback))) {
-# if defined(HAVE_SSL_CTX_SET_TMP_ECDH_CALLBACK)
- rb_warn("#tmp_ecdh_callback= is deprecated; use #ecdh_curves= instead");
- SSL_CTX_set_tmp_ecdh_callback(ctx, ossl_tmp_ecdh_callback);
-# if defined(HAVE_SSL_CTX_SET_ECDH_AUTO)
- /* tmp_ecdh_callback and ecdh_auto conflict; OpenSSL ignores
- * tmp_ecdh_callback. So disable ecdh_auto. */
- if (!SSL_CTX_set_ecdh_auto(ctx, 0))
- ossl_raise(eSSLError, "SSL_CTX_set_ecdh_auto");
-# endif
-# else
- ossl_raise(eSSLError, "OpenSSL does not support tmp_ecdh_callback; "
- "use #ecdh_curves= instead");
-# endif
+ 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);
}
-#endif /* OPENSSL_NO_EC */
+#endif
+ SSL_CTX_set_ex_data(ctx, ossl_ssl_ex_ptr_idx, (void*)self);
- val = rb_attr_get(self, id_i_cert_store);
- if (!NIL_P(val)) {
- X509_STORE *store = GetX509StorePtr(val); /* NO NEED TO DUP */
- SSL_CTX_set_cert_store(ctx, store);
-#if !defined(HAVE_X509_STORE_UP_REF)
+ val = ossl_sslctx_get_cert_store(self);
+ if(!NIL_P(val)){
/*
* WORKAROUND:
* X509_STORE can count references, but
* X509_STORE_free() doesn't care it.
* So we won't increment it but mark it by ex_data.
*/
- SSL_CTX_set_ex_data(ctx, ossl_sslctx_ex_store_p, ctx);
-#else /* Fixed in OpenSSL 1.0.2; bff9ce4db38b (master), 5b4b9ce976fc (1.0.2) */
- X509_STORE_up_ref(store);
-#endif
+ store = GetX509StorePtr(val); /* NO NEED TO DUP */
+ SSL_CTX_set_cert_store(ctx, store);
+ SSL_CTX_set_ex_data(ctx, ossl_ssl_ex_store_p, (void*)1);
}
- val = rb_attr_get(self, id_i_extra_chain_cert);
+ val = ossl_sslctx_get_extra_cert(self);
if(!NIL_P(val)){
rb_block_call(val, rb_intern("each"), 0, 0, ossl_sslctx_add_extra_chain_cert_i, self);
}
/* private key may be bundled in certificate file. */
- val = rb_attr_get(self, id_i_cert);
+ val = ossl_sslctx_get_cert(self);
cert = NIL_P(val) ? NULL : GetX509CertPtr(val); /* NO DUP NEEDED */
- val = rb_attr_get(self, id_i_key);
- key = NIL_P(val) ? NULL : GetPrivPKeyPtr(val); /* NO DUP NEEDED */
+ val = ossl_sslctx_get_key(self);
+ key = NIL_P(val) ? NULL : GetPKeyPtr(val); /* NO DUP NEEDED */
if (cert && key) {
if (!SSL_CTX_use_certificate(ctx, cert)) {
/* Adds a ref => Safe to FREE */
@@ -849,11 +714,11 @@ ossl_sslctx_setup(VALUE self)
}
}
- val = rb_attr_get(self, id_i_client_ca);
+ val = ossl_sslctx_get_client_ca(self);
if(!NIL_P(val)){
if (RB_TYPE_P(val, T_ARRAY)) {
for(i = 0; i < RARRAY_LEN(val); i++){
- client_ca = GetX509CertPtr(RARRAY_AREF(val, i));
+ client_ca = GetX509CertPtr(RARRAY_PTR(val)[i]);
if (!SSL_CTX_add_client_CA(ctx, client_ca)){
/* Copies X509_NAME => FREE it. */
ossl_raise(eSSLError, "SSL_CTX_add_client_CA");
@@ -869,61 +734,50 @@ ossl_sslctx_setup(VALUE self)
}
}
- val = rb_attr_get(self, id_i_ca_file);
- ca_file = NIL_P(val) ? NULL : StringValueCStr(val);
- val = rb_attr_get(self, id_i_ca_path);
- ca_path = NIL_P(val) ? NULL : StringValueCStr(val);
+ val = ossl_sslctx_get_ca_file(self);
+ ca_file = NIL_P(val) ? NULL : StringValuePtr(val);
+ val = ossl_sslctx_get_ca_path(self);
+ ca_path = NIL_P(val) ? NULL : StringValuePtr(val);
if(ca_file || ca_path){
if (!SSL_CTX_load_verify_locations(ctx, ca_file, ca_path))
rb_warning("can't set verify locations");
}
- val = rb_attr_get(self, id_i_verify_mode);
+ val = ossl_sslctx_get_verify_mode(self);
verify_mode = NIL_P(val) ? SSL_VERIFY_NONE : NUM2INT(val);
SSL_CTX_set_verify(ctx, verify_mode, ossl_ssl_verify_callback);
- if (RTEST(rb_attr_get(self, id_i_client_cert_cb)))
+ if (RTEST(ossl_sslctx_get_client_cert_cb(self)))
SSL_CTX_set_client_cert_cb(ctx, ossl_client_cert_cb);
- val = rb_attr_get(self, id_i_timeout);
+ val = ossl_sslctx_get_timeout(self);
if(!NIL_P(val)) SSL_CTX_set_timeout(ctx, NUM2LONG(val));
- val = rb_attr_get(self, id_i_verify_depth);
+ val = ossl_sslctx_get_verify_dep(self);
if(!NIL_P(val)) SSL_CTX_set_verify_depth(ctx, NUM2INT(val));
-#ifndef OPENSSL_NO_NEXTPROTONEG
- val = rb_attr_get(self, id_i_npn_protocols);
+ 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
+ val = rb_iv_get(self, "@npn_protocols");
if (!NIL_P(val)) {
- VALUE encoded = ssl_encode_npn_protocols(val);
- rb_ivar_set(self, id_npn_protocols_encoded, encoded);
- SSL_CTX_set_next_protos_advertised_cb(ctx, ssl_npn_advertise_cb, (void *)encoded);
+ ssl_npn_encode_protocols(self, val);
+ SSL_CTX_set_next_protos_advertised_cb(ctx, ssl_npn_advertise_cb, (void *) self);
OSSL_Debug("SSL NPN advertise callback added");
}
- if (RTEST(rb_attr_get(self, id_i_npn_select_cb))) {
+ if (RTEST(rb_iv_get(self, "@npn_select_cb"))) {
SSL_CTX_set_next_proto_select_cb(ctx, ssl_npn_select_cb, (void *) self);
OSSL_Debug("SSL NPN select callback added");
}
#endif
-#ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
- val = rb_attr_get(self, id_i_alpn_protocols);
- if (!NIL_P(val)) {
- VALUE rprotos = ssl_encode_npn_protocols(val);
-
- /* returns 0 on success */
- if (SSL_CTX_set_alpn_protos(ctx, (unsigned char *)RSTRING_PTR(rprotos),
- RSTRING_LENINT(rprotos)))
- ossl_raise(eSSLError, "SSL_CTX_set_alpn_protos");
- OSSL_Debug("SSL ALPN values added");
- }
- if (RTEST(rb_attr_get(self, id_i_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 = rb_attr_get(self, id_i_session_id_context);
+ val = ossl_sslctx_get_sess_id_ctx(self);
if (!NIL_P(val)){
StringValue(val);
if (!SSL_CTX_set_session_id_context(ctx, (unsigned char *)RSTRING_PTR(val),
@@ -932,30 +786,32 @@ ossl_sslctx_setup(VALUE self)
}
}
- if (RTEST(rb_attr_get(self, id_i_session_get_cb))) {
+ if (RTEST(rb_iv_get(self, "@session_get_cb"))) {
SSL_CTX_sess_set_get_cb(ctx, ossl_sslctx_session_get_cb);
OSSL_Debug("SSL SESSION get callback added");
}
- if (RTEST(rb_attr_get(self, id_i_session_new_cb))) {
+ if (RTEST(rb_iv_get(self, "@session_new_cb"))) {
SSL_CTX_sess_set_new_cb(ctx, ossl_sslctx_session_new_cb);
OSSL_Debug("SSL SESSION new callback added");
}
- if (RTEST(rb_attr_get(self, id_i_session_remove_cb))) {
+ if (RTEST(rb_iv_get(self, "@session_remove_cb"))) {
SSL_CTX_sess_set_remove_cb(ctx, ossl_sslctx_session_remove_cb);
OSSL_Debug("SSL SESSION remove callback added");
}
- val = rb_attr_get(self, id_i_servername_cb);
+#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
+ val = rb_iv_get(self, "@servername_cb");
if (!NIL_P(val)) {
SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb);
OSSL_Debug("SSL TLSEXT servername callback added");
}
+#endif
return Qtrue;
}
static VALUE
-ossl_ssl_cipher_to_ary(const SSL_CIPHER *cipher)
+ossl_ssl_cipher_to_ary(SSL_CIPHER *cipher)
{
VALUE ary;
int bits, alg_bits;
@@ -964,8 +820,8 @@ ossl_ssl_cipher_to_ary(const SSL_CIPHER *cipher)
rb_ary_push(ary, rb_str_new2(SSL_CIPHER_get_name(cipher)));
rb_ary_push(ary, rb_str_new2(SSL_CIPHER_get_version(cipher)));
bits = SSL_CIPHER_get_bits(cipher, &alg_bits);
- rb_ary_push(ary, INT2NUM(bits));
- rb_ary_push(ary, INT2NUM(alg_bits));
+ rb_ary_push(ary, INT2FIX(bits));
+ rb_ary_push(ary, INT2FIX(alg_bits));
return ary;
}
@@ -974,19 +830,24 @@ ossl_ssl_cipher_to_ary(const SSL_CIPHER *cipher)
* call-seq:
* ctx.ciphers => [[name, version, bits, alg_bits], ...]
*
- * The list of cipher suites configured for this context.
+ * The list of ciphers configured for this context.
*/
static VALUE
ossl_sslctx_get_ciphers(VALUE self)
{
SSL_CTX *ctx;
STACK_OF(SSL_CIPHER) *ciphers;
- const SSL_CIPHER *cipher;
+ SSL_CIPHER *cipher;
VALUE ary;
int i, num;
- GetSSLCTX(self, ctx);
- ciphers = SSL_CTX_get_ciphers(ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
+ if(!ctx){
+ rb_warning("SSL_CTX is not initialized.");
+ return Qnil;
+ }
+ ciphers = ctx->cipher_list;
+
if (!ciphers)
return rb_ary_new();
@@ -1005,9 +866,11 @@ ossl_sslctx_get_ciphers(VALUE self)
* ctx.ciphers = [name, ...]
* ctx.ciphers = [[name, version, bits, alg_bits], ...]
*
- * Sets the list of available cipher suites for this context. Note in a server
+ * Sets the list of available ciphers for this context. Note in a server
* context some ciphers require the appropriate certificates. For example, an
- * RSA cipher suite can only be chosen when an RSA certificate is available.
+ * RSA cipher can only be chosen when an RSA certificate is available.
+ *
+ * See also OpenSSL::Cipher and OpenSSL::Cipher::ciphers
*/
static VALUE
ossl_sslctx_set_ciphers(VALUE self, VALUE v)
@@ -1033,294 +896,23 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
StringValue(str);
}
- GetSSLCTX(self, ctx);
- if (!SSL_CTX_set_cipher_list(ctx, StringValueCStr(str))) {
+ Data_Get_Struct(self, SSL_CTX, ctx);
+ if(!ctx){
+ ossl_raise(eSSLError, "SSL_CTX is not initialized.");
+ return Qnil;
+ }
+ if (!SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(str))) {
ossl_raise(eSSLError, "SSL_CTX_set_cipher_list");
}
return v;
}
-#if !defined(OPENSSL_NO_EC)
-/*
- * call-seq:
- * ctx.ecdh_curves = curve_list -> curve_list
- *
- * Sets the list of "supported elliptic curves" for this context.
- *
- * For a TLS client, the list is directly used in the Supported Elliptic Curves
- * Extension. For a server, the list is used by OpenSSL to determine the set of
- * shared curves. OpenSSL will pick the most appropriate one from it.
- *
- * Note that this works differently with old OpenSSL (<= 1.0.1). Only one curve
- * can be set, and this has no effect for TLS clients.
- *
- * === Example
- * ctx1 = OpenSSL::SSL::SSLContext.new
- * ctx1.ecdh_curves = "X25519:P-256:P-224"
- * svr = OpenSSL::SSL::SSLServer.new(tcp_svr, ctx1)
- * Thread.new { svr.accept }
- *
- * ctx2 = OpenSSL::SSL::SSLContext.new
- * ctx2.ecdh_curves = "P-256"
- * cli = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx2)
- * cli.connect
- *
- * p cli.tmp_key.group.curve_name
- * # => "prime256v1" (is an alias for NIST P-256)
- */
-static VALUE
-ossl_sslctx_set_ecdh_curves(VALUE self, VALUE arg)
-{
- SSL_CTX *ctx;
-
- rb_check_frozen(self);
- GetSSLCTX(self, ctx);
- StringValueCStr(arg);
-
-#if defined(HAVE_SSL_CTX_SET1_CURVES_LIST)
- if (!SSL_CTX_set1_curves_list(ctx, RSTRING_PTR(arg)))
- ossl_raise(eSSLError, NULL);
-#else
- /* OpenSSL does not have SSL_CTX_set1_curves_list()... Fallback to
- * SSL_CTX_set_tmp_ecdh(). So only the first curve is used. */
- {
- VALUE curve, splitted;
- EC_KEY *ec;
- int nid;
-
- splitted = rb_str_split(arg, ":");
- if (!RARRAY_LEN(splitted))
- ossl_raise(eSSLError, "invalid input format");
- curve = RARRAY_AREF(splitted, 0);
- StringValueCStr(curve);
-
- /* SSL_CTX_set1_curves_list() accepts NIST names */
- nid = EC_curve_nist2nid(RSTRING_PTR(curve));
- if (nid == NID_undef)
- nid = OBJ_txt2nid(RSTRING_PTR(curve));
- if (nid == NID_undef)
- ossl_raise(eSSLError, "unknown curve name");
-
- ec = EC_KEY_new_by_curve_name(nid);
- if (!ec)
- ossl_raise(eSSLError, NULL);
- EC_KEY_set_asn1_flag(ec, OPENSSL_EC_NAMED_CURVE);
- if (!SSL_CTX_set_tmp_ecdh(ctx, ec)) {
- EC_KEY_free(ec);
- ossl_raise(eSSLError, "SSL_CTX_set_tmp_ecdh");
- }
- EC_KEY_free(ec);
-# if defined(HAVE_SSL_CTX_SET_ECDH_AUTO)
- /* tmp_ecdh and ecdh_auto conflict. tmp_ecdh is ignored when ecdh_auto
- * is enabled. So disable ecdh_auto. */
- if (!SSL_CTX_set_ecdh_auto(ctx, 0))
- ossl_raise(eSSLError, "SSL_CTX_set_ecdh_auto");
-# endif
- }
-#endif
-
- return arg;
-}
-#else
-#define ossl_sslctx_set_ecdh_curves rb_f_notimplement
-#endif
-
-/*
- * call-seq:
- * ctx.security_level -> Integer
- *
- * Returns the security level for the context.
- *
- * See also OpenSSL::SSL::SSLContext#security_level=.
- */
-static VALUE
-ossl_sslctx_get_security_level(VALUE self)
-{
- SSL_CTX *ctx;
-
- GetSSLCTX(self, ctx);
-
-#if defined(HAVE_SSL_CTX_GET_SECURITY_LEVEL)
- return INT2NUM(SSL_CTX_get_security_level(ctx));
-#else
- (void)ctx;
- return INT2FIX(0);
-#endif
-}
-
-/*
- * call-seq:
- * ctx.security_level = integer
- *
- * Sets the security level for the context. OpenSSL limits parameters according
- * to the level. The "parameters" include: ciphersuites, curves, key sizes,
- * certificate signature algorithms, protocol version and so on. For example,
- * level 1 rejects parameters offering below 80 bits of security, such as
- * ciphersuites using MD5 for the MAC or RSA keys shorter than 1024 bits.
- *
- * Note that attempts to set such parameters with insufficient security are
- * also blocked. You need to lower the level first.
- *
- * This feature is not supported in OpenSSL < 1.1.0, and setting the level to
- * other than 0 will raise NotImplementedError. Level 0 means everything is
- * permitted, the same behavior as previous versions of OpenSSL.
- *
- * See the manpage of SSL_CTX_set_security_level(3) for details.
- */
-static VALUE
-ossl_sslctx_set_security_level(VALUE self, VALUE value)
-{
- SSL_CTX *ctx;
-
- rb_check_frozen(self);
- GetSSLCTX(self, ctx);
-
-#if defined(HAVE_SSL_CTX_GET_SECURITY_LEVEL)
- SSL_CTX_set_security_level(ctx, NUM2INT(value));
-#else
- (void)ctx;
- if (NUM2INT(value) != 0)
- ossl_raise(rb_eNotImpError, "setting security level to other than 0 is "
- "not supported in this version of OpenSSL");
-#endif
-
- return value;
-}
-
-#ifdef SSL_MODE_SEND_FALLBACK_SCSV
-/*
- * call-seq:
- * ctx.enable_fallback_scsv() => nil
- *
- * Activate TLS_FALLBACK_SCSV for this context.
- * See RFC 7507.
- */
-static VALUE
-ossl_sslctx_enable_fallback_scsv(VALUE self)
-{
- SSL_CTX *ctx;
-
- GetSSLCTX(self, ctx);
- SSL_CTX_set_mode(ctx, SSL_MODE_SEND_FALLBACK_SCSV);
-
- return Qnil;
-}
-#endif
-
-/*
- * call-seq:
- * ctx.add_certificate(certiticate, pkey [, extra_certs]) -> self
- *
- * Adds a certificate to the context. _pkey_ must be a corresponding private
- * key with _certificate_.
- *
- * Multiple certificates with different public key type can be added by
- * repeated calls of this method, and OpenSSL will choose the most appropriate
- * certificate during the handshake.
- *
- * #cert=, #key=, and #extra_chain_cert= are old accessor methods for setting
- * certificate and internally call this method.
- *
- * === Parameters
- * _certificate_::
- * A certificate. An instance of OpenSSL::X509::Certificate.
- * _pkey_::
- * The private key for _certificate_. An instance of OpenSSL::PKey::PKey.
- * _extra_certs_::
- * Optional. An array of OpenSSL::X509::Certificate. When sending a
- * certificate chain, the certificates specified by this are sent following
- * _certificate_, in the order in the array.
- *
- * === Example
- * rsa_cert = OpenSSL::X509::Certificate.new(...)
- * rsa_pkey = OpenSSL::PKey.read(...)
- * ca_intermediate_cert = OpenSSL::X509::Certificate.new(...)
- * ctx.add_certificate(rsa_cert, rsa_pkey, [ca_intermediate_cert])
- *
- * ecdsa_cert = ...
- * ecdsa_pkey = ...
- * another_ca_cert = ...
- * ctx.add_certificate(ecdsa_cert, ecdsa_pkey, [another_ca_cert])
- *
- * === Note
- * OpenSSL before the version 1.0.2 could handle only one extra chain across
- * all key types. Calling this method discards the chain set previously.
- */
-static VALUE
-ossl_sslctx_add_certificate(int argc, VALUE *argv, VALUE self)
-{
- VALUE cert, key, extra_chain_ary;
- SSL_CTX *ctx;
- X509 *x509;
- STACK_OF(X509) *extra_chain = NULL;
- EVP_PKEY *pkey, *pub_pkey;
-
- GetSSLCTX(self, ctx);
- rb_scan_args(argc, argv, "21", &cert, &key, &extra_chain_ary);
- rb_check_frozen(self);
- x509 = GetX509CertPtr(cert);
- pkey = GetPrivPKeyPtr(key);
-
- /*
- * The reference counter is bumped, and decremented immediately.
- * X509_get0_pubkey() is only available in OpenSSL >= 1.1.0.
- */
- pub_pkey = X509_get_pubkey(x509);
- EVP_PKEY_free(pub_pkey);
- if (!pub_pkey)
- rb_raise(rb_eArgError, "certificate does not contain public key");
- if (EVP_PKEY_cmp(pub_pkey, pkey) != 1)
- rb_raise(rb_eArgError, "public key mismatch");
-
- if (argc >= 3)
- extra_chain = ossl_x509_ary2sk(extra_chain_ary);
-
- if (!SSL_CTX_use_certificate(ctx, x509)) {
- sk_X509_pop_free(extra_chain, X509_free);
- ossl_raise(eSSLError, "SSL_CTX_use_certificate");
- }
- if (!SSL_CTX_use_PrivateKey(ctx, pkey)) {
- sk_X509_pop_free(extra_chain, X509_free);
- ossl_raise(eSSLError, "SSL_CTX_use_PrivateKey");
- }
-
- if (extra_chain) {
-#if OPENSSL_VERSION_NUMBER >= 0x10002000 && !defined(LIBRESSL_VERSION_NUMBER)
- if (!SSL_CTX_set0_chain(ctx, extra_chain)) {
- sk_X509_pop_free(extra_chain, X509_free);
- ossl_raise(eSSLError, "SSL_CTX_set0_chain");
- }
-#else
- STACK_OF(X509) *orig_extra_chain;
- X509 *x509_tmp;
-
- /* First, clear the existing chain */
- SSL_CTX_get_extra_chain_certs(ctx, &orig_extra_chain);
- if (orig_extra_chain && sk_X509_num(orig_extra_chain)) {
- rb_warning("SSL_CTX_set0_chain() is not available; " \
- "clearing previously set certificate chain");
- SSL_CTX_clear_extra_chain_certs(ctx);
- }
- while ((x509_tmp = sk_X509_shift(extra_chain))) {
- /* Transfers ownership */
- if (!SSL_CTX_add_extra_chain_cert(ctx, x509_tmp)) {
- X509_free(x509_tmp);
- sk_X509_pop_free(extra_chain, X509_free);
- ossl_raise(eSSLError, "SSL_CTX_add_extra_chain_cert");
- }
- }
- sk_X509_free(extra_chain);
-#endif
- }
- return self;
-}
-
/*
* call-seq:
* ctx.session_add(session) -> true | false
*
- * Adds _session_ to the session cache.
+ * Adds +session+ to the session cache
*/
static VALUE
ossl_sslctx_session_add(VALUE self, VALUE arg)
@@ -1328,8 +920,8 @@ ossl_sslctx_session_add(VALUE self, VALUE arg)
SSL_CTX *ctx;
SSL_SESSION *sess;
- GetSSLCTX(self, ctx);
- GetSSLSession(arg, sess);
+ Data_Get_Struct(self, SSL_CTX, ctx);
+ SafeGetSSLSession(arg, sess);
return SSL_CTX_add_session(ctx, sess) == 1 ? Qtrue : Qfalse;
}
@@ -1338,7 +930,7 @@ ossl_sslctx_session_add(VALUE self, VALUE arg)
* call-seq:
* ctx.session_remove(session) -> true | false
*
- * Removes _session_ from the session cache.
+ * Removes +session+ from the session cache
*/
static VALUE
ossl_sslctx_session_remove(VALUE self, VALUE arg)
@@ -1346,8 +938,8 @@ ossl_sslctx_session_remove(VALUE self, VALUE arg)
SSL_CTX *ctx;
SSL_SESSION *sess;
- GetSSLCTX(self, ctx);
- GetSSLSession(arg, sess);
+ Data_Get_Struct(self, SSL_CTX, ctx);
+ SafeGetSSLSession(arg, sess);
return SSL_CTX_remove_session(ctx, sess) == 1 ? Qtrue : Qfalse;
}
@@ -1363,7 +955,7 @@ ossl_sslctx_get_session_cache_mode(VALUE self)
{
SSL_CTX *ctx;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
return LONG2NUM(SSL_CTX_get_session_cache_mode(ctx));
}
@@ -1381,7 +973,7 @@ ossl_sslctx_set_session_cache_mode(VALUE self, VALUE arg)
{
SSL_CTX *ctx;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
SSL_CTX_set_session_cache_mode(ctx, NUM2LONG(arg));
@@ -1400,7 +992,7 @@ ossl_sslctx_get_session_cache_size(VALUE self)
{
SSL_CTX *ctx;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
return LONG2NUM(SSL_CTX_sess_get_cache_size(ctx));
}
@@ -1417,7 +1009,7 @@ ossl_sslctx_set_session_cache_size(VALUE self, VALUE arg)
{
SSL_CTX *ctx;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
SSL_CTX_sess_set_cache_size(ctx, NUM2LONG(arg));
@@ -1452,7 +1044,7 @@ ossl_sslctx_get_session_cache_stats(VALUE self)
SSL_CTX *ctx;
VALUE hash;
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
hash = rb_hash_new();
rb_hash_aset(hash, ID2SYM(rb_intern("cache_num")), LONG2NUM(SSL_CTX_sess_number(ctx)));
@@ -1474,9 +1066,9 @@ ossl_sslctx_get_session_cache_stats(VALUE self)
/*
* call-seq:
- * ctx.flush_sessions(time) -> self
+ * ctx.flush_sessions(time | nil) -> self
*
- * Removes sessions in the internal cache that have expired at _time_.
+ * Removes sessions in the internal cache that have expired at +time+.
*/
static VALUE
ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
@@ -1487,7 +1079,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "01", &arg1);
- GetSSLCTX(self, ctx);
+ Data_Get_Struct(self, SSL_CTX, ctx);
if (NIL_P(arg1)) {
tm = time(0);
@@ -1506,31 +1098,37 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
* SSLSocket class
*/
#ifndef OPENSSL_NO_SOCK
-static inline int
-ssl_started(SSL *ssl)
-{
- /* the FD is set in ossl_ssl_setup(), called by #connect or #accept */
- return SSL_get_fd(ssl) >= 0;
+static void
+ossl_ssl_shutdown(SSL *ssl)
+{
+ int i, rc;
+
+ if (ssl) {
+ /* 4 is from SSL_smart_shutdown() of mod_ssl.c (v2.2.19) */
+ /* It says max 2x pending + 2x data = 4 */
+ for (i = 0; i < 4; ++i) {
+ /*
+ * Ignore the case SSL_shutdown returns -1. Empty handshake_func
+ * must not happen.
+ */
+ if (rc = SSL_shutdown(ssl))
+ break;
+ }
+ SSL_clear(ssl);
+ ERR_clear_error();
+ }
}
static void
-ossl_ssl_free(void *ssl)
+ossl_ssl_free(SSL *ssl)
{
SSL_free(ssl);
}
-const rb_data_type_t ossl_ssl_type = {
- "OpenSSL/SSL",
- {
- 0, ossl_ssl_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
-
static VALUE
ossl_ssl_s_alloc(VALUE klass)
{
- return TypedData_Wrap_Struct(klass, &ossl_ssl_type, NULL);
+ return Data_Wrap_Struct(klass, 0, ossl_ssl_free, NULL);
}
/*
@@ -1538,10 +1136,10 @@ ossl_ssl_s_alloc(VALUE klass)
* SSLSocket.new(io) => aSSLSocket
* SSLSocket.new(io, ctx) => aSSLSocket
*
- * Creates a new SSL socket from _io_ which must be a real IO object (not an
+ * 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
+ * If +ctx+ is provided the SSL Sockets initial params will be taken from
* the context.
*
* The OpenSSL::Buffering module provides additional IO methods.
@@ -1552,36 +1150,21 @@ ossl_ssl_s_alloc(VALUE klass)
static VALUE
ossl_ssl_initialize(int argc, VALUE *argv, VALUE self)
{
- VALUE io, v_ctx, verify_cb;
- SSL *ssl;
- SSL_CTX *ctx;
-
- TypedData_Get_Struct(self, SSL, &ossl_ssl_type, ssl);
- if (ssl)
- ossl_raise(eSSLError, "SSL already initialized");
+ VALUE io, ctx;
- if (rb_scan_args(argc, argv, "11", &io, &v_ctx) == 1)
- v_ctx = rb_funcall(cSSLContext, rb_intern("new"), 0);
-
- GetSSLCTX(v_ctx, ctx);
- rb_ivar_set(self, id_i_context, v_ctx);
- ossl_sslctx_setup(v_ctx);
-
- if (rb_respond_to(io, rb_intern("nonblock=")))
- rb_funcall(io, rb_intern("nonblock="), 1, Qtrue);
- rb_ivar_set(self, id_i_io, io);
-
- ssl = SSL_new(ctx);
- if (!ssl)
- ossl_raise(eSSLError, NULL);
- RTYPEDDATA_DATA(self) = ssl;
+ 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);
- SSL_set_ex_data(ssl, ossl_ssl_ex_ptr_idx, (void *)self);
- SSL_set_info_callback(ssl, ssl_info_cb);
- verify_cb = rb_attr_get(v_ctx, id_i_verify_callback);
- SSL_set_ex_data(ssl, ossl_ssl_ex_vcb_idx, (void *)verify_cb);
+ rb_iv_set(self, "@hostname", Qnil);
- rb_call_super(0, NULL);
+ rb_call_super(0, 0);
return self;
}
@@ -1589,20 +1172,46 @@ ossl_ssl_initialize(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_ssl_setup(VALUE self)
{
- VALUE io;
+ VALUE io, v_ctx, cb;
+ SSL_CTX *ctx;
SSL *ssl;
rb_io_t *fptr;
- GetSSL(self, ssl);
- if (ssl_started(ssl))
- return Qtrue;
+ Data_Get_Struct(self, SSL, ssl);
+ if(!ssl){
+#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
+ VALUE hostname = rb_iv_get(self, "@hostname");
+#endif
- io = rb_attr_get(self, id_i_io);
- GetOpenFile(io, fptr);
- rb_io_check_readable(fptr);
- rb_io_check_writable(fptr);
- if (!SSL_set_fd(ssl, TO_SOCKET(fptr->fd)))
- ossl_raise(eSSLError, "SSL_set_fd");
+ v_ctx = ossl_ssl_get_ctx(self);
+ Data_Get_Struct(v_ctx, SSL_CTX, ctx);
+
+ ssl = SSL_new(ctx);
+ if (!ssl) {
+ ossl_raise(eSSLError, "SSL_new");
+ }
+ DATA_PTR(self) = ssl;
+
+#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
+ if (!NIL_P(hostname)) {
+ if (SSL_set_tlsext_host_name(ssl, StringValuePtr(hostname)) != 1)
+ ossl_raise(eSSLError, "SSL_set_tlsext_host_name");
+ }
+#endif
+ io = ossl_ssl_get_io(self);
+ GetOpenFile(io, fptr);
+ rb_io_check_readable(fptr);
+ rb_io_check_writable(fptr);
+ SSL_set_fd(ssl, TO_SOCKET(FPTR_TO_FD(fptr)));
+ 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);
+ }
return Qtrue;
}
@@ -1613,90 +1222,68 @@ ossl_ssl_setup(VALUE self)
#define ssl_get_error(ssl, ret) SSL_get_error((ssl), (ret))
#endif
+#define ossl_ssl_data_get_struct(v, ssl) \
+do { \
+ Data_Get_Struct((v), SSL, (ssl)); \
+ if (!(ssl)) { \
+ rb_warning("SSL session is not started yet."); \
+ return Qnil; \
+ } \
+} while (0)
+
static void
write_would_block(int nonblock)
{
- if (nonblock)
- ossl_raise(eSSLErrorWaitWritable, "write would block");
+ if (nonblock) {
+ VALUE exc = ossl_exc_new(eSSLErrorWaitWritable, "write would block");
+ rb_exc_raise(exc);
+ }
}
static void
read_would_block(int nonblock)
{
- if (nonblock)
- ossl_raise(eSSLErrorWaitReadable, "read would block");
-}
-
-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;
+ if (nonblock) {
+ VALUE exc = ossl_exc_new(eSSLErrorWaitReadable, "read would block");
+ rb_exc_raise(exc);
+ }
}
static VALUE
-ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, VALUE opts)
+ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, int nonblock)
{
SSL *ssl;
rb_io_t *fptr;
int ret, ret2;
VALUE cb_state;
- int nonblock = opts != Qfalse;
-#if defined(SSL_R_CERTIFICATE_VERIFY_FAILED)
- unsigned long err;
-#endif
rb_ivar_set(self, ID_callback_state, Qnil);
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
- GetOpenFile(rb_attr_get(self, id_i_io), fptr);
+ GetOpenFile(ossl_ssl_get_io(self), fptr);
for(;;){
ret = func(ssl);
- cb_state = rb_attr_get(self, ID_callback_state);
- if (!NIL_P(cb_state)) {
- /* must cleanup OpenSSL error stack before re-raising */
- ossl_clear_error();
- rb_jump_tag(NUM2INT(cb_state));
- }
+ cb_state = rb_ivar_get(self, ID_callback_state);
+ if (!NIL_P(cb_state))
+ rb_jump_tag(NUM2INT(cb_state));
if (ret > 0)
break;
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->fd);
+ 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->fd);
+ rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
if (errno) rb_sys_fail(funcname);
ossl_raise(eSSLError, "%s SYSCALL returned=%d errno=%d state=%s", funcname, ret2, errno, SSL_state_string_long(ssl));
-#if defined(SSL_R_CERTIFICATE_VERIFY_FAILED)
- case SSL_ERROR_SSL:
- err = ERR_peek_last_error();
- if (ERR_GET_LIB(err) == ERR_LIB_SSL &&
- ERR_GET_REASON(err) == SSL_R_CERTIFICATE_VERIFY_FAILED) {
- const char *err_msg = ERR_reason_error_string(err),
- *verify_msg = X509_verify_cert_error_string(SSL_get_verify_result(ssl));
- if (!err_msg)
- err_msg = "(null)";
- if (!verify_msg)
- verify_msg = "(null)";
- ossl_clear_error(); /* let ossl_raise() not append message */
- ossl_raise(eSSLError, "%s returned=%d errno=%d state=%s: %s (%s)",
- funcname, ret2, errno, SSL_state_string_long(ssl),
- err_msg, verify_msg);
- }
-#endif
default:
ossl_raise(eSSLError, "%s returned=%d errno=%d state=%s", funcname, ret2, errno, SSL_state_string_long(ssl));
}
@@ -1716,13 +1303,12 @@ static VALUE
ossl_ssl_connect(VALUE self)
{
ossl_ssl_setup(self);
-
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", Qfalse);
+ return ossl_start_ssl(self, SSL_connect, "SSL_connect", 0);
}
/*
* call-seq:
- * ssl.connect_nonblock([options]) => self
+ * ssl.connect_nonblock => self
*
* Initiates the SSL/TLS handshake as a client in non-blocking manner.
*
@@ -1737,20 +1323,12 @@ ossl_ssl_connect(VALUE self)
* retry
* end
*
- * By specifying a keyword argument _exception_ to +false+, you can 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(int argc, VALUE *argv, VALUE self)
+ossl_ssl_connect_nonblock(VALUE self)
{
- VALUE opts;
- rb_scan_args(argc, argv, "0:", &opts);
-
ossl_ssl_setup(self);
-
- return ossl_start_ssl(self, SSL_connect, "SSL_connect", opts);
+ return ossl_start_ssl(self, SSL_connect, "SSL_connect", 1);
}
/*
@@ -1764,13 +1342,12 @@ static VALUE
ossl_ssl_accept(VALUE self)
{
ossl_ssl_setup(self);
-
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", Qfalse);
+ return ossl_start_ssl(self, SSL_accept, "SSL_accept", 0);
}
/*
* call-seq:
- * ssl.accept_nonblock([options]) => self
+ * ssl.accept_nonblock => self
*
* Initiates the SSL/TLS handshake as a server in non-blocking manner.
*
@@ -1785,20 +1362,12 @@ ossl_ssl_accept(VALUE self)
* retry
* end
*
- * By specifying a keyword argument _exception_ to +false+, you can 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(int argc, VALUE *argv, VALUE self)
+ossl_ssl_accept_nonblock(VALUE self)
{
- VALUE opts;
-
- rb_scan_args(argc, argv, "0:", &opts);
ossl_ssl_setup(self);
-
- return ossl_start_ssl(self, SSL_accept, "SSL_accept", opts);
+ return ossl_start_ssl(self, SSL_accept, "SSL_accept", 1);
}
static VALUE
@@ -1806,86 +1375,73 @@ 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 io, opts = Qnil;
+ VALUE opts = Qnil;
- if (nonblock) {
- rb_scan_args(argc, argv, "11:", &len, &str, &opts);
- } else {
- rb_scan_args(argc, argv, "11", &len, &str);
- }
+ rb_scan_args(argc, argv, "11:", &len, &str, &opts);
+
+ if (!NIL_P(opts) && Qfalse == rb_hash_aref(opts, sym_exception))
+ no_exception = 1;
ilen = NUM2INT(len);
- if (NIL_P(str))
- str = rb_str_new(0, ilen);
- else {
- StringValue(str);
- if (RSTRING_LEN(str) >= ilen)
- rb_str_modify(str);
- else
- rb_str_modify_expand(str, ilen - RSTRING_LEN(str));
+ if(NIL_P(str)) str = rb_str_new(0, ilen);
+ else{
+ StringValue(str);
+ rb_str_modify(str);
+ rb_str_resize(str, ilen);
}
- OBJ_TAINT(str);
- rb_str_set_len(str, 0);
- if (ilen == 0)
- return str;
-
- GetSSL(self, ssl);
- io = rb_attr_get(self, id_i_io);
- GetOpenFile(io, fptr);
- if (ssl_started(ssl)) {
+ if(ilen == 0) return str;
+
+ Data_Get_Struct(self, SSL, ssl);
+ GetOpenFile(ossl_ssl_get_io(self), fptr);
+ if (ssl) {
+ if(!nonblock && SSL_pending(ssl) <= 0)
+ rb_thread_wait_fd(FPTR_TO_FD(fptr));
for (;;){
- nread = SSL_read(ssl, RSTRING_PTR(str), ilen);
+ nread = SSL_read(ssl, RSTRING_PTR(str), RSTRING_LENINT(str));
switch(ssl_get_error(ssl, nread)){
case SSL_ERROR_NONE:
goto end;
case SSL_ERROR_ZERO_RETURN:
- if (no_exception_p(opts)) { return Qnil; }
+ if (no_exception) { return Qnil; }
rb_eof_error();
case SSL_ERROR_WANT_WRITE:
- if (no_exception_p(opts)) { return sym_wait_writable; }
+ if (no_exception) { return ID2SYM(rb_intern("wait_writable")); }
write_would_block(nonblock);
- rb_io_wait_writable(fptr->fd);
+ rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- if (no_exception_p(opts)) { return sym_wait_readable; }
+ if (no_exception) { return ID2SYM(rb_intern("wait_readable")); }
read_would_block(nonblock);
- rb_io_wait_readable(fptr->fd);
+ rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
- if (!ERR_peek_error()) {
- if (errno)
- rb_sys_fail(0);
- else {
- /*
- * The underlying BIO returned 0. This is actually a
- * protocol error. But unfortunately, not all
- * implementations cleanly shutdown the TLS connection
- * but just shutdown/close the TCP connection. So report
- * EOF for now...
- */
- if (no_exception_p(opts)) { return Qnil; }
- rb_eof_error();
- }
+ if(ERR_peek_error() == 0 && nread == 0) {
+ if (no_exception) { return Qnil; }
+ rb_eof_error();
}
+ rb_sys_fail(0);
default:
ossl_raise(eSSLError, "SSL_read");
}
}
}
else {
- ID meth = nonblock ? rb_intern("read_nonblock") : rb_intern("sysread");
-
- rb_warning("SSL session is not started yet.");
- if (nonblock)
- return rb_funcall(io, meth, 3, len, str, opts);
- else
- return rb_funcall(io, meth, 2, len, str);
+ ID meth = nonblock ? rb_intern("read_nonblock") : rb_intern("sysread");
+ rb_warning("SSL session is not started yet.");
+ 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:
rb_str_set_len(str, nread);
+ OBJ_TAINT(str);
+
return str;
}
@@ -1894,7 +1450,7 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
* ssl.sysread(length) => string
* ssl.sysread(length, buffer) => buffer
*
- * Reads _length_ bytes from the SSL connection. If a pre-allocated _buffer_
+ * Reads +length+ bytes from the SSL connection. If a pre-allocated +buffer+
* is provided the data will be written into it.
*/
static VALUE
@@ -1913,7 +1469,7 @@ ossl_ssl_read(int argc, VALUE *argv, VALUE self)
* block. If "exception: false" is passed, this method returns a symbol of
* :wait_readable, :wait_writable, or nil, rather than raising an exception.
*
- * Reads _length_ bytes from the SSL connection. If a pre-allocated _buffer_
+ * Reads +length+ bytes from the SSL connection. If a pre-allocated +buffer+
* is provided the data will be written into it.
*/
static VALUE
@@ -1923,39 +1479,31 @@ ossl_ssl_read_nonblock(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
+ossl_ssl_write_internal(VALUE self, VALUE str, int nonblock, int no_exception)
{
SSL *ssl;
int nwrite = 0;
rb_io_t *fptr;
- int nonblock = opts != Qfalse;
- VALUE io;
StringValue(str);
- GetSSL(self, ssl);
- io = rb_attr_get(self, id_i_io);
- GetOpenFile(io, fptr);
- if (ssl_started(ssl)) {
- for (;;){
- int num = RSTRING_LENINT(str);
+ Data_Get_Struct(self, SSL, ssl);
+ GetOpenFile(ossl_ssl_get_io(self), fptr);
- /* SSL_write(3ssl) manpage states num == 0 is undefined */
- if (num == 0)
- goto end;
-
- nwrite = SSL_write(ssl, RSTRING_PTR(str), num);
+ if (ssl) {
+ for (;;){
+ nwrite = SSL_write(ssl, RSTRING_PTR(str), RSTRING_LENINT(str));
switch(ssl_get_error(ssl, nwrite)){
case SSL_ERROR_NONE:
goto end;
case SSL_ERROR_WANT_WRITE:
- if (no_exception_p(opts)) { return sym_wait_writable; }
+ if (no_exception) { return ID2SYM(rb_intern("wait_writable")); }
write_would_block(nonblock);
- rb_io_wait_writable(fptr->fd);
+ rb_io_wait_writable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_WANT_READ:
- if (no_exception_p(opts)) { return sym_wait_readable; }
+ if (no_exception) { return ID2SYM(rb_intern("wait_readable")); }
read_would_block(nonblock);
- rb_io_wait_readable(fptr->fd);
+ rb_io_wait_readable(FPTR_TO_FD(fptr));
continue;
case SSL_ERROR_SYSCALL:
if (errno) rb_sys_fail(0);
@@ -1965,14 +1513,9 @@ ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
}
}
else {
- ID meth = nonblock ?
- rb_intern("write_nonblock") : rb_intern("syswrite");
-
- rb_warning("SSL session is not started yet.");
- if (nonblock)
- return rb_funcall(io, meth, 2, str, opts);
- else
- return rb_funcall(io, meth, 1, str);
+ ID id_syswrite = rb_intern("syswrite");
+ rb_warning("SSL session is not started yet.");
+ return rb_funcall(ossl_ssl_get_io(self), id_syswrite, 1, str);
}
end:
@@ -1983,60 +1526,64 @@ ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
* call-seq:
* ssl.syswrite(string) => Integer
*
- * Writes _string_ to the SSL connection.
+ * Writes +string+ to the SSL connection.
*/
static VALUE
ossl_ssl_write(VALUE self, VALUE str)
{
- return ossl_ssl_write_internal(self, str, Qfalse);
+ return ossl_ssl_write_internal(self, str, 0, 0);
}
/*
* call-seq:
* ssl.syswrite_nonblock(string) => Integer
*
- * Writes _string_ to the SSL connection in a non-blocking manner. Raises an
+ * Writes +string+ to the SSL connection in a non-blocking manner. Raises an
* SSLError if writing would block.
*/
static VALUE
ossl_ssl_write_nonblock(int argc, VALUE *argv, VALUE self)
{
- VALUE str, opts;
+ VALUE str;
+ VALUE opts = Qnil;
+ int no_exception = 0;
rb_scan_args(argc, argv, "1:", &str, &opts);
- return ossl_ssl_write_internal(self, 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);
}
/*
* call-seq:
- * ssl.stop => nil
+ * ssl.sysclose => nil
*
- * Sends "close notify" to the peer and tries to shut down the SSL connection
- * gracefully.
+ * Shuts down the SSL connection and prepares it for another connection.
*/
static VALUE
-ossl_ssl_stop(VALUE self)
+ossl_ssl_close(VALUE self)
{
SSL *ssl;
- int ret;
+ VALUE io;
- GetSSL(self, ssl);
- if (!ssl_started(ssl))
- return Qnil;
- ret = SSL_shutdown(ssl);
- if (ret == 1) /* Have already received close_notify */
- return Qnil;
- if (ret == 0) /* Sent close_notify, but we don't wait for reply */
- return Qnil;
+ /* ossl_ssl_data_get_struct() is not usable here because it may return
+ * from this function; */
+
+ Data_Get_Struct(self, SSL, ssl);
+
+ io = ossl_ssl_get_io(self);
+ if (!RTEST(rb_funcall(io, rb_intern("closed?"), 0))) {
+ if (ssl) {
+ 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);
+ }
- /*
- * XXX: Something happened. Possibly it failed because the underlying socket
- * is not writable/readable, since it is in non-blocking mode. We should do
- * some proper error handling using SSL_get_error() and maybe retry, but we
- * can't block here. Give up for now.
- */
- ossl_clear_error();
return Qnil;
}
@@ -2052,7 +1599,7 @@ ossl_ssl_get_cert(VALUE self)
SSL *ssl;
X509 *cert = NULL;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
/*
* Is this OpenSSL bug? Should add a ref?
@@ -2079,7 +1626,7 @@ ossl_ssl_get_peer_cert(VALUE self)
X509 *cert = NULL;
VALUE obj;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
cert = SSL_get_peer_certificate(ssl); /* Adds a ref => Safe to FREE. */
@@ -2107,7 +1654,7 @@ ossl_ssl_get_peer_cert_chain(VALUE self)
VALUE ary;
int i, num;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
chain = SSL_get_peer_cert_chain(ssl);
if(!chain) return Qnil;
@@ -2133,35 +1680,35 @@ ossl_ssl_get_version(VALUE self)
{
SSL *ssl;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
return rb_str_new2(SSL_get_version(ssl));
}
/*
- * call-seq:
- * ssl.cipher -> nil or [name, version, bits, alg_bits]
- *
- * Returns the cipher suite actually used in the current session, or nil if
- * no session has been established.
- */
+* call-seq:
+* ssl.cipher => [name, version, bits, alg_bits]
+*
+* The cipher being used for the current connection
+*/
static VALUE
ossl_ssl_get_cipher(VALUE self)
{
SSL *ssl;
- const SSL_CIPHER *cipher;
+ SSL_CIPHER *cipher;
+
+ ossl_ssl_data_get_struct(self, ssl);
+
+ cipher = (SSL_CIPHER *)SSL_get_current_cipher(ssl);
- GetSSL(self, ssl);
- cipher = SSL_get_current_cipher(ssl);
- return cipher ? ossl_ssl_cipher_to_ary(cipher) : Qnil;
+ return ossl_ssl_cipher_to_ary(cipher);
}
/*
* call-seq:
* ssl.state => string
*
- * A description of the current connection state. This is for diagnostic
- * purposes only.
+ * A description of the current connection state.
*/
static VALUE
ossl_ssl_get_state(VALUE self)
@@ -2169,7 +1716,7 @@ ossl_ssl_get_state(VALUE self)
SSL *ssl;
VALUE ret;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
ret = rb_str_new2(SSL_state_string(ssl));
if (ruby_verbose) {
@@ -2183,14 +1730,14 @@ ossl_ssl_get_state(VALUE self)
* call-seq:
* ssl.pending => Integer
*
- * The number of bytes that are immediately available for reading.
+ * The number of bytes that are immediately available for reading
*/
static VALUE
ossl_ssl_pending(VALUE self)
{
SSL *ssl;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
return INT2NUM(SSL_pending(ssl));
}
@@ -2199,16 +1746,22 @@ ossl_ssl_pending(VALUE self)
* call-seq:
* ssl.session_reused? -> true | false
*
- * Returns +true+ if a reused session was negotiated during the handshake.
+ * Returns true if a reused session was negotiated during the handshake.
*/
static VALUE
ossl_ssl_session_reused(VALUE self)
{
SSL *ssl;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
- return SSL_session_reused(ssl) ? Qtrue : Qfalse;
+ switch(SSL_session_reused(ssl)) {
+ case 1: return Qtrue;
+ case 0: return Qfalse;
+ default: ossl_raise(eSSLError, "SSL_session_reused");
+ }
+
+ UNREACHABLE;
}
/*
@@ -2223,8 +1776,12 @@ ossl_ssl_set_session(VALUE self, VALUE arg1)
SSL *ssl;
SSL_SESSION *sess;
- GetSSL(self, ssl);
- GetSSLSession(arg1, sess);
+/* why is ossl_ssl_setup delayed? */
+ ossl_ssl_setup(self);
+
+ ossl_ssl_data_get_struct(self, ssl);
+
+ SafeGetSSLSession(arg1, sess);
if (SSL_set_session(ssl, sess) != 1)
ossl_raise(eSSLError, "SSL_set_session");
@@ -2234,33 +1791,6 @@ ossl_ssl_set_session(VALUE self, VALUE arg1)
/*
* call-seq:
- * ssl.hostname = hostname -> hostname
- *
- * Sets the server hostname used for SNI. This needs to be set before
- * SSLSocket#connect.
- */
-static VALUE
-ossl_ssl_set_hostname(VALUE self, VALUE arg)
-{
- SSL *ssl;
- char *hostname = NULL;
-
- GetSSL(self, ssl);
-
- if (!NIL_P(arg))
- hostname = StringValueCStr(arg);
-
- if (!SSL_set_tlsext_host_name(ssl, hostname))
- ossl_raise(eSSLError, NULL);
-
- /* for SSLSocket#hostname */
- rb_ivar_set(self, id_i_hostname, arg);
-
- return arg;
-}
-
-/*
- * call-seq:
* ssl.verify_result => Integer
*
* Returns the result of the peer certificates verification. See verify(1)
@@ -2273,9 +1803,9 @@ ossl_ssl_get_verify_result(VALUE self)
{
SSL *ssl;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
- return INT2NUM(SSL_get_verify_result(ssl));
+ return INT2FIX(SSL_get_verify_result(ssl));
}
/*
@@ -2295,16 +1825,16 @@ ossl_ssl_get_client_ca_list(VALUE self)
SSL *ssl;
STACK_OF(X509_NAME) *ca;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
ca = SSL_get_client_CA_list(ssl);
return ossl_x509name_sk2ary(ca);
}
-# ifndef OPENSSL_NO_NEXTPROTONEG
+# ifdef HAVE_OPENSSL_NPN_NEGOTIATED
/*
* call-seq:
- * ssl.npn_protocol => String | nil
+ * ssl.npn_protocol => String
*
* Returns the protocol string that was finally selected by the client
* during the handshake.
@@ -2316,7 +1846,7 @@ ossl_ssl_npn_protocol(VALUE self)
const unsigned char *out;
unsigned int outlen;
- GetSSL(self, ssl);
+ ossl_ssl_data_get_struct(self, ssl);
SSL_get0_next_proto_negotiated(ssl, &out, &outlen);
if (!outlen)
@@ -2325,82 +1855,27 @@ 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 | nil
- *
- * Returns the ALPN protocol string that was finally selected by the server
- * during the handshake.
- */
-static VALUE
-ossl_ssl_alpn_protocol(VALUE self)
-{
- SSL *ssl;
- const unsigned char *out;
- unsigned int outlen;
-
- GetSSL(self, ssl);
-
- SSL_get0_alpn_selected(ssl, &out, &outlen);
- if (!outlen)
- return Qnil;
- else
- return rb_str_new((const char *) out, outlen);
-}
-# endif
-
-# ifdef HAVE_SSL_GET_SERVER_TMP_KEY
-/*
- * call-seq:
- * ssl.tmp_key => PKey or nil
- *
- * Returns the ephemeral key used in case of forward secrecy cipher.
- */
-static VALUE
-ossl_ssl_tmp_key(VALUE self)
-{
- SSL *ssl;
- EVP_PKEY *key;
-
- GetSSL(self, ssl);
- if (!SSL_get_server_tmp_key(ssl, &key))
- return Qnil;
- return ossl_pkey_new(key);
-}
-# endif /* defined(HAVE_SSL_GET_SERVER_TMP_KEY) */
#endif /* !defined(OPENSSL_NO_SOCK) */
-#undef rb_intern
-#define rb_intern(s) rb_intern_const(s)
void
-Init_ossl_ssl(void)
+Init_ossl_ssl()
{
+ int i;
+ VALUE ary;
+
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- rb_mWaitReadable = rb_define_module_under(rb_cIO, "WaitReadable");
- rb_mWaitWritable = rb_define_module_under(rb_cIO, "WaitWritable");
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif
- id_call = rb_intern("call");
- ID_callback_state = rb_intern("callback_state");
-
- ossl_ssl_ex_vcb_idx = SSL_get_ex_new_index(0, (void *)"ossl_ssl_ex_vcb_idx", 0, 0, 0);
- if (ossl_ssl_ex_vcb_idx < 0)
- ossl_raise(rb_eRuntimeError, "SSL_get_ex_new_index");
- ossl_ssl_ex_ptr_idx = SSL_get_ex_new_index(0, (void *)"ossl_ssl_ex_ptr_idx", 0, 0, 0);
- if (ossl_ssl_ex_ptr_idx < 0)
- ossl_raise(rb_eRuntimeError, "SSL_get_ex_new_index");
- ossl_sslctx_ex_ptr_idx = SSL_CTX_get_ex_new_index(0, (void *)"ossl_sslctx_ex_ptr_idx", 0, 0, 0);
- if (ossl_sslctx_ex_ptr_idx < 0)
- ossl_raise(rb_eRuntimeError, "SSL_CTX_get_ex_new_index");
-#if !defined(HAVE_X509_STORE_UP_REF)
- ossl_sslctx_ex_store_p = SSL_CTX_get_ex_new_index(0, (void *)"ossl_sslctx_ex_store_p", 0, 0, 0);
- if (ossl_sslctx_ex_store_p < 0)
- ossl_raise(rb_eRuntimeError, "SSL_CTX_get_ex_new_index");
-#endif
+ ID_callback_state = rb_intern("@callback_state");
+
+ 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
*
@@ -2410,17 +1885,6 @@ Init_ossl_ssl(void)
* 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.
@@ -2441,24 +1905,22 @@ Init_ossl_ssl(void)
*
* All attributes must be set before creating an SSLSocket as the
* SSLContext will be frozen afterward.
+ *
+ * The following attributes are available but don't show up in rdoc:
+ * * ssl_version, cert, key, client_ca, ca_file, ca_path, timeout,
+ * * verify_mode, verify_depth client_cert_cb, tmp_dh_callback,
+ * * session_id_context, session_add_cb, session_new_cb, session_remove_cb
*/
cSSLContext = rb_define_class_under(mSSL, "SSLContext", rb_cObject);
rb_define_alloc_func(cSSLContext, ossl_sslctx_s_alloc);
- rb_undef_method(cSSLContext, "initialize_copy");
/*
* Context certificate
- *
- * The _cert_, _key_, and _extra_chain_cert_ attributes are deprecated.
- * It is recommended to use #add_certificate instead.
*/
rb_attr(cSSLContext, rb_intern("cert"), 1, 1, Qfalse);
/*
* Context private key
- *
- * The _cert_, _key_, and _extra_chain_cert_ attributes are deprecated.
- * It is recommended to use #add_certificate instead.
*/
rb_attr(cSSLContext, rb_intern("key"), 1, 1, Qfalse);
@@ -2480,7 +1942,7 @@ Init_ossl_ssl(void)
rb_attr(cSSLContext, rb_intern("ca_path"), 1, 1, Qfalse);
/*
- * Maximum session lifetime in seconds.
+ * Maximum session lifetime.
*/
rb_attr(cSSLContext, rb_intern("timeout"), 1, 1, Qfalse);
@@ -2489,11 +1951,6 @@ Init_ossl_ssl(void)
*
* Valid modes are VERIFY_NONE, VERIFY_PEER, VERIFY_CLIENT_ONCE,
* VERIFY_FAIL_IF_NO_PEER_CERT and defined on OpenSSL::SSL
- *
- * The default mode is VERIFY_NONE, which does not perform any verification
- * at all.
- *
- * See SSL_CTX_set_verify(3) for details.
*/
rb_attr(cSSLContext, rb_intern("verify_mode"), 1, 1, Qfalse);
@@ -2506,35 +1963,28 @@ Init_ossl_ssl(void)
* A callback for additional certificate verification. The callback is
* invoked for each certificate in the chain.
*
- * The callback is invoked with two values. _preverify_ok_ indicates
- * indicates if the verification was passed (+true+) or not (+false+).
- * _store_context_ is an OpenSSL::X509::StoreContext containing the
+ * The callback is invoked with two values. +preverify_ok+ indicates
+ * indicates if the verification was passed (true) or not (false).
+ * +store_context+ is an OpenSSL::X509::StoreContext containing the
* context used for certificate verification.
*
- * If the callback returns +false+, the chain verification is immediately
- * stopped and a bad_certificate alert is then sent.
+ * If the callback returns false verification is stopped.
*/
rb_attr(cSSLContext, rb_intern("verify_callback"), 1, 1, Qfalse);
/*
- * Whether to check the server certificate is valid for the hostname.
- *
- * In order to make this work, verify_mode must be set to VERIFY_PEER and
- * the server hostname must be given by OpenSSL::SSL::SSLSocket#hostname=.
+ * Sets various OpenSSL options.
*/
- rb_attr(cSSLContext, rb_intern("verify_hostname"), 1, 1, Qfalse);
+ rb_attr(cSSLContext, rb_intern("options"), 1, 1, Qfalse);
/*
- * An OpenSSL::X509::Store used for certificate verification.
+ * An OpenSSL::X509::Store used for certificate verification
*/
rb_attr(cSSLContext, rb_intern("cert_store"), 1, 1, Qfalse);
/*
* An Array of extra X509 certificates to be added to the certificate
* chain.
- *
- * The _cert_, _key_, and _extra_chain_cert_ attributes are deprecated.
- * It is recommended to use #add_certificate instead.
*/
rb_attr(cSSLContext, rb_intern("extra_chain_cert"), 1, 1, Qfalse);
@@ -2548,19 +1998,17 @@ Init_ossl_ssl(void)
*/
rb_attr(cSSLContext, rb_intern("client_cert_cb"), 1, 1, Qfalse);
-#if !defined(OPENSSL_NO_EC) && defined(HAVE_SSL_CTX_SET_TMP_ECDH_CALLBACK)
/*
- * A callback invoked when ECDH parameters are required.
+ * 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 is deprecated. This does not work with recent versions of
- * OpenSSL. Use OpenSSL::SSL::SSLContext#ecdh_curves= instead.
+ * The callback must return an OpenSSL::PKey::DH instance of the correct
+ * key length.
*/
- rb_attr(cSSLContext, rb_intern("tmp_ecdh_callback"), 1, 1, Qfalse);
-#endif
+ rb_attr(cSSLContext, rb_intern("tmp_dh_callback"), 1, 1, Qfalse);
/*
* Sets the context in which a session can be reused. This allows
@@ -2581,7 +2029,7 @@ Init_ossl_ssl(void)
/*
* A callback invoked when a new session was negotiated.
*
- * The callback is invoked with an SSLSocket. If +false+ is returned the
+ * The callback is invoked with an SSLSocket. If false is returned the
* session will be removed from the internal cache.
*/
rb_attr(cSSLContext, rb_intern("session_new_cb"), 1, 1, Qfalse);
@@ -2590,15 +2038,19 @@ Init_ossl_ssl(void)
* A callback invoked when a session is removed from the internal cache.
*
* The callback is invoked with an SSLContext and a Session.
- *
- * IMPORTANT NOTE: It is currently not possible to use this safely in a
- * multi-threaded application. The callback is called inside a global lock
- * and it can randomly cause deadlock on Ruby thread switching.
*/
rb_attr(cSSLContext, rb_intern("session_remove_cb"), 1, 1, Qfalse);
- rb_define_const(mSSLExtConfig, "HAVE_TLSEXT_HOST_NAME", Qtrue);
-
+#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);
+#endif
/*
* A callback invoked whenever a new handshake is initiated. May be used
* to disable renegotiation entirely.
@@ -2621,7 +2073,7 @@ Init_ossl_ssl(void)
* end
*/
rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);
-#ifndef OPENSSL_NO_NEXTPROTONEG
+#ifdef HAVE_OPENSSL_NPN_NEGOTIATED
/*
* An Enumerable of Strings. Each String represents a protocol to be
* advertised as the list of supported protocols for Next Protocol
@@ -2646,81 +2098,41 @@ Init_ossl_ssl(void)
* === Example
*
* ctx.npn_select_cb = lambda do |protocols|
- * # inspect the protocols and select one
+ * #inspect the protocols and select one
* protocols.first
* end
*/
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.2 and higher. Has no
- * effect on the server side. If not set explicitly, the ALPN extension will
- * not be included 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 callback must return 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 server - any protocols
- * advertised by the client 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_private_method(cSSLContext, "set_minmax_proto_version",
- ossl_sslctx_set_minmax_proto_version, 2);
+ 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);
- rb_define_method(cSSLContext, "ecdh_curves=", ossl_sslctx_set_ecdh_curves, 1);
- rb_define_method(cSSLContext, "security_level", ossl_sslctx_get_security_level, 0);
- rb_define_method(cSSLContext, "security_level=", ossl_sslctx_set_security_level, 1);
-#ifdef SSL_MODE_SEND_FALLBACK_SCSV
- rb_define_method(cSSLContext, "enable_fallback_scsv", ossl_sslctx_enable_fallback_scsv, 0);
-#endif
- rb_define_method(cSSLContext, "add_certificate", ossl_sslctx_add_certificate, -1);
rb_define_method(cSSLContext, "setup", ossl_sslctx_setup, 0);
- rb_define_alias(cSSLContext, "freeze", "setup");
/*
* No session caching for client or server
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_OFF", LONG2NUM(SSL_SESS_CACHE_OFF));
+ rb_define_const(cSSLContext, "SESSION_CACHE_OFF", LONG2FIX(SSL_SESS_CACHE_OFF));
/*
* Client sessions are added to the session cache
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_CLIENT", LONG2NUM(SSL_SESS_CACHE_CLIENT)); /* doesn't actually do anything in 0.9.8e */
+ rb_define_const(cSSLContext, "SESSION_CACHE_CLIENT", LONG2FIX(SSL_SESS_CACHE_CLIENT)); /* doesn't actually do anything in 0.9.8e */
/*
* Server sessions are added to the session cache
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_SERVER", LONG2NUM(SSL_SESS_CACHE_SERVER));
+ rb_define_const(cSSLContext, "SESSION_CACHE_SERVER", LONG2FIX(SSL_SESS_CACHE_SERVER));
/*
* Both client and server sessions are added to the session cache
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_BOTH", LONG2NUM(SSL_SESS_CACHE_BOTH)); /* no different than CACHE_SERVER in 0.9.8e */
+ rb_define_const(cSSLContext, "SESSION_CACHE_BOTH", LONG2FIX(SSL_SESS_CACHE_BOTH)); /* no different than CACHE_SERVER in 0.9.8e */
/*
* Normally the session cache is checked for expired sessions every 255
@@ -2728,7 +2140,7 @@ Init_ossl_ssl(void)
* the automatic flushing may be disabled and #flush_sessions can be
* called explicitly.
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_NO_AUTO_CLEAR", LONG2NUM(SSL_SESS_CACHE_NO_AUTO_CLEAR));
+ rb_define_const(cSSLContext, "SESSION_CACHE_NO_AUTO_CLEAR", LONG2FIX(SSL_SESS_CACHE_NO_AUTO_CLEAR));
/*
* Always perform external lookups of sessions even if they are in the
@@ -2736,18 +2148,18 @@ Init_ossl_ssl(void)
*
* This flag has no effect on clients
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL_LOOKUP", LONG2NUM(SSL_SESS_CACHE_NO_INTERNAL_LOOKUP));
+ rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL_LOOKUP", LONG2FIX(SSL_SESS_CACHE_NO_INTERNAL_LOOKUP));
/*
* Never automatically store sessions in the internal store.
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL_STORE", LONG2NUM(SSL_SESS_CACHE_NO_INTERNAL_STORE));
+ rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL_STORE", LONG2FIX(SSL_SESS_CACHE_NO_INTERNAL_STORE));
/*
* Enables both SESSION_CACHE_NO_INTERNAL_LOOKUP and
* SESSION_CACHE_NO_INTERNAL_STORE.
*/
- rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL", LONG2NUM(SSL_SESS_CACHE_NO_INTERNAL));
+ rb_define_const(cSSLContext, "SESSION_CACHE_NO_INTERNAL", LONG2FIX(SSL_SESS_CACHE_NO_INTERNAL));
rb_define_method(cSSLContext, "session_add", ossl_sslctx_session_add, 1);
rb_define_method(cSSLContext, "session_remove", ossl_sslctx_session_remove, 1);
@@ -2757,30 +2169,42 @@ Init_ossl_ssl(void)
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++) {
+ rb_ary_push(ary, ID2SYM(rb_intern(ossl_ssl_method_tab[i].name)));
+ }
+ rb_obj_freeze(ary);
+ /* The list of available SSL/TLS methods */
+ rb_define_const(cSSLContext, "METHODS", ary);
/*
* Document-class: OpenSSL::SSL::SSLSocket
+ *
+ * The following attributes are available but don't show up in rdoc.
+ * * io, context, sync_close
+ *
*/
cSSLSocket = rb_define_class_under(mSSL, "SSLSocket", rb_cObject);
#ifdef OPENSSL_NO_SOCK
- rb_define_const(mSSLExtConfig, "OPENSSL_NO_SOCK", Qtrue);
- rb_define_method(cSSLSocket, "initialize", rb_f_notimplement, -1);
+ rb_define_method(cSSLSocket, "initialize", rb_notimplement, -1);
#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_undef_method(cSSLSocket, "initialize_copy");
rb_define_method(cSSLSocket, "connect", ossl_ssl_connect, 0);
- rb_define_method(cSSLSocket, "connect_nonblock", ossl_ssl_connect_nonblock, -1);
+ rb_define_method(cSSLSocket, "connect_nonblock", ossl_ssl_connect_nonblock, 0);
rb_define_method(cSSLSocket, "accept", ossl_ssl_accept, 0);
- rb_define_method(cSSLSocket, "accept_nonblock", ossl_ssl_accept_nonblock, -1);
+ rb_define_method(cSSLSocket, "accept_nonblock", ossl_ssl_accept_nonblock, 0);
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_private_method(cSSLSocket, "stop", ossl_ssl_stop, 0);
+ rb_define_method(cSSLSocket, "sysclose", ossl_ssl_close, 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);
@@ -2793,158 +2217,65 @@ Init_ossl_ssl(void)
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);
- /* #hostname is defined in lib/openssl/ssl.rb */
- rb_define_method(cSSLSocket, "hostname=", ossl_ssl_set_hostname, 1);
-# ifdef HAVE_SSL_GET_SERVER_TMP_KEY
- rb_define_method(cSSLSocket, "tmp_key", ossl_ssl_tmp_key, 0);
-# endif
-# ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
- rb_define_method(cSSLSocket, "alpn_protocol", ossl_ssl_alpn_protocol, 0);
-# endif
-# ifndef OPENSSL_NO_NEXTPROTONEG
+# ifdef HAVE_OPENSSL_NPN_NEGOTIATED
rb_define_method(cSSLSocket, "npn_protocol", ossl_ssl_npn_protocol, 0);
# endif
#endif
- rb_define_const(mSSL, "VERIFY_NONE", INT2NUM(SSL_VERIFY_NONE));
- rb_define_const(mSSL, "VERIFY_PEER", INT2NUM(SSL_VERIFY_PEER));
- rb_define_const(mSSL, "VERIFY_FAIL_IF_NO_PEER_CERT", INT2NUM(SSL_VERIFY_FAIL_IF_NO_PEER_CERT));
- rb_define_const(mSSL, "VERIFY_CLIENT_ONCE", INT2NUM(SSL_VERIFY_CLIENT_ONCE));
+#define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2NUM(SSL_##x))
- rb_define_const(mSSL, "OP_ALL", ULONG2NUM(SSL_OP_ALL));
- rb_define_const(mSSL, "OP_LEGACY_SERVER_CONNECT", ULONG2NUM(SSL_OP_LEGACY_SERVER_CONNECT));
-#ifdef SSL_OP_TLSEXT_PADDING /* OpenSSL 1.0.1h and OpenSSL 1.0.2 */
- rb_define_const(mSSL, "OP_TLSEXT_PADDING", ULONG2NUM(SSL_OP_TLSEXT_PADDING));
+ ossl_ssl_def_const(VERIFY_NONE);
+ ossl_ssl_def_const(VERIFY_PEER);
+ ossl_ssl_def_const(VERIFY_FAIL_IF_NO_PEER_CERT);
+ ossl_ssl_def_const(VERIFY_CLIENT_ONCE);
+ /* Introduce constants included in OP_ALL. These constants are mostly for
+ * unset some bits in OP_ALL such as;
+ * ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
+ */
+ ossl_ssl_def_const(OP_MICROSOFT_SESS_ID_BUG);
+ ossl_ssl_def_const(OP_NETSCAPE_CHALLENGE_BUG);
+ ossl_ssl_def_const(OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
+ ossl_ssl_def_const(OP_SSLREF2_REUSE_CERT_TYPE_BUG);
+ ossl_ssl_def_const(OP_MICROSOFT_BIG_SSLV3_BUFFER);
+#if defined(SSL_OP_MSIE_SSLV2_RSA_PADDING)
+ ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);
#endif
-#ifdef SSL_OP_SAFARI_ECDHE_ECDSA_BUG /* OpenSSL 1.0.1f and OpenSSL 1.0.2 */
- rb_define_const(mSSL, "OP_SAFARI_ECDHE_ECDSA_BUG", ULONG2NUM(SSL_OP_SAFARI_ECDHE_ECDSA_BUG));
+ ossl_ssl_def_const(OP_SSLEAY_080_CLIENT_DH_BUG);
+ ossl_ssl_def_const(OP_TLS_D5_BUG);
+ ossl_ssl_def_const(OP_TLS_BLOCK_PADDING_BUG);
+ ossl_ssl_def_const(OP_DONT_INSERT_EMPTY_FRAGMENTS);
+ ossl_ssl_def_const(OP_ALL);
+#if defined(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION)
+ ossl_ssl_def_const(OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
#endif
-#ifdef SSL_OP_ALLOW_NO_DHE_KEX /* OpenSSL 1.1.1 */
- rb_define_const(mSSL, "OP_ALLOW_NO_DHE_KEX", ULONG2NUM(SSL_OP_ALLOW_NO_DHE_KEX));
+#if defined(SSL_OP_SINGLE_ECDH_USE)
+ ossl_ssl_def_const(OP_SINGLE_ECDH_USE);
#endif
- rb_define_const(mSSL, "OP_DONT_INSERT_EMPTY_FRAGMENTS", ULONG2NUM(SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
- rb_define_const(mSSL, "OP_NO_TICKET", ULONG2NUM(SSL_OP_NO_TICKET));
- rb_define_const(mSSL, "OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION", ULONG2NUM(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION));
- rb_define_const(mSSL, "OP_NO_COMPRESSION", ULONG2NUM(SSL_OP_NO_COMPRESSION));
- rb_define_const(mSSL, "OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION", ULONG2NUM(SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION));
-#ifdef SSL_OP_NO_ENCRYPT_THEN_MAC /* OpenSSL 1.1.1 */
- rb_define_const(mSSL, "OP_NO_ENCRYPT_THEN_MAC", ULONG2NUM(SSL_OP_NO_ENCRYPT_THEN_MAC));
+ ossl_ssl_def_const(OP_SINGLE_DH_USE);
+ ossl_ssl_def_const(OP_EPHEMERAL_RSA);
+#if defined(SSL_OP_CIPHER_SERVER_PREFERENCE)
+ ossl_ssl_def_const(OP_CIPHER_SERVER_PREFERENCE);
#endif
- rb_define_const(mSSL, "OP_CIPHER_SERVER_PREFERENCE", ULONG2NUM(SSL_OP_CIPHER_SERVER_PREFERENCE));
- rb_define_const(mSSL, "OP_TLS_ROLLBACK_BUG", ULONG2NUM(SSL_OP_TLS_ROLLBACK_BUG));
-#ifdef SSL_OP_NO_RENEGOTIATION /* OpenSSL 1.1.1 */
- rb_define_const(mSSL, "OP_NO_RENEGOTIATION", ULONG2NUM(SSL_OP_NO_RENEGOTIATION));
+ ossl_ssl_def_const(OP_TLS_ROLLBACK_BUG);
+ ossl_ssl_def_const(OP_NO_SSLv2);
+ ossl_ssl_def_const(OP_NO_SSLv3);
+ ossl_ssl_def_const(OP_NO_TLSv1);
+#if defined(SSL_OP_NO_TLSv1_1)
+ ossl_ssl_def_const(OP_NO_TLSv1_1);
#endif
- rb_define_const(mSSL, "OP_CRYPTOPRO_TLSEXT_BUG", ULONG2NUM(SSL_OP_CRYPTOPRO_TLSEXT_BUG));
-
- rb_define_const(mSSL, "OP_NO_SSLv3", ULONG2NUM(SSL_OP_NO_SSLv3));
- rb_define_const(mSSL, "OP_NO_TLSv1", ULONG2NUM(SSL_OP_NO_TLSv1));
- rb_define_const(mSSL, "OP_NO_TLSv1_1", ULONG2NUM(SSL_OP_NO_TLSv1_1));
- rb_define_const(mSSL, "OP_NO_TLSv1_2", ULONG2NUM(SSL_OP_NO_TLSv1_2));
-#ifdef SSL_OP_NO_TLSv1_3 /* OpenSSL 1.1.1 */
- rb_define_const(mSSL, "OP_NO_TLSv1_3", ULONG2NUM(SSL_OP_NO_TLSv1_3));
+#if defined(SSL_OP_NO_TLSv1_2)
+ ossl_ssl_def_const(OP_NO_TLSv1_2);
#endif
-
- /* SSL_OP_* flags for DTLS */
-#if 0
- rb_define_const(mSSL, "OP_NO_QUERY_MTU", ULONG2NUM(SSL_OP_NO_QUERY_MTU));
- rb_define_const(mSSL, "OP_COOKIE_EXCHANGE", ULONG2NUM(SSL_OP_COOKIE_EXCHANGE));
- rb_define_const(mSSL, "OP_CISCO_ANYCONNECT", ULONG2NUM(SSL_OP_CISCO_ANYCONNECT));
+#if defined(SSL_OP_NO_TICKET)
+ ossl_ssl_def_const(OP_NO_TICKET);
#endif
-
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_MICROSOFT_SESS_ID_BUG", ULONG2NUM(SSL_OP_MICROSOFT_SESS_ID_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_NETSCAPE_CHALLENGE_BUG", ULONG2NUM(SSL_OP_NETSCAPE_CHALLENGE_BUG));
- /* Deprecated in OpenSSL 0.9.8q and 1.0.0c. */
- rb_define_const(mSSL, "OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG", ULONG2NUM(SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG));
- /* Deprecated in OpenSSL 1.0.1h and 1.0.2. */
- rb_define_const(mSSL, "OP_SSLREF2_REUSE_CERT_TYPE_BUG", ULONG2NUM(SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_MICROSOFT_BIG_SSLV3_BUFFER", ULONG2NUM(SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER));
- /* Deprecated in OpenSSL 0.9.7h and 0.9.8b. */
- rb_define_const(mSSL, "OP_MSIE_SSLV2_RSA_PADDING", ULONG2NUM(SSL_OP_MSIE_SSLV2_RSA_PADDING));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_SSLEAY_080_CLIENT_DH_BUG", ULONG2NUM(SSL_OP_SSLEAY_080_CLIENT_DH_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_TLS_D5_BUG", ULONG2NUM(SSL_OP_TLS_D5_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_TLS_BLOCK_PADDING_BUG", ULONG2NUM(SSL_OP_TLS_BLOCK_PADDING_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_SINGLE_ECDH_USE", ULONG2NUM(SSL_OP_SINGLE_ECDH_USE));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_SINGLE_DH_USE", ULONG2NUM(SSL_OP_SINGLE_DH_USE));
- /* Deprecated in OpenSSL 1.0.1k and 1.0.2. */
- rb_define_const(mSSL, "OP_EPHEMERAL_RSA", ULONG2NUM(SSL_OP_EPHEMERAL_RSA));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_NO_SSLv2", ULONG2NUM(SSL_OP_NO_SSLv2));
- /* Deprecated in OpenSSL 1.0.1. */
- rb_define_const(mSSL, "OP_PKCS1_CHECK_1", ULONG2NUM(SSL_OP_PKCS1_CHECK_1));
- /* Deprecated in OpenSSL 1.0.1. */
- rb_define_const(mSSL, "OP_PKCS1_CHECK_2", ULONG2NUM(SSL_OP_PKCS1_CHECK_2));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_NETSCAPE_CA_DN_BUG", ULONG2NUM(SSL_OP_NETSCAPE_CA_DN_BUG));
- /* Deprecated in OpenSSL 1.1.0. */
- rb_define_const(mSSL, "OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG", ULONG2NUM(SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG));
-
-
- /*
- * SSL/TLS version constants. Used by SSLContext#min_version= and
- * #max_version=
- */
- /* SSL 2.0 */
- rb_define_const(mSSL, "SSL2_VERSION", INT2NUM(SSL2_VERSION));
- /* SSL 3.0 */
- rb_define_const(mSSL, "SSL3_VERSION", INT2NUM(SSL3_VERSION));
- /* TLS 1.0 */
- rb_define_const(mSSL, "TLS1_VERSION", INT2NUM(TLS1_VERSION));
- /* TLS 1.1 */
- rb_define_const(mSSL, "TLS1_1_VERSION", INT2NUM(TLS1_1_VERSION));
- /* TLS 1.2 */
- rb_define_const(mSSL, "TLS1_2_VERSION", INT2NUM(TLS1_2_VERSION));
-#ifdef TLS1_3_VERSION /* OpenSSL 1.1.1 */
- /* TLS 1.3 */
- rb_define_const(mSSL, "TLS1_3_VERSION", INT2NUM(TLS1_3_VERSION));
+#if defined(SSL_OP_NO_COMPRESSION)
+ ossl_ssl_def_const(OP_NO_COMPRESSION);
#endif
-
+ ossl_ssl_def_const(OP_PKCS1_CHECK_1);
+ ossl_ssl_def_const(OP_PKCS1_CHECK_2);
+ ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG);
+ ossl_ssl_def_const(OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
sym_exception = ID2SYM(rb_intern("exception"));
- sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
- sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
-
- id_tmp_dh_callback = rb_intern("tmp_dh_callback");
- id_tmp_ecdh_callback = rb_intern("tmp_ecdh_callback");
- id_npn_protocols_encoded = rb_intern("npn_protocols_encoded");
-
-#define DefIVarID(name) do \
- id_i_##name = rb_intern("@"#name); while (0)
-
- DefIVarID(cert_store);
- DefIVarID(ca_file);
- DefIVarID(ca_path);
- DefIVarID(verify_mode);
- DefIVarID(verify_depth);
- DefIVarID(verify_callback);
- DefIVarID(client_ca);
- DefIVarID(renegotiation_cb);
- DefIVarID(cert);
- DefIVarID(key);
- DefIVarID(extra_chain_cert);
- DefIVarID(client_cert_cb);
- DefIVarID(tmp_ecdh_callback);
- DefIVarID(timeout);
- DefIVarID(session_id_context);
- DefIVarID(session_get_cb);
- DefIVarID(session_new_cb);
- DefIVarID(session_remove_cb);
- DefIVarID(npn_select_cb);
- DefIVarID(npn_protocols);
- DefIVarID(alpn_protocols);
- DefIVarID(alpn_select_cb);
- DefIVarID(servername_cb);
- DefIVarID(verify_hostname);
-
- DefIVarID(io);
- DefIVarID(context);
- DefIVarID(hostname);
}
diff --git a/ext/openssl/ossl_ssl.h b/ext/openssl/ossl_ssl.h
index 535c56097c..034762fc46 100644
--- a/ext/openssl/ossl_ssl.h
+++ b/ext/openssl/ossl_ssl.h
@@ -1,36 +1,36 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced 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)); \
- if (!(ssl)) { \
- ossl_raise(rb_eRuntimeError, "SSL is not initialized"); \
- } \
-} while (0)
-
#define GetSSLSession(obj, sess) do { \
- TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \
+ Data_Get_Struct((obj), SSL_SESSION, (sess)); \
if (!(sess)) { \
ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
} \
} while (0)
-extern const rb_data_type_t ossl_ssl_type;
-extern const rb_data_type_t ossl_ssl_session_type;
+#define SafeGetSSLSession(obj, sess) do { \
+ OSSL_Check_Kind((obj), cSSLSession); \
+ GetSSLSession((obj), (sess)); \
+} while (0)
+
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 5514087387..a7437caf37 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -4,36 +4,35 @@
#include "ossl.h"
-VALUE cSSLSession;
-static VALUE eSSLSession;
+#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)
-static void
-ossl_ssl_session_free(void *ptr)
-{
- SSL_SESSION_free(ptr);
-}
+#define SafeGetSSLSession(obj, sess) do { \
+ OSSL_Check_Kind((obj), cSSLSession); \
+ GetSSLSession((obj), (sess)); \
+} while (0)
-const rb_data_type_t ossl_ssl_session_type = {
- "OpenSSL/SSL/Session",
- {
- 0, ossl_ssl_session_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
+
+VALUE cSSLSession;
+static VALUE eSSLSession;
static VALUE ossl_ssl_session_alloc(VALUE klass)
{
- return TypedData_Wrap_Struct(klass, &ossl_ssl_session_type, NULL);
+ return Data_Wrap_Struct(klass, 0, SSL_SESSION_free, NULL);
}
/*
* call-seq:
- * Session.new(ssl_socket) -> Session
- * Session.new(string) -> Session
+ * Session.new(SSLSocket | string) => session
*
- * Creates a new Session object from an instance of SSLSocket or DER/PEM encoded
- * String.
- */
+ * === Parameters
+ * +SSLSocket+ is an OpenSSL::SSL::SSLSocket
+ * +string+ must be a DER or PEM encoded Session.
+*/
static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
{
SSL_SESSION *ctx = NULL;
@@ -44,12 +43,12 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
if (rb_obj_is_instance_of(arg1, cSSLSocket)) {
SSL *ssl;
- GetSSL(arg1, ssl);
+ Data_Get_Struct(arg1, SSL, ssl);
- if ((ctx = SSL_get1_session(ssl)) == NULL)
+ if (!ssl || (ctx = SSL_get1_session(ssl)) == NULL)
ossl_raise(eSSLSession, "no session available");
} else {
- BIO *in = ossl_obj2bio(&arg1);
+ BIO *in = ossl_obj2bio(arg1);
ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
@@ -73,56 +72,29 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
return self;
}
-static VALUE
-ossl_ssl_session_initialize_copy(VALUE self, VALUE other)
+#if HAVE_SSL_SESSION_CMP == 0
+int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b)
{
- SSL_SESSION *sess, *sess_other, *sess_new;
-
- rb_check_frozen(self);
- sess = RTYPEDDATA_DATA(self); /* XXX */
- GetSSLSession(other, sess_other);
-
- sess_new = ASN1_dup((i2d_of_void *)i2d_SSL_SESSION, (d2i_of_void *)d2i_SSL_SESSION,
- (char *)sess_other);
- if (!sess_new)
- ossl_raise(eSSLSession, "ASN1_dup");
-
- RTYPEDDATA_DATA(self) = sess_new;
- SSL_SESSION_free(sess);
-
- return self;
-}
-
-static int
-ossl_SSL_SESSION_cmp(const SSL_SESSION *a, const SSL_SESSION *b)
-{
- unsigned int a_len;
- const unsigned char *a_sid = SSL_SESSION_get_id(a, &a_len);
- unsigned int b_len;
- const unsigned char *b_sid = SSL_SESSION_get_id(b, &b_len);
-
- if (SSL_SESSION_get_protocol_version(a) != SSL_SESSION_get_protocol_version(b))
- return 1;
- if (a_len != b_len)
+ if (a->ssl_version != b->ssl_version ||
+ a->session_id_length != b->session_id_length)
return 1;
-
- return CRYPTO_memcmp(a_sid, b_sid, a_len);
+ return memcmp(a->session_id,b-> session_id, a->session_id_length);
}
+#endif
/*
* call-seq:
- * session1 == session2 -> boolean
+ * session1 == session2 -> boolean
*
- * Returns +true+ if the two Session is the same, +false+ if not.
- */
+*/
static VALUE ossl_ssl_session_eq(VALUE val1, VALUE val2)
{
SSL_SESSION *ctx1, *ctx2;
GetSSLSession(val1, ctx1);
- GetSSLSession(val2, ctx2);
+ SafeGetSSLSession(val2, ctx2);
- switch (ossl_SSL_SESSION_cmp(ctx1, ctx2)) {
+ switch (SSL_SESSION_cmp(ctx1, ctx2)) {
case 0: return Qtrue;
default: return Qfalse;
}
@@ -132,50 +104,51 @@ static VALUE ossl_ssl_session_eq(VALUE val1, VALUE val2)
* call-seq:
* session.time -> Time
*
- * Returns the time at which the session was established.
- */
-static VALUE
-ossl_ssl_session_get_time(VALUE self)
+ * Gets start time of the session.
+ *
+*/
+static VALUE ossl_ssl_session_get_time(VALUE self)
{
- SSL_SESSION *ctx;
- long t;
+ SSL_SESSION *ctx;
+ time_t t;
- GetSSLSession(self, ctx);
- t = SSL_SESSION_get_time(ctx);
- if (t == 0)
- return Qnil;
+ GetSSLSession(self, ctx);
- return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
+ t = SSL_SESSION_get_time(ctx);
+
+ if (t == 0)
+ return Qnil;
+
+ return rb_funcall(rb_cTime, rb_intern("at"), 1, TIMET2NUM(t));
}
/*
* call-seq:
- * session.timeout -> Integer
+ * session.timeout -> integer
*
- * Returns the timeout value set for the session, in seconds from the
- * established time.
+ * Gets how long until the session expires in seconds.
*
- */
-static VALUE
-ossl_ssl_session_get_timeout(VALUE self)
+*/
+static VALUE ossl_ssl_session_get_timeout(VALUE self)
{
- SSL_SESSION *ctx;
- long t;
+ SSL_SESSION *ctx;
+ time_t t;
+
+ GetSSLSession(self, ctx);
- GetSSLSession(self, ctx);
- t = SSL_SESSION_get_timeout(ctx);
+ t = SSL_SESSION_get_timeout(ctx);
- return LONG2NUM(t);
+ return TIMET2NUM(t);
}
/*
* call-seq:
- * session.time = time
- * session.time = integer
+ * session.time=(Time) -> Time
+ * session.time=(integer) -> Time
*
* Sets start time of the session. Time resolution is in seconds.
*
- */
+*/
static VALUE ossl_ssl_session_set_time(VALUE self, VALUE time_v)
{
SSL_SESSION *ctx;
@@ -192,10 +165,11 @@ static VALUE ossl_ssl_session_set_time(VALUE self, VALUE time_v)
/*
* call-seq:
- * session.timeout = integer
+ * session.timeout=(integer) -> integer
*
* Sets how long until the session expires in seconds.
- */
+ *
+*/
static VALUE ossl_ssl_session_set_timeout(VALUE self, VALUE time_v)
{
SSL_SESSION *ctx;
@@ -207,9 +181,10 @@ static VALUE ossl_ssl_session_set_timeout(VALUE self, VALUE time_v)
return ossl_ssl_session_get_timeout(self);
}
+#ifdef HAVE_SSL_SESSION_GET_ID
/*
* call-seq:
- * session.id -> String
+ * session.id -> aString
*
* Returns the Session ID.
*/
@@ -225,13 +200,14 @@ static VALUE ossl_ssl_session_get_id(VALUE self)
return rb_str_new((const char *) p, i);
}
+#endif
/*
* call-seq:
- * session.to_der -> String
+ * session.to_der -> aString
*
* Returns an ASN1 encoded String that contains the Session object.
- */
+*/
static VALUE ossl_ssl_session_to_der(VALUE self)
{
SSL_SESSION *ctx;
@@ -257,11 +233,14 @@ static VALUE ossl_ssl_session_to_der(VALUE self)
* session.to_pem -> String
*
* Returns a PEM encoded String that contains the Session object.
- */
+*/
static VALUE ossl_ssl_session_to_pem(VALUE self)
{
SSL_SESSION *ctx;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
+ int i;
GetSSLSession(self, ctx);
@@ -269,13 +248,16 @@ static VALUE ossl_ssl_session_to_pem(VALUE self)
ossl_raise(eSSLSession, "BIO_s_mem()");
}
- if (!PEM_write_bio_SSL_SESSION(out, ctx)) {
+ if (!(i=PEM_write_bio_SSL_SESSION(out, ctx))) {
BIO_free(out);
ossl_raise(eSSLSession, "SSL_SESSION_print()");
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
@@ -283,12 +265,14 @@ static VALUE ossl_ssl_session_to_pem(VALUE self)
* call-seq:
* session.to_text -> String
*
- * Shows everything in the Session object. This is for diagnostic purposes.
- */
+ * Shows everything in the Session object.
+*/
static VALUE ossl_ssl_session_to_text(VALUE self)
{
SSL_SESSION *ctx;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetSSLSession(self, ctx);
@@ -301,23 +285,25 @@ static VALUE ossl_ssl_session_to_text(VALUE self)
ossl_raise(eSSLSession, "SSL_SESSION_print()");
}
- return ossl_membio2str(out);
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
+
+ return str;
}
void Init_ossl_ssl_session(void)
{
#if 0
- mOSSL = rb_define_module("OpenSSL");
- mSSL = rb_define_module_under(mOSSL, "SSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
+ mSSL = rb_define_module_under(mOSSL, "SSL");
#endif
cSSLSession = rb_define_class_under(mSSL, "Session", rb_cObject);
eSSLSession = rb_define_class_under(cSSLSession, "SessionError", eOSSLError);
rb_define_alloc_func(cSSLSession, ossl_ssl_session_alloc);
rb_define_method(cSSLSession, "initialize", ossl_ssl_session_initialize, 1);
- rb_define_method(cSSLSession, "initialize_copy", ossl_ssl_session_initialize_copy, 1);
rb_define_method(cSSLSession, "==", ossl_ssl_session_eq, 1);
@@ -325,7 +311,12 @@ void Init_ossl_ssl_session(void)
rb_define_method(cSSLSession, "time=", ossl_ssl_session_set_time, 1);
rb_define_method(cSSLSession, "timeout", ossl_ssl_session_get_timeout, 0);
rb_define_method(cSSLSession, "timeout=", ossl_ssl_session_set_timeout, 1);
+
+#ifdef HAVE_SSL_SESSION_GET_ID
rb_define_method(cSSLSession, "id", ossl_ssl_session_get_id, 0);
+#else
+ rb_undef_method(cSSLSession, "id");
+#endif
rb_define_method(cSSLSession, "to_der", ossl_ssl_session_to_der, 0);
rb_define_method(cSSLSession, "to_pem", ossl_ssl_session_to_pem, 0);
rb_define_method(cSSLSession, "to_text", ossl_ssl_session_to_text, 0);
diff --git a/ext/openssl/ossl_version.h b/ext/openssl/ossl_version.h
index c162f8c2a8..193ceab089 100644
--- a/ext/openssl/ossl_version.h
+++ b/ext/openssl/ossl_version.h
@@ -1,15 +1,16 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_VERSION_H_)
#define _OSSL_VERSION_H_
-#define OSSL_VERSION "2.1.2"
+#define OSSL_VERSION "1.1.0"
#endif /* _OSSL_VERSION_H_ */
diff --git a/ext/openssl/ossl_x509.c b/ext/openssl/ossl_x509.c
index 8a061b0687..fd1d9b6c7e 100644
--- a/ext/openssl/ossl_x509.c
+++ b/ext/openssl/ossl_x509.c
@@ -1,38 +1,24 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
VALUE mX509;
-#define DefX509Const(x) rb_define_const(mX509, #x, INT2NUM(X509_##x))
+#define DefX509Const(x) rb_define_const(mX509, #x,INT2FIX(X509_##x))
#define DefX509Default(x,i) \
rb_define_const(mX509, "DEFAULT_" #x, rb_str_new2(X509_get_default_##i()))
-ASN1_TIME *
-ossl_x509_time_adjust(ASN1_TIME *s, VALUE time)
-{
- time_t sec;
-
- int off_days;
-
- ossl_time_split(time, &sec, &off_days);
- return X509_time_adj_ex(s, off_days, 0, &sec);
-}
-
void
-Init_ossl_x509(void)
+Init_ossl_x509()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
-#endif
-
mX509 = rb_define_module_under(mOSSL, "X509");
Init_ossl_x509attr();
@@ -78,89 +64,35 @@ Init_ossl_x509(void)
DefX509Const(V_ERR_KEYUSAGE_NO_CERTSIGN);
DefX509Const(V_ERR_APPLICATION_VERIFICATION);
- /* Set by Store#flags= and StoreContext#flags=. Enables CRL checking for the
- * certificate chain leaf. */
+#if defined(X509_V_FLAG_CRL_CHECK)
DefX509Const(V_FLAG_CRL_CHECK);
- /* Set by Store#flags= and StoreContext#flags=. Enables CRL checking for all
- * certificates in the certificate chain */
- DefX509Const(V_FLAG_CRL_CHECK_ALL);
- /* Set by Store#flags= and StoreContext#flags=. Disables critical extension
- * checking. */
- DefX509Const(V_FLAG_IGNORE_CRITICAL);
- /* Set by Store#flags= and StoreContext#flags=. Disables workarounds for
- * broken certificates. */
- DefX509Const(V_FLAG_X509_STRICT);
- /* Set by Store#flags= and StoreContext#flags=. Enables proxy certificate
- * verification. */
- DefX509Const(V_FLAG_ALLOW_PROXY_CERTS);
- /* Set by Store#flags= and StoreContext#flags=. Enables certificate policy
- * constraints checking. */
- DefX509Const(V_FLAG_POLICY_CHECK);
- /* Set by Store#flags= and StoreContext#flags=.
- * Implies V_FLAG_POLICY_CHECK */
- DefX509Const(V_FLAG_EXPLICIT_POLICY);
- /* Set by Store#flags= and StoreContext#flags=.
- * Implies V_FLAG_POLICY_CHECK */
- DefX509Const(V_FLAG_INHIBIT_ANY);
- /* Set by Store#flags= and StoreContext#flags=.
- * Implies V_FLAG_POLICY_CHECK */
- DefX509Const(V_FLAG_INHIBIT_MAP);
- /* Set by Store#flags= and StoreContext#flags=. */
- DefX509Const(V_FLAG_NOTIFY_POLICY);
- /* Set by Store#flags= and StoreContext#flags=. Enables some additional
- * features including support for indirect signed CRLs. */
- DefX509Const(V_FLAG_EXTENDED_CRL_SUPPORT);
- /* Set by Store#flags= and StoreContext#flags=. Uses delta CRLs. If not
- * specified, deltas are ignored. */
- DefX509Const(V_FLAG_USE_DELTAS);
- /* Set by Store#flags= and StoreContext#flags=. Enables checking of the
- * signature of the root self-signed CA. */
- DefX509Const(V_FLAG_CHECK_SS_SIGNATURE);
-#if defined(X509_V_FLAG_TRUSTED_FIRST)
- /* Set by Store#flags= and StoreContext#flags=. When constructing a
- * certificate chain, search the Store first for the issuer certificate.
- * Enabled by default in OpenSSL >= 1.1.0. */
- DefX509Const(V_FLAG_TRUSTED_FIRST);
-#endif
-#if defined(X509_V_FLAG_NO_ALT_CHAINS)
- /* Set by Store#flags= and StoreContext#flags=. Suppresses searching for
- * a alternative chain. No effect in OpenSSL >= 1.1.0. */
- DefX509Const(V_FLAG_NO_ALT_CHAINS);
#endif
-#if defined(X509_V_FLAG_NO_CHECK_TIME)
- /* Set by Store#flags= and StoreContext#flags=. Suppresses checking the
- * validity period of certificates and CRLs. No effect when the current
- * time is explicitly set by Store#time= or StoreContext#time=. */
- DefX509Const(V_FLAG_NO_CHECK_TIME);
+#if defined(X509_V_FLAG_CRL_CHECK_ALL)
+ DefX509Const(V_FLAG_CRL_CHECK_ALL);
#endif
- /* Set by Store#purpose=. SSL/TLS client. */
DefX509Const(PURPOSE_SSL_CLIENT);
- /* Set by Store#purpose=. SSL/TLS server. */
DefX509Const(PURPOSE_SSL_SERVER);
- /* Set by Store#purpose=. Netscape SSL server. */
DefX509Const(PURPOSE_NS_SSL_SERVER);
- /* Set by Store#purpose=. S/MIME signing. */
DefX509Const(PURPOSE_SMIME_SIGN);
- /* Set by Store#purpose=. S/MIME encryption. */
DefX509Const(PURPOSE_SMIME_ENCRYPT);
- /* Set by Store#purpose=. CRL signing */
DefX509Const(PURPOSE_CRL_SIGN);
- /* Set by Store#purpose=. No checks. */
DefX509Const(PURPOSE_ANY);
- /* Set by Store#purpose=. OCSP helper. */
+#if defined(X509_PURPOSE_OCSP_HELPER)
DefX509Const(PURPOSE_OCSP_HELPER);
- /* Set by Store#purpose=. Time stamps signer. */
- DefX509Const(PURPOSE_TIMESTAMP_SIGN);
+#endif
DefX509Const(TRUST_COMPAT);
DefX509Const(TRUST_SSL_CLIENT);
DefX509Const(TRUST_SSL_SERVER);
DefX509Const(TRUST_EMAIL);
DefX509Const(TRUST_OBJECT_SIGN);
+#if defined(X509_TRUST_OCSP_SIGN)
DefX509Const(TRUST_OCSP_SIGN);
+#endif
+#if defined(X509_TRUST_OCSP_REQUEST)
DefX509Const(TRUST_OCSP_REQUEST);
- DefX509Const(TRUST_TSA);
+#endif
DefX509Default(CERT_AREA, cert_area);
DefX509Default(CERT_DIR, cert_dir);
@@ -169,3 +101,4 @@ Init_ossl_x509(void)
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 4fadfa6b82..1a43569073 100644
--- a/ext/openssl/ossl_x509.h
+++ b/ext/openssl/ossl_x509.h
@@ -1,10 +1,11 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_X509_H_)
@@ -15,13 +16,6 @@
*/
extern VALUE mX509;
-/*
- * Converts the VALUE into Integer and set it to the ASN1_TIME. This is a
- * wrapper for X509_time_adj_ex() so passing NULL creates a new ASN1_TIME.
- * Note that the caller must check the NULL return.
- */
-ASN1_TIME *ossl_x509_time_adjust(ASN1_TIME *, VALUE);
-
void Init_ossl_x509(void);
/*
@@ -31,7 +25,7 @@ extern VALUE cX509Attr;
extern VALUE eX509AttrError;
VALUE ossl_x509attr_new(X509_ATTRIBUTE *);
-X509_ATTRIBUTE *GetX509AttrPtr(VALUE);
+X509_ATTRIBUTE *DupX509AttrPtr(VALUE);
void Init_ossl_x509attr(void);
/*
@@ -41,6 +35,7 @@ extern VALUE cX509Cert;
extern VALUE eX509CertError;
VALUE ossl_x509_new(X509 *);
+VALUE ossl_x509_new_from_file(VALUE);
X509 *GetX509CertPtr(VALUE);
X509 *DupX509CertPtr(VALUE);
void Init_ossl_x509cert(void);
@@ -53,6 +48,7 @@ extern VALUE eX509CRLError;
VALUE ossl_x509crl_new(X509_CRL *);
X509_CRL *GetX509CRLPtr(VALUE);
+X509_CRL *DupX509CRLPtr(VALUE);
void Init_ossl_x509crl(void);
/*
@@ -64,6 +60,7 @@ extern VALUE eX509ExtError;
VALUE ossl_x509ext_new(X509_EXTENSION *);
X509_EXTENSION *GetX509ExtPtr(VALUE);
+X509_EXTENSION *DupX509ExtPtr(VALUE);
void Init_ossl_x509ext(void);
/*
@@ -82,7 +79,9 @@ void Init_ossl_x509name(void);
extern VALUE cX509Req;
extern VALUE eX509ReqError;
+VALUE ossl_x509req_new(X509_REQ *);
X509_REQ *GetX509ReqPtr(VALUE);
+X509_REQ *DupX509ReqPtr(VALUE);
void Init_ossl_x509req(void);
/*
@@ -102,14 +101,14 @@ extern VALUE cX509Store;
extern VALUE cX509StoreContext;
extern VALUE eX509StoreError;
+VALUE ossl_x509store_new(X509_STORE *);
X509_STORE *GetX509StorePtr(VALUE);
+X509_STORE *DupX509StorePtr(VALUE);
-void Init_ossl_x509store(void);
+VALUE ossl_x509stctx_new(X509_STORE_CTX *);
+VALUE ossl_x509stctx_clear_ptr(VALUE);
+X509_STORE_CTX *GetX509StCtxtPtr(VALUE);
-/*
- * Calls the verify callback Proc (the first parameter) with given pre-verify
- * result and the X509_STORE_CTX.
- */
-int ossl_verify_cb_call(VALUE, int, X509_STORE_CTX *);
+void Init_ossl_x509store(void);
#endif /* _OSSL_X509_H_ */
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index 60846cfe9d..d50f88c969 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Attr(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509attr_type, 0)
-#define SetX509Attr(obj, attr) do { \
+#define WrapX509Attr(klass, obj, attr) do { \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (attr); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_ATTRIBUTE_free, (attr)); \
} while (0)
#define GetX509Attr(obj, attr) do { \
- TypedData_Get_Struct((obj), X509_ATTRIBUTE, &ossl_x509attr_type, (attr)); \
+ Data_Get_Struct((obj), X509_ATTRIBUTE, (attr)); \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509Attr(obj, attr) do { \
+ OSSL_Check_Kind((obj), cX509Attr); \
+ GetX509Attr((obj), (attr)); \
+} while (0)
/*
* Classes
@@ -30,20 +33,6 @@
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
*/
@@ -53,7 +42,6 @@ ossl_x509attr_new(X509_ATTRIBUTE *attr)
X509_ATTRIBUTE *new;
VALUE obj;
- obj = NewX509Attr(cX509Attr);
if (!attr) {
new = X509_ATTRIBUTE_new();
} else {
@@ -62,19 +50,22 @@ ossl_x509attr_new(X509_ATTRIBUTE *attr)
if (!new) {
ossl_raise(eX509AttrError, NULL);
}
- SetX509Attr(obj, new);
+ WrapX509Attr(cX509Attr, obj, new);
return obj;
}
X509_ATTRIBUTE *
-GetX509AttrPtr(VALUE obj)
+DupX509AttrPtr(VALUE obj)
{
- X509_ATTRIBUTE *attr;
+ X509_ATTRIBUTE *attr, *new;
- GetX509Attr(obj, attr);
+ SafeGetX509Attr(obj, attr);
+ if (!(new = X509_ATTRIBUTE_dup(attr))) {
+ ossl_raise(eX509AttrError, NULL);
+ }
- return attr;
+ return new;
}
/*
@@ -86,10 +77,9 @@ ossl_x509attr_alloc(VALUE klass)
X509_ATTRIBUTE *attr;
VALUE obj;
- obj = NewX509Attr(klass);
if (!(attr = X509_ATTRIBUTE_new()))
ossl_raise(eX509AttrError, NULL);
- SetX509Attr(obj, attr);
+ WrapX509Attr(klass, obj, attr);
return obj;
}
@@ -123,25 +113,6 @@ ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-ossl_x509attr_initialize_copy(VALUE self, VALUE other)
-{
- X509_ATTRIBUTE *attr, *attr_other, *attr_new;
-
- rb_check_frozen(self);
- GetX509Attr(self, attr);
- GetX509Attr(other, attr_other);
-
- attr_new = X509_ATTRIBUTE_dup(attr_other);
- if (!attr_new)
- ossl_raise(eX509AttrError, "X509_ATTRIBUTE_dup");
-
- SetX509Attr(self, attr_new);
- X509_ATTRIBUTE_free(attr);
-
- return self;
-}
-
/*
* call-seq:
* attr.oid = string => string
@@ -153,15 +124,12 @@ ossl_x509attr_set_oid(VALUE self, VALUE oid)
ASN1_OBJECT *obj;
char *s;
- GetX509Attr(self, attr);
- s = StringValueCStr(oid);
+ s = StringValuePtr(oid);
obj = OBJ_txt2obj(s, 0);
+ if(!obj) obj = OBJ_txt2obj(s, 1);
if(!obj) ossl_raise(eX509AttrError, NULL);
- if (!X509_ATTRIBUTE_set1_object(attr, obj)) {
- ASN1_OBJECT_free(obj);
- ossl_raise(eX509AttrError, "X509_ATTRIBUTE_set1_object");
- }
- ASN1_OBJECT_free(obj);
+ GetX509Attr(self, attr);
+ X509_ATTRIBUTE_set1_object(attr, obj);
return oid;
}
@@ -193,6 +161,14 @@ ossl_x509attr_get_oid(VALUE self)
return ret;
}
+#if defined(HAVE_ST_X509_ATTRIBUTE_SINGLE) || defined(HAVE_ST_SINGLE)
+# define OSSL_X509ATTR_IS_SINGLE(attr) ((attr)->single)
+# define OSSL_X509ATTR_SET_SINGLE(attr) ((attr)->single = 1)
+#else
+# define OSSL_X509ATTR_IS_SINGLE(attr) (!(attr)->value.set)
+# define OSSL_X509ATTR_SET_SINGLE(attr) ((attr)->value.set = 0)
+#endif
+
/*
* call-seq:
* attr.value = asn1 => asn1
@@ -201,37 +177,21 @@ static VALUE
ossl_x509attr_set_value(VALUE self, VALUE value)
{
X509_ATTRIBUTE *attr;
- VALUE asn1_value;
- int i, asn1_tag;
-
- OSSL_Check_Kind(value, cASN1Data);
- asn1_tag = NUM2INT(rb_attr_get(value, rb_intern("@tag")));
- asn1_value = rb_attr_get(value, rb_intern("@value"));
- if (asn1_tag != V_ASN1_SET)
- ossl_raise(eASN1Error, "argument must be ASN1::Set");
- if (!RB_TYPE_P(asn1_value, T_ARRAY))
- ossl_raise(eASN1Error, "ASN1::Set has non-array value");
+ ASN1_TYPE *a1type;
- GetX509Attr(self, attr);
- if (X509_ATTRIBUTE_count(attr)) { /* populated, reset first */
- ASN1_OBJECT *obj = X509_ATTRIBUTE_get0_object(attr);
- X509_ATTRIBUTE *new_attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, 0, NULL, -1);
- if (!new_attr)
- ossl_raise(eX509AttrError, NULL);
- SetX509Attr(self, new_attr);
- X509_ATTRIBUTE_free(attr);
- attr = new_attr;
- }
-
- for (i = 0; i < RARRAY_LEN(asn1_value); i++) {
- ASN1_TYPE *a1type = ossl_asn1_get_asn1type(RARRAY_AREF(asn1_value, i));
- if (!X509_ATTRIBUTE_set1_data(attr, ASN1_TYPE_get(a1type),
- a1type->value.ptr, -1)) {
- ASN1_TYPE_free(a1type);
- ossl_raise(eX509AttrError, NULL);
- }
+ if(!(a1type = ossl_asn1_get_asn1type(value)))
+ ossl_raise(eASN1Error, "could not get ASN1_TYPE");
+ if(ASN1_TYPE_get(a1type) == V_ASN1_SEQUENCE){
ASN1_TYPE_free(a1type);
+ ossl_raise(eASN1Error, "couldn't set SEQUENCE for attribute value.");
+ }
+ GetX509Attr(self, attr);
+ if(attr->value.set){
+ if(OSSL_X509ATTR_IS_SINGLE(attr)) ASN1_TYPE_free(attr->value.single);
+ else sk_ASN1_TYPE_free(attr->value.set);
}
+ OSSL_X509ATTR_SET_SINGLE(attr);
+ attr->value.single = a1type;
return value;
}
@@ -244,34 +204,32 @@ static VALUE
ossl_x509attr_get_value(VALUE self)
{
X509_ATTRIBUTE *attr;
- STACK_OF(ASN1_TYPE) *sk;
- VALUE str;
- int i, count, len;
+ VALUE str, asn1;
+ long length;
unsigned char *p;
GetX509Attr(self, attr);
- /* there is no X509_ATTRIBUTE_get0_set() :( */
- if (!(sk = sk_ASN1_TYPE_new_null()))
- ossl_raise(eX509AttrError, "sk_new");
-
- count = X509_ATTRIBUTE_count(attr);
- for (i = 0; i < count; i++)
- sk_ASN1_TYPE_push(sk, X509_ATTRIBUTE_get0_type(attr, i));
-
- if ((len = i2d_ASN1_SET_ANY(sk, NULL)) <= 0) {
- sk_ASN1_TYPE_free(sk);
- ossl_raise(eX509AttrError, NULL);
+ if(attr->value.ptr == NULL) return Qnil;
+ if(OSSL_X509ATTR_IS_SINGLE(attr)){
+ length = i2d_ASN1_TYPE(attr->value.single, NULL);
+ str = rb_str_new(0, length);
+ p = (unsigned char *)RSTRING_PTR(str);
+ i2d_ASN1_TYPE(attr->value.single, &p);
+ ossl_str_adjust(str, p);
}
- str = rb_str_new(0, len);
- p = (unsigned char *)RSTRING_PTR(str);
- if (i2d_ASN1_SET_ANY(sk, &p) <= 0) {
- sk_ASN1_TYPE_free(sk);
- ossl_raise(eX509AttrError, NULL);
+ else{
+ length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set,
+ (unsigned char **) NULL, i2d_ASN1_TYPE,
+ V_ASN1_SET, V_ASN1_UNIVERSAL, 0);
+ str = rb_str_new(0, length);
+ p = (unsigned char *)RSTRING_PTR(str);
+ i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, &p,
+ i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0);
+ ossl_str_adjust(str, p);
}
- ossl_str_adjust(str, p);
- sk_ASN1_TYPE_free(sk);
+ asn1 = rb_funcall(mASN1, rb_intern("decode"), 1, str);
- return rb_funcall(mASN1, rb_intern("decode"), 1, str);
+ return asn1;
}
/*
@@ -293,7 +251,7 @@ ossl_x509attr_to_der(VALUE self)
p = (unsigned char *)RSTRING_PTR(str);
if(i2d_X509_ATTRIBUTE(attr, &p) <= 0)
ossl_raise(eX509AttrError, NULL);
- ossl_str_adjust(str, p);
+ rb_str_set_len(str, p - (unsigned char*)RSTRING_PTR(str));
return str;
}
@@ -302,20 +260,13 @@ ossl_x509attr_to_der(VALUE self)
* X509_ATTRIBUTE init
*/
void
-Init_ossl_x509attr(void)
+Init_ossl_x509attr()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
eX509AttrError = rb_define_class_under(mX509, "AttributeError", eOSSLError);
cX509Attr = rb_define_class_under(mX509, "Attribute", rb_cObject);
rb_define_alloc_func(cX509Attr, ossl_x509attr_alloc);
rb_define_method(cX509Attr, "initialize", ossl_x509attr_initialize, -1);
- rb_define_method(cX509Attr, "initialize_copy", ossl_x509attr_initialize_copy, 1);
rb_define_method(cX509Attr, "oid=", ossl_x509attr_set_oid, 1);
rb_define_method(cX509Attr, "oid", ossl_x509attr_get_oid, 0);
rb_define_method(cX509Attr, "value=", ossl_x509attr_set_value, 1);
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index 40542c4a78..85bbc0d081 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509_type, 0)
-#define SetX509(obj, x509) do { \
+#define WrapX509(klass, obj, x509) do { \
if (!(x509)) { \
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (x509); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_free, (x509)); \
} while (0)
#define GetX509(obj, x509) do { \
- TypedData_Get_Struct((obj), X509, &ossl_x509_type, (x509)); \
+ Data_Get_Struct((obj), X509, (x509)); \
if (!(x509)) { \
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509(obj, x509) do { \
+ OSSL_Check_Kind((obj), cX509Cert); \
+ GetX509((obj), (x509)); \
+} while (0)
/*
* Classes
@@ -30,20 +33,6 @@
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
*/
@@ -53,7 +42,6 @@ ossl_x509_new(X509 *x509)
X509 *new;
VALUE obj;
- obj = NewX509(cX509Cert);
if (!x509) {
new = X509_new();
} else {
@@ -62,7 +50,40 @@ ossl_x509_new(X509 *x509)
if (!new) {
ossl_raise(eX509CertError, NULL);
}
- SetX509(obj, new);
+ WrapX509(cX509Cert, obj, new);
+
+ return obj;
+}
+
+VALUE
+ossl_x509_new_from_file(VALUE filename)
+{
+ X509 *x509;
+ FILE *fp;
+ VALUE obj;
+
+ SafeStringValue(filename);
+ if (!(fp = fopen(RSTRING_PTR(filename), "r"))) {
+ ossl_raise(eX509CertError, "%s", strerror(errno));
+ }
+ rb_fd_fix_cloexec(fileno(fp));
+ x509 = PEM_read_X509(fp, NULL, NULL, NULL);
+ /*
+ * prepare for DER...
+#if !defined(OPENSSL_NO_FP_API)
+ if (!x509) {
+ (void)ERR_get_error();
+ rewind(fp);
+
+ x509 = d2i_X509_fp(fp, NULL);
+ }
+#endif
+ */
+ fclose(fp);
+ if (!x509) {
+ ossl_raise(eX509CertError, NULL);
+ }
+ WrapX509(cX509Cert, obj, x509);
return obj;
}
@@ -72,7 +93,7 @@ GetX509CertPtr(VALUE obj)
{
X509 *x509;
- GetX509(obj, x509);
+ SafeGetX509(obj, x509);
return x509;
}
@@ -82,9 +103,9 @@ DupX509CertPtr(VALUE obj)
{
X509 *x509;
- GetX509(obj, x509);
+ SafeGetX509(obj, x509);
- X509_up_ref(x509);
+ CRYPTO_add(&x509->references, 1, CRYPTO_LOCK_X509);
return x509;
}
@@ -98,10 +119,10 @@ ossl_x509_alloc(VALUE klass)
X509 *x509;
VALUE obj;
- obj = NewX509(klass);
x509 = X509_new();
if (!x509) ossl_raise(eX509CertError, NULL);
- SetX509(obj, x509);
+
+ WrapX509(klass, obj, x509);
return obj;
}
@@ -123,7 +144,7 @@ ossl_x509_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
+ in = ossl_obj2bio(arg);
x509 = PEM_read_bio_X509(in, &x, NULL, NULL);
DATA_PTR(self) = x;
if (!x509) {
@@ -146,7 +167,7 @@ ossl_x509_copy(VALUE self, VALUE other)
if (self == other) return self;
GetX509(self, a);
- GetX509(other, b);
+ SafeGetX509(other, b);
x509 = X509_dup(b);
if (!x509) ossl_raise(eX509CertError, NULL);
@@ -311,7 +332,9 @@ ossl_x509_set_serial(VALUE self, VALUE num)
X509 *x509;
GetX509(self, x509);
- X509_set_serialNumber(x509, num_to_asn1integer(num, X509_get_serialNumber(x509)));
+
+ x509->cert_info->serialNumber =
+ num_to_asn1integer(num, X509_get_serialNumber(x509));
return num;
}
@@ -331,7 +354,7 @@ ossl_x509_get_signature_algorithm(VALUE self)
out = BIO_new(BIO_s_mem());
if (!out) ossl_raise(eX509CertError, NULL);
- if (!i2a_ASN1_OBJECT(out, X509_get0_tbs_sigalg(x509)->algorithm)) {
+ if (!i2a_ASN1_OBJECT(out, x509->cert_info->signature->algorithm)) {
BIO_free(out);
ossl_raise(eX509CertError, NULL);
}
@@ -418,10 +441,10 @@ static VALUE
ossl_x509_get_not_before(VALUE self)
{
X509 *x509;
- const ASN1_TIME *asn1time;
+ ASN1_UTCTIME *asn1time;
GetX509(self, x509);
- if (!(asn1time = X509_get0_notBefore(x509))) {
+ if (!(asn1time = X509_get_notBefore(x509))) { /* NO DUP - don't free! */
ossl_raise(eX509CertError, NULL);
}
@@ -436,15 +459,13 @@ static VALUE
ossl_x509_set_not_before(VALUE self, VALUE time)
{
X509 *x509;
- ASN1_TIME *asn1time;
+ time_t sec;
+ sec = time_to_time_t(time);
GetX509(self, x509);
- asn1time = ossl_x509_time_adjust(NULL, time);
- if (!X509_set1_notBefore(x509, asn1time)) {
- ASN1_TIME_free(asn1time);
- ossl_raise(eX509CertError, "X509_set_notBefore");
+ if (!X509_time_adj(X509_get_notBefore(x509), 0, &sec)) {
+ ossl_raise(eX509CertError, NULL);
}
- ASN1_TIME_free(asn1time);
return time;
}
@@ -457,10 +478,10 @@ static VALUE
ossl_x509_get_not_after(VALUE self)
{
X509 *x509;
- const ASN1_TIME *asn1time;
+ ASN1_TIME *asn1time;
GetX509(self, x509);
- if (!(asn1time = X509_get0_notAfter(x509))) {
+ if (!(asn1time = X509_get_notAfter(x509))) { /* NO DUP - don't free! */
ossl_raise(eX509CertError, NULL);
}
@@ -475,15 +496,13 @@ static VALUE
ossl_x509_set_not_after(VALUE self, VALUE time)
{
X509 *x509;
- ASN1_TIME *asn1time;
+ time_t sec;
+ sec = time_to_time_t(time);
GetX509(self, x509);
- asn1time = ossl_x509_time_adjust(NULL, time);
- if (!X509_set1_notAfter(x509, asn1time)) {
- ASN1_TIME_free(asn1time);
- ossl_raise(eX509CertError, "X509_set_notAfter");
+ if (!X509_time_adj(X509_get_notAfter(x509), 0, &sec)) {
+ ossl_raise(eX509CertError, NULL);
}
- ASN1_TIME_free(asn1time);
return time;
}
@@ -508,19 +527,18 @@ ossl_x509_get_public_key(VALUE self)
/*
* call-seq:
- * cert.public_key = key
+ * cert.public_key = key => key
*/
static VALUE
ossl_x509_set_public_key(VALUE self, VALUE key)
{
X509 *x509;
- EVP_PKEY *pkey;
GetX509(self, x509);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- if (!X509_set_pubkey(x509, pkey))
- ossl_raise(eX509CertError, "X509_set_pubkey");
+ if (!X509_set_pubkey(x509, GetPKeyPtr(key))) { /* DUPs pkey */
+ ossl_raise(eX509CertError, NULL);
+ }
+
return key;
}
@@ -536,7 +554,7 @@ ossl_x509_sign(VALUE self, VALUE key, VALUE digest)
const EVP_MD *md;
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ md = GetDigestPtr(digest);
GetX509(self, x509);
if (!X509_sign(x509, pkey, md)) {
ossl_raise(eX509CertError, NULL);
@@ -549,35 +567,32 @@ ossl_x509_sign(VALUE self, VALUE key, VALUE digest)
* call-seq:
* cert.verify(key) => true | false
*
- * Verifies the signature of the certificate, with the public key _key_. _key_
- * must be an instance of OpenSSL::PKey.
+ * Checks that cert signature is made with PRIVversion of this PUBLIC 'key'
*/
static VALUE
ossl_x509_verify(VALUE self, VALUE key)
{
X509 *x509;
EVP_PKEY *pkey;
+ int i;
+ pkey = GetPKeyPtr(key); /* NO NEED TO DUP */
GetX509(self, x509);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- switch (X509_verify(x509, pkey)) {
- case 1:
- return Qtrue;
- case 0:
- ossl_clear_error();
- return Qfalse;
- default:
+ if ((i = X509_verify(x509, pkey)) < 0) {
ossl_raise(eX509CertError, NULL);
}
+ if (i > 0) {
+ return Qtrue;
+ }
+
+ return Qfalse;
}
/*
* call-seq:
- * cert.check_private_key(key) -> true | false
+ * cert.check_private_key(key)
*
- * Returns +true+ if _key_ is the corresponding private key to the Subject
- * Public Key Information, +false+ otherwise.
+ * Checks if 'key' is PRIV key for this cert
*/
static VALUE
ossl_x509_check_private_key(VALUE self, VALUE key)
@@ -589,7 +604,7 @@ ossl_x509_check_private_key(VALUE self, VALUE key)
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
GetX509(self, x509);
if (!X509_check_private_key(x509, pkey)) {
- ossl_clear_error();
+ OSSL_Warning("Check private key:%s", OSSL_ErrMsg());
return Qfalse;
}
@@ -631,21 +646,24 @@ ossl_x509_set_extensions(VALUE self, VALUE ary)
{
X509 *x509;
X509_EXTENSION *ext;
- long i;
+ int 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_AREF(ary, i), cX509Ext);
+ OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
}
GetX509(self, x509);
- while ((ext = X509_delete_ext(x509, 0)))
- X509_EXTENSION_free(ext);
+ 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 = GetX509ExtPtr(RARRAY_AREF(ary, i));
- if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext */
+ ext = DupX509ExtPtr(RARRAY_PTR(ary)[i]);
+
+ if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext - FREE it */
+ X509_EXTENSION_free(ext);
ossl_raise(eX509CertError, NULL);
}
+ X509_EXTENSION_free(ext);
}
return ary;
@@ -662,10 +680,12 @@ ossl_x509_add_extension(VALUE self, VALUE extension)
X509_EXTENSION *ext;
GetX509(self, x509);
- ext = GetX509ExtPtr(extension);
+ ext = DupX509ExtPtr(extension);
if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext - FREE it */
+ X509_EXTENSION_free(ext);
ossl_raise(eX509CertError, NULL);
}
+ X509_EXTENSION_free(ext);
return extension;
}
@@ -685,34 +705,14 @@ ossl_x509_inspect(VALUE self)
}
/*
- * call-seq:
- * cert1 == cert2 -> true | false
- *
- * Compares the two certificates. Note that this takes into account all fields,
- * not just the issuer name and the serial number.
- */
-static VALUE
-ossl_x509_eq(VALUE self, VALUE other)
-{
- X509 *a, *b;
-
- GetX509(self, a);
- if (!rb_obj_is_kind_of(other, cX509Cert))
- return Qfalse;
- GetX509(other, b);
-
- return !X509_cmp(a, b) ? Qtrue : Qfalse;
-}
-
-/*
* INIT
*/
void
-Init_ossl_x509cert(void)
+Init_ossl_x509cert()
{
+
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
mX509 = rb_define_module_under(mOSSL, "X509");
#endif
@@ -814,7 +814,7 @@ Init_ossl_x509cert(void)
rb_define_alloc_func(cX509Cert, ossl_x509_alloc);
rb_define_method(cX509Cert, "initialize", ossl_x509_initialize, -1);
- rb_define_method(cX509Cert, "initialize_copy", ossl_x509_copy, 1);
+ rb_define_copy_func(cX509Cert, ossl_x509_copy);
rb_define_method(cX509Cert, "to_der", ossl_x509_to_der, 0);
rb_define_method(cX509Cert, "to_pem", ossl_x509_to_pem, 0);
@@ -842,5 +842,5 @@ Init_ossl_x509cert(void)
rb_define_method(cX509Cert, "extensions=", ossl_x509_set_extensions, 1);
rb_define_method(cX509Cert, "add_extension", ossl_x509_add_extension, 1);
rb_define_method(cX509Cert, "inspect", ossl_x509_inspect, 0);
- rb_define_method(cX509Cert, "==", ossl_x509_eq, 1);
}
+
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index b0badf45c4..dec13c8cae 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509CRL(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509crl_type, 0)
-#define SetX509CRL(obj, crl) do { \
+#define WrapX509CRL(klass, obj, crl) do { \
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (crl); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_CRL_free, (crl)); \
} while (0)
#define GetX509CRL(obj, crl) do { \
- TypedData_Get_Struct((obj), X509_CRL, &ossl_x509crl_type, (crl)); \
+ Data_Get_Struct((obj), X509_CRL, (crl)); \
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509CRL(obj, crl) do { \
+ OSSL_Check_Kind((obj), cX509CRL); \
+ GetX509CRL((obj), (crl)); \
+} while (0)
/*
* Classes
@@ -30,20 +33,6 @@
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
*/
@@ -52,7 +41,18 @@ GetX509CRLPtr(VALUE obj)
{
X509_CRL *crl;
- GetX509CRL(obj, crl);
+ SafeGetX509CRL(obj, crl);
+
+ return crl;
+}
+
+X509_CRL *
+DupX509CRLPtr(VALUE obj)
+{
+ X509_CRL *crl;
+
+ SafeGetX509CRL(obj, crl);
+ CRYPTO_add(&crl->references, 1, CRYPTO_LOCK_X509_CRL);
return crl;
}
@@ -63,10 +63,9 @@ 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);
- SetX509CRL(obj, tmp);
+ WrapX509CRL(cX509CRL, obj, tmp);
return obj;
}
@@ -80,11 +79,10 @@ ossl_x509crl_alloc(VALUE klass)
X509_CRL *crl;
VALUE obj;
- obj = NewX509CRL(klass);
if (!(crl = X509_CRL_new())) {
ossl_raise(eX509CRLError, NULL);
}
- SetX509CRL(obj, crl);
+ WrapX509CRL(klass, obj, crl);
return obj;
}
@@ -100,7 +98,7 @@ ossl_x509crl_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
+ in = ossl_obj2bio(arg);
crl = PEM_read_bio_X509_CRL(in, &x, NULL, NULL);
DATA_PTR(self) = x;
if (!crl) {
@@ -122,7 +120,7 @@ ossl_x509crl_copy(VALUE self, VALUE other)
rb_check_frozen(self);
if (self == other) return self;
GetX509CRL(self, a);
- GetX509CRL(other, b);
+ SafeGetX509CRL(other, b);
if (!(crl = X509_CRL_dup(b))) {
ossl_raise(eX509CRLError, NULL);
}
@@ -165,20 +163,22 @@ static VALUE
ossl_x509crl_get_signature_algorithm(VALUE self)
{
X509_CRL *crl;
- const X509_ALGOR *alg;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509CRL(self, crl);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eX509CRLError, NULL);
}
- X509_CRL_get0_signature(crl, NULL, &alg);
- if (!i2a_ASN1_OBJECT(out, alg->algorithm)) {
+ if (!i2a_ASN1_OBJECT(out, crl->sig_alg->algorithm)) {
BIO_free(out);
ossl_raise(eX509CRLError, NULL);
}
-
- return ossl_membio2str(out);
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
+ return str;
}
static VALUE
@@ -208,29 +208,23 @@ static VALUE
ossl_x509crl_get_last_update(VALUE self)
{
X509_CRL *crl;
- const ASN1_TIME *time;
GetX509CRL(self, crl);
- time = X509_CRL_get0_lastUpdate(crl);
- if (!time)
- return Qnil;
- return asn1time_to_time(time);
+ return asn1time_to_time(X509_CRL_get_lastUpdate(crl));
}
static VALUE
ossl_x509crl_set_last_update(VALUE self, VALUE time)
{
X509_CRL *crl;
- ASN1_TIME *asn1time;
+ time_t sec;
+ sec = time_to_time_t(time);
GetX509CRL(self, crl);
- asn1time = ossl_x509_time_adjust(NULL, time);
- if (!X509_CRL_set1_lastUpdate(crl, asn1time)) {
- ASN1_TIME_free(asn1time);
- ossl_raise(eX509CRLError, "X509_CRL_set_lastUpdate");
+ if (!X509_time_adj(crl->crl->lastUpdate, 0, &sec)) {
+ ossl_raise(eX509CRLError, NULL);
}
- ASN1_TIME_free(asn1time);
return time;
}
@@ -239,29 +233,24 @@ static VALUE
ossl_x509crl_get_next_update(VALUE self)
{
X509_CRL *crl;
- const ASN1_TIME *time;
GetX509CRL(self, crl);
- time = X509_CRL_get0_nextUpdate(crl);
- if (!time)
- return Qnil;
- return asn1time_to_time(time);
+ return asn1time_to_time(X509_CRL_get_nextUpdate(crl));
}
static VALUE
ossl_x509crl_set_next_update(VALUE self, VALUE time)
{
X509_CRL *crl;
- ASN1_TIME *asn1time;
+ time_t sec;
+ sec = time_to_time_t(time);
GetX509CRL(self, crl);
- asn1time = ossl_x509_time_adjust(NULL, time);
- if (!X509_CRL_set1_nextUpdate(crl, asn1time)) {
- ASN1_TIME_free(asn1time);
- ossl_raise(eX509CRLError, "X509_CRL_set_nextUpdate");
+ /* This must be some thinko in OpenSSL */
+ if (!(crl->crl->nextUpdate = X509_time_adj(crl->crl->nextUpdate, 0, &sec))){
+ ossl_raise(eX509CRLError, NULL);
}
- ASN1_TIME_free(asn1time);
return time;
}
@@ -296,24 +285,20 @@ ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_REVOKED *rev;
- STACK_OF(X509_REVOKED) *sk;
- long i;
+ int 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_AREF(ary, i), cX509Rev);
+ OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Rev);
}
GetX509CRL(self, crl);
- if ((sk = X509_CRL_get_REVOKED(crl))) {
- while ((rev = sk_X509_REVOKED_pop(sk)))
- X509_REVOKED_free(rev);
- }
+ 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_AREF(ary, i));
+ rev = DupX509RevokedPtr(RARRAY_PTR(ary)[i]);
if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
- X509_REVOKED_free(rev);
- ossl_raise(eX509CRLError, "X509_CRL_add0_revoked");
+ ossl_raise(eX509CRLError, NULL);
}
}
X509_CRL_sort(crl);
@@ -330,8 +315,7 @@ 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! */
- X509_REVOKED_free(rev);
- ossl_raise(eX509CRLError, "X509_CRL_add0_revoked");
+ ossl_raise(eX509CRLError, NULL);
}
X509_CRL_sort(crl);
@@ -347,7 +331,7 @@ ossl_x509crl_sign(VALUE self, VALUE key, VALUE digest)
GetX509CRL(self, crl);
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ md = GetDigestPtr(digest);
if (!X509_CRL_sign(crl, pkey, md)) {
ossl_raise(eX509CRLError, NULL);
}
@@ -359,20 +343,17 @@ static VALUE
ossl_x509crl_verify(VALUE self, VALUE key)
{
X509_CRL *crl;
- EVP_PKEY *pkey;
+ int ret;
GetX509CRL(self, crl);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- switch (X509_CRL_verify(crl, pkey)) {
- case 1:
- return Qtrue;
- case 0:
- ossl_clear_error();
- return Qfalse;
- default:
+ if ((ret = X509_CRL_verify(crl, GetPKeyPtr(key))) < 0) {
ossl_raise(eX509CRLError, NULL);
}
+ if (ret == 1) {
+ return Qtrue;
+ }
+
+ return Qfalse;
}
static VALUE
@@ -380,6 +361,8 @@ ossl_x509crl_to_der(VALUE self)
{
X509_CRL *crl;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509CRL(self, crl);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -389,8 +372,11 @@ ossl_x509crl_to_der(VALUE self)
BIO_free(out);
ossl_raise(eX509CRLError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
static VALUE
@@ -398,6 +384,8 @@ ossl_x509crl_to_pem(VALUE self)
{
X509_CRL *crl;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509CRL(self, crl);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -407,8 +395,11 @@ ossl_x509crl_to_pem(VALUE self)
BIO_free(out);
ossl_raise(eX509CRLError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
static VALUE
@@ -416,6 +407,8 @@ ossl_x509crl_to_text(VALUE self)
{
X509_CRL *crl;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509CRL(self, crl);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -425,8 +418,11 @@ ossl_x509crl_to_text(VALUE self)
BIO_free(out);
ossl_raise(eX509CRLError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
/*
@@ -463,21 +459,23 @@ ossl_x509crl_set_extensions(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_EXTENSION *ext;
- long i;
+ int 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_AREF(ary, i), cX509Ext);
+ OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
}
GetX509CRL(self, crl);
- while ((ext = X509_CRL_delete_ext(crl, 0)))
- X509_EXTENSION_free(ext);
+ sk_X509_EXTENSION_pop_free(crl->crl->extensions, X509_EXTENSION_free);
+ crl->crl->extensions = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- ext = GetX509ExtPtr(RARRAY_AREF(ary, i)); /* NO NEED TO DUP */
- if (!X509_CRL_add_ext(crl, ext, -1)) {
+ ext = DupX509ExtPtr(RARRAY_PTR(ary)[i]);
+ if(!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */
+ X509_EXTENSION_free(ext);
ossl_raise(eX509CRLError, NULL);
}
+ X509_EXTENSION_free(ext);
}
return ary;
@@ -490,10 +488,12 @@ ossl_x509crl_add_extension(VALUE self, VALUE extension)
X509_EXTENSION *ext;
GetX509CRL(self, crl);
- ext = GetX509ExtPtr(extension);
- if (!X509_CRL_add_ext(crl, ext, -1)) {
+ ext = DupX509ExtPtr(extension);
+ if (!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */
+ X509_EXTENSION_free(ext);
ossl_raise(eX509CRLError, NULL);
}
+ X509_EXTENSION_free(ext);
return extension;
}
@@ -502,21 +502,15 @@ ossl_x509crl_add_extension(VALUE self, VALUE extension)
* INIT
*/
void
-Init_ossl_x509crl(void)
+Init_ossl_x509crl()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
eX509CRLError = rb_define_class_under(mX509, "CRLError", eOSSLError);
cX509CRL = rb_define_class_under(mX509, "CRL", rb_cObject);
rb_define_alloc_func(cX509CRL, ossl_x509crl_alloc);
rb_define_method(cX509CRL, "initialize", ossl_x509crl_initialize, -1);
- rb_define_method(cX509CRL, "initialize_copy", ossl_x509crl_copy, 1);
+ rb_define_copy_func(cX509CRL, ossl_x509crl_copy);
rb_define_method(cX509CRL, "version", ossl_x509crl_get_version, 0);
rb_define_method(cX509CRL, "version=", ossl_x509crl_set_version, 1);
@@ -540,3 +534,4 @@ Init_ossl_x509crl(void)
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 30ec09d7a3..bd2e1dd2fa 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -1,37 +1,39 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Ext(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)
-#define SetX509Ext(obj, ext) do { \
+#define WrapX509Ext(klass, obj, ext) do { \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (ext); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_EXTENSION_free, (ext)); \
} while (0)
#define GetX509Ext(obj, ext) do { \
- TypedData_Get_Struct((obj), X509_EXTENSION, &ossl_x509ext_type, (ext)); \
+ Data_Get_Struct((obj), X509_EXTENSION, (ext)); \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509Ext(obj, ext) do { \
+ OSSL_Check_Kind((obj), cX509Ext); \
+ 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); \
- RTYPEDDATA_DATA(obj) = (ctx); \
+ (obj) = Data_Wrap_Struct((klass), 0, ossl_x509extfactory_free, (ctx)); \
} while (0)
#define GetX509ExtFactory(obj, ctx) do { \
- TypedData_Get_Struct((obj), X509V3_CTX, &ossl_x509extfactory_type, (ctx)); \
+ Data_Get_Struct((obj), X509V3_CTX, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
} \
@@ -44,20 +46,6 @@ 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
*/
@@ -67,7 +55,6 @@ ossl_x509ext_new(X509_EXTENSION *ext)
X509_EXTENSION *new;
VALUE obj;
- obj = NewX509Ext(cX509Ext);
if (!ext) {
new = X509_EXTENSION_new();
} else {
@@ -76,7 +63,7 @@ ossl_x509ext_new(X509_EXTENSION *ext)
if (!new) {
ossl_raise(eX509ExtError, NULL);
}
- SetX509Ext(obj, new);
+ WrapX509Ext(cX509Ext, obj, new);
return obj;
}
@@ -86,11 +73,24 @@ GetX509ExtPtr(VALUE obj)
{
X509_EXTENSION *ext;
- GetX509Ext(obj, ext);
+ SafeGetX509Ext(obj, ext);
return ext;
}
+X509_EXTENSION *
+DupX509ExtPtr(VALUE obj)
+{
+ X509_EXTENSION *ext, *new;
+
+ SafeGetX509Ext(obj, ext);
+ if (!(new = X509_EXTENSION_dup(ext))) {
+ ossl_raise(eX509ExtError, NULL);
+ }
+
+ return new;
+}
+
/*
* Private
*/
@@ -98,19 +98,11 @@ GetX509ExtPtr(VALUE obj)
* Ext factory
*/
static void
-ossl_x509extfactory_free(void *ctx)
+ossl_x509extfactory_free(X509V3_CTX *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)
{
@@ -171,6 +163,24 @@ 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)
{
@@ -194,11 +204,12 @@ ossl_x509extfactory_initialize(int argc, VALUE *argv, VALUE self)
}
/*
- * call-seq:
- * ef.create_ext(ln_or_sn, "value", critical = false) -> X509::Extension
- * ef.create_ext(ln_or_sn, "critical,value") -> X509::Extension
- *
- * Creates a new X509::Extension with passed values. See also x509v3_config(5).
+ * Array to X509_EXTENSION
+ * Structure:
+ * ["ln", "value", bool_critical] or
+ * ["sn", "value", bool_critical] or
+ * ["ln", "critical,value"] or the same for sn
+ * ["ln", "value"] => not critical
*/
static VALUE
ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
@@ -207,34 +218,37 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
X509_EXTENSION *ext;
VALUE oid, value, critical, valstr, obj;
int nid;
+#ifdef HAVE_X509V3_EXT_NCONF_NID
VALUE rconf;
CONF *conf;
+#else
+ static LHASH *empty_lhash;
+#endif
rb_scan_args(argc, argv, "21", &oid, &value, &critical);
- StringValueCStr(oid);
+ StringValue(oid);
StringValue(value);
if(NIL_P(critical)) critical = Qfalse;
nid = OBJ_ln2nid(RSTRING_PTR(oid));
if(!nid) nid = OBJ_sn2nid(RSTRING_PTR(oid));
- if(!nid) ossl_raise(eX509ExtError, "unknown OID `%"PRIsVALUE"'", oid);
-
+ if(!nid) ossl_raise(eX509ExtError, "unknown OID `%s'", RSTRING_PTR(oid));
valstr = rb_str_new2(RTEST(critical) ? "critical," : "");
rb_str_append(valstr, value);
- StringValueCStr(valstr);
-
GetX509ExtFactory(self, ctx);
- obj = NewX509Ext(cX509Ext);
+#ifdef HAVE_X509V3_EXT_NCONF_NID
rconf = rb_iv_get(self, "@config");
- conf = NIL_P(rconf) ? NULL : DupConfigPtr(rconf);
- X509V3_set_nconf(ctx, conf);
+ conf = NIL_P(rconf) ? NULL : GetConfigPtr(rconf);
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));
+#endif
if (!ext){
- ossl_raise(eX509ExtError, "%"PRIsVALUE" = %"PRIsVALUE, oid, valstr);
+ ossl_raise(eX509ExtError, "%s = %s",
+ RSTRING_PTR(oid), RSTRING_PTR(value));
}
- SetX509Ext(obj, ext);
+ WrapX509Ext(cX509Ext, obj, ext);
return obj;
}
@@ -248,26 +262,25 @@ ossl_x509ext_alloc(VALUE klass)
X509_EXTENSION *ext;
VALUE obj;
- obj = NewX509Ext(klass);
if(!(ext = X509_EXTENSION_new())){
ossl_raise(eX509ExtError, NULL);
}
- SetX509Ext(obj, ext);
+ WrapX509Ext(klass, obj, ext);
return obj;
}
/*
* call-seq:
- * OpenSSL::X509::Extension.new(der)
- * OpenSSL::X509::Extension.new(oid, value)
- * OpenSSL::X509::Extension.new(oid, value, critical)
+ * OpenSSL::X509::Extension.new asn1
+ * OpenSSL::X509::Extension.new name, value
+ * OpenSSL::X509::Extension.new name, value, critical
*
* Creates an X509 extension.
*
- * The extension may be created from _der_ data or from an extension _oid_
- * and _value_. The _oid_ may be either an OID or an extension name. If
- * _critical_ is +true+ the extension is marked critical.
+ * The extension may be created from +asn1+ data or from an extension +name+
+ * and +value+. The +name+ may be either an OID or an extension name. If
+ * +critical+ is true the extension is marked critical.
*/
static VALUE
ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self)
@@ -295,39 +308,18 @@ ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ossl_x509ext_initialize_copy(VALUE self, VALUE other)
-{
- X509_EXTENSION *ext, *ext_other, *ext_new;
-
- rb_check_frozen(self);
- GetX509Ext(self, ext);
- GetX509Ext(other, ext_other);
-
- ext_new = X509_EXTENSION_dup(ext_other);
- if (!ext_new)
- ossl_raise(eX509ExtError, "X509_EXTENSION_dup");
-
- SetX509Ext(self, ext_new);
- X509_EXTENSION_free(ext);
-
- return self;
-}
-
-static VALUE
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);
- 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);
+ X509_EXTENSION_set_object(ext, obj);
return oid;
}
@@ -337,16 +329,25 @@ 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);
- 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");
+ 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);
}
+ OPENSSL_free(s);
+ GetX509Ext(self, ext);
+ X509_EXTENSION_set_data(ext, asn1s);
return data;
}
@@ -396,7 +397,7 @@ ossl_x509ext_get_value(VALUE obj)
if (!(out = BIO_new(BIO_s_mem())))
ossl_raise(eX509ExtError, NULL);
if (!X509V3_EXT_print(out, ext, 0, 0))
- ASN1_STRING_print(out, (ASN1_STRING *)X509_EXTENSION_get_data(ext));
+ M_ASN1_OCTET_STRING_print(out, ext->value);
ret = ossl_membio2str(out);
return ret;
@@ -435,15 +436,8 @@ ossl_x509ext_to_der(VALUE obj)
* INIT
*/
void
-Init_ossl_x509ext(void)
+Init_ossl_x509ext()
{
-#undef rb_intern
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
eX509ExtError = rb_define_class_under(mX509, "ExtensionError", eOSSLError);
cX509ExtFactory = rb_define_class_under(mX509, "ExtensionFactory", rb_cObject);
@@ -455,18 +449,18 @@ Init_ossl_x509ext(void)
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, 1, Qfalse);
+ rb_attr(cX509ExtFactory, rb_intern("config"), 1, 0, 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);
rb_define_alloc_func(cX509Ext, ossl_x509ext_alloc);
rb_define_method(cX509Ext, "initialize", ossl_x509ext_initialize, -1);
- rb_define_method(cX509Ext, "initialize_copy", ossl_x509ext_initialize_copy, 1);
rb_define_method(cX509Ext, "oid=", ossl_x509ext_set_oid, 1);
rb_define_method(cX509Ext, "value=", ossl_x509ext_set_value, 1);
rb_define_method(cX509Ext, "critical=", ossl_x509ext_set_critical, 1);
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index 0053f2e372..be70dc1b12 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Name(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509name_type, 0)
-#define SetX509Name(obj, name) do { \
+#define WrapX509Name(klass, obj, name) do { \
if (!(name)) { \
ossl_raise(rb_eRuntimeError, "Name wasn't initialized."); \
} \
- RTYPEDDATA_DATA(obj) = (name); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_NAME_free, (name)); \
} while (0)
#define GetX509Name(obj, name) do { \
- TypedData_Get_Struct((obj), X509_NAME, &ossl_x509name_type, (name)); \
+ Data_Get_Struct((obj), X509_NAME, (name)); \
if (!(name)) { \
ossl_raise(rb_eRuntimeError, "Name wasn't initialized."); \
} \
} while (0)
+#define SafeGetX509Name(obj, name) do { \
+ OSSL_Check_Kind((obj), cX509Name); \
+ GetX509Name((obj), (name)); \
+} while (0)
#define OBJECT_TYPE_TEMPLATE \
rb_const_get(cX509Name, rb_intern("OBJECT_TYPE_TEMPLATE"))
@@ -35,20 +38,6 @@
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
*/
@@ -58,7 +47,6 @@ ossl_x509name_new(X509_NAME *name)
X509_NAME *new;
VALUE obj;
- obj = NewX509Name(cX509Name);
if (!name) {
new = X509_NAME_new();
} else {
@@ -67,7 +55,7 @@ ossl_x509name_new(X509_NAME *name)
if (!new) {
ossl_raise(eX509NameError, NULL);
}
- SetX509Name(obj, new);
+ WrapX509Name(cX509Name, obj, new);
return obj;
}
@@ -77,7 +65,7 @@ GetX509NamePtr(VALUE obj)
{
X509_NAME *name;
- GetX509Name(obj, name);
+ SafeGetX509Name(obj, name);
return name;
}
@@ -91,11 +79,10 @@ ossl_x509name_alloc(VALUE klass)
X509_NAME *name;
VALUE obj;
- obj = NewX509Name(klass);
if (!(name = X509_NAME_new())) {
ossl_raise(eX509NameError, NULL);
}
- SetX509Name(obj, name);
+ WrapX509Name(klass, obj, name);
return obj;
}
@@ -131,15 +118,15 @@ ossl_x509name_init_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, args))
*
* Creates a new Name.
*
- * A name may be created from a DER encoded string _der_, an Array
- * representing a _distinguished_name_ or a _distinguished_name_ along with a
- * _template_.
+ * A name may be created from a DER encoded string +der+, an Array
+ * representing a +distinguished_name+ or a +distinguished_name+ along with a
+ * +template+.
*
* name = OpenSSL::X509::Name.new [['CN', 'nobody'], ['DC', 'example']]
*
* name = OpenSSL::X509::Name.new name.to_der
*
- * See add_entry for a description of the _distinguished_name_ Array's
+ * See add_entry for a description of the +distinguished_name+ Array's
* contents
*/
static VALUE
@@ -177,30 +164,11 @@ ossl_x509name_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-static VALUE
-ossl_x509name_initialize_copy(VALUE self, VALUE other)
-{
- X509_NAME *name, *name_other, *name_new;
-
- rb_check_frozen(self);
- GetX509Name(self, name);
- GetX509Name(other, name_other);
-
- name_new = X509_NAME_dup(name_other);
- if (!name_new)
- ossl_raise(eX509NameError, "X509_NAME_dup");
-
- SetX509Name(self, name_new);
- X509_NAME_free(name);
-
- return self;
-}
-
/*
* call-seq:
- * name.add_entry(oid, value [, type], loc: -1, set: 0) => self
+ * name.add_entry(oid, value [, type]) => self
*
- * Adds a new entry with the given _oid_ and _value_ to this name. The _oid_
+ * Adds a new entry with the given +oid+ and +value+ to this name. The +oid+
* is an object identifier defined in ASN.1. Some common OIDs are:
*
* C:: Country Name
@@ -209,39 +177,24 @@ ossl_x509name_initialize_copy(VALUE self, VALUE other)
* O:: Organization Name
* OU:: Organizational Unit Name
* ST:: State or Province Name
- *
- * The optional keyword parameters _loc_ and _set_ specify where to insert the
- * new attribute. Refer to the manpage of X509_NAME_add_entry(3) for details.
- * _loc_ defaults to -1 and _set_ defaults to 0. This appends a single-valued
- * RDN to the end.
*/
static
VALUE ossl_x509name_add_entry(int argc, VALUE *argv, VALUE self)
{
X509_NAME *name;
- VALUE oid, value, type, opts, kwargs[2];
- static ID kwargs_ids[2];
+ VALUE oid, value, type;
const char *oid_name;
- int loc = -1, set = 0;
- if (!kwargs_ids[0]) {
- kwargs_ids[0] = rb_intern_const("loc");
- kwargs_ids[1] = rb_intern_const("set");
- }
- rb_scan_args(argc, argv, "21:", &oid, &value, &type, &opts);
- rb_get_kwargs(opts, kwargs_ids, 0, 2, kwargs);
+ rb_scan_args(argc, argv, "21", &oid, &value, &type);
oid_name = StringValueCStr(oid);
StringValue(value);
if(NIL_P(type)) type = rb_aref(OBJECT_TYPE_TEMPLATE, oid);
- if (kwargs[0] != Qundef)
- loc = NUM2INT(kwargs[0]);
- if (kwargs[1] != Qundef)
- set = NUM2INT(kwargs[1]);
GetX509Name(self, name);
if (!X509_NAME_add_entry_by_txt(name, oid_name, NUM2INT(type),
- (unsigned char *)RSTRING_PTR(value),
- RSTRING_LENINT(value), loc, set))
- ossl_raise(eX509NameError, "X509_NAME_add_entry_by_txt");
+ (const unsigned char *)RSTRING_PTR(value), RSTRING_LENINT(value), -1, 0)) {
+ ossl_raise(eX509NameError, NULL);
+ }
+
return self;
}
@@ -250,83 +203,52 @@ ossl_x509name_to_s_old(VALUE self)
{
X509_NAME *name;
char *buf;
+ VALUE str;
GetX509Name(self, name);
buf = X509_NAME_oneline(name, NULL, 0);
- if (!buf)
- ossl_raise(eX509NameError, "X509_NAME_oneline");
- return ossl_buf2str(buf, rb_long2int(strlen(buf)));
-}
-
-static VALUE
-x509name_print(VALUE self, unsigned long iflag)
-{
- X509_NAME *name;
- BIO *out;
- int ret;
+ str = rb_str_new2(buf);
+ OPENSSL_free(buf);
- GetX509Name(self, name);
- out = BIO_new(BIO_s_mem());
- if (!out)
- ossl_raise(eX509NameError, NULL);
- ret = X509_NAME_print_ex(out, name, 0, iflag);
- if (ret < 0 || iflag == XN_FLAG_COMPAT && ret == 0) {
- BIO_free(out);
- ossl_raise(eX509NameError, "X509_NAME_print_ex");
- }
- return ossl_membio2str(out);
+ return str;
}
/*
* call-seq:
- * name.to_s -> string
- * name.to_s(format) -> string
+ * name.to_s => string
+ * name.to_s(flags) => string
*
- * Returns a String representation of the Distinguished Name. _format_ is
- * one of:
+ * Returns this name as a Distinguished Name string. +flags+ may be one of:
*
* * OpenSSL::X509::Name::COMPAT
* * OpenSSL::X509::Name::RFC2253
* * OpenSSL::X509::Name::ONELINE
* * OpenSSL::X509::Name::MULTILINE
- *
- * If _format_ is omitted, the largely broken and traditional OpenSSL format
- * is used.
*/
static VALUE
ossl_x509name_to_s(int argc, VALUE *argv, VALUE self)
{
- rb_check_arity(argc, 0, 1);
- /* name.to_s(nil) was allowed */
- if (!argc || NIL_P(argv[0]))
+ X509_NAME *name;
+ VALUE flag, str;
+ BIO *out;
+ unsigned long iflag;
+
+ rb_scan_args(argc, argv, "01", &flag);
+ if (NIL_P(flag))
return ossl_x509name_to_s_old(self);
- else
- return x509name_print(self, NUM2ULONG(argv[0]));
-}
+ else iflag = NUM2ULONG(flag);
+ if (!(out = BIO_new(BIO_s_mem())))
+ ossl_raise(eX509NameError, NULL);
+ GetX509Name(self, name);
+ if (!X509_NAME_print_ex(out, name, 0, iflag)){
+ BIO_free(out);
+ ossl_raise(eX509NameError, NULL);
+ }
+ str = ossl_membio2str(out);
-/*
- * call-seq:
- * name.to_utf8 -> string
- *
- * Returns an UTF-8 representation of the distinguished name, as specified
- * in {RFC 2253}[https://www.ietf.org/rfc/rfc2253.txt].
- */
-static VALUE
-ossl_x509name_to_utf8(VALUE self)
-{
- VALUE str = x509name_print(self, XN_FLAG_RFC2253 & ~ASN1_STRFLGS_ESC_MSB);
- rb_enc_associate_index(str, rb_utf8_encindex());
return str;
}
-/* :nodoc: */
-static VALUE
-ossl_x509name_inspect(VALUE self)
-{
- return rb_enc_sprintf(rb_utf8_encoding(), "#<%"PRIsVALUE" %"PRIsVALUE">",
- rb_obj_class(self), ossl_x509name_to_utf8(self));
-}
-
/*
* call-seq:
* name.to_a => [[name, data, type], ...]
@@ -343,7 +265,6 @@ ossl_x509name_to_a(VALUE self)
char long_name[512];
const char *short_name;
VALUE ary, vname, ret;
- ASN1_STRING *value;
GetX509Name(self, name);
entries = X509_NAME_entry_count(name);
@@ -356,8 +277,7 @@ ossl_x509name_to_a(VALUE self)
if (!(entry = X509_NAME_get_entry(name, i))) {
ossl_raise(eX509NameError, NULL);
}
- if (!i2t_ASN1_OBJECT(long_name, sizeof(long_name),
- X509_NAME_ENTRY_get_object(entry))) {
+ if (!i2t_ASN1_OBJECT(long_name, sizeof(long_name), entry->object)) {
ossl_raise(eX509NameError, NULL);
}
nid = OBJ_ln2nid(long_name);
@@ -367,8 +287,10 @@ ossl_x509name_to_a(VALUE self)
short_name = OBJ_nid2sn(nid);
vname = rb_str_new2(short_name); /*do not free*/
}
- value = X509_NAME_ENTRY_get_data(entry);
- ary = rb_ary_new3(3, vname, asn1str_to_str(value), INT2NUM(value->type));
+ ary = rb_ary_new3(3,
+ vname,
+ rb_str_new((const char *)entry->value->data, entry->value->length),
+ INT2FIX(entry->value->type));
rb_ary_push(ret, ary);
}
return ret;
@@ -380,18 +302,18 @@ ossl_x509name_cmp0(VALUE self, VALUE other)
X509_NAME *name1, *name2;
GetX509Name(self, name1);
- GetX509Name(other, name2);
+ SafeGetX509Name(other, name2);
return X509_NAME_cmp(name1, name2);
}
/*
* call-seq:
- * name.cmp(other) -> -1 | 0 | 1
- * name <=> other -> -1 | 0 | 1
+ * name.cmp other => integer
+ * name.<=> other => integer
*
- * Compares this Name with _other_ and returns +0+ if they are the same and +-1+
- * or ++1+ if they are greater or less than each other respectively.
+ * Compares this Name with +other+ and returns 0 if they are the same and -1 or
+ * +1 if they are greater or less than each other respectively.
*/
static VALUE
ossl_x509name_cmp(VALUE self, VALUE other)
@@ -400,24 +322,26 @@ ossl_x509name_cmp(VALUE self, VALUE other)
result = ossl_x509name_cmp0(self, other);
if (result < 0) return INT2FIX(-1);
- if (result > 0) return INT2FIX(1);
+ if (result > 1) return INT2FIX(1);
return INT2FIX(0);
}
/*
* call-seq:
- * name.eql?(other) -> true | false
+ * name.eql? other => boolean
*
- * Returns true if _name_ and _other_ refer to the same hash key.
+ * Returns true if +name+ and +other+ refer to the same hash key.
*/
static VALUE
ossl_x509name_eql(VALUE self, VALUE other)
{
- if (!rb_obj_is_kind_of(other, cX509Name))
- return Qfalse;
+ int result;
- return ossl_x509name_cmp0(self, other) == 0 ? Qtrue : Qfalse;
+ if(CLASS_OF(other) != cX509Name) return Qfalse;
+ result = ossl_x509name_cmp0(self, other);
+
+ return (result == 0) ? Qtrue : Qfalse;
}
/*
@@ -440,6 +364,7 @@ ossl_x509name_hash(VALUE self)
return ULONG2NUM(hash);
}
+#ifdef HAVE_X509_NAME_HASH_OLD
/*
* call-seq:
* name.hash_old => integer
@@ -458,6 +383,7 @@ ossl_x509name_hash_old(VALUE self)
return ULONG2NUM(hash);
}
+#endif
/*
* call-seq:
@@ -500,17 +426,10 @@ ossl_x509name_to_der(VALUE self)
*/
void
-Init_ossl_x509name(void)
+Init_ossl_x509name()
{
-#undef rb_intern
VALUE utf8str, ptrstr, ia5str, hash;
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
id_aref = rb_intern("[]");
eX509NameError = rb_define_class_under(mX509, "NameError", eOSSLError);
cX509Name = rb_define_class_under(mX509, "Name", rb_cObject);
@@ -519,24 +438,24 @@ Init_ossl_x509name(void)
rb_define_alloc_func(cX509Name, ossl_x509name_alloc);
rb_define_method(cX509Name, "initialize", ossl_x509name_initialize, -1);
- rb_define_method(cX509Name, "initialize_copy", ossl_x509name_initialize_copy, 1);
rb_define_method(cX509Name, "add_entry", ossl_x509name_add_entry, -1);
rb_define_method(cX509Name, "to_s", ossl_x509name_to_s, -1);
- rb_define_method(cX509Name, "to_utf8", ossl_x509name_to_utf8, 0);
- rb_define_method(cX509Name, "inspect", ossl_x509name_inspect, 0);
rb_define_method(cX509Name, "to_a", ossl_x509name_to_a, 0);
rb_define_method(cX509Name, "cmp", ossl_x509name_cmp, 1);
rb_define_alias(cX509Name, "<=>", "cmp");
rb_define_method(cX509Name, "eql?", ossl_x509name_eql, 1);
rb_define_method(cX509Name, "hash", ossl_x509name_hash, 0);
+#ifdef HAVE_X509_NAME_HASH_OLD
rb_define_method(cX509Name, "hash_old", ossl_x509name_hash_old, 0);
+#endif
rb_define_method(cX509Name, "to_der", ossl_x509name_to_der, 0);
utf8str = INT2NUM(V_ASN1_UTF8STRING);
ptrstr = INT2NUM(V_ASN1_PRINTABLESTRING);
ia5str = INT2NUM(V_ASN1_IA5STRING);
- /*
+ /* Document-const: DEFAULT_OBJECT_TYPE
+ *
* The default object type for name entries.
*/
rb_define_const(cX509Name, "DEFAULT_OBJECT_TYPE", utf8str);
@@ -550,12 +469,14 @@ Init_ossl_x509name(void)
rb_hash_aset(hash, rb_str_new2("domainComponent"), ia5str);
rb_hash_aset(hash, rb_str_new2("emailAddress"), ia5str);
- /*
+ /* Document-const: OBJECT_TYPE_TEMPLATE
+ *
* The default object type template for name entries.
*/
rb_define_const(cX509Name, "OBJECT_TYPE_TEMPLATE", hash);
- /*
+ /* Document-const: COMPAT
+ *
* A flag for #to_s.
*
* Breaks the name returned into multiple lines if longer than 80
@@ -563,21 +484,24 @@ Init_ossl_x509name(void)
*/
rb_define_const(cX509Name, "COMPAT", ULONG2NUM(XN_FLAG_COMPAT));
- /*
+ /* Document-const: RFC2253
+ *
* A flag for #to_s.
*
* Returns an RFC2253 format name.
*/
rb_define_const(cX509Name, "RFC2253", ULONG2NUM(XN_FLAG_RFC2253));
- /*
+ /* Document-const: ONELINE
+ *
* A flag for #to_s.
*
* Returns a more readable format than RFC2253.
*/
rb_define_const(cX509Name, "ONELINE", ULONG2NUM(XN_FLAG_ONELINE));
- /*
+ /* Document-const: MULTILINE
+ *
* A flag for #to_s.
*
* Returns a multiline format.
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c
index 2c20042a92..5927f76d44 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Req(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509req_type, 0)
-#define SetX509Req(obj, req) do { \
+#define WrapX509Req(klass, obj, req) do { \
if (!(req)) { \
ossl_raise(rb_eRuntimeError, "Req wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (req); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_REQ_free, (req)); \
} while (0)
#define GetX509Req(obj, req) do { \
- TypedData_Get_Struct((obj), X509_REQ, &ossl_x509req_type, (req)); \
+ Data_Get_Struct((obj), X509_REQ, (req)); \
if (!(req)) { \
ossl_raise(rb_eRuntimeError, "Req wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509Req(obj, req) do { \
+ OSSL_Check_Kind((obj), cX509Req); \
+ GetX509Req((obj), (req)); \
+} while (0)
/*
* Classes
@@ -30,33 +33,51 @@
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
*/
+VALUE
+ossl_x509req_new(X509_REQ *req)
+{
+ X509_REQ *new;
+ VALUE obj;
+
+ if (!req) {
+ new = X509_REQ_new();
+ } else {
+ new = X509_REQ_dup(req);
+ }
+ if (!new) {
+ ossl_raise(eX509ReqError, NULL);
+ }
+ WrapX509Req(cX509Req, obj, new);
+
+ return obj;
+}
+
X509_REQ *
GetX509ReqPtr(VALUE obj)
{
X509_REQ *req;
- GetX509Req(obj, req);
+ SafeGetX509Req(obj, req);
return req;
}
+X509_REQ *
+DupX509ReqPtr(VALUE obj)
+{
+ X509_REQ *req, *new;
+
+ SafeGetX509Req(obj, req);
+ if (!(new = X509_REQ_dup(req))) {
+ ossl_raise(eX509ReqError, NULL);
+ }
+
+ return new;
+}
+
/*
* Private functions
*/
@@ -66,11 +87,10 @@ ossl_x509req_alloc(VALUE klass)
X509_REQ *req;
VALUE obj;
- obj = NewX509Req(klass);
if (!(req = X509_REQ_new())) {
ossl_raise(eX509ReqError, NULL);
}
- SetX509Req(obj, req);
+ WrapX509Req(klass, obj, req);
return obj;
}
@@ -86,7 +106,7 @@ ossl_x509req_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
arg = ossl_to_der_if_possible(arg);
- in = ossl_obj2bio(&arg);
+ in = ossl_obj2bio(arg);
req = PEM_read_bio_X509_REQ(in, &x, NULL, NULL);
DATA_PTR(self) = x;
if (!req) {
@@ -108,7 +128,7 @@ ossl_x509req_copy(VALUE self, VALUE other)
rb_check_frozen(self);
if (self == other) return self;
GetX509Req(self, a);
- GetX509Req(other, b);
+ SafeGetX509Req(other, b);
if (!(req = X509_REQ_dup(b))) {
ossl_raise(eX509ReqError, NULL);
}
@@ -123,6 +143,8 @@ ossl_x509req_to_pem(VALUE self)
{
X509_REQ *req;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509Req(self, req);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -132,8 +154,11 @@ ossl_x509req_to_pem(VALUE self)
BIO_free(out);
ossl_raise(eX509ReqError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
static VALUE
@@ -161,6 +186,8 @@ ossl_x509req_to_text(VALUE self)
{
X509_REQ *req;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509Req(self, req);
if (!(out = BIO_new(BIO_s_mem()))) {
@@ -170,8 +197,11 @@ ossl_x509req_to_text(VALUE self)
BIO_free(out);
ossl_raise(eX509ReqError, NULL);
}
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
- return ossl_membio2str(out);
+ return str;
}
#if 0
@@ -203,7 +233,7 @@ ossl_x509req_get_version(VALUE self)
GetX509Req(self, req);
version = X509_REQ_get_version(req);
- return LONG2NUM(version);
+ return LONG2FIX(version);
}
static VALUE
@@ -212,12 +242,12 @@ ossl_x509req_set_version(VALUE self, VALUE version)
X509_REQ *req;
long ver;
- if ((ver = NUM2LONG(version)) < 0) {
+ if ((ver = FIX2LONG(version)) < 0) {
ossl_raise(eX509ReqError, "version must be >= 0!");
}
GetX509Req(self, req);
if (!X509_REQ_set_version(req, ver)) {
- ossl_raise(eX509ReqError, "X509_REQ_set_version");
+ ossl_raise(eX509ReqError, NULL);
}
return version;
@@ -255,21 +285,23 @@ static VALUE
ossl_x509req_get_signature_algorithm(VALUE self)
{
X509_REQ *req;
- const X509_ALGOR *alg;
BIO *out;
+ BUF_MEM *buf;
+ VALUE str;
GetX509Req(self, req);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eX509ReqError, NULL);
}
- X509_REQ_get0_signature(req, NULL, &alg);
- if (!i2a_ASN1_OBJECT(out, alg->algorithm)) {
+ if (!i2a_ASN1_OBJECT(out, req->sig_alg->algorithm)) {
BIO_free(out);
ossl_raise(eX509ReqError, NULL);
}
-
- return ossl_membio2str(out);
+ BIO_get_mem_ptr(out, &buf);
+ str = rb_str_new(buf->data, buf->length);
+ BIO_free(out);
+ return str;
}
static VALUE
@@ -293,10 +325,11 @@ ossl_x509req_set_public_key(VALUE self, VALUE key)
EVP_PKEY *pkey;
GetX509Req(self, req);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- if (!X509_REQ_set_pubkey(req, pkey))
- ossl_raise(eX509ReqError, "X509_REQ_set_pubkey");
+ pkey = GetPKeyPtr(key); /* NO NEED TO DUP */
+ if (!X509_REQ_set_pubkey(req, pkey)) {
+ ossl_raise(eX509ReqError, NULL);
+ }
+
return key;
}
@@ -309,7 +342,7 @@ ossl_x509req_sign(VALUE self, VALUE key, VALUE digest)
GetX509Req(self, req);
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ md = GetDigestPtr(digest);
if (!X509_REQ_sign(req, pkey, md)) {
ossl_raise(eX509ReqError, NULL);
}
@@ -325,19 +358,18 @@ ossl_x509req_verify(VALUE self, VALUE key)
{
X509_REQ *req;
EVP_PKEY *pkey;
+ int i;
GetX509Req(self, req);
- pkey = GetPKeyPtr(key);
- ossl_pkey_check_public_key(pkey);
- switch (X509_REQ_verify(req, pkey)) {
- case 1:
- return Qtrue;
- case 0:
- ossl_clear_error();
- return Qfalse;
- default:
+ pkey = GetPKeyPtr(key); /* NO NEED TO DUP */
+ if ((i = X509_REQ_verify(req, pkey)) < 0) {
ossl_raise(eX509ReqError, NULL);
}
+ if (i > 0) {
+ return Qtrue;
+ }
+
+ return Qfalse;
}
static VALUE
@@ -369,19 +401,19 @@ ossl_x509req_set_attributes(VALUE self, VALUE ary)
{
X509_REQ *req;
X509_ATTRIBUTE *attr;
- long i;
+ int i;
VALUE item;
Check_Type(ary, T_ARRAY);
for (i=0;i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Attr);
+ OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Attr);
}
GetX509Req(self, req);
- while ((attr = X509_REQ_delete_attr(req, 0)))
- X509_ATTRIBUTE_free(attr);
+ 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_AREF(ary, i);
- attr = GetX509AttrPtr(item);
+ item = RARRAY_PTR(ary)[i];
+ attr = DupX509AttrPtr(item);
if (!X509_REQ_add1_attr(req, attr)) {
ossl_raise(eX509ReqError, NULL);
}
@@ -395,7 +427,7 @@ ossl_x509req_add_attribute(VALUE self, VALUE attr)
X509_REQ *req;
GetX509Req(self, req);
- if (!X509_REQ_add1_attr(req, GetX509AttrPtr(attr))) {
+ if (!X509_REQ_add1_attr(req, DupX509AttrPtr(attr))) {
ossl_raise(eX509ReqError, NULL);
}
@@ -406,21 +438,15 @@ ossl_x509req_add_attribute(VALUE self, VALUE attr)
* X509_REQUEST init
*/
void
-Init_ossl_x509req(void)
+Init_ossl_x509req()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
eX509ReqError = rb_define_class_under(mX509, "RequestError", eOSSLError);
cX509Req = rb_define_class_under(mX509, "Request", rb_cObject);
rb_define_alloc_func(cX509Req, ossl_x509req_alloc);
rb_define_method(cX509Req, "initialize", ossl_x509req_initialize, -1);
- rb_define_method(cX509Req, "initialize_copy", ossl_x509req_copy, 1);
+ rb_define_copy_func(cX509Req, ossl_x509req_copy);
rb_define_method(cX509Req, "to_pem", ossl_x509req_to_pem, 0);
rb_define_method(cX509Req, "to_der", ossl_x509req_to_der, 0);
@@ -439,3 +465,4 @@ Init_ossl_x509req(void)
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 5fe6853430..320abaa7ae 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -1,28 +1,31 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Rev(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509rev_type, 0)
-#define SetX509Rev(obj, rev) do { \
+#define WrapX509Rev(klass, obj, rev) do { \
if (!(rev)) { \
ossl_raise(rb_eRuntimeError, "REV wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (rev); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_REVOKED_free, (rev)); \
} while (0)
#define GetX509Rev(obj, rev) do { \
- TypedData_Get_Struct((obj), X509_REVOKED, &ossl_x509rev_type, (rev)); \
+ Data_Get_Struct((obj), X509_REVOKED, (rev)); \
if (!(rev)) { \
ossl_raise(rb_eRuntimeError, "REV wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509Rev(obj, rev) do { \
+ OSSL_Check_Kind((obj), cX509Rev); \
+ GetX509Rev((obj), (rev)); \
+} while (0)
/*
* Classes
@@ -30,20 +33,6 @@
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
*/
@@ -53,7 +42,6 @@ ossl_x509revoked_new(X509_REVOKED *rev)
X509_REVOKED *new;
VALUE obj;
- obj = NewX509Rev(cX509Rev);
if (!rev) {
new = X509_REVOKED_new();
} else {
@@ -62,7 +50,7 @@ ossl_x509revoked_new(X509_REVOKED *rev)
if (!new) {
ossl_raise(eX509RevError, NULL);
}
- SetX509Rev(obj, new);
+ WrapX509Rev(cX509Rev, obj, new);
return obj;
}
@@ -72,7 +60,7 @@ DupX509RevokedPtr(VALUE obj)
{
X509_REVOKED *rev, *new;
- GetX509Rev(obj, rev);
+ SafeGetX509Rev(obj, rev);
if (!(new = X509_REVOKED_dup(rev))) {
ossl_raise(eX509RevError, NULL);
}
@@ -89,11 +77,10 @@ ossl_x509revoked_alloc(VALUE klass)
X509_REVOKED *rev;
VALUE obj;
- obj = NewX509Rev(klass);
if (!(rev = X509_REVOKED_new())) {
ossl_raise(eX509RevError, NULL);
}
- SetX509Rev(obj, rev);
+ WrapX509Rev(klass, obj, rev);
return obj;
}
@@ -106,47 +93,22 @@ ossl_x509revoked_initialize(int argc, VALUE *argv, VALUE self)
}
static VALUE
-ossl_x509revoked_initialize_copy(VALUE self, VALUE other)
-{
- X509_REVOKED *rev, *rev_other, *rev_new;
-
- rb_check_frozen(self);
- GetX509Rev(self, rev);
- GetX509Rev(other, rev_other);
-
- rev_new = X509_REVOKED_dup(rev_other);
- if (!rev_new)
- ossl_raise(eX509RevError, "X509_REVOKED_dup");
-
- SetX509Rev(self, rev_new);
- X509_REVOKED_free(rev);
-
- return self;
-}
-
-static VALUE
ossl_x509revoked_get_serial(VALUE self)
{
X509_REVOKED *rev;
GetX509Rev(self, rev);
- return asn1integer_to_num(X509_REVOKED_get0_serialNumber(rev));
+ return asn1integer_to_num(rev->serialNumber);
}
static VALUE
ossl_x509revoked_set_serial(VALUE self, VALUE num)
{
X509_REVOKED *rev;
- ASN1_INTEGER *asn1int;
GetX509Rev(self, rev);
- asn1int = num_to_asn1integer(num, NULL);
- if (!X509_REVOKED_set_serialNumber(rev, asn1int)) {
- ASN1_INTEGER_free(asn1int);
- ossl_raise(eX509RevError, "X509_REVOKED_set_serialNumber");
- }
- ASN1_INTEGER_free(asn1int);
+ rev->serialNumber = num_to_asn1integer(num, rev->serialNumber);
return num;
}
@@ -155,29 +117,23 @@ static VALUE
ossl_x509revoked_get_time(VALUE self)
{
X509_REVOKED *rev;
- const ASN1_TIME *time;
GetX509Rev(self, rev);
- time = X509_REVOKED_get0_revocationDate(rev);
- if (!time)
- return Qnil;
- return asn1time_to_time(time);
+ return asn1time_to_time(rev->revocationDate);
}
static VALUE
ossl_x509revoked_set_time(VALUE self, VALUE time)
{
X509_REVOKED *rev;
- ASN1_TIME *asn1time;
+ time_t sec;
+ sec = time_to_time_t(time);
GetX509Rev(self, rev);
- asn1time = ossl_x509_time_adjust(NULL, time);
- if (!X509_REVOKED_set_revocationDate(rev, asn1time)) {
- ASN1_TIME_free(asn1time);
- ossl_raise(eX509RevError, "X509_REVOKED_set_revocationDate");
+ if (!X509_time_adj(rev->revocationDate, 0, &sec)) {
+ ossl_raise(eX509RevError, NULL);
}
- ASN1_TIME_free(asn1time);
return time;
}
@@ -215,19 +171,19 @@ ossl_x509revoked_set_extensions(VALUE self, VALUE ary)
{
X509_REVOKED *rev;
X509_EXTENSION *ext;
- long i;
+ int i;
VALUE item;
Check_Type(ary, T_ARRAY);
for (i=0; i<RARRAY_LEN(ary); i++) {
- OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
+ OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
}
GetX509Rev(self, rev);
- while ((ext = X509_REVOKED_delete_ext(rev, 0)))
- X509_EXTENSION_free(ext);
+ sk_X509_EXTENSION_pop_free(rev->extensions, X509_EXTENSION_free);
+ rev->extensions = NULL;
for (i=0; i<RARRAY_LEN(ary); i++) {
- item = RARRAY_AREF(ary, i);
- ext = GetX509ExtPtr(item);
+ item = RARRAY_PTR(ary)[i];
+ ext = DupX509ExtPtr(item);
if(!X509_REVOKED_add_ext(rev, ext, -1)) {
ossl_raise(eX509RevError, NULL);
}
@@ -242,52 +198,25 @@ ossl_x509revoked_add_extension(VALUE self, VALUE ext)
X509_REVOKED *rev;
GetX509Rev(self, rev);
- if (!X509_REVOKED_add_ext(rev, GetX509ExtPtr(ext), -1)) {
+ if(!X509_REVOKED_add_ext(rev, DupX509ExtPtr(ext), -1)) {
ossl_raise(eX509RevError, NULL);
}
return ext;
}
-static VALUE
-ossl_x509revoked_to_der(VALUE self)
-{
- X509_REVOKED *rev;
- VALUE str;
- int len;
- unsigned char *p;
-
- GetX509Rev(self, rev);
- len = i2d_X509_REVOKED(rev, NULL);
- if (len <= 0)
- ossl_raise(eX509RevError, "i2d_X509_REVOKED");
- str = rb_str_new(NULL, len);
- p = (unsigned char *)RSTRING_PTR(str);
- if (i2d_X509_REVOKED(rev, &p) <= 0)
- ossl_raise(eX509RevError, "i2d_X509_REVOKED");
- ossl_str_adjust(str, p);
- return str;
-}
-
/*
* INIT
*/
void
-Init_ossl_x509revoked(void)
+Init_ossl_x509revoked()
{
-#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
- mX509 = rb_define_module_under(mOSSL, "X509");
-#endif
-
eX509RevError = rb_define_class_under(mX509, "RevokedError", eOSSLError);
cX509Rev = rb_define_class_under(mX509, "Revoked", rb_cObject);
rb_define_alloc_func(cX509Rev, ossl_x509revoked_alloc);
rb_define_method(cX509Rev, "initialize", ossl_x509revoked_initialize, -1);
- rb_define_method(cX509Rev, "initialize_copy", ossl_x509revoked_initialize_copy, 1);
rb_define_method(cX509Rev, "serial", ossl_x509revoked_get_serial, 0);
rb_define_method(cX509Rev, "serial=", ossl_x509revoked_set_serial, 1);
@@ -296,5 +225,5 @@ Init_ossl_x509revoked(void)
rb_define_method(cX509Rev, "extensions", ossl_x509revoked_get_extensions, 0);
rb_define_method(cX509Rev, "extensions=", ossl_x509revoked_set_extensions, 1);
rb_define_method(cX509Rev, "add_extension", ossl_x509revoked_add_extension, 1);
- rb_define_method(cX509Rev, "to_der", ossl_x509revoked_to_der, 0);
}
+
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index 2909eeda17..f59c376574 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -1,102 +1,48 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#include "ossl.h"
-#define NewX509Store(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509store_type, 0)
-#define SetX509Store(obj, st) do { \
+#define WrapX509Store(klass, obj, st) do { \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (st); \
+ (obj) = Data_Wrap_Struct((klass), 0, X509_STORE_free, (st)); \
} while (0)
#define GetX509Store(obj, st) do { \
- TypedData_Get_Struct((obj), X509_STORE, &ossl_x509store_type, (st)); \
+ Data_Get_Struct((obj), X509_STORE, (st)); \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
} while (0)
+#define SafeGetX509Store(obj, st) do { \
+ OSSL_Check_Kind((obj), cX509Store); \
+ GetX509Store((obj), (st)); \
+} while (0)
-#define NewX509StCtx(klass) \
- TypedData_Wrap_Struct((klass), &ossl_x509stctx_type, 0)
-#define SetX509StCtx(obj, ctx) do { \
+#define WrapX509StCtx(klass, obj, ctx) do { \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX wasn't initialized!"); \
} \
- RTYPEDDATA_DATA(obj) = (ctx); \
+ (obj) = Data_Wrap_Struct((klass), 0, ossl_x509stctx_free, (ctx)); \
} while (0)
#define GetX509StCtx(obj, ctx) do { \
- TypedData_Get_Struct((obj), X509_STORE_CTX, &ossl_x509stctx_type, (ctx)); \
+ Data_Get_Struct((obj), X509_STORE_CTX, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX is out of scope!"); \
} \
} while (0)
-
-/*
- * Verify callback stuff
- */
-static int stctx_ex_verify_cb_idx, store_ex_verify_cb_idx;
-static VALUE ossl_x509stctx_new(X509_STORE_CTX *);
-
-struct ossl_verify_cb_args {
- VALUE proc;
- VALUE preverify_ok;
- VALUE store_ctx;
-};
-
-static VALUE
-call_verify_cb_proc(struct ossl_verify_cb_args *args)
-{
- return rb_funcall(args->proc, rb_intern("call"), 2,
- args->preverify_ok, args->store_ctx);
-}
-
-int
-ossl_verify_cb_call(VALUE proc, int ok, X509_STORE_CTX *ctx)
-{
- VALUE rctx, ret;
- struct ossl_verify_cb_args args;
- int state;
-
- if (NIL_P(proc))
- return ok;
-
- ret = Qfalse;
- rctx = rb_protect((VALUE(*)(VALUE))ossl_x509stctx_new, (VALUE)ctx, &state);
- if (state) {
- rb_set_errinfo(Qnil);
- rb_warn("StoreContext initialization failure");
- }
- else {
- args.proc = proc;
- args.preverify_ok = ok ? Qtrue : Qfalse;
- args.store_ctx = rctx;
- ret = rb_protect((VALUE(*)(VALUE))call_verify_cb_proc, (VALUE)&args, &state);
- if (state) {
- rb_set_errinfo(Qnil);
- rb_warn("exception in verify_callback is ignored");
- }
- RTYPEDDATA_DATA(rctx) = NULL;
- }
- if (ret == Qtrue) {
- X509_STORE_CTX_set_error(ctx, X509_V_OK);
- ok = 1;
- }
- else {
- if (X509_STORE_CTX_get_error(ctx) == X509_V_OK)
- X509_STORE_CTX_set_error(ctx, X509_V_ERR_CERT_REJECTED);
- ok = 0;
- }
-
- return ok;
-}
+#define SafeGetX509StCtx(obj, storep) do { \
+ OSSL_Check_Kind((obj), cX509StoreContext); \
+ GetX509Store((obj), (ctx)); \
+} while (0)
/*
* Classes
@@ -105,62 +51,53 @@ 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
*/
+VALUE
+ossl_x509store_new(X509_STORE *store)
+{
+ VALUE obj;
+
+ WrapX509Store(cX509Store, obj, store);
+
+ return obj;
+}
+
X509_STORE *
GetX509StorePtr(VALUE obj)
{
X509_STORE *store;
- GetX509Store(obj, store);
+ SafeGetX509Store(obj, store);
return store;
}
-/*
- * Private functions
- */
-static int
-x509store_verify_cb(int ok, X509_STORE_CTX *ctx)
+X509_STORE *
+DupX509StorePtr(VALUE obj)
{
- VALUE proc;
+ X509_STORE *store;
- proc = (VALUE)X509_STORE_CTX_get_ex_data(ctx, stctx_ex_verify_cb_idx);
- if (!proc)
- proc = (VALUE)X509_STORE_get_ex_data(X509_STORE_CTX_get0_store(ctx),
- store_ex_verify_cb_idx);
- if (!proc)
- return ok;
+ SafeGetX509Store(obj, store);
+ CRYPTO_add(&store->references, 1, CRYPTO_LOCK_X509_STORE);
- return ossl_verify_cb_call(proc, ok, ctx);
+ return store;
}
+/*
+ * Private functions
+ */
static VALUE
ossl_x509store_alloc(VALUE klass)
{
X509_STORE *store;
VALUE obj;
- obj = NewX509Store(klass);
if((store = X509_STORE_new()) == NULL){
ossl_raise(eX509StoreError, NULL);
}
- SetX509Store(obj, store);
+ WrapX509Store(klass, obj, store);
return obj;
}
@@ -174,7 +111,7 @@ ossl_x509store_set_vfy_cb(VALUE self, VALUE cb)
X509_STORE *store;
GetX509Store(self, store);
- X509_STORE_set_ex_data(store, store_ex_verify_cb_idx, (void *)cb);
+ X509_STORE_set_ex_data(store, ossl_verify_cb_idx, (void*)cb);
rb_iv_set(self, "@verify_callback", cb);
return cb;
@@ -185,7 +122,6 @@ ossl_x509store_set_vfy_cb(VALUE self, VALUE cb)
* call-seq:
* X509::Store.new => store
*
- * Creates a new X509::Store.
*/
static VALUE
ossl_x509store_initialize(int argc, VALUE *argv, VALUE self)
@@ -194,13 +130,16 @@ ossl_x509store_initialize(int argc, VALUE *argv, VALUE self)
/* BUG: This method takes any number of arguments but appears to ignore them. */
GetX509Store(self, store);
-#if !defined(HAVE_OPAQUE_OPENSSL)
- /* [Bug #405] [Bug #1678] [Bug #3000]; already fixed? */
store->ex_data.sk = NULL;
-#endif
- X509_STORE_set_verify_cb(store, x509store_verify_cb);
+ X509_STORE_set_verify_cb_func(store, ossl_verify_cb);
ossl_x509store_set_vfy_cb(self, Qnil);
+#if (OPENSSL_VERSION_NUMBER < 0x00907000L)
+ rb_iv_set(self, "@flags", INT2FIX(0));
+ rb_iv_set(self, "@purpose", INT2FIX(0));
+ rb_iv_set(self, "@trust", INT2FIX(0));
+#endif
+
/* last verification status */
rb_iv_set(self, "@error", Qnil);
rb_iv_set(self, "@error_string", Qnil);
@@ -210,77 +149,54 @@ ossl_x509store_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-/*
- * call-seq:
- * store.flags = flags
- *
- * Sets _flags_ to the Store. _flags_ consists of zero or more of the constants
- * defined in with name V_FLAG_* or'ed together.
- */
static VALUE
ossl_x509store_set_flags(VALUE self, VALUE flags)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE *store;
long f = NUM2LONG(flags);
GetX509Store(self, store);
X509_STORE_set_flags(store, f);
+#else
+ rb_iv_set(self, "@flags", flags);
+#endif
return flags;
}
-/*
- * call-seq:
- * store.purpose = purpose
- *
- * Sets the store's purpose to _purpose_. If specified, the verifications on
- * the store will check every untrusted certificate's extensions are consistent
- * with the purpose. The purpose is specified by constants:
- *
- * * X509::PURPOSE_SSL_CLIENT
- * * X509::PURPOSE_SSL_SERVER
- * * X509::PURPOSE_NS_SSL_SERVER
- * * X509::PURPOSE_SMIME_SIGN
- * * X509::PURPOSE_SMIME_ENCRYPT
- * * X509::PURPOSE_CRL_SIGN
- * * X509::PURPOSE_ANY
- * * X509::PURPOSE_OCSP_HELPER
- * * X509::PURPOSE_TIMESTAMP_SIGN
- */
static VALUE
ossl_x509store_set_purpose(VALUE self, VALUE purpose)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE *store;
int p = NUM2INT(purpose);
GetX509Store(self, store);
X509_STORE_set_purpose(store, p);
+#else
+ rb_iv_set(self, "@purpose", purpose);
+#endif
return purpose;
}
-/*
- * call-seq:
- * store.trust = trust
- */
static VALUE
ossl_x509store_set_trust(VALUE self, VALUE trust)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE *store;
int t = NUM2INT(trust);
GetX509Store(self, store);
X509_STORE_set_trust(store, t);
+#else
+ rb_iv_set(self, "@trust", trust);
+#endif
return trust;
}
-/*
- * call-seq:
- * store.time = time
- *
- * Sets the time to be used in verifications.
- */
static VALUE
ossl_x509store_set_time(VALUE self, VALUE time)
{
@@ -290,12 +206,13 @@ ossl_x509store_set_time(VALUE self, VALUE time)
/*
* call-seq:
- * store.add_file(file) -> self
+ * store.add_file(file) -> store
*
- * Adds the certificates in _file_ to the certificate store. _file_ is the path
- * to the file, and the file contains one or more certificates in PEM format
- * concatenated together.
+ *
+ * Adds the certificates in +file+ to the certificate store. The +file+ can
+ * contain multiple PEM-encoded certificates.
*/
+
static VALUE
ossl_x509store_add_file(VALUE self, VALUE file)
{
@@ -304,8 +221,8 @@ ossl_x509store_add_file(VALUE self, VALUE file)
char *path = NULL;
if(file != Qnil){
- rb_check_safe_obj(file);
- path = StringValueCStr(file);
+ SafeStringValue(file);
+ path = RSTRING_PTR(file);
}
GetX509Store(self, store);
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
@@ -313,25 +230,10 @@ ossl_x509store_add_file(VALUE self, VALUE file)
if(X509_LOOKUP_load_file(lookup, path, X509_FILETYPE_PEM) != 1){
ossl_raise(eX509StoreError, NULL);
}
-#if OPENSSL_VERSION_NUMBER < 0x10101000 || defined(LIBRESSL_VERSION_NUMBER)
- /*
- * 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.
- */
- ossl_clear_error();
-#endif
return self;
}
-/*
- * call-seq:
- * store.add_path(path) -> self
- *
- * Adds _path_ as the hash dir to be looked up by the store.
- */
static VALUE
ossl_x509store_add_path(VALUE self, VALUE dir)
{
@@ -340,8 +242,8 @@ ossl_x509store_add_path(VALUE self, VALUE dir)
char *path = NULL;
if(dir != Qnil){
- rb_check_safe_obj(dir);
- path = StringValueCStr(dir);
+ SafeStringValue(dir);
+ path = RSTRING_PTR(dir);
}
GetX509Store(self, store);
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
@@ -357,12 +259,11 @@ ossl_x509store_add_path(VALUE self, VALUE dir)
* call-seq:
* store.set_default_paths
*
- * Configures _store_ to look up CA certificates from the system default
- * certificate store as needed basis. The location of the store can usually be
+ * Adds the default certificates to the certificate store. These certificates
+ * are loaded from the default configuration directory which can usually be
* determined by:
*
- * * OpenSSL::X509::DEFAULT_CERT_FILE
- * * OpenSSL::X509::DEFAULT_CERT_DIR
+ * File.dirname OpenSSL::Config::DEFAULT_CONFIG_FILE
*/
static VALUE
ossl_x509store_set_default_paths(VALUE self)
@@ -381,8 +282,9 @@ ossl_x509store_set_default_paths(VALUE self)
* call-seq:
* store.add_cert(cert)
*
- * Adds the OpenSSL::X509::Certificate _cert_ to the certificate store.
+ * Adds the OpenSSL::X509::Certificate +cert+ to the certificate store.
*/
+
static VALUE
ossl_x509store_add_cert(VALUE self, VALUE arg)
{
@@ -398,12 +300,6 @@ ossl_x509store_add_cert(VALUE self, VALUE arg)
return self;
}
-/*
- * call-seq:
- * store.add_crl(crl) -> self
- *
- * Adds the OpenSSL::X509::CRL _crl_ to the store.
- */
static VALUE
ossl_x509store_add_crl(VALUE self, VALUE arg)
{
@@ -423,21 +319,6 @@ static VALUE ossl_x509stctx_get_err(VALUE);
static VALUE ossl_x509stctx_get_err_string(VALUE);
static VALUE ossl_x509stctx_get_chain(VALUE);
-/*
- * call-seq:
- * store.verify(cert, chain = nil) -> true | false
- *
- * Performs a certificate verification on the OpenSSL::X509::Certificate _cert_.
- *
- * _chain_ can be an array of OpenSSL::X509::Certificate that is used to
- * construct the certificate chain.
- *
- * If a block is given, it overrides the callback set by #verify_callback=.
- *
- * After finishing the verification, the error information can be retrieved by
- * #error, #error_string, and the resulting complete certificate chain can be
- * retrieved by #chain.
- */
static VALUE
ossl_x509store_verify(int argc, VALUE *argv, VALUE self)
{
@@ -461,28 +342,37 @@ ossl_x509store_verify(int argc, VALUE *argv, VALUE self)
/*
* Public Functions
*/
-static void ossl_x509stctx_free(void*);
+static void ossl_x509stctx_free(X509_STORE_CTX*);
+
+VALUE
+ossl_x509stctx_new(X509_STORE_CTX *ctx)
+{
+ VALUE obj;
+
+ WrapX509StCtx(cX509StoreContext, obj, ctx);
+
+ return obj;
+}
+VALUE
+ossl_x509stctx_clear_ptr(VALUE obj)
+{
+ OSSL_Check_Kind(obj, cX509StoreContext);
+ RDATA(obj)->data = NULL;
-static const rb_data_type_t ossl_x509stctx_type = {
- "OpenSSL/X509/STORE_CTX",
- {
- 0, ossl_x509stctx_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
-};
+ return obj;
+}
/*
* Private functions
*/
static void
-ossl_x509stctx_free(void *ptr)
+ossl_x509stctx_free(X509_STORE_CTX *ctx)
{
- X509_STORE_CTX *ctx = ptr;
- if (X509_STORE_CTX_get0_untrusted(ctx))
- sk_X509_pop_free(X509_STORE_CTX_get0_untrusted(ctx), X509_free);
- if (X509_STORE_CTX_get0_cert(ctx))
- X509_free(X509_STORE_CTX_get0_cert(ctx));
+ if(ctx->untrusted)
+ sk_X509_pop_free(ctx->untrusted, X509_free);
+ if(ctx->cert)
+ X509_free(ctx->cert);
X509_STORE_CTX_free(ctx);
}
@@ -492,22 +382,10 @@ 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);
}
- SetX509StCtx(obj, ctx);
-
- return obj;
-}
-
-static VALUE
-ossl_x509stctx_new(X509_STORE_CTX *ctx)
-{
- VALUE obj;
-
- obj = NewX509StCtx(cX509StoreContext);
- SetX509StCtx(obj, ctx);
+ WrapX509StCtx(klass, obj, ctx);
return obj;
}
@@ -517,10 +395,6 @@ static VALUE ossl_x509stctx_set_purpose(VALUE, VALUE);
static VALUE ossl_x509stctx_set_trust(VALUE, VALUE);
static VALUE ossl_x509stctx_set_time(VALUE, VALUE);
-/*
- * call-seq:
- * StoreContext.new(store, cert = nil, chain = nil)
- */
static VALUE
ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -532,13 +406,20 @@ ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "12", &store, &cert, &chain);
GetX509StCtx(self, ctx);
- GetX509Store(store, x509st);
+ SafeGetX509Store(store, x509st);
if(!NIL_P(cert)) x509 = DupX509CertPtr(cert); /* NEED TO DUP */
if(!NIL_P(chain)) x509s = ossl_x509_ary2sk(chain);
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
if(X509_STORE_CTX_init(ctx, x509st, x509, x509s) != 1){
sk_X509_pop_free(x509s, X509_free);
ossl_raise(eX509StoreError, NULL);
}
+#else
+ X509_STORE_CTX_init(ctx, x509st, x509, x509s);
+ ossl_x509stctx_set_flags(self, rb_iv_get(store, "@flags"));
+ ossl_x509stctx_set_purpose(self, rb_iv_get(store, "@purpose"));
+ ossl_x509stctx_set_trust(self, rb_iv_get(store, "@trust"));
+#endif
if (!NIL_P(t = rb_iv_get(store, "@time")))
ossl_x509stctx_set_time(self, t);
rb_iv_set(self, "@verify_callback", rb_iv_get(store, "@verify_callback"));
@@ -547,34 +428,20 @@ ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
-/*
- * call-seq:
- * stctx.verify -> true | false
- */
static VALUE
ossl_x509stctx_verify(VALUE self)
{
X509_STORE_CTX *ctx;
+ int result;
GetX509StCtx(self, ctx);
- X509_STORE_CTX_set_ex_data(ctx, stctx_ex_verify_cb_idx,
- (void *)rb_iv_get(self, "@verify_callback"));
-
- switch (X509_verify_cert(ctx)) {
- case 1:
- return Qtrue;
- case 0:
- ossl_clear_error();
- return Qfalse;
- default:
- ossl_raise(eX509CertError, NULL);
- }
+ X509_STORE_CTX_set_ex_data(ctx, ossl_verify_cb_idx,
+ (void*)rb_iv_get(self, "@verify_callback"));
+ result = X509_verify_cert(ctx);
+
+ return result ? Qtrue : Qfalse;
}
-/*
- * call-seq:
- * stctx.chain -> Array of X509::Certificate
- */
static VALUE
ossl_x509stctx_get_chain(VALUE self)
{
@@ -585,7 +452,7 @@ ossl_x509stctx_get_chain(VALUE self)
VALUE ary;
GetX509StCtx(self, ctx);
- if((chain = X509_STORE_CTX_get0_chain(ctx)) == NULL){
+ if((chain = X509_STORE_CTX_get_chain(ctx)) == NULL){
return Qnil;
}
if((num = sk_X509_num(chain)) < 0){
@@ -601,10 +468,6 @@ ossl_x509stctx_get_chain(VALUE self)
return ary;
}
-/*
- * call-seq:
- * stctx.error -> Integer
- */
static VALUE
ossl_x509stctx_get_err(VALUE self)
{
@@ -612,13 +475,9 @@ ossl_x509stctx_get_err(VALUE self)
GetX509StCtx(self, ctx);
- return INT2NUM(X509_STORE_CTX_get_error(ctx));
+ return INT2FIX(X509_STORE_CTX_get_error(ctx));
}
-/*
- * call-seq:
- * stctx.error = error_code
- */
static VALUE
ossl_x509stctx_set_error(VALUE self, VALUE err)
{
@@ -630,12 +489,6 @@ ossl_x509stctx_set_error(VALUE self, VALUE err)
return err;
}
-/*
- * call-seq:
- * stctx.error_string -> String
- *
- * Returns the error string corresponding to the error code retrieved by #error.
- */
static VALUE
ossl_x509stctx_get_err_string(VALUE self)
{
@@ -648,10 +501,6 @@ ossl_x509stctx_get_err_string(VALUE self)
return rb_str_new2(X509_verify_cert_error_string(err));
}
-/*
- * call-seq:
- * stctx.error_depth -> Integer
- */
static VALUE
ossl_x509stctx_get_err_depth(VALUE self)
{
@@ -659,13 +508,9 @@ ossl_x509stctx_get_err_depth(VALUE self)
GetX509StCtx(self, ctx);
- return INT2NUM(X509_STORE_CTX_get_error_depth(ctx));
+ return INT2FIX(X509_STORE_CTX_get_error_depth(ctx));
}
-/*
- * call-seq:
- * stctx.current_cert -> X509::Certificate
- */
static VALUE
ossl_x509stctx_get_curr_cert(VALUE self)
{
@@ -676,30 +521,21 @@ ossl_x509stctx_get_curr_cert(VALUE self)
return ossl_x509_new(X509_STORE_CTX_get_current_cert(ctx));
}
-/*
- * call-seq:
- * stctx.current_crl -> X509::CRL
- */
static VALUE
ossl_x509stctx_get_curr_crl(VALUE self)
{
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
X509_STORE_CTX *ctx;
- X509_CRL *crl;
GetX509StCtx(self, ctx);
- crl = X509_STORE_CTX_get0_current_crl(ctx);
- if (!crl)
- return Qnil;
+ if(!ctx->current_crl) return Qnil;
- return ossl_x509crl_new(crl);
+ return ossl_x509crl_new(ctx->current_crl);
+#else
+ return Qnil;
+#endif
}
-/*
- * call-seq:
- * stctx.flags = flags
- *
- * Sets the verification flags to the context. See Store#flags=.
- */
static VALUE
ossl_x509stctx_set_flags(VALUE self, VALUE flags)
{
@@ -712,12 +548,6 @@ ossl_x509stctx_set_flags(VALUE self, VALUE flags)
return flags;
}
-/*
- * call-seq:
- * stctx.purpose = purpose
- *
- * Sets the purpose of the context. See Store#purpose=.
- */
static VALUE
ossl_x509stctx_set_purpose(VALUE self, VALUE purpose)
{
@@ -730,10 +560,6 @@ ossl_x509stctx_set_purpose(VALUE self, VALUE purpose)
return purpose;
}
-/*
- * call-seq:
- * stctx.trust = trust
- */
static VALUE
ossl_x509stctx_set_trust(VALUE self, VALUE trust)
{
@@ -748,9 +574,7 @@ ossl_x509stctx_set_trust(VALUE self, VALUE trust)
/*
* call-seq:
- * stctx.time = time
- *
- * Sets the time used in the verification. If not set, the current time is used.
+ * storectx.time = time => time
*/
static VALUE
ossl_x509stctx_set_time(VALUE self, VALUE time)
@@ -769,23 +593,15 @@ ossl_x509stctx_set_time(VALUE self, VALUE time)
* INIT
*/
void
-Init_ossl_x509store(void)
+Init_ossl_x509store()
{
-#undef rb_intern
+ VALUE x509stctx;
+
#if 0
- mOSSL = rb_define_module("OpenSSL");
- eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
+ mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
mX509 = rb_define_module_under(mOSSL, "X509");
#endif
- /* Register ext_data slot for verify callback Proc */
- stctx_ex_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"stctx_ex_verify_cb_idx", 0, 0, 0);
- if (stctx_ex_verify_cb_idx < 0)
- ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
- store_ex_verify_cb_idx = X509_STORE_get_ex_new_index(0, (void *)"store_ex_verify_cb_idx", 0, 0, 0);
- if (store_ex_verify_cb_idx < 0)
- ossl_raise(eOSSLError, "X509_STORE_get_ex_new_index");
-
eX509StoreError = rb_define_class_under(mX509, "StoreError", eOSSLError);
/* Document-class: OpenSSL::X509::Store
@@ -800,11 +616,11 @@ Init_ossl_x509store(void)
*
* This will use your system's built-in certificates.
*
- * If your system does not have a default set of certificates you can obtain
- * a set extracted from Mozilla CA certificate store by cURL maintainers
- * here: https://curl.haxx.se/docs/caextract.html (You may wish to use the
- * firefox-db2pem.sh script to extract the certificates from a local install
- * to avoid man-in-the-middle attacks.)
+ * If your system does not have a default set of certificates you can
+ * obtain a set from Mozilla here: http://curl.haxx.se/docs/caextract.html
+ * (Note that this set does not have an HTTPS download option so you may
+ * wish to use the firefox-db2pem.sh script to extract the certificates
+ * from a local install to avoid man-in-the-middle attacks.)
*
* After downloading or generating a cacert.pem from the above link you
* can create a certificate store from the pem file like this:
@@ -815,7 +631,6 @@ Init_ossl_x509store(void)
* The certificate store can be used with an SSLSocket like this:
*
* ssl_context = OpenSSL::SSL::SSLContext.new
- * ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
* ssl_context.cert_store = cert_store
*
* tcp_socket = TCPSocket.open 'example.com', 443
@@ -824,30 +639,12 @@ Init_ossl_x509store(void)
*/
cX509Store = rb_define_class_under(mX509, "Store", rb_cObject);
- /*
- * The callback for additional certificate verification. It is invoked for
- * each untrusted certificate in the chain.
- *
- * The callback is invoked with two values, a boolean that indicates if the
- * pre-verification by OpenSSL has succeeded or not, and the StoreContext in
- * use. The callback must return either true or false.
- */
rb_attr(cX509Store, rb_intern("verify_callback"), 1, 0, Qfalse);
- /*
- * The error code set by the last call of #verify.
- */
rb_attr(cX509Store, rb_intern("error"), 1, 0, Qfalse);
- /*
- * The description for the error code set by the last call of #verify.
- */
rb_attr(cX509Store, rb_intern("error_string"), 1, 0, Qfalse);
- /*
- * The certificate chain constructed by the last call of #verify.
- */
rb_attr(cX509Store, rb_intern("chain"), 1, 0, Qfalse);
rb_define_alloc_func(cX509Store, ossl_x509store_alloc);
rb_define_method(cX509Store, "initialize", ossl_x509store_initialize, -1);
- rb_undef_method(cX509Store, "initialize_copy");
rb_define_method(cX509Store, "verify_callback=", ossl_x509store_set_vfy_cb, 1);
rb_define_method(cX509Store, "flags=", ossl_x509store_set_flags, 1);
rb_define_method(cX509Store, "purpose=", ossl_x509store_set_purpose, 1);
@@ -860,26 +657,21 @@ Init_ossl_x509store(void)
rb_define_method(cX509Store, "add_crl", ossl_x509store_add_crl, 1);
rb_define_method(cX509Store, "verify", ossl_x509store_verify, -1);
- /*
- * Document-class: OpenSSL::X509::StoreContext
- *
- * A StoreContext is used while validating a single certificate and holds
- * the status involved.
- */
- cX509StoreContext = rb_define_class_under(mX509,"StoreContext", rb_cObject);
+ cX509StoreContext = rb_define_class_under(mX509,"StoreContext",rb_cObject);
+ x509stctx = cX509StoreContext;
rb_define_alloc_func(cX509StoreContext, ossl_x509stctx_alloc);
- rb_define_method(cX509StoreContext, "initialize", ossl_x509stctx_initialize, -1);
- rb_undef_method(cX509StoreContext, "initialize_copy");
- rb_define_method(cX509StoreContext, "verify", ossl_x509stctx_verify, 0);
- rb_define_method(cX509StoreContext, "chain", ossl_x509stctx_get_chain,0);
- rb_define_method(cX509StoreContext, "error", ossl_x509stctx_get_err, 0);
- rb_define_method(cX509StoreContext, "error=", ossl_x509stctx_set_error, 1);
- rb_define_method(cX509StoreContext, "error_string", ossl_x509stctx_get_err_string,0);
- rb_define_method(cX509StoreContext, "error_depth", ossl_x509stctx_get_err_depth, 0);
- rb_define_method(cX509StoreContext, "current_cert", ossl_x509stctx_get_curr_cert, 0);
- rb_define_method(cX509StoreContext, "current_crl", ossl_x509stctx_get_curr_crl, 0);
- rb_define_method(cX509StoreContext, "flags=", ossl_x509stctx_set_flags, 1);
- rb_define_method(cX509StoreContext, "purpose=", ossl_x509stctx_set_purpose, 1);
- rb_define_method(cX509StoreContext, "trust=", ossl_x509stctx_set_trust, 1);
- rb_define_method(cX509StoreContext, "time=", ossl_x509stctx_set_time, 1);
+ rb_define_method(x509stctx,"initialize", ossl_x509stctx_initialize, -1);
+ rb_define_method(x509stctx,"verify", ossl_x509stctx_verify, 0);
+ rb_define_method(x509stctx,"chain", ossl_x509stctx_get_chain,0);
+ rb_define_method(x509stctx,"error", ossl_x509stctx_get_err, 0);
+ rb_define_method(x509stctx,"error=", ossl_x509stctx_set_error, 1);
+ rb_define_method(x509stctx,"error_string",ossl_x509stctx_get_err_string,0);
+ rb_define_method(x509stctx,"error_depth", ossl_x509stctx_get_err_depth, 0);
+ rb_define_method(x509stctx,"current_cert",ossl_x509stctx_get_curr_cert, 0);
+ rb_define_method(x509stctx,"current_crl", ossl_x509stctx_get_curr_crl, 0);
+ rb_define_method(x509stctx,"flags=", ossl_x509stctx_set_flags, 1);
+ rb_define_method(x509stctx,"purpose=", ossl_x509stctx_set_purpose, 1);
+ rb_define_method(x509stctx,"trust=", ossl_x509stctx_set_trust, 1);
+ rb_define_method(x509stctx,"time=", ossl_x509stctx_set_time, 1);
+
}
diff --git a/ext/openssl/ruby_missing.h b/ext/openssl/ruby_missing.h
index 069acc8b14..0f9de1c842 100644
--- a/ext/openssl/ruby_missing.h
+++ b/ext/openssl/ruby_missing.h
@@ -1,24 +1,28 @@
/*
+ * $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2003 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
- * This program is licensed under the same licence as Ruby.
+ * This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_RUBY_MISSING_H_)
#define _OSSL_RUBY_MISSING_H_
-/* Ruby 2.4 */
-#ifndef RB_INTEGER_TYPE_P
-# define RB_INTEGER_TYPE_P(obj) (RB_FIXNUM_P(obj) || RB_TYPE_P(obj, T_BIGNUM))
+#define rb_define_copy_func(klass, func) \
+ rb_define_method((klass), "initialize_copy", (func), 1)
+
+
+#ifndef GetReadFile
+#define FPTR_TO_FD(fptr) ((fptr)->fd)
+#else
+#define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
#endif
-/* Ruby 2.5 */
-#ifndef ST2FIX
-# define RB_ST2FIX(h) LONG2FIX((long)(h))
-# define ST2FIX(h) RB_ST2FIX(h)
+#ifndef HAVE_RB_IO_T
+#define rb_io_t OpenFile
#endif
#endif /* _OSSL_RUBY_MISSING_H_ */
diff --git a/ext/pathname/depend b/ext/pathname/depend
index 42abd32130..79b6c53f50 100644
--- a/ext/pathname/depend
+++ b/ext/pathname/depend
@@ -1,16 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-pathname.o: $(RUBY_EXTCONF_H)
-pathname.o: $(arch_hdrdir)/ruby/config.h
-pathname.o: $(hdrdir)/ruby/backward.h
-pathname.o: $(hdrdir)/ruby/defines.h
-pathname.o: $(hdrdir)/ruby/encoding.h
-pathname.o: $(hdrdir)/ruby/intern.h
-pathname.o: $(hdrdir)/ruby/missing.h
-pathname.o: $(hdrdir)/ruby/onigmo.h
-pathname.o: $(hdrdir)/ruby/oniguruma.h
-pathname.o: $(hdrdir)/ruby/ruby.h
-pathname.o: $(hdrdir)/ruby/st.h
-pathname.o: $(hdrdir)/ruby/subst.h
-pathname.o: $(top_srcdir)/include/ruby.h
-pathname.o: pathname.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/pathname/extconf.rb b/ext/pathname/extconf.rb
index c9133bc153..037f10065d 100644
--- a/ext/pathname/extconf.rb
+++ b/ext/pathname/extconf.rb
@@ -1,4 +1,3 @@
-# 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 ed7d8c791b..82541e9b15 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = pathname.rb
#
@@ -15,9 +14,12 @@ require 'pathname.so'
class Pathname
# :stopdoc:
-
- # to_path is implemented so Pathname objects are usable with File.open, etc.
- TO_PATH = :to_path
+ 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
SAME_PATHS = if File::FNM_SYSCASE.nonzero?
# Avoid #zero? here because #casecmp can return nil.
@@ -281,17 +283,9 @@ 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 }
@@ -314,17 +308,9 @@ 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)
@@ -380,7 +366,7 @@ class Pathname
basename_list2.shift
end
r1 = chop_basename(prefix1)
- if !r1 && (r1 = /#{SEPARATOR_PAT}/o =~ File.basename(prefix1))
+ if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
while !basename_list2.empty? && basename_list2.first == '..'
index_list2.shift
basename_list2.shift
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 2d74e9cf80..7c24598759 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -2,75 +2,7 @@
#include "ruby/encoding.h"
static VALUE rb_cPathname;
-static ID id_ENOTDIR;
-static ID id_at_path;
-static ID id_atime;
-static ID id_base;
-static ID id_basename;
-static ID id_binread;
-static ID id_binwrite;
-static ID id_birthtime;
-static ID id_blockdev_p;
-static ID id_chardev_p;
-static ID id_chmod;
-static ID id_chown;
-static ID id_ctime;
-static ID id_directory_p;
-static ID id_dirname;
-static ID id_empty_p;
-static ID id_entries;
-static ID id_executable_p;
-static ID id_executable_real_p;
-static ID id_exist_p;
-static ID id_expand_path;
-static ID id_extname;
-static ID id_file_p;
-static ID id_fnmatch;
-static ID id_foreach;
-static ID id_ftype;
-static ID id_getwd;
-static ID id_glob;
-static ID id_grpowned_p;
-static ID id_lchmod;
-static ID id_lchown;
-static ID id_link;
-static ID id_lstat;
-static ID id_mkdir;
-static ID id_mtime;
-static ID id_open;
-static ID id_owned_p;
-static ID id_pipe_p;
-static ID id_read;
-static ID id_readable_p;
-static ID id_readable_real_p;
-static ID id_readlines;
-static ID id_readlink;
-static ID id_realdirpath;
-static ID id_realpath;
-static ID id_rename;
-static ID id_rmdir;
-static ID id_setgid_p;
-static ID id_setuid_p;
-static ID id_size;
-static ID id_size_p;
-static ID id_socket_p;
-static ID id_split;
-static ID id_stat;
-static ID id_sticky_p;
-static ID id_sub;
-static ID id_symlink;
-static ID id_symlink_p;
-static ID id_sysopen;
-static ID id_to_path;
-static ID id_truncate;
-static ID id_unlink;
-static ID id_utime;
-static ID id_world_readable_p;
-static ID id_world_writable_p;
-static ID id_writable_p;
-static ID id_writable_real_p;
-static ID id_write;
-static ID id_zero_p;
+static ID id_at_path, id_to_path;
static VALUE
get_strpath(VALUE obj)
@@ -223,15 +155,11 @@ path_cmp(VALUE self, VALUE other)
return INT2FIX(0);
}
-#ifndef ST2FIX
-#define ST2FIX(h) LONG2FIX((long)(h))
-#endif
-
/* :nodoc: */
static VALUE
path_hash(VALUE self)
{
- return ST2FIX(rb_str_hash(get_strpath(self)));
+ return INT2FIX(rb_str_hash(get_strpath(self)));
}
/*
@@ -271,10 +199,10 @@ path_sub(int argc, VALUE *argv, VALUE self)
VALUE str = get_strpath(self);
if (rb_block_given_p()) {
- str = rb_block_call(str, id_sub, argc, argv, 0, 0);
+ str = rb_block_call(str, rb_intern("sub"), argc, argv, 0, 0);
}
else {
- str = rb_funcallv(str, id_sub, argc, argv);
+ str = rb_funcall2(str, rb_intern("sub"), argc, argv);
}
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -329,7 +257,7 @@ path_realpath(int argc, VALUE *argv, VALUE self)
{
VALUE basedir, str;
rb_scan_args(argc, argv, "01", &basedir);
- str = rb_funcall(rb_cFile, id_realpath, 2, get_strpath(self), basedir);
+ str = rb_funcall(rb_cFile, rb_intern("realpath"), 2, get_strpath(self), basedir);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -345,7 +273,7 @@ path_realdirpath(int argc, VALUE *argv, VALUE self)
{
VALUE basedir, str;
rb_scan_args(argc, argv, "01", &basedir);
- str = rb_funcall(rb_cFile, id_realdirpath, 2, get_strpath(self), basedir);
+ str = rb_funcall(rb_cFile, rb_intern("realdirpath"), 2, get_strpath(self), basedir);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -368,10 +296,10 @@ path_each_line(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
if (rb_block_given_p()) {
- return rb_block_call(rb_cIO, id_foreach, 1+n, args, 0, 0);
+ return rb_block_call(rb_cIO, rb_intern("foreach"), 1+n, args, 0, 0);
}
else {
- return rb_funcallv(rb_cIO, id_foreach, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("foreach"), 1+n, args);
}
}
@@ -393,7 +321,7 @@ path_read(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
- return rb_funcallv(rb_cIO, id_read, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("read"), 1+n, args);
}
/*
@@ -413,7 +341,7 @@ path_binread(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "02", &args[1], &args[2]);
- return rb_funcallv(rb_cIO, id_binread, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("binread"), 1+n, args);
}
/*
@@ -434,7 +362,7 @@ path_write(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
- return rb_funcallv(rb_cIO, id_write, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("write"), 1+n, args);
}
/*
@@ -455,7 +383,7 @@ path_binwrite(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
- return rb_funcallv(rb_cIO, id_binwrite, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("binwrite"), 1+n, args);
}
/*
@@ -477,7 +405,7 @@ path_readlines(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
- return rb_funcallv(rb_cIO, id_readlines, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("readlines"), 1+n, args);
}
/*
@@ -495,7 +423,7 @@ path_sysopen(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "02", &args[1], &args[2]);
- return rb_funcallv(rb_cIO, id_sysopen, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("sysopen"), 1+n, args);
}
/*
@@ -509,7 +437,7 @@ path_sysopen(int argc, VALUE *argv, VALUE self)
static VALUE
path_atime(VALUE self)
{
- return rb_funcall(rb_cFile, id_atime, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("atime"), 1, get_strpath(self));
}
#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) || defined(_WIN32)
@@ -518,14 +446,14 @@ path_atime(VALUE self)
* pathname.birthtime -> time
*
* Returns the birth time for the file.
- * If the platform doesn't have birthtime, raises NotImplementedError.
+ * If the platform doesn't have birthtime, returns <i>ctime</i>.
*
* See File.birthtime.
*/
static VALUE
path_birthtime(VALUE self)
{
- return rb_funcall(rb_cFile, id_birthtime, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("birthtime"), 1, get_strpath(self));
}
#else
# define path_birthtime rb_f_notimplement
@@ -542,7 +470,7 @@ path_birthtime(VALUE self)
static VALUE
path_ctime(VALUE self)
{
- return rb_funcall(rb_cFile, id_ctime, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("ctime"), 1, get_strpath(self));
}
/*
@@ -556,7 +484,7 @@ path_ctime(VALUE self)
static VALUE
path_mtime(VALUE self)
{
- return rb_funcall(rb_cFile, id_mtime, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("mtime"), 1, get_strpath(self));
}
/*
@@ -570,7 +498,7 @@ path_mtime(VALUE self)
static VALUE
path_chmod(VALUE self, VALUE mode)
{
- return rb_funcall(rb_cFile, id_chmod, 2, mode, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("chmod"), 2, mode, get_strpath(self));
}
/*
@@ -584,7 +512,7 @@ path_chmod(VALUE self, VALUE mode)
static VALUE
path_lchmod(VALUE self, VALUE mode)
{
- return rb_funcall(rb_cFile, id_lchmod, 2, mode, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("lchmod"), 2, mode, get_strpath(self));
}
/*
@@ -598,7 +526,7 @@ path_lchmod(VALUE self, VALUE mode)
static VALUE
path_chown(VALUE self, VALUE owner, VALUE group)
{
- return rb_funcall(rb_cFile, id_chown, 3, owner, group, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("chown"), 3, owner, group, get_strpath(self));
}
/*
@@ -612,7 +540,7 @@ path_chown(VALUE self, VALUE owner, VALUE group)
static VALUE
path_lchown(VALUE self, VALUE owner, VALUE group)
{
- return rb_funcall(rb_cFile, id_lchown, 3, owner, group, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("lchown"), 3, owner, group, get_strpath(self));
}
/*
@@ -630,9 +558,9 @@ path_fnmatch(int argc, VALUE *argv, VALUE self)
VALUE str = get_strpath(self);
VALUE pattern, flags;
if (rb_scan_args(argc, argv, "11", &pattern, &flags) == 1)
- return rb_funcall(rb_cFile, id_fnmatch, 2, pattern, str);
+ return rb_funcall(rb_cFile, rb_intern("fnmatch"), 2, pattern, str);
else
- return rb_funcall(rb_cFile, id_fnmatch, 3, pattern, str, flags);
+ return rb_funcall(rb_cFile, rb_intern("fnmatch"), 3, pattern, str, flags);
}
/*
@@ -646,7 +574,7 @@ path_fnmatch(int argc, VALUE *argv, VALUE self)
static VALUE
path_ftype(VALUE self)
{
- return rb_funcall(rb_cFile, id_ftype, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("ftype"), 1, get_strpath(self));
}
/*
@@ -660,7 +588,7 @@ path_ftype(VALUE self)
static VALUE
path_make_link(VALUE self, VALUE old)
{
- return rb_funcall(rb_cFile, id_link, 2, old, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("link"), 2, old, get_strpath(self));
}
/*
@@ -677,10 +605,10 @@ path_open(int argc, VALUE *argv, VALUE self)
args[0] = get_strpath(self);
n = rb_scan_args(argc, argv, "03", &args[1], &args[2], &args[3]);
if (rb_block_given_p()) {
- return rb_block_call(rb_cFile, id_open, 1+n, args, 0, 0);
+ return rb_block_call(rb_cFile, rb_intern("open"), 1+n, args, 0, 0);
}
else {
- return rb_funcallv(rb_cFile, id_open, 1+n, args);
+ return rb_funcall2(rb_cFile, rb_intern("open"), 1+n, args);
}
}
@@ -693,7 +621,7 @@ static VALUE
path_readlink(VALUE self)
{
VALUE str;
- str = rb_funcall(rb_cFile, id_readlink, 1, get_strpath(self));
+ str = rb_funcall(rb_cFile, rb_intern("readlink"), 1, get_strpath(self));
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -705,7 +633,7 @@ path_readlink(VALUE self)
static VALUE
path_rename(VALUE self, VALUE to)
{
- return rb_funcall(rb_cFile, id_rename, 2, get_strpath(self), to);
+ return rb_funcall(rb_cFile, rb_intern("rename"), 2, get_strpath(self), to);
}
/*
@@ -716,7 +644,7 @@ path_rename(VALUE self, VALUE to)
static VALUE
path_stat(VALUE self)
{
- return rb_funcall(rb_cFile, id_stat, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("stat"), 1, get_strpath(self));
}
/*
@@ -725,7 +653,7 @@ path_stat(VALUE self)
static VALUE
path_lstat(VALUE self)
{
- return rb_funcall(rb_cFile, id_lstat, 1, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("lstat"), 1, get_strpath(self));
}
/*
@@ -739,7 +667,7 @@ path_lstat(VALUE self)
static VALUE
path_make_symlink(VALUE self, VALUE old)
{
- return rb_funcall(rb_cFile, id_symlink, 2, old, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("symlink"), 2, old, get_strpath(self));
}
/*
@@ -750,7 +678,7 @@ path_make_symlink(VALUE self, VALUE old)
static VALUE
path_truncate(VALUE self, VALUE length)
{
- return rb_funcall(rb_cFile, id_truncate, 2, get_strpath(self), length);
+ return rb_funcall(rb_cFile, rb_intern("truncate"), 2, get_strpath(self), length);
}
/*
@@ -761,7 +689,7 @@ path_truncate(VALUE self, VALUE length)
static VALUE
path_utime(VALUE self, VALUE atime, VALUE mtime)
{
- return rb_funcall(rb_cFile, id_utime, 3, atime, mtime, get_strpath(self));
+ return rb_funcall(rb_cFile, rb_intern("utime"), 3, atime, mtime, get_strpath(self));
}
/*
@@ -775,9 +703,9 @@ path_basename(int argc, VALUE *argv, VALUE self)
VALUE str = get_strpath(self);
VALUE fext;
if (rb_scan_args(argc, argv, "01", &fext) == 0)
- str = rb_funcall(rb_cFile, id_basename, 1, str);
+ str = rb_funcall(rb_cFile, rb_intern("basename"), 1, str);
else
- str = rb_funcall(rb_cFile, id_basename, 2, str, fext);
+ str = rb_funcall(rb_cFile, rb_intern("basename"), 2, str, fext);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -790,7 +718,7 @@ static VALUE
path_dirname(VALUE self)
{
VALUE str = get_strpath(self);
- str = rb_funcall(rb_cFile, id_dirname, 1, str);
+ str = rb_funcall(rb_cFile, rb_intern("dirname"), 1, str);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -803,7 +731,7 @@ static VALUE
path_extname(VALUE self)
{
VALUE str = get_strpath(self);
- return rb_funcall(rb_cFile, id_extname, 1, str);
+ return rb_funcall(rb_cFile, rb_intern("extname"), 1, str);
}
/*
@@ -817,9 +745,9 @@ path_expand_path(int argc, VALUE *argv, VALUE self)
VALUE str = get_strpath(self);
VALUE dname;
if (rb_scan_args(argc, argv, "01", &dname) == 0)
- str = rb_funcall(rb_cFile, id_expand_path, 1, str);
+ str = rb_funcall(rb_cFile, rb_intern("expand_path"), 1, str);
else
- str = rb_funcall(rb_cFile, id_expand_path, 2, str, dname);
+ str = rb_funcall(rb_cFile, rb_intern("expand_path"), 2, str, dname);
return rb_class_new_instance(1, &str, rb_obj_class(self));
}
@@ -833,7 +761,7 @@ path_split(VALUE self)
{
VALUE str = get_strpath(self);
VALUE ary, dirname, basename;
- ary = rb_funcall(rb_cFile, id_split, 1, str);
+ ary = rb_funcall(rb_cFile, rb_intern("split"), 1, str);
ary = rb_check_array_type(ary);
dirname = rb_ary_entry(ary, 0);
basename = rb_ary_entry(ary, 1);
@@ -848,7 +776,7 @@ path_split(VALUE self)
static VALUE
path_blockdev_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_blockdev_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("blockdev?"), 1, get_strpath(self));
}
/*
@@ -857,7 +785,7 @@ path_blockdev_p(VALUE self)
static VALUE
path_chardev_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_chardev_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("chardev?"), 1, get_strpath(self));
}
/*
@@ -866,7 +794,7 @@ path_chardev_p(VALUE self)
static VALUE
path_executable_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_executable_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("executable?"), 1, get_strpath(self));
}
/*
@@ -875,7 +803,7 @@ path_executable_p(VALUE self)
static VALUE
path_executable_real_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_executable_real_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("executable_real?"), 1, get_strpath(self));
}
/*
@@ -884,7 +812,7 @@ path_executable_real_p(VALUE self)
static VALUE
path_exist_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_exist_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("exist?"), 1, get_strpath(self));
}
/*
@@ -893,7 +821,7 @@ path_exist_p(VALUE self)
static VALUE
path_grpowned_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_grpowned_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("grpowned?"), 1, get_strpath(self));
}
/*
@@ -902,7 +830,7 @@ path_grpowned_p(VALUE self)
static VALUE
path_directory_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_directory_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("directory?"), 1, get_strpath(self));
}
/*
@@ -911,7 +839,7 @@ path_directory_p(VALUE self)
static VALUE
path_file_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_file_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("file?"), 1, get_strpath(self));
}
/*
@@ -920,7 +848,7 @@ path_file_p(VALUE self)
static VALUE
path_pipe_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_pipe_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("pipe?"), 1, get_strpath(self));
}
/*
@@ -929,7 +857,7 @@ path_pipe_p(VALUE self)
static VALUE
path_socket_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_socket_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("socket?"), 1, get_strpath(self));
}
/*
@@ -938,7 +866,7 @@ path_socket_p(VALUE self)
static VALUE
path_owned_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_owned_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("owned?"), 1, get_strpath(self));
}
/*
@@ -947,7 +875,7 @@ path_owned_p(VALUE self)
static VALUE
path_readable_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_readable_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("readable?"), 1, get_strpath(self));
}
/*
@@ -956,7 +884,7 @@ path_readable_p(VALUE self)
static VALUE
path_world_readable_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_world_readable_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("world_readable?"), 1, get_strpath(self));
}
/*
@@ -965,7 +893,7 @@ path_world_readable_p(VALUE self)
static VALUE
path_readable_real_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_readable_real_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("readable_real?"), 1, get_strpath(self));
}
/*
@@ -974,7 +902,7 @@ path_readable_real_p(VALUE self)
static VALUE
path_setuid_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_setuid_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("setuid?"), 1, get_strpath(self));
}
/*
@@ -983,7 +911,7 @@ path_setuid_p(VALUE self)
static VALUE
path_setgid_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_setgid_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("setgid?"), 1, get_strpath(self));
}
/*
@@ -992,7 +920,7 @@ path_setgid_p(VALUE self)
static VALUE
path_size(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_size, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("size"), 1, get_strpath(self));
}
/*
@@ -1001,7 +929,7 @@ path_size(VALUE self)
static VALUE
path_size_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_size_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("size?"), 1, get_strpath(self));
}
/*
@@ -1010,7 +938,7 @@ path_size_p(VALUE self)
static VALUE
path_sticky_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_sticky_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("sticky?"), 1, get_strpath(self));
}
/*
@@ -1019,7 +947,7 @@ path_sticky_p(VALUE self)
static VALUE
path_symlink_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_symlink_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("symlink?"), 1, get_strpath(self));
}
/*
@@ -1028,7 +956,7 @@ path_symlink_p(VALUE self)
static VALUE
path_writable_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_writable_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("writable?"), 1, get_strpath(self));
}
/*
@@ -1037,7 +965,7 @@ path_writable_p(VALUE self)
static VALUE
path_world_writable_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_world_writable_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("world_writable?"), 1, get_strpath(self));
}
/*
@@ -1046,7 +974,7 @@ path_world_writable_p(VALUE self)
static VALUE
path_writable_real_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_writable_real_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("writable_real?"), 1, get_strpath(self));
}
/*
@@ -1055,27 +983,11 @@ path_writable_real_p(VALUE self)
static VALUE
path_zero_p(VALUE self)
{
- return rb_funcall(rb_mFileTest, id_zero_p, 1, get_strpath(self));
+ return rb_funcall(rb_mFileTest, rb_intern("zero?"), 1, get_strpath(self));
}
-/*
- * Tests the file is empty.
- *
- * See Dir#empty? and FileTest.empty?.
- */
static VALUE
-path_empty_p(VALUE self)
-{
-
- VALUE path = get_strpath(self);
- if (RTEST(rb_funcall(rb_mFileTest, id_directory_p, 1, path)))
- return rb_funcall(rb_cDir, id_empty_p, 1, path);
- else
- return rb_funcall(rb_mFileTest, id_empty_p, 1, path);
-}
-
-static VALUE
-s_glob_i(RB_BLOCK_CALL_FUNC_ARGLIST(elt, klass))
+glob_i(RB_BLOCK_CALL_FUNC_ARGLIST(elt, klass))
{
return rb_yield(rb_class_new_instance(1, &elt, klass));
}
@@ -1083,8 +995,8 @@ s_glob_i(RB_BLOCK_CALL_FUNC_ARGLIST(elt, klass))
/*
* Returns or yields Pathname objects.
*
- * Pathname.glob("lib/i*.rb")
- * #=> [#<Pathname:lib/ipaddr.rb>, #<Pathname:lib/irb.rb>]
+ * Pathname.glob("config/" "*.rb")
+ * #=> [#<Pathname:config/environment.rb>, #<Pathname:config/routes.rb>, ..]
*
* See Dir.glob.
*/
@@ -1096,12 +1008,12 @@ path_s_glob(int argc, VALUE *argv, VALUE klass)
n = rb_scan_args(argc, argv, "11", &args[0], &args[1]);
if (rb_block_given_p()) {
- return rb_block_call(rb_cDir, id_glob, n, args, s_glob_i, klass);
+ return rb_block_call(rb_cDir, rb_intern("glob"), n, args, glob_i, klass);
}
else {
VALUE ary;
long i;
- ary = rb_funcallv(rb_cDir, id_glob, n, args);
+ ary = rb_funcall2(rb_cDir, rb_intern("glob"), n, args);
ary = rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
for (i = 0; i < RARRAY_LEN(ary); i++) {
VALUE elt = RARRAY_AREF(ary, i);
@@ -1112,54 +1024,6 @@ path_s_glob(int argc, VALUE *argv, VALUE klass)
}
}
-static VALUE
-glob_i(RB_BLOCK_CALL_FUNC_ARGLIST(elt, self))
-{
- elt = rb_funcall(self, '+', 1, elt);
- return rb_yield(elt);
-}
-
-/*
- * Returns or yields Pathname objects.
- *
- * Pathname("ruby-2.4.2").glob("R*.md")
- * #=> [#<Pathname:ruby-2.4.2/README.md>, #<Pathname:ruby-2.4.2/README.ja.md>]
- *
- * See Dir.glob.
- * This method uses the +base+ keyword argument of Dir.glob.
- */
-static VALUE
-path_glob(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[3];
- int n;
-
- n = rb_scan_args(argc, argv, "11", &args[0], &args[1]);
- if (n == 1)
- args[1] = INT2FIX(0);
-
- args[2] = rb_hash_new();
- rb_hash_aset(args[2], ID2SYM(id_base), get_strpath(self));
-
- n = 3;
-
- if (rb_block_given_p()) {
- return rb_block_call(rb_cDir, id_glob, n, args, glob_i, self);
- }
- else {
- VALUE ary;
- long i;
- ary = rb_funcallv(rb_cDir, id_glob, n, args);
- ary = rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_AREF(ary, i);
- elt = rb_funcall(self, '+', 1, elt);
- rb_ary_store(ary, i, elt);
- }
- return ary;
- }
-}
-
/*
* Returns the current working directory as a Pathname.
*
@@ -1172,7 +1036,7 @@ static VALUE
path_s_getwd(VALUE klass)
{
VALUE str;
- str = rb_funcall(rb_cDir, id_getwd, 0);
+ str = rb_funcall(rb_cDir, rb_intern("getwd"), 0);
return rb_class_new_instance(1, &str, klass);
}
@@ -1209,7 +1073,7 @@ path_entries(VALUE self)
long i;
klass = rb_obj_class(self);
str = get_strpath(self);
- ary = rb_funcall(rb_cDir, id_entries, 1, str);
+ ary = rb_funcall(rb_cDir, rb_intern("entries"), 1, str);
ary = rb_convert_type(ary, T_ARRAY, "Array", "to_ary");
for (i = 0; i < RARRAY_LEN(ary); i++) {
VALUE elt = RARRAY_AREF(ary, i);
@@ -1230,9 +1094,9 @@ path_mkdir(int argc, VALUE *argv, VALUE self)
VALUE str = get_strpath(self);
VALUE vmode;
if (rb_scan_args(argc, argv, "01", &vmode) == 0)
- return rb_funcall(rb_cDir, id_mkdir, 1, str);
+ return rb_funcall(rb_cDir, rb_intern("mkdir"), 1, str);
else
- return rb_funcall(rb_cDir, id_mkdir, 2, str, vmode);
+ return rb_funcall(rb_cDir, rb_intern("mkdir"), 2, str, vmode);
}
/*
@@ -1243,7 +1107,7 @@ path_mkdir(int argc, VALUE *argv, VALUE self)
static VALUE
path_rmdir(VALUE self)
{
- return rb_funcall(rb_cDir, id_rmdir, 1, get_strpath(self));
+ return rb_funcall(rb_cDir, rb_intern("rmdir"), 1, get_strpath(self));
}
/*
@@ -1257,7 +1121,7 @@ path_opendir(VALUE self)
VALUE args[1];
args[0] = get_strpath(self);
- return rb_block_call(rb_cDir, id_open, 1, args, 0, 0);
+ return rb_block_call(rb_cDir, rb_intern("open"), 1, args, 0, 0);
}
static VALUE
@@ -1276,19 +1140,19 @@ path_each_entry(VALUE self)
VALUE args[1];
args[0] = get_strpath(self);
- return rb_block_call(rb_cDir, id_foreach, 1, args, each_entry_i, rb_obj_class(self));
+ return rb_block_call(rb_cDir, rb_intern("foreach"), 1, args, each_entry_i, rb_obj_class(self));
}
static VALUE
unlink_body(VALUE str)
{
- return rb_funcall(rb_cDir, id_unlink, 1, str);
+ return rb_funcall(rb_cDir, rb_intern("unlink"), 1, str);
}
static VALUE
unlink_rescue(VALUE str, VALUE errinfo)
{
- return rb_funcall(rb_cFile, id_unlink, 1, str);
+ return rb_funcall(rb_cFile, rb_intern("unlink"), 1, str);
}
/*
@@ -1298,7 +1162,7 @@ unlink_rescue(VALUE str, VALUE errinfo)
static VALUE
path_unlink(VALUE self)
{
- VALUE eENOTDIR = rb_const_get_at(rb_mErrno, id_ENOTDIR);
+ VALUE eENOTDIR = rb_const_get_at(rb_mErrno, rb_intern("ENOTDIR"));
VALUE str = get_strpath(self);
return rb_rescue2(unlink_body, str, unlink_rescue, str, eENOTDIR, (VALUE)0);
}
@@ -1506,9 +1370,10 @@ path_f_pathname(VALUE self, VALUE str)
* information. In some cases, a brief description will follow.
*/
void
-Init_pathname(void)
+Init_pathname()
{
- InitVM(pathname);
+ id_at_path = rb_intern("@path");
+ id_to_path = rb_intern("to_path");
rb_cPathname = rb_define_class("Pathname", rb_cObject);
rb_define_method(rb_cPathname, "initialize", path_initialize, 1);
@@ -1583,11 +1448,9 @@ Init_pathname(void)
rb_define_method(rb_cPathname, "world_writable?", path_world_writable_p, 0);
rb_define_method(rb_cPathname, "writable_real?", path_writable_real_p, 0);
rb_define_method(rb_cPathname, "zero?", path_zero_p, 0);
- rb_define_method(rb_cPathname, "empty?", path_empty_p, 0);
rb_define_singleton_method(rb_cPathname, "glob", path_s_glob, -1);
rb_define_singleton_method(rb_cPathname, "getwd", path_s_getwd, 0);
rb_define_singleton_method(rb_cPathname, "pwd", path_s_getwd, 0);
- rb_define_method(rb_cPathname, "glob", path_glob, -1);
rb_define_method(rb_cPathname, "entries", path_entries, 0);
rb_define_method(rb_cPathname, "mkdir", path_mkdir, -1);
rb_define_method(rb_cPathname, "rmdir", path_rmdir, 0);
@@ -1598,78 +1461,3 @@ Init_pathname(void)
rb_undef_method(rb_cPathname, "=~");
rb_define_global_function("Pathname", path_f_pathname, 1);
}
-
-void
-InitVM_pathname(void)
-{
-#undef rb_intern
- id_at_path = rb_intern("@path");
- id_to_path = rb_intern("to_path");
- id_ENOTDIR = rb_intern("ENOTDIR");
- id_atime = rb_intern("atime");
- id_basename = rb_intern("basename");
- id_base = rb_intern("base");
- id_binread = rb_intern("binread");
- id_binwrite = rb_intern("binwrite");
- id_birthtime = rb_intern("birthtime");
- id_blockdev_p = rb_intern("blockdev?");
- id_chardev_p = rb_intern("chardev?");
- id_chmod = rb_intern("chmod");
- id_chown = rb_intern("chown");
- id_ctime = rb_intern("ctime");
- id_directory_p = rb_intern("directory?");
- id_dirname = rb_intern("dirname");
- id_empty_p = rb_intern("empty?");
- id_entries = rb_intern("entries");
- id_executable_p = rb_intern("executable?");
- id_executable_real_p = rb_intern("executable_real?");
- id_exist_p = rb_intern("exist?");
- id_expand_path = rb_intern("expand_path");
- id_extname = rb_intern("extname");
- id_file_p = rb_intern("file?");
- id_fnmatch = rb_intern("fnmatch");
- id_foreach = rb_intern("foreach");
- id_ftype = rb_intern("ftype");
- id_getwd = rb_intern("getwd");
- id_glob = rb_intern("glob");
- id_grpowned_p = rb_intern("grpowned?");
- id_lchmod = rb_intern("lchmod");
- id_lchown = rb_intern("lchown");
- id_link = rb_intern("link");
- id_lstat = rb_intern("lstat");
- id_mkdir = rb_intern("mkdir");
- id_mtime = rb_intern("mtime");
- id_open = rb_intern("open");
- id_owned_p = rb_intern("owned?");
- id_pipe_p = rb_intern("pipe?");
- id_read = rb_intern("read");
- id_readable_p = rb_intern("readable?");
- id_readable_real_p = rb_intern("readable_real?");
- id_readlines = rb_intern("readlines");
- id_readlink = rb_intern("readlink");
- id_realdirpath = rb_intern("realdirpath");
- id_realpath = rb_intern("realpath");
- id_rename = rb_intern("rename");
- id_rmdir = rb_intern("rmdir");
- id_setgid_p = rb_intern("setgid?");
- id_setuid_p = rb_intern("setuid?");
- id_size = rb_intern("size");
- id_size_p = rb_intern("size?");
- id_socket_p = rb_intern("socket?");
- id_split = rb_intern("split");
- id_stat = rb_intern("stat");
- id_sticky_p = rb_intern("sticky?");
- id_sub = rb_intern("sub");
- id_symlink = rb_intern("symlink");
- id_symlink_p = rb_intern("symlink?");
- id_sysopen = rb_intern("sysopen");
- id_truncate = rb_intern("truncate");
- id_unlink = rb_intern("unlink");
- id_utime = rb_intern("utime");
- id_world_readable_p = rb_intern("world_readable?");
- id_world_writable_p = rb_intern("world_writable?");
- id_writable_p = rb_intern("writable?");
- id_writable_real_p = rb_intern("writable_real?");
- id_write = rb_intern("write");
- id_zero_p = rb_intern("zero?");
-}
diff --git a/ext/psych/depend b/ext/psych/depend
index c5ca1f6b13..79b6c53f50 100644
--- a/ext/psych/depend
+++ b/ext/psych/depend
@@ -1,97 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-psych.o: $(RUBY_EXTCONF_H)
-psych.o: $(arch_hdrdir)/ruby/config.h
-psych.o: $(hdrdir)/ruby/backward.h
-psych.o: $(hdrdir)/ruby/defines.h
-psych.o: $(hdrdir)/ruby/encoding.h
-psych.o: $(hdrdir)/ruby/intern.h
-psych.o: $(hdrdir)/ruby/missing.h
-psych.o: $(hdrdir)/ruby/onigmo.h
-psych.o: $(hdrdir)/ruby/oniguruma.h
-psych.o: $(hdrdir)/ruby/ruby.h
-psych.o: $(hdrdir)/ruby/st.h
-psych.o: $(hdrdir)/ruby/subst.h
-psych.o: $(top_srcdir)/include/ruby.h
-psych.o: psych.c
-psych.o: psych.h
-psych.o: psych_emitter.h
-psych.o: psych_parser.h
-psych.o: psych_to_ruby.h
-psych.o: psych_yaml_tree.h
-psych_emitter.o: $(RUBY_EXTCONF_H)
-psych_emitter.o: $(arch_hdrdir)/ruby/config.h
-psych_emitter.o: $(hdrdir)/ruby/backward.h
-psych_emitter.o: $(hdrdir)/ruby/defines.h
-psych_emitter.o: $(hdrdir)/ruby/encoding.h
-psych_emitter.o: $(hdrdir)/ruby/intern.h
-psych_emitter.o: $(hdrdir)/ruby/missing.h
-psych_emitter.o: $(hdrdir)/ruby/onigmo.h
-psych_emitter.o: $(hdrdir)/ruby/oniguruma.h
-psych_emitter.o: $(hdrdir)/ruby/ruby.h
-psych_emitter.o: $(hdrdir)/ruby/st.h
-psych_emitter.o: $(hdrdir)/ruby/subst.h
-psych_emitter.o: $(top_srcdir)/include/ruby.h
-psych_emitter.o: psych.h
-psych_emitter.o: psych_emitter.c
-psych_emitter.o: psych_emitter.h
-psych_emitter.o: psych_parser.h
-psych_emitter.o: psych_to_ruby.h
-psych_emitter.o: psych_yaml_tree.h
-psych_parser.o: $(RUBY_EXTCONF_H)
-psych_parser.o: $(arch_hdrdir)/ruby/config.h
-psych_parser.o: $(hdrdir)/ruby/backward.h
-psych_parser.o: $(hdrdir)/ruby/defines.h
-psych_parser.o: $(hdrdir)/ruby/encoding.h
-psych_parser.o: $(hdrdir)/ruby/intern.h
-psych_parser.o: $(hdrdir)/ruby/missing.h
-psych_parser.o: $(hdrdir)/ruby/onigmo.h
-psych_parser.o: $(hdrdir)/ruby/oniguruma.h
-psych_parser.o: $(hdrdir)/ruby/ruby.h
-psych_parser.o: $(hdrdir)/ruby/st.h
-psych_parser.o: $(hdrdir)/ruby/subst.h
-psych_parser.o: $(top_srcdir)/include/ruby.h
-psych_parser.o: psych.h
-psych_parser.o: psych_emitter.h
-psych_parser.o: psych_parser.c
-psych_parser.o: psych_parser.h
-psych_parser.o: psych_to_ruby.h
-psych_parser.o: psych_yaml_tree.h
-psych_to_ruby.o: $(RUBY_EXTCONF_H)
-psych_to_ruby.o: $(arch_hdrdir)/ruby/config.h
-psych_to_ruby.o: $(hdrdir)/ruby/backward.h
-psych_to_ruby.o: $(hdrdir)/ruby/defines.h
-psych_to_ruby.o: $(hdrdir)/ruby/encoding.h
-psych_to_ruby.o: $(hdrdir)/ruby/intern.h
-psych_to_ruby.o: $(hdrdir)/ruby/missing.h
-psych_to_ruby.o: $(hdrdir)/ruby/onigmo.h
-psych_to_ruby.o: $(hdrdir)/ruby/oniguruma.h
-psych_to_ruby.o: $(hdrdir)/ruby/ruby.h
-psych_to_ruby.o: $(hdrdir)/ruby/st.h
-psych_to_ruby.o: $(hdrdir)/ruby/subst.h
-psych_to_ruby.o: $(top_srcdir)/include/ruby.h
-psych_to_ruby.o: psych.h
-psych_to_ruby.o: psych_emitter.h
-psych_to_ruby.o: psych_parser.h
-psych_to_ruby.o: psych_to_ruby.c
-psych_to_ruby.o: psych_to_ruby.h
-psych_to_ruby.o: psych_yaml_tree.h
-psych_yaml_tree.o: $(RUBY_EXTCONF_H)
-psych_yaml_tree.o: $(arch_hdrdir)/ruby/config.h
-psych_yaml_tree.o: $(hdrdir)/ruby/backward.h
-psych_yaml_tree.o: $(hdrdir)/ruby/defines.h
-psych_yaml_tree.o: $(hdrdir)/ruby/encoding.h
-psych_yaml_tree.o: $(hdrdir)/ruby/intern.h
-psych_yaml_tree.o: $(hdrdir)/ruby/missing.h
-psych_yaml_tree.o: $(hdrdir)/ruby/onigmo.h
-psych_yaml_tree.o: $(hdrdir)/ruby/oniguruma.h
-psych_yaml_tree.o: $(hdrdir)/ruby/ruby.h
-psych_yaml_tree.o: $(hdrdir)/ruby/st.h
-psych_yaml_tree.o: $(hdrdir)/ruby/subst.h
-psych_yaml_tree.o: $(top_srcdir)/include/ruby.h
-psych_yaml_tree.o: psych.h
-psych_yaml_tree.o: psych_emitter.h
-psych_yaml_tree.o: psych_parser.h
-psych_yaml_tree.o: psych_to_ruby.h
-psych_yaml_tree.o: psych_yaml_tree.c
-psych_yaml_tree.o: psych_yaml_tree.h
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index 6d8390ebe5..65e83a3554 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -1,5 +1,4 @@
# -*- coding: us-ascii -*-
-# frozen_string_literal: true
require 'mkmf'
require 'fileutils'
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index a4d5a96dce..40fcf610e2 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -1,16 +1,4 @@
-# frozen_string_literal: true
-require 'psych/versions'
-case RUBY_ENGINE
-when 'jruby'
- require 'psych_jars'
- org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
-else
- begin
- require "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
- rescue LoadError
- require 'psych.so'
- end
-end
+require 'psych.so'
require 'psych/nodes'
require 'psych/streaming'
require 'psych/visitors'
@@ -21,6 +9,7 @@ require 'psych/omap'
require 'psych/set'
require 'psych/coder'
require 'psych/core_ext'
+require 'psych/deprecated'
require 'psych/stream'
require 'psych/json/tree_builder'
require 'psych/json/stream'
@@ -198,13 +187,12 @@ require 'psych/class_loader'
#
# ==== Receiving an events stream
#
-# recorder = Psych::Handlers::Recorder.new
-# parser = Psych::Parser.new(recorder)
+# parser = Psych::Parser.new(Psych::Handlers::Recorder.new)
#
# parser.parse("---\n - a\n - b")
-# recorder.events # => [list of [event, args] lists]
-# # event is one of: Psych::Handler::EVENTS
-# # args are the arguments passed to the event
+# parser.events # => [list of [event, args] lists]
+# # event is one of: Psych::Handler::EVENTS
+# # args are the arguments passed to the event
#
# === Emitting
#
@@ -228,11 +216,12 @@ require 'psych/class_loader'
# # => "a"
module Psych
+ # The version is Psych you're using
+ VERSION = '2.0.6'
+
# 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.
@@ -252,18 +241,9 @@ module Psych
# ex.file # => 'file.txt'
# ex.message # => "(file.txt): found character that cannot start any token"
# end
- #
- # When the optional +symbolize_names+ keyword argument is set to a
- # true value, returns symbols for keys in Hash objects (default: strings).
- #
- # Psych.load("---\n foo: bar") # => {"foo"=>"bar"}
- # Psych.load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
- #
- def self.load yaml, filename = nil, fallback: false, symbolize_names: false
- result = parse(yaml, filename, fallback: fallback)
- result = result.to_ruby if result
- symbolize_names!(result) if symbolize_names
- result
+ def self.load yaml, filename = nil
+ result = parse(yaml, filename)
+ result ? result.to_ruby : result
end
###
@@ -300,17 +280,7 @@ module Psych
#
# A Psych::BadAlias exception will be raised if the yaml contains aliases
# but the +aliases+ parameter is set to false.
- #
- # +filename+ will be used in the exception message if any exception is raised
- # while parsing.
- #
- # When the optional +symbolize_names+ keyword argument is set to a
- # true value, returns symbols for keys in Hash objects (default: strings).
- #
- # Psych.safe_load("---\n foo: bar") # => {"foo"=>"bar"}
- # Psych.safe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
- #
- def self.safe_load yaml, whitelist_classes = [], whitelist_symbols = [], aliases = false, filename = nil, symbolize_names: false
+ def self.safe_load yaml, whitelist_classes = [], whitelist_symbols = [], aliases = false, filename = nil
result = parse(yaml, filename)
return unless result
@@ -322,9 +292,7 @@ module Psych
else
visitor = Visitors::NoAliasRuby.new scanner, class_loader
end
- result = visitor.accept result
- symbolize_names!(result) if symbolize_names
- result
+ visitor.accept result
end
###
@@ -346,11 +314,11 @@ module Psych
# end
#
# See Psych::Nodes for more information about YAML AST.
- def self.parse yaml, filename = nil, fallback: false
+ def self.parse yaml, filename = nil
parse_stream(yaml, filename) do |node|
return node
end
- fallback
+ false
end
###
@@ -491,12 +459,9 @@ module Psych
###
# Load the document contained in +filename+. Returns the yaml contained in
- # +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: FALLBACK.new(fallback)
- }
+ # +filename+ as a Ruby object
+ def self.load_file filename
+ File.open(filename, 'r:bom|utf-8') { |f| self.load f, filename }
end
# :stopdoc:
@@ -524,19 +489,6 @@ module Psych
@dump_tags[klass] = tag
end
- def self.symbolize_names!(result)
- case result
- when Hash
- result.keys.each do |key|
- result[key.to_sym] = symbolize_names!(result.delete(key))
- end
- when Array
- result.map! { |r| symbolize_names!(r) }
- end
- result
- end
- private_class_method :symbolize_names!
-
class << self
attr_accessor :load_tags
attr_accessor :dump_tags
diff --git a/ext/psych/lib/psych/class_loader.rb b/ext/psych/lib/psych/class_loader.rb
index cfca86845a..46c6b93627 100644
--- a/ext/psych/lib/psych/class_loader.rb
+++ b/ext/psych/lib/psych/class_loader.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'psych/omap'
require 'psych/set'
diff --git a/ext/psych/lib/psych/coder.rb b/ext/psych/lib/psych/coder.rb
index 96a9c3fbad..2b830d2b21 100644
--- a/ext/psych/lib/psych/coder.rb
+++ b/ext/psych/lib/psych/coder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 81055cc501..9c8134da7e 100644
--- a/ext/psych/lib/psych/core_ext.rb
+++ b/ext/psych/lib/psych/core_ext.rb
@@ -1,17 +1,33 @@
-# frozen_string_literal: true
class Object
def self.yaml_tag url
Psych.add_tag(url, self)
end
+ # FIXME: rename this to "to_yaml" when syck is removed
+
###
# call-seq: to_yaml(options = {})
#
# Convert an object to YAML. See Psych.dump for more information on the
# available +options+.
- def to_yaml options = {}
+ def psych_to_yaml options = {}
Psych.dump self, options
end
+ remove_method :to_yaml rescue nil
+ alias :to_yaml :psych_to_yaml
+end
+
+class Module
+ def psych_yaml_as url
+ return if caller[0].end_with?('rubytypes.rb')
+ if $VERBOSE
+ warn "#{caller[0]}: yaml_as is deprecated, please use yaml_tag"
+ end
+ Psych.add_tag(url, self)
+ end
+
+ remove_method :yaml_as rescue nil
+ alias :yaml_as :psych_yaml_as
end
if defined?(::IRB)
diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb
new file mode 100644
index 0000000000..8c310b3207
--- /dev/null
+++ b/ext/psych/lib/psych/deprecated.rb
@@ -0,0 +1,85 @@
+require 'date'
+
+module Psych
+ DEPRECATED = __FILE__ # :nodoc:
+
+ module DeprecatedMethods # :nodoc:
+ attr_accessor :taguri
+ attr_accessor :to_yaml_style
+ end
+
+ def self.quick_emit thing, opts = {}, &block # :nodoc:
+ warn "#{caller[0]}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
+ target = eval 'self', block.binding
+ target.extend DeprecatedMethods
+ metaclass = class << target; self; end
+ metaclass.send(:define_method, :encode_with) do |coder|
+ target.taguri = coder.tag
+ target.to_yaml_style = coder.style
+ block.call coder
+ end
+ target.psych_to_yaml unless opts[:nodump]
+ end
+
+ # This method is deprecated, use Psych.load_stream instead.
+ def self.load_documents yaml, &block
+ if $VERBOSE
+ warn "#{caller[0]}: load_documents is deprecated, use load_stream"
+ end
+ list = load_stream yaml
+ return list unless block_given?
+ list.each(&block)
+ end
+
+ def self.detect_implicit thing
+ warn "#{caller[0]}: detect_implicit is deprecated" if $VERBOSE
+ return '' unless String === thing
+ return 'null' if '' == thing
+ ss = ScalarScanner.new(ClassLoader.new)
+ ss.tokenize(thing).class.name.downcase
+ end
+
+ def self.add_ruby_type type_tag, &block
+ warn "#{caller[0]}: add_ruby_type is deprecated, use add_domain_type" if $VERBOSE
+ domain = 'ruby.yaml.org,2002'
+ key = ['tag', domain, type_tag].join ':'
+ @domain_types[key] = [key, block]
+ end
+
+ def self.add_private_type type_tag, &block
+ warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
+ domain = 'x-private'
+ key = [domain, type_tag].join ':'
+ @domain_types[key] = [key, block]
+ end
+
+ def self.tagurize thing
+ warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
+ return thing unless String === thing
+ "tag:yaml.org,2002:#{thing}"
+ end
+
+ def self.read_type_class type, reference
+ warn "#{caller[0]}: read_type_class is deprecated" if $VERBOSE
+ _, _, type, name = type.split ':', 4
+
+ reference = name.split('::').inject(reference) do |k,n|
+ k.const_get(n.to_sym)
+ end if name
+ [type, reference]
+ end
+
+ def self.object_maker klass, hash
+ warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE
+ klass.allocate.tap do |obj|
+ hash.each { |k,v| obj.instance_variable_set(:"@#{k}", v) }
+ end
+ end
+end
+
+class Object
+ undef :to_yaml_properties rescue nil
+ def to_yaml_properties # :nodoc:
+ instance_variables
+ end
+end
diff --git a/ext/psych/lib/psych/exception.rb b/ext/psych/lib/psych/exception.rb
index fac0c42b9f..ce9d2caf3f 100644
--- a/ext/psych/lib/psych/exception.rb
+++ b/ext/psych/lib/psych/exception.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
class Exception < RuntimeError
end
diff --git a/ext/psych/lib/psych/handler.rb b/ext/psych/lib/psych/handler.rb
index 84a3b4f2bc..c55afe745f 100644
--- a/ext/psych/lib/psych/handler.rb
+++ b/ext/psych/lib/psych/handler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
###
# Psych::Handler is an abstract base class that defines the events used
@@ -242,11 +241,6 @@ module Psych
end
###
- # Called before each event with line/column information.
- def event_location(start_line, start_column, end_line, end_column)
- end
-
- ###
# Is this handler a streaming handler?
def streaming?
false
diff --git a/ext/psych/lib/psych/handlers/document_stream.rb b/ext/psych/lib/psych/handlers/document_stream.rb
index 67da794093..e429993c1c 100644
--- a/ext/psych/lib/psych/handlers/document_stream.rb
+++ b/ext/psych/lib/psych/handlers/document_stream.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 a8fc7b1144..4eae62e5f9 100644
--- a/ext/psych/lib/psych/handlers/recorder.rb
+++ b/ext/psych/lib/psych/handlers/recorder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 17b7ddc386..6b73249c06 100644
--- a/ext/psych/lib/psych/json/ruby_events.rb
+++ b/ext/psych/lib/psych/json/ruby_events.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 2ebd3d7a66..fe2a6e9116 100644
--- a/ext/psych/lib/psych/json/stream.rb
+++ b/ext/psych/lib/psych/json/stream.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 5c2ee8ca25..b799c93f58 100644
--- a/ext/psych/lib/psych/json/tree_builder.rb
+++ b/ext/psych/lib/psych/json/tree_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 eb973f5361..d054d9b458 100644
--- a/ext/psych/lib/psych/json/yaml_events.rb
+++ b/ext/psych/lib/psych/json/yaml_events.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module JSON
module YAMLEvents # :nodoc:
diff --git a/ext/psych/lib/psych/nodes.rb b/ext/psych/lib/psych/nodes.rb
index 5842c2e3e5..f3b33fe975 100644
--- a/ext/psych/lib/psych/nodes.rb
+++ b/ext/psych/lib/psych/nodes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 8131a4befb..5bd4df13d1 100644
--- a/ext/psych/lib/psych/nodes/alias.rb
+++ b/ext/psych/lib/psych/nodes/alias.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/document.rb b/ext/psych/lib/psych/nodes/document.rb
index 3cd418eaf3..32014d60dc 100644
--- a/ext/psych/lib/psych/nodes/document.rb
+++ b/ext/psych/lib/psych/nodes/document.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/mapping.rb b/ext/psych/lib/psych/nodes/mapping.rb
index b921ddc862..5ba95ce4b6 100644
--- a/ext/psych/lib/psych/nodes/mapping.rb
+++ b/ext/psych/lib/psych/nodes/mapping.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index 6d86669a17..83233a61fd 100644
--- a/ext/psych/lib/psych/nodes/node.rb
+++ b/ext/psych/lib/psych/nodes/node.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'stringio'
require 'psych/class_loader'
require 'psych/scalar_scanner'
@@ -17,18 +16,6 @@ module Psych
# An associated tag
attr_reader :tag
- # The line number where this node start
- attr_accessor :start_line
-
- # The column number where this node start
- attr_accessor :start_column
-
- # The line number where this node ends
- attr_accessor :end_line
-
- # The column number where this node ends
- attr_accessor :end_column
-
# Create a new Psych::Nodes::Node
def initialize
@children = []
diff --git a/ext/psych/lib/psych/nodes/scalar.rb b/ext/psych/lib/psych/nodes/scalar.rb
index b448858831..1b1b25b98a 100644
--- a/ext/psych/lib/psych/nodes/scalar.rb
+++ b/ext/psych/lib/psych/nodes/scalar.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/sequence.rb b/ext/psych/lib/psych/nodes/sequence.rb
index 77c2c602b9..7e907fe2c8 100644
--- a/ext/psych/lib/psych/nodes/sequence.rb
+++ b/ext/psych/lib/psych/nodes/sequence.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/nodes/stream.rb b/ext/psych/lib/psych/nodes/stream.rb
index 2474fe62c4..7cf5e033ec 100644
--- a/ext/psych/lib/psych/nodes/stream.rb
+++ b/ext/psych/lib/psych/nodes/stream.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
module Nodes
###
diff --git a/ext/psych/lib/psych/omap.rb b/ext/psych/lib/psych/omap.rb
index 29cde0be50..6286270616 100644
--- a/ext/psych/lib/psych/omap.rb
+++ b/ext/psych/lib/psych/omap.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
class Omap < ::Hash
end
diff --git a/ext/psych/lib/psych/parser.rb b/ext/psych/lib/psych/parser.rb
index 39bc8289be..84085f1fb0 100644
--- a/ext/psych/lib/psych/parser.rb
+++ b/ext/psych/lib/psych/parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 29c156c212..93007902a7 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'strscan'
module Psych
@@ -10,6 +9,7 @@ module Psych
# Taken from http://yaml.org/type/float.html
FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10)
+ |[-+]?[0-9][0-9_,]*(:[0-5]?[0-9])+\.[0-9_]*(?# base 60)
|[-+]?\.(inf|Inf|INF)(?# infinity)
|\.(nan|NaN|NAN)(?# not a number))$/x
@@ -82,13 +82,13 @@ module Psych
else
@symbol_cache[string] = class_loader.symbolize(string.sub(/^:/, ''))
end
- when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9]){1,2}$/
+ when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
i = 0
string.split(':').each_with_index do |n,e|
i += (n.to_i * 60 ** (e - 2).abs)
end
i
- when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9]){1,2}\.[0-9_]*$/
+ when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]*$/
i = 0
string.split(':').each_with_index do |n,e|
i += (n.to_f * 60 ** (e - 2).abs)
@@ -99,7 +99,7 @@ module Psych
@string_cache[string] = true
string
else
- Float(string.gsub(/[,_]|\.([Ee]|$)/, '\1'))
+ Float(string.gsub(/[,_]|\.$/, ''))
end
else
int = parse_int string.gsub(/[,_]/, '')
@@ -143,7 +143,7 @@ module Psych
offset += ((tz[1] || 0) * 60)
end
- klass.new(yy, m, dd, hh, mm, ss+us/(1_000_000r), offset)
+ klass.at((time - offset).to_i, us)
end
end
end
diff --git a/ext/psych/lib/psych/set.rb b/ext/psych/lib/psych/set.rb
index 760d217098..6793a8ed1b 100644
--- a/ext/psych/lib/psych/set.rb
+++ b/ext/psych/lib/psych/set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Psych
class Set < ::Hash
end
diff --git a/ext/psych/lib/psych/stream.rb b/ext/psych/lib/psych/stream.rb
index 24e45afc3b..88c4c4cb4e 100644
--- a/ext/psych/lib/psych/stream.rb
+++ b/ext/psych/lib/psych/stream.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 eb19792ad0..9d94eb549f 100644
--- a/ext/psych/lib/psych/streaming.rb
+++ b/ext/psych/lib/psych/streaming.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 1598e6ff36..e200ef0060 100644
--- a/ext/psych/lib/psych/syntax_error.rb
+++ b/ext/psych/lib/psych/syntax_error.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'psych/exception'
module Psych
diff --git a/ext/psych/lib/psych/tree_builder.rb b/ext/psych/lib/psych/tree_builder.rb
index 47a1695643..c8f344787c 100644
--- a/ext/psych/lib/psych/tree_builder.rb
+++ b/ext/psych/lib/psych/tree_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'psych/handler'
module Psych
@@ -23,18 +22,6 @@ module Psych
@stack = []
@last = nil
@root = nil
-
- @start_line = nil
- @start_column = nil
- @end_line = nil
- @end_column = nil
- end
-
- def event_location(start_line, start_column, end_line, end_column)
- @start_line = start_line
- @start_column = start_column
- @end_line = end_line
- @end_column = end_column
end
%w{
@@ -44,15 +31,12 @@ module Psych
class_eval %{
def start_#{node.downcase}(anchor, tag, implicit, style)
n = Nodes::#{node}.new(anchor, tag, implicit, style)
- set_start_location(n)
@last.children << n
push n
end
def end_#{node.downcase}
- n = pop
- set_end_location(n)
- n
+ pop
end
}
end
@@ -64,7 +48,6 @@ module Psych
# See Psych::Handler#start_document
def start_document version, tag_directives, implicit
n = Nodes::Document.new version, tag_directives, implicit
- set_start_location(n)
@last.children << n
push n
end
@@ -76,35 +59,26 @@ module Psych
# See Psych::Handler#start_document
def end_document implicit_end = !streaming?
@last.implicit_end = implicit_end
- n = pop
- set_end_location(n)
- n
+ pop
end
def start_stream encoding
@root = Nodes::Stream.new(encoding)
- set_start_location(@root)
push @root
end
def end_stream
- n = pop
- set_end_location(n)
- n
+ pop
end
def scalar value, anchor, tag, plain, quoted, style
s = Nodes::Scalar.new(value,anchor,tag,plain,quoted,style)
- set_location(s)
@last.children << s
s
end
def alias anchor
- a = Nodes::Alias.new(anchor)
- set_location(a)
- @last.children << a
- a
+ @last.children << Nodes::Alias.new(anchor)
end
private
@@ -118,20 +92,5 @@ module Psych
@last = @stack.last
x
end
-
- def set_location(node)
- set_start_location(node)
- set_end_location(node)
- end
-
- def set_start_location(node)
- node.start_line = @start_line
- node.start_column = @start_column
- end
-
- def set_end_location(node)
- node.end_line = @end_line
- node.end_column = @end_column
- end
end
end
diff --git a/ext/psych/lib/psych/versions.rb b/ext/psych/lib/psych/versions.rb
deleted file mode 100644
index 33993ec837..0000000000
--- a/ext/psych/lib/psych/versions.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-module Psych
- # The version is Psych you're using
- VERSION = '3.0.2'
-
- if RUBY_ENGINE == 'jruby'
- DEFAULT_SNAKEYAML_VERSION = '1.18'.freeze
- end
-end
diff --git a/ext/psych/lib/psych/visitors.rb b/ext/psych/lib/psych/visitors.rb
index e2b084daee..cc98b103f1 100644
--- a/ext/psych/lib/psych/visitors.rb
+++ b/ext/psych/lib/psych/visitors.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 b4ff9e40e7..c6eb814ac0 100644
--- a/ext/psych/lib/psych/visitors/depth_first.rb
+++ b/ext/psych/lib/psych/visitors/depth_first.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 e3b92b7d03..c886e5092e 100644
--- a/ext/psych/lib/psych/visitors/emitter.rb
+++ b/ext/psych/lib/psych/visitors/emitter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 9912cb1362..0127ac8aa8 100644
--- a/ext/psych/lib/psych/visitors/json_tree.rb
+++ b/ext/psych/lib/psych/visitors/json_tree.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 74a52df866..e74d5d4bc5 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'psych/scalar_scanner'
require 'psych/class_loader'
require 'psych/exception'
@@ -33,7 +32,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]
@@ -62,7 +61,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
@@ -70,11 +69,11 @@ module Psych
o.value
end
when '!ruby/object:BigDecimal'
- require 'bigdecimal' unless defined? BigDecimal
+ require 'bigdecimal'
class_loader.big_decimal._load o.value
when "!ruby/object:DateTime"
class_loader.date_time
- require 'date' unless defined? DateTime
+ require 'date'
@ss.parse_time(o.value).to_datetime
when '!ruby/encoding'
::Encoding.find o.value
@@ -90,7 +89,7 @@ module Psych
Float(@ss.tokenize(o.value))
when "!ruby/regexp"
klass = class_loader.regexp
- o.value =~ /^\/(.*)\/([mixn]*)$/m
+ o.value =~ /^\/(.*)\/([mixn]*)$/
source = $1
options = 0
lang = nil
@@ -209,7 +208,7 @@ module Psych
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
@@ -262,23 +261,8 @@ 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).allocate), o
+ revive_hash register(o, resolve_class($1).new), o
when '!omap', 'tag:yaml.org,2002:omap'
map = register(o, class_loader.psych_omap.new)
@@ -287,21 +271,6 @@ 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
@@ -331,13 +300,12 @@ 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 == SHOVEL && k.tag != "tag:yaml.org,2002:str"
+ if key == '<<' && k.tag != "tag:yaml.org,2002:str"
case v
when Nodes::Alias, Nodes::Mapping
begin
@@ -380,6 +348,11 @@ module Psych
if o.respond_to?(:init_with)
o.init_with c
+ elsif o.respond_to?(:yaml_initialize)
+ if $VERBOSE
+ warn "Implementing #{o.class}#yaml_initialize is deprecated, please implement \"init_with(coder)\""
+ end
+ o.yaml_initialize c.tag, c.map
else
h.each { |k,v| o.instance_variable_set(:"@#{k}", v) }
end
diff --git a/ext/psych/lib/psych/visitors/visitor.rb b/ext/psych/lib/psych/visitors/visitor.rb
index 3f4ba64e57..4d7772f428 100644
--- a/ext/psych/lib/psych/visitors/visitor.rb
+++ b/ext/psych/lib/psych/visitors/visitor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
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 cfed8f1814..3f2427b8d0 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'psych/tree_builder'
require 'psych/scalar_scanner'
require 'psych/class_loader'
@@ -22,15 +21,12 @@ module Psych
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
@@ -53,24 +49,24 @@ module Psych
new(emitter, ss, options)
end
+ def self.new emitter = nil, ss = nil, options = nil
+ return super if emitter && ss && options
+
+ if $VERBOSE
+ warn "This API is deprecated, please pass an emitter, scalar scanner, and options or call #{self}.create() (#{caller.first})"
+ end
+ create emitter, ss
+ end
+
def initialize emitter, ss, options
super()
- @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 = []
+ @started = false
+ @finished = false
+ @emitter = emitter
+ @st = Registrar.new
+ @ss = ss
+ @options = options
+ @coders = []
@dispatch_cache = Hash.new do |h,klass|
method = "visit_#{(klass.name || '').split('::').join('_')}"
@@ -130,6 +126,24 @@ module Psych
return @emitter.alias anchor
end
+ if target.respond_to?(:to_yaml)
+ begin
+ loc = target.method(:to_yaml).source_location.first
+ if loc !~ /(syck\/rubytypes.rb|psych\/core_ext.rb)/
+ unless target.respond_to?(:encode_with)
+ if $VERBOSE
+ warn "implementing to_yaml is deprecated, please implement \"encode_with\""
+ end
+
+ target.to_yaml(:nodump => true)
+ end
+ end
+ rescue
+ # public_method or source_location might be overridden,
+ # and it's OK to skip it since it's only to emit a warning
+ end
+ end
+
if target.respond_to?(:encode_with)
dump_coder target
else
@@ -138,7 +152,7 @@ module Psych
end
def visit_Psych_Omap o
- seq = @emitter.start_sequence(nil, 'tag:yaml.org,2002:omap', false, Nodes::Sequence::BLOCK)
+ seq = @emitter.start_sequence(nil, '!omap', false, Nodes::Sequence::BLOCK)
register(o, seq)
o.each { |k,v| visit_Hash k => v }
@@ -164,8 +178,6 @@ module Psych
@emitter.end_mapping
end
- alias :visit_Delegator :visit_Object
-
def visit_Struct o
tag = ['!ruby/struct', o.class.name].compact.join(':')
@@ -287,46 +299,46 @@ module Psych
quote = true
style = Nodes::Scalar::PLAIN
tag = nil
+ str = o
if binary?(o)
- o = [o].pack('m0')
+ str = [o].pack('m').chomp
tag = '!binary' # FIXME: change to below when syck is removed
#tag = 'tag:yaml.org,2002:binary'
style = Nodes::Scalar::LITERAL
plain = false
quote = false
- elsif o =~ /\n(?!\Z)/ # match \n except blank line at the end of string
+ elsif o =~ /\n/
style = Nodes::Scalar::LITERAL
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:]][^"]*$/
+ elsif o =~ /^\W[^"]*$/
style = Nodes::Scalar::DOUBLE_QUOTED
- elsif not String === @ss.tokenize(o) or /\A0[0-7]*[89]/ =~ o
- style = Nodes::Scalar::SINGLE_QUOTED
+ else
+ unless String === @ss.tokenize(o)
+ style = Nodes::Scalar::SINGLE_QUOTED
+ end
end
- is_primitive = o.class == ::String
- ivars = is_primitive ? [] : o.instance_variables
+ ivars = find_ivars o
if ivars.empty?
- unless is_primitive
+ unless o.class == ::String
tag = "!ruby/string:#{o.class}"
plain = false
quote = false
end
- @emitter.scalar o, nil, tag, plain, quote, style
+ @emitter.scalar str, nil, tag, plain, quote, style
else
- maptag = '!ruby/string'.dup
+ 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 o, nil, tag, plain, quote, style
+ @emitter.scalar str, nil, tag, plain, quote, style
dump_ivars o
@@ -353,16 +365,17 @@ module Psych
end
def visit_Hash o
- 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
+ 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
end
+
+ @emitter.end_mapping
end
def visit_Psych_Set o
@@ -378,18 +391,14 @@ module Psych
def visit_Array o
if o.class == ::Array
- visit_Enumerator o
+ register o, @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
+ o.each { |c| accept c }
+ @emitter.end_sequence
else
visit_array_subclass o
end
end
- def visit_Enumerator o
- register o, @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
- o.each { |c| accept c }
- @emitter.end_sequence
- end
-
def visit_NilClass o
@emitter.scalar('', nil, 'tag:yaml.org,2002:null', true, false, Nodes::Scalar::ANY)
end
@@ -402,28 +411,21 @@ module Psych
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
+ # FIXME: Remove the index and count checks in Psych 3.0
+ NULL = "\x00"
+ BINARY_RANGE = "\x00-\x7F"
+ WS_RANGE = "^ -~\t\r\n"
def binary? string
- string.encoding == Encoding::ASCII_8BIT && !string.ascii_only?
+ (string.encoding == Encoding::ASCII_8BIT && !string.ascii_only?) ||
+ string.index(NULL) ||
+ string.count(BINARY_RANGE, WS_RANGE).fdiv(string.length) > 0.3
end
def visit_array_subclass o
tag = "!ruby/array:#{o.class}"
- ivars = o.instance_variables
- if ivars.empty?
+ if o.instance_variables.empty?
node = @emitter.start_sequence(nil, tag, false, Nodes::Sequence::BLOCK)
register o, node
o.each { |c| accept c }
@@ -441,7 +443,7 @@ module Psych
# Dump the ivars
accept 'ivars'
@emitter.start_mapping(nil, nil, true, Nodes::Sequence::BLOCK)
- ivars.each do |ivar|
+ o.instance_variables.each do |ivar|
accept ivar
accept o.instance_variable_get ivar
end
@@ -451,53 +453,49 @@ module Psych
end
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)
+ def dump_list o
+ end
- # 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
+ # '%: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 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
+ if time.utc?
+ formatted += " Z"
+ else
+ zone = time.strftime('%z')
+ formatted += " #{zone[0,3]}:#{zone[3,5]}"
end
- @emitter.end_mapping
- @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
+ formatted
+ end
+ else
+ def format_time time
+ if time.utc?
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
+ else
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
end
- @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")
+ # FIXME: remove this method once "to_yaml_properties" is removed
+ def find_ivars target
+ begin
+ loc = target.method(:to_yaml_properties).source_location.first
+ unless loc.start_with?(Psych::DEPRECATED) || loc.end_with?('rubytypes.rb')
+ if $VERBOSE
+ warn "#{loc}: to_yaml_properties is deprecated, please implement \"encode_with(coder)\""
+ end
+ return target.to_yaml_properties
+ end
+ rescue
+ # public_method or source_location might be overridden,
+ # and it's OK to skip it since it's only to emit a warning.
end
+
+ target.instance_variables
end
def register target, yaml_obj
@@ -515,10 +513,10 @@ module Psych
c = Psych::Coder.new(tag)
o.encode_with(c)
- emit_coder c, o
+ emit_coder c
end
- def emit_coder c, o
+ def emit_coder c
case c.type
when :scalar
@emitter.scalar c.scalar, nil, c.tag, c.tag.nil?, false, Nodes::Scalar::ANY
@@ -529,7 +527,7 @@ module Psych
end
@emitter.end_sequence
when :map
- register o, @emitter.start_mapping(nil, c.tag, c.implicit, c.style)
+ @emitter.start_mapping nil, c.tag, c.implicit, c.style
c.map.each do |k,v|
accept k
accept v
@@ -541,7 +539,9 @@ module Psych
end
def dump_ivars target
- target.instance_variables.each do |iv|
+ ivars = find_ivars target
+
+ ivars.each do |iv|
@emitter.scalar("#{iv.to_s.sub(/^@/, '')}", nil, nil, true, false, Nodes::Scalar::ANY)
accept target.instance_variable_get(iv)
end
diff --git a/ext/psych/lib/psych/y.rb b/ext/psych/lib/psych/y.rb
index e857953c04..d0e049d4e5 100644
--- a/ext/psych/lib/psych/y.rb
+++ b/ext/psych/lib/psych/y.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Kernel
###
# An alias for Psych.dump_stream meant to be used with IRB.
diff --git a/ext/psych/psych.c b/ext/psych/psych.c
index 3bb59bfc11..69ff1d8dfc 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)
+void Init_psych()
{
mPsych = rb_define_module("Psych");
diff --git a/ext/psych/psych.gemspec b/ext/psych/psych.gemspec
index 2254d46829..de83d6b3d2 100644
--- a/ext/psych/psych.gemspec
+++ b/ext/psych/psych.gemspec
@@ -1,64 +1,23 @@
# -*- encoding: utf-8 -*-
-# frozen_string_literal: true
Gem::Specification.new do |s|
s.name = "psych"
- s.version = "3.0.2"
- s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
- s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
- s.date = "2017-12-04"
- s.summary = "Psych is a YAML parser and emitter"
- s.description = <<-DESCRIPTION
-Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/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.
-DESCRIPTION
- s.homepage = "https://github.com/ruby/psych"
- s.licenses = ["MIT"]
- s.require_paths = ["lib"]
-
- # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- s.files = [
- ".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console",
- "bin/setup", "ext/psych/.gitignore", "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/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", "psych.gemspec"
- ]
-
- s.rdoc_options = ["--main", "README.md"]
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
+ s.version = "2.0.6"
- s.required_ruby_version = Gem::Requirement.new(">= 2.2.2")
- s.rubygems_version = "2.5.1"
- s.required_rubygems_version = Gem::Requirement.new(">= 0")
-
- s.add_development_dependency 'rake-compiler', ">= 0.4.1"
- s.add_development_dependency 'minitest', "~> 5.0"
-
- if RUBY_ENGINE == 'jruby'
- s.platform = 'java'
- s.files.concat [
- "ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java",
- "ext/java/PsychYamlTree.java", "lib/psych_jars.rb", "lib/psych.jar"
- ]
- s.requirements = "jar org.yaml:snakeyaml, 1.18"
- s.add_dependency 'jar-dependencies', '>= 0.1.7'
- s.add_development_dependency 'ruby-maven'
- else
- s.extensions = ["ext/psych/extconf.rb"]
- s.add_development_dependency 'rake-compiler-dock', ">= 0.6.1"
- end
+ 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 = "2014-09-14"
+ 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", "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_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.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
+ s.rubygems_version = "2.2.2"
+ 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_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"]
end
diff --git a/ext/psych/psych.h b/ext/psych/psych.h
index 6b3d63f246..1830ca4b19 100644
--- a/ext/psych/psych.h
+++ b/ext/psych/psych.h
@@ -2,7 +2,10 @@
#define PSYCH_H
#include <ruby.h>
+
+#ifdef HAVE_RUBY_ENCODING_H
#include <ruby/encoding.h>
+#endif
#include <yaml.h>
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index 55bd417004..f0d032649c 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -1,14 +1,6 @@
#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_io;
static ID id_write;
static ID id_line_width;
static ID id_indentation;
@@ -22,8 +14,8 @@ static void emit(yaml_emitter_t * emitter, yaml_event_t * event)
static int writer(void *ctx, unsigned char *buffer, size_t size)
{
- VALUE self = (VALUE)ctx, io = rb_attr_get(self, id_io);
- VALUE str = rb_enc_str_new((const char *)buffer, (long)size, rb_utf8_encoding());
+ VALUE io = (VALUE)ctx;
+ VALUE str = rb_str_new((const char *)buffer, (long)size);
VALUE wrote = rb_funcall(io, id_write, 1, str);
return (int)NUM2INT(wrote);
}
@@ -37,34 +29,17 @@ 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;
- VALUE obj = TypedData_Make_Struct(klass, yaml_emitter_t, &psych_emitter_type, emitter);
+
+ emitter = xmalloc(sizeof(yaml_emitter_t));
yaml_emitter_initialize(emitter);
yaml_emitter_set_unicode(emitter, 1);
yaml_emitter_set_indent(emitter, 2);
- return obj;
+ return Data_Wrap_Struct(klass, 0, dealloc, emitter);
}
/* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS)
@@ -79,7 +54,7 @@ static VALUE initialize(int argc, VALUE *argv, VALUE self)
VALUE indent;
VALUE canonical;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
if (rb_scan_args(argc, argv, "11", &io, &options) == 2) {
line_width = rb_funcall(options, id_line_width, 0);
@@ -91,8 +66,7 @@ static VALUE initialize(int argc, VALUE *argv, VALUE self)
yaml_emitter_set_canonical(emitter, Qtrue == canonical ? 1 : 0);
}
- rb_ivar_set(self, id_io, io);
- yaml_emitter_set_output(emitter, writer, (void *)self);
+ yaml_emitter_set_output(emitter, writer, (void *)io);
return self;
}
@@ -107,7 +81,7 @@ static VALUE start_stream(VALUE self, VALUE encoding)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
Check_Type(encoding, T_FIXNUM);
yaml_stream_start_event_initialize(&event, (yaml_encoding_t)NUM2INT(encoding));
@@ -127,7 +101,7 @@ static VALUE end_stream(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_stream_end_event_initialize(&event);
@@ -150,7 +124,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;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
Check_Type(version, T_ARRAY);
@@ -164,18 +138,18 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
}
if(RTEST(tags)) {
- long i = 0;
- long len;
+ int i = 0;
+#ifdef HAVE_RUBY_ENCODING_H
rb_encoding * encoding = rb_utf8_encoding();
+#endif
Check_Type(tags, T_ARRAY);
- len = RARRAY_LEN(tags);
- head = xcalloc((size_t)len, sizeof(yaml_tag_directive_t));
+ head = xcalloc((size_t)RARRAY_LEN(tags), sizeof(yaml_tag_directive_t));
tail = head;
- for(i = 0; i < len && i < RARRAY_LEN(tags); i++) {
- VALUE tuple = RARRAY_AREF(tags, i);
+ for(i = 0; i < RARRAY_LEN(tags); i++) {
+ VALUE tuple = RARRAY_PTR(tags)[i];
VALUE name;
VALUE value;
@@ -185,15 +159,15 @@ 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_AREF(tuple, 0);
- value = RARRAY_AREF(tuple, 1);
- StringValue(name);
- StringValue(value);
+ name = RARRAY_PTR(tuple)[0];
+ value = RARRAY_PTR(tuple)[1];
+#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 *)StringValueCStr(name);
- tail->prefix = (yaml_char_t *)StringValueCStr(value);
+ tail->handle = (yaml_char_t *)StringValuePtr(name);
+ tail->prefix = (yaml_char_t *)StringValuePtr(value);
tail++;
}
@@ -224,7 +198,7 @@ static VALUE end_document(VALUE self, VALUE imp)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_document_end_event_initialize(&event, imp ? 1 : 0);
@@ -251,11 +225,14 @@ static VALUE scalar(
) {
yaml_emitter_t * emitter;
yaml_event_t event;
+#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *encoding;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+#endif
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
Check_Type(value, T_STRING);
+#ifdef HAVE_RUBY_ENCODING_H
encoding = rb_utf8_encoding();
value = rb_str_export_to_enc(value, encoding);
@@ -269,11 +246,12 @@ static VALUE scalar(
Check_Type(tag, T_STRING);
tag = rb_str_export_to_enc(tag, encoding);
}
+#endif
yaml_scalar_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
(yaml_char_t*)StringValuePtr(value),
(int)RSTRING_LEN(value),
plain ? 1 : 0,
@@ -303,6 +281,7 @@ static VALUE start_sequence(
yaml_emitter_t * emitter;
yaml_event_t event;
+#ifdef HAVE_RUBY_ENCODING_H
rb_encoding * encoding = rb_utf8_encoding();
if(!NIL_P(anchor)) {
@@ -314,13 +293,14 @@ static VALUE start_sequence(
Check_Type(tag, T_STRING);
tag = rb_str_export_to_enc(tag, encoding);
}
+#endif
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_sequence_start_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
implicit ? 1 : 0,
(yaml_sequence_style_t)NUM2INT(style)
);
@@ -340,7 +320,7 @@ static VALUE end_sequence(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_sequence_end_event_initialize(&event);
@@ -365,10 +345,12 @@ static VALUE start_mapping(
) {
yaml_emitter_t * emitter;
yaml_event_t event;
+#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();
if(!NIL_P(anchor)) {
@@ -380,11 +362,12 @@ static VALUE start_mapping(
Check_Type(tag, T_STRING);
tag = rb_str_export_to_enc(tag, encoding);
}
+#endif
yaml_mapping_start_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor)),
- (yaml_char_t *)(NIL_P(tag) ? NULL : StringValueCStr(tag)),
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor)),
+ (yaml_char_t *)(NIL_P(tag) ? NULL : StringValuePtr(tag)),
implicit ? 1 : 0,
(yaml_mapping_style_t)NUM2INT(style)
);
@@ -404,7 +387,7 @@ static VALUE end_mapping(VALUE self)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_mapping_end_event_initialize(&event);
@@ -423,16 +406,18 @@ static VALUE alias(VALUE self, VALUE anchor)
{
yaml_emitter_t * emitter;
yaml_event_t event;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
+#ifdef HAVE_RUBY_ENCODING_H
if(!NIL_P(anchor)) {
Check_Type(anchor, T_STRING);
anchor = rb_str_export_to_enc(anchor, rb_utf8_encoding());
}
+#endif
yaml_alias_event_initialize(
&event,
- (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValueCStr(anchor))
+ (yaml_char_t *)(NIL_P(anchor) ? NULL : StringValuePtr(anchor))
);
emit(emitter, &event);
@@ -447,7 +432,7 @@ static VALUE alias(VALUE self, VALUE anchor)
static VALUE set_canonical(VALUE self, VALUE style)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_emitter_set_canonical(emitter, Qtrue == style ? 1 : 0);
@@ -461,7 +446,7 @@ static VALUE set_canonical(VALUE self, VALUE style)
static VALUE canonical(VALUE self)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
return (emitter->canonical == 0) ? Qfalse : Qtrue;
}
@@ -474,7 +459,7 @@ static VALUE canonical(VALUE self)
static VALUE set_indentation(VALUE self, VALUE level)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_emitter_set_indent(emitter, NUM2INT(level));
@@ -488,7 +473,7 @@ static VALUE set_indentation(VALUE self, VALUE level)
static VALUE indentation(VALUE self)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
return INT2NUM(emitter->best_indent);
}
@@ -500,7 +485,7 @@ static VALUE indentation(VALUE self)
static VALUE line_width(VALUE self)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
return INT2NUM(emitter->best_width);
}
@@ -512,14 +497,14 @@ static VALUE line_width(VALUE self)
static VALUE set_line_width(VALUE self, VALUE width)
{
yaml_emitter_t * emitter;
- TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, emitter);
+ Data_Get_Struct(self, yaml_emitter_t, emitter);
yaml_emitter_set_width(emitter, NUM2INT(width));
return width;
}
-void Init_psych_emitter(void)
+void Init_psych_emitter()
{
VALUE psych = rb_define_module("Psych");
VALUE handler = rb_define_class_under(psych, "Handler", rb_cObject);
@@ -545,7 +530,6 @@ void Init_psych_emitter(void)
rb_define_method(cPsychEmitter, "line_width", line_width, 0);
rb_define_method(cPsychEmitter, "line_width=", set_line_width, 1);
- id_io = rb_intern("io");
id_write = rb_intern("write");
id_line_width = rb_intern("line_width");
id_indentation = rb_intern("indentation");
diff --git a/ext/psych/psych_emitter.h b/ext/psych/psych_emitter.h
index 4c1482a78b..560451ef31 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);
+void Init_psych_emitter();
#endif
diff --git a/ext/psych/psych_parser.c b/ext/psych/psych_parser.c
index ca196ddba4..8c65ce1307 100644
--- a/ext/psych/psych_parser.c
+++ b/ext/psych/psych_parser.c
@@ -16,7 +16,6 @@ static ID id_start_sequence;
static ID id_end_sequence;
static ID id_start_mapping;
static ID id_end_mapping;
-static ID id_event_location;
#define PSYCH_TRANSCODE(_str, _yaml_enc, _internal_enc) \
do { \
@@ -50,32 +49,14 @@ 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 obj;
+ return Data_Wrap_Struct(klass, 0, dealloc, parser);
}
static VALUE make_exception(yaml_parser_t * parser, VALUE path)
@@ -94,6 +75,7 @@ static VALUE make_exception(yaml_parser_t * parser, VALUE path)
parser->context ? rb_usascii_str_new2(parser->context) : Qnil);
}
+#ifdef HAVE_RUBY_ENCODING_H
static VALUE transcode_string(VALUE src, int * parser_encoding)
{
int utf8 = rb_utf8_encindex();
@@ -171,6 +153,8 @@ static VALUE transcode_io(VALUE src, int * parser_encoding)
return src;
}
+#endif
+
static VALUE protected_start_stream(VALUE pointer)
{
VALUE *args = (VALUE *)pointer;
@@ -233,12 +217,6 @@ static VALUE protected_end_stream(VALUE handler)
return rb_funcall(handler, id_end_stream, 0);
}
-static VALUE protected_event_location(VALUE pointer)
-{
- VALUE *args = (VALUE *)pointer;
- return rb_funcall3(args[0], id_event_location, 4, args + 1);
-}
-
/*
* call-seq:
* parser.parse(yaml)
@@ -257,8 +235,10 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
int tainted = 0;
int state = 0;
int parser_encoding = YAML_ANY_ENCODING;
+#ifdef HAVE_RUBY_ENCODING_H
int encoding = rb_utf8_encindex();
rb_encoding * internal_enc = rb_default_internal_encoding();
+#endif
VALUE handler = rb_iv_get(self, "@handler");
if (rb_scan_args(argc, argv, "11", &yaml, &path) == 1) {
@@ -268,7 +248,7 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
path = rb_str_new2("<unknown>");
}
- TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
+ Data_Get_Struct(self, yaml_parser_t, parser);
yaml_parser_delete(parser);
yaml_parser_initialize(parser);
@@ -276,14 +256,18 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
if (OBJ_TAINTED(yaml)) tainted = 1;
if (rb_respond_to(yaml, id_read)) {
+#ifdef HAVE_RUBY_ENCODING_H
yaml = transcode_io(yaml, &parser_encoding);
yaml_parser_set_encoding(parser, parser_encoding);
+#endif
yaml_parser_set_input(parser, io_reader, (void *)yaml);
if (RTEST(rb_obj_is_kind_of(yaml, rb_cIO))) tainted = 1;
} else {
StringValue(yaml);
+#ifdef HAVE_RUBY_ENCODING_H
yaml = transcode_string(yaml, &parser_encoding);
yaml_parser_set_encoding(parser, parser_encoding);
+#endif
yaml_parser_set_input_string(
parser,
(const unsigned char *)RSTRING_PTR(yaml),
@@ -292,9 +276,6 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
}
while(!done) {
- VALUE event_args[5];
- VALUE start_line, start_column, end_line, end_column;
-
if(!yaml_parser_parse(parser, &event)) {
VALUE exception;
@@ -305,18 +286,6 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
rb_exc_raise(exception);
}
- start_line = INT2NUM((long)event.start_mark.line);
- start_column = INT2NUM((long)event.start_mark.column);
- end_line = INT2NUM((long)event.end_mark.line);
- end_column = INT2NUM((long)event.end_mark.column);
-
- event_args[0] = handler;
- event_args[1] = start_line;
- event_args[2] = start_column;
- event_args[3] = end_line;
- event_args[4] = end_column;
- rb_protect(protected_event_location, (VALUE)event_args, &state);
-
switch(event.type) {
case YAML_STREAM_START_EVENT:
{
@@ -351,13 +320,17 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
if(start->handle) {
handle = rb_str_new2((const char *)start->handle);
if (tainted) OBJ_TAINT(handle);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(handle, encoding, internal_enc);
+#endif
}
if(start->prefix) {
prefix = rb_str_new2((const char *)start->prefix);
if (tainted) OBJ_TAINT(prefix);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(prefix, encoding, internal_enc);
+#endif
}
rb_ary_push(tag_directives, rb_ary_new3((long)2, handle, prefix));
@@ -386,7 +359,9 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
if(event.data.alias.anchor) {
alias = rb_str_new2((const char *)event.data.alias.anchor);
if (tainted) OBJ_TAINT(alias);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(alias, encoding, internal_enc);
+#endif
}
args[0] = handler;
@@ -406,18 +381,24 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
);
if (tainted) OBJ_TAINT(val);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(val, encoding, internal_enc);
+#endif
if(event.data.scalar.anchor) {
anchor = rb_str_new2((const char *)event.data.scalar.anchor);
if (tainted) OBJ_TAINT(anchor);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(anchor, encoding, internal_enc);
+#endif
}
if(event.data.scalar.tag) {
tag = rb_str_new2((const char *)event.data.scalar.tag);
if (tainted) OBJ_TAINT(tag);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(tag, encoding, internal_enc);
+#endif
}
plain_implicit =
@@ -447,14 +428,18 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
if(event.data.sequence_start.anchor) {
anchor = rb_str_new2((const char *)event.data.sequence_start.anchor);
if (tainted) OBJ_TAINT(anchor);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(anchor, encoding, internal_enc);
+#endif
}
tag = Qnil;
if(event.data.sequence_start.tag) {
tag = rb_str_new2((const char *)event.data.sequence_start.tag);
if (tainted) OBJ_TAINT(tag);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(tag, encoding, internal_enc);
+#endif
}
implicit =
@@ -483,13 +468,17 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
if(event.data.mapping_start.anchor) {
anchor = rb_str_new2((const char *)event.data.mapping_start.anchor);
if (tainted) OBJ_TAINT(anchor);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(anchor, encoding, internal_enc);
+#endif
}
if(event.data.mapping_start.tag) {
tag = rb_str_new2((const char *)event.data.mapping_start.tag);
if (tainted) OBJ_TAINT(tag);
+#ifdef HAVE_RUBY_ENCODING_H
PSYCH_TRANSCODE(tag, encoding, internal_enc);
+#endif
}
implicit =
@@ -537,7 +526,7 @@ static VALUE mark(VALUE self)
VALUE args[3];
yaml_parser_t * parser;
- TypedData_Get_Struct(self, yaml_parser_t, &psych_parser_type, parser);
+ Data_Get_Struct(self, yaml_parser_t, parser);
mark_klass = rb_const_get_at(cPsychParser, rb_intern("Mark"));
args[0] = INT2NUM(parser->mark.index);
args[1] = INT2NUM(parser->mark.line);
@@ -546,7 +535,7 @@ static VALUE mark(VALUE self)
return rb_class_new_instance(3, args, mark_klass);
}
-void Init_psych_parser(void)
+void Init_psych_parser()
{
#if 0
mPsych = rb_define_module("Psych");
@@ -573,19 +562,18 @@ void Init_psych_parser(void)
rb_define_method(cPsychParser, "parse", parse, -1);
rb_define_method(cPsychParser, "mark", mark, 0);
- id_read = rb_intern("read");
- id_path = rb_intern("path");
- id_empty = rb_intern("empty");
- id_start_stream = rb_intern("start_stream");
- id_end_stream = rb_intern("end_stream");
- id_start_document = rb_intern("start_document");
- id_end_document = rb_intern("end_document");
- id_alias = rb_intern("alias");
- id_scalar = rb_intern("scalar");
- id_start_sequence = rb_intern("start_sequence");
- id_end_sequence = rb_intern("end_sequence");
- id_start_mapping = rb_intern("start_mapping");
- id_end_mapping = rb_intern("end_mapping");
- id_event_location = rb_intern("event_location");
+ id_read = rb_intern("read");
+ id_path = rb_intern("path");
+ id_empty = rb_intern("empty");
+ id_start_stream = rb_intern("start_stream");
+ id_end_stream = rb_intern("end_stream");
+ id_start_document = rb_intern("start_document");
+ id_end_document = rb_intern("end_document");
+ id_alias = rb_intern("alias");
+ id_scalar = rb_intern("scalar");
+ id_start_sequence = rb_intern("start_sequence");
+ id_end_sequence = rb_intern("end_sequence");
+ id_start_mapping = rb_intern("start_mapping");
+ id_end_mapping = rb_intern("end_mapping");
}
/* vim: set noet sws=4 sw=4: */
diff --git a/ext/psych/psych_parser.h b/ext/psych/psych_parser.h
index beb3dd0709..25e896f01d 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);
+void Init_psych_parser();
#endif
diff --git a/ext/psych/psych_to_ruby.c b/ext/psych/psych_to_ruby.c
index b388ff7754..3cc87a965e 100644
--- a/ext/psych/psych_to_ruby.c
+++ b/ext/psych/psych_to_ruby.c
@@ -21,7 +21,11 @@ static VALUE build_exception(VALUE self, VALUE klass, VALUE mesg)
*/
static VALUE path2class(VALUE self, VALUE path)
{
+#ifdef HAVE_RUBY_ENCODING_H
return rb_path_to_class(path);
+#else
+ return rb_path2class(StringValuePtr(path));
+#endif
}
void Init_psych_to_ruby(void)
diff --git a/ext/psych/psych_yaml_tree.c b/ext/psych/psych_yaml_tree.c
index 7aca9114c9..bcf24d2070 100644
--- a/ext/psych/psych_yaml_tree.c
+++ b/ext/psych/psych_yaml_tree.c
@@ -9,7 +9,7 @@ VALUE cPsychVisitorsYamlTree;
*/
static VALUE private_iv_get(VALUE self, VALUE target, VALUE prop)
{
- return rb_attr_get(target, rb_intern(StringValueCStr(prop)));
+ return rb_attr_get(target, rb_intern(StringValuePtr(prop)));
}
void Init_psych_yaml_tree(void)
diff --git a/ext/psych/yaml/LICENSE b/ext/psych/yaml/LICENSE
new file mode 100644
index 0000000000..050ced23f6
--- /dev/null
+++ b/ext/psych/yaml/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006 Kirill Simonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/ext/psych/yaml/api.c b/ext/psych/yaml/api.c
index b1a8da0bda..e0b9d979cc 100644
--- a/ext/psych/yaml/api.c
+++ b/ext/psych/yaml/api.c
@@ -395,7 +395,7 @@ yaml_emitter_delete(yaml_emitter_t *emitter)
}
QUEUE_DEL(emitter, emitter->events);
STACK_DEL(emitter, emitter->indents);
- while (!STACK_EMPTY(empty, emitter->tag_directives)) {
+ while (!STACK_EMPTY(emitter, emitter->tag_directives)) {
yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives);
yaml_free(tag_directive.handle);
yaml_free(tag_directive.prefix);
@@ -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,
@@ -822,6 +822,7 @@ yaml_scalar_event_initialize(yaml_event_t *event,
yaml_char_t *anchor_copy = NULL;
yaml_char_t *tag_copy = NULL;
yaml_char_t *value_copy = NULL;
+ size_t value_length;
assert(event); /* Non-NULL event object is expected. */
assert(value); /* Non-NULL anchor is expected. */
@@ -839,16 +840,19 @@ yaml_scalar_event_initialize(yaml_event_t *event,
}
if (length < 0) {
- length = strlen((char *)value);
+ value_length = strlen((char *)value);
+ }
+ else {
+ value_length = (size_t)length;
}
- if (!yaml_check_utf8(value, length)) goto error;
- value_copy = yaml_malloc(length+1);
+ if (!yaml_check_utf8(value, value_length)) goto error;
+ value_copy = yaml_malloc(value_length+1);
if (!value_copy) goto error;
- memcpy(value_copy, value, length);
- value_copy[length] = '\0';
+ memcpy(value_copy, value, value_length);
+ value_copy[value_length] = '\0';
- SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length,
+ SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, value_length,
plain_implicit, quoted_implicit, style, mark, mark);
return 1;
@@ -1202,6 +1206,8 @@ yaml_document_add_scalar(yaml_document_t *document,
yaml_char_t *tag_copy = NULL;
yaml_char_t *value_copy = NULL;
yaml_node_t node;
+ size_t value_length;
+ ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
assert(value); /* Non-NULL value is expected. */
@@ -1215,19 +1221,26 @@ yaml_document_add_scalar(yaml_document_t *document,
if (!tag_copy) goto error;
if (length < 0) {
- length = strlen((char *)value);
+ value_length = strlen((char *)value);
+ }
+ else {
+ value_length = (size_t)length;
}
- if (!yaml_check_utf8(value, length)) goto error;
- value_copy = yaml_malloc(length+1);
+ if (!yaml_check_utf8(value, value_length)) goto error;
+ value_copy = yaml_malloc(value_length+1);
if (!value_copy) goto error;
- memcpy(value_copy, value, length);
- value_copy[length] = '\0';
+ memcpy(value_copy, value, value_length);
+ value_copy[value_length] = '\0';
- SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
+ SCALAR_NODE_INIT(node, tag_copy, value_copy, value_length, style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- return document->nodes.top - document->nodes.start;
+ ret = document->nodes.top - document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (ret > INT_MAX) goto error;
+#endif
+ return (int)ret;
error:
yaml_free(tag_copy);
@@ -1255,6 +1268,7 @@ yaml_document_add_sequence(yaml_document_t *document,
yaml_node_item_t *top;
} items = { NULL, NULL, NULL };
yaml_node_t node;
+ ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
@@ -1272,7 +1286,11 @@ yaml_document_add_sequence(yaml_document_t *document,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- return document->nodes.top - document->nodes.start;
+ ret = document->nodes.top - document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (ret > INT_MAX) goto error;
+#endif
+ return (int)ret;
error:
STACK_DEL(&context, items);
@@ -1300,6 +1318,7 @@ yaml_document_add_mapping(yaml_document_t *document,
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
yaml_node_t node;
+ ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
@@ -1317,7 +1336,11 @@ yaml_document_add_mapping(yaml_document_t *document,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- return document->nodes.top - document->nodes.start;
+ ret = document->nodes.top - document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (ret > INT_MAX) goto error;
+#endif
+ return (int)ret;
error:
STACK_DEL(&context, pairs);
diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h
index 79e8501f4f..f54c27d339 100644
--- a/ext/psych/yaml/config.h
+++ b/ext/psych/yaml/config.h
@@ -1,10 +1,10 @@
#define PACKAGE_NAME "yaml"
#define PACKAGE_TARNAME "yaml"
-#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 PACKAGE_VERSION "0.1.6"
+#define PACKAGE_STRING "yaml 0.1.6"
+#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
+#define PACKAGE_URL ""
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
-#define YAML_VERSION_PATCH 7
-#define YAML_VERSION_STRING "0.1.7"
+#define YAML_VERSION_PATCH 6
+#define YAML_VERSION_STRING "0.1.6"
diff --git a/ext/psych/yaml/emitter.c b/ext/psych/yaml/emitter.c
index 580a8d2123..bf84fafc51 100644
--- a/ext/psych/yaml/emitter.c
+++ b/ext/psych/yaml/emitter.c
@@ -24,8 +24,8 @@
*/
#define PUT_BREAK(emitter) \
- (FLUSH(emitter) ? \
- ((emitter->line_break == YAML_CR_BREAK ? \
+ (FLUSH(emitter) \
+ && ((emitter->line_break == YAML_CR_BREAK ? \
(*(emitter->buffer.pointer++) = (yaml_char_t) '\r') : \
emitter->line_break == YAML_LN_BREAK ? \
(*(emitter->buffer.pointer++) = (yaml_char_t) '\n') : \
@@ -34,7 +34,7 @@
*(emitter->buffer.pointer++) = (yaml_char_t) '\n') : 0), \
emitter->column = 0, \
emitter->line ++, \
- 1) : 0)
+ 1))
/*
* Copy a character from a string into buffer.
@@ -53,7 +53,7 @@
#define WRITE_BREAK(emitter,string) \
(FLUSH(emitter) \
&& (CHECK(string,'\n') ? \
- (PUT_BREAK(emitter), \
+ ((void)PUT_BREAK(emitter), \
string.pointer ++, \
1) : \
(COPY(emitter->buffer,string), \
@@ -1493,7 +1493,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
int break_space = 0;
int space_break = 0;
- int preceded_by_whitespace = 0;
+ int preceeded_by_whitespace = 0;
int followed_by_whitespace = 0;
int previous_space = 0;
int previous_break = 0;
@@ -1524,7 +1524,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
flow_indicators = 1;
}
- preceded_by_whitespace = 1;
+ preceeded_by_whitespace = 1;
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
while (string.pointer != string.end)
@@ -1570,7 +1570,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
}
}
- if (CHECK(string, '#') && preceded_by_whitespace) {
+ if (CHECK(string, '#') && preceeded_by_whitespace) {
flow_indicators = 1;
block_indicators = 1;
}
@@ -1619,7 +1619,7 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
previous_break = 0;
}
- preceded_by_whitespace = IS_BLANKZ(string);
+ preceeded_by_whitespace = IS_BLANKZ(string);
MOVE(string);
if (string.pointer != string.end) {
followed_by_whitespace = IS_BLANKZ_AT(string, WIDTH(string));
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c
index 3ba99f087e..cb3ea93089 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 occurrence",
- alias_data->mark, "second occurrence", data.mark);
+ "found duplicate anchor; first occurence",
+ alias_data->mark, "second occurence", data.mark);
}
}
@@ -283,6 +283,7 @@ static int
yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
{
yaml_node_t node;
+ ptrdiff_t node_index;
int index;
yaml_char_t *tag = first_event->data.scalar.tag;
@@ -300,7 +301,11 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- index = parser->document->nodes.top - parser->document->nodes.start;
+ node_index = parser->document->nodes.top - parser->document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (node_index > INT_MAX) goto error;
+#endif
+ index = (int)node_index;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.scalar.anchor)) return 0;
@@ -329,6 +334,7 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_node_item_t *top;
} items = { NULL, NULL, NULL };
int index, item_index;
+ ptrdiff_t node_index;
yaml_char_t *tag = first_event->data.sequence_start.tag;
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
@@ -347,7 +353,11 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- index = parser->document->nodes.top - parser->document->nodes.start;
+ node_index = parser->document->nodes.top - parser->document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (node_index > INT_MAX) goto error;
+#endif
+ index = (int)node_index;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.sequence_start.anchor)) return 0;
@@ -391,6 +401,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
int index;
+ ptrdiff_t node_index;
yaml_node_pair_t pair;
yaml_char_t *tag = first_event->data.mapping_start.tag;
@@ -410,7 +421,11 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- index = parser->document->nodes.top - parser->document->nodes.start;
+ node_index = parser->document->nodes.top - parser->document->nodes.start;
+#if PTRDIFF_MAX > INT_MAX
+ if (node_index > INT_MAX) goto error;
+#endif
+ index = (int)node_index;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.mapping_start.anchor)) return 0;
diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c
index d8d90325e0..08ad8edb45 100644
--- a/ext/psych/yaml/scanner.c
+++ b/ext/psych/yaml/scanner.c
@@ -1106,6 +1106,13 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
&& parser->indent == (ptrdiff_t)parser->mark.column);
/*
+ * A simple key is required only when it is the first token in the current
+ * line. Therefore it is always allowed. But we add a check anyway.
+ */
+
+ assert(parser->simple_key_allowed || !required); /* Impossible. */
+
+ /*
* If the current position may start a simple key, save it.
*/
@@ -1188,7 +1195,7 @@ yaml_parser_decrease_flow_level(yaml_parser_t *parser)
{
if (parser->flow_level) {
parser->flow_level --;
- (void)POP(parser, parser->simple_keys);
+ (void)POP(parser, parser->simple_keys);
}
return 1;
@@ -1222,12 +1229,14 @@ yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
if (!PUSH(parser, parser->indents, parser->indent))
return 0;
+#if PTRDIFF_MAX > INT_MAX
if (column > INT_MAX) {
parser->error = YAML_MEMORY_ERROR;
return 0;
}
+#endif
- parser->indent = column;
+ parser->indent = (int)column;
/* Create a token and insert it into the queue. */
@@ -1249,7 +1258,7 @@ yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
/*
* Pop indentation levels from the indents stack until the current level
- * becomes less or equal to the column. For each indentation level, append
+ * becomes less or equal to the column. For each intendation level, append
* the BLOCK-END token.
*/
@@ -1264,7 +1273,7 @@ yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column)
if (parser->flow_level)
return 1;
- /* Loop through the indentation levels in the stack. */
+ /* Loop through the intendation levels in the stack. */
while (parser->indent > column)
{
@@ -1636,7 +1645,7 @@ yaml_parser_fetch_key(yaml_parser_t *parser)
if (!parser->flow_level)
{
- /* Check if we are allowed to start a new key (not necessary simple). */
+ /* Check if we are allowed to start a new key (not nessesary simple). */
if (!parser->simple_key_allowed) {
return yaml_parser_set_scanner_error(parser, NULL, parser->mark,
@@ -2051,7 +2060,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 unknown directive name");
+ start_mark, "found uknown directive name");
goto error;
}
@@ -2773,15 +2782,15 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
if (IS_DIGIT(parser->buffer))
{
- /* Check that the indentation is greater than 0. */
+ /* Check that the intendation is greater than 0. */
if (CHECK(parser->buffer, '0')) {
yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found an indentation indicator equal to 0");
+ start_mark, "found an intendation indicator equal to 0");
goto error;
}
- /* Get the indentation level and eat the indicator. */
+ /* Get the intendation level and eat the indicator. */
increment = AS_DIGIT(parser->buffer);
@@ -2795,7 +2804,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
{
if (CHECK(parser->buffer, '0')) {
yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found an indentation indicator equal to 0");
+ start_mark, "found an intendation indicator equal to 0");
goto error;
}
@@ -2845,7 +2854,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
end_mark = parser->mark;
- /* Set the indentation level if it was specified. */
+ /* Set the intendation level if it was specified. */
if (increment) {
indent = parser->indent >= 0 ? parser->indent+increment : increment;
@@ -2911,7 +2920,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
if (!READ_LINE(parser, leading_break)) goto error;
- /* Eat the following indentation spaces and line breaks. */
+ /* Eat the following intendation spaces and line breaks. */
if (!yaml_parser_scan_block_scalar_breaks(parser,
&indent, &trailing_breaks, start_mark, &end_mark)) goto error;
@@ -2946,8 +2955,8 @@ error:
}
/*
- * Scan indentation spaces and line breaks for a block scalar. Determine the
- * indentation level if needed.
+ * Scan intendation spaces and line breaks for a block scalar. Determine the
+ * intendation level if needed.
*/
static int
@@ -2959,11 +2968,11 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
*end_mark = parser->mark;
- /* Eat the indentation spaces and line breaks. */
+ /* Eat the intendation spaces and line breaks. */
while (1)
{
- /* Eat the indentation spaces. */
+ /* Eat the intendation spaces. */
if (!CACHE(parser, 1)) return 0;
@@ -2976,12 +2985,12 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
if ((int)parser->mark.column > max_indent)
max_indent = (int)parser->mark.column;
- /* Check for a tab character messing the indentation. */
+ /* Check for a tab character messing the intendation. */
if ((!*indent || (int)parser->mark.column < *indent)
&& IS_TAB(parser->buffer)) {
return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found a tab character where an indentation space is expected");
+ start_mark, "found a tab character where an intendation space is expected");
}
/* Have we found a non-empty line? */
@@ -3502,12 +3511,12 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
{
if (IS_BLANK(parser->buffer))
{
- /* Check for tab characters that abuse indentation. */
+ /* Check for tab character that abuse intendation. */
if (leading_blanks && (int)parser->mark.column < indent
&& IS_TAB(parser->buffer)) {
yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
- start_mark, "found a tab character that violates indentation");
+ start_mark, "found a tab character that violate intendation");
goto error;
}
@@ -3540,7 +3549,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
if (!CACHE(parser, 1)) goto error;
}
- /* Check indentation level. */
+ /* Check intendation level. */
if (!parser->flow_level && (int)parser->mark.column < indent)
break;
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
index ce262d3086..944499c94e 100644
--- a/ext/psych/yaml/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h
@@ -436,7 +436,8 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(stack).start = (stack).top = (stack).end = 0)
#define STACK_EMPTY(context,stack) \
- ((stack).start == (stack).top)
+ ((void)(context), \
+ ((stack).start == (stack).top))
#define STACK_LIMIT(context,stack,size) \
((stack).top - (stack).start < (size) ? \
@@ -660,3 +661,4 @@ 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 4f0595c99d..cfcd3c910e 100644
--- a/ext/pty/depend
+++ b/ext/pty/depend
@@ -1,19 +1,6 @@
-# AUTOGENERATED DEPENDENCIES START
-pty.o: $(RUBY_EXTCONF_H)
-pty.o: $(arch_hdrdir)/ruby/config.h
-pty.o: $(hdrdir)/ruby/backward.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/onigmo.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
+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
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 4379177755..1db9f6e8aa 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'mkmf'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
@@ -9,7 +8,6 @@ if /mswin|mingw|bccwin|nacl/ !~ RUBY_PLATFORM
have_header("libutil.h")
have_header("util.h") # OpenBSD openpty
have_header("pty.h")
- have_header("pwd.h")
have_library("util", "openpty")
if have_func("posix_openpt") or
have_func("openpty") or
diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb
index 5dbfa09ae9..c3f3925be7 100644
--- a/ext/pty/lib/expect.rb
+++ b/ext/pty/lib/expect.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
$expect_verbose = false
# Expect library adds the IO instance method #expect, which does similar act to
@@ -31,7 +30,7 @@ class IO
# or yielded. However, the buffer in a timeout session is kept for the next
# expect call. The default timeout is 9999999 seconds.
def expect(pat,timeout=9999999)
- buf = ''.dup
+ buf = ''
case pat
when String
e_pat = Regexp.new(Regexp.quote(pat))
@@ -43,13 +42,13 @@ class IO
@unusedBuf ||= ''
while true
if not @unusedBuf.empty?
- c = @unusedBuf.slice!(0)
+ c = @unusedBuf.slice!(0).chr
elsif !IO.select([self],nil,nil,timeout) or eof? then
result = nil
@unusedBuf = buf
break
else
- c = getc
+ c = getc.chr
end
buf << c
if $expect_verbose
@@ -57,7 +56,7 @@ class IO
STDOUT.flush
end
if mat=e_pat.match(buf) then
- result = [buf,*mat.captures]
+ result = [buf,*mat.to_a[1..-1]]
break
end
end
@@ -69,3 +68,4 @@ class IO
nil
end
end
+
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 341dbbf88b..ec255cf202 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -9,9 +9,7 @@
#include <sys/file.h>
#include <fcntl.h>
#include <errno.h>
-#ifdef HAVE_PWD_H
#include <pwd.h>
-#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
@@ -35,9 +33,10 @@
#endif
#include <ctype.h>
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/util.h"
+#include "internal.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -159,23 +158,23 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
int master, slave, status = 0;
rb_pid_t pid;
char *p, *getenv();
+ struct passwd *pwent;
VALUE v;
struct child_info carg;
char errbuf[32];
if (argc == 0) {
- const char *shellname = "/bin/sh";
+ const char *shellname;
if ((p = getenv("SHELL")) != NULL) {
shellname = p;
}
else {
-#if defined HAVE_PWD_H
- const char *username = getenv("USER");
- struct passwd *pwent = getpwnam(username ? username : getlogin());
+ pwent = getpwuid(getuid());
if (pwent && pwent->pw_shell)
shellname = pwent->pw_shell;
-#endif
+ else
+ shellname = "/bin/sh";
}
v = rb_str_new2(shellname);
argc = 1;
@@ -184,7 +183,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_parent_start(carg.execarg_obj);
+ rb_execarg_fixup(carg.execarg_obj);
getDevice(&master, &slave, SlaveName, 0);
@@ -198,14 +197,12 @@ 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;
@@ -213,7 +210,6 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
RB_GC_GUARD(carg.execarg_obj);
}
-#if defined(HAVE_POSIX_OPENPT) || defined(HAVE_OPENPTY) || defined(HAVE_PTSNAME)
static int
no_mesg(char *slavedevice, int nomesg)
{
@@ -222,7 +218,6 @@ no_mesg(char *slavedevice, int nomesg)
else
return 0;
}
-#endif
static int
get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, int fail)
@@ -237,7 +232,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
dfl.sa_flags = 0;
sigemptyset(&dfl.sa_mask);
-#if defined(__sun) || defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD_version < 902000)
+#if defined(__sun) || (defined(__FreeBSD__) && __FreeBSD_version < 902000)
/* workaround for Solaris 10: grantpt() doesn't work if FD_CLOEXEC is set. [ruby-dev:44688] */
/* FreeBSD 9.2 or later supports O_CLOEXEC
* http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 */
@@ -267,7 +262,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__) && !defined(_AIX)
+#if defined(I_PUSH) && !defined(__linux__)
if (ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
if (ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
if (ioctl(slavefd, I_PUSH, "ttcompat") == -1) goto error;
@@ -351,7 +346,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__) && !defined(_AIX)
+#if defined(I_PUSH) && !defined(__linux__)
if(ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
if(ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
ioctl(slavefd, I_PUSH, "ttcompat");
@@ -369,44 +364,74 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
#else
/* BSD */
int masterfd = -1, slavefd = -1;
- int i;
+ const char *const *p;
char MasterName[DEVICELEN];
-#define HEX1(c) \
- c"0",c"1",c"2",c"3",c"4",c"5",c"6",c"7", \
- c"8",c"9",c"a",c"b",c"c",c"d",c"e",c"f"
-
#if defined(__hpux)
static const char MasterDevice[] = "/dev/ptym/pty%s";
static const char SlaveDevice[] = "/dev/pty/tty%s";
- static const char deviceNo[][3] = {
- HEX1("p"), HEX1("q"), HEX1("r"), HEX1("s"),
- HEX1("t"), HEX1("u"), HEX1("v"), HEX1("w"),
+ static const char *const deviceNo[] = {
+ "p0","p1","p2","p3","p4","p5","p6","p7",
+ "p8","p9","pa","pb","pc","pd","pe","pf",
+ "q0","q1","q2","q3","q4","q5","q6","q7",
+ "q8","q9","qa","qb","qc","qd","qe","qf",
+ "r0","r1","r2","r3","r4","r5","r6","r7",
+ "r8","r9","ra","rb","rc","rd","re","rf",
+ "s0","s1","s2","s3","s4","s5","s6","s7",
+ "s8","s9","sa","sb","sc","sd","se","sf",
+ "t0","t1","t2","t3","t4","t5","t6","t7",
+ "t8","t9","ta","tb","tc","td","te","tf",
+ "u0","u1","u2","u3","u4","u5","u6","u7",
+ "u8","u9","ua","ub","uc","ud","ue","uf",
+ "v0","v1","v2","v3","v4","v5","v6","v7",
+ "v8","v9","va","vb","vc","vd","ve","vf",
+ "w0","w1","w2","w3","w4","w5","w6","w7",
+ "w8","w9","wa","wb","wc","wd","we","wf",
+ 0
};
#elif defined(_IBMESA) /* AIX/ESA */
static const char MasterDevice[] = "/dev/ptyp%s";
static const char SlaveDevice[] = "/dev/ttyp%s";
- static const char deviceNo[][3] = {
- HEX1("0"), HEX1("1"), HEX1("2"), HEX1("3"),
- HEX1("4"), HEX1("5"), HEX1("6"), HEX1("7"),
- HEX1("8"), HEX1("9"), HEX1("a"), HEX1("b"),
- HEX1("c"), HEX1("d"), HEX1("e"), HEX1("f"),
+ static const char *const deviceNo[] = {
+ "00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f",
+ "10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f",
+ "20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f",
+ "30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f",
+ "40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f",
+ "50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f",
+ "60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f",
+ "70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f",
+ "80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f",
+ "90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f",
+ "a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af",
+ "b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf",
+ "c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf",
+ "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df",
+ "e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef",
+ "f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff",
+ 0
};
#else /* 4.2BSD */
static const char MasterDevice[] = "/dev/pty%s";
static const char SlaveDevice[] = "/dev/tty%s";
- static const char deviceNo[][3] = {
- HEX1("p"), HEX1("q"), HEX1("r"), HEX1("s"),
+ static const char *const deviceNo[] = {
+ "p0","p1","p2","p3","p4","p5","p6","p7",
+ "p8","p9","pa","pb","pc","pd","pe","pf",
+ "q0","q1","q2","q3","q4","q5","q6","q7",
+ "q8","q9","qa","qb","qc","qd","qe","qf",
+ "r0","r1","r2","r3","r4","r5","r6","r7",
+ "r8","r9","ra","rb","rc","rd","re","rf",
+ "s0","s1","s2","s3","s4","s5","s6","s7",
+ "s8","s9","sa","sb","sc","sd","se","sf",
+ 0
};
#endif
-#undef HEX1
- for (i = 0; i < numberof(deviceNo); i++) {
- const char *const devno = deviceNo[i];
- snprintf(MasterName, sizeof MasterName, MasterDevice, devno);
+ for (p = deviceNo; *p != NULL; p++) {
+ snprintf(MasterName, sizeof MasterName, MasterDevice, *p);
if ((masterfd = rb_cloexec_open(MasterName,O_RDWR,0)) >= 0) {
rb_update_max_fd(masterfd);
*master = masterfd;
- snprintf(SlaveName, DEVICELEN, SlaveDevice, devno);
+ snprintf(SlaveName, DEVICELEN, SlaveDevice, *p);
if ((slavefd = rb_cloexec_open(SlaveName,O_RDWR,0)) >= 0) {
rb_update_max_fd(slavefd);
*slave = slavefd;
@@ -479,14 +504,6 @@ 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)
@@ -553,7 +570,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 contains the command's
+ * +r+:: A readable IO that 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.
@@ -573,11 +590,11 @@ pty_getpty(int argc, VALUE *argv, VALUE self)
establishShell(argc, argv, &info, SlaveName);
- rfptr->mode = rb_io_modestr_fmode("r");
+ rfptr->mode = rb_io_mode_flags("r");
rfptr->fd = info.fd;
rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName));
- wfptr->mode = rb_io_modestr_fmode("w") | FMODE_SYNC;
+ wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
wfptr->fd = rb_cloexec_dup(info.fd);
if (wfptr->fd == -1)
rb_sys_fail("dup()");
@@ -648,17 +665,9 @@ pty_check(int argc, VALUE *argv, VALUE self)
VALUE pid, exc;
rb_pid_t cpid;
int status;
- const int flag =
-#ifdef WNOHANG
- WNOHANG|
-#endif
-#ifdef WUNTRACED
- WUNTRACED|
-#endif
- 0;
rb_scan_args(argc, argv, "11", &pid, &exc);
- cpid = rb_waitpid(NUM2PIDT(pid), &status, flag);
+ cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED);
if (cpid == -1 || cpid == 0) return Qnil;
if (!RTEST(exc)) return rb_last_status_get();
@@ -715,7 +724,7 @@ static VALUE cPTY;
* # The result of read operation when pty slave is closed is platform
* # dependent.
* ret = begin
- * master.gets # FreeBSD returns nil.
+ * m.gets # FreeBSD returns nil.
* rescue Errno::EIO # GNU/Linux raises EIO.
* nil
* end
@@ -736,10 +745,10 @@ static VALUE cPTY;
*/
void
-Init_pty(void)
+Init_pty()
{
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 b4429ed5f3..36ad959222 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -200,7 +200,6 @@ 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));
@@ -218,48 +217,31 @@ 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)
{
- VALUE vparams;
+ volatile VALUE vparams;
struct cparse_params *v;
- vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
- &cparse_params_type, v);
+ vparams = Data_Make_Struct(CparseParams, struct cparse_params,
+ cparse_params_mark, -1, 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)
{
- VALUE vparams;
+ volatile VALUE vparams;
struct cparse_params *v;
- vparams = TypedData_Make_Struct(CparseParams, struct cparse_params,
- &cparse_params_type, v);
+ vparams = Data_Make_Struct(CparseParams, struct cparse_params,
+ cparse_params_mark, -1, v);
v->sys_debug = RTEST(sysdebug);
D_puts("start C yyparse");
vparams = initialize_params(vparams, parser, arg, lexer, lexmid);
@@ -272,7 +254,6 @@ racc_yyparse(VALUE parser, VALUE lexer, VALUE lexmid, VALUE arg, VALUE sysdebug)
rb_id2name(v->lexmid));
}
- RB_GC_GUARD(vparams);
return v->retval;
}
@@ -286,8 +267,9 @@ call_lexer(struct cparse_params *v)
static VALUE
lexer_iter(VALUE data)
{
- struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
+ struct cparse_params *v;
+ Data_Get_Struct(data, struct cparse_params, v);
rb_funcall(v->lexer, v->lexmid, 0);
return Qnil;
}
@@ -302,9 +284,10 @@ call_lexer(struct cparse_params *v)
static VALUE
lexer_i(RB_BLOCK_CALL_FUNC_ARGLIST(block_args, data))
{
- struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
+ struct cparse_params *v;
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);
@@ -337,8 +320,9 @@ assert_integer(VALUE n)
static VALUE
initialize_params(VALUE vparams, VALUE parser, VALUE arg, VALUE lexer, VALUE lexmid)
{
- struct cparse_params *v = rb_check_typeddata(vparams, &cparse_params_type);
+ struct cparse_params *v;
+ Data_Get_Struct(vparams, struct cparse_params, v);
v->value_v = vparams;
v->parser = parser;
v->lexer = lexer;
@@ -421,12 +405,6 @@ 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)
@@ -706,7 +684,7 @@ reduce(struct cparse_params *v, long act)
static VALUE
reduce0(VALUE val, VALUE data, VALUE self)
{
- struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
+ struct cparse_params *v;
VALUE reduce_to, reduce_len, method_id;
long len;
ID mid;
@@ -714,6 +692,7 @@ 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);
@@ -815,8 +794,6 @@ 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");
@@ -836,9 +813,6 @@ 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/depend b/ext/racc/cparse/depend
deleted file mode 100644
index 441d4df0f7..0000000000
--- a/ext/racc/cparse/depend
+++ /dev/null
@@ -1,12 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-cparse.o: $(RUBY_EXTCONF_H)
-cparse.o: $(arch_hdrdir)/ruby/config.h
-cparse.o: $(hdrdir)/ruby/backward.h
-cparse.o: $(hdrdir)/ruby/defines.h
-cparse.o: $(hdrdir)/ruby/intern.h
-cparse.o: $(hdrdir)/ruby/missing.h
-cparse.o: $(hdrdir)/ruby/ruby.h
-cparse.o: $(hdrdir)/ruby/st.h
-cparse.o: $(hdrdir)/ruby/subst.h
-cparse.o: cparse.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index dfddf57111..3710f6f7e7 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# $Id$
require 'mkmf'
diff --git a/ext/rbconfig/sizeof/depend b/ext/rbconfig/sizeof/depend
index 143cbb0ee5..360b3386d3 100644
--- a/ext/rbconfig/sizeof/depend
+++ b/ext/rbconfig/sizeof/depend
@@ -1,37 +1,3 @@
-# sources
-
-limits.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/limits.c.tmpl
+sizes.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
$(Q) $(RUBY) $(top_srcdir)/tool/generic_erb.rb --output=$@ \
- $(top_srcdir)/template/limits.c.tmpl \
-
-sizes.c: $(top_srcdir)/tool/generic_erb.rb \
- $(top_srcdir)/template/sizes.c.tmpl \
- $(top_srcdir)/configure.ac \
- $(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.ac \
- $(top_srcdir)/ext/rbconfig/sizeof/extconf.rb
-
-# AUTOGENERATED DEPENDENCIES START
-limits.o: $(RUBY_EXTCONF_H)
-limits.o: $(arch_hdrdir)/ruby/config.h
-limits.o: $(hdrdir)/ruby/backward.h
-limits.o: $(hdrdir)/ruby/defines.h
-limits.o: $(hdrdir)/ruby/intern.h
-limits.o: $(hdrdir)/ruby/missing.h
-limits.o: $(hdrdir)/ruby/ruby.h
-limits.o: $(hdrdir)/ruby/st.h
-limits.o: $(hdrdir)/ruby/subst.h
-limits.o: limits.c
-sizes.o: $(RUBY_EXTCONF_H)
-sizes.o: $(arch_hdrdir)/ruby/config.h
-sizes.o: $(hdrdir)/ruby/backward.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
+ $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
diff --git a/ext/rbconfig/sizeof/extconf.rb b/ext/rbconfig/sizeof/extconf.rb
index f7cd58f2d9..ac66b6ac26 100644
--- a/ext/rbconfig/sizeof/extconf.rb
+++ b/ext/rbconfig/sizeof/extconf.rb
@@ -1,36 +1,3 @@
-# frozen_string_literal: false
-$srcs = %w[sizes.c limits.c]
+$srcs = %w[sizes.c]
$distcleanfiles.concat($srcs)
-
-have_type('int_least8_t')
-have_type('int_least16_t')
-have_type('int_least32_t')
-have_type('int_least64_t')
-have_type('int_fast8_t')
-have_type('int_fast16_t')
-have_type('int_fast32_t')
-have_type('int_fast64_t')
-have_type('intmax_t')
-have_type('sig_atomic_t', %w[signal.h])
-have_type('wchar_t')
-have_type('wint_t', %w[wctype.h])
-have_type('wctrans_t', %w[wctype.h])
-have_type('wctype_t', %w[wctype.h])
-have_type('_Bool')
-have_type('long double')
-have_type('float _Complex')
-have_type('double _Complex')
-have_type('long double _Complex')
-have_type('float _Imaginary')
-have_type('double _Imaginary')
-have_type('long double _Imaginary')
-have_type('__int128') # x86_64 ABI (optional)
-have_type('__float128') # x86_64 ABI (optional)
-have_type('_Decimal32') # x86_64 ABI
-have_type('_Decimal64') # x86_64 ABI
-have_type('_Decimal128') # x86_64 ABI
-have_type('__m64') # x86_64 ABI (optional)
-have_type('__m128') # x86_64 ABI (optional)
-have_type('__float80') # gcc x86
-
create_makefile('rbconfig/sizeof')
diff --git a/ext/readline/depend b/ext/readline/depend
index eb7a047473..5780d8d42a 100644
--- a/ext/readline/depend
+++ b/ext/readline/depend
@@ -1,18 +1,6 @@
-# AUTOGENERATED DEPENDENCIES START
-readline.o: $(RUBY_EXTCONF_H)
-readline.o: $(arch_hdrdir)/ruby/config.h
-readline.o: $(hdrdir)/ruby/backward.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/onigmo.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: readline.c
-# AUTOGENERATED DEPENDENCIES END
+readline.o: readline.c $(HDRS) $(ruby_headers) \
+ $(top_srcdir)/internal.h \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h \
+ $(hdrdir)/ruby/thread.h
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 7bba386540..c79370bf4c 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "mkmf"
readline = Struct.new(:headers, :extra_check).new(["stdio.h"])
@@ -38,7 +37,6 @@ 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")
@@ -59,7 +57,7 @@ else
have_library("edit", "readline"))) ||
(readline.have_header("editline/readline.h") &&
have_library("edit", "readline"))
- raise "Neither readline nor libedit was found"
+ raise "readline nor libedit not found"
end
end
@@ -81,7 +79,6 @@ readline.have_var("rl_library_version")
readline.have_var("rl_editing_mode")
readline.have_var("rl_line_buffer")
readline.have_var("rl_point")
-readline.have_var("rl_char_is_quoted_p")
# workaround for native windows.
/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_event_hook")
/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_sigwinch")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 5b52422563..5ceaaf780b 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -33,8 +33,10 @@
#include <editline/readline.h>
#endif
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/thread.h"
+#include "internal.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -57,11 +59,7 @@ static VALUE mReadline;
#define COMPLETION_PROC "completion_proc"
#define COMPLETION_CASE_FOLD "completion_case_fold"
-static ID id_call, completion_proc, completion_case_fold;
-#if defined HAVE_RL_CHAR_IS_QUOTED_P
-#define QUOTING_DETECTION_PROC "quoting_detection_proc"
-static ID quoting_detection_proc;
-#endif
+static ID completion_proc, completion_case_fold;
#if USE_INSERT_IGNORE_ESCAPE
static ID id_orig_prompt, id_last_prompt;
#endif
@@ -92,8 +90,7 @@ static char **readline_attempted_completion_function(const char *text,
int start, int end);
#define OutputStringValue(str) do {\
- StringValueCStr(str);\
- rb_check_safe_obj(str);\
+ SafeStringValue(str);\
(str) = rb_str_conv_enc((str), rb_enc_get(str), rb_locale_encoding());\
} while (0)\
@@ -136,13 +133,6 @@ static VALUE readline_outstream;
static FILE *readline_rl_instream;
static FILE *readline_rl_outstream;
-static void
-mustbe_callable(VALUE proc)
-{
- if (!NIL_P(proc) && !rb_respond_to(proc, id_call))
- rb_raise(rb_eArgError, "argument must respond to `call'");
-}
-
#if defined HAVE_RL_GETC_FUNCTION
#ifndef HAVE_RL_GETC
@@ -165,25 +155,24 @@ getc_body(struct getc_struct *p)
#if defined(_WIN32)
{
INPUT_RECORD ir;
- DWORD n;
+ int n;
static int prior_key = '0';
for (;;) {
- HANDLE h;
if (prior_key > 0xff) {
prior_key = rl_getc(p->input);
return prior_key;
}
- h = (HANDLE)_get_osfhandle(p->fd);
- if (PeekConsoleInput(h, &ir, 1, &n)) {
+ if (PeekConsoleInput((HANDLE)_get_osfhandle(p->fd), &ir, 1, &n)) {
if (n == 1) {
if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) {
prior_key = rl_getc(p->input);
return prior_key;
} else {
- ReadConsoleInput(h, &ir, 1, &n);
+ ReadConsoleInput((HANDLE)_get_osfhandle(p->fd), &ir, 1, &n);
}
} else {
- rb_w32_wait_events_blocking(&h, 1, INFINITE);
+ HANDLE h = (HANDLE)_get_osfhandle(p->fd);
+ rb_w32_wait_events(&h, 1, INFINITE);
}
} else {
break;
@@ -241,7 +230,8 @@ readline_getc(FILE *input)
goto again;
rb_sys_fail("rb_wait_for_single_fd");
}
- rb_syserr_fail(data.err, "read");
+ errno = data.err;
+ rb_sys_fail("read");
}
return data.ret;
}
@@ -370,34 +360,6 @@ 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
@@ -499,7 +461,23 @@ readline_readline(int argc, VALUE *argv, VALUE self)
prompt = RSTRING_PTR(tmp);
}
- prepare_readline();
+ 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");
+ }
+ }
#ifdef _WIN32
rl_prep_terminal(1);
@@ -568,7 +546,8 @@ readline_s_set_input(VALUE self, VALUE input)
if (f == NULL) {
int save_errno = errno;
close(fd);
- rb_syserr_fail(save_errno, "fdopen");
+ errno = save_errno;
+ rb_sys_fail("fdopen");
}
rl_instream = readline_rl_instream = f;
readline_instream = input;
@@ -604,7 +583,8 @@ readline_s_set_output(VALUE self, VALUE output)
if (f == NULL) {
int save_errno = errno;
close(fd);
- rb_syserr_fail(save_errno, "fdopen");
+ errno = save_errno;
+ rb_sys_fail("fdopen");
}
rl_outstream = readline_rl_outstream = f;
readline_outstream = output;
@@ -630,7 +610,8 @@ readline_s_set_output(VALUE self, VALUE output)
static VALUE
readline_s_set_pre_input_hook(VALUE self, VALUE proc)
{
- mustbe_callable(proc);
+ if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
+ rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, id_pre_input_hook, proc);
}
@@ -657,7 +638,7 @@ readline_pre_input_hook(void)
proc = rb_attr_get(mReadline, id_pre_input_hook);
if (!NIL_P(proc))
- rb_funcall(proc, id_call, 0);
+ rb_funcall(proc, rb_intern("call"), 0);
return 0;
}
#else
@@ -688,16 +669,6 @@ readline_s_insert_text(VALUE self, VALUE str)
#endif
#if defined(HAVE_RL_DELETE_TEXT)
-static const char *
-str_subpos(const char *ptr, const char *end, long beg, long *sublen, rb_encoding *enc)
-{
- VALUE str = rb_enc_str_new_static(ptr, end-ptr, enc);
- OBJ_FREEZE(str);
- ptr = rb_str_subpos(str, beg, sublen);
- rb_gc_force_recycle(str);
- return ptr;
-}
-
/*
* call-seq:
* Readline.delete_text([start[, length]]) -> self
@@ -715,20 +686,21 @@ readline_s_delete_text(int argc, VALUE *argv, VALUE self)
{
rb_check_arity(argc, 0, 2);
if (rl_line_buffer) {
- const char *p, *ptr = rl_line_buffer;
- long beg = 0, len = strlen(ptr);
- const char *end = ptr + len;
- rb_encoding *enc = rb_locale_encoding();
+ char *p, *ptr = rl_line_buffer;
+ long beg = 0, len = strlen(rl_line_buffer);
+ struct RString fakestr;
+ VALUE str = rb_setup_fake_str(&fakestr, ptr, len, rb_locale_encoding());
+ OBJ_FREEZE(str);
if (argc == 2) {
beg = NUM2LONG(argv[0]);
len = NUM2LONG(argv[1]);
num_pos:
- p = str_subpos(ptr, end, beg, &len, enc);
+ p = rb_str_subpos(str, beg, &len);
if (!p) rb_raise(rb_eArgError, "invalid index");
beg = p - ptr;
}
else if (argc == 1) {
- len = rb_enc_strlen(ptr, ptr + len, enc);
+ len = rb_str_strlen(str);
if (!rb_range_beg_len(argv[0], &beg, &len, len, 1)) {
beg = NUM2LONG(argv[0]);
goto num_pos;
@@ -835,7 +807,8 @@ readline_s_redisplay(VALUE self)
static VALUE
readline_s_set_completion_proc(VALUE self, VALUE proc)
{
- mustbe_callable(proc);
+ if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
+ rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, completion_proc, proc);
}
@@ -851,51 +824,6 @@ readline_s_get_completion_proc(VALUE self)
return rb_attr_get(mReadline, completion_proc);
}
-#ifdef HAVE_RL_CHAR_IS_QUOTED_P
-/*
- * call-seq:
- * Readline.quoting_detection_proc = proc
- *
- * Specifies a Proc object +proc+ to determine if a character in the user's
- * input is escaped. It should take the user's input and the index of the
- * character in question as input, and return a boolean (true if the specified
- * character is escaped).
- *
- * Readline will only call this proc with characters specified in
- * +completer_quote_characters+, to discover if they indicate the end of a
- * quoted argument, or characters specified in
- * +completer_word_break_characters+, to discover if they indicate a break
- * between arguments.
- *
- * If +completer_quote_characters+ is not set, or if the user input doesn't
- * contain one of the +completer_quote_characters+ or a +\+ character,
- * Readline will not attempt to use this proc at all.
- *
- * Raises ArgumentError if +proc+ does not respond to the call method.
- */
-static VALUE
-readline_s_set_quoting_detection_proc(VALUE self, VALUE proc)
-{
- mustbe_callable(proc);
- return rb_ivar_set(mReadline, quoting_detection_proc, proc);
-}
-
-/*
- * call-seq:
- * Readline.quoting_detection_proc -> proc
- *
- * Returns the quoting detection Proc object.
- */
-static VALUE
-readline_s_get_quoting_detection_proc(VALUE self)
-{
- return rb_attr_get(mReadline, quoting_detection_proc);
-}
-#else
-#define readline_s_set_quoting_detection_proc rb_f_notimplement
-#define readline_s_get_quoting_detection_proc rb_f_notimplement
-#endif
-
/*
* call-seq:
* Readline.completion_case_fold = bool
@@ -1017,7 +945,7 @@ readline_attempted_completion_function(const char *text, int start, int end)
rl_attempted_completion_over = 1;
#endif
case_fold = RTEST(rb_attr_get(mReadline, completion_case_fold));
- ary = rb_funcall(proc, id_call, 1, rb_locale_str_new_cstr(text));
+ ary = rb_funcall(proc, rb_intern("call"), 1, rb_locale_str_new_cstr(text));
if (!RB_TYPE_P(ary, T_ARRAY))
ary = rb_Array(ary);
matches = RARRAY_LEN(ary);
@@ -1027,7 +955,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_AREF(ary, i));
+ temp = rb_obj_as_string(RARRAY_PTR(ary)[i]);
StringValueCStr(temp); /* must be NUL-terminated */
rb_enc_check(encobj, temp);
result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1);
@@ -1071,32 +999,6 @@ readline_attempted_completion_function(const char *text, int start, int end)
return result;
}
-#ifdef HAVE_RL_CHAR_IS_QUOTED_P
-static int
-readline_char_is_quoted(char *text, int byte_index)
-{
- VALUE proc, result, str;
- long char_index;
- size_t len;
-
- proc = rb_attr_get(mReadline, quoting_detection_proc);
- if (NIL_P(proc)) {
- return 0;
- }
-
- len = strlen(text);
- if (byte_index < 0 || len < (size_t)byte_index) {
- rb_raise(rb_eIndexError, "invalid byte index (%d in %"PRIdSIZE")",
- byte_index, len);
- }
-
- str = rb_locale_str_new(text, len);
- char_index = rb_str_sublen(str, byte_index);
- result = rb_funcall(proc, id_call, 2, str, LONG2FIX(char_index));
- return RTEST(result);
-}
-#endif
-
#ifdef HAVE_RL_SET_SCREEN_SIZE
/*
* call-seq:
@@ -1648,7 +1550,6 @@ 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;
}
@@ -1884,9 +1785,8 @@ username_completion_proc_call(VALUE self, VALUE str)
return result;
}
-#undef rb_intern
void
-Init_readline(void)
+Init_readline()
{
VALUE history, fcomp, ucomp, version;
@@ -1904,7 +1804,6 @@ Init_readline(void)
using_history();
- id_call = rb_intern("call");
completion_proc = rb_intern(COMPLETION_PROC);
completion_case_fold = rb_intern(COMPLETION_CASE_FOLD);
#if defined(HAVE_RL_PRE_INPUT_HOOK)
@@ -1913,9 +1812,6 @@ Init_readline(void)
#if defined(HAVE_RL_SPECIAL_PREFIXES)
id_special_prefixes = rb_intern("special_prefixes");
#endif
-#if defined HAVE_RL_CHAR_IS_QUOTED_P
- quoting_detection_proc = rb_intern(QUOTING_DETECTION_PROC);
-#endif
mReadline = rb_define_module("Readline");
rb_define_module_function(mReadline, "readline",
@@ -1928,10 +1824,6 @@ Init_readline(void)
readline_s_set_completion_proc, 1);
rb_define_singleton_method(mReadline, "completion_proc",
readline_s_get_completion_proc, 0);
- rb_define_singleton_method(mReadline, "quoting_detection_proc=",
- readline_s_set_quoting_detection_proc, 1);
- rb_define_singleton_method(mReadline, "quoting_detection_proc",
- readline_s_get_quoting_detection_proc, 0);
rb_define_singleton_method(mReadline, "completion_case_fold=",
readline_s_set_completion_case_fold, 1);
rb_define_singleton_method(mReadline, "completion_case_fold",
@@ -2080,9 +1972,6 @@ Init_readline(void)
#if defined(HAVE_RL_PRE_INPUT_HOOK)
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
-#if defined HAVE_RL_CHAR_IS_QUOTED_P
- rl_char_is_quoted_p = &readline_char_is_quoted;
-#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
#endif
@@ -2093,9 +1982,3 @@ Init_readline(void)
rb_gc_register_address(&readline_instream);
rb_gc_register_address(&readline_outstream);
}
-
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * end:
- */
diff --git a/ext/ripper/depend b/ext/ripper/depend
index 5d3bce4ec3..db7bea74ed 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -7,12 +7,24 @@ BISON = bison
src: ripper.c eventids1.c eventids2table.c
-ripper.o: ripper.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
.y.c:
$(ECHO) compiling compiler $<
$(Q) $(BISON) -t -v -oy.tab.c $<
- $(Q) sed -e "/^#/s!y\.tab\.c!$@!" -f $(top_srcdir)/tool/ytab.sed y.tab.c > $@
+ $(Q) sed -f $(top_srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@
@$(RM) y.tab.c
all: check
@@ -20,17 +32,13 @@ static: check
ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
$(ECHO) extracting $@ from $(top_srcdir)/parse.y
- $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ \
- --vpath=$(VPATH)$(PATH_SEPARATOR)$(top_srcdir) id.h $(top_srcdir)/parse.y > ripper.tmp.y
+ $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(top_srcdir)/parse.y > ripper.tmp.y
$(Q) $(RUBY) $(srcdir)/tools/preproc.rb ripper.tmp.y --output=$@
$(Q) $(RM) ripper.tmp.y
-check: .eventids2-check
-
-.eventids2-check: $(GEN) $(SRC1) $(SRC2)
+check: $(GEN) $(SRC1) $(SRC2)
$(ECHO) checking $(SRC1) and $(SRC2)
$(Q) $(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
- @exit > $@
eventids1.c: $(srcdir)/tools/generate.rb $(SRC1)
$(ECHO) generating $@ from $(SRC1)
@@ -45,37 +53,4 @@ eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
preproc: ripper.E
ripper.E: ripper.c
$(ECHO) preprocessing ripper.c
- $(Q) $(CC) -E $(INCFLAGS) $(CPPFLAGS) $< | $(RUBY) $(srcdir)/tools/strip.rb > $@
-
-# AUTOGENERATED DEPENDENCIES START
-ripper.o: $(RUBY_EXTCONF_H)
-ripper.o: $(arch_hdrdir)/ruby/config.h
-ripper.o: $(hdrdir)/ruby/backward.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/onigmo.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: ../../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)}probes.dmyh
-ripper.o: {$(VPATH)}ripper.c
-# AUTOGENERATED DEPENDENCIES END
+ $(Q) $(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index 04a40e0da7..423f9d7e29 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -8,297 +8,284 @@
#define tHEREDOC_END (tLAST_TOKEN + 8)
#define k__END__ (tLAST_TOKEN + 9)
-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_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;
- 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;
+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;
#include "eventids2table.c"
static void
ripper_init_eventids2(void)
{
-#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_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");
- 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);
+ 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");
}
-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 {
- unsigned short token;
- unsigned short id_offset;
+ int token;
+ ID *id;
} token_to_eventid[] = {
- {' ', 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_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},
/* ripper specific tokens */
- {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__)},
+ {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}
};
static ID
ripper_token2eventid(int tok)
{
- int i;
+ const struct token_assoc *a;
- for (i = 0; i < numberof(token_to_eventid); i++) {
- const struct token_assoc *const a = &token_to_eventid[i];
+ for (a = token_to_eventid; a->id != NULL; a++) {
if (a->token == tok)
- return *(const ID *)((const char *)&ripper_scanner_ids + a->id_offset);
+ return *a->id;
}
if (tok < 256) {
- return ripper_scanner_ids.ripper_id_CHAR;
+ return 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 89b46abcfd..db54e5ca2a 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -1,5 +1,4 @@
#!ruby -s
-# frozen_string_literal: true
require 'mkmf'
require 'rbconfig'
@@ -11,7 +10,7 @@ def main
end
end
$objs = %w(ripper.o)
- $cleanfiles.concat %w(ripper.y ripper.c ripper.E ripper.output y.output eventids1.c eventids2table.c .eventids2-check)
+ $cleanfiles.concat %w(ripper.y ripper.c ripper.E ripper.output y.output eventids1.c eventids2table.c)
$defs << '-DRIPPER'
$defs << '-DRIPPER_DEBUG' if $debug
$VPATH << '$(topdir)' << '$(top_srcdir)'
diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb
index e937d65217..542bd405d2 100644
--- a/ext/ripper/lib/ripper.rb
+++ b/ext/ripper/lib/ripper.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'ripper/core'
require 'ripper/lexer'
require 'ripper/filter'
@@ -66,9 +65,9 @@ require 'ripper/sexp'
#
# == License
#
-# Ruby License.
+# Ruby License.
#
-# - Minero Aoki
-# - aamine@loveruby.net
-# - http://i.loveruby.net
+# Minero Aoki
+# aamine@loveruby.net
+# http://i.loveruby.net
class Ripper; end
diff --git a/ext/ripper/lib/ripper/core.rb b/ext/ripper/lib/ripper/core.rb
index cdbaf7dd34..637a72f4ad 100644
--- a/ext/ripper/lib/ripper/core.rb
+++ b/ext/ripper/lib/ripper/core.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# $Id$
#
@@ -30,21 +29,16 @@ 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|
- alias_method "on_#{id}", "_dispatch_#{arity}"
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
+ def on_#{id}(#{ ('a'..'z').to_a[0, arity].join(', ') })
+ #{arity == 0 ? 'nil' : 'a'}
+ end
+ End
end
# This method is called when weak warning is produced by the parser.
@@ -66,7 +60,11 @@ class Ripper
#
SCANNER_EVENTS.each do |id|
- alias_method "on_#{id}", :_dispatch_1
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
+ def on_#{id}(token)
+ token
+ end
+ End
end
end
diff --git a/ext/ripper/lib/ripper/filter.rb b/ext/ripper/lib/ripper/filter.rb
index 9955d30550..239f9f00e1 100644
--- a/ext/ripper/lib/ripper/filter.rb
+++ b/ext/ripper/lib/ripper/filter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# $Id$
#
@@ -25,7 +24,6 @@ class Ripper
@__lexer = Lexer.new(src, filename, lineno)
@__line = nil
@__col = nil
- @__state = nil
end
# The file name of the input.
@@ -47,20 +45,13 @@ class Ripper
@__col
end
- # The scanner's state of the current token.
- # This value is the bitwise OR of zero or more of the +Ripper::EXPR_*+ constants.
- def state
- @__state
- end
-
# Starts the parser.
# +init+ is a data accumulator and is passed to the next event handler (as
# of Enumerable#inject).
def parse(init = nil)
data = init
- @__lexer.lex.each do |pos, event, tok, state|
+ @__lexer.lex.each do |pos, event, tok|
@__line, @__col = *pos
- @__state = state
data = if respond_to?(event, true)
then __send__(event, tok, data)
else on_default(event, tok, data)
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
index 9220257196..c0a64d1ee5 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# $Id$
#
@@ -23,114 +22,50 @@ class Ripper
end
# Tokenizes the Ruby program and returns an array of an array,
- # which is formatted like
- # <code>[[lineno, column], type, token, state]</code>.
+ # which is formatted like <code>[[lineno, column], type, token]</code>.
#
# require 'ripper'
# require 'pp'
#
# pp Ripper.lex("def m(a) nil end")
- # #=> [[[1, 0], :on_kw, "def", Ripper::EXPR_FNAME ],
- # [[1, 3], :on_sp, " ", Ripper::EXPR_FNAME ],
- # [[1, 4], :on_ident, "m", Ripper::EXPR_ENDFN ],
- # [[1, 5], :on_lparen, "(", Ripper::EXPR_LABEL | Ripper::EXPR_BEG],
- # [[1, 6], :on_ident, "a", Ripper::EXPR_ARG ],
- # [[1, 7], :on_rparen, ")", Ripper::EXPR_ENDFN ],
- # [[1, 8], :on_sp, " ", Ripper::EXPR_BEG ],
- # [[1, 9], :on_kw, "nil", Ripper::EXPR_END ],
- # [[1, 12], :on_sp, " ", Ripper::EXPR_END ],
- # [[1, 13], :on_kw, "end", Ripper::EXPR_END ]]
+ # #=> [[[1, 0], :on_kw, "def"],
+ # [[1, 3], :on_sp, " " ],
+ # [[1, 4], :on_ident, "m" ],
+ # [[1, 5], :on_lparen, "(" ],
+ # [[1, 6], :on_ident, "a" ],
+ # [[1, 7], :on_rparen, ")" ],
+ # [[1, 8], :on_sp, " " ],
+ # [[1, 9], :on_kw, "nil"],
+ # [[1, 12], :on_sp, " " ],
+ # [[1, 13], :on_kw, "end"]]
#
def Ripper.lex(src, filename = '-', lineno = 1)
Lexer.new(src, filename, lineno).lex
end
class Lexer < ::Ripper #:nodoc: internal use only
- State = Struct.new(:to_int, :to_s) do
- alias to_i to_int
- def initialize(i) super(i, Ripper.lex_state_name(i)).freeze end
- def inspect; "#<#{self.class}: #{self}>" end
- def pretty_print(q) q.text(to_s) end
- def ==(i) super or to_int == i end
- def &(i) self.class.new(to_int & i) end
- def |(i) self.class.new(to_int & i) end
- def allbits?(i) to_int.allbits?(i) end
- def anybits?(i) to_int.anybits?(i) end
- def nobits?(i) to_int.nobits?(i) end
- end
-
- Elem = Struct.new(:pos, :event, :tok, :state) do
- def initialize(pos, event, tok, state)
- super(pos, event, tok, State.new(state))
- end
- end
-
def tokenize
- parse().sort_by(&:pos).map(&:tok)
+ lex().map {|pos, event, tok| tok }
end
def lex
- parse().sort_by(&:pos).map(&:to_a)
+ parse().sort_by {|pos, event, tok| pos }
end
def parse
@buf = []
- @stack = []
super
- @buf.flatten!
@buf
end
private
- unless SCANNER_EVENT_TABLE.key?(:ignored_sp)
- SCANNER_EVENT_TABLE[:ignored_sp] = 1
- SCANNER_EVENTS << :ignored_sp
- EVENTS << :ignored_sp
- end
-
- 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 and e.pos[1].zero?
- tok = e.tok.dup if w > 0 and /\A\s/ =~ e.tok
- if (n = dedent_string(e.tok, w)) > 0
- if e.tok.empty?
- e.tok = tok[0, n]
- e.event = :on_ignored_sp
- next
- end
- ignored_sp << [i, Elem.new(e.pos.dup, :on_ignored_sp, tok[0, n], e.state)]
- e.pos[1] += n
- end
+ SCANNER_EVENTS.each do |event|
+ module_eval(<<-End, __FILE__+'/module_eval', __LINE__ + 1)
+ def on_#{event}(tok)
+ @buf.push [[lineno(), column()], :on_#{event}, tok]
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, state())
- end
-
- def on_heredoc_end(tok)
- @buf.push Elem.new([lineno(), column()], __callee__, tok, state())
- @buf = @stack.pop
- end
-
- def _push_token(tok)
- @buf.push Elem.new([lineno(), column()], __callee__, tok, state())
- end
-
- (SCANNER_EVENTS.map {|event|:"on_#{event}"} - private_instance_methods(false)).each do |event|
- alias_method event, :_push_token
+ End
end
end
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
index b52dd30ddc..66bd69134d 100644
--- a/ext/ripper/lib/ripper/sexp.rb
+++ b/ext/ripper/lib/ripper/sexp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# $Id$
#
@@ -29,9 +28,7 @@ class Ripper
# [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]]
#
def Ripper.sexp(src, filename = '-', lineno = 1)
- builder = SexpBuilderPP.new(src, filename, lineno)
- sexp = builder.parse
- sexp unless builder.error?
+ SexpBuilderPP.new(src, filename, lineno).parse
end
# [EXPERIMENTAL]
@@ -55,43 +52,48 @@ class Ripper
# nil]]]]
#
def Ripper.sexp_raw(src, filename = '-', lineno = 1)
- builder = SexpBuilder.new(src, filename, lineno)
- sexp = builder.parse
- sexp unless builder.error?
+ SexpBuilder.new(src, filename, lineno).parse
end
- class SexpBuilder < ::Ripper #:nodoc:
+ class SexpBuilderPP < ::Ripper #:nodoc:
private
- def dedent_element(e, width)
- if (n = dedent_string(e[1], width)) > 0
- e[2][1] += n
+ 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
end
- e
end
- 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
+ SCANNER_EVENTS.each do |event|
+ module_eval(<<-End, __FILE__, __LINE__ + 1)
+ def on_#{event}(tok)
+ [:@#{event}, tok, [lineno(), column()]]
end
- end
- sub[val]
- val
+ End
end
+ end
- events = private_instance_methods(false).grep(/\Aon_/) {$'.to_sym}
- (PARSER_EVENTS - events).each do |event|
+ class SexpBuilder < ::Ripper #:nodoc:
+ private
+
+ PARSER_EVENTS.each do |event|
module_eval(<<-End, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
args.unshift :#{event}
@@ -109,50 +111,4 @@ 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
-
- def on_mlhs_paren(list)
- [:mlhs, *list]
- end
-
- def on_mlhs_add_star(list, star)
- list.push([:rest_param, star])
- end
-
- def on_mlhs_add_post(list, post)
- list.concat(post)
- 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 f0de55a5f2..b19f6e8d5c 100755
--- a/ext/ripper/tools/generate-param-macros.rb
+++ b/ext/ripper/tools/generate-param-macros.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
off = true
ARGF.each do |line|
case line
diff --git a/ext/ripper/tools/generate.rb b/ext/ripper/tools/generate.rb
index cf24f1398d..48ad9e1d25 100755
--- a/ext/ripper/tools/generate.rb
+++ b/ext/ripper/tools/generate.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# $Id$
require 'optparse'
@@ -68,23 +67,16 @@ def usage(msg)
end
def generate_eventids1(ids)
- buf = "".dup
- buf << %Q[static struct {\n]
+ buf = ""
ids.each do |id, arity|
- 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]
+ buf << %Q[static ID ripper_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[ set_id1(#{id});\n]
+ buf << %Q[ ripper_id_#{id} = rb_intern_const("on_#{id}");\n]
end
buf << %Q[}\n]
buf << %Q[\n]
@@ -92,23 +84,27 @@ 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[ rb_hash_aset(h, intern_sym("#{id}"), INT2FIX(#{arity}));\n]
+ buf << %Q[ id = rb_intern_const("#{id}");\n]
+ buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(#{arity}));\n]
end
buf << %Q[}\n]
buf
end
def generate_eventids2_table(ids)
- buf = "".dup
+ buf = ""
buf << %Q[static void\n]
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[ rb_hash_aset(h, intern_sym("#{id}"), INT2FIX(1));\n]
+ buf << %Q[ id = rb_intern_const("#{id}");\n]
+ buf << %Q[ rb_hash_aset(h, ID2SYM(id), INT2NUM(1));\n]
end
buf << %Q[}\n]
buf
@@ -139,9 +135,9 @@ def read_ids1_with_locations(path)
h = {}
File.open(path) {|f|
f.each do |line|
- next if /\A\#\s*define\s+dispatch/ =~ line
+ next if /\A\#\s*define\s+s?dispatch/ =~ line
next if /ripper_dispatch/ =~ line
- line.scan(/\bdispatch(\d)\((\w+)/) do |arity, event|
+ line.scan(/dispatch(\d)\((\w+)/) do |arity, event|
(h[event] ||= []).push [f.lineno, arity.to_i]
end
end
@@ -150,13 +146,9 @@ def read_ids1_with_locations(path)
end
def read_ids2(path)
- 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
+ File.open(path) {|f|
+ return f.read.scan(/ripper_id_(\w+)/).flatten.uniq.sort
+ }
end
main
diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb
index 8b68579164..06397cea05 100755
--- a/ext/ripper/tools/preproc.rb
+++ b/ext/ripper/tools/preproc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# $Id$
require 'optparse'
@@ -24,7 +23,7 @@ def main
unless ARGV.size == 1
abort "wrong number of arguments (#{ARGV.size} for 1)"
end
- out = "".dup
+ out = ""
File.open(ARGV[0]) {|f|
prelude f, out
grammar f, out
@@ -40,7 +39,6 @@ def main
end
def prelude(f, out)
- @exprs = {}
while line = f.gets
case line
when %r</\*%%%\*/>
@@ -57,16 +55,6 @@ def prelude(f, out)
when /\A%type/
out << line.sub(/<\w+>/, '<val>')
else
- if (/^enum lex_state_(?:bits|e) \{/ =~ line)..(/^\}/ =~ line)
- case line
- when /^\s*(EXPR_\w+),\s+\/\*(.+)\*\//
- @exprs[$1.chomp("_bit")] = $2.strip
- when /^\s*(EXPR_\w+)\s+=\s+(.+)$/
- name = $1
- val = $2.chomp(",")
- @exprs[name] = "equals to " + (val.start_with?("(") ? "<tt>#{val}</tt>" : "+#{val}+")
- end
- end
out << line
end
end
@@ -95,12 +83,9 @@ def grammar(f, out)
end
def usercode(f, out)
- require 'erb'
- compiler = ERB::Compiler.new('%-')
- compiler.put_cmd = compiler.insert_cmd = "out.<<"
- lineno = f.lineno
- src, = compiler.compile(f.read)
- eval(src, binding, f.path, lineno)
+ while line = f.gets
+ out << line
+ end
end
main
diff --git a/ext/ripper/tools/strip.rb b/ext/ripper/tools/strip.rb
index 23102f797a..99413c361d 100755
--- a/ext/ripper/tools/strip.rb
+++ b/ext/ripper/tools/strip.rb
@@ -1,10 +1,10 @@
-# frozen_string_literal: true
last_is_void = false
ARGF.each do |line|
- case line
- when /\A\s*\z/, /\A\#/
- puts unless last_is_void
+ if line.strip.empty?
+ #puts() unless last_is_void
last_is_void = true
+ elsif /\A\#/ === line
+ ;
else
print line
last_is_void = false
diff --git a/ext/rubyvm/extconf.rb b/ext/rubyvm/extconf.rb
deleted file mode 100644
index 8c40f58e2b..0000000000
--- a/ext/rubyvm/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile("rubyvm")
diff --git a/ext/rubyvm/lib/forwardable/impl.rb b/ext/rubyvm/lib/forwardable/impl.rb
deleted file mode 100644
index e9ada26e74..0000000000
--- a/ext/rubyvm/lib/forwardable/impl.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# :stopdoc:
-module Forwardable
- FILTER_EXCEPTION = ""
-
- def self._valid_method?(method)
- iseq = RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)
- rescue SyntaxError
- false
- else
- iseq.to_a.dig(-1, 1, 1, :mid) == method.to_sym
- end
-
- def self._compile_method(src, file, line)
- RubyVM::InstructionSequence.compile(src, file, file, line,
- trace_instruction: false,
- tailcall_optimization: true)
- .eval
- end
-end
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 3a42b0e569..847eb2aaf6 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -7,7 +7,8 @@
* core routines
*/
-#include "ruby/ruby.h"
+#include "ruby/config.h"
+#include "ruby/defines.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -176,24 +177,24 @@ sdbm_open(register char *file, register int flags, register int mode)
static int
fd_set_cloexec(int fd)
{
- /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
+ /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */
#ifdef F_GETFD
- int flags, ret;
- flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
- if (flags == -1) {
- return -1;
- }
- if (2 < fd) {
- if (!(flags & FD_CLOEXEC)) {
- flags |= FD_CLOEXEC;
- ret = fcntl(fd, F_SETFD, flags);
- if (ret == -1) {
- return -1;
- }
- }
- }
+ int flags, ret;
+ flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */
+ if (flags == -1) {
+ return -1;
+ }
+ if (2 < fd) {
+ if (!(flags & FD_CLOEXEC)) {
+ flags |= FD_CLOEXEC;
+ ret = fcntl(fd, F_SETFD, flags);
+ if (ret == -1) {
+ return -1;
+ }
+ }
+ }
#endif
- return 0;
+ return 0;
}
DBM *
@@ -372,7 +373,7 @@ makroom(register DBM *db, long int hash, int need)
{
long newp;
char twin[PBLKSIZ];
-#if defined _WIN32
+#if defined _WIN32 && !defined __CYGWIN__
char zer[PBLKSIZ];
long oldtail;
#endif
@@ -399,21 +400,21 @@ 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
- /*
- * Fill hole with 0 if made it.
- * (hole is NOT read as 0)
- */
- oldtail = lseek(db->pagf, 0L, SEEK_END);
- memset(zer, 0, PBLKSIZ);
- while (OFF_PAG(newp) > oldtail) {
- if (lseek(db->pagf, 0L, SEEK_END) < 0 ||
- write(db->pagf, zer, PBLKSIZ) < 0) {
+#if defined _WIN32 && !defined __CYGWIN__
+ /*
+ * Fill hole with 0 if made it.
+ * (hole is NOT read as 0)
+ */
+ oldtail = lseek(db->pagf, 0L, SEEK_END);
+ memset(zer, 0, PBLKSIZ);
+ while (OFF_PAG(newp) > oldtail) {
+ if (lseek(db->pagf, 0L, SEEK_END) < 0 ||
+ write(db->pagf, zer, PBLKSIZ) < 0) {
- return 0;
- }
- oldtail += PBLKSIZ;
+ return 0;
}
+ oldtail += PBLKSIZ;
+ }
#endif
if (hash & (db->hmask + 1)) {
@@ -506,7 +507,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: %ld...", dbit));
+ debug(("dbit: %d...", dbit));
db->curbit = dbit;
db->hmask = masks[hbit];
@@ -531,7 +532,7 @@ getpage(register DBM *db, register long int hash)
}
db->pagbno = pagb;
- debug(("pag read: %ld\n", pagb));
+ debug(("pag read: %d\n", pagb));
}
return 1;
}
@@ -551,7 +552,7 @@ getdbit(register DBM *db, register long int dbit)
return 0;
db->dirbno = dirb;
- debug(("dir read: %ld\n", dirb));
+ debug(("dir read: %d\n", dirb));
}
return db->dirbuf[c % DBLKSIZ] & (1 << (dbit % BYTESIZ));
@@ -572,7 +573,7 @@ setdbit(register DBM *db, register long int dbit)
return 0;
db->dirbno = dirb;
- debug(("dir read: %ld\n", dirb));
+ debug(("dir read: %d\n", dirb));
}
db->dirbuf[c % DBLKSIZ] |= (1 << (dbit % BYTESIZ));
@@ -802,7 +803,7 @@ delpair(char *pag, datum key)
}
#else
#ifdef MEMMOVE
- memmove(dst-m, src-m, m);
+ memmove(dst, src, m);
#else
while (m--)
*--dst = *--src;
diff --git a/ext/sdbm/depend b/ext/sdbm/depend
index aeb2099e18..09f171a511 100644
--- a/ext/sdbm/depend
+++ b/ext/sdbm/depend
@@ -1,25 +1,2 @@
-# AUTOGENERATED DEPENDENCIES START
-_sdbm.o: $(RUBY_EXTCONF_H)
-_sdbm.o: $(arch_hdrdir)/ruby/config.h
-_sdbm.o: $(hdrdir)/ruby/backward.h
-_sdbm.o: $(hdrdir)/ruby/defines.h
-_sdbm.o: $(hdrdir)/ruby/intern.h
-_sdbm.o: $(hdrdir)/ruby/missing.h
-_sdbm.o: $(hdrdir)/ruby/ruby.h
-_sdbm.o: $(hdrdir)/ruby/st.h
-_sdbm.o: $(hdrdir)/ruby/subst.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/backward.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
+_sdbm.o: _sdbm.c sdbm.h $(HDRS) $(ruby_headers)
+init.o: init.c sdbm.h $(HDRS) $(ruby_headers)
diff --git a/ext/sdbm/extconf.rb b/ext/sdbm/extconf.rb
index bdf3e299e6..67796fbf8a 100644
--- a/ext/sdbm/extconf.rb
+++ b/ext/sdbm/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
$defs << "-D""BADMESS=0"
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index f28eeb2f5e..92901181a5 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -72,13 +72,14 @@ struct dbmdata {
};
static void
-closed_sdbm(void)
+closed_sdbm()
{
rb_raise(rb_eDBMError, "closed SDBM file");
}
#define GetDBM(obj, dbmp) do {\
- TypedData_Get_Struct((obj), struct dbmdata, &sdbm_type, (dbmp));\
+ Data_Get_Struct((obj), struct dbmdata, (dbmp));\
+ if ((dbmp) == 0) closed_sdbm();\
if ((dbmp)->di_dbm == 0) closed_sdbm();\
} while (0)
@@ -88,31 +89,13 @@ closed_sdbm(void)
} while (0)
static void
-free_sdbm(void *ptr)
+free_sdbm(struct dbmdata *dbmp)
{
- struct dbmdata *dbmp = ptr;
if (dbmp->di_dbm) sdbm_close(dbmp->di_dbm);
ruby_xfree(dbmp);
}
-static size_t
-memsize_dbm(const void *ptr)
-{
- const struct dbmdata *dbmp = ptr;
- size_t 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
@@ -144,7 +127,9 @@ fsdbm_closed(VALUE obj)
{
struct dbmdata *dbmp;
- TypedData_Get_Struct(obj, struct dbmdata, &sdbm_type, dbmp);
+ Data_Get_Struct(obj, struct dbmdata, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -154,9 +139,7 @@ fsdbm_closed(VALUE obj)
static VALUE
fsdbm_alloc(VALUE klass)
{
- struct dbmdata *dbmp;
-
- return TypedData_Make_Struct(klass, struct dbmdata, &sdbm_type, dbmp);
+ return Data_Wrap_Struct(klass, 0, free_sdbm, 0);
}
/*
* call-seq:
@@ -176,12 +159,12 @@ fsdbm_alloc(VALUE klass)
static VALUE
fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
{
- VALUE file, vmode;
+ volatile VALUE file;
+ VALUE vmode;
DBM *dbm;
struct dbmdata *dbmp;
int mode;
- TypedData_Get_Struct(obj, struct dbmdata, &sdbm_type, dbmp);
if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
mode = 0666; /* default value */
}
@@ -206,8 +189,8 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
rb_sys_fail_str(file);
}
- if (dbmp->di_dbm)
- sdbm_close(dbmp->di_dbm);
+ dbmp = ALLOC(struct dbmdata);
+ DATA_PTR(obj) = dbmp;
dbmp->di_dbm = dbm;
dbmp->di_size = -1;
@@ -235,7 +218,7 @@ fsdbm_initialize(int argc, VALUE *argv, VALUE obj)
static VALUE
fsdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = fsdbm_alloc(klass);
+ VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0);
if (NIL_P(fsdbm_initialize(argc, argv, obj))) {
return Qnil;
@@ -509,8 +492,7 @@ fsdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_new();
- long i;
- int status = 0, n;
+ int i, status = 0, n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
@@ -527,7 +509,7 @@ fsdbm_delete_if(VALUE obj)
}
for (i = 0; i < RARRAY_LEN(ary); i++) {
- keystr = RARRAY_AREF(ary, i);
+ keystr = RARRAY_PTR(ary)[i];
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LENINT(keystr);
@@ -652,13 +634,11 @@ 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]");
}
- ptr = RARRAY_CONST_PTR(pair);
- fsdbm_store(dbm, ptr[0], ptr[1]);
+ fsdbm_store(dbm, RARRAY_PTR(pair)[0], RARRAY_PTR(pair)[1]);
return Qnil;
}
@@ -1011,7 +991,7 @@ fsdbm_reject(VALUE obj)
}
void
-Init_sdbm(void)
+Init_sdbm()
{
rb_cDBM = rb_define_class("SDBM", rb_cObject);
rb_eDBMError = rb_define_class("SDBMError", rb_eStandardError);
diff --git a/ext/sdbm/sdbm.gemspec b/ext/sdbm/sdbm.gemspec
deleted file mode 100644
index 3627d2800b..0000000000
--- a/ext/sdbm/sdbm.gemspec
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-Gem::Specification.new do |s|
- s.name = "sdbm"
- s.version = '1.0.0'
- s.date = '2017-12-11'
- s.summary = "Provides a simple file-based key-value store with String keys and values."
- s.description = "Provides a simple file-based key-value store with String keys and values."
-
- s.require_path = %w{lib}
- s.files = %w{ext/sdbm/_sdbm.c ext/sdbm/depend ext/sdbm/extconf.rb ext/sdbm/init.c ext/sdbm/sdbm.h}
- s.extensions = ["ext/sdbm/extconf.rb"]
- s.required_ruby_version = ">= 2.3.0"
-
- s.authors = ["Yukihiro Matsumoto"]
- s.email = ["matz@ruby-lang.org"]
- s.homepage = "https://github.com/ruby/sdbm"
- s.license = "BSD-2-Clause"
-
- s.add_development_dependency "test-unit"
- s.add_development_dependency "rake-compiler"
-end
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index f5451c9569..218085d5ce 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -3,7 +3,6 @@
#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;
@@ -207,7 +206,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_AREF(ary, i);
+ VALUE obj = RARRAY_PTR(ary)[i];
rb_io_t *fptr;
int fd;
GetOpenFile(obj, fptr);
@@ -360,8 +359,6 @@ ancillary_timestamp(VALUE self)
*
* The size and endian is dependent on the host.
*
- * require 'socket'
- *
* p Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
* #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
*/
@@ -992,7 +989,7 @@ ancillary_inspect(VALUE self)
vtype = ip_cmsg_type_to_sym(level, type);
if (SYMBOL_P(vtype))
- rb_str_catf(ret, " %"PRIsVALUE, rb_sym2str(vtype));
+ rb_str_catf(ret, " %s", rb_id2name(SYM2ID(vtype)));
else
rb_str_catf(ret, " cmsg_type:%d", type);
}
@@ -1108,8 +1105,8 @@ ancillary_cmsg_is_p(VALUE self, VALUE vlevel, VALUE vtype)
#if defined(HAVE_SENDMSG)
struct sendmsg_args_struct {
int fd;
- int flags;
const struct msghdr *msg;
+ int flags;
};
static void *
@@ -1130,16 +1127,16 @@ rb_sendmsg(int fd, const struct msghdr *msg, int flags)
}
static VALUE
-bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
- VALUE dest_sockaddr, VALUE controls, VALUE ex,
- int nonblock)
+bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, 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)
- VALUE controls_str = 0;
+ volatile VALUE controls_str = 0;
+ VALUE *controls_ptr = NULL;
int family;
#endif
int flags;
@@ -1147,21 +1144,27 @@ bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
GetOpenFile(sock, fptr);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- family = rsock_getfamily(fptr);
+ family = rsock_getfamily(fptr->fd);
#endif
- StringValue(data);
+ data = vflags = dest_sockaddr = Qnil;
- if (!RB_TYPE_P(controls, T_ARRAY)) {
- controls = rb_ary_new();
- }
- controls_num = RARRAY_LENINT(controls);
+ 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]; }
+#endif
+
+ StringValue(data);
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;
@@ -1236,7 +1239,6 @@ bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
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,63 +1270,96 @@ bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
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 && !MSG_DONTWAIT_RELIABLE)
+ if (nonblock)
rb_io_set_nonblock(fptr);
ss = rb_sendmsg(fptr->fd, &mh, flags);
if (ss == -1) {
- 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 (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
+ rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block");
+ rb_sys_fail("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(VALUE sock, VALUE data, VALUE flags, VALUE dest_sockaddr,
- VALUE controls)
+rsock_bsock_sendmsg(int argc, VALUE *argv, VALUE sock)
{
- return bsock_sendmsg_internal(sock, data, flags, dest_sockaddr, controls,
- Qtrue, 0);
+ return bsock_sendmsg_internal(argc, argv, sock, 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(VALUE sock, VALUE data, VALUE flags,
- VALUE dest_sockaddr, VALUE controls, VALUE ex)
+rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return bsock_sendmsg_internal(sock, data, flags, dest_sockaddr,
- controls, ex, 1);
+ return bsock_sendmsg_internal(argc, argv, sock, 1);
}
#endif
#if defined(HAVE_RECVMSG)
struct recvmsg_args_struct {
int fd;
- int flags;
struct msghdr *msg;
+ int flags;
};
ssize_t
@@ -1444,18 +1479,18 @@ make_io_for_unix_rights(VALUE ctl, struct cmsghdr *cmh, char *msg_end)
#endif
static VALUE
-bsock_recvmsg_internal(VALUE sock,
- VALUE vmaxdatlen, VALUE vflags, VALUE vmaxctllen,
- VALUE scm_rights, VALUE ex, int nonblock)
+bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, 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 *datbuf;
+ char datbuf0[4096], *datbuf;
VALUE dat_str = Qnil;
VALUE ret;
ssize_t ss;
@@ -1463,20 +1498,27 @@ bsock_recvmsg_internal(VALUE sock,
#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
- maxdatlen = NIL_P(vmaxdatlen) ? 4096 : NUM2SIZET(vmaxdatlen);
+
+ rb_scan_args(argc, argv, "03:", &vmaxdatlen, &vflags, &vmaxctllen, &vopts);
+
+ maxdatlen = NIL_P(vmaxdatlen) ? sizeof(datbuf0) : NUM2SIZET(vmaxdatlen);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- maxctllen = NIL_P(vmaxctllen) ? 4096 : NUM2SIZET(vmaxctllen);
+ maxctllen = NIL_P(vmaxctllen) ? sizeof(ctlbuf0) : NUM2SIZET(vmaxctllen);
#else
if (!NIL_P(vmaxctllen))
rb_raise(rb_eArgError, "control message not supported");
#endif
- flags = NUM2INT(vflags);
+ flags = NIL_P(vflags) ? 0 : NUM2INT(vflags);
#ifdef MSG_DONTWAIT
if (nonblock)
flags |= MSG_DONTWAIT;
@@ -1486,7 +1528,7 @@ bsock_recvmsg_internal(VALUE sock,
grow_buffer = NIL_P(vmaxdatlen) || NIL_P(vmaxctllen);
request_scm_rights = 0;
- if (RTEST(scm_rights))
+ if (!NIL_P(vopts) && RTEST(rb_hash_aref(vopts, ID2SYM(rb_intern("scm_rights")))))
request_scm_rights = 1;
#if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
if (request_scm_rights)
@@ -1511,18 +1553,26 @@ bsock_recvmsg_internal(VALUE sock,
#endif
retry:
- 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 (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 defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- 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 (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);
+ }
#endif
memset(&mh, 0, sizeof(mh));
@@ -1545,26 +1595,20 @@ bsock_recvmsg_internal(VALUE sock,
flags |= MSG_PEEK;
rb_io_check_closed(fptr);
- if (nonblock && !MSG_DONTWAIT_RELIABLE)
+ if (nonblock)
rb_io_set_nonblock(fptr);
ss = rb_recvmsg(fptr->fd, &mh, flags);
if (ss == -1) {
- 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 (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN))
+ rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "recvmsg(2) would block");
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- if (!gc_done && (e == EMFILE || e == EMSGSIZE)) {
+ if (!gc_done && (errno == EMFILE || errno == EMSGSIZE)) {
/*
* When SCM_RIGHTS hit the file descriptors limit:
* - Linux 2.6.18 causes success with MSG_CTRUNC
@@ -1576,23 +1620,19 @@ bsock_recvmsg_internal(VALUE sock,
gc_done = 1;
goto retry;
}
-#else
- if (NIL_P(vmaxdatlen) && grow_buffer && e == EMSGSIZE)
- ss = (ssize_t)iov.iov_len;
- else
#endif
- rb_syserr_fail(e, "recvmsg(2)");
+ rb_sys_fail("recvmsg(2)");
}
if (grow_buffer) {
int grown = 0;
- if (NIL_P(vmaxdatlen) && ss != -1 && ss == (ssize_t)iov.iov_len) {
+#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
+ if (NIL_P(vmaxdatlen) && (mh.msg_flags & MSG_TRUNC)) {
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 &&
@@ -1612,6 +1652,13 @@ bsock_recvmsg_internal(VALUE sock,
}
#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);
@@ -1645,7 +1692,7 @@ bsock_recvmsg_internal(VALUE sock,
);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
- family = rsock_getfamily(fptr);
+ family = rsock_getfamily(fptr->fd);
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)) {
@@ -1664,7 +1711,6 @@ bsock_recvmsg_internal(VALUE sock,
discard_cmsg(cmh, msg_end, (flags & MSG_PEEK) != 0);
rb_ary_push(ret, ctl);
}
- RB_GC_GUARD(ctl_str);
}
#endif
@@ -1673,21 +1719,82 @@ bsock_recvmsg_internal(VALUE sock,
#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(VALUE sock, VALUE dlen, VALUE flags, VALUE clen,
- VALUE scm_rights)
+rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock)
{
- VALUE ex = Qtrue;
- return bsock_recvmsg_internal(sock, dlen, flags, clen, scm_rights, ex, 0);
+ return bsock_recvmsg_internal(argc, argv, sock, 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(VALUE sock, VALUE dlen, VALUE flags, VALUE clen,
- VALUE scm_rights, VALUE ex)
+rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return bsock_recvmsg_internal(sock, dlen, flags, clen, scm_rights, ex, 1);
+ return bsock_recvmsg_internal(argc, argv, sock, 1);
}
#endif
@@ -1728,7 +1835,4 @@ 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 a1065608e6..088234aa85 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -66,6 +66,9 @@ 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;
@@ -97,6 +100,9 @@ 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)) {
@@ -127,6 +133,9 @@ 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);
@@ -158,10 +167,10 @@ bsock_close_write(VALUE sock)
* * +optval+ is the value of the option, it is passed to the underlying
* setsockopt() as a pointer to a certain number of bytes. How this is
* done depends on the type:
- * - Integer: value is assigned to an int, and a pointer to the int is
+ * - Fixnum: value is assigned to an int, and a pointer to the int is
* passed, with length of sizeof(int).
* - true or false: 1 or 0 (respectively) is assigned to an int, and the
- * int is passed as for an Integer. Note that +false+ must be passed,
+ * int is passed as for a Fixnum. Note that +false+ must be passed,
* not +nil+.
* - String: the string's data and length is passed to the socket.
* * +socketoption+ is an instance of Socket::Option
@@ -213,8 +222,9 @@ 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);
+ family = rsock_getfamily(fptr->fd);
level = rsock_level_arg(family, lev);
option = rsock_optname_arg(family, level, optname);
@@ -244,6 +254,7 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
return INT2FIX(0);
}
+#if !defined(__BEOS__)
/*
* Document-method: getsockopt
* call-seq:
@@ -310,22 +321,10 @@ bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
int family;
GetOpenFile(sock, fptr);
- family = rsock_getfamily(fptr);
+ family = rsock_getfamily(fptr->fd);
level = rsock_level_arg(family, lev);
option = rsock_optname_arg(family, level, optname);
len = 256;
-#ifdef _AIX
- switch (option) {
- case SO_DEBUG:
- case SO_REUSEADDR:
- case SO_KEEPALIVE:
- case SO_DONTROUTE:
- case SO_BROADCAST:
- case SO_OOBINLINE:
- /* AIX doesn' set len for boolean options */
- len = sizeof(int);
- }
-#endif
buf = ALLOCA_N(char,len);
rb_io_check_closed(fptr);
@@ -335,6 +334,9 @@ 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:
@@ -542,9 +544,8 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
struct rsock_send_arg arg;
VALUE flags, to;
rb_io_t *fptr;
- ssize_t n;
+ int n;
rb_blocking_function_t *func;
- const char *funcname;
rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to);
@@ -555,23 +556,21 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
arg.to = (struct sockaddr *)RSTRING_PTR(to);
arg.tolen = RSTRING_SOCKLEN(to);
func = rsock_sendto_blocking;
- funcname = "sendto(2)";
}
else {
func = rsock_send_blocking;
- funcname = "send(2)";
}
GetOpenFile(sock, fptr);
arg.fd = fptr->fd;
arg.flags = NUM2INT(flags);
while (rsock_maybe_fd_writable(arg.fd),
- (n = (ssize_t)BLOCKING_REGION_FD(func, &arg)) < 0) {
+ (n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
if (rb_io_wait_writable(arg.fd)) {
continue;
}
- rb_sys_fail(funcname);
+ rb_sys_fail("send(2)");
}
- return SSIZET2NUM(n);
+ return INT2FIX(n);
}
/*
@@ -580,15 +579,11 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
*
* Gets the do_not_reverse_lookup flag of _basicsocket_.
*
- * require 'socket'
- *
- * BasicSocket.do_not_reverse_lookup = false
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
* p sock.do_not_reverse_lookup #=> false
- * }
- * BasicSocket.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, "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"]
* }
*/
static VALUE
@@ -606,12 +601,10 @@ bsock_do_not_reverse_lookup(VALUE sock)
*
* Sets the do_not_reverse_lookup flag of _basicsocket_.
*
- * 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"]
- * }
+ * 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
*
*/
static VALUE
@@ -631,7 +624,8 @@ bsock_do_not_reverse_lookup_set(VALUE sock, VALUE state)
/*
* call-seq:
- * basicsocket.recv(maxlen[, flags[, outbuf]]) => mesg
+ * basicsocket.recv(maxlen) => mesg
+ * basicsocket.recv(maxlen, flags) => mesg
*
* Receives a message.
*
@@ -639,9 +633,6 @@ 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"
@@ -656,11 +647,55 @@ bsock_recv(int argc, VALUE *argv, VALUE sock)
return rsock_s_recvfrom(sock, argc, argv, RECV_RECV);
}
-/* :nodoc: */
+/*
+ * 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
+ */
+
static VALUE
-bsock_recv_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
+bsock_recv_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_RECV);
+ return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_RECV);
}
/*
@@ -729,29 +764,13 @@ 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);
- /* for ext/socket/lib/socket.rb use only: */
- rb_define_private_method(rb_cBasicSocket,
- "__recv_nonblock", bsock_recv_nonblock, 4);
-
-#if MSG_DONTWAIT_RELIABLE
- rb_define_private_method(rb_cBasicSocket,
- "__read_nonblock", rsock_read_nonblock, 3);
- rb_define_private_method(rb_cBasicSocket,
- "__write_nonblock", rsock_write_nonblock, 2);
-#endif
-
- /* 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);
+ 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 */
}
diff --git a/ext/socket/constants.c b/ext/socket/constants.c
index 6fc862777e..bab27b23bb 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_sym2str(arg);
+ arg = rb_sym_to_s(arg);
goto str;
}
else if (!NIL_P(tmp = rb_check_string_type(arg))) {
diff --git a/ext/socket/depend b/ext/socket/depend
index 41b00406a4..cd3fae98ea 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,329 +1,29 @@
-srcs: constdefs.h constdefs.c
+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
-getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h rubysocket.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: $(srcdir)/mkconstants.rb
+constdefs.h constdefs.c : $(srcdir)/mkconstants.rb
@echo "generating constant definitions"
@$(RUBY) $(srcdir)/mkconstants.rb -H constdefs.h -o constdefs.c
-
-constdefs.c: constdefs.h
-
-# AUTOGENERATED DEPENDENCIES START
-ancdata.o: $(RUBY_EXTCONF_H)
-ancdata.o: $(arch_hdrdir)/ruby/config.h
-ancdata.o: $(hdrdir)/ruby/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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/backward.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/onigmo.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 ec89bed7c2..c4523da24d 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
AF_INET6_SOCKET_CREATION_TEST = <<EOF
@@ -385,9 +384,7 @@ if have_type("struct tcp_info", 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_ca_state', headers)
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)
@@ -436,9 +433,15 @@ when /mswin(32|64)|mingw/
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
@@ -476,7 +479,6 @@ EOF
have_func('inet_aton("", (struct in_addr *)0)', headers)
have_func('getservbyport(0, "")', headers)
have_func("getifaddrs((struct ifaddrs **)NULL)", headers)
- have_struct_member("struct if_data", "ifi_vhid", headers) # FreeBSD
have_func("getpeereid", headers)
@@ -506,7 +508,7 @@ EOF
end
ipv6 = false
- default_ipv6 = /haiku/ !~ RUBY_PLATFORM
+ default_ipv6 = /beos|haiku/ !~ RUBY_PLATFORM
if enable_config("ipv6", default_ipv6)
if checking_for("ipv6") {try_link(AF_INET6_SOCKET_CREATION_TEST)}
$defs << "-DENABLE_IPV6" << "-DINET6"
@@ -563,16 +565,29 @@ EOS
case enable_config("wide-getaddrinfo")
when true
getaddr_info_ok = :wide
- when nil, false
- getaddr_info_ok = (:wide if getaddr_info_ok.nil?)
+ 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
if have_func("getnameinfo", headers) and have_func("getaddrinfo", headers)
- if CROSS_COMPILING ||
- $mingw || $mswin ||
- checking_for("system getaddrinfo working") {
+ getaddr_info_ok = :os
+ if !CROSS_COMPILING &&
+ !checking_for("system getaddrinfo working") {
try_run(cpp_include(headers) + GETADDRINFO_GETNAMEINFO_TEST)
}
- getaddr_info_ok = :os
+ getaddr_info_ok = nil
end
+ else
+ getaddr_info_ok = nil
end
else
raise "unexpected enable_config() value"
@@ -655,7 +670,7 @@ EOS
#include <netinet/in.h>
int t(struct in6_addr *addr) {return IN6_IS_ADDR_UNSPECIFIED(addr);}
SRC
- print "fixing apple's netinet6/in6.h ..."; $stdout.flush
+ print "fixing apple's netinet6/in6.rb ..."; $stdout.flush
in6 = File.read("/usr/include/#{hdr}")
if in6.gsub!(/\*\(const\s+__uint32_t\s+\*\)\(const\s+void\s+\*\)\(&(\(\w+\))->s6_addr\[(\d+)\]\)/) do
i, r = $2.to_i.divmod(4)
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index b01f1cb82e..a17d12b705 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -45,7 +45,11 @@
#include <sys/types.h>
#ifndef _WIN32
#include <sys/param.h>
-#include <sys/socket.h>
+#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+# include <net/socket.h>
+#else
+# include <sys/socket.h>
+#endif
#include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h>
@@ -62,9 +66,6 @@
#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>
@@ -435,8 +436,11 @@ 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);
@@ -589,7 +593,6 @@ 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 94a5eb9439..4da9680ccb 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -41,7 +41,11 @@
#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
-#include <sys/socket.h>
+#if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+# include <net/socket.h>
+#else
+# include <sys/socket.h>
+#endif
#include <netinet/in.h>
#if defined(HAVE_ARPA_INET_H)
#include <arpa/inet.h>
@@ -55,9 +59,6 @@
#endif
#endif
#ifdef _WIN32
-#if defined(_MSC_VER) && _MSC_VER <= 1200
-#include <windows.h>
-#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#define snprintf _snprintf
@@ -76,7 +77,6 @@ typedef int socklen_t;
#include "addrinfo.h"
#include "sockport.h"
-#include "rubysocket.h"
#define SUCCESS 0
#define ANY 0
@@ -118,6 +118,24 @@ 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 26aa0c8082..15395d7088 100644
--- a/ext/socket/ifaddr.c
+++ b/ext/socket/ifaddr.c
@@ -24,6 +24,7 @@ typedef struct rb_ifaddr_root_tag rb_ifaddr_root_t;
struct rb_ifaddr_tag {
int ord;
struct ifaddrs *ifaddr;
+ rb_ifaddr_root_t *root;
};
struct rb_ifaddr_root_tag {
@@ -40,6 +41,11 @@ get_root(const rb_ifaddr_t *ifaddr)
}
static void
+ifaddr_mark(void *ptr)
+{
+}
+
+static void
ifaddr_free(void *ptr)
{
rb_ifaddr_t *ifaddr = ptr;
@@ -54,17 +60,18 @@ ifaddr_free(void *ptr)
static size_t
ifaddr_memsize(const void *ptr)
{
- size_t size = offsetof(rb_ifaddr_root_t, ary);
const rb_ifaddr_t *ifaddr;
+ const rb_ifaddr_root_t *root;
+ if (ptr == NULL)
+ return 0;
ifaddr = ptr;
- if (ifaddr->ord == 0) size = sizeof(rb_ifaddr_root_t);
- size += sizeof(struct ifaddrs);
- return size;
+ root = get_root(ifaddr);
+ return sizeof(rb_ifaddr_root_t) + (root->numifaddrs - 1) * sizeof(rb_ifaddr_t);
}
static const rb_data_type_t ifaddr_type = {
"socket/ifaddr",
- {0, ifaddr_free, ifaddr_memsize,},
+ {ifaddr_mark, ifaddr_free, ifaddr_memsize,},
};
static inline rb_ifaddr_t *
@@ -84,12 +91,6 @@ get_ifaddr(VALUE self)
return rifaddr;
}
-static struct ifaddrs *
-get_ifaddrs(VALUE self)
-{
- return get_ifaddr(self)->ifaddr;
-}
-
static VALUE
rsock_getifaddrs(void)
{
@@ -97,7 +98,7 @@ rsock_getifaddrs(void)
int numifaddrs, i;
struct ifaddrs *ifaddrs, *ifa;
rb_ifaddr_root_t *root;
- VALUE result, addr;
+ VALUE result;
ret = getifaddrs(&ifaddrs);
if (ret == -1)
@@ -111,26 +112,20 @@ rsock_getifaddrs(void)
for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next)
numifaddrs++;
- addr = TypedData_Wrap_Struct(rb_cSockIfaddr, &ifaddr_type, 0);
- root = xmalloc(offsetof(rb_ifaddr_root_t, ary) + numifaddrs * sizeof(rb_ifaddr_t));
- root->refcount = 0;
- root->numifaddrs = numifaddrs;
+ root = xmalloc(sizeof(rb_ifaddr_root_t) + (numifaddrs-1) * sizeof(rb_ifaddr_t));
+ root->refcount = root->numifaddrs = numifaddrs;
ifa = ifaddrs;
for (i = 0; i < numifaddrs; i++) {
root->ary[i].ord = i;
root->ary[i].ifaddr = ifa;
+ root->ary[i].root = root;
ifa = ifa->ifa_next;
}
- RTYPEDDATA_DATA(addr) = &root->ary[0];
- root->refcount++;
result = rb_ary_new2(numifaddrs);
- 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);
+ for (i = 0; i < numifaddrs; i++) {
+ rb_ary_push(result, TypedData_Wrap_Struct(rb_cSockIfaddr, &ifaddr_type, &root->ary[i]));
}
return result;
@@ -146,7 +141,8 @@ rsock_getifaddrs(void)
static VALUE
ifaddr_name(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
return rb_str_new_cstr(ifa->ifa_name);
}
@@ -161,7 +157,8 @@ ifaddr_name(VALUE self)
static VALUE
ifaddr_ifindex(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
unsigned int ifindex = if_nametoindex(ifa->ifa_name);
if (ifindex == 0) {
rb_raise(rb_eArgError, "invalid interface name: %s", ifa->ifa_name);
@@ -182,7 +179,8 @@ ifaddr_ifindex(VALUE self)
static VALUE
ifaddr_flags(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
return IFAFLAGS2NUM(ifa->ifa_flags);
}
@@ -197,7 +195,8 @@ ifaddr_flags(VALUE self)
static VALUE
ifaddr_addr(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
if (ifa->ifa_addr)
return rsock_sockaddr_obj(ifa->ifa_addr, rsock_sockaddr_len(ifa->ifa_addr));
return Qnil;
@@ -214,7 +213,8 @@ ifaddr_addr(VALUE self)
static VALUE
ifaddr_netmask(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
if (ifa->ifa_netmask)
return rsock_sockaddr_obj(ifa->ifa_netmask, rsock_sockaddr_len(ifa->ifa_netmask));
return Qnil;
@@ -231,7 +231,8 @@ ifaddr_netmask(VALUE self)
static VALUE
ifaddr_broadaddr(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
if ((ifa->ifa_flags & IFF_BROADCAST) && ifa->ifa_broadaddr)
return rsock_sockaddr_obj(ifa->ifa_broadaddr, rsock_sockaddr_len(ifa->ifa_broadaddr));
return Qnil;
@@ -248,32 +249,13 @@ ifaddr_broadaddr(VALUE self)
static VALUE
ifaddr_dstaddr(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa = rifaddr->ifaddr;
if ((ifa->ifa_flags & IFF_POINTOPOINT) && ifa->ifa_dstaddr)
return rsock_sockaddr_obj(ifa->ifa_dstaddr, rsock_sockaddr_len(ifa->ifa_dstaddr));
return Qnil;
}
-#ifdef HAVE_STRUCT_IF_DATA_IFI_VHID
-/*
- * call-seq:
- * ifaddr.vhid => Integer
- *
- * Returns the vhid address of _ifaddr_.
- * nil is returned if there is no vhid.
- */
-
-static VALUE
-ifaddr_vhid(VALUE self)
-{
- struct ifaddrs *ifa = get_ifaddrs(self);
- if (ifa->ifa_data)
- return (INT2FIX(((struct if_data*)ifa->ifa_data)->ifi_vhid));
- else
- return Qnil;
-}
-#endif
-
static void
ifaddr_inspect_flags(ifa_flags_t flags, VALUE result)
{
@@ -356,9 +338,12 @@ ifaddr_inspect_flags(ifa_flags_t flags, VALUE result)
static VALUE
ifaddr_inspect(VALUE self)
{
- struct ifaddrs *ifa = get_ifaddrs(self);
+ rb_ifaddr_t *rifaddr = get_ifaddr(self);
+ struct ifaddrs *ifa;
VALUE result;
+ ifa = rifaddr->ifaddr;
+
result = rb_str_new_cstr("#<");
rb_str_append(result, rb_class_name(CLASS_OF(self)));
@@ -468,9 +453,6 @@ rsock_init_sockifaddr(void)
rb_define_method(rb_cSockIfaddr, "netmask", ifaddr_netmask, 0);
rb_define_method(rb_cSockIfaddr, "broadaddr", ifaddr_broadaddr, 0);
rb_define_method(rb_cSockIfaddr, "dstaddr", ifaddr_dstaddr, 0);
-#ifdef HAVE_STRUCT_IF_DATA_IFI_VHID
- rb_define_method(rb_cSockIfaddr, "vhid", ifaddr_vhid, 0);
-#endif
#endif
rb_define_singleton_method(rb_cSocket, "getifaddrs", socket_s_getifaddrs, 0);
diff --git a/ext/socket/init.c b/ext/socket/init.c
index e357beb0c9..f6cd2bce7b 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -29,49 +29,34 @@ 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
- int e;
- if (error == EAI_SYSTEM && (e = errno) != 0)
- rb_syserr_fail(e, reason);
+ if (error == EAI_SYSTEM) rb_sys_fail(reason);
#endif
rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
}
-#ifdef _WIN32
-#define is_socket(fd) rb_w32_is_socket(fd)
-#else
-static int
-is_socket(int fd)
+VALUE
+rsock_init_sock(VALUE sock, int fd)
{
+ rb_io_t *fp;
+#ifndef _WIN32
struct stat sbuf;
if (fstat(fd, &sbuf) < 0)
rb_sys_fail("fstat(2)");
- return S_ISSOCK(sbuf.st_mode);
-}
-#endif
-
-#if defined __APPLE__
-# define do_write_retry(code) do {ret = code;} while (ret == -1 && errno == EPROTOTYPE)
+ rb_update_max_fd(fd);
+ if (!S_ISSOCK(sbuf.st_mode))
+ rb_raise(rb_eArgError, "not a socket file descriptor");
#else
-# define do_write_retry(code) ret = code
+ rb_update_max_fd(fd);
+ if (!rb_w32_is_socket(fd))
+ rb_raise(rb_eArgError, "not a socket file descriptor");
#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;
@@ -89,10 +74,8 @@ rsock_sendto_blocking(void *data)
{
struct rsock_send_arg *arg = data;
VALUE mesg = arg->mesg;
- ssize_t ret;
- do_write_retry(sendto(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
- arg->flags, arg->to, arg->tolen));
- return (VALUE)ret;
+ return (VALUE)sendto(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
+ arg->flags, arg->to, arg->tolen);
}
VALUE
@@ -100,10 +83,8 @@ rsock_send_blocking(void *data)
{
struct rsock_send_arg *arg = data;
VALUE mesg = arg->mesg;
- ssize_t ret;
- do_write_retry(send(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
- arg->flags));
- return (VALUE)ret;
+ return (VALUE)send(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
+ arg->flags);
}
struct recvfrom_arg {
@@ -126,48 +107,21 @@ 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;
+ VALUE str, klass;
struct recvfrom_arg arg;
VALUE len, flg;
long buflen;
long slen;
- rb_scan_args(argc, argv, "12", &len, &flg, &str);
+ rb_scan_args(argc, argv, "11", &len, &flg);
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)) {
@@ -175,18 +129,24 @@ 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;
+
+ arg.str = str = rb_tainted_str_new(0, buflen);
+ klass = RBASIC(str)->klass;
+ rb_obj_hide(str);
while (rb_io_check_closed(fptr),
rsock_maybe_wait_fd(arg.fd),
- (slen = (long)rb_str_locktmp_ensure(str, recvfrom_locktmp,
- (VALUE)&arg)) < 0) {
+ (slen = BLOCKING_REGION_FD(recvfrom_blocking, &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");
+ }
}
- if (slen != RSTRING_LEN(str)) {
+ rb_obj_reveal(str, klass);
+ if (slen < RSTRING_LEN(str)) {
rb_str_set_len(str, slen);
}
rb_obj_taint(str);
@@ -216,21 +176,24 @@ rsock_s_recvfrom(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)
+rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, 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;
- flags = NUM2INT(flg);
+ rb_scan_args(argc, argv, "11", &len, &flg);
+
+ if (flg == Qnil) flags = 0;
+ else flags = NUM2INT(flg);
buflen = NUM2INT(len);
- str = rsock_strbuf(str, buflen);
#ifdef MSG_DONTWAIT
/* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom.
@@ -244,30 +207,26 @@ rsock_s_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str,
}
fd = fptr->fd;
- rb_io_check_closed(fptr);
-
- if (!MSG_DONTWAIT_RELIABLE)
- rb_io_set_nonblock(fptr);
+ str = rb_tainted_str_new(0, buflen);
+ rb_io_check_closed(fptr);
+ 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) {
- int e = errno;
- switch (e) {
+ switch (errno) {
case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- if (ex == Qfalse)
- return sym_wait_readable;
- rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE, e, "recvfrom(2) would block");
+ rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "recvfrom(2) would block");
}
- rb_syserr_fail(e, "recvfrom(2)");
+ rb_sys_fail("recvfrom(2)");
}
- if (slen != RSTRING_LEN(str)) {
+ if (slen < RSTRING_LEN(str)) {
rb_str_set_len(str, slen);
}
rb_obj_taint(str);
@@ -290,116 +249,6 @@ rsock_s_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str,
return rb_assoc_new(str, addr);
}
-#if MSG_DONTWAIT_RELIABLE
-static VALUE sym_wait_writable;
-
-/* copied from io.c :< */
-static long
-read_buffered_data(char *ptr, long len, rb_io_t *fptr)
-{
- int n = fptr->rbuf.len;
-
- if (n <= 0) return 0;
- if (n > len) n = (int)len;
- MEMMOVE(ptr, fptr->rbuf.ptr+fptr->rbuf.off, char, n);
- fptr->rbuf.off += n;
- fptr->rbuf.len -= n;
- return n;
-}
-
-/* :nodoc: */
-VALUE
-rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex)
-{
- rb_io_t *fptr;
- long n;
- long len = NUM2LONG(length);
- VALUE str = rsock_strbuf(buf, len);
- char *ptr;
-
- OBJ_TAINT(str);
- GetOpenFile(sock, fptr);
-
- if (len == 0) {
- return str;
- }
-
- ptr = RSTRING_PTR(str);
- n = read_buffered_data(ptr, len, fptr);
- if (n <= 0) {
- n = (long)recv(fptr->fd, ptr, len, MSG_DONTWAIT);
- 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);
- }
- }
- if (len != n) {
- rb_str_modify(str);
- rb_str_set_len(str, n);
- if (str != buf) {
- rb_str_resize(str, n);
- }
- }
- if (n == 0) {
- if (ex == Qfalse) return Qnil;
- rb_eof_error();
- }
-
- return str;
-}
-
-/* :nodoc: */
-VALUE
-rsock_write_nonblock(VALUE sock, VALUE str, VALUE ex)
-{
- rb_io_t *fptr;
- long n;
-
- if (!RB_TYPE_P(str, T_STRING))
- str = rb_obj_as_string(str);
-
- sock = rb_io_get_write_io(sock);
- GetOpenFile(sock, fptr);
- rb_io_check_writable(fptr);
-
- /*
- * As with IO#write_nonblock, we may block if somebody is relying on
- * buffered I/O; but nobody actually hits this because pipes and sockets
- * are not userspace-buffered in Ruby by default.
- */
- if (fptr->wbuf.len > 0) {
- rb_io_flush(sock);
- }
-
-#ifdef __APPLE__
- again:
-#endif
- n = (long)send(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str), MSG_DONTWAIT);
- if (n < 0) {
- int e = errno;
-
-#ifdef __APPLE__
- if (e == EPROTOTYPE) {
- goto again;
- }
-#endif
- if (e == EWOULDBLOCK || e == EAGAIN) {
- if (ex == Qfalse) return sym_wait_writable;
- rb_readwrite_syserr_fail(RB_IO_WAIT_WRITABLE, e,
- "write would block");
- }
- rb_syserr_fail_path(e, fptr->pathv);
- }
-
- return LONG2FIX(n);
-}
-#endif /* MSG_DONTWAIT_RELIABLE */
-
/* returns true if SOCK_CLOEXEC is supported */
int rsock_detect_cloexec(int fd)
{
@@ -480,7 +329,8 @@ rsock_socket(int domain, int type, int proto)
fd = rsock_socket0(domain, type, proto);
if (fd < 0) {
- if (rb_gc_for_fd(errno)) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
fd = rsock_socket0(domain, type, proto);
}
}
@@ -489,69 +339,72 @@ 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, revents;
+ int sockerr;
socklen_t sockerrlen;
+ int revents;
+ int ret;
- /* only to clear pending error */
- sockerrlen = (socklen_t)sizeof(sockerr);
- if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) < 0)
- return -1;
+ for (;;) {
+ /*
+ * Stevens book says, successful 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) {
+ if (revents & RB_WAITFD_OUT)
+ break;
+ else
+ continue; /* workaround for winsock */
+ }
- /*
- * 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);
+ /* BSD and Linux use sockerr. */
+ errno = sockerr;
+ ret = -1;
+ break;
+ }
- if (revents < 0)
- return -1;
+ if ((revents & (RB_WAITFD_IN|RB_WAITFD_OUT)) == RB_WAITFD_OUT) {
+ ret = 0;
+ break;
+ }
+ }
- sockerrlen = (socklen_t)sizeof(sockerr);
- if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) < 0)
- return -1;
+ return ret;
+}
- switch (sockerr) {
- case 0:
- /*
- * be defensive in case some platforms set SO_ERROR on the original,
- * interrupted connect()
- */
- case EINTR:
-#ifdef ERESTART
- case ERESTART:
+#ifdef __CYGWIN__
+#define WAIT_IN_PROGRESS 10
#endif
- case EAGAIN:
-#ifdef EINPROGRESS
- case EINPROGRESS:
+#ifdef __APPLE__
+#define WAIT_IN_PROGRESS 10
#endif
-#ifdef EALREADY
- case EALREADY:
+#ifdef __linux__
+/* returns correct error */
+#define WAIT_IN_PROGRESS 0
#endif
-#ifdef EISCONN
- case EISCONN:
+#ifndef WAIT_IN_PROGRESS
+/* BSD origin code apparently has a problem */
+#define WAIT_IN_PROGRESS 1
#endif
- return 0; /* success */
- default:
- /* likely (but not limited to): ECONNREFUSED, ETIMEDOUT, EHOSTUNREACH */
- errno = sockerr;
- return -1;
- }
-
- return 0;
-}
struct connect_arg {
int fd;
- socklen_t len;
const struct sockaddr *sockaddr;
+ socklen_t len;
};
static VALUE
@@ -576,6 +429,11 @@ 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;
@@ -583,22 +441,76 @@ rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
#if defined(SOCKS) && !defined(SOCKS5)
if (socks) func = socks_connect_blocking;
#endif
- status = (int)BLOCKING_REGION_FD(func, &arg);
-
- if (status < 0) {
- switch (errno) {
- case EINTR:
-#ifdef ERESTART
- case ERESTART:
+ for (;;) {
+ status = (int)BLOCKING_REGION_FD(func, &arg);
+ if (status < 0) {
+ switch (errno) {
+ case EINTR:
+#if defined(ERESTART)
+ case ERESTART:
#endif
- case EAGAIN:
+ continue;
+
+ case EAGAIN:
#ifdef EINPROGRESS
- case EINPROGRESS:
+ case EINPROGRESS:
#endif
- return wait_connectable(fd);
- }
+#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;
+#endif
+
+#ifdef EISCONN
+ case EISCONN:
+ status = 0;
+ errno = 0;
+ break;
+#endif
+ default:
+ break;
+ }
+ }
+ return status;
}
- return status;
}
static void
@@ -620,8 +532,7 @@ make_fd_nonblock(int fd)
}
static int
-cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len,
- int nonblock)
+cloexec_accept(int socket, struct sockaddr *address, socklen_t *address_len)
{
int ret;
socklen_t len0 = 0;
@@ -635,21 +546,11 @@ 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;
}
@@ -663,23 +564,20 @@ 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, VALUE ex, rb_io_t *fptr,
- struct sockaddr *sockaddr, socklen_t *len)
+rsock_s_accept_nonblock(VALUE klass, 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, 1);
+ fd2 = cloexec_accept(fptr->fd, (struct sockaddr*)sockaddr, len);
if (fd2 < 0) {
- int e = errno;
- switch (e) {
+ switch (errno) {
case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
@@ -688,13 +586,12 @@ rsock_s_accept_nonblock(VALUE klass, VALUE ex, rb_io_t *fptr,
#if defined EPROTO
case EPROTO:
#endif
- if (ex == Qfalse)
- return sym_wait_readable;
- rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE, e, "accept(2) would block");
+ rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "accept(2) would block");
}
- rb_syserr_fail(e, "accept(2)");
+ rb_sys_fail("accept(2)");
}
rb_update_max_fd(fd2);
+ make_fd_nonblock(fd2);
return rsock_init_sock(rb_obj_alloc(klass), fd2);
}
@@ -708,7 +605,7 @@ static VALUE
accept_blocking(void *data)
{
struct accept_arg *arg = data;
- return (VALUE)cloexec_accept(arg->fd, arg->sockaddr, arg->len, 0);
+ return (VALUE)cloexec_accept(arg->fd, arg->sockaddr, arg->len);
}
VALUE
@@ -718,6 +615,7 @@ 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;
@@ -725,11 +623,9 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
rsock_maybe_wait_fd(fd);
fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
if (fd2 < 0) {
- int e = errno;
- switch (e) {
+ switch (errno) {
case EMFILE:
case ENFILE:
- case ENOMEM:
if (retry) break;
rb_gc();
retry = 1;
@@ -739,7 +635,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
retry = 0;
goto retry;
}
- rb_syserr_fail(e, "accept(2)");
+ rb_sys_fail("accept(2)");
}
rb_update_max_fd(fd2);
if (!klass) return INT2NUM(fd2);
@@ -747,39 +643,20 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
}
int
-rsock_getfamily(rb_io_t *fptr)
+rsock_getfamily(int sockfd)
{
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(fptr->fd, &ss.addr, &sslen) < 0)
+ if (getsockname(sockfd, &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(void)
+rsock_init_socket_init()
{
/*
* SocketError is the error class for socket.
@@ -797,11 +674,4 @@ rsock_init_socket_init(void)
rsock_init_addrinfo();
rsock_init_sockifaddr();
rsock_init_socket_constants();
-
-#undef rb_intern
- sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
-
-#if MSG_DONTWAIT_RELIABLE
- sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
-#endif
}
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index dadf10f6a5..ef5ce763ec 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -41,23 +41,19 @@ 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,
- family, SOCK_STREAM,
- (type == INET_SERVER) ? AI_PASSIVE : 0);
+ arg->remote.res = rsock_addrinfo(arg->remote.host, arg->remote.serv, 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,
- family, SOCK_STREAM, 0);
+ arg->local.res = rsock_addrinfo(arg->local.host, arg->local.serv, SOCK_STREAM, 0);
}
arg->fd = fd = -1;
@@ -84,7 +80,6 @@ init_inetsock_internal(struct inetsock_arg *arg)
syscall = "socket(2)";
fd = status;
if (fd < 0) {
- error = errno;
continue;
}
arg->fd = fd;
@@ -112,7 +107,6 @@ init_inetsock_internal(struct inetsock_arg *arg)
}
if (status < 0) {
- error = errno;
close(fd);
arg->fd = fd = -1;
continue;
@@ -130,7 +124,7 @@ init_inetsock_internal(struct inetsock_arg *arg)
port = arg->remote.serv;
}
- rsock_syserr_fail_host_port(error, syscall, host, port);
+ rsock_sys_fail_host_port(syscall, host, port);
}
arg->fd = -1;
@@ -138,9 +132,8 @@ init_inetsock_internal(struct inetsock_arg *arg)
if (type == INET_SERVER) {
status = listen(fd, SOMAXCONN);
if (status < 0) {
- error = errno;
close(fd);
- rb_syserr_fail(error, "listen(2)");
+ rb_sys_fail("listen(2)");
}
}
@@ -191,43 +184,6 @@ rsock_revlookup_flag(VALUE revlookup, int *norevlookup)
/*
* call-seq:
- * ipsocket.inspect -> string
- *
- * Return a string describing this IPSocket object.
- */
-static VALUE
-ip_inspect(VALUE sock)
-{
- VALUE str = rb_call_super(0, 0);
- rb_io_t *fptr = RFILE(sock)->fptr;
- union_sockaddr addr;
- socklen_t len = (socklen_t)sizeof addr;
- ID id;
- if (fptr && fptr->fd >= 0 &&
- getsockname(fptr->fd, &addr.addr, &len) >= 0 &&
- (id = rsock_intern_family(addr.addr.sa_family)) != 0) {
- VALUE family = rb_id2str(id);
- char hbuf[1024], pbuf[1024];
- long slen = RSTRING_LEN(str);
- const char last = (slen > 1 && RSTRING_PTR(str)[slen - 1] == '>') ?
- (--slen, '>') : 0;
- str = rb_str_subseq(str, 0, slen);
- rb_str_cat_cstr(str, ", ");
- rb_str_append(str, family);
- if (!rb_getnameinfo(&addr.addr, len, hbuf, sizeof(hbuf),
- pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV)) {
- rb_str_cat_cstr(str, ", ");
- rb_str_cat_cstr(str, hbuf);
- rb_str_cat_cstr(str, ", ");
- rb_str_cat_cstr(str, pbuf);
- }
- if (last) rb_str_cat(str, &last, 1);
- }
- return str;
-}
-
-/*
- * call-seq:
* ipsocket.addr([reverse_lookup]) => [address_family, port, hostname, numeric_address]
*
* Returns the local address as an array which contains
@@ -237,7 +193,7 @@ ip_inspect(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 omitted, obeys to +ipsocket.do_not_reverse_lookup+.
+ * Or if it is +nil+ or ommitted, obeys to +ipsocket.do_not_reverse_lookup+.
* See +Socket.getaddrinfo+ also.
*
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
@@ -278,7 +234,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 omitted, obeys to +ipsocket.do_not_reverse_lookup+.
+ * Or if it is +nil+ or ommitted, obeys to +ipsocket.do_not_reverse_lookup+.
* See +Socket.getaddrinfo+ also.
*
* TCPSocket.open("www.ruby-lang.org", 80) {|sock|
@@ -340,8 +296,6 @@ ip_recvfrom(int argc, VALUE *argv, VALUE sock)
*
* Lookups the IP address of _host_.
*
- * require 'socket'
- *
* IPSocket.getaddress("localhost") #=> "127.0.0.1"
* IPSocket.getaddress("ip6-localhost") #=> "::1"
*
@@ -350,7 +304,7 @@ static VALUE
ip_s_getaddress(VALUE obj, VALUE host)
{
union_sockaddr addr;
- struct rb_addrinfo *res = rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, 0);
+ struct rb_addrinfo *res = rsock_addrinfo(host, Qnil, SOCK_STREAM, 0);
socklen_t len = res->ai->ai_addrlen;
/* just take the first one */
@@ -369,7 +323,6 @@ rsock_init_ipsocket(void)
* IPSocket is the super class of TCPSocket and UDPSocket.
*/
rb_cIPSocket = rb_define_class("IPSocket", rb_cBasicSocket);
- rb_define_method(rb_cIPSocket, "inspect", ip_inspect, 0);
rb_define_method(rb_cIPSocket, "addr", ip_addr, -1);
rb_define_method(rb_cIPSocket, "peeraddr", ip_peeraddr, -1);
rb_define_method(rb_cIPSocket, "recvfrom", ip_recvfrom, -1);
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 18f79b3f08..2cd7aeadf9 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -1,7 +1,4 @@
-# frozen_string_literal: true
-
require 'socket.so'
-require 'io/wait'
class Addrinfo
# creates an Addrinfo object from the arguments.
@@ -53,13 +50,17 @@ class Addrinfo
sock.ipv6only! if self.ipv6?
sock.bind local_addrinfo if local_addrinfo
if 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
+ begin
+ sock.connect_nonblock(self)
+ rescue IO::WaitWritable
+ if !IO.select(nil, [sock], nil, timeout)
raise Errno::ETIMEDOUT, 'user specified timeout'
- end while true
+ end
+ begin
+ sock.connect_nonblock(self) # check connection failure
+ rescue Errno::EISCONN
+ end
+ end
else
sock.connect(self)
end
@@ -71,7 +72,7 @@ class Addrinfo
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
@@ -110,8 +111,10 @@ class Addrinfo
# puts s.read
# }
#
- def connect_from(*args, timeout: nil, &block)
- connect_internal(family_addrinfo(*args), timeout, &block)
+ def connect_from(*args, &block)
+ opts = Hash === args.last ? args.pop : {}
+ local_addr_args = args
+ connect_internal(family_addrinfo(*local_addr_args), opts[:timeout], &block)
end
# :call-seq:
@@ -133,8 +136,8 @@ class Addrinfo
# puts s.read
# }
#
- def connect(timeout: nil, &block)
- connect_internal(nil, timeout, &block)
+ def connect(opts={}, &block)
+ connect_internal(nil, opts[:timeout], &block)
end
# :call-seq:
@@ -156,9 +159,11 @@ class Addrinfo
# puts s.read
# }
#
- def connect_to(*args, timeout: nil, &block)
- remote_addrinfo = family_addrinfo(*args)
- remote_addrinfo.send(:connect_internal, self, timeout, &block)
+ def connect_to(*args, &block)
+ opts = Hash === args.last ? args.pop : {}
+ remote_addr_args = args
+ remote_addrinfo = family_addrinfo(*remote_addr_args)
+ remote_addrinfo.send(:connect_internal, self, opts[:timeout], &block)
end
# creates a socket bound to self.
@@ -185,7 +190,7 @@ class Addrinfo
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
@@ -208,7 +213,7 @@ class Addrinfo
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
@@ -270,192 +275,6 @@ 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 a keyword argument _exception_ to +false+, you can 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
- # * +buf+ - destination String buffer
- # * +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 a keyword argument _exception_ to +false+, you can indicate
- # that recv_nonblock should not raise an IO::WaitReadable exception, but
- # return the symbol +:wait_readable+ 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 a keyword argument _exception_ to +false+, you can indicate
- # that recvmsg_nonblock should not raise an IO::WaitReadable exception, but
- # return the symbol +:wait_readable+ instead.
- def recvmsg_nonblock(dlen = nil, flags = 0, clen = nil,
- scm_rights: false, exception: true)
- __recvmsg_nonblock(dlen, flags, clen, scm_rights, exception)
- end
-
- # Linux-specific optimizations to avoid fcntl for IO#read_nonblock
- # and IO#write_nonblock using MSG_DONTWAIT
- # Do other platforms support MSG_DONTWAIT reliably?
- if RUBY_PLATFORM =~ /linux/ && Socket.const_defined?(:MSG_DONTWAIT)
- def read_nonblock(len, str = nil, exception: true) # :nodoc:
- __read_nonblock(len, str, exception)
- end
-
- def write_nonblock(buf, exception: true) # :nodoc:
- __write_nonblock(buf, exception)
- end
- end
end
class Socket < BasicSocket
@@ -466,133 +285,6 @@ 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 a keyword argument _exception_ to +false+, you can indicate
- # that recvfrom_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 a keyword argument _exception_ to +false+, you can 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])
@@ -619,10 +311,15 @@ class Socket < BasicSocket
# puts sock.read
# }
#
- def self.tcp(host, port, local_host = nil, local_port = nil, connect_timeout: nil) # :yield: socket
+ def self.tcp(host, port, *rest) # :yield: socket
+ opts = Hash === rest.last ? rest.pop : {}
+ raise ArgumentError, "wrong number of arguments (#{rest.length} for 2)" if 2 < rest.length
+ local_host, local_port = rest
last_error = nil
ret = nil
+ connect_timeout = opts[:connect_timeout]
+
local_addr_list = nil
if local_host != nil || local_port != nil
local_addr_list = Addrinfo.getaddrinfo(local_host, local_port, nil, :STREAM, nil)
@@ -631,14 +328,14 @@ class Socket < BasicSocket
Addrinfo.foreach(host, port, nil, :STREAM) {|ai|
if local_addr_list
local_addr = local_addr_list.find {|local_ai| local_ai.afamily == ai.afamily }
- next unless local_addr
+ next if !local_addr
else
local_addr = nil
end
begin
sock = local_addr ?
- ai.connect_from(local_addr, timeout: connect_timeout) :
- ai.connect(timeout: connect_timeout)
+ ai.connect_from(local_addr, :timeout => connect_timeout) :
+ ai.connect(:timeout => connect_timeout)
rescue SystemCallError
last_error = $!
next
@@ -646,7 +343,7 @@ class Socket < BasicSocket
ret = sock
break
}
- unless ret
+ if !ret
if last_error
raise last_error
else
@@ -657,7 +354,7 @@ class Socket < BasicSocket
begin
yield ret
ensure
- ret.close
+ ret.close if !ret.closed?
end
else
ret
@@ -681,7 +378,7 @@ class Socket < BasicSocket
if reuseaddr
s.setsockopt(:SOCKET, :REUSEADDR, 1)
end
- unless port
+ if !port
s.bind(ai)
port = s.local_address.ip_port
else
@@ -689,10 +386,10 @@ class Socket < BasicSocket
end
}
rescue Errno::EADDRINUSE
- sockets.each(&:close)
+ sockets.each {|s| s.close }
retry
rescue Exception
- sockets.each(&:close)
+ sockets.each {|s| s.close }
raise
end
sockets
@@ -709,7 +406,7 @@ class Socket < BasicSocket
s.listen(Socket::SOMAXCONN)
}
rescue Exception
- sockets.each(&:close)
+ sockets.each {|s| s.close }
raise
end
sockets
@@ -772,7 +469,7 @@ class Socket < BasicSocket
raise last_error
end
rescue Exception
- sockets.each(&:close)
+ sockets.each {|s| s.close }
raise
end
end
@@ -780,7 +477,7 @@ class Socket < BasicSocket
begin
yield sockets
ensure
- sockets.each(&:close)
+ sockets.each {|s| s.close if !s.closed? }
end
else
sockets
@@ -804,8 +501,11 @@ class Socket < BasicSocket
loop {
readable, _, _ = IO.select(sockets)
readable.each {|r|
- sock, addr = r.accept_nonblock(exception: false)
- next if sock == :wait_readable
+ begin
+ sock, addr = r.accept_nonblock
+ rescue IO::WaitReadable
+ next
+ end
yield sock, addr
}
}
@@ -899,19 +599,18 @@ class Socket < BasicSocket
Addrinfo.foreach(host, port, nil, :DGRAM, nil, Socket::AI_PASSIVE) {|ai|
if ai.ipv4? && ai.ip_address == "0.0.0.0"
local_addrs.each {|a|
- next unless a.ipv4?
+ next if !a.ipv4?
ip_list << Addrinfo.new(a.to_sockaddr, :INET, :DGRAM, 0);
}
elsif ai.ipv6? && ai.ip_address == "::" && !ipv6_recvpktinfo
local_addrs.each {|a|
- next unless a.ipv6?
+ next if !a.ipv6?
ip_list << Addrinfo.new(a.to_sockaddr, :INET6, :DGRAM, 0);
}
else
ip_list << ai
end
}
- ip_list.uniq!(&:to_sockaddr)
if port == 0
sockets = ip_sockets_port0(ip_list, false)
@@ -942,7 +641,7 @@ class Socket < BasicSocket
begin
yield sockets
ensure
- sockets.each(&:close) if sockets
+ sockets.each {|s| s.close if !s.closed? } if sockets
end
else
sockets
@@ -970,8 +669,11 @@ class Socket < BasicSocket
#
def self.udp_server_recv(sockets)
sockets.each {|r|
- msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock(exception: false)
- next if msg == :wait_readable
+ begin
+ msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock
+ rescue IO::WaitReadable
+ next
+ end
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)
@@ -1048,7 +750,7 @@ class Socket < BasicSocket
attr_reader :local_address
def inspect # :nodoc:
- "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>".dup
+ "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
end
# Sends the String +msg+ to the source
@@ -1079,7 +781,7 @@ class Socket < BasicSocket
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
@@ -1103,12 +805,12 @@ class Socket < BasicSocket
# }
#
def self.unix_server_socket(path)
- unless unix_socket_abstract_name?(path)
+ if !unix_socket_abstract_name?(path)
begin
st = File.lstat(path)
rescue Errno::ENOENT
end
- if st&.socket? && st.owned?
+ if st && st.socket? && st.owned?
File.unlink path
end
end
@@ -1117,8 +819,8 @@ class Socket < BasicSocket
begin
yield s
ensure
- s.close
- unless unix_socket_abstract_name?(path)
+ s.close if !s.closed?
+ if !unix_socket_abstract_name?(path)
File.unlink path
end
end
@@ -1165,192 +867,5 @@ 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 a keyword argument _exception_ to +false+, you can 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.
- # _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 a keyword argument _exception_ to +false+, you can indicate
- # that recvfrom_nonblock should not raise an IO::WaitReadable exception, but
- # return the symbol +:wait_readable+ 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 a keyword argument _exception_ to +false+, you can 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 a keyword argument _exception_ to +false+, you can 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 0ebf628b46..59fcb17682 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'optparse'
require 'erb'
diff --git a/ext/socket/option.c b/ext/socket/option.c
index bf3af171a2..a4a2a37c0f 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -27,12 +27,6 @@ VALUE rb_cSockOpt;
# 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)
{
@@ -217,9 +211,12 @@ sockopt_s_byte(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE v
static VALUE
sockopt_byte(VALUE self)
{
+ unsigned char i;
VALUE data = sockopt_data(self);
StringValue(data);
- check_size(RSTRING_LEN(data), sizeof(char));
+ 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));
return CHR2FIX(*RSTRING_PTR(data));
}
@@ -260,7 +257,9 @@ sockopt_int(VALUE self)
int i;
VALUE data = sockopt_data(self);
StringValue(data);
- check_size(RSTRING_LEN(data), sizeof(int));
+ 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));
return INT2NUM(i);
}
@@ -272,8 +271,6 @@ sockopt_int(VALUE self)
* Creates a new Socket::Option object which contains boolean as data.
* Actually 0 or 1 as int is used.
*
- * require 'socket'
- *
* p Socket::Option.bool(:INET, :SOCKET, :KEEPALIVE, true)
* #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>
*
@@ -304,15 +301,12 @@ static VALUE
sockopt_bool(VALUE self)
{
int i;
- long len;
VALUE data = sockopt_data(self);
StringValue(data);
- 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);
+ 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));
return i == 0 ? Qfalse : Qtrue;
}
@@ -364,7 +358,9 @@ sockopt_linger(VALUE self)
if (level != SOL_SOCKET || optname != SO_LINGER)
rb_raise(rb_eTypeError, "linger socket option expected");
- check_size(RSTRING_LEN(data), sizeof(struct linger));
+ 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));
memcpy((char*)&l, RSTRING_PTR(data), sizeof(struct linger));
switch (l.l_onoff) {
case 0: vonoff = Qfalse; break;
@@ -406,7 +402,7 @@ sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
* call-seq:
* sockopt.ipv4_multicast_loop => integer
*
- * Returns the ipv4_multicast_loop data in _sockopt_ as an integer.
+ * Returns the ipv4_multicast_loop data in _sockopt_ as a integer.
*
* sockopt = Socket::Option.ipv4_multicast_loop(10)
* p sockopt.ipv4_multicast_loop => 10
@@ -457,7 +453,7 @@ sockopt_s_ipv4_multicast_ttl(VALUE klass, VALUE value)
* call-seq:
* sockopt.ipv4_multicast_ttl => integer
*
- * Returns the ipv4_multicast_ttl data in _sockopt_ as an integer.
+ * Returns the ipv4_multicast_ttl data in _sockopt_ as a integer.
*
* sockopt = Socket::Option.ipv4_multicast_ttl(10)
* p sockopt.ipv4_multicast_ttl => 10
@@ -646,8 +642,8 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
* it is not distinguishable by the size.
*/
-#if !defined HAVE_INET_NTOP && ! defined _WIN32
-const char *
+#ifndef HAVE_INET_NTOP
+static const char *
inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
#ifdef HAVE_INET_NTOA
@@ -662,6 +658,8 @@ inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
#endif
return numaddr;
}
+#elif defined __MINGW64__
+# define inet_ntop(f,a,n,l) rb_w32_inet_ntop(f,a,n,l)
#endif
/* Although the buffer size needed depends on the prefixes, "%u" may generate "4294967295". */
@@ -883,14 +881,14 @@ inspect_ipv6_mreq(int level, int optname, VALUE data, VALUE ret)
#endif
static void
-inspect_tcpi_options(VALUE ret, uint8_t options)
+inspect_tcpi_options(VALUE ret, u_int8_t options)
{
int sep = '=';
rb_str_cat2(ret, " options");
#define INSPECT_TCPI_OPTION(optval, name) \
if (options & (optval)) { \
- options &= ~(uint8_t)(optval); \
+ options &= ~(u_int8_t)(optval); \
rb_str_catf(ret, "%c%s", sep, name); \
sep = ','; \
}
@@ -923,19 +921,14 @@ inspect_tcpi_options(VALUE ret, uint8_t options)
}
static void
-inspect_tcpi_usec(VALUE ret, const char *prefix, uint32_t t)
+inspect_tcpi_usec(VALUE ret, const char *prefix, u_int32_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)
+#ifdef __linux__
static void
-inspect_tcpi_msec(VALUE ret, const char *prefix, uint32_t t)
+inspect_tcpi_msec(VALUE ret, const char *prefix, u_int32_t t)
{
rb_str_catf(ret, "%s%u.%03us", prefix, t / 1000, t % 1000);
}
@@ -1249,7 +1242,7 @@ sockopt_inspect(VALUE self)
v = optname_to_sym(level, optname);
if (SYMBOL_P(v))
- rb_str_catf(ret, " %"PRIsVALUE, rb_sym2str(v));
+ rb_str_catf(ret, " %s", rb_id2name(SYM2ID(v)));
else
rb_str_catf(ret, " optname:%d", optname);
}
@@ -1475,3 +1468,4 @@ rsock_init_sockopt(void)
rb_define_method(rb_cSockOpt, "to_s", sockopt_data, 0); /* compatibility for ruby before 1.9.2 */
}
+
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index dcabb2022e..ceed9c3ac1 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -154,34 +154,6 @@ 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)
{
@@ -209,9 +181,7 @@ numeric_getaddrinfo(const char *node, const char *service,
# define inet_pton(f,s,d) rb_w32_inet_pton(f,s,d)
# endif
- int port;
-
- if (node && parse_numeric_port(service, &port)) {
+ if (node && (!service || strspn(service, "0123456789") == strlen(service))) {
static const struct {
int socktype;
int protocol;
@@ -221,6 +191,7 @@ numeric_getaddrinfo(const char *node, const char *service,
{ SOCK_RAW, 0 }
};
struct addrinfo *ai = NULL;
+ int port = service ? (unsigned short)atoi(service): 0;
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;
@@ -341,11 +312,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 *
@@ -426,14 +397,6 @@ str_is_number(const char *p)
return 0;
}
-#define str_equal(ptr, len, name) \
- ((ptr)[0] == name[0] && \
- rb_strlen_lit(name) == (len) && memcmp(ptr, name, len) == 0)
-#define SafeStringValueCStr(v) do {\
- StringValueCStr(v);\
- rb_check_safe_obj(v);\
-} while(0)
-
static char*
host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
{
@@ -448,26 +411,24 @@ host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
return hbuf;
}
else {
- const char *name;
- size_t len;
+ char *name;
- SafeStringValueCStr(host);
- RSTRING_GETMEM(host, name, len);
- if (!len || str_equal(name, len, "<any>")) {
+ SafeStringValue(host);
+ name = RSTRING_PTR(host);
+ if (!name || *name == 0 || (name[0] == '<' && strcmp(name, "<any>") == 0)) {
make_inetaddr(INADDR_ANY, hbuf, hbuflen);
if (flags_ptr) *flags_ptr |= AI_NUMERICHOST;
}
- else if (str_equal(name, len, "<broadcast>")) {
+ else if (name[0] == '<' && strcmp(name, "<broadcast>") == 0) {
make_inetaddr(INADDR_BROADCAST, hbuf, hbuflen);
if (flags_ptr) *flags_ptr |= AI_NUMERICHOST;
}
- else if (len >= hbuflen) {
+ else if (strlen(name) >= hbuflen) {
rb_raise(rb_eArgError, "hostname too long (%"PRIuSIZE")",
- len);
+ strlen(name));
}
else {
- memcpy(hbuf, name, len);
- hbuf[len] = '\0';
+ strcpy(hbuf, name);
}
return hbuf;
}
@@ -487,17 +448,15 @@ port_str(VALUE port, char *pbuf, size_t pbuflen, int *flags_ptr)
return pbuf;
}
else {
- const char *serv;
- size_t len;
+ char *serv;
- SafeStringValueCStr(port);
- RSTRING_GETMEM(port, serv, len);
- if (len >= pbuflen) {
+ SafeStringValue(port);
+ serv = RSTRING_PTR(port);
+ if (strlen(serv) >= pbuflen) {
rb_raise(rb_eArgError, "service name too long (%"PRIuSIZE")",
- len);
+ strlen(serv));
}
- memcpy(pbuf, serv, len);
- pbuf[len] = '\0';
+ strcpy(pbuf, serv);
return pbuf;
}
}
@@ -530,26 +489,13 @@ rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_h
return res;
}
-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)
+rsock_addrinfo(VALUE host, VALUE port, int socktype, int flags)
{
struct addrinfo hints;
MEMZERO(&hints, struct addrinfo, 1);
- hints.ai_family = family;
+ hints.ai_family = AF_UNSPEC;
hints.ai_socktype = socktype;
hints.ai_flags = flags;
return rsock_getaddrinfo(host, port, &hints, 1);
@@ -671,8 +617,7 @@ make_hostent_internal(struct hostent_arg *arg)
}
rb_ary_push(ary, rb_str_new2(hostp));
- if (addr->ai_canonname && strlen(addr->ai_canonname) < NI_MAXHOST &&
- (h = gethostbyname(addr->ai_canonname))) {
+ if (addr->ai_canonname && (h = gethostbyname(addr->ai_canonname))) {
names = rb_ary_new();
if (h->h_aliases != NULL) {
for (pch = h->h_aliases; *pch; pch++) {
@@ -726,8 +671,10 @@ static void
addrinfo_mark(void *ptr)
{
rb_addrinfo_t *rai = ptr;
- rb_gc_mark(rai->inspectname);
- rb_gc_mark(rai->canonname);
+ if (rai) {
+ rb_gc_mark(rai->inspectname);
+ rb_gc_mark(rai->canonname);
+ }
}
#define addrinfo_free RUBY_TYPED_DEFAULT_FREE
@@ -735,7 +682,7 @@ addrinfo_mark(void *ptr)
static size_t
addrinfo_memsize(const void *ptr)
{
- return sizeof(rb_addrinfo_t);
+ return ptr ? sizeof(rb_addrinfo_t) : 0;
}
static const rb_data_type_t addrinfo_type = {
@@ -769,7 +716,7 @@ get_addrinfo(VALUE self)
static rb_addrinfo_t *
-alloc_addrinfo(void)
+alloc_addrinfo()
{
rb_addrinfo_t *rai = ZALLOC(rb_addrinfo_t);
rai->inspectname = Qnil;
@@ -1262,7 +1209,7 @@ rsock_inspect_sockaddr(struct sockaddr *sockaddr_arg, socklen_t socklen, VALUE r
}
#endif
-#if defined(AF_PACKET) && defined(__linux__)
+#ifdef AF_PACKET
/* GNU/Linux */
case AF_PACKET:
{
@@ -1695,7 +1642,6 @@ addrinfo_mload(VALUE self, VALUE ary)
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 922df9b87b..8beffd2e76 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -27,7 +27,11 @@
# undef HAVE_TYPE_STRUCT_SOCKADDR_DL
# endif
#else
-# include <sys/socket.h>
+# if defined(__BEOS__) && !defined(__HAIKU__) && !defined(BONE)
+# include <net/socket.h>
+# else
+# include <sys/socket.h>
+# endif
# include <netinet/in.h>
# ifdef HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
@@ -76,9 +80,6 @@
#endif
#ifdef HAVE_IFADDRS_H
-# ifdef __HAIKU__
-# define _BSD_SOURCE
-# endif
# include <ifaddrs.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
@@ -218,6 +219,11 @@ typedef union {
# endif
#endif
+#ifdef __BEOS__
+# undef close
+# define close closesocket
+#endif
+
#define INET_CLIENT 0
#define INET_SERVER 1
#define INET_SOCKS 2
@@ -226,12 +232,6 @@ 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;
@@ -279,7 +279,7 @@ 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(rb_io_t *fptr);
+int rsock_getfamily(int sockfd);
struct rb_addrinfo {
struct addrinfo *ai;
@@ -289,8 +289,7 @@ int rb_getaddrinfo(const char *node, const char *service, const struct addrinfo
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);
-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_addrinfo(VALUE host, VALUE port, 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);
@@ -338,34 +337,28 @@ enum sock_recv_type {
RECV_SOCKET /* Socket#recvfrom */
};
-VALUE rsock_s_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str,
- VALUE ex, enum sock_recv_type from);
+VALUE rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, 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, VALUE ex, rb_io_t *fptr,
- 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_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(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);
+VALUE rsock_bsock_sendmsg(int argc, VALUE *argv, VALUE sock);
+VALUE rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock);
#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(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);
+VALUE rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock);
+VALUE rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock);
ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags);
#else
#define rsock_bsock_recvmsg rb_f_notimplement
@@ -414,31 +407,9 @@ NORETURN(void rsock_sys_fail_raddrinfo_or_sockaddr(const char *, VALUE addr, VAL
#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
-
-VALUE rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex);
-VALUE rsock_write_nonblock(VALUE sock, VALUE buf, VALUE ex);
-
-#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 8846770097..f27383d61c 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -10,8 +10,6 @@
#include "rubysocket.h"
-static VALUE sym_wait_writable;
-
static VALUE sock_s_unpack_sockaddr_in(VALUE, VALUE);
void
@@ -140,6 +138,7 @@ 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)");
@@ -151,7 +150,7 @@ sock_initialize(int argc, VALUE *argv, VALUE sock)
static VALUE
io_call_close(VALUE io)
{
- return rb_funcallv(io, rb_intern("close"), 0, 0);
+ return rb_funcall(io, rb_intern("close"), 0, 0);
}
static VALUE
@@ -241,7 +240,8 @@ rsock_socketpair(int domain, int type, int protocol, int sv[2])
int ret;
ret = rsock_socketpair0(domain, type, protocol, sv);
- if (ret < 0 && rb_gc_for_fd(errno)) {
+ if (ret < 0 && (errno == EMFILE || errno == ENFILE)) {
+ rb_gc();
ret = rsock_socketpair0(domain, type, protocol, sv);
}
@@ -319,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
@@ -438,9 +438,50 @@ sock_connect(VALUE sock, VALUE addr)
return INT2FIX(n);
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-sock_connect_nonblock(VALUE sock, VALUE addr, VALUE ex)
+sock_connect_nonblock(VALUE sock, VALUE addr)
{
VALUE rai;
rb_io_t *fptr;
@@ -452,19 +493,9 @@ sock_connect_nonblock(VALUE sock, VALUE addr, VALUE ex)
rb_io_set_nonblock(fptr);
n = connect(fptr->fd, (struct sockaddr*)RSTRING_PTR(addr), RSTRING_SOCKLEN(addr));
if (n < 0) {
- 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);
+ 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);
}
return INT2FIX(n);
@@ -480,18 +511,18 @@ sock_connect_nonblock(VALUE sock, VALUE addr, VALUE ex)
* * +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
@@ -582,18 +613,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
@@ -669,27 +700,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
@@ -765,11 +796,72 @@ sock_recvfrom(int argc, VALUE *argv, VALUE sock)
return rsock_s_recvfrom(sock, argc, argv, RECV_SOCKET);
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-sock_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
+sock_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_SOCKET);
+ return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_SOCKET);
}
/*
@@ -800,21 +892,67 @@ sock_accept(VALUE sock)
return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, &buf.addr, len));
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-sock_accept_nonblock(VALUE sock, VALUE ex)
+sock_accept_nonblock(VALUE sock)
{
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, ex, fptr, addr, &len);
-
- if (SYMBOL_P(sock2)) /* :wait_readable */
- return sock2;
+ sock2 = rsock_s_accept_nonblock(rb_cSocket, fptr, &buf.addr, &len);
return rb_assoc_new(sock2, rsock_io_socket_addrinfo(sock2, &buf.addr, len));
}
@@ -827,28 +965,28 @@ sock_accept_nonblock(VALUE sock, VALUE ex)
* 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.
@@ -893,27 +1031,14 @@ sock_gethostname(VALUE obj)
# define RUBY_MAX_HOST_NAME_LEN 1024
#endif
- 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;
+ char buf[RUBY_MAX_HOST_NAME_LEN+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);
}
#else
#ifdef HAVE_UNAME
@@ -925,6 +1050,7 @@ sock_gethostname(VALUE obj)
{
struct utsname un;
+ rb_secure(3);
uname(&un);
return rb_str_new2(un.nodename);
}
@@ -946,7 +1072,7 @@ make_addrinfo(struct rb_addrinfo *res0, int norevlookup)
for (res = res0->ai; res; res = res->ai_next) {
ary = rsock_ipaddr(res->ai_addr, res->ai_addrlen, norevlookup);
if (res->ai_canonname) {
- RARRAY_ASET(ary, 2, rb_str_new2(res->ai_canonname));
+ RARRAY_PTR(ary)[2] = rb_str_new2(res->ai_canonname);
}
rb_ary_push(ary, INT2FIX(res->ai_family));
rb_ary_push(ary, INT2FIX(res->ai_socktype));
@@ -983,18 +1109,7 @@ sock_sockaddr(struct sockaddr *addr, socklen_t len)
* call-seq:
* Socket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
*
- * Use Addrinfo.getaddrinfo instead.
- * This method is deprecated for the following reasons:
- *
- * - The 3rd element of the result is the address family of the first address.
- * The address families of the rest of the addresses are not returned.
- * - Uncommon address representation:
- * 4/16-bytes binary string to represent IPv4/IPv6 address.
- * - gethostbyname() may take a long time and it may block other threads.
- * (GVL cannot be released since gethostbyname() is not thread safe.)
- * - This method uses gethostbyname() function already removed from POSIX.
- *
- * This method obtains the host information for _hostname_.
+ * Obtains the host information for _hostname_.
*
* p Socket.gethostbyname("hal") #=> ["localhost", ["hal"], 2, "\x7F\x00\x00\x01"]
*
@@ -1002,35 +1117,18 @@ sock_sockaddr(struct sockaddr *addr, socklen_t len)
static VALUE
sock_s_gethostbyname(VALUE obj, VALUE host)
{
- struct rb_addrinfo *res =
- rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
- return rsock_make_hostent(host, res, sock_sockaddr);
+ rb_secure(3);
+ return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME), sock_sockaddr);
}
/*
* call-seq:
* Socket.gethostbyaddr(address_string [, address_family]) => hostent
*
- * Use Addrinfo#getnameinfo instead.
- * This method is deprecated for the following reasons:
- *
- * - Uncommon address representation:
- * 4/16-bytes binary string to represent IPv4/IPv6 address.
- * - gethostbyaddr() may take a long time and it may block other threads.
- * (GVL cannot be released since gethostbyname() is not thread safe.)
- * - This method uses gethostbyname() function already removed from POSIX.
- *
- * This method obtains the host information for _address_.
+ * Obtains the host information for _address_.
*
* p Socket.gethostbyaddr([221,186,184,68].pack("CCCC"))
* #=> ["carbon.ruby-lang.org", [], 2, "\xDD\xBA\xB8D"]
- *
- * p Socket.gethostbyaddr([127,0,0,1].pack("CCCC"))
- * ["localhost", [], 2, "\x7F\x00\x00\x01"]
- * p Socket.gethostbyaddr(([0]*15+[1]).pack("C"*16))
- * #=> ["localhost", ["ip6-localhost", "ip6-loopback"], 10,
- * "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"]
- *
*/
static VALUE
sock_s_gethostbyaddr(int argc, VALUE *argv)
@@ -1164,10 +1262,7 @@ sock_s_getservbyport(int argc, VALUE *argv)
*
* Obtains address information for _nodename_:_servname_.
*
- * Note that Addrinfo.getaddrinfo provides the same functionality in
- * an object oriented style.
- *
- * _family_ should be an address family such as: :INET, :INET6, etc.
+ * _family_ should be an address family such as: :INET, :INET6, :UNIX, etc.
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
@@ -1287,16 +1382,16 @@ sock_s_getnameinfo(int argc, VALUE *argv)
sa = tmp;
MEMZERO(&hints, struct addrinfo, 1);
if (RARRAY_LEN(sa) == 3) {
- af = RARRAY_AREF(sa, 0);
- port = RARRAY_AREF(sa, 1);
- host = RARRAY_AREF(sa, 2);
+ af = RARRAY_PTR(sa)[0];
+ port = RARRAY_PTR(sa)[1];
+ host = RARRAY_PTR(sa)[2];
}
else if (RARRAY_LEN(sa) >= 4) {
- af = RARRAY_AREF(sa, 0);
- port = RARRAY_AREF(sa, 1);
- host = RARRAY_AREF(sa, 3);
+ af = RARRAY_PTR(sa)[0];
+ port = RARRAY_PTR(sa)[1];
+ host = RARRAY_PTR(sa)[3];
if (NIL_P(host)) {
- host = RARRAY_AREF(sa, 2);
+ host = RARRAY_PTR(sa)[2];
}
else {
/*
@@ -1317,7 +1412,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
hptr = NULL;
}
else {
- strncpy(hbuf, StringValueCStr(host), sizeof(hbuf));
+ strncpy(hbuf, StringValuePtr(host), sizeof(hbuf));
hbuf[sizeof(hbuf) - 1] = '\0';
hptr = hbuf;
}
@@ -1331,7 +1426,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
pptr = pbuf;
}
else {
- strncpy(pbuf, StringValueCStr(port), sizeof(pbuf));
+ strncpy(pbuf, StringValuePtr(port), sizeof(pbuf));
pbuf[sizeof(pbuf) - 1] = '\0';
pptr = pbuf;
}
@@ -1401,7 +1496,7 @@ sock_s_getnameinfo(int argc, VALUE *argv)
static VALUE
sock_s_pack_sockaddr_in(VALUE self, VALUE port, VALUE host)
{
- struct rb_addrinfo *res = rsock_addrinfo(host, port, AF_UNSPEC, 0, 0);
+ struct rb_addrinfo *res = rsock_addrinfo(host, port, 0, 0);
VALUE addr = rb_str_new((char*)res->ai->ai_addr, res->ai->ai_addrlen);
rb_freeaddrinfo(res);
@@ -1672,7 +1767,7 @@ socket_s_ip_address_list(VALUE self)
int ret;
struct lifnum ln;
struct lifconf lc;
- const char *reason = NULL;
+ char *reason = NULL;
int save_errno;
int i;
VALUE list = Qnil;
@@ -1733,7 +1828,7 @@ socket_s_ip_address_list(VALUE self)
errno = save_errno;
if (reason)
- rb_syserr_fail(save_errno, reason);
+ rb_sys_fail(reason);
return list;
#elif defined(SIOCGIFCONF)
@@ -1818,7 +1913,7 @@ socket_s_ip_address_list(VALUE self)
errno = save_errno;
if (reason)
- rb_syserr_fail(save_errno, reason);
+ rb_sys_fail(reason);
return list;
#undef EXTRA_SPACE
@@ -1930,7 +2025,7 @@ socket_s_ip_address_list(VALUE self)
#endif
void
-Init_socket(void)
+Init_socket()
{
rsock_init_basicsocket();
@@ -1985,8 +2080,6 @@ Init_socket(void)
*
* Let's create an internet socket using the IPv4 protocol in a C-like manner:
*
- * require 'socket'
- *
* s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
* s.connect Socket.pack_sockaddr_in(80, 'example.com')
*
@@ -2057,26 +2150,15 @@ Init_socket(void)
rb_define_method(rb_cSocket, "initialize", sock_initialize, -1);
rb_define_method(rb_cSocket, "connect", sock_connect, 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, "connect_nonblock", sock_connect_nonblock, 1);
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);
-
- /* 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, "accept_nonblock", sock_accept_nonblock, 0);
rb_define_method(rb_cSocket, "sysaccept", sock_sysaccept, 0);
rb_define_method(rb_cSocket, "recvfrom", sock_recvfrom, -1);
-
- /* for ext/socket/lib/socket.rb use only: */
- rb_define_private_method(rb_cSocket,
- "__recvfrom_nonblock", sock_recvfrom_nonblock, 4);
+ rb_define_method(rb_cSocket, "recvfrom_nonblock", sock_recvfrom_nonblock, -1);
rb_define_singleton_method(rb_cSocket, "socketpair", rsock_sock_s_socketpair, -1);
rb_define_singleton_method(rb_cSocket, "pair", rsock_sock_s_socketpair, -1);
@@ -2097,7 +2179,4 @@ Init_socket(void)
#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/sockssocket.c b/ext/socket/sockssocket.c
index 81f77a67c5..48be4fcf99 100644
--- a/ext/socket/sockssocket.c
+++ b/ext/socket/sockssocket.c
@@ -41,6 +41,9 @@ 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 1bbb31adcf..2245a0600d 100644
--- a/ext/socket/tcpserver.c
+++ b/ext/socket/tcpserver.c
@@ -64,16 +64,49 @@ tcp_accept(VALUE sock)
return rsock_s_accept(rb_cTCPSocket, fptr->fd, &from.addr, &fromlen);
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-tcp_accept_nonblock(VALUE sock, VALUE ex)
+tcp_accept_nonblock(VALUE sock)
{
rb_io_t *fptr;
union_sockaddr from;
- socklen_t len = (socklen_t)sizeof(from);
+ socklen_t fromlen;
GetOpenFile(sock, fptr);
- return rsock_s_accept_nonblock(rb_cTCPSocket, ex, fptr, &from.addr, &len);
+ fromlen = (socklen_t)sizeof(from);
+ return rsock_s_accept_nonblock(rb_cTCPSocket, fptr, &from.addr, &fromlen);
}
/*
@@ -138,8 +171,7 @@ rsock_init_tcpserver(void)
*/
rb_cTCPServer = rb_define_class("TCPServer", rb_cTCPSocket);
rb_define_method(rb_cTCPServer, "accept", tcp_accept, 0);
- rb_define_private_method(rb_cTCPServer,
- "__accept_nonblock", tcp_accept_nonblock, 1);
+ rb_define_method(rb_cTCPServer, "accept_nonblock", tcp_accept_nonblock, 0);
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 29a3eda45f..6217e424d9 100644
--- a/ext/socket/tcpsocket.c
+++ b/ext/socket/tcpsocket.c
@@ -41,16 +41,7 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
* call-seq:
* TCPSocket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
*
- * Use Addrinfo.getaddrinfo instead.
- * This method is deprecated for the following reasons:
- *
- * - The 3rd element of the result is the address family of the first address.
- * The address families of the rest of the addresses are not returned.
- * - gethostbyname() may take a long time and it may block other threads.
- * (GVL cannot be released since gethostbyname() is not thread safe.)
- * - This method uses gethostbyname() function already removed from POSIX.
- *
- * This method lookups host information by _hostname_.
+ * Lookups host information by _hostname_.
*
* TCPSocket.gethostbyname("localhost")
* #=> ["localhost", ["hal"], 2, "127.0.0.1"]
@@ -59,9 +50,9 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
static VALUE
tcp_s_gethostbyname(VALUE obj, VALUE host)
{
- struct rb_addrinfo *res =
- rsock_addrinfo(host, Qnil, AF_UNSPEC, SOCK_STREAM, AI_CANONNAME);
- return rsock_make_hostent(host, res, tcp_sockaddr);
+ rb_secure(3);
+ return rsock_make_hostent(host, rsock_addrinfo(host, Qnil, SOCK_STREAM, AI_CANONNAME),
+ tcp_sockaddr);
}
void
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index c2e273c2a3..eb605cafc1 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -19,8 +19,6 @@
* _address_family_ should be an integer, a string or a symbol:
* Socket::AF_INET, "AF_INET", :INET, etc.
*
- * require 'socket'
- *
* UDPSocket.new #=> #<UDPSocket:fd 3>
* UDPSocket.new(Socket::AF_INET6) #=> #<UDPSocket:fd 4>
*
@@ -32,6 +30,7 @@ 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);
}
@@ -46,18 +45,15 @@ udp_init(int argc, VALUE *argv, VALUE sock)
struct udp_arg
{
struct rb_addrinfo *res;
- rb_io_t *fptr;
+ int fd;
};
static VALUE
udp_connect_internal(struct udp_arg *arg)
{
- rb_io_t *fptr;
- int fd;
+ int fd = arg->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 (rsock_connect(fd, res->ai_addr, res->ai_addrlen, 0) >= 0) {
return Qtrue;
@@ -85,35 +81,20 @@ udp_connect_internal(struct udp_arg *arg)
static VALUE
udp_connect(VALUE sock, VALUE host, VALUE port)
{
+ rb_io_t *fptr;
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);
+ rb_secure(3);
+ arg.res = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
+ GetOpenFile(sock, fptr);
+ arg.fd = fptr->fd;
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
@@ -129,46 +110,25 @@ udp_bind_internal(struct udp_arg *arg)
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 rsock_send_arg sarg;
-};
-
-static VALUE
-udp_send_internal(struct udp_send_arg *arg)
-{
rb_io_t *fptr;
- int n;
+ struct rb_addrinfo *res0;
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;
+ rb_secure(3);
+ res0 = rsock_addrinfo(host, port, SOCK_DGRAM, 0);
+ GetOpenFile(sock, fptr);
+ for (res = res0->ai; res; res = res->ai_next) {
+ if (bind(fptr->fd, res->ai_addr, res->ai_addrlen) < 0) {
+ continue;
}
+ rb_freeaddrinfo(res0);
+ return INT2FIX(0);
}
- return Qfalse;
+ rb_freeaddrinfo(res0);
+
+ rsock_sys_fail_host_port("bind(2)", host, port);
+
+ return INT2FIX(0);
}
/*
@@ -197,30 +157,94 @@ static VALUE
udp_send(int argc, VALUE *argv, VALUE sock)
{
VALUE flags, host, port;
- struct udp_send_arg arg;
- VALUE ret;
+ rb_io_t *fptr;
+ int n;
+ struct rb_addrinfo *res0;
+ struct addrinfo *res;
+ struct rsock_send_arg arg;
if (argc == 2 || argc == 3) {
return rsock_bsock_send(argc, argv, sock);
}
- 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;
+ 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->ai; res; res = res->ai_next) {
+ retry:
+ arg.to = res->ai_addr;
+ arg.tolen = res->ai_addrlen;
+ rsock_maybe_fd_writable(arg.fd);
+ n = (int)BLOCKING_REGION_FD(rsock_sendto_blocking, &arg);
+ if (n >= 0) {
+ rb_freeaddrinfo(res0);
+ return INT2FIX(n);
+ }
+ if (rb_io_wait_writable(fptr->fd)) {
+ goto retry;
+ }
+ }
+ rb_freeaddrinfo(res0);
+ rsock_sys_fail_host_port("sendto(2)", host, port);
+ return INT2FIX(n);
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-udp_recvfrom_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
+udp_recvfrom_nonblock(int argc, VALUE *argv, VALUE sock)
{
- return rsock_s_recvfrom_nonblock(sock, len, flg, str, ex, RECV_IP);
+ return rsock_s_recvfrom_nonblock(sock, argc, argv, RECV_IP);
}
void
@@ -237,8 +261,6 @@ 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);
-
- /* for ext/socket/lib/socket.rb use only: */
- rb_define_private_method(rb_cUDPSocket,
- "__recvfrom_nonblock", udp_recvfrom_nonblock, 4);
+ rb_define_method(rb_cUDPSocket, "recvfrom_nonblock", udp_recvfrom_nonblock, -1);
}
+
diff --git a/ext/socket/unixserver.c b/ext/socket/unixserver.c
index b1f2a38547..df9849703b 100644
--- a/ext/socket/unixserver.c
+++ b/ext/socket/unixserver.c
@@ -17,8 +17,6 @@
*
* Creates a new UNIX server socket bound to _path_.
*
- * require 'socket'
- *
* serv = UNIXServer.new("/tmp/sock")
* s = serv.accept
* p s.read
@@ -59,9 +57,41 @@ unix_accept(VALUE sock)
(struct sockaddr*)&from, &fromlen);
}
-/* :nodoc: */
+/*
+ * 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
+ */
static VALUE
-unix_accept_nonblock(VALUE sock, VALUE ex)
+unix_accept_nonblock(VALUE sock)
{
rb_io_t *fptr;
struct sockaddr_un from;
@@ -69,7 +99,7 @@ unix_accept_nonblock(VALUE sock, VALUE ex)
GetOpenFile(sock, fptr);
fromlen = (socklen_t)sizeof(from);
- return rsock_s_accept_nonblock(rb_cUNIXSocket, ex, fptr,
+ return rsock_s_accept_nonblock(rb_cUNIXSocket, fptr,
(struct sockaddr *)&from, &fromlen);
}
@@ -118,10 +148,7 @@ 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_private_method(rb_cUNIXServer,
- "__accept_nonblock", unix_accept_nonblock, 1);
-
+ rb_define_method(rb_cUNIXServer, "accept_nonblock", unix_accept_nonblock, 0);
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 75f17d6c10..0a1b65a5b9 100644
--- a/ext/socket/unixsocket.c
+++ b/ext/socket/unixsocket.c
@@ -25,28 +25,6 @@ unixsock_connect_internal(VALUE a)
arg->sockaddrlen, 0);
}
-static VALUE
-unixsock_path_value(VALUE path)
-{
-#ifdef __linux__
-#define TO_STR_FOR_LINUX_ABSTRACT_NAMESPACE 0
-
- VALUE name = path;
-#if TO_STR_FOR_LINUX_ABSTRACT_NAMESPACE
- const int isstr = !NIL_P(name = rb_check_string_type(name));
-#else
- const int isstr = RB_TYPE_P(name, T_STRING);
-#endif
- if (isstr) {
- if (RSTRING_LEN(name) == 0 || RSTRING_PTR(name)[0] == '\0') {
- rb_check_safe_obj(name);
- return name; /* ignore encoding */
- }
- }
-#endif
- return rb_get_path(path);
-}
-
VALUE
rsock_init_unixsock(VALUE sock, VALUE path, int server)
{
@@ -55,7 +33,7 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
int fd, status;
rb_io_t *fptr;
- path = unixsock_path_value(path);
+ SafeStringValue(path);
INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un));
if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
@@ -87,16 +65,14 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
}
if (status < 0) {
- int e = errno;
close(fd);
- rsock_syserr_fail_path(e, "connect(2)", path);
+ rsock_sys_fail_path("connect(2)", path);
}
if (server) {
if (listen(fd, SOMAXCONN) < 0) {
- int e = errno;
close(fd);
- rsock_syserr_fail_path(e, "listen(2)", path);
+ rsock_sys_fail_path("listen(2)", path);
}
}
@@ -115,8 +91,6 @@ rsock_init_unixsock(VALUE sock, VALUE path, int server)
*
* Creates a new UNIX client socket connected to _path_.
*
- * require 'socket'
- *
* s = UNIXSocket.new("/tmp/sock")
* s.send "hello", 0
*
@@ -157,7 +131,7 @@ unix_path(VALUE sock)
/*
* call-seq:
- * unixsocket.recvfrom(maxlen [, flags[, outbuf]]) => [mesg, unixaddress]
+ * unixsocket.recvfrom(maxlen [, flags]) => [mesg, unixaddress]
*
* Receives a message via _unixsocket_.
*
@@ -165,9 +139,6 @@ 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)
@@ -227,8 +198,6 @@ 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)
@@ -309,8 +278,6 @@ 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
@@ -325,11 +292,6 @@ 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)
@@ -446,7 +408,7 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
ff_argc = mode == Qnil ? 1 : 2;
ff_argv[0] = INT2FIX(fd);
ff_argv[1] = mode;
- return rb_funcallv(klass, for_fd, ff_argc, ff_argv);
+ return rb_funcall2(klass, for_fd, ff_argc, ff_argv);
}
}
#else
@@ -513,7 +475,7 @@ unix_peeraddr(VALUE sock)
* UNIXSocket.pair([type [, protocol]]) => [unixsocket1, unixsocket2]
* UNIXSocket.socketpair([type [, protocol]]) => [unixsocket1, unixsocket2]
*
- * Creates a pair of sockets connected to each other.
+ * Creates a pair of sockets connected each other.
*
* _socktype_ should be a socket type such as: :STREAM, :DGRAM, :RAW, etc.
*
diff --git a/ext/stringio/README b/ext/stringio/README
new file mode 100644
index 0000000000..d03f37dfd3
--- /dev/null
+++ b/ext/stringio/README
@@ -0,0 +1,18 @@
+-*- rd -*-
+$Author$
+
+=begin
+
+= StringIO
+Pseudo (({IO})) class from/to (({String})).
+
+This library is based on MoonWolf version written in Ruby. Thanks a lot.
+
+= Differences to (({IO}))
+
+* not implemented: (({fcntl})), (({reopen})).
+* (({fileno})) returns nil.
+* (({pos=})) returns new position, not 0.
+* (({ungetc})) does nothing at start of the string.
+
+=end
diff --git a/ext/stringio/README.md b/ext/stringio/README.md
deleted file mode 100644
index 94532ed688..0000000000
--- a/ext/stringio/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# StringIO
-
-Pseudo `IO` class from/to `String`.
-
-This library is based on MoonWolf version written in Ruby. Thanks a lot.
-
-## Differences to `IO`
-
-* `fileno` raises `NotImplementedError`.
-* encoding conversion is not implemented, and ignored silently.
diff --git a/ext/stringio/depend b/ext/stringio/depend
index 852146f503..db356dd6e0 100644
--- a/ext/stringio/depend
+++ b/ext/stringio/depend
@@ -1,17 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-stringio.o: $(RUBY_EXTCONF_H)
-stringio.o: $(arch_hdrdir)/ruby/config.h
-stringio.o: $(hdrdir)/ruby/backward.h
-stringio.o: $(hdrdir)/ruby/defines.h
-stringio.o: $(hdrdir)/ruby/encoding.h
-stringio.o: $(hdrdir)/ruby/intern.h
-stringio.o: $(hdrdir)/ruby/io.h
-stringio.o: $(hdrdir)/ruby/missing.h
-stringio.o: $(hdrdir)/ruby/onigmo.h
-stringio.o: $(hdrdir)/ruby/oniguruma.h
-stringio.o: $(hdrdir)/ruby/ruby.h
-stringio.o: $(hdrdir)/ruby/st.h
-stringio.o: $(hdrdir)/ruby/subst.h
-stringio.o: $(top_srcdir)/include/ruby.h
-stringio.o: stringio.c
-# AUTOGENERATED DEPENDENCIES END
+stringio.o: stringio.c $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
diff --git a/ext/stringio/extconf.rb b/ext/stringio/extconf.rb
index ad8650dce2..8fc84b3735 100644
--- a/ext/stringio/extconf.rb
+++ b/ext/stringio/extconf.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: false
require 'mkmf'
create_makefile('stringio')
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index f537054b5d..2964adab40 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -20,26 +20,18 @@
#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;
int count;
};
-static VALUE strio_init(int, VALUE *, struct StringIO *, VALUE);
-static VALUE strio_unget_bytes(struct StringIO *, const char *, long);
-static long strio_write(VALUE self, VALUE str);
+static void strio_init(int, VALUE *, struct StringIO *, VALUE);
#define IS_STRIO(obj) (rb_typeddata_is_kind_of((obj), &strio_data_type))
-#define error_inval(msg) (rb_syserr_fail(EINVAL, msg))
-#define get_enc(ptr) ((ptr)->enc ? (ptr)->enc : rb_enc_get((ptr)->string))
+#define error_inval(msg) (errno = EINVAL, rb_sys_fail(msg))
static struct StringIO *
strio_alloc(void)
@@ -57,8 +49,9 @@ static void
strio_mark(void *p)
{
struct StringIO *ptr = p;
-
- rb_gc_mark(ptr->string);
+ if (ptr) {
+ rb_gc_mark(ptr->string);
+ }
}
static void
@@ -73,6 +66,8 @@ 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);
}
@@ -83,7 +78,7 @@ static const rb_data_type_t strio_data_type = {
strio_free,
strio_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
#define check_strio(self) ((struct StringIO*)rb_check_typeddata((self), &strio_data_type))
@@ -100,23 +95,16 @@ get_strio(VALUE self)
}
static VALUE
-enc_subseq(VALUE str, long pos, long len, rb_encoding *enc)
-{
- str = rb_str_subseq(str, pos, len);
- rb_enc_associate(str, enc);
- return str;
-}
-
-static VALUE
-strio_substr(struct StringIO *ptr, long pos, long len, rb_encoding *enc)
+strio_substr(struct StringIO *ptr, long pos, long len)
{
VALUE str = ptr->string;
+ rb_encoding *enc = rb_enc_get(str);
long rlen = RSTRING_LEN(str) - pos;
if (len > rlen) len = rlen;
if (len < 0) len = 0;
- if (len == 0) return rb_enc_str_new(0, 0, enc);
- return enc_subseq(str, pos, len, enc);
+ if (len == 0) return rb_str_new(0,0);
+ return rb_enc_str_new(RSTRING_PTR(str)+pos, len, enc);
}
#define StringIO(obj) get_strio(obj)
@@ -151,6 +139,8 @@ writable(VALUE strio)
if (!WRITABLE(strio)) {
rb_raise(rb_eIOError, "not opened for writing");
}
+ if (!OBJ_TAINTED(ptr->string)) {
+ }
return ptr;
}
@@ -182,10 +172,11 @@ strio_initialize(int argc, VALUE *argv, VALUE self)
DATA_PTR(self) = ptr = strio_alloc();
}
rb_call_super(0, 0);
- return strio_init(argc, argv, ptr, self);
+ strio_init(argc, argv, ptr, self);
+ return self;
}
-static VALUE
+static void
strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
{
VALUE string, mode;
@@ -195,17 +186,18 @@ 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_oflags_fmode(flags);
+ ptr->flags = rb_io_modenum_flags(flags);
trunc = flags & O_TRUNC;
}
else {
const char *m = StringValueCStr(mode);
- ptr->flags = rb_io_modestr_fmode(m);
+ ptr->flags = rb_io_mode_flags(m);
trunc = *m == 'w';
}
StringValue(string);
if ((ptr->flags & FMODE_WRITABLE) && OBJ_FROZEN(string)) {
- rb_syserr_fail(EACCES, 0);
+ errno = EACCES;
+ rb_sys_fail(0);
}
if (trunc) {
rb_str_resize(string, 0);
@@ -221,11 +213,9 @@ 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);
- return self;
}
static VALUE
@@ -252,19 +242,6 @@ strio_s_open(int argc, VALUE *argv, VALUE klass)
return rb_ensure(rb_yield, obj, strio_finalize, obj);
}
-/* :nodoc: */
-static VALUE
-strio_s_new(int argc, VALUE *argv, VALUE klass)
-{
- if (rb_block_given_p()) {
- VALUE cname = rb_obj_as_string(klass);
-
- rb_warn("%"PRIsVALUE"::new() does not take block; use %"PRIsVALUE"::open() instead",
- cname, cname);
- }
- return rb_class_new_instance(argc, argv, klass);
-}
-
/*
* Returns +false+. Just for compatibility to IO.
*/
@@ -369,6 +346,9 @@ static VALUE
strio_close(VALUE self)
{
StringIO(self);
+ if (CLOSED(self)) {
+ rb_raise(rb_eIOError, "closed stream");
+ }
RBASIC(self)->flags &= ~STRIO_READWRITE;
return Qnil;
}
@@ -383,8 +363,8 @@ strio_close(VALUE self)
static VALUE
strio_close_read(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (!(ptr->flags & FMODE_READABLE)) {
+ StringIO(self);
+ if (!READABLE(self)) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
RBASIC(self)->flags &= ~STRIO_READABLE;
@@ -401,8 +381,8 @@ strio_close_read(VALUE self)
static VALUE
strio_close_write(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- if (!(ptr->flags & FMODE_WRITABLE)) {
+ StringIO(self);
+ if (!WRITABLE(self)) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
RBASIC(self)->flags &= ~STRIO_WRITABLE;
@@ -517,18 +497,7 @@ strio_set_lineno(VALUE self, VALUE lineno)
return lineno;
}
-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_binmode strio_self
#define strio_fcntl strio_unimpl
@@ -551,7 +520,8 @@ strio_reopen(int argc, VALUE *argv, VALUE self)
if (argc == 1 && !RB_TYPE_P(*argv, T_STRING)) {
return strio_copy(self, *argv);
}
- return strio_init(argc, argv, StringIO(self), self);
+ strio_init(argc, argv, StringIO(self), self);
+ return self;
}
/*
@@ -613,30 +583,29 @@ strio_seek(int argc, VALUE *argv, VALUE self)
{
VALUE whence;
struct StringIO *ptr = StringIO(self);
- long amount, offset;
+ long offset;
rb_scan_args(argc, argv, "11", NULL, &whence);
- amount = NUM2LONG(argv[0]);
+ offset = NUM2LONG(argv[0]);
if (CLOSED(self)) {
rb_raise(rb_eIOError, "closed stream");
}
switch (NIL_P(whence) ? 0 : NUM2LONG(whence)) {
case 0:
- offset = 0;
break;
case 1:
- offset = ptr->pos;
+ offset += ptr->pos;
break;
case 2:
- offset = RSTRING_LEN(ptr->string);
+ offset += RSTRING_LEN(ptr->string);
break;
default:
error_inval("invalid whence");
}
- if (amount > LONG_MAX - offset || amount + offset < 0) {
+ if (offset < 0) {
error_inval(0);
}
- ptr->pos = amount + offset;
+ ptr->pos = offset;
return INT2FIX(0);
}
@@ -700,19 +669,17 @@ static VALUE
strio_getc(VALUE self)
{
struct StringIO *ptr = readable(self);
- rb_encoding *enc = get_enc(ptr);
- VALUE str = ptr->string;
- long pos = ptr->pos;
+ rb_encoding *enc = rb_enc_get(ptr->string);
int len;
char *p;
- if (pos >= RSTRING_LEN(str)) {
+ if (ptr->pos >= RSTRING_LEN(ptr->string)) {
return Qnil;
}
- p = RSTRING_PTR(str)+pos;
- len = rb_enc_mbclen(p, RSTRING_END(str), enc);
+ p = RSTRING_PTR(ptr->string)+ptr->pos;
+ len = rb_enc_mbclen(p, RSTRING_END(ptr->string), enc);
ptr->pos += len;
- return enc_subseq(str, pos, len, enc);
+ return rb_enc_str_new(p, len, rb_enc_get(ptr->string));
}
/*
@@ -738,9 +705,6 @@ strio_extend(struct StringIO *ptr, long pos, long len)
{
long olen;
- if (len > LONG_MAX - pos)
- rb_raise(rb_eArgError, "string size too big");
-
check_modifiable(ptr);
olen = RSTRING_LEN(ptr->string);
if (pos + len > olen) {
@@ -766,19 +730,19 @@ static VALUE
strio_ungetc(VALUE self, VALUE c)
{
struct StringIO *ptr = readable(self);
+ long lpos, clen;
+ char *p, *pend;
rb_encoding *enc, *enc2;
- check_modifiable(ptr);
if (NIL_P(c)) return Qnil;
- if (RB_INTEGER_TYPE_P(c)) {
- int len, cc = NUM2INT(c);
+ check_modifiable(ptr);
+ if (FIXNUM_P(c)) {
+ int cc = FIX2INT(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);
- return strio_unget_bytes(ptr, buf, len);
+ c = rb_enc_str_new(buf, rb_enc_codelen(cc, enc), enc);
}
else {
SafeStringValue(c);
@@ -787,10 +751,29 @@ 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;
}
/*
@@ -804,53 +787,35 @@ strio_ungetbyte(VALUE self, VALUE c)
{
struct StringIO *ptr = readable(self);
char buf[1], *cp = buf;
- long cl = 1;
+ long pos = ptr->pos, cl = 1;
+ VALUE str = ptr->string;
- 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;
}
-}
-
-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;
+ check_modifiable(ptr);
+ rb_str_modify(str);
if (cl > pos) {
- long ex = (rest < 0 ? cl-pos : cl+rest);
- rb_str_modify_expand(str, ex);
- rb_str_set_len(str, len + ex);
+ char *s;
+ long rest = RSTRING_LEN(str) - pos;
+ rb_str_resize(str, rest + cl);
s = RSTRING_PTR(str);
- if (rest < 0) memmove(s + cl, s + pos, -rest);
+ 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(s + pos, cp, cl);
+ memcpy(RSTRING_PTR(str) + pos, cp, cl);
ptr->pos = pos;
+ RB_GC_GUARD(c);
return Qnil;
}
@@ -932,7 +897,7 @@ strio_each_codepoint(VALUE self)
RETURN_ENUMERATOR(self, 0, 0);
ptr = readable(self);
- enc = get_enc(ptr);
+ enc = rb_enc_get(ptr->string);
for (;;) {
if (ptr->pos >= RSTRING_LEN(ptr->string)) {
return self;
@@ -991,19 +956,14 @@ bm_search(const char *little, long llen, const char *big, long blen, const long
return -1;
}
-struct getline_arg {
- VALUE rs;
- long limit;
- unsigned int chomp: 1;
-};
-
-static struct getline_arg *
-prepare_getline_args(struct getline_arg *arg, int argc, VALUE *argv)
+static VALUE
+strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
{
- VALUE str, lim, opts;
- long limit = -1;
+ const char *s, *e, *p;
+ long n, limit = 0;
+ VALUE str, lim;
- argc = rb_scan_args(argc, argv, "02:", &str, &lim, &opts);
+ rb_scan_args(argc, argv, "02", &str, &lim);
switch (argc) {
case 0:
str = rb_rs;
@@ -1014,6 +974,7 @@ prepare_getline_args(struct getline_arg *arg, int argc, VALUE *argv)
VALUE tmp = rb_check_string_type(str);
if (NIL_P(tmp)) {
limit = NUM2LONG(str);
+ if (limit == 0) return rb_str_new(0,0);
str = rb_rs;
}
else {
@@ -1027,39 +988,6 @@ prepare_getline_args(struct getline_arg *arg, int argc, VALUE *argv)
if (!NIL_P(lim)) limit = NUM2LONG(lim);
break;
}
- arg->rs = str;
- arg->limit = limit;
- arg->chomp = 0;
- if (!NIL_P(opts)) {
- static ID keywords[1];
- VALUE vchomp;
- if (!keywords[0]) {
- keywords[0] = rb_intern_const("chomp");
- }
- rb_get_kwargs(opts, keywords, 0, 1, &vchomp);
- arg->chomp = (vchomp != Qundef) && RTEST(vchomp);
- }
- return arg;
-}
-
-static inline int
-chomp_newline_width(const char *s, const char *e)
-{
- if (e > s && *--e == '\n') {
- if (e > s && *--e == '\r') return 2;
- return 1;
- }
- return 0;
-}
-
-static VALUE
-strio_getline(struct getline_arg *arg, struct StringIO *ptr)
-{
- const char *s, *e, *p;
- long n, limit = arg->limit;
- VALUE str = arg->rs;
- int w = 0;
- rb_encoding *enc = get_enc(ptr);
if (ptr->pos >= (n = RSTRING_LEN(ptr->string))) {
return Qnil;
@@ -1067,19 +995,15 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
s = RSTRING_PTR(ptr->string);
e = s + RSTRING_LEN(ptr->string);
s += ptr->pos;
- if (limit > 0 && (size_t)limit < (size_t)(e - s)) {
- e = rb_enc_right_char_head(s, s + limit, e, get_enc(ptr));
+ if (limit > 0 && s + limit < e) {
+ e = rb_enc_right_char_head(s, s + limit, e, rb_enc_get(ptr->string));
}
if (NIL_P(str)) {
- if (arg->chomp) {
- w = chomp_newline_width(s, e);
- }
- str = strio_substr(ptr, ptr->pos, e - s - w, enc);
+ str = strio_substr(ptr, ptr->pos, e - s);
}
else if ((n = RSTRING_LEN(str)) == 0) {
p = s;
- while (p[(p + 1 < e) && (*p == '\r') && 0] == '\n') {
- p += *p == '\r';
+ while (*p == '\n') {
if (++p == e) {
return Qnil;
}
@@ -1088,33 +1012,23 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
while ((p = memchr(p, '\n', e - p)) && (p != e)) {
if (*++p == '\n') {
e = p + 1;
- w = (arg->chomp ? 1 : 0);
break;
}
- else if (*p == '\r' && p < e && p[1] == '\n') {
- e = p + 2;
- w = (arg->chomp ? 2 : 0);
- break;
- }
- }
- if (!w && arg->chomp) {
- w = chomp_newline_width(s, e);
}
- str = strio_substr(ptr, s - RSTRING_PTR(ptr->string), e - s - w, enc);
+ str = strio_substr(ptr, s - RSTRING_PTR(ptr->string), e - s);
}
else if (n == 1) {
if ((p = memchr(s, RSTRING_PTR(str)[0], e - s)) != 0) {
e = p + 1;
- w = (arg->chomp ? (p > s && *(p-1) == '\r') + 1 : 0);
}
- str = strio_substr(ptr, ptr->pos, e - s - w, enc);
+ str = strio_substr(ptr, ptr->pos, e - s);
}
else {
if (n < e - s) {
if (e - s < 1024) {
for (p = s; p + n <= e; ++p) {
if (MEMCMP(p, RSTRING_PTR(str), char, n) == 0) {
- e = p + (arg->chomp ? 0 : n);
+ e = p + n;
break;
}
}
@@ -1124,11 +1038,11 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
p = RSTRING_PTR(str);
bm_init_skip(skip, p, n);
if ((pos = bm_search(p, n, s, e - s, skip)) >= 0) {
- e = s + pos + (arg->chomp ? 0 : n);
+ e = s + pos + n;
}
}
}
- str = strio_substr(ptr, ptr->pos, e - s - w, enc);
+ str = strio_substr(ptr, ptr->pos, e - s);
}
ptr->pos = e - RSTRING_PTR(ptr->string);
ptr->lineno++;
@@ -1146,15 +1060,8 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
static VALUE
strio_gets(int argc, VALUE *argv, VALUE self)
{
- struct getline_arg arg;
- VALUE str;
+ VALUE str = strio_getline(argc, argv, readable(self));
- if (prepare_getline_args(&arg, argc, argv)->limit == 0) {
- struct StringIO *ptr = readable(self);
- return rb_enc_str_new(0, 0, get_enc(ptr));
- }
-
- str = strio_getline(&arg, readable(self));
rb_lastline_set(str);
return str;
}
@@ -1193,16 +1100,16 @@ static VALUE
strio_each(int argc, VALUE *argv, VALUE self)
{
VALUE line;
- struct getline_arg arg;
StringIO(self);
RETURN_ENUMERATOR(self, argc, argv);
- if (prepare_getline_args(&arg, argc, argv)->limit == 0) {
+ if (argc > 0 && !NIL_P(argv[argc-1]) && NIL_P(rb_check_string_type(argv[argc-1])) &&
+ NUM2LONG(argv[argc-1]) == 0) {
rb_raise(rb_eArgError, "invalid limit: 0 for each_line");
}
- while (!NIL_P(line = strio_getline(&arg, readable(self)))) {
+ while (!NIL_P(line = strio_getline(argc, argv, readable(self)))) {
rb_yield(line);
}
return self;
@@ -1232,15 +1139,15 @@ static VALUE
strio_readlines(int argc, VALUE *argv, VALUE self)
{
VALUE ary, line;
- struct getline_arg arg;
StringIO(self);
ary = rb_ary_new();
- if (prepare_getline_args(&arg, argc, argv)->limit == 0) {
+ if (argc > 0 && !NIL_P(argv[argc-1]) && NIL_P(rb_check_string_type(argv[argc-1])) &&
+ NUM2LONG(argv[argc-1]) == 0) {
rb_raise(rb_eArgError, "invalid limit: 0 for readlines");
}
- while (!NIL_P(line = strio_getline(&arg, readable(self)))) {
+ while (!NIL_P(line = strio_getline(argc, argv, readable(self)))) {
rb_ary_push(ary, line);
}
return ary;
@@ -1248,8 +1155,8 @@ strio_readlines(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * strio.write(string, ...) -> integer
- * strio.syswrite(string) -> integer
+ * strio.write(string) -> integer
+ * strio.syswrite(string) -> integer
*
* Appends the given string to the underlying buffer string of *strio*.
* The stream must be opened for writing. If the argument is not a
@@ -1257,40 +1164,28 @@ strio_readlines(int argc, VALUE *argv, VALUE self)
* Returns the number of bytes written. See IO#write.
*/
static VALUE
-strio_write_m(int argc, VALUE *argv, VALUE self)
-{
- long len = 0;
- while (argc-- > 0) {
- /* StringIO can't exceed long limit */
- len += strio_write(self, *argv++);
- }
- return LONG2NUM(len);
-}
-
-static long
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();
if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
- enc = get_enc(ptr);
+ enc = rb_enc_get(ptr->string);
enc2 = rb_enc_get(str);
- if (enc != enc2 && enc != ascii8bit) {
+ if (enc != enc2 && enc != rb_ascii8bit_encoding()) {
str = rb_str_conv_enc(str, enc2, enc);
}
len = RSTRING_LEN(str);
- if (len == 0) return 0;
+ if (len == 0) return INT2FIX(0);
check_modifiable(ptr);
olen = RSTRING_LEN(ptr->string);
if (ptr->flags & FMODE_APPEND) {
ptr->pos = olen;
}
if (ptr->pos == olen) {
- if (enc == ascii8bit || enc2 == ascii8bit) {
+ if (enc2 == rb_ascii8bit_encoding()) {
rb_enc_str_buf_cat(ptr->string, RSTRING_PTR(str), len, enc);
OBJ_INFECT(ptr->string, str);
}
@@ -1306,7 +1201,7 @@ strio_write(VALUE self, VALUE str)
OBJ_INFECT(ptr->string, self);
RB_GC_GUARD(str);
ptr->pos += len;
- return len;
+ return LONG2NUM(len);
}
/*
@@ -1380,7 +1275,6 @@ 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];
@@ -1388,7 +1282,6 @@ strio_read(int argc, VALUE *argv, VALUE self)
StringValue(str);
rb_str_modify(str);
}
- /* fall through */
case 1:
if (!NIL_P(argv[0])) {
len = NUM2LONG(argv[0]);
@@ -1406,24 +1299,24 @@ strio_read(int argc, VALUE *argv, VALUE self)
case 0:
len = RSTRING_LEN(ptr->string);
if (len <= ptr->pos) {
- rb_encoding *enc = binary ? rb_ascii8bit_encoding() : get_enc(ptr);
if (NIL_P(str)) {
str = rb_str_new(0, 0);
}
else {
rb_str_resize(str, 0);
}
- rb_enc_associate(str, enc);
return str;
}
else {
len -= ptr->pos;
}
break;
+ default:
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
- rb_encoding *enc = binary ? rb_ascii8bit_encoding() : get_enc(ptr);
- str = strio_substr(ptr, ptr->pos, len, enc);
+ str = strio_substr(ptr, ptr->pos, len);
+ if (binary) rb_enc_associate(str, rb_ascii8bit_encoding());
}
else {
long rest = RSTRING_LEN(ptr->string) - ptr->pos;
@@ -1468,17 +1361,20 @@ 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 (!NIL_P(opts) &&
- rb_hash_lookup2(opts, sym_exception, Qundef) == Qfalse)
+ if (no_exception)
return Qnil;
else
rb_eof_error();
@@ -1555,8 +1451,7 @@ strio_truncate(VALUE self, VALUE len)
static VALUE
strio_external_encoding(VALUE self)
{
- struct StringIO *ptr = StringIO(self);
- return rb_enc_from_encoding(get_enc(ptr));
+ return rb_enc_from_encoding(rb_enc_get(StringIO(self)->string));
}
/*
@@ -1570,7 +1465,7 @@ strio_external_encoding(VALUE self)
static VALUE
strio_internal_encoding(VALUE self)
{
- return Qnil;
+ return Qnil;
}
/*
@@ -1587,7 +1482,7 @@ static VALUE
strio_set_encoding(int argc, VALUE *argv, VALUE self)
{
rb_encoding* enc;
- struct StringIO *ptr = StringIO(self);
+ VALUE str = StringIO(self)->string;
VALUE ext_enc, int_enc, opt;
argc = rb_scan_args(argc, argv, "11:", &ext_enc, &int_enc, &opt);
@@ -1598,11 +1493,7 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
else {
enc = rb_to_encoding(ext_enc);
}
- ptr->enc = enc;
- if (WRITABLE(self)) {
- rb_enc_associate(ptr->string, enc);
- }
-
+ rb_enc_associate(str, enc);
return self;
}
@@ -1617,16 +1508,15 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
*
* io = StringIO.new
* io.puts "Hello World"
- * io.string #=> "Hello World\n"
+ * io.string #=> "Hello World"
*/
void
-Init_stringio(void)
+Init_stringio()
{
VALUE StringIO = rb_define_class("StringIO", rb_cData);
rb_include_module(StringIO, rb_mEnumerable);
rb_define_alloc_func(StringIO, strio_s_allocate);
- rb_define_singleton_method(StringIO, "new", strio_s_new, -1);
rb_define_singleton_method(StringIO, "open", strio_s_open, -1);
rb_define_method(StringIO, "initialize", strio_initialize, -1);
rb_define_method(StringIO, "initialize_copy", strio_copy, 1);
@@ -1680,7 +1570,7 @@ Init_stringio(void)
rb_define_method(StringIO, "readlines", strio_readlines, -1);
rb_define_method(StringIO, "read", strio_read, -1);
- rb_define_method(StringIO, "write", strio_write_m, -1);
+ rb_define_method(StringIO, "write", strio_write, 1);
rb_define_method(StringIO, "putc", strio_putc, 1);
/*
diff --git a/ext/stringio/stringio.gemspec b/ext/stringio/stringio.gemspec
deleted file mode 100644
index fa1e767f5f..0000000000
--- a/ext/stringio/stringio.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- encoding: utf-8 -*-
-# frozen_string_literal: true
-# stub: stringio 0.0.0 ruby lib
-# stub: extconf.rb
-
-Gem::Specification.new do |s|
- s.name = "stringio".freeze
- s.version = "0.0.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 2.6".freeze)
- s.require_paths = ["lib".freeze]
- s.authors = ["Nobu Nakada".freeze]
- s.date = "2016-06-09"
- s.description = "Pseudo `IO` class from/to `String`.".freeze
- s.email = "nobu@ruby-lang.org".freeze
- s.extensions = ["extconf.rb".freeze]
- s.files = ["README.md".freeze, "depend".freeze, "extconf.rb".freeze, "stringio.c".freeze]
- s.homepage = "https://github.com/ruby/stringio".freeze
- s.licenses = ["BSD-2-Clause".freeze]
- s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
- s.rubygems_version = "2.6.11".freeze
- s.summary = "Pseudo IO on String".freeze
- s.cert_chain = %w[certs/nobu.pem]
- s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
-
- s.add_development_dependency 'rake-compiler'
-end
diff --git a/ext/strscan/depend b/ext/strscan/depend
index 1c396b00cf..689510ec66 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,19 +1,7 @@
-# AUTOGENERATED DEPENDENCIES START
-strscan.o: $(RUBY_EXTCONF_H)
-strscan.o: $(arch_hdrdir)/ruby/config.h
-strscan.o: $(hdrdir)/ruby/backward.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/onigmo.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
+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
diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb
index 714fa99fae..3e5a295e31 100644
--- a/ext/strscan/extconf.rb
+++ b/ext/strscan/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'mkmf'
$INCFLAGS << " -I$(top_srcdir)"
create_makefile 'strscan'
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index d6168a0d4f..7f93324dee 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -64,7 +64,6 @@ 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));
@@ -141,17 +140,12 @@ 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;
- end_i = minl(end_i, S_LEN(p));
+ if (end_i > S_LEN(p))
+ end_i = S_LEN(p);
return infect(str_new(p, S_PBEG(p) + beg_i, end_i - beg_i), p);
}
@@ -159,7 +153,8 @@ static VALUE
extract_beg_len(struct strscanner *p, long beg_i, long len)
{
if (beg_i > S_LEN(p)) return Qnil;
- len = minl(len, S_LEN(p) - beg_i);
+ if (beg_i + len > S_LEN(p))
+ len = S_LEN(p) - beg_i;
return infect(str_new(p, S_PBEG(p) + beg_i, len), p);
}
@@ -186,25 +181,29 @@ static size_t
strscan_memsize(const void *ptr)
{
const struct strscanner *p = ptr;
- return sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
+ size_t size = 0;
+ if (p) {
+ size = sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
+ }
+ return size;
}
static const rb_data_type_t strscanner_type = {
"StringScanner",
{strscan_mark, strscan_free, strscan_memsize},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, 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 = ZALLOC(struct strscanner);
CLEAR_MATCH_STATUS(p);
onig_region_init(&(p->regs));
p->str = Qnil;
- return obj;
+ return TypedData_Wrap_Struct(klass, &strscanner_type, p);
}
/*
@@ -252,9 +251,7 @@ strscan_init_copy(VALUE vself, VALUE vorig)
self->str = orig->str;
self->prev = orig->prev;
self->curr = orig->curr;
- if (rb_reg_region_copy(&self->regs, &orig->regs))
- rb_memerror();
- RB_GC_GUARD(vorig);
+ onig_region_copy(&self->regs, &orig->regs);
}
return vself;
@@ -465,7 +462,7 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
p->regex = regex;
re = rb_reg_prepare_re(regex, p->str);
- tmpreg = re != RREGEXP_PTR(regex);
+ tmpreg = re != RREGEXP(regex)->ptr;
if (!tmpreg) RREGEXP(regex)->usecnt++;
if (headonly) {
@@ -485,8 +482,8 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
onig_free(re);
}
else {
- onig_free(RREGEXP_PTR(regex));
- RREGEXP_PTR(regex) = re;
+ onig_free(RREGEXP(regex)->ptr);
+ RREGEXP(regex)->ptr = re;
}
}
@@ -733,7 +730,9 @@ strscan_getch(VALUE self)
return Qnil;
len = rb_enc_mbclen(CURPTR(p), S_PEND(p), rb_enc_get(p->str));
- len = minl(len, S_RESTLEN(p));
+ if (p->curr + len > S_LEN(p)) {
+ len = S_LEN(p) - p->curr;
+ }
p->prev = p->curr;
p->curr += len;
MATCHED(p);
@@ -810,7 +809,8 @@ strscan_peek(VALUE self, VALUE vlen)
if (EOS_P(p))
return infect(str_new(p, "", 0), p);
- len = minl(len, S_RESTLEN(p));
+ if (p->curr + len > S_LEN(p))
+ len = S_LEN(p) - p->curr;
return extract_beg_len(p, p->curr, len);
}
@@ -980,7 +980,7 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
{
int num;
- num = onig_name_to_backref_number(RREGEXP_PTR(regexp),
+ num = onig_name_to_backref_number(RREGEXP(regexp)->ptr,
(const unsigned char* )name, (const unsigned char* )name_end, regs);
if (num >= 1) {
return num;
@@ -996,7 +996,7 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
/*
* call-seq: [](n)
*
- * Returns the n-th subgroup in the most recent match.
+ * Return the n-th subgroup in the most recent match.
*
* s = StringScanner.new("Fri Dec 12 1975 14:39")
* s.scan(/(\w+) (\w+) (\d+) /) # -> "Fri Dec 12 "
@@ -1034,7 +1034,6 @@ strscan_aref(VALUE self, VALUE idx)
idx = rb_sym2str(idx);
/* fall through */
case T_STRING:
- 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;
@@ -1053,93 +1052,7 @@ strscan_aref(VALUE self, VALUE idx)
}
/*
- * call-seq: size
- *
- * Returns the amount of subgroups in the most recent match.
- * The full match counts as a subgroup.
- *
- * s = StringScanner.new("Fri Dec 12 1975 14:39")
- * s.scan(/(\w+) (\w+) (\d+) /) # -> "Fri Dec 12 "
- * s.size # -> 4
- */
-static VALUE
-strscan_size(VALUE self)
-{
- struct strscanner *p;
-
- GET_SCANNER(self, p);
- if (! MATCHED_P(p)) return Qnil;
- return INT2FIX(p->regs.num_regs);
-}
-
-/*
- * call-seq: captures
- *
- * Returns the subgroups in the most recent match (not including the full match).
- * If nothing was priorly matched, it returns nil.
- *
- * s = StringScanner.new("Fri Dec 12 1975 14:39")
- * s.scan(/(\w+) (\w+) (\d+) /) # -> "Fri Dec 12 "
- * s.captures # -> ["Fri", "Dec", "12"]
- * s.scan(/(\w+) (\w+) (\d+) /) # -> nil
- * s.captures # -> nil
- */
-static VALUE
-strscan_captures(VALUE self)
-{
- struct strscanner *p;
- int i, num_regs;
- VALUE new_ary;
-
- GET_SCANNER(self, p);
- if (! MATCHED_P(p)) return Qnil;
-
- num_regs = p->regs.num_regs;
- new_ary = rb_ary_new2(num_regs);
-
- for (i = 1; i < num_regs; i++) {
- VALUE str = extract_range(p, p->prev + p->regs.beg[i],
- p->prev + p->regs.end[i]);
- rb_ary_push(new_ary, str);
- }
-
- return new_ary;
-}
-
-/*
- * call-seq:
- * scanner.values_at( i1, i2, ... iN ) -> an_array
- *
- * Returns the subgroups in the most recent match at the given indices.
- * If nothing was priorly matched, it returns nil.
- *
- * s = StringScanner.new("Fri Dec 12 1975 14:39")
- * s.scan(/(\w+) (\w+) (\d+) /) # -> "Fri Dec 12 "
- * s.values_at 0, -1, 5, 2 # -> ["Fri Dec 12 ", "12", nil, "Dec"]
- * s.scan(/(\w+) (\w+) (\d+) /) # -> nil
- * s.values_at 0, -1, 5, 2 # -> nil
- */
-
-static VALUE
-strscan_values_at(int argc, VALUE *argv, VALUE self)
-{
- struct strscanner *p;
- long i;
- VALUE new_ary;
-
- GET_SCANNER(self, p);
- if (! MATCHED_P(p)) return Qnil;
-
- new_ary = rb_ary_new2(argc);
- for (i = 0; i<argc; i++) {
- rb_ary_push(new_ary, strscan_aref(self, argv[i]));
- }
-
- return new_ary;
-}
-
-/*
- * Returns the <i><b>pre</b>-match</i> (in the regular expression sense) of the last scan.
+ * Return the <i><b>pre</b>-match</i> (in the regular expression sense) of the last scan.
*
* s = StringScanner.new('test string')
* s.scan(/\w+/) # -> "test"
@@ -1158,7 +1071,7 @@ strscan_pre_match(VALUE self)
}
/*
- * Returns the <i><b>post</b>-match</i> (in the regular expression sense) of the last scan.
+ * Return the <i><b>post</b>-match</i> (in the regular expression sense) of the last scan.
*
* s = StringScanner.new('test string')
* s.scan(/\w+/) # -> "test"
@@ -1205,7 +1118,7 @@ strscan_rest_size(VALUE self)
if (EOS_P(p)) {
return INT2FIX(0);
}
- i = S_RESTLEN(p);
+ i = S_LEN(p) - p->curr;
return INT2FIX(i);
}
@@ -1291,7 +1204,7 @@ inspect2(struct strscanner *p)
long len;
if (EOS_P(p)) return rb_str_new2("");
- len = S_RESTLEN(p);
+ len = S_LEN(p) - p->curr;
if (len > INSPECT_LENGTH) {
str = rb_str_new(CURPTR(p), INSPECT_LENGTH);
rb_str_cat2(str, "...");
@@ -1410,7 +1323,7 @@ inspect2(struct strscanner *p)
* There are aliases to several of the methods.
*/
void
-Init_strscan(void)
+Init_strscan()
{
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
@@ -1478,9 +1391,6 @@ Init_strscan(void)
rb_define_method(StringScanner, "[]", strscan_aref, 1);
rb_define_method(StringScanner, "pre_match", strscan_pre_match, 0);
rb_define_method(StringScanner, "post_match", strscan_post_match, 0);
- rb_define_method(StringScanner, "size", strscan_size, 0);
- rb_define_method(StringScanner, "captures", strscan_captures, 0);
- rb_define_method(StringScanner, "values_at", strscan_values_at, -1);
rb_define_method(StringScanner, "rest", strscan_rest, 0);
rb_define_method(StringScanner, "rest_size", strscan_rest_size, 0);
diff --git a/ext/strscan/strscan.gemspec b/ext/strscan/strscan.gemspec
deleted file mode 100644
index e2f6cf5503..0000000000
--- a/ext/strscan/strscan.gemspec
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "strscan"
- s.version = '1.0.0'
- s.date = '2017-12-19'
- s.summary = "Provides lexical scanning operations on a String."
- s.description = "Provides lexical scanning operations on a String."
-
- s.require_path = %w{lib}
- s.files = %w{ext/strscan/extconf.rb ext/strscan/strscan.c ext/strscan/regenc.h ext/strscan/regint.h}
- s.extensions = %w{ext/strscan/extconf.rb}
- s.required_ruby_version = ">= 2.4.0"
-
- s.authors = ["Minero Aoki"]
- s.email = [nil]
- s.homepage = "https://github.com/ruby/strscan"
- s.license = "BSD-2-Clause"
-
- s.add_development_dependency "rake-compiler"
-end
diff --git a/ext/syslog/depend b/ext/syslog/depend
index ee2ad79052..0e2d76fbf6 100644
--- a/ext/syslog/depend
+++ b/ext/syslog/depend
@@ -1,13 +1,2 @@
-# AUTOGENERATED DEPENDENCIES START
-syslog.o: $(RUBY_EXTCONF_H)
-syslog.o: $(arch_hdrdir)/ruby/config.h
-syslog.o: $(hdrdir)/ruby/backward.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
+syslog.o: syslog.c $(HDRS) $(ruby_headers) \
+ $(hdrdir)/util.h
diff --git a/ext/syslog/extconf.rb b/ext/syslog/extconf.rb
index 3bfea1fa73..0fa0bc339b 100644
--- a/ext/syslog/extconf.rb
+++ b/ext/syslog/extconf.rb
@@ -1,4 +1,3 @@
-# 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 06cbe5b19d..086f83c591 100644
--- a/ext/syslog/lib/syslog/logger.rb
+++ b/ext/syslog/lib/syslog/logger.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'syslog'
require 'logger'
@@ -67,7 +66,7 @@ class Syslog::Logger
##
# The version of Syslog::Logger you are using.
- VERSION = '2.1.0'
+ VERSION = '2.0'
##
# Maps Logger warning types to syslog(3) warning types.
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 317607eeef..8ef722e1c0 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -150,7 +150,6 @@ static VALUE mSyslog_close(VALUE self)
static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
{
VALUE ident, opt, fac;
- const char *ident_ptr;
if (syslog_opened) {
rb_raise(rb_eRuntimeError, "syslog already open");
@@ -161,9 +160,8 @@ static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
if (NIL_P(ident)) {
ident = rb_gv_get("$0");
}
- ident_ptr = StringValueCStr(ident);
- rb_check_safe_obj(ident);
- syslog_ident = strdup(ident_ptr);
+ SafeStringValue(ident);
+ syslog_ident = strdup(RSTRING_PTR(ident));
if (NIL_P(opt)) {
syslog_options = LOG_PID | LOG_CONS;
@@ -306,7 +304,9 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
{
VALUE pri;
- rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS);
+ if (argc < 2) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
+ }
argc--;
pri = *argv++;
@@ -418,7 +418,7 @@ static VALUE mSyslogMacros_included(VALUE mod, VALUE target)
*
* The syslog protocol is standardized in RFC 5424.
*/
-void Init_syslog(void)
+void Init_syslog()
{
mSyslog = rb_define_module("Syslog");
@@ -506,7 +506,7 @@ void Init_syslog(void)
rb_define_syslog_facility(LOG_NEWS);
#endif
#ifdef LOG_NTP
- rb_define_syslog_facility(LOG_NTP);
+ rb_define_syslog_facility(LOG_NTP);
#endif
#ifdef LOG_SECURITY
rb_define_syslog_facility(LOG_SECURITY);
diff --git a/ext/thread/extconf.rb b/ext/thread/extconf.rb
new file mode 100644
index 0000000000..f2f0890580
--- /dev/null
+++ b/ext/thread/extconf.rb
@@ -0,0 +1,3 @@
+require 'mkmf'
+
+create_makefile('thread')
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
new file mode 100644
index 0000000000..c14443b06c
--- /dev/null
+++ b/ext/thread/thread.c
@@ -0,0 +1,653 @@
+#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) get_array((cv), CONDVAR_WAITERS)
+
+#define GET_QUEUE_QUE(q) get_array((q), QUEUE_QUE)
+#define GET_QUEUE_WAITERS(q) get_array((q), QUEUE_WAITERS)
+#define GET_SZQUEUE_WAITERS(q) get_array((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
+get_array(VALUE obj, int idx)
+{
+ VALUE ary = RSTRUCT_GET(obj, idx);
+ if (!RB_TYPE_P(ary, T_ARRAY)) {
+ rb_raise(rb_eTypeError, "%+"PRIsVALUE" not initialized", obj);
+ }
+ return ary;
+}
+
+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, int should_block)
+{
+ struct waiting_delete args;
+ args.waiting = GET_QUEUE_WAITERS(self);
+ args.th = rb_thread_current();
+
+ while (queue_length(self) == 0) {
+ if (!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 int
+queue_pop_should_block(int argc, const VALUE *argv)
+{
+ int should_block = 1;
+ rb_check_arity(argc, 0, 1);
+ if (argc > 0) {
+ should_block = !RTEST(argv[0]);
+ }
+ 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)
+{
+ int 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_SZQUEUE_WAITERS(self)))) {
+ rb_thread_wakeup_alive(t);
+ }
+ return vmax;
+}
+
+static int
+szqueue_push_should_block(int argc, const VALUE *argv)
+{
+ int should_block = 1;
+ rb_check_arity(argc, 1, 2);
+ if (argc > 1) {
+ should_block = !RTEST(argv[1]);
+ }
+ return should_block;
+}
+
+/*
+ * Document-method: SizedQueue#push
+ * call-seq:
+ * push(object, non_block=false)
+ * enq(object, non_block=false)
+ * <<(object)
+ *
+ * Pushes +object+ to the queue.
+ *
+ * If there is no space left in the queue, waits until space becomes
+ * available, unless +non_block+ is true. If +non_block+ is true, the
+ * thread isn't suspended, and an exception is raised.
+ */
+
+static VALUE
+rb_szqueue_push(int argc, VALUE *argv, VALUE self)
+{
+ struct waiting_delete args;
+ int should_block = szqueue_push_should_block(argc, argv);
+ args.waiting = GET_SZQUEUE_WAITERS(self);
+ args.th = rb_thread_current();
+
+ while (queue_length(self) >= GET_SZQUEUE_ULONGMAX(self)) {
+ if (!should_block) {
+ rb_raise(rb_eThreadError, "queue full");
+ }
+ 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, argv[0]);
+}
+
+static VALUE
+szqueue_do_pop(VALUE self, int 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)
+{
+ int should_block = queue_pop_should_block(argc, argv);
+ return szqueue_do_pop(self, should_block);
+}
+
+/*
+ * Document-method: Queue#clear
+ *
+ * Removes all objects from the queue.
+ */
+
+static VALUE
+rb_szqueue_clear(VALUE self)
+{
+ rb_ary_clear(GET_QUEUE_QUE(self));
+ wakeup_all_threads(GET_SZQUEUE_WAITERS(self));
+ return self;
+}
+
+/*
+ * 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
+
+/* :nodoc: */
+static VALUE
+undumpable(VALUE obj)
+{
+ rb_raise(rb_eTypeError, "can't dump %"PRIsVALUE, rb_obj_class(obj));
+ UNREACHABLE;
+}
+
+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_undef_method(rb_cConditionVariable, "initialize_copy");
+ rb_define_method(rb_cConditionVariable, "marshal_dump", undumpable, 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_undef_method(rb_cQueue, "initialize_copy");
+ rb_define_method(rb_cQueue, "marshal_dump", undumpable, 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, "clear", rb_szqueue_clear, 0);
+ 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/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib
new file mode 100644
index 0000000000..52a0b7ea3a
--- /dev/null
+++ b/ext/tk/ChangeLog.tkextlib
@@ -0,0 +1,949 @@
+2009-07-12 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/*: update release.
+ Tcllib 1.8/Tklib 0.4.1 ==> Tcllib 1.11.1/Tklib 0.5
+ BWidgets 1.7 ==> BWidgets 1.8
+ TkTable 2.9 ==> TkTable 2.10
+ TkTreeCtrl 2005-12-02 ==> TkTreeCtrl 2.2.9
+ Tile 0.8.0/8.5.1 ==> Tile 0.8.3/8.6b1
+ IncrTcl 2005-02-14 ==> IncrTcl 2008-12-15
+ TclX 2005-02-07 ==> TclX 2008-12-15
+ Trofs 0.4.3 ==> Trofs 0.4.4
+
+--------------< ... some bug fixes ... >------------------
+
+Tue Nov 25 03:37:42 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/blt/tabset.rb,
+ ext/tk/lib/tkextlib/blt/tabnotebook.rb:
+ fix many bugs. Now, those work properly.
+
+Sat Nov 22 10:31:25 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb:
+ fix NameError bug.
+
+2008-05-12 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/tkDND/shape.rb: wrong package name.
+
+--------------< ... some changes ... >------------------
+
+2007-05-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/tcllib/tablelist.rb: fix typo.
+
+ * ext/tk/lib/tkextlib/tile/dialog.rb: forget to give an argument.
+
+ * ext/tk/lib/tkextlib/version.rb: update RELEASE_DATE.
+
+2007-01-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tkextlib/iwidgets/checkbox.rb: wrong number of arguments
+ [ruby-Bugs-7776].
+
+ * ext/tk/lib/tkextlib/iwidgets/radiobox.rb: ditto.
+
+ * ext/tk/lib/tkextlib/blt/tile/checkbutton.rb: change primary name
+ of class [ruby-dev:30080].
+
+ * ext/tk/lib/tkextlib/blt/tile/radiobutton.rb: ditto.
+
+2006-11-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile/treeview.rb : minor bug fix.
+
+ * lib/tkextlib/blt/table.rb: fix bugs which forbade use of
+ '::blt::table' command. Now, probably, it'll works properly.
+
+2006-11-06 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/version.rb: keep release date of tkextlib on
+ "Tk::Tkextlib_RELEASE_DATE".
+
+ * lib/tkextlib/tile/treeview.rb : support Tile 0.7.8.
+ Now, you can handle tree items as objects.
+
+2006-10-04 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile.rb, lib/tkextlib/tile/* : support Tile 0.7.6.
+
+2006-10-03 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPORT_STATUS: [ruby-talk:211939] check links
+ of extensions.
+
+ * lib/tkextlib/blt/container.rb: define instance methods properly.
+
+ * lib/tkextlib/tile/tcombobox.rb: bug fix [ruby-talk:213003].
+
+ * lib/tkextlib/tile/tnotebook.rb: ditto.
+
+ * lib/tkextlib/tile/treeview.rb: ditto.
+
+ * lib/tkextlib/tile/sizegrip.rb: [new] add 'ttk::sizegrip' widget.
+
+2006-08-31 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt.rb: double dashes (--) option doesn't work
+ properly on some versions of BLT (wrong description on the
+ manual of `blt::bgexec'?).
+
+2005-12-11 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPORT_STATUS: update to support libraries in
+ ActiveTcl8.4.12.0.
+
+ * lib/tkextlib/tile/tnotebook.rb: add Tk::Tile::TNotebook#insert.
+
+ * sample/tkextlib/tile/demo.rb: improve the look of a part of the demo.
+
+2005-11-25 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/tile/demo.rb: bug fix
+
+ * sample/tkextlib/tile/themes/*: add some themes (blue,
+ keramik, and plastik; require Tile-0.5 or later).
+
+2005-11-22 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile.rb: bug fix (Tk::Tile::USE_TTK_NAMESPACE
+ is not defined).
+
+2005-11-19 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/treectrl/demo.rb: remove dependency on Ruby's
+ version (1.8 or 1.9).
+
+2005-10-23 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/*: update to support ActiveTcl8.4.11.2
+
+ * lib/tkextlib/trofs/*: support Trofs 0.4.3
+
+ * lib/tkextlib/tile/*: support Tile 0.7.2
+
+ * lib/tkextlib/vu/*: support vu 2.3.0
+
+ * lib/tkextlib/tcllib/*: support Tcllib 1.8 (Tklib 0.3 part only)
+
+ * lib/tkextlib/*: improve conversion of option values
+
+2005-10-04 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tktable/tktable.rb: border_* instance methods
+ don't call 'border' subcommands.
+
+2005-08-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/component.rb: didn't check
+ __item_ruby2val_optkeys().
+
+2005-08-09 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/barchart.rb: support to treat tkvariable-type
+ configure options.
+
+ * lib/tkextlib/blt/component.rb: ditto.
+
+ * lib/tkextlib/blt/dragdrop.rb: ditto.
+
+ * lib/tkextlib/blt/treeview.rb: ditto.
+
+ * lib/tkextlib/bwidget/button.rb: ditto.
+
+ * lib/tkextlib/bwidget/entry.rb: ditto.
+
+ * lib/tkextlib/bwidget/label.rb: ditto.
+
+ * lib/tkextlib/bwidget/labelentry.rb: ditto.
+
+ * lib/tkextlib/bwidget/labelframe.rb: ditto.
+
+ * lib/tkextlib/bwidget/mainframe.rb: ditto.
+
+ * lib/tkextlib/bwidget/passwddlg.rb: ditto.
+
+ * lib/tkextlib/bwidget/spinbox.rb: ditto.
+
+ * lib/tkextlib/bwidget/tree.rb: ditto.
+
+ * lib/tkextlib/iwidgets/calendar.rb: ditto.
+
+ * lib/tkextlib/iwidgets/entryfield.rb: ditto.
+
+ * lib/tkextlib/iwidgets/hierarchy.rb: ditto.
+
+ * lib/tkextlib/iwidgets/labeledframe.rb: ditto.
+
+ * lib/tkextlib/iwidgets/labeledwidget.rb: ditto.
+
+ * lib/tkextlib/iwidgets/menubar.rb: ditto.
+
+ * lib/tkextlib/iwidgets/scrolledlistbox.rb: ditto.
+
+ * lib/tkextlib/iwidgets/spinner.rb: ditto.
+
+ * lib/tkextlib/iwidgets/toolbar.rb: ditto.
+
+ * lib/tkextlib/tkimg/pixmap.rb: ditto.
+
+ * lib/tkextlib/tktable/tktable.rb: ditto.
+
+2005-08-06 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: use Tk::Tile::Scale#variable.
+
+2005-08-04 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: followed previous changes.
+
+2005-08-04 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile/t*.rb: aliased class names starting with 'T'
+ to non 'T' ones. (ie. Tk::Tile::TButton -> Tk::Tile::Button)
+ [ruby-dev:26724]
+
+ * lib/tkextlib/tile.rb: ditto. (autoload support)
+
+2005-08-04 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: fixed: Tk::Tile::TProgressbar is
+ supported on tile 0.6 or later, not tile 0.5.
+
+ * sample/tkextlib/tile/demo.rb: updated scales demo to use
+ Tk::Tile::TProgressbar for tile 0.6 or later.
+
+ * sample/tkextlib/tile/demo.rb: set some TkVariable default values.
+
+2005-08-03 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile/treeview.rb: Tk::Tile::Treeview#headingconfigure
+ is now working and more. [ruby-dev:26716]
+
+ * sample/tkextlib/tile/demo.rb: use Tk::Tile::Treeview#headingconfigure instead of direct Tk.tk_call.
+
+2005-08-02 ocean <ocean@ruby-lang.org>
+
+ * lib/tkextlib/tile/tprogressbar.rb: Tk::Tile::TProgressbar#start
+ takes optional argument `interval'.
+
+ * sample/tkextlib/tile/demo.rb: emulate Tk::Tile::TProgressbar
+ with Tk::Tile::TProgress in tile 0.4. (repeating buttons demo)
+
+2005-08-02 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: added repeating buttons demo.
+
+ * sample/tkextlib/tile/repeater.tcl: ditto. (new file)
+
+2005-08-01 ocean <ocean@ruby-lang.org>
+
+ * lib/tkextlib/tile.rb: fixed autoload for Treeview.
+
+ * lib/tkextlib/tile/treeview.rb: replaced `ary2tk_list(items)' with
+ `*items'.
+
+ * sample/tkextlib/tile/demo.rb: added treeview demo. (tile 0.5 or
+ later is required) [ruby-dev:26668]
+
+2005-08-01 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: added combobox demo.
+
+2005-07-27 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/demo.rb: fixed typo.
+
+2005-06-16 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPOPRT_STATUS: add RELEASE_DATE information.
+
+ * lib/tkextlib/tile/style.rb: add "style element options <elem>"
+ command support.
+
+2005-06-08 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/ICONS/icons.rb: fail to create instances of
+ Tk::ICONS [ruby-dev:26305].
+
+2005-06-07 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/themes/kroc.{rb,tcl}: also support tile 0.4.
+
+2005-06-07 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/tile/themes/kroc.{rb,tcl}: support tile 0.5 or later.
+ ("pixmap" element constructor replaced by "image")
+
+2005-06-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/tile/demo.rb: fix TypeError & create Console
+
+2005-05-30 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt.rb: add PACKAGE_NAME information of Tcl/Tk
+ Extension.
+
+ * lib/tkextlib/bwidget.rb: ditto.
+
+ * lib/tkextlib/iwidgets.rb: ditto.
+
+ * lib/tkextlib/tile.rb: ditto.
+
+ * lib/tkextlib/tkimg.rb: ditto.
+
+ * lib/tkextlib/vu.rb: ditto.
+
+ * lib/tkextlib/ICONS/icons.rb: ditto.
+
+ * lib/tkextlib/itcl/incr_tcl.rb: ditto.
+
+ * lib/tkextlib/itk/incr_tk.rb: ditto.
+
+ * lib/tkextlib/tcllib/autoscroll.rb: ditto.
+
+ * lib/tkextlib/tcllib/ctext.rb: ditto.
+
+ * lib/tkextlib/tcllib/cursor.rb: ditto.
+
+ * lib/tkextlib/tcllib/datefield.rb: ditto.
+
+ * lib/tkextlib/tcllib/ico.rb: ditto.
+
+ * lib/tkextlib/tcllib/ip_entry.rb: ditto.
+
+ * lib/tkextlib/tcllib/plotchart.rb: ditto.
+
+ * lib/tkextlib/tcllib/style.rb: ditto.
+
+ * lib/tkextlib/tcllib/tkpiechart.rb: ditto.
+
+ * lib/tkextlib/tclx/tclx.rb: ditto.
+
+ * lib/tkextlib/tkDND/shape.rb: ditto.
+
+ * lib/tkextlib/tkDND/tkdnd.rb: ditto.
+
+ * lib/tkextlib/tkHTML/htmlwidget.rb: ditto.
+
+ * lib/tkextlib/tkimg/bmp.rb: ditto.
+
+ * lib/tkextlib/tkimg/gif.rb: ditto.
+
+ * lib/tkextlib/tkimg/ico.rb: ditto.
+
+ * lib/tkextlib/tkimg/jpeg.rb: ditto.
+
+ * lib/tkextlib/tkimg/pcx.rb: ditto.
+
+ * lib/tkextlib/tkimg/pixmap.rb: ditto.
+
+ * lib/tkextlib/tkimg/png.rb: ditto.
+
+ * lib/tkextlib/tkimg/ppm.rb: ditto.
+
+ * lib/tkextlib/tkimg/ps.rb: ditto.
+
+ * lib/tkextlib/tkimg/sgi.rb: ditto.
+
+ * lib/tkextlib/tkimg/sun.rb: ditto.
+
+ * lib/tkextlib/tkimg/tga.rb: ditto.
+
+ * lib/tkextlib/tkimg/tiff.rb: ditto.
+
+ * lib/tkextlib/tkimg/window.rb: ditto.
+
+ * lib/tkextlib/tkimg/xbm.rb: ditto.
+
+ * lib/tkextlib/tkimg/xpm.rb: ditto.
+
+ * lib/tkextlib/tktable/tktable.rb: ditto.
+
+ * lib/tkextlib/tktrans/tktrans.rb: ditto.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto.
+
+ * lib/tkextlib/winico/winico.rb: ditto.
+
+2005-05-25 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/iwidgets/scrolledlistbox.rb: follow the change
+ of tk.rb. modify to attend encoding.
+
+ * lib/tkextlib/iwidgets/scrolledtext.rb: ditto.
+
+ * lib/tkextlib/iwidgets/scrolledcanvas.rb: bug fix on
+ TkCanvas#delete when given non-TkcItem arguments.
+
+2005-05-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/winop.rb: fix typo
+
+2005-05-08 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/vu/pie.rb: fix typo
+
+2005-04-10 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/mailwasher.rb: fixed typo. [ruby-dev:26008]
+
+2005-04-09 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/tile/demo.rb: new demo of Tile extension.
+
+ * sample/tkextlib/tile/iconlib.tcl: part of the demo.
+
+ * sample/tkextlib/tile/toolbutton.tcl: ditto.
+
+ * sample/tkextlib/tile/readme.txt: document of the demo.
+
+ * sample/tkextlib/tile/Orig_LICENSE.txt: ditto.
+
+ * sample/tkextlib/tile/themes/kroc.tcl: sample theme written with Tcl.
+
+ * sample/tkextlib/tile/themes/pkgIndex.tcl: pkgIndex of kroc.tcl.
+
+ * sample/tkextlib/tile/themes/kroc.rb: Kroc theme written with Ruby.
+
+ * sample/tkextlib/tile/themes/kroc/button-h.gif: images for Kroc theme.
+
+ * sample/tkextlib/tile/themes/kroc/button-n.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/button-p.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/check-hc.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/check-hu.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/check-nc.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/check-nu.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/radio-hc.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/radio-hu.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/radio-nc.gif: ditto.
+
+ * sample/tkextlib/tile/themes/kroc/radio-nu.gif: ditto.
+
+ * lib/tkextlib/tile.rb: bug fix (tested on the new demo).
+
+ * lib/tkextlib/tile/style.rb: ditto.
+
+ * lib/tkextlib/tile/tbutton.rb: ditto.
+
+ * lib/tkextlib/tile/tcheckbutton.rb: ditto.
+
+ * lib/tkextlib/tile/tcombobox.rb: ditto.
+
+ * lib/tkextlib/tile/tentry.rb: ditto.
+
+ * lib/tkextlib/tile/tframe.rb: ditto.
+
+ * lib/tkextlib/tile/tlabel.rb: ditto.
+
+ * lib/tkextlib/tile/tlabelframe.rb: ditto.
+
+ * lib/tkextlib/tile/tmenubutton.rb: ditto.
+
+ * lib/tkextlib/tile/tnotebook.rb: ditto.
+
+ * lib/tkextlib/tile/tprogressbar.rb: ditto.
+
+ * lib/tkextlib/tile/tradiobutton.rb: ditto.
+
+ * lib/tkextlib/tile/treeview.rb: ditto.
+
+ * lib/tkextlib/tile/tscrollbar.rb: ditto.
+
+ * lib/tkextlib/tile/tseparator.rb: ditto.
+
+ * lib/tkextlib/tile/tsquare.rb: ditto.
+
+ * lib/tkextlib/tile/tpaned.rb: new library
+
+ * lib/tkextlib/tile/tscale.rb: ditto.
+
+ * lib/tkextlib/SUPPORT_STATUS: update support status of Tile extension.
+
+ * lib/tkextlib/tcllib/ctext.rb: use TkCommandNames on create_self().
+
+ * lib/tkextlib/tcllib/datefield.rb: ditto.
+
+ * lib/tkextlib/tcllib/ip_entry.rb: ditto.
+
+ * lib/tkextlib/tkHTML/htmlwidget.rb: ditto.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto.
+
+2005-04-09 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/explorer.rb: File.executable? returns true
+ even if it's plain text file. (this function only checks access right)
+
+2005-04-09 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/{help,www-options}.rb: fixed typo.
+ (click or resize column header)
+
+2005-04-09 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/imovie.rb: fixed typo. (click on clip title)
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/random.rb: fixed typo. (drop node outside of
+ widget, or reenter widget while dragging)
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/outlook-newgrounp.rb: image had disappered when
+ node was selected.
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/{random,outlook-newgroup}.rb:
+ tk::treectrl uses 'afterId' not 'afterID'.
+
+ * sample/tkextlib/treectrl/{random,outlook-newgroup}.rb:
+ item_firstchild can return empty string. (drop node to leaf node)
+
+ * sample/tkextlib/treectrl/random.rb: Enumerable#find didn't work properly
+ because tried to compare String with Integer. (drag node and leave widget)
+
+ * sample/tkextlib/treectrl/random.rb: and some fixes.
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * lib/tkextlib/treectrl/tktreectrl.rb (selection_clear): fixed typo.
+
+ * sample/tkextlib/treectrl/random.rb: node deselection now works.
+
+ * sample/tkextlib/treectrl/demo.rb: fixed typo. (popup menu on column header)
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/help.rb: fixed typo. (wrong color)
+
+2005-04-08 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/random.rb: fixed typo. (wrong itemheight)
+
+ * sample/tkextlib/treectrl/outlook-newgroup.rb: ditto.
+
+ * sample/tkextlib/treectrl/explorer.rb: ditto.
+
+ * sample/tkextlib/treectrl/help.rb: ditto.
+
+2005-04-07 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/*.rb: some speed up... cache the result of
+ version checking.
+
+2005-04-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: performance tuning by calling
+ tk_send_without_enc. [ruby-dev:25997]
+
+2005-04-04 ocean <ocean@ruby-lang.org>
+
+ * lib/tkextlib/tktable/tktable.rb: added Tk::TkTable#selection_present.
+
+2005-04-02 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: support TreeCtrl's cvs head.
+
+2005-04-02 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/component.rb: add TreeCtrl#legend_window_create().
+
+ * sample/tkextlib/blt/graph6.rb: use legend_window_create().
+
+ * lib/tkextlib/blt/tree.rb: forget to call tagid().
+
+ * lib/tkextlib/blt/treeview.rb: ditto.
+
+2005-04-01 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/treectrl/demo.rb: bridge the gap of
+ Hash#index or Hash#key between ruby 1.8 and 1.9
+
+2005-04-01 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/component.rb: bug fix on treatment of
+ component objects.
+
+ * sample/tkextlib/blt/graph6.rb: a new sample script.
+
+2005-03-31 ocean <ocean@ruby-lang.org>
+
+ * sample/tkextlib/treectrl/demo.rb: should use Hash#index.
+
+ * sample/tkextlib/treectrl/demo.rb: TkImage was not
+ cached properly.
+
+ * sample/tkextlib/treectrl/random.rb: fixed typo.
+
+2005-03-31 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/iwidgets/sample/hierarchy.rb: show basename
+ only [ruby-dev:25970]
+
+ * sample/tkextlib/treectrl/demo.rb: add check for existence of
+ 'backgroundimage' option.
+
+ * sample/tkextlib/treectrl/bitmaps.rb: ditto.
+
+ * sample/tkextlib/treectrl/outlook-newgroup.rb: lack of '%I'
+ event callback argument.
+
+2005-03-31 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/iwidgets/sample/hierarchy.rb: fail to treat
+ Japanese (i18n?) filenames.
+
+2005-03-30 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/bwidget/tree.rb: use 'return' in the Proc object.
+
+ * sample/tkextlib/tkHTML/hv.rb: ditto.
+
+ * sample/tkextlib/tkHTML/ss.rb: ditto.
+
+ * sample/tkextlib/tktable/basic.rb: ditto.
+
+ * sample/tkextlib/tktable/command.rb: ditto.
+
+ * sample/tkextlib/tktable/debug.rb: ditto.
+
+ * sample/tkextlib/tktable/maxsize.rb: ditto.
+
+ * sample/tkextlib/treectrl/demo.rb: ditto.
+
+2005-03-29 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/component.rb: cannot create elements except
+ default type of element.
+
+ * lib/tkextlib/blt/barchart.rb: ditto.
+
+ * lib/tkextlib/blt/graph.rb: ditto.
+
+ * lib/tkextlib/blt/stripchart.rb: ditto.
+
+ * lib/tkextlib/blt/component.rb: axis command option gets
+ proper object type of arguments.
+
+ * sample/tkextlib/blt/calendar.rb: new sample.
+
+ * sample/tkextlib/blt/pareto.rb: ditto.
+
+2005-03-28 ocean <ocean@ruby-lang.org>
+
+ * lib/tkextlib/iwidgets/notebook.rb: fixed typo.
+
+2005-03-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt.rb: add commands for zooming.
+
+ * lib/tkextlib/blt/bitmap.rb (new_with_name): add for using
+ given name.
+
+ * lib/tkextlib/blt/busy.rb: bug fix on Tk::BLT::Busy::Shild class.
+
+ * lib/tkextlib/blt/component.rb: typo fix.
+
+ * lib/tkextlib/blt/component.rb: fix lack of *_create methods
+
+ * lib/tkextlib/blt/component.rb: proper call on xaxis_* and so on.
+
+ * lib/tkextlib/blt/htext.rb: add TkVariable object to access
+ special Tcl variables.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: typo fix.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: proper treatment
+ of 'font' option of element_configure.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: bug fix on item_sort.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: add methods to
+ call TreeCtrl commands for bindings.
+
+ * sample/tkextlib/blt/*: add some sample scripts.
+
+ * sample/tkextlib/treectrl/*: add some sample scripts.
+
+2005-03-18 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: bug fix and define some
+ classes for components of Tk::TreeCtrl
+
+2005-03-17 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: call wrong method in
+ Tk::TreeCtrl#*_configinfo and current_*_configinfo method
+
+2005-03-16 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPORT_STATUS: change the status of TkImg
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: bug fix and support
+ TkTreeCtrl-1.1
+
+ * lib/tkextlib/SUPPORT_STATUS: change the supported version of
+ TkTreeCtrl
+
+2005-03-15 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * sample/tkextlib/tkimg: add sample
+
+2005-03-06 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPORT_STATUS: add version info of each extension
+
+2005-03-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile.rb: lack of "autoload TProgressbar"
+
+2005-03-05 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile.rb: support tile-0.6
+
+ * lib/tkextlib/tile/tbutton.rb: ditto
+
+ * lib/tkextlib/tile/tcheckbutton.rb: ditto
+
+ * lib/tkextlib/tile/tlabel.rb: ditto
+
+ * lib/tkextlib/tile/tmenubutton.rb: ditto
+
+ * lib/tkextlib/tile/tnotebook.rb: ditto
+
+ * lib/tkextlib/tile/tradiobutton.rb: ditto
+
+ * lib/tkextlib/tile/tcombobox.rb: [new] ditto
+
+ * lib/tkextlib/tile/tentry.rb: [new] ditto
+
+ * lib/tkextlib/tile/tframe.rb: [new] ditto
+
+ * lib/tkextlib/tile/tlabelframe.rb: [new] ditto
+
+ * lib/tkextlib/tile/tprogressbar.rb: [new] ditto
+
+ * lib/tkextlib/tile/treeview.rb: [new] ditto
+
+ * lib/tkextlib/tile/tscrollbar.rb: [new] ditto
+
+ * lib/tkextlib/tile/tseparator.rb: [new] ditto
+
+ * lib/tkextlib/tile/tsquare.rb: [new] ditto
+
+2005-02-20 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tclx/tclx.rb: warning TclX's 'signal' command.
+
+2005-01-25 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt/component.rb: bug fix. cannot accept
+ a callback ID string for a command argument. [ruby-dev:25479]
+
+ * lib/tkextlib/blt/tabset.rb: ditto
+
+ * lib/tkextlib/blt/treeview.rb: ditto
+
+ * lib/tkextlib/bwidget/labelentry.rb: ditto
+
+ * lib/tkextlib/bwidget/listbox.rb: ditto
+
+ * lib/tkextlib/bwidget/notebook.rb: ditto
+
+ * lib/tkextlib/bwidget/spinbox.rb: ditto
+
+ * lib/tkextlib/bwidget/tree.rb: ditto
+
+ * lib/tkextlib/itk/incr_tk.rb: ditto
+
+ * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto
+
+ * lib/tkextlib/tkDND/tkdnd.rb: ditto
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto
+
+ * sample/tkextlib/tkHTML/ss.rb: local variable scope bug fix
+ [ruby-dev:25479]
+
+ * sample/tkextlib/vu/vu_demo.rb: rename from vu.rb; avoid the bug on
+ Windows version of Tcl/Tk. The trouble based on the bug occurs when
+ the script name (without extension) is a same name as a Tcl/Tk's
+ library file name (without extension) required in the script.
+
+2004-12-24 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/blt: add BLT extension support
+
+2004-12-16 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/bwidget/labelentry.rb: use TkCore.callback_obj?()
+
+ * lib/tkextlib/bwidget/listbox.rb: ditto
+
+ * lib/tkextlib/bwidget/notebook.rb: ditto
+
+ * lib/tkextlib/bwidget/spinbox.rb: ditto
+
+ * lib/tkextlib/itk/incr_tk.rb: ditto
+
+ * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto
+
+ * lib/tkextlib/tkDND/tkdnd.rb: ditto
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto
+
+ * lib/tkextlib/winico/winico.rb: ditto
+
+2004-12-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile/style.rb: 'theme_use' method bug fix
+
+2004-12-08 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/bwidget/notebook.rb: raise method cannot return
+ the raised page.
+
+ * lib/tkextlib/bwidget/labelentry.rb: bind methods accept
+ subst_args + block
+
+ * lib/tkextlib/bwidget/listbox.rb: ditto
+
+ * lib/tkextlib/bwidget/notebook.rb: ditto
+
+ * lib/tkextlib/bwidget/spinbox.rb: ditto
+
+ * lib/tkextlib/bwidget/tree.rb: ditto
+
+ * lib/tkextlib/itk/incr_tk.rb: ditto
+
+ * lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto
+
+ * lib/tkextlib/tkDND/tkdnd.rb: ditto
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto
+
+2004-11-26 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/bwidget/notebook.rb: uses epath
+
+ * lib/tkextlib/bwidget/widget.rb: ditto
+
+ * lib/tkextlib/tktable/tktable.rb: ditto
+
+ * lib/tkextlib/tcllib/cursor.rb: ditto, and bug fix
+
+2004-11-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tile/style.rb: bug fix
+
+2004-11-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/iwidgets/scrolledcanvas.rb: bind-event methods
+ accept multi substitution arguments.
+
+ * lib/tkextlib/tktable/tktable.rb: ditto.
+
+ * lib/tkextlib/treectrl/tktreectrl.rb: ditto
+
+2004-11-03 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/SUPPORT_STATUS: BLT moves to 'plan to support'
+ from 'not determined'
+
+ * lib/tkextlib/itk/incr_tk.rb: __cget_cmd and __config_cmd are
+ private methods
+
+ * lib/tkextlib/tcllib/autoscroll.rb: extend TkCore
+
+ * lib/tkextlib/tcllib/cursor.rb: ditto.
+
+ * lib/tkextlib/tcllib/plotchart.rb: ditto.
+
+ * lib/tkextlib/tcllib/style.rb: ditto.
+
+ * lib/tkextlib/tile/style.rb: ditto.
+
+ * lib/tkextlib/tkDND/shape.rb: ditto.
+
+2004-10-24 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/bwidget/tree.rb: bug fix on Windows
+
+2004-10-16 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/tcllib/ico.rb: new library (Tk::Tcllib:ICO)
+
+ * lib/tkextlib/tcllib.rb: add Tk::Tcllib::ICO (based on tcllib 1.7)
+
+2004-10-06 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/bwidget.rb (BWidget.grab): bug fix
+
+ * lib/tkextlib/tcllib.rb: typo fix
+
+2004-07-28 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/add winico support
+
+2004-07-23 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * lib/tkextlib/add TclX support (partially; infox command and
+ XPG/3 MsgCat only)
+
+2004-07-15 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * bug fix
+
+ * support TkTable extension
+
+2004-07-12 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * bug fix
+
+ * support Iwidgets extension
+
+2004-07-10 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * bug fix
+
+ * add more part of [incr Widget] support (about 65%? are complete)
+
+ * use Tk::ValidateConfigure.__def_validcmd() method
+ (new function to define validatecommand methods easier)
+
+ * tcllib.rb : avoid the loading trouble that almost all part of
+ the extension is not available when some libraries are invalid.
+
+2004-07-09 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * add some part of [incr Widget] support (about 50%? are complete)
+
+2004-07-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * add [incr Tck], [incr Tk] support
+
+2004-07-06 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * support BWidget extension
+
+ * add BWidget extension demo
+
+ * add ICONS extension demo
+
+ * many bug fix
+
+2004-07-01 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * 1st release of tkextlib ( to support Tcl/Tk extensions )
diff --git a/ext/tk/MANUAL_tcltklib.eng b/ext/tk/MANUAL_tcltklib.eng
new file mode 100644
index 0000000000..957e8ec840
--- /dev/null
+++ b/ext/tk/MANUAL_tcltklib.eng
@@ -0,0 +1,473 @@
+(tof)
+ 2005/07/05 Hidetoshi NAGAI
+
+This document discribes 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).
+
+==============================================================
+module TclTklib
+ : Defines methods to do operations which are independed on
+ : Tcl/Tk interpreters
+
+ module TclTkLib::EventFlag
+ : Defines flags to define target events on 'do_one_event' methods.
+ : When to give, please use bit-operator (e.g. WINDOW | DONT_WAIT).
+
+ [constants]
+ NONE
+ : Is 0. It means "there is no target". But on the real
+ : operation, it is same to ALL.
+
+ WINDOW
+ : 'window' event is processed.
+
+ FILE
+ : 'file' event is processed.
+
+ TIMER
+ : 'timer' event is processed.
+
+ IDLE
+ : 'idle' operation (e.g. 're-draw'; the operations when the
+ : other kinds of events doesn't occur) is processed.
+
+ ALL
+ : All kinds of events are processed.
+ : Same to 'WINDOW | FILE | TIMER | IDLE'.
+
+ DONT_WAIT
+ : Without this flag, 'do_one_event' waits the occurrence of
+ : a target event. With this flag, doesn't wait and returns
+ : false if there is no target event for processing.
+
+ module TclTkLib::VarAccessFlag
+ : Defines flags to give '_get_variable' and so on. When to give,
+ : please use bit-operator (e.g. GLOBAL_ONLY | LEAVE_ERR_MSG ).
+
+ [constants]
+ NONE
+ : Is 0. It means "set no flag".
+
+ GLOBAL_ONLY
+ : (site Tcl/Tk's man page)
+ : Under normal circumstances the procedures look up
+ : variables as follows: If a procedure call is active
+ : in interp, a variable is looked up at the current
+ : level of procedure call. Otherwise, a variable is
+ : looked up first in the current namespace, then in
+ : the global namespace. However, if this bit is set
+ : in flags then the variable is looked up only in the
+ : global namespace even if there is a procedure call
+ : active. If both GLOBAL_ONLY and NAMESPACE_ONLY are
+ : given, GLOBAL_ONLY is ignored.
+ :
+ : *** ATTENTION ***
+ : Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
+ : is defined as 0, and then GLOBAL_ONLY is available
+ : even if flag is (GLOBAL_ONLY | NAMESPACE_ONLY).
+
+ NAMESPACE_ONLY
+ : (site Tcl/Tk's man page)
+ : Under normal circumstances the procedures look up
+ : variables as follows: If a procedure call is active
+ : in interp, a variable is looked up at the current
+ : level of procedure call. Otherwise, a variable is
+ : looked up first in the current namespace, then in
+ : the global namespace. However, if this bit is set
+ : in flags then the variable is looked up only in the
+ : current namespace even if there is a procedure call
+ : active.
+ :
+ : *** ATTENTION ***
+ : Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
+ : is defined as 0.
+
+ LEAVE_ERR_MSG
+ : (site Tcl/Tk's man page)
+ : If an error is returned and this bit is set in flags,
+ : then an error message will be left in the interpreter's
+ : result, where it can be retrieved with Tcl_GetObjResult
+ : or Tcl_GetStringResult. If this flag bit isn't set then
+ : no error message is left and the interpreter's result
+ : will not be modified.
+
+ APPEND_VALUE
+ : (site Tcl/Tk's man page)
+ : If this bit is set then newValue is appended to the
+ : current value, instead of replacing it. If the variable
+ : is currently undefined, then this bit is ignored.
+
+ LIST_ELEMENT
+ : (site Tcl/Tk's man page)
+ : If this bit is set, then newValue is converted to a
+ : valid Tcl list element before setting (or appending
+ : to) the variable. A separator space is appended before
+ : the new list element unless the list element is going
+ : to be the first element in a list or sublist (i.e. the
+ : variable's current value is empty, or contains the
+ : single character ``{'', or ends in `` }'').
+
+ PARSE_VARNAME
+ : (site Tcl/Tk's man page)
+ : If this bit is set when calling _set_variable and so
+ : on, var_name argument may contain both an array and an
+ : element name: if the name contains an open parenthesis
+ : and ends with a close parenthesis, then the value
+ : between the parentheses is treated as an element name
+ : (which can have any string value) and the characters
+ : before the first open parenthesis are treated as the
+ : name of an array variable. If the flag PARSE_VARNAME
+ : is given, index_name argument should be 'nil' since the
+ : array and element names are taken from var_name.
+ :
+ : *** ATTENTION ***
+ : Tcl7.6 doesn't have this flag. So PARSE_VARNAME is
+ : defined as 0.
+
+ module TclTkLib::RELEASE_TYPE
+ : Defines release type number of Tcl/Tk
+
+ ALPHA
+ : ALPHA release
+
+ BETA
+ : BETA release
+
+ FINAL
+ : FINAL release
+
+ [module methods]
+ get_version()
+ : return an array of major, minor, release-type number,
+ : and patchlevel of current Tcl/Tk library.
+
+ mainloop(check_root = true)
+ : Starts the eventloop. If 'check_root' is true, this method
+ : doesn't return when a root widget exists.
+ : If 'check_root' is false, doesn't return by the other
+ : reasons than exceptions.
+
+ mainloop_thread?
+ : Returns whether the current thread executes the eventloop.
+ : If true, the eventloop is working on the current thread.
+ : If no eventloop is working, this method returns nil.
+ : And if the other thread executes the eventloop, returns false.
+ :
+ : *** ATTENTION ***
+ : When this methods returns false, it is dangerous to call a Tk
+ : interpreter directly.
+
+ mainloop_watchdog(check_root = true)
+ : On the normal eventloop, some kinds of callback operations
+ : cause deadlock. To avoid some of such deadlocks, this
+ : method starts an eventloop and a watchdog-thread.
+
+ do_one_event(flag = TclTkLib::EventFlag::ALL |
+ TclTkLib::EventFlag::DONT_WAIT)
+ : Do one event for processing. When processed an event,
+ : returns true.
+ : If NOT set DONT_WAIT flag, this method waits occurrence of
+ : 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,
+ : force to set DONT_WAIT flag.
+
+ set_eventloop_tick(timer_tick)
+ : Define the interval of thread-switching with an integer
+ : value of mili-seconds.
+ : Default timer_tick is 0. It means that thread-switching
+ : is based on the count of processed events.
+ : ( see 'set_eventloop_weight' method )
+ : 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'
+
+ set_no_event_wait(no_event_wait)
+ : Define sleeping time of the eventloop when two or more
+ : thread are running and there is no event for processing.
+ : 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'.
+
+ set_eventloop_weight(loop_max, no_event_tick)
+ : Define the weight parameters for the eventloop thread.
+ : That is invalid when the eventloop is the only thread.
+ : 'loop_max' is the max events for thread-switching.
+ : 'no_event_tick' is the increment value of the event count
+ : 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'.
+
+ 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 nil, no warning message and ignore the exception.
+ : This parameter is sometimes useful when multiple Tk
+ : interpreters are working. Because the only one eventloop
+ : admins all Tk interpreters, sometimes exception on a
+ : 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.
+
+ num_of_mainwindows
+ : Returns the number of main-windows (root-widget).
+ : Because there is only one main-window for one Tk interpreter,
+ : the value is same to the number of interpreters which has
+ : available Tk functions.
+
+ _merge_tklist(str, str, ... )
+ : Get a Tcl's list string from arguments with a Tcl/Tk's
+ : library function. Each arguemnt is converted to a valid
+ : Tcl list element.
+
+ _conv_listelement(str)
+ : Convert the argument to a valid Tcl list element with
+ : Tcl/Tk's library function.
+
+ _toUTF8(str, encoding=nil)
+ _fromUTF8(str, encoding=nil)
+ : Call the function (which is internal function of Tcl/Tk) to
+ : convert to/from a UTF8 string.
+
+ _subst_UTF_backslash(str)
+ _subst_Tcl_backslash(str)
+ : Substitute backslash sequence with Tcl's rule (include \uhhhh;
+ : give a sixteen-bit hexadecimal value for Unicode character).
+ : _subst_Tcl_backslash method parses all backslash sequence.
+ : _subst_UTF_backslash method parses \uhhhh only.
+
+ encoding_system
+ encoding_system=(encoding)
+ : Get and set Tcl's system encoding.
+
+ encoding
+ encoding=(encoding)
+ : alias of encoding_system / encoding_system=
+ : ( probably, Ruby/Tk's tk.rb will override them )
+
+
+class TclTkIp
+ [class methods]
+ new(ip_name=nil, options='')
+ : Generate an instance of TclTkIp class.
+ : If 'ip_name' argument is given as a string, it is the name
+ : of the Tk interpreter which is shown by 'winfo interps'
+ : command.
+ : 'options' argument accepts a string which is the command
+ : line options of wish; such as '-geometry' or '-use'.
+ : The information is used to generate the root widget of the
+ : interpreter.
+ : ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
+ : If is given nil or false for the 'option' argument, generates
+ : the Tcl interpreter without Tk library. Then the interpreter
+ : doesn't need GUI environment. Therefore, even if a window
+ : system doesn't exist or cannot be used, Ruby can control the
+ : Tcl interpreter and the extension libraries loaded on the
+ : interpreter.
+
+ [instance methods]
+ create_slave(name, safe=false)
+ : Create a slave interpreter.
+ : The parent of the interpreter is the receiver of this method.
+ : The name of the slave interpreter is given by 'name' argument.
+ : The 'safe' argument decides whether the slave interpreter is
+ : created as a safe interpreter or not. If true, create a safe
+ : 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
+ : self. If fail, raise RuntimeError.
+
+ safe?
+ : Check whether the interpreter is the safe interpreter.
+ : If is the safe interpreter, returns true.
+
+ allow_ruby_exit?
+ : Return the mode whether 'exit' function of ruby or 'exit'
+ : command of Tcl/Tk can quit the ruby process or not on the
+ : interpreter. If false, such a command quit the interpreter
+ : only.
+ : The default value for a master interpreter is true, and
+ : for a slave interpreter is false.
+
+ allow_ruby_exit=(mode)
+ : Change the mode of 'allow_ruby_exit?'.
+ : If $SAFE >= 4 or the interpreter is a "safe" interpreter,
+ : this is not permitted (raise an exception).
+
+ delete
+ : Delete the interpreter.
+ : The deleted interpreter doesn't accept command and then
+ : raise an exception.
+
+ deleted?
+ : Check whether the interpreter is already deleted.
+ : If deleted, returns true.
+
+ has_mainwindow?
+ : Check whether the interpreter has a MainWindow (root widget).
+ : If has, returns true. If doesn't, returns false.
+ : If IP is already deleted, returns nil.
+
+ restart
+ : 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)
+ : Estimates the arguments as a command on the Tk interpreter.
+ : The argument of _eval is a script of Tcl/Tk.
+ : Each argument of _invoke is a token of one command line of
+ : Tcl/Tk.
+ : Because the operation of _invoke doesn't through the
+ : command line parser of Tk interpreter, the cost of
+ : estimation is smaller than _eval. However, auto_load
+ : mechanism of the Tk interpreter doesn't work on _invoke.
+ : So _invoke can call only the command which already
+ : registered on the interpreter by 'load' command and so on.
+ : On _eval command, auto_load mechanism words. So if succeed
+ : to _eval and register the command once, after that, the
+ : command can be called by _invoke.
+
+ _cancel_eval(str)
+ _cancel_eval_unwind(str)
+ : (Tcl/Tk8.6 or later)
+ : Call Tcl_CancelEval() function, and cancel evaluation.
+
+ _toUTF8(str, encoding=nil)
+ _fromUTF8(str, encoding=nil)
+ : Call the function (which is internal function of Tcl/Tk) to
+ : convert to/from a UTF8 string.
+
+ _thread_vwait(var_name)
+ _thread_tkwait(mode, target)
+ : 'vwait' or 'tkwait' with thread support.
+ : The difference from normal 'vwait' or 'tkwait' command is
+ : doing independent wait from the vwait stack when they are
+ : called on the other thread than the eventloop thread.
+ : In the case of Tcl/Tk's vwait / tkwait, if 2nd vwait /
+ : tkwait is called on waiting for 1st vwait / tkwait,
+ : returns the order of [2nd]->[1st] regardless of the order
+ : of when the wait condition was fulfilled.
+ : If _thread_vwait / _thread_tkwait is called on the
+ : eventloop thread, there is no difference from vwait /
+ : tkwait. But if called on the other thread than the
+ : eventloop, stops the thread. And when the wait condition
+ : is fulfilled, the thread restarts. The meaning of
+ : "independent from the vwait stack" is that the timing of
+ : restarting is independent from the waiting status of the
+ : other threads. That is, even if the eventloop thread is
+ : waiting by vwait and is not fulfilled the condition,
+ : _thread_vwait completes the waiting when its waiting
+ : condition is fulfilled and the thread which stopped by
+ : _thread_vwait can continue the operation.
+
+ _return_value
+ : Get the last result value on the interpreter.
+
+ _get_variable(var_name, flag)
+ _get_variable2(var_name, index_name, flag)
+ : Get the current value of a variable. If specified a
+ : index_name (see also the PARSE_VARNAME flag), get the
+ : value of the index_name element.
+
+ _set_variable(var_name, value, flag)
+ _set_variable2(var_name, index_name, value, flag)
+ : Create or modify a variable. If specified a index_name
+ : (see also the PARSE_VARNAME flag), create or modify the
+ : index_name element.
+
+ _unset_variable(var_name)
+ _unset_variable2(var_name, index_name)
+ : Remove a variable. If specified a index_name (see also
+ : the PARSE_VARNAME flag), remove the index_name element.
+
+ _get_global_var(var_name)
+ _get_global_var2(var_name, index_name)
+ _set_global_var(var_name, value)
+ _set_global_var2(var_name, index_name, value)
+ _unset_global_var(var_name)
+ _unset_global_var2(var_name, index_name)
+ : Call the associated method with the flag argument
+ : (GLOBAL_ONLY | LEAVE_ERR_MSG).
+
+ _split_tklist(str)
+ : Split the argument with Tcl/Tk's library function and
+ : get an array as a list of Tcl list elements.
+
+ _merge_tklist(str, str, ... )
+ : Get a Tcl's list string from arguments with a Tcl/Tk's
+ : library function. Each arguemnt is converted to a valid
+ : Tcl list element.
+
+ _conv_listelement(str)
+ : Convert the argument to a valid Tcl list element with
+ : Tcl/Tk's library function.
+
+ mainloop
+ mainloop_watchdog
+ : If on the slave interpreter, never start an eventloop and
+ : returns nil.
+ : With the exception that, same to the TclTkLib module method
+ : with the same name.
+
+ do_one_event
+ : With the exception that the argument is forced to set
+ : DONT_WAIT flag on the slave interpreter, same to
+ : TclTkLib#do_one_event.
+
+ set_eventloop_tick
+ get_eventloop_tick
+ set_no_event_wait
+ get_no_event_wait
+ set_eventloop_weight
+ get_eventloop_weight
+ mainloop_abort_on_exception
+ mainloop_abort_on_exception=
+ : With the exception that it is ignored to set value on the
+ : slave interpreter, same to the TclTkLib module method with
+ : the same name.
+
+ encoding_table
+ : For Ruby m17n. Return encoding relation table between Ruby's
+ : Encoding object and Tcl's encoding name.
+
+class TkCallbackBreak < StandardError
+class TkCallbackContinue < StandardError
+ : They are exception classes to break or continue the Tk callback
+ : operation.
+ : If raise TkCallbackBreak on the callback procedure, Ruby returns
+ : 'break' code to Tk interpreter (Then the Tk interpreter will
+ : break the operation for the current event).
+ : If raise TkCallbackContinue, returns 'continue' code (Then the Tk
+ : interpreter will break the operation for the current bindtag and
+ : starts the operation for the next bindtag for the current event).
+ : However, current tcltklib supports Ruby's 'break' and 'next' to
+ : get the same effect. That is, those classes are obsolete. Those
+ : exist for backward compatibility.
+
+(eof)
diff --git a/ext/tk/MANUAL_tcltklib.ja b/ext/tk/MANUAL_tcltklib.ja
new file mode 100644
index 0000000000..1de1736f9f
--- /dev/null
+++ b/ext/tk/MANUAL_tcltklib.ja
@@ -0,0 +1,584 @@
+(tof)
+ 2005/07/05 Hidetoshi NAGAI
+
+本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明
+が含まれていますが,その記述内容は古いものとなっています.
+
+tcltk ライブラリ(tcltk.rb)は現在ではメンテナンスが事実上行われて
+いないため,古いドキュメントの説明がそのまま有効です.それに対し,
+tcltklib ライブラリについては,現在の Ruby/Tk(tk.rb 以下のライブラ
+リ群)を稼働させるための中心としてメンテナンスされているため,少々
+違いが生じています.
+
+そこで,まず古い説明文書を示した後,現在の tcltklib ライブラリにつ
+いての説明を加えます.
+
+以下がライブラリの古い説明文書です.
+==============================================================
+ MANUAL.euc
+ Sep. 19, 1997 Y. Shigehiro
+
+以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう
+ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ
+リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します.
+
+<< tcltk ライブラリ >>
+
+tcl/tk の C ライブラリを利用するための高(中?)水準インターフェースを提
+供します.
+
+このライブラリは ruby から tcl/tk ライブラリを利用するためのもので, 内
+部で tcltklib ライブラリを利用しています.
+
+[説明]
+
+tcl/tk インタプリタでは, ウィジェットに何か指示を送るには, ウィジェッ
+ト名に続いてパラメータを書きます. したがって, ウィジェットがオブジェク
+トであり, それに対してメソッドを送っている, とみなすことができます. さ
+て, tcl/tk インタプリタでは, 組み込みコマンドも, 前述のウィジェットと
+同じような書式の命令で実行されます. すなわち, コマンドもオブジェクトで
+あると考えることができます.
+
+このような考えに基づき, tcltk ライブラリでは, tcl/tk のコマンドやウィ
+ジェットに対応するオブジェクトを生成します. オブジェクトに対するメソッ
+ド呼び出しは, e() メソッドにより実行されます. 例えば, tcl/tk の info
+コマンドに対応する ruby のオブジェクトが info という名前であるとすると,
+tcl/tk の
+ info commands
+という命令は tcltk ライブラリでは
+ info.e("commands")
+と記述されます. また, 「.」というウィジェット (wish 実行時に自動的に生
+成されるルートウィジェット) に対応する ruby のオブジェクトが root とい
+う名前であるとすると,
+ . configure -height 300 -width 300
+という tcl/tk の命令は
+ root.e("configure -height 300 -width 300")
+と記述されます. このような記述は, 見ためには美しくありませんが, そして,
+スクリプトを読む人には見づらいかも知れませんが, 実際にスクリプトを書い
+てみると予想外に手軽です.
+
+[使用法]
+
+1. ライブラリを読み込む.
+ require "tcltk"
+
+2. tcl/tk インタプリタを生成する.
+ ip = TclTkInterpreter.new()
+
+3. tcl/tk のコマンドに対応するオブジェクトを変数に代入しておく.
+ # コマンドに対応するオブジェクトが入った Hash を取り出す.
+ c = ip.commands()
+ # 使いたいコマンドに対応するオブジェクトを個別の変数に代入する.
+ bind, button, info, wm = c.indexes("bind", "button", "info", "wm")
+
+4. 必要な処理を行う.
+ 詳しくは, サンプルを参照のこと.
+
+5. 準備ができたら, イベントループに入る.
+ TclTk.mainloop()
+
+(( 以下, モジュール, クラス等の説明を書く予定.))
+
+
+
+<< tcltklib ライブラリ >>
+
+tcl/tk の C ライブラリを利用するための低水準インターフェースを提供しま
+す.
+
+コンパイル/実行には, tcl/tk の C ライブラリが必要です.
+
+[説明]
+
+このライブラリを用いると, ruby から tcl/tk の C ライブラリを利用できま
+す. 具体的には, ruby インタプリタから tcl/tk インタプリタを呼び出すこ
+とができます. さらに, その(ruby インタプリタから呼び出した) tcl/tk イ
+ンタプリタから, 逆に ruby インタプリタを呼び出すこともできます.
+
+[使用法]
+
+require "tcltklib" すると, 以下のモジュール, クラスが利用可能です.
+
+モジュール TclTkLib
+ tcl/tk ライブラリを呼び出すメソッドを集めたモジュールです. ただし,
+ tcl/tk インタプリタ関係のメソッドはクラス TclTkIp にあります.
+
+ モジュールメソッド mainloop()
+ Tk_MainLoop を実行します. 全ての tk のウインドウが無くなると終了
+ します(例えば, tcl/tk で書くところの "destroy ." をした場合等).
+ 引数: 無し
+ 戻り値: nil
+
+クラス TclTkIp
+ インスタンスが tcl/tk のインタプリタに対応します. tcl/tk のライブ
+ ラリの仕様通り, インスタンスを複数個生成しても正しく動作します(そ
+ んなことをする必要はあまり無いはずですが). インタプリタは wish の
+ tcl/tk コマンドを実行できます. さらに, 以下のコマンドを実行できま
+ す.
+ コマンド ruby
+ 引数を ruby で実行します(ruby_eval_string を実行します). 引数
+ は 1 つでなければなりません. 戻り値は ruby の実行結果です.
+ ruby の実行結果は nil か String でなければなりません.
+
+ クラスメソッド new()
+ TclTkIp クラスのインスタンスを生成します
+ 引数: 無し
+ 戻り値 (TclTkIp): 生成されたインスタンス
+
+ メソッド _eval(script)
+ インタプリタで script を評価します(Tcl_Eval を実行します). 前述
+ のように, ruby コマンドにより script 内から ruby スクリプトを実
+ 行できます.
+ 引数: script (String) - インタプリタで評価するスクリプト文字列
+ 戻り値 (String): 評価結果 ((Tcl_Interp *)->result)
+
+ メソッド _return_value()
+ 直前の Tcl_Eval の戻り値を返します. 0(TCL_OK) で正常終了です.
+ 引数: 無し
+ 戻り値 (Fixnum): 直前の Tcl_Eval() が返した値.
+
+==============================================================
+
+以下が本ドキュメント作成時点での tcltklib ライブラリの説明です.
+==============================================================
+モジュール TclTkLib
+ : 個々の Tcl/Tk インタープリタに依存しない処理 ( == イベントルー
+ : プに関する処理 ) を呼び出すメソッドを定義したモジュール.
+
+ モジュール TclTkLib::EventFlag
+ : do_one_event を呼び出す際の処理対象イベントを指定するための
+ : フラグ ( WINDOW|DONT_WAIT というようにビット演算子で連結して
+ : 指定 ) を定数として定義したモジュール.以下の定数が含まれる.
+
+ 定数 NONE
+ : 値は 0 で,値としてはいかなる種類のイベントも指定していない
+ : ことになるが,実際の処理上は ALL と同じとして扱われる.
+
+ 定数 WINDOW
+ : window イベントを処理対象とする
+
+ 定数 FILE
+ : file イベントを処理対象とする
+
+ 定数 TIMER
+ : timer イベントを処理対象とする
+
+ 定数 IDLE
+ : アイドルループ処理 ( 再描画など,他の種類のイベントが発生
+ : していないときに行われる処理 ) を処理対象とする
+
+ 定数 ALL
+ : すべての種類のイベントを処理対象とする
+ : WINDOW|FILE|TIMER|IDLE と同じ
+
+ 定数 DONT_WAIT
+ : 処理対象イベントが存在しない場合に,イベント発生を待たず
+ : に do_one_event を終了 ( false を返す ) する
+
+ モジュール TclTkLib::VarAccessFlag
+ : _get_variable などでのフラグを指定するためのもの.フラグに
+ : は以下の定数を OR で連結して与える.
+
+ 定数 NONE
+ : 値は 0 で,何もフラグを指定していないのに等しい.
+
+ 定数 GLOBAL_ONLY
+ : 通常,変数の検索はまず手続き呼び出しを行ったレベルで検
+ : 索し,次に現在の名前空間で検索,最後にグローバル空間で
+ : 検索を行う.しかし,このフラグが指定された場合には,グ
+ : ローバル空間でのみ検索する.
+ : もし GLOBAL_ONLY と NAMESPACE_ONLY とが両方指定された場
+ : 合には,GLOBAL_ONLY の指定は無視される.
+
+ 定数 NAMESPACE_ONLY
+ : このフラグが指定された場合には,現在の名前空間でのみ変
+ : 数の検索を行う.GLOBAL_ONLY の説明も参照すること.
+
+ 定数 LEAVE_ERR_MSG
+ : 変数アクセスにおいてエラーが発生した場合,このフラグが
+ : 指定されていれば,実行結果として Tcl インタープリタにエ
+ : ラーメッセージが残される.このフラグが指定されていなけ
+ : れば,エラーメッセージは一切残されない.
+
+ 定数 APPEND_VALUE
+ : このフラグが指定されていた場合,変数の値を置き換えので
+ : はなく,現在の値に代入値が追加 (append; 文字列連結) さ
+ : れる.変数が未定義あった場合,このフラグは無視される.
+
+ 定数 LIST_ELEMENT
+ : このフラグが指定されていた場合,代入値はまず Tcl のリス
+ : ト要素として適切となるように変換される.代入値がリスト
+ : (またはサブリスト) の最初の要素となるのでない限り,代入
+ : 値の直前には空白文字が追加される.
+
+ 定数 PARSE_VARNAME
+ : _set_variable などの呼び出しにおいてこのフラグが指定さ
+ : れていた場合,var_name 引数が連想配列名と要素名とを両方
+ : 含む可能性がある (開き括弧を含み,閉じ括弧で終わる) こ
+ : とを示す.その場合,括弧の間が要素名指定,最初の開き括
+ : 弧までが連想配列名として扱われる._set_variable2 などで
+ : このフラグを指定する場合,連想配列名と要素名は var_name
+ : から抽出されるはずであるから,index_name 引数は nil と
+ : せねばならない.
+
+ モジュール TclTkLib::RELEASE_TYPE
+ : Tcl/Tk のリリースタイプ番号の定義
+
+ 定数 ALPHA
+ : ALPHA リリース
+
+ 定数 BETA
+ : BETA リリース
+
+ 定数 FINAL
+ : FINAL リリース
+
+ モジュールメソッド
+ get_version()
+ : Tcl/Tk の major, minor, release-type 番号, patchlevel を
+ : 配列にして返す.
+
+ mainloop(check_root = true)
+ : イベントループを起動する.check_root が true であれば,
+ : root widget が存在する限り,このメソッドは終了しない.
+ : check_root が false の場合は,root widget が消滅しても
+ : このメソッドは終了しない ( root widget が消滅しても,
+ : WINDOW 以外のイベントは発生しうるため ).終了には,外部
+ : からの働き掛け ( スレッドを活用するなど ) が必要.
+
+ mainloop_thread?
+ : カレントスレッドがイベントループを実行しているスレッド
+ : かどうかを返す.
+ : イベントループを実行しているスレッドであれば true を,
+ : どのスレッドでもイベントループが実行されていない場合は
+ : nil を,他のスレッドでイベントループが実行されている場
+ : 合は false を返す.
+ : false の際に Tk インタープリタを直接呼ぶのは危険である.
+
+ mainloop_watchdog(check_root = true)
+ : 通常のイベントループでは,イベント処理の内容によっては
+ : デッドロックを引き起こす可能性がある (例えばイベントに
+ : 対するコールバック処理中で widget 操作をし,その終了を
+ : 待つなど).このメソッドは,そうしたデッドロックを回避す
+ : るための監視スレッド付きでイベントループを起動する
+ : ( 監視スレッドを生成した後にイベントループを実行する ).
+ : 引数の意味は mainloop と同じである.
+
+ do_one_event(flag = TclTkLib::EventFlag::ALL |
+ TclTkLib::EventFlag::DONT_WAIT)
+ : 処理待ちのイベント 1 個を実行する.
+ : イベントを処理した場合は true を返す.
+ : フラグで DONT_WAIT を指定していない場合,フラグで処理対
+ : 象となっている種類のイベントが発生するまで待ち続ける.
+ : DONT_WAIT を指定していた場合,処理対象イベントがなくても
+ : すぐに終了し false を返す.
+ : $SAFE >= 4 か,$SAFE >= 1 かつ flag が汚染されているならば
+ : flag には DONT_WAIT が強制的に付けられる.
+
+ set_eventloop_tick(timer_tick)
+ : イベントループと同時に別スレッドが稼働している場合に,時
+ : 間に基づいた強制的なスレッドスイッチングをどの程度の頻度
+ : ( 時間間隔 ) で発生させるかをミリ秒単位の整数値で指定する.
+ : 0 を指定すると,この強制的なスイッチングは行われない.
+ : 標準では 0 に設定されており,イベント処理数に基づくスイッ
+ : チングだけが行われる ( see set_eventloop_weight ).
+ : ただし,稼働しているスレッドがイベントループだけの場合,
+ : timer_tick を 0 に設定することはできない.もし設定されて
+ : いたら,100 ms ( see NO_THREAD_INTERRUPT_TIME ) に自動設
+ : 定される.
+ : 詳細な説明は略すが,これは CPU パワーを節約しつつ安全で
+ : 安定した動作を実現するために実装した仕様である.
+ : $SAFE >= 4 では実行が禁止される.
+
+ get_eventloop_tick
+ : timer_tick の現在値を返す.
+
+ set_no_event_wait(no_event_wait)
+ : 複数のスレッドが稼働している場合で,処理待ちイベントが全
+ : く存在しなかった際に sleep 状態に入る時間長を指定する.
+ : 稼働スレッドがイベントループだけの場合には意味をなさない.
+ : デフォルトの値は 20 (ms)
+ : $SAFE >= 4 では実行が禁止される.
+
+ get_no_event_wait
+ : no_event_wait の現在値を返す.
+
+ set_eventloop_weight(loop_max, no_event_tick)
+ : 複数のスレッドが稼働している際に Ruby/Tk のイベントルー
+ : プに割り当てる比重を定めるためのパラメータを設定する.
+ : 稼働スレッドがイベントループだけの場合には意味をなさない.
+ : 一度のスレッド切り替えの間に処理するイベントの最大数と,
+ : 処理待ちのイベントが存在しない際の加算数とを設定する.
+ : 処理待ちイベントが存在しない場合は no_event_wait ( see
+ : set_no_event_wait ) だけの間 sleep 状態に入る.
+ : デフォルトではそれぞれ 800 回と 10 回,つまり,800 個のイ
+ : ベント (アイドルイベントを含む) を処理するとか,イベント
+ : が全く発生しないままに 80 回の処理待ちイベント検査が完了
+ : するとかでカウントが 800 以上になるとスレッドスイッチング
+ : が発生することになる.
+ : $SAFE >= 4 では実行が禁止される.
+
+ get_eventloop_weight
+ : 現在の loop_max と no_event_tick との値を返す.
+ : ( see set_eventloop_wait )
+
+ mainloop_abort_on_exception=(bool)
+ : Tk インタープリタ上で例外を発生した際に,イベントループを
+ : エラー停止させるかどうかを指定する.true を指定した場合は
+ : エラー停止するが,false の場合は例外を無視してイベントルー
+ : プを継続する.さらに nil の場合は警告モードでない限りはエ
+ : ラーメッセージの出力すら省略して,例外を無視する.
+ : デフォルトでは true に設定されている.
+ : 1個のインタープリタだけを使っている場合にはエラー時にその
+ : まま停止しても通常は問題ないが,複数のインタープリタが同時
+ : に動作している場合には,それらを管理するイベントループは1
+ : 個だけであるため,いずれかのインタープリタのエラーが原因で,
+ : 他のインタープリタの処理継続が不可能になることがある.その
+ : ような場合でもエラーを無視してイベントループが稼働を続ける
+ : ことで,他のインタープリタが正常に動作し続けることができる.
+ : $SAFE >= 4 では実行が禁止される.
+
+ mainloop_abort_on_exception
+ : Tk インタープリタ上で例外を発生した際に,イベントループをエ
+ : ラー停止させるかどうかの設定状態を true/false で得る.
+
+ num_of_mainwindows
+ : 現在のメインウィンドウ (ルートウィジェット) の数を返す.
+ : メインウィンドウは一つのインタープリタに付き最大一つである
+ : ので,この値は現在 Tk の機能が有効であるインタープリタの総
+ : 数に等しい.
+
+ _merge_tklist(str, str, ... )
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
+ : 正しく一つのリスト要素となるように連結した文字列を返す.
+
+ _conv_listelement(str)
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
+ : 一つのリスト要素として適切な表現になるように変換した文
+ : 字列を返す.
+
+ _toUTF8(str, encoding=nil)
+ _fromUTF8(str, encoding=nil)
+ : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す.
+
+ _subst_UTF_backslash(str)
+ _subst_Tcl_backslash(str)
+ : Tcl のルールでバックスラッシュ記法 ( \uhhhh による
+ : Unicode 文字表現を含む ) を解析する.
+ : _subst_Tcl_backslash はすべてのバックスラッシュ記法を
+ : 置き換えるのに対し,_subst_UTF_backslash は \uhhhh
+ : による Unicode 文字表現だけを置き換える.
+
+ encoding_system
+ encoding_system=(encoding)
+ : Tcl の system encoding の獲得および設定
+
+ encoding
+ encoding=(encoding)
+ : encoding_system / encoding_system= の alias
+ : ( Ruby/Tk の tk.rb では置き換えられる予定のもの.)
+
+
+クラス TclTkIp
+ クラスメソッド
+ new(ip_name=nil, options='')
+ : TclTkIp クラスのインスタンスを生成する.
+ : ip_name に文字列を与えた場合は,それが winfo interps などで
+ : 表示される名前になる.
+ : options には,-geometry や -use など,wish のコマンドライン
+ : 引数として与えるオプションと同様の情報を文字列として与える.
+ : 与えられた情報は,root widget 生成の際に用いられる.
+ : ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
+ : もし options に敢えて nil または false を与えた場合,Tk ライ
+ : ブラリが導入されていない (つまりは Tcl のみの) インタープリ
+ : タを生成する.この場合は GUI 環境は必要ないため,ウインドウ
+ : システムが存在しない,または使用できない環境でも Tcl インター
+ : プリタを生成し,Tcl やその拡張ライブラリを活用することができる.
+
+ インスタンスメソッド
+ create_slave(name, safe=false)
+ : レシーバを親とする name という名前のスレーブインタープリタを
+ : 生成する.
+ : safe には生成するインタープリタを safe インタープリタとする
+ : かを指定する.デフォルトは false ということになっているが,
+ : たとえ明確に false を指定していたとしても,親となるインター
+ : プリタが safe インタープリタであれば,その設定を引き継いで
+ : safe インタープリタとして生成される.
+ : $SAFE >= 4 では,safe インタープリタ以外の生成が禁止される.
+
+ make_safe
+ : Tcl/Tk インタープリタを safe インタープリタに変更する.
+ : 戻り値はレシーバであるインタープリタ自身である.
+ : 失敗した場合は RuntimeError の例外を発生する.
+
+ safe?
+ : Tcl/Tk インタープリタが safe インタープリタであるかを調べる.
+ : safe インタープリタであれば true を返す.
+
+ allow_ruby_exit?
+ : 対象となるインタープリタ上の評価で,ruby の exit 関数または
+ : Tcl/Tk 上の exit コマンドによって ruby 自体を終了させること
+ : を許すかどうかを返す.
+ : 許さない場合は対象のインタープリタだけが終了する.
+ : マスターインタープリタのデフォルト値は true,スレーブインター
+ : プリタのデフォルト値は false である.
+
+ allow_ruby_exit=(mode)
+ : 対象となるインタープリタの allow_ruby_exit? の状態を変更する.
+ : $SAFE >= 4 またはインタープリタが safe インタープリタの場合は
+ : 変更が許されない (例外を発生).
+
+ delete
+ : Tcl/Tk インタープリタを delete する.
+ : delete されたインタープリタは,以後一切の操作ができなくなり,
+ : コマンドを送っても例外を発生するようになる.
+
+ deleted?
+ : Tcl/Tk インタープリタがすでに delete されているかを調べる.
+ : delete 済みでコマンドを受け付けない状態になっているならば
+ : true を返す.
+
+ has_mainwindow?
+ : Tcl/Tk インタープリタにメインウィンドウ (root widget) が
+ : 存在すれば true を,存在しなければ false を返す.
+ : インタープリタが既に delete 済みであれば nil を返す.
+
+ restart
+ : Tcl/Tk インタープリタの Tk 部分の初期化,再起動を行う.
+ : 一旦 root widget を破壊した後に再度 Tk の機能が必要と
+ : なった場合に用いる.
+ : $SAFE >= 4 では実行が禁止される.
+
+ _eval(str)
+ _invoke(*args)
+ : Tcl/Tk インタープリタ上で評価を行う.
+ : _eval は評価スクリプトが一つの文字列であることに対し,
+ : _invoke は評価スクリプトの token ごとに一つの引数とな
+ : るように与える.
+ : _invoke の方は Tcl/Tk インタープリタの字句解析器を用い
+ : ないため,評価の負荷がより少なくてすむ.ただし,その代
+ : わりに auto_load のような機構は働かず,load 等によって
+ : Tcl/Tk インタープリタ上に既に登録済みのコマンドしか呼
+ : び出すことができない.
+ : _eval では auto_load 機構が働くため,一度 _eval を実行
+ : して登録に成功しさえすれば,以降は _invoke でも利用で
+ : きるようになる.
+
+ _cancel_eval(str)
+ _cancel_eval_unwind(str)
+ : (Tcl/Tk8.6 or later)
+ : Tcl_CancelEval() 関数を呼び出し,eval の実行を打ち切る.
+
+ _toUTF8(str, encoding=nil)
+ _fromUTF8(str, encoding=nil)
+ : Tcl/Tk が内蔵している UTF8 変換処理を呼び出す.
+
+ _thread_vwait(var_name)
+ _thread_tkwait(mode, target)
+ : スレッド対応の vwait あるいは tkwait 相当のメソッド.
+ : 通常の vwait あるいは tkwait コマンドと異なるのは,イベン
+ : トループとは異なるスレッドから呼び出した場合に vwait 等の
+ : スタックとは独立に条件の成立待ちがなされることである.
+ : 通常の vwait / tkwait では,vwait / tkwait (1) の待ちの途
+ : 中でさらに vwait / tkwait (2) が呼ばれた場合,待ちの対象
+ : となっている条件の成立順序がどうあれ,(2)->(1) の順で待ち
+ : を終了して戻ってくる.
+ : _thread_vwait / _thread_tkwait は,イベントループのスレッ
+ : ドで呼ばれた場合は通常の vwait / tkwait と同様に動作する
+ : が,イベントループ以外のスレッドで呼ばれた場合にはそのス
+ : レッドを停止させて待ちに入り,条件が成立した時にスレッド
+ : の実行を再開する.「vwait 等の待ちスタックとは独立」とい
+ : う意味は,この再開のタイミングが他のスレッドでの待ち状況
+ : とは無関係ということである.つまり,イベントループ等の他
+ : のスレッドで vwait 等で待ちの状態にあったとしてもその完了
+ : を待つことなく,自らの待ち条件が成立次第,処理を継続する
+ : ことになる.
+
+ _return_value
+ : 直前の Tcl/Tk 上での評価の実行結果としての戻り値を返す.
+
+ _get_variable(var_name, flag)
+ _get_variable2(var_name, index_name, flag)
+ : Tcl/Tk 上の var という変数名の変数の値を返す.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name の index_name の要素を返す.
+ : flag には変数を検索する際の条件を指定する.flag に与える
+ : 値はモジュール TclTkLib::VarAccessFlag を参照すること.
+
+ _set_variable(var_name, value, flag)
+ _set_variable2(var_name, index_name, value, flag)
+ : Tcl/Tk 上の var という変数名の変数に値を設定する.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name の index_name の要素を設定
+ : する.
+ : flag には変数を検索する際の条件を指定する.flag に与える
+ : 値はモジュール TclTkLib::VarAccessFlag を参照すること.
+
+ _unset_variable(var_name)
+ _unset_variable2(var_name, index_name)
+ : Tcl/Tk 上の var_name という変数名の変数を消去する.
+ : もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
+ : された場合は連想配列 var_name から index_name の要素だけ
+ : を消去する.
+
+ _get_global_var(var_name)
+ _get_global_var2(var_name, index_name)
+ _set_global_var(var_name, value)
+ _set_global_var2(var_name, index_name, value)
+ _unset_global_var(var_name)
+ _unset_global_var2(var_name, index_name)
+ : それぞれ,対応する変数アクセスメソッドの flag に対して
+ : (GLOBAL_ONLY | LEAVE_ERR_MSG) を与えたもの.
+
+ _split_tklist(str)
+ : Tcl/Tk のライブラリ関数を使って,文字列 str をリストに
+ : 分割する (文字列の配列として返す).
+
+ _merge_tklist(str, str, ... )
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
+ : 正しく一つのリスト要素となるように連結した文字列を返す.
+
+ _conv_listelement(str)
+ : Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
+ : 一つのリスト要素として適切な表現になるように変換した文
+ : 字列を返す.
+
+ mainloop
+ mainloop_watchdog
+ : スレーブ IP の場合にはイベントループを起動せずに nil を返す.
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
+
+ do_one_event
+ : スレーブ IP の場合には引数のイベントフラグに DONT_WAIT が
+ : 強制的に追加される (イベント待ちでスリープすることは禁止).
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
+
+ set_eventloop_tick
+ get_eventloop_tick
+ set_no_event_wait
+ get_no_event_wait
+ set_eventloop_weight
+ get_eventloop_weight
+ mainloop_abort_on_exception
+ mainloop_abort_on_exception=
+ : スレーブ IP の場合には値の設定が許されない (無視される).
+ : それ以外の点では引数を含めて TclTkLib の同名メソッドに同じ.
+
+ encoding_table
+ : Ruby m17n 用に Ruby と Tk との間の encoding 対応表を返す.
+
+クラス TkCallbackBreak < StandardError
+クラス TkCallbackContinue < StandardError
+ : これらはイベントコールバックにおいて,コールバック処理を適切に中
+ : 断したり,次のバインドタグのバインディング処理に進めたりすること
+ : を可能にするための例外クラスである.
+ : コールバックで break や continue を実現するためには,コールバック
+ : である Ruby 手続きが Tcl/Tk インタープリタ側に適切なリターンコー
+ : ドを返す必要がある.Ruby の手続きが普通に値を返すのでは,それが普
+ : 通の戻り値であるのか否かを区別ができないため,例外発生を利用した
+ : 実装を行っている.
+ : ただし現在では,コールバック手続きを Ruby の break, next で終了す
+ : ることで同等の結果を得ることができるようになっている.それゆえ,
+ : これらは必要ないものではあるが,互換性のために残してある.
+
+(eof)
diff --git a/ext/tk/README.1st b/ext/tk/README.1st
new file mode 100644
index 0000000000..4ffef34f1d
--- /dev/null
+++ b/ext/tk/README.1st
@@ -0,0 +1,19 @@
+If you want to use Ruby/Tk (tk.rb and so on), you must have tcltklib.so
+which is working correctly. When you have some troubles on compiling,
+please read README.tcltklib and README.ActiveTcl.
+Even if there is a tcltklib.so on your Ruby library directory, it will not
+work without Tcl/Tk libraries (e.g. libtcl8.4.so) on your environment.
+You must also check that your Tcl/Tk is installed properly.
+
+--------------------------------------------
+ ( the following is written in UTF-8 )
+
+Ruby/Tk (tk.rb など) を使いたい場合には,tcltklib.so が正しく動いていな
+ければなりません.コンパイル時に何か問題が生じた場合は,README.tcltklib
+や README.ActiveTcl を見てください.
+たとえ Ruby のライブラリディレクトリに tcltklib.so が存在していたとして
+も,実行環境に Tcl/Tk ライブラリ (libtcl8.4.so など) がなければ機能しま
+せん.Tcl/Tk が正しくインストールされているかもチェックしてください.
+
+==========================================================
+ Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/README.ActiveTcl b/ext/tk/README.ActiveTcl
new file mode 100644
index 0000000000..990f612648
--- /dev/null
+++ b/ext/tk/README.ActiveTcl
@@ -0,0 +1,62 @@
+ActiveTcl is ActiveState's quality-assured distribution of Tcl.
+
+# see <http://www.activestate.com/Products/ActiveTcl/>
+# <http://www.tcl.tk/>
+
+First of all, please try to configure without any options.
+"extconf.rb" searches ActiveTcl as default action.
+If you have ActiveTcl and standard (or your own) Tcl/Tk on your
+environment and don't want to use ActiveTcl on your Ruby/Tk, please
+use --without-ActiveTcl option.
+
+When "extconf.rb" fails to find your ActiveTcl libraries, please try
+the followings.
+
+If you want to use ActiveTcl binary package as the Tcl/Tk libraries,
+please use the following configure options.
+
+ --with-ActiveTcl=<ActiveTcl_root>
+ ( When without argument; no <ActiveTcl_root>; only '--with-ActiveTcl',
+ it same to '--with-ActiveTcl=/opt/ActiveTcl*/lib' )
+
+ --with-tcl-dir=<ActiveTcl_root>
+ --with-tk-dir=<ActiveTcl_root>
+
+And use the followings if you need.
+
+ --with-tcllib=<libname>
+ --with-tklib=<libname>
+ --enable-tcltk-stubs
+
+For example, when you install ActiveTcl-8.4.x to '/usr/local/ActiveTcl',
+
+ configure --with-tcl-dir=/usr/local/ActiveTcl/ \
+ --with-tk-dir=/usr/local/ActiveTcl/ \
+ --with-tcllib=tclstub8.4 \
+ --with-tklib=tkstub8.4 \
+ --enable-tcltk-stubs
+
+It depends on your environment that you have to add the directory of
+ActiveTcl's libraries to your library path when execute Ruby/Tk.
+One of the way is to add entries to TCLLIBPATH environment variable,
+and one of the others add to LD_LIBRARY_PATH environment variable
+
+Probably, using TCLLIBPATH is better. The value is appended at the
+head of Tcl's 'auto_path' variable. You can see the value of the
+variable by using 'Tk::AUTO_PATH.value' or 'Tk::AUTO_PATH.list'.
+
+For example, on Linux, one of the ways is to use LD_LIBRARY_PATH
+environment variable.
+-------------------------------------------------------------------------
+ [bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH \
+ ruby your-Ruby/Tk-script
+
+ [bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH irb
+-------------------------------------------------------------------------
+Based on it, the Tcl interpreter changes auto_path variable's value.
+
+Then, you'll be able to use Tcl/Tk extension libraries included in the
+ActiveTcl package (e.g. call TkPackage.require('BWidget'), and then,
+use functions/widgets of BWidget extension).
+
+ Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/README.fork b/ext/tk/README.fork
new file mode 100644
index 0000000000..c58d75883b
--- /dev/null
+++ b/ext/tk/README.fork
@@ -0,0 +1,34 @@
+Ruby/Tk does NOT support forking the process on which Tk interpreter
+is running (unless NEVER control Tk interpreter under the forked child
+process). In the library 'tk.rb', a Tk interpreter is initialized.
+Therefore, if you want running Tk under a child process, please call
+"require 'tk'" in the child process.
+
+# If do fork and exec(<new Ruby/Tk>) on the child process, you can
+# control Ruby/Tk interpreter on the child process by 'send' command
+# of Tcl/Tk. About this, please see Tk.appsend and Tk.rb_appsend, or
+# 'remote-tk.rb' and the sample 'sample/remote-ip_sample.rb'.
+
+For example, the following sample1 will NOT work, and sample2 will
+work properly.
+
+---<sample1: NOT work>---------------------------------------
+require 'tk' ## init Tk interpreter under parent process
+
+exit! if fork ## exit parent process
+
+## child process
+TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
+Tk.mainloop
+-------------------------------------------------------------
+
+---<sample2: will work>--------------------------------------
+exit! if fork ## exit main process
+
+## child process
+require 'tk' ## init Tk interpreter under child process
+TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
+Tk.mainloop
+-------------------------------------------------------------
+
+ 2004/05/22 Hidetoshi NAGAI
diff --git a/ext/tk/README.macosx-aqua b/ext/tk/README.macosx-aqua
new file mode 100644
index 0000000000..15630727ec
--- /dev/null
+++ b/ext/tk/README.macosx-aqua
@@ -0,0 +1,67 @@
+
+ *** for MacOS X Aqua (Tcl/Tk Aqua) users ***
+
+First of all, please read README.tcltklib to use Tcl/Tk Aqua Framework.
+
+With Tcl/Tk Aqua libraries, current tcltklib somtimes freezes when
+using Aqua specific dialogs (e.g. Tk.messageBox).
+This is a known bug of Ruby-1.8.4 release.
+
+When you meet the trouble on your GUI, you'll be able to avoid the trouble
+by Tcl/Tk's traditional dialogs.
+If you want to do that, please call some of the following bits of script
+after "reqruie 'tk'".
+
+=================================================================
+# use a traditional dialog for Tk.chooseColor()
+Tk.ip_eval(<<'EOS')
+ proc ::tk_chooseColor {args} {
+ return [eval tk::dialog::color:: $args]
+ }
+EOS
+
+# use a traditional dialog for Tk.getOpenFile() and Tk.getMultipleOpenFile()
+Tk.ip_eval(<<'EOS')
+ proc ::tk_getOpenFile {args} {
+ if {$::tk_strictMotif} {
+ return [eval tk::MotifFDialog open $args]
+ } else {
+ return [eval ::tk::dialog::file:: open $args]
+ }
+ }
+EOS
+
+# use a traditional dialog for Tk.getSaveFile() and Tk.getMultipleSaveFile()
+Tk.ip_eval(<<'EOS')
+ proc ::tk_getSaveFile {args} {
+ if {$::tk_strictMotif} {
+ return [eval tk::MotifFDialog save $args]
+ } else {
+ return [eval ::tk::dialog::file:: save $args]
+ }
+ }
+EOS
+
+# use a traditional dialog for Tk.messageBox()
+Tk.ip_eval(<<'EOS')
+ proc ::tk_messageBox {args} {
+ return [eval tk::MessageBox $args]
+ }
+EOS
+
+# use a traditional dialog for Tk.chooseDirectory()
+Tk.ip_eval(<<'EOS')
+ proc ::tk_chooseDirectory {args} {
+ return [eval ::tk::dialog::file::chooseDir:: $args]
+ }
+EOS
+=================================================================
+
+Each of them replaces the platform specific dialog command to the
+traditional one.
+
+If you use some MultiTkIp objects, probably, you'll have to call the
+bits of script for each MultiTkIp object.
+
+--
+Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/README.tcltklib b/ext/tk/README.tcltklib
new file mode 100644
index 0000000000..da343a4f3e
--- /dev/null
+++ b/ext/tk/README.tcltklib
@@ -0,0 +1,152 @@
+To compile 'tcltklib', you must have Tcl/Tk libraries on your environment.
+Although 'extconf.rb' script searches Tcl/Tk libraries and header files
+(as default, searches tclConfig.sh/tkConfig.sh and use the defintions on
+those; ActiveTcl has high priority on searching unless --without-ActiveTcl),
+sometimes fails to find them. And then, 'tcltklib' cannot be compiled. If
+Tcl/Tk libraries or header files are installed but are not found, you can
+give the information by arguments of the 'configure' script. Please give
+some or all of the following options.
+
+ --with-tk-old-extconf use old "extconf.rb" (default: false).
+ If current extconf.rb doesn't work properly
+ (or your install process is based on old
+ documant about Ruby/Tk install), please try
+ this option.
+
+ --with-ActiveTcl / --without-ActiveTcl
+ --with-ActiveTcl=<dir> search ActiveTcl libraries (default: true).
+ When true, try to find installed ActiveTcl.
+ When <dir> is given, use it as the ActiveTcl's
+ top directory (use <dir>/lib, and so on).
+ Old "extconf.rb" doesn't support this option.
+
+ --with-tk-shlib-search-path=<paths>
+ teach the paths for loading shared-libraries
+ to linker.
+ <paths> is a path list with the same format
+ as PATH environment variable.
+ This option may be experimental.
+ Old "extconf.rb" doesn't support this option.
+
+ --with-tcltkversion=<version>
+ --with-tcltkversion=<tclversion>,<tkversion>
+ 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)
+
+ --enable-tcl-h-ver-check/--disable-tcl-h-ver-check
+ --enable-tk-h-ver-check/--disable-tk-h-ver-check
+ enable or disable for checking MAJOR_VERSION and
+ MINOR_VERSION on tcl.h/tk.h whether match with
+ Tcl/Tk libraries' version or not.
+
+ --with-tcl-build-dir=<dir>
+ --with-tk-build-dir=<dir> If you want to compile with libraries on Tcl/Tk
+ build dir (still NOT installed), you must use
+ these options.
+ (e.g. --with-tcl-build-dir=./build/tcl8.5.9/unix)
+ When use these options, --with-tclConfig-dir and
+ --with-tkConfig-dir options are ignored (however,
+ --with-tclConfig-file and --with-tkConfig-file
+ options are still available).
+
+ --with-tclConfig-file=<file>/--without-tclConfig-file
+ --with-tkConfig-file=<file>/--without-tkConfig-file
+ file path of tclConfig.sh/tkConfig.sh, or don't
+ refer those.
+ If you want use non-standard filenames of config
+ files (e.g. tclConfig-static.sh), you must use
+ these options.
+
+ --with-tclConfig-dir=<dir>
+ --with-tkConfig-dir=<dir> the directory contains 'tclConfig.sh' and
+ 'tkConfig.sh'.
+ Current "extconf.rb" uses the information
+ on tclConfig.sh/tkConfig.rb, if possible.
+ Old "extconf.rb" doesn't support this option.
+
+ --with-tcllib=<libname> (e.g. libtcl8.4.so ==> --with-tcllib=tcl8.4)
+ --with-tklib=<libname> (e.g. libtk8.4.so ==> --with-tklib=tk8.4)
+
+ --enable-tcltk-stubs (if you force to enable stubs)
+ On old "extconf.rb", default is false.
+ On current "extconf.rb", default is true when
+ tclConfig.sh/tkConfig.sh have TCL_STUB_LIB_SPEC
+ /TK_STUB_LIB_SPEC, else default is false.
+
+ --with-tcl-dir=<path>
+ equal to "--with-tcl-include=<path>/include --with-tcl-lib=<path>/lib"
+
+ --with-tk-dir=<path>
+ equal to "--with-tk-include=<path>/include --with-tk-lib=<path>/lib"
+
+ --with-tcl-include=<dir> the directory contains 'tcl.h'
+ --with-tk-include=<dir> the directory contains 'tk.h'
+
+ --with-tcl-lib=<dir> the directory contains 'libtcl<version>.so'
+ --with-tk-lib=<dir> the directory contains 'libtk<version>.so'
+
+ --enable-mac-tcltk-framework (MacOS X) use Tcl/Tk framework
+ (Obsolete. Please use '--enable-tcltk-framework'.)
+
+ --enable-tcltk-framework use Tcl/Tk framework
+
+ --with-tcltk-framework=<dir> the directory contains Tcl/Tk framework;
+ "<dir>/Tcl.framework" and "<dir>/Tk.framework".
+ When this option is given, it is assumed that
+ --enable-tcltk-framework option is given also.
+
+ --with-tcl-framework-dir=<dir>
+ Tcl framework directory (e.g. "/Library/Frameworks/Tcl.framework")
+
+ --with-tk-framework-dir=<dir>
+ Tk framework directory (e.g. "/Library/Frameworks/Tk.framework")
+
+ --with-tcl-framework-header=<dir>
+ Tcl framework headers directory
+ (e.g. "/Library/Frameworks/Tcl.framework/Headers")
+
+ --with-tk-framework-header=<dir>
+ Tk framework headers directory
+ (e.g. "/Library/Frameworks/Tk.framework/Headers")
+
+
+ --with-X11 / --without-X11 use / not use the X Window System
+
+ --with-X11-dir=<path>
+ equal to "--with-X11-include=<path>/include --with-X11-lib=<path>/lib"
+
+ --with-X11-include=<dir> the directory contais X11 header files
+ --with-X11-lib=<dir> the directory contais X11 libraries
+
+
+If you forgot to give the options when do 'configure' on toplevel
+directory of Ruby sources, please try something like as the followings.
+
+ $ cd ext/tcltklib
+ $ rm Makefile
+ $ CONFIGURE_ARGS='--with-tcl-include=/usr/local/include/tcl8.4/ --with-tcllib=tcl8.4 --with-tklib=tk8.4' ruby extconf.rb
+
+
+ *** ATTENTION ***
+When your Tcl/Tk libraries are compiled with "pthread support",
+Ruby/Tk may cause "Hang-up" or "Segmentation Fault" frequently.
+If you have such a trouble, please try to use the '--enable-pthread'
+option of the 'configure' command and re-compile Ruby sources.
+It may help you to avoid this trouble. The following configure
+options may be useful.
+
+ --enable-tcl-thread/--disable-tcl-thread
+ --with-tclConfig-file=<path of 'tclConfig.sh'>
+ --with-tkConfig-file=<path of 'tkConfig.sh'>
+
+It is not need that 'tclConfig.sh' is a normal Tcl/Tk's tclConfig.sh.
+But the file is expected to include the line "TCL_THREADS=0" or "...=1".
+When no "TCL_THREADS=?" line, if Tcl version is 7.x or 8.0 which is
+given by "TCL_MAJOR_VERSION=?" line and "TCL_MINOR_VERSION=?" line,
+then --disable-tcl-thread is expected. Else, ignore the 'tclConfig.sh'.
+If --enable-tcl-thread or --disable-tcl-thread option is given, then
+--with-tclConfig-file option is ignored.
+
+==========================================================
+ Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/config_list.in b/ext/tk/config_list.in
new file mode 100644
index 0000000000..143a7b5df6
--- /dev/null
+++ b/ext/tk/config_list.in
@@ -0,0 +1,41 @@
+##############################################
+# configure options for Ruby/Tk
+# release date: 2011-06-05
+##############################################
+with tk-old-extconf
+with ActiveTcl
+with tk-shlib-search-path
+enable tcltk-stubs
+with tcltkversion
+enable tcl-h-ver-check
+enable tk-h-ver-check
+with tcl-build-dir
+with tk-build-dir
+with tcl-config
+with tk-config
+with tclConfig-dir
+with tkConfig-dir
+with tclConfig-file
+with tkConfig-file
+with tcllib
+with tklib
+with tcl-dir
+with tk-dir
+with tcl-include
+with tk-include
+with tcl-lib
+with tk-lib
+enable mac-tcltk-framework
+enable tcltk-framework
+with tcltk-framework
+with tcl-framework-dir
+with tk-framework-dir
+with tcl-framework-header
+with tk-framework-header
+with X11
+with X11-dir
+with X11-include
+with X11-lib
+enable pthread
+enable tcl-thread
+enable space-on-tk-libpath
diff --git a/ext/tk/depend b/ext/tk/depend
new file mode 100644
index 0000000000..f7ba3229c1
--- /dev/null
+++ b/ext/tk/depend
@@ -0,0 +1,2 @@
+tcltklib.o: tcltklib.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h stubs.h
+stubs.o: stubs.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h stubs.h
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
new file mode 100644
index 0000000000..99a7367782
--- /dev/null
+++ b/ext/tk/extconf.rb
@@ -0,0 +1,2094 @@
+##############################################################
+# extconf.rb for tcltklib
+# release date: 2010-07-30
+##############################################################
+require 'mkmf'
+
+TkLib_Config = {}
+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.
+
+TkLib_Config['unsupported_versions'] =
+ %w[8.8 8.7 8.6] # At present, Tcl/Tk8.6 is not supported.
+
+TkLib_Config['major_nums'] = '87'
+
+
+##############################################################
+
+TkLib_Config['enable-shared'] = enable_config("shared")
+
+
+##############################################################
+# use old extconf.rb ?
+##############################################################
+if with_config('tk-old-extconf')
+ require File.join(File.dirname(__FILE__), 'old-extconf.rb')
+ exit
+end
+
+
+##############################################################
+# check configs
+##############################################################
+($cleanfiles ||= "") << 'config_list'
+config_list_file = 'config_list'
+config_list_file_source = File.join(File.dirname(__FILE__),'config_list.in')
+if !File.exist?(config_list_file) ||
+ File.ctime(config_list_file_source) > File.ctime(config_list_file)
+ old_config_list_file = config_list_file_source
+else
+ old_config_list_file = config_list_file
+end
+
+current_configs = {'with'=>{}, 'enable'=>{}}
+
+# setup keys by config_list.in
+IO.foreach(config_list_file_source){|line|
+ line.chomp!
+ line.lstrip!
+ next if line.empty? || line =~ /^\#/ #
+ mode, key, value = line.split(/\s+/, 3)
+ value ||= ""
+ current_configs[mode][key] = value rescue nil
+}
+
+# define current value of keys
+IO.foreach(old_config_list_file){|line|
+ line.chomp!
+ line.lstrip!
+ next if line.empty? || line =~ /^\#/ #
+ mode, key, value = line.split(/\s+/, 3)
+ value ||= ""
+ if current_configs[mode] && current_configs[mode].has_key?(key)
+ current_configs[mode][key] = value
+ end
+}
+
+update_flag = false
+current_configs['with'].each_key{|key|
+ if (value = with_config(key).to_s) != current_configs['with'][key]
+ update_flag = true
+ current_configs['with'][key] = value
+ end
+}
+current_configs['enable'].each_key{|key|
+ if (value = enable_config(key).to_s) != current_configs['enable'][key]
+ update_flag = true
+ current_configs['enable'][key] = value
+ end
+}
+
+# update current_configs
+if update_flag || !File.exist?(config_list_file)
+ open(config_list_file, 'w'){|fobj|
+ fobj.print("# values of current configure options (generated by extconf.rb)\n");
+ ['with', 'enable'].each{|mode|
+ current_configs[mode].each_key{|key|
+ fobj.print("#{mode} #{key} #{current_configs[mode][key]}\n")
+ }
+ }
+ }
+end
+
+if update_flag
+ puts "Configure options for Ruby/Tk may be updated."
+ puts "So, delete files which depend on old configs."
+ File.delete(*Dir.glob("*.#{CONFIG['DLEXT']}", File::FNM_CASEFOLD))
+ File.delete(*Dir.glob("*.#{$OBJEXT}", File::FNM_CASEFOLD))
+ File.delete('Makefile') rescue nil
+
+else
+ makefile = 'Makefile'
+ if File.exist?(makefile) &&
+ File.ctime(config_list_file) > File.ctime(makefile)
+ # no need to update Makefile
+ exit
+ end
+end
+
+
+##############################################################
+# fuctions
+##############################################################
+def is_win32?
+ /mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
+end
+
+def is_macosx?
+ /darwin/ =~ RUBY_PLATFORM
+end
+
+def maybe_64bit?
+ /64|universal|s390x/ =~ RUBY_PLATFORM
+end
+
+def check_tcltk_version(version)
+ return [nil, nil] unless version.kind_of? String
+
+ tclver, tkver = version.split(',')
+ tclver = tclver.strip
+ return [tclver, tkver.strip] if tkver
+
+ dot = major = minor_dot = minor = plvl_dot = plvl = ext = nil
+ if tclver =~ /^(\d)(\.?)(\d)(\.?)(\d*)(.*)$/
+ major = $1; minor_dot = $2; minor = $3; plvl_dot = $4; plvl = $5; ext = $6
+ dot = ! minor_dot.empty?
+ if plvl_dot.empty? && ! plvl.empty?
+ minor << plvl
+ end
+ elsif tclver =~ /^(\d)(\.?)(\d?)(.*)$/
+ major = $1; minor_dot = $2; minor = $3; ext = $4
+ dot = ! minor_dot.empty?
+ else # unknown -> believe user
+ return [tclver, tkver]
+ end
+
+ # check Tcl7.6 / Tk4.2 ?
+ if major == "7" # Tcl7.6 ( not support Tclversion < 7.6 )
+ # Tk4.2
+ tkver = "4" + ((dot)? ".": "") + ((minor.empty)? "": "2") + ext
+ elsif major == "4" # Tk4.2 ( not support Tkversion < 4.2 )
+ # Tcl7.6
+ tkver = tclver
+ tclver = "7" + ((dot)? ".": "") + ((minor.empty)? "": "6") + ext
+ end
+
+ tkver = tclver unless tkver
+
+ [tclver, tkver]
+end
+
+def get_shlib_versions(major = 8, minor_max = 9, minor_min = 0, ext = "")
+ if tclcfg = TkLib_Config["tclConfig_info"]
+ major = tclcfg['TCL_MAJOR_VERSION'].to_i
+ minor_min = tclcfg['TCL_MINOR_VERSION'].to_i
+
+ elsif TkLib_Config["tcltkversion"]
+ tclver, tkver = TkLib_Config["tcltkversion"]
+ if tclver =~ /8\.?(\d)(.*)/
+ minor_min = $1.to_i
+ ext = $2
+ else
+ # unsupported version
+ return [""]
+ end
+ end
+
+ # if disable-stubs, version is fixed.
+ minor_max = minor_min unless TkLib_Config["tcltk-stubs"]
+
+ vers = []
+ minor_max.downto(minor_min){|minor|
+ vers << "#{major}.#{minor}#{ext}" unless ext.empty?
+ vers << "#{major}.#{minor}"
+ }
+
+ vers << ""
+end
+
+def get_shlib_path_head
+ path_head = []
+ path_dirs = []
+
+ if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
+ # path_head << TkLib_Config["ActiveTcl"]
+ path_head.concat Dir.glob(TkLib_Config["ActiveTcl"], File::FNM_CASEFOLD).sort.reverse
+ # path_dirs.concat Dir.glob(File.join(TkLib_Config["ActiveTcl"], 'lib'), File::FNM_CASEFOLD).sort.reverse
+ end
+
+ if CROSS_COMPILING
+ elsif is_win32?
+ if TkLib_Config["ActiveTcl"]
+ path_head.concat ["c:/ActiveTcl", "c:/Program Files/ActiveTcl",
+ "c:/Program Files (x86)/ActiveTcl"]
+ end
+ path_head.concat [
+ "c:/Tcl", "c:/Program Files/Tcl", "c:/Program Files (x86)/Tcl",
+ "/Tcl", "/Program Files/Tcl", "/Program Files (x86)/Tcl"
+ ]
+ path_head.uniq!
+ #path_head.each{|dir| path_dirs << dir.dup if File.directory? dir}
+ path_head.each{|dir| path_dirs << File.expand_path(dir) if File.directory? dir}
+
+ # for MinGW
+ ["/usr/local/lib64", "/usr/lib64", "/usr/local/lib", "/usr/lib"].each{|dir|
+ #path_dirs << dir if File.directory? dir
+ path_dirs << File.expand_path(dir) if File.directory? dir
+ }
+ path_dirs |= ENV['LIBRARY_PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['LIBRARY_PATH']
+ path_dirs |= ENV['PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['PATH']
+
+ else
+ [
+ '/opt', '/pkg', '/share',
+ '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
+ '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
+ ].each{|dir|
+ next unless File.directory?(dir)
+
+ path_dirs << "#{dir}/lib64" if maybe_64bit?
+ path_dirs << "#{dir}/lib"
+ path_dirs << "#{dir}" unless Dir.glob("#{dir}/lib*.*", File::FNM_CASEFOLD).empty?
+
+ dirnames = []
+ if TkLib_Config["ActiveTcl"]
+ dirnames.concat ["ActiveTcl"]
+ end
+ dirnames.concat ["TclTk","Tcl_Tk","Tcl-Tk"]
+
+ dirnames.each{|name|
+ path_dirs << "#{dir}/#{name}" if File.directory?("#{dir}/#{name}")
+ path_head << "#{dir}/#{name}" unless Dir.glob("#{dir}/#{name}[-89_]*", File::FNM_CASEFOLD).empty?
+ }
+ }
+ end
+
+ unless TkLib_Config["space-on-tk-libpath"]
+ path_head.delete_if{|path| path =~ / /}
+ path_dirs.delete_if{|path| path =~ / /}
+ end
+
+ [path_head, path_dirs]
+end
+
+def find_macosx_framework
+ use_framework = is_macosx? && TkLib_Config["ActiveTcl"]
+
+ use_framework ||= (tcl_hdr = with_config("tcl-framework-header"))
+ use_framework ||= (tk_hdr = with_config("tk-framework-header"))
+ tcl_hdr = nil unless tcl_hdr.kind_of? String
+ tk_hdr = nil unless tk_hdr.kind_of? String
+ TkLib_Config["tcl-framework-header"] = tcl_hdr
+ TkLib_Config["tk-framework-header"] = tk_hdr
+
+ use_framework ||= (tcl_dir = with_config("tcl-framework-dir"))
+ tcl_dir = nil unless tcl_dir.kind_of? String
+ if !tcl_dir && tcl_hdr
+ # e.g. /Library/Frameworks/Tcl.framework/Headers
+ # ==> /Library/Frameworks/Tcl.framework
+ tcl_dir = File.dirname(tcl_hdr.strip.chomp('/'))
+ end
+ TkLib_Config["tcl-framework-dir"] = tcl_dir
+
+ use_framework ||= (tk_dir = with_config("tk-framework-dir"))
+ tk_dir = nil unless tk_dir.kind_of? String
+ if !tk_dir && tk_hdr
+ # e.g. /Library/Frameworks/Tk.framework/Headers
+ # ==> /Library/Frameworks/Tk.framework
+ tk_dir = File.dirname(tk_hdr.strip.chomp('/'))
+ end
+ TkLib_Config["tk-framework-dir"] = tk_dir
+
+ if tcl_dir && !tk_dir
+ tk_dir = File.join(File.dirname(tcl_dir), 'Tk.framework')
+ TkLib_Config["tk-framework-dir"] = tk_dir
+ elsif !tcl_dir && tk_dir
+ tcl_dir = File.join(File.dirname(tk_dir), 'Tcl.framework')
+ TkLib_Config["tcl-framework-dir"] = tcl_dir
+ end
+ if tcl_dir && tk_dir
+ TkLib_Config["tcltk-framework"] = File.dirname(tcl_dir) unless TkLib_Config["tcltk-framework"]
+ return [tcl_dir, tk_dir]
+ end
+
+ # framework is disabled?
+ if with_config("tcltk-framework") == false ||
+ enable_config("tcltk-framework") == false
+ return false
+ end
+
+ use_framework ||= (framework_dir = with_config("tcltk-framework"))
+ if framework_dir.kind_of? String
+ TkLib_Config["tcltk-framework"] = framework_dir.strip.chomp('/')
+ return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'),
+ File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')]
+ end
+
+ unless enable_config("tcltk-framework", use_framework) ||
+ enable_config("mac-tcltk-framework", use_framework)
+ TkLib_Config["tcltk-framework"] = false
+ return false
+ end
+
+ paths = [
+ #"~/Library/Frameworks",
+ "/Library/Frameworks",
+ "/Network/Library/Frameworks", "/System/Library/Frameworks"
+ ]
+ paths.reverse! unless TkLib_Config["ActiveTcl"] # system has higher priority
+
+ paths.map{|dir| dir.strip.chomp('/')}.each{|dir|
+ next unless File.exist?(File.join(dir, "Tcl.framework", "Headers"))
+ next unless File.directory?(tcldir = File.join(dir, "Tcl.framework"))
+ next unless File.exist?(File.join(dir, "Tk.framework", "Headers"))
+ next unless File.directory?(tkdir = File.join(dir, "Tk.framework"))
+ TkLib_Config["tcltk-framework"] = dir
+ return [tcldir, tkdir]
+ }
+
+ nil
+end
+
+def collect_tcltk_defs(tcl_defs_str, tk_defs_str)
+ conflicts = [
+ 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION',
+ 'PACKAGE_STRING', 'PACKAGE_BUGREPORT'
+ ]
+
+ begin
+ # Ruby 1.9.x or later
+ arch_config_h = RbConfig.expand($arch_hdrdir + "/ruby/config.h")
+ if File.exist?(arch_config_h)
+ keys = []
+ IO.foreach(arch_config_h){|line|
+ if line =~ /^#define +([^ ]+)/
+ keys << $1
+ end
+ }
+ conflicts = keys
+ end
+ rescue
+ # ignore, use default
+ end
+
+ if tcl_defs_str
+ tcl_defs = tcl_defs_str.split(/ ?-D/).map{|s|
+ s =~ /^([^=]+)(.*)$/
+ [$1, $2]
+ }
+ else
+ tcl_defs = []
+ end
+
+ if tk_defs_str
+ tk_defs = tk_defs_str.split(/ ?-D/).map{|s|
+ s =~ /^([^=]+)(.*)$/
+ [$1, $2]
+ }
+ else
+ tk_defs = []
+ end
+
+ defs = tcl_defs | tk_defs
+
+ defs.delete_if{|name,value|
+ conflicts.include?(name) ||
+ ( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) &&
+ vtcl != vtk )
+ }
+
+ defs.map{|ary| s = ary.join(''); (s.strip.empty?)? "": "-D" << s}
+end
+
+def parse_tclConfig(file)
+ # check tclConfig.sh/tkConfig.sh
+ tbl = Hash.new{|h,k| h[k] = ""}
+ return tbl unless file
+ IO.foreach(file){|line|
+ line.strip!
+ next if line !~ /^([^\#=][^=]*)=(['"]|)(.*)\2$/
+ key, val = $1, $3
+ tbl[key] = val.gsub(/\$\{([^}]+)\}/){|s|
+ subst = $1
+ (tbl[subst])? tbl[subst]: s
+ } rescue nil
+ }
+ tbl
+end
+
+def get_libpath(lib_flag, lib_spec)
+ # get libpath from {TCL,Tk}_LIB_FLAG and {TCL,Tk}_LIB_SPEC
+ lib_spec.gsub(/(#{lib_flag}|-L)/, "").strip
+end
+
+def get_tclConfig_dirs
+ config_dir = []
+
+ if CROSS_COMPILING
+ elsif is_win32?
+ if TkLib_Config["ActiveTcl"]
+ dirs = []
+ if TkLib_Config["ActiveTcl"].kind_of?(String)
+ dirs << File.join(TkLib_Config["ActiveTcl"], 'lib')
+ end
+ dirs.concat [
+ "c:/ActiveTcl*/lib", "c:/Tcl*/lib",
+ "c:/Program Files*/ActiveTcl*/lib", "c:/Program Files*/Tcl*/lib",
+ "/ActiveTcl*/lib", "/Tcl*/lib",
+ "/Program Files*/ActiveTcl*/lib", "/Program Files*/Tcl*/lib"
+ ]
+ else
+ dirs = [
+ "c:/Tcl*/lib", "c:/Program Files*/Tcl*/lib",
+ "/Tcl*/lib", "/Program Files*/Tcl*/lib"
+ ]
+ end
+ dirs = dirs.collect{|d| Dir.glob(d, File::FNM_CASEFOLD)}.flatten.uniq
+
+ dirs |= ENV['LIBRARY_PATH'].split(';') if ENV['LIBRARY_PATH']
+ dirs |= ENV['PATH'].split(';') if ENV['PATH']
+
+ exeext = RbConfig::CONFIG['EXEEXT']
+ ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
+ dir.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
+ next if Dir.glob(File.join(dir, "{tclsh,wish}*#{exeext}"), File::FNM_CASEFOLD).empty?
+ dirs << File.expand_path(File.join(dir, '..', 'lib'))
+ dirs << dir
+ # dirs << File.expand_path(File.join(dir, '..'))
+ }
+
+ unless TkLib_Config["space-on-tk-libpath"]
+ dirs.delete_if{|path| path =~ / /}
+ end
+
+ config_dir.concat(dirs.zip(dirs))
+
+ else
+ if framework = find_macosx_framework()
+ config_dir.unshift(framework)
+ end
+
+ if activeTcl = TkLib_Config['ActiveTcl']
+ # check latest version at first
+ if is_macosx?
+ base = File.expand_path(activeTcl)
+ config_dir << [
+ File.join(base, 'Tcl.framework'), File.join(base, 'Tk.framework')
+ ]
+
+ config_dir << [
+ File.join(base, 'Tcl.framework', 'Versions', 'Current'),
+ File.join(base, 'Tk.framework', 'Versions', 'Current')
+ ]
+
+ Dir.glob(File.join(base, 'Tcl.framework',
+ 'Versions', '*')).sort.reverse.each{|dir|
+ next if dir =~ /Current/
+ config_dir << [dir, dir.gsub(/Tcl/, 'Tk')]
+ }
+ else
+ config_dir.concat(Dir.glob(File.join(activeTcl, 'lib'), File::FNM_CASEFOLD).sort.reverse)
+ end
+ end
+
+ config_dir << RbConfig::CONFIG['libdir']
+
+ ((maybe_64bit?)? ['lib64', 'lib']: ['lib']).each{|dir|
+ config_dir.concat [
+ File.join(RbConfig::CONFIG['exec_prefix'], dir),
+ File.join(RbConfig::CONFIG['prefix'], dir),
+ "/usr/local/opt/#{dir}", "/usr/local/pkg/#{dir}",
+ "/usr/local/share/#{dir}", "/usr/local/#{dir}",
+ "/usr/opt/#{dir}", "/usr/pkg/#{dir}", "/usr/share/#{dir}",
+ "/usr/contrib/#{dir}", "/usr/#{dir}"
+ ]
+ }
+
+ config_dir.concat [
+ '/opt', '/pkg', '/share',
+ '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
+ '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
+ ].map{|dir|
+ Dir.glob(dir + "/{tcltk,tcl,tk}[#{TkLib_Config['major_nums']}*/lib",
+ File::FNM_CASEFOLD)
+ Dir.glob(dir + "/{tcltk,tcl,tk}[#{TkLib_Config['major_nums']}*",
+ File::FNM_CASEFOLD)
+ Dir.glob(dir + '/{tcltk,tcl,tk}/lib', File::FNM_CASEFOLD)
+ Dir.glob(dir + '/{tcltk,tcl,tk}', File::FNM_CASEFOLD)
+ }.flatten!
+
+ exeext = RbConfig::CONFIG['EXEEXT']
+ ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
+ dir.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
+ next if Dir.glob(File.join(dir, "{tclsh,wish}*#{exeext}"), File::FNM_CASEFOLD).empty?
+ config_dir << File.expand_path(File.join(dir, '..', 'lib'))
+ }
+
+ # for MacOS X
+ paths = [
+ #"~/Library/Tcl",
+ "/Library/Tcl", "/Network/Library/Tcl", "/System/Library/Tcl"
+ ]
+ paths.reverse! unless TkLib_Config["ActiveTcl"]
+
+ paths.each{|path|
+ config_dir << path
+ config_dir.concat(Dir.glob(File.join(path, '{tcl,tk}*'), File::FNM_CASEFOLD).sort.reverse.find_all{|d| File.directory?(d)})
+ }
+
+ paths = [
+ #"~/Library/Frameworks",
+ "/Library/Frameworks",
+ "/Network/Library/Frameworks", "/System/Library/Frameworks"
+ ]
+ paths.reverse! unless TkLib_Config["ActiveTcl"]
+
+ paths.each{|frmwk|
+ base = File.expand_path(frmwk)
+ config_dir << [
+ File.join(base, 'Tcl.framework'), File.join(base, 'Tk.framework')
+ ]
+
+ config_dir << [
+ File.join(base, 'Tcl.framework', 'Versions', 'Current'),
+ File.join(base, 'Tk.framework', 'Versions', 'Current')
+ ]
+
+ Dir.glob(File.join(base, 'Tcl.framework',
+ 'Versions', '*')).sort.reverse.each{|dir|
+ next if dir =~ /Current/
+ config_dir << [dir, dir.gsub(/Tcl/, 'Tk')]
+ }
+ }
+ end
+
+ config_dir
+end
+
+def get_ext_list()
+ exts = [CONFIG['DLEXT']]
+ exts.concat %w(dll) if is_win32?
+ exts.concat %w(bundle dylib) if is_macosx?
+
+ if TkLib_Config["tcltk-stubs"] || TkLib_Config['enable-shared'] == false
+ exts.unshift "lib" if is_win32?
+ exts.unshift "a"
+ exts.unshift CONFIG['LIBEXT']
+ end
+
+ if is_win32?
+ exts.map!{|ext| [ext.downcase, ext.upcase]}.flatten!
+ end
+
+ exts
+end
+
+def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
+ tcllib_ok = tklib_ok = false
+
+ if TkLib_Config["tcltk-stubs"]
+ stub = "stub"
+ tclfunc = "Tcl_InitStubs"
+ tkfunc = "Tk_InitStubs"
+ else
+ stub = ""
+ tclfunc = "Tcl_FindExecutable"
+ tkfunc = "Tk_Init"
+ end
+
+ incflags = ($INCFLAGS ||= "").dup
+ libpath = ($LIBPATH ||= []).dup
+ libs_param = ($libs ||= "").dup
+ tcllibs = nil
+ mkmf_param = nil
+
+ tclver, tkver = TkLib_Config["tcltkversion"]
+ exts = "(" + get_ext_list.join('|') + ")"
+
+ if tclver
+ tcl_glob = "*tcl#{stub}#{tclver}.*"
+ tcl_regexp = /^.*(tcl#{stub}#{tclver}.*)\.(#{exts}).*$/
+ elsif tclconf
+ tcl_glob = "*tcl#{stub}#{tclconf['TCL_MAJOR_VERSION']}{.,}#{tclconf['TCL_MINOR_VERSION']}*.*"
+ tcl_regexp = /^.*(tcl#{stub}#{tclconf['TCL_MAJOR_VERSION']}(?:\.|)#{tclconf['TCL_MINOR_VERSION']}.*)\.(#{exts}).*$/
+ end
+ if tkver
+ tk_glob = "*tk#{stub}#{tkver}.*"
+ tk_regexp = /^.*(tk#{stub}#{tkver}.*)\.(#{exts}).*$/
+ elsif tkconf
+ tk_glob = "*tk#{stub}#{tkconf['TK_MAJOR_VERSION']}{.,}#{tkconf['TK_MINOR_VERSION']}*.*"
+ tk_regexp = /^.*(tk#{stub}#{tkconf['TK_MAJOR_VERSION']}(?:\.|)#{tkconf['TK_MINOR_VERSION']}.*)\.#{exts}.*$/
+ end
+
+ tcllib_ok ||= !tclconf || Dir.glob(File.join(tcldir, tcl_glob), File::FNM_CASEFOLD).find{|file|
+ if file =~ tcl_regexp
+ libname = $1
+ ext = $2.downcase
+ begin
+ $INCFLAGS = incflags.dup << " " << tclconf["TCL_INCLUDE_SPEC"]
+ #puts "check #{file} #{$1} #{tclfunc} #{tcldir}"
+ #find_library($1, tclfunc, tcldir)
+ if (tclconf && tclconf["TCL_SHARED_BUILD"] == "0") ||
+ (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a"
+ # static link
+ tcllibs = $libs + " -DSTATIC_BUILD " + file.quote
+
+ # FIX ME: avoid pathname trouble (fail to find) on MinGW.
+ # e.g. TCL_INCLUDE_SPEC describes "-I/usr/local/include",
+ # but compiler can find "-IC:/msys/1.0/local/include" only.
+ $INCFLAGS << " -I" << File.join(File.dirname(File.dirname(file)),"include") if is_win32?
+ else
+ tcllibs = append_library($libs, libname)
+ 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?
+ end
+
+ $LIBPATH = libpath | [tcldir]
+ try_func(tclfunc, tcllibs, ["tcl.h"]) ||
+ ( try_func(tclfunc, tcllibs << " " << tclconf['TCL_LIBS'], ["tcl.h"]) if tclconf['TCL_LIBS'] )
+
+ ensure
+ mkmf_param = {
+ 'PATH' => file,
+ 'LIBNAME' => libname,
+ 'libs' => tcllibs.dup,
+ 'INCFLAGS' => $INCFLAGS.dup,
+ 'LIBPATH' => $LIBPATH.dup,
+ }
+ $LIBPATH = libpath.dup
+ $libs = libs_param.dup
+ end
+ end
+ }
+ tclconf['MKMF_PARAMS'] = mkmf_param if tclconf && tcllib_ok
+
+ tklib_ok ||= !tkconf || Dir.glob(File.join(tkdir, tk_glob), File::FNM_CASEFOLD).find{|file|
+ if file =~ tk_regexp
+ libname = $1
+ ext = $2.downcase
+ begin
+ #puts "check #{file} #{$1} #{tkfunc} #{tkdir}"
+ # find_library($1, tkfunc, tkdir)
+ if (tkconf && tkconf["TCL_SHARED_BUILD"] == "0") ||
+ (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) || ext == "a"
+ # static link
+ tklibs = " -DSTATIC_BUILD " + file.quote
+
+ # FIX ME: avoid pathname trouble (fail to find) on MinGW.
+ $INCFLAGS << " -I" << File.join(File.dirname(File.dirname(file)),"include") if is_win32?
+ else
+ tklibs = append_library("", libname)
+ #tklibs = append_library("", $1)
+ 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?
+ end
+
+ tklibs << " " << tcllibs if tcllibs
+ tmp_tklibs = tklibs.dup
+ $LIBPATH = libpath | [tkdir]
+ try_func(tkfunc, tklibs, ["tcl.h", "tk.h"]) ||
+ ( try_func(tkfunc, tklibs << " " << tkconf['TK_LIBS'], ["tcl.h", "tk.h"]) if tkconf['TK_LIBS'] ) ||
+ ( try_func(tkfunc, (tklibs = tmp_tklibs.dup) << " " << tkconf['TK_XLIBSW'], ["tcl.h", "tk.h"]) if tkconf['TK_XLIBSW'] ) ||
+ ( try_func(tkfunc, tklibs << " " << tkconf['TK_LIBS'], ["tcl.h", "tk.h"]) if tkconf['TK_LIBS'] )
+
+ ensure
+ mkmf_param = {
+ 'PATH' => file,
+ 'LIBNAME' => libname,
+ 'libs' => tklibs.dup,
+ 'INCFLAGS' => $INCFLAGS.dup,
+ 'LIBPATH' => $LIBPATH.dup,
+ }
+ $LIBPATH = libpath.dup
+ $libs = libs_param.dup
+ end
+ end
+ }
+
+ $INCFLAGS = incflags.dup
+ tkconf['MKMF_PARAMS'] = mkmf_param if tkconf && tklib_ok
+
+ [tcllib_ok, tklib_ok]
+end
+
+def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
+ TkLib_Config["tclConfig_paths"] = []
+
+ paths.compact!
+ if paths.empty?
+ config_dir = get_tclConfig_dirs
+ elsif paths.length == 1 && !paths[0][0] && !paths[0][1]
+ config_dir = get_tclConfig_dirs.map{|dir|
+ if dir.kind_of? Array
+ [ (paths[0][0] == false)? nil: dir[0],
+ (paths[0][1] == false)? nil: dir[1] ]
+ else
+ [ (paths[0][0] == false)? nil: dir,
+ (paths[0][1] == false)? nil: dir ]
+ end
+ }
+ else
+ # fixed tclConfig
+ config_dir = []
+ paths.each{|path|
+ if path.kind_of?(Array)
+ config_dir << path
+ else
+ dirs = Dir.glob(path, File::FNM_CASEFOLD)
+ config_dir.concat(dirs.zip(dirs))
+ end
+ }
+ end
+
+ tclver, tkver = TkLib_Config['tcltkversion']
+ if tclver && tclver =~ /^\D*(\d)\.?(\d)?/ # ignore PATCH_LEVEL
+ tclver_major = $1
+ tclver_minor = $2
+ else
+ tclver_major = nil
+ tclver_minor = nil
+ end
+ if tkver && tkver =~ /^\D*(\d)\.?(\d)?/ # ignore PATCH_LEVEL
+ tkver_major = $1
+ tkver_minor = $2
+ else
+ tkver_major = nil
+ tkver_minor = nil
+ end
+
+ conf = nil
+ progress_flag = false
+
+ config_dir.uniq!
+ config_dir.map{|dir|
+ if dir.kind_of? Array
+ [ (dir[0])? dir[0].strip.chomp('/'): nil,
+ (dir[1])? dir[1].strip.chomp('/'): nil ]
+ else
+ dir.strip.chomp('/')
+ end
+ }.each{|dir|
+ print("."); progress_flag = true # progress
+ # print("check #{dir} ==>");
+ if dir.kind_of? Array
+ tcldir, tkdir = dir
+ else
+ tcldir = tkdir = dir
+ end
+
+ tails = ['Config-shared.sh', 'config-shared.sh', 'Config.sh', 'config.sh']
+
+ if tcldir
+ if File.file?(tcldir)
+ tclcfg_files = [tcldir] * tails.length
+ else
+ tclcfg_files = tails.map{|f| File.join(tcldir, 'tcl' << f)}
+ end
+ else
+ tclcfg_files = [nil] * tails.length
+ end
+
+ if tkdir
+ if File.file?(tkdir)
+ tkcfg_files = [tkdir] * tails.length
+ else
+ tkcfg_files = tails.map{|f| File.join(tkdir, 'tk' << f)}
+ end
+ else
+ tkcfg_files = [nil] * tails.length
+ end
+
+ tclcfg_files.zip(tkcfg_files).map{|tclpath, tkpath|
+ [ (tclpath && File.exist?(tclpath))? File.expand_path(tclpath): tclpath,
+ (tkpath && File.exist?(tkpath))? File.expand_path(tkpath): tkpath ]
+ }.uniq.each{|tclpath, tkpath|
+ next if tclpath && !File.exist?(tclpath)
+ next if tkpath && !File.exist?(tkpath)
+
+ # parse tclConfig.sh/tkConfig.sh
+ tclconf = (tclpath)? parse_tclConfig(tclpath): nil
+ if tclconf
+ if tclver && ((tclver_major && tclver_major != tclconf['TCL_MAJOR_VERSION']) || (tclver_minor && tclver_minor != tclconf['TCL_MINOR_VERSION']))
+ print("\n") if progress_flag
+ puts "Ignore \"#{tclpath}\" (unmatch with configured version)."
+ progress_flag = false
+ next
+ end
+ if TkLib_Config['unsupported_versions'].find{|ver| ver == "#{tclconf['TCL_MAJOR_VERSION']}.#{tclconf['TCL_MINOR_VERSION']}"}
+ print("\n") if progress_flag
+ puts "Ignore \"#{tclpath}\" (unsupported version of Tcl/Tk)."
+ progress_flag = false
+ next
+ end
+ end
+
+ tkconf = (tkpath)? parse_tclConfig(tkpath): nil
+ if tkconf
+ if tkver && ((tkver_major && tkver_major != tkconf['TK_MAJOR_VERSION']) || (tkver_minor && tkver_minor != tkconf['TK_MINOR_VERSION']))
+ print("\n") if progress_flag
+ puts "Ignore \"#{tkpath}\" (unmatch with configured version)."
+ progress_flag = false
+ next
+ end
+ if TkLib_Config['unsupported_versions'].find{|ver| ver == "#{tkconf['TK_MAJOR_VERSION']}.#{tkconf['TK_MINOR_VERSION']}"}
+ print("\n") if progress_flag
+ puts "Ignore \"#{tkpath}\" (unsupported version of Tcl/Tk)."
+ progress_flag = false
+ next
+ end
+ end
+
+ # nativethread check
+ if !TkLib_Config["ruby_with_thread"]
+ if tclconf
+ if tclconf['TCL_THREADS'] == '1'
+ puts "\nWARNING: found #{tclpath.inspect}, but it WITH nativethread-support under ruby WITHOUT nativethread-support. So, ignore it."
+ TkLib_Config["tcl-NG-path"] << File.dirname(tclpath)
+ next
+ end
+ else
+ puts "\nWARNING: When not refer tclConfig.sh, cannot check native-thread support on Tcl/Tk libraries. Ruby, which is used now, does NOT support native-thread. So, if Tcl/Tk libraries support native-thread, it will NOT work properly."
+ end
+ end
+
+ # find tclConfig.sh & tkConfig.sh
+ conf = [tclconf, tkconf] unless conf
+
+ # check Tcl library
+ if is_macosx? && TkLib_Config["tcltk-framework"]
+ # if use framework, not check (believe it is installed properly)
+ tcllib_ok = tklib_ok = true
+ else
+ tcllib_ok, tklib_ok =
+ libcheck_for_tclConfig((tclpath)? File.dirname(tclpath): nil,
+ (tkpath)? File.dirname(tkpath): nil,
+ tclconf, tkconf)
+ end
+
+ unless tcllib_ok && tklib_ok
+ unless tcllib_ok
+ puts "\nWARNING: found #{tclpath.inspect}, but cannot find valid Tcl library for the tclConfig.sh. So, ignore it."
+ TkLib_Config["tcl-NG-path"] << File.dirname(tclpath)
+ end
+ unless tklib_ok
+ puts "\nWARNING: found #{tkpath.inspect}, but cannot find valid Tk library for the tkConfig.sh. So, ignore it."
+ TkLib_Config["tk-NG-path"] << File.dirname(tkpath)
+ end
+ next
+ end
+
+ #return [tclpath, tkpath]
+ # print(" #{[tclpath, tkpath].inspect}");
+ TkLib_Config["tclConfig_paths"] << [tclpath, tkpath]
+ }
+
+ # print("\n");
+ }
+
+ if is_macosx? && TkLib_Config["tcltk-stubs"]
+ CONFIG['LDSHARED'] << " -Xlinker -bind_at_load"
+ if config_string('LDSHAREDXX')
+ config_string('LDSHAREDXX') << " -Xlinker -bind_at_load"
+ end
+ end
+
+ if TkLib_Config["tclConfig_paths"].empty?
+ [nil, nil]
+ else
+ # find tclConfig.sh and tkConfig.sh
+ TkLib_Config["tclConfig_info"], TkLib_Config["tkConfig_info"] = conf
+ TkLib_Config["tclConfig_paths"][0]
+ end
+end
+
+def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir)
+ use_tclConfig = tclConfig_file != false && tclConfig_dir != false
+ use_tkConfig = tkConfig_file != false && tkConfig_dir != false
+
+ unless use_tclConfig || use_tkConfig
+ puts("Don't use [tclConfig.sh, tkConfig.sh]")
+ return [nil, nil]
+ end
+
+ tclConfig_file = nil unless tclConfig_file.kind_of? String
+ tkConfig_file = nil unless tkConfig_file.kind_of? String
+ tclConfig_dir = nil unless tclConfig_dir.kind_of? String
+ tkConfig_dir = nil unless tkConfig_dir.kind_of? String
+
+ if use_tclConfig && !tclConfig_dir
+ if tclConfig_file
+ tclConfig_dir = File.dirname(tclConfig_file)
+ elsif tkConfig_dir
+ tclConfig_dir = tkConfig_dir
+ end
+ end
+ if use_tkConfig && !tkConfig_dir
+ if tkConfig_file
+ tkConfig_dir = File.dirname(tkConfig_file)
+ elsif tclConfig_dir
+ tkConfig_dir = tclConfig_dir
+ end
+ end
+ tkConfig_dir ||= tclConfig_dir
+
+ if use_tclConfig
+ TkLib_Config["tclConfig-file"] = tclConfig_file
+ TkLib_Config["tclConfig-dir"] = tclConfig_dir
+ else
+ tclConfig_file = false
+ tclConfig_dir = false
+ end
+ if use_tkConfig
+ TkLib_Config["tkConfig-file"] = tkConfig_file
+ TkLib_Config["tkConfig-dir"] = tkConfig_dir
+ else
+ tkConfig_file = false
+ tkConfig_dir = false
+ end
+
+ print ("Don't use tclConfig.sh (specified by configure option).\n") unless use_tclConfig
+ print ("Don't use tkConfig.sh (specified by configure option).\n") unless use_tkConfig
+ print("Search ")
+ print("tclConfig.sh", (tclConfig_dir)? " (in #{tclConfig_dir})": "") if use_tclConfig
+ print((use_tclConfig)? " and ": "", "tkConfig.sh", (tkConfig_dir)? " (in #{tkConfig_dir})": "") if use_tkConfig
+ print(".")
+
+ if tclConfig_dir || tkConfig_dir || !use_tclConfig || !use_tkConfig
+ tclConfig, tkConfig =
+ search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir),
+ ((tkConfig_file)? tkConfig_file: tkConfig_dir) ])
+ else
+ tclConfig, tkConfig = search_tclConfig()
+ end
+ print("\n")
+ # TclConfig_Info = TkLib_Config["tclConfig_info"]
+ # TkConfig_Info = TkLib_Config["tkConfig_info"]
+
+ if tclConfig || tkConfig
+ dirs = TkLib_Config["tclConfig_paths"].map{|tclpath, tkpath|
+ [ (tclpath)? File.dirname(tclpath): nil,
+ (tkpath)? File.dirname(tkpath): nil ]
+ }
+ dirs |= dirs
+ puts("Valid [tclConfig.sh, tkConfig.sh] are found in #{dirs.inspect}")
+ puts("Use [tclConfig.sh, tkConfig.sh] == #{[tclConfig, tkConfig].inspect}")
+ $LIBPATH ||= []
+ $LIBPATH |= [File.dirname(tclConfig)] if tclConfig
+ $LIBPATH |= [File.dirname(tkConfig)] if tkConfig
+ #TkLib_Config["tclConfig_paths"].each{|tclcfg, tkcfg|
+ # $LIBPATH |= [File.dirname(tclcfg)] | [File.dirname(tkcfg)]
+ #}
+ else
+ puts("Fail to find [tclConfig.sh, tkConfig.sh]")
+ end
+
+ [tclConfig, tkConfig]
+end
+
+def check_tcl_NG_path(path_list)
+ path_list.find_all{|path| not TkLib_Config["tcl-NG-path"].include?(path) }
+end
+
+def check_tk_NG_path(path_list)
+ path_list.find_all{|path| not TkLib_Config["tk-NG-path"].include?(path) }
+end
+
+def check_NG_path(path_list)
+ path_list.find_all{|path|
+ not (TkLib_Config["tcl-NG-path"].include?(path) &&
+ TkLib_Config["tk-NG-path"].include?(path))
+ }
+end
+
+def check_shlib_search_path(paths)
+ if !paths || paths.empty?
+ path_list = []
+
+ #if TkLib_Config["ActiveTcl"]
+ # path_list.concat Dir.glob(TkLib_Config["ActiveTcl"], File::FNM_CASEFOLD).sort.reverse
+ #end
+ if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
+ path_list.concat Dir.glob(TkLib_Config["ActiveTcl"], File::FNM_CASEFOLD).sort.reverse
+ end
+
+ vers = get_shlib_versions
+ path_head, path_dirs = get_shlib_path_head
+
+ path_list.concat vers.map{|ver|
+ path_head.map{|head|
+ if ver.empty?
+ head + "/lib"
+ else
+ dirs = []
+
+ if Dir.glob(head, File::FNM_CASEFOLD).find{|dir| dir == head}
+ dirs << head + "/lib"
+ end
+
+ if !Dir.glob(head + "-*", File::FNM_CASEFOLD).empty?
+ dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*", File::FNM_CASEFOLD).empty?
+ dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*", File::FNM_CASEFOLD).empty?
+ end
+
+ if !Dir.glob(head + "[_-]*", File::FNM_CASEFOLD).empty?
+ dirs << head + "_#{ver}/lib" if !Dir.glob(head + "_[89].*", File::FNM_CASEFOLD).empty?
+ dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*", File::FNM_CASEFOLD).empty?
+ dirs << head + "_#{ver.delete('.')}/lib" if !Dir.glob(head + "_[89][0-9]*", File::FNM_CASEFOLD).empty?
+ dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*", File::FNM_CASEFOLD).empty?
+ end
+
+ dirs
+ end
+ }
+ }.flatten!
+
+ path_list.concat path_dirs
+
+ else
+ # paths is a string with PATH environment style
+ path_list = paths.split((is_win32?)? ';': ':')
+ end
+
+ path_list = check_NG_path(path_list)
+ path_list.map!{|path| path.strip}
+
+ if !CROSS_COMPILING and (is_win32? || is_macosx?)
+ # exist-dir only
+ path_list.delete_if{|path| Dir.glob(File.join(path, "*.{a,so,dll,lib}")).empty?}
+ end
+
+ # keep paths for searching dynamic libs
+ #$LIBPATH |= path_list
+ path_list.uniq
+end
+
+def search_vers_on_path(vers, path, *heads)
+ exts = get_ext_list.join(',')
+ files = Dir.glob(File.join(path, "*{#{heads.join(',')}}*.{#{exts}}"), File::FNM_CASEFOLD)
+ vers.find_all{|ver| files.find{|f| f =~ /(#{ver}|#{ver.delete('.')})/} }
+end
+
+def find_tcl(tcllib, stubs, version, *opt_paths)
+ if TclConfig_Info['MKMF_PARAMS']
+ # already checked existence of tcl library based on tclConfig.sh
+ ($INCFLAGS ||= "") << " " << TclConfig_Info['MKMF_PARAMS']['INCFLAGS']
+ $LIBPATH ||= []; $LIBPATH |= TclConfig_Info['MKMF_PARAMS']['LIBPATH']
+ ($libs ||= "") << " " << TclConfig_Info['MKMF_PARAMS']['libs']
+ return [true, nil, nil, nil]
+ end
+ # else, no available tclConfig.sh on the system
+
+ print "Search Tcl library"
+
+ if stubs
+ func = "Tcl_InitStubs"
+ lib = "tclstub"
+ else
+ func = "Tcl_FindExecutable"
+ lib = "tcl"
+ end
+
+ if version && ! version.empty?
+ versions = [version]
+ else
+ versions = TkLib_Config['search_versions']
+ end
+
+ default_paths = []
+
+ default_paths.concat [
+ RbConfig::CONFIG['libdir'],
+ File.join(RbConfig::CONFIG['exec_prefix'], 'lib'),
+ File.join(RbConfig::CONFIG['prefix'], 'lib'),
+ "/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
+ ].find_all{|dir| File.directory?(dir)} unless CROSS_COMPILING
+
+ if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
+ default_paths.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse.map{|d| d << "/lib"}
+ end
+
+ if !CROSS_COMPILING and is_win32?
+ default_paths.concat [
+ "c:/Tcl/lib","c:/Program Files/Tcl/lib","c:/Program Files (x86)/Tcl/lib",
+ "/Tcl/lib","/Program Files/Tcl/lib","/Program Files (x86)/Tcl/lib"
+ ].find_all{|dir| File.directory?(dir)}.map{|dir| File.expand_path(dir)}
+
+ # for MinGW
+ ["/usr/local/lib64", "/usr/lib64", "/usr/local/lib", "/usr/lib"].each{|dir|
+ default_paths << File.expand_path(dir) if File.directory? dir
+ }
+
+ default_paths |= ENV['LIBRARY_PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['LIBRARY_PATH']
+ default_paths |= ENV['PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['PATH']
+ end
+
+ default_paths |= TkLib_Config["checked_shlib_dirs"]
+
+ unless TkLib_Config["space-on-tk-libpath"]
+ default_paths.delete_if{|path| path =~ / /}
+ end
+
+ if (paths = opt_paths.compact).empty?
+ paths = check_tcl_NG_path(default_paths)
+ end
+
+ incflags = ($INCFLAGS ||= "").dup
+ libpath = ($LIBPATH ||= []).dup
+ libs_param = ($libs ||= "").dup
+ tcllibs = nil
+
+ exts = "(" + get_ext_list.join('|') + ")"
+
+ paths.map{|path|
+ lib_w_sufx = lib
+ begin
+ $LIBPATH |= [path]
+ inc = [File.join(File.dirname(path),"include"), File.dirname(path)]
+ inc.each{|f| $INCFLAGS << " -I" << f }
+
+ if tcllib
+ print(".")
+ if have_library(tcllib, func, ["tcl.h"])
+ return [true, path, tcllib, nil, *inc]
+ end
+ else
+ sufx_list = ['', 't', 'g', 's', 'x']
+ search_vers_on_path(versions, path, lib, 'tcl').find{|ver|
+ dir_enum = Dir.foreach(path)
+ no_dot_ver = ver.delete('.')
+ libnames = ["#{lib}#{ver}", "#{lib}#{no_dot_ver}"]
+ libnames << "tcl#{ver}" << "tcl#{no_dot_ver}" if lib != "tcl"
+ libnames.find{|libname|
+ sufx_list.find{|sufx|
+ print(".")
+ dir_enum.map{|fname|
+ if fname =~ /^.*(#{libname}.*#{sufx})\.(#{exts}).*$/
+ [fname, $1, $2]
+ end
+ }.compact.find{|fname, lib_w_sufx, ext|
+ ext.downcase!
+ if (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) ||
+ ext == "a"
+ # static link
+ tcllibs = libs_param + " -DSTATIC_BUILD " + fname.quote
+ else
+ tcllibs = append_library($libs, lib_w_sufx)
+ tcllibs = "#{libpathflag([path])} #{tcllibs}"
+ end
+ if try_func(func, tcllibs, ["tcl.h"])
+ return [true, path, nil, tcllibs, *inc]
+ end
+ }
+ }
+ }
+ }
+ if (!version && (print(".");try_func(func, libs_param, ["tcl.h"])))
+ return [true, path, lib_w_sufx, nil, *inc]
+ end
+ end
+ ensure
+ $LIBPATH = libpath.dup
+ $libs = libs_param.dup
+ $INCFLAGS = incflags.dup
+ end
+ }
+
+ print("\n") # progress
+ [false, nil, nil, nil]
+end
+
+def parse_TK_LIBS(tklibs)
+ sfx = "lib|shlib|dll|so"
+ re = /(("|')[^"']+\.(#{sfx})\2|[^"' ]+\.(#{sfx})|-l("|')[^"']+\5|-l[^" ]+)/#'
+
+ tklibs.scan(re).map{|lib,|
+ if lib =~ /^("|')([^"]+)\.(#{sfx})\1/
+ "\"-l#{$2}\""
+ elsif lib =~ /([^" ]+)\.(#{sfx})/
+ "-l#{$1}"
+ else
+ lib
+ end
+ }.join(' ')
+end
+
+def find_tk(tklib, stubs, version, *opt_paths)
+ if TkConfig_Info['MKMF_PARAMS']
+ # already checked existence of tcl library based on tkConfig.sh
+ ($INCFLAGS ||= "") << " " << TkConfig_Info['MKMF_PARAMS']['INCFLAGS']
+ $LIBPATH ||= []; $LIBPATH |= TkConfig_Info['MKMF_PARAMS']['LIBPATH']
+ ($libs ||= "") << " " << TkConfig_Info['MKMF_PARAMS']['libs']
+ return [true, nil, nil, nil]
+ end
+ # else, no available tkConfig.sh on the system
+
+ print "Search Tk library"
+
+ if stubs
+ func = "Tk_InitStubs"
+ lib = "tkstub"
+ else
+ func = "Tk_Init"
+ lib = "tk"
+ end
+
+ if version && ! version.empty?
+ versions = [version]
+ else
+ versions = TkLib_Config['search_versions']
+ end
+
+ default_paths = []
+
+ default_paths.concat [
+ RbConfig::CONFIG['libdir'],
+ File.join(RbConfig::CONFIG['exec_prefix'], 'lib'),
+ File.join(RbConfig::CONFIG['prefix'], 'lib'),
+ "/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
+ ].find_all{|dir| File.directory?(dir)} unless CROSS_COMPILING
+
+ if !CROSS_COMPILING and is_win32?
+ default_paths.concat [
+ "c:/Tcl/lib","c:/Program Files/Tcl/lib","c:/Program Files (x86)/Tcl/lib",
+ "/Tcl/lib","/Program Files/Tcl/lib","/Program Files (x86)/Tcl/lib"
+ ].find_all{|dir| File.directory?(dir)}
+
+ # for MinGW
+ ["/usr/local/lib64", "/usr/lib64", "/usr/local/lib", "/usr/lib"].each{|dir|
+ default_paths << File.expand_path(dir) if File.directory? dir
+ }
+
+ default_paths |= ENV['LIBRARY_PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['LIBRARY_PATH']
+ default_paths |= ENV['PATH'].split(';').find_all{|dir| File.directory? dir}.map{|dir| File.expand_path(dir)} if ENV['PATH']
+ end
+
+ default_paths |= TkLib_Config["checked_shlib_dirs"]
+
+ unless TkLib_Config["space-on-tk-libpath"]
+ default_paths.delete_if{|path| path =~ / /}
+ end
+
+ if (paths = opt_paths.compact).empty?
+ paths = check_tk_NG_path(default_paths)
+ end
+
+ incflags = ($INCFLAGS ||= "").dup
+ libpath = ($LIBPATH ||= []).dup
+ libs_param = ($libs ||= "").dup
+ tcllibs = nil
+
+ exts = "(" + get_ext_list.join('|') + ")"
+
+ paths.map{|path|
+ lib_w_sufx = lib
+ begin
+ $LIBPATH |= [path]
+ inc = [File.join(File.dirname(path),"include"), File.dirname(path)]
+ inc.each{|f| $INCFLAGS << " -I" << f }
+
+ if tklib
+ print(".")
+ if have_library(tklib, func, ["tcl.h", "tk.h"])
+ return [true, path, tklib, nil, *inc]
+ end
+ else
+ sufx_list = ['', 't', 'g', 's', 'x']
+ search_vers_on_path(versions, path, lib, 'tk').find{|ver|
+ dir_enum = Dir.foreach(path)
+ no_dot_ver = ver.delete('.')
+ libnames = ["#{lib}#{ver}", "#{lib}#{no_dot_ver}"]
+ libnames << "tk#{ver}" << "tk#{no_dot_ver}" if lib != "tk"
+ libnames.find{|libname|
+ sufx_list.find{|sufx|
+ print(".")
+ dir_enum.map{|fname|
+ if fname =~ /^.*(#{libname}.*#{sufx})\.(#{exts}).*$/
+ [fname, $1, $2]
+ end
+ }.compact.find{|fname, lib_w_sufx, ext|
+ if (ext != CONFIG['DLEXT'] && ext == CONFIG['LIBEXT']) ||
+ ext == "a"
+ # static link
+ tklibs = libs_param + " -DSTATIC_BUILD " + fname.quote
+ else
+ tklibs = append_library($libs, lib_w_sufx)
+ tklibs = "#{libpathflag([path])} #{tklibs}"
+ end
+ if try_func(func, tklibs, ["tcl.h", "tk.h"])
+ return [true, path, nil, tklibs, *inc]
+ end
+ }
+ }
+ }
+ }
+ if (!version && (print(".");try_func(func, libs_param, ["tcl.h", "tk.h"])))
+ return [true, path, lib_w_sufx, nil, *inc]
+ end
+ end
+ ensure
+ $LIBPATH = libpath
+ $libs = libs_param
+ $INCFLAGS = incflags.dup
+ end
+ }
+
+ print("\n") # progress
+ [false, nil, nil, nil]
+end
+
+def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion,
+ tcl_opt_paths, tk_opt_paths)
+ st,path,lib,libs,*inc = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths)
+ if !st && TkLib_Config['enable-shared'] == nil
+ TkLib_Config['enable-shared'] = false
+ st,path,lib,libs,*inc = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths)
+ end
+ unless st
+ puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.")
+ return false
+ else
+ ($LIBPATH ||= []; $LIBPATH |= [path]) if path
+ $libs = append_library($libs, lib) if lib
+ ($libs ||= "") << " " << libs if libs
+ $INCFLAGS ||= ""
+ inc.each{|f| $INCFLAGS << " -I" << f}
+ end
+
+ st,path,lib,libs,*inc = find_tk(tklib, stubs, tkversion, *tk_opt_paths)
+ if !st && TkLib_Config['enable-shared'] == nil
+ TkLib_Config['enable-shared'] = false
+ st,path,lib,libs,*inc = find_tk(tklib, stubs, tkversion, *tk_opt_paths)
+ end
+ unless st
+ puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.")
+ return false
+ else
+ ($LIBPATH ||= []; $LIBPATH |= [path]) if path
+ $libs = append_library($libs, lib) if lib && !lib.empty?
+ ($libs ||= "") << " " << libs if libs
+ $INCFLAGS ||= ""
+ inc.each{|f| $INCFLAGS << " -I" << f}
+ end
+
+ true
+end
+
+def find_tcltk_header(tclver, tkver)
+ base_dir = []
+
+ base_dir.concat [
+ File.join(RbConfig::CONFIG['prefix'], 'include'),
+ "/usr/local/include", "/usr/pkg/include", "/usr/contrib/include",
+ "/usr/include"
+ ].find_all{|dir| File.directory?(dir)}.map{|dir| File.expand_path(dir)}
+
+ if !CROSS_COMPILING && is_win32?
+ base_dir.concat [
+ "c:/Tcl/include","c:/Program Files/Tcl/include",
+ "c:/Program Files (x86)/Tcl/include",
+ "/Tcl/include","/Program Files/Tcl/include",
+ "/Program Files (x86)/Tcl/include"
+ ].find_all{|dir| File.directory?(dir)}.map{|dir| File.expand_path(dir)}
+
+ if ENV['CPATH']
+ base_dir |= ENV['CPATH'].split(';').find_all{|dir| File.directory?(dir)}.map{|dir| File.expand_path(dir)}
+ end
+ end
+
+ base_dir |= TkLib_Config["checked_shlib_dirs"]
+
+ unless TkLib_Config["space-on-tk-libpath"]
+ base_dir.delete_if{|path| path =~ / /}
+ end
+
+ # tcl.h
+ if TclConfig_Info['MKMF_PARAMS']
+ # already checked existence of tcl headers based on tclConfig.sh
+ have_tcl_h = true
+ else
+ print "\nSearch tcl.h"
+ if enable_config("tcl-h-ver-check", true) &&
+ tclver && tclver =~ /^\D*(\d)\.?(\d)/
+ major = $1; minor = $2
+ else
+ major = minor = nil
+ end
+ print(".") # progress
+ if major && minor
+ # version check on tcl.h
+ version_check = proc {|code|
+ code << ("#if TCL_MAJOR_VERSION != #{major} || TCL_MINOR_VERSION != #{minor}\n" \
+ "#error VERSION does not match\n" \
+ "#endif")
+ }
+ else
+ version_check = nil
+ end
+ have_tcl_h = have_header('tcl.h', &version_check)
+ unless have_tcl_h
+ if tclver && ! tclver.empty?
+ versions = [tclver]
+ else
+ versions = TkLib_Config['search_versions']
+ end
+ paths = base_dir.dup
+ (versions + [""]).each{|ver|
+ paths.concat(base_dir.map{|dir|
+ [
+ dir + '/tcl' + ver,
+ dir + '/tcl' + ver + '/include',
+ dir + '/tcl' + ver.delete('.'),
+ dir + '/tcl' + ver.delete('.') + '/include'
+ ]
+ }.flatten)
+ }
+ paths = paths.map{|dir|
+ (File.directory?(dir))? File.expand_path(dir): nil
+ }.compact.uniq
+
+ if major || minor
+ version_check = proc {|code|
+ code << "#if TCL_MAJOR_VERSION != #{major}\n#error MAJOR_VERSION does not match\n#endif\n" if major
+ code << "#if TCL_MINOR_VERSION != #{minor}\n#error MINOR_VERSION does not match\n#endif\n" if minor
+ code
+ }
+ else
+ version_check = nil
+ end
+ have_tcl_h = paths.find{|path|
+ print(".") # progress
+ inc_opt = " -I#{path.quote}"
+ if try_header("tcl", inc_opt, &version_check)
+ ($INCFLAGS ||= "") << inc_opt
+ true
+ else
+ false
+ end
+ }
+ end
+ end
+
+ # tk.h
+ if TkConfig_Info['MKMF_PARAMS']
+ # already checked existence of tk headers based on tkConfig.sh
+ have_tk_h = true
+ else
+ print "\nSearch tk.h"
+ if enable_config("tk-h-ver-check", true) &&
+ tkver && tkver =~ /^\D*(\d)\.?(\d)/
+ major = $1; minor = $2
+ else
+ major = minor = nil
+ end
+ print(".") # progress
+ if major && minor
+ # version check on tk.h
+ version_check = proc {|code|
+ code << ("#if TK_MAJOR_VERSION != #{major} || TK_MINOR_VERSION != #{minor}\n" \
+ "#error VERSION does not match\n" \
+ "#endif")
+ }
+ else
+ version_check = nil
+ end
+ have_tk_h = have_header('tk.h')
+ unless have_tk_h
+ if tkver && ! tkver.empty?
+ versions = [tkver]
+ else
+ versions = TkLib_Config['search_versions']
+ end
+ paths = base_dir.dup
+ (versions + [""]).each{|ver|
+ paths.concat(base_dir.map{|dir|
+ [
+ dir + '/tk' + ver,
+ dir + '/tk' + ver + '/include',
+ dir + '/tk' + ver.delete('.'),
+ dir + '/tk' + ver.delete('.') + '/include'
+ ]
+ }.flatten)
+ }
+ paths = paths.map{|dir|
+ (File.directory?(dir))? File.expand_path(dir): nil
+ }.compact.uniq
+
+ if major || minor
+ version_check = proc {|code|
+ code << "#if TK_MAJOR_VERSION != #{major}\n#error MAJOR_VERSION does not match\n#endif\n" if major
+ code << "#if TK_MINOR_VERSION != #{minor}\n#error MINOR_VERSION does not match\n#endif\n" if minor
+ code
+ }
+ else
+ version_check = nil
+ end
+ have_tk_h = paths.find{|path|
+ print(".") # progress
+ inc_opt = " -I#{path.quote}"
+ if try_header(%w'tcl.h tk.h', inc_opt, &version_check)
+ ($INCFLAGS ||= "") << inc_opt
+ true
+ else
+ false
+ end
+ }
+ end
+ end
+
+ puts "Can't find \"tcl.h\"." unless have_tcl_h
+ puts "Can't find \"tk.h\"." unless have_tk_h
+ have_tcl_h && have_tk_h
+end
+
+def setup_for_macosx_framework(tclver, tkver)
+ # use framework, but no tclConfig.sh
+ unless $LIBS && $LIBS.include?('-framework')
+ ($LIBS ||= "") << ' -framework Tk -framework Tcl'
+ end
+
+ if TkLib_Config["tcl-framework-header"]
+ TclConfig_Info['TCL_INCLUDE_SPEC'][0,0] =
+ " -I#{TkLib_Config["tcl-framework-header"].quote} "
+ else
+ tcl_base = File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework')
+ if tclver
+ TclConfig_Info['TCL_INCLUDE_SPEC'] <<
+ " -I#{File.join(tcl_base, 'Versions', tclver, 'Headers').quote} "
+ end
+
+ TclConfig_Info['TCL_INCLUDE_SPEC'] << File.join(tcl_base, 'Headers')
+
+ unless tclver
+ dir = Dir.glob(File.join(tcl_base, 'Versions', '*', 'Headers'),
+ File::FNM_CASEFOLD).sort.reverse[0]
+ TclConfig_Info['TCL_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir
+ end
+ end
+
+ if TkLib_Config["tk-framework-header"]
+ TkConfig_Info['TK_INCLUDE_SPEC'][0,0] =
+ " -I#{TkLib_Config["tk-framework-header"].quote} "
+ else
+ tk_base = File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')
+ if tkver
+ TkConfig_Info['TK_INCLUDE_SPEC'] <<
+ " -I#{File.join(tk_base, 'Versions', tkver, 'Headers').quote} "
+ end
+
+ TkConfig_Info['TK_INCLUDE_SPEC'] << File.join(tk_base, 'Headers')
+
+ unless tkver
+ dir = Dir.glob(File.join(tk_base, 'Versions', '*', 'Headers'),
+ File::FNM_CASEFOLD).sort.reverse[0]
+ TkConfig_Info['TK_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir
+ end
+ end
+end
+
+def find_X11(*opt_paths)
+ defaults =
+ [ "/usr/X11*/lib", "/usr/lib/X11*", "/usr/local/X11*", "/usr/openwin/lib" ]
+ paths = []
+ opt_paths.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/'), File::FNM_CASEFOLD))}
+ defaults.compact.each{|path| paths.concat(Dir.glob(path.strip.chomp('/'), File::FNM_CASEFOLD))}
+ st = find_library("X11", "XOpenDisplay", *paths)
+ unless st
+ puts("Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.")
+ end
+ st
+end
+
+def search_X_libraries
+ use_tkConfig = false
+ if TkConfig_Info['config_file_path']
+ # use definitions on tkConfig.sh
+ if (TkConfig_Info['TK_XINCLUDES'] &&
+ !TkConfig_Info['TK_XINCLUDES'].strip.empty?) ||
+ (TkConfig_Info['TK_XLIBSW'] && !TkConfig_Info['TK_XLIBSW'].strip.empty?)
+ use_tkConfig = true
+ #use_X = true && with_config("X11", ! is_win32?)
+ use_X = with_config("X11", true)
+ else
+ #use_X = false || with_config("X11", false)
+ use_X = with_config("X11", false)
+ end
+ else
+ # depend on configure options
+ use_X = with_config("X11", !(is_win32? || TkLib_Config["tcltk-framework"]))
+ end
+
+ if TkConfig_Info['TK_XINCLUDES'] &&
+ !TkConfig_Info['TK_XINCLUDES'].strip.empty?
+ ($INCFLAGS ||= "") << " " << TkConfig_Info['TK_XINCLUDES'].strip
+ end
+
+ if use_X
+ puts("Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).")
+ x11_idir, x11_ldir = dir_config("X11")
+ x11_ldir2 = with_config("X11-lib")
+ unless find_X11(x11_ldir2, x11_ldir)
+ puts("Can't find X11 libraries. ")
+ if use_tkConfig &&
+ TkConfig_Info['TK_XLIBSW'] && !TkConfig_Info['TK_XLIBSW'].strip.empty?
+ puts("But, try to use TK_XLIBSW information (believe tkCOnfig.sh).")
+ ($libs ||= "") << " " << TkConfig_Info['TK_XLIBSW'] << " "
+ else
+ puts("So, can't make tcltklib.so which is required by Ruby/Tk.")
+ exit
+ end
+ end
+ end
+
+ use_X
+end
+
+def pthread_check()
+ tcl_major_ver = nil
+ tcl_minor_ver = nil
+
+ # Is tcl-thread given by user ?
+ case enable_config("tcl-thread")
+ when true
+ tcl_enable_thread = true
+ when false
+ tcl_enable_thread = false
+ else
+ tcl_enable_thread = nil
+ end
+
+ 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.")
+ elsif tcl_enable_thread == false
+ puts("Warning: definition of tclConfig.sh is ignored, because --disable-tcl-thread option is given.")
+ else
+ # tcl-thread is unknown and tclConfig.sh is given
+ if TclConfig_Info['TCL_THREADS']
+ tcl_enable_thread = (TclConfig_Info['TCL_THREADS'] == "1")
+ else
+ tcl_major_ver = TclConfig_Info['TCL_MAJOR_VERSION'].to_i
+ tcl_minor_ver = TclConfig_Info['TCL_MINOR_VERSION'].to_i
+ if tcl_major_ver < 8 || (tcl_major_ver == 8 && tcl_minor_ver == 0)
+ tcl_enable_thread = false
+ end
+ end
+
+ if tcl_enable_thread == nil
+ # cannot find definition
+ if tcl_major_ver
+ puts("Warning: '#{TclConfig_Info['config_file_path']}' doesn't include TCL_THREADS definition.")
+ else
+ puts("Warning: '#{TclConfig_Info['config_file_path']}' may not be a tclConfig file.")
+ end
+ #tclConfig = false
+ end
+ end
+ end
+
+ if tcl_enable_thread == nil && !TclConfig_Info['config_file_path']
+ # tcl-thread is unknown and tclConfig is unavailable
+ begin
+ try_run("int main() { exit(0); }")
+ rescue Exception
+ # cannot try_run. Is CROSS-COMPILE environment?
+ puts(%Q'\
+*****************************************************************************
+**
+** NATIVETHREAD SUPPORT CHECK WARNING:
+**
+** We cannot check the consistency of nativethread support between
+** Ruby and the Tcl/Tk library in your environment (are you perhaps
+** cross-compiling?). If nativethread support for these 2 packages
+** is inconsistent you may find you get errors when running Ruby/Tk
+** (e.g. hangs or segmentation faults). We strongly recommend
+** you to check the consistency manually.
+**
+*****************************************************************************
+')
+ return true
+ end
+ end
+
+ if tcl_enable_thread == nil
+ # tcl-thread is unknown
+ if try_run(<<EOF)
+#include <tcl.h>
+int main() {
+ Tcl_Interp *ip;
+ ip = Tcl_CreateInterp();
+ exit((Tcl_Eval(ip, "set tcl_platform(threaded)") == TCL_OK)? 0: 1);
+}
+EOF
+ tcl_enable_thread = true
+ elsif try_run(<<EOF)
+#include <tcl.h>
+static Tcl_ThreadDataKey dataKey;
+int main() { exit((Tcl_GetThreadData(&dataKey, 1) == dataKey)? 1: 0); }
+EOF
+ tcl_enable_thread = true
+ else
+ tcl_enable_thread = false
+ end
+ end
+
+ # check pthread mode
+ if (TkLib_Config["ruby_with_thread"])
+ $CPPFLAGS ||= ""
+
+ # ruby -> enable
+ unless tcl_enable_thread
+ # ruby -> enable && tcl -> disable
+ puts(%Q'\
+*****************************************************************************
+**
+** NATIVETHREAD SUPPORT MODE WARNING:
+**
+** Ruby is compiled with --enable-pthread, but your Tcl/Tk library
+** seems to be compiled without nativethread support. Although you can
+** create the tcltklib library, this combination may cause errors (e.g.
+** hangs or segmentation faults). If you have no reason to keep the
+** current nativethread support status, we recommend you reconfigure and
+** recompile the libraries so that both or neither support nativethreads.
+**
+** If you want change the status of nativethread support, please recompile
+** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x
+** or later, you cannot remove this option, because it requires native-
+** thread support.) or recompile Tcl/Tk with "--enable-threads" configure
+** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1).
+**
+*****************************************************************************
+')
+ end
+
+ # ruby -> enable && tcl -> enable/disable
+ if tcl_enable_thread
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
+ else
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
+ end
+
+ return true
+
+ else
+ # ruby -> disable
+ if tcl_enable_thread
+ # ruby -> disable && tcl -> enable
+ puts(%Q'\
+*****************************************************************************
+**
+** NATIVETHREAD SUPPORT MODE ERROR:
+**
+** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
+** library seems to be compiled with nativethread support. This
+** combination may cause frequent hang or segmentation fault
+** errors when Ruby/Tk is working. We recommend that you NEVER
+** create the library with such a combination of nativethread support.
+**
+** Please recompile Ruby with the "--enable-pthread" configure option
+** or recompile Tcl/Tk with the "--disable-threads" configure option.
+**
+*****************************************************************************
+')
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
+ return false
+ else
+ # ruby -> disable && tcl -> disable
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
+ return true
+ end
+ end
+end
+
+##############################################################
+# main
+##############################################################
+# check header file
+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|
+ have_func(func, "ruby.h")
+ print(".") # progress
+end
+print("\n") # progress
+
+print("check struct members.")
+have_struct_member("struct RArray", "ptr", "ruby.h")
+print(".") # progress
+have_struct_member("struct RArray", "len", "ruby.h")
+print("\n") # progress
+
+# check libraries
+unless is_win32?
+ print("check libraries.")
+ have_library("nsl", "t_open")
+ print(".") # progress
+ have_library("socket", "socket")
+ print(".") # progress
+ have_library("dl", "dlopen")
+ print(".") # progress
+ have_library("m", "log", "math.h")
+ print("\n") # progress
+end
+$CPPFLAGS ||= ""
+$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
+
+# Does ruby have nativethread ?
+TkLib_Config["ruby_with_thread"] =
+ macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"')
+
+
+#---------------------------------------------------
+TclConfig_Info = {}
+TkConfig_Info = {}
+
+# use Tcl/Tk build dir? (has highest priority)
+TkLib_Config["tcl-build-dir"] = with_config("tcl-build-dir")
+TkLib_Config["tk-build-dir"] = with_config("tk-build-dir")
+if TkLib_Config["tcl-build-dir"]
+ puts("use Tcl build (pre-install) dir \"#{TkLib_Config["tcl-build-dir"]}\"")
+ TkLib_Config["tcl-build-dir"] = File.expand_path(TkLib_Config["tcl-build-dir"])
+ base = File.dirname(TkLib_Config["tcl-build-dir"])
+ ($INCFLAGS ||= "") << " -I#{File.join(base, "generic").quote} -I#{TkLib_Config["tcl-build-dir"].quote}"
+ $LIBPATH ||= []; $LIBPATH |= [TkLib_Config["tcl-build-dir"]]
+end
+if TkLib_Config["tk-build-dir"]
+ puts("use Tk build (pre-install) dir \"#{TkLib_Config["tk-build-dir"]}\"")
+ TkLib_Config["tk-build-dir"] = File.expand_path(TkLib_Config["tk-build-dir"])
+ base = File.dirname(TkLib_Config["tk-build-dir"])
+ ($INCFLAGS ||= "") << " -I#{File.join(base, "generic").quote} -I#{TkLib_Config["tk-build-dir"].quote}"
+ $LIBPATH ||= []; $LIBPATH |= [TkLib_Config["tk-build-dir"]]
+end
+
+# check requirement of Tcl/tk version
+tcltk_version = with_config("tcltkversion")
+TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version)
+
+if TkLib_Config["tcl-build-dir"]
+ if (cfgfile = with_config("tclConfig-file", Dir.glob(File.join(TkLib_Config["tcl-build-dir"], "tclConfig*.sh"), File::FNM_CASEFOLD)[0]))
+ TclConfig_Info['config_file_path'] = cfgfile
+ TkLib_Config["tclConfig_info"] = cfginfo = parse_tclConfig(cfgfile)
+ if tclver = TkLib_Config["tcltkversion"][0]
+ TkLib_Config["tcltkversion"][0].sub!(/\d(\.?)\d/, "#{cfginfo['TCL_MAJOR_VERSION']}\\1#{cfginfo['TCL_MINOR_VERSION']}")
+ else
+ TkLib_Config["tcltkversion"][0] = "#{cfginfo['TCL_MAJOR_VERSION']}.#{cfginfo['TCL_MINOR_VERSION']}"
+ end
+ end
+end
+if TkLib_Config["tk-build-dir"]
+ if (cfgfile = with_config("tkConfig-file", Dir.glob(File.join(TkLib_Config["tk-build-dir"], "tkConfig*.sh"), File::FNM_CASEFOLD)[0]))
+ TkConfig_Info['config_file_path'] = cfgfile
+ TkLib_Config["tkConfig_info"] = cfginfo = parse_tclConfig(cfgfile)
+ if TkLib_Config["tcltkversion"][1]
+ TkLib_Config["tcltkversion"][1].sub!(/\d(\.?)\d/, "#{cfginfo['TK_MAJOR_VERSION']}\\1#{cfginfo['TK_MINOR_VERSION']}")
+ else
+ TkLib_Config["tcltkversion"][1] = "#{cfginfo['TK_MAJOR_VERSION']}.#{cfginfo['TK_MINOR_VERSION']}"
+ end
+ end
+end
+
+tclver, tkver = TkLib_Config["tcltkversion"]
+puts("Specified Tcl/Tk version is #{[tclver, tkver].inspect}") if tclver||tkver
+
+# use ActiveTcl ?
+#if activeTcl = with_config("ActiveTcl")
+#if activeTcl = with_config("ActiveTcl", true)
+if activeTcl = with_config("ActiveTcl", !(TkLib_Config["tcl-build-dir"] && TkLib_Config["tk-build-dir"]))
+ puts("Use ActiveTcl libraries (if available).")
+ unless activeTcl.kind_of? String
+ # set default ActiveTcl path
+ if CROSS_COMPILING
+ elsif is_win32?
+ activeTcl = 'c:/Tcl*'
+ elsif is_macosx?
+ activeTcl = '/Library/Frameworks'
+ else
+ activeTcl = '/opt/ActiveTcl*'
+ end
+ end
+end
+TkLib_Config["ActiveTcl"] = activeTcl
+
+# allow space chars on a libpath
+TkLib_Config["space-on-tk-libpath"] =
+ enable_config("space-on-tk-libpath", ! is_win32?)
+
+# enable Tcl/Tk stubs?
+=begin
+if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] &&
+ !TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? &&
+ !TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty?
+ stubs = true
+ unless (st = enable_config("tcltk-stubs")).nil?
+ stubs &&= st
+ end
+ unless (st = with_config("tcltk-stubs")).nil?
+ stubs &&= st
+ end
+else
+ stubs = enable_config("tcltk-stubs") || with_config("tcltk-stubs")
+end
+=end
+stubs = enable_config("tcltk-stubs") || with_config("tcltk-stubs")
+if (TkLib_Config["tcltk-stubs"] = stubs)
+ puts("Compile with Tcl/Tk stubs.")
+ $CPPFLAGS ||= ""; $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS'
+end
+
+# directory configuration of Tcl/Tk libraries
+if TkLib_Config["tcl-build-dir"]
+ tcl_idir = File.join(File.dirname(TkLib_Config["tcl-build-dir"]),"generic")
+ tcl_ldir = TkLib_Config["tcl-build-dir"]
+else
+ tcl_idir, tcl_ldir = dir_config("tcl")
+end
+if TkLib_Config["tk-build-dir"]
+ tk_idir = File.join(File.dirname(TkLib_Config["tk-build-dir"]),"generic")
+ tk_ldir = TkLib_Config["tk-build-dir"]
+else
+ tk_idir, tk_ldir = dir_config("tk")
+end
+
+tcl_idir = tk_idir unless tcl_idir
+tcl_ldir = tk_ldir unless tcl_ldir
+tk_idir = tcl_idir unless tk_idir
+tk_ldir = tcl_ldir unless tk_ldir
+
+TclConfig_Info['TCL_INCLUDE_SPEC'] ||= ""
+TkConfig_Info['TK_INCLUDE_SPEC'] ||= ""
+TclConfig_Info['TCL_INCLUDE_SPEC'][0,0] = "-I#{tcl_idir.quote} " if tcl_idir
+TkConfig_Info['TK_INCLUDE_SPEC'][0,0] = "-I#{tk_idir.quote} " if tk_idir
+
+# get tclConfig.sh/tkConfig.sh
+TkLib_Config["tcl-NG-path"] = []
+TkLib_Config["tk-NG-path"] = []
+tclcfg, tkcfg =
+ get_tclConfig(
+ TclConfig_Info['config_file_path'] || with_config("tclConfig-file", true),
+ TkConfig_Info['config_file_path'] || with_config("tkConfig-file", true),
+ (TclConfig_Info['config_file_path'])?
+ File.dirname(TclConfig_Info['config_file_path']) :
+ with_config("tclConfig-dir", tcl_ldir || true),
+ (TkConfig_Info['config_file_path'])?
+ File.dirname(TkConfig_Info['config_file_path']) :
+ with_config("tkConfig-dir", tk_ldir || true)
+ )
+TclConfig_Info.merge!(TkLib_Config["tclConfig_info"]) if TkLib_Config["tclConfig_info"]
+TkConfig_Info.merge!(TkLib_Config["tkConfig_info"]) if TkLib_Config["tkConfig_info"]
+TclConfig_Info['config_file_path'] ||= tclcfg
+TkConfig_Info['config_file_path'] ||= tkcfg
+
+tk_cfg_dir = File.dirname(TkConfig_Info['config_file_path']) rescue nil
+tcl_cfg_dir = File.dirname(TclConfig_Info['config_file_path']) rescue nil
+
+tk_ldir_list = [tk_ldir, tk_cfg_dir].uniq
+tcl_ldir_list = [tcl_ldir, tcl_cfg_dir].uniq
+
+if TkConfig_Info['config_file_path']
+ if TkLib_Config["tk-build-dir"]
+ spec_dir = get_libpath(TkConfig_Info['TK_LIB_FLAG'], TkConfig_Info['TK_BUILD_LIB_SPEC'])
+ else
+ spec_dir = get_libpath(TkConfig_Info['TK_LIB_FLAG'], TkConfig_Info['TK_LIB_SPEC'])
+ end
+ tk_ldir_list << spec_dir if File.directory?(spec_dir)
+end
+if TclConfig_Info['config_file_path']
+ if TkLib_Config["tcl-build-dir"]
+ spec_dir = get_libpath(TclConfig_Info['TCL_LIB_FLAG'], TclConfig_Info['TCL_BUILD_LIB_SPEC'])
+ else
+ spec_dir = get_libpath(TclConfig_Info['TCL_LIB_FLAG'], TclConfig_Info['TCL_LIB_SPEC'])
+ end
+ tcl_ldir_list << spec_dir if File.directory?(spec_dir)
+end
+
+# check tk_shlib_search_path
+TkLib_Config["checked_shlib_dirs"] =
+ check_shlib_search_path(with_config('tk-shlib-search-path'))
+
+# set TCL_DEFS and TK_DEFS
+$CPPFLAGS ||= ""
+# $CPPFLAGS += " #{TclConfig_Info['TCL_DEFS']}"
+# $CPPFLAGS += " #{TkConfig_Info['TK_DEFS']}"
+$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 ||= "") << " " << libpathflag([TkLib_Config["tcl-build-dir"]]) if TkLib_Config["tcl-build-dir"]
+
+ libs = ''
+ if tcl_cfg_dir
+ TclConfig_Info['TCL_LIBS'] ||= ""
+ ($INCFLAGS ||= "") << ' ' << TclConfig_Info['TCL_INCLUDE_SPEC']
+ libs << ' ' << TclConfig_Info['TCL_LIBS']
+ if stubs
+ if TkLib_Config["tcl-build-dir"] &&
+ TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'] &&
+ !TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'].strip.empty?
+ libs << ' ' << TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC']
+ else
+ libs << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC']
+ end
+ else
+ if TkLib_Config["tcl-build-dir"] &&
+ TclConfig_Info['TCL_BUILD_LIB_SPEC'] &&
+ !TclConfig_Info['TCL_BUILD_LIB_SPEC'].strip.empty?
+ libs << ' ' << TclConfig_Info['TCL_BUILD_LIB_SPEC']
+ else
+ libs << ' ' << TclConfig_Info['TCL_LIB_SPEC']
+ end
+ end
+ end
+
+ libs << " " << libpathflag([TkLib_Config["tk-build-dir"]]) if TkLib_Config["tk-build-dir"]
+
+ if tk_cfg_dir
+ TkConfig_Info['TK_LIBS'] ||= ""
+ ($INCFLAGS ||= "") << ' ' << TkConfig_Info['TK_INCLUDE_SPEC']
+ libs << ' ' << TkConfig_Info['TK_LIBS']
+ if stubs
+ if TkLib_Config["tk-build-dir"] &&
+ TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'] &&
+ !TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'].strip.empty?
+ libs << ' ' << TkConfig_Info['TK_BUILD_STUB_LIB_SPEC']
+ else
+ libs << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC']
+ end
+ else
+ if TkLib_Config["tk-build-dir"] &&
+ TclConfig_Info['TK_BUILD_LIB_SPEC'] &&
+ !TclConfig_Info['TK_BUILD_LIB_SPEC'].strip.empty?
+ libs << ' ' << TkConfig_Info['TK_BUILD_LIB_SPEC']
+ else
+ libs << ' ' << TkConfig_Info['TK_LIB_SPEC']
+ end
+ end
+ end
+ $LDFLAGS << ' ' << libs
+ setup_for_macosx_framework(tclver, tkver) if tcl_cfg_dir && tk_cfg_dir
+end
+
+# name of Tcl/Tk libraries
+tklib = with_config("tklib")
+tcllib = with_config("tcllib")
+
+# search X libraries
+use_X = search_X_libraries
+
+
+#---------------------------------------------------
+if (TkLib_Config["tcltk-framework"] ||
+ ( find_tcltk_header(tclver, tkver) &&
+ find_tcltk_library(tcllib, tklib, stubs, tclver, tkver,
+ tcl_ldir_list, tk_ldir_list) ) ) &&
+ (stubs || pthread_check())
+ # create Makefile
+
+ # for SUPPORT_STATUS
+ $INSTALLFILES ||= []
+ $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
+
+ # create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
+
+ # remove harmful definitions.
+ $defs.delete_if{|x|/^-Du?intptr_t=/ =~ x}
+
+ create_makefile("tcltklib")
+
+ puts "\nFind Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk."
+else
+ puts "\nCan't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk."
+ puts "If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib)."
+ puts "At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4."
+end
diff --git a/ext/tk/lib/README b/ext/tk/lib/README
new file mode 100644
index 0000000000..c076755756
--- /dev/null
+++ b/ext/tk/lib/README
@@ -0,0 +1,30 @@
+README this file
+multi-tk.rb multiple Tk interpreter (included safe-Tk) support
+remotei-tk.rb control remote Tk interpreter on the other process support
+tk.rb Tk interface
+
+tk/ library files construct Ruby/Tk
+
+tkextlib/ non-standard Tcl/Tk extension support libraries
+
+*********************************************************************
+*** The followings exists for backward compatibility only.
+*** The only thing which they work is that requires current
+*** library files ( tk/*.rb ).
+*********************************************************************
+tkafter.rb handles Tcl after
+tkbgerror.rb Tk error module
+tkcanvas.rb Tk canvas interface
+tkclass.rb provides generic names for Tk classes
+tkconsole.rb console command support
+tkdialog.rb Tk dialog class
+tkentry.rb Tk entry class
+tkfont.rb Tk font support
+tkmacpkg.rb Mac resource support
+tkmenubar.rb TK menubar utility
+tkmngfocus.rb focus manager
+tkpalette.rb pallete support
+tkscrollbox.rb scroll box, also example of compound widget
+tktext.rb text classes
+tkvirtevent.rb virtual event support
+tkwinpkg.rb Win DDE and registry support
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
new file mode 100644
index 0000000000..bb6e69aab6
--- /dev/null
+++ b/ext/tk/lib/multi-tk.rb
@@ -0,0 +1,3754 @@
+#
+# multi-tk.rb - supports multi Tk interpreters
+# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+require 'tcltklib'
+require 'tkutil'
+require 'thread'
+
+if defined? Tk
+ fail RuntimeError,"'multi-tk' library must be required before requiring 'tk'"
+end
+
+################################################
+# ignore exception on the mainloop?
+
+TclTkLib.mainloop_abort_on_exception = true
+# TclTkLib.mainloop_abort_on_exception = false
+# TclTkLib.mainloop_abort_on_exception = nil
+
+
+################################################
+# add ThreadGroup check to TclTkIp.new
+class << TclTkIp
+ alias __new__ new
+ private :__new__
+
+ def new(*args)
+ if Thread.current.group != ThreadGroup::Default
+ raise SecurityError, 'only ThreadGroup::Default can call TclTkIp.new'
+ end
+ obj = __new__(*args)
+ obj.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+ obj
+ end
+end
+
+
+################################################
+# exceptiopn to treat the return value from IP
+class MultiTkIp_OK < Exception
+ def self.send(thread, ret=nil)
+ thread.raise self.new(ret)
+ end
+
+ def initialize(ret=nil)
+ super('succeed')
+ @return_value = ret
+ end
+
+ attr_reader :return_value
+ alias value return_value
+end
+MultiTkIp_OK.freeze
+
+
+################################################
+# methods for construction
+class MultiTkIp
+ class Command_Queue < Queue
+ def initialize(interp)
+ @interp = interp
+ super()
+ end
+
+ def push(value)
+ if !@interp || @interp.deleted?
+ fail RuntimeError, "Tk interpreter is already deleted"
+ end
+ super(value)
+ end
+ alias << push
+ alias enq push
+
+ def close
+ @interp = nil
+ end
+ end
+ Command_Queue.freeze
+
+ BASE_DIR = File.dirname(__FILE__)
+
+ WITH_RUBY_VM = Object.const_defined?(:RubyVM) && ::RubyVM.class == Class
+ WITH_ENCODING = defined?(::Encoding.default_external)
+ #WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
+
+ (@@SLAVE_IP_ID = ['slave'.freeze, TkUtil.untrust('0')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ @@IP_TABLE = TkUtil.untrust({}) unless defined?(@@IP_TABLE)
+
+ @@INIT_IP_ENV = TkUtil.untrust([]) unless defined?(@@INIT_IP_ENV) # table of Procs
+ @@ADD_TK_PROCS = TkUtil.untrust([]) unless defined?(@@ADD_TK_PROCS) # table of [name, args, body]
+
+ @@TK_TABLE_LIST = TkUtil.untrust([]) unless defined?(@@TK_TABLE_LIST)
+
+ unless defined?(@@TK_CMD_TBL)
+ @@TK_CMD_TBL = TkUtil.untrust(Object.new)
+
+ # @@TK_CMD_TBL.instance_variable_set('@tbl', {}.taint)
+ tbl_obj = TkUtil.untrust(Hash.new{|hash,key|
+ fail IndexError, "unknown command ID '#{key}'"
+ })
+ @@TK_CMD_TBL.instance_variable_set('@tbl', tbl_obj)
+
+ class << @@TK_CMD_TBL
+ allow = [
+ '__send__', '__id__', 'freeze', 'inspect', 'kind_of?', 'object_id',
+ '[]', '[]=', 'delete', 'each', 'has_key?'
+ ]
+ instance_methods.each{|m| undef_method(m) unless allow.index(m.to_s)}
+
+ def kind_of?(klass)
+ @tbl.kind_of?(klass)
+ end
+
+ def inspect
+ if Thread.current.group == ThreadGroup::Default
+ @tbl.inspect
+ else
+ ip = MultiTkIp.__getip
+ @tbl.reject{|idx, ent| ent.respond_to?(:ip) && ent.ip != ip}.inspect
+ end
+ end
+
+ def [](idx)
+ return unless (ent = @tbl[idx])
+ if Thread.current.group == ThreadGroup::Default
+ ent
+ elsif ent.respond_to?(:ip)
+ (ent.ip == MultiTkIp.__getip)? ent: nil
+ else
+ ent
+ end
+ end
+
+ def []=(idx,val)
+ if self.has_key?(idx) && Thread.current.group != ThreadGroup::Default
+ fail SecurityError,"cannot change the entried command"
+ end
+ @tbl[idx] = val
+ end
+
+ def delete(idx, &blk)
+ # if gets an entry, is permitted to delete
+ if self[idx]
+ @tbl.delete(idx)
+ elsif blk
+ blk.call(idx)
+ else
+ nil
+ end
+ end
+
+ def each(&blk)
+ if Thread.current.group == ThreadGroup::Default
+ @tbl.each(&blk)
+ else
+ ip = MultiTkIp.__getip
+ @tbl.each{|idx, ent|
+ blk.call(idx, ent) unless ent.respond_to?(:ip) && ent.ip != ip
+ }
+ end
+ self
+ end
+
+ def has_key?(k)
+ @tbl.has_key?(k)
+ end
+ alias include? has_key?
+ alias key? has_key?
+ alias member? has_key?
+ end
+
+ @@TK_CMD_TBL.freeze
+ end
+
+ ######################################
+
+ @@CB_ENTRY_CLASS = Class.new(TkCallbackEntry){
+ def initialize(ip, cmd)
+ @ip = ip
+ @safe = safe = $SAFE
+ # @cmd = cmd
+ cmd = MultiTkIp._proc_on_safelevel(&cmd)
+ @cmd = proc{|*args| cmd.call(safe, *args)}
+ self.freeze
+ end
+ attr_reader :ip, :cmd
+ def inspect
+ cmd.inspect
+ end
+ def call(*args)
+ unless @ip.deleted?
+ current = Thread.current
+ backup_ip = current[:callback_ip]
+ current[:callback_ip] = @ip
+ begin
+ ret = @ip.cb_eval(@cmd, *args)
+ fail ret if ret.kind_of?(Exception)
+ ret
+ rescue TkCallbackBreak, TkCallbackContinue => e
+ fail e
+ rescue SecurityError => e
+ # in 'exit', 'exit!', and 'abort' : security error --> delete IP
+ if e.backtrace[0] =~ /^(.+?):(\d+):in `(exit|exit!|abort)'/
+ @ip.delete
+ elsif @ip.safe?
+ if @ip.respond_to?(:cb_error)
+ @ip.cb_error(e)
+ else
+ nil # ignore
+ end
+ else
+ fail e
+ end
+ rescue Exception => e
+ fail e if e.message =~ /^TkCallback/
+
+ if @ip.safe?
+ if @ip.respond_to?(:cb_error)
+ @ip.cb_error(e)
+ else
+ nil # ignore
+ end
+ else
+ fail e
+ end
+ ensure
+ current[:callback_ip] = backup_ip
+ end
+ end
+ end
+ }.freeze
+
+ ######################################
+
+ def _keys2opts(src_keys)
+ return nil if src_keys == nil
+ keys = {}; src_keys.each{|k, v| keys[k.to_s] = v}
+ #keys.collect{|k,v| "-#{k} #{v}"}.join(' ')
+ keys.collect{|k,v| "-#{k} #{TclTkLib._conv_listelement(TkComm::_get_eval_string(v))}"}.join(' ')
+ end
+ private :_keys2opts
+
+ def _check_and_return(thread, exception, wait=0)
+ unless thread
+ unless exception.kind_of?(MultiTkIp_OK)
+ msg = "#{exception.class}: #{exception.message}"
+
+ if @interp.deleted?
+ warn("Warning (#{self}): " + msg)
+ return nil
+ end
+
+ if safe?
+ warn("Warning (#{self}): " + msg) if $DEBUG
+ return nil
+ end
+
+ begin
+ @interp._eval_without_enc(@interp._merge_tklist('bgerror', msg))
+ rescue Exception => e
+ warn("Warning (#{self}): " + msg)
+ end
+ end
+ return nil
+ end
+
+ if wait == 0
+ # no wait
+ Thread.pass
+ if thread.stop?
+ thread.raise exception
+ end
+ return thread
+ end
+
+ # wait to stop the caller thread
+ wait.times{
+ if thread.stop?
+ # ready to send exception
+ thread.raise exception
+ return thread
+ end
+
+ # wait
+ Thread.pass
+ }
+
+ # unexpected error
+ thread.raise RuntimeError, "the thread may not wait for the return value"
+ return thread
+ end
+
+ ######################################
+
+ def set_cb_error(cmd = Proc.new)
+ @cb_error_proc[0] = cmd
+ end
+
+ def cb_error(e)
+ if @cb_error_proc[0].respond_to?(:call)
+ @cb_error_proc[0].call(e)
+ end
+ end
+
+ ######################################
+
+ def set_safe_level(safe)
+ if safe > @safe_level[0]
+ @safe_level[0] = safe
+ @cmd_queue.enq([@system, 'set_safe_level', safe])
+ end
+ @safe_level[0]
+ end
+ def safe_level=(safe)
+ set_safe_level(safe)
+ end
+ def self.set_safe_level(safe)
+ __getip.set_safe_level(safe)
+ end
+ def self.safe_level=(safe)
+ self.set_safe_level(safe)
+ end
+ def safe_level
+ @safe_level[0]
+ end
+ def self.safe_level
+ __getip.safe_level
+ end
+
+ def wait_on_mainloop?
+ @wait_on_mainloop[0]
+ end
+ def wait_on_mainloop=(bool)
+ @wait_on_mainloop[0] = bool
+ end
+
+ def running_mainloop?
+ @wait_on_mainloop[1] > 0
+ end
+
+ def _destroy_slaves_of_slaveIP(ip)
+ unless ip.deleted?
+ # ip._split_tklist(ip._invoke('interp', 'slaves')).each{|name|
+ ip._split_tklist(ip._invoke_without_enc('interp', 'slaves')).each{|name|
+ name = _fromUTF8(name)
+ begin
+ # ip._eval_without_enc("#{name} eval {foreach i [after info] {after cancel $i}}")
+ after_ids = ip._eval_without_enc("#{name} eval {after info}")
+ ip._eval_without_enc("#{name} eval {foreach i {#{after_ids}} {after cancel $i}}")
+ rescue Exception
+ end
+ begin
+ # ip._invoke('interp', 'eval', name, 'destroy', '.')
+ ip._invoke(name, 'eval', 'destroy', '.')
+ rescue Exception
+ end
+
+ # safe_base?
+ if ip._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0'
+ begin
+ ip._eval_without_enc("::safe::interpDelete #{name}")
+ rescue Exception
+ end
+ end
+=begin
+ if ip._invoke('interp', 'exists', name) == '1'
+ begin
+ ip._invoke(name, 'eval', 'exit')
+ rescue Exception
+ end
+ end
+=end
+ unless ip.deleted?
+ if ip._invoke('interp', 'exists', name) == '1'
+ begin
+ ip._invoke('interp', 'delete', name)
+ rescue Exception
+ end
+ end
+ end
+ }
+ end
+ end
+
+ def _receiver_eval_proc_core(safe_level, thread, cmd, *args)
+ begin
+ #ret = proc{$SAFE = safe_level; cmd.call(*args)}.call
+ #ret = cmd.call(safe_level, *args)
+ normal_ret = false
+ ret = catch(:IRB_EXIT) do # IRB hack
+ retval = cmd.call(safe_level, *args)
+ normal_ret = true
+ retval
+ end
+ unless normal_ret
+ # catch IRB_EXIT
+ exit(ret)
+ end
+ ret
+ rescue SystemExit => e
+ # delete IP
+ unless @interp.deleted?
+ @slave_ip_tbl.each{|name, subip|
+ _destroy_slaves_of_slaveIP(subip)
+ begin
+ # subip._eval_without_enc("foreach i [after info] {after cancel $i}")
+ after_ids = subip._eval_without_enc("after info")
+ subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ rescue Exception
+ end
+=begin
+ begin
+ subip._invoke('destroy', '.') unless subip.deleted?
+ rescue Exception
+ end
+=end
+ # safe_base?
+ if @interp._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0'
+ begin
+ @interp._eval_without_enc("::safe::interpDelete #{name}")
+ rescue Exception
+ else
+ next if subip.deleted?
+ end
+ end
+ if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ !subip.deleted?
+ # do 'exit' to call the delete_hook procedure
+ begin
+ subip._eval_without_enc('exit')
+ rescue Exception
+ end
+ else
+ begin
+ subip.delete unless subip.deleted?
+ rescue Exception
+ end
+ end
+ }
+
+ begin
+ # @interp._eval_without_enc("foreach i [after info] {after cancel $i}")
+ after_ids = @interp._eval_without_enc("after info")
+ @interp._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ rescue Exception
+ end
+ begin
+ @interp._invoke('destroy', '.') unless @interp.deleted?
+ rescue Exception
+ end
+ if @safe_base && !@interp.deleted?
+ # do 'exit' to call the delete_hook procedure
+ @interp._eval_without_enc('exit')
+ else
+ @interp.delete unless @interp.deleted?
+ end
+ end
+
+ if e.backtrace[0] =~ /^(.+?):(\d+):in `(exit|exit!|abort)'/
+ _check_and_return(thread, MultiTkIp_OK.new($3 == 'exit'))
+ else
+ _check_and_return(thread, MultiTkIp_OK.new(nil))
+ end
+
+ # if master? && !safe? && allow_ruby_exit?
+ if !@interp.deleted? && master? && !safe? && allow_ruby_exit?
+=begin
+ ObjectSpace.each_object(TclTkIp){|obj|
+ obj.delete unless obj.deleted?
+ }
+=end
+ #exit(e.status)
+ fail e
+ end
+ # break
+
+ rescue SecurityError => e
+ # in 'exit', 'exit!', and 'abort' : security error --> delete IP
+ if e.backtrace[0] =~ /^(.+?):(\d+):in `(exit|exit!|abort)'/
+ ret = ($3 == 'exit')
+ unless @interp.deleted?
+ @slave_ip_tbl.each{|name, subip|
+ _destroy_slaves_of_slaveIP(subip)
+ begin
+ # subip._eval_without_enc("foreach i [after info] {after cancel $i}")
+ after_ids = subip._eval_without_enc("after info")
+ subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ rescue Exception
+ end
+=begin
+ begin
+ subip._invoke('destroy', '.') unless subip.deleted?
+ rescue Exception
+ end
+=end
+ # safe_base?
+ if @interp._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0'
+ begin
+ @interp._eval_without_enc("::safe::interpDelete #{name}")
+ rescue Exception
+ else
+ next if subip.deleted?
+ end
+ end
+ if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ !subip.deleted?
+ # do 'exit' to call the delete_hook procedure
+ begin
+ subip._eval_without_enc('exit')
+ rescue Exception
+ end
+ else
+ begin
+ subip.delete unless subip.deleted?
+ rescue Exception
+ end
+ end
+ }
+
+ begin
+ # @interp._eval_without_enc("foreach i [after info] {after cancel $i}")
+ after_ids = @interp._eval_without_enc("after info")
+ @interp._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ rescue Exception
+ end
+=begin
+ begin
+ @interp._invoke('destroy', '.') unless @interp.deleted?
+ rescue Exception
+ end
+=end
+ if @safe_base && !@interp.deleted?
+ # do 'exit' to call the delete_hook procedure
+ @interp._eval_without_enc('exit')
+ else
+ @interp.delete unless @interp.deleted?
+ end
+ end
+ _check_and_return(thread, MultiTkIp_OK.new(ret))
+ # break
+
+ else
+ # raise security error
+ _check_and_return(thread, e)
+ end
+
+ rescue Exception => e
+ # raise exception
+ begin
+ bt = _toUTF8(e.backtrace.join("\n"))
+ if MultiTkIp::WITH_ENCODING
+ bt.force_encoding('utf-8')
+ else
+ bt.instance_variable_set(:@encoding, 'utf-8')
+ end
+ rescue Exception
+ bt = e.backtrace.join("\n")
+ end
+ begin
+ @interp._set_global_var('errorInfo', bt)
+ rescue Exception
+ end
+ _check_and_return(thread, e)
+
+ else
+ # no exception
+ _check_and_return(thread, MultiTkIp_OK.new(ret))
+ end
+ end
+
+ def _receiver_eval_proc(last_thread, safe_level, thread, cmd, *args)
+ if thread
+ Thread.new{
+ last_thread.join if last_thread
+ unless @interp.deleted?
+ _receiver_eval_proc_core(safe_level, thread, cmd, *args)
+ end
+ }
+ else
+ Thread.new{
+ unless @interp.deleted?
+ _receiver_eval_proc_core(safe_level, thread, cmd, *args)
+ end
+ }
+ last_thread
+ end
+ end
+
+ private :_receiver_eval_proc, :_receiver_eval_proc_core
+
+ def _receiver_mainloop(check_root)
+ if @evloop_thread[0] && @evloop_thread[0].alive?
+ @evloop_thread[0]
+ else
+ @evloop_thread[0] = Thread.new{
+ while !@interp.deleted?
+ #if check_root
+ # inf = @interp._invoke_without_enc('info', 'command', '.')
+ # break if !inf.kind_of?(String) || inf != '.'
+ #end
+ break if check_root && !@interp.has_mainwindow?
+ sleep 0.5
+ end
+ }
+ @evloop_thread[0]
+ end
+ end
+
+ def _create_receiver_and_watchdog(lvl = $SAFE)
+ lvl = $SAFE if lvl < $SAFE
+
+ # command-procedures receiver
+ receiver = Thread.new(lvl){|safe_level|
+ last_thread = {}
+
+ loop do
+ break if @interp.deleted?
+ thread, cmd, *args = @cmd_queue.deq
+ if thread == @system
+ # control command
+ case cmd
+ when 'set_safe_level'
+ begin
+ safe_level = args[0] if safe_level < args[0]
+ rescue Exception
+ end
+ when 'call_mainloop'
+ thread = args.shift
+ _check_and_return(thread,
+ MultiTkIp_OK.new(_receiver_mainloop(*args)))
+ else
+ # ignore
+ end
+
+ else
+ # procedure
+ last_thread[thread] = _receiver_eval_proc(last_thread[thread],
+ safe_level, thread,
+ cmd, *args)
+ end
+ end
+ }
+
+ # watchdog of receiver
+ watchdog = Thread.new{
+ begin
+ loop do
+ sleep 1
+ if @interp.deleted?
+ receiver.kill
+ @cmd_queue.close
+ end
+ break unless receiver.alive?
+ end
+ rescue Exception
+ # ignore all kind of Exception
+ end
+
+ # receiver is dead
+ retry_count = 3
+ loop do
+ Thread.pass
+ begin
+ thread, cmd, *args = @cmd_queue.deq(true) # non-block
+ rescue ThreadError
+ # queue is empty
+ retry_count -= 1
+ break if retry_count <= 0
+ sleep 0.5
+ retry
+ end
+ next unless thread
+ if thread.alive?
+ if @interp.deleted?
+ thread.raise RuntimeError, 'the interpreter is already deleted'
+ else
+ thread.raise RuntimeError,
+ 'the interpreter no longer receives command procedures'
+ end
+ end
+ end
+ }
+
+ # return threads
+ [receiver, watchdog]
+ end
+ private :_check_and_return, :_create_receiver_and_watchdog
+
+ ######################################
+
+ unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
+ ### Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!!
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+ end
+
+ if self.const_defined? :DEFAULT_MASTER_NAME
+ name = DEFAULT_MASTER_NAME.to_s
+ else
+ name = nil
+ end
+ if self.const_defined?(:DEFAULT_MASTER_OPTS) &&
+ DEFAULT_MASTER_OPTS.kind_of?(Hash)
+ keys = DEFAULT_MASTER_OPTS
+ else
+ keys = {}
+ end
+
+ @@DEFAULT_MASTER = self.allocate
+ @@DEFAULT_MASTER.instance_eval{
+ @tk_windows = TkUtil.untrust({})
+
+ @tk_table_list = TkUtil.untrust([])
+
+ @slave_ip_tbl = TkUtil.untrust({})
+
+ @slave_ip_top = TkUtil.untrust({})
+
+ @evloop_thread = TkUtil.untrust([])
+
+ unless keys.kind_of? Hash
+ fail ArgumentError, "expecting a Hash object for the 2nd argument"
+ end
+
+ if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ @interp = TclTkIp.new(name, _keys2opts(keys))
+ else ### Ruby 1.9 !!!!!!!!!!!
+ @interp_thread = Thread.new{
+ current = Thread.current
+ begin
+ current[:interp] = interp = TclTkIp.new(name, _keys2opts(keys))
+ rescue e
+ current[:interp] = e
+ raise e
+ end
+ #sleep
+ current[:mutex] = mutex = Mutex.new
+ current[:root_check] = cond_var = ConditionVariable.new
+
+ status = [nil]
+ def status.value
+ self[0]
+ end
+ def status.value=(val)
+ self[0] = val
+ end
+ current[:status] = status
+
+ begin
+ begin
+ #TclTkLib.mainloop_abort_on_exception = false
+ #Thread.current[:status].value = TclTkLib.mainloop(true)
+ interp.mainloop_abort_on_exception = true
+ current[:status].value = interp.mainloop(true)
+ rescue SystemExit=>e
+ current[:status].value = e
+ rescue Exception=>e
+ current[:status].value = e
+ retry if interp.has_mainwindow?
+ ensure
+ mutex.synchronize{ cond_var.broadcast }
+ end
+
+ #Thread.current[:status].value = TclTkLib.mainloop(false)
+ current[:status].value = interp.mainloop(false)
+
+ ensure
+ # interp must be deleted before the thread for interp is dead.
+ # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler
+ # deleted by the wrong thread.
+ interp.delete
+ end
+ }
+ until @interp_thread[:interp]
+ Thread.pass
+ end
+ # INTERP_THREAD.run
+ raise @interp_thread[:interp] if @interp_thread[:interp].kind_of? Exception
+ @interp = @interp_thread[:interp]
+
+ # delete the interpreter and kill the eventloop thread at exit
+ interp = @interp
+ interp_thread = @interp_thread
+ END{
+ if interp_thread.alive?
+ interp.delete
+ interp_thread.kill
+ end
+ }
+
+ def self.mainloop(check_root = true)
+ begin
+ TclTkLib.set_eventloop_window_mode(true)
+ @interp_thread.value
+ ensure
+ TclTkLib.set_eventloop_window_mode(false)
+ end
+ end
+ end
+
+ @interp.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+
+ @ip_name = nil
+
+ @callback_status = TkUtil.untrust([])
+
+ @system = Object.new
+
+ @wait_on_mainloop = TkUtil.untrust([true, 0])
+
+ @threadgroup = Thread.current.group
+
+ @safe_base = false
+
+ @safe_level = [$SAFE]
+
+ @cmd_queue = MultiTkIp::Command_Queue.new(@interp)
+
+ @cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog(@safe_level[0])
+
+ @threadgroup.add @cmd_receiver
+ @threadgroup.add @receiver_watchdog
+
+ # NOT enclose @threadgroup for @@DEFAULT_MASTER
+
+ @@IP_TABLE[ThreadGroup::Default] = self
+ @@IP_TABLE[@threadgroup] = self
+
+ #################################
+
+ @pseudo_toplevel = [false, nil]
+
+ def self.__pseudo_toplevel
+ Thread.current.group == ThreadGroup::Default &&
+ MultiTkIp.__getip == @@DEFAULT_MASTER &&
+ self.__pseudo_toplevel_evaluable? && @pseudo_toplevel[1]
+ end
+
+ def self.__pseudo_toplevel=(m)
+ unless (Thread.current.group == ThreadGroup::Default &&
+ MultiTkIp.__getip == @@DEFAULT_MASTER)
+ fail SecurityError, "no permission to manipulate"
+ end
+
+ # if m.kind_of?(Module) && m.respond_to?(:pseudo_toplevel_evaluable?)
+ if m.respond_to?(:pseudo_toplevel_evaluable?)
+ @pseudo_toplevel[0] = true
+ @pseudo_toplevel[1] = m
+ else
+ fail ArgumentError, 'fail to set pseudo-toplevel'
+ end
+ self
+ end
+
+ def self.__pseudo_toplevel_evaluable?
+ begin
+ @pseudo_toplevel[0] && @pseudo_toplevel[1].pseudo_toplevel_evaluable?
+ rescue Exception
+ false
+ end
+ end
+
+ def self.__pseudo_toplevel_evaluable=(mode)
+ unless (Thread.current.group == ThreadGroup::Default &&
+ MultiTkIp.__getip == @@DEFAULT_MASTER)
+ fail SecurityError, "no permission to manipulate"
+ end
+
+ @pseudo_toplevel[0] = (mode)? true: false
+ end
+
+ #################################
+
+ @assign_request = Class.new(Exception){
+ def self.new(target, ret)
+ obj = super()
+ obj.target = target
+ obj.ret = ret
+ obj
+ end
+ attr_accessor :target, :ret
+ }
+
+ @assign_thread = Thread.new{
+ loop do
+ begin
+ Thread.stop
+ rescue @assign_request=>req
+ begin
+ req.ret[0] = req.target.instance_eval{
+ @cmd_receiver, @receiver_watchdog =
+ _create_receiver_and_watchdog(@safe_level[0])
+ @threadgroup.add @cmd_receiver
+ @threadgroup.add @receiver_watchdog
+ @threadgroup.enclose
+ true
+ }
+ rescue Exception=>e
+ begin
+ req.ret[0] = e
+ rescue Exception
+ # ignore
+ end
+ end
+ rescue Exception
+ # ignore
+ end
+ end
+ }
+
+ def self.assign_receiver_and_watchdog(target)
+ ret = [nil]
+ @assign_thread.raise(@assign_request.new(target, ret))
+ while ret[0] == nil
+ unless @assign_thread.alive?
+ raise RuntimeError, 'lost the thread to assign a receiver and a watchdog thread'
+ end
+ end
+ if ret[0].kind_of?(Exception)
+ raise ret[0]
+ else
+ ret[0]
+ end
+ end
+
+ #################################
+
+ @init_ip_env_queue = Queue.new
+ Thread.new{
+ current = Thread.current
+ loop {
+ mtx, cond, ret, table, script = @init_ip_env_queue.deq
+ begin
+ ret[0] = table.each{|tg, ip| ip._init_ip_env(script) }
+ rescue Exception => e
+ ret[0] = e
+ ensure
+ mtx.synchronize{ cond.signal }
+ end
+ mtx = cond = ret = table = script = nil # clear variables for GC
+ }
+ }
+
+ def self.__init_ip_env__(table, script)
+ ret = []
+ mtx = (Thread.current[:MultiTk_ip_Mutex] ||= Mutex.new)
+ cond = (Thread.current[:MultiTk_ip_CondVar] ||= ConditionVariable.new)
+ mtx.synchronize{
+ @init_ip_env_queue.enq([mtx, cond, ret, table, script])
+ cond.wait(mtx)
+ }
+ if ret[0].kind_of?(Exception)
+ raise ret[0]
+ else
+ ret[0]
+ end
+ end
+
+ #################################
+
+ class << self
+ undef :instance_eval
+ end
+ }
+
+ @@DEFAULT_MASTER.freeze # defend against modification
+
+ ######################################
+
+ def self.inherited(subclass)
+ # trust if on ThreadGroup::Default or @@DEFAULT_MASTER's ThreadGroup
+ if @@IP_TABLE[Thread.current.group] == @@DEFAULT_MASTER
+ begin
+ class << subclass
+ self.methods.each{|m|
+ name = m.to_s
+ begin
+ unless name == '__id__' || name == '__send__' || name == 'freeze'
+ undef_method(m)
+ end
+ rescue Exception
+ # ignore all exceptions
+ end
+ }
+ end
+ ensure
+ subclass.freeze
+ fail SecurityError,
+ "cannot create subclass of MultiTkIp on a untrusted ThreadGroup"
+ end
+ end
+ end
+
+ ######################################
+
+ @@SAFE_OPT_LIST = [
+ 'accessPath'.freeze,
+ 'statics'.freeze,
+ 'nested'.freeze,
+ 'deleteHook'.freeze
+ ].freeze
+
+ def _parse_slaveopts(keys)
+ name = nil
+ safe = false
+ safe_opts = {}
+ tk_opts = {}
+
+ keys.each{|k,v|
+ k_str = k.to_s
+ if k_str == 'name'
+ name = v
+ elsif k_str == 'safe'
+ safe = v
+ elsif @@SAFE_OPT_LIST.member?(k_str)
+ safe_opts[k_str] = v
+ else
+ tk_opts[k_str] = v
+ end
+ }
+
+ if keys['without_tk'] || keys[:without_tk]
+ [name, safe, safe_opts, nil]
+ else
+ [name, safe, safe_opts, tk_opts]
+ end
+ end
+ private :_parse_slaveopts
+
+ def _create_slave_ip_name
+ @@SLAVE_IP_ID.mutex.synchronize{
+ name = @@SLAVE_IP_ID.join('')
+ @@SLAVE_IP_ID[1].succ!
+ name.freeze
+ }
+ end
+ private :_create_slave_ip_name
+
+ ######################################
+
+ def __check_safetk_optkeys(optkeys)
+ # based on 'safetk.tcl'
+ new_keys = {}
+ optkeys.each{|k,v| new_keys[k.to_s] = v}
+
+ # check 'display'
+ if !new_keys.key?('display')
+ begin
+ #new_keys['display'] = @interp._invoke('winfo screen .')
+ new_keys['display'] = @interp._invoke('winfo', 'screen', '.')
+ rescue
+ if ENV[DISPLAY]
+ new_keys['display'] = ENV[DISPLAY]
+ elsif !new_keys.key?('use')
+ warn "Warning: no screen info or ENV[DISPLAY], so use ':0.0'"
+ new_keys['display'] = ':0.0'
+ end
+ end
+ end
+
+ # check 'use'
+ if new_keys.key?('use')
+ # given 'use'
+ case new_keys['use']
+ when TkWindow
+ new_keys['use'] = TkWinfo.id(new_keys['use'])
+ #assoc_display = @interp._eval('winfo screen .')
+ assoc_display = @interp._invoke('winfo', 'screen', '.')
+ when /^\..*/
+ new_keys['use'] = @interp._invoke('winfo', 'id', new_keys['use'])
+ assoc_display = @interp._invoke('winfo', 'screen', new_keys['use'])
+ else
+ begin
+ pathname = @interp._invoke('winfo', 'pathname', new_keys['use'])
+ assoc_display = @interp._invoke('winfo', 'screen', pathname)
+ rescue
+ assoc_display = new_keys['display']
+ end
+ end
+
+ # match display?
+ if assoc_display != new_keys['display']
+ if optkeys.key?(:display) || optkeys.key?('display')
+ fail RuntimeError,
+ "conflicting 'display'=>#{new_keys['display']} " +
+ "and display '#{assoc_display}' on 'use'=>#{new_keys['use']}"
+ else
+ new_keys['display'] = assoc_display
+ end
+ end
+ end
+
+ # return
+ new_keys
+ end
+ private :__check_safetk_optkeys
+
+ def __create_safetk_frame(slave_ip, slave_name, app_name, keys)
+ # display option is used by ::safe::loadTk
+ loadTk_keys = {}
+ loadTk_keys['display'] = keys['display']
+ dup_keys = keys.dup
+
+ # keys for toplevel : allow followings
+ toplevel_keys = {}
+ ['height', 'width', 'background', 'menu'].each{|k|
+ toplevel_keys[k] = dup_keys.delete(k) if dup_keys.key?(k)
+ }
+ toplevel_keys['classname'] = 'SafeTk'
+ toplevel_keys['screen'] = dup_keys.delete('display')
+
+ # other keys used by pack option of container frame
+
+ # create toplevel widget
+ begin
+ top = TkToplevel.new(toplevel_keys)
+ rescue NameError => e
+ fail e unless @interp.safe?
+ fail SecurityError, "unable create toplevel on the safe interpreter"
+ end
+ msg = "Untrusted Ruby/Tk applet (#{slave_name})"
+ if app_name.kind_of?(String)
+ top.title "#{app_name} (#{slave_name})"
+ else
+ top.title msg
+ end
+
+ # procedure to delete slave interpreter
+ slave_delete_proc = proc{
+ unless slave_ip.deleted?
+ #if slave_ip._invoke('info', 'command', '.') != ""
+ # slave_ip._invoke('destroy', '.')
+ #end
+ #slave_ip.delete
+ slave_ip._eval_without_enc('exit')
+ end
+ begin
+ top.destroy if top.winfo_exist?
+ rescue
+ # ignore
+ end
+ }
+ tag = TkBindTag.new.bind('Destroy', slave_delete_proc)
+
+ top.bindtags = top.bindtags.unshift(tag)
+
+ # create control frame
+ TkFrame.new(top, :bg=>'red', :borderwidth=>3, :relief=>'ridge') {|fc|
+ fc.bindtags = fc.bindtags.unshift(tag)
+
+ TkFrame.new(fc, :bd=>0){|f|
+ TkButton.new(f,
+ :text=>'Delete', :bd=>1, :padx=>2, :pady=>0,
+ :highlightthickness=>0, :command=>slave_delete_proc
+ ).pack(:side=>:right, :fill=>:both)
+ f.pack(:side=>:right, :fill=>:both, :expand=>true)
+ }
+
+ TkLabel.new(fc, :text=>msg, :padx=>2, :pady=>0,
+ :anchor=>:w).pack(:side=>:left, :fill=>:both, :expand=>true)
+
+ fc.pack(:side=>:bottom, :fill=>:x)
+ }
+
+ # container frame for slave interpreter
+ dup_keys['fill'] = :both unless dup_keys.key?('fill')
+ dup_keys['expand'] = true unless dup_keys.key?('expand')
+ c = TkFrame.new(top, :container=>true).pack(dup_keys)
+ c.bind('Destroy', proc{top.destroy})
+
+ # return keys
+ loadTk_keys['use'] = TkWinfo.id(c)
+ [loadTk_keys, top.path]
+ end
+ private :__create_safetk_frame
+
+ def __create_safe_slave_obj(safe_opts, app_name, tk_opts)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ # safe interpreter
+ ip_name = _create_slave_ip_name
+ slave_ip = @interp.create_slave(ip_name, true)
+ slave_ip.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+ @slave_ip_tbl[ip_name] = slave_ip
+ def slave_ip.safe_base?
+ true
+ end
+
+ @interp._eval("::safe::interpInit #{ip_name}")
+
+ slave_ip._invoke('set', 'argv0', app_name) if app_name.kind_of?(String)
+
+ if tk_opts
+ tk_opts = __check_safetk_optkeys(tk_opts)
+ if tk_opts.key?('use')
+ @slave_ip_top[ip_name] = ''
+ else
+ tk_opts, top_path = __create_safetk_frame(slave_ip, ip_name, app_name,
+ tk_opts)
+ @slave_ip_top[ip_name] = top_path
+ end
+ @interp._eval("::safe::loadTk #{ip_name} #{_keys2opts(tk_opts)}")
+ @interp._invoke('__replace_slave_tk_commands__', ip_name)
+ else
+ @slave_ip_top[ip_name] = nil
+ end
+
+ if safe_opts.key?('deleteHook') || safe_opts.key?(:deleteHook)
+ @interp._eval("::safe::interpConfigure #{ip_name} " +
+ _keys2opts(safe_opts))
+ else
+ @interp._eval("::safe::interpConfigure #{ip_name} " +
+ _keys2opts(safe_opts) + '-deleteHook {' +
+ TkComm._get_eval_string(proc{|slave|
+ self._default_delete_hook(slave)
+ }) + '}')
+ end
+
+ [slave_ip, ip_name]
+ end
+
+ def __create_trusted_slave_obj(name, keys)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ ip_name = _create_slave_ip_name
+ slave_ip = @interp.create_slave(ip_name, false)
+ slave_ip.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+ slave_ip._invoke('set', 'argv0', name) if name.kind_of?(String)
+ slave_ip._invoke('set', 'argv', _keys2opts(keys))
+ @interp._invoke('load', '', 'Tk', ip_name)
+ @interp._invoke('__replace_slave_tk_commands__', ip_name)
+ @slave_ip_tbl[ip_name] = slave_ip
+ [slave_ip, ip_name]
+ end
+
+ ######################################
+
+ def _create_slave_object(keys={})
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ ip = MultiTkIp.new_slave(self, keys={})
+ @slave_ip_tbl[ip.name] = ip
+ end
+
+ ######################################
+
+ 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
+
+ if !master.deleted? && !master.master? && master.safe?
+ fail SecurityError, "safe-slave-ip cannot create a new interpreter"
+ end
+
+ if safeip == nil && !master.master?
+ fail SecurityError, "slave-ip cannot create a master-ip"
+ end
+
+ unless keys.kind_of? Hash
+ fail ArgumentError, "expecting a Hash object for the 2nd argument"
+ end
+
+ @tk_windows = {}
+ @tk_table_list = []
+ @slave_ip_tbl = {}
+ @slave_ip_top = {}
+ @cb_error_proc = []
+ @evloop_thread = []
+
+ TkUtil.untrust(@tk_windows) unless @tk_windows.tainted?
+ TkUtil.untrust(@tk_table_list) unless @tk_table_list.tainted?
+ TkUtil.untrust(@slave_ip_tbl) unless @slave_ip_tbl.tainted?
+ TkUtil.untrust(@slave_ip_top) unless @slave_ip_top.tainted?
+ TkUtil.untrust(@cb_error_proc) unless @cb_error_proc.tainted?
+ TkUtil.untrust(@evloop_thread) unless @evloop_thread.tainted?
+
+ @callback_status = []
+
+ name, safe, safe_opts, tk_opts = _parse_slaveopts(keys)
+
+ safe = 4 if safe && !safe.kind_of?(Fixnum)
+
+ @safe_base = false
+
+ if safeip == nil
+ # create master-ip
+ unless WITH_RUBY_VM
+ @interp = TclTkIp.new(name, _keys2opts(tk_opts))
+ @interp.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+
+ else ### Ruby 1.9 !!!!!!!!!!!
+=begin
+ @interp_thread = Thread.new{
+ Thread.current[:interp] = interp = TclTkIp.new(name, _keys2opts(tk_opts))
+ interp.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+
+ #sleep
+ TclTkLib.mainloop(true)
+ }
+ until @interp_thread[:interp]
+ Thread.pass
+ end
+ # INTERP_THREAD.run
+ @interp = @interp_thread[:interp]
+=end
+ @interp_thread = Thread.new{
+ current = Thread.current
+ begin
+ current[:interp] = interp = TclTkIp.new(name, _keys2opts(tk_opts))
+ rescue e
+ current[:interp] = e
+ raise e
+ end
+ #sleep
+ #TclTkLib.mainloop(true)
+ current[:mutex] = mutex = Mutex.new
+ current[:root_check] = cond_ver = ConditionVariable.new
+
+ status = [nil]
+ def status.value
+ self[0]
+ end
+ def status.value=(val)
+ self[0] = val
+ end
+ current[:status] = status
+
+ begin
+ begin
+ current[:status].value = interp.mainloop(true)
+ rescue SystemExit=>e
+ current[:status].value = e
+ rescue Exception=>e
+ current[:status].value = e
+ retry if interp.has_mainwindow?
+ ensure
+ mutex.synchronize{ cond_var.broadcast }
+ end
+ current[:status].value = interp.mainloop(false)
+ ensure
+ interp.delete
+ end
+ }
+ until @interp_thread[:interp]
+ Thread.pass
+ end
+ # INTERP_THREAD.run
+ @interp = @interp_thread[:interp]
+
+ @evloop_thread[0] = @interp_thread
+
+ def self.mainloop(check_root = true)
+ begin
+ TclTkLib.set_eventloop_window_mode(true)
+ @interp_thread.value
+ ensure
+ TclTkLib.set_eventloop_window_mode(false)
+ end
+ end
+ end
+
+ @interp.instance_eval{
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ }
+
+ @ip_name = nil
+
+ if safe
+ safe = $SAFE if safe < $SAFE
+ @safe_level = [safe]
+ else
+ @safe_level = [$SAFE]
+ end
+
+ else
+ # create slave-ip
+ if safeip || master.safe?
+ @safe_base = true
+ @interp, @ip_name = master.__create_safe_slave_obj(safe_opts,
+ name, tk_opts)
+ # @interp_thread = nil if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!
+ @interp_thread = nil unless WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!!
+ if safe
+ safe = master.safe_level if safe < master.safe_level
+ @safe_level = [safe]
+ else
+ @safe_level = [4]
+ end
+ else
+ @interp, @ip_name = master.__create_trusted_slave_obj(name, tk_opts)
+ # @interp_thread = nil if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!
+ @interp_thread = nil unless WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!!
+ if safe
+ safe = master.safe_level if safe < master.safe_level
+ @safe_level = [safe]
+ else
+ @safe_level = [master.safe_level]
+ end
+ end
+ @set_alias_proc = proc{|name|
+ master._invoke('interp', 'alias', @ip_name, name, '', name)
+ }.freeze
+ end
+
+ @system = Object.new
+
+ @wait_on_mainloop = TkUtil.untrust([true, 0])
+ # @wait_on_mainloop = TkUtil.untrust([false, 0])
+
+ @threadgroup = ThreadGroup.new
+
+ @pseudo_toplevel = [false, nil]
+
+ @cmd_queue = MultiTkIp::Command_Queue.new(@interp)
+
+=begin
+ @cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog(@safe_level[0])
+
+ @threadgroup.add @cmd_receiver
+ @threadgroup.add @receiver_watchdog
+
+ @threadgroup.enclose
+=end
+ @@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
+
+ @@IP_TABLE[@threadgroup] = self
+ @@TK_TABLE_LIST.size.times{
+ @tk_table_list << TkUtil.untrust({})
+ }
+ _init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS)
+
+ class << self
+ undef :instance_eval
+ end
+
+ # dummy call for initialization
+ self.eval_proc{ Tk.tk_call('set', 'tcl_patchLevel') }
+
+ self.freeze # defend against modification
+ end
+
+ ######################################
+
+ def _default_delete_hook(slave)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @slave_ip_tbl.delete(slave)
+ top = @slave_ip_top.delete(slave)
+ if top.kind_of?(String)
+ # call default hook of safetk.tcl (ignore exceptions)
+ if top == ''
+ begin
+ @interp._eval("::safe::disallowTk #{slave}")
+ rescue
+ warn("Waring: 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
+ begin
+ @interp._eval("destroy #{top}")
+ rescue
+ warn("Waring: fail to destroy toplevel") if $DEBUG
+ end
+ end
+ end
+ end
+ end
+
+end
+
+
+# get target IP
+class MultiTkIp
+ @@CALLBACK_SUBTHREAD = Class.new(Thread){
+ def self.new(interp, &blk)
+ super(interp){|ip| Thread.current[:callback_ip] = ip; blk.call}
+ end
+
+ @table = TkUtil.untrust(Hash.new{|h,k| h[k] = TkUtil.untrust([])})
+ def self.table
+ @table
+ end
+ }
+
+ def self._ip_id_
+ __getip._ip_id_
+ end
+ def _ip_id_
+ # for RemoteTkIp
+ ''
+ end
+
+ def self.__getip
+ current = Thread.current
+ if current.kind_of?(@@CALLBACK_SUBTHREAD)
+ return current[:callback_ip]
+ end
+ if TclTkLib.mainloop_thread? != false && current[:callback_ip]
+ return current[:callback_ip]
+ end
+ if current.group == ThreadGroup::Default
+ @@DEFAULT_MASTER
+ else
+ ip = @@IP_TABLE[current.group]
+ unless ip
+ fail SecurityError,
+ "cannot call Tk methods on #{Thread.current.inspect}"
+ end
+ ip
+ end
+ end
+end
+
+
+# aliases of constructor
+class << MultiTkIp
+ alias __new new
+ private :__new
+
+ def new_master(safe=nil, keys={}, &blk)
+ if MultiTkIp::WITH_RUBY_VM
+ #### TODO !!!!!!
+ fail RuntimeError,
+ 'sorry, still not support multiple master-interpreters on RubyVM'
+ end
+
+ if safe.kind_of?(Hash)
+ keys = safe
+ elsif safe.kind_of?(Integer)
+ raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash)
+ if !keys.key?(:safe) && !keys.key?('safe')
+ keys[:safe] = safe
+ end
+ elsif safe == nil
+ # do nothing
+ else
+ raise ArgumentError, "unexpected argument(s)"
+ end
+
+ ip = __new(__getip, nil, keys)
+ #ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given?
+ if block_given?
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)}
+ ip._proc_on_safelevel(&blk).call(ip.safe_level)
+ end
+ ip
+ end
+
+ alias new new_master
+
+ def new_slave(safe=nil, keys={}, &blk)
+ if safe.kind_of?(Hash)
+ keys = safe
+ elsif safe.kind_of?(Integer)
+ raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash)
+ if !keys.key?(:safe) && !keys.key?('safe')
+ keys[:safe] = safe
+ end
+ elsif safe == nil
+ # do nothing
+ else
+ raise ArgumentError, "unexpected argument(s)"
+ end
+
+ ip = __new(__getip, false, keys)
+ # ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given?
+ if block_given?
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)}
+ ip._proc_on_safelevel(&blk).call(ip.safe_level)
+ end
+ ip
+ end
+ alias new_trusted_slave new_slave
+
+ def new_safe_slave(safe=4, keys={}, &blk)
+ if safe.kind_of?(Hash)
+ keys = safe
+ elsif safe.kind_of?(Integer)
+ raise ArgumentError, "unexpected argument(s)" unless keys.kind_of?(Hash)
+ if !keys.key?(:safe) && !keys.key?('safe')
+ keys[:safe] = safe
+ end
+ else
+ raise ArgumentError, "unexpected argument(s)"
+ end
+
+ ip = __new(__getip, true, keys)
+ # ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call) if block_given?
+ if block_given?
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; Proc.new}.call)}
+ #Thread.new{ip.eval_proc(proc{$SAFE=ip.safe_level; yield}.call)}
+ ip._proc_on_safelevel(&blk).call(ip.safe_level)
+ end
+ ip
+ end
+ alias new_safeTk new_safe_slave
+end
+
+
+# get info
+class MultiTkIp
+ def inspect
+ s = self.to_s.chop!
+ if self.manipulable?
+ if master?
+ if @interp.deleted?
+ s << ':deleted-master'
+ else
+ s << ':master'
+ end
+ else
+ if @interp.deleted?
+ s << ':deleted-slave'
+ elsif @interp.safe?
+ s << ':safe-slave'
+ else
+ s << ':trusted-slave'
+ end
+ end
+ end
+ s << '>'
+ end
+
+ def master?
+ if @ip_name
+ false
+ else
+ true
+ end
+ end
+ def self.master?
+ __getip.master?
+ end
+
+ def slave?
+ not master?
+ end
+ def self.slave?
+ not self.master?
+ end
+
+ def alive?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ begin
+ return false unless @cmd_receiver.alive?
+ return false if @interp.deleted?
+ return false if @interp._invoke('interp', 'exists', '') == '0'
+ rescue Exception
+ return false
+ end
+ true
+ end
+ def self.alive?
+ __getip.alive?
+ end
+
+ def path
+ @ip_name || ''
+ end
+ def self.path
+ __getip.path
+ end
+ def ip_name
+ @ip_name || ''
+ end
+ def self.ip_name
+ __getip.ip_name
+ end
+ def to_eval
+ @ip_name || ''
+ end
+ def self.to_eval
+ __getip.to_eval
+ end
+
+ def slaves(all = false)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp','slaves').split.map!{|name|
+ if @slave_ip_tbl.key?(name)
+ @slave_ip_tbl[name]
+ elsif all
+ name
+ else
+ nil
+ end
+ }.compact!
+ end
+ def self.slaves(all = false)
+ __getip.slaves(all)
+ end
+
+ def manipulable?
+ return true if (Thread.current.group == ThreadGroup::Default)
+ ip = MultiTkIp.__getip
+ (ip == self) || ip._is_master_of?(@interp)
+ end
+ def self.manipulable?
+ true
+ end
+
+ def _is_master_of?(tcltkip_obj)
+ tcltkip_obj.slave_of?(@interp)
+ end
+ protected :_is_master_of?
+end
+
+
+# instance methods to treat tables
+class MultiTkIp
+ def _tk_cmd_tbl
+ tbl = {}
+ MultiTkIp.tk_cmd_tbl.each{|id, ent| tbl[id] = ent if ent.ip == self }
+ tbl
+ end
+
+ def _tk_windows
+ @tk_windows
+ end
+
+ def _tk_table_list
+ @tk_table_list
+ end
+
+ def _add_new_tables
+ (@@TK_TABLE_LIST.size - @tk_table_list.size).times{
+ @tk_table_list << TkUtil.untrust({})
+ }
+ end
+
+ def _init_ip_env(script)
+ self.eval_proc{script.call(self)}
+ end
+
+ def _add_tk_procs(name, args, body)
+ return if slave?
+ @interp._invoke('proc', name, args, body) if args && body
+ @interp._invoke('interp', 'slaves').split.each{|slave|
+ @interp._invoke('interp', 'alias', slave, name, '', name)
+ }
+ end
+
+ def _remove_tk_procs(*names)
+ return if slave?
+ names.each{|name|
+ name = name.to_s
+
+ return if @interp.deleted?
+ @interp._invoke('rename', name, '')
+
+ return if @interp.deleted?
+ @interp._invoke('interp', 'slaves').split.each{|slave|
+ return if @interp.deleted?
+ @interp._invoke('interp', 'alias', slave, name, '') rescue nil
+ }
+ }
+ end
+
+ def _init_ip_internal(init_ip_env, add_tk_procs)
+ #init_ip_env.each{|script| self.eval_proc{script.call(self)}}
+ init_ip_env.each{|script| self._init_ip_env(script)}
+ add_tk_procs.each{|name, args, body|
+ if master?
+ @interp._invoke('proc', name, args, body) if args && body
+ else
+ @set_alias_proc.call(name)
+ end
+ }
+ end
+end
+
+
+# class methods to treat tables
+class MultiTkIp
+ def self.tk_cmd_tbl
+ @@TK_CMD_TBL
+ end
+ def self.tk_windows
+ __getip._tk_windows
+ end
+ def self.tk_object_table(id)
+ __getip._tk_table_list[id]
+ end
+ def self.create_table
+ if __getip.slave?
+ begin
+ raise SecurityError, "slave-IP has no permission creating a new table"
+ rescue SecurityError => e
+ #p e.backtrace
+ # Is called on a Ruby/Tk library?
+ caller_info = e.backtrace[1]
+ if caller_info =~ %r{^#{MultiTkIp::BASE_DIR}/(tk|tkextlib)/[^:]+\.rb:}
+ # Probably, caller is a Ruby/Tk library --> allow creating
+ else
+ raise e
+ end
+ end
+ end
+
+ id = @@TK_TABLE_LIST.size
+ obj = Object.new
+ @@TK_TABLE_LIST << obj
+ obj.instance_variable_set(:@id, id)
+ obj.instance_variable_set(:@mutex, Mutex.new)
+ obj.instance_eval{
+ def self.mutex
+ @mutex
+ end
+ def self.method_missing(m, *args)
+ MultiTkIp.tk_object_table(@id).__send__(m, *args)
+ end
+ }
+ obj.freeze
+ @@IP_TABLE.each{|tg, ip| ip._add_new_tables }
+ return obj
+ end
+
+ def self.init_ip_env(script = Proc.new)
+ @@INIT_IP_ENV << script
+ if __getip.slave?
+ begin
+ raise SecurityError, "slave-IP has no permission initializing IP env"
+ rescue SecurityError => e
+ #p e.backtrace
+ # Is called on a Ruby/Tk library?
+ caller_info = e.backtrace[1]
+ if caller_info =~ %r{^#{MultiTkIp::BASE_DIR}/(tk|tkextlib)/[^:]+\.rb:}
+ # Probably, caller is a Ruby/Tk library --> allow creating
+ else
+ raise e
+ end
+ end
+ end
+
+ # @@IP_TABLE.each{|tg, ip|
+ # ip._init_ip_env(script)
+ # }
+ @@DEFAULT_MASTER.__init_ip_env__(@@IP_TABLE, script)
+ end
+
+ def self.add_tk_procs(name, args=nil, body=nil)
+ if name.kind_of?(Array) # => an array of [name, args, body]
+ name.each{|param| self.add_tk_procs(*param)}
+ else
+ name = name.to_s
+ @@ADD_TK_PROCS << [name, args, body]
+ @@IP_TABLE.each{|tg, ip|
+ ip._add_tk_procs(name, args, body)
+ }
+ end
+ end
+
+ def self.remove_tk_procs(*names)
+ names.each{|name|
+ name = name.to_s
+ @@ADD_TK_PROCS.delete_if{|elem|
+ elem.kind_of?(Array) && elem[0].to_s == name
+ }
+ }
+ @@IP_TABLE.each{|tg, ip|
+ ip._remove_tk_procs(*names)
+ }
+ end
+
+ def self.init_ip_internal
+ __getip._init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS)
+ end
+end
+
+# for callback operation
+class MultiTkIp
+ def self.cb_entry_class
+ @@CB_ENTRY_CLASS
+ end
+ def self.get_cb_entry(cmd)
+ @@CB_ENTRY_CLASS.new(__getip, cmd).freeze
+ end
+
+=begin
+ def cb_eval(cmd, *args)
+ #self.eval_callback{ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *args)) }
+ #ret = self.eval_callback{ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *args)) }
+ ret = self.eval_callback(*args){|safe, *params|
+ $SAFE=safe if $SAFE < safe
+ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params))
+ }
+ if ret.kind_of?(Exception)
+ raise ret
+ end
+ ret
+ end
+=end
+ def cb_eval(cmd, *args)
+ self.eval_callback(*args,
+ &_proc_on_safelevel{|*params|
+ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params))
+ })
+ end
+=begin
+ def cb_eval(cmd, *args)
+ self.eval_callback(*args){|safe, *params|
+ $SAFE=safe if $SAFE < safe
+ # TkUtil.eval_cmd(cmd, *params)
+ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params))
+ }
+ end
+=end
+=begin
+ def cb_eval(cmd, *args)
+ @callback_status[0] ||= TkVariable.new
+ @callback_status[1] ||= TkVariable.new
+ st, val = @callback_status
+ th = Thread.new{
+ self.eval_callback(*args){|safe, *params|
+ #p [status, val, safe, *params]
+ $SAFE=safe if $SAFE < safe
+ begin
+ TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params))
+ rescue TkCallbackContinue
+ st.value = 4
+ rescue TkCallbackBreak
+ st.value = 3
+ rescue TkCallbackReturn
+ st.value = 2
+ rescue Exception => e
+ val.value = e.message
+ st.value = 1
+ else
+ st.value = 0
+ end
+ }
+ }
+ begin
+ st.wait
+ status = st.numeric
+ retval = val.value
+ rescue => e
+ fail e
+ end
+
+ if status == 1
+ fail RuntimeError, retval
+ elsif status == 2
+ fail TkCallbackReturn, "Tk callback returns 'return' status"
+ elsif status == 3
+ fail TkCallbackBreak, "Tk callback returns 'break' status"
+ elsif status == 4
+ fail TkCallbackContinue, "Tk callback returns 'continue' status"
+ else
+ ''
+ end
+ end
+=end
+
+end
+
+# pseudo-toplevel operation support
+class MultiTkIp
+ # instance method
+ def __pseudo_toplevel
+ ip = MultiTkIp.__getip
+ (ip == @@DEFAULT_MASTER || ip == self) &&
+ self.__pseudo_toplevel_evaluable? && @pseudo_toplevel[1]
+ end
+
+ def __pseudo_toplevel=(m)
+ unless (Thread.current.group == ThreadGroup::Default &&
+ MultiTkIp.__getip == @@DEFAULT_MASTER)
+ fail SecurityError, "no permission to manipulate"
+ end
+
+ # if m.kind_of?(Module) && m.respond_to?(:pseudo_toplevel_evaluable?)
+ if m.respond_to?(:pseudo_toplevel_evaluable?)
+ @pseudo_toplevel[0] = true
+ @pseudo_toplevel[1] = m
+ else
+ fail ArgumentError, 'fail to set pseudo-toplevel'
+ end
+ self
+ end
+
+ def __pseudo_toplevel_evaluable?
+ begin
+ @pseudo_toplevel[0] && @pseudo_toplevel[1].pseudo_toplevel_evaluable?
+ rescue Exception
+ false
+ end
+ end
+
+ def __pseudo_toplevel_evaluable=(mode)
+ unless (Thread.current.group == ThreadGroup::Default &&
+ MultiTkIp.__getip == @@DEFAULT_MASTER)
+ fail SecurityError, "no permission to manipulate"
+ end
+
+ @pseudo_toplevel[0] = (mode)? true: false
+ end
+end
+
+
+################################################
+# use pseudo-toplevel feature of MultiTkIp ?
+if (!defined?(Use_PseudoToplevel_Feature_of_MultiTkIp) ||
+ Use_PseudoToplevel_Feature_of_MultiTkIp)
+ module MultiTkIp_PseudoToplevel_Evaluable
+ #def pseudo_toplevel_eval(body = Proc.new)
+ # Thread.current[:TOPLEVEL] = self
+ # begin
+ # body.call
+ # ensure
+ # Thread.current[:TOPLEVEL] = nil
+ # end
+ #end
+
+ def pseudo_toplevel_evaluable?
+ @pseudo_toplevel_evaluable
+ end
+
+ def pseudo_toplevel_evaluable=(mode)
+ @pseudo_toplevel_evaluable = (mode)? true: false
+ end
+
+ def self.extended(mod)
+ mod.__send__(:extend_object, mod)
+ mod.instance_variable_set('@pseudo_toplevel_evaluable', true)
+ end
+ end
+
+ class Object
+ alias __method_missing_alias_for_MultiTkIp__ method_missing
+ private :__method_missing_alias_for_MultiTkIp__
+
+ def method_missing(id, *args)
+ begin
+ has_top = (top = MultiTkIp.__getip.__pseudo_toplevel) &&
+ top.respond_to?(:pseudo_toplevel_evaluable?) &&
+ top.pseudo_toplevel_evaluable? &&
+ top.respond_to?(id)
+ rescue Exception => e
+ has_top = false
+ end
+
+ if has_top
+ top.__send__(id, *args)
+ else
+ __method_missing_alias_for_MultiTkIp__(id, *args)
+ end
+ end
+ end
+else
+ # dummy
+ module MultiTkIp_PseudoToplevel_Evaluable
+ def pseudo_toplevel_evaluable?
+ false
+ end
+ end
+end
+
+
+################################################
+# evaluate a procedure on the proper interpreter
+class MultiTkIp
+ # instance & class method
+ def _proc_on_safelevel(cmd=nil) # require a block for eval
+ if cmd
+ if cmd.kind_of?(Method)
+ _proc_on_safelevel{|*args| cmd.call(*args)}
+ else
+ _proc_on_safelevel(&cmd)
+ end
+ else
+ #Proc.new{|safe, *args| $SAFE=safe if $SAFE < safe; yield(*args)}
+ Proc.new{|safe, *args|
+ # avoid security error on Exception objects
+ untrust_proc = proc{|err|
+ begin
+ err.untrust if err.respond_to?(:untrust)
+ rescue SecurityError
+ end
+ err
+ }
+ $SAFE=safe if $SAFE < safe;
+ begin
+ yield(*args)
+ rescue Exception => e
+ fail untrust_proc.call(e)
+ end
+ }
+ end
+ end
+ def MultiTkIp._proc_on_safelevel(cmd=nil, &blk)
+ MultiTkIp.__getip._proc_on_safelevel(cmd, &blk)
+ end
+
+ def _proc_on_current_safelevel(cmd=nil, &blk) # require a block for eval
+ safe = $SAFE
+ cmd = _proc_on_safelevel(cmd, &blk)
+ Proc.new{|*args| cmd.call(safe, *args)}
+ end
+ def MultiTkIp._proc_on_current_safelevel(cmd=nil, &blk)
+ MultiTkIp.__getip._proc_on_current_safelevel(cmd, &blk)
+ end
+
+ ######################################
+ # instance method
+ def eval_proc_core(req_val, cmd, *args)
+ # check
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ unless cmd.kind_of?(Proc) || cmd.kind_of?(Method)
+ raise RuntimeError, "A Proc/Method object is expected for the 'cmd' argument"
+ end
+
+ # on IP thread
+ if @cmd_receiver == Thread.current ||
+ (!req_val && TclTkLib.mainloop_thread? != false) # callback
+ begin
+ ret = cmd.call(safe_level, *args)
+ rescue SystemExit => e
+ # exit IP
+ warn("Warning: "+ e.inspect + " on " + self.inspect) if $DEBUG
+ begin
+ self._eval_without_enc('exit')
+ rescue Exception => e
+ end
+ self.delete
+ ret = nil
+ rescue Exception => e
+ if $DEBUG
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
+ end
+=begin
+ begin
+ bt = _toUTF8(e.backtrace.join("\n"))
+ bt.instance_variable_set(:@encoding, 'utf-8')
+ rescue Exception
+ bt = e.backtrace.join("\n")
+ end
+ begin
+ @interp._set_global_var('errorInfo', bt)
+ rescue Exception
+ end
+=end
+ ret = e
+ end
+ return ret
+ end
+
+ # send cmd to the proc-queue
+ unless req_val
+ begin
+ @cmd_queue.enq([nil, cmd, *args])
+ rescue Exception => e
+ # ignore
+ if $DEBUG
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
+ end
+ return e
+ end
+ return nil
+ end
+
+ # send and get return value by exception
+ begin
+ @cmd_queue.enq([Thread.current, cmd, *args])
+ Thread.stop
+ rescue MultiTkIp_OK => ret
+ # return value
+ return ret.value
+ rescue SystemExit => e
+ # exit IP
+ warn("Warning: " + e.inspect + " on " + self.inspect) if $DEBUG
+ begin
+ self._eval_without_enc('exit')
+ rescue Exception
+ end
+ if !self.deleted? && !safe? && allow_ruby_exit?
+ self.delete
+ fail e
+ else
+ self.delete
+ end
+ rescue Exception => e
+ if $DEBUG
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
+ end
+ return e
+ end
+ return nil
+ end
+ private :eval_proc_core
+
+if false && WITH_RUBY_VM ### Ruby 1.9
+ # Not stable, so disable this feature
+ def eval_callback(*args)
+ if block_given?
+ cmd = Proc.new
+ else
+ cmd = args.shift
+ end
+ begin
+ if @@CALLBACK_SUBTHREAD.table[self].index(Thread.current)
+ last_th = nil
+ else
+ last_th = @@CALLBACK_SUBTHREAD.table[self][-1]
+ end
+ @@CALLBACK_SUBTHREAD.new(self){
+ @@CALLBACK_SUBTHREAD.table[self] << Thread.current
+ begin
+ last_th.join if last_th
+ eval_proc_core(false, cmd, *args)
+ rescue Exception=>e
+ e
+ ensure
+ @@CALLBACK_SUBTHREAD.table[self].delete(Thread.current)
+ end
+ }
+ end
+ end
+else ### Ruby 1.8
+ def eval_callback(*args)
+ if block_given?
+ cmd = Proc.new
+ else
+ cmd = args.shift
+ end
+ begin
+ eval_proc_core(false, cmd, *args)
+ rescue Exception=>e
+ e
+ ensure
+ end
+ end
+end
+
+ def eval_proc(*args, &blk)
+ if block_given?
+ cmd = _proc_on_safelevel(&blk)
+ else
+ unless (cmd = args.shift)
+ fail ArgumentError, "A Proc or Method object is expected for 1st argument"
+ end
+ cmd = _proc_on_safelevel(&cmd)
+ end
+ if TclTkLib.mainloop_thread? == true
+ # call from eventloop
+ current = Thread.current
+ backup_ip = current[:callback_ip]
+ current[:callback_ip] = self
+ begin
+ eval_proc_core(false, cmd, *args)
+ ensure
+ current[:callback_ip] = backup_ip
+ end
+ else
+ eval_proc_core(true,
+ proc{|safe, *params|
+ Thread.new{cmd.call(safe, *params)}.value
+ },
+ *args)
+ end
+ end
+=begin
+ def eval_proc(*args)
+ # The scope of the eval-block of 'eval_proc' method is different from
+ # the external. If you want to pass local values to the eval-block,
+ # use arguments of eval_proc method. They are passed to block-arguments.
+ if block_given?
+ cmd = Proc.new
+ else
+ unless (cmd = args.shift)
+ fail ArgumentError, "A Proc or Method object is expected for 1st argument"
+ end
+ end
+ if TclTkLib.mainloop_thread? == true
+ # call from eventloop
+ current = Thread.current
+ backup_ip = current[:callback_ip]
+ current[:callback_ip] = self
+ begin
+ eval_proc_core(false,
+ proc{|safe, *params|
+ $SAFE=safe if $SAFE < safe
+ cmd.call(*params)
+ }, *args)
+ ensure
+ current[:callback_ip] = backup_ip
+ end
+ else
+ eval_proc_core(true,
+ proc{|safe, *params|
+ $SAFE=safe if $SAFE < safe
+ Thread.new(*params, &cmd).value
+ },
+ *args)
+ end
+ end
+=end
+ alias call eval_proc
+
+ def bg_eval_proc(*args)
+ if block_given?
+ cmd = Proc.new
+ else
+ unless (cmd = args.shift)
+ fail ArgumentError, "A Proc or Method object is expected for 1st argument"
+ end
+ end
+ Thread.new{
+ eval_proc(cmd, *args)
+=begin
+ eval_proc_core(false,
+ proc{|safe, *params|
+ $SAFE=safe if $SAFE < safe
+ Thread.new(*params, &cmd).value
+ },
+ safe_level, *args)
+=end
+ }
+ end
+ alias background_eval_proc bg_eval_proc
+ alias thread_eval_proc bg_eval_proc
+ alias bg_call bg_eval_proc
+ alias background_call bg_eval_proc
+
+ def eval_string(cmd, *eval_args)
+ # cmd string ==> proc
+ unless cmd.kind_of?(String)
+ raise RuntimeError, "A String object is expected for the 'cmd' argument"
+ end
+
+ eval_proc_core(true,
+ proc{|safe|
+ Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd,
+ *eval_args)
+ })
+ end
+ alias eval_str eval_string
+
+ def bg_eval_string(cmd, *eval_args)
+ # cmd string ==> proc
+ unless cmd.kind_of?(String)
+ raise RuntimeError, "A String object is expected for the 'cmd' argument"
+ end
+ Thread.new{
+ eval_proc_core(true,
+ proc{|safe|
+ Kernel.eval("$SAFE=#{safe} if $SAFE < #{safe};" << cmd,
+ *eval_args)
+ })
+ }
+ end
+ alias background_eval_string bg_eval_string
+ alias bg_eval_str bg_eval_string
+ alias background_eval_str bg_eval_string
+
+ def eval(*args, &blk)
+ if block_given?
+ eval_proc(*args, &blk)
+ elsif args[0]
+ if args[0].respond_to?(:call)
+ eval_proc(*args)
+ else
+ eval_string(*args)
+ end
+ else
+ fail ArgumentError, "no argument to eval"
+ end
+ end
+
+ def bg_eval(*args, &blk)
+ if block_given?
+ bg_eval_proc(*args, &blk)
+ elsif args[0]
+ if args[0].respond_to?(:call)
+ bg_eval_proc(*args)
+ else
+ bg_eval_string(*args)
+ end
+ else
+ fail ArgumentError, "no argument to eval"
+ end
+ end
+ alias background_eval bg_eval
+end
+
+class << MultiTkIp
+ # class method
+ def eval_proc(*args, &blk)
+ # class ==> interp object
+ __getip.eval_proc(*args, &blk)
+ end
+ alias call eval_proc
+
+ def bg_eval_proc(*args, &blk)
+ # class ==> interp object
+ __getip.bg_eval_proc(*args, &blk)
+ end
+ alias background_eval_proc bg_eval_proc
+ alias thread_eval_proc bg_eval_proc
+ alias bg_call bg_eval_proc
+ alias background_call bg_eval_proc
+
+ def eval_string(cmd, *eval_args)
+ # class ==> interp object
+ __getip.eval_string(cmd, *eval_args)
+ end
+ alias eval_str eval_string
+
+ def bg_eval_string(cmd, *eval_args)
+ # class ==> interp object
+ __getip.bg_eval_string(cmd, *eval_args)
+ end
+ alias background_eval_string bg_eval_string
+ alias bg_eval_str bg_eval_string
+ alias background_eval_str bg_eval_string
+
+ def eval(*args, &blk)
+ # class ==> interp object
+ __getip.eval(*args, &blk)
+ end
+ def bg_eval(*args, &blk)
+ # class ==> interp object
+ __getip.bg_eval(*args, &blk)
+ end
+ alias background_eval bg_eval
+end
+
+
+# event loop
+# all master/slave IPs are controled by only one event-loop
+class MultiTkIp
+ def self.default_master?
+ __getip == @@DEFAULT_MASTER
+ end
+end
+class << MultiTkIp
+ def mainloop(check_root = true)
+ __getip.mainloop(check_root)
+ end
+ def mainloop_watchdog(check_root = true)
+ __getip.mainloop_watchdog(check_root)
+ end
+ def do_one_event(flag = TclTkLib::EventFlag::ALL)
+ __getip.do_one_event(flag)
+ end
+ def mainloop_abort_on_exception
+ # __getip.mainloop_abort_on_exception
+ TclTkLib.mainloop_abort_on_exception
+ end
+ def mainloop_abort_on_exception=(mode)
+ # __getip.mainloop_abort_on_exception=(mode)
+ TclTkLib.mainloop_abort_on_exception=(mode)
+ end
+ def set_eventloop_tick(tick)
+ __getip.set_eventloop_tick(tick)
+ end
+ def get_eventloop_tick
+ __getip.get_eventloop_tick
+ end
+ def set_no_event_wait(tick)
+ __getip.set_no_event_wait(tick)
+ end
+ def get_no_event_wait
+ __getip.get_no_event_wait
+ end
+ def set_eventloop_weight(loop_max, no_event_tick)
+ __getip.set_eventloop_weight(loop_max, no_event_tick)
+ end
+ def get_eventloop_weight
+ __getip.get_eventloop_weight
+ end
+end
+
+# class methods to delegate to TclTkIp
+class << MultiTkIp
+ def method_missing(id, *args)
+ __getip.__send__(id, *args)
+ end
+
+ def make_safe
+ __getip.make_safe
+ end
+
+ def safe?
+ __getip.safe?
+ end
+
+ def safe_base?
+ begin
+ __getip.safe_base?
+ rescue
+ false
+ end
+ end
+
+ def allow_ruby_exit?
+ __getip.allow_ruby_exit?
+ end
+
+ def allow_ruby_exit= (mode)
+ __getip.allow_ruby_exit = mode
+ end
+
+ def delete
+ __getip.delete
+ end
+
+ def deleted?
+ __getip.deleted?
+ end
+
+ def has_mainwindow?
+ __getip.has_mainwindow?
+ end
+
+ def invalid_namespace?
+ __getip.invalid_namespace?
+ end
+
+ def abort(msg = nil)
+ __getip.abort(msg)
+ end
+
+ def exit(st = true)
+ __getip.exit(st)
+ end
+
+ def exit!(st = false)
+ __getip.exit!(st)
+ end
+
+ def restart(app_name = nil, keys = {})
+ init_ip_internal
+
+ __getip._invoke('set', 'argv0', app_name) if app_name
+ if keys.kind_of?(Hash)
+ __getip._invoke('set', 'argv', _keys2opts(keys))
+ end
+
+ __getip.restart
+ end
+
+ def _eval(str)
+ __getip._eval(str)
+ end
+
+ def _invoke(*args)
+ __getip._invoke(*args)
+ end
+
+ def _eval_without_enc(str)
+ __getip._eval_without_enc(str)
+ end
+
+ def _invoke_without_enc(*args)
+ __getip._invoke_without_enc(*args)
+ end
+
+ def _eval_with_enc(str)
+ __getip._eval_with_enc(str)
+ end
+
+ def _invoke_with_enc(*args)
+ __getip._invoke_with_enc(*args)
+ end
+
+ def _toUTF8(str, encoding=nil)
+ __getip._toUTF8(str, encoding)
+ end
+
+ def _fromUTF8(str, encoding=nil)
+ __getip._fromUTF8(str, encoding)
+ end
+
+ def _thread_vwait(var)
+ __getip._thread_vwait(var)
+ end
+
+ def _thread_tkwait(mode, target)
+ __getip._thread_tkwait(mode, target)
+ end
+
+ def _return_value
+ __getip._return_value
+ end
+
+ def _get_variable(var, flag)
+ __getip._get_variable(var, flag)
+ end
+ def _get_variable2(var, idx, flag)
+ __getip._get_variable2(var, idx, flag)
+ end
+ def _set_variable(var, value, flag)
+ __getip._set_variable(var, value, flag)
+ end
+ def _set_variable2(var, idx, value, flag)
+ __getip._set_variable2(var, idx, value, flag)
+ end
+ def _unset_variable(var, flag)
+ __getip._unset_variable(var, flag)
+ end
+ def _unset_variable2(var, idx, flag)
+ __getip._unset_variable2(var, idx, flag)
+ end
+
+ def _get_global_var(var)
+ __getip._get_global_var(var)
+ end
+ def _get_global_var2(var, idx)
+ __getip._get_global_var2(var, idx)
+ end
+ def _set_global_var(var, value)
+ __getip._set_global_var(var, value)
+ end
+ def _set_global_var2(var, idx, value)
+ __getip._set_global_var2(var, idx, value)
+ end
+ def _unset_global_var(var)
+ __getip._unset_global_var(var)
+ end
+ def _unset_global_var2(var, idx)
+ __getip._unset_global_var2(var, idx)
+ end
+
+ def _make_menu_embeddable(menu_path)
+ __getip._make_menu_embeddable(menu_path)
+ end
+
+ def _split_tklist(str)
+ __getip._split_tklist(str)
+ end
+ def _merge_tklist(*args)
+ __getip._merge_tklist(*args)
+ end
+ def _conv_listelement(arg)
+ __getip._conv_listelement(arg)
+ end
+
+ def _create_console
+ __getip._create_console
+ end
+end
+
+
+# wrap methods on TclTkLib : not permit calling TclTkLib module methods
+class << TclTkLib
+ def mainloop(check_root = true)
+ MultiTkIp.mainloop(check_root)
+ end
+ def mainloop_watchdog(check_root = true)
+ MultiTkIp.mainloop_watchdog(check_root)
+ end
+ def do_one_event(flag = TclTkLib::EventFlag::ALL)
+ MultiTkIp.do_one_event(flag)
+ end
+ #def mainloop_abort_on_exception
+ # MultiTkIp.mainloop_abort_on_exception
+ #end
+ #def mainloop_abort_on_exception=(mode)
+ # MultiTkIp.mainloop_abort_on_exception=(mode)
+ #end
+ def set_eventloop_tick(tick)
+ MultiTkIp.set_eventloop_tick(tick)
+ end
+ def get_eventloop_tick
+ MultiTkIp.get_eventloop_tick
+ end
+ def set_no_event_wait(tick)
+ MultiTkIp.set_no_event_wait(tick)
+ end
+ def get_no_event_wait
+ MultiTkIp.get_no_event_wait
+ end
+ def set_eventloop_weight(loop_max, no_event_tick)
+ MultiTkIp.set_eventloop_weight(loop_max, no_event_tick)
+ end
+ def get_eventloop_weight
+ MultiTkIp.get_eventloop_weight
+ end
+ def restart(*args)
+ MultiTkIp.restart(*args)
+ end
+
+ def _merge_tklist(*args)
+ MultiTkIp._merge_tklist(*args)
+ end
+ def _conv_listelement(arg)
+ MultiTkIp._conv_listelement(arg)
+ end
+end
+
+
+# depend on TclTkIp
+class MultiTkIp
+# def mainloop(check_root = true, restart_on_dead = true)
+ def mainloop(check_root = true, restart_on_dead = false)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ if WITH_RUBY_VM ### Ruby 1.9 !!!!!!!!!!!
+ return @interp_thread.value if @interp_thread
+ end
+
+ #return self if self.slave?
+ #return self if self != @@DEFAULT_MASTER
+ if self != @@DEFAULT_MASTER
+ 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
+ rescue MultiTkIp_OK => ret
+ # return value
+ if ret.value.kind_of?(Thread)
+ return ret.value.value
+ else
+ return ret.value
+ end
+ rescue SystemExit => e
+ # exit IP
+ warn("Warning: " + e.inspect + " on " + self.inspect) if $DEBUG
+ begin
+ self._eval_without_enc('exit')
+ rescue Exception
+ end
+ self.delete
+ rescue StandardError => e
+ if $DEBUG
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
+ end
+ return e
+ rescue Exception => e
+ return e
+ ensure
+ @wait_on_mainloop[1] -= 1
+ end
+ end
+ return
+ end
+
+ unless restart_on_dead
+ @wait_on_mainloop[1] += 1
+=begin
+ begin
+ @interp.mainloop(check_root)
+ rescue StandardError => e
+ if $DEBUG
+ warn("Warning: " + e.class.inspect +
+ ((e.message.length > 0)? ' "' + e.message + '"': '') +
+ " on " + self.inspect)
+ end
+ end
+=end
+ begin
+ @interp.mainloop(check_root)
+ ensure
+ @wait_on_mainloop[1] -= 1
+ end
+ else
+ loop do
+ break unless self.alive?
+ if check_root
+ begin
+ break if TclTkLib.num_of_mainwindows == 0
+ rescue StandardError
+ break
+ end
+ end
+ break if @interp.deleted?
+ begin
+ @wait_on_mainloop[1] += 1
+ @interp.mainloop(check_root)
+ rescue StandardError => e
+ if TclTkLib.mainloop_abort_on_exception != nil
+ #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
+ # " exception (ignore) : ", $!.message, "\n");
+ if $DEBUG
+ warn("Warning: Tk mainloop receives " << e.class.inspect <<
+ " exception (ignore) : " << e.message);
+ end
+ end
+ #raise e
+ rescue Exception => e
+=begin
+ if TclTkLib.mainloop_abort_on_exception != nil
+ #STDERR.print("Warning: Tk mainloop receives ", $!.class.inspect,
+ # " exception (ignore) : ", $!.message, "\n");
+ if $DEBUG
+ warn("Warning: Tk mainloop receives " << e.class.inspect <<
+ " exception (ignore) : " << e.message);
+ end
+ end
+=end
+ raise e
+ ensure
+ @wait_on_mainloop[1] -= 1
+ Thread.pass # avoid eventloop conflict
+ end
+ end
+ end
+ self
+ end
+
+ def make_safe
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.make_safe
+ end
+
+ def safe?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.safe?
+ end
+
+ def safe_base?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @safe_base
+ end
+
+ def allow_ruby_exit?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.allow_ruby_exit?
+ end
+
+ def allow_ruby_exit= (mode)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.allow_ruby_exit = mode
+ end
+
+ def delete
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @slave_ip_tbl.each{|name, subip|
+ _destroy_slaves_of_slaveIP(subip)
+=begin
+ begin
+ subip._invoke('destroy', '.') unless subip.deleted?
+ rescue Exception
+ end
+=end
+ begin
+ # subip._eval_without_enc("foreach i [after info] {after cancel $i}")
+ unless subip.deleted?
+ after_ids = subip._eval_without_enc("after info")
+ subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ end
+ rescue Exception
+ end
+
+ # safe_base?
+ if @interp._eval_without_enc("catch {::safe::interpConfigure #{name}}") == '0'
+ begin
+ @interp._eval_without_enc("::safe::interpDelete #{name}")
+ rescue Exception
+ else
+ next if subip.deleted?
+ end
+ end
+ if subip.respond_to?(:safe_base?) && subip.safe_base? &&
+ !subip.deleted?
+ # do 'exit' to call the delete_hook procedure
+ begin
+ subip._eval_without_enc('exit')
+ rescue Exception
+ end
+ else
+ begin
+ subip.delete unless subip.deleted?
+ rescue Exception
+ end
+ end
+ }
+
+ begin
+ # @interp._eval_without_enc("foreach i [after info] {after cancel $i}")
+ after_ids = @interp._eval_without_enc("after info")
+ @interp._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
+ rescue Exception
+ end
+
+ begin
+ @interp._invoke('destroy', '.') unless @interp.deleted?
+ rescue Exception
+ end
+
+ if @safe_base && !@interp.deleted?
+ # do 'exit' to call the delete_hook procedure
+ @interp._eval_without_enc('exit')
+ end
+ @interp.delete
+ self
+ end
+
+ def deleted?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.deleted?
+ end
+
+ def has_mainwindow?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.has_mainwindow?
+ end
+
+ def invalid_namespace?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.invalid_namespace?
+ end
+
+ def abort(msg = nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if master? && !safe? && allow_ruby_exit?
+ if msg
+ Kernel.abort(msg)
+ else
+ Kernel.abort
+ end
+ else
+ # ignore msg
+ delete
+ 1
+ end
+ end
+
+ def exit(st = true)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if master? && !safe? && allow_ruby_exit?
+ Kernel.exit(st)
+ else
+ delete
+ st
+ end
+ end
+
+ def exit!(st = false)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if master? && !safe? && allow_ruby_exit?
+ Kernel.exit!(st)
+ else
+ delete
+ st
+ end
+ end
+
+ def restart(app_name = nil, keys = {})
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ _init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS)
+
+ @interp._invoke('set', 'argv0', app_name) if app_name
+ if keys.kind_of?(Hash)
+ @interp._invoke('set', 'argv', _keys2opts(keys))
+ end
+
+ @interp.restart
+ end
+
+ def __eval(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.__eval(str)
+ end
+
+ def __invoke(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.__invoke(*args)
+ end
+
+ def _eval(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._eval(str)
+ end
+
+ def _invoke(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke(*args)
+ end
+
+ def _eval_without_enc(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._eval_without_enc(str)
+ end
+
+ def _invoke_without_enc(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke_without_enc(*args)
+ end
+
+ def _eval_with_enc(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._eval_with_enc(str)
+ end
+
+ def _invoke_with_enc(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke_with_enc(*args)
+ end
+
+ def _toUTF8(str, encoding=nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._toUTF8(str, encoding)
+ end
+
+ def _fromUTF8(str, encoding=nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._fromUTF8(str, encoding)
+ end
+
+ def _thread_vwait(var)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._thread_vwait(var)
+ end
+
+ def _thread_tkwait(mode, target)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._thread_tkwait(mode, target)
+ end
+
+ def _return_value
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._return_value
+ end
+
+ def _get_variable(var, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._get_variable(var, flag)
+ end
+ def _get_variable2(var, idx, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._get_variable2(var, idx, flag)
+ end
+ def _set_variable(var, value, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._set_variable(var, value, flag)
+ end
+ def _set_variable2(var, idx, value, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._set_variable2(var, idx, value, flag)
+ end
+ def _unset_variable(var, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._unset_variable(var, flag)
+ end
+ def _unset_variable2(var, idx, flag)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._unset_variable2(var, idx, flag)
+ end
+
+ def _get_global_var(var)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._get_global_var(var)
+ end
+ def _get_global_var2(var, idx)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._get_global_var2(var, idx)
+ end
+ def _set_global_var(var, value)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._set_global_var(var, value)
+ end
+ def _set_global_var2(var, idx, value)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._set_global_var2(var, idx, value)
+ end
+ def _unset_global_var(var)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._unset_global_var(var)
+ end
+ def _unset_global_var2(var, idx)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._unset_global_var2(var, idx)
+ end
+
+ def _make_menu_embeddable(menu_path)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._make_menu_embeddable(menu_path)
+ end
+
+ def _split_tklist(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._split_tklist(str)
+ end
+ def _merge_tklist(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._merge_tklist(*args)
+ end
+ def _conv_listelement(arg)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._conv_listelement(arg)
+ end
+end
+
+
+# interp command support
+class MultiTkIp
+ def _lst2ary(str)
+ return [] if str == ""
+ idx = str.index('{')
+ while idx and idx > 0 and str[idx-1] == ?\\
+ idx = str.index('{', idx+1)
+ end
+ return str.split unless idx
+
+ list = str[0,idx].split
+ str = str[idx+1..-1]
+ i = -1
+ brace = 1
+ str.each_byte {|c|
+ c = c.chr
+ i += 1
+ brace += 1 if c == '{'
+ brace -= 1 if c == '}'
+ break if brace == 0
+ }
+ if i == 0
+ list.push ''
+ elsif str[0, i] == ' '
+ list.push ' '
+ else
+ list.push str[0..i-1]
+ end
+ #list += _lst2ary(str[i+1..-1])
+ list.concat(_lst2ary(str[i+1..-1]))
+ list
+ end
+ private :_lst2ary
+
+ def _slavearg(slave)
+ if slave.kind_of?(MultiTkIp)
+ slave.path
+ elsif slave.kind_of?(String)
+ slave
+ else
+ slave.to_s
+ end
+ end
+ private :_slavearg
+
+ def alias_info(slave, cmd_name)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ _lst2ary(@interp._invoke('interp', 'alias', _slavearg(slave), cmd_name))
+ end
+ def self.alias_info(slave, cmd_name)
+ __getip.alias_info(slave, cmd_name)
+ end
+
+ def alias_delete(slave, cmd_name)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'alias', _slavearg(slave), cmd_name, '')
+ self
+ end
+ def self.alias_delete(slave, cmd_name)
+ __getip.alias_delete(slave, cmd_name)
+ self
+ end
+
+ def def_alias(slave, new_cmd, org_cmd, *args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ ret = @interp._invoke('interp', 'alias', _slavearg(slave), new_cmd,
+ '', org_cmd, *args)
+ (ret == new_cmd)? self: nil
+ end
+ def self.def_alias(slave, new_cmd, org_cmd, *args)
+ ret = __getip.def_alias(slave, new_cmd, org_cmd, *args)
+ (ret == new_cmd)? self: nil
+ end
+
+ def aliases(slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ _lst2ary(@interp._invoke('interp', 'aliases', _slavearg(slave)))
+ end
+ def self.aliases(slave = '')
+ __getip.aliases(slave)
+ end
+
+ def delete_slaves(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ slaves = args.collect{|s| _slavearg(s)}
+ @interp._invoke('interp', 'delete', *slaves) if slaves.size > 0
+ self
+ end
+ def self.delete_slaves(*args)
+ __getip.delete_slaves(*args)
+ self
+ end
+
+ def exist?(slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ ret = @interp._invoke('interp', 'exists', _slavearg(slave))
+ (ret == '1')? true: false
+ end
+ def self.exist?(slave = '')
+ __getip.exist?(slave)
+ end
+
+ def delete_cmd(slave, cmd)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ slave_invoke = @interp._invoke('list', 'rename', cmd, '')
+ @interp._invoke('interp', 'eval', _slavearg(slave), slave_invoke)
+ self
+ end
+ def self.delete_cmd(slave, cmd)
+ __getip.delete_cmd(slave, cmd)
+ self
+ end
+
+ def expose_cmd(slave, cmd, aliasname = nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if aliasname
+ @interp._invoke('interp', 'expose', _slavearg(slave), cmd, aliasname)
+ else
+ @interp._invoke('interp', 'expose', _slavearg(slave), cmd)
+ end
+ self
+ end
+ def self.expose_cmd(slave, cmd, aliasname = nil)
+ __getip.expose_cmd(slave, cmd, aliasname)
+ self
+ end
+
+ def hide_cmd(slave, cmd, aliasname = nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if aliasname
+ @interp._invoke('interp', 'hide', _slavearg(slave), cmd, aliasname)
+ else
+ @interp._invoke('interp', 'hide', _slavearg(slave), cmd)
+ end
+ self
+ end
+ def self.hide_cmd(slave, cmd, aliasname = nil)
+ __getip.hide_cmd(slave, cmd, aliasname)
+ self
+ end
+
+ def hidden_cmds(slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ _lst2ary(@interp._invoke('interp', 'hidden', _slavearg(slave)))
+ end
+ def self.hidden_cmds(slave = '')
+ __getip.hidden_cmds(slave)
+ end
+
+ def invoke_hidden(slave, cmd, *args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = []
+ end
+ keys << _slavearg(slave)
+ if Tk::TCL_MAJOR_VERSION > 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ keys << '--'
+ end
+ keys << cmd
+ keys.concat(args)
+ @interp._invoke('interp', 'invokehidden', *keys)
+ end
+ def self.invoke_hidden(slave, cmd, *args)
+ __getip.invoke_hidden(slave, cmd, *args)
+ end
+
+ def invoke_hidden_on_global(slave, cmd, *args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = []
+ end
+ keys << _slavearg(slave)
+ keys << '-global'
+ if Tk::TCL_MAJOR_VERSION > 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ keys << '--'
+ end
+ keys << cmd
+ keys.concat(args)
+ @interp._invoke('interp', 'invokehidden', *keys)
+ end
+ def self.invoke_hidden_on_global(slave, cmd, *args)
+ __getip.invoke_hidden_on_global(slave, cmd, *args)
+ end
+
+ def invoke_hidden_on_namespace(slave, ns, cmd, *args)
+ # for Tcl8.5 or later
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = []
+ end
+ keys << _slavearg(slave)
+ keys << '-namespace' << TkComm._get_eval_string(ns)
+ keys << '--' << cmd
+ keys.concat(args)
+ @interp._invoke('interp', 'invokehidden', *keys)
+ end
+ def self.invoke_hidden_on_namespace(slave, ns, cmd, *args)
+ __getip.invoke_hidden_on_namespace(slave, ns, cmd, *args)
+ end
+
+ def mark_trusted(slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'marktrusted', _slavearg(slave))
+ self
+ end
+ def self.mark_trusted(slave = '')
+ __getip.mark_trusted(slave)
+ self
+ end
+
+ def set_bgerror_handler(cmd = Proc.new, slave = nil, &b)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ unless TkComm._callback_entry?(cmd)
+ if !slave && b
+ slave = cmd
+ cmd = Proc.new(&b)
+ end
+ end
+ slave = '' unless slave
+
+ @interp._invoke('interp', 'bgerror', _slavearg(slave), cmd)
+ end
+ def self.bgerror(cmd = Proc.new, slave = nil, &b)
+ __getip.bgerror(cmd, slave, &b)
+ end
+
+ def get_bgerror_handler(slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ procedure(@interp._invoke('interp', 'bgerror', _slavearg(slave)))
+ end
+ def self.bgerror(slave = '')
+ __getip.bgerror(slave)
+ end
+
+ def set_limit(limit_type, slave = '', opts = {})
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'limit', _slavearg(slave), limit_type, opts)
+ end
+ def self.set_limit(limit_type, slave = '', opts = {})
+ __getip.set_limit(limit_type, slave, opts)
+ end
+
+ def get_limit(limit_type, slave = '', slot = nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ if slot
+ num_or_str(@interp._invoke('interp', 'limit', _slavearg(slave),
+ limit_type, slot))
+ else
+ l = @interp._split_tklist(@interp._invoke_without_enc('interp', 'limit',
+ _slavearg(slave),
+ limit_type))
+ l.map!{|s| _fromUTF8(s)}
+ r = {}
+ until l.empty?
+ key = l.shift[1..-1]
+ val = l.shift
+ val = num_or_str(val) if val
+ r[key] = val
+ end
+ r
+ end
+ end
+ def self.get_limit(limit_type, slave = '', slot = nil)
+ __getip.get_limit(limit_type, slave, slot)
+ end
+
+ def recursion_limit(slave = '', limit = None)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ number(@interp._invoke('interp', 'recursionlimit',
+ _slavearg(slave), limit))
+ end
+ def self.recursion_limit(slave = '', limit = None)
+ __getip.recursion_limit(slave)
+ end
+
+ def alias_target(aliascmd, slave = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'target', _slavearg(slave), aliascmd)
+ end
+ def self.alias_target(aliascmd, slave = '')
+ __getip.alias_target(aliascmd, slave)
+ end
+
+ def share_stdin(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'share', src, 'stdin', dist)
+ self
+ end
+ def self.share_stdin(dist, src = '')
+ __getip.share_stdin(dist, src)
+ self
+ end
+
+ def share_stdout(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'share', src, 'stdout', dist)
+ self
+ end
+ def self.share_stdout(dist, src = '')
+ __getip.share_stdout(dist, src)
+ self
+ end
+
+ def share_stderr(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'share', src, 'stderr', dist)
+ self
+ end
+ def self.share_stderr(dist, src = '')
+ __getip.share_stderr(dist, src)
+ self
+ end
+
+ def transfer_stdin(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'transfer', src, 'stdin', dist)
+ self
+ end
+ def self.transfer_stdin(dist, src = '')
+ __getip.transfer_stdin(dist, src)
+ self
+ end
+
+ def transfer_stdout(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'transfer', src, 'stdout', dist)
+ self
+ end
+ def self.transfer_stdout(dist, src = '')
+ __getip.transfer_stdout(dist, src)
+ self
+ end
+
+ def transfer_stderr(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'transfer', src, 'stderr', dist)
+ self
+ end
+ def self.transfer_stderr(dist, src = '')
+ __getip.transfer_stderr(dist, src)
+ self
+ end
+
+ def share_stdio(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'share', src, 'stdin', dist)
+ @interp._invoke('interp', 'share', src, 'stdout', dist)
+ @interp._invoke('interp', 'share', src, 'stderr', dist)
+ self
+ end
+ def self.share_stdio(dist, src = '')
+ __getip.share_stdio(dist, src)
+ self
+ end
+
+ def transfer_stdio(dist, src = '')
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._invoke('interp', 'transfer', src, 'stdin', dist)
+ @interp._invoke('interp', 'transfer', src, 'stdout', dist)
+ @interp._invoke('interp', 'transfer', src, 'stderr', dist)
+ self
+ end
+ def self.transfer_stdio(dist, src = '')
+ __getip.transfer_stdio(dist, src)
+ self
+ end
+end
+
+
+# Safe Base :: manipulating safe interpreter
+class MultiTkIp
+ def safeip_configure(slot, value=None)
+ # use for '-noStatics' option ==> {statics=>false}
+ # for '-nestedLoadOk' option ==> {nested=>true}
+ if slot.kind_of?(Hash)
+ ip = MultiTkIp.__getip
+ ip._eval('::safe::interpConfigure ' + @ip_name + ' ' + _keys2opts(slot))
+ else
+ ip._eval('::safe::interpConfigure ' + @ip_name + ' ' +
+ "-#{slot} #{_get_eval_string(value)}")
+ end
+ self
+ end
+
+ def safeip_configinfo(slot = nil)
+ ip = MultiTkIp.__getip
+ ret = {}
+ if slot
+ conf = _lst2ary(ip._eval("::safe::interpConfigure " +
+ @ip_name + " -#{slot}"))
+ if conf[0] == '-deleteHook'
+=begin
+ if conf[1] =~ /^rb_out\S* (c(_\d+_)?\d+)/
+ ret[conf[0][1..-1]] = MultiTkIp._tk_cmd_tbl[$1]
+=end
+ if conf[1] =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+ ret[conf[0][1..-1]] = MultiTkIp._tk_cmd_tbl[$4]
+ else
+ ret[conf[0][1..-1]] = conf[1]
+ end
+ else
+ ret[conf[0][1..-1]] = conf[1]
+ end
+ else
+ Hash[*_lst2ary(ip._eval("::safe::interpConfigure " +
+ @ip_name))].each{|k, v|
+ if k == '-deleteHook'
+=begin
+ if v =~ /^rb_out\S* (c(_\d+_)?\d+)/
+ ret[k[1..-1]] = MultiTkIp._tk_cmd_tbl[$1]
+=end
+ if v =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+ ret[k[1..-1]] = MultiTkIp._tk_cmd_tbl[$4]
+ else
+ ret[k[1..-1]] = v
+ end
+ else
+ ret[k[1..-1]] = v
+ end
+ }
+ end
+ ret
+ end
+
+ def safeip_delete
+ ip = MultiTkIp.__getip
+ ip._eval("::safe::interpDelete " + @ip_name)
+ end
+
+ def safeip_add_to_access_path(dir)
+ ip = MultiTkIp.__getip
+ ip._eval("::safe::interpAddToAccessPath #{@ip_name} #{dir}")
+ end
+
+ def safeip_find_in_access_path(dir)
+ ip = MultiTkIp.__getip
+ ip._eval("::safe::interpFindInAccessPath #{@ip_name} #{dir}")
+ end
+
+ def safeip_set_log_cmd(cmd = Proc.new)
+ ip = MultiTkIp.__getip
+ ip._eval("::safe::setLogCmd #{@ip_name} #{_get_eval_string(cmd)}")
+ end
+end
+
+
+# encoding convert
+class << MultiTkIp
+ def encoding_table
+ __getip.encoding_table
+ end
+
+ def force_default_encoding=(mode)
+ __getip.force_default_encoding=(mode)
+ end
+
+ def force_default_encoding?
+ __getip.force_default_encoding?
+ end
+
+ def default_encoding=(enc)
+ __getip.default_encoding=(enc)
+ end
+
+ def encoding=(enc)
+ __getip.encoding=(enc)
+ end
+
+ def encoding_name
+ __getip.encoding_name
+ end
+
+ def encoding_obj
+ __getip.encoding_obj
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def encoding_convertfrom(str, enc=None)
+ __getip.encoding_convertfrom(str, enc)
+ end
+ alias encoding_convert_from encoding_convertfrom
+
+ def encoding_convertto(str, enc=None)
+ __getip.encoding_convertto(str, enc)
+ end
+ alias encoding_convert_to encoding_convertto
+end
+class MultiTkIp
+ def encoding_table
+ @interp.encoding_table
+ end
+
+ def force_default_encoding=(mode)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.force_default_encoding = mode
+ end
+ def force_default_encoding?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.force_default_encoding?
+ end
+
+ def default_encoding=(enc)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.default_encoding = enc
+ end
+
+ def encoding=(enc)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.encoding = enc
+ end
+ def encoding_name
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.encoding_name
+ end
+ def encoding_obj
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.encoding_obj
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def encoding_convertfrom(str, enc=None)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.encoding_convertfrom(str, enc)
+ end
+ alias encoding_convert_from encoding_convertfrom
+
+ def encoding_convertto(str, enc=None)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp.encoding_convertto(str, enc)
+ end
+ alias encoding_convert_to encoding_convertto
+end
+
+
+# remove methods for security
+=begin
+class MultiTkIp
+ INTERP_THREAD = @@DEFAULT_MASTER.instance_variable_get('@interp_thread')
+ INTERP_MUTEX = INTERP_THREAD[:mutex]
+ INTERP_ROOT_CHECK = INTERP_THREAD[:root_check]
+
+ # undef_method :instance_eval
+ undef_method :instance_variable_get
+ undef_method :instance_variable_set
+end
+
+module TkCore
+ if MultiTkIp::WITH_RUBY_VM &&
+ ! MultiTkIp::RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ INTERP_THREAD = MultiTkIp::INTERP_THREAD
+ INTERP_MUTEX = MultiTkIp::INTERP_MUTEX
+ INTERP_ROOT_CHECK = MultiTkIp::INTERP_ROOT_CHECK
+ end
+end
+class MultiTkIp
+ remove_const(:INTERP_THREAD)
+ remove_const(:INTERP_MUTEX)
+ remove_const(:INTERP_ROOT_CHECK)
+end
+=end
+if MultiTkIp::WITH_RUBY_VM &&
+ ! MultiTkIp::RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ class MultiTkIp
+ INTERP_THREAD = @@DEFAULT_MASTER.instance_variable_get('@interp_thread')
+ INTERP_THREAD_STATUS = INTERP_THREAD[:status]
+ INTERP_MUTEX = INTERP_THREAD[:mutex]
+ INTERP_ROOT_CHECK = INTERP_THREAD[:root_check]
+ end
+ module TkCore
+ INTERP_THREAD = MultiTkIp::INTERP_THREAD
+ INTERP_THREAD_STATUS = MultiTkIp::INTERP_THREAD_STATUS
+ INTERP_MUTEX = MultiTkIp::INTERP_MUTEX
+ INTERP_ROOT_CHECK = MultiTkIp::INTERP_ROOT_CHECK
+ end
+ class MultiTkIp
+ remove_const(:INTERP_THREAD)
+ remove_const(:INTERP_THREAD_STATUS)
+ remove_const(:INTERP_MUTEX)
+ remove_const(:INTERP_ROOT_CHECK)
+ end
+end
+
+class MultiTkIp
+ # undef_method :instance_eval
+ undef_method :instance_variable_get
+ undef_method :instance_variable_set
+end
+# end of MultiTkIp definition
+
+# defend against modification
+#MultiTkIp.freeze
+#TclTkLib.freeze
+
+########################################
+# start Tk which depends on MultiTkIp
+module TkCore
+ INTERP = MultiTkIp
+end
+require 'tk'
diff --git a/ext/tk/lib/remote-tk.rb b/ext/tk/lib/remote-tk.rb
new file mode 100644
index 0000000000..443d66010c
--- /dev/null
+++ b/ext/tk/lib/remote-tk.rb
@@ -0,0 +1,530 @@
+#
+# remote-tk.rb - supports to control remote Tk interpreters
+# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+if defined? MultiTkIp
+ fail RuntimeError, "'remote-tk' library must be required before requiring 'multi-tk'"
+end
+
+class MultiTkIp; end
+class RemoteTkIp < MultiTkIp; end
+
+class MultiTkIp
+ @@IP_TABLE = TkUtil.untrust({}) unless defined?(@@IP_TABLE)
+ @@TK_TABLE_LIST = TkUtil.untrust([]) unless defined?(@@TK_TABLE_LIST)
+ def self._IP_TABLE; @@IP_TABLE; end
+ def self._TK_TABLE_LIST; @@TK_TABLE_LIST; end
+
+ @flag = true
+ def self._DEFAULT_MASTER
+ # work only once
+ if @flag
+ @flag = nil
+ @@DEFAULT_MASTER
+ else
+ nil
+ end
+ end
+end
+class RemoteTkIp
+ @@IP_TABLE = MultiTkIp._IP_TABLE unless defined?(@@IP_TABLE)
+ @@TK_TABLE_LIST = MultiTkIp._TK_TABLE_LIST unless defined?(@@TK_TABLE_LIST)
+end
+class << MultiTkIp
+ undef _IP_TABLE
+ undef _TK_TABLE_LIST
+end
+
+require 'multi-tk'
+
+class RemoteTkIp
+ if defined?(@@DEFAULT_MASTER)
+ MultiTkIp._DEFAULT_MASTER
+ else
+ @@DEFAULT_MASTER = MultiTkIp._DEFAULT_MASTER
+ end
+end
+
+
+###############################
+
+class << RemoteTkIp
+ undef new_master, new_slave, new_safe_slave
+ undef new_trusted_slave, new_safeTk
+
+ def new(*args, &b)
+ ip = __new(*args)
+ ip.eval_proc(&b) if b
+ ip
+ end
+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"
+ end
+
+
+ @interp.allow_ruby_exit = false
+ @appname = @interp._invoke('tk', 'appname')
+ @remote = remote_ip.to_s.dup.freeze
+ if displayof.kind_of?(TkWindow)
+ @displayof = displayof.path.dup.freeze
+ else
+ @displayof = nil
+ end
+ if self.deleted?
+ fail RuntimeError, "no Tk application named \"#{@remote}\""
+ end
+
+ @tk_windows = {}
+ @tk_table_list = []
+ @slave_ip_tbl = {}
+ @slave_ip_top = {}
+
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+
+ TkUtil.untrust(@tk_windows) unless @tk_windows.tainted?
+ TkUtil.untrust(@tk_table_list) unless @tk_table_list.tainted?
+ TkUtil.untrust(@slave_ip_tbl) unless @slave_ip_tbl.tainted?
+ TkUtil.untrust(@slave_ip_top) unless @slave_ip_top.tainted?
+
+ @system = Object.new
+
+ @threadgroup = ThreadGroup.new
+
+ @safe_level = [$SAFE]
+
+ @wait_on_mainloop = [true, 0]
+
+ @cmd_queue = Queue.new
+
+=begin
+ @cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog()
+
+ @threadgroup.add @cmd_receiver
+ @threadgroup.add @receiver_watchdog
+
+ @threadgroup.enclose
+=end
+ @@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
+
+ @@IP_TABLE[@threadgroup] = self
+ @@TK_TABLE_LIST.size.times{
+ (tbl = {}).tainted? || TkUtil.untrust(tbl)
+ @tk_table_list << tbl
+ }
+
+ @ret_val = TkVariable.new
+ if timeout > 0 && ! _available_check(timeout)
+ fail RuntimeError, "cannot create connection"
+ end
+ @ip_id = _create_connection
+
+ class << self
+ undef :instance_eval
+ end
+
+ self.freeze # defend against modification
+ end
+
+ def manipulable?
+ return true if (Thread.current.group == ThreadGroup::Default)
+ MultiTkIp.__getip == @interp && ! @interp.safe?
+ end
+ def self.manipulable?
+ true
+ end
+
+ def _is_master_of?(tcltkip_obj)
+ tcltkip_obj == @interp
+ end
+ protected :_is_master_of?
+
+ def _ip_id_
+ @ip_id
+ end
+
+ def _available_check(timeout = 5)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ return nil if timeout < 1
+ @ret_val.value = ''
+ @interp._invoke('send', '-async', @remote,
+ 'send', '-async', Tk.appname,
+ "set #{@ret_val.id} ready")
+ Tk.update
+ if @ret_val != 'ready'
+ (1..(timeout*5)).each{
+ sleep 0.2
+ Tk.update
+ break if @ret_val == 'ready'
+ }
+ end
+ @ret_val.value == 'ready'
+ end
+ private :_available_check
+
+ def _create_connection
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ ip_id = '_' + @interp._invoke('send', @remote, <<-'EOS') + '_'
+ if {[catch {set _rubytk_control_ip_id_} ret] != 0} {
+ set _rubytk_control_ip_id_ 0
+ } else {
+ set _rubytk_control_ip_id_ [expr $ret + 1]
+ }
+ return $_rubytk_control_ip_id_
+ EOS
+
+ @interp._invoke('send', @remote, <<-EOS)
+ proc rb_out#{ip_id} args {
+ send #{@appname} rb_out \$args
+ }
+ EOS
+
+ ip_id
+ end
+ private :_create_connection
+
+ def _appsend(enc_mode, async, *cmds)
+ 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?}
+ fail SecurityError, "cannot send tainted commands at level #{$SAFE}"
+ end
+
+ cmds = @interp._merge_tklist(*TkUtil::_conv_args([], enc_mode, *cmds))
+ if @displayof
+ if async
+ @interp.__invoke('send', '-async', '-displayof', @displayof,
+ '--', @remote, *cmds)
+ else
+ @interp.__invoke('send', '-displayof', @displayof,
+ '--', @remote, *cmds)
+ end
+ else
+ if async
+ @interp.__invoke('send', '-async', '--', @remote, *cmds)
+ else
+ @interp.__invoke('send', '--', @remote, *cmds)
+ end
+ end
+ end
+ private :_appsend
+
+ def ready?(timeout=5)
+ if timeout < 0
+ fail ArgumentError, "timeout must be positive number"
+ end
+ _available_check(timeout)
+ end
+
+ def is_rubytk?
+ return false if _appsend(false, false, 'info', 'command', 'ruby') == ""
+ [ _appsend(false, false, 'ruby', 'RUBY_VERSION'),
+ _appsend(false, false, 'set', 'tk_patchLevel') ]
+ end
+
+ def appsend(async, *args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ if @displayof
+ Tk.appsend_displayof(@remote, @displayof, async, *args)
+ else
+ Tk.appsend(@remote, async, *args)
+ end
+ end
+
+ def rb_appsend(async, *args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ if @displayof
+ Tk.rb_appsend_displayof(@remote, @displayof, async, *args)
+ else
+ Tk.rb_appsend(@remote, async, *args)
+ end
+ end
+
+ def create_slave(name, safe=false)
+ if safe
+ safe_opt = ''
+ else
+ safe_opt = '-safe'
+ end
+ _appsend(false, false, "interp create #{safe_opt} -- #{name}")
+ end
+
+ def make_safe
+ fail RuntimeError, 'cannot change safe mode of the remote interpreter'
+ end
+
+ def safe?
+ _appsend(false, false, 'interp issafe')
+ end
+
+ def safe_base?
+ false
+ end
+
+ def allow_ruby_exit?
+ false
+ end
+
+ def allow_ruby_exit= (mode)
+ fail RuntimeError, 'cannot change mode of the remote interpreter'
+ end
+
+ def delete
+ _appsend(false, true, 'exit')
+ end
+
+ def deleted?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ if @displayof
+ lst = @interp._invoke_without_enc('winfo', 'interps',
+ '-displayof', @displayof)
+ else
+ lst = @interp._invoke_without_enc('winfo', 'interps')
+ end
+ # unless @interp._split_tklist(lst).index(@remote)
+ unless @interp._split_tklist(lst).index(_toUTF8(@remote))
+ true
+ else
+ false
+ end
+ end
+
+ def has_mainwindow?
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+
+ begin
+ inf = @interp._invoke_without_enc('info', 'command', '.')
+ rescue Exception
+ return nil
+ end
+ if !inf.kind_of?(String) || inf != '.'
+ false
+ else
+ true
+ end
+ end
+
+ def invalid_namespace?
+ false
+ end
+
+ def restart
+ fail RuntimeError, 'cannot restart the remote interpreter'
+ end
+
+ def __eval(str)
+ _appsend(false, false, str)
+ end
+ def _eval(str)
+ _appsend(nil, false, str)
+ end
+ def _eval_without_enc(str)
+ _appsend(false, false, str)
+ end
+ def _eval_with_enc(str)
+ _appsend(true, false, str)
+ end
+
+ def _invoke(*args)
+ _appsend(nil, false, *args)
+ end
+
+ def __invoke(*args)
+ _appsend(false, false, *args)
+ end
+ def _invoke(*args)
+ _appsend(nil, false, *args)
+ end
+ def _invoke_without_enc(*args)
+ _appsend(false, false, *args)
+ end
+ def _invoke_with_enc(*args)
+ _appsend(true, false, *args)
+ end
+
+ def _toUTF8(str, encoding=nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._toUTF8(str, encoding)
+ end
+
+ def _fromUTF8(str, encoding=nil)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._fromUTF8(str, encoding)
+ end
+
+ def _thread_vwait(var_name)
+ _appsend(false, 'thread_vwait', varname)
+ end
+
+ def _thread_tkwait(mode, target)
+ _appsend(false, 'thread_tkwait', mode, target)
+ end
+
+ def _return_value
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._return_value
+ end
+
+ def _get_variable(var_name, flag)
+ # ignore flag
+ _appsend(false, 'set', TkComm::_get_eval_string(var_name))
+ end
+ def _get_variable2(var_name, index_name, flag)
+ # ignore flag
+ _appsend(false, 'set', "#{TkComm::_get_eval_string(var_name)}(#{TkComm::_get_eval_string(index_name)})")
+ end
+
+ def _set_variable(var_name, value, flag)
+ # ignore flag
+ _appsend(false, 'set', TkComm::_get_eval_string(var_name), TkComm::_get_eval_string(value))
+ end
+ def _set_variable2(var_name, index_name, value, flag)
+ # ignore flag
+ _appsend(false, 'set', "#{TkComm::_get_eval_string(var_name)}(#{TkComm::_get_eval_string(index_name)})", TkComm::_get_eval_string(value))
+ end
+
+ def _unset_variable(var_name, flag)
+ # ignore flag
+ _appsend(false, 'unset', TkComm::_get_eval_string(var_name))
+ end
+ def _unset_variable2(var_name, index_name, flag)
+ # ignore flag
+ _appsend(false, 'unset', "#{var_name}(#{index_name})")
+ end
+
+ def _get_global_var(var_name)
+ _appsend(false, 'set', TkComm::_get_eval_string(var_name))
+ end
+ def _get_global_var2(var_name, index_name)
+ _appsend(false, 'set', "#{TkComm::_get_eval_string(var_name)}(#{TkComm::_get_eval_string(index_name)})")
+ end
+
+ def _set_global_var(var_name, value)
+ _appsend(false, 'set', TkComm::_get_eval_string(var_name), TkComm::_get_eval_string(value))
+ end
+ def _set_global_var2(var_name, index_name, value)
+ _appsend(false, 'set', "#{TkComm::_get_eval_string(var_name)}(#{TkComm::_get_eval_string(index_name)})", TkComm::_get_eval_string(value))
+ end
+
+ def _unset_global_var(var_name)
+ _appsend(false, 'unset', TkComm::_get_eval_string(var_name))
+ end
+ def _unset_global_var2(var_name, index_name)
+ _appsend(false, 'unset', "#{var_name}(#{index_name})")
+ end
+
+ def _split_tklist(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._split_tklist(str)
+ end
+
+ def _merge_tklist(*args)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._merge_tklist(*args)
+ end
+
+ def _conv_listelement(str)
+ raise SecurityError, "no permission to manipulate" unless self.manipulable?
+ @interp._conv_listelement(str)
+ end
+
+ def _create_console
+ fail RuntimeError, 'not support "_create_console" on the remote interpreter'
+ end
+
+ def mainloop
+ fail RuntimeError, 'not support "mainloop" on the remote interpreter'
+ end
+ def mainloop_watchdog
+ fail RuntimeError, 'not support "mainloop_watchdog" on the remote interpreter'
+ end
+ def do_one_event(flag = nil)
+ fail RuntimeError, 'not support "do_one_event" on the remote interpreter'
+ end
+ def mainloop_abort_on_exception
+ fail RuntimeError, 'not support "mainloop_abort_on_exception" on the remote interpreter'
+ end
+ def mainloop_abort_on_exception=(mode)
+ fail RuntimeError, 'not support "mainloop_abort_on_exception=" on the remote interpreter'
+ end
+ def set_eventloop_tick(*args)
+ fail RuntimeError, 'not support "set_eventloop_tick" on the remote interpreter'
+ end
+ def get_eventloop_tick
+ fail RuntimeError, 'not support "get_eventloop_tick" on the remote interpreter'
+ end
+ def set_no_event_wait(*args)
+ fail RuntimeError, 'not support "set_no_event_wait" on the remote interpreter'
+ end
+ def get_no_event_wait
+ fail RuntimeError, 'not support "get_no_event_wait" on the remote interpreter'
+ end
+ def set_eventloop_weight(*args)
+ fail RuntimeError, 'not support "set_eventloop_weight" on the remote interpreter'
+ end
+ def get_eventloop_weight
+ fail RuntimeError, 'not support "get_eventloop_weight" on the remote interpreter'
+ end
+end
+
+class << RemoteTkIp
+ def mainloop(*args)
+ fail RuntimeError, 'not support "mainloop" on the remote interpreter'
+ end
+ def mainloop_watchdog(*args)
+ fail RuntimeError, 'not support "mainloop_watchdog" on the remote interpreter'
+ end
+ def do_one_event(flag = nil)
+ fail RuntimeError, 'not support "do_one_event" on the remote interpreter'
+ end
+ def mainloop_abort_on_exception
+ fail RuntimeError, 'not support "mainloop_abort_on_exception" on the remote interpreter'
+ end
+ def mainloop_abort_on_exception=(mode)
+ fail RuntimeError, 'not support "mainloop_abort_on_exception=" on the remote interpreter'
+ end
+ def set_eventloop_tick(*args)
+ fail RuntimeError, 'not support "set_eventloop_tick" on the remote interpreter'
+ end
+ def get_eventloop_tick
+ fail RuntimeError, 'not support "get_eventloop_tick" on the remote interpreter'
+ end
+ def set_no_event_wait(*args)
+ fail RuntimeError, 'not support "set_no_event_wait" on the remote interpreter'
+ end
+ def get_no_event_wait
+ fail RuntimeError, 'not support "get_no_event_wait" on the remote interpreter'
+ end
+ def set_eventloop_weight(*args)
+ fail RuntimeError, 'not support "set_eventloop_weight" on the remote interpreter'
+ end
+ def get_eventloop_weight
+ fail RuntimeError, 'not support "get_eventloop_weight" on the remote interpreter'
+ end
+end
diff --git a/ext/tk/lib/tcltk.rb b/ext/tk/lib/tcltk.rb
new file mode 100644
index 0000000000..f8fbdfbe6d
--- /dev/null
+++ b/ext/tk/lib/tcltk.rb
@@ -0,0 +1,367 @@
+# tof
+
+#### tcltk library, more direct manipulation of tcl/tk
+#### Sep. 5, 1997 Y. Shigehiro
+
+require "tcltklib"
+
+################
+
+# module TclTk: collection of tcl/tk utilities (supplies namespace.)
+module TclTk
+
+ # initialize Hash to hold unique symbols and such
+ @namecnt = {}
+
+ # initialize Hash to hold callbacks
+ @callback = {}
+end
+
+# TclTk.mainloop(): call TclTkLib.mainloop()
+def TclTk.mainloop()
+ print("mainloop: start\n") if $DEBUG
+ TclTkLib.mainloop()
+ print("mainloop: end\n") if $DEBUG
+end
+
+# TclTk.deletecallbackkey(ca): remove callback from TclTk module
+# this does not remove callbacks from tcl/tk interpreter
+# without calling this method, TclTkInterpreter will not be GCed
+# ca: callback(TclTkCallback)
+def TclTk.deletecallbackkey(ca)
+ print("deletecallbackkey: ", ca.to_s(), "\n") if $DEBUG
+ @callback.delete(ca.to_s)
+end
+
+# TclTk.dcb(ca, wid, W): call TclTk.deletecallbackkey() for each callbacks
+# in an array.
+# this is for callback for top-level <Destroy>
+# ca: array of callbacks(TclTkCallback)
+# wid: top-level widget(TclTkWidget)
+# w: information about window given by %W(String)
+def TclTk.dcb(ca, wid, w)
+ if wid.to_s() == w
+ ca.each{|i|
+ TclTk.deletecallbackkey(i)
+ }
+ end
+end
+
+# TclTk._addcallback(ca): register callback
+# ca: callback(TclTkCallback)
+def TclTk._addcallback(ca)
+ print("_addcallback: ", ca.to_s(), "\n") if $DEBUG
+ @callback[ca.to_s()] = ca
+end
+
+# TclTk._callcallback(key, arg): invoke registered callback
+# key: key to select callback (to_s value of the TclTkCallback)
+# arg: parameter from tcl/tk interpreter
+def TclTk._callcallback(key, arg)
+ print("_callcallback: ", @callback[key].inspect, "\n") if $DEBUG
+ @callback[key]._call(arg)
+ # throw out callback value
+ # should return String to satisfy rb_eval_string()
+ return ""
+end
+
+# TclTk._newname(prefix): generate unique name(String)
+# prefix: prefix of the unique name
+def TclTk._newname(prefix)
+ # generated name counter is stored in @namecnt
+ if !@namecnt.key?(prefix)
+ # first appearing prefix, initialize
+ @namecnt[prefix] = 1
+ else
+ # already appeared prefix, generate next name
+ @namecnt[prefix] += 1
+ end
+ return "#{prefix}#{@namecnt[prefix]}"
+end
+
+################
+
+# class TclTkInterpreter: tcl/tk interpreter
+class TclTkInterpreter
+
+ # initialize():
+ def initialize()
+ # generate interpreter object
+ @ip = TclTkIp.new()
+
+ # add ruby_fmt command to tcl interpreter
+ # ruby_fmt command format arguments by `format' and call `ruby' command
+ # (notice ruby command receives only one argument)
+ if $DEBUG
+ @ip._eval("proc ruby_fmt {fmt args} { puts \"ruby_fmt: $fmt $args\" ; set cmd [list ruby [format $fmt $args]] ; uplevel $cmd }")
+ else
+ @ip._eval("proc ruby_fmt {fmt args} { set cmd [list ruby [format $fmt $args]] ; uplevel $cmd }")
+ end
+
+ # @ip._get_eval_string(*args): generate string to evaluate in tcl interpreter
+ # *args: script which is going to be evaluated under tcl/tk
+ def @ip._get_eval_string(*args)
+ argstr = ""
+ args.each{|arg|
+ argstr += " " if argstr != ""
+ # call to_eval if it is defined
+ if (arg.respond_to?(:to_eval))
+ argstr += arg.to_eval()
+ else
+ # call to_s unless defined
+ argstr += arg.to_s()
+ end
+ }
+ return argstr
+ end
+
+ # @ip._eval_args(*args): evaluate string under tcl/tk interpreter
+ # returns result string.
+ # *args: script which is going to be evaluated under tcl/tk
+ def @ip._eval_args(*args)
+ # calculate the string to eval in the interpreter
+ argstr = _get_eval_string(*args)
+
+ # evaluate under the interpreter
+ print("_eval: \"", argstr, "\"") if $DEBUG
+ res = _eval(argstr)
+ if $DEBUG
+ print(" -> \"", res, "\"\n")
+ elsif _return_value() != 0
+ print(res, "\n")
+ end
+ fail(%Q/can't eval "#{argstr}"/) if _return_value() != 0 #'
+ return res
+ end
+
+ # generate tcl/tk command object and register in the hash
+ @commands = {}
+ # for all commands registered in tcl/tk interpreter:
+ @ip._eval("info command").split(/ /).each{|comname|
+ if comname =~ /^[.]/
+ # if command is a widget (path), generate TclTkWidget,
+ # and register it in the hash
+ @commands[comname] = TclTkWidget.new(@ip, comname)
+ else
+ # otherwise, generate TclTkCommand
+ @commands[comname] = TclTkCommand.new(@ip, comname)
+ end
+ }
+ end
+
+ # commands(): returns hash of the tcl/tk commands
+ def commands()
+ return @commands
+ end
+
+ # rootwidget(): returns root widget(TclTkWidget)
+ def rootwidget()
+ return @commands["."]
+ end
+
+ # _tcltkip(): returns @ip(TclTkIp)
+ def _tcltkip()
+ return @ip
+ end
+
+ # method_missing(id, *args): execute undefined method as tcl/tk command
+ # id: method symbol
+ # *args: method arguments
+ def method_missing(id, *args)
+ # if command named by id registered, then execute it
+ if @commands.key?(id.id2name)
+ return @commands[id.id2name].e(*args)
+ else
+ # otherwise, exception
+ super
+ end
+ end
+end
+
+# class TclTkObject: base class of the tcl/tk objects
+class TclTkObject
+
+ # initialize(ip, exp):
+ # ip: interpreter(TclTkIp)
+ # exp: tcl/tk representation
+ def initialize(ip, exp)
+ fail("type is not TclTkIp") if !ip.kind_of?(TclTkIp)
+ @ip = ip
+ @exp = exp
+ end
+
+ # to_s(): returns tcl/tk representation
+ def to_s()
+ return @exp
+ end
+end
+
+# class TclTkCommand: tcl/tk commands
+# you should not call TclTkCommand.new()
+# commands are created by TclTkInterpreter:initialize()
+class TclTkCommand < TclTkObject
+
+ # e(*args): execute command. returns String (e is for exec or eval)
+ # *args: command arguments
+ def e(*args)
+ return @ip._eval_args(to_s(), *args)
+ end
+end
+
+# class TclTkLibCommand: tcl/tk commands in the library
+class TclTkLibCommand < TclTkCommand
+
+ # initialize(ip, name):
+ # ip: interpreter(TclTkInterpreter)
+ # name: command name (String)
+ def initialize(ip, name)
+ super(ip._tcltkip, name)
+ end
+end
+
+# class TclTkVariable: tcl/tk variable
+class TclTkVariable < TclTkObject
+
+ # initialize(interp, dat):
+ # interp: interpreter(TclTkInterpreter)
+ # dat: the value to set(String)
+ # if nil, not initialize variable
+ def initialize(interp, dat)
+ # auto-generate tcl/tk representation (variable name)
+ exp = TclTk._newname("v_")
+ # initialize TclTkObject
+ super(interp._tcltkip(), exp)
+ # safe this for `set' command
+ @set = interp.commands()["set"]
+ # set value
+ set(dat) if dat
+ end
+
+ # although you can set/read variables by using set in tcl/tk,
+ # we provide the method for accessing variables
+
+ # set(data): set tcl/tk variable using `set'
+ # data: new value
+ def set(data)
+ @set.e(to_s(), data.to_s())
+ end
+
+ # get(): read tcl/tk variable(String) using `set'
+ def get()
+ return @set.e(to_s())
+ end
+end
+
+# class TclTkWidget: tcl/tk widget
+class TclTkWidget < TclTkCommand
+
+ # initialize(*args):
+ # *args: parameters
+ def initialize(*args)
+ if args[0].kind_of?(TclTkIp)
+ # in case the 1st argument is TclTkIp:
+
+ # Wrap tcl/tk widget by TclTkWidget
+ # (used in TclTkInterpreter#initialize())
+
+ # need two arguments
+ fail("invalid # of parameter") if args.size != 2
+
+ # ip: interpreter(TclTkIp)
+ # exp: tcl/tk representation
+ ip, exp = args
+
+ # initialize TclTkObject
+ super(ip, exp)
+ elsif args[0].kind_of?(TclTkInterpreter)
+ # in case 1st parameter is TclTkInterpreter:
+
+ # generate new widget from parent widget
+
+ # interp: interpreter(TclTkInterpreter)
+ # parent: parent widget
+ # command: widget generating tk command(label 等)
+ # *args: argument to the command
+ interp, parent, command, *args = args
+
+ # generate widget name
+ exp = parent.to_s()
+ exp += "." if exp !~ /[.]$/
+ exp += TclTk._newname("w_")
+ # initialize TclTkObject
+ super(interp._tcltkip(), exp)
+ # generate widget
+ res = @ip._eval_args(command, exp, *args)
+# fail("can't create Widget") if res != exp
+ # for tk_optionMenu, it is legal res != exp
+ else
+ fail("first parameter is not TclTkInterpreter")
+ end
+ end
+end
+
+# class TclTkCallback: tcl/tk callbacks
+class TclTkCallback < TclTkObject
+
+ # initialize(interp, pr, arg):
+ # interp: interpreter(TclTkInterpreter)
+ # pr: callback procedure(Proc)
+ # arg: string to pass as block parameters of pr
+ # bind command of tcl/tk uses % replacement for parameters
+ # pr can receive replaced data using block parameter
+ # its format is specified by arg string
+ # You should not specify arg for the command like
+ # scrollbar with -command option, which receives parameters
+ # without specifying any replacement
+ def initialize(interp, pr, arg = nil)
+ # auto-generate tcl/tk representation (variable name)
+ exp = TclTk._newname("c_")
+ # initialize TclTkObject
+ super(interp._tcltkip(), exp)
+ # save parameters
+ @pr = pr
+ @arg = arg
+ # register in the module
+ TclTk._addcallback(self)
+ end
+
+ # 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
+ s = %Q/{ruby_fmt {TclTk._callcallback("#{to_s()}", "%%s")} #{@arg}}/
+ else
+ s = %Q/{ruby_fmt {TclTk._callcallback("#{to_s()}", "%s")}}/
+ end
+
+ return s
+ end
+
+ # _call(arg): invoke callback
+ # arg: callback parameter
+ def _call(arg)
+ @pr.call(arg)
+ end
+end
+
+# class TclTkImage: tcl/tk images
+class TclTkImage < TclTkCommand
+
+ # initialize(interp, t, *args):
+ # generating image is done by TclTkImage.new()
+ # destroying is done by image delete (inconsistent, sigh)
+ # interp: interpreter(TclTkInterpreter)
+ # t: image type (photo, bitmap, etc.)
+ # *args: command argument
+ def initialize(interp, t, *args)
+ # auto-generate tcl/tk representation
+ exp = TclTk._newname("i_")
+ # initialize TclTkObject
+ super(interp._tcltkip(), exp)
+ # generate image
+ res = @ip._eval_args("image create", t, exp, *args)
+ fail("can't create Image") if res != exp
+ end
+end
+
+# eof
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
new file mode 100644
index 0000000000..5bac92e47c
--- /dev/null
+++ b/ext/tk/lib/tk.rb
@@ -0,0 +1,5761 @@
+#
+# tk.rb - Tk interface module using tcltklib
+# by Yukihiro Matsumoto <matz@netlab.jp>
+
+# use Shigehiro's tcltklib
+require 'tcltklib'
+require 'tkutil'
+
+# autoload
+require 'tk/autoload'
+
+# for Mutex
+require 'thread'
+
+class TclTkIp
+ # backup original (without encoding) _eval and _invoke
+ alias _eval_without_enc _eval
+ alias __eval__ _eval
+ alias _invoke_without_enc _invoke
+ alias __invoke__ _invoke
+
+ def _ip_id_
+ # for RemoteTkIp
+ ''
+ end
+
+ alias __initialize__ initialize
+ private :__initialize__
+
+ def initialize(*args)
+ __initialize__(*args)
+
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+ end
+end
+
+# define TkComm module (step 1: basic functions)
+module TkComm
+ include TkUtil
+ extend TkUtil
+
+ WidgetClassNames = TkUtil.untrust({})
+ TkExtlibAutoloadModule = TkUtil.untrust([])
+
+ # None = Object.new ### --> definition is moved to TkUtil module
+ # def None.to_s
+ # 'None'
+ # end
+ # None.freeze
+
+ #Tk_CMDTBL = {}
+ #Tk_WINDOWS = {}
+ Tk_IDs = [
+ TkUtil.untrust("00000"), # [0]-cmdid
+ TkUtil.untrust("00000") # [1]-winid
+ ]
+ Tk_IDs.instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ # for backward compatibility
+ Tk_CMDTBL = Object.new
+ def Tk_CMDTBL.method_missing(id, *args)
+ TkCore::INTERP.tk_cmd_tbl.__send__(id, *args)
+ end
+ Tk_CMDTBL.freeze
+ Tk_WINDOWS = Object.new
+ def Tk_WINDOWS.method_missing(id, *args)
+ TkCore::INTERP.tk_windows.__send__(id, *args)
+ end
+ Tk_WINDOWS.freeze
+
+ self.instance_eval{
+ @cmdtbl = TkUtil.untrust([])
+ }
+
+ unless const_defined?(:GET_CONFIGINFO_AS_ARRAY)
+ # GET_CONFIGINFO_AS_ARRAY = false => returns a Hash { opt =>val, ... }
+ # true => returns an Array [[opt,val], ... ]
+ # val is a list which includes resource info.
+ GET_CONFIGINFO_AS_ARRAY = true
+ end
+ unless const_defined?(:GET_CONFIGINFOwoRES_AS_ARRAY)
+ # for configinfo without resource info; list of [opt, value] pair
+ # false => returns a Hash { opt=>val, ... }
+ # true => returns an Array [[opt,val], ... ]
+ GET_CONFIGINFOwoRES_AS_ARRAY = true
+ end
+ # *** ATTENTION ***
+ # 'current_configinfo' method always returns a Hash under all cases of above.
+
+ def error_at
+ frames = caller()
+ frames.delete_if do |c|
+ c =~ %r!/tk(|core|thcore|canvas|text|entry|scrollbox)\.rb:\d+!
+ end
+ frames
+ end
+ private :error_at
+
+ def _genobj_for_tkwidget(path)
+ return TkRoot.new if path == '.'
+
+ begin
+ #tk_class = TkCore::INTERP._invoke('winfo', 'class', path)
+ tk_class = Tk.ip_invoke_without_enc('winfo', 'class', path)
+ rescue
+ return path
+ end
+
+ if ruby_class = WidgetClassNames[tk_class]
+ ruby_class_name = ruby_class.name
+ # gen_class_name = ruby_class_name + 'GeneratedOnTk'
+ gen_class_name = ruby_class_name
+ classname_def = ''
+ else # ruby_class == nil
+ if Tk.const_defined?(tk_class)
+ Tk.const_get(tk_class) # auto_load
+ ruby_class = WidgetClassNames[tk_class]
+ end
+
+ unless ruby_class
+ mods = TkExtlibAutoloadModule.find_all{|m| m.const_defined?(tk_class)}
+ mods.each{|mod|
+ begin
+ mod.const_get(tk_class) # auto_load
+ break if (ruby_class = WidgetClassNames[tk_class])
+ rescue LoadError
+ # ignore load error
+ end
+ }
+ end
+
+ unless ruby_class
+ std_class = 'Tk' << tk_class
+ if Object.const_defined?(std_class)
+ Object.const_get(std_class) # auto_load
+ ruby_class = WidgetClassNames[tk_class]
+ end
+ end
+
+ unless ruby_class
+ if Tk.const_defined?('TOPLEVEL_ALIASES') &&
+ Tk::TOPLEVEL_ALIASES.const_defined?(std_class)
+ Tk::TOPLEVEL_ALIASES.const_get(std_class) # auto_load
+ ruby_class = WidgetClassNames[tk_class]
+ end
+ end
+
+ if ruby_class
+ # found
+ ruby_class_name = ruby_class.name
+ gen_class_name = ruby_class_name
+ classname_def = ''
+ else
+ # unknown
+ ruby_class_name = 'TkWindow'
+ gen_class_name = 'TkWidget_' + tk_class
+ classname_def = "WidgetClassName = '#{tk_class}'.freeze"
+ end
+ end
+
+###################################
+=begin
+ if ruby_class = WidgetClassNames[tk_class]
+ ruby_class_name = ruby_class.name
+ # gen_class_name = ruby_class_name + 'GeneratedOnTk'
+ gen_class_name = ruby_class_name
+ classname_def = ''
+ else
+ mod = TkExtlibAutoloadModule.find{|m| m.const_defined?(tk_class)}
+ if mod
+ ruby_class_name = mod.name + '::' + tk_class
+ gen_class_name = ruby_class_name
+ classname_def = ''
+ elsif Object.const_defined?('Tk' + tk_class)
+ ruby_class_name = 'Tk' + tk_class
+ # gen_class_name = ruby_class_name + 'GeneratedOnTk'
+ gen_class_name = ruby_class_name
+ classname_def = ''
+ else
+ ruby_class_name = 'TkWindow'
+ # gen_class_name = ruby_class_name + tk_class + 'GeneratedOnTk'
+ gen_class_name = 'TkWidget_' + tk_class
+ classname_def = "WidgetClassName = '#{tk_class}'.freeze"
+ end
+ end
+=end
+
+=begin
+ unless Object.const_defined? gen_class_name
+ Object.class_eval "class #{gen_class_name}<#{ruby_class_name}
+ #{classname_def}
+ end"
+ end
+ Object.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
+ 'without_creating'=>true)"
+=end
+ base = Object
+ gen_class_name.split('::').each{|klass|
+ next if klass == ''
+ if base.const_defined?(klass)
+ base = base.class_eval klass
+ else
+ base = base.class_eval "class #{klass}<#{ruby_class_name}
+ #{classname_def}
+ end
+ #{klass}"
+ end
+ }
+ base.class_eval "#{gen_class_name}.new('widgetname'=>'#{path}',
+ 'without_creating'=>true)"
+ end
+ private :_genobj_for_tkwidget
+ module_function :_genobj_for_tkwidget
+
+ def _at(x,y=nil)
+ if y
+ "@#{Integer(x)},#{Integer(y)}"
+ else
+ "@#{Integer(x)}"
+ end
+ end
+ module_function :_at
+
+ def tk_tcl2ruby(val, enc_mode = false, listobj = true)
+=begin
+ if val =~ /^rb_out\S* (c(_\d+_)?\d+)/
+ #return Tk_CMDTBL[$1]
+ return TkCore::INTERP.tk_cmd_tbl[$1]
+ #cmd_obj = TkCore::INTERP.tk_cmd_tbl[$1]
+ #if cmd_obj.kind_of?(Proc) || cmd_obj.kind_of?(Method)
+ # cmd_obj
+ #else
+ # cmd_obj.cmd
+ #end
+ end
+=end
+ if val =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+ return TkCore::INTERP.tk_cmd_tbl[$4]
+ end
+ #if val.include? ?\s
+ # return val.split.collect{|v| tk_tcl2ruby(v)}
+ #end
+ case val
+ when /\A@font\S+\z/
+ TkFont.get_obj(val)
+ when /\A-?\d+\z/
+ val.to_i
+ when /\A\.\S*\z/
+ #Tk_WINDOWS[val] ? Tk_WINDOWS[val] : _genobj_for_tkwidget(val)
+ TkCore::INTERP.tk_windows[val]?
+ TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val)
+ when /\Ai(_\d+_)?\d+\z/
+ TkImage::Tk_IMGTBL.mutex.synchronize{
+ TkImage::Tk_IMGTBL[val]? TkImage::Tk_IMGTBL[val] : val
+ }
+ when /\A-?\d+\.?\d*(e[-+]?\d+)?\z/
+ val.to_f
+ when /\\ /
+ val.gsub(/\\ /, ' ')
+ when /[^\\] /
+ if listobj
+ #tk_split_escstr(val).collect{|elt|
+ # tk_tcl2ruby(elt, enc_mode, listobj)
+ #}
+ val = _toUTF8(val) unless enc_mode
+ tk_split_escstr(val, false, false).collect{|elt|
+ tk_tcl2ruby(elt, true, listobj)
+ }
+ elsif enc_mode
+ _fromUTF8(val)
+ else
+ val
+ end
+ else
+ if enc_mode
+ _fromUTF8(val)
+ else
+ val
+ end
+ end
+ end
+
+ private :tk_tcl2ruby
+ module_function :tk_tcl2ruby
+ #private_class_method :tk_tcl2ruby
+
+unless const_defined?(:USE_TCLs_LIST_FUNCTIONS)
+ USE_TCLs_LIST_FUNCTIONS = true
+end
+
+if USE_TCLs_LIST_FUNCTIONS
+ ###########################################################################
+ # use Tcl function version of split_list
+ ###########################################################################
+
+ def tk_split_escstr(str, src_enc=true, dst_enc=true)
+ str = _toUTF8(str) if src_enc
+ if dst_enc
+ TkCore::INTERP._split_tklist(str).map!{|s| _fromUTF8(s)}
+ else
+ TkCore::INTERP._split_tklist(str)
+ end
+ end
+
+ def tk_split_sublist(str, depth=-1, src_enc=true, dst_enc=true)
+ # return [] if str == ""
+ # list = TkCore::INTERP._split_tklist(str)
+ str = _toUTF8(str) if src_enc
+
+ if depth == 0
+ return "" if str == ""
+ list = [str]
+ else
+ return [] if str == ""
+ list = TkCore::INTERP._split_tklist(str)
+ end
+ if list.size == 1
+ # tk_tcl2ruby(list[0], nil, false)
+ tk_tcl2ruby(list[0], dst_enc, false)
+ else
+ list.collect{|token| tk_split_sublist(token, depth - 1, false, dst_enc)}
+ end
+ end
+
+ def tk_split_list(str, depth=0, src_enc=true, dst_enc=true)
+ return [] if str == ""
+ str = _toUTF8(str) if src_enc
+ TkCore::INTERP._split_tklist(str).map!{|token|
+ tk_split_sublist(token, depth - 1, false, dst_enc)
+ }
+ end
+
+ def tk_split_simplelist(str, src_enc=true, dst_enc=true)
+ #lst = TkCore::INTERP._split_tklist(str)
+ #if (lst.size == 1 && lst =~ /^\{.*\}$/)
+ # TkCore::INTERP._split_tklist(str[1..-2])
+ #else
+ # lst
+ #end
+
+ str = _toUTF8(str) if src_enc
+ if dst_enc
+ TkCore::INTERP._split_tklist(str).map!{|s| _fromUTF8(s)}
+ else
+ TkCore::INTERP._split_tklist(str)
+ end
+ end
+
+ def array2tk_list(ary, enc=nil)
+ return "" if ary.size == 0
+
+ sys_enc = TkCore::INTERP.encoding
+ sys_enc = TclTkLib.encoding_system unless sys_enc
+
+ dst_enc = (enc == nil)? sys_enc: enc
+
+ dst = ary.collect{|e|
+ if e.kind_of? Array
+ s = array2tk_list(e, enc)
+ elsif e.kind_of? Hash
+ tmp_ary = []
+ #e.each{|k,v| tmp_ary << k << v }
+ e.each{|k,v| tmp_ary << "-#{_get_eval_string(k)}" << v }
+ s = array2tk_list(tmp_ary, enc)
+ else
+ s = _get_eval_string(e, enc)
+ end
+
+ if dst_enc != true && dst_enc != false
+ if (s_enc = s.instance_variable_get(:@encoding))
+ s_enc = s_enc.to_s
+ elsif TkCore::WITH_ENCODING
+ s_enc = s.encoding.name
+ else
+ s_enc = sys_enc
+ end
+ dst_enc = true if s_enc != dst_enc
+ end
+
+ s
+ }
+
+ if sys_enc && dst_enc
+ dst.map!{|s| _toUTF8(s)}
+ ret = TkCore::INTERP._merge_tklist(*dst)
+ if TkCore::WITH_ENCODING
+ if dst_enc.kind_of?(String)
+ ret = _fromUTF8(ret, dst_enc)
+ ret.force_encoding(dst_enc)
+ else
+ ret.force_encoding('utf-8')
+ end
+ else # without encoding
+ if dst_enc.kind_of?(String)
+ ret = _fromUTF8(ret, dst_enc)
+ ret.instance_variable_set(:@encoding, dst_enc)
+ else
+ ret.instance_variable_set(:@encoding, 'utf-8')
+ end
+ end
+ ret
+ else
+ TkCore::INTERP._merge_tklist(*dst)
+ end
+ end
+
+else
+ ###########################################################################
+ # use Ruby script version of split_list (traditional methods)
+ ###########################################################################
+
+ def tk_split_escstr(str, src_enc=true, dst_enc=true)
+ return [] if str == ""
+ list = []
+ token = nil
+ escape = false
+ brace = 0
+ str.split('').each {|c|
+ brace += 1 if c == '{' && !escape
+ brace -= 1 if c == '}' && !escape
+ if brace == 0 && c == ' ' && !escape
+ list << token.gsub(/^\{(.*)\}$/, '\1') if token
+ token = nil
+ else
+ token = (token || "") << c
+ end
+ escape = (c == '\\' && !escape)
+ }
+ list << token.gsub(/^\{(.*)\}$/, '\1') if token
+ list
+ end
+
+ def tk_split_sublist(str, depth=-1, src_enc=true, dst_enc=true)
+ #return [] if str == ""
+ #return [tk_split_sublist(str[1..-2])] if str =~ /^\{.*\}$/
+ #list = tk_split_escstr(str)
+ if depth == 0
+ return "" if str == ""
+ str = str[1..-2] if str =~ /^\{.*\}$/
+ list = [str]
+ else
+ return [] if str == []
+ return [tk_split_sublist(str[1..-2], depth - 1)] if str =~ /^\{.*\}$/
+ list = tk_split_escstr(str)
+ end
+ if list.size == 1
+ tk_tcl2ruby(list[0], nil, false)
+ else
+ list.collect{|token| tk_split_sublist(token, depth - 1)}
+ end
+ end
+
+ def tk_split_list(str, depth=0, src_enc=true, dst_enc=true)
+ return [] if str == ""
+ tk_split_escstr(str).collect{|token|
+ tk_split_sublist(token, depth - 1)
+ }
+ end
+
+ def tk_split_simplelist(str, src_enc=true, dst_enc=true)
+ return [] if str == ""
+ list = []
+ token = nil
+ escape = false
+ brace = 0
+ str.split('').each {|c|
+ if c == '\\' && !escape
+ escape = true
+ token = (token || "") << c if brace > 0
+ next
+ end
+ brace += 1 if c == '{' && !escape
+ brace -= 1 if c == '}' && !escape
+ if brace == 0 && c == ' ' && !escape
+ list << token.gsub(/^\{(.*)\}$/, '\1') if token
+ token = nil
+ else
+ token = (token || "") << c
+ end
+ escape = false
+ }
+ list << token.gsub(/^\{(.*)\}$/, '\1') if token
+ list
+ end
+
+ def array2tk_list(ary, enc=nil)
+ ary.collect{|e|
+ if e.kind_of? Array
+ "{#{array2tk_list(e, enc)}}"
+ elsif e.kind_of? Hash
+ # "{#{e.to_a.collect{|ee| array2tk_list(ee)}.join(' ')}}"
+ e.each{|k,v| tmp_ary << "-#{_get_eval_string(k)}" << v }
+ array2tk_list(tmp_ary, enc)
+ else
+ s = _get_eval_string(e, enc)
+ (s.index(/\s/) || s.size == 0)? "{#{s}}": s
+ end
+ }.join(" ")
+ end
+end
+
+ private :tk_split_escstr, :tk_split_sublist
+ private :tk_split_list, :tk_split_simplelist
+ private :array2tk_list
+
+ module_function :tk_split_escstr, :tk_split_sublist
+ module_function :tk_split_list, :tk_split_simplelist
+ module_function :array2tk_list
+
+ private_class_method :tk_split_escstr, :tk_split_sublist
+ private_class_method :tk_split_list, :tk_split_simplelist
+# private_class_method :array2tk_list
+
+=begin
+ ### --> definition is moved to TkUtil module
+ def _symbolkey2str(keys)
+ h = {}
+ keys.each{|key,value| h[key.to_s] = value}
+ h
+ end
+ private :_symbolkey2str
+ module_function :_symbolkey2str
+=end
+
+=begin
+ ### --> definition is moved to TkUtil module
+ # def hash_kv(keys, enc_mode = nil, conf = [], flat = false)
+ def hash_kv(keys, enc_mode = nil, conf = nil)
+ # Hash {key=>val, key=>val, ... } or Array [ [key, val], [key, val], ... ]
+ # ==> Array ['-key', val, '-key', val, ... ]
+ dst = []
+ if keys and keys != None
+ keys.each{|k, v|
+ #dst.push("-#{k}")
+ dst.push('-' + k.to_s)
+ if v != None
+ # v = _get_eval_string(v, enc_mode) if (enc_mode || flat)
+ v = _get_eval_string(v, enc_mode) if enc_mode
+ dst.push(v)
+ end
+ }
+ end
+ if conf
+ conf + dst
+ else
+ dst
+ end
+ end
+ private :hash_kv
+ module_function :hash_kv
+=end
+
+=begin
+ ### --> definition is moved to TkUtil module
+ def bool(val)
+ case val
+ when "1", 1, 'yes', 'true'
+ true
+ else
+ false
+ end
+ end
+
+ def number(val)
+ case val
+ when /^-?\d+$/
+ val.to_i
+ when /^-?\d+\.?\d*(e[-+]?\d+)?$/
+ val.to_f
+ else
+ fail(ArgumentError, "invalid value for Number:'#{val}'")
+ end
+ end
+ def string(val)
+ if val == "{}"
+ ''
+ elsif val[0] == ?{ && val[-1] == ?}
+ val[1..-2]
+ else
+ val
+ end
+ end
+ def num_or_str(val)
+ begin
+ number(val)
+ rescue ArgumentError
+ string(val)
+ end
+ end
+=end
+
+ def list(val, depth=0, enc=true)
+ tk_split_list(val, depth, enc, enc)
+ end
+ def simplelist(val, src_enc=true, dst_enc=true)
+ tk_split_simplelist(val, src_enc, dst_enc)
+ end
+ def window(val)
+ if val =~ /^\./
+ #Tk_WINDOWS[val]? Tk_WINDOWS[val] : _genobj_for_tkwidget(val)
+ TkCore::INTERP.tk_windows[val]?
+ TkCore::INTERP.tk_windows[val] : _genobj_for_tkwidget(val)
+ else
+ nil
+ end
+ end
+ def image_obj(val)
+ if val =~ /^i(_\d+_)?\d+$/
+ TkImage::Tk_IMGTBL.mutex.synchronize{
+ TkImage::Tk_IMGTBL[val]? TkImage::Tk_IMGTBL[val] : val
+ }
+ else
+ val
+ end
+ end
+ def procedure(val)
+=begin
+ if val =~ /^rb_out\S* (c(_\d+_)?\d+)/
+ #Tk_CMDTBL[$1]
+ #TkCore::INTERP.tk_cmd_tbl[$1]
+ TkCore::INTERP.tk_cmd_tbl[$1].cmd
+=end
+ if val =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+ return TkCore::INTERP.tk_cmd_tbl[$4].cmd
+ else
+ #nil
+ val
+ end
+ end
+ private :bool, :number, :num_or_str, :num_or_nil, :string
+ private :list, :simplelist, :window, :image_obj, :procedure
+ module_function :bool, :number, :num_or_str, :num_or_nil, :string
+ module_function :list, :simplelist, :window, :image_obj, :procedure
+
+ if (RUBY_VERSION.split('.').map{|n| n.to_i} <=> [1,8,7]) < 0
+ def slice_ary(ary, size)
+ sliced = []
+ wk_ary = ary.dup
+ until wk_ary.size.zero?
+ sub_ary = []
+ size.times{ sub_ary << wk_ary.shift }
+ yield(sub_ary) if block_given?
+ sliced << sub_ary
+ end
+ (block_given?)? ary: sliced
+ end
+ else
+ def slice_ary(ary, size, &b)
+ if b
+ ary.each_slice(size, &b)
+ else
+ ary.each_slice(size).to_a
+ end
+ end
+ end
+ private :slice_ary
+ module_function :slice_ary
+
+ def subst(str, *opts)
+ # opts := :nobackslashes | :nocommands | novariables
+ tk_call('subst',
+ *(opts.collect{|opt|
+ opt = opt.to_s
+ (opt[0] == ?-)? opt: '-' << opt
+ } << str))
+ end
+
+ def _toUTF8(str, encoding = nil)
+ TkCore::INTERP._toUTF8(str, encoding)
+ end
+ def _fromUTF8(str, encoding = nil)
+ TkCore::INTERP._fromUTF8(str, encoding)
+ end
+ private :_toUTF8, :_fromUTF8
+ module_function :_toUTF8, :_fromUTF8
+
+ def _callback_entry_class?(cls)
+ cls <= Proc || cls <= Method || cls <= TkCallbackEntry
+ end
+ private :_callback_entry_class?
+ module_function :_callback_entry_class?
+
+ def _callback_entry?(obj)
+ obj.kind_of?(Proc) || obj.kind_of?(Method) || obj.kind_of?(TkCallbackEntry)
+ end
+ private :_callback_entry?
+ module_function :_callback_entry?
+
+=begin
+ ### --> definition is moved to TkUtil module
+ def _get_eval_string(str, enc_mode = nil)
+ return nil if str == None
+ if str.kind_of?(TkObject)
+ str = str.path
+ elsif str.kind_of?(String)
+ str = _toUTF8(str) if enc_mode
+ elsif str.kind_of?(Symbol)
+ str = str.id2name
+ str = _toUTF8(str) if enc_mode
+ elsif str.kind_of?(Hash)
+ str = hash_kv(str, enc_mode).join(" ")
+ elsif str.kind_of?(Array)
+ str = array2tk_list(str)
+ str = _toUTF8(str) if enc_mode
+ elsif str.kind_of?(Proc)
+ str = install_cmd(str)
+ elsif str == nil
+ str = ""
+ elsif str == false
+ str = "0"
+ elsif str == true
+ str = "1"
+ elsif (str.respond_to?(:to_eval))
+ str = str.to_eval()
+ str = _toUTF8(str) if enc_mode
+ else
+ str = str.to_s() || ''
+ unless str.kind_of? String
+ fail RuntimeError, "fail to convert the object to a string"
+ end
+ str = _toUTF8(str) if enc_mode
+ end
+ return str
+ end
+=end
+=begin
+ def _get_eval_string(obj, enc_mode = nil)
+ case obj
+ when Numeric
+ obj.to_s
+ when String
+ (enc_mode)? _toUTF8(obj): obj
+ when Symbol
+ (enc_mode)? _toUTF8(obj.id2name): obj.id2name
+ when TkObject
+ obj.path
+ when Hash
+ hash_kv(obj, enc_mode).join(' ')
+ when Array
+ (enc_mode)? _toUTF8(array2tk_list(obj)): array2tk_list(obj)
+ when Proc, Method, TkCallbackEntry
+ install_cmd(obj)
+ when false
+ '0'
+ when true
+ '1'
+ when nil
+ ''
+ when None
+ nil
+ else
+ if (obj.respond_to?(:to_eval))
+ (enc_mode)? _toUTF8(obj.to_eval): obj.to_eval
+ else
+ begin
+ obj = obj.to_s || ''
+ rescue
+ fail RuntimeError, "fail to convert object '#{obj}' to string"
+ end
+ (enc_mode)? _toUTF8(obj): obj
+ end
+ end
+ end
+ private :_get_eval_string
+ module_function :_get_eval_string
+=end
+
+=begin
+ ### --> definition is moved to TkUtil module
+ def _get_eval_enc_str(obj)
+ return obj if obj == None
+ _get_eval_string(obj, true)
+ end
+ private :_get_eval_enc_str
+ module_function :_get_eval_enc_str
+=end
+
+=begin
+ ### --> obsolete
+ def ruby2tcl(v, enc_mode = nil)
+ if v.kind_of?(Hash)
+ v = hash_kv(v)
+ v.flatten!
+ v.collect{|e|ruby2tcl(e, enc_mode)}
+ else
+ _get_eval_string(v, enc_mode)
+ end
+ end
+ private :ruby2tcl
+=end
+
+=begin
+ ### --> definition is moved to TkUtil module
+ def _conv_args(args, enc_mode, *src_args)
+ conv_args = []
+ src_args.each{|arg|
+ conv_args << _get_eval_string(arg, enc_mode) unless arg == None
+ # if arg.kind_of?(Hash)
+ # arg.each{|k, v|
+ # args << '-' + k.to_s
+ # args << _get_eval_string(v, enc_mode)
+ # }
+ # elsif arg != None
+ # args << _get_eval_string(arg, enc_mode)
+ # end
+ }
+ args + conv_args
+ end
+ private :_conv_args
+=end
+
+ def _curr_cmd_id
+ #id = format("c%.4d", Tk_IDs[0])
+ id = "c" + TkCore::INTERP._ip_id_ + TkComm::Tk_IDs[0]
+ end
+ def _next_cmd_id
+ TkComm::Tk_IDs.mutex.synchronize{
+ id = _curr_cmd_id
+ #Tk_IDs[0] += 1
+ TkComm::Tk_IDs[0].succ!
+ id
+ }
+ end
+ private :_curr_cmd_id, :_next_cmd_id
+ module_function :_curr_cmd_id, :_next_cmd_id
+
+ def TkComm.install_cmd(cmd, local_cmdtbl=nil)
+ return '' if cmd == ''
+ begin
+ ns = TkCore::INTERP._invoke_without_enc('namespace', 'current')
+ ns = nil if ns == '::' # for backward compatibility
+ rescue
+ # probably, Tcl7.6
+ ns = nil
+ end
+ id = _next_cmd_id
+ #Tk_CMDTBL[id] = cmd
+ if cmd.kind_of?(TkCallbackEntry)
+ TkCore::INTERP.tk_cmd_tbl[id] = cmd
+ else
+ TkCore::INTERP.tk_cmd_tbl[id] = TkCore::INTERP.get_cb_entry(cmd)
+ end
+ @cmdtbl = [] unless defined? @cmdtbl
+ TkUtil.untrust(@cmdtbl) unless @cmdtbl.tainted?
+ @cmdtbl.push id
+
+ if local_cmdtbl && local_cmdtbl.kind_of?(Array)
+ begin
+ local_cmdtbl << id
+ rescue Exception
+ # ignore
+ end
+ end
+
+ #return Kernel.format("rb_out %s", id);
+ if ns
+ 'rb_out' << TkCore::INTERP._ip_id_ << ' ' << ns << ' ' << id
+ else
+ 'rb_out' << TkCore::INTERP._ip_id_ << ' ' << id
+ end
+ end
+ def TkComm.uninstall_cmd(id, local_cmdtbl=nil)
+ #id = $1 if /rb_out\S* (c(_\d+_)?\d+)/ =~ id
+ id = $4 if id =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+
+ if local_cmdtbl && local_cmdtbl.kind_of?(Array)
+ begin
+ local_cmdtbl.delete(id)
+ rescue Exception
+ # ignore
+ end
+ end
+ @cmdtbl.delete(id)
+
+ #Tk_CMDTBL.delete(id)
+ TkCore::INTERP.tk_cmd_tbl.delete(id)
+ end
+ # private :install_cmd, :uninstall_cmd
+ # module_function :install_cmd, :uninstall_cmd
+ def install_cmd(cmd)
+ TkComm.install_cmd(cmd, @cmdtbl)
+ end
+ def uninstall_cmd(id)
+ TkComm.uninstall_cmd(id, @cmdtbl)
+ end
+
+=begin
+ def install_win(ppath,name=nil)
+ if !name or name == ''
+ #name = format("w%.4d", Tk_IDs[1])
+ #Tk_IDs[1] += 1
+ name = "w" + Tk_IDs[1]
+ Tk_IDs[1].succ!
+ end
+ if name[0] == ?.
+ @path = name.dup
+ elsif !ppath or ppath == "."
+ @path = Kernel.format(".%s", name);
+ else
+ @path = Kernel.format("%s.%s", ppath, name)
+ end
+ #Tk_WINDOWS[@path] = self
+ TkCore::INTERP.tk_windows[@path] = self
+ end
+=end
+ def install_win(ppath,name=nil)
+ if name
+ if name == ''
+ raise ArgumentError, "invalid wiget-name '#{name}'"
+ end
+ if name[0] == ?.
+ @path = '' + name
+ @path.freeze
+ return TkCore::INTERP.tk_windows[@path] = self
+ end
+ else
+ Tk_IDs.mutex.synchronize{
+ name = "w" + TkCore::INTERP._ip_id_ + Tk_IDs[1]
+ Tk_IDs[1].succ!
+ }
+ end
+ if !ppath or ppath == '.'
+ @path = '.' + name
+ else
+ @path = ppath + '.' + name
+ end
+ @path.freeze
+ TkCore::INTERP.tk_windows[@path] = self
+ end
+
+ def uninstall_win()
+ #Tk_WINDOWS.delete(@path)
+ TkCore::INTERP.tk_windows.delete(@path)
+ end
+ private :install_win, :uninstall_win
+
+ def _epath(win)
+ if win.kind_of?(TkObject)
+ win.epath
+ elsif win.respond_to?(:epath)
+ win.epath
+ else
+ win
+ end
+ end
+ private :_epath
+end
+
+# define TkComm module (step 2: event binding)
+module TkComm
+ include TkEvent
+ extend TkEvent
+
+ def tk_event_sequence(context)
+ if context.kind_of? TkVirtualEvent
+ context = context.path
+ end
+ if context.kind_of? Array
+ context = context.collect{|ev|
+ if ev.kind_of? TkVirtualEvent
+ ev.path
+ else
+ ev
+ end
+ }.join("><")
+ end
+ if /,/ =~ context
+ context = context.split(/\s*,\s*/).join("><")
+ else
+ context
+ end
+ end
+
+ def _bind_core(mode, what, context, cmd, *args)
+ id = install_bind(cmd, *args) if cmd
+ begin
+ tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>",
+ mode + id]))
+ rescue
+ uninstall_cmd(id) if cmd
+ fail
+ end
+ end
+
+ def _bind(what, context, cmd, *args)
+ _bind_core('', what, context, cmd, *args)
+ end
+
+ def _bind_append(what, context, cmd, *args)
+ _bind_core('+', what, context, cmd, *args)
+ end
+
+ def _bind_remove(what, context)
+ tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", '']))
+ end
+
+ def _bindinfo(what, context=nil)
+ if context
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ enum_obj = tk_call_without_enc(*what+["<#{tk_event_sequence(context)}>"]).each_line
+ else
+ enum_obj = tk_call_without_enc(*what+["<#{tk_event_sequence(context)}>"])
+ end
+ enum_obj.collect {|cmdline|
+=begin
+ if cmdline =~ /^rb_out\S* (c(?:_\d+_)?\d+)\s+(.*)$/
+ #[Tk_CMDTBL[$1], $2]
+ [TkCore::INTERP.tk_cmd_tbl[$1], $2]
+=end
+ if cmdline =~ /rb_out\S*(?:\s+(::\S*|[{](::.*)[}]|["](::.*)["]))? (c(_\d+_)?(\d+))/
+ [TkCore::INTERP.tk_cmd_tbl[$4], $5]
+ else
+ cmdline
+ end
+ }
+ else
+ tk_split_simplelist(tk_call_without_enc(*what)).collect!{|seq|
+ l = seq.scan(/<*[^<>]+>*/).collect!{|subseq|
+ case (subseq)
+ when /^<<[^<>]+>>$/
+ TkVirtualEvent.getobj(subseq[1..-2])
+ when /^<[^<>]+>$/
+ subseq[1..-2]
+ else
+ subseq.split('')
+ end
+ }.flatten
+ (l.size == 1) ? l[0] : l
+ }
+ end
+ end
+
+ def _bind_core_for_event_class(klass, mode, what, context, cmd, *args)
+ id = install_bind_for_event_class(klass, cmd, *args) if cmd
+ begin
+ tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>",
+ mode + id]))
+ rescue
+ uninstall_cmd(id) if cmd
+ fail
+ end
+ end
+
+ def _bind_for_event_class(klass, what, context, cmd, *args)
+ _bind_core_for_event_class(klass, '', what, context, cmd, *args)
+ end
+
+ def _bind_append_for_event_class(klass, what, context, cmd, *args)
+ _bind_core_for_event_class(klass, '+', what, context, cmd, *args)
+ end
+
+ def _bind_remove_for_event_class(klass, what, context)
+ _bind_remove(what, context)
+ end
+
+ def _bindinfo_for_event_class(klass, what, context=nil)
+ _bindinfo(what, context)
+ end
+
+ private :tk_event_sequence
+ private :_bind_core, :_bind, :_bind_append, :_bind_remove, :_bindinfo
+ private :_bind_core_for_event_class, :_bind_for_event_class,
+ :_bind_append_for_event_class, :_bind_remove_for_event_class,
+ :_bindinfo_for_event_class
+
+ #def bind(tagOrClass, context, cmd=Proc.new, *args)
+ # _bind(["bind", tagOrClass], context, cmd, *args)
+ # tagOrClass
+ #end
+ def bind(tagOrClass, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind(["bind", tagOrClass], context, cmd, *args)
+ tagOrClass
+ end
+
+ #def bind_append(tagOrClass, context, cmd=Proc.new, *args)
+ # _bind_append(["bind", tagOrClass], context, cmd, *args)
+ # tagOrClass
+ #end
+ def bind_append(tagOrClass, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append(["bind", tagOrClass], context, cmd, *args)
+ tagOrClass
+ end
+
+ def bind_remove(tagOrClass, context)
+ _bind_remove(['bind', tagOrClass], context)
+ tagOrClass
+ end
+
+ def bindinfo(tagOrClass, context=nil)
+ _bindinfo(['bind', tagOrClass], context)
+ end
+
+ #def bind_all(context, cmd=Proc.new, *args)
+ # _bind(['bind', 'all'], context, cmd, *args)
+ # TkBindTag::ALL
+ #end
+ def bind_all(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind(['bind', 'all'], context, cmd, *args)
+ TkBindTag::ALL
+ end
+
+ #def bind_append_all(context, cmd=Proc.new, *args)
+ # _bind_append(['bind', 'all'], context, cmd, *args)
+ # TkBindTag::ALL
+ #end
+ def bind_append_all(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append(['bind', 'all'], context, cmd, *args)
+ TkBindTag::ALL
+ end
+
+ def bind_remove_all(context)
+ _bind_remove(['bind', 'all'], context)
+ TkBindTag::ALL
+ end
+
+ def bindinfo_all(context=nil)
+ _bindinfo(['bind', 'all'], context)
+ end
+end
+
+
+module TkCore
+ include TkComm
+ extend TkComm
+
+ WITH_RUBY_VM = Object.const_defined?(:RubyVM) && ::RubyVM.class == Class
+ WITH_ENCODING = defined?(::Encoding.default_external) && true
+ #WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
+
+ unless self.const_defined? :INTERP
+ if self.const_defined? :IP_NAME
+ name = IP_NAME.to_s
+ else
+ #name = nil
+ name = $0
+ end
+ if self.const_defined? :IP_OPTS
+ if IP_OPTS.kind_of?(Hash)
+ opts = hash_kv(IP_OPTS).join(' ')
+ else
+ opts = IP_OPTS.to_s
+ end
+ else
+ opts = ''
+ end
+
+ # RUN_EVENTLOOP_ON_MAIN_THREAD = true
+
+ unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
+ if WITH_RUBY_VM ### check Ruby 1.9 !!!!!!!
+ # *** NEED TO FIX ***
+ case RUBY_PLATFORM
+ when /cygwin/
+ RUN_EVENTLOOP_ON_MAIN_THREAD = true
+ when /darwin/ # MacOS X
+=begin
+ ip = TclTkIp.new(name, opts)
+ if ip._invoke_without_enc('tk', 'windowingsystem') == 'aqua' &&
+ (TclTkLib.get_version<=>[8,4,TclTkLib::RELEASE_TYPE::FINAL,6]) > 0
+=end
+ if TclTkLib::WINDOWING_SYSTEM == 'aqua' &&
+ (TclTkLib.get_version<=>[8,4,TclTkLib::RELEASE_TYPE::FINAL,6]) > 0
+ # *** KNOWN BUG ***
+ # Main event loop thread of TkAqua (> Tk8.4.9) must be the main
+ # application thread. So, ruby1.9 users must call Tk.mainloop on
+ # the main application thread.
+ #
+ # *** ADD (2009/05/10) ***
+ # In some cases (I don't know the description of conditions),
+ # TkAqua 8.4.7 has a same kind of hang-up trouble.
+ # So, if 8.4.7 or later, set RUN_EVENTLOOP_ON_MAIN_THREAD to true.
+ # When you want to control this mode, please call the following
+ # (set true/false as you want) before "require 'tk'".
+ # ----------------------------------------------------------
+ # module TkCore; RUN_EVENTLOOP_ON_MAIN_THREAD = true; end
+ # ----------------------------------------------------------
+ #
+ # *** ADD (2010/07/05) ***
+ # The value of TclTkLib::WINDOWING_SYSTEM is defined at compiling.
+ # If it is inconsistent with linked DLL, please call the following
+ # before "require 'tk'".
+ # ----------------------------------------------------------
+ # require 'tcltklib'
+ # module TclTkLib
+ # remove_const :WINDOWING_SYSTEM
+ # WINDOWING_SYSTEM = 'x11' # or 'aqua'
+ # end
+ # ----------------------------------------------------------
+ #
+ RUN_EVENTLOOP_ON_MAIN_THREAD = true
+ else
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+=begin
+ ip.delete
+ ip = nil
+=end
+ end
+ else
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+ end
+
+ else # Ruby 1.8.x
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+ end
+ end
+
+ if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ INTERP = TclTkIp.new(name, opts) unless self.const_defined? :INTERP
+ else
+ INTERP_MUTEX = Mutex.new
+ INTERP_ROOT_CHECK = ConditionVariable.new
+ INTERP_THREAD = Thread.new{
+ begin
+ #Thread.current[:interp] = interp = TclTkIp.new(name, opts)
+ interp = TclTkIp.new(name, opts)
+ rescue => e
+ Thread.current[:interp] = e
+ raise e
+ end
+
+ interp.mainloop_abort_on_exception = true
+ Thread.current.instance_variable_set("@interp", interp)
+
+ status = [nil]
+ def status.value
+ self[0]
+ end
+ def status.value=(val)
+ self[0] = val
+ end
+
+ Thread.current[:status] = status
+ #sleep
+
+ # like as 1.8, withdraw a root widget before calling Tk.mainloop
+ interp._eval <<EOS
+wm withdraw .
+rename wm __wm_orig__
+proc wm {subcmd win args} {
+ set val [eval [list __wm_orig__ $subcmd $win] $args]
+ if {[string equal $subcmd withdraw] && [string equal $win .]} {
+ rename wm {}
+ rename __wm_orig__ wm
+ }
+ return $val
+}
+proc __startup_rbtk_mainloop__ {args} {
+ rename __startup_rbtk_mainloop__ {}
+ if {[info command __wm_orig__] == "__wm_orig__"} {
+ rename wm {}
+ rename __wm_orig__ wm
+ if [string equal [wm state .] withdrawn] {
+ wm deiconify .
+ }
+ }
+}
+set __initial_state_of_rubytk__ 1
+trace add variable __initial_state_of_rubytk__ unset __startup_rbtk_mainloop__
+
+# complete initializing
+ruby {TkCore::INTERP_THREAD[:interp] = TkCore::INTERP_THREAD.instance_variable_get('@interp')}
+EOS
+
+ begin
+ begin
+ #TclTkLib.mainloop_abort_on_exception = false
+ #interp.mainloop_abort_on_exception = true
+ #Thread.current[:interp] = interp
+ #Thread.current[:status].value = TclTkLib.mainloop(true)
+ Thread.current[:status].value = interp.mainloop(true)
+ rescue SystemExit=>e
+ Thread.current[:status].value = e
+ rescue Exception=>e
+ Thread.current[:status].value = e
+ p e if $DEBUG
+ retry if interp.has_mainwindow?
+ ensure
+ INTERP_MUTEX.synchronize{ INTERP_ROOT_CHECK.broadcast }
+ end
+
+ unless interp.deleted?
+ #Thread.current[:status].value = TclTkLib.mainloop(false)
+ Thread.current[:status].value = interp.mainloop(false)
+ end
+
+ ensure
+ # interp must be deleted before the thread for interp is dead.
+ # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler
+ # deleted by the wrong thread.
+ interp.delete
+ end
+ }
+
+ # check a Tcl/Tk interpreter is initialized
+ until INTERP_THREAD[:interp]
+ # Thread.pass
+ INTERP_THREAD.run
+ end
+
+ # INTERP_THREAD.run
+ raise INTERP_THREAD[:interp] if INTERP_THREAD[:interp].kind_of? Exception
+
+ # check an eventloop is running
+ while INTERP_THREAD.alive? && TclTkLib.mainloop_thread?.nil?
+ INTERP_THREAD.run
+ end
+
+ INTERP = INTERP_THREAD[:interp]
+ INTERP_THREAD_STATUS = INTERP_THREAD[:status]
+
+ # delete the interpreter and kill the eventloop thread at exit
+ END{
+ if INTERP_THREAD.alive?
+ INTERP.delete
+ INTERP_THREAD.kill
+ end
+ }
+
+ # (for safety's sake) force the eventloop to run
+ INTERP_THREAD.run
+ end
+
+ def INTERP.__getip
+ self
+ end
+ def INTERP.default_master?
+ true
+ end
+
+ INTERP.instance_eval{
+ # @tk_cmd_tbl = TkUtil.untrust({})
+ @tk_cmd_tbl =
+ TkUtil.untrust(Hash.new{|hash, key|
+ fail IndexError, "unknown command ID '#{key}'"
+ })
+ def @tk_cmd_tbl.[]=(idx,val)
+ if self.has_key?(idx) && Thread.current.group != ThreadGroup::Default
+ fail SecurityError,"cannot change the entried command"
+ end
+ super(idx,val)
+ end
+
+ @tk_windows = TkUtil.untrust({})
+
+ @tk_table_list = TkUtil.untrust([])
+
+ @init_ip_env = TkUtil.untrust([]) # table of Procs
+ @add_tk_procs = TkUtil.untrust([]) # table of [name, args, body]
+
+ @force_default_encoding ||= TkUtil.untrust([false])
+ @encoding ||= TkUtil.untrust([nil])
+ def @encoding.to_s; self.join(nil); end
+
+ @cb_entry_class = Class.new(TkCallbackEntry){
+ class << self
+ def inspect
+ sprintf("#<Class(TkCallbackEntry):%0x>", self.__id__)
+ end
+ alias to_s inspect
+ end
+
+ def initialize(ip, cmd)
+ @ip = ip
+ @cmd = cmd
+ end
+ attr_reader :ip, :cmd
+ def call(*args)
+ @ip.cb_eval(@cmd, *args)
+ end
+ def inspect
+ sprintf("#<cb_entry:%0x>", self.__id__)
+ end
+ alias to_s inspect
+ }.freeze
+ }
+
+ def INTERP.cb_entry_class
+ @cb_entry_class
+ end
+ def INTERP.tk_cmd_tbl
+ @tk_cmd_tbl
+ end
+ def INTERP.tk_windows
+ @tk_windows
+ end
+
+ class Tk_OBJECT_TABLE
+ def initialize(id)
+ @id = id
+ @mutex = Mutex.new
+ end
+ def mutex
+ @mutex
+ end
+ def method_missing(m, *args, &b)
+ TkCore::INTERP.tk_object_table(@id).__send__(m, *args, &b)
+ end
+ end
+
+ def INTERP.tk_object_table(id)
+ @tk_table_list[id]
+ end
+ def INTERP.create_table
+ id = @tk_table_list.size
+ (tbl = {}).tainted? || TkUtil.untrust(tbl)
+ @tk_table_list << tbl
+# obj = Object.new
+# obj.instance_eval <<-EOD
+# def self.method_missing(m, *args)
+# TkCore::INTERP.tk_object_table(#{id}).send(m, *args)
+# end
+# EOD
+# return obj
+ Tk_OBJECT_TABLE.new(id)
+ end
+
+ def INTERP.get_cb_entry(cmd)
+ @cb_entry_class.new(__getip, cmd).freeze
+ end
+ def INTERP.cb_eval(cmd, *args)
+ TkUtil._get_eval_string(TkUtil.eval_cmd(cmd, *args))
+ end
+
+ def INTERP.init_ip_env(script = Proc.new)
+ @init_ip_env << script
+ script.call(self)
+ end
+ def INTERP.add_tk_procs(name, args = nil, body = nil)
+ if name.kind_of?(Array)
+ name.each{|param| self.add_tk_procs(*param)}
+ else
+ name = name.to_s
+ @add_tk_procs << [name, args, body]
+ self._invoke('proc', name, args, body) if args && body
+ end
+ end
+ def INTERP.remove_tk_procs(*names)
+ names.each{|name|
+ name = name.to_s
+ @add_tk_procs.delete_if{|elem|
+ elem.kind_of?(Array) && elem[0].to_s == name
+ }
+ #self._invoke('rename', name, '')
+ self.__invoke__('rename', name, '')
+ }
+ end
+ def INTERP.init_ip_internal
+ ip = self
+ @init_ip_env.each{|script| script.call(ip)}
+ @add_tk_procs.each{|name,args,body| ip._invoke('proc',name,args,body)}
+ end
+ end
+
+ unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
+ ### Ruby 1.9 !!!!!!!!!!!!!!!!!!!!!!!!!!
+ RUN_EVENTLOOP_ON_MAIN_THREAD = false
+ end
+
+ WIDGET_DESTROY_HOOK = '<WIDGET_DESTROY_HOOK>'
+ INTERP._invoke_without_enc('event', 'add',
+ "<#{WIDGET_DESTROY_HOOK}>", '<Destroy>')
+ INTERP._invoke_without_enc('bind', 'all', "<#{WIDGET_DESTROY_HOOK}>",
+ install_cmd(proc{|path|
+ unless TkCore::INTERP.deleted?
+ begin
+ if (widget=TkCore::INTERP.tk_windows[path])
+ if widget.respond_to?(:__destroy_hook__)
+ widget.__destroy_hook__
+ end
+ end
+ rescue Exception=>e
+ p e if $DEBUG
+ end
+ end
+ }) << ' %W')
+
+ INTERP.add_tk_procs(TclTkLib::FINALIZE_PROC_NAME, '',
+ "catch { bind all <#{WIDGET_DESTROY_HOOK}> {} }")
+
+ INTERP.add_tk_procs('rb_out', 'ns args', <<-'EOL')
+ if [regexp {^::} $ns] {
+ set cmd {namespace eval $ns {ruby_cmd TkCore callback} $args}
+ } else {
+ set cmd {eval {ruby_cmd TkCore callback} $ns $args}
+ }
+ if {[set st [catch $cmd ret]] != 0} {
+ #return -code $st $ret
+ set idx [string first "\n\n" $ret]
+ if {$idx > 0} {
+ return -code $st \
+ -errorinfo [string range $ret [expr $idx + 2] \
+ [string length $ret]] \
+ [string range $ret 0 [expr $idx - 1]]
+ } else {
+ return -code $st $ret
+ }
+ } else {
+ return $ret
+ }
+ EOL
+=begin
+ INTERP.add_tk_procs('rb_out', 'args', <<-'EOL')
+ if {[set st [catch {eval {ruby_cmd TkCore callback} $args} ret]] != 0} {
+ #return -code $st $ret
+ set idx [string first "\n\n" $ret]
+ if {$idx > 0} {
+ return -code $st \
+ -errorinfo [string range $ret [expr $idx + 2] \
+ [string length $ret]] \
+ [string range $ret 0 [expr $idx - 1]]
+ } else {
+ return -code $st $ret
+ }
+ } else {
+ return $ret
+ }
+ EOL
+=end
+=begin
+ INTERP.add_tk_procs('rb_out', 'args', <<-'EOL')
+ #regsub -all {\\} $args {\\\\} args
+ #regsub -all {!} $args {\\!} args
+ #regsub -all "{" $args "\\{" args
+ regsub -all {(\\|!|\{|\})} $args {\\\1} args
+ if {[set st [catch {ruby [format "TkCore.callback %%Q!%s!" $args]} ret]] != 0} {
+ #return -code $st $ret
+ set idx [string first "\n\n" $ret]
+ if {$idx > 0} {
+ return -code $st \
+ -errorinfo [string range $ret [expr $idx + 2] \
+ [string length $ret]] \
+ [string range $ret 0 [expr $idx - 1]]
+ } else {
+ return -code $st $ret
+ }
+ } else {
+ return $ret
+ }
+ EOL
+=end
+
+ at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
+
+ EventFlag = TclTkLib::EventFlag
+
+ def callback_break
+ fail TkCallbackBreak, "Tk callback returns 'break' status"
+ end
+
+ def callback_continue
+ fail TkCallbackContinue, "Tk callback returns 'continue' status"
+ end
+
+ def callback_return
+ fail TkCallbackReturn, "Tk callback returns 'return' status"
+ end
+
+ def TkCore.callback(*arg)
+ begin
+ if TkCore::INTERP.tk_cmd_tbl.kind_of?(Hash)
+ #TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
+ normal_ret = false
+ ret = catch(:IRB_EXIT) do # IRB hack
+ retval = TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
+ normal_ret = true
+ retval
+ end
+ unless normal_ret
+ # catch IRB_EXIT
+ exit(ret)
+ end
+ ret
+ end
+ rescue SystemExit=>e
+ exit(e.status)
+ rescue Interrupt=>e
+ fail(e)
+ rescue Exception => e
+ begin
+ msg = _toUTF8(e.class.inspect) + ': ' +
+ _toUTF8(e.message) + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ _toUTF8(e.backtrace.join("\n")) +
+ "\n---< backtrace of Tk side >-------"
+ if TkCore::WITH_ENCODING
+ msg.force_encoding('utf-8')
+ else
+ msg.instance_variable_set(:@encoding, 'utf-8')
+ end
+ rescue Exception
+ msg = e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------"
+ end
+ # TkCore::INTERP._set_global_var('errorInfo', msg)
+ # fail(e)
+ fail(e, msg)
+ end
+ end
+=begin
+ def TkCore.callback(arg_str)
+ # arg = tk_split_list(arg_str)
+ arg = tk_split_simplelist(arg_str)
+ #_get_eval_string(TkUtil.eval_cmd(Tk_CMDTBL[arg.shift], *arg))
+ #_get_eval_string(TkUtil.eval_cmd(TkCore::INTERP.tk_cmd_tbl[arg.shift],
+ # *arg))
+ # TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
+ begin
+ TkCore::INTERP.tk_cmd_tbl[arg.shift].call(*arg)
+ rescue Exception => e
+ raise(e, e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------")
+ end
+#=begin
+# cb_obj = TkCore::INTERP.tk_cmd_tbl[arg.shift]
+# unless $DEBUG
+# cb_obj.call(*arg)
+# else
+# begin
+# raise 'check backtrace'
+# rescue
+# # ignore backtrace before 'callback'
+# pos = -($!.backtrace.size)
+# end
+# begin
+# cb_obj.call(*arg)
+# rescue
+# trace = $!.backtrace
+# raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
+# "\tfrom #{trace[1..pos].join("\n\tfrom ")}"
+# end
+# end
+#=end
+ end
+=end
+
+ def load_cmd_on_ip(tk_cmd)
+ bool(tk_call('auto_load', tk_cmd))
+ end
+
+ def after(ms, cmd=Proc.new)
+ cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(cmdid); ret})
+ after_id = tk_call_without_enc("after",ms,cmdid)
+ after_id.instance_variable_set('@cmdid', cmdid)
+ after_id
+ end
+=begin
+ def after(ms, cmd=Proc.new)
+ crit_bup = Thread.critical
+ Thread.critical = true
+
+ myid = _curr_cmd_id
+ cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(myid); ret})
+
+ Thread.critical = crit_bup
+
+ tk_call_without_enc("after",ms,cmdid) # return id
+# return
+# if false #defined? Thread
+# Thread.start do
+# ms = Float(ms)/1000
+# ms = 10 if ms == 0
+# sleep ms/1000
+# cmd.call
+# end
+# else
+# cmdid = install_cmd(cmd)
+# tk_call("after",ms,cmdid)
+# end
+ end
+=end
+
+ def after_idle(cmd=Proc.new)
+ cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(cmdid); ret})
+ after_id = tk_call_without_enc('after','idle',cmdid)
+ after_id.instance_variable_set('@cmdid', cmdid)
+ after_id
+ end
+=begin
+ def after_idle(cmd=Proc.new)
+ crit_bup = Thread.critical
+ Thread.critical = true
+
+ myid = _curr_cmd_id
+ cmdid = install_cmd(proc{ret = cmd.call;uninstall_cmd(myid); ret})
+
+ Thread.critical = crit_bup
+
+ tk_call_without_enc('after','idle',cmdid)
+ end
+=end
+
+ def after_cancel(afterId)
+ tk_call_without_enc('after','cancel',afterId)
+ if (cmdid = afterId.instance_variable_get('@cmdid'))
+ afterId.instance_variable_set('@cmdid', nil)
+ uninstall_cmd(cmdid)
+ end
+ afterId
+ end
+
+ def windowingsystem
+ tk_call_without_enc('tk', 'windowingsystem')
+ end
+
+ def scaling(scale=nil)
+ if scale
+ tk_call_without_enc('tk', 'scaling', scale)
+ else
+ Float(number(tk_call_without_enc('tk', 'scaling')))
+ end
+ end
+ def scaling_displayof(win, scale=nil)
+ if scale
+ tk_call_without_enc('tk', 'scaling', '-displayof', win, scale)
+ else
+ Float(number(tk_call_without_enc('tk', '-displayof', win, 'scaling')))
+ end
+ end
+
+ def inactive
+ Integer(tk_call_without_enc('tk', 'inactive'))
+ end
+ def inactive_displayof(win)
+ Integer(tk_call_without_enc('tk', 'inactive', '-displayof', win))
+ end
+ def reset_inactive
+ tk_call_without_enc('tk', 'inactive', 'reset')
+ end
+ def reset_inactive_displayof(win)
+ tk_call_without_enc('tk', 'inactive', '-displayof', win, 'reset')
+ end
+
+ def appname(name=None)
+ tk_call('tk', 'appname', name)
+ end
+
+ def appsend_deny
+ tk_call('rename', 'send', '')
+ 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?}
+ fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
+ end
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ if async
+ tk_call('send', '-async', '--', interp, *args)
+ else
+ tk_call('send', '--', interp, *args)
+ end
+ 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?}
+ fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
+ end
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ #args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"]/, '\\\\\&')}
+ args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"\\]/, '\\\\\&')}
+ # args.push(').to_s"')
+ # appsend(interp, async, 'ruby "(', *args)
+ args.push('}.call)"')
+ appsend(interp, async, 'ruby "TkComm._get_eval_string(proc{', *args)
+ 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?}
+ fail SecurityError, "cannot send tainted Tk commands at level #{$SAFE}"
+ end
+ win = '.' if win == nil
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ if async
+ tk_call('send', '-async', '-displayof', win, '--', interp, *args)
+ else
+ tk_call('send', '-displayor', win, '--', interp, *args)
+ end
+ 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?}
+ fail SecurityError, "cannot send tainted Ruby commands at level #{$SAFE}"
+ end
+ win = '.' if win == nil
+ if async != true && async != false && async != nil
+ args.unshift(async)
+ async = false
+ end
+ #args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"]/, '\\\\\&')}
+ args = args.collect!{|c| _get_eval_string(c).gsub(/[\[\]$"\\]/, '\\\\\&')}
+ # args.push(').to_s"')
+ # appsend_displayof(interp, win, async, 'ruby "(', *args)
+ args.push('}.call)"')
+ appsend(interp, win, async, 'ruby "TkComm._get_eval_string(proc{', *args)
+ end
+
+ def info(*args)
+ tk_call('info', *args)
+ end
+
+ def mainloop(check_root = true)
+ if !TkCore::WITH_RUBY_VM
+ TclTkLib.mainloop(check_root)
+
+ elsif TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD
+ # if TclTkLib::WINDOWING_SYSTEM == 'aqua' &&
+ #if TkCore::INTERP._invoke_without_enc('tk','windowingsystem')=='aqua' &&
+ # Thread.current != Thread.main &&
+ # (TclTkLib.get_version <=> [8,4,TclTkLib::RELEASE_TYPE::FINAL,9]) > 0
+ # raise RuntimeError,
+ # "eventloop on TkAqua ( > Tk8.4.9 ) works on the main thread only"
+ #end
+ if Thread.current != Thread.main
+ raise RuntimeError, "Tk.mainloop is allowed on the main thread only"
+ end
+ TclTkLib.mainloop(check_root)
+
+ else ### Ruby 1.9 !!!!!
+ unless TkCore::INTERP.default_master?
+ # [MultiTkIp] slave interp ?
+ return TkCore::INTERP._thread_tkwait('window', '.') if check_root
+ end
+
+ # like as 1.8, withdraw a root widget before calling Tk.mainloop
+ TkCore::INTERP._eval_without_enc('catch {unset __initial_state_of_rubytk__}')
+ INTERP_THREAD.run
+
+ begin
+ TclTkLib.set_eventloop_window_mode(true)
+
+ # force run the eventloop
+ TkCore::INTERP._eval_without_enc('update')
+ TkCore::INTERP._eval_without_enc('catch {set __initial_state_of_rubytk__}')
+ INTERP_THREAD.run
+ if check_root
+ INTERP_MUTEX.synchronize{
+ 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
+ raise status if status.kind_of?(Exception)
+ end
+ }
+ else
+ # INTERP_THREAD.value
+ begin
+ INTERP_THREAD.value
+ rescue Exception => e
+ raise e
+ end
+ end
+ rescue Exception => e
+ raise e
+ ensure
+ TclTkLib.set_eventloop_window_mode(false)
+ end
+ end
+ end
+
+ def mainloop_thread?
+ # true : current thread is mainloop
+ # nil : there is no mainloop
+ # false : mainloop is running on the other thread
+ # ( At then, it is dangerous to call Tk interpreter directly. )
+ if !TkCore::WITH_RUBY_VM || TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD
+ ### Ruby 1.9 !!!!!!!!!!!
+ TclTkLib.mainloop_thread?
+ else
+ Thread.current == INTERP_THREAD
+ end
+ end
+
+ def mainloop_exist?
+ TclTkLib.mainloop_thread? != nil
+ end
+
+ def is_mainloop?
+ TclTkLib.mainloop_thread? == true
+ end
+
+ def mainloop_watchdog(check_root = true)
+ # watchdog restarts mainloop when mainloop is dead
+ TclTkLib.mainloop_watchdog(check_root)
+ end
+
+ def do_one_event(flag = TclTkLib::EventFlag::ALL)
+ TclTkLib.do_one_event(flag)
+ end
+
+ def set_eventloop_tick(timer_tick)
+ TclTkLib.set_eventloop_tick(timer_tick)
+ end
+
+ def get_eventloop_tick()
+ TclTkLib.get_eventloop_tick
+ end
+
+ def set_no_event_wait(wait)
+ TclTkLib.set_no_even_wait(wait)
+ end
+
+ def get_no_event_wait()
+ TclTkLib.get_no_eventloop_wait
+ end
+
+ def set_eventloop_weight(loop_max, no_event_tick)
+ TclTkLib.set_eventloop_weight(loop_max, no_event_tick)
+ end
+
+ def get_eventloop_weight()
+ TclTkLib.get_eventloop_weight
+ end
+
+ def restart(app_name = nil, keys = {})
+ TkCore::INTERP.init_ip_internal
+
+ tk_call('set', 'argv0', app_name) if app_name
+ if keys.kind_of?(Hash)
+ # tk_call('set', 'argc', keys.size * 2)
+ tk_call('set', 'argv', hash_kv(keys).join(' '))
+ end
+
+ INTERP.restart
+ nil
+ end
+
+ def event_generate(win, context, keys=nil)
+ #win = win.path if win.kind_of?(TkObject)
+ if context.kind_of?(TkEvent::Event)
+ context.generate(win, ((keys)? keys: {}))
+ elsif keys
+ tk_call_without_enc('event', 'generate', win,
+ "<#{tk_event_sequence(context)}>",
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc('event', 'generate', win,
+ "<#{tk_event_sequence(context)}>")
+ end
+ nil
+ end
+
+ def messageBox(keys)
+ tk_call('tk_messageBox', *hash_kv(keys))
+ end
+
+ def getOpenFile(keys = nil)
+ tk_call('tk_getOpenFile', *hash_kv(keys))
+ end
+ def getMultipleOpenFile(keys = nil)
+ simplelist(tk_call('tk_getOpenFile', '-multiple', '1', *hash_kv(keys)))
+ end
+
+ def getSaveFile(keys = nil)
+ tk_call('tk_getSaveFile', *hash_kv(keys))
+ end
+ def getMultipleSaveFile(keys = nil)
+ simplelist(tk_call('tk_getSaveFile', '-multiple', '1', *hash_kv(keys)))
+ end
+
+ def chooseColor(keys = nil)
+ tk_call('tk_chooseColor', *hash_kv(keys))
+ end
+
+ def chooseDirectory(keys = nil)
+ tk_call('tk_chooseDirectory', *hash_kv(keys))
+ end
+
+ def _ip_eval_core(enc_mode, cmd_string)
+ case enc_mode
+ when nil
+ res = INTERP._eval(cmd_string)
+ when false
+ res = INTERP._eval_without_enc(cmd_string)
+ when true
+ res = INTERP._eval_with_enc(cmd_string)
+ end
+ if INTERP._return_value() != 0
+ fail RuntimeError, res, error_at
+ end
+ return res
+ end
+ private :_ip_eval_core
+
+ def ip_eval(cmd_string)
+ _ip_eval_core(nil, cmd_string)
+ end
+
+ def ip_eval_without_enc(cmd_string)
+ _ip_eval_core(false, cmd_string)
+ end
+
+ def ip_eval_with_enc(cmd_string)
+ _ip_eval_core(true, cmd_string)
+ end
+
+ def _ip_invoke_core(enc_mode, *args)
+ case enc_mode
+ when false
+ res = INTERP._invoke_without_enc(*args)
+ when nil
+ res = INTERP._invoke(*args)
+ when true
+ res = INTERP._invoke_with_enc(*args)
+ end
+ if INTERP._return_value() != 0
+ fail RuntimeError, res, error_at
+ end
+ return res
+ end
+ private :_ip_invoke_core
+
+ def ip_invoke(*args)
+ _ip_invoke_core(nil, *args)
+ end
+
+ def ip_invoke_without_enc(*args)
+ _ip_invoke_core(false, *args)
+ end
+
+ def ip_invoke_with_enc(*args)
+ _ip_invoke_core(true, *args)
+ end
+
+ def _tk_call_core(enc_mode, *args)
+ ### puts args.inspect if $DEBUG
+ #args.collect! {|x|ruby2tcl(x, enc_mode)}
+ #args.compact!
+ #args.flatten!
+ args = _conv_args([], enc_mode, *args)
+ puts 'invoke args => ' + args.inspect if $DEBUG
+ ### print "=> ", args.join(" ").inspect, "\n" if $DEBUG
+ begin
+ # res = TkUtil.untrust(INTERP._invoke(*args))
+ # res = INTERP._invoke(enc_mode, *args)
+ res = _ip_invoke_core(enc_mode, *args)
+ # >>>>> _invoke returns a TAINTED string <<<<<
+ rescue NameError => err
+ # err = $!
+ begin
+ args.unshift "unknown"
+ #res = TkUtil.untrust(INTERP._invoke(*args))
+ #res = INTERP._invoke(enc_mode, *args)
+ res = _ip_invoke_core(enc_mode, *args)
+ # >>>>> _invoke returns a TAINTED string <<<<<
+ rescue StandardError => err2
+ fail err2 unless /^invalid command/ =~ err2.message
+ fail err
+ end
+ end
+ if INTERP._return_value() != 0
+ fail RuntimeError, res, error_at
+ end
+ ### print "==> ", res.inspect, "\n" if $DEBUG
+ return res
+ end
+ private :_tk_call_core
+
+ def tk_call(*args)
+ _tk_call_core(nil, *args)
+ end
+
+ def tk_call_without_enc(*args)
+ _tk_call_core(false, *args)
+ end
+
+ def tk_call_with_enc(*args)
+ _tk_call_core(true, *args)
+ end
+
+ def _tk_call_to_list_core(depth, arg_enc, val_enc, *args)
+ args = _conv_args([], arg_enc, *args)
+ val = _tk_call_core(false, *args)
+ if !depth.kind_of?(Integer) || depth == 0
+ tk_split_simplelist(val, false, val_enc)
+ else
+ tk_split_list(val, depth, false, val_enc)
+ end
+ end
+ #private :_tk_call_to_list_core
+
+ def tk_call_to_list(*args)
+ _tk_call_to_list_core(-1, nil, true, *args)
+ end
+
+ def tk_call_to_list_without_enc(*args)
+ _tk_call_to_list_core(-1, false, false, *args)
+ end
+
+ def tk_call_to_list_with_enc(*args)
+ _tk_call_to_list_core(-1, true, true, *args)
+ end
+
+ def tk_call_to_simplelist(*args)
+ _tk_call_to_list_core(0, nil, true, *args)
+ end
+
+ def tk_call_to_simplelist_without_enc(*args)
+ _tk_call_to_list_core(0, false, false, *args)
+ end
+
+ def tk_call_to_simplelist_with_enc(*args)
+ _tk_call_to_list_core(0, true, true, *args)
+ end
+end
+
+
+module Tk
+ include TkCore
+ extend Tk
+
+ TCL_VERSION = INTERP._invoke_without_enc("info", "tclversion").freeze
+ TCL_PATCHLEVEL = INTERP._invoke_without_enc("info", "patchlevel").freeze
+
+ major, minor = TCL_VERSION.split('.')
+ TCL_MAJOR_VERSION = major.to_i
+ TCL_MINOR_VERSION = minor.to_i
+
+ TK_VERSION = INTERP._invoke_without_enc("set", "tk_version").freeze
+ TK_PATCHLEVEL = INTERP._invoke_without_enc("set", "tk_patchLevel").freeze
+
+ major, minor = TK_VERSION.split('.')
+ TK_MAJOR_VERSION = major.to_i
+ TK_MINOR_VERSION = minor.to_i
+
+ JAPANIZED_TK = (INTERP._invoke_without_enc("info", "commands",
+ "kanji") != "").freeze
+
+ def Tk.const_missing(sym)
+ case(sym)
+ when :TCL_LIBRARY
+ INTERP._invoke_without_enc('global', 'tcl_library')
+ INTERP._invoke("set", "tcl_library").freeze
+
+ when :TK_LIBRARY
+ INTERP._invoke_without_enc('global', 'tk_library')
+ INTERP._invoke("set", "tk_library").freeze
+
+ when :LIBRARY
+ INTERP._invoke("info", "library").freeze
+
+ #when :PKG_PATH, :PACKAGE_PATH, :TCL_PACKAGE_PATH
+ # INTERP._invoke_without_enc('global', 'tcl_pkgPath')
+ # tk_split_simplelist(INTERP._invoke('set', 'tcl_pkgPath'))
+
+ #when :LIB_PATH, :LIBRARY_PATH, :TCL_LIBRARY_PATH
+ # INTERP._invoke_without_enc('global', 'tcl_libPath')
+ # 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'))]
+
+ when :ENV
+ INTERP._invoke_without_enc('global', 'env')
+ Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', 'env'))]
+
+ #when :AUTO_PATH #<===
+ # tk_split_simplelist(INTERP._invoke('set', 'auto_path'))
+
+ #when :AUTO_OLDPATH
+ # tk_split_simplelist(INTERP._invoke('set', 'auto_oldpath'))
+
+ when :AUTO_INDEX
+ INTERP._invoke_without_enc('global', 'auto_index')
+ Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', 'auto_index'))]
+
+ when :PRIV, :PRIVATE, :TK_PRIV
+ priv = {}
+ if INTERP._invoke_without_enc('info', 'vars', 'tk::Priv') != ""
+ var_nam = 'tk::Priv'
+ else
+ var_nam = 'tkPriv'
+ end
+ INTERP._invoke_without_enc('global', var_nam)
+ Hash[*tk_split_simplelist(INTERP._invoke('array', 'get',
+ var_nam))].each{|k,v|
+ k.freeze
+ case v
+ when /^-?\d+$/
+ priv[k] = v.to_i
+ when /^-?\d+\.?\d*(e[-+]?\d+)?$/
+ priv[k] = v.to_f
+ else
+ priv[k] = v.freeze
+ end
+ }
+ priv
+
+ else
+ raise NameError, 'uninitialized constant Tk::' + sym.id2name
+ end
+ end
+
+ def Tk.errorInfo
+ INTERP._invoke_without_enc('global', 'errorInfo')
+ INTERP._invoke_without_enc('set', 'errorInfo')
+ end
+
+ def Tk.errorCode
+ INTERP._invoke_without_enc('global', 'errorCode')
+ code = tk_split_simplelist(INTERP._invoke_without_enc('set', 'errorCode'))
+ case code[0]
+ when 'CHILDKILLED', 'CHILDSTATUS', 'CHILDSUSP'
+ begin
+ pid = Integer(code[1])
+ code[1] = pid
+ rescue
+ end
+ end
+ code
+ end
+
+ def Tk.has_mainwindow?
+ INTERP.has_mainwindow?
+ end
+
+ def root
+ Tk::Root.new
+ end
+
+ def Tk.load_tclscript(file, enc=nil)
+ if enc
+ # TCL_VERSION >= 8.5
+ tk_call('source', '-encoding', enc, file)
+ else
+ tk_call('source', file)
+ end
+ end
+
+ def Tk.load_tcllibrary(file, pkg_name=None, interp=None)
+ tk_call('load', file, pkg_name, interp)
+ end
+
+ def Tk.unload_tcllibrary(*args)
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ nocomp = (keys['nocomplain'])? '-nocomplain': None
+ keeplib = (keys['keeplibrary'])? '-keeplibrary': None
+ tk_call('unload', nocomp, keeplib, '--', *args)
+ else
+ tk_call('unload', *args)
+ end
+ end
+
+ def Tk.pkgconfig_list(mod)
+ # Tk8.5 feature
+ if mod.kind_of?(Module)
+ if mod.respond_to?(:package_name)
+ pkgname = mod.package_name
+ elsif mod.const_defined?(:PACKAGE_NAME)
+ pkgname = mod::PACKAGE_NAME
+ else
+ fail NotImplementedError, 'may not be a module for a Tcl extension'
+ end
+ else
+ pkgname = mod.to_s
+ end
+
+ pkgname = '::' << pkgname unless pkgname =~ /^::/
+
+ tk_split_list(tk_call(pkgname + '::pkgconfig', 'list'))
+ end
+
+ def Tk.pkgconfig_get(mod, key)
+ # Tk8.5 feature
+ if mod.kind_of?(Module)
+ if mod.respond_to?(:package_name)
+ pkgname = mod.package_name
+ else
+ fail NotImplementedError, 'may not be a module for a Tcl extension'
+ end
+ else
+ pkgname = mod.to_s
+ end
+
+ pkgname = '::' << pkgname unless pkgname =~ /^::/
+
+ tk_call(pkgname + '::pkgconfig', 'get', key)
+ end
+
+ def Tk.tcl_pkgconfig_list
+ # Tk8.5 feature
+ Tk.pkgconfig_list('::tcl')
+ end
+
+ def Tk.tcl_pkgconfig_get(key)
+ # Tk8.5 feature
+ Tk.pkgconfig_get('::tcl', key)
+ end
+
+ def Tk.tk_pkgconfig_list
+ # Tk8.5 feature
+ Tk.pkgconfig_list('::tk')
+ end
+
+ def Tk.tk_pkgconfig_get(key)
+ # Tk8.5 feature
+ Tk.pkgconfig_get('::tk', key)
+ end
+
+ def Tk.bell(nice = false)
+ if nice
+ tk_call_without_enc('bell', '-nice')
+ else
+ tk_call_without_enc('bell')
+ end
+ nil
+ end
+
+ def Tk.bell_on_display(win, nice = false)
+ if nice
+ tk_call_without_enc('bell', '-displayof', win, '-nice')
+ else
+ tk_call_without_enc('bell', '-displayof', win)
+ end
+ nil
+ end
+
+ def Tk.destroy(*wins)
+ #tk_call_without_enc('destroy', *wins)
+ tk_call_without_enc('destroy', *(wins.collect{|win|
+ if win.kind_of?(TkWindow)
+ win.epath
+ else
+ win
+ end
+ }))
+ end
+
+ def Tk.exit
+ TkCore::INTERP.has_mainwindow? && tk_call_without_enc('destroy', '.')
+ end
+
+ ################################################
+
+ def Tk.sleep(ms = nil, id = nil)
+ if id
+ var = (id.kind_of?(TkVariable))? id: TkVarAccess.new(id.to_s)
+ else
+ var = TkVariable.new
+ end
+
+ var.value = tk_call_without_enc('after', ms, proc{ var.value = 0 }) if ms
+ var.thread_wait
+ ms
+ end
+
+ def Tk.wakeup(id)
+ ((id.kind_of?(TkVariable))? id: TkVarAccess.new(id.to_s)).value = 0
+ nil
+ end
+
+ ################################################
+
+ def Tk.pack(*args)
+ TkPack.configure(*args)
+ end
+ def Tk.pack_forget(*args)
+ TkPack.forget(*args)
+ end
+ def Tk.unpack(*args)
+ TkPack.forget(*args)
+ end
+
+ def Tk.grid(*args)
+ TkGrid.configure(*args)
+ end
+ def Tk.grid_forget(*args)
+ TkGrid.forget(*args)
+ end
+ def Tk.ungrid(*args)
+ TkGrid.forget(*args)
+ end
+
+ def Tk.place(*args)
+ TkPlace.configure(*args)
+ end
+ def Tk.place_forget(*args)
+ TkPlace.forget(*args)
+ end
+ def Tk.unplace(*args)
+ TkPlace.forget(*args)
+ end
+
+ def Tk.update(idle=nil)
+ if idle
+ tk_call_without_enc('update', 'idletasks')
+ else
+ tk_call_without_enc('update')
+ end
+ end
+ def Tk.update_idletasks
+ update(true)
+ end
+ def update(idle=nil)
+ # only for backward compatibility (This never be recommended to use)
+ Tk.update(idle)
+ self
+ end
+
+ # NOTE::
+ # If no eventloop-thread is running, "thread_update" method is same
+ # to "update" method. Else, "thread_update" method waits to complete
+ # idletask operation on the eventloop-thread.
+ def Tk.thread_update(idle=nil)
+ if idle
+ tk_call_without_enc('thread_update', 'idletasks')
+ else
+ tk_call_without_enc('thread_update')
+ end
+ end
+ def Tk.thread_update_idletasks
+ thread_update(true)
+ end
+
+ def Tk.lower_window(win, below=None)
+ tk_call('lower', _epath(win), _epath(below))
+ nil
+ end
+ def Tk.raise_window(win, above=None)
+ tk_call('raise', _epath(win), _epath(above))
+ nil
+ end
+
+ def Tk.current_grabs(win = nil)
+ if win
+ window(tk_call_without_enc('grab', 'current', win))
+ else
+ tk_split_list(tk_call_without_enc('grab', 'current'))
+ end
+ end
+
+ def Tk.focus(display=nil)
+ if display == nil
+ window(tk_call_without_enc('focus'))
+ else
+ window(tk_call_without_enc('focus', '-displayof', display))
+ end
+ end
+
+ def Tk.focus_to(win, force=false)
+ if force
+ tk_call_without_enc('focus', '-force', win)
+ else
+ tk_call_without_enc('focus', win)
+ end
+ end
+
+ def Tk.focus_lastfor(win)
+ window(tk_call_without_enc('focus', '-lastfor', win))
+ end
+
+ def Tk.focus_next(win)
+ TkManageFocus.next(win)
+ end
+
+ def Tk.focus_prev(win)
+ TkManageFocus.prev(win)
+ end
+
+ def Tk.strictMotif(mode=None)
+ bool(tk_call_without_enc('set', 'tk_strictMotif', mode))
+ end
+
+ def Tk.show_kinsoku(mode='both')
+ begin
+ if /^8\.*/ === TK_VERSION && JAPANIZED_TK
+ tk_split_simplelist(tk_call('kinsoku', 'show', mode))
+ end
+ rescue
+ end
+ end
+ def Tk.add_kinsoku(chars, mode='both')
+ begin
+ if /^8\.*/ === TK_VERSION && JAPANIZED_TK
+ tk_split_simplelist(tk_call('kinsoku', 'add', mode,
+ *(chars.split(''))))
+ else
+ []
+ end
+ rescue
+ []
+ end
+ end
+ def Tk.delete_kinsoku(chars, mode='both')
+ begin
+ if /^8\.*/ === TK_VERSION && JAPANIZED_TK
+ tk_split_simplelist(tk_call('kinsoku', 'delete', mode,
+ *(chars.split(''))))
+ end
+ rescue
+ end
+ end
+
+ def Tk.toUTF8(str, encoding = nil)
+ _toUTF8(str, encoding)
+ end
+
+ def Tk.fromUTF8(str, encoding = nil)
+ _fromUTF8(str, encoding)
+ end
+end
+
+###########################################
+# string with Tcl's encoding
+###########################################
+module Tk
+ def Tk.subst_utf_backslash(str)
+ Tk::EncodedString.subst_utf_backslash(str)
+ end
+ def Tk.subst_tk_backslash(str)
+ Tk::EncodedString.subst_tk_backslash(str)
+ end
+ def Tk.utf_to_backslash_sequence(str)
+ Tk::EncodedString.utf_to_backslash_sequence(str)
+ end
+ def Tk.utf_to_backslash(str)
+ Tk::EncodedString.utf_to_backslash_sequence(str)
+ end
+ def Tk.to_backslash_sequence(str)
+ Tk::EncodedString.to_backslash_sequence(str)
+ end
+end
+
+
+###########################################
+# convert kanji string to/from utf-8
+###########################################
+if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK)
+ module Tk
+ module Encoding
+ extend Encoding
+
+ TkCommandNames = ['encoding'.freeze].freeze
+
+ #############################################
+
+ if TkCore::WITH_ENCODING ### Ruby 1.9
+ RubyEncoding = ::Encoding
+
+ # for saving GC cost
+ #ENCNAMES_CMD = ['encoding'.freeze, 'names'.freeze]
+ BINARY_NAME = 'binary'.freeze
+ UTF8_NAME = 'utf-8'.freeze
+ DEFAULT_EXTERNAL_NAME = RubyEncoding.default_external.name.freeze
+ DEFAULT_INTERNAL_NAME = RubyEncoding.default_internal.name.freeze rescue nil
+
+ BINARY = RubyEncoding.find(BINARY_NAME)
+ UNKNOWN = RubyEncoding.find('ASCII-8BIT')
+
+ ### start of creating ENCODING_TABLE
+ ENCODING_TABLE = TkCore::INTERP.encoding_table
+=begin
+ ENCODING_TABLE = {
+ 'binary' => BINARY,
+ # 'UNKNOWN-8BIT' => UNKNOWN,
+ }
+
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ ENCNAMES_CMD[1])
+ TkCore::INTERP._split_tklist(list).each{|name|
+ begin
+ enc = RubyEncoding.find(name)
+ rescue ArgumentError
+ case name
+ when 'identity'
+ enc = BINARY
+ when 'shiftjis'
+ enc = RubyEncoding.find('Shift_JIS')
+ when 'unicode'
+ enc = RubyEncoding.find('UTF-8')
+ #if Tk.tk_call('set', 'tcl_platform(byteOrder)') =='littleEndian'
+ # enc = RubyEncoding.find('UTF-16LE')
+ #else
+ # enc = RubyEncoding.find('UTF-16BE')
+ #end
+ when 'symbol'
+ # single byte data
+ enc = RubyEncoding.find('ASCII-8BIT') ### ???
+ else
+ # unsupported on Ruby, but supported on Tk
+ enc = TkCore::INTERP.create_dummy_encoding_for_tk(name)
+ end
+ end
+ ENCODING_TABLE[name.freeze] = enc
+ }
+=end
+=begin
+ def ENCODING_TABLE.get_name(enc)
+ orig_enc = enc
+
+ # unles enc, use system default
+ # 1st: Ruby/Tk default encoding
+ # 2nd: Tcl/Tk default encoding
+ # 3rd: Ruby's default_external
+ enc ||= TkCore::INTERP.encoding
+ enc ||= TclTkLib.encoding_system
+ enc ||= DEFAULT_EXTERNAL_NAME
+
+ if enc.kind_of?(RubyEncoding)
+ # Ruby's Encoding object
+ if (name = self.key(enc))
+ return name
+ end
+
+ # Is it new ?
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ ENCNAMES_CMD[1])
+ TkComm.simplelist(list).each{|name|
+ if ((enc == RubyEncoding.find(name)) rescue false)
+ # new relation!! update table
+ self[name.freeze] = enc
+ return name
+ end
+ }
+ else
+ # String or Symbol ?
+ if self[name = enc.to_s]
+ return name
+ end
+
+ # Is it new ?
+ if (enc_obj = (RubyEncoding.find(name) rescue false))
+ list = TkCore::INTERP._invoke_without_enc(ENCNAMES_CMD[0],
+ ENCNAMES_CMD[1])
+ if TkComm.simplelist(list).index(name)
+ # Tk's encoding name ?
+ self[name.freeze] = enc_obj # new relation!! update table
+ return name
+ else
+ # Ruby's encoding name ?
+ if (name = self.key(enc_obj))
+ return name
+ end
+ end
+ end
+ end
+
+ fail ArgumentError, "unsupported Tk encoding '#{orig_enc}'"
+ end
+
+ def ENCODING_TABLE.get_obj(enc)
+ # returns the encoding object.
+ # If 'enc' is the encoding name on Tk only, it returns nil.
+ ((obj = self[self.get_name(enc)]).kind_of?(RubyEncoding))? obj: nil
+ end
+=end
+ ### end of creating ENCODING_TABLE
+
+ end
+
+ #############################################
+
+ if TkCore::WITH_ENCODING
+ ################################
+ ### Ruby 1.9
+ ################################
+ def force_default_encoding(mode)
+ TkCore::INTERP.force_default_encoding = mode
+ end
+
+ def force_default_encoding?
+ TkCore::INTERP.force_default_encoding?
+ end
+
+ def default_encoding=(enc)
+ TkCore::INTERP.default_encoding = Tk::Encoding::ENCODING_TABLE.get_name(enc)
+ end
+
+ def encoding=(enc)
+ TkCore::INTERP.encoding = Tk::Encoding::ENCODING_TABLE.get_name(enc)
+ end
+
+ def encoding_name
+ Tk::Encoding::ENCODING_TABLE.get_name(TkCore::INTERP.encoding)
+ end
+ def encoding_obj
+ Tk::Encoding::ENCODING_TABLE.get_obj(TkCore::INTERP.encoding)
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def tk_encoding_names
+ #TkComm.simplelist(TkCore::INTERP._invoke_without_enc(Tk::Encoding::ENCNAMES_CMD[0], Tk::Encoding::ENCNAMES_CMD[1]))
+ TkComm.simplelist(TkCore::INTERP._invoke_without_enc('encoding', 'names'))
+ end
+ def encoding_names
+ self.tk_encoding_names.find_all{|name|
+ Tk::Encoding::ENCODING_TABLE.get_name(name) rescue false
+ }
+ end
+ def encoding_objs
+ self.tk_encoding_names.map!{|name|
+ Tk::Encoding::ENCODING_TABLE.get_obj(name) rescue nil
+ }.compact
+ end
+
+ def encoding_system=(enc)
+ TclTkLib.encoding_system = Tk::Encoding::ENCODING_TABLE.get_name(enc)
+ end
+
+ def encoding_system_name
+ Tk::Encoding::ENCODING_TABLE.get_name(TclTkLib.encoding_system)
+ end
+ def encoding_system_obj
+ Tk::Encoding::ENCODING_TABLE.get_obj(TclTkLib.encoding_system)
+ end
+ alias encoding_system encoding_system_name
+
+ ################################
+ else
+ ################################
+ ### Ruby 1.8-
+ ################################
+ def force_default_encoding=(mode)
+ true
+ end
+
+ def force_default_encoding?
+ true
+ end
+
+ def default_encoding=(enc)
+ TkCore::INTERP.default_encoding = enc
+ end
+
+ def encoding=(enc)
+ TkCore::INTERP.encoding = enc
+ end
+
+ def encoding_obj
+ TkCore::INTERP.encoding
+ end
+ def encoding_name
+ TkCore::INTERP.encoding
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def tk_encoding_names
+ TkComm.simplelist(Tk.tk_call('encoding', 'names'))
+ end
+ def encoding_objs
+ self.tk_encoding_names
+ end
+ def encoding_names
+ self.tk_encoding_names
+ end
+
+ def encoding_system=(enc)
+ TclTkLib.encoding_system = enc
+ end
+
+ def encoding_system_name
+ TclTkLib.encoding_system
+ end
+ def encoding_system_obj
+ TclTkLib.encoding_system
+ end
+ alias encoding_system encoding_system_name
+
+ ################################
+ end
+
+ def encoding_convertfrom(str, enc=nil)
+ enc = encoding_system_name unless enc
+ str = str.dup
+ if TkCore::WITH_ENCODING
+ if str.kind_of?(Tk::EncodedString)
+ str.__instance_variable_set('@encoding', nil)
+ else
+ str.instance_variable_set('@encoding', nil)
+ end
+ str.force_encoding('binary')
+ else
+ str.instance_variable_set('@encoding', 'binary')
+ end
+ ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertfrom',
+ enc, str)
+ if TkCore::WITH_ENCODING
+ ret.force_encoding('utf-8')
+ else
+ Tk::UTF8_String.new(ret)
+ end
+ ret
+ end
+ alias encoding_convert_from encoding_convertfrom
+
+ def encoding_convertto(str, enc=nil)
+ # str must be a UTF-8 string
+ enc = encoding_system_name unless enc
+ ret = TkCore::INTERP._invoke_without_enc('encoding', 'convertto',
+ enc, str)
+ #ret.instance_variable_set('@encoding', 'binary')
+ if TkCore::WITH_ENCODING
+ #ret.force_encoding(Tk::Encoding::ENCODING_TABLE.get_obj('binary'))
+ ret.force_encoding(Tk::Encoding::ENCODING_TABLE.get_obj(enc))
+ end
+ ret
+ end
+ alias encoding_convert_to encoding_convertto
+
+ def encoding_dirs
+ # Tcl8.5 feature
+ TkComm.simplelist(Tk.tk_call_without_enc('encoding', 'dirs'))
+ end
+
+ def encoding_dirs=(dir_list) # an array or a Tcl's list string
+ # Tcl8.5 feature
+ Tk.tk_call_without_enc('encoding', 'dirs', dir_list)
+ end
+ end
+
+ extend Encoding
+ end
+
+ class TclTkIp
+ def force_default_encoding=(mode)
+ @force_default_encoding[0] = (mode)? true: false
+ end
+
+ def force_default_encoding?
+ @force_default_encoding[0] ||= false
+ end
+
+ def default_encoding=(name)
+ name = name.name if Tk::WITH_ENCODING && name.kind_of?(::Encoding)
+ @encoding[0] = name.to_s.dup
+ end
+
+ # from tkencoding.rb by ttate@jaist.ac.jp
+ #attr_accessor :encoding
+ def encoding=(name)
+ self.force_default_encoding = true # for comaptibility
+ self.default_encoding = name
+ end
+
+ def encoding_name
+ (@encoding[0])? @encoding[0].dup: nil
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def encoding_obj
+ if Tk::WITH_ENCODING
+ Tk::Encoding.tcl2rb_encoding(@encoding[0])
+ else
+ (@encoding[0])? @encoding[0].dup: nil
+ end
+ end
+
+ alias __toUTF8 _toUTF8
+ alias __fromUTF8 _fromUTF8
+
+ if Object.const_defined?(:Encoding) && ::Encoding.class == Class
+ # with Encoding (Ruby 1.9+)
+ #
+ # use functions on Tcl as default.
+ # but when unsupported encoding on Tcl, use methods on Ruby.
+ #
+ def _toUTF8(str, enc = nil)
+ if enc
+ # use given encoding
+ begin
+ enc_name = Tk::Encoding::ENCODING_TABLE.get_name(enc)
+ rescue
+ # unknown encoding for Tk -> try to convert encoding on Ruby
+ str = str.dup.force_encoding(enc)
+ str.encode!(Tk::Encoding::UTF8_NAME) # modify self !!
+ return str # if no error, probably succeed converting
+ end
+ end
+
+ enc_name ||= str.instance_variable_get(:@encoding)
+
+ enc_name ||=
+ Tk::Encoding::ENCODING_TABLE.get_name(str.encoding) rescue nil
+
+ if enc_name
+ # str has its encoding information
+ encstr = __toUTF8(str, enc_name)
+ encstr.force_encoding(Tk::Encoding::UTF8_NAME)
+ return encstr
+ else
+ # str.encoding isn't supported by Tk -> try to convert on Ruby
+ begin
+ return str.encode(Tk::Encoding::UTF8_NAME) # new string
+ rescue
+ # error -> ignore, try to use default encoding of Ruby/Tk
+ end
+ end
+
+ #enc_name ||=
+ # Tk::Encoding::ENCODING_TABLE.get_name(Tk.encoding) rescue nil
+ enc_name ||= Tk::Encoding::ENCODING_TABLE.get_name(nil)
+
+ # is 'binary' encoding?
+ if enc_name == Tk::Encoding::BINARY_NAME
+ return str.dup.force_encoding(Tk::Encoding::BINARY_NAME)
+ end
+
+ # force default encoding?
+ if ! str.kind_of?(Tk::EncodedString) && self.force_default_encoding?
+ enc_name = Tk::Encoding::ENCODING_TABLE.get_name(Tk.default_encoding)
+ end
+
+ encstr = __toUTF8(str, enc_name)
+ encstr.force_encoding(Tk::Encoding::UTF8_NAME)
+ encstr
+ end
+ def _fromUTF8(str, enc = nil)
+ # str must be UTF-8 or binary.
+ enc_name = str.instance_variable_get(:@encoding)
+ enc_name ||=
+ Tk::Encoding::ENCODING_TABLE.get_name(str.encoding) rescue nil
+
+ # is 'binary' encoding?
+ if enc_name == Tk::Encoding::BINARY_NAME
+ return str.dup.force_encoding(Tk::Encoding::BINARY_NAME)
+ end
+
+ # get target encoding name (if enc == nil, use default encoding)
+ begin
+ enc_name = Tk::Encoding::ENCODING_TABLE.get_name(enc)
+ rescue
+ # then, enc != nil
+ # unknown encoding for Tk -> try to convert encoding on Ruby
+ str = str.dup.force_encoding(Tk::Encoding::UTF8_NAME)
+ str.encode!(enc) # modify self !!
+ return str # if no error, probably succeed converting
+ end
+
+ encstr = __fromUTF8(str, enc_name)
+ encstr.force_encoding(Tk::Encoding::ENCODING_TABLE.get_obj(enc_name))
+ encstr
+ end
+ ###
+ else
+ # without Encoding (Ruby 1.8)
+ def _toUTF8(str, encoding = nil)
+ __toUTF8(str, encoding)
+ end
+ def _fromUTF8(str, encoding = nil)
+ __fromUTF8(str, encoding)
+ end
+ ###
+ end
+
+ alias __eval _eval
+ alias __invoke _invoke
+
+ def _eval(cmd)
+ _fromUTF8(__eval(_toUTF8(cmd)))
+ end
+
+ def _invoke(*cmds)
+ _fromUTF8(__invoke(*(cmds.collect{|cmd| _toUTF8(cmd)})))
+ end
+
+ alias _eval_with_enc _eval
+ alias _invoke_with_enc _invoke
+
+=begin
+ #### --> definition is moved to TclTkIp module
+
+ def _toUTF8(str, encoding = nil)
+ # decide encoding
+ if encoding
+ encoding = encoding.to_s
+ elsif str.kind_of?(Tk::EncodedString) && str.encoding != nil
+ encoding = str.encoding.to_s
+ elsif str.instance_variable_get(:@encoding)
+ encoding = str.instance_variable_get(:@encoding).to_s
+ elsif defined?(@encoding) && @encoding != nil
+ encoding = @encoding.to_s
+ else
+ encoding = __invoke('encoding', 'system')
+ end
+
+ # convert
+ case encoding
+ when 'utf-8', 'binary'
+ str
+ else
+ __toUTF8(str, encoding)
+ end
+ end
+
+ def _fromUTF8(str, encoding = nil)
+ unless encoding
+ if defined?(@encoding) && @encoding != nil
+ encoding = @encoding.to_s
+ else
+ encoding = __invoke('encoding', 'system')
+ end
+ end
+
+ if str.kind_of?(Tk::EncodedString)
+ if str.encoding == 'binary'
+ str
+ else
+ __fromUTF8(str, encoding)
+ end
+ elsif str.instance_variable_get(:@encoding).to_s == 'binary'
+ str
+ else
+ __fromUTF8(str, encoding)
+ end
+ end
+=end
+
+=begin
+ def _eval(cmd)
+ if defined?(@encoding) && @encoding != 'utf-8'
+ ret = if cmd.kind_of?(Tk::EncodedString)
+ case cmd.encoding
+ when 'utf-8', 'binary'
+ __eval(cmd)
+ else
+ __eval(_toUTF8(cmd, cmd.encoding))
+ end
+ elsif cmd.instance_variable_get(:@encoding) == 'binary'
+ __eval(cmd)
+ else
+ __eval(_toUTF8(cmd, @encoding))
+ end
+ if ret.kind_of?(String) && ret.instance_variable_get(:@encoding) == 'binary'
+ ret
+ else
+ _fromUTF8(ret, @encoding)
+ end
+ else
+ __eval(cmd)
+ end
+ end
+
+ def _invoke(*cmds)
+ if defined?(@encoding) && @encoding != 'utf-8'
+ cmds = cmds.collect{|cmd|
+ if cmd.kind_of?(Tk::EncodedString)
+ case cmd.encoding
+ when 'utf-8', 'binary'
+ cmd
+ else
+ _toUTF8(cmd, cmd.encoding)
+ end
+ elsif cmd.instance_variable_get(:@encoding) == 'binary'
+ cmd
+ else
+ _toUTF8(cmd, @encoding)
+ end
+ }
+ ret = __invoke(*cmds)
+ if ret.kind_of?(String) && ret.instance_variable_get(:@encoding) == 'binary'
+ ret
+ else
+ _fromUTF8(ret, @encoding)
+ end
+ else
+ __invoke(*cmds)
+ end
+ end
+=end
+ end
+
+ module TclTkLib
+ class << self
+ def force_default_encoding=(mode)
+ TkCore::INTERP.force_default_encoding = mode
+ end
+
+ def force_default_encoding?
+ TkCore::INTERP.force_default_encoding?
+ end
+
+ def default_encoding=(name)
+ TkCore::INTERP.default_encoding = name
+ end
+
+ alias _encoding encoding
+ alias _encoding= encoding=
+ def encoding=(name)
+ name = name.name if name.kind_of?(::Encoding) if Tk::WITH_ENCODING
+ TkCore::INTERP.encoding = name
+ end
+
+ def encoding_name
+ TkCore::INTERP.encoding
+ end
+ alias encoding encoding_name
+ alias default_encoding encoding_name
+
+ def encoding_obj
+ if Tk::WITH_ENCODING
+ Tk::Encoding.tcl2rb_encoding(TkCore::INTERP.encoding)
+ else
+ TkCore::INTERP.encoding
+ end
+ end
+ end
+ end
+
+ # estimate encoding
+ unless TkCore::WITH_ENCODING
+ case $KCODE
+ when /^e/i # EUC
+ Tk.encoding = 'euc-jp'
+ Tk.encoding_system = 'euc-jp'
+ when /^s/i # SJIS
+ begin
+ if Tk.encoding_system == 'cp932'
+ Tk.encoding = 'cp932'
+ else
+ Tk.encoding = 'shiftjis'
+ Tk.encoding_system = 'shiftjis'
+ end
+ rescue StandardError, NameError
+ Tk.encoding = 'shiftjis'
+ Tk.encoding_system = 'shiftjis'
+ end
+ when /^u/i # UTF8
+ Tk.encoding = 'utf-8'
+ Tk.encoding_system = 'utf-8'
+ else # NONE
+ if defined? DEFAULT_TK_ENCODING
+ Tk.encoding_system = DEFAULT_TK_ENCODING
+ end
+ begin
+ Tk.encoding = Tk.encoding_system
+ rescue StandardError, NameError
+ Tk.encoding = 'utf-8'
+ Tk.encoding_system = 'utf-8'
+ end
+ end
+
+ else ### Ruby 1.9 !!!!!!!!!!!!
+ # loc_enc_obj = (::Encoding.find(::Encoding.locale_charmap) rescue Tk::Encoding::UNKNOWN)
+ loc_enc_obj = ::Encoding.find("locale")
+ ext_enc_obj = ::Encoding.default_external
+ int_enc_obj = ::Encoding.default_internal || ext_enc_obj
+ tksys_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(Tk.encoding_system)
+ # p [Tk.encoding, Tk.encoding_system, loc_enc_obj, ext_enc_obj]
+
+=begin
+ if ext_enc_obj == Tk::Encoding::UNKNOWN
+ if defined? DEFAULT_TK_ENCODING
+ if DEFAULT_TK_ENCODING.kind_of?(::Encoding)
+ tk_enc_name = DEFAULT_TK_ENCODING.name
+ tksys_enc_name = DEFAULT_TK_ENCODING.name
+ else
+ tk_enc_name = DEFAULT_TK_ENCODING
+ tksys_enc_name = DEFAULT_TK_ENCODING
+ end
+ else
+ tk_enc_name = loc_enc_obj.name
+ tksys_enc_name = loc_enc_obj.name
+ end
+ else
+ tk_enc_name = ext_enc_obj.name
+ tksys_enc_name = ext_enc_obj.name
+ end
+
+ # Tk.encoding = tk_enc_name
+ Tk.default_encoding = tk_enc_name
+ Tk.encoding_system = tksys_enc_name
+=end
+
+ if ext_enc_obj == Tk::Encoding::UNKNOWN
+ if loc_enc_obj == Tk::Encoding::UNKNOWN
+ # use Tk.encoding_system
+ else
+ # use locale_charmap
+ begin
+ loc_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(loc_enc_obj)
+ if loc_enc_name && loc_enc_name != tksys_enc_name
+ # use locale_charmap
+ Tk.encoding_system = loc_enc_name
+ else
+ # use Tk.encoding_system
+ end
+ rescue ArgumentError
+ # unsupported encoding on Tk -> use Tk.encoding_system
+ end
+ end
+ else
+ begin
+ ext_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(ext_enc_obj)
+ if ext_enc_name && ext_enc_name != tksys_enc_name
+ # use default_external
+ Tk.encoding_system = ext_enc_name
+ else
+ # use Tk.encoding_system
+ end
+ rescue ArgumentError
+ # unsupported encoding on Tk -> use Tk.encoding_system
+ end
+ end
+
+ # setup Tk.encoding
+ enc_name = nil
+
+ begin
+ default_def = DEFAULT_TK_ENCODING
+ if ::Encoding.find(default_def.to_s) != Tk::Encoding::UNKNOWN
+ enc_name = Tk::Encoding::ENCODING_TABLE.get_name(default_def)
+ end
+ rescue NameError
+ # ignore
+ enc_name = nil
+ rescue ArgumentError
+ enc_name = nil
+ fail ArgumentError,
+ "DEFAULT_TK_ENCODING has an unknown encoding #{default_def}"
+ end
+
+ unless enc_name
+ #if ext_enc_obj == Tk::Encoding::UNKNOWN
+ if int_enc_obj == Tk::Encoding::UNKNOWN
+ if loc_enc_obj == Tk::Encoding::UNKNOWN
+ # use Tk.encoding_system
+ enc_name = tksys_enc_name
+ else
+ # use locale_charmap
+ begin
+ loc_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(loc_enc_obj)
+ if loc_enc_name
+ # use locale_charmap
+ enc_name = loc_enc_name
+ else
+ # use Tk.encoding_system
+ enc_name = tksys_enc_name
+ end
+ rescue ArgumentError
+ # unsupported encoding on Tk -> use Tk.encoding_system
+ enc_name = tksys_enc_name
+ end
+ end
+ else
+ begin
+ #ext_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(ext_enc_obj)
+ #if ext_enc_name && ext_enc_name != tksys_enc_name
+ int_enc_name = Tk::Encoding::ENCODING_TABLE.get_name(int_enc_obj)
+ if int_enc_name
+ # use default_internal
+ enc_name = int_enc_name
+ else
+ # use Tk.encoding_system
+ enc_name = tksys_enc_name
+ end
+ rescue ArgumentError
+ # unsupported encoding on Tk -> use Tk.encoding_system
+ enc_name = tksys_enc_name
+ end
+ end
+ end
+
+ Tk.default_encoding = (enc_name)? enc_name: tksys_enc_name
+ end
+
+else
+ # dummy methods
+ module Tk
+ module Encoding
+ extend Encoding
+
+ def force_default_encoding=(mode)
+ nil
+ end
+
+ def force_default_encoding?
+ nil
+ end
+
+ def default_encoding=(enc)
+ nil
+ end
+ def default_encoding
+ nil
+ end
+
+ def encoding=(name)
+ nil
+ end
+ def encoding
+ nil
+ end
+ def encoding_names
+ nil
+ end
+ def encoding_system
+ nil
+ end
+ def encoding_system=(enc)
+ nil
+ end
+
+ def encoding_convertfrom(str, enc=None)
+ str
+ end
+ alias encoding_convert_from encoding_convertfrom
+
+ def encoding_convertto(str, enc=None)
+ str
+ end
+ alias encoding_convert_to encoding_convertto
+ def encoding_dirs
+ nil
+ end
+ def encoding_dirs=(dir_array)
+ nil
+ end
+ end
+
+ extend Encoding
+ end
+
+ class TclTkIp
+ attr_accessor :encoding
+
+ alias __eval _eval
+ alias __invoke _invoke
+
+ alias _eval_with_enc _eval
+ alias _invoke_with_enc _invoke
+ end
+end
+
+
+module TkBindCore
+ #def bind(context, cmd=Proc.new, *args)
+ # Tk.bind(self, context, cmd, *args)
+ #end
+ def bind(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ Tk.bind(self, context, cmd, *args)
+ end
+
+ #def bind_append(context, cmd=Proc.new, *args)
+ # Tk.bind_append(self, context, cmd, *args)
+ #end
+ def bind_append(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ Tk.bind_append(self, context, cmd, *args)
+ end
+
+ def bind_remove(context)
+ Tk.bind_remove(self, context)
+ end
+
+ def bindinfo(context=nil)
+ Tk.bindinfo(self, context)
+ end
+end
+
+
+module TkTreatFont
+ def __font_optkeys
+ ['font']
+ end
+ private :__font_optkeys
+
+ def __pathname
+ self.path
+ end
+ private :__pathname
+
+ ################################
+
+ def font_configinfo(key = nil)
+ optkeys = __font_optkeys
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __pathname.split(':')
+
+ if key
+ pathname = [win, tag, key].join(';')
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname, *__confinfo_cmd)
+ elsif optkeys.size == 1
+ pathname = [win, tag, optkeys[0]].join(';')
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname, *__confinfo_cmd)
+ else
+ fonts = {}
+ optkeys.each{|k|
+ k = k.to_s
+ pathname = [win, tag, k].join(';')
+ fonts[k] =
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname, *__confinfo_cmd)
+ }
+ fonts
+ end
+ end
+ alias fontobj font_configinfo
+
+ def font_configure(slot)
+ pathname = __pathname
+
+ slot = _symbolkey2str(slot)
+
+ __font_optkeys.each{|optkey|
+ optkey = optkey.to_s
+ l_optkey = 'latin' << optkey
+ a_optkey = 'ascii' << optkey
+ k_optkey = 'kanji' << optkey
+
+ if slot.key?(optkey)
+ fnt = slot.delete(optkey)
+ if fnt.kind_of?(TkFont)
+ slot.delete(l_optkey)
+ slot.delete(a_optkey)
+ slot.delete(k_optkey)
+
+ fnt.call_font_configure([pathname, optkey], *(__config_cmd << {}))
+ next
+ else
+ if fnt
+ if (slot.key?(l_optkey) ||
+ slot.key?(a_optkey) ||
+ slot.key?(k_optkey))
+ fnt = TkFont.new(fnt)
+
+ lfnt = slot.delete(l_optkey)
+ lfnt = slot.delete(a_optkey) if slot.key?(a_optkey)
+ kfnt = slot.delete(k_optkey)
+
+ fnt.latin_replace(lfnt) if lfnt
+ fnt.kanji_replace(kfnt) if kfnt
+
+ fnt.call_font_configure([pathname, optkey],
+ *(__config_cmd << {}))
+ next
+ else
+ fnt = hash_kv(fnt) if fnt.kind_of?(Hash)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__config_cmd << "-#{optkey}" << fnt))
+ else
+ begin
+ tk_call(*(__config_cmd << "-#{optkey}" << fnt))
+ rescue
+ # ignore
+ end
+ end
+ end
+ end
+ next
+ end
+ end
+
+ lfnt = slot.delete(l_optkey)
+ lfnt = slot.delete(a_optkey) if slot.key?(a_optkey)
+ kfnt = slot.delete(k_optkey)
+
+ if lfnt && kfnt
+ TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
+ *(__config_cmd << {}))
+ elsif lfnt
+ latinfont_configure([lfnt, optkey])
+ elsif kfnt
+ kanjifont_configure([kfnt, optkey])
+ end
+ }
+
+ # configure other (without font) options
+ tk_call(*(__config_cmd.concat(hash_kv(slot)))) if slot != {}
+ self
+ end
+
+ def latinfont_configure(ltn, keys=nil)
+ if ltn.kind_of?(Array)
+ key = ltn[1]
+ ltn = ltn[0]
+ else
+ key = nil
+ end
+
+ optkeys = __font_optkeys
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __pathname.split(':')
+
+ optkeys = [key] if key
+
+ optkeys.each{|optkey|
+ optkey = optkey.to_s
+
+ pathname = [win, tag, optkey].join(';')
+
+ if (fobj = TkFont.used_on(pathname))
+ fobj = TkFont.new(fobj) # create a new TkFont object
+ elsif Tk::JAPANIZED_TK
+ fobj = fontobj # create a new TkFont object
+ else
+ ltn = hash_kv(ltn) if ltn.kind_of?(Hash)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__config_cmd << "-#{optkey}" << ltn))
+ else
+ begin
+ tk_call(*(__config_cmd << "-#{optkey}" << ltn))
+ rescue => e
+ # ignore
+ end
+ end
+ next
+ end
+
+ if fobj.kind_of?(TkFont)
+ if ltn.kind_of?(TkFont)
+ conf = {}
+ ltn.latin_configinfo.each{|k,val| conf[k] = val}
+ if keys
+ fobj.latin_configure(conf.update(keys))
+ else
+ fobj.latin_configure(conf)
+ end
+ else
+ fobj.latin_replace(ltn)
+ end
+ end
+
+ fobj.call_font_configure([pathname, optkey], *(__config_cmd << {}))
+ }
+ self
+ end
+ alias asciifont_configure latinfont_configure
+
+ def kanjifont_configure(knj, keys=nil)
+ if knj.kind_of?(Array)
+ key = knj[1]
+ knj = knj[0]
+ else
+ key = nil
+ end
+
+ optkeys = __font_optkeys
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __pathname.split(':')
+
+ optkeys = [key] if key
+
+ optkeys.each{|optkey|
+ optkey = optkey.to_s
+
+ pathname = [win, tag, optkey].join(';')
+
+ if (fobj = TkFont.used_on(pathname))
+ fobj = TkFont.new(fobj) # create a new TkFont object
+ elsif Tk::JAPANIZED_TK
+ fobj = fontobj # create a new TkFont object
+ else
+ knj = hash_kv(knj) if knj.kind_of?(Hash)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__config_cmd << "-#{optkey}" << knj))
+ else
+ begin
+ tk_call(*(__config_cmd << "-#{optkey}" << knj))
+ rescue => e
+ # ignore
+ end
+ end
+ next
+ end
+
+ if fobj.kind_of?(TkFont)
+ if knj.kind_of?(TkFont)
+ conf = {}
+ knj.kanji_configinfo.each{|k,val| conf[k] = val}
+ if keys
+ fobj.kanji_configure(conf.update(keys))
+ else
+ fobj.kanji_configure(conf)
+ end
+ else
+ fobj.kanji_replace(knj)
+ end
+ end
+
+ fobj.call_font_configure([pathname, optkey], *(__config_cmd << {}))
+ }
+ self
+ end
+
+ def font_copy(win, wintag=nil, winkey=nil, targetkey=nil)
+ if wintag
+ if winkey
+ fnt = win.tagfontobj(wintag, winkey).dup
+ else
+ fnt = win.tagfontobj(wintag).dup
+ end
+ else
+ if winkey
+ fnt = win.fontobj(winkey).dup
+ else
+ fnt = win.fontobj.dup
+ end
+ end
+
+ if targetkey
+ fnt.call_font_configure([__pathname, targetkey], *(__config_cmd << {}))
+ else
+ fnt.call_font_configure(__pathname, *(__config_cmd << {}))
+ end
+ self
+ end
+
+ def latinfont_copy(win, wintag=nil, winkey=nil, targetkey=nil)
+ if targetkey
+ fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
+ *(__config_cmd << {}))
+ else
+ fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {}))
+ end
+
+ if wintag
+ if winkey
+ fontobj.latin_replace(win.tagfontobj(wintag, winkey).latin_font_id)
+ else
+ fontobj.latin_replace(win.tagfontobj(wintag).latin_font_id)
+ end
+ else
+ if winkey
+ fontobj.latin_replace(win.fontobj(winkey).latin_font_id)
+ else
+ fontobj.latin_replace(win.fontobj.latin_font_id)
+ end
+ end
+ self
+ end
+ alias asciifont_copy latinfont_copy
+
+ def kanjifont_copy(win, wintag=nil, winkey=nil, targetkey=nil)
+ if targetkey
+ fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
+ *(__config_cmd << {}))
+ else
+ fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {}))
+ end
+
+ if wintag
+ if winkey
+ fontobj.kanji_replace(win.tagfontobj(wintag, winkey).kanji_font_id)
+ else
+ fontobj.kanji_replace(win.tagfontobj(wintag).kanji_font_id)
+ end
+ else
+ if winkey
+ fontobj.kanji_replace(win.fontobj(winkey).kanji_font_id)
+ else
+ fontobj.kanji_replace(win.fontobj.kanji_font_id)
+ end
+ end
+ self
+ end
+end
+
+
+module TkConfigMethod
+ include TkUtil
+ include TkTreatFont
+
+ def TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ @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
+
+ def __cget_cmd
+ [self.path, 'cget']
+ end
+ private :__cget_cmd
+
+ def __config_cmd
+ [self.path, 'configure']
+ end
+ private :__config_cmd
+
+ def __confinfo_cmd
+ __config_cmd
+ end
+ private :__confinfo_cmd
+
+ def __configinfo_struct
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
+ :default_value=>3, :current_value=>4}
+ end
+ private :__configinfo_struct
+
+ def __optkey_aliases
+ {}
+ end
+ private :__optkey_aliases
+
+ def __numval_optkeys
+ []
+ end
+ private :__numval_optkeys
+
+ def __numstrval_optkeys
+ []
+ end
+ private :__numstrval_optkeys
+
+ def __boolval_optkeys
+ ['exportselection', 'jump', 'setgrid', 'takefocus']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ [
+ 'text', 'label', 'show', 'data', 'file',
+ 'activebackground', 'activeforeground', 'background',
+ 'disabledforeground', 'disabledbackground', 'foreground',
+ 'highlightbackground', 'highlightcolor', 'insertbackground',
+ 'selectbackground', 'selectforeground', 'troughcolor'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ []
+ end
+ private :__listval_optkeys
+
+ def __numlistval_optkeys
+ []
+ end
+ private :__numlistval_optkeys
+
+ def __tkvariable_optkeys
+ ['variable', 'textvariable']
+ end
+ private :__tkvariable_optkeys
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ # The method is used to convert a opt-value to a ruby's object.
+ # When get the value of the option "key", "proc.call(value)" is called.
+ {}
+ end
+ private :__val2ruby_optkeys
+
+ def __ruby2val_optkeys # { key=>proc, ... }
+ # The method is used to convert a ruby's object to a opt-value.
+ # When set the value of the option "key", "proc.call(value)" is called.
+ # That is, "-#{key} #{proc.call(value)}".
+ {}
+ end
+ private :__ruby2val_optkeys
+
+ def __methodcall_optkeys # { key=>method, ... }
+ # The method is used to both of get and set.
+ # Usually, the 'key' will not be a widget option.
+ {}
+ end
+ private :__methodcall_optkeys
+
+ def __keyonly_optkeys # { def_key=>undef_key or nil, ... }
+ {}
+ end
+ private :__keyonly_optkeys
+
+ def __conv_keyonly_opts(keys)
+ return keys unless keys.kind_of?(Hash)
+ keyonly = __keyonly_optkeys
+ keys2 = {}
+ keys.each{|k, v|
+ optkey = keyonly.find{|kk,vv| kk.to_s == k.to_s}
+ if optkey
+ defkey, undefkey = optkey
+ if v
+ keys2[defkey.to_s] = None
+ elsif undefkey
+ keys2[undefkey.to_s] = None
+ else
+ # remove key
+ end
+ else
+ keys2[k.to_s] = v
+ end
+ }
+ keys2
+ end
+ private :__conv_keyonly_opts
+
+ def config_hash_kv(keys, enc_mode = nil, conf = nil)
+ hash_kv(__conv_keyonly_opts(keys), enc_mode, conf)
+ end
+
+ ################################
+
+ def [](id)
+ cget(id)
+ end
+
+ def []=(id, val)
+ configure(id, val)
+ val
+ end
+
+ def cget_tkstring(option)
+ opt = option.to_s
+ fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.length == 0
+ tk_call_without_enc(*(__cget_cmd << "-#{opt}"))
+ end
+
+ def __cget_core(slot)
+ orig_slot = slot
+ slot = slot.to_s
+
+ if slot.length == 0
+ fail ArgumentError, "Invalid option `#{orig_slot.inspect}'"
+ end
+
+ alias_name, real_name = __optkey_aliases.find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ if ( method = _symbolkey2str(__val2ruby_optkeys())[slot] )
+ optval = tk_call_without_enc(*(__cget_cmd << "-#{slot}"))
+ begin
+ return method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ return optval
+ end
+ end
+
+ if ( method = _symbolkey2str(__methodcall_optkeys)[slot] )
+ return self.__send__(method)
+ end
+
+ case slot
+ when /^(#{__numval_optkeys.join('|')})$/
+ begin
+ number(tk_call_without_enc(*(__cget_cmd << "-#{slot}")))
+ rescue
+ nil
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ num_or_str(tk_call_without_enc(*(__cget_cmd << "-#{slot}")))
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ begin
+ bool(tk_call_without_enc(*(__cget_cmd << "-#{slot}")))
+ rescue
+ nil
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ simplelist(tk_call_without_enc(*(__cget_cmd << "-#{slot}")))
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ conf = tk_call_without_enc(*(__cget_cmd << "-#{slot}"))
+ if conf =~ /^[0-9+-]/
+ list(conf)
+ else
+ conf
+ end
+
+ when /^(#{__strval_optkeys.join('|')})$/
+ _fromUTF8(tk_call_without_enc(*(__cget_cmd << "-#{slot}")))
+
+ when /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/
+ fontcode = $1
+ fontkey = $2
+ fnt = tk_tcl2ruby(tk_call_without_enc(*(__cget_cmd << "-#{fontkey}")), true)
+ unless fnt.kind_of?(TkFont)
+ fnt = fontobj(fontkey)
+ end
+ if fontcode == 'kanji' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+
+ when /^(#{__tkvariable_optkeys.join('|')})$/
+ v = tk_call_without_enc(*(__cget_cmd << "-#{slot}"))
+ (v.empty?)? nil: TkVarAccess.new(v)
+
+ else
+ tk_tcl2ruby(tk_call_without_enc(*(__cget_cmd << "-#{slot}")), true)
+ end
+ end
+ private :__cget_core
+
+ def cget(slot)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __cget_core(slot)
+ else
+ begin
+ __cget_core(slot)
+ rescue => e
+ if current_configinfo.has_key?(slot.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ end
+ end
+ end
+ def cget_strict(slot)
+ # never use TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __cget_core(slot)
+ end
+
+ def __configure_core(slot, value=None)
+ if slot.kind_of? Hash
+ slot = _symbolkey2str(slot)
+
+ __optkey_aliases.each{|alias_name, real_name|
+ alias_name = alias_name.to_s
+ if slot.has_key?(alias_name)
+ slot[real_name.to_s] = slot.delete(alias_name)
+ end
+ }
+
+ __methodcall_optkeys.each{|key, method|
+ value = slot.delete(key.to_s)
+ self.__send__(method, value) if value
+ }
+
+ __ruby2val_optkeys.each{|key, method|
+ key = key.to_s
+ slot[key] = method.call(slot[key]) if slot.has_key?(key)
+ }
+
+ __keyonly_optkeys.each{|defkey, undefkey|
+ conf = slot.find{|kk, vv| kk == defkey.to_s}
+ if conf
+ k, v = conf
+ if v
+ slot[k] = None
+ else
+ slot[undefkey.to_s] = None if undefkey
+ slot.delete(k)
+ end
+ end
+ }
+
+ if (slot.find{|k, v| k =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/})
+ font_configure(slot)
+ elsif slot.size > 0
+ tk_call(*(__config_cmd.concat(hash_kv(slot))))
+ end
+
+ else
+ orig_slot = slot
+ slot = slot.to_s
+ if slot.length == 0
+ fail ArgumentError, "Invalid option `#{orig_slot.inspect}'"
+ end
+
+ alias_name, real_name = __optkey_aliases.find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ if ( conf = __keyonly_optkeys.find{|k, v| k.to_s == slot} )
+ defkey, undefkey = conf
+ if value
+ tk_call(*(__config_cmd << "-#{defkey}"))
+ elsif undefkey
+ tk_call(*(__config_cmd << "-#{undefkey}"))
+ end
+ elsif ( method = _symbolkey2str(__ruby2val_optkeys)[slot] )
+ tk_call(*(__config_cmd << "-#{slot}" << method.call(value)))
+ elsif ( method = _symbolkey2str(__methodcall_optkeys)[slot] )
+ self.__send__(method, value)
+ elsif (slot =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/)
+ if value == None
+ fontobj($2)
+ else
+ font_configure({slot=>value})
+ end
+ else
+ tk_call(*(__config_cmd << "-#{slot}" << value))
+ end
+ end
+ self
+ end
+ private :__configure_core
+
+ def __check_available_configure_options(keys)
+ availables = self.current_configinfo.keys
+
+ # add non-standard keys
+ availables |= __font_optkeys.map{|k|
+ [k.to_s, "latin#{k}", "ascii#{k}", "kanji#{k}"]
+ }.flatten
+ availables |= __methodcall_optkeys.keys.map{|k| k.to_s}
+ availables |= __keyonly_optkeys.keys.map{|k| k.to_s}
+
+ keys = _symbolkey2str(keys)
+ keys.delete_if{|k, v| !(availables.include?(k))}
+ end
+
+ def configure(slot, value=None)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __configure_core(slot, value)
+ else
+ if slot.kind_of?(Hash)
+ begin
+ __configure_core(slot)
+ rescue
+ slot = __check_available_configure_options(slot)
+ __configure_core(slot) unless slot.empty?
+ end
+ else
+ begin
+ __configure_core(slot, value)
+ rescue => e
+ if current_configinfo.has_key?(slot.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ end
+ end
+ end
+ self
+ end
+
+ def configure_cmd(slot, value)
+ configure(slot, install_cmd(value))
+ end
+
+ def __configinfo_core(slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot &&
+ slot.to_s =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/)
+ fontkey = $2
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")), false, true)
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+ if ( ! __configinfo_struct[:alias] \
+ || conf.size > __configinfo_struct[:alias] + 1 )
+ fnt = conf[__configinfo_struct[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ conf[__configinfo_struct[:default_value]] = TkNamedFont.new(fnt)
+ end
+ conf[__configinfo_struct[:current_value]] = fontobj(fontkey)
+ elsif ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 \
+ && conf[__configinfo_struct[:alias]][0] == ?- )
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+ conf
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __optkey_aliases.find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__val2ruby_optkeys().keys.join('|')})$/
+ method = _symbolkey2str(__val2ruby_optkeys())[slot]
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd() << "-#{slot}")), false, true)
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ optval = conf[__configinfo_struct[:default_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:default_value]] = val
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ optval = conf[__configinfo_struct[:current_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:current_value]] = val
+ end
+
+ when /^(#{__methodcall_optkeys.keys.join('|')})$/
+ method = _symbolkey2str(__methodcall_optkeys)[slot]
+ return [slot, '', '', '', self.__send__(method)]
+
+ when /^(#{__numval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]])
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ number(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ number(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]])
+ conf[__configinfo_struct[:default_value]] =
+ num_or_str(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ num_or_str(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]])
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ bool(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ bool(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]])
+ conf[__configinfo_struct[:default_value]] =
+ simplelist(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ simplelist(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] \
+ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:default_value]] =
+ list(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] \
+ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:current_value]] =
+ list(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__strval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ when /^(#{__tkvariable_optkeys.join('|')})$/
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]])
+ v = conf[__configinfo_struct[:default_value]]
+ if v.empty?
+ conf[__configinfo_struct[:default_value]] = nil
+ else
+ conf[__configinfo_struct[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ v = conf[__configinfo_struct[:current_value]]
+ if v.empty?
+ conf[__configinfo_struct[:current_value]] = nil
+ else
+ conf[__configinfo_struct[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ # conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true)
+ conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 1, false, true)
+ end
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+
+ if ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 \
+ && conf[__configinfo_struct[:alias]][0] == ?- )
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+
+ conf
+
+ else
+ # ret = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*__confinfo_cmd))).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ ret = tk_split_simplelist(tk_call_without_enc(*__confinfo_cmd), false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+
+ optkey = conf[__configinfo_struct[:key]]
+ case optkey
+ when /^(#{__val2ruby_optkeys().keys.join('|')})$/
+ method = _symbolkey2str(__val2ruby_optkeys())[optkey]
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ optval = conf[__configinfo_struct[:default_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:default_value]] = val
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ optval = conf[__configinfo_struct[:current_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:current_value]] = val
+ end
+
+ when /^(#{__strval_optkeys.join('|')})$/
+ # do nothing
+
+ when /^(#{__numval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ number(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ number(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ num_or_str(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ num_or_str(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ bool(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ bool(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ simplelist(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ simplelist(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] \
+ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:default_value]] =
+ list(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] \
+ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:current_value]] =
+ list(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__tkvariable_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ v = conf[__configinfo_struct[:default_value]]
+ if v.empty?
+ conf[__configinfo_struct[:default_value]] = nil
+ else
+ conf[__configinfo_struct[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ v = conf[__configinfo_struct[:current_value]]
+ if v.empty?
+ conf[__configinfo_struct[:current_value]] = nil
+ else
+ conf[__configinfo_struct[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ if conf[__configinfo_struct[:default_value]].index('{')
+ conf[__configinfo_struct[:default_value]] =
+ tk_split_list(conf[__configinfo_struct[:default_value]])
+ else
+ conf[__configinfo_struct[:default_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:default_value]])
+ end
+ end
+ if conf[__configinfo_struct[:current_value]]
+ if conf[__configinfo_struct[:current_value]].index('{')
+ conf[__configinfo_struct[:current_value]] =
+ tk_split_list(conf[__configinfo_struct[:current_value]])
+ else
+ conf[__configinfo_struct[:current_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:current_value]])
+ end
+ end
+ end
+
+ if ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 \
+ && conf[__configinfo_struct[:alias]][0] == ?- )
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+
+ conf
+ }
+
+ __font_optkeys.each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret.assoc(optkey)
+ if fontconf && fontconf.size > 2
+ ret.delete_if{|inf| inf[0] =~ /^(|latin|ascii|kanji)#{optkey}$/}
+ fnt = fontconf[__configinfo_struct[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ fontconf[__configinfo_struct[:default_value]] \
+ = TkNamedFont.new(fnt)
+ end
+ fontconf[__configinfo_struct[:current_value]] = fontobj(optkey)
+ ret.push(fontconf)
+ end
+ }
+
+ __methodcall_optkeys.each{|optkey, m|
+ ret << [optkey.to_s, '', '', '', self.__send__(m)]
+ }
+
+ ret
+ end
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot &&
+ slot.to_s =~ /^(|latin|ascii|kanji)(#{__font_optkeys.join('|')})$/)
+ fontkey = $2
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{fontkey}")), false, true)
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+
+ if ( ! __configinfo_struct[:alias] \
+ || conf.size > __configinfo_struct[:alias] + 1 )
+ fnt = conf[__configinfo_struct[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ conf[__configinfo_struct[:default_value]] = TkNamedFont.new(fnt)
+ end
+ conf[__configinfo_struct[:current_value]] = fontobj(fontkey)
+ { conf.shift => conf }
+ elsif ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 )
+ if conf[__configinfo_struct[:alias]][0] == ?-
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+ { conf[0] => conf[1] }
+ else
+ { conf.shift => conf }
+ end
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __optkey_aliases.find{|k,var| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__val2ruby_optkeys().keys.join('|')})$/
+ method = _symbolkey2str(__val2ruby_optkeys())[slot]
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ optval = conf[__configinfo_struct[:default_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:default_value]] = val
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ optval = conf[__configinfo_struct[:current_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:current_value]] = val
+ end
+
+ when /^(#{__methodcall_optkeys.keys.join('|')})$/
+ method = _symbolkey2str(__methodcall_optkeys)[slot]
+ return {slot => ['', '', '', self.__send__(method)]}
+
+ when /^(#{__numval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ number(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ number(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ num_or_str(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ num_or_str(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ bool(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ bool(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ simplelist(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ simplelist(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] \
+ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:default_value]] =
+ list(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] \
+ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:current_value]] =
+ list(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__tkvariable_optkeys.join('|')})$/
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ v = conf[__configinfo_struct[:default_value]]
+ if v.empty?
+ conf[__configinfo_struct[:default_value]] = nil
+ else
+ conf[__configinfo_struct[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ v = conf[__configinfo_struct[:current_value]]
+ if v.empty?
+ conf[__configinfo_struct[:current_value]] = nil
+ else
+ conf[__configinfo_struct[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ when /^(#{__strval_optkeys.join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), false, true)
+ else
+ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}"))))
+ conf = tk_split_list(tk_call_without_enc(*(__confinfo_cmd << "-#{slot}")), 0, false, true)
+ end
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+
+ if ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 )
+ if conf[__configinfo_struct[:alias]][0] == ?-
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+ { conf[0] => conf[1] }
+ else
+ { conf.shift => conf }
+ end
+
+ else
+ ret = {}
+ # tk_split_simplelist(_fromUTF8(tk_call_without_enc(*__confinfo_cmd))).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_call_without_enc(*__confinfo_cmd), false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[__configinfo_struct[:key]] =
+ conf[__configinfo_struct[:key]][1..-1]
+
+ optkey = conf[__configinfo_struct[:key]]
+ case optkey
+ when /^(#{__val2ruby_optkeys().keys.join('|')})$/
+ method = _symbolkey2str(__val2ruby_optkeys())[optkey]
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ optval = conf[__configinfo_struct[:default_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:default_value]] = val
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ optval = conf[__configinfo_struct[:current_value]]
+ begin
+ val = method.call(optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__configinfo_struct[:current_value]] = val
+ end
+
+ when /^(#{__strval_optkeys.join('|')})$/
+ # do nothing
+
+ when /^(#{__numval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ number(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ number(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ num_or_str(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ num_or_str(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ begin
+ conf[__configinfo_struct[:default_value]] =
+ bool(conf[__configinfo_struct[:default_value]])
+ rescue
+ conf[__configinfo_struct[:default_value]] = nil
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ begin
+ conf[__configinfo_struct[:current_value]] =
+ bool(conf[__configinfo_struct[:current_value]])
+ rescue
+ conf[__configinfo_struct[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ conf[__configinfo_struct[:default_value]] =
+ simplelist(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ conf[__configinfo_struct[:current_value]] =
+ simplelist(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] \
+ && conf[__configinfo_struct[:default_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:default_value]] =
+ list(conf[__configinfo_struct[:default_value]])
+ end
+ if ( conf[__configinfo_struct[:current_value]] \
+ && conf[__configinfo_struct[:current_value]] =~ /^[0-9]/ )
+ conf[__configinfo_struct[:current_value]] =
+ list(conf[__configinfo_struct[:current_value]])
+ end
+
+ when /^(#{__tkvariable_optkeys.join('|')})$/
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ v = conf[__configinfo_struct[:default_value]]
+ if v.empty?
+ conf[__configinfo_struct[:default_value]] = nil
+ else
+ conf[__configinfo_struct[:default_value]] = TkVarAccess.new
+ end
+ end
+ if ( conf[__configinfo_struct[:current_value]] )
+ v = conf[__configinfo_struct[:current_value]]
+ if v.empty?
+ conf[__configinfo_struct[:current_value]] = nil
+ else
+ conf[__configinfo_struct[:current_value]] = TkVarAccess.new
+ end
+ end
+
+ else
+ if ( __configinfo_struct[:default_value] \
+ && conf[__configinfo_struct[:default_value]] )
+ if conf[__configinfo_struct[:default_value]].index('{')
+ conf[__configinfo_struct[:default_value]] =
+ tk_split_list(conf[__configinfo_struct[:default_value]])
+ else
+ conf[__configinfo_struct[:default_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:default_value]])
+ end
+ end
+ if conf[__configinfo_struct[:current_value]]
+ if conf[__configinfo_struct[:current_value]].index('{')
+ conf[__configinfo_struct[:current_value]] =
+ tk_split_list(conf[__configinfo_struct[:current_value]])
+ else
+ conf[__configinfo_struct[:current_value]] =
+ tk_tcl2ruby(conf[__configinfo_struct[:current_value]])
+ end
+ end
+ end
+
+ if ( __configinfo_struct[:alias] \
+ && conf.size == __configinfo_struct[:alias] + 1 )
+ if conf[__configinfo_struct[:alias]][0] == ?-
+ conf[__configinfo_struct[:alias]] =
+ conf[__configinfo_struct[:alias]][1..-1]
+ end
+ ret[conf[0]] = conf[1]
+ else
+ ret[conf.shift] = conf
+ end
+ }
+
+ __font_optkeys.each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret[optkey]
+ if fontconf.kind_of?(Array)
+ ret.delete(optkey)
+ ret.delete('latin' << optkey)
+ ret.delete('ascii' << optkey)
+ ret.delete('kanji' << optkey)
+ fnt = fontconf[__configinfo_struct[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ fontconf[__configinfo_struct[:default_value]] \
+ = TkNamedFont.new(fnt)
+ end
+ fontconf[__configinfo_struct[:current_value]] = fontobj(optkey)
+ ret[optkey] = fontconf
+ end
+ }
+
+ __methodcall_optkeys.each{|optkey, m|
+ ret[optkey.to_s] = ['', '', '', self.__send__(m)]
+ }
+
+ ret
+ end
+ end
+ end
+ end
+ private :__configinfo_core
+
+ def configinfo(slot = nil)
+ if slot && TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ begin
+ __configinfo_core(slot)
+ rescue
+ Array.new(__configinfo_struct.values.max).unshift(slot.to_s)
+ end
+ else
+ __configinfo_core(slot)
+ end
+ end
+
+ def current_configinfo(slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ org_slot = slot
+ begin
+ conf = configinfo(slot)
+ if ( ! __configinfo_struct[:alias] \
+ || conf.size > __configinfo_struct[:alias] + 1 )
+ return {conf[0] => conf[-1]}
+ end
+ slot = conf[__configinfo_struct[:alias]]
+ end while(org_slot != slot)
+ fail RuntimeError,
+ "there is a configure alias loop about '#{org_slot}'"
+ else
+ ret = {}
+ configinfo().each{|cnf|
+ if ( ! __configinfo_struct[:alias] \
+ || cnf.size > __configinfo_struct[:alias] + 1 )
+ ret[cnf[0]] = cnf[-1]
+ end
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ configinfo(slot).each{|key, cnf|
+ ret[key] = cnf[-1] if cnf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+end
+
+class TkObject<TkKernel
+ extend TkCore
+ include Tk
+ include TkConfigMethod
+ include TkBindCore
+
+### --> definition is moved to TkUtil module
+# def path
+# @path
+# end
+
+ def epath
+ @path
+ end
+
+ def to_eval
+ @path
+ end
+
+ def tk_send(cmd, *rest)
+ tk_call(path, cmd, *rest)
+ end
+ def tk_send_without_enc(cmd, *rest)
+ tk_call_without_enc(path, cmd, *rest)
+ end
+ def tk_send_with_enc(cmd, *rest)
+ tk_call_with_enc(path, cmd, *rest)
+ end
+ # private :tk_send, :tk_send_without_enc, :tk_send_with_enc
+
+ def tk_send_to_list(cmd, *rest)
+ tk_call_to_list(path, cmd, *rest)
+ end
+ def tk_send_to_list_without_enc(cmd, *rest)
+ tk_call_to_list_without_enc(path, cmd, *rest)
+ end
+ def tk_send_to_list_with_enc(cmd, *rest)
+ tk_call_to_list_with_enc(path, cmd, *rest)
+ end
+ def tk_send_to_simplelist(cmd, *rest)
+ tk_call_to_simplelist(path, cmd, *rest)
+ end
+ def tk_send_to_simplelist_without_enc(cmd, *rest)
+ tk_call_to_simplelist_without_enc(path, cmd, *rest)
+ end
+ def tk_send_to_simplelist_with_enc(cmd, *rest)
+ tk_call_to_simplelist_with_enc(path, cmd, *rest)
+ end
+
+ def method_missing(id, *args)
+ name = id.id2name
+ case args.length
+ when 1
+ if name[-1] == ?=
+ configure name[0..-2], args[0]
+ args[0]
+ else
+ configure name, args[0]
+ self
+ end
+ when 0
+ begin
+ cget(name)
+ rescue
+ if self.kind_of?(TkWindow) && name != "to_ary" && name != "to_str"
+ fail NameError,
+ "unknown option '#{id}' for #{self.inspect} (deleted widget?)"
+ else
+ super(id, *args)
+ end
+# fail NameError,
+# "undefined local variable or method `#{name}' for #{self.to_s}",
+# error_at
+ end
+ else
+ super(id, *args)
+# fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at
+ end
+ end
+
+=begin
+ def [](id)
+ cget(id)
+ end
+
+ def []=(id, val)
+ configure(id, val)
+ val
+ end
+=end
+
+ def event_generate(context, keys=nil)
+ if context.kind_of?(TkEvent::Event)
+ context.generate(self, ((keys)? keys: {}))
+ elsif keys
+ #tk_call('event', 'generate', path,
+ # "<#{tk_event_sequence(context)}>", *hash_kv(keys))
+ tk_call_without_enc('event', 'generate', path,
+ "<#{tk_event_sequence(context)}>",
+ *hash_kv(keys, true))
+ else
+ #tk_call('event', 'generate', path, "<#{tk_event_sequence(context)}>")
+ tk_call_without_enc('event', 'generate', path,
+ "<#{tk_event_sequence(context)}>")
+ end
+ end
+
+ def tk_trace_variable(v)
+ #unless v.kind_of?(TkVariable)
+ # fail(ArgumentError, "type error (#{v.class}); must be TkVariable object")
+ #end
+ v
+ end
+ private :tk_trace_variable
+
+ def destroy
+ #tk_call 'trace', 'vdelete', @tk_vn, 'w', @var_id if @var_id
+ end
+end
+
+
+class TkWindow<TkObject
+ include TkWinfo
+ extend TkBindCore
+ include Tk::Wm_for_General
+ include Tk::Busy
+
+ @@WIDGET_INSPECT_FULL = false
+ def TkWindow._widget_inspect_full_?
+ @@WIDGET_INSPECT_FULL
+ end
+ def TkWindow._widget_inspect_full_=(mode)
+ @@WIDGET_INSPECT_FULL = (mode && true) || false
+ end
+
+ TkCommandNames = [].freeze
+ ## ==> If TkCommandNames[0] is a string (not a null string),
+ ## assume the string is a Tcl/Tk's create command of the widget class.
+ WidgetClassName = ''.freeze
+ # WidgetClassNames[WidgetClassName] = self
+ ## ==> If self is a widget class, entry to the WidgetClassNames table.
+ def self.to_eval
+ self::WidgetClassName
+ end
+
+ def initialize(parent=nil, keys=nil)
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ widgetname = keys.delete('widgetname')
+ install_win(if parent then parent.path end, widgetname)
+ without_creating = keys.delete('without_creating')
+ # if without_creating && !widgetname
+ # fail ArgumentError,
+ # "if set 'without_creating' to true, need to define 'widgetname'"
+ # end
+ elsif keys
+ keys = _symbolkey2str(keys)
+ widgetname = keys.delete('widgetname')
+ install_win(if parent then parent.path end, widgetname)
+ without_creating = keys.delete('without_creating')
+ # if without_creating && !widgetname
+ # fail ArgumentError,
+ # "if set 'without_creating' to true, need to define 'widgetname'"
+ # end
+ else
+ install_win(if parent then parent.path end)
+ end
+ if self.method(:create_self).arity == 0
+ p 'create_self has no arg' if $DEBUG
+ create_self unless without_creating
+ if keys
+ # tk_call @path, 'configure', *hash_kv(keys)
+ configure(keys)
+ end
+ else
+ p 'create_self has args' if $DEBUG
+ fontkeys = {}
+ methodkeys = {}
+ if keys
+ #['font', 'kanjifont', 'latinfont', 'asciifont'].each{|key|
+ # fontkeys[key] = keys.delete(key) if keys.key?(key)
+ #}
+ __font_optkeys.each{|key|
+ fkey = key.to_s
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "kanji#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "latin#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "ascii#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+ }
+
+ __optkey_aliases.each{|alias_name, real_name|
+ alias_name = alias_name.to_s
+ if keys.has_key?(alias_name)
+ keys[real_name.to_s] = keys.delete(alias_name)
+ end
+ }
+
+ __methodcall_optkeys.each{|key|
+ key = key.to_s
+ methodkeys[key] = keys.delete(key) if keys.key?(key)
+ }
+
+ __ruby2val_optkeys.each{|key, method|
+ key = key.to_s
+ keys[key] = method.call(keys[key]) if keys.has_key?(key)
+ }
+ end
+ if without_creating && keys
+ #configure(keys)
+ configure(__conv_keyonly_opts(keys))
+ else
+ #create_self(keys)
+ create_self(__conv_keyonly_opts(keys))
+ end
+ font_configure(fontkeys) unless fontkeys.empty?
+ configure(methodkeys) unless methodkeys.empty?
+ end
+ end
+
+ def create_self(keys)
+ # may need to override
+ begin
+ cmd = self.class::TkCommandNames[0]
+ fail unless (cmd.kind_of?(String) && cmd.length > 0)
+ rescue
+ fail RuntimeError, "class #{self.class} may be an abstract class"
+ end
+
+ if keys and keys != None
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call_without_enc(cmd, @path, *hash_kv(keys, true))
+ else
+ begin
+ tk_call_without_enc(cmd, @path, *hash_kv(keys, true))
+ rescue => e
+ tk_call_without_enc(cmd, @path)
+ keys = __check_available_configure_options(keys)
+ unless keys.empty?
+ begin
+ # try to configure
+ configure(keys)
+ rescue
+ # fail => includes options adaptable when creattion only?
+ begin
+ tk_call_without_enc('destroy', @path)
+ rescue
+ # cannot rescue options error
+ fail e
+ else
+ # re-create widget
+ tk_call_without_enc(cmd, @path, *hash_kv(keys, true))
+ end
+ end
+ end
+ end
+ end
+ else
+ tk_call_without_enc(cmd, @path)
+ end
+ end
+ private :create_self
+
+ def inspect
+ if @@WIDGET_INSPECT_FULL
+ super
+ else
+ str = super
+ str[0..(str.index(' '))] << '@path=' << @path.inspect << '>'
+ end
+ end
+
+ def exist?
+ TkWinfo.exist?(self)
+ end
+
+ def bind_class
+ @db_class || self.class()
+ end
+
+ def database_classname
+ TkWinfo.classname(self)
+ end
+ def database_class
+ name = database_classname()
+ if WidgetClassNames[name]
+ WidgetClassNames[name]
+ else
+ TkDatabaseClass.new(name)
+ end
+ end
+ def self.database_classname
+ self::WidgetClassName
+ end
+ def self.database_class
+ WidgetClassNames[self::WidgetClassName]
+ end
+
+ def pack(keys = nil)
+ #tk_call_without_enc('pack', epath, *hash_kv(keys, true))
+ if keys
+ TkPack.configure(self, keys)
+ else
+ TkPack.configure(self)
+ end
+ self
+ end
+
+ def pack_in(target, keys = nil)
+ if keys
+ keys = keys.dup
+ keys['in'] = target
+ else
+ keys = {'in'=>target}
+ end
+ #tk_call 'pack', epath, *hash_kv(keys)
+ TkPack.configure(self, keys)
+ self
+ end
+
+ def pack_forget
+ #tk_call_without_enc('pack', 'forget', epath)
+ TkPack.forget(self)
+ self
+ end
+ alias unpack pack_forget
+
+ def pack_config(slot, value=None)
+ #if slot.kind_of? Hash
+ # tk_call 'pack', 'configure', epath, *hash_kv(slot)
+ #else
+ # tk_call 'pack', 'configure', epath, "-#{slot}", value
+ #end
+ if slot.kind_of? Hash
+ TkPack.configure(self, slot)
+ else
+ TkPack.configure(self, slot=>value)
+ end
+ end
+ alias pack_configure pack_config
+
+ def pack_info()
+ #ilist = list(tk_call('pack', 'info', epath))
+ #info = {}
+ #while key = ilist.shift
+ # info[key[1..-1]] = ilist.shift
+ #end
+ #return info
+ TkPack.info(self)
+ end
+
+ def pack_propagate(mode=None)
+ #if mode == None
+ # bool(tk_call('pack', 'propagate', epath))
+ #else
+ # tk_call('pack', 'propagate', epath, mode)
+ # self
+ #end
+ if mode == None
+ TkPack.propagate(self)
+ else
+ TkPack.propagate(self, mode)
+ self
+ end
+ end
+
+ def pack_slaves()
+ #list(tk_call('pack', 'slaves', epath))
+ TkPack.slaves(self)
+ end
+
+ def grid(keys = nil)
+ #tk_call 'grid', epath, *hash_kv(keys)
+ if keys
+ TkGrid.configure(self, keys)
+ else
+ TkGrid.configure(self)
+ end
+ self
+ end
+
+ def grid_in(target, keys = nil)
+ if keys
+ keys = keys.dup
+ keys['in'] = target
+ else
+ keys = {'in'=>target}
+ end
+ #tk_call 'grid', epath, *hash_kv(keys)
+ TkGrid.configure(self, keys)
+ self
+ end
+
+ def grid_anchor(anchor=None)
+ if anchor == None
+ TkGrid.anchor(self)
+ else
+ TkGrid.anchor(self, anchor)
+ self
+ end
+ end
+
+ def grid_forget
+ #tk_call('grid', 'forget', epath)
+ TkGrid.forget(self)
+ self
+ end
+ alias ungrid grid_forget
+
+ def grid_bbox(*args)
+ #list(tk_call('grid', 'bbox', epath, *args))
+ TkGrid.bbox(self, *args)
+ end
+
+ def grid_config(slot, value=None)
+ #if slot.kind_of? Hash
+ # tk_call 'grid', 'configure', epath, *hash_kv(slot)
+ #else
+ # tk_call 'grid', 'configure', epath, "-#{slot}", value
+ #end
+ if slot.kind_of? Hash
+ TkGrid.configure(self, slot)
+ else
+ TkGrid.configure(self, slot=>value)
+ end
+ end
+ alias grid_configure grid_config
+
+ def grid_columnconfig(index, keys)
+ #tk_call('grid', 'columnconfigure', epath, index, *hash_kv(keys))
+ TkGrid.columnconfigure(self, index, keys)
+ end
+ alias grid_columnconfigure grid_columnconfig
+
+ def grid_rowconfig(index, keys)
+ #tk_call('grid', 'rowconfigure', epath, index, *hash_kv(keys))
+ TkGrid.rowconfigure(self, index, keys)
+ end
+ alias grid_rowconfigure grid_rowconfig
+
+ def grid_columnconfiginfo(index, slot=nil)
+ #if slot
+ # tk_call('grid', 'columnconfigure', epath, index, "-#{slot}").to_i
+ #else
+ # ilist = list(tk_call('grid', 'columnconfigure', epath, index))
+ # info = {}
+ # while key = ilist.shift
+ # info[key[1..-1]] = ilist.shift
+ # end
+ # info
+ #end
+ TkGrid.columnconfiginfo(self, index, slot)
+ end
+
+ def grid_rowconfiginfo(index, slot=nil)
+ #if slot
+ # tk_call('grid', 'rowconfigure', epath, index, "-#{slot}").to_i
+ #else
+ # ilist = list(tk_call('grid', 'rowconfigure', epath, index))
+ # info = {}
+ # while key = ilist.shift
+ # info[key[1..-1]] = ilist.shift
+ # end
+ # info
+ #end
+ TkGrid.rowconfiginfo(self, index, slot)
+ end
+
+ def grid_column(index, keys=nil)
+ if keys.kind_of?(Hash)
+ grid_columnconfigure(index, keys)
+ else
+ grid_columnconfiginfo(index, keys)
+ end
+ end
+
+ def grid_row(index, keys=nil)
+ if keys.kind_of?(Hash)
+ grid_rowconfigure(index, keys)
+ else
+ grid_rowconfiginfo(index, keys)
+ end
+ end
+
+ def grid_info()
+ #list(tk_call('grid', 'info', epath))
+ TkGrid.info(self)
+ end
+
+ def grid_location(x, y)
+ #list(tk_call('grid', 'location', epath, x, y))
+ TkGrid.location(self, x, y)
+ end
+
+ def grid_propagate(mode=None)
+ #if mode == None
+ # bool(tk_call('grid', 'propagate', epath))
+ #else
+ # tk_call('grid', 'propagate', epath, mode)
+ # self
+ #end
+ if mode == None
+ TkGrid.propagate(self)
+ else
+ TkGrid.propagate(self, mode)
+ self
+ end
+ end
+
+ def grid_remove()
+ #tk_call 'grid', 'remove', epath
+ TkGrid.remove(self)
+ self
+ end
+
+ def grid_size()
+ #list(tk_call('grid', 'size', epath))
+ TkGrid.size(self)
+ end
+
+ def grid_slaves(keys = nil)
+ #list(tk_call('grid', 'slaves', epath, *hash_kv(args)))
+ TkGrid.slaves(self, keys)
+ end
+
+ def place(keys)
+ #tk_call 'place', epath, *hash_kv(keys)
+ TkPlace.configure(self, keys)
+ self
+ end
+
+ def place_in(target, keys = nil)
+ if keys
+ keys = keys.dup
+ keys['in'] = target
+ else
+ keys = {'in'=>target}
+ end
+ #tk_call 'place', epath, *hash_kv(keys)
+ TkPlace.configure(self, keys)
+ self
+ end
+
+ def place_forget
+ #tk_call 'place', 'forget', epath
+ TkPlace.forget(self)
+ self
+ end
+ alias unplace place_forget
+
+ def place_config(slot, value=None)
+ #if slot.kind_of? Hash
+ # tk_call 'place', 'configure', epath, *hash_kv(slot)
+ #else
+ # tk_call 'place', 'configure', epath, "-#{slot}", value
+ #end
+ TkPlace.configure(self, slot, value)
+ end
+ alias place_configure place_config
+
+ def place_configinfo(slot = nil)
+ # for >= Tk8.4a2 ?
+ #if slot
+ # conf = tk_split_list(tk_call('place', 'configure', epath, "-#{slot}") )
+ # conf[0] = conf[0][1..-1]
+ # conf
+ #else
+ # tk_split_simplelist(tk_call('place',
+ # 'configure', epath)).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ # conf[0] = conf[0][1..-1]
+ # conf
+ # }
+ #end
+ TkPlace.configinfo(self, slot)
+ end
+
+ def place_info()
+ #ilist = list(tk_call('place', 'info', epath))
+ #info = {}
+ #while key = ilist.shift
+ # info[key[1..-1]] = ilist.shift
+ #end
+ #return info
+ TkPlace.info(self)
+ end
+
+ def place_slaves()
+ #list(tk_call('place', 'slaves', epath))
+ TkPlace.slaves(self)
+ end
+
+ def set_focus(force=false)
+ if force
+ tk_call_without_enc('focus', '-force', path)
+ else
+ tk_call_without_enc('focus', path)
+ end
+ self
+ end
+ alias focus set_focus
+
+ def grab(opt = nil)
+ unless opt
+ tk_call_without_enc('grab', 'set', path)
+ return self
+ end
+
+ case opt
+ when 'set', :set
+ tk_call_without_enc('grab', 'set', path)
+ return self
+ when 'global', :global
+ #return(tk_call('grab', 'set', '-global', path))
+ tk_call_without_enc('grab', 'set', '-global', path)
+ return self
+ when 'release', :release
+ #return tk_call('grab', 'release', path)
+ tk_call_without_enc('grab', 'release', path)
+ return self
+ when 'current', :current
+ return window(tk_call_without_enc('grab', 'current', path))
+ when 'status', :status
+ return tk_call_without_enc('grab', 'status', path)
+ else
+ return tk_call_without_enc('grab', opt, path)
+ end
+ end
+
+ def grab_current
+ grab('current')
+ end
+ alias current_grab grab_current
+ def grab_release
+ grab('release')
+ end
+ alias release_grab grab_release
+ def grab_set
+ grab('set')
+ end
+ alias set_grab grab_set
+ def grab_set_global
+ grab('global')
+ end
+ alias set_global_grab grab_set_global
+ def grab_status
+ grab('status')
+ end
+
+ def lower(below=None)
+ # below = below.epath if below.kind_of?(TkObject)
+ below = _epath(below)
+ tk_call 'lower', epath, below
+ self
+ end
+ alias lower_window lower
+ def raise(above=None)
+ #above = above.epath if above.kind_of?(TkObject)
+ above = _epath(above)
+ tk_call 'raise', epath, above
+ self
+ end
+ alias raise_window raise
+
+ def command(cmd=nil, &b)
+ if cmd
+ configure_cmd('command', cmd)
+ elsif b
+ configure_cmd('command', Proc.new(&b))
+ else
+ cget('command')
+ end
+ end
+
+ def colormodel(model=None)
+ tk_call('tk', 'colormodel', path, model)
+ self
+ end
+
+ def caret(keys=nil)
+ TkXIM.caret(path, keys)
+ end
+
+ def destroy
+ super
+ children = []
+ rexp = /^#{self.path}\.[^.]+$/
+ TkCore::INTERP.tk_windows.each{|path, obj|
+ children << [path, obj] if path =~ rexp
+ }
+ if defined?(@cmdtbl)
+ for id in @cmdtbl
+ uninstall_cmd id
+ end
+ end
+
+ children.each{|path, obj|
+ obj.instance_eval{
+ if defined?(@cmdtbl)
+ for id in @cmdtbl
+ uninstall_cmd id
+ end
+ end
+ }
+ TkCore::INTERP.tk_windows.delete(path)
+ }
+
+ begin
+ tk_call_without_enc('destroy', epath)
+ rescue
+ end
+ uninstall_win
+ 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)
+ else
+ INTERP._invoke('tkwait', 'visibility', path)
+ end
+ end
+ def eventloop_wait_visibility
+ wait_visibility(false)
+ end
+ def thread_wait_visibility
+ wait_visibility(true)
+ end
+ alias wait wait_visibility
+ alias tkwait wait_visibility
+ alias eventloop_wait eventloop_wait_visibility
+ alias eventloop_tkwait eventloop_wait_visibility
+ alias eventloop_tkwait_visibility eventloop_wait_visibility
+ alias thread_wait thread_wait_visibility
+ alias thread_tkwait thread_wait_visibility
+ 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)
+ else
+ INTERP._invoke('tkwait', 'window', epath)
+ end
+ end
+ alias wait_window wait_destroy
+ def eventloop_wait_destroy
+ wait_destroy(false)
+ end
+ alias eventloop_wait_window eventloop_wait_destroy
+ def thread_wait_destroy
+ wait_destroy(true)
+ end
+ alias thread_wait_window thread_wait_destroy
+
+ alias tkwait_destroy wait_destroy
+ alias tkwait_window wait_destroy
+
+ alias eventloop_tkwait_destroy eventloop_wait_destroy
+ alias eventloop_tkwait_window eventloop_wait_destroy
+
+ alias thread_tkwait_destroy thread_wait_destroy
+ alias thread_tkwait_window thread_wait_destroy
+
+ def bindtags(taglist=nil)
+ if taglist
+ fail ArgumentError, "taglist must be Array" unless taglist.kind_of? Array
+ tk_call('bindtags', path, taglist)
+ taglist
+ else
+ list(tk_call('bindtags', path)).collect{|tag|
+ if tag.kind_of?(String)
+ if cls = WidgetClassNames[tag]
+ cls
+ elsif btag = TkBindTag.id2obj(tag)
+ btag
+ else
+ tag
+ end
+ else
+ tag
+ end
+ }
+ end
+ end
+
+ def bindtags=(taglist)
+ bindtags(taglist)
+ taglist
+ end
+
+ def bindtags_shift
+ taglist = bindtags
+ tag = taglist.shift
+ bindtags(taglist)
+ tag
+ end
+
+ def bindtags_unshift(tag)
+ bindtags(bindtags().unshift(tag))
+ end
+end
+TkWidget = TkWindow
+
+# freeze core modules
+#TclTkLib.freeze
+#TclTkIp.freeze
+#TkUtil.freeze
+#TkKernel.freeze
+#TkComm.freeze
+#TkComm::Event.freeze
+#TkCore.freeze
+#Tk.freeze
+
+module Tk
+ RELEASE_DATE = '2010-06-03'.freeze
+
+ autoload :AUTO_PATH, 'tk/variable'
+ autoload :TCL_PACKAGE_PATH, 'tk/variable'
+ autoload :PACKAGE_PATH, 'tk/variable'
+ autoload :TCL_LIBRARY_PATH, 'tk/variable'
+ autoload :LIBRARY_PATH, 'tk/variable'
+ autoload :TCL_PRECISION, 'tk/variable'
+end
+
+# call setup script for Tk extension libraries (base configuration)
+begin
+ require 'tkextlib/version.rb'
+ require 'tkextlib/setup.rb'
+rescue LoadError
+ # ignore
+end
diff --git a/ext/tk/lib/tk/after.rb b/ext/tk/lib/tk/after.rb
new file mode 100644
index 0000000000..8c58210331
--- /dev/null
+++ b/ext/tk/lib/tk/after.rb
@@ -0,0 +1,6 @@
+#
+# tk/after.rb : methods for Tcl/Tk after command
+#
+# $Id$
+#
+require 'tk/timer'
diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb
new file mode 100644
index 0000000000..f6ca261da9
--- /dev/null
+++ b/ext/tk/lib/tk/autoload.rb
@@ -0,0 +1,760 @@
+#
+# autoload
+#
+############################################
+# geometry manager
+module Tk
+ autoload :Grid, 'tk/grid'
+ def Grid(*args); TkGrid.configure(*args); end
+
+ autoload :Pack, 'tk/pack'
+ def Pack(*args); TkPack.configure(*args); end
+
+ autoload :Place, 'tk/place'
+ def Place(*args); TkPlace.configure(*args); end
+end
+
+autoload :TkGrid, 'tk/grid'
+def TkGrid(*args); TkGrid.configure(*args); end
+
+autoload :TkPack, 'tk/pack'
+def TkPack(*args); TkPack.configure(*args); end
+
+autoload :TkPlace, 'tk/place'
+def TkPlace(*args); TkPlace.configure(*args); end
+
+
+############################################
+# classes on Tk module
+module Tk
+ autoload :Busy, 'tk/busy'
+
+ autoload :Button, 'tk/button'
+
+ autoload :Canvas, 'tk/canvas'
+
+ autoload :CheckButton, 'tk/checkbutton'
+ autoload :Checkbutton, 'tk/checkbutton'
+
+ autoload :Entry, 'tk/entry'
+
+ autoload :Frame, 'tk/frame'
+
+ autoload :Label, 'tk/label'
+
+ autoload :LabelFrame, 'tk/labelframe'
+ autoload :Labelframe, 'tk/labelframe'
+
+ autoload :Listbox, 'tk/listbox'
+
+ autoload :Menu, 'tk/menu'
+ autoload :MenuClone, 'tk/menu'
+ autoload :CloneMenu, 'tk/menu'
+ autoload :SystemMenu, 'tk/menu'
+ autoload :SysMenu_Help, 'tk/menu'
+ autoload :SysMenu_System, 'tk/menu'
+ autoload :SysMenu_Apple, 'tk/menu'
+ autoload :Menubutton, 'tk/menu'
+ autoload :MenuButton, 'tk/menu'
+ autoload :OptionMenubutton, 'tk/menu'
+ autoload :OptionMenBbutton, 'tk/menu'
+
+ autoload :Message, 'tk/message'
+
+ autoload :PanedWindow, 'tk/panedwindow'
+ autoload :Panedwindow, 'tk/panedwindow'
+
+ autoload :RadioButton, 'tk/radiobutton'
+ autoload :Radiobutton, 'tk/radiobutton'
+
+ autoload :Root, 'tk/root'
+
+ autoload :Scale, 'tk/scale'
+
+ autoload :Scrollbar, 'tk/scrollbar'
+ autoload :XScrollbar, 'tk/scrollbar'
+ autoload :YScrollbar, 'tk/scrollbar'
+
+ autoload :Spinbox, 'tk/spinbox'
+
+ autoload :Text, 'tk/text'
+
+ autoload :Toplevel, 'tk/toplevel'
+end
+
+
+############################################
+# sub-module of Tk
+module Tk
+ autoload :Clock, 'tk/clock'
+
+ autoload :OptionObj, 'tk/optionobj'
+
+ autoload :X_Scrollable, 'tk/scrollable'
+ autoload :Y_Scrollable, 'tk/scrollable'
+ autoload :Scrollable, 'tk/scrollable'
+
+ autoload :Wm, 'tk/wm'
+ autoload :Wm_for_General, 'tk/wm'
+
+ autoload :MacResource, 'tk/macpkg'
+
+ autoload :WinDDE, 'tk/winpkg'
+ autoload :WinRegistry, 'tk/winpkg'
+
+ autoload :ValidateConfigure, 'tk/validation'
+ autoload :ItemValidateConfigure, 'tk/validation'
+
+ autoload :EncodedString, 'tk/encodedstr'
+ def Tk.EncodedString(str, enc = nil); Tk::EncodedString.new(str, enc); end
+
+ autoload :BinaryString, 'tk/encodedstr'
+ def Tk.BinaryString(str); Tk::BinaryString.new(str); end
+
+ autoload :UTF8_String, 'tk/encodedstr'
+ def Tk.UTF8_String(str); Tk::UTF8_String.new(str); end
+
+end
+
+
+############################################
+# toplevel classes/modules (fixed)
+autoload :TkBgError, 'tk/bgerror'
+
+autoload :TkBindTag, 'tk/bindtag'
+autoload :TkBindTagAll, 'tk/bindtag'
+autoload :TkDatabaseClass, 'tk/bindtag'
+
+autoload :TkConsole, 'tk/console'
+
+autoload :TkcItem, 'tk/canvas'
+autoload :TkcArc, 'tk/canvas'
+autoload :TkcBitmap, 'tk/canvas'
+autoload :TkcImage, 'tk/canvas'
+autoload :TkcLine, 'tk/canvas'
+autoload :TkcOval, 'tk/canvas'
+autoload :TkcPolygon, 'tk/canvas'
+autoload :TkcRectangle, 'tk/canvas'
+autoload :TkcText, 'tk/canvas'
+autoload :TkcWindow, 'tk/canvas'
+
+autoload :TkcTagAccess, 'tk/canvastag'
+autoload :TkcTag, 'tk/canvastag'
+autoload :TkcTagString, 'tk/canvastag'
+autoload :TkcNamedTag, 'tk/canvastag'
+autoload :TkcTagAll, 'tk/canvastag'
+autoload :TkcTagCurrent, 'tk/canvastag'
+autoload :TkcTagGroup, 'tk/canvastag'
+
+autoload :TkClipboard, 'tk/clipboard'
+
+autoload :TkComposite, 'tk/composite'
+
+autoload :TkConsole, 'tk/console'
+
+autoload :TkDialog, 'tk/dialog'
+autoload :TkDialog2, 'tk/dialog'
+autoload :TkDialogObj, 'tk/dialog'
+autoload :TkWarning, 'tk/dialog'
+autoload :TkWarning2, 'tk/dialog'
+autoload :TkWarningObj, 'tk/dialog'
+
+autoload :TkEvent, 'tk/event'
+
+autoload :TkFont, 'tk/font'
+autoload :TkNamedFont, 'tk/font'
+
+autoload :TkImage, 'tk/image'
+autoload :TkBitmapImage, 'tk/image'
+autoload :TkPhotoImage, 'tk/image'
+
+autoload :TkItemConfigMethod, 'tk/itemconfig'
+
+autoload :TkTreatItemFont, 'tk/itemfont'
+
+autoload :TkKinput, 'tk/kinput'
+
+autoload :TkSystemMenu, 'tk/menu'
+
+autoload :TkMenubar, 'tk/menubar'
+
+autoload :TkMenuSpec, 'tk/menuspec'
+
+autoload :TkManageFocus, 'tk/mngfocus'
+
+autoload :TkMsgCatalog, 'tk/msgcat'
+autoload :TkMsgCat, 'tk/msgcat'
+
+autoload :TkNamespace, 'tk/namespace'
+
+autoload :TkOptionDB, 'tk/optiondb'
+autoload :TkOption, 'tk/optiondb'
+autoload :TkResourceDB, 'tk/optiondb'
+
+autoload :TkPackage, 'tk/package'
+
+autoload :TkPalette, 'tk/palette'
+
+autoload :TkRoot, 'tk/root'
+
+autoload :TkScrollbox, 'tk/scrollbox'
+
+autoload :TkSelection, 'tk/selection'
+
+autoload :TkTreatTagFont, 'tk/tagfont'
+
+autoload :TkTextImage, 'tk/textimage'
+autoload :TktImage, 'tk/textimage'
+
+autoload :TkTextMark, 'tk/textmark'
+autoload :TkTextNamedMark, 'tk/textmark'
+autoload :TkTextMarkInsert, 'tk/textmark'
+autoload :TkTextMarkCurrent, 'tk/textmark'
+autoload :TkTextMarkAnchor, 'tk/textmark'
+autoload :TktMark, 'tk/textmark'
+autoload :TktNamedMark, 'tk/textmark'
+autoload :TktMarkInsert, 'tk/textmark'
+autoload :TktMarkCurrent, 'tk/textmark'
+autoload :TktMarkAnchor, 'tk/textmark'
+
+autoload :TkTextTag, 'tk/texttag'
+autoload :TkTextNamedTag, 'tk/texttag'
+autoload :TkTextTagSel, 'tk/texttag'
+autoload :TktTag, 'tk/texttag'
+autoload :TktNamedTag, 'tk/texttag'
+autoload :TktTagSel, 'tk/texttag'
+
+autoload :TkTextWindow, 'tk/textwindow'
+autoload :TktWindow, 'tk/textwindow'
+
+autoload :TkAfter, 'tk/timer'
+autoload :TkTimer, 'tk/timer'
+autoload :TkRTTimer, 'tk/timer'
+
+autoload :TkTextWin, 'tk/txtwin_abst'
+
+autoload :TkValidation, 'tk/validation'
+autoload :TkValidateCommand, 'tk/validation'
+
+autoload :TkVariable, 'tk/variable'
+autoload :TkVarAccess, 'tk/variable'
+
+autoload :TkVirtualEvent, 'tk/virtevent'
+autoload :TkNamedVirtualEvent,'tk/virtevent'
+
+autoload :TkWinfo, 'tk/winfo'
+
+autoload :TkXIM, 'tk/xim'
+
+
+############################################
+# toplevel classes/modules (switchable)
+module Tk
+ @TOPLEVEL_ALIAS_TABLE = {}
+ @TOPLEVEL_ALIAS_TABLE[:Tk] = {
+ :TkButton => 'tk/button',
+
+ :TkCanvas => 'tk/canvas',
+
+ :TkCheckButton => 'tk/checkbutton',
+ :TkCheckbutton => 'tk/checkbutton',
+
+ # :TkDialog => 'tk/dialog',
+ # :TkDialog2 => 'tk/dialog',
+ # :TkDialogObj => 'tk/dialog',
+ # :TkWarning => 'tk/dialog',
+ # :TkWarning2 => 'tk/dialog',
+ # :TkWarningObj => 'tk/dialog',
+
+ :TkEntry => 'tk/entry',
+
+ :TkFrame => 'tk/frame',
+
+ :TkLabel => 'tk/label',
+
+ :TkLabelFrame => 'tk/labelframe',
+ :TkLabelframe => 'tk/labelframe',
+
+ :TkListbox => 'tk/listbox',
+
+ :TkMacResource => 'tk/macpkg',
+
+ :TkMenu => 'tk/menu',
+ :TkMenuClone => 'tk/menu',
+ :TkCloneMenu => 'tk/menu',
+ # :TkSystemMenu => 'tk/menu',
+ :TkSysMenu_Help => 'tk/menu',
+ :TkSysMenu_System => 'tk/menu',
+ :TkSysMenu_Apple => 'tk/menu',
+ :TkMenubutton => 'tk/menu',
+ :TkMenuButton => 'tk/menu',
+ :TkOptionMenubutton => 'tk/menu',
+ :TkOptionMenuButton => 'tk/menu',
+
+ :TkMessage => 'tk/message',
+
+ :TkPanedWindow => 'tk/panedwindow',
+ :TkPanedwindow => 'tk/panedwindow',
+
+ :TkRadioButton => 'tk/radiobutton',
+ :TkRadiobutton => 'tk/radiobutton',
+
+ # :TkRoot => 'tk/root',
+
+ :TkScale => 'tk/scale',
+
+ :TkScrollbar => 'tk/scrollbar',
+ :TkXScrollbar => 'tk/scrollbar',
+ :TkYScrollbar => 'tk/scrollbar',
+
+ :TkSpinbox => 'tk/spinbox',
+
+ :TkText => 'tk/text',
+
+ :TkToplevel => 'tk/toplevel',
+
+ :TkWinDDE => 'tk/winpkg',
+ :TkWinRegistry => 'tk/winpkg',
+ }
+
+ @TOPLEVEL_ALIAS_OWNER = {}
+
+ @TOPLEVEL_ALIAS_SETUP_PROC = {}
+
+ @AUTOLOAD_FILE_SYM_TABLE = Hash.new{|h,k| h[k]={}} # TABLE[file][sym] -> obj
+
+ @current_default_widget_set = nil
+
+ module TOPLEVEL_ALIASES; end
+end
+
+class Object
+ include Tk::TOPLEVEL_ALIASES
+end
+
+############################################
+# methods to control default widget set
+############################################
+
+class << Tk
+ def default_widget_set
+ @current_default_widget_set
+ end
+
+ def default_widget_set=(target)
+ target = target.to_sym
+ return target if target == @current_default_widget_set
+
+ if (cmd = @TOPLEVEL_ALIAS_SETUP_PROC[target])
+ cmd.call(target)
+ end
+
+ _replace_toplevel_aliases(target)
+ end
+
+ def widget_set_symbols
+ @TOPLEVEL_ALIAS_TABLE.keys
+ end
+
+ def toplevel_aliases_on_widget_set(widget_set)
+ if (tbl = @TOPLEVEL_ALIAS_TABLE[widget_set.to_sym])
+ tbl.collect{|k, v| (v.nil?)? nil: k}.compact
+ else
+ fail ArgumentError, "unknown widget_set #{widget_set.to_sym.inspect}"
+ end
+ end
+
+ def __toplevel_alias_setup_proc__(*target_list, &cmd)
+ target_list.each{|target| @TOPLEVEL_ALIAS_SETUP_PROC[target.to_sym] = cmd}
+ end
+
+ def topobj_defined?(sym) #=> alias_filename or object or false
+ Object.autoload?(sym) ||
+ (Object.const_defined?(sym) && Object.const_get(sym))
+ end
+ def topalias_defined?(sym) #=> alias_filename or object or false
+ Tk::TOPLEVEL_ALIASES.autoload?(sym) ||
+ (Tk::TOPLEVEL_ALIASES.const_defined?(sym) &&
+ Tk::TOPLEVEL_ALIASES.const_get(sym))
+ end
+ def define_topobj(sym, obj)
+ if obj.kind_of? String
+ # obj is an autoload path
+ Object.autoload(sym, obj)
+ unless Object.autoload?(sym)
+ # file is autoloaded?
+ if @AUTOLOAD_FILE_SYM_TABLE.has_key?(obj) &&
+ (loaded_obj = @AUTOLOAD_FILE_SYM_TABLE[obj][sym])
+ Object.const_set(sym, loaded_obj)
+ else
+ fail ArgumentError, "cannot define autoload file (already loaded?)"
+ end
+ end
+ else
+ # object
+ Object.const_set(sym, obj)
+ end
+ end
+ def define_topalias(sym, obj)
+ if obj.kind_of? String
+ # obj is an autoload path
+ Tk::TOPLEVEL_ALIASES.autoload(sym, obj)
+ unless Tk::TOPLEVEL_ALIASES.autoload?(sym)
+ # file is autoloaded?
+ if @AUTOLOAD_FILE_SYM_TABLE.has_key?(obj) &&
+ (loaded_obj = @AUTOLOAD_FILE_SYM_TABLE[obj][sym])
+ Tk::TOPLEVEL_ALIASES.const_set(sym, loaded_obj)
+ else
+ fail ArgumentError, "cannot define autoload file (already loaded?)"
+ end
+ end
+ else
+ # object
+ Tk::TOPLEVEL_ALIASES.const_set(sym, obj)
+ end
+ end
+ def replace_topobj(sym, obj) #=> old_obj (alias_filename or object) or nil
+ if old_obj = topobj_defined?(sym)
+ Object.class_eval{remove_const sym} rescue nil # ignore err
+ end
+ define_topobj(sym, obj)
+ old_obj
+ end
+ def replace_topalias(sym, obj) #=> old_obj (alias_filename or object) or nil
+ if old_obj = topalias_defined?(sym)
+ Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} rescue nil #ignore err
+ end
+ define_topalias(sym, obj)
+ old_obj
+ end
+ private :topobj_defined?, :topalias_defined?
+ private :define_topobj, :define_topalias
+ private :replace_topobj, :replace_topalias
+
+ def __regist_toplevel_aliases__(target, obj, *symbols)
+ # initial regist
+ @TOPLEVEL_ALIAS_TABLE[target = target.to_sym] ||= {}
+ symbols.each{|sym|
+ @TOPLEVEL_ALIAS_TABLE[target][sym = sym.to_sym] = obj
+ if !topalias_defined?(sym) || target == @current_default_widget_set
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj) unless obj.kind_of?(String) # NOT autoload
+ end
+ }
+ end
+
+ def regist_sym_for_loaded_file(auto, obj, sym)
+ @AUTOLOAD_FILE_SYM_TABLE[auto][sym] = obj
+
+ reg = /^#{Regexp.quote(auto)}(\.rb|\.so|)$/
+ @TOPLEVEL_ALIAS_TABLE.each_key{|set|
+ if @TOPLEVEL_ALIAS_TABLE[set][sym] =~ reg
+ @TOPLEVEL_ALIAS_TABLE[set][sym] = obj
+ if @TOPLEVEL_ALIAS_OWNER[sym].nil? || @TOPLEVEL_ALIAS_OWNER[sym] == set
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj) if set == @current_default_widget_set
+ end
+ end
+ }
+ if (f = Object.autoload?(sym)) && f =~ reg
+ replace_topobj(sym, obj)
+ end
+ if (f = Tk::TOPLEVEL_ALIASES.autoload?(sym)) && f =~ reg
+ replace_topalias(sym, obj)
+ end
+ end
+ private :regist_sym_for_loaded_file
+
+ def set_topalias(target, obj, sym)
+ # obj is a kind of String : define autoload path
+ # Class : use the class object
+ if target == @current_default_widget_set
+ case @TOPLEVEL_ALIAS_OWNER[sym]
+ when false
+ # Object::sym is out of control. --> not change
+ # Make ALIAS::sym under control, because target widget set is current.
+ # Keep OWNER[sym]
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+
+ when target
+ if current_obj = topobj_defined?(sym)
+ if current_obj == obj
+ # Make current_obj under control.
+ # Keep Object::sym.
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+
+ else # current_obj != obj
+ if current_obj == topalias_defined?(sym)
+ # Change controlled object
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+
+ else # current_obj != topalias_defined?(sym)
+ # Maybe current_obj is defined by user. --> OWNER[sym] = faise
+ # Keep Object::sym.
+ @TOPLEVEL_ALIAS_OWNER[sym] = false
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ end
+ end
+
+ else # NOT topobj_defined?(sym)
+ # New definition for sym at target.
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ define_topobj(sym, obj)
+ end
+
+ when nil
+ # New definition for sym at target.
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+
+ else # others
+ # Maybe planning to make sym under control.
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+ end
+
+ else # target != @current_default_widget_set
+ case @TOPLEVEL_ALIAS_OWNER[sym]
+ when false
+ # Object::sym is out of control. --> not change
+ if topalias_defined?(sym)
+ # ALIAS[sym] may be defined by other widget set.
+ # Keep Object::sym (even if it is not defined)
+ # Keep ALIAS[sym].
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+
+ else # NOT topalias_defined?(sym)
+ # Nobody controls ALIAS[sym].
+ # At leaset, current widget set doesn't control ALIAS[sym].
+ # Keep Object::sym (even if it is not defined)
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ define_topalias(sym, obj)
+ end
+
+ when target
+ # Maybe change controlled object, because Object::sym is under control.
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+
+ when nil
+ # New definition for sym
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+
+ else # others
+ # An other widget set controls sym.
+ # Keep Object::sym (even if it is not defined)
+ # Keep ALIAS[sym].
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
+
+ end
+ end
+
+ sym
+ end
+ private :set_topalias
+
+ def __set_toplevel_aliases__(target, obj, *symbols)
+ # obj is a kind of String : define autoload path
+ # Class : use the class object
+ target = target.to_sym
+ symbols.each{|sym| set_topalias(target, obj, sym.to_sym)}
+ end
+
+ def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols)
+ # autopath is an autoload file
+ # Currently, this method doesn't support that autoload loads
+ # different toplevels between <basename>.rb and <basename>.so extension.
+ shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath
+ target = target.to_sym
+ symbols.map!{|sym| sym.to_sym}
+
+ symbols.each{|sym| regist_sym_for_loaded_file(shortpath, obj, sym) }
+ symbols.each{|sym| set_topalias(target, obj, sym)}
+ end
+
+ def backup_current_topdef(sym)
+ return if (current = @current_default_widget_set).nil?
+
+ case @TOPLEVEL_ALIAS_OWNER[sym]
+ when false
+ # Object::sym is out of control.
+ if (cur_alias = topalias_defined?(sym)) && ! cur_alias.kind_of?(String)
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias
+ end
+
+ when current
+ if cur_obj = topobj_defined?(sym)
+ if ! cur_obj.kind_of?(String) && (cur_alias = topalias_defined?(sym))
+ if cur_alias.kind_of?(String)
+ # Mayby, user replaced Object::sym.
+ # Make Object::sym out of control.
+ @TOPLEVEL_ALIAS_OWNER[sym] = false
+ elsif cur_obj == cur_alias
+ # Possibley, defined normally. Backup it
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias
+ else
+ # Mayby, user replaced Object::sym.
+ # Make Object::sym out of control.
+ @TOPLEVEL_ALIAS_OWNER[sym] = false
+ end
+ end
+ else
+ # Mayby, user replaced Object::sym.
+ # Make Object::sym out of control.
+ @TOPLEVEL_ALIAS_OWNER[sym] = false
+ end
+
+ when nil
+ # Object::sym is out of control.
+ if (cur_alias = topalias_defined?(sym)) && ! cur_alias.kind_of?(String)
+ # Possibley, defined normally. Backup it.
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = cur_alias
+ end
+ else
+ # No authority to control Object::sym and ALIASES::sym.
+ # Do nothing.
+ end
+ end
+ private :backup_current_topdef
+
+ def _replace_toplevel_aliases(target)
+ # backup
+ @TOPLEVEL_ALIAS_TABLE[target].each_key{|sym|
+ backup_current_topdef(sym)
+ }
+
+ # replace
+ @TOPLEVEL_ALIAS_TABLE[target].each_key{|sym|
+ next if (obj = @TOPLEVEL_ALIAS_TABLE[target][sym]).nil?
+ if @TOPLEVEL_ALIAS_OWNER[sym] == false
+ # Object::sym is out of control. --> not change
+ # Keep OWNER[sym].
+ replace_topalias(sym, obj)
+ else
+ # New definition
+ @TOPLEVEL_ALIAS_OWNER[sym] = target
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+ end
+ }
+
+ # change default_widget_set
+ @current_default_widget_set = target
+ end
+ private :_replace_toplevel_aliases
+
+ def __import_toplevel_aliases__(target, *symbols)
+ current = @current_default_widget_set
+ symbols.each{|sym|
+ sym = sym.to_sym
+ if (obj = @TOPLEVEL_ALIAS_TABLE[target][sym]).nil?
+ # remove
+ @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
+ @TOPLEVEL_ALIAS_OWNER.delete(sym)
+ Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)
+ Object.class_eval{remove_const sym} if topobj_defined?(sym)
+
+ elsif obj == false
+ # remove, but OWNER[sym] <- false and not treat Object::sym
+ @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
+ @TOPLEVEL_ALIAS_OWNER[sym] = false
+ Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)
+
+ elsif @TOPLEVEL_ALIAS_OWNER[sym] == false
+ # Object::sym is out of control. --> not change
+ # Keep OWNER[sym].
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = obj
+ replace_topalias(sym, obj)
+
+ else
+ # new definition under control
+ @TOPLEVEL_ALIAS_OWNER[sym] = current
+ @TOPLEVEL_ALIAS_TABLE[current][sym] = obj
+ replace_topalias(sym, obj)
+ replace_topobj(sym, obj)
+ end
+ }
+ end
+
+ def __remove_toplevel_aliases__(*symbols)
+ # remove toplevel aliases of current widget set
+ current = @current_default_widget_set
+ symbols.each{|sym|
+ sym = sym.to_sym
+ @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
+ @TOPLEVEL_ALIAS_OWNER.delete(sym)
+ Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)
+ Object.class_eval{remove_const sym} if topobj_defined?(sym)
+ }
+ end
+
+ def __reset_toplevel_owner__(*symbols)
+ symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER.delete(sym.to_sym)}
+ end
+
+ def __disable_toplevel_control__(*symbols)
+ symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER[sym.to_sym] = false}
+ end
+
+ def __create_widget_set__(new_set, src_set={})
+ new_set = new_set.to_sym
+ if @TOPLEVEL_ALIAS_TABLE[new_set]
+ fail RuntimeError, "A widget-set #{new_set.inspect} is already exist."
+ end
+ if src_set.kind_of?(Symbol)
+ # new_set is an alias name of existed widget set.
+ @TOPLEVEL_ALIAS_TABLE[new_set] = @TOPLEVEL_ALIAS_TABLE[src_set]
+ else
+ @TOPLEVEL_ALIAS_TABLE[new_set] = {}
+ src_set.each{|sym, obj| set_topalias(new_set, obj, sym.to_sym) }
+ end
+ end
+end
+
+
+############################################
+# setup default widget set => :Tk
+Tk.default_widget_set = :Tk
+
+
+############################################
+# depend on the version of Tcl/Tk
+# major, minor, type, patchlevel = TclTkLib.get_version
+
+############################################
+# Ttk (Tile) support
+=begin
+if major > 8 ||
+ (major == 8 && minor > 5) ||
+ (major == 8 && minor == 5 && type >= TclTkLib::RELEASE_TYPE::BETA)
+ # Tcl/Tk 8.5 beta or later
+ Object.autoload :Ttk, 'tkextlib/tile'
+ Tk.autoload :Tile, 'tkextlib/tile'
+
+ require 'tk/ttk_selector'
+end
+=end
+Object.autoload :Ttk, 'tkextlib/tile'
+Tk.autoload :Tile, 'tkextlib/tile'
+require 'tk/ttk_selector'
diff --git a/ext/tk/lib/tk/bgerror.rb b/ext/tk/lib/tk/bgerror.rb
new file mode 100644
index 0000000000..c82a8e046b
--- /dev/null
+++ b/ext/tk/lib/tk/bgerror.rb
@@ -0,0 +1,29 @@
+#
+# tkbgerror -- bgerror ( tkerror ) module
+# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+module TkBgError
+ extend Tk
+
+ TkCommandNames = ['bgerror'.freeze].freeze
+
+ def bgerror(message)
+ tk_call('bgerror', message)
+ end
+ alias tkerror bgerror
+ alias show bgerror
+ module_function :bgerror, :tkerror, :show
+
+ def set_handler(hdlr = Proc.new) #==> handler :: proc{|msg| ...body... }
+ tk_call('proc', 'bgerror', 'msg', install_cmd(hdlr) + ' $msg')
+ end
+ def set_default
+ begin
+ tk_call('rename', 'bgerror', '')
+ rescue RuntimeError
+ end
+ end
+ module_function :set_handler, :set_default
+end
diff --git a/ext/tk/lib/tk/bindtag.rb b/ext/tk/lib/tk/bindtag.rb
new file mode 100644
index 0000000000..23b4e0b7c3
--- /dev/null
+++ b/ext/tk/lib/tk/bindtag.rb
@@ -0,0 +1,138 @@
+#
+# tk/bind.rb : control event binding
+#
+require 'tk'
+
+class TkBindTag
+ include TkBindCore
+
+ #BTagID_TBL = {}
+ BTagID_TBL = TkCore::INTERP.create_table
+
+ (Tk_BINDTAG_ID = ["btag".freeze, TkUtil.untrust("00000")]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ BTagID_TBL.mutex.synchronize{ BTagID_TBL.clear }
+ }
+
+ def TkBindTag.id2obj(id)
+ BTagID_TBL.mutex.synchronize{
+ (BTagID_TBL[id])? BTagID_TBL[id]: id
+ }
+ end
+
+=begin
+ def TkBindTag.new_by_name(name, *args, &b)
+ BTagID_TBL.mutex.synchronize{
+ return BTagID_TBL[name] if BTagID_TBL[name]
+ }
+
+ self.new.instance_eval{
+ BTagID_TBL.mutex.synchronize{
+ BTagID_TBL.delete @id
+ @id = name
+ BTagID_TBL[@id] = self
+ }
+ bind(*args, &b) if args != []
+ self
+ }
+ end
+=end
+ def TkBindTag.new_by_name(name, *args, &b)
+ obj = nil
+ BTagID_TBL.mutex.synchronize{
+ if BTagID_TBL[name]
+ obj = BTagID_TBL[name]
+ else
+ (obj = BTagID_TBL[name] = self.allocate).instance_eval{
+ @id = name
+ }
+ end
+ }
+ bind(*args, &b) if obj && args != []
+ obj
+ end
+
+ def initialize(*args, &b)
+ Tk_BINDTAG_ID.mutex.synchronize{
+ # @id = Tk_BINDTAG_ID.join('')
+ @id = Tk_BINDTAG_ID.join(TkCore::INTERP._ip_id_)
+ Tk_BINDTAG_ID[1].succ!
+ }
+ BTagID_TBL.mutex.synchronize{
+ BTagID_TBL[@id] = self
+ }
+ bind(*args, &b) if args != []
+ end
+
+ ALL = self.new_by_name('all')
+
+ def name
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def inspect
+ #Kernel.format "#<TkBindTag: %s>", @id
+ '#<TkBindTag: ' + @id + '>'
+ end
+end
+
+
+class TkBindTagAll<TkBindTag
+ def TkBindTagAll.new(*args, &b)
+ $stderr.puts "Warning: TkBindTagALL is obsolete. Use TkBindTag::ALL\n"
+
+ TkBindTag::ALL.bind(*args, &b) if args != []
+ TkBindTag::ALL
+ end
+end
+
+
+class TkDatabaseClass<TkBindTag
+=begin
+ def self.new(name, *args, &b)
+ BTagID_TBL.mutex.synchronize{
+ return BTagID_TBL[name] if BTagID_TBL[name]
+ }
+ super(name, *args, &b)
+ end
+
+ def initialize(name, *args, &b)
+ @id = name
+ BTagID_TBL.mutex.synchronize{
+ BTagID_TBL[@id] = self
+ }
+ bind(*args, &b) if args != []
+ end
+=end
+ def self.new(name, *args, &b)
+ BTagID_TBL.mutex.synchronize{
+ if BTagID_TBL[name]
+ BTagID_TBL[name]
+ else
+ BTagID_TBL[name] = self.allocate.instance_eval{
+ initialize(name, *args, &b)
+ self
+ }
+ end
+ }
+ end
+
+ def initialize(name, *args, &b)
+ @id = name
+ bind(*args, &b) if args != []
+ end
+
+ def inspect
+ #Kernel.format "#<TkDatabaseClass: %s>", @id
+ '#<TkDatabaseClass: ' + @id + '>'
+ end
+end
diff --git a/ext/tk/lib/tk/busy.rb b/ext/tk/lib/tk/busy.rb
new file mode 100644
index 0000000000..7f4f89f524
--- /dev/null
+++ b/ext/tk/lib/tk/busy.rb
@@ -0,0 +1,118 @@
+#
+# tk/busy.rb: support 'tk busy' command (Tcl/Tk8.6 or later)
+#
+require 'tk'
+
+module Tk::Busy
+ include TkCore
+ extend TkCore
+ extend TkItemConfigMethod
+end
+
+class << Tk::Busy
+ def __item_cget_cmd(win)
+ # maybe need to override
+ ['tk', 'busy', 'cget', win.path]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(win)
+ # maybe need to override
+ ['tk', 'busy', 'configure', win.path]
+ end
+ private :__item_config_cmd
+
+ def __item_confinfo_cmd(win)
+ # maybe need to override
+ __item_config_cmd(win)
+ end
+ private :__item_confinfo_cmd
+
+ alias cget_tkstring itemcget_tkstring
+ alias cget itemcget
+ alias cget_strict itemcget_strict
+ alias configure itemconfigure
+ alias configinfo itemconfiginfo
+ alias current_configinfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ def method_missing(id, *args)
+ name = id.id2name
+ case args.length
+ when 1
+ if name[-1] == ?=
+ configure name[0..-2], args[0]
+ args[0]
+ else
+ configure name, args[0]
+ self
+ end
+ when 0
+ begin
+ cget(name)
+ rescue
+ super(id, *args)
+ end
+ else
+ super(id, *args)
+ end
+ end
+
+ def hold(win, keys={})
+ tk_call_without_enc('tk', 'busy', 'hold', win, *hash_kv(keys))
+ win
+ end
+
+ def forget(*wins)
+ tk_call_without_enc('tk', 'busy', 'forget', *wins)
+ self
+ end
+
+ def current(pat=None)
+ list(tk_call('tk', 'busy', 'current', pat))
+ end
+
+ def status(win)
+ bool(tk_call_without_enc('tk', 'busy', 'status', win))
+ end
+end
+
+module Tk::Busy
+ def busy_configinfo(option=nil)
+ Tk::Busy.configinfo(self, option)
+ end
+
+ def busy_current_configinfo(option=nil)
+ Tk::Busy.current_configinfo(self, option)
+ end
+
+ def busy_configure(option, value=None)
+ Tk::Busy.configure(self, option, value)
+ self
+ end
+
+ def busy_cget(option)
+ Tk::Busy.configure(self, option)
+ end
+
+ def busy(keys={})
+ Tk::Busy.hold(self, keys)
+ self
+ end
+ alias busy_hold busy
+
+ def busy_forget
+ Tk::Busy.forget(self)
+ self
+ end
+
+ def busy_current?
+ ! Tk::Busy.current(self.path).empty?
+ end
+
+ def busy_status
+ Tk::Busy.status(self)
+ end
+end
diff --git a/ext/tk/lib/tk/button.rb b/ext/tk/lib/tk/button.rb
new file mode 100644
index 0000000000..65233c91b6
--- /dev/null
+++ b/ext/tk/lib/tk/button.rb
@@ -0,0 +1,31 @@
+#
+# tk/button.rb : treat button widget
+#
+require 'tk'
+require 'tk/label'
+
+class Tk::Button<Tk::Label
+ TkCommandNames = ['button'.freeze].freeze
+ WidgetClassName = 'Button'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('button', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('button', @path)
+ # end
+ #end
+ #private :create_self
+
+ def invoke
+ _fromUTF8(tk_send_without_enc('invoke'))
+ end
+ def flash
+ tk_send_without_enc('flash')
+ self
+ end
+end
+
+#TkButton = Tk::Button unless Object.const_defined? :TkButton
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Button, :TkButton)
+Tk.__set_loaded_toplevel_aliases__('tk/button.rb', :Tk, Tk::Button, :TkButton)
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb
new file mode 100644
index 0000000000..f3e9a7c229
--- /dev/null
+++ b/ext/tk/lib/tk/canvas.rb
@@ -0,0 +1,846 @@
+#
+# tk/canvas.rb - Tk canvas classes
+# by Yukihiro Matsumoto <matz@caelum.co.jp>
+#
+require 'tk'
+require 'tk/canvastag'
+require 'tk/itemconfig'
+require 'tk/scrollable'
+
+module TkCanvasItemConfig
+ include TkItemConfigMethod
+
+ def __item_strval_optkeys(id)
+ # maybe need to override
+ super(id) + [
+ 'fill', 'activefill', 'disabledfill',
+ 'outline', 'activeoutline', 'disabledoutline'
+ ]
+ end
+ private :__item_strval_optkeys
+
+ def __item_methodcall_optkeys(id)
+ {'coords'=>'coords'}
+ end
+ private :__item_methodcall_optkeys
+
+ def __item_val2ruby_optkeys(id) # { key=>proc, ... }
+ super(id).update('window'=>proc{|i, v| window(v)},
+ 'tags'=>proc{|i, v|
+ simplelist(v).collect{|tag| TkcTag.id2obj(self, tag)}
+ })
+ end
+ private :__item_val2ruby_optkeys
+
+ def __item_pathname(tagOrId)
+ if tagOrId.kind_of?(TkcItem) || tagOrId.kind_of?(TkcTag)
+ self.path + ';' + tagOrId.id.to_s
+ else
+ self.path + ';' + tagOrId.to_s
+ end
+ end
+ private :__item_pathname
+end
+
+class Tk::Canvas<TkWindow
+ include TkCanvasItemConfig
+ include Tk::Scrollable
+
+ TkCommandNames = ['canvas'.freeze].freeze
+ WidgetClassName = 'Canvas'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __destroy_hook__
+ TkcItem::CItemID_TBL.delete(@path)
+ end
+
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('canvas', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('canvas', @path)
+ # end
+ #end
+ #private :create_self
+
+ def __numval_optkeys
+ super() + ['closeenough']
+ end
+ private :__numval_optkeys
+
+ def __boolval_optkeys
+ super() + ['confine']
+ end
+ private :__boolval_optkeys
+
+ def tagid(tag)
+ if tag.kind_of?(TkcItem) || tag.kind_of?(TkcTag)
+ tag.id
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+ private :tagid
+
+
+ # create a canvas item without creating a TkcItem object
+ def create(type, *args)
+ if type.kind_of?(Class) && type < TkcItem
+ # do nothing
+ elsif TkcItem.type2class(type.to_s)
+ type = TkcItem.type2class(type.to_s)
+ else
+ fail ArgumentError, "type must a subclass of TkcItem class, or a string in CItemTypeToClass"
+ end
+ type.create(self, *args)
+ end
+
+ def addtag(tag, mode, *args)
+ mode = mode.to_s
+ if args[0] && mode =~ /^(above|below|with(tag)?)$/
+ args[0] = tagid(args[0])
+ end
+ tk_send_without_enc('addtag', tagid(tag), mode, *args)
+ self
+ end
+ def addtag_above(tagOrId, target)
+ addtag(tagOrId, 'above', tagid(target))
+ end
+ def addtag_all(tagOrId)
+ addtag(tagOrId, 'all')
+ end
+ def addtag_below(tagOrId, target)
+ addtag(tagOrId, 'below', tagid(target))
+ end
+ def addtag_closest(tagOrId, x, y, halo=None, start=None)
+ addtag(tagOrId, 'closest', x, y, halo, start)
+ end
+ def addtag_enclosed(tagOrId, x1, y1, x2, y2)
+ addtag(tagOrId, 'enclosed', x1, y1, x2, y2)
+ end
+ def addtag_overlapping(tagOrId, x1, y1, x2, y2)
+ addtag(tagOrId, 'overlapping', x1, y1, x2, y2)
+ end
+ def addtag_withtag(tagOrId, tag)
+ addtag(tagOrId, 'withtag', tagid(tag))
+ end
+
+ def bbox(tagOrId, *tags)
+ list(tk_send_without_enc('bbox', tagid(tagOrId),
+ *tags.collect{|t| tagid(t)}))
+ end
+
+ #def itembind(tag, context, cmd=Proc.new, *args)
+ # _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def itembind(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+
+ #def itembind_append(tag, context, cmd=Proc.new, *args)
+ # _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def itembind_append(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+
+ def itembind_remove(tag, context)
+ _bind_remove([path, "bind", tagid(tag)], context)
+ self
+ end
+
+ def itembindinfo(tag, context=nil)
+ _bindinfo([path, "bind", tagid(tag)], context)
+ end
+
+ def canvasx(screen_x, *args)
+ #tk_tcl2ruby(tk_send_without_enc('canvasx', screen_x, *args))
+ number(tk_send_without_enc('canvasx', screen_x, *args))
+ end
+ def canvasy(screen_y, *args)
+ #tk_tcl2ruby(tk_send_without_enc('canvasy', screen_y, *args))
+ number(tk_send_without_enc('canvasy', screen_y, *args))
+ end
+ alias canvas_x canvasx
+ alias canvas_y canvasy
+
+ def coords(tag, *args)
+ if args.empty?
+ tk_split_list(tk_send_without_enc('coords', tagid(tag)))
+ else
+ tk_send_without_enc('coords', tagid(tag), *(args.flatten))
+ self
+ end
+ end
+
+ def dchars(tag, first, last=None)
+ tk_send_without_enc('dchars', tagid(tag),
+ _get_eval_enc_str(first), _get_eval_enc_str(last))
+ self
+ end
+
+ def delete(*args)
+ tbl = nil
+ TkcItem::CItemID_TBL.mutex.synchronize{
+ tbl = TkcItem::CItemID_TBL[self.path]
+ }
+ if tbl
+ args.each{|tag|
+ find('withtag', tag).each{|item|
+ if item.kind_of?(TkcItem)
+ TkcItem::CItemID_TBL.mutex.synchronize{
+ tbl.delete(item.id)
+ }
+ end
+ }
+ }
+ end
+ tk_send_without_enc('delete', *args.collect{|t| tagid(t)})
+ self
+ end
+ alias remove delete
+
+ def dtag(tag, tag_to_del=None)
+ tk_send_without_enc('dtag', tagid(tag), tagid(tag_to_del))
+ self
+ end
+ alias deltag dtag
+
+ def find(mode, *args)
+ list(tk_send_without_enc('find', mode, *args)).collect!{|id|
+ TkcItem.id2obj(self, id)
+ }
+ end
+ def find_above(target)
+ find('above', tagid(target))
+ end
+ def find_all
+ find('all')
+ end
+ def find_below(target)
+ find('below', tagid(target))
+ end
+ def find_closest(x, y, halo=None, start=None)
+ find('closest', x, y, halo, start)
+ end
+ def find_enclosed(x1, y1, x2, y2)
+ find('enclosed', x1, y1, x2, y2)
+ end
+ def find_overlapping(x1, y1, x2, y2)
+ find('overlapping', x1, y1, x2, y2)
+ end
+ def find_withtag(tag)
+ find('withtag', tag)
+ end
+
+ def itemfocus(tagOrId=nil)
+ if tagOrId
+ tk_send_without_enc('focus', tagid(tagOrId))
+ self
+ else
+ ret = tk_send_without_enc('focus')
+ if ret == ""
+ nil
+ else
+ TkcItem.id2obj(self, ret)
+ end
+ end
+ end
+
+ def gettags(tagOrId)
+ list(tk_send_without_enc('gettags', tagid(tagOrId))).collect{|tag|
+ TkcTag.id2obj(self, tag)
+ }
+ end
+
+ def icursor(tagOrId, index)
+ tk_send_without_enc('icursor', tagid(tagOrId), index)
+ self
+ end
+
+ def imove(tagOrId, idx, x, y)
+ tk_send_without_enc('imove', tagid(tagOrId), idx, x, y)
+ self
+ end
+ alias i_move imove
+
+ def index(tagOrId, idx)
+ number(tk_send_without_enc('index', tagid(tagOrId), idx))
+ end
+
+ def insert(tagOrId, index, string)
+ tk_send_without_enc('insert', tagid(tagOrId), index,
+ _get_eval_enc_str(string))
+ self
+ end
+
+=begin
+ def itemcget(tagOrId, option)
+ case option.to_s
+ when 'dash', 'activedash', 'disableddash'
+ conf = tk_send_without_enc('itemcget', tagid(tagOrId), "-#{option}")
+ if conf =~ /^[0-9]/
+ list(conf)
+ else
+ conf
+ end
+ when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'
+ _fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId), "-#{option}"))
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_send('itemcget', tagid(tagOrId), "-#{option}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_with_enc('itemcget', tagid(tagOrId), '-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(tagid(tagOrId), fnt)
+ end
+ if option.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', tagid(tagOrId),
+ "-#{option}")))
+ end
+ end
+
+ def itemconfigure(tagOrId, key, value=None)
+ if key.kind_of? Hash
+ key = _symbolkey2str(key)
+ coords = key.delete('coords')
+ self.coords(tagOrId, coords) if coords
+
+ if ( key['font'] || key['kanjifont'] \
+ || key['latinfont'] || key['asciifont'] )
+ tagfont_configure(tagid(tagOrId), key.dup)
+ else
+ _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),
+ *hash_kv(key, true)))
+ end
+
+ else
+ if ( key == 'coords' || key == :coords )
+ self.coords(tagOrId, value)
+ elsif ( key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
+ key == 'asciifont' || key == :asciifont )
+ if value == None
+ tagfontobj(tagid(tagOrId))
+ else
+ tagfont_configure(tagid(tagOrId), {key=>value})
+ end
+ else
+ _fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),
+ "-#{key}", _get_eval_enc_str(value)))
+ end
+ end
+ self
+ end
+# def itemconfigure(tagOrId, key, value=None)
+# if key.kind_of? Hash
+# tk_send 'itemconfigure', tagid(tagOrId), *hash_kv(key)
+# else
+# tk_send 'itemconfigure', tagid(tagOrId), "-#{key}", value
+# end
+# end
+# def itemconfigure(tagOrId, keys)
+# tk_send 'itemconfigure', tagid(tagOrId), *hash_kv(keys)
+# end
+
+ def itemconfiginfo(tagOrId, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'coords'
+ return ['coords', '', '', '', self.coords(tagOrId)]
+ when 'dash', 'activedash', 'disableddash'
+ conf = tk_split_simplelist(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}"))
+ if conf[3] && conf[3] =~ /^[0-9]/
+ conf[3] = list(conf[3])
+ end
+ if conf[4] && conf[4] =~ /^[0-9]/
+ conf[4] = list(conf[4])
+ end
+ when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),"-#{key}")))
+ conf[4] = tagfont_configinfo(tagid(tagOrId), conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}")))
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ ret = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId)))).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'
+ when 'dash', 'activedash', 'disableddash'
+ if conf[3] && conf[3] =~ /^[0-9]/
+ conf[3] = list(conf[3])
+ end
+ if conf[4] && conf[4] =~ /^[0-9]/
+ conf[4] = list(conf[4])
+ end
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+
+ fontconf = ret.assoc('font')
+ if fontconf
+ ret.delete_if{|item| item[0] == 'font' || item[0] == 'kanjifont'}
+ fontconf[4] = tagfont_configinfo(tagid(tagOrId), fontconf[4])
+ ret.push(fontconf)
+ end
+
+ ret << ['coords', '', '', '', self.coords(tagOrId)]
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'coords'
+ {'coords' => ['', '', '', self.coords(tagOrId)]}
+ when 'dash', 'activedash', 'disableddash'
+ conf = tk_split_simplelist(tk_send_without_enc('itemconfigure',
+ tagid(tagOrId),
+ "-#{key}"))
+ if conf[3] && conf[3] =~ /^[0-9]/
+ conf[3] = list(conf[3])
+ end
+ if conf[4] && conf[4] =~ /^[0-9]/
+ conf[4] = list(conf[4])
+ end
+ when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId),"-#{key}")))
+ conf[4] = tagfont_configinfo(tagid(tagOrId), conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId), "-#{key}")))
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', tagid(tagOrId)))).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'
+ when 'dash', 'activedash', 'disableddash'
+ if conf[2] && conf[2] =~ /^[0-9]/
+ conf[2] = list(conf[2])
+ end
+ if conf[3] && conf[3] =~ /^[0-9]/
+ conf[3] = list(conf[3])
+ end
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+
+ fontconf = ret['font']
+ if fontconf
+ ret.delete('font')
+ ret.delete('kanjifont')
+ fontconf[3] = tagfont_configinfo(tagid(tagOrId), fontconf[3])
+ ret['font'] = fontconf
+ end
+
+ ret['coords'] = ['', '', '', self.coords(tagOrId)]
+
+ ret
+ end
+ end
+ end
+
+ def current_itemconfiginfo(tagOrId, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = itemconfiginfo(tagOrId, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ itemconfiginfo(tagOrId).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ itemconfiginfo(tagOrId, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+=end
+
+ def lower(tag, below=nil)
+ if below
+ tk_send_without_enc('lower', tagid(tag), tagid(below))
+ else
+ tk_send_without_enc('lower', tagid(tag))
+ end
+ self
+ end
+
+ def move(tag, dx, dy)
+ tk_send_without_enc('move', tagid(tag), dx, dy)
+ self
+ end
+
+ def moveto(tag, x, y)
+ # Tcl/Tk 8.6 or later
+ tk_send_without_enc('moveto', tagid(tag), x, y)
+ self
+ end
+ alias move_to moveto
+
+ def postscript(keys)
+ tk_send("postscript", *hash_kv(keys))
+ end
+
+ def raise(tag, above=nil)
+ if above
+ tk_send_without_enc('raise', tagid(tag), tagid(above))
+ else
+ tk_send_without_enc('raise', tagid(tag))
+ end
+ self
+ end
+
+ def rchars(tag, first, last, str_or_coords)
+ # Tcl/Tk 8.6 or later
+ str_or_coords = str_or_coords.flatten if str_or_coords.kinad_of? Array
+ tk_send_without_enc('rchars', tagid(tag), first, last, str_or_coords)
+ self
+ end
+ alias replace_chars rchars
+ alias replace_coords rchars
+
+ def scale(tag, x, y, xs, ys)
+ tk_send_without_enc('scale', tagid(tag), x, y, xs, ys)
+ self
+ end
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y, gain=None)
+ tk_send_without_enc('scan', 'dragto', x, y, gain)
+ self
+ end
+
+ def select(mode, *args)
+ r = tk_send_without_enc('select', mode, *args)
+ (mode == 'item')? TkcItem.id2obj(self, r): self
+ end
+ def select_adjust(tagOrId, index)
+ select('adjust', tagid(tagOrId), index)
+ end
+ def select_clear
+ select('clear')
+ end
+ def select_from(tagOrId, index)
+ select('from', tagid(tagOrId), index)
+ end
+ def select_item
+ select('item')
+ end
+ def select_to(tagOrId, index)
+ select('to', tagid(tagOrId), index)
+ end
+
+ def itemtype(tag)
+ TkcItem.type2class(tk_send('type', tagid(tag)))
+ end
+
+ def create_itemobj_from_id(idnum)
+ id = TkcItem.id2obj(self, idnum.to_i)
+ return id if id.kind_of?(TkcItem)
+
+ typename = tk_send('type', id)
+ unless type = TkcItem.type2class(typename)
+ (itemclass = typename.dup)[0,1] = typename[0,1].upcase
+ type = TkcItem.const_set(itemclass, Class.new(TkcItem))
+ type.const_set("CItemTypeName", typename.freeze)
+ TkcItem::CItemTypeToClass[typename] = type
+ end
+
+ canvas = self
+ (obj = type.allocate).instance_eval{
+ @parent = @c = canvas
+ @path = canvas.path
+ @id = id
+ TkcItem::CItemID_TBL.mutex.synchronize{
+ TkcItem::CItemID_TBL[@path] = {} unless TkcItem::CItemID_TBL[@path]
+ TkcItem::CItemID_TBL[@path][@id] = self
+ }
+ }
+ end
+end
+
+#TkCanvas = Tk::Canvas unless Object.const_defined? :TkCanvas
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Canvas, :TkCanvas)
+Tk.__set_loaded_toplevel_aliases__('tk/canvas.rb', :Tk, Tk::Canvas, :TkCanvas)
+
+
+class TkcItem<TkObject
+ extend Tk
+ include TkcTagAccess
+ extend TkItemFontOptkeys
+ extend TkItemConfigOptkeys
+
+ CItemTypeName = nil
+ CItemTypeToClass = {}
+
+ CItemID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ CItemID_TBL.mutex.synchronize{ CItemID_TBL.clear }
+ }
+
+ def TkcItem.type2class(type)
+ CItemTypeToClass[type]
+ end
+
+ def TkcItem.id2obj(canvas, id)
+ cpath = canvas.path
+ CItemID_TBL.mutex.synchronize{
+ if CItemID_TBL[cpath]
+ CItemID_TBL[cpath][id]? CItemID_TBL[cpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ ########################################
+ def self._parse_create_args(args)
+ fontkeys = {}
+ methodkeys = {}
+ if args[-1].kind_of? Hash
+ keys = _symbolkey2str(args.pop)
+ if args.size == 0
+ args = keys.delete('coords')
+ unless args.kind_of?(Array)
+ fail "coords parameter must be given by an Array"
+ end
+ end
+
+ #['font', 'kanjifont', 'latinfont', 'asciifont'].each{|key|
+ # fontkeys[key] = keys.delete(key) if keys.key?(key)
+ #}
+ __item_font_optkeys(nil).each{|key|
+ fkey = key.to_s
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "kanji#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "latin#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "ascii#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+ }
+
+ __item_optkey_aliases(nil).each{|alias_name, real_name|
+ alias_name = alias_name.to_s
+ if keys.has_key?(alias_name)
+ keys[real_name.to_s] = keys.delete(alias_name)
+ end
+ }
+
+ __item_methodcall_optkeys(nil).each{|key|
+ key = key.to_s
+ methodkeys[key] = keys.delete(key) if keys.key?(key)
+ }
+
+ __item_ruby2val_optkeys(nil).each{|key, method|
+ key = key.to_s
+ keys[key] = method.call(keys[key]) if keys.has_key?(key)
+ }
+
+ #args = args.flatten.concat(hash_kv(keys))
+ args = args.flatten.concat(itemconfig_hash_kv(nil, keys))
+ else
+ args = args.flatten
+ end
+
+ [args, fontkeys, methodkeys]
+ end
+ private_class_method :_parse_create_args
+
+ def self.create(canvas, *args)
+ unless self::CItemTypeName
+ fail RuntimeError, "#{self} is an abstract class"
+ end
+ args, fontkeys, methodkeys = _parse_create_args(args)
+ idnum = tk_call_without_enc(canvas.path, 'create',
+ self::CItemTypeName, *args)
+ canvas.itemconfigure(idnum, fontkeys) unless fontkeys.empty?
+ canvas.itemconfigure(idnum, methodkeys) unless methodkeys.empty?
+ idnum.to_i # 'canvas item id' is an integer number
+ end
+ ########################################
+
+ def initialize(parent, *args)
+ #unless parent.kind_of?(Tk::Canvas)
+ # fail ArgumentError, "expect Tk::Canvas for 1st argument"
+ #end
+ @parent = @c = parent
+ @path = parent.path
+
+ @id = create_self(*args) # an integer number as 'canvas item id'
+ CItemID_TBL.mutex.synchronize{
+ CItemID_TBL[@path] = {} unless CItemID_TBL[@path]
+ CItemID_TBL[@path][@id] = self
+ }
+ end
+ def create_self(*args)
+ self.class.create(@c, *args) # return an integer number as 'canvas item id'
+ end
+ private :create_self
+
+ def id
+ @id
+ end
+
+ def exist?
+ if @c.find_withtag(@id)
+ true
+ else
+ false
+ end
+ end
+
+ def delete
+ @c.delete @id
+ CItemID_TBL.mutex.synchronize{
+ CItemID_TBL[@path].delete(@id) if CItemID_TBL[@path]
+ }
+ self
+ end
+ alias remove delete
+ alias destroy delete
+end
+
+class TkcArc<TkcItem
+ CItemTypeName = 'arc'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcBitmap<TkcItem
+ CItemTypeName = 'bitmap'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcImage<TkcItem
+ CItemTypeName = 'image'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcLine<TkcItem
+ CItemTypeName = 'line'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcOval<TkcItem
+ CItemTypeName = 'oval'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcPolygon<TkcItem
+ CItemTypeName = 'polygon'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcRectangle<TkcItem
+ CItemTypeName = 'rectangle'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+end
+
+class TkcText<TkcItem
+ CItemTypeName = 'text'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ def self.create(canvas, *args)
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ txt = keys['text']
+ keys['text'] = _get_eval_enc_str(txt) if txt
+ args.push(keys)
+ end
+ super(canvas, *args)
+ end
+end
+
+class TkcWindow<TkcItem
+ CItemTypeName = 'window'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ def self.create(canvas, *args)
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ win = keys['window']
+ # keys['window'] = win.epath if win.kind_of?(TkWindow)
+ keys['window'] = _epath(win) if win
+ args.push(keys)
+ end
+ super(canvas, *args)
+ end
+end
diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb
new file mode 100644
index 0000000000..495d92a9a8
--- /dev/null
+++ b/ext/tk/lib/tk/canvastag.rb
@@ -0,0 +1,459 @@
+#
+# tk/canvastag.rb - methods for treating canvas tags
+#
+require 'tk'
+require 'tk/tagfont'
+
+module TkcTagAccess
+ include TkComm
+ include TkTreatTagFont
+end
+
+require 'tk/canvas'
+
+module TkcTagAccess
+ def addtag(tag)
+ @c.addtag(tag, 'withtag', @id)
+ self
+ end
+
+ def bbox
+ @c.bbox(@id)
+ end
+
+ #def bind(seq, cmd=Proc.new, *args)
+ # @c.itembind(@id, seq, cmd, *args)
+ # self
+ #end
+ def bind(seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @c.itembind(@id, seq, cmd, *args)
+ self
+ end
+
+ #def bind_append(seq, cmd=Proc.new, *args)
+ # @c.itembind_append(@id, seq, cmd, *args)
+ # self
+ #end
+ def bind_append(seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @c.itembind_append(@id, seq, cmd, *args)
+ self
+ end
+
+ def bind_remove(seq)
+ @c.itembind_remove(@id, seq)
+ self
+ end
+
+ def bindinfo(seq=nil)
+ @c.itembindinfo(@id, seq)
+ end
+
+ def cget_tkstring(option)
+ @c.itemcget_tkstring(@id, option)
+ end
+ def cget(option)
+ @c.itemcget(@id, option)
+ end
+ def cget_strict(option)
+ @c.itemcget_strict(@id, option)
+ end
+
+ def configure(key, value=None)
+ @c.itemconfigure(@id, key, value)
+ self
+ end
+# def configure(keys)
+# @c.itemconfigure @id, keys
+# end
+
+ def configinfo(key=nil)
+ @c.itemconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @c.current_itemconfiginfo(@id, key)
+ end
+
+ def coords(*args)
+ @c.coords(@id, *args)
+ end
+
+ def dchars(first, last=None)
+ @c.dchars(@id, first, last)
+ self
+ end
+
+ def dtag(tag_to_del=None)
+ @c.dtag(@id, tag_to_del)
+ self
+ end
+ alias deltag dtag
+
+ def find
+ @c.find('withtag', @id)
+ end
+ alias list find
+
+ def focus
+ @c.itemfocus(@id)
+ end
+
+ def gettags
+ @c.gettags(@id)
+ end
+
+ def icursor(index)
+ @c.icursor(@id, index)
+ self
+ end
+
+ def imove(idx, x, y)
+ # Tcl/Tk 8.6 or later
+ @c.imove(@id, idx, x, y)
+ self
+ end
+ alias i_move imove
+
+ def index(idx)
+ @c.index(@id, idx)
+ end
+
+ def insert(beforethis, string)
+ @c.insert(@id, beforethis, string)
+ self
+ end
+
+ def lower(belowthis=None)
+ @c.lower(@id, belowthis)
+ self
+ end
+
+ def move(xamount, yamount)
+ @c.move(@id, xamount, yamount)
+ self
+ end
+
+ def moveto(x, y)
+ # Tcl/Tk 8.6 or later
+ @c.moveto(@id, x, y)
+ self
+ end
+ alias move_to moveto
+
+ def raise(abovethis=None)
+ @c.raise(@id, abovethis)
+ self
+ end
+
+ def scale(xorigin, yorigin, xscale, yscale)
+ @c.scale(@id, xorigin, yorigin, xscale, yscale)
+ self
+ end
+
+ def rchars(first, last, str_or_coords)
+ # Tcl/Tk 8.6 or later
+ @c.rchars(@id, first, last, str_or_coords)
+ self
+ end
+ alias replace_chars rchars
+ alias replace_coords rchars
+
+ def select_adjust(index)
+ @c.select('adjust', @id, index)
+ self
+ end
+ def select_from(index)
+ @c.select('from', @id, index)
+ self
+ end
+ def select_to(index)
+ @c.select('to', @id, index)
+ self
+ end
+
+ def itemtype
+ @c.itemtype(@id)
+ end
+
+ # Following operators support logical expressions of canvas tags
+ # (for Tk8.3+).
+ # If tag1.path is 't1' and tag2.path is 't2', then
+ # ltag = tag1 & tag2; ltag.path => "(t1)&&(t2)"
+ # ltag = tag1 | tag2; ltag.path => "(t1)||(t2)"
+ # ltag = tag1 ^ tag2; ltag.path => "(t1)^(t2)"
+ # ltag = - tag1; ltag.path => "!(t1)"
+ def & (tag)
+ if tag.kind_of? TkObject
+ TkcTagString.new(@c, '(' + @id + ')&&(' + tag.path + ')')
+ else
+ TkcTagString.new(@c, '(' + @id + ')&&(' + tag.to_s + ')')
+ end
+ end
+
+ def | (tag)
+ if tag.kind_of? TkObject
+ TkcTagString.new(@c, '(' + @id + ')||(' + tag.path + ')')
+ else
+ TkcTagString.new(@c, '(' + @id + ')||(' + tag.to_s + ')')
+ end
+ end
+
+ def ^ (tag)
+ if tag.kind_of? TkObject
+ TkcTagString.new(@c, '(' + @id + ')^(' + tag.path + ')')
+ else
+ TkcTagString.new(@c, '(' + @id + ')^(' + tag.to_s + ')')
+ end
+ end
+
+ def -@
+ TkcTagString.new(@c, '!(' + @id + ')')
+ end
+end
+
+class TkcTag<TkObject
+ include TkcTagAccess
+
+ CTagID_TBL = TkCore::INTERP.create_table
+
+ (Tk_CanvasTag_ID = ['ctag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ CTagID_TBL.mutex.synchronize{ CTagID_TBL.clear }
+ }
+
+ def TkcTag.id2obj(canvas, id)
+ cpath = canvas.path
+ CTagID_TBL.mutex.synchronize{
+ if CTagID_TBL[cpath]
+ CTagID_TBL[cpath][id]? CTagID_TBL[cpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, mode=nil, *args)
+ #unless parent.kind_of?(TkCanvas)
+ # fail ArgumentError, "expect TkCanvas for 1st argument"
+ #end
+ @c = parent
+ @cpath = parent.path
+ Tk_CanvasTag_ID.mutex.synchronize{
+ # @path = @id = Tk_CanvasTag_ID.join('')
+ @path = @id = Tk_CanvasTag_ID.join(TkCore::INTERP._ip_id_)
+ Tk_CanvasTag_ID[1].succ!
+ }
+ CTagID_TBL.mutex.synchronize{
+ CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
+ CTagID_TBL[@cpath][@id] = self
+ }
+ if mode
+ tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
+ end
+ end
+ def id
+ @id
+ end
+
+ def exist?
+ if @c.find_withtag(@id)
+ true
+ else
+ false
+ end
+ end
+
+ def delete
+ @c.delete @id
+ CTagID_TBL.mutex.synchronize{
+ CTagID_TBL[@cpath].delete(@id) if CTagID_TBL[@cpath]
+ }
+ self
+ end
+ alias remove delete
+ alias destroy delete
+
+ def set_to_above(target)
+ @c.addtag_above(@id, target)
+ self
+ end
+ alias above set_to_above
+
+ def set_to_all
+ @c.addtag_all(@id)
+ self
+ end
+ alias all set_to_all
+
+ def set_to_below(target)
+ @c.addtag_below(@id, target)
+ self
+ end
+ alias below set_to_below
+
+ def set_to_closest(x, y, halo=None, start=None)
+ @c.addtag_closest(@id, x, y, halo, start)
+ self
+ end
+ alias closest set_to_closest
+
+ def set_to_enclosed(x1, y1, x2, y2)
+ @c.addtag_enclosed(@id, x1, y1, x2, y2)
+ self
+ end
+ alias enclosed set_to_enclosed
+
+ def set_to_overlapping(x1, y1, x2, y2)
+ @c.addtag_overlapping(@id, x1, y1, x2, y2)
+ self
+ end
+ alias overlapping set_to_overlapping
+
+ def set_to_withtag(target)
+ @c.addtag_withtag(@id, target)
+ self
+ end
+ alias withtag set_to_withtag
+end
+
+class TkcTagString<TkcTag
+ def self.new(parent, name, mode=nil, *args)
+ obj = nil
+ CTagID_TBL.mutex.synchronize{
+ if CTagID_TBL[parent.path] && CTagID_TBL[parent.path][name]
+ obj = CTagID_TBL[parent.path][name]
+ else
+ # super(parent, name, *args)
+ (obj = self.allocate).instance_eval{
+ @c = parent
+ @cpath = parent.path
+ @path = @id = name
+ CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
+ CTagID_TBL[@cpath][@id] = self
+ }
+ end
+ }
+ if obj && mode
+ tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
+ end
+ obj
+ end
+
+ def initialize(parent, name, mode=nil, *args)
+ # dummy:: not called by 'new' method
+
+ #unless parent.kind_of?(TkCanvas)
+ # fail ArgumentError, "expect TkCanvas for 1st argument"
+ #end
+ @c = parent
+ @cpath = parent.path
+ @path = @id = name
+
+ if mode
+ tk_call_without_enc(@c.path, "addtag", @id, mode, *args)
+ end
+ end
+end
+TkcNamedTag = TkcTagString
+
+class TkcTagAll<TkcTagString
+ def self.new(parent)
+ super(parent, 'all')
+ end
+=begin
+ def initialize(parent)
+ #unless parent.kind_of?(TkCanvas)
+ # fail ArgumentError, "expect TkCanvas for 1st argument"
+ #end
+ @c = parent
+ @cpath = parent.path
+ @path = @id = 'all'
+ CTagID_TBL.mutex.synchronize{
+ CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
+ CTagID_TBL[@cpath][@id] = self
+ }
+ end
+=end
+end
+
+class TkcTagCurrent<TkcTagString
+ def self.new(parent)
+ super(parent, 'current')
+ end
+=begin
+ def initialize(parent)
+ #unless parent.kind_of?(TkCanvas)
+ # fail ArgumentError, "expect TkCanvas for 1st argument"
+ #end
+ @c = parent
+ @cpath = parent.path
+ @path = @id = 'current'
+ CTagID_TBL.mutex.synchronize{
+ CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
+ CTagID_TBL[@cpath][@id] = self
+ }
+ end
+=end
+end
+
+class TkcGroup<TkcTag
+ (Tk_cGroup_ID = ['tkcg'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ #def create_self(parent, *args)
+ def initialize(parent, *args)
+ #unless parent.kind_of?(TkCanvas)
+ # fail ArgumentError, "expect TkCanvas for 1st argument"
+ #end
+ @c = parent
+ @cpath = parent.path
+ Tk_cGroup_ID.mutex.synchronize{
+ # @path = @id = Tk_cGroup_ID.join('')
+ @path = @id = Tk_cGroup_ID.join(TkCore::INTERP._ip_id_)
+ Tk_cGroup_ID[1].succ!
+ }
+ CTagID_TBL.mutex.synchronize{
+ CTagID_TBL[@cpath] = {} unless CTagID_TBL[@cpath]
+ CTagID_TBL[@cpath][@id] = self
+ }
+ include(*args) if args != []
+ end
+ #private :create_self
+
+ def include(*tags)
+ for i in tags
+ #i.addtag(@id)
+ @c.addtag_withtag(@id, i)
+ end
+ self
+ end
+ alias add include
+
+ def exclude(*tags)
+ for i in tags
+ #i.dtag(@id)
+ @c.dtag(i, @id)
+ end
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/checkbutton.rb b/ext/tk/lib/tk/checkbutton.rb
new file mode 100644
index 0000000000..b7449541c5
--- /dev/null
+++ b/ext/tk/lib/tk/checkbutton.rb
@@ -0,0 +1,32 @@
+#
+# tk/checkbutton.rb : treat checkbutton widget
+#
+require 'tk'
+require 'tk/radiobutton'
+
+class Tk::CheckButton<Tk::RadioButton
+ TkCommandNames = ['checkbutton'.freeze].freeze
+ WidgetClassName = 'Checkbutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('checkbutton', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('checkbutton', @path)
+ # end
+ #end
+ #private :create_self
+
+ def toggle
+ tk_send_without_enc('toggle')
+ self
+ end
+end
+
+Tk::Checkbutton = Tk::CheckButton
+#TkCheckButton = Tk::CheckButton unless Object.const_defined? :TkCheckButton
+#TkCheckbutton = Tk::Checkbutton unless Object.const_defined? :TkCheckbutton
+#Tk.__set_toplevel_aliases__(:Tk, Tk::CheckButton,
+# :TkCheckButton, :TkCheckbutton)
+Tk.__set_loaded_toplevel_aliases__('tk/checkbutton.rb', :Tk, Tk::CheckButton,
+ :TkCheckButton, :TkCheckbutton)
diff --git a/ext/tk/lib/tk/clipboard.rb b/ext/tk/lib/tk/clipboard.rb
new file mode 100644
index 0000000000..d4205a5c28
--- /dev/null
+++ b/ext/tk/lib/tk/clipboard.rb
@@ -0,0 +1,75 @@
+#
+# tk/clipboard.rb : methods to treat clipboard
+#
+require 'tk'
+
+module TkClipboard
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['clipboard'.freeze].freeze
+
+ def self.clear(win=nil)
+ if win
+ tk_call_without_enc('clipboard', 'clear', '-displayof', win)
+ else
+ tk_call_without_enc('clipboard', 'clear')
+ end
+ end
+ def self.clear_on_display(win)
+ tk_call_without_enc('clipboard', 'clear', '-displayof', win)
+ end
+
+ def self.get(type=nil)
+ if type
+ tk_call_without_enc('clipboard', 'get', '-type', type)
+ else
+ tk_call_without_enc('clipboard', 'get')
+ end
+ end
+ def self.get_on_display(win, type=nil)
+ if type
+ tk_call_without_enc('clipboard', 'get', '-displayof', win, '-type', type)
+ else
+ tk_call_without_enc('clipboard', 'get', '-displayof', win)
+ end
+ end
+
+ def self.set(data, keys=nil)
+ clear
+ append(data, keys)
+ end
+ def self.set_on_display(win, data, keys=nil)
+ clear(win)
+ append_on_display(win, data, keys)
+ end
+
+ def self.append(data, keys=nil)
+ args = ['clipboard', 'append']
+ args.concat(hash_kv(keys))
+ args.concat(['--', data])
+ tk_call(*args)
+ end
+ def self.append_on_display(win, data, keys=nil)
+ args = ['clipboard', 'append', '-displayof', win]
+ args.concat(hash_kv(keys))
+ args.concat(['--', data])
+ tk_call(*args)
+ end
+
+ def clear
+ TkClipboard.clear_on_display(self)
+ self
+ end
+ def get(type=nil)
+ TkClipboard.get_on_display(self, type)
+ end
+ def set(data, keys=nil)
+ TkClipboard.set_on_display(self, data, keys)
+ self
+ end
+ def append(data, keys=nil)
+ TkClipboard.append_on_display(self, data, keys)
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/clock.rb b/ext/tk/lib/tk/clock.rb
new file mode 100644
index 0000000000..4e9438f5ab
--- /dev/null
+++ b/ext/tk/lib/tk/clock.rb
@@ -0,0 +1,71 @@
+#
+# tk/clock.rb : methods for clock command
+#
+require 'tk'
+
+module Tk
+ module Clock
+ include Tk
+ extend TkCore
+
+ def self.add(clk, *args)
+ tk_call_without_enc('clock','add', clk, *args).to_i
+ end
+
+ def self.clicks(ms=nil)
+ ms = ms.to_s if ms.kind_of?(Symbol)
+ case ms
+ when nil, ''
+ tk_call_without_enc('clock','clicks').to_i
+ when /^mic/
+ tk_call_without_enc('clock','clicks','-microseconds').to_i
+ when /^mil/
+ tk_call_without_enc('clock','clicks','-milliseconds').to_i
+ else
+ tk_call_without_enc('clock','clicks','-milliseconds').to_i
+ end
+ end
+
+ def self.format(clk, form=nil)
+ if form
+ tk_call('clock','format',clk,'-format',form)
+ else
+ tk_call('clock','format',clk)
+ end
+ end
+
+ def self.formatGMT(clk, form=nil)
+ if form
+ tk_call('clock','format',clk,'-format',form,'-gmt','1')
+ else
+ tk_call('clock','format',clk,'-gmt','1')
+ end
+ end
+
+ def self.scan(str, base=nil)
+ if base
+ tk_call('clock','scan',str,'-base',base).to_i
+ else
+ tk_call('clock','scan',str).to_i
+ end
+ end
+
+ def self.scanGMT(str, base=nil)
+ if base
+ tk_call('clock','scan',str,'-base',base,'-gmt','1').to_i
+ else
+ tk_call('clock','scan',str,'-gmt','1').to_i
+ end
+ end
+
+ def self.seconds
+ tk_call_without_enc('clock','seconds').to_i
+ end
+ def self.milliseconds
+ tk_call_without_enc('clock','milliseconds').to_i
+ end
+ def self.microseconds
+ tk_call_without_enc('clock','microseconds').to_i
+ end
+ end
+end
diff --git a/ext/tk/lib/tk/composite.rb b/ext/tk/lib/tk/composite.rb
new file mode 100644
index 0000000000..e267c7a22b
--- /dev/null
+++ b/ext/tk/lib/tk/composite.rb
@@ -0,0 +1,484 @@
+#
+# tk/composite.rb :
+#
+require 'tk'
+
+module TkComposite
+ include Tk
+ extend Tk
+
+=begin
+ def initialize(parent=nil, *args)
+ @delegates = {}
+ @option_methods = {}
+ @option_setting = {}
+
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ @frame = TkFrame.new(parent)
+ @path = @epath = @frame.path
+ initialize_composite(keys)
+ else
+ @frame = TkFrame.new(parent)
+ @path = @epath = @frame.path
+ initialize_composite(*args)
+ end
+ end
+=end
+
+ def _choice_classname_of_baseframe
+ base_class_name = nil
+
+ klass = WidgetClassNames[self.class::WidgetClassName]
+
+ if klass
+ # WidgetClassName is a known class
+ #if klass <= TkFrame || klass < TkComposite
+ if klass <= TkFrame || klass < Tk::Frame || klass < TkComposite
+ # klass is valid for the base frame
+ if self.class <= klass
+ # use my classname
+ base_class_name = self.class.name
+ if base_class_name == ''
+ # anonymous class -> use ancestor's name
+ base_class_name = klass.name
+ end
+ else
+ # not subclass -> use WidgetClassName
+ base_class_name = klass.name
+ end
+
+ else
+ # klass is invalid for the base frame
+ #if self.class < TkFrame || self.class.superclass < TkComposite
+ if self.class < TkFrame || self.class.superclass < Tk::Frame || self.class.superclass < TkComposite
+ # my class name is valid for the base frame -> use my classname
+ base_class_name = self.class.name
+ if base_class_name == ''
+ # anonymous class -> use TkFrame
+ base_class_name = nil
+ end
+ else
+ # no idea for the base frame -> use TkFrame
+ base_class_name = nil
+ end
+ end
+
+ elsif self.class::WidgetClassName && ! self.class::WidgetClassName.empty?
+ # unknown WidgetClassName is defined -> use it for the base frame
+ base_class_name = self.class::WidgetClassName
+
+ else
+ # no valid WidgetClassName
+ #if self.class < TkFrame || self.class.superclass < TkComposite
+ if self.class < TkFrame || self.class.superclass < Tk::Frame || self.class.superclass < TkComposite
+ # my class name is valid for the base frame -> use my classname
+ base_class_name = self.class.name
+ if base_class_name == ''
+ # anonymous class -> use TkFrame
+ base_class_name = nil
+ end
+ else
+ # no idea for the base frame -> use TkFrame
+ base_class_name = nil
+ end
+ end
+
+ base_class_name
+ end
+ private :_choice_classname_of_baseframe
+
+ # def initialize(parent=nil, *args)
+ def initialize(*args)
+ @delegates = {}
+ @option_methods = {}
+ @option_setting = {}
+
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = {}
+ end
+ parent = args.shift
+ parent = keys.delete('parent') if keys.has_key?('parent')
+
+ if keys.key?('classname')
+ keys['class'] = keys.delete('classname')
+ end
+ if (base_class_name = (keys.delete('class')).to_s).empty?
+ base_class_name = _choice_classname_of_baseframe
+ end
+
+ if base_class_name
+ # @frame = Tk::Frame.new(parent, :class=>base_class_name)
+ # --> use current TkFrame class
+ @frame = TkFrame.new(parent, :class=>base_class_name)
+ else
+ # @frame = Tk::Frame.new(parent)
+ # --> use current TkFrame class
+ @frame = TkFrame.new(parent)
+ end
+ @path = @epath = @frame.path
+
+ args.push(keys) unless keys.empty?
+ initialize_composite(*args)
+ end
+
+ def database_classname
+ @frame.database_classname
+ end
+
+ def database_class
+ @frame.database_class
+ end
+
+ def epath
+ @epath
+ end
+
+ def initialize_composite(*args) end
+ private :initialize_composite
+
+ def inspect
+ str = super
+ str.chop << ' @epath=' << @epath.inspect << '>'
+ end
+
+ def _get_opt_method_list(arg)
+ m_set, m_cget, m_info = arg
+ m_set = m_set.to_s
+ m_cget = m_set if !m_cget && self.method(m_set).arity == -1
+ m_cget = m_cget.to_s if m_cget
+ m_info = m_info.to_s if m_info
+ [m_set, m_cget, m_info]
+ end
+ private :_get_opt_method_list
+
+ def option_methods(*opts)
+ if opts.size == 1 && opts[0].kind_of?(Hash)
+ # {name => [m_set, m_cget, m_info], name => method} style
+ opts[0].each{|name, arg|
+ m_set, m_cget, m_info = _get_opt_method_list(arg)
+ @option_methods[name.to_s] = {
+ :set => m_set, :cget => m_cget, :info => m_info
+ }
+ }
+ else
+ # [m_set, m_cget, m_info] or method style
+ opts.each{|arg|
+ m_set, m_cget, m_info = _get_opt_method_list(arg)
+ @option_methods[m_set] = {
+ :set => m_set, :cget => m_cget, :info => m_info
+ }
+ }
+ end
+ end
+
+ def delegate_alias(alias_opt, option, *wins)
+ if wins.length == 0
+ fail ArgumentError, "target widgets are not given"
+ end
+ if alias_opt != option && (alias_opt == 'DEFAULT' || option == 'DEFAULT')
+ fail ArgumentError, "cannot alias 'DEFAULT' option"
+ end
+ alias_opt = alias_opt.to_s
+ option = option.to_s
+ if @delegates[alias_opt].kind_of?(Array)
+ if (elem = @delegates[alias_opt].assoc(option))
+ wins.each{|w| elem[1].push(w)}
+ else
+ @delegates[alias_opt] << [option, wins]
+ end
+ else
+ @delegates[alias_opt] = [ [option, wins] ]
+ end
+ end
+
+ def delegate(option, *wins)
+ delegate_alias(option, option, *wins)
+ end
+
+ def __cget_delegates(slot)
+ slot = slot.to_s
+
+ if @option_methods.include?(slot)
+ if @option_methods[slot][:cget]
+ return self.__send__(@option_methods[slot][:cget])
+ else
+ if @option_setting[slot]
+ return @option_setting[slot]
+ else
+ return ''
+ end
+ end
+ end
+
+ tbl = @delegates[slot]
+ tbl = @delegates['DEFAULT'] unless tbl
+
+ begin
+ if tbl
+ opt, wins = tbl[-1]
+ opt = slot if opt == 'DEFAULT'
+ if wins && wins[-1]
+ # return wins[-1].cget(opt)
+ return wins[-1].cget_strict(opt)
+ end
+ end
+ rescue
+ end
+
+ return None
+ end
+ private :__cget_delegates
+
+ def cget_tkstring(slot)
+ if (ret = __cget_delegates(slot)) == None
+ super(slot)
+ else
+ _get_eval_string(ret)
+ end
+ end
+
+ def cget(slot)
+ if (ret = __cget_delegates(slot)) == None
+ super(slot)
+ else
+ ret
+ end
+ end
+
+ def cget_strict(slot)
+ if (ret = __cget_delegates(slot)) == None
+ super(slot)
+ else
+ ret
+ end
+ end
+
+=begin
+ def cget(slot)
+ slot = slot.to_s
+
+ if @option_methods.include?(slot)
+ if @option_methods[slot][:cget]
+ return self.__send__(@option_methods[slot][:cget])
+ else
+ if @option_setting[slot]
+ return @option_setting[slot]
+ else
+ return ''
+ end
+ end
+ end
+
+ tbl = @delegates[slot]
+ tbl = @delegates['DEFAULT'] unless tbl
+
+ begin
+ if tbl
+ opt, wins = tbl[-1]
+ opt = slot if opt == 'DEFAULT'
+ if wins && wins[-1]
+ return wins[-1].cget(opt)
+ end
+ end
+ rescue
+ end
+
+ super(slot)
+ end
+=end
+
+ def configure(slot, value=None)
+ if slot.kind_of? Hash
+ slot.each{|slot,value| configure slot, value}
+ return self
+ end
+
+ slot = slot.to_s
+
+ if @option_methods.include?(slot)
+ unless @option_methods[slot][:cget]
+ if value.kind_of?(Symbol)
+ @option_setting[slot] = value.to_s
+ else
+ @option_setting[slot] = value
+ end
+ end
+ return self.__send__(@option_methods[slot][:set], value)
+ end
+
+ tbl = @delegates[slot]
+ tbl = @delegates['DEFAULT'] unless tbl
+
+ begin
+ if tbl
+ last = nil
+ tbl.each{|opt, wins|
+ opt = slot if opt == 'DEFAULT'
+ wins.each{|w| last = w.configure(opt, value)}
+ }
+ return last
+ end
+ rescue
+ end
+
+ super(slot, value)
+ end
+
+ def configinfo(slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ slot = slot.to_s
+ if @option_methods.include?(slot)
+ if @option_methods[slot][:info]
+ return self.__send__(@option_methods[slot][:info])
+ else
+ return [slot, '', '', '', self.cget(slot)]
+ end
+ end
+
+ tbl = @delegates[slot]
+ tbl = @delegates['DEFAULT'] unless tbl
+
+ begin
+ if tbl
+ if tbl.length == 1
+ opt, wins = tbl[0]
+ if slot == opt || opt == 'DEFAULT'
+ return wins[-1].configinfo(slot)
+ else
+ info = wins[-1].configinfo(opt)
+ info[0] = slot
+ return info
+ end
+ else
+ opt, wins = tbl[-1]
+ return [slot, '', '', '', wins[-1].cget(opt)]
+ end
+ end
+ rescue
+ end
+
+ super(slot)
+
+ else # slot == nil
+ info_list = super(slot)
+
+ tbl = @delegates['DEFAULT']
+ if tbl
+ wins = tbl[0][1]
+ if wins && wins[-1]
+ wins[-1].configinfo.each{|info|
+ slot = info[0]
+ info_list.delete_if{|i| i[0] == slot} << info
+ }
+ end
+ end
+
+ @delegates.each{|slot, tbl|
+ next if slot == 'DEFAULT'
+ if tbl.length == 1
+ opt, wins = tbl[0]
+ next unless wins && wins[-1]
+ if slot == opt
+ info_list.delete_if{|i| i[0] == slot} <<
+ wins[-1].configinfo(slot)
+ else
+ info = wins[-1].configinfo(opt)
+ info[0] = slot
+ info_list.delete_if{|i| i[0] == slot} << info
+ end
+ else
+ opt, wins = tbl[-1]
+ info_list.delete_if{|i| i[0] == slot} <<
+ [slot, '', '', '', wins[-1].cget(opt)]
+ end
+ }
+
+ @option_methods.each{|slot, m|
+ if m[:info]
+ info = self.__send__(m[:info])
+ else
+ info = [slot, '', '', '', self.cget(slot)]
+ end
+ info_list.delete_if{|i| i[0] == slot} << info
+ }
+
+ info_list
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ slot = slot.to_s
+ if @option_methods.include?(slot)
+ if @option_methods[slot][:info]
+ return self.__send__(@option_methods[slot][:info])
+ else
+ return {slot => ['', '', '', self.cget(slot)]}
+ end
+ end
+
+ tbl = @delegates[slot]
+ tbl = @delegates['DEFAULT'] unless tbl
+
+ begin
+ if tbl
+ if tbl.length == 1
+ opt, wins = tbl[0]
+ if slot == opt || opt == 'DEFAULT'
+ return wins[-1].configinfo(slot)
+ else
+ return {slot => wins[-1].configinfo(opt)[opt]}
+ end
+ else
+ opt, wins = tbl[-1]
+ return {slot => ['', '', '', wins[-1].cget(opt)]}
+ end
+ end
+ rescue
+ end
+
+ super(slot)
+
+ else # slot == nil
+ info_list = super(slot)
+
+ tbl = @delegates['DEFAULT']
+ if tbl
+ wins = tbl[0][1]
+ info_list.update(wins[-1].configinfo) if wins && wins[-1]
+ end
+
+ @delegates.each{|slot, tbl|
+ next if slot == 'DEFAULT'
+ if tbl.length == 1
+ opt, wins = tbl[0]
+ next unless wins && wins[-1]
+ if slot == opt
+ info_list.update(wins[-1].configinfo(slot))
+ else
+ info_list.update({slot => wins[-1].configinfo(opt)[opt]})
+ end
+ else
+ opt, wins = tbl[-1]
+ info_list.update({slot => ['', '', '', wins[-1].cget(opt)]})
+ end
+ }
+
+ @option_methods.each{|slot, m|
+ if m[:info]
+ info = self.__send__(m[:info])
+ else
+ info = {slot => ['', '', '', self.cget(slot)]}
+ end
+ info_list.update(info)
+ }
+
+ info_list
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tk/console.rb b/ext/tk/lib/tk/console.rb
new file mode 100644
index 0000000000..64e257594c
--- /dev/null
+++ b/ext/tk/lib/tk/console.rb
@@ -0,0 +1,52 @@
+#
+# tk/console.rb : control the console on system without a real console
+#
+require 'tk'
+
+module TkConsole
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['console'.freeze, 'consoleinterp'.freeze].freeze
+
+ def self.create
+ TkCore::INTERP._create_console
+ end
+ self.create # initialize console
+
+ def self.title(str=None)
+ tk_call 'console', str
+ end
+ def self.hide
+ tk_call_without_enc('console', 'hide')
+ end
+ def self.show
+ tk_call_without_enc('console', 'show')
+ end
+ def self.eval(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _fromUTF8(tk_call_without_enc('console', 'eval',
+ _get_eval_enc_str(tcl_script)))
+ end
+ def self.maininterp_eval(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'eval',
+ _get_eval_enc_str(tcl_script)))
+
+ end
+ def self.maininterp_record(tcl_script)
+ #
+ # supports a Tcl script only
+ # I have no idea to support a Ruby script seamlessly.
+ #
+ _fromUTF8(tk_call_without_enc('consoleinterp', 'record',
+ _get_eval_enc_str(tcl_script)))
+
+ end
+end
diff --git a/ext/tk/lib/tk/dialog.rb b/ext/tk/lib/tk/dialog.rb
new file mode 100644
index 0000000000..7ef7820699
--- /dev/null
+++ b/ext/tk/lib/tk/dialog.rb
@@ -0,0 +1,326 @@
+#
+# tk/dialog.rb : create dialog boxes
+#
+require 'tk'
+require 'tk/variable.rb'
+
+class TkDialogObj < TkWindow
+ extend Tk
+
+ TkCommandNames = ['tk_dialog'.freeze].freeze
+
+ def self.show(*args)
+ dlog = self.new(*args)
+ dlog.show
+ dlog
+ end
+
+ def _set_button_config(configs)
+ set_config = proc{|c,i|
+ if $VERBOSE && (c.has_key?('command') || c.has_key?(:command))
+ STDERR.print("Warning: cannot give a command option " +
+ "to the dialog button#{i}. It was removed.\n")
+ end
+ c.delete('command'); c.delete(:command)
+ # @config << Kernel.format("%s.button%s configure %s; ",
+ # @path, i, hash_kv(c).join(' '))
+ # @config << @path+'.button'+i.to_s+' configure '+hash_kv(c).join(' ')+'; '
+ @config << @path+'.button'+i.to_s+' configure '+
+ array2tk_list(hash_kv(c))+'; '
+ }
+ case configs
+ when Proc
+ @buttons.each_index{|i|
+ if (c = configs.call(i)).kind_of?(Hash)
+ set_config.call(c,i)
+ end
+ }
+
+ when Array
+ @buttons.each_index{|i|
+ if (c = configs[i]).kind_of?(Hash)
+ set_config.call(c,i)
+ end
+ }
+
+ when Hash
+ @buttons.each_with_index{|s,i|
+ if (c = configs[s]).kind_of?(Hash)
+ set_config.call(c,i)
+ end
+ }
+ end
+ # @config = 'after idle {' + @config + '};' if @config != ""
+ @config = array2tk_list(['after', 'idle', @config]) << ';' if @config != ""
+ end
+ private :_set_button_config
+
+ # initialize tk_dialog
+ def create_self(keys)
+ # @var = TkVariable.new
+ @val = nil
+
+ @title = title
+
+ @message = message
+ @message_config = message_config
+ @msgframe_config = msgframe_config
+
+ @bitmap = bitmap
+ @bitmap_config = message_config
+
+ @default_button = default_button
+
+ @buttons = buttons
+ @button_configs = proc{|num| button_configs(num)}
+ @btnframe_config = btnframe_config
+
+ #@config = "puts [winfo children .w0000];"
+ @config = ""
+
+ @command = prev_command
+
+ if keys.kind_of?(Hash)
+ @title = keys['title'] if keys.key? 'title'
+ @message = keys['message'] if keys.key? 'message'
+ @bitmap = keys['bitmap'] if keys.key? 'bitmap'
+ # @bitmap = '{}' if @bitmap == nil || @bitmap == ""
+ @bitmap = '' unless @bitmap
+ @default_button = keys['default'] if keys.key? 'default'
+ @buttons = keys['buttons'] if keys.key? 'buttons'
+
+ @command = keys['prev_command'] if keys.key? 'prev_command'
+
+ @message_config = keys['message_config'] if keys.key? 'message_config'
+ @msgframe_config = keys['msgframe_config'] if keys.key? 'msgframe_config'
+ @bitmap_config = keys['bitmap_config'] if keys.key? 'bitmap_config'
+ @button_configs = keys['button_configs'] if keys.key? 'button_configs'
+ @btnframe_config = keys['btnframe_config'] if keys.key? 'btnframe_config'
+ end
+
+ #if @title.include? ?\s
+ # @title = '{' + @title + '}'
+ #end
+
+ if @buttons.kind_of?(Array)
+ _set_button_config(@buttons.collect{|cfg|
+ (cfg.kind_of? Array)? cfg[1]: nil})
+ @buttons = @buttons.collect{|cfg| (cfg.kind_of? Array)? cfg[0]: cfg}
+ end
+ if @buttons.kind_of?(Hash)
+ _set_button_config(@buttons)
+ @buttons = @buttons.keys
+ end
+ @buttons = tk_split_simplelist(@buttons) if @buttons.kind_of?(String)
+ @buttons = [] unless @buttons
+=begin
+ @buttons = @buttons.collect{|s|
+ if s.kind_of?(Array)
+ s = s.join(' ')
+ end
+ if s.include? ?\s
+ '{' + s + '}'
+ else
+ s
+ end
+ }
+=end
+
+ if @message_config.kind_of?(Hash)
+ # @config << Kernel.format("%s.msg configure %s;",
+ # @path, hash_kv(@message_config).join(' '))
+ # @config << @path+'.msg configure '+hash_kv(@message_config).join(' ')+';'
+ @config << @path+'.msg configure '+
+ array2tk_list(hash_kv(@message_config))+';'
+ end
+
+ if @msgframe_config.kind_of?(Hash)
+ # @config << Kernel.format("%s.top configure %s;",
+ # @path, hash_kv(@msgframe_config).join(' '))
+ # @config << @path+'.top configure '+hash_kv(@msgframe_config).join(' ')+';'
+ @config << @path+'.top configure '+
+ array2tk_list(hash_kv(@msgframe_config))+';'
+ end
+
+ if @btnframe_config.kind_of?(Hash)
+ # @config << Kernel.format("%s.bot configure %s;",
+ # @path, hash_kv(@btnframe_config).join(' '))
+ # @config << @path+'.bot configure '+hash_kv(@btnframe_config).join(' ')+';'
+ @config << @path+'.bot configure '+
+ array2tk_list(hash_kv(@btnframe_config))+';'
+ end
+
+ if @bitmap_config.kind_of?(Hash)
+ # @config << Kernel.format("%s.bitmap configure %s;",
+ # @path, hash_kv(@bitmap_config).join(' '))
+ # @config << @path+'.bitmap configure '+hash_kv(@bitmap_config).join(' ')+';'
+ @config << @path+'.bitmap configure '+
+ array2tk_list(hash_kv(@bitmap_config))+';'
+ end
+
+ _set_button_config(@button_configs) if @button_configs
+ end
+ private :create_self
+
+ def show
+ # if @command.kind_of?(Proc)
+ if TkComm._callback_entry?(@command)
+ @command.call(self)
+ end
+
+ if @default_button.kind_of?(String)
+ default_button = @buttons.index(@default_button)
+ else
+ default_button = @default_button
+ end
+ # default_button = '{}' if default_button == nil
+ default_button = '' if default_button == nil
+ #Tk.ip_eval('eval {global '+@var.id+';'+@config+
+ # 'set '+@var.id+' [tk_dialog '+
+ # @path+" "+@title+" {#{@message}} "+@bitmap+" "+
+ # String(default_button)+" "+@buttons.join(' ')+']}')
+ Tk.ip_eval(@config)
+ # @val = Tk.ip_eval('tk_dialog ' + @path + ' ' + @title +
+ # ' {' + @message + '} ' + @bitmap + ' ' +
+ # String(default_button) + ' ' + @buttons.join(' ')).to_i
+ # @val = Tk.ip_eval(self.class::TkCommandNames[0] + ' ' + @path + ' ' +
+ # @title + ' {' + @message + '} ' + @bitmap + ' ' +
+ # String(default_button) + ' ' + @buttons.join(' ')).to_i
+ @val = Tk.ip_eval(array2tk_list([
+ self.class::TkCommandNames[0],
+ @path, @title, @message, @bitmap,
+ String(default_button)
+ ].concat(@buttons))).to_i
+ end
+
+ def value
+ # @var.value.to_i
+ @val
+ end
+
+ def name
+ (@val)? @buttons[@val]: nil
+ end
+
+ ############################################################
+ # #
+ # following methods should be overridden for each dialog #
+ # #
+ ############################################################
+ private
+
+ def title
+ # returns a title string of the dialog window
+ return "DIALOG"
+ end
+ def message
+ # returns a message text to display on the dialog
+ return "MESSAGE"
+ end
+ def message_config
+ # returns a Hash {option=>value, ...} for the message text
+ return nil
+ end
+ def msgframe_config
+ # returns a Hash {option=>value, ...} for the message text frame
+ return nil
+ end
+ def bitmap
+ # returns a bitmap name or a bitmap file path
+ # (@ + path ; e.g. '@/usr/share/bitmap/sample.xbm')
+ return "info"
+ end
+ def bitmap_config
+ # returns nil or a Hash {option=>value, ...} for the bitmap
+ return nil
+ end
+ def default_button
+ # returns a default button's number or name
+ # if nil or null string, set no-default
+ return 0
+ end
+ def buttons
+ #return "BUTTON1 BUTTON2"
+ return ["BUTTON1", "BUTTON2"]
+ end
+ def button_configs(num)
+ # returns nil / Proc / Array or Hash (see _set_button_config)
+ return nil
+ end
+ def btnframe_config
+ # returns nil or a Hash {option=>value, ...} for the button frame
+ return nil
+ end
+ def prev_command
+ # returns nil or a Proc
+ return nil
+ end
+end
+TkDialog2 = TkDialogObj
+
+#
+# TkDialog : with showing at initialize
+#
+class TkDialog < TkDialogObj
+ def self.show(*args)
+ self.new(*args)
+ end
+
+ def initialize(*args)
+ super(*args)
+ show
+ end
+end
+
+
+#
+# dialog for warning
+#
+class TkWarningObj < TkDialogObj
+ def initialize(parent = nil, mes = nil)
+ if !mes
+ if parent.kind_of?(TkWindow)
+ mes = ""
+ else
+ mes = parent.to_s
+ parent = nil
+ end
+ end
+ super(parent, :message=>mes)
+ end
+
+ def show(mes = nil)
+ mes_bup = @message
+ @message = mes if mes
+ ret = super()
+ @message = mes_bup
+ ret
+ end
+
+ #######
+ private
+
+ def title
+ return "WARNING";
+ end
+ def bitmap
+ return "warning";
+ end
+ def default_button
+ return 0;
+ end
+ def buttons
+ return "OK";
+ end
+end
+TkWarning2 = TkWarningObj
+
+class TkWarning < TkWarningObj
+ def self.show(*args)
+ self.new(*args)
+ end
+ def initialize(*args)
+ super(*args)
+ show
+ end
+end
diff --git a/ext/tk/lib/tk/encodedstr.rb b/ext/tk/lib/tk/encodedstr.rb
new file mode 100644
index 0000000000..59fbb1911d
--- /dev/null
+++ b/ext/tk/lib/tk/encodedstr.rb
@@ -0,0 +1,187 @@
+#
+# tk/encodedstr.rb : Tk::EncodedString class
+#
+require 'tk'
+
+###########################################
+# string with Tcl's encoding
+###########################################
+module Tk
+ class EncodedString < String
+ Encoding = nil
+
+ def self.subst_utf_backslash(str)
+ # str.gsub(/\\u([0-9A-Fa-f]{1,4})/){[$1.hex].pack('U')}
+ TclTkLib._subst_UTF_backslash(str)
+ end
+ def self.utf_backslash(str)
+ self.subst_utf_backslash(str)
+ end
+
+ def self.subst_tk_backslash(str)
+ TclTkLib._subst_Tcl_backslash(str)
+ end
+
+ def self.utf_to_backslash_sequence(str)
+ str.unpack('U*').collect{|c|
+ if c <= 0xFF # ascii character
+ c.chr
+ else
+ format('\u%X', c)
+ end
+ }.join('')
+ end
+ def self.utf_to_backslash(str)
+ self.utf_to_backslash_sequence(str)
+ end
+
+ def self.to_backslash_sequence(str)
+ str.unpack('U*').collect{|c|
+ if c <= 0x1F # control character
+ case c
+ when 0x07; '\a'
+ when 0x08; '\b'
+ when 0x09; '\t'
+ when 0x0a; '\n'
+ when 0x0b; '\v'
+ when 0x0c; '\f'
+ when 0x0d; '\r'
+ else
+ format('\x%02X', c)
+ end
+ elsif c <= 0xFF # ascii character
+ c.chr
+ else
+ format('\u%X', c)
+ end
+ }.join('')
+ end
+
+ def self.new_with_utf_backslash(str, enc = nil)
+ self.new('', enc).replace(self.subst_utf_backslash(str))
+ end
+
+ def self.new_without_utf_backslash(str, enc = nil)
+ self.new('', enc).replace(str)
+ end
+
+ def initialize(str, enc = nil)
+ super(str)
+ # @encoding = ( enc ||
+ # ((self.class::Encoding)?
+ # self.class::Encoding : Tk.encoding_system) )
+ enc ||= (self.class::Encoding)?
+ self.class::Encoding :
+ ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
+ if TkCore::WITH_ENCODING
+ unless encobj = Tk::Encoding::ENCODING_TABLE.get_obj(enc)
+ fail ArgumentError, "unsupported Tk encoding '#{enc}'"
+ end
+ self.force_encoding(encobj)
+ else
+ @encoding = enc
+ end
+ end
+
+ if TkCore::WITH_ENCODING
+ alias encoding_obj encoding
+ alias __encoding encoding
+ def encoding
+ Tk::Encoding::ENCODING_TABLE.get_name(super())
+ end
+ else
+ def encoding
+ @encoding
+ end
+ alias encoding_obj encoding
+ end
+
+ if TkCore::WITH_ENCODING
+ # wrapper methods for compatibility
+ alias __instance_variable_get instance_variable_get
+ alias __instance_variable_set instance_variable_set
+ alias __instance_eval instance_eval
+ alias __instance_variables instance_variables
+
+ def instance_variable_get(key)
+ if (key.to_s == '@encoding')
+ self.encoding
+ else
+ super(key)
+ end
+ end
+
+ def instance_variable_set(key, value)
+ if (key.to_s == '@encoding')
+ if value
+ self.force_encoding(value)
+ else
+ self.force_encoding(Tk::Encoding::UNKNOWN)
+ end
+ value
+ else
+ super(key, value)
+ end
+ end
+
+ def instance_eval(*args, &b)
+ old_enc = @encoding = self.encoding
+
+ ret = super(*args, &b)
+
+ if @encoding
+ if @encoding != old_enc
+ # modified by user
+ self.force_encoding(@encoding)
+ end
+ remove_instance_variable(:@encoding)
+ else
+ begin
+ remove_instance_variable(:@encoding)
+ # user sets to nil -> use current default
+ self.force_encoding(Tk.encoding)
+ rescue NameError
+ # removed by user -> ignore, because user don't use @encoding
+ end
+ end
+ ret
+ end
+ end
+
+ def instance_variables
+ ret = super()
+ ret << :@encoding # fake !!
+ ret
+ end
+ end
+ # def Tk.EncodedString(str, enc = nil)
+ # Tk::EncodedString.new(str, enc)
+ # end
+
+ ##################################
+
+ class BinaryString < EncodedString
+ Encoding = 'binary'.freeze
+ end
+ # def Tk.BinaryString(str)
+ # Tk::BinaryString.new(str)
+ # end
+
+ ##################################
+
+ class UTF8_String < EncodedString
+ Encoding = 'utf-8'.freeze
+ def self.new(str)
+ super(self.subst_utf_backslash(str))
+ end
+
+ def to_backslash_sequence
+ Tk::EncodedString.utf_to_backslash_sequence(self)
+ end
+ alias to_backslash to_backslash_sequence
+ end
+ # def Tk.UTF8_String(str)
+ # Tk::UTF8_String.new(str)
+ # end
+
+end
diff --git a/ext/tk/lib/tk/entry.rb b/ext/tk/lib/tk/entry.rb
new file mode 100644
index 0000000000..d4aa03f2b6
--- /dev/null
+++ b/ext/tk/lib/tk/entry.rb
@@ -0,0 +1,120 @@
+#
+# tk/entry.rb - Tk entry classes
+# by Yukihiro Matsumoto <matz@caelum.co.jp>
+
+require 'tk'
+require 'tk/label'
+require 'tk/scrollable'
+require 'tk/validation'
+
+class Tk::Entry<Tk::Label
+ include X_Scrollable
+ include TkValidation
+
+ TkCommandNames = ['entry'.freeze].freeze
+ WidgetClassName = 'Entry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ #def create_self(keys)
+ # super(__conv_vcmd_on_hash_kv(keys))
+ #end
+ #private :create_self
+
+ def __strval_optkeys
+ super() + ['show', 'disabledbackground', 'readonlybackground']
+ end
+ private :__strval_optkeys
+
+ def bbox(index)
+ list(tk_send_without_enc('bbox', index))
+ end
+ def cursor
+ number(tk_send_without_enc('index', 'insert'))
+ end
+ alias icursor cursor
+ def cursor=(index)
+ tk_send_without_enc('icursor', index)
+ #self
+ index
+ end
+ alias icursor= cursor=
+ def index(idx)
+ number(tk_send_without_enc('index', idx))
+ end
+ def insert(pos,text)
+ tk_send_without_enc('insert', pos, _get_eval_enc_str(text))
+ self
+ end
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+ def mark(pos)
+ tk_send_without_enc('scan', 'mark', pos)
+ self
+ end
+ def dragto(pos)
+ tk_send_without_enc('scan', 'dragto', pos)
+ self
+ end
+ def selection_adjust(index)
+ tk_send_without_enc('selection', 'adjust', index)
+ self
+ end
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+ def selection_from(index)
+ tk_send_without_enc('selection', 'from', index)
+ self
+ end
+ def selection_present()
+ bool(tk_send_without_enc('selection', 'present'))
+ end
+ def selection_range(s, e)
+ tk_send_without_enc('selection', 'range', s, e)
+ self
+ end
+ def selection_to(index)
+ tk_send_without_enc('selection', 'to', index)
+ self
+ end
+
+ def invoke_validate
+ bool(tk_send_without_enc('validate'))
+ end
+ def validate(mode = nil)
+ if mode
+ configure 'validate', mode
+ else
+ invoke_validate
+ end
+ end
+
+ def value
+ _fromUTF8(tk_send_without_enc('get'))
+ end
+ def value= (val)
+ tk_send_without_enc('delete', 0, 'end')
+ tk_send_without_enc('insert', 0, _get_eval_enc_str(val))
+ val
+ end
+ alias get value
+ alias set value=
+
+ def [](*args)
+ self.value[*args]
+ end
+ def []=(*args)
+ val = args.pop
+ str = self.value
+ str[*args] = val
+ self.value = str
+ val
+ end
+end
+
+#TkEntry = Tk::Entry unless Object.const_defined? :TkEntry
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Entry, :TkEntry)
+Tk.__set_loaded_toplevel_aliases__('tk/entry.rb', :Tk, Tk::Entry, :TkEntry)
diff --git a/ext/tk/lib/tk/event.rb b/ext/tk/lib/tk/event.rb
new file mode 100644
index 0000000000..bf4e122322
--- /dev/null
+++ b/ext/tk/lib/tk/event.rb
@@ -0,0 +1,562 @@
+#
+# tk/event.rb - module for event
+#
+
+module TkEvent
+end
+
+########################
+
+require 'tkutil'
+require 'tk' unless Object.const_defined? :TkComm
+
+########################
+
+module TkEvent
+ class Event < TkUtil::CallbackSubst
+ module Grp
+ KEY = 0x1
+ BUTTON = 0x2
+ MOTION = 0x4
+ CROSSING = 0x8
+ FOCUS = 0x10
+ EXPOSE = 0x20
+ VISIBILITY = 0x40
+ CREATE = 0x80
+ DESTROY = 0x100
+ UNMAP = 0x200
+ MAP = 0x400
+ REPARENT = 0x800
+ CONFIG = 0x1000
+ GRAVITY = 0x2000
+ CIRC = 0x4000
+ PROP = 0x8000
+ COLORMAP = 0x10000
+ VIRTUAL = 0x20000
+ ACTIVATE = 0x40000
+ MAPREQ = 0x80000
+ CONFIGREQ = 0x100000
+ RESIZEREQ = 0x200000
+ CIRCREQ = 0x400000
+
+ MWHEEL = KEY
+
+ STRING_DATA = 0x80000000 # special flag for 'data' field
+
+ ALL = 0xFFFFFFFF
+
+ KEY_BUTTON_MOTION_VIRTUAL = (KEY|MWHEEL|BUTTON|MOTION|VIRTUAL)
+ KEY_BUTTON_MOTION_CROSSING = (KEY|MWHEEL|BUTTON|MOTION|CROSSING|VIRTUAL)
+ end
+
+ type_data = [
+ #-----+-------------------+------------------+-----------------------#
+ # ID | const | group_flag | context_name #
+ #-----+-------------------+------------------+-----------------------#
+ [ 2, :KeyPress, Grp::KEY, 'KeyPress', 'Key' ],
+ [ 3, :KeyRelease, Grp::KEY, 'KeyRelease' ],
+ [ 4, :ButtonPress, Grp::BUTTON, 'ButtonPress', 'Button' ],
+ [ 5, :ButtonRelease, Grp::BUTTON, 'ButtonRelease' ],
+ [ 6, :MotionNotify, Grp::MOTION, 'Motion' ],
+ [ 7, :EnterNotify, Grp::CROSSING, 'Enter' ],
+ [ 8, :LeaveNotify, Grp::CROSSING, 'Leave' ],
+ [ 9, :FocusIn, Grp::FOCUS, 'FocusIn' ],
+ [ 10, :FocusOut, Grp::FOCUS, 'FocusOut' ],
+ [ 11, :KeymapNotify, 0, ],
+ [ 12, :Expose, Grp::EXPOSE, 'Expose' ],
+ [ 13, :GraphicsExpose, Grp::EXPOSE, ],
+ [ 14, :NoExpose, 0, ],
+ [ 15, :VisibilityNotify, Grp::VISIBILITY, 'Visibility' ],
+ [ 16, :CreateNotify, Grp::CREATE, 'Create' ],
+ [ 17, :DestroyNotify, Grp::DESTROY, 'Destroy' ],
+ [ 18, :UnmapNotify, Grp::UNMAP, 'Unmap' ],
+ [ 19, :MapNotify, Grp::MAP, 'Map' ],
+ [ 20, :MapRequest, Grp::MAPREQ, 'MapRequest' ],
+ [ 21, :ReparentNotify, Grp::REPARENT, 'Reparent' ],
+ [ 22, :ConfigureNotify, Grp::CONFIG, 'Configure' ],
+ [ 23, :ConfigureRequest, Grp::CONFIGREQ, 'ConfigureRequest' ],
+ [ 24, :GravityNotify, Grp::GRAVITY, 'Gravity' ],
+ [ 25, :ResizeRequest, Grp::RESIZEREQ, 'ResizeRequest' ],
+ [ 26, :CirculateNotify, Grp::CIRC, 'Circulate' ],
+ [ 27, :CirculateRequest, 0, 'CirculateRequest' ],
+ [ 28, :PropertyNotify, Grp::PROP, 'Property' ],
+ [ 29, :SelectionClear, 0, ],
+ [ 30, :SelectionRequest, 0, ],
+ [ 31, :SelectionNotify, 0, ],
+ [ 32, :ColormapNotify, Grp::COLORMAP, 'Colormap' ],
+ [ 33, :ClientMessage, 0, ],
+ [ 34, :MappingNotify, 0, ],
+ [ 35, :VirtualEvent, Grp::VIRTUAL, ],
+ [ 36, :ActivateNotify, Grp::ACTIVATE, 'Activate' ],
+ [ 37, :DeactivateNotify, Grp::ACTIVATE, 'Deactivate' ],
+ [ 38, :MouseWheelEvent, Grp::MWHEEL, 'MouseWheel' ],
+ [ 39, :TK_LASTEVENT, 0, ]
+ ]
+
+ module TypeNum
+ end
+
+ TYPE_NAME_TBL = Hash.new
+ TYPE_ID_TBL = Hash.new
+ TYPE_GROUP_TBL = Hash.new
+
+ type_data.each{|id, c_name, g_flag, *t_names|
+ TypeNum.const_set(c_name, id)
+ t_names.each{|t_name| t_name.freeze; TYPE_NAME_TBL[t_name] = id }
+ TYPE_ID_TBL[id] = t_names
+ TYPE_GROUP_TBL[id] = g_flag
+ }
+
+ TYPE_NAME_TBL.freeze
+ TYPE_ID_TBL.freeze
+
+ def self.type_id(name)
+ TYPE_NAME_TBL[name.to_s]
+ end
+
+ def self.type_name(id)
+ TYPE_ID_TBL[id] && TYPE_ID_TBL[id][0]
+ end
+
+ def self.group_flag(id)
+ TYPE_GROUP_TBL[id] || 0
+ end
+
+ #############################################
+
+ module StateMask
+ ShiftMask = (1<<0)
+ LockMask = (1<<1)
+ ControlMask = (1<<2)
+ Mod1Mask = (1<<3)
+ Mod2Mask = (1<<4)
+ Mod3Mask = (1<<5)
+ Mod4Mask = (1<<6)
+ Mod5Mask = (1<<7)
+ Button1Mask = (1<<8)
+ Button2Mask = (1<<9)
+ Button3Mask = (1<<10)
+ Button4Mask = (1<<11)
+ Button5Mask = (1<<12)
+
+ AnyModifier = (1<<15)
+
+ META_MASK = (AnyModifier<<1)
+ ALT_MASK = (AnyModifier<<2)
+ EXTENDED_MASK = (AnyModifier<<3)
+
+ CommandMask = Mod1Mask
+ OptionMask = Mod2Mask
+ end
+
+ #############################################
+
+ FIELD_FLAG = {
+ # key => flag
+ 'above' => Grp::CONFIG,
+ 'borderwidth' => (Grp::CREATE|Grp::CONFIG),
+ 'button' => Grp::BUTTON,
+ 'count' => Grp::EXPOSE,
+ 'data' => (Grp::VIRTUAL|Grp::STRING_DATA),
+ 'delta' => Grp::MWHEEL,
+ 'detail' => (Grp::FOCUS|Grp::CROSSING),
+ 'focus' => Grp::CROSSING,
+ 'height' => (Grp::EXPOSE|Grp::CONFIG),
+ 'keycode' => Grp::KEY,
+ 'keysym' => Grp::KEY,
+ 'mode' => (Grp::CROSSING|Grp::FOCUS),
+ 'override' => (Grp::CREATE|Grp::MAP|Grp::REPARENT|Grp::CONFIG),
+ 'place' => Grp::CIRC,
+ 'root' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING),
+ 'rootx' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING),
+ 'rooty' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING),
+ 'sendevent' => Grp::ALL,
+ 'serial' => Grp::ALL,
+ 'state' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|
+ Grp::CROSSING|Grp::VISIBILITY),
+ 'subwindow' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING),
+ 'time' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING|
+ Grp::PROP),
+ 'warp' => Grp::KEY_BUTTON_MOTION_VIRTUAL,
+ 'width' => (Grp::EXPOSE|Grp::CREATE|Grp::CONFIG),
+ 'window' => (Grp::CREATE|Grp::UNMAP|Grp::MAP|Grp::REPARENT|
+ Grp::CONFIG|Grp::GRAVITY|Grp::CIRC),
+ 'when' => Grp::ALL,
+ 'x' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING|
+ Grp::EXPOSE|Grp::CREATE|Grp::CONFIG|Grp::GRAVITY|
+ Grp::REPARENT),
+ 'y' => (Grp::KEY_BUTTON_MOTION_VIRTUAL|Grp::CROSSING|
+ Grp::EXPOSE|Grp::CREATE|Grp::CONFIG|Grp::GRAVITY|
+ Grp::REPARENT),
+ }
+
+ FIELD_OPERATION = {
+ 'root' => proc{|val|
+ begin
+ Tk.tk_call_without_enc('winfo', 'pathname', val)
+ val
+ rescue
+ nil
+ end
+ },
+
+ 'subwindow' => proc{|val|
+ begin
+ Tk.tk_call_without_enc('winfo', 'pathname', val)
+ val
+ rescue
+ nil
+ end
+ },
+
+ 'window' => proc{|val| nil}
+ }
+
+ #-------------------------------------------
+
+ def valid_fields(group_flag=nil)
+ group_flag = self.class.group_flag(self.type) unless group_flag
+
+ fields = {}
+ FIELD_FLAG.each{|key, flag|
+ next if (flag & group_flag) == 0
+ begin
+ val = self.__send__(key)
+ rescue
+ next
+ end
+ # next if !val || val == '??'
+ next if !val || (val == '??' && (flag & Grp::STRING_DATA))
+ fields[key] = val
+ }
+
+ fields
+ end
+
+ def valid_for_generate(group_flag=nil)
+ fields = valid_fields(group_flag)
+
+ FIELD_OPERATION.each{|key, cmd|
+ next unless fields.has_key?(key)
+ val = FIELD_OPERATION[key].call(fields[key])
+ if val
+ fields[key] = val
+ else
+ fields.delete(key)
+ end
+ }
+
+ fields
+ end
+
+ def generate(win, modkeys={})
+ klass = self.class
+
+ if modkeys.has_key?(:type) || modkeys.has_key?('type')
+ modkeys = TkComm._symbolkey2str(modkeys)
+ type_id = modkeys.delete('type')
+ else
+ type_id = self.type
+ end
+
+ type_name = klass.type_name(type_id)
+ unless type_name
+ fail RuntimeError, "type_id #{type_id} is invalid"
+ end
+
+ group_flag = klass.group_flag(type_id)
+
+ opts = valid_for_generate(group_flag)
+
+ modkeys.each{|key, val|
+ if val
+ opts[key.to_s] = val
+ else
+ opts.delete(key.to_s)
+ end
+ }
+
+ if group_flag != Grp::KEY
+ Tk.event_generate(win, type_name, opts)
+ else
+ # If type is KEY event, focus should be set to target widget.
+ # If not set, original widget will get the same event.
+ # That will make infinite loop.
+ w = Tk.tk_call_without_enc('focus')
+ begin
+ Tk.tk_call_without_enc('focus', win)
+ Tk.event_generate(win, type_name, opts)
+ ensure
+ Tk.tk_call_without_enc('focus', w)
+ end
+ end
+ end
+
+ #############################################
+
+ # [ <'%' subst-key char>, <proc type char>, <instance var (accessor) name>]
+ KEY_TBL = [
+ [ ?#, ?n, :serial ],
+ [ ?a, ?s, :above ],
+ [ ?b, ?n, :num ],
+ [ ?c, ?n, :count ],
+ [ ?d, ?s, :detail ],
+ # ?e
+ [ ?f, ?b, :focus ],
+ # ?g
+ [ ?h, ?n, :height ],
+ [ ?i, ?s, :win_hex ],
+ # ?j
+ [ ?k, ?n, :keycode ],
+ # ?l
+ [ ?m, ?s, :mode ],
+ # ?n
+ [ ?o, ?b, :override ],
+ [ ?p, ?s, :place ],
+ # ?q
+ # ?r
+ [ ?s, ?x, :state ],
+ [ ?t, ?n, :time ],
+ # ?u
+ [ ?v, ?n, :value_mask ],
+ [ ?w, ?n, :width ],
+ [ ?x, ?n, :x ],
+ [ ?y, ?n, :y ],
+ # ?z
+ [ ?A, ?s, :char ],
+ [ ?B, ?n, :borderwidth ],
+ # ?C
+ [ ?D, ?n, :wheel_delta ],
+ [ ?E, ?b, :send_event ],
+ # ?F
+ # ?G
+ # ?H
+ # ?I
+ # ?J
+ [ ?K, ?s, :keysym ],
+ # ?L
+ # ?M
+ [ ?N, ?n, :keysym_num ],
+ # ?O
+ [ ?P, ?s, :property ],
+ # ?Q
+ [ ?R, ?s, :rootwin_id ],
+ [ ?S, ?s, :subwindow ],
+ [ ?T, ?n, :type ],
+ # ?U
+ # ?V
+ [ ?W, ?w, :widget ],
+ [ ?X, ?n, :x_root ],
+ [ ?Y, ?n, :y_root ],
+ # ?Z
+ nil
+ ]
+
+ # [ <'%' subst-key str>, <proc type char>, <instance var (accessor) name>]
+ # the subst-key string will be converted to a bytecode (128+idx).
+ LONGKEY_TBL = [
+ # for example, for %CTT and %CST subst-key on tkdnd-2.0
+ # ['CTT', ?l, :drop_target_type],
+ # ['CST', ?l, :drop_source_type],
+ ]
+
+ # [ <proc type char>, <proc/method to convert tcl-str to ruby-obj>]
+ PROC_TBL = [
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?b, TkComm.method(:bool) ],
+ [ ?w, TkComm.method(:window) ],
+
+ [ ?x, proc{|val|
+ begin
+ TkComm::number(val)
+ rescue ArgumentError
+ val
+ end
+ }
+ ],
+
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ # setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys
+ #
+ # _get_subst_key() and _get_all_subst_keys() generates key-string
+ # which describe how to convert callback arguments to ruby objects.
+ # When binding parameters are given, use _get_subst_key().
+ # But when no parameters are given, use _get_all_subst_keys() to
+ # create a Event class object as a callback parameter.
+ #
+ # scan_args() is used when doing callback. It convert arguments
+ # ( which are Tcl strings ) to ruby objects based on the key string
+ # that is generated by _get_subst_key() or _get_all_subst_keys().
+ #
+ _setup_subst_table(KEY_TBL, PROC_TBL)
+ # _setup_subst_table(KEY_TBL, LONGKEY_TBL, PROC_TBL) # if use longname-keys
+
+ #
+ # NOTE: The order of parameters which passed to callback procedure is
+ # <extra_arg>, <extra_arg>, ... , <subst_arg>, <subst_arg>, ...
+ #
+
+ # If you need support extra arguments given by Tcl/Tk,
+ # please override _get_extra_args_tbl
+ #
+ #def self._get_extra_args_tbl
+ # # return an array of convert procs
+ # []
+ #end
+
+=begin
+ alias button num
+ alias delta wheel_delta
+ alias root rootwin_id
+ alias rootx x_root
+ alias root_x x_root
+ alias rooty y_root
+ alias root_y y_root
+ alias sendevent send_event
+=end
+ ALIAS_TBL = {
+ :button => :num,
+ :data => :detail,
+ :delta => :wheel_delta,
+ :root => :rootwin_id,
+ :rootx => :x_root,
+ :root_x => :x_root,
+ :rooty => :y_root,
+ :root_y => :y_root,
+ :sendevent => :send_event,
+ :window => :widget
+ }
+
+ _define_attribute_aliases(ALIAS_TBL)
+
+ end
+
+ ###############################################
+
+ def install_bind_for_event_class(klass, cmd, *args)
+ extra_args_tbl = klass._get_extra_args_tbl
+
+ if args.compact.size > 0
+ args.map!{|arg| klass._sym2subst(arg)}
+ args = args.join(' ')
+ keys = klass._get_subst_key(args)
+
+ if cmd.kind_of?(String)
+ id = cmd
+ elsif cmd.kind_of?(TkCallbackEntry)
+ id = install_cmd(cmd)
+ else
+ id = install_cmd(proc{|*arg|
+ ex_args = []
+ extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
+ begin
+ TkUtil.eval_cmd(cmd, *(ex_args.concat(klass.scan_args(keys, arg))))
+ rescue Exception=>e
+ if TkCore::INTERP.kind_of?(TclTkIp)
+ fail e
+ else
+ # MultiTkIp
+ fail Exception, "#{e.class}: #{e.message.dup}"
+ end
+ end
+ })
+ end
+ elsif cmd.respond_to?(:arity) && cmd.arity == 0 # args.size == 0
+ args = ''
+ if cmd.kind_of?(String)
+ id = cmd
+ elsif cmd.kind_of?(TkCallbackEntry)
+ id = install_cmd(cmd)
+ else
+ id = install_cmd(proc{
+ begin
+ TkUtil.eval_cmd(cmd)
+ rescue Exception=>e
+ if TkCore::INTERP.kind_of?(TclTkIp)
+ fail e
+ else
+ # MultiTkIp
+ fail Exception, "#{e.class}: #{e.message.dup}"
+ end
+ end
+ })
+ end
+ else
+ keys, args = klass._get_all_subst_keys
+
+ if cmd.kind_of?(String)
+ id = cmd
+ elsif cmd.kind_of?(TkCallbackEntry)
+ id = install_cmd(cmd)
+ else
+ id = install_cmd(proc{|*arg|
+ ex_args = []
+ extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
+ begin
+ TkUtil.eval_cmd(cmd, *(ex_args << klass.new(*klass.scan_args(keys, arg))))
+ rescue Exception=>e
+ if TkCore::INTERP.kind_of?(TclTkIp)
+ fail e
+ else
+ # MultiTkIp
+ fail Exception, "#{e.class}: #{e.message.dup}"
+ end
+ end
+ })
+ end
+ end
+
+ if TkCore::INTERP.kind_of?(TclTkIp)
+ id + ' ' + args
+ else
+ # MultiTkIp
+ "if {[set st [catch {#{id} #{args}} ret]] != 0} {
+ if {$st == 4} {
+ return -code continue $ret
+ } elseif {$st == 3} {
+ return -code break $ret
+ } elseif {$st == 2} {
+ return -code return $ret
+ } elseif {[regexp {^Exception: (TkCallbackContinue: .*)$} \
+ $ret m msg]} {
+ return -code continue $msg
+ } elseif {[regexp {^Exception: (TkCallbackBreak: .*)$} $ret m msg]} {
+ return -code break $msg
+ } elseif {[regexp {^Exception: (TkCallbackReturn: .*)$} $ret m msg]} {
+ return -code return $msg
+ } elseif {[regexp {^Exception: (\\S+: .*)$} $ret m msg]} {
+ return -code return $msg
+ } else {
+ return -code error $ret
+ }
+ } else {
+ set ret
+ }"
+ end
+ end
+
+ def install_bind(cmd, *args)
+ install_bind_for_event_class(TkEvent::Event, cmd, *args)
+ end
+end
diff --git a/ext/tk/lib/tk/font.rb b/ext/tk/lib/tk/font.rb
new file mode 100644
index 0000000000..03db850f96
--- /dev/null
+++ b/ext/tk/lib/tk/font.rb
@@ -0,0 +1,2351 @@
+#
+# tk/font.rb - the class to treat fonts on Ruby/Tk
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+class TkFont
+ include Tk
+ extend TkCore
+
+ TkCommandNames = ['font'.freeze].freeze
+
+ (Tk_FontID = ["@font".freeze, TkUtil.untrust("00000")]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ Tk_FontNameTBL = TkCore::INTERP.create_table
+ Tk_FontUseTBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ Tk_FontNameTBL.mutex.synchronize{ Tk_FontNameTBL.clear }
+ Tk_FontUseTBL.mutex.synchronize{ Tk_FontUseTBL.clear }
+ }
+
+ # option_type : default => string
+ OptionType = Hash.new(?s)
+ OptionType['size'] = ?n
+ OptionType['pointadjust'] = ?n
+ OptionType['underline'] = ?b
+ OptionType['overstrike'] = ?b
+
+ # metric_type : default => num_or_str
+ MetricType = Hash.new(?n)
+ MetricType['fixed'] = ?b
+
+ # system font names
+ SYSTEM_FONT_NAMES = []
+ def SYSTEM_FONT_NAMES.add(font_names)
+ (@mutex ||= Mutex.new).synchronize{
+ self.replace(self | font_names.map{|name| name.to_s})
+ }
+ end
+ def SYSTEM_FONT_NAMES.include?(name)
+ (@mutex ||= Mutex.new).synchronize{
+ super(name.to_s)
+ }
+ end
+
+ # set default font
+ case Tk::TK_VERSION
+ when /^4\..*/
+ DEFAULT_LATIN_FONT_NAME = 'a14'.freeze
+ DEFAULT_KANJI_FONT_NAME = 'k14'.freeze
+
+ when /^8\.[0-4]/
+ if JAPANIZED_TK
+ begin
+ fontnames = tk_call('font', 'names')
+ case fontnames
+ when /defaultgui/
+ # Tcl/Tk-JP for Windows
+ ltn = 'defaultgui'
+ knj = 'defaultgui'
+ when /Mincho:Helvetica-Bold-12/
+ # Tcl/Tk-JP for UNIX/X
+ ltn, knj = tk_split_simplelist(tk_call('font', 'configure',
+ 'Mincho:Helvetica-Bold-12',
+ '-compound'))
+ else
+ # unknown Tcl/Tk-JP
+ #platform = tk_call('set', 'tcl_platform(platform)')
+ platform = Tk::PLATFORM['platform']
+ case platform
+ when 'unix'
+ ltn = {'family'=>'Helvetica'.freeze,
+ 'size'=>-12, 'weight'=>'bold'.freeze}
+ #knj = 'k14'
+ #knj = '-misc-fixed-medium-r-normal--14-*-*-*-c-*-jisx0208.1983-0'
+ knj = '-*-fixed-bold-r-normal--12-*-*-*-c-*-jisx0208.1983-0'
+ when 'windows'
+ ltn = {'family'=>'MS Sans Serif'.freeze, 'size'=>8}
+ knj = 'mincho'
+ when 'macintosh'
+ ltn = 'system'
+ knj = 'mincho'
+ else # unknown
+ ltn = 'Helvetica'
+ knj = 'mincho'
+ end
+ end
+ rescue
+ ltn = 'Helvetica'
+ knj = 'mincho'
+ end
+
+ else # not JAPANIZED_TK
+ begin
+ #platform = tk_call('set', 'tcl_platform(platform)')
+ platform = Tk::PLATFORM['platform']
+ case platform
+ when 'unix'
+ ltn = {'family'=>'Helvetica'.freeze,
+ 'size'=>-12, 'weight'=>'bold'.freeze}
+ when 'windows'
+ ltn = {'family'=>'MS Sans Serif'.freeze, 'size'=>8}
+ when 'macintosh'
+ ltn = 'system'
+ else # unknown
+ ltn = 'Helvetica'
+ end
+ rescue
+ ltn = 'Helvetica'
+ end
+
+ knj = ltn.dup
+ end
+
+ DEFAULT_LATIN_FONT_NAME = ltn.freeze
+ DEFAULT_KANJI_FONT_NAME = knj.freeze
+
+ when /^8\.[5-9]/, /^9\..*/
+ if tk_call('font', 'names') =~ /\bTkDefaultFont\b/
+ DEFAULT_LATIN_FONT_NAME = 'TkDefaultFont'.freeze
+ DEFAULT_KANJI_FONT_NAME = 'TkDefaultFont'.freeze
+ else
+ DEFAULT_LATIN_FONT_NAME = 'Helvetica'.freeze
+ DEFAULT_KANJI_FONT_NAME = 'mincho'.freeze
+ end
+
+ else # unknown version
+ DEFAULT_LATIN_FONT_NAME = 'Helvetica'.freeze
+ DEFAULT_KANJI_FONT_NAME = 'mincho'.freeze
+
+ end
+
+ if $DEBUG
+ print "default latin font = "; p DEFAULT_LATIN_FONT_NAME
+ print "default kanji font = "; p DEFAULT_KANJI_FONT_NAME
+ end
+
+
+ ###################################
+ class DescendantFont
+ def initialize(compound, type)
+ unless compound.kind_of?(TkFont)
+ fail ArgumentError, "a TkFont object is expected for the 1st argument"
+ end
+
+ @compound = compound
+ case type
+ when 'kanji', 'latin', 'ascii'
+ @type = type
+ when :kanji, :latin, :ascii
+ @type = type.to_s
+ else
+ fail ArgumentError, "unknown type '#{type}'"
+ end
+ end
+
+ def dup
+ fail RuntimeError, "cannot dupulicate a descendant font"
+ end
+ def clone
+ fail RuntimeError, "cannot clone a descendant font"
+ end
+
+ def to_eval
+ @compound.__send__(@type + '_font_id')
+ end
+ def font
+ @compound.__send__(@type + '_font_id')
+ end
+ alias font_id font
+ alias name font
+ alias to_s font
+
+ def [](slot)
+ @compound.__send__(@type + '_configinfo', slot)
+ end
+ def []=(slot, value)
+ @compound.__send__(@type + '_configure', slot, value)
+ value
+ end
+
+ def method_missing(id, *args)
+ @compound.__send__(@type + '_' + id.id2name, *args)
+ end
+ end
+
+
+ ###################################
+ # class methods
+ ###################################
+ def TkFont.is_system_font?(fnt)
+ # true --> system font which is available on the current system
+ # false --> not system font (or unknown system font)
+ # nil --> system font name, but not available on the current system
+ fnt = fnt.to_s
+ SYSTEM_FONT_NAMES.include?(fnt) && self.names.index(fnt) && true
+ end
+
+ def TkFont.actual(fnt, option=nil)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ fnt.actual(option)
+ else
+ actual_core(fnt, nil, option)
+ end
+ end
+ def TkFont.actual_hash(fnt, option=nil)
+ Hash[TkFont.actual(fnt, option)]
+ end
+
+ def TkFont.actual_displayof(fnt, win, option=nil)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ fnt.actual_displayof(win, option)
+ else
+ win = '.' unless win
+ actual_core(fnt, win, option)
+ end
+ end
+ def TkFont.actual_hash_displayof(fnt, option=nil)
+ Hash[TkFont.actual_displayof(fnt, option)]
+ end
+
+ def TkFont.configure(fnt, slot, value=None)
+ if fnt.kind_of?(TkFont)
+ fnt.configure(fnt, slot, value)
+ else
+ configure_core(fnt, slot, value)
+ end
+ fnt
+ end
+
+ def TkFont.configinfo(fnt, slot=nil)
+ if fnt.kind_of?(TkFont)
+ fnt.configinfo(fnt, slot)
+ else
+ configinfo_core(fnt, slot)
+ end
+ end
+
+ def TkFont.current_configinfo(fnt, slot=nil)
+ if fnt.kind_of?(TkFont)
+ fnt.current_configinfo(fnt, slot)
+ else
+ current_configinfo_core(fnt, slot)
+ end
+ end
+
+ def TkFont.measure(fnt, text)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ fnt.measure(text)
+ else
+ measure_core(fnt, nil, text)
+ end
+ end
+
+ def TkFont.measure_displayof(fnt, win, text)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ fnt.measure_displayof(win, text)
+ else
+ win = '.' unless win
+ measure_core(fnt, win, text)
+ end
+ end
+
+ def TkFont.metrics(fnt, option=nil)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ fnt.metrics(option)
+ else
+ metrics_core(fnt, nil, option)
+ end
+ end
+ def TkFont.metrics_hash(fnt, option=nil)
+ if option
+ val = TkFont.metrics(fnt, option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[TkFont.metrics(fnt)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def TkFont.metrics_displayof(fnt, win, option=nil)
+ fnt = '{}' if fnt == ''
+ if fnt.kind_of?(TkFont)
+ font.metrics_displayof(win, option=nil)
+ else
+ win = '.' unless win
+ metrics_core(fnt, win, option)
+ end
+ end
+ def TkFont.metrics_hash_displayof(fnt, win, option=nil)
+ if option
+ val = TkFont.metrics_displayof(fnt, win, option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[TkFont.metrics_displayof(fnt, win, option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def TkFont.families(win=nil)
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ ['fixed']
+
+ when /^8\..*/
+ if win
+ tk_split_simplelist(tk_call('font', 'families', '-displayof', win))
+ else
+ tk_split_simplelist(tk_call('font', 'families'))
+ end
+ end
+ end
+
+ def TkFont.names
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ r = ['fixed']
+ r += ['a14', 'k14'] if JAPANIZED_TK
+ Tk_FontNameTBL.mutex.synchronize{
+ Tk_FontNameTBL.each_value{|obj| r.push(obj)}
+ }
+ #r | []
+ r.uniq
+
+ when /^8\..*/
+ tk_split_simplelist(tk_call('font', 'names'))
+
+ end
+ end
+
+ def TkFont.create_copy(font)
+ fail 'source-font must be a TkFont object' unless font.kind_of? TkFont
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ keys = {}
+ font.configinfo.each{|key,value| keys[key] = value }
+ TkFont.new(font.latin_font_id, font.kanji_font_id, keys)
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ TkFont.new(font.latin_font_id, font.kanji_font_id, font.configinfo)
+ end
+ end
+
+ def TkFont.get_obj(name)
+ name = name.to_s
+ if name =~ /^(@font[0-9]+)(|c|l|k)$/
+ Tk_FontNameTBL.mutex.synchronize{
+ Tk_FontNameTBL[$1]
+ }
+ else
+ Tk_FontNameTBL.mutex.synchronize{
+ Tk_FontNameTBL[name]
+ }
+ end
+ end
+
+ def TkFont.init_widget_font(pathname, *args)
+ win, tag, key = pathname.split(';')
+ key = 'font' if key == nil || key == ''
+ path = [win, tag, key].join(';')
+
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ regexp = /^-(|kanji)#{key} /
+
+ conf_list = tk_split_simplelist(tk_call(*args)).
+ find_all{|prop| prop =~ regexp}.
+ collect{|prop| tk_split_simplelist(prop)}
+
+ if conf_list.size == 0
+ raise RuntimeError, "the widget may not support 'font' option"
+ end
+
+ args << {}
+
+ ltn_key = "-#{key}"
+ knj_key = "-kanji#{key}"
+
+ ltn_info = conf_list.find{|conf| conf[0] == ltn_key}
+ ltn = ltn_info[-1]
+ ltn = nil if ltn == [] || ltn == ""
+
+ knj_info = conf_list.find{|conf| conf[0] == knj_key}
+ knj = knj_info[-1]
+ knj = nil if knj == [] || knj == ""
+
+ TkFont.new(ltn, knj).call_font_configure([path, key], *args)
+
+ when /^8\.[0-4]/
+ regexp = /^-#{key} /
+
+ conf_list = tk_split_simplelist(tk_call(*args)).
+ find_all{|prop| prop =~ regexp}.
+ collect{|prop| tk_split_simplelist(prop)}
+
+ if conf_list.size == 0
+ raise RuntimeError, "the widget may not support 'font' option"
+ end
+
+ args << {}
+
+ optkey = "-#{key}"
+
+ info = conf_list.find{|conf| conf[0] == optkey}
+ fnt = info[-1]
+ fnt = nil if fnt == [] || fnt == ""
+
+ unless fnt
+ # create dummy
+ # TkFont.new(nil, nil).call_font_configure([path, key], *args)
+ dummy_fnt = TkFont.allocate
+ dummy_fnt.instance_eval{ init_dummy_fontobj() }
+ dummy_fnt
+ else
+ begin
+ compound = tk_split_simplelist(
+ Hash[*tk_split_simplelist(tk_call('font', 'configure',
+ fnt))].collect{|k,v|
+ [k[1..-1], v]
+ }.assoc('compound')[1])
+ rescue
+ compound = []
+ end
+ if compound == []
+ if TkFont.is_system_font?(fnt)
+ TkNamedFont.new(fnt).call_font_configure([path, key], *args)
+ else
+ TkFont.new(fnt).call_font_configure([path, key], *args)
+ end
+ else
+ TkFont.new(compound[0],
+ compound[1]).call_font_configure([path, key], *args)
+ end
+ end
+
+ when /^8\.[5-9]/, /^9\..*/
+ regexp = /^-#{key} /
+
+ conf_list = tk_split_simplelist(tk_call(*args)).
+ find_all{|prop| prop =~ regexp}.
+ collect{|prop| tk_split_simplelist(prop)}
+
+ if conf_list.size == 0
+ raise RuntimeError, "the widget may not support 'font' option"
+ end
+
+ args << {}
+
+ optkey = "-#{key}"
+
+ info = conf_list.find{|conf| conf[0] == optkey}
+ fnt = info[-1]
+ fnt = nil if fnt == [] || fnt == ""
+
+ unless fnt
+ # create dummy
+ # TkFont.new(nil, nil).call_font_configure([path, key], *args)
+ dummy_fnt = TkFont.allocate
+ dummy_fnt.instance_eval{ init_dummy_fontobj() }
+ dummy_fnt
+ else
+ if TkFont.is_system_font?(fnt)
+ TkNamedFont.new(fnt).call_font_configure([path, key], *args)
+ else
+ TkFont.new(fnt).call_font_configure([path, key], *args)
+ end
+ end
+ end
+ end
+
+ def TkFont.used_on(path=nil)
+ Tk_FontUseTBL.mutex.synchronize{
+ if path
+ Tk_FontUseTBL[path]
+ else
+ # Tk_FontUseTBL.values | []
+ Tk_FontUseTBL.values.uniq
+ end
+ }
+ end
+
+ def TkFont.failsafe(font)
+ begin
+ if /^8\..*/ === Tk::TK_VERSION && JAPANIZED_TK
+ tk_call('font', 'failsafe', font)
+ end
+ rescue
+ end
+ end
+
+ ###################################
+ # instance methods
+ ###################################
+ private
+ ###################################
+ def init_dummy_fontobj
+ Tk_FontID.mutex.synchronize{
+ @id = Tk_FontID.join(TkCore::INTERP._ip_id_)
+ Tk_FontID[1].succ!
+ }
+ Tk_FontNameTBL.mutex.synchronize{
+ Tk_FontNameTBL[@id] = self
+ }
+
+ # @latin_desscendant = nil
+ # @kanji_desscendant = nil
+ @descendant = [nil, nil] # [latin, kanji]
+
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ @latinfont = ""
+ @kanjifont = ""
+ if JAPANIZED_TK
+ @compoundfont = [[@latinfont], [@kanjifont]]
+ @fontslot = {'font'=>@latinfont, 'kanjifont'=>@kanjifont}
+ else
+ @compoundfont = @latinfont
+ @fontslot = {'font'=>@latinfont}
+ end
+ else
+ @latinfont = @id + 'l'
+ @kanjifont = @id + 'k'
+ @compoundfont = @id + 'c'
+
+ if JAPANIZED_TK
+ tk_call('font', 'create', @latinfont, '-charset', 'iso8859')
+ tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983')
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont])
+ else
+ tk_call('font', 'create', @latinfont)
+ tk_call('font', 'create', @kanjifont)
+ tk_call('font', 'create', @compoundfont)
+ end
+
+ @fontslot = {'font'=>@compoundfont}
+ end
+
+ self
+ end
+
+ def initialize(ltn=nil, knj=nil, keys=nil)
+ ltn = '{}' if ltn == ''
+ knj = '{}' if knj == ''
+
+ Tk_FontID.mutex.synchronize{
+ # @id = Tk_FontID.join('')
+ @id = Tk_FontID.join(TkCore::INTERP._ip_id_)
+ Tk_FontID[1].succ!
+ }
+ Tk_FontNameTBL.mutex.synchronize{
+ Tk_FontNameTBL[@id] = self
+ }
+
+ # @latin_desscendant = nil
+ # @kanji_desscendant = nil
+ @descendant = [nil, nil] # [latin, kanji]
+
+ # @latinfont = @id + 'l'
+ # @kanjifont = @id + 'k'
+ # @compoundfont = @id + 'c'
+ # @fontslot = {}
+
+ if knj.kind_of?(Hash) && !keys
+ keys = knj
+ knj = nil
+ end
+
+ # compound font check
+ if Tk::TK_VERSION == '8.0' && JAPANIZED_TK
+ begin
+ compound = tk_split_simplelist(tk_call('font', 'configure',
+ ltn, '-compound'))
+ if knj == nil
+ if compound != []
+ ltn, knj = compound
+ end
+ else
+ if compound != []
+ ltn = compound[0]
+ end
+ compound = tk_split_simplelist(tk_call('font', 'configure',
+ knj, '-compound'))
+ if compound != []
+ knj = compound[1]
+ end
+ end
+ rescue
+ end
+ end
+
+ if ltn
+ if JAPANIZED_TK && !knj
+ if Tk::TK_VERSION =~ /^4..*/
+ knj = DEFAULT_KANJI_FONT_NAME
+ else
+ knj = ltn
+ end
+ end
+ else
+ ltn = DEFAULT_LATIN_FONT_NAME
+ knj = DEFAULT_KANJI_FONT_NAME if JAPANIZED_TK && !knj
+ end
+
+ create_compoundfont(ltn, knj, keys)
+ end
+
+ def initialize_copy(font)
+ unless font.kind_of?(TkFont)
+ fail TypeError, '"initialize_copy should take same class object'
+ end
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ keys = {}
+ font.configinfo.each{|key,value| keys[key] = value }
+ initialize(font.latin_font_id, font.kanji_font_id, keys)
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ initialize(font.latin_font_id, font.kanji_font_id, font.configinfo)
+ end
+ end
+
+ def _get_font_info_from_hash(font)
+ font = _symbolkey2str(font)
+ foundry = (info = font['foundry'] .to_s)? info: '*'
+ family = (info = font['family'] .to_s)? info: '*'
+ weight = (info = font['weight'] .to_s)? info: '*'
+ slant = (info = font['slant'] .to_s)? info: '*'
+ swidth = (info = font['swidth'] .to_s)? info: '*'
+ adstyle = (info = font['adstyle'] .to_s)? info: '*'
+ pixels = (info = font['pixels'] .to_s)? info: '*'
+ points = (info = font['points'] .to_s)? info: '*'
+ resx = (info = font['resx'] .to_s)? info: '*'
+ resy = (info = font['resy'] .to_s)? info: '*'
+ space = (info = font['space'] .to_s)? info: '*'
+ avgWidth = (info = font['avgWidth'].to_s)? info: '*'
+ charset = (info = font['charset'] .to_s)? info: '*'
+ encoding = (info = font['encoding'].to_s)? info: '*'
+
+ [foundry, family, weight, slant, swidth, adstyle,
+ pixels, points, resx, resy, space, avgWidth, charset, encoding]
+ end
+
+ def create_latinfont_tk4x(font)
+ if font.kind_of? Hash
+ @latinfont = '-' + _get_font_info_from_hash(font).join('-') + '-'
+
+ elsif font.kind_of? Array
+ finfo = {}
+ finfo['family'] = font[0].to_s
+ if font[1]
+ fsize = font[1].to_s
+ if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/
+ if $1 == '-'
+ finfo['pixels'] = $2
+ else
+ finfo['points'] = $2
+ end
+ else
+ finfo['points'] = '13'
+ end
+ end
+ font[2..-1].each{|style|
+ case (style)
+ when 'normal'
+ finfo['weight'] = style
+ when 'bold'
+ finfo['weight'] = style
+ when 'roman'
+ finfo['slant'] = 'r'
+ when 'italic'
+ finfo['slant'] = 'i'
+ end
+ }
+
+ @latinfont = '-' + _get_font_info_from_hash(finfo).join('-') + '-'
+
+ elsif font.kind_of? TkFont
+ @latinfont = font.latin_font
+
+ else
+ if font
+ @latinfont = font
+ else
+ @latinfont = DEFAULT_LATIN_FONT_NAME
+ end
+
+ end
+ end
+
+ def create_kanjifont_tk4x(font)
+ unless JAPANIZED_TK
+ @kanjifont = ""
+ return
+ end
+
+ if font.kind_of? Hash
+ @kanjifont = '-' + _get_font_info_from_hash(font).join('-') + '-'
+
+ elsif font.kind_of? Array
+ finfo = {}
+ finfo['family'] = font[0].to_s
+ if font[1]
+ fsize = font[1].to_s
+ if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/
+ if $1 == '-'
+ finfo['pixels'] = $2
+ else
+ finfo['points'] = $2
+ end
+ else
+ finfo['points'] = '13'
+ end
+ end
+ font[2..-1].each{|style|
+ case (style)
+ when 'normal'
+ finfo['weight'] = style
+ when 'bold'
+ finfo['weight'] = style
+ when 'roman'
+ finfo['slant'] = 'r'
+ when 'italic'
+ finfo['slant'] = 'i'
+ end
+ }
+
+ @kanjifont = '-' + _get_font_info_from_hash(finfo).join('-') + '-'
+ elsif font.kind_of? TkFont
+ @kanjifont = font.kanji_font_id
+ else
+ if font
+ @kanjifont = font
+ else
+ @kanjifont = DEFAULT_KANJI_FONT_NAME
+ end
+ end
+ end
+
+ def create_compoundfont_tk4x(ltn, knj, keys)
+ create_latinfont(ltn)
+ create_kanjifont(knj)
+
+ if JAPANIZED_TK
+ @compoundfont = [[@latinfont], [@kanjifont]]
+ @fontslot = {'font'=>@latinfont, 'kanjifont'=>@kanjifont}
+ # @fontslot.clear
+ # @fontslot['font'] = @latinfont
+ # @fontslot['kanjifont'] = @kanjifont
+ else
+ @compoundfont = @latinfont
+ @fontslot = {'font'=>@latinfont}
+ # @fontslot.clear
+ # @fontslot['font'] = @latinfont
+ end
+ end
+
+ def create_latinfont_tk8x(font)
+ @latinfont = @id + 'l'
+
+ if JAPANIZED_TK
+ if font.kind_of? Hash
+ if font[:charset] || font['charset']
+ tk_call('font', 'create', @latinfont, *hash_kv(font))
+ else
+ tk_call('font', 'create', @latinfont,
+ '-charset', 'iso8859', *hash_kv(font))
+ end
+ elsif font.kind_of? Array
+ tk_call('font', 'create', @latinfont, '-copy', array2tk_list(font))
+ tk_call('font', 'configure', @latinfont, '-charset', 'iso8859')
+ elsif font.kind_of? TkFont
+ tk_call('font', 'create', @latinfont, '-copy', font.latin_font)
+ elsif font
+ tk_call('font', 'create', @latinfont, '-copy', font,
+ '-charset', 'iso8859')
+ else
+ tk_call('font', 'create', @latinfont, '-charset', 'iso8859')
+ end
+ else
+ if font.kind_of? Hash
+ tk_call('font', 'create', @latinfont, *hash_kv(font))
+ else
+ keys = {}
+ if font.kind_of? Array
+ actual_core(array2tk_list(font)).each{|key,val| keys[key] = val}
+ elsif font.kind_of? TkFont
+ actual_core(font.latin_font).each{|key,val| keys[key] = val}
+ elsif font
+ actual_core(font).each{|key,val| keys[key] = val}
+ end
+ tk_call('font', 'create', @latinfont, *hash_kv(keys))
+ end
+
+ if font && @compoundfont
+ keys = {}
+ actual_core(@latinfont).each{|key,val| keys[key] = val}
+ tk_call('font', 'configure', @compoundfont, *hash_kv(keys))
+ end
+ end
+ end
+
+ def create_kanjifont_tk8x(font)
+ @kanjifont = @id + 'k'
+
+ if JAPANIZED_TK
+ if font.kind_of? Hash
+ if font[:charset] || font['charset']
+ tk_call('font', 'create', @kanjifont, *hash_kv(font))
+ else
+ tk_call('font', 'create', @kanjifont,
+ '-charset', 'jisx0208.1983', *hash_kv(font))
+ end
+ elsif font.kind_of? Array
+ tk_call('font', 'create', @kanjifont, '-copy', array2tk_list(font))
+ tk_call('font', 'configure', @kanjifont, '-charset', 'jisx0208.1983')
+ elsif font.kind_of? TkFont
+ tk_call('font', 'create', @kanjifont, '-copy', font.kanji_font_id)
+ elsif font
+ tk_call('font', 'create', @kanjifont, '-copy', font,
+ '-charset', 'jisx0208.1983')
+ else
+ tk_call('font', 'create', @kanjifont, '-charset', 'jisx0208.1983')
+ end
+ # end of JAPANIZED_TK
+
+ else
+ if font.kind_of? Hash
+ tk_call('font', 'create', @kanjifont, *hash_kv(font))
+ else
+ keys = {}
+ if font.kind_of? Array
+ actual_core(array2tk_list(font)).each{|key,val| keys[key] = val}
+ elsif font.kind_of? TkFont
+ actual_core(font.kanji_font_id).each{|key,val| keys[key] = val}
+ elsif font
+ actual_core(font).each{|key,val| keys[key] = val}
+ end
+ tk_call('font', 'create', @kanjifont, *hash_kv(keys))
+ end
+
+ if font && @compoundfont
+ keys = {}
+ actual_core(@kanjifont).each{|key,val| keys[key] = val}
+ tk_call('font', 'configure', @compoundfont, *hash_kv(keys))
+ end
+ end
+ end
+
+ def create_compoundfont_tk8x(ltn, knj, keys)
+ if knj
+ create_latinfont(ltn)
+ create_kanjifont(knj)
+ else
+ cfnt = ltn
+ create_kanjifont(cfnt)
+ create_latinfont(cfnt)
+ end
+
+ @compoundfont = @id + 'c'
+
+ if JAPANIZED_TK
+ unless keys
+ keys = {}
+ else
+ keys = keys.dup
+ end
+ if (tk_call('font', 'configure', @latinfont, '-underline') == '1' &&
+ tk_call('font', 'configure', @kanjifont, '-underline') == '1' &&
+ !keys.key?('underline'))
+ keys['underline'] = true
+ end
+ if (tk_call('font', 'configure', @latinfont, '-overstrike') == '1' &&
+ tk_call('font', 'configure', @kanjifont, '-overstrike') == '1' &&
+ !keys.key?('overstrike'))
+ keys['overstrike'] = true
+ end
+
+ @fontslot = {'font'=>@compoundfont}
+ # @fontslot['font'] = @compoundfont
+ begin
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+ rescue RuntimeError => e
+ if ltn == knj
+ if e.message =~ /kanji font .* specified/
+ tk_call('font', 'delete', @latinfont)
+ create_latinfont(DEFAULT_LATIN_FONT_NAME)
+ opts = []
+ Hash[*(tk_split_simplelist(tk_call('font', 'configure',
+ @kanjifont)))].each{|k,v|
+ case k
+ when '-size', '-weight', '-slant', '-underline', '-overstrike'
+ opts << k << v
+ end
+ }
+ tk_call('font', 'configure', @latinfont, *opts)
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+
+ elsif e.message =~ /ascii font .* specified/
+ tk_call('font', 'delete', @kanjifont)
+ create_kanjifont(DEFAULT_KANJI_FONT_NAME)
+ opts = []
+ Hash[*(tk_split_simplelist(tk_call('font', 'configure',
+ @latinfont)))].each{|k,v|
+ case k
+ when '-size', '-weight', '-slant', '-underline', '-overstrike'
+ opts << k << v
+ end
+ }
+ tk_call('font', 'configure', @kanjifont, *opts)
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+
+ else
+ raise e
+ end
+ else
+ raise e
+ end
+ end
+ else
+ tk_call('font', 'create', @compoundfont)
+
+ latinkeys = {}
+ begin
+ actual_core(@latinfont).each{|key,val| latinkeys[key] = val}
+ rescue
+ latinkeys = {}
+ end
+ if latinkeys != {}
+ tk_call('font', 'configure', @compoundfont, *hash_kv(latinkeys))
+ end
+
+ if knj
+ compoundkeys = nil
+ kanjikeys = {}
+ begin
+ actual_core(@kanjifont).each{|key,val| kanjikeys[key] = val}
+ rescue
+ kanjikeys = {}
+ end
+ if kanjikeys != {}
+ tk_call('font', 'configure', @compoundfont, *hash_kv(kanjikeys))
+ end
+ end
+
+ if cfnt
+ if cfnt.kind_of?(Hash)
+ compoundkeys = cfnt.dup
+ else
+ compoundkeys = {}
+ actual_core(cfnt).each{|key,val| compoundkeys[key] = val}
+ end
+ compoundkeys.update(_symbolkey2str(keys))
+ keys = compoundkeys
+ end
+
+ @fontslot = {'font'=>@compoundfont}
+ # @fontslot['font'] = @compoundfont
+ tk_call('font', 'configure', @compoundfont, *hash_kv(keys))
+ end
+ end
+
+ ###################################
+ public
+ ###################################
+ def inspect
+ sprintf("#<%s:%0x:%s>", self.class.inspect, self.__id__, @compoundfont)
+ end
+
+ def method_missing(id, *args)
+ name = id.id2name
+ case args.length
+ when 1
+ if name[-1] == ?=
+ configure name[0..-2], args[0]
+ args[0]
+ else
+ configure name, args[0]
+ self
+ end
+ when 0
+ begin
+ configinfo name
+ rescue
+ super(id, *args)
+# fail NameError, "undefined local variable or method `#{name}' for #{self.to_s}", error_at
+ end
+ else
+ super(id, *args)
+# fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at
+ end
+ end
+
+ def call_font_configure(path, *args)
+ if path.kind_of?(Array)
+ # [path, optkey]
+ win, tag = path[0].split(';')
+ optkey = path[1].to_s
+ else
+ win, tag, optkey = path.split(';')
+ end
+
+ fontslot = _symbolkey2str(@fontslot)
+ if optkey && optkey != ""
+ ltn = fontslot.delete('font')
+ knj = fontslot.delete('kanjifont')
+ fontslot[optkey] = ltn if ltn
+ fontslot["kanji#{optkey}"] = knj if knj
+ end
+
+ keys = _symbolkey2str(args.pop).update(fontslot)
+ args.concat(hash_kv(keys))
+ begin
+ tk_call(*args)
+ rescue => e
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ fail e
+ end
+ end
+ Tk_FontUseTBL.mutex.synchronize{
+ Tk_FontUseTBL[[win, tag, optkey].join(';')] = self
+ }
+ self
+ end
+
+ def used
+ ret = []
+ table = nil
+ Tk_FontUseTBL.mutex.synchronize{
+ table = Tk_FontUseTBL.clone # to avoid deadlock
+ }
+ table.each{|key,value|
+ next unless self == value
+ if key.include?(';')
+ win, tag, optkey = key.split(';')
+ winobj = tk_tcl2ruby(win)
+ #if winobj.kind_of? TkText
+ if winobj.kind_of?(TkText) || winobj.kind_of?(Tk::Text)
+ if optkey
+ ret.push([winobj, winobj.tagid2obj(tag), optkey])
+ else
+ ret.push([winobj, winobj.tagid2obj(tag)])
+ end
+ #elsif winobj.kind_of? TkCanvas
+ elsif winobj.kind_of?(TkCanvas) || winobj.kind_of?(Tk::Canvas)
+ if (tagobj = TkcTag.id2obj(winobj, tag)).kind_of? TkcTag
+ if optkey
+ ret.push([winobj, tagobj, optkey])
+ else
+ ret.push([winobj, tagobj])
+ end
+ elsif (tagobj = TkcItem.id2obj(winobj, tag)).kind_of? TkcItem
+ if optkey
+ ret.push([winobj, tagobj, optkey])
+ else
+ ret.push([winobj, tagobj])
+ end
+ else
+ if optkey
+ ret.push([winobj, tag, optkey])
+ else
+ ret.push([winobj, tag])
+ end
+ end
+ #elsif winobj.kind_of? TkMenu
+ elsif winobj.kind_of?(TkMenu) || winobj.kind_of?(Tk::Menu)
+ if optkey
+ ret.push([winobj, tag, optkey])
+ else
+ ret.push([winobj, tag])
+ end
+ else
+ if optkey
+ ret.push([win, tag, optkey])
+ else
+ ret.push([win, tag])
+ end
+ end
+ else
+ ret.push(tk_tcl2ruby(key))
+ end
+ }
+ ret
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ font
+ end
+
+ def font
+ @compoundfont
+ end
+ alias font_id font
+ alias name font
+ alias to_s font
+
+ def latin_font_id
+ @latinfont
+ end
+
+ def latin_font
+ # @latinfont
+ if @descendant[0] # [0] -> latin
+ @descendant[0]
+ else
+ @descendant[0] = DescendantFont.new(self, 'latin')
+ end
+=begin
+ if @latin_descendant
+ @latin_descendant
+ else
+ @latin_descendant = DescendantFont.new(self, 'latin')
+ end
+=end
+ end
+ alias latinfont latin_font
+
+ def kanji_font_id
+ @kanjifont
+ end
+
+ def kanji_font
+ # @kanjifont
+ if @descendant[1] # [1] -> kanji
+ @descendant[1]
+ else
+ @descendant[1] = DescendantFont.new(self, 'kanji')
+ end
+=begin
+ if @kanji_descendant
+ @kanji_descendant
+ else
+ @kanji_descendant = DescendantFont.new(self, 'kanji')
+ end
+=end
+ end
+ alias kanjifont kanji_font
+
+ def actual(option=nil)
+ actual_core(@compoundfont, nil, option)
+ end
+ def actual_hash(option=nil)
+ Hash[actual(option)]
+ end
+
+ def actual_displayof(win, option=nil)
+ win = '.' unless win
+ actual_core(@compoundfont, win, option)
+ end
+ def actual_hash_displayof(win, option=nil)
+ Hash[actual_displayof(win, option)]
+ end
+
+ def latin_actual(option=nil)
+ if @latinfont == nil
+ actual_core(@compoundfont, nil, option) # use @compoundfont
+ else
+ actual_core(@latinfont, nil, option)
+ end
+ end
+ def latin_actual_hash(option=nil)
+ Hash[latin_actual(option)]
+ end
+
+ def latin_actual_displayof(win, option=nil)
+ win = '.' unless win
+ if @latinfont == nil
+ actual_core(@compoundfont, win, option) # use @compoundfont
+ else
+ actual_core(@latinfont, win, option)
+ end
+ end
+ def latin_actual_hash_displayof(win, option=nil)
+ Hash[latin_actual_displayof(win, option)]
+ end
+
+ def kanji_actual(option=nil)
+ #if JAPANIZED_TK
+ if @kanjifont == nil
+ actual_core(@compoundfont, nil, option) # use @compoundfont
+ elsif @kanjifont != ""
+ actual_core(@kanjifont, nil, option)
+ else
+ actual_core_tk4x(nil, nil, option)
+ end
+ end
+ def kanji_actual_hash(option=nil)
+ Hash[kanji_actual(option)]
+ end
+
+ def kanji_actual_displayof(win, option=nil)
+ #if JAPANIZED_TK
+ if @kanjifont == nil
+ actual_core(@compoundfont, nil, option) # use @compoundfont
+ elsif @kanjifont != ""
+ win = '.' unless win
+ actual_core(@kanjifont, win, option)
+ else
+ actual_core_tk4x(nil, win, option)
+ end
+ end
+ def kanji_actual_hash_displayof(win, option=nil)
+ Hash[kanji_actual_displayof(win, option)]
+ end
+
+ def [](slot)
+ configinfo slot
+ end
+
+ def []=(slot, val)
+ configure slot, val
+ val
+ end
+
+ def configure(slot, value=None)
+ configure_core(@compoundfont, slot, value)
+ self
+ end
+
+ def configinfo(slot=nil)
+ configinfo_core(@compoundfont, slot)
+ end
+
+ def current_configinfo(slot=nil)
+ current_configinfo_core(@compoundfont, slot)
+ end
+
+ def delete
+ delete_core
+ end
+
+ def latin_configure(slot, value=None)
+ if JAPANIZED_TK
+ configure_core(@latinfont, slot, value)
+ else
+ configure(slot, value)
+ end
+ self
+ end
+
+ def latin_configinfo(slot=nil)
+ if JAPANIZED_TK
+ configinfo_core(@latinfont, slot)
+ else
+ configinfo(slot)
+ end
+ end
+ def latin_current_configinfo(slot=nil)
+ Hash[latin_configinfo(slot)]
+ end
+
+ def kanji_configure(slot, value=None)
+ #if JAPANIZED_TK
+ if @kanjifont == nil
+ configure_core(@compoundfont, slot, value) # use @compoundfont
+ elsif @kanjifont != ""
+ configure_core(@kanjifont, slot, value)
+ configure('size'=>configinfo('size')) # to reflect new configuration
+ else
+ #""
+ configure(slot, value)
+ end
+ self
+ end
+
+ def kanji_configinfo(slot=nil)
+ #if JAPANIZED_TK
+ if @kanjifont == nil
+ configure_core(@compoundfont, slot) # use @compoundfont
+ elsif @kanjifont != ""
+ configinfo_core(@kanjifont, slot)
+ else
+ #[]
+ configinfo(slot)
+ end
+ end
+ def kanji_current_configinfo(slot=nil)
+ Hash[kanji_configinfo(slot)]
+ end
+
+ def replace(ltn, knj=None)
+ knj = ltn if knj == None
+ latin_replace(ltn)
+ kanji_replace(knj)
+ self
+ end
+
+ def latin_replace(ltn)
+ if @latinfont
+ latin_replace_core(ltn)
+ reset_pointadjust
+ else
+ # not compound font -> copy properties of ltn
+ latinkeys = {}
+ begin
+ actual_core(ltn).each{|key,val| latinkeys[key] = val}
+ rescue
+ latinkeys = {}
+ end
+ begin
+ tk_call('font', 'configure', @compoundfont, *hash_kv(latinkeys))
+ rescue
+ # not exist? (deleted?) -> create font
+ tk_call('font', 'create', @compoundfont, *hash_kv(latinkeys))
+ end
+ end
+
+ self
+ end
+
+ def kanji_replace(knj)
+ return self unless @kanjifont # ignore
+ kanji_replace_core(knj)
+ reset_pointadjust
+ self
+ end
+
+ def measure(text)
+ measure_core(@compoundfont, nil, text)
+ end
+
+ def measure_displayof(win, text)
+ win = '.' unless win
+ measure_core(@compoundfont, win, text)
+ end
+
+ def metrics(option=nil)
+ metrics_core(@compoundfont, nil, option)
+ end
+ def metrics_hash(option=nil)
+ if option
+ val = metrics(option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[metrics(option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def metrics_displayof(win, option=nil)
+ win = '.' unless win
+ metrics_core(@compoundfont, win, option)
+ end
+ def metrics_hash_displayof(win, option=nil)
+ if option
+ val = metrics_displayof(win, option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[metrics_displayof(win, option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def latin_metrics(option=nil)
+ if @latinfont == nil
+ metrics_core(@compoundfont, nil, option) # use @compoundfont
+ else
+ metrics_core(@latinfont, nil, option)
+ end
+ end
+ def latin_metrics_hash(option=nil)
+ if option
+ val = latin_metrics(option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[latin_metrics(option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def latin_metrics_displayof(win, option=nil)
+ win = '.' unless win
+ if @latinfont == nil
+ metrics_core(@compoundfont, win, option) # use @compoundfont
+ else
+ metrics_core(@latinfont, win, option)
+ end
+ end
+ def latin_metrics_hash_displayof(win, option=nil)
+ if option
+ val = latin_metrics_displayof(win, option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[latin_metrics_displayof(win, option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def kanji_metrics(option=nil)
+ if @latinfont == nil
+ metrics_core(@compoundfont, nil, option) # use @compoundfont
+ elsif JAPANIZED_TK
+ metrics_core(@kanjifont, nil, option)
+ else
+ metrics_core_tk4x(nil, nil, option)
+ end
+ end
+ def kanji_metrics_hash(option=nil)
+ if option
+ val = kanji_metrics(option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[kanji_metrics(option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def kanji_metrics_displayof(win, option=nil)
+ win = '.' unless win
+ if @latinfont == nil
+ metrics_core(@compoundfont, win, option) # use @compoundfont
+ elsif JAPANIZED_TK
+ metrics_core(@kanjifont, win, option)
+ else
+ metrics_core_tk4x(nil, win, option)
+ end
+ end
+ def kanji_metrics_hash_displayof(win, option=nil)
+ if option
+ val = kanji_metrics_displayof(win, option)
+ case TkFont::MetricsType[option.to_s]
+ when ?n
+ val = TkComm::num_or_str(val)
+ when ?b
+ val = TkComm::bool(val)
+ else
+ # do nothing
+ end
+ return val
+ end
+
+ h = Hash[kanji_metrics_displayof(win, option)]
+ h.keys.each{|k|
+ case TkFont::MetricsType[k.to_s]
+ when ?n
+ h[k] = TkComm::num_or_str(h[k])
+ when ?b
+ h[k] = TkComm::bool(h[k])
+ else
+ # do nothing
+ end
+ }
+ h
+ end
+
+ def reset_pointadjust
+ begin
+ if /^8\..*/ === Tk::TK_VERSION && JAPANIZED_TK
+ configure('pointadjust' => latin_actual.assoc('size')[1].to_f /
+ kanji_actual.assoc('size')[1].to_f )
+ end
+ rescue
+ end
+ self
+ end
+
+ ###################################
+ # private alias
+ ###################################
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ alias create_latinfont create_latinfont_tk4x
+ alias create_kanjifont create_kanjifont_tk4x
+ alias create_compoundfont create_compoundfont_tk4x
+
+ when /^8\.[0-5]/
+ alias create_latinfont create_latinfont_tk8x
+ alias create_kanjifont create_kanjifont_tk8x
+ alias create_compoundfont create_compoundfont_tk8x
+
+ else
+ alias create_latinfont create_latinfont_tk8x
+ alias create_kanjifont create_kanjifont_tk8x
+ alias create_compoundfont create_compoundfont_tk8x
+
+ end
+
+ ###################################
+ # public alias
+ ###################################
+ alias ascii_font latin_font
+ alias asciifont latinfont
+ alias create_asciifont create_latinfont
+ alias ascii_actual latin_actual
+ alias ascii_actual_displayof latin_actual_displayof
+ alias ascii_configure latin_configure
+ alias ascii_configinfo latin_configinfo
+ alias ascii_replace latin_replace
+ alias ascii_metrics latin_metrics
+
+ ###################################
+=begin
+ def dup
+ TkFont.new(self)
+ end
+ def clone
+ TkFont.new(self)
+ end
+=end
+end
+
+module TkFont::CoreMethods
+ include Tk
+ extend TkCore
+
+ private
+
+ def actual_core_tk4x(font, win=nil, option=nil)
+ # dummy
+ if option == 'pointadjust' || option == :pointadjust
+ 1.0
+ elsif option
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ 0
+ when ?b
+ false
+ else
+ ''
+ end
+ else
+ [['family',''], ['size',0], ['weight',''], ['slant',''],
+ ['underline',false], ['overstrike',false], ['charset',''],
+ ['pointadjust',0]]
+ end
+ end
+
+ def actual_core_tk8x(font, win=nil, option=nil)
+ font = '{}' if font == ''
+
+ if option == 'compound' || option == :compound
+ ""
+ elsif option
+ if win
+ val = tk_call('font', 'actual', font,
+ "-displayof", win, "-#{option}")
+ else
+ val = tk_call('font', 'actual', font, "-#{option}")
+ end
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ num_or_str(val)
+ when ?b
+ bool(val)
+ else
+ val
+ end
+ else
+ l = tk_split_simplelist(if win
+ tk_call('font', 'actual', font,
+ "-displayof", win)
+ else
+ tk_call('font', 'actual', font)
+ end)
+ r = []
+ while key=l.shift
+ if key == '-compound'
+ l.shift
+ else
+ key = key[1..-1]
+ val = l.shift
+ case TkFont::OptionType[key]
+ when ?n
+ r.push [key, num_or_str(val)]
+ when ?b
+ r.push [key, bool(val)]
+ else
+ r.push [key, val]
+ end
+ end
+ end
+ r
+ end
+ end
+
+ def configure_core_tk4x(font, slot, value=None)
+ #""
+ self
+ end
+
+ def configinfo_core_tk4x(font, option=nil)
+ # dummy
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ if option == 'pointadjust' || option == :pointadjust
+ 1.0
+ elsif option
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ 0
+ when ?b
+ false
+ else
+ ''
+ end
+ else
+ [['family',''], ['size',0], ['weight',''], ['slant',''],
+ ['underline',false], ['overstrike',false], ['charset',''],
+ ['pointadjust',1.0]]
+ end
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ current_configinfo_core_tk4x(font, option)
+ end
+ end
+
+ def current_configinfo_core_tk4x(font, option=nil)
+ if option
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ 0
+ when ?b
+ false
+ else
+ ''
+ end
+ else
+ {'family'=>'', 'size'=>0, 'weight'=>'', 'slant'=>'',
+ 'underline'=>false, 'overstrike'=>false,
+ 'charset'=>false, 'pointadjust'=>1.0}
+ end
+ end
+
+ def configure_core_tk8x(font, slot, value=None)
+ if JAPANIZED_TK
+ begin
+ padjust = tk_call('font', 'configure', font, '-pointadjust')
+ rescue
+ padjust = nil
+ end
+ else
+ padjust = nil
+ end
+ if slot.kind_of? Hash
+ if JAPANIZED_TK && (slot.key?('family') || slot.key?(:family))
+ slot = _symbolkey2str(slot)
+ configure_core_tk8x(font, 'family', slot.delete('family'))
+ end
+
+ if ((slot.key?('size') || slot.key?(:size)) &&
+ padjust && !slot.key?('pointadjust') && !slot.key?(:pointadjust))
+ tk_call('font', 'configure', font,
+ '-pointadjust', padjust, *hash_kv(slot))
+ else
+ tk_call('font', 'configure', font, *hash_kv(slot))
+ end
+ elsif (slot == 'size' || slot == :size) && padjust != nil
+ tk_call('font', 'configure', font,
+ "-#{slot}", value, '-pointadjust', padjust)
+ elsif JAPANIZED_TK && (slot == 'family' || slot == :family)
+ # coumpund font?
+ begin
+ compound = tk_split_simplelist(tk_call('font', 'configure',
+ font, '-compound'))
+ rescue
+ tk_call('font', 'configure', font, '-family', value)
+ return self
+ end
+ if compound == []
+ tk_call('font', 'configure', font, '-family', value)
+ return self
+ end
+ ltn, knj = compound
+
+ lfnt = tk_call('font', 'create', '-copy', ltn)
+ begin
+ tk_call('font', 'configure', lfnt, '-family', value)
+ latin_replace_core_tk8x(lfnt)
+ rescue RuntimeError => e
+ fail e if $DEBUG
+ ensure
+ tk_call('font', 'delete', lfnt) if lfnt != ''
+ end
+
+ kfnt = tk_call('font', 'create', '-copy', knj)
+ begin
+ tk_call('font', 'configure', kfnt, '-family', value)
+ kanji_replace_core_tk8x(lfnt)
+ rescue RuntimeError => e
+ fail e if $DEBUG
+ ensure
+ tk_call('font', 'delete', kfnt) if kfnt != ''
+ end
+
+ else
+ tk_call('font', 'configure', font, "-#{slot}", value)
+ end
+ self
+ end
+
+ def configinfo_core_tk8x(font, option=nil)
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ if option == 'compound' || option == :compound
+ ""
+ elsif option
+ val = tk_call('font', 'configure', font, "-#{option}")
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ num_or_str(val)
+ when ?b
+ bool(val)
+ else
+ val
+ end
+ else
+ l = tk_split_simplelist(tk_call('font', 'configure', font))
+ r = []
+ while key=l.shift
+ if key == '-compound'
+ l.shift
+ else
+ key = key[1..-1]
+ val = l.shift
+ case TkFont::OptionType[key]
+ when ?n
+ r.push [key, num_or_str(val)]
+ when ?b
+ r.push [key, bool(val)]
+ else
+ r.push [key, val]
+ end
+ end
+ end
+ r
+ end
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ current_configinfo_core_tk8x(font, option)
+ end
+ end
+
+ def current_configinfo_core_tk8x(font, option=nil)
+ if option == 'compound'
+ ""
+ elsif option
+ val = tk_call('font', 'configure', font, "-#{option}")
+ case TkFont::OptionType[option.to_s]
+ when ?n
+ num_or_str(val)
+ when ?b
+ bool(val)
+ else
+ val
+ end
+ else
+ l = tk_split_simplelist(tk_call('font', 'configure', font))
+ h = {}
+ while key=l.shift
+ if key == '-compound'
+ l.shift
+ else
+ key = key[1..-1]
+ val = l.shift
+ case TkFont::OptionType[key]
+ when ?n
+ h[key] = num_or_str(val)
+ when ?b
+ h[key] = bool(val)
+ else
+ h[key] = val
+ end
+ end
+ end
+ h
+ end
+ end
+
+ def delete_core_tk4x
+ TkFont::Tk_FontNameTBL.mutex.synchronize{
+ TkFont::Tk_FontNameTBL.delete(@id)
+ }
+ TkFont::Tk_FontUseTBL.mutex.synchronize{
+ TkFont::Tk_FontUseTBL.delete_if{|key,value| value == self}
+ }
+ end
+
+ def delete_core_tk8x
+ begin
+ tk_call('font', 'delete', @latinfont) if @latinfont
+ rescue
+ end
+ begin
+ tk_call('font', 'delete', @kanjifont) if @kanjifont
+ rescue
+ end
+ begin
+ tk_call('font', 'delete', @compoundfont) if @compoundfont
+ rescue
+ end
+ TkFont::Tk_FontNameTBL.mutex.synchronize{
+ TkFont::Tk_FontNameTBL.delete(@id)
+ }
+ TkFont::Tk_FontUseTBL.mutex.synchronize{
+ TkFont::Tk_FontUseTBL.delete_if{|key,value| value == self}
+ }
+ end
+
+ def latin_replace_core_tk4x(ltn)
+ create_latinfont_tk4x(ltn)
+ @compoundfont[0] = [@latinfont] if JAPANIZED_TK
+ @fontslot['font'] = @latinfont
+ table = nil
+ TkFont::Tk_FontUseTBL.mutex.synchronize{
+ table = TkFont::Tk_FontUseTBL.clone
+ }
+ table.each{|w, fobj|
+ if self == fobj
+ begin
+ if w.include?(';')
+ win, tag, optkey = w.split(';')
+ optkey = 'font' if optkey == nil || optkey == ''
+ winobj = tk_tcl2ruby(win)
+# winobj.tagfont_configure(tag, {'font'=>@latinfont})
+ #if winobj.kind_of? TkText
+ if winobj.kind_of?(TkText) || winobj.kind_of?(Tk::Text)
+ tk_call(win, 'tag', 'configure', tag, "-#{optkey}", @latinfont)
+ #elsif winobj.kind_of? TkCanvas
+ elsif winobj.kind_of?(TkCanvas) || winobj.kind_of?(Tk::Canvas)
+ tk_call(win, 'itemconfigure', tag, "-#{optkey}", @latinfont)
+ #elsif winobj.kind_of? TkMenu
+ elsif winobj.kind_of?(TkMenu) || winobj.kind_of?(Tk::Menu)
+ tk_call(win, 'entryconfigure', tag, "-#{optkey}", @latinfont)
+ else
+ raise RuntimeError, "unknown widget type"
+ end
+ else
+# tk_tcl2ruby(w).font_configure('font'=>@latinfont)
+ tk_call(w, 'configure', '-font', @latinfont)
+ end
+ rescue
+ TkFont::Tk_FontUseTBL.mutex.synchronize{
+ TkFont::Tk_FontUseTBL.delete(w)
+ }
+ end
+ end
+ }
+ self
+ end
+
+ def kanji_replace_core_tk4x(knj)
+ return self unless JAPANIZED_TK
+
+ create_kanjifont_tk4x(knj)
+ @compoundfont[1] = [@kanjifont]
+ @fontslot['kanjifont'] = @kanjifont
+ table = nil
+ TkFont::Tk_FontUseTBL.mutex.synchronize{
+ table = TkFont::Tk_FontUseTBL.clone
+ }
+ table.dup.each{|w, fobj|
+ if self == fobj
+ begin
+ if w.include?(';')
+ win, tag, optkey = w.split(';')
+ optkey = 'kanjifont' unless optkey
+ winobj = tk_tcl2ruby(win)
+# winobj.tagfont_configure(tag, {'kanjifont'=>@kanjifont})
+ #if winobj.kind_of? TkText
+ if winobj.kind_of?(TkText) || winobj.kind_of?(Tk::Text)
+ tk_call(win, 'tag', 'configure', tag, "-#{optkey}", @kanjifont)
+ #elsif winobj.kind_of? TkCanvas
+ elsif winobj.kind_of?(TkCanvas) || winobj.kind_of?(Tk::Canvas)
+ tk_call(win, 'itemconfigure', tag, "-#{optkey}", @kanjifont)
+ #elsif winobj.kind_of? TkMenu
+ elsif winobj.kind_of?(TkMenu) || winobj.kind_of?(Tk::Menu)
+ tk_call(win, 'entryconfigure', tag, "-#{optkey}", @latinfont)
+ else
+ raise RuntimeError, "unknown widget type"
+ end
+ else
+# tk_tcl2ruby(w).font_configure('kanjifont'=>@kanjifont)
+ tk_call(w, 'configure', '-kanjifont', @kanjifont)
+ end
+ rescue
+ Tk_FontUseTBL.mutex.synchronize{
+ TkFont::Tk_FontUseTBL.delete(w)
+ }
+ end
+ end
+ }
+ self
+ end
+
+ def latin_replace_core_tk8x(ltn)
+ ltn = '{}' if ltn == ''
+
+ if JAPANIZED_TK
+ begin
+ tk_call('font', 'delete', '@font_tmp')
+ rescue
+ end
+ begin
+ fnt_bup = tk_call('font', 'create', '@font_tmp', '-copy', @latinfont)
+ rescue
+ #fnt_bup = ''
+ fnt_bup = TkFont::DEFAULT_LATIN_FONT_NAME
+ end
+ end
+
+ begin
+ tk_call('font', 'delete', @latinfont)
+ rescue
+ end
+ create_latinfont(ltn)
+
+ if JAPANIZED_TK
+ keys = self.configinfo
+ tk_call('font', 'delete', @compoundfont)
+ begin
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+=begin
+ latinkeys = {}
+ begin
+ actual_core(@latinfont).each{|key,val| latinkeys[key] = val}
+ rescue
+ latinkeys = {}
+ end
+ if latinkeys != {}
+ tk_call('font', 'configure', @compoundfont, *hash_kv(latinkeys))
+ end
+=end
+ rescue RuntimeError => e
+ tk_call('font', 'delete', @latinfont)
+ if fnt_bup && fnt_bup != ''
+ tk_call('font', 'create', @latinfont, '-copy', fnt_bup)
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+ tk_call('font', 'delete', fnt_bup)
+ else
+ fail e
+ end
+ end
+
+ else
+ latinkeys = {}
+ begin
+ actual_core(@latinfont).each{|key,val| latinkeys[key] = val}
+ rescue
+ latinkeys = {}
+ end
+ begin
+ tk_call('font', 'configure', @compoundfont, *hash_kv(latinkeys))
+ rescue
+ # not exist? (deleted?) -> create font
+ tk_call('font', 'create', @compoundfont, *hash_kv(latinkeys))
+ end
+ end
+ self
+ end
+
+ def kanji_replace_core_tk8x(knj)
+ knj = '{}' if knj == ''
+
+ if JAPANIZED_TK
+ begin
+ tk_call('font', 'delete', '@font_tmp')
+ rescue
+ end
+ begin
+ fnt_bup = tk_call('font', 'create', '@font_tmp', '-copy', @kanjifont)
+ rescue
+ #fnt_bup = ''
+ fnt_bup = TkFont::DEFAULT_KANJI_FONT_NAME
+ end
+ end
+
+ begin
+ tk_call('font', 'delete', @kanjifont)
+ rescue
+ end
+ create_kanjifont(knj)
+
+ if JAPANIZED_TK
+ keys = self.configinfo
+ tk_call('font', 'delete', @compoundfont)
+ begin
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+ rescue RuntimeError => e
+ tk_call('font', 'delete', @kanjifont)
+ if fnt_bup && fnt_bup != ''
+ tk_call('font', 'create', @kanjifont, '-copy', fnt_bup)
+ tk_call('font', 'create', @compoundfont,
+ '-compound', [@latinfont, @kanjifont], *hash_kv(keys))
+ tk_call('font', 'delete', fnt_bup)
+ else
+ fail e
+ end
+ end
+ end
+ self
+ end
+
+ def measure_core_tk4x(font, win, text)
+ 0
+ end
+
+ def measure_core_tk8x(font, win, text)
+ font = '{}' if font == ''
+
+ if win
+ number(tk_call('font', 'measure', font,
+ '-displayof', win, text))
+ else
+ number(tk_call('font', 'measure', font, text))
+ end
+ end
+
+ def metrics_core_tk4x(font, win, option=nil)
+ # dummy
+ if option
+ ""
+ else
+ [['ascent',[]], ['descent',[]], ['linespace',[]], ['fixed',[]]]
+ end
+ end
+
+ def metrics_core_tk8x(font, win, option=nil)
+ font = '{}' if font == ''
+
+ if option
+ if win
+ number(tk_call('font', 'metrics', font,
+ "-displayof", win, "-#{option}"))
+ else
+ number(tk_call('font', 'metrics', font, "-#{option}"))
+ end
+ else
+ l = tk_split_list(if win
+ tk_call('font','metrics',font,"-displayof",win)
+ else
+ tk_call('font','metrics',font)
+ end)
+ r = []
+ while key=l.shift
+ r.push [key[1..-1], l.shift.to_i]
+=begin
+ if key == '-fixed' # boolean value
+ r.push [key[1..-1], bool(l.shift)]
+ else
+ r.push [key[1..-1], l.shift.to_i]
+ end
+=end
+ end
+ r
+ end
+ end
+
+ ###################################
+ # private alias
+ ###################################
+ case (Tk::TK_VERSION)
+ when /^4\..*/
+ alias actual_core actual_core_tk4x
+ alias configure_core configure_core_tk4x
+ alias configinfo_core configinfo_core_tk4x
+ alias current_configinfo_core current_configinfo_core_tk4x
+ alias delete_core delete_core_tk4x
+ alias latin_replace_core latin_replace_core_tk4x
+ alias kanji_replace_core kanji_replace_core_tk4x
+ alias measure_core measure_core_tk4x
+ alias metrics_core metrics_core_tk4x
+
+ when /^8\.[0-9]/
+ alias actual_core actual_core_tk8x
+ alias configure_core configure_core_tk8x
+ alias configinfo_core configinfo_core_tk8x
+ alias current_configinfo_core current_configinfo_core_tk8x
+ alias delete_core delete_core_tk8x
+ alias latin_replace_core latin_replace_core_tk8x
+ alias kanji_replace_core kanji_replace_core_tk8x
+ alias measure_core measure_core_tk8x
+ alias metrics_core metrics_core_tk8x
+
+ else
+ alias actual_core actual_core_tk8x
+ alias configure_core configure_core_tk8x
+ alias configinfo_core configinfo_core_tk8x
+ alias current_configinfo_core current_configinfo_core_tk8x
+ alias delete_core delete_core_tk8x
+ alias latin_replace_core latin_replace_core_tk8x
+ alias kanji_replace_core kanji_replace_core_tk8x
+ alias measure_core measure_core_tk8x
+ alias metrics_core metrics_core_tk8x
+
+ end
+end
+
+class TkFont
+ include TkFont::CoreMethods
+ extend TkFont::CoreMethods
+end
+
+class TkNamedFont < TkFont
+ # for built-in named fonts
+ def TkNamedFont.find(name)
+ name = name.to_s
+ unless (obj = Tk_FontNameTBL[name])
+ obj = self.new(name) if TkFont.is_system_font?(name)
+ end
+ obj
+ end
+
+ def TkNamedFont.new(name, keys=nil)
+ name = name.to_s
+ obj = nil
+ Tk_FontNameTBL.mutex.synchronize{
+ unless (obj = Tk_FontNameTBL[name])
+ (obj = self.allocate).instance_eval{
+ @id = @compoundfont = name.to_s
+ @latinfont = nil
+ @kanjifont = nil
+ @descendant = [self, self] # [latin, kanji] : dummy
+ Tk_FontNameTBL[@id] = self
+ }
+ end
+ }
+ obj.instance_eval{ initialize(name, keys) }
+ obj
+ end
+
+ ###########################
+ private
+ ###########################
+ def initialize(name, keys=nil)
+ @id = @compoundfont = name.to_s
+
+ # if not exist named font, create it.
+ begin
+ if keys
+ tk_call('font', 'configure', @compoundfont, keys)
+ else
+ tk_call('font', 'configure', @compoundfont)
+ end
+ rescue
+ # the named font doesn't exist -> create
+ if keys
+ tk_call('font', 'create', @compoundfont, keys)
+ else
+ tk_call('font', 'create', @compoundfont)
+ end
+ end
+ end
+
+ def create_latinfont(fnt)
+ # ignore
+ end
+ def create_kanjifont(fnt)
+ # ignore
+ end
+ def create_compoundfont(ltn, knj, keys)
+ # ignore
+ end
+
+ ###########################
+ public
+ ###########################
+ def latin_font_id
+ @compoundfont
+ end
+ def kanji_font_id
+ @compoundfont
+ end
+end
+
+#######################################
+# define system font names
+#######################################
+if Tk::TCL_MAJOR_VERSION > 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ # add standard fonts of Tcl/Tk 8.5+
+ TkFont::SYSTEM_FONT_NAMES.add [
+ 'TkDefaultFont', 'TkTextFont', 'TkFixedFont', 'TkMenuFont',
+ 'TkHeadingFont', 'TkCaptionFont', 'TkSmallCaptionFont',
+ 'TkIconFont', 'TkTooltipFont'
+ ]
+end
+
+# platform-specific fonts
+# -- windows
+TkFont::SYSTEM_FONT_NAMES.add [
+ 'ansifixed', 'ansi', 'device', 'oemfixed', 'systemfixed', 'system'
+]
+
+# -- macintosh, macosx
+TkFont::SYSTEM_FONT_NAMES.add ['system', 'application']
+
+if Tk::TCL_MAJOR_VERSION > 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ TkFont::SYSTEM_FONT_NAMES.add ['menu']
+end
+
+# -- macosx (Aqua theme)
+if Tk::TCL_MAJOR_VERSION > 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION >= 5)
+ TkFont::SYSTEM_FONT_NAMES.add [
+ 'systemSystemFont', 'systemEmphasizedSystemFont',
+ 'systemSmallSystemFont', 'systemSmallEmphasizedSystemFont',
+ 'systemApplicationFont', 'systemLabelFont', 'systemViewsFont',
+ 'systemMenuTitleFont', 'systemMenuItemFont', 'systemMenuItemMarkFont',
+ 'systemMenuItemCmdKeyFont', 'systemWindowTitleFont',
+ 'systemPushButtonFont', 'systemUtilityWindowTitleFont',
+ 'systemAlertHeaderFont', 'systemToolbarFont', 'systemMiniSystemFont',
+ 'systemDetailSystemFont', 'systemDetailEmphasizedSystemFont'
+ ]
+end
+
+#######################################
+# autoload
+#######################################
+class TkFont
+ autoload :Chooser, 'tk/fontchooser'
+end
diff --git a/ext/tk/lib/tk/fontchooser.rb b/ext/tk/lib/tk/fontchooser.rb
new file mode 100644
index 0000000000..694c58a607
--- /dev/null
+++ b/ext/tk/lib/tk/fontchooser.rb
@@ -0,0 +1,176 @@
+#
+# tk/fontchooser.rb -- "tk fontchooser" support (Tcl/Tk8.6 or later)
+#
+require 'tk'
+require 'tk/font'
+
+module TkFont::Chooser
+ extend TkCore
+end
+
+class << TkFont::Chooser
+ def method_missing(id, *args)
+ name = id.id2name
+ case args.length
+ when 1
+ if name[-1] == ?=
+ configure name[0..-2], args[0]
+ args[0]
+ else
+ configure name, args[0]
+ self
+ end
+ when 0
+ begin
+ cget(name)
+ rescue
+ super(id, *args)
+ end
+ else
+ super(id, *args)
+ end
+ end
+
+ def __configinfo_value(key, val)
+ case key
+ when 'parent'
+ window(val)
+ when 'title'
+ val
+ when 'font'
+ if (lst = tk_split_simplelist(val)).size == 1
+ lst[0]
+ else
+ lst.map{|elem| num_or_str(elem)}
+ end
+ when 'command'
+ tk_tcl2ruby(val)
+ when 'visible'
+ bool(val)
+ else # unkown
+ val
+ end
+ end
+ private :__configinfo_value
+
+ def configinfo(option=nil)
+ if !option && TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ lst = tk_split_simplelist(tk_call('tk', 'fontchooser', 'configure'))
+ ret = []
+ TkComm.slice_ary(lst, 2){|k, v|
+ k = k[1..-1]
+ ret << [k, __configinfo_value(k, v)]
+ }
+ ret
+ else
+ current_configinfo(option)
+ end
+ end
+
+ def current_configinfo(option=nil)
+ if option
+ opt = option.to_s
+ fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.empty?
+ __configinfo_value(option.to_s, tk_call('tk','fontchooser',
+ 'configure',"-#{opt}"))
+ else
+ lst = tk_split_simplelist(tk_call('tk', 'fontchooser', 'configure'))
+ ret = {}
+ TkComm.slice_ary(lst, 2){|k, v|
+ k = k[1..-1]
+ ret[k] = __configinfo_value(k, v)
+ }
+ ret
+ end
+ end
+
+ def configure(option, value=None)
+ if option.kind_of? Hash
+ tk_call('tk', 'fontchooser', 'configure',
+ *hash_kv(_symbolkey2str(option)))
+ else
+ opt = option.to_s
+ fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.empty?
+ tk_call('tk', 'fontchooser', 'configure', "-#{opt}", value)
+ end
+ self
+ end
+
+ def configure_cmd(slot, value)
+ configure(slot, install_cmd(value))
+ end
+
+ def command(cmd=nil, &b)
+ if cmd
+ configure_cmd('command', cmd)
+ elsif b
+ configure_cmd('command', Proc.new(&b))
+ else
+ cget('command')
+ end
+ end
+
+ def cget(slot)
+ configinfo slot
+ end
+
+ def [](slot)
+ cget slot
+ end
+
+ def []=(slot, val)
+ configure slot, val
+ val
+ end
+
+ def show
+ tk_call('tk', 'fontchooser', 'show')
+ self
+ end
+
+ def hide
+ tk_call('tk', 'fontchooser', 'hide')
+ self
+ end
+
+ def toggle
+ cget(:visible) ? hide: show
+ self
+ end
+
+ def set_for(target, title="Font")
+ if target.kind_of? TkFont
+ configs = {
+ :font=>target.actual_hash,
+ :command=>proc{|fnt, *args|
+ target.configure(TkFont.actual_hash(fnt))
+ }
+ }
+ elsif target.kind_of? Hash
+ # key=>value list or OptionObj
+ fnt = target[:font] rescue ''
+ fnt = fnt.actual_hash if fnt.kind_of?(TkFont)
+ configs = {
+ :font => fnt,
+ :command=>proc{|fnt, *args|
+ target[:font] = TkFont.actual_hash(fnt)
+ }
+ }
+ else
+ configs = {
+ :font=>target.cget_tkstring(:font),
+ :command=>proc{|fnt, *args|
+ target.font = TkFont.actual_hash_displayof(fnt, target)
+ }
+ }
+ end
+
+ configs[:title] = title if title
+ configure(configs)
+ target
+ end
+
+ def unset
+ configure(:command, nil)
+ end
+end
diff --git a/ext/tk/lib/tk/frame.rb b/ext/tk/lib/tk/frame.rb
new file mode 100644
index 0000000000..5118939732
--- /dev/null
+++ b/ext/tk/lib/tk/frame.rb
@@ -0,0 +1,132 @@
+#
+# tk/frame.rb : treat frame widget
+#
+require 'tk'
+
+class Tk::Frame<TkWindow
+ TkCommandNames = ['frame'.freeze].freeze
+ WidgetClassName = 'Frame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+################# old version
+# def initialize(parent=nil, keys=nil)
+# if keys.kind_of? Hash
+# keys = keys.dup
+# @classname = keys.delete('classname') if keys.key?('classname')
+# @colormap = keys.delete('colormap') if keys.key?('colormap')
+# @container = keys.delete('container') if keys.key?('container')
+# @visual = keys.delete('visual') if keys.key?('visual')
+# end
+# super(parent, keys)
+# end
+#
+# def create_self
+# s = []
+# s << "-class" << @classname if @classname
+# s << "-colormap" << @colormap if @colormap
+# s << "-container" << @container if @container
+# s << "-visual" << @visual if @visual
+# tk_call 'frame', @path, *s
+# end
+#################
+
+ def __boolval_optkeys
+ super() << 'container'
+ end
+ private :__boolval_optkeys
+
+ def initialize(parent=nil, keys=nil)
+ my_class_name = nil
+ if self.class < WidgetClassNames[self.class::WidgetClassName]
+ my_class_name = self.class.name
+ my_class_name = nil if my_class_name == ''
+ end
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ else
+ if keys
+ keys = _symbolkey2str(keys)
+ keys['parent'] = parent
+ else
+ keys = {'parent'=>parent}
+ end
+ end
+ if keys.key?('classname')
+ keys['class'] = keys.delete('classname')
+ end
+ @classname = keys['class']
+ @colormap = keys['colormap']
+ @container = keys['container']
+ @visual = keys['visual']
+ if !@classname && my_class_name
+ keys['class'] = @classname = my_class_name
+ end
+ if @classname.kind_of? TkBindTag
+ @db_class = @classname
+ @classname = @classname.id
+ elsif @classname
+ @db_class = TkDatabaseClass.new(@classname)
+ else
+ @db_class = self.class
+ @classname = @db_class::WidgetClassName
+ end
+ super(keys)
+ end
+
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('frame', @path, *hash_kv(keys))
+ # else
+ # tk_call_without_enc( 'frame', @path)
+ # end
+ #end
+ #private :create_self
+
+ def database_classname
+ @classname
+ end
+
+ def self.database_class
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ self
+ else
+ TkDatabaseClass.new(self.name)
+ end
+ end
+ def self.database_classname
+ self.database_class.name
+ end
+
+ def self.bind(*args, &b)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args, &b)
+ else
+ TkDatabaseClass.new(self.name).bind(*args, &b)
+ end
+ end
+ def self.bind_append(*args, &b)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args, &b)
+ else
+ TkDatabaseClass.new(self.name).bind_append(*args, &b)
+ end
+ end
+ def self.bind_remove(*args)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args)
+ else
+ TkDatabaseClass.new(self.name).bind_remove(*args)
+ end
+ end
+ def self.bindinfo(*args)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args)
+ else
+ TkDatabaseClass.new(self.name).bindinfo(*args)
+ end
+ end
+end
+
+#TkFrame = Tk::Frame unless Object.const_defined? :TkFrame
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Frame, :TkFrame)
+Tk.__set_loaded_toplevel_aliases__('tk/frame.rb', :Tk, Tk::Frame, :TkFrame)
diff --git a/ext/tk/lib/tk/grid.rb b/ext/tk/lib/tk/grid.rb
new file mode 100644
index 0000000000..e1e07c44fa
--- /dev/null
+++ b/ext/tk/lib/tk/grid.rb
@@ -0,0 +1,279 @@
+#
+# tk/grid.rb : control grid geometry manager
+#
+require 'tk'
+
+module TkGrid
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['grid'.freeze].freeze
+
+ def anchor(master, anchor=None)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ tk_call_without_enc('grid', 'anchor', master, anchor)
+ end
+
+ def bbox(master, *args)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ args.unshift(master)
+ list(tk_call_without_enc('grid', 'bbox', *args))
+ end
+
+=begin
+ def configure(win, *args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ params = []
+ params.push(_epath(win))
+ args.each{|win|
+ case win
+ when '-', 'x', '^' # RELATIVE PLACEMENT
+ params.push(win)
+ else
+ params.push(_epath(win))
+ end
+ }
+ opts.each{|k, v|
+ params.push("-#{k}")
+ params.push((v.kind_of?(TkObject))? v.epath: v)
+ }
+ if Tk::TCL_MAJOR_VERSION < 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION <= 3)
+ if params[0] == '-' || params[0] == 'x' || params[0] == '^'
+ tk_call_without_enc('grid', *params)
+ else
+ tk_call_without_enc('grid', 'configure', *params)
+ end
+ else
+ tk_call_without_enc('grid', 'configure', *params)
+ end
+ end
+=end
+ def configure(*args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ fail ArgumentError, 'no widget is given' if args.empty?
+ params = []
+ args.flatten(1).each{|win|
+ case win
+ when '-', ?- # RELATIVE PLACEMENT (increase columnspan)
+ params.push('-')
+ when /^-+$/ # RELATIVE PLACEMENT (increase columnspan)
+ params.concat(win.to_s.split(//))
+ when '^', ?^ # RELATIVE PLACEMENT (increase rowspan)
+ params.push('^')
+ when /^\^+$/ # RELATIVE PLACEMENT (increase rowspan)
+ params.concat(win.to_s.split(//))
+ when 'x', :x, ?x, nil, '' # RELATIVE PLACEMENT (empty column)
+ params.push('x')
+ when /^x+$/ # RELATIVE PLACEMENT (empty column)
+ params.concat(win.to_s.split(//))
+ else
+ params.push(_epath(win))
+ end
+ }
+ opts.each{|k, v|
+ params.push("-#{k}")
+ params.push(_epath(v)) # have to use 'epath' (hash_kv() is unavailable)
+ }
+ if Tk::TCL_MAJOR_VERSION < 8 ||
+ (Tk::TCL_MAJOR_VERSION == 8 && Tk::TCL_MINOR_VERSION <= 3)
+ if params[0] == '-' || params[0] == 'x' || params[0] == '^'
+ tk_call_without_enc('grid', *params)
+ else
+ tk_call_without_enc('grid', 'configure', *params)
+ end
+ else
+ tk_call_without_enc('grid', 'configure', *params)
+ end
+ end
+ alias grid configure
+
+ def columnconfigure(master, index, args)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ tk_call_without_enc("grid", 'columnconfigure',
+ master, index, *hash_kv(args))
+ end
+
+ def rowconfigure(master, index, args)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ tk_call_without_enc("grid", 'rowconfigure', master, index, *hash_kv(args))
+ end
+
+ def columnconfiginfo(master, index, slot=nil)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ if slot
+ case slot
+ when 'uniform', :uniform
+ tk_call_without_enc('grid', 'columnconfigure',
+ master, index, "-#{slot}")
+ else
+ num_or_str(tk_call_without_enc('grid', 'columnconfigure',
+ master, index, "-#{slot}"))
+ end
+ else
+ #ilist = list(tk_call_without_enc('grid','columnconfigure',master,index))
+ ilist = simplelist(tk_call_without_enc('grid', 'columnconfigure',
+ master, index))
+ info = {}
+ while key = ilist.shift
+ case key
+ when 'uniform'
+ info[key[1..-1]] = ilist.shift
+ else
+ info[key[1..-1]] = tk_tcl2ruby(ilist.shift)
+ end
+ end
+ info
+ end
+ end
+
+ def rowconfiginfo(master, index, slot=nil)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ if slot
+ case slot
+ when 'uniform', :uniform
+ tk_call_without_enc('grid', 'rowconfigure',
+ master, index, "-#{slot}")
+ else
+ num_or_str(tk_call_without_enc('grid', 'rowconfigure',
+ master, index, "-#{slot}"))
+ end
+ else
+ #ilist = list(tk_call_without_enc('grid', 'rowconfigure', master, index))
+ ilist = simplelist(tk_call_without_enc('grid', 'rowconfigure',
+ master, index))
+ info = {}
+ while key = ilist.shift
+ case key
+ when 'uniform'
+ info[key[1..-1]] = ilist.shift
+ else
+ info[key[1..-1]] = tk_tcl2ruby(ilist.shift)
+ end
+ end
+ info
+ end
+ end
+
+ def column(master, index, keys=nil)
+ if keys.kind_of?(Hash)
+ columnconfigure(master, index, keys)
+ else
+ columnconfiginfo(master, index, keys)
+ end
+ end
+
+ def row(master, index, keys=nil)
+ if keys.kind_of?(Hash)
+ rowconfigure(master, index, keys)
+ else
+ rowconfiginfo(master, index, keys)
+ end
+ end
+
+ def add(widget, *args)
+ configure(widget, *args)
+ end
+
+ def forget(*args)
+ return '' if args.size == 0
+ wins = args.collect{|win|
+ # (win.kind_of?(TkObject))? win.epath: win
+ _epath(win)
+ }
+ tk_call_without_enc('grid', 'forget', *wins)
+ end
+
+ def info(slave)
+ # slave = slave.epath if slave.kind_of?(TkObject)
+ slave = _epath(slave)
+ #ilist = list(tk_call_without_enc('grid', 'info', slave))
+ ilist = simplelist(tk_call_without_enc('grid', 'info', slave))
+ info = {}
+ while key = ilist.shift
+ #info[key[1..-1]] = ilist.shift
+ info[key[1..-1]] = tk_tcl2ruby(ilist.shift)
+ end
+ return info
+ end
+
+ def location(master, x, y)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ list(tk_call_without_enc('grid', 'location', master, x, y))
+ end
+
+ def propagate(master, mode=None)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ if mode == None
+ bool(tk_call_without_enc('grid', 'propagate', master))
+ else
+ tk_call_without_enc('grid', 'propagate', master, mode)
+ end
+ end
+
+ def remove(*args)
+ return '' if args.size == 0
+ wins = args.collect{|win|
+ # (win.kind_of?(TkObject))? win.epath: win
+ _epath(win)
+ }
+ tk_call_without_enc('grid', 'remove', *wins)
+ end
+
+ def size(master)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ list(tk_call_without_enc('grid', 'size', master))
+ end
+
+ def slaves(master, keys=nil)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ list(tk_call_without_enc('grid', 'slaves', master, *hash_kv(args)))
+ end
+
+ module_function :anchor, :bbox, :add, :forget, :propagate, :info
+ module_function :remove, :size, :slaves, :location
+ module_function :grid, :configure, :columnconfigure, :rowconfigure
+ module_function :column, :row, :columnconfiginfo, :rowconfiginfo
+end
+=begin
+def TkGrid(win, *args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ params = []
+ params.push((win.kind_of?(TkObject))? win.epath: win)
+ args.each{|win|
+ case win
+ when '-', 'x', '^' # RELATIVE PLACEMENT
+ params.push(win)
+ else
+ params.push((win.kind_of?(TkObject))? win.epath: win)
+ end
+ }
+ opts.each{|k, v|
+ params.push("-#{k}")
+ params.push((v.kind_of?(TkObject))? v.epath: v)
+ }
+ tk_call_without_enc("grid", *params)
+end
+=end
diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb
new file mode 100644
index 0000000000..972383982f
--- /dev/null
+++ b/ext/tk/lib/tk/image.rb
@@ -0,0 +1,395 @@
+#
+# tk/image.rb : treat Tk image objects
+#
+
+require 'tk'
+
+class TkImage<TkObject
+ include Tk
+
+ TkCommandNames = ['image'.freeze].freeze
+
+ Tk_IMGTBL = TkCore::INTERP.create_table
+
+ (Tk_Image_ID = ['i'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ Tk_IMGTBL.mutex.synchronize{ Tk_IMGTBL.clear }
+ }
+
+ def self.new(keys=nil)
+ 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('image', 'create',
+ @type, @path, *hash_kv(keys, true))
+ }
+ end
+ return obj
+ end
+ end
+ end
+ (obj = self.allocate).instance_eval{
+ Tk_IMGTBL.mutex.synchronize{
+ initialize(keys)
+ Tk_IMGTBL[@path] = self
+ }
+ }
+ obj
+ end
+
+ def initialize(keys=nil)
+ @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('image', 'create',
+ @type, @path, *hash_kv(keys, true))
+ end
+ end
+
+ def delete
+ Tk_IMGTBL.mutex.synchronize{
+ Tk_IMGTBL.delete(@id) if @id
+ }
+ tk_call_without_enc('image', 'delete', @path)
+ self
+ end
+ def height
+ number(tk_call_without_enc('image', 'height', @path))
+ end
+ def inuse
+ bool(tk_call_without_enc('image', 'inuse', @path))
+ end
+ def itemtype
+ tk_call_without_enc('image', 'type', @path)
+ end
+ def width
+ number(tk_call_without_enc('image', 'width', @path))
+ end
+
+ def TkImage.names
+ Tk_IMGTBL.mutex.synchronize{
+ Tk.tk_call_without_enc('image', 'names').split.collect!{|id|
+ (Tk_IMGTBL[id])? Tk_IMGTBL[id] : id
+ }
+ }
+ end
+
+ def TkImage.types
+ Tk.tk_call_without_enc('image', 'types').split
+ end
+end
+
+class TkBitmapImage<TkImage
+ def __strval_optkeys
+ super() + ['maskdata', 'maskfile']
+ end
+ private :__strval_optkeys
+
+ def initialize(*args)
+ @type = 'bitmap'
+ super(*args)
+ end
+end
+
+# A photo is an image whose pixels can display any color or be transparent.
+# At present, only GIF and PPM/PGM formats are supported, but an interface
+# exists to allow additional image file formats to be added easily.
+#
+# This class documentation is a copy from the original Tcl/Tk at
+# http://www.tcl.tk/man/tcl8.5/TkCmd/photo.htm with some rewritten parts.
+class TkPhotoImage<TkImage
+ NullArgOptionKeys = [ "shrink", "grayscale" ]
+
+ def _photo_hash_kv(keys)
+ keys = _symbolkey2str(keys)
+ NullArgOptionKeys.collect{|opt|
+ if keys[opt]
+ keys[opt] = None
+ else
+ keys.delete(opt)
+ end
+ }
+ keys.collect{|k,v|
+ ['-' << k, v]
+ }.flatten
+ end
+ private :_photo_hash_kv
+
+ # Create a new image with the given options.
+ # == Examples of use :
+ # === Create an empty image of 300x200 pixels
+ #
+ # image = TkPhotoImage.new(:height => 200, :width => 300)
+ #
+ # === Create an image from a file
+ #
+ # image = TkPhotoImage.new(:file: => 'my_image.gif')
+ #
+ # == Options
+ # Photos support the following options:
+ # * :data
+ # Specifies the contents of the image as a string.
+ # * :format
+ # Specifies the name of the file format for the data.
+ # * :file
+ # Gives the name of a file that is to be read to supply data for the image.
+ # * :gamma
+ # Specifies that the colors allocated for displaying this image in a window
+ # should be corrected for a non-linear display with the specified gamma
+ # exponent value.
+ # * height
+ # Specifies the height of the image, in pixels. This option is useful
+ # primarily in situations where the user wishes to build up the contents of
+ # the image piece by piece. A value of zero (the default) allows the image
+ # to expand or shrink vertically to fit the data stored in it.
+ # * palette
+ # Specifies the resolution of the color cube to be allocated for displaying
+ # this image.
+ # * width
+ # Specifies the width of the image, in pixels. This option is useful
+ # primarily in situations where the user wishes to build up the contents of
+ # the image piece by piece. A value of zero (the default) allows the image
+ # to expand or shrink horizontally to fit the data stored in it.
+ def initialize(*args)
+ @type = 'photo'
+ super(*args)
+ end
+
+ # Blank the image; that is, set the entire image to have no data, so it will
+ # be displayed as transparent, and the background of whatever window it is
+ # displayed in will show through.
+ def blank
+ tk_send_without_enc('blank')
+ self
+ end
+
+ def cget_strict(option)
+ case option.to_s
+ when 'data', 'file'
+ tk_send 'cget', '-' << option.to_s
+ else
+ tk_tcl2ruby(tk_send('cget', '-' << option.to_s))
+ end
+ end
+
+ # Returns the current value of the configuration option given by option.
+ # Example, display name of the file from which <tt>image</tt> was created:
+ # puts image.cget :file
+ def cget(option)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ cget_strict(option)
+ else
+ begin
+ cget_strict(option)
+ rescue => e
+ if current_configinfo.has_key?(option.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ end
+ end
+ end
+
+ # Copies a region from the image called source to the image called
+ # destination, possibly with pixel zooming and/or subsampling. If no options
+ # are specified, this method copies the whole of source into destination,
+ # starting at coordinates (0,0) in destination. The following options may be
+ # specified:
+ #
+ # * :from [x1, y1, x2, y2]
+ # Specifies a rectangular sub-region of the source image to be copied.
+ # (x1,y1) and (x2,y2) specify diagonally opposite corners of the rectangle.
+ # If x2 and y2 are not specified, the default value is the bottom-right
+ # corner of the source image. The pixels copied will include the left and
+ # top edges of the specified rectangle but not the bottom or right edges.
+ # If the :from option is not given, the default is the whole source image.
+ # * :to [x1, y1, x2, y2]
+ # Specifies a rectangular sub-region of the destination image to be
+ # affected. (x1,y1) and (x2,y2) specify diagonally opposite corners of the
+ # rectangle. If x2 and y2 are not specified, the default value is (x1,y1)
+ # plus the size of the source region (after subsampling and zooming, if
+ # specified). If x2 and y2 are specified, the source region will be
+ # replicated if necessary to fill the destination region in a tiled fashion.
+ # * :shrink
+ # Specifies that the size of the destination image should be reduced, if
+ # necessary, so that the region being copied into is at the bottom-right
+ # corner of the image. This option will not affect the width or height of
+ # the image if the user has specified a non-zero value for the :width or
+ # :height configuration option, respectively.
+ # * :zoom [x, y]
+ # Specifies that the source region should be magnified by a factor of x
+ # in the X direction and y in the Y direction. If y is not given, the
+ # default value is the same as x. With this option, each pixel in the
+ # source image will be expanded into a block of x x y pixels in the
+ # destination image, all the same color. x and y must be greater than 0.
+ # * :subsample [x, y]
+ # Specifies that the source image should be reduced in size by using only
+ # every xth pixel in the X direction and yth pixel in the Y direction.
+ # Negative values will cause the image to be flipped about the Y or X axes,
+ # respectively. If y is not given, the default value is the same as x.
+ # * :compositingrule rule
+ # Specifies how transparent pixels in the source image are combined with
+ # the destination image. When a compositing rule of <tt>overlay</tt> is set,
+ # the old contents of the destination image are visible, as if the source
+ # image were printed on a piece of transparent film and placed over the
+ # top of the destination. When a compositing rule of <tt>set</tt> is set,
+ # the old contents of the destination image are discarded and the source
+ # image is used as-is. The default compositing rule is <tt>overlay</tt>.
+ def copy(src, *opts)
+ if opts.size == 0
+ tk_send('copy', src)
+ elsif opts.size == 1 && opts[0].kind_of?(Hash)
+ tk_send('copy', src, *_photo_hash_kv(opts[0]))
+ else
+ # for backward compatibility
+ args = opts.collect{|term|
+ if term.kind_of?(String) && term.include?(?\s)
+ term.split
+ else
+ term
+ end
+ }.flatten
+ tk_send('copy', src, *args)
+ end
+ self
+ end
+
+ # Returns image data in the form of a string. The following options may be
+ # specified:
+ # * :background color
+ # If the color is specified, the data will not contain any transparency
+ # information. In all transparent pixels the color will be replaced by the
+ # specified color.
+ # * :format format-name
+ # Specifies the name of the image file format handler to be used.
+ # Specifically, this subcommand searches for the first handler whose name
+ # matches an initial substring of format-name and which has the capability
+ # to read this image data. If this option is not given, this subcommand
+ # uses the first handler that has the capability to read the image data.
+ # * :from [x1, y1, x2, y2]
+ # Specifies a rectangular region of imageName to be returned. If only x1
+ # and y1 are specified, the region extends from (x1,y1) to the bottom-right
+ # corner of imageName. If all four coordinates are given, they specify
+ # diagonally opposite corners of the rectangular region, including x1,y1
+ # and excluding x2,y2. The default, if this option is not given, is the
+ # whole image.
+ # * :grayscale
+ # If this options is specified, the data will not contain color information.
+ # All pixel data will be transformed into grayscale.
+ def data(keys={})
+ tk_split_list(tk_send('data', *_photo_hash_kv(keys)))
+ end
+
+ # Returns the color of the pixel at coordinates (x,y) in the image as a list
+ # of three integers between 0 and 255, representing the red, green and blue
+ # components respectively.
+ def get(x, y)
+ tk_send('get', x, y).split.collect{|n| n.to_i}
+ end
+
+ def put(data, *opts)
+ if opts.empty?
+ tk_send('put', data)
+ elsif opts.size == 1 && opts[0].kind_of?(Hash)
+ tk_send('put', data, *_photo_hash_kv(opts[0]))
+ else
+ # for backward compatibility
+ tk_send('put', data, '-to', *opts)
+ end
+ self
+ end
+
+ def read(file, *opts)
+ if opts.size == 0
+ tk_send('read', file)
+ elsif opts.size == 1 && opts[0].kind_of?(Hash)
+ tk_send('read', file, *_photo_hash_kv(opts[0]))
+ else
+ # for backward compatibility
+ args = opts.collect{|term|
+ if term.kind_of?(String) && term.include?(?\s)
+ term.split
+ else
+ term
+ end
+ }.flatten
+ tk_send('read', file, *args)
+ end
+ self
+ end
+
+ def redither
+ tk_send 'redither'
+ self
+ end
+
+ # Returns a boolean indicating if the pixel at (x,y) is transparent.
+ def get_transparency(x, y)
+ bool(tk_send('transparency', 'get', x, y))
+ end
+
+ # Makes the pixel at (x,y) transparent if <tt>state</tt> is true, and makes
+ # that pixel opaque otherwise.
+ def set_transparency(x, y, state)
+ tk_send('transparency', 'set', x, y, state)
+ self
+ end
+
+ def write(file, *opts)
+ if opts.size == 0
+ tk_send('write', file)
+ elsif opts.size == 1 && opts[0].kind_of?(Hash)
+ tk_send('write', file, *_photo_hash_kv(opts[0]))
+ else
+ # for backward compatibility
+ args = opts.collect{|term|
+ if term.kind_of?(String) && term.include?(?\s)
+ term.split
+ else
+ term
+ end
+ }.flatten
+ tk_send('write', file, *args)
+ end
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/itemconfig.rb b/ext/tk/lib/tk/itemconfig.rb
new file mode 100644
index 0000000000..14396048ba
--- /dev/null
+++ b/ext/tk/lib/tk/itemconfig.rb
@@ -0,0 +1,1222 @@
+#
+# tk/itemconfig.rb : control item/tag configuration of widget
+#
+require 'tk'
+require 'tkutil'
+require 'tk/itemfont.rb'
+
+module TkItemConfigOptkeys
+ include TkUtil
+
+ def __item_optkey_aliases(id)
+ {}
+ end
+ private :__item_optkey_aliases
+
+ def __item_numval_optkeys(id)
+ []
+ end
+ private :__item_numval_optkeys
+
+ def __item_numstrval_optkeys(id)
+ []
+ end
+ private :__item_numstrval_optkeys
+
+ def __item_boolval_optkeys(id)
+ ['exportselection', 'jump', 'setgrid', 'takefocus']
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ # maybe need to override
+ [
+ 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile',
+ 'activebackground', 'activeforeground', 'background',
+ 'disabledforeground', 'disabledbackground', 'foreground',
+ 'highlightbackground', 'highlightcolor', 'insertbackground',
+ 'selectbackground', 'selectforeground', 'troughcolor'
+ ]
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+
+ def __item_numlistval_optkeys(id)
+ # maybe need to override
+ ['dash', 'activedash', 'disableddash']
+ end
+ private :__item_numlistval_optkeys
+
+ def __item_tkvariable_optkeys(id)
+ ['variable', 'textvariable']
+ end
+ private :__item_tkvariable_optkeys
+
+ def __item_val2ruby_optkeys(id) # { key=>method, ... }
+ # The method is used to convert a opt-value to a ruby's object.
+ # When get the value of the option "key", "method.call(id, val)" is called.
+ {}
+ end
+ private :__item_val2ruby_optkeys
+
+ def __item_ruby2val_optkeys(id) # { key=>method, ... }
+ # The method is used to convert a ruby's object to a opt-value.
+ # When set the value of the option "key", "method.call(id, val)" is called.
+ # That is, "-#{key} #{method.call(id, value)}".
+ {}
+ end
+ private :__item_ruby2val_optkeys
+
+ def __item_methodcall_optkeys(id) # { key=>method, ... }
+ # Use the method for both of get and set.
+ # Usually, the 'key' will not be a widget option.
+ #
+ # maybe need to override
+ # {'coords'=>'coords'}
+ {}
+ end
+ private :__item_methodcall_optkeys
+
+ ################################################
+
+ def __item_keyonly_optkeys(id) # { def_key=>(undef_key|nil), ... }
+ # maybe need to override
+ {}
+ end
+ private :__item_keyonly_optkeys
+
+
+ def __conv_item_keyonly_opts(id, keys)
+ return keys unless keys.kind_of?(Hash)
+ keyonly = __item_keyonly_optkeys(id)
+ keys2 = {}
+ keys.each{|k, v|
+ optkey = keyonly.find{|kk,vv| kk.to_s == k.to_s}
+ if optkey
+ defkey, undefkey = optkey
+ if v
+ keys2[defkey.to_s] = None
+ else
+ keys2[undefkey.to_s] = None
+ end
+ else
+ keys2[k.to_s] = v
+ end
+ }
+ keys2
+ end
+
+ def itemconfig_hash_kv(id, keys, enc_mode = nil, conf = nil)
+ hash_kv(__conv_item_keyonly_opts(id, keys), enc_mode, conf)
+ end
+end
+
+module TkItemConfigMethod
+ include TkUtil
+ include TkTreatItemFont
+ include TkItemConfigOptkeys
+
+ def TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ @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
+
+ def __item_cget_cmd(id)
+ # maybe need to override
+ [self.path, 'itemcget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ # maybe need to override
+ [self.path, 'itemconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_confinfo_cmd(id)
+ # maybe need to override
+ __item_config_cmd(id)
+ end
+ private :__item_confinfo_cmd
+
+ def __item_configinfo_struct(id)
+ # maybe need to override
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
+ :default_value=>3, :current_value=>4}
+ end
+ private :__item_configinfo_struct
+
+ ################################################
+
+ def tagid(tagOrId)
+ # maybe need to override
+ tagOrId
+ end
+
+ ################################################
+
+
+ def itemcget_tkstring(tagOrId, option)
+ opt = option.to_s
+ fail ArgumentError, "Invalid option `#{option.inspect}'" if opt.length == 0
+ tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{opt}"))
+ end
+
+ def __itemcget_core(tagOrId, option)
+ orig_opt = option
+ option = option.to_s
+
+ if option.length == 0
+ fail ArgumentError, "Invalid option `#{orig_opt.inspect}'"
+ end
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == option}
+ if real_name
+ option = real_name.to_s
+ end
+
+ if ( method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[option] )
+ optval = tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}"))
+ begin
+ return method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ return optval
+ end
+ end
+
+ if ( method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[option] )
+ return self.__send__(method, tagOrId)
+ end
+
+ case option
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ number(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
+ rescue
+ nil
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ num_or_str(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ bool(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
+ rescue
+ nil
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ simplelist(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ conf = tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}"))
+ if conf =~ /^[0-9]/
+ list(conf)
+ else
+ conf
+ end
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ v = tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}"))
+ (v.empty?)? nil: TkVarAccess.new(v)
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ _fromUTF8(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")))
+
+ when /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/
+ fontcode = $1
+ fontkey = $2
+ fnt = tk_tcl2ruby(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{fontkey}")), true)
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(tagid(tagOrId), fontkey)
+ end
+ if fontcode == 'kanji' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(tk_call_without_enc(*(__item_cget_cmd(tagid(tagOrId)) << "-#{option}")), true)
+ end
+ end
+ private :__itemcget_core
+
+ def itemcget(tagOrId, option)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __itemcget_core(tagOrId, option)
+ else
+ begin
+ __itemcget_core(tagOrId, option)
+ rescue => e
+ begin
+ if __current_itemconfiginfo(tagOrId).has_key?(option.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ def itemcget_strict(tagOrId, option)
+ # never use TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __itemcget_core(tagOrId, option)
+ end
+
+ def __itemconfigure_core(tagOrId, slot, value=None)
+ if slot.kind_of? Hash
+ slot = _symbolkey2str(slot)
+
+ __item_optkey_aliases(tagid(tagOrId)).each{|alias_name, real_name|
+ alias_name = alias_name.to_s
+ if slot.has_key?(alias_name)
+ slot[real_name.to_s] = slot.delete(alias_name)
+ end
+ }
+
+ __item_methodcall_optkeys(tagid(tagOrId)).each{|key, method|
+ value = slot.delete(key.to_s)
+ self.__send__(method, tagOrId, value) if value
+ }
+
+ __item_ruby2val_optkeys(tagid(tagOrId)).each{|key, method|
+ key = key.to_s
+ slot[key] = method.call(tagOrId, slot[key]) if slot.has_key?(key)
+ }
+
+ __item_keyonly_optkeys(tagid(tagOrId)).each{|defkey, undefkey|
+ conf = slot.find{|kk, vv| kk == defkey.to_s}
+ if conf
+ k, v = conf
+ if v
+ slot[k] = None
+ else
+ slot[undefkey.to_s] = None if undefkey
+ slot.delete(k)
+ end
+ end
+ }
+
+ if (slot.find{|k, v| k =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/})
+ tagfont_configure(tagid(tagOrId), slot)
+ elsif slot.size > 0
+ tk_call(*(__item_config_cmd(tagid(tagOrId)).concat(hash_kv(slot))))
+ end
+
+ else
+ orig_slot = slot
+ slot = slot.to_s
+ if slot.length == 0
+ fail ArgumentError, "Invalid option `#{orig_slot.inspect}'"
+ end
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ if ( conf = __item_keyonly_optkeys(tagid(tagOrId)).find{|k, v| k.to_s == slot } )
+ defkey, undefkey = conf
+ if value
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{defkey}"))
+ elsif undefkey
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{undefkey}"))
+ end
+ elsif ( method = _symbolkey2str(__item_ruby2val_optkeys(tagid(tagOrId)))[slot] )
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{slot}" << method.call(tagOrId, value)))
+ elsif ( method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot] )
+ self.__send__(method, tagOrId, value)
+ elsif (slot =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
+ if value == None
+ tagfontobj(tagid(tagOrId), $2)
+ else
+ tagfont_configure(tagid(tagOrId), {slot=>value})
+ end
+ else
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{slot}" << value))
+ end
+ end
+ self
+ end
+ private :__itemconfigure_core
+
+ def __check_available_itemconfigure_options(tagOrId, keys)
+ id = tagid(tagOrId)
+
+ availables = self.__current_itemconfiginfo(id).keys
+
+ # add non-standard keys
+ availables |= __font_optkeys.map{|k|
+ [k.to_s, "latin#{k}", "ascii#{k}", "kanji#{k}"]
+ }.flatten
+ availables |= __item_methodcall_optkeys(id).keys.map{|k| k.to_s}
+ availables |= __item_keyonly_optkeys(id).keys.map{|k| k.to_s}
+
+ keys = _symbolkey2str(keys)
+
+ keys.delete_if{|k, v| !(availables.include?(k))}
+ end
+
+ def itemconfigure(tagOrId, slot, value=None)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ __itemconfigure_core(tagOrId, slot, value)
+ else
+ if slot.kind_of?(Hash)
+ begin
+ __itemconfigure_core(tagOrId, slot)
+ rescue
+ slot = __check_available_itemconfigure_options(tagOrId, slot)
+ __itemconfigure_core(tagOrId, slot) unless slot.empty?
+ end
+ else
+ begin
+ __itemconfigure_core(tagOrId, slot, value)
+ rescue => e
+ begin
+ if __current_itemconfiginfo(tagOrId).has_key?(slot.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ self
+ end
+
+ def __itemconfiginfo_core(tagOrId, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
+ fontkey = $2
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")), false, true)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ fnt = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkNamedFont.new(fnt)
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = tagfontobj(tagid(tagOrId), fontkey)
+ elsif ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+ conf
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = val
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = val
+ end
+
+ when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
+ return [slot, '', '', '', self.__send__(method, tagOrId)]
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_list(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), 0, false, true)
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+
+ conf
+
+ else
+ # ret = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))))).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ ret = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+
+ optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]]
+ case optkey
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[optkey]
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ begin
+ val = method(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = val
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = val
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # do nothing
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]].index('{')
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ end
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]].index('{')
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+ end
+ end
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?- )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+
+ conf
+ }
+
+ __item_font_optkeys(tagid(tagOrId)).each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret.assoc(optkey)
+ if fontconf && fontconf.size > 2
+ ret.delete_if{|inf| inf[0] =~ /^(|latin|ascii|kanji)#{optkey}$/}
+ fnt = fontconf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ fontconf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkNamedFont.new(fnt)
+ end
+ fontconf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = tagfontobj(tagid(tagOrId), optkey)
+ ret.push(fontconf)
+ end
+ }
+
+ __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
+ ret << [optkey.to_s, '', '', '', self.__send__(method, tagOrId)]
+ }
+
+ ret
+ end
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
+ fontkey = $2
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{fontkey}")), false, true)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ fnt = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkNamedFont.new(fnt)
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = tagfontobj(tagid(tagOrId), fontkey)
+ { conf.shift => conf }
+ elsif ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?-
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+ { conf[0] => conf[1] }
+ else
+ { conf.shift => conf }
+ end
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = val
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = val
+ end
+
+ when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
+ return {slot => ['', '', '', self.__send__(method, tagOrId)]}
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ num_or_stre(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # conf = tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ conf = tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), false, true)
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ # conf = tk_split_list(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))))
+ conf = tk_split_list(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")), 0, false, true)
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?-
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+ { conf[0] => conf[1] }
+ else
+ { conf.shift => conf }
+ end
+
+ else
+ ret = {}
+ # tk_split_simplelist(_fromUTF8(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))))).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:key]][1..-1]
+
+ optkey = conf[__item_configinfo_struct(tagid(tagOrId))[:key]]
+ case optkey
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[optkey]
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = val
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ optval = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = val
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # do nothing
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ number(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ num_or_str(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ begin
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ bool(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ rescue
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ end
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ simplelist(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =~ /^[0-9]/ )
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkVarAccess.new(v)
+ end
+ end
+ if ( conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] )
+ v = conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if v.empty?
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = nil
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = TkVarAccess.new(v)
+ end
+ end
+
+ else
+ if ( __item_configinfo_struct(tagid(tagOrId))[:default_value] \
+ && conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] )
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]].index('{')
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] =
+ tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:default_value]])
+ end
+ end
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]]
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]].index('{')
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ tk_split_list(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ else
+ conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] =
+ tk_tcl2ruby(conf[__item_configinfo_struct(tagid(tagOrId))[:current_value]])
+ end
+ end
+ end
+
+ if ( __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ && conf.size == __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ if conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][0] == ?-
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]] =
+ conf[__item_configinfo_struct(tagid(tagOrId))[:alias]][1..-1]
+ end
+ ret[conf[0]] = conf[1]
+ else
+ ret[conf.shift] = conf
+ end
+ }
+
+ __item_font_optkeys(tagid(tagOrId)).each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret[optkey]
+ if fontconf.kind_of?(Array)
+ ret.delete(optkey)
+ ret.delete('latin' << optkey)
+ ret.delete('ascii' << optkey)
+ ret.delete('kanji' << optkey)
+ fnt = fontconf[__item_configinfo_struct(tagid(tagOrId))[:default_value]]
+ if TkFont.is_system_font?(fnt)
+ fontconf[__item_configinfo_struct(tagid(tagOrId))[:default_value]] = TkNamedFont.new(fnt)
+ end
+ fontconf[__item_configinfo_struct(tagid(tagOrId))[:current_value]] = tagfontobj(tagid(tagOrId), optkey)
+ ret[optkey] = fontconf
+ end
+ }
+
+ __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
+ ret[optkey.to_s] = ['', '', '', self.__send__(method, tagOrId)]
+ }
+
+ ret
+ end
+ end
+ end
+ end
+ private :__itemconfiginfo_core
+
+ def itemconfiginfo(tagOrId, slot = nil)
+ if slot && TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ begin
+ __itemconfiginfo_core(tagOrId, slot)
+ rescue => e
+ begin
+ __itemconfiginfo_core(tagOrId)
+ # not tag error -> option is unknown
+ Array.new(__item_configinfo_struct.values.max).unshift(slot.to_s)
+ rescue
+ fail e # tag error
+ end
+ end
+ else
+ __itemconfiginfo_core(tagOrId, slot)
+ end
+ end
+
+ def __current_itemconfiginfo(tagOrId, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ org_slot = slot
+ begin
+ conf = __itemconfiginfo_core(tagOrId, slot)
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ return {conf[0] => conf[-1]}
+ end
+ slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]]
+ end while(org_slot != slot)
+ fail RuntimeError,
+ "there is a configure alias loop about '#{org_slot}'"
+ else
+ ret = {}
+ __itemconfiginfo_core(tagOrId).each{|conf|
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ ret[conf[0]] = conf[-1]
+ end
+ }
+
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ __itemconfiginfo_core(tagOrId, slot).each{|key, conf|
+ ret[key] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+
+ def current_itemconfiginfo(tagOrId, slot = nil)
+ __current_itemconfiginfo(tagOrId, slot)
+ end
+end
diff --git a/ext/tk/lib/tk/itemfont.rb b/ext/tk/lib/tk/itemfont.rb
new file mode 100644
index 0000000000..b5da4fa1ef
--- /dev/null
+++ b/ext/tk/lib/tk/itemfont.rb
@@ -0,0 +1,327 @@
+#
+# tk/itemfont.rb : control font of widget items
+#
+require 'tk'
+
+module TkItemFontOptkeys
+ def __item_font_optkeys(id)
+ # maybe need to override
+ ['font']
+ end
+ private :__item_font_optkeys
+end
+
+module TkTreatItemFont
+ include TkItemFontOptkeys
+
+ def __item_pathname(id)
+ # maybe need to override
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ ################################################
+
+ def tagfont_configinfo(tagOrId, key = nil)
+ optkeys = __item_font_optkeys(tagid(tagOrId))
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __item_pathname(tagid(tagOrId)).split(';')
+
+ if key
+ pathname = [win, tag, key].join(';')
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname,
+ *(__item_confinfo_cmd(tagid(tagOrId))))
+ elsif optkeys.size == 1
+ pathname = [win, tag, optkeys[0]].join(';')
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname,
+ *(__item_confinfo_cmd(tagid(tagOrId))))
+ else
+ fonts = {}
+ optkeys.each{|key|
+ key = key.to_s
+ pathname = [win, tag, key].join(';')
+ fonts[key] =
+ TkFont.used_on(pathname) ||
+ TkFont.init_widget_font(pathname,
+ *(__item_confinfo_cmd(tagid(tagOrId))))
+ }
+ fonts
+ end
+ end
+ alias tagfontobj tagfont_configinfo
+
+ def tagfont_configure(tagOrId, slot)
+ pathname = __item_pathname(tagid(tagOrId))
+
+ slot = _symbolkey2str(slot)
+
+ __item_font_optkeys(tagid(tagOrId)).each{|optkey|
+ optkey = optkey.to_s
+ l_optkey = 'latin' << optkey
+ a_optkey = 'ascii' << optkey
+ k_optkey = 'kanji' << optkey
+
+ if slot.key?(optkey)
+ fnt = slot.delete(optkey)
+ if fnt.kind_of?(TkFont)
+ slot.delete(l_optkey)
+ slot.delete(a_optkey)
+ slot.delete(k_optkey)
+
+ fnt.call_font_configure([pathname, optkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ next
+ else
+ if fnt
+ if (slot.key?(l_optkey) ||
+ slot.key?(a_optkey) ||
+ slot.key?(k_optkey))
+ fnt = TkFont.new(fnt)
+
+ lfnt = slot.delete(l_optkey)
+ lfnt = slot.delete(a_optkey) if slot.key?(a_optkey)
+ kfnt = slot.delete(k_optkey)
+
+ fnt.latin_replace(lfnt) if lfnt
+ fnt.kanji_replace(kfnt) if kfnt
+
+ fnt.call_font_configure([pathname, optkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ next
+ else
+ fnt = hash_kv(fnt) if fnt.kind_of?(Hash)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << fnt))
+ else
+ begin
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << fnt))
+ rescue => e
+ # ignore
+ end
+ end
+ end
+ end
+ next
+ end
+ end
+
+ lfnt = slot.delete(l_optkey)
+ lfnt = slot.delete(a_optkey) if slot.key?(a_optkey)
+ kfnt = slot.delete(k_optkey)
+
+ if lfnt && kfnt
+ TkFont.new(lfnt, kfnt).call_font_configure([pathname, optkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ elsif lfnt
+ latintagfont_configure([lfnt, optkey])
+ elsif kfnt
+ kanjitagfont_configure([kfnt, optkey])
+ end
+ }
+
+ # configure other (without font) options
+ tk_call(*(__item_config_cmd(tagid(tagOrId)).concat(hash_kv(slot)))) if slot != {}
+ self
+ end
+
+ def latintagfont_configure(tagOrId, ltn, keys=nil)
+ if ltn.kind_of?(Array)
+ key = ltn[1]
+ ltn = ltn[0]
+ else
+ key = nil
+ end
+
+ optkeys = __item_font_optkeys(tagid(tagOrId))
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __item_pathname(tagid(tagOrId)).split(';')
+
+ optkeys = [key] if key
+
+ optkeys.each{|optkey|
+ optkey = optkey.to_s
+
+ pathname = [win, tag, optkey].join(';')
+
+ if (fobj = TkFont.used_on(pathname))
+ fobj = TkFont.new(fobj) # create a new TkFont object
+ elsif Tk::JAPANIZED_TK
+ fobj = fontobj # create a new TkFont object
+ else
+ ltn = hash_kv(ltn) if ltn.kind_of?(Hash)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << ltn))
+ else
+ begin
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << ltn))
+ rescue => e
+ # ignore
+ end
+ end
+ next
+ end
+
+ if fobj.kind_of?(TkFont)
+ if ltn.kind_of?(TkFont)
+ conf = {}
+ ltn.latin_configinfo.each{|key,val| conf[key] = val}
+ if keys
+ fobj.latin_configure(conf.update(keys))
+ else
+ fobj.latin_configure(conf)
+ end
+ else
+ fobj.latin_replace(ltn)
+ end
+ end
+
+ fobj.call_font_configure([pathname, optkey], *(__item_config_cmd(tagid(tagOrId)) << {}))
+ }
+ self
+ end
+ alias asciitagfont_configure latintagfont_configure
+
+ def kanjitagfont_configure(tagOrId, knj, keys=nil)
+ if knj.kind_of?(Array)
+ key = knj[1]
+ knj = knj[0]
+ else
+ key = nil
+ end
+
+ optkeys = __item_font_optkeys(tagid(tagOrId))
+ if key && !optkeys.find{|opt| opt.to_s == key.to_s}
+ fail ArgumentError, "unknown font option name `#{key}'"
+ end
+
+ win, tag = __item_pathname(tagid(tagOrId)).split(';')
+
+ optkeys = [key] if key
+
+ optkeys.each{|optkey|
+ optkey = optkey.to_s
+
+ pathname = [win, tag, optkey].join(';')
+
+ if (fobj = TkFont.used_on(pathname))
+ fobj = TkFont.new(fobj) # create a new TkFont object
+ elsif Tk::JAPANIZED_TK
+ fobj = fontobj # create a new TkFont object
+ else
+ knj = hash_kv(knj) if knj.kind_of?(Hash)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << knj))
+ else
+ begin
+ tk_call(*(__item_config_cmd(tagid(tagOrId)) << "-#{optkey}" << knj))
+ rescue => e
+ # ignore
+ end
+ end
+ next
+ end
+
+ if fobj.kind_of?(TkFont)
+ if knj.kind_of?(TkFont)
+ conf = {}
+ knj.kanji_configinfo.each{|key,val| conf[key] = val}
+ if keys
+ fobj.kanji_configure(conf.update(keys))
+ else
+ fobj.kanji_configure(conf)
+ end
+ else
+ fobj.kanji_replace(knj)
+ end
+ end
+
+ fobj.call_font_configure([pathname, optkey], *(__item_config_cmd(tagid(tagOrId)) << {}))
+ }
+ self
+ end
+
+ def tagfont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil)
+ if wintag
+ if winkey
+ fnt = win.tagfontobj(wintag, winkey).dup
+ else
+ fnt = win.tagfontobj(wintag).dup
+ end
+ else
+ if winkey
+ fnt = win.fontobj(winkey).dup
+ else
+ fnt = win.fontobj.dup
+ end
+ end
+
+ if targetkey
+ fnt.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ else
+ fnt.call_font_configure(__item_pathname(tagid(tagOrId)),
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ end
+ self
+ end
+
+
+ def latintagfont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil)
+ if targetkey
+ fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ else
+ fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)),
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ end
+
+ if wintag
+ if winkey
+ fontobj.latin_replace(win.tagfontobj(wintag, winkey).latin_font_id)
+ else
+ fontobj.latin_replace(win.tagfontobj(wintag).latin_font_id)
+ end
+ else
+ if winkey
+ fontobj.latin_replace(win.fontobj(winkey).latin_font_id)
+ else
+ fontobj.latin_replace(win.fontobj.latin_font_id)
+ end
+ end
+ self
+ end
+ alias asciitagfont_copy latintagfont_copy
+
+ def kanjifont_copy(tagOrId, win, wintag=nil, winkey=nil, targetkey=nil)
+ if targetkey
+ fontobj(targetkey).dup.call_font_configure([__item_pathname(tagid(tagOrId)), targetkey],
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ else
+ fontobj.dup.call_font_configure(__item_pathname(tagid(tagOrId)),
+ *(__item_config_cmd(tagid(tagOrId)) << {}))
+ end
+
+ if wintag
+ if winkey
+ fontobj.kanji_replace(win.tagfontobj(wintag, winkey).kanji_font_id)
+ else
+ fontobj.kanji_replace(win.tagfontobj(wintag).kanji_font_id)
+ end
+ else
+ if winkey
+ fontobj.kanji_replace(win.fontobj(winkey).kanji_font_id)
+ else
+ fontobj.kanji_replace(win.fontobj.kanji_font_id)
+ end
+ end
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/kinput.rb b/ext/tk/lib/tk/kinput.rb
new file mode 100644
index 0000000000..b63f756def
--- /dev/null
+++ b/ext/tk/lib/tk/kinput.rb
@@ -0,0 +1,71 @@
+#
+# tk/kinput.rb : control kinput
+#
+require 'tk'
+
+module TkKinput
+ include Tk
+ extend Tk
+
+ TkCommandNames = [
+ 'kinput_start'.freeze,
+ 'kinput_send_spot'.freeze,
+ 'kanjiInput'.freeze
+ ].freeze
+
+ def TkKinput.start(win, style=None)
+ tk_call('kinput_start', win, style)
+ end
+ def kinput_start(style=None)
+ TkKinput.start(self, style)
+ end
+
+ def TkKinput.send_spot(win)
+ tk_call('kinput_send_spot', win)
+ end
+ def kinput_send_spot
+ TkKinput.send_spot(self)
+ end
+
+ def TkKinput.input_start(win, keys=nil)
+ tk_call('kanjiInput', 'start', win, *hash_kv(keys))
+ end
+ def kanji_input_start(keys=nil)
+ TkKinput.input_start(self, keys)
+ end
+
+ def TkKinput.attribute_config(win, slot, value=None)
+ if slot.kind_of? Hash
+ tk_call('kanjiInput', 'attribute', win, *hash_kv(slot))
+ else
+ tk_call('kanjiInput', 'attribute', win, "-#{slot}", value)
+ end
+ end
+ def kinput_attribute_config(slot, value=None)
+ TkKinput.attribute_config(self, slot, value)
+ end
+
+ def TkKinput.attribute_info(win, slot=nil)
+ if slot
+ conf = tk_split_list(tk_call('kanjiInput', 'attribute',
+ win, "-#{slot}"))
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ tk_split_list(tk_call('kanjiInput', 'attribute', win)).collect{|conf|
+ conf[0] = conf[0][1..-1]
+ conf
+ }
+ end
+ end
+ def kinput_attribute_info(slot=nil)
+ TkKinput.attribute_info(self, slot)
+ end
+
+ def TkKinput.input_end(win)
+ tk_call('kanjiInput', 'end', win)
+ end
+ def kanji_input_end
+ TkKinput.input_end(self)
+ end
+end
diff --git a/ext/tk/lib/tk/label.rb b/ext/tk/lib/tk/label.rb
new file mode 100644
index 0000000000..05e430e49b
--- /dev/null
+++ b/ext/tk/lib/tk/label.rb
@@ -0,0 +1,22 @@
+#
+# tk/label.rb : treat label widget
+#
+require 'tk'
+
+class Tk::Label<TkWindow
+ TkCommandNames = ['label'.freeze].freeze
+ WidgetClassName = 'Label'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('label', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('label', @path)
+ # end
+ #end
+ #private :create_self
+end
+
+#TkLabel = Tk::Label unless Object.const_defined? :TkLabel
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Label, :TkLabel)
+Tk.__set_loaded_toplevel_aliases__('tk/label.rb', :Tk, Tk::Label, :TkLabel)
diff --git a/ext/tk/lib/tk/labelframe.rb b/ext/tk/lib/tk/labelframe.rb
new file mode 100644
index 0000000000..6f679e55b5
--- /dev/null
+++ b/ext/tk/lib/tk/labelframe.rb
@@ -0,0 +1,31 @@
+#
+# tk/labelframe.rb : treat labelframe widget
+#
+require 'tk'
+require 'tk/frame'
+
+class Tk::LabelFrame<Tk::Frame
+ TkCommandNames = ['labelframe'.freeze].freeze
+ WidgetClassName = 'Labelframe'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('labelframe', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('labelframe', @path)
+ # end
+ #end
+ #private :create_self
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ super().update('labelwidget'=>proc{|v| window(v)})
+ end
+ private :__val2ruby_optkeys
+end
+
+Tk::Labelframe = Tk::LabelFrame
+#TkLabelFrame = Tk::LabelFrame unless Object.const_defined? :TkLabelFrame
+#TkLabelframe = Tk::Labelframe unless Object.const_defined? :TkLabelframe
+#Tk.__set_toplevel_aliases__(:Tk, Tk::LabelFrame, :TkLabelFrame, :TkLabelframe)
+Tk.__set_loaded_toplevel_aliases__('tk/labelframe.rb', :Tk, Tk::LabelFrame,
+ :TkLabelFrame, :TkLabelframe)
diff --git a/ext/tk/lib/tk/listbox.rb b/ext/tk/lib/tk/listbox.rb
new file mode 100644
index 0000000000..6742b2132c
--- /dev/null
+++ b/ext/tk/lib/tk/listbox.rb
@@ -0,0 +1,284 @@
+#
+# tk/listbox.rb : treat listbox widget
+#
+require 'tk'
+require 'tk/itemconfig'
+require 'tk/scrollable'
+require 'tk/txtwin_abst'
+
+module TkListItemConfig
+ include TkItemConfigMethod
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+end
+
+class Tk::Listbox<TkTextWin
+ include TkListItemConfig
+ include Scrollable
+
+ TkCommandNames = ['listbox'.freeze].freeze
+ WidgetClassName = 'Listbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('listbox', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('listbox', @path)
+ # end
+ #end
+ #private :create_self
+
+ def __tkvariable_optkeys
+ super() << 'listvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def tagid(id)
+ #id.to_s
+ _get_eval_string(id)
+ end
+
+ def activate(y)
+ tk_send_without_enc('activate', y)
+ self
+ end
+ def curselection
+ list(tk_send_without_enc('curselection'))
+ end
+ def get(first, last=nil)
+ if last
+ # tk_split_simplelist(_fromUTF8(tk_send_without_enc('get', first, last)))
+ tk_split_simplelist(tk_send_without_enc('get', first, last), false, true)
+ else
+ _fromUTF8(tk_send_without_enc('get', first))
+ end
+ end
+ def nearest(y)
+ tk_send_without_enc('nearest', y).to_i
+ end
+ def size
+ tk_send_without_enc('size').to_i
+ end
+ def selection_anchor(index)
+ tk_send_without_enc('selection', 'anchor', index)
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', first, last)
+ self
+ end
+ def selection_includes(index)
+ bool(tk_send_without_enc('selection', 'includes', index))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', first, last)
+ self
+ end
+
+ def index(idx)
+ tk_send_without_enc('index', idx).to_i
+ end
+
+ def value
+ get('0', 'end')
+ end
+
+ def value= (vals)
+ unless vals.kind_of?(Array)
+ fail ArgumentError, 'an Array is expected'
+ end
+ tk_send_without_enc('delete', '0', 'end')
+ tk_send_without_enc('insert', '0',
+ *(vals.collect{|v| _get_eval_enc_str(v)}))
+ vals
+ end
+
+ def clear
+ tk_send_without_enc('delete', '0', 'end')
+ self
+ end
+ alias erase clear
+
+=begin
+ def itemcget(index, key)
+ case key.to_s
+ when 'text', 'label', 'show'
+ _fromUTF8(tk_send_without_enc('itemcget', index, "-#{key}"))
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_send('itemcget', index, "-#{key}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', index,
+ '-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(index, fnt)
+ end
+ if key.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('itemcget', index, "-#{key}")))
+ end
+ end
+ def itemconfigure(index, key, val=None)
+ if key.kind_of? Hash
+ if (key['font'] || key[:font] ||
+ key['kanjifont'] || key[:kanjifont] ||
+ key['latinfont'] || key[:latinfont] ||
+ key['asciifont'] || key[:asciifont] )
+ tagfont_configure(index, _symbolkey2str(key))
+ else
+ tk_send_without_enc('itemconfigure', index, *hash_kv(key, true))
+ end
+
+ else
+ if (key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
+ key == 'asciifont' || key == :asciifont )
+ if val == None
+ tagfontobj(index)
+ else
+ tagfont_configure(index, {key=>val})
+ end
+ else
+ tk_call('itemconfigure', index, "-#{key}", val)
+ end
+ end
+ self
+ end
+
+ def itemconfiginfo(index, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ conf[4] = tagfont_configinfo(index, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ ret = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', index))).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ fontconf = ret.assoc('font')
+ if fontconf
+ ret.delete_if{|item| item[0] == 'font' || item[0] == 'kanjifont'}
+ fontconf[4] = tagfont_configinfo(index, fontconf[4])
+ ret.push(fontconf)
+ else
+ ret
+ end
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ conf[4] = tagfont_configinfo(index, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('itemconfigure',index,"-#{key}")))
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(_fromUTF8(tk_send_without_enc('itemconfigure', index))).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ fontconf = ret['font']
+ if fontconf
+ ret.delete('font')
+ ret.delete('kanjifont')
+ fontconf[3] = tagfont_configinfo(index, fontconf[3])
+ ret['font'] = fontconf
+ end
+ ret
+ end
+ end
+ end
+
+ def current_itemconfiginfo(index, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = itemconfiginfo(index, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ itemconfiginfo(index).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ itemconfiginfo(index, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+=end
+end
+
+#TkListbox = Tk::Listbox unless Object.const_defined? :TkListbox
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Listbox, :TkListbox)
+Tk.__set_loaded_toplevel_aliases__('tk/listbox.rb', :Tk, Tk::Listbox,
+ :TkListbox)
diff --git a/ext/tk/lib/tk/macpkg.rb b/ext/tk/lib/tk/macpkg.rb
new file mode 100644
index 0000000000..3ca7953c13
--- /dev/null
+++ b/ext/tk/lib/tk/macpkg.rb
@@ -0,0 +1,80 @@
+#
+# tk/macpkg.rb : methods for Tcl/Tk packages for Macintosh
+# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+# ATTENTION !!
+# This is NOT TESTED. Because I have no test-environment.
+#
+#
+require 'tk'
+
+module Tk
+ def Tk.load_tclscript_rsrc(resource_name, file=None)
+ # Mac only
+ tk_call('source', '-rsrc', resource_name, file)
+ end
+
+ def Tk.load_tclscript_rsrcid(resource_id, file=None)
+ # Mac only
+ tk_call('source', '-rsrcid', resource_id, file)
+ end
+end
+
+module Tk::MacResource
+end
+#TkMacResource = Tk::MacResource
+#Tk.__set_toplevel_aliases__(:Tk, Tk::MacResource, :TkMacResource)
+Tk.__set_loaded_toplevel_aliases__('tk/macpkg.rb', :Tk, Tk::MacResource,
+ :TkMacResource)
+
+module Tk::MacResource
+ extend Tk
+ extend Tk::MacResource
+
+ TkCommandNames = ['resource'.freeze].freeze
+
+ PACKAGE_NAME = 'resource'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ tk_call_without_enc('package', 'require', 'resource')
+
+ def close(rsrcRef)
+ tk_call('resource', 'close', rsrcRef)
+ end
+
+ def delete(rsrcType, opts=nil)
+ tk_call('resource', 'delete', *(hash_kv(opts) << rsrcType))
+ end
+
+ def files(rsrcRef=nil)
+ if rsrcRef
+ tk_call('resource', 'files', rsrcRef)
+ else
+ tk_split_simplelist(tk_call('resource', 'files'))
+ end
+ end
+
+ def list(rsrcType, rsrcRef=nil)
+ tk_split_simplelist(tk_call('resource', 'list', rsrcType, rsrcRef))
+ end
+
+ def open(fname, access=nil)
+ tk_call('resource', 'open', fname, access)
+ end
+
+ def read(rsrcType, rsrcID, rsrcRef=nil)
+ tk_call('resource', 'read', rsrcType, rsrcID, rsrcRef)
+ end
+
+ def types(rsrcRef=nil)
+ tk_split_simplelist(tk_call('resource', 'types', rsrcRef))
+ end
+
+ def write(rsrcType, data, opts=nil)
+ tk_call('resource', 'write', *(hash_kv(opts) << rsrcType << data))
+ end
+
+ module_function :close, :delete, :files, :list, :open, :read, :types, :write
+end
diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb
new file mode 100644
index 0000000000..bcd250026d
--- /dev/null
+++ b/ext/tk/lib/tk/menu.rb
@@ -0,0 +1,718 @@
+#
+# tk/menu.rb : treat menu and menubutton
+#
+require 'tk'
+require 'tk/itemconfig'
+require 'tk/menuspec'
+
+module TkMenuEntryConfig
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'entrycget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'entryconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_strval_optkeys(id)
+ super(id) << 'selectcolor'
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+
+ def __item_val2ruby_optkeys(id) # { key=>proc, ... }
+ super(id).update('menu'=>proc{|i, v| window(v)})
+ end
+ private :__item_val2ruby_optkeys
+
+ alias entrycget_tkstring itemcget_tkstring
+ alias entrycget itemcget
+ alias entrycget_strict itemcget_strict
+ alias entryconfigure itemconfigure
+ alias entryconfiginfo itemconfiginfo
+ alias current_entryconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+class Tk::Menu<TkWindow
+ include Wm
+ include TkMenuEntryConfig
+ extend TkMenuSpec
+
+ TkCommandNames = ['menu'.freeze].freeze
+ WidgetClassName = 'Menu'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('menu', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('menu', @path)
+ # end
+ #end
+ #private :create_self
+
+ def __strval_optkeys
+ super() << 'selectcolor' << 'title'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'tearoff'
+ end
+ private :__boolval_optkeys
+
+ def self.new_menuspec(menu_spec, parent = nil, tearoff = false, keys = nil)
+ if parent.kind_of?(Hash)
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ tearoff = keys.delete('tearoff')
+ elsif tearoff.kind_of?(Hash)
+ keys = _symbolkey2str(tearoff)
+ tearoff = keys.delete('tearoff')
+ elsif keys
+ keys = _symbolkey2str(keys)
+ else
+ keys = {}
+ end
+
+ widgetname = keys.delete('widgetname')
+ _create_menu(parent, menu_spec, widgetname, tearoff, keys)
+ end
+
+ def tagid(id)
+ #id.to_s
+ _get_eval_string(id)
+ end
+
+ def activate(index)
+ tk_send_without_enc('activate', _get_eval_enc_str(index))
+ self
+ end
+ def add(type, keys=nil)
+ tk_send_without_enc('add', type, *hash_kv(keys, true))
+ self
+ end
+ def add_cascade(keys=nil)
+ add('cascade', keys)
+ end
+ def add_checkbutton(keys=nil)
+ add('checkbutton', keys)
+ end
+ def add_command(keys=nil)
+ add('command', keys)
+ end
+ def add_radiobutton(keys=nil)
+ add('radiobutton', keys)
+ end
+ def add_separator(keys=nil)
+ add('separator', keys)
+ end
+
+ def clone_menu(*args)
+ if args[0].kind_of?(TkWindow)
+ parent = args.shift
+ else
+ parent = self
+ end
+
+ if args[0].kind_of?(String) || args[0].kind_of?(Symbol) # menu type
+ type = args.shift
+ else
+ type = None # 'normal'
+ end
+
+ if args[0].kind_of?(Hash)
+ keys = _symbolkey2str(args.shift)
+ else
+ keys = {}
+ end
+
+ parent = keys.delete('parent') if keys.has_key?('parent')
+ type = keys.delete('type') if keys.has_key?('type')
+
+ if keys.empty?
+ Tk::MenuClone.new(self, parent, type)
+ else
+ Tk::MenuClone.new(self, parent, type, keys)
+ end
+ end
+
+ def index(idx)
+ ret = tk_send_without_enc('index', _get_eval_enc_str(idx))
+ (ret == 'none')? nil: number(ret)
+ end
+ def invoke(index)
+ _fromUTF8(tk_send_without_enc('invoke', _get_eval_enc_str(index)))
+ end
+ def insert(index, type, keys=nil)
+ tk_send_without_enc('insert', _get_eval_enc_str(index),
+ type, *hash_kv(keys, true))
+ self
+ end
+ def delete(first, last=nil)
+ if last
+ tk_send_without_enc('delete', _get_eval_enc_str(first),
+ _get_eval_enc_str(last))
+ else
+ tk_send_without_enc('delete', _get_eval_enc_str(first))
+ end
+ self
+ end
+ def popup(x, y, index=nil)
+ if index
+ tk_call_without_enc('tk_popup', path, x, y,
+ _get_eval_enc_str(index))
+ else
+ tk_call_without_enc('tk_popup', path, x, y)
+ end
+ self
+ end
+ def post(x, y)
+ _fromUTF8(tk_send_without_enc('post', x, y))
+ end
+ def postcascade(index)
+ tk_send_without_enc('postcascade', _get_eval_enc_str(index))
+ self
+ end
+ def postcommand(cmd=Proc.new)
+ configure_cmd 'postcommand', cmd
+ self
+ end
+ def set_focus
+ tk_call_without_enc('tk_menuSetFocus', path)
+ self
+ end
+ def tearoffcommand(cmd=Proc.new)
+ configure_cmd 'tearoffcommand', cmd
+ self
+ end
+ def menutype(index)
+ tk_send_without_enc('type', _get_eval_enc_str(index))
+ end
+ def unpost
+ tk_send_without_enc('unpost')
+ self
+ end
+ def xposition(index)
+ number(tk_send_without_enc('xposition', _get_eval_enc_str(index)))
+ end
+ def yposition(index)
+ number(tk_send_without_enc('yposition', _get_eval_enc_str(index)))
+ end
+
+=begin
+ def entrycget(index, key)
+ case key.to_s
+ when 'text', 'label', 'show'
+ _fromUTF8(tk_send_without_enc('entrycget',
+ _get_eval_enc_str(index), "-#{key}"))
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_send('entrycget', index, "-#{key}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_without_enc('entrycget', _get_eval_enc_str(index), '-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(index, fnt)
+ end
+ if key.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('entrycget', _get_eval_enc_str(index), "-#{key}")))
+ end
+ end
+ def entryconfigure(index, key, val=None)
+ if key.kind_of? Hash
+ if (key['font'] || key[:font] ||
+ key['kanjifont'] || key[:kanjifont] ||
+ key['latinfont'] || key[:latinfont] ||
+ key['asciifont'] || key[:asciifont])
+ tagfont_configure(index, _symbolkey2str(key))
+ else
+ tk_send_without_enc('entryconfigure', _get_eval_enc_str(index),
+ *hash_kv(key, true))
+ end
+
+ else
+ if (key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
+ key == 'asciifont' || key == :asciifont )
+ if val == None
+ tagfontobj(index)
+ else
+ tagfont_configure(index, {key=>val})
+ end
+ else
+ tk_call('entryconfigure', index, "-#{key}", val)
+ end
+ end
+ self
+ end
+
+ def entryconfiginfo(index, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ conf[4] = tagfont_configinfo(index, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ ret = tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure', _get_eval_enc_str(index)))).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ if fontconf
+ ret.delete_if{|item| item[0] == 'font' || item[0] == 'kanjifont'}
+ fontconf[4] = tagfont_configinfo(index, fontconf[4])
+ ret.push(fontconf)
+ else
+ ret
+ end
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ conf[4] = tagfont_configinfo(index, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('entryconfigure',_get_eval_enc_str(index),"-#{key}")))
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(_fromUTF8(tk_send_without_enc('entryconfigure', _get_eval_enc_str(index)))).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ fontconf = ret['font']
+ if fontconf
+ ret.delete('font')
+ ret.delete('kanjifont')
+ fontconf[3] = tagfont_configinfo(index, fontconf[3])
+ ret['font'] = fontconf
+ end
+ ret
+ end
+ end
+ end
+
+ def current_entryconfiginfo(index, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = entryconfiginfo(index, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ entryconfiginfo(index).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ entryconfiginfo(index, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+=end
+end
+
+#TkMenu = Tk::Menu unless Object.const_defined? :TkMenu
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Menu, :TkMenu)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::Menu, :TkMenu)
+
+
+module Tk::Menu::TkInternalFunction; end
+class << Tk::Menu::TkInternalFunction
+ # These methods calls internal functions of Tcl/Tk.
+ # So, They may not work on your Tcl/Tk.
+ def next_menu(menu, dir='next')
+ dir = dir.to_s
+ case dir
+ when 'next', 'forward', 'down'
+ dir = 'right'
+ when 'previous', 'backward', 'up'
+ dir = 'left'
+ end
+
+ Tk.tk_call('::tk::MenuNextMenu', menu, dir)
+ end
+
+ def next_entry(menu, delta)
+ # delta is increment value of entry index.
+ # For example, +1 denotes 'next entry' and -1 denotes 'previous entry'.
+ Tk.tk_call('::tk::MenuNextEntry', menu, delta)
+ end
+end
+
+class Tk::MenuClone<Tk::Menu
+=begin
+ def initialize(parent, type=None)
+ widgetname = nil
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ widgetname = keys.delete('widgetname')
+ type = keys.delete('type'); type = None unless type
+ end
+ #unless parent.kind_of?(TkMenu)
+ # fail ArgumentError, "parent must be TkMenu"
+ #end
+ @parent = parent
+ install_win(@parent.path, widgetname)
+ tk_call_without_enc(@parent.path, 'clone', @path, type)
+ end
+=end
+ def initialize(src_menu, *args)
+ widgetname = nil
+
+ if args[0].kind_of?(TkWindow) # parent window
+ parent = args.shift
+ else
+ parent = src_menu
+ end
+
+ if args[0].kind_of?(String) || args[0].kind_of?(Symbol) # menu type
+ type = args.shift
+ else
+ type = None # 'normal'
+ end
+
+ if args[0].kind_of?(Hash)
+ keys = _symbolkey2str(args.shift)
+ parent = keys.delete('parent') if keys.has_key?('parent')
+ widgetname = keys.delete('widgetname')
+ type = keys.delete('type') if keys.has_key?('type')
+ else
+ keys = nil
+ end
+
+ @src_menu = src_menu
+ @parent = parent
+ @type = type
+ install_win(@parent.path, widgetname)
+ tk_call_without_enc(@src_menu.path, 'clone', @path, @type)
+ configure(keys) if keys && !keys.empty?
+ end
+
+ def source_menu
+ @src_menu
+ end
+end
+Tk::CloneMenu = Tk::MenuClone
+#TkMenuClone = Tk::MenuClone unless Object.const_defined? :TkMenuClone
+#TkCloneMenu = Tk::CloneMenu unless Object.const_defined? :TkCloneMenu
+#Tk.__set_toplevel_aliases__(:Tk, Tk::MenuClone, :TkMenuClone, :TkCloneMenu)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::MenuClone,
+ :TkMenuClone, :TkCloneMenu)
+
+module Tk::SystemMenu
+ def initialize(parent, keys=nil)
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ end
+ #unless parent.kind_of? TkMenu
+ # fail ArgumentError, "parent must be a TkMenu object"
+ #end
+ # @path = Kernel.format("%s.%s", parent.path, self.class::SYSMENU_NAME)
+ @path = parent.path + '.' + self.class::SYSMENU_NAME
+ #TkComm::Tk_WINDOWS[@path] = self
+ TkCore::INTERP.tk_windows[@path] = self
+ if self.method(:create_self).arity == 0
+ p 'create_self has no arg' if $DEBUG
+ create_self
+ configure(keys) if keys
+ else
+ p 'create_self has an arg' if $DEBUG
+ create_self(keys)
+ end
+ end
+end
+TkSystemMenu = Tk::SystemMenu
+
+
+class Tk::SysMenu_Help<Tk::Menu
+ # for all platform
+ include Tk::SystemMenu
+ SYSMENU_NAME = 'help'
+end
+#TkSysMenu_Help = Tk::SysMenu_Help unless Object.const_defined? :TkSysMenu_Help
+#Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_Help, :TkSysMenu_Help)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::SysMenu_Help,
+ :TkSysMenu_Help)
+
+
+class Tk::SysMenu_System<Tk::Menu
+ # for Windows
+ include Tk::SystemMenu
+ SYSMENU_NAME = 'system'
+end
+#TkSysMenu_System = Tk::SysMenu_System unless Object.const_defined? :TkSysMenu_System
+#Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_System, :TkSysMenu_System)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::SysMenu_System,
+ :TkSysMenu_System)
+
+
+class Tk::SysMenu_Apple<Tk::Menu
+ # for Machintosh
+ include Tk::SystemMenu
+ SYSMENU_NAME = 'apple'
+end
+#TkSysMenu_Apple = Tk::SysMenu_Apple unless Object.const_defined? :TkSysMenu_Apple
+#Tk.__set_toplevel_aliases__(:Tk, Tk::SysMenu_Apple, :TkSysMenu_Apple)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::SysMenu_Apple,
+ :TkSysMenu_Apple)
+
+
+class Tk::Menubutton<Tk::Label
+ TkCommandNames = ['menubutton'.freeze].freeze
+ WidgetClassName = 'Menubutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ def create_self(keys)
+ if keys and keys != None
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ # tk_call_without_enc('menubutton', @path, *hash_kv(keys, true))
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ begin
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ rescue
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ keys = __check_available_configure_options(keys)
+ unless keys.empty?
+ tk_call_without_enc('destroy', @path) rescue nil
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ end
+ end
+ end
+ else
+ # tk_call_without_enc('menubutton', @path)
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def __boolval_optkeys
+ super() << 'indicatoron'
+ end
+ private :__boolval_optkeys
+
+end
+Tk::MenuButton = Tk::Menubutton
+#TkMenubutton = Tk::Menubutton unless Object.const_defined? :TkMenubutton
+#TkMenuButton = Tk::MenuButton unless Object.const_defined? :TkMenuButton
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Menubutton, :TkMenubutton, :TkMenuButton)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::Menubutton,
+ :TkMenubutton, :TkMenuButton)
+
+
+class Tk::OptionMenubutton<Tk::Menubutton
+ TkCommandNames = ['tk_optionMenu'.freeze].freeze
+
+ class OptionMenu<TkMenu
+ def initialize(path) #==> return value of tk_optionMenu
+ @path = path
+ #TkComm::Tk_WINDOWS[@path] = self
+ TkCore::INTERP.tk_windows[@path] = self
+ end
+ end
+
+ def initialize(*args)
+ # args :: [parent,] [var,] [value[, ...],] [keys]
+ # parent --> TkWindow or nil
+ # var --> TkVariable or nil
+ # keys --> Hash
+ # keys[:parent] or keys['parent'] --> parent
+ # keys[:variable] or keys['variable'] --> var
+ # keys[:values] or keys['values'] --> value, ...
+ # other Hash keys are menubutton options
+ keys = {}
+ keys = args.pop if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(keys)
+
+ parent = nil
+ if !args.empty? && (args[0].kind_of?(TkWindow) || args[0] == nil)
+ keys.delete('parent') # ignore
+ parent = args.shift
+ else
+ parent = keys.delete('parent')
+ end
+
+ @variable = nil
+ if !args.empty? && (args[0].kind_of?(TkVariable) || args[0] == nil)
+ keys.delete('variable') # ignore
+ @variable = args.shift
+ else
+ @variable = keys.delete('variable')
+ end
+ @variable = TkVariable.new unless @variable
+
+ (args = keys.delete('values') || []) if args.empty?
+ if args.empty?
+ args << @variable.value
+ else
+ @variable.value = args[0]
+ end
+
+ install_win(if parent then parent.path end)
+ @menu = OptionMenu.new(tk_call('tk_optionMenu',
+ @path, @variable.id, *args))
+
+ configure(keys) if keys
+ end
+
+ def value
+ @variable.value
+ end
+
+ def value=(val)
+ @variable.value = val
+ end
+
+ def activate(index)
+ @menu.activate(index)
+ self
+ end
+ def add(value)
+ @menu.add('radiobutton', 'variable'=>@variable,
+ 'label'=>value, 'value'=>value)
+ self
+ end
+ def index(index)
+ @menu.index(index)
+ end
+ def invoke(index)
+ @menu.invoke(index)
+ end
+ def insert(index, value)
+ @menu.insert(index, 'radiobutton', 'variable'=>@variable,
+ 'label'=>value, 'value'=>value)
+ self
+ end
+ def delete(index, last=None)
+ @menu.delete(index, last)
+ self
+ end
+ def xposition(index)
+ @menu.xposition(index)
+ end
+ def yposition(index)
+ @menu.yposition(index)
+ end
+ def menu
+ @menu
+ end
+ def menucget(key)
+ @menu.cget(key)
+ end
+ def menucget_strict(key)
+ @menu.cget_strict(key)
+ end
+ def menuconfigure(key, val=None)
+ @menu.configure(key, val)
+ self
+ end
+ def menuconfiginfo(key=nil)
+ @menu.configinfo(key)
+ end
+ def current_menuconfiginfo(key=nil)
+ @menu.current_configinfo(key)
+ end
+ def entrycget(index, key)
+ @menu.entrycget(index, key)
+ end
+ def entrycget_strict(index, key)
+ @menu.entrycget_strict(index, key)
+ end
+ def entryconfigure(index, key, val=None)
+ @menu.entryconfigure(index, key, val)
+ self
+ end
+ def entryconfiginfo(index, key=nil)
+ @menu.entryconfiginfo(index, key)
+ end
+ def current_entryconfiginfo(index, key=nil)
+ @menu.current_entryconfiginfo(index, key)
+ end
+end
+
+Tk::OptionMenuButton = Tk::OptionMenubutton
+#TkOptionMenubutton = Tk::OptionMenubutton unless Object.const_defined? :TkOptionMenubutton
+#TkOptionMenuButton = Tk::OptionMenuButton unless Object.const_defined? :TkOptionMenuButton
+#Tk.__set_toplevel_aliases__(:Tk, Tk::OptionMenubutton,
+# :TkOptionMenubutton, :TkOptionMenuButton)
+Tk.__set_loaded_toplevel_aliases__('tk/menu.rb', :Tk, Tk::OptionMenubutton,
+ :TkOptionMenubutton, :TkOptionMenuButton)
diff --git a/ext/tk/lib/tk/menubar.rb b/ext/tk/lib/tk/menubar.rb
new file mode 100644
index 0000000000..9d5571c470
--- /dev/null
+++ b/ext/tk/lib/tk/menubar.rb
@@ -0,0 +1,137 @@
+#
+# tk/menubar.rb
+#
+# Original version:
+# Copyright (C) 1998 maeda shugo. All rights reserved.
+# This file can be distributed under the terms of the Ruby.
+
+# Usage:
+#
+# menu_spec = [
+# [['File', 0],
+# ['Open', proc{puts('Open clicked')}, 0],
+# '---',
+# ['Quit', proc{exit}, 0]],
+# [['Edit', 0],
+# ['Cut', proc{puts('Cut clicked')}, 2],
+# ['Copy', proc{puts('Copy clicked')}, 0],
+# ['Paste', proc{puts('Paste clicked')}, 0]]
+# ]
+# menubar = TkMenubar.new(nil, menu_spec,
+# 'tearoff'=>false,
+# 'foreground'=>'grey40',
+# 'activeforeground'=>'red',
+# 'font'=>'-adobe-helvetica-bold-r-*--12-*-iso8859-1')
+# menubar.pack('side'=>'top', 'fill'=>'x')
+#
+#
+# OR
+#
+#
+# menubar = TkMenubar.new
+# menubar.add_menu([['File', 0],
+# ['Open', proc{puts('Open clicked')}, 0],
+# '---',
+# ['Quit', proc{exit}, 0]])
+# menubar.add_menu([['Edit', 0],
+# ['Cut', proc{puts('Cut clicked')}, 2],
+# ['Copy', proc{puts('Copy clicked')}, 0],
+# ['Paste', proc{puts('Paste clicked')}, 0]])
+# menubar.configure('tearoff', false)
+# menubar.configure('foreground', 'grey40')
+# menubar.configure('activeforeground', 'red')
+# menubar.configure('font', '-adobe-helvetica-bold-r-*--12-*-iso8859-1')
+# menubar.pack('side'=>'top', 'fill'=>'x')
+#
+#
+# OR
+#
+# radio_var = TkVariable.new('y')
+# menu_spec = [
+# [['File', 0],
+# {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
+# '---',
+# ['Check_A', TkVariable.new(true), 6],
+# {:type=>'checkbutton', :label=>'Check_B',
+# :variable=>TkVariable.new, :underline=>6},
+# '---',
+# ['Radio_X', [radio_var, 'x'], 6],
+# ['Radio_Y', [radio_var, 'y'], 6],
+# ['Radio_Z', [radio_var, 'z'], 6],
+# '---',
+# ['cascade', [
+# ['sss', proc{p 'sss'}, 0],
+# ['ttt', proc{p 'ttt'}, 0],
+# ['uuu', proc{p 'uuu'}, 0],
+# ['vvv', proc{p 'vvv'}, 0],
+# ], 0],
+# '---',
+# ['Quit', proc{exit}, 0]],
+# [['Edit', 0],
+# ['Cut', proc{puts('Cut clicked')}, 2],
+# ['Copy', proc{puts('Copy clicked')}, 0],
+# ['Paste', proc{puts('Paste clicked')}, 0]]
+# ]
+# menubar = TkMenubar.new(nil, menu_spec,
+# 'tearoff'=>false,
+# 'foreground'=>'grey40',
+# 'activeforeground'=>'red',
+# 'font'=>'Helvetia 12 bold')
+# menubar.pack('side'=>'top', 'fill'=>'x')
+
+# See tk/menuspce.rb about the format of the menu_spec
+
+# To use add_menu, configuration must be done by calling configure after
+# adding all menus by add_menu, not by the constructor arguments.
+
+require 'tk'
+require 'tk/frame'
+require 'tk/composite'
+require 'tk/menuspec'
+
+class TkMenubar<Tk::Frame
+ include TkComposite
+ include TkMenuSpec
+
+ def initialize(parent = nil, spec = nil, options = {})
+ if parent.kind_of? Hash
+ options = parent
+ parent = nil
+ spec = (options.has_key?('spec'))? options.delete('spec'): nil
+ end
+
+ _symbolkey2str(options)
+ menuspec_opt = {}
+ TkMenuSpec::MENUSPEC_OPTKEYS.each{|key|
+ menuspec_opt[key] = options.delete(key) if options.has_key?(key)
+ }
+
+ super(parent, options)
+
+ @menus = []
+
+ spec.each{|info| add_menu(info, menuspec_opt)} if spec
+
+ options.each{|key, value| configure(key, value)} if options
+ end
+
+ def add_menu(menu_info, menuspec_opt={})
+ mbtn, menu = _create_menubutton(@frame, menu_info, menuspec_opt)
+
+ submenus = _get_cascade_menus(menu).flatten
+
+ @menus.push([mbtn, menu])
+ delegate('tearoff', menu, *submenus)
+ delegate('foreground', mbtn, menu, *submenus)
+ delegate('background', mbtn, menu, *submenus)
+ delegate('disabledforeground', mbtn, menu, *submenus)
+ delegate('activeforeground', mbtn, menu, *submenus)
+ delegate('activebackground', mbtn, menu, *submenus)
+ delegate('font', mbtn, menu, *submenus)
+ delegate('kanjifont', mbtn, menu, *submenus)
+ end
+
+ def [](index)
+ return @menus[index]
+ end
+end
diff --git a/ext/tk/lib/tk/menuspec.rb b/ext/tk/lib/tk/menuspec.rb
new file mode 100644
index 0000000000..cb3597eec9
--- /dev/null
+++ b/ext/tk/lib/tk/menuspec.rb
@@ -0,0 +1,456 @@
+#
+# tk/menuspec.rb
+# Hidethoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# based on tkmenubar.rb :
+# Copyright (C) 1998 maeda shugo. All rights reserved.
+# This file can be distributed under the terms of the Ruby.
+#
+# The format of the menu_spec is:
+# [ menubutton_info, menubutton_info, ... ]
+#
+# The format of the menubutton_info is:
+# [ menubutton_info, entry_info, entry_info, ... ]
+#
+# And each format of *_info is:
+# [
+# [text, underline, configs], # menu button/entry (*1)
+# [label, command, underline, accelerator, configs], # command entry
+# [label, TkVar_obj, underline, accelerator, configs], # checkbutton entry
+# [label, [TkVar_obj, value],
+# underline, accelerator, configs], # radiobutton entry
+# [label, [[...menu_info...], [...menu_info...], ...],
+# underline, accelerator, configs], # cascade entry (*2)
+# '---', # separator
+# ...
+# ]
+#
+# A menu_info is an array of menu entries:
+# [ entry_info, entry_info, ... ]
+#
+#
+# underline, accelerator, and configs are optional pearameters.
+# Hashes are OK instead of Arrays. Then the entry type ('command',
+# 'checkbutton', 'radiobutton' or 'cascade') is given by 'type' key
+# (e.g. :type=>'cascade'). When type is 'cascade', an array of menu_info
+# is acceptable for 'menu' key (then, create sub-menu).
+#
+# If the value of underline is true instead of an integer,
+# check whether the text/label string contains a '&' character.
+# When includes, the first '&' is removed and its following character is
+# converted the corresponding 'underline' option (first '&' is removed).
+# Else if the value of underline is a String or a Regexp,
+# use the result of label.index(underline) as the index of underline
+# (don't remove matched substring).
+#
+# NOTE: (*1)
+# If you want to make special menus (*.help for UNIX, *.system for Win,
+# and *.apple for Mac), append 'menu_name'=>name (name is 'help' for UNIX,
+# 'system' for Win, and 'apple' for Mac) option to the configs hash of
+# menu button/entry information.
+#
+# NOTE: (*2)
+# If you want to configure a cascade menu, add :menu_config=>{...configs..}
+# to the configs of the cascade entry.
+
+module TkMenuSpec
+ extend TkMenuSpec
+
+ MENUSPEC_OPTKEYS = [ 'layout_proc' ]
+
+ def _create_menu(parent, menu_info, menu_name = nil,
+ tearoff = false, default_opts = nil)
+ if tearoff.kind_of?(Hash)
+ default_opts = tearoff
+ tearoff = false
+ end
+
+ if menu_name.kind_of?(Hash)
+ default_opts = menu_name
+ menu_name = nil
+ tearoff = false
+ end
+
+ if default_opts.kind_of?(Hash)
+ orig_opts = _symbolkey2str(default_opts)
+ else
+ orig_opts = {}
+ end
+
+ tearoff = orig_opts.delete('tearoff') if orig_opts.key?('tearoff')
+ tearoff = false unless tearoff # nil --> false
+
+ if menu_name
+ #menu = Tk::Menu.new(parent, :widgetname=>menu_name, :tearoff=>tearoff)
+ # --> use current TkMenu class
+ menu = TkMenu.new(parent, :widgetname=>menu_name, :tearoff=>tearoff)
+ else
+ #menu = Tk::Menu.new(parent, :tearoff=>tearoff)
+ # --> use current TkMenu class
+ menu = TkMenu.new(parent, :tearoff=>tearoff)
+ end
+
+ for item_info in menu_info
+ if item_info.kind_of?(Hash)
+ options = orig_opts.dup
+ options.update(_symbolkey2str(item_info))
+ item_type = (options.delete('type') || 'command').to_s
+ menu_name = options.delete('menu_name')
+ menu_opts = orig_opts.dup
+ menu_opts.update(_symbolkey2str(options.delete('menu_config') || {}))
+ if item_type == 'cascade' && options['menu'].kind_of?(Array)
+ # create cascade menu
+ submenu = _create_menu(menu, options['menu'], menu_name,
+ tearoff, menu_opts)
+ options['menu'] = submenu
+ end
+ case options['underline']
+ when String, Regexp
+ if options['label'] &&
+ (idx = options['label'].index(options['underline']))
+ options['underline'] = idx
+ else
+ options['underline'] = -1
+ end
+ when true
+ if options['label'] && (idx = options['label'].index('&'))
+ options['label'] = options['label'].dup
+ options['label'][idx] = ''
+ options['underline'] = idx
+ else
+ options['underline'] = -1
+ end
+ end
+ menu.add(item_type, options)
+
+ elsif item_info.kind_of?(Array)
+ options = orig_opts.dup
+
+ options['label'] = item_info[0] if item_info[0]
+
+ case item_info[1]
+ when TkVariable
+ # checkbutton
+ item_type = 'checkbutton'
+ options['variable'] = item_info[1]
+ options['onvalue'] = true
+ options['offvalue'] = false
+
+ when Array
+ # radiobutton or cascade
+ if item_info[1][0].kind_of?(TkVariable)
+ # radiobutton
+ item_type = 'radiobutton'
+ options['variable'] = item_info[1][0]
+ options['value'] = item_info[1][1] if item_info[1][1]
+
+ else
+ # cascade
+ item_type = 'cascade'
+ menu_opts = orig_opts.dup
+ if item_info[4] && item_info[4].kind_of?(Hash)
+ opts = _symbolkey2str(item_info[4])
+ menu_name = opts.delete('menu_name')
+ menu_config = opts.delete('menu_config') || {}
+ menu_opts.update(_symbolkey2str(menu_config))
+ end
+ submenu = _create_menu(menu, item_info[1], menu_name,
+ tearoff, menu_opts)
+ options['menu'] = submenu
+ end
+
+ else
+ # command
+ item_type = 'command'
+ options['command'] = item_info[1] if item_info[1]
+ end
+
+ options['underline'] = item_info[2] if item_info[2]
+ options['accelerator'] = item_info[3] if item_info[3]
+ if item_info[4] && item_info[4].kind_of?(Hash)
+ opts = _symbolkey2str(item_info[4])
+ if item_type == 'cascade'
+ opts.delete('menu_name')
+ opts.delete('menu_config')
+ end
+ options.update(opts)
+ end
+
+ case options['underline']
+ when String, Regexp
+ if options['label'] &&
+ (idx = options['label'].index(options['underline']))
+ options['underline'] = idx
+ else
+ options['underline'] = -1
+ end
+ when true
+ if options['label'] && (idx = options['label'].index('&'))
+ options['label'] = options['label'].dup
+ options['label'][idx] = ''
+ options['underline'] = idx
+ else
+ options['underline'] = -1
+ end
+ end
+
+ menu.add(item_type, options)
+
+ elsif /^-+$/ =~ item_info
+ menu.add('separator')
+
+ else
+ menu.add('command', 'label' => item_info)
+ end
+ end
+
+ menu
+ end
+ private :_create_menu
+
+ def _use_menubar?(parent)
+ use_menubar = false
+ if parent.kind_of?(Tk::Root) || parent.kind_of?(Tk::Toplevel)
+ true
+ elsif parent.current_configinfo.has_key?('menu')
+ true
+ else
+ false
+ end
+ end
+ private :_use_menubar?
+
+ def _create_menu_for_menubar(parent)
+ #unless (mbar = parent.menu).kind_of?(TkMenu)
+ # --> use current TkMenu class
+ mbar = parent.menu
+ unless mbar.kind_of?(Tk::Menu) || mbar.kind_of?(TkMenu)
+ #mbar = Tk::Menu.new(parent, :tearoff=>false)
+ mbar = TkMenu.new(parent, :tearoff=>false)
+ parent.menu(mbar)
+ end
+ mbar
+ end
+ private :_create_menu_for_menubar
+
+ def _create_menubutton(parent, menu_info, tearoff=false, default_opts = {})
+ btn_info = menu_info[0]
+
+ if tearoff.kind_of?(Hash)
+ default_opts = tearoff
+ tearoff = false
+ end
+
+ if default_opts.kind_of?(Hash)
+ default_opts = _symbolkey2str(default_opts)
+
+ if default_opts.has_key?('layout_proc')
+ layout_proc = default_opts.delete('layout_proc')
+ end
+
+ _vertical_mbar_bind_proc = proc{|m, dir|
+ Tk::Menu::TkInternalFunction.next_menu(m, dir) rescue nil
+ # ignore error when the internal function doesn't exist
+ }
+
+ case layout_proc
+ when :vertical, 'vertical', :vertical_left, 'vertical_left'
+ layout_proc = proc{|_parent, _mbtn|
+ _mbtn.direction :right
+ _mbtn.pack(:side=>:top, :fill=>:x)
+
+ menu = _mbtn.menu
+ menu.bind('Tab', _vertical_mbar_bind_proc, :widget, 'forward')
+ menu.bind('Alt-Tab', _vertical_mbar_bind_proc, :widget, 'backward')
+ }
+ when :vertical_right, 'vertical_right'
+ layout_proc = proc{|_parent, _mbtn|
+ _mbtn.direction :left
+ _mbtn.pack(:side=>:top, :fill=>:x)
+
+ menu = _mbtn.menu
+ menu.bind('Tab', _vertical_mbar_bind_proc, :widget, 'forward')
+ menu.bind('Alt-Tab', _vertical_mbar_bind_proc, :widget, 'backward')
+ }
+ when :horizontal, 'horizontal'
+ layout_proc = proc{|_parent, _mbtn| _mbtn.pack(:side=>:left)}
+ else
+ # do nothing
+ end
+ end
+
+ keys = (default_opts)? default_opts.dup: {}
+
+ tearoff = keys.delete('tearoff') if keys.key?('tearoff')
+ tearoff = false unless tearoff # nil --> false
+
+ if _use_menubar?(parent) && ! layout_proc
+ # menubar by menu entries
+ mbar = _create_menu_for_menubar(parent)
+
+ menu_name = nil
+
+ if btn_info.kind_of?(Hash)
+ keys.update(_symbolkey2str(btn_info))
+ menu_name = keys.delete('menu_name')
+ keys['label'] = keys.delete('text') || ''
+
+ case keys['underline']
+ when String, Regexp
+ if idx = keys['label'].index(keys['underline'])
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ when true
+ if idx = keys['label'].index('&')
+ keys['label'] = keys['label'].dup
+ keys['label'][idx] = ''
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ end
+
+ elsif btn_info.kind_of?(Array)
+ keys['label'] = btn_info[0] if btn_info[0]
+
+ case btn_info[1]
+ when Integer
+ keys['underline'] = btn_info[1]
+ when String, Regexp
+ if idx = keys['label'].index(btn_info[1])
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ when true
+ if idx = keys['label'].index('&')
+ keys['label'] = keys['label'].dup
+ keys['label'][idx] = ''
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ end
+
+ if btn_info[2]&&btn_info[2].kind_of?(Hash)
+ keys.update(_symbolkey2str(btn_info[2]))
+ menu_name = keys.delete('menu_name')
+ end
+
+ else
+ keys = {:label=>btn_info}
+ end
+
+ menu = _create_menu(mbar, menu_info[1..-1], menu_name,
+ tearoff, default_opts)
+ menu.tearoff(tearoff)
+
+ keys['menu'] = menu
+ mbar.add('cascade', keys)
+
+ [mbar, menu]
+
+ else
+ # menubar by menubuttons
+ #mbtn = Tk::Menubutton.new(parent)
+ # --> use current TkMenubutton class
+ mbtn = TkMenubutton.new(parent)
+
+ menu_name = nil
+
+ if btn_info.kind_of?(Hash)
+ keys.update(_symbolkey2str(btn_info))
+ menu_name = keys.delete('menu_name')
+ keys['text'] = keys.delete('label') || ''
+ case keys['underline']
+ when String, Regexp
+ if idx = keys['text'].index(keys['underline'])
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ when true
+ if idx = keys['text'].index('&')
+ keys['text'] = keys['text'].dup
+ keys['text'][idx] = ''
+ keys['underline'] = idx
+ else
+ keys['underline'] = -1
+ end
+ end
+ mbtn.configure(keys)
+
+ elsif btn_info.kind_of?(Array)
+ case btn_info[1]
+ when String, Regexp
+ if btn_info[0] && (idx = btn_info[0].index(btn_info[1]))
+ btn_info[1] = idx
+ else
+ btn_info[1] = -1
+ end
+ when true
+ if btn_info[0] && (idx = btn_info[0].index('&'))
+ btn_info[0] = btn_info[0].dup
+ btn_info[0][idx] = ''
+ btn_info[1] = idx
+ else
+ btn_info[1] = -1
+ end
+ end
+ mbtn.configure('text', btn_info[0]) if btn_info[0]
+ mbtn.configure('underline', btn_info[1]) if btn_info[1]
+ # mbtn.configure('accelerator', btn_info[2]) if btn_info[2]
+ if btn_info[2]&&btn_info[2].kind_of?(Hash)
+ keys.update(_symbolkey2str(btn_info[2]))
+ menu_name = keys.delete('menu_name')
+ mbtn.configure(keys)
+ end
+
+ else
+ mbtn.configure('text', btn_info)
+ end
+
+ menu = _create_menu(mbtn, menu_info[1..-1], menu_name,
+ tearoff, default_opts)
+ mbtn.menu(menu)
+
+ if layout_proc.kind_of?(Proc) || layout_proc.kind_of?(Method)
+ # e.g. make a vertical menubar
+ # :layout_proc => proc{|parent, btn| btn.pack(:side=>:top, :fill=>:x)}
+ layout_proc.call(parent, mbtn)
+ else
+ mbtn.pack('side' => 'left')
+ end
+
+ [mbtn, menu]
+ end
+ end
+ private :_create_menubutton
+
+ def _create_menubar(parent, menu_spec, tearoff = false, opts = nil)
+ if tearoff.kind_of?(Hash)
+ opts = tearoff
+ tearoff = false
+ end
+ tearoff = false unless tearoff # nil --> false
+ menu_spec.each{|menu_info|
+ _create_menubutton(parent, menu_info, tearoff, opts)
+ }
+ parent
+ end
+ private :_create_menubar
+
+ def _get_cascade_menus(menu)
+ menus = []
+ (0..(menu.index('last'))).each{|idx|
+ if menu.menutype(idx) == 'cascade'
+ submenu = menu.entrycget(idx, 'menu')
+ menus << [submenu, _get_cascade_menus(submenu)]
+ end
+ }
+ menus
+ end
+ private :_get_cascade_menus
+end
diff --git a/ext/tk/lib/tk/message.rb b/ext/tk/lib/tk/message.rb
new file mode 100644
index 0000000000..5f73b3066f
--- /dev/null
+++ b/ext/tk/lib/tk/message.rb
@@ -0,0 +1,24 @@
+#
+# tk/message.rb : treat message widget
+#
+require 'tk'
+require 'tk/label'
+
+class Tk::Message<Tk::Label
+ TkCommandNames = ['message'.freeze].freeze
+ WidgetClassName = 'Message'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('message', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('message', @path)
+ # end
+ #end
+ private :create_self
+end
+
+#TkMessage = Tk::Message unless Object.const_defined? :TkMessage
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Message, :TkMessage)
+Tk.__set_loaded_toplevel_aliases__('tk/message.rb', :Tk, Tk::Message,
+ :TkMessage)
diff --git a/ext/tk/lib/tk/mngfocus.rb b/ext/tk/lib/tk/mngfocus.rb
new file mode 100644
index 0000000000..a05fb94f8e
--- /dev/null
+++ b/ext/tk/lib/tk/mngfocus.rb
@@ -0,0 +1,33 @@
+#
+# tk/mngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
+# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+module TkManageFocus
+ extend Tk
+
+ TkCommandNames = [
+ 'tk_focusFollowMouse'.freeze,
+ 'tk_focusNext'.freeze,
+ 'tk_focusPrev'.freeze
+ ].freeze
+
+ def TkManageFocus.followsMouse
+ tk_call_without_enc('tk_focusFollowsMouse')
+ end
+
+ def TkManageFocus.next(win)
+ tk_tcl2ruby(tk_call('tk_focusNext', win))
+ end
+ def focusNext
+ TkManageFocus.next(self)
+ end
+
+ def TkManageFocus.prev(win)
+ tk_tcl2ruby(tk_call('tk_focusPrev', win))
+ end
+ def focusPrev
+ TkManageFocus.prev(self)
+ end
+end
diff --git a/ext/tk/lib/tk/msgcat.rb b/ext/tk/lib/tk/msgcat.rb
new file mode 100644
index 0000000000..f2d0653c69
--- /dev/null
+++ b/ext/tk/lib/tk/msgcat.rb
@@ -0,0 +1,299 @@
+#
+# tk/msgcat.rb : methods for Tcl message catalog
+# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+#class TkMsgCatalog
+class TkMsgCatalog < TkObject
+ include TkCore
+ extend Tk
+ #extend TkMsgCatalog
+
+ TkCommandNames = [
+ '::msgcat::mc'.freeze,
+ '::msgcat::mcmax'.freeze,
+ '::msgcat::mclocale'.freeze,
+ '::msgcat::mcpreferences'.freeze,
+ '::msgcat::mcload'.freeze,
+ '::msgcat::mcset'.freeze,
+ '::msgcat::mcmset'.freeze,
+ '::msgcat::mcunknown'.freeze
+ ].freeze
+
+ tk_call_without_enc('package', 'require', 'Tcl', '8.2')
+
+ PACKAGE_NAME = 'msgcat'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ if self.const_defined? :FORCE_VERSION
+ tk_call_without_enc('package', 'require', 'msgcat', FORCE_VERSION)
+ else
+ tk_call_without_enc('package', 'require', 'msgcat')
+ end
+
+ MSGCAT_EXT = '.msg'
+
+ UNKNOWN_CBTBL = TkUtil.untrust(Hash.new{|hash,key| hash[key] = {}})
+
+ TkCore::INTERP.add_tk_procs('::msgcat::mcunknown', 'args', <<-'EOL')
+ if {[set st [catch {eval {ruby_cmd TkMsgCatalog callback} [namespace current] $args} ret]] != 0} {
+ #return -code $st $ret
+ set idx [string first "\n\n" $ret]
+ if {$idx > 0} {
+ return -code $st \
+ -errorinfo [string range $ret [expr $idx + 2] \
+ [string length $ret]] \
+ [string range $ret 0 [expr $idx - 1]]
+ } else {
+ return -code $st $ret
+ }
+ } else {
+ return $ret
+ }
+ EOL
+
+ def self.callback(namespace, locale, src_str, *args)
+ src_str = sprintf(src_str, *args) unless args.empty?
+ cmd_tbl = TkMsgCatalog::UNKNOWN_CBTBL[TkCore::INTERP.__getip]
+ cmd = cmd_tbl[namespace]
+ cmd = cmd_tbl['::'] unless cmd # use global scope as interp default
+ return src_str unless cmd # no cmd -> return src-str (default action)
+ begin
+ cmd.call(locale, src_str)
+ rescue SystemExit
+ exit(0)
+ rescue Interrupt
+ exit!(1)
+ rescue Exception => e
+ begin
+ msg = _toUTF8(e.class.inspect) + ': ' +
+ _toUTF8(e.message) + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ _toUTF8(e.backtrace.join("\n")) +
+ "\n---< backtrace of Tk side >-------"
+ if TkCore::WITH_ENCODING
+ msg.force_encoding('utf-8')
+ else
+ msg.instance_variable_set(:@encoding, 'utf-8')
+ end
+ rescue Exception
+ msg = e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------"
+ end
+ fail(e, msg)
+ end
+ end
+
+ def initialize(namespace = nil)
+ if namespace.kind_of?(TkNamespace)
+ @namespace = namespace
+ elsif namespace == nil
+ @namespace = TkNamespace.new('::') # global namespace
+ else
+ @namespace = TkNamespace.new(namespace)
+ end
+ @path = @namespace.path
+
+ @msgcat_ext = '.msg'
+ end
+ attr_accessor :msgcat_ext
+
+ def method_missing(id, *args)
+ # locale(src, trans) ==> set_translation(locale, src, trans)
+ loc = id.id2name
+ case args.length
+ when 0 # set locale
+ self.locale=(loc)
+
+ when 1 # src only, or trans_list
+ if args[0].kind_of?(Array)
+ # trans_list
+ #list = args[0].collect{|src, trans|
+ # [ Tk::UTF8_String.new(src), Tk::UTF8_String.new(trans) ]
+ #}
+ self.set_translation_list(loc, args[0])
+ else
+ # src
+ #self.set_translation(loc, Tk::UTF8_String.new(args[0]))
+ self.set_translation(loc, args[0])
+ end
+
+ when 2 # src and trans, or, trans_list and enc
+ if args[0].kind_of?(Array)
+ # trans_list
+ self.set_translation_list(loc, *args)
+ else
+ #self.set_translation(loc, args[0], Tk::UTF8_String.new(args[1]))
+ self.set_translation(loc, *args)
+ end
+
+ when 3 # src and trans and enc
+ self.set_translation(loc, *args)
+
+ else
+ super(id, *args)
+# fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at
+
+ end
+ end
+
+ # *args ::= form, arg, arg, ...
+ def self.translate(*args)
+ dst = args.collect{|src|
+ tk_call_without_enc('::msgcat::mc', _get_eval_string(src, true))
+ }
+ Tk.UTF8_String(sprintf(*dst))
+ end
+ class << self
+ alias mc translate
+ alias [] translate
+ end
+ def translate(*args)
+ dst = args.collect{|src|
+ @namespace.eval{tk_call_without_enc('::msgcat::mc',
+ _get_eval_string(src, true))}
+ }
+ Tk.UTF8_String(sprintf(*dst))
+ end
+ alias mc translate
+ alias [] translate
+
+ def self.maxlen(*src_strings)
+ tk_call('::msgcat::mcmax', *src_strings).to_i
+ end
+ def maxlen(*src_strings)
+ @namespace.eval{tk_call('::msgcat::mcmax', *src_strings).to_i}
+ end
+
+ def self.locale
+ tk_call('::msgcat::mclocale')
+ end
+ def locale
+ @namespace.eval{tk_call('::msgcat::mclocale')}
+ end
+
+ def self.locale=(locale)
+ tk_call('::msgcat::mclocale', locale)
+ end
+ def locale=(locale)
+ @namespace.eval{tk_call('::msgcat::mclocale', locale)}
+ end
+
+ def self.preferences
+ tk_split_simplelist(tk_call('::msgcat::mcpreferences'))
+ end
+ def preferences
+ tk_split_simplelist(@namespace.eval{tk_call('::msgcat::mcpreferences')})
+ end
+
+ def self.load_tk(dir)
+ number(tk_call('::msgcat::mcload', dir))
+ end
+
+ def self.load_rb(dir)
+ count = 0
+ preferences().each{|loc|
+ file = File.join(dir, loc + self::MSGCAT_EXT)
+ if File.readable?(file)
+ count += 1
+ if TkCore::WITH_ENCODING
+ eval(IO.read(file, :encoding=>"ASCII-8BIT"))
+ else
+ eval(IO.read(file))
+ end
+ end
+ }
+ count
+ end
+
+ def load_tk(dir)
+ number(@namespace.eval{tk_call('::msgcat::mcload', dir)})
+ end
+
+ def load_rb(dir)
+ count = 0
+ preferences().each{|loc|
+ file = File.join(dir, loc + @msgcat_ext)
+ if File.readable?(file)
+ count += 1
+ if TkCore::WITH_ENCODING
+ @namespace.eval(IO.read(file, :encoding=>"ASCII-8BIT"))
+ else
+ @namespace.eval(IO.read(file))
+ end
+ end
+ }
+ count
+ end
+
+ def self.load(dir)
+ self.load_rb(dir)
+ end
+ alias load load_rb
+
+ def self.set_translation(locale, src_str, trans_str=None, enc='utf-8')
+ if trans_str && trans_str != None
+ trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc))
+ Tk.UTF8_String(ip_eval_without_enc("::msgcat::mcset {#{locale}} {#{_get_eval_string(src_str, true)}} {#{trans_str}}"))
+ else
+ Tk.UTF8_String(ip_eval_without_enc("::msgcat::mcset {#{locale}} {#{_get_eval_string(src_str, true)}}"))
+ end
+ end
+ def set_translation(locale, src_str, trans_str=None, enc='utf-8')
+ if trans_str && trans_str != None
+ trans_str = Tk.UTF8_String(_toUTF8(trans_str, enc))
+ Tk.UTF8_String(@namespace.eval{
+ ip_eval_without_enc("::msgcat::mcset {#{locale}} {#{_get_eval_string(src_str, true)}} {#{trans_str}}")
+ })
+ else
+ Tk.UTF8_String(@namespace.eval{
+ ip_eval_without_enc("::msgcat::mcset {#{locale}} {#{_get_eval_string(src_str, true)}}")
+ })
+ end
+ end
+
+ def self.set_translation_list(locale, trans_list, enc='utf-8')
+ # trans_list ::= [ [src, trans], [src, trans], ... ]
+ list = []
+ trans_list.each{|src, trans|
+ if trans && trans != None
+ list << _get_eval_string(src, true)
+ list << Tk.UTF8_String(_toUTF8(trans, enc))
+ else
+ list << _get_eval_string(src, true) << ''
+ end
+ }
+ #number(tk_call_without_enc('::msgcat::mcmset', locale, list))
+ number(ip_eval_without_enc("::msgcat::mcmset {#{locale}} {#{_get_eval_string(list)}}"))
+ end
+ def set_translation_list(locale, trans_list, enc='utf-8')
+ # trans_list ::= [ [src, trans], [src, trans], ... ]
+ list = []
+ trans_list.each{|src, trans|
+ if trans && trans != None
+ list << _get_eval_string(src, true)
+ list << Tk.UTF8_String(_toUTF8(trans, enc))
+ else
+ list << _get_eval_string(src, true) << ''
+ end
+ }
+ number(@namespace.eval{
+ #tk_call_without_enc('::msgcat::mcmset', locale, list)
+ ip_eval_without_enc("::msgcat::mcmset {#{locale}} {#{_get_eval_string(list)}}")
+ })
+ end
+
+ def self.def_unknown_proc(cmd=Proc.new)
+ TkMsgCatalog::UNKNOWN_CBTBL[TkCore::INTERP.__getip]['::'] = cmd
+ end
+ def def_unknown_proc(cmd=Proc.new)
+ TkMsgCatalog::UNKNOWN_CBTBL[TkCore::INTERP.__getip][@namespace.path] = cmd
+ end
+end
+
+TkMsgCat = TkMsgCatalog
diff --git a/ext/tk/lib/tk/namespace.rb b/ext/tk/lib/tk/namespace.rb
new file mode 100644
index 0000000000..0119ba5ef7
--- /dev/null
+++ b/ext/tk/lib/tk/namespace.rb
@@ -0,0 +1,546 @@
+#
+# tk/namespace.rb : methods to manipulate Tcl/Tk namespace
+# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+class TkNamespace < TkObject
+ extend Tk
+
+ TkCommandNames = [
+ 'namespace'.freeze,
+ ].freeze
+
+ Tk_Namespace_ID_TBL = TkCore::INTERP.create_table
+
+ (Tk_Namespace_ID = ["ns".freeze, TkUtil.untrust("00000")]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ Tk_NsCode_RetObjID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ Tk_Namespace_ID_TBL.mutex.synchronize{ Tk_Namespace_ID_TBL.clear }
+ Tk_NsCode_RetObjID_TBL.mutex.synchronize{ Tk_NsCode_RetObjID_TBL.clear }
+ }
+
+ def TkNamespace.id2obj(id)
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ Tk_Namespace_ID_TBL[id]? Tk_Namespace_ID_TBL[id]: id
+ }
+ end
+
+ #####################################
+
+ class Ensemble < TkObject
+ def __cget_cmd
+ ['namespace', 'ensemble', 'configure', self.path]
+ end
+ private :__cget_cmd
+
+ def __config_cmd
+ ['namespace', 'ensemble', 'configure', self.path]
+ end
+ private :__config_cmd
+
+ def __configinfo_struct
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ :default_value=>nil, :current_value=>2}
+ end
+ private :__configinfo_struct
+
+ def __boolval_optkeys
+ ['prefixes']
+ end
+ private :__boolval_optkeys
+
+ def __listval_optkeys
+ ['map', 'subcommands', 'unknown']
+ end
+ private :__listval_optkeys
+
+ def self.exist?(ensemble)
+ bool(tk_call('namespace', 'ensemble', 'exists', ensemble))
+ end
+
+ def initialize(keys = {})
+ @ensemble = @path = tk_call('namespace', 'ensemble', 'create', keys)
+ end
+
+ def cget(slot)
+ if slot == :namespace || slot == 'namespace'
+ ns = super(slot)
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if TkNamespace::Tk_Namespace_ID_TBL.key?(ns)
+ TkNamespace::Tk_Namespace_ID_TBL[ns]
+ else
+ ns
+ end
+ }
+ else
+ super(slot)
+ end
+ end
+ def cget_strict(slot)
+ if slot == :namespace || slot == 'namespace'
+ ns = super(slot)
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if TkNamespace::Tk_Namespace_ID_TBL.key?(ns)
+ TkNamespace::Tk_Namespace_ID_TBL[ns]
+ else
+ ns
+ end
+ }
+ else
+ super(slot)
+ end
+ end
+
+ def configinfo(slot = nil)
+ if slot
+ if slot == :namespace || slot == 'namespace'
+ val = super(slot)
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if TkNamespace::Tk_Namespace_ID_TBL.key?(val)
+ val = TkNamespace::Tk_Namespace_ID_TBL[val]
+ end
+ }
+ else
+ val = super(slot)
+ end
+
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ [slot.to_s, val]
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ {slot.to_s => val}
+ end
+
+ else
+ info = super()
+
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ info.map!{|inf|
+ if inf[0] == 'namespace' &&
+ TkNamespace::Tk_Namespace_ID_TBL.key?(inf[-1])
+ [inf[0], TkNamespace::Tk_Namespace_ID_TBL[inf[-1]]]
+ else
+ inf
+ end
+ }
+ }
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ val = info['namespace']
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if TkNamespace::Tk_Namespace_ID_TBL.key?(val)
+ info['namespace'] = TkNamespace::Tk_Namespace_ID_TBL[val]
+ end
+ }
+ end
+
+ info
+ end
+ end
+
+ def exists?
+ bool(tk_call('namespace', 'ensemble', 'exists', @path))
+ end
+ end
+
+ #####################################
+
+ class ScopeArgs < Array
+ include Tk
+
+ # alias __tk_call tk_call
+ # alias __tk_call_without_enc tk_call_without_enc
+ # alias __tk_call_with_enc tk_call_with_enc
+ def tk_call(*args)
+ #super('namespace', 'eval', @namespace, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @namespace,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+ def tk_call_without_enc(*args)
+ #super('namespace', 'eval', @namespace, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @namespace,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+ def tk_call_with_enc(*args)
+ #super('namespace', 'eval', @namespace, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @namespace,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+
+ def initialize(namespace, *args)
+ @namespace = namespace
+ super(args.size)
+ self.replace(args)
+ end
+ end
+
+ #####################################
+
+ class NsCode < TkObject
+ def initialize(scope, use_obj_id = false)
+ @scope = scope + ' '
+ @use_obj_id = use_obj_id
+ end
+ def path
+ @scope
+ end
+ def to_eval
+ @scope
+ end
+ def call(*args)
+ ret = TkCore::INTERP._eval_without_enc(@scope + array2tk_list(args))
+ if @use_obj_id
+ ret = TkNamespace::Tk_NsCode_RetObjID_TBL.delete(ret.to_i)
+ end
+ ret
+ end
+ end
+
+ #####################################
+
+ def install_cmd(cmd)
+ lst = tk_split_simplelist(super(cmd), false, false)
+ if lst[1] =~ /^::/
+ lst[1] = @fullname
+ else
+ lst.insert(1, @fullname)
+ end
+ TkCore::INTERP._merge_tklist(*lst)
+ end
+
+ alias __tk_call tk_call
+ alias __tk_call_without_enc tk_call_without_enc
+ alias __tk_call_with_enc tk_call_with_enc
+ def tk_call(*args)
+ #super('namespace', 'eval', @fullname, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @fullname,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+ def tk_call_without_enc(*args)
+ #super('namespace', 'eval', @fullname, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @fullname,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+ def tk_call_with_enc(*args)
+ #super('namespace', 'eval', @fullname, *args)
+ args = args.collect{|arg| (s = _get_eval_string(arg, true))? s: ''}
+ super('namespace', 'eval', @fullname,
+ TkCore::INTERP._merge_tklist(*args))
+ end
+ alias ns_tk_call tk_call
+ alias ns_tk_call_without_enc tk_call_without_enc
+ alias ns_tk_call_with_enc tk_call_with_enc
+
+ def initialize(name = nil, parent = nil)
+ unless name
+ Tk_Namespace_ID.mutex.synchronize{
+ # name = Tk_Namespace_ID.join('')
+ name = Tk_Namespace_ID.join(TkCore::INTERP._ip_id_)
+ Tk_Namespace_ID[1].succ!
+ }
+ end
+ name = __tk_call('namespace', 'current') if name == ''
+ if parent
+ if parent =~ /^::/
+ if name =~ /^::/
+ @fullname = parent + name
+ else
+ @fullname = parent +'::'+ name
+ end
+ else
+ ancestor = __tk_call('namespace', 'current')
+ ancestor = '' if ancestor == '::'
+ if name =~ /^::/
+ @fullname = ancestor + '::' + parent + name
+ else
+ @fullname = ancestor + '::'+ parent +'::'+ name
+ end
+ end
+ else # parent == nil
+ ancestor = __tk_call('namespace', 'current')
+ ancestor = '' if ancestor == '::'
+ if name =~ /^::/
+ @fullname = name
+ else
+ @fullname = ancestor + '::' + name
+ end
+ end
+ @path = @fullname
+ @parent = __tk_call('namespace', 'qualifiers', @fullname)
+ @name = __tk_call('namespace', 'tail', @fullname)
+
+ # create namespace
+ __tk_call('namespace', 'eval', @fullname, '')
+
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ Tk_Namespace_ID_TBL[@fullname] = self
+ }
+ end
+
+ def self.children(*args)
+ # args ::= [<namespace>] [<pattern>]
+ # <pattern> must be glob-style pattern
+ tk_split_simplelist(tk_call('namespace', 'children', *args)).collect{|ns|
+ # ns is fullname
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if Tk_Namespace_ID_TBL.key?(ns)
+ Tk_Namespace_ID_TBL[ns]
+ else
+ ns
+ end
+ }
+ }
+ end
+ def children(pattern=None)
+ TkNamespace.children(@fullname, pattern)
+ end
+
+ def self.code(script = Proc.new)
+ TkNamespace.new('').code(script)
+ end
+=begin
+ def code(script = Proc.new)
+ if script.kind_of?(String)
+ cmd = proc{|*args| ScopeArgs.new(@fullname,*args).instance_eval(script)}
+ elsif script.kind_of?(Proc)
+ cmd = proc{|*args| ScopeArgs.new(@fullname,*args).instance_eval(&script)}
+ else
+ fail ArgumentError, "String or Proc is expected"
+ end
+ TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
+ _get_eval_string(cmd, false)))
+ end
+=end
+ def code(script = Proc.new)
+ if script.kind_of?(String)
+ cmd = proc{|*args|
+ ret = ScopeArgs.new(@fullname,*args).instance_eval(script)
+ id = ret.object_id
+ TkNamespace::Tk_NsCode_RetObjID_TBL[id] = ret
+ id
+ }
+ elsif script.kind_of?(Proc)
+ cmd = proc{|*args|
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ obj = ScopeArgs.new(@fullname,*args)
+ ret = obj.instance_exec(obj, &script)
+ else
+ ret = ScopeArgs.new(@fullname,*args).instance_eval(&script)
+ end
+ id = ret.object_id
+ TkNamespace::Tk_NsCode_RetObjID_TBL[id] = ret
+ id
+ }
+ else
+ fail ArgumentError, "String or Proc is expected"
+ end
+ TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
+ _get_eval_string(cmd, false)),
+ true)
+ end
+
+ def self.current_path
+ tk_call('namespace', 'current')
+ end
+ def current_path
+ @fullname
+ end
+
+ def self.current
+ ns = self.current_path
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if Tk_Namespace_ID_TBL.key?(ns)
+ Tk_Namespace_ID_TBL[ns]
+ else
+ ns
+ end
+ }
+ end
+ def current_namespace
+ # ns_tk_call('namespace', 'current')
+ # @fullname
+ self
+ end
+ alias current current_namespace
+
+ def self.delete(*ns_list)
+ tk_call('namespace', 'delete', *ns_list)
+ ns_list.each{|ns|
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if ns.kind_of?(TkNamespace)
+ Tk_Namespace_ID_TBL.delete(ns.path)
+ else
+ Tk_Namespace_ID_TBL.delete(ns.to_s)
+ end
+ }
+ }
+ end
+ def delete
+ TkNamespece.delete(@fullname)
+ end
+
+ def self.ensemble_create(*keys)
+ tk_call('namespace', 'ensemble', 'create', *hash_kv(keys))
+ end
+ def self.ensemble_configure(cmd, slot, value=None)
+ if slot.kind_of?(Hash)
+ tk_call('namespace', 'ensemble', 'configure', cmd, *hash_kv(slot))
+ else
+ tk_call('namespace', 'ensemble', 'configure', cmd, '-'+slot.to_s, value)
+ end
+ end
+ def self.ensemble_configinfo(cmd, slot = nil)
+ if slot
+ tk_call('namespace', 'ensemble', 'configure', cmd, '-' + slot.to_s)
+ else
+ inf = {}
+ Hash(*tk_split_simplelist(tk_call('namespace', 'ensemble', 'configure', cmd))).each{|k, v| inf[k[1..-1]] = v}
+ inf
+ end
+ end
+ def self.ensemble_exist?(cmd)
+ bool(tk_call('namespace', 'ensemble', 'exists', cmd))
+ end
+
+ def self.eval(namespace, cmd = Proc.new, *args)
+ #tk_call('namespace', 'eval', namespace, cmd, *args)
+ TkNamespace.new(namespace).eval(cmd, *args)
+ end
+=begin
+ def eval(cmd = Proc.new, *args)
+ #TkNamespace.eval(@fullname, cmd, *args)
+ #ns_tk_call(cmd, *args)
+ code_obj = code(cmd)
+ ret = code_obj.call(*args)
+ # uninstall_cmd(TkCore::INTERP._split_tklist(code_obj.path)[-1])
+ uninstall_cmd(_fromUTF8(TkCore::INTERP._split_tklist(_toUTF8(code_obj.path))[-1]))
+ tk_tcl2ruby(ret)
+ end
+=end
+ def eval(cmd = Proc.new, *args)
+ code_obj = code(cmd)
+ ret = code_obj.call(*args)
+ uninstall_cmd(_fromUTF8(TkCore::INTERP._split_tklist(_toUTF8(code_obj.path))[-1]))
+ ret
+ end
+
+ def self.exist?(ns)
+ bool(tk_call('namespace', 'exists', ns))
+ end
+ def exist?
+ TkNamespece.exist?(@fullname)
+ end
+
+ def self.export(*patterns)
+ tk_call('namespace', 'export', *patterns)
+ end
+ def self.export_with_clear(*patterns)
+ tk_call('namespace', 'export', '-clear', *patterns)
+ end
+ def export
+ TkNamespace.export(@fullname)
+ end
+ def export_with_clear
+ TkNamespace.export_with_clear(@fullname)
+ end
+
+ def self.forget(*patterns)
+ tk_call('namespace', 'forget', *patterns)
+ end
+ def forget
+ TkNamespace.forget(@fullname)
+ end
+
+ def self.import(*patterns)
+ tk_call('namespace', 'import', *patterns)
+ end
+ def self.force_import(*patterns)
+ tk_call('namespace', 'import', '-force', *patterns)
+ end
+ def import
+ TkNamespace.import(@fullname)
+ end
+ def force_import
+ TkNamespace.force_import(@fullname)
+ end
+
+ def self.inscope(namespace, script, *args)
+ tk_call('namespace', 'inscope', namespace, script, *args)
+ end
+ def inscope(script, *args)
+ TkNamespace.inscope(@fullname, script, *args)
+ end
+
+ def self.origin(cmd)
+ tk_call('namespace', 'origin', cmd)
+ end
+
+ def self.parent(namespace=None)
+ ns = tk_call('namespace', 'parent', namespace)
+ Tk_Namespace_ID_TBL.mutex.synchronize{
+ if Tk_Namespace_ID_TBL.key?(ns)
+ Tk_Namespace_ID_TBL[ns]
+ else
+ ns
+ end
+ }
+ end
+ def parent
+ tk_call('namespace', 'parent', @fullname)
+ end
+
+ def self.get_path
+ tk_call('namespace', 'path')
+ end
+ def self.set_path(*namespace_list)
+ tk_call('namespace', 'path', array2tk_list(namespace_list))
+ end
+ def set_path
+ tk_call('namespace', 'path', @fullname)
+ end
+
+ def self.qualifiers(str)
+ tk_call('namespace', 'qualifiers', str)
+ end
+
+ def self.tail(str)
+ tk_call('namespace', 'tail', str)
+ end
+
+ def self.upvar(namespace, *var_pairs)
+ tk_call('namespace', 'upvar', namespace, *(var_pairs.flatten))
+ end
+ def upvar(*var_pairs)
+ TkNamespace.inscope(@fullname, *(var_pairs.flatten))
+ end
+
+ def self.get_unknown_handler
+ tk_tcl2ruby(tk_call('namespace', 'unknown'))
+ end
+ def self.set_unknown_handler(cmd = Proc.new)
+ tk_call('namespace', 'unknown', cmd)
+ end
+
+ def self.which(name)
+ tk_call('namespace', 'which', name)
+ end
+ def self.which_command(name)
+ tk_call('namespace', 'which', '-command', name)
+ end
+ def self.which_variable(name)
+ tk_call('namespace', 'which', '-variable', name)
+ end
+end
+
+TkNamespace::Global = TkNamespace.new('::')
diff --git a/ext/tk/lib/tk/optiondb.rb b/ext/tk/lib/tk/optiondb.rb
new file mode 100644
index 0000000000..0f3be30ff7
--- /dev/null
+++ b/ext/tk/lib/tk/optiondb.rb
@@ -0,0 +1,377 @@
+#
+# tk/optiondb.rb : treat option database
+#
+require 'tk'
+
+module TkOptionDB
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['option'.freeze].freeze
+ (CmdClassID = ['CMD_CLASS'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ module Priority
+ WidgetDefault = 20
+ StartupFile = 40
+ UserDefault = 60
+ Interactive = 80
+ 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)
+ tk_call('option', 'get', win ,name, klass)
+ end
+ def readfile(file, pri=None)
+ tk_call('option', 'readfile', file, pri)
+ end
+ alias read_file readfile
+ module_function :add, :clear, :get, :readfile, :read_file
+
+ def read_entries(file, f_enc=nil)
+ if TkCore::INTERP.safe?
+ fail SecurityError,
+ "can't call 'TkOptionDB.read_entries' on a safe interpreter"
+ end
+
+ i_enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
+
+ unless f_enc
+ f_enc = i_enc
+ end
+
+ ent = []
+ cline = ''
+ open(file, 'r') {|f|
+ while line = f.gets
+ #cline += line.chomp!
+ cline.concat(line.chomp!)
+ case cline
+ when /\\$/ # continue
+ cline.chop!
+ next
+ when /^\s*(!|#)/ # coment
+ cline = ''
+ next
+ when /^([^:]+):(.*)$/
+ pat = $1.strip
+ val = $2.lstrip
+ p "ResourceDB: #{[pat, val].inspect}" if $DEBUG
+ pat = TkCore::INTERP._toUTF8(pat, f_enc)
+ pat = TkCore::INTERP._fromUTF8(pat, i_enc)
+ val = TkCore::INTERP._toUTF8(val, f_enc)
+ val = TkCore::INTERP._fromUTF8(val, i_enc)
+ ent << [pat, val]
+ cline = ''
+ else # unknown --> ignore
+ cline = ''
+ next
+ end
+ end
+ }
+ ent
+ end
+ module_function :read_entries
+
+ def read_with_encoding(file, f_enc=nil, pri=None)
+ # try to read the file as an OptionDB file
+ read_entries(file, f_enc).each{|pat, val|
+ add(pat, val, pri)
+ }
+
+=begin
+ i_enc = Tk.encoding()
+
+ unless f_enc
+ f_enc = i_enc
+ end
+
+ cline = ''
+ open(file, 'r') {|f|
+ while line = f.gets
+ cline += line.chomp!
+ case cline
+ when /\\$/ # continue
+ cline.chop!
+ next
+ when /^\s*!/ # coment
+ cline = ''
+ next
+ when /^([^:]+):\s(.*)$/
+ pat = $1
+ val = $2
+ p "ResourceDB: #{[pat, val].inspect}" if $DEBUG
+ pat = TkCore::INTERP._toUTF8(pat, f_enc)
+ pat = TkCore::INTERP._fromUTF8(pat, i_enc)
+ val = TkCore::INTERP._toUTF8(val, f_enc)
+ val = TkCore::INTERP._fromUTF8(val, i_enc)
+ add(pat, val, pri)
+ cline = ''
+ else # unknown --> ignore
+ cline = ''
+ next
+ end
+ end
+ }
+=end
+ end
+ module_function :read_with_encoding
+
+ # support procs on the resource database
+ @@resource_proc_class = Class.new
+
+ @@resource_proc_class.const_set(:CARRIER, '.'.freeze)
+
+ @@resource_proc_class.instance_variable_set('@method_tbl',
+ TkCore::INTERP.create_table)
+ @@resource_proc_class.instance_variable_set('@add_method', false)
+ @@resource_proc_class.instance_variable_set('@safe_mode', 4)
+
+ class << @@resource_proc_class
+ private :new
+
+=begin
+ CARRIER = '.'.freeze
+ METHOD_TBL = TkCore::INTERP.create_table
+ ADD_METHOD = false
+ SAFE_MODE = 4
+=end
+
+=begin
+ def __closed_block_check__(str)
+ depth = 0
+ str.scan(/[{}]/){|x|
+ if x == "{"
+ depth += 1
+ elsif x == "}"
+ depth -= 1
+ end
+ if depth <= 0 && !($' =~ /\A\s*\Z/)
+ fail RuntimeError, "bad string for procedure : #{str.inspect}"
+ end
+ }
+ str
+ end
+ private :__closed_block_check__
+=end
+
+ def __check_proc_string__(str)
+ # If you want to check the proc_string, do it in this method.
+ # Please define this in the block given to 'new_proc_class' method.
+ str
+ end
+
+ def method_missing(id, *args)
+ #res_proc, proc_str = self::METHOD_TBL[id]
+ res_proc, proc_str = @method_tbl[id]
+
+ proc_source = TkOptionDB.get(self::CARRIER, id.id2name, '').strip
+ res_proc = nil if proc_str != proc_source # resource is changed
+
+ # unless res_proc.kind_of?(Proc)
+ unless TkComm._callback_entry?(res_proc)
+ #if id == :new || !(self::METHOD_TBL.has_key?(id) || self::ADD_METHOD)
+ if id == :new || !(@method_tbl.has_key?(id) || @add_method)
+ raise NoMethodError,
+ "not support resource-proc '#{id.id2name}' for #{self.name}"
+ end
+ proc_str = proc_source
+ proc_str = '{' + proc_str + '}' unless /\A\{.*\}\Z/ =~ proc_str
+ #proc_str = __closed_block_check__(proc_str)
+ proc_str = __check_proc_string__(proc_str)
+ res_proc = proc{
+ begin
+ #eval("$SAFE = #{self::SAFE_MODE};\nProc.new" + proc_str)
+ eval("$SAFE = #{@safe_mode};\nProc.new" + proc_str)
+ rescue SyntaxError=>err
+ raise SyntaxError,
+ TkCore::INTERP._toUTF8(err.message.gsub(/\(eval\):\d:/,
+ "(#{id.id2name}):"))
+ end
+ }.call
+ #self::METHOD_TBL[id] = [res_proc, proc_source]
+ @method_tbl[id] = [res_proc, proc_source]
+ end
+ res_proc.call(*args)
+ end
+
+ private :__check_proc_string__, :method_missing
+ end
+ @@resource_proc_class.freeze
+
+=begin
+ def __create_new_class(klass, func, safe = 4, add = false, parent = nil)
+ klass = klass.to_s if klass.kind_of? Symbol
+ unless (?A..?Z) === klass[0]
+ fail ArgumentError, "bad string '#{klass}' for class name"
+ end
+ unless func.kind_of? Array
+ fail ArgumentError, "method-list must be Array"
+ end
+ func_str = func.join(' ')
+ if parent == nil
+ install_win(parent)
+ elsif parent <= @@resource_proc_class
+ install_win(parent::CARRIER)
+ else
+ fail ArgumentError, "parent must be Resource-Proc class"
+ end
+ carrier = Tk.tk_call_without_enc('frame', @path, '-class', klass)
+
+ body = <<-"EOD"
+ class #{klass} < TkOptionDB.module_eval('@@resource_proc_class')
+ CARRIER = '#{carrier}'.freeze
+ METHOD_TBL = TkCore::INTERP.create_table
+ ADD_METHOD = #{add}
+ SAFE_MODE = #{safe}
+ %w(#{func_str}).each{|f| METHOD_TBL[f.intern] = nil }
+ end
+ EOD
+
+ if parent.kind_of?(Class) && parent <= @@resource_proc_class
+ parent.class_eval(body)
+ eval(parent.name + '::' + klass)
+ else
+ eval(body)
+ eval('TkOptionDB::' + klass)
+ end
+ end
+=end
+ def __create_new_class(klass, func, safe = 4, add = false, parent = nil)
+ if klass.kind_of?(TkWindow)
+ carrier = klass.path
+ CmdClassID.mutex.synchronize{
+ klass = CmdClassID.join(TkCore::INTERP._ip_id_)
+ CmdClassID[1].succ!
+ }
+ parent = nil # ignore parent
+ else
+ klass = klass.to_s if klass.kind_of?(Symbol)
+ unless (?A..?Z) === klass[0]
+ fail ArgumentError, "bad string '#{klass}' for class name"
+ end
+ if parent == nil
+ install_win(nil)
+ elsif parent.kind_of?(TkWindow)
+ install_win(parent.path)
+ elsif parent <= @@resource_proc_class
+ install_win(parent::CARRIER)
+ else
+ fail ArgumentError, "parent must be Resource-Proc class"
+ end
+ carrier = Tk.tk_call_without_enc('frame', @path, '-class', klass)
+ end
+
+ unless func.kind_of?(Array)
+ fail ArgumentError, "method-list must be Array"
+ end
+ func_str = func.join(' ')
+
+ if parent.kind_of?(Class) && parent <= @@resource_proc_class
+ cmd_klass = Class.new(parent)
+ else
+ cmd_klass = Class.new(TkOptionDB.module_eval('@@resource_proc_class'))
+ end
+ cmd_klass.const_set(:CARRIER, carrier.dup.freeze)
+
+ cmd_klass.instance_variable_set('@method_tbl', TkCore::INTERP.create_table)
+ cmd_klass.instance_variable_set('@add_method', add)
+ cmd_klass.instance_variable_set('@safe_mode', safe)
+ func.each{|f|
+ cmd_klass.instance_variable_get('@method_tbl')[f.to_s.intern] = nil
+ }
+=begin
+ cmd_klass.const_set(:METHOD_TBL, TkCore::INTERP.create_table)
+ cmd_klass.const_set(:ADD_METHOD, add)
+ cmd_klass.const_set(:SAFE_MODE, safe)
+ func.each{|f| cmd_klass::METHOD_TBL[f.to_s.intern] = nil }
+=end
+
+ cmd_klass
+ end
+ module_function :__create_new_class
+ private_class_method :__create_new_class
+
+ def __remove_methods_of_proc_class(klass)
+ # for security, make these methods invalid
+ class << klass
+ def __null_method(*args); nil; end
+ [ :class_eval, :name, :superclass, :clone, :dup, :autoload, :autoload?,
+ :ancestors, :const_defined?, :const_get, :const_set, :const_missing,
+ :class_variables, :constants, :included_modules, :instance_methods,
+ :method_defined?, :module_eval, :private_instance_methods,
+ :protected_instance_methods, :public_instance_methods,
+ :singleton_methods, :remove_const, :remove_method, :undef_method,
+ :to_s, :inspect, :display, :method, :methods, :respond_to?,
+ :instance_variable_get, :instance_variable_set, :instance_method,
+ :instance_eval, :instance_exec, :instance_variables, :kind_of?, :is_a?,
+ :private_methods, :protected_methods, :public_methods ].each{|m|
+ alias_method(m, :__null_method)
+ }
+ end
+ end
+ module_function :__remove_methods_of_proc_class
+ private_class_method :__remove_methods_of_proc_class
+
+ RAND_BASE_CNT = [0]
+ RAND_BASE_HEAD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ RAND_BASE_CHAR = RAND_BASE_HEAD + 'abcdefghijklmnopqrstuvwxyz0123456789_'
+ def __get_random_basename
+ name = '%s%03d' % [RAND_BASE_HEAD[rand(RAND_BASE_HEAD.size),1],
+ RAND_BASE_CNT[0]]
+ len = RAND_BASE_CHAR.size
+ (6+rand(10)).times{
+ name << RAND_BASE_CHAR[rand(len),1]
+ }
+ RAND_BASE_CNT[0] = RAND_BASE_CNT[0] + 1
+ name
+ end
+ module_function :__get_random_basename
+ private_class_method :__get_random_basename
+
+ # define new proc class :
+ # If you want to modify the new class or create a new subclass,
+ # you must do such operation in the block parameter.
+ # Because the created class is flozen after evaluating the block.
+ def new_proc_class(klass, func, safe = 4, add = false, parent = nil, &b)
+ new_klass = __create_new_class(klass, func, safe, add, parent)
+ new_klass.class_eval(&b) if block_given?
+ __remove_methods_of_proc_class(new_klass)
+ new_klass.freeze
+ new_klass
+ end
+ module_function :new_proc_class
+
+ def eval_under_random_base(parent = nil, &b)
+ new_klass = __create_new_class(__get_random_basename(),
+ [], 4, false, parent)
+ ret = new_klass.class_eval(&b) if block_given?
+ __remove_methods_of_proc_class(new_klass)
+ new_klass.freeze
+ ret
+ end
+ module_function :eval_under_random_base
+
+ def new_proc_class_random(klass, func, safe = 4, add = false, &b)
+ eval_under_random_base(){
+ TkOptionDB.new_proc_class(klass, func, safe, add, self, &b)
+ }
+ end
+ module_function :new_proc_class_random
+end
+TkOption = TkOptionDB
+TkResourceDB = TkOptionDB
diff --git a/ext/tk/lib/tk/optionobj.rb b/ext/tk/lib/tk/optionobj.rb
new file mode 100644
index 0000000000..29b06da0eb
--- /dev/null
+++ b/ext/tk/lib/tk/optionobj.rb
@@ -0,0 +1,212 @@
+#
+# tk/optionobj.rb : control options for a group of widgets
+#
+# NOTE: If you want to use key-only option (no value),
+# use Tk::None for the value of the key-only option.
+#
+# e.g. hash_kv({'aaa'=>1, 'bbb'=>Tk::None, 'ccc'=>3})
+# => ["-aaa", 1, "-bbb", "-ccc", 3]
+#
+require 'tk'
+
+module Tk
+ class OptionObj < Hash
+ include TkUtil
+
+ def initialize(hash = nil)
+ super()
+ @observ = []
+ update_without_notify(_symbolkey2str(hash)) if hash
+ end
+
+ def observ_info
+ @observ.dup
+ end
+
+ def observs
+ @observ.collect{|win|
+ if win.kind_of?(Array)
+ win[0]
+ else
+ win
+ end
+ }
+ end
+
+ def _remove_win(win)
+ if win.kind_of?(Array)
+ widget, method = win
+ @observ.delete_if{|x|
+ if x.kind_of?(Array)
+ x[0] == widget
+ else
+ x == widget
+ end
+ }
+ else
+ @observ.delete_if{|x|
+ if x.kind_of?(Array)
+ x[0] == win
+ else
+ x == win
+ end
+ }
+ end
+ end
+ private :_remove_win
+
+ def assign(*wins)
+ # win :=
+ # widget #==> call widget.configure(hash)
+ # [widget] #==> call widget.configure(hash)
+ # [widget, nil, {src=>target, ... }]
+ # #==> call widget.configure(hash)
+ # with converting hash-key
+ # [widget, method] #==> call widget.method(hash)
+ # [widget, method, {src=>target, ... }]
+ # #==> call widget.method(hash)
+ # with converting hash-key
+ # [widget [receiver, method, arg, ... ]]
+ # #==> call receiver.method(arg, ... , hash)
+ # [widget [receiver, method, arg, ... ], {src=>target, ... }]
+ # #==> call receiver.method(arg, ... , hash)
+ # with onverting hash-key
+ #
+ # src := option_name_on_optobj
+ #
+ # target :=
+ # nil #==> not use the src
+ # option_name_on_target_widget
+ # [ option_name_on_target_widget, ... ]
+ # #==> set all of them
+ #
+ wins.each{|win|
+ _remove_win(win)
+ @observ << win
+ notify(win)
+ }
+ self
+ end
+
+ def unassign(*wins)
+ wins.each{|win|
+ _remove_win(win)
+ }
+ self
+ end
+
+ def notify(target = nil)
+ if target
+ targets = [target]
+ elsif @observ.empty?
+ return self
+ else
+ targets = @observ.dup
+ end
+
+ return self if empty?
+
+ org_hash = _symbolkey2str(self)
+
+ targets.each{|win|
+ widget = receiver = win
+ hash = org_hash
+ begin
+ if win.kind_of?(Array)
+ widget, method, conv_tbl = win
+ receiver = widget
+
+ if conv_tbl
+ hash = {}
+ org_hash.each{|key, val|
+ key = conv_tbl[key] if conv_tbl.key?(key)
+ next unless key
+ if key.kind_of?(Array)
+ key.each{|k| hash[k] = val}
+ else
+ hash[key] = val
+ end
+ }
+ end
+
+ if method.kind_of?(Array)
+ receiver, method, *args = method
+ receiver.__send__(method, *(args << hash))
+ elsif method
+ widget.__send__(method, hash)
+ else
+ widget.configure(hash)
+ end
+
+ else
+ widget.configure(self)
+ end
+ rescue => e
+ if ( ( widget.kind_of?(TkObject) \
+ && widget.respond_to?('exist?') \
+ && ! receiver.exist? ) \
+ || ( receiver.kind_of?(TkObject) \
+ && receiver.respond_to?('exist?') \
+ && ! receiver.exist? ) )
+ @observ.delete(win)
+ else
+ fail e
+ end
+ end
+ }
+
+ self
+ end
+ alias apply notify
+
+ def +(hash)
+ unless hash.kind_of?(Hash)
+ fail ArgumentError, "expect a Hash"
+ end
+ new_obj = self.dup
+ new_obj.update_without_notify(_symbolkey2str(hash))
+ new_obj
+ end
+
+ alias update_without_notify update
+
+ def update(hash)
+ update_without_notify(_symbolkey2str(hash))
+ notify
+ end
+
+ def configure(key, value=nil)
+ if key.kind_of?(Hash)
+ update(key)
+ else
+ store(key,value)
+ end
+ end
+
+ def [](key)
+ super(key.to_s)
+ end
+ alias cget []
+
+ def store(key, val)
+ key = key.to_s
+ super(key, val)
+ notify
+ end
+ def []=(key, val)
+ store(key,val)
+ end
+
+ def replace(hash)
+ super(_symbolkey2str(hash))
+ notify
+ end
+
+ def default(opt)
+ fail RuntimeError, "unknown option `#{opt}'"
+ end
+ private :default
+
+ undef :default=
+ end
+end
diff --git a/ext/tk/lib/tk/pack.rb b/ext/tk/lib/tk/pack.rb
new file mode 100644
index 0000000000..220a38e524
--- /dev/null
+++ b/ext/tk/lib/tk/pack.rb
@@ -0,0 +1,107 @@
+#
+# tk/pack.rb : control pack geometry manager
+#
+require 'tk'
+
+module TkPack
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['pack'.freeze].freeze
+
+=begin
+ def configure(win, *args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ params = []
+ # params.push((win.kind_of?(TkObject))? win.epath: win)
+ params.push(_epath(win))
+ args.each{|win|
+ # params.push((win.kind_of?(TkObject))? win.epath: win)
+ params.push(_epath(win))
+ }
+ opts.each{|k, v|
+ params.push("-#{k}")
+ # params.push((v.kind_of?(TkObject))? v.epath: v)
+ params.push(_epath(v))
+ }
+ tk_call_without_enc("pack", 'configure', *params)
+ end
+=end
+ def configure(*args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ fail ArgumentError, 'no widget is given' if args.empty?
+ params = []
+ args.flatten(1).each{|win| params.push(_epath(win))}
+ opts.each{|k, v|
+ params.push("-#{k}")
+ params.push(_epath(v)) # have to use 'epath' (hash_kv() is unavailable)
+ }
+ tk_call_without_enc("pack", 'configure', *params)
+ end
+ alias pack configure
+
+ def forget(*args)
+ return '' if args.size == 0
+ wins = args.collect{|win|
+ # (win.kind_of?(TkObject))? win.epath: win
+ _epath(win)
+ }
+ tk_call_without_enc('pack', 'forget', *wins)
+ end
+
+ def info(slave)
+ # slave = slave.epath if slave.kind_of?(TkObject)
+ slave = _epath(slave)
+ ilist = list(tk_call_without_enc('pack', 'info', slave))
+ info = {}
+ while key = ilist.shift
+ info[key[1..-1]] = ilist.shift
+ end
+ return info
+ end
+
+ def propagate(master, mode=None)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ if mode == None
+ bool(tk_call_without_enc('pack', 'propagate', master))
+ else
+ tk_call_without_enc('pack', 'propagate', master, mode)
+ end
+ end
+
+ def slaves(master)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ list(tk_call_without_enc('pack', 'slaves', master))
+ end
+
+ module_function :pack, :configure, :forget, :info, :propagate, :slaves
+end
+=begin
+def TkPack(win, *args)
+ if args[-1].kind_of?(Hash)
+ opts = args.pop
+ else
+ opts = {}
+ end
+ params = []
+ params.push((win.kind_of?(TkObject))? win.epath: win)
+ args.each{|win|
+ params.push((win.kind_of?(TkObject))? win.epath: win)
+ }
+ opts.each{|k, v|
+ params.push("-#{k}")
+ params.push((v.kind_of?(TkObject))? v.epath: v)
+ }
+ tk_call_without_enc("pack", *params)
+end
+=end
diff --git a/ext/tk/lib/tk/package.rb b/ext/tk/lib/tk/package.rb
new file mode 100644
index 0000000000..0c329732f5
--- /dev/null
+++ b/ext/tk/lib/tk/package.rb
@@ -0,0 +1,143 @@
+#
+# tk/package.rb : package command
+#
+require 'tk'
+
+module TkPackage
+ include TkCore
+ extend TkPackage
+
+ TkCommandNames = ['package'.freeze].freeze
+
+ def add_path(path)
+ Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path
+ end
+
+ def forget(package)
+ tk_call('package', 'forget', package)
+ nil
+ end
+
+ def if_needed(pkg, ver, *arg, &b)
+ size = arg.size
+
+ if size==0 && !b
+ # proc info
+ procedure(tk_call('package', 'ifneeded', pkg, ver))
+
+ elsif size==0 && b
+ # set proc
+ cmd = proc(&b)
+ tk_call('package', 'ifneeded', pkg, ver, cmd)
+ cmd
+
+ elsif size==1 && !b
+ # set proc
+ cmd = arg[0]
+ if cmd
+ tk_call('package', 'ifneeded', pkg, ver, cmd)
+ cmd
+ else
+ # remove proc
+ tk_call('package', 'ifneeded', pkg, ver, '')
+ nil
+ end
+
+ else
+ fail ArgumentError, 'too many arguments'
+ end
+ end
+
+ def names
+ tk_split_simplelist(tk_call('package', 'names'))
+ end
+
+ def provide(package, version=nil)
+ if version
+ tk_call('package', 'provide', package, version)
+ end
+ if (ret = tk_call('package', 'provide', package)) == ''
+ nil
+ else
+ ret
+ end
+ end
+
+ def present(package, version=None)
+ begin
+ tk_call('package', 'present', package, version)
+ rescue => e
+ fail e.class, 'TkPackage ' << e.message
+ end
+ end
+
+ def present_exact(package, version)
+ begin
+ tk_call('package', 'present', '-exact', package, version)
+ rescue => e
+ fail e.class, 'TkPackage ' << e.message
+ end
+ end
+
+ def require(package, version=None)
+ begin
+ tk_call('package', 'require', package, version)
+ rescue => e
+ fail e.class, 'TkPackage ' << e.message
+ end
+ end
+
+ def require_exact(package, version)
+ begin
+ tk_call('package', 'require', '-exact', package, version)
+ rescue => e
+ fail e.class, 'TkPackage ' << e.message
+ end
+ end
+
+ def unknown_proc(*arg, &b)
+ size = arg.size
+
+ if size==0 && !b
+ # proc info
+ procedure(tk_call('package', 'unknown'))
+
+ elsif size==0 && b
+ # set proc
+ cmd = proc(&b)
+ tk_call('package', 'unknown', cmd)
+ cmd
+
+ elsif size==1 && !b
+ # set proc
+ cmd = arg[0]
+ if cmd
+ tk_call('package', 'unknown', cmd)
+ cmd
+ else
+ # remove proc
+ tk_call('package', 'unknown', '')
+ nil
+ end
+
+ else
+ fail ArgumentError, 'too many arguments'
+ end
+ end
+
+ def versions(package)
+ tk_split_simplelist(tk_call('package', 'versions', package))
+ end
+
+ def vcompare(version1, version2)
+ number(tk_call('package', 'vcompare', version1, version2))
+ end
+
+ def vsatisfies(version1, version2)
+ bool(tk_call('package', 'vsatisfies', version1, version2))
+ end
+
+ def prefer(setting = None)
+ tk_call('package', 'prefer', setting)
+ end
+end
diff --git a/ext/tk/lib/tk/palette.rb b/ext/tk/lib/tk/palette.rb
new file mode 100644
index 0000000000..9462bb0667
--- /dev/null
+++ b/ext/tk/lib/tk/palette.rb
@@ -0,0 +1,55 @@
+#
+# tk/palette.rb : methods for Tcl/Tk standard library 'palette.tcl'
+# 1998/06/21 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+module TkPalette
+ include Tk
+ extend Tk
+
+ TkCommandNames = [
+ 'tk_setPalette'.freeze,
+ 'tk_bisque'.freeze,
+ 'tkDarken'.freeze
+ ].freeze
+
+ def TkPalette.set(*args)
+ args = args[0].to_a.flatten if args[0].kind_of? Hash
+ tk_call('tk_setPalette', *args)
+ end
+ def TkPalette.setPalette(*args)
+ TkPalette.set(*args)
+ end
+
+ def TkPalette.bisque
+ tk_call('tk_bisque')
+ end
+
+ def TkPalette.darken(color, percent)
+ tk_call('tkDarken', color, percent)
+ end
+
+ def TkPalette.recolorTree(win, colors)
+ if not colors.kind_of?(Hash)
+ fail "2nd arg need to be Hash"
+ end
+
+ tk_call('global', "tkPalette")
+ colors.each{|key, value|
+ begin
+ if win.cget(key) == tk_call('set', "tkPalette(#{key})")
+ win[key] = colors[key]
+ end
+ rescue
+ # ignore
+ end
+ }
+
+ TkWinfo.children(win).each{|w| TkPalette.recolorTree(w, colors)}
+ end
+
+ def recolorTree(colors)
+ TkPalette.recolorTree(self, colors)
+ end
+end
diff --git a/ext/tk/lib/tk/panedwindow.rb b/ext/tk/lib/tk/panedwindow.rb
new file mode 100644
index 0000000000..04407802ea
--- /dev/null
+++ b/ext/tk/lib/tk/panedwindow.rb
@@ -0,0 +1,260 @@
+#
+# tk/panedwindow.rb : treat panedwindow
+#
+require 'tk'
+
+class Tk::PanedWindow<TkWindow
+ TkCommandNames = ['panedwindow'.freeze].freeze
+ WidgetClassName = 'Panedwindow'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('panedwindow', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('panedwindow', @path)
+ # end
+ #end
+ #private :create_self
+
+ def add(*args)
+ keys = args.pop
+ fail ArgumentError, "no window in arguments" unless keys
+ if keys && keys.kind_of?(Hash)
+ fail ArgumentError, "no window in arguments" if args == []
+ # args = args.collect{|w| (w.kind_of?(TkObject))? w.epath: w }
+ args = args.collect{|w| _epath(w) }
+ #args.push(hash_kv(keys))
+ args.concat(hash_kv(keys))
+ else
+ args.push(keys) if keys
+ # args = args.collect{|w| (w.kind_of?(TkObject))? w.epath: w }
+ args = args.collect{|w| _epath(w) }
+ end
+ tk_send_without_enc('add', *args)
+ self
+ end
+
+ def forget(win, *wins)
+ wins.unshift(win)
+ # tk_send_without_enc('forget', *((w.kind_of?(TkObject))? w.epath: w))
+ tk_send_without_enc('forget', *(wins.collect{|w| _epath(w)}))
+ self
+ end
+ alias del forget
+ alias delete forget
+ alias remove forget
+
+ def identify(x, y)
+ list(tk_send_without_enc('identify', x, y))
+ end
+
+ def proxy_coord
+ list(tk_send_without_enc('proxy', 'coord'))
+ end
+ def proxy_forget
+ tk_send_without_enc('proxy', 'forget')
+ self
+ end
+ def proxy_place(x, y)
+ tk_send_without_enc('proxy', 'place', x, y)
+ self
+ end
+
+ def sash_coord(index)
+ list(tk_send('sash', 'coord', index))
+ end
+ def sash_dragto(index, x, y)
+ tk_send('sash', 'dragto', index, x, y)
+ self
+ end
+ def sash_mark(index, x, y)
+ tk_send('sash', 'mark', index, x, y)
+ self
+ end
+ def sash_place(index, x, y)
+ tk_send('sash', 'place', index, x, y)
+ self
+ end
+
+ def panecget_strict(win, key)
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ tk_tcl2ruby(tk_send_without_enc('panecget', win, "-#{key}"))
+ end
+ def panecget(win, key)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ panecget_strict(win, key)
+ else
+ begin
+ panecget_strict(win, key)
+ rescue => e
+ begin
+ if current_paneconfiginfo(win).has_key?(option.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+
+ def paneconfigure(win, key, value=nil)
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if key.kind_of? Hash
+ params = []
+ key.each{|k, v|
+ params.push("-#{k}")
+ # params.push((v.kind_of?(TkObject))? v.epath: v)
+ params.push(_epath(v))
+ }
+ tk_send_without_enc('paneconfigure', win, *params)
+ else
+ # value = value.epath if value.kind_of?(TkObject)
+ value = _epath(value)
+ tk_send_without_enc('paneconfigure', win, "-#{key}", value)
+ end
+ self
+ end
+ alias pane_config paneconfigure
+
+ def paneconfiginfo(win, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if key
+ #conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ # win, "-#{key}"))
+ conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ win, "-#{key}"),
+ false, true)
+ conf[0] = conf[0][1..-1]
+ if conf[0] == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ conf[4] = bool(conf[4]) unless conf[4].empty?
+ end
+ conf
+ else
+ #tk_split_simplelist(tk_send_without_enc('paneconfigure',
+ # win)).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('paneconfigure', win),
+ false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[0] = conf[0][1..-1]
+ if conf[3]
+ if conf[0] == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ elsif conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[0] == 'hide'
+ conf[4] = bool(conf[4]) unless conf[4].empty?
+ elsif conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if key
+ #conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ # win, "-#{key}"))
+ conf = tk_split_list(tk_send_without_enc('paneconfigure',
+ win, "-#{key}"),
+ false, true)
+ key = conf.shift[1..-1]
+ if key == 'hide'
+ conf[2] = bool(conf[2]) unless conf[2].empty?
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ end
+ { key => conf }
+ else
+ ret = {}
+ #tk_split_simplelist(tk_send_without_enc('paneconfigure',
+ # win)).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('paneconfigure', win),
+ false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ key = conf.shift[1..-1]
+ if key
+ if key == 'hide'
+ conf[2] = bool(conf[2]) unless conf[2].empty?
+ elsif conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if key == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ elsif conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ ret
+ end
+ end
+ end
+ alias pane_configinfo paneconfiginfo
+
+ def current_paneconfiginfo(win, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = paneconfiginfo(win, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ paneconfiginfo(win).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ paneconfiginfo(win, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+
+ alias current_pane_configinfo current_paneconfiginfo
+
+ def panes
+ list(tk_send_without_enc('panes'))
+ end
+end
+
+Tk::Panedwindow = Tk::PanedWindow
+#TkPanedWindow = Tk::PanedWindow unless Object.const_defined? :TkPanedWindow
+#TkPanedwindow = Tk::Panedwindow unless Object.const_defined? :TkPanedwindow
+#Tk.__set_toplevel_aliases__(:Tk, Tk::PanedWindow,
+# :TkPanedWindow, :TkPanedwindow)
+Tk.__set_loaded_toplevel_aliases__('tk/panedwindow.rb', :Tk, Tk::PanedWindow,
+ :TkPanedWindow, :TkPanedwindow)
diff --git a/ext/tk/lib/tk/place.rb b/ext/tk/lib/tk/place.rb
new file mode 100644
index 0000000000..109d866fda
--- /dev/null
+++ b/ext/tk/lib/tk/place.rb
@@ -0,0 +1,128 @@
+#
+# tk/place.rb : control place geometry manager
+#
+require 'tk'
+
+module TkPlace
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['place'.freeze].freeze
+
+ def configure(win, slot, value=None)
+ # for >= Tk8.4a2 ?
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if slot.kind_of? Hash
+ params = []
+ slot.each{|k, v|
+ params.push("-#{k}")
+ # params.push((v.kind_of?(TkObject))? v.epath: v)
+ params.push(_epath(v))
+ }
+ tk_call_without_enc('place', 'configure', win, *params)
+ else
+ # value = value.epath if value.kind_of?(TkObject)
+ value = _epath(value)
+ tk_call_without_enc('place', 'configure', win, "-#{slot}", value)
+ end
+ end
+ alias place configure
+
+ def configinfo(win, slot = nil)
+ # for >= Tk8.4a2 ?
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if slot
+ #conf = tk_split_list(tk_call_without_enc('place', 'configure',
+ # win, "-#{slot}") )
+ conf = tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ win, "-#{slot}") )
+ conf[0] = conf[0][1..-1]
+ conf[1] = tk_tcl2ruby(conf[1])
+ conf[2] = tk_tcl2ruby(conf[1])
+ conf[3] = tk_tcl2ruby(conf[1])
+ conf[4] = tk_tcl2ruby(conf[1])
+ conf
+ else
+ tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ win)).collect{|conflist|
+ #conf = list(conflist)
+ conf = simplelist(conflist).collect!{|inf| tk_tcl2ruby(inf)}
+ conf[0] = conf[0][1..-1]
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ current_configinfo(win, slot)
+ end
+ end
+
+ def current_configinfo(win, slot = nil)
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ if slot
+ #conf = tk_split_list(tk_call_without_enc('place', 'configure',
+ # win, "-#{slot}") )
+ conf = tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ win, "-#{slot}") )
+ # { conf[0][1..-1] => conf[1] }
+ { conf[0][1..-1] => tk_tcl2ruby(conf[4]) }
+ else
+ ret = {}
+ #tk_split_list(tk_call_without_enc('place','configure',win)).each{|conf|
+ tk_split_simplelist(tk_call_without_enc('place', 'configure',
+ win)).each{|conf_list|
+ #ret[conf[0][1..-1]] = conf[1]
+ conf = simplelist(conf_list)
+ ret[conf[0][1..-1]] = tk_tcl2ruby(conf[4])
+ }
+ ret
+ end
+ end
+
+ def forget(win)
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ tk_call_without_enc('place', 'forget', win)
+ end
+
+ def info(win)
+ # win = win.epath if win.kind_of?(TkObject)
+ win = _epath(win)
+ #ilist = list(tk_call_without_enc('place', 'info', win))
+ ilist = simplelist(tk_call_without_enc('place', 'info', win))
+ info = {}
+ while key = ilist.shift
+ #info[key[1..-1]] = ilist.shift
+ info[key[1..-1]] = tk_tcl2ruby(ilist.shift)
+ end
+ return info
+ end
+
+ def slaves(master)
+ # master = master.epath if master.kind_of?(TkObject)
+ master = _epath(master)
+ list(tk_call('place', 'slaves', master))
+ end
+
+ module_function :place, :configure, :configinfo, :current_configinfo
+ module_function :forget, :info, :slaves
+end
+=begin
+def TkPlace(win, slot, value=None)
+ win = win.epath if win.kind_of?(TkObject)
+ if slot.kind_of? Hash
+ params = []
+ slot.each{|k, v|
+ params.push("-#{k}")
+ params.push((v.kind_of?(TkObject))? v.epath: v)
+ }
+ tk_call_without_enc('place', win, *params)
+ else
+ value = value.epath if value.kind_of?(TkObject)
+ tk_call_without_enc('place', win, "-#{slot}", value)
+ end
+end
+=end
diff --git a/ext/tk/lib/tk/radiobutton.rb b/ext/tk/lib/tk/radiobutton.rb
new file mode 100644
index 0000000000..627df6d9cf
--- /dev/null
+++ b/ext/tk/lib/tk/radiobutton.rb
@@ -0,0 +1,73 @@
+#
+# tk/radiobutton.rb : treat radiobutton widget
+#
+require 'tk'
+require 'tk/button'
+
+class Tk::RadioButton<Tk::Button
+ TkCommandNames = ['radiobutton'.freeze].freeze
+ WidgetClassName = 'Radiobutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('radiobutton', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('radiobutton', @path)
+ # end
+ #end
+ #private :create_self
+
+ def __boolval_optkeys
+ super() << 'indicatoron'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'selectcolor'
+ end
+ private :__strval_optkeys
+
+ def __ruby2val_optkeys # { key=>proc, ... }
+ {
+ 'variable'=>proc{|v| tk_trace_variable(v)} # for backward compatibility
+ }
+ end
+ private :__ruby2val_optkeys
+
+
+ def deselect
+ tk_send_without_enc('deselect')
+ self
+ end
+ def select
+ tk_send_without_enc('select')
+ self
+ end
+
+ def get_value
+ var = tk_send_without_enc('cget', '-variable')
+ if TkVariable::USE_TCLs_SET_VARIABLE_FUNCTIONS
+ _fromUTF8(INTERP._get_global_var(var))
+ else
+ INTERP._eval(Kernel.format('global %s; set %s', var, var))
+ end
+ end
+
+ def set_value(val)
+ var = tk_send_without_enc('cget', '-variable')
+ if TkVariable::USE_TCLs_SET_VARIABLE_FUNCTIONS
+ _fromUTF8(INTERP._set_global_var(var, _get_eval_string(val, true)))
+ else
+ s = '"' + _get_eval_string(val).gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; set %s %s', var, var, s))
+ end
+ end
+end
+
+Tk::Radiobutton = Tk::RadioButton
+#TkRadioButton = Tk::RadioButton unless Object.const_defined? :TkRadioButton
+#TkRadiobutton = Tk::Radiobutton unless Object.const_defined? :TkRadiobutton
+#Tk.__set_toplevel_aliases__(:Tk, Tk::RadioButton,
+# :TkRadioButton, :TkRadiobutton)
+Tk.__set_loaded_toplevel_aliases__('tk/radiobutton.rb', :Tk, Tk::RadioButton,
+ :TkRadioButton, :TkRadiobutton)
diff --git a/ext/tk/lib/tk/root.rb b/ext/tk/lib/tk/root.rb
new file mode 100644
index 0000000000..b4f0bd107f
--- /dev/null
+++ b/ext/tk/lib/tk/root.rb
@@ -0,0 +1,95 @@
+#
+# tk/root.rb : treat root widget
+#
+require 'tk'
+require 'tk/wm'
+require 'tk/menuspec'
+
+class Tk::Root<TkWindow
+ include Wm
+ include TkMenuSpec
+
+ def __methodcall_optkeys # { key=>method, ... }
+ TOPLEVEL_METHODCALL_OPTKEYS
+ end
+ private :__methodcall_optkeys
+
+ def Root.new(keys=nil, &b)
+ unless TkCore::INTERP.tk_windows['.']
+ TkCore::INTERP.tk_windows['.'] =
+ super(:without_creating=>true, :widgetname=>'.'){}
+ end
+ root = TkCore::INTERP.tk_windows['.']
+
+ keys = _symbolkey2str(keys)
+
+ # wm commands
+ root.instance_eval{
+ __methodcall_optkeys.each{|key, method|
+ value = keys.delete(key.to_s)
+ self.__send__(method, value) if value
+ }
+ }
+
+ if keys # wm commands ( for backward comaptibility )
+ keys.each{|k,v|
+ if v.kind_of? Array
+ root.__send__(k,*v)
+ else
+ root.__send__(k,v)
+ end
+ }
+ end
+
+ if block_given?
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ root.instance_exec(root, &b)
+ else
+ root.instance_eval(&b)
+ end
+ end
+ root
+ end
+
+ WidgetClassName = 'Tk'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.to_eval
+ # self::WidgetClassName
+ '.'
+ end
+
+ def create_self
+ @path = '.'
+ end
+ private :create_self
+
+ def path
+ "."
+ end
+
+ def add_menu(menu_info, tearoff=false, opts=nil)
+ # See tk/menuspec.rb for menu_info.
+ # opts is a hash of default configs for all of cascade menus.
+ # Configs of menu_info can override it.
+ if tearoff.kind_of?(Hash)
+ opts = tearoff
+ tearoff = false
+ end
+ _create_menubutton(self, menu_info, tearoff, opts)
+ end
+
+ def add_menubar(menu_spec, tearoff=false, opts=nil)
+ # See tk/menuspec.rb for menu_spec.
+ # opts is a hash of default configs for all of cascade menus.
+ # Configs of menu_spec can override it.
+ menu_spec.each{|info| add_menu(info, tearoff, opts)}
+ self.menu
+ end
+
+ def Root.destroy
+ TkCore::INTERP._invoke('destroy', '.')
+ end
+end
+
+TkRoot = Tk::Root unless Object.const_defined? :TkRoot
diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb
new file mode 100644
index 0000000000..0bdcead7f2
--- /dev/null
+++ b/ext/tk/lib/tk/scale.rb
@@ -0,0 +1,112 @@
+#
+# tk/scale.rb : treat scale widget
+#
+require 'tk'
+
+class Tk::Scale<TkWindow
+ TkCommandNames = ['scale'.freeze].freeze
+ WidgetClassName = 'Scale'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ if keys and keys != None
+ if keys.key?('command') && ! keys['command'].kind_of?(String)
+ cmd = keys.delete('command')
+ keys['command'] = proc{|val| cmd.call(val.to_f)}
+ end
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ #tk_call_without_enc('scale', @path, *hash_kv(keys, true))
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ begin
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ rescue
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ keys = __check_available_configure_options(keys)
+ unless keys.empty?
+ begin
+ tk_call_without_enc('destroy', @path)
+ rescue
+ # cannot destroy
+ configure(keys)
+ else
+ # re-create widget
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ end
+ end
+ end
+ end
+ else
+ #tk_call_without_enc('scale', @path)
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'label'
+ end
+ private :__strval_optkeys
+
+ def _wrap_command_arg(cmd)
+ proc{|val|
+ if val.kind_of?(String)
+ cmd.call(number(val))
+ else
+ cmd.call(val)
+ end
+ }
+ end
+ private :_wrap_command_arg
+
+ def configure_cmd(slot, value)
+ configure(slot=>value)
+ end
+
+ def configure(slot, value=None)
+ if (slot == 'command' || slot == :command)
+ configure('command'=>value)
+ elsif slot.kind_of?(Hash) &&
+ (slot.key?('command') || slot.key?(:command))
+ slot = _symbolkey2str(slot)
+ slot['command'] = _wrap_command_arg(slot.delete('command'))
+ end
+ super(slot, value)
+ end
+
+ def command(cmd=Proc.new)
+ configure('command'=>cmd)
+ end
+
+ def get(x=None, y=None)
+ number(tk_send_without_enc('get', x, y))
+ end
+
+ def coords(val=None)
+ tk_split_list(tk_send_without_enc('coords', val))
+ end
+
+ def identify(x, y)
+ tk_send_without_enc('identify', x, y)
+ end
+
+ def set(val)
+ tk_send_without_enc('set', val)
+ end
+
+ def value
+ get
+ end
+
+ def value= (val)
+ set(val)
+ val
+ end
+end
+
+#TkScale = Tk::Scale unless Object.const_defined? :TkScale
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Scale, :TkScale)
+Tk.__set_loaded_toplevel_aliases__('tk/scale.rb', :Tk, Tk::Scale, :TkScale)
diff --git a/ext/tk/lib/tk/scrollable.rb b/ext/tk/lib/tk/scrollable.rb
new file mode 100644
index 0000000000..96959b7a4b
--- /dev/null
+++ b/ext/tk/lib/tk/scrollable.rb
@@ -0,0 +1,82 @@
+#
+# tk/scrollable.rb : module for scrollable widget
+#
+require 'tk'
+
+module Tk
+ module XScrollable
+ def xscrollcommand(cmd=Proc.new)
+ configure_cmd 'xscrollcommand', cmd
+ # Tk.update # avoid scrollbar trouble
+ self
+ end
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def xscrollbar(bar=nil)
+ if bar
+ @xscrollbar = bar
+ @xscrollbar.orient 'horizontal'
+ self.xscrollcommand {|*arg| @xscrollbar.set(*arg)}
+ @xscrollbar.command {|*arg| self.xview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @xscrollbar
+ end
+ end
+
+ module YScrollable
+ def yscrollcommand(cmd=Proc.new)
+ configure_cmd 'yscrollcommand', cmd
+ # Tk.update # avoid scrollbar trouble
+ self
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+
+ def yscrollbar(bar=nil)
+ if bar
+ @yscrollbar = bar
+ @yscrollbar.orient 'vertical'
+ self.yscrollcommand {|*arg| @yscrollbar.set(*arg)}
+ @yscrollbar.command {|*arg| self.yview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @yscrollbar
+ end
+ end
+
+ X_Scrollable = XScrollable
+ Y_Scrollable = YScrollable
+
+ module Scrollable
+ include XScrollable
+ include YScrollable
+ end
+end
diff --git a/ext/tk/lib/tk/scrollbar.rb b/ext/tk/lib/tk/scrollbar.rb
new file mode 100644
index 0000000000..c0ac201acb
--- /dev/null
+++ b/ext/tk/lib/tk/scrollbar.rb
@@ -0,0 +1,183 @@
+#
+# tk/scrollbar.rb : treat scrollbar widget
+#
+require 'tk'
+
+class Tk::Scrollbar<TkWindow
+ TkCommandNames = ['scrollbar'.freeze].freeze
+ WidgetClassName = 'Scrollbar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ @assigned = []
+ @scroll_proc = proc{|*args|
+ if self.orient == 'horizontal'
+ @assigned.each{|w| w.xview(*args)}
+ else # 'vertical'
+ @assigned.each{|w| w.yview(*args)}
+ end
+ }
+
+ if keys and keys != None
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ #tk_call_without_enc('scrollbar', @path, *hash_kv(keys, true))
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ begin
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ rescue
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ keys = __check_available_configure_options(keys)
+ unless keys.empty?
+ begin
+ tk_call_without_enc('destroy', @path)
+ rescue
+ # cannot destroy
+ configure(keys)
+ else
+ # re-create widget
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ end
+ end
+ end
+ end
+ else
+ #tk_call_without_enc('scrollbar', @path)
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def propagate_set(src_win, first, last)
+ self.set(first, last)
+ if self.orient == 'horizontal'
+ @assigned.each{|w| w.xview('moveto', first) if w != src_win}
+ else # 'vertical'
+ @assigned.each{|w| w.yview('moveto', first) if w != src_win}
+ end
+ end
+
+ def assign(*wins)
+ begin
+ self.command(@scroll_proc) if self.cget('command').cmd != @scroll_proc
+ rescue Exception
+ self.command(@scroll_proc)
+ end
+ orient = self.orient
+ wins.each{|w|
+ @assigned << w unless @assigned.index(w)
+ if orient == 'horizontal'
+ w.xscrollcommand proc{|first, last| self.propagate_set(w, first, last)}
+ else # 'vertical'
+ w.yscrollcommand proc{|first, last| self.propagate_set(w, first, last)}
+ end
+ }
+ Tk.update # avoid scrollbar trouble
+ self
+ end
+
+ def assigned_list
+ begin
+ return @assigned.dup if self.cget('command').cmd == @scroll_proc
+ rescue Exception
+ end
+ fail RuntimeError, "not depend on the assigned_list"
+ end
+
+ def configure(*args)
+ ret = super(*args)
+ # Tk.update # avoid scrollbar trouble
+ ret
+ end
+
+ #def delta(deltax=None, deltay=None)
+ def delta(deltax, deltay)
+ number(tk_send_without_enc('delta', deltax, deltay))
+ end
+
+ #def fraction(x=None, y=None)
+ def fraction(x, y)
+ number(tk_send_without_enc('fraction', x, y))
+ end
+
+ def identify(x, y)
+ tk_send_without_enc('identify', x, y)
+ end
+
+ def get
+ #ary1 = tk_send('get').split
+ #ary2 = []
+ #for i in ary1
+ # ary2.push number(i)
+ #end
+ #ary2
+ list(tk_send_without_enc('get'))
+ end
+
+ def set(first, last)
+ tk_send_without_enc('set', first, last)
+ self
+ end
+
+ def activate(element=None)
+ tk_send_without_enc('activate', element)
+ end
+
+ def moveto(fraction)
+ tk_send_without_enc('moveto', fraction)
+ self
+ end
+
+ def scroll(*args)
+ tk_send_without_enc('scroll', *args)
+ self
+ end
+
+ def scroll_units(num)
+ scroll(num, 'units')
+ self
+ end
+
+ def scroll_pages(num)
+ scroll(num, 'pages')
+ self
+ end
+end
+
+#TkScrollbar = Tk::Scrollbar unless Object.const_defined? :TkScrollbar
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Scrollbar, :TkScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tk/scrollbar.rb', :Tk, Tk::Scrollbar,
+ :TkScrollbar)
+
+
+class Tk::XScrollbar<Tk::Scrollbar
+ def create_self(keys)
+ keys = {} unless keys
+ keys['orient'] = 'horizontal'
+ super(keys)
+ end
+ private :create_self
+end
+
+#TkXScrollbar = Tk::XScrollbar unless Object.const_defined? :TkXScrollbar
+#Tk.__set_toplevel_aliases__(:Tk, Tk::XScrollbar, :TkXScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tk/scrollbar.rb', :Tk, Tk::XScrollbar,
+ :TkXScrollbar)
+
+
+class Tk::YScrollbar<Tk::Scrollbar
+ def create_self(keys)
+ keys = {} unless keys
+ keys['orient'] = 'vertical'
+ super(keys)
+ end
+ private :create_self
+end
+
+#TkYScrollbar = Tk::YScrollbar unless Object.const_defined? :TkYScrollbar
+#Tk.__set_toplevel_aliases__(:Tk, Tk::YScrollbar, :TkYScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tk/scrollbar.rb', :Tk, Tk::YScrollbar,
+ :TkYScrollbar)
diff --git a/ext/tk/lib/tk/scrollbox.rb b/ext/tk/lib/tk/scrollbox.rb
new file mode 100644
index 0000000000..d20742a666
--- /dev/null
+++ b/ext/tk/lib/tk/scrollbox.rb
@@ -0,0 +1,39 @@
+#
+# tk/scrollbox.rb - Tk Listbox with Scrollbar
+# as an example of Composite Widget
+# by Yukihiro Matsumoto <matz@netlab.co.jp>
+#
+require 'tk'
+require 'tk/listbox'
+
+class TkScrollbox<Tk::Listbox
+ include TkComposite
+ def initialize_composite(keys=nil)
+ #list = Tk::Listbox.new(@frame)
+ # -> use current TkListbox class
+ list = TkListbox.new(@frame)
+ #scroll = Tk::Scrollbar.new(@frame)
+ # -> use current TkScrollbar class
+ scroll = TkScrollbar.new(@frame)
+ @path = list.path
+
+=begin
+ list.configure 'yscroll', scroll.path+" set"
+ list.pack 'side'=>'left','fill'=>'both','expand'=>'yes'
+ scroll.configure 'command', list.path+" yview"
+ scroll.pack 'side'=>'right','fill'=>'y'
+=end
+ list.yscrollbar(scroll)
+ list.pack('side'=>'left','fill'=>'both','expand'=>'yes')
+ scroll.pack('side'=>'right','fill'=>'y')
+
+ delegate('DEFAULT', list)
+ delegate('foreground', list)
+ delegate('background', list, scroll)
+ delegate('borderwidth', @frame)
+ delegate('relief', @frame)
+
+ configure keys if keys
+ end
+ private :initialize_composite
+end
diff --git a/ext/tk/lib/tk/selection.rb b/ext/tk/lib/tk/selection.rb
new file mode 100644
index 0000000000..ba0a6f49f9
--- /dev/null
+++ b/ext/tk/lib/tk/selection.rb
@@ -0,0 +1,86 @@
+#
+# tk/selection.rb : control selection
+#
+require 'tk'
+
+module TkSelection
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['selection'.freeze].freeze
+
+ def self.clear(sel=nil)
+ if sel
+ tk_call_without_enc('selection', 'clear', '-selection', sel)
+ else
+ tk_call_without_enc('selection', 'clear')
+ end
+ end
+ def self.clear_on_display(win, sel=nil)
+ if sel
+ tk_call_without_enc('selection', 'clear',
+ '-displayof', win, '-selection', sel)
+ else
+ tk_call_without_enc('selection', 'clear', '-displayof', win)
+ end
+ end
+ def clear(sel=nil)
+ TkSelection.clear_on_display(self, sel)
+ self
+ end
+
+ def self.get(keys=nil)
+ #tk_call('selection', 'get', *hash_kv(keys))
+ _fromUTF8(tk_call_without_enc('selection', 'get', *hash_kv(keys)))
+ end
+ def self.get_on_display(win, keys=nil)
+ #tk_call('selection', 'get', '-displayof', win, *hash_kv(keys))
+ _fromUTF8(tk_call_without_enc('selection', 'get', '-displayof',
+ win, *hash_kv(keys)))
+ end
+ def get(keys=nil)
+ TkSelection.get_on_display(self, sel)
+ end
+
+ def self.handle(win, func=Proc.new, keys=nil, &b)
+ if func.kind_of?(Hash) && keys == nil
+ keys = func
+ func = Proc.new(&b)
+ end
+ args = ['selection', 'handle']
+ args.concat(hash_kv(keys))
+ args.concat([win, func])
+ tk_call_without_enc(*args)
+ end
+ def handle(func=Proc.new, keys=nil, &b)
+ TkSelection.handle(self, func, keys, &b)
+ end
+
+ def self.get_owner(sel=nil)
+ if sel
+ window(tk_call_without_enc('selection', 'own', '-selection', sel))
+ else
+ window(tk_call_without_enc('selection', 'own'))
+ end
+ end
+ def self.get_owner_on_display(win, sel=nil)
+ if sel
+ window(tk_call_without_enc('selection', 'own',
+ '-displayof', win, '-selection', sel))
+ else
+ window(tk_call_without_enc('selection', 'own', '-displayof', win))
+ end
+ end
+ def get_owner(sel=nil)
+ TkSelection.get_owner_on_display(self, sel)
+ self
+ end
+
+ def self.set_owner(win, keys=nil)
+ tk_call_without_enc('selection', 'own', *(hash_kv(keys) << win))
+ end
+ def set_owner(keys=nil)
+ TkSelection.set_owner(self, keys)
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/spinbox.rb b/ext/tk/lib/tk/spinbox.rb
new file mode 100644
index 0000000000..f2917d60ca
--- /dev/null
+++ b/ext/tk/lib/tk/spinbox.rb
@@ -0,0 +1,144 @@
+#
+# tk/spinbox.rb - Tk spinbox classes
+# by Yukihiro Matsumoto <matz@caelum.co.jp>
+#
+require 'tk'
+require 'tk/entry'
+
+class Tk::Spinbox<Tk::Entry
+ TkCommandNames = ['spinbox'.freeze].freeze
+ WidgetClassName = 'Spinbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class SpinCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?d, ?s, :direction ],
+ [ ?s, ?e, :current ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+
+ [ ?e, proc{|val|
+ #enc = Tk.encoding
+ enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
+ if enc
+ Tk.fromUTF8(TkComm::string(val), enc)
+ else
+ TkComm::string(val)
+ end
+ }
+ ],
+
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ (val)? '1': '0'
+ end
+ end
+
+ def self._config_keys
+ ['command']
+ end
+ end
+
+ def __validation_class_list
+ super() << SpinCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, SpinCommand)
+
+ #def create_self(keys)
+ # tk_call_without_enc('spinbox', @path)
+ # if keys and keys != None
+ # configure(keys)
+ # end
+ #end
+ #private :create_self
+
+ def __boolval_optkeys
+ super() << 'wrap'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'buttonbackground' << 'format'
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'values'
+ end
+ private :__listval_optkeys
+
+ def identify(x, y)
+ tk_send_without_enc('identify', x, y)
+ end
+
+ def invoke(elem)
+ tk_send_without_enc('invoke', elem)
+ self
+ end
+
+ def spinup
+ begin
+ tk_send_without_enc('invoke', 'buttonup')
+ rescue RuntimeError => e
+ # old version of element?
+ begin
+ tk_send_without_enc('invoke', 'spinup')
+ rescue
+ fail e
+ end
+ end
+ self
+ end
+
+ def spindown
+ begin
+ tk_send_without_enc('invoke', 'buttondown')
+ rescue RuntimeError => e
+ # old version of element?
+ begin
+ tk_send_without_enc('invoke', 'spinup')
+ rescue
+ fail e
+ end
+ end
+ self
+ end
+
+ def set(str)
+ _fromUTF8(tk_send_without_enc('set', _get_eval_enc_str(str)))
+ end
+end
+
+#TkSpinbox = Tk::Spinbox unless Object.const_defined? :TkSpinbox
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Spinbox, :TkSpinbox)
+Tk.__set_loaded_toplevel_aliases__('tk/spinbox.rb', :Tk, Tk::Spinbox,
+ :TkSpinbox)
diff --git a/ext/tk/lib/tk/tagfont.rb b/ext/tk/lib/tk/tagfont.rb
new file mode 100644
index 0000000000..a1807395d2
--- /dev/null
+++ b/ext/tk/lib/tk/tagfont.rb
@@ -0,0 +1,43 @@
+#
+# tk/tagfont.rb : control font of tags
+#
+require 'tk'
+
+module TkTreatTagFont
+ def font_configinfo
+ @parent.tagfont_configinfo(@id)
+ end
+# alias font font_configinfo
+
+ def font_configure(slot)
+ @parent.tagfont_configure(@id, slot)
+ self
+ end
+
+ def latinfont_configure(ltn, keys=nil)
+ @parent.latintagfont_configure(@id, ltn, keys)
+ self
+ end
+ alias asciifont_configure latinfont_configure
+
+ def kanjifont_configure(knj, keys=nil)
+ @parent.kanjitagfont_configure(@id, ltn, keys)
+ self
+ end
+
+ def font_copy(win, wintag=nil)
+ @parent.tagfont_copy(@id, win, wintag)
+ self
+ end
+
+ def latinfont_copy(win, wintag=nil)
+ @parent.latintagfont_copy(@id, win, wintag)
+ self
+ end
+ alias asciifont_copy latinfont_copy
+
+ def kanjifont_copy(win, wintag=nil)
+ @parent.kanjitagfont_copy(@id, win, wintag)
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb
new file mode 100644
index 0000000000..c18b3843b4
--- /dev/null
+++ b/ext/tk/lib/tk/text.rb
@@ -0,0 +1,1604 @@
+#
+# tk/text.rb - Tk text classes
+# by Yukihiro Matsumoto <matz@caelum.co.jp>
+require 'tk'
+require 'tk/itemfont'
+require 'tk/itemconfig'
+require 'tk/scrollable'
+require 'tk/txtwin_abst'
+
+module TkTextTagConfig
+ include TkTreatItemFont
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id) # id := [ type, tagOrId ]
+ [self.path, id[0], 'cget', id[1]]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id) # id := [ type, tagOrId ]
+ [self.path, id[0], 'configure', id[1]]
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ if id.kind_of?(Array)
+ id = tagid(id[1])
+ end
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ def tag_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['tag', tagOrId], option)
+ end
+ def tag_cget(tagOrId, option)
+ itemcget(['tag', tagOrId], option)
+ end
+ def tag_cget_strict(tagOrId, option)
+ itemcget_strict(['tag', tagOrId], option)
+ end
+ def tag_configure(tagOrId, slot, value=None)
+ itemconfigure(['tag', tagOrId], slot, value)
+ end
+ def tag_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['tag', tagOrId], slot)
+ end
+ def current_tag_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['tag', tagOrId], slot)
+ end
+
+ def window_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['window', tagOrId], option)
+ end
+ def window_cget(tagOrId, option)
+ itemcget(['window', tagOrId], option)
+ end
+ def window_cget_strict(tagOrId, option)
+ itemcget_strict(['window', tagOrId], option)
+ end
+ def window_configure(tagOrId, slot, value=None)
+ itemconfigure(['window', tagOrId], slot, value)
+ end
+ def window_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['window', tagOrId], slot)
+ end
+ def current_window_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['window', tagOrId], slot)
+ end
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+class Tk::Text<TkTextWin
+ ItemConfCMD = ['tag'.freeze, 'configure'.freeze].freeze
+ #include TkTreatTextTagFont
+ include TkTextTagConfig
+ include Scrollable
+
+ #######################################
+
+ module IndexModMethods
+ def +(mod)
+ return chars(mod) if mod.kind_of?(Numeric)
+
+ mod = mod.to_s
+ if mod =~ /^\s*[+-]?\d/
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod)
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
+ end
+ end
+
+ def -(mod)
+ return chars(-mod) if mod.kind_of?(Numeric)
+
+ mod = mod.to_s
+ if mod =~ /^\s*[+-]?\d/
+ Tk::Text::IndexString.new(String.new(id) << ' - ' << mod)
+ elsif mod =~ /^\s*[-]\s+(\d.*)$/
+ Tk::Text::IndexString.new(String.new(id) << ' - -' << $1)
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod)
+ end
+ end
+
+ def chars(mod)
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' chars')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' chars')
+ end
+ end
+ alias char chars
+
+ def display_chars(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display chars')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display chars')
+ end
+ end
+ alias display_char display_chars
+
+ def any_chars(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any chars')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any chars')
+ end
+ end
+ alias any_char any_chars
+
+ def indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' indices')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' indices')
+ end
+ end
+
+ def display_indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display indices')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display indices')
+ end
+ end
+
+ def any_indices(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any indices')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any indices')
+ end
+ end
+
+ def lines(mod)
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' lines')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' lines')
+ end
+ end
+ alias line lines
+
+ def display_lines(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' display_lines')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' display lines')
+ end
+ end
+ alias display_line display_lines
+
+ def any_lines(mod)
+ # Tk8.5 feature
+ fail ArgumentError, 'expect Integer' unless mod.kind_of?(Integer)
+ if mod < 0
+ Tk::Text::IndexString.new(String.new(id) << ' ' << mod.to_s << ' any_lines')
+ else
+ Tk::Text::IndexString.new(String.new(id) << ' + ' << mod.to_s << ' any lines')
+ end
+ end
+ alias any_line any_lines
+
+ def linestart
+ Tk::Text::IndexString.new(String.new(id) << ' linestart')
+ end
+ def lineend
+ Tk::Text::IndexString.new(String.new(id) << ' lineend')
+ end
+
+ def display_linestart
+ # Tk8.5 feature
+ Tk::Text::IndexString.new(String.new(id) << ' display linestart')
+ end
+ def display_lineend
+ # Tk8.5 feature
+ Tk::Text::IndexString.new(String.new(id) << ' display lineend')
+ end
+
+ def wordstart
+ Tk::Text::IndexString.new(String.new(id) << ' wordstart')
+ end
+ def wordend
+ Tk::Text::IndexString.new(String.new(id) << ' wordend')
+ end
+
+ def display_wordstart
+ # Tk8.5 feature
+ Tk::Text::IndexString.new(String.new(id) << ' display wordstart')
+ end
+ def display_wordend
+ # Tk8.5 feature
+ Tk::Text::IndexString.new(String.new(id) << ' display wordend')
+ end
+ end
+
+ class IndexString < String
+ include IndexModMethods
+
+ def self.at(x,y)
+ self.new("@#{x},#{y}")
+ end
+
+ def self.new(str)
+ if str.kind_of?(String)
+ super(str)
+ elsif str.kind_of?(Symbol)
+ super(str.to_s)
+ else
+ str
+ end
+ end
+
+ def id
+ self
+ end
+ end
+
+ #######################################
+
+ TkCommandNames = ['text'.freeze].freeze
+ WidgetClassName = 'Text'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.new(*args, &block)
+ obj = super(*args){}
+ obj.init_instance_variable
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ obj.instance_exec(obj, &block) if defined? yield
+ else
+ obj.instance_eval(&block) if defined? yield
+ end
+ obj
+ end
+
+ def init_instance_variable
+ @cmdtbl = []
+ @tags = {}
+ end
+
+ def __destroy_hook__
+ TkTextTag::TTagID_TBL.mutex.synchronize{
+ TkTextTag::TTagID_TBL.delete(@path)
+ }
+ TkTextTag::TMarkID_TBL.mutex.synchronize{
+ TkTextMark::TMarkID_TBL.delete(@path)
+ }
+ end
+
+ def create_self(keys)
+ #if keys and keys != None
+ # #tk_call_without_enc('text', @path, *hash_kv(keys, true))
+ # tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ # *hash_kv(keys, true))
+ #else
+ # #tk_call_without_enc('text', @path)
+ # tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ #end
+ super(keys)
+ init_instance_variable
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'inactiveseletcionbackground'
+ end
+ private :__strval_optkeys
+
+ def self.at(x, y)
+ Tk::Text::IndexString.at(x, y)
+ end
+
+ def at(x, y)
+ Tk::Text::IndexString.at(x, y)
+ end
+
+ def index(idx)
+ Tk::Text::IndexString.new(tk_send_without_enc('index',
+ _get_eval_enc_str(idx)))
+ end
+
+ def get_displaychars(*index)
+ # Tk8.5 feature
+ get('-displaychars', *index)
+ end
+
+ def value
+ _fromUTF8(tk_send_without_enc('get', "1.0", "end - 1 char"))
+ end
+
+ def value= (val)
+ tk_send_without_enc('delete', "1.0", 'end')
+ tk_send_without_enc('insert', "1.0", _get_eval_enc_str(val))
+ val
+ end
+
+ def clear
+ tk_send_without_enc('delete', "1.0", 'end')
+ self
+ end
+ alias erase clear
+
+ def _addcmd(cmd)
+ @cmdtbl.push cmd
+ end
+
+ def _addtag(name, obj)
+ @tags[name] = obj
+ end
+
+ def tagid(tag)
+ if tag.kind_of?(TkTextTag) \
+ || tag.kind_of?(TkTextMark) \
+ || tag.kind_of?(TkTextImage) \
+ || tag.kind_of?(TkTextWindow)
+ tag.id
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+ private :tagid
+
+ def tagid2obj(tagid)
+ if @tags[tagid]
+ @tags[tagid]
+ else
+ tagid
+ end
+ end
+
+ def tag_names(index=None)
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('tag', 'names', _get_eval_enc_str(index)))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('tag', 'names', _get_eval_enc_str(index)), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def mark_names
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('mark', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('mark', 'names'), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def mark_gravity(mark, direction=nil)
+ if direction
+ tk_send_without_enc('mark', 'gravity',
+ _get_eval_enc_str(mark), direction)
+ self
+ else
+ tk_send_without_enc('mark', 'gravity', _get_eval_enc_str(mark))
+ end
+ end
+
+ def mark_set(mark, index)
+ tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark),
+ _get_eval_enc_str(index))
+ self
+ end
+ alias set_mark mark_set
+
+ def mark_unset(*marks)
+ tk_send_without_enc('mark', 'unset',
+ *(marks.collect{|mark| _get_eval_enc_str(mark)}))
+ self
+ end
+ alias unset_mark mark_unset
+
+ def mark_next(index)
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'next',
+ _get_eval_enc_str(index))))
+ end
+ alias next_mark mark_next
+
+ def mark_previous(index)
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous',
+ _get_eval_enc_str(index))))
+ end
+ alias previous_mark mark_previous
+
+ def image_cget_strict(index, slot)
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ _fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index), "-#{slot}"))
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index),
+ "-#{slot}")))
+ end
+ end
+
+ def image_cget(index, slot)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ image_cget_strict(index, slot)
+ else
+ begin
+ image_cget_strict(index, slot)
+ rescue => e
+ begin
+ if current_image_configinfo(index).has_key?(slot.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+
+ def image_configure(index, slot, value=None)
+ if slot.kind_of?(Hash)
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ *hash_kv(slot, true)))
+ else
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ "-#{slot}",
+ _get_eval_enc_str(value)))
+ end
+ self
+ end
+
+ def image_configinfo(index, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
+ else
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ # tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
+ else
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ ret
+ end
+ end
+ end
+
+ def current_image_configinfo(index, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ conf = image_configinfo(index, slot)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ image_configinfo(index).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ image_configinfo(index, slot).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+
+ def image_names
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('image', 'names'), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def set_insert(index)
+ tk_send_without_enc('mark','set','insert', _get_eval_enc_str(index))
+ self
+ end
+
+ def set_current(index)
+ tk_send_without_enc('mark','set','current', _get_eval_enc_str(index))
+ self
+ end
+
+ def insert(index, chars, *tags)
+ if tags[0].kind_of?(Array)
+ # multiple chars-taglist argument :: str, [tag,...], str, [tag,...], ...
+ args = [chars]
+ while tags.size > 0
+ args << tags.shift.collect{|x|_get_eval_string(x)}.join(' ') # taglist
+ args << tags.shift if tags.size > 0 # chars
+ end
+ super(index, *args)
+ else
+ # single chars-taglist argument :: str, tag, tag, ...
+ if tags.size == 0
+ super(index, chars)
+ else
+ super(index, chars, tags.collect{|x|_get_eval_string(x)}.join(' '))
+ end
+ end
+ end
+
+ def destroy
+ @tags = {} unless @tags
+ @tags.each_value do |t|
+ t.destroy
+ end
+ super()
+ end
+
+ def backspace
+ self.delete 'insert'
+ end
+
+ def bbox(index)
+ list(tk_send_without_enc('bbox', _get_eval_enc_str(index)))
+ end
+
+ def compare(idx1, op, idx2)
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ op, _get_eval_enc_str(idx2)))
+ end
+
+ def count(idx1, idx2, *opts)
+ # opts are Tk8.5 feature
+ cnt = 0
+ args = opts.collect{|opt|
+ str = opt.to_s
+ cnt += 1 if str != 'update'
+ '-' + str
+ }
+ args << _get_eval_enc_str(idx1) << _get_eval_enc_str(idx2)
+ if cnt <= 1
+ number(tk_send_without_enc('count', *opts))
+ else
+ list(tk_send_without_enc('count', *opts))
+ end
+ end
+
+ def count_info(idx1, idx2, update=true)
+ # Tk8.5 feature
+ opts = [
+ :chars, :displaychars, :displayindices, :displaylines,
+ :indices, :lines, :xpixels, :ypixels
+ ]
+ if update
+ lst = count(idx1, idx2, :update, *opts)
+ else
+ lst = count(idx1, idx2, *opts)
+ end
+ info = {}
+ opts.each_with_index{|key, idx| info[key] = lst[idx]}
+ info
+ end
+
+ def peer_names()
+ # Tk8.5 feature
+ list(tk_send_without_enc('peer', 'names'))
+ end
+
+ def replace(idx1, idx2, *opts)
+ tk_send('replace', idx1, idx2, *opts)
+ self
+ end
+
+ def debug
+ bool(tk_send_without_enc('debug'))
+ end
+ def debug=(boolean)
+ tk_send_without_enc('debug', boolean)
+ #self
+ boolean
+ end
+
+ def dlineinfo(index)
+ list(tk_send_without_enc('dlineinfo', _get_eval_enc_str(index)))
+ end
+
+ def modified?
+ bool(tk_send_without_enc('edit', 'modified'))
+ end
+ def modified(mode)
+ tk_send_without_enc('edit', 'modified', mode)
+ self
+ end
+ def modified=(mode)
+ modified(mode)
+ mode
+ end
+
+ def edit_redo
+ tk_send_without_enc('edit', 'redo')
+ self
+ end
+ def edit_reset
+ tk_send_without_enc('edit', 'reset')
+ self
+ end
+ def edit_separator
+ tk_send_without_enc('edit', 'separator')
+ self
+ end
+ def edit_undo
+ tk_send_without_enc('edit', 'undo')
+ self
+ end
+
+ def xview_pickplace(index)
+ tk_send_without_enc('xview', '-pickplace', _get_eval_enc_str(index))
+ self
+ end
+
+ def yview_pickplace(index)
+ tk_send_without_enc('yview', '-pickplace', _get_eval_enc_str(index))
+ self
+ end
+
+ def text_copy
+ # Tk8.4 feature
+ tk_call_without_enc('tk_textCopy', @path)
+ self
+ end
+
+ def text_cut
+ # Tk8.4 feature
+ tk_call_without_enc('tk_textCut', @path)
+ self
+ end
+
+ def text_paste
+ # Tk8.4 feature
+ tk_call_without_enc('tk_textPaste', @path)
+ self
+ end
+
+ def tag_add(tag, index1, index2=None)
+ tk_send_without_enc('tag', 'add', _get_eval_enc_str(tag),
+ _get_eval_enc_str(index1),
+ _get_eval_enc_str(index2))
+ self
+ end
+ alias addtag tag_add
+ alias add_tag tag_add
+
+ def tag_delete(*tags)
+ tk_send_without_enc('tag', 'delete',
+ *(tags.collect{|tag| _get_eval_enc_str(tag)}))
+ TkTextTag::TTagID_TBL.mutex.synchronize{
+ if TkTextTag::TTagID_TBL[@path]
+ tags.each{|tag|
+ if tag.kind_of?(TkTextTag)
+ TkTextTag::TTagID_TBL[@path].delete(tag.id)
+ else
+ TkTextTag::TTagID_TBL[@path].delete(tag)
+ end
+ }
+ end
+ }
+ self
+ end
+ alias deltag tag_delete
+ alias delete_tag tag_delete
+
+ #def tag_bind(tag, seq, cmd=Proc.new, *args)
+ # _bind([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ # self
+ #end
+ def tag_bind(tag, seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ self
+ end
+
+ #def tag_bind_append(tag, seq, cmd=Proc.new, *args)
+ # _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ # self
+ #end
+ def tag_bind_append(tag, seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ self
+ end
+
+ def tag_bind_remove(tag, seq)
+ _bind_remove([@path, 'tag', 'bind', tag], seq)
+ self
+ end
+
+ def tag_bindinfo(tag, context=nil)
+ _bindinfo([@path, 'tag', 'bind', tag], context)
+ end
+
+=begin
+ def tag_cget(tag, key)
+ case key.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ tk_call_without_enc(@path, 'tag', 'cget',
+ _get_eval_enc_str(tag), "-#{key}")
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_send('tag', 'cget', tag, "-#{key}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_without_enc('tag','cget',_get_eval_enc_str(tag),'-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(tag, fnt)
+ end
+ if key.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@path,'tag','cget',_get_eval_enc_str(tag),"-#{key}")))
+ end
+ end
+
+ def tag_configure(tag, key, val=None)
+ if key.kind_of?(Hash)
+ key = _symbolkey2str(key)
+ if ( key['font'] || key['kanjifont'] \
+ || key['latinfont'] || key['asciifont'] )
+ tagfont_configure(tag, key)
+ else
+ tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
+ *hash_kv(key, true))
+ end
+
+ else
+ if key == 'font' || key == :font ||
+ key == 'kanjifont' || key == :kanjifont ||
+ key == 'latinfont' || key == :latinfont ||
+ key == 'asciifont' || key == :asciifont
+ if val == None
+ tagfontobj(tag)
+ else
+ tagfont_configure(tag, {key=>val})
+ end
+ else
+ tk_send_without_enc('tag', 'configure', _get_eval_enc_str(tag),
+ "-#{key}", _get_eval_enc_str(val))
+ end
+ end
+ self
+ end
+
+ def tag_configinfo(tag, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ conf[4] = tagfont_configinfo(tag, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ ret = tk_split_simplelist(_fromUTF8(tk_send('tag','configure',_get_eval_enc_str(tag)))).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ fontconf = ret.assoc('font')
+ if fontconf
+ ret.delete_if{|item| item[0] == 'font' || item[0] == 'kanjifont'}
+ fontconf[4] = tagfont_configinfo(tag, fontconf[4])
+ ret.push(fontconf)
+ else
+ ret
+ end
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ case key.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ when 'font', 'kanjifont'
+ conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ conf[4] = tagfont_configinfo(tag, conf[4])
+ else
+ conf = tk_split_list(_fromUTF8(tk_send_without_enc('tag','configure',_get_eval_enc_str(tag),"-#{key}")))
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(_fromUTF8(tk_send('tag','configure',_get_eval_enc_str(tag)))).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ fontconf = ret['font']
+ if fontconf
+ ret.delete('font')
+ ret.delete('kanjifont')
+ fontconf[3] = tagfont_configinfo(tag, fontconf[3])
+ ret['font'] = fontconf
+ end
+ ret
+ end
+ end
+ end
+
+ def current_tag_configinfo(tag, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = tag_configinfo(tag, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ tag_configinfo(tag).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ tag_configinfo(tag, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+=end
+
+ def tag_raise(tag, above=None)
+ tk_send_without_enc('tag', 'raise', _get_eval_enc_str(tag),
+ _get_eval_enc_str(above))
+ self
+ end
+
+ def tag_lower(tag, below=None)
+ tk_send_without_enc('tag', 'lower', _get_eval_enc_str(tag),
+ _get_eval_enc_str(below))
+ self
+ end
+
+ def tag_remove(tag, *indices)
+ tk_send_without_enc('tag', 'remove', _get_eval_enc_str(tag),
+ *(indices.collect{|idx| _get_eval_enc_str(idx)}))
+ self
+ end
+
+ def tag_ranges(tag)
+ #l = tk_split_simplelist(tk_send_without_enc('tag', 'ranges',
+ # _get_eval_enc_str(tag)))
+ l = tk_split_simplelist(tk_send_without_enc('tag', 'ranges',
+ _get_eval_enc_str(tag)),
+ false, true)
+ r = []
+ while key=l.shift
+ r.push [Tk::Text::IndexString.new(key), Tk::Text::IndexString.new(l.shift)]
+ end
+ r
+ end
+
+ def tag_nextrange(tag, first, last=None)
+ simplelist(tk_send_without_enc('tag', 'nextrange',
+ _get_eval_enc_str(tag),
+ _get_eval_enc_str(first),
+ _get_eval_enc_str(last))).collect{|idx|
+ Tk::Text::IndexString.new(idx)
+ }
+ end
+
+ def tag_prevrange(tag, first, last=None)
+ simplelist(tk_send_without_enc('tag', 'prevrange',
+ _get_eval_enc_str(tag),
+ _get_eval_enc_str(first),
+ _get_eval_enc_str(last))).collect{|idx|
+ Tk::Text::IndexString.new(idx)
+ }
+ end
+
+=begin
+ def window_cget(index, slot)
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ _fromUTF8(tk_send_without_enc('window', 'cget',
+ _get_eval_enc_str(index), "-#{slot}"))
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_send('window', 'cget', index, "-#{slot}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_send_without_enc('window', 'cget', _get_eval_enc_str(index), '-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(index, fnt)
+ end
+ if slot.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('window', 'cget', _get_eval_enc_str(index), "-#{slot}")))
+ end
+ end
+
+ def window_configure(index, slot, value=None)
+ if index.kind_of?(TkTextWindow)
+ index.configure(slot, value)
+ else
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ win = slot['window']
+ # slot['window'] = win.epath if win.kind_of?(TkWindow)
+ slot['window'] = _epath(win) if win
+ if slot['create']
+ p_create = slot['create']
+ if p_create.kind_of?(Proc)
+#=begin
+ slot['create'] = install_cmd(proc{
+ id = p_create.call
+ if id.kind_of?(TkWindow)
+ id.epath
+ else
+ id
+ end
+ })
+#=end
+ slot['create'] = install_cmd(proc{_epath(p_create.call)})
+ end
+ end
+ tk_send_without_enc('window', 'configure',
+ _get_eval_enc_str(index),
+ *hash_kv(slot, true))
+ else
+ if slot == 'window' || slot == :window
+ # id = value
+ # value = id.epath if id.kind_of?(TkWindow)
+ value = _epath(value)
+ end
+ if slot == 'create' || slot == :create
+ p_create = value
+ if p_create.kind_of?(Proc)
+#=begin
+ value = install_cmd(proc{
+ id = p_create.call
+ if id.kind_of?(TkWindow)
+ id.epath
+ else
+ id
+ end
+ })
+#=end
+ value = install_cmd(proc{_epath(p_create.call)})
+ end
+ end
+ tk_send_without_enc('window', 'configure',
+ _get_eval_enc_str(index),
+ "-#{slot}", _get_eval_enc_str(value))
+ end
+ end
+ self
+ end
+
+ def window_configinfo(win, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ conf = tk_split_simplelist(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win), "-#{slot}")))
+ else
+ conf = tk_split_list(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win), "-#{slot}")))
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ tk_split_simplelist(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win)))).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ conf = tk_split_simplelist(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win), "-#{slot}")))
+ else
+ conf = tk_split_list(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win), "-#{slot}")))
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(_fromUTF8(tk_send('window', 'configure', _get_eval_enc_str(win)))).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ ret
+ end
+ end
+ end
+
+ def current_window_configinfo(win, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ conf = window_configinfo(win, slot)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ window_configinfo(win).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ window_configinfo(win, slot).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+=end
+
+ def window_names
+ # tk_split_simplelist(_fromUTF8(tk_send_without_enc('window', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('window', 'names'), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def _ktext_length(txt)
+ if TkCore::WITH_ENCODING ### Ruby 1.9 !!!!!!!!!!!!!
+ return txt.length
+ end
+ ###########################
+
+ if $KCODE !~ /n/i
+ return txt.gsub(/[^\Wa-zA-Z_\d]/, ' ').length
+ end
+
+ # $KCODE == 'NONE'
+ if JAPANIZED_TK
+ tk_call_without_enc('kstring', 'length',
+ _get_eval_enc_str(txt)).to_i
+ else
+ begin
+ tk_call_without_enc('encoding', 'convertto', 'ascii',
+ _get_eval_enc_str(txt)).length
+ rescue StandardError, NameError
+ # sorry, I have no plan
+ txt.length
+ end
+ end
+ end
+ private :_ktext_length
+
+ def tksearch(*args)
+ # call 'search' subcommand of text widget
+ # args ::= [<array_of_opts>] <pattern> <start_index> [<stop_index>]
+ # If <pattern> is regexp, then it must be a regular expression of Tcl
+ nocase = false
+ if args[0].kind_of?(Array)
+ opts = args.shift.collect{|opt|
+ s_opt = opt.to_s
+ nocase = true if s_opt == 'nocase'
+ '-' + s_opt
+ }
+ else
+ opts = []
+ end
+
+ if args[0].kind_of?(Regexp)
+ regexp = args.shift
+ if !nocase && (regexp.options & Regexp::IGNORECASE) != 0
+ opts << '-nocase'
+ end
+ args.unshift(regexp.source)
+ end
+
+ opts << '--'
+
+ ret = tk_send('search', *(opts + args))
+ if ret == ""
+ nil
+ else
+ Tk::Text::IndexString.new(ret)
+ end
+ end
+
+ def tksearch_with_count(*args)
+ # call 'search' subcommand of text widget
+ # args ::= [<array_of_opts>] <var> <pattern> <start_index> [<stop_index>]
+ # If <pattern> is regexp, then it must be a regular expression of Tcl
+ nocase = false
+ if args[0].kind_of?(Array)
+ opts = args.shift.collect{|opt|
+ s_opt = opt.to_s
+ nocase = true if s_opt == 'nocase'
+ '-' + s_opt
+ }
+ else
+ opts = []
+ end
+
+ opts << '-count' << args.shift
+
+ if args[0].kind_of?(Regexp)
+ regexp = args.shift
+ if !nocase && (regexp.options & Regexp::IGNORECASE) != 0
+ opts << '-nocase'
+ end
+ args.unshift(regexp.source)
+ end
+
+ opts << '--'
+
+ ret = tk_send('search', *(opts + args))
+ if ret == ""
+ nil
+ else
+ Tk::Text::IndexString.new(ret)
+ end
+ end
+
+ def search_with_length(pat,start,stop=None)
+ pat = pat.chr if pat.kind_of?(Integer)
+ if stop != None
+ return ["", 0] if compare(start,'>=',stop)
+ txt = get(start,stop)
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index(start + " + #{pos} chars"), pat.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index(start + " + #{pos} chars"), $&.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ else
+ txt = get(start,'end - 1 char')
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index(start + " + #{pos} chars"), pat.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index(start + " + #{pos} chars"), $&.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(match), match]
+ end
+ else
+ txt = get('1.0','end - 1 char')
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ end
+ end
+ end
+
+ def search(pat,start,stop=None)
+ search_with_length(pat,start,stop)[0]
+ end
+
+ def rsearch_with_length(pat,start,stop=None)
+ pat = pat.chr if pat.kind_of?(Integer)
+ if stop != None
+ return ["", 0] if compare(start,'<=',stop)
+ txt = get(stop,start)
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index(stop + " + #{pos} chars"), pat.split('').length]
+ return [index(stop + " + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index(stop + " + #{pos} chars"), $&.split('').length]
+ return [index(stop + " + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ else
+ txt = get('1.0',start)
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ txt = get('1.0','end - 1 char')
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of?(String)
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ end
+ end
+ end
+
+ def rsearch(pat,start,stop=None)
+ rsearch_with_length(pat,start,stop)[0]
+ end
+
+ def dump(type_info, *index, &block)
+ if type_info.kind_of?(Symbol)
+ type_info = [ type_info.to_s ]
+ elsif type_info.kind_of?(String)
+ type_info = [ type_info ]
+ end
+ args = type_info.collect{|inf| '-' + inf}
+ args << '-command' << block if block
+ str = tk_send('dump', *(args + index))
+ result = []
+ sel = nil
+ i = 0
+ while i < str.size
+ # retrieve key
+ idx = str.index(/ /, i)
+ result.push str[i..(idx-1)]
+ i = idx + 1
+
+ # retrieve value
+ case result[-1]
+ when 'text'
+ if str[i] == ?{
+ # text formed as {...}
+ val, i = _retrieve_braced_text(str, i)
+ result.push val
+ else
+ # text which may contain backslahes
+ val, i = _retrieve_backslashed_text(str, i)
+ result.push val
+ end
+ else
+ idx = str.index(/ /, i)
+ val = str[i..(idx-1)]
+ case result[-1]
+ when 'mark'
+ case val
+ when 'insert'
+ result.push TkTextMarkInsert.new(self)
+ when 'current'
+ result.push TkTextMarkCurrent.new(self)
+ when 'anchor'
+ result.push TkTextMarkAnchor.new(self)
+ else
+ result.push tk_tcl2ruby(val)
+ end
+ when 'tagon'
+ if val == 'sel'
+ if sel
+ result.push sel
+ else
+ result.push TkTextTagSel.new(self)
+ end
+ else
+ result.push tk_tcl2ruby(val)
+ end
+ when 'tagoff'
+ result.push tk_tcl2ruby(val)
+ when 'window'
+ result.push tk_tcl2ruby(val)
+ when 'image'
+ result.push tk_tcl2ruby(val)
+ end
+ i = idx + 1
+ end
+
+ # retrieve index
+ idx = str.index(/ /, i)
+ if idx
+ result.push(Tk::Text::IndexString.new(str[i..(idx-1)]))
+ i = idx + 1
+ else
+ result.push(Tk::Text::IndexString.new(str[i..-1]))
+ break
+ end
+ end
+
+ kvis = []
+ until result.empty?
+ kvis.push [result.shift, result.shift, result.shift]
+ end
+ kvis # result is [[key1, value1, index1], [key2, value2, index2], ...]
+ end
+
+ def _retrieve_braced_text(str, i)
+ cnt = 0
+ idx = i
+ while idx < str.size
+ case str[idx]
+ when ?{
+ cnt += 1
+ when ?}
+ cnt -= 1
+ if cnt == 0
+ break
+ end
+ end
+ idx += 1
+ end
+ return str[i+1..idx-1], idx + 2
+ end
+ private :_retrieve_braced_text
+
+ def _retrieve_backslashed_text(str, i)
+ j = i
+ idx = nil
+ loop {
+ idx = str.index(/ /, j)
+ if str[idx-1] == ?\\
+ j += 1
+ else
+ break
+ end
+ }
+ val = str[i..(idx-1)]
+ val.gsub!(/\\( |\{|\})/, '\1')
+ return val, idx + 1
+ end
+ private :_retrieve_backslashed_text
+
+ def dump_all(*index, &block)
+ dump(['all'], *index, &block)
+ end
+ def dump_mark(*index, &block)
+ dump(['mark'], *index, &block)
+ end
+ def dump_tag(*index, &block)
+ dump(['tag'], *index, &block)
+ end
+ def dump_text(*index, &block)
+ dump(['text'], *index, &block)
+ end
+ def dump_window(*index, &block)
+ dump(['window'], *index, &block)
+ end
+ def dump_image(*index, &block)
+ dump(['image'], *index, &block)
+ end
+end
+
+#TkText = Tk::Text unless Object.const_defined? :TkText
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Text, :TkText)
+Tk.__set_loaded_toplevel_aliases__('tk/text.rb', :Tk, Tk::Text, :TkText)
+
+
+#######################################
+
+class Tk::Text::Peer < Tk::Text
+ # Tk8.5 feature
+ def initialize(text, parent=nil, keys={})
+ unless text.kind_of?(Tk::Text)
+ fail ArgumentError, "Tk::Text is expected for 1st argument"
+ end
+ @src_text = text
+ super(parent, keys)
+ end
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(@src_text.path, 'peer', 'create',
+ @path, *hash_kv(keys, true))
+ else
+ tk_call_without_enc(@src_text.path, 'peer', 'create', @path)
+ end
+ end
+ private :create_self
+end
diff --git a/ext/tk/lib/tk/textimage.rb b/ext/tk/lib/tk/textimage.rb
new file mode 100644
index 0000000000..99027a06fb
--- /dev/null
+++ b/ext/tk/lib/tk/textimage.rb
@@ -0,0 +1,88 @@
+#
+# tk/textimage.rb - treat Tk text image object
+#
+require 'tk'
+require 'tk/text'
+
+class TkTextImage<TkObject
+ include Tk::Text::IndexModMethods
+
+ def initialize(parent, index, keys)
+ #unless parent.kind_of?(Tk::Text)
+ # fail ArgumentError, "expect Tk::Text for 1st argument"
+ #end
+ @t = parent
+ if index == 'end' || index == :end
+ @path = TkTextMark.new(@t, tk_call(@t.path, 'index', 'end - 1 chars'))
+ elsif index.kind_of? TkTextMark
+ if tk_call_without_enc(@t.path,'index',index.path) == tk_call_without_enc(@t.path,'index','end')
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ 'end - 1 chars'))
+ else
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ index.path))
+ end
+ else
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ _get_eval_enc_str(index)))
+ end
+ @path.gravity = 'left'
+ @index = @path.path
+ @id = tk_call_without_enc(@t.path, 'image', 'create', @index,
+ *hash_kv(keys, true)).freeze
+ @path.gravity = 'right'
+ end
+
+ def id
+ Tk::Text::IndexString.new(@id)
+ end
+ def mark
+ @path
+ end
+
+ def [](slot)
+ cget(slot)
+ end
+ def []=(slot, value)
+ configure(slot, value)
+ value
+ end
+
+ def cget(slot)
+ @t.image_cget(@index, slot)
+ end
+
+ def cget_strict(slot)
+ @t.image_cget_strict(@index, slot)
+ end
+
+ def configure(slot, value=None)
+ @t.image_configure(@index, slot, value)
+ self
+ end
+# def configure(slot, value)
+# tk_call @t.path, 'image', 'configure', @index, "-#{slot}", value
+# end
+
+ def configinfo(slot = nil)
+ @t.image_configinfo(@index, slot)
+ end
+
+ def current_configinfo(slot = nil)
+ @t.current_image_configinfo(@index, slot)
+ end
+
+ def image
+ img = tk_call_without_enc(@t.path, 'image', 'cget', @index, '-image')
+ TkImage::Tk_IMGTBL[img]? TkImage::Tk_IMGTBL[img] : img
+ end
+
+ def image=(value)
+ tk_call_without_enc(@t.path, 'image', 'configure', @index, '-image',
+ _get_eval_enc_str(value))
+ #self
+ value
+ end
+end
+
+TktImage = TkTextImage
diff --git a/ext/tk/lib/tk/textmark.rb b/ext/tk/lib/tk/textmark.rb
new file mode 100644
index 0000000000..d1888c5e54
--- /dev/null
+++ b/ext/tk/lib/tk/textmark.rb
@@ -0,0 +1,204 @@
+#
+# tk/textmark.rb - methods for treating text marks
+#
+require 'tk'
+require 'tk/text'
+
+class TkTextMark<TkObject
+ include Tk::Text::IndexModMethods
+
+ TMarkID_TBL = TkCore::INTERP.create_table
+
+ (Tk_TextMark_ID = ['mark'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TMarkID_TBL.mutex.synchronize{ TMarkID_TBL.clear }
+ }
+
+ def TkTextMark.id2obj(text, id)
+ tpath = text.path
+ TMarkID_TBL.mutex.synchronize{
+ if TMarkID_TBL[tpath]
+ TMarkID_TBL[tpath][id]? TMarkID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, index)
+ #unless parent.kind_of?(Tk::Text)
+ # fail ArgumentError, "expect Tk::Text for 1st argument"
+ #end
+ @parent = @t = parent
+ @tpath = parent.path
+ Tk_TextMark_ID.mutex.synchronize{
+ # @path = @id = Tk_TextMark_ID.join('')
+ @path = @id = Tk_TextMark_ID.join(TkCore::INTERP._ip_id_).freeze
+ Tk_TextMark_ID[1].succ!
+ }
+ TMarkID_TBL.mutex.synchronize{
+ TMarkID_TBL[@id] = self
+ TMarkID_TBL[@tpath] = {} unless TMarkID_TBL[@tpath]
+ TMarkID_TBL[@tpath][@id] = self
+ }
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ _get_eval_enc_str(index))
+ @t._addtag id, self
+ end
+
+ def id
+ Tk::Text::IndexString.new(@id)
+ end
+
+ def exist?
+ #if ( tk_split_simplelist(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'names'))).find{|id| id == @id } )
+ if ( tk_split_simplelist(tk_call_without_enc(@t.path, 'mark', 'names'), false, true).find{|id| id == @id } )
+ true
+ else
+ false
+ end
+ end
+
+=begin
+ # move to Tk::Text::IndexModMethods module
+ def +(mod)
+ return chars(mod) if mod.kind_of?(Numeric)
+
+ mod = mod.to_s
+ if mod =~ /^\s*[+-]?\d/
+ Tk::Text::IndexString.new(@id + ' + ' + mod)
+ else
+ Tk::Text::IndexString.new(@id + ' ' + mod)
+ end
+ end
+
+ def -(mod)
+ return chars(-mod) if mod.kind_of?(Numeric)
+
+ mod = mod.to_s
+ if mod =~ /^\s*[+-]?\d/
+ Tk::Text::IndexString.new(@id + ' - ' + mod)
+ elsif mod =~ /^\s*[-]\s+(\d.*)$/
+ Tk::Text::IndexString.new(@id + ' - -' + $1)
+ else
+ Tk::Text::IndexString.new(@id + ' ' + mod)
+ end
+ end
+=end
+
+ def pos
+ @t.index(@id)
+ end
+
+ def pos=(where)
+ set(where)
+ end
+
+ def set(where)
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ _get_eval_enc_str(where))
+ self
+ end
+
+ def unset
+ tk_call_without_enc(@t.path, 'mark', 'unset', @id)
+ self
+ end
+ alias destroy unset
+
+ def gravity
+ tk_call_without_enc(@t.path, 'mark', 'gravity', @id)
+ end
+
+ def gravity=(direction)
+ tk_call_without_enc(@t.path, 'mark', 'gravity', @id, direction)
+ #self
+ direction
+ end
+
+ def next(index = nil)
+ if index
+ @t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'next', _get_eval_enc_str(index))))
+ else
+ @t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'next', @id)))
+ end
+ end
+
+ def previous(index = nil)
+ if index
+ @t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'previous', _get_eval_enc_str(index))))
+ else
+ @t.tagid2obj(_fromUTF8(tk_call_without_enc(@t.path, 'mark', 'previous', @id)))
+ end
+ end
+end
+TktMark = TkTextMark
+
+class TkTextNamedMark<TkTextMark
+ def self.new(parent, name, index=nil)
+ TMarkID_TBL.mutex.synchronize{
+ if TMarkID_TBL[parent.path] && TMarkID_TBL[parent.path][name]
+ obj = TMarkID_TBL[parent.path][name]
+ else
+ # super(parent, name, *args)
+ (obj = self.allocate).instance_eval{
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+ TMarkID_TBL[@id] = self
+ TMarkID_TBL[@tpath] = {} unless TMarkID_TBL[@tpath]
+ TMarkID_TBL[@tpath][@id] = self unless TMarkID_TBL[@tpath][@id]
+ @t._addtag @id, self
+ }
+ obj
+ end
+
+ if obj && index
+ tk_call_without_enc(parent.path, 'mark', 'set', name,
+ _get_eval_enc_str(index))
+ end
+ obj
+ }
+ end
+
+ def initialize(parent, name, index=nil)
+ # dummy:: not called by 'new' method
+
+ #unless parent.kind_of?(Tk::Text)
+ # fail ArgumentError, "expect Tk::Text for 1st argument"
+ #end
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+ tk_call_without_enc(@t.path, 'mark', 'set', @id,
+ _get_eval_enc_str(index)) if index
+ @t._addtag @id, self
+ end
+end
+TktNamedMark = TkTextNamedMark
+
+class TkTextMarkInsert<TkTextNamedMark
+ def self.new(parent,*args)
+ super(parent, 'insert', *args)
+ end
+end
+TktMarkInsert = TkTextMarkInsert
+
+class TkTextMarkCurrent<TkTextNamedMark
+ def self.new(parent,*args)
+ super(parent, 'current', *args)
+ end
+end
+TktMarkCurrent = TkTextMarkCurrent
+
+class TkTextMarkAnchor<TkTextNamedMark
+ def self.new(parent,*args)
+ super(parent, 'anchor', *args)
+ end
+end
+TktMarkAnchor = TkTextMarkAnchor
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb
new file mode 100644
index 0000000000..96692014e4
--- /dev/null
+++ b/ext/tk/lib/tk/texttag.rb
@@ -0,0 +1,321 @@
+#
+# tk/texttag.rb - methods for treating text tags
+#
+require 'tk'
+require 'tk/text'
+require 'tk/tagfont'
+
+class TkTextTag<TkObject
+ include TkTreatTagFont
+ include Tk::Text::IndexModMethods
+
+ TTagID_TBL = TkCore::INTERP.create_table
+
+ (Tk_TextTag_ID = ['tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TTagID_TBL.mutex.synchronize{ TTagID_TBL.clear }
+ }
+
+ def TkTextTag.id2obj(text, id)
+ tpath = text.path
+ TTagID_TBL.mutex.synchronize{
+ if TTagID_TBL[tpath]
+ TTagID_TBL[tpath][id]? TTagID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, *args)
+ #unless parent.kind_of?(TkText)
+ # fail ArgumentError, "expect TkText for 1st argument"
+ #end
+ @parent = @t = parent
+ @tpath = parent.path
+ Tk_TextTag_ID.mutex.synchronize{
+ # @path = @id = Tk_TextTag_ID.join('')
+ @path = @id = Tk_TextTag_ID.join(TkCore::INTERP._ip_id_).freeze
+ Tk_TextTag_ID[1].succ!
+ }
+ TTagID_TBL.mutex.synchronize{
+ TTagID_TBL[@id] = self
+ TTagID_TBL[@tpath] = {} unless TTagID_TBL[@tpath]
+ TTagID_TBL[@tpath][@id] = self
+ }
+ #tk_call @t.path, "tag", "configure", @id, *hash_kv(keys)
+ if args != []
+ keys = args.pop
+ if keys.kind_of?(Hash)
+ add(*args) if args != []
+ configure(keys)
+ else
+ args.push keys
+ add(*args)
+ end
+ end
+ @t._addtag id, self
+ end
+
+ def id
+ Tk::Text::IndexString.new(@id)
+ end
+
+ def exist?
+ #if ( tk_split_simplelist(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'names'))).find{|id| id == @id } )
+ if ( tk_split_simplelist(tk_call_without_enc(@t.path, 'tag', 'names'), false, true).find{|id| id == @id } )
+ true
+ else
+ false
+ end
+ end
+
+ def first
+ Tk::Text::IndexString.new(@id + '.first')
+ end
+
+ def last
+ Tk::Text::IndexString.new(@id + '.last')
+ end
+
+ def add(*indices)
+ tk_call_without_enc(@t.path, 'tag', 'add', @id,
+ *(indices.collect{|idx| _get_eval_enc_str(idx)}))
+ self
+ end
+
+ def remove(*indices)
+ tk_call_without_enc(@t.path, 'tag', 'remove', @id,
+ *(indices.collect{|idx| _get_eval_enc_str(idx)}))
+ self
+ end
+
+ def ranges
+ l = tk_split_simplelist(tk_call_without_enc(@t.path, 'tag', 'ranges', @id))
+ r = []
+ while key=l.shift
+ r.push [Tk::Text::IndexString.new(key), Tk::Text::IndexString.new(l.shift)]
+ end
+ r
+ end
+
+ def nextrange(first, last=None)
+ simplelist(tk_call_without_enc(@t.path, 'tag', 'nextrange', @id,
+ _get_eval_enc_str(first),
+ _get_eval_enc_str(last))).collect{|idx|
+ Tk::Text::IndexString.new(idx)
+ }
+ end
+
+ def prevrange(first, last=None)
+ simplelist(tk_call_without_enc(@t.path, 'tag', 'prevrange', @id,
+ _get_eval_enc_str(first),
+ _get_eval_enc_str(last))).collect{|idx|
+ Tk::Text::IndexString.new(idx)
+ }
+ end
+
+ def [](key)
+ cget key
+ end
+
+ def []=(key,val)
+ configure key, val
+ val
+ end
+
+ def cget_tkstring(key)
+ @t.tag_cget_tkstring @id, key
+ end
+ def cget(key)
+ @t.tag_cget @id, key
+ end
+ def cget_strict(key)
+ @t.tag_cget_strict @id, key
+ end
+=begin
+ def cget(key)
+ case key.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ _fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', @id, "-#{key}"))
+ when 'font', 'kanjifont'
+ #fnt = tk_tcl2ruby(tk_call(@t.path, 'tag', 'cget', @id, "-#{key}"))
+ fnt = tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget',
+ @id, '-font')))
+ unless fnt.kind_of?(TkFont)
+ fnt = tagfontobj(@id, fnt)
+ end
+ if key.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/
+ # obsolete; just for compatibility
+ fnt.kanji_font
+ else
+ fnt
+ end
+ else
+ tk_tcl2ruby(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget',
+ @id, "-#{key}")))
+ end
+ end
+=end
+
+ def configure(key, val=None)
+ @t.tag_configure @id, key, val
+ end
+# def configure(key, val=None)
+# if key.kind_of?(Hash)
+# tk_call @t.path, 'tag', 'configure', @id, *hash_kv(key)
+# else
+# tk_call @t.path, 'tag', 'configure', @id, "-#{key}", val
+# end
+# end
+# def configure(key, value)
+# if value == FALSE
+# value = "0"
+# elsif value.kind_of?(Proc)
+# value = install_cmd(value)
+# end
+# tk_call @t.path, 'tag', 'configure', @id, "-#{key}", value
+# end
+
+ def configinfo(key=nil)
+ @t.tag_configinfo @id, key
+ end
+
+ def current_configinfo(key=nil)
+ @t.current_tag_configinfo @id, key
+ end
+
+ #def bind(seq, cmd=Proc.new, *args)
+ # _bind([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ # self
+ #end
+ def bind(seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ self
+ end
+
+ #def bind_append(seq, cmd=Proc.new, *args)
+ # _bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ # self
+ #end
+ def bind_append(seq, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ self
+ end
+
+ def bind_remove(seq)
+ _bind_remove([@t.path, 'tag', 'bind', @id], seq)
+ self
+ end
+
+ def bindinfo(context=nil)
+ _bindinfo([@t.path, 'tag', 'bind', @id], context)
+ end
+
+ def raise(above=None)
+ tk_call_without_enc(@t.path, 'tag', 'raise', @id,
+ _get_eval_enc_str(above))
+ self
+ end
+
+ def lower(below=None)
+ tk_call_without_enc(@t.path, 'tag', 'lower', @id,
+ _get_eval_enc_str(below))
+ self
+ end
+
+ def destroy
+ tk_call_without_enc(@t.path, 'tag', 'delete', @id)
+ TTagID_TBL.mutex.synchronize{
+ TTagID_TBL[@tpath].delete(@id) if TTagID_TBL[@tpath]
+ }
+ self
+ end
+end
+TktTag = TkTextTag
+
+class TkTextNamedTag<TkTextTag
+ def self.new(parent, name, *args)
+ tagobj = nil
+ TTagID_TBL.mutex.synchronize{
+ if TTagID_TBL[parent.path] && TTagID_TBL[parent.path][name]
+ tagobj = TTagID_TBL[parent.path][name]
+ else
+ # super(parent, name, *args)
+ (tagobj = self.allocate).instance_eval{
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+ TTagID_TBL[@id] = self
+ TTagID_TBL[@tpath] = {} unless TTagID_TBL[@tpath]
+ TTagID_TBL[@tpath][@id] = self unless TTagID_TBL[@tpath][@id]
+ @t._addtag @id, self
+ }
+ end
+ }
+
+ if args != []
+ keys = args.pop
+ if keys.kind_of?(Hash)
+ tagobj.add(*args) if args != []
+ tagobj.configure(keys)
+ else
+ args.push keys
+ tagobj.add(*args)
+ end
+ end
+
+ tagobj
+ end
+
+ def initialize(parent, name, *args)
+ # dummy:: not called by 'new' method
+
+ #unless parent.kind_of?(Tk::Text)
+ # fail ArgumentError, "expect Tk::Text for 1st argument"
+ #end
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+
+ #if mode
+ # tk_call @t.path, "addtag", @id, *args
+ #end
+ if args != []
+ keys = args.pop
+ if keys.kind_of?(Hash)
+ add(*args) if args != []
+ configure(keys)
+ else
+ args.push keys
+ add(*args)
+ end
+ end
+ @t._addtag @id, self
+ end
+end
+TktNamedTag = TkTextNamedTag
+
+class TkTextTagSel<TkTextNamedTag
+ def self.new(parent, *args)
+ super(parent, 'sel', *args)
+ end
+end
+TktTagSel = TkTextTagSel
diff --git a/ext/tk/lib/tk/textwindow.rb b/ext/tk/lib/tk/textwindow.rb
new file mode 100644
index 0000000000..49327b2c81
--- /dev/null
+++ b/ext/tk/lib/tk/textwindow.rb
@@ -0,0 +1,154 @@
+#
+# tk/textwindow.rb - treat Tk text window object
+#
+require 'tk'
+require 'tk/text'
+
+class TkTextWindow<TkObject
+ include Tk::Text::IndexModMethods
+
+ def initialize(parent, index, keys = {})
+ #unless parent.kind_of?(Tk::Text)
+ # fail ArgumentError, "expect Tk::Text for 1st argument"
+ #end
+ @t = parent
+ if index == 'end' || index == :end
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ 'end - 1 chars'))
+ elsif index.kind_of?(TkTextMark)
+ if tk_call_without_enc(@t.path,'index',index.path) == tk_call_without_enc(@t.path,'index','end')
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ 'end - 1 chars'))
+ else
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index',
+ index.path))
+ end
+ else
+ @path = TkTextMark.new(@t, tk_call_without_enc(@t.path, 'index', _get_eval_enc_str(index)))
+ end
+ @path.gravity = 'left'
+ @index = @path.path
+ keys = _symbolkey2str(keys)
+ @id = keys['window']
+ # keys['window'] = @id.epath if @id.kind_of?(TkWindow)
+ keys['window'] = _epath(@id) if @id
+ if keys['create']
+ @p_create = keys['create']
+ # if @p_create.kind_of?(Proc)
+ if TkComm._callback_entry?(@p_create)
+=begin
+ keys['create'] = install_cmd(proc{
+ @id = @p_create.call
+ if @id.kind_of?(TkWindow)
+ @id.epath
+ else
+ @id
+ end
+ })
+=end
+ keys['create'] = install_cmd(proc{@id = @p_create.call; _epath(@id)})
+ end
+ end
+ tk_call_without_enc(@t.path, 'window', 'create', @index,
+ *hash_kv(keys, true))
+ @path.gravity = 'right'
+ end
+
+ def id
+ Tk::Text::IndexString.new(_epath(@id))
+ end
+ def mark
+ @path
+ end
+
+ def [](slot)
+ cget(slot)
+ end
+ def []=(slot, value)
+ configure(slot, value)
+ value
+ end
+
+ def cget(slot)
+ @t.window_cget(@index, slot)
+ end
+ def cget_strict(slot)
+ @t.window_cget_strict(@index, slot)
+ end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ if slot['window']
+ @id = slot['window']
+ # slot['window'] = @id.epath if @id.kind_of?(TkWindow)
+ slot['window'] = _epath(@id) if @id
+ end
+ if slot['create']
+ self.create=slot.delete('create')
+ end
+ if slot.size > 0
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ *hash_kv(slot, true))
+ end
+ else
+ if slot == 'window' || slot == :window
+ @id = value
+ # value = @id.epath if @id.kind_of?(TkWindow)
+ value = _epath(@id) if @id
+ end
+ if slot == 'create' || slot == :create
+ self.create=value
+ else
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ "-#{slot}", _get_eval_enc_str(value))
+ end
+ end
+ self
+ end
+
+ def configinfo(slot = nil)
+ @t.window_configinfo(@index, slot)
+ end
+
+ def current_configinfo(slot = nil)
+ @t.current_window_configinfo(@index, slot)
+ end
+
+ def window
+ @id
+ end
+
+ def window=(value)
+ @id = value
+ # value = @id.epath if @id.kind_of?(TkWindow)
+ value = _epath(@id) if @id
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ '-window', _get_eval_enc_str(value))
+ value
+ end
+
+ def create
+ @p_create
+ end
+
+ def create=(value)
+ @p_create = value
+ # if @p_create.kind_of?(Proc)
+ if TkComm._callback_entry?(@p_create)
+ value = install_cmd(proc{
+ @id = @p_create.call
+ if @id.kind_of?(TkWindow)
+ @id.epath
+ else
+ @id
+ end
+ })
+ end
+ tk_call_without_enc(@t.path, 'window', 'configure', @index,
+ '-create', _get_eval_enc_str(value))
+ value
+ end
+end
+
+TktWindow = TkTextWindow
diff --git a/ext/tk/lib/tk/timer.rb b/ext/tk/lib/tk/timer.rb
new file mode 100644
index 0000000000..ddfbfce9be
--- /dev/null
+++ b/ext/tk/lib/tk/timer.rb
@@ -0,0 +1,669 @@
+#
+# tk/timer.rb : methods for Tcl/Tk after command
+#
+# $Id$
+#
+require 'tk'
+
+class TkTimer
+ include TkCore
+ extend TkCore
+
+ TkCommandNames = ['after'.freeze].freeze
+
+ (Tk_CBID = ['a'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ Tk_CBTBL = TkUtil.untrust({})
+
+ TkCore::INTERP.add_tk_procs('rb_after', 'id', <<-'EOL')
+ if {[set st [catch {eval {ruby_cmd TkTimer callback} $id} ret]] != 0} {
+ return -code $st $ret
+ } {
+ return $ret
+ }
+ EOL
+
+ DEFAULT_IGNORE_EXCEPTIONS = [ NameError, RuntimeError ].freeze
+
+ ###############################
+ # class methods
+ ###############################
+ def self.start(*args, &b)
+ self.new(*args, &b).start
+ end
+
+ def self.callback(obj_id)
+ ex_obj = Tk_CBTBL[obj_id]
+ return "" if ex_obj == nil; # canceled
+ ex_obj.cb_call
+ end
+
+ def self.info(obj = nil)
+ if obj
+ if obj.kind_of?(TkTimer)
+ if obj.after_id
+ inf = tk_split_list(tk_call_without_enc('after','info',obj.after_id))
+ [Tk_CBTBL[inf[0][1]], inf[1]]
+ else
+ nil
+ end
+ else
+ fail ArgumentError, "TkTimer object is expected"
+ end
+ else
+ tk_call_without_enc('after', 'info').split(' ').collect!{|id|
+ ret = Tk_CBTBL.find{|key,val| val.after_id == id}
+ (ret == nil)? id: ret[1]
+ }
+ end
+ end
+
+
+ ###############################
+ # instance methods
+ ###############################
+ def do_callback
+ @in_callback = true
+ @after_id = nil
+ begin
+ @return_value = @current_proc.call(self)
+ rescue SystemExit
+ exit(0)
+ rescue Interrupt
+ exit!(1)
+ rescue Exception => e
+ if @cancel_on_exception &&
+ @cancel_on_exception.find{|exc| e.kind_of?(exc)}
+ cancel
+ @return_value = e
+ @in_callback = false
+ return e
+ else
+ fail e
+ end
+ end
+ if @set_next
+ set_next_callback(@current_args)
+ else
+ @set_next = true
+ end
+ @in_callback = false
+ @return_value
+ end
+
+ def set_callback(sleep, args=nil)
+ if TkCore::INTERP.deleted?
+ self.cancel
+ return self
+ end
+ @after_script = "rb_after #{@id}"
+ @current_args = args
+ @current_script = [sleep, @after_script]
+ @after_id = tk_call_without_enc('after', sleep, @after_script)
+ self
+ end
+
+ def set_next_callback(args)
+ if @running == false || @proc_max == 0 || @do_loop == 0
+ Tk_CBTBL.delete(@id) ;# for GC
+ @running = false
+ # @wait_var.value = 0
+ __at_end__
+ return
+ end
+ if @current_pos >= @proc_max
+ if @do_loop < 0 || (@do_loop -= 1) > 0
+ @current_pos = 0
+ else
+ Tk_CBTBL.delete(@id) ;# for GC
+ @running = false
+ # @wait_var.value = 0
+ __at_end__
+ return
+ end
+ end
+
+ @current_args = args
+
+ # if @sleep_time.kind_of?(Proc)
+ if TkComm._callback_entry?(@sleep_time)
+ sleep = @sleep_time.call(self)
+ else
+ sleep = @sleep_time
+ end
+ @current_sleep = sleep
+
+ cmd, *cmd_args = @loop_proc[@current_pos]
+ @current_pos += 1
+ @current_proc = cmd
+
+ set_callback(sleep, cmd_args)
+ end
+
+ def initialize(*args, &b)
+ Tk_CBID.mutex.synchronize{
+ # @id = Tk_CBID.join('')
+ @id = Tk_CBID.join(TkCore::INTERP._ip_id_)
+ Tk_CBID[1].succ!
+ }
+
+ @wait_var = TkVariable.new(0)
+
+ @at_end_proc = nil
+
+ @cb_cmd = TkCore::INTERP.get_cb_entry(self.method(:do_callback))
+
+ @set_next = true
+
+ @init_sleep = 0
+ @init_proc = nil
+ @init_args = []
+
+ @current_script = []
+ @current_proc = nil
+ @current_args = nil
+ @return_value = nil
+
+ @sleep_time = 0
+ @current_sleep = 0
+ @loop_exec = 0
+ @do_loop = 0
+ @loop_proc = []
+ @proc_max = 0
+ @current_pos = 0
+
+ @after_id = nil
+ @after_script = nil
+
+ @cancel_on_exception = DEFAULT_IGNORE_EXCEPTIONS
+ # Unless @cancel_on_exception, Ruby/Tk shows an error dialog box when
+ # an excepsion is raised on TkTimer callback procedure.
+ # If @cancel_on_exception is an array of exception classes and the raised
+ # exception is included in the array, Ruby/Tk cancels executing TkTimer
+ # callback procedures silently (TkTimer#cancel is called and no dialog is
+ # shown).
+
+ if b
+ case args.size
+ when 0
+ add_procs(b)
+ when 1
+ args << -1 << b
+ else
+ args << b
+ end
+ end
+
+ set_procs(*args) if args != []
+
+ @running = false
+ @in_callback = false
+ end
+
+ attr :after_id
+ attr :after_script
+ attr :current_proc
+ attr :current_args
+ attr :current_sleep
+ alias :current_interval :current_sleep
+ attr :return_value
+
+ attr_accessor :loop_exec
+
+ def __at_end__
+ @at_end_proc.call(self) if @at_end_proc
+ @wait_var.value = 0 # for wait
+ end
+ private :__at_end__
+
+ def cb_call
+ @cb_cmd.call
+ end
+
+ def get_procs
+ [@init_sleep, @init_proc, @init_args, @sleep_time, @loop_exec, @loop_proc]
+ end
+
+ def current_status
+ [@running, @current_sleep, @current_proc, @current_args,
+ @do_loop, @cancel_on_exception]
+ end
+
+ def cancel_on_exception?
+ @cancel_on_exception
+ end
+
+ def cancel_on_exception=(mode)
+ if mode.kind_of?(Array)
+ @cancel_on_exception = mode
+ elsif mode
+ @cancel_on_exception = DEFAULT_IGNORE_EXCEPTIONS
+ else
+ @cancel_on_exception = false
+ end
+ #self
+ end
+
+ def running?
+ @running
+ end
+
+ def loop_rest
+ @do_loop
+ end
+
+ def loop_rest=(rest)
+ @do_loop = rest
+ #self
+ end
+
+ def set_interval(interval)
+ #if interval != 'idle' && interval != :idle \
+ # && !interval.kind_of?(Integer) && !interval.kind_of?(Proc)
+ if interval != 'idle' && interval != :idle \
+ && !interval.kind_of?(Integer) && !TkComm._callback_entry?(interval)
+ fail ArgumentError, "expect Integer or Proc"
+ end
+ @sleep_time = interval
+ end
+
+ def set_procs(interval, loop_exec, *procs)
+ #if interval != 'idle' && interval != :idle \
+ # && !interval.kind_of?(Integer) && !interval.kind_of?(Proc)
+ if interval != 'idle' && interval != :idle \
+ && !interval.kind_of?(Integer) && !TkComm._callback_entry?(interval)
+ fail ArgumentError, "expect Integer or Proc for 1st argument"
+ end
+ @sleep_time = interval
+
+ @loop_proc = []
+ procs.each{|e|
+ # if e.kind_of?(Proc)
+ if TkComm._callback_entry?(e)
+ @loop_proc.push([e])
+ else
+ @loop_proc.push(e)
+ end
+ }
+ @proc_max = @loop_proc.size
+ @current_pos = 0
+
+ if loop_exec.kind_of?(Integer) && loop_exec < 0
+ @loop_exec = -1
+ elsif loop_exec == true
+ @loop_exec = -1
+ elsif loop_exec == nil || loop_exec == false || loop_exec == 0
+ @loop_exec = 0
+ else
+ if not loop_exec.kind_of?(Integer)
+ fail ArgumentError, "expect Integer for 2nd argument"
+ end
+ @loop_exec = loop_exec
+ end
+ @do_loop = @loop_exec
+
+ self
+ end
+
+ def add_procs(*procs)
+ procs.each{|e|
+ # if e.kind_of?(Proc)
+ if TkComm._callback_entry?(e)
+ @loop_proc.push([e])
+ else
+ @loop_proc.push(e)
+ end
+ }
+ @proc_max = @loop_proc.size
+
+ self
+ end
+
+ def delete_procs(*procs)
+ procs.each{|e|
+ # if e.kind_of?(Proc)
+ if TkComm._callback_entry?(e)
+ @loop_proc.delete([e])
+ else
+ @loop_proc.delete(e)
+ end
+ }
+ @proc_max = @loop_proc.size
+
+ cancel if @proc_max == 0
+
+ self
+ end
+
+ def delete_at(n)
+ @loop_proc.delete_at(n)
+ @proc_max = @loop_proc.size
+ cancel if @proc_max == 0
+ self
+ end
+
+ def set_start_proc(sleep=nil, init_proc=nil, *init_args, &b)
+ # set parameters for 'restart'
+ sleep = @init_sleep unless sleep
+
+ if sleep != 'idle' && sleep != :idle && !sleep.kind_of?(Integer)
+ fail ArgumentError, "expect Integer or 'idle' for 1st argument"
+ end
+
+ @init_sleep = sleep
+ @init_proc = init_proc
+ @init_args = init_args
+
+ @init_proc = b if !@init_proc && b
+ @init_proc = proc{|*args| } if @init_sleep > 0 && !@init_proc
+
+ self
+ end
+
+ def start(*init_args, &b)
+ return nil if @running
+
+ Tk_CBTBL[@id] = self
+ @do_loop = @loop_exec
+ @current_pos = 0
+ @return_value = nil
+ @after_id = nil
+
+ @init_sleep = 0
+ @init_proc = nil
+ @init_args = nil
+
+ argc = init_args.size
+ if argc > 0
+ sleep = init_args.shift
+ if sleep != 'idle' && sleep != :idle && !sleep.kind_of?(Integer)
+ fail ArgumentError, "expect Integer or 'idle' for 1st argument"
+ end
+ @init_sleep = sleep
+ end
+ @init_proc = init_args.shift if argc > 1
+ @init_args = init_args if argc > 2
+
+ @init_proc = b if !@init_proc && b
+ @init_proc = proc{|*args| } if @init_sleep > 0 && !@init_proc
+
+ @current_sleep = @init_sleep
+ @running = true
+ if @init_proc
+ # if not @init_proc.kind_of?(Proc)
+ if !TkComm._callback_entry?(@init_proc)
+ fail ArgumentError, "Argument '#{@init_proc}' need to be Proc"
+ end
+ @current_proc = @init_proc
+ set_callback(@init_sleep, @init_args)
+ @set_next = false if @in_callback
+ else
+ set_next_callback(@init_args)
+ end
+
+ self
+ end
+
+ def reset(*reset_args)
+ restart() if @running
+
+ if @init_proc
+ @return_value = @init_proc.call(self)
+ else
+ @return_value = nil
+ end
+
+ @current_pos = 0
+ @current_args = @init_args
+ @current_script = []
+
+ @set_next = false if @in_callback
+
+ self
+ end
+
+ def restart(*restart_args, &b)
+ cancel if @running
+ if restart_args.empty? && !b
+ start(@init_sleep, @init_proc, *@init_args)
+ else
+ start(*restart_args, &b)
+ end
+ end
+
+ def cancel
+ @running = false
+ # @wait_var.value = 0
+ __at_end__
+ tk_call 'after', 'cancel', @after_id if @after_id
+ @after_id = nil
+
+ Tk_CBTBL.delete(@id) ;# for GC
+ self
+ end
+ alias stop cancel
+
+ def continue(wait=nil)
+ fail RuntimeError, "is already running" if @running
+ return restart() if @current_script.empty?
+ sleep, cmd = @current_script
+ fail RuntimeError, "no procedure to continue" unless cmd
+ if wait
+ unless wait.kind_of?(Integer)
+ fail ArgumentError, "expect Integer for 1st argument"
+ end
+ sleep = wait
+ end
+ Tk_CBTBL[@id] = self
+ @running = true
+ @after_id = tk_call_without_enc('after', sleep, cmd)
+ self
+ end
+
+ def skip
+ fail RuntimeError, "is not running now" unless @running
+ cancel
+ Tk_CBTBL[@id] = self
+ @running = true
+ set_next_callback(@current_args)
+ self
+ end
+
+ def info
+ if @after_id
+ inf = tk_split_list(tk_call_without_enc('after', 'info', @after_id))
+ [Tk_CBTBL[inf[0][1]], inf[1]]
+ else
+ nil
+ end
+ end
+
+ def at_end(*arg, &b)
+ if arg.empty?
+ if b
+ @at_end_proc = b
+ else
+ # no proc
+ return @at_end_proc
+ end
+ else
+ fail ArgumentError, "wrong number of arguments" if arg.length != 1 || b
+ @at_end_proc = arg[0]
+ end
+ self
+ 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
+ else
+ return @return_value
+ end
+ end
+
+ @wait_var.wait(on_thread, check_root)
+ if @return_value.kind_of?(Exception)
+ fail @return_value
+ else
+ @return_value
+ end
+ end
+ def eventloop_wait(check_root = false)
+ wait(false, check_root)
+ end
+ def thread_wait(check_root = false)
+ wait(true, check_root)
+ end
+ def tkwait(on_thread = true)
+ wait(on_thread, true)
+ end
+ def eventloop_tkwait
+ wait(false, true)
+ end
+ def thread_tkwait
+ wait(true, true)
+ end
+end
+
+TkAfter = TkTimer
+
+
+class TkRTTimer < TkTimer
+ DEFAULT_OFFSET_LIST_SIZE = 5
+
+ def initialize(*args, &b)
+ super(*args, &b)
+
+ @offset_list = Array.new(DEFAULT_OFFSET_LIST_SIZE){ [0, 0] }
+ @offset_s = 0
+ @offset_u = 0
+ @est_time = nil
+ end
+
+ def start(*args, &b)
+ return nil if @running
+ @est_time = nil
+ @cb_start_time = Time.now
+ super(*args, &b)
+ end
+
+ def cancel
+ super()
+ @est_time = nil
+ @cb_start_time = Time.now
+ self
+ end
+ alias stop cancel
+
+ def continue(wait=nil)
+ fail RuntimeError, "is already running" if @running
+ @cb_start_time = Time.now
+ super(wait)
+ end
+
+ def set_interval(interval)
+ super(interval)
+ @est_time = nil
+ end
+
+ def _offset_ave
+ size = 0
+ d_sec = 0; d_usec = 0
+ @offset_list.each_with_index{|offset, idx|
+ # weight = 1
+ weight = idx + 1
+ size += weight
+ d_sec += offset[0] * weight
+ d_usec += offset[1] * weight
+ }
+ offset_s, mod = d_sec.divmod(size)
+ offset_u = ((mod * 1000000 + d_usec) / size.to_f).round
+ [offset_s, offset_u]
+ end
+ private :_offset_ave
+
+ def set_next_callback(args)
+ if @running == false || @proc_max == 0 || @do_loop == 0
+ Tk_CBTBL.delete(@id) ;# for GC
+ @running = false
+ # @wait_var.value = 0
+ __at_end__
+ return
+ end
+ if @current_pos >= @proc_max
+ if @do_loop < 0 || (@do_loop -= 1) > 0
+ @current_pos = 0
+ else
+ Tk_CBTBL.delete(@id) ;# for GC
+ @running = false
+ # @wait_var.value = 0
+ __at_end__
+ return
+ end
+ end
+
+ @current_args = args
+
+ cmd, *cmd_args = @loop_proc[@current_pos]
+ @current_pos += 1
+ @current_proc = cmd
+
+ @offset_s, @offset_u = _offset_ave
+
+ if TkComm._callback_entry?(@sleep_time)
+ sleep = @sleep_time.call(self)
+ else
+ sleep = @sleep_time
+ end
+
+ if @est_time
+ @est_time = Time.at(@est_time.to_i, @est_time.usec + sleep*1000)
+ else
+ @est_time = Time.at(@cb_start_time.to_i,
+ @cb_start_time.usec + sleep*1000)
+ end
+
+ now = Time.now
+ real_sleep = ((@est_time.to_i - now.to_i + @offset_s)*1000.0 +
+ (@est_time.usec - now.usec + @offset_u)/1000.0).round
+ if real_sleep <= 0
+ real_sleep = 0
+ @offset_s = now.to_i
+ @offset_u = now.usec
+ end
+ @current_sleep = real_sleep
+
+ set_callback(real_sleep, cmd_args)
+ end
+
+ def cb_call
+ if @est_time
+ @offset_list.shift
+
+ @cb_start_time = Time.now
+
+ if @current_sleep == 0
+ @offset_list.push([
+ @offset_s - @cb_start_time.to_i,
+ @offset_u - @cb_start_time.usec
+ ])
+ else
+ @offset_list.push([
+ @offset_s + (@est_time.to_i - @cb_start_time.to_i),
+ @offset_u + (@est_time.usec - @cb_start_time.usec)
+ ])
+ end
+ end
+
+ @cb_cmd.call
+ end
+end
diff --git a/ext/tk/lib/tk/toplevel.rb b/ext/tk/lib/tk/toplevel.rb
new file mode 100644
index 0000000000..30ef009517
--- /dev/null
+++ b/ext/tk/lib/tk/toplevel.rb
@@ -0,0 +1,264 @@
+#
+# tk/toplevel.rb : treat toplevel widget
+#
+require 'tk'
+require 'tk/wm'
+require 'tk/menuspec'
+
+class Tk::Toplevel<TkWindow
+ include Wm
+ include TkMenuSpec
+
+ TkCommandNames = ['toplevel'.freeze].freeze
+ WidgetClassName = 'Toplevel'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+################# old version
+# def initialize(parent=nil, screen=nil, classname=nil, keys=nil)
+# if screen.kind_of? Hash
+# keys = screen.dup
+# else
+# @screen = screen
+# end
+# @classname = classname
+# if keys.kind_of? Hash
+# keys = keys.dup
+# @classname = keys.delete('classname') if keys.key?('classname')
+# @colormap = keys.delete('colormap') if keys.key?('colormap')
+# @container = keys.delete('container') if keys.key?('container')
+# @screen = keys.delete('screen') if keys.key?('screen')
+# @use = keys.delete('use') if keys.key?('use')
+# @visual = keys.delete('visual') if keys.key?('visual')
+# end
+# super(parent, keys)
+# end
+#
+# def create_self
+# s = []
+# s << "-class" << @classname if @classname
+# s << "-colormap" << @colormap if @colormap
+# s << "-container" << @container if @container
+# s << "-screen" << @screen if @screen
+# s << "-use" << @use if @use
+# s << "-visual" << @visual if @visual
+# tk_call 'toplevel', @path, *s
+# end
+#################
+
+ def __boolval_optkeys
+ super() << 'container'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'screen'
+ end
+ private :__strval_optkeys
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ super().update('menu'=>proc{|v| window(v)})
+ end
+ private :__val2ruby_optkeys
+
+ def __methodcall_optkeys # { key=>method, ... }
+ TOPLEVEL_METHODCALL_OPTKEYS
+ end
+ private :__methodcall_optkeys
+
+ def _wm_command_option_chk(keys)
+ keys = {} unless keys
+ new_keys = {}
+ wm_cmds = {}
+
+ conf_methods = _symbolkey2str(__methodcall_optkeys())
+
+ keys.each{|k,v| # k is a String
+ if conf_methods.key?(k)
+ wm_cmds[conf_methods[k]] = v
+ elsif Wm.method_defined?(k)
+ case k
+ when 'screen','class','colormap','container','use','visual'
+ new_keys[k] = v
+ else
+ case self.method(k).arity
+ when -1,1
+ wm_cmds[k] = v
+ else
+ new_keys[k] = v
+ end
+ end
+ else
+ new_keys[k] = v
+ end
+ }
+ [new_keys, wm_cmds]
+ end
+ private :_wm_command_option_chk
+
+ def initialize(parent=nil, screen=nil, classname=nil, keys=nil)
+ my_class_name = nil
+ if self.class < WidgetClassNames[WidgetClassName]
+ my_class_name = self.class.name
+ my_class_name = nil if my_class_name == ''
+ end
+ if parent.kind_of? Hash
+ keys = _symbolkey2str(parent)
+ if keys.key?('classname')
+ keys['class'] = keys.delete('classname')
+ end
+ @classname = keys['class']
+ @colormap = keys['colormap']
+ @container = keys['container']
+ @screen = keys['screen']
+ @use = keys['use']
+ @visual = keys['visual']
+ if !@classname && my_class_name
+ keys['class'] = @classname = my_class_name
+ end
+ if @classname.kind_of? TkBindTag
+ @db_class = @classname
+ keys['class'] = @classname = @classname.id
+ elsif @classname
+ @db_class = TkDatabaseClass.new(@classname)
+ keys['class'] = @classname
+ else
+ @db_class = self.class
+ @classname = @db_class::WidgetClassName
+ end
+ keys, cmds = _wm_command_option_chk(keys)
+ super(keys)
+ cmds.each{|k,v|
+ if v.kind_of? Array
+ self.__send__(k,*v)
+ else
+ self.__send__(k,v)
+ end
+ }
+ return
+ end
+
+ if screen.kind_of? Hash
+ keys = screen
+ else
+ @screen = screen
+ if classname.kind_of? Hash
+ keys = classname
+ else
+ @classname = classname
+ end
+ end
+ if keys.kind_of? Hash
+ keys = _symbolkey2str(keys)
+ if keys.key?('classname')
+ keys['class'] = keys.delete('classname')
+ end
+ @classname = keys['class'] unless @classname
+ @colormap = keys['colormap']
+ @container = keys['container']
+ @screen = keys['screen'] unless @screen
+ @use = keys['use']
+ @visual = keys['visual']
+ else
+ keys = {}
+ end
+ if !@classname && my_class_name
+ keys['class'] = @classname = my_class_name
+ end
+ if @classname.kind_of? TkBindTag
+ @db_class = @classname
+ keys['class'] = @classname = @classname.id
+ elsif @classname
+ @db_class = TkDatabaseClass.new(@classname)
+ keys['class'] = @classname
+ else
+ @db_class = self.class
+ @classname = @db_class::WidgetClassName
+ end
+ keys, cmds = _wm_command_option_chk(keys)
+ super(parent, keys)
+ cmds.each{|k,v|
+ if v.kind_of? Array
+ self.send(k,*v)
+ else
+ self.send(k,v)
+ end
+ }
+ end
+
+ #def create_self(keys)
+ # if keys and keys != None
+ # tk_call_without_enc('toplevel', @path, *hash_kv(keys, true))
+ # else
+ # tk_call_without_enc('toplevel', @path)
+ # end
+ #end
+ #private :create_self
+
+ def specific_class
+ @classname
+ end
+
+ def add_menu(menu_info, tearoff=false, opts=nil)
+ # See tk/menuspec.rb for menu_info.
+ # opts is a hash of default configs for all of cascade menus.
+ # Configs of menu_info can override it.
+ if tearoff.kind_of?(Hash)
+ opts = tearoff
+ tearoff = false
+ end
+ _create_menubutton(self, menu_info, tearoff, opts)
+ end
+
+ def add_menubar(menu_spec, tearoff=false, opts=nil)
+ # See tk/menuspec.rb for menu_spec.
+ # opts is a hash of default configs for all of cascade menus.
+ # Configs of menu_spec can override it.
+ menu_spec.each{|info| add_menu(info, tearoff, opts)}
+ self.menu
+ end
+
+ def self.database_class
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ self
+ else
+ TkDatabaseClass.new(self.name)
+ end
+ end
+ def self.database_classname
+ self.database_class.name
+ end
+
+ def self.bind(*args, &b)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args, &b)
+ else
+ TkDatabaseClass.new(self.name).bind(*args, &b)
+ end
+ end
+ def self.bind_append(*args, &b)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args, &b)
+ else
+ TkDatabaseClass.new(self.name).bind_append(*args, &b)
+ end
+ end
+ def self.bind_remove(*args)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args)
+ else
+ TkDatabaseClass.new(self.name).bind_remove(*args)
+ end
+ end
+ def self.bindinfo(*args)
+ if self == WidgetClassNames[WidgetClassName] || self.name == ''
+ super(*args)
+ else
+ TkDatabaseClass.new(self.name).bindinfo(*args)
+ end
+ end
+end
+
+#TkToplevel = Tk::Toplevel unless Object.const_defined? :TkToplevel
+#Tk.__set_toplevel_aliases__(:Tk, Tk::Toplevel, :TkToplevel)
+Tk.__set_loaded_toplevel_aliases__('tk/toplevel.rb', :Tk, Tk::Toplevel,
+ :TkToplevel)
diff --git a/ext/tk/lib/tk/ttk_selector.rb b/ext/tk/lib/tk/ttk_selector.rb
new file mode 100644
index 0000000000..cc9e9928cb
--- /dev/null
+++ b/ext/tk/lib/tk/ttk_selector.rb
@@ -0,0 +1,98 @@
+#
+# ttk_selector
+#
+######################################
+# toplevel classes/modules
+module Tk
+ @TOPLEVEL_ALIAS_TABLE[:Ttk] = {
+ :TkButton => 'tkextlib/tile/tbutton',
+
+ :TkCheckbutton => 'tkextlib/tile/tcheckbutton',
+ :TkCheckButton => 'tkextlib/tile/tcheckbutton',
+
+ # :TkDialog => 'tkextlib/tile/dialog',
+
+ :TkEntry => 'tkextlib/tile/tentry',
+
+ :TkCombobox => 'tkextlib/tile/tcombobox',
+
+ :TkFrame => 'tkextlib/tile/tframe',
+
+ :TkLabel => 'tkextlib/tile/tlabel',
+
+ :TkLabelframe => 'tkextlib/tile/tlabelframe',
+ :TkLabelFrame => 'tkextlib/tile/tlabelframe',
+
+ :TkMenubutton => 'tkextlib/tile/tmenubutton',
+ :TkMenuButton => 'tkextlib/tile/tmenubutton',
+
+ :TkNotebook => 'tkextlib/tile/tnotebook',
+
+ # :TkPaned => 'tkextlib/tile/tpaned',
+ :TkPanedwindow => 'tkextlib/tile/tpaned',
+ :TkPanedWindow => 'tkextlib/tile/tpaned',
+
+ :TkProgressbar => 'tkextlib/tile/tprogressbar',
+
+ :TkRadiobutton => 'tkextlib/tile/tradiobutton',
+ :TkRadioButton => 'tkextlib/tile/tradiobutton',
+
+ :TkScale => 'tkextlib/tile/tscale',
+ # :TkProgress => 'tkextlib/tile/tscale',
+
+ :TkScrollbar => 'tkextlib/tile/tscrollbar',
+ :TkXScrollbar => 'tkextlib/tile/tscrollbar',
+ :TkYScrollbar => 'tkextlib/tile/tscrollbar',
+
+ :TkSeparator => 'tkextlib/tile/tseparator',
+
+ :TkSizeGrip => 'tkextlib/tile/sizegrip',
+ :TkSizegrip => 'tkextlib/tile/sizegrip',
+
+ # :TkSquare => 'tkextlib/tile/tsquare',
+
+ :TkTreeview => 'tkextlib/tile/treeview',
+ }
+
+ # @TOPLEVEL_ALIAS_TABLE[:Tile] = @TOPLEVEL_ALIAS_TABLE[:Ttk]
+ Tk.__create_widget_set__(:Tile, :Ttk)
+
+ ############################################
+ # depend on the version of Tcl/Tk
+ major, minor, type, patchlevel = TclTkLib.get_version
+
+ # ttk::spinbox is supported on Tcl/Tk8.6b1 or later
+ if ([major,minor,type,patchlevel] <=>
+ [8,6,TclTkLib::RELEASE_TYPE::BETA,1]) >= 0
+ @TOPLEVEL_ALIAS_TABLE[:Ttk].update(
+ :TkSpinbox => 'tkextlib/tile/tspinbox'
+ )
+ end
+
+ ################################################
+ # register some Ttk widgets as default
+ # (Ttk is a standard library on Tcl/Tk8.5+)
+ @TOPLEVEL_ALIAS_TABLE[:Ttk].each{|sym, file|
+ #unless Tk::TOPLEVEL_ALIASES.autoload?(sym) || Tk::TOPLEVEL_ALIASES.const_defined?(sym)
+ # @TOPLEVEL_ALIAS_OWNER[sym] = :Ttk
+ # Tk::TOPLEVEL_ALIASES.autoload(sym, file)
+ #end
+ Tk.__regist_toplevel_aliases__(:Ttk, file, sym)
+ }
+
+ ################################################
+
+ # @TOPLEVEL_ALIAS_SETUP_PROC[:Tile] =
+ # @TOPLEVEL_ALIAS_SETUP_PROC[:Ttk] = proc{|mod|
+ # unless Tk.autoload?(:Tile) || Tk.const_defined?(:Tile)
+ # Object.autoload :Ttk, 'tkextlib/tile'
+ # Tk.autoload :Tile, 'tkextlib/tile'
+ # end
+ # }
+ Tk.__toplevel_alias_setup_proc__(:Ttk, :Tile){|mod|
+ unless Tk.autoload?(:Tile) || Tk.const_defined?(:Tile)
+ Object.autoload :Ttk, 'tkextlib/tile'
+ Tk.autoload :Tile, 'tkextlib/tile'
+ end
+ }
+end
diff --git a/ext/tk/lib/tk/txtwin_abst.rb b/ext/tk/lib/tk/txtwin_abst.rb
new file mode 100644
index 0000000000..540f806d17
--- /dev/null
+++ b/ext/tk/lib/tk/txtwin_abst.rb
@@ -0,0 +1,39 @@
+#
+# tk/txtwin_abst.rb : TkTextWin abstruct class
+#
+require 'tk'
+
+class TkTextWin<TkWindow
+ TkCommandNames = [].freeze
+ #def create_self
+ # fail RuntimeError, "TkTextWin is an abstract class"
+ #end
+ #private :create_self
+
+ def bbox(index)
+ list(tk_send_without_enc('bbox', index))
+ end
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+ def get(*index)
+ _fromUTF8(tk_send_without_enc('get', *index))
+ end
+ def insert(index, *args)
+ tk_send('insert', index, *args)
+ self
+ end
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+ def see(index)
+ tk_send_without_enc('see', index)
+ self
+ end
+end
diff --git a/ext/tk/lib/tk/validation.rb b/ext/tk/lib/tk/validation.rb
new file mode 100644
index 0000000000..0ebd5c51b7
--- /dev/null
+++ b/ext/tk/lib/tk/validation.rb
@@ -0,0 +1,397 @@
+#
+# tk/validation.rb - validation support module for entry, spinbox, and so on
+#
+require 'tk'
+
+module Tk
+ module ValidateConfigure
+ def self.__def_validcmd(scope, klass, keys=nil)
+ keys = klass._config_keys unless keys
+ keys.each{|key|
+ eval("def #{key}(*args, &b)
+ __validcmd_call(#{klass.name}, '#{key}', *args, &b)
+ end", scope)
+ }
+ end
+
+ def __validcmd_call(klass, key, *args, &b)
+ return cget(key) if args.empty? && !b
+
+ cmd = (b)? proc(&b) : args.shift
+
+ if cmd.kind_of?(klass)
+ configure(key, cmd)
+ elsif !args.empty?
+ configure(key, [cmd, args])
+ else
+ configure(key, cmd)
+ end
+ end
+
+ def __validation_class_list
+ # maybe need to override
+ []
+ end
+
+ def __get_validate_key2class
+ k2c = {}
+ __validation_class_list.each{|klass|
+ klass._config_keys.each{|key|
+ k2c[key.to_s] = klass
+ }
+ }
+ k2c
+ end
+
+ def __conv_vcmd_on_hash_kv(keys)
+ key2class = __get_validate_key2class
+
+ keys = _symbolkey2str(keys)
+ key2class.each{|key, klass|
+ if keys[key].kind_of?(Array)
+ cmd, *args = keys[key]
+ #keys[key] = klass.new(cmd, args.join(' '))
+ keys[key] = klass.new(cmd, *args)
+ # elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method)
+ elsif TkComm._callback_entry?(keys[key])
+ keys[key] = klass.new(keys[key])
+ end
+ }
+ keys
+ end
+
+ def create_self(keys)
+ super(__conv_vcmd_on_hash_kv(keys))
+ end
+ private :create_self
+
+ def configure(slot, value=TkComm::None)
+ if slot.kind_of?(Hash)
+ super(__conv_vcmd_on_hash_kv(slot))
+ else
+ super(__conv_vcmd_on_hash_kv(slot=>value))
+ end
+ self
+ end
+=begin
+ def configure(slot, value=TkComm::None)
+ key2class = __get_validate_key2class
+
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ key2class.each{|key, klass|
+ if slot[key].kind_of?(Array)
+ cmd, *args = slot[key]
+ slot[key] = klass.new(cmd, args.join(' '))
+ elsif slot[key].kind_of?(Proc) || slot[key].kind_of?(Method)
+ slot[key] = klass.new(slot[key])
+ end
+ }
+ super(slot)
+
+ else
+ slot = slot.to_s
+ if (klass = key2class[slot])
+ if value.kind_of?(Array)
+ cmd, *args = value
+ value = klass.new(cmd, args.join(' '))
+ elsif value.kind_of?(Proc) || value.kind_of?(Method)
+ value = klass.new(value)
+ end
+ end
+ super(slot, value)
+ end
+
+ self
+ end
+=end
+ end
+
+ module ItemValidateConfigure
+ def self.__def_validcmd(scope, klass, keys=nil)
+ keys = klass._config_keys unless keys
+ keys.each{|key|
+ eval("def item_#{key}(id, *args, &b)
+ __item_validcmd_call(#{klass.name}, '#{key}', id, *args, &b)
+ end", scope)
+ }
+ end
+
+ def __item_validcmd_call(tagOrId, klass, key, *args, &b)
+ return itemcget(tagid(tagOrId), key) if args.empty? && !b
+
+ cmd = (b)? proc(&b) : args.shift
+
+ if cmd.kind_of?(klass)
+ itemconfigure(tagid(tagOrId), key, cmd)
+ elsif !args.empty?
+ itemconfigure(tagid(tagOrId), key, [cmd, args])
+ else
+ itemconfigure(tagid(tagOrId), key, cmd)
+ end
+ end
+
+ def __item_validation_class_list(id)
+ # maybe need to override
+ []
+ end
+
+ def __get_item_validate_key2class(id)
+ k2c = {}
+ __item_validation_class_list(id).each{|klass|
+ klass._config_keys.each{|key|
+ k2c[key.to_s] = klass
+ }
+ }
+ end
+
+ def __conv_item_vcmd_on_hash_kv(keys)
+ key2class = __get_item_validate_key2class(tagid(tagOrId))
+
+ keys = _symbolkey2str(keys)
+ key2class.each{|key, klass|
+ if keys[key].kind_of?(Array)
+ cmd, *args = keys[key]
+ #keys[key] = klass.new(cmd, args.join(' '))
+ keys[key] = klass.new(cmd, *args)
+ # elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method)
+ elsif TkComm._callback_entry?(keys[key])
+ keys[key] = klass.new(keys[key])
+ end
+ }
+ keys
+ end
+
+ def itemconfigure(tagOrId, slot, value=TkComm::None)
+ if slot.kind_of?(Hash)
+ super(__conv_item_vcmd_on_hash_kv(slot))
+ else
+ super(__conv_item_vcmd_on_hash_kv(slot=>value))
+ end
+ self
+ end
+=begin
+ def itemconfigure(tagOrId, slot, value=TkComm::None)
+ key2class = __get_item_validate_key2class(tagid(tagOrId))
+
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ key2class.each{|key, klass|
+ if slot[key].kind_of?(Array)
+ cmd, *args = slot[key]
+ slot[key] = klass.new(cmd, args.join(' '))
+ elsif slot[key].kind_of?(Proc) || slot[key].kind_of?(Method)
+ slot[key] = klass.new(slot[key])
+ end
+ }
+ super(slot)
+
+ else
+ slot = slot.to_s
+ if (klass = key2class[slot])
+ if value.kind_of?(Array)
+ cmd, *args = value
+ value = klass.new(cmd, args.join(' '))
+ elsif value.kind_of?(Proc) || value.kind_of?(Method)
+ value = klass.new(value)
+ end
+ end
+ super(slot, value)
+ end
+
+ self
+ end
+=end
+ end
+end
+
+class TkValidateCommand
+ include TkComm
+ extend TkComm
+
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?d, ?n, :action ],
+ [ ?i, ?x, :index ],
+ [ ?s, ?e, :current ],
+ [ ?v, ?s, :type ],
+ [ ?P, ?e, :value ],
+ [ ?S, ?e, :string ],
+ [ ?V, ?s, :triggered ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+
+ [ ?e, proc{|val|
+ #enc = Tk.encoding
+ enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
+ if enc
+ Tk.fromUTF8(TkComm::string(val), enc)
+ else
+ TkComm::string(val)
+ end
+ }
+ ],
+
+ [ ?x, proc{|val|
+ idx = TkComm::number(val)
+ if idx < 0
+ nil
+ else
+ idx
+ end
+ }
+ ],
+
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ #
+ # NOTE: The order of parameters which passed to callback procedure is
+ # <extra_arg>, <extra_arg>, ... , <subst_arg>, <subst_arg>, ...
+ #
+
+ #def self._get_extra_args_tbl
+ # # return an array of convert procs
+ # []
+ #end
+
+ def self.ret_val(val)
+ (val)? '1': '0'
+ end
+ end
+
+ ###############################################
+
+ def self._config_keys
+ # array of config-option key (string or symbol)
+ ['vcmd', 'validatecommand', 'invcmd', 'invalidcommand']
+ end
+
+ def _initialize_for_cb_class(klass, cmd = Proc.new, *args)
+ extra_args_tbl = klass._get_extra_args_tbl
+
+ if args.compact.size > 0
+ args.map!{|arg| klass._sym2subst(arg)}
+ args = args.join(' ')
+ keys = klass._get_subst_key(args)
+ if cmd.kind_of?(String)
+ id = cmd
+ elsif cmd.kind_of?(TkCallbackEntry)
+ @id = install_cmd(cmd)
+ else
+ @id = install_cmd(proc{|*arg|
+ ex_args = []
+ extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
+ klass.ret_val(cmd.call(
+ *(ex_args.concat(klass.scan_args(keys, arg)))
+ ))
+ }) + ' ' + args
+ end
+ else
+ keys, args = klass._get_all_subst_keys
+ if cmd.kind_of?(String)
+ id = cmd
+ elsif cmd.kind_of?(TkCallbackEntry)
+ @id = install_cmd(cmd)
+ else
+ @id = install_cmd(proc{|*arg|
+ ex_args = []
+ extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
+ klass.ret_val(cmd.call(
+ *(ex_args << klass.new(*klass.scan_args(keys, arg)))
+ ))
+ }) + ' ' + args
+ end
+ end
+ end
+
+ def initialize(cmd = Proc.new, *args)
+ _initialize_for_cb_class(self.class::ValidateArgs, cmd, *args)
+ end
+
+ def to_eval
+ @id
+ end
+end
+
+module TkValidation
+ include Tk::ValidateConfigure
+
+ class ValidateCmd < TkValidateCommand
+ module Action
+ Insert = 1
+ Delete = 0
+ Others = -1
+ Focus = -1
+ Forced = -1
+ Textvariable = -1
+ TextVariable = -1
+ end
+ end
+
+ #####################################
+
+ def __validation_class_list
+ super() << ValidateCmd
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, ValidateCmd)
+
+=begin
+ def validatecommand(cmd = Proc.new, args = nil)
+ if cmd.kind_of?(ValidateCmd)
+ configure('validatecommand', cmd)
+ elsif args
+ configure('validatecommand', [cmd, args])
+ else
+ configure('validatecommand', cmd)
+ end
+ end
+=end
+# def validatecommand(*args, &b)
+# __validcmd_call(ValidateCmd, 'validatecommand', *args, &b)
+# end
+# alias vcmd validatecommand
+
+=begin
+ def invalidcommand(cmd = Proc.new, args = nil)
+ if cmd.kind_of?(ValidateCmd)
+ configure('invalidcommand', cmd)
+ elsif args
+ configure('invalidcommand', [cmd, args])
+ else
+ configure('invalidcommand', cmd)
+ end
+ end
+=end
+# def invalidcommand(*args, &b)
+# __validcmd_call(ValidateCmd, 'invalidcommand', *args, &b)
+# end
+# alias invcmd invalidcommand
+end
diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb
new file mode 100644
index 0000000000..0487b034bd
--- /dev/null
+++ b/ext/tk/lib/tk/variable.rb
@@ -0,0 +1,1799 @@
+#
+# tk/variable.rb : treat Tk variable object
+#
+require 'tk'
+
+class TkVariable
+ include Tk
+ extend TkCore
+
+ include Comparable
+
+ #TkCommandNames = ['tkwait'.freeze].freeze
+ TkCommandNames = ['vwait'.freeze].freeze
+
+ #TkVar_CB_TBL = {}
+ #TkVar_ID_TBL = {}
+ TkVar_CB_TBL = TkCore::INTERP.create_table
+ TkVar_ID_TBL = TkCore::INTERP.create_table
+ (Tk_VARIABLE_ID = ["v".freeze, TkUtil.untrust("00000")]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+ TkCore::INTERP.init_ip_env{
+ TkVar_CB_TBL.mutex.synchronize{ TkVar_CB_TBL.clear }
+ TkVar_ID_TBL.mutex.synchronize{ TkVar_ID_TBL.clear }
+ }
+
+ major, minor, type, patchlevel = TclTkLib.get_version
+ USE_OLD_TRACE_OPTION_STYLE = (major < 8) || (major == 8 && minor < 4)
+
+ #TkCore::INTERP.add_tk_procs('rb_var', 'args',
+ # "ruby [format \"TkVariable.callback %%Q!%s!\" $args]")
+ TkCore::INTERP.add_tk_procs('rb_var', 'args', <<-'EOL')
+ if {[set st [catch {eval {ruby_cmd TkVariable callback} $args} ret]] != 0} {
+ set idx [string first "\n\n" $ret]
+ if {$idx > 0} {
+ global errorInfo
+ set tcl_backtrace $errorInfo
+ set errorInfo [string range $ret [expr $idx + 2] \
+ [string length $ret]]
+ append errorInfo "\n" $tcl_backtrace
+ bgerror [string range $ret 0 [expr $idx - 1]]
+ } else {
+ bgerror $ret
+ }
+ return ""
+ #return -code $st $ret
+ } else {
+ return $ret
+ }
+ EOL
+
+ #def TkVariable.callback(args)
+ def TkVariable.callback(id, name1, name2, op)
+ #name1,name2,op = tk_split_list(args)
+ #name1,name2,op = tk_split_simplelist(args)
+ if cb_obj = TkVar_CB_TBL[id]
+ #_get_eval_string(TkVar_CB_TBL[name1].trace_callback(name2,op))
+ begin
+ _get_eval_string(cb_obj.trace_callback(name2, op))
+ rescue SystemExit
+ exit(0)
+ rescue Interrupt
+ exit!(1)
+ rescue Exception => e
+ begin
+ msg = _toUTF8(e.class.inspect) + ': ' +
+ _toUTF8(e.message) + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ _toUTF8(e.backtrace.join("\n")) +
+ "\n---< backtrace of Tk side >-------"
+ if TkCore::WITH_ENCODING
+ msg.force_encoding('utf-8')
+ else
+ msg.instance_variable_set(:@encoding, 'utf-8')
+ end
+ rescue Exception
+ msg = e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------"
+ end
+ fail(e, msg)
+ end
+=begin
+ begin
+ raise 'check backtrace'
+ rescue
+ # ignore backtrace before 'callback'
+ pos = -($!.backtrace.size)
+ end
+ begin
+ _get_eval_string(TkVar_CB_TBL[name1].trace_callback(name2,op))
+ rescue
+ trace = $!.backtrace
+ raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
+ "\tfrom #{trace[1..pos].join("\n\tfrom ")}"
+ end
+=end
+ else
+ ''
+ end
+ end
+
+ def self.new_hash(val = {})
+ if val.kind_of?(Hash)
+ self.new(val)
+ else
+ fail ArgumentError, 'Hash is expected'
+ end
+ end
+
+ #
+ # default_value is available only when the variable is an assoc array.
+ #
+ def default_value(val=nil, &b)
+ if b
+ @def_default = :proc
+ @default_val = proc(&b)
+ else
+ @def_default = :val
+ @default_val = val
+ end
+ self
+ end
+ def set_default_value(val)
+ @def_default = :val
+ @default_val = val
+ self
+ end
+ alias default_value= set_default_value
+ def default_proc(cmd = Proc.new)
+ @def_default = :proc
+ @default_val = cmd
+ self
+ end
+
+ def undef_default
+ @default_val = nil
+ @def_default = false
+ self
+ end
+
+ def default_value_type
+ @type
+ end
+ def default_element_value_type(idxs)
+ if idxs.kind_of?(Array)
+ index = idxs.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ else
+ index = _get_eval_string(idxs, true)
+ end
+ @element_type[index]
+ end
+
+ def _set_default_value_type_core(type, idxs)
+ if type.kind_of?(Class)
+ if type == NilClass
+ type = nil
+ elsif type == Numeric
+ type = :numeric
+ elsif type == TrueClass || type == FalseClass
+ type = :bool
+ elsif type == String
+ type = :string
+ elsif type == Symbol
+ type = :symbol
+ elsif type == Array
+ type = :list
+ elsif type <= TkVariable
+ type = :variable
+ elsif type <= TkWindow
+ type = :window
+ elsif TkComm._callback_entry_class?(type)
+ type = :procedure
+ else
+ type = nil
+ end
+ else
+ case(type)
+ when nil
+ type = nil
+ when :numeric, 'numeric'
+ type = :numeric
+ when true, false, :bool, 'bool'
+ type = :bool
+ when :string, 'string'
+ type = :string
+ when :symbol, 'symbol'
+ type = :symbol
+ when :list, 'list'
+ type = :list
+ when :numlist, 'numlist'
+ type = :numlist
+ when :variable, 'variable'
+ type = :variable
+ when :window, 'window'
+ type = :window
+ when :procedure, 'procedure'
+ type = :procedure
+ else
+ return _set_default_value_type_core(type.class, idxs)
+ end
+ end
+ if idxs
+ if idxs.kind_of?(Array)
+ index = idxs.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ else
+ index = _get_eval_string(idxs, true)
+ end
+ @element_type[index] = type
+ else
+ @type = type
+ end
+ type
+ end
+ private :_set_default_value_type_core
+
+ def set_default_value_type(type)
+ _set_default_value_type_core(type, nil)
+ self
+ end
+ alias default_value_type= set_default_value_type
+
+ def set_default_element_value_type(idxs, type)
+ _set_default_value_type_core(type, idxs)
+ self
+ end
+
+ def _to_default_type(val, idxs = nil)
+ if idxs
+ if idxs.kind_of?(Array)
+ index = idxs.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ else
+ index = _get_eval_string(idxs, true)
+ end
+ type = @element_type[index]
+ else
+ type = @type
+ end
+ return val unless type
+ if val.kind_of?(Hash)
+ val.keys.each{|k| val[k] = _to_default_type(val[k], idxs) }
+ val
+ else
+ begin
+ case(type)
+ when :numeric
+ number(val)
+ when :bool
+ TkComm.bool(val)
+ when :string
+ val
+ when :symbol
+ val.intern
+ when :list
+ tk_split_simplelist(val)
+ when :numlist
+ tk_split_simplelist(val).collect!{|v| number(v)}
+ when :variable
+ TkVarAccess.new(val)
+ when :window
+ TkComm.window(val)
+ when :procedure
+ TkComm.procedure(val)
+ else
+ val
+ end
+ rescue
+ val
+ end
+ end
+ end
+ private :_to_default_type
+
+ def _to_default_element_type(idxs, val)
+ _to_default_type(val, idxs)
+ end
+ private :_to_default_element_type
+
+ def initialize(val="", type=nil)
+ # @id = Tk_VARIABLE_ID.join('')
+ begin
+ Tk_VARIABLE_ID.mutex.synchronize{
+ @id = Tk_VARIABLE_ID.join(TkCore::INTERP._ip_id_)
+ Tk_VARIABLE_ID[1].succ!
+ }
+ end until INTERP._invoke_without_enc('info', 'globals', @id).empty?
+
+ TkVar_ID_TBL.mutex.synchronize{
+ TkVar_ID_TBL[@id] = self
+ }
+
+ @var = @id
+ @elem = nil
+
+ @def_default = false
+ @default_val = nil
+
+ @trace_var = nil
+ @trace_elem = nil
+ @trace_opts = nil
+
+ @type = nil
+ var = self
+ @element_type = Hash.new{|k,v| var.default_value_type }
+
+ self.default_value_type = type
+
+ # teach Tk-ip that @id is global var
+ INTERP._invoke_without_enc('global', @id)
+ #INTERP._invoke('global', @id)
+
+ # create and init
+ if val.kind_of?(Hash)
+ # assoc-array variable
+ self[''] = 0
+ self.clear
+ end
+ self.value = val
+
+=begin
+ if val == []
+ # INTERP._eval(format('global %s; set %s(0) 0; unset %s(0)',
+ # @id, @id, @id))
+ elsif val.kind_of?(Array)
+ a = []
+ # val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e))}
+ # s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ val.each_with_index{|e,i| a.push(i); a.push(e)}
+ #s = '"' + array2tk_list(a).gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + array2tk_list(a).gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(format('global %s; array set %s %s', @id, @id, s))
+ elsif val.kind_of?(Hash)
+ #s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\
+ # .gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\
+ .gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(format('global %s; array set %s %s', @id, @id, s))
+ else
+ #s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + _get_eval_string(val).gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(format('global %s; set %s %s', @id, @id, s))
+ end
+=end
+=begin
+ if val.kind_of?(Hash)
+ #s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\
+ # .gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\
+ .gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; array set %s %s', @id, @id, s))
+ else
+ #s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + _get_eval_string(val).gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; set %s %s', @id, @id, s))
+ end
+=end
+ 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
+ INTERP._thread_tkwait('variable', @id)
+ else
+ INTERP._thread_vwait(@id)
+ end
+ else
+ if check_root
+ INTERP._invoke_without_enc('tkwait', 'variable', @id)
+ else
+ INTERP._invoke_without_enc('vwait', @id)
+ end
+ end
+ end
+ def eventloop_wait(check_root = false)
+ wait(false, check_root)
+ end
+ def thread_wait(check_root = false)
+ wait(true, check_root)
+ end
+ def tkwait(on_thread = true)
+ wait(on_thread, true)
+ end
+ def eventloop_tkwait
+ wait(false, true)
+ end
+ def thread_tkwait
+ wait(true, true)
+ end
+
+ def id
+ @id
+ end
+
+ def ref(*idxs)
+ # "#{@id}(#{idxs.collect{|idx| _get_eval_string(idx)}.join(',')})"
+ TkVarAccess.new("#{@id}(#{idxs.collect{|idx| _get_eval_string(idx)}.join(',')})")
+ end
+
+ def is_hash?
+ #ITNERP._eval("global #{@id}; array exist #{@id}") == '1'
+ INTERP._invoke_without_enc('global', @id)
+ # INTERP._invoke_without_enc('array', 'exist', @id) == '1'
+ TkComm.bool(INTERP._invoke_without_enc('array', 'exist', @id))
+ end
+
+ def is_scalar?
+ ! is_hash?
+ end
+
+ def exist?(*elems)
+ INTERP._invoke_without_enc('global', @id)
+ if elems.empty?
+ TkComm.bool(tk_call('info', 'exist', @id))
+ else
+ # array
+ index = elems.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ TkComm.bool(tk_call('info', 'exist', "#{@id}")) &&
+ TkComm.bool(tk_call('info', 'exist', "#{@id}(#{index})"))
+ end
+ end
+
+ def keys
+ if (is_scalar?)
+ fail RuntimeError, 'cannot get keys from a scalar variable'
+ end
+ #tk_split_simplelist(INTERP._eval("global #{@id}; array get #{@id}"))
+ INTERP._invoke_without_enc('global', @id)
+ #tk_split_simplelist(INTERP._fromUTF8(INTERP._invoke_without_enc('array', 'names', @id)))
+ tk_split_simplelist(INTERP._invoke_without_enc('array', 'names', @id),
+ false, true)
+ end
+
+ def size
+ INTERP._invoke_without_enc('global', @id)
+ TkComm.number(INTERP._invoke_without_enc('array', 'size', @id))
+ end
+
+ def clear
+ if (is_scalar?)
+ fail RuntimeError, 'cannot clear a scalar variable'
+ end
+ keys.each{|k| unset(k)}
+ self
+ end
+
+ def update(hash)
+ if (is_scalar?)
+ fail RuntimeError, 'cannot update a scalar variable'
+ end
+ hash.each{|k,v| self[k] = v}
+ self
+ end
+
+unless const_defined?(:USE_TCLs_SET_VARIABLE_FUNCTIONS)
+ USE_TCLs_SET_VARIABLE_FUNCTIONS = true
+end
+
+if USE_TCLs_SET_VARIABLE_FUNCTIONS
+ ###########################################################################
+ # use Tcl function version of set tkvariable
+ ###########################################################################
+
+ def _value
+ #if INTERP._eval("global #{@id}; array exist #{@id}") == '1'
+ INTERP._invoke_without_enc('global', @id)
+ # if INTERP._invoke('array', 'exist', @id) == '1'
+ if TkComm.bool(INTERP._invoke('array', 'exist', @id))
+ #Hash[*tk_split_simplelist(INTERP._eval("global #{@id}; array get #{@id}"))]
+ Hash[*tk_split_simplelist(INTERP._invoke('array', 'get', @id))]
+ else
+ _fromUTF8(INTERP._get_global_var(@id))
+ end
+ end
+
+ def value=(val)
+ val = val._value if !@type && @type != :variable && val.kind_of?(TkVariable)
+ if val.kind_of?(Hash)
+ self.clear
+ val.each{|k, v|
+ #INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(k)),
+ # _toUTF8(_get_eval_string(v)))
+ INTERP._set_global_var2(@id, _get_eval_string(k, true),
+ _get_eval_string(v, true))
+ }
+ self.value
+# elsif val.kind_of?(Array)
+=begin
+ INTERP._set_global_var(@id, '')
+ val.each{|v|
+ #INTERP._set_variable(@id, _toUTF8(_get_eval_string(v)),
+ INTERP._set_variable(@id, _get_eval_string(v, true),
+ TclTkLib::VarAccessFlag::GLOBAL_ONLY |
+ TclTkLib::VarAccessFlag::LEAVE_ERR_MSG |
+ TclTkLib::VarAccessFlag::APPEND_VALUE |
+ TclTkLib::VarAccessFlag::LIST_ELEMENT)
+ }
+ self.value
+=end
+# _fromUTF8(INTERP._set_global_var(@id, array2tk_list(val, true)))
+ else
+ #_fromUTF8(INTERP._set_global_var(@id, _toUTF8(_get_eval_string(val))))
+ _fromUTF8(INTERP._set_global_var(@id, _get_eval_string(val, true)))
+ end
+ end
+
+ def _element_value(*idxs)
+ index = idxs.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ begin
+ _fromUTF8(INTERP._get_global_var2(@id, index))
+ rescue => e
+ case @def_default
+ when :proc
+ @default_val.call(self, *idxs)
+ when :val
+ @default_val
+ else
+ fail e
+ end
+ end
+ #_fromUTF8(INTERP._get_global_var2(@id, index))
+ #_fromUTF8(INTERP._get_global_var2(@id, _toUTF8(_get_eval_string(index))))
+ #_fromUTF8(INTERP._get_global_var2(@id, _get_eval_string(index, true)))
+ end
+
+ def []=(*args)
+ val = args.pop
+ type = default_element_value_type(args)
+ val = val._value if !type && type != :variable && val.kind_of?(TkVariable)
+ index = args.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ _fromUTF8(INTERP._set_global_var2(@id, index, _get_eval_string(val, true)))
+ #_fromUTF8(INTERP._set_global_var2(@id, _toUTF8(_get_eval_string(index)),
+ # _toUTF8(_get_eval_string(val))))
+ #_fromUTF8(INTERP._set_global_var2(@id, _get_eval_string(index, true),
+ # _get_eval_string(val, true)))
+ end
+
+ def unset(*elems)
+ if elems.empty?
+ INTERP._unset_global_var(@id)
+ else
+ index = elems.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ INTERP._unset_global_var2(@id, index)
+ end
+ end
+ alias remove unset
+
+else
+ ###########################################################################
+ # use Ruby script version of set tkvariable (traditional methods)
+ ###########################################################################
+
+ def _value
+ begin
+ INTERP._eval(Kernel.format('global %s; set %s', @id, @id))
+ #INTERP._eval(Kernel.format('set %s', @id))
+ #INTERP._invoke_without_enc('set', @id)
+ rescue
+ if INTERP._eval(Kernel.format('global %s; array exists %s',
+ @id, @id)) != "1"
+ #if INTERP._eval(Kernel.format('array exists %s', @id)) != "1"
+ #if INTERP._invoke_without_enc('array', 'exists', @id) != "1"
+ fail
+ else
+ Hash[*tk_split_simplelist(INTERP._eval(Kernel.format('global %s; array get %s', @id, @id)))]
+ #Hash[*tk_split_simplelist(_fromUTF8(INTERP._invoke_without_enc('array', 'get', @id)))]
+ end
+ end
+ end
+
+ def value=(val)
+ val = val._value if !@type && @type != :variable && val.kind_of?(TkVariable)
+ begin
+ #s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + _get_eval_string(val).gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; set %s %s', @id, @id, s))
+ #INTERP._eval(Kernel.format('set %s %s', @id, s))
+ #_fromUTF8(INTERP._invoke_without_enc('set', @id, _toUTF8(s)))
+ rescue
+ if INTERP._eval(Kernel.format('global %s; array exists %s',
+ @id, @id)) != "1"
+ #if INTERP._eval(Kernel.format('array exists %s', @id)) != "1"
+ #if INTERP._invoke_without_enc('array', 'exists', @id) != "1"
+ fail
+ else
+ if val == []
+ INTERP._eval(Kernel.format('global %s; unset %s; set %s(0) 0; unset %s(0)', @id, @id, @id, @id))
+ #INTERP._eval(Kernel.format('unset %s; set %s(0) 0; unset %s(0)',
+ # @id, @id, @id))
+ #INTERP._invoke_without_enc('unset', @id)
+ #INTERP._invoke_without_enc('set', @id+'(0)', 0)
+ #INTERP._invoke_without_enc('unset', @id+'(0)')
+ elsif val.kind_of?(Array)
+ a = []
+ val.each_with_index{|e,i| a.push(i); a.push(array2tk_list(e, true))}
+ #s = '"' + a.join(" ").gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + a.join(" ").gsub(/[\[\]$"\\]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s',
+ @id, @id, @id, s))
+ #INTERP._eval(Kernel.format('unset %s; array set %s %s',
+ # @id, @id, s))
+ #INTERP._invoke_without_enc('unset', @id)
+ #_fromUTF8(INTERP._invoke_without_enc('array','set', @id, _toUTF8(s)))
+ elsif val.kind_of?(Hash)
+ #s = '"' + val.to_a.collect{|e| array2tk_list(e)}.join(" ")\
+ # .gsub(/[\[\]$"]/, '\\\\\&') + '"'
+ s = '"' + val.to_a.collect{|e| array2tk_list(e, true)}.join(" ")\
+ .gsub(/[\[\]$\\"]/, '\\\\\&') + '"'
+ INTERP._eval(Kernel.format('global %s; unset %s; array set %s %s',
+ @id, @id, @id, s))
+ #INTERP._eval(Kernel.format('unset %s; array set %s %s',
+ # @id, @id, s))
+ #INTERP._invoke_without_enc('unset', @id)
+ #_fromUTF8(INTERP._invoke_without_enc('array','set', @id, _toUTF8(s)))
+ else
+ fail
+ end
+ end
+ end
+ end
+
+ def _element_value(*idxs)
+ index = idxs.collect{|idx| _get_eval_string(idx)}.join(',')
+ begin
+ INTERP._eval(Kernel.format('global %s; set %s(%s)', @id, @id, index))
+ rescue => e
+ case @def_default
+ when :proc
+ @default_val.call(self, *idxs)
+ when :val
+ @default_val
+ else
+ fail e
+ end
+ end
+ #INTERP._eval(Kernel.format('global %s; set %s(%s)', @id, @id, index))
+ #INTERP._eval(Kernel.format('global %s; set %s(%s)',
+ # @id, @id, _get_eval_string(index)))
+ #INTERP._eval(Kernel.format('set %s(%s)', @id, _get_eval_string(index)))
+ #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ')')
+ end
+
+ def []=(*args)
+ val = args.pop
+ type = default_element_value_type(args)
+ val = val._value if !type && type != :variable && val.kind_of?(TkVariable)
+ index = args.collect{|idx| _get_eval_string(idx)}.join(',')
+ INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id,
+ index, _get_eval_string(val)))
+ #INTERP._eval(Kernel.format('global %s; set %s(%s) %s', @id, @id,
+ # _get_eval_string(index), _get_eval_string(val)))
+ #INTERP._eval(Kernel.format('set %s(%s) %s', @id,
+ # _get_eval_string(index), _get_eval_string(val)))
+ #INTERP._eval('set ' + @id + '(' + _get_eval_string(index) + ') ' +
+ # _get_eval_string(val))
+ end
+
+ def unset(*elems)
+ if elems.empty?
+ INTERP._eval(Kernel.format('global %s; unset %s', @id, @id))
+ #INTERP._eval(Kernel.format('unset %s', @id))
+ #INTERP._eval('unset ' + @id)
+ else
+ index = elems.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ INTERP._eval(Kernel.format('global %s; unset %s(%s)', @id, @id, index))
+ #INTERP._eval(Kernel.format('global %s; unset %s(%s)',
+ # @id, @id, _get_eval_string(elem)))
+ #INTERP._eval(Kernel.format('unset %s(%s)', @id, tk_tcl2ruby(elem)))
+ #INTERP._eval('unset ' + @id + '(' + _get_eval_string(elem) + ')')
+ end
+ end
+ alias remove unset
+
+end
+
+ protected :_value, :_element_value
+
+ def value
+ _to_default_type(_value)
+ end
+
+ def [](*idxs)
+ _to_default_element_type(idxs, _element_value(*idxs))
+ end
+
+ def set_value(val)
+ self.value = val
+ self
+ end
+
+ def to_hash
+ hash = {}
+ self.keys.each{|k|
+ hash[k] = self[k]
+ }
+ hash
+ end
+
+ def set_element_value(idxs, val)
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+
+ def set_value_type(val)
+ self.default_value_type = val.class
+ self.value = val
+ self
+ end
+
+ alias value_type= set_value_type
+
+ def set_element_value_type(idxs, val)
+ self.set_default_element_value_type(idxs, val.class)
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+
+ def numeric
+ number(_value)
+ end
+ def numeric_element(*idxs)
+ number(_element_value(*idxs))
+ end
+ def set_numeric(val)
+ case val
+ when Numeric
+ self.value=(val)
+ when TkVariable
+ self.value=(val.numeric)
+ else
+ raise ArgumentError, "Numeric is expected"
+ end
+ self
+ end
+ alias numeric= set_numeric
+ def set_numeric_element(idxs, val)
+ case val
+ when Numeric
+ val
+ when TkVariable
+ val = val.numeric
+ else
+ raise ArgumentError, "Numeric is expected"
+ end
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+ def set_numeric_type(val)
+ @type = :numeric
+ self.numeric=(val)
+ self
+ end
+ alias numeric_type= set_numeric_type
+ def set_numeric_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :numeric)
+ self.set_numeric_element(idxs, val)
+ end
+
+ def bool
+ TkComm.bool(_value)
+=begin
+ # see Tcl_GetBoolean man-page
+ case _value.downcase
+ when '0', 'false', 'no', 'off'
+ false
+ else
+ true
+ end
+=end
+ end
+ def bool_element(*idxs)
+ TkComm.bool(_element_value(*idxs))
+ end
+ def set_bool(val)
+ if ! val
+ self.value = '0'
+ else
+ case val.to_s.downcase
+ when 'false', '0', 'no', 'off'
+ self.value = '0'
+ else
+ self.value = '1'
+ end
+ end
+ self
+ end
+ alias bool= set_bool
+ def set_bool_element(idxs, val)
+ if ! val
+ val = '0'
+ else
+ case val.to_s.downcase
+ when 'false', '0', 'no', 'off'
+ val = '0'
+ else
+ val = '1'
+ end
+ end
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+ def set_bool_type(val)
+ @type = :bool
+ self.bool=(val)
+ self
+ end
+ alias bool_type= set_bool_type
+ def set_bool_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :bool)
+ self.set_bool_element(idxs, val)
+ end
+
+ def variable
+ # keeps a Tcl's variable name
+ TkVarAccess.new(self._value)
+ end
+ def variable_element(*idxs)
+ TkVarAccess.new(_element_value(*idxs))
+ end
+ def set_variable(var)
+ var = var.id if var.kind_of?(TkVariable)
+ self.value = var
+ self
+ end
+ alias variable= set_variable
+ def set_variable_element(idxs, var)
+ var = var.id if var.kind_of?(TkVariable)
+ if idxs.kind_of?(Array)
+ self[*idxs]=var
+ else
+ self[idxs]=var
+ end
+ self
+ end
+ def set_variable_type(var)
+ @type = :variable
+ var = var.id if var.kind_of?(TkVariable)
+ self.value = var
+ self
+ end
+ alias variable_type= set_variable_type
+ def set_variable_element_type(idxs, var)
+ self.set_default_element_value_type(idxs, :variable)
+ self.set_variable_element(idxs, var)
+ end
+
+ def window
+ TkComm.window(self._value)
+ end
+ def window_element(*idxs)
+ TkComm.window(_element_value(*idxs))
+ end
+ def set_window(win)
+ win = win._value if win.kind_of?(TkVariable)
+ self.value = win
+ self
+ end
+ alias window= set_window
+ def set_window_element(idxs, win)
+ win = win._value if win.kind_of?(TkVariable)
+ if idxs.kind_of?(Array)
+ self[*idxs]=win
+ else
+ self[idxs]=win
+ end
+ self
+ end
+ def set_window_type(win)
+ @type = :window
+ self.window=(win)
+ self
+ end
+ alias window_type= set_window_type
+ def set_window_element_type(idxs, win)
+ self.set_default_element_value_type(idxs, :window)
+ self.set_window_element(idxs, win)
+ end
+
+ def procedure
+ TkComm.procedure(self._value)
+ end
+ def procedure_element(*idxs)
+ TkComm.procedure(_element_value(*idxs))
+ end
+ def set_procedure(cmd)
+ self.value = cmd
+ self
+ end
+ alias procedure= set_procedure
+ def set_procedure_element(idxs, cmd)
+ cmd = cmd._value if cmd.kind_of?(TkVariable)
+ if idxs.kind_of?(Array)
+ self[*idxs]=cmd
+ else
+ self[idxs]=cmd
+ end
+ self
+ end
+ def set_procedure_type(cmd)
+ @type = :procedure
+ self.procedure=(cmd)
+ self
+ end
+ alias procedure_type= set_procedure_type
+ def set_procedure_element_type(idxs, cmd)
+ self.set_default_element_value_type(idxs, :procedure)
+ self.set_proceure_element(idxs, cmd)
+ end
+
+ def to_proc
+ cmd = self.procedure
+ if cmd.respond_to?(:call)
+ cmd
+ else
+ # cmd is a String
+ cmd.to_sym.to_proc
+ end
+ end
+
+ def to_i
+ number(_value).to_i
+ end
+ alias to_int to_i
+ def element_to_i(*idxs)
+ number(_element_value(*idxs)).to_i
+ end
+
+ def to_f
+ number(_value).to_f
+ end
+ def element_to_f(*idxs)
+ number(_element_value(*idxs)).to_f
+ end
+
+ def to_s
+ #string(value).to_s
+ _value
+ end
+ alias string to_s
+ alias to_str to_s
+ def element_to_s(*idxs)
+ _element_value(*idxs)
+ end
+ def string_element(*idxs)
+ _element_value(*idxs)
+ end
+ def set_string(val)
+ val = val._value if val.kind_of?(TkVariable)
+ self.value=val
+ self
+ end
+ alias string= set_string
+ def set_string_element(idxs, val)
+ val = val._value if val.kind_of?(TkVariable)
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+ def set_string_type(val)
+ @type = :string
+ self.string=(val)
+ self
+ end
+ alias string_type= set_string_type
+ def set_string_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :string)
+ self.set_string_element(idxs, val)
+ end
+
+ def to_sym
+ _value.intern
+ end
+ alias symbol to_sym
+ def element_to_sym(*idxs)
+ _element_value(*idxs).intern
+ end
+ alias symbol_element element_to_sym
+ def set_symbol(val)
+ val = val._value if val.kind_of?(TkVariable)
+ self.value=val
+ self
+ end
+ alias symbol= set_symbol
+ def set_symbol_element(idxs, val)
+ val = val._value if val.kind_of?(TkVariable)
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+ def set_symbol_type(val)
+ @type = :symbol
+ self.value=(val)
+ self
+ end
+ alias symbol_type= set_symbol_type
+ def set_symbol_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :symbol)
+ self.set_symbol_element(idxs, val)
+ end
+
+ def list
+ #tk_split_list(value)
+ tk_split_simplelist(_value)
+ end
+ alias to_a list
+ alias to_ary list
+ def list_element(*idxs)
+ tk_split_simplelist(_element_value(*idxs))
+ end
+ alias element_to_a list_element
+
+ def numlist
+ list.collect!{|val| number(val)}
+ end
+ def numlist_element(*idxs)
+ list_element(*idxs).collect!{|val| number(val)}
+ end
+
+ def set_list(val)
+ case val
+ when Array
+ self.value=(val)
+ when TkVariable
+ self.value=(val.list)
+ else
+ raise ArgumentError, "Array is expected"
+ end
+ self
+ end
+ alias list= set_list
+
+ alias set_numlist set_list
+ alias numlist= set_numlist
+
+ def set_list_element(idxs, val)
+ case val
+ when Array
+ val
+ when TkVariable
+ val = val.list
+ else
+ raise ArgumentError, "Array is expected"
+ end
+ if idxs.kind_of?(Array)
+ self[*idxs]=val
+ else
+ self[idxs]=val
+ end
+ self
+ end
+ alias set_numlist_element set_list_element
+
+ def set_list_type(val)
+ @type = :list
+ self.list=(val)
+ self
+ end
+ alias list_type= set_list_type
+ def set_list_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :list)
+ self.set_list_element(idxs, val)
+ end
+ def set_numlist_type(val)
+ @type = :numlist
+ self.numlist=(val)
+ self
+ end
+ alias numlist_type= set_numlist_type
+ def set_numlist_element_type(idxs, val)
+ self.set_default_element_value_type(idxs, :numlist)
+ self.set_numlist_element(idxs, val)
+ end
+
+ def lappend(*elems)
+ tk_call('lappend', @id, *elems)
+ self
+ end
+ def element_lappend(idxs, *elems)
+ if idxs.kind_of?(Array)
+ idxs = idxs.collect{|idx| _get_eval_string(idx, true)}.join(',')
+ end
+ tk_call('lappend', "#{@id}(#{idxs})", *elems)
+ self
+ end
+
+ def lindex(idx)
+ tk_call('lindex', self._value, idx)
+ end
+ alias lget lindex
+ def element_lindex(elem_idxs, idx)
+ if elem_idxs.kind_of?(Array)
+ val = _element_value(*elem_idxs)
+ else
+ val = _element_value(elem_idxs)
+ end
+ tk_call('lindex', val, idx)
+ end
+ alias element_lget element_lindex
+
+ def lget_i(idx)
+ number(lget(idx)).to_i
+ end
+ def element_lget_i(elem_idxs, idx)
+ number(element_lget(elem_idxs, idx)).to_i
+ end
+
+ def lget_f(idx)
+ number(lget(idx)).to_f
+ end
+ def element_lget_f(elem_idxs, idx)
+ number(element_lget(elem_idxs, idx)).to_f
+ end
+
+ def lset(idx, val)
+ tk_call('lset', @id, idx, val)
+ self
+ end
+ def element_lset(elem_idxs, idx, val)
+ if elem_idxs.kind_of?(Array)
+ idxs = elem_idxs.collect{|i| _get_eval_string(i, true)}.join(',')
+ end
+ tk_call('lset', "#{@id}(#{idxs})", idx, val)
+ self
+ end
+
+ def inspect
+ #Kernel.format "#<TkVariable: %s>", @id
+ '#<TkVariable: ' + @id + '>'
+ end
+
+ def coerce(other)
+ case other
+ when TkVariable
+ [other._value, self._value]
+ when String
+ [other, self.to_s]
+ when Symbol
+ [other, self.to_sym]
+ when Numeric
+ [other, self.numeric]
+ when Array
+ [other, self.to_a]
+ else
+ [other, self._value]
+ end
+ end
+
+ def +@
+ self.numeric
+ end
+ def -@
+ -(self.numeric)
+ end
+
+ def &(other)
+ if other.kind_of?(Array)
+ self.to_a & other.to_a
+ else
+ self.to_i & other.to_i
+ end
+ end
+ def |(other)
+ if other.kind_of?(Array)
+ self.to_a | other.to_a
+ else
+ self.to_i | other.to_i
+ end
+ end
+ def +(other)
+ case other
+ when Array
+ self.to_a + other
+ when String
+ self._value + other
+ else
+ begin
+ number(self._value) + other
+ rescue
+ self._value + other.to_s
+ end
+ end
+ end
+ def -(other)
+ if other.kind_of?(Array)
+ self.to_a - other
+ else
+ number(self._value) - other
+ end
+ end
+ def *(other)
+ num_or_str(self._value) * other
+ #begin
+ # number(self._value) * other
+ #rescue
+ # self._value * other
+ #end
+ end
+ def /(other)
+ number(self._value) / other
+ end
+ def %(other)
+ num_or_str(self._value) % other
+ #begin
+ # number(self._value) % other
+ #rescue
+ # self._value % other
+ #end
+ end
+ def **(other)
+ number(self._value) ** other
+ end
+ def =~(other)
+ self._value =~ other
+ end
+
+ def ==(other)
+ case other
+ when TkVariable
+ #self.equal?(other)
+ self._value == other._value
+ when String
+ self.to_s == other
+ when Symbol
+ self.to_sym == other
+ when Integer
+ self.to_i == other
+ when Float
+ self.to_f == other
+ when Array
+ self.to_a == other
+ when Hash
+ # false if self is not an assoc array
+ self._value == other
+ else
+ # false
+ self._value == _get_eval_string(other)
+ end
+ end
+
+ def ===(other)
+ if other.kind_of?(TkVariable)
+ self.id == other.id
+ else
+ super
+ end
+ end
+
+ def zero?
+ numeric.zero?
+ end
+ def nonzero?
+ !(numeric.zero?)
+ end
+
+ def <=>(other)
+ if other.kind_of?(TkVariable)
+ begin
+ val = other.numeric
+ other = val
+ rescue
+ other = other._value
+ end
+ elsif other.kind_of?(Numeric)
+ begin
+ return self.numeric <=> other
+ rescue
+ return self._value <=> other.to_s
+ end
+ elsif other.kind_of?(Array)
+ return self.list <=> other
+ else
+ return self._value <=> other
+ end
+ end
+
+ def to_eval
+ @id
+ end
+
+ def trace_callback(elem, op)
+ if @trace_var.kind_of? Array
+ @trace_var.each{|m,e| e.call(self,elem,op) if m.index(op)}
+ end
+ if elem.kind_of?(String) && elem != ''
+ if @trace_elem.kind_of?(Hash) && @trace_elem[elem].kind_of?(Array)
+ @trace_elem[elem].each{|m,e| e.call(self,elem,op) if m.index(op)}
+ end
+ end
+ end
+
+ def _check_trace_opt(opts)
+ if opts.kind_of?(Array)
+ opt_str = opts.map{|s| s.to_s}.join(' ')
+ else
+ opt_str = opts.to_s
+ end
+
+ fail ArgumentError, 'null trace option' if opt_str.empty?
+
+ if opt_str =~ /[^arwu\s]/
+ # new format (Tcl/Tk8.4+?)
+ if opts.kind_of?(Array)
+ opt_ary = opts.map{|opt| opt.to_s.strip}
+ else
+ opt_ary = opt_str.split(/\s+|\|/)
+ opt_ary.delete('')
+ end
+ if USE_OLD_TRACE_OPTION_STYLE
+ opt_ary.uniq.map{|opt|
+ case opt
+ when 'array'
+ 'a'
+ when 'read'
+ 'r'
+ when 'write'
+ 'w'
+ when 'unset'
+ 'u'
+ else
+ fail ArgumentError, "unsupported trace option '#{opt}' on Tcl/Tk#{Tk::TCL_PATCHLEVEL}"
+ end
+ }.join
+ else
+ opt_ary
+ end
+ else
+ # old format
+ opt_ary = opt_str.delete('^arwu').split(//).uniq
+ if USE_OLD_TRACE_OPTION_STYLE
+ opt_ary.join
+ else
+ opt_ary.map{|c|
+ case c
+ when 'a'
+ 'array'
+ when 'r'
+ 'read'
+ when 'w'
+ 'write'
+ when 'u'
+ 'unset'
+ end
+ }
+ end
+ end
+ end
+ private :_check_trace_opt
+
+ def trace(opts, cmd = Proc.new)
+ opts = _check_trace_opt(opts)
+ (@trace_var ||= []).unshift([opts,cmd])
+
+ if @trace_opts == nil
+ TkVar_CB_TBL[@id] = self
+ @trace_opts = opts.dup
+ if USE_OLD_TRACE_OPTION_STYLE
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ else
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ else
+ newopts = @trace_opts.dup
+ if USE_OLD_TRACE_OPTION_STYLE
+ opts.each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ if newopts != @trace_opts
+ Tk.tk_call_without_enc('trace', 'vdelete',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ else
+ newopts |= opts
+ unless (newopts - @trace_opts).empty?
+ Tk.tk_call_without_enc('trace', 'remove', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ end
+
+ self
+ end
+
+ def trace_element(elem, opts, cmd = Proc.new)
+ if @elem
+ fail(RuntimeError,
+ "invalid for a TkVariable which denotes an element of Tcl's array")
+ end
+
+ opts = _check_trace_opt(opts)
+
+ ((@trace_elem ||= {})[elem] ||= []).unshift([opts,cmd])
+
+ if @trace_opts == nil
+ TkVar_CB_TBL[@id] = self
+ @trace_opts = opts.dup
+ if USE_OLD_TRACE_OPTION_STYLE
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ else
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ else
+ newopts = @trace_opts.dup
+ if USE_OLD_TRACE_OPTION_STYLE
+ opts.each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ if newopts != @trace_opts
+ Tk.tk_call_without_enc('trace', 'vdelete',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ else
+ newopts |= opts
+ unless (newopts - @trace_opts).empty?
+ Tk.tk_call_without_enc('trace', 'remove', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ end
+
+ self
+ end
+
+ def trace_info
+ return [] unless @trace_var
+ @trace_var.dup
+ end
+ alias trace_vinfo trace_info
+
+ def trace_info_for_element(elem)
+ if @elem
+ fail(RuntimeError,
+ "invalid for a TkVariable which denotes an element of Tcl's array")
+ end
+ return [] unless @trace_elem
+ return [] unless @trace_elem[elem]
+ @trace_elem[elem].dup
+ end
+ alias trace_vinfo_for_element trace_info_for_element
+
+ def trace_remove(opts,cmd)
+ return self unless @trace_var.kind_of? Array
+
+ opts = _check_trace_opt(opts)
+
+ idx = -1
+ if USE_OLD_TRACE_OPTION_STYLE
+ newopts = ''
+ @trace_var.each_with_index{|e, i|
+ if idx < 0 && e[1] == cmd
+ diff = false
+ ['a', 'r', 'w', 'u'].each{|c|
+ break if (diff = e[0].index(c) ^ opts.index(c))
+ }
+ unless diff
+ #find
+ idx = i
+ next
+ end
+ end
+ e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ }
+ else
+ newopts = []
+ @trace_var.each_with_index{|e, i|
+ if idx < 0 && e[1] == cmd &&
+ e[0].size == opts.size && (e[0] - opts).empty?
+ # find
+ idx = i
+ next
+ end
+ newopts |= e[0]
+ }
+ end
+
+ if idx >= 0
+ @trace_var.delete_at(idx)
+ else
+ return self
+ end
+
+ (@trace_elem ||= {}).each{|elem|
+ @trace_elem[elem].each{|e|
+ if USE_OLD_TRACE_OPTION_STYLE
+ e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ else
+ newopts |= e[0]
+ end
+ }
+ }
+
+ if USE_OLD_TRACE_OPTION_STYLE
+ diff = false
+ @trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))}
+ if diff
+ Tk.tk_call_without_enc('trace', 'vdelete',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ unless @trace_opts.empty?
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ else
+ unless (@trace_opts - newopts).empty?
+ Tk.tk_call_without_enc('trace', 'remove', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ unless @trace_opts.empty?
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ end
+
+ self
+ end
+ alias trace_delete trace_remove
+ alias trace_vdelete trace_remove
+
+ def trace_remove_for_element(elem,opts,cmd)
+ if @elem
+ fail(RuntimeError,
+ "invalid for a TkVariable which denotes an element of Tcl's array")
+ end
+ return self unless @trace_elem.kind_of? Hash
+ return self unless @trace_elem[elem].kind_of? Array
+
+ opts = _check_trace_opt(opts)
+
+ idx = -1
+ if USE_OLD_TRACE_OPTION_STYLE
+ @trace_elem[elem].each_with_index{|e, i|
+ if idx < 0 && e[1] == cmd
+ diff = false
+ ['a', 'r', 'w', 'u'].each{|c|
+ break if (diff = e[0].index(c) ^ opts.index(c))
+ }
+ unless diff
+ #find
+ idx = i
+ next
+ end
+ end
+ }
+ else
+ @trace_elem[elem].each_with_index{|e, i|
+ if idx < 0 && e[1] == cmd &&
+ e[0].size == opts.size && (e[0] - opts).empty?
+ # find
+ idx = i
+ next
+ end
+ }
+ end
+
+ if idx >= 0
+ @trace_elem[elem].delete_at(idx)
+ else
+ return self
+ end
+
+ if USE_OLD_TRACE_OPTION_STYLE
+ newopts = ''
+ @trace_var.each{|e|
+ e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ }
+ @trace_elem.each{|elem|
+ @trace_elem[elem].each{|e|
+ e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ }
+ }
+ else
+ newopts = []
+ @trace_var.each{|e|
+ newopts |= e[0]
+ }
+ @trace_elem.each{|elem|
+ @trace_elem[elem].each{|e|
+ e[0].each_byte{|c| newopts.concat(c.chr) unless newopts.index(c.chr)}
+ }
+ }
+ end
+
+ if USE_OLD_TRACE_OPTION_STYLE
+ diff = false
+ @trace_opts.each_byte{|c| break if (diff = ! newopts.index(c))}
+ if diff
+ Tk.tk_call_without_enc('trace', 'vdelete',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ unless @trace_opts.empty?
+ Tk.tk_call_without_enc('trace', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ else
+ unless (@trace_opts - newopts).empty?
+ Tk.tk_call_without_enc('trace', 'remove', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ @trace_opts.replace(newopts)
+ unless @trace_opts.empty?
+ Tk.tk_call_without_enc('trace', 'add', 'variable',
+ @id, @trace_opts, 'rb_var ' << @id)
+ end
+ end
+ end
+
+ self
+ end
+ alias trace_delete_for_element trace_remove_for_element
+ alias trace_vdelete_for_element trace_remove_for_element
+end
+
+class TkVarAccess<TkVariable
+ def self.new(name, *args)
+ if name.kind_of?(TkVariable)
+ name.value = args[0] unless args.empty?
+ return name
+ end
+
+ name = name.to_s
+ v = nil
+ TkVar_ID_TBL.mutex.synchronize{
+ if v = TkVar_ID_TBL[name]
+ v.value = args[0] unless args.empty?
+ return v
+ else
+ (v = self.allocate).instance_eval{
+ @id = name
+ TkVar_ID_TBL[@id] = self
+ @var = @id
+ }
+ end
+ }
+
+ v.instance_eval{ initialize(name, *args) }
+ v
+ end
+
+ def self.new_hash(name, *args)
+ if name.kind_of?(TkVariable)
+ unless name.is_hash?
+ fail ArgumentError, "already exist as a scalar variable"
+ end
+ name.value = args[0] unless args.empty?
+ return name
+ end
+
+ name = name.to_s
+ v = nil
+ TkVar_ID_TBL.mutex.synchronize{
+ if v = TkVar_ID_TBL[name]
+ unless v.is_hash?
+ fail ArgumentError, "already exist as a scalar variable"
+ end
+ v.value = args[0] unless args.empty?
+ return v
+ else
+ (v = self.allocate).instance_eval{
+ @id = name
+ TkVar_ID_TBL[@id] = self
+ @var = @id
+ }
+ end
+ }
+
+ INTERP._invoke_without_enc('global', name)
+ if args.empty? && INTERP._invoke_without_enc('array', 'exist', name) == '0'
+ v.instance_eval{ initialize(name, {}) } # force creating
+ else
+ v.instance_eval{ initialize(name, *args) }
+ end
+ v
+ end
+
+ def initialize(varname, val=nil)
+ # @id = varname
+ # TkVar_ID_TBL[@id] = self
+
+ # @var = @id
+ @elem = nil
+
+ @def_default = false
+ @default_val = nil
+
+ @trace_var = nil
+ @trace_elem = nil
+ @trace_opts = nil
+
+ @type = nil
+ var = self
+ @element_type = Hash.new{|k,v| var.default_value_type }
+
+ # is an element?
+ if @id =~ /^([^(]+)\((.+)\)$/
+ # is an element --> var == $1, elem == $2
+ @var = $1
+ @elem = $2
+ end
+
+ # teach Tk-ip that @id is global var
+ INTERP._invoke_without_enc('global', @var)
+=begin
+ begin
+ INTERP._invoke_without_enc('global', @id)
+ rescue => e
+ if @id =~ /^(.+)\([^()]+\)$/
+ # is an element --> varname == $1
+ INTERP._invoke_without_enc('global', $1)
+ else
+ fail e
+ end
+ end
+=end
+
+ if val
+ if val.kind_of?(Hash)
+ # assoc-array variable
+ self[''] = 0
+ self.clear
+ end
+ #s = '"' + _get_eval_string(val).gsub(/[\[\]$"]/, '\\\\\&') + '"' #"
+ #s = '"' + _get_eval_string(val).gsub(/[\[\]$"\\]/, '\\\\\&') + '"' #"
+ #INTERP._eval(Kernel.format('global %s; set %s %s', @id, @id, s))
+ #INTERP._set_global_var(@id, _toUTF8(_get_eval_string(val)))
+ self.value = val
+ end
+ end
+end
+
+module Tk
+ begin
+ INTERP._invoke_without_enc('global', 'auto_path')
+ auto_path = INTERP._invoke('set', 'auto_path')
+ rescue => e
+ begin
+ INTERP._invoke_without_enc('global', 'env')
+ auto_path = INTERP._invoke('set', 'env(TCLLIBPATH)')
+ rescue => e
+ auto_path = Tk::LIBRARY
+ end
+ end
+
+ AUTO_PATH = TkVarAccess.new('auto_path', auto_path)
+
+=begin
+ AUTO_OLDPATH = tk_split_simplelist(INTERP._invoke('set', 'auto_oldpath'))
+ AUTO_OLDPATH.each{|s| s.freeze}
+ AUTO_OLDPATH.freeze
+=end
+
+ TCL_PACKAGE_PATH = TkVarAccess.new('tcl_pkgPath')
+ PACKAGE_PATH = TCL_PACKAGE_PATH
+
+ TCL_LIBRARY_PATH = TkVarAccess.new('tcl_libPath')
+ LIBRARY_PATH = TCL_LIBRARY_PATH
+
+ TCL_PRECISION = TkVarAccess.new('tcl_precision')
+end
diff --git a/ext/tk/lib/tk/virtevent.rb b/ext/tk/lib/tk/virtevent.rb
new file mode 100644
index 0000000000..c11e9692e7
--- /dev/null
+++ b/ext/tk/lib/tk/virtevent.rb
@@ -0,0 +1,139 @@
+#
+# tk/virtevent.rb : treats virtual events
+# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+require 'tk'
+
+class TkVirtualEvent<TkObject
+ extend Tk
+
+ TkCommandNames = ['event'.freeze].freeze
+
+ (TkVirtualEventID = ["VirtEvent".freeze, TkUtil.untrust("00000")]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkVirtualEventTBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ TkVirtualEventTBL.mutex.synchronize{ TkVirtualEventTBL.clear }
+ }
+
+ class PreDefVirtEvent<self
+ def self.new(event, *sequences)
+ if event =~ /^<(<.*>)>$/
+ event = $1
+ elsif event !~ /^<.*>$/
+ event = '<' + event + '>'
+ end
+ TkVirtualEvent::TkVirtualEventTBL.mutex.synchronize{
+ if TkVirtualEvent::TkVirtualEventTBL.has_key?(event)
+ TkVirtualEvent::TkVirtualEventTBL[event]
+ else
+ # super(event, *sequences)
+ (obj = self.allocate).instance_eval{
+ initialize(event, *sequences)
+ TkVirtualEvent::TkVirtualEventTBL[@id] = self
+ }
+ end
+ }
+ end
+
+ def initialize(event, *sequences)
+ @path = @id = event
+ _add_sequences(sequences)
+ end
+ end
+
+ def TkVirtualEvent.getobj(event)
+ obj = nil
+ TkVirtualEventTBL.mutex.synchronize{
+ obj = TkVirtualEventTBL[event]
+ }
+ if obj
+ obj
+ else
+ if tk_call_without_enc('event', 'info').index("<#{event}>")
+ PreDefVirtEvent.new(event)
+ else
+ fail ArgumentError, "undefined virtual event '<#{event}>'"
+ end
+ end
+ end
+
+ def TkVirtualEvent.info
+ tk_call_without_enc('event', 'info').split(/\s+/).collect!{|seq|
+ TkVirtualEvent.getobj(seq[1..-2])
+ }
+ end
+
+ def initialize(*sequences)
+ TkVirtualEventID.mutex.synchronize{
+ # @path = @id = '<' + TkVirtualEventID.join('') + '>'
+ @path = @id = '<' + TkVirtualEventID.join(TkCore::INTERP._ip_id_) + '>'
+ TkVirtualEventID[1].succ!
+ }
+ _add_sequences(sequences)
+ end
+
+ def _add_sequences(seq_ary)
+ unless seq_ary.empty?
+ tk_call_without_enc('event', 'add', "<#{@id}>",
+ *(seq_ary.collect{|seq|
+ "<#{tk_event_sequence(seq)}>"
+ }) )
+ end
+ self
+ end
+ private :_add_sequences
+
+ def add(*sequences)
+ if sequences != []
+ _add_sequences(sequences)
+ TkVirtualEventTBL.mutex.synchronize{
+ TkVirtualEventTBL[@id] = self
+ }
+ end
+ self
+ end
+
+ def delete(*sequences)
+ if sequences.empty?
+ tk_call_without_enc('event', 'delete', "<#{@id}>")
+ TkVirtualEventTBL.mutex.synchronize{
+ TkVirtualEventTBL.delete(@id)
+ }
+ else
+ tk_call_without_enc('event', 'delete', "<#{@id}>",
+ *(sequences.collect{|seq|
+ "<#{tk_event_sequence(seq)}>"
+ }) )
+ if tk_call_without_enc('event','info',"<#{@id}>").empty?
+ TkVirtualEventTBL.mutex.synchronize{
+ TkVirtualEventTBL.delete(@id)
+ }
+ end
+ end
+ self
+ end
+
+ def info
+ tk_call_without_enc('event','info',"<#{@id}>").split(/\s+/).collect!{|seq|
+ lst = seq.scan(/<*[^<>]+>*/).collect!{|subseq|
+ case (subseq)
+ when /^<<[^<>]+>>$/
+ TkVirtualEvent.getobj(subseq[1..-2])
+ when /^<[^<>]+>$/
+ subseq[1..-2]
+ else
+ subseq.split('')
+ end
+ }.flatten
+ (lst.size == 1) ? lst[0] : lst
+ }
+ end
+end
+
+TkNamedVirtualEvent = TkVirtualEvent::PreDefVirtEvent
diff --git a/ext/tk/lib/tk/winfo.rb b/ext/tk/lib/tk/winfo.rb
new file mode 100644
index 0000000000..b10cfe6760
--- /dev/null
+++ b/ext/tk/lib/tk/winfo.rb
@@ -0,0 +1,392 @@
+#
+# tk/winfo.rb : methods for winfo command
+#
+module TkWinfo
+end
+
+require 'tk'
+
+module TkWinfo
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['winfo'.freeze].freeze
+
+ def TkWinfo.atom(name, win=nil)
+ if win
+ number(tk_call_without_enc('winfo', 'atom', '-displayof', win,
+ _get_eval_enc_str(name)))
+ else
+ number(tk_call_without_enc('winfo', 'atom', _get_eval_enc_str(name)))
+ end
+ end
+ def winfo_atom(name)
+ TkWinfo.atom(name, self)
+ end
+
+ def TkWinfo.atomname(id, win=nil)
+ if win
+ _fromUTF8(tk_call_without_enc('winfo', 'atomname',
+ '-displayof', win, id))
+ else
+ _fromUTF8(tk_call_without_enc('winfo', 'atomname', id))
+ end
+ end
+ def winfo_atomname(id)
+ TkWinfo.atomname(id, self)
+ end
+
+ def TkWinfo.cells(win)
+ number(tk_call_without_enc('winfo', 'cells', win))
+ end
+ def winfo_cells
+ TkWinfo.cells self
+ end
+
+ def TkWinfo.children(win)
+ list(tk_call_without_enc('winfo', 'children', win))
+ end
+ def winfo_children
+ TkWinfo.children self
+ end
+
+ def TkWinfo.classname(win)
+ tk_call_without_enc('winfo', 'class', win)
+ end
+ def winfo_classname
+ TkWinfo.classname self
+ end
+ alias winfo_class winfo_classname
+
+ def TkWinfo.colormapfull(win)
+ bool(tk_call_without_enc('winfo', 'colormapfull', win))
+ end
+ def winfo_colormapfull
+ TkWinfo.colormapfull self
+ end
+
+ def TkWinfo.containing(rootX, rootY, win=nil)
+ if win
+ window(tk_call_without_enc('winfo', 'containing',
+ '-displayof', win, rootX, rootY))
+ else
+ window(tk_call_without_enc('winfo', 'containing', rootX, rootY))
+ end
+ end
+ def winfo_containing(x, y)
+ TkWinfo.containing(x, y, self)
+ end
+
+ def TkWinfo.depth(win)
+ number(tk_call_without_enc('winfo', 'depth', win))
+ end
+ def winfo_depth
+ TkWinfo.depth self
+ end
+
+ def TkWinfo.exist?(win)
+ bool(tk_call_without_enc('winfo', 'exists', win))
+ end
+ def winfo_exist?
+ TkWinfo.exist? self
+ end
+
+ def TkWinfo.fpixels(win, dist)
+ number(tk_call_without_enc('winfo', 'fpixels', win, dist))
+ end
+ def winfo_fpixels(dist)
+ TkWinfo.fpixels self, dist
+ end
+
+ def TkWinfo.geometry(win)
+ tk_call_without_enc('winfo', 'geometry', win)
+ end
+ def winfo_geometry
+ TkWinfo.geometry self
+ end
+
+ def TkWinfo.height(win)
+ number(tk_call_without_enc('winfo', 'height', win))
+ end
+ def winfo_height
+ TkWinfo.height self
+ end
+
+ def TkWinfo.id(win)
+ tk_call_without_enc('winfo', 'id', win)
+ end
+ def winfo_id
+ TkWinfo.id self
+ end
+
+ def TkWinfo.interps(win=nil)
+ if win
+ #tk_split_simplelist(tk_call_without_enc('winfo', 'interps',
+ # '-displayof', win))
+ tk_split_simplelist(tk_call_without_enc('winfo', 'interps',
+ '-displayof', win),
+ false, true)
+ else
+ #tk_split_simplelist(tk_call_without_enc('winfo', 'interps'))
+ tk_split_simplelist(tk_call_without_enc('winfo', 'interps'),
+ false, true)
+ end
+ end
+ def winfo_interps
+ TkWinfo.interps self
+ end
+
+ def TkWinfo.mapped?(win)
+ bool(tk_call_without_enc('winfo', 'ismapped', win))
+ end
+ def winfo_mapped?
+ TkWinfo.mapped? self
+ end
+
+ def TkWinfo.manager(win)
+ tk_call_without_enc('winfo', 'manager', win)
+ end
+ def winfo_manager
+ TkWinfo.manager self
+ end
+
+ def TkWinfo.appname(win)
+ tk_call('winfo', 'name', win)
+ end
+ def winfo_appname
+ TkWinfo.appname self
+ end
+
+ def TkWinfo.parent(win)
+ window(tk_call_without_enc('winfo', 'parent', win))
+ end
+ def winfo_parent
+ TkWinfo.parent self
+ end
+
+ def TkWinfo.widget(id, win=nil)
+ if win
+ window(tk_call_without_enc('winfo', 'pathname', '-displayof', win, id))
+ else
+ window(tk_call_without_enc('winfo', 'pathname', id))
+ end
+ end
+ def winfo_widget(id)
+ TkWinfo.widget id, self
+ end
+
+ def TkWinfo.pixels(win, dist)
+ number(tk_call_without_enc('winfo', 'pixels', win, dist))
+ end
+ def winfo_pixels(dist)
+ TkWinfo.pixels self, dist
+ end
+
+ def TkWinfo.reqheight(win)
+ number(tk_call_without_enc('winfo', 'reqheight', win))
+ end
+ def winfo_reqheight
+ TkWinfo.reqheight self
+ end
+
+ def TkWinfo.reqwidth(win)
+ number(tk_call_without_enc('winfo', 'reqwidth', win))
+ end
+ def winfo_reqwidth
+ TkWinfo.reqwidth self
+ end
+
+ def TkWinfo.rgb(win, color)
+ list(tk_call_without_enc('winfo', 'rgb', win, color))
+ end
+ def winfo_rgb(color)
+ TkWinfo.rgb self, color
+ end
+
+ def TkWinfo.rootx(win)
+ number(tk_call_without_enc('winfo', 'rootx', win))
+ end
+ def winfo_rootx
+ TkWinfo.rootx self
+ end
+
+ def TkWinfo.rooty(win)
+ number(tk_call_without_enc('winfo', 'rooty', win))
+ end
+ def winfo_rooty
+ TkWinfo.rooty self
+ end
+
+ def TkWinfo.screen(win)
+ tk_call('winfo', 'screen', win)
+ end
+ def winfo_screen
+ TkWinfo.screen self
+ end
+
+ def TkWinfo.screencells(win)
+ number(tk_call_without_enc('winfo', 'screencells', win))
+ end
+ def winfo_screencells
+ TkWinfo.screencells self
+ end
+
+ def TkWinfo.screendepth(win)
+ number(tk_call_without_enc('winfo', 'screendepth', win))
+ end
+ def winfo_screendepth
+ TkWinfo.screendepth self
+ end
+
+ def TkWinfo.screenheight (win)
+ number(tk_call_without_enc('winfo', 'screenheight', win))
+ end
+ def winfo_screenheight
+ TkWinfo.screenheight self
+ end
+
+ def TkWinfo.screenmmheight(win)
+ number(tk_call_without_enc('winfo', 'screenmmheight', win))
+ end
+ def winfo_screenmmheight
+ TkWinfo.screenmmheight self
+ end
+
+ def TkWinfo.screenmmwidth(win)
+ number(tk_call_without_enc('winfo', 'screenmmwidth', win))
+ end
+ def winfo_screenmmwidth
+ TkWinfo.screenmmwidth self
+ end
+
+ def TkWinfo.screenvisual(win)
+ tk_call_without_enc('winfo', 'screenvisual', win)
+ end
+ def winfo_screenvisual
+ TkWinfo.screenvisual self
+ end
+
+ def TkWinfo.screenwidth(win)
+ number(tk_call_without_enc('winfo', 'screenwidth', win))
+ end
+ def winfo_screenwidth
+ TkWinfo.screenwidth self
+ end
+
+ def TkWinfo.server(win)
+ tk_call('winfo', 'server', win)
+ end
+ def winfo_server
+ TkWinfo.server self
+ end
+
+ def TkWinfo.toplevel(win)
+ window(tk_call_without_enc('winfo', 'toplevel', win))
+ end
+ def winfo_toplevel
+ TkWinfo.toplevel self
+ end
+
+ def TkWinfo.visual(win)
+ tk_call_without_enc('winfo', 'visual', win)
+ end
+ def winfo_visual
+ TkWinfo.visual self
+ end
+
+ def TkWinfo.visualid(win)
+ tk_call_without_enc('winfo', 'visualid', win)
+ end
+ def winfo_visualid
+ TkWinfo.visualid self
+ end
+
+ def TkWinfo.visualsavailable(win, includeids=false)
+ if includeids
+ list(tk_call_without_enc('winfo', 'visualsavailable',
+ win, "includeids"))
+ else
+ list(tk_call_without_enc('winfo', 'visualsavailable', win))
+ end
+ end
+ def winfo_visualsavailable(includeids=false)
+ TkWinfo.visualsavailable self, includeids
+ end
+
+ def TkWinfo.vrootheight(win)
+ number(tk_call_without_enc('winfo', 'vrootheight', win))
+ end
+ def winfo_vrootheight
+ TkWinfo.vrootheight self
+ end
+
+ def TkWinfo.vrootwidth(win)
+ number(tk_call_without_enc('winfo', 'vrootwidth', win))
+ end
+ def winfo_vrootwidth
+ TkWinfo.vrootwidth self
+ end
+
+ def TkWinfo.vrootx(win)
+ number(tk_call_without_enc('winfo', 'vrootx', win))
+ end
+ def winfo_vrootx
+ TkWinfo.vrootx self
+ end
+
+ def TkWinfo.vrooty(win)
+ number(tk_call_without_enc('winfo', 'vrooty', win))
+ end
+ def winfo_vrooty
+ TkWinfo.vrooty self
+ end
+
+ def TkWinfo.width(win)
+ number(tk_call_without_enc('winfo', 'width', win))
+ end
+ def winfo_width
+ TkWinfo.width self
+ end
+
+ def TkWinfo.x(win)
+ number(tk_call_without_enc('winfo', 'x', win))
+ end
+ def winfo_x
+ TkWinfo.x self
+ end
+
+ def TkWinfo.y(win)
+ number(tk_call_without_enc('winfo', 'y', win))
+ end
+ def winfo_y
+ TkWinfo.y self
+ end
+
+ def TkWinfo.viewable(win)
+ bool(tk_call_without_enc('winfo', 'viewable', win))
+ end
+ def winfo_viewable
+ TkWinfo.viewable self
+ end
+
+ def TkWinfo.pointerx(win)
+ number(tk_call_without_enc('winfo', 'pointerx', win))
+ end
+ def winfo_pointerx
+ TkWinfo.pointerx self
+ end
+
+ def TkWinfo.pointery(win)
+ number(tk_call_without_enc('winfo', 'pointery', win))
+ end
+ def winfo_pointery
+ TkWinfo.pointery self
+ end
+
+ def TkWinfo.pointerxy(win)
+ list(tk_call_without_enc('winfo', 'pointerxy', win))
+ end
+ def winfo_pointerxy
+ TkWinfo.pointerxy self
+ end
+end
diff --git a/ext/tk/lib/tk/winpkg.rb b/ext/tk/lib/tk/winpkg.rb
new file mode 100644
index 0000000000..80e0439ace
--- /dev/null
+++ b/ext/tk/lib/tk/winpkg.rb
@@ -0,0 +1,156 @@
+#
+# tk/winpkg.rb : methods for Tcl/Tk packages for Microsoft Windows
+# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
+#
+# ATTENTION !!
+# This is NOT TESTED. Because I have no test-environment.
+#
+require 'tk'
+
+module Tk::WinDDE
+end
+#TkWinDDE = Tk::WinDDE
+#Tk.__set_toplevel_aliases__(:Tk, Tk::WinDDE, :TkWinDDE)
+Tk.__set_loaded_toplevel_aliases__('tk/winpkg.rb', :Tk, Tk::WinDDE, :TkWinDDE)
+
+module Tk::WinDDE
+ extend Tk
+ extend Tk::WinDDE
+
+ TkCommandNames = ['dde'.freeze].freeze
+
+ PACKAGE_NAME = 'dde'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ if self.const_defined? :FORCE_VERSION
+ tk_call_without_enc('package', 'require', 'dde', FORCE_VERSION)
+ else
+ tk_call_without_enc('package', 'require', 'dde')
+ end
+
+ #def servername(topic=None)
+ # tk_call('dde', 'servername', topic)
+ #end
+ def servername(*args)
+ if args.size == 0
+ tk_call('dde', 'servername')
+ else
+ if args[-1].kind_of?(Hash) # dde 1.2 +
+ keys = _symbolkey2str(args.pop)
+ force = (keys.delete('force'))? '-force': None
+ exact = (keys.delete('exact'))? '-exact': None
+ if keys.size == 0
+ tk_call('dde', 'servername', force, exact)
+ elsif args.size == 0
+ tk_call('dde', 'servername', force, exact, *hash_kv(keys))
+ else
+ tk_call('dde', 'servername', force, exact,
+ *((hash_kv(keys) << '--') + args))
+ end
+ else
+ tk_call('dde', 'servername', *args)
+ end
+ end
+ end
+
+ def execute(service, topic, data)
+ tk_call('dde', 'execute', service, topic, data)
+ end
+
+ def async_execute(service, topic, data)
+ tk_call('dde', '-async', 'execute', service, topic, data)
+ end
+
+ def poke(service, topic, item, data)
+ tk_call('dde', 'poke', service, topic, item, data)
+ end
+
+ def request(service, topic, item)
+ tk_call('dde', 'request', service, topic, item)
+ end
+
+ def binary_request(service, topic, item)
+ tk_call('dde', 'request', '-binary', service, topic, item)
+ end
+
+ def services(service, topic)
+ tk_call('dde', 'services', service, topic)
+ end
+
+ def eval(topic, cmd, *args)
+ tk_call('dde', 'eval', topic, cmd, *args)
+ end
+
+ def async_eval(topic, cmd, *args)
+ tk_call('dde', 'eval', -async, topic, cmd, *args)
+ end
+
+ module_function :servername, :execute, :async_execute,
+ :poke, :request, :services, :eval
+end
+
+module Tk::WinRegistry
+end
+#TkWinRegistry = Tk::WinRegistry
+#Tk.__set_toplevel_aliases__(:Tk, Tk::WinRegistry, :TkWinRegistry)
+Tk.__set_loaded_toplevel_aliases__('tk/winpkg.rb', :Tk, Tk::WinRegistry,
+ :TkWinRegistry)
+
+module Tk::WinRegistry
+ extend Tk
+ extend Tk::WinRegistry
+
+ TkCommandNames = ['registry'.freeze].freeze
+
+ if self.const_defined? :FORCE_VERSION
+ tk_call('package', 'require', 'registry', FORCE_VERSION)
+ else
+ tk_call('package', 'require', 'registry')
+ end
+
+ def broadcast(keynam, timeout=nil)
+ if timeout
+ tk_call('registry', 'broadcast', keynam, '-timeout', timeout)
+ else
+ tk_call('registry', 'broadcast', keynam)
+ end
+ end
+
+ def delete(keynam, valnam=None)
+ tk_call('registry', 'delete', keynam, valnam)
+ end
+
+ def get(keynam, valnam)
+ tk_call('registry', 'get', keynam, valnam)
+ end
+
+ def keys(keynam, pattern=nil)
+ lst = tk_split_simplelist(tk_call('registry', 'keys', keynam))
+ if pattern
+ lst.find_all{|key| key =~ pattern}
+ else
+ lst
+ end
+ end
+
+ def set(keynam, valnam=None, data=None, dattype=None)
+ tk_call('registry', 'set', keynam, valnam, data, dattype)
+ end
+
+ def type(keynam, valnam)
+ tk_call('registry', 'type', keynam, valnam)
+ end
+
+ def values(keynam, pattern=nil)
+ lst = tk_split_simplelist(tk_call('registry', 'values', keynam))
+ if pattern
+ lst.find_all{|val| val =~ pattern}
+ else
+ lst
+ end
+ end
+
+ module_function :delete, :get, :keys, :set, :type, :values
+end
diff --git a/ext/tk/lib/tk/wm.rb b/ext/tk/lib/tk/wm.rb
new file mode 100644
index 0000000000..fcd5a2cbd2
--- /dev/null
+++ b/ext/tk/lib/tk/wm.rb
@@ -0,0 +1,552 @@
+#
+# tk/wm.rb : methods for wm command
+#
+require 'tk'
+
+module Tk
+ module Wm
+ #include TkComm
+ extend TkCore
+
+ TkCommandNames = ['wm'.freeze].freeze
+
+ TOPLEVEL_METHODCALL_OPTKEYS = {}
+
+ def Wm.aspect(win, *args)
+ if args.length == 0
+ list(tk_call_without_enc('wm', 'aspect', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call('wm', 'aspect', win.epath, *args)
+ win
+ end
+ end
+ def aspect(*args)
+ Wm.aspect(self, *args)
+ end
+ alias wm_aspect aspect
+ TOPLEVEL_METHODCALL_OPTKEYS['aspect'] = 'aspect'
+
+ def Wm.attributes(win, slot=nil,value=TkComm::None)
+ if slot == nil
+ lst = tk_split_list(tk_call('wm', 'attributes', win.epath))
+ info = {}
+ while key = lst.shift
+ info[key[1..-1]] = lst.shift
+ end
+ info
+ elsif slot.kind_of? Hash
+ tk_call('wm', 'attributes', win.epath, *hash_kv(slot))
+ win
+ elsif value == TkComm::None
+ tk_call('wm', 'attributes', win.epath, "-#{slot}")
+ else
+ tk_call('wm', 'attributes', win.epath, "-#{slot}", value)
+ win
+ end
+ end
+ def attributes(slot=nil,value=TkComm::None)
+ Wm.attributes(self, slot, value)
+ end
+ alias wm_attributes attributes
+ TOPLEVEL_METHODCALL_OPTKEYS['attributes'] = 'attributes'
+
+ def Wm.client(win, name=TkComm::None)
+ if name == TkComm::None
+ tk_call('wm', 'client', win.epath)
+ else
+ name = '' if name == nil
+ tk_call('wm', 'client', win.epath, name)
+ win
+ end
+ end
+ def client(name=TkComm::None)
+ Wm.client(self, name)
+ end
+ alias wm_client client
+ TOPLEVEL_METHODCALL_OPTKEYS['client'] = 'client'
+
+ def Wm.colormapwindows(win, *args)
+ if args.size == 0
+ list(tk_call_without_enc('wm', 'colormapwindows', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'colormapwindows', win.epath, *args)
+ win
+ end
+ end
+ def colormapwindows(*args)
+ Wm.colormapwindows(self, *args)
+ end
+ alias wm_colormapwindows colormapwindows
+ TOPLEVEL_METHODCALL_OPTKEYS['colormapwindows'] = 'colormapwindows'
+
+ def Wm.command(win, value=nil)
+ if value
+ tk_call('wm', 'command', win.epath, value)
+ win
+ else
+ #procedure(tk_call('wm', 'command', win.epath))
+ tk_call('wm', 'command', win.epath)
+ end
+ end
+ def wm_command(value=nil)
+ Wm.command(self, value)
+ end
+ TOPLEVEL_METHODCALL_OPTKEYS['wm_command'] = 'wm_command'
+
+ def Wm.deiconify(win, ex = true)
+ if ex
+ tk_call_without_enc('wm', 'deiconify', win.epath)
+ else
+ Wm.iconify(win)
+ end
+ win
+ end
+ def deiconify(ex = true)
+ Wm.deiconify(self, ex)
+ end
+ alias wm_deiconify deiconify
+
+ def Wm.focusmodel(win, mode = nil)
+ if mode
+ tk_call_without_enc('wm', 'focusmodel', win.epath, mode)
+ win
+ else
+ tk_call_without_enc('wm', 'focusmodel', win.epath)
+ end
+ end
+ def focusmodel(mode = nil)
+ Wm.focusmodel(self, mode)
+ end
+ alias wm_focusmodel focusmodel
+ TOPLEVEL_METHODCALL_OPTKEYS['focusmodel'] = 'focusmodel'
+
+ def Wm.forget(win)
+ # Tcl/Tk 8.5+
+ # work with dockable frames
+ tk_call_without_enc('wm', 'forget', win.epath)
+ win
+ end
+ def wm_forget
+ Wm.forget(self)
+ end
+
+ def Wm.frame(win)
+ tk_call_without_enc('wm', 'frame', win.epath)
+ end
+ def frame
+ Wm.frame(self)
+ end
+ alias wm_frame frame
+
+ def Wm.geometry(win, geom=nil)
+ if geom
+ tk_call_without_enc('wm', 'geometry', win.epath, geom)
+ win
+ else
+ tk_call_without_enc('wm', 'geometry', win.epath)
+ end
+ end
+ def geometry(geom=nil)
+ Wm.geometry(self, geom)
+ end
+ alias wm_geometry geometry
+ TOPLEVEL_METHODCALL_OPTKEYS['geometry'] = 'geometry'
+
+ def Wm.grid(win, *args)
+ if args.size == 0
+ list(tk_call_without_enc('wm', 'grid', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'grid', win.epath, *args)
+ win
+ end
+ end
+ def wm_grid(*args)
+ Wm.grid(self, *args)
+ end
+ TOPLEVEL_METHODCALL_OPTKEYS['wm_grid'] = 'wm_grid'
+
+ def Wm.group(win, leader = nil)
+ if leader
+ tk_call('wm', 'group', win.epath, leader)
+ win
+ else
+ window(tk_call('wm', 'group', win.epath))
+ end
+ end
+ def group(leader = nil)
+ Wm.group(self, leader)
+ end
+ alias wm_group group
+ TOPLEVEL_METHODCALL_OPTKEYS['group'] = 'group'
+
+ def Wm.iconbitmap(win, bmp=nil)
+ if bmp
+ tk_call_without_enc('wm', 'iconbitmap', win.epath, bmp)
+ win
+ else
+ image_obj(tk_call_without_enc('wm', 'iconbitmap', win.epath))
+ end
+ end
+ def iconbitmap(bmp=nil)
+ Wm.iconbitmap(self, bmp)
+ end
+ alias wm_iconbitmap iconbitmap
+ TOPLEVEL_METHODCALL_OPTKEYS['iconbitmap'] = 'iconbitmap'
+
+ def Wm.iconphoto(win, *imgs)
+ if imgs.empty?
+ win.instance_eval{
+ @wm_iconphoto = nil unless defined? @wm_iconphoto
+ return @wm_iconphoto
+ }
+ end
+
+ imgs = imgs[0] if imgs.length == 1 && imgs[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'iconphoto', win.epath, *imgs)
+ win.instance_eval{ @wm_iconphoto = imgs }
+ win
+ end
+ def iconphoto(*imgs)
+ Wm.iconphoto(self, *imgs)
+ end
+ alias wm_iconphoto iconphoto
+ TOPLEVEL_METHODCALL_OPTKEYS['iconphoto'] = 'iconphoto'
+
+ def Wm.iconphoto_default(win, *imgs)
+ imgs = imgs[0] if imgs.length == 1 && imgs[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'iconphoto', win.epath, '-default', *imgs)
+ win
+ end
+ def iconphoto_default(*imgs)
+ Wm.iconphoto_default(self, *imgs)
+ end
+ alias wm_iconphoto_default iconphoto_default
+
+ def Wm.iconify(win, ex = true)
+ if ex
+ tk_call_without_enc('wm', 'iconify', win.epath)
+ else
+ Wm.deiconify(win)
+ end
+ win
+ end
+ def iconify(ex = true)
+ Wm.iconify(self, ex)
+ end
+ alias wm_iconify iconify
+
+ def Wm.iconmask(win, bmp=nil)
+ if bmp
+ tk_call_without_enc('wm', 'iconmask', win.epath, bmp)
+ win
+ else
+ image_obj(tk_call_without_enc('wm', 'iconmask', win.epath))
+ end
+ end
+ def iconmask(bmp=nil)
+ Wm.iconmask(self, bmp)
+ end
+ alias wm_iconmask iconmask
+ TOPLEVEL_METHODCALL_OPTKEYS['iconmask'] = 'iconmask'
+
+ def Wm.iconname(win, name=nil)
+ if name
+ tk_call('wm', 'iconname', win.epath, name)
+ win
+ else
+ tk_call('wm', 'iconname', win.epath)
+ end
+ end
+ def iconname(name=nil)
+ Wm.iconname(self, name)
+ end
+ alias wm_iconname iconname
+ TOPLEVEL_METHODCALL_OPTKEYS['iconname'] = 'iconname'
+
+ def Wm.iconposition(win, *args)
+ if args.size == 0
+ list(tk_call_without_enc('wm', 'iconposition', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'iconposition', win.epath, *args)
+ win
+ end
+ end
+ def iconposition(*args)
+ Wm.iconposition(self, *args)
+ end
+ alias wm_iconposition iconposition
+ TOPLEVEL_METHODCALL_OPTKEYS['iconposition'] = 'iconposition'
+
+ def Wm.iconwindow(win, iconwin = nil)
+ if iconwin
+ tk_call_without_enc('wm', 'iconwindow', win.epath, iconwin)
+ win
+ else
+ w = tk_call_without_enc('wm', 'iconwindow', win.epath)
+ (w == '')? nil: window(w)
+ end
+ end
+ def iconwindow(iconwin = nil)
+ Wm.iconwindow(self, iconwin)
+ end
+ alias wm_iconwindow iconwindow
+ TOPLEVEL_METHODCALL_OPTKEYS['iconwindow'] = 'iconwindow'
+
+ def Wm.manage(win)
+ # Tcl/Tk 8.5+ feature
+ tk_call_without_enc('wm', 'manage', win.epath)
+ win
+ end
+ def wm_manage
+ Wm.manage(self)
+ end
+=begin
+ def Wm.manage(win, use_id = nil)
+ # Tcl/Tk 8.5+ feature
+ # --------------------------------------------------------------
+ # In the future release, I want to support to embed the 'win'
+ # into the container which has window-id 'use-id'.
+ # It may give users frexibility on controlling their GUI.
+ # However, it may be difficult for current Tcl/Tk (Tcl/Tk8.5.1),
+ # because it seems to require to modify Tcl/Tk's source code.
+ # --------------------------------------------------------------
+ if use_id
+ tk_call_without_enc('wm', 'manage', win.epath, '-use', use_id)
+ else
+ tk_call_without_enc('wm', 'manage', win.epath)
+ end
+ win
+ end
+=end
+
+ def Wm.maxsize(win, *args)
+ if args.size == 0
+ list(tk_call_without_enc('wm', 'maxsize', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'maxsize', win.epath, *args)
+ win
+ end
+ end
+ def maxsize(*args)
+ Wm.maxsize(self, *args)
+ end
+ alias wm_maxsize maxsize
+ TOPLEVEL_METHODCALL_OPTKEYS['maxsize'] = 'maxsize'
+
+ def Wm.minsize(win, *args)
+ if args.size == 0
+ list(tk_call_without_enc('wm', 'minsize', win.epath))
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'minsize', win.path, *args)
+ win
+ end
+ end
+ def minsize(*args)
+ Wm.minsize(self, *args)
+ end
+ alias wm_minsize minsize
+ TOPLEVEL_METHODCALL_OPTKEYS['minsize'] = 'minsize'
+
+ def Wm.overrideredirect(win, mode=TkComm::None)
+ if mode == TkComm::None
+ bool(tk_call_without_enc('wm', 'overrideredirect', win.epath))
+ else
+ tk_call_without_enc('wm', 'overrideredirect', win.epath, mode)
+ win
+ end
+ end
+ def overrideredirect(mode=TkComm::None)
+ Wm.overrideredirect(self, mode)
+ end
+ alias wm_overrideredirect overrideredirect
+ TOPLEVEL_METHODCALL_OPTKEYS['overrideredirect'] = 'overrideredirect'
+
+ def Wm.positionfrom(win, who=TkComm::None)
+ if who == TkComm::None
+ r = tk_call_without_enc('wm', 'positionfrom', win.epath)
+ (r == "")? nil: r
+ else
+ tk_call_without_enc('wm', 'positionfrom', win.epath, who)
+ win
+ end
+ end
+ def positionfrom(who=TkComm::None)
+ Wm.positionfrom(self, who)
+ end
+ alias wm_positionfrom positionfrom
+ TOPLEVEL_METHODCALL_OPTKEYS['positionfrom'] = 'positionfrom'
+
+ def Wm.protocol(win, name=nil, cmd=nil, &b)
+ if cmd
+ tk_call_without_enc('wm', 'protocol', win.epath, name, cmd)
+ win
+ elsif b
+ tk_call_without_enc('wm', 'protocol', win.epath, name, proc(&b))
+ win
+ elsif name
+ result = tk_call_without_enc('wm', 'protocol', win.epath, name)
+ (result == "")? nil : tk_tcl2ruby(result)
+ else
+ tk_split_simplelist(tk_call_without_enc('wm', 'protocol', win.epath))
+ end
+ end
+ def protocol(name=nil, cmd=nil, &b)
+ Wm.protocol(self, name, cmd, &b)
+ end
+ alias wm_protocol protocol
+
+ def Wm.protocols(win, kv=nil)
+ unless kv
+ ret = {}
+ Wm.protocol(win).each{|name|
+ ret[name] = Wm.protocol(win, name)
+ }
+ return ret
+ end
+
+ unless kv.kind_of?(Hash)
+ fail ArgumentError, 'expect a hash of protocol=>command'
+ end
+ kv.each{|k, v| Wm.protocol(win, k, v)}
+ win
+ end
+ def protocols(kv=nil)
+ Wm.protocols(self, kv)
+ end
+ alias wm_protocols protocols
+ TOPLEVEL_METHODCALL_OPTKEYS['protocols'] = 'protocols'
+
+ def Wm.resizable(win, *args)
+ if args.length == 0
+ list(tk_call_without_enc('wm', 'resizable', win.epath)).map!{|e| bool(e)}
+ else
+ args = args[0] if args.length == 1 && args[0].kind_of?(Array)
+ tk_call_without_enc('wm', 'resizable', win.epath, *args)
+ win
+ end
+ end
+ def resizable(*args)
+ Wm.resizable(self, *args)
+ end
+ alias wm_resizable resizable
+ TOPLEVEL_METHODCALL_OPTKEYS['resizable'] = 'resizable'
+
+ def Wm.sizefrom(win, who=TkComm::None)
+ if who == TkComm::None
+ r = tk_call_without_enc('wm', 'sizefrom', win.epath)
+ (r == "")? nil: r
+ else
+ tk_call_without_enc('wm', 'sizefrom', win.epath, who)
+ win
+ end
+ end
+ def sizefrom(who=TkComm::None)
+ Wm.sizefrom(self, who)
+ end
+ alias wm_sizefrom sizefrom
+ TOPLEVEL_METHODCALL_OPTKEYS['sizefrom'] = 'sizefrom'
+
+ def Wm.stackorder(win)
+ list(tk_call('wm', 'stackorder', win.epath))
+ end
+ def stackorder
+ Wm.stackorder(self)
+ end
+ alias wm_stackorder stackorder
+
+ def Wm.stackorder_isabove(win, target)
+ bool(tk_call('wm', 'stackorder', win.epath, 'isabove', target))
+ end
+ def Wm.stackorder_is_above(win, target)
+ Wm.stackorder_isabove(win, target)
+ end
+ def stackorder_isabove(target)
+ Wm.stackorder_isabove(self, target)
+ end
+ alias stackorder_is_above stackorder_isabove
+ alias wm_stackorder_isabove stackorder_isabove
+ alias wm_stackorder_is_above stackorder_isabove
+
+ def Wm.stackorder_isbelow(win, target)
+ bool(tk_call('wm', 'stackorder', win.epath, 'isbelow', target))
+ end
+ def Wm.stackorder_is_below(win, target)
+ Wm.stackorder_isbelow(win, target)
+ end
+ def stackorder_isbelow(target)
+ Wm.stackorder_isbelow(self, target)
+ end
+ alias stackorder_is_below stackorder_isbelow
+ alias wm_stackorder_isbelow stackorder_isbelow
+ alias wm_stackorder_is_below stackorder_isbelow
+
+ def Wm.state(win, st=nil)
+ if st
+ tk_call_without_enc('wm', 'state', win.epath, st)
+ win
+ else
+ tk_call_without_enc('wm', 'state', win.epath)
+ end
+ end
+ def state(st=nil)
+ Wm.state(self, st)
+ end
+ alias wm_state state
+ TOPLEVEL_METHODCALL_OPTKEYS['state'] = 'state'
+
+ def Wm.title(win, str=nil)
+ if str
+ tk_call('wm', 'title', win.epath, str)
+ win
+ else
+ tk_call('wm', 'title', win.epath)
+ end
+ end
+ def title(str=nil)
+ Wm.title(self, str)
+ end
+ alias wm_title title
+ TOPLEVEL_METHODCALL_OPTKEYS['title'] = 'title'
+
+ def Wm.transient(win, master=nil)
+ if master
+ tk_call_without_enc('wm', 'transient', win.epath, master)
+ win
+ else
+ window(tk_call_without_enc('wm', 'transient', win.epath))
+ end
+ end
+ def transient(master=nil)
+ Wm.transient(self, master)
+ end
+ alias wm_transient transient
+ TOPLEVEL_METHODCALL_OPTKEYS['transient'] = 'transient'
+
+ def Wm.withdraw(win, ex = true)
+ if ex
+ tk_call_without_enc('wm', 'withdraw', win.epath)
+ else
+ Wm.deiconify(win)
+ end
+ win
+ end
+ def withdraw(ex = true)
+ Wm.withdraw(self, ex)
+ end
+ alias wm_withdraw withdraw
+ end
+
+ module Wm_for_General
+ Wm.instance_methods.each{|m|
+ if (m = m.to_s) =~ /^wm_(.*)$/
+ eval "def #{m}(*args, &b); Tk::Wm.#{$1}(self, *args, &b); end"
+ end
+ }
+ end
+end
diff --git a/ext/tk/lib/tk/xim.rb b/ext/tk/lib/tk/xim.rb
new file mode 100644
index 0000000000..c0126c5175
--- /dev/null
+++ b/ext/tk/lib/tk/xim.rb
@@ -0,0 +1,122 @@
+#
+# tk/xim.rb : control imput_method
+#
+require 'tk'
+
+module TkXIM
+ include Tk
+ extend Tk
+
+ TkCommandNames = ['imconfigure'.freeze].freeze
+
+ def TkXIM.useinputmethods(value = None, win = nil)
+ if value == None
+ if win
+ bool(tk_call_without_enc('tk', 'useinputmethods',
+ '-displayof', win))
+ else
+ bool(tk_call_without_enc('tk', 'useinputmethods'))
+ end
+ else
+ if win
+ bool(tk_call_without_enc('tk', 'useinputmethods',
+ '-displayof', win, value))
+ else
+ bool(tk_call_without_enc('tk', 'useinputmethods', value))
+ end
+ end
+ end
+
+ def TkXIM.useinputmethods_displayof(win, value = None)
+ TkXIM.useinputmethods(value, win)
+ end
+
+ def TkXIM.caret(win, keys=nil)
+ if keys
+ tk_call_without_enc('tk', 'caret', win, *hash_kv(keys))
+ self
+ else
+ lst = tk_split_list(tk_call_without_enc('tk', 'caret', win))
+ info = {}
+ while key = lst.shift
+ info[key[1..-1]] = lst.shift
+ end
+ info
+ end
+ end
+
+ def TkXIM.configure(win, slot, value=None)
+ begin
+ if /^8\.*/ === Tk::TK_VERSION && JAPANIZED_TK
+ if slot.kind_of? Hash
+ tk_call('imconfigure', win, *hash_kv(slot))
+ else
+ tk_call('imconfigure', win, "-#{slot}", value)
+ end
+ end
+ rescue
+ end
+ end
+
+ def TkXIM.configinfo(win, slot=nil)
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ begin
+ if /^8\.*/ === Tk::TK_VERSION && JAPANIZED_TK
+ if slot
+ conf = tk_split_list(tk_call('imconfigure', win, "-#{slot}"))
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ tk_split_list(tk_call('imconfigure', win)).collect{|conf|
+ conf[0] = conf[0][1..-1]
+ conf
+ }
+ end
+ else
+ []
+ end
+ rescue
+ []
+ end
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ TkXIM.current_configinfo(win, slot)
+ end
+ end
+
+ def TkXIM.current_configinfo(win, slot=nil)
+ begin
+ if /^8\.*/ === Tk::TK_VERSION && JAPANIZED_TK
+ if slot
+ conf = tk_split_list(tk_call('imconfigure', win, "-#{slot}"))
+ { conf[0][1..-1] => conf[1] }
+ else
+ ret = {}
+ tk_split_list(tk_call('imconfigure', win)).each{|conf|
+ ret[conf[0][1..-1]] = conf[1]
+ }
+ ret
+ end
+ else
+ {}
+ end
+ rescue
+ {}
+ end
+ end
+
+ def useinputmethods(value=None)
+ TkXIM.useinputmethods(value, self)
+ end
+
+ def caret(keys=nil)
+ TkXIM.caret(self, keys=nil)
+ end
+
+ def imconfigure(slot, value=None)
+ TkXIM.configure(self, slot, value)
+ end
+
+ def imconfiginfo(slot=nil)
+ TkXIM.configinfo(self, slot)
+ end
+end
diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb
new file mode 100644
index 0000000000..f65945884c
--- /dev/null
+++ b/ext/tk/lib/tkafter.rb
@@ -0,0 +1,4 @@
+#
+# tkafter.rb - load tk/after.rb
+#
+require 'tk/timer'
diff --git a/ext/tk/lib/tkbgerror.rb b/ext/tk/lib/tkbgerror.rb
new file mode 100644
index 0000000000..deba7a57fa
--- /dev/null
+++ b/ext/tk/lib/tkbgerror.rb
@@ -0,0 +1,4 @@
+#
+# tkbgerror.rb - load tk/bgerror.rb
+#
+require 'tk/bgerror'
diff --git a/ext/tk/lib/tkcanvas.rb b/ext/tk/lib/tkcanvas.rb
new file mode 100644
index 0000000000..9524614291
--- /dev/null
+++ b/ext/tk/lib/tkcanvas.rb
@@ -0,0 +1,4 @@
+#
+# tkcanvas.rb - load tk/canvas.rb
+#
+require 'tk/canvas'
diff --git a/ext/tk/lib/tkclass.rb b/ext/tk/lib/tkclass.rb
new file mode 100644
index 0000000000..87f5acc453
--- /dev/null
+++ b/ext/tk/lib/tkclass.rb
@@ -0,0 +1,47 @@
+#
+# tkclass.rb - Tk classes
+# Date: 2000/11/27 09:23:36
+# by Yukihiro Matsumoto <matz@caelum.co.jp>
+#
+# $Id$
+
+require "tk"
+
+TopLevel = TkToplevel
+Frame = TkFrame
+Label = TkLabel
+Button = TkButton
+Radiobutton = TkRadioButton
+Checkbutton = TkCheckButton
+Message = TkMessage
+Entry = TkEntry
+Spinbox = TkSpinbox
+Text = TkText
+Scale = TkScale
+Scrollbar = TkScrollbar
+Listbox = TkListbox
+Menu = TkMenu
+Menubutton = TkMenubutton
+Canvas = TkCanvas
+Arc = TkcArc
+Bitmap = TkcBitmap
+Line = TkcLine
+Oval = TkcOval
+Polygon = TkcPolygon
+Rectangle = TkcRectangle
+TextItem = TkcText
+WindowItem = TkcWindow
+BitmapImage = TkBitmapImage
+PhotoImage = TkPhotoImage
+Selection = TkSelection
+Winfo = TkWinfo
+Pack = TkPack
+Grid = TkGrid
+Place = TkPlace
+Variable = TkVariable
+Font = TkFont
+VirtualEvent = TkVirtualEvent
+
+def Mainloop
+ Tk.mainloop
+end
diff --git a/ext/tk/lib/tkconsole.rb b/ext/tk/lib/tkconsole.rb
new file mode 100644
index 0000000000..9960ddb8ac
--- /dev/null
+++ b/ext/tk/lib/tkconsole.rb
@@ -0,0 +1,4 @@
+#
+# tkconsole.rb - load tk/console.rb
+#
+require 'tk/console'
diff --git a/ext/tk/lib/tkdialog.rb b/ext/tk/lib/tkdialog.rb
new file mode 100644
index 0000000000..bec5e5d29a
--- /dev/null
+++ b/ext/tk/lib/tkdialog.rb
@@ -0,0 +1,4 @@
+#
+# tkdialog.rb - load tk/dialog.rb
+#
+require 'tk/dialog'
diff --git a/ext/tk/lib/tkentry.rb b/ext/tk/lib/tkentry.rb
new file mode 100644
index 0000000000..2dcfcab5da
--- /dev/null
+++ b/ext/tk/lib/tkentry.rb
@@ -0,0 +1,4 @@
+#
+# tkentry.rb - load tk/entry.rb
+#
+require 'tk/entry'
diff --git a/ext/tk/lib/tkextlib/ICONS.rb b/ext/tk/lib/tkextlib/ICONS.rb
new file mode 100644
index 0000000000..18d84c05e9
--- /dev/null
+++ b/ext/tk/lib/tkextlib/ICONS.rb
@@ -0,0 +1,13 @@
+#
+# ICONS support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/ICONS/setup.rb'
+
+# load library
+require 'tkextlib/ICONS/icons'
diff --git a/ext/tk/lib/tkextlib/ICONS/icons.rb b/ext/tk/lib/tkextlib/ICONS/icons.rb
new file mode 100644
index 0000000000..bd3180aa55
--- /dev/null
+++ b/ext/tk/lib/tkextlib/ICONS/icons.rb
@@ -0,0 +1,129 @@
+#
+# tkextlib/ICONS/icons.rb
+# 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/ICONS/setup.rb'
+
+# TkPackage.require('icons', '1.0')
+TkPackage.require('icons')
+
+module Tk
+ class ICONS < TkImage
+ extend Tk
+
+ PACKAGE_NAME = 'icons'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('icons')
+ rescue
+ ''
+ end
+ end
+
+ def self.create(*args) # icon, icon, ..., ?option=>value, ...?
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ icons = simplelist(tk_call('::icons::icons', 'create',
+ *(hash_kv(keys) << (args.flatten))))
+ else
+ icons = simplelist(tk_call('::icons::icons', 'create',
+ args.flatten))
+ end
+
+ icons.collect{|icon| self.new(icon, :without_creating=>true)}
+ end
+
+ def self.delete(*icons) # icon, icon, ...
+ icons = icons.flatten
+ return if icons.empty?
+ icons.map!{|icon|
+ if icon.kind_of?(Tk::ICONS)
+ Tk_IMGTBL.delete(icon.path)
+ icon.name
+ elsif icon.to_s =~ /^::icon::(.*)/
+ name = $1
+ Tk_IMGTBL.delete(icon)
+ name
+ else
+ Tk_IMGTBL.delete("::icon::#{icon}")
+ icon
+ end
+ }
+ tk_call('::icons::icons', 'delete', icons)
+ end
+
+ def self.query(*args) # icon, icon, ..., ?option=>value, ...?
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ simplelist(tk_call('::icons::icons', 'query',
+ *(hash_kv(keys) << (args.flatten))))
+ else
+ simplelist(tk_call('::icons::icons', 'query', args.flatten))
+ end . map{|inf| list(inf) }
+ end
+
+ ##########################################
+
+ class << self
+ alias _new new
+
+ def new(name, keys=nil)
+ if obj = Tk_IMGTBL["::icon::#{name}"]
+ if keys
+ keys = _symbolkey2str(keys)
+ unless keys.delete('without_creating')
+ tk_call('::icons::icons', 'create', *(hash_kv(keys) << obj.name))
+ end
+ end
+ else
+ obj = _new(name, keys)
+ end
+ obj
+ end
+ end
+
+ ##########################################
+
+ def initialize(name, keys=nil)
+ if name.kind_of?(String) && name =~ /^::icon::(.+)$/
+ @name = $1
+ @path = name
+ else
+ @name = name.to_s
+ @path = "::icon::#{@name}"
+ end
+ keys = _symbolkey2str(keys)
+ unless keys.delete('without_creating')
+ tk_call('::icons::icons', 'create', *(hash_kv(keys) << @name))
+ end
+ Tk_IMGTBL[@path] = self
+ end
+
+ def name
+ @name
+ end
+
+ def delete
+ Tk_IMGTBL.delete(@path)
+ tk_call('::icons::icons', 'delete', @name)
+ self
+ end
+
+ def query(keys={})
+ list(simplelist(tk_call('::icons::icons', 'query',
+ *(hash_kv(keys) << @name))
+ )[0])
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/ICONS/setup.rb b/ext/tk/lib/tkextlib/ICONS/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/ICONS/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/SUPPORT_STATUS b/ext/tk/lib/tkextlib/SUPPORT_STATUS
new file mode 100644
index 0000000000..de51c519fa
--- /dev/null
+++ b/ext/tk/lib/tkextlib/SUPPORT_STATUS
@@ -0,0 +1,193 @@
+
+ [ current support status of Tcl/Tk extensions ]
+
+ *** 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
+(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.
+
+If you want to check that wrapper libraries are ready to use on your
+environment, please execute 'pkg_checker.rb' with no arguments. The
+script may give you some hints about that.
+
+
+ ***** IMPORTANT NOTE **********************************************
+
+ 'support' means that Ruby/Tk's wrapper libraries are released.
+ 'not support' does *NOT* mean that the extension doesn't work
+ on Ruby/Tk.
+
+ The version number of each extension means the latest version
+ which is checked its feature. That is, it does NOT means only
+ version of working. Library files maybe include some features
+ which is included in the former version but removed from the
+ latest, and maybe able to support the later version then the
+ shown version.
+
+ Even if the status of the extension is 'not support', you can
+ control the functions/widgets of the extension without wrapper
+ libraries by Tk.tk_call(), Tk.ip_eval(), and so on.
+
+ If you cannot use installed Tcl/Tk extension, please check the
+ followings.
+
+ (1) On your Tcl/Tk, does the extension work?
+
+ (2) Do DLL libraries of the extension exist on DLL load-path?
+ (See also "<ruby archive>/ext/tcltklib/README.ActiveTcl")
+
+ (3) Is the Tcl library directory of the extension included in
+ library search-path of the Tcl interpreter linked Ruby/Tk?
+
+ The check results may request you to do some setup operations
+ before using the extension. If so, then please write the step
+ of setup operations into the "setup.rb" file in the directory
+ of the wrapper libraries for the extension (It is the wrapper
+ libraries have the standard structure of the libraries in this
+ directory). The "setup" file is required before requiring the
+ Tcl library package (TkPackage.require(<libname>)).
+
+ *******************************************************************
+
+
+===< support with some examples (may be beta quality) >=======================
+
+Tcllib 1.11.1
+Tklib 0.5 http://sourceforge.net/projects/tcllib ==> tcllib
+ ( partial support; primary support target is Tklib)
+
+IWidgets 4.0.2 http://sourceforge.net/projects/incrtcl ==> iwidgets
+
+BWidget 1.8 [ CVS/Hd(2009-07-02) ]
+ http://sourceforge.net/projects/tcllib ==> bwidget
+
+TkTable 2.10 http://sourceforge.net/projects/tktable ==> tktable
+ * see also <http://www.korus.hu/~fery/ruby/tktable.rb>
+ written by Ferenc Engard (ferenc@engard.hu)
+
+Vu widgets 2.3.0 http://sourceforge.net/projects/tktable ==> vu
+
+TkHTML 2.0 http://www.hwaci.com/sw/tkhtml/ ==> tkHTML
+
+ICONS 1.0 http://www.satisoft.com/tcltk/icons/ ==> ICONS
+
+TkImg 1.3 http://sourceforge.net/projects/tkimg ==> tkimg
+
+
+BLT 2.4z http://sourceforge.net/projects/blt ==> blt
+
+TkTreeCtrl 2.2.9
+ http://tktreectrl.sourceforge.net/ ==> treectrl
+
+Tile 0.8.3/8.6b1
+ http://sourceforge.net/projects/tktable ==> tile
+
+
+
+===< support (may be alpha or beta quality) >=================================
+
+IncrTcl CVS/Hd(2008-12-15)
+ http://sourceforge.net/projects/incrtcl ==> itcl, itk
+
+TclX CVS/Hd(2008-12-15)
+ http://sourceforge.net/projects/tclx
+ ==> tclx (partial support; infox command and
+ XPG/3 message catalogs only)
+
+Trofs 0.4.4 http://math.nist.gov/~DPorter/tcltk/trofs/
+
+
+
+===< possibly available (not tested; alpha quality) >=========================
+
+winico 0.6
+ http://sourceforge.net/projects/tktable
+ ==> winico (win32 only)
+
+TkTrans latest(2004-10-11)
+ http://www2.cmp.uea.ac.uk/~fuzz/tktrans/default.html
+ ==> tktrans (win32 only)
+
+TkDND 1.0a2 http://sourceforge.net/projects/tkdnd ==> tkDND
+
+
+
+===< plan to support (alpha quality libraries may be included) >==============
+
+GraphViz *** http://www.graphviz.org/
+
+Tkgeomap *** http://tkgeomap.sourceforge.net/index.html
+
+
+
+===< not determined to supprt or not >========================================
+
+Tix *** http://tixlibrary.sourceforge.net/
+
+TkZinc *** http://www.tkzinc.org/
+
+Wbc *** http://home.t-online.de/home/csaba.nemethi/
+
+Mentry *** http://home.t-online.de/home/csaba.nemethi/
+
+Tablelist *** http://home.t-online.de/home/csaba.nemethi/
+
+ANIGIF *** http://cardtable.sourceforge.net/tcltk/
+
+IMG_ROTATE *** http://cardtable.sourceforge.net/tcltk/
+
+TclVfs *** http://sourceforge.net/projects/tclvfs/
+
+vfwtcl *** http://sourceforge.net/projects/avicaptcl
+ * Win32 only
+
+multicast *** http://sourceforge.net/projects/avicaptcl
+ * Win32 only
+
+XBit *** http://www.geocities.com/~chengye/
+ * current implementation is for Windows only
+
+QuickTimeTcl *** http://hem.fyristorg.com/matben/qt/
+ * works under Mac OS (8,9,X) or Windows
+
+
+
+===< may not support (already exist, out of Ruby/Tk scope, and so on) >=======
+
+TkCon *** http://sourceforge.net/projects/tkcon
+
+Expect *** http://sourceforge.net/projects/expect
+
+TclXML *** http://sourceforge.net/projects/tclxml
+
+TclXSLT *** http://sourceforge.net/projects/tclxml
+
+TclDOM *** http://sourceforge.net/projects/tclxml
+
+TclSOAP *** http://sourceforge.net/projects/tclsoap
+
+Snack *** http://www.speech.kth.se/~kare/snack2.2.tar.gz
+ * use Snack for Ruby
+ (see http://rbsnack.sourceforge.net/)
+
+Tcom *** http://www.vex.net/~cthuang/tcom/
+
+tDOM *** http://www.tdom.org
+
+Mk4tcl *** http://www.equi4.com/metakit/tcl.html
+
+Memchan *** http://sourceforge.net/projects/memchan
+
+XOTcl *** http://www.xotcl.org/
+
+
+===< tool (may not supprt) >==================================================
+
+tbcload/tclcompiler
+ *** http://www.tcl.tk/software/tclpro/
+
+
+(End of List)
diff --git a/ext/tk/lib/tkextlib/blt.rb b/ext/tk/lib/tkextlib/blt.rb
new file mode 100644
index 0000000000..8b132e41a7
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt.rb
@@ -0,0 +1,189 @@
+#
+# BLT support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/variable'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/blt/setup.rb'
+
+# load all image format handlers
+#TkPackage.require('BLT', '2.4')
+TkPackage.require('BLT')
+
+module Tk
+ module BLT
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+ # Require autoload-symbols which is a same name as widget classname.
+ # Those are used at TkComm._genobj_for_tkwidget method.
+
+ extend TkCore
+
+ VERSION = tk_call('set', 'blt_version')
+ PATCH_LEVEL = tk_call('set', 'blt_patchLevel')
+
+ begin
+ lib = TkCore::INTERP._invoke('set', 'blt_library')
+ rescue
+ lib = ''
+ end
+ LIBRARY = TkVarAccess.new('blt_library', lib)
+
+ begin
+ lib = TkCore::INTERP._invoke('set', 'blt_libPath')
+ rescue
+ lib = ''
+ end
+ LIB_PATH = TkVarAccess.new('blt_libPath', lib)
+
+ PACKAGE_NAME = 'BLT'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('BLT')
+ rescue
+ ''
+ end
+ end
+
+ ####################################################
+
+ def self.beep(percent = 50)
+ tk_call('::blt::beep', percent)
+ end
+
+ def self.bgexec(*args)
+ if args[0].kind_of?(TkVariable)
+ var = args.shift
+ else
+ var = TkVariable.new
+ end
+ params = [var]
+
+ params.concat(hash_kv(args.shift, true)) if args[0].kind_of?(Hash)
+
+ params << '--' if args[0] =~ /^\s*-[^-]/
+ params.concat(args)
+
+ tk_call('::blt::bgexec', *params)
+ var
+ end
+
+ def self.detach_bgexec(*args)
+ if args[0].kind_of?(TkVariable)
+ var = args.shift
+ else
+ var = TkVariable.new
+ end
+ params = [var]
+
+ params.concat(hash_kv(args.shift, true)) if args[0].kind_of?(Hash)
+
+ params << '--' if args[0] =~ /^\s*-[^-]/
+ params.concat(args)
+ params << '&'
+
+ [var, tk_split_list(tk_call('::blt::bgexec', *params))]
+ end
+
+ def self.bltdebug(lvl = nil)
+ if lvl
+ tk_call('::blt::bltdebug', lvl)
+ else
+ number(tk_call('::blt::bltdebug'))
+ end
+ end
+
+ def self.crc32_file(name)
+ tk_call_without_enc('::blt::crc32', name)
+ end
+ def self.crc32_data(dat)
+ tk_call_without_enc('::blt::crc32', '-data', dat)
+ end
+
+ ####################################################
+
+ def self.active_legend(graph)
+ tk_call_without_enc('Blt_ActiveLegend', graph)
+ end
+ def self.crosshairs(graph)
+ tk_call_without_enc('Blt_Crosshairs', graph)
+ end
+ def self.zoom_stack(graph)
+ tk_call_without_enc('Blt_ZoomStack', graph)
+ end
+ def self.print_key(graph)
+ tk_call_without_enc('Blt_PrintKey', graph)
+ end
+ def self.closest_point(graph)
+ tk_call_without_enc('Blt_ClosestPoint', graph)
+ end
+
+ module GraphCommand
+ def active_legend
+ tk_call_without_enc('Blt_ActiveLegend', @path)
+ self
+ end
+ def crosshairs
+ tk_call_without_enc('Blt_Crosshairs', @path)
+ self
+ end
+ def zoom_stack
+ tk_call_without_enc('Blt_ZoomStack', @path)
+ self
+ end
+ def print_key
+ tk_call_without_enc('Blt_PrintKey', @path)
+ self
+ end
+ def closest_point
+ tk_call_without_enc('Blt_ClosestPoint', @path)
+ self
+ end
+ end
+
+ ####################################################
+
+ autoload :PlotComponent,'tkextlib/blt/component.rb'
+
+ autoload :Barchart, 'tkextlib/blt/barchart.rb'
+ autoload :Bitmap, 'tkextlib/blt/bitmap.rb'
+ autoload :Busy, 'tkextlib/blt/busy.rb'
+ autoload :Container, 'tkextlib/blt/container.rb'
+ autoload :CutBuffer, 'tkextlib/blt/cutbuffer.rb'
+ autoload :DragDrop, 'tkextlib/blt/dragdrop.rb'
+ autoload :EPS, 'tkextlib/blt/eps.rb'
+ autoload :Htext, 'tkextlib/blt/htext.rb'
+ autoload :Graph, 'tkextlib/blt/graph.rb'
+ autoload :Spline, 'tkextlib/blt/spline.rb'
+ autoload :Stripchart, 'tkextlib/blt/stripchart.rb'
+ autoload :Table, 'tkextlib/blt/table.rb'
+ autoload :Tabnotebook, 'tkextlib/blt/tabnotebook.rb'
+ autoload :Tabset, 'tkextlib/blt/tabset.rb'
+ autoload :Ted, 'tkextlib/blt/ted.rb'
+ autoload :Tile, 'tkextlib/blt/tile.rb'
+ autoload :Tree, 'tkextlib/blt/tree.rb'
+ autoload :TreeView, 'tkextlib/blt/treeview.rb'
+ autoload :Hiertable, 'tkextlib/blt/treeview.rb'
+ # Hierbox is obsolete
+ autoload :Vector, 'tkextlib/blt/vector.rb'
+ autoload :VectorAccess, 'tkextlib/blt/vector.rb'
+ autoload :Watch, 'tkextlib/blt/watch.rb'
+ autoload :Winop, 'tkextlib/blt/winop.rb'
+ autoload :WinOp, 'tkextlib/blt/winop.rb'
+
+ # Unix only
+ autoload :DnD, 'tkextlib/blt/unix_dnd.rb'
+
+ # Windows only
+ autoload :Printer, 'tkextlib/blt/win_printer.rb'
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/barchart.rb b/ext/tk/lib/tkextlib/blt/barchart.rb
new file mode 100644
index 0000000000..a86b91c959
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/barchart.rb
@@ -0,0 +1,79 @@
+#
+# tkextlib/blt/barchart.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+require 'tkextlib/blt/component.rb'
+
+module Tk::BLT
+ class Barchart < TkWindow
+ TkCommandNames = ['::blt::barchart'.freeze].freeze
+ WidgetClassName = 'Barchart'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include PlotComponent
+ include GraphCommand
+
+ def __boolval_optkeys
+ ['bufferelements', 'buffergraph', 'invertxy']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ ['text', 'label', 'title', 'file',
+ 'background', 'plotbackground']
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'colormap' << 'fontmap'
+ end
+ private :__tkvariable_optkeys
+
+=begin
+ BarElement_ID = ['blt_barchart_bar'.freeze, TkUtil.untrust('00000')].freeze
+
+ def bar(elem=nil, keys={})
+ if elem.kind_of?(Hash)
+ keys = elem
+ elem = nil
+ end
+ unless elem
+ elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
+ BarElement_ID[1].succ!
+ end
+ tk_send('bar', elem, keys)
+ Element.new(self, elem, :without_creating=>true)
+ end
+=end
+
+ def extents(item)
+ num_or_str(tk_send_without_enc('extents', item))
+ end
+
+ def invtransform(x, y)
+ list(tk_send_without_enc('invtransform', x, y))
+ end
+
+ def inside(x, y)
+ bool(tk_send_without_enc('inside', x, y))
+ end
+
+ def metafile(file=None)
+ # Windows only
+ tk_send('metafile', file)
+ self
+ end
+
+ def snap(output, keys={})
+ tk_send_without_enc('snap', *(hash_kv(keys, false) + output))
+ self
+ end
+
+ def transform(x, y)
+ list(tk_send_without_enc('transform', x, y))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/bitmap.rb b/ext/tk/lib/tkextlib/blt/bitmap.rb
new file mode 100644
index 0000000000..3254b63116
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/bitmap.rb
@@ -0,0 +1,112 @@
+#
+# tkextlib/blt/bitmap.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Bitmap < TkObject
+ extend TkCore
+
+ TkCommandNames = ['::blt::bitmap'.freeze].freeze
+
+ BITMAP_ID_TBL = TkCore::INTERP.create_table
+
+ (BITMAP_ID = ['blt_bitmap_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ BITMAP_ID_TBL.mutex.synchronize{ BITMAP_ID_TBL.clear }
+ }
+
+ def self.data(name)
+ dat = tk_simple_list(tk_call('::blt::bitmap', 'data', name))
+ [ tk_split_list(dat[0]), tk_simple_list(dat[1]) ]
+ end
+
+ def self.exist?(name)
+ bool(tk_call('::blt::bitmap', 'exists', name))
+ end
+
+ def self.height(name)
+ number(tk_call('::blt::bitmap', 'height', name))
+ end
+
+ def self.width(name)
+ number(tk_call('::blt::bitmap', 'width', name))
+ end
+
+ def self.source(name)
+ tk_simple_list(tk_call('::blt::bitmap', 'source', name))
+ end
+
+ #################################
+
+ class << self
+ alias _new new
+
+ def new(data, keys={})
+ _new(:data, nil, data, keys)
+ end
+ alias define new
+
+ def new_with_name(name, data, keys={})
+ _new(:data, name, data, keys)
+ end
+ alias define_with_name new_with_name
+
+ def compose(text, keys={})
+ _new(:text, nil, text, keys)
+ end
+
+ def compose_with_name(name, text, keys={})
+ _new(:text, name, text, keys)
+ end
+ end
+
+ def initialize(type, name, data, keys = {})
+ if name
+ @id = name
+ else
+ BITMAP_ID.mutex.synchronize{
+ @id = BITMAP_ID.join(TkCore::INTERP._ip_id_)
+ BITMAP_ID[1].succ!
+ }
+ BITMAP_ID_TBL.mutex.synchronize{
+ BITMAP_ID_TBL[@id] = self
+ }
+ end
+
+ @path = @id
+
+ unless bool(tk_call('::blt::bitmap', 'exists', @id))
+ if type == :text
+ tk_call('::blt::bitmap', 'compose', @id, data, *hash_kv(keys))
+ else # :data
+ tk_call('::blt::bitmap', 'define', @id, data, *hash_kv(keys))
+ end
+ end
+ end
+
+ def exist?
+ bool(tk_call('::blt::bitmap', 'exists', @id))
+ end
+
+ def height
+ number(tk_call('::blt::bitmap', 'height', @id))
+ end
+
+ def width
+ number(tk_call('::blt::bitmap', 'width', @id))
+ end
+
+ def source
+ tk_simple_list(tk_call('::blt::bitmap', 'source', @id))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/busy.rb b/ext/tk/lib/tkextlib/blt/busy.rb
new file mode 100644
index 0000000000..b5287fb5b7
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/busy.rb
@@ -0,0 +1,83 @@
+#
+# tkextlib/blt/busy.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/itemconfig.rb'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Busy
+ extend TkCore
+ extend TkItemConfigMethod
+
+ TkCommandNames = ['::blt::busy'.freeze].freeze
+
+ ###########################
+
+ class Shield < TkWindow
+ def self.shield_path(win)
+ win = window(win) unless win.kind_of?(TkWindow)
+ if win.kind_of?(Tk::Toplevel)
+ win.path + '._Busy'
+ else
+ win.path + '_Busy'
+ end
+ end
+
+ def initialize(win)
+ @path = self.class.shield_path(win)
+ end
+ end
+
+ def self.shield_path(win)
+ Tk::BLT::Busy::Shield.shield_path(win)
+ end
+ end
+end
+
+class << Tk::BLT::Busy
+ def __item_config_cmd(win)
+ ['::blt::busy', 'configure', win]
+ end
+ private :__item_config_cmd
+
+ undef itemcget
+ undef itemcget_tkstring
+ alias configure itemconfigure
+ alias configinfo itemconfiginfo
+ alias current_configinfo current_itemconfiginfo
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ##################################
+
+ def hold(win, keys={})
+ tk_call('::blt::busy', 'hold', win, *hash_kv(keys))
+ end
+
+ def release(*wins)
+ tk_call('::blt::busy', 'release', *wins)
+ end
+
+ def forget(*wins)
+ tk_call('::blt::busy', 'forget', *wins)
+ end
+
+ def is_busy(pat=None)
+ tk_split_list(tk_call('::blt::busy', 'isbusy', pat))
+ end
+
+ def names(pat=None)
+ tk_split_list(tk_call('::blt::busy', 'names', pat))
+ end
+ alias windows names
+
+ def check(win)
+ bool(tk_call('::blt::busy', 'check', win))
+ end
+
+ def status(win)
+ bool(tk_call('::blt::busy', 'status', win))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/component.rb b/ext/tk/lib/tkextlib/blt/component.rb
new file mode 100644
index 0000000000..c7ea213cee
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/component.rb
@@ -0,0 +1,2218 @@
+#
+# tkextlib/blt/component.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module PlotComponent
+ include TkItemConfigMethod
+
+ module OptKeys
+ def __item_font_optkeys(id)
+ ['font', 'tickfont', 'titlefont']
+ end
+ private :__item_font_optkeys
+
+ def __item_numstrval_optkeys(id)
+ ['xoffset', 'yoffset']
+ end
+ private :__item_numstrval_optkeys
+
+ def __item_boolval_optkeys(id)
+ ['hide', 'under', 'descending', 'logscale', 'loose', 'showticks',
+ 'titlealternate', 'scalesymbols', 'minor', 'raised',
+ 'center', 'decoration', 'landscape', 'maxpect']
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ ['text', 'label', 'limits', 'title',
+ 'show', 'file', 'maskdata', 'maskfile',
+ 'color', 'titlecolor', 'fill', 'outline', 'offdash']
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ ['bindtags']
+ end
+ private :__item_listval_optkeys
+
+ def __item_numlistval_optkeys(id)
+ ['dashes', 'majorticks', 'minorticks']
+ end
+ private :__item_numlistval_optkeys
+
+ def __item_tkvariable_optkeys(id)
+ ['variable', 'textvariable', 'colormap', 'fontmap']
+ end
+ private :__item_tkvariable_optkeys
+ end
+
+ include OptKeys
+
+ def __item_cget_cmd(id)
+ if id.kind_of?(Array)
+ # id := [ type, name ]
+ [self.path, id[0], 'cget', id[1]]
+ else
+ [self.path, id, 'cget']
+ end
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ if id.kind_of?(Array)
+ # id := [ type, name, ... ]
+ type, *names = id
+ [self.path, type, 'configure'].concat(names)
+ else
+ [self.path, id, 'configure']
+ end
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ if id.kind_of?(Array)
+ id = tagid(id[1])
+ end
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ def axis_cget_tkstring(id, option)
+ ret = itemcget_tkstring(['axis', tagid(id)], option)
+ end
+ def axis_cget(id, option)
+ ret = itemcget(['axis', tagid(id)], option)
+ end
+ def axis_cget_strict(id, option)
+ ret = itemcget_strict(['axis', tagid(id)], option)
+ end
+ def axis_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ slot = _symbolkey2str(slot)
+ if cmd = slot.delete('command')
+ slot['command'] = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ else
+ value = slot
+ slot = args.pop
+ if slot == :command || slot == 'command'
+ cmd = value
+ value = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('axis')
+ itemconfigure(id_list, slot, value)
+ end
+ def axis_configinfo(id, slot=nil)
+ itemconfiginfo(['axis', tagid(id)], slot)
+ end
+ def current_axis_configinfo(id, slot=nil)
+ current_itemconfiginfo(['axis', tagid(id)], slot)
+ end
+
+ def crosshairs_cget_tkstring(option)
+ itemcget_tkstring('crosshairs', option)
+ end
+ def crosshairs_cget(option)
+ itemcget('crosshairs', option)
+ end
+ def crosshairs_cget_strict(option)
+ itemcget_strict('crosshairs', option)
+ end
+ def crosshairs_configure(slot, value=None)
+ itemconfigure('crosshairs', slot, value)
+ end
+ def crosshairs_configinfo(slot=nil)
+ itemconfiginfo('crosshairs', slot)
+ end
+ def current_crosshairs_configinfo(slot=nil)
+ current_itemconfiginfo('crosshairs', slot)
+ end
+
+ def element_cget_tkstring(id, option)
+ itemcget_tkstring(['element', tagid(id)], option)
+ end
+ def element_cget(id, option)
+ itemcget(['element', tagid(id)], option)
+ end
+ def element_cget_strict(id, option)
+ itemcget_strict(['element', tagid(id)], option)
+ end
+ def element_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ else
+ value = slot
+ slot = args.pop
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('element')
+ itemconfigure(id_list, slot, value)
+ end
+ def element_configinfo(id, slot=nil)
+ itemconfiginfo(['element', tagid(id)], slot)
+ end
+ def current_element_configinfo(id, slot=nil)
+ current_itemconfiginfo(['element', tagid(id)], slot)
+ end
+
+ def bar_cget_tkstring(id, option)
+ itemcget_tkstring(['bar', tagid(id)], option)
+ end
+ def bar_cget(id, option)
+ itemcget(['bar', tagid(id)], option)
+ end
+ def bar_cget_strict(id, option)
+ itemcget_strict(['bar', tagid(id)], option)
+ end
+ def bar_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ else
+ value = slot
+ slot = args.pop
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('bar')
+ itemconfigure(id_list, slot, value)
+ end
+ def bar_configinfo(id, slot=nil)
+ itemconfiginfo(['bar', tagid(id)], slot)
+ end
+ def current_bar_configinfo(id, slot=nil)
+ current_itemconfiginfo(['bar', tagid(id)], slot)
+ end
+
+ def line_cget_tkstring(id, option)
+ itemcget_tkstring(['line', tagid(id)], option)
+ end
+ def line_cget(id, option)
+ itemcget(['line', tagid(id)], option)
+ end
+ def line_cget_strict(id, option)
+ itemcget_strict(['line', tagid(id)], option)
+ end
+ def line_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ else
+ value = slot
+ slot = args.pop
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('line')
+ itemconfigure(id_list, slot, value)
+ end
+ def line_configinfo(id, slot=nil)
+ itemconfiginfo(['line', tagid(id)], slot)
+ end
+ def current_line_configinfo(id, slot=nil)
+ current_itemconfiginfo(['line', tagid(id)], slot)
+ end
+
+ def gridline_cget_tkstring(option)
+ itemcget_tkstring('grid', option)
+ end
+ def gridline_cget(option)
+ itemcget('grid', option)
+ end
+ def gridline_cget_strict(option)
+ itemcget_strict('grid', option)
+ end
+ def gridline_configure(slot, value=None)
+ itemconfigure('grid', slot, value)
+ end
+ def gridline_configinfo(slot=nil)
+ itemconfiginfo('grid', slot)
+ end
+ def current_gridline_configinfo(slot=nil)
+ current_itemconfiginfo('grid', slot)
+ end
+
+ def legend_cget_tkstring(option)
+ itemcget_tkstring('legend', option)
+ end
+ def legend_cget(option)
+ itemcget('legend', option)
+ end
+ def legend_cget_strict(option)
+ itemcget_strict('legend', option)
+ end
+ def legend_configure(slot, value=None)
+ itemconfigure('legend', slot, value)
+ end
+ def legend_configinfo(slot=nil)
+ itemconfiginfo('legend', slot)
+ end
+ def current_legend_configinfo(slot=nil)
+ current_itemconfiginfo('legend', slot)
+ end
+
+ def pen_cget_tkstring(id, option)
+ itemcget_tkstring(['pen', tagid(id)], option)
+ end
+ def pen_cget(id, option)
+ itemcget(['pen', tagid(id)], option)
+ end
+ def pen_cget_strict(id, option)
+ itemcget_strict(['pen', tagid(id)], option)
+ end
+ def pen_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ else
+ value = slot
+ slot = args.pop
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('pen')
+ itemconfigure(id_list, slot, value)
+ end
+ def pen_configinfo(id, slot=nil)
+ itemconfiginfo(['pen', tagid(id)], slot)
+ end
+ def current_pen_configinfo(id, slot=nil)
+ current_itemconfiginfo(['pen', tagid(id)], slot)
+ end
+
+ def postscript_cget_tkstring(option)
+ itemcget_tkstring('postscript', option)
+ end
+ def postscript_cget(option)
+ itemcget('postscript', option)
+ end
+ def postscript_cget_strict(option)
+ itemcget_strict('postscript', option)
+ end
+ def postscript_configure(slot, value=None)
+ itemconfigure('postscript', slot, value)
+ end
+ def postscript_configinfo(slot=nil)
+ itemconfiginfo('postscript', slot)
+ end
+ def current_postscript_configinfo(slot=nil)
+ current_itemconfiginfo('postscript', slot)
+ end
+
+ def marker_cget_tkstring(id, option)
+ itemcget_tkstring(['marker', tagid(id)], option)
+ end
+ def marker_cget(id, option)
+ itemcget(['marker', tagid(id)], option)
+ end
+ def marker_cget_strict(id, option)
+ itemcget_strict(['marker', tagid(id)], option)
+ end
+ def marker_configure(*args)
+ slot = args.pop
+ if slot.kind_of?(Hash)
+ value = None
+ else
+ value = slot
+ slot = args.pop
+ end
+ id_list = args.flatten.collect!{|id| tagid(id)}.unshift('marker')
+ itemconfigure(id_list, slot, value)
+ end
+ def marker_configinfo(id, slot=nil)
+ itemconfiginfo(['marker', tagid(id)], slot)
+ end
+ def current_marker_configinfo(id, slot=nil)
+ current_itemconfiginfo(['marker', tagid(id)], slot)
+ end
+
+ alias __itemcget_tkstring itemcget_tkstring
+ alias __itemcget itemcget
+ alias __itemcget_strict itemcget_strict
+ alias __itemconfiginfo itemconfiginfo
+ alias __current_itemconfiginfo current_itemconfiginfo
+ private :__itemcget_tkstring, :__itemcget, :__itemconfiginfo, :__current_itemconfiginfo
+
+ def itemcget_tkstring(tagOrId, option)
+ __itemcget_tkstring(tagid(tagOrId), option)
+ end
+ def itemcget_strict(tagOrId, option)
+ ret = __itemcget(tagid(tagOrId), option)
+ if option == 'bindtags' || option == :bindtags
+ ret.collect{|tag| TkBindTag.id2obj(tag)}
+ else
+ ret
+ end
+ end
+ def itemcget(tagOrId, option)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ itemcget_strict(tagOrId, option)
+ else
+ begin
+ itemcget_strict(tagOrId, option)
+ rescue => e
+ begin
+ if current_itemconfiginfo(tagOrId).has_key?(option.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ def itemconfiginfo(tagOrId, slot = nil)
+ ret = __itemconfiginfo(tagid(tagOrId), slot)
+
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ if slot == 'bindtags' || slot == :bindtags
+ ret[-2] = ret[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ ret[-1] = ret[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ end
+ else
+ if (inf = ret.assoc('bindtags'))
+ inf[-2] = inf[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ inf[-1] = inf[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ end
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (inf = ret['bindtags'])
+ inf[-2] = inf[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ inf[-1] = inf[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ ret['bindtags'] = inf
+ end
+ end
+
+ ret
+ end
+ def current_itemconfiginfo(tagOrId, slot = nil)
+ ret = __current_itemconfiginfo(tagid(tagOrId), slot)
+
+ if (val = ret['bindtags'])
+ ret['bindtags'] = val.collect{|tag| TkBindTag.id2obj(tag)}
+ end
+
+ ret
+ end
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ #################
+
+ class Axis < TkObject
+ (OBJ_ID = ['blt_chart_axis'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ AxisID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ AxisID_TBL.mutex.synchronize{ AxisID_TBL.clear }
+ }
+
+ def self.id2obj(chart, id)
+ cpath = chart.path
+ AxisID_TBL.mutex.synchronize{
+ return id unless AxisID_TBL[cpath]
+ AxisID_TBL[cpath][id]? AxisID_TBL[cpath][id]: id
+ }
+ end
+
+ def self.new(chart, axis=nil, keys={})
+ if axis.kind_of?(Hash)
+ keys = axis
+ axis = nil
+ end
+ if keys
+ keys = _symbolkey2str(keys)
+ not_create = keys.delete('without_creating')
+ else
+ not_create = false
+ end
+
+ obj = nil
+ AxisID_TBL.mutex.synchronize{
+ chart_path = chart.path
+ AxisID_TBL[chart_path] ||= {}
+ if axis && AxisID_TBL[chart_path][axis]
+ obj = AxisID_TBL[chart_path][axis]
+ else
+ (obj = self.allocate).instance_eval{
+ if axis
+ @axis = @id = axis.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @axis = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ Axis::AxisID_TBL[@cpath][@axis] = self
+ unless not_create
+ tk_call(@chart, 'axis', 'create', @axis, keys)
+ return obj
+ end
+ }
+ end
+ }
+
+ obj.configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, axis=nil, keys={})
+ # dummy:: not called by 'new' method
+
+ if axis.kind_of?(Hash)
+ keys = axis
+ axis = nil
+ end
+ if axis
+ @axis = @id = axis.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @axis = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ # Axis::AxisID_TBL[@cpath][@axis] = self
+ keys = _symbolkey2str(keys)
+ unless keys.delete('without_creating')
+ # @chart.axis_create(@axis, keys)
+ tk_call(@chart, 'axis', 'create', @axis, keys)
+ end
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.axis_cget_tkstring(@id, option)
+ end
+ def cget(option)
+ @chart.axis_cget(@id, option)
+ end
+ def cget_strict(option)
+ @chart.axis_cget_strict(@id, option)
+ end
+ def configure(key, value=None)
+ @chart.axis_configure(@id, key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.axis_configinfo(@id, key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_axis_configinfo(@id, key)
+ end
+
+ def command(cmd=nil, &b)
+ if cmd
+ configure('command', cmd)
+ elsif b
+ configure('command', Proc.new(&b))
+ else
+ cget('command')
+ end
+ end
+
+ def delete
+ @chart.axis_delete(@id)
+ self
+ end
+
+ def invtransform(val)
+ @chart.axis_invtransform(@id, val)
+ end
+
+ def limits
+ @chart.axis_limits(@id)
+ end
+
+ def name
+ @axis
+ end
+
+ def transform(val)
+ @chart.axis_transform(@id, val)
+ end
+
+ def view
+ @chart.axis_view(@id)
+ self
+ end
+
+ def use(name=None) # if @id == xaxis | x2axis | yaxis | y2axis
+ @chart.axis_use(@id, name)
+ end
+
+ def use_as(axis) # axis := xaxis | x2axis | yaxis | y2axis
+ @chart.axis_use(axis, @id)
+ end
+ end
+
+ #################
+
+ class Crosshairs < TkObject
+ CrosshairsID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ CrosshairsID_TBL.mutex.synchronize{ CrosshairsID_TBL.clear }
+ }
+
+ def self.new(chart, keys={})
+ obj = nil
+ CrosshairsID_TBL.mutex.synchronize{
+ unless (obj = CrosshairsID_TBL[chart.path])
+ (obj = self.allocate).instance_eval{
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @path = @id = 'crosshairs'
+ Crosshairs::CrosshairsID_TBL[@cpath] = self
+ }
+ end
+ }
+ chart.crosshair_configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, keys={})
+ # dummy:: not called by 'new' method
+
+ @parent = @chart = chart
+ @cpath = @chart.path
+ # Crosshairs::CrosshairsID_TBL[@cpath] = self
+ @chart.crosshair_configure(keys) unless keys.empty?
+ @path = @id = 'crosshairs'
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.crosshair_cget_tkstring(option)
+ end
+ def cget(option)
+ @chart.crosshair_cget(option)
+ end
+ def cget_strict(option)
+ @chart.crosshair_cget_strict(option)
+ end
+ def configure(key, value=None)
+ @chart.crosshair_configure(key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.crosshair_configinfo(key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_crosshair_configinfo(key)
+ end
+
+ def off
+ @chart.crosshair_off
+ self
+ end
+ def on
+ @chart.crosshair_on
+ self
+ end
+ def toggle
+ @chart.crosshair_toggle
+ self
+ end
+ end
+
+ #################
+
+ class Element < TkObject
+ extend Tk
+ extend TkItemFontOptkeys
+ extend TkItemConfigOptkeys
+
+ extend Tk::BLT::PlotComponent::OptKeys
+
+ ElementTypeName = 'element'
+ ElementTypeToClass = { ElementTypeName=>self }
+
+ ElementID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ ElementID_TBL.mutex.synchronize{ ElementID_TBL.clear }
+ }
+
+ (OBJ_ID = ['blt_chart_element'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ def Element.type2class(type)
+ ElementTypeToClass[type]
+ end
+
+ def Element.id2obj(chart, id)
+ cpath = chart.path
+ ElementID_TBL.mutex.synchronize{
+ return id unless ElementID_TBL[cpath]
+ ElementID_TBL[cpath][id]? ElementID_TBL[cpath][id]: id
+ }
+ end
+
+ def self.new(chart, element=nil, keys={})
+ if element.kind_of?(Hash)
+ keys = element
+ element = nil
+ end
+ if keys
+ keys = _symbolkey2str(keys)
+ not_create = keys.delete('without_creating')
+ else
+ not_create = false
+ end
+
+ obj = nil
+ ElementID_TBL.mutex.synchronize{
+ chart_path = chart.path
+ ElementID_TBL[chart_path] ||= {}
+ if element && ElementID_TBL[chart_path][element]
+ obj = ElementID_TBL[chart_path][element]
+ else
+ (obj = self.allocate).instance_eval{
+ if element
+ @element = @id = element.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @element = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @typename = self.class::ElementTypeName
+ Element::ElementID_TBL[@cpath][@element] = self
+ unless not_create
+ tk_call(@chart, @typename, 'create', @element, keys)
+ return obj
+ end
+ }
+ end
+ }
+
+ obj.configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, element=nil, keys={})
+ # dummy:: not called by 'new' method
+
+ if element.kind_of?(Hash)
+ keys = element
+ element = nil
+ end
+ if element
+ @element = @id = element.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @element = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @typename = self.class::ElementTypeName
+ # Element::ElementID_TBL[@cpath][@element] = self
+ keys = _symbolkey2str(keys)
+ unless keys.delete('without_creating')
+ # @chart.element_create(@element, keys)
+ tk_call(@chart, @typename, 'create', @element, keys)
+ end
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ # @chart.element_cget(@id, option)
+ @chart.__send__(@typename + '_cget_tkstring', @id, option)
+ end
+ def cget(option)
+ # @chart.element_cget(@id, option)
+ @chart.__send__(@typename + '_cget', @id, option)
+ end
+ def cget_strict(option)
+ @chart.__send__(@typename + '_cget_strict', @id, option)
+ end
+ def configure(key, value=None)
+ # @chart.element_configure(@id, key, value)
+ @chart.__send__(@typename + '_configure', @id, key, value)
+ self
+ end
+ def configinfo(key=nil)
+ # @chart.element_configinfo(@id, key)
+ @chart.__send__(@typename + '_configinfo', @id, key)
+ end
+ def current_configinfo(key=nil)
+ # @chart.current_element_configinfo(@id, key)
+ @chart.__send__('current_' << @typename << '_configinfo', @id, key)
+ end
+
+ def activate(*args)
+ @chart.element_activate(@id, *args)
+ end
+
+ def closest(x, y, var, keys={})
+ # @chart.element_closest(x, y, var, @id, keys)
+ @chart.__send__(@typename + '_closest', x, y, var, @id, keys)
+ end
+
+ def deactivate
+ @chart.element_deactivate(@id)
+ self
+ end
+
+ def delete
+ @chart.element_delete(@id)
+ self
+ end
+
+ def exist?
+ @chart.element_exist?(@id)
+ end
+
+ def name
+ @element
+ end
+
+ def type
+ @chart.element_type(@id)
+ end
+ end
+
+ class Bar < Element
+ ElementTypeName = 'bar'.freeze
+ ElementTypeToClass[ElementTypeName] = self
+ end
+ class Line < Element
+ ElementTypeName = 'line'.freeze
+ ElementTypeToClass[ElementTypeName] = self
+ end
+
+ #################
+
+ class GridLine < TkObject
+ GridLineID_TBL = TkCore::INTERP.create_table
+ TkCore::INTERP.init_ip_env{
+ GridLineID_TBL.mutex.synchronize{ GridLineID_TBL.clear }
+ }
+
+ def self.new(chart, keys={})
+ obj = nil
+ GridLineID_TBL.mutex.synchronize{
+ unless (obj = GridLineID_TBL[chart.path])
+ (obj = self.allocate).instance_eval{
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @path = @id = 'grid'
+ GridLine::GridLineID_TBL[@cpath] = self
+ }
+ end
+ }
+ chart.gridline_configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, keys={})
+ # dummy:: not called by 'new' method
+
+ @parent = @chart = chart
+ @cpath = @chart.path
+ # GridLine::GridLineID_TBL[@cpath] = self
+ @chart.gridline_configure(keys) unless keys.empty?
+ @path = @id = 'grid'
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.gridline_cget_tkstring(option)
+ end
+ def cget(option)
+ @chart.gridline_cget(option)
+ end
+ def cget_strict(option)
+ @chart.gridline_cget_strict(option)
+ end
+ def configure(key, value=None)
+ @chart.gridline_configure(key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.gridline_configinfo(key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_gridline_configinfo(key)
+ end
+
+ def off
+ @chart.gridline_off
+ self
+ end
+ def on
+ @chart.gridline_on
+ self
+ end
+ def toggle
+ @chart.gridline_toggle
+ self
+ end
+ end
+
+ #################
+
+ class Legend < TkObject
+ LegendID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ LegendID_TBL.mutex.synchronize{ LegendID_TBL.clear }
+ }
+
+ def self.new(chart, keys={})
+ obj = nil
+ LegenedID_TBL.mutex.synchronize{
+ unless (obj = LegenedID_TBL[chart.path])
+ (obj = self.allocate).instance_eval{
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @path = @id = 'crosshairs'
+ Legend::LegenedID_TBL[@cpath] = self
+ }
+ end
+ }
+ chart.legend_configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, keys={})
+ # dummy:: not called by 'new' method
+
+ @parent = @chart = chart
+ @cpath = @chart.path
+ # Legend::LegendID_TBL[@cpath] = self
+ @chart.legend_configure(keys) unless keys.empty?
+ @path = @id = 'legend'
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.legend_cget_tkstring(option)
+ end
+ def cget(option)
+ @chart.legend_cget(option)
+ end
+ def cget_strict(option)
+ @chart.legend_cget_strict(option)
+ end
+ def configure(key, value=None)
+ @chart.legend_configure(key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.legend_configinfo(key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_legend_configinfo(key)
+ end
+
+ def activate(*args)
+ @chart.legend_activate(*args)
+ end
+
+ def deactivate(*args)
+ @chart.legend_deactivate(*args)
+ end
+
+ def get(pos, y=nil)
+ @chart.legend_get(pos, y)
+ end
+ end
+
+ #################
+
+ class Pen < TkObject
+ (OBJ_ID = ['blt_chart_pen'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ PenID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ PenID_TBL.mutex.synchronize{ PenID_TBL.clear }
+ }
+
+ def self.id2obj(chart, id)
+ cpath = chart.path
+ PenID_TBL.mutex.synchronize{
+ return id unless PenID_TBL[cpath]
+ PenID_TBL[cpath][id]? PenID_TBL[cpath][id]: id
+ }
+ end
+
+ def self.new(chart, pen=nil, keys={})
+ if pen.kind_of?(Hash)
+ keys = pen
+ pen = nil
+ end
+ if keys
+ keys = _symbolkey2str(keys)
+ not_create = keys.delete('without_creating')
+ else
+ not_create = false
+ end
+
+ obj = nil
+ PenID_TBL.mutex.synchronize{
+ chart_path = chart.path
+ PenID_TBL[chart_path] ||= {}
+ if pen && PenID_TBL[chart_path][pen]
+ obj = PenID_TBL[chart_path][pen]
+ else
+ (obj = self.allocate).instance_eval{
+ if pen
+ @pen = @id = pen.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @pen = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ Pen::PenID_TBL[@cpath][@pen] = self
+ unless not_create
+ tk_call(@chart, 'pen', 'create', @pen, keys)
+ return obj
+ end
+ }
+ end
+ }
+
+ obj.configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, pen=nil, keys={})
+ if pen.kind_of?(Hash)
+ keys = pen
+ pen = nil
+ end
+ if pen
+ @pen = @id = pen.to_s
+ else
+ OBJ_ID.mutex.synchronize{
+ @pen = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
+ OBJ_ID[1].succ!
+ }
+ end
+ @path = @id
+ @parent = @chart = chart
+ @cpath = @chart.path
+ Pen::PenID_TBL[@cpath][@pen] = self
+ keys = _symbolkey2str(keys)
+ unless keys.delete('without_creating')
+ # @chart.pen_create(@pen, keys)
+ tk_call(@chart, 'pen', 'create', @pen, keys)
+ end
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.pen_cget_tkstring(@id, option)
+ end
+ def cget(option)
+ @chart.pen_cget(@id, option)
+ end
+ def cget_strict(option)
+ @chart.pen_cget_strict(@id, option)
+ end
+ def configure(key, value=None)
+ @chart.pen_configure(@id, key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.pen_configinfo(@id, key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_pen_configinfo(@id, key)
+ end
+
+ def delete
+ @chart.pen_delete(@id)
+ self
+ end
+
+ def name
+ @pen
+ end
+ end
+
+ #################
+
+ class Postscript < TkObject
+ PostscriptID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ PostscriptID_TBL.mutex.synchronize{ PostscriptID_TBL.clear }
+ }
+
+ def self.new(chart, keys={})
+ obj = nil
+ PostscriptID_TBL.mutex.synchronize{
+ unless (obj = PostscriptID_TBL[chart.path])
+ (obj = self.allocate).instance_eval{
+ @parent = @chart = chart
+ @cpath = @chart.path
+ @path = @id = 'postscript'
+ Postscript::PostscriptID_TBL[@cpath] = self
+ }
+ end
+ }
+ chart.postscript_configure(keys) if obj && ! keys.empty?
+ obj
+ end
+
+ def initialize(chart, keys={})
+ # dummy:: not called by 'new' method
+
+ @parent = @chart = chart
+ @cpath = @chart.path
+ # Postscript::PostscriptID_TBL[@cpath] = self
+ @chart.postscript_configure(keys) unless keys.empty?
+ @path = @id = 'postscript'
+ end
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.postscript_cget_tkstring(option)
+ end
+ def cget(option)
+ @chart.postscript_cget(option)
+ end
+ def cget_strict(option)
+ @chart.postscript_cget_strict(option)
+ end
+ def configure(key, value=None)
+ @chart.postscript_configure(key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.postscript_configinfo(key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_postscript_configinfo(key)
+ end
+
+ def output(file=nil, keys={})
+ if file.kind_of?(Hash)
+ keys = file
+ file = nil
+ end
+
+ ret = @chart.postscript_output(file, keys)
+
+ if file
+ self
+ else
+ ret
+ end
+ end
+ end
+
+ #################
+ class Marker < TkObject
+ extend Tk
+ extend TkItemFontOptkeys
+ extend TkItemConfigOptkeys
+
+ extend Tk::BLT::PlotComponent::OptKeys
+
+ MarkerTypeName = nil
+ MarkerTypeToClass = {}
+ MarkerID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ MarkerID_TBL.mutex.synchronize{ MarkerID_TBL.clear }
+ }
+
+ def Marker.type2class(type)
+ MarkerTypeToClass[type]
+ end
+
+ def Marker.id2obj(chart, id)
+ cpath = chart.path
+ MarkerID_TBL.mutex.synchronize{
+ if MarkerID_TBL[cpath]
+ MarkerID_TBL[cpath][id]? MarkerID_TBL[cpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def self._parse_create_args(keys)
+ fontkeys = {}
+ methodkeys = {}
+ if keys.kind_of? Hash
+ keys = _symbolkey2str(keys)
+
+ __item_font_optkeys(nil).each{|key|
+ fkey = key.to_s
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "kanji#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "latin#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+
+ fkey = "ascii#{key}"
+ fontkeys[fkey] = keys.delete(fkey) if keys.key?(fkey)
+ }
+
+ __item_optkey_aliases(nil).each{|alias_name, real_name|
+ alias_name = alias_name.to_s
+ if keys.has_key?(alias_name)
+ keys[real_name.to_s] = keys.delete(alias_name)
+ end
+ }
+
+ __item_methodcall_optkeys(nil).each{|key|
+ key = key.to_s
+ methodkeys[key] = keys.delete(key) if keys.key?(key)
+ }
+
+ __item_ruby2val_optkeys(nil).each{|key, method|
+ key = key.to_s
+ keys[key] = method.call(keys[key]) if keys.has_key?(key)
+ }
+
+ args = itemconfig_hash_kv(nil, keys)
+ else
+ args = []
+ end
+
+ [args, fontkeys, methodkeys]
+ end
+ private_class_method :_parse_create_args
+
+ def self.create(chart, keys={})
+ unless self::MarkerTypeName
+ fail RuntimeError, "#{self} is an abstract class"
+ end
+ args, fontkeys, methodkeys = _parse_create_args(keys)
+ idnum = tk_call_without_enc(chart.path, 'marker', 'create',
+ self::MarkerTypeName, *args)
+ chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
+ chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
+ idnum.to_i # 'item id' is an integer number
+ end
+
+ def self.create_type(chart, type, keys={})
+ args, fontkeys, methodkeys = _parse_create_args(keys)
+ idnum = tk_call_without_enc(chart.path, 'marker', 'create',
+ type, *args)
+ chart.marker_configure(idnum, fontkeys) unless fontkeys.empty?
+ chart.marker_configure(idnum, methodkeys) unless methodkeys.empty?
+ id = idnum.to_i # 'item id' is an integer number
+ obj = self.allocate
+ obj.instance_eval{
+ @parent = @chart = chart
+ @cpath = chart.path
+ @id = id
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL.mutex.synchronize{
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] ||= {}
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
+ }
+ }
+ obj
+ end
+
+ def initialize(parent, *args)
+ @parent = @chart = parent
+ @cpath = parent.path
+
+ @path = @id = create_self(*args) # an integer number as 'item id'
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL.mutex.synchronize{
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath] ||= {}
+ Tk::BLT::PlotComponent::Marker::MarkerID_TBL[@cpath][@id] = self
+ }
+ end
+ def create_self(*args)
+ self.class.create(@chart, *args) # return an integer as 'item id'
+ end
+ private :create_self
+
+ def id
+ @id
+ end
+
+ def to_eval
+ @id
+ end
+
+ def cget_tkstring(option)
+ @chart.marker_cget_tkstring(@id, option)
+ end
+ def cget(option)
+ @chart.marker_cget(@id, option)
+ end
+ def cget_strict(option)
+ @chart.marker_cget_strict(@id, option)
+ end
+ def configure(key, value=None)
+ @chart.marker_configure(@id, key, value)
+ self
+ end
+ def configinfo(key=nil)
+ @chart.marker_configinfo(@id, key)
+ end
+ def current_configinfo(key=nil)
+ @chart.current_marker_configinfo(@id, key)
+ end
+
+ def after(target=None)
+ @chart.marker_after(@id, target)
+ end
+
+ def before(target=None)
+ @chart.marker_before(@id, target)
+ end
+
+ def delete
+ @chart.marker_delete(@id)
+ end
+
+ def exist?
+ @chart.marker_exist(@id)
+ end
+
+ def type
+ @chart.marker_type(@id)
+ end
+ end
+
+ class TextMarker < Marker
+ MarkerTypeName = 'text'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+ class LineMarker < Marker
+ MarkerTypeName = 'line'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+ class BitmapMarker < Marker
+ MarkerTypeName = 'bitmap'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+ class ImageMarker < Marker
+ MarkerTypeName = 'image'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+ class PolygonMarker < Marker
+ MarkerTypeName = 'polygon'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+ class WindowMarker < Marker
+ MarkerTypeName = 'window'.freeze
+ MarkerTypeToClass[MarkerTypeName] = self
+ end
+
+ #################
+
+ def __destroy_hook__
+ Axis::AxisID_TBL.delete(@path)
+ Crosshairs::CrosshairsID_TBL.delete(@path)
+ Element::ElementID_TBL.delete(@path)
+ GridLine::GridLineID_TBL.delete(@path)
+ Legend::LegendID_TBL.delete(@path)
+ Pen::PenID_TBL.delete(@path)
+ Postscript::PostscriptID_TBL.delete(@path)
+ Marker::MarkerID_TBL.delete(@path)
+ super()
+ end
+
+ #################
+
+ def tagid(tag)
+ if tag.kind_of?(Axis) ||
+ tag.kind_of?(Crosshairs) ||
+ tag.kind_of?(Element) ||
+ tag.kind_of?(GridLine) ||
+ tag.kind_of?(Legend) ||
+ tag.kind_of?(Pen) ||
+ tag.kind_of?(Postscript) ||
+ tag.kind_of?(Marker)
+ tag.id
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+
+ def _component_bind(target, tag, context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, target, 'bind', tagid(tag)], context, cmd, *args)
+ self
+ end
+ def _component_bind_append(target, tag, context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, target, 'bind', tagid(tag)], context, cmd, *args)
+ self
+ end
+ def _component_bind_remove(target, tag, context)
+ _bind_remove([path, target, 'bind', tagid(tag)], context)
+ self
+ end
+ def _component_bindinfo(target, tag, context=nil)
+ _bindinfo([path, target, 'bind', tagid(tag)], context)
+ end
+ private :_component_bind, :_component_bind_append
+ private :_component_bind_remove, :_component_bindinfo
+
+ def axis_bind(tag, context, *args)
+ _component_bind('axis', tag, context, *args)
+ end
+ def axis_bind_append(tag, context, *args)
+ _component_bind_append('axis', tag, context, *args)
+ end
+ def axis_bind_remove(tag, context)
+ _component_bind_remove('axis', tag, context)
+ end
+ def axis_bindinfo(tag, context=nil)
+ _component_bindinfo('axis', tag, context)
+ end
+
+ def element_bind(tag, context, *args)
+ _component_bind('element', tag, context, *args)
+ end
+ def element_bind_append(tag, context, *args)
+ _component_bind_append('element', tag, context, *args)
+ end
+ def element_bind_remove(tag, context)
+ _component_bind_remove('element', tag, context)
+ end
+ def element_bindinfo(tag, context=nil)
+ _component_bindinfo('element', tag, context)
+ end
+
+ def bar_bind(tag, context, *args)
+ _component_bind('bar', tag, context, *args)
+ end
+ def bar_bind_append(tag, context, *args)
+ _component_bind_append('bar', tag, context, *args)
+ end
+ def bar_bind_remove(tag, context)
+ _component_bind_remove('bar', tag, context)
+ end
+ def bar_bindinfo(tag, context=nil)
+ _component_bindinfo('bar', tag, context)
+ end
+
+ def line_bind(tag, context, *args)
+ _component_bind('line', tag, context, *args)
+ end
+ def line_bind_append(tag, context, *args)
+ _component_bind_append('line', tag, context, *args)
+ end
+ def line_bind_remove(tag, context)
+ _component_bind_remove('line', tag, context)
+ end
+ def line_bindinfo(tag, context=nil)
+ _component_bindinfo('line', tag, context)
+ end
+
+ def legend_bind(tag, context, *args)
+ _component_bind('legend', tag, context, *args)
+ end
+ def legend_bind_append(tag, context, *args)
+ _component_bind_append('legend', tag, context, *args)
+ end
+ def legend_bind_remove(tag, context)
+ _component_bind_remove('legend', tag, context)
+ end
+ def legend_bindinfo(tag, context=nil)
+ _component_bindinfo('legend', tag, context)
+ end
+
+ def marker_bind(tag, context, *args)
+ _component_bind('marker', tag, context, *args)
+ end
+ def marker_bind_append(tag, context, *args)
+ _component_bind_append('marker', tag, context, *args)
+ end
+ def marker_bind_remove(tag, context)
+ _component_bind_remove('marker', tag, context)
+ end
+ def marker_bindinfo(tag, context=nil)
+ _component_bindinfo('marker', tag, context)
+ end
+
+ ###################
+
+ def axis_create(id=nil, keys={})
+ # tk_send('axis', 'create', tagid(id), keys)
+ Tk::BLT::PlotComponent::Axis.new(self, tagid(id), keys)
+ end
+ def axis_delete(*ids)
+ tk_send('axis', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def axis_invtransform(id, val)
+ list(tk_send('axis', 'invtransform', tagid(id), val))
+ end
+ def axis_limits(id)
+ list(tk_send('axis', 'limits', tagid(id)))
+ end
+ def axis_names(*pats)
+ simplelist(tk_send('axis', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|axis|
+ Tk::BLT::PlotComponent::Axis.id2obj(self, axis)
+ }
+ end
+ def axis_transform(id, val)
+ list(tk_send('axis', 'transform', tagid(id), val))
+ end
+ def axis_view(id)
+ tk_send('axis', 'view', tagid(id))
+ self
+ end
+ def axis_use(id, target=nil)
+ if target
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('axis', 'use',
+ tagid(id), tagid(target)))
+ else
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('axis', 'use', tagid(id)))
+ end
+ end
+
+ ###################
+
+ def crosshairs_off
+ tk_send_without_enc('crosshairs', 'off')
+ self
+ end
+ def crosshairs_on
+ tk_send_without_enc('crosshairs', 'on')
+ self
+ end
+ def crosshairs_toggle
+ tk_send_without_enc('crosshairs', 'toggle')
+ self
+ end
+
+ ###################
+
+ def element_create(id=nil, keys={})
+ # tk_send('element', 'create', tagid(id), keys)
+ Tk::BLT::PlotComponent::Element.new(self, tagid(id), keys)
+ end
+ def element_activate(*args)
+ if args.empty?
+ list(tk_send('element', 'activate')).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ else
+ # id, *indices
+ id = args.shift
+ tk_send('element', 'activate', tagid(id), *args)
+ end
+ end
+ def element_closest(x, y, var, *args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ bool(tk_send('element', 'closest', x, y, var,
+ *(hash_kv(keys).concat(args.collect{|id| tagid(id)}))))
+ else
+ bool(tk_send('element', 'closest', x, y, var,
+ *(args.collect{|id| tagid(id)})))
+ end
+ end
+ def element_deactivate(*ids)
+ tk_send('element', 'deactivate', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def element_delete(*ids)
+ tk_send('element', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def element_exist?(id)
+ bool(tk_send('element', 'exists', tagid(id)))
+ end
+ def element_names(*pats)
+ simplelist(tk_send('element', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ end
+ def element_show(*names)
+ if names.empty?
+ simplelist(tk_send('element', 'show'))
+ else
+ tk_send('element', 'show', *(names.collect{|n| tagid(n)}))
+ self
+ end
+ end
+ def element_type(id)
+ tk_send('element', 'type', tagid(id))
+ end
+
+ ###################
+
+ def bar_create(id=nil, keys={})
+ # tk_send('bar', 'create', tagid(id), keys)
+ Tk::BLT::PlotComponent::Bar.new(self, tagid(id), keys)
+ end
+ alias bar bar_create
+ def bar_activate(*args)
+ if args.empty?
+ list(tk_send('bar', 'activate')).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ else
+ # id, *indices
+ id = args.shift
+ tk_send('bar', 'activate', tagid(id), *args)
+ end
+ end
+ def bar_closest(x, y, var, *args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ bool(tk_send('bar', 'closest', x, y, var,
+ *(hash_kv(keys).concat(args.collect{|id| tagid(id)}))))
+ else
+ bool(tk_send('bar', 'closest', x, y, var,
+ *(args.collect{|id| tagid(id)})))
+ end
+ end
+ def bar_deactivate(*ids)
+ tk_send('bar', 'deactivate', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def bar_delete(*ids)
+ tk_send('bar', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def bar_exist?(id)
+ bool(tk_send('bar', 'exists', tagid(id)))
+ end
+ def bar_names(*pats)
+ simplelist(tk_send('bar', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ end
+ def bar_show(*names)
+ if names.empty?
+ simplelist(tk_send('bar', 'show'))
+ else
+ tk_send('bar', 'show', *(names.collect{|n| tagid(n)}))
+ self
+ end
+ end
+ def bar_type(id)
+ tk_send('bar', 'type', tagid(id))
+ end
+
+ ###################
+
+ def line_create(id=nil, keys={})
+ # tk_send('line', 'create', tagid(id), keys)
+ Tk::BLT::PlotComponent::Line.new(self, tagid(id), keys)
+ end
+ alias bar line_create
+ def line_activate(*args)
+ if args.empty?
+ list(tk_send('line', 'activate')).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ else
+ # id, *indices
+ id = args.shift
+ tk_send('line', 'activate', tagid(id), *args)
+ end
+ end
+ def line_closest(x, y, var, *args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ bool(tk_send('line', 'closest', x, y, var,
+ *(hash_kv(keys).concat(args.collect{|id| tagid(id)}))))
+ else
+ bool(tk_send('line', 'closest', x, y, var,
+ *(args.collect{|id| tagid(id)})))
+ end
+ end
+ def line_deactivate(*ids)
+ tk_send('line', 'deactivate', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def line_delete(*ids)
+ tk_send('line', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def line_exist?(id)
+ bool(tk_send('line', 'exists', tagid(id)))
+ end
+ def line_names(*pats)
+ simplelist(tk_send('line', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ end
+ def line_show(*names)
+ if names.empty?
+ simplelist(tk_send('line', 'show'))
+ else
+ tk_send('line', 'show', *(names.collect{|n| tagid(n)}))
+ self
+ end
+ end
+ def line_type(id)
+ tk_send('line', 'type', tagid(id))
+ end
+
+ ###################
+
+ def gridline_off
+ tk_send_without_enc('grid', 'off')
+ self
+ end
+ def gridline_on
+ tk_send_without_enc('grid', 'on')
+ self
+ end
+ def gridline_toggle
+ tk_send_without_enc('grid', 'toggle')
+ self
+ end
+
+ ###################
+
+ def legend_window_create(parent=nil, keys=nil)
+ if parent.kind_of?(Hash)
+ keys = _symbolkey2str(parent)
+ parent = keys.delete('parent')
+ widgetname = keys.delete('widgetname')
+ keys.delete('without_creating')
+ elsif keys
+ keys = _symbolkey2str(keys)
+ widgetname = keys.delete('widgetname')
+ keys.delete('without_creating')
+ end
+
+ legend = self.class.new(parent, :without_creating=>true,
+ :widgetname=>widgetname)
+ class << legend
+ def __destroy_hook__
+ TkCore::INTERP.tk_windows.delete(@path)
+ end
+ end
+
+ if keys
+ self.legend_configure(keys.update('position'=>legend))
+ else
+ self.legend_configure('position'=>legend)
+ end
+ legend
+ end
+
+ def legend_activate(*pats)
+ list(tk_send('legend', 'activate',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ end
+ def legend_deactivate(*pats)
+ list(tk_send('legend', 'deactivate',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|elem|
+ Tk::BLT::PlotComponent::Element.id2obj(self, elem)
+ }
+ end
+ def legend_get(pos, y=nil)
+ if y
+ Tk::BLT::PlotComponent::Element.id2obj(self,
+ tk_send('legend', 'get',
+ _at(pos, y)))
+ else
+ Tk::BLT::PlotComponent::Element.id2obj(self,
+ tk_send('legend', 'get', pos))
+ end
+ end
+
+ ###################
+
+ def pen_create(id=nil, keys={})
+ # tk_send('pen', 'create', tagid(id), keys)
+ Tk::BLT::PlotComponent::Pen.new(self, tagid(id), keys)
+ end
+ def pen_delete(*ids)
+ tk_send('pen', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def pen_names(*pats)
+ simplelist(tk_send('pen', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|pen|
+ Tk::BLT::PlotComponent::Pen.id2obj(self, pen)
+ }
+ end
+
+ ###################
+
+ def postscript_output(file=nil, keys={})
+ if file.kind_of?(Hash)
+ keys = file
+ file = nil
+ end
+
+ if file
+ tk_send('postscript', 'output', file, keys)
+ self
+ else
+ tk_send('postscript', 'output', keys)
+ end
+ end
+
+ ###################
+
+ def marker_create(type, keys={})
+ case type
+ when :text, 'text'
+ Tk::BLT::PlotComponent::TextMarker.new(self, keys)
+ when :line, 'line'
+ Tk::BLT::PlotComponent::LineMarker.new(self, keys)
+ when :bitmap, 'bitmap'
+ Tk::BLT::PlotComponent::BitmapMarker.new(self, keys)
+ when :image, 'image'
+ Tk::BLT::PlotComponent::ImageMarker.new(self, keys)
+ when :polygon, 'polygon'
+ Tk::BLT::PlotComponent::PolygonMarker.new(self, keys)
+ when :window, 'window'
+ Tk::BLT::PlotComponent::WindowMarker.new(self, keys)
+ else
+ if type.kind_of?(Tk::BLT::PlotComponent::Marker)
+ type.new(self, keys)
+ else
+ Tk::BLT::PlotComponent::Marker.create_type(self, type, keys)
+ end
+ end
+ end
+ def marker_after(id, target=nil)
+ if target
+ tk_send_without_enc('marker', 'after', tagid(id), tagid(target))
+ else
+ tk_send_without_enc('marker', 'after', tagid(id))
+ end
+ self
+ end
+ def marker_before(id, target=None)
+ if target
+ tk_send_without_enc('marker', 'before', tagid(id), tagid(target))
+ else
+ tk_send_without_enc('marker', 'before', tagid(id))
+ end
+ self
+ end
+ def marker_delete(*ids)
+ tk_send('marker', 'delete', *(ids.collect{|id| tagid(id)}))
+ self
+ end
+ def marker_exist?(id)
+ bool(tk_send('marker', 'exists', tagid(id)))
+ end
+ def marker_names(*pats)
+ simplelist(tk_send('marker', 'names',
+ *(pats.collect{|pat| tagid(pat)}))).collect{|id|
+ Tk::BLT::PlotComponent::Marker.id2obj(self, id)
+ }
+ end
+ def marker_type(id)
+ tk_send('marker', 'type', tagid(id))
+ end
+
+ ###################
+
+ def xaxis_cget_tkstring(option)
+ itemcget_tkstring('xaxis', option)
+ end
+ def xaxis_cget(option)
+ itemcget('xaxis', option)
+ end
+ def xaxis_cget_strict(option)
+ itemcget_strict('xaxis', option)
+ end
+ def xaxis_configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ if cmd = slot.delete('command')
+ slot['command'] = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ elsif slot == :command || slot == 'command'
+ cmd = value
+ value = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ itemconfigure('xaxis', slot, value)
+ end
+ def xaxis_configinfo(slot=nil)
+ itemconfiginfo('xaxis', slot)
+ end
+ def current_xaxis_configinfo(slot=nil)
+ current_itemconfiginfo('xaxis', slot)
+ end
+ def xaxis_bind(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'xaxis', 'bind'], context, cmd, *args)
+ self
+ end
+ def xaxis_bind_append(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'xaxis', 'bind'], context, cmd, *args)
+ self
+ end
+ def xaxis_bind_remove(context)
+ _bind_remove([path, 'xaxis', 'bind'], context)
+ self
+ end
+ def xaxis_bindinfo(context=nil)
+ _bindinfo([path, 'xaxis', 'bind'], context)
+ end
+ def xaxis_invtransform(val)
+ list(tk_send('xaxis', 'invtransform', val))
+ end
+ def xaxis_limits
+ list(tk_send('xaxis', 'limits'))
+ end
+ def xaxis_transform(val)
+ list(tk_send('xaxis', 'transform', val))
+ end
+ def xaxis_use(target=nil)
+ if target
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('xaxis', 'use',
+ tagid(target)))
+ else
+ Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('xaxis', 'use'))
+ end
+ end
+
+ def x2axis_cget_tkstring(option)
+ itemcget_tkstring('x2axis', option)
+ end
+ def x2axis_cget(option)
+ itemcget('x2axis', option)
+ end
+ def x2axis_cget_strict(option)
+ itemcget_strict('x2axis', option)
+ end
+ def x2axis_configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ if cmd = slot.delete('command')
+ slot['command'] = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ elsif slot == :command || slot == 'command'
+ cmd = value
+ value = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ itemconfigure('x2axis', slot, value)
+ end
+ def x2axis_configinfo(slot=nil)
+ itemconfiginfo('x2axis', slot)
+ end
+ def current_x2axis_configinfo(slot=nil)
+ current_itemconfiginfo('x2axis', slot)
+ end
+ def x2axis_bind(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'x2axis', 'bind'], context, cmd, *args)
+ self
+ end
+ def x2axis_bind_append(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'x2axis', 'bind'], context, cmd, *args)
+ self
+ end
+ def x2axis_bind_remove(context)
+ _bind_remove([path, 'x2axis', 'bind'], context)
+ self
+ end
+ def x2axis_bindinfo(context=nil)
+ _bindinfo([path, 'x2axis', 'bind'], context)
+ end
+ def x2axis_invtransform(val)
+ list(tk_send('x2axis', 'invtransform', val))
+ end
+ def x2axis_limits
+ list(tk_send('x2axis', 'limits'))
+ end
+ def x2axis_transform(val)
+ list(tk_send('x2axis', 'transform', val))
+ end
+ def x2axis_use(target=nil)
+ if target
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('x2axis', 'use',
+ tagid(target)))
+ else
+ Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('x2axis', 'use'))
+ end
+ end
+
+ def yaxis_cget_tkstring(option)
+ itemcget_tkstring('yaxis', option)
+ end
+ def yaxis_cget(option)
+ itemcget('yaxis', option)
+ end
+ def yaxis_cget_strict(option)
+ itemcget_strict('yaxis', option)
+ end
+ def yaxis_configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ if cmd = slot.delete('command')
+ slot['command'] = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ elsif slot == :command || slot == 'command'
+ cmd = value
+ value = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ itemconfigure('yaxis', slot, value)
+ end
+ def yaxis_configinfo(slot=nil)
+ itemconfiginfo('yaxis', slot)
+ end
+ def current_yaxis_configinfo(slot=nil)
+ current_itemconfiginfo('yaxis', slot)
+ end
+ def yaxis_bind(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'yaxis', 'bind'], context, cmd, *args)
+ self
+ end
+ def yaxis_bind_append(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'yaxis', 'bind'], context, cmd, *args)
+ self
+ end
+ def yaxis_bind_remove(context)
+ _bind_remove([path, 'yaxis', 'bind'], context)
+ self
+ end
+ def yaxis_bindinfo(context=nil)
+ _bindinfo([path, 'yaxis', 'bind'], context)
+ end
+ def yaxis_invtransform(val)
+ list(tk_send('yaxis', 'invtransform', val))
+ end
+ def yaxis_limits
+ list(tk_send('yaxis', 'limits'))
+ end
+ def yaxis_transform(val)
+ list(tk_send('yaxis', 'transform', val))
+ end
+ def yaxis_use(target=nil)
+ if target
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('yaxis', 'use',
+ tagid(target)))
+ else
+ Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('yaxis', 'use'))
+ end
+ end
+
+ def y2axis_cget_tkstring(option)
+ itemcget_tkstring('y2axis', option)
+ end
+ def y2axis_cget(option)
+ itemcget('y2axis', option)
+ end
+ def y2axis_cget_strict(option)
+ itemcget_strict('y2axis', option)
+ end
+ def y2axis_configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ if cmd = slot.delete('command')
+ slot['command'] = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ elsif slot == :command || slot == 'command'
+ cmd = value
+ value = proc{|w, tick|
+ cmd.call(TkComm.window(w), TkComm.num_or_str(tick))
+ }
+ end
+ itemconfigure('y2axis', slot, value)
+ end
+ def y2axis_configinfo(slot=nil)
+ axis_configinfo('y2axis', slot)
+ end
+ def current_y2axis_configinfo(slot=nil)
+ current_itemconfiginfo('y2axis', slot)
+ end
+ def y2axis_bind(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'y2axis', 'bind'], context, cmd, *args)
+ self
+ end
+ def y2axis_bind_append(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'y2axis', 'bind'], context, cmd, *args)
+ self
+ end
+ def y2axis_bind_remove(context)
+ _bind_remove([path, 'y2axis', 'bind'], context)
+ self
+ end
+ def y2axis_bindinfo(context=nil)
+ _bindinfo([path, 'y2axis', 'bind'], context)
+ end
+ def y2axis_invtransform(val)
+ list(tk_send('y2axis', 'invtransform', val))
+ end
+ def y2axis_limits
+ list(tk_send('y2axis', 'limits'))
+ end
+ def y2axis_transform(val)
+ list(tk_send('y2axis', 'transform', val))
+ end
+ def y2axis_use(target=nil)
+ if target
+ Tk::BLT::PlotComponent::Axis.id2obj(self,
+ tk_send('y2axis', 'use',
+ tagid(target)))
+ else
+ Tk::BLT::PlotComponent::Axis.id2obj(self, tk_send('y2axis', 'use'))
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/container.rb b/ext/tk/lib/tkextlib/blt/container.rb
new file mode 100644
index 0000000000..be05828d95
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/container.rb
@@ -0,0 +1,28 @@
+#
+# tkextlib/blt/container.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Container < TkWindow
+ TkCommandNames = ['::blt::container'.freeze].freeze
+ WidgetClassName = 'Container'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'name'
+ end
+ private :__strval_optkeys
+
+ def find_command(pat)
+ Hash[*simplelist(tk_send_without_enc('find', '-command', pat))]
+ end
+
+ def find_name(pat)
+ Hash[*simplelist(tk_send_without_enc('find', '-name', pat))]
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/cutbuffer.rb b/ext/tk/lib/tkextlib/blt/cutbuffer.rb
new file mode 100644
index 0000000000..1cc39dfb94
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/cutbuffer.rb
@@ -0,0 +1,23 @@
+#
+# tkextlib/blt/cutbuffer.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module CutBuffer
+ TkCommandNames = ['::blt::cutbuffer'.freeze].freeze
+
+ def self.get(num = 0)
+ Tk.tk_call('::blt::cutbuffer', 'get', num)
+ end
+ def self.rotate(count = 1)
+ Tk.tk_call('::blt::cutbuffer', 'rotate', count)
+ end
+ def self.set(val, num = 0)
+ Tk.tk_call('::blt::cutbuffer', 'set', val, num)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/dragdrop.rb b/ext/tk/lib/tkextlib/blt/dragdrop.rb
new file mode 100644
index 0000000000..aa5c5654c2
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/dragdrop.rb
@@ -0,0 +1,269 @@
+#
+# tkextlib/blt/dragdrop.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/itemconfig'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module DragDrop
+ extend TkCore
+
+ TkCommandNames = ['::blt::drag&drop'.freeze].freeze
+
+ class Token < TkWindow
+ WidgetClassName = 'DragDropToken'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def initialize(arg)
+ if arg.kind_of?(Hash) # arg is a hash includes the widgetpath of token
+ arg = _symbolkey2str(arg)
+ install_win(nil, arg['widgetname'])
+ else # arg is a drag&drop source
+ tk_call('::blt::drag&drop', 'source', arg)
+ install_win(nil, tk_call('::blt::drag&drop', 'token', arg))
+ end
+ end
+ end
+
+ ###################################
+
+ extend TkItemConfigMethod
+ extend Tk::ValidateConfigure
+
+ class << self
+ def __item_config_cmd(id) # id := ['source'|'target', win]
+ ['::blt::drag&drop', id[0], id[1]]
+ end
+ private :__item_config_cmd
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'selftarget'
+ end
+ private :__item_boolval_optkeys
+
+ def __item_listval_optkeys(id)
+ super(id) << 'send'
+ end
+ private :__item_listval_optkeys
+
+ def __item_strval_optkeys(id)
+ super(id) << 'rejectbg' << 'rejectfg' << 'tokenbg'
+ end
+ private :__item_strval_optkeys
+
+ undef itemcget
+ undef itemcget_tkstring
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ def source_configure(win, slot, value=None)
+ itemconfigure(['source', win], slot, value)
+ end
+ def source_configinfo(win, slot=nil)
+ itemconfiginfo(['source', win], slot)
+ end
+ def current_source_configinfo(win, slot=nil)
+ current_itemconfiginfo(['source', win], slot)
+ end
+ end
+
+ class PackageCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?t, ?w, :token ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL)
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ ['packagecmd']
+ end
+ end
+
+ class SiteCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?s, ?b, :compatible ],
+ [ ?t, ?w, :token ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?b, TkComm.method(:bool) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL)
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ ['sitecmd']
+ end
+ end
+
+ def self.__validation_class_list
+ super() << PackageCommand << SiteCommand
+ end
+
+ class << self
+ Tk::ValidateConfigure.__def_validcmd(binding, PackageCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, SiteCommand)
+ end
+
+ ###################################
+
+ class DnD_Handle < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?i, ?s, :ip_name ],
+ [ ?v, ?v, :value ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?i, TkComm.method(:string) ],
+ [ ?v, TkComm.method(:tk_tcl2ruby) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL)
+ end
+
+ def self.source_handler(win, datatype, cmd=Proc.new, *args)
+ _bind_for_event_class(DnD_Handle,
+ ['::blt::drag&drop', 'source', win, 'handler'],
+ cmd, *args)
+ end
+
+ def self.target_handler(win, datatype, cmd=Proc.new, *args)
+ _bind_for_event_class(DnD_Handle,
+ ['::blt::drag&drop', 'target', win, 'handler'],
+ cmd, *args)
+ end
+
+ ###################################
+
+ def self.init_source(win)
+ tk_call('::blt::drag&drop', 'source', win)
+ end
+
+ def self.source()
+ list(tk_call('::blt::drag&drop', 'source'))
+ end
+
+ def self.source_handler_list(win)
+ simplelist(tk_call('::blt::drag&drop', 'source', win, 'handler'))
+ end
+ def self.source_handler_info(win, type)
+ tk_tcl2ruby(tk_call('::blt::drag&drop', 'source', win, 'handler', type))
+ end
+
+ def self.target
+ list(tk_call('::blt::drag&drop', 'target'))
+ end
+ def self.target_handler_list(win)
+ simplelist(tk_call('::blt::drag&drop', 'target', win, 'handler'))
+ end
+
+ def self.handle_target(win, type, val=None)
+ tk_call('::blt::drag&drop', 'target', win, 'handle', type, val)
+ end
+
+ def self.token(win)
+ window(tk_call('::blt::drag&drop', 'token', win))
+ end
+
+ def self.drag(win, x, y)
+ tk_call('::blt::drag&drop', 'drag', win, x, y)
+ end
+ def self.drop(win, x, y)
+ tk_call('::blt::drag&drop', 'drop', win, x, y)
+ end
+
+ def self.errors(cmd=Proc.new)
+ tk_call('::blt::drag&drop', 'errors', cmd)
+ end
+
+ def self.active
+ bool(tk_call('::blt::drag&drop', 'active'))
+ end
+
+ def self.location(x=None, y=None)
+ list(tk_call('::blt::drag&drop', 'location', x, y))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/eps.rb b/ext/tk/lib/tkextlib/blt/eps.rb
new file mode 100644
index 0000000000..0dba87a7cc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/eps.rb
@@ -0,0 +1,32 @@
+#
+# tkextlib/blt/eps.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/canvas'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class EPS < TkcItem
+ CItemTypeName = 'eps'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ end
+end
+
+class Tk::Canvas
+ alias __BLT_EPS_item_strval_optkeys __item_strval_optkeys
+ def __item_strval_optkeys(id)
+ __BLT_EPS_item_strval_optkeys(id) + [
+ 'shadowcolor', 'title', 'titlecolor'
+ ]
+ end
+ private :__item_strval_optkeys
+
+ alias __BLT_EPS_item_boolval_optkeys __item_boolval_optkeys
+ def __item_boolval_optkeys(id)
+ __BLT_EPS_item_boolval_optkeys(id) + ['showimage']
+ end
+ private :__item_boolval_optkeys
+end
+
diff --git a/ext/tk/lib/tkextlib/blt/graph.rb b/ext/tk/lib/tkextlib/blt/graph.rb
new file mode 100644
index 0000000000..6bd4424065
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/graph.rb
@@ -0,0 +1,67 @@
+#
+# tkextlib/blt/graph.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+require 'tkextlib/blt/component.rb'
+
+module Tk::BLT
+ class Graph < TkWindow
+ TkCommandNames = ['::blt::graph'.freeze].freeze
+ WidgetClassName = 'Graph'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include PlotComponent
+ include GraphCommand
+
+ def __boolval_optkeys
+ ['bufferelements', 'invertxy']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ ['text', 'label', 'title', 'file', 'plotbackground']
+ end
+ private :__strval_optkeys
+
+=begin
+ BarElement_ID = ['blt_graph_bar'.freeze, TkUtil.untrust('00000')].freeze
+
+ def bar(elem=nil, keys={})
+ if elem.kind_of?(Hash)
+ keys = elem
+ elem = nil
+ end
+ unless elem
+ elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
+ BarElement_ID[1].succ!
+ end
+ tk_send('bar', elem, keys)
+ Element.new(self, elem, :without_creating=>true)
+ end
+=end
+
+ def extents(item)
+ num_or_str(tk_send_without_enc('extents', item))
+ end
+
+ def invtransform(x, y)
+ list(tk_send_without_enc('invtransform', x, y))
+ end
+
+ def inside(x, y)
+ bool(tk_send_without_enc('inside', x, y))
+ end
+
+ def snap(output, keys={})
+ tk_send_without_enc('snap', *(hash_kv(keys, false) + output))
+ self
+ end
+
+ def transform(x, y)
+ list(tk_send_without_enc('transform', x, y))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/htext.rb b/ext/tk/lib/tkextlib/blt/htext.rb
new file mode 100644
index 0000000000..878bd9982d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/htext.rb
@@ -0,0 +1,112 @@
+#
+# tkextlib/blt/htext.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/itemconfig.rb'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Htext<TkWindow
+ Htext_Var = TkVarAccess.new_hash('htext')
+ Htext_Widget = TkVarAccess.new('htext(widget)', :window)
+ Htext_File = TkVarAccess.new('htext(file)')
+ Htext_Line = TkVarAccess.new('htext(line)')
+
+ include TkItemConfigMethod
+ include Scrollable
+
+ TkCommandNames = ['::blt::htext'.freeze].freeze
+ WidgetClassName = 'Htext'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ alias window_cget_tkstring itemcget_tkstring
+ alias window_cget itemcget
+ alias window_cget_strict itemcget_strict
+ alias window_configure itemconfigure
+ alias window_configuinfo itemconfiginfo
+ alias current_window_configuinfo current_itemconfiginfo
+
+ def __strval_optkeys
+ super() << 'filename'
+ end
+ private :__strval_optkeys
+
+ def append(win, keys={})
+ tk_send('append', _epath(win), keys)
+ self
+ end
+
+ def goto_line(idx)
+ tk_send_without_enc('gotoline', idx)
+ self
+ end
+ def current_line
+ number(tk_send_without_enc('gotoline'))
+ end
+
+ def index(str)
+ number(tk_send('index', str))
+ end
+
+ def line_pos(str)
+ tk_send('linepos', str)
+ end
+
+ def range(from=None, to=None)
+ tk_send_without_enc('range', from, to)
+ end
+
+ def scan_mark(pos)
+ tk_send_without_enc('scan', 'mark', pos)
+ self
+ end
+
+ def scan_dragto(pos)
+ tk_send_without_enc('scan', 'dragto', pos)
+ self
+ end
+
+ def search(pat, from=None, to=None)
+ num = number(tk_send('search', pat, from, to))
+ (num < 0)? nil: num
+ end
+
+ def selection_adjust(index)
+ tk_send_without_enc('selection', 'adjust', index)
+ self
+ end
+ def selection_clear()
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+ def selection_from(index)
+ tk_send_without_enc('selection', 'from', index)
+ self
+ end
+ def selection_line(index)
+ tk_send_without_enc('selection', 'line', index)
+ self
+ end
+ def selection_present()
+ bool(tk_send_without_enc('selection', 'present'))
+ end
+ def selection_range(first, last)
+ tk_send_without_enc('selection', 'range', first, last)
+ self
+ end
+ def selection_to(index)
+ tk_send_without_enc('selection', 'to', index)
+ self
+ end
+ def selection_word(index)
+ tk_send_without_enc('selection', 'word', index)
+ self
+ end
+
+ def windows(pat=None)
+ list(tk_send('windows', pat))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/setup.rb b/ext/tk/lib/tkextlib/blt/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/blt/spline.rb b/ext/tk/lib/tkextlib/blt/spline.rb
new file mode 100644
index 0000000000..9f75a0b217
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/spline.rb
@@ -0,0 +1,23 @@
+#
+# tkextlib/blt/spline.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Spline
+ extend TkCore
+
+ TkCommandNames = ['::blt::spline'.freeze].freeze
+
+ def self.natural(x, y, sx, sy)
+ tk_call('::blt::spline', 'natural', x, y, sx, sy)
+ end
+
+ def self.quadratic(x, y, sx, sy)
+ tk_call('::blt::spline', 'quadratic', x, y, sx, sy)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/stripchart.rb b/ext/tk/lib/tkextlib/blt/stripchart.rb
new file mode 100644
index 0000000000..74093f1868
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/stripchart.rb
@@ -0,0 +1,74 @@
+#
+# tkextlib/blt/stripchart.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+require 'tkextlib/blt/component.rb'
+
+module Tk::BLT
+ class Stripchart < TkWindow
+ TkCommandNames = ['::blt::stripchart'.freeze].freeze
+ WidgetClassName = 'Stripchart'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include PlotComponent
+ include GraphCommand
+
+ def __boolval_optkeys
+ ['bufferelements', 'buffergraph', 'invertxy']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ ['text', 'label', 'title', 'file',
+ 'background', 'plotbackground']
+ end
+ private :__strval_optkeys
+
+=begin
+ BarElement_ID = ['blt_stripchart_bar'.freeze, TkUtil.untrust('00000')].freeze
+
+ def bar(elem=nil, keys={})
+ if elem.kind_of?(Hash)
+ keys = elem
+ elem = nil
+ end
+ unless elem
+ elem = BarElement_ID.join(TkCore::INTERP._ip_id_).freeze
+ BarElement_ID[1].succ!
+ end
+ tk_send('bar', elem, keys)
+ Element.new(self, elem, :without_creating=>true)
+ end
+=end
+
+ def extents(item)
+ num_or_str(tk_send_without_enc('extents', item))
+ end
+
+ def invtransform(x, y)
+ list(tk_send_without_enc('invtransform', x, y))
+ end
+
+ def inside(x, y)
+ bool(tk_send_without_enc('inside', x, y))
+ end
+
+ def metafile(file=None)
+ # Windows only
+ tk_send('metafile', file)
+ self
+ end
+
+ def snap(output, keys={})
+ tk_send_without_enc('snap', *(hash_kv(keys, false) + output))
+ self
+ end
+
+ def transform(x, y)
+ list(tk_send_without_enc('transform', x, y))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/table.rb b/ext/tk/lib/tkextlib/blt/table.rb
new file mode 100644
index 0000000000..205e29e6c5
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/table.rb
@@ -0,0 +1,412 @@
+#
+# tkextlib/blt/table.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/itemconfig.rb'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Table
+ include Tk
+ extend Tk
+ extend TkItemConfigMethod
+
+ TkCommandNames = ['::blt::table'.freeze].freeze
+
+ module TableContainer
+ def blt_table_add(*args)
+ Tk::BLT::Table.add(self, *args)
+ self
+ end
+
+ def blt_table_arrange()
+ Tk::BLT::Table.arrange(self)
+ self
+ end
+
+ def blt_table_cget_tkstring(*args)
+ Tk::BLT::Table.cget_tkstring(self, *args)
+ end
+ def blt_table_cget(*args)
+ Tk::BLT::Table.cget(self, *args)
+ end
+ def blt_table_cget_strict(*args)
+ Tk::BLT::Table.cget_strict(self, *args)
+ end
+
+ def blt_table_configure(*args)
+ Tk::BLT::Table.configure(self, *args)
+ self
+ end
+
+ def blt_table_configinfo(*args)
+ Tk::BLT::Table.configinfo(self, *args)
+ end
+
+ def blt_table_current_configinfo(*args)
+ Tk::BLT::Table.current_configinfo(self, *args)
+ end
+
+ def blt_table_locate(x, y)
+ Tk::BLT::Table.locate(self, x, y)
+ end
+
+ def blt_table_delete(*args)
+ Tk::BLT::Table.delete(self, *args)
+ self
+ end
+
+ def blt_table_extents(item)
+ Tk::BLT::Table.extents(self, item)
+ end
+
+ def blt_table_insert(*args)
+ Tk::BLT::Table.insert(self, *args)
+ self
+ end
+
+ def blt_table_insert_before(*args)
+ Tk::BLT::Table.insert_before(self, *args)
+ self
+ end
+
+ def blt_table_insert_after(*args)
+ Tk::BLT::Table.insert_after(self, *args)
+ self
+ end
+
+ def blt_table_join(first, last)
+ Tk::BLT::Table.join(self, first, last)
+ self
+ end
+
+ def blt_table_save()
+ Tk::BLT::Table.save(self)
+ end
+
+ def blt_table_search(*args)
+ Tk::BLT::Table.search(self, *args)
+ end
+
+ def blt_table_split(*args)
+ Tk::BLT::Table.split(self, *args)
+ self
+ end
+
+ def blt_table_itemcget_tkstring(*args)
+ Tk::BLT::Table.itemcget_tkstring(self, *args)
+ end
+ def blt_table_itemcget(*args)
+ Tk::BLT::Table.itemcget(self, *args)
+ end
+ def blt_table_itemcget_strict(*args)
+ Tk::BLT::Table.itemcget_strict(self, *args)
+ end
+
+ def blt_table_itemconfigure(*args)
+ Tk::BLT::Table.itemconfigure(self, *args)
+ self
+ end
+
+ def blt_table_itemconfiginfo(*args)
+ Tk::BLT::Table.itemconfiginfo(self, *args)
+ end
+
+ def blt_table_current_itemconfiginfo(*args)
+ Tk::BLT::Table.current_itemconfiginfo(self, *args)
+ end
+
+ def blt_table_iteminfo(item)
+ Tk::BLT::Table.iteminfo(self, item)
+ end
+ end
+ end
+end
+
+
+############################################
+class << Tk::BLT::Table
+ def __item_cget_cmd(id) # id := [ container, item ]
+ win = (id[0].kind_of?(TkWindow))? id[0].path: id[0].to_s
+ ['::blt::table', 'cget', win, id[1]]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id) # id := [ container, item, ... ]
+ container, *items = id
+ win = (container.kind_of?(TkWindow))? container.path: container.to_s
+ ['::blt::table', 'configure', win, *items]
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ win = (id[0].kind_of?(TkWindow))? id[0].path: id[0].to_s
+ win + ';'
+ end
+ private :__item_pathname
+
+ alias __itemcget_tkstring itemcget_tkstring
+ alias __itemcget itemcget
+ alias __itemcget_strict itemcget_strict
+ alias __itemconfigure itemconfigure
+ alias __itemconfiginfo itemconfiginfo
+ alias __current_itemconfiginfo current_itemconfiginfo
+
+ private :__itemcget_tkstring, :__itemcget, :__itemcget_strict
+ private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo
+
+ def __boolval_optkeys
+ super() << 'propagate'
+ end
+ private :__boolval_optkeys
+
+ def tagid(tag)
+ if tag.kind_of?(Array)
+ case tag[0]
+ when Integer
+ # [row, col]
+ tag.join(',')
+ when :c, :C, 'c', 'C', :r, :R, 'r', 'R'
+ # c0 or r1 or C*, and so on
+ tag.collect{|elem| elem.to_s}.join('')
+ else
+ tag
+ end
+ elsif tag.kind_of?(TkWindow)
+ _epath(tag)
+ else
+ tag
+ end
+ end
+
+ def tagid2obj(tagid)
+ tagid
+ end
+
+ ############################################
+
+ def cget_tkstring(container, option)
+ __itemcget_tkstring([container], option)
+ end
+ def cget(container, option)
+ __itemcget([container], option)
+ end
+ def cget_strict(container, option)
+ __itemcget_strict([container], option)
+ end
+
+ def configure(container, *args)
+ __itemconfigure([container], *args)
+ end
+
+ def configinfo(container, *args)
+ __itemconfiginfo([container], *args)
+ end
+
+ def current_configinfo(container, *args)
+ __current_itemconfiginfo([container], *args)
+ end
+
+ def itemcget_tkstring(container, item, option)
+ __itemcget_tkstring([container, tagid(item)], option)
+ end
+ def itemcget(container, item, option)
+ __itemcget([container, tagid(item)], option)
+ end
+ def itemcget_strict(container, item, option)
+ __itemcget_strict([container, tagid(item)], option)
+ end
+
+ def itemconfigure(container, *args)
+ if args[-1].kind_of?(Hash)
+ # container, item, item, ... , hash_optkeys
+ keys = args.pop
+ fail ArgumentError, 'no item is given' if args.empty?
+ id = [container]
+ args.each{|item| id << tagid(item)}
+ __itemconfigure(id, keys)
+ else
+ # container, item, item, ... , option, value
+ val = args.pop
+ opt = args.pop
+ fail ArgumentError, 'no item is given' if args.empty?
+ id = [container]
+ args.each{|item| id << tagid(item)}
+ __itemconfigure(id, opt, val)
+ end
+ container
+ end
+
+ def itemconfiginfo(container, *args)
+ slot = args[-1]
+ if slot.kind_of?(String) || slot.kind_of?(Symbol)
+ slot = slot.to_s
+ if slot[0] == ?. || slot =~ /^\d+,\d+$/ || slot =~ /^(c|C|r|R)(\*|\d+)/
+ # widget || row,col || Ci or Ri
+ slot = nil
+ else
+ # option
+ slot = args.pop
+ end
+ else
+ slot = nil
+ end
+
+ fail ArgumentError, 'no item is given' if args.empty?
+
+ id = [container]
+ args.each{|item| id << tagid(item)}
+ __itemconfiginfo(id, slot)
+ end
+
+ def current_itemconfiginfo(container, *args)
+ slot = args[-1]
+ if slot.kind_of?(String) || slot.kind_of?(Symbol)
+ slot = slot.to_s
+ if slot[0] == ?. || slot =~ /^\d+,\d+$/ || slot =~ /^(c|C|r|R)(\*|\d+)/
+ # widget || row,col || Ci or Ri
+ slot = nil
+ else
+ # option
+ slot = args.pop
+ end
+ else
+ slot = nil
+ end
+
+ fail ArgumentError, 'no item is given' if args.empty?
+
+ id = [container]
+ args.each{|item| id << tagid(item)}
+ __current_itemconfiginfo(id, slot)
+ end
+
+ def info(container)
+ ret = {}
+ inf = list(tk_call('::blt::table', 'info', container))
+ until inf.empty?
+ opt = inf.slice!(0..1)
+ ret[opt[1..-1]] = opt[1]
+ end
+ ret
+ end
+
+ def iteminfo(container, item)
+ inf = list(tk_call('::blt::table', 'info', container, tagid(item)).chomp)
+
+ ret = []
+ until inf.empty? || (inf[0].kind_of?(String) && inf[0] =~ /^-/)
+ ret << inf.shift
+ end
+
+ if inf.length > 1
+ keys = {}
+ while inf.length > 1
+ opt = inf.slice!(0..1)
+ keys[opt[0][1..-1]] = opt[1]
+ end
+ ret << keys
+ end
+
+ ret
+ end
+
+ ############################################
+
+ def create_container(container)
+ tk_call('::blt::table', container)
+ begin
+ class << container
+ include Tk::BLT::Table::TableContainer
+ end
+ rescue
+ warn('fail to include TableContainer methods (frozen object?)')
+ end
+ container
+ end
+
+ def add(container, *args)
+ if args.empty?
+ tk_call('::blt::table', container)
+ else
+ args = args.collect{|arg|
+ if arg.kind_of?(TkWindow)
+ _epath(arg)
+ elsif arg.kind_of?(Array) # index
+ arg.join(',')
+ else
+ arg
+ end
+ }
+ tk_call('::blt::table', container, *args)
+ end
+ container
+ end
+
+ def arrange(container)
+ tk_call('::blt::table', 'arrange', container)
+ container
+ end
+
+ def delete(container, *args)
+ tk_call('::blt::table', 'delete', container, *args)
+ end
+
+ def extents(container, item)
+ ret = []
+ inf = list(tk_call('::blt::table', 'extents', container, item))
+ ret << inf.slice!(0..4) until inf.empty?
+ ret
+ end
+
+ def forget(*wins)
+ wins = wins.collect{|win| _epath(win)}
+ tk_call('::blt::table', 'forget', *wins)
+ end
+
+ def insert(container, *args)
+ tk_call('::blt::table', 'insert', container, *args)
+ end
+
+ def insert_before(container, *args)
+ tk_call('::blt::table', 'insert', container, '-before', *args)
+ end
+
+ def insert_after(container, *args)
+ tk_call('::blt::table', 'insert', container, '-after', *args)
+ end
+
+ def join(container, first, last)
+ tk_call('::blt::table', 'join', container, first, last)
+ end
+
+ def locate(container, x, y)
+ tk_call('::blt::table', 'locate', container, x, y)
+ end
+
+ def containers(arg={})
+ list(tk_call('::blt::table', 'containers', *hash_kv(arg)))
+ end
+
+ def containers_pattern(pat)
+ list(tk_call('::blt::table', 'containers', '-pattern', pat))
+ end
+
+ def containers_slave(win)
+ list(tk_call('::blt::table', 'containers', '-slave', win))
+ end
+
+ def save(container)
+ tk_call('::blt::table', 'save', container)
+ end
+
+ def search(container, keys={})
+ list(tk_call('::blt::table', 'containers', *hash_kv(keys)))
+ end
+
+ def split(container, *args)
+ tk_call('::blt::table', 'split', container, *args)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tabnotebook.rb b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
new file mode 100644
index 0000000000..82936c67d3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tabnotebook.rb
@@ -0,0 +1,110 @@
+#
+# tkextlib/blt/tabnotebook.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+require 'tkextlib/blt/tabset.rb'
+
+module Tk::BLT
+ class Tabnotebook < Tabset
+ TkCommandNames = ['::blt::tabnotebook'.freeze].freeze
+ WidgetClassName = 'Tabnotebook'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class Tab < Tk::BLT::Tabset::Tab
+ def self.new(parent, pos=nil, name=nil, keys={})
+ if pos.kind_of?(Hash)
+ keys = pos
+ name = nil
+ pos = nil
+ end
+ if name.kind_of?(Hash)
+ keys = name
+ name = nil
+ end
+ obj = nil
+ TabID_TBL.mutex.synchronize{
+ if name && TabID_TBL[parent.path] && TabID_TBL[parent.path][name]
+ obj = TabID_TBL[parent.path][name]
+ if pos
+ if pos.to_s == 'end'
+ obj.move_after('end')
+ else
+ obj.move_before(pos)
+ end
+ end
+ obj.configure if keys && ! keys.empty?
+ else
+ (obj = self.allocate).instance_eval{
+ initialize(parent, pos, name, keys)
+ TabID_TBL[@tpath] = {} unless TabID_TBL[@tpath]
+ TabID_TBL[@tpath][@id] = self
+ }
+ end
+ }
+ obj
+ end
+
+ def initialize(parent, pos, name, keys)
+ @t = parent
+ @tpath = parent.path
+ if name
+ @path = @id = name
+ unless (list(tk_call(@tpath, 'tab', 'names', @id)).empty?)
+ if pos
+ idx = tk_call(@tpath, 'index', @id)
+ if pos.to_s == 'end'
+ tk_call(@tpath, 'move', idx, 'after', 'end')
+ else
+ tk_call(@tpath, 'move', idx, 'before', pos)
+ end
+ end
+ tk_call(@tpath, 'tab', 'configure', @id, keys)
+ else
+ fail ArgumentError, "can't find tab \"#{@id}\" in #{@t}"
+ end
+ else
+ pos = 'end' unless pos
+ @path = @id = tk_call(@tpath, 'insert', pos, keys)
+ end
+ end
+ end
+
+ #######################################
+
+ def get_tab(index)
+ if (idx = tk_send_without_enc('id', tagindex(index))).empty?
+ nil
+ else
+ Tk::BLT::Tabset::Tab.id2obj(self, idx)
+ end
+ end
+ alias get_id get_tab
+
+ def get_tabobj(index)
+ if (idx = tk_send_without_enc('id', tagindex(index))).empty?
+ nil
+ else
+ Tk::BLT::Tabnotebook::Tab.new(self, nil, idx)
+ end
+ end
+
+ alias index_name index
+
+ def insert(pos=nil, keys={})
+ if pos.kind_of?(Hash)
+ keys = pos
+ pos = nil
+ end
+ pos = 'end' if pos.nil?
+ Tk::BLT::Tabnotebook::Tab.new(self, nil,
+ tk_send('insert', tagindex(pos), keys))
+
+ end
+ undef :insert_tabs
+
+ undef :tab_pageheight, :tab_pagewidth
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tabset.rb b/ext/tk/lib/tkextlib/blt/tabset.rb
new file mode 100644
index 0000000000..c4716c7304
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tabset.rb
@@ -0,0 +1,504 @@
+#
+# tkextlib/blt/tabset.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Tabset < TkWindow
+ class Tab < TkObject
+ include TkTreatItemFont
+
+ TabID_TBL = TkCore::INTERP.create_table
+
+ (TabsetTab_ID = ['blt_tabset_tab'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TabID_TBL.mutex.synchronize{ TabID_TBL.clear }
+ }
+
+ def self.id2obj(tabset, id)
+ tpath = tabset.path
+ TabID_TBL.mutex.synchronize{
+ if TabID_TBL[tpath]
+ TabID_TBL[tpath][id]? TabID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def self.new(parent, pos=nil, name=nil, keys={})
+ if pos.kind_of?(Hash)
+ keys = pos
+ name = nil
+ pos = nil
+ end
+ if name.kind_of?(Hash)
+ keys = name
+ name = nil
+ end
+ obj = nil
+ TabID_TBL.mutex.synchronize{
+ if name && TabID_TBL[parent.path] && TabID_TBL[parent.path][name]
+ obj = TabID_TBL[parent.path][name]
+ if pos
+ if pos.to_s == 'end'
+ obj.move_after('end')
+ else
+ obj.move_before(pos)
+ end
+ end
+ obj.configure if keys && ! keys.empty?
+ else
+ (obj = self.allocate).instance_eval{
+ initialize(parent, pos, name, keys)
+ TabID_TBL[@tpath] = {} unless TabID_TBL[@tpath]
+ TabID_TBL[@tpath][@id] = self
+ }
+ end
+ }
+ obj
+ end
+
+ def initialize(parent, pos, name, keys)
+ @t = parent
+ @tpath = parent.path
+ if name
+ @path = @id = name
+ unless (list(tk_call(@tpath, 'tab', 'names', @id)).empty?)
+ if pos
+ idx = tk_call(@tpath, 'index', '-name', @id)
+ if pos.to_s == 'end'
+ tk_call(@tpath, 'move', idx, 'after', 'end')
+ else
+ tk_call(@tpath, 'move', idx, 'before', pos)
+ end
+ end
+ tk_call(@tpath, 'tab', 'configure', @id, keys)
+ else
+ pos = 'end' unless pos
+ tk_call(@tpath, 'insert', pos, @id, keys)
+ end
+ else
+ pos = 'end' unless pos
+ TabsetTab_ID.mutex.synchronize{
+ @path = @id = TabsetTab_ID.join(TkCore::INTERP._ip_id_)
+ TabsetTab_ID[1].succ!
+ }
+ tk_call(@tpath, 'insert', pos, @id, keys)
+ end
+ end
+
+ #def bind(context, cmd=Proc.new, *args)
+ # @t.tab_bind(@id, context, cmd, *args)
+ # self
+ #end
+ def bind(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @t.tab_bind(@id, context, cmd, *args)
+ self
+ end
+ #def bind_append(context, cmd=Proc.new, *args)
+ # @t.tab_bind_append(@id, context, cmd, *args)
+ # self
+ #end
+ def bind_append(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @t.tab_bind_append(@id, context, cmd, *args)
+ self
+ end
+ def bind_remove(context)
+ @t.tab_bind_remove(@id, context)
+ self
+ end
+ def bindinfo(context=nil)
+ @t.tab_bindinfo(@id, context)
+ end
+
+ def cget_tkstring(*args)
+ @t.tab_cget_tkstring(@id, *args)
+ end
+ def cget(*args)
+ @t.tab_cget(@id, *args)
+ end
+ def cget_strict(*args)
+ @t.tab_cget_strict(@id, *args)
+ end
+ def configure(*args)
+ @t.tab_configure(@id, *args)
+ end
+ def configinfo(*args)
+ @t.tab_configinfo(@id, *args)
+ end
+ def current_configinfo(*args)
+ @t.current_tab_configinfo(@id, *args)
+ end
+
+ def delete()
+ @t.delete(@id)
+ TabID_TBL.mutex.synchronize{
+ TabID_TBL[@tpath].delete(@id)
+ }
+ self
+ end
+
+ def get_name()
+ @id.dup
+ end
+
+ def focus()
+ @t.focus(self.index)
+ end
+
+ def index()
+ @t.index_name(@id)
+ end
+
+ def invoke()
+ @t.invoke(self.index)
+ end
+
+ def move_before(idx)
+ @t.move_before(self.index, idx)
+ end
+ def move_after(idx)
+ @t.move_after(self.index, idx)
+ end
+
+ def perforation_highlight(mode)
+ @t.perforation_highlight(self.index, mode)
+ end
+ def perforation_invoke()
+ @t.perforation_invoke(self.index)
+ end
+
+ def see()
+ @t.see(self.index)
+ end
+
+ def tearoff(name=None)
+ @t.tab_tearoff(self.index, *args)
+ end
+ end
+
+ ########################################
+
+ class NamedTab < Tab
+ def self.new(parent, name)
+ super(parent, nil, name, {})
+ end
+ end
+
+ ########################################
+
+ include X_Scrollable
+ include TkItemConfigMethod
+
+ TkCommandNames = ['::blt::tabset'.freeze].freeze
+ WidgetClassName = 'Tabset'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __destroy_hook__
+ Tk::BLT::Tabset::Tab::TabID_TBL.mutex.synchronize{
+ Tk::BLT::Tabset::Tab::TabID_TBL.delete(@path)
+ }
+ end
+
+ ########################################
+
+ def __boolval_optkeys
+ super() << 'samewidth' << 'tearoff'
+ end
+ private :__strval_optkeys
+
+ def __strval_optkeys
+ super() << 'tabbackground' << 'tabforeground'
+ end
+ private :__strval_optkeys
+
+ def __item_cget_cmd(id)
+ [self.path, 'tab', 'cget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'tab', 'configure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(tagOrId)
+ if tagOrId.kind_of?(Tk::BLT::Tabset::Tab)
+ self.path + ';' + tagOrId.id.to_s
+ else
+ self.path + ';' + tagOrId.to_s
+ end
+ end
+ private :__item_pathname
+
+ alias tab_cget_tkstring itemcget_tkstring
+ alias tab_cget itemcget
+ alias tab_cget_strict itemcget_strict
+ alias tab_configure itemconfigure
+ alias tab_configinfo itemconfiginfo
+ alias current_tab_configinfo current_itemconfiginfo
+
+ def __item_strval_optkeys(id)
+ super(id) << 'shadow'
+ end
+ private :__item_strval_optkeys
+
+ def tagid(tab)
+ if tab.kind_of?(Tk::BLT::Tabset::Tab)
+ tab.id
+ else
+ tab
+ end
+ end
+
+ def tagindex(tab)
+ if tab.kind_of?(Tk::BLT::Tabset::Tab)
+ tab.index
+ else
+ tab
+ end
+ end
+
+ ########################################
+
+ def activate(index)
+ tk_send('activate', tagindex(index))
+ self
+ end
+ alias highlight activate
+
+ #def tabbind(tag, context, cmd=Proc.new, *args)
+ # _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def tabbind(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+ #def tabbind_append(tag, context, cmd=Proc.new, *args)
+ # _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def tabbind_append(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+ def tabbind_remove(tag, context)
+ _bind_remove([path, "bind", tagid(tag)], context)
+ self
+ end
+ def tabbindinfo(tag, context=nil)
+ _bindinfo([path, "bind", tagid(tag)], context)
+ end
+
+ def delete(first, last=None)
+ tk_send('delete', tagindex(first), tagindex(last))
+ if first.kind_of?(Tk::BLT::Tabset::Tab)
+ TabID_TBL.mutex.synchronize{
+ TabID_TBL[@path].delete(first.id)
+ }
+ end
+ # middle tabs of the range are unknown
+ if last.kind_of?(Tk::BLT::Tabset::Tab)
+ TabID_TBL.mutex.synchronize{
+ TabID_TBL[@path].delete(last.id)
+ }
+ end
+ self
+ end
+
+ def focus(index)
+ tk_send('focus', tagindex(index))
+ self
+ end
+
+ def get_tab(index)
+ if (idx = tk_send_without_enc('get', tagindex(index))).empty?
+ nil
+ else
+ Tk::BLT::Tabset::Tab.id2obj(self, idx)
+ end
+ end
+ def get_tabobj(index)
+ if (idx = tk_send_without_enc('get', tagindex(index))).empty?
+ nil
+ else
+ Tk::BLT::Tabset::Tab.new(self, nil, name, {})
+ end
+ end
+
+ def index(str)
+ num_or_str(tk_send('index', str))
+ end
+ def index_name(tab)
+ num_or_str(tk_send('index', '-name', tagid(tab)))
+ end
+
+ def insert(pos, tab, keys={})
+ pos = 'end' if pos.nil?
+ Tk::BLT::Tabset::Tab.new(self, tagindex(pos), tagid(tab), keys)
+ end
+ def insert_tabs(pos, *tabs)
+ pos = 'end' if pos.nil?
+ if tabs[-1].kind_of?(Hash)
+ keys = tabs.pop
+ else
+ keys = {}
+ end
+ fail ArgumentError, 'no tabs is given' if tabs.empty?
+ tabs.map!{|tab| tagid(tab)}
+ tk_send('insert', tagindex(pos), *(tabs + [keys]))
+ tabs.collect{|tab| Tk::BLT::Tabset::Tab.new(self, nil, tagid(tab))}
+ end
+
+ def invoke(index)
+ tk_send('invoke', tagindex(index))
+ end
+
+ def move_before(index, base_idx)
+ tk_send('move', tagindex(index), 'before', tagindex(base_idx))
+ self
+ end
+ def move_after(index, base_idx)
+ tk_send('move', tagindex(index), 'after', tagindex(base_idx))
+ self
+ end
+
+ def nearest(x, y)
+ Tk::BLT::Tabset::Tab.id2obj(self, num_or_str(tk_send_without_enc('nearest', x, y)))
+ end
+
+ def perforation_activate(mode)
+ tk_send('perforation', 'activate', mode)
+ self
+ end
+ def perforation_highlight(index, *args)
+ if args.empty?
+ # index --> mode
+ tk_send('perforation', 'highlight', index)
+ elsif args.size == 1
+ # args[0] --> mode
+ tk_send('perforation', 'highlight', tagindex(index), args[0])
+ else # Error: call to get Tcl's error message
+ tk_send('perforation', 'highlight', tagindex(index), *args)
+ end
+ self
+ end
+ def perforation_invoke(index=nil)
+ if index
+ tk_send('perforation', 'invoke', tagindex(index))
+ else
+ tk_send('perforation', 'invoke')
+ end
+ end
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+
+ def see(index)
+ tk_send('see', tagindex(index))
+ self
+ end
+
+ def size()
+ number(tk_send_without_enc('size'))
+ end
+
+ def select(index)
+ tk_send('select', tagindex(index))
+ self
+ end
+
+ def tab_dockall
+ tk_send('tab', 'dockall')
+ self
+ end
+
+ def tab_names(pat=None)
+ simplelist(tk_send('tab', 'names', pat)).collect{|name|
+ Tk::BLT::Tabset::Tab.id2obj(self, name)
+ }
+ end
+
+ def tab_objs(pat=None)
+ simplelist(tk_send('tab', 'names', pat)).collect{|name|
+ Tk::BLT::Tabset::Tab.new(self, nil, name, {})
+ }
+ end
+
+ def tab_ids(pat=None)
+ simplelist(tk_send('tab', 'names', pat))
+ end
+
+ def tab_pageheight
+ number(tk_send('tab', 'pageheight'))
+ end
+
+ def tab_pagewidth
+ number(tk_send('tab', 'pagewidth'))
+ end
+
+ def tab_tearoff(index, parent=None)
+ window(tk_send('tab', 'tearoff', tagindex(index), parent))
+ end
+
+ def xscrollcommand(cmd=Proc.new)
+ configure_cmd 'scrollcommand', cmd
+ self
+ end
+ alias scrollcommand xscrollcommand
+
+ def xview(*index)
+ if index.empty?
+ list(tk_send_without_enc('view'))
+ else
+ tk_send_without_enc('view', *index)
+ self
+ end
+ end
+ alias view xview
+ alias view_moveto xview_moveto
+ alias view_scroll xview_scroll
+
+ alias scrollbar xscrollbar
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/ted.rb b/ext/tk/lib/tkextlib/blt/ted.rb
new file mode 100644
index 0000000000..53ab9acdaa
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/ted.rb
@@ -0,0 +1,68 @@
+#
+# tkextlib/blt/ted.rb
+#
+# *** This is alpha version, because there is no document on BLT. ***
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Ted
+ extend TkCore
+
+ TkCommandNames = ['::blt::ted'.freeze].freeze
+
+ ##############################
+
+ extend TkItemConfigMethod
+
+ class << self
+ def __item_cget_cmd(id)
+ ['::blt::ted', 'cget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ ['::blt::ted', 'configure', id]
+ end
+ private :__item_config_cmd
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ def cget_tkstring(master, option)
+ itemcget_tkstring(master, option)
+ end
+ def cget(master, option)
+ itemcget(master, option)
+ end
+ def cget_strict(master, option)
+ itemcget_strict(master, option)
+ end
+ def configure(master, slot, value=None)
+ itemconfigure(master, slot, value)
+ end
+ def configinfo(master, slot=nil)
+ itemconfiginfo(master, slot)
+ end
+ def current_configinfo(master, slot=nil)
+ current_itemconfiginfo(master, slot)
+ end
+ end
+
+ ##############################
+
+ def self.edit(master, *args)
+ tk_call('::blt::ted', 'edit', master, *args)
+ end
+ def self.rep(master, *args)
+ tk_call('::blt::ted', 'rep', master, *args)
+ end
+ def self.select(master, *args)
+ tk_call('::blt::ted', 'select', master, *args)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile.rb b/ext/tk/lib/tkextlib/blt/tile.rb
new file mode 100644
index 0000000000..c67cafd8d6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile.rb
@@ -0,0 +1,25 @@
+#
+# tkextlib/blt/tile.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Tile
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+ # Require autoload-symbols which is a same name as widget classname.
+ # Those are used at TkComm._genobj_for_tkwidget method.
+
+ autoload :Button, 'tkextlib/blt/tile/button.rb'
+ autoload :CheckButton, 'tkextlib/blt/tile/checkbutton.rb'
+ autoload :Checkbutton, 'tkextlib/blt/tile/checkbutton.rb'
+ autoload :Radiobutton, 'tkextlib/blt/tile/radiobutton.rb'
+ autoload :RadioButton, 'tkextlib/blt/tile/radiobutton.rb'
+ autoload :Frame, 'tkextlib/blt/tile/frame.rb'
+ autoload :Label, 'tkextlib/blt/tile/label.rb'
+ autoload :Scrollbar, 'tkextlib/blt/tile/scrollbar.rb'
+ autoload :Toplevel, 'tkextlib/blt/tile/toplevel.rb'
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/button.rb b/ext/tk/lib/tkextlib/blt/tile/button.rb
new file mode 100644
index 0000000000..2e0863cfbe
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/button.rb
@@ -0,0 +1,16 @@
+#
+# tkextlib/blt/tile/button.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/button'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class Button < Tk::Button
+ TkCommandNames = ['::blt::tile::button'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb b/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb
new file mode 100644
index 0000000000..da230b5925
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb
@@ -0,0 +1,17 @@
+#
+# tkextlib/blt/tile/checkbutton.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/checkbutton'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class CheckButton < Tk::CheckButton
+ TkCommandNames = ['::blt::tile::checkbutton'.freeze].freeze
+ end
+ Checkbutton = CheckButton
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/frame.rb b/ext/tk/lib/tkextlib/blt/tile/frame.rb
new file mode 100644
index 0000000000..5434af4b72
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/frame.rb
@@ -0,0 +1,16 @@
+#
+# tkextlib/blt/tile/frame.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class Frame < Tk::Frame
+ TkCommandNames = ['::blt::tile::frame'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/label.rb b/ext/tk/lib/tkextlib/blt/tile/label.rb
new file mode 100644
index 0000000000..f370c1403b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/label.rb
@@ -0,0 +1,16 @@
+#
+# tkextlib/blt/tile/label.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/label'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class Label < Tk::Label
+ TkCommandNames = ['::blt::tile::label'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb b/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb
new file mode 100644
index 0000000000..814f9a5cc4
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb
@@ -0,0 +1,17 @@
+#
+# tkextlib/blt/tile/radiobutton.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/radiobutton'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class RadioButton < Tk::RadioButton
+ TkCommandNames = ['::blt::tile::radiobutton'.freeze].freeze
+ end
+ Radiobutton = RadioButton
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb b/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb
new file mode 100644
index 0000000000..2ae871d518
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb
@@ -0,0 +1,16 @@
+#
+# tkextlib/blt/tile/scrollbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/scrollbar'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class Scrollbar < Tk::Scrollbar
+ TkCommandNames = ['::blt::tile::scrollbar'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tile/toplevel.rb b/ext/tk/lib/tkextlib/blt/tile/toplevel.rb
new file mode 100644
index 0000000000..76d5f86b1b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tile/toplevel.rb
@@ -0,0 +1,16 @@
+#
+# tkextlib/blt/tile/toplevel.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/toplevel'
+require 'tkextlib/blt/tile.rb'
+
+module Tk::BLT
+ module Tile
+ class Toplevel < Tk::Toplevel
+ TkCommandNames = ['::blt::tile::toplevel'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/tree.rb b/ext/tk/lib/tkextlib/blt/tree.rb
new file mode 100644
index 0000000000..1a3563e60d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/tree.rb
@@ -0,0 +1,1058 @@
+#
+# tkextlib/blt/tree.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Tree < TkObject
+ TkCommandNames = ['::blt::tree'.freeze].freeze
+
+ ###################################
+
+ class Node < TkObject
+ TreeNodeID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ TreeNodeID_TBL.mutex.synchronize{ TreeNodeID_TBL.clear }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ TreeNodeID_TBL.mutex.synchronize{
+ if TreeNodeID_TBL[tpath]
+ if TreeNodeID_TBL[tpath][id]
+ TreeNodeID_TBL[tpath][id]
+ else
+ begin
+ # self.new(tree, nil, 'node'=>Integer(id))
+ id = Integer(id)
+ if bool(tk_call(@tpath, 'exists', id))
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = tpath
+ @path = @id = id
+ TreeNodeID_TBL[@tpath] = {} unless TreeNodeID_TBL[@tpath]
+ TreeNodeID_TBL[@tpath][@id] = self
+ }
+ obj
+ else
+ id
+ end
+ rescue
+ id
+ end
+ end
+ else
+ id
+ end
+ }
+ end
+
+ def self.new(tree, parent, keys={})
+ keys = _symbolkey2str(keys)
+ tpath = tree.path
+
+ TreeNodeID_TBL.mutex.synchronize{
+ TreeNodeID_TBL[tpath] ||= {}
+ if (id = keys['node']) && (obj = TreeNodeID_TBL[tpath][id])
+ keys.delete('node')
+ tk_call(tree.path, 'move', id, parent, keys) if parent
+ return obj
+ end
+
+ (obj = self.allocate).instance_eval{
+ initialize(tree, parent, keys)
+ TreeNodeID_TBL[tpath][@id] = self
+ }
+ obj
+ }
+ end
+
+ def initialize(tree, parent, keys={})
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ if (id = keys['node']) && bool(tk_call(@tpath, 'exists', id))
+ @path = @id = id
+ keys.delete('node')
+ tk_call(@tpath, 'move', @id, parent, keys) if parent
+ else
+ parent = tk_call(@tpath, 'root') unless parent
+ @path = @id = tk_call(@tpath, 'insert', parent, keys)
+ end
+ end
+
+ def id
+ @id
+ end
+
+ def apply(keys={})
+ @tree.apply(@id, keys)
+ self
+ end
+
+ def children()
+ @tree.children(@id)
+ end
+
+ def copy(parent, keys={})
+ @tree.copy(@id, parent, keys)
+ end
+ def copy_to(dest_tree, parent, keys={})
+ @tree.copy_to(@id, dest_tree, parent, keys)
+ end
+
+ def degree()
+ @tree.degree(@id)
+ end
+
+ def delete()
+ @tree.delete(@id)
+ self
+ end
+
+ def depth()
+ @tree.depth(@id)
+ end
+
+ def dump()
+ @tree.dump(@id)
+ end
+
+ def dump_to_file(file)
+ @tree.dump_to_file(@id, file)
+ self
+ end
+
+ def exist?(keys={})
+ @tree.exist?(@id, keys)
+ end
+
+ def find(keys={})
+ @tree.find(@id, keys)
+ end
+
+ def find_child(label)
+ @tree.find_child(@id, label)
+ end
+
+ def first_child()
+ @tree.first_child(@id)
+ end
+
+ def get()
+ @tree.get(@id)
+ end
+ def get_value(key, default_val=None)
+ @tree.get_value(@id, key, default_val)
+ end
+
+ def index()
+ @tree.index(@id)
+ end
+
+ def leaf?()
+ @tree.leaf?(@id)
+ end
+ def link?()
+ @tree.link?(@id)
+ end
+ def root?()
+ @tree.root?(@id)
+ end
+
+ def keys()
+ @tree.keys(@id)
+ end
+
+ def label(text = nil)
+ @tree.label(@id, nil)
+ end
+ def label=(text)
+ @tree.label(@id, text)
+ end
+
+ def last_child()
+ @tree.last_child(@id)
+ end
+
+ def move(dest, keys={})
+ @tree.keys(@id, dest, keys)
+ self
+ end
+
+ def next()
+ @tree.next(@id)
+ end
+
+ def next_sibling()
+ @tree.next_sibling(@id)
+ end
+
+ def parent()
+ @tree.parent(@id)
+ end
+
+ def fullpath()
+ @tree.fullpath(@id)
+ end
+
+ def position()
+ @tree.position(@id)
+ end
+
+ def previous()
+ @tree.previous(@id)
+ end
+
+ def prev_sibling()
+ @tree.prev_sibling(@id)
+ end
+
+ def restore(str, keys={})
+ @tree.restore(@id, str, keys)
+ self
+ end
+ def restore_overwrite(str, keys={})
+ @tree.restore_overwrite(@id, str, keys)
+ self
+ end
+
+ def restore_from_file(file, keys={})
+ @tree.restore_from_file(@id, file, keys)
+ self
+ end
+ def restore_overwrite_from_file(file, keys={})
+ @tree.restore_overwrite_from_file(@id, file, keys)
+ self
+ end
+
+ def root()
+ @tree.root(@id)
+ self
+ end
+
+ def set(data)
+ @tree.set(@id, data)
+ self
+ end
+
+ def size()
+ @tree.size(@id)
+ end
+
+ def sort(keys={})
+ @tree.sort(@id, keys)
+ self
+ end
+
+ def type(key)
+ @tree.type(@id, key)
+ end
+
+ def unset(*keys)
+ @tree.unset(@id, *keys)
+ self
+ end
+
+ def values(key=None)
+ @tree.values(@id, key)
+ end
+ end
+
+ ###################################
+
+ class Tag < TkObject
+ TreeTagID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ TreeTagID_TBL.mutex.synchronize{ TreeTagID_TBL.clear }
+ }
+
+ (TreeTag_ID = ['blt_tree_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ TreeTagID_TBL.mutex.synchronize{
+ if TreeTagID_TBL[tpath]
+ if TreeTagID_TBL[tpath][id]
+ TreeTagID_TBL[tpath][id]
+ else
+ begin
+ # self.new(tree, id)
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = id.dup.freeze if id
+ TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
+ TreeTagID_TBL[@tpath][@id] = self
+ }
+ obj
+ rescue
+ id
+ end
+ end
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(tree, tag_str = nil)
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ if tag_str
+ @path = @id = tag_str.dup.freeze
+ else
+ TreeTag_ID.mutex.synchronize{
+ @path = @id = TreeTag_ID.join(TkCore::INTERP._ip_id_)
+ TreeTag_ID[1].succ!
+ }
+ end
+ TreeTagID_TBL.mutex.synchronize{
+ TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
+ TreeTagID_TBL[@tpath][@id] = self
+ }
+ end
+
+ def id
+ @id
+ end
+
+ def add(*nodes)
+ tk_call(@tpath, 'tag', 'add', @id, *nodes)
+ self
+ end
+
+ def delete(*nodes)
+ tk_call(@tpath, 'tag', 'delete', @id, *nodes)
+ self
+ end
+
+ def forget()
+ tk_call(@tpath, 'tag', 'forget', @id)
+ TreeTagID_TBL.mutex.synchronize{
+ TreeTagID_TBL[@tpath].delete(@id)
+ }
+ self
+ end
+
+ def nodes()
+ simplelist(tk_call(@tpath, 'tag', 'nodes', @id)).collect{|node|
+ Tk::BLT::Tree::Node.id2obj(@path, node)
+ }
+ end
+
+ def set(node)
+ tk_call(@tpath, 'tag', 'set', node, @id)
+ self
+ end
+
+ def unset(node)
+ tk_call(@tpath, 'tag', 'unset', node, @id)
+ self
+ end
+ end
+
+ ###################################
+
+ class Notify < TkObject
+ NotifyID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ NotifyID_TBL.mutex.synchronize{ NotifyID_TBL.clear }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ NotifyID_TBL.mutex.synchronize{
+ if NotifyID_TBL[tpath]
+ if NotifyID_TBL[tpath][id]
+ NotifyID_TBL[tpath][id]
+ else
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = id
+ NotifyID_TBL[@tpath] ||= {}
+ NotifyID_TBL[@tpath][@id] = self
+ }
+ obj
+ end
+ else
+ return id
+ end
+ }
+ end
+
+ def self.new(tree, *args, &b)
+ NotifyID_TBL.mutex.synchronize{
+ if tree.kind_of?(Array)
+ # not create
+ tpath = tree[0].path
+ NotifyID_TBL[tpath] ||= {}
+ unless (obj = NotifyID_TBL[tpath][tree[1]])
+ (NotifyID_TBL[tpath][tree[1]] =
+ obj = self.allocate).instance_eval{
+ @parent = @tree = tree[0]
+ @tpath = @parent.path
+ @path = @id = tree[1]
+ }
+ end
+ return obj
+ end
+
+ (obj = self.allocate).instance_eval{
+ initialize(tree, *args, &b)
+ NotifyID_TBL[@tpath] ||= {}
+ NotifyID_TBL[@tpath][@id] = self
+ }
+ return obj
+ }
+ end
+
+ def initialize(tree, *args, &b)
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0])
+ cmd = args.shift
+ # elsif args[-1].kind_of?(Proc) || args[-1].kind_of?(Method)
+ elsif TkComm._callback_entry?(args[-1])
+ cmd = args.pop
+ elsif b
+ cmd = Proc.new(&b)
+ else
+ fail ArgumentError, "lack of 'command' argument"
+ end
+
+ args = args.collect{|arg| '-' << arg.to_s}
+
+ args << proc{|id, type|
+ cmd.call(Tk::BLT::Tree::Node.id2obj(@tree, id),
+ ((type[0] == ?-)? type[1..-1]: type))
+ }
+
+ @path = @id = tk_call(@tpath, 'notify', 'create', *args)
+ end
+
+ def id
+ @id
+ end
+
+ def delete()
+ tk_call(@tpath, 'notify', 'delete', @id)
+ NotifyID_TBL.mutex.synchronize{
+ NotifyID_TBL[@tpath].delete(@id)
+ }
+ self
+ end
+
+ def info()
+ lst = simplelist(tk_call(@tpath, 'notify', 'info', id))
+ lst[0] = Tk::BLT::Tree::Notify.id2obj(@tree, lst[0])
+ lst[1] = simplelist(lst[1]).collect{|flag| flag[1..-1]}
+ lst[2] = tk_tcl2ruby(lst[2])
+ lst
+ end
+ end
+
+ ###################################
+
+ class Trace < TkObject
+ TraceID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ TraceID_TBL.mutex.synchronize{ TraceID_TBL.clear }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ TraceID_TBL.mutex.synchronize{
+ if TraceID_TBL[tpath]
+ if TraceID_TBL[tpath][id]
+ TraceID_TBL[tpath][id]
+ else
+ begin
+ # self.new([tree, id])
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = node # == traceID
+ TraceID_TBL[@tpath] ||= {}
+ TraceID_TBL[@tpath][@id] = self
+ }
+ obj
+ rescue
+ id
+ end
+ end
+ else
+ id
+ end
+ }
+ end
+
+ def self.new(tree, *args, &b)
+ TraceID_TBL.mutex.synchronize{
+ if tree.kind_of?(Array)
+ # not create
+ tpath = tree[0].path
+ TraceID_TBL[tpath] ||= {}
+ unless (obj = TraceID_TBL[tpath][tree[1]])
+ (TraceID_TBL[tpath][tree[1]] =
+ obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = tree[1] # == traceID
+ }
+ end
+ return obj
+ end
+
+ # super(true, tree, *args, &b)
+ (obj = self.allocate).instance_eval{
+ initialize(tree, *args, &b)
+ TraceID_TBL[@tpath] ||= {}
+ TraceID_TBL[@tpath][@id] = self
+ }
+ return obj
+ }
+ end
+
+ def initialize(tree, node, key, opts, cmd=nil, &b)
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ if !cmd
+ if b
+ cmd = Proc.new(&b)
+ else
+ fail ArgumentError, "lack of 'command' argument"
+ end
+ end
+
+ @path = @id = tk_call(@tpath, 'trace', 'create', node, key, opts,
+ proc{|t, id, k, ops|
+ tobj = Tk::BLT::Tree.id2obj(t)
+ if tobj.kind_of?(Tk::BLT::Tree)
+ nobj = Tk::BLT::Tree::Node.id2obj(tobj, id)
+ else
+ nobj = id
+ end
+ cmd.call(tobj, nobj, k, ops)
+ })
+ end
+
+ def id
+ @id
+ end
+
+ def delete()
+ tk_call(@tpath, 'trace', 'delete', @id)
+ TraceID_TBL.mutex.synchronize{
+ TraceID_TBL[tpath].delete(@id)
+ }
+ self
+ end
+
+ def info()
+ lst = simplelist(tk_call(@tpath, 'trace', 'info', id))
+ lst[0] = Tk::BLT::Tree::Trace.id2obj(@tree, lst[0])
+ lst[2] = simplelist(lst[2])
+ lst[3] = tk_tcl2ruby(lst[3])
+ lst
+ end
+ end
+
+ ###################################
+
+ TreeID_TBL = TkCore::INTERP.create_table
+
+ (Tree_ID = ['blt_tree'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ def __keyonly_optkeys
+ {
+ # apply / find command
+ 'invert'=>nil, 'leafonly'=>nil, 'nocase'=>nil,
+
+ # apply / find / sort command
+ 'path'=>nil,
+
+ # copy / restore / restorefile command
+ 'overwrite'=>nil,
+
+ # copy command
+ 'recurse'=>nil, 'tags'=>nil,
+
+ # sort command
+ 'ascii'=>nil, 'decreasing'=>nil, 'disctionary'=>nil,
+ 'integer'=>nil, 'real'=>nil, 'recurse'=>nil, 'reorder'=>nil,
+ }
+ end
+
+ def self.id2obj(id)
+ TreeID_TBL.mutex.synchronize{
+ TreeID_TBL[id]? TreeID_TBL[id]: id
+ }
+ end
+
+ def self.names(pat = None)
+ simplelist(tk_call('::blt::tree', 'names', pat)).collect{|name|
+ id2obj(name)
+ }
+ end
+
+ def self.destroy(*names)
+ tk_call('::blt::tree', 'destroy',
+ *(names.collect{|n| (n.kind_of?(Tk::BLT::Tree))? n.id: n }) )
+ end
+
+ def self.new(name = nil)
+ TreeID_TBL.mutex.synchronize{
+ if name && TreeID_TBL[name]
+ TreeID_TBL[name]
+ else
+ (obj = self.allocate).instance_eval{
+ initialize(name)
+ TreeID_TBL[@id] = self
+ }
+ obj
+ end
+ }
+ end
+
+ def initialzie(name = nil)
+ if name
+ @path = @id = name
+ else
+ Tree_ID.mutex.synchronize{
+ @path = @id = Tree_ID.join(TkCore::INTERP._ip_id_)
+ Tree_ID[1].succ!
+ }
+ end
+
+ tk_call('::blt::tree', 'create', @id)
+ end
+
+ def __destroy_hook__
+ Tk::BLT::Tree::Node::TreeNodeID_TBL.mutex.synchronize{
+ Tk::BLT::Tree::Node::TreeNodeID_TBL.delete(@path)
+ }
+ Tk::BLT::Tree::Tag::TreeTagID_TBL.mutex.synchronize{
+ Tk::BLT::Tree::Tag::TreeTagID_TBL.delete(@path)
+ }
+ Tk::BLT::Tree::Notify::NotifyID_TBL.mutex.synchronize{
+ Tk::BLT::Tree::Notify::NotifyID_TBL.delete(@path)
+ }
+ Tk::BLT::Tree::Trace::TraceID_TBL.mutex.synchronize{
+ Tk::BLT::Tree::Trace::TraceID_TBL.delete(@path)
+ }
+ end
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::BLT::Tree::Node) ||
+ tag.kind_of?(Tk::BLT::Tree::Tag) ||
+ tag.kind_of?(Tk::BLT::Tree::Notify) ||
+ tag.kind_of?(Tk::BLT::Tree::Trace)
+ tag.id
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+
+ def destroy()
+ tk_call('::blt::tree', 'destroy', @id)
+ self
+ end
+
+ def ancestor(node1, node2)
+ Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'ancestor',
+ tagid(node1), tagid(node2)))
+ end
+
+ def apply(node, keys={})
+ tk_call('::blt::tree', 'apply', tagid(node), __conv_keyonly_opts(keys))
+ self
+ end
+
+ def attach(tree_obj)
+ tk_call('::blt::tree', 'attach', tree_obj)
+ self
+ end
+
+ def children(node)
+ simplelist(tk_call('::blt::tree', 'children', tagid(node))).collect{|n|
+ Tk::BLT::Tree::Node.id2obj(self, n)
+ }
+ end
+
+ def copy(src, parent, keys={})
+ id = tk_call('::blt::tree', 'copy', tagid(src), tagid(parent),
+ __conv_keyonly_opts(keys))
+ Tk::BLT::Tree::Node.new(self, nil, 'node'=>id)
+ end
+ def copy_to(src, dest_tree, parent, keys={})
+ return copy(src, parent, keys={}) unless dest_tree
+
+ id = tk_call('::blt::tree', 'copy', tagid(src), dest_tree,
+ tagid(parent), __conv_keyonly_opts(keys))
+ Tk::BLT::Tree::Node.new(dest_tree, nil, 'node'=>id)
+ end
+
+ def degree(node)
+ number(tk_call('::blt::tree', 'degree', tagid(node)))
+ end
+
+ def delete(*nodes)
+ tk_call('::blt::tree', 'delete', *(nodes.collect{|node| tagid(node)}))
+ Tk::BLT::Tree::Node::TreeNodeID_TBL.mutex.synchronize{
+ nodes.each{|node|
+ if node.kind_of?(Tk::BLT::Tree::Node)
+ Tk::BLT::Tree::Node::TreeNodeID_TBL[@path].delete(node.id)
+ else
+ Tk::BLT::Tree::Node::TreeNodeID_TBL[@path].delete(node.to_s)
+ end
+ }
+ }
+ self
+ end
+
+ def depth(node)
+ number(tk_call('::blt::tree', 'depth', tagid(node)))
+ end
+
+ def dump(node)
+ simplelist(tk_call('::blt::tree', 'dump', tagid(node))).collect{|n|
+ simplelist(n)
+ }
+ end
+
+ def dump_to_file(node, file)
+ tk_call('::blt::tree', 'dumpfile', tagid(node), file)
+ self
+ end
+
+ def exist?(node, key=None)
+ bool(tk_call('::blt::tree', 'exists', tagid(node), key))
+ end
+
+ def find(node, keys={})
+ simplelist(tk_call('::blt::tree', 'find', tagid(node),
+ __conv_keyonly_opts(keys))).collect{|n|
+ Tk::BLT::Tree::Node.id2obj(self, n)
+ }
+ end
+
+ def find_child(node, label)
+ ret = tk_call('::blt::tree', 'findchild', tagid(node), label)
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def first_child(node)
+ ret = tk_call('::blt::tree', 'firstchild', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def get(node)
+ Hash[*simplelist(tk_call('::blt::tree', 'get', tagid(node)))]
+ end
+ def get_value(node, key, default_val=None)
+ tk_call('::blt::tree', 'get', tagid(node), key, default_val)
+ end
+
+ def index(node)
+ Tk::BLT::Tree::Node.id2obj(self,
+ tk_call('::blt::tree', 'index', tagid(node)))
+ end
+
+ def insert(parent, keys={})
+ id = tk_call('::blt::tree', 'insert', tagid(parent), keys)
+ Tk::BLT::Tree::Node.new(self, nil, 'node'=>id)
+ end
+
+ def ancestor?(node1, node2)
+ bool(tk_call('::blt::tree', 'is', 'ancestor',
+ tagid(node1), tagid(node2)))
+ end
+ def before?(node1, node2)
+ bool(tk_call('::blt::tree', 'is', 'before',
+ tagid(node1), tagid(node2)))
+ end
+ def leaf?(node)
+ bool(tk_call('::blt::tree', 'is', 'leaf', tagid(node)))
+ end
+ def link?(node)
+ bool(tk_call('::blt::tree', 'is', 'link', tagid(node)))
+ end
+ def root?(node)
+ bool(tk_call('::blt::tree', 'is', 'root', tagid(node)))
+ end
+
+ def keys(node, *nodes)
+ if nodes.empty?
+ simplelist(tk_call('blt::tree', 'keys', tagid(node)))
+ else
+ simplelist(tk_call('blt::tree', 'keys', tagid(node),
+ *(nodes.collect{|n| tagid(n)}))).collect{|lst|
+ simplelist(lst)
+ }
+ end
+ end
+
+ def label(node, text=nil)
+ if text
+ tk_call('::blt::tree', 'label', tagid(node), text)
+ text
+ else
+ tk_call('::blt::tree', 'label', tagid(node))
+ end
+ end
+
+ def last_child(node)
+ ret = tk_call('::blt::tree', 'lastchild', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def link(parent, node, keys={})
+ ret = tk_call('::blt::tree', 'link', tagid(parent), tagid(node),
+ __conv_keyonly_opts(keys))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def move(node, dest, keys={})
+ tk_call('::blt::tree', 'move', tagid(node), tagid(dest), keys)
+ self
+ end
+
+ def next(node)
+ ret = tk_call('::blt::tree', 'next', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def next_sibling(node)
+ ret = tk_call('::blt::tree', 'nextsibling', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def notify_create(*args, &b)
+ Tk::BLT::Tree::Notify.new(self, *args, &b)
+ end
+
+ def notify_delete(id)
+ if id.kind_of?(Tk::BLT::Tree::Notify)
+ id.delete
+ else
+ tk_call(@path, 'notify', 'delete', id)
+ Tk::BLT::Tree::Notify::NotifyID_TBL.mutex.synchronize{
+ Tk::BLT::Tree::Notify::NotifyID_TBL[@path].delete(id.to_s)
+ }
+ end
+ self
+ end
+
+ def notify_info(id)
+ lst = simplelist(tk_call(@path, 'notify', 'info', tagid(id)))
+ lst[0] = Tk::BLT::Tree::Notify.id2obj(self, lst[0])
+ lst[1] = simplelist(lst[1]).collect{|flag| flag[1..-1]}
+ lst[2] = tk_tcl2ruby(lst[2])
+ lst
+ end
+
+ def notify_names()
+ tk_call(@path, 'notify', 'names').collect{|id|
+ Tk::BLT::Tree::Notify.id2obj(self, id)
+ }
+ end
+
+ def parent(node)
+ ret = tk_call('::blt::tree', 'parent', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def fullpath(node)
+ tk_call('::blt::tree', 'path', tagid(node))
+ end
+
+ def position(node)
+ number(tk_call('::blt::tree', 'position', tagid(node)))
+ end
+
+ def previous(node)
+ ret = tk_call('::blt::tree', 'previous', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def prev_sibling(node)
+ ret = tk_call('::blt::tree', 'prevsibling', tagid(node))
+ (ret == '-1')? nil: Tk::BLT::Tree::Node.id2obj(self, ret)
+ end
+
+ def restore(node, str, keys={})
+ tk_call('::blt::tree', 'restore', tagid(node), str,
+ __conv_keyonly_opts(keys))
+ self
+ end
+ def restore_overwrite(node, str, keys={})
+ keys = __conv_keyonly_opts(keys)
+ keys.delete('overwrite')
+ keys.delete(:overwrite)
+ tk_call('::blt::tree', 'restore', tagid(node), str, '-overwrite', keys)
+ self
+ end
+
+ def restore_from_file(node, file, keys={})
+ tk_call('::blt::tree', 'restorefile', tagid(node), file,
+ __conv_keyonly_opts(keys))
+ self
+ end
+ def restore_overwrite_from_file(node, file, keys={})
+ keys = __conv_keyonly_opts(keys)
+ keys.delete('overwrite')
+ keys.delete(:overwrite)
+ tk_call('::blt::tree', 'restorefile', tagid(node), file,
+ '-overwrite', keys)
+ self
+ end
+
+ def root(node=None)
+ Tk::BLT::Tree::Node.id2obj(self, tk_call('::blt::tree', 'root',
+ tagid(node)))
+ end
+
+ def set(node, data)
+ unless data.kind_of?(Hash)
+ fail ArgumentError, 'Hash is expected for data'
+ end
+ args = []
+ data.each{|k, v| args << k << v}
+ tk_call('::blt::tree', 'set', tagid(node), *args)
+ self
+ end
+
+ def size(node)
+ number(tk_call('::blt::tree', 'size', tagid(node)))
+ end
+
+ def sort(node, keys={})
+ tk_call('::blt::tree', 'sort', tagid(node), __conv_keyonly_opts(keys))
+ self
+ end
+
+ def tag_add(tag, *nodes)
+ tk_call(@path, 'tag', 'add', tagid(tag), *(nodes.collect{|n| tagid(n)}))
+ self
+ end
+
+ def tag_delete(tag, *nodes)
+ tk_call(@path, 'tag', 'delete', tagid(tag),
+ *(nodes.collect{|n| tagid(n)}))
+ self
+ end
+
+ def tag_forget(tag)
+ tag = tag.id if tag.kind_of?(Tk::BLT::Tree::Tag)
+ tk_call(@path, 'tag', 'forget', tag)
+ TreeTagID_TBL.mutex.synchronize{
+ TreeTagID_TBL[@path].delete(tag)
+ }
+ self
+ end
+
+ def tag_get(node, *patterns)
+ simplelist(tk_call(@tpath, 'tag', 'get', tagid(node),
+ *(patterns.collect{|pat| tagid(pat)}))).collect{|str|
+ Tk::BLT::Tree::Tag.id2obj(self, str)
+ }
+ end
+
+ def tag_names(node = None)
+ simplelist(tk_call(@tpath, 'tag', 'names', tagid(node))).collect{|str|
+ Tk::BLT::Tree::Tag.id2obj(self, str)
+ }
+ end
+
+ def tag_nodes(tag)
+ simplelist(tk_call(@tpath, 'tag', 'nodes', tagid(tag))).collect{|node|
+ Tk::BLT::Tree::Node.id2obj(self, node)
+ }
+ end
+
+ def tag_set(node, *tags)
+ tk_call(@path, 'tag', 'set', tagid(node), *(tags.collect{|t| tagid(t)}))
+ self
+ end
+
+ def tag_unset(node, *tags)
+ tk_call(@path, 'tag', 'unset', tagid(node),
+ *(tags.collect{|t| tagid(t)}))
+ self
+ end
+
+ def trace_create(*args, &b)
+ Tk::BLT::Tree::Trace.new(self, *args, &b)
+ end
+
+=begin
+ def trace_delete(*args)
+ args.each{|id|
+ if id.kind_of?(Tk::BLT::Tree::Trace)
+ id.delete
+ else
+ tk_call(@path, 'trace', 'delete', id)
+ Tk::BLT::Tree::Trace::TraceID_TBL[@path].delete(id.to_s)
+ end
+ self
+ }
+ end
+=end
+ def trace_delete(*args)
+ args = args.collect{|id| tagid(id)}
+ tk_call(@path, 'trace', 'delete', *args)
+ Tk::BLT::Tree::Trace::TraceID_TBL.mutex.synchronize{
+ args.each{|id| Tk::BLT::Tree::Trace::TraceID_TBL[@path].delete(id.to_s)}
+ }
+ self
+ end
+
+ def trace_info(id)
+ lst = simplelist(tk_call(@path, 'trace', 'info', tagid(id)))
+ lst[0] = Tk::BLT::Tree::Trace.id2obj(self, lst[0])
+ lst[2] = simplelist(lst[2])
+ lst[3] = tk_tcl2ruby(lst[3])
+ lst
+ end
+
+ def trace_names()
+ tk_call(@path, 'trace', 'names').collect{|id|
+ Tk::BLT::Tree::Trace.id2obj(self, id)
+ }
+ end
+
+ def type(node, key)
+ tk_call('::blt::tree', 'type', tagid(node), key)
+ end
+
+ def unset(node, *keys)
+ tk_call('::blt::tree', 'unset', tagid(node), *keys)
+ self
+ end
+
+ def values(node, key=None)
+ simplelist(tk_call('::blt::tree', 'values', tagid(node), key))
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/treeview.rb b/ext/tk/lib/tkextlib/blt/treeview.rb
new file mode 100644
index 0000000000..38d90412e0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/treeview.rb
@@ -0,0 +1,1287 @@
+#
+# tkextlib/blt/treeview.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+require 'tk/validation.rb'
+
+module Tk::BLT
+ class Treeview < TkWindow
+ module ConfigMethod
+ end
+
+ module TagOrID_Methods
+ end
+
+ class Node < TkObject
+ end
+
+ class Tag < TkObject
+ end
+ end
+
+ class Hiertable < Treeview
+ end
+end
+
+######################################
+
+module Tk::BLT::Treeview::ConfigMethod
+ include TkItemConfigMethod
+
+ def __item_boolval_optkeys(id)
+ case id
+ when Array
+ # id := [ 'column', name ]
+ ['edit', 'hide']
+ when 'sort'
+ ['decreasing']
+ else
+ []
+ end
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ case id
+ when Array
+ # id := [ 'column', name ]
+ super() << 'titleforeground' << 'titleshadow'
+ when 'sort'
+ ['decreasing']
+ else
+ []
+ end
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ case id
+ when 'entry'
+ ['bindtags']
+ else
+ []
+ end
+ end
+ private :__item_listval_optkeys
+
+ def __item_cget_cmd(id)
+ if id.kind_of?(Array)
+ # id := [ type, name ]
+ [self.path, id[0], 'cget', id[1]]
+ else
+ [self.path, id, 'cget']
+ end
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ if id.kind_of?(Array)
+ # id := [ type, name ]
+ [self.path, id[0], 'configure', id[1]]
+ else
+ [self.path, id, 'configure']
+ end
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ if id.kind_of?(Array)
+ id = tagid(id[1])
+ end
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ def column_cget_tkstring(name, option)
+ itemcget_tkstring(['column', name], option)
+ end
+ def column_cget(name, option)
+ itemcget(['column', name], option)
+ end
+ def column_cget_strict(name, option)
+ itemcget_strict(['column', name], option)
+ end
+ def column_configure(name, slot, value=None)
+ itemconfigure(['column', name], slot, value)
+ end
+ def column_configinfo(name, slot=nil)
+ itemconfiginfo(['column', name], slot)
+ end
+ def current_column_configinfo(name, slot=nil)
+ current_itemconfiginfo(['column', name], slot)
+ end
+
+ def button_cget_tkstring(option)
+ itemcget_tkstring('button', option)
+ end
+ def button_cget(option)
+ itemcget('button', option)
+ end
+ def button_cget_strict(option)
+ itemcget_strict('button', option)
+ end
+ def button_configure(slot, value=None)
+ itemconfigure('button', slot, value)
+ end
+ def button_configinfo(slot=nil)
+ itemconfiginfo('button', slot)
+ end
+ def current_button_configinfo(slot=nil)
+ current_itemconfiginfo('button', slot)
+ end
+
+ def entry_cget_tkstring(option)
+ itemcget_tkstring('entry', option)
+ end
+ def entry_cget(option)
+ ret = itemcget('entry', option)
+ if option == 'bindtags' || option == :bindtags
+ ret.collect{|tag| TkBindTag.id2obj(tag)}
+ else
+ ret
+ end
+ end
+ def entry_cget_strict(option)
+ ret = itemcget_strict('entry', option)
+ if option == 'bindtags' || option == :bindtags
+ ret.collect{|tag| TkBindTag.id2obj(tag)}
+ else
+ ret
+ end
+ end
+ def entry_configure(slot, value=None)
+ itemconfigure('entry', slot, value)
+ end
+ def entry_configinfo(slot=nil)
+ ret = itemconfiginfo('entry', slot)
+
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ if slot == 'bindtags' || slot == :bindtags
+ ret[-2] = ret[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ ret[-1] = ret[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ end
+ else
+ inf = ret.assoc('bindtags')
+ inf[-2] = inf[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ inf[-1] = inf[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (inf = ret['bindtags'])
+ inf[-2] = inf[-2].collect{|tag| TkBindTag.id2obj(tag)}
+ inf[-1] = inf[-1].collect{|tag| TkBindTag.id2obj(tag)}
+ ret['bindtags'] = inf
+ end
+ end
+
+ ret
+ end
+ def current_entry_configinfo(slot=nil)
+ ret = current_itemconfiginfo('entry', slot)
+
+ if (val = ret['bindtags'])
+ ret['bindtags'] = val.collect{|tag| TkBindTag.id2obj(tag)}
+ end
+
+ ret
+ end
+
+ def sort_cget_tkstring(option)
+ itemcget_tkstring('sort', option)
+ end
+ def sort_cget(option)
+ itemcget('sort', option)
+ end
+ def sort_cget_strict(option)
+ itemcget_strict('sort', option)
+ end
+ def sort_configure(slot, value=None)
+ itemconfigure('sort', slot, value)
+ end
+ def sort_configinfo(slot=nil)
+ itemconfiginfo('sort', slot)
+ end
+ def current_sort_configinfo(slot=nil)
+ current_itemconfiginfo('sort', slot)
+ end
+
+ def text_cget_tkstring(option)
+ itemcget_tkstring('text', option)
+ end
+ def text_cget(option)
+ itemcget('text', option)
+ end
+ def text_cget_strict(option)
+ itemcget_strict('text', option)
+ end
+ def text_configure(slot, value=None)
+ itemconfigure('text', slot, value)
+ end
+ def text_configinfo(slot=nil)
+ itemconfiginfo('text', slot)
+ end
+ def current_text_configinfo(slot=nil)
+ current_itemconfiginfo('text', slot)
+ end
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+class Tk::BLT::Treeview
+ TkCommandNames = ['::blt::treeview'.freeze].freeze
+ WidgetClassName = 'TreeView'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include Scrollable
+ include ValidateConfigure
+ include ItemValidateConfigure
+ include Tk::BLT::Treeview::ConfigMethod
+
+ ########################
+
+ def __boolval_optkeys
+ ['autocreate', 'allowduplicates', 'exportselection', 'flat', 'hideroot',
+ 'newtags', 'showtitles', 'sortselection']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() + ['focusforeground', 'linecolor', 'separator', 'trim']
+ end
+ private :__strval_optkeys
+
+ ########################
+
+ class OpenCloseCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?W, ?w, :widget ],
+ [ ?p, ?s, :name ],
+ [ ?P, ?s, :fullpath ],
+ [ ?#, ?x, :node_id ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ ['opencommand', 'closecomand']
+ end
+ end
+
+ def __validation_class_list
+ super() << OpenCloseCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, OpenCloseCommand)
+
+ ########################
+
+ def __item_validation_class_list(id)
+ case id
+ when 'entry'
+ super(id) << OpenCloseCommand
+ else
+ super(id)
+ end
+ end
+
+ Tk::ItemValidateConfigure.__def_validcmd(binding, OpenCloseCommand)
+
+ ########################
+
+ def __destroy_hook__
+ Tk::BLT::Treeview::Node::TreeNodeID_TBL.mutex.synchronize{
+ Tk::BLT::Treeview::Node::TreeNodeID_TBL.delete(@path)
+ }
+ Tk::BLT::Treeview::Tag::TreeTagID_TBL.mutex.synchronize{
+ Tk::BLT::Treeview::Tag::TreeTagID_TBL.delete(@path)
+ }
+ end
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::BLT::Treeview::Node) \
+ || tag.kind_of?(Tk::BLT::Treeview::Tag)
+ tag.id
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+ private :tagid
+
+ def tagid2obj(tagid)
+ if tagid.kind_of?(Integer)
+ Tk::BLT::Treeview::Node.id2obj(self, tagid.to_s)
+ elsif tagid.kind_of?(String)
+ if tagid =~ /^\d+$/
+ Tk::BLT::Treeview::Node.id2obj(self, tagid)
+ else
+ Tk::BLT::Treeview::Tag.id2obj(self, tagid)
+ end
+ else
+ tagid
+ end
+ end
+
+ def bbox(*tags)
+ list(tk_send('bbox', *(tags.collect{|tag| tagid(tag)})))
+ end
+
+ def screen_bbox(*tags)
+ list(tk_send('bbox', '-screen', *(tags.collect{|tag| tagid(tag)})))
+ end
+
+ def tag_bind(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@path, 'bind', tagid(tag)], seq, cmd, *args)
+ self
+ end
+ def tag_bind_append(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@path, 'bind', tagid(tag)], seq, cmd, *args)
+ self
+ end
+ def tag_bind_remove(tag, seq)
+ _bind_remove([@path, 'bind', tagid(tag)], seq)
+ self
+ end
+ def tag_bindinfo(tag, seq=nil)
+ _bindinfo([@path, 'bind', tagid(tag)], seq)
+ end
+
+ def button_activate(tag)
+ tk_send('button', 'activate', tagid(tag))
+ self
+ end
+
+ def button_bind(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
+ self
+ end
+ def button_bind_append(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
+ self
+ end
+ def button_bind_remove(tag, seq)
+ _bind_remove([@path, 'button', 'bind', tagid(tag)], seq)
+ self
+ end
+ def button_bindinfo(tag, seq=nil)
+ _bindinfo([@path, 'button', 'bind', tagid(tag)], seq)
+ end
+
+ def close(*tags)
+ tk_send('close', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+ def close_recurse(*tags)
+ tk_send('close', '-recurse', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+
+ def column_activate(column=None)
+ if column == None
+ tk_send('column', 'activate')
+ else
+ tk_send('column', 'activate', column)
+ self
+ end
+ end
+
+ def column_delete(*fields)
+ tk_send('column', 'delete', *fields)
+ self
+ end
+ def column_insert(pos, field, *opts)
+ tk_send('column', 'insert', pos, field, *opts)
+ self
+ end
+ def column_invoke(field)
+ tk_send('column', 'invoke', field)
+ self
+ end
+ def column_move(name, dest)
+ tk_send('column', 'move', name, dest)
+ self
+ end
+ def column_names()
+ simplelist(tk_send('column', 'names'))
+ end
+ def column_nearest(x, y=None)
+ tk_send('column', 'nearest', x, y)
+ end
+
+ def curselection
+ simplelist(tk_send('curselection')).collect{|id| tagid2obj(id)}
+ end
+
+ def delete(*tags)
+ tk_send('delete', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+
+ def entry_activate(tag)
+ tk_send('entry', 'activate', tagid(tag))
+ self
+ end
+ def entry_children(tag, first=None, last=None)
+ simplelist(tk_send('entry', 'children', tagid(tag),
+ first, last)).collect{|id| tagid2obj(id)}
+ end
+ def entry_delete(tag, first=None, last=None)
+ tk_send('entry', 'delete', tagid(tag), first, last)
+ end
+ def entry_before?(tag1, tag2)
+ bool(tk_send('entry', 'isbefore', tagid(tag1), tagid(tag2)))
+ end
+ def entry_hidden?(tag)
+ bool(tk_send('entry', 'ishidden', tagid(tag)))
+ end
+ def entry_open?(tag)
+ bool(tk_send('entry', 'isopen', tagid(tag)))
+ end
+
+ def entry_size(tag)
+ number(tk_send('entry', 'size', tagid(tag)))
+ end
+ def entry_size_recurse(tag)
+ number(tk_send('entry', 'size', '-recurse', tagid(tag)))
+ end
+
+ def _search_flags(keys)
+ keys = _symbolkey2str(keys)
+ keys['exact'] = None if keys.delete('exact')
+ keys['glob'] = None if keys.delete('glob')
+ keys['regexp'] = None if keys.delete('regexp')
+ keys['nonmatching'] = None if keys.delete('nonmatching')
+ end
+ private :_search_flags
+
+ ################################
+
+ class FindExecFlagValue < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?W, ?w, :widget ],
+ [ ?p, ?s, :name ],
+ [ ?P, ?s, :fullpath ],
+ [ ?#, ?x, :node_id ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ []
+ end
+ end
+
+ def _find_exec_flag_value(val)
+ if val.kind_of?(Array)
+ cmd, *args = val
+ #FindExecFlagValue.new(cmd, args.join(' '))
+ FindExecFlagValue.new(cmd, *args)
+ elsif TkComm._callback_entry?(val)
+ FindExecFlagValue.new(val)
+ else
+ val
+ end
+ end
+
+ ################################
+
+ def find(first, last, keys={})
+ keys = _search_flags(keys)
+ keys['exec'] = _find_exec_flag_value(keys['exec']) if keys.key?('exec')
+ args = hash_kv(keys) << '--' << tagid(first) << tagid(last)
+ simplelist(tk_send('find', *args)).collect{|id| tagid2obj(id)}
+ end
+
+ def tag_focus(tag)
+ tk_send('focus', tagid(tag))
+ self
+ end
+ def get(*tags)
+ simplelist(tk_send('get', *(tags.collect{|tag| tagid(tag)})))
+ end
+ def get_full(*tags)
+ simplelist(tk_send('get', '-full', *(tags.collect{|tag| tagid(tag)})))
+ end
+
+ def hide(*tags)
+ if tags[-1].kind_of?(Hash)
+ keys = tags.pop
+ else
+ keys = {}
+ end
+ keys = _search_flags(keys)
+ args = hash_kv(keys) << '--'
+ args.concat(tags.collect{|t| tagid(t)})
+ tk_send('hide', *args)
+ self
+ end
+
+ def index(str)
+ tagid2obj(tk_send('index', str))
+ end
+ def index_at(tag, str)
+ tagid2obj(tk_send('index', '-at', tagid(tag), str))
+ end
+ def index_at_path(tag, str)
+ tagid2obj(tk_send('index', '-at', tagid(tag), '-path', str))
+ end
+
+ def insert(pos, parent=nil, keys={})
+ Tk::BLT::Treeview::Node.new(pos, parent, keys)
+ end
+ def insert_at(tag, pos, parent=nil, keys={})
+ if parent.kind_of?(Hash)
+ keys = parent
+ parent = nil
+ end
+
+ keys = _symbolkey2str(keys)
+ keys['at'] = tagid(tag)
+
+ Tk::BLT::Treeview::Node.new(pos, parent, keys)
+ end
+
+ def move_before(tag, dest)
+ tk_send('move', tagid(tag), 'before', tagid(dest))
+ self
+ end
+ def move_after(tag, dest)
+ tk_send('move', tagid(tag), 'after', tagid(dest))
+ self
+ end
+ def move_into(tag, dest)
+ tk_send('move', tagid(tag), 'into', tagid(dest))
+ self
+ end
+
+ def nearest(x, y, var=None)
+ tagid2obj(tk_send('nearest', x, y, var))
+ end
+
+ def open(*tags)
+ tk_send('open', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+ def open_recurse(*tags)
+ tk_send('open', '-recurse', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+
+ def range(first, last)
+ simplelist(tk_send('range', tagid(first), tagid(last))).collect{|id|
+ tagid2obj(id)
+ }
+ end
+ def range_open(first, last)
+ simplelist(tk_send('range', '-open',
+ tagid(first), tagid(last))).collect{|id|
+ tagid2obj(id)
+ }
+ end
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+
+ def see(tag)
+ tk_send_without_enc('see', tagid(tag))
+ self
+ end
+ def see_anchor(anchor, tag)
+ tk_send_without_enc('see', '-anchor', anchor, tagid(tag))
+ self
+ end
+
+ def selection_anchor(tag)
+ tk_send_without_enc('selection', 'anchor', tagid(tag))
+ self
+ end
+ def selection_cancel()
+ tk_send_without_enc('selection', 'cancel')
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', tagid(first), tagid(last))
+ self
+ end
+ def selection_clear_all()
+ tk_send_without_enc('selection', 'clearall')
+ self
+ end
+ def selection_mark(tag)
+ tk_send_without_enc('selection', 'mark', tagid(tag))
+ self
+ end
+ def selection_include?(tag)
+ bool(tk_send('selection', 'include', tagid(tag)))
+ end
+ def selection_present?()
+ bool(tk_send('selection', 'present'))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', tagid(first), tagid(last))
+ self
+ end
+ def selection_toggle(first, last=None)
+ tk_send_without_enc('selection', 'toggle', tagid(first), tagid(last))
+ self
+ end
+
+ def show(*tags)
+ if tags[-1].kind_of?(Hash)
+ keys = tags.pop
+ else
+ keys = {}
+ end
+ keys = _search_flags(keys)
+ args = hash_kv(keys) << '--'
+ args.concat(tags.collect{|t| tagid(t)})
+ tk_send('show', *args)
+ self
+ end
+
+ def sort_auto(mode)
+ tk_send('sort', 'auto', mode)
+ self
+ end
+ def sort_auto=(mode)
+ tk_send('sort', 'auto', mode)
+ mode
+ end
+ def sort_auto?
+ bool(tk_send('sort', 'auto'))
+ end
+ def sort_once(*tags)
+ tk_send('sort', 'once', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+ def sort_once_recurse(*tags)
+ tk_send('sort', 'once', '-recurse', *(tags.collect{|tag| tagid(tag)}))
+ self
+ end
+
+ def tag_add(tag, *ids)
+ tk_send('tag', 'add', tagid(tag), *ids)
+ self
+ end
+ def tag_delete(tag, *ids)
+ tk_send('tag', 'delete', tagid(tag), *ids)
+ self
+ end
+ def tag_forget(tag)
+ tk_send('tag', 'forget', tagid(tag))
+ self
+ end
+ def tag_names(id=nil)
+ id = (id)? tagid(id): None
+
+ simplelist(tk_send('tag', 'nodes', id)).collect{|tag|
+ Tk::BLT::Treeview::Tag.id2obj(self, tag)
+ }
+ end
+ def tag_nodes(tag)
+ simplelist(tk_send('tag', 'nodes', tagid(tag))).collect{|id|
+ Tk::BLT::Treeview::Node.id2obj(self, id)
+ }
+ end
+
+ def text_apply
+ tk_send('text', 'apply')
+ self
+ end
+ def text_cancel
+ tk_send('text', 'cancel')
+ self
+ end
+
+ def text_delete(first, last)
+ tk_send('text', 'delete', first, last)
+ self
+ end
+ def text_get(x, y)
+ tk_send('text', 'get', x, y)
+ end
+ def text_get_root(x, y)
+ tk_send('text', 'get', '-root', x, y)
+ end
+ def text_icursor(idx)
+ tk_send('text', 'icursor', idx)
+ self
+ end
+ def text_index(idx)
+ num_or_str(tk_send('text', 'index', idx))
+ end
+ def text_insert(idx, str)
+ tk_send('text', 'insert', idx, str)
+ self
+ end
+
+ def text_selection_adjust(idx)
+ tk_send('text', 'selection', 'adjust', idx)
+ self
+ end
+ def text_selection_clear
+ tk_send('text', 'selection', 'clear')
+ self
+ end
+ def text_selection_from(idx)
+ tk_send('text', 'selection', 'from', idx)
+ self
+ end
+ def text_selection_present
+ num_or_str(tk_send('text', 'selection', 'present'))
+ end
+ def text_selection_range(start, last)
+ tk_send('text', 'selection', 'range', start, last)
+ self
+ end
+ def text_selection_to(idx)
+ tk_send('text', 'selection', 'to', idx)
+ self
+ end
+
+ def toggle(tag)
+ tk_send('toggle', tagid(tag))
+ self
+ end
+end
+
+######################################
+
+module Tk::BLT::Treeview::TagOrID_Methods
+ def bbox
+ @tree.bbox(self)
+ end
+ def screen_bbox
+ @tree.screen_bbox(self)
+ end
+
+ def bind(seq, *args)
+ @tree.tag_bind(self, seq, *args)
+ self
+ end
+ def bind_append(seq, *args)
+ @tree.tag_bind_append(self, seq, *args)
+ self
+ end
+ def bind_remove(seq)
+ @tree.tag_bind_remove(self, seq)
+ self
+ end
+ def bindinfo(seq=nil)
+ @tree.tag_bindinfo(self, seq)
+ end
+
+ def button_activate
+ @tree.button_activate(self)
+ self
+ end
+
+ def button_bind(seq, *args)
+ @tree.button_bind(self, seq, *args)
+ self
+ end
+ def button_bind_append(seq, *args)
+ @tree.button_bind_append(self, seq, *args)
+ self
+ end
+ def button_bind_remove(seq)
+ @tree.button_bind_remove(self, seq)
+ self
+ end
+ def button_bindinfo(seq=nil)
+ @tree.button_bindinfo(self, seq)
+ end
+
+ def close
+ @tree.close(self)
+ self
+ end
+ def close_recurse
+ @tree.close_recurse(self)
+ self
+ end
+
+ def delete
+ @tree.delete(self)
+ self
+ end
+
+ def entry_activate
+ @tree.entry_activate(self)
+ self
+ end
+ def entry_children(first=None, last=None)
+ @tree.entry_children(self, first, last)
+ end
+ def entry_delete(first=None, last=None)
+ @tree.entry_delete(self, first, last)
+ end
+ def entry_before?(tag)
+ @tree.entry_before?(self, tag)
+ end
+ def entry_hidden?
+ @tree.entry_before?(self)
+ end
+ def entry_open?
+ @tree.entry_open?(self)
+ end
+
+ def entry_size
+ @tree.entry_size(self)
+ end
+ def entry_size_recurse
+ @tree.entry_size_recurse(self)
+ end
+
+ def focus
+ @tree.tag_focus(self)
+ self
+ end
+
+ def get
+ @tree.get(self)
+ end
+ def get_full
+ @tree.get_full(self)
+ end
+
+ def hide
+ @tree.hide(self)
+ self
+ end
+
+ def index(str)
+ @tree.index_at(self, str)
+ end
+ def index_path(str)
+ @tree.index_at_path(self, str)
+ end
+
+ def insert(pos, parent=nil, keys={})
+ @tree.insert_at(self, pos, parent, keys)
+ end
+
+ def move_before(dest)
+ @tree.move_before(self, dest)
+ self
+ end
+ def move_after(dest)
+ @tree.move_after(self, dest)
+ self
+ end
+ def move_into(dest)
+ @tree.move_into(self, dest)
+ self
+ end
+
+ def open
+ @tree.open(self)
+ self
+ end
+ def open_recurse
+ @tree.open_recurse(self)
+ self
+ end
+
+ def range_to(tag)
+ @tree.range(self, tag)
+ end
+ def range_open_to(tag)
+ @tree.range(self, tag)
+ end
+
+ def see
+ @tree.see(self)
+ self
+ end
+ def see_anchor(anchor)
+ @tree.see_anchor(anchor, self)
+ self
+ end
+
+ def selection_anchor
+ @tree.selection_anchor(self)
+ self
+ end
+ def selection_clear
+ @tree.selection_clear(self)
+ self
+ end
+ def selection_mark
+ @tree.selection_mark(self)
+ self
+ end
+ def selection_include?
+ @tree.selection_include?(self)
+ end
+ def selection_set
+ @tree.selection_set(self)
+ self
+ end
+ def selection_toggle
+ @tree.selection_toggle(self)
+ self
+ end
+
+ def show
+ @tree.show(self)
+ self
+ end
+
+ def sort_once
+ @tree.sort_once(self)
+ self
+ end
+ def sort_once_recurse
+ @tree.sort_once_recurse(self)
+ self
+ end
+
+ def toggle
+ @tree.toggle(self)
+ self
+ end
+end
+
+######################################
+
+class Tk::BLT::Treeview::Node < TkObject
+ include Tk::BLT::Treeview::TagOrID_Methods
+
+ TreeNodeID_TBL = TkCore::INTERP.create_table
+
+ (TreeNode_ID = ['blt_treeview_node'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TreeNodeID_TBL.mutex.synchronize{ TreeNodeID_TBL.clear }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ TreeNodeID_TBL.mutex.synchronize{
+ if TreeNodeID_TBL[tpath]
+ if TreeNodeID_TBL[tpath][id]
+ TreeNodeID_TBL[tpath][id]
+ else
+ begin
+ # self.new(tree, nil, nil, 'node'=>Integer(id))
+ unless (tk_call(@tpath, 'get', id)).empty?
+ id = Integer(id)
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = id
+ TreeNodeID_TBL[@tpath] ||= {}
+ TreeNodeID_TBL[@tpath][@id] = self
+ }
+ obj
+ else
+ id
+ end
+ rescue
+ id
+ end
+ end
+ else
+ id
+ end
+ }
+ end
+
+ def self.new(tree, pos, parent=nil, keys={})
+ if parent.kind_of?(Hash)
+ keys = parent
+ parent = nil
+ end
+
+ keys = _symbolkey2str(keys)
+ tpath = tree.path
+
+ TreeNodeID_TBL.mutex.synchronize{
+ TreeNodeID_TBL[tpath] ||= {}
+ if (id = keys['node']) && (obj = TreeNodeID_TBL[tpath][id])
+ keys.delete('node')
+ tk_call(tree.path, 'move', id, pos, parent) if parent
+ return obj
+ end
+
+ #super(tree, pos, parent, keys)
+ (obj = self.allocate).instance_eval{
+ initialize(tree, pos, parent, keys)
+ TreeNodeID_TBL[tpath][@id] = self
+ }
+ obj
+ }
+ end
+
+ def initialize(tree, pos, parent, keys)
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ if (id = keys['node'])
+ # if tk_call(@tpath, 'get', id).empty?
+ # fail RuntimeError, "not exist the node '#{id}'"
+ # end
+ @path = @id = id
+ tk_call(@tpath, 'move', @id, pos, tagid(parent)) if parent
+ configure(keys) if keys && ! keys.empty?
+ else
+ name = nil
+ TreeNode_ID.mutex.synchronize{
+ name = TreeNode_ID.join(TkCore::INTERP._ip_id_).freeze
+ TreeNode_ID[1].succ!
+ }
+
+ at = keys.delete['at']
+
+ if parent
+ if parent.kind_of?(Tk::BLT::Treeview::Node) ||
+ parent.kind_of?(Tk::BLT::Treeview::Tag)
+ path = [get_full(parent.id)[0], name]
+ at = nil # ignore 'at' option
+ else
+ path = [parent.to_s, name]
+ end
+ else
+ path = name
+ end
+
+ if at
+ @id = tk_call(@tpath, 'insert', '-at', tagid(at), pos, path, keys)
+ else
+ @id = tk_call(@tpath, 'insert', pos, path, keys)
+ end
+ @path = @id
+ end
+ end
+
+ def id
+ @id
+ end
+end
+
+######################################
+
+class Tk::BLT::Treeview::Tag < TkObject
+ include Tk::BLT::Treeview::TagOrID_Methods
+
+ TreeTagID_TBL = TkCore::INTERP.create_table
+
+ (TreeTag_ID = ['blt_treeview_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TreeTagID_TBL.mutex.synchronize{ TreeTagID_TBL.clear }
+ }
+
+ def self.id2obj(tree, name)
+ tpath = tree.path
+ TreeTagID_TBL.mutex.synchronize{
+ if TreeTagID_TBL[tpath]
+ if TreeTagID_TBL[tpath][name]
+ TreeTagID_TBL[tpath][name]
+ else
+ #self.new(tree, name)
+ (obj = self.allocate).instance_eval{
+ @parent = @tree = tree
+ @tpath = @parent.path
+ @path = @id = name
+ TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
+ TreeTagID_TBL[@tpath][@id] = self
+ }
+ obj
+ end
+ else
+ id
+ end
+ }
+ end
+
+ def self.new_by_name(tree, name, *ids)
+ TreeTagID_TBL.mutex.synchronize{
+ unless (obj = TreeTagID_TBL[tree.path][name])
+ (obj = self.allocate).instance_eval{
+ initialize(tree, name, ids)
+ TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
+ TreeTagID_TBL[@tpath][@id] = self
+ }
+ end
+ obj
+ }
+ end
+
+ def self.new(tree, *ids)
+ TreeTagID_TBL.mutex.synchronize{
+ (obj = self.allocate).instance_eval{
+ if tree.kind_of?(Array)
+ initialize(tree[0], tree[1], ids)
+ else
+ initialize(tree, nil, ids)
+ end
+ TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
+ TreeTagID_TBL[@tpath][@id] = self
+ }
+ obj
+ }
+ end
+
+ def initialize(tree, name, ids)
+ @parent = @tree = tree
+ @tpath = @parent.path
+
+ if name
+ @path = @id = name
+ else
+ TreeTag_ID.mutex.synchronize{
+ @path = @id = TreeTag_ID.join(TkCore::INTERP._ip_id_).freeze
+ TreeTag_ID[1].succ!
+ }
+ end
+
+ unless ids.empty?
+ tk_call(@tpath, 'tag', 'add', @id, *(ids.collect{|id| tagid(id)}))
+ end
+ end
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::BLT::Treeview::Node) \
+ || tag.kind_of?(Tk::BLT::Treeview::Tag)
+ tag.id
+ else
+ tag
+ end
+ end
+ private :tagid
+
+ def id
+ @id
+ end
+
+ def add(*ids)
+ tk_call(@tpath, 'tag', 'add', @id, *(ids{|id| tagid(id)}))
+ self
+ end
+
+ def remove(*ids)
+ tk_call(@tpath, 'tag', 'delete', @id, *(ids{|id| tagid(id)}))
+ self
+ end
+
+ def forget
+ tk_call(@tpath, 'tag', 'forget', @id)
+ self
+ end
+
+ def nodes
+ simplelist(tk_call(@tpath, 'tag', 'nodes', @id)).collect{|id|
+ Tk::BLT::Treeview::Node.id2obj(@tree, id)
+ }
+ end
+end
+
+class Tk::BLT::Hiertable
+ TkCommandNames = ['::blt::hiertable'.freeze].freeze
+ WidgetClassName = 'Hiertable'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/blt/unix_dnd.rb b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
new file mode 100644
index 0000000000..8996f7c891
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/unix_dnd.rb
@@ -0,0 +1,141 @@
+#
+# tkextlib/blt/unix_dnd.rb
+#
+# *** This is alpha version, because there is no document on BLT. ***
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module DnD
+ extend TkCore
+
+ TkCommandNames = ['::blt::dnd'.freeze].freeze
+
+ ##############################
+
+ extend TkItemConfigMethod
+
+ class << self
+ def __item_cget_cmd(id)
+ ['::blt::dnd', *id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ ['::blt::dnd', *id]
+ end
+ private :__item_config_cmd
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ def cget_tkstring(win, option)
+ itemcget_tkstring(['cget', win], option)
+ end
+ def cget(win, option)
+ itemcget(['cget', win], option)
+ end
+ def cget_strict(win, option)
+ itemcget_strict(['cget', win], option)
+ end
+ def configure(win, slot, value=None)
+ itemconfigure(['configure', win], slot, value)
+ end
+ def configinfo(win, slot=nil)
+ itemconfiginfo(['configure', win], slot)
+ end
+ def current_configinfo(win, slot=nil)
+ current_itemconfiginfo(['configure', win], slot)
+ end
+
+ def token_cget_tkstring(win, option)
+ itemcget_tkstring(['token', 'cget', win], option)
+ end
+ def token_cget(win, option)
+ itemcget(['token', 'cget', win], option)
+ end
+ def token_cget_strict(win, option)
+ itemcget_strict(['token', 'cget', win], option)
+ end
+ def token_configure(win, slot, value=None)
+ itemconfigure(['token', 'configure', win], slot, value)
+ end
+ def token_configinfo(win, slot=nil)
+ itemconfiginfo(['token', 'configure', win], slot)
+ end
+ def current_token_configinfo(win, slot=nil)
+ current_itemconfiginfo(['token', 'configure', win], slot)
+ end
+
+ def token_windowconfigure(win, slot, value=None)
+ itemconfigure(['token', 'window', win], slot, value)
+ end
+ def token_windowconfiginfo(win, slot=nil)
+ itemconfiginfo(['token', 'window', win], slot)
+ end
+ def current_token_windowconfiginfo(win, slot=nil)
+ current_itemconfiginfo(['token', 'window', win], slot)
+ end
+ end
+
+ ##############################
+
+ def self.cancel(win)
+ tk_call('::blt::dnd', 'cancel', *wins)
+ end
+ def self.delete(*wins)
+ tk_call('::blt::dnd', 'delete', *wins)
+ end
+ def self.delete_source(*wins)
+ tk_call('::blt::dnd', 'delete', '-source', *wins)
+ end
+ def self.delete_target(*wins)
+ tk_call('::blt::dnd', 'delete', '-target', *wins)
+ end
+ def self.drag(win, x, y, token=None)
+ tk_call('::blt::dnd', 'drag', win, x, y, token)
+ end
+ def self.drop(win, x, y, token=None)
+ tk_call('::blt::dnd', 'drop', win, x, y, token)
+ end
+ def self.get_data(win, fmt=nil, cmd=nil)
+ if fmt
+ tk_call('::blt::dnd', 'getdata', win, fmt, cmd)
+ else
+ list(tk_call('::blt::dnd', 'getdata', win))
+ end
+ end
+ def self.names(pat=None)
+ list(tk_call('::blt::dnd', 'names', pat))
+ end
+ def self.source_names(pat=None)
+ list(tk_call('::blt::dnd', 'names', '-source', pat))
+ end
+ def self.target_names(pat=None)
+ list(tk_call('::blt::dnd', 'names', '-target', pat))
+ end
+ def self.pull(win, fmt)
+ tk_call('::blt::dnd', 'pull', win, fmt)
+ end
+ def self.register(win, keys={})
+ tk_call('::blt::dnd', 'register', win, keys)
+ end
+ def self.select(win, x, y, timestamp)
+ tk_call('::blt::dnd', 'select', win, x, y, timestamp)
+ end
+ def self.set_data(win, fmt=nil, cmd=nil)
+ if fmt
+ tk_call('::blt::dnd', 'setdata', win, fmt, cmd)
+ else
+ list(tk_call('::blt::dnd', 'setdata', win))
+ end
+ end
+ def self.token(*args)
+ tk_call('::blt::dnd', 'token', *args)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/vector.rb b/ext/tk/lib/tkextlib/blt/vector.rb
new file mode 100644
index 0000000000..742e901d3e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/vector.rb
@@ -0,0 +1,256 @@
+#
+# tkextlib/blt/vector.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Vector < TkVariable
+ TkCommandNames = ['::blt::vector'.freeze].freeze
+
+ def self.create(*args)
+ tk_call('::blt::vector', 'create', *args)
+ end
+
+ def self.destroy(*args)
+ tk_call('::blt::vector', 'destroy', *args)
+ end
+
+ def self.expr(expression)
+ tk_call('::blt::vector', 'expr', expression)
+ end
+
+ def self.names(pat=None)
+ list = simplelist(tk_call('::blt::vector', 'names', pat))
+ TkVar_ID_TBL.mutex.synchronize{
+ list.collect{|name|
+ if TkVar_ID_TBL[name]
+ TkVar_ID_TBL[name]
+ elsif name[0..1] == '::' && TkVar_ID_TBL[name[2..-1]]
+ TkVar_ID_TBL[name[2..-1]]
+ else
+ name
+ end
+ }
+ }
+ end
+
+ ####################################
+
+ def initialize(size=nil, keys={})
+ if size.kind_of?(Hash)
+ keys = size
+ size = nil
+ end
+ if size.kind_of?(Array)
+ # [first, last]
+ size = size.join(':')
+ end
+ if size
+ @id = TkCore::INTERP._invoke('::blt::vector', 'create',
+ "#auto(#{size})", *hash_kv(keys))
+ else
+ @id = TkCore::INTERP._invoke('::blt::vector', 'create',
+ "#auto", *hash_kv(keys))
+ end
+
+ TkVar_ID_TBL.mutex.synchronize{
+ TkVar_ID_TBL[@id] = self
+ }
+
+ @def_default = false
+ @default_val = nil
+
+ @trace_var = nil
+ @trace_elem = nil
+ @trace_opts = nil
+
+ # teach Tk-ip that @id is global var
+ TkCore::INTERP._invoke_without_enc('global', @id)
+ end
+
+ def destroy
+ tk_call('::blt::vector', 'destroy', @id)
+ end
+
+ def inspect
+ '#<Tk::BLT::Vector: ' + @id + '>'
+ end
+
+ def to_s
+ @id
+ end
+
+ def *(item)
+ list(tk_call(@id, '*', item))
+ end
+
+ def +(item)
+ list(tk_call(@id, '+', item))
+ end
+
+ def -(item)
+ list(tk_call(@id, '-', item))
+ end
+
+ def /(item)
+ list(tk_call(@id, '/', item))
+ end
+
+ def append(*vectors)
+ tk_call(@id, 'append', *vectors)
+ end
+
+ def binread(channel, len=None, keys={})
+ if len.kind_of?(Hash)
+ keys = len
+ len = None
+ end
+ keys = _symbolkey2str(keys)
+ keys['swap'] = None if keys.delete('swap')
+ tk_call(@id, 'binread', channel, len, keys)
+ end
+
+ def clear()
+ tk_call(@id, 'clear')
+ self
+ end
+
+ def delete(*indices)
+ tk_call(@id, 'delete', *indices)
+ self
+ end
+
+ def dup_vector(vec)
+ tk_call(@id, 'dup', vec)
+ self
+ end
+
+ def expr(expression)
+ tk_call(@id, 'expr', expression)
+ self
+ end
+
+ def index(idx, val=None)
+ number(tk_call(@id, 'index', idx, val))
+ end
+
+ def [](idx)
+ index(idx)
+ end
+
+ def []=(idx, val)
+ index(idx, val)
+ end
+
+ def length()
+ number(tk_call(@id, 'length'))
+ end
+
+ def length=(size)
+ number(tk_call(@id, 'length', size))
+ end
+
+ def merge(*vectors)
+ tk_call(@id, 'merge', *vectors)
+ self
+ end
+
+ def normalize(vec=None)
+ tk_call(@id, 'normalize', vec)
+ self
+ end
+
+ def notify(keyword)
+ tk_call(@id, 'notify', keyword)
+ self
+ end
+
+ def offset()
+ number(tk_call(@id, 'offset'))
+ end
+
+ def offset=(val)
+ number(tk_call(@id, 'offset', val))
+ end
+
+ def random()
+ tk_call(@id, 'random')
+ end
+
+ def populate(vector, density=None)
+ tk_call(@id, 'populate', vector, density)
+ self
+ end
+
+ def range(first, last=None)
+ list(tk_call(@id, 'range', first, last))
+ end
+
+ def search(val1, val2=None)
+ list(tk_call(@id, 'search', val1, val2))
+ end
+
+ def set(item)
+ tk_call(@id, 'set', item)
+ self
+ end
+
+ def seq(start, finish=None, step=None)
+ tk_call(@id, 'seq', start, finish, step)
+ self
+ end
+
+ def sort(*vectors)
+ tk_call(@id, 'sort', *vectors)
+ self
+ end
+
+ def sort_reverse(*vectors)
+ tk_call(@id, 'sort', '-reverse', *vectors)
+ self
+ end
+
+ def split(*vectors)
+ tk_call(@id, 'split', *vectors)
+ self
+ end
+
+ def variable(var)
+ tk_call(@id, 'variable', var)
+ self
+ end
+ end
+
+ class VectorAccess < Vector
+ def self.new(name)
+ TkVar_ID_TBL.mutex.synchronize{
+ if TkVar_ID_TBL[name]
+ TkVar_ID_TBL[name]
+ else
+ (obj = self.allocate).instance_eval{
+ initialize(name)
+ TkVar_ID_TBL[@id] = self
+ }
+ obj
+ end
+ }
+ end
+
+ def initialize(vec_name)
+ @id = vec_name
+
+ @def_default = false
+ @default_val = nil
+
+ @trace_var = nil
+ @trace_elem = nil
+ @trace_opts = nil
+
+ # teach Tk-ip that @id is global var
+ TkCore::INTERP._invoke_without_enc('global', @id)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/watch.rb b/ext/tk/lib/tkextlib/blt/watch.rb
new file mode 100644
index 0000000000..292623ff58
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/watch.rb
@@ -0,0 +1,175 @@
+#
+# tkextlib/blt/watch.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Watch < TkObject
+ extend TkCore
+
+ TkCommandNames = ['::blt::watch'.freeze].freeze
+
+ WATCH_ID_TBL = TkCore::INTERP.create_table
+
+ (BLT_WATCH_ID = ['blt_watch_id'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ WATCH_ID_TBL.mutex.synchronize{ WATCH_ID_TBL.clear }
+ }
+
+ def self.names(state = None)
+ lst = tk_split_list(tk_call('::blt::watch', 'names', state))
+ WATCH_ID_TBL.mutex.synchronize{
+ lst.collect{|name|
+ WATCH_ID_TBL[name] || name
+ }
+ }
+ end
+
+ def __numval_optkeys
+ ['maxlevel']
+ end
+ private :__numval_optkeys
+
+ def __boolval_optkeys
+ ['active']
+ end
+ private :__boolval_optkeys
+
+ def __config_cmd
+ ['::blt::watch', 'configure', self.path]
+ end
+ private :__config_cmd
+
+ def initialize(name = nil, keys = {})
+ if name.kind_of?(Hash)
+ keys = name
+ name = nil
+ end
+
+ if name
+ @id = name.to_s
+ else
+ BLT_WATCH_ID.mutex.synchronize{
+ @id = BLT_WATCH_ID.join(TkCore::INTERP._ip_id_)
+ BLT_WATCH_ID[1].succ!
+ }
+ end
+
+ @path = @id
+
+ WATCH_ID_TBL.mutex.synchronize{
+ WATCH_ID_TBL[@id] = self
+ }
+ tk_call('::blt::watch', 'create', @id, *hash_kv(keys))
+ end
+
+ def activate
+ tk_call('::blt::watch', 'activate', @id)
+ self
+ end
+ def deactivate
+ tk_call('::blt::watch', 'deactivate', @id)
+ self
+ end
+ def delete
+ tk_call('::blt::watch', 'delete', @id)
+ self
+ end
+ def info
+ ret = []
+ lst = tk_split_simplelist(tk_call('::blt::watch', 'info', @id))
+ until lst.empty?
+ k, v, *lst = lst
+ k = k[1..-1]
+ case k
+ when /^(#{__strval_optkeys.join('|')})$/
+ # do nothing
+
+ when /^(#{__numval_optkeys.join('|')})$/
+ begin
+ v = number(v)
+ rescue
+ v = nil
+ end
+
+ when /^(#{__numstrval_optkeys.join('|')})$/
+ v = num_or_str(v)
+
+ when /^(#{__boolval_optkeys.join('|')})$/
+ begin
+ v = bool(v)
+ rescue
+ v = nil
+ end
+
+ when /^(#{__listval_optkeys.join('|')})$/
+ v = simplelist(v)
+
+ when /^(#{__numlistval_optkeys.join('|')})$/
+ v = list(v)
+
+ else
+ if v.index('{')
+ v = tk_split_list(v)
+ else
+ v = tk_tcl2ruby(v)
+ end
+ end
+
+ ret << [k, v]
+ end
+
+ ret
+ end
+ def configinfo(slot = nil)
+ if slot
+ slot = slot.to_s
+ v = cget(slot)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ [slot, v]
+ else
+ {slot=>v}
+ end
+ else
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ info
+ else
+ Hash[*(info.flatten)]
+ end
+ end
+ end
+ def cget_strict(key)
+ key = key.to_s
+ begin
+ info.assoc(key)[1]
+ rescue
+ fail ArgumentError, "unknown option '#{key}'"
+ end
+ end
+ def cget(key)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ cget_strict(key)
+ else
+ begin
+ cget_strict(key)
+ rescue => e
+ if current_configinfo.has_key?(key.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/win_printer.rb b/ext/tk/lib/tkextlib/blt/win_printer.rb
new file mode 100644
index 0000000000..7ac6a0dcfc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/win_printer.rb
@@ -0,0 +1,61 @@
+#
+# tkextlib/blt/win_printer.rb
+#
+# *** Windows only ***
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ class Printer < TkObject
+ extend TkCore
+
+ TkCommandNames = ['::blt::printer'.freeze].freeze
+
+ def self.enum(attribute)
+ simplelist(tk_call('::blt::printer', 'enum', attribute))
+ end
+
+ def self.names(pat=None)
+ simplelist(tk_call('::blt::printer', 'names', pat))
+ end
+
+ def self.open(printer)
+ self.new(printer)
+ end
+
+ #################################
+
+ def initialize(printer)
+ @printer_id = tk_call('::blt::printer', 'open', printer)
+ end
+
+ def close
+ tk_call('::blt::print', 'close', @printer_id)
+ self
+ end
+ def get_attrs(var)
+ tk_call('::blt::print', 'getattrs', @printer_id, var)
+ var
+ end
+ def set_attrs(var)
+ tk_call('::blt::print', 'setattrs', @printer_id, var)
+ self
+ end
+ def snap(win)
+ tk_call('::blt::print', 'snap', @printer_id, win)
+ self
+ end
+ def write(str)
+ tk_call('::blt::print', 'write', @printer_id, str)
+ self
+ end
+ def write_with_title(title, str)
+ tk_call('::blt::print', 'write', @printer_id, title, str)
+ self
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/blt/winop.rb b/ext/tk/lib/tkextlib/blt/winop.rb
new file mode 100644
index 0000000000..03bdb60810
--- /dev/null
+++ b/ext/tk/lib/tkextlib/blt/winop.rb
@@ -0,0 +1,107 @@
+#
+# tkextlib/blt/winop.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/blt.rb'
+
+module Tk::BLT
+ module Winop
+ extend TkCore
+
+ TkCommandNames = ['::blt::winop'.freeze].freeze
+ end
+ WinOp = Winop
+end
+
+class << Tk::BLT::Winop
+ def changes(win)
+ tk_call('::blt::winop', 'changes', win)
+ end
+
+ def colormap(win)
+ Hash[*list(tk_call('::blt::winop', 'colormap', win))]
+ end
+
+ def convolve(src, dest, filter)
+ tk_call('::blt::winop', 'convolve', src, dest, filter)
+ end
+
+ def image_convolve(src, dest, filter)
+ tk_call('::blt::winop', 'image', 'convolve', src, dest, filter)
+ end
+ def image_gradient(photo, left, right, type)
+ tk_call('::blt::winop', 'image', 'gradient', photo, left, right, type)
+ end
+ def image_read_jpeg(file, photo)
+ tk_call('::blt::winop', 'image', 'readjpeg', file, photo)
+ end
+ def image_resample(src, dest, horiz_filter=None, vert_filter=None)
+ tk_call('::blt::winop', 'image', 'resample',
+ src, dest, horiz_filter, vert_filter)
+ end
+ def image_rotate(src, dest, angle)
+ tk_call('::blt::winop', 'image', 'rotate', src, dest, angle)
+ end
+ def image_snap(win, photo, width=None, height=None)
+ tk_call('::blt::winop', 'image', 'snap', win, photo, width, height)
+ end
+ def image_subsample(src, dest, x, y, width, height,
+ horiz_filter=None, vert_filter=None)
+ tk_call('::blt::winop', 'image', 'subsample',
+ src, dest, x, y, width, height, horiz_filter, vert_filter)
+ end
+
+ def quantize(src, dest, colors)
+ tk_call('::blt::winop', 'quantize', src, dest, colors)
+ end
+
+ def query()
+ tk_call('::blt::winop', 'query')
+ end
+
+ def read_jpeg(file, photo)
+ tk_call('::blt::winop', 'readjpeg', file, photo)
+ end
+
+ def resample(src, dest, horiz_filter=None, vert_filter=None)
+ tk_call('::blt::winop', 'resample',
+ src, dest, horiz_filter, vert_filter)
+ end
+
+ def subsample(src, dest, x, y, width, height,
+ horiz_filter=None, vert_filter=None)
+ tk_call('::blt::winop', 'subsample',
+ src, dest, x, y, width, height, horiz_filter, vert_filter)
+ end
+
+ def raise(*wins)
+ tk_call('::blt::winop', 'raise', *wins)
+ end
+
+ def lower(*wins)
+ tk_call('::blt::winop', 'lower', *wins)
+ end
+
+ def map(*wins)
+ tk_call('::blt::winop', 'map', *wins)
+ end
+
+ def unmap(*wins)
+ tk_call('::blt::winop', 'unmap', *wins)
+ end
+
+ def move(win, x, y)
+ tk_call('::blt::winop', 'move', win, x, y)
+ end
+
+ def snap(win, photo)
+ tk_call('::blt::winop', 'snap', win, photo)
+ end
+
+ def warpto(win = None)
+ tk_call('::blt::winop', 'warpto', win)
+ end
+ alias warp_to warpto
+end
diff --git a/ext/tk/lib/tkextlib/bwidget.rb b/ext/tk/lib/tkextlib/bwidget.rb
new file mode 100644
index 0000000000..7a1eff51d8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget.rb
@@ -0,0 +1,153 @@
+#
+# BWidget extension support
+# 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/bwidget/setup.rb'
+
+# load all image format handlers
+#TkPackage.require('BWidget', '1.7')
+TkPackage.require('BWidget')
+
+module Tk
+ module BWidget
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+ # Require autoload-symbols which is a same name as widget classname.
+ # Those are used at TkComm._genobj_for_tkwidget method.
+
+ extend TkCore
+
+ LIBRARY = tk_call('set', '::BWIDGET::LIBRARY')
+
+ PACKAGE_NAME = 'BWidget'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('BWidget')
+ rescue
+ ''
+ end
+ end
+
+ def self.XLFDfont(cmd, *args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ args.concat(hash_kv(keys))
+ end
+ tk_call('BWidget::XLFDfont', cmd, *args)
+ end
+
+ def self.assert(exp, msg=None)
+ tk_call('BWidget::assert', exp, msg)
+ end
+
+ def self.badOptionString(type, value, list)
+ tk_call('BWidget::badOptionString', type, value, list)
+ end
+
+ def self.bindMouseWheel(widget)
+ tk_call('BWidget::bindMouseWheel', widget)
+ end
+
+ def self.classes(klass)
+ list(tk_call('BWidget::classes', klass))
+ end
+
+ def self.clonename(menu)
+ tk_call('BWidget::clonename', menu)
+ end
+
+ def self.focus(opt, path)
+ tk_call('BWidget::focus', opt, path)
+ end
+
+ def self.get3dcolor(path, bgcolor)
+ tk_call('BWidget::get3dcolor', path, bgcolor)
+ end
+
+ def self.getname(name)
+ tk_call('BWidget::getname', name)
+ end
+
+ def self.grab(opt, path)
+ tk_call('BWidget::grab', opt, path)
+ end
+
+ def self.inuse(klass)
+ bool(tk_call('BWidget::inuse', klass))
+ end
+
+ def self.library(klass, *klasses)
+ tk_call('BWidget::library', klass, *klasses)
+ end
+
+ def self.lreorder(list, neworder)
+ tk_call('BWidget::lreorder', list, neworder)
+ end
+
+ def self.parsetext(text)
+ tk_call('BWidget::parsetext', text)
+ end
+
+ def self.place(path, w, h, *args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ args.concat(hash_kv(keys))
+ end
+ tk_call('BWidget::place', path, w, h, *(args.flatten))
+ end
+
+ def self.write(file, mode=None)
+ tk_call('BWidget::write', file, mode)
+ end
+
+ def self.wrongNumArgsString(str)
+ tk_call('BWidget::wrongNumArgsString', str)
+ end
+
+ ####################################################
+
+ autoload :ArrowButton, 'tkextlib/bwidget/arrowbutton'
+ autoload :Bitmap, 'tkextlib/bwidget/bitmap'
+ autoload :Button, 'tkextlib/bwidget/button'
+ autoload :ButtonBox, 'tkextlib/bwidget/buttonbox'
+ autoload :ComboBox, 'tkextlib/bwidget/combobox'
+ autoload :Dialog, 'tkextlib/bwidget/dialog'
+ autoload :DragSite, 'tkextlib/bwidget/dragsite'
+ autoload :DropSite, 'tkextlib/bwidget/dropsite'
+ autoload :DynamicHelp, 'tkextlib/bwidget/dynamichelp'
+ autoload :Entry, 'tkextlib/bwidget/entry'
+ autoload :Label, 'tkextlib/bwidget/label'
+ autoload :LabelEntry, 'tkextlib/bwidget/labelentry'
+ autoload :LabelFrame, 'tkextlib/bwidget/labelframe'
+ autoload :ListBox, 'tkextlib/bwidget/listbox'
+ autoload :MainFrame, 'tkextlib/bwidget/mainframe'
+ autoload :MessageDlg, 'tkextlib/bwidget/messagedlg'
+ autoload :NoteBook, 'tkextlib/bwidget/notebook'
+ autoload :PagesManager, 'tkextlib/bwidget/pagesmanager'
+ autoload :PanedWindow, 'tkextlib/bwidget/panedwindow'
+ autoload :PasswdDlg, 'tkextlib/bwidget/passwddlg'
+ autoload :ProgressBar, 'tkextlib/bwidget/progressbar'
+ autoload :ProgressDlg, 'tkextlib/bwidget/progressdlg'
+ autoload :ScrollableFrame, 'tkextlib/bwidget/scrollableframe'
+ autoload :ScrolledWindow, 'tkextlib/bwidget/scrolledwindow'
+ autoload :ScrollView, 'tkextlib/bwidget/scrollview'
+ autoload :SelectColor, 'tkextlib/bwidget/selectcolor'
+ autoload :SelectFont, 'tkextlib/bwidget/selectfont'
+ autoload :Separator, 'tkextlib/bwidget/separator'
+ autoload :SpinBox, 'tkextlib/bwidget/spinbox'
+ autoload :TitleFrame, 'tkextlib/bwidget/titleframe'
+ autoload :Tree, 'tkextlib/bwidget/tree'
+ autoload :Widget, 'tkextlib/bwidget/widget'
+
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
new file mode 100644
index 0000000000..13fe9e59bf
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb
@@ -0,0 +1,21 @@
+#
+# tkextlib/bwidget/arrowbutton.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/button'
+
+module Tk
+ module BWidget
+ class ArrowButton < Tk::BWidget::Button
+ end
+ end
+end
+
+class Tk::BWidget::ArrowButton
+ TkCommandNames = ['ArrowButton'.freeze].freeze
+ WidgetClassName = 'ArrowButton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/bitmap.rb b/ext/tk/lib/tkextlib/bwidget/bitmap.rb
new file mode 100644
index 0000000000..6cfde203e8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/bitmap.rb
@@ -0,0 +1,21 @@
+#
+# tkextlib/bwidget/bitmap.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tk/image'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Bitmap < TkPhotoImage
+ end
+ end
+end
+
+class Tk::BWidget::Bitmap
+ def initialize(name)
+ @path = tk_call_without_enc('Bitmap::get', name)
+ Tk_IMGTBL[@path] = self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/button.rb b/ext/tk/lib/tkextlib/bwidget/button.rb
new file mode 100644
index 0000000000..e139fb6708
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/button.rb
@@ -0,0 +1,31 @@
+#
+# tkextlib/bwidget/button.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/button'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Button < Tk::Button
+ end
+ end
+end
+
+class Tk::BWidget::Button
+ TkCommandNames = ['Button'.freeze].freeze
+ WidgetClassName = 'Button'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/buttonbox.rb b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
new file mode 100644
index 0000000000..a6de33c40c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/buttonbox.rb
@@ -0,0 +1,90 @@
+#
+# tkextlib/bwidget/buttonbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/button'
+
+module Tk
+ module BWidget
+ class ButtonBox < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::ButtonBox
+ TkCommandNames = ['ButtonBox'.freeze].freeze
+ WidgetClassName = 'ButtonBox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include TkItemConfigMethod
+
+ def __boolval_optkeys
+ super() << 'homogeneous'
+ end
+ private :__boolval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::BWidget::Button)
+ name = tagOrId[:name]
+ return index(name) unless name.empty?
+ end
+ if tagOrId.kind_of?(Tk::Button)
+ return index(tagOrId[:text])
+ end
+ # index(tagOrId.to_s)
+ index(_get_eval_string(tagOrId))
+ end
+
+ def add(keys={}, &b)
+ win = window(tk_send('add', *hash_kv(keys)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def delete(idx)
+ tk_send('delete', tagid(idx))
+ self
+ end
+
+ def index(idx)
+ if idx.kind_of?(Tk::BWidget::Button)
+ name = idx[:name]
+ idx = name unless name.empty?
+ end
+ if idx.kind_of?(Tk::Button)
+ idx = idx[:text]
+ end
+ number(tk_send('index', idx.to_s))
+ end
+
+ def insert(idx, keys={}, &b)
+ win = window(tk_send('insert', tagid(idx), *hash_kv(keys)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def invoke(idx)
+ tk_send('invoke', tagid(idx))
+ self
+ end
+
+ def set_focus(idx)
+ tk_send('setfocus', tagid(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/combobox.rb b/ext/tk/lib/tkextlib/bwidget/combobox.rb
new file mode 100644
index 0000000000..16143dfbc6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/combobox.rb
@@ -0,0 +1,62 @@
+#
+# tkextlib/bwidget/combobox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/listbox'
+require 'tkextlib/bwidget/spinbox'
+
+module Tk
+ module BWidget
+ class ComboBox < Tk::BWidget::SpinBox
+ end
+ end
+end
+
+class Tk::BWidget::ComboBox
+ include Scrollable
+
+ TkCommandNames = ['ComboBox'.freeze].freeze
+ WidgetClassName = 'ComboBox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'autocomplete' << 'autopost'
+ end
+ private :__boolval_optkeys
+
+ def get_listbox(&b)
+ win = window(tk_send_without_enc('getlistbox'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def clear_value
+ tk_send_without_enc('clearvalue')
+ self
+ end
+ alias clearvalue clear_value
+
+ def icursor(idx)
+ tk_send_without_enc('icursor', idx)
+ end
+
+ def post
+ tk_send_without_enc('post')
+ self
+ end
+
+ def unpost
+ tk_send_without_enc('unpost')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/dialog.rb b/ext/tk/lib/tkextlib/bwidget/dialog.rb
new file mode 100644
index 0000000000..3b0656f021
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/dialog.rb
@@ -0,0 +1,194 @@
+#
+# tkextlib/bwidget/dialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/buttonbox'
+
+module Tk
+ module BWidget
+ class Dialog < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::Dialog
+ TkCommandNames = ['Dialog'.freeze].freeze
+ WidgetClassName = 'Dialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include TkItemConfigMethod
+
+ def __numstrval_optkeys
+ super() << 'buttonwidth'
+ end
+ private :__numstrval_optkeys
+
+ def __strval_optkeys
+ super() << 'title' << 'geometry'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'transient' << 'homogeneous'
+ end
+ private :__boolval_optkeys
+
+ def initialize(parent=nil, keys=nil)
+ @relative = ''
+ if parent.kind_of?(Hash)
+ keys = _symbolkey2str(parent)
+ @relative = keys['parent'] if keys.key?('parent')
+ @relative = keys.delete('relative') if keys.key?('relative')
+ super(keys)
+ elsif keys
+ keys = _symbolkey2str(keys)
+ @relative = keys.delete('parent') if keys.key?('parent')
+ @relative = keys.delete('relative') if keys.key?('relative')
+ super(parent, keys)
+ else
+ super(parent)
+ end
+ end
+
+ def create_self(keys)
+ cmd = self.class::TkCommandNames[0]
+ if keys and keys != None
+ tk_call_without_enc(cmd, @path, '-parent', @relative,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(cmd, @path, '-parent', @relative)
+ end
+ end
+
+ def cget_tkstring(slot)
+ if slot.to_s == 'relative'
+ super('parent')
+ else
+ super(slot)
+ end
+ end
+ def cget_strict(slot)
+ if slot.to_s == 'relative'
+ super('parent')
+ else
+ super(slot)
+ end
+ end
+ def cget(slot)
+ if slot.to_s == 'relative'
+ super('parent')
+ else
+ super(slot)
+ end
+ end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ slot['parent'] = slot.delete('relative') if slot.key?('relative')
+ super(slot)
+ else
+ if slot.to_s == 'relative'
+ super('parent', value)
+ else
+ super(slot, value)
+ end
+ end
+ end
+
+ def configinfo(slot=nil)
+ if slot
+ if slot.to_s == 'relative'
+ super('parent')
+ else
+ super(slot)
+ end
+ else
+ ret = super()
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret << ['relative', 'parent']
+ else
+ ret['relative'] = 'parent'
+ end
+ end
+ end
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::BWidget::Button)
+ name = tagOrId[:name]
+ return index(name) unless name.empty?
+ end
+ if tagOrId.kind_of?(Tk::Button)
+ return index(tagOrId[:text])
+ end
+ # index(tagOrId.to_s)
+ index(_get_eval_string(tagOrId))
+ end
+
+ def add(keys={}, &b)
+ win = window(tk_send('add', *hash_kv(keys)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_frame(&b)
+ win = window(tk_send('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_buttonbox(&b)
+ win = window(@path + '.bbox')
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def draw(focus_win=None)
+ tk_send('draw', focus_win)
+ end
+
+ def enddialog(ret)
+ tk_send('enddialog', ret)
+ end
+
+ def index(idx)
+ get_buttonbox.index(idx)
+ end
+
+ def invoke(idx)
+ tk_send('invoke', tagid(idx))
+ self
+ end
+
+ def set_focus(idx)
+ tk_send('setfocus', tagid(idx))
+ self
+ end
+
+ def withdraw
+ tk_send('withdraw')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/dragsite.rb b/ext/tk/lib/tkextlib/bwidget/dragsite.rb
new file mode 100644
index 0000000000..4d4de1780c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/dragsite.rb
@@ -0,0 +1,31 @@
+#
+# tkextlib/bwidget/dragsite.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ module DragSite
+ end
+ end
+end
+
+module Tk::BWidget::DragSite
+ include Tk
+ extend Tk
+
+ def self.include(klass, type, event)
+ tk_call('DragSite::include', klass, type, event)
+ end
+
+ def self.register(path, keys={})
+ tk_call('DragSite::register', path, *hash_kv(keys))
+ end
+
+ def self.set_drag(path, subpath, initcmd, endcmd, force=None)
+ tk_call('DragSite::setdrag', path, subpath, initcmd, endcmd, force)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/dropsite.rb b/ext/tk/lib/tkextlib/bwidget/dropsite.rb
new file mode 100644
index 0000000000..e5e98fbc51
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/dropsite.rb
@@ -0,0 +1,39 @@
+#
+# tkextlib/bwidget/dropsite.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ module DropSite
+ end
+ end
+end
+
+module Tk::BWidget::DropSite
+ include Tk
+ extend Tk
+
+ def self.include(klass, type)
+ tk_call('DropSite::include', klass, type)
+ end
+
+ def self.register(path, keys={})
+ tk_call('DropSite::register', path, *hash_kv(keys))
+ end
+
+ def self.set_cursor(cursor)
+ tk_call('DropSite::setcursor', cursor)
+ end
+
+ def self.set_drop(path, subpath, dropover, drop, force=None)
+ tk_call('DropSite::setdrop', path, subpath, dropover, drop, force)
+ end
+
+ def self.set_operation(op)
+ tk_call('DropSite::setoperation', op)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb
new file mode 100644
index 0000000000..846e58062d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb
@@ -0,0 +1,63 @@
+#
+# tkextlib/bwidget/dynamichelp.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ module DynamicHelp
+ end
+ end
+end
+
+module Tk::BWidget::DynamicHelp
+ include Tk
+ extend Tk
+
+ def self.__pathname
+ 'DynamicHelp::configure'
+ end
+
+ def __strval_optkeys
+ super() << 'topbackground'
+ end
+ private :__strval_optkeys
+
+ def self.__cget_cmd
+ ['DynamicHelp::configure']
+ end
+
+ def self.__config_cmd
+ ['DynamicHelp::configure']
+ end
+
+ def self.cget_strict(slot)
+ slot = slot.to_s
+ info = {}
+ self.current_configinfo.each{|k,v| info[k.to_s] = v if k.to_s == slot}
+ fail RuntimeError, "unknown option \"-#{slot}\"" if info.empty?
+ info.values[0]
+ end
+ def self.cget(slot)
+ self.current_configinfo(slot).values[0]
+ end
+
+ def self.add(widget, keys={})
+ tk_call('DynamicHelp::add', widget, *hash_kv(keys))
+ end
+
+ def self.delete(widget)
+ tk_call('DynamicHelp::delete', widget)
+ end
+
+ def self.include(klass, type)
+ tk_call('DynamicHelp::include', klass, type)
+ end
+
+ def self.sethelp(path, subpath, force=None)
+ tk_call('DynamicHelp::sethelp', path, subpath, force)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/entry.rb b/ext/tk/lib/tkextlib/bwidget/entry.rb
new file mode 100644
index 0000000000..8dc4496123
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/entry.rb
@@ -0,0 +1,43 @@
+#
+# tkextlib/bwidget/entry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Entry < Tk::Entry
+ end
+ end
+end
+
+class Tk::BWidget::Entry
+ include Scrollable
+
+ TkCommandNames = ['Entry'.freeze].freeze
+ WidgetClassName = 'Entry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext' << 'insertbackground'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'dragenabled' << 'dropenabled' << 'editable'
+ end
+ private :__boolval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ def invoke
+ tk_send_without_enc('invoke')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/label.rb b/ext/tk/lib/tkextlib/bwidget/label.rb
new file mode 100644
index 0000000000..e8d9352c62
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/label.rb
@@ -0,0 +1,41 @@
+#
+# tkextlib/bwidget/label.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/label'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Label < Tk::Label
+ end
+ end
+end
+
+class Tk::BWidget::Label
+ TkCommandNames = ['Label'.freeze].freeze
+ WidgetClassName = 'Label'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'dragenabled' << 'dropenabled'
+ end
+ private :__boolval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ def set_focus
+ tk_send_without_enc('setfocus')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
new file mode 100644
index 0000000000..16e7b46933
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb
@@ -0,0 +1,80 @@
+#
+# tkextlib/bwidget/labelentry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/labelframe'
+require 'tkextlib/bwidget/entry'
+
+module Tk
+ module BWidget
+ class LabelEntry < Tk::Entry
+ end
+ end
+end
+
+class Tk::BWidget::LabelEntry
+ include Scrollable
+
+ TkCommandNames = ['LabelEntry'.freeze].freeze
+ WidgetClassName = 'LabelEntry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ def __font_optkeys
+ super() << 'labelfont'
+ end
+ private :__font_optkeys
+
+ #def entrybind(*args)
+ # _bind([path, 'bind'], *args)
+ # self
+ #end
+ def entrybind(context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'bind'], context, cmd, *args)
+ self
+ end
+
+ #def entrybind_append(*args)
+ # _bind_append([path, 'bind'], *args)
+ # self
+ #end
+ def entrybind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'bind'], context, cmd, *args)
+ self
+ end
+
+ def entrybind_remove(*args)
+ _bind_remove([path, 'bind'], *args)
+ self
+ end
+
+ def entrybindinfo(*args)
+ _bindinfo([path, 'bind'], *args)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/labelframe.rb b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
new file mode 100644
index 0000000000..0710f213f0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/labelframe.rb
@@ -0,0 +1,52 @@
+#
+# tkextlib/bwidget/labelframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/label'
+
+module Tk
+ module BWidget
+ class LabelFrame < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::LabelFrame
+ TkCommandNames = ['LabelFrame'.freeze].freeze
+ WidgetClassName = 'LabelFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'dragenabled' << 'dropenabled'
+ end
+ private :__boolval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ def self.align(*args)
+ tk_call('LabelFrame::align', *args)
+ end
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb
new file mode 100644
index 0000000000..930491c869
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb
@@ -0,0 +1,361 @@
+#
+# tkextlib/bwidget/listbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/canvas'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class ListBox < TkWindow
+ # is NOT a subclass of a listbox widget class.
+ # because it constructed on a canvas widget.
+
+ class Item < TkObject
+ end
+ end
+ end
+end
+
+class Tk::BWidget::ListBox
+ include TkItemConfigMethod
+ include Scrollable
+
+ TkCommandNames = ['ListBox'.freeze].freeze
+ WidgetClassName = 'ListBox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class Event_for_Items < TkEvent::Event
+ def self._get_extra_args_tbl
+ [
+ TkComm.method(:string) # item idenfier
+ ]
+ end
+ end
+
+ def __boolval_optkeys
+ super() << 'autofocus' << 'dragenabled' << 'dropenabled' << 'selectfill'
+ end
+ private :__boolval_optkeys
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::BWidget::ListBox::Item)
+ tag.id
+ else
+ # tag
+ _get_eval_string(tag)
+ end
+ end
+
+ #def imagebind(*args)
+ # _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ # self
+ #end
+ def imagebind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
+ context, cmd, *args)
+ self
+ end
+
+ #def imagebind_append(*args)
+ # _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ # self
+ #end
+ def imagebind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
+ context, cmd, *args)
+ self
+ end
+
+ def imagebind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ self
+ end
+
+ def imagebindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ end
+
+ #def textbind(*args)
+ # _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ # self
+ #end
+ def textbind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Items, [path, 'bindText'],
+ context, cmd, *args)
+ self
+ end
+
+ #def textbind_append(*args)
+ # _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ # self
+ #end
+ def textbind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
+ context, cmd, *args)
+ self
+ end
+
+ def textbind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ self
+ end
+
+ def textbindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ end
+
+ def delete(*args)
+ tk_send('delete', *args)
+ self
+ end
+
+ def edit(item, text, *args)
+ tk_send('edit', tagid(item), text, *args)
+ self
+ end
+
+ def exist?(item)
+ bool(tk_send('exists', tagid(item)))
+ end
+
+ def index(item)
+ num_or_str(tk_send('index', tagid(item)))
+ end
+
+ def insert(idx, item, keys={})
+ tk_send('insert', idx, tagid(item), *hash_kv(keys))
+ self
+ end
+
+ def get_item(idx)
+ tk_send('items', idx)
+ end
+
+ def items(first=None, last=None)
+ list(tk_send('items', first, last))
+ end
+
+ def move(item, idx)
+ tk_send('move', tagid(item), idx)
+ self
+ end
+
+ def reorder(neworder)
+ tk_send('reorder', neworder)
+ self
+ end
+
+ def see(item)
+ tk_send('see', tagid(item))
+ self
+ end
+
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+
+ def selection_set(*args)
+ tk_send_without_enc('selection', 'set',
+ *(args.collect{|item| tagid(item)}))
+ self
+ end
+
+ def selection_add(*args)
+ tk_send_without_enc('selection', 'add',
+ *(args.collect{|item| tagid(item)}))
+ self
+ end
+
+ def selection_remove(*args)
+ tk_send_without_enc('selection', 'remove',
+ *(args.collect{|item| tagid(item)}))
+ self
+ end
+
+ def selection_get(*args)
+ simplelist(tk_send_without_enc('selection', 'get')).collect{|item|
+ Tk::BWidget::ListBox::Item.id2obj(self, item)
+ }
+ end
+end
+
+class Tk::BWidget::ListBox::Item
+ include TkTreatTagFont
+
+ ListItem_TBL = TkCore::INTERP.create_table
+
+ (ListItem_ID = ['bw:item'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ ListItem_TBL.mutex.synchronize{ ListItem_TBL.clear }
+ }
+
+ def self.id2obj(lbox, id)
+ lpath = lbox.path
+ ListItem_TBL.mutex.synchronize{
+ if ListItem_TBL[lpath]
+ ListItem_TBL[lpath][id]? ListItem_TBL[lpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(lbox, *args)
+ if lbox.kind_of?(Tk::BWidget::ListBox)
+ @listbox = lbox
+ else
+ fail RuntimeError,
+ "expect Tk::BWidget::ListBox or Tk::BWidget::ListBox::Item for 1st argument"
+ end
+
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = {}
+ end
+
+ index = keys.delete('index')
+ unless args.empty?
+ index = args.shift
+ end
+ index = 'end' unless index
+
+ unless args.empty?
+ fail RuntimeError, 'too much arguments'
+ end
+
+ @lpath = @listbox.path
+
+ if keys.key?('itemname')
+ @path = @id = keys.delete('itemname')
+ else
+ ListItem_ID.mutex.synchronize{
+ @path = @id = ListItem_ID.join(TkCore::INTERP._ip_id_)
+ ListItem_ID[1].succ!
+ }
+ end
+
+ ListItem_TBL.mutex.synchronize{
+ ListItem_TBL[@id] = self
+ ListItem_TBL[@lpath] = {} unless ListItem_TBL[@lpath]
+ ListItem_TBL[@lpath][@id] = self
+ }
+
+ @listbox.insert(index, @id, keys)
+ end
+
+ def listbox
+ @listbox
+ end
+
+ def id
+ @id
+ end
+
+ def [](key)
+ cget(key)
+ end
+
+ def []=(key, val)
+ configure(key, val)
+ val
+ end
+
+ def cget_tkstring(key)
+ @listbox.itemcget_tkstring(@id, key)
+ end
+ def cget(key)
+ @listbox.itemcget(@id, key)
+ end
+ def cget_strict(key)
+ @listbox.itemcget_strict(@id, key)
+ end
+
+ def configure(key, val=None)
+ @listbox.itemconfigure(@id, key, val)
+ end
+
+ def configinfo(key=nil)
+ @listbox.itemconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @listbox.current_itemconfiginfo(@id, key)
+ end
+
+ def delete
+ @listbox.delete(@id)
+ self
+ end
+
+ def edit(*args)
+ @listbox.edit(@id, *args)
+ self
+ end
+
+ def exist?
+ @listbox.exist?(@id)
+ end
+
+ def index
+ @listbox.index(@id)
+ end
+
+ def move(index)
+ @listbox.move(@id, index)
+ end
+
+ def see
+ @listbox.see(@id)
+ end
+
+ def selection_add
+ @listbox.selection_add(@id)
+ end
+
+ def selection_remove
+ @listbox.selection_remove(@id)
+ end
+
+ def selection_set
+ @listbox.selection_set(@id)
+ end
+
+ def selection_toggle
+ @listbox.selection_toggle(@id)
+ end
+end
+
diff --git a/ext/tk/lib/tkextlib/bwidget/mainframe.rb b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
new file mode 100644
index 0000000000..92253bd8d3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/mainframe.rb
@@ -0,0 +1,132 @@
+#
+# tkextlib/bwidget/mainframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/progressbar'
+
+module Tk
+ module BWidget
+ class MainFrame < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::MainFrame
+ TkCommandNames = ['MainFrame'.freeze].freeze
+ WidgetClassName = 'MainFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'progressfg'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'progressvar'
+ end
+ private :__tkvariable_optkeys
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ # The method is used to convert a opt-value to a ruby's object.
+ # When get the value of the option "key", "proc.call(value)" is called.
+ {
+ 'menu'=>proc{|v| simplelist(v).collect!{|elem| simplelist(v)}}
+ }
+ end
+ private :__val2ruby_optkeys
+
+ def add_indicator(keys={}, &b)
+ win = window(tk_send('addindicator', *hash_kv(keys)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def add_toolbar(&b)
+ win = window(tk_send('addtoolbar'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_frame(&b)
+ win = window(tk_send('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_indicator(idx, &b)
+ win = window(tk_send('getindicator', idx))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_menu(menu_id, &b)
+ win = window(tk_send('getmenu', menu_id))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_toolbar(idx, &b)
+ win = window(tk_send('gettoolbar', idx))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_menustate(tag)
+ tk_send('getmenustate', tag) # return state name string
+ end
+
+ def set_menustate(tag, state)
+ tk_send('setmenustate', tag, state)
+ self
+ end
+
+ def show_statusbar(name)
+ tk_send('showstatusbar', name)
+ self
+ end
+
+ def show_toolbar(idx, mode)
+ tk_send('showtoolbar', idx, mode)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
new file mode 100644
index 0000000000..7b62614737
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb
@@ -0,0 +1,192 @@
+#
+# tkextlib/bwidget/messagedlg.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/dialog.rb'
+
+module Tk
+ module BWidget
+ class MessageDlg < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::MessageDlg
+ TkCommandNames = ['MessageDlg'.freeze].freeze
+ WidgetClassName = 'MessageDlg'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def initialize(parent=nil, keys=nil)
+ @relative = ''
+ if parent.kind_of?(Hash)
+ keys = _symbolkey2str(parent)
+ @relative = keys['parent'] if keys.key?('parent')
+ @relative = keys.delete('relative') if keys.key?('relative')
+ super(keys)
+ elsif keys
+ keys = _symbolkey2str(keys)
+ @relative = keys.delete('parent') if keys.key?('parent')
+ @relative = keys.delete('relative') if keys.key?('relative')
+ super(parent, keys)
+ else
+ super(parent)
+ end
+ end
+
+ def create_self(keys)
+ # NOT create widget.
+ # Because the widget no longer exist when returning from creation.
+ @keys = _symbolkey2str(keys).update('parent'=>@relative)
+ @info = nil
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'message' << 'title'
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'buttons'
+ end
+ private :__listval_optkeys
+
+ def cget(slot)
+ slot = slot.to_s
+ if slot == 'relative'
+ slot = 'parent'
+ end
+ if winfo_exist?
+ val = super(slot)
+ @keys[slot] = val
+ end
+ @keys[slot]
+ end
+ def cget_strict(slot)
+ slot = slot.to_s
+ if slot == 'relative'
+ slot = 'parent'
+ end
+ if winfo_exist?
+ val = super(slot)
+ @keys[slot] = val
+ end
+ @keys[slot]
+ end
+
+ def configure(slot, value=None)
+ if winfo_exist?
+ super(slot, value)
+ end
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ slot['parent'] = slot.delete('relative') if slot.key?('relative')
+ @keys.update(slot)
+
+ if @info
+ # update @info
+ slot.each{|k, v|
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (inf = @info.assoc(k))
+ inf[-1] = v
+ else
+ @info << [k, '', '', '', v]
+ end
+ else
+ if (inf = @info[k])
+ inf[-1] = v
+ else
+ @info[k] = ['', '', '', v]
+ end
+ end
+ }
+ end
+
+ else # ! Hash
+ slot = slot.to_s
+ slot = 'parent' if slot == 'relative'
+ @keys[slot] = value
+
+ if @info
+ # update @info
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (inf = @info.assoc(slot))
+ inf[-1] = value
+ else
+ @info << [slot, '', '', '', value]
+ end
+ else
+ if (inf = @info[slot])
+ inf[-1] = value
+ else
+ @info[slot] = ['', '', '', value]
+ end
+ end
+ end
+ end
+
+ self
+ end
+
+ def configinfo(slot=nil)
+ if winfo_exist?
+ @info = super()
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ @info << ['relative', 'parent']
+ else
+ @info['relative'] = 'parent'
+ end
+ end
+
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if @info
+ if winfo_exist?
+ # update @keys
+ @info.each{|inf| @keys[inf[0]] = inf[-1] if inf.size > 2 }
+ end
+ else
+ @info = []
+ @keys.each{|k, v|
+ @info << [k, '', '', '', v]
+ }
+ @info << ['relative', 'parent']
+ end
+
+ if slot
+ @info.asoc(slot.to_s).dup
+ else
+ @info.dup
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if @info
+ if winfo_exist?
+ # update @keys
+ @info.each{|k, inf| @keys[k] = inf[-1] if inf.size > 2 }
+ end
+ else
+ @info = {}
+ @keys.each{|k, v|
+ @info[k] = ['', '', '', v]
+ }
+ @info['relative'] = 'parent'
+ end
+
+ if slot
+ @info[slot.to_s].dup
+ else
+ @info.dup
+ end
+ end
+ end
+
+ def create
+ # return the index of the pressed button, or nil if it is destroyed
+ ret = num_or_str(tk_call(self.class::TkCommandNames[0],
+ @path, *hash_kv(@keys)))
+ (ret < 0)? nil: ret
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb
new file mode 100644
index 0000000000..ed28bcd86a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb
@@ -0,0 +1,166 @@
+#
+# tkextlib/bwidget/notebook.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class NoteBook < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::NoteBook
+ include TkItemConfigMethod
+
+ TkCommandNames = ['NoteBook'.freeze].freeze
+ WidgetClassName = 'NoteBook'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class Event_for_Tabs < TkEvent::Event
+ def self._get_extra_args_tbl
+ [
+ TkComm.method(:string) # page idenfier
+ ]
+ end
+ end
+
+ def __boolval_optkeys
+ super() << 'homogeneous'
+ end
+ private :__boolval_optkeys
+
+ def tagid(id)
+ if id.kind_of?(TkWindow)
+ #id.path
+ id.epath
+ elsif id.kind_of?(TkObject)
+ id.to_eval
+ else
+ # id.to_s
+ _get_eval_string(id)
+ end
+ end
+
+ #def tabbind(*args)
+ # _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
+ # self
+ #end
+ def tabbind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
+ context, cmd, *args)
+ self
+ end
+
+ #def tabbind_append(*args)
+ # _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
+ # self
+ #end
+ def tabbind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Tabs, [path, 'bindtabs'],
+ context, cmd, *args)
+ self
+ end
+
+ def tabbind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
+ self
+ end
+
+ def tabbindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Tabs, [path, 'bindtabs'], *args)
+ end
+
+ def add(page, &b)
+ win = window(tk_send('add', tagid(page)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def compute_size
+ tk_send('compute_size')
+ self
+ end
+
+ def delete(page, destroyframe=None)
+ tk_send('delete', tagid(page), destroyframe)
+ self
+ end
+
+ def get_frame(page, &b)
+ win = window(tk_send('getframe', tagid(page)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def index(page)
+ num_or_str(tk_send('index', tagid(page)))
+ end
+
+ def insert(index, page, keys={}, &b)
+ win = window(tk_send('insert', index, tagid(page), *hash_kv(keys)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def move(page, index)
+ tk_send('move', tagid(page), index)
+ self
+ end
+
+ def get_page(page)
+ tk_send('pages', page)
+ end
+
+ def pages(first=None, last=None)
+ list(tk_send('pages', first, last))
+ end
+
+ def raise(page=nil)
+ if page
+ tk_send('raise', page)
+ self
+ else
+ tk_send('raise')
+ end
+ end
+
+ def see(page)
+ tk_send('see', page)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
new file mode 100644
index 0000000000..31bbf1fb8b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
@@ -0,0 +1,73 @@
+#
+# tkextlib/bwidget/pagesmanager.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class PagesManager < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::PagesManager
+ TkCommandNames = ['PagesManager'.freeze].freeze
+ WidgetClassName = 'PagesManager'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def tagid(id)
+ # id.to_s
+ _get_eval_string(id)
+ end
+
+ def add(page, &b)
+ win = window(tk_send('add', tagid(page)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def compute_size
+ tk_send('compute_size')
+ self
+ end
+
+ def delete(page)
+ tk_send('delete', tagid(page))
+ self
+ end
+
+ def get_frame(page, &b)
+ win = window(tk_send('getframe', tagid(page)))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def get_page(page)
+ tk_send('pages', page)
+ end
+
+ def pages(first=None, last=None)
+ list(tk_send('pages', first, last))
+ end
+
+ def raise(page=None)
+ tk_send('raise', page)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/panedwindow.rb b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
new file mode 100644
index 0000000000..54cf06cbde
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/panedwindow.rb
@@ -0,0 +1,42 @@
+#
+# tkextlib/bwidget/panedwindow.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class PanedWindow < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::PanedWindow
+ TkCommandNames = ['PanedWindow'.freeze].freeze
+ WidgetClassName = 'PanedWindow'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'activator'
+ end
+ private :__strval_optkeys
+
+ def add(keys={})
+ window(tk_send('add', *hash_kv(keys)))
+ end
+
+ def get_frame(idx, &b)
+ win = window(tk_send_without_enc('getframe', idx))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/panelframe.rb b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
new file mode 100644
index 0000000000..1cbf914425
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/panelframe.rb
@@ -0,0 +1,67 @@
+#
+# tkextlib/bwidget/panelframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class PanelFrame < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::PanelFrame
+ TkCommandNames = ['PanelFrame'.freeze].freeze
+ WidgetClassName = 'PanelFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() + ['panelforeground', 'panelbackground']
+ end
+ private :__strval_optkeys
+
+ def add(win, keys={})
+ tk_send('add', win, keys)
+ self
+ end
+
+ def delete(*wins)
+ tk_send('delete', *wins)
+ self
+ end
+
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def items
+ simplelist(tk_send('items')).map{|w| window(w)}
+ end
+
+ def remove(*wins)
+ tk_send('remove', *wins)
+ self
+ end
+
+ def remove_with_destroy(*wins)
+ tk_send('remove', '-destroy', *wins)
+ self
+ end
+
+ def delete(*wins) # same to 'remove_with_destroy'
+ tk_send('delete', *wins)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/passwddlg.rb b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
new file mode 100644
index 0000000000..ea50c87cef
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/passwddlg.rb
@@ -0,0 +1,44 @@
+#
+# tkextlib/bwidget/passwddlg.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/messagedlg'
+
+module Tk
+ module BWidget
+ class PasswdDlg < Tk::BWidget::MessageDlg
+ end
+ end
+end
+
+class Tk::BWidget::PasswdDlg
+ TkCommandNames = ['PasswdDlg'.freeze].freeze
+ WidgetClassName = 'PasswdDlg'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'loginhelptext' << 'loginlabel' << 'logintext' <<
+ 'passwdlabel' << 'passwdtext'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'passwdeditable' << 'homogeneous'
+ end
+ private :__boolval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'loginhelpvar' << 'logintextvariable' <<
+ 'passwdhelpvar' << 'passwdtextvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def create
+ login, passwd = simplelist(tk_call(self.class::TkCommandNames[0],
+ @path, *hash_kv(@keys)))
+ [login, passwd]
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/progressbar.rb b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
new file mode 100644
index 0000000000..18eb67349b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/progressbar.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/bwidget/progressbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class ProgressBar < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::ProgressBar
+ TkCommandNames = ['ProgressBar'.freeze].freeze
+ WidgetClassName = 'ProgressBar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/progressdlg.rb b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
new file mode 100644
index 0000000000..0c0c4540bc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/progressdlg.rb
@@ -0,0 +1,58 @@
+#
+# tkextlib/bwidget/progressdlg.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/variable'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/progressbar'
+require 'tkextlib/bwidget/messagedlg'
+
+module Tk
+ module BWidget
+ class ProgressDlg < Tk::BWidget::MessageDlg
+ end
+ end
+end
+
+class Tk::BWidget::ProgressDlg
+ TkCommandNames = ['ProgressDlg'.freeze].freeze
+ WidgetClassName = 'ProgressDlg'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ # NOT create widget for reusing the object
+ super(keys)
+ @keys['textvariable'] = TkVariable.new unless @keys.key?('textvariable')
+ @keys['variable'] = TkVariable.new unless @keys.key?('variable')
+ end
+
+ def textvariable
+ @keys['textvariable']
+ end
+
+ def text
+ @keys['textvariable'].value
+ end
+
+ def text= (txt)
+ @keys['textvariable'].value = txt
+ end
+
+ def variable
+ @keys['variable']
+ end
+
+ def value
+ @keys['variable'].value
+ end
+
+ def value= (val)
+ @keys['variable'].value = val
+ end
+
+ def create
+ window(tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys)))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
new file mode 100644
index 0000000000..5bd00d6870
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb
@@ -0,0 +1,40 @@
+#
+# tkextlib/bwidget/scrollableframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class ScrollableFrame < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::ScrollableFrame
+ include Scrollable
+
+ TkCommandNames = ['ScrollableFrame'.freeze].freeze
+ WidgetClassName = 'ScrollableFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def see(win, vert=None, horiz=None)
+ tk_send_without_enc('see', win, vert, horiz)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
new file mode 100644
index 0000000000..ea5a18cc66
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb
@@ -0,0 +1,48 @@
+#
+# tkextlib/bwidget/scrolledwindow.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class ScrolledWindow < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::ScrolledWindow
+ TkCommandNames = ['ScrolledWindow'.freeze].freeze
+ WidgetClassName = 'ScrolledWindow'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'sides'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'managed'
+ end
+ private :__boolval_optkeys
+
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def set_widget(win)
+ tk_send_without_enc('setwidget', win)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/scrollview.rb b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
new file mode 100644
index 0000000000..ab27bc91cf
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/scrollview.rb
@@ -0,0 +1,25 @@
+#
+# tkextlib/bwidget/scrollview.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class ScrollView < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::ScrollView
+ TkCommandNames = ['ScrollView'.freeze].freeze
+ WidgetClassName = 'ScrollView'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'fill'
+ end
+ private :__strval_optkeys
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/selectcolor.rb b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
new file mode 100644
index 0000000000..456175e87e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/selectcolor.rb
@@ -0,0 +1,73 @@
+#
+# tkextlib/bwidget/selectcolor.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/messagedlg'
+
+module Tk
+ module BWidget
+ class SelectColor < Tk::BWidget::MessageDlg
+ class Dialog < Tk::BWidget::SelectColor
+ end
+ class Menubutton < Tk::Menubutton
+ end
+ MenuButton = Menubutton
+ end
+ end
+end
+
+class Tk::BWidget::SelectColor
+ extend Tk
+
+ TkCommandNames = ['SelectColor'.freeze].freeze
+ WidgetClassName = 'SelectColor'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def dialog(keys={})
+ newkeys = @keys.dup
+ newkeys.update(_symbolkey2str(keys))
+ tk_call('SelectColor::dialog', @path, *hash_kv(newkeys))
+ end
+
+ def menu(*args)
+ if args[-1].kind_of?(Hash)
+ keys = args.pop
+ else
+ keys = {}
+ end
+ place = args.flatten
+ newkeys = @keys.dup
+ newkeys.update(_symbolkey2str(keys))
+ tk_call('SelectColor::menu', @path, place, *hash_kv(newkeys))
+ end
+
+ def self.set_color(idx, color)
+ tk_call('SelectColor::setcolor', idx, color)
+ end
+end
+
+class Tk::BWidget::SelectColor::Dialog
+ def create_self(keys)
+ super(keys)
+ @keys['type'] = 'dialog'
+ end
+
+ def create
+ @keys['type'] = 'dialog' # 'dialog' type returns color
+ tk_call(Tk::BWidget::SelectColor::TkCommandNames[0],
+ @path, *hash_kv(@keys))
+ end
+end
+
+class Tk::BWidget::SelectColor::Menubutton
+ def create_self(keys)
+ keys = {} unless keys
+ keys = _symbolkey2str(keys)
+ keys['type'] = 'menubutton' # 'toolbar' type returns widget path
+ window(tk_call(Tk::BWidget::SelectColor::TkCommandNames[0],
+ @path, *hash_kv(keys)))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/selectfont.rb b/ext/tk/lib/tkextlib/bwidget/selectfont.rb
new file mode 100644
index 0000000000..23419cb0fa
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/selectfont.rb
@@ -0,0 +1,91 @@
+#
+# tkextlib/bwidget/selectfont.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/messagedlg'
+
+module Tk
+ module BWidget
+ class SelectFont < Tk::BWidget::MessageDlg
+ class Dialog < Tk::BWidget::SelectFont
+ end
+ class Toolbar < TkWindow
+ end
+ end
+ end
+end
+
+class Tk::BWidget::SelectFont
+ extend Tk
+
+ TkCommandNames = ['SelectFont'.freeze].freeze
+ WidgetClassName = 'SelectFont'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'sampletext' << 'title'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'nosizes'
+ end
+ private :__boolval_optkeys
+
+ def __font_optkeys
+ [] # without fontobj operation
+ end
+ private :__font_optkeys
+
+ def create
+ tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys))
+ end
+
+ def self.load_font
+ tk_call('SelectFont::loadfont')
+ end
+end
+
+class Tk::BWidget::SelectFont::Dialog
+ def __font_optkeys
+ [] # without fontobj operation
+ end
+
+ def create_self(keys)
+ super(keys)
+ @keys['type'] = 'dialog'
+ end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot.delete['type']
+ slot.delete[:type]
+ return self if slot.empty?
+ else
+ return self if slot == 'type' || slot == :type
+ end
+ super(slot, value)
+ end
+
+ def create
+ @keys['type'] = 'dialog' # 'dialog' type returns font name
+ tk_call(Tk::BWidget::SelectFont::TkCommandNames[0], @path, *hash_kv(@keys))
+ end
+end
+
+class Tk::BWidget::SelectFont::Toolbar
+ def __font_optkeys
+ [] # without fontobj operation
+ end
+
+ def create_self(keys)
+ keys = {} unless keys
+ keys = _symbolkey2str(keys)
+ keys['type'] = 'toolbar' # 'toolbar' type returns widget path
+ window(tk_call(Tk::BWidget::SelectFont::TkCommandNames[0],
+ @path, *hash_kv(keys)))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/separator.rb b/ext/tk/lib/tkextlib/bwidget/separator.rb
new file mode 100644
index 0000000000..6d92321210
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/separator.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/bwidget/separator.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Separator < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::Separator
+ TkCommandNames = ['Separator'.freeze].freeze
+ WidgetClassName = 'Separator'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/setup.rb b/ext/tk/lib/tkextlib/bwidget/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/bwidget/spinbox.rb b/ext/tk/lib/tkextlib/bwidget/spinbox.rb
new file mode 100644
index 0000000000..0a45b045fb
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb
@@ -0,0 +1,98 @@
+#
+# tkextlib/bwidget/entry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+require 'tkextlib/bwidget/arrowbutton'
+require 'tkextlib/bwidget/entry'
+
+module Tk
+ module BWidget
+ class SpinBox < Tk::Entry
+ end
+ end
+end
+
+class Tk::BWidget::SpinBox
+ include Scrollable
+
+ TkCommandNames = ['SpinBox'.freeze].freeze
+ WidgetClassName = 'SpinBox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helptext' << 'insertbackground' << 'entryfg' << 'entrybg'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'dragenabled' << 'dropenabled' << 'editable'
+ end
+ private :__boolval_optkeys
+
+ def __listval_optkeys
+ super() << 'values'
+ end
+ private :__listval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ #def entrybind(*args)
+ # _bind([path, 'bind'], *args)
+ # self
+ #end
+ def entrybind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, 'bind'], context, cmd, *args)
+ self
+ end
+
+ #def entrybind_append(*args)
+ # _bind_append([path, 'bind'], *args)
+ # self
+ #end
+ def entrybind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, 'bind'], context, cmd, *args)
+ self
+ end
+
+ def entrybind_remove(*args)
+ _bind_remove([path, 'bind'], *args)
+ self
+ end
+
+ def entrybindinfo(*args)
+ _bindinfo([path, 'bind'], *args)
+ self
+ end
+
+ def get_index_of_value
+ number(tk_send_without_enc('getvalue'))
+ end
+ alias get_value get_index_of_value
+ alias get_value_index get_index_of_value
+
+ def set_value_by_index(idx)
+ idx = "@#{idx}" if idx.kind_of?(Integer)
+ tk_send_without_enc('setvalue', idx)
+ self
+ end
+ alias set_value set_value_by_index
+ alias set_index_value set_value_by_index
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/statusbar.rb b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
new file mode 100644
index 0000000000..5c5dd43fe4
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/statusbar.rb
@@ -0,0 +1,62 @@
+#
+# tkextlib/bwidget/statusbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class StatusBar < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::StatusBar
+ TkCommandNames = ['StatusBar'.freeze].freeze
+ WidgetClassName = 'StatusBar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'showresize' << 'showseparator' << 'showresizesep'
+ end
+ private :__boolval_optkeys
+
+ def add(win, keys={})
+ tk_send('add', win, keys)
+ self
+ end
+
+ def remove(*wins)
+ tk_send('remove', *wins)
+ self
+ end
+
+ def remove_with_destroy(*wins)
+ tk_send('remove', '-destroy', *wins)
+ self
+ end
+
+ def delete(*wins) # same to 'remove_with_destroy'
+ tk_send('delete', *wins)
+ self
+ end
+
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def items
+ simplelist(tk_send('items')).map{|w| window(w)}
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/titleframe.rb b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
new file mode 100644
index 0000000000..71879111c1
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/titleframe.rb
@@ -0,0 +1,33 @@
+#
+# tkextlib/bwidget/titleframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/frame'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class TitleFrame < TkWindow
+ end
+ end
+end
+
+class Tk::BWidget::TitleFrame
+ TkCommandNames = ['TitleFrame'.freeze].freeze
+ WidgetClassName = 'TitleFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def get_frame(&b)
+ win = window(tk_send_without_enc('getframe'))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb
new file mode 100644
index 0000000000..089c482fe8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/tree.rb
@@ -0,0 +1,500 @@
+#
+# tkextlib/bwidget/tree.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/canvas'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ class Tree < TkWindow
+ class Node < TkObject
+ end
+ end
+ end
+end
+
+class Tk::BWidget::Tree
+ include TkItemConfigMethod
+ include Scrollable
+
+ TkCommandNames = ['Tree'.freeze].freeze
+ WidgetClassName = 'Tree'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class Event_for_Items < TkEvent::Event
+ def self._get_extra_args_tbl
+ [
+ TkComm.method(:string) # item idenfier
+ ]
+ end
+ end
+
+ def __strval_optkeys
+ super() << 'crossfill' << 'linesfill'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'dragenabled' << 'dropenabled' <<
+ 'redraw' << 'selectfill' << 'showlines'
+ end
+ private :__boolval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvar'
+ end
+ private :__tkvariable_optkeys
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::BWidget::Tree::Node)
+ tag.id
+ else
+ # tag
+ _get_eval_string(tag)
+ end
+ end
+
+ def areabind(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Items, [path, 'bindArea'],
+ context, cmd, *args)
+ self
+ end
+
+ def areabind_append(context, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindArea'],
+ context, cmd, *args)
+ self
+ end
+
+ def areabind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
+ self
+ end
+
+ def areabindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
+ end
+
+ #def imagebind(*args)
+ # _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ # self
+ #end
+ def imagebind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
+ context, cmd, *args)
+ self
+ end
+
+ #def imagebind_append(*args)
+ # _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ # self
+ #end
+ def imagebind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
+ context, cmd, *args)
+ self
+ end
+
+ def imagebind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ self
+ end
+
+ def imagebindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
+ end
+
+ #def textbind(*args)
+ # _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ # self
+ #end
+ def textbind(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_for_event_class(Event_for_Items, [path, 'bindText'],
+ context, cmd, *args)
+ self
+ end
+
+ #def textbind_append(*args)
+ # _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ # self
+ #end
+ def textbind_append(context, *args)
+ #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
+ context, cmd, *args)
+ self
+ end
+
+ def textbind_remove(*args)
+ _bind_remove_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ self
+ end
+
+ def textbindinfo(*args)
+ _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args)
+ end
+
+ def close_tree(node, recurse=None)
+ tk_send('closetree', tagid(node), recurse)
+ self
+ end
+
+ def delete(*args)
+ tk_send('delete', *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def edit(node, text, *args)
+ tk_send('edit', tagid(node), text, *args)
+ self
+ end
+
+ def exist?(node)
+ bool(tk_send('exists', tagid(node)))
+ end
+
+ def find(findinfo, confine=None)
+ Tk::BWidget::Tree::Node.id2obj(self, tk_send(findinfo, confine))
+ end
+ def find_position(x, y, confine=None)
+ self.find(_at(x,y), confine)
+ end
+ def find_line(linenum)
+ self.find(linenum)
+ end
+
+ def index(node)
+ num_or_str(tk_send('index', tagid(node)))
+ end
+
+ def insert(idx, parent, node, keys={})
+ tk_send('insert', idx, tagid(parent), tagid(node), *hash_kv(keys))
+ self
+ end
+
+ def line(node)
+ number(tk_send('line', tagid(node)))
+ end
+
+ def move(parent, node, idx)
+ tk_send('move', tagid(parent), tagid(node), idx)
+ self
+ end
+
+ def get_node(node, idx)
+ Tk::BWidget::Tree::Node.id2obj(self, tk_send('nodes', tagid(node), idx))
+ end
+
+ def nodes(node, first=None, last=None)
+ simplelist(tk_send('nodes', tagid(node), first, last)).collect{|node|
+ Tk::BWidget::Tree::Node.id2obj(self, node)
+ }
+ end
+
+ def open?(node)
+ bool(self.itemcget(tagid(node), 'open'))
+ end
+
+ def open_tree(node, recurse=None)
+ tk_send('opentree', tagid(node), recurse)
+ self
+ end
+
+ def parent(node)
+ Tk::BWidget::Tree::Node.id2obj(self, tk_send('parent', tagid(node)))
+ end
+
+ def reorder(node, neworder)
+ tk_send('reorder', tagid(node), neworder)
+ self
+ end
+
+ def see(node)
+ tk_send('see', tagid(node))
+ self
+ end
+
+ def selection_add(*args)
+ tk_send_without_enc('selection', 'add',
+ *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+
+ def selection_get
+ list(tk_send_without_enc('selection', 'get'))
+ end
+
+ def selection_include?(*args)
+ bool(tk_send_without_enc('selection', 'get',
+ *(args.collect{|node| tagid(node)})))
+ end
+
+ def selection_range(*args)
+ tk_send_without_enc('selection', 'range',
+ *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def selection_remove(*args)
+ tk_send_without_enc('selection', 'remove',
+ *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def selection_set(*args)
+ tk_send_without_enc('selection', 'set',
+ *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def selection_toggle(*args)
+ tk_send_without_enc('selection', 'toggle',
+ *(args.collect{|node| tagid(node)}))
+ self
+ end
+
+ def toggle(node)
+ tk_send_without_enc('toggle', tagid(node))
+ self
+ end
+
+ def visible(node)
+ bool(tk_send_without_enc('visible', tagid(node)))
+ end
+end
+
+class Tk::BWidget::Tree::Node
+ include TkTreatTagFont
+
+ TreeNode_TBL = TkCore::INTERP.create_table
+
+ (TreeNode_ID = ['bw:node'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ TreeNode_TBL.mutex.synchronize{ TreeNode_TBL.clear }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ TreeNode_TBL.mutex.synchronize{
+ if TreeNode_TBL[tpath]
+ TreeNode_TBL[tpath][id]? TreeNode_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(tree, *args)
+ if tree.kind_of?(Tk::BWidget::Tree)
+ @tree = tree
+ parent = args.shift
+ if parent.kind_of?(Tk::BWidget::Tree::Node)
+ if parent.tree.path != @tree.path
+ fail RuntimeError, 'tree of parent node is not match'
+ end
+ end
+ elsif tree.kind_of?(Tk::BWidget::Tree::Node)
+ @tree = tree.tree
+ parent = tree.parent
+ else
+ fail RuntimeError,
+ "expect Tk::BWidget::Tree or Tk::BWidget::Tree::Node for 1st argument"
+ end
+
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ else
+ keys = {}
+ end
+
+ index = keys.delete('index')
+ unless args.empty?
+ index = args.shift
+ end
+ index = 'end' unless index
+
+ unless args.empty?
+ fail RuntimeError, 'too much arguments'
+ end
+
+ @tpath = @tree.path
+
+ if keys.key?('nodename')
+ @path = @id = keys.delete('nodename')
+ else
+ TreeNode_ID.mutex.synchronize{
+ @path = @id = TreeNode_ID.join(TkCore::INTERP._ip_id_)
+ TreeNode_ID[1].succ!
+ }
+ end
+
+ TreeNode_TBL.mutex.synchronize{
+ TreeNode_TBL[@id] = self
+ TreeNode_TBL[@tpath] = {} unless TreeNode_TBL[@tpath]
+ TreeNode_TBL[@tpath][@id] = self
+ }
+
+ @tree.insert(index, parent, @id, keys)
+ end
+
+ def tree
+ @tree
+ end
+
+ def id
+ @id
+ end
+
+ def [](key)
+ cget(key)
+ end
+
+ def []=(key, val)
+ configure(key, val)
+ val
+ end
+
+ def cget_tkstring(key)
+ @tree.itemcget_tkstring(@id, key)
+ end
+ def cget(key)
+ @tree.itemcget(@id, key)
+ end
+ def cget_strict(key)
+ @tree.itemcget_strict(@id, key)
+ end
+
+ def configure(key, val=None)
+ @tree.itemconfigure(@id, key, val)
+ end
+
+ def configinfo(key=nil)
+ @tree.itemconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @tree.current_itemconfiginfo(@id, key)
+ end
+
+ def close_tree(recurse=None)
+ @tree.close_tree(@id, recurse)
+ self
+ end
+
+ def delete
+ @tree.delete(@id)
+ self
+ end
+
+ def edit(*args)
+ @tree.edit(@id, *args)
+ self
+ end
+
+ def exist?
+ @tree.exist?(@id)
+ end
+
+ def index
+ @tree.index(@id)
+ end
+
+ def move(index, parent=nil)
+ if parent
+ @tree.move(parent, @id, index)
+ else
+ @tree.move(self.parent, @id, index)
+ end
+ end
+
+ def open_tree(recurse=None)
+ @tree.open_tree(@id, recurse)
+ self
+ end
+
+ def open?
+ bool(@tree.itemcget(@id, 'open'))
+ end
+
+ def parent
+ @tree.parent(@id)
+ end
+
+ def reorder(neworder)
+ @tree.reorder(@id, neworder)
+ end
+
+ def see
+ @tree.see(@id)
+ end
+
+ def selection_add
+ @tree.selection_add(@id)
+ end
+
+ def selection_remove
+ @tree.selection_remove(@id)
+ end
+
+ def selection_set
+ @tree.selection_set(@id)
+ end
+
+ def selection_toggle
+ @tree.selection_toggle(@id)
+ end
+
+ def toggle
+ @tree.toggle(@id)
+ end
+
+ def visible
+ @tree.visible(@id)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/bwidget/widget.rb b/ext/tk/lib/tkextlib/bwidget/widget.rb
new file mode 100644
index 0000000000..a93364b567
--- /dev/null
+++ b/ext/tk/lib/tkextlib/bwidget/widget.rb
@@ -0,0 +1,129 @@
+#
+# tkextlib/bwidget/widget.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/bwidget.rb'
+
+module Tk
+ module BWidget
+ module Widget
+ end
+ end
+end
+
+module Tk::BWidget::Widget
+ include Tk
+ extend Tk
+
+ def self.__pathname
+ 'Widget::configure'
+ end
+
+ def self.__cget_cmd
+ ['Widget::cget']
+ end
+
+ def self.__config_cmd
+ ['Widget::configure']
+ end
+
+ def self.cget_strict(slot)
+ slot = slot.to_s
+ info = {}
+ self.current_configinfo.each{|k,v| info[k.to_s] = v if k.to_s == slot}
+ fail RuntimeError, "unknown option \"-#{slot}\"" if info.empty?
+ info.values[0]
+ end
+ def self.cget(slot)
+ self.current_configinfo(slot).values[0]
+ end
+
+ def self.add_map(klass, subclass, subpath, opts)
+ tk_call('Widget::addmap', klass, subclass, subpath, opts)
+ end
+
+ def self.bwinclude(klass, subclass, subpath, *args)
+ tk_call('Widget::bwinclude', klass, subclass, subpath, *args)
+ end
+
+ def self.create(klass, path, rename=None, &b)
+ win = window(tk_call('Widget::create', klass, path, rename))
+ if b
+ if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ win.instance_exec(self, &b)
+ else
+ win.instance_eval(&b)
+ end
+ end
+ win
+ end
+
+ def self.declare(klass, optlist)
+ tk_call('Widget::declare', klass, optlist)
+ end
+
+ def self.define(klass, filename, *args)
+ tk_call('Widget::define', klass, filename, *args)
+ end
+
+ def self.destroy(win)
+ tk_call('Widget::destroy', _epath(win))
+ end
+
+ def self.focus_next(win)
+ tk_call('Widget::focusNext', win)
+ end
+
+ def self.focus_ok(win)
+ tk_call('Widget::focusOk', win)
+ end
+
+ def self.focus_prev(win)
+ tk_call('Widget::focusPrev', win)
+ end
+
+ def self.generate_doc(dir, widgetlist)
+ tk_call('Widget::generate-doc', dir, widgetlist)
+ end
+
+ def self.generate_widget_doc(klass, iscmd, file)
+ tk_call('Widget::generate-widget-doc', klass, iscmd, file)
+ end
+
+ def self.get_option(win, option)
+ tk_call('Widget::getoption', win, option)
+ end
+
+ def self.get_variable(win, varname, my_varname=None)
+ tk_call('Widget::getVariable', win, varname, my_varname)
+ end
+
+ def self.has_changed(win, option, pvalue)
+ tk_call('Widget::hasChanged', win, option, pvalue)
+ end
+
+ def self.init(klass, win, options)
+ tk_call('Widget::init', klass, win, options)
+ end
+
+ def self.set_option(win, option, value)
+ tk_call('Widget::setoption', win, option, value)
+ end
+
+ def self.sub_cget_strict(win, subwidget)
+ tk_call('Widget::subcget', win, subwidget)
+ end
+ def self.sub_cget(win, subwidget)
+ self.sub_cget_strict(win, subwidget)
+ end
+
+ def self.sync_options(klass, subclass, subpath, options)
+ tk_call('Widget::syncoptions', klass, subclass, subpath, options)
+ end
+
+ def self.tkinclude(klass, tkwidget, subpath, *args)
+ tk_call('Widget::tkinclude', klass, tkwidget, subpath, *args)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/itcl.rb b/ext/tk/lib/tkextlib/itcl.rb
new file mode 100644
index 0000000000..1d6ecf04f2
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itcl.rb
@@ -0,0 +1,13 @@
+#
+# [incr Tcl] support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/itcl/setup.rb'
+
+# load library
+require 'tkextlib/itcl/incr_tcl.rb'
diff --git a/ext/tk/lib/tkextlib/itcl/incr_tcl.rb b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
new file mode 100644
index 0000000000..8f6bb33abe
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itcl/incr_tcl.rb
@@ -0,0 +1,178 @@
+#
+# tkextlib/itk/incr_tcl.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+
+# call setup script
+require 'tkextlib/itcl.rb'
+
+# TkPackage.require('Itcl', '3.2')
+TkPackage.require('Itcl')
+
+module Tk
+ module Itcl
+ include Tk
+ extend Tk
+
+ LIBRARY = TkVarAccess.new('::itcl::library')
+ PURIST = TkVarAccess.new('::itcl::purist')
+
+ VERSION = TkCore::INTERP._invoke("set", "::itcl::version").freeze
+ PATCHLEVEL = TkCore::INTERP._invoke("set", "::itcl::patchLevel").freeze
+
+ PACKAGE_NAME = 'Itcl'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Itcl')
+ rescue
+ ''
+ end
+ end
+
+ ##############################################
+
+ class ItclObject < TkObject
+ ITCL_CLASSNAME = ''.freeze
+
+ (ITCL_OBJ_ID = ['itclobj'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+ ITCL_OBJ_TBL = TkUtil.untrust({})
+
+ def initialize(*args)
+ if (@klass = self.class::ITCL_CLASSNAME).empty?
+ fail RuntimeError, 'unknown itcl class (abstract class?)'
+ end
+ Tk::Itcl::ItclObject::ITCL_OBJ_ID.mutex.synchronize{
+ @id = Tk::Itcl::ItclObject::TCL_OBJ_ID.join(TkCore::INTERP._ip_id_)
+ Tk::Itcl::ItclObject::ITCL_OBJ_ID[1].succ!
+ }
+ @path = @id
+ end
+
+ def self.call_proc(name, *args)
+ tk_call("#{ITCL_CLASSNAME}::#{cmd}", *args)
+ end
+
+ def call_method(name, *args)
+ tk_call(@path, name, *args)
+ end
+
+ def isa(klass)
+ bool(tk_call(@path, 'isa', klass))
+ end
+ alias itcl_kind_of? isa
+
+ def info_class
+ tk_call(@path, 'info', 'class')
+ end
+
+ def info_inherit
+ simplelist(tk_call(@path, 'info', 'inherit'))
+ end
+
+ def info_heritage
+ list(tk_call(@path, 'info', 'heritage'))
+ end
+
+ def info_function(*args)
+ if args[-1].kind_of?(Array)
+ params = args.pop
+ params.each{|param|
+ param = param.to_s
+ args << ( (param[0] == ?-)? param: "-#{param}" )
+ }
+ end
+ list(tk_call(@path, 'info', 'function', *args))
+ end
+
+ def info_variable(*args)
+ if args[-1].kind_of?(Array)
+ params = args.pop
+ params.each{|param|
+ param = param.to_s
+ args << ( (param[0] == ?-)? param: "-#{param}" )
+ }
+ end
+ list(tk_call(@path, 'info', 'variable', *args))
+ end
+ end
+
+ ##############################################
+
+ def self.body(klass, func, args, body)
+ tk_call('::itcl::body', "#{klass}::#{func}", args, body)
+ end
+
+ def self.code(cmd, *args)
+ tk_call('::itcl::code', cmd, *args)
+ end
+
+ def self.code_in_namespace(namespace, cmd, *args)
+ tk_call('::itcl::code', '-namespace', namespace, cmd, *args)
+ end
+
+ def self.configbody(klass, var, body)
+ tk_call('::itcl::configbody', "#{klass}::#{var}", body)
+ end
+
+ def self.create_itcl_class(name, body)
+ TkCore::INTERP._invoke('::itcl::class', name, body)
+ klass = Class.new(Tk::Itcl::ItclObject)
+ klass.const_set('ITCL_CLASSNAME', name.dup.freeze)
+ klass
+ end
+
+ def self.delete_itcl_class(*names)
+ tk_call('::itcl::delete', 'class', *names)
+ end
+
+ def self.delete_itcl_object(*names)
+ tk_call('::itcl::delete', 'object', *names)
+ end
+
+ def self.delete_namespace(*names)
+ tk_call('::itcl::delete', 'namespace', *names)
+ end
+
+ def self.ensemble(name, *args)
+ tk_call('::itcl::ensemble', name, *args)
+ end
+
+ def self.find_classes(pat=None)
+ simplelist(tk_call('::itcl::find', 'classes', pat))
+ end
+
+ def self.find_objects(*args)
+ simplelist(tk_call('::itcl::find', 'objects', *args))
+ end
+
+ def self.is_itcl_class(target)
+ bool(tk_call('::itcl::is', 'class', target))
+ end
+
+ def self.is_itcl_object(target)
+ bool(tk_call('::itcl::is', 'object', target))
+ end
+
+ def self.create_local_obj(klass, name, *args)
+ tk_call('::itcl::local', klass, name, *args)
+ end
+
+ def self.is_itcl_instance(klass, target)
+ bool(tk_call('::itcl::is', 'object', '-class', klass, target))
+ end
+
+ def self.scope(var)
+ tk_call('::itcl::scope', var)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/itcl/setup.rb b/ext/tk/lib/tkextlib/itcl/setup.rb
new file mode 100644
index 0000000000..70b38e4916
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itcl/setup.rb
@@ -0,0 +1,13 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
+
+
+# set [incr Tcl] library directory
+
+# ENV['ITCL_LIBRARY'] = '/usr/local/ActiveTcl/lib/itcl3.2/'
diff --git a/ext/tk/lib/tkextlib/itk.rb b/ext/tk/lib/tkextlib/itk.rb
new file mode 100644
index 0000000000..7492bd3eb4
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itk.rb
@@ -0,0 +1,13 @@
+#
+# [incr Tk] support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/itk/setup.rb'
+
+# load library
+require 'tkextlib/itk/incr_tk.rb'
diff --git a/ext/tk/lib/tkextlib/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb
new file mode 100644
index 0000000000..989585e33b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb
@@ -0,0 +1,446 @@
+#
+# tkextlib/itk/incr_tk.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/menuspec'
+require 'tkextlib/itcl.rb'
+
+# call setup script
+require 'tkextlib/itk.rb'
+
+#TkPackage.require('Itk', '3.2')
+TkPackage.require('Itk')
+
+module Tk
+ module Itk
+ include Tk
+ extend Tk
+
+ LIBRARY = TkVarAccess.new('::itk::library')
+
+ PACKAGE_NAME = 'Itk'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Itk')
+ rescue
+ ''
+ end
+ end
+
+ def self.usual(arg, *args)
+ tk_call('::itk::usual', arg, *args)
+ end
+
+ def self.usual_names
+ list(tk_call('::itk::usual'))
+ end
+
+ ############################
+
+ class Archetype < TkWindow
+ TkCommandNames = [].freeze
+ # WidgetClassName = 'Archetype'.freeze
+ # WidgetClassNames[WidgetClassName] = self
+
+ def self.to_eval
+ '::itk::' << self::WidgetClassName
+ end
+
+ def __destroy_hook__
+ Tk::Itk::Component::ComponentID_TBL.delete(self.path)
+ end
+
+ #### [incr Tk] public methods
+ def component
+ simplelist(tk_send('component'))
+ end
+
+ def component_path(name)
+ window(tk_send('component', name))
+ end
+ alias component_widget component_path
+
+ def component_invoke(name, cmd, *args)
+ window(tk_send('component', name, cmd, *args))
+ end
+
+ def component_obj(*names)
+ names = component if names.empty?
+ names.collect{|name| Tk::Itk::Component.new(self.path, name) }
+ end
+
+ #### [incr Tk] protected methods
+=begin
+ def itk_component_add(visibility, name, create_cmds, option_cmds=None)
+ args = []
+ visibility.each{|v| v = v.to_s; args << ( (v[0] == ?-)? v: "-#{v}" )}
+ args << '--' << name << create_cmd << option_cmds
+ tk_call('itk_component', 'add', *args)
+ end
+
+ def itk_component_delete(*names)
+ tk_call('itk_component', 'delete', *names)
+ end
+
+ def itk_initialize(keys={})
+ tk_call('itk_initialize', keys)
+ end
+
+ def itk_option_add(*args)
+ tk_call('itk_option', 'add', *args)
+ end
+
+ def itk_option_define(name, resource, klass, init, config=None)
+ tk_call('itk_option', 'define', name, resource, klass, init, config)
+ end
+
+ def itk_option_remove(*args)
+ tk_call('itk_option', 'remove', *args)
+ end
+=end
+ end
+
+ ############################
+
+ class Toplevel < Archetype
+ TkCommandNames = ['::itk::Toplevel'].freeze
+ WidgetClassName = 'Toplevel'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include Wm
+ include TkMenuSpec
+
+ def __strval_optkeys
+ super() << 'title'
+ end
+ private :__strval_optkeys
+ end
+
+ ############################
+
+ class Widget < Archetype
+ TkCommandNames = ['::itk::Widget'].freeze
+ WidgetClassName = 'Widget'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+ end
+
+
+ ############################
+
+ class Component < TkObject
+ def __cget_cmd
+ [self.master, 'component', self.name, 'cget']
+ end
+ private :__cget_cmd
+
+ def __config_cmd
+ [self.master, 'component', self.name, 'configure']
+ end
+ private :__config_cmd
+
+ ComponentID_TBL = TkCore::INTERP.create_table
+
+ (Itk_Component_ID = ['itk:component'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ ComponentID_TBL.mutex.synchronize{ ComponentID_TBL.clear }
+ }
+
+ def self.id2obj(master, id)
+ if master.kind_of?(TkObject)
+ master = master.path
+ else
+ master = master.to_s
+ end
+ ComponentID_TBL.mutex.synchronize{
+ if ComponentID_TBL.key?(master)
+ (ComponentID_TBL[master].key?(id))? ComponentID_TBL[master][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def self.new(master, component=nil)
+ if master.kind_of?(TkObject)
+ master = master.path
+ else
+ master = master.to_s
+ end
+
+ if component.kind_of?(Tk::Itk::Component)
+ component = component.name
+ elsif component
+ component = component.to_s
+ else
+ Itk_Component_ID.mutex.synchronize{
+ component = Itk_Component_ID.join(TkCore::INTERP._ip_id_)
+ Itk_Component_ID[1].succ!
+ }
+ end
+
+ ComponentID_TBL.mutex.synchronize{
+ if ComponentID_TBL.key?(master)
+ if ComponentID_TBL[master].key?(component)
+ return ComponentID_TBL[master][component]
+ end
+ else
+ ComponentID_TBL[master] = {}
+ end
+ }
+
+ super(master, component)
+ end
+
+ def initialize(master, component)
+ @master = master
+ @component = component
+
+ ComponentID_TBL.mutex.synchronize{
+ ComponentID_TBL[@master][@component] = self
+ }
+
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ @widget = nil
+ @path = nil
+ end
+ end
+
+ def path
+ unless @path
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ @path
+ end
+
+ def epath
+ path()
+ end
+
+ def to_eval
+ path()
+ end
+
+ def master
+ @master
+ end
+
+ def name
+ @component
+ end
+
+ def widget
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ @widget
+ end
+
+ def widget_class
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ @widget.classname
+ rescue
+ nil
+ end
+ end
+ end
+
+ def method_missing(id, *args)
+ name = id.id2name
+
+ # try 1 : component command
+ begin
+ return tk_call(@master, 'component', @component, name, *args)
+ rescue
+ end
+
+ # try 2 : component configure
+ len = args.length
+ begin
+ case len
+ when 1
+ if name[-1] == ?=
+ return configure(name[0..-2], args[0])
+ else
+ return configure(name, args[0])
+ end
+ when 0
+ return cget(name)
+ end
+ rescue
+ end
+
+ # try 3 : widget method or widget configure
+ begin
+ unless @widget
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ end
+ @widget.__send__(id, *args)
+ rescue
+ end
+
+ # unknown method
+ super(id, *args)
+ # fail RuntimeError, "unknown method '#{name}' for #{self.inspect}"
+ end
+
+ def tk_send(cmd, *rest)
+ begin
+ tk_call(@master, 'component', @component, cmd, *rest)
+ rescue
+ unless @path
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ tk_call(@path, cmd, *rest)
+ end
+ end
+
+ def tk_send_without_enc(cmd, *rest)
+ begin
+ tk_call_without_enc(@master, 'component', @component, cmd, *rest)
+ rescue
+ unless @path
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ tk_call_without_enc(@path, cmd, *rest)
+ end
+ end
+
+ def tk_send_with_enc(cmd, *rest)
+ begin
+ tk_call_with_enc(@master, 'component', @component, cmd, *rest)
+ rescue
+ unless @path
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ tk_call_with_enc(@path, cmd, *rest)
+ end
+ end
+
+ #def bind(*args)
+ # unless @widget
+ # begin
+ # @widget = window(tk_call(@master, 'component', @component))
+ # @path = @widget.path
+ # rescue
+ # fail RuntimeError, 'component is not assigned to a widget'
+ # end
+ # end
+ # @widget.bind(*args)
+ #end
+ def bind(context, *args)
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @widget.bind(context, cmd, *args)
+ end
+
+ #def bind_append(*args)
+ # unless @widget
+ # begin
+ # @widget = window(tk_call(@master, 'component', @component))
+ # @path = @widget.path
+ # rescue
+ # fail RuntimeError, 'component is not assigned to a widget'
+ # end
+ # end
+ # @widget.bind_append(*args)
+ #end
+ def bind_append(context, *args)
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @widget.bind_append(context, cmd, *args)
+ end
+
+ def bind_remove(*args)
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ @widget.bind_remove(*args)
+ end
+
+ def bindinfo(*args)
+ unless @widget
+ begin
+ @widget = window(tk_call(@master, 'component', @component))
+ @path = @widget.path
+ rescue
+ fail RuntimeError, 'component is not assigned to a widget'
+ end
+ end
+ @widget.bindinfo(*args)
+ end
+
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/itk/setup.rb b/ext/tk/lib/tkextlib/itk/setup.rb
new file mode 100644
index 0000000000..544926efe0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/itk/setup.rb
@@ -0,0 +1,13 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
+
+
+# set [incr Tk] library directory
+
+# ENV['ITK_LIBRARY'] = '/usr/local/ActiveTcl/lib/itk3.2/'
diff --git a/ext/tk/lib/tkextlib/iwidgets.rb b/ext/tk/lib/tkextlib/iwidgets.rb
new file mode 100644
index 0000000000..ebd4cf7507
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets.rb
@@ -0,0 +1,94 @@
+#
+# [incr Widgets] support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/itcl'
+require 'tkextlib/itk'
+
+# call setup script for general 'tkextlib' libraries
+#require 'tkextlib/setup.rb'
+
+# call setup script
+#require 'tkextlib/iwidgets/setup.rb'
+
+# load all image format handlers
+#TkPackage.require('Iwidgets', '4.0')
+TkPackage.require('Iwidgets')
+
+module Tk
+ module Iwidgets
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+
+ extend TkCore
+
+ PACKAGE_NAME = 'Iwidgets'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Iwidgets')
+ rescue
+ ''
+ end
+ end
+
+ ####################################################
+
+ autoload :Buttonbox, 'tkextlib/iwidgets/buttonbox'
+ autoload :Calendar, 'tkextlib/iwidgets/calendar'
+ autoload :Canvasprintbox, 'tkextlib/iwidgets/canvasprintbox'
+ autoload :Canvasprintdialog, 'tkextlib/iwidgets/canvasprintdialog'
+ autoload :Checkbox, 'tkextlib/iwidgets/checkbox'
+ autoload :Combobox, 'tkextlib/iwidgets/combobox'
+ autoload :Dateentry, 'tkextlib/iwidgets/dateentry'
+ autoload :Datefield, 'tkextlib/iwidgets/datefield'
+ autoload :Dialog, 'tkextlib/iwidgets/dialog'
+ autoload :Dialogshell, 'tkextlib/iwidgets/dialogshell'
+ autoload :Disjointlistbox, 'tkextlib/iwidgets/disjointlistbox'
+ autoload :Entryfield, 'tkextlib/iwidgets/entryfield'
+ autoload :Extbutton, 'tkextlib/iwidgets/extbutton'
+ autoload :Extfileselectionbox, 'tkextlib/iwidgets/extfileselectionbox'
+ autoload :Extfileselectiondialog,'tkextlib/iwidgets/extfileselectiondialog'
+ autoload :Feedback, 'tkextlib/iwidgets/feedback'
+ autoload :Fileselectionbox, 'tkextlib/iwidgets/fileselectionbox'
+ autoload :Fileselectiondialog, 'tkextlib/iwidgets/fileselectiondialog'
+ autoload :Finddialog, 'tkextlib/iwidgets/finddialog'
+ autoload :Hierarchy, 'tkextlib/iwidgets/hierarchy'
+ autoload :Hyperhelp, 'tkextlib/iwidgets/hyperhelp'
+ autoload :Labeledframe, 'tkextlib/iwidgets/labeledframe'
+ autoload :Labeledwidget, 'tkextlib/iwidgets/labeledwidget'
+ autoload :Mainwindow, 'tkextlib/iwidgets/mainwindow'
+ autoload :Menubar, 'tkextlib/iwidgets/menubar'
+ autoload :Messagebox, 'tkextlib/iwidgets/messagebox'
+ autoload :Messagedialog, 'tkextlib/iwidgets/messagedialog'
+ autoload :Notebook, 'tkextlib/iwidgets/notebook'
+ autoload :Optionmenu, 'tkextlib/iwidgets/optionmenu'
+ autoload :Panedwindow, 'tkextlib/iwidgets/panedwindow'
+ autoload :Pushbutton, 'tkextlib/iwidgets/pushbutton'
+ autoload :Promptdialog, 'tkextlib/iwidgets/promptdialog'
+ autoload :Radiobox, 'tkextlib/iwidgets/radiobox'
+ autoload :Scrolledcanvas, 'tkextlib/iwidgets/scrolledcanvas'
+ autoload :Scrolledframe, 'tkextlib/iwidgets/scrolledframe'
+ autoload :Scrolledhtml, 'tkextlib/iwidgets/scrolledhtml'
+ autoload :Scrolledlistbox, 'tkextlib/iwidgets/scrolledlistbox'
+ autoload :Scrolledtext, 'tkextlib/iwidgets/scrolledtext'
+ autoload :Scrolledwidget, 'tkextlib/iwidgets/scrolledwidget'
+ autoload :Selectionbox, 'tkextlib/iwidgets/selectionbox'
+ autoload :Selectiondialog, 'tkextlib/iwidgets/selectiondialog'
+ autoload :Shell, 'tkextlib/iwidgets/shell'
+ autoload :Spindate, 'tkextlib/iwidgets/spindate'
+ autoload :Spinint, 'tkextlib/iwidgets/spinint'
+ autoload :Spinner, 'tkextlib/iwidgets/spinner'
+ autoload :Spintime, 'tkextlib/iwidgets/spintime'
+ autoload :Tabnotebook, 'tkextlib/iwidgets/tabnotebook'
+ autoload :Tabset, 'tkextlib/iwidgets/tabset'
+ autoload :Timeentry, 'tkextlib/iwidgets/timeentry'
+ autoload :Timefield, 'tkextlib/iwidgets/timefield'
+ autoload :Toolbar, 'tkextlib/iwidgets/toolbar'
+ autoload :Watch, 'tkextlib/iwidgets/watch'
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
new file mode 100644
index 0000000000..91e06d1b52
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb
@@ -0,0 +1,121 @@
+#
+# tkextlib/iwidgets/buttonbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Buttonbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Buttonbox
+ TkCommandNames = ['::iwidgets::buttonbox'.freeze].freeze
+ WidgetClassName = 'Buttonbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'buttoncget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'buttonconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'defaultring'
+ end
+ private :__item_boolval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias buttoncget_tkstring itemcget_tkstring
+ alias buttoncget itemcget
+ alias buttoncget_strict itemcget_strict
+ alias buttonconfigure itemconfigure
+ alias buttonconfiginfo itemconfiginfo
+ alias current_buttonconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'add', tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def default(idx)
+ tk_call(@path, 'default', index(idx))
+ self
+ end
+
+ def delete(idx)
+ tk_call(@path, 'delete', index(idx))
+ self
+ end
+
+ def hide(idx)
+ tk_call(@path, 'hide', index(idx))
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def invoke(idx=nil)
+ if idx
+ tk_call(@path, 'invoke', index(idx))
+ else
+ tk_call(@path, 'invoke')
+ end
+ self
+ end
+
+ def show(idx)
+ tk_call(@path, 'show', index(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/calendar.rb b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
new file mode 100644
index 0000000000..a5478c7cc6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/calendar.rb
@@ -0,0 +1,125 @@
+#
+# tkextlib/iwidgets/calendar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Calendar < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Calendar
+ TkCommandNames = ['::iwidgets::calendar'.freeze].freeze
+ WidgetClassName = 'Calendar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() + [
+ 'buttonforeground', 'outline', 'selectcolor',
+ 'weekdaybackground', 'weekendbackground'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'days'
+ end
+ private :__listval_optkeys
+
+ def __font_optkeys
+ super() + ['currentdatefont', 'datefont', 'dayfont', 'titlefont']
+ end
+ private :__font_optkeys
+
+ ####################################
+
+ include Tk::ValidateConfigure
+
+ class CalendarCommand < TkValidateCommand
+ #class CalCmdArgs < TkUtil::CallbackSubst
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [ [?d, ?s, :date], nil ]
+ PROC_TBL = [ [?s, TkComm.method(:string) ], nil ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ # array of config-option key (string or symbol)
+ ['command']
+ end
+
+ #def initialize(cmd = Proc.new, *args)
+ # _initialize_for_cb_class(CalCmdArgs, cmd, *args)
+ #end
+ end
+
+ def __validation_class_list
+ super() << CalendarCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, CalendarCommand)
+=begin
+ def command(cmd = Proc.new, args = nil)
+ if cmd.kind_of?(CalendarCommand)
+ configure('command', cmd)
+ elsif args
+ configure('command', [cmd, args])
+ else
+ configure('command', cmd)
+ end
+ end
+=end
+
+ ####################################
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def select(date)
+ tk_call(@path, 'select', date)
+ self
+ end
+
+ def show(date)
+ tk_call(@path, 'show', date)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
new file mode 100644
index 0000000000..398eec3f1a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb
@@ -0,0 +1,53 @@
+#
+# tkextlib/iwidgets/canvasprintbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Canvasprintbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Canvasprintbox
+ TkCommandNames = ['::iwidgets::canvasprintbox'.freeze].freeze
+ WidgetClassName = 'Canvasprintbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'filename'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'stretch'
+ end
+ private :__boolval_optkeys
+
+ def get_output
+ tk_call(@path, 'getoutput')
+ end
+
+ def print
+ bool(tk_call(@path, 'print'))
+ end
+
+ def refresh
+ tk_call(@path, 'refresh')
+ self
+ end
+
+ def set_canvas(win)
+ tk_call(@path, 'setcanvas', win)
+ self
+ end
+
+ def stop
+ tk_call(@path, 'stop')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
new file mode 100644
index 0000000000..e64d8154ca
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb
@@ -0,0 +1,38 @@
+#
+# tkextlib/iwidgets/canvasprintdialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Canvasprintdialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Canvasprintdialog
+ TkCommandNames = ['::iwidgets::canvasprintdialog'.freeze].freeze
+ WidgetClassName = 'Canvasprintdialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def get_output
+ tk_call(@path, 'getoutput')
+ end
+
+ def print
+ bool(tk_call(@path, 'print'))
+ end
+
+ def refresh
+ tk_call(@path, 'refresh')
+ self
+ end
+
+ def set_canvas(win)
+ tk_call(@path, 'setcanvas', win)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/checkbox.rb b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
new file mode 100644
index 0000000000..a7476c824e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/checkbox.rb
@@ -0,0 +1,130 @@
+#
+# tkextlib/iwidgets/checkbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Checkbox < Tk::Iwidgets::Labeledframe
+ end
+ end
+end
+
+class Tk::Iwidgets::Checkbox
+ TkCommandNames = ['::iwidgets::checkbox'.freeze].freeze
+ WidgetClassName = 'Checkbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'buttoncget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'buttonconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'defaultring'
+ end
+ private :__item_boolval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias buttoncget_tkstring itemcget_tkstring
+ alias buttoncget itemcget
+ alias buttoncget_strict itemcget_strict
+ alias buttonconfigure itemconfigure
+ alias buttonconfiginfo itemconfiginfo
+ alias current_buttonconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'add', tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def delete(idx)
+ tk_call(@path, 'delete', index(idx))
+ self
+ end
+
+ def deselect(idx)
+ tk_call(@path, 'deselect', index(idx))
+ self
+ end
+
+ def flash(idx)
+ tk_call(@path, 'flash', index(idx))
+ self
+ end
+
+ def get_tags
+ simplelist(tk_call_without_enc(@path, 'get'))
+ end
+
+ def get_objs
+ simplelist(tk_call_without_enc(@path, 'get')).collect{|id|
+ Tk::Itk::Component.id2obj(self, id)
+ }
+ end
+
+ def get(idx=nil)
+ if idx
+ bool(tk_call_without_enc(@path, 'get', index(idx)))
+ else
+ get_tags
+ end
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def select(idx)
+ tk_call(@path, 'select', index(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/combobox.rb b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
new file mode 100644
index 0000000000..82dcf25d0b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/combobox.rb
@@ -0,0 +1,104 @@
+#
+# tkextlib/iwidgets/combobox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Combobox < Tk::Iwidgets::Entryfield
+ end
+ end
+end
+
+class Tk::Iwidgets::Combobox
+ TkCommandNames = ['::iwidgets::combobox'.freeze].freeze
+ WidgetClassName = 'Combobox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'completion' << 'dropdown' << 'editable' << 'unique'
+ end
+ private :__boolval_optkeys
+
+ def clear(component=None)
+ tk_call(@path, 'clear', component)
+ self
+ end
+
+ def delete_list(first, last=None)
+ tk_call(@path, 'delete', 'list', first, last)
+ self
+ end
+
+ def delete_entry(first, last=None)
+ tk_call(@path, 'delete', 'entry', first, last)
+ self
+ end
+
+ def get_list_contents(index)
+ tk_call(@path, 'get', index)
+ end
+
+ def insert_list(idx, *elems)
+ tk_call(@path, 'insert', 'list', idx, *elems)
+ self
+ end
+
+ def insert_entry(idx, *elems)
+ tk_call(@path, 'insert', 'entry', idx, *elems)
+ self
+ end
+
+ # listbox methods
+ def size
+ tk_send_without_enc('size').to_i
+ end
+ def see(index)
+ tk_send_without_enc('see', index)
+ self
+ end
+ def selection_anchor(index)
+ tk_send_without_enc('selection', 'anchor', index)
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', first, last)
+ self
+ end
+ def selection_includes(index)
+ bool(tk_send_without_enc('selection', 'includes', index))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', first, last)
+ self
+ end
+
+ # scrolledlistbox methods
+ def get_curselection
+ tk_call(@path, 'getcurselection')
+ end
+ def justify(dir)
+ tk_call(@path, 'justify', dir)
+ self
+ end
+ def sort(*params, &b)
+ # see 'lsort' man page about params
+ if b
+ tk_call(@path, 'sort', '-command', proc(&b), *params)
+ else
+ tk_call(@path, 'sort', *params)
+ end
+ self
+ end
+ def sort_ascending
+ tk_call(@path, 'sort', 'ascending')
+ self
+ end
+ def sort_descending
+ tk_call(@path, 'sort', 'descending')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/dateentry.rb b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
new file mode 100644
index 0000000000..98a0051e55
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/dateentry.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/iwidgets/dateentry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Dateentry < Tk::Iwidgets::Datefield
+ end
+ end
+end
+
+class Tk::Iwidgets::Dateentry
+ TkCommandNames = ['::iwidgets::dateentry'.freeze].freeze
+ WidgetClassName = 'Dateentry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/datefield.rb b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
new file mode 100644
index 0000000000..50d5405a3b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/datefield.rb
@@ -0,0 +1,58 @@
+#
+# tkextlib/iwidgets/datefield.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Datefield < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Datefield
+ TkCommandNames = ['::iwidgets::datefield'.freeze].freeze
+ WidgetClassName = 'Datefield'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'gmt'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def valid?
+ bool(tk_call(@path, 'isvalid'))
+ end
+ alias isvalid? valid?
+
+ def show(date=None)
+ tk_call(@path, 'show', date)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialog.rb b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
new file mode 100644
index 0000000000..2d554ca7b5
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/dialog.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/iwidgets/dialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Dialog < Tk::Iwidgets::Dialogshell
+ end
+ end
+end
+
+class Tk::Iwidgets::Dialog
+ TkCommandNames = ['::iwidgets::dialog'.freeze].freeze
+ WidgetClassName = 'Dialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
new file mode 100644
index 0000000000..e880594532
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb
@@ -0,0 +1,121 @@
+#
+# tkextlib/iwidgets/dialogshell.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Dialogshell < Tk::Iwidgets::Shell
+ end
+ end
+end
+
+class Tk::Iwidgets::Dialogshell
+ TkCommandNames = ['::iwidgets::dialogshell'.freeze].freeze
+ WidgetClassName = 'Dialogshell'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'buttoncget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'buttonconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'defaultring'
+ end
+ private :__item_boolval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias buttoncget_tkstring itemcget_tkstring
+ alias buttoncget itemcget
+ alias buttoncget_strict itemcget_strict
+ alias buttonconfigure itemconfigure
+ alias buttonconfiginfo itemconfiginfo
+ alias current_buttonconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'add', tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def default(idx)
+ tk_call(@path, 'default', index(idx))
+ self
+ end
+
+ def delete(idx)
+ tk_call(@path, 'delete', index(idx))
+ self
+ end
+
+ def hide(idx)
+ tk_call(@path, 'hide', index(idx))
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def invoke(idx=nil)
+ if idx
+ tk_call(@path, 'invoke', index(idx))
+ else
+ tk_call(@path, 'invoke')
+ end
+ self
+ end
+
+ def show(idx)
+ tk_call(@path, 'show', index(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
new file mode 100644
index 0000000000..07ab025cdf
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb
@@ -0,0 +1,50 @@
+#
+# tkextlib/iwidgets/disjointlistbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Disjointlistbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Disjointlistbox
+ TkCommandNames = ['::iwidgets::disjointlistbox'.freeze].freeze
+ WidgetClassName = 'Disjointlistbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'lhslabeltext' << 'rhslabeltext' << 'lhsbuttonlabel' << 'rhsbuttonlabel'
+ end
+ private :__strval_optkeys
+
+ def set_lhs(*items)
+ tk_call(@path, 'setlhs', items)
+ self
+ end
+ def set_rhs(*items)
+ tk_call(@path, 'setrhs', items)
+ self
+ end
+
+ def get_lhs
+ simplelist(tk_call(@path, 'getlhs'))
+ end
+ def get_rhs
+ simplelist(tk_call(@path, 'getrhs'))
+ end
+
+ def insert_lhs(*items)
+ tk_call(@path, 'insertlhs', items)
+ self
+ end
+ def insert_rhs(*items)
+ tk_call(@path, 'insertrhs', items)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/entryfield.rb b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
new file mode 100644
index 0000000000..3e7149a662
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/entryfield.rb
@@ -0,0 +1,185 @@
+#
+# tkextlib/iwidgets/entryfield.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Entryfield < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Entryfield
+ TkCommandNames = ['::iwidgets::entryfield'.freeze].freeze
+ WidgetClassName = 'Entryfield'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ ####################################
+
+ include Tk::ValidateConfigure
+
+ class EntryfieldValidate < TkValidateCommand
+ #class CalCmdArgs < TkUtil::CallbackSubst
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?s, :char ],
+ [ ?P, ?s, :post ],
+ [ ?S, ?s, :current ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+ end
+
+ def self._config_keys
+ ['validate', 'invalid']
+ end
+ end
+
+ def __validation_class_list
+ super() << EntryfieldValidate
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, EntryfieldValidate)
+=begin
+ def validate(cmd = Proc.new, args = nil)
+ if cmd.kind_of?(ValidateCmd)
+ configure('validate', cmd)
+ elsif args
+ configure('validate', [cmd, args])
+ else
+ configure('validate', cmd)
+ end
+ end
+
+ def invalid(cmd = Proc.new, args = nil)
+ if cmd.kind_of?(ValidateCmd)
+ configure('invalid', cmd)
+ elsif args
+ configure('invalid', [cmd, args])
+ else
+ configure('invalid', cmd)
+ end
+ end
+=end
+
+ ####################################
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+
+ def value
+ _fromUTF8(tk_send_without_enc('get'))
+ end
+ def value= (val)
+ tk_send_without_enc('delete', 0, 'end')
+ tk_send_without_enc('insert', 0, _get_eval_enc_str(val))
+ val
+ end
+ alias get value
+ alias set value=
+
+ def cursor=(index)
+ tk_send_without_enc('icursor', index)
+ #self
+ index
+ end
+ alias icursor cursor=
+
+ def index(index)
+ number(tk_send_without_enc('index', index))
+ end
+
+ def insert(pos,text)
+ tk_send_without_enc('insert', pos, _get_eval_enc_str(text))
+ self
+ end
+
+ def mark(pos)
+ tk_send_without_enc('scan', 'mark', pos)
+ self
+ end
+ def dragto(pos)
+ tk_send_without_enc('scan', 'dragto', pos)
+ self
+ end
+ def selection_adjust(index)
+ tk_send_without_enc('selection', 'adjust', index)
+ self
+ end
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+ def selection_from(index)
+ tk_send_without_enc('selection', 'from', index)
+ self
+ end
+ def selection_present()
+ bool(tk_send_without_enc('selection', 'present'))
+ end
+ def selection_range(s, e)
+ tk_send_without_enc('selection', 'range', s, e)
+ self
+ end
+ def selection_to(index)
+ tk_send_without_enc('selection', 'to', index)
+ self
+ end
+
+ # based on tk/scrollable.rb
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/extbutton.rb b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
new file mode 100644
index 0000000000..e744fba91a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/extbutton.rb
@@ -0,0 +1,40 @@
+#
+# tkextlib/iwidgets/extbutton.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Extbutton < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Extbutton
+ TkCommandNames = ['::iwidgets::extbutton'.freeze].freeze
+ WidgetClassName = 'Extbutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'bitmapforeground' << 'ringbackground'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'defaultring'
+ end
+ private :__boolval_optkeys
+
+ def invoke
+ tk_call(@path, 'invoke')
+ self
+ end
+
+ def flash
+ tk_call(@path, 'flash')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
new file mode 100644
index 0000000000..2ff15bb509
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb
@@ -0,0 +1,46 @@
+#
+# tkextlib/iwidgets/extfileselectionbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Extfileselectionbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Extfileselectionbox
+ TkCommandNames = ['::iwidgets::extfileselectionbox'.freeze].freeze
+ WidgetClassName = 'Extfileselectionbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() + [
+ 'dirslabel', 'fileslabel', 'filterlabel', 'mask', 'nomatchstring',
+ 'selectionlabel'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() + ['dirson', 'fileson', 'filteron', 'selectionon']
+ end
+ private :__boolval_optkeys
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def filter
+ tk_call(@path, 'filter')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
new file mode 100644
index 0000000000..509fdcf636
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb
@@ -0,0 +1,33 @@
+#
+# tkextlib/iwidgets/extfileselectiondialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Extfileselectiondialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Extfileselectiondialog
+ TkCommandNames = ['::iwidgets::extfileselectiondialog'.freeze].freeze
+ WidgetClassName = 'Extfileselectiondialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def filter
+ tk_call(@path, 'filter')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/feedback.rb b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
new file mode 100644
index 0000000000..29d04c8a5d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/feedback.rb
@@ -0,0 +1,35 @@
+#
+# tkextlib/iwidgets/feedback.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Feedback < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Feedback
+ TkCommandNames = ['::iwidgets::feedback'.freeze].freeze
+ WidgetClassName = 'Feedback'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'barcolor'
+ end
+ private :__strval_optkeys
+
+ def reset
+ tk_call(@path, 'reset')
+ self
+ end
+
+ def step(inc=1)
+ tk_call(@path, 'step', inc)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
new file mode 100644
index 0000000000..a425b53b5f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb
@@ -0,0 +1,46 @@
+#
+# tkextlib/iwidgets/fileselectionbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Fileselectionbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Fileselectionbox
+ TkCommandNames = ['::iwidgets::fileselectionbox'.freeze].freeze
+ WidgetClassName = 'Fileselectionbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() + [
+ 'directory', 'dirslabel', 'fileslabel', 'filterlabel', 'mask',
+ 'nomatchstring', 'selectionlabel'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() + ['dirson', 'fileson', 'filteron', 'selectionon']
+ end
+ private :__boolval_optkeys
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def filter
+ tk_call(@path, 'filter')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
new file mode 100644
index 0000000000..ebcdaf8c0b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb
@@ -0,0 +1,33 @@
+#
+# tkextlib/iwidgets/fileselectiondialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Fileselectiondialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Fileselectiondialog
+ TkCommandNames = ['::iwidgets::fileselectiondialog'.freeze].freeze
+ WidgetClassName = 'Fileselectiondialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def filter
+ tk_call(@path, 'filter')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/finddialog.rb b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
new file mode 100644
index 0000000000..3d522e07c8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/finddialog.rb
@@ -0,0 +1,42 @@
+#
+# tkextlib/iwidgets/finddialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Finddialog < Tk::Iwidgets::Dialogshell
+ end
+ end
+end
+
+class Tk::Iwidgets::Finddialog
+ TkCommandNames = ['::iwidgets::finddialog'.freeze].freeze
+ WidgetClassName = 'Finddialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() + [
+ 'patternbackground', 'patternforeground',
+ 'searchbackground', 'searchforeground'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ super().update('textwidget'=>proc{|v| window(v)})
+ end
+ private :__val2ruby_optkeys
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def find
+ tk_call(@path, 'find')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
new file mode 100644
index 0000000000..cb9301d0c9
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb
@@ -0,0 +1,365 @@
+#
+# tkextlib/iwidgets/hierarchy.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/text'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Hierarchy < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Hierarchy
+ ItemConfCMD = ['tag'.freeze, 'configure'.freeze].freeze
+ include TkTextTagConfig
+
+ TkCommandNames = ['::iwidgets::hierarchy'.freeze].freeze
+ WidgetClassName = 'Hierarchy'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include Tk::ValidateConfigure
+
+ class QueryCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [ [?n, ?s, :node], nil ]
+ PROC_TBL = [ [?s, TkComm.method(:string) ], nil ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ # array of config-option key (string or symbol)
+ ['querycommand']
+ end
+ end
+
+ class IndicatorCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?n, ?s, :node ],
+ [ ?s, ?b, :status ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?b, TkComm.method(:bool) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ # array of config-option key (string or symbol)
+ ['iconcommand', 'icondblcommand', 'imagedblcommand']
+ end
+ end
+
+ class IconCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?n, ?s, :node ],
+ [ ?i, ?s, :icon ],
+ nil
+ ]
+ PROC_TBL = [ [ ?s, TkComm.method(:string) ], nil ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ # array of config-option key (string or symbol)
+ ['dblclickcommand', 'imagecommand', 'selectcommand']
+ end
+ end
+
+ def __validation_class_list
+ super() << QueryCommand << IndicatorCommand << IconCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, QueryCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, IndicatorCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, IconCommand)
+
+ ####################################
+
+ def __boolval_optkeys
+ super() << 'alwaysquery' << 'expanded' << 'filter'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'markbackground' << 'markforeground' << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def collapse(node)
+ tk_call(@path, 'collapse')
+ self
+ end
+
+ def current
+ tk_call(@path, 'current')
+ end
+
+ def draw(mode=None)
+ case mode
+ when None
+ # do nothing
+ when 'now', :now
+ mode = '-now'
+ when 'eventually', :eventually
+ mode = '-eventually'
+ when String, Symbol
+ mode = mode.to_s
+ mode = '-' << mode if mode[0] != ?-
+ end
+ tk_call(@path, 'draw', mode)
+ end
+
+ def expand(node)
+ tk_call(@path, 'expand', node)
+ self
+ end
+
+ def expanded?(node)
+ bool(tk_call(@path, 'expanded', node))
+ end
+
+ def exp_state
+ list(tk_call(@path, 'expState'))
+ end
+ alias expand_state exp_state
+ alias expanded_list exp_state
+
+ def mark_clear
+ tk_call(@path, 'mark', 'clear')
+ self
+ end
+ def mark_add(*nodes)
+ tk_call(@path, 'mark', 'add', *nodes)
+ self
+ end
+ def mark_remove(*nodes)
+ tk_call(@path, 'mark', 'remove', *nodes)
+ self
+ end
+ def mark_get
+ list(tk_call(@path, 'mark', 'get'))
+ end
+
+ def refresh(node)
+ tk_call(@path, 'refresh', node)
+ self
+ end
+
+ def prune(node)
+ tk_call(@path, 'prune', node)
+ self
+ end
+
+ def selection_clear
+ tk_call(@path, 'selection', 'clear')
+ self
+ end
+ def selection_add(*nodes)
+ tk_call(@path, 'selection', 'add', *nodes)
+ self
+ end
+ def selection_remove(*nodes)
+ tk_call(@path, 'selection', 'remove', *nodes)
+ self
+ end
+ def selection_get
+ list(tk_call(@path, 'selection', 'get'))
+ end
+
+ def toggle(node)
+ tk_call(@path, 'toggle', node)
+ self
+ end
+
+ # based on Tk::Text widget
+
+ def bbox(index)
+ list(tk_send_without_enc('bbox', _get_eval_enc_str(index)))
+ end
+
+ def compare(idx1, op, idx2)
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ op, _get_eval_enc_str(idx2)))
+ end
+
+ def debug
+ bool(tk_send_without_enc('debug'))
+ end
+ def debug=(boolean)
+ tk_send_without_enc('debug', boolean)
+ #self
+ boolean
+ end
+
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+
+ def dlineinfo(index)
+ list(tk_send_without_enc('dlineinfo', _get_eval_enc_str(index)))
+ end
+
+ def get(*index)
+ _fromUTF8(tk_send_without_enc('get', *index))
+ end
+
+ def index(index)
+ tk_send_without_enc('index', _get_eval_enc_str(index))
+ end
+
+ def insert(index, chars, *tags)
+ if tags[0].kind_of? Array
+ # multiple chars-taglist argument :: str, [tag,...], str, [tag,...], ...
+ args = [chars]
+ while tags.size > 0
+ args << tags.shift.collect{|x|_get_eval_string(x)}.join(' ') # taglist
+ args << tags.shift if tags.size > 0 # chars
+ end
+ super(index, *args)
+ else
+ # single chars-taglist argument :: str, tag, tag, ...
+ if tags.size == 0
+ super(index, chars)
+ else
+ super(index, chars, tags.collect{|x|_get_eval_string(x)}.join(' '))
+ end
+ end
+ end
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+ def see(index)
+ tk_send_without_enc('see', index)
+ self
+ end
+
+ # based on tk/scrollable.rb
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
new file mode 100644
index 0000000000..d4ea1aac65
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb
@@ -0,0 +1,50 @@
+#
+# tkextlib/iwidgets/hyperhelp.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Hyperhelp < Tk::Iwidgets::Shell
+ end
+ end
+end
+
+class Tk::Iwidgets::Hyperhelp
+ TkCommandNames = ['::iwidgets::hyperhelp'.freeze].freeze
+ WidgetClassName = 'Hyperhelp'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'helpdir'
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'topics'
+ end
+ private :__listval_optkeys
+
+ def show_topic(topic)
+ tk_call(@path, 'showtopic', topic)
+ self
+ end
+
+ def follow_link(href)
+ tk_call(@path, 'followlink', href)
+ self
+ end
+
+ def forward
+ tk_call(@path, 'forward')
+ self
+ end
+
+ def back
+ tk_call(@path, 'back')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
new file mode 100644
index 0000000000..6595398427
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb
@@ -0,0 +1,39 @@
+#
+# tkextlib/iwidgets/labeledframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Labeledframe < Tk::Itk::Archetype
+ end
+ end
+end
+
+class Tk::Iwidgets::Labeledframe
+ TkCommandNames = ['::iwidgets::labeledframe'.freeze].freeze
+ WidgetClassName = 'Labeledframe'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'labeltext'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'labelvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def __font_optkeys
+ super() << 'labelfont'
+ end
+ private :__font_optkeys
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
new file mode 100644
index 0000000000..d36d42878d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb
@@ -0,0 +1,45 @@
+#
+# tkextlib/iwidgets/labeledwidget.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Labeledwidget < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Labeledwidget
+ extend TkCore
+
+ TkCommandNames = ['::iwidgets::labeledwidget'.freeze].freeze
+ WidgetClassName = 'Labeledwidget'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'labeltext'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'labelvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def __font_optkeys
+ super() << 'labelfont'
+ end
+ private :__font_optkeys
+
+ def self.alignlabels(*wins)
+ tk_call('::iwidgets::Labeledwidget::alignlabels', *wins)
+ end
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
new file mode 100644
index 0000000000..ebf48021db
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb
@@ -0,0 +1,67 @@
+#
+# tkextlib/iwidgets/mainwindow.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Mainwindow < Tk::Iwidgets::Shell
+ end
+ end
+end
+
+class Tk::Iwidgets::Mainwindow
+ TkCommandNames = ['::iwidgets::mainwindow'.freeze].freeze
+ WidgetClassName = 'Mainwindow'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'helpline' << 'statusline'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'menubarbackground' << 'menubarforeground' << 'toolbarforeground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'menubarfont' << 'toolbarfont'
+ end
+ private :__font_optkeys
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def menubar(*args)
+ unless args.empty?
+ tk_call(@path, 'menubar', *args)
+ end
+ window(tk_call(@path, 'menubar'))
+ end
+
+ def mousebar(*args)
+ unless args.empty?
+ tk_call(@path, 'mousebar', *args)
+ end
+ window(tk_call(@path, 'mousebar'))
+ end
+
+ def msgd(*args)
+ unless args.empty?
+ tk_call(@path, 'msgd', *args)
+ end
+ window(tk_call(@path, 'msgd'))
+ end
+
+ def toolbar(*args)
+ unless args.empty?
+ tk_call(@path, 'toolbar', *args)
+ end
+ window(tk_call(@path, 'toolbar'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/menubar.rb b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
new file mode 100644
index 0000000000..f9a17d0b55
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/menubar.rb
@@ -0,0 +1,212 @@
+#
+# tkextlib/iwidgets/menubar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Menubar < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Menubar
+ TkCommandNames = ['::iwidgets::menubar'.freeze].freeze
+ WidgetClassName = 'Menubar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'menubuttons'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvariable'
+ end
+ private :__tkvariable_optkeys
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'menucget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'menuconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_strval_optkeys(id)
+ super(id) << 'selectcolor'
+ end
+ private :__item_strval_optkeys
+
+ def __item_tkvariable_optkeys(id)
+ super(id) << 'helpstr'
+ end
+ private :__item_tkvariable_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias menucget_tkstring itemcget_tkstring
+ alias menucget itemcget
+ alias menucget_strict itemcget_strict
+ alias menuconfigure itemconfigure
+ alias menuconfiginfo itemconfiginfo
+ alias current_menuconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __methodcall_optkeys
+ {'menubuttons'=>'menubuttons'}
+ end
+
+ def menubuttons(val = nil)
+ unless val
+ return tk_call(@path, 'cget', '-menubuttons')
+ end
+
+ tk_call(@path, 'configure', '-menubuttons', _parse_menu_spec(val))
+ self
+ end
+
+ def _parse_menu_spec(menu_spec)
+ ret = ''
+ menu_spec.each{|spec|
+ next unless spec
+
+ if spec.kind_of?(Hash)
+ args = [spec]
+ type = 'options'
+ else
+ type, *args = spec
+ end
+
+ type = type.to_s
+ case type
+ when 'options'
+ keys = args[0]
+ ary = [type]
+ ary.concat(hash_kv(keys))
+ ret << array2tk_list(ary) << "\n"
+
+ when 'menubutton', 'cascade'
+ name, keys = args
+ if keys
+ ary = [type, name]
+ keys = _symbolkey2str(keys)
+ keys['menu'] = _parse_menu_spec(keys['menu']) if keys.key?('menu')
+ ary.concat(hash_kv(keys))
+ ret << array2tk_list(ary) << "\n"
+ else
+ ret << array2tk_list([type, name]) << "\n"
+ end
+
+ else
+ name, keys = args
+ if keys
+ ary = [type, name]
+ ary.concat(hash_kv(keys))
+ ret << array2tk_list(ary) << "\n"
+ else
+ ret << array2tk_list([type, name]) << "\n"
+ end
+ end
+ }
+ ret
+ end
+
+ ####################################
+
+ def add(type, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ keys = _symbolkey2str(keys)
+ keys['menu'] = _parse_menu_spec(keys['menu']) if keys.key?('menu')
+ tk_call(@path, 'add', type, tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def delete(path1, path2=nil)
+ if path2
+ else
+ tk_call(@path, 'delete', index(idx))
+ end
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, type, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ keys = _symbolkey2str(keys)
+ keys['menu'] = _parse_menu_spec(keys['menu']) if keys.key?('menu')
+ tk_call(@path, 'insert', index(idx), type, tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def invoke(idx)
+ tk_call(@path, 'invoke', index(idx))
+ self
+ end
+
+ def menupath(pat)
+ if (win = tk_call(@path, 'path', pat)) == '-1'
+ return nil
+ end
+ window(win)
+ end
+ def menupath_glob(pat)
+ if (win = tk_call(@path, 'path', '-glob', pat)) == '-1'
+ return nil
+ end
+ window(win)
+ end
+ def menupath_tclregexp(pat)
+ if (win = tk_call(@path, 'path', '-regexp', pat)) == '-1'
+ return nil
+ end
+ window(win)
+ end
+
+ def type(path)
+ tk_call(@path, 'type', path)
+ end
+
+ def yposition(path)
+ number(tk_call(@path, 'yposition', path))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagebox.rb b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
new file mode 100644
index 0000000000..6adb53d941
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/messagebox.rb
@@ -0,0 +1,93 @@
+#
+# tkextlib/iwidgets/messagebox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Messagebox < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Messagebox
+ TkCommandNames = ['::iwidgets::messagebox'.freeze].freeze
+ WidgetClassName = 'Messagebox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'type', 'cget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'type', 'configure', id]
+ end
+ private :__item_config_cmd
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'bell' << 'show'
+ end
+ private :__item_boolval_optkeys
+
+ alias typecget_tkstring itemcget_tkstring
+ alias typecget itemcget
+ alias typecget_strict itemcget_strict
+ alias typeconfigure itemconfigure
+ alias typeconfiginfo itemconfiginfo
+ alias current_typeconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __strval_optkeys
+ super() << 'filename' << 'savedir'
+ end
+ private :__strval_optkeys
+
+ def type_add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ unless tag
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'type', 'add', tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def export(file)
+ tk_call(@path, 'export', file)
+ self
+ end
+
+ def issue(string, type=None, *args)
+ tk_call(@path, 'issue', string, tagid(type), *args)
+ self
+ end
+
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
new file mode 100644
index 0000000000..9aa590056f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/iwidgets/messagedialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Messagedialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Messagedialog
+ TkCommandNames = ['::iwidgets::messagedialog'.freeze].freeze
+ WidgetClassName = 'Messagedialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/notebook.rb b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
new file mode 100644
index 0000000000..7ed4126a4d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/notebook.rb
@@ -0,0 +1,175 @@
+#
+# tkextlib/iwidgets/notebook.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Notebook < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Notebook
+ TkCommandNames = ['::iwidgets::notebook'.freeze].freeze
+ WidgetClassName = 'Notebook'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'pagecget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'pageconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias pagecget_tkstring itemcget_tkstring
+ alias pagecget itemcget
+ alias pagecget_strict itemcget_strict
+ alias pageconfigure itemconfigure
+ alias pageconfiginfo itemconfiginfo
+ alias current_pageconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __boolval_optkeys
+ super() << 'auto'
+ end
+ private :__boolval_optkeys
+
+ def add(keys={})
+ window(tk_call(@path, 'add', *hash_kv(keys)))
+ end
+
+ def child_site_list
+ list(tk_call(@path, 'childsite'))
+ end
+
+ def child_site(idx)
+ if (new_idx = self.index(idx)) < 0
+ new_idx = tagid(idx)
+ end
+ window(tk_call(@path, 'childsite', new_idx))
+ end
+
+ def delete(idx1, idx2=nil)
+ if (new_idx1 = self.index(idx1)) < 0
+ new_idx1 = tagid(idx1)
+ end
+ if idx2
+ if (new_idx2 = self.index(idx2)) < 0
+ new_idx2 = tagid(idx2)
+ end
+ tk_call(@path, 'delete', new_idx1, new_idx2)
+ else
+ tk_call(@path, 'delete', new_idx1)
+ end
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, keys={})
+ if (new_idx = self.index(idx)) < 0
+ new_idx = tagid(idx)
+ end
+ window(tk_call(@path, 'insert', new_idx, *hash_kv(keys)))
+ end
+
+ def next
+ tk_call(@path, 'next')
+ self
+ end
+
+ def prev
+ tk_call(@path, 'prev')
+ self
+ end
+
+ def select(idx)
+ if (new_idx = self.index(idx)) < 0
+ new_idx = tagid(idx)
+ end
+ tk_call(@path, 'select', new_idx)
+ self
+ end
+
+ def scrollcommand(cmd=Proc.new)
+ configure_cmd 'scrollcommand', cmd
+ self
+ end
+ alias xscrollcommand scrollcommand
+ alias yscrollcommand scrollcommand
+
+ def xscrollbar(bar=nil)
+ if bar
+ @scrollbar = bar
+ @scrollbar.orient 'horizontal'
+ self.scrollcommand {|*arg| @scrollbar.set(*arg)}
+ @scrollbar.command {|*arg| self.xview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @scrollbar
+ end
+ def yscrollbar(bar=nil)
+ if bar
+ @scrollbar = bar
+ @scrollbar.orient 'vertical'
+ self.scrollcommand {|*arg| @scrollbar.set(*arg)}
+ @scrollbar.command {|*arg| self.yview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @scrollbar
+ end
+ alias scrollbar yscrollbar
+
+ def view(*idxs)
+ if idxs.size == 0
+ idx = num_or_str(tk_send_without_enc('view'))
+ if idx.kind_of?(Fixnum) && idx < 0
+ nil
+ else
+ idx
+ end
+ else
+ tk_send_without_enc('view', *idxs)
+ self
+ end
+ end
+ alias xview view
+ alias yview view
+
+ def view_moveto(*idxs)
+ view('moveto', *idxs)
+ end
+ alias xview_moveto view_moveto
+ alias yview_moveto view_moveto
+ def view_scroll(index, what='pages')
+ view('scroll', index, what)
+ end
+ alias xview_scroll view_scroll
+ alias yview_scroll view_scroll
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
new file mode 100644
index 0000000000..57a3cc7d2b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb
@@ -0,0 +1,92 @@
+#
+# tkextlib/iwidgets/optionmenu.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Optionmenu < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Optionmenu
+ TkCommandNames = ['::iwidgets::optionmenu'.freeze].freeze
+ WidgetClassName = 'Optionmenu'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'cyclicon'
+ end
+ private :__boolval_optkeys
+
+ def delete(first, last=nil)
+ if last
+ tk_call(@path, 'delete', first, last)
+ else
+ tk_call(@path, 'delete', first)
+ end
+ self
+ end
+
+ def disable(idx)
+ tk_call(@path, 'disable', idx)
+ self
+ end
+
+ def enable(idx)
+ tk_call(@path, 'enable', idx)
+ self
+ end
+
+ def get(first=nil, last=nil)
+ if last
+ simplelist(tk_call(@path, 'get', first, last))
+ elsif first
+ tk_call(@path, 'get', first)
+ else
+ tk_call(@path, 'get')
+ end
+ end
+ def get_range(first, last)
+ get(first, last)
+ end
+ def get_selected
+ get()
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', idx))
+ end
+
+ def insert(idx, *args)
+ tk_call(@path, 'insert', idx, *args)
+ self
+ end
+
+ def select(idx)
+ tk_call(@path, 'select', idx)
+ self
+ end
+
+ def sort(*params, &b)
+ # see 'lsort' man page about params
+ if b
+ tk_call(@path, 'sort', '-command', proc(&b), *params)
+ else
+ tk_call(@path, 'sort', *params)
+ end
+ self
+ end
+ def sort_ascending
+ tk_call(@path, 'sort', 'ascending')
+ self
+ end
+ def sort_descending
+ tk_call(@path, 'sort', 'descending')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
new file mode 100644
index 0000000000..65463cc85a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb
@@ -0,0 +1,134 @@
+#
+# tkextlib/iwidgets/panedwindow.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Panedwindow < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Panedwindow
+ TkCommandNames = ['::iwidgets::panedwindow'.freeze].freeze
+ WidgetClassName = 'Panedwindow'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'panecget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'paneconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias panecget_tkstring itemcget_tkstring
+ alias panecget itemcget
+ alias panecget_strict itemcget_strict
+ alias paneconfigure itemconfigure
+ alias paneconfiginfo itemconfiginfo
+ alias current_paneconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __boolval_optkeys
+ super() << 'showhandle'
+ end
+ private :__boolval_optkeys
+
+ def add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ window(tk_call(@path, 'add', tagid(tag), *hash_kv(keys)))
+ tag
+ end
+
+ def child_site_list
+ list(tk_call(@path, 'childsite'))
+ end
+
+ def child_site(idx)
+ window(tk_call(@path, 'childsite', index(idx)))
+ end
+
+ def delete(idx)
+ tk_call(@path, 'delete', index(idx))
+ self
+ end
+
+ def fraction(*percentages)
+ tk_call(@path, 'fraction', *percentages)
+ self
+ end
+
+ def hide(idx)
+ tk_call(@path, 'hide', index(idx))
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ window(tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys)))
+ tag
+ end
+
+ def invoke(idx=nil)
+ if idx
+ tk_call(@path, 'invoke', index(idx))
+ else
+ tk_call(@path, 'invoke')
+ end
+ self
+ end
+
+ def reset
+ tk_call(@path, 'reset')
+ self
+ end
+
+ def show(idx)
+ tk_call(@path, 'show', index(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
new file mode 100644
index 0000000000..7c7ff7ad62
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb
@@ -0,0 +1,131 @@
+#
+# tkextlib/iwidgets/promptdialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Promptdialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Promptdialog
+ TkCommandNames = ['::iwidgets::promptdialog'.freeze].freeze
+ WidgetClassName = 'Promptdialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ # index method is not available, because it shows index of the entry field
+ def default(name)
+ tk_call(@path, 'default', tagid(name))
+ self
+ end
+
+ def hide(name)
+ tk_call(@path, 'hide', tagid(name))
+ self
+ end
+
+ def invoke(name=nil)
+ if name
+ tk_call(@path, 'invoke', tagid(name))
+ else
+ tk_call(@path, 'invoke')
+ end
+ self
+ end
+
+ def show(name)
+ tk_call(@path, 'show', tagid(name))
+ self
+ end
+
+
+ # based on Tk::Iwidgets::Entryfield
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+
+ def value
+ _fromUTF8(tk_send_without_enc('get'))
+ end
+ def value= (val)
+ tk_send_without_enc('delete', 0, 'end')
+ tk_send_without_enc('insert', 0, _get_eval_enc_str(val))
+ val
+ end
+ alias get value
+ alias set value=
+
+ def cursor=(index)
+ tk_send_without_enc('icursor', index)
+ #self
+ index
+ end
+ alias icursor cursor=
+
+ def index(idx)
+ number(tk_send_without_enc('index', idx))
+ end
+
+ def insert(pos,text)
+ tk_send_without_enc('insert', pos, _get_eval_enc_str(text))
+ self
+ end
+
+ def mark(pos)
+ tk_send_without_enc('scan', 'mark', pos)
+ self
+ end
+ def dragto(pos)
+ tk_send_without_enc('scan', 'dragto', pos)
+ self
+ end
+ def selection_adjust(index)
+ tk_send_without_enc('selection', 'adjust', index)
+ self
+ end
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+ def selection_from(index)
+ tk_send_without_enc('selection', 'from', index)
+ self
+ end
+ def selection_present()
+ bool(tk_send_without_enc('selection', 'present'))
+ end
+ def selection_range(s, e)
+ tk_send_without_enc('selection', 'range', s, e)
+ self
+ end
+ def selection_to(index)
+ tk_send_without_enc('selection', 'to', index)
+ self
+ end
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
new file mode 100644
index 0000000000..ae56788289
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb
@@ -0,0 +1,35 @@
+#
+# tkextlib/iwidgets/pushbutton.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Pushbutton < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Pushbutton
+ TkCommandNames = ['::iwidgets::pushbutton'.freeze].freeze
+ WidgetClassName = 'Pushbutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'defaultring'
+ end
+ private :__boolval_optkeys
+
+ def invoke
+ tk_call_without_enc(@path, 'invoke')
+ self
+ end
+
+ def flash
+ tk_call_without_enc(@path, 'flash')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/radiobox.rb b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
new file mode 100644
index 0000000000..21181777b5
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/radiobox.rb
@@ -0,0 +1,121 @@
+#
+# tkextlib/iwidgets/radiobox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Radiobox < Tk::Iwidgets::Labeledframe
+ end
+ end
+end
+
+class Tk::Iwidgets::Radiobox
+ TkCommandNames = ['::iwidgets::radiobox'.freeze].freeze
+ WidgetClassName = 'Radiobox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'buttoncget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'buttonconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'defaultring'
+ end
+ private :__item_boolval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias buttoncget_tkstring itemcget_tkstring
+ alias buttoncget itemcget
+ alias buttoncget_strict itemcget_strict
+ alias buttonconfigure itemconfigure
+ alias buttonconfiginfo itemconfiginfo
+ alias current_buttonconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def add(tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'add', tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def delete(idx)
+ tk_call(@path, 'delete', index(idx))
+ self
+ end
+
+ def deselect(idx)
+ tk_call(@path, 'deselect', index(idx))
+ self
+ end
+
+ def flash(idx)
+ tk_call(@path, 'flash', index(idx))
+ self
+ end
+
+ def get_tag
+ ((tag = tk_call_without_enc(@path, 'get')).empty?)? nil: tag
+ end
+ alias get get_tag
+
+ def get_obj
+ (tag = get_tag)? Tk::Itk::Component.id2obj(self, tag): nil
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ tk_call(@path, 'insert', index(idx), tagid(tag), *hash_kv(keys))
+ tag
+ end
+
+ def select(idx)
+ tk_call(@path, 'select', index(idx))
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
new file mode 100644
index 0000000000..056cd85322
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb
@@ -0,0 +1,24 @@
+#
+# tkextlib/iwidgets/buttonbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scopedobject < TkObject
+ end
+ end
+end
+
+class Tk::Iwidgets::Scopedobject
+ TkCommandNames = ['::iwidgets::scopedobject'.freeze].freeze
+ WidgetClassName = 'Scopedobject'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def initialize(obj_name, keys={})
+ @path = tk_call(self.class::TkCommandNames[0], obj_name, *hash_kv(keys))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
new file mode 100644
index 0000000000..4dea2f2d5c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
@@ -0,0 +1,353 @@
+#
+# tkextlib/iwidgets/scrolledcanvas.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/canvas'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledcanvas < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledcanvas
+ TkCommandNames = ['::iwidgets::scrolledcanvas'.freeze].freeze
+ WidgetClassName = 'Scrolledcanvas'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ################################
+
+ def __boolval_optkeys
+ super() << 'autoresize'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def initialize(*args)
+ super(*args)
+ @canvas = component_widget('canvas')
+ end
+
+ def method_missing(id, *args)
+ if @canvas.respond_to?(id)
+ @canvas.__send__(id, *args)
+ else
+ super(id, *args)
+ end
+ end
+
+ ################################
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def justify(dir)
+ tk_call(@path, 'justify', dir)
+ self
+ end
+
+ ##########################
+ include TkCanvasItemConfig
+
+ def tagid(tag)
+ if tag.kind_of?(TkcItem) || tag.kind_of?(TkcTag)
+ tag.id
+ elsif tag.kind_of?(Tk::Itk::Component)
+ tag.name
+ else
+ tag # maybe an Array of configure parameters
+ end
+ end
+ private :tagid
+
+ # create a canvas item without creating a TkcItem object
+ def create(type, *args)
+ type.create(self, *args)
+ end
+
+ #######################
+
+ def addtag(tag, mode, *args)
+ tk_send_without_enc('addtag', tagid(tag), mode, *args)
+ self
+ end
+ def addtag_above(tagOrId, target)
+ addtag(tagOrId, 'above', tagid(target))
+ end
+ def addtag_all(tagOrId)
+ addtag(tagOrId, 'all')
+ end
+ def addtag_below(tagOrId, target)
+ addtag(tagOrId, 'below', tagid(target))
+ end
+ def addtag_closest(tagOrId, x, y, halo=None, start=None)
+ addtag(tagOrId, 'closest', x, y, halo, start)
+ end
+ def addtag_enclosed(tagOrId, x1, y1, x2, y2)
+ addtag(tagOrId, 'enclosed', x1, y1, x2, y2)
+ end
+ def addtag_overlapping(tagOrId, x1, y1, x2, y2)
+ addtag(tagOrId, 'overlapping', x1, y1, x2, y2)
+ end
+ def addtag_withtag(tagOrId, tag)
+ addtag(tagOrId, 'withtag', tagid(tag))
+ end
+
+ def bbox(tagOrId, *tags)
+ list(tk_send_without_enc('bbox', tagid(tagOrId),
+ *tags.collect{|t| tagid(t)}))
+ end
+
+ #def itembind(tag, context, cmd=Proc.new, *args)
+ # _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def itembind(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+
+ #def itembind_append(tag, context, cmd=Proc.new, *args)
+ # _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ # self
+ #end
+ def itembind_append(tag, context, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([path, "bind", tagid(tag)], context, cmd, *args)
+ self
+ end
+
+ def itembind_remove(tag, context)
+ _bind_remove([path, "bind", tagid(tag)], context)
+ self
+ end
+
+ def itembindinfo(tag, context=nil)
+ _bindinfo([path, "bind", tagid(tag)], context)
+ end
+
+ def canvasx(screen_x, *args)
+ #tk_tcl2ruby(tk_send_without_enc('canvasx', screen_x, *args))
+ number(tk_send_without_enc('canvasx', screen_x, *args))
+ end
+ def canvasy(screen_y, *args)
+ #tk_tcl2ruby(tk_send_without_enc('canvasy', screen_y, *args))
+ number(tk_send_without_enc('canvasy', screen_y, *args))
+ end
+
+ def coords(tag, *args)
+ if args == []
+ tk_split_list(tk_send_without_enc('coords', tagid(tag)))
+ else
+ tk_send_without_enc('coords', tagid(tag), *(args.flatten))
+ self
+ end
+ end
+
+ def dchars(tag, first, last=None)
+ tk_send_without_enc('dchars', tagid(tag),
+ _get_eval_enc_str(first), _get_eval_enc_str(last))
+ self
+ end
+
+ def delete(*args)
+ tbl = nil
+ TkcItem::CItemID_TBL.mutex.synchronize{
+ tbl = TkcItem::CItemID_TBL[self.path]
+ }
+ if tbl
+ find('withtag', *args).each{|item|
+ if item.kind_of?(TkcItem)
+ TkcItem::CItemID_TBL.mutex.synchronize{
+ tbl.delete(item.id)
+ }
+ end
+ }
+ end
+ tk_send_without_enc('delete', *args.collect{|t| tagid(t)})
+ self
+ end
+ alias remove delete
+
+ def dtag(tag, tag_to_del=None)
+ tk_send_without_enc('dtag', tagid(tag), tag_to_del)
+ self
+ end
+
+ def find(mode, *args)
+ list(tk_send_without_enc('find', mode, *args)).collect!{|id|
+ TkcItem.id2obj(self, id)
+ }
+ end
+ def find_above(target)
+ find('above', tagid(target))
+ end
+ def find_all
+ find('all')
+ end
+ def find_below(target)
+ find('below', tagid(target))
+ end
+ def find_closest(x, y, halo=None, start=None)
+ find('closest', x, y, halo, start)
+ end
+ def find_enclosed(x1, y1, x2, y2)
+ find('enclosed', x1, y1, x2, y2)
+ end
+ def find_overlapping(x1, y1, x2, y2)
+ find('overlapping', x1, y1, x2, y2)
+ end
+ def find_withtag(tag)
+ find('withtag', tag)
+ end
+
+ def itemfocus(tagOrId=nil)
+ if tagOrId
+ tk_send_without_enc('focus', tagid(tagOrId))
+ self
+ else
+ ret = tk_send_without_enc('focus')
+ if ret == ""
+ nil
+ else
+ TkcItem.id2obj(self, ret)
+ end
+ end
+ end
+
+ def gettags(tagOrId)
+ list(tk_send_without_enc('gettags', tagid(tagOrId))).collect{|tag|
+ TkcTag.id2obj(self, tag)
+ }
+ end
+
+ def icursor(tagOrId, index)
+ tk_send_without_enc('icursor', tagid(tagOrId), index)
+ self
+ end
+
+ def index(tagOrId, idx)
+ number(tk_send_without_enc('index', tagid(tagOrId), idx))
+ end
+
+ def insert(tagOrId, index, string)
+ tk_send_without_enc('insert', tagid(tagOrId), index,
+ _get_eval_enc_str(string))
+ self
+ end
+
+ def lower(tag, below=nil)
+ if below
+ tk_send_without_enc('lower', tagid(tag), tagid(below))
+ else
+ tk_send_without_enc('lower', tagid(tag))
+ end
+ self
+ end
+
+ def move(tag, x, y)
+ tk_send_without_enc('move', tagid(tag), x, y)
+ self
+ end
+
+ def postscript(keys)
+ tk_send("postscript", *hash_kv(keys))
+ end
+
+ def raise(tag, above=nil)
+ if above
+ tk_send_without_enc('raise', tagid(tag), tagid(above))
+ else
+ tk_send_without_enc('raise', tagid(tag))
+ end
+ self
+ end
+
+ def scale(tag, x, y, xs, ys)
+ tk_send_without_enc('scale', tagid(tag), x, y, xs, ys)
+ self
+ end
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+
+ def select(mode, *args)
+ r = tk_send_without_enc('select', mode, *args)
+ (mode == 'item')? TkcItem.id2obj(self, r): self
+ end
+ def select_adjust(tagOrId, index)
+ select('adjust', tagid(tagOrId), index)
+ end
+ def select_clear
+ select('clear')
+ end
+ def select_from(tagOrId, index)
+ select('from', tagid(tagOrId), index)
+ end
+ def select_item
+ select('item')
+ end
+ def select_to(tagOrId, index)
+ select('to', tagid(tagOrId), index)
+ end
+
+ def itemtype(tag)
+ TkcItem.type2class(tk_send('type', tagid(tag)))
+ end
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
new file mode 100644
index 0000000000..7b7b95df1c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb
@@ -0,0 +1,59 @@
+#
+# tkextlib/iwidgets/scrolledframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledframe < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledframe
+ TkCommandNames = ['::iwidgets::scrolledframe'.freeze].freeze
+ WidgetClassName = 'Scrolledframe'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def justify(dir)
+ tk_call(@path, 'justify', dir)
+ self
+ end
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
new file mode 100644
index 0000000000..dc2966bd48
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb
@@ -0,0 +1,58 @@
+#
+# tkextlib/iwidgets/scrolledhtml.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledhtml < Tk::Iwidgets::Scrolledtext
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledhtml
+ TkCommandNames = ['::iwidgets::scrolledhtml'.freeze].freeze
+ WidgetClassName = 'Scrolledhtml'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'update'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'fontname' << 'link' << 'alink' << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'fixedfont'
+ end
+ private :__font_optkeys
+
+ def import(href)
+ tk_call(@path, 'import', href)
+ self
+ end
+
+ def import_link(href)
+ tk_call(@path, 'import', '-link', href)
+ self
+ end
+
+ def pwd
+ tk_call(@path, 'pwd')
+ end
+
+ def render(htmltext, workdir=None)
+ tk_call(@path, 'render', htmltext, workdir)
+ self
+ end
+
+ def title
+ tk_call(@path, 'title')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
new file mode 100644
index 0000000000..20a4cd1d36
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
@@ -0,0 +1,207 @@
+#
+# tkextlib/iwidgets/scrolledlistbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/listbox'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledlistbox < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledlistbox
+ TkCommandNames = ['::iwidgets::scrolledlistbox'.freeze].freeze
+ WidgetClassName = 'Scrolledlistbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'listvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ ################################
+
+ def initialize(*args)
+ super(*args)
+ @listbox = component_widget('listbox')
+ end
+
+ def method_missing(id, *args)
+ if @listbox.respond_to?(id)
+ @listbox.__send__(id, *args)
+ else
+ super(id, *args)
+ end
+ end
+
+ ################################
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def get_curselection
+ tk_call(@path, 'getcurselection')
+ end
+
+ def justify(dir)
+ tk_call(@path, 'justify', dir)
+ self
+ end
+
+ def selected_item_count
+ number(tk_call(@path, 'selecteditemcount'))
+ end
+
+ def sort(*params, &b)
+ # see 'lsort' man page about params
+ if b
+ tk_call(@path, 'sort', '-command', proc(&b), *params)
+ else
+ tk_call(@path, 'sort', *params)
+ end
+ self
+ end
+ def sort_ascending
+ tk_call(@path, 'sort', 'ascending')
+ self
+ end
+ def sort_descending
+ tk_call(@path, 'sort', 'descending')
+ self
+ end
+
+ #####################################
+
+ def bbox(index)
+ list(tk_send_without_enc('bbox', index))
+ end
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+ def get(*index)
+ _fromUTF8(tk_send_without_enc('get', *index))
+ end
+ def insert(index, *args)
+ tk_send('insert', index, *args)
+ self
+ end
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+ def see(index)
+ tk_send_without_enc('see', index)
+ self
+ end
+
+ #####################################
+
+ include TkListItemConfig
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::Itk::Component)
+ tag.name
+ else
+ super(tag)
+ end
+ end
+ private :tagid
+
+ #####################################
+
+ def activate(y)
+ tk_send_without_enc('activate', y)
+ self
+ end
+ def curselection
+ list(tk_send_without_enc('curselection'))
+ end
+ def get(first, last=nil)
+ if last
+ # tk_split_simplelist(_fromUTF8(tk_send_without_enc('get', first, last)))
+ tk_split_simplelist(tk_send_without_enc('get', first, last),
+ false, true)
+ else
+ _fromUTF8(tk_send_without_enc('get', first))
+ end
+ end
+ def nearest(y)
+ tk_send_without_enc('nearest', y).to_i
+ end
+ def size
+ tk_send_without_enc('size').to_i
+ end
+ def selection_anchor(index)
+ tk_send_without_enc('selection', 'anchor', index)
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', first, last)
+ self
+ end
+ def selection_includes(index)
+ bool(tk_send_without_enc('selection', 'includes', index))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', first, last)
+ self
+ end
+
+ def index(idx)
+ tk_send_without_enc('index', idx).to_i
+ end
+
+ #####################################
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
new file mode 100644
index 0000000000..69b7d314fd
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
@@ -0,0 +1,568 @@
+#
+# tkextlib/iwidgets/scrolledtext.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/text'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledtext < Tk::Iwidgets::Scrolledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledtext
+ TkCommandNames = ['::iwidgets::scrolledtext'.freeze].freeze
+ WidgetClassName = 'Scrolledtext'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ ################################
+
+ def initialize(*args)
+ super(*args)
+ @text = component_widget('text')
+ end
+
+ def method_missing(id, *args)
+ if @text.respond_to?(id)
+ @text.__send__(id, *args)
+ else
+ super(id, *args)
+ end
+ end
+
+ ################################
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def clear
+ tk_call(@path, 'clear')
+ self
+ end
+
+ def import(file, idx=nil)
+ if idx
+ tk_call(@path, 'import', file, index(idx))
+ else
+ tk_call(@path, 'import', file)
+ end
+ self
+ end
+
+ def export(file)
+ tk_call(@path, 'export', file)
+ self
+ end
+
+ #####################################
+
+ include TkTextTagConfig
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::Itk::Component)
+ tag.name
+ else
+ super(tag)
+ end
+ end
+ private :tagid
+
+ def bbox(index)
+ list(tk_send('bbox', index))
+ end
+ def compare(idx1, op, idx2)
+ bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1),
+ op, _get_eval_enc_str(idx2)))
+ end
+
+ def debug
+ bool(tk_send_without_enc('debug'))
+ end
+ def debug=(boolean)
+ tk_send_without_enc('debug', boolean)
+ #self
+ boolean
+ end
+
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+
+ def dlineinfo(index)
+ list(tk_send_without_enc('dlineinfo', _get_eval_enc_str(index)))
+ end
+
+ def get(*index)
+ _fromUTF8(tk_send_without_enc('get', *index))
+ end
+ def get_displaychars(*index)
+ # Tk8.5 feature
+ get('-displaychars', *index)
+ end
+
+ def image_cget_tkstring(index, slot)
+ _fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index), "-#{slot.to_s}"))
+ end
+ def image_cget_strict(index, slot)
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ _fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index), "-#{slot}"))
+ else
+ tk_tcl2ruby(_fromUTF8(tk_send_without_enc('image', 'cget',
+ _get_eval_enc_str(index),
+ "-#{slot}")))
+ end
+ end
+ def image_cget(index, slot)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ image_cget_strict(index, slot)
+ else
+ begin
+ image_cget_strict(index, slot)
+ rescue => e
+ begin
+ if current_image_configinfo.has_key?(slot.to_s)
+ # error on known option
+ fail e
+ else
+ # unknown option
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+
+ def image_configure(index, slot, value=None)
+ if slot.kind_of? Hash
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ *hash_kv(slot, true)))
+ else
+ _fromUTF8(tk_send_without_enc('image', 'configure',
+ _get_eval_enc_str(index),
+ "-#{slot}",
+ _get_eval_enc_str(value)))
+ end
+ self
+ end
+
+ def image_configinfo(index, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
+ else
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
+ end
+ conf[0] = conf[0][1..-1]
+ conf
+ else
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ conf[0] = conf[0][1..-1]
+ case conf[0]
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ case slot.to_s
+ when 'text', 'label', 'show', 'data', 'file'
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
+ else
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
+ end
+ key = conf.shift[1..-1]
+ { key => conf }
+ else
+ ret = {}
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
+ key = conf.shift[1..-1]
+ case key
+ when 'text', 'label', 'show', 'data', 'file'
+ else
+ if conf[2]
+ if conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ ret
+ end
+ end
+ end
+
+ def current_image_configinfo(index, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ conf = image_configinfo(index, slot)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ image_configinfo(index).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ image_configinfo(index, slot).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+
+ def image_names
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('image', 'names'), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def index(idx)
+ tk_send_without_enc('index', _get_eval_enc_str(idx))
+ end
+
+ def insert(index, *args)
+ tk_send('insert', index, *args)
+ self
+ end
+
+ def mark_names
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('mark', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('mark', 'names'), false, true).collect{|elt|
+ tagid2obj(elt)
+ }
+ end
+
+ def mark_gravity(mark, direction=nil)
+ if direction
+ tk_send_without_enc('mark', 'gravity',
+ _get_eval_enc_str(mark), direction)
+ self
+ else
+ tk_send_without_enc('mark', 'gravity', _get_eval_enc_str(mark))
+ end
+ end
+
+ def mark_set(mark, index)
+ tk_send_without_enc('mark', 'set', _get_eval_enc_str(mark),
+ _get_eval_enc_str(index))
+ self
+ end
+ alias set_mark mark_set
+
+ def mark_unset(*marks)
+ tk_send_without_enc('mark', 'unset',
+ *(marks.collect{|mark| _get_eval_enc_str(mark)}))
+ self
+ end
+ alias unset_mark mark_unset
+
+ def mark_next(index)
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'next',
+ _get_eval_enc_str(index))))
+ end
+ alias next_mark mark_next
+
+ def mark_previous(index)
+ tagid2obj(_fromUTF8(tk_send_without_enc('mark', 'previous',
+ _get_eval_enc_str(index))))
+ end
+ alias previous_mark mark_previous
+
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+
+
+ def _ktext_length(txt)
+ if TkCore::WITH_ENCODING ### Ruby 1.9 !!!!!!!!!!!!!
+ return txt.length
+ end
+ ###########################
+
+ if $KCODE !~ /n/i
+ return txt.gsub(/[^\Wa-zA-Z_\d]/, ' ').length
+ end
+
+ # $KCODE == 'NONE'
+ if JAPANIZED_TK
+ tk_call_without_enc('kstring', 'length',
+ _get_eval_enc_str(txt)).to_i
+ else
+ begin
+ tk_call_without_enc('encoding', 'convertto', 'ascii',
+ _get_eval_enc_str(txt)).length
+ rescue StandardError, NameError
+ # sorry, I have no plan
+ txt.length
+ end
+ end
+ end
+ private :_ktext_length
+
+ def tksearch(*args)
+ # call 'search' subcommand of text widget
+ # args ::= [<array_of_opts>] <pattern> <start_index> [<stop_index>]
+ # If <pattern> is regexp, then it must be a regular expression of Tcl
+ if args[0].kind_of?(Array)
+ opts = args.shift.collect{|opt| '-' + opt.to_s }
+ else
+ opts = []
+ end
+
+ opts << '--'
+
+ ret = tk_send('search', *(opts + args))
+ if ret == ""
+ nil
+ else
+ ret
+ end
+ end
+
+ def tksearch_with_count(*args)
+ # call 'search' subcommand of text widget
+ # args ::= [<array_of_opts>] <var> <pattern> <start_index> [<stop_index>]
+ # If <pattern> is regexp, then it must be a regular expression of Tcl
+ if args[0].kind_of?(Array)
+ opts = args.shift.collect{|opt| '-' + opt.to_s }
+ else
+ opts = []
+ end
+
+ opts << '-count' << args.shift << '--'
+
+ ret = tk_send('search', *(opts + args))
+ if ret == ""
+ nil
+ else
+ ret
+ end
+ end
+
+ def search_with_length(pat,start,stop=None)
+ pat = pat.chr if pat.kind_of? Integer
+ if stop != None
+ return ["", 0] if compare(start,'>=',stop)
+ txt = get(start,stop)
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index(start + " + #{pos} chars"), pat.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index(start + " + #{pos} chars"), $&.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ else
+ txt = get(start,'end - 1 char')
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index(start + " + #{pos} chars"), pat.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index(start + " + #{pos} chars"), $&.split('').length]
+ return [index(start + " + #{pos} chars"),
+ _ktext_length(match), match]
+ end
+ else
+ txt = get('1.0','end - 1 char')
+ if (pos = txt.index(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"),
+ _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ end
+ end
+ end
+
+ def search(pat,start,stop=None)
+ search_with_length(pat,start,stop)[0]
+ end
+
+ def rsearch_with_length(pat,start,stop=None)
+ pat = pat.chr if pat.kind_of? Integer
+ if stop != None
+ return ["", 0] if compare(start,'<=',stop)
+ txt = get(stop,start)
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index(stop + " + #{pos} chars"), pat.split('').length]
+ return [index(stop + " + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index(stop + " + #{pos} chars"), $&.split('').length]
+ return [index(stop + " + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ else
+ txt = get('1.0',start)
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ txt = get('1.0','end - 1 char')
+ if (pos = txt.rindex(pat))
+ match = $&
+ #pos = txt[0..(pos-1)].split('').length if pos > 0
+ pos = _ktext_length(txt[0..(pos-1)]) if pos > 0
+ if pat.kind_of? String
+ #return [index("1.0 + #{pos} chars"), pat.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup]
+ else
+ #return [index("1.0 + #{pos} chars"), $&.split('').length]
+ return [index("1.0 + #{pos} chars"), _ktext_length(match), match]
+ end
+ else
+ return ["", 0]
+ end
+ end
+ end
+ end
+
+ def rsearch(pat,start,stop=None)
+ rsearch_with_length(pat,start,stop)[0]
+ end
+
+ def see(index)
+ tk_send_without_enc('see', index)
+ self
+ end
+
+ ###############################
+
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+
+ def yview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('yview'))
+ else
+ tk_send_without_enc('yview', *index)
+ self
+ end
+ end
+ def yview_moveto(*index)
+ yview('moveto', *index)
+ end
+ def yview_scroll(*index)
+ yview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
new file mode 100644
index 0000000000..5ecd2d72d2
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb
@@ -0,0 +1,20 @@
+#
+# tkextlib/iwidgets/scrolledwidget.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Scrolledwidget < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Scrolledwidget
+ TkCommandNames = ['::iwidgets::scrolledwidget'.freeze].freeze
+ WidgetClassName = 'Scrolledwidget'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
new file mode 100644
index 0000000000..eb8fe3ad52
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb
@@ -0,0 +1,102 @@
+#
+# tkextlib/iwidgets/selectionbox.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Selectionbox < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Selectionbox
+ TkCommandNames = ['::iwidgets::selectionbox'.freeze].freeze
+ WidgetClassName = 'Selectionbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'itemson' << 'selectionon'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'itemslabel' << 'selectionlabel'
+ end
+ private :__strval_optkeys
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def clear_items
+ tk_call(@path, 'clear', 'items')
+ self
+ end
+
+ def clear_selection
+ tk_call(@path, 'clear', 'selection')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+
+ def insert_items(idx, *args)
+ tk_call(@path, 'insert', 'items', idx, *args)
+ end
+
+ def insert_selection(pos, text)
+ tk_call(@path, 'insert', 'selection', pos, text)
+ end
+
+ def select_item
+ tk_call(@path, 'selectitem')
+ self
+ end
+
+ # based on Tk::Listbox ( and TkTextWin )
+ def curselection
+ list(tk_send_without_enc('curselection'))
+ end
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+ def index(idx)
+ tk_send_without_enc('index', idx).to_i
+ end
+ def nearest(y)
+ tk_send_without_enc('nearest', y).to_i
+ end
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+ def selection_anchor(index)
+ tk_send_without_enc('selection', 'anchor', index)
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', first, last)
+ self
+ end
+ def selection_includes(index)
+ bool(tk_send_without_enc('selection', 'includes', index))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', first, last)
+ self
+ end
+ def size
+ tk_send_without_enc('size').to_i
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
new file mode 100644
index 0000000000..45aecf3266
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb
@@ -0,0 +1,92 @@
+#
+# tkextlib/iwidgets/selectiondialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Selectiondialog < Tk::Iwidgets::Dialog
+ end
+ end
+end
+
+class Tk::Iwidgets::Selectiondialog
+ TkCommandNames = ['::iwidgets::selectiondialog'.freeze].freeze
+ WidgetClassName = 'Selectiondialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def clear_items
+ tk_call(@path, 'clear', 'items')
+ self
+ end
+
+ def clear_selection
+ tk_call(@path, 'clear', 'selection')
+ self
+ end
+
+ def get
+ tk_call(@path, 'get')
+ end
+
+ def insert_items(idx, *args)
+ tk_call(@path, 'insert', 'items', idx, *args)
+ end
+
+ def insert_selection(pos, text)
+ tk_call(@path, 'insert', 'selection', pos, text)
+ end
+
+ def select_item
+ tk_call(@path, 'selectitem')
+ self
+ end
+
+ # based on Tk::Listbox ( and TkTextWin )
+ def curselection
+ list(tk_send_without_enc('curselection'))
+ end
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+ def index(idx)
+ tk_send_without_enc('index', idx).to_i
+ end
+ def nearest(y)
+ tk_send_without_enc('nearest', y).to_i
+ end
+ def scan_mark(x, y)
+ tk_send_without_enc('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send_without_enc('scan', 'dragto', x, y)
+ self
+ end
+ def selection_anchor(index)
+ tk_send_without_enc('selection', 'anchor', index)
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send_without_enc('selection', 'clear', first, last)
+ self
+ end
+ def selection_includes(index)
+ bool(tk_send_without_enc('selection', 'includes', index))
+ end
+ def selection_set(first, last=None)
+ tk_send_without_enc('selection', 'set', first, last)
+ self
+ end
+ def size
+ tk_send_without_enc('size').to_i
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/setup.rb b/ext/tk/lib/tkextlib/iwidgets/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/iwidgets/shell.rb b/ext/tk/lib/tkextlib/iwidgets/shell.rb
new file mode 100644
index 0000000000..c560e3ac29
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/shell.rb
@@ -0,0 +1,38 @@
+#
+# tkextlib/iwidgets/shell.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Shell < Tk::Itk::Toplevel
+ end
+ end
+end
+
+class Tk::Iwidgets::Shell
+ TkCommandNames = ['::iwidgets::shell'.freeze].freeze
+ WidgetClassName = 'Shell'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def activate
+ tk_call(@path, 'activate') # may return val of deactibate method
+ end
+
+ def center(win=None)
+ tk_call(@path, 'center', win)
+ self
+ end
+
+ def child_site
+ window(tk_call(@path, 'childsite'))
+ end
+
+ def deactivate(val=None)
+ tk_call(@path, 'deactivate', val)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/spindate.rb b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
new file mode 100644
index 0000000000..b3de9ed989
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/spindate.rb
@@ -0,0 +1,48 @@
+#
+# tkextlib/iwidgets/spindate.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Spindate < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Spindate
+ TkCommandNames = ['::iwidgets::spindate'.freeze].freeze
+ WidgetClassName = 'Spindate'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'dayon' << 'monthon' << 'yearon'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'daylabel' << 'monthformat' << 'monthlabel' << 'yearlabel'
+ end
+ private :__strval_optkeys
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def show(date=None)
+ tk_call(@path, 'show', date)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinint.rb b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
new file mode 100644
index 0000000000..bede3bb1bf
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/spinint.rb
@@ -0,0 +1,30 @@
+#
+# tkextlib/iwidgets/spinint.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Spinint < Tk::Iwidgets::Spinner
+ end
+ end
+end
+
+class Tk::Iwidgets::Spinint
+ TkCommandNames = ['::iwidgets::spinint'.freeze].freeze
+ WidgetClassName = 'Spinint'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'wrap'
+ end
+ private :__boolval_optkeys
+
+ def __numlistval_optkeys
+ super() << 'range'
+ end
+ private :__numlistval_optkeys
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/spinner.rb b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
new file mode 100644
index 0000000000..d960996e22
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/spinner.rb
@@ -0,0 +1,169 @@
+#
+# tkextlib/iwidgets/spinner.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Spinner < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Spinner
+ TkCommandNames = ['::iwidgets::spinner'.freeze].freeze
+ WidgetClassName = 'Spinner'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include Tk::ValidateConfigure
+
+ class EntryfieldValidate < TkValidateCommand
+ #class CalCmdArgs < TkUtil::CallbackSubst
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?s, :char ],
+ [ ?P, ?s, :post ],
+ [ ?S, ?s, :current ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+ end
+
+ def self._config_keys
+ ['validate', 'invalid']
+ end
+ end
+
+ def __validation_class_list
+ super() << EntryfieldValidate
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, EntryfieldValidate)
+
+ ####################################
+
+ def up
+ tk_call_without_enc(@path, 'up')
+ self
+ end
+
+ def down
+ tk_call_without_enc(@path, 'down')
+ self
+ end
+
+ def clear
+ tk_call_without_enc(@path, 'clear')
+ self
+ end
+
+ def delete(first, last=None)
+ tk_send_without_enc('delete', first, last)
+ self
+ end
+
+ def value
+ _fromUTF8(tk_send_without_enc('get'))
+ end
+ def value= (val)
+ tk_send_without_enc('delete', 0, 'end')
+ tk_send_without_enc('insert', 0, _get_eval_enc_str(val))
+ val
+ end
+ alias get value
+ alias set value=
+
+ def cursor=(index)
+ tk_send_without_enc('icursor', index)
+ #self
+ index
+ end
+ alias icursor cursor=
+
+ def index(idx)
+ number(tk_send_without_enc('index', idx))
+ end
+
+ def insert(pos,text)
+ tk_send_without_enc('insert', pos, _get_eval_enc_str(text))
+ self
+ end
+
+ def mark(pos)
+ tk_send_without_enc('scan', 'mark', pos)
+ self
+ end
+ def dragto(pos)
+ tk_send_without_enc('scan', 'dragto', pos)
+ self
+ end
+ def selection_adjust(index)
+ tk_send_without_enc('selection', 'adjust', index)
+ self
+ end
+ def selection_clear
+ tk_send_without_enc('selection', 'clear')
+ self
+ end
+ def selection_from(index)
+ tk_send_without_enc('selection', 'from', index)
+ self
+ end
+ def selection_present()
+ bool(tk_send_without_enc('selection', 'present'))
+ end
+ def selection_range(s, e)
+ tk_send_without_enc('selection', 'range', s, e)
+ self
+ end
+ def selection_to(index)
+ tk_send_without_enc('selection', 'to', index)
+ self
+ end
+
+ # based on tk/scrollable.rb
+ def xview(*index)
+ if index.size == 0
+ list(tk_send_without_enc('xview'))
+ else
+ tk_send_without_enc('xview', *index)
+ self
+ end
+ end
+ def xview_moveto(*index)
+ xview('moveto', *index)
+ end
+ def xview_scroll(*index)
+ xview('scroll', *index)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/spintime.rb b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
new file mode 100644
index 0000000000..20f8197a09
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/spintime.rb
@@ -0,0 +1,48 @@
+#
+# tkextlib/iwidgets/spintime.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Spintime < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Spintime
+ TkCommandNames = ['::iwidgets::spintime'.freeze].freeze
+ WidgetClassName = 'Spintime'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'houron' << 'militaryon' << 'minutelabel' << 'secondlabel'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'hourlabel' << 'minuteon' << 'secondon'
+ end
+ private :__strval_optkeys
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def show(date=None)
+ tk_call(@path, 'show', date)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
new file mode 100644
index 0000000000..f56efa9aaf
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb
@@ -0,0 +1,181 @@
+#
+# tkextlib/iwidgets/tabnotebook.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Tabnotebook < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Tabnotebook
+ TkCommandNames = ['::iwidgets::tabnotebook'.freeze].freeze
+ WidgetClassName = 'Tabnotebook'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'pagecget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'pageconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def __item_strval_optkeys(id)
+ super(id) << 'tabbackground' << 'tabforeground'
+ end
+ private :__item_strval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias pagecget_tkstring itemcget_tkstring
+ alias pagecget itemcget
+ alias pagecget_strict itemcget_strict
+ alias pageconfigure itemconfigure
+ alias pageconfiginfo itemconfiginfo
+ alias current_pageconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __boolval_optkeys
+ super() << 'auto' << 'equaltabs' << 'raiseselect' << 'tabborders'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'backdrop' << 'tabbackground' << 'tabforeground'
+ end
+ private :__strval_optkeys
+
+ def initialize(*args)
+ super(*args)
+ @tabset = self.component_widget('tabset')
+ end
+
+ def add(keys={})
+ window(tk_call(@path, 'add', *hash_kv(keys)))
+ end
+
+ def child_site_list
+ list(tk_call(@path, 'childsite'))
+ end
+
+ def child_site(idx)
+ window(tk_call(@path, 'childsite', index(idx)))
+ end
+
+ def delete(idx1, idx2=nil)
+ if idx2
+ tk_call(@path, 'delete', index(idx1), index(idx2))
+ else
+ tk_call(@path, 'delete', index(idx1))
+ end
+ self
+ end
+
+ def index(idx)
+ #number(tk_call(@path, 'index', tagid(idx)))
+ @tabset.index(tagid(idx))
+ end
+
+ def insert(idx, keys={})
+ window(tk_call(@path, 'insert', index(idx), *hash_kv(keys)))
+ end
+
+ def next
+ tk_call(@path, 'next')
+ self
+ end
+
+ def prev
+ tk_call(@path, 'prev')
+ self
+ end
+
+ def select(idx)
+ tk_call(@path, 'select', index(idx))
+ self
+ end
+
+ def show_tab(idx)
+ @tabset.show_tab(idx)
+ self
+ end
+
+ def scrollcommand(cmd=Proc.new)
+ configure_cmd 'scrollcommand', cmd
+ self
+ end
+ alias xscrollcommand scrollcommand
+ alias yscrollcommand scrollcommand
+
+ def xscrollbar(bar=nil)
+ if bar
+ @scrollbar = bar
+ @scrollbar.orient 'horizontal'
+ self.scrollcommand {|*arg| @scrollbar.set(*arg)}
+ @scrollbar.command {|*arg| self.xview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @scrollbar
+ end
+ def yscrollbar(bar=nil)
+ if bar
+ @scrollbar = bar
+ @scrollbar.orient 'vertical'
+ self.scrollcommand {|*arg| @scrollbar.set(*arg)}
+ @scrollbar.command {|*arg| self.yview(*arg)}
+ Tk.update # avoid scrollbar trouble
+ end
+ @scrollbar
+ end
+ alias scrollbar yscrollbar
+
+ def view(*index)
+ if index.size == 0
+ idx = num_or_str(tk_send_without_enc('view'))
+ if idx.kind_of?(Fixnum) && idx < 0
+ nil
+ else
+ idx
+ end
+ else
+ tk_send_without_enc('view', *index)
+ self
+ end
+ end
+ alias xview view
+ alias yview view
+
+ def view_moveto(*index)
+ view('moveto', *index)
+ end
+ alias xview_moveto view_moveto
+ alias yview_moveto view_moveto
+ def view_scroll(index, what='pages')
+ view('scroll', index, what)
+ end
+ alias xview_scroll view_scroll
+ alias yview_scroll view_scroll
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/tabset.rb b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
new file mode 100644
index 0000000000..501ead4964
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/tabset.rb
@@ -0,0 +1,145 @@
+#
+# tkextlib/iwidgets/tabset.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Tabset < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Tabset
+ TkCommandNames = ['::iwidgets::tabset'.freeze].freeze
+ WidgetClassName = 'Tabset'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'tabcget', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'tabconfigure', id]
+ end
+ private :__item_config_cmd
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ alias tabcget_tkstring itemcget_tkstring
+ alias tabcget itemcget
+ alias tabcget_strict itemcget_strict
+ alias tabconfigure itemconfigure
+ alias tabconfiginfo itemconfiginfo
+ alias current_tabconfiginfo current_itemconfiginfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ ####################################
+
+ def __boolval_optkeys
+ super() << 'equaltabs' << 'raiseselect' << 'tabborders'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'backdrop'
+ end
+ private :__strval_optkeys
+
+ def add(keys={})
+ window(tk_call(@path, 'add', *hash_kv(keys)))
+ end
+
+ def delete(idx1, idx2=nil)
+ if idx2
+ tk_call(@path, 'delete', index(idx1), index(idx2))
+ else
+ tk_call(@path, 'delete', index(idx1))
+ end
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, keys={})
+ window(tk_call(@path, 'insert', index(idx), *hash_kv(keys)))
+ end
+
+ def next
+ tk_call(@path, 'next')
+ self
+ end
+
+ def prev
+ tk_call(@path, 'prev')
+ self
+ end
+
+ def select(idx)
+ tk_call(@path, 'select', index(idx))
+ self
+ end
+
+ def show_tab(idx)
+ if index(idx) == 0
+ self.start = 0
+ return
+ end
+
+ reutrn unless @canvas ||= self.winfo_children[0]
+
+ delta = 1 if (delta = cget(:gap)) == 'overlap' ||
+ (delta = self.winfo_pixels(delta) + 1) <= 0
+
+ case cget(:tabpos)
+ when 's', 'n'
+ if (head = tabcget(idx, :left)) < 0
+ self.start -= head
+ return
+ end
+ tabs_size = @canvas.winfo_width
+ tab_start, tab_end = @canvas .
+ find_overlapping(head, 0, head + delta, @canvas.winfo_height) .
+ find_all{|id| @canvas.itemtype(id) == TkcPolygon} .
+ map!{|id| bbox = @canvas.bbox(id); [bbox[0], bbox[2]]} . max
+
+ when 'e', 'w'
+ if (head = tabcget(idx, :top)) < 0
+ self.start -= head
+ return
+ end
+ tabs_size = @canvas.winfo_height
+ tab_start, tab_end = @canvas .
+ find_overlapping(0, head, @canvas.winfo_width, head + delta) .
+ find_all{|id| @canvas.itemtype(id) == TkcPolygon} .
+ map!{|id| bbox = @canvas.bbox(id); [bbox[1], bbox[3]]} . max
+ end
+
+ if (size = tab_end - tab_start + 1) > tabs_size
+ self.start -= tab_start
+ elsif head + size > tabs_size
+ self.start -= head + size - tabs_size
+ end
+
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/timeentry.rb b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
new file mode 100644
index 0000000000..b0afb3afd9
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/timeentry.rb
@@ -0,0 +1,25 @@
+#
+# tkextlib/iwidgets/timeentry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Timeentry < Tk::Iwidgets::Timefield
+ end
+ end
+end
+
+class Tk::Iwidgets::Timeentry
+ TkCommandNames = ['::iwidgets::timeentry'.freeze].freeze
+ WidgetClassName = 'Timeentry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __strval_optkeys
+ super() << 'closetext'
+ end
+ private :__strval_optkeys
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/timefield.rb b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
new file mode 100644
index 0000000000..c34281d4ff
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
@@ -0,0 +1,58 @@
+#
+# tkextlib/iwidgets/timefield.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Timefield < Tk::Iwidgets::Labeledwidget
+ end
+ end
+end
+
+class Tk::Iwidgets::Timefield
+ TkCommandNames = ['::iwidgets::timefield'.freeze].freeze
+ WidgetClassName = 'Timefield'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'gmt'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'textbackground'
+ end
+ private :__strval_optkeys
+
+ def __font_optkeys
+ super() << 'textfont'
+ end
+ private :__font_optkeys
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def valid?
+ bool(tk_call(@path, 'isvalid'))
+ end
+ alias isvalid? valid?
+
+ def show(time=None)
+ tk_call(@path, 'show', time)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/toolbar.rb b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
new file mode 100644
index 0000000000..5b474c3816
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/toolbar.rb
@@ -0,0 +1,112 @@
+#
+# tkextlib/iwidgets/toolbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Toolbar < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Toolbar
+ TkCommandNames = ['::iwidgets::toolbar'.freeze].freeze
+ WidgetClassName = 'Toolbar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __tkvariable_optkeys
+ super() << 'helpvariable'
+ end
+ private :__tkvariable_optkeys
+
+ ####################################
+
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'itemcget', self.index(id)]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'itemconfigure', self.index(id)]
+ end
+ private :__item_config_cmd
+
+ def __item_strval_optkeys(id)
+ super(id) << 'helpstr' << 'balloonstr'
+ end
+ private :__item_strval_optkeys
+
+ def tagid(tagOrId)
+ if tagOrId.kind_of?(Tk::Itk::Component)
+ tagOrId.name
+ else
+ #_get_eval_string(tagOrId)
+ tagOrId
+ end
+ end
+
+ ####################################
+
+ def __strval_optkeys
+ super() << 'balloonbackground' << 'balloonforeground'
+ end
+ private :__strval_optkeys
+
+ def __tkvariable_optkeys
+ super() << 'helpvariable'
+ end
+ private :__tkvariable_optkeys
+
+ def __font_optkeys
+ super() << 'balloonfont'
+ end
+ private :__font_optkeys
+
+ def add(type, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ window(tk_call(@path, 'add', type, tagid(tag), *hash_kv(keys)))
+ tag
+ end
+
+ def delete(idx1, idx2=nil)
+ if idx2
+ tk_call(@path, 'delete', index(idx1), index(idx2))
+ else
+ tk_call(@path, 'delete', index(idx1))
+ end
+ self
+ end
+
+ def index(idx)
+ number(tk_call(@path, 'index', tagid(idx)))
+ end
+
+ def insert(idx, type, tag=nil, keys={})
+ if tag.kind_of?(Hash)
+ keys = tag
+ tag = nil
+ end
+ if tag
+ tag = Tk::Itk::Component.new(self, tagid(tag))
+ else
+ tag = Tk::Itk::Component.new(self)
+ end
+ window(tk_call(@path, 'insert', index(idx), type,
+ tagid(tag), *hash_kv(keys)))
+ tag
+ end
+end
diff --git a/ext/tk/lib/tkextlib/iwidgets/watch.rb b/ext/tk/lib/tkextlib/iwidgets/watch.rb
new file mode 100644
index 0000000000..f10ec54cb2
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/watch.rb
@@ -0,0 +1,56 @@
+#
+# tkextlib/iwidgets/watch.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tkextlib/iwidgets.rb'
+
+module Tk
+ module Iwidgets
+ class Watch < Tk::Itk::Widget
+ end
+ end
+end
+
+class Tk::Iwidgets::Watch
+ TkCommandNames = ['::iwidgets::watch'.freeze].freeze
+ WidgetClassName = 'Watch'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'showampm'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'clockcolor' << 'hourcolor' << 'minutecolor' <<
+ 'pivotcolor' << 'secondcolor' << 'tickcolor'
+ end
+ private :__strval_optkeys
+
+ def get_string
+ tk_call(@path, 'get', '-string')
+ end
+ alias get get_string
+
+ def get_clicks
+ number(tk_call(@path, 'get', '-clicks'))
+ end
+
+ def show(time=None)
+ tk_call(@path, 'show', time)
+ self
+ end
+ def show_now
+ tk_call(@path, 'show', 'now')
+ self
+ end
+
+ def watch(*args)
+ unless args.empty?
+ tk_call(@path, 'watch', *args)
+ end
+ component_path('canvas')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/pkg_checker.rb b/ext/tk/lib/tkextlib/pkg_checker.rb
new file mode 100755
index 0000000000..e2fd97bb6a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/pkg_checker.rb
@@ -0,0 +1,184 @@
+#!/usr/bin/env ruby
+#
+# Ruby/Tk extension library checker
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+TkRoot.new.withdraw # hide root window
+
+name = File.basename(__FILE__)
+
+add_path = false
+verbose = false
+
+def help_msg
+ print "Usage: #{$0} [-l] [-v] [-h] [--] [dir]\n"
+ print "\tIf dir is omitted, check the directory that this command exists.\n"
+ print "\tAvailable options are \n"
+ print "\t -l : Add dir to $LOAD_PATH\n"
+ print "\t (If dir == '<parent>/tkextlib', add <parent> also.)\n"
+ print "\t -v : Verbose mode (show reason of fail)\n"
+ print "\t -h : Show this message\n"
+ print "\t -- : End of options\n"
+end
+
+while(ARGV[0] && ARGV[0][0] == ?-)
+ case ARGV[0]
+ when '--'
+ ARGV.shift
+ break;
+ when '-l'
+ ARGV.shift
+ add_path = true
+ when '-v'
+ ARGV.shift
+ verbose = true
+ when '-h'
+ help_msg
+ exit(0)
+ else
+ print "Argument Error!! : unknown option '#{ARGV[0]}'\n"
+ help_msg
+ exit(1)
+ end
+end
+
+if ARGV[0]
+ dir = File.expand_path(ARGV[0])
+else
+ dir = File.dirname(File.expand_path(__FILE__))
+end
+
+if add_path
+ $LOAD_PATH.unshift(dir)
+ if File.basename(dir) == 'tkextlib'
+ $LOAD_PATH.unshift(File.dirname(dir))
+ end
+end
+
+print "\nRuby/Tk extension library checker\n"
+print "( Note:: This check is very simple one. Shown status may be wrong. )\n"
+print "\n check directory :: #{dir}"
+print "\n $LOAD_PATH :: #{$LOAD_PATH.inspect}\n"
+
+def get_pkg_list(file)
+ pkg_list = []
+
+ File.foreach(file){|l|
+ if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)TkPackage\s*\.\s*require\s*\(?\s*(["'])((\w|:)+)\1/
+ pkg = [$2, :package]
+ pkg_list << pkg unless pkg_list.member?(pkg)
+ end
+ if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)Tk\s*\.\s*load_tcllibrary\s*\(?\s*(["'])((\w|:)+)\1/
+ pkg = [$2, :library]
+ pkg_list << pkg unless pkg_list.member?(pkg)
+ end
+ if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)Tk\s*\.\s*load_tclscript\s*\(?\s*(["'])((\w|:)+)\1/
+ pkg = [$2, :script]
+ pkg_list << pkg unless pkg_list.member?(pkg)
+ end
+ if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)require\s*\(?\s*(["'])((\w|\/|:)+)\1/
+ pkg = [$2, :require_ruby_lib]
+ pkg_list << pkg unless pkg_list.member?(pkg)
+ end
+ }
+
+ pkg_list
+end
+
+def check_pkg(file, verbose=false)
+ pkg_list = get_pkg_list(file)
+
+ error_list = []
+ success_list = {}
+
+ pkg_list.each{|name, type|
+ next if success_list[name]
+
+ begin
+ case type
+ when :package
+ ver = TkPackage.require(name)
+ success_list[name] = ver
+ error_list.delete_if{|n, t| n == name}
+
+ when :library
+ Tk.load_tcllibrary(name)
+ success_list[name] = :library
+ error_list.delete_if{|n, t| n == name}
+
+ when :script
+ Tk.load_tclscript(name)
+ success_list[name] = :script
+ error_list.delete_if{|n, t| n == name}
+
+ when :require_ruby_lib
+ require name
+
+ end
+ rescue => e
+ if verbose
+ error_list << [name, type, e.message]
+ else
+ error_list << [name, type]
+ end
+ end
+ }
+
+ success_list.dup.each{|name, ver|
+ unless ver.kind_of?(String)
+ begin
+ ver = TkPackage.require(name)
+ sccess_list[name] = ver
+ rescue
+ end
+ end
+ }
+
+ [success_list, error_list]
+end
+
+def subdir_check(dir, verbose=false)
+ Dir.foreach(dir){|f|
+ next if f == '.' || f == '..'
+ if File.directory?(f)
+ subdir_check(File.join(dir, f))
+ elsif File.extname(f) == '.rb'
+ path = File.join(dir, f)
+ suc, err = check_pkg(path, verbose)
+ if err.empty?
+ print 'Ready : ', path, ' : require->', suc.inspect, "\n"
+ else
+ print '*LACK : ', path, ' : require->', suc.inspect,
+ ' FAIL->', err.inspect, "\n"
+ end
+ end
+ }
+end
+
+Dir.chdir(dir)
+
+(Dir['*.rb'] - ['setup.rb', name]).each{|f|
+ subdir = File.basename(f, '.*')
+=begin
+ begin
+ # read 'setup.rb' as if the library has standard structure
+ require File.join(subdir, 'setup.rb')
+ rescue LoadError
+ # ignore error
+ end
+=end
+ print "\n"
+
+ suc, err = check_pkg(f, verbose)
+ if err.empty?
+ print 'Ready : ', f, ' : require->', suc.inspect, "\n"
+ else
+ print '*LACK : ', f, ' : require->', suc.inspect,
+ ' FAIL->', err.inspect, "\n"
+ end
+
+ subdir_check(subdir, verbose) if File.directory?(subdir)
+}
diff --git a/ext/tk/lib/tkextlib/setup.rb b/ext/tk/lib/tkextlib/setup.rb
new file mode 100644
index 0000000000..79facc5ee3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before using Tk extension libraries
+#
+# If you need some setup operations for Tk extensions (for example,
+# modify the dynamic library path) required, please write the setup
+# operations in this file. This file is required at the last of
+# "require 'tk'".
+#
diff --git a/ext/tk/lib/tkextlib/tcllib.rb b/ext/tk/lib/tkextlib/tcllib.rb
new file mode 100644
index 0000000000..2831989759
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib.rb
@@ -0,0 +1,105 @@
+#
+# tcllib extension support
+# 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/tcllib/setup.rb'
+
+err = ''
+
+# package:: autoscroll
+target = 'tkextlib/tcllib/autoscroll'
+begin
+ require target
+rescue => e
+ err << "\n ['" << target << "'] " << e.class.name << ' : ' << e.message
+end
+
+# package:: cursor
+target = 'tkextlib/tcllib/cursor'
+begin
+ require target
+rescue => e
+ err << "\n ['" << target << "'] " << e.class.name << ' : ' << e.message
+end
+
+# package:: style
+target = 'tkextlib/tcllib/style'
+begin
+ require target
+rescue => e
+ err << "\n ['" << target << "'] " << e.class.name << ' : ' << e.message
+end
+
+# autoload
+module Tk
+ module Tcllib
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+
+ # package:: autoscroll
+ autoload :Autoscroll, 'tkextlib/tcllib/autoscroll'
+
+ # package:: ctext
+ autoload :CText, 'tkextlib/tcllib/ctext'
+
+ # package:: cursor
+ autoload :Cursor, 'tkextlib/tcllib/cursor'
+
+ # package:: datefield
+ autoload :Datefield, 'tkextlib/tcllib/datefield'
+ autoload :DateField, 'tkextlib/tcllib/datefield'
+
+ # package:: getstring
+ autoload :GetString_Dialog, 'tkextlib/tcllib/getstring'
+
+ # package:: history
+ autoload :History, 'tkextlib/tcllib/history'
+
+ # package:: ico
+ autoload :ICO, 'tkextlib/tcllib/ico'
+
+ # package:: ipentry
+ autoload :IP_Entry, 'tkextlib/tcllib/ip_entry'
+ autoload :IPEntry, 'tkextlib/tcllib/ip_entry'
+
+ # package:: khim
+ autoload :KHIM, 'tkextlib/tcllib/khim'
+
+ # package:: ntext
+ autoload :Ntext, 'tkextlib/tcllib/ntext'
+
+ # package:: Plotchart
+ autoload :Plotchart, 'tkextlib/tcllib/plotchart'
+
+ # package:: style
+ autoload :Style, 'tkextlib/tcllib/style'
+
+ # package:: swaplist
+ autoload :Swaplist_Dialog, 'tkextlib/tcllib/swaplist'
+
+ # package:: tablelist
+ autoload :Tablelist, 'tkextlib/tcllib/tablelist'
+ autoload :TableList, 'tkextlib/tcllib/tablelist'
+ autoload :Tablelist_Tile, 'tkextlib/tcllib/tablelist_tile'
+ autoload :TableList_Tile, 'tkextlib/tcllib/tablelist_tile'
+
+ # package:: tkpiechart
+ autoload :Tkpiechart, 'tkextlib/tcllib/tkpiechart'
+
+ # package:: tooltip
+ autoload :Tooltip, 'tkextlib/tcllib/tooltip'
+
+ # package:: widget
+ autoload :Widget, 'tkextlib/tcllib/widget'
+ end
+end
+
+if $VERBOSE && !err.empty?
+ warn("Warning: some sub-packages are failed to require : " + err)
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/README b/ext/tk/lib/tkextlib/tcllib/README
new file mode 100644
index 0000000000..441918adce
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/README
@@ -0,0 +1,135 @@
+
+ [ tcllib extension support files ]
+
+Tcllib includes many utilities. But currently, supports TKLib part
+only (see the following 'tcllib contents').
+
+If you request to support others, please send your message to one of
+ruby-talk/ruby-list/ruby-dev/ruby-ext mailing lists.
+
+-----<from "What is tcllib?">----------------------------
+Tcllib is a collection of utility modules for Tcl. These modules provide
+a wide variety of functionality, from implementations of standard data
+structures to implementations of common networking protocols. The intent
+is to collect commonly used function into a single library, which users
+can rely on to be available and stable.
+---------------------------------------------------------
+
+-----< tcllib contents (based on tcllib-1.6.1) >---------
+Programming tools
+ * cmdline - Procedures to process command lines and options.
+ * comm - A remote communications facility for Tcl (7.6, 8.0, and later)
+ * control - Procedures for control flow structures.
+ * fileutil - Procedures implementing some file utilities
+ * log - Procedures to log messages of libraries and applications.
+ * logger - System to control logging of events.
+ * multiplexer - One-to-many communication with sockets.
+ * snit - Snit's Not Incr Tcl
+ * snitfaq - Snit Frequently Asked Questions
+ * stooop - Object oriented extension.
+ * stoop - Simple Tcl Only Object Oriented Programming
+ * switched - stooop switched class
+ * profiler - Tcl source code profiler
+
+Mathematics
+ * math::statistics - Basic statistical functions and procedures
+ * math::calculus - Integration and ordinary differential equations
+ * math::optimize - Optimisation routines
+ * math::fuzzy - Fuzzy comparison of floating-point numbers
+ * counter - Procedures for counters and histograms
+ * combinatorics - Combinatorial functions in the Tcl Math Library
+
+Data structures
+ * struct::list - Procedures for manipulating lists
+ * struct::set - Procedures for manipulating sets
+ * struct::stack - Create and manipulate stack objects
+ * struct::queue - Create and manipulate queue objects
+ * struct::prioqueue - Create and manipulate prioqueue objects
+ * struct::skiplist - Create and manipulate skiplists
+ * struct::tree - Create and manipulate tree objects
+ * struct::graph - Create and manipulate directed graph objects
+ * struct::record - Define and create records (similar to 'C' structures)
+ * struct::matrix - Create and manipulate matrix objects
+ * struct::pool - Create and manipulate pool objects (of discrete items)
+ * report - Create and manipulate report objects
+
+Text processing
+ * expander - Procedures to process templates and expand text.
+ * base64 - Procedures to encode and decode base64
+ * yencode - encode/decoding a binary file
+ * uuencode - encode/decoding a binary file
+ * csv - Procedures to handle CSV data.
+ * inifile - Parsing of Windows INI files
+ * htmlparse - Procedures to parse HTML strings
+ * mime - Manipulation of MIME body parts
+ * Tcl MIME - generates and parses MIME body parts
+ * textutil - Procedures to manipulate texts and strings.
+ * exif - Tcl EXIF extracts and parses EXIF fields from digital images
+ * EXIF - extract and parse EXIF fields from digital images
+
+Hashes, checksums, and encryption
+ * cksum - calculate a cksum(1) compatible checksum
+ * crc16 - Perform a 16bit Cyclic Redundancy Check
+ * crc32 - Perform a 32bit Cyclic Redundancy Check
+ * des - Perform DES encryption of Tcl data
+ * md4 - MD4 Message-Digest Algorithm
+ * md5 - MD5 Message-Digest Algorithm
+ * ripemd160 - RIPEMD-160 Message-Digest Algorithm
+ * ripemd128 - RIPEMD-128 Message-Digest Algorithm
+ * md5crypt - MD5-based password encryption
+ * sha1 - Perform sha1 hashing
+ * sum - calculate a sum(1) compatible checksum
+ * soundex - Soundex
+
+Documentation tools
+ * mpexpand - Markup processor
+ * doctools - Create and manipulate doctools converter object
+ * doctoc_fmt - Specification of simple tcl markup for table of contents
+ * doctools_api - Interface specification for formatter code
+ * doctools_fmt - Specification of simple tcl markup for manpages
+ * docidx - Create and manipulate docidx converter objects
+ * docidx_api - Interface specification for index formatting code
+ * docidx_fmt - Specification of simple tcl markup for an index
+ * doctoc - Create and manipulate doctoc converter objects
+ * doctoc_api - Interface specification for toc formatting code
+ * doctools::changelog - Handle text in Emacs ChangeLog format
+ * doctools::cvs - Handle text in 'cvs log' format
+
+Networking
+ * uri - URI utilities
+ * dns - Tcl Domain Name Service Client
+ * ntp_time - Tcl Time Service Client
+ * nntp - Tcl client for the NNTP protocol
+ * pop3 - Tcl client for POP3 email protocol
+ * pop3d - Tcl POP3 server implementation
+ * pop3d::udb - Simple user database for pop3d
+ * pop3d::dbox - Simple mailbox database for pop3d
+ * ftp - Client-side tcl implementation of the ftp protocol
+ * ftp - Client-side tcl implementation of the ftp protocol
+ * ftpd - Tcl FTP server implementation
+ * smtp - Client-side tcl implementation of the smtp protocol
+ * smtpd - Tcl SMTP server implementation
+ * irc - Create IRC connection and interface.
+
+CGI programming
+ * ncgi - Procedures to manipulate CGI values.
+ * html - Procedures to generate HTML structures
+ * javascript - Procedures to generate HTML and Java Script structures.
+
+Grammars and finite automata
+ * grammar::fa - Create and manipulate finite automatons
+ * grammar::fa::op - Operations on finite automatons
+ * grammar::dacceptor - Create and use deterministic acceptors
+ * grammar::dexec - Execute deterministic finite automatons
+
+TKLib
+ * Plotchart - Simple plotting and charting package
+ * autoscroll - Provides for a scrollbar to automatically mapped and
+ unmapped as needed
+ * ctext - An extended text widget with customizable Syntax highlighting
+ * cursor - Procedures to handle CURSOR data
+ * datefield - Tk datefield widget
+ * style - Changes default Tk look&feel
+ * ipentry - An IP address entry widget
+ * tkpiechart - Creates and dynamically updates 2D or 3D pie charts
+---------------------------------------------------------
diff --git a/ext/tk/lib/tkextlib/tcllib/autoscroll.rb b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
new file mode 100644
index 0000000000..2def59bf73
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/autoscroll.rb
@@ -0,0 +1,158 @@
+#
+# tkextlib/tcllib/autoscroll.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Provides for a scrollbar to automatically mapped and unmapped as needed
+#
+# (The following is the original description of the library.)
+#
+# This package allows scrollbars to be mapped and unmapped as needed
+# depending on the size and content of the scrollbars scrolled widget.
+# The scrollbar must be managed by either pack or grid, other geometry
+# managers are not supported.
+#
+# When managed by pack, any geometry changes made in the scrollbars parent
+# between the time a scrollbar is unmapped, and when it is mapped will be
+# lost. It is an error to destroy any of the scrollbars siblings while the
+# scrollbar is unmapped. When managed by grid, if anything becomes gridded
+# in the same row and column the scrollbar occupied it will be replaced by
+# the scrollbar when remapped.
+#
+# This package may be used on any scrollbar-like widget as long as it
+# supports the set subcommand in the same style as scrollbar. If the set
+# subcommand is not used then this package will have no effect.
+#
+
+require 'tk'
+require 'tk/scrollbar'
+require 'tkextlib/tcllib.rb'
+
+module Tk
+ module Tcllib
+ module Autoscroll
+ PACKAGE_NAME = 'autoscroll'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('autoscroll')
+ rescue
+ ''
+ end
+ end
+
+ def self.not_available
+ fail RuntimeError, "'tkextlib/tcllib/autoscroll' extension is not available on your current environment."
+ end
+
+ def self.autoscroll(win)
+ Tk::Tcllib::Autoscroll.not_available
+ end
+
+ def self.unautoscroll(win)
+ Tk::Tcllib::Autoscroll.not_available
+ end
+ end
+ end
+end
+
+module Tk
+ module Scrollable
+ def autoscroll(mode = nil)
+ case mode
+ when :x, 'x'
+ if @xscrollbar
+ Tk::Tcllib::Autoscroll.autoscroll(@xscrollbar)
+ end
+ when :y, 'y'
+ if @yscrollbar
+ Tk::Tcllib::Autoscroll.autoscroll(@yscrollbar)
+ end
+ when nil, :both, 'both'
+ if @xscrollbar
+ Tk::Tcllib::Autoscroll.autoscroll(@xscrollbar)
+ end
+ if @yscrollbar
+ Tk::Tcllib::Autoscroll.autoscroll(@yscrollbar)
+ end
+ else
+ fail ArgumentError, "'x', 'y' or 'both' (String or Symbol) is expected"
+ end
+ self
+ end
+ def unautoscroll(mode = nil)
+ case mode
+ when :x, 'x'
+ if @xscrollbar
+ Tk::Tcllib::Autoscroll.unautoscroll(@xscrollbar)
+ end
+ when :y, 'y'
+ if @yscrollbar
+ Tk::Tcllib::Autoscroll.unautoscroll(@yscrollbar)
+ end
+ when nil, :both, 'both'
+ if @xscrollbar
+ Tk::Tcllib::Autoscroll.unautoscroll(@xscrollbar)
+ end
+ if @yscrollbar
+ Tk::Tcllib::Autoscroll.unautoscroll(@yscrollbar)
+ end
+ else
+ fail ArgumentError, "'x', 'y' or 'both' (String or Symbol) is expected"
+ end
+ self
+ end
+ end
+end
+
+class Tk::Scrollbar
+ def autoscroll
+ # Arranges for the already existing scrollbar to be mapped
+ # and unmapped as needed.
+ #tk_call_without_enc('::autoscroll::autoscroll', @path)
+ Tk::Tcllib::Autoscroll.autoscroll(self)
+ self
+ end
+ def unautoscroll
+ # Returns the scrollbar to its original static state.
+ #tk_call_without_enc('::autoscroll::unautoscroll', @path)
+ Tk::Tcllib::Autoscroll.unautoscroll(self)
+ self
+ end
+end
+
+# TkPackage.require('autoscroll', '1.0')
+# TkPackage.require('autoscroll', '1.1')
+TkPackage.require('autoscroll')
+
+module Tk
+ module Tcllib
+ class << Autoscroll
+ undef not_available
+ end
+
+ module Autoscroll
+ extend TkCore
+ def self.autoscroll(win)
+ tk_call_without_enc('::autoscroll::autoscroll', win.path)
+ end
+
+ def self.unautoscroll(win)
+ tk_call_without_enc('::autoscroll::unautoscroll', win.path)
+ end
+
+ def self.wrap
+ # v1.1
+ tk_call_without_enc('::autoscroll::wrap')
+ end
+
+ def self.unwrap
+ # v1.1
+ tk_call_without_enc('::autoscroll::unwrap')
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/calendar.rb b/ext/tk/lib/tkextlib/tcllib/calendar.rb
new file mode 100644
index 0000000000..b6843df176
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/calendar.rb
@@ -0,0 +1,55 @@
+#
+# tkextlib/tcllib/calendar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * calendar widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::calendar', '0.9')
+TkPackage.require('widget::calendar')
+
+module Tk::Tcllib
+ module Widget
+ class Calendar < TkCanvas
+ PACKAGE_NAME = 'widget::calendar'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::calendar')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::Widget::Calendar
+ TkCommandNames = ['::widget::calendar'.freeze].freeze
+
+ def __boolval_optkeys
+ super() << 'showpast'
+ end
+ private :__boolval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def get(what = 'all')
+ tk_send('get', what)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
new file mode 100644
index 0000000000..ba87cd3aae
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb
@@ -0,0 +1,36 @@
+#
+# tkextlib/tcllib/canvas.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# *
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::canvas_sqmap', '0.2')
+TkPackage.require('widget::canvas_sqmap')
+
+module Tk::Tcllib
+ module Widget
+ class Canvas_Sqmap < Canvas
+ TkCommandNames = ['::widget::canvas_sqmap'.freeze].freeze
+
+ def image_set(cell, img)
+ tk_send('image', 'set', cell, img)
+ self
+ end
+
+ def image_unset(cell)
+ tk_send('image', 'unset', cell)
+ self
+ end
+
+ def flush
+ tk_send('flush')
+ self
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
new file mode 100644
index 0000000000..f4ffb48ece
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb
@@ -0,0 +1,21 @@
+#
+# tkextlib/tcllib/canvas.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# *
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::canvas_zoom', '0.1')
+TkPackage.require('widget::canvas_zoom')
+
+module Tk::Tcllib
+ module Widget
+ class Canvas_Zoom < Canvas
+ TkCommandNames = ['::widget::canvas_zoom'.freeze].freeze
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
new file mode 100644
index 0000000000..ddb0340c31
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb
@@ -0,0 +1,151 @@
+#
+# tkextlib/tcllib/chatwidget.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * chatwidget - Provides a multi-paned view suitable for display of
+# chat room or irc channel information
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('chatwidget', '1.1.0')
+TkPackage.require('chatwidget')
+
+module Tk::Tcllib
+ class ChatWidget < TkText
+ PACKAGE_NAME = 'chatwidget'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('chatwidget')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::ChatWidget
+ TkCommandNames = ['::chatwidget::chatwidget'.freeze].freeze
+
+ def show_topic
+ tk_send_without_enc('topic', 'show')
+ self
+ end
+
+ def hide_topic
+ tk_send_without_enc('topic', 'hide')
+ self
+ end
+
+ def set_topic(topic)
+ tk_send('topic', 'set', topic)
+ end
+
+ def list_name
+ tk_split_simplelist(tk_send('name', 'list'))
+ end
+
+ def list_name_full
+ tk_split_simplelist(tk_send('name', 'list')).map{|lst|
+ nick, *opts = tk_split_simplelist(lst)
+ h_opt = {}
+ opts.slice(2){|k, v| h_opt[k[1..-1]] = tk_tcl2ruby(v)}
+ [nick, h_opt]
+ }
+ end
+
+ def add_name(nick, opts={})
+ tk_send('name', 'add', nick, *(hash_kv(opts)))
+ end
+
+ def delete_name(nick)
+ tk_send('name', 'delete', nick)
+ end
+
+ def get_name(nick)
+ lst = tk_send('name', 'get', nick)
+ return nil if lst.empty?
+ nick, *opts = tk_split_simplelist(lst)
+ h_opt = {}
+ opts.slice(2){|k, v| h_opt[k[1..-1]] = tk_tcl2ruby(v)}
+ [nick, h_opt]
+ end
+
+ def message(msg, opts={})
+ tk_send('message', msg, *(hash_kv(opts)))
+ self
+ end
+
+ def _parse_hook_list(lst)
+ tk_split_simplelist(lst).map{|hook|
+ cmd, prior = tk_split_simplelist(hook)
+ [procedure(cmd), number(prior)]
+ }
+ end
+ private :_parse_hook_list
+
+ def hook_add(type, *args, &blk) # args -> [prior, cmd], [prior], [cmd]
+ #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url'
+
+ if prior = args.shift
+ if !prior.kind_of?(Numeric)
+ cmd = prior
+ if (prior = args.shift) && !prior.kind_of?(Numeric) # error
+ args.unshift(prior)
+ end
+ args.unshift(cmd)
+ end
+ prior ||= 50 # default priority
+ end
+
+ cmd = args.shift || blk
+
+ fail ArgumentError, "invalid arguments" unless args.empty?
+ fail ArgumentError, "no callback is given" unless cmd
+
+ _parse_hook_list(tk_send('hook', 'add', type, cmd, prior))
+ end
+
+ def hook_remove(type, cmd)
+ #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url'
+ _parse_hook_list(tk_send('hook', 'remove', type, cmd))
+ end
+
+ def hook_run(type, *cmd_args)
+ #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url'
+ tk_send('hook', 'run', type, *cmd_args)
+ end
+
+ def hook_list(type)
+ #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url'
+ _parse_hook_list(tk_send('hook', 'list', type))
+ end
+
+ def show_names
+ tk_send('names', 'show')
+ self
+ end
+
+ def hide_names
+ tk_send('names', 'hide')
+ self
+ end
+
+ def names_widget
+ window(tk_send('names'))
+ end
+
+ def entry_widget
+ window(tk_send('entry'))
+ end
+
+ def chat_widget
+ window(tk_send('chat'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/crosshair.rb b/ext/tk/lib/tkextlib/tcllib/crosshair.rb
new file mode 100644
index 0000000000..49b5361e4f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/crosshair.rb
@@ -0,0 +1,117 @@
+#
+# tkextlib/tcllib/crosshair.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Crosshairs for Tk canvas
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('crosshair', '1.0.2')
+TkPackage.require('crosshair')
+
+module Tk::Tcllib
+ module Crosshair
+ PACKAGE_NAME = 'crosshair'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('crosshair')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::Crosshair
+ include TkCore
+ TkCommandNames = ['::crosshair::crosshair'.freeze].freeze
+
+ def self.crosshair(w, keys={})
+ Tk.tk_call('::crosshair::crosshair', w, *hash_kv(keys))
+ w
+ end
+ def self.on(w, keys={})
+ self.crosshair(w, keys)
+ end
+
+ def self.off(w)
+ Tk.tk_call('::crosshair::off', w)
+ w
+ end
+
+ def self.track_on(w, &b)
+ Tk.tk_call('::crosshair::track_on', w, b)
+ w
+ end
+
+ def self.track_off(w)
+ Tk.tk_call('::crosshair::track_off', w)
+ w
+ end
+end
+
+class << Tk::Tcllib::Crosshair
+ include TkComm
+ include TkCanvasItemConfig
+
+ def __item_methodcall_optkeys(id)
+ {}
+ end
+ private :__item_methodcall_optkeys
+
+ def __item_config_cmd(id)
+ # maybe need to override
+ ['::crosshair::configure', id]
+ end
+ private :__item_config_cmd
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+
+ def confugure(w, slot, value=None)
+ itemconfigure(w, slot, value)
+ end
+ def confuginfo(w, slot = nil)
+ itemconfiginfo(w, slot)
+ end
+ def current_configinfo(w, slot = nil)
+ current_itemconfiginfo(w, slot)
+ end
+ def cget(w, slot)
+ current_itemconfiginfo(w, slot).values[0]
+ end
+end
+
+module Tk::Tcllib::Crosshair
+ def crosshair_on(keys={})
+ Tk::Tcllib::Crosshair.on(self, keys)
+ end
+ def crosshair_off
+ Tk::Tcllib::Crosshair.off(self)
+ end
+ def crosshair_track_on(&b)
+ Tk::Tcllib::Crosshair.track_on(self, &b)
+ end
+ def crosshair_track_off
+ Tk::Tcllib::Crosshair.track_off(self)
+ end
+ def crosshair_configure(*args)
+ Tk::Tcllib::Crosshair.configure(self, *args)
+ end
+ def crosshair_configinfo(slot = nil)
+ Tk::Tcllib::Crosshair.configinfo(self, slot)
+ end
+ def crosshair_current_configinfo(slot = nil)
+ Tk::Tcllib::Crosshair.current_configinfo(self, slot)
+ end
+ def crosshair_cget(slot)
+ Tk::Tcllib::Crosshair.cget(self, slot)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/ctext.rb b/ext/tk/lib/tkextlib/tcllib/ctext.rb
new file mode 100644
index 0000000000..308847c233
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/ctext.rb
@@ -0,0 +1,160 @@
+#
+# tkextlib/tcllib/ctext.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Overloads the text widget and provides new commands
+#
+
+require 'tk'
+require 'tk/text'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('ctext', '3.1')
+TkPackage.require('ctext')
+
+module Tk
+ module Tcllib
+ class CText < Tk::Text
+ PACKAGE_NAME = 'ctext'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('ctext')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::CText
+ TkCommandNames = ['ctext'.freeze].freeze
+ WidgetClassName = 'Ctext'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'linemapfg' << 'linemapbg' <<
+ 'linemap_select_fg' << 'linemap_select_bg'
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() << 'highlight' << 'linemap_markable'
+ end
+ private :__boolval_optkeys
+
+ def append(*args)
+ tk_send('append', *args)
+ end
+
+ def copy
+ tk_send('copy')
+ end
+
+ def cut
+ tk_send('cut')
+ end
+
+ def fast_delete(*args)
+ tk_send('fastdelete', *args)
+ end
+
+ def fast_insert(*args)
+ tk_send('fastinsert', *args)
+ end
+
+ def highlight(*args)
+ tk_send('highlight', *args)
+ end
+
+ def paste
+ tk_send('paste')
+ end
+
+ def edit(*args)
+ tk_send('edit', *args)
+ end
+
+ def add_highlight_class(klass, col, *keywords)
+ tk_call('ctext::addHighlightClass', @path, klass, col, keywords.flatten)
+ self
+ end
+
+ def add_highlight_class_for_special_chars(klass, col, *chrs)
+ tk_call('ctext::addHighlightClassForSpecialChars',
+ @path, klass, col, chrs.join(''))
+ self
+ end
+
+ def add_highlight_class_for_regexp(klass, col, tcl_regexp)
+ tk_call('ctext::addHighlightClassForRegexp',
+ @path, klass, col, tcl_regexp)
+ self
+ end
+
+ def add_highlight_class_with_only_char_start(klass, col, chr)
+ tk_call('ctext::addHighlightClassWithOnlyCharStart',
+ @path, klass, col, chr)
+ self
+ end
+
+ def clear_highlight_classes
+ tk_call('ctext::clearHighlightClasses', @path)
+ self
+ end
+
+ def get_highlight_classes
+ tk_split_simplelist(tk_call('ctext::getHighlightClasses', @path))
+ end
+
+ def delete_highlight_class(klass)
+ tk_call('ctext::deleteHighlightClass', @path, klass)
+ self
+ end
+
+ def enable_C_comments
+ tk_call('ctext::enableComments', @path)
+ self
+ end
+
+ def disable_C_comments
+ tk_call('ctext::disableComments', @path)
+ self
+ end
+
+ def find_next_char(idx, chr)
+ tk_call('ctext::findNextChar', @path, idx, chr)
+ end
+
+ def find_next_space(idx)
+ tk_call('ctext::findNextSpace', @path, idx)
+ end
+
+ def find_previous_space(idx)
+ tk_call('ctext::findPreviousSpace', @path, idx)
+ end
+
+ def set_update_proc(cmd=Proc.new)
+ tk_call('proc', 'ctext::update', '', cmd)
+ self
+ end
+
+ def modified?(mode)
+ bool(tk_call('ctext::modified', @path, mode))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/cursor.rb b/ext/tk/lib/tkextlib/tcllib/cursor.rb
new file mode 100644
index 0000000000..5c47f9709b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/cursor.rb
@@ -0,0 +1,97 @@
+#
+# tkextlib/tcllib/cursor.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Procedures to handle CURSOR data
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+module Tk
+ module Tcllib
+ module Cursor
+ PACKAGE_NAME = 'cursor'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('cursor')
+ rescue
+ ''
+ end
+ end
+
+ def self.not_available
+ fail RuntimeError, "'tkextlib/tcllib/cursor' extension is not available on your current environment."
+ end
+
+ def self.cursor_display(win=None)
+ Tk::Tcllib::Cursor.not_available
+ end
+
+ def self.cursor_propagate(win, cursor)
+ Tk::Tcllib::Cursor.not_available
+ end
+
+ def self.cursor_restore(win, cursor = None)
+ Tk::Tcllib::Cursor.not_available
+ end
+ end
+ end
+
+ def self.cursor_display(parent=None)
+ # Pops up a dialog with a listbox containing all the cursor names.
+ # Selecting a cursor name will display it in that dialog.
+ # This is simply for viewing any available cursors on the platform .
+ #tk_call_without_enc('::cursor::display', parent)
+ Tk::Tcllib::Cursor.cursor_display(parent)
+ end
+end
+
+class TkWindow
+ def cursor_propagate(cursor)
+ # Sets the cursor for self and all its descendants to cursor.
+ #tk_call_without_enc('::cursor::propagate', @path, cursor)
+ Tk::Tcllib::Cursor.cursor_propagate(self, cursor)
+ end
+ def cursor_restore(cursor = None)
+ # Restore the original or previously set cursor for self and all its
+ # descendants. If cursor is specified, that will be used if on any
+ # widget that did not have a preset cursor (set by a previous call
+ # to TkWindow#cursor_propagate).
+ #tk_call_without_enc('::cursor::restore', @path, cursor)
+ Tk::Tcllib::Cursor.cursor_restore(self, cursor)
+ end
+end
+
+# TkPackage.require('cursor', '0.1')
+TkPackage.require('cursor')
+
+module Tk
+ module Tcllib
+ class << Cursor
+ undef not_available
+ end
+
+ module Cursor
+ extend TkCore
+ def self.cursor_display(win=None)
+ tk_call_without_enc('::cursor::display', _epath(win))
+ end
+
+ def self.cursor_propagate(win, cursor)
+ #tk_call_without_enc('::cursor::propagate', win.path, cursor)
+ tk_call_without_enc('::cursor::propagate', _epath(win), cursor)
+ end
+
+ def self.cursor_restore(win, cursor = None)
+ #tk_call_without_enc('::cursor::restore', win.path, cursor)
+ tk_call_without_enc('::cursor::restore', _epath(win), cursor)
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/dateentry.rb b/ext/tk/lib/tkextlib/tcllib/dateentry.rb
new file mode 100644
index 0000000000..77038d95bc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/dateentry.rb
@@ -0,0 +1,62 @@
+#
+# tkextlib/tcllib/dateentry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * dateentry widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::dateentry', '0.91')
+TkPackage.require('widget::dateentry')
+
+module Tk::Tcllib
+ module Widget
+ class Dateentry < Tk::Tile::TEntry
+ PACKAGE_NAME = 'widget::dateentry'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::dateentry')
+ rescue
+ ''
+ end
+ end
+ end
+ DateEntry = Dateentry
+ end
+end
+
+class Tk::Tcllib::Widget::Dateentry
+ TkCommandNames = ['::widget::dateentry'.freeze].freeze
+
+ def __strval_optkeys
+ super() << ['dateformat']
+ end
+ private :__strval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def post
+ tk_send('post')
+ self
+ end
+
+ def unpost
+ tk_send('unpost')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/datefield.rb b/ext/tk/lib/tkextlib/tcllib/datefield.rb
new file mode 100644
index 0000000000..4c2eae741e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/datefield.rb
@@ -0,0 +1,57 @@
+#
+# tkextlib/tcllib/datefield.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Tk datefield widget
+#
+# (The following is the original description of the library.)
+#
+# The datefield package provides the datefield widget which is an enhanced
+# text entry widget for the purpose of date entry. Only valid dates of the
+# form MM/DD/YYYY can be entered.
+#
+# The datefield widget is, in fact, just an entry widget with specialized
+# bindings. This means all the command and options for an entry widget apply
+# equally here.
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('datefield', '0.1')
+TkPackage.require('datefield')
+
+module Tk
+ module Tcllib
+ class Datefield < Tk::Entry
+ PACKAGE_NAME = 'datefield'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('datefield')
+ rescue
+ ''
+ end
+ end
+ end
+ DateField = Datefield
+ end
+end
+
+class Tk::Tcllib::Datefield
+ TkCommandNames = ['::datefield::datefield'.freeze].freeze
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/diagrams.rb b/ext/tk/lib/tkextlib/tcllib/diagrams.rb
new file mode 100644
index 0000000000..d24ba9d232
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/diagrams.rb
@@ -0,0 +1,224 @@
+#
+# tkextlib/tcllib/diagrams.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Draw diagrams
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('Diagrams', '0.3')
+TkPackage.require('Diagrams')
+
+module Tk::Tcllib
+ module Diagrams
+ PACKAGE_NAME = 'Diagrams'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Diagrams')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+class << Tk::Tcllib::Diagrams
+ include TkCore
+
+ def drawin(canvas)
+ tk_call('::Diagrams::drawin', canvas)
+ canvas
+ end
+ alias draw_in drawin
+
+ def saveps(filename)
+ tk_call('::Diagrams::saveps', filename)
+ filename
+ end
+ alias save_ps saveps
+
+ def direction(dir)
+ tk_call('::Diagrams::direction', dir)
+ dir
+ end
+
+ def currentpos(pos)
+ list(tk_call('::Diagrams::currentpos', pos))
+ end
+ alias current_pos currentpos
+ alias currentpos= currentpos
+ alias current_pos= currentpos
+
+ def getpos(anchor, obj)
+ list(tk_call('::Diagrams::getpos', anchor, obj))
+ end
+ alias get_pos getpos
+
+ def position(x, y)
+ list(tk_call('::Diagrams::position', x, y))
+ end
+
+ def box(text, width=nil, height=nil)
+ if width || height
+ width = '' unless width
+ height = '' unless height
+ list(tk_call('::Diagrams::box', text, width, height))
+ else
+ list(tk_call('::Diagrams::box', text))
+ end
+ end
+
+ def plaintext(text, width=nil, height=nil)
+ if width || height
+ width = '' unless width
+ height = '' unless height
+ list(tk_call('::Diagrams::plaintext', text, width, height))
+ else
+ list(tk_call('::Diagrams::plaintext', text))
+ end
+ end
+
+ def circle(text, radius=nil)
+ if radius
+ list(tk_call('::Diagrams::circle', text, radius))
+ else
+ list(tk_call('::Diagrams::circle', text))
+ end
+ end
+
+ def slanted(text, width=nil, height=nil, angle=nil)
+ if width || height || angle
+ width = '' unless width
+ height = '' unless height
+ if angle
+ list(tk_call('::Diagrams::slanted', text, width, height, angle))
+ else
+ list(tk_call('::Diagrams::slanted', text, width, height))
+ end
+ else
+ list(tk_call('::Diagrams::slanted', text))
+ end
+ end
+
+ def diamond(text, width=nil, height=nil)
+ if width || height
+ width = '' unless width
+ height = '' unless height
+ list(tk_call('::Diagrams::diamond', text, width, height))
+ else
+ list(tk_call('::Diagrams::diamond', text))
+ end
+ end
+
+ def drum(text, width=nil, height=nil)
+ if width || height
+ width = '' unless width
+ height = '' unless height
+ list(tk_call('::Diagrams::drum', text, width, height))
+ else
+ list(tk_call('::Diagrams::drum', text))
+ end
+ end
+
+ def arrow(text=nil, length=nil, head=nil)
+ if length || head
+ text = '' unless text
+ length = '' unless length
+ list(tk_call('::Diagrams::arrow', text, length, head))
+ else
+ if text
+ list(tk_call('::Diagrams::arrow', text))
+ else
+ list(tk_call('::Diagrams::arrow'))
+ end
+ end
+ end
+
+ def line(*args)
+ ary = []
+ args.each{|arg|
+ if arg.kind_of?(Array) && arg.length == 2 # [length, angle]
+ ary.concat arg
+ else # ["POSITION", x, y] or length or angle
+ ary << arg
+ end
+ }
+ list(tk_call('::Diagrams::line', *ary))
+ end
+
+ def bracket(dir, dist, from_pos, to_pos)
+ list(tk_call('::Diagrams::bracket', dir, dist, from_pos, to_pos))
+ end
+
+ def attach(anchor=None)
+ tk_call('::Diagrams::attach', anchor)
+ end
+
+ def color(name=None)
+ tk_call('::Diagrams::color', name)
+ end
+
+ def fillcolor(name=None)
+ tk_call('::Diagrams::fillcolor', name)
+ end
+
+ def textcolor(name=None)
+ tk_call('::Diagrams::textcolor', name)
+ end
+
+ def usegap(mode=None)
+ bool(tk_call('::Diagrams::usegap', mode))
+ end
+ alias use_gap usegap
+
+ def xgap(val=None)
+ number(tk_call('::Diagrams::xgap', val))
+ end
+
+ def ygap(val=None)
+ number(tk_call('::Diagrams::ygap', val))
+ end
+
+ def textfont(fnt=None)
+ tk_call('::Diagrams::textfont', fnt)
+ end
+
+ def linewidth(pixels=None)
+ number(tk_call('::Diagrams::linewidth', pixels))
+ end
+
+ def linestyle(style=None)
+ tk_call('::Diagrams::linestyle', style)
+ end
+
+ def pushstate
+ tk_call('::Diagrams::pushstate')
+ end
+ alias push_state pushstate
+
+ def popstate
+ tk_call('::Diagrams::popstate')
+ end
+ alias pop_state popstate
+
+ def computepos
+ list(tk_call('::Diagrams::computepos'))
+ end
+ alias compute_pos computepos
+
+ def boxcoords(x1, y1, x2, y2)
+ list(tk_call('::Diagrams::boxcoords', x1, y1, x2, y2))
+ end
+
+ def moveobject(obj)
+ list(tk_call('::Diagrams::moveobject', obj))
+ end
+ alias move_object moveobject
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/dialog.rb b/ext/tk/lib/tkextlib/tcllib/dialog.rb
new file mode 100644
index 0000000000..86a0ef2269
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/dialog.rb
@@ -0,0 +1,84 @@
+#
+# tkextlib/tcllib/dialog.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Generic dialog widget (themed)
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::dialog', '1.2')
+TkPackage.require('widget::dialog')
+
+module Tk::Tcllib
+ module Widget
+ class Dialog < TkWindow
+ PACKAGE_NAME = 'widget::dialog'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::dialog')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::Widget::Dialog
+ TkCommandNames = ['::widget::dialog'.freeze].freeze
+
+ def __boolval_optkeys
+ ['separator', 'synchronous', 'transient']
+ end
+ private :__boolval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def add(what, *args)
+ window(tk_send('add', *args))
+ end
+
+ def get_frame
+ window(tk_send('getframe'))
+ end
+
+ def set_widget(widget)
+ tk_send('setwidget', widget)
+ self
+ end
+
+ def display
+ tk_send('display')
+ self
+ end
+ alias show display
+
+ def cancel
+ tk_send('cancel')
+ self
+ end
+
+ def close(reason = None)
+ tk_send('close', reason)
+ end
+
+ def withdraw
+ tk_send('withdraw')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/getstring.rb b/ext/tk/lib/tkextlib/tcllib/getstring.rb
new file mode 100644
index 0000000000..48711d3b66
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/getstring.rb
@@ -0,0 +1,134 @@
+#
+# tkextlib/tcllib/getstring.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * A dialog which consists of an Entry, OK, and Cancel buttons.
+#
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('getstring', '0.1')
+TkPackage.require('getstring')
+
+module Tk::Tcllib
+ class GetString_Dialog < TkWindow
+ PACKAGE_NAME = 'getstring'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('getstring')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+
+class Tk::Tcllib::GetString_Dialog
+ TkCommandNames = ['::getstring::tk_getString'.freeze].freeze
+ WidgetClassName = 'TkSDialog'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.show(*args)
+ dialog = self.new(*args)
+ dialog.show
+ [dialog.status, dialog.value]
+ end
+ def self.display(*args)
+ self.show(*args)
+ end
+
+ def initialize(*args) # args = (parent=nil, text='', keys=nil)
+ keys = args.pop
+ if keys.kind_of?(Hash)
+ text = args.pop
+ @keys = _symbolkey2str(keys)
+ args.push(keys)
+ else
+ text = keys
+ @keys = {}
+ end
+ if text
+ @text = text.dup
+ else
+ @text = ''
+ end
+
+ @variable = TkVariable.new
+ @status = nil
+
+ super(*args)
+ end
+
+ def create_self(keys)
+ # dummy
+ end
+ private :create_self
+
+ def show
+ @variable.value = ''
+ @status = bool(tk_call(self.class::TkCommandNames[0],
+ @path, @variable, @text, *hash_kv(@keys)))
+ end
+ alias display show
+
+ def status
+ @status
+ end
+
+ def value
+ @variable.value
+ end
+
+ def cget_strict(slot)
+ slot = slot.to_s
+ if slot == 'text'
+ @text
+ else
+ @keys[slot]
+ end
+ end
+ def cget(slot)
+ cget_strict(slot)
+ end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot.each{|k, v| configure(k, v)}
+ else
+ slot = slot.to_s
+ value = _symbolkey2str(value) if value.kind_of?(Hash)
+ if value && value != None
+ if slot == 'text'
+ @text = value.to_s
+ else
+ @keys[slot] = value
+ end
+ else
+ if slot == 'text'
+ @text = ''
+ else
+ @keys.delete(slot)
+ end
+ end
+ end
+ self
+ end
+
+ def configinfo(slot = nil)
+ if slot
+ slot = slot.to_s
+ [ slot, nil, nil, nil, ( (slot == 'text')? @text: @keys[slot] ) ]
+ else
+ @keys.collect{|k, v| [ k, nil, nil, nil, v ] } \
+ << [ 'text', nil, nil, nil, @text ]
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/history.rb b/ext/tk/lib/tkextlib/tcllib/history.rb
new file mode 100644
index 0000000000..a01a4ebfcc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/history.rb
@@ -0,0 +1,73 @@
+#
+# tkextlib/tcllib/history.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Provides a history for Entry widgets
+#
+
+require 'tk'
+require 'tk/entry'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('history', '0.1')
+TkPackage.require('history')
+
+module Tk::Tcllib
+ module History
+ PACKAGE_NAME = 'history'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('history')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::History
+ extend TkCore
+
+ def self.init(entry, length=None)
+ tk_call_without_enc('::history::init', entry.path, length)
+ entry.extend(self) # add methods to treat history to the entry widget
+ end
+
+ def self.remove(entry)
+ tk_call_without_enc('::history::remove', entry.path)
+ entry
+ end
+
+ def history_remove
+ tk_call_without_enc('::history::remove', @path)
+ self
+ end
+
+ def history_add(text)
+ tk_call('::history::add', @path, text)
+ self
+ end
+
+ def history_get
+ simplelist(tk_call_without_enc('::history::get', @path))
+ end
+
+ def history_clear
+ tk_call_without_enc('::history::clear', @path)
+ self
+ end
+
+ def history_configure(opt, value)
+ tk_call('::history::configure', @path, opt, value)
+ self
+ end
+
+ def history_configinfo(opt)
+ tk_call('::history::configure', @path, opt)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/ico.rb b/ext/tk/lib/tkextlib/tcllib/ico.rb
new file mode 100644
index 0000000000..36a32c6b09
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/ico.rb
@@ -0,0 +1,146 @@
+#
+# tkextlib/tcllib/ico.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Reading and writing windows icons
+#
+
+require 'tk'
+require 'tk/image'
+#require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('ico', '0.3')
+TkPackage.require('ico')
+
+module Tk
+ module Tcllib
+ class ICO < TkImage
+ PACKAGE_NAME = 'ico'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('ico')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::ICO
+ def self.list(file, keys=nil)
+ tk_split_list(tk_call_without_enc('::ico::getIconList', file,
+ *hash_kv(keys, true)))
+ end
+
+ def self.icons(file, keys=nil)
+ tk_split_simplelist(tk_call_without_enc('::ico::icons', file,
+ *hash_kv(keys, true))).map{|elem|
+ num_or_str(elem)
+ }
+ end
+
+ def self.get_members(file, name, keys=nil)
+ tk_split_simplelist(tk_call_without_enc('::ico::getMembers', file, name,
+ *hash_kv(keys, true))).map{|elem|
+ name, width, height, bpp = tk_split_simplelist(elem)
+ [name, number(width), number(height), number(bpp)]
+ }
+ end
+
+ def self.get(file, index, keys=nil)
+ tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true))
+ end
+ def self.get_icon(*args)
+ get(*args)
+ end
+
+ def self.get_by_name(file, name, keys=nil)
+ tk_call_without_enc('::ico::getIconByName', file, name,
+ *hash_kv(keys, true))
+ end
+ def self.get_icon_by_name(*args)
+ get_by_name(*args)
+ end
+
+ def self.get_fileicon(file, keys=nil)
+ tk_call_without_enc('::ico::getFileIcon', file, *hash_kv(keys, true))
+ end
+
+ def self.get_image(file, index, keys={})
+ keys = _symbolkey2str(keys)
+ keys.delete('format')
+ self.new(file, index, keys)
+ end
+
+ def self.get_data(file, index, keys={})
+ keys['format'] = 'data'
+ tk_split_list(tk_call_without_enc('::ico::getIcon', file, index,
+ *hash_kv(keys, true)))
+ end
+
+ def self.write(file, index, depth, data, keys=nil)
+ tk_call_without_enc('::ico::writeIcon', file, index, depth, data,
+ *hash_kv(keys, true))
+ end
+
+ def self.copy(from_file, from_index, to_file, to_index, keys=nil)
+ tk_call_without_enc('::ico::copyIcon',
+ from_file, from_index, to_file, to_index,
+ *hash_kv(keys, true))
+ end
+
+ def self.exe_to_ico(exe_file, ico_file, keys=nil)
+ tk_call_without_enc('::ico::copyIcon', exe_file, ico_file,
+ *hash_kv(keys, true))
+ end
+
+ def self.clear_cache(file=None)
+ tk_call_without_enc('::ico::clearCache', file)
+ end
+
+ def self.transparent_color(image, color)
+ if image.kind_of?(Array)
+ tk_split_list(tk_call_without_enc('::ico::transparentColor',
+ image, color))
+ else
+ tk_call_without_enc('::ico::transparentColor', image, color)
+ end
+ end
+
+ def self.show(file, keys=nil)
+ tk_call_without_enc('::ico::Show', file, *hash_kv(keys, true))
+ end
+
+ ###########################
+
+ def initialize(file, index, keys=nil)
+ keys = _symbolkey2str(keys)
+ if keys.key?('name')
+ @path = keys['name'].to_s
+ else
+ Tk_Image_ID.mutex.synchronize{
+ @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
+ Tk_Image_ID[1].succ!
+ }
+ end
+ tk_call_without_enc('::ico::getIcon', file, index, '-name', @path,
+ '-format', 'image', *hash_kv(keys, true))
+ Tk_IMGTBL[@path] = self
+ end
+
+ def write(file, index, depth, keys=nil)
+ Tk::Tcllib::ICO.write(file, index, depth, @path, keys=nil)
+ self
+ end
+
+ def transparent_color(color)
+ tk_call_without_enc('::ico::transparentColor', @path, color)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
new file mode 100644
index 0000000000..4878cc3c23
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb
@@ -0,0 +1,75 @@
+#
+# tkextlib/tcllib/ip_entry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * An IP address entry widget
+#
+# (The following is the original description of the library.)
+#
+# This package provides a widget for the entering of a IP address.
+# It guarantees a valid address at all times.
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('ipentry', '0.1')
+TkPackage.require('ipentry')
+
+module Tk
+ module Tcllib
+ class IP_Entry < Tk::Entry
+ PACKAGE_NAME = 'ipentry'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('ipentry')
+ rescue
+ ''
+ end
+ end
+ end
+ IPEntry = IP_Entry
+
+ class IP_Entry6 < IP_Entry
+ end
+ IPEntry6 = IP_Entry6
+ IP6_Entry = IP_Entry6
+ end
+end
+
+class Tk::Tcllib::IP_Entry
+ TkCommandNames = ['::ipentry::ipentry'.freeze].freeze
+ WidgetClassName = 'IPEntry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'fg' << 'bg' << 'insertbackground'
+ end
+ private :__strval_optkeys
+
+ def complete?
+ bool(tk_send_without_enc('complete'))
+ end
+
+ def insert(*ip)
+ tk_send_without_enc('insert', array2tk_list(ip.flatten))
+ end
+end
+
+class Tk::Tcllib::IP_Entry6 < Tk::Tcllib::IP_Entry
+ TkCommandNames = ['::ipentry::ipentry6'.freeze].freeze
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/khim.rb b/ext/tk/lib/tkextlib/tcllib/khim.rb
new file mode 100644
index 0000000000..5dc2130b35
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/khim.rb
@@ -0,0 +1,68 @@
+#
+# tkextlib/tcllib/khim.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Kevin's Hacky Input Method
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('khim', '1.0')
+TkPackage.require('khim')
+
+module Tk::Tcllib
+ class KHIM < TkToplevel
+ PACKAGE_NAME = 'khim'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('khim')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::KHIM
+ TkCommandNames = ['::khim::getOptions'.freeze].freeze
+
+ def self.get_options(parent='')
+ path = parent + '.tcllib_widget_khim_dialog'
+ self.new(:widgetname => path)
+ end
+
+ def self.get_config #=> cmd_string
+ Tk.tk_call_without_enc('::khim::getConfig')
+ end
+
+ def self.set_config(*args)
+ if args.length == 1
+ # cmd_string generated by
+ #Tk.ip_eval_without_enc(cmd_string)
+ Tk.ip_eval(cmd_string)
+ else
+ # args for setConfig command
+ #Tk.tk_call_without_enc('::khim::setConfig', *args)
+ Tk.tk_call('::khim::setConfig', *args)
+ end
+ end
+
+ def self.showHelp
+ Tk::Tcllib::KHIM::Help.new
+ end
+
+ def create_self(keys=None)
+ @db_class = @classname = nil
+ super(None) # ignore keys
+ end
+end
+
+class Tk::Tcllib::KHIM::Help < TkToplevel
+ TkCommandNames = ['::khim::showHelp'.freeze].freeze
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/menuentry.rb b/ext/tk/lib/tkextlib/tcllib/menuentry.rb
new file mode 100644
index 0000000000..f1eb2f295c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/menuentry.rb
@@ -0,0 +1,47 @@
+#
+# tkextlib/tcllib/menuentry.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * menuentry widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::menuentry', '1.0')
+TkPackage.require('widget::menuentry')
+
+module Tk::Tcllib
+ module Widget
+ class Menuentry < Tk::Tile::TEntry
+ PACKAGE_NAME = 'widget::menuentry'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::menuentry')
+ rescue
+ ''
+ end
+ end
+ end
+ MenuEntry = Menuentry
+ end
+end
+
+class Tk::Tcllib::Widget::Menuentry
+ TkCommandNames = ['::widget::menuentry'.freeze].freeze
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/ntext.rb b/ext/tk/lib/tkextlib/tcllib/ntext.rb
new file mode 100644
index 0000000000..7888ed4871
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/ntext.rb
@@ -0,0 +1,146 @@
+#
+# tkextlib/tcllib/ntext.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Ntext bindtag
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('ntext', '0.81')
+TkPackage.require('ntext')
+
+module Tk::Tcllib
+ Ntext = TkBindTag.new_by_name('Ntext')
+end
+
+# variables
+Tk::Tcllib::Ntext.instance_eval{
+ # boolean
+ @classicAnchor = TkVarAccess.new('::ntext::classicAnchor')
+ @classicExtras = TkVarAccess.new('::ntext::classicExtras')
+ @classicMouseSelect = TkVarAccess.new('::ntext::classicMouseSelect')
+ @classicWordBreak = TkVarAccess.new('::ntext::classicWordBreak')
+ @classicWrap = TkVarAccess.new('::ntext::classicWrap')
+ @overwrite = TkVarAccess.new('::ntext::overwrite')
+
+ # regexp
+ @newWrapRegexp = TkVarAccess.new('::ntext::newWrapRegexp')
+
+ # variables (advanced use)
+ @tcl_match_wordBreakAfter = TkVarAccess.new('::ntext::tcl_match_wordBreakAfter')
+ @tcl_match_wordBreakBefore = TkVarAccess.new('::ntext::tcl_match_wordBreakBefore')
+ @tcl_match_endOfWord = TkVarAccess.new('::ntext::tcl_match_endOfWord')
+ @tcl_match_startOfNextWord = TkVarAccess.new('::ntext::tcl_match_startOfNextWord')
+ @tcl_match_startOfPreviousWord = TkVarAccess.new('::ntext::tcl_match_startOfPreviousWord')
+}
+
+class << Tk::Tcllib::Ntext
+ def wrapIndent(txt, *args)
+ TK.tk_call('::next::wrapIndent', txt, *args)
+ end
+
+ def initializeMatchPatterns
+ TK.tk_call('::next::initializeMatchPatterns')
+ self
+ end
+
+ def createMatchPatterns(*args)
+ TK.tk_call('::next::createMatchPatterns', *args)
+ self
+ end
+
+ # functions (advanced use)
+ #ntext::new_wordBreakAfter
+ #ntext::new_wordBreakBefore
+ #ntext::new_endOfWord
+ #ntext::new_startOfNextWord
+ #ntext::new_startOfPreviousWord
+
+ # accessor
+ def classicAnchor
+ @classicAnchor.bool
+ end
+ def classicAnchor=(mode)
+ @classicAnchor.bool = mode
+ end
+
+ def classicExtras
+ @classicExtras.bool
+ end
+ def classicExtras=(mode)
+ @classicExtras.bool = mode
+ end
+
+ def classicMouseSelect
+ @classicMouseSelect.bool
+ end
+ def classicMouseSelect=(mode)
+ @classicMouseSelect.bool = mode
+ end
+
+ def classicWordBreak
+ @classicWordBreak.bool
+ end
+ def classicWordBreak=(mode)
+ @classicWordBreak.bool = mode
+ end
+
+ def classicWrap
+ @classicWrap.bool
+ end
+ def classicWrap=(mode)
+ @classicWrap.bool = mode
+ end
+
+ def overwrite
+ @overwrite.bool
+ end
+ def overwrite=(mode)
+ @classic.bool = mode
+ end
+
+ def newWrapRegexp
+ @newWrapRegexp.value
+ end
+ def newWrapRegexp=(val)
+ @newWrapRegexp.value = val
+ end
+
+ def tcl_match_wordBreakAfter
+ @tcl_match_wordBreakAfter.value
+ end
+ def tcl_match_wordBreakAfter=(val)
+ @tcl_match_wordBreakAfter.value = val
+ end
+
+ def tcl_match_wordBreakBefore
+ @tcl_match_wordBreakBefore.value
+ end
+ def tcl_match_wordBreakBefore=(val)
+ @tcl_match_wordBreakBefore.value = val
+ end
+
+ def tcl_match_endOfWord
+ @tcl_match_endOfWord.value
+ end
+ def tcl_match_endOfWord=(val)
+ @tcl_match_endOfWord.value = val
+ end
+
+ def tcl_match_startOfNextWord
+ @tcl_match_startOfNextWord.value
+ end
+ def tcl_match_startOfNextWord=(val)
+ @tcl_match_startOfNextWord.value = val
+ end
+
+ def tcl_match_startOfPreviousWord
+ @tcl_match_startOfPreviousWord.value
+ end
+ def tcl_match_startOfPreviousWord=(val)
+ @tcl_match_startOfPreviousWord.value = val
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/panelframe.rb b/ext/tk/lib/tkextlib/tcllib/panelframe.rb
new file mode 100644
index 0000000000..020c51cbd1
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/panelframe.rb
@@ -0,0 +1,78 @@
+#
+# tkextlib/tcllib/panelframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Create PanelFrame widgets.
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::panelframe', '1.0')
+TkPackage.require('widget::panelframe')
+
+module Tk::Tcllib
+ module Widget
+ class PanelFrame < TkWindow
+ PACKAGE_NAME = 'widget::panelframe'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::panelframe')
+ rescue
+ ''
+ end
+ end
+ end
+ Panelframe = PanelFrame
+ end
+end
+
+class Tk::Tcllib::Widget::PanelFrame
+ TkCommandNames = ['::widget::panelframe'.freeze].freeze
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def add(what, *args)
+ window(tk_send('add', *args))
+ end
+
+ #def get_frame
+ # window(tk_send('getframe'))
+ #end
+
+ def set_widget(widget)
+ tk_send('setwidget', widget)
+ self
+ end
+
+ def remove(*wins)
+ tk_send('remove', *wins)
+ self
+ end
+ def remove_destroy(*wins)
+ tk_send('remove', '-destroy', *wins)
+ self
+ end
+
+ def delete(*wins)
+ tk_send('delete', *wins)
+ self
+ end
+
+ def items
+ simplelist(tk_send('items')).collect!{|w| window(w)}
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/plotchart.rb b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
new file mode 100644
index 0000000000..d2f3a0da3a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/plotchart.rb
@@ -0,0 +1,1404 @@
+#
+# tkextlib/tcllib/plotchart.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Simple plotting and charting package
+#
+# (The following is the original description of the library.)
+#
+# Plotchart is a Tcl-only package that focuses on the easy creation of
+# xy-plots, barcharts and other common types of graphical presentations.
+# The emphasis is on ease of use, rather than flexibility. The procedures
+# that create a plot use the entire canvas window, making the layout of the
+# plot completely automatic.
+#
+# This results in the creation of an xy-plot in, say, ten lines of code:
+# --------------------------------------------------------------------
+# package require Plotchart
+#
+# canvas .c -background white -width 400 -height 200
+# pack .c -fill both
+#
+# #
+# # Create the plot with its x- and y-axes
+# #
+# set s [::Plotchart::createXYPlot .c {0.0 100.0 10.0} {0.0 100.0 20.0}]
+#
+# foreach {x y} {0.0 32.0 10.0 50.0 25.0 60.0 78.0 11.0 } {
+# $s plot series1 $x $y
+# }
+#
+# $s title "Data series"
+# --------------------------------------------------------------------
+#
+# A drawback of the package might be that it does not do any data management.
+# So if the canvas that holds the plot is to be resized, the whole plot must
+# be redrawn. The advantage, though, is that it offers a number of plot and
+# chart types:
+#
+# * XY-plots like the one shown above with any number of data series.
+# * Stripcharts, a kind of XY-plots where the horizontal axis is adjusted
+# automatically. The result is a kind of sliding window on the data
+# series.
+# * Polar plots, where the coordinates are polar instead of cartesian.
+# * Isometric plots, where the scale of the coordinates in the two
+# directions is always the same, i.e. a circle in world coordinates
+# appears as a circle on the screen.
+# You can zoom in and out, as well as pan with these plots (Note: this
+# works best if no axes are drawn, the zooming and panning routines do
+# not distinguish the axes), using the mouse buttons with the control
+# key and the arrow keys with the control key.
+# * Piecharts, with automatic scaling to indicate the proportions.
+# * Barcharts, with either vertical or horizontal bars, stacked bars or
+# bars side by side.
+# * Timecharts, where bars indicate a time period and milestones or other
+# important moments in time are represented by triangles.
+# * 3D plots (both for displaying surfaces and 3D bars)
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('Plotchart', '0.9')
+# TkPackage.require('Plotchart', '1.1')
+# TkPackage.require('Plotchart', '1.6.3')
+TkPackage.require('Plotchart')
+
+module Tk
+ module Tcllib
+ module Plotchart
+ PACKAGE_NAME = 'Plotchart'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Plotchart')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::Plotchart
+ extend TkCore
+ ############################
+ def self.view_port(w, *args) # args := pxmin, pymin, pxmax, pymax
+ tk_call_without_enc('::Plotchart::viewPort', w.path, *(args.flatten))
+ end
+
+ def self.world_coordinates(w, *args) # args := xmin, ymin, xmax, ymax
+ tk_call_without_enc('::Plotchart::worldCoordinates',
+ w.path, *(args.flatten))
+ end
+
+ def self.world_3D_coordinates(w, *args)
+ # args := xmin, ymin, zmin, xmax, ymax, zmax
+ tk_call_without_enc('::Plotchart::world3DCoordinates',
+ w.path, *(args.flatten))
+ end
+
+ def self.coords_to_pixel(w, x, y)
+ list(tk_call_without_enc('::Plotchart::coordsToPixel', w.path, x, y))
+ end
+
+ def self.coords_3D_to_pixel(w, x, y, z)
+ list(tk_call_without_enc('::Plotchart::coords3DToPixel', w.path, x, y, z))
+ end
+
+ def self.plotconfig(*args)
+ case args.length
+ when 0, 1, 2
+ # 0: (no args) --> list of chat types
+ # 1: charttype --> list of components
+ # 2: charttype, component --> list of properties
+ simplelist(tk_call('::Plotchart::plotconfig', *args))
+ when 3
+ # 3: charttype, component, property --> current value
+ tk_call('::Plotchart::plotconfig', *args)
+ else
+ # 4: charttype, component, property, value : set new value
+ # 5+: Error on Tcl/Tk
+ tk_call('::Plotchart::plotconfig', *args)
+ nil
+ end
+ end
+
+ def self.plotpack(w, dir, *plots)
+ tk_call_without_enc('::Plotchart::plotpack', w.path, dir, *plots)
+ w
+ end
+
+ def self.polar_coordinates(w, radmax)
+ tk_call_without_enc('::Plotchart::polarCoordinates', w.path, radmax)
+ end
+
+ def self.polar_to_pixel(w, rad, phi)
+ list(tk_call_without_enc('::Plotchart::polarToPixel', w.path, rad, phi))
+ end
+
+ def self.pixel_to_coords(w, x, y)
+ list(tk_call_without_enc('::Plotchart::coordsToPixel', w.path, x, y))
+ end
+
+ def self.determine_scale(*args) # (xmin, xmax, inverted=false)
+ tk_call_without_enc('::Plotchart::determineScale', *args)
+ end
+
+ def self.set_zoom_pan(w)
+ tk_call_without_enc('::Plotchart::setZoomPan', w.path)
+ end
+
+ ############################
+ module ChartMethod
+ include TkCore
+
+ def title(str)
+ tk_call_without_enc(@chart, 'title', _get_eval_enc_str(str))
+ self
+ end
+
+ def save_plot(filename)
+ tk_call_without_enc(@chart, 'saveplot', filename)
+ self
+ end
+
+ def xtext(str)
+ tk_call_without_enc(@chart, 'xtext', _get_eval_enc_str(str))
+ self
+ end
+
+ def ytext(str)
+ tk_call_without_enc(@chart, 'ytext', _get_eval_enc_str(str))
+ self
+ end
+
+ def xconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'xconfig', "-#{key}",value)
+ end
+ self
+ end
+
+ def yconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'yconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'yconfig', "-#{key}", value)
+ end
+ self
+ end
+
+ def background(part, color_or_image, dir)
+ tk_call_without_enc(@chart, 'background',
+ part, color_or_image, dir)
+ self
+ end
+
+ def xticklines(color=None)
+ tk_call(@chart, 'xticklines', color)
+ self
+ end
+
+ def yticklines(color=None)
+ tk_call(@chart, 'yticklines', color)
+ self
+ end
+
+ def legendconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'legendconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'legendconfig', "-#{key}", value)
+ end
+ self
+ end
+
+ def legend(series, text)
+ tk_call_without_enc(@chart, 'legend',
+ _get_eval_enc_str(series), _get_eval_enc_str(text))
+ self
+ end
+
+ def balloon(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
+ if args[0].kind_of?(Array)
+ # args => ([x, y], text, dir)
+ x, y = args.shift
+ else
+ # args => (x, y, text, dir)
+ x = args.shift
+ y = args.shift
+ end
+
+ text, dir = args
+
+ tk_call_without_enc(@chart, 'balloon', x, y,
+ _get_eval_enc_str(text), dir)
+ self
+ end
+
+ def balloonconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'balloonconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'balloonconfig', "-#{key}", value)
+ end
+ end
+
+ def plaintext(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
+ if args[0].kind_of?(Array)
+ # args => ([x, y], text, dir)
+ x, y = args.shift
+ else
+ # args => (x, y, text, dir)
+ x = args.shift
+ y = args.shift
+ end
+
+ text, dir = args
+
+ tk_call_without_enc(@chart, 'plaintext', x, y,
+ _get_eval_enc_str(text), dir)
+ self
+ end
+
+ ############################
+
+ def view_port(*args) # args := pxmin, pymin, pxmax, pymax
+ tk_call_without_enc('::Plotchart::viewPort', @path, *(args.flatten))
+ self
+ end
+
+ def world_coordinates(*args) # args := xmin, ymin, xmax, ymax
+ tk_call_without_enc('::Plotchart::worldCoordinates',
+ @path, *(args.flatten))
+ self
+ end
+
+ def world_3D_coordinates(*args)
+ # args := xmin, ymin, zmin, xmax, ymax, zmax
+ tk_call_without_enc('::Plotchart::world3DCoordinates',
+ @path, *(args.flatten))
+ self
+ end
+
+ def coords_to_pixel(x, y)
+ list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
+ end
+
+ def coords_3D_to_pixel(x, y, z)
+ list(tk_call_without_enc('::Plotchart::coords3DToPixel', @path, x, y, z))
+ end
+
+ def plotpack(dir, *plots)
+ tk_call_without_enc('::Plotchart::plotpack', @path, dir, *plots)
+ self
+ end
+
+ def polar_coordinates(radmax)
+ tk_call_without_enc('::Plotchart::polarCoordinates', @path, radmax)
+ self
+ end
+
+ def polar_to_pixel(rad, phi)
+ list(tk_call_without_enc('::Plotchart::polarToPixel', @path, rad, phi))
+ end
+
+ def pixel_to_coords(x, y)
+ list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
+ end
+
+ def determine_scale(xmax, ymax)
+ tk_call_without_enc('::Plotchart::determineScale', @path, xmax, ymax)
+ self
+ end
+
+ def set_zoom_pan()
+ tk_call_without_enc('::Plotchart::setZoomPan', @path)
+ self
+ end
+ end
+
+ ############################
+ class XYPlot < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createXYPlot'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] xaxis, yaxis [, keys])
+ # xaxis := Array of [minimum, maximum, stepsize]
+ # yaxis := Array of [minimum, maximum, stepsize]
+ if args[0].kind_of?(Array)
+ @xaxis = args.shift
+ @yaxis = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @xaxis = args.shift
+ @yaxis = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis), array2tk_list(@yaxis))
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+
+ def plot(series, x, y)
+ tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series), x, y)
+ self
+ end
+
+ def contourlines(xcrd, ycrd, vals, clss=None)
+ xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
+ ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
+ vals = array2tk_list(vals) if vals.kind_of?(Array)
+ clss = array2tk_list(clss) if clss.kind_of?(Array)
+
+ tk_call(@chart, 'contourlines', xcrd, ycrd, vals, clss)
+ self
+ end
+
+ def contourfill(xcrd, ycrd, vals, clss=None)
+ xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
+ ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
+ vals = array2tk_list(vals) if vals.kind_of?(Array)
+ clss = array2tk_list(clss) if clss.kind_of?(Array)
+
+ tk_call(@chart, 'contourfill', xcrd, ycrd, vals, clss)
+ self
+ end
+
+ def contourbox(xcrd, ycrd, vals, clss=None)
+ xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
+ ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
+ vals = array2tk_list(vals) if vals.kind_of?(Array)
+ clss = array2tk_list(clss) if clss.kind_of?(Array)
+
+ tk_call(@chart, 'contourbox', xcrd, ycrd, vals, clss)
+ self
+ end
+
+ def color_map(colors)
+ colors = array2tk_list(colors) if colors.kind_of?(Array)
+
+ tk_call_without_enc(@chart, 'colorMap', colors)
+ self
+ end
+
+ def grid_cells(xcrd, ycrd)
+ xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
+ ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
+
+ tk_call_without_enc(@chart, 'grid', xcrd, ycrd)
+ self
+ end
+
+ def dataconfig(series, key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
+ else
+ tk_call(@chart, 'dataconfig', series, "-#{key}", value)
+ end
+ end
+
+ def rescale(xscale, yscale) # xscale|yscale => [newmin, newmax, newstep]
+ tk_call_without_enc(@chart, 'rescale', xscale, yscale)
+ self
+ end
+
+ def trend(series, xcrd, ycrd)
+ tk_call_without_enc(@chart, 'trend',
+ _get_eval_enc_str(series), xcrd, ycrd)
+ self
+ end
+
+ def rchart(series, xcrd, ycrd)
+ tk_call_without_enc(@chart, 'rchart',
+ _get_eval_enc_str(series), xcrd, ycrd)
+ self
+ end
+
+ def interval(series, xcrd, ymin, ymax, ycenter=None)
+ tk_call(@chart, 'interval', series, xcrd, ymin, ymax, ycenter)
+ self
+ end
+
+ def box_and_whiskers(series, xcrd, ycrd)
+ tk_call_without_enc(@chart, 'box-and-whiskers',
+ _get_eval_enc_str(series), xcrd, ycrd)
+ self
+ end
+ alias box_whiskers box_and_whiskers
+
+ def vectorconfig(series, key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'vectorconfig',
+ _get_eval_enc_str(series), *hash_kv(key, true))
+ else
+ tk_call(@chart, 'vectorconfig', series, "-#{key}", value)
+ end
+ self
+ end
+
+ def vector(series, xcrd, ycrd, ucmp, vcmp)
+ tk_call_without_enc(@chart, 'vector', _get_eval_enc_str(series),
+ xcrd, ycrd, ucmp, vcmp)
+ self
+ end
+
+ def dotconfig(series, key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'dotconfig',
+ _get_eval_enc_str(series), *hash_kv(key, true))
+ else
+ tk_call(@chart, 'dotconfig', series, "-#{key}", value)
+ end
+ self
+ end
+
+ def dot(series, xcrd, ycrd, value)
+ tk_call_without_enc(@chart, 'dot', _get_eval_enc_str(series),
+ xcrd, ycrd, value)
+ self
+ end
+ end
+
+ ############################
+ class Stripchart < XYPlot
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createStripchart'.freeze
+ ].freeze
+ end
+
+ ############################
+ class TXPlot < XYPlot
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createTXPlot'.freeze
+ ].freeze
+ end
+
+ ############################
+ class XLogYPlot < XYPlot
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createXLogYPlot'.freeze
+ ].freeze
+ end
+
+ ############################
+ class Histogram < XYPlot
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createHistogram'.freeze
+ ].freeze
+ end
+
+ ############################
+ class PolarPlot < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createPolarplot'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] radius_data [, keys])
+ # radius_data := Array of [maximum_radius, stepsize]
+ if args[0].kind_of?(Array)
+ @radius_data = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @radius_data = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@radius_data))
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+
+ def plot(series, radius, angle)
+ tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series),
+ radius, angle)
+ self
+ end
+
+ def dataconfig(series, key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'dataconfig', _get_eval_enc_str(series),
+ *hash_kv(key, true))
+ else
+ tk_call(@chart, 'dataconfig', series, "-#{key}", value)
+ end
+ end
+ end
+ Polarplot = PolarPlot
+
+ ############################
+ class IsometricPlot < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createIsometricPlot'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] xaxis, yaxis, [, step] [, keys])
+ # xaxis := Array of [minimum, maximum]
+ # yaxis := Array of [minimum, maximum]
+ # step := Float of stepsize | "noaxes" | :noaxes
+ if args[0].kind_of?(Array)
+ @xaxis = args.shift
+ @yaxis = args.shift
+
+ if args[0].kind_of?(Hash)
+ @stepsize = :noaxes
+ else
+ @stepsize = args.shift
+ end
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @xaxis = args.shift
+ @yaxis = args.shift
+
+ if args[0].kind_of?(Hash)
+ @stepsize = :noaxes
+ else
+ @stepsize = args.shift
+ end
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis), array2tk_list(@yaxis),
+ @stepsize)
+ end
+ private :_create_chart
+
+ def plot(type, *args)
+ self.__send__("plot_#{type.to_s.tr('-', '_')}", *args)
+ end
+
+ def plot_rectangle(*args) # args := x1, y1, x2, y2, color
+ tk_call_without_enc(@chart, 'plot', 'rectangle', *(args.flatten))
+ self
+ end
+
+ def plot_filled_rectangle(*args) # args := x1, y1, x2, y2, color
+ tk_call_without_enc(@chart, 'plot', 'filled-rectangle', *(args.flatten))
+ self
+ end
+
+ def plot_circle(*args) # args := xc, yc, radius, color
+ tk_call_without_enc(@chart, 'plot', 'circle', *(args.flatten))
+ self
+ end
+
+ def plot_filled_circle(*args) # args := xc, yc, radius, color
+ tk_call_without_enc(@chart, 'plot', 'filled-circle', *(args.flatten))
+ self
+ end
+ end
+ Isometricplot = IsometricPlot
+
+ ############################
+ class Plot3D < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::create3DPlot'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] xaxis, yaxis, zaxis [, keys])
+ # xaxis := Array of [minimum, maximum, stepsize]
+ # yaxis := Array of [minimum, maximum, stepsize]
+ # zaxis := Array of [minimum, maximum, stepsize]
+ if args[0].kind_of?(Array)
+ @xaxis = args.shift
+ @yaxis = args.shift
+ @zaxis = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @xaxis = args.shift
+ @yaxis = args.shift
+ @zaxis = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis),
+ array2tk_list(@yaxis),
+ array2tk_list(@zaxis))
+ end
+ private :_create_chart
+
+ def plot_function(cmd=Proc.new)
+ Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
+ tk_call_without_enc(@chart, 'plotfunc', "#{@path}_#{@chart}")
+ self
+ end
+
+ def plot_funcont(conts, cmd=Proc.new)
+ conts = array2tk_list(conts) if conts.kind_of?(Array)
+ Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
+ tk_call_without_enc(@chart, 'plotfuncont', "#{@path}_#{@chart}", conts)
+ self
+ end
+
+ def grid_size(nxcells, nycells)
+ tk_call_without_enc(@chart, 'gridsize', nxcells, nycells)
+ self
+ end
+
+ def plot_line(dat, color)
+ # dat has to be provided as a 2 level array.
+ # 1st level contains rows, drawn in y-direction,
+ # and each row is an array whose elements are drawn in x-direction,
+ # for the columns.
+ tk_call_without_enc(@chart, 'plotline', dat, color)
+ self
+ end
+
+ def plot_data(dat)
+ # dat has to be provided as a 2 level array.
+ # 1st level contains rows, drawn in y-direction,
+ # and each row is an array whose elements are drawn in x-direction,
+ # for the columns.
+ tk_call_without_enc(@chart, 'plotdata', dat)
+ self
+ end
+
+ def zconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'zconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'zconfig', "-#{key}", value)
+ end
+ self
+ end
+
+ def colour(fill, border)
+ # configure the colours to use for polygon borders and inner area
+ tk_call_without_enc(@chart, 'colour', fill, border)
+ self
+ end
+ alias colours colour
+ alias colors colour
+ alias color colour
+ end
+
+ ############################
+ class Barchart3D < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::create3DBarchart'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] yaxis, nobars [, keys])
+ # yaxis := Array of [minimum, maximum, stepsize]
+ # nobars := number of bars
+ if args[0].kind_of?(Array)
+ @yaxis = args.shift
+ @nobars = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @yaxis = args.shift
+ @nobars = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@yaxis), @nobars)
+ end
+ private :_create_chart
+
+ def plot(label, yvalue, color)
+ tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label),
+ _get_eval_enc_str(yvalue), color)
+ self
+ end
+
+ def config(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'config', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'config', "-#{key}", value)
+ end
+ self
+ end
+ end
+
+ ############################
+ class RibbonChart3D < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::create3DRibbonChart'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] names, yaxis, zaxis [, keys])
+ # names := Array of the series
+ # yaxis := Array of [minimum, maximum, stepsize]
+ # zaxis := Array of [minimum, maximum, stepsize]
+ if args[0].kind_of?(Array)
+ @names = args.shift
+ @yaxis = args.shift
+ @zaxis = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @names = args.shift
+ @yaxis = args.shift
+ @zaxis = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@names),
+ array2tk_list(@yaxis),
+ array2tk_list(@zaxis))
+ end
+ private :_create_chart
+
+ def line(*args) # xypairs, color
+ color = args.pop # last argument is a color
+ xypairs = TkComm.slice_ary(args.flatten, 2) # regenerate xypairs
+ tk_call_without_enc(@chart, 'line', xypairs, color)
+ self
+ end
+
+ def area(*args) # xypairs, color
+ color = args.pop # last argument is a color
+ xypairs = TkComm.slice_ary(args.flatten, 2) # regenerate xypairs
+ tk_call_without_enc(@chart, 'area', xypairs, color)
+ self
+ end
+
+ def zconfig(key, value=None)
+ if key.kind_of?(Hash)
+ tk_call_without_enc(@chart, 'zconfig', *hash_kv(key, true))
+ else
+ tk_call(@chart, 'zconfig',"-#{key}", value)
+ end
+ self
+ end
+ end
+
+
+ ############################
+ class Piechart < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createPiechart'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent] [, keys])
+ if args[0].kind_of?(Tk::Canvas)
+ parent = args.shift
+ @path = parent.path
+ else
+ super(*args) # create canvas widget
+ end
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path)
+ end
+ private :_create_chart
+
+ def plot(*dat) # argument is a list of [label, value]
+ tk_call(@chart, 'plot', dat.flatten)
+ self
+ end
+
+ def colours(*list)
+ tk_call_without_enc(@chart, 'colours', *list)
+ self
+ end
+ alias colors colours
+ end
+
+
+ ############################
+ class Radialchart < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createRadialchart'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] names, scale, style [, keys])
+ # radius_data := Array of [maximum_radius, stepsize]
+ if args[0].kind_of?(Array)
+ @names = args.shift
+ @scale = args.shift
+ @style = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @names = args.shift
+ @scale = args.shift
+ @style = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@names), @scale, @style)
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+
+ def plot(data, color, thickness)
+ tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(data),
+ color, thickness)
+ self
+ end
+
+ def colours(*list)
+ tk_call_without_enc(@chart, 'colours', *list)
+ self
+ end
+ alias colors colours
+ end
+
+ ############################
+ class Barchart < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createBarchart'.freeze
+ ].freeze
+
+ def initialize(*args)
+ # args := ([parent,] xlabels, ylabels [, series] [, keys])
+ # xlabels, ylabels := labels | axis ( depend on normal or horizontal )
+ # labels := Array of [label, label, ...]
+ # (It determines the number of bars that will be plotted per series.)
+ # axis := Array of [minimum, maximum, stepsize]
+ # series := Integer number of data series | 'stacked' | :stacked
+ if args[0].kind_of?(Array)
+ @xlabels = args.shift
+ @ylabels = args.shift
+
+ if args[0].kind_of?(Hash)
+ @series_size = :stacked
+ else
+ @series_size = args.shift
+ end
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @xlabels = args.shift
+ @ylabels = args.shift
+
+ if args[0].kind_of?(Hash)
+ @series_size = :stacked
+ else
+ @series_size = args.shift
+ end
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xlabels), array2tk_list(@ylabels),
+ @series_size)
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+
+ def plot(series, dat, col=None)
+ tk_call(@chart, 'plot', series, dat, col)
+ self
+ end
+
+ def colours(*cols)
+ # set the colours to be used
+ tk_call(@chart, 'colours', *cols)
+ self
+ end
+ alias colour colours
+ alias colors colours
+ alias color colours
+ end
+
+ ############################
+ class HorizontalBarchart < Barchart
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createHorizontalBarchart'.freeze
+ ].freeze
+ end
+
+ ############################
+ class Boxplot < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createBoxplot'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] xaxis, ylabels [, keys])
+ # xaxis := Array of [minimum, maximum, stepsize]
+ # yaxis := List of labels for the y-axis
+ if args[0].kind_of?(Array)
+ @xaxis = args.shift
+ @ylabels = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @xaxis = args.shift
+ @ylabels = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@xaxis), array2tk_list(@ylabels))
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+
+ def plot(label, *values)
+ tk_call(@chart, 'plot', label, values.flatten)
+ self
+ end
+ end
+
+ ############################
+ class RightAxis < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createRightAxis'.freeze
+ ].freeze
+
+ def initialize(*args) # args := ([parent,] yaxis [, keys])
+ # yaxis := Array of [minimum, maximum, stepsize]
+ if args[0].kind_of?(Array)
+ @yaxis = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @yaxis = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ array2tk_list(@yaxis))
+ end
+ private :_create_chart
+
+ def __destroy_hook__
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
+ Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
+ }
+ end
+ end
+
+ ############################
+ class Timechart < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createTimechart'.freeze
+ ].freeze
+
+ def initialize(*args)
+ # args := ([parent,] time_begin, time_end, items [, keys])
+ # time_begin := String of time format (e.g. "1 january 2004")
+ # time_end := String of time format (e.g. "1 january 2004")
+ # items := Expected/maximum number of items
+ # ( This determines the vertical spacing. )
+ if args[0].kind_of?(String)
+ @time_begin = args.shift
+ @time_end = args.shift
+ @items = args.shift
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @time_begin = args.shift
+ @time_end = args.shift
+ @items = args.shift
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call_without_enc(self.class::TkCommandNames[1], @path,
+ @time_begin, @time_end, @items)
+ end
+ private :_create_chart
+
+ def period(txt, time_begin, time_end, col=None)
+ tk_call(@chart, 'period', txt, time_begin, time_end, col)
+ self
+ end
+
+ def milestone(txt, time, col=None)
+ tk_call(@chart, 'milestone', txt, time, col)
+ self
+ end
+
+ def vertline(txt, time)
+ tk_call(@chart, 'vertline', txt, time)
+ self
+ end
+
+ def hscroll=(scr)
+ tk_call_without_enc(@chart, 'hscroll', scr)
+ scr
+ end
+ def hscroll(scr)
+ tk_call_without_enc(@chart, 'hscroll', scr)
+ self
+ end
+
+ def vscroll=(scr)
+ tk_call_without_enc(@chart, 'vscroll', scr)
+ scr
+ end
+ def vscroll(scr)
+ tk_call_without_enc(@chart, 'vscroll', scr)
+ self
+ end
+ end
+
+ ############################
+ class Ganttchart < Tk::Canvas
+ include ChartMethod
+
+ TkCommandNames = [
+ 'canvas'.freeze,
+ '::Plotchart::createGanttchart'.freeze
+ ].freeze
+
+ def initialize(*args)
+ # args := ([parent,] time_begin, time_end, items [, text_width] [, keys])
+ # time_begin := String of time format (e.g. "1 january 2004")
+ # time_end := String of time format (e.g. "1 january 2004")
+ # args := Expected/maximum number of items
+ # ( This determines the vertical spacing. ),
+ # Expected/maximum width of items,
+ # Option Hash ( { key=>value, ... } )
+ if args[0].kind_of?(String)
+ @time_begin = args.shift
+ @time_end = args.shift
+ @args = args
+
+ super(*args) # create canvas widget
+ else
+ parent = args.shift
+
+ @time_begin = args.shift
+ @time_end = args.shift
+ @args = args
+
+ if parent.kind_of?(Tk::Canvas)
+ @path = parent.path
+ else
+ super(parent, *args) # create canvas widget
+ end
+ end
+
+ @chart = _create_chart
+ end
+
+ def _create_chart
+ p self.class::TkCommandNames[1] if $DEBUG
+ tk_call(self.class::TkCommandNames[1], @path,
+ @time_begin, @time_end, *args)
+ end
+ private :_create_chart
+
+ def task(txt, time_begin, time_end, completed=0.0)
+ list(tk_call(@chart, 'task', txt, time_begin, time_end,
+ completed)).collect!{|id|
+ TkcItem.id2obj(self, id)
+ }
+ end
+
+ def milestone(txt, time, col=None)
+ tk_call(@chart, 'milestone', txt, time, col)
+ self
+ end
+
+ def vertline(txt, time)
+ tk_call(@chart, 'vertline', txt, time)
+ self
+ end
+
+ def connect(from_task, to_task)
+ from_task = array2tk_list(from_task) if from_task.kind_of?(Array)
+ to_task = array2tk_list(to_task) if to_task.kind_of?(Array)
+
+ tk_call(@chart, 'connect', from_task, to_task)
+ self
+ end
+
+ def summary(txt, tasks)
+ tasks = array2tk_list(tasks) if tasks.kind_of?(Array)
+ tk_call(@chart, 'summary', tasks)
+ self
+ end
+
+ def color_of_part(keyword, newcolor)
+ tk_call(@chart, 'color', keyword, newcolor)
+ self
+ end
+
+ def font_of_part(keyword, newfont)
+ tk_call(@chart, 'font', keyword, newfont)
+ self
+ end
+
+ def hscroll=(scr)
+ tk_call_without_enc(@chart, 'hscroll', scr)
+ scr
+ end
+ def hscroll(scr)
+ tk_call_without_enc(@chart, 'hscroll', scr)
+ self
+ end
+
+ def vscroll=(scr)
+ tk_call_without_enc(@chart, 'vscroll', scr)
+ scr
+ end
+ def vscroll(scr)
+ tk_call_without_enc(@chart, 'vscroll', scr)
+ self
+ end
+ end
+
+ ############################
+ class PlotSeries < TkObject
+ SeriesID_TBL = TkCore::INTERP.create_table
+
+ (Series_ID = ['series'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+ TkCore::INTERP.init_ip_env{
+ SeriesID_TBL.mutex.synchronize{ SeriesID_TBL.clear }
+ }
+
+ def self.id2obj(chart, id)
+ path = chart.path
+ SeriesID_TBL.mutex.synchronize{
+ if SeriesID_TBL[path]
+ SeriesID_TBL[path][id]? SeriesID_TBL[path][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(chart, keys=nil)
+ @parent = @chart_obj = chart
+ @ppath = @chart_obj.path
+ Series_ID.mutex.synchronize{
+ @path = @series = @id = Series_ID.join(TkCore::INTERP._ip_id_)
+ Series_ID[1].succ!
+ }
+ SeriesID_TBL.mutex.synchronize{
+ SeriesID_TBL[@ppath] ||= {}
+ SeriesID_TBL[@ppath][@id] = self
+ }
+ dataconfig(keys) if keys.kind_of?(Hash)
+ end
+
+ def plot(*args)
+ @chart_obj.plot(@series, *args)
+ end
+
+ def dataconfig(key, value=None)
+ @chart_obj.dataconfig(@series, key, value)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/ruler.rb b/ext/tk/lib/tkextlib/tcllib/ruler.rb
new file mode 100644
index 0000000000..d22dafa053
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/ruler.rb
@@ -0,0 +1,65 @@
+#
+# tkextlib/tcllib/ruler.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * ruler widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::ruler', '1.0')
+TkPackage.require('widget::ruler')
+
+module Tk::Tcllib
+ module Widget
+ class Ruler < TkWindow
+ PACKAGE_NAME = 'widget::ruler'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::ruler')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::Widget::Ruler
+ TkCommandNames = ['::widget::ruler'.freeze].freeze
+
+ def __boolval_optkeys
+ ['showvalues', 'outline', 'grid']
+ end
+ private :__boolval_optkeys
+
+ def __numlistval_optkeys
+ ['interval', 'sizes']
+ end
+ private :__numlistval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def redraw
+ tk_send('redraw')
+ self
+ end
+
+ def shade(org, dest, frac)
+ tk_send('shade', org, dest, frac)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/screenruler.rb b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
new file mode 100644
index 0000000000..75fa36b66d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/screenruler.rb
@@ -0,0 +1,68 @@
+#
+# tkextlib/tcllib/screenruler.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * screenruler dialog
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::screenruler', '1.1')
+TkPackage.require('widget::screenruler')
+
+module Tk::Tcllib
+ module Widget
+ class ScreenRuler < TkWindow
+ PACKAGE_NAME = 'widget::ruler'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::screenruler')
+ rescue
+ ''
+ end
+ end
+ end
+ Screenruler = ScreenRuler
+ end
+end
+
+class Tk::Tcllib::Widget::ScreenRuler
+ TkCommandNames = ['::widget::screenruler'.freeze].freeze
+
+ def __boolval_optkeys
+ ['topmost', 'reflect']
+ end
+ private :__boolval_optkeys
+
+ def __numlistval_optkeys
+ ['alpha']
+ end
+ private :__numlistval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def display
+ tk_send('display')
+ self
+ end
+ alias show display
+
+ def hide
+ tk_send('hide')
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb b/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
new file mode 100644
index 0000000000..c9488b4686
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb
@@ -0,0 +1,57 @@
+#
+# tkextlib/tcllib/scrolledwindow.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * scrolledwindow widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::scrolledwindow', '1.2')
+TkPackage.require('widget::scrolledwindow')
+
+module Tk::Tcllib
+ module Widget
+ class Scrolledwindow < Tk::Tile::TFrame
+ PACKAGE_NAME = 'widget::scrolledwindow'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::scrolledwindow')
+ rescue
+ ''
+ end
+ end
+ end
+ ScrolledWindow = Scrolledwindow
+ end
+end
+
+class Tk::Tcllib::Widget::ScrolledWindow
+ TkCommandNames = ['::widget::scrolledwindow'.freeze].freeze
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def getframe
+ window(tk_send_without_enc('getframe'))
+ end
+ alias get_frame getframe
+
+ def setwidget(w)
+ window(tk_send_without_enc('setwidget', w))
+ end
+ alias set_widget setwidget
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/scrollwin.rb b/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
new file mode 100644
index 0000000000..c9f6062fef
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/scrollwin.rb
@@ -0,0 +1,61 @@
+#
+# tkextlib/tcllib/scrollwin.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Scrolled widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::scrolledwindow', '1.0')
+TkPackage.require('widget::scrolledwindow')
+
+module Tk::Tcllib
+ module Widget
+ class ScrolledWindow < TkWindow
+ PACKAGE_NAME = 'widget::scrolledwindow'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::scrolledwindow')
+ rescue
+ ''
+ end
+ end
+ end
+ Scrolledwindow = ScrolledWindow
+ end
+end
+
+class Tk::Tcllib::Widget::ScrolledWindow
+ TkCommandNames = ['::widget::scrolledwindow'.freeze].freeze
+
+ def __numlistval_optkeys
+ ['ipad']
+ end
+ private :__numlistval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def get_frame
+ window(tk_send('getframe'))
+ end
+
+ def set_widget(widget)
+ tk_send('setwidget', widget)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/setup.rb b/ext/tk/lib/tkextlib/tcllib/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tcllib/statusbar.rb b/ext/tk/lib/tkextlib/tcllib/statusbar.rb
new file mode 100644
index 0000000000..46a4b9d8b6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/statusbar.rb
@@ -0,0 +1,79 @@
+#
+# tkextlib/tcllib/statusbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * statusbar widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::statusbar', '1.2')
+TkPackage.require('widget::statusbar')
+
+module Tk::Tcllib
+ module Widget
+ class Statusbar < Tk::Tile::TFrame
+ PACKAGE_NAME = 'widget::statusbar'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::statusbar')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class Tk::Tcllib::Widget::Statusbar
+ TkCommandNames = ['::widget::statusbar'.freeze].freeze
+
+ def __boolval_optkeys
+ super() << 'separator' << 'resize' << 'resizeseparator'
+ end
+ private :__boolval_optkeys
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def getframe
+ window(tk_send_without_enc('getframe'))
+ end
+ alias get_frame getframe
+
+ def add(w, keys={})
+ window(tk_send_without_enc('setwidget', *(hash_kv(keys))))
+ end
+
+ def remove(*wins)
+ tk_send_without_enc('remove', *wins)
+ self
+ end
+
+ def remove_with_destroy(*wins)
+ tk_send_without_enc('remove', '-destroy', *wins)
+ self
+ end
+
+ def delete(*wins)
+ tk_send_without_enc('delete', *wins)
+ self
+ end
+
+ def items(pat=None)
+ tk_split_list(tk_send('items', pat))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/style.rb b/ext/tk/lib/tkextlib/tcllib/style.rb
new file mode 100644
index 0000000000..dac6916e46
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/style.rb
@@ -0,0 +1,61 @@
+#
+# tkextlib/tcllib/style.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * select and use some 'style' of option (resource) DB
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+module Tk::Tcllib
+ module Style
+ PACKAGE_NAME = 'style'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('style')
+ rescue
+ ''
+ end
+ end
+
+ def self.not_available
+ fail RuntimeError, "'tkextlib/tcllib/style' extension is not available on your current environment."
+ end
+
+ def self.names
+ Tk::Tcllib::Style.not_available
+ end
+
+ def self.use(style)
+ Tk::Tcllib::Style.not_available
+ end
+ end
+end
+
+# TkPackage.require('style', '0.1')
+# TkPackage.require('style', '0.3')
+TkPackage.require('style')
+
+module Tk::Tcllib
+ class << Style
+ undef not_available
+ end
+
+ module Style
+ extend TkCore
+
+ def self.names
+ tk_split_simplelist(tk_call('style::names'))
+ end
+
+ def self.use(style)
+ tk_call('style::use', style)
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/superframe.rb b/ext/tk/lib/tkextlib/tcllib/superframe.rb
new file mode 100644
index 0000000000..adc9c4adbd
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/superframe.rb
@@ -0,0 +1,51 @@
+#
+# tkextlib/tcllib/superframe.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Superframe widget - enhanced labelframe widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::superframe', '1.0')
+TkPackage.require('widget::superframe')
+
+module Tk::Tcllib
+ module Widget
+ class SuperFrame < TkWindow
+ PACKAGE_NAME = 'widget::superframe'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::superframe')
+ rescue
+ ''
+ end
+ end
+ end
+ Superframe = SuperlFrame
+ end
+end
+
+class Tk::Tcllib::Widget::SuperFrame
+ TkCommandNames = ['::widget::superframe'.freeze].freeze
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def labelwidget
+ window(tk_send('labelwidget'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/swaplist.rb b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
new file mode 100644
index 0000000000..7698640534
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/swaplist.rb
@@ -0,0 +1,150 @@
+#
+# tkextlib/tcllib/swaplist.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * A dialog which allows a user to move options between two lists
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('swaplist', '0.1')
+TkPackage.require('swaplist')
+
+module Tk::Tcllib
+ class Swaplist_Dialog < TkWindow
+ PACKAGE_NAME = 'swaplist'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('swaplist')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+
+class Tk::Tcllib::Swaplist_Dialog
+ TkCommandNames = ['::swaplist::swaplist'.freeze].freeze
+ WidgetClassName = 'Swaplist'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.show(*args)
+ dialog = self.new(*args)
+ dialog.show
+ [dialog.status, dialog.value]
+ end
+ def self.display(*args)
+ self.show(*args)
+ end
+
+ def initialize(*args)
+ # args = (parent=nil, complete_list=[], selected_list=[], keys=nil)
+ keys = args.pop
+ if keys.kind_of?(Hash)
+ @selected_list = args.pop
+ @complete_list = args.pop
+ @keys = _symbolkey2str(keys)
+ args.push(keys)
+ else
+ @selected_list = keys
+ @complete_list = args.pop
+ @keys = {}
+ end
+
+ @selected_list = [] unless @selected_list
+ @complete_list = [] unless @complete_list
+
+ @variable = TkVariable.new
+ @status = nil
+
+ super(*args)
+ end
+
+ def create_self(keys)
+ # dummy
+ end
+ private :create_self
+
+ def show
+ @variable.value = ''
+ @status = bool(tk_call(self.class::TkCommandNames[0],
+ @path, @variable,
+ @complete_list, @selected_list,
+ *hash_kv(@keys)))
+ end
+ alias display show
+
+ def status
+ @status
+ end
+
+ def value
+ @variable.list
+ end
+ alias selected value
+
+ def cget_strict(slot)
+ slot = slot.to_s
+ if slot == 'complete_list'
+ @complete_list
+ elsif slot == 'selected_list'
+ @selected_list
+ else
+ @keys[slot]
+ end
+ end
+ def cget(slot)
+ cget_strict(slot)
+ end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot.each{|k, v| configure(k, v)}
+ else
+ slot = slot.to_s
+ value = _symbolkey2str(value) if value.kind_of?(Hash)
+ if value && value != None
+ if slot == 'complete_list'
+ @complete_list = value
+ elsif slot == 'selected_list'
+ @selected_list = value
+ else
+ @keys[slot] = value
+ end
+ else
+ if slot == 'complete_list'
+ @complete_list = []
+ elsif slot == 'selected_list'
+ @selected_list = []
+ else
+ @keys.delete(slot)
+ end
+ end
+ end
+ self
+ end
+
+ def configinfo(slot = nil)
+ if slot
+ slot = slot.to_s
+ if slot == 'complete_list'
+ [ slot, nil, nil, nil, @complete_list ]
+ elsif slot == 'selected_list'
+ [ slot, nil, nil, nil, @selected_list ]
+ else
+ [ slot, nil, nil, nil, @keys[slot] ]
+ end
+ else
+ @keys.collect{|k, v| [ k, nil, nil, nil, v ] } \
+ << [ 'complete_list', nil, nil, nil, @complete_list ] \
+ << [ 'selected_list', nil, nil, nil, @selected_list ]
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist.rb b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
new file mode 100644
index 0000000000..bf5ab6620a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist.rb
@@ -0,0 +1,28 @@
+#
+# tkextlib/tcllib/tablelist.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * A multi-column listbox
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# check Tile extension :: If already loaded, use tablelist_tile.
+unless defined? Tk::Tcllib::Tablelist_usingTile
+ Tk::Tcllib::Tablelist_usingTile =
+ TkPackage.provide('tile') || TkPackage.provide('Ttk')
+end
+
+if Tk::Tcllib::Tablelist_usingTile
+ # with Tile
+ require 'tkextlib/tcllib/tablelist_tile'
+
+else
+ # without Tile
+
+ # TkPackage.require('tablelist', '4.2')
+ TkPackage.require('tablelist')
+
+ require 'tkextlib/tcllib/tablelist_core'
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
new file mode 100644
index 0000000000..2a5c415cc7
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb
@@ -0,0 +1,1072 @@
+#
+# tkextlib/tcllib/tablelist_core.rb
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * This file is required by 'tkextlib/tcllib/tablelist.rb' or
+# 'tkextlib/tcllib/tablelist_tile.rb'.
+#
+
+module Tk
+ module Tcllib
+ class Tablelist < TkWindow
+ if Tk::Tcllib::Tablelist_usingTile
+ PACKAGE_NAME = 'Tablelist_tile'.freeze
+ else
+ PACKAGE_NAME = 'Tablelist'.freeze
+ end
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require(self.package_name)
+ rescue
+ ''
+ end
+ end
+
+ def self.use_Tile?
+ (Tk::Tcllib::Tablelist_usingTile)? true: false
+ end
+ end
+ TableList = Tablelist
+ end
+end
+
+module Tk::Tcllib::TablelistItemConfig
+ include TkItemConfigMethod
+
+ def _to_idx(idx)
+ if idx.kind_of?(Array)
+ idx.collect{|elem| _get_eval_string(elem)}.join(',')
+ else
+ idx
+ end
+ end
+ def _from_idx(idx)
+ return idx unless idx.kind_of?(String)
+
+ if idx[0] == ?@ # '@x,y'
+ idx
+ elsif idx =~ /([^,]+),([^,]+)/
+ row = $1, column = $2
+ [num_or_str(row), num_or_str(column)]
+ else
+ num_or_str(idx)
+ end
+ end
+ private :_to_idx, :_from_idx
+
+ def __item_cget_cmd(mixed_id)
+ [self.path, mixed_id[0] + 'cget', _to_idx(mixed_id[1])]
+ end
+ def __item_config_cmd(mixed_id)
+ [self.path, mixed_id[0] + 'configure', _to_idx(mixed_id[1])]
+ end
+
+ def cell_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['cell', tagOrId], option)
+ end
+ def cell_cget(tagOrId, option)
+ itemcget(['cell', tagOrId], option)
+ end
+ def cell_cget_strict(tagOrId, option)
+ itemcget_strict(['cell', tagOrId], option)
+ end
+ def cell_configure(tagOrId, slot, value=None)
+ itemconfigure(['cell', tagOrId], slot, value)
+ end
+ def cell_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['cell', tagOrId], slot)
+ end
+ def current_cell_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['cell', tagOrId], slot)
+ end
+ alias cellcget_tkstring cell_cget_tkstring
+ alias cellcget cell_cget
+ alias cellcget_strict cell_cget_strict
+ alias cellconfigure cell_configure
+ alias cellconfiginfo cell_configinfo
+ alias current_cellconfiginfo current_cell_configinfo
+
+ def column_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['column', tagOrId], option)
+ end
+ def column_cget(tagOrId, option)
+ itemcget(['column', tagOrId], option)
+ end
+ def column_cget_strict(tagOrId, option)
+ itemcget_strict(['column', tagOrId], option)
+ end
+ def column_configure(tagOrId, slot, value=None)
+ itemconfigure(['column', tagOrId], slot, value)
+ end
+ def column_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['column', tagOrId], slot)
+ end
+ def current_column_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['column', tagOrId], slot)
+ end
+ alias columncget_tkstring column_cget_tkstring
+ alias columncget column_cget
+ alias columncget_strict column_cget_strict
+ alias columnconfigure column_configure
+ alias columnconfiginfo column_configinfo
+ alias current_columnconfiginfo current_column_configinfo
+
+ def row_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['row', tagOrId], option)
+ end
+ def row_cget(tagOrId, option)
+ itemcget(['row', tagOrId], option)
+ end
+ def row_cget_strict(tagOrId, option)
+ itemcget_strict(['row', tagOrId], option)
+ end
+ def row_configure(tagOrId, slot, value=None)
+ itemconfigure(['row', tagOrId], slot, value)
+ end
+ def row_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['row', tagOrId], slot)
+ end
+ def current_row_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['row', tagOrId], slot)
+ end
+ alias rowcget_tkstring row_cget_tkstring
+ alias rowcget row_cget
+ alias rowcget_strict row_cget_strict
+ alias rowconfigure row_configure
+ alias rowconfiginfo row_configinfo
+ alias current_rowconfiginfo current_row_configinfo
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+class Tk::Tcllib::Tablelist
+ include Tk::Tcllib::TablelistItemConfig
+ include Scrollable
+
+ TkCommandNames = ['::tablelist::tablelist'.freeze].freeze
+ WidgetClassName = 'Tablelist'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ ##########################
+
+ def __numval_optkeys
+ super() + ['titlecolumns']
+ end
+ private :__numval_optkeys
+
+ def __strval_optkeys
+ super() + ['snipstring']
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ super() - ['takefocus'] + [
+ 'forceeditendcommand', 'movablecolumns', 'movablerows',
+ 'protecttitlecolumns', 'resizablecolumns', 'setfocus',
+ 'showarrow', 'showlabels', 'showseparators'
+ ]
+ end
+ private :__boolval_optkeys
+
+ def __listval_optkeys
+ super() + ['columns', 'columntitles']
+ end
+ private :__listval_optkeys
+
+ def __tkvariable_optkeys
+ super() + ['listvariable']
+ end
+ private :__tkvariable_optkeys
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ # The method is used to convert a opt-value to a ruby's object.
+ # When get the value of the option "key", "proc.call(value)" is called.
+ super().update('stretch'=>proc{|v|
+ (v == 'all')? v: simplelist(v)
+ },
+ 'takefocus'=>proc{|v|
+ case v
+ when '1'
+ true
+ when '0'
+ false
+ when ''
+ nil
+ else # cmd
+ tk_tcl2ruby(cmd)
+ end
+ })
+ end
+ private :__val2ruby_optkeys
+
+ def __ruby2val_optkeys # { key=>proc, ... }
+ # The method is used to convert a ruby's object to a opt-value.
+ # When set the value of the option "key", "proc.call(value)" is called.
+ # That is, "-#{key} #{proc.call(value)}".
+ super().update('stretch'=>proc{|v|
+ (v.kind_of?(Array))? v.collect{|e| _to_idx(e)}: v
+ },
+ 'takefocus'=>proc{|v|
+ case v
+ when true
+ '1'
+ when false
+ '0'
+ when nil
+ ''
+ else
+ _get_eval_string(v)
+ end
+ })
+ end
+ private :__ruby2val_optkeys
+
+ def __font_optkeys
+ super() + ['labelfont']
+ end
+ private :__font_optkeys
+
+ ##########################
+
+ def __item_strval_optkeys(id)
+ if id[0] == 'cell'
+ super(id) + ['title']
+ else
+ super(id) - ['text'] + ['title', 'name']
+ end
+ end
+ private :__item_strval_optkeys
+
+ def __item_boolval_optkeys(id)
+ super(id) + [
+ 'changesnipside', 'editable', 'hide', 'resizable', 'selectable',
+ 'showarrow', 'showlinenumbers', 'stretchable', 'stretchwindow', 'wrap'
+ ]
+ end
+ private :__item_boolval_optkeys
+
+ def __item_listval_optkeys(id)
+ if id[0] == 'cell'
+ super(id)
+ else
+ super(id) + ['text']
+ end
+ end
+ private :__item_listval_optkeys
+
+ def __item_font_optkeys(id)
+ # maybe need to override
+ super(id) + ['labelfont']
+ end
+ private :__item_font_optkeys
+
+ ##########################
+
+ def activate(index)
+ tk_send('activate', _to_idx(index))
+ self
+ end
+
+ def activate_cell(index)
+ tk_send('activatecell', _to_idx(index))
+ self
+ end
+ alias activatecell activate_cell
+
+ def get_attrib(name=nil)
+ if name && name != None
+ tk_send('attrib', name)
+ else
+ ret = []
+ lst = simplelist(tk_send('attrib'))
+ until lst.empty?
+ ret << ( [lst.shift] << lst.shift )
+ end
+ ret
+ end
+ end
+ def set_attrib(*args)
+ tk_send('attrib', *(args.flatten))
+ self
+ end
+
+ def bbox(index)
+ list(tk_send('bbox', _to_idx(index)))
+ end
+
+ def bodypath
+ window(tk_send('bodypath'))
+ end
+
+ def bodytag
+ TkBindTag.new_by_name(tk_send('bodytag'))
+ end
+
+ def cancel_editing
+ tk_send('cancelediting')
+ self
+ end
+ alias cancelediting cancel_editing
+
+ def get_cellattrib(name=nil)
+ if name && name != None
+ tk_send('cellattrib', name)
+ else
+ ret = []
+ lst = simplelist(tk_send('cellattrib'))
+ until lst.empty?
+ ret << ( [lst.shift] << lst.shift )
+ end
+ ret
+ end
+ end
+ def set_cellattrib(*args)
+ tk_send('cellattrib', *(args.flatten))
+ self
+ end
+
+ def cellindex(idx)
+ _from_idx(tk_send('cellindex', _to_idx(idx)))
+ end
+
+ def cellselection_anchor(idx)
+ tk_send('cellselection', 'anchor', _to_idx(idx))
+ self
+ end
+
+ def cellselection_clear(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('cellselection', 'clear', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('cellselection', 'clear', first, last)
+ end
+ self
+ end
+
+ def cellselection_includes(idx)
+ bool(tk_send('cellselection', 'includes', _to_idx(idx)))
+ end
+
+ def cellselection_set(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('cellselection', 'set', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('cellselection', 'set', first, last)
+ end
+ self
+ end
+
+ def get_columnattrib(name=nil)
+ if name && name != None
+ tk_send('columnattrib', name)
+ else
+ ret = []
+ lst = simplelist(tk_send('columnattrib'))
+ until lst.empty?
+ ret << ( [lst.shift] << lst.shift )
+ end
+ ret
+ end
+ end
+ def set_columnattrib(*args)
+ tk_send('columnattrib', *(args.flatten))
+ self
+ end
+
+ def columncount
+ number(tk_send('columncount'))
+ end
+
+ def columnindex(idx)
+ number(tk_send('columnindex', _to_idx(idx)))
+ end
+
+ def columnwidth(idx, opt=nil)
+ if opt
+ number(tk_send('columnwidth', _to_idx(idx), "-#{opt}"))
+ else
+ number(tk_send('columnwidth', _to_idx(idx)))
+ end
+ end
+ def requested_columnwidth(idx)
+ columnwidth(idx, 'requested')
+ end
+ def stretched_columnwidth(idx)
+ columnwidth(idx, 'stretched')
+ end
+ def total_columnwidth(idx)
+ columnwidth(idx, 'total')
+ end
+
+ def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
+ ary = []
+ lst.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configcelllist', ary)
+ self
+ end
+ alias config_celllist configcelllist
+
+ def configcells(*args) # args ==> idx, opt, val, idx, opt, val, ...
+ ary = []
+ args.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configcells', *ary)
+ self
+ end
+ alias config_cells configcells
+
+ def configcolumnlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
+ ary = []
+ lst.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configcolumnlist', ary)
+ self
+ end
+ alias config_columnlist configcolumnlist
+
+ def configcolumns(*args) # args ==> idx, opt, val, idx, opt, val, ...
+ ary = []
+ args.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configcolumns', *ary)
+ self
+ end
+ alias config_columns configcolumns
+
+ def configrowlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
+ ary = []
+ lst.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configrowlist', ary)
+ self
+ end
+ alias config_rowlist configrowlist
+
+ def configrows(*args) # args ==> idx, opt, val, idx, opt, val, ...
+ ary = []
+ args.slice(3){|idx, opt, val|
+ ary << _to_idx(idx) << "-#{opt}" << val
+ }
+ tk_send('configrows', *ary)
+ self
+ end
+ alias config_rows configrows
+
+ def containing(y)
+ idx = num_or_str(tk_send('containing', y))
+ (idx.kind_of?(Fixnum) && idx < 0)? nil: idx
+ end
+
+ def containing_cell(x, y)
+ idx = _from_idx(tk_send('containingcell', x, y))
+ if idx.kind_of?(Array)
+ [
+ ((idx[0].kind_of?(Fixnum) && idx[0] < 0)? nil: idx[0]),
+ ((idx[1].kind_of?(Fixnum) && idx[1] < 0)? nil: idx[1])
+ ]
+ else
+ idx
+ end
+ end
+ alias containingcell containing_cell
+
+ def containing_column(x)
+ idx = num_or_str(tk_send('containingcolumn', x))
+ (idx.kind_of?(Fixnum) && idx < 0)? nil: idx
+ end
+ alias containingcolumn containing_column
+
+ def curcellselection
+ simplelist(tk_send('curcellselection')).collect!{|idx| _from_idx(idx)}
+ end
+
+ def curselection
+ list(tk_send('curselection'))
+ end
+
+ def delete_items(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('delete', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('delete', first, last)
+ end
+ self
+ end
+ alias delete delete_items
+ alias deleteitems delete_items
+
+ def delete_columns(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('deletecolumns', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('deletecolumns', first, last)
+ end
+ self
+ end
+ alias deletecolumns delete_columns
+
+ def edit_cell(idx)
+ tk_send('editcell', _to_idx(idx))
+ self
+ end
+ alias editcell edit_cell
+
+ def editwintag
+ TkBindTag.new_by_name(tk_send('editwintag'))
+ end
+
+ def editwinpath
+ window(tk_send('editwinpath'))
+ end
+
+ def entrypath
+ window(tk_send('entrypath'))
+ end
+
+ def fill_column(idx, txt)
+ tk_send('fillcolumn', _to_idx(idx), txt)
+ self
+ end
+ alias fillcolumn fill_column
+
+ def finish_editing
+ tk_send('finishediting')
+ self
+ end
+ alias finishediting finish_editing
+
+ def formatinfo
+ key, row, col = simplelist(tk_send('formatinfo'))
+ [key, number(row), number(col)]
+ end
+
+ def get(first, last=nil)
+ if first.kind_of?(Array)
+ simplelist(tk_send('get', first.collect{|idx| _to_idx(idx)})).collect!{|elem| simplelist(elem) }
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ simplelist(tk_send('get', first, last))
+ end
+ end
+
+ def get_cells(first, last=nil)
+ if first.kind_of?(Array)
+ simplelist(tk_send('getcells', first.collect{|idx| _to_idx(idx)})).collect!{|elem| simplelist(elem) }
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ simplelist(tk_send('getcells', first, last))
+ end
+ end
+ alias getcells get_cells
+
+ def get_columns(first, last=nil)
+ if first.kind_of?(Array)
+ simplelist(tk_send('getcolumns', first.collect{|idx| _to_idx(idx)})).collect!{|elem| simplelist(elem) }
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ simplelist(tk_send('getcolumns', first, last))
+ end
+ end
+ alias getcolumns get_columns
+
+ def get_keys(first, last=nil)
+ if first.kind_of?(Array)
+ simplelist(tk_send('getkeys', first.collect{|idx| _to_idx(idx)})).collect!{|elem| simplelist(elem) }
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ simplelist(tk_send('getkeys', first, last))
+ end
+ end
+ alias getkeys get_keys
+
+ def has_attrib?(name)
+ bool(tk_send('hasattrib', name))
+ end
+
+ def has_cellattrib?(idx, name)
+ bool(tk_send('hascellattrib', _to_idx(idx), name))
+ end
+
+ def has_columnattrib?(idx, name)
+ bool(tk_send('hascolumnattrib', _to_idx(idx), name))
+ end
+
+ def has_rowattrib?(idx, name)
+ bool(tk_send('hasrowattrib', _to_idx(idx), name))
+ end
+
+ def imagelabelpath(idx)
+ window(tk_send('imagelabelpath', _to_idx(idx)))
+ end
+
+ def index(idx)
+ number(tk_send('index', _to_idx(idx)))
+ end
+
+ def insert(idx, *items)
+ tk_send('insert', _to_idx(idx), *items)
+ self
+ end
+
+ def insert_columnlist(idx, columnlist)
+ tk_send('insertcolumnlist', _to_idx(idx), columnlist)
+ self
+ end
+ alias insertcolumnlist insert_columnlist
+
+ def insert_columns(idx, *args)
+ tk_send('insertcolums', _to_idx(idx), *args)
+ self
+ end
+ alias insertcolumns insert_columns
+
+ def insert_list(idx, list)
+ tk_send('insertlist', _to_idx(idx), list)
+ self
+ end
+ alias insertlist insert_list
+
+ def is_elem_snipped?(cellidx, tkvar)
+ bool(tk_send('iselemsnipped', _to_idx(cellidx), tkvar))
+ end
+ alias elem_snipped? is_elem_snipped?
+
+ def is_title_snipped?(colidx, tkvar)
+ bool(tk_send('istitlesnipped', _to_idx(colidx), tkvar))
+ end
+ alias title_snipped? is_title_snipped?
+
+ def itemlistvar
+ TkVarAccess.new(tk_send('itemlistvar'))
+ end
+
+ def labelpath(idx)
+ window(tk_send('labelpath', _to_idx(idx)))
+ end
+
+ def labels
+ simplelist(tk_send('labels'))
+ end
+
+ def labeltag
+ TkBindTag.new_by_name(tk_send('labeltag'))
+ end
+
+ def move(src, target)
+ tk_send('move', _to_idx(src), _to_idx(target))
+ self
+ end
+
+ def move_column(src, target)
+ tk_send('movecolumn', _to_idx(src), _to_idx(target))
+ self
+ end
+ alias movecolumn move_column
+
+ def nearest(y)
+ _from_idx(tk_send('nearest', y))
+ end
+
+ def nearest_cell(x, y)
+ _from_idx(tk_send('nearestcell', x, y))
+ end
+ alias nearestcell nearest_cell
+
+ def nearest_column(x)
+ _from_idx(tk_send('nearestcolumn', x))
+ end
+ alias nearestcolumn nearest_column
+
+ def reject_input
+ tk_send('rejectinput')
+ self
+ end
+ alias rejectinput reject_input
+
+ def reset_sortinfo
+ tk_send('resetsortinfo')
+ self
+ end
+ alias resetsortinfo reset_sortinfo
+
+ def get_rowattrib(name=nil)
+ if name && name != None
+ tk_send('rowattrib', name)
+ else
+ ret = []
+ lst = simplelist(tk_send('rowattrib'))
+ until lst.empty?
+ ret << ( [lst.shift] << lst.shift )
+ end
+ ret
+ end
+ end
+ def set_rowattrib(*args)
+ tk_send('rowattrib', *(args.flatten))
+ self
+ end
+
+ def scan_mark(x, y)
+ tk_send('scan', 'mark', x, y)
+ self
+ end
+
+ def scan_dragto(x, y)
+ tk_send('scan', 'dragto', x, y)
+ self
+ end
+
+ def see(idx)
+ tk_send('see', _to_idx(idx))
+ self
+ end
+
+ def see_cell(idx)
+ tk_send('seecell', _to_idx(idx))
+ self
+ end
+ alias seecell see_cell
+
+ def see_column(idx)
+ tk_send('seecolumn', _to_idx(idx))
+ self
+ end
+ alias seecolumn see_column
+
+ def selection_anchor(idx)
+ tk_send('selection', 'anchor', _to_idx(idx))
+ self
+ end
+
+ def selection_clear(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('selection', 'clear', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('selection', 'clear', first, last)
+ end
+ self
+ end
+
+ def selection_includes(idx)
+ bool(tk_send('selection', 'includes', _to_idx(idx)))
+ end
+
+ def selection_set(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('selection', 'set', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('selection', 'set', first, last)
+ end
+ self
+ end
+
+ def separatorpath(idx=nil)
+ if idx
+ window(tk_send('separatorpath', _to_idx(idx)))
+ else
+ window(tk_send('separatorpath'))
+ end
+ end
+
+ def separators
+ simplelist(tk_send('separators')).collect!{|w| window(w)}
+ end
+
+ def size
+ number(tk_send('size'))
+ end
+
+ def sort(order=nil)
+ if order
+ order = order.to_s
+ order = '-' << order if order[0] != ?-
+ if order.length < 2
+ order = nil
+ end
+ end
+ if order
+ tk_send('sort', order)
+ else
+ tk_send('sort')
+ end
+ self
+ end
+ def sort_increasing
+ tk_send('sort', '-increasing')
+ self
+ end
+ def sort_decreasing
+ tk_send('sort', '-decreasing')
+ self
+ end
+
+
+ # default of 'labelcommand' option
+ DEFAULT_labelcommand_value =
+ DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn'
+
+ # default of 'labelcommand2' option
+ DEFAULT_labelcommand2_value =
+ DEFAULT_addToSortColumns_cmd = '::tablelist::addToSortColumns'
+
+ def sortByColumn_with_event_generate(idx)
+ tk_call('::tablelist::sortByColumn', @path, _to_idx(idx))
+ end
+
+ def addToSortColumns_with_event_generate(idx)
+ tk_call('::tablelist::addToSortColumns', @path, _to_idx(idx))
+ end
+
+ def sort_by_column(idx, order=nil)
+ if order
+ order = order.to_s
+ order = '-' << order if order[0] != ?-
+ if order.length < 2
+ order = nil
+ end
+ end
+ if order
+ tk_send('sortbycolumn', _to_idx(idx), order)
+ else
+ tk_send('sortbycolumn', _to_idx(idx))
+ end
+ self
+ end
+ def sort_by_column_increasing(idx)
+ tk_send('sortbycolumn', _to_idx(idx), '-increasing')
+ self
+ end
+ def sort_by_column_decreasing(idx)
+ tk_send('sortbycolumn', _to_idx(idx), '-decreasing')
+ self
+ end
+
+ def sort_by_columnlist(idxlist, orderlist=None)
+ # orderlist :: list of 'increasing' or 'decreasing'
+ tk_send('sortbycolumnlist', idxlist.map{|idx| _to_idx(idx)}, orderlist)
+ self
+ end
+
+ def sortcolumn
+ idx = num_or_str(tk_send('sortcolum'))
+ (idx.kind_of?(Fixnum) && idx < 0)? nil: idx
+ end
+
+ def sortcolumnlist
+ simplelist(tk_send('sortcolumlist')).map{|col| num_or_str(col)}
+ end
+
+ def sortorder
+ tk_send('sortorder')
+ end
+
+ def sortorderlist
+ simplelist(tk_send('sortorderlist'))
+ end
+
+ def toggle_columnhide(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('togglecolumnhide', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('togglecolumnhide', first, last)
+ end
+ end
+
+ def toggle_rowhide(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('togglerowhide', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('togglerowhide', first, last)
+ end
+ end
+
+ def toggle_visibility(first, last=nil)
+ if first.kind_of?(Array)
+ tk_send('togglevisibility', first.collect{|idx| _to_idx(idx)})
+ else
+ first = _to_idx(first)
+ last = (last)? _to_idx(last): first
+ tk_send('togglevisibility', first, last)
+ end
+ self
+ end
+ alias togglevisibility toggle_visibility
+
+ def unset_attrib(name)
+ tk_send('unsetattrib', name)
+ self
+ end
+
+ def unset_cellattrib(idx, name)
+ tk_send('unsetcellattrib', _to_idx(idx), name)
+ self
+ end
+
+ def unset_columnattrib(idx, name)
+ tk_send('unsetcolumnattrib', _to_idx(idx), name)
+ self
+ end
+
+ def unset_rowattrib(idx, name)
+ tk_send('unsetrowattrib', _to_idx(idx), name)
+ self
+ end
+
+ def windowpath(idx)
+ window(tk_send('windowpath', _to_idx(idx)))
+ end
+end
+
+class << Tk::Tcllib::Tablelist
+ ############################################################
+ # helper commands
+ def getTablelistPath(descendant)
+ window(Tk.tk_call('::tablelist::getTablelistPath', descendant))
+ end
+
+ def getTablelistColumn(descendant)
+ num_or_str(Tk.tk_call('::tablelist::getTablelistColumn', headerlabel))
+ end
+
+
+ def convEventFields(descendant, x, y)
+ window(Tk.tk_call('::tablelist::convEventFields', descendant, x, y))
+ end
+
+
+ ############################################################
+ # with the BWidget package
+ def addBWidgetEntry(name=None)
+ Tk.tk_call('::tablelist::addBWidgetEntry', name)
+ end
+
+ def addBWidgetSpinBox(name=None)
+ Tk.tk_call('::tablelist::addBWidgetSpinBox', name)
+ end
+
+ def addBWidgetComboBox(name=None)
+ Tk.tk_call('::tablelist::addBWidgetComboBox', name)
+ end
+
+
+ ############################################################
+ # with the Iwidgets ([incr Widgets]) package
+ def addIncrEntryfield(name=None)
+ Tk.tk_call('::tablelist::addIncrEntry', name)
+ end
+
+ def addIncrDateTimeWidget(type, seconds=false, name=None)
+ # type := 'datefield'|'dateentry'|timefield'|'timeentry'
+ if seconds && seconds != None
+ seconds = '-seconds'
+ else
+ seconds = None
+ end
+ Tk.tk_call('::tablelist::addDateTimeWidget', type, seconds, name)
+ end
+
+ def addIncrSpinner(name=None)
+ Tk.tk_call('::tablelist::addIncrSpinner', name)
+ end
+
+ def addIncrSpinint(name=None)
+ Tk.tk_call('::tablelist::addIncrSpinint', name)
+ end
+
+ def addIncrCombobox(name=None)
+ Tk.tk_call('::tablelist::addIncrCombobox', name)
+ end
+
+
+ ############################################################
+ # with Bryan Oakley's combobox package
+ def addOakleyCombobox(name=None)
+ Tk.tk_call('::tablelist::addOakleyCombobox', name)
+ end
+
+ ############################################################
+ # with the multi-entry package Mentry is a library extension
+ def addDateMentry(format, separator, gmt=false, name=None)
+ if gmt && gmt != None
+ gmt = '-gmt'
+ else
+ gmt = None
+ end
+ Tk.tk_call('::tablelist::addDateMentry', format, separator, gmt, name)
+ end
+
+ def addTimeMentry(format, separator, gmt=false, name=None)
+ if gmt && gmt != None
+ gmt = '-gmt'
+ else
+ gmt = None
+ end
+ Tk.tk_call('::tablelist::addTimeMentry', format, separator, gmt, name)
+ end
+
+ def addDateTimeMentry(format, date_sep, time_sep, gmt=false, name=None)
+ if gmt && gmt != None
+ gmt = '-gmt'
+ else
+ gmt = None
+ end
+ Tk.tk_call('::tablelist::addDateTimeMentry',
+ format, date_sep, time_sep, gmt, name)
+ end
+
+ def addFixedPointMentry(count1, count2, comma=false, name=None)
+ if comma && comma != None
+ comma = '-comma'
+ else
+ comma = None
+ end
+ Tk.tk_call('::tablelist::addFixedPoingMentry', count1, count2, comma, name)
+ end
+
+ def addIPAddrMentry(name=None)
+ Tk.tk_call('::tablelist::addIPAddrMentry', name)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
new file mode 100644
index 0000000000..0a1458415e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb
@@ -0,0 +1,43 @@
+#
+# tkextlib/tcllib/tablelist_tlie.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * A multi-column listbox
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('tablelist_tile', '4.2')
+TkPackage.require('tablelist_tile')
+
+unless defined? Tk::Tcllib::Tablelist_usingTile
+ Tk::Tcllib::Tablelist_usingTile = true
+end
+
+requrie 'tkextlib/tcllib/tablelist_core'
+
+module Tk
+ module Tcllib
+ class Tablelist
+ # commands related to tile Themems
+ def self.set_theme(theme)
+ Tk.tk_call('::tablelist::setTheme', theme)
+ end
+
+ def self.get_current_theme
+ Tk.tk_call('::tablelist::getCurrentTheme')
+ end
+
+ def self.get_theme_list
+ TkComm.simplelist(Tk.tk_call('::tablelist::getThemes'))
+ end
+ def self.set_theme_defaults
+ Tk.tk_call('::tablelist::setThemeDefaults')
+ end
+ end
+
+ Tablelist_Tile = Tablelist
+ TableList_Tile = Tablelist
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
new file mode 100644
index 0000000000..2f6e4b44fc
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb
@@ -0,0 +1,314 @@
+#
+# tkextlib/tcllib/tkpiechart.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Create 2D or 3D pies with labels in Tcl canvases
+#
+
+require 'tk'
+require 'tk/canvas'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('tkpiechart', '6.6')
+TkPackage.require('tkpiechart')
+
+module Tk
+ module Tcllib
+ module Tkpiechart
+ end
+ end
+end
+
+module Tk::Tcllib::Tkpiechart
+ PACKAGE_NAME = 'tkpiechart'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('tkpiechart')
+ rescue
+ ''
+ end
+ end
+
+ module ConfigMethod
+ include TkConfigMethod
+
+ def __pathname
+ self.path + ';' + self.tag
+ end
+ private :__pathname
+
+ def __cget_cmd
+ ['::switched::cget', self.tag]
+ end
+
+ def __config_cmd
+ ['::switched::configure', self.tag]
+ end
+ private :__config_cmd
+
+ def __configinfo_struct
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ :default_value=>1, :current_value=>2}
+ end
+ private :__configinfo_struct
+
+ def __boolval_optkeys
+ super() << 'select' << 'autoupdate' << 'selectable'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'bordercolor' << 'textbackground' <<
+ 'widestvaluetext' << 'title'
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'colors'
+ end
+ private :__listval_optkeys
+ end
+
+ ####################################
+ class PieChartObj < TkcItem
+ include ConfigMethod
+
+ def __font_optkeys
+ ['titlefont']
+ end
+ private :__font_optkeys
+ end
+
+ ####################################
+ class Pie < TkcItem
+ include ConfigMethod
+
+ def create_self(x, y, width, height, keys=None)
+ if keys and keys != None
+ @tag_key = tk_call_without_enc('::stooop::new', 'pie',
+ @c, x, y, *hash_kv(keys, true))
+ else
+ @tag_key = tk_call_without_enc('::stooop::new', 'pie', @c, x, y)
+ end
+
+ @slice_tbl = {}
+
+ id = "pie(#{@tag_key})"
+
+ @tag = @tag_pie = TkcNamedTag(@c, id)
+ @tag_slices = TkcNamedTag(@c, "pieSlices(#{@tag_key})")
+
+ id
+ end
+ private :create_self
+
+ def tag_key
+ @tag_key
+ end
+ def tag
+ @tag
+ end
+ def canvas
+ @c
+ end
+ def _entry_slice(slice)
+ @slice_tbl[slice.to_eval] = slice
+ end
+ def _delete_slice(slice)
+ @slice_tbl.delete(slice.to_eval)
+ end
+
+ def delete
+ tk_call_without_enc('::stooop::delete', @tag_key)
+ CItemID_TBL.mutex.synchronize{
+ CItemID_TBL[@path].delete(@id) if CItemID_TBL[@path]
+ }
+ self
+ end
+
+ def new_slice(text=None)
+ Slice.new(self, text)
+ end
+
+ def delete_slice(slice)
+ unless slice.kind_of?(Slice)
+ unless (slice = @slice_tbl[slice])
+ return tk_call_without_enc('pie::deleteSlice', @tag_key, slice)
+ end
+ end
+ unless slice.kind_of?(Slice) && slice.pie == self
+ fail ArgumentError, "argument is not a slice of self"
+ end
+ slice.delete
+ end
+
+ def selected_slices
+ tk_split_simplelist(tk_call_without_enc('pie::selectedSlices',
+ @tag_key)).collect{|slice|
+ @slice_tbl[slice] || Slice.new(:no_create, self, slice)
+ }
+ end
+ end
+
+ ####################################
+ class Slice < TkcItem
+ include ConfigMethod
+
+ def __config_cmd
+ ['::switched::configure', self.tag]
+ end
+ private :__config_cmd
+
+ #------------------------
+
+ def initialize(pie, *args)
+ unless pie.kind_of?(Pie) && pie != :no_create
+ fail ArgumentError, "expects TkPiechart::Pie for 1st argument"
+ end
+
+ if pie == :no_create
+ @pie, @tag_key = args
+ else
+ text = args[0] || None
+ @pie = pie
+ @tag_key = tk_call_without_enc('pie::newSlice', @pie.tag_key, text)
+ end
+ @parent = @c = @pie.canvas
+ @path = @parent.path
+
+ @pie._entry_slice(self)
+
+ @id = "slices(#{@tag_key})"
+ @tag = TkcNamedTag.new(@pie.canvas, @id)
+
+ CItemID_TBL.mutex.synchronize{
+ CItemID_TBL[@path] = {} unless CItemID_TBL[@path]
+ CItemID_TBL[@path][@id] = self
+ }
+ end
+
+ def tag_key
+ @tag_key
+ end
+ def tag
+ @tag
+ end
+ def pie
+ @pie
+ end
+
+ def delete
+ tk_call_without_enc('pie::deleteSlice', @pie.tag_key, @tag_key)
+ CItemID_TBL.mutex.synchronize{
+ CItemID_TBL[@path].delete(@id) if CItemID_TBL[@path]
+ }
+ @pie._delete_slice(self)
+ self
+ end
+
+ def size(share, disp=None)
+ tk_call_without_enc('pie::sizeSlice',
+ @pie.tag_key, @tag_key, share, disp)
+ self
+ end
+
+ def label(text)
+ tk_call_without_enc('pie::labelSlice', @pie.tag_key, @tag_key, text)
+ self
+ end
+ end
+
+ ####################################
+ class BoxLabeler < TkcItem
+ include ConfigMethod
+
+ def __config_cmd
+ ['::switched::configure', self.tag]
+ end
+ private :__config_cmd
+
+ #------------------------
+
+ def create_self(keys=None)
+ if keys and keys != None
+ @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler',
+ *hash_kv(keys, true))
+ else
+ @tag_key = tk_call_without_enc('::stooop::new', 'pieBoxLabeler')
+ end
+
+ id = "pieBoxLabeler(#{@tag_key})"
+ @tag = TkcNamedTag(@c, id)
+
+ id
+ end
+ private :create_self
+ end
+
+ ####################################
+ class PeripheralLabeler < TkcItem
+ include ConfigMethod
+
+ def __font_optkeys
+ ['font', 'smallfont']
+ end
+ private :__font_optkeys
+
+ def __config_cmd
+ ['::switched::configure', self.tag]
+ end
+ private :__config_cmd
+
+ #------------------------
+
+ def create_self(keys=None)
+ if keys and keys != None
+ @tag_key = tk_call_without_enc('::stooop::new',
+ 'piePeripheralLabeler',
+ *hash_kv(keys, true))
+ else
+ @tag_key = tk_call_without_enc('::stooop::new', 'piePeripheralLabeler')
+ end
+
+ id = "piePeripheralLabeler(#{@tag_key})"
+ @tag = TkcNamedTag(@c, id)
+
+ id
+ end
+ private :create_self
+ end
+
+ ####################################
+ class Label < TkcItem
+ include ConfigMethod
+
+ def __config_cmd
+ ['::switched::configure', self.tag]
+ end
+ private :__config_cmd
+
+ #------------------------
+
+ def create_self(x, y, keys=None)
+ if keys and keys != None
+ @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel',
+ @c, x, y, width, height,
+ *hash_kv(keys, true))
+ else
+ @tag_key = tk_call_without_enc('::stooop::new', 'canvasLabel',
+ @c, x, y, width, height)
+ end
+
+ id = "canvasLabel(#{@tag_key})"
+ @tag = TkcNamedTag(@c, id)
+
+ id
+ end
+ private :create_self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/toolbar.rb b/ext/tk/lib/tkextlib/tcllib/toolbar.rb
new file mode 100644
index 0000000000..6eae4eb3e1
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/toolbar.rb
@@ -0,0 +1,175 @@
+#
+# tkextlib/tcllib/toolbar.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * toolbar widget
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::toolbar', '1.2')
+TkPackage.require('widget::toolbar')
+
+module Tk::Tcllib
+ module Widget
+ class Toolbar < TkWindow
+ PACKAGE_NAME = 'widget::toolbar'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::toolbar')
+ rescue
+ ''
+ end
+ end
+ end
+
+ module ToolbarItemConfig
+ include TkItemConfigMethod
+ end
+ end
+end
+
+
+class Tk::Tcllib::Widget::ToolbarItem < TkObject
+ include TkTreatTagFont
+
+ ToolbarItemID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ TTagID_TBL.mutex.synchronize{ TTagID_TBL.clear }
+ }
+
+ def ToolbarItem.id2obj(tbar, id)
+ tpath = tbar.path
+ ToolbarItemID_TBL.mutex.synchronize{
+ if ToolbarItemID_TBL[tpath]
+ ToolbarItemID_TBL[tpath][id]? ToolbarItemID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initaialize(parent, *args)
+ @parent = @t = parent
+ @tpath = parent.path
+
+ @path = @id = @t.tk_send('add', *args)
+ # A same id is rejected by the Tcl function.
+
+ ToolbarItemID_TBL.mutex.synchronize{
+ ToolbarItemID_TBL[@id] = self
+ ToolbarItemID_TBL[@tpath] = {} unless ToolbarItemID_TBL[@tpath]
+ ToolbarItemID_TBL[@tpath][@id] = self
+ }
+ end
+
+ def [](key)
+ cget key
+ end
+
+ def []=(key,val)
+ configure key, val
+ val
+ end
+
+ def cget_tkstring(option)
+ @t.itemcget_tkstring(@id, option)
+ end
+ def cget(option)
+ @t.itemcget(@id, option)
+ end
+ def cget_strict(option)
+ @t.itemcget_strict(@id, option)
+ end
+
+ def configure(key, value=None)
+ @t.itemconfigure(@id, key, value)
+ self
+ end
+
+ def configinfo(key=nil)
+ @t.itemconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @t.current_itemconfiginfo(@id, key)
+ end
+
+ def delete
+ @t.delete(@id)
+ end
+
+ def itemid
+ @t.itemid(@id)
+ end
+
+ def remove
+ @t.remove(@id)
+ end
+ def remove_with_destroy
+ @t.remove_with_destroy(@id)
+ end
+end
+
+class Tk::Tcllib::Widget::Toolbar
+ include Tk::Tcllib::Widget::ToolbarItemConfig
+
+ TkCommandNames = ['::widget::toolbar'.freeze].freeze
+
+ def __destroy_hook__
+ Tk::Tcllib::Widget::ToolbarItem::ToolbarItemID_TBL.mutex.synchronize{
+ Tk::Tcllib::Widget::ToolbarItem::ToolbarItemID_TBL.delete(@path)
+ }
+ end
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def getframe
+ window(tk_send('getframe'))
+ end
+ alias get_frame getframe
+
+ def add(*args)
+ Tk::Tcllib::Widget::Toolbar.new(self, *args)
+ end
+
+ def itemid(item)
+ window(tk_send('itemid'))
+ end
+
+ def items(pattern)
+ tk_split_simplelist(tk_send('items', pattern)).map{|id|
+ Tk::Tcllib::Widget::ToolbarItem.id2obj(self, id)
+ }
+ end
+
+ def remove(*items)
+ tk_send('remove', *items)
+ self
+ end
+
+ def remove_with_destroy(*items)
+ tk_send('remove', '-destroy', *items)
+ self
+ end
+
+ def delete(*items)
+ tk_send('delete', *items)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/tooltip.rb b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
new file mode 100644
index 0000000000..070e63a7b5
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/tooltip.rb
@@ -0,0 +1,104 @@
+#
+# tkextlib/tcllib/tooltip.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Provides tooltips, a small text message that is displayed when the
+# mouse hovers over a widget.
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('tooltip', '1.1')
+TkPackage.require('tooltip')
+
+module Tk::Tcllib
+ module Tooltip
+ PACKAGE_NAME = 'tooltip'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('tooltip')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::Tooltip
+ extend TkCore
+
+ WidgetClassName = 'Tooltip'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.database_classname
+ self::WidgetClassName
+ end
+ def self.database_class
+ WidgetClassNames[self::WidgetClassName]
+ end
+
+ def self.clear(glob_path_pat = None)
+ self.clear_glob(glob_path_pat)
+ end
+
+ def self.clear_glob(glob_path_pat)
+ tk_call_without_enc('::tooltip::tooltip', 'clear', glob_path_pat)
+ end
+
+ def self.clear_widgets(*args)
+ self.clear_glob("{#{args.collect{|w| _get_eval_string(w)}.join(',')}}")
+ end
+
+ def self.clear_children(*args)
+ self.clear_glob("{#{args.collect{|w| s = _get_eval_string(w); "#{s},#{s}.*"}.join(',')}}")
+ end
+
+ def self.delay(millisecs=None)
+ number(tk_call_without_enc('::tooltip::tooltip', 'delay', millisecs))
+ end
+ def self.delay=(millisecs)
+ self.delay(millisecs)
+ end
+
+ def self.fade?
+ bool(tk_call_without_enc('::tooltip::tooltip', 'fade'))
+ end
+ def self.fade(mode)
+ tk_call_without_enc('::tooltip::tooltip', 'fade', mode)
+ end
+
+ def self.disable
+ tk_call_without_enc('::tooltip::tooltip', 'disable')
+ false
+ end
+ def self.off
+ self.disable
+ end
+
+ def self.enable
+ tk_call_without_enc('::tooltip::tooltip', 'enable')
+ true
+ end
+ def self.on
+ self.enable
+ end
+
+ def self.register(widget, msg, keys=nil)
+ if keys.kind_of?(Hash)
+ args = hash_kv(keys) << msg
+ else
+ args = msg
+ end
+ tk_call('::tooltip::tooltip', widget.path, *args)
+ end
+
+ def self.erase(widget)
+ tk_call_without_enc('::tooltip::tooltip', widget.path, '')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/widget.rb b/ext/tk/lib/tkextlib/tcllib/widget.rb
new file mode 100644
index 0000000000..57fdf7a575
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/widget.rb
@@ -0,0 +1,82 @@
+#
+# tkextlib/tcllib/widget.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * megawidget package that uses snit as the object system (snidgets)
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget', '3.0')
+TkPackage.require('widget')
+
+module Tk::Tcllib
+ module Widget
+ PACKAGE_NAME = 'widget'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget')
+ rescue
+ ''
+ end
+ end
+
+ #--- followings may be private functions of tklib
+ def self.isa(compare_as, *args)
+ begin
+ return Tk.tk_call('::widget::isa', compare_as, *args)
+ rescue => e
+ if TkComm.bool(Tk.tk_call('info','command','::widget::isa')) ||
+ ! TkComm.bool(Tk.tk_call('info','command','::widget::validate'))
+ fail e
+ end
+ end
+ Tk.tk_call('::widget::validate', compare_as, *args)
+ end
+ def self.validate(compare_as, *args)
+ begin
+ return Tk.tk_call('::widget::validate', compare_as, *args)
+ rescue => e
+ if TkComm.bool(Tk.tk_call('info','command','::widget::validate')) ||
+ ! TkComm.bool(Tk.tk_call('info','command','::widget::isa'))
+ fail e
+ end
+ end
+ Tk.tk_call('::widget::isa', compare_as, *args)
+ end
+ end
+end
+
+module Tk::Tcllib::Widget
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+
+ autoload :Calendar, 'tkextlib/tcllib/calendar'
+
+ autoload :Canvas_Sqmap, 'tkextlib/tcllib/canvas_sqmap'
+ autoload :Canvas_Zoom, 'tkextlib/tcllib/canvas_zoom'
+
+ autoload :Dialog, 'tkextlib/tcllib/dialog'
+
+ autoload :Panelframe, 'tkextlib/tcllib/panelframe'
+ autoload :PanelFrame, 'tkextlib/tcllib/panelframe'
+
+ autoload :Ruler, 'tkextlib/tcllib/ruler'
+
+ autoload :Screenruler, 'tkextlib/tcllib/screenruler'
+ autoload :ScreenRuler, 'tkextlib/tcllib/screenruler'
+
+ autoload :Scrolledwindow, 'tkextlib/tcllib/scrollwin'
+ autoload :ScrolledWindow, 'tkextlib/tcllib/scrollwin'
+
+ autoload :Superframe, 'tkextlib/tcllib/superframe'
+ autoload :SuperFrame, 'tkextlib/tcllib/superframe'
+
+ autoload :Toolbar, 'tkextlib/tcllib/toolbar'
+ autoload :ToolbarItem, 'tkextlib/tcllib/toolbar'
+end
diff --git a/ext/tk/lib/tkextlib/tclx.rb b/ext/tk/lib/tkextlib/tclx.rb
new file mode 100644
index 0000000000..3a4ff27644
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tclx.rb
@@ -0,0 +1,13 @@
+#
+# TclX support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tclx/setup.rb'
+
+# load library
+require 'tkextlib/tclx/tclx'
diff --git a/ext/tk/lib/tkextlib/tclx/setup.rb b/ext/tk/lib/tkextlib/tclx/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tclx/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tclx/tclx.rb b/ext/tk/lib/tkextlib/tclx/tclx.rb
new file mode 100644
index 0000000000..5a908fcd0b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tclx/tclx.rb
@@ -0,0 +1,74 @@
+#
+# tclx/tclx.rb
+# 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/tclx/setup.rb'
+
+# TkPackage.require('Tclx', '8.0')
+TkPackage.require('Tclx')
+
+module Tk
+ module TclX
+ PACKAGE_NAME = 'Tclx'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Tclx')
+ rescue
+ ''
+ end
+ end
+
+ def self.infox(*args)
+ Tk.tk_call('infox', *args)
+ end
+
+ def self.signal(*args)
+ warn("Warning: Don't recommend to use TclX's 'signal' command. Please use Ruby's 'Signal.trap' method")
+ Tk.tk_call('signal', *args)
+ end
+
+ def self.signal_restart(*args)
+ warn("Warning: Don't recommend to use TclX's 'signal' command. Please use Ruby's 'Signal.trap' method")
+ Tk.tk_call('signal', '-restart', *args)
+ end
+
+ ##############################
+
+ class XPG3_MsgCat
+ class << self
+ alias open new
+ end
+
+ def initialize(catname, fail_mode=false)
+ if fail_mode
+ @msgcat_id = Tk.tk_call('catopen', '-fail', catname)
+ else
+ @msgcat_id = Tk.tk_call('catopen', '-nofail', catname)
+ end
+ end
+
+ def close(fail_mode=false)
+ if fail_mode
+ Tk.tk_call('catclose', '-fail', @msgcat_id)
+ else
+ Tk.tk_call('catclose', '-nofail', @msgcat_id)
+ end
+ self
+ end
+
+ def get(setnum, msgnum, defaultstr)
+ Tk.tk_call('catgets', @msgcat_id, setnum, msgnum, defaultstr)
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tile.rb b/ext/tk/lib/tkextlib/tile.rb
new file mode 100644
index 0000000000..6c11e212ae
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile.rb
@@ -0,0 +1,449 @@
+#
+# Tile theme engin (tile widget set) support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/ttk_selector'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# library directory
+require 'tkextlib/tile/setup.rb'
+
+# load package
+# TkPackage.require('tile', '0.4')
+# TkPackage.require('tile', '0.6')
+# TkPackage.require('tile', '0.7')
+if Tk::TK_MAJOR_VERSION > 8 ||
+ (Tk::TK_MAJOR_VERSION == 8 && Tk::TK_MINOR_VERSION >= 5)
+ begin
+ TkPackage.require('tile') # for compatibility (version check of 'tile')
+ rescue RuntimeError
+ # ignore, even if cannot find package 'tile'
+ end
+ pkgname = 'Ttk'
+else
+ pkgname = 'tile'
+end
+
+begin
+ verstr = TkPackage.require(pkgname)
+rescue RuntimeError
+ # define dummy methods
+ module Tk
+ module Tile
+ CANNOT_FIND_PACKAGE = true
+ def self.const_missing(sym)
+ TkPackage.require(PACKAGE_NAME)
+ end
+ def self.method_missing(*args)
+ TkPackage.require(PACKAGE_NAME)
+ end
+ end
+ end
+ Tk.__cannot_find_tk_package_for_widget_set__(:Ttk, pkgname)
+ if pkgname == 'Ttk'
+ verstr = Tk::TK_PATCHLEVEL # dummy
+ else
+ verstr = '0.7' # dummy
+ end
+end
+
+ver = verstr.split('.')
+if ver[0].to_i == 0
+ # Tile extension package
+ if ver[1].to_i <= 4
+ # version 0.4 or former
+ module Tk
+ module Tile
+ USE_TILE_NAMESPACE = true
+ USE_TTK_NAMESPACE = false
+ TILE_SPEC_VERSION_ID = 0
+ end
+ end
+ elsif ver[1].to_i <= 6
+ # version 0.5 -- version 0.6
+ module Tk
+ module Tile
+ USE_TILE_NAMESPACE = true
+ USE_TTK_NAMESPACE = true
+ TILE_SPEC_VERSION_ID = 5
+ end
+ end
+ elsif ver[1].to_i <= 7
+ module Tk
+ module Tile
+ USE_TILE_NAMESPACE = false
+ USE_TTK_NAMESPACE = true
+ TILE_SPEC_VERSION_ID = 7
+ end
+ end
+ else
+ # version 0.8 or later
+ module Tk
+ module Tile
+ USE_TILE_NAMESPACE = false
+ USE_TTK_NAMESPACE = true
+ TILE_SPEC_VERSION_ID = 8
+ end
+ end
+ end
+
+ module Tk::Tile
+ PACKAGE_NAME = 'tile'.freeze
+ end
+else
+ # Ttk package merged Tcl/Tk core (Tcl/Tk 8.5+)
+ module Tk
+ module Tile
+ USE_TILE_NAMESPACE = false
+ USE_TTK_NAMESPACE = true
+ TILE_SPEC_VERSION_ID = 8
+
+ PACKAGE_NAME = 'Ttk'.freeze
+ end
+ end
+end
+
+# autoload
+module Tk
+ module Tile
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require(PACKAGE_NAME)
+ rescue
+ ''
+ end
+ end
+
+ def self.__Import_Tile_Widgets__!
+ warn 'Warning: "Tk::Tile::__Import_Tile_Widgets__!" is obsolete.' <<
+ ' To control default widget set, use "Tk.default_widget_set = :Ttk"'
+ Tk.tk_call('namespace', 'import', '-force', 'ttk::*')
+ end
+
+ def self.__define_LoadImages_proc_for_compatibility__!
+ # Ttk 8.5 (Tile 0.8) lost 'LoadImages' utility procedure.
+ # So, some old scripts doen't work, because those scripts use the
+ # procedure to define local styles.
+ # Of course, rewriting such Tcl/Tk scripts isn't difficult for
+ # Tcl/Tk users. However, it may be troublesome for Ruby/Tk users
+ # who use such Tcl/Tk scripts as it is.
+ # This method may help Ruby/Tk users who don't want to modify old
+ # Tcl/Tk scripts for the latest version of Ttk (Tile) extension.
+ # This method defines a comaptible 'LoadImages' procedure on the
+ # Tcl/Tk interpreter working under Ruby/Tk.
+ # Please give attention to use this method. It may conflict with
+ # some definitions on Tcl/Tk scripts.
+ klass_name = self.name
+ proc_name = 'LoadImages'
+ if Tk::Tile::USE_TTK_NAMESPACE
+ ns_list = ['::tile']
+ if Tk.info(:commands, "::ttk::#{proc_name}").empty?
+ ns_list << '::ttk'
+ end
+ else # Tk::Tile::USE_TILE_NAMESPACE
+ ns_list = ['::ttk']
+ if Tk.info(:commands, "::tile::#{proc_name}").empty?
+ ns_list << '::tile'
+ end
+ end
+
+ ns_list.each{|ns|
+ cmd = "#{ns}::#{proc_name}"
+ unless Tk.info(:commands, cmd).empty?
+ #fail RuntimeError, "can't define '#{cmd}' command (already exist)"
+
+ # do nothing !!!
+ warn "Warning: can't define '#{cmd}' command (already exist)" if $DEBUG
+ next
+ end
+ TkNamespace.eval(ns){
+ TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}',
+ <<-'EOS')
+ foreach pattern $patterns {
+ foreach file [glob -directory $imgdir $pattern] {
+ set img [file tail [file rootname $file]]
+ if {![info exists images($img)]} {
+ set images($img) [image create photo -file $file]
+ }
+ }
+ }
+ return [array get images]
+ EOS
+ }
+ }
+ end
+
+ def self.load_images(imgdir, pat=nil)
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 8
+ if Tk::Tile::USE_TTK_NAMESPACE
+ cmd = '::ttk::LoadImages'
+ else # Tk::Tile::USE_TILE_NAMESPACE
+ cmd = '::tile::LoadImages'
+ end
+ pat ||= TkComm::None
+ images = Hash[*TkComm.simplelist(Tk.tk_call(cmd, imgdir, pat))]
+ images.keys.each{|k|
+ images[k] = TkPhotoImage.new(:imagename=>images[k],
+ :without_creating=>true)
+ }
+ else ## TILE_SPEC_VERSION_ID >= 8
+ pat ||= '*.gif'
+ if pat.kind_of?(Array)
+ pat_list = pat
+ else
+ pat_list = [ pat ]
+ end
+ Dir.chdir(imgdir){
+ pat_list.each{|pat|
+ Dir.glob(pat).each{|f|
+ img = File.basename(f, '.*')
+ unless TkComm.bool(Tk.info('exists', "images(#{img})"))
+ Tk.tk_call('set', "images(#{img})",
+ Tk.tk_call('image', 'create', 'photo', '-file', f))
+ end
+ }
+ }
+ }
+ images = Hash[*TkComm.simplelist(Tk.tk_call('array', 'get', 'images'))]
+ images.keys.each{|k|
+ images[k] = TkPhotoImage.new(:imagename=>images[k],
+ :without_creating=>true)
+ }
+ end
+
+ images
+ end
+
+ def self.style(*args)
+ args.map!{|arg| TkComm._get_eval_string(arg)}.join('.')
+ end
+
+ def self.themes(glob_ptn = nil)
+ if TILE_SPEC_VERSION_ID < 8 && Tk.info(:commands, '::ttk::themes').empty?
+ fail RuntimeError, 'not support glob option' if glob_ptn
+ cmd = ['::tile::availableThemes']
+ else
+ glob_ptn = '*' unless glob_ptn
+ cmd = ['::ttk::themes', glob_ptn]
+ end
+
+ begin
+ TkComm.simplelist(Tk.tk_call_without_enc(*cmd))
+ rescue
+ TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline',
+ Tk::Tile::Style.theme_names,
+ glob_ptn))
+ end
+ end
+
+ def self.set_theme(theme)
+ if TILE_SPEC_VERSION_ID < 8 && Tk.info(:commands, '::ttk::setTheme').empty?
+ cmd = '::tile::setTheme'
+ else
+ cmd = '::ttk::setTheme'
+ end
+
+ begin
+ Tk.tk_call_without_enc(cmd, theme)
+ rescue
+ Tk::Tile::Style.theme_use(theme)
+ end
+ end
+
+ module KeyNav
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 8
+ def self.enableMnemonics(w)
+ Tk.tk_call('::keynav::enableMnemonics', w)
+ end
+ def self.defaultButton(w)
+ Tk.tk_call('::keynav::defaultButton', w)
+ end
+ else # dummy
+ def self.enableMnemonics(w)
+ ""
+ end
+ def self.defaultButton(w)
+ ""
+ end
+ end
+ end
+
+ module Font
+ Default = 'TkDefaultFont'
+ Text = 'TkTextFont'
+ Heading = 'TkHeadingFont'
+ Caption = 'TkCaptionFont'
+ Tooltip = 'TkTooltipFont'
+
+ Fixed = 'TkFixedFont'
+ Menu = 'TkMenuFont'
+ SmallCaption = 'TkSmallCaptionFont'
+ Icon = 'TkIconFont'
+
+ TkFont::SYSTEM_FONT_NAMES.add [
+ 'TkDefaultFont', 'TkTextFont', 'TkHeadingFont',
+ 'TkCaptionFont', 'TkTooltipFont', 'TkFixedFont',
+ 'TkMenuFont', 'TkSmallCaptionFont', 'TkIconFont'
+ ]
+ end
+
+ module ParseStyleLayout
+ def _style_layout(lst)
+ ret = []
+ until lst.empty?
+ sub = [lst.shift]
+ keys = {}
+
+ until lst.empty?
+ if lst[0][0] == ?-
+ k = lst.shift[1..-1]
+ children = lst.shift
+ children = _style_layout(children) if children.kind_of?(Array)
+ keys[k] = children
+ else
+ break
+ end
+ end
+
+ sub << keys unless keys.empty?
+ ret << sub
+ end
+ ret
+ end
+ private :_style_layout
+ end
+
+ module TileWidget
+ include Tk::Tile::ParseStyleLayout
+
+ def __val2ruby_optkeys # { key=>proc, ... }
+ # The method is used to convert a opt-value to a ruby's object.
+ # When get the value of the option "key", "proc.call(value)" is called.
+ super().update('style'=>proc{|v| _style_layout(list(v))})
+ end
+ private :__val2ruby_optkeys
+
+ def ttk_instate(state, script=nil, &b)
+ if script
+ tk_send('instate', state, script)
+ elsif b
+ tk_send('instate', state, Proc.new(&b))
+ else
+ bool(tk_send('instate', state))
+ end
+ end
+ alias tile_instate ttk_instate
+
+ def ttk_state(state=nil)
+ if state
+ tk_send('state', state)
+ else
+ list(tk_send('state'))
+ end
+ end
+ alias tile_state ttk_state
+
+ def ttk_identify(x, y)
+ ret = tk_send_without_enc('identify', x, y)
+ (ret.empty?)? nil: ret
+ end
+ alias tile_identify ttk_identify
+
+ # remove instate/state/identify method
+ # to avoid the conflict with widget options
+ if Tk.const_defined?(:USE_OBSOLETE_TILE_STATE_METHOD) && Tk::USE_OBSOLETE_TILE_STATE_METHOD
+ alias instate ttk_instate
+ alias state ttk_state
+ alias identify ttk_identify
+ end
+ end
+
+ ######################################
+
+ autoload :TButton, 'tkextlib/tile/tbutton'
+ autoload :Button, 'tkextlib/tile/tbutton'
+
+ autoload :TCheckButton, 'tkextlib/tile/tcheckbutton'
+ autoload :CheckButton, 'tkextlib/tile/tcheckbutton'
+ autoload :TCheckbutton, 'tkextlib/tile/tcheckbutton'
+ autoload :Checkbutton, 'tkextlib/tile/tcheckbutton'
+
+ autoload :Dialog, 'tkextlib/tile/dialog'
+
+ autoload :TEntry, 'tkextlib/tile/tentry'
+ autoload :Entry, 'tkextlib/tile/tentry'
+
+ autoload :TCombobox, 'tkextlib/tile/tcombobox'
+ autoload :Combobox, 'tkextlib/tile/tcombobox'
+
+ autoload :TFrame, 'tkextlib/tile/tframe'
+ autoload :Frame, 'tkextlib/tile/tframe'
+
+ autoload :TLabelframe, 'tkextlib/tile/tlabelframe'
+ autoload :Labelframe, 'tkextlib/tile/tlabelframe'
+ autoload :TLabelFrame, 'tkextlib/tile/tlabelframe'
+ autoload :LabelFrame, 'tkextlib/tile/tlabelframe'
+
+ autoload :TLabel, 'tkextlib/tile/tlabel'
+ autoload :Label, 'tkextlib/tile/tlabel'
+
+ autoload :TMenubutton, 'tkextlib/tile/tmenubutton'
+ autoload :Menubutton, 'tkextlib/tile/tmenubutton'
+ autoload :TMenuButton, 'tkextlib/tile/tmenubutton'
+ autoload :MenuButton, 'tkextlib/tile/tmenubutton'
+
+ autoload :TNotebook, 'tkextlib/tile/tnotebook'
+ autoload :Notebook, 'tkextlib/tile/tnotebook'
+
+ autoload :TPaned, 'tkextlib/tile/tpaned'
+ autoload :Paned, 'tkextlib/tile/tpaned'
+ autoload :PanedWindow, 'tkextlib/tile/tpaned'
+ autoload :Panedwindow, 'tkextlib/tile/tpaned'
+
+ autoload :TProgressbar, 'tkextlib/tile/tprogressbar'
+ autoload :Progressbar, 'tkextlib/tile/tprogressbar'
+
+ autoload :TRadioButton, 'tkextlib/tile/tradiobutton'
+ autoload :RadioButton, 'tkextlib/tile/tradiobutton'
+ autoload :TRadiobutton, 'tkextlib/tile/tradiobutton'
+ autoload :Radiobutton, 'tkextlib/tile/tradiobutton'
+
+ autoload :TScale, 'tkextlib/tile/tscale'
+ autoload :Scale, 'tkextlib/tile/tscale'
+ autoload :TProgress, 'tkextlib/tile/tscale'
+ autoload :Progress, 'tkextlib/tile/tscale'
+
+ autoload :TScrollbar, 'tkextlib/tile/tscrollbar'
+ autoload :Scrollbar, 'tkextlib/tile/tscrollbar'
+ autoload :XScrollbar, 'tkextlib/tile/tscrollbar'
+ autoload :YScrollbar, 'tkextlib/tile/tscrollbar'
+
+ autoload :TSeparator, 'tkextlib/tile/tseparator'
+ autoload :Separator, 'tkextlib/tile/tseparator'
+
+ autoload :TSpinbox, 'tkextlib/tile/tspinbox'
+ autoload :Spinbox, 'tkextlib/tile/tspinbox'
+
+ autoload :TSquare, 'tkextlib/tile/tsquare'
+ autoload :Square, 'tkextlib/tile/tsquare'
+
+ autoload :SizeGrip, 'tkextlib/tile/sizegrip'
+ autoload :Sizegrip, 'tkextlib/tile/sizegrip'
+
+ autoload :Treeview, 'tkextlib/tile/treeview'
+
+ autoload :Style, 'tkextlib/tile/style'
+ end
+end
+
+Ttk = Tk::Tile
diff --git a/ext/tk/lib/tkextlib/tile/dialog.rb b/ext/tk/lib/tkextlib/tile/dialog.rb
new file mode 100644
index 0000000000..b112e6152b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/dialog.rb
@@ -0,0 +1,102 @@
+#
+# ttk::dialog (tile-0.7+)
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class Dialog < TkWindow
+ end
+ end
+end
+
+begin
+ TkPackage.require('ttk::dialog') # this may be required.
+rescue RuntimeError
+ # ignore
+end
+
+class Tk::Tile::Dialog
+ TkCommandNames = ['::ttk::dialog'.freeze].freeze
+
+ def self.show(*args)
+ dialog = self.new(*args)
+ dialog.show
+ [dialog.status, dialog.value]
+ end
+ def self.display(*args)
+ self.show(*args)
+ end
+
+ def self.define_dialog_type(name, keys)
+ Tk.tk_call('::ttk::dialog::define', name, keys)
+ name
+ end
+
+ def self.style(*args)
+ ['Dialog', *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ #########################
+
+ def initialize(keys={})
+ @keys = _symbolkey2str(keys)
+ super(*args)
+ end
+
+ def create_self(keys)
+ # dummy
+ end
+ private :create_self
+
+ def show
+ tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys))
+ end
+ alias display show
+
+ def client_frame
+ window(tk_call_without_enc('::ttk::dialog::clientframe', @path))
+ end
+
+ def cget_strict(slot)
+ @keys[slot.to_s]
+ end
+ def cget(slot)
+ @keys[slot.to_s]
+ end
+=begin
+ def cget(slot)
+ unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ cget_strict(slot)
+ else
+ cget_strict(slot) rescue nil
+ end
+ end
+=end
+
+ def configure(slot, value=None)
+ if slot.kind_of?(Hash)
+ slot.each{|k, v| configure(k, v)}
+ else
+ slot = slot.to_s
+ value = _symbolkey2str(value) if value.kind_of?(Hash)
+ if value && value != None
+ @keys[slot] = value
+ else
+ @keys.delete(slot)
+ end
+ end
+ self
+ end
+
+ def configinfo(slot = nil)
+ if slot
+ slot = slot.to_s
+ [ slot, nil, nil, nil, @keys[slot] ]
+ else
+ @keys.collect{|k, v| [ k, nil, nil, nil, v ] }
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tile/setup.rb b/ext/tk/lib/tkextlib/tile/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tile/sizegrip.rb b/ext/tk/lib/tkextlib/tile/sizegrip.rb
new file mode 100644
index 0000000000..9947e0d870
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb
@@ -0,0 +1,32 @@
+#
+# ttk::sizegrip widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class SizeGrip < TkWindow
+ end
+ Sizegrip = SizeGrip
+ end
+end
+
+class Tk::Tile::SizeGrip < TkWindow
+ include Tk::Tile::TileWidget
+
+ TkCommandNames = ['::ttk::sizegrip'.freeze].freeze
+ WidgetClassName = 'TSizegrip'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip,
+# :TkSizegrip, :TkSizeGrip)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb',
+ :Ttk, Tk::Tile::Sizegrip,
+ :TkSizegrip, :TkSizeGrip)
diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb
new file mode 100644
index 0000000000..83a0c9a2e8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/style.rb
@@ -0,0 +1,336 @@
+#
+# style commands
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ module Style
+ end
+ end
+end
+
+module Tk::Tile::Style
+ extend TkCore
+end
+
+class << Tk::Tile::Style
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 8
+ TkCommandNames = ['style'.freeze].freeze
+
+ # --- Tk::Tile::Style.__define_wrapper_proc_for_compatibility__! ---
+ # On Ttk (Tile) extension, 'style' command has incompatible changes
+ # depend on the version of the extension. It requires modifying the
+ # Tcl/Tk scripts to define local styles. The rule for modification
+ # is a simple one. But, if users want to keep compatibility between
+ # versions of the extension, they will have to contrive to do that.
+ # It may be troublesome, especially for Ruby/Tk users.
+ # This method may help such work. This method make some definitions
+ # on the Tcl/Tk interpreter to work with different version of style
+ # command format. Please give attention to use this method. It may
+ # conflict with some definitions on Tcl/Tk scripts.
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 7
+ def __define_wrapper_proc_for_compatibility__!
+ __define_themes_and_setTheme_proc__!
+
+ unless Tk.info(:commands, '::ttk::style').empty?
+ # fail RuntimeError,
+ # "can't define '::ttk::style' command (already exist)"
+
+ # do nothing !!!
+ warn "Warning: can't define '::ttk::style' command (already exist)" if $DEBUG
+ return
+ end
+ TkCore::INTERP.add_tk_procs('::ttk::style', 'args', <<-'EOS')
+ if [string equal [lrange $args 0 1] {element create}] {
+ if [string equal [lindex $args 3] image] {
+ set spec [lindex $args 4]
+ set map [lrange $spec 1 end]
+ if [llength $map] {
+ # return [eval [concat [list ::style element create [lindex $args 2] image [lindex $spec 0] -map $map] [lrange $args 5 end]]]
+ return [uplevel 1 [list ::style element create [lindex $args 2] image [lindex $spec 0] -map $map] [lrange $args 5 end]]
+ }
+ }
+ }
+ # return [eval "::style $args"]
+ return [uplevel 1 ::style $args]
+ EOS
+ #########################
+ end
+ else ### TILE_SPEC_VERSION_ID == 7
+ def __define_wrapper_proc_for_compatibility__!
+ __define_themes_and_setTheme_proc__!
+
+ unless Tk.info(:commands, '::ttk::style').empty?
+ # fail RuntimeError,
+ # "can't define '::ttk::style' command (already exist)"
+
+ # do nothing !!!
+ warn "Warning: can't define '::ttk::style' command (already exist)" if $DEBUG
+ return
+ end
+ TkCore::INTERP.add_tk_procs('::ttk::style', 'args', <<-'EOS')
+ if [string equal [lrange $args 0 1] {element create}] {
+ if [string equal [lindex $args 3] image] {
+ set spec [lindex $args 4]
+ set map [lrange $spec 1 end]
+ if [llength $map] {
+ # return [eval [concat [list ::style element create [lindex $args 2] image [lindex $spec 0] -map $map] [lrange $args 5 end]]]
+ return [uplevel 1 [list ::style element create [lindex $args 2] image [lindex $spec 0] -map $map] [lrange $args 5 end]]]
+ }
+ }
+ } elseif [string equal [lindex $args 0] default] {
+ # return [eval "::style [lreplace $args 0 0 configure]"]
+ return [uplevel 1 ::style [lreplace $args 0 0 configure]]
+ }
+ # return [eval "::style $args"]
+ return [uplevel 1 ::style $args]
+ EOS
+ #########################
+ end
+ end
+ else ### TILE_SPEC_VERSION_ID >= 8
+ TkCommandNames = ['::ttk::style'.freeze].freeze
+
+ def __define_wrapper_proc_for_compatibility__!
+ __define_themes_and_setTheme_proc__!
+
+ unless Tk.info(:commands, '::style').empty?
+ # fail RuntimeError, "can't define '::style' command (already exist)"
+
+ # do nothing !!!
+ warn "Warning: can't define '::style' command (already exist)" if $DEBUG
+ return
+ end
+ TkCore::INTERP.add_tk_procs('::style', 'args', <<-'EOS')
+ if [string equal [lrange $args 0 1] {element create}] {
+ if [string equal [lindex $args 3] image] {
+ set name [lindex $args 4]
+ set opts [lrange $args 5 end]
+ set idx [lsearch $opts -map]
+ if {$idx >= 0 && [expr $idx % 2 == 0]} {
+ # return [eval [concat [list ::ttk::style element create [lindex $args 2] image [concat $name [lindex $opts [expr $idx + 1]]]] [lreplace $opts $idx [expr $idx + 1]]]]
+ return [uplevel 1 [list ::ttk::style element create [lindex $args 2] image [concat $name [lindex $opts [expr $idx + 1]]]] [lreplace $opts $idx [expr $idx + 1]]]
+ }
+ }
+ } elseif [string equal [lindex $args 0] default] {
+ # return [eval "::ttk::style [lreplace $args 0 0 configure]"]
+ return [uplevel 1 ::ttk::style [lreplace $args 0 0 configure]]
+ }
+ # return [eval "::ttk::style $args"]
+ return [uplevel 1 ::ttk::style $args]
+ EOS
+ #########################
+ end
+ end
+
+ def __define_themes_and_setTheme_proc__!
+ TkCore::INTERP.add_tk_procs('::ttk::themes', '{ptn *}', <<-'EOS')
+ #set themes [list]
+ set themes [::ttk::style theme names]
+ foreach pkg [lsearch -inline -all -glob [package names] ttk::theme::$ptn] {
+ set theme [namespace tail $pkg]
+ if {[lsearch -exact $themes $theme] < 0} {
+ lappend themes $theme
+ }
+ }
+ foreach pkg [lsearch -inline -all -glob [package names] tile::theme::$ptn] {
+ set theme [namespace tail $pkg]
+ if {[lsearch -exact $themes $theme] < 0} {
+ lappend themes $theme
+ }
+ }
+ return $themes
+ EOS
+ #########################
+ TkCore::INTERP.add_tk_procs('::ttk::setTheme', 'theme', <<-'EOS')
+ variable currentTheme
+ if {[lsearch -exact [::ttk::style theme names] $theme] < 0} {
+ package require [lsearch -inline -regexp [package names] (ttk|tile)::theme::$theme]
+ }
+ ::ttk::style theme use $theme
+ set currentTheme $theme
+ EOS
+ end
+ private :__define_themes_and_setTheme_proc__!
+
+ def configure(style=nil, keys=nil)
+ if style.kind_of?(Hash)
+ keys = style
+ style = nil
+ end
+ style = '.' unless style
+
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 7
+ sub_cmd = 'default'
+ else
+ sub_cmd = 'configure'
+ end
+
+ if keys && keys != None
+ tk_call(TkCommandNames[0], sub_cmd, style, *hash_kv(keys))
+ else
+ tk_call(TkCommandNames[0], sub_cmd, style)
+ end
+ end
+ alias default configure
+
+ def map(style=nil, keys=nil)
+ if style.kind_of?(Hash)
+ keys = style
+ style = nil
+ end
+ style = '.' unless style
+
+ if keys && keys != None
+ if keys.kind_of?(Hash)
+ tk_call(TkCommandNames[0], 'map', style, *hash_kv(keys))
+ else
+ simplelist(tk_call(TkCommandNames[0], 'map', style, '-' << keys.to_s))
+ end
+ else
+ ret = {}
+ Hash[*(simplelist(tk_call(TkCommandNames[0], 'map', style)))].each{|k, v|
+ ret[k[1..-1]] = list(v)
+ }
+ ret
+ end
+ end
+ alias map_configure map
+
+ def map_configinfo(style=nil, key=None)
+ style = '.' unless style
+ map(style, key)
+ end
+
+ def map_default_configinfo(key=None)
+ map('.', key)
+ end
+
+ def lookup(style, opt, state=None, fallback_value=None)
+ tk_call(TkCommandNames[0], 'lookup', style,
+ '-' << opt.to_s, state, fallback_value)
+ end
+
+ include Tk::Tile::ParseStyleLayout
+
+ def layout(style=nil, spec=nil)
+ if style.kind_of?(Hash)
+ spec = style
+ style = nil
+ end
+ style = '.' unless style
+
+ if spec
+ tk_call(TkCommandNames[0], 'layout', style, spec)
+ else
+ _style_layout(list(tk_call(TkCommandNames[0], 'layout', style)))
+ end
+ end
+
+ def element_create(name, type, *args)
+ if type == 'image' || type == :image
+ element_create_image(name, *args)
+ elsif type == 'vsapi' || type == :vsapi
+ element_create_vsapi(name, *args)
+ else
+ tk_call(TkCommandNames[0], 'element', 'create', name, type, *args)
+ end
+ end
+
+ def element_create_image(name, *args)
+ fail ArgumentError, 'Must supply a base image' unless (spec = args.shift)
+ if (opts = args.shift)
+ if opts.kind_of?(Hash)
+ opts = _symbolkey2str(opts)
+ else
+ fail ArgumentError, 'bad option'
+ end
+ end
+ fail ArgumentError, 'too many arguments' unless args.empty?
+
+ if spec.kind_of?(Array)
+ # probably, command format is tile 0.8+ (Tcl/Tk8.5+) style
+ if Tk::Tile::TILE_SPEC_VERSION_ID >= 8
+ if opts
+ tk_call(TkCommandNames[0],
+ 'element', 'create', name, 'image', spec, opts)
+ else
+ tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec)
+ end
+ else
+ fail ArgumentError, 'illegal arguments' if opts.key?('map')
+ base = spec.shift
+ opts['map'] = spec
+ tk_call(TkCommandNames[0],
+ 'element', 'create', name, 'image', base, opts)
+ end
+ else
+ # probably, command format is tile 0.7.8 or older style
+ if Tk::Tile::TILE_SPEC_VERSION_ID >= 8
+ spec = [spec, *(opts.delete('map'))] if opts.key?('map')
+ end
+ if opts
+ tk_call(TkCommandNames[0],
+ 'element', 'create', name, 'image', spec, opts)
+ else
+ tk_call(TkCommandNames[0], 'element', 'create', name, 'image', spec)
+ end
+ end
+ end
+
+ def element_create_vsapi(name, class_name, part_id, *args)
+ # supported on Tcl/Tk 8.6 or later
+
+ # argument check
+ if (state_map = args.shift || None)
+ if state_map.kind_of?(Hash)
+ opts = _symbolkey2str(state_map)
+ state_map = None
+ end
+ end
+ opts = args.shift || None
+ fail ArgumentError, "too many arguments" unless args.empty?
+
+ # define a Microsoft Visual Styles element
+ tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi',
+ class_name, part_id, state_map, opts)
+ end
+
+ def element_names()
+ list(tk_call(TkCommandNames[0], 'element', 'names'))
+ end
+
+ def element_options(elem)
+ simplelist(tk_call(TkCommandNames[0], 'element', 'options', elem))
+ end
+
+ def theme_create(name, keys=nil)
+ name = name.to_s
+ if keys && keys != None
+ tk_call(TkCommandNames[0], 'theme', 'create', name, *hash_kv(keys))
+ else
+ tk_call(TkCommandNames[0], 'theme', 'create', name)
+ end
+ name
+ end
+
+ def theme_settings(name, cmd=nil, &b)
+ name = name.to_s
+ cmd = Proc.new(&b) if !cmd && b
+ tk_call(TkCommandNames[0], 'theme', 'settings', name, cmd)
+ name
+ end
+
+ def theme_names()
+ list(tk_call(TkCommandNames[0], 'theme', 'names'))
+ end
+
+ def theme_use(name)
+ name = name.to_s
+ tk_call(TkCommandNames[0], 'theme', 'use', name)
+ name
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tile/tbutton.rb b/ext/tk/lib/tkextlib/tile/tbutton.rb
new file mode 100644
index 0000000000..c852024842
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tbutton.rb
@@ -0,0 +1,34 @@
+#
+# tbutton widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TButton < Tk::Button
+ end
+ Button = TButton
+ end
+end
+
+class Tk::Tile::TButton < Tk::Button
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::button'.freeze].freeze
+ else
+ TkCommandNames = ['::tbutton'.freeze].freeze
+ end
+ WidgetClassName = 'TButton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Button, :TkButton)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tbutton.rb',
+ :Ttk, Tk::Tile::Button, :TkButton)
diff --git a/ext/tk/lib/tkextlib/tile/tcheckbutton.rb b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
new file mode 100644
index 0000000000..01751ede0f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tcheckbutton.rb
@@ -0,0 +1,38 @@
+#
+# tcheckbutton widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TCheckButton < Tk::CheckButton
+ end
+ TCheckbutton = TCheckButton
+ CheckButton = TCheckButton
+ Checkbutton = TCheckButton
+ end
+end
+
+class Tk::Tile::TCheckButton < Tk::CheckButton
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::checkbutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tcheckbutton'.freeze].freeze
+ end
+ WidgetClassName = 'TCheckbutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Checkbutton,
+# :TkCheckbutton, :TkCheckButton)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tcheckbutton.rb',
+ :Ttk, Tk::Tile::Checkbutton,
+ :TkCheckbutton, :TkCheckButton)
diff --git a/ext/tk/lib/tkextlib/tile/tcombobox.rb b/ext/tk/lib/tkextlib/tile/tcombobox.rb
new file mode 100644
index 0000000000..b5ab827e2d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tcombobox.rb
@@ -0,0 +1,55 @@
+#
+# tcombobox widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TCombobox < Tk::Tile::TEntry
+ end
+ Combobox = TCombobox
+ end
+end
+
+class Tk::Tile::TCombobox < Tk::Tile::TEntry
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::combobox'.freeze].freeze
+ else
+ TkCommandNames = ['::tcombobox'.freeze].freeze
+ end
+ WidgetClassName = 'TCombobox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __boolval_optkeys
+ super() << 'exportselection'
+ end
+ private :__boolval_optkeys
+
+ def __listval_optkeys
+ super() << 'values'
+ end
+ private :__listval_optkeys
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def current
+ number(tk_send_without_enc('current'))
+ end
+ def current=(idx)
+ tk_send_without_enc('current', idx)
+ end
+
+ def set(val)
+ tk_send('set', val)
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Combobox, :TkCombobox)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tcombobox.rb',
+ :Ttk, Tk::Tile::Combobox, :TkCombobox)
diff --git a/ext/tk/lib/tkextlib/tile/tentry.rb b/ext/tk/lib/tkextlib/tile/tentry.rb
new file mode 100644
index 0000000000..8d2633a774
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tentry.rb
@@ -0,0 +1,49 @@
+#
+# tentry widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TEntry < Tk::Entry
+ end
+ Entry = TEntry
+ end
+end
+
+class Tk::Tile::TEntry < Tk::Entry
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::entry'.freeze].freeze
+ else
+ TkCommandNames = ['::tentry'.freeze].freeze
+ end
+ WidgetClassName = 'TEntry'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __optkey_aliases
+ {:vcmd=>:validatecommand, :invcmd=>:invalidcommand}
+ end
+ private :__optkey_aliases
+
+ def __boolval_optkeys
+ super() << 'exportselection'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'show'
+ end
+ private :__strval_optkeys
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Entry, :TkEntry)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tentry.rb',
+ :Ttk, Tk::Tile::Entry, :TkEntry)
diff --git a/ext/tk/lib/tkextlib/tile/tframe.rb b/ext/tk/lib/tkextlib/tile/tframe.rb
new file mode 100644
index 0000000000..d6d4312628
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tframe.rb
@@ -0,0 +1,34 @@
+#
+# tframe widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TFrame < Tk::Frame
+ end
+ Frame = TFrame
+ end
+end
+
+class Tk::Tile::TFrame < Tk::Frame
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::frame'.freeze].freeze
+ else
+ TkCommandNames = ['::tframe'.freeze].freeze
+ end
+ WidgetClassName = 'TFrame'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Frame, :TkFrame)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tframe.rb',
+ :Ttk, Tk::Tile::Frame, :TkFrame)
diff --git a/ext/tk/lib/tkextlib/tile/tlabel.rb b/ext/tk/lib/tkextlib/tile/tlabel.rb
new file mode 100644
index 0000000000..55b98acc68
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tlabel.rb
@@ -0,0 +1,34 @@
+#
+# tlabel widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TLabel < Tk::Label
+ end
+ Label = TLabel
+ end
+end
+
+class Tk::Tile::TLabel < Tk::Label
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::label'.freeze].freeze
+ else
+ TkCommandNames = ['::tlabel'.freeze].freeze
+ end
+ WidgetClassName = 'TLabel'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Label, :TkLabel)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tlabel.rb',
+ :Ttk, Tk::Tile::Label, :TkLabel)
diff --git a/ext/tk/lib/tkextlib/tile/tlabelframe.rb b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
new file mode 100644
index 0000000000..a34c98583f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tlabelframe.rb
@@ -0,0 +1,38 @@
+#
+# tlabelframe widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TLabelframe < Tk::Tile::TFrame
+ end
+ TLabelFrame = TLabelframe
+ Labelframe = TLabelframe
+ LabelFrame = TLabelframe
+ end
+end
+
+class Tk::Tile::TLabelframe < Tk::Tile::TFrame
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::labelframe'.freeze].freeze
+ else
+ TkCommandNames = ['::tlabelframe'.freeze].freeze
+ end
+ WidgetClassName = 'TLabelframe'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Labelframe,
+# :TkLabelframe, :TkLabelFrame)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tlabelframe.rb',
+ :Ttk, Tk::Tile::Labelframe,
+ :TkLabelframe, :TkLabelFrame)
diff --git a/ext/tk/lib/tkextlib/tile/tmenubutton.rb b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
new file mode 100644
index 0000000000..1cf553ec8c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tmenubutton.rb
@@ -0,0 +1,38 @@
+#
+# tmenubutton widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TMenubutton < Tk::Menubutton
+ end
+ TMenuButton = TMenubutton
+ Menubutton = TMenubutton
+ MenuButton = TMenubutton
+ end
+end
+
+class Tk::Tile::TMenubutton < Tk::Menubutton
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::menubutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tmenubutton'.freeze].freeze
+ end
+ WidgetClassName = 'TMenubutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Menubutton,
+# :TkMenubutton, :TkMenuButton)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tmenubutton.rb',
+ :Ttk, Tk::Tile::Menubutton,
+ :TkMenubutton, :TkMenuButton)
diff --git a/ext/tk/lib/tkextlib/tile/tnotebook.rb b/ext/tk/lib/tkextlib/tile/tnotebook.rb
new file mode 100644
index 0000000000..9e27e2c1fd
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tnotebook.rb
@@ -0,0 +1,147 @@
+#
+# tnotebook widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TNotebook < TkWindow
+ end
+ Notebook = TNotebook
+ end
+end
+
+class Tk::Tile::TNotebook < TkWindow
+ ################################
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id)
+ [self.path, 'tab', id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, 'tab', id]
+ end
+ private :__item_config_cmd
+
+ def __item_listval_optkeys(id)
+ []
+ end
+ private :__item_listval_optkeys
+
+ def __item_methodcall_optkeys(id) # { key=>method, ... }
+ {}
+ end
+ private :__item_methodcall_optkeys
+
+ #alias tabcget itemcget
+ #alias tabcget_strict itemcget_strict
+ alias tabconfigure itemconfigure
+ alias tabconfiginfo itemconfiginfo
+ alias current_tabconfiginfo current_itemconfiginfo
+
+ def tabcget_tkstring(tagOrId, option)
+ tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{option}")), false, true)[-1]
+ end
+ def tabcget_strict(tagOrId, option)
+ tabconfiginfo(tagOrId, option)[-1]
+ end
+ def tabcget(tagOrId, option)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ tabcget_strict(tagOrId, option)
+ else
+ begin
+ tabcget_strict(tagOrId, option)
+ rescue => e
+ begin
+ if current_tabconfiginfo(tagOrId).has_key?(option.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ ################################
+
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::notebook'.freeze].freeze
+ else
+ TkCommandNames = ['::tnotebook'.freeze].freeze
+ end
+ WidgetClassName = 'TNotebook'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def enable_traversal()
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 5
+ tk_call_without_enc('::tile::enableNotebookTraversal', @path)
+ elsif Tk::Tile::TILE_SPEC_VERSION_ID < 7
+ tk_call_without_enc('::tile::notebook::enableTraversal', @path)
+ else
+ tk_call_without_enc('::ttk::notebook::enableTraversal', @path)
+ end
+ self
+ end
+
+ def add(child, keys=nil)
+ if keys && keys != None
+ tk_send('add', _epath(child), *hash_kv(keys))
+ else
+ tk_send('add', _epath(child))
+ end
+ self
+ end
+
+ def forget(idx)
+ tk_send('forget', idx)
+ self
+ end
+
+ def hide(idx)
+ tk_send('hide', idx)
+ end
+
+ def index(idx)
+ number(tk_send('index', idx))
+ end
+
+ def insert(idx, subwin, keys=nil)
+ if keys && keys != None
+ tk_send('insert', idx, subwin, *hash_kv(keys))
+ else
+ tk_send('insert', idx, subwin)
+ end
+ self
+ end
+
+ def select(idx)
+ tk_send('select', idx)
+ self
+ end
+
+ def selected
+ window(tk_send_without_enc('select'))
+ end
+
+ def tabs
+ list(tk_send('tabs'))
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Notebook, :TkNotebook)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tnotebook.rb',
+ :Ttk, Tk::Tile::Notebook, :TkNotebook)
diff --git a/ext/tk/lib/tkextlib/tile/tpaned.rb b/ext/tk/lib/tkextlib/tile/tpaned.rb
new file mode 100644
index 0000000000..d6ad234559
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tpaned.rb
@@ -0,0 +1,245 @@
+#
+# tpaned widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TPaned < TkWindow
+ end
+ PanedWindow = Panedwindow = Paned = TPaned
+ end
+end
+
+class Tk::Tile::TPaned < TkWindow
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 8
+ TkCommandNames = ['::ttk::paned'.freeze].freeze
+ else
+ TkCommandNames = ['::ttk::panedwindow'.freeze].freeze
+ end
+ else
+ TkCommandNames = ['::tpaned'.freeze].freeze
+ end
+ WidgetClassName = 'TPaned'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def add(*args)
+ keys = args.pop
+ fail ArgumentError, "no window in arguments" unless keys
+
+ if keys && keys.kind_of?(Hash)
+ fail ArgumentError, "no window in arguments" if args == []
+ opts = hash_kv(keys)
+ else
+ args.push(keys) if keys
+ opts = []
+ end
+
+ args.each{|win|
+ tk_send_without_enc('add', _epath(win), *opts)
+ }
+ self
+ end
+
+ def forget(pane)
+ pane = _epath(pane)
+ tk_send_without_enc('forget', pane)
+ self
+ end
+
+ def insert(pos, win, keys)
+ win = _epath(win)
+ tk_send_without_enc('insert', pos, win, *hash_kv(keys))
+ self
+ end
+
+ def panecget_tkstring(pane, slot)
+ pane = _epath(pane)
+ tk_send_without_enc('pane', pane, "-#{slot}")
+ end
+ alias pane_cget_tkstring panecget_tkstring
+
+ def panecget_strict(pane, slot)
+ pane = _epath(pane)
+ tk_tcl2ruby(tk_send_without_enc('pane', pane, "-#{slot}"))
+ end
+ alias pane_cget_strict panecget_strict
+
+ def panecget(pane, slot)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ panecget_strict(pane, slot)
+ else
+ begin
+ panecget_strict(pane, slot)
+ rescue => e
+ begin
+ if current_paneconfiginfo(pane).has_key?(slot.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ alias pane_cget panecget
+
+ def paneconfigure(pane, key, value=nil)
+ pane = _epath(pane)
+ if key.kind_of? Hash
+ params = []
+ key.each{|k, v|
+ params.push("-#{k}")
+ # params.push((v.kind_of?(TkObject))? v.epath: v)
+ params.push(_epath(v))
+ }
+ tk_send_without_enc('pane', pane, *params)
+ else
+ # value = value.epath if value.kind_of?(TkObject)
+ value = _epath(value)
+ tk_send_without_enc('pane', pane, "-#{key}", value)
+ end
+ self
+ end
+ alias pane_config paneconfigure
+ alias pane_configure paneconfigure
+
+ def paneconfiginfo(win)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ win = _epath(win)
+ if key
+ conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
+ conf[0] = conf[0][1..-1]
+ if conf[0] == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ conf[4] = bool(conf[4]) unless conf[4].empty?
+ end
+ conf
+ else
+ tk_split_simplelist(tk_send_without_enc('pane',
+ win)).collect{|conflist|
+ conf = tk_split_simplelist(conflist)
+ conf[0] = conf[0][1..-1]
+ if conf[3]
+ if conf[0] == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ elsif conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf[4]
+ if conf[0] == 'hide'
+ conf[4] = bool(conf[4]) unless conf[4].empty?
+ elsif conf[4].index('{')
+ conf[4] = tk_split_list(conf[4])
+ else
+ conf[4] = tk_tcl2ruby(conf[4])
+ end
+ end
+ conf[1] = conf[1][1..-1] if conf.size == 2 # alias info
+ conf
+ }
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ win = _epath(win)
+ if key
+ conf = tk_split_list(tk_send_without_enc('pane', win, "-#{key}"))
+ key = conf.shift[1..-1]
+ if key == 'hide'
+ conf[2] = bool(conf[2]) unless conf[2].empty?
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ end
+ { key => conf }
+ else
+ ret = {}
+ tk_split_simplelist(tk_send_without_enc('pane',
+ win)).each{|conflist|
+ conf = tk_split_simplelist(conflist)
+ key = conf.shift[1..-1]
+ if key
+ if key == 'hide'
+ conf[2] = bool(conf[2]) unless conf[2].empty?
+ elsif conf[2].index('{')
+ conf[2] = tk_split_list(conf[2])
+ else
+ conf[2] = tk_tcl2ruby(conf[2])
+ end
+ end
+ if conf[3]
+ if key == 'hide'
+ conf[3] = bool(conf[3]) unless conf[3].empty?
+ elsif conf[3].index('{')
+ conf[3] = tk_split_list(conf[3])
+ else
+ conf[3] = tk_tcl2ruby(conf[3])
+ end
+ end
+ if conf.size == 1
+ ret[key] = conf[0][1..-1] # alias info
+ else
+ ret[key] = conf
+ end
+ }
+ ret
+ end
+ end
+ end
+ alias pane_configinfo paneconfiginfo
+
+ def current_paneconfiginfo(win, key=nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if key
+ conf = paneconfiginfo(win, key)
+ {conf[0] => conf[4]}
+ else
+ ret = {}
+ paneconfiginfo(win).each{|conf|
+ ret[conf[0]] = conf[4] if conf.size > 2
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ paneconfiginfo(win, key).each{|k, conf|
+ ret[k] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+ alias current_pane_configinfo current_paneconfiginfo
+
+ def panes
+ tk_split_simplelist(tk_send_without_enc('panes')).map{|w|
+ (obj = window(w))? obj: w
+ }
+ end
+
+ def identify(x, y)
+ num_or_nil(tk_send_without_enc('identify', x, y))
+ end
+
+ def sashpos(idx, newpos=None)
+ num_or_str(tk_send_without_enc('sashpos', idx, newpos))
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Panedwindow,
+# :TkPanedwindow, :TkPanedWindow)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tpaned.rb',
+ :Ttk, Tk::Tile::Panedwindow,
+ :TkPanedwindow, :TkPanedWindow)
diff --git a/ext/tk/lib/tkextlib/tile/tprogressbar.rb b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
new file mode 100644
index 0000000000..0c9d15e1b9
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tprogressbar.rb
@@ -0,0 +1,57 @@
+#
+# tprogressbar widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TProgressbar < TkWindow
+ end
+ Progressbar = TProgressbar
+ end
+end
+
+class Tk::Tile::TProgressbar
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::progressbar'.freeze].freeze
+ else
+ TkCommandNames = ['::tprogressbar'.freeze].freeze
+ end
+ WidgetClassName = 'TProgressbar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def step(amount=None)
+ tk_send_without_enc('step', amount).to_f
+ end
+ #def step=(amount)
+ # tk_send_without_enc('step', amount)
+ #end
+
+ def start(interval=None)
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 5
+ tk_call_without_enc('::tile::progressbar::start', @path, interval)
+ else
+ tk_send_without_enc('start', interval)
+ end
+ end
+
+ def stop(amount=None)
+ if Tk::Tile::TILE_SPEC_VERSION_ID < 5
+ tk_call_without_enc('::tile::progressbar::stop', @path)
+ else
+ tk_send_without_enc('stop', amount)
+ end
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Progressbar, :TkProgressbar)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tprogressbar.rb',
+ :Ttk, Tk::Tile::Progressbar, :TkProgressbar)
diff --git a/ext/tk/lib/tkextlib/tile/tradiobutton.rb b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
new file mode 100644
index 0000000000..5dbf260666
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tradiobutton.rb
@@ -0,0 +1,38 @@
+#
+# tradiobutton widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TRadioButton < Tk::RadioButton
+ end
+ TRadiobutton = TRadioButton
+ RadioButton = TRadioButton
+ Radiobutton = TRadioButton
+ end
+end
+
+class Tk::Tile::TRadioButton < Tk::RadioButton
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::radiobutton'.freeze].freeze
+ else
+ TkCommandNames = ['::tradiobutton'.freeze].freeze
+ end
+ WidgetClassName = 'TRadiobutton'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Radiobutton,
+# :TkRadiobutton, :TkRadioButton)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tradiobutton.rb',
+ :Ttk, Tk::Tile::Radiobutton,
+ :TkRadiobutton, :TkRadioButton)
diff --git a/ext/tk/lib/tkextlib/tile/treeview.rb b/ext/tk/lib/tkextlib/tile/treeview.rb
new file mode 100644
index 0000000000..70db3d6d78
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/treeview.rb
@@ -0,0 +1,1306 @@
+#
+# treeview widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class Treeview < TkWindow
+ end
+ end
+end
+
+module Tk::Tile::TreeviewConfig
+ include TkItemConfigMethod
+
+ def __item_configinfo_struct(id)
+ # maybe need to override
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ :default_value=>nil, :current_value=>1}
+ end
+ private :__item_configinfo_struct
+
+ def __itemconfiginfo_core(tagOrId, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
+ fontkey = $2
+ return [slot.to_s, tagfontobj(tagid(tagOrId), fontkey)]
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
+ val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot))
+ rescue
+ # Maybe, 'state' option has '-' in future.
+ val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ end
+ return [slot, val]
+
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
+ optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ return [slot, val]
+
+ when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
+ return [slot, self.__send__(method, tagOrId)]
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ rescue
+ val = nil
+ end
+ return [slot, val]
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ return [slot, val]
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ rescue
+ val = nil
+ end
+ return [slot, val]
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ return [slot, val]
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val =~ /^[0-9]/
+ return [slot, list(val)]
+ else
+ return [slot, val]
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ return [slot, val]
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val.empty?
+ return [slot, nil]
+ else
+ return [slot, TkVarAccess.new(val)]
+ end
+
+ else
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val.index('{')
+ return [slot, tk_split_list(val)]
+ else
+ return [slot, tk_tcl2ruby(val)]
+ end
+ end
+
+ else # ! slot
+ ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf|
+ conf[0] = conf[0][1..-1] if conf[0][0] == ?-
+ case conf[0]
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[conf[0]]
+ optval = conf[1]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[1] = val
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # do nothing
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ conf[1] = number(conf[1])
+ rescue
+ conf[1] = nil
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ conf[1] = num_or_str(conf[1])
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ conf[1] = bool(conf[1])
+ rescue
+ conf[1] = nil
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ conf[1] = simplelist(conf[1])
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ if conf[1] =~ /^[0-9]/
+ conf[1] = list(conf[1])
+ end
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ if conf[1].empty?
+ conf[1] = nil
+ else
+ conf[1] = TkVarAccess.new(conf[1])
+ end
+
+ else
+ if conf[1].index('{')
+ conf[1] = tk_split_list(conf[1])
+ else
+ conf[1] = tk_tcl2ruby(conf[1])
+ end
+ end
+
+ conf
+ }
+
+ __item_font_optkeys(tagid(tagOrId)).each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret.assoc(optkey)
+ if fontconf
+ ret.delete_if{|inf| inf[0] =~ /^(|latin|ascii|kanji)#{optkey}$/}
+ fontconf[1] = tagfontobj(tagid(tagOrId), optkey)
+ ret.push(fontconf)
+ end
+ }
+
+ __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
+ ret << [optkey.to_s, self.__send__(method, tagOrId)]
+ }
+
+ ret
+ end
+ end
+
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ if (slot && slot.to_s =~ /^(|latin|ascii|kanji)(#{__item_font_optkeys(tagid(tagOrId)).join('|')})$/)
+ fontkey = $2
+ return {slot.to_s => tagfontobj(tagid(tagOrId), fontkey)}
+ else
+ if slot
+ slot = slot.to_s
+
+ alias_name, real_name = __item_optkey_aliases(tagid(tagOrId)).find{|k, v| k.to_s == slot}
+ if real_name
+ slot = real_name.to_s
+ end
+
+ case slot
+ when /^(#{__tile_specific_item_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ # On tile-0.7.{2-8}, 'state' option has no '-' at its head.
+ val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << slot))
+ rescue
+ # Maybe, 'state' option has '-' in future.
+ val = tk_call(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ end
+ return {slot => val}
+
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[slot]
+ optval = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}lcall(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ return {slot => val}
+
+ when /^(#{__item_methodcall_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_methodcall_optkeys(tagid(tagOrId)))[slot]
+ return {slot => self.__send__(method, tagOrId)}
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ val = number(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ rescue
+ val = nil
+ end
+ return {slot => val}
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = num_or_str(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ return {slot => val}
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ val = bool(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ rescue
+ val = nil
+ end
+ return {slot => val}
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}")))
+ return {slot => val}
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val =~ /^[0-9]/
+ return {slot => list(val)}
+ else
+ return {slot => val}
+ end
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ return {slot => val}
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val.empty?
+ return {slot => nil}
+ else
+ return {slot => TkVarAccess.new(val)}
+ end
+
+ else
+ val = tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)) << "-#{slot}"))
+ if val.index('{')
+ return {slot => tk_split_list(val)}
+ else
+ return {slot => tk_tcl2ruby(val)}
+ end
+ end
+
+ else # ! slot
+ ret = {}
+ ret = Hash[*(tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(tagOrId)))), false, false))].to_a.collect{|conf|
+ conf[0] = conf[0][1..-1] if conf[0][0] == ?-
+
+ optkey = conf[0]
+ case optkey
+ when /^(#{__item_val2ruby_optkeys(tagid(tagOrId)).keys.join('|')})$/
+ method = _symbolkey2str(__item_val2ruby_optkeys(tagid(tagOrId)))[optkey]
+ optval = conf[1]
+ begin
+ val = method.call(tagOrId, optval)
+ rescue => e
+ warn("Warning:: #{e.message} (when #{method}.call(#{tagOrId.inspect}, #{optval.inspect})") if $DEBUG
+ val = optval
+ end
+ conf[1] = val
+
+ when /^(#{__item_strval_optkeys(tagid(tagOrId)).join('|')})$/
+ # do nothing
+
+ when /^(#{__item_numval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ conf[1] = number(conf[1])
+ rescue
+ conf[1] = nil
+ end
+
+ when /^(#{__item_numstrval_optkeys(tagid(tagOrId)).join('|')})$/
+ conf[1] = num_or_str(conf[1])
+
+ when /^(#{__item_boolval_optkeys(tagid(tagOrId)).join('|')})$/
+ begin
+ conf[1] = bool(conf[1])
+ rescue
+ conf[1] = nil
+ end
+
+ when /^(#{__item_listval_optkeys(tagid(tagOrId)).join('|')})$/
+ conf[1] = simplelist(conf[1])
+
+ when /^(#{__item_numlistval_optkeys(tagid(tagOrId)).join('|')})$/
+ if conf[1] =~ /^[0-9]/
+ conf[1] = list(conf[1])
+ end
+
+ when /^(#{__item_tkvariable_optkeys(tagid(tagOrId)).join('|')})$/
+ if conf[1].empty?
+ conf[1] = nil
+ else
+ conf[1] = TkVarAccess.new(conf[1])
+ end
+
+ else
+ if conf[1].index('{')
+ return [slot, tk_split_list(conf[1])]
+ else
+ return [slot, tk_tcl2ruby(conf[1])]
+ end
+ end
+
+ ret[conf[0]] = conf[1]
+ }
+
+ __item_font_optkeys(tagid(tagOrId)).each{|optkey|
+ optkey = optkey.to_s
+ fontconf = ret[optkey]
+ if fontconf.kind_of?(Array)
+ ret.delete(optkey)
+ ret.delete('latin' << optkey)
+ ret.delete('ascii' << optkey)
+ ret.delete('kanji' << optkey)
+ fontconf[1] = tagfontobj(tagid(tagOrId), optkey)
+ ret[optkey] = fontconf
+ end
+ }
+
+ __item_methodcall_optkeys(tagid(tagOrId)).each{|optkey, method|
+ ret[optkey.to_s] = self.__send__(method, tagOrId)
+ }
+
+ ret
+ end
+ end
+ end
+ end
+
+ ###################
+
+ def __item_cget_cmd(id)
+ [self.path, *id]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id)
+ [self.path, *id]
+ end
+ private :__item_config_cmd
+
+ def __item_numstrval_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ ['width']
+ when :column, 'column'
+ super(id[1]) + ['minwidth']
+ when :tag, 'tag'
+ super(id[1])
+ when :heading, 'heading'
+ super(id[1])
+ else
+ super(id[1])
+ end
+ end
+ private :__item_numstrval_optkeys
+
+ def __item_strval_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ super(id) + ['id']
+ when :column, 'column'
+ super(id[1])
+ when :tag, 'tag'
+ super(id[1])
+ when :heading, 'heading'
+ super(id[1])
+ else
+ super(id[1])
+ end
+ end
+ private :__item_strval_optkeys
+
+ def __item_boolval_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ ['open']
+ when :column, 'column'
+ super(id[1]) + ['stretch']
+ when :tag, 'tag'
+ super(id[1])
+ when :heading, 'heading'
+ super(id[1])
+ end
+ end
+ private :__item_boolval_optkeys
+
+ def __item_listval_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ ['values']
+ when :column, 'column'
+ []
+ when :heading, 'heading'
+ []
+ else
+ []
+ end
+ end
+ private :__item_listval_optkeys
+
+ def __item_val2ruby_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ {
+ 'tags'=>proc{|arg_id, val|
+ simplelist(val).collect{|tag|
+ Tk::Tile::Treeview::Tag.id2obj(self, tag)
+ }
+ }
+ }
+ when :column, 'column'
+ {}
+ when :heading, 'heading'
+ {}
+ else
+ {}
+ end
+ end
+ private :__item_val2ruby_optkeys
+
+ def __tile_specific_item_optkeys(id)
+ case id[0]
+ when :item, 'item'
+ []
+ when :column, 'column'
+ []
+ when :heading, 'heading'
+ ['state'] # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
+ else
+ []
+ end
+ end
+ private :__item_val2ruby_optkeys
+
+ def itemconfiginfo(tagOrId, slot = nil)
+ __itemconfiginfo_core(tagOrId, slot)
+ end
+
+ def current_itemconfiginfo(tagOrId, slot = nil)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ if slot
+ org_slot = slot
+ begin
+ conf = __itemconfiginfo_core(tagOrId, slot)
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ return {conf[0] => conf[-1]}
+ end
+ slot = conf[__item_configinfo_struct(tagid(tagOrId))[:alias]]
+ end while(org_slot != slot)
+ fail RuntimeError,
+ "there is a configure alias loop about '#{org_slot}'"
+ else
+ ret = {}
+ __itemconfiginfo_core(tagOrId).each{|conf|
+ if ( ! __item_configinfo_struct(tagid(tagOrId))[:alias] \
+ || conf.size > __item_configinfo_struct(tagid(tagOrId))[:alias] + 1 )
+ ret[conf[0]] = conf[-1]
+ end
+ }
+ ret
+ end
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ ret = {}
+ __itemconfiginfo_core(tagOrId, slot).each{|key, conf|
+ ret[key] = conf[-1] if conf.kind_of?(Array)
+ }
+ ret
+ end
+ end
+
+ alias __itemcget_tkstring itemcget_tkstring
+ alias __itemcget itemcget
+ alias __itemcget_strict itemcget_strict
+ alias __itemconfigure itemconfigure
+ alias __itemconfiginfo itemconfiginfo
+ alias __current_itemconfiginfo current_itemconfiginfo
+
+ private :__itemcget_tkstring, :__itemcget, :__itemcget_strict
+ private :__itemconfigure, :__itemconfiginfo, :__current_itemconfiginfo
+
+ # Treeview Item
+ def itemcget_tkstring(tagOrId, option)
+ __itemcget_tkstring([:item, tagOrId], option)
+ end
+ def itemcget(tagOrId, option)
+ __itemcget([:item, tagOrId], option)
+ end
+ def itemcget_strict(tagOrId, option)
+ __itemcget_strict([:item, tagOrId], option)
+ end
+ def itemconfigure(tagOrId, slot, value=None)
+ __itemconfigure([:item, tagOrId], slot, value)
+ end
+ def itemconfiginfo(tagOrId, slot=nil)
+ __itemconfiginfo([:item, tagOrId], slot)
+ end
+ def current_itemconfiginfo(tagOrId, slot=nil)
+ __current_itemconfiginfo([:item, tagOrId], slot)
+ end
+
+ # Treeview Column
+ def columncget_tkstring(tagOrId, option)
+ __itemcget_tkstring([:column, tagOrId], option)
+ end
+ def columncget(tagOrId, option)
+ __itemcget([:column, tagOrId], option)
+ end
+ def columncget_strict(tagOrId, option)
+ __itemcget_strict([:column, tagOrId], option)
+ end
+ def columnconfigure(tagOrId, slot, value=None)
+ __itemconfigure([:column, tagOrId], slot, value)
+ end
+ def columnconfiginfo(tagOrId, slot=nil)
+ __itemconfiginfo([:column, tagOrId], slot)
+ end
+ def current_columnconfiginfo(tagOrId, slot=nil)
+ __current_itemconfiginfo([:column, tagOrId], slot)
+ end
+ alias column_cget_tkstring columncget_tkstring
+ alias column_cget columncget
+ alias column_cget_strict columncget_strict
+ alias column_configure columnconfigure
+ alias column_configinfo columnconfiginfo
+ alias current_column_configinfo current_columnconfiginfo
+
+ # Treeview Heading
+ def headingcget_tkstring(tagOrId, option)
+ if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s)
+ begin
+ # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s))
+ rescue
+ # Maybe, 'state' option has '-' in future.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}"))
+ end
+ else
+ __itemcget_tkstring([:heading, tagOrId], option)
+ end
+ end
+ def headingcget_strict(tagOrId, option)
+ if __tile_specific_item_optkeys([:heading, tagOrId]).index(option.to_s)
+ begin
+ # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << option.to_s))
+ rescue
+ # Maybe, 'state' option has '-' in future.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{option}"))
+ end
+ else
+ __itemcget_strict([:heading, tagOrId], option)
+ end
+ end
+ def headingcget(tagOrId, option)
+ unless TkItemConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
+ headingcget_strict(tagOrId, option)
+ else
+ begin
+ headingcget_strict(tagOrId, option)
+ rescue => e
+ begin
+ if current_headingconfiginfo(tagOrId).has_key?(option.to_s)
+ # not tag error & option is known -> error on known option
+ fail e
+ else
+ # not tag error & option is unknown
+ nil
+ end
+ rescue
+ fail e # tag error
+ end
+ end
+ end
+ end
+ def headingconfigure(tagOrId, slot, value=None)
+ if slot.kind_of?(Hash)
+ slot = _symbolkey2str(slot)
+ sp_kv = []
+ __tile_specific_item_optkeys([:heading, tagOrId]).each{|k|
+ sp_kv << k << _get_eval_string(slot.delete(k)) if slot.has_key?(k)
+ }
+ tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(sp_kv)))
+ tk_call(*(__item_config_cmd([:heading, tagOrId]).concat(hash_kv(slot))))
+ elsif __tile_specific_item_optkeys([:heading, tagOrId]).index(slot.to_s)
+ begin
+ # On tile-0.7.{2-8}, 'state' options has no '-' at its head.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << slot.to_s << value))
+ rescue
+ # Maybe, 'state' option has '-' in future.
+ tk_call(*(__item_cget_cmd([:heading, tagOrId]) << "-#{slot}" << value))
+ end
+ else
+ __itemconfigure([:heading, tagOrId], slot, value)
+ end
+ self
+ end
+ def headingconfiginfo(tagOrId, slot=nil)
+ __itemconfiginfo([:heading, tagOrId], slot)
+ end
+ def current_headingconfiginfo(tagOrId, slot=nil)
+ __current_itemconfiginfo([:heading, tagOrId], slot)
+ end
+ alias heading_cget_tkstring headingcget_tkstring
+ alias heading_cget headingcget
+ alias heading_cget_strict headingcget_strict
+ alias heading_configure headingconfigure
+ alias heading_configinfo headingconfiginfo
+ alias current_heading_configinfo current_headingconfiginfo
+
+ # Treeview Tag
+ def tagcget_tkstring(tagOrId, option)
+ __itemcget_tkstring([:tag, :configure, tagOrId], option)
+ end
+ def tagcget(tagOrId, option)
+ __itemcget([:tag, :configure, tagOrId], option)
+ end
+ def tagcget_strict(tagOrId, option)
+ __itemcget_strict([:tag, :configure, tagOrId], option)
+ end
+ def tagconfigure(tagOrId, slot, value=None)
+ __itemconfigure([:tag, :configure, tagOrId], slot, value)
+ end
+ def tagconfiginfo(tagOrId, slot=nil)
+ __itemconfiginfo([:tag, :configure, tagOrId], slot)
+ end
+ def current_tagconfiginfo(tagOrId, slot=nil)
+ __current_itemconfiginfo([:tag, :configure, tagOrId], slot)
+ end
+ alias tag_cget_tkstring tagcget_tkstring
+ alias tag_cget tagcget
+ alias tag_cget_strict tagcget_strict
+ alias tag_configure tagconfigure
+ alias tag_configinfo tagconfiginfo
+ alias current_tag_configinfo current_tagconfiginfo
+end
+
+########################
+
+class Tk::Tile::Treeview::Item < TkObject
+ ItemID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ Tk::Tile::Treeview::Item::ItemID_TBL.clear
+ }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ if Tk::Tile::Treeview::Item::ItemID_TBL[tpath]
+ (Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id])? \
+ Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def self.assign(tree, id)
+ tpath = tree.path
+ obj = nil
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ if Tk::Tile::Treeview::Item::ItemID_TBL[tpath] &&
+ Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
+ return Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
+ end
+
+ obj = self.allocate
+ obj.instance_eval{
+ @parent = @t = tree
+ @tpath = tpath
+ @path = @id = id
+ }
+ Tk::Tile::Treeview::Item::ItemID_TBL[tpath] ||= {}
+ Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id] = obj
+ }
+ obj
+ end
+
+ def _insert_item(tree, parent_item, idx, keys={})
+ keys = _symbolkey2str(keys)
+ id = keys.delete('id')
+ if id
+ num_or_str(tk_call(tree, 'insert',
+ parent_item, idx, '-id', id, *hash_kv(keys)))
+ else
+ num_or_str(tk_call(tree, 'insert', parent_item, idx, *hash_kv(keys)))
+ end
+ end
+ private :_insert_item
+
+ def initialize(tree, parent_item = '', idx = 'end', keys = {})
+ if parent_item.kind_of?(Hash)
+ keys = parent_item
+ idx = 'end'
+ parent_item = ''
+ elsif idx.kind_of?(Hash)
+ keys = idx
+ idx = 'end'
+ end
+
+ @parent = @t = tree
+ @tpath = tree.path
+ @path = @id = _insert_item(@t, parent_item, idx, keys)
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ ItemID_TBL[@tpath] = {} unless ItemID_TBL[@tpath]
+ ItemID_TBL[@tpath][@id] = self
+ }
+ end
+ def id
+ @id
+ end
+
+ def cget_tkstring(option)
+ @t.itemcget_tkstring(@id, option)
+ end
+ def cget(option)
+ @t.itemcget(@id, option)
+ end
+ def cget_strict(option)
+ @t.itemcget_strict(@id, option)
+ end
+
+ def configure(key, value=None)
+ @t.itemconfigure(@id, key, value)
+ self
+ end
+
+ def configinfo(key=nil)
+ @t.itemconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @t.current_itemconfiginfo(@id, key)
+ end
+
+ def open?
+ cget('open')
+ end
+ def open
+ configure('open', true)
+ self
+ end
+ def close
+ configure('open', false)
+ self
+ end
+
+ def tag_has?(tag)
+ @t.tag_has?(tag, @id)
+ end
+ alias has_tag? tag_has?
+
+ def bbox(column=None)
+ @t.bbox(@id, column)
+ end
+
+ def children
+ @t.children(@id)
+ end
+ def set_children(*items)
+ @t.set_children(@id, *items)
+ self
+ end
+
+ def delete
+ @t.delete(@id)
+ self
+ end
+
+ def detach
+ @t.detach(@id)
+ self
+ end
+
+ def exist?
+ @t.exist?(@id)
+ end
+
+ def focus
+ @t.focus_item(@id)
+ end
+
+ def index
+ @t.index(@id)
+ end
+
+ def insert(idx='end', keys={})
+ @t.insert(@id, idx, keys)
+ end
+
+ def move(parent, idx)
+ @t.move(@id, parent, idx)
+ self
+ end
+
+ def next_item
+ @t.next_item(@id)
+ end
+
+ def parent_item
+ @t.parent_item(@id)
+ end
+
+ def prev_item
+ @t.prev_item(@id)
+ end
+
+ def see
+ @t.see(@id)
+ self
+ end
+
+ def selection_add
+ @t.selection_add(@id)
+ self
+ end
+
+ def selection_remove
+ @t.selection_remove(@id)
+ self
+ end
+
+ def selection_set
+ @t.selection_set(@id)
+ self
+ end
+
+ def selection_toggle
+ @t.selection_toggle(@id)
+ self
+ end
+
+ def get_directory
+ @t.get_directory(@id)
+ end
+ alias get_dictionary get_directory
+
+ def get(col)
+ @t.get(@id, col)
+ end
+
+ def set(col, value)
+ @t.set(@id, col, value)
+ end
+end
+
+########################
+
+class Tk::Tile::Treeview::Root < Tk::Tile::Treeview::Item
+ def self.new(tree, keys = {})
+ tpath = tree.path
+ obj = nil
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ if Tk::Tile::Treeview::Item::ItemID_TBL[tpath] &&
+ Tk::Tile::Treeview::Item::ItemID_TBL[tpath]['']
+ obj = Tk::Tile::Treeview::Item::ItemID_TBL[tpath]['']
+ else
+ #super(tree, keys)
+ (obj = self.allocate).instance_eval{
+ @parent = @t = tree
+ @tpath = tree.path
+ @path = @id = ''
+ Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
+ Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
+ }
+ end
+ }
+ obj.configure(keys) if keys && ! keys.empty?
+ obj
+ end
+
+ def initialize(tree, keys = {})
+ # dummy:: not called by 'new' method
+ @parent = @t = tree
+ @tpath = tree.path
+ @path = @id = ''
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
+ Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
+ }
+ end
+end
+
+########################
+
+class Tk::Tile::Treeview::Tag < TkObject
+ include TkTreatTagFont
+
+ TagID_TBL = TkCore::INTERP.create_table
+
+ (Tag_ID = ['tile_treeview_tag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ Tk::Tile::Treeview::Tag::TagID_TBL.mutex.synchronize{
+ Tk::Tile::Treeview::Tag::TagID_TBL.clear
+ }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::Tile::Treeview::Tag::TagID_TBL.mutex.synchronize{
+ if Tk::Tile::Treeview::Tag::TagID_TBL[tpath]
+ (Tk::Tile::Treeview::Tag::TagID_TBL[tpath][id])? \
+ Tk::Tile::Treeview::Tag::TagID_TBL[tpath][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(tree, keys=nil)
+ @parent = @t = tree
+ @tpath = tree.path
+ Tag_ID.mutex.synchronize{
+ @path = @id = Tag_ID.join(TkCore::INTERP._ip_id_)
+ Tag_ID[1].succ!
+ }
+ TagID_TBL.mutex.synchronize{
+ TagID_TBL[@tpath] = {} unless TagID_TBL[@tpath]
+ TagID_TBL[@tpath][@id] = self
+ }
+ if keys && keys != None
+ tk_call_without_enc(@tpath, 'tag', 'configure', @id, *hash_kv(keys,true))
+ end
+ end
+ def id
+ @id
+ end
+
+ def tag_has?(item)
+ @t.tag_has?(@id, item)
+ end
+ alias added? tag_has?
+
+ def bind(seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @t.tag_bind(@id, seq, cmd, *args)
+ self
+ end
+
+ def bind_append(seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ @t.tag_bind_append(@id, seq, cmd, *args)
+ self
+ end
+
+ def bind_remove(seq)
+ @t.tag_bind_remove(@id, seq)
+ self
+ end
+
+ def bindinfo(seq=nil)
+ @t.tag_bindinfo(@id, seq)
+ end
+
+ def cget_tkstring(option)
+ @t.tagcget_tkstring(@id, option)
+ end
+ def cget(option)
+ @t.tagcget(@id, option)
+ end
+ def cget_strict(option)
+ @t.tagcget_strict(@id, option)
+ end
+
+ def configure(key, value=None)
+ @t.tagconfigure(@id, key, value)
+ self
+ end
+
+ def configinfo(key=nil)
+ @t.tagconfiginfo(@id, key)
+ end
+
+ def current_configinfo(key=nil)
+ @t.current_tagconfiginfo(@id, key)
+ end
+end
+
+########################
+
+class Tk::Tile::Treeview < TkWindow
+ include Tk::Tile::TileWidget
+ include Scrollable
+
+ include Tk::Tile::TreeviewConfig
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::treeview'.freeze].freeze
+ else
+ TkCommandNames = ['::treeview'.freeze].freeze
+ end
+ WidgetClassName = 'Treeview'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __destroy_hook__
+ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
+ Tk::Tile::Treeview::Item::ItemID_TBL.delete(@path)
+ }
+ Tk::Tile::Treeview::Tag::ItemID_TBL.mutex.synchronize{
+ Tk::Tile::Treeview::Tag::ItemID_TBL.delete(@path)
+ }
+ end
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def tagid(id)
+ if id.kind_of?(Tk::Tile::Treeview::Item) ||
+ id.kind_of?(Tk::Tile::Treeview::Tag)
+ id.id
+ elsif id.kind_of?(Array)
+ # size is 2 or 3
+ id[0..-2] << _get_eval_string(id[-1])
+ else
+ _get_eval_string(id)
+ end
+ end
+
+ def root
+ Tk::Tile::Treeview::Root.new(self)
+ end
+
+ def bbox(item, column=None)
+ list(tk_send('item', 'bbox', item, column))
+ end
+
+ def children(item)
+ simplelist(tk_send_without_enc('children', item)).collect{|id|
+ Tk::Tile::Treeview::Item.id2obj(self, id)
+ }
+ end
+ def set_children(item, *items)
+ tk_send_without_enc('children', item,
+ array2tk_list(items.flatten, true))
+ self
+ end
+
+ def delete(*items)
+ tk_send_without_enc('delete', array2tk_list(items.flatten, true))
+ self
+ end
+
+ def detach(*items)
+ tk_send_without_enc('detach', array2tk_list(items.flatten, true))
+ self
+ end
+
+ def exist?(item)
+ bool(tk_send_without_enc('exists', _get_eval_enc_str(item)))
+ end
+
+ def focus_item(item = nil)
+ if item
+ tk_send('focus', item)
+ item
+ else
+ id = tk_send('focus')
+ (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+ end
+
+ def identify(x, y)
+ # tile-0.7.2 or previous
+ ret = simplelist(tk_send('identify', x, y))
+ case ret[0]
+ when 'heading', 'separator'
+ ret[-1] = num_or_str(ret[-1])
+ when 'cell'
+ ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1])
+ ret[-1] = num_or_str(ret[-1])
+ when 'item', 'row'
+ ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1])
+ end
+ end
+
+ def identify_region(x, y)
+ tk_send('identify', 'region', x, y)
+ end
+
+ def identify_item(x, y)
+ id = tk_send('identify', 'item', x, y)
+ (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+
+ def identify_element(x, y)
+ tk_send('identify', 'element', x, y)
+ end
+
+ def row_identify(x, y)
+ id = tk_send('identify', 'row', x, y)
+ (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+ alias identify_row row_identify
+
+ def column_identify(x, y)
+ tk_send('identify', 'column', x, y)
+ end
+ alias identify_column column_identify
+
+ def index(item)
+ number(tk_send('index', item))
+ end
+
+ # def insert(parent, idx='end', keys={})
+ # keys = _symbolkey2str(keys)
+ # id = keys.delete('id')
+ # if id
+ # num_or_str(tk_send('insert', parent, idx, '-id', id, *hash_kv(keys)))
+ # else
+ # num_or_str(tk_send('insert', parent, idx, *hash_kv(keys)))
+ # end
+ # end
+ def insert(parent, idx='end', keys={})
+ Tk::Tile::Treeview::Item.new(self, parent, idx, keys)
+ end
+
+ # def instate(spec, cmd=Proc.new)
+ # tk_send('instate', spec, cmd)
+ # end
+ # def state(spec=None)
+ # tk_send('state', spec)
+ # end
+
+ def move(item, parent, idx)
+ tk_send('move', item, parent, idx)
+ self
+ end
+
+ def next_item(item)
+ id = tk_send('next', item)
+ (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+
+ def parent_item(item)
+ if (id = tk_send('parent', item)).empty?
+ Tk::Tile::Treeview::Root.new(self)
+ else
+ Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+ end
+
+ def prev_item(item)
+ id = tk_send('prev', item)
+ (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id)
+ end
+
+ def see(item)
+ tk_send('see', item)
+ self
+ end
+
+ def selection
+ simplelist(tk_send('selection')).collect{|id|
+ Tk::Tile::Treeview::Item.id2obj(self, id)
+ }
+ end
+ alias selection_get selection
+
+ def selection_add(*items)
+ tk_send('selection', 'add', array2tk_list(items.flatten, true))
+ self
+ end
+ def selection_remove(*items)
+ tk_send('selection', 'remove', array2tk_list(items.flatten, true))
+ self
+ end
+ def selection_set(*items)
+ tk_send('selection', 'set', array2tk_list(items.flatten, true))
+ self
+ end
+ def selection_toggle(*items)
+ tk_send('selection', 'toggle', array2tk_list(items.flatten, true))
+ self
+ end
+
+ def get_directory(item)
+ # tile-0.7+
+ ret = []
+ lst = simplelist(tk_send('set', item))
+ until lst.empty?
+ col = lst.shift
+ val = lst.shift
+ ret << [col, val]
+ end
+ ret
+ end
+ alias get_dictionary get_directory
+
+ def get(item, col)
+ tk_send('set', item, col)
+ end
+ def set(item, col, value)
+ tk_send('set', item, col, value)
+ self
+ end
+
+ def tag_has?(tag, item)
+ bool(tk_send('tag', 'has', tagid(tag), tagid(item)))
+ end
+ def tag_has(tag)
+ tk_split_simplelist(tk_send('tag', 'has', tagid(tag))).collect{|id|
+ Tk::Tile::Treeview::Item.id2obj(self, id)
+ }
+ end
+
+ def tag_bind(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ self
+ end
+ alias tagbind tag_bind
+
+ def tag_bind_append(tag, seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args)
+ self
+ end
+ alias tagbind_append tag_bind_append
+
+ def tag_bind_remove(tag, seq)
+ _bind_remove([@path, 'tag', 'bind', tag], seq)
+ self
+ end
+ alias tagbind_remove tag_bind_remove
+
+ def tag_bindinfo(tag, context=nil)
+ _bindinfo([@path, 'tag', 'bind', tag], context)
+ end
+ alias tagbindinfo tag_bindinfo
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/treeview.rb',
+ :Ttk, Tk::Tile::Treeview, :TkTreeview)
diff --git a/ext/tk/lib/tkextlib/tile/tscale.rb b/ext/tk/lib/tkextlib/tile/tscale.rb
new file mode 100644
index 0000000000..7eefcef731
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tscale.rb
@@ -0,0 +1,56 @@
+#
+# tscale & tprogress widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TScale < Tk::Scale
+ end
+ Scale = TScale
+
+ class TProgress < TScale
+ end
+ Progress = TProgress
+ end
+end
+
+class Tk::Tile::TScale < Tk::Scale
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::scale'.freeze].freeze
+ else
+ TkCommandNames = ['::tscale'.freeze].freeze
+ end
+ WidgetClassName = 'TScale'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ alias identify ttk_identify
+end
+
+class Tk::Tile::TProgress < Tk::Tile::TScale
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::progress'.freeze].freeze
+ else
+ TkCommandNames = ['::tprogress'.freeze].freeze
+ end
+ WidgetClassName = 'TProgress'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scale, :TkScale)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscale.rb',
+ :Ttk, Tk::Tile::Scale, :TkScale)
diff --git a/ext/tk/lib/tkextlib/tile/tscrollbar.rb b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
new file mode 100644
index 0000000000..c6bba5810b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tscrollbar.rb
@@ -0,0 +1,63 @@
+#
+# tscrollbar widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TScrollbar < Tk::Scrollbar
+ end
+ Scrollbar = TScrollbar
+ end
+end
+
+class Tk::Tile::TScrollbar < Tk::Scrollbar
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::scrollbar'.freeze].freeze
+ else
+ TkCommandNames = ['::tscrollbar'.freeze].freeze
+ end
+ WidgetClassName = 'TScrollbar'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ alias identify ttk_identify
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Scrollbar, :TkScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb',
+ :Ttk, Tk::Tile::Scrollbar, :TkScrollbar)
+
+#######################################################################
+
+class Tk::Tile::XScrollbar < Tk::Tile::TScrollbar
+ def create_self(keys)
+ keys = {} unless keys
+ keys['orient'] = 'horizontal'
+ super(keys)
+ end
+ private :create_self
+end
+
+class Tk::Tile::YScrollbar < Tk::Tile::TScrollbar
+ def create_self(keys)
+ keys = {} unless keys
+ keys['orient'] = 'vertical'
+ super(keys)
+ end
+ private :create_self
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::XScrollbar, :TkXScrollbar)
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::YScrollbar, :TkYScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb',
+ :Ttk, Tk::Tile::XScrollbar, :TkXScrollbar)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tscrollbar.rb',
+ :Ttk, Tk::Tile::YScrollbar, :TkYScrollbar)
diff --git a/ext/tk/lib/tkextlib/tile/tseparator.rb b/ext/tk/lib/tkextlib/tile/tseparator.rb
new file mode 100644
index 0000000000..ffd2f6f89f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tseparator.rb
@@ -0,0 +1,34 @@
+#
+# tseparator widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TSeparator < TkWindow
+ end
+ Separator = TSeparator
+ end
+end
+
+class Tk::Tile::TSeparator < TkWindow
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::separator'.freeze].freeze
+ else
+ TkCommandNames = ['::tseparator'.freeze].freeze
+ end
+ WidgetClassName = 'TSeparator'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Separator, :TkSeparator)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tseparator.rb',
+ :Ttk, Tk::Tile::Separator, :TkSeparator)
diff --git a/ext/tk/lib/tkextlib/tile/tspinbox.rb b/ext/tk/lib/tkextlib/tile/tspinbox.rb
new file mode 100644
index 0000000000..2f2d73c5ab
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tspinbox.rb
@@ -0,0 +1,107 @@
+#
+# ttk::spinbox widget (Tcl/Tk 8.6b1 or later)
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TSpinbox < Tk::Tile::TEntry
+ end
+ Spinbox = TSpinbox
+ end
+end
+
+class Tk::Tile::TSpinbox < Tk::Tile::TEntry
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::spinbox'.freeze].freeze
+ else
+ TkCommandNames = ['::tspinbox'.freeze].freeze
+ end
+ WidgetClassName = 'TSpinbox'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ class SpinCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?d, ?s, :direction ],
+ [ ?s, ?e, :current ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+
+ [ ?e, proc{|val|
+ #enc = Tk.encoding
+ enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
+ if enc
+ Tk.fromUTF8(TkComm::string(val), enc)
+ else
+ TkComm::string(val)
+ end
+ }
+ ],
+
+ nil
+ ]
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ (val)? '1': '0'
+ end
+ end
+
+ def self._config_keys
+ ['command']
+ end
+ end
+
+ def __validation_class_list
+ super() << SpinCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, SpinCommand)
+
+ def __boolval_optkeys
+ super() << 'wrap'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'buttonbackground' << 'format'
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ super() << 'values'
+ end
+ private :__listval_optkeys
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+
+ def current
+ number(tk_send_without_enc('current'))
+ end
+ def current=(idx)
+ tk_send('current', idx)
+ end
+
+ def set(val)
+ tk_send('set', val)
+ end
+
+ alias identify ttk_identify
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Spinbox, :TkSpinbox)
+Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/tspinbox.rb',
+ :Ttk, Tk::Tile::Spinbox, :TkSpinbox)
diff --git a/ext/tk/lib/tkextlib/tile/tsquare.rb b/ext/tk/lib/tkextlib/tile/tsquare.rb
new file mode 100644
index 0000000000..a81cd7b98a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/tsquare.rb
@@ -0,0 +1,30 @@
+#
+# tsquare widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tkextlib/tile.rb'
+
+module Tk
+ module Tile
+ class TSquare < TkWindow
+ end
+ Square = TSquare
+ end
+end
+
+class Tk::Tile::TSquare < TkWindow
+ include Tk::Tile::TileWidget
+
+ if Tk::Tile::USE_TTK_NAMESPACE
+ TkCommandNames = ['::ttk::square'.freeze].freeze
+ else
+ TkCommandNames = ['::tsquare'.freeze].freeze
+ end
+ WidgetClassName = 'TSquare'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def self.style(*args)
+ [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkDND.rb b/ext/tk/lib/tkextlib/tkDND.rb
new file mode 100644
index 0000000000..5d52e34418
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkDND.rb
@@ -0,0 +1,18 @@
+#
+# TkDND (Tk Drag & Drop Extension) support
+# 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/tkDND/setup.rb'
+
+module Tk
+ module TkDND
+ autoload :DND, 'tkextlib/tkDND/tkdnd'
+ autoload :Shape, 'tkextlib/tkDND/shape'
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkDND/setup.rb b/ext/tk/lib/tkextlib/tkDND/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkDND/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tkDND/shape.rb b/ext/tk/lib/tkextlib/tkDND/shape.rb
new file mode 100644
index 0000000000..d44068ed33
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkDND/shape.rb
@@ -0,0 +1,125 @@
+#
+# tkextlib/tkDND/shape.rb
+# 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/tkDND/setup.rb'
+
+# TkPackage.require('Shape', '0.3')
+TkPackage.require('Shape')
+
+module Tk
+ module TkDND
+ module Shape
+ extend TkCore
+
+ PACKAGE_NAME = 'Shape'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+=begin
+ def self.package_version
+ begin
+ TkPackage.require('Shape')
+ rescue
+ ''
+ end
+ end
+=end
+ class << self
+ def package_version
+ Tk.tk_call('set', 'shape_version')
+ end
+ alias shape_version package_version
+
+ def package_patchlevel
+ Tk.tk_call('set', 'shape_patchLevel')
+ end
+ alias shape_patchlevel package_patchlevel
+
+ def version
+ tk_call('shape', 'version')
+ end
+ alias xshape_version version
+ end
+
+ ############################
+
+ def shape_bounds(kind=nil)
+ if kind
+ ret = tk_call('shape', 'bounds', @path, "-#{kind}")
+ else
+ ret = tk_call('shape', 'bounds', @path)
+ end
+ if ret == ""
+ nil
+ else
+ list(ret)
+ end
+ end
+
+ def shape_get(kind=nil)
+ if kind
+ list(tk_call('shape', 'get', @path, "-#{kind}"))
+ else
+ list(tk_call('shape', 'get', @path))
+ end
+ end
+
+ def shape_offset(x, y, kind=nil)
+ if kind
+ tk_call('shape', 'get', @path, "-#{kind}", x, y)
+ else
+ tk_call('shape', 'get', @path, x, y)
+ end
+ self
+ end
+
+ def _parse_shapespec_param(args)
+ cmd = []
+
+ kind_keys = ['bounding', 'clip', 'both']
+ offset_keys = ['offset']
+ srckind_keys = ['bitmap', 'rectangles', 'reset', 'test', 'window']
+
+ cmd << "-#{args.shift}" if kind_keys.member?(args[0].to_s)
+
+ if offset_keys.member?(args[0].to_s)
+ cmd << "-#{args.shift}"
+ cmd << args.shift # xOffset
+ cmd << args.shift # yOffset
+ end
+
+ if srckind_keys.member?(args[0].to_s)
+ cmd << "-#{args.shift}"
+ end
+
+ cmd.concat(args)
+
+ cmd
+ end
+ private :_parse_shapespec_param
+
+ def shape_set(*args) # ?kind? ?offset <x> <y>? srckind ?arg ...?
+ tk_call('shape', 'set', @path, *(_parse_shapespec_param(args)))
+ self
+ end
+
+ def shape_update(op, *args) # ?kind? ?offset <x> <y>? srckind ?arg ...?
+ tk_call('shape', 'update', @path, op, *(_parse_shapespec_param(args)))
+ self
+ end
+ end
+ end
+end
+
+class TkWindow
+ include Tk::TkDND::Shape
+end
diff --git a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
new file mode 100644
index 0000000000..38e05ce775
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb
@@ -0,0 +1,182 @@
+#
+# tkextlib/tkDND/tkdnd.rb
+# 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/tkDND/setup.rb'
+
+TkPackage.require('tkdnd')
+
+module Tk
+ module TkDND
+ PACKAGE_NAME = 'tkdnd'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('tkdnd')
+ rescue
+ ''
+ end
+ end
+
+ class DND_Subst < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?a, ?l, :actions ],
+ [ ?A, ?s, :action ],
+ [ ?b, ?L, :codes ],
+ [ ?c, ?s, :code ],
+ [ ?d, ?l, :descriptions ],
+ [ ?D, ?l, :data ],
+ [ ?L, ?l, :source_types ],
+ [ ?m, ?l, :modifiers ],
+ [ ?t, ?l, :types ],
+ [ ?T, ?s, :type ],
+ [ ?W, ?w, :widget ],
+ [ ?x, ?n, :x ],
+ [ ?X, ?n, :x_root ],
+ [ ?y, ?n, :y ],
+ [ ?Y, ?n, :y_root ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?l, TkComm.method(:list) ],
+ [ ?L, TkComm.method(:simplelist) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ # setup tables
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+ end
+
+ module DND
+ def self.version
+ begin
+ TkPackage.require('tkdnd')
+ rescue
+ ''
+ end
+ end
+
+ def dnd_bindtarget_info(type=nil, event=nil)
+ if event
+ procedure(tk_call('dnd', 'bindtarget', @path, type, event))
+ elsif type
+ procedure(tk_call('dnd', 'bindtarget', @path, type))
+ else
+ simplelist(tk_call('dnd', 'bindtarget', @path))
+ end
+ end
+
+ #def dnd_bindtarget(type, event, cmd=Proc.new, prior=50, *args)
+ # event = tk_event_sequence(event)
+ # if prior.kind_of?(Numeric)
+ # tk_call('dnd', 'bindtarget', @path, type, event,
+ # install_bind_for_event_class(DND_Subst, cmd, *args),
+ # prior)
+ # else
+ # tk_call('dnd', 'bindtarget', @path, type, event,
+ # install_bind_for_event_class(DND_Subst, cmd, prior, *args))
+ # end
+ # self
+ #end
+ def dnd_bindtarget(type, event, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+
+ prior = 50
+ prior = args.shift unless args.empty?
+
+ event = tk_event_sequence(event)
+ if prior.kind_of?(Numeric)
+ tk_call('dnd', 'bindtarget', @path, type, event,
+ install_bind_for_event_class(DND_Subst, cmd, *args),
+ prior)
+ else
+ tk_call('dnd', 'bindtarget', @path, type, event,
+ install_bind_for_event_class(DND_Subst, cmd, prior, *args))
+ end
+ self
+ end
+
+ def dnd_cleartarget
+ tk_call('dnd', 'cleartarget', @path)
+ self
+ end
+
+ def dnd_bindsource_info(type=nil)
+ if type
+ procedure(tk_call('dnd', 'bindsource', @path, type))
+ else
+ simplelist(tk_call('dnd', 'bindsource', @path))
+ end
+ end
+
+ #def dnd_bindsource(type, cmd=Proc.new, prior=None)
+ # tk_call('dnd', 'bindsource', @path, type, cmd, prior)
+ # self
+ #end
+ def dnd_bindsource(type, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+
+ args = [TkComm::None] if args.empty?
+
+ tk_call('dnd', 'bindsource', @path, type, cmd, *args)
+ self
+ end
+
+ def dnd_clearsource()
+ tk_call('dnd', 'clearsource', @path)
+ self
+ end
+
+ def dnd_drag(keys=nil)
+ tk_call('dnd', 'drag', @path, *hash_kv(keys))
+ self
+ end
+ end
+ end
+end
+
+class TkWindow
+ include Tk::TkDND::DND
+end
diff --git a/ext/tk/lib/tkextlib/tkHTML.rb b/ext/tk/lib/tkextlib/tkHTML.rb
new file mode 100644
index 0000000000..5fddde72ff
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkHTML.rb
@@ -0,0 +1,13 @@
+#
+# TkHtml support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tkHTML/setup.rb'
+
+# load library
+require 'tkextlib/tkHTML/htmlwidget'
diff --git a/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
new file mode 100644
index 0000000000..b9ee90aace
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb
@@ -0,0 +1,453 @@
+#
+# tkextlib/tkHTML/htmlwidget.rb
+# 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/tkHTML/setup.rb'
+
+# TkPackage.require('Tkhtml', '2.0')
+TkPackage.require('Tkhtml')
+
+module Tk
+ class HTML_Widget < TkWindow
+ PACKAGE_NAME = 'Tkhtml'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Tkhtml')
+ rescue
+ ''
+ end
+ end
+
+ class ClippingWindow < TkWindow
+ end
+ end
+end
+
+class Tk::HTML_Widget::ClippingWindow
+ WidgetClassName = 'HtmlClip'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ HtmlClip_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ HtmlClip_TBL.mutex.synchronize{ HtmlClip_TBL.clear }
+ }
+
+ def self.new(parent, keys={})
+ if parent.kind_of?(Hash)
+ keys = TkComm._symbolkey2str(parent)
+ parent = keys.delete('parent')
+ end
+
+ if parent.kind_of?(String)
+ ppath = parent.path
+ elsif parent
+ ppath = parent
+ else
+ ppath = ''
+ end
+ HtmlClip_TBL.mutex.synchronize{
+ return HtmlClip_TBL[ppath] if HtmlClip_TBL[ppath]
+ }
+
+ widgetname = keys.delete('widgetname')
+ if widgetname =~ /^(.*)\.[^.]+$/
+ ppath2 = $1
+ if ppath2[0] != ?.
+ ppath2 = ppath + '.' + ppath2
+ end
+ HtmlClip_TBL.mutex.synchronize{
+ return HtmlClip_TBL[ppath2] if HtmlClip_TBL[ppath2]
+ }
+
+ ppath = ppath2
+ end
+
+ parent = TkComm._genobj_for_tkwidget(ppath)
+ unless parent.kind_of?(Tk::HTML_Widget)
+ fail ArgumentError, "parent must be a Tk::HTML_Widget instance"
+ end
+
+ super(parent)
+ end
+
+ def initialize(parent)
+ @parent = parent
+ @ppath = parent.path
+ @path = @id = @ppath + '.x'
+ HtmlClip_TBL.mutex.synchronize{
+ HtmlClip_TBL[@ppath] = self
+ }
+ end
+
+ def method_missing(m, *args, &b)
+ @parent.__send__(m, *args, &b)
+ end
+end
+
+class Tk::HTML_Widget
+ include Scrollable
+
+ TkCommandNames = ['html'.freeze].freeze
+ WidgetClassName = 'Html'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ def __strval_optkeys
+ super() << 'base' << 'selectioncolor' << 'unvisitedcolor' << 'visitedcolor'
+ end
+ private :__strval_optkeys
+
+ ###################################
+ # class methods
+ ###################################
+ def self.reformat(src, dst, txt)
+ tk_call('html', 'reformat', src, dst, txt)
+ end
+
+ def self.url_join(*args) # args := sheme authority path query fragment
+ tk_call('html', 'urljoin', *args)
+ end
+
+ def self.url_split(uri)
+ tk_call('html', 'urlsplit', uri)
+ end
+
+ def self.lockcopy(src, dst)
+ tk_call('html', 'lockcopy', src, dst)
+ end
+
+ def self.gzip_file(file, dat)
+ tk_call('html', 'gzip', 'file', file, dat)
+ end
+
+ def self.gunzip_file(file, dat)
+ tk_call('html', 'gunzip', 'file', filet)
+ end
+
+ def self.gzip_data(dat)
+ tk_call('html', 'gzip', 'data', file, dat)
+ end
+
+ def self.gunzip_data(dat)
+ tk_call('html', 'gunzip', 'data', filet)
+ end
+
+ def self.base64_encode(dat)
+ tk_call('html', 'base64', 'encode', dat)
+ end
+
+ def self.base64_decode(dat)
+ tk_call('html', 'base64', 'encode', dat)
+ end
+
+ def self.text_format(dat, len)
+ tk_call('html', 'text', 'format', dat, len)
+ end
+
+ def self.xor(cmd, *args)
+ tk_call('html', 'xor', cmd, *args)
+ end
+
+ def self.stdchan(cmd, channel)
+ tk_call('html', 'stdchan', cmd, channel)
+ end
+
+ def self.crc32(data)
+ tk_call('html', 'crc32', data)
+ end
+
+ ###################################
+ # instance methods
+ ###################################
+ def clipping_window
+ ClippingWindow.new(self)
+ end
+ alias clipwin clipping_window
+ alias htmlclip clipping_window
+
+ def bgimage(image, tid=None)
+ tk_send('bgimage', image, tid)
+ self
+ end
+
+ def clear()
+ tk_send('clear')
+ self
+ end
+
+ def coords(index=None, percent=None)
+ tk_send('coords', index, percent)
+ end
+
+ def forminfo(*args)
+ tk_send('forminfo', *args)
+ end
+ alias form_info forminfo
+
+ def href(x, y)
+ simplelist(tk_send('href', x, y))
+ end
+
+ def image_add(id, img)
+ tk_send('imageadd', id, img)
+ self
+ end
+
+ def image_at(x, y)
+ tk_send('imageat', x, y)
+ end
+
+ def images()
+ list(tk_send('images'))
+ end
+
+ def image_set(id, num)
+ tk_send('imageset', id, num)
+ self
+ end
+
+ def image_update(id, imgs)
+ tk_send('imageupdate', id, imgs)
+ self
+ end
+
+ def index(idx, count=None, unit=None)
+ tk_send('index', idx, count, unit)
+ end
+
+ def insert_cursor(idx)
+ tk_send('insert', idx)
+ end
+
+ def names()
+ simple_list(tk_send('names'))
+ end
+
+ def on_screen(id, x, y)
+ bool(tk_send('onscreen', id, x, y))
+ end
+
+ def over(x, y)
+ list(tk_send('over', x, y))
+ end
+
+ def over_markup(x, y)
+ list(tk_send('over', x, y, '-muponly'))
+ end
+
+ def over_attr(x, y, attrs)
+ list(tk_send('overattr', x, y, attrs))
+ end
+
+ def parse(txt)
+ tk_send('parse', txt)
+ self
+ end
+
+ def resolver(*uri_args)
+ tk_send('resolver', *uri_args)
+ end
+
+ def selection_clear()
+ tk_send('selection', 'clear')
+ self
+ end
+
+ def selection_set(first, last)
+ tk_send('selection', 'set', first, last)
+ self
+ end
+
+ def refresh(*opts)
+ tk_send('refresh', *opts)
+ end
+
+ def layout()
+ tk_send('layout')
+ end
+
+ def sizewindow(*args)
+ tk_send('sizewindow', *args)
+ end
+
+ def postscript(*args)
+ tk_send('postscript', *args)
+ end
+
+ def source()
+ tk_send('source')
+ end
+
+ def plain_text(first, last)
+ tk_send('text', 'ascii', first, last)
+ end
+ alias ascii_text plain_text
+ alias text_ascii plain_text
+
+ def text_delete(first, last)
+ tk_send('text', 'delete', first, last)
+ self
+ end
+
+ def html_text(first, last)
+ tk_send('text', 'html', first, last)
+ end
+ alias text_html html_text
+
+ def text_insert(idx, txt)
+ tk_send('text', 'insert', idx, txt)
+ self
+ end
+
+ def break_text(idx)
+ tk_send('text', 'break', idx)
+ end
+ alias text_break break_text
+
+ def text_find(txt, *args)
+ tk_send('text', 'find', txt, *args)
+ end
+
+ def text_table(idx, imgs=None, attrs=None)
+ tk_send('text', 'table', idx, imgs, attrs)
+ end
+
+ def token_append(tag, *args)
+ tk_send('token', 'append', tag, *args)
+ self
+ end
+
+ def token_delete(first, last=None)
+ tk_send('token', 'delete', first, last)
+ self
+ end
+
+ def token_define(*args)
+ tk_send('token', 'defile', *args)
+ self
+ end
+
+ def token_find(tag, *args)
+ list(tk_send('token', 'find', tag, *args))
+ end
+
+ def token_get(first, last=None)
+ list(tk_send('token', 'get', first, last))
+ end
+
+ def token_list(first, last=None)
+ list(tk_send('token', 'list', first, last))
+ end
+
+ def token_markup(first, last=None)
+ list(tk_send('token', 'markup', first, last))
+ end
+
+ def token_DOM(first, last=None)
+ list(tk_send('token', 'domtokens', first, last))
+ end
+ alias token_dom token_DOM
+ alias token_domtokens token_DOM
+ alias token_dom_tokens token_DOM
+
+ def token_get_end(idx)
+ tk_send('token', 'getend', idx)
+ end
+ alias token_getend token_get_end
+
+ def token_offset(start, num1, num2)
+ list(tk_send('token', 'offset', start, num1, num2))
+ end
+
+ def token_get_attr(idx, name=None)
+ list(tk_send('token', 'attr', idx, name))
+ end
+
+ def token_set_attr(idx, name=None, val=None)
+ tk_send('token', 'attr', idx, name, val)
+ self
+ end
+
+ def token_handler(tag, cmd=nil, &b)
+ cmd = Proc.new(&b) if !cmd && b
+ if cmd
+ tk_send('token', 'handler', tag, cmd)
+ return self
+ else
+ return tk_send('token', 'handler', tag)
+ end
+ end
+
+ def token_insert(idx, tag, *args)
+ tk_send('token', 'insert', idx, tag, *args)
+ self
+ end
+
+ def token_attrs(*args)
+ list(tk_send('token', 'attrs', *args))
+ end
+
+ def token_unique(*args)
+ list(tk_send('token', 'unique', *args))
+ end
+
+ def token_on_events(*args)
+ list(tk_send('token', 'onEvents', *args))
+ end
+
+ def dom_nameidx(tag, name)
+ number(tk_send('dom', 'nameidx', tag, name))
+ end
+ alias dom_name_index dom_nameidx
+
+ def dom_radioidx(tag, name)
+ number(tk_send('dom', 'radioidx', tag, name))
+ end
+ alias dom_radio_index dom_radioidx
+
+ def dom_id(*spec)
+ tk_send('dom', 'id', *spec)
+ end
+
+ def dom_ids(*spec)
+ list(tk_send('dom', 'ids', *spec))
+ end
+
+ def dom_value(*spec)
+ list(tk_send('dom', 'value', *spec))
+ end
+
+ def dom_attr(idx)
+ tk_send('dom', 'attr', idx)
+ end
+
+ def dom_formel(name)
+ tk_send('dom', 'formel', name)
+ end
+ alias dom_form_element dom_formel
+
+ def dom_tree(idx, val)
+ list(tk_send('dom', 'tree', idx, val))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkHTML/setup.rb b/ext/tk/lib/tkextlib/tkHTML/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkHTML/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tkimg.rb b/ext/tk/lib/tkextlib/tkimg.rb
new file mode 100644
index 0000000000..c01359d3ef
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg.rb
@@ -0,0 +1,36 @@
+#
+# TkImg extension support
+# 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'
+
+# load all image format handlers
+#TkPackage.require('Img', '1.3')
+TkPackage.require('Img')
+
+module Tk
+ module Img
+ PACKAGE_NAME = 'Img'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Img')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+# autoload
+autoload :TkPixmapImage, 'tkextlib/tkimg/pixmap'
diff --git a/ext/tk/lib/tkextlib/tkimg/README b/ext/tk/lib/tkextlib/tkimg/README
new file mode 100644
index 0000000000..f5981cb98c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/README
@@ -0,0 +1,26 @@
+
+ [ Tcl/Tk Image formats (TkImg) support ]
+
+TkImg contains a collection of format handlers for the Tk photo
+image type, and a new image type, pixmaps.
+
+Supported formats of TkImg version 1.3 are
+-------------------------------------------------------
+ bmp : Windows Bitmap Format
+ gif : Graphics Interchange Format
+ ico : Windows Icon Format
+ jpeg : Joint Picture Expert Group format
+ pcx : Paintbrush Format
+ pixmap : Pixmap Image type
+ png : Portable Network Graphics format
+ ppm : Portable Pixmap format
+ ps : Adobe PostScript Format
+ sgi : SGI Native Format
+ sun : Sun Raster Format
+ tga : Truevision Targa Format
+ tiff : Tagged Image File Format
+ window : Tk Windows
+ xbm : X Window Bitmap Format
+ xpm : X Window Pixmap Format
+-------------------------------------------------------
+
diff --git a/ext/tk/lib/tkextlib/tkimg/bmp.rb b/ext/tk/lib/tkextlib/tkimg/bmp.rb
new file mode 100644
index 0000000000..ea90181aa3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/bmp.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'bmp'
+# 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::bmp', '1.3')
+TkPackage.require('img::bmp')
+
+module Tk
+ module Img
+ module BMP
+ PACKAGE_NAME = 'img::bmp'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::bmp')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/gif.rb b/ext/tk/lib/tkextlib/tkimg/gif.rb
new file mode 100644
index 0000000000..d542d47561
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/gif.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'gif'
+# 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::gif', '1.3')
+TkPackage.require('img::gif')
+
+module Tk
+ module Img
+ module GIF
+ PACKAGE_NAME = 'img::gif'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::gif')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/ico.rb b/ext/tk/lib/tkextlib/tkimg/ico.rb
new file mode 100644
index 0000000000..e79bdf45e9
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/ico.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'ico'
+# 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::ico', '1.3')
+TkPackage.require('img::ico')
+
+module Tk
+ module Img
+ module ICO
+ PACKAGE_NAME = 'img::ico'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::ico')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/jpeg.rb b/ext/tk/lib/tkextlib/tkimg/jpeg.rb
new file mode 100644
index 0000000000..2126120161
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/jpeg.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'jpeg'
+# 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::jpeg', '1.3')
+TkPackage.require('img::jpeg')
+
+module Tk
+ module Img
+ module JPEG
+ PACKAGE_NAME = 'img::jpeg'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::jpeg')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/pcx.rb b/ext/tk/lib/tkextlib/tkimg/pcx.rb
new file mode 100644
index 0000000000..6831f4d35b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/pcx.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'pcx'
+# 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::pcx', '1.3')
+TkPackage.require('img::pcx')
+
+module Tk
+ module Img
+ module PCX
+ PACKAGE_NAME = 'img::pcx'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::pcx')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/pixmap.rb b/ext/tk/lib/tkextlib/tkimg/pixmap.rb
new file mode 100644
index 0000000000..bd1b870af7
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/pixmap.rb
@@ -0,0 +1,44 @@
+#
+# TkImg - format 'pixmap'
+# 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::pixmap', '1.3')
+TkPackage.require('img::pixmap')
+
+module Tk
+ module Img
+ module PIXMAP
+ PACKAGE_NAME = 'img::pixmap'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::pixmap')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
+
+class TkPixmapImage<TkImage
+ def self.version
+ Tk::Img::PIXMAP.version
+ end
+
+ def initialize(*args)
+ @type = 'pixmap'
+ super(*args)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/png.rb b/ext/tk/lib/tkextlib/tkimg/png.rb
new file mode 100644
index 0000000000..5c829f48d2
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/png.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'png'
+# 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::png', '1.3')
+TkPackage.require('img::png')
+
+module Tk
+ module Img
+ module PNG
+ PACKAGE_NAME = 'img::png'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::png')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/ppm.rb b/ext/tk/lib/tkextlib/tkimg/ppm.rb
new file mode 100644
index 0000000000..eacfae467d
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/ppm.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'ppm'
+# 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::ppm', '1.3')
+TkPackage.require('img::ppm')
+
+module Tk
+ module Img
+ module PPM
+ PACKAGE_NAME = 'img::ppm'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::ppm')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/ps.rb b/ext/tk/lib/tkextlib/tkimg/ps.rb
new file mode 100644
index 0000000000..68e9178ac0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/ps.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'ps'
+# 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::ps', '1.3')
+TkPackage.require('img::ps')
+
+module Tk
+ module Img
+ module PS
+ PACKAGE_NAME = 'img::ps'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::ps')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/setup.rb b/ext/tk/lib/tkextlib/tkimg/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tkimg/sgi.rb b/ext/tk/lib/tkextlib/tkimg/sgi.rb
new file mode 100644
index 0000000000..ec7038bf0e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/sgi.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'sgi'
+# 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::sgi', '1.3')
+TkPackage.require('img::sgi')
+
+module Tk
+ module Img
+ module SGI
+ PACKAGE_NAME = 'img::sgi'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::sgi')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/sun.rb b/ext/tk/lib/tkextlib/tkimg/sun.rb
new file mode 100644
index 0000000000..651f946497
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/sun.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'sun'
+# 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::sun', '1.3')
+TkPackage.require('img::sun')
+
+module Tk
+ module Img
+ module SUN
+ PACKAGE_NAME = 'img::sun'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::sun')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/tga.rb b/ext/tk/lib/tkextlib/tkimg/tga.rb
new file mode 100644
index 0000000000..1eae407c0a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/tga.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'tga'
+# 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::tga', '1.3')
+TkPackage.require('img::tga')
+
+module Tk
+ module Img
+ module TGA
+ PACKAGE_NAME = 'img::tga'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::tga')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/tiff.rb b/ext/tk/lib/tkextlib/tkimg/tiff.rb
new file mode 100644
index 0000000000..ed271c2600
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/tiff.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'tiff'
+# 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::tiff', '1.3')
+TkPackage.require('img::tiff')
+
+module Tk
+ module Img
+ module TIFF
+ PACKAGE_NAME = 'img::tiff'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::tiff')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/window.rb b/ext/tk/lib/tkextlib/tkimg/window.rb
new file mode 100644
index 0000000000..3b5906fab6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/window.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'window'
+# 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::window', '1.3')
+TkPackage.require('img::window')
+
+module Tk
+ module Img
+ module WINDOW
+ PACKAGE_NAME = 'img::window'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::window')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/xbm.rb b/ext/tk/lib/tkextlib/tkimg/xbm.rb
new file mode 100644
index 0000000000..f4bea030be
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/xbm.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'xbm'
+# 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::xbm', '1.3')
+TkPackage.require('img::xbm')
+
+module Tk
+ module Img
+ module XBM
+ PACKAGE_NAME = 'img::xbm'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::xbm')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/xpm.rb b/ext/tk/lib/tkextlib/tkimg/xpm.rb
new file mode 100644
index 0000000000..5119c8710b
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/xpm.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'xpm'
+# 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::xpm', '1.3')
+TkPackage.require('img::xpm')
+
+module Tk
+ module Img
+ module XPM
+ PACKAGE_NAME = 'img::xpm'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::xpm')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tktable.rb b/ext/tk/lib/tkextlib/tktable.rb
new file mode 100644
index 0000000000..385eb13497
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktable.rb
@@ -0,0 +1,14 @@
+#
+# TkTable support
+# 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/tktable/setup.rb'
+
+# load library
+require 'tkextlib/tktable/tktable'
diff --git a/ext/tk/lib/tkextlib/tktable/setup.rb b/ext/tk/lib/tkextlib/tktable/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktable/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tktable/tktable.rb b/ext/tk/lib/tkextlib/tktable/tktable.rb
new file mode 100644
index 0000000000..f7074655ed
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktable/tktable.rb
@@ -0,0 +1,966 @@
+#
+# tkextlib/tktable/tktable.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+require 'tk'
+require 'tk/validation'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tktable/setup.rb'
+
+# TkPackage.require('Tktable', '2.8')
+TkPackage.require('Tktable')
+
+module Tk
+ class TkTable < TkWindow
+ PACKAGE_NAME = 'Tktable'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('Tktable')
+ rescue
+ ''
+ end
+ end
+
+ class CellTag < TkObject
+ end
+
+ module ConfigMethod
+ end
+ end
+end
+
+module Tk::TkTable::ConfigMethod
+ include TkItemConfigMethod
+
+ def __item_cget_cmd(id) # id := [ type, tagOrId ]
+ [self.path, id[0], 'cget', id[1]]
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(id) # id := [ type, tagOrId ]
+ [self.path, id[0], 'configure', id[1]]
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ if id.kind_of?(Array)
+ id = tagid(id[1])
+ end
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ def __item_boolval_optkeys(id)
+ super(id) << 'multiline' << 'showtext' << 'wrap'
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ super(id) << 'ellipsis'
+ end
+ private :__item_strval_optkeys
+
+ def __item_val2ruby_optkeys(id) # { key=>method, ... }
+ super(id).update('window'=>proc{|k,v| window(v)})
+ end
+ private :__item_val2ruby_optkeys
+
+ def tag_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['tag', tagid(tagOrId)], option)
+ end
+ def tag_cget(tagOrId, option)
+ itemcget(['tag', tagid(tagOrId)], option)
+ end
+ def tag_cget_strict(tagOrId, option)
+ itemcget_strict(['tag', tagid(tagOrId)], option)
+ end
+ def tag_configure(tagOrId, slot, value=None)
+ itemconfigure(['tag', tagid(tagOrId)], slot, value)
+ end
+ def tag_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['tag', tagid(tagOrId)], slot)
+ end
+ def current_tag_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['tag', tagid(tagOrId)], slot)
+ end
+
+ def window_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['window', tagid(tagOrId)], option)
+ end
+ def window_cget(tagOrId, option)
+ itemcget(['window', tagid(tagOrId)], option)
+ end
+ def window_cget_strict(tagOrId, option)
+ itemcget_strict(['window', tagid(tagOrId)], option)
+ end
+ def window_configure(tagOrId, slot, value=None)
+ if slot == :window || slot == 'window'
+ value = _epath(value)
+ elsif slot.kind_of?(Hash)
+ if slot.key?(:window) || slot.key?('window')
+ slot = _symbolkey2str(slot)
+ slot['window'] = _epath(slot['window'])
+ end
+ end
+ itemconfigure(['window', tagid(tagOrId)], slot, value)
+ end
+ def window_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['window', tagid(tagOrId)], slot)
+ end
+ def current_window_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['window', tagid(tagOrId)], slot)
+ end
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+#####################################################
+
+class Tk::TkTable::CellTag
+ include TkTreatTagFont
+
+ CellTagID_TBL = TkCore::INTERP.create_table
+
+ (CellTag_ID = ['tktbl:celltag'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ CellTagID_TBL.mutex.synchronize{ CellTagID_TBL.clear }
+ }
+
+ def self.id2obj(table, id)
+ tpath = table.path
+ CellTagID_TBL.mutex.synchronize{
+ if CellTagID_TBL[tpath]
+ CellTagID_TBL[tpath][id]? CellTagID_TBL[tpath][id] : id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, keys=nil)
+ @parent = @t = parent
+ @tpath - parent.path
+ CellTag_ID.mutex.synchronize{
+ @path = @id = CellTag_ID.join(TkCore::INTERP._ip_id_)
+ CellTag_ID[1].succ!
+ }
+ CellTagID_TBL.mutex.synchronize{
+ CellTagID_TBL[@tpath] = {} unless CellTagID_TBL[@tpath]
+ CellTagID_TBL[@tpath][@id] = self
+ }
+ configure(keys) if keys
+ end
+
+ def id
+ @id
+ end
+
+ def destroy
+ tk_call(@tpath, 'tag', 'delete', @id)
+ CellTagID_TBL.mutex.synchronize{
+ CellTagID_TBL[@tpath].delete(@id) if CellTagID_TBL[@tpath]
+ }
+ self
+ end
+ alias delete destroy
+
+ def exist?
+ @t.tag_exist?(@id)
+ end
+ def include?(idx)
+ @t.tag_include?(@id, idx)
+ end
+
+ def add_cell(*args)
+ @t.tag_cell(@id, *args)
+ end
+ def add_col(*args)
+ @t.tag_col(@id, *args)
+ end
+ def add_row(*args)
+ @t.tag_row(@id, *args)
+ end
+
+ def raise(target=None)
+ @t.tag_raise(@id, target)
+ end
+ def lower(target=None)
+ @t.tag_lower(@id, target)
+ end
+
+ def cget_tkstring(key)
+ @t.tag_cget_tkstring(@id, key)
+ end
+ def cget(key)
+ @t.tag_cget(@id, key)
+ end
+ def cget_strict(key)
+ @t.tag_cget_strict(@id, key)
+ end
+ def configure(key, val=None)
+ @t.tag_configure(@id, key, val)
+ end
+ def configinfo(key=nil)
+ @t.tag_configinfo(@id, key)
+ end
+ def current_configinfo(key=nil)
+ @t.current_tag_configinfo(@id, key)
+ end
+end
+
+class Tk::TkTable::NamedCellTag < Tk::TkTable::CellTag
+ def self.new(parent, name, keys=nil)
+ obj = nil
+ CellTagID_TBL.mutex.synchronize{
+ if CellTagID_TBL[parent.path] && CellTagID_TBL[parent.path][name]
+ obj = CellTagID_TBL[parent.path][name]
+ else
+ #super(parent, name, keys)
+ (obj = self.allocate).instance_eval{
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+ CellTagID_TBL[@tpath] = {} unless CellTagID_TBL[@tpath]
+ CellTagID_TBL[@tpath][@id] = self
+ }
+ end
+ }
+ obj.configure(keys) if keys && ! keys.empty?
+ obj
+ end
+
+ def initialize(parent, name, keys=nil)
+ # dummy:: not called by 'new' method
+ @parent = @t = parent
+ @tpath = parent.path
+ @path = @id = name
+ CellTagID_TBL.mutex.synchronize{
+ CellTagID_TBL[@tpath] = {} unless CellTagID_TBL[@tpath]
+ CellTagID_TBL[@tpath][@id] = self
+ }
+ configure(keys) if keys && ! keys.empty?
+ end
+end
+
+#####################################################
+
+class Tk::TkTable
+ TkCommandNames = ['table'.freeze].freeze
+ WidgetClassName = 'Table'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ include Scrollable
+ include Tk::TkTable::ConfigMethod
+ include Tk::ValidateConfigure
+
+ def __destroy_hook__
+ Tk::TkTable::CelTag::CellTagID_TBL.mutex.synchronize{
+ Tk::TkTable::CelTag::CellTagID_TBL.delete(@path)
+ }
+ end
+
+ def __boolval_optkeys
+ super() << 'autoclear' << 'flashmode' << 'invertselected' <<
+ 'multiline' << 'selecttitle' << 'wrap'
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() << 'colseparator' << 'ellipsis' << 'rowseparator' << 'sparsearray'
+ end
+ private :__strval_optkeys
+
+
+ #################################
+
+ class BrowseCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?n, :column ],
+ [ ?C, ?s, :index ],
+ [ ?i, ?x, :cursor ],
+ [ ?r, ?n, :row ],
+ [ ?s, ?s, :last_index ],
+ [ ?S, ?s, :new_index ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ ['browsecommand', 'browsecmd']
+ end
+ end
+ #--------------------------------
+ class CellCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?n, :column ],
+ [ ?C, ?s, :index ],
+ [ ?i, ?m, :rw_mode ],
+ [ ?r, ?n, :row ],
+ [ ?s, ?v, :value ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ [ ?m, proc{|val| (val == '0')? (:r) : (:w)} ],
+ [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ TkComm._get_eval_string(val)
+ end
+ end
+
+ def self._config_keys
+ ['command']
+ end
+ end
+ #--------------------------------
+ class SelectionCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?n, :sel_columns ],
+ [ ?C, ?s, :sel_area ],
+ [ ?i, ?n, :total ],
+ [ ?r, ?n, :sel_rows ],
+ [ ?s, ?s, :value ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val.to_s
+ end
+ end
+
+ def self._config_keys
+ ['selectioncommand', 'selcmd']
+ end
+ end
+ #--------------------------------
+ class ValidateCommand < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?c, ?n, :column ],
+ [ ?C, ?s, :index ],
+ [ ?i, ?x, :cursor ],
+ [ ?r, ?n, :row ],
+ [ ?s, ?v, :current_value ],
+ [ ?S, ?v, :new_value ],
+ [ ?W, ?w, :widget ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?x, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?w, TkComm.method(:window) ],
+ [ ?v, proc{|val| TkComm.tk_tcl2ruby(val, true, false)} ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+ end
+
+ def self._config_keys
+ ['vcmd', 'validatecommand']
+ end
+ end
+
+ #################################
+
+ def __validation_class_list
+ super() <<
+ BrowseCommand << CellCommand << SelectionCommand << ValidateCommand
+ end
+
+ Tk::ValidateConfigure.__def_validcmd(binding, BrowseCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, CellCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, SelectionCommand)
+ Tk::ValidateConfigure.__def_validcmd(binding, ValidateCommand)
+
+ #################################
+
+ def activate(idx)
+ tk_send('activate', tagid(idx))
+ end
+
+ def bbox(idx)
+ list(tk_send('bbox', tagid(idx)))
+ end
+
+ def border_mark(x, y)
+ simplelist(tk_send('border', 'mark', x, y))
+ end
+ def border_mark_row(x, y)
+ tk_send('border', 'mark', x, y, 'row')
+ end
+ def border_mark_col(x, y)
+ tk_send('border', 'mark', x, y, 'col')
+ end
+ def border_dragto(x, y)
+ tk_send('border', 'dragto', x, y)
+ end
+
+ def clear_cache(first=None, last=None)
+ tk_send('clear', 'cache', tagid(first), tagid(last))
+ self
+ end
+ def clear_sizes(first=None, last=None)
+ tk_send('clear', 'sizes', tagid(first), tagid(last))
+ self
+ end
+ def clear_tags(first=None, last=None)
+ tk_send('clear', 'tags', tagid(first), tagid(last))
+ self
+ end
+ def clear_all(first=None, last=None)
+ tk_send('clear', 'all', tagid(first), tagid(last))
+ self
+ end
+
+ def curselection
+ simplelist(tk_send('curselection'))
+ end
+ def curselection=(val)
+ tk_send('curselection', val)
+ val
+ end
+
+ def curvalue
+ tk_tcl2ruby(tk_send('curvalue'), true, false)
+ end
+ def curvalue=(val)
+ tk_send('curvalue', val)
+ val
+ end
+
+ def delete_active(idx1, idx2=None)
+ tk_send('delete', 'active', tagid(idx1), tagid(idx2))
+ self
+ end
+ def delete_cols(*args) # ?switches_array?, index, ?count?
+ params = []
+ if args[0].kind_of?(Array)
+ switches = args.shift
+ switches.each{|k| params << "-#{k}"}
+ end
+ params << '--'
+ params << tagid(args.shift)
+ params.concat(args)
+ tk_send('delete', 'cols', *params)
+ self
+ end
+ def delete_rows(*args) # ?switches_array?, index, ?count?
+ params = []
+ if args[0].kind_of?(Array)
+ switches = args.shift
+ switches.each{|k| params << "-#{k}"}
+ end
+ params << '--'
+ params << tagid(args.shift)
+ params.concat(args)
+ tk_send('delete', 'rows', *params)
+ self
+ end
+
+ def get(idx)
+ tk_tcl2ruby(tk_send('get', tagid(idx)), true, false)
+ end
+ def get_area(idx1, idx2)
+ simplelist(tk_send('get', tagid(idx1), tagid(idx2))).collect{|v|
+ tk_tcl2ruby(v, true, false)
+ }
+ end
+
+ def height_list
+ list(tk_send('height'))
+ end
+ def height(row)
+ number(tk_send('height', row))
+ end
+ def set_height(*pairs)
+ tk_send('height', *(pairs.flatten))
+ self
+ end
+
+ def hidden_list
+ simplelist(tk_send('hidden'))
+ end
+ def hidden?(idx, *args)
+ if args.empty?
+ if (ret = tk_send('hidden', tagid(idx))) == ''
+ false
+ else
+ ret
+ end
+ else
+ bool(tk_send('hidden', tagid(idx), *(args.collect{|i| tagid(i)})))
+ end
+ end
+
+ def icursor
+ number(tk_send('icursor'))
+ end
+ def icursor_set(idx)
+ number(tk_send('icursor', tagid(idx)))
+ end
+
+ def index(idx)
+ tk_send('index', tagid(idx))
+ end
+ def row_index(idx)
+ number(tk_send('index', tagid(idx), 'row'))
+ end
+ def col_index(idx)
+ number(tk_send('index', tagid(idx), 'col'))
+ end
+
+ def insert_active(idx, val)
+ tk_send('insert', 'active', tagid(idx), val)
+ self
+ end
+ def insert_cols(*args) # ?switches_array?, index, ?count?
+ params = []
+ if args[0].kind_of?(Array)
+ switches = args.shift
+ switches.each{|k| params << "-#{k}"}
+ end
+ params << '--'
+ params.concat(args)
+ params << tagid(args.shift)
+ tk_send('insert', 'cols', *params)
+ self
+ end
+ def insert_rows(*args) # ?switches_array?, index, ?count?
+ params = []
+ if args[0].kind_of?(Array)
+ switches = args.shift
+ switches.each{|k| params << "-#{k}"}
+ end
+ params << '--'
+ params << tagid(args.shift)
+ params.concat(args)
+ tk_send('insert', 'rows', *params)
+ self
+ end
+
+ # def postscript(*args)
+ # tk_send('postscript', *args)
+ # end
+
+ def reread
+ tk_send('reread')
+ self
+ end
+
+ def scan_mark(x, y)
+ tk_send('scan', 'mark', x, y)
+ self
+ end
+ def scan_dragto(x, y)
+ tk_send('scan', 'dragto', x, y)
+ self
+ end
+
+ def see(idx)
+ tk_send('see', tagid(idx))
+ self
+ end
+
+ def selection_anchor(idx)
+ tk_send('selection', 'anchor', tagid(idx))
+ self
+ end
+ def selection_clear(first, last=None)
+ tk_send('selection', 'clear', tagid(first), tagid(last))
+ self
+ end
+ def selection_clear_all
+ selection_clear('all')
+ end
+ def selection_include?(idx)
+ bool(tk_send('selection', 'includes', tagid(idx)))
+ end
+ def selection_present
+ bool(tk_send('selection', 'present'))
+ end
+ def selection_set(first, last=None)
+ tk_send('selection', 'set', tagid(first), tagid(last))
+ self
+ end
+
+ def set(*pairs) # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', *args)
+ self
+ end
+ def set_row(*pairs) # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', 'row', *args)
+ self
+ end
+ def set_col(*pairs) # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', 'col', *args)
+ self
+ end
+=begin
+ def set(*pairs) # idx, val, idx, val, ... OR [idx, val], [idx, val], ...
+ if pairs[0].kind_of?(Array)
+ # [idx, val], [idx, val], ...
+ args = []
+ pairs.each{|idx, val| args << tagid(idx) << val }
+ tk_send('set', *args)
+ else
+ # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', *args)
+ end
+ self
+ end
+ def set_row(*pairs)
+ if pairs[0].kind_of?(Array)
+ # [idx, val], [idx, val], ...
+ args = []
+ pairs.each{|idx, val| args << tagid(idx) << val }
+ tk_send('set', 'row', *args)
+ else
+ # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', 'row', *args)
+ end
+ self
+ end
+ def set_col(*pairs)
+ if pairs[0].kind_of?(Array)
+ # [idx, val], [idx, val], ...
+ args = []
+ pairs.each{|idx, val| args << idx << val }
+ tk_send('set', 'col', *args)
+ else
+ # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ args << pairs[i+1]
+ }
+ tk_send('set', 'col', *args)
+ end
+ self
+ end
+=end
+
+ def spans
+ simplelist(tk_send('spans')).collect{|inf|
+ lst = simplelist(inf)
+ idx = lst[0]
+ rows, cols = lst[1].split(',').map!{|n| Integer(n)}
+ [idx [rows, cols]]
+ }
+ end
+ alias span_list spans
+ def span(idx)
+ lst = simplelist(tk_send('spans', tagid(idx)))
+ idx = lst[0]
+ rows, cols = lst[1].split(',').map!{|n| Integer(n)}
+ [idx [rows, cols]]
+ end
+ def set_spans(*pairs)
+ # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ val = pairs[i+1]
+ if val.kind_of?(Array)
+ args << val.join(',')
+ else
+ args << val
+ end
+ }
+ tk_send('spans', *args)
+ self
+ end
+=begin
+ def set_spans(*pairs)
+ if pairs[0].kind_of?(Array)
+ # [idx, val], [idx, val], ...
+ args = []
+ pairs.each{|idx, val|
+ args << tagid(idx)
+ if val.kind_of?(Array)
+ args << val.join(',')
+ else
+ args << val
+ end
+ }
+ tk_send('spans', *args)
+ else
+ # idx, val, idx, val, ...
+ args = []
+ 0.step(pairs.size-1, 2){|i|
+ args << tagid(pairs[i])
+ val = pairs[i+1]
+ if val.kind_of?(Array)
+ args << val.join(',')
+ else
+ args << val
+ end
+ }
+ tk_send('spans', *args)
+ end
+ self
+ end
+=end
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::TkTable::CellTag)
+ tag.id
+ elsif tag.kind_of?(Array)
+ if tag[0].kind_of?(Integer) && tag[1].kind_of?(Integer)
+ # [row, col]
+ tag.join(',')
+ else
+ tag
+ end
+ else
+ tag
+ end
+ end
+
+ def tagid2obj(tagid)
+ Tk::TkTable::CellTag::CellTagID_TBL.mutex.synchronize{
+ if Tk::TkTable::CellTag::CellTagID_TBL.key?(@path)
+ if Tk::TkTable::CellTag::CellTagID_TBL[@path].key?(tagid)
+ Tk::TkTable::CellTag::CellTagID_TBL[@path][tagid]
+ else
+ tagid
+ end
+ else
+ tagid
+ end
+ }
+ end
+
+ def tag_cell(tag, *cells)
+ tk_send('tag', 'cell', tagid(tag), *(cells.collect{|idx| tagid(idx)}))
+ self
+ end
+ def tag_reset(*cells)
+ tk_send('tag', 'cell', '', *(cells.collect{|idx| tagid(idx)}))
+ self
+ end
+ def tag_col(tag, *cols)
+ tk_send('tag', 'col', tagid(tag), *cols)
+ self
+ end
+ def tag_col_reset(*cols)
+ tk_send('tag', 'col', '', *cols)
+ self
+ end
+ def tag_delete(tag)
+ tk_send('tag', 'delete', tagid(tag))
+ Tk::TkTable::CellTag::CellTagID_TBL.mutex.synchronize{
+ if Tk::TkTable::CellTag::CellTagID_TBL[@path]
+ if tag.kind_of? Tk::TkTable::CellTag
+ Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag.id)
+ else
+ Tk::TkTable::CellTag::CellTagID_TBL[@path].delete(tag)
+ end
+ end
+ }
+ self
+ end
+ def tag_exist?(tag)
+ bool(tk_send('tag', 'exists', tagid(tag)))
+ end
+ def tag_include?(tag, idx)
+ bool(tk_send('tag', 'includes', tagid(tag), tagid(idx)))
+ end
+ def tag_lower(tag, target=None)
+ tk_send('tag', 'lower', tagid(tag), tagid(target))
+ self
+ end
+ def tag_names(pat=None)
+ simplelist(tk_send('tag', 'names', pat)).collect{|tag| tagid2obj(tag)}
+ end
+ def tag_raise(tag, target=None)
+ tk_send('tag', 'raise', tagid(tag), tagid(target))
+ self
+ end
+ def tag_row(tag, *rows)
+ tk_send('tag', 'row', tagid(tag), *rows)
+ self
+ end
+ def tag_row_reset(*rows)
+ tk_send('tag', 'row', '', *rows)
+ self
+ end
+
+ def validate(idx)
+ bool(tk_send('validate', tagid(idx)))
+ end
+
+ def width_list
+ list(tk_send('width'))
+ end
+ def width(row)
+ number(tk_send('width', row))
+ end
+ def set_width(*pairs)
+ tk_send('width', *(pairs.flatten))
+ self
+ end
+
+ def window_delete(*args)
+ tk_send('window', 'delete', *(args.collect{|idx| tagid(idx)}))
+ self
+ end
+ def window_move(from_idx, to_idx)
+ tk_send('window', 'move', tagid(from_idx), tagid(to_idx))
+ self
+ end
+ def window_names(pat=None)
+ simplelist(tk_send('window', 'names', pat))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tktrans.rb b/ext/tk/lib/tkextlib/tktrans.rb
new file mode 100644
index 0000000000..c5de5be5e6
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktrans.rb
@@ -0,0 +1,14 @@
+#
+# TkTrans support (win32 only)
+# 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/tktrans/setup.rb'
+
+# load library
+require 'tkextlib/tktrans/tktrans'
diff --git a/ext/tk/lib/tkextlib/tktrans/setup.rb b/ext/tk/lib/tkextlib/tktrans/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktrans/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/tktrans/tktrans.rb b/ext/tk/lib/tkextlib/tktrans/tktrans.rb
new file mode 100644
index 0000000000..e051c09211
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tktrans/tktrans.rb
@@ -0,0 +1,64 @@
+#
+# TkTrans support (win32 only)
+# 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/tktrans/setup.rb'
+
+TkPackage.require('tktrans') rescue Tk.load_tcllibrary('tktrans')
+
+module Tk
+ module TkTrans
+ PACKAGE_NAME = 'tktrans'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('tktrans')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+class TkWindow
+ def tktrans_set_image(img)
+ tk_send('tktrans::setwidget', @path, img)
+ self
+ end
+ def tktrans_get_image()
+ tk_send('tktrans::setwidget', @path)
+ end
+end
+
+class Tk::Root
+ undef tktrans_set_image, tktrans_get_image
+
+ def tktrans_set_image(img)
+ tk_send('tktrans::settoplevel', @path, img)
+ self
+ end
+ def tktrans_get_image()
+ tk_send('tktrans::settoplevel', @path)
+ end
+end
+
+class Tk::Toplevel
+ undef tktrans_set_image, tktrans_get_image
+
+ def tktrans_set_image(img)
+ tk_send('tktrans::settoplevel', @path, img)
+ self
+ end
+ def tktrans_get_image()
+ tk_send('tktrans::settoplevel', @path)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/treectrl.rb b/ext/tk/lib/tkextlib/treectrl.rb
new file mode 100644
index 0000000000..1944fb83e3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/treectrl.rb
@@ -0,0 +1,13 @@
+#
+# TkTreeCtrl support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/treectrl/setup.rb'
+
+# load library
+require 'tkextlib/treectrl/tktreectrl'
diff --git a/ext/tk/lib/tkextlib/treectrl/setup.rb b/ext/tk/lib/tkextlib/treectrl/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/treectrl/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
new file mode 100644
index 0000000000..1879a531ae
--- /dev/null
+++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb
@@ -0,0 +1,2522 @@
+#
+# tkextlib/treectrl/tktreectrl.rb
+# 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/treectrl/setup.rb'
+
+# TkPackage.require('treectrl', '1.0')
+# TkPackage.require('treectrl', '1.1')
+TkPackage.require('treectrl')
+
+module Tk
+ class TreeCtrl < TkWindow
+ BindTag_FileList = TkBindTag.new_by_name('TreeCtrlFileList')
+
+ PACKAGE_NAME = 'treectrl'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('treectrl')
+ rescue
+ ''
+ end
+ end
+
+ HasColumnCreateCommand =
+ (TkPackage.vcompare(self.package_version, '1.1') >= 0)
+
+ # dummy ::
+ # pkgIndex.tcl of TreeCtrl-1.0 doesn't support auto_load for
+ # 'loupe' command (probably it is bug, I think).
+ # So, calling a 'treectrl' command for loading the dll with
+ # the auto_load facility.
+ begin
+ tk_call('treectrl')
+ rescue
+ end
+ def self.loupe(img, x, y, w, h, zoom)
+ # NOTE: platform == 'unix' only
+
+ # img => TkPhotoImage
+ # x, y => screen coords
+ # w, h => magnifier width and height
+ # zoom => zooming rate
+ Tk.tk_call_without_enc('loupe', img, x, y, w, h, zoom)
+ end
+
+ def self.text_layout(font, text, keys={})
+ TkComm.list(Tk.tk_call_without_enc('textlayout', font, text, keys))
+ end
+
+ def self.image_tint(img, color, alpha)
+ Tk.tk_call_without_enc('imagetint', img, color, alpha)
+ end
+
+ class NotifyEvent < TkUtil::CallbackSubst
+ end
+
+ module ConfigMethod
+ end
+ end
+ TreeCtrl_Widget = TreeCtrl
+end
+
+##############################################
+
+class Tk::TreeCtrl::NotifyEvent
+ # [ <'%' subst-key char>, <proc type char>, <instance var (accessor) name>]
+ KEY_TBL = [
+ [ ?c, ?n, :item_num ],
+ [ ?d, ?s, :detail ],
+ [ ?D, ?l, :items ],
+ [ ?e, ?e, :event ],
+ [ ?I, ?n, :id ],
+ [ ?l, ?n, :lower_bound ],
+ [ ?p, ?n, :active_id ],
+ [ ?P, ?e, :pattern ],
+ [ ?S, ?l, :sel_items ],
+ [ ?T, ?w, :widget ],
+ [ ?u, ?n, :upper_bound ],
+ [ ?W, ?o, :object ],
+ [ ??, ?x, :parm_info ],
+ nil
+ ]
+
+ # [ <proc type char>, <proc/method to convert tcl-str to ruby-obj>]
+ PROC_TBL = [
+ [ ?n, TkComm.method(:num_or_str) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?l, TkComm.method(:list) ],
+ [ ?w, TkComm.method(:window) ],
+
+ [ ?e, proc{|val|
+ case val
+ when /^<<[^<>]+>>$/
+ TkVirtualEvent.getobj(val[1..-2])
+ when /^<[^<>]+>$/
+ val[1..-2]
+ else
+ val
+ end
+ }
+ ],
+
+ [ ?o, proc{|val| TkComm.tk_tcl2ruby(val)} ],
+
+ [ ?x, proc{|val|
+ begin
+ inf = {}
+ Hash[*(TkComm.list(val))].each{|k, v|
+ if keyinfo = KEY_TBL.assoc(k[0])
+ if cmd = PROC_TBL.assoc(keyinfo[1])
+ begin
+ new_v = cmd.call(v)
+ v = new_v
+ rescue
+ end
+ end
+ end
+ inf[k] = v
+ }
+ inf
+ rescue
+ val
+ end
+ } ],
+
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ # setup tables to be used by scan_args, _get_subst_key, _get_all_subst_keys
+ #
+ # _get_subst_key() and _get_all_subst_keys() generates key-string
+ # which describe how to convert callback arguments to ruby objects.
+ # When binding parameters are given, use _get_subst_key().
+ # But when no parameters are given, use _get_all_subst_keys() to
+ # create a Event class object as a callback parameter.
+ #
+ # scan_args() is used when doing callback. It convert arguments
+ # ( which are Tcl strings ) to ruby objects based on the key string
+ # that is generated by _get_subst_key() or _get_all_subst_keys().
+ #
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+end
+
+##############################################
+
+module Tk::TreeCtrl::ConfigMethod
+ include TkItemConfigMethod
+
+ def treectrl_tagid(key, obj)
+ if key.kind_of?(Array)
+ key = key.join(' ')
+ else
+ key = key.to_s
+ end
+
+ if (obj.kind_of?(Tk::TreeCtrl::Column) ||
+ obj.kind_of?(Tk::TreeCtrl::Element) ||
+ obj.kind_of?(Tk::TreeCtrl::Item) ||
+ obj.kind_of?(Tk::TreeCtrl::Style))
+ obj = obj.id
+ end
+
+ case key
+ when 'column'
+ obj
+
+ when 'debug'
+ None
+
+ when 'dragimage'
+ None
+
+ when 'element'
+ obj
+
+ when 'item element'
+ obj
+
+ when 'marquee'
+ None
+
+ when 'notify'
+ obj
+
+ when 'style'
+ obj
+
+ else
+ obj
+ end
+ end
+
+ def tagid(mixed_id)
+ if mixed_id == 'debug'
+ ['debug', None]
+ elsif mixed_id == 'dragimage'
+ ['dragimage', None]
+ elsif mixed_id == 'marquee'
+ ['marquee', None]
+ elsif mixed_id.kind_of?(Array)
+ [mixed_id[0], treectrl_tagid(*mixed_id)]
+ else
+ tagid(mixed_id.split(':'))
+ end
+ end
+
+ def __item_cget_cmd(mixed_id)
+ if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
+ return [self.path, 'column', 'dragcget']
+ end
+
+ if mixed_id[1].kind_of?(Array)
+ id = mixed_id[1]
+ else
+ id = [mixed_id[1]]
+ end
+
+ if mixed_id[0].kind_of?(Array)
+ ([self.path].concat(mixed_id[0]) << 'cget').concat(id)
+ else
+ [self.path, mixed_id[0], 'cget'].concat(id)
+ end
+ end
+ private :__item_cget_cmd
+
+ def __item_config_cmd(mixed_id)
+ if mixed_id[0] == 'column' && mixed_id[1] == 'drag'
+ return [self.path, 'column', 'dragconfigure']
+ end
+
+ if mixed_id[1].kind_of?(Array)
+ id = mixed_id[1]
+ else
+ id = [mixed_id[1]]
+ end
+
+ if mixed_id[0].kind_of?(Array)
+ ([self.path].concat(mixed_id[0]) << 'configure').concat(id)
+ else
+ [self.path, mixed_id[0], 'configure'].concat(id)
+ end
+ end
+ private :__item_config_cmd
+
+ def __item_pathname(id)
+ if id.kind_of?(Array)
+ key = id[0]
+ if key.kind_of?(Array)
+ key = key.join(' ')
+ end
+
+ tag = id[1]
+ if tag.kind_of?(Array)
+ tag = tag.join(' ')
+ end
+
+ id = [key, tag].join(':')
+ end
+ [self.path, id].join(';')
+ end
+ private :__item_pathname
+
+ def __item_configinfo_struct(id)
+ if id.kind_of?(Array) && id[0].to_s == 'notify'
+ {:key=>0, :alias=>nil, :db_name=>nil, :db_class=>nil,
+ :default_value=>nil, :current_value=>1}
+ else
+ {:key=>0, :alias=>1, :db_name=>1, :db_class=>2,
+ :default_value=>3, :current_value=>4}
+ end
+ end
+ private :__item_configinfo_struct
+
+
+ def __item_font_optkeys(id)
+ if id.kind_of?(Array) && (id[0] == 'element' ||
+ (id[0].kind_of?(Array) && id[0][1] == 'element'))
+ []
+ else
+ ['font']
+ end
+ end
+ private :__item_font_optkeys
+
+ def __item_numstrval_optkeys(id)
+ if id == 'debug'
+ ['displaydelay']
+ else
+ super(id)
+ end
+ end
+ private :__item_numstrval_optkeys
+
+ def __item_boolval_optkeys(id)
+ if id == 'debug'
+ ['data', 'display', 'enable', 'span', 'textlayout']
+ elsif id == 'dragimage'
+ ['visible']
+ elsif id == 'marquee'
+ ['visible']
+ elsif id.kind_of?(Array)
+ case id[0]
+ when 'item'
+ ['visible', 'wrap', 'open', 'returnid', 'visible']
+ when 'column'
+ if id[1] == 'drag'
+ ['enable']
+ else
+ ['button', 'expand', 'resize', 'squeeze', 'sunken',
+ 'visible', 'widthhack']
+ end
+ when 'element'
+ ['draw', 'filled', 'showfocus', 'clip', 'destroy']
+ when 'notify'
+ ['active']
+ when 'style'
+ ['detach', 'indent', 'visible']
+ else
+ if id[0].kind_of?(Array) && id[0][1] == 'element'
+ ['filled', 'showfocus']
+ else
+ super(id)
+ end
+ end
+ else
+ super(id)
+ end
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ if id == 'debug'
+ ['erasecolor']
+ elsif id.kind_of?(Array)
+ case id[0]
+ when 'column'
+ if id[1] == 'drag'
+ ['indicatorcolor']
+ else
+ super(id) << 'textcolor'
+ end
+ when 'element'
+ super(id) << 'fill' << 'outline' << 'format'
+ else
+ super(id)
+ end
+ else
+ super(id)
+ end
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ if id.kind_of?(Array)
+ case id[0]
+ when 'column'
+ ['itembackground']
+ when 'element'
+ ['relief']
+ when 'style'
+ ['union']
+ else
+ if id[0].kind_of?(Array) && id[0][1] == 'element'
+ ['relief']
+ else
+ []
+ end
+ end
+ else
+ []
+ end
+ end
+ private :__item_listval_optkeys
+
+ def __item_val2ruby_optkeys(id)
+ if id.kind_of?(Array)
+ case id[0]
+ when 'item'
+ { 'button' => proc{|id,val| (val == 'auto')? val: TkComm.bool(val)} }
+ else
+ []
+ end
+ else
+ []
+ end
+ end
+ private :__item_val2ruby_optkeys
+
+ def __item_keyonly_optkeys(id) # { def_key=>(undef_key|nil), ... }
+ {
+ 'notreally'=>nil,
+ 'increasing'=>'decreasing',
+ 'decreasing'=>'increasing',
+ 'ascii'=>nil,
+ 'dictionary'=>nil,
+ 'integer'=>nil,
+ 'real'=>nil
+ }
+ end
+ private :__item_keyonly_optkeys
+
+ def column_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['column', tagOrId], option)
+ end
+ def column_cget(tagOrId, option)
+ itemcget(['column', tagOrId], option)
+ end
+ def column_cget_strict(tagOrId, option)
+ itemcget_strict(['column', tagOrId], option)
+ end
+ def column_configure(tagOrId, slot, value=None)
+ itemconfigure(['column', tagOrId], slot, value)
+ end
+ def column_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['column', tagOrId], slot)
+ end
+ def current_column_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['column', tagOrId], slot)
+ end
+
+ def column_dragcget_tkstring(option)
+ itemcget_tkstring(['column', 'drag'], option)
+ end
+ def column_dragcget(option)
+ itemcget(['column', 'drag'], option)
+ end
+ def column_dragcget_strict(option)
+ itemcget_strict(['column', 'drag'], option)
+ end
+ def column_dragconfigure(slot, value=None)
+ itemconfigure(['column', 'drag'], slot, value)
+ end
+ def column_dragconfiginfo(slot=nil)
+ itemconfiginfo(['column', 'drag'], slot)
+ end
+ def current_column_dragconfiginfo(slot=nil)
+ current_itemconfiginfo(['column', 'drag'], slot)
+ end
+
+ def debug_cget_tkstring(option)
+ itemcget_tkstring('debug', option)
+ end
+ def debug_cget(option)
+ itemcget('debug', option)
+ end
+ def debug_cget_strict(option)
+ itemcget_strict('debug', option)
+ end
+ def debug_configure(slot, value=None)
+ itemconfigure('debug', slot, value)
+ end
+ def debug_configinfo(slot=nil)
+ itemconfiginfo('debug', slot)
+ end
+ def current_debug_configinfo(slot=nil)
+ current_itemconfiginfo('debug', slot)
+ end
+
+ def dragimage_cget_tkstring(option)
+ itemcget_tkstring('dragimage', option)
+ end
+ def dragimage_cget(option)
+ itemcget('dragimage', option)
+ end
+ def dragimage_cget_strict(option)
+ itemcget_strict('dragimage', option)
+ end
+ def dragimage_configure(slot, value=None)
+ itemconfigure('dragimage', slot, value)
+ end
+ def dragimage_configinfo(slot=nil)
+ itemconfiginfo('dragimage', slot)
+ end
+ def current_dragimage_configinfo(slot=nil)
+ current_itemconfiginfo('dragimage', slot)
+ end
+
+ def element_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['element', tagOrId], option)
+ end
+ def element_cget(tagOrId, option)
+ itemcget(['element', tagOrId], option)
+ end
+ def element_cget_strict(tagOrId, option)
+ itemcget_strict(['element', tagOrId], option)
+ end
+ def element_configure(tagOrId, slot, value=None)
+ itemconfigure(['element', tagOrId], slot, value)
+ end
+ def element_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['element', tagOrId], slot)
+ end
+ def current_element_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['element', tagOrId], slot)
+ end
+
+ def item_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['item', tagOrId], option)
+ end
+ def item_cget(tagOrId, option)
+ itemcget(['item', tagOrId], option)
+ end
+ def item_cget_strict(tagOrId, option)
+ itemcget_strict(['item', tagOrId], option)
+ end
+ def item_configure(tagOrId, slot, value=None)
+ itemconfigure(['item', tagOrId], slot, value)
+ end
+ def item_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['item', tagOrId], slot)
+ end
+ def current_item_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['item', tagOrId], slot)
+ end
+
+ def item_element_cget_tkstring(item, column, elem, option)
+ itemcget_tkstring([['item', 'element'], [item, column, elem]], option)
+ end
+ def item_element_cget(item, column, elem, option)
+ itemcget([['item', 'element'], [item, column, elem]], option)
+ end
+ def item_element_cget_strict(item, column, elem, option)
+ itemcget_strict([['item', 'element'], [item, column, elem]], option)
+ end
+ def item_element_configure(item, column, elem, slot, value=None)
+ itemconfigure([['item', 'element'], [item, column, elem]], slot, value)
+ end
+ def item_element_configinfo(item, column, elem, slot=nil)
+ itemconfiginfo([['item', 'element'], [item, column, elem]], slot)
+ end
+ def current_item_element_configinfo(item, column, elem, slot=nil)
+ current_itemconfiginfo([['item', 'element'], [item, column, elem]], slot)
+ end
+
+ def marquee_cget_tkstring(option)
+ itemcget_tkstring('marquee', option)
+ end
+ def marquee_cget(option)
+ itemcget('marquee', option)
+ end
+ def marquee_cget_strict(option)
+ itemcget_strict('marquee', option)
+ end
+ def marquee_configure(slot, value=None)
+ itemconfigure('marquee', slot, value)
+ end
+ def marquee_configinfo(slot=nil)
+ itemconfiginfo('marquee', slot)
+ end
+ def current_marquee_configinfo(slot=nil)
+ current_itemconfiginfo('marquee', slot)
+ end
+
+ def notify_cget_tkstring(win, pattern, option)
+ pattern = "<#{pattern}>"
+ # "notify" doesn't have cget subcommand.
+ tk_split_simplelist(tk_call_without_enc(*(__item_confinfo_cmd(tagid(['notify', [win, pattern]])) << "-#{option}")), false, true)[-1]
+ end
+ def notify_cget(win, pattern, option)
+ pattern = "<#{pattern}>"
+ # "notify" doesn't have cget subcommand.
+ current_itemconfiginfo(['notify', [win, pattern]])[option.to_s]
+ end
+ def notify_cget_strict(win, pattern, option)
+ pattern = "<#{pattern}>"
+ # "notify" doesn't have cget subcommand.
+ info = current_itemconfiginfo(['notify', [win, pattern]])
+ option = option.to_s
+ unless info.has_key?(option)
+ fail RuntimeError, "unknown option \"#{option}\""
+ else
+ info[option]
+ end
+ end
+ def notify_configure(win, pattern, slot, value=None)
+ pattern = "<#{pattern}>"
+ itemconfigure(['notify', [win, pattern]], slot, value)
+ end
+ def notify_configinfo(win, pattern, slot=nil)
+ pattern = "<#{pattern}>"
+ itemconfiginfo(['notify', [win, pattern]], slot)
+ end
+ def current_notify_configinfo(tagOrId, slot=nil)
+ pattern = "<#{pattern}>"
+ current_itemconfiginfo(['notify', [win, pattern]], slot)
+ end
+
+ def style_cget_tkstring(tagOrId, option)
+ itemcget_tkstring(['style', tagOrId], option)
+ end
+ def style_cget(tagOrId, option)
+ itemcget(['style', tagOrId], option)
+ end
+ def style_cget_strict(tagOrId, option)
+ itemcget_strict(['style', tagOrId], option)
+ end
+ def style_configure(tagOrId, slot, value=None)
+ itemconfigure(['style', tagOrId], slot, value)
+ end
+ def style_configinfo(tagOrId, slot=nil)
+ itemconfiginfo(['style', tagOrId], slot)
+ end
+ def current_style_configinfo(tagOrId, slot=nil)
+ current_itemconfiginfo(['style', tagOrId], slot)
+ end
+
+ private :itemcget_tkstring, :itemcget, :itemcget_strict
+ private :itemconfigure, :itemconfiginfo, :current_itemconfiginfo
+end
+
+##############################################
+
+class Tk::TreeCtrl
+ include Tk::TreeCtrl::ConfigMethod
+ include Scrollable
+
+ TkCommandNames = ['treectrl'.freeze].freeze
+ WidgetClassName = 'TreeCtrl'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ #########################
+
+ def __destroy_hook__
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.delete(@path)
+ }
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.delete(@path)
+ }
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.delete(@path)
+ }
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.delete(@path)
+ }
+ end
+
+ #########################
+
+ def __strval_optkeys
+ super() + [
+ 'buttoncolor', 'columnprefix', 'itemprefix', 'linecolor'
+ ]
+ end
+ private :__strval_optkeys
+
+ def __boolval_optkeys
+ [
+ 'itemwidthequal', 'usetheme',
+ 'showbuttons', 'showheader', 'showlines', 'showroot',
+ 'showrootbutton', 'showrootlines', 'showrootchildbuttons'
+ ]
+ end
+ private :__boolval_optkeys
+
+ def __listval_optkeys
+ [ 'defaultstyle' ]
+ end
+ private :__listval_optkeys
+
+ #########################
+
+ def install_bind(cmd, *args)
+ install_bind_for_event_class(Tk::TreeCtrl::NotifyEvent, cmd, *args)
+ end
+
+ #########################
+
+ def create_self(keys)
+ if keys and keys != None
+ tk_call_without_enc(self.class::TkCommandNames[0], @path,
+ *hash_kv(keys, true))
+ else
+ tk_call_without_enc(self.class::TkCommandNames[0], @path)
+ end
+ end
+ private :create_self
+
+ #########################
+
+ def activate(desc)
+ tk_send('activate', desc)
+ self
+ end
+
+ def canvasx(x)
+ number(tk_send('canvasx', x))
+ end
+
+ def canvasy(y)
+ number(tk_send('canvasy', y))
+ end
+
+ def collapse(*dsc)
+ tk_send_without_enc('collapse', *(dsc.map!{|d| _get_eval_string(d, true)}))
+ self
+ end
+
+ def collapse_recurse(*dsc)
+ tk_send_without_enc('collapse', '-recurse',
+ *(dsc.map!{|d| _get_eval_string(d, true)}))
+ self
+ end
+
+ def column_bbox(idx)
+ list(tk_send('column', 'bbox', idx))
+ end
+
+ def column_compare(column1, op, column2)
+ bool(tk_send('column', 'compare', column1, op, column2))
+ end
+
+ def column_count
+ num_or_str(tk_send('column', 'count'))
+ end
+
+ def column_create(keys=nil)
+ if keys && keys.kind_of?(Hash)
+ num_or_str(tk_send('column', 'create', *hash_kv(keys)))
+ else
+ num_or_str(tk_send('column', 'create'))
+ end
+ end
+
+ def column_delete(idx)
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[self.path]
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[self.path].delete(idx)
+ end
+ }
+ tk_send('column', 'delete', idx)
+ self
+ end
+
+ def column_index(idx)
+ num_or_str(tk_send('column', 'index', idx))
+ end
+
+ def column_id(idx)
+ tk_send('column', 'id', idx)
+ end
+
+ def column_list(visible=false)
+ if visible
+ simplelist(tk_send('column', 'list', '-visible'))
+ else
+ simplelist(tk_send('column', 'list'))
+ end
+ end
+ def column_visible_list
+ column_list(true)
+ end
+
+ def column_move(idx, before)
+ tk_send('column', 'move', idx, before)
+ self
+ end
+
+ def column_needed_width(idx)
+ num_or_str(tk_send('column', 'neededwidth', idx))
+ end
+ alias column_neededwidth column_needed_width
+
+ def column_order(column, visible=false)
+ if visible
+ num_or_str(tk_send('column', 'order', column, '-visible'))
+ else
+ num_or_str(tk_send('column', 'order', column))
+ end
+ end
+ def column_visible_order(column)
+ column_order(column, true)
+ end
+
+ def column_width(idx)
+ num_or_str(tk_send('column', 'width', idx))
+ end
+
+ def compare(item1, op, item2)
+ bool(tk_send('compare', item1, op, item2))
+ end
+
+ def contentbox()
+ list(tk_send('contentbox'))
+ end
+
+ def depth(item=None)
+ num_or_str(tk_send_without_enc('depth', _get_eval_string(item, true)))
+ end
+
+ def dragimage_add(item, *args)
+ tk_send('dragimage', 'add', item, *args)
+ self
+ end
+
+ def dragimage_clear()
+ tk_send('dragimage', 'clear')
+ self
+ end
+
+ def dragimage_offset(*args) # x, y
+ if args.empty?
+ list(tk_send('dragimage', 'offset'))
+ else
+ tk_send('dragimage', 'offset', *args)
+ self
+ end
+ end
+
+ def dragimage_visible(*args) # mode
+ if args..empty?
+ bool(tk_send('dragimage', 'visible'))
+ else
+ tk_send('dragimage', 'visible', *args)
+ self
+ end
+ end
+ def dragimage_visible?
+ dragimage_visible()
+ end
+
+ def debug_dinfo
+ tk_send('debug', 'dinfo')
+ self
+ end
+
+ def debug_scroll
+ tk_send('debug', 'scroll')
+ end
+
+ def element_create(elem, type, keys=nil)
+ if keys && keys.kind_of?(Hash)
+ tk_send('element', 'create', elem, type, *hash_kv(keys))
+ else
+ tk_send('element', 'create', elem, type)
+ end
+ end
+
+ def element_delete(*elems)
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[self.path]
+ elems.each{|elem|
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[self.path].delete(elem)
+ }
+ end
+ }
+ tk_send('element', 'delete', *elems)
+ self
+ end
+
+ def element_names()
+ list(tk_send('element', 'names')).collect!{|elem|
+ Tk::TreeCtrl::Element.id2obj(self, elem)
+ }
+ end
+
+ def _conv_element_perstate_val(opt, val)
+ case opt
+ when 'background', 'foreground', 'fill', 'outline', 'format'
+ val
+ when 'draw', 'filled', 'showfocus', 'destroy'
+ bool(val)
+ else
+ tk_tcl2ruby(val)
+ end
+ end
+ private :_conv_element_perstate_val
+
+ def element_perstate(elem, opt, st_list)
+ tk_send('element', 'perstate', elem, "-{opt}", st_list)
+ end
+
+ def element_type(elem)
+ tk_send('element', 'type', elem)
+ end
+
+ def element_class(elem)
+ Tk::TreeCtrl::Element.type2class(element_type(elem))
+ end
+
+ def expand(*dsc)
+ tk_send('expand', *dsc)
+ self
+ end
+
+ def expand_recurse(*dsc)
+ tk_send('expand', '-recurse', *dsc)
+ self
+ end
+
+ def identify(x, y)
+ lst = list(tk_send('identify', x, y))
+
+ if lst[0] == 'item'
+ lst[1] = Tk::TreeCtrl::Item.id2obj(self, lst[1])
+ size = lst.size
+ i = 2
+ while i < size
+ case lst[i]
+ when 'line'
+ i += 1
+ lst[i] = Tk::TreeCtrl::Item.id2obj(self, lst[i])
+ i += 1
+
+ when 'button'
+ i += 1
+
+ when 'column'
+ i += 2
+
+ when 'elem'
+ i += 1
+ lst[i] = Tk::TreeCtrl::Element.id2obj(self, lst[i])
+ i += 1
+
+ else
+ i += 1
+ end
+ end
+ end
+
+ lst
+ end
+
+ def index(idx)
+ num_or_str(tk_send('index', idx))
+ end
+
+ def item_ancestors(item)
+ list(tk_send('item', 'ancestors', item)).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def item_bbox(item, *args)
+ list(tk_send('item', 'bbox', item, *args))
+ end
+
+ def item_children(item)
+ list(tk_send('item', 'children', item)).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def item_collapse(item)
+ tk_send_without_enc('item', 'collapse', _get_eval_string(item, true))
+ self
+ end
+
+ def item_collapse_recurse(item)
+ tk_send_without_enc('item', 'collapse',
+ _get_eval_string(item, true), '-recurse')
+ self
+ end
+
+ def item_compare(item1, op, item2)
+ bool(tk_send('item', 'compare', item1, op, item2))
+ end
+
+ def item_complex(item, *args)
+ tk_send_without_enc('item', 'complex',
+ _get_eval_string(item, true),
+ *(args.map!{|arg| _get_eval_string(arg, true)}))
+ self
+ end
+
+ def item_count
+ num_or_str(tk_send('item', 'count'))
+ end
+
+ def item_create(keys={})
+ num_or_str(tk_send_without_enc('item', 'create', *hash_kv(keys, true)))
+ end
+
+ def _erase_children(item)
+ item_children(item).each{|i| _erase_children(i)}
+ # table is already locked
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[self.path].delete(item)
+ end
+ private :_erase_children
+
+ def item_delete(first, last=None)
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[self.path]
+ if first == 'all' || first == :all || last == 'all' || last == :all
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[self.path].clear
+ elsif last == None
+ _erase_children(first)
+ else
+ self.range(first, last).each{|id|
+ _erase_children(id)
+ }
+ end
+ end
+ }
+ tk_send('item', 'delete', first, last)
+ self
+ end
+
+ def item_dump(item)
+ list(tk_send('item', 'dump', item))
+ end
+
+ def item_dump_hash(item)
+ Hash[*list(tk_send('item', 'dump', item))]
+ end
+
+ def item_element_actual(item, column, elem, key)
+ tk_send('item', 'element', 'actual', item, column, elem, "-#{key}")
+ end
+
+ def item_element_perstate(elem, opt, st_list)
+ tk_send('item', 'element', 'perstate', elem, "-{opt}", st_list)
+ end
+
+ def item_expand(item)
+ tk_send('item', 'expand', item)
+ self
+ end
+
+ def item_expand_recurse(item)
+ tk_send('item', 'expand', item, '-recurse')
+ self
+ end
+
+ def item_firstchild(parent, child=nil)
+ if child
+ tk_send_without_enc('item', 'firstchild',
+ _get_eval_string(parent, true),
+ _get_eval_string(child, true))
+ self
+ else
+ id = num_or_str(tk_send_without_enc('item', 'firstchild',
+ _get_eval_string(parent, true)))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+ end
+ alias item_first_child item_firstchild
+
+ def item_hasbutton(item, st=None)
+ if st == None
+ bool(tk_send_without_enc('item', 'hasbutton',
+ _get_eval_string(item, true)))
+ else
+ tk_send_without_enc('item', 'hasbutton',
+ _get_eval_string(item, true),
+ _get_eval_string(st))
+ self
+ end
+ end
+ alias item_has_button item_hasbutton
+
+ def item_hasbutton?(item)
+ item_hasbutton(item)
+ end
+ alias item_has_button? item_hasbutton?
+
+ def item_id(item)
+ tk_send('item', 'id', item)
+ end
+
+ def item_image(item, column=nil, *args)
+ if args.empty?
+ if column
+ img = tk_send('item', 'image', item, column)
+ TkImage::Tk_IMGTBL[img]? TkImage::Tk_IMGTBL[img] : img
+ else
+ simplelist(tk_send('item', 'image', item)).collect!{|img|
+ TkImage::Tk_IMGTBL[img]? TkImage::Tk_IMGTBL[img] : img
+ }
+ end
+ else
+ tk_send('item', 'image', item, column, *args)
+ self
+ end
+ end
+ def get_item_image(item, column=nil)
+ item_image(item, column)
+ end
+ def set_item_image(item, col, img, *args)
+ item_image(item, col, img, *args)
+ end
+
+ def item_index(item)
+ list(tk_send('item', 'index', item))
+ end
+
+ def item_isancestor(item, des)
+ bool(tk_send('item', 'isancestor', item, des))
+ end
+ alias item_is_ancestor item_isancestor
+ alias item_isancestor? item_isancestor
+ alias item_is_ancestor? item_isancestor
+
+ def item_isopen(item)
+ bool(tk_send('item', 'isopen', item))
+ end
+ alias item_is_open item_isopen
+ alias item_isopen? item_isopen
+ alias item_is_open? item_isopen
+ alias item_isopened? item_isopen
+ alias item_is_opened? item_isopen
+
+ def item_lastchild(parent, child=nil)
+ if child
+ tk_send_without_enc('item', 'lastchild',
+ _get_eval_string(parent, true),
+ _get_eval_string(child, true))
+ self
+ else
+ id = num_or_str(tk_send_without_enc('item', 'lastchild',
+ _get_eval_string(parent, true)))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+ end
+ alias item_last_child item_lastchild
+
+ def item_nextsibling(sibling, nxt=nil)
+ if nxt
+ tk_send('item', 'nextsibling', sibling, nxt)
+ self
+ else
+ id = num_or_str(tk_send('item', 'nextsibling', sibling))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+ end
+ alias item_next_sibling item_nextsibling
+
+ def item_numchildren(item)
+ number(tk_send_without_enc('item', 'numchildren',
+ _get_eval_string(item, true)))
+ end
+ alias item_num_children item_numchildren
+ alias item_children_size item_numchildren
+
+ def item_order(item, visible=false)
+ if visible
+ ret = num_or_str(tk_send('item', 'order', item, '-visible'))
+ else
+ ret = num_or_str(tk_send('item', 'order', item))
+ end
+
+ (ret.kind_of?(Fixnum) && ret < 0)? nil: ret
+ end
+ def item_visible_order(item)
+ item_order(item, true)
+ end
+
+ def item_parent(item)
+ id = num_or_str(tk_send('item', 'parent', item))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+
+ def item_prevsibling(sibling, prev=nil)
+ if prev
+ tk_send('item', 'prevsibling', sibling, prev)
+ self
+ else
+ id = num_or_str(tk_send('item', 'prevsibling', sibling))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+ end
+ alias item_prev_sibling item_prevsibling
+
+ def item_range(first, last)
+ simplelist(tk_send('item', 'range', first, last))
+ end
+
+ def item_remove(item)
+ tk_send('item', 'remove', item)
+ self
+ end
+
+ def item_rnc(item)
+ list(tk_send('item', 'rnc', item))
+ end
+
+ def _item_sort_core(real_sort, item, *opts)
+ # opts ::= sort_param [, sort_param, ... ]
+ # sort_param ::= {key=>val, ...}
+ # [type, desc, {key=>val, ...}]
+ # param
+ opts = opts.collect{|param|
+ if param.kind_of?(Hash)
+ param = _symbolkey2str(param)
+ if param.key?('column')
+ key = '-column'
+ desc = param.delete('column')
+ elsif param.key?('element')
+ key = '-element'
+ desc = param.delete('element')
+ else
+ key = nil
+ end
+
+ if param.empty?
+ param = None
+ else
+ param = hash_kv(__conv_item_keyonly_opts(item, param))
+ end
+
+ if key
+ [key, desc].concat(param)
+ else
+ param
+ end
+
+ elsif param.kind_of?(Array)
+ if param[2].kind_of?(Hash)
+ param[2] = hash_kv(__conv_item_keyonly_opts(item, param[2]))
+ end
+ param
+
+ elsif param.kind_of?(String) && param =~ /\A[a-z]+\Z/
+ '-' << param
+
+ elsif param.kind_of?(Symbol)
+ '-' << param.to_s
+
+ else
+ param
+ end
+ }.flatten
+
+ if real_sort
+ tk_send('item', 'sort', item, *opts)
+ self
+ else
+ list(tk_send('item', 'sort', item, '-notreally', *opts))
+ end
+ end
+ private :_item_sort_core
+
+ def item_sort(item, *opts)
+ _item_sort_core(true, item, *opts)
+ end
+ def item_sort_not_really(item, *opts)
+ _item_sort_core(false, item, *opts)
+ end
+
+ def item_span(item, column=nil, *args)
+ if args.empty?
+ if column
+ list(tk_send('item', 'span', item, column))
+ else
+ simplelist(tk_send('item', 'span', item)).collect!{|elem| list(elem)}
+ end
+ else
+ tk_send('item', 'span', item, column, *args)
+ self
+ end
+ end
+ def get_item_span(item, column=nil)
+ item_span(item, column)
+ end
+ def set_item_span(item, col, num, *args)
+ item_span(item, col, num, *args)
+ end
+
+ def item_state_forcolumn(item, column, *args)
+ tk_send('item', 'state', 'forcolumn', item, column, *args)
+ end
+ alias item_state_for_column item_state_forcolumn
+
+ def item_state_get(item, *args)
+ if args.empty?
+ list(tk_send('item', 'state', 'get', item *args))
+ else
+ bool(tk_send('item', 'state', 'get', item))
+ end
+ end
+
+ def item_state_set(item, *args)
+ tk_send('item', 'state', 'set', item, *args)
+ end
+
+ def item_style_elements(item, column)
+ list(tk_send('item', 'style', 'elements', item, column)).collect!{|id|
+ Tk::TreeCtrl::Style.id2obj(self, id)
+ }
+ end
+
+ def item_style_map(item, column, style, map)
+ tk_send('item', 'style', 'map', item, column, style, map)
+ self
+ end
+
+ def item_style_set(item, column=nil, *args)
+ if args.empty?
+ if column
+ id = tk_send_without_enc('item', 'style', 'set',
+ _get_eval_string(item, true),
+ _get_eval_string(column, true))
+ Tk::TreeCtrl::Style.id2obj(self, id)
+ else
+ list(tk_send_without_enc('item', 'style', 'set',
+ _get_eval_string(item, true))).collect!{|id|
+ Tk::TreeCtrl::Style.id2obj(self, id)
+ }
+ end
+ else
+ tk_send_without_enc('item', 'style', 'set',
+ _get_eval_string(item, true),
+ _get_eval_string(column, true),
+ *(args.flatten.map!{|arg|
+ _get_eval_string(arg, true)
+ }))
+ self
+ end
+ end
+
+ def item_text(item, column, txt=nil, *args)
+ if args.empty?
+ if txt
+ tk_send('item', 'text', item, column, txt)
+ self
+ else
+ tk_send('item', 'text', item, column)
+ end
+ else
+ tk_send('item', 'text', item, column, txt, *args)
+ self
+ end
+ end
+
+ def item_toggle(item)
+ tk_send('item', 'toggle', item)
+ self
+ end
+
+ def item_toggle_recurse(item)
+ tk_send('item', 'toggle', item, '-recurse')
+ self
+ end
+
+ def item_visible(item, st=None)
+ if st == None
+ bool(tk_send('item', 'visible', item))
+ else
+ tk_send('item', 'visible', item, st)
+ self
+ end
+ end
+ def item_visible?(item)
+ item_visible(item)
+ end
+
+ def marquee_anchor(*args)
+ if args.empty?
+ list(tk_send('marquee', 'anchor'))
+ else
+ tk_send('marquee', 'anchor', *args)
+ self
+ end
+ end
+
+ def marquee_coords(*args)
+ if args.empty?
+ list(tk_send('marquee', 'coords'))
+ else
+ tk_send('marquee', 'coords', *args)
+ self
+ end
+ end
+
+ def marquee_corner(*args)
+ if args.empty?
+ tk_send('marquee', 'corner')
+ else
+ tk_send('marquee', 'corner', *args)
+ self
+ end
+ end
+
+ def marquee_identify()
+ list(tk_send('marquee', 'identify')).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def marquee_visible(st=None)
+ if st == None
+ bool(tk_send('marquee', 'visible'))
+ else
+ tk_send('marquee', 'visible', st)
+ self
+ end
+ end
+ def marquee_visible?()
+ marquee_visible()
+ end
+
+ #def notify_bind(obj, event, cmd=Proc.new, *args)
+ # _bind([@path, 'notify', 'bind', obj], event, cmd, *args)
+ # self
+ #end
+ def notify_bind(obj, event, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind([@path, 'notify', 'bind', obj], event, cmd, *args)
+ self
+ end
+
+ #def notify_bind_append(obj, event, cmd=Proc.new, *args)
+ # _bind_append([@path, 'notify', 'bind', obj], event, cmd, *args)
+ # self
+ #end
+ def notify_bind_append(obj, event, *args)
+ # if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
+ _bind_append([@path, 'notify', 'bind', obj], event, cmd, *args)
+ self
+ end
+
+ def notify_bind_remove(obj, event)
+ _bind_remove([@path, 'notify', 'bind', obj], event)
+ self
+ end
+
+ def notify_bindinfo(obj, event=nil)
+ _bindinfo([@path, 'notify', 'bind', obj], event)
+ end
+
+ def notify_detailnames(event)
+ list(tk_send('notify', 'detailnames', event))
+ end
+
+ def notify_eventnames()
+ list(tk_send('notify', 'eventnames'))
+ end
+
+ def notify_generate(pattern, char_map=None, percents_cmd=None)
+ pattern = "<#{pattern}>"
+ tk_send('notify', 'generate', pattern, char_map, percents_cmd)
+ self
+ end
+
+ def notify_install(pattern, percents_cmd=nil, &b)
+ pattern = "<#{pattern}>"
+ percents_cmd = Proc.new(&b) if !percents_cmd && b
+ if percents_cmd
+ procedure(tk_send('notify', 'install', pattern, percents_cmd))
+ else
+ procedure(tk_send('notify', 'install', pattern))
+ end
+ end
+
+ def notify_install_detail(event, detail, percents_cmd=nil, &b)
+ percents_cmd = Proc.new(&b) if !percents_cmd && b
+ if percents_cmd
+ tk_send('notify', 'install', 'detail', event, detail, percents_cmd)
+ else
+ tk_send('notify', 'install', 'detail', event, detail)
+ end
+ end
+
+ def notify_install_event(event, percents_cmd=nil, &b)
+ percents_cmd = Proc.new(&b) if !percents_cmd && b
+ if percents_cmd
+ tk_send('notify', 'install', 'event', event, percents_cmd)
+ else
+ tk_send('notify', 'install', 'event', event)
+ end
+ end
+
+ def notify_linkage(pattern, detail=None)
+ if detail != None
+ tk_send('notify', 'linkage', pattern, detail)
+ else
+ begin
+ if pattern.to_s.index(?-)
+ # TreeCtrl 1.1 format?
+ begin
+ tk_send('notify', 'linkage', "<#{pattern}>")
+ rescue
+ # TreeCtrl 1.0?
+ tk_send('notify', 'linkage', pattern)
+ end
+ else
+ # TreeCtrl 1.0 format?
+ begin
+ tk_send('notify', 'linkage', pattern)
+ rescue
+ # TreeCtrl 1.1?
+ tk_send('notify', 'linkage', "<#{pattern}>")
+ end
+ end
+ end
+ end
+ end
+
+ def notify_unbind(pattern=nil)
+ if pattern
+ tk_send('notify', 'unbind', "<#{pattern}>")
+ else
+ tk_send('notify', 'unbind')
+ end
+ self
+ end
+
+ def notify_uninstall(pattern)
+ pattern = "<#{pattern}>"
+ tk_send('notify', 'uninstall', pattern)
+ self
+ end
+
+ def notify_uninstall_detail(event, detail)
+ tk_send('notify', 'uninstall', 'detail', event, detail)
+ self
+ end
+
+ def notify_uninstall_event(event)
+ tk_send('notify', 'uninstall', 'event', event)
+ self
+ end
+
+ def numcolumns()
+ num_or_str(tk_send('numcolumns'))
+ end
+ alias num_columns numcolumns
+ alias columns_size numcolumns
+
+ def numitems()
+ num_or_str(tk_send('numitems'))
+ end
+ alias num_items numitems
+ alias items_size numitems
+
+ def orphans()
+ list(tk_send('orphans')).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def range(first, last)
+ list(tk_send('range', first, last)).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def state_define(name)
+ tk_send('state', 'define', name)
+ self
+ end
+
+ def state_linkage(name)
+ tk_send('state', 'linkage', name)
+ end
+
+ def state_names()
+ list(tk_send('state', 'names'))
+ end
+
+ def state_undefine(*names)
+ tk_send('state', 'undefine', *names)
+ self
+ end
+
+ def see(item, column=None, keys={})
+ tk_send('see', item, column, *hash_kv(keys))
+ self
+ end
+
+ def selection_add(first, last=None)
+ tk_send('selection', 'add', first, last)
+ self
+ end
+
+ def selection_anchor(item=None)
+ id = num_or_str(tk_send('selection', 'anchor', item))
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ end
+
+ def selection_clear(*args) # first, last
+ tk_send('selection', 'clear', *args)
+ self
+ end
+
+ def selection_count()
+ number(tk_send('selection', 'count'))
+ end
+
+ def selection_get()
+ list(tk_send('selection', 'get')).collect!{|id|
+ Tk::TreeCtrl::Item.id2obj(self, id)
+ }
+ end
+
+ def selection_includes(item)
+ bool(tk_send('selection', 'includes', item))
+ end
+
+ def selection_modify(sel, desel)
+ tk_send('selection', 'modify', sel, desel)
+ self
+ end
+
+ def style_create(style, keys=None)
+ if keys && keys != None
+ tk_send('style', 'create', style, *hash_kv(keys))
+ else
+ tk_send('style', 'create', style)
+ end
+ end
+
+ def style_delete(*args)
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[self.path]
+ args.each{|sty|
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[self.path].delete(sty)
+ }
+ end
+ }
+ tk_send('style', 'delete', *args)
+ self
+ end
+
+ def style_elements(style, *elems)
+ if elems.empty?
+ list(tk_send('style', 'elements', style)).collect!{|id|
+ Tk::TreeCtrl::Element.id2obj(self, id)
+ }
+ else
+ tk_send('style', 'elements', style, elems.flatten)
+ self
+ end
+ end
+
+ def _conv_style_layout_val(sty, val)
+ case sty.to_s
+ when 'padx', 'pady', 'ipadx', 'ipady'
+ lst = list(val)
+ (lst.size == 1)? lst[0]: lst
+ when 'detach', 'indent'
+ bool(val)
+ when 'union'
+ simplelist(val).collect!{|elem|
+ Tk::TreeCtrl::Element.id2obj(self, elem)
+ }
+ else
+ val
+ end
+ end
+ private :_conv_style_layout_val
+
+ def style_layout(style, elem, keys=None)
+ if keys && keys != None
+ if keys.kind_of?(Hash)
+ tk_send('style', 'layout', style, elem, *hash_kv(keys))
+ self
+ else
+ _conv_style_layout_val(keys,
+ tk_send('style', 'layout',
+ style, elem, "-#{keys}"))
+ end
+ else
+ ret = Hash.new
+ Hash[*simplelist(tk_send('style', 'layout', style, elem))].each{|k, v|
+ k = k[1..-1]
+ ret[k] = _conv_style_layout_val(k, v)
+ }
+ ret
+ end
+ end
+ def get_style_layout(style, elem, opt=None)
+ style_layout(style, elem, opt)
+ end
+ def set_style_layout(style, elem, slot, value=None)
+ if slot.kind_of?(Hash)
+ style_layout(style, elem, slot)
+ else
+ style_layout(style, elem, {slot=>value})
+ end
+ end
+
+ def style_names()
+ list(tk_send('style', 'names')).collect!{|id|
+ Tk::TreeCtrl::Style.id2obj(self, id)
+ }
+ end
+
+ def toggle(*items)
+ tk_send('toggle', *items)
+ self
+ end
+
+ def toggle_recurse()
+ tk_send('toggle', '-recurse', *items)
+ self
+ end
+end
+
+#####################
+
+class Tk::TreeCtrl::Column < TkObject
+ TreeCtrlColumnID_TBL = TkCore::INTERP.create_table
+
+ (TreeCtrlColumnID = ['treectrl_column'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.clear
+ }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[tpath]
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[tpath][id]? \
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[tpath][id] : id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, keys={})
+ @tree = parent
+ @tpath = parent.path
+
+ keys = _symbolkey2str(keys)
+
+ Tk::TreeCtrl::Column::TreeCtrlColumnID.mutex.synchronize{
+ @path = @id =
+ keys.delete('tag') ||
+ Tk::TreeCtrl::Column::TreeCtrlColumnID.join(TkCore::INTERP._ip_id_)
+ Tk::TreeCtrl::Column::TreeCtrlColumnID[1].succ!
+ }
+
+ keys['tag'] = @id
+
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath] ||= {}
+ Tk::TreeCtrl::Column::TreeCtrlColumnID_TBL[@tpath][@id] = self
+ }
+
+ @tree.column_create(keys)
+ end
+
+ def id
+ @id
+ end
+
+ def to_s
+ @id.to_s.dup
+ end
+
+ def cget_tkstring(opt)
+ @tree.column_cget_tkstring(@tree.column_index(@id), opt)
+ end
+ def cget(opt)
+ @tree.column_cget(@tree.column_index(@id), opt)
+ end
+ def cget_strict(opt)
+ @tree.column_cget_strict(@tree.column_index(@id), opt)
+ end
+
+ def configure(*args)
+ @tree.column_configure(@tree.column_index(@id), *args)
+ end
+
+ def configinfo(*args)
+ @tree.column_configinfo(@tree.column_index(@id), *args)
+ end
+
+ def current_configinfo(*args)
+ @tree.current_column_configinfo(@tree.column_index(@id), *args)
+ end
+
+ def delete
+ @tree.column_delete(@tree.column_index(@id))
+ self
+ end
+
+ def index
+ @tree.column_index(@id)
+ end
+
+ def move(before)
+ @tree.column_move(@tree.column_index(@id), before)
+ self
+ end
+
+ def needed_width
+ @tree.column_needed_width(@tree.column_index(@id))
+ end
+ alias neededwidth needed_width
+
+ def current_width
+ @tree.column_width(@tree.column_index(@id))
+ end
+end
+
+#####################
+
+class Tk::TreeCtrl::Element < TkObject
+ TreeCtrlElementID_TBL = TkCore::INTERP.create_table
+
+ (TreeCtrlElementID = ['treectrl_element'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+ TreeCtrlElemTypeToClass = {}
+
+ TkCore::INTERP.init_ip_env{
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.clear
+ }
+ }
+
+ def self.type2class(type)
+ TreeCtrlElemTypeToClass[type] || type
+ end
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[tpath]
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[tpath][id]? \
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[tpath][id] : id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, type, keys=nil)
+ @tree = parent
+ @tpath = parent.path
+ @type = type.to_s
+ Tk::TreeCtrl::Element::TreeCtrlElementID.mutex.synchronize{
+ @path = @id =
+ Tk::TreeCtrl::Element::TreeCtrlElementID.join(TkCore::INTERP._ip_id_)
+ Tk::TreeCtrl::Element::TreeCtrlElementID[1].succ!
+ }
+
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath] ||= {}
+ Tk::TreeCtrl::Element::TreeCtrlElementID_TBL[@tpath][@id] = self
+ }
+
+ @tree.element_create(@id, @type, keys)
+ end
+
+ def id
+ @id
+ end
+
+ def to_s
+ @id.dup
+ end
+
+ def cget_tkstring(opt)
+ @tree.element_cget_tkstring(@id, opt)
+ end
+ def cget(opt)
+ @tree.element_cget(@id, opt)
+ end
+ def cget_strict(opt)
+ @tree.element_cget_strict(@id, opt)
+ end
+
+ def configure(*args)
+ @tree.element_configure(@id, *args)
+ end
+
+ def configinfo(*args)
+ @tree.element_configinfo(@id, *args)
+ end
+
+ def current_configinfo(*args)
+ @tree.current_element_configinfo(@id, *args)
+ end
+
+ def delete
+ @tree.element_delete(@id)
+ self
+ end
+
+ def element_type
+ @tree.element_type(@id)
+ end
+
+ def element_class
+ @tree.element_class(@id)
+ end
+end
+
+class Tk::TreeCtrl::BitmapElement < Tk::TreeCtrl::Element
+ TreeCtrlElemTypeToClass['bitmap'] = self
+
+ def initialize(parent, keys=nil)
+ super(parent, 'bitmap', keys)
+ end
+end
+
+class Tk::TreeCtrl::BorderElement < Tk::TreeCtrl::Element
+ TreeCtrlElemTypeToClass['border'] = self
+
+ def initialize(parent, keys=nil)
+ super(parent, 'border', keys)
+ end
+end
+
+class Tk::TreeCtrl::ImageElement < Tk::TreeCtrl::Element
+ TreeCtrlElemTypeToClass['image'] = self
+
+ def initialize(parent, keys=nil)
+ super(parent, 'image', keys)
+ end
+end
+
+class Tk::TreeCtrl::RectangleElement < Tk::TreeCtrl::Element
+ TreeCtrlElemTypeToClass['rect'] = self
+
+ def initialize(parent, keys=nil)
+ super(parent, 'rect', keys)
+ end
+end
+
+#####################
+
+class Tk::TreeCtrl::Item < TkObject
+ TreeCtrlItemID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.clear
+ }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[tpath]
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[tpath][id]? \
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[tpath][id] : id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, keys={})
+ @tree = parent
+ @tpath = parent.path
+ @path = @id = @tree.item_create(keys)
+
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath] ||= {}
+ Tk::TreeCtrl::Item::TreeCtrlItemID_TBL[@tpath][@id] = self
+ }
+ end
+
+ def id
+ @id
+ end
+
+ def to_s
+ @id.to_s.dup
+ end
+
+ def ancestors
+ @tree.item_ancestors(@id)
+ end
+
+ def bbox(*args)
+ @tree.item_bbox(@id, *args)
+ end
+
+ def children
+ @tree.item_children(@id)
+ end
+
+ def collapse
+ @tree.item_collapse(@id)
+ self
+ end
+
+ def collapse_recurse
+ @tree.item_collapse_recurse(@id)
+ self
+ end
+
+ def complex(*args)
+ @tree.item_complex(@id, *args)
+ self
+ end
+
+ def cget_tkstring(opt)
+ @tree.item_cget_tkstring(@id, opt)
+ end
+ def cget(opt)
+ @tree.item_cget(@id, opt)
+ end
+ def cget_strict(opt)
+ @tree.item_cget_strict(@id, opt)
+ end
+
+ def configure(*args)
+ @tree.item_configure(@id, *args)
+ end
+
+ def configinfo(*args)
+ @tree.item_configinfo(@id, *args)
+ end
+
+ def current_configinfo(*args)
+ @tree.current_item_configinfo(@id, *args)
+ end
+
+ def delete
+ @tree.item_delete(@id)
+ self
+ end
+
+ def element_dump
+ @tree.item_dump(@id)
+ end
+
+ def element_dump_hash
+ @tree.item_dump_hash(@id)
+ end
+
+ def element_actual(column, elem, key)
+ @tree.item_element_actual(@id, column, elem, key)
+ end
+
+ def element_cget_tkstring(opt)
+ @tree.item_element_cget(@id, opt)
+ end
+ def element_cget_tkstring(opt)
+ @tree.item_element_cget(@id, opt)
+ end
+ def element_cget_strict(opt)
+ @tree.item_element_cget_strict(@id, opt)
+ end
+
+ def element_configure(*args)
+ @tree.item_element_configure(@id, *args)
+ end
+
+ def element_configinfo(*args)
+ @tree.item_element_configinfo(@id, *args)
+ end
+
+ def current_element_configinfo(*args)
+ @tree.current_item_element_configinfo(@id, *args)
+ end
+
+ def expand
+ @tree.item_expand(@id)
+ self
+ end
+
+ def expand_recurse
+ @tree.item_expand_recurse(@id)
+ self
+ end
+
+ def firstchild(child=nil)
+ if child
+ @tree.item_firstchild(@id, child)
+ self
+ else
+ @tree.item_firstchild(@id)
+ end
+ end
+ alias first_child firstchild
+
+ def hasbutton(st=None)
+ if st == None
+ @tree.item_hasbutton(@id)
+ else
+ @tree.item_hasbutton(@id, st)
+ self
+ end
+ end
+ alias has_button hasbutton
+
+ def hasbutton?
+ @tree.item_hasbutton(@id)
+ end
+ alias has_button? hasbutton?
+
+ def index
+ @tree.item_index(@id)
+ end
+
+ def isancestor(des)
+ @tree.item_isancestor(@id, des)
+ end
+ alias is_ancestor isancestor
+ alias isancestor? isancestor
+ alias is_ancestor? isancestor
+ alias ancestor? isancestor
+
+ def isopen
+ @tree.item_isopen(@id)
+ end
+ alias is_open isopen
+ alias isopen? isopen
+ alias is_open? isopen
+ alias isopened? isopen
+ alias is_opened? isopen
+ alias open? isopen
+
+ def lastchild(child=nil)
+ if child
+ @tree.item_lastchild(@id, child)
+ self
+ else
+ @tree.item_lastchild(@id)
+ end
+ end
+ alias last_child lastchild
+
+ def nextsibling(nxt=nil)
+ if nxt
+ @tree.item_nextsibling(@id, nxt)
+ self
+ else
+ @tree.item_nextsibling(@id)
+ end
+ end
+ alias next_sibling nextsibling
+
+ def numchildren
+ @tree.item_numchildren(@id)
+ end
+ alias num_children numchildren
+ alias children_size numchildren
+
+ def parent_index
+ @tree.item_parent(@id)
+ end
+
+ def prevsibling(nxt=nil)
+ if nxt
+ @tree.item_prevsibling(@id, nxt)
+ self
+ else
+ @tree.item_prevsibling(@id)
+ end
+ end
+ alias prev_sibling prevsibling
+
+ def remove
+ @tree.item_remove(@id)
+ end
+
+ def rnc
+ @tree.item_rnc(@id)
+ end
+
+ def sort(*opts)
+ @tree.item_sort(@id, *opts)
+ end
+ def sort_not_really(*opts)
+ @tree.item_sort_not_really(@id, *opts)
+ self
+ end
+
+ def state_forcolumn(column, *args)
+ @tree.item_state_forcolumn(@id, column, *args)
+ self
+ end
+ alias state_for_column state_forcolumn
+
+ def state_get(*args)
+ @tree.item_state_get(@id, *args)
+ end
+
+ def state_set(*args)
+ @tree.item_state_set(@id, *args)
+ self
+ end
+
+ def style_elements(column)
+ @tree.item_style_elements(@id, column)
+ end
+
+ def style_map(column, style, map)
+ @tree.item_style_map(@id, column, style, map)
+ self
+ end
+
+ def style_set(column=nil, *args)
+ if args.empty?
+ @tree.item_style_set(@id, column)
+ else
+ @tree.item_style_set(@id, column, *args)
+ self
+ end
+ end
+
+ def item_text(column, txt=nil, *args)
+ if args.empty?
+ if txt
+ @tree.item_text(@id, column, txt)
+ self
+ else
+ @tree.item_text(@id, column)
+ end
+ else
+ @tree.item_text(@id, column, txt, *args)
+ self
+ end
+ end
+
+ def toggle
+ @tree.item_toggle(@id)
+ self
+ end
+
+ def toggle_recurse
+ @tree.item_toggle_recurse(@id)
+ self
+ end
+
+ def visible(st=None)
+ if st == None
+ @tree.item_visible(@id)
+ else
+ @tree.item_visible(@id, st)
+ self
+ end
+ end
+end
+
+#####################
+
+class Tk::TreeCtrl::Style < TkObject
+ TreeCtrlStyleID_TBL = TkCore::INTERP.create_table
+
+ (TreeCtrlStyleID = ['treectrl_style'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.clear
+ }
+ }
+
+ def self.id2obj(tree, id)
+ tpath = tree.path
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
+ if Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[tpath]
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[tpath][id]? \
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[tpath][id] : id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, keys=nil)
+ @tree = parent
+ @tpath = parent.path
+
+ Tk::TreeCtrl::Style::TreeCtrlStyleID.mutex.synchronize{
+ @path = @id =
+ Tk::TreeCtrl::Style::TreeCtrlStyleID.join(TkCore::INTERP._ip_id_)
+ Tk::TreeCtrl::Style::TreeCtrlStyleID[1].succ!
+ }
+
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL.mutex.synchronize{
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath] ||= {}
+ Tk::TreeCtrl::Style::TreeCtrlStyleID_TBL[@tpath][@id] = self
+ }
+
+ @tree.style_create(@id, keys)
+ end
+
+ def id
+ @id
+ end
+
+ def to_s
+ @id.dup
+ end
+
+ def cget_tkstring(opt)
+ @tree.style_cget_tkstring(@id, opt)
+ end
+ def cget(opt)
+ @tree.style_cget(@id, opt)
+ end
+ def cget_strict(opt)
+ @tree.style_cget_strict(@id, opt)
+ end
+
+ def configure(*args)
+ @tree.style_configure(@id, *args)
+ end
+
+ def configinfo(*args)
+ @tree.style_configinfo(@id, *args)
+ end
+
+ def current_configinfo(*args)
+ @tree.current_style_configinfo(@id, *args)
+ end
+
+ def delete
+ @tree.style_delete(@id)
+ self
+ end
+
+ def elements(*elems)
+ if elems.empty?
+ @tree.style_elements(@id)
+ else
+ @tree.style_elements(@id, *elems)
+ self
+ end
+ end
+
+ def layout(elem, keys=None)
+ if keys && keys != None && keys.kind_of?(Hash)
+ @tree.style_layout(@id, elem, keys)
+ self
+ else
+ @tree.style_layout(@id, elem, keys)
+ end
+ end
+end
+
+module Tk::TreeCtrl::BindCallback
+ include Tk
+ extend Tk
+end
+
+class << Tk::TreeCtrl::BindCallback
+ def percentsCmd(*args)
+ tk_call('::TreeCtrl::PercentsCmd', *args)
+ end
+ def cursorCheck(w, x, y)
+ tk_call('::TreeCtrl::CursorCheck', w, x, y)
+ end
+ def cursorCheckAux(w)
+ tk_call('::TreeCtrl::CursorCheckAux', w)
+ end
+ def cursorCancel(w)
+ tk_call('::TreeCtrl::CursorCancel', w)
+ end
+ def buttonPress1(w, x, y)
+ tk_call('::TreeCtrl::ButtonPress1', w, x, y)
+ end
+ def doubleButton1(w, x, y)
+ tk_call('::TreeCtrl::DoubleButton1', w, x, y)
+ end
+ def motion1(w, x, y)
+ tk_call('::TreeCtrl::Motion1', w, x, y)
+ end
+ def leave1(w, x, y)
+ tk_call('::TreeCtrl::Leave1', w, x, y)
+ end
+ def release1(w, x, y)
+ tk_call('::TreeCtrl::Release1', w, x, y)
+ end
+ def beginSelect(w, el)
+ tk_call('::TreeCtrl::BeginSelect', w, el)
+ end
+ def motion(w, le)
+ tk_call('::TreeCtrl::Motion', w, el)
+ end
+ def beginExtend(w, el)
+ tk_call('::TreeCtrl::BeginExtend', w, el)
+ end
+ def beginToggle(w, el)
+ tk_call('::TreeCtrl::BeginToggle', w, el)
+ end
+ def cancelRepeat
+ tk_call('::TreeCtrl::CancelRepeat')
+ end
+ def autoScanCheck(w, x, y)
+ tk_call('::TreeCtrl::AutoScanCheck', w, x, y)
+ end
+ def autoScanCheckAux(w)
+ tk_call('::TreeCtrl::AutoScanCheckAux', w)
+ end
+ def autoScanCancel(w)
+ tk_call('::TreeCtrl::AutoScanCancel', w)
+ end
+ def up_down(w, n)
+ tk_call('::TreeCtrl::UpDown', w, n)
+ end
+ def left_right(w, n)
+ tk_call('::TreeCtrl::LeftRight', w, n)
+ end
+ def setActiveItem(w, idx)
+ tk_call('::TreeCtrl::SetActiveItem', w, idx)
+ end
+ def extendUpDown(w, amount)
+ tk_call('::TreeCtrl::ExtendUpDown', w, amount)
+ end
+ def dataExtend(w, el)
+ tk_call('::TreeCtrl::DataExtend', w, el)
+ end
+ def cancel(w)
+ tk_call('::TreeCtrl::Cancel', w)
+ end
+ def selectAll(w)
+ tk_call('::TreeCtrl::selectAll', w)
+ end
+ def marqueeBegin(w, x, y)
+ tk_call('::TreeCtrl::MarqueeBegin', w, x, y)
+ end
+ def marqueeUpdate(w, x, y)
+ tk_call('::TreeCtrl::MarqueeUpdate', w, x, y)
+ end
+ def marqueeEnd(w, x, y)
+ tk_call('::TreeCtrl::MarqueeEnd', w, x, y)
+ end
+ def scanMark(w, x, y)
+ tk_call('::TreeCtrl::ScanMark', w, x, y)
+ end
+ def scanDrag(w, x, y)
+ tk_call('::TreeCtrl::ScanDrag', w, x, y)
+ end
+
+ # filelist-bindings
+ def fileList_button1(w, x, y)
+ tk_call('::TreeCtrl::FileListButton1', w, x, y)
+ end
+ def fileList_motion1(w, x, y)
+ tk_call('::TreeCtrl::FileListMotion1', w, x, y)
+ end
+ def fileList_motion(w, x, y)
+ tk_call('::TreeCtrl::FileListMotion', w, x, y)
+ end
+ def fileList_leave1(w, x, y)
+ tk_call('::TreeCtrl::FileListLeave1', w, x, y)
+ end
+ def fileList_release1(w, x, y)
+ tk_call('::TreeCtrl::FileListRelease1', w, x, y)
+ end
+ def fileList_edit(w, i, s, e)
+ tk_call('::TreeCtrl::FileListEdit', w, i, s, e)
+ end
+ def fileList_editCancel(w)
+ tk_call('::TreeCtrl::FileListEditCancel', w)
+ end
+ def fileList_autoScanCheck(w, x, y)
+ tk_call('::TreeCtrl::FileListAutoScanCheck', w, x, y)
+ end
+ def fileList_autoScanCheckAux(w)
+ tk_call('::TreeCtrl::FileListAutoScanCheckAux', w)
+ end
+
+ def entryOpen(w, item, col, elem)
+ tk_call('::TreeCtrl::EntryOpen', w, item, col, elem)
+ end
+ def entryExpanderOpen(w, item, col, elem)
+ tk_call('::TreeCtrl::EntryExpanderOpen', w, item, col, elem)
+ end
+ def entryClose(w, accept)
+ tk_call('::TreeCtrl::EntryClose', w, accept)
+ end
+ def entryExpanderKeypress(w)
+ tk_call('::TreeCtrl::EntryExpanderKeypress', w)
+ end
+ def textOpen(w, item, col, elem, width=0, height=0)
+ tk_call('::TreeCtrl::TextOpen', w, item, col, elem, width, height)
+ end
+ def textExpanderOpen(w, item, col, elem, width)
+ tk_call('::TreeCtrl::TextOpen', w, item, col, elem, width)
+ end
+ def textClose(w, accept)
+ tk_call('::TreeCtrl::TextClose', w, accept)
+ end
+ def textExpanderKeypress(w)
+ tk_call('::TreeCtrl::TextExpanderKeypress', w)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/trofs.rb b/ext/tk/lib/tkextlib/trofs.rb
new file mode 100644
index 0000000000..5914e5165f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/trofs.rb
@@ -0,0 +1,13 @@
+#
+# trofs support
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/trofs/setup.rb'
+
+# load library
+require 'tkextlib/trofs/trofs.rb'
diff --git a/ext/tk/lib/tkextlib/trofs/setup.rb b/ext/tk/lib/tkextlib/trofs/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/trofs/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/trofs/trofs.rb b/ext/tk/lib/tkextlib/trofs/trofs.rb
new file mode 100644
index 0000000000..7a2606a275
--- /dev/null
+++ b/ext/tk/lib/tkextlib/trofs/trofs.rb
@@ -0,0 +1,51 @@
+#
+# tkextlib/trofs/trofs.rb
+# 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/trofs/setup.rb'
+
+# TkPackage.require('trofs', '0.4')
+TkPackage.require('trofs')
+
+module Tk
+ module Trofs
+ extend TkCore
+
+ PACKAGE_NAME = 'trofs'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('trofs')
+ rescue
+ ''
+ end
+ end
+
+ ##############################################
+
+ def self.create_archive(dir, archive)
+ tk_call('::trofs::archive', dir, archive)
+ archive
+ end
+
+ def self.mount(archive, mountpoint=None)
+ # returns the normalized path to mountpoint
+ tk_call('::trofs::mount', archive, mountpoint)
+ end
+
+ def self.umount(mountpoint)
+ tk_call('::trofs::umount', mountpoint)
+ mountpoint
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/version.rb b/ext/tk/lib/tkextlib/version.rb
new file mode 100644
index 0000000000..4bef78fe54
--- /dev/null
+++ b/ext/tk/lib/tkextlib/version.rb
@@ -0,0 +1,6 @@
+#
+# release date of tkextlib
+#
+module Tk
+ Tkextlib_RELEASE_DATE = '2010-02-01'.freeze
+end
diff --git a/ext/tk/lib/tkextlib/vu.rb b/ext/tk/lib/tkextlib/vu.rb
new file mode 100644
index 0000000000..d2234eb2a8
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu.rb
@@ -0,0 +1,48 @@
+#
+# The vu widget set support
+# 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/vu/setup.rb'
+
+# load package
+# TkPackage.require('vu', '2.1')
+TkPackage.require('vu')
+
+# autoload
+module Tk
+ module Vu
+ TkComm::TkExtlibAutoloadModule.unshift(self)
+
+ PACKAGE_NAME = 'vu'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('vu')
+ rescue
+ ''
+ end
+ end
+
+ ##########################################
+
+ autoload :Dial, 'tkextlib/vu/dial'
+
+ autoload :Pie, 'tkextlib/vu/pie'
+ autoload :PieSlice, 'tkextlib/vu/pie'
+ autoload :NamedPieSlice, 'tkextlib/vu/pie'
+
+ autoload :Spinbox, 'tkextlib/vu/spinbox'
+
+ autoload :Bargraph, 'tkextlib/vu/bargraph'
+ end
+end
diff --git a/ext/tk/lib/tkextlib/vu/bargraph.rb b/ext/tk/lib/tkextlib/vu/bargraph.rb
new file mode 100644
index 0000000000..b9fcf925f3
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/bargraph.rb
@@ -0,0 +1,61 @@
+#
+# ::vu::bargraph widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# create module/class
+module Tk
+ module Vu
+ class Bargraph < TkWindow
+ end
+ end
+end
+
+
+# call setup script -- <libdir>/tkextlib/vu.rb
+require 'tkextlib/vu.rb'
+
+class Tk::Vu::Bargraph < TkWindow
+ TkCommandNames = ['::vu::bargraph'.freeze].freeze
+ WidgetClassName = 'Bargraph'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ###############################
+
+ def __boolval_optkeys
+ ['showminmax', 'showvalue']
+ end
+ private :__boolval_optkeys
+
+ def __strval_optkeys
+ super() + [
+ 'title',
+ 'barbackground', 'barcolor', 'barcolour',
+ 'tickcolor', 'tickcolour',
+ 'textcolor', 'textcolour',
+ ]
+ end
+ private :__strval_optkeys
+
+ def __listval_optkeys
+ ['alabels', 'blabels']
+ end
+ private :__listval_optkeys
+
+ def __font_optkeys
+ ['alabfont', 'blabfont']
+ end
+ private :__font_optkeys
+
+ ###############################
+
+ def set(val = None)
+ tk_call_without_enc(@path, 'set', val)
+ self
+ end
+
+ def get()
+ num_or_str(tk_call_without_enc(@path, 'get'))
+ end
+end
diff --git a/ext/tk/lib/tkextlib/vu/charts.rb b/ext/tk/lib/tkextlib/vu/charts.rb
new file mode 100644
index 0000000000..8569ac5541
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/charts.rb
@@ -0,0 +1,53 @@
+#
+# charts -- Create and manipulate canvas Add-On Items
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+require 'tk/canvas'
+
+# call setup script -- <libdir>/tkextlib/vu.rb
+require 'tkextlib/vu.rb'
+
+module Tk
+ module Vu
+ module ChartsConfig
+ include TkItemConfigOptkeys
+ def __item_boolval_optkeys(id)
+ super(id) << 'lefttrunc' << 'autocolor'
+ end
+ private :__item_boolval_optkeys
+
+ def __item_strval_optkeys(id)
+ super(id) << 'bar' << 'color' << 'outline' <<
+ 'fill' << 'scaleline' << 'stripline'
+ end
+ private :__item_strval_optkeys
+
+ def __item_listval_optkeys(id)
+ super(id) << 'values' << 'tags'
+ end
+ private :__item_listval_optkeys
+ end
+
+ class TkcSticker < TkcItem
+ include ChartsConfig
+
+ CItemTypeName = 'sticker'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ end
+
+ class TkcStripchart < TkcItem
+ include ChartsConfig
+
+ CItemTypeName = 'stripchart'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ end
+
+ class TkcBarchart < TkcItem
+ include ChartsConfig
+
+ CItemTypeName = 'barchart'.freeze
+ CItemTypeToClass[CItemTypeName] = self
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/vu/dial.rb b/ext/tk/lib/tkextlib/vu/dial.rb
new file mode 100644
index 0000000000..4d04974a55
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/dial.rb
@@ -0,0 +1,102 @@
+#
+# ::vu::dial widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# create module/class
+module Tk
+ module Vu
+ class Dial < TkWindow
+ end
+ end
+end
+
+# call setup script -- <libdir>/tkextlib/vu.rb
+require 'tkextlib/vu.rb'
+
+# define module/class
+class Tk::Vu::Dial < TkWindow
+ TkCommandNames = ['::vu::dial'.freeze].freeze
+ WidgetClassName = 'Dial'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ ###############################
+
+ def __methodcall_optkeys # { key=>method, ... }
+ {'coords'=>'coords'}
+ end
+ private :__methodcall_optkeys
+
+ ###############################
+
+ def coords(val = nil)
+ if val
+ tk_send_without_enc('coords', val)
+ self
+ else
+ tk_split_list(tk_send_without_enc('coords'))
+ end
+ end
+
+ def constrain(val = None)
+ num_or_str(tk_call(@path, 'constrain', val))
+ end
+
+ def get(*args)
+ num_or_str(tk_call(@path, 'get', *args))
+ end
+
+ def identify(x, y)
+ tk_call(@path, 'identify', x, y)
+ end
+
+ def get_label(val=nil)
+ if val
+ tk_call(@path, 'label', val)
+ else
+ ret = []
+ lst = simplelist(tk_call(@path, 'label'))
+ while lst.size > 0
+ ret << ([num_or_str(lst.shift)] << lst.shift)
+ end
+ end
+ end
+
+ def set_label(val, str, *args)
+ tk_call(@path, 'label', val, str, *args)
+ self
+ end
+
+ def set_label_constrain(val, str, *args)
+ tk_call(@path, 'label', '-constrain', val, str, *args)
+ self
+ end
+
+ def get_tag(val=nil)
+ if val
+ tk_call(@path, 'tag', val)
+ else
+ ret = []
+ lst = simplelist(tk_call(@path, 'tag'))
+ while lst.size > 0
+ ret << ([num_or_str(lst.shift)] << lst.shift)
+ end
+ end
+ end
+
+ def set_tag(val, str, *args)
+ tk_call(@path, 'tag', val, str, *args)
+ self
+ end
+
+ def set_tag_constrain(val, str, *args)
+ tk_call(@path, 'tag', '-constrain', val, str, *args)
+ self
+ end
+
+ def set(val = None)
+ tk_call_without_enc(@path, 'set', val)
+ self
+ end
+end
diff --git a/ext/tk/lib/tkextlib/vu/pie.rb b/ext/tk/lib/tkextlib/vu/pie.rb
new file mode 100644
index 0000000000..6b0c485d8a
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/pie.rb
@@ -0,0 +1,286 @@
+#
+# ::vu::pie widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# create module/class
+module Tk
+ module Vu
+ module PieSliceConfigMethod
+ end
+ class Pie < TkWindow
+ end
+ class PieSlice < TkObject
+ end
+ class NamedPieSlice < PieSlice
+ end
+ end
+end
+
+# call setup script -- <libdir>/tkextlib/vu.rb
+require 'tkextlib/vu.rb'
+
+module Tk::Vu::PieSliceConfigMethod
+ include TkItemConfigMethod
+
+ def __item_pathname(tagOrId)
+ if tagOrId.kind_of?(Tk::Vu::PieSlice)
+ self.path + ';' + tagOrId.id.to_s
+ else
+ self.path + ';' + tagOrId.to_s
+ end
+ end
+ private :__item_pathname
+end
+
+class Tk::Vu::Pie < TkWindow
+ TkCommandNames = ['::vu::pie'.freeze].freeze
+ WidgetClassName = 'Pie'.freeze
+ WidgetClassNames[WidgetClassName] ||= self
+
+ def __destroy_hook__
+ Tk::Vu::PieSlice::SliceID_TBL.delete(@path)
+ end
+
+ ###############################
+
+ include Tk::Vu::PieSliceConfigMethod
+
+ def tagid(tag)
+ if tag.kind_of?(Tk::Vu::PieSlice)
+ tag.id
+ else
+ # tag
+ _get_eval_string(tag)
+ end
+ end
+
+ ###############################
+
+ def delete(*glob_pats)
+ tk_call(@path, 'delete', *glob_pats)
+ self
+ end
+
+ def explode(slice, *args)
+ tk_call(@path, 'explode', slice, *args)
+ self
+ end
+
+ def explode_value(slice)
+ num_or_str(tk_call(@path, 'explode', slice))
+ end
+
+ def lower(slice, below=None)
+ tk_call(@path, 'lower', slice, below)
+ self
+ end
+
+ def names(*glob_pats)
+ simplelist(tk_call(@path, 'names', *glob_pats))
+ end
+ alias slices names
+
+ def order(*args)
+ tk_call(@path, 'order', *args)
+ self
+ end
+
+ def raise(slice, above=None)
+ tk_call(@path, 'raise', slice, above)
+ self
+ end
+
+ def swap(slice1, slice2)
+ tk_call(@path, 'swap', slice1, slice2)
+ self
+ end
+
+ def set(slice, *args)
+ num_or_str(tk_call(@path, 'set', slice, *args))
+ end
+ alias set_value set
+ alias set_values set
+ alias create set
+
+ def slice_value(slice)
+ num_or_str(tk_call(@path, 'set', slice))
+ end
+
+ def value(val = None)
+ num_or_str(tk_call_without_enc(@path, 'value'))
+ end
+ alias sum_value value
+end
+
+class Tk::Vu::PieSlice
+ SliceID_TBL = TkCore::INTERP.create_table
+
+ (Pie_Slice_ID = ['vu:pie'.freeze, TkUtil.untrust('00000')]).instance_eval{
+ @mutex = Mutex.new
+ def mutex; @mutex; end
+ freeze
+ }
+
+ TkCore::INTERP.init_ip_env{
+ SliceID_TBL.mutex.synchronize{ SliceID_TBL.clear }
+ }
+
+ def self.id2obj(pie, id)
+ pie_path = pie.path
+ SliceID_TBL.mutex.synchronize{
+ if SliceID_TBL[pie_path]
+ SliceID_TBL[pie_path][id]? SliceID_TBL[pie_path][id]: id
+ else
+ id
+ end
+ }
+ end
+
+ def initialize(parent, *args)
+ unless parent.kind_of?(Tk::Vu::Pie)
+ fail ArgumentError, "expect a Tk::Vu::Pie instance for 1st argument"
+ end
+ @parent = @pie = parent
+ @ppath = parent.path
+ Pie_Slice_ID.mutex.synchronize{
+ @path = @id = Pie_Slice_ID.join(TkCore::INTERP._ip_id_)
+ Pie_Slice_ID[1].succ!
+ }
+ SliceID_TBL.mutex.synchronize{
+ SliceID_TBL[@ppath] = {} unless SliceID_TBL[@ppath]
+ SliceID_TBL[@ppath][@id] = self
+ }
+
+ if args[-1].kind_of?(Hash)
+ keys = args.unshift
+ end
+ @pie.set(@id, *args)
+ configure(keys)
+ end
+
+ def id
+ @id
+ end
+
+ def [](key)
+ cget key
+ end
+
+ def []=(key,val)
+ configure key, val
+ val
+ end
+
+ def cget_tkstring(slot)
+ @pie.itemcget_tkstring(@id, slot)
+ end
+
+ def cget(slot)
+ @pie.itemcget(@id, slot)
+ end
+
+ def cget_strict(slot)
+ @pie.itemcget_strict(@id, slot)
+ end
+
+ def configure(*args)
+ @pie.itemconfigure(@id, *args)
+ self
+ end
+
+ def configinfo(*args)
+ @pie.itemconfiginfo(@id, *args)
+ end
+
+ def current_configinfo(*args)
+ @pie.current_itemconfiginfo(@id, *args)
+ end
+
+ def delete
+ @pie.delete(@id)
+ end
+
+ def explode(value)
+ @pie.explode(@id, value)
+ self
+ end
+
+ def explode_value
+ @pie.explode_value(@id)
+ end
+
+ def lower(other=None)
+ @pie.lower(@id, other)
+ self
+ end
+
+ def raise(other=None)
+ @pie.raise(@id, other)
+ self
+ end
+
+ def set(value)
+ @pie.set(@id, value)
+ self
+ end
+ alias set_value set
+
+ def value
+ @pie.set(@id)
+ end
+end
+
+class Tk::Vu::NamedPieSlice
+ def self.new(parent, name, *args)
+ obj = nil
+ SliceID_TBL.mutex.synchronize{
+ if SliceID_TBL[parent.path] && SliceID_TBL[parent.path][name]
+ obj = SliceID_TBL[parent.path][name]
+ else
+ #super(parent, name, *args)
+ unless parent.kind_of?(Tk::Vu::Pie)
+ fail ArgumentError, "expect a Tk::Vu::Pie instance for 1st argument"
+ end
+ obj = self.allocate
+ obj.instance_eval{
+ @parent = @pie = parent
+ @ppath = parent.path
+ @path = @id = name.to_s
+ SliceID_TBL[@ppath] = {} unless SliceID_TBL[@ppath]
+ SliceID_TBL[@ppath][@id] = self
+ }
+ end
+ }
+ obj.instance_eval{
+ if args[-1].kind_of?(Hash)
+ keys = args.unshift
+ end
+ @pie.set(@id, *args)
+ configure(keys)
+ }
+
+ obj
+ end
+
+ def initialize(parent, name, *args)
+ # dummy:: not called by 'new' method
+ unless parent.kind_of?(Tk::Vu::Pie)
+ fail ArgumentError, "expect a Tk::Vu::Pie instance for 1st argument"
+ end
+ @parent = @pie = parent
+ @ppath = parent.path
+ @path = @id = name.to_s
+ SliceID_TBL.mutex.synchronize{
+ SliceID_TBL[@ppath] = {} unless SliceID_TBL[@ppath]
+ SliceID_TBL[@ppath][@id] = self
+ }
+
+ if args[-1].kind_of?(Hash)
+ keys = args.unshift
+ end
+ @pie.set(@id, *args)
+ configure(keys)
+ end
+end
diff --git a/ext/tk/lib/tkextlib/vu/setup.rb b/ext/tk/lib/tkextlib/vu/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/vu/spinbox.rb b/ext/tk/lib/tkextlib/vu/spinbox.rb
new file mode 100644
index 0000000000..7d6104f4d1
--- /dev/null
+++ b/ext/tk/lib/tkextlib/vu/spinbox.rb
@@ -0,0 +1,22 @@
+#
+# ::vu::spinbox widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# a standard spinbox (<= 8.3)
+# This is the same as the 8.4 core spinbox widget.
+#
+require 'tk'
+
+if (Tk::TK_MAJOR_VERSION < 8 ||
+ (Tk::TK_MAJOR_VERSION == 8 && Tk::TK_MINOR_VERSION < 4))
+ # call setup script -- <libdir>/tkextlib/vu.rb
+ require 'tkextlib/vu.rb'
+
+ Tk.tk_call('namespace', 'import', '::vu::spinbox')
+end
+
+module Tk
+ module Vu
+ Spinbox = Tk::Spinbox
+ end
+end
diff --git a/ext/tk/lib/tkextlib/winico.rb b/ext/tk/lib/tkextlib/winico.rb
new file mode 100644
index 0000000000..ce7b8eac5c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/winico.rb
@@ -0,0 +1,14 @@
+#
+# winico -- Windows Icon extension support
+# 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/tktable/setup.rb'
+
+# load library
+require 'tkextlib/winico/winico'
diff --git a/ext/tk/lib/tkextlib/winico/setup.rb b/ext/tk/lib/tkextlib/winico/setup.rb
new file mode 100644
index 0000000000..ee406c6ca0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/winico/setup.rb
@@ -0,0 +1,8 @@
+#
+# setup.rb -- setup script before calling TkPackage.require()
+#
+# If you need some setup operations (for example, add a library path
+# to the library search path) before using Tcl/Tk library packages
+# wrapped by Ruby scripts in this directory, please write the setup
+# operations in this file.
+#
diff --git a/ext/tk/lib/tkextlib/winico/winico.rb b/ext/tk/lib/tkextlib/winico/winico.rb
new file mode 100644
index 0000000000..9160c2960f
--- /dev/null
+++ b/ext/tk/lib/tkextlib/winico/winico.rb
@@ -0,0 +1,224 @@
+#
+# tkextlib/winico/winico.rb
+# 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/winico/setup.rb'
+
+# TkPackage.require('winico', '0.5')
+# TkPackage.require('winico', '0.6')
+TkPackage.require('winico')
+
+module Tk
+ class Winico < TkObject
+ PACKAGE_NAME = 'winico'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('winico')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+class Tk::Winico
+ WinicoID_TBL = TkCore::INTERP.create_table
+
+ TkCore::INTERP.init_ip_env{
+ WinicoID_TBL.mutex.synchronize{ WinicoID_TBL.clear }
+ }
+
+ def self.id2obj(id)
+ WinicoID_TBL.mutex.synchronize{
+ (WinicoID_TBL.key?(id))? WinicoID_TBL[id] : id
+ }
+ end
+
+ def self.info
+ simplelist(Tk.tk_call('winico', 'info')).collect{|id|
+ Tk::Winico.id2obj(id)
+ }
+ end
+
+ def self.icon_info(id)
+ simplelist(Tk.tk_call('winico', 'info', id)).collect{|inf|
+ h = Hash[*list(inf)]
+ h.keys.each{|k| h[k[1..-1]] = h.delete(k)}
+ }
+ end
+
+ #################################
+
+ def self.new_from_file(file_name)
+ self.new(file_name)
+ end
+
+ def self.new_from_resource(resource_name, file_name = nil)
+ self.new(file_name, resource_name)
+ end
+
+ def initialize(file_name, resource_name=nil, winico_id=nil)
+ if resource_name
+ # from resource
+ if file_name
+ @id = Tk.tk_call('winico', 'load', resource_name, file_name)
+ else
+ @id = Tk.tk_call('winico', 'load', resource_name)
+ end
+ elsif file_name
+ # from .ico file
+ @id = Tk.tk_call('winico', 'createfrom', file_name)
+ elsif winico_id
+ @id = winico_id
+ else
+ fail ArgumentError,
+ "must be given proper information from where loading icons"
+ end
+ @path = @id
+ WinicoID_TBL.mutex.synchronize{
+ WinicoID_TBL[@id] = self
+ }
+ end
+
+ def id
+ @id
+ end
+
+ def set_window(win_id, *opts) # opts := ?'big'|'small'?, ?pos?
+ # NOTE:: the window, which is denoted by win_id, MUST BE MAPPED.
+ # If not, then this may fail or crash.
+ tk_call('winico', 'setwindow', win_id, @id, *opts)
+ end
+
+ def delete
+ tk_call('winico', 'delete', @id)
+ WinicoID_TBL.mutex.synchronize{
+ WinicoID_TBL.delete(@id)
+ }
+ self
+ end
+ alias destroy delete
+
+ def info
+ Tk::Winico.icon_info(@id)
+ end
+
+ #################################
+
+ class Winico_callback < TkValidateCommand
+ class ValidateArgs < TkUtil::CallbackSubst
+ KEY_TBL = [
+ [ ?m, ?s, :message ],
+ [ ?i, ?x, :icon ],
+ [ ?x, ?n, :x ],
+ [ ?y, ?n, :y ],
+ [ ?X, ?n, :last_x ],
+ [ ?Y, ?n, :last_y ],
+ [ ?t, ?n, :tickcount ],
+ [ ?w, ?n, :icon_idnum ],
+ [ ?l, ?n, :msg_idnum ],
+ nil
+ ]
+
+ PROC_TBL = [
+ [ ?n, TkComm.method(:number) ],
+ [ ?s, TkComm.method(:string) ],
+ [ ?x, proc{|id|
+ Tk::Winico::WinicoID_TBL.mutex.synchronize{
+ if Tk::Winico::WinicoID_TBL.key?(id)
+ obj = Tk::Winico::WinicoID_TBL[id]
+ else
+ # Tk::Winico.new(nil, nil, id)
+ obj = Tk::Winico.allocate
+ obj.instance_eval{ @path = @id = id }
+ Tk::Winico::WinicoID_TBL[id] = obj
+ end
+ obj
+ }
+ } ],
+ nil
+ ]
+
+=begin
+ # for Ruby m17n :: ?x --> String --> char-code ( getbyte(0) )
+ KEY_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ inf[1] = inf[1].getbyte(0) if inf[1].kind_of?(String)
+ end
+ inf
+ }
+
+ PROC_TBL.map!{|inf|
+ if inf.kind_of?(Array)
+ inf[0] = inf[0].getbyte(0) if inf[0].kind_of?(String)
+ end
+ inf
+ }
+=end
+
+ _setup_subst_table(KEY_TBL, PROC_TBL);
+
+ def self.ret_val(val)
+ val
+ end
+ end
+
+ def self._config_keys
+ ['callback']
+ end
+ end
+
+ #################################
+
+ def add_to_taskbar(keys = {})
+ keys = _symbolkey2str(keys)
+ Winico_callback._config_keys.each{|k|
+ if keys[k].kind_of?(Array)
+ cmd, *args = keys[k]
+ #keys[k] = Winico_callback.new(cmd, args.join(' '))
+ keys[k] = Winico_callback.new(cmd, *args)
+ # elsif keys[k].kind_of?(Proc)
+ elsif TkComm._callback_entry?(keys[k])
+ keys[k] = Winico_callback.new(keys[k])
+ end
+ }
+ tk_call('winico', 'taskbar', 'add', @id, *(hash_kv(keys)))
+ self
+ end
+ alias taskbar_add add_to_taskbar
+
+ def modify_taskbar(keys = {})
+ keys = _symbolkey2str(keys)
+ Winico_callback._config_keys.each{|k|
+ if keys[k].kind_of?(Array)
+ cmd, *args = keys[k]
+ #keys[k] = Winico_callback.new(cmd, args.join(' '))
+ keys[k] = Winico_callback.new(cmd, *args)
+ # elsif keys[k].kind_of?(Proc)
+ elsif TkComm._callback_entry?(keys[k])
+ keys[k] = Winico_callback.new(keys[k])
+ end
+ }
+ tk_call('winico', 'taskbar', 'modify', @id, *(hash_kv(keys)))
+ self
+ end
+ alias taskbar_modify modify_taskbar
+
+ def delete_from_taskbar
+ tk_call('winico', 'taskbar', 'delete', @id)
+ self
+ end
+ alias taskbar_delete delete_from_taskbar
+end
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb
new file mode 100644
index 0000000000..38a96633de
--- /dev/null
+++ b/ext/tk/lib/tkfont.rb
@@ -0,0 +1,4 @@
+#
+# tkfont.rb - load tk/font.rb
+#
+require 'tk/font'
diff --git a/ext/tk/lib/tkmacpkg.rb b/ext/tk/lib/tkmacpkg.rb
new file mode 100644
index 0000000000..35560e78ce
--- /dev/null
+++ b/ext/tk/lib/tkmacpkg.rb
@@ -0,0 +1,4 @@
+#
+# tkmacpkg.rb - load tk/macpkg.rb
+#
+require 'tk/macpkg'
diff --git a/ext/tk/lib/tkmenubar.rb b/ext/tk/lib/tkmenubar.rb
new file mode 100644
index 0000000000..70214fda1a
--- /dev/null
+++ b/ext/tk/lib/tkmenubar.rb
@@ -0,0 +1,4 @@
+#
+# tkmenubar.rb - load tk/menubar.rb
+#
+require 'tk/menubar'
diff --git a/ext/tk/lib/tkmngfocus.rb b/ext/tk/lib/tkmngfocus.rb
new file mode 100644
index 0000000000..fe70950e8e
--- /dev/null
+++ b/ext/tk/lib/tkmngfocus.rb
@@ -0,0 +1,4 @@
+#
+# tkmngfocus.rb - load tk/mngfocus.rb
+#
+require 'tk/mngfocus'
diff --git a/ext/tk/lib/tkpalette.rb b/ext/tk/lib/tkpalette.rb
new file mode 100644
index 0000000000..56b203bbb9
--- /dev/null
+++ b/ext/tk/lib/tkpalette.rb
@@ -0,0 +1,4 @@
+#
+# tkpalette.rb - load tk/palette.rb
+#
+require 'tk/palette'
diff --git a/ext/tk/lib/tkscrollbox.rb b/ext/tk/lib/tkscrollbox.rb
new file mode 100644
index 0000000000..6093b2e4e7
--- /dev/null
+++ b/ext/tk/lib/tkscrollbox.rb
@@ -0,0 +1,4 @@
+#
+# tkscrollbox.rb - load tk/scrollbox.rb
+#
+require 'tk/scrollbox'
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
new file mode 100644
index 0000000000..97ad62a3ea
--- /dev/null
+++ b/ext/tk/lib/tktext.rb
@@ -0,0 +1,4 @@
+#
+# tktext.rb - load tk/text.rb
+#
+require 'tk/text'
diff --git a/ext/tk/lib/tkvirtevent.rb b/ext/tk/lib/tkvirtevent.rb
new file mode 100644
index 0000000000..f4fae19a0a
--- /dev/null
+++ b/ext/tk/lib/tkvirtevent.rb
@@ -0,0 +1,4 @@
+#
+# tkvirtevent.rb - load tk/virtevent.rb
+#
+require 'tk/virtevent'
diff --git a/ext/tk/lib/tkwinpkg.rb b/ext/tk/lib/tkwinpkg.rb
new file mode 100644
index 0000000000..83371c546d
--- /dev/null
+++ b/ext/tk/lib/tkwinpkg.rb
@@ -0,0 +1,4 @@
+#
+# tkwinpkg.rb - load tk/winpkg.rb
+#
+require 'tk/winpkg'
diff --git a/ext/tk/old-README.tcltklib.ja b/ext/tk/old-README.tcltklib.ja
new file mode 100644
index 0000000000..e29b389402
--- /dev/null
+++ b/ext/tk/old-README.tcltklib.ja
@@ -0,0 +1,159 @@
+(tof)
+ 2003/06/19 Hidetoshi NAGAI
+
+本ドキュメントには古い tcltk ライブラリ,tcltklib ライブラリの説明
+が含まれていますが,その記述内容は古いものとなっています.
+
+まず,現在の Ruby/Tk の中心である tk.rb は wish を呼び出したりはせ
+ず,tcltklib ライブラリを wrap して動作するものとなっています.その
+ため,古い説明記述で述べられているようなプロセス間通信によるオーバ
+ヘッドは存在しません.
+
+現在の tcltklib ライブラリでも,Tcl/Tk の C ライブラリをリンクして
+直接に動かすことで,オーバヘッドを押さえつつ Tcl/Tk インタープリタ
+のほぼ全機能(拡張ライブラリを含む)を使える点は同じです.しかし,
+その役割はほぼ「tk.rb 以下のライブラリを効果的に働かせるためのもの」
+と見なされており,その目的でメンテナンスされています.
+
+tk.rb の高機能化に伴って,中水準のライブラリである tcltk ライブラリ
+(tcltk.rb)はその存在意義を減じており,現在ではメンテナンスは行わ
+れていません.
+
+なお,古い説明ではバインディングにおけるスクリプトの追加はできないこ
+ととなっていますが,現在の tk.rb ではこれも可能であることを補足して
+おきます.
+
+以下がライブラリの古い説明文書です.
+==============================================================
+ tcltk ライブラリ
+ tcltklib ライブラリ
+ Sep. 19, 1997 Y. Shigehiro
+
+以下, 「tcl/tk」という表記は, tclsh や wish を実現している, 一般でいう
+ところの tcl/tk を指します. 「tcltk ライブラリ」, 「tcltklib ライブラ
+リ」という表記は, 本パッケージに含まれる ruby 用のライブラリを指します.
+
+[ファイルについて]
+
+README.euc : このファイル(注意, 特徴, インストールの方法).
+MANUAL.euc : マニュアル.
+
+lib/, ext/ : ライブラリの実体.
+
+sample/ : マニュアル代わりのサンプルプログラム.
+sample/sample0.rb : tcltklib ライブラリのテスト.
+sample/sample1.rb : tcltk ライブラリのテスト.
+ tcl/tk (wish) でできそうなことを一通り書いてみました.
+sample/sample2.rb : tcltk ライブラリのサンプル.
+ maeda shugo (shugo@po.aianet.ne.jp) 氏による
+ (`rb.tk' で書かれていた) ruby のサンプルプログラム
+ http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz
+ を tcltk ライブラリを使うように, 機械的に変更してみました.
+
+demo/ : 100 本の線を 100 回描くデモプログラム.
+ 最初に空ループの時間を測定し, 続いて実際に線を引く時間を測定します.
+ tcl/tk は(再)描画のときに backing store を使わずに律義に 10000 本(?)
+ 線を引くので, (再)描画を始めると, マシンがかなり重くなります.
+demo/lines0.tcl : wish 用のスクリプト.
+demo/lines1.rb : `tk.rb' 用のスクリプト.
+demo/lines2.rb : tcltk ライブラリ用のスクリプト.
+
+[注意]
+
+コンパイル/実行には, tcl/tk の C ライブラリが必要です.
+
+このライブラリは,
+
+ ruby-1.0-970701, ruby-1.0-970911, ruby-1.0-970919
+ FreeBSD 2.2.2-RELEASE
+ およびそのパッケージ jp-tcl-7.6.tgz, jp-tk-4.2.tgz
+
+で作成/動作確認しました. 他の環境では動作するかどうかわかりません.
+
+TclTkLib.mainloop を実行中に Control-C が効かないのは不便なので, ruby
+のソースを参考に, #include "sig.h" して trap_immediate を操作していま
+すが, ruby の README.EXT にも書いてないのに, こんなことをして良いのか
+どうかわかりません.
+
+-d オプションでデバッグ情報を表示させるために, ruby のソースを参考に,
+debug という大域変数を参照していますが, ruby の README.EXT にも書いて
+ないのに, こんなことをして良いのかどうかわかりません.
+
+extconf.rb は書きましたが, (いろいろな意味で)これで良いのか良く分かり
+ません.
+
+[特徴]
+
+ruby から tcl/tk ライブラリを利用できます.
+
+tcl/tk インタプリタのスクリプトは, 機械的に tcltk ライブラリ用の ruby
+スクリプトに変換できます.
+
+(`tk.rb' との違い)
+
+1. tcl/tk インタプリタのスクリプトが, どのように, tcltk ライブラリ用の
+ ruby スクリプトに変換されるかが理解できれば, マニュアル類が無いに等
+ しい `tk.rb' とは異なり
+
+ tcl/tk のマニュアルやオンラインドキュメントを用いて
+
+ 効率良くプログラミングを行うことができます.
+ 記述方法がわからない, コマンドに与えるパラメータがわからない...
+ - Canvas.new { ... } と, なぜイテレータブロックを書けるの??
+ - Canvas の bbox は数値のリストを返すのに, xview は文字列を返すの??
+ と, いちいち, ライブラリのソースを追いかける必要はありません.
+
+2. 個々の機能(オプション)を個別処理によりサポートしており, そのためサ
+ ポートしていない機能は使うことができない(本当は使えないこともないの
+ ですが) `tk.rb' とは異なり, tcl/tk インタプリタで可能なことは
+
+ ほとんど
+
+ ruby からも実行できます. 現在, ruby から実行できないことが確認され
+ ているのは,
+
+ bind コマンドでスクリプトを追加する構文
+ 「bind tag sequence +script」
+ ^
+
+ のみです.
+ - `. configure -width' をしようとして, `Tk.root.height()' と書い
+ たのに, `undefined method `height'' と怒られてしまった. tk.rb を
+ 読んでみて, ガーン. できないのか...
+ ということはありません.
+
+3. wish プロセスを起動しプロセス間通信で wish を利用する `tk.rb' とは
+ 異なり, tcl/tk の C ライブラリをリンクし
+
+ より高速に (といっても, 思った程は速くないですが)
+
+ 処理を行います.
+
+4. `tk.rb' ほど, 高水準なインターフェースを備えていないため, tcl/tk イ
+ ンタプリタの生成等
+
+ 何から何まで自分で記述
+
+ しなければなりません(その代わり, tcl/tk ライブラリの仕様通り,
+ tcl/tk インタプリタを複数生成することもできますが).
+ インターフェースは(おそらく) ruby の思想に沿ったものではありません.
+ また, スクリプトの記述は
+
+ ダサダサ
+
+ です. スクリプトは, 一見, 読みづらいものとなります. が, 書く人にとっ
+ ては, それほど煩わしいものではないと思います.
+
+[インストールの方法]
+
+0. ruby のソースファイル(ruby-1.0-なんたら.tgz)を展開しておきます.
+
+1. ruby-1.0-なんたら/ext に ext/tcltklib をコピーします.
+ cp -r ext/tcltklib ???/ruby-1.0-なんたら/ext/
+
+2. ruby のインストール法に従い make 等をします.
+
+3. ruby のライブラリ置場に lib/* をコピーします.
+ cp lib/* /usr/local/lib/ruby/
+
+(eof)
diff --git a/ext/tk/old-extconf.rb b/ext/tk/old-extconf.rb
new file mode 100644
index 0000000000..ebc83a0c0b
--- /dev/null
+++ b/ext/tk/old-extconf.rb
@@ -0,0 +1,440 @@
+# extconf.rb for tcltklib
+
+require 'mkmf'
+
+is_win32 = (/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM)
+#is_macosx = (/darwin/ =~ RUBY_PLATFORM)
+
+have_func("ruby_native_thread_p", "ruby.h")
+have_func("rb_errinfo", "ruby.h")
+have_func("rb_safe_level", "ruby.h")
+have_struct_member("struct RArray", "ptr", "ruby.h")
+have_struct_member("struct RArray", "len", "ruby.h")
+
+def find_framework(tcl_hdr, tk_hdr)
+ if framework_dir = with_config("tcltk-framework")
+ paths = [framework_dir]
+ else
+ unless tcl_hdr || tk_hdr ||
+ enable_config("tcltk-framework", false) ||
+ enable_config("mac-tcltk-framework", false)
+ return false
+ end
+ paths = ["/Library/Frameworks", "/System/Library/Frameworks"]
+ end
+
+ checking_for('Tcl/Tk Framework') {
+ paths.find{|dir|
+ dir.strip!
+ dir.chomp!('/')
+ (tcl_hdr || FileTest.directory?(dir + "/Tcl.framework/") ) &&
+ (tk_hdr || FileTest.directory?(dir + "/Tk.framework/") )
+ }
+ }
+end
+
+tcl_framework_header = with_config("tcl-framework-header")
+tk_framework_header = with_config("tk-framework-header")
+
+tcltk_framework = find_framework(tcl_framework_header, tk_framework_header)
+
+unless is_win32
+ have_library("nsl", "t_open")
+ have_library("socket", "socket")
+ have_library("dl", "dlopen")
+ have_library("m", "log")
+end
+
+tk_idir, tk_ldir = dir_config("tk")
+tcl_idir, tcl_ldir = dir_config("tcl")
+x11_idir, x11_ldir = dir_config("X11")
+
+tk_ldir2 = with_config("tk-lib")
+tcl_ldir2 = with_config("tcl-lib")
+x11_ldir2 = with_config("X11-lib")
+
+tk_ldir_list = [tk_ldir2, tk_ldir]
+tcl_ldir_list = [tcl_ldir2, tcl_ldir]
+
+tklib = with_config("tklib")
+tcllib = with_config("tcllib")
+stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
+
+tcltk_version = with_config("tcltkversion")
+
+use_X = with_config("X11", (! is_win32))
+
+def parse_tclConfig(file)
+ # check tclConfig.sh/tkConfig.sh
+ tbl = {}
+ IO.foreach(file){|line|
+ line.strip!
+ next if line !~ /^([^\#=][^=]*)=(['"]|)(.*)\2$/
+ key, val = $1, $3
+ tbl[key] = val.gsub(/\$\{([^}]+)\}/){|s| tbl[$1]} rescue nil
+ }
+ tbl
+end
+
+def check_tcltk_version(version)
+ return [nil, nil] unless version
+
+ version = version.strip
+
+ tclver = version.dup
+ tkver = version.dup
+
+ major = dot = minor = dot = plvl = ext = nil
+
+ if version =~ /^(\d)(\.?)(\d)(\.?)(\d*)(.*)$/
+ major = $1; minor_dot = $2; minor = $3; plvl_dot = $4; plvl = $5; ext = $6
+ dot = ! minor_dot.empty?
+ if plvl_dot.empty? && ! plvl.empty?
+ minor << plvl
+ end
+ elsif version =~ /^(\d)(\.?)(\d?)(.*)$/
+ major = $1; minor_dot = $2; minor = $3; ext = $4
+ dot = ! minor_dot.empty?
+ else # unknown -> believe user
+ return [tclver, tkver]
+ end
+
+ # check Tcl7.6 / Tk4.2 ?
+ if major == "7" # Tcl7.6 ( not support Tclversion < 7.6 )
+ # Tk4.2
+ tkver = "4" + ((dot)? ".": "") + ((minor.empty)? "": "2") + ext
+ elsif major == "4" # Tk4.2 ( not support Tkversion < 4.2 )
+ # Tcl7.6
+ tclver = "7" + ((dot)? ".": "") + ((minor.empty)? "": "6") + ext
+ end
+
+ [tclver, tkver]
+end
+
+def find_tcl(tcllib, stubs, version, *opt_paths)
+ default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+ default_paths << "/Tcl/lib" # default for ActiveTcl
+
+ if (paths = opt_paths.compact).empty?
+ paths = default_paths
+ end
+
+ if stubs
+ func = "Tcl_InitStubs"
+ lib = "tclstub"
+ else
+ func = "Tcl_FindExecutable"
+ lib = "tcl"
+ end
+
+ if version && ! version.empty?
+ versions = [version]
+ else
+ versions = %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6]
+ end
+
+ if tcllib
+ st = find_library(tcllib, func, *paths)
+ else
+ st = versions.find { |ver|
+ find_library("#{lib}#{ver}", func, *paths) or
+ find_library("#{lib}#{ver.delete('.')}", func, *paths) or
+ find_library("#{lib}#{ver}g", func, *paths) or
+ find_library("#{lib}#{ver.delete('.')}g", func, *paths) or
+ find_library("tcl#{ver}", func, *paths) or
+ find_library("tcl#{ver.delete('.')}", func, *paths) or
+ find_library("tcl#{ver}g", func, *paths) or
+ find_library("tcl#{ver.delete('.')}g", func, *paths)
+ } || (!version && find_library(lib, func, *paths))
+ end
+
+ unless st
+ puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
+ end
+ st
+end
+
+def find_tk(tklib, stubs, version, *opt_paths)
+ default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+ default_paths << "/Tcl/lib" # default for ActiveTcl
+
+ if (paths = opt_paths.compact).empty?
+ paths = default_paths
+ end
+
+ if stubs
+ func = "Tk_InitStubs"
+ lib = "tkstub"
+ else
+ func = "Tk_Init"
+ lib = "tk"
+ end
+
+ if version && ! version.empty?
+ versions = [version]
+ else
+ versions = %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
+ end
+
+ if tklib
+ st = find_library(tklib, func, *paths)
+ else
+ st = versions.find { |ver|
+ find_library("#{lib}#{ver}", func, *paths) or
+ find_library("#{lib}#{ver.delete('.')}", func, *paths) or
+ find_library("#{lib}#{ver}g", func, *paths) or
+ find_library("#{lib}#{ver.delete('.')}g", func, *paths) or
+ find_library("tk#{ver}", func, *paths) or
+ find_library("tk#{ver.delete('.')}", func, *paths) or
+ find_library("tk#{ver}g", func, *paths) or
+ find_library("tk#{ver.delete('.')}g", func, *paths)
+ } || (!version && find_library(lib, func, *paths))
+ end
+
+ unless st
+ puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
+ end
+ st
+end
+
+def find_tcltk_header(tclver, tkver)
+ base_dir = ['/usr/local/include', '/usr/pkg/include', '/usr/include']
+ base_dir << '/Tcl/include' # default for ActiveTcl
+
+ unless have_tcl_h = have_header('tcl.h')
+ if tclver && ! tclver.empty?
+ versions = [tclver]
+ else
+ versions = %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6]
+ end
+ paths = base_dir.dup
+ versions.each{|ver| paths.concat(base_dir.map{|dir| dir + '/tcl' + ver})}
+ have_tcl_h = find_header('tcl.h', *paths)
+ end
+
+ unless have_tk_h = have_header("tk.h")
+ if tkver && ! tkver.empty?
+ versions = [tkver]
+ else
+ versions = %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
+ end
+ paths = base_dir.dup
+ versions.each{|ver| paths.concat(base_dir.map{|dir| dir + '/tk' + ver})}
+ have_tk_h = find_header('tk.h', *paths)
+ end
+
+ have_tcl_h && have_tk_h
+end
+
+def find_X11(*opt_paths)
+ default_paths =
+ [ "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib" ]
+ paths = opt_paths.compact.concat(default_paths)
+ st = find_library("X11", "XOpenDisplay", *paths)
+ unless st
+ puts("Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.")
+ end
+ st
+end
+
+def pthread_check()
+ tcl_major_ver = nil
+ tcl_minor_ver = nil
+
+ # Is tcl-thread given by user ?
+ case enable_config("tcl-thread")
+ when true
+ tcl_enable_thread = true
+ when false
+ tcl_enable_thread = false
+ else
+ tcl_enable_thread = nil
+ end
+
+ if (tclConfig = with_config("tclConfig-file"))
+ if tcl_enable_thread == true
+ puts("Warning: --with-tclConfig-file option is ignored, because --enable-tcl-thread option is given.")
+ elsif tcl_enable_thread == false
+ puts("Warning: --with-tclConfig-file option is ignored, because --disable-tcl-thread option is given.")
+ else
+ # tcl-thread is unknown and tclConfig.sh is given
+ begin
+ tbl = parse_tclConfig(tclConfig)
+ if tbl['TCL_THREADS']
+ tcl_enable_thread = (tbl['TCL_THREADS'] == "1")
+ else
+ tcl_major_ver = tbl['TCL_MAJOR_VERSION'].to_i
+ tcl_minor_ver = tbl['TCL_MINOR_VERSION'].to_i
+ if tcl_major_ver < 8 || (tcl_major_ver == 8 && tcl_minor_ver == 0)
+ tcl_enable_thread = false
+ end
+ end
+
+ if tcl_enable_thread == nil
+ # cannot find definition
+ if tcl_major_ver
+ puts("Warning: '#{tclConfig}' doesn't include TCL_THREADS definition.")
+ else
+ puts("Warning: '#{tclConfig}' may not be a tclConfig file.")
+ end
+ tclConfig = false
+ end
+ rescue Exception
+ puts("Warning: fail to read '#{tclConfig}'!! --> ignore the file")
+ tclConfig = false
+ end
+ end
+ end
+
+ if tcl_enable_thread == nil && !tclConfig
+ # tcl-thread is unknown and tclConfig is unavailable
+ begin
+ try_run_available = try_run("int main() { exit(0); }")
+ rescue Exception
+ # cannot try_run. Is CROSS-COMPILE environment?
+ puts(%Q'\
+*****************************************************************************
+**
+** PTHREAD SUPPORT CHECK WARNING:
+**
+** We cannot check the consistency of pthread support between Ruby
+** and the Tcl/Tk library in your environment (are you perhaps
+** cross-compiling?). If pthread support for these 2 packages is
+** inconsistent you may find you get errors when running Ruby/Tk
+** (e.g. hangs or segmentation faults). We strongly recommend
+** you to check the consistency manually.
+**
+*****************************************************************************
+')
+ return true
+ end
+ end
+
+ if tcl_enable_thread == nil
+ # tcl-thread is unknown
+ if try_run(<<EOF)
+#include <tcl.h>
+int main() {
+ Tcl_Interp *ip;
+ ip = Tcl_CreateInterp();
+ exit((Tcl_Eval(ip, "set tcl_platform(threaded)") == TCL_OK)? 0: 1);
+}
+EOF
+ tcl_enable_thread = true
+ elsif try_run(<<EOF)
+#include <tcl.h>
+static Tcl_ThreadDataKey dataKey;
+int main() { exit((Tcl_GetThreadData(&dataKey, 1) == dataKey)? 1: 0); }
+EOF
+ tcl_enable_thread = true
+ else
+ tcl_enable_thread = false
+ end
+ end
+
+ # check pthread mode
+ if (macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"'))
+ # ruby -> enable
+ unless tcl_enable_thread
+ # ruby -> enable && tcl -> disable
+ puts(%Q'\
+*****************************************************************************
+**
+** PTHREAD SUPPORT MODE WARNING:
+**
+** Ruby is compiled with --enable-pthread, but your Tcl/Tk library
+** seems to be compiled without pthread support. Although you can
+** create the tcltklib library, this combination may cause errors
+** (e.g. hangs or segmentation faults). If you have no reason to
+** keep the current pthread support status, we recommend you reconfigure
+** and recompile the libraries so that both or neither support pthreads.
+**
+** If you want change the status of pthread support, please recompile
+** Ruby without "--enable-pthread" configure option or recompile Tcl/Tk
+** with "--enable-threads" configure option (if your Tcl/Tk is later
+** than or equal to Tcl/Tk 8.1).
+**
+*****************************************************************************
+')
+ end
+
+ # ruby -> enable && tcl -> enable/disable
+ if tcl_enable_thread
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
+ else
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
+ end
+
+ return true
+
+ else
+ # ruby -> disable
+ if tcl_enable_thread
+ # ruby -> disable && tcl -> enable
+ puts(%Q'\
+*****************************************************************************
+**
+** PTHREAD SUPPORT MODE ERROR:
+**
+** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
+** library seems to be compiled with pthread support. This
+** combination may cause frequent hang or segmentation fault
+** errors when Ruby/Tk is working. We recommend that you NEVER
+** create the library with such a combination of pthread support.
+**
+** Please recompile Ruby with the "--enable-pthread" configure option
+** or recompile Tcl/Tk with the "--disable-threads" configure option.
+**
+*****************************************************************************
+')
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
+ return false
+ else
+ # ruby -> disable && tcl -> disable
+ $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
+ return true
+ end
+ end
+end
+
+tclver, tkver = check_tcltk_version(tcltk_version)
+
+if ( tcltk_framework ||
+ ( find_tcltk_header(tclver, tkver) &&
+ ( !use_X || find_X11(x11_ldir2, x11_ldir) ) &&
+ find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) &&
+ find_tk(tklib, stubs, tkver, *tk_ldir_list) ) )
+ $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
+ $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
+
+ if tcltk_framework
+ if tcl_framework_header
+ $CPPFLAGS += " -I#{tcl_framework_header}"
+ else
+ $CPPFLAGS += " -I#{tcltk_framework}/Tcl.framework/Headers"
+ end
+
+ if tk_framework_header
+ $CPPFLAGS += " -I#{tk_framework_header}"
+ else
+ $CPPFLAGS += " -I#{tcltk_framework}/Tk.framework/Headers"
+ end
+
+ $LDFLAGS += ' -framework Tk -framework Tcl'
+ end
+
+ if stubs or pthread_check
+ # create Makefile
+
+ # for SUPPORT_STATUS
+ $INSTALLFILES ||= []
+ $INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
+
+ have_func("rb_hash_lookup", "ruby.h")
+
+ # create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
+ create_makefile("tcltklib")
+ end
+end
diff --git a/ext/tk/sample/24hr_clock.rb b/ext/tk/sample/24hr_clock.rb
new file mode 100644
index 0000000000..29f84e0b40
--- /dev/null
+++ b/ext/tk/sample/24hr_clock.rb
@@ -0,0 +1,286 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+
+class Clock
+ def initialize(clock24 = true)
+ @clock = (clock24)? 24: 12
+
+ @size = 200
+ @cdot_size = 5
+
+ @cdot_color = 'black'
+ @hour_hand_color = 'black'
+ @minute_hand_color = 'gray25'
+ @second_hand_color = 'gray50'
+
+ @mark_font = 'Helvetica -14'
+ @mark_width = 3
+ @mark_color = 'black'
+ @submark_color = 'gray50'
+
+ @c = TkCanvas.new(:width=>2*@size, :height=>2*@size,
+ :scrollregion=>[-@size, -@size, @size, @size]
+ ).pack(:fill=>:both, :expand=>true)
+
+ @tag = TkcTag.new(@c)
+ @hand_tag = TkcTag.new(@c)
+
+ @circle_coords = [[-0.9*@size, -0.9*@size], [0.9*@size, 0.9*@size]]
+ @oval = TkcOval.new(@c, @circle_coords, :fill=>'white', :tags=>[@tag])
+
+ f = TkFrame.new.pack
+ TkLabel.new(f, :text=>'CURRENT:').pack(:side=>:left)
+ @now = TkLabel.new(f, :text=>'00:00:00').pack(:side=>:left, :padx=>2)
+ TkLabel.new(f, :text=>' ').pack(:side=>:left)
+ TkLabel.new(f, :text=>' ').pack(:side=>:right)
+ @l = TkLabel.new(f, :text=>'00:00').pack(:side=>:right, :padx=>2)
+ TkLabel.new(f, :text=>'MOUSE-POINTER:').pack(:side=>:right)
+
+ cmd = proc{|x, y|
+ @l.text = '%02d:%02d' % coords_to_time(@c.canvasx(x), @c.canvasy(y))
+ }
+ @c.bind('Motion', cmd, '%x %y')
+ @tag.bind('Motion', cmd, '%x %y')
+
+ _create_hands
+ _create_marks
+
+ timer_proc = proc{
+ t = Time.now
+ @now.text = '%02d:%02d:%02d' % [t.hour, t.min, t.sec]
+ set_hands(t.hour, t.min, t.sec)
+ }
+
+ timer_proc.call
+ @timer = TkRTTimer.start(100, -1, timer_proc)
+ end
+
+ def _create_marks
+ @mark_tag = TkcTag.new(@c)
+
+ TkcLine.new(@c, 0, -0.90*@size, 0, -0.85*@size,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, 0.90*@size, 0, 0.85*@size, 0,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, 0, 0.90*@size, 0, 0.85*@size,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, -0.90*@size, 0, -0.85*@size, 0,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+
+ TkcText.new(@c, [0, -0.92*@size], :text=>0,
+ :anchor=>'s', :fill=>@mark_color)
+ TkcText.new(@c, [0.92*@size, 0], :text=>@clock.div(4),
+ :anchor=>'w', :fill=>@mark_color)
+ TkcText.new(@c, [0, 0.92*@size], :text=>@clock.div(2),
+ :anchor=>'n', :fill=>@mark_color)
+ TkcText.new(@c, [-0.92*@size, 0], :text=>@clock.div(4)*3,
+ :anchor=>'e', :fill=>@mark_color)
+
+ [30.0, 60.0].each{|angle|
+ rad = Math::PI * angle / 180.0
+ x_base = @size*Math::sin(rad)
+ y_base = @size*Math::cos(rad)
+
+ x1 = 0.90*x_base
+ y1 = 0.90*y_base
+
+ x2 = 0.85*x_base
+ y2 = 0.85*y_base
+
+ TkcLine.new(@c, x1, y1, x2, y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, x1, -y1, x2, -y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, -x1, y1, -x2, y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+ TkcLine.new(@c, -x1, -y1, -x2, -y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@mark_color)
+
+ x3 = 0.92*x_base
+ y3 = 0.92*y_base
+
+ if @clock == 24
+ dh = angle.to_i/15
+ else # @clock == 12
+ dh = angle.to_i/30
+ end
+
+ TkcText.new(@c, x3, -y3, :text=>dh,
+ :anchor=>'sw', :fill=>@mark_color)
+ TkcText.new(@c, x3, y3, :text=>@clock.div(2)-dh,
+ :anchor=>'nw', :fill=>@mark_color)
+ TkcText.new(@c, -x3, y3, :text=>@clock.div(2)+dh,
+ :anchor=>'ne', :fill=>@mark_color)
+ TkcText.new(@c, -x3, -y3, :text=>@clock-dh,
+ :anchor=>'se', :fill=>@mark_color)
+ }
+
+ if @clock == 24
+ [15.0, 45.0, 75.0].each{|angle|
+ rad = Math::PI * angle / 180.0
+ x_base = @size*Math::sin(rad)
+ y_base = @size*Math::cos(rad)
+
+ x1 = 0.90*x_base
+ y1 = 0.90*y_base
+
+ x2 = 0.875*x_base
+ y2 = 0.875*y_base
+
+ TkcLine.new(@c, x1, y1, x2, y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@submark_color)
+ TkcLine.new(@c, x1, -y1, x2, -y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@submark_color)
+ TkcLine.new(@c, -x1, y1, -x2, y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@submark_color)
+ TkcLine.new(@c, -x1, -y1, -x2, -y2,
+ :tags=>[@tag, @mark_tag],
+ :width=>@mark_width, :fill=>@submark_color)
+ }
+ end
+ end
+
+ def _create_hands
+ hour_hand_len = 0.55*@size
+ minute_hand_len = 0.85*@size
+ second_hand_len = 0.88*@size
+
+ hour_hand_width = 1.8*@cdot_size
+ minute_hand_width = 1.0*@cdot_size
+ second_hand_width = 1 # 0.4*@cdot_size
+
+ @hour_hand_coords = [
+ [0, -0.5*@cdot_size],
+ [hour_hand_width, -0.5*@cdot_size-hour_hand_width],
+ [hour_hand_width, -hour_hand_len+hour_hand_width],
+ [0, -hour_hand_len],
+ [-hour_hand_width, -hour_hand_len+hour_hand_width],
+ [-hour_hand_width, -0.5*@cdot_size-hour_hand_width],
+ ]
+ @minute_hand_coords = [
+ [0, -0.5*@cdot_size],
+ [minute_hand_width, -0.5*@cdot_size - minute_hand_width],
+ [minute_hand_width, -minute_hand_len+minute_hand_width],
+ [0, -minute_hand_len],
+ [-minute_hand_width, -minute_hand_len+minute_hand_width],
+ [-minute_hand_width, -0.5*@cdot_size-minute_hand_width],
+ ]
+ @second_hand_coords = [
+ [0, -0.5*@cdot_size],
+ [second_hand_width, -0.5*@cdot_size - second_hand_width],
+ [second_hand_width, -second_hand_len+second_hand_width],
+ [0, -second_hand_len],
+ [-second_hand_width, -second_hand_len+second_hand_width],
+ [-second_hand_width, -0.5*@cdot_size-second_hand_width],
+ ]
+
+ @hour_hand = TkcPolygon.new(@c, @hour_hand_coords,
+ :tags=>[@tag, @hand_tag],
+ :outline=>@hour_hand_color,
+ :fill=>@hour_hand_color)
+
+ @minute_hand = TkcPolygon.new(@c, @minute_hand_coords,
+ :tags=>[@tag, @hand_tag],
+ :outline=>@minute_hand_color,
+ :fill=>@minute_hand_color)
+
+ @second_hand = TkcPolygon.new(@c, @second_hand_coords,
+ :tags=>[@tag, @hand_tag],
+ :outline=>@second_hand_color,
+ :fill=>@second_hand_color)
+
+ @center_dot = TkcOval.new(@c,
+ [-@cdot_size, -@cdot_size],
+ [@cdot_size, @cdot_size],
+ :outline=>@cdot_color, :fill=>@cdot_color)
+ end
+ private :_create_hands
+
+ def _raise_hands
+ @hour_hand.raise
+ @minute_hand.raise
+ @second_hand.raise
+ @center_dot.raise
+ end
+ private :_raise_hands
+
+ def _raise_marks
+ @mark_tag.raise
+ end
+ private :_raise_marks
+
+ def set_hands(hh, mm, ss)
+ ss_angle = Math::PI * ss / 30.0
+ mm_angle = Math::PI * (mm + ss/60.0) / 30.0
+ hh_angle = Math::PI * (hh + (mm + ss/60.0)/60.0) / (@clock.div(2))
+
+ @second_hand.coords = @second_hand_coords.collect{|x, y|
+ r = Math::hypot(y, x)
+ a = Math::atan2(y, x) + ss_angle
+ [Math::cos(a) * r, Math::sin(a) * r]
+ }
+
+ @minute_hand.coords = @minute_hand_coords.collect{|x, y|
+ r = Math::hypot(y, x)
+ a = Math::atan2(y, x) + mm_angle
+ [Math::cos(a) * r, Math::sin(a) * r]
+ }
+
+ @hour_hand.coords = @hour_hand_coords.collect{|x, y|
+ r = Math::hypot(y, x)
+ a = Math::atan2(y, x) + hh_angle
+ [Math::cos(a) * r, Math::sin(a) * r]
+ }
+
+ _raise_hands
+ _raise_marks
+ end
+
+ def coords_to_time(x, y)
+ return ((y < 0)? [0, 0]: [@clock.div(2), 0]) if x == 0
+ if @clock == 24
+ offset = (x<0&&y<0)? 1800.0: 360.0
+ m_half = 720.0
+ else # @clock == 12
+ offset = (x<0&&y<0)? 900.0: 180.0
+ m_half = 360.0
+ end
+ (offset + m_half*Math.atan2(y,x)/Math::PI).round.divmod(60)
+ end
+
+ def create_pie(hh, mm, span, color='red')
+ if @clock == 24
+ start = 90.0 - (hh*60 + mm)/4.0 # 360.0*(hh*60+mm)/(24*60)
+ extent = -span/4.0
+ else # @clock == 12
+ start = 90.0 - (hh*60 + mm)/2.0 # 360.0*(hh*60+mm)/(12*60)
+ extent = -span/2.0
+ end
+
+ pie = TkcArc.new(@c, @circle_coords, :tags=>[@tag],
+ :outline=>'black', 'fill'=>color,
+ :start=>start, :extent=>extent)
+ _raise_hands
+ _raise_marks
+ pie
+ end
+end
+
+sched = Clock.new
+sched.create_pie(0,0, 60) # 60 minutes from 00:00
+sched.create_pie(6,30, 280, 'green') # 280 minutes from 06:30
+sched.create_pie(15,20, 90, 'blue') # 90 minutes from 15:20
+
+Tk.mainloop
diff --git a/ext/tk/sample/binding_sample.rb b/ext/tk/sample/binding_sample.rb
new file mode 100644
index 0000000000..3c2eb5e1cb
--- /dev/null
+++ b/ext/tk/sample/binding_sample.rb
@@ -0,0 +1,87 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+
+class Button_clone < TkLabel
+ def initialize(*args)
+ @command = nil
+
+ if args[-1].kind_of?(Hash)
+ keys = _symbolkey2str(args.pop)
+ @command = keys.delete('command')
+
+ keys['highlightthickness'] = 1 unless keys.key?('highlightthickness')
+ keys['padx'] = '3m' unless keys.key?('padx')
+ keys['pady'] = '1m' unless keys.key?('pady')
+ keys['relief'] = 'raised' unless keys.key?('relief')
+
+ args.push(keys)
+ end
+
+ super(*args)
+
+ @press = false
+
+ self.bind('Enter', proc{self.background(self.activebackground)})
+ self.bind('Leave', proc{
+ @press = false
+ self.background(self.highlightbackground)
+ self.relief('raised')
+ })
+
+ self.bind('ButtonPress-1', proc{@press = true; self.relief('sunken')})
+ self.bind('ButtonRelease-1', proc{
+ self.relief('raised')
+ @command.call if @press && @command
+ @press = false
+ })
+ end
+
+ def command(cmd = Proc.new)
+ @command = cmd
+ end
+
+ def invoke
+ if @command
+ @command.call
+ else
+ ''
+ end
+ end
+end
+
+TkLabel.new(:text=><<EOT).pack
+This is a sample of 'event binding'.
+The first button is a normal button widget.
+And the second one is a normal label widget
+but with some bindings like a button widget.
+EOT
+
+lbl = TkLabel.new(:foreground=>'red').pack(:pady=>3)
+
+v = TkVariable.new(0)
+
+TkFrame.new{|f|
+ TkLabel.new(f, :text=>'click count : ').pack(:side=>:left)
+ TkLabel.new(f, :textvariable=>v).pack(:side=>:left)
+}.pack
+
+TkButton.new(:text=>'normal Button widget',
+ :command=>proc{
+ puts 'button is clicked!!'
+ lbl.text 'button is clicked!!'
+ v.numeric += 1
+ }){
+ pack(:fill=>:x, :expand=>true)
+}
+
+Button_clone.new(:text=>'Label with Button binding',
+ :command=>proc{
+ puts 'label is clicked!!'
+ lbl.text 'label is clicked!!'
+ v.numeric += 1
+ }){
+ pack(:fill=>:x, :expand=>true)
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/bindtag_sample.rb b/ext/tk/sample/bindtag_sample.rb
new file mode 100644
index 0000000000..b13364bb68
--- /dev/null
+++ b/ext/tk/sample/bindtag_sample.rb
@@ -0,0 +1,127 @@
+#!/usr/bin/env ruby
+require 'tk'
+
+TkLabel.new(:text=><<EOT, :justify=>:left).pack
+This is a sample of bindtags and usage of
+Tk.callback_break/Tk.callback_continue.
+Please check the work of following buttons
+(attend the difference between before/after
+ pressing the bottom button), and see the
+source code.
+EOT
+
+def set_class_bind
+ TkButton.bind('ButtonPress-1',
+ proc{puts 'bind "ButtonPress-1" of TkButton class'})
+ TkButton.bind('ButtonRelease-1',
+ proc{puts 'bind "ButtonRelease-1" of TkButton class'})
+end
+
+# set root binding
+r = TkRoot.new
+r.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of root widget'})
+r.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of root widget'})
+
+# set 'all' binding
+TkBindTag::ALL.bind('ButtonPress-1',
+ proc{puts 'bind "ButtonPress-1" of the tag "all"'})
+TkBindTag::ALL.bind('ButtonRelease-1',
+ proc{puts 'bind "ButtonRelease-1" of the tag "all"'})
+
+# create buttons
+b1 = TkButton.new(:text=>'button-1',
+ :command=>proc{puts "command of button-1"}).pack
+b2 = TkButton.new(:text=>'button-2',
+ :command=>proc{puts "command of button-2"}).pack
+b3 = TkButton.new(:text=>'button-3',
+ :command=>proc{puts "command of button-3"}).pack
+b4 = TkButton.new(:text=>'button-4',
+ :command=>proc{puts "command of button-4"}).pack
+b5 = TkButton.new(:text=>'button-5',
+ :command=>proc{puts "command of button-5"}).pack
+
+# set button binding
+b1.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of button-1'})
+b1.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of button-1'})
+
+b2.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of button-2'})
+b2.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of button-2'})
+
+b3.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of button-3'})
+b3.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of button-3'})
+
+b4.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of button-4'})
+b4.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of button-4'})
+
+b5.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of button-5'})
+b5.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of button-5'})
+
+# create bindtag and set binding
+tag1 = TkBindTag.new
+tag1.bind('ButtonPress-1', proc{puts 'bind "ButtonPress-1" of tag1'})
+tag1.bind('ButtonRelease-1', proc{puts 'bind "ButtonRelease-1" of tag1'})
+
+tag2 = TkBindTag.new
+tag2.bind('ButtonPress-1',
+ proc{
+ puts 'bind "ButtonPress-1" of tag2'
+ puts 'call Tk.callback_continue'
+ Tk.callback_continue
+ puts 'never see this message'
+ })
+tag2.bind('ButtonRelease-1',
+ proc{
+ puts 'bind "ButtonRelease-1" of tag2'
+ puts 'call Tk.callback_continue'
+ Tk.callback_continue
+ puts 'never see this message'
+ })
+
+tag3 = TkBindTag.new
+tag3.bind('ButtonPress-1',
+ proc{
+ puts 'bind "ButtonPress-1" of tag3'
+ puts 'call Tk.callback_break'
+ Tk.callback_break
+ puts 'never see this message'
+ })
+tag3.bind('ButtonRelease-1',
+ proc{
+ puts 'bind "ButtonRelease-1" of tag3'
+ puts 'call Tk.callback_break'
+ Tk.callback_break
+ puts 'never see this message'
+ })
+
+# set bindtags
+p b1.bindtags
+
+tags = b2.bindtags
+tags[2,0] = tag1
+tags[0,0] = tag1
+b2.bindtags(tags)
+p b2.bindtags
+
+tags = b3.bindtags
+tags[2,0] = tag2
+tags[0,0] = tag2
+b3.bindtags(tags)
+p b3.bindtags
+
+tags = b4.bindtags
+tags[2,0] = tag3
+tags[0,0] = tag3
+b4.bindtags(tags)
+p b4.bindtags
+
+b5.bindtags([tag1, TkButton, tag2, b5])
+
+# create button to set button class binding
+TkButton.new(:text=>'set binding to TkButton class',
+ :command=>proc{
+ puts 'call "set_class_bind"'
+ set_class_bind
+ }).pack(:pady=>7)
+
+# start event-loop
+Tk.mainloop
diff --git a/ext/tk/sample/binstr_usage.rb b/ext/tk/sample/binstr_usage.rb
new file mode 100644
index 0000000000..fa81f98b5e
--- /dev/null
+++ b/ext/tk/sample/binstr_usage.rb
@@ -0,0 +1,45 @@
+#!/usr/bin/env ruby
+
+require "tk"
+
+TkMessage.new(:width=>360, :text=><<EOM).pack
+This sample shows how to use a binary sequence between Ruby and Tk. \
+This reads the image data from the file as the binary sequence.
+
+To treat the difference of encodings between on Ruby and on Tk seamlessly, \
+Ruby/Tk converts the encoding of string arguments automatically. \
+I think it is comfortable for users on almost all situations. \
+However, when treats a binary sequence, the convert process makes troubles.
+
+Tk::BinaryString class (subclass of Tk::EncodedString class) is the class \
+to avoid such troubles. Please see the source code of this sample. \
+A Tk::BinaryString instance is used to create the image for the center button.
+EOM
+
+ImgFile=[File.dirname(__FILE__), 'images','tcllogo.gif'].join(File::Separator)
+
+ph1 = TkPhotoImage.new(:file=>ImgFile)
+p ph1.configinfo
+
+b_str = Tk::BinaryString(IO.read(ImgFile))
+p [b_str, b_str.encoding]
+
+ph2 = TkPhotoImage.new(:data=>b_str)
+p ph2.configinfo
+p ph2.data(:grayscale=>true)
+
+ph3 = TkPhotoImage.new(:palette=>256)
+ph3.put(ph2.data)
+
+ph4 = TkPhotoImage.new()
+ph4.put(ph2.data(:grayscale=>true))
+
+#p [b_str.encoding, b_str.rb_encoding]
+
+f = TkFrame.new.pack
+TkButton.new(:parent=>f, :image=>ph1, :command=>proc{exit}).pack(:side=>:left)
+TkButton.new(:parent=>f, :image=>ph2, :command=>proc{exit}).pack(:side=>:left)
+TkButton.new(:parent=>f, :image=>ph3, :command=>proc{exit}).pack(:side=>:left)
+TkButton.new(:parent=>f, :image=>ph4, :command=>proc{exit}).pack(:side=>:left)
+
+Tk.mainloop
diff --git a/ext/tk/sample/btn_with_frame.rb b/ext/tk/sample/btn_with_frame.rb
new file mode 100644
index 0000000000..d04c95a289
--- /dev/null
+++ b/ext/tk/sample/btn_with_frame.rb
@@ -0,0 +1,20 @@
+require 'tk'
+
+class Button_with_Frame < TkButton
+ def create_self(keys)
+ @frame = TkFrame.new('widgetname'=>@path, 'background'=>'yellow')
+ install_win(@path) # create new @path which is a daughter of old @path
+ super(keys)
+ TkPack(@path, :padx=>7, :pady=>7)
+ @epath = @frame.path
+ end
+ def epath
+ @epath
+ end
+end
+
+Button_with_Frame.new(:text=>'QUIT', :command=>proc{exit}) {
+ pack(:padx=>15, :pady=>5)
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/cd_timer.rb b/ext/tk/sample/cd_timer.rb
new file mode 100644
index 0000000000..e2611fbf23
--- /dev/null
+++ b/ext/tk/sample/cd_timer.rb
@@ -0,0 +1,81 @@
+#!/usr/bin/env ruby
+#
+# countdown timer
+# usage: cd_timer min [, min ... ]
+# ( e.g. cd_timer 0.5 1 3 5 10 )
+#
+require 'tk'
+
+if ARGV.empty?
+ $stderr.puts 'Error:: No time arguments for counting down'
+ exit(1)
+end
+
+width = 10
+
+TkButton.new(:text=>'exit',
+ :command=>proc{exit}).pack(:side=>:bottom, :fill=>:x)
+
+b = TkButton.new(:text=>'start').pack(:side=>:top, :fill=>:x)
+
+f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x)
+TkLabel.new(f, :relief=>:flat, :pady=>3,
+ :background=>'black', :foreground=>'white',
+ :text=>' elapsed: ').pack(:fill=>:x, :side=>:left, :expand=>true)
+now = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w,
+ :background=>'black', :foreground=>'white',
+ :text=>'%4d:%02d.00' % [0, 0]).pack(:side=>:right)
+
+timers = [ TkRTTimer.new(10){|tm|
+ t = (tm.return_value || 0) + 1
+ s, u = t.divmod(100)
+ m, s = s.divmod(60)
+ now.text('%4d:%02d.%02d' % [m, s, u])
+ t
+ }.set_start_proc(0, proc{
+ now.text('%4d:%02d.00' % [0,0])
+ now.foreground('white')
+ 0
+ })
+]
+
+ARGV.collect{|arg| (Float(arg) * 60).to_i}.sort.each_with_index{|time, idx|
+ f = TkFrame.new(:relief=>:ridge, :borderwidth=>2).pack(:fill=>:x)
+ TkLabel.new(f, :relief=>:flat, :pady=>3,
+ :text=>' %4d:%02d --> ' % (time.divmod(60))).pack(:side=>:left)
+ l = TkLabel.new(f, :width=>width, :relief=>:flat, :pady=>3, :anchor=>:w,
+ :text=>'%4d:%02d' % (time.divmod(60))).pack(:side=>:right)
+ timers << TkRTTimer.new(1000){|tm|
+ t = (tm.return_value || time) - 1
+ if t < 0
+ l.text('%4d:%02d' % ((-t).divmod(60)))
+ else
+ l.text('%4d:%02d' % (t.divmod(60)))
+ end
+ if t.zero?
+ l.foreground('red')
+ idx.times{Tk.bell}
+ end
+ t
+ }.set_start_proc(0, proc{
+ l.text('%4d:%02d' % (time.divmod(60)))
+ l.foreground('black')
+ time
+ })
+}
+
+mode = :start
+b.command(proc{
+ if mode == :start
+ timers.each{|timer| timer.restart}
+ b.text('reset')
+ mode = :reset
+ else
+ timers.each{|timer| timer.stop.reset}
+ b.text('start')
+ mode = :start
+ end
+ })
+
+Tk.mainloop
+
diff --git a/ext/tk/sample/cmd_res_test.rb b/ext/tk/sample/cmd_res_test.rb
new file mode 100644
index 0000000000..8df2e61af7
--- /dev/null
+++ b/ext/tk/sample/cmd_res_test.rb
@@ -0,0 +1,17 @@
+require 'tk'
+TkOptionDB.readfile(File.expand_path('cmd_resource',
+ File.dirname(__FILE__)))
+f = TkFrame.new(:class=>'BtnFrame').pack
+b = TkButton.new(:parent=>f, :widgetname=>'hello').pack
+cmd1 = TkOptionDB.new_proc_class(b, [:show_msg, :bye_msg], 3)
+cmd2 = TkOptionDB.new_proc_class(:ZZZ, [:show_msg, :bye_msg], 3, false, cmd1)
+cmd3 = TkOptionDB.new_proc_class(:ZZZ, [:show_msg, :bye_msg], 3, false, b)
+cmd4 = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3){
+ def self.__check_proc_string__(str)
+ "{|arg| print [arg, $SAFE].inspect, ': '; Proc.new#{str}.call(arg)}"
+ end
+}
+cmd1.show_msg('cmd1')
+cmd2.show_msg('cmd2')
+cmd3.show_msg('cmd3')
+cmd4.show_msg('cmd4')
diff --git a/ext/tk/sample/cmd_resource b/ext/tk/sample/cmd_resource
new file mode 100644
index 0000000000..9cc4915546
--- /dev/null
+++ b/ext/tk/sample/cmd_resource
@@ -0,0 +1,5 @@
+*BtnFrame.hello.text: HELLO
+*BtnFrame.hello.command: ruby {puts "Hello World!!"}
+*BTN_CMD.show_msg: {|arg| print "Hello, #{arg}!!\n"}
+*hello.show_msg: {|arg| print "Hello, Hello, #{arg}!!\n"}
+*hello.ZZZ.show_msg: {|arg| print "Hello, Hello, ZZZ:#{arg}!!\n"}
diff --git a/ext/tk/sample/demos-en/ChangeLog b/ext/tk/sample/demos-en/ChangeLog
new file mode 100644
index 0000000000..c3f66cf409
--- /dev/null
+++ b/ext/tk/sample/demos-en/ChangeLog
@@ -0,0 +1,64 @@
+2002-08-29 16:30 matt
+
+ * ChangeLog: ChangeLog is auto-generated *from* CVS log.
+
+2002-08-29 16:27 matt
+
+ * ChangeLog.prev: [no log message]
+
+2002-08-28 18:07 matt
+
+ * browse1, browse2, hello, ixset, rmt, rolodex, rolodex-j, square,
+ tcolor, timer, widget: Changed #! lines to the slightly more
+ portable '#!/usr/bin/env ruby'.
+
+2002-08-28 17:56 matt
+
+ * icon.rb, items.rb, label.rb, menu.rb, ruler.rb: Changed bitmap
+ file extensions from .bmp to .xbm.
+
+2002-08-28 17:55 matt
+
+ * images/: face.bmp, face.xbm, flagdown.bmp, flagdown.xbm,
+ flagup.bmp, flagup.xbm, gray25.bmp, gray25.xbm, letters.bmp,
+ letters.xbm, noletter.bmp, noletter.xbm, pattern.bmp, pattern.xbm:
+ Changed X bitmap file extensions from .bmp to the more intuitive
+ .xbm.
+
+2002-08-28 17:35 matt
+
+ * bitmap.rb, colors.rb, cscroll.rb, ctext.rb, hello, ixset,
+ menubu.rb, patch_1.1c1, rmt, style.rb, timer, ChangeLog, README,
+ README.tkencoding, arrow.rb, bind.rb, browse1, browse2, button.rb,
+ check.rb, clrpick.rb, dialog1.rb, dialog2.rb, entry1.rb, entry2.rb,
+ filebox.rb, floor.rb, form.rb, hscale.rb, icon.rb, image1.rb,
+ image2.rb, items.rb, label.rb, menu.rb, msgbox.rb, plot.rb,
+ puzzle.rb, radio.rb, rolodex, rolodex-j, ruler.rb, sayings.rb,
+ search.rb, square, states.rb, tcolor, text.rb, tkencoding.rb,
+ twind.rb, vscale.rb, widget, doc.org/README, doc.org/README.JP,
+ doc.org/README.tk80, doc.org/license.terms,
+ doc.org/license.terms.tk80, images/earth.gif, images/earthris.gif,
+ images/face.bmp, images/flagdown.bmp, images/flagup.bmp,
+ images/gray25.bmp, images/grey.25, images/grey.5,
+ images/letters.bmp, images/noletter.bmp, images/pattern.bmp,
+ images/tcllogo.gif, images/teapot.ppm: Initial revision
+
+2002-08-28 17:35 matt
+
+ * bitmap.rb, colors.rb, cscroll.rb, ctext.rb, hello, ixset,
+ menubu.rb, patch_1.1c1, rmt, style.rb, timer, ChangeLog, README,
+ README.tkencoding, arrow.rb, bind.rb, browse1, browse2, button.rb,
+ check.rb, clrpick.rb, dialog1.rb, dialog2.rb, entry1.rb, entry2.rb,
+ filebox.rb, floor.rb, form.rb, hscale.rb, icon.rb, image1.rb,
+ image2.rb, items.rb, label.rb, menu.rb, msgbox.rb, plot.rb,
+ puzzle.rb, radio.rb, rolodex, rolodex-j, ruler.rb, sayings.rb,
+ search.rb, square, states.rb, tcolor, text.rb, tkencoding.rb,
+ twind.rb, vscale.rb, widget, doc.org/README, doc.org/README.JP,
+ doc.org/README.tk80, doc.org/license.terms,
+ doc.org/license.terms.tk80, images/earth.gif, images/earthris.gif,
+ images/face.bmp, images/flagdown.bmp, images/flagup.bmp,
+ images/gray25.bmp, images/grey.25, images/grey.5,
+ images/letters.bmp, images/noletter.bmp, images/pattern.bmp,
+ images/tcllogo.gif, images/teapot.ppm: Taking over demo package
+ from Jonathan Conway.
+
diff --git a/ext/tk/sample/demos-en/ChangeLog.prev b/ext/tk/sample/demos-en/ChangeLog.prev
new file mode 100644
index 0000000000..ba808eca8b
--- /dev/null
+++ b/ext/tk/sample/demos-en/ChangeLog.prev
@@ -0,0 +1,9 @@
+2001-07-26 <rise@leannan.knavery.net>
+
+ * Moved files to directory ruby-tk81-demos-english in tarball.
+
+2001-07-26 <rise@knavery.net>
+
+ * Added test to widget and hello versus Tk::TCL_VERSION & Tk::JAPANIZED_TK (per Guy Decoux in [ruby-talk:18559]) before requiring tkencoding.rb.
+
+
diff --git a/ext/tk/sample/demos-en/README b/ext/tk/sample/demos-en/README
new file mode 100644
index 0000000000..033dca33c6
--- /dev/null
+++ b/ext/tk/sample/demos-en/README
@@ -0,0 +1,138 @@
+Current Maintainer:
+ Jonathan Conway
+ rise@knavery.net
+
+ Please direct all bug reports/requests/suggestions to the above
+ address.
+
+
+Notes:
+
+* The files hello and widget have been changed to test Tk::TCL_VERSION
+ and Tk::JAPANIZED_TK before requiring tkencoding.rb to prevent an
+ infinite loop. This test was taken from a message in
+ [ruby-talk:18559] by Guy Decoux.
+
+* The .bmp files in the images directory are X bitmaps (i.e. XBM to many
+ graphics packages), not Windows bitmaps (.bmp). You will not be
+ able to use images exported by a graphics program as Windows
+ bitmaps with this demo collection nor will you be able to edit the
+ included images without setting the file type correctly.
+
+-- Jonathan Conway, 2001-07-26
+
+
+#------------------------------------------------------------------------------
+# ==== Introduction. ====
+#
+# To create this version of the Ruby/Tk widget demo, I took the
+# ruby-tk81-demos and removed all the Kanji strings and comments. I
+# have tried to restore the original English strings and comments
+# using the Tcl/Tk8.2.2 version of the widget demo.
+#
+# When I tried running the Kanji version, all I got was a mostly blank
+# panel with a non-functional "File" button. I disovered that if all
+# non-ASCII characters were replaced with blanks, then I could get the
+# gutted stuff running.
+#
+# Since English Ruby/Tk documentation is lacking and I needed this
+# code to see how it worked and to use as the basis of my try-it
+# prototype (The Ruby Yielding Interactive Toolkit), plus the fact
+# that no help was forthcoming for making the Kanji version work (plus
+# the fact that I can't read Kanji anyway), I decided to embark on
+# this English restoration project.
+#
+# Thanks to everyone who worked on the original Ruby/Tk widget demo
+# (and the preceding Tcl/Tk version for that matter). The
+# comparatively simple task of changing text strings and comments has
+# made me appreciate the great amount of original work that went into
+# this.
+#
+# -- Conrad Schneiker, 2000-07-23.
+#------------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# ==== Known bugs. ====
+#
+# ^C-ing the demo gives Ruby interrupt and stack message; clean exit needed.
+# Font settings don't work correctly.
+# Dismissing the embedded windows demo (tkwind.rb) kills the widget demo.
+# Rerunning the canvas item demo from the code widow get errors.
+# The "press me" button in the canvas item demo doesn't time out.
+# The simple 2 d plot starts up extremely slow compared to the Tcl version.
+# The first item message on the icon menu on the menu and cascades demo doesn't work.
+#------------------------------------------------------------------------------
+
+
+###################### Original README ########################################
+
+ Ruby/Tk81 widget-demo 1999/08/13
+
+ 北陸先端大情報科学研究科
+ 立石 <ttate@jaist.ac.jp>
+
+Tcl/Tk8.1ではunicode(UTF8)が採用され、unicodeに変換された日本語であれば
+Widgetに表示させることが可能です。本アーカイブには以前に永井さんが中心と
+なられて作成されたRuby/Tkのサンプルに修正を加え、以下の環境においてで動作
+を確認したものです。
+
+* ruby-1.3.7,ruby-1.4.0
+* tcl8.1, tk8.1
+* linux-2.2
+
+Windows(Cygwin)において、サンプルを動かすにはrubyを-Keというオプションを付
+けて起動させると良いそうです。
+ 情報提供:渡辺さん
+ <eban@os.rim.or.jp>
+
+----------------------------------------------------------------------------
+ Ruby/Tk widget-demo
+ version 1.1 ( 1998/07/24 )
+ 永井@知能.九工大 (nagai@ai.kyutech.ac.jp)
+
+標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます)
+では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成
+していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk
+にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し,
+拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで
+きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成
+を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の
+ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも
+のです.
+
+本アーカイブに含まれるスクリプトを実行するためには,ruby-1.1c2 以上であるこ
+とが必要です.1.1c1 の場合は,本アーカイブに含まれる patck_1.1c1 を Ruby の
+ライブラリにあててください.組み込む Tk のバージョンは,4.2 でも 8.0 でも修
+正なく動かせるはずです.ただし,日本語版での移植となっているため,日本語化さ
+れた Tk をご利用ください.スクリプトのテストは,Tk4.2jp と Tk8.0jp の上で行
+いました (完璧にではないですが).
+
+本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近
+いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに
+は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述
+を取っている理由は,Ruby/Tk のドキュメント不足にあります.
+
+Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成
+する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思
+います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある
+でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして
+おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます.
+一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ
+プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk
+を最初に習得するまでの踏台として利用していただければ幸いです.
+
+widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ
+きました.ここに感謝の意を表します.
+
+ 立石@JAIST (ttate@jaist.ac.jp) さん
+ 平松祥史 (hiramatu@cdrom.co.jp) さん
+
+平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/)
+も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください.
+
+また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し
+て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし
+ていただいた方々にも感謝致します.
+
+そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp)
+さんに捧げたいと思います.
diff --git a/ext/tk/sample/demos-en/README.1st b/ext/tk/sample/demos-en/README.1st
new file mode 100644
index 0000000000..2ba1e275c8
--- /dev/null
+++ b/ext/tk/sample/demos-en/README.1st
@@ -0,0 +1,18 @@
+There are Ruby/Tk demo scripts.
+
+Files with '.rb' extension are sub-scripts which are launched 'widget'
+script. Those files don't work independently. Please call them from
+'widget' script.
+
+If you want start some sub-scripts at same time when the launcher
+script tarts, please give the sub-script names as arguments.
+(e.g. /usr/local/bin/ruby widget button.rb entry1.rb text.rb )
+You can ommit '.rb' of the sub-scripts
+(e.g. /usr/local/bin/ruby widget button entry1 text )
+
+If you don't need launcher's main window, give -n option.
+(e.g. /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb )
+
+Others (browse1, hello, and so on) are standalone scripts.
+
+ 2004/04/14 Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/demos-en/README.tkencoding b/ext/tk/sample/demos-en/README.tkencoding
new file mode 100644
index 0000000000..cca8734a28
--- /dev/null
+++ b/ext/tk/sample/demos-en/README.tkencoding
@@ -0,0 +1,29 @@
+This is a original document of 'tkencoding.rb'.
+The library 'tkencoding.rb' is obsolete.
+Functions of tkencoding.rb is already included into Ruby/Tk.
+
+-------------------------------------------------
+tkencoding.rbを用いた日本語の表示について
+
+Copyright (C) 1999/07, Takaaki Tateishi <ttate@jaist.ac.jp>
+
+
+1. tkencoding.rbとは?
+
+tkencoding.rbはTcl/Tk8.1を利用したRuby/Tkのためのライブラリ
+です。tkencoding.rbをrequireすることによってWedgetに表示さ
+れるテキストは全てunicode(UTF8)へ変換されます。
+
+
+2. 使い方
+
+tkencoding.rbをrequireしてTk.encodingで使用している文字コード
+を指定して下さい。例えば以下のような感じになります。
+
+----
+require 'tk'
+require 'tkencoding'
+
+Tk.encoding = "utf-8"
+# Tk.encoding = "shiftjis"
+---
diff --git a/ext/tk/sample/demos-en/anilabel.rb b/ext/tk/sample/demos-en/anilabel.rb
new file mode 100644
index 0000000000..ebd84accd2
--- /dev/null
+++ b/ext/tk/sample/demos-en/anilabel.rb
@@ -0,0 +1,174 @@
+#
+# animated label widget demo (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+if defined?($anilabel_demo) && $anilabel_demo
+ $anilabel_demo.destroy
+ $anilabel_demo = nil
+end
+
+# demo toplevel widget
+$anilabel_demo = TkToplevel.new {|w|
+ title("Animated Label Demonstration")
+ iconname("anilabel")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($anilabel_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "Four animated labels are displayed below; each of the labels on the left is animated by making the text message inside it appear to scroll, and the label on the right is animated by animating the image that it displays."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $anilabel_demo
+ $anilabel_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'anilabel'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# create frame for label demo
+f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts')
+f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image')
+Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both',
+ 'padx'=>10, 'pady'=>10)
+
+# animated label
+class AnimatedTextLabel < TkLabel
+ def initialize(*args)
+ super(*args)
+ @timer = TkTimer.new{ _animation_callback }
+ @timer.loop_exec = -1
+ # bind('Destroy'){ @timer.stop }
+ @btag = TkBindTag.new('Destroy'){ @timer.stop }
+ self.bindtags_unshift(@btag)
+ end
+
+ def _animation_callback()
+ txt = self.text
+ self.text = (txt[1..-1] << txt[0])
+ end
+ private :_animation_callback
+
+ def start(interval)
+ @timer.set_interval(interval)
+ @timer.start
+ end
+
+ def stop
+ @timer.stop
+ end
+end
+
+# animated image
+class AnimatedImageLabel < AnimatedTextLabel
+ def initialize(*args)
+ super(*args)
+ @destroy_image = false
+ @btag.bind_append('Destroy'){
+ if @destroy_image
+ begin
+ self.image.delete
+ rescue
+ end
+ end
+ }
+ end
+ attr_accessor :destroy_image
+
+ def _animation_callback()
+ img = self.image
+
+ fmt = img.format
+ if fmt.kind_of?(Array)
+ if fmt[1].kind_of?(Hash)
+ # fmt == ['GIF', {'index'=>idx}]
+ idx = fmt[1]['index']
+ else
+ # fmt == ['GIF', '-index', idx] :: Ruby1.8.2 returns this.
+ idx = fmt[2]
+ end
+ elsif fmt.kind_of?(String) && fmt =~ /GIF -index (\d+)/
+ idx = $1.to_i
+ else
+ idx = -1
+ end
+
+ begin
+ img.format("GIF -index #{idx + 1}")
+ rescue => e
+ img.format("GIF -index 0")
+ end
+ end
+ private :_animation_callback
+end
+
+# create labels
+l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
+ :font=>{:family=>'Courier', :size=>10})
+l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
+ :font=>{:family=>'Courier', :size=>10})
+l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
+ :font=>{:family=>'Courier', :size=>10}, :width=>18)
+Tk.pack(l1, l2, l3,
+ :side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10)
+
+limg = AnimatedImageLabel.new(f_right, :borderwidth=>0)
+limg.pack(:side=>:top, :expand=>true, :padx=>10, :pady=>10)
+
+# base64-encoded animated GIF file
+tclPowerdData = <<EOD
+ R0lGODlhKgBAAPQAAP//////zP//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz//8zM
+ zMyZmcyZZsxmZsxmAMwzAJnMzJmZzJmZmZlmmZlmZplmM5kzM2aZzGZmzGZm
+ mWZmZmYzZmYzMzNmzDMzZgAzmSH+IE1hZGUgd2l0aCBHSU1QIGJ5IExARGVt
+ YWlsbHkuY29tACH5BAVkAAEALAAAAAAqAEAAAAX+YCCOZEkyTKM2jOm66yPP
+ dF03bx7YcuHIDkGBR7SZeIyhTID4FZ+4Es8nQyCe2EeUNJ0peY2s9mi7PhAM
+ ngEAMGRbUpvzSxskLh1J+Hkg134OdDIDEB+GHxtYMEQMTjMGEYeGFoomezaC
+ DZGSHFmLXTQKkh8eNQVpZ2afmDQGHaOYSoEyhhcklzVmMpuHnaZmDqiGJbg0
+ qFqvh6UNAwB7VA+OwydEjgujkgrPNhbTI8dFvNgEYcHcHx0lB1kX2IYeA2G6
+ NN0YfkXJ2BsAMuAzHB9cZMk3qoEbRzUACsRCUBK5JxsC3iMiKd8GN088SIyT
+ 0RAFSROyeEg38caDiB/+JEgqxsODrZJ1BkT0oHKSmI0ceQxo94HDpg0qsuDk
+ UmRAMgu8OgwQ+uIJgUMVeGXA+IQkzEeHGvD8cIGlDXsLiRjQ+EHroQhea7xY
+ 8IQBSgYYDi1IS+OFBCgaDMGVS3fGi5BPJpBaENdQ0EomKGD56IHw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)
+l2.text('* Fast Animation *').start(80)
+l3.text('This is a longer scrolling text in a widget that will not show the whole message at once. ').start(150)
+
+limg.destroy_image = true
+limg.image(TkPhotoImage.new(:format=>'GIF', :data=>tclPowerdData)).start(100)
diff --git a/ext/tk/sample/demos-en/aniwave.rb b/ext/tk/sample/demos-en/aniwave.rb
new file mode 100644
index 0000000000..57d58193f6
--- /dev/null
+++ b/ext/tk/sample/demos-en/aniwave.rb
@@ -0,0 +1,118 @@
+#
+# animated wave demo (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+# destroy toplevel widget for this demo script
+if defined?($aniwave_demo) && $aniwave_demo
+ $aniwave_demo.destroy
+ $aniwave_demo = nil
+end
+
+# create toplevel widget
+$aniwave_demo = TkToplevel.new {|w|
+ title("Animated Wave Demonstration")
+ iconname("aniwave")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($aniwave_demo).pack(:fill=>:both, :expand=>true)
+
+# create label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text 'This demonstration contains a canvas widget with a line item inside it. The animation routines work by adjusting the coordinates list of the line.'
+}
+msg.pack('side'=>'top')
+
+# create frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $aniwave_demo
+ $aniwave_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'aniwave'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# animated wave
+class AnimatedWaveDemo
+ def initialize(frame, dir=:left)
+ @direction = dir
+
+ # create canvas widget
+ @c = TkCanvas.new(frame, :width=>300, :height=>200,
+ :background=>'black')
+ @c.pack(:padx=>10, :pady=>10, :expand=>true)
+
+ # Creates a coordinates list of a wave.
+ @waveCoords = []
+ @backupCoords = []
+ n = 0
+ (-10..300).step(5){|n| @waveCoords << [n, 100]; @backupCoords << [n, 100] }
+ n = 305
+ @waveCoords << [n, 0]; @backupCoords << [n, 0]
+ @waveCoords << [n+5, 200]; @backupCoords << [n+5, 200]
+ @coordsLen = @waveCoords.length
+
+ # Create a smoothed line and arrange for its coordinates to be the
+ # contents of the variable waveCoords.
+ @line = TkcLine.new(@c, @waveCoords,
+ :width=>1, :fill=>'green', :smooth=>true)
+
+ # Main animation "loop".
+ # Theoretically 100 frames-per-second (==10ms between frames)
+ @timer = TkTimer.new(10){ basicMotion; reverser }
+
+ # Arrange for the animation loop to stop when the canvas is deleted
+ @c.bindtags_unshift(TkBindTag.new('Destroy'){ @timer.stop })
+ end
+
+ # Basic motion handler. Given what direction the wave is travelling
+ # in, it advances the y coordinates in the coordinate-list one step in
+ # that direction.
+ def basicMotion
+ @backupCoords, @waveCoords = @waveCoords, @backupCoords
+ (0...@coordsLen).each{|idx|
+ if @direction == :left
+ @waveCoords[idx][1] = @backupCoords[(idx+1 == @coordsLen)? 0: idx+1][1]
+ else
+ @waveCoords[idx][1] = @backupCoords[(idx == 0)? -1: idx-1][1]
+ end
+ }
+ @line.coords(@waveCoords)
+ end
+
+ # Oscillation handler. This detects whether to reverse the direction
+ # of the wave by checking to see if the peak of the wave has moved off
+ # the screen (whose size we know already.)
+ def reverser
+ if @waveCoords[0][1] < 10
+ @direction = :right
+ elsif @waveCoords[-1][1] < 10
+ @direction = :left
+ end
+ end
+
+ # animation control
+ def move
+ @timer.start
+ end
+
+ def stop
+ @timer.stop
+ end
+end
+
+# Start the animation processing
+AnimatedWaveDemo.new(base_frame, :left).move
diff --git a/ext/tk/sample/demos-en/arrow.rb b/ext/tk/sample/demos-en/arrow.rb
new file mode 100644
index 0000000000..452153d010
--- /dev/null
+++ b/ext/tk/sample/demos-en/arrow.rb
@@ -0,0 +1,249 @@
+# arrow.rb
+#
+# This demonstration script creates a canvas widget that displays a
+# large line with an arrowhead whose shape can be edited interactively.
+#
+# arrowhead widget demo (called by 'widget')
+#
+
+# arrowSetup --
+# This method regenerates all the text and graphics in the canvas
+# window. It's called when the canvas is initially created, and also
+# whenever any of the parameters of the arrow head are changed
+# interactively.
+#
+# Arguments:
+# c - Name of the canvas widget.
+
+def arrowSetup(c)
+ v = $demo_arrowInfo
+
+ # Remember the current box, if there is one.
+ tags = c.gettags('current')
+ if tags != []
+ cur = tags.find{|t| t.kind_of?(String) && t =~ /^box[1-3]$/ }
+ else
+ cur = nil
+ end
+
+ # Create the arrow and outline.
+ c.delete('all')
+ TkcLine.new(c, v.x1, v.y, v.x2, v.y,
+ { 'width'=>10 * v.width,
+ 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c],
+ 'arrow'=>'last'
+ }.update(v.bigLineStyle) )
+ xtip = v.x2 - 10*v.b
+ deltaY = 10*v.c + 5*v.width
+ TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY,
+ v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y,
+ 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round')
+
+ # Create the boxes for reshaping the line and arrowhead.
+ TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5,
+ {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) )
+ TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5,
+ {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) )
+ TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5,
+ {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) )
+ c.itemconfigure cur, v.activeStyle if cur
+
+ # Create three arrows in actual size with the same parameters
+ TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2)
+ tmp = v.x2+100
+ TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+ TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+ TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+
+ # Create a bunch of other arrows and text items showing the
+ # current dimensions.
+ tmp = v.x2+10
+ TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w')
+ tmp = v.x1-10
+ TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e')
+ tmp = v.y+5*v.width+10*v.c+10
+ TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n')
+ tmp = tmp+25
+ TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n')
+
+ if $tk_version =~ /^4.*/
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
+ 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
+ TkcText.new(c, v.x1, 330,
+ 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",'anchor'=>'w',
+ 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
+ else
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
+ 'font'=>'Helvetica 18')
+ TkcText.new(c, v.x1, 330,
+ 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",
+ 'anchor'=>'w', 'font'=>'Helvetica 18')
+ end
+
+ v.count += 1
+end
+
+# toplevel widget
+if defined?($arrow_demo) && $arrow_demo
+ $arrow_demo.destroy
+ $arrow_demo = nil
+end
+
+# demo toplevel widget
+$arrow_demo = TkToplevel.new {|w|
+ title("Arrowhead Editor Demonstration")
+ iconname("arrow")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"This widget allows you to experiment with different widths and arrowhead shapes for lines in canvases. To change the line width or the shape of the arrowhead, drag any of the three boxes attached to the oversized arrow. The arrows on the right give examples at normal scale. The text at the bottom shows the configuration options as you'd enter them for a canvas line item."){
+ pack('side'=>'top')
+}
+
+# frame
+$arrow_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $arrow_demo
+ $arrow_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'arrow'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas
+$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350,
+ 'relief'=>'sunken', 'borderwidth'=>2)
+$arrow_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+#
+unless Struct.const_defined?("ArrowInfo")
+ $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc,
+ :x1, :x2, :y, :smallTips, :count,
+ :bigLineStyle, :boxStyle, :activeStyle).new
+end
+$demo_arrowInfo.a = 8
+$demo_arrowInfo.b = 10
+$demo_arrowInfo.c = 3
+$demo_arrowInfo.width = 2
+$demo_arrowInfo.motionProc = proc{}
+$demo_arrowInfo.x1 = 40
+$demo_arrowInfo.x2 = 350
+$demo_arrowInfo.y = 150
+$demo_arrowInfo.smallTips = [5, 5, 2]
+$demo_arrowInfo.count = 0
+if TkWinfo.depth($arrow_canvas) > 1
+ $demo_arrowInfo.bigLineStyle = {'fill'=>'SkyBlue1'}
+ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
+ $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
+else
+ $demo_arrowInfo.bigLineStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)}
+ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
+ $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1}
+end
+$arrowTag_box = TkcTag.new($arrow_canvas)
+arrowSetup $arrow_canvas
+$arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.activeStyle)})
+$arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)})
+$arrowTag_box.bind('B1-Enter', proc{})
+$arrowTag_box.bind('B1-Leave', proc{})
+$arrow_canvas.itembind('box1', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove1 $arrow_canvas, x, y}})
+$arrow_canvas.itembind('box2', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove2 $arrow_canvas, x, y}})
+$arrow_canvas.itembind('box3', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove3 $arrow_canvas, x, y}})
+$arrowTag_box.bind('B1-Motion',
+ proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y")
+$arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas})
+
+# arrowMove1 --
+# This method is called for each mouse motion event on box1 (the
+# one at the vertex of the arrow). It updates the controlling parameters
+# for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove1(c,x,y)
+ v = $demo_arrowInfo
+ newA = (v.x2+5-c.canvasx(x).round)/10
+ newA = 0 if newA < 0
+ newA = 25 if newA > 25
+ if newA != v.a
+ c.move('box1', 10*(v.a-newA), 0)
+ v.a = newA
+ end
+end
+
+# arrowMove2 --
+# This method is called for each mouse motion event on box2 (the
+# one at the trailing tip of the arrowhead). It updates the controlling
+# parameters for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove2(c,x,y)
+ v = $demo_arrowInfo
+ newB = (v.x2+5-c.canvasx(x).round)/10
+ newB = 0 if newB < 0
+ newB = 25 if newB > 25
+ newC = (v.y+5-c.canvasy(y).round-5*v.width)/10
+ newC = 0 if newC < 0
+ newC = 20 if newC > 20
+ if newB != v.b || newC != v.c
+ c.move('box2', 10*(v.b-newB), 10*(v.c-newC))
+ v.b = newB
+ v.c = newC
+ end
+end
+
+# arrowMove3 --
+# This method is called for each mouse motion event on box3 (the
+# one that controls the thickness of the line). It updates the
+# controlling parameters for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove3(c,x,y)
+ v = $demo_arrowInfo
+ newWidth = (v.y+2-c.canvasy(y).round)/5
+ newWidth = 0 if newWidth < 0
+ newWidth = 20 if newWidth > 20
+ if newWidth != v.width
+ c.move('box3', 0, 5*(v.width-newWidth))
+ v.width = newWidth
+ end
+end
+
diff --git a/ext/tk/sample/demos-en/bind.rb b/ext/tk/sample/demos-en/bind.rb
new file mode 100644
index 0000000000..c291e4730a
--- /dev/null
+++ b/ext/tk/sample/demos-en/bind.rb
@@ -0,0 +1,127 @@
+# bind.rb
+#
+# This demonstration script creates a text widget with bindings set
+# up for hypertext-like effects.
+#
+# text (tag bindings) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($bind_demo) && $bind_demo
+ $bind_demo.destroy
+ $bind_demo = nil
+end
+
+# demo toplevel widget
+$bind_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Tag Bindings")
+ iconname("bind")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($bind_demo).pack(:fill=>:both, :expand=>true)
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $bind_demo
+ $bind_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'bind'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# bind
+def tag_binding_for_bind_demo(tag, enter_style, leave_style)
+ tag.bind('Any-Enter', proc{tag.configure enter_style})
+ tag.bind('Any-Leave', proc{tag.configure leave_style})
+end
+
+# text
+txt = TkText.new(base_frame){|t|
+ #
+ setgrid 'true'
+ #width 60
+ #height 24
+ font $font
+ wrap 'word'
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ #
+ if TkWinfo.depth($root).to_i > 1
+ tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
+ 'borderwidth'=>1}
+ tagstyle_normal = {'background'=>'', 'relief'=>'flat'}
+ else
+ tagstyle_bold = {'foreground'=>'white', 'background'=>'black'}
+ tagstyle_normal = {'foreground'=>'', 'background'=>''}
+ end
+
+ # insert text
+ insert 'insert', "The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked. For example, in the text below the descriptions of the canvas demonstrations have been tagged. When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked.
+
+"
+ insert('end', '1. Samples of all the different types of items that can be created in canvas widgets.', (d1 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '2. A simple two-dimensional plot that allows you to adjust the positions of the data points.', (d2 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '3. Anchoring and justification modes for text items.',
+ (d3 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '4. An editor for arrow-head shapes for line items.',
+ (d4 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '5. A ruler with facilities for editing tab stops.',
+ (d5 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end',
+ '6. A grid that demonstrates how canvases can be scrolled.',
+ (d6 = TkTextTag.new(t)) )
+
+ # binding
+ [d1, d2, d3, d4, d5, d6].each{|tag|
+ tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal)
+ }
+ d1.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb')
+ })
+ d2.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb')
+ })
+ d3.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb')
+ })
+ d4.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb')
+ })
+ d5.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb')
+ })
+ d6.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb')
+ })
+
+ TkTextMarkInsert.new(t, '0.0')
+ configure('state','disabled')
+}
+
+txt.width 60
+txt.height 24
diff --git a/ext/tk/sample/demos-en/bitmap.rb b/ext/tk/sample/demos-en/bitmap.rb
new file mode 100644
index 0000000000..858d067d0d
--- /dev/null
+++ b/ext/tk/sample/demos-en/bitmap.rb
@@ -0,0 +1,75 @@
+# bitmap.rb
+#
+# This demonstration script creates a toplevel window that displays
+# all of Tk's built-in bitmaps.#
+# bitmap widget demo (called by 'widget')
+#
+
+# bitmapRow --
+# Create a row of bitmap items in a window.
+#
+# Arguments:
+# w - The parent window that is to contain the row.
+# args - The names of one or more bitmaps, which will be displayed
+# in a new row across the bottom of w along with their
+# names.
+
+def bitmapRow(w,*args)
+ TkFrame.new(w){|row|
+ pack('side'=>'top', 'fill'=>'both')
+ for bitmap in args
+ TkFrame.new(row){|base|
+ pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c')
+ TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom')
+ Tk::Label.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom')
+ }
+ end
+ }
+end
+
+# toplevel widget
+if defined?($bitmap_demo) && $bitmap_demo
+ $bitmap_demo.destroy
+ $bitmap_demo = nil
+end
+
+# demo toplevel widget
+$bitmap_demo = TkToplevel.new {|w|
+ title("Bitmap Demonstration")
+ iconname("bitmap")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."){
+ pack('side'=>'top')
+}
+
+# frame
+$bitmap_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $bitmap_demo
+ $bitmap_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'bitmap'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+TkFrame.new(base_frame){|f|
+ bitmapRow(f,'error','gray25','gray50','hourglass')
+ bitmapRow(f,'info','question','questhead','warning')
+ pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
+}
+
diff --git a/ext/tk/sample/demos-en/browse1 b/ext/tk/sample/demos-en/browse1
new file mode 100644
index 0000000000..568892e4a8
--- /dev/null
+++ b/ext/tk/sample/demos-en/browse1
@@ -0,0 +1,63 @@
+#!/usr/bin/env ruby
+
+# browse --
+# This script generates a directory browser, which lists the working
+# directory and allow you to open files or subdirectories by
+# double-clicking.
+
+require 'tk'
+
+# Create a scrollbar on the right side of the main window and a listbox
+# on the left side.
+
+listbox = TkListbox.new(nil, 'relief'=>'sunken',
+ 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l|
+ TkScrollbar.new(nil, 'command'=>proc{|*args| l.yview *args}) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ l.yscrollcommand(proc{|first,last| s.set(first,last)})
+ }
+
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+}
+
+root = TkRoot.new
+root.minsize(1,1)
+
+# The procedure below is invoked to open a browser on a given file; if the
+# file is a directory then another instance of this program is invoked; if
+# the file is a regular file then the Mx editor is invoked to display
+# the file.
+
+def browse (dir, file)
+ file = dir + File::Separator + file if dir != '.'
+ type = File.ftype(file)
+ if type == 'directory'
+ system($0 + ' ' + file + ' &')
+ else
+ if type == 'file'
+ if ENV['EDITOR']
+ system(ENV['EDITOR'] + ' ' + file + ' &')
+ else
+ system('xedit ' + file + ' &')
+ end
+ else
+ STDOUT.print "\"#{file}\" isn't a directory or regular file"
+ end
+ end
+end
+
+# Fill the listbox with a list of all the files in the directory (run
+# the "ls" command to get that information).
+
+dir = ARGV[0] ? ARGV[0] : '.'
+open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname|
+ listbox.insert('end', fname.chomp)
+}
+
+# Set up bindings for the browser.
+
+Tk.bind_all('Control-c', proc{root.destroy})
+listbox.bind('Double-Button-1',
+ proc{TkSelection.get.each{|f| browse dir, f}})
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/browse2 b/ext/tk/sample/demos-en/browse2
new file mode 100644
index 0000000000..1a511c8d29
--- /dev/null
+++ b/ext/tk/sample/demos-en/browse2
@@ -0,0 +1,82 @@
+#!/usr/bin/env ruby
+
+# browse --
+# This script generates a directory browser, which lists the working
+# directory and allow you to open files or subdirectories by
+# double-clicking.
+
+require 'tk'
+
+class Browse
+ BROWSE_WIN_COUNTER = TkVariable.new(0)
+
+ def initialize(dir)
+ BROWSE_WIN_COUNTER.value = BROWSE_WIN_COUNTER.to_i + 1
+
+ # create base frame
+ base = TkToplevel.new {
+ minsize(1,1)
+ title('Browse : ' + dir)
+ }
+
+ # Create a scrollbar on the right side of the main window and a listbox
+ # on the left side.
+ list = TkListbox.new(base, 'relief'=>'sunken',
+ 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l|
+ TkScrollbar.new(base, 'command'=>proc{|*args| l.yview *args}) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ l.yscrollcommand(proc{|first,last| s.set(first,last)})
+ }
+
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+
+ # Fill the listbox with a list of all the files in the directory (run
+ # the "ls" command to get that information).
+ open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname|
+ l.insert('end', fname.chomp)
+ }
+
+ }
+
+ # Set up bindings for the browser.
+ base.bind('Destroy', proc{
+ Browse::BROWSE_WIN_COUNTER.value = \
+ Browse::BROWSE_WIN_COUNTER.to_i - 1
+ })
+ base.bind('Control-c', proc{base.destroy})
+ list.bind('Double-Button-1',
+ proc{TkSelection.get.each{|f| self.browse dir, f}})
+ end
+
+ # The method below is invoked to open a browser on a given file; if the
+ # file is a directory then another instance of this program is invoked; if
+ # the file is a regular file then the Mx editor is invoked to display
+ # the file.
+ def browse (dir, file)
+ file = dir + File::Separator + file if dir != '.'
+ type = File.ftype(file)
+ if type == 'directory'
+ Browse.new(file)
+ else
+ if type == 'file'
+ if ENV['EDITOR']
+ system(ENV['EDITOR'] + ' ' + file + ' &')
+ else
+ system('xedit ' + file + ' &')
+ end
+ else
+ STDOUT.print "\"#{file}\" isn't a directory or regular file"
+ end
+ end
+ end
+
+end
+
+Browse.new(ARGV[0] ? ARGV[0] : '.')
+
+TkRoot.new {
+ withdraw
+ Browse::BROWSE_WIN_COUNTER.trace('w', proc{exit if Browse::BROWSE_WIN_COUNTER.to_i == 0})
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/button.rb b/ext/tk/sample/demos-en/button.rb
new file mode 100644
index 0000000000..f63a2f3b06
--- /dev/null
+++ b/ext/tk/sample/demos-en/button.rb
@@ -0,0 +1,84 @@
+# button.rb
+#
+# This demonstration script creates a toplevel window containing
+# several button widgets.
+#
+# button widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($button_demo) && $button_demo
+ $button_demo.destroy
+ $button_demo = nil
+end
+
+# demo toplevel widget
+$button_demo = TkToplevel.new {|w|
+ title("Button Demonstration")
+ iconname("button")
+ positionWindow(w)
+}
+
+# label
+msg = TkLabel.new($button_demo) {
+ font $kanji_font
+ wraplength '4i'
+ justify 'left'
+ text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button. You can press Tab to move among the buttons, then press Space to invoke the current button."
+}
+msg.pack('side'=>'top')
+
+# frame
+$button_buttons = Tk::Frame.new($button_demo) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $button_demo
+ $button_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'button'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# button
+TkButton.new($button_demo){
+ text "Peach Puff"
+ width 10
+ command proc{
+ $button_demo.configure('bg','PeachPuff1')
+ $button_buttons.configure('bg','PeachPuff1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Light Blue"
+ width 10
+ command proc{
+ $button_demo.configure('bg','LightBlue1')
+ $button_buttons.configure('bg','LightBlue1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Sea Green"
+ width 10
+ command proc{
+ $button_demo.configure('bg','SeaGreen2')
+ $button_buttons.configure('bg','SeaGreen2')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Yellow"
+ width 10
+ command proc{
+ $button_demo.configure('bg','Yellow1')
+ $button_buttons.configure('bg','Yellow1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
diff --git a/ext/tk/sample/demos-en/check.rb b/ext/tk/sample/demos-en/check.rb
new file mode 100644
index 0000000000..bf0b73476a
--- /dev/null
+++ b/ext/tk/sample/demos-en/check.rb
@@ -0,0 +1,72 @@
+# check.rb
+#
+# This demonstration script creates a toplevel window containing
+# several checkbuttons.
+#
+# checkbutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($check_demo) && $check_demo
+ $check_demo.destroy
+ $check_demo = nil
+end
+
+# demo toplevel widget
+$check_demo = TkToplevel.new {|w|
+ title("Checkbutton Demonstration")
+ iconname("check")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "Three checkbuttons are displayed below. If you click on a button, it will toggle the button's selection state and set a Tcl variable to a value indicating the state of the checkbutton. Click the \"See Variables\" button to see the current values of the variables."
+}
+msg.pack('side'=>'top')
+
+#
+wipers = TkVariable.new(0)
+brakes = TkVariable.new(0)
+sober = TkVariable.new(0)
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $check_demo
+ $check_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'check'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+
+ TkButton.new(frame) {
+ text 'See Variables'
+ command proc{
+ showVars(base_frame,
+ ['wipers', wipers], ['brakes', brakes], ['sober', sober])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+# checkbutton
+[ TkCheckButton.new(base_frame, 'text'=>'Wipers OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'Brakes OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'Driver Sober', 'variable'=>sober)
+].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')}
+
diff --git a/ext/tk/sample/demos-en/check2.rb b/ext/tk/sample/demos-en/check2.rb
new file mode 100644
index 0000000000..4f7b1f07bc
--- /dev/null
+++ b/ext/tk/sample/demos-en/check2.rb
@@ -0,0 +1,109 @@
+#
+# checkbutton widget demo2 (called by 'widget')
+#
+
+# delete old toplevel widget
+if defined?($check2_demo) && $check2_demo
+ $check2_demo.destroy
+ $check2_demo = nil
+end
+
+# create demo toplevel widget
+$check2_demo = TkToplevel.new {|w|
+ title("Checkbutton Demonstration 2")
+ iconname("check2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($check2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "Four checkbuttons are displayed below. If you click on a button, it will toggle the button's selection state and set a Tcl variable to a value indicating the state of the checkbutton. The first button also follows the state of the other three. If only some of the three are checked, the first button will display the tri-state mode. Click the \"See Variables\" button to see the current values of the variables."
+}
+msg.pack('side'=>'top')
+
+# variable
+safety = TkVariable.new(0)
+wipers = TkVariable.new(0)
+brakes = TkVariable.new(0)
+sober = TkVariable.new(0)
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars($check2_demo,
+ ['safety', safety], ['wipers', wipers],
+ ['brakes', brakes], ['sober', sober])
+ }),
+ TkButton.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'check2'}),
+ TkButton.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $check2_demo
+ $check2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+}.pack('side'=>'bottom', 'fill'=>'x')
+
+
+# checkbutton
+TkCheckButton.new(base_frame, :text=>'Safety Check', :variable=>safety,
+ :relief=>:flat, :onvalue=>'all', :offvalue=>'none',
+ :tristatevalue=>'partial'){
+ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
+[ TkCheckButton.new(base_frame, 'text'=>'Wipers OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'Brakes OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'Driver Sober', 'variable'=>sober)
+].each{|w|
+ w.relief('flat')
+ w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w')
+}
+
+# tristate check
+in_check = false
+tristate_check = proc{|n1,n2,op|
+ unless in_check
+ in_check = true
+ begin
+ if n1 == safety
+ if safety == 'none'
+ wipers.value = 0
+ brakes.value = 0
+ sober.value = 0
+ elsif safety == 'all'
+ wipers.value = 1
+ brakes.value = 1
+ sober.value = 1
+ end
+ else
+ if wipers == 1 && brakes == 1 && sober == 1
+ safety.value = 'all'
+ elsif wipers == 1 || brakes == 1 || sober == 1
+ safety.value = 'partial'
+ else
+ safety.value = 'none'
+ end
+ end
+ ensure
+ in_check = false
+ end
+ end
+}
+
+[wipers, brakes, sober, safety].each{|v| v.trace('w', tristate_check)}
diff --git a/ext/tk/sample/demos-en/clrpick.rb b/ext/tk/sample/demos-en/clrpick.rb
new file mode 100644
index 0000000000..6da28cb112
--- /dev/null
+++ b/ext/tk/sample/demos-en/clrpick.rb
@@ -0,0 +1,87 @@
+# clrpick.rb
+#
+# This demonstration script prompts the user to select a color.
+#
+# widget demo prompts the user to select a color (called by 'widget')
+#
+# Note: don't support ttk_wrapper. work with standard widgets only.
+#
+
+# toplevel widget
+if defined?($clrpick_demo) && $clrpick_demo
+ $clrpick_demo.destroy
+ $clrpick_demo = nil
+end
+
+# demo toplevel widget
+$clrpick_demo = TkToplevel.new {|w|
+ title("Color Selection Dialogs")
+ iconname("colors")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($clrpick_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+#TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+Tk::Label.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"Press the buttons below to choose the foreground and background colors for the widgets in this window.").pack('side'=>'top')
+
+# frame
+#TkFrame.new($clrpick_demo) {|frame|
+Tk::Frame.new($clrpick_demo) {|frame|
+ # TkButton.new(frame) {
+ Tk::Button.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $clrpick_demo
+ $clrpick_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ # TkButton.new(frame) {
+ Tk::Button.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'clrpick'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# button
+# TkButton.new($clrpick_demo, 'text'=>'Set background color ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'Set background color ...') {|b|
+ command(proc{setColor $clrpick_demo, b, 'background',
+ ['background', 'highlightbackground']})
+ pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
+}
+
+# TkButton.new($clrpick_demo, 'text'=>'Set foreground color ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'Set foreground color ...') {|b|
+ command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']})
+ pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
+}
+
+def setColor(w,button,name,options)
+ w.grab
+ initialColor = button[name]
+ color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
+ 'initialcolor'=>initialColor)
+ if color != ""
+ setColor_helper(w,options,color)
+ end
+
+ w.grab('release')
+end
+
+def setColor_helper(w, options, color)
+ options.each{|opt|
+ begin
+ w[opt] = color
+ rescue
+ end
+ }
+ TkWinfo.children(w).each{|child|
+ setColor_helper child, options, color
+ }
+end
+
diff --git a/ext/tk/sample/demos-en/colors.rb b/ext/tk/sample/demos-en/colors.rb
new file mode 100644
index 0000000000..b0ef9590b9
--- /dev/null
+++ b/ext/tk/sample/demos-en/colors.rb
@@ -0,0 +1,158 @@
+# colors.rb
+#
+# This demonstration script creates a listbox widget that displays
+# many of the colors from the X color database. You can click on
+# a color to change the application's palette.
+#
+# listbox widget demo 'colors' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($colors_demo) && $colors_demo
+ $colors_demo.destroy
+ $colors_demo = nil
+end
+
+# demo toplevel widget
+$colors_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (colors)")
+ iconname("colors")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($colors_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "A listbox containing several color names is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by dragging in the listbox window with button 2 pressed. If you double-click button 1 on a color, then the application's color palette will be set to match that color"
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $colors_demo
+ $colors_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'colors'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+colors_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ s = TkScrollbar.new(w)
+ colors_lbox = TkListbox.new(w) {
+ setgrid 1
+ width 10
+ height 12
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| colors_lbox.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ colors_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+#colors_lbox.bind('Double-1', proc{TkPalette.setPalette TkSelection.get})
+colors_lbox.bind('Double-1', proc{
+ begin
+ TkPalette.setPalette TkSelection.get
+ rescue => e
+ p e
+ Tk.tk_call_without_enc('destroy', '.___tk_set_palette')
+ end
+ })
+
+ins_data = [
+ 'gray60','gray70','gray80','gray85','gray90','gray95',
+ 'snow1','snow2','snow3','snow4','seashell1','seashell2',
+ 'seashell3','seashell4','AntiqueWhite1','AntiqueWhite2',
+ 'AntiqueWhite3','AntiqueWhite4','bisque1','bisque2',
+ 'bisque3','bisque4','PeachPuff1','PeachPuff2',
+ 'PeachPuff3','PeachPuff4','NavajoWhite1','NavajoWhite2',
+ 'NavajoWhite3','NavajoWhite4','LemonChiffon1',
+ 'LemonChiffon2','LemonChiffon3','LemonChiffon4',
+ 'cornsilk1','cornsilk2','cornsilk3','cornsilk4',
+ 'ivory1','ivory2','ivory3','ivory4','honeydew1',
+ 'honeydew2','honeydew3','honeydew4','LavenderBlush1',
+ 'LavenderBlush2','LavenderBlush3','LavenderBlush4',
+ 'MistyRose1','MistyRose2','MistyRose3','MistyRose4',
+ 'azure1','azure2','azure3','azure4','SlateBlue1',
+ 'SlateBlue2','SlateBlue3','SlateBlue4','RoyalBlue1',
+ 'RoyalBlue2','RoyalBlue3','RoyalBlue4','blue1','blue2',
+ 'blue3','blue4','DodgerBlue1','DodgerBlue2',
+ 'DodgerBlue3','DodgerBlue4','SteelBlue1','SteelBlue2',
+ 'SteelBlue3','SteelBlue4','DeepSkyBlue1','DeepSkyBlue2',
+ 'DeepSkyBlue3','DeepSkyBlue4','SkyBlue1','SkyBlue2',
+ 'SkyBlue3','SkyBlue4','LightSkyBlue1','LightSkyBlue2',
+ 'LightSkyBlue3','LightSkyBlue4','SlateGray1',
+ 'SlateGray2','SlateGray3','SlateGray4',
+ 'LightSteelBlue1','LightSteelBlue2','LightSteelBlue3',
+ 'LightSteelBlue4','LightBlue1','LightBlue2',
+ 'LightBlue3','LightBlue4','LightCyan1','LightCyan2',
+ 'LightCyan3','LightCyan4','PaleTurquoise1',
+ 'PaleTurquoise2','PaleTurquoise3','PaleTurquoise4',
+ 'CadetBlue1','CadetBlue2','CadetBlue3','CadetBlue4',
+ 'turquoise1','turquoise2','turquoise3','turquoise4',
+ 'cyan1','cyan2','cyan3','cyan4','DarkSlateGray1',
+ 'DarkSlateGray2','DarkSlateGray3','DarkSlateGray4',
+ 'aquamarine1','aquamarine2','aquamarine3','aquamarine4',
+ 'DarkSeaGreen1','DarkSeaGreen2','DarkSeaGreen3',
+ 'DarkSeaGreen4','SeaGreen1','SeaGreen2','SeaGreen3',
+ 'SeaGreen4','PaleGreen1','PaleGreen2','PaleGreen3',
+ 'PaleGreen4','SpringGreen1','SpringGreen2',
+ 'SpringGreen3','SpringGreen4','green1','green2',
+ 'green3','green4','chartreuse1','chartreuse2',
+ 'chartreuse3','chartreuse4','OliveDrab1','OliveDrab2',
+ 'OliveDrab3','OliveDrab4','DarkOliveGreen1',
+ 'DarkOliveGreen2','DarkOliveGreen3','DarkOliveGreen4',
+ 'khaki1','khaki2','khaki3','khaki4','LightGoldenrod1',
+ 'LightGoldenrod2','LightGoldenrod3','LightGoldenrod4',
+ 'LightYellow1','LightYellow2','LightYellow3',
+ 'LightYellow4','yellow1','yellow2','yellow3','yellow4',
+ 'gold1','gold2','gold3','gold4','goldenrod1',
+ 'goldenrod2','goldenrod3','goldenrod4','DarkGoldenrod1',
+ 'DarkGoldenrod2','DarkGoldenrod3','DarkGoldenrod4',
+ 'RosyBrown1','RosyBrown2','RosyBrown3','RosyBrown4',
+ 'IndianRed1','IndianRed2','IndianRed3','IndianRed4',
+ 'sienna1','sienna2','sienna3','sienna4','burlywood1',
+ 'burlywood2','burlywood3','burlywood4','wheat1',
+ 'wheat2','wheat3','wheat4','tan1','tan2','tan3','tan4',
+ 'chocolate1','chocolate2','chocolate3','chocolate4',
+ 'firebrick1','firebrick2','firebrick3','firebrick4',
+ 'brown1','brown2','brown3','brown4','salmon1','salmon2',
+ 'salmon3','salmon4','LightSalmon1','LightSalmon2',
+ 'LightSalmon3','LightSalmon4','orange1','orange2',
+ 'orange3','orange4','DarkOrange1','DarkOrange2',
+ 'DarkOrange3','DarkOrange4','coral1','coral2','coral3',
+ 'coral4','tomato1','tomato2','tomato3','tomato4',
+ 'OrangeRed1','OrangeRed2','OrangeRed3','OrangeRed4',
+ 'red1','red2','red3','red4','DeepPink1','DeepPink2',
+ 'DeepPink3','DeepPink4','HotPink1','HotPink2',
+ 'HotPink3','HotPink4','pink1','pink2','pink3','pink4',
+ 'LightPink1','LightPink2','LightPink3','LightPink4',
+ 'PaleVioletRed1','PaleVioletRed2','PaleVioletRed3',
+ 'PaleVioletRed4','maroon1','maroon2','maroon3',
+ 'maroon4','VioletRed1','VioletRed2','VioletRed3',
+ 'VioletRed4','magenta1','magenta2','magenta3',
+ 'magenta4','orchid1','orchid2','orchid3','orchid4',
+ 'plum1','plum2','plum3','plum4','MediumOrchid1',
+ 'MediumOrchid2','MediumOrchid3','MediumOrchid4',
+ 'DarkOrchid1','DarkOrchid2','DarkOrchid3',
+ 'DarkOrchid4','purple1','purple2','purple3','purple4',
+ 'MediumPurple1','MediumPurple2','MediumPurple3',
+ 'MediumPurple4','thistle1','thistle2','thistle3', 'thistle4'
+]
+
+colors_lbox.insert(0, *ins_data)
diff --git a/ext/tk/sample/demos-en/combo.rb b/ext/tk/sample/demos-en/combo.rb
new file mode 100644
index 0000000000..d77660095c
--- /dev/null
+++ b/ext/tk/sample/demos-en/combo.rb
@@ -0,0 +1,96 @@
+# combo.rb --
+#
+# This demonstration script creates several combobox widgets.
+#
+# based on "Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($combo_demo) && $combo_demo
+ $combo_demo.destroy
+ $combo_demo = nil
+end
+
+$combo_demo = TkToplevel.new {|w|
+ title("Combobox Demonstration")
+ iconname("combo")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+Three different combo-boxes are displayed below. \
+You can add characters to the first \
+one by pointing, clicking and typing, just as with an entry; pressing \
+Return will cause the current value to be added to the list that is \
+selectable from the drop-down list, and you can choose other values \
+by pressing the Down key, using the arrow keys to pick another one, \
+and pressing Return again. The second combo-box is fixed to a \
+particular value, and cannot be modified at all. The third one only \
+allows you to select values from its drop-down list of Australian \
+cities.
+EOL
+
+## variables
+firstValue = TkVariable.new
+secondValue = TkVariable.new
+ozCity = TkVariable.new
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame,
+ ['firstVariable', firstValue],
+ ['secondVariable', secondValue],
+ ['ozCity', ozCity])
+ }),
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'combo'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $combo_demo.destroy
+ $combo_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+australianCities = [
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide', 'Brisbane',
+ 'Hobart', 'Darwin', 'Alice Springs'
+]
+
+
+secondValue.value = 'unchangable'
+ozCity.value = 'Sydney'
+
+Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
+ Ttk::Combobox.new(f, :textvariable=>firstValue){|b|
+ b.bind('Return', '%W'){|w|
+ w.values <<= w.value unless w.values.include?(w.value)
+ }
+ }.pack(:pady=>5, :padx=>10)
+ },
+
+ Ttk::LabelFrame.new(frame, :text=>'Disabled'){|f|
+ Ttk::Combobox.new(f, :textvariable=>secondValue, :state=>:disabled) .
+ pack(:pady=>5, :padx=>10)
+ },
+
+ Ttk::LabelFrame.new(frame, :text=>'Defined List Only'){|f|
+ Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly,
+ :values=>australianCities) .
+ pack(:pady=>5, :padx=>10)
+ },
+
+ :side=>:top, :pady=>5, :padx=>10)
diff --git a/ext/tk/sample/demos-en/cscroll.rb b/ext/tk/sample/demos-en/cscroll.rb
new file mode 100644
index 0000000000..40a3afc0ad
--- /dev/null
+++ b/ext/tk/sample/demos-en/cscroll.rb
@@ -0,0 +1,136 @@
+# cscroll.rb
+#
+# This demonstration script creates a simple canvas that can be
+# scrolled in two dimensions.
+#
+# simple scrollable canvas widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($cscroll_demo) && $cscroll_demo
+ $cscroll_demo.destroy
+ $cscroll_demo = nil
+end
+
+# demo toplevel widget
+$cscroll_demo = TkToplevel.new {|w|
+ title("Scrollable Canvas Demonstration")
+ iconname("cscroll")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
+ 'justify'=>'left', 'text'=>"This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."){
+ pack('side'=>'top')
+}
+
+# frame
+$cscroll_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $cscroll_demo
+ $cscroll_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'cscroll'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+unless $tk_version =~ /^4\.[01]/
+ $cscroll_grid = TkFrame.new(base_frame) {
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+ }
+ TkGrid.rowconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
+end
+
+# canvas
+$cscroll_canvas = TkCanvas.new(base_frame,
+ 'relief'=>'sunken', 'borderwidth'=>2,
+ 'scrollregion'=>['-11c', '-11c', '50c', '20c']
+ ) {|c|
+ if $tk_version =~ /^4\.[01]/
+ pack('expand'=>'yes', 'fill'=>'both')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}) {|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ if $tk_version =~ /^4\.[01]/
+ pack('side'=>'right', 'fill'=>'y')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+ }
+
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}) {|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ if $tk_version =~ /^4\.[01]/
+ pack('side'=>'bottom', 'fill'=>'x')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+ }
+}
+
+bg = $cscroll_canvas.configinfo('bg')[4]
+(0..19).each{|i|
+ x = -10+3*i
+ y = -10
+ (0..9).each{|j|
+ TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c",
+ 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect')
+ TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c",
+ 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
+ y += 3
+ }
+}
+
+$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas})
+$cscroll_canvas.itembind('all', 'Any-Leave', proc{scrollLeave $cscroll_canvas})
+$cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas})
+$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas})
+$cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y')
+$cscroll_canvas.bind('B2-Motion',
+ proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
+
+def scrollEnter(c)
+ id = c.find_withtag('current')[0].id
+ id -= 1 if c.gettags('current').include?('text')
+ $oldFill = c.itemconfiginfo(id, 'fill')[4]
+ if TkWinfo.depth(c) > 1
+ c.itemconfigure(id, 'fill'=>'SeaGreen1')
+ else
+ c.itemconfigure(id, 'fill'=>'black')
+ c.itemconfigure(id+1, 'fill'=>'white')
+ end
+end
+
+def scrollLeave(c)
+ id = c.find_withtag('current')[0].id
+ id -= 1 if c.gettags('current').include?('text')
+ c.itemconfigure(id, 'fill'=>$oldFill)
+ c.itemconfigure(id+1, 'fill'=>'black')
+end
+
+def scrollButton(c)
+ id = c.find_withtag('current')[0].id
+ id += 1 unless c.gettags('current').include?('text')
+ print "You buttoned at #{c.itemconfiginfo(id,'text')[4]}\n"
+end
+
diff --git a/ext/tk/sample/demos-en/ctext.rb b/ext/tk/sample/demos-en/ctext.rb
new file mode 100644
index 0000000000..e04cb283f0
--- /dev/null
+++ b/ext/tk/sample/demos-en/ctext.rb
@@ -0,0 +1,207 @@
+# ctext.rb
+#
+# This demonstration script creates a canvas widget with a text
+# item that can be edited and reconfigured in various ways.
+#
+# Canvas Text widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($ctext_demo) && $ctext_demo
+ $ctext_demo.destroy
+ $ctext_demo = nil
+end
+
+# demo toplevel widget
+$ctext_demo = TkToplevel.new {|w|
+ title("Canvas Text Demonstration")
+ iconname("Text")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing:
+ 1. You can point, click, and type.
+ 2. You can also select with button 1.
+ 3. You can copy the selection to the mouse position with button 2.
+ 4. Backspace and Control+h delete the selection if there is one;
+ otherwise they delete the character just before the insertion cursor.
+ 5. Delete deletes the selection if there is one; otherwise it deletes
+ the character just after the insertion cursor."){
+ pack('side'=>'top')
+}
+
+# frame
+$ctext_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $ctext_demo
+ $ctext_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'ctext'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas
+$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
+ 'borderwidth'=>0, 'width'=>500, 'height'=>350)
+$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
+
+# font
+if $tk_version =~ /^4.*/
+ textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
+else
+ textFont = 'Helvetica 24'
+end
+
+# canvas
+TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
+ 'outline'=>'black', 'fill'=>'red')
+
+ctag_text_param = {
+ 'text'=>"This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above).",
+ 'width'=>440, 'anchor'=>'n', 'justify'=>'left'
+}
+if $tk_version =~ /^4.*/
+ ctag_text_param['font'] = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
+else
+ ctag_text_param['font'] = 'Helvetica 24'
+end
+
+$ctag_text = TkcTag.new($ctext_canvas)
+$ctag_text.withtag(TkcText.new($ctext_canvas, 250, 200, ctag_text_param))
+
+$ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('Shift-1',
+ proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"},
+ "%x %y")
+$ctag_text.bind('Shift-B1-Motion',
+ proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A")
+$ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"})
+$ctag_text.bind('Control-h', proc{textBs $ctext_canvas})
+$ctag_text.bind('BackSpace', proc{textBs $ctext_canvas})
+$ctag_text.bind('Delete', proc{textDel $ctext_canvas})
+$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"},
+ "%x %y")
+
+# Next, create some items that allow the text's anchor position
+# to be edited.
+
+def mkTextConfig(w,x,y,option,value,color)
+ item = TkcRectangle.new(w, x, y, x+30, y+30,
+ 'outline'=>'black', 'fill'=>color, 'width'=>1)
+ item.bind('1', proc{$ctag_text.configure option, value})
+ w.addtag_withtag('config', item)
+end
+
+x = 50
+y = 50
+color = 'LightSkyBlue1'
+mkTextConfig $ctext_canvas, x, y, 'anchor', 'se', color
+mkTextConfig $ctext_canvas, x+30, y, 'anchor', 's', color
+mkTextConfig $ctext_canvas, x+60, y, 'anchor', 'sw', color
+mkTextConfig $ctext_canvas, x, y+30, 'anchor', 'e', color
+mkTextConfig $ctext_canvas, x+30, y+30, 'anchor', 'center', color
+mkTextConfig $ctext_canvas, x+60, y+30, 'anchor', 'w', color
+mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color
+mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color
+mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color
+item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50,
+ 'outline'=>'black', 'fill'=>'red')
+item.bind('1', proc{$ctag_text.configure 'anchor', 'center'})
+if $tk_version =~ /^4.*/
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
+ 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*',
+ 'anchor'=>'s', 'fill'=>'brown')
+else
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
+ 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
+end
+
+# Lastly, create some items that allow the text's justification to be
+# changed.
+
+x = 350
+y = 50
+color = 'SeaGreen2'
+mkTextConfig $ctext_canvas, x, y, 'justify', 'left', color
+mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color
+mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color
+if $tk_version =~ /^4.*/
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification',
+ 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*',
+ 'anchor'=>'s', 'fill'=>'brown')
+else
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification',
+ 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
+end
+
+$ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas})
+$ctext_canvas.itembind('config', 'Leave',
+ proc{$ctext_canvas\
+ .itemconfigure('current',
+ 'fill'=>$textConfigFill)})
+
+$textConfigFill = ''
+
+def textEnter(w)
+ $textConfigFill = (w.itemconfiginfo 'current', 'fill')[4]
+ w.itemconfigure 'current', 'fill', 'black'
+end
+
+def textInsert(w, string)
+ return if string == ""
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ end
+ $ctag_text.insert 'insert', string
+end
+
+def textPaste(w, pos)
+ begin
+ $ctag_text.insert pos, TkSelection.get
+ rescue
+ end
+end
+
+def textB1Press(w,x,y)
+ w.icursor 'current', "@#{x},#{y}"
+ w.itemfocus 'current'
+ w.focus
+ w.select_from 'current', "@#{x},#{y}"
+end
+
+def textB1Move(w,x,y)
+ w.select_to 'current', "@#{x},#{y}"
+end
+
+def textBs(w)
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ char = $ctag_text.index('insert').to_i - 1
+ $ctag_text.dchars(char) if char >= 0
+ end
+end
+
+def textDel(w)
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ $ctag_text.dchars 'insert'
+ end
+end
+
diff --git a/ext/tk/sample/demos-en/dialog1.rb b/ext/tk/sample/demos-en/dialog1.rb
new file mode 100644
index 0000000000..af476ecd05
--- /dev/null
+++ b/ext/tk/sample/demos-en/dialog1.rb
@@ -0,0 +1,38 @@
+#
+# a dialog box with a local grab (called by 'widget')
+#
+class TkDialog_Demo1 < TkDialog
+ ###############
+ private
+ ###############
+ def title
+ "Dialog with local grab"
+ end
+
+ def message
+ 'This is a modal dialog box. It uses Tk\'s "grab" command to create a "local grab" on the dialog box. The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications.'
+ end
+
+ def bitmap
+ 'info'
+ end
+
+ def default_button
+ 0
+ end
+
+ def buttons
+ # ["Dismiss", "", "Show Code"]
+ ["OK", "Cancel", "Show Code"]
+ end
+end
+
+ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value
+case ret
+when 0
+ print "You pressed OK\n"
+when 1
+ print "You pressed Cancel\n"
+when 2
+ showCode 'dialog1'
+end
diff --git a/ext/tk/sample/demos-en/dialog2.rb b/ext/tk/sample/demos-en/dialog2.rb
new file mode 100644
index 0000000000..efc4b714da
--- /dev/null
+++ b/ext/tk/sample/demos-en/dialog2.rb
@@ -0,0 +1,41 @@
+#
+# a dialog box with a global grab (called by 'widget')
+#
+class TkDialog_Demo2 < TkDialog
+ ###############
+ private
+ ###############
+ def title
+ "Dialog with global grab"
+ end
+
+ def message
+ "This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below. Global grabs are almost always a bad idea; don't use them unless you're truly desperate."
+ end
+
+ def bitmap
+ 'info'
+ end
+
+ def default_button
+ 0
+ end
+
+ def buttons
+ ["OK", "Cancel", "Show Code"]
+ end
+end
+
+ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'},
+ 'prev_command'=>proc{|dialog|
+ Tk.after 100, proc{dialog.grab('global')}
+ }).value
+case ret
+when 0
+ print "\You pressed OK\n"
+when 1
+ print "You pressed Cancel\n"
+when 2
+ showCode 'dialog2'
+end
+
diff --git a/ext/tk/sample/demos-en/doc.org/README b/ext/tk/sample/demos-en/doc.org/README
new file mode 100644
index 0000000000..90677d3316
--- /dev/null
+++ b/ext/tk/sample/demos-en/doc.org/README
@@ -0,0 +1,7 @@
+This directory contains a collection of demonstration programs that
+are translated into Japanese. You need to use a Japanized "wish" to
+see these Japanese-translated demonstration programs. You also need
+to put this directory ("demos.jp") at the next to "demos" since some
+of the programs refer to the image files at "demos".
+
+Please refer to the README file at "demos" for more detail.
diff --git a/ext/tk/sample/demos-en/doc.org/README.JP b/ext/tk/sample/demos-en/doc.org/README.JP
new file mode 100644
index 0000000000..42b4929378
--- /dev/null
+++ b/ext/tk/sample/demos-en/doc.org/README.JP
@@ -0,0 +1,14 @@
+This directory contains "widget" demo for the Japanized Tcl7.6/Tk4.2.
+Most of the messages in the original are translated to Japanese.
+But other tools in this directory are not translated.
+
+Following 2 kanji fonts are defined at the beginning of the file "widget."
+
+ -*--24-*-jisx0208.1983-0
+ -*--16-*-jisx0208.1983-0
+
+These fonts are all part of the core distribution of X11R5, so
+if you are running X11R5, you don't have to modify the file.
+
+But if you don't have these fonts, replace them with appropriate ones.
+"-*--14-*-jisx0208.1983-0" will be a good choice.
diff --git a/ext/tk/sample/demos-en/doc.org/README.tk80 b/ext/tk/sample/demos-en/doc.org/README.tk80
new file mode 100644
index 0000000000..c71f977d74
--- /dev/null
+++ b/ext/tk/sample/demos-en/doc.org/README.tk80
@@ -0,0 +1,46 @@
+This directory contains a collection of programs to demonstrate
+the features of the Tk toolkit. The programs are all scripts for
+"wish", a windowing shell. If wish has been installed in /usr/local
+then you can invoke any of the programs in this directory just
+by typing its file name to your command shell. Otherwise invoke
+wish with the file as its first argument, e.g., "wish hello".
+The rest of this file contains a brief description of each program.
+Files with names ending in ".tcl" are procedure packages used by one
+or more of the demo programs; they can't be used as programs by
+themselves so they aren't described below.
+
+hello - Creates a single button; if you click on it, a message
+ is typed and the application terminates.
+
+widget - Contains a collection of demonstrations of the widgets
+ currently available in the Tk library. Most of the .tcl
+ files are scripts for individual demos available through
+ the "widget" program.
+
+ixset - A simple Tk-based wrapper for the "xset" program, which
+ allows you to interactively query and set various X options
+ such as mouse acceleration and bell volume. Thanks to
+ Pierre David for contributing this example.
+
+rolodex - A mock-up of a simple rolodex application. It has much of
+ the user interface for such an application but no back-end
+ database. This program was written in response to Tom
+ LaStrange's toolkit benchmark challenge.
+
+tcolor - A color editor. Allows you to edit colors in several
+ different ways, and will also perform automatic updates
+ using "send".
+
+rmt - Allows you to "hook-up" remotely to any Tk application
+ on the display. Select an application with the menu,
+ then just type commands: they'll go to that application.
+
+timer - Displays a seconds timer with start and stop buttons.
+ Control-c and control-q cause it to exit.
+
+browse - A simple directory browser. Invoke it with and argument
+ giving the name of the directory you'd like to browse.
+ Double-click on files or subdirectories to browse them.
+ Control-c and control-q cause the program to exit.
+
+sccs id = SCCS: @(#) README 1.3 96/02/16 10:49:14
diff --git a/ext/tk/sample/demos-en/doc.org/license.terms b/ext/tk/sample/demos-en/doc.org/license.terms
new file mode 100644
index 0000000000..c0a44d3fc2
--- /dev/null
+++ b/ext/tk/sample/demos-en/doc.org/license.terms
@@ -0,0 +1,39 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., and other parties. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/demos-en/doc.org/license.terms.tk80 b/ext/tk/sample/demos-en/doc.org/license.terms.tk80
new file mode 100644
index 0000000000..c0a44d3fc2
--- /dev/null
+++ b/ext/tk/sample/demos-en/doc.org/license.terms.tk80
@@ -0,0 +1,39 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., and other parties. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/demos-en/entry1.rb b/ext/tk/sample/demos-en/entry1.rb
new file mode 100644
index 0000000000..fac0afc243
--- /dev/null
+++ b/ext/tk/sample/demos-en/entry1.rb
@@ -0,0 +1,58 @@
+#
+# entry (no scrollbars) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($entry1_demo) && $entry1_demo
+ $entry1_demo.destroy
+ $entry1_demo = nil
+end
+
+# demo toplevel widget
+$entry1_demo = TkToplevel.new {|w|
+ title("Entry Demonstration (no scrollbars)")
+ iconname("entry1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry1_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "Three different entries are displayed below. You can add characters by pointing, clicking and typing. The normal Motif editing characters are supported, along with many Emacs bindings. For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor. For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with mouse button2 pressed."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $entry1_demo
+ $entry1_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'entry1'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+#
+e1 = TkEntry.new(base_frame, 'relief'=>'sunken')
+e2 = TkEntry.new(base_frame, 'relief'=>'sunken')
+e3 = TkEntry.new(base_frame, 'relief'=>'sunken')
+[e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')}
+
+#
+e1.insert(0, 'Initial value')
+e2.insert('end', "This entry contains a long value, much too long ")
+e2.insert('end', "to fit in the window at one time, so long in fact ")
+e2.insert('end', "that you'll have to scan or scroll to see the end.")
+e2.insert('end', "")
+
diff --git a/ext/tk/sample/demos-en/entry2.rb b/ext/tk/sample/demos-en/entry2.rb
new file mode 100644
index 0000000000..05a6c83cfd
--- /dev/null
+++ b/ext/tk/sample/demos-en/entry2.rb
@@ -0,0 +1,93 @@
+# entry2.rb
+#
+# This demonstration script is the same as the entry1.tcl script
+# except that it creates scrollbars for the entries.
+#
+# entry (with scrollbars) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($entry2_demo) && $entry2_demo
+ $entry2_demo.destroy
+ $entry2_demo = nil
+end
+
+# demo toplevel widget
+$entry2_demo = TkToplevel.new {|w|
+ title("Entry Demonstration (with scrollbars)")
+ iconname("entry2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "Three different entries are displayed below, with a scrollbar for each entry. You can add characters by pointing, clicking and typing. The normal Motif editing characters are supported, along with many Emacs bindings. For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor. For entries that are too large to fit in the window all at once, you can scan through the entries with the scrollbars, or by dragging with mouse button2 pressed."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $entry2_demo
+ $entry2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'entry2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ # entry 1
+ s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e1 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s1.set first,last}
+ }
+ s1.command(proc{|*args| e1.xview(*args)})
+ e1.pack('side'=>'top', 'fill'=>'x')
+ s1.pack('side'=>'top', 'fill'=>'x')
+
+ # spacer
+ TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
+
+ # entry 2
+ s2 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e2 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s2.set first,last}
+ }
+ s2.command(proc{|*args| e2.xview(*args)})
+ e2.pack('side'=>'top', 'fill'=>'x')
+ s2.pack('side'=>'top', 'fill'=>'x')
+
+ # spacer
+ TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
+
+ # entry 3
+ s3 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e3 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s3.set first,last}
+ }
+ s3.command(proc{|*args| e3.xview(*args)})
+ e3.pack('side'=>'top', 'fill'=>'x')
+ s3.pack('side'=>'top', 'fill'=>'x')
+
+ #
+ e1.insert(0, 'Initial value')
+ e2.insert('end', "This entry contains a long value, much too long ")
+ e2.insert('end', "to fit in the window at one time, so long in fact ")
+ e2.insert('end', "that you'll have to scan or scroll to see the end.")
+ e2.insert('end', "")
+
+}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes')
+
diff --git a/ext/tk/sample/demos-en/entry3.rb b/ext/tk/sample/demos-en/entry3.rb
new file mode 100644
index 0000000000..d3bc629fdf
--- /dev/null
+++ b/ext/tk/sample/demos-en/entry3.rb
@@ -0,0 +1,220 @@
+# entry3.rb --
+#
+# This demonstration script creates several entry widgets whose
+# permitted input is constrained in some way. It also shows off a
+# password entry.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($entry3_demo) && $entry3_demo
+ $entry3_demo.destroy
+ $entry3_demo = nil
+end
+
+$entry3_demo = TkToplevel.new {|w|
+ title("Constrained Entry Demonstration")
+ iconname("entry3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+Four different entries are displayed below. You can add characters \
+by pointing, clicking and typing, though each is constrained in what \
+it will accept. The first only accepts integers or the empty string \
+(checking when focus leaves it) and will flash to indicate any \
+problem. The second only accepts strings with fewer than ten \
+characters and sounds the bell when an attempt to go over the limit \
+is made. The third accepts US phone numbers, mapping letters to \
+their digit equivalent and sounding the bell on encountering an \
+invalid character or if trying to type over a character that is not \
+a digit. The fourth is a password field that accepts up to eight \
+characters (silently ignoring further ones), and displaying them as \
+asterisk characters.
+EOL
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $entry3_demo.destroy
+ $entry3_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'entry3'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+# focusAndFlash --
+# Error handler for entry widgets that forces the focus onto the
+# widget and makes the widget flash by exchanging the foreground and
+# background colours at intervals of 200ms (i.e. at approximately
+# 2.5Hz).
+#
+# Arguments:
+# widget - entry widget to flash
+# fg - Initial foreground colour
+# bg - Initial background colour
+# count - Counter to control the number of times flashed
+def focusAndFlash(widget, fg, bg, count=5)
+ return if count <= 0
+ if fg && !fg.empty? && bg && !bg.empty?
+ TkTimer.new(200, count,
+ proc{widget.configure(:foreground=>bg, :background=>fg)},
+ proc{widget.configure(:foreground=>fg, :background=>bg)}
+ ).start
+ else
+ # TkTimer.new(150, 3){Tk.bell}.start
+ Tk.bell
+ TkTimer.new(200, count,
+ proc{widget.configure(:foreground=>'white',
+ :background=>'black')},
+ proc{widget.configure(:foreground=>'black',
+ :background=>'white')}
+ ).at_end{begin
+ widget.configure(:foreground=>fg,
+ :background=>bg)
+ rescue
+ # ignore
+ end}.start
+ end
+ widget.focus(true)
+end
+
+l1 = TkLabelFrame.new(base_frame, :text=>"Integer Entry")
+TkEntry.new(l1, :validate=>:focus,
+ :vcmd=>[
+ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
+ ]) {|e|
+ fg = e.foreground
+ bg = e.background
+ invalidcommand [proc{|w| focusAndFlash(w, fg, bg)}, '%W']
+ pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+}
+
+l2 = TkLabelFrame.new(base_frame, :text=>"Length-Constrained Entry")
+TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :vcmd=>[proc{|s| s.length < 10}, '%P']
+ ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+
+### PHONE NUMBER ENTRY ###
+# Note that the source to this is quite a bit longer as the behaviour
+# demonstrated is a lot more ambitious than with the others.
+
+# Initial content for the third entry widget
+entry3content = TkVariable.new("1-(000)-000-0000")
+
+# Mapping from alphabetic characters to numbers.
+$phoneNumberMap = {}
+Hash[*(%w(abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9))].each{|chars, n|
+ chars.split('').each{|c|
+ $phoneNumberMap[c] = n
+ $phoneNumberMap[c.upcase] = n
+ }
+}
+
+# phoneSkipLeft --
+# Skip over fixed characters in a phone-number string when moving left.
+#
+# Arguments:
+# widget - The entry widget containing the phone-number.
+def phoneSkipLeft(widget)
+ idx = widget.index('insert')
+ if idx == 8
+ # Skip back two extra characters
+ widget.cursor = idx - 2
+ elsif idx == 7 || idx == 12
+ # Skip back one extra character
+ widget.cursor = idx - 1
+ elsif idx <= 3
+ # Can't move any further
+ Tk.bell
+ Tk.callback_break
+ end
+end
+
+# phoneSkipRight --
+# Skip over fixed characters in a phone-number string when moving right.
+#
+# Arguments:
+# widget - The entry widget containing the phone-number.
+# add - Offset to add to index before calculation (used by validation.)
+def phoneSkipRight(widget, add = 0)
+ idx = widget.index('insert')
+ if (idx + add == 5)
+ # Skip forward two extra characters
+ widget.cursor = idx + 2
+ elsif (idx + add == 6 || idx + add == 10)
+ # Skip forward one extra character
+ widget.cursor = idx + 1
+ elsif (idx + add == 15 && add == 0)
+ # Can't move any further
+ Tk.bell
+ Tk.callback_break
+ end
+end
+
+# validatePhoneChange --
+# Checks that the replacement (mapped to a digit) of the given
+# character in an entry widget at the given position will leave a
+# valid phone number in the widget.
+#
+# widget - entry widget to validate
+# vmode - The widget's validation mode
+# idx - The index where replacement is to occur
+# char - The character (or string, though that will always be
+# refused) to be overwritten at that point.
+
+def validatePhoneChange(widget, vmode, idx, char)
+ return true if idx == nil
+ Tk.after_idle(proc{widget.configure(:validate=>vmode,
+ :invcmd=>proc{Tk.bell})})
+ if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/
+ widget.delete(idx)
+ widget.insert(idx, $phoneNumberMap[char] || char)
+ Tk.after_idle(proc{phoneSkipRight(widget, -1)})
+ return true
+ # Tk.update(true) # <- Don't work 'update' inter validation callback.
+ # It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1).
+ end
+ return false
+end
+
+
+l3 = TkLabelFrame.new(base_frame, :text=>"US Phone-Number Entry")
+TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :textvariable=>entry3content,
+ :vcmd=>[
+ proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
+ "%W %v %i %S"
+ ]){|e|
+ # Click to focus goes to the first editable character...
+ bind('FocusIn', proc{|d,w|
+ if d != "NotifyAncestor"
+ w.cursor = 3
+ Tk.after_idle(proc{w.selection_clear})
+ end
+ }, '%d %W')
+ bind('Left', proc{|w| phoneSkipLeft(w)}, '%W')
+ bind('Right', proc{|w| phoneSkipRight(w)}, '%W')
+ pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+}
+
+l4 = TkLabelFrame.new(base_frame, :text=>"Password Entry")
+TkEntry.new(l4, :validate=>:key, :show=>'*',
+ :vcmd=>[
+ proc{|s| s.length <= 8},
+ '%P'
+ ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+
+TkFrame.new(base_frame){|f|
+ lower
+ TkGrid.configure(l1, l2, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew)
+ TkGrid.configure(l3, l4, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew)
+ TkGrid.columnconfigure(f, [0,1], :uniform=>1)
+ pack(:fill=>:both, :expand=>true)
+}
diff --git a/ext/tk/sample/demos-en/filebox.rb b/ext/tk/sample/demos-en/filebox.rb
new file mode 100644
index 0000000000..0c284c11d4
--- /dev/null
+++ b/ext/tk/sample/demos-en/filebox.rb
@@ -0,0 +1,102 @@
+# filebox.rb
+#
+# This demonstration script prompts the user to select a file.#
+# widget demo prompts the user to select a file (called by 'widget')
+#
+
+# toplevel widget
+if defined?($filebox_demo) && $filebox_demo
+ $filebox_demo.destroy
+ $filebox_demo = nil
+end
+
+# demo toplevel widget
+$filebox_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("filebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($filebox_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog.").pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $filebox_demo
+ $filebox_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'filebox'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+['open', 'save'].each{|type|
+ TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>"Select a file to #{type}: ", 'anchor'=>'e')\
+ .pack('side'=>'left')
+
+ TkEntry.new(f, 'width'=>20) {|e|
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
+
+ TkButton.new(f, 'text'=>'Browse ...',
+ 'command'=>proc{fileDialog base_frame,e,type})\
+ .pack('side'=>'left')
+ }
+
+ pack('fill'=>'x', 'padx'=>'1c', 'pady'=>3)
+ }
+}
+
+$tk_strictMotif = TkVarAccess.new('tk_strictMotif')
+if ($tk_platform['platform'] == 'unix')
+ TkCheckButton.new(base_frame,
+ 'text'=>'Use Motif Style Dialog',
+ 'variable'=>$tk_strictMotif,
+ 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c')
+end
+
+def fileDialog(w,ent,operation)
+ # Type names Extension(s) Mac File Type(s)
+ #
+ #--------------------------------------------------------
+ types = [
+ ['Text files', ['.txt','.doc'] ],
+ ['Text files', [], 'TEXT' ],
+ ['Ruby Scripts', ['.rb'], 'TEXT' ],
+ ['Tcl Scripts', ['.tcl'], 'TEXT' ],
+ ['C Source Files', ['.c','.h'] ],
+ ['All Source Files', ['.rb','.tcl','.c','.h'] ],
+ ['Image Files', ['.gif'] ],
+ ['Image Files', ['.jpeg','.jpg'] ],
+ ['Image Files', [], ['GIFF','JPEG']],
+ ['All files', '*' ]
+ ]
+
+ if operation == 'open'
+ file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w)
+ else
+ file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w,
+ 'initialfile'=>'Untitled',
+ 'defaultextension'=>'.txt')
+ end
+ if file != ""
+ ent.delete 0, 'end'
+ ent.insert 0, file
+ # ent.xview 'end'
+ Tk.update_idletasks # need this for Tk::Tile::Entry
+ # (to find right position of 'xview').
+ ent.xview(ent.index('end'))
+ end
+end
+
diff --git a/ext/tk/sample/demos-en/floor.rb b/ext/tk/sample/demos-en/floor.rb
new file mode 100644
index 0000000000..eb8b23eb7d
--- /dev/null
+++ b/ext/tk/sample/demos-en/floor.rb
@@ -0,0 +1,1723 @@
+# floor.rb
+#
+# This demonstration script creates a canvas widet that displays the
+# floorplan for DEC's Western Research Laboratory.
+#
+# floorDisplay widget demo (called by 'widget')
+#
+
+# floorDisplay --
+# Recreate the floorplan display in the canvas given by "w". The
+# floor given by "active" is displayed on top with its office structure
+# visible.
+#
+# Arguments:
+# w - Name of the canvas window.
+# active - Number of active floor (1, 2, or 3).
+
+def floorDisplay(w,active)
+ return if $activeFloor == active
+
+ w.delete('all')
+ $activeFloor = active
+
+ # First go through the three floors, displaying the backgrounds for
+ # each floor.
+
+ floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1'])
+ floor_bg2(w,$floor_colors['bg2'],$floor_colors['outline2'])
+ floor_bg3(w,$floor_colors['bg3'],$floor_colors['outline3'])
+
+ # Raise the background for the active floor so that it's on top.
+
+ w.raise("floor#{active}")
+
+ # Create a dummy item just to mark this point in the display list,
+ # so we can insert highlights here.
+
+ TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker')
+
+ # Add the walls and labels for the active floor, along with
+ # transparent polygons that define the rooms on the floor.
+ # Make sure that the room polygons are on top.
+
+ $floorLabels.clear
+ $floorItems.clear
+ send("floor_fg#{active}", w, $floor_colors['offices'])
+ w.raise('room')
+
+ # Offset the floors diagonally from each other.
+
+ w.move('floor1', '2c', '2c')
+ w.move('floor2', '1c', '1c')
+
+ # Create items for the room entry and its label.
+ TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry)
+ TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"Room: ")
+ w['scrollregion'] = w.bbox('all')
+end
+
+# newRoom --
+# This method is invoked whenever the mouse enters a room
+# in the floorplan. It changes tags so that the current room is
+# highlighted.
+#
+# Arguments:
+# w - The name of the canvas window.
+
+def newRoom(w)
+ id = w.find_withtag('current')[0]
+ $currentRoom.value = $floorLabels[id.id] if id != ""
+ Tk.update(true)
+end
+
+# roomChanged --
+# This method is invoked whenever the currentRoom variable changes.
+# It highlights the current room and unhighlights any previous room.
+#
+# Arguments:
+# w - The canvas window displaying the floorplan.
+# args - Not used.
+
+def roomChanged(w,*args)
+ w.delete('highlight')
+ item = $floorItems[$currentRoom.value]
+ return if item == nil
+ new = TkcPolygon.new(w, *(w.coords(item)))
+ new.configure('fill'=>$floor_colors['active'], 'tags'=>'highlight')
+ w.raise(new, 'marker')
+end
+
+# floor_bg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg1(w,fill,outline)
+ TkcPolygon.new(w,347,80,349,82,351,84,353,85,363,92,375,99,386,104,
+ 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725,
+ 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327,
+ 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404,
+ 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325,
+ 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332,
+ 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363,
+ 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391,
+ 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7,
+ 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221,
+ 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5,
+ 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70,
+ 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill)
+ TkcLine.new(w,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg'])
+end
+
+# floor_bg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg2(w,fill,outline)
+ TkcPolygon.new(w,559,129,484,129,484,162,398,162,398,129,315,129,
+ 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391,
+ 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280,
+ 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644,
+ 367,802,367,802,129,725,129,725,133,559,133,559,129,
+ 'tags'=>['floor2','bg'], 'fill'=>fill)
+ TkcLine.new(w,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+end
+
+# floor_bg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg3(w,fill,outline)
+ TkcPolygon.new(w,159,300,107,300,107,248,159,248,159,129,96,129,96,
+ 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ TkcPolygon.new(w,258,370,258,329,350,329,350,311,399,311,399,129,
+ 315,129,315,133,176,133,176,129,159,129,159,370,258,370,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,107,300,159,300,159,248,107,248,107,300,
+ 'fill'=>outline, 'tags'=>['floor3','bg'])
+end
+
+# floor_fg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the first
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg1(w,color)
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '101'
+ $floorItems['101'] = i
+ TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Pub Lift1'
+ $floorItems['Pub Lift1'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Priv Lift1'
+ $floorItems['Priv Lift1'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,42,389,42,337,1,337,1,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '110'
+ $floorItems['110'] = i
+ TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '109'
+ $floorItems['109'] = i
+ TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,300,51,253,6,253,6,300,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '111'
+ $floorItems['111'] = i
+ TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,98,248,98,309,79,309,79,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117B'
+ $floorItems['117B'] = i
+ TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,251,51,204,6,204,6,251,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '112'
+ $floorItems['112'] = i
+ TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,6,156,51,156,51,203,6,203,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '113'
+ $floorItems['113'] = i
+ TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,85,169,79,169,79,192,85,192,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117A'
+ $floorItems['117A'] = i
+ TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,77,302,77,168,53,168,53,302,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117'
+ $floorItems['117'] = i
+ TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,155,51,115,6,115,6,155,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '114'
+ $floorItems['114'] = i
+ TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,95,115,53,115,53,168,95,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '115'
+ $floorItems['115'] = i
+ TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,87,113,87,27,10,27,10,113,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '116'
+ $floorItems['116'] = i
+ TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,89,91,128,91,128,113,89,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '118'
+ $floorItems['118'] = i
+ TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,178,128,178,132,216,132,216,91,
+ 163,91,163,112,149,112,149,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '120'
+ $floorItems['120'] = i
+ TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192,
+ 156,192,156,169,175,169,175,246,79,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '122'
+ $floorItems['122'] = i
+ TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,169,154,169,154,191,138,191,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '121'
+ $floorItems['121'] = i
+ TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,99,300,126,300,126,309,99,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106A'
+ $floorItems['106A'] = i
+ TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '105'
+ $floorItems['105'] = i
+ TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,174,309,174,300,152,300,152,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106B'
+ $floorItems['106B'] = i
+ TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '104'
+ $floorItems['104'] = i
+ TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,385,138,337,91,337,91,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '108'
+ $floorItems['108'] = i
+ TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,256,337,140,337,140,385,256,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '107'
+ $floorItems['107'] = i
+ TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,300,353,300,329,260,329,260,353,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Smoking'
+ $floorItems['Smoking'] = i
+ TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '123'
+ $floorItems['123'] = i
+ TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '103'
+ $floorItems['103'] = i
+ TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '124'
+ $floorItems['124'] = i
+ TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '125'
+ $floorItems['125'] = i
+ TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '126'
+ $floorItems['126'] = i
+ TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,409,209,409,229,399,229,399,253,
+ 486,253,486,239,474,239,474,209,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '127'
+ $floorItems['127'] = i
+ TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,501,164,501,174,495,174,495,188,
+ 490,188,490,204,476,204,476,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'MShower'
+ $floorItems['MShower'] = i
+ TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Closet'
+ $floorItems['Closet'] = i
+ TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'WShower'
+ $floorItems['WShower'] = i
+ TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166,
+ 697,166,697,275,553,275,531,254,515,254,
+ 515,174,503,174,503,161,486,161,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '130'
+ $floorItems['130'] = i
+ TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,308,242,339,242,339,248,342,248,
+ 342,246,397,246,397,276,393,276,
+ 393,309,300,309,300,248,308,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '102'
+ $floorItems['102'] = i
+ TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,255,486,255,486,276,397,276,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '128'
+ $floorItems['128'] = i
+ TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,510,309,486,309,486,255,530,255,
+ 552,277,561,277,561,325,510,325,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '129'
+ $floorItems['129'] = i
+ TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,696,281,740,281,740,387,642,387,
+ 642,389,561,389,561,277,696,277,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '133'
+ $floorItems['133'] = i
+ TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,742,387,742,281,800,281,800,387,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '132'
+ $floorItems['132'] = i
+ TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,800,168,800,280,699,280,699,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '134'
+ $floorItems['134'] = i
+ TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,726,131,726,166,800,166,800,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '135'
+ $floorItems['135'] = i
+ TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366,
+ 304,312,396,312,396,288,400,288,404,288,
+ 409,290,413,292,418,297,421,302,422,309,
+ 421,318,417,325,411,330,405,332,397,333,
+ 344,333,340,334,336,336,335,338,332,342,
+ 331,347,332,351,334,354,336,357,341,359,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Ramona Stair'
+ $floorItems['Ramona Stair'] = i
+ TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20,
+ 122,28,123,32,123,68,220,68,220,87,90,87,90,23,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'University Stair'
+ $floorItems['University Stair'] = i
+ TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56,
+ 358,48,363,39,365,29,348,25,335,22,321,14,
+ 300,5,283,1,260,0,246,0,242,2,236,4,231,8,
+ 227,13,223,17,221,22,220,34,260,34,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Plaza Stair'
+ $floorItems['Plaza Stair'] = i
+ TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49,
+ 323,56,337,70,350,83,365,94,377,100,
+ 386,104,386,128,220,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Plaza Deck'
+ $floorItems['Plaza Deck'] = i
+ TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106'
+ $floorItems['106'] = i
+ TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115,
+ 95,128,114,128,114,151,157,151,157,153,112,153,
+ 112,130,97,130,97,168,175,168,175,131,146,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '119'
+ $floorItems['119'] = i
+ TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+end
+
+# floor_fg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the second
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg2(w,color)
+ i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222,
+ 800,222,800,168,748,168,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '238'
+ $floorItems['238'] = i
+ TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '237'
+ $floorItems['237'] = i
+ TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324,
+ 643,324,643,291,641,291,641,205,696,205,
+ 696,291,694,291,694,314,715,314,715,291,
+ 715,205,755,205,755,190,724,190,724,187,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '246'
+ $floorItems['246'] = i
+ TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,694,279,643,279,643,314,694,314,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '247'
+ $floorItems['247'] = i
+ TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246,
+ 397,246,397,255,476,255,476,250,482,250,559,250,
+ 559,274,482,274,482,278,396,278,396,274,232,274,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '202'
+ $floorItems['202'] = i
+ TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196,
+ 306,196,306,180,175,180,175,169,156,169,
+ 156,196,176,196,176,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '206'
+ $floorItems['206'] = i
+ TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,277,6,277,6,338,51,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '212'
+ $floorItems['212'] = i
+ TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '245'
+ $floorItems['245'] = i
+ TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,560,389,599,389,599,326,560,326,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '244'
+ $floorItems['244'] = i
+ TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,601,389,601,326,643,326,643,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '243'
+ $floorItems['243'] = i
+ TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,688,316,645,316,645,365,688,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '242'
+ $floorItems['242'] = i
+ TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,802,367,759,367,759,226,802,226,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Barbecue Deck'
+ $floorItems['Barbecue Deck'] = i
+ TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,262,755,314,717,314,717,262,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '240'
+ $floorItems['240'] = i
+ TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,316,689,316,689,365,755,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '241'
+ $floorItems['241'] = i
+ TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,206,717,206,717,261,755,261,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '239'
+ $floorItems['239'] = i
+ TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,695,277,643,277,643,206,695,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '248'
+ $floorItems['248'] = i
+ TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,676,135,676,185,724,185,724,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '236'
+ $floorItems['236'] = i
+ TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '235'
+ $floorItems['235'] = i
+ TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,626,143,633,143,633,135,572,135,
+ 572,143,579,143,579,185,626,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '234'
+ $floorItems['234'] = i
+ TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,135,571,135,571,145,578,145,
+ 578,185,527,185,527,131,557,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '233'
+ $floorItems['233'] = i
+ TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,249,557,249,557,205,476,205,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '230'
+ $floorItems['230'] = i
+ TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '232'
+ $floorItems['232'] = i
+ TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,186,495,186,495,204,476,204,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '229'
+ $floorItems['229'] = i
+ TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '227'
+ $floorItems['227'] = i
+ TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '228'
+ $floorItems['228'] = i
+ TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '226'
+ $floorItems['226'] = i
+ TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '225'
+ $floorItems['225'] = i
+ TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,198,306,198,306,249,234,249,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '224'
+ $floorItems['224'] = i
+ TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '223'
+ $floorItems['223'] = i
+ TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,268,179,221,179,221,135,268,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '222'
+ $floorItems['222'] = i
+ TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,177,179,219,179,219,135,177,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '221'
+ $floorItems['221'] = i
+ TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '204'
+ $floorItems['204'] = i
+ TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '205'
+ $floorItems['205'] = i
+ TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,256,385,256,340,212,340,212,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '207'
+ $floorItems['207'] = i
+ TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,210,340,164,340,164,385,210,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '208'
+ $floorItems['208'] = i
+ TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,115,340,162,340,162,385,115,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '209'
+ $floorItems['209'] = i
+ TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,228,89,156,53,156,53,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '217'
+ $floorItems['217'] = i
+ TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,169,97,169,97,190,89,190,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '217A'
+ $floorItems['217A'] = i
+ TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '216'
+ $floorItems['216'] = i
+ TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,179,51,135,6,135,6,179,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '215'
+ $floorItems['215'] = i
+ TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,227,6,227,6,180,51,180,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '214'
+ $floorItems['214'] = i
+ TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,275,6,275,6,229,51,229,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '213'
+ $floorItems['213'] = i
+ TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,114,340,67,340,67,385,114,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '210'
+ $floorItems['210'] = i
+ TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '211'
+ $floorItems['211'] = i
+ TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '203'
+ $floorItems['203'] = i
+ TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198,
+ 154,198,154,192,109,192,109,169,99,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '220'
+ $floorItems['220'] = i
+ TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Priv Lift2'
+ $floorItems['Priv Lift2'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Pub Lift 2'
+ $floorItems['Pub Lift 2'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '218'
+ $floorItems['218'] = i
+ TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '219'
+ $floorItems['219'] = i
+ TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '201'
+ $floorItems['201'] = i
+ TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+end
+
+# floor_fg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the third
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg3(w,color)
+ i = TkcPolygon.new(w,89,228,89,180,70,180,70,228,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316'
+ $floorItems['316'] = i
+ TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,115,368,162,368,162,323,115,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '309'
+ $floorItems['309'] = i
+ TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,164,323,164,368,211,368,211,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '308'
+ $floorItems['308'] = i
+ TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,256,368,212,368,212,323,256,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '307'
+ $floorItems['307'] = i
+ TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '305'
+ $floorItems['305'] = i
+ TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,219,251,203,244,203,244,219,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324B'
+ $floorItems['324B'] = i
+ TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,249,244,249,244,232,251,232,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324A'
+ $floorItems['324A'] = i
+ TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,223,135,223,179,177,179,177,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '320'
+ $floorItems['320'] = i
+ TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,114,368,114,323,67,323,67,368,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '310'
+ $floorItems['310'] = i
+ TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,277,23,321,68,321,68,277,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '312'
+ $floorItems['312'] = i
+ TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,229,68,229,68,275,23,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '313'
+ $floorItems['313'] = i
+ TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,68,227,23,227,23,180,68,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '314'
+ $floorItems['314'] = i
+ TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,95,179,95,135,23,135,23,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '315'
+ $floorItems['315'] = i
+ TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,99,226,99,204,91,204,91,226,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316B'
+ $floorItems['316B'] = i
+ TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,91,202,99,202,99,180,91,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316A'
+ $floorItems['316A'] = i
+ TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198,
+ 174,198,174,226,101,226,101,179,97,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '319'
+ $floorItems['319'] = i
+ TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '311'
+ $floorItems['311'] = i
+ TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '318'
+ $floorItems['318'] = i
+ TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '317'
+ $floorItems['317'] = i
+ TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,274,194,274,221,306,221,306,194,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '323'
+ $floorItems['323'] = i
+ TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,306,222,274,222,274,249,306,249,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '325'
+ $floorItems['325'] = i
+ TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,263,179,224,179,224,135,263,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '321'
+ $floorItems['321'] = i
+ TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,314,169,306,169,306,192,273,192,
+ 264,181,264,135,314,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '322'
+ $floorItems['322'] = i
+ TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = 'Pub Lift3'
+ $floorItems['Pub Lift3'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = 'Priv Lift3'
+ $floorItems['Priv Lift3'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '303'
+ $floorItems['303'] = i
+ TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,272,203,272,249,252,249,252,230,
+ 244,230,244,221,252,221,252,203,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324'
+ $floorItems['324'] = i
+ TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '304'
+ $floorItems['304'] = i
+ TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '301'
+ $floorItems['301'] = i
+ TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,397,246,377,246,377,185,397,185,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '327'
+ $floorItems['327'] = i
+ TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '326'
+ $floorItems['326'] = i
+ TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282,
+ 375,274,397,274,397,248,339,248,339,242,308,242,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '302'
+ $floorItems['302'] = i
+ TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203,
+ 272,193,263,180,242,180,175,180,175,169,156,169,
+ 156,196,177,196,177,228,107,228,70,228,70,275,107,275,
+ 107,248,160,248,160,301,107,301,107,275,70,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '306'
+ $floorItems['306'] = i
+ TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+end
+
+# Below is the "main program" that creates the floorplan demonstration.
+
+# toplevel widget
+if defined?($floor_demo) && $floor_demo
+ $floor_demo.destroy
+ $floor_demo = nil
+end
+
+# demo toplevel widget
+$floor_demo = TkToplevel.new {|w|
+ title("Floorplan Canvas Demonstration")
+ iconname("Floorplan")
+ positionWindow(w)
+ geometry('+20+20')
+ minsize(100,100)
+}
+
+base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+ 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){
+ pack('side'=>'top')
+}
+
+# frame
+$floor_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $floor_demo
+ $floor_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'floor'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+#
+$floorLabels = {}
+$floorItems = {}
+
+# canvas
+if $tk_version =~ /^4\.[01]/
+ $floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
+ 'highlightthickness'=>2)
+ $floor_canvas = TkCanvas.new($floor_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ 'highlightthickness'=>0) {|c|
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}){|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ pack('side'=>'bottom', 'fill'=>'x')
+ }
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}){|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ }
+ $floor_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes')
+ $floor_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+else
+ TkFrame.new(base_frame) {|f|
+ pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+ h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal')
+ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical')
+
+ TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1|
+ $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500,
+ 'borderwidth'=>0,
+ 'highlightthickness'=>0) {
+ xscrollcommand(proc{|first,last| h.set first,last})
+ yscrollcommand(proc{|first,last| v.set first,last})
+ pack('expand'=>'yes', 'fill'=>'both')
+ }
+ grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ }
+
+ v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ v.command(proc{|*args| $floor_canvas.yview(*args)})
+ h.command(proc{|*args| $floor_canvas.xview(*args)})
+ }
+end
+
+
+# Create an entry for displaying and typing in current room.
+
+$currentRoom = TkVariable.new
+$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
+ 'bd'=>2, 'textvariable'=>$currentRoom)
+
+# Choose colors, then fill in the floorplan.
+
+$floor_colors = {}
+if TkWinfo.depth($floor_canvas) > 1
+ $floor_colors['bg1'] = '#a9c1da'
+ $floor_colors['outline1'] = '#77889a'
+ $floor_colors['bg2'] = '#9ab0c6'
+ $floor_colors['outline2'] = '#687786'
+ $floor_colors['bg3'] = '#8ba0b3'
+ $floor_colors['outline3'] = '#596673'
+ $floor_colors['offices'] = 'Black'
+ $floor_colors['active'] = '#c4d1df'
+else
+ $floor_colors['bg1'] = 'white'
+ $floor_colors['outline1'] = 'black'
+ $floor_colors['bg2'] = 'white'
+ $floor_colors['outline2'] = 'black'
+ $floor_colors['bg3'] = 'white'
+ $floor_colors['outline3'] = 'black'
+ $floor_colors['offices'] = 'Black'
+ $floor_colors['active'] = 'black'
+end
+
+$activeFloor = ''
+floorDisplay $floor_canvas,3
+
+# Set up event bindings for canvas:
+
+$floor_canvas.itembind('floor1', '1', proc{floorDisplay $floor_canvas,1})
+$floor_canvas.itembind('floor2', '1', proc{floorDisplay $floor_canvas,2})
+$floor_canvas.itembind('floor3', '1', proc{floorDisplay $floor_canvas,3})
+$floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas})
+$floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''})
+$floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y')
+$floor_canvas.bind('B2-Motion',
+ proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y')
+$floor_canvas.bind('Destroy', proc{$currentRoom.unset})
+$currentRoom.value = ''
+$currentRoom.trace('w',proc{roomChanged $floor_canvas})
+
diff --git a/ext/tk/sample/demos-en/floor2.rb b/ext/tk/sample/demos-en/floor2.rb
new file mode 100644
index 0000000000..3bfa89a920
--- /dev/null
+++ b/ext/tk/sample/demos-en/floor2.rb
@@ -0,0 +1,1722 @@
+%# floor2.rb
+#
+# This demonstration script creates a canvas widet that displays the
+# floorplan for DEC's Western Research Laboratory.
+#
+# floorDisplay widget demo (called by 'widget')
+#
+
+# floorDisplay2 --
+# Recreate the floorplan display in the canvas given by "w". The
+# floor given by "active" is displayed on top with its office structure
+# visible.
+#
+# Arguments:
+# w - Name of the canvas window.
+# active - Number of active floor (1, 2, or 3).
+
+def floorDisplay2(w,active)
+ return if $activeFloor2 == active
+
+ w.delete('all')
+ $activeFloor2 = active
+
+ # First go through the three floors, displaying the backgrounds for
+ # each floor.
+
+ floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1'])
+ floor2_bg2(w,$floor2_colors['bg2'],$floor2_colors['outline2'])
+ floor2_bg3(w,$floor2_colors['bg3'],$floor2_colors['outline3'])
+
+ # Raise the background for the active floor so that it's on top.
+
+ w.raise("floor#{active}")
+
+ # Create a dummy item just to mark this point in the display list,
+ # so we can insert highlights here.
+
+ w.create(TkcRectangle,0,100,1,101,'fill'=>'','outline'=>'','tags'=>'marker')
+
+ # Add the walls and labels for the active floor, along with
+ # transparent polygons that define the rooms on the floor.
+ # Make sure that the room polygons are on top.
+
+ $floorLabels2.clear
+ $floorItems2.clear
+ send("floor2_fg#{active}", w, $floor2_colors['offices'])
+ w.raise('room')
+
+ # Offset the floors diagonally from each other.
+
+ w.move('floor1', '2c', '2c')
+ w.move('floor2', '1c', '1c')
+
+ # Create items for the room entry and its label.
+ w.create(TkcWindow, 600, 100, 'anchor'=>'w', 'window'=>$floor2_entry)
+ w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"Room: ")
+ w['scrollregion'] = w.bbox('all')
+end
+
+# newRoom2 --
+# This method is invoked whenever the mouse enters a room
+# in the floorplan. It changes tags so that the current room is
+# highlighted.
+#
+# Arguments:
+# w - The name of the canvas window.
+
+def newRoom2(w)
+ id = w.find_withtag('current')[0]
+ $currentRoom2.value = $floorLabels2[id.id] if id != ""
+ Tk.update(true)
+end
+
+# roomChanged2 --
+# This method is invoked whenever the currentRoom variable changes.
+# It highlights the current room and unhighlights any previous room.
+#
+# Arguments:
+# w - The canvas window displaying the floorplan.
+# args - Not used.
+
+def roomChanged2(w,*args)
+ w.delete('highlight')
+ item = $floorItems2[$currentRoom2.value]
+ return if item == nil
+ new = TkcPolygon.new(w, *(w.coords(item)))
+ new.configure('fill'=>$floor2_colors['active'], 'tags'=>'highlight')
+ w.raise(new, 'marker')
+end
+
+# floor2_bg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg1(w,fill,outline)
+ w.create(TkcPolygon,347,80,349,82,351,84,353,85,363,92,375,99,386,104,
+ 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725,
+ 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327,
+ 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404,
+ 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325,
+ 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332,
+ 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363,
+ 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391,
+ 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7,
+ 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221,
+ 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5,
+ 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70,
+ 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill)
+ w.create(TkcLine,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg'])
+end
+
+# floor2_bg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg2(w,fill,outline)
+ w.create(TkcPolygon,559,129,484,129,484,162,398,162,398,129,315,129,
+ 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391,
+ 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280,
+ 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644,
+ 367,802,367,802,129,725,129,725,133,559,133,559,129,
+ 'tags'=>['floor2','bg'], 'fill'=>fill)
+ w.create(TkcLine,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+end
+
+# floor2_bg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg3(w,fill,outline)
+ w.create(TkcPolygon,159,300,107,300,107,248,159,248,159,129,96,129,96,
+ 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ w.create(TkcPolygon,258,370,258,329,350,329,350,311,399,311,399,129,
+ 315,129,315,133,176,133,176,129,159,129,159,370,258,370,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ w.create(TkcLine,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,107,300,159,300,159,248,107,248,107,300,
+ 'fill'=>outline, 'tags'=>['floor3','bg'])
+end
+
+# floor2_fg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the first
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg1(w,color)
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '101'
+ $floorItems2['101'] = i
+ w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Pub Lift1'
+ $floorItems2['Pub Lift1'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Priv Lift1'
+ $floorItems2['Priv Lift1'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,42,389,42,337,1,337,1,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '110'
+ $floorItems2['110'] = i
+ w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '109'
+ $floorItems2['109'] = i
+ w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,300,51,253,6,253,6,300,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '111'
+ $floorItems2['111'] = i
+ w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,98,248,98,309,79,309,79,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117B'
+ $floorItems2['117B'] = i
+ w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,251,51,204,6,204,6,251,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '112'
+ $floorItems2['112'] = i
+ w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,6,156,51,156,51,203,6,203,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '113'
+ $floorItems2['113'] = i
+ w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,85,169,79,169,79,192,85,192,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117A'
+ $floorItems2['117A'] = i
+ w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,77,302,77,168,53,168,53,302,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117'
+ $floorItems2['117'] = i
+ w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,155,51,115,6,115,6,155,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '114'
+ $floorItems2['114'] = i
+ w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,95,115,53,115,53,168,95,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '115'
+ $floorItems2['115'] = i
+ w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,87,113,87,27,10,27,10,113,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '116'
+ $floorItems2['116'] = i
+ w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,89,91,128,91,128,113,89,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '118'
+ $floorItems2['118'] = i
+ w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,178,128,178,132,216,132,216,91,
+ 163,91,163,112,149,112,149,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '120'
+ $floorItems2['120'] = i
+ w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192,
+ 156,192,156,169,175,169,175,246,79,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '122'
+ $floorItems2['122'] = i
+ w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,169,154,169,154,191,138,191,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '121'
+ $floorItems2['121'] = i
+ w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,99,300,126,300,126,309,99,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106A'
+ $floorItems2['106A'] = i
+ w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '105'
+ $floorItems2['105'] = i
+ w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,174,309,174,300,152,300,152,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106B'
+ $floorItems2['106B'] = i
+ w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '104'
+ $floorItems2['104'] = i
+ w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,385,138,337,91,337,91,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '108'
+ $floorItems2['108'] = i
+ w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,256,337,140,337,140,385,256,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '107'
+ $floorItems2['107'] = i
+ w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,300,353,300,329,260,329,260,353,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Smoking'
+ $floorItems2['Smoking'] = i
+ w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '123'
+ $floorItems2['123'] = i
+ w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '103'
+ $floorItems2['103'] = i
+ w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '124'
+ $floorItems2['124'] = i
+ w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '125'
+ $floorItems2['125'] = i
+ w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '126'
+ $floorItems2['126'] = i
+ w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,409,209,409,229,399,229,399,253,
+ 486,253,486,239,474,239,474,209,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '127'
+ $floorItems2['127'] = i
+ w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,501,164,501,174,495,174,495,188,
+ 490,188,490,204,476,204,476,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'MShower'
+ $floorItems2['MShower'] = i
+ w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Closet'
+ $floorItems2['Closet'] = i
+ w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'WShower'
+ $floorItems2['WShower'] = i
+ w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166,
+ 697,166,697,275,553,275,531,254,515,254,
+ 515,174,503,174,503,161,486,161,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '130'
+ $floorItems2['130'] = i
+ w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,308,242,339,242,339,248,342,248,
+ 342,246,397,246,397,276,393,276,
+ 393,309,300,309,300,248,308,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '102'
+ $floorItems2['102'] = i
+ w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,255,486,255,486,276,397,276,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '128'
+ $floorItems2['128'] = i
+ w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,510,309,486,309,486,255,530,255,
+ 552,277,561,277,561,325,510,325,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '129'
+ $floorItems2['129'] = i
+ w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,696,281,740,281,740,387,642,387,
+ 642,389,561,389,561,277,696,277,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '133'
+ $floorItems2['133'] = i
+ w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,742,387,742,281,800,281,800,387,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '132'
+ $floorItems2['132'] = i
+ w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,800,168,800,280,699,280,699,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '134'
+ $floorItems2['134'] = i
+ w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,726,131,726,166,800,166,800,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '135'
+ $floorItems2['135'] = i
+ w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366,
+ 304,312,396,312,396,288,400,288,404,288,
+ 409,290,413,292,418,297,421,302,422,309,
+ 421,318,417,325,411,330,405,332,397,333,
+ 344,333,340,334,336,336,335,338,332,342,
+ 331,347,332,351,334,354,336,357,341,359,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Ramona Stair'
+ $floorItems2['Ramona Stair'] = i
+ w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20,
+ 122,28,123,32,123,68,220,68,220,87,90,87,90,23,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'University Stair'
+ $floorItems2['University Stair'] = i
+ w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56,
+ 358,48,363,39,365,29,348,25,335,22,321,14,
+ 300,5,283,1,260,0,246,0,242,2,236,4,231,8,
+ 227,13,223,17,221,22,220,34,260,34,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Plaza Stair'
+ $floorItems2['Plaza Stair'] = i
+ w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49,
+ 323,56,337,70,350,83,365,94,377,100,
+ 386,104,386,128,220,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Plaza Deck'
+ $floorItems2['Plaza Deck'] = i
+ w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106'
+ $floorItems2['106'] = i
+ w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115,
+ 95,128,114,128,114,151,157,151,157,153,112,153,
+ 112,130,97,130,97,168,175,168,175,131,146,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '119'
+ $floorItems2['119'] = i
+ w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ w.create(TkcLine,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+end
+
+# floor2_fg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the second
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg2(w,color)
+ i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222,
+ 800,222,800,168,748,168,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '238'
+ $floorItems2['238'] = i
+ w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '237'
+ $floorItems2['237'] = i
+ w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324,
+ 643,324,643,291,641,291,641,205,696,205,
+ 696,291,694,291,694,314,715,314,715,291,
+ 715,205,755,205,755,190,724,190,724,187,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '246'
+ $floorItems2['246'] = i
+ w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,694,279,643,279,643,314,694,314,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '247'
+ $floorItems2['247'] = i
+ w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246,
+ 397,246,397,255,476,255,476,250,482,250,559,250,
+ 559,274,482,274,482,278,396,278,396,274,232,274,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '202'
+ $floorItems2['202'] = i
+ w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196,
+ 306,196,306,180,175,180,175,169,156,169,
+ 156,196,176,196,176,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '206'
+ $floorItems2['206'] = i
+ w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,277,6,277,6,338,51,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '212'
+ $floorItems2['212'] = i
+ w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '245'
+ $floorItems2['245'] = i
+ w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,560,389,599,389,599,326,560,326,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '244'
+ $floorItems2['244'] = i
+ w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,601,389,601,326,643,326,643,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '243'
+ $floorItems2['243'] = i
+ w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,688,316,645,316,645,365,688,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '242'
+ $floorItems2['242'] = i
+ w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,802,367,759,367,759,226,802,226,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Barbecue Deck'
+ $floorItems2['Barbecue Deck'] = i
+ w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,262,755,314,717,314,717,262,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '240'
+ $floorItems2['240'] = i
+ w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,316,689,316,689,365,755,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '241'
+ $floorItems2['241'] = i
+ w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,206,717,206,717,261,755,261,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '239'
+ $floorItems2['239'] = i
+ w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,695,277,643,277,643,206,695,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '248'
+ $floorItems2['248'] = i
+ w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,676,135,676,185,724,185,724,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '236'
+ $floorItems2['236'] = i
+ w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '235'
+ $floorItems2['235'] = i
+ w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,626,143,633,143,633,135,572,135,
+ 572,143,579,143,579,185,626,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '234'
+ $floorItems2['234'] = i
+ w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,135,571,135,571,145,578,145,
+ 578,185,527,185,527,131,557,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '233'
+ $floorItems2['233'] = i
+ w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,249,557,249,557,205,476,205,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '230'
+ $floorItems2['230'] = i
+ w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '232'
+ $floorItems2['232'] = i
+ w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,186,495,186,495,204,476,204,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '229'
+ $floorItems2['229'] = i
+ w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '227'
+ $floorItems2['227'] = i
+ w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '228'
+ $floorItems2['228'] = i
+ w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '226'
+ $floorItems2['226'] = i
+ w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '225'
+ $floorItems2['225'] = i
+ w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,198,306,198,306,249,234,249,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '224'
+ $floorItems2['224'] = i
+ w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '223'
+ $floorItems2['223'] = i
+ w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,268,179,221,179,221,135,268,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '222'
+ $floorItems2['222'] = i
+ w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,177,179,219,179,219,135,177,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '221'
+ $floorItems2['221'] = i
+ w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '204'
+ $floorItems2['204'] = i
+ w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '205'
+ $floorItems2['205'] = i
+ w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,256,385,256,340,212,340,212,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '207'
+ $floorItems2['207'] = i
+ w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,210,340,164,340,164,385,210,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '208'
+ $floorItems2['208'] = i
+ w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,115,340,162,340,162,385,115,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '209'
+ $floorItems2['209'] = i
+ w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,228,89,156,53,156,53,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '217'
+ $floorItems2['217'] = i
+ w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,169,97,169,97,190,89,190,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '217A'
+ $floorItems2['217A'] = i
+ w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '216'
+ $floorItems2['216'] = i
+ w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,179,51,135,6,135,6,179,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '215'
+ $floorItems2['215'] = i
+ w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,227,6,227,6,180,51,180,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '214'
+ $floorItems2['214'] = i
+ w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,275,6,275,6,229,51,229,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '213'
+ $floorItems2['213'] = i
+ w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,114,340,67,340,67,385,114,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '210'
+ $floorItems2['210'] = i
+ w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '211'
+ $floorItems2['211'] = i
+ w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '203'
+ $floorItems2['203'] = i
+ w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198,
+ 154,198,154,192,109,192,109,169,99,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '220'
+ $floorItems2['220'] = i
+ w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Priv Lift2'
+ $floorItems2['Priv Lift2'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Pub Lift 2'
+ $floorItems2['Pub Lift 2'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '218'
+ $floorItems2['218'] = i
+ w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '219'
+ $floorItems2['219'] = i
+ w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '201'
+ $floorItems2['201'] = i
+ w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ w.create(TkcLine,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+end
+
+# floor2_fg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the third
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg3(w,color)
+ i = TkcPolygon.new(w,89,228,89,180,70,180,70,228,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316'
+ $floorItems2['316'] = i
+ w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,115,368,162,368,162,323,115,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '309'
+ $floorItems2['309'] = i
+ w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,164,323,164,368,211,368,211,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '308'
+ $floorItems2['308'] = i
+ w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,256,368,212,368,212,323,256,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '307'
+ $floorItems2['307'] = i
+ w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '305'
+ $floorItems2['305'] = i
+ w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,219,251,203,244,203,244,219,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324B'
+ $floorItems2['324B'] = i
+ w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,249,244,249,244,232,251,232,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324A'
+ $floorItems2['324A'] = i
+ w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,223,135,223,179,177,179,177,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '320'
+ $floorItems2['320'] = i
+ w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,114,368,114,323,67,323,67,368,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '310'
+ $floorItems2['310'] = i
+ w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,277,23,321,68,321,68,277,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '312'
+ $floorItems2['312'] = i
+ w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,229,68,229,68,275,23,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '313'
+ $floorItems2['313'] = i
+ w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,68,227,23,227,23,180,68,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '314'
+ $floorItems2['314'] = i
+ w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,95,179,95,135,23,135,23,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '315'
+ $floorItems2['315'] = i
+ w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,99,226,99,204,91,204,91,226,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316B'
+ $floorItems2['316B'] = i
+ w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,91,202,99,202,99,180,91,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316A'
+ $floorItems2['316A'] = i
+ w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198,
+ 174,198,174,226,101,226,101,179,97,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '319'
+ $floorItems2['319'] = i
+ w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '311'
+ $floorItems2['311'] = i
+ w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '318'
+ $floorItems2['318'] = i
+ w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '317'
+ $floorItems2['317'] = i
+ w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,274,194,274,221,306,221,306,194,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '323'
+ $floorItems2['323'] = i
+ w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,306,222,274,222,274,249,306,249,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '325'
+ $floorItems2['325'] = i
+ w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,263,179,224,179,224,135,263,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '321'
+ $floorItems2['321'] = i
+ w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,314,169,306,169,306,192,273,192,
+ 264,181,264,135,314,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '322'
+ $floorItems2['322'] = i
+ w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = 'Pub Lift3'
+ $floorItems2['Pub Lift3'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = 'Priv Lift3'
+ $floorItems2['Priv Lift3'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '303'
+ $floorItems2['303'] = i
+ w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,272,203,272,249,252,249,252,230,
+ 244,230,244,221,252,221,252,203,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324'
+ $floorItems2['324'] = i
+ w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '304'
+ $floorItems2['304'] = i
+ w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '301'
+ $floorItems2['301'] = i
+ w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,397,246,377,246,377,185,397,185,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '327'
+ $floorItems2['327'] = i
+ w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '326'
+ $floorItems2['326'] = i
+ w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282,
+ 375,274,397,274,397,248,339,248,339,242,308,242,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '302'
+ $floorItems2['302'] = i
+ w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203,
+ 272,193,263,180,242,180,175,180,175,169,156,169,
+ 156,196,177,196,177,228,107,228,70,228,70,275,107,275,
+ 107,248,160,248,160,301,107,301,107,275,70,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '306'
+ $floorItems2['306'] = i
+ w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+end
+
+# Below is the "main program" that creates the floorplan demonstration.
+
+# toplevel widget
+if defined?($floor2_demo) && $floor2_demo
+ $floor2_demo.destroy
+ $floor2_demo = nil
+end
+
+# demo toplevel widget
+$floor2_demo = TkToplevel.new {|w|
+ title("Floorplan Canvas Demonstration 2")
+ iconname("Floorplan2")
+ positionWindow(w)
+ geometry('+20+20')
+ minsize(100,100)
+}
+
+base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+ 'text'=>"This window contains a canvas widget showing the floorplan of Digital Equipment Corporation's Western Research Laboratory. It has three levels. At any given time one of the levels is active, meaning that you can see its room structure. To activate a level, click the left mouse button anywhere on it. As the mouse moves over the active level, the room under the mouse lights up and its room number appears in the \"Room:\" entry. You can also type a room number in the entry and the room will light up."){
+ pack('side'=>'top')
+}
+
+# frame
+$floor2_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $floor2_demo
+ $floor2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'floor2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+#
+$floorLabels2 = {}
+$floorItems2 = {}
+
+# canvas
+if $tk_version =~ /^4\.[01]/
+ $floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
+ 'highlightthickness'=>2)
+ $floor2_canvas = TkCanvas.new($floor2_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ 'highlightthickness'=>0) {|c|
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}){|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ pack('side'=>'bottom', 'fill'=>'x')
+ }
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}){|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ }
+ $floor2_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes')
+ $floor2_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+else
+ TkFrame.new(base_frame) {|f|
+ pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+ h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal')
+ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical')
+
+ TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1|
+ $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500,
+ 'borderwidth'=>0,
+ 'highlightthickness'=>0) {
+ xscrollcommand(proc{|first,last| h.set first,last})
+ yscrollcommand(proc{|first,last| v.set first,last})
+ pack('expand'=>'yes', 'fill'=>'both')
+ }
+ grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ }
+
+ v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ v.command(proc{|*args| $floor2_canvas.yview(*args)})
+ h.command(proc{|*args| $floor2_canvas.xview(*args)})
+ }
+end
+
+
+# Create an entry for displaying and typing in current room.
+
+$currentRoom2 = TkVariable.new
+$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
+ 'bd'=>2, 'textvariable'=>$currentRoom2)
+
+# Choose colors, then fill in the floorplan.
+
+$floor2_colors = {}
+if TkWinfo.depth($floor2_canvas) > 1
+ $floor2_colors['bg1'] = '#a9c1da'
+ $floor2_colors['outline1'] = '#77889a'
+ $floor2_colors['bg2'] = '#9ab0c6'
+ $floor2_colors['outline2'] = '#687786'
+ $floor2_colors['bg3'] = '#8ba0b3'
+ $floor2_colors['outline3'] = '#596673'
+ $floor2_colors['offices'] = 'Black'
+ $floor2_colors['active'] = '#c4d1df'
+else
+ $floor2_colors['bg1'] = 'white'
+ $floor2_colors['outline1'] = 'black'
+ $floor2_colors['bg2'] = 'white'
+ $floor2_colors['outline2'] = 'black'
+ $floor2_colors['bg3'] = 'white'
+ $floor2_colors['outline3'] = 'black'
+ $floor2_colors['offices'] = 'Black'
+ $floor2_colors['active'] = 'black'
+end
+
+$activeFloor2 = ''
+floorDisplay2 $floor2_canvas,3
+
+# Set up event bindings for canvas:
+
+$floor2_canvas.itembind('floor1', '1', proc{floorDisplay2 $floor2_canvas,1})
+$floor2_canvas.itembind('floor2', '1', proc{floorDisplay2 $floor2_canvas,2})
+$floor2_canvas.itembind('floor3', '1', proc{floorDisplay2 $floor2_canvas,3})
+$floor2_canvas.itembind('room', 'Enter', proc{newRoom2 $floor2_canvas})
+$floor2_canvas.itembind('room', 'Leave', proc{$currentRoom2.value = ''})
+$floor2_canvas.bind('2', proc{|x,y| $floor2_canvas.scan_mark x,y}, '%x %y')
+$floor2_canvas.bind('B2-Motion',
+ proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y')
+$floor2_canvas.bind('Destroy', proc{$currentRoom2.unset})
+$currentRoom2.value = ''
+$currentRoom2.trace('w',proc{roomChanged2 $floor2_canvas})
diff --git a/ext/tk/sample/demos-en/form.rb b/ext/tk/sample/demos-en/form.rb
new file mode 100644
index 0000000000..abb3e0e10e
--- /dev/null
+++ b/ext/tk/sample/demos-en/form.rb
@@ -0,0 +1,64 @@
+#
+# form widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($form_demo) && $form_demo
+ $form_demo.destroy
+ $form_demo = nil
+end
+
+# demo toplevel widget
+$form_demo = TkToplevel.new {|w|
+ title("Form Demonstration")
+ iconname("form")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($form_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries."
+}
+msg.pack('side'=>'top', 'fill'=>'x')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $form_demo
+ $form_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'form'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# entry
+form_data = []
+(1..5).each{|i|
+ f = TkFrame.new(base_frame, 'bd'=>2)
+ e = TkEntry.new(f, 'relief'=>'sunken', 'width'=>40)
+ l = TkLabel.new(f)
+ e.pack('side'=>'right')
+ l.pack('side'=>'left')
+ form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l}
+}
+
+#
+form_data[1]['label'].text('Name:')
+form_data[2]['label'].text('Address:')
+form_data[5]['label'].text('Phone:')
+
+# pack
+(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')}
+
diff --git a/ext/tk/sample/demos-en/goldberg.rb b/ext/tk/sample/demos-en/goldberg.rb
new file mode 100644
index 0000000000..d3956ef78c
--- /dev/null
+++ b/ext/tk/sample/demos-en/goldberg.rb
@@ -0,0 +1,2006 @@
+#
+# Ruby/Tk Goldverg demo (called by 'widget')
+#
+# Based on Tcl/Tk8.5a2 widget demos.
+# The following is the original comment of TkGoldberg.tcl.
+#
+#>>##+#################################################################
+#>>#
+#>># TkGoldberg.tcl
+#>># by Keith Vetter, March 13, 2003
+#>>#
+#>># "Man will always find a difficult means to perform a simple task"
+#>># Rube Goldberg
+#>>#
+#>># Reproduced here with permission.
+#>>#
+#>>##+#################################################################
+#>>#
+#>># Keith Vetter 2003-03-21: this started out as a simple little program
+#>># but was so much fun that it grew and grew. So I apologize about the
+#>># size but I just couldn't resist sharing it.
+#>>#
+#>># This is a whizzlet that does a Rube Goldberg type animation, the
+#>># design of which comes from an New Years e-card from IncrediMail.
+#>># That version had nice sound effects which I eschewed. On the other
+#>># hand, that version was in black and white (actually dark blue and
+#>># light blue) and this one is fully colorized.
+#>>#
+#>># One thing I learned from this project is that drawing filled complex
+#>># objects on a canvas is really hard. More often than not I had to
+#>># draw each item twice--once with the desired fill color but no
+#>># outline, and once with no fill but with the outline. Another trick
+#>># is erasing by drawing with the background color. Having a flood fill
+#>># command would have been extremely helpful.
+#>>#
+#>># Two wiki pages were extremely helpful: Drawing rounded rectangles
+#>># which I generalized into Drawing rounded polygons, and regular
+#>># polygons which allowed me to convert ovals and arcs into polygons
+#>># which could then be rotated (see Canvas Rotation). I also wrote
+#>># Named Colors to aid in the color selection.
+#>>#
+#>># I could comment on the code, but it's just 26 state machines with
+#>># lots of canvas create and move calls.
+
+if defined?($goldberg_demo) && $goldberg_demo
+ $goldberg_demo.destroy
+ $goldberg_demo = nil
+end
+
+# demo toplevel widget
+$goldberg_demo = TkToplevel.new {|w|
+ title("Tk Goldberg (demonstration)")
+ iconname("goldberg")
+# positionWindow(w)
+}
+
+base_frame = TkFrame.new($goldberg_demo).pack(:fill=>:both, :expand=>true)
+
+=begin
+# label
+msg = TkLabel.new($goldberg_demo) {
+ font 'Arial 10'
+ wraplength '4i'
+ justify 'left'
+ text "This is a demonstration of just how complex you can make your animations become. Click the ball to start things moving!\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg"
+}
+msg.pack('side'=>'top')
+=end
+
+=begin
+# frame
+TkFrame.new($goldberg_demo) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $goldberg_demo
+ $goldberg_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'goldberg'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+=end
+
+#########################################
+
+class TkGoldberg_Demo
+ def initialize(parent)
+ @parent = parent
+
+ @S = {}
+ @S['title'] = 'Tk Goldberg'
+ @S['speed'] = TkVariable.new(5)
+ @S['cnt'] = TkVariable.new(0)
+ @S['message'] = TkVariable.new("\\nWelcome\\nto\\nRuby/Tk")
+ @S['pause'] = TkVariable.new
+ @S['details'] = TkVariable.new(true)
+
+ @S['mode'] = TkVariable.new(:MSTART, :symbol)
+ # :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG
+
+ # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
+ @speed = [1, 10, 20, 50, 80, 100, 150, 200, 300, 400, 500]
+
+ # colors
+ @C = {}
+ @C['fg'] = 'black'
+ # @C['bg'] = 'gray75'
+ @C['bg'] = 'cornflowerblue'
+
+ @C['0'] = 'white'; @C['1a'] = 'darkgreen'; @C['1b'] = 'yellow'
+ @C['2'] = 'red'; @C['3a'] = 'green'; @C['3b'] = 'darkblue'
+ @C['4'] = @C['fg']; @C['5a'] = 'brown'; @C['5b'] = 'white'
+ @C['6'] = 'magenta'; @C['7'] = 'green'; @C['8'] = @C['fg']
+ @C['9'] = 'blue4'; @C['10a'] = 'white'; @C['10b'] = 'cyan'
+ @C['11a'] = 'yellow'; @C['11b'] = 'mediumblue'; @C['12'] = 'tan2'
+ @C['13a'] = 'yellow'; @C['13b'] = 'red'; @C['14'] = 'white'
+ @C['15a'] = 'green'; @C['15b'] = 'yellow'; @C['16'] = 'gray65'
+ @C['17'] = '#A65353'; @C['18'] = @C['fg']; @C['19'] = 'gray50'
+ @C['20'] = 'cyan'; @C['21'] = 'gray65'; @C['22'] = @C['20']
+ @C['23a'] = 'blue'; @C['23b'] = 'red'; @C['23c'] = 'yellow'
+ @C['24a'] = 'red'; @C['24b'] = 'white';
+
+ @STEP = TkVariable.new_hash
+ @STEP.default_value_type = :numeric
+
+ @XY = {}
+
+ @XY6 = {
+ '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192],
+ '-5'=>[340, 190], '-6'=>[349, 177], '-7'=>[366, 177], '-8'=>[380, 176],
+ '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164],
+ '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151],
+ '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219],
+ '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324],
+ '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346],
+ '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391],
+ '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456],
+ '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443],
+ '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437],
+ '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424],
+ '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412],
+ '13,15'=>[376, 410], '13,16'=>[360, 403]
+ }
+
+ @timer = TkTimer.new(@speed[@S['speed'].numeric]){|timer|
+ timer.set_interval(go)
+ }
+
+ do_display
+ reset
+
+ # Start everything going
+ @timer.start
+ end
+
+ def do_display()
+ @ctrl = TkFrame.new(@parent, :relief=>:ridge, :bd=>2, :padx=>5, :pady=>5)
+ @screen = TkFrame.new(@parent, :bd=>2,
+ :relief=>:raised).pack(:side=>:left, :fill=>:both,
+ :expand=>true)
+
+ @canvas = TkCanvas.new(@parent, :width=>850, :height=>700,
+ :bg=>@C['bg'], :highlightthickness=>0){
+ scrollregion([0, 0, 1000, 1000]) # Kludge to move everything up
+ yview_moveto(0.05)
+ }.pack(:in=>@screen, :side=>:top, :fill=>:both, :expand=>true)
+
+ @canvas.bind('3'){ @pause.invoke }
+ @canvas.bind('Destroy'){ @timer.stop }
+
+ do_ctrl_frame
+ do_detail_frame
+
+ # msg = TkLabel.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ msg = Tk::Label.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ font 'Arial 10'
+ wraplength 600
+ justify 'left'
+ text "This is a demonstration of just how complex you can make your animations become. Click the ball to start things moving!\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg"
+ }
+ msg.place(:in=>@canvas, :relx=>0, :rely=>0, :anchor=>:nw)
+
+ frame = TkFrame.new(@parent, :bg=>@C['bg'])
+
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $goldberg_demo
+ $goldberg_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left')
+
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ text 'See Code'
+ command proc{showCode 'goldberg'}
+ }.pack('side'=>'left', 'padx'=>5)
+
+ # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ :bg=>@C['bg'], :activebackground=>@C['bg'])
+ @show.pack('side'=>'left')
+ frame.place(:in=>@canvas, :relx=>1, :rely=>0, :anchor=>:ne)
+
+ Tk.update
+ end
+
+ def do_ctrl_frame
+ @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6,
+ :command=>proc{do_button(0)})
+ if font = @start['font']
+ @start.font(font.weight('bold'))
+ end
+
+ @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font,
+ :command=>proc{do_button(1)}, :relief=>:raised,
+ :variable=>@S['pause'])
+
+ @step = TkButton.new(@parent, :text=>'Single Step', :font=>font,
+ :command=>proc{do_button(2)})
+ @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
+ :command=>proc{do_button(4)})
+ @reset = TkButton.new(@parent, :text=>'Reset', :font=>font,
+ :command=>proc{do_button(3)})
+
+ @details = TkFrame.new(@parent, :bd=>2, :relief=>:ridge)
+ @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font,
+ :relief=>:raised, :variable=>@S['details'])
+
+ @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'],
+ :justify=>:center)
+ @speed_scale = TkScale.new(@parent, :orient=>:horizontal,
+ :from=>1, :to=>10, :font=>font,
+ :variable=>@S['speed'], :bd=>2,
+ :relief=>:ridge, :showvalue=>false)
+ @about = TkButton.new(@parent, :text=>'About',
+ :command=>proc{about}, :font=>font)
+
+ Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(1, :minsize=>10)
+ Tk.grid(@pause, :in=>@ctrl, :row=>2, :sticky=>:ew)
+ Tk.grid(@step, :in=>@ctrl, :sticky=>:ew)
+ Tk.grid(@bstep, :in=>@ctrl, :sticky=>:ew)
+ Tk.grid(@reset, :in=>@ctrl, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(10, :minsize=>20)
+ Tk.grid(@details, :in=>@ctrl, :row=>11, :sticky=>:ew)
+ Tk.grid(@detail, :in=>@details, :row=>0, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(50, :weight=>1)
+
+ @S['mode'].trace('w', proc{|*args| active_GUI(*args)})
+ @S['details'].trace('w', proc{|*args| active_GUI(*args)})
+ @S['speed'].trace('w', proc{|*args| active_GUI(*args)})
+
+ Tk.grid(@msg_entry, :in=>@ctrl, :row=>98, :sticky=>:ew, :pady=>5)
+ Tk.grid(@speed_scale, :in=>@ctrl, :row=>99, :sticky=>:ew)
+ Tk.grid(@about, :in=>@ctrl, :row=>100, :sticky=>:ew)
+
+ @reset.bind('3'){@S['mode'].value = -1} # Debugging
+ end
+
+ def do_detail_frame
+ @f_details = TkFrame.new(@details)
+
+ @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'],
+ :bd=>1, :relief=>:solid, :bg=>'white')
+ Tk.grid(@label, '-', '-', '-', :sticky=>:ew, :row=>0)
+
+ idx = 1
+ loop {
+ break unless respond_to?("move#{idx}")
+ l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e,
+ :width=>2, :bd=>1, :relief=>:solid, :bg=>'white')
+ @STEP[idx] = 0
+ ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx),
+ :width=>5, :bd=>1, :relief=>:solid, :bg=>'white')
+ row = (idx + 1)/2
+ col = ((idx + 1) & 1) * 2
+ Tk.grid(l, :sticky=>:ew, :row=>row, :column=>col)
+ Tk.grid(ll, :sticky=>:ew, :row=>row, :column=>(col + 1))
+ idx += 1
+ }
+ @f_details.grid_columnconfigure(1, :weight=>1)
+ end
+
+ def show_ctrl
+ if @ctrl.winfo_mapped?
+ @ctrl.pack_forget
+ @show.text('>>')
+ else
+ @ctrl.pack(:side=>:right, :fill=>:both, :ipady=>5)
+ @show.text('<<')
+ end
+ end
+
+ def draw_all
+ reset_step
+ @canvas.delete(:all)
+ idx = 0
+ loop{
+ m = "draw#{idx}"
+ break unless respond_to?(m)
+ send(m)
+ idx += 1
+ }
+ end
+
+ def active_GUI(var1, var2, op)
+ st = {false=>:disabled, true=>:normal}
+
+ m = @S['mode'].to_sym
+ @S['pause'].value = (m == :MPAUSE)
+ @start.state(st[m != :MGO])
+ @pause.state(st[m != :MSTART && m != :MDONE])
+ @step.state(st[m != :MGO && m != :MDONE])
+ @bstep.state(st[m != :MGO && m != :MDONE])
+ @reset.state(st[m != :MSTART])
+
+ if @S['details'].bool
+ Tk.grid(@f_details, :in=>@details, :row=>2, :sticky=>:ew)
+ else
+ Tk.grid_forget(@f_details)
+ end
+ @speed_scale.label("Speed: #{@S['speed'].value}")
+ end
+
+ def start
+ @S['mode'].value = :MGO
+ end
+
+ def do_button(what)
+ case what
+ when 0 # Start
+ reset if @S['mode'].to_sym == :MDONE
+ @S['mode'].value = :MGO
+
+ when 1 # Pause
+ @S['mode'].value = ((@S['pause'].bool)? :MPAUSE: :MGO)
+
+ when 2 # Step
+ @S['mode'].value = :MSSTEP
+
+ when 3 # Reset
+ reset
+
+ when 4 # Big step
+ @S['mode'].value = :MBSTEP
+ end
+ end
+
+ def go(who = nil)
+ now = Tk::Clock.clicks(:miliseconds)
+ if who # Start here for debugging
+ @S['active'] = [who]
+ @S['mode'].value = :MGO
+ end
+ return if @S['mode'].to_sym == :MDEBUG # Debugging
+ # If not paused, do the next move
+ n = next_step if @S['mode'].to_sym != :MPAUSE
+ @S['mode'].value = :MPAUSE if @S['mode'].to_sym == :MSSTEP # Single step
+ @S['mode'].value = :MSSTEP if @S['mode'].to_sym == :MBSTEP && n # big step
+ elapsed = Tk::Clock.clicks(:miliseconds) - now
+ delay = @speed[@S['speed'].to_i] - elapsed
+ delay = 1 if delay <= 0
+ return delay
+ end
+
+ def next_step
+ retval = false # Return value
+
+ if @S['mode'].to_sym != :MSTART && @S['mode'].to_sym != :MDONE
+ @S['cnt'].numeric += 1
+ end
+ alive = []
+ @S['active'].each{|who|
+ who = who.to_i
+ n = send("move#{who}")
+ if (n & 1).nonzero? # This guy still alive
+ alive << who
+ end
+ if (n & 2).nonzero? # Next guy is active
+ alive << (who + 1)
+ retval = true
+ end
+ if (n & 4).nonzero? # End of puzzle flag
+ @S['mode'].value = :MDONE # Done mode
+ @S['active'] = [] # No more animation
+ return true
+ end
+ }
+ @S['active'] = alive
+ return retval
+ end
+
+ def about
+ msg = "Ruby/Tk Version ::\nby Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)\n\n"
+ msg += "Original Version ::\n"
+ msg += "#{@S['title']}\nby Keith Vetter, March 2003\n(Reproduced by kind permission of the author)\n\n"
+ msg += "Man will always find a difficult means to perform a simple task"
+ msg += "\nRube Goldberg"
+ Tk.messageBox(:message=>msg, :title=>'About')
+ end
+
+ ################################################################
+ #
+ # All the drawing and moving routines
+ #
+
+ # START HERE! banner
+ def draw0
+ color = @C['0']
+ TkcText.new(@canvas, [579, 119], :text=>'START HERE!',
+ :fill=>color, :anchor=>:w,
+ :tag=>'I0', :font=>['Times Roman', 12, :italic, :bold])
+ TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color,
+ :width=>5, :arrow=>:last, :arrowshape=>[18, 18, 5])
+ @canvas.itembind('I0', '1'){ start }
+ end
+
+ def move0(step = nil)
+ step = get_step(0, step)
+
+ if @S['mode'].to_sym != :MSTART # Start the ball rolling
+ move_abs('I0', [-100, -100]) # Hide the banner
+ return 2
+ end
+
+ pos = [
+ [673, 119], [678, 119], [683, 119], [688, 119],
+ [693, 119], [688, 119], [683, 119], [678, 119]
+ ]
+ step = step % pos.length
+ move_abs('I0', pos[step])
+ return 1
+ end
+
+ # Dropping ball
+ def draw1
+ color = @C['1a']
+ color2 = @C['1b']
+ TkcPolygon.new(@canvas,
+ [ 844, 133, 800, 133, 800, 346, 820, 346,
+ 820, 168, 844, 168, 844, 133 ],
+ :width=>3, :fill=>color, :outline=>'')
+ TkcPolygon.new(@canvas,
+ [ 771, 133, 685, 133, 685, 168, 751, 168,
+ 751, 346, 771, 346, 771, 133 ],
+ :width=>3, :fill=>color, :outline=>'')
+ TkcOval.new(@canvas, box(812, 122, 9),
+ :tag=>'I1', :fill=>color2, :outline=>'')
+
+ @canvas.itembind('I1', '1'){ start }
+ end
+
+ def move1(step = nil)
+ step = get_step(1, step)
+ pos = [
+ [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153],
+ [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438],
+ [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601],
+ [-100, -100]
+ ]
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I1', where)
+ move15a if where[2] == :y
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Lighting the match
+ def draw2
+ color = @C['2']
+
+ # Fulcrum
+ TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
+ :fill=>@C['fg'], :outline=>@C['fg'])
+
+ # Strike box
+ TkcRectangle.new(@canvas, [628, 335, 660, 383],
+ :fill=>'', :outline=>@C['fg'])
+ (0..2).each{|y|
+ yy = 335 + y*16
+ TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25',
+ :anchor=>:nw, :foreground=>@C['fg'])
+ TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
+ :anchor=>:nw, :foreground=>@C['fg'])
+ }
+
+ # Lever
+ TkcLine.new(@canvas, [702, 366, 798, 366],
+ :fill=>@C['fg'], :width=>6, :tag=>'I2_0')
+
+ # R strap
+ TkcLine.new(@canvas, [712, 363, 712, 355],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_1')
+
+ # L strap
+ TkcLine.new(@canvas, [705, 363, 705, 355],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_2')
+
+ # Match stick
+ TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_3')
+
+ # Match head
+ TkcPolygon.new(@canvas,
+ [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1,
+ 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ],
+ :fill=>color, :outline=>color, :tag=>'I2_4')
+ end
+
+ def move2(step = nil)
+ step = get_step(2, step)
+
+ stages = [0, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1]
+ xy = []
+ xy[0] = [
+ 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307,
+ 662, 318, 662, 328, 671, 336
+ ]
+ xy[1] = [
+ 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311,
+ 661, 327, 671, 335
+ ]
+ xy[2] = [
+ 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298,
+ 666, 309, 660, 324, 672, 336
+ ]
+
+ if step >= stages.length
+ @canvas.delete('I2')
+ return 0
+ end
+
+ if step == 0 # Rotate the match
+ beta = 20
+
+ ox, oy = anchor('I2_0', :s) # Where to pivot
+
+ i = 0
+ until @canvas.find_withtag("I2_#{i}").empty?
+ rotate_item("I2_#{i}", ox, oy, beta)
+ i += 1
+ end
+
+ # For the flame
+ TkcPolygon.new(@canvas, [], :tag=>'I2', :smooth=>true, :fill=>@C['2'])
+
+ return 1
+ end
+ @canvas.coords('I2', xy[stages[step]])
+ return ((step == 7)? 3: 1)
+ end
+
+ # Weight and pulleys
+ def draw3
+ color = @C['3a']
+ color2 = @C['3b']
+
+ xy = [ [602, 296], [577, 174], [518, 174] ]
+ xy.each{|x, y| # 3 Pulleys
+ TkcOval.new(@canvas, box(x, y, 13),
+ :fill=>color, :outline=>@C['fg'], :width=>3)
+ TkcOval.new(@canvas, box(x, y, 2), :fill=>@C['fg'], :outline=>@C['fg'])
+ }
+
+ # Wall to flame
+ TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+
+ # Flame to pulley 1
+ TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+ TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+
+ # Pulley 1 half way to 2
+ TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2',
+ :width=>3, :fill=>@C['fg'])
+
+ # Pulley 1 other half to 2
+ TkcLine.new(@canvas, [589, 235, 589, 174], :width=>3, :fill=>@C['fg'])
+
+ # Across the top
+ TkcLine.new(@canvas, [577, 161, 518, 161], :width=>3, :fill=>@C['fg'])
+
+ # Down to weight
+ TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w',
+ :width=>3, :fill=>@C['fg'])
+
+ # Draw the weight as 2 circles, two rectangles and 1 rounded rectangle
+ x1, y1, x2, y2 = [515, 207, 495, 207]
+ TkcOval.new(@canvas, box(x1, y1, 6),
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+ TkcOval.new(@canvas, box(x2, y2, 6),
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+ TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6,
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+
+ TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15),
+ :smooth=>true, :tag=>'I3_', :fill=>color2, :outline=>color2)
+
+ TkcLine.new(@canvas, [500, 217, 511, 217],
+ :tag=>'I3_', :fill=>color2, :width=>10)
+
+ # Bottom weight target
+ TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465],
+ :tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10)
+ end
+
+ def move3(step = nil)
+ step = get_step(3, step)
+
+ pos = [ [505, 247], [505, 297], [505, 386.5], [505, 386.5] ]
+ rope = []
+ rope[0] = [750, 309, 729, 301, 711, 324, 690, 300]
+ rope[1] = [750, 309, 737, 292, 736, 335, 717, 315, 712, 320]
+ rope[2] = [750, 309, 737, 309, 740, 343, 736, 351, 725, 340]
+ rope[3] = [750, 309, 738, 321, 746, 345, 742, 356]
+
+ return 0 if step >= pos.length
+
+ @canvas.delete("I3_#{step}") # Delete part of the rope
+ move_abs('I3_', pos[step]) # Move weight down
+ @canvas.coords('I3_s', rope[step]) # Flapping rope end
+ @canvas.coords('I3_w', [505, 174].concat(pos[step]))
+ if step == 2
+ @canvas.move('I3__', 0, 30)
+ return 2
+ end
+ return 1
+ end
+
+ # Cage and door
+ def draw4
+ color = @C['4']
+ x0, y0, x1, y1 = [527, 356, 611, 464]
+
+ # Horizontal bars
+ y0.step(y1, 12){|y|
+ TkcLine.new(@canvas, [x0, y, x1, y], :fill=>color, :width=>1)
+ }
+
+ # Vertical bars
+ x0.step(x1, 12){|x|
+ TkcLine.new(@canvas, [x, y0, x, y1], :fill=>color, :width=>1)
+ }
+
+ # Swing gate
+ TkcLine.new(@canvas, [518, 464, 518, 428],
+ :tag=>'I4', :fill=>color, :width=>1)
+ end
+
+ def move4(step = nil)
+ step = get_step(4, step)
+
+ angles = [-10, -20, -30, -30]
+ return 0 if step >= angles.length
+
+ rotate_item('I4', 518, 464, angles[step])
+ @canvas.raise('I4')
+
+ return((step == 3)? 3: 1)
+ end
+
+ # Mouse
+ def draw5
+ color = @C['5a']
+ color2 = @C['5b']
+
+ xy = [377, 248, 410, 248, 410, 465, 518, 465] # Mouse course
+ xy.concat [518, 428, 451, 428, 451, 212, 377, 212]
+
+ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3)
+
+ xy = [
+ 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446,
+ 575, 452, 574, 454, 566, 456, 554, 456, 545, 456, 537, 454, 530, 452
+ ]
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_0'], :fill=>color)
+
+ TkcLine.new(@canvas, [573, 452, 592, 458, 601, 460, 613, 456], # Tail
+ :tag=>['I5', 'I5_1'], :fill=>color, :smooth=>true, :width=>3)
+
+ xy = box(540, 446, 2) # Eye
+ xy = [540, 444, 541, 445, 541, 447, 540, 448, 538, 447, 538, 445]
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'],
+ :outline=>'', :smooth=>true)
+
+ xy = [538, 454, 535, 461] # Front leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_3'], :fill=>color, :width=>2)
+
+ xy = [566, 455, 569, 462] # Back leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_4'], :fill=>color, :width=>2)
+
+ xy = [544, 455, 545, 460] # 2nd front leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_5'], :fill=>color, :width=>2)
+
+ xy = [560, 455, 558, 460] # 2nd back leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_6'], :fill=>color, :width=>2)
+ end
+
+ def move5(step = nil)
+ step = get_step(5, step)
+
+ pos = [
+ [553, 452], [533, 452], [513, 452], [493, 452], [473, 452],
+ [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414],
+ [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294],
+ [422, 274, -30], [422, 260.5, -30, :x], [422.5, 248.5, -28], [425, 237]
+ ]
+
+ return 0 if step >= pos.length
+
+ x, y, beta, nxt = pos[step]
+ move_abs('I5', [x, y])
+ if beta
+ ox, oy = centroid('I5_0')
+ (0..6).each{|id| rotate_item("I5_#{id}", ox, oy, beta) }
+ end
+ return 3 if nxt == :x
+ return 1
+ end
+
+ # Dropping gumballs
+ def draw6
+ color = @C['6']
+ xy = [324, 130, 391, 204] # Ball holder
+ xy = round_rect(xy, 10)
+ TkcPolygon.new(@canvas, xy, :smooth=>true,
+ :outline=>@C['fg'], :width=>3, :fill=>color)
+ xy = [339, 204, 376, 253] # Below the ball holder
+ TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3,
+ :fill=>color, :tag=>'I6c')
+ xy = box(346, 339, 28)
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') # Roter
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
+ :start=>80, :extent=>205)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
+ :start=>-41, :extent=>85)
+
+ xy = box(346, 339, 15) # Center of rotor
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['fg'], :tag=>'I6m')
+ xy = [352, 312, 352, 254, 368, 254, 368, 322] # Top drop to rotor
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'')
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2)
+
+ xy = [353, 240, 367, 300] # Poke bottom hole
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+ xy = [341, 190, 375, 210] # Poke another hole
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+
+ xy = [
+ 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
+ 352, 403, 352, 366
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'',
+ :width=>2) # Below rotor
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2)
+ xy = box(275, 342, 7) # On/off rotor
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['fg'])
+ xy = [276, 334, 342, 325] # Fan belt top
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [276, 349, 342, 353] # Fan belt bottom
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = [337, 212, 337, 247] # What the mouse pushes
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I6_')
+ xy = [392, 212, 392, 247]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I6_')
+ xy = [337, 230, 392, 230]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>7, :tag=>'I6_')
+
+ who = -1 # All the balls
+ colors = %w(red cyan orange green blue darkblue)
+ colors *= 3
+
+ (0..16).each{|i|
+ loc = -i
+ color = colors[i]
+ x, y = @XY6["#{loc}"]
+ TkcOval.new(@canvas, box(x, y, 5),
+ :fill=>color, :outline=>color, :tag=>"I6_b#{i}")
+ }
+ draw6a(12) # The wheel
+ end
+
+ def draw6a(beta)
+ @canvas.delete('I6_0')
+ ox, oy = [346, 339]
+ (0..3).each{|i|
+ b = beta + i * 45
+ x, y = rotate_c(28, 0, 0, 0, b)
+ xy = [ox + x, oy + y, ox - x, oy - y]
+ TkcLine.new(@canvas, xy, :tag=>'I6_0', :fill=>@C['fg'], :width=>2)
+ }
+ end
+
+ def move6(step = nil)
+ step = get_step(6, step)
+
+ return 0 if step > 62
+
+ if step < 2 # Open gate for balls to drop
+ @canvas.move('I6_', -7, 0)
+ if step == 1 # Poke a hole
+ xy = [348, 226, 365, 240]
+ TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill),
+ :outline=>'')
+ end
+ return 1
+ end
+
+ s = step - 1 # Do the gumball drop dance
+ (0..(((s - 1)/3).to_i)).each{|i|
+ tag = "I6_b#{i}"
+ break if @canvas.find_withtag(tag).empty?
+ loc = s - 3*i
+
+ if @XY6["#{loc},#{i}"]
+ move_abs(tag, @XY6["#{loc},#{i}"])
+ elsif @XY6["#{loc}"]
+ move_abs(tag, @XY6["#{loc}"])
+ end
+ }
+ if s % 3 == 1
+ first = (s + 2)/3
+ i = first
+ loop {
+ tag = "I6_b#{i}"
+ break if @canvas.find_withtag(tag).empty?
+ loc = first - i
+ move_abs(tag, @XY6["#{loc}"])
+ i += 1
+ }
+ end
+ if s >= 3 # Rotate the motor
+ idx = s % 3
+ draw6a(12 + s * 15)
+ end
+ return((s == 3)? 3 : 1)
+ end
+
+ # On/off switch
+ def draw7
+ color = @C['7']
+ xy = [198, 306, 277, 374] # Box
+ TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2,
+ :fill=>color, :tag=>'I7z')
+ @canvas.lower('I7z')
+ xy = [275, 343, 230, 349]
+ TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last,
+ :arrowshape=>[23, 23, 8], :width=>6)
+ xy = [225, 324] # On button
+ x, y = xy
+ TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg'])
+ xy = [218, 323] # On text
+ font = ['Times Roman', 8]
+ TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e,
+ :fill=>@C['fg'], :font=>font)
+ xy = [225, 350] # Off button
+ x, y = xy
+ TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg'])
+ xy = [218, 349] # Off text
+ TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e,
+ :fill=>@C['fg'], :font=>font)
+ end
+
+ def move7(step = nil)
+ step = get_step(7, step)
+
+ numsteps = 30
+ return 0 if step > numsteps
+ beta = 30.0 / numsteps
+ rotate_item('I7', 275, 343, beta)
+
+ return((step == numsteps)? 3: 1)
+ end
+
+ # Electricity to the fan
+ def draw8
+ sine([271, 248, 271, 306], 5, 8, :tag=>'I8_s', :fill=>@C['8'], :width=>3)
+ end
+
+ def move8(step = nil)
+ step = get_step(8, step)
+
+ return 0 if step > 3
+ if step == 0
+ sparkle(anchor('I8_s', :s), 'I8')
+ return 1
+ elsif step == 1
+ move_abs('I8', anchor('I8_s', :c))
+ elsif step == 2
+ move_abs('I8', anchor('I8_s', :n))
+ else
+ @canvas.delete('I8')
+ end
+ return((step == 2)? 3: 1)
+ end
+
+ # Fan
+ def draw9
+ color = @C['9']
+ xy = [266, 194, 310, 220]
+ TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
+ xy = [280, 209, 296, 248]
+ TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
+ xy = [
+ 288, 249, 252, 249, 260, 240, 280, 234,
+ 296, 234, 316, 240, 324, 249, 288, 249
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true)
+
+ xy = [248, 205, 265, 214, 264, 205, 265, 196] # Spinner
+ TkcPolygon.new(@canvas, xy, :fill=>color)
+
+ xy = [255, 206, 265, 234] # Fan blades
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I9_0')
+ xy = [255, 176, 265, 204]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I9_0')
+ xy = [255, 206, 265, 220]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>1, :tag=>'I9_1')
+ xy = [255, 190, 265, 204]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>1, :tag=>'I9_1')
+ end
+
+ def move9(step = nil)
+ step = get_step(9, step)
+
+ if (step & 1).nonzero?
+ @canvas.itemconfigure('I9_0', :width=>4)
+ @canvas.itemconfigure('I9_1', :width=>1)
+ @canvas.lower('I9_1', 'I9_0')
+ else
+ @canvas.itemconfigure('I9_0', :width=>1)
+ @canvas.itemconfigure('I9_1', :width=>4)
+ @canvas.lower('I9_0', 'I9_1')
+ end
+ return 3 if step == 0
+ return 1
+ end
+
+ # Boat
+ def draw10
+ color = @C['10a']
+ color2 = @C['10b']
+ xy = [191, 230, 233, 230, 233, 178, 191, 178] # Sail
+ TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'],
+ :tag=>'I10')
+ xy = box(209, 204, 31) # Front
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie,
+ :start=>120, :extent=>120, :tag=>'I10')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>120, :extent=>120, :tag=>'I10')
+ xy = box(249, 204, 31) # Back
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3,
+ :style=>:pie, :start=>120, :extent=>120, :tag=>'I10')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>120, :extent=>120, :tag=>'I10')
+
+ xy = [200, 171, 200, 249] # Mast
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
+ xy = [159, 234, 182, 234] # Bow sprit
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
+ xy = [180, 234, 180, 251, 220, 251] # Hull
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>6, :tag=>'I10')
+
+ xy = [92, 255, 221, 255] # Waves
+ sine(xy, 2, 25, :fill=>color2, :width=>1, :tag=>'I10w')
+
+ xy = @canvas.coords('I10w')[4..-5] # Water
+ xy.concat([222, 266, 222, 277, 99, 277])
+ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>color2)
+ xy = [222, 266, 222, 277, 97, 277, 97, 266] # Water bottom
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = box(239, 262, 17)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>95, :extent=>103)
+ xy = box(76, 266, 21)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :extent=>190)
+ end
+
+ def move10(step = nil)
+ step = get_step(10, step)
+
+ pos = [
+ [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212],
+ [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212],
+ [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212],
+ [116, 212], [111, 212]
+ ]
+
+ return 0 if step >= pos.length
+
+ where = pos[step]
+ move_abs('I10', where)
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # 2nd ball drop
+ def draw11
+ color = @C['11a']
+ color2 = @C['11b']
+ xy = [23, 264, 55, 591] # Color the down tube
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+ xy = box(71, 460, 48) # Color the outer loop
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'')
+
+ xy = [55, 264, 55, 458] # Top right side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [55, 504, 55, 591] # Bottom right side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = box(71, 460, 48) # Outer loop
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>110, :extent=>-290, :tag=>'I11i')
+ xy = box(71, 460, 16) # Inner loop
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'',
+ :width=>3, :tag=>'I11i')
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['bg'], :width=>3)
+
+ xy = [23, 264, 23, 591] # Left side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = box(1, 266, 23) # Top left curve
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3,
+ :style=>:arc, :extent=>90)
+
+ xy = box(75, 235, 9) # The ball
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'',
+ :width=>3, :tag=>'I11')
+ end
+
+ def move11(step = nil)
+ step = get_step(11, step)
+
+ pos = [
+ [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266],
+ [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472],
+ [100, 437], [65, 423], [-100, -100], [38, 505], [38, 527, :x], [38, 591]
+ ]
+
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I11', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Hand
+ def draw12
+ xy = [
+ 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590,
+ 60, 590, 60, 610, 60, 610
+ ]
+ xy.concat([60, 610, 65, 620, 60, 631]) # Thumb
+ xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669,
+ 56, 669, 50, 669, 50, 662, 50, 637])
+
+ y0 = 637 # Bumps for fingers
+ y1 = 645
+ 50.step(21, -10){|x|
+ x1 = x - 5
+ x2 = x - 10
+ xy << x << y0 << x1 << y1 << x2 << y0
+ }
+ TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
+ :smooth=>true, :tag=>'I12', :width=>3)
+ end
+
+ def move12(step = nil)
+ step = get_step(12, step)
+
+ pos = [[42.5, 641, :x]]
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I12', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Fax
+ def draw13
+ color = @C['13a']
+ xy = [86, 663, 149, 663, 149, 704, 50, 704, 50, 681, 64, 681, 86, 671]
+ xy2 = [
+ 784, 663, 721, 663, 721, 704, 820, 704, 820, 681, 806, 681, 784, 671
+ ]
+ radii = [2, 9, 9, 8, 5, 5, 2]
+
+ round_poly(@canvas, xy, radii, :width=>3,
+ :outline=>@C['fg'], :fill=>color)
+ round_poly(@canvas, xy2, radii, :width=>3,
+ :outline=>@C['fg'], :fill=>color)
+
+ xy = [56, 677]
+ x, y = xy
+ TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I13')
+ xy = [809, 677]
+ x, y = xy
+ TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I13R')
+
+ xy = [112, 687] # Label
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
+ :font=>['Times Roman', 12, :bold])
+ xy = [762, 687]
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
+ :font=>['Times Roman', 12, :bold])
+
+ xy = [138, 663, 148, 636, 178, 636] # Paper guide
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3)
+ xy = [732, 663, 722, 636, 692, 636]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3)
+
+ sine([149, 688, 720, 688], 5, 15,
+ :tag=>'I13_s', :fill=>@C['fg'], :width=>3)
+ end
+
+ def move13(step = nil)
+ step = get_step(13, step)
+
+ numsteps = 7
+
+ if step == numsteps + 2
+ move_abs('I13_star', [-100, -100])
+ @canvas.itemconfigure('I13R', :fill=>@C['13b'], :width=>2)
+ return 2
+ end
+ if step == 0 # Button down
+ @canvas.delete('I13')
+ sparkle([-100, -100], 'I13_star') # Create off screen
+ return 1
+ end
+ x0, y0 = anchor('I13_s', :w)
+ x1, y1 = anchor('I13_s', :e)
+ x = x0 + (x1 - x0) * (step - 1) / numsteps.to_f
+ move_abs('I13_star', [x, y0])
+ return 1
+ end
+
+ # Paper in fax
+ def draw14
+ color = @C['14']
+ xy = [102, 661, 113, 632, 130, 618] # Left paper edge
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14L_0')
+ xy = [148, 629, 125, 640, 124, 662] # Right paper edge
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14L_1')
+ draw14a('L')
+
+ xy = [
+ 768.0, 662.5, 767.991316225, 662.433786215, 767.926187912, 662.396880171
+ ]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14R_0')
+ @canvas.lower('I14R_0')
+ # NB. these numbers are VERY sensitive, you must start with final size
+ # and shrink down to get the values
+ xy = [
+ 745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5
+ ]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14R_1')
+ @canvas.lower('I14R_1')
+ end
+
+ def draw14a(side)
+ color = @C['14']
+ xy = @canvas.coords("I14#{side}_0")
+ xy2 = @canvas.coords("I14#{side}_1")
+ x0, y0, x1, y1, x2, y2 = xy
+ x3, y3, x4, y4, x5, y5 = xy2
+
+ zz = [
+ x0, y0, x0, y0, xy, x2, y2, x2, y2,
+ x3, y3, x3, y3, xy2, x5, y5, x5, y5
+ ].flatten
+ @canvas.delete("I14#{side}")
+ TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true,
+ :fill=>color, :outline=>color, :width=>3)
+ @canvas.lower("I14#{side}")
+ end
+
+ def move14(step = nil)
+ step = get_step(14, step)
+
+ # Paper going down
+ sc = 0.9 - 0.05*step
+ if sc < 0.3
+ @canvas.delete('I14L')
+ return 0
+ end
+
+ ox, oy = @canvas.coords('I14L_0')
+ @canvas.scale('I14L_0', ox, oy, sc, sc)
+ ox, oy = @canvas.coords('I14L_1')[-2..-1]
+ @canvas.scale('I14L_1', ox, oy, sc, sc)
+ draw14a('L')
+
+ # Paper going up
+ sc = 0.35 + 0.05*step
+ sc = 1/sc
+
+ ox, oy = @canvas.coords('I14R_0')
+ @canvas.scale('I14R_0', ox, oy, sc, sc)
+ ox, oy = @canvas.coords('I14R_1')[-2..-1]
+ @canvas.scale('I14R_1', ox, oy, sc, sc)
+ draw14a('R')
+
+ return((step == 10)? 3: 1)
+ end
+
+ # Light beam
+ def draw15
+ color = @C['15a']
+ xy = [824, 599, 824, 585, 820, 585, 829, 585]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I15a')
+ xy = [789, 599, 836, 643]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [778, 610, 788, 632]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [766, 617, 776, 625]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+
+ xy = [633, 600, 681, 640]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [635, 567, 657, 599]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
+ xy = [765, 557, 784, 583]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
+
+ sine([658, 580, 765, 580], 3, 15,
+ :tag=>'I15_s', :fill=>@C['fg'], :width=>3)
+ end
+
+ def move15a
+ color = @C['15b']
+ @canvas.scale('I15a', 824, 599, 1, 0.3) # Button down
+ xy = [765, 621, 681, 621]
+ TkcLine.new(@canvas, xy, :dash=>'-', :width=>3, :fill=>color, :tag=>'I15')
+ end
+
+ def move15(step = nil)
+ step = get_step(15, step)
+
+ numsteps = 6
+
+ if step == numsteps + 2
+ move_abs('I15_star', [-100, -100])
+ return 2
+ end
+ if step == 0 # Break the light beam
+ sparkle([-100, -100], 'I15_star')
+ xy = [765, 621, 745, 621]
+ @canvas.coords('I15', xy)
+ return 1
+ end
+ x0, y0 = anchor('I15_s', :w)
+ x1, y1 = anchor('I15_s', :e)
+ x = x0 + (x1 - x0) * (step - 1) / numsteps.to_f
+ move_abs('I15_star', [x, y0])
+ return 1
+ end
+
+ # Bell
+ def draw16
+ color = @C['16']
+ xy = [722, 485, 791, 556]
+ TkcRectangle.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3)
+ xy = box(752, 515, 25) # Bell
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black',
+ :tag=>'I16b', :width=>2)
+ xy = box(752, 515, 5) # Bell button
+ TkcOval.new(@canvas, xy, :fill=>'black', :outline=>'black', :tag=>'I16b')
+
+ xy = [784, 523, 764, 549] # Clapper
+ TkcLine.new(@canvas, xy, :width=>3, :tag=>'I16c', :fill=>@C['fg'])
+ xy = box(784, 523, 4)
+ TkcOval.new(@canvas, xy, :fill=>@C['fg'], :outline=>@C['fg'], :tag=>'I16d')
+ end
+
+ def move16(step = nil)
+ step = get_step(16, step)
+
+ # Note: we never stop
+ ox, oy = [760, 553]
+ if (step & 1).nonzero?
+ beta = 12
+ @canvas.move('I16b', 3, 0)
+ else
+ beta = -12
+ @canvas.move('I16b', -3, 0)
+ end
+ rotate_item('I16c', ox, oy, beta)
+ rotate_item('I16d', ox, oy, beta)
+
+ return ((step == 1)? 3: 1)
+ end
+
+ # Cat
+ def draw17
+ color = @C['17']
+
+ xy = [584, 556, 722, 556]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [584, 485, 722, 485]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = [664, 523, 717, 549] # Body
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3,
+ :style=>:chord, :start=>128, :extent=>260, :tag=>'I17')
+
+ xy = [709, 554, 690, 543] # Paw
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color,
+ :width=>3, :tag=>'I17')
+ xy = [657, 544, 676, 555]
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color,
+ :width=>3, :tag=>'I17')
+
+ xy = box(660, 535, 15) # Lower face
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>150, :extent=>240, :tag=>'I17_')
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:chord, :start=>150, :extent=>240, :tag=>'I17_')
+ xy = [674, 529, 670, 513, 662, 521, 658, 521, 650, 513, 647, 529] # Ears
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1,
+ :tag=>['I17_', 'I17_c'])
+ xy = [652, 542, 628, 539] # Whiskers
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [652, 543, 632, 545]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [652, 546, 632, 552]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+
+ xy = [668, 543, 687, 538]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+ xy = [668, 544, 688, 546]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+ xy = [668, 547, 688, 553]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+
+ xy = [649, 530, 654, 538, 659, 530] # Left eye
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ xy = [671, 530, 666, 538, 661, 530] # Right eye
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ xy = [655, 543, 660, 551, 665, 543] # Mouth
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ end
+
+ def move17(step = nil)
+ step = get_step(17, step)
+
+ if step == 0
+ @canvas.delete('I17') # Delete most of the cat
+ xy = [655, 543, 660, 535, 665, 543] # Mouth
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :smooth=>true, :tag=>'I17_')
+ xy = box(654, 530, 4) # Left eye
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
+ :tag=>'I17_')
+ xy = box(666, 530, 4) # Right eye
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
+ :tag=>'I17_')
+
+ @canvas.move('I17_', 0, -20) # Move face up
+ xy = [652, 528, 652, 554] # Front leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [670, 528, 670, 554] # 2nd front leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+
+ xy = [ # Body
+ 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525,
+ 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527,
+ 668, 527, 668, 527, 675, 522, 676, 517, 677, 512
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill),
+ :outline=>@C['fg'], :width=>3, :smooth=>true,
+ :tag=>'I17_')
+ xy = [716, 514, 716, 554] # Back leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [694, 532, 694, 554] # 2nd back leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [715, 514, 718, 506, 719, 495, 716, 488] # Tail
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :smooth=>true, :tag=>'I17_')
+
+ @canvas.raise('I17w') # Make whiskers visible
+ @canvas.move('I17_', -5, 0) # Move away from the wall a bit
+ return 2
+ end
+ return 0
+ end
+
+ # Sling shot
+ def draw18
+ color = @C['18']
+ xy = [721, 506, 627, 506] # Sling hold
+ TkcLine.new(@canvas, xy, :width=>4, :fill=>@C['fg'], :tag=>'I18')
+
+ xy = [607, 500, 628, 513] # Sling rock
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :tag=>'I18a')
+
+ xy = [526, 513, 606, 507, 494, 502] # Sling band
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>4, :tag=>'I18b')
+ xy = [485, 490, 510, 540, 510, 575, 510, 540, 535, 491] # Sling
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>6)
+ end
+
+ def move18(step = nil)
+ step = get_step(18, step)
+
+ pos = [
+ [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x],
+ [136, 506], [16, 506], [-100, -100]
+ ]
+
+ b = []
+ b[0] = [490, 502, 719, 507, 524, 512] # Band collapsing
+ b[1] = [
+ 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525,
+ 553, 536, 538, 534, 532, 519, 529, 499
+ ]
+ b[2] = [
+ 491, 503, 508, 563, 542, 533, 551, 526, 561, 539, 549, 550, 530, 500
+ ]
+ b[3] = [
+ 491, 503, 508, 563, 530, 554, 541, 562, 525, 568, 519, 544, 530, 501
+ ]
+
+ return 0 if step >= pos.length
+
+ if step == 0
+ @canvas.delete('I18')
+ @canvas.itemconfigure('I18b', :smooth=>true)
+ end
+ if b[step]
+ @canvas.coords('I18b', b[step])
+ end
+
+ where = pos[step]
+ move_abs('I18a', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Water pipe
+ def draw19
+ color = @C['19']
+ xx = [[249, 181], [155, 118], [86, 55], [22, 0]]
+ xx.each{|x1, x2|
+ TkcRectangle.new(@canvas, x1, 453, x2, 467,
+ :fill=>color, :outline=>'', :tag=>'I19')
+ TkcLine.new(@canvas, x1, 453, x2, 453,
+ :fill=>@C['fg'], :width=>1) # Pipe top
+ TkcLine.new(@canvas, x1, 467, x2, 467,
+ :fill=>@C['fg'], :width=>1) # Pipe bottom
+ }
+ @canvas.raise('I11i')
+
+ xy = box(168, 460, 16) # Bulge by the joint
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc,
+ :start=>21, :extent=>136)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc,
+ :start=>-21, :extent=>-130)
+
+ xy = [249, 447, 255, 473] # First joint 26x6
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+
+ xy = box(257, 433, 34) # Bend up
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>0, :extent=>-91)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>-90)
+ xy = box(257, 433, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>0, :extent=>-92)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>-90)
+ xy = box(257, 421, 34) # Bend left
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>0, :extent=>91)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>90)
+ xy = box(257, 421, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>0, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>90)
+ xy = box(243, 421, 34) # Bend down
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>90, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>90, :extent=>90)
+ xy = box(243, 421, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>90, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>90, :extent=>90)
+
+ xy = [270, 427, 296, 433] # 2nd joint bottom
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [270, 421, 296, 427] # 2nd joint top
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [249, 382, 255, 408] # Third joint right
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [243, 382, 249, 408] # Third joint left
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [203, 420, 229, 426] # Last joint
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+
+ xy = box(168, 460, 6) # Handle joint
+ TkcOval.new(@canvas, xy, :fill=>@C['fg'], :outline=>'', :tag=>'I19a')
+ xy = [168, 460, 168, 512] # Handle bar
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>5, :tag=>'I19b')
+ end
+
+ def move19(step = nil)
+ step = get_step(19, step)
+
+ angles = [30, 30, 30]
+ return 2 if step == angles.length
+ ox, oy = centroid('I19a')
+ rotate_item('I19b', ox, oy, angles[step])
+
+ return 1
+ end
+
+ # Water pouring
+ def draw20
+ # do nothing
+ end
+
+ def move20(step = nil)
+ step = get_step(20, step)
+
+ pos = [451, 462, 473, 484, 496, 504, 513, 523, 532]
+ freq = [20, 40, 40, 40, 40, 40, 40, 40, 40]
+ pos = [
+ [451, 20], [462, 40], [473, 40], [484, 40], [496, 40],
+ [504, 40], [513, 40], [523, 40], [532, 40, :x]
+ ]
+ return 0 if step >= pos.length
+
+ @canvas.delete('I20')
+ where = pos[step]
+ y, f = where
+ h20(y, f)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ def h20(y, f)
+ color = @C['20']
+ @canvas.delete('I20')
+
+ sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
+ :width=>3, :fill=>color, :smooth=>true)
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ :fill=>color, :smooth=>1, :tag=>['I20', 'I20a'])
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ :fill=>color, :smooth=>1, :tag=>['I20', 'I20b'])
+ @canvas.move('I20a', 8, 0)
+ @canvas.move('I20b', 16, 0)
+ end
+
+ # Bucket
+ def draw21
+ color = @C['21']
+ xy = [217, 451, 244, 490] # Right handle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21_a')
+ xy = [201, 467, 182, 490] # Left handle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21_a')
+
+ xy = [245, 490, 237, 535] # Right side
+ xy2 = [189, 535, 181, 490] # Left side
+ TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'',
+ :tag=>['I21', 'I21f'])
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21')
+ TkcLine.new(@canvas, xy2, :fill=>@C['fg'], :width=>2, :tag=>'I21')
+
+ xy = [182, 486, 244, 498] # Top
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2,
+ :tag=>['I21', 'I21f'])
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2,
+ :tag=>['I21', 'I21t'])
+ xy = [189, 532, 237, 540] # Bottom
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2,
+ :tag=>['I21', 'I21b'])
+ end
+
+ def move21(step = nil)
+ step = get_step(21, step)
+
+ numsteps = 30
+ return 0 if step >= numsteps
+
+ x1, y1, x2, y2 = @canvas.coords('I21b')
+ # lx1, ly1, lx2, ly2 = @canvas.coords('I21t')
+ lx1, ly1, lx2, ly2 = [183, 492, 243, 504]
+
+ f = step / numsteps.to_f
+ y2 = y2 - 3
+ xx1 = x1 + (lx1 - x1) * f
+ yy1 = y1 + (ly1 - y1) * f
+ xx2 = x2 + (lx2 - x2) * f
+ yy2 = y2 + (ly2 - y2) * f
+
+ @canvas.itemconfigure('I21b', :fill=>@C['20'])
+ @canvas.delete('I21w')
+ TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1,
+ :tag=>['I21', 'I21w'], :outline=>'', :fill=>@C['20'])
+ @canvas.lower('I21w', 'I21')
+ @canvas.raise('I21b')
+ @canvas.lower('I21f')
+
+ return((step == numsteps - 1)? 3: 1)
+ end
+
+ # Bucket drop
+ def draw22
+ # do nothing
+ end
+
+ def move22(step = nil)
+ step = get_step(22, step)
+ pos = [[213, 513], [213, 523], [213, 543, :x], [213, 583], [213, 593]]
+
+ @canvas.itemconfigure('I21f', :fill=>@C['22']) if step == 0
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I21', where)
+ h20(where[1], 40)
+ @canvas.delete('I21_a') # Delete handles
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Blow dart
+ def draw23
+ color = @C['23a']
+ color2 = @C['23b']
+ color3 = @C['23c']
+
+ xy = [185, 623, 253, 650] # Block
+ TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'],
+ :width=>2, :tag=>'I23a')
+ xy = [187, 592, 241, 623] # Balloon
+ TkcOval.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b',
+ :style=>:arc, :start=>12, :extent=>336)
+ xy = [239, 604, 258, 589, 258, 625, 239, 610] # Balloon nozzle
+ TkcPolygon.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b')
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23b')
+
+ xy = [285, 611, 250, 603] # Dart body
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'],
+ :width=>3, :tag=>'I23d')
+ xy = [249, 596, 249, 618, 264, 607, 249, 596] # Dart tail
+ TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'],
+ :width=>3, :tag=>'I23d')
+ xy = [249, 607, 268, 607] # Dart detail
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d')
+ xy = [285, 607, 305, 607] # Dart needle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d')
+ end
+
+ def move23(step = nil)
+ step = get_step(23, step)
+
+ pos = [
+ [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
+ [487, 607], [587, 607], [687, 607], [787, 607], [-100, -100]
+ ]
+
+ return 0 if step >= pos.length
+ if step <= 1
+ ox, oy = anchor('I23a', :n)
+ @canvas.scale('I23b', ox, oy, 0.9, 0.5)
+ end
+ where = pos[step]
+ move_abs('I23d', where)
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Balloon
+ def draw24
+ color = @C['24a']
+ xy = [366, 518, 462, 665] # Balloon
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ :width=>3, :tag=>'I24')
+ xy = [414, 666, 414, 729] # String
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I24')
+ xy = [410, 666, 404, 673, 422, 673, 418, 666] # Nozzle
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ :width=>3, :tag=>'I24')
+
+ xy = [387, 567, 390, 549, 404, 542] # Reflections
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [395, 568, 399, 554, 413, 547]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [403, 570, 396, 555, 381, 553]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [408, 564, 402, 547, 386, 545]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ end
+
+ def move24(step = nil)
+ step = get_step(24, step)
+
+ return 0 if step > 4
+ return 2 if step == 4
+
+ if step == 0
+ @canvas.delete('I24') # Exploding balloon
+ xy = [
+ 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594,
+ 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738,
+ 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613,
+ 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508,
+ 431, 441, 431, 440, 400, 502, 347, 465, 347, 465
+ ]
+ TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'],
+ :outline=>@C['24a'], :width=>10, :smooth=>true)
+ msg = Tk.subst(@S['message'].value)
+ TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'],
+ :justify=>:center, :font=>['Times Roman', 18, :bold])
+ return 1
+ end
+
+ @canvas.itemconfigure('I24t', :font=>['Times Roman', 18 + 6*step, :bold])
+ @canvas.move('I24', 0, -60)
+ ox, oy = centroid('I24')
+ @canvas.scale('I24', ox, oy, 1.25, 1.25)
+ return 1
+ end
+
+ # Displaying the message
+ def move25(step = nil)
+ step = get_step(25, step)
+
+ if step == 0
+ @XY['25'] = Tk::Clock.clicks(:miliseconds)
+ return 1
+ end
+ elapsed = Tk::Clock.clicks(:miliseconds) - @XY['25']
+ return 1 if elapsed < 5000
+ return 2
+ end
+
+ # Collapsing balloon
+ def move26(step = nil)
+ step = get_step(26, step)
+
+ if step >= 3
+ @canvas.delete('I24', 'I26')
+ TkcText.new(@canvas, 430, 740, :anchor=>:s, :tag=>'I26',
+ :text=>'click to continue',
+ :font=>['Times Roman', 24, :bold])
+ @canvas.bind('1', proc{reset})
+ return 4
+ end
+
+ ox, oy = centroid('I24')
+ @canvas.scale('I24', ox, oy, 0.8, 0.8)
+ @canvas.move('I24', 0, 60)
+ @canvas.itemconfigure('I24t', :font=>['Times Roman', 30 - 6*step, :bold])
+ return 1
+ end
+
+ ################################################################
+ #
+ # Helper functions
+ #
+ def box(x, y, r)
+ [x - r, y - r, x + r, y + r]
+ end
+
+ def move_abs(item, xy)
+ x, y = xy
+ ox, oy = centroid(item)
+ dx = x - ox
+ dy = y - oy
+ @canvas.move(item, dx, dy)
+ end
+
+ def rotate_item(item, ox, oy, beta)
+ xy = @canvas.coords(item)
+ xy2 = []
+ 0.step(xy.length - 1, 2){|idx|
+ x, y = xy[idx, 2]
+ xy2.concat(rotate_c(x, y, ox, oy, beta))
+ }
+ @canvas.coords(item, xy2)
+ end
+
+ def rotate_c(x, y, ox, oy, beta)
+ # rotates vector (ox,oy)->(x,y) by beta degrees clockwise
+
+ x -= ox # Shift to origin
+ y -= oy
+
+ beta = beta * Math.atan(1) * 4 / 180.0 # Radians
+ xx = x * Math.cos(beta) - y * Math.sin(beta) # Rotate
+ yy = x * Math.sin(beta) + y * Math.cos(beta)
+
+ xx += ox # Shift back
+ yy += oy
+
+ [xx, yy]
+ end
+
+ def reset
+ draw_all
+ @canvas.bind_remove('1')
+ @S['mode'].value = :MSTART
+ @S['active'] = [0]
+ end
+
+ # Each Move## keeps its state info in STEP, this retrieves and increments it
+ def get_step(who, step)
+ if step
+ @STEP[who] = step
+ else
+ if !@STEP.exist?(who) || @STEP[who] == ""
+ @STEP[who] = 0
+ else
+ @STEP[who] += 1
+ end
+ end
+ @STEP[who]
+ end
+
+ def reset_step
+ @S['cnt'].value = 0
+ @STEP.keys.each{|k| @STEP[k] = ''}
+ end
+
+ def sine(xy0, amp, freq, opts = {})
+ x0, y0, x1, y1 = xy0
+ step = 2
+ xy = []
+ if y0 == y1 # Horizontal
+ x0.step(x1, step){|x|
+ beta = (x - x0) * 2 * Math::PI / freq
+ y = y0 + amp * Math.sin(beta)
+ xy << x << y
+ }
+ else
+ y0.step(y1, step){|y|
+ beta = (y - y0) * 2 * Math::PI / freq
+ x = x0 + amp * Math.sin(beta)
+ xy << x << y
+ }
+ end
+ TkcLine.new(@canvas, xy, opts)
+ end
+
+ def round_rect(xy, radius, opts={})
+ x0, y0, x3, y3 = xy
+ r = @canvas.winfo_pixels(radius)
+ d = 2 * r
+
+ # Make sure that the radius of the curve is less than 3/8 size of the box!
+ maxr = 0.75
+ if d > maxr * (x3 - x0)
+ d = maxr * (x3 - x0)
+ end
+ if d > maxr * (y3 - y0)
+ d = maxr * (y3 - y0)
+ end
+
+ x1 = x0 + d
+ x2 = x3 - d
+ y1 = y0 + d
+ y2 = y3 - d
+
+ xy = [x0, y0, x1, y0, x2, y0, x3, y0, x3, y1, x3, y2]
+ xy.concat([x3, y3, x2, y3, x1, y3, x0, y3, x0, y2, x0, y1])
+ return xy
+ end
+
+ def round_poly(canv, xy, radii, opts)
+ lenXY = xy.length
+ lenR = radii.length
+ if lenXY != 2*lenR
+ raise "wrong number of vertices and radii"
+ end
+
+ knots = []
+ x0 = xy[-2]; y0 = xy[-1]
+ x1 = xy[0]; y1 = xy[1]
+ xy << xy[0] << xy[1]
+
+ 0.step(lenXY - 1, 2){|i|
+ radius = radii[i/2]
+ r = canv.winfo_pixels(radius)
+
+ x2 = xy[i+2]; y2 = xy[i+3]
+ z = _round_poly2(x0, y0, x1, y1, x2, y2, r)
+ knots.concat(z)
+
+ x0 = x1; y0 = y1
+ x1 = x2; y1 = y2
+ }
+ TkcPolygon.new(canv, knots, {:smooth=>true}.update(opts))
+ end
+
+ def _round_poly2(x0, y0, x1, y1, x2, y2, radius)
+ d = 2 * radius
+ maxr = 0.75
+
+ v1x = x0 - x1
+ v1y = y0 - y1
+ v2x = x2 - x1
+ v2y = y2 - y1
+
+ vlen1 = Math.sqrt(v1x*v1x + v1y*v1y)
+ vlen2 = Math.sqrt(v2x*v2x + v2y*v2y)
+
+ if d > maxr * vlen1
+ d = maxr * vlen1
+ end
+ if d > maxr * vlen2
+ d = maxr * vlen2
+ end
+
+ xy = []
+ xy << (x1 + d * v1x / vlen1) << (y1 + d * v1y / vlen1)
+ xy << x1 << y1
+ xy << (x1 + d * v2x / vlen2) << (y1 + d * v2y / vlen2)
+
+ return xy
+ end
+
+ def sparkle(oxy, tag)
+ xy = [
+ [299, 283], [298, 302], [295, 314], [271, 331],
+ [239, 310], [242, 292], [256, 274], [281, 273]
+ ]
+ xy.each{|x, y|
+ TkcLine.new(@canvas, 271, 304, x, y,
+ :fill=>'white', :width=>3, :tag=>tag)
+ }
+ move_abs(tag, oxy)
+ end
+
+ def centroid(item)
+ anchor(item, :c)
+ end
+
+ def anchor(item, where)
+ x1, y1, x2, y2 = @canvas.bbox(item)
+ case(where)
+ when :n
+ y = y1
+ when :s
+ y = y2
+ else
+ y = (y1 + y2) / 2.0
+ end
+ case(where)
+ when :w
+ x = x1
+ when :e
+ x = x2
+ else
+ x = (x1 + x2) / 2.0
+ end
+ return [x, y]
+ end
+end
+
+TkGoldberg_Demo.new(base_frame)
diff --git a/ext/tk/sample/demos-en/hello b/ext/tk/sample/demos-en/hello
new file mode 100644
index 0000000000..5e86ad7e3e
--- /dev/null
+++ b/ext/tk/sample/demos-en/hello
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+
+#unless /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK
+# require 'tkencoding'
+#end
+
+TkButton.new(nil,
+ 'text'=>"Hello Ruby world!",
+ 'font'=>TkFont.new('k14'),
+ 'command'=>proc{print "Hello Ruby world!\n"; exit}
+).pack
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/hscale.rb b/ext/tk/sample/demos-en/hscale.rb
new file mode 100644
index 0000000000..e660216967
--- /dev/null
+++ b/ext/tk/sample/demos-en/hscale.rb
@@ -0,0 +1,75 @@
+require "tkcanvas"
+
+if defined?($hscale_demo) && $hscale_demo
+ $hscale_demo.destroy
+ $hscale_demo = nil
+end
+
+$hscale_demo = TkToplevel.new {|w|
+ title("Horizontal Scale Demonstration")
+ iconname("hscale")
+}
+positionWindow($hscale_demo)
+
+base_frame = TkFrame.new($hscale_demo).pack(:fill=>:both, :expand=>true)
+
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '3.5i'
+ justify 'left'
+ text "An arrow and a horizontal scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the length of the arrow."
+}
+msg.pack('side'=>'top')
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc {
+ tmppath = $hscale_demo
+ $hscale_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc { showCode 'hscale' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+def setWidth(w, width)
+ width = width + 21
+ x2 = width - 30
+ if x2 < 21
+ x2 = 21
+ end
+ w.coords 'poly',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15
+ w.coords 'line',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15
+end
+
+TkFrame.new(base_frame) {|frame|
+ canvas = TkCanvas.new(frame) {|c|
+ width 50
+ height 50
+ bd 0
+ highlightthickness 0
+ TkcPolygon.new(c, '0', '0', '1', '1', '2', '2') {
+ fill 'DeepSkyBlue'
+ tags 'poly'
+ }
+ TkcLine.new(c, '0', '0', '1', '1', '2', '2', '0', '0') {
+ fill 'black'
+ tags 'line'
+ }
+ }.pack('side'=>'top', 'expand'=>'yes', 'anchor'=>'s', 'fill'=>'x', 'padx'=>'15')
+ scale = TkScale.new(frame) {
+ orient 'horizontal'
+ length 284
+ from 0
+ to 250
+ command proc{|value| setWidth(canvas, value)}
+ tickinterval 50
+ }.pack('side'=>'bottom', 'expand'=>'yes', 'anchor'=>'n')
+ scale.set 75
+}.pack('side'=>'top', 'fill'=>'x')
diff --git a/ext/tk/sample/demos-en/icon.rb b/ext/tk/sample/demos-en/icon.rb
new file mode 100644
index 0000000000..bab40da214
--- /dev/null
+++ b/ext/tk/sample/demos-en/icon.rb
@@ -0,0 +1,105 @@
+# icon.rb
+#
+# This demonstration script creates a toplevel window containing
+# buttons that display bitmaps instead of text.
+#
+# iconic button widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($icon_demo) && $icon_demo
+ $icon_demo.destroy
+ $icon_demo = nil
+end
+
+# demo toplevel widget
+$icon_demo = TkToplevel.new {|w|
+ title("Iconic Button Demonstration")
+ iconname("icon")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($icon_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "This window shows three ways of using bitmaps or images in radiobuttons and checkbuttons. On the left are two radiobuttons, each of which displays a bitmap and an indicator. In the middle is a checkbutton that displays a different image depending on whether it is selected or not. On the right is a checkbutton that displays a single bitmap but changes its background color to indicate whether or not it is selected. (This change is visible when the mouse pointer is not directy over the button.)"
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $icon_demo
+ $icon_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'icon'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# image
+flagup = \
+TkBitmapImage.new('file'=>[$demo_dir,'..',
+ 'images','flagup.xbm'].join(File::Separator),
+ 'maskfile'=>\
+ [$demo_dir,'..','images','flagup.xbm'].join(File::Separator))
+flagdown = \
+TkBitmapImage.new('file'=>[$demo_dir,'..',
+ 'images','flagdown.xbm'].join(File::Separator),
+ 'maskfile'=>\
+ [$demo_dir,'..',
+ 'images','flagdown.xbm'].join(File::Separator))
+
+# create variable
+letters = TkVariable.new
+
+# frame
+TkFrame.new(base_frame, 'borderwidth'=>10){|w|
+ TkFrame.new(w) {|f|
+ # TkRadioButton.new(f){
+ Tk::RadioButton.new(f){
+ bitmap '@' + [$demo_dir,'..',
+ 'images','letters.xbm'].join(File::Separator)
+ variable letters
+ value 'full'
+ }.pack('side'=>'top', 'expand'=>'yes')
+
+ # TkRadioButton.new(f){
+ Tk::RadioButton.new(f){
+ bitmap '@' + [$demo_dir,'..',
+ 'images','noletter.xbm'].join(File::Separator)
+ variable letters
+ value 'empty'
+ }.pack('side'=>'top', 'expand'=>'yes')
+
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+ # TkCheckButton.new(w) {
+ Tk::CheckButton.new(w) {
+ image flagdown
+ selectimage flagup
+ indicatoron 0
+ selectcolor self['background']
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+ # TkCheckButton.new(w) {
+ Tk::CheckButton.new(w) {
+ bitmap '@' + [$demo_dir,'..',
+ 'images','letters.xbm'].join(File::Separator)
+ indicatoron 0
+ selectcolor 'SeaGreen1'
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+}.pack('side'=>'top')
+
diff --git a/ext/tk/sample/demos-en/image1.rb b/ext/tk/sample/demos-en/image1.rb
new file mode 100644
index 0000000000..233cb963d1
--- /dev/null
+++ b/ext/tk/sample/demos-en/image1.rb
@@ -0,0 +1,65 @@
+## image1.rb
+#
+# This demonstration script displays two image widgets.
+#
+# two image widgets demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($image1_demo) && $image1_demo
+ $image1_demo.destroy
+ $image1_demo = nil
+end
+
+# demo toplevel widget
+$image1_demo = TkToplevel.new {|w|
+ title('Image Demonstration #1')
+ iconname("Image1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image1_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "This demonstration displays two images, each in a separate label widget."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $image1_demo
+ $image1_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'image1'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# image
+image1a = \
+TkPhotoImage.new('file'=>[$demo_dir,'..',
+ 'images','earth.gif'].join(File::Separator))
+image1b = \
+TkPhotoImage.new('file'=>[$demo_dir,'..',
+ 'images','earthris.gif'].join(File::Separator))
+
+# label
+#[ TkLabel.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'),
+# TkLabel.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken')
+#].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')}
+[ Tk::Label.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'),
+ Tk::Label.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken')
+].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')}
+
diff --git a/ext/tk/sample/demos-en/image2.rb b/ext/tk/sample/demos-en/image2.rb
new file mode 100644
index 0000000000..13098af1b6
--- /dev/null
+++ b/ext/tk/sample/demos-en/image2.rb
@@ -0,0 +1,107 @@
+# image2.rb
+#
+# This demonstration script creates a simple collection of widgets
+# that allow you to select and view images in a Tk label.
+#
+# widget demo 'load image' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($image2_demo) && $image2_demo
+ $image2_demo.destroy
+ $image2_demo = nil
+end
+
+# demo toplevel widget
+$image2_demo = TkToplevel.new {|w|
+ title('Image Demonstration #2')
+ iconname("Image2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "This demonstration allows you to view images using a Tk \"photo\" image. First type a directory name in the listbox, then press Enter to load the directory into the listbox. Then double-click on a file name in the listbox to see that image."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $image2_demo
+ $image2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'image2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# create variable
+$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
+
+# image
+$image2a = TkPhotoImage.new
+
+#
+TkLabel.new(base_frame, 'text'=>'Directory:')\
+.pack('side'=>'top', 'anchor'=>'w')
+
+image2_e = TkEntry.new(base_frame) {
+ width 30
+ textvariable $dirName
+}.pack('side'=>'top', 'anchor'=>'w')
+
+TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20)\
+.pack('side'=>'top', 'anchor'=>'w')
+
+TkLabel.new(base_frame, 'text'=>'File:')\
+.pack('side'=>'top', 'anchor'=>'w')
+
+TkFrame.new(base_frame){|w|
+ s = TkScrollbar.new(w)
+ l = TkListbox.new(w) {
+ width 20
+ height 10
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| l.yview(*args)})
+ l.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y')
+ s.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y')
+ #l.insert(0,'earth.gif', 'earthris.gif', 'mickey.gif', 'teapot.ppm')
+ l.insert(0,'earth.gif', 'earthris.gif', 'teapot.ppm')
+ l.bind('Double-1', proc{|x,y| loadImage $image2a,l,x,y}, '%x %y')
+
+ image2_e.bind 'Return', proc{loadDir l}
+
+}.pack('side'=>'top', 'anchor'=>'w')
+
+# image
+[ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20),
+ TkLabel.new(base_frame, 'text'=>'Image:'),
+ TkLabel.new(base_frame, 'image'=>$image2a)
+].each{|w| w.pack('side'=>'top', 'anchor'=>'w')}
+
+#
+def loadDir(w)
+ w.delete(0,'end')
+ Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
+ w.insert('end',File.basename(f))
+ }
+end
+
+def loadImage(img,w,x,y)
+ img.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator))
+end
+
diff --git a/ext/tk/sample/demos-en/image3.rb b/ext/tk/sample/demos-en/image3.rb
new file mode 100644
index 0000000000..edb6d231bf
--- /dev/null
+++ b/ext/tk/sample/demos-en/image3.rb
@@ -0,0 +1,125 @@
+# image3.rb
+#
+# This demonstration script creates a simple collection of widgets
+# that allow you to select and view images in a Tk label.
+#
+# widget demo 'load image' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($image3_demo) && $image3_demo
+ $image3_demo.destroy
+ $image3_demo = nil
+end
+
+# demo toplevel widget
+$image3_demo = TkToplevel.new {|w|
+ title('Image Demonstration #3')
+ iconname("Image3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true)
+
+#
+def loadDir3(w)
+ w.delete(0,'end')
+ Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
+ w.insert('end',File.basename(f))
+ }
+end
+
+# selectAndLoadDir3 --
+# This procedure pops up a dialog to ask for a directory to load into
+# the listobx and (if the user presses OK) reloads the directory
+# listbox from the directory named in the demo's entry.
+#
+# Arguments:
+# w - Name of the toplevel window of the demo.
+def selectAndLoadDir3(w, lbox)
+ dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
+ :parent=>w, :mustexist=>true)
+ if dir.length > 0
+ $dirName.value = dir
+ loadDir3(lbox)
+ end
+end
+
+def loadImage(w,x,y)
+ $image3a.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator))
+end
+
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "This demonstration allows you to view images using a Tk \"photo\" image. First type a directory name in the listbox, then type Return to load the directory into the listbox. Then double-click on a file name in the listbox to see that image."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $image3_demo
+ $image3_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'image3'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# variable
+$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
+
+# image
+begin
+ $image3a.delete
+rescue
+end
+$image3a = TkPhotoImage.new
+
+#
+image3_f = TkFrame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+image3_df = TkLabelFrame.new(base_frame, :text=>'Directory:')
+
+image3_ff = TkLabelFrame.new(base_frame, :text=>'File:',
+ :padx=>'2m', :pady=>'2m')
+image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) {
+ pack(:side=>:left, :fill=>:y, :expand=>true)
+ yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y,
+ :expand=>true))
+ insert(0, *(%w(earth.gif earthris.gif teapot.ppm)))
+ bind('Double-1', proc{|x,y| loadImage(self, x, y)}, '%x %y')
+}
+
+image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
+ pack(:side=>:left, :fill=>:both, :padx=>'2m', :pady=>'2m', :expand=>true)
+ bind('Return', proc{loadDir3(image3_lbx)})
+}
+
+TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"Select Dir.",
+ :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) {
+ pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m')
+}
+
+image3_if = TkLabelFrame.new(base_frame, :text=>'Image:') {|f|
+ # TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
+ Tk::Label.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
+}
+
+Tk.grid(image3_df, '-',
+ :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f)
+Tk.grid(image3_ff, image3_if,
+ :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f)
+TkGrid.columnconfigure(image3_f, 1, :weight=>1)
+
diff --git a/ext/tk/sample/demos-en/items.rb b/ext/tk/sample/demos-en/items.rb
new file mode 100644
index 0000000000..01a4072cb7
--- /dev/null
+++ b/ext/tk/sample/demos-en/items.rb
@@ -0,0 +1,381 @@
+# items.rb
+#
+# This demonstration script creates a canvas that displays the
+# canvas item types.
+#
+# canvas item types widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($items_demo) && $items_demo
+ $items_demo.destroy
+ $items_demo = nil
+end
+
+# demo toplevel widget
+$items_demo = TkToplevel.new {|w|
+ title("Canvas Item Demonstration")
+ iconname("Items")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($items_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "This window contains a canvas widget with examples of the various kinds of items supported by canvases. The following operations are supported:\n Button-1 drag:\tmoves item under pointer.\n Button-2 drag:\trepositions view.\n Button-3 drag:\tstrokes out area.\n Ctrl+f:\t\tprints items under area."
+}.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $items_demo
+ $items_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'items'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+cvs = nil
+TkFrame.new(base_frame) {|cf|
+ # canvas
+ cvs = TkCanvas.new(cf) {|c|
+ focus
+ scrollregion '0c 0c 30c 24c'
+ width '15c'
+ height '10c'
+ relief 'sunken'
+ borderwidth 2
+
+ hs = TkScrollbar.new(cf) {|s|
+ orient 'horizontal'
+ command proc{|*args| c.xview(*args)}
+ c.xscrollcommand proc{|first,last| s.set first,last}
+ }
+
+ vs = TkScrollbar.new(cf) {|s|
+ command proc{|*args| c.yview(*args)}
+ c.yscrollcommand proc{|first,last| s.set first,last}
+ }
+
+ if $tk_version =~ /^4\.[01]/
+ hs.pack('side'=>'bottom', 'fill'=>'x')
+ vs.pack('side'=>'right', 'fill'=>'y')
+ c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both')
+
+ else
+ c.grid('in'=>cf, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ vs.grid('row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ hs.grid('row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0)
+
+ end
+
+ }
+}.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+# Display a 3x3 rectangular grid
+TkcRectangle.new(cvs, '0c', '0c', '30c', '24c', 'width'=>2)
+TkcLine.new(cvs, '0c', '8c', '30c', '8c', 'width'=>2)
+TkcLine.new(cvs, '0c', '16c', '30c', '16c', 'width'=>2)
+TkcLine.new(cvs, '10c', '0c', '10c', '24c', 'width'=>2)
+TkcLine.new(cvs, '20c', '0c', '20c', '24c', 'width'=>2)
+
+if $tk_version =~ /^4.*/
+ font1 = '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*'
+ font2 = '-Adobe-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*'
+else
+ font1 = 'Helvetica 12'
+ font2 = 'Helvetica 24 bold'
+end
+if TkWinfo.depth($root).to_i > 1
+ blue = 'DeepSkyBlue3'
+ red = 'red'
+ bisque = 'bisque3'
+ green = 'SeaGreen3'
+else
+ blue = 'black'
+ red = 'black'
+ bisque = 'black'
+ green = 'black'
+end
+
+# tag
+$tag_item = TkcGroup.new(cvs)
+
+# Set up demos within each of the areas of the grid.
+TkcText.new(cvs, '5c', '.2c', 'text'=>'Lines', 'anchor'=>'n')
+TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c',
+ 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt',
+ 'join'=>'miter', 'tags'=>$tag_item )
+TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item)
+TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item)
+TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c',
+ '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c',
+ '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c',
+ 'width'=>3, 'fill'=>red, 'tags'=>$tag_item )
+TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item )
+TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c',
+ 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round',
+ 'tags'=>$tag_item )
+
+TkcText.new(cvs, '15c', '.2c',
+ 'text'=>'Curves (smoothed lines)', 'anchor'=>'n')
+TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c',
+ 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item )
+TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c',
+ 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item )
+TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c',
+ '16.5c','4.5c','13.5c','7.5c','12c','6c',
+ 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator),
+ 'fill'=>red, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '25c', '.2c', 'text'=>'Polygons', 'anchor'=>'n')
+TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c',
+ '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c',
+ 'fill'=>'green', 'outline'=>'black', 'width'=>4,
+ 'tags'=>$tag_item )
+TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c',
+ '28c','1c','29c','1c','29c','4c','29c','4c',
+ 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item)
+TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
+ '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c',
+ '7.5c','22c','7.5c',
+ 'stipple'=>'@' + [$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator),
+ 'outline'=>'black', 'tags'=>$tag_item )
+
+TkcText.new(cvs, '5c', '8.2c', 'text'=>'Rectangles', 'anchor'=>'n')
+TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c',
+ 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
+TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c',
+ 'fill'=>green, 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'fill'=>blue, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '15c', '8.2c', 'text'=>'Ovals', 'anchor'=>'n')
+TkcOval.new(cvs, '11c','9.5c','14c','12.5c',
+ 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
+TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c',
+ 'fill'=>green, 'tags'=>$tag_item )
+TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'fill'=>blue, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '25c', '8.2c', 'text'=>'Text', 'anchor'=>'n')
+TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c')
+TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c',
+ 'text'=>'A short string of text, word-wrapped, justified left, and anchored north (at the top). The rectangles show the anchor points for each piece of text.', 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c')
+TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue,
+ 'text'=>"Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge.", 'justify'=>'center', 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c')
+if $tk_version =~ /^4\.[01]/
+ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
+ 'stipple'=>'@' + [$demo_dir, '..',
+ 'images', 'grey.5'].join(File::Separator),
+ 'text'=>'Stippled characters', 'tags'=>$tag_item )
+else
+ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
+ 'stipple'=>'gray50', 'text'=>'Stippled characters',
+ 'tags'=>$tag_item )
+end
+
+TkcText.new(cvs, '5c', '16.2c', 'text'=>'Arcs', 'anchor'=>'n')
+TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black',
+ 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item)
+#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
+# 'outline'=>blue, 'start'=>135, 'extent'=>270,
+# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
+ 'outline'=>blue, 'start'=>135, 'extent'=>270,
+ 'outlinestipple'=>'@'+[$demo_dir, '..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice',
+ 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90,
+ 'tags'=>$tag_item)
+TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord',
+ 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270,
+ 'tags'=>$tag_item)
+
+TkcText.new(cvs, '15c', '16.2c', 'text'=>'Bitmaps', 'anchor'=>'n')
+#TkcBitmap.new(cvs, '13c','20c',
+# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcBitmap.new(cvs, '13c','20c',
+ 'bitmap'=>'@' + [$demo_dir, '..',
+ 'images', 'face.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+#TkcBitmap.new(cvs, '17c','18.5c',
+# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcBitmap.new(cvs, '17c','18.5c',
+ 'bitmap'=>'@' + [$demo_dir, '..',
+ 'images', 'noletter.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+#TkcBitmap.new(cvs, '17c','21.5c',
+# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator),
+# 'tags'=>$tag_item)
+#
+TkcBitmap.new(cvs, '17c','21.5c') {
+ bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
+ tags $tag_item
+}
+#TkcBitmap.new(cvs, '17c','21.5c') {
+# bitmap '@' + ['images', 'letters'].join(File::Separator)
+# tags $tag_item
+#}
+
+TkcText.new(cvs, '25c', '16.2c', 'text'=>'Windows', 'anchor'=>'n')
+TkButton.new(cvs) {|b|
+ text 'Press Me'
+ command proc{butPress cvs, red}
+ TkcWindow.new(cvs, '21c','18c',
+ 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item)
+}
+TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e|
+ insert 'end', 'Edit this text'
+ TkcWindow.new(cvs, '21c','21c',
+ 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item)
+}
+TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
+ 'width'=>'.5c', 'tickinterval'=>0 ) {|scl|
+ TkcWindow.new(cvs, '28.5c','17.5c',
+ 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item)
+}
+TkcText.new(cvs, '21c', '17.9c', 'text'=>'Button:', 'anchor'=>'sw')
+TkcText.new(cvs, '21c', '20.9c', 'text'=>'Entry:', 'anchor'=>'sw')
+TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'Scale:', 'anchor'=>'s')
+
+# Set up event bindings for canvas:
+cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs})
+cvs.itembind($tag_item, 'Any-Leave', proc{itemLeave cvs})
+cvs.bind('2', proc{|x,y| cvs.scan_mark x,y}, '%x %y')
+cvs.bind('B2-Motion', proc{|x,y| cvs.scan_dragto x,y}, '%x %y')
+cvs.bind('3', proc{|x,y| itemMark cvs,x,y}, '%x %y')
+cvs.bind('B3-Motion', proc{|x,y| itemStroke cvs,x,y}, '%x %y')
+cvs.bind('Control-f', proc{itemsUnderArea cvs})
+cvs.bind('1', proc{|x,y| itemStartDrag cvs,x,y}, '%x %y')
+cvs.bind('B1-Motion', proc{|x,y| itemDrag cvs,x,y}, '%x %y')
+# Utility methods for highlighting the item under the pointer
+
+$restoreCmd = nil
+def itemEnter (c)
+ if TkWinfo.depth(c).to_i == 1
+ $restoreCmd = nil
+ return
+ end
+ type = c.itemtype('current')
+ if type == TkcWindow
+ $restoreCmd = nil
+ return
+ end
+ if type == TkcBitmap
+ bg = (c.itemconfiginfo('current', 'background'))[4]
+ $restoreCmd = proc{c.itemconfigure 'current', 'background', bg}
+ c.itemconfigure 'current', 'background', 'SteelBlue2'
+ return
+ end
+ fill = (c.itemconfiginfo('current', 'fill'))[4]
+ if (type == TkcRectangle || type == TkcOval || type == TkcArc) && fill == []
+ outline = (c.itemconfiginfo('current', 'outline'))[4]
+ $restoreCmd = proc{c.itemconfigure 'current', 'outline', outline}
+ c.itemconfigure 'current', 'outline', 'SteelBlue2'
+ else
+ $restoreCmd = proc{c.itemconfigure 'current', 'fill', fill}
+ c.itemconfigure 'current', 'fill', 'SteelBlue2'
+ end
+end
+
+def itemLeave(c)
+ $restoreCmd.call if $restoreCmd
+end
+
+# Utility methods for stroking out a rectangle and printing what's
+# underneath the rectangle's area.
+
+def itemMark(c,x,y)
+ $areaX1 = c.canvasx(x)
+ $areaY1 = c.canvasy(y)
+ c.delete 'area'
+end
+
+def itemStroke(c,x,y)
+ x = c.canvasx(x)
+ y = c.canvasy(y)
+ if $areaX1 != x && $areaY1 != y
+ c.delete 'area'
+ c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
+ '-outline', 'black')
+ $areaX2 = x
+ $areaY2 = y
+ end
+end
+
+def itemsUnderArea(c)
+ area = c.find_withtag('area')
+ items = []
+ c.find_enclosed($areaX1,$areaY1,$areaX2,$areaY2).each{|i|
+ items.push(i) if i.gettags.include?($tag_item)
+ }
+ print "Items enclosed by area: #{items.inspect}\n"; STDOUT.flush
+ items.clear
+ c.find_overlapping($areaX1,$areaY1,$areaX2,$areaY2).each{|i|
+ items.push(i) if i.gettags.include?($tag_item)
+ }
+ print "Items overlapping area: #{items.inspect}\n"; STDOUT.flush
+end
+
+$areaX1 = 0
+$areaY1 = 0
+$areaX2 = 0
+$areaY2 = 0
+
+# Utility methods to support dragging of items.
+
+def itemStartDrag(c,x,y)
+ $lastX = c.canvasx(x)
+ $lastY = c.canvasy(y)
+end
+
+def itemDrag(c,x,y)
+ x = c.canvasx(x)
+ y = c.canvasy(y)
+ c.move 'current', x - $lastX, y - $lastY
+ $lastX = x
+ $lastY = y
+end
+
+# Method that's invoked when the button embedded in the canvas
+# is invoked.
+
+def butPress(w,color)
+ i = TkcText.new(w, '25c', '18.1c',
+ 'text'=>'Ouch!!', 'fill'=>color, 'anchor'=>'n')
+ Tk.after(500, proc{w.delete i})
+end
diff --git a/ext/tk/sample/demos-en/ixset b/ext/tk/sample/demos-en/ixset
new file mode 100644
index 0000000000..40a77f487c
--- /dev/null
+++ b/ext/tk/sample/demos-en/ixset
@@ -0,0 +1,333 @@
+#!/usr/bin/env ruby
+
+# ixset --
+# A nice interface to "xset" to change X server settings
+#
+
+require 'tk'
+
+class Xsettings
+ #
+ # Button actions
+ #
+ def quit
+ @root.destroy
+ end
+
+ def ok
+ writesettings
+ quit
+ end
+
+ def cancel
+ readsettings
+ dispsettings
+ end
+
+ # apply is just "writesettings"
+
+
+ #
+ # Read current settings
+ #
+ def readsettings
+ xfd = open("|xset q", 'r')
+ xfd.readlines.each{|line|
+ fields = line.chomp.strip.split(/\s+/)
+ case fields[0]
+ when "auto"
+ if fields[1] == 'repeat:'
+ @kbdrep = fields[2]
+ @w_kbdrep.set(@kbdrep)
+ @kbdcli = fields[6]
+ end
+
+ when "bell"
+ @bellvol = fields[2]
+ @bellpit = fields[5]
+ @belldur = fields[8]
+
+ when "acceleration:"
+ @mouseacc = fields[1]
+ @mousethr = fields[3]
+
+ when "prefer"
+ if fields[2] == 'yes'
+ @screenbla = 'blank'
+ else
+ @screenbla = 'noblank'
+ end
+ @w_screenbla.set(@screenbla)
+
+ when "timeout:"
+ @screentim = fields[1]
+ @screencyc = fields[3]
+
+ end
+ }
+
+ xfd.close
+ end
+
+ #
+ # Write settings into the X server
+ #
+ def writesettings
+ @bellvol = @w_bellvol.get
+ @bellpit = @w_bellpit.get
+ @belldur = @w_belldur.get
+
+ @kbdrep = @w_kbdrep.get
+ if @kbdrep == 'on'
+ @kbdcli = @w_kbdcli.get
+ else
+ @kbdcli = 'off'
+ end
+
+ @mouseacc = @w_mouseacc.get
+ @mousethr = @w_mousethr.get
+
+ @screentim = @w_screentim.get
+ @screencyc = @w_screencyc.get
+ @screenbla = @w_screenbla.get
+
+ system("xset \
+ b #{@bellvol} #{@bellpit} #{@belldur} \
+ c #{@kbdcli} \
+ r #{@kbdrep} \
+ m #{@mouseacc} #{@mousethr} \
+ s #{@screentim} #{@screencyc} \
+ s #{@screenbla}")
+ end
+
+ #
+ # Sends all settings to the window
+ #
+ def dispsettings
+ @w_bellvol.set(@bellvol)
+ @w_bellpit.set(@bellpit)
+ @w_belldur.set(@belldur)
+
+ @w_kbdonoff.set(@w_kbdrep.get)
+ @w_kbdcli.set(@kbdcli)
+
+ @w_mouseacc.set(@mouseacc)
+ @w_mousethr.set(@mousethr)
+
+ @w_screenblank.set(@w_screenbla.get)
+ @w_screenpat.set(@w_screenbla.get)
+
+ @w_screentim.set(@screentim)
+ @w_screencyc.set(@screencyc)
+ end
+
+ #
+ # Create all windows, and pack them
+ #
+ class LabelEntry
+ def initialize(parent, text, length)
+ @frame = TkFrame.new(parent)
+ TkLabel.new(@frame, 'text'=>text).pack('side'=>'left','expand'=>'y')
+ @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') {
+ pack('side'=>'left','expand'=>'y')
+ }
+ end
+ def pack(keys)
+ @frame.pack(keys)
+ end
+ def get
+ @entry.value
+ end
+ def set(value)
+ @entry.delete(0,'end')
+ @entry.insert(0, value)
+ end
+ end
+
+ def createwindows
+ win = self
+
+ #
+ # Buttons
+ #
+ buttons = TkFrame.new(@root) {|f|
+ [ TkButton.new(f, 'command'=>proc{win.ok}, 'text'=>'Ok'),
+ TkButton.new(f, 'command'=>proc{win.writesettings}, 'text'=>'Apply'),
+ TkButton.new(f, 'command'=>proc{win.cancel}, 'text'=>'Cancel'),
+ TkButton.new(f, 'command'=>proc{win.quit}, 'text'=>'Quit') ].each{|b|
+ b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5)
+ }
+ }
+
+ #
+ # Bell settings
+ #
+ bell = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(bell, 'text'=>'Bell Settings')
+ @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>"Volume (%)")
+
+ f = TkFrame.new(bell)
+ @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6)
+ @w_bellpit.pack('side'=>'left', 'padx'=>5)
+ @w_belldur = LabelEntry.new(f, "Duration (ms)", 6)
+ @w_belldur.pack('side'=>'right', 'padx'=>5)
+
+ l.pack('side'=>'top', 'expand'=>'yes')
+ @w_bellvol.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Keyboard settings
+ #
+ kbdonoff = nil
+ kbdcli = nil
+ kbd = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(kbd, 'text'=>'Keyboard Repeat Settings')
+ f = TkFrame.new(kbd)
+ @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat',
+ 'onvalue'=>'on', 'offvalue'=>'off',
+ 'variable'=>@w_kbdrep ) {
+ def self.set(value)
+ if value == 'on'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both')
+ }
+ @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>'Click Volume (%)')
+ @w_kbdcli.pack('side'=>'left', 'expand'=>'yes')
+ l.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x')
+
+ #
+ # Mouse settings
+ #
+ mouse = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(mouse, 'text'=>'Mouse Settings')
+ f = TkFrame.new(mouse)
+ @w_mouseacc = LabelEntry.new(f, 'Acceleration', 3)
+ @w_mouseacc.pack('side'=>'left')
+ @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3)
+ @w_mousethr.pack('side'=>'right')
+ l.pack('side'=>'top')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Screen Saver settings
+ #
+ screen = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(screen, 'text'=>'Screen-saver Settings')
+ f = TkFrame.new(screen)
+ ff1 = TkFrame.new(f)
+ [ @w_screenblank = TkRadioButton.new(ff1, 'text'=>'Blank',
+ 'relief'=>'flat',
+ 'variable'=>@w_screenbla,
+ 'value'=>'blank') {
+ def self.set(value)
+ if value == 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ },
+ @w_screenpat = TkRadioButton.new(ff1, 'text'=>'Pattern',
+ 'relief'=>'flat',
+ 'variable'=>@w_screenbla,
+ 'value'=>'noblank') {
+ def self.set(value)
+ if value != 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+ ].each {|w| w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') }
+
+ ff2 = TkFrame.new(f)
+ [ @w_screentim = LabelEntry.new(ff2, 'Timeout (s)', 5),
+ @w_screencyc = LabelEntry.new(ff2, 'Cycle (s)', 5) ].each{|w|
+ w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'e')
+ }
+
+ ff1.pack('side'=>'left')
+ ff2.pack('side'=>'left')
+
+ l.pack('side'=>'top')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Main window
+ #
+ buttons.pack('side'=>'top', 'fill'=>'both')
+ bell.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ kbd.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ mouse.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ screen.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+
+ #
+ # Let the user resize our window
+ #
+ @root.minsize(10,10)
+ end
+
+ def initialize
+ @root = TkRoot.new
+
+ @kbdrep = 'on'
+ @w_kbdrep = TkVariable.new(@kbdrep)
+ def @w_kbdrep.get
+ self.value
+ end
+ def @w_kbdrep.set(val)
+ self.value=val
+ end
+
+ @kbdcli = 0
+
+ @bellvol = 100
+ @bellpit = 440
+ @belldur = 100
+
+ @mouseacc = "3/1"
+ @mousethr = 4
+
+ @screenbla = "blank"
+ @w_screenbla = TkVariable.new(@screenbla)
+ def @w_screenbla.get
+ self.value
+ end
+ def @w_screenbla.set(val)
+ self.value=val
+ end
+
+ @screentim = 600
+ @screencyc = 600
+
+ #
+ # Listen what "xset" tells us...
+ #
+ readsettings
+
+ #
+ # Create all windows
+ #
+ createwindows
+
+ #
+ # Write xset parameters
+ #
+ dispsettings
+ end
+end
+
+Xsettings.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/ixset2 b/ext/tk/sample/demos-en/ixset2
new file mode 100644
index 0000000000..cb99c60793
--- /dev/null
+++ b/ext/tk/sample/demos-en/ixset2
@@ -0,0 +1,367 @@
+#!/usr/bin/env ruby
+#
+# ixset --
+# A nice interface to "xset" to change X server settings
+#
+
+require 'tk'
+
+class Xsettings
+ #
+ # Button actions
+ #
+ def quit
+ @root.destroy
+ end
+
+ def ok
+ writesettings
+ quit
+ end
+
+ def cancel
+ readsettings
+ dispsettings
+ @btn_APPLY.state(:disabled)
+ @btn_CANCEL.state(:disabled)
+ end
+
+ # apply is just "writesettings"
+ def apply
+ writesettings
+ @btn_APPLY.state(:disabled)
+ @btn_CANCEL.state(:disabled)
+ end
+
+ #
+ # Read current settings
+ #
+ def readsettings
+ xfd = open("|xset q", 'r')
+ xfd.readlines.each{|line|
+ fields = line.chomp.strip.split(/\s+/)
+ case fields[0]
+ when "auto"
+ if fields[1] == 'repeat:'
+ @kbdrep = fields[2]
+ @w_kbdrep.set(@kbdrep)
+ @kbdcli = fields[6]
+ end
+
+ when "bell"
+ @bellvol = fields[2]
+ @bellpit = fields[5]
+ @belldur = fields[8]
+
+ when "acceleration:"
+ @mouseacc = fields[1]
+ @mousethr = fields[3]
+
+ when "prefer"
+ if fields[2] == 'yes'
+ @screenbla = 'blank'
+ else
+ @screenbla = 'noblank'
+ end
+ @w_screenbla.set(@screenbla)
+
+ when "timeout:"
+ @screentim = fields[1]
+ @screencyc = fields[3]
+
+ end
+ }
+
+ xfd.close
+ end
+
+ #
+ # Write settings into the X server
+ #
+ def writesettings
+ @bellvol = @w_bellvol.get
+ @bellpit = @w_bellpit.get
+ @belldur = @w_belldur.get
+
+ @kbdrep = @w_kbdrep.get
+ if @kbdrep == 'on'
+ @kbdcli = @w_kbdcli.get
+ else
+ @kbdcli = 'off'
+ end
+
+ @mouseacc = @w_mouseacc.get
+ @mousethr = @w_mousethr.get
+
+ @screentim = @w_screentim.get
+ @screencyc = @w_screencyc.get
+ @screenbla = @w_screenbla.get
+
+ system("xset \
+ b #{@bellvol} #{@bellpit} #{@belldur} \
+ c #{@kbdcli} \
+ r #{@kbdrep} \
+ m #{@mouseacc} #{@mousethr} \
+ s #{@screentim} #{@screencyc} \
+ s #{@screenbla}")
+ end
+
+ #
+ # Sends all settings to the window
+ #
+ def dispsettings
+ @w_bellvol.set(@bellvol)
+ @w_bellpit.set(@bellpit)
+ @w_belldur.set(@belldur)
+
+ @w_kbdonoff.set(@w_kbdrep.get)
+ @w_kbdcli.set(@kbdcli)
+
+ @w_mouseacc.set(@mouseacc)
+ @w_mousethr.set(@mousethr)
+
+ @w_screenblank.set(@w_screenbla.get)
+ @w_screenpat.set(@w_screenbla.get)
+
+ @w_screentim.set(@screentim)
+ @w_screencyc.set(@screencyc)
+ end
+
+ #
+ # Create all windows, and pack them
+ #
+ class LabelEntry
+ def initialize(parent, text, length, range=[])
+ @frame = TkFrame.new(parent)
+ TkLabel.new(@frame, 'text'=>text).pack('side'=>'left')
+ if range.size > 0
+ @entry = TkSpinbox.new(@frame, 'width'=>length, 'relief'=>'sunken',
+ 'from'=>range[0], 'to'=>range[1])
+ else
+ @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken')
+ end
+ @entry.pack('side'=>'right','expand'=>'y', 'fill'=>'x')
+ end
+ def epath
+ @frame
+ end
+ def pack(keys)
+ @frame.pack(keys)
+ end
+ def get
+ @entry.value
+ end
+ def set(value)
+ @entry.delete(0,'end')
+ @entry.insert(0, value)
+ end
+ end
+
+ def createwindows
+ win = self
+
+ #
+ # Buttons
+ #
+ btn_frame = TkFrame.new(@root)
+ buttons = [
+ @btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok},
+ 'default'=>'active', 'text'=>'Ok'),
+ @btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings},
+ 'default'=>'normal', 'text'=>'Apply',
+ 'state'=>'disabled'),
+ @btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel},
+ 'default'=>'normal', 'text'=>'Cancel',
+ 'state'=>'disabled'),
+ @btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit},
+ 'default'=>'normal', 'text'=>'Quit')
+ ]
+ buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) }
+
+ @root.bind('Return', proc{@btn_OK.flash; @btn_OK.invoke})
+ @root.bind('Escape', proc{@btn_QUIT.flash; @btn_QUIT.invoke})
+ @root.bind('1', proc{|w|
+ unless buttons.index(w)
+ @btn_APPLY.state(:normal)
+ @btn_CANCEL.state(:normal)
+ end
+ }, '%W')
+ @root.bind('Key', proc{|w, k|
+ unless buttons.index(w)
+ case k
+ when 'Return', 'Escape', 'Tab', /.*Shift.*/
+ # do nothing
+ else
+ @btn_APPLY.state(:normal)
+ @btn_CANCEL.state(:normal)
+ end
+ end
+ }, '%W %K')
+
+ #
+ # Bell settings
+ #
+ bell = TkLabelframe.new(@root, 'text'=>'Bell Settings',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>"Volume (%)")
+
+ f = TkFrame.new(bell)
+ @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6, [25, 20000])
+ @w_bellpit.pack('side'=>'left', 'padx'=>5)
+ @w_belldur = LabelEntry.new(f, "Duration (ms)", 6, [1, 10000])
+ @w_belldur.pack('side'=>'right', 'padx'=>5)
+
+ @w_bellvol.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Keyboard settings
+ #
+ kbdonoff = nil
+ kbdcli = nil
+ kbd = TkLabelframe.new(@root, 'text'=>'Keyboard Repeat Settings',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ f = TkFrame.new(kbd)
+ @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat',
+ 'onvalue'=>'on', 'offvalue'=>'off',
+ 'variable'=>@w_kbdrep ) {
+ def self.set(value)
+ if value == 'on'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x', 'padx'=>[0, '1m'])
+ }
+ @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>'Click Volume (%)')
+ @w_kbdcli.pack('side'=>'left', 'expand'=>'yes',
+ 'fill'=>'x', 'padx'=>['1m', 0])
+ f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x')
+
+ #
+ # Mouse settings
+ #
+ mouse = TkLabelframe.new(@root, 'text'=>'Mouse Settings',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ f = TkFrame.new(mouse)
+ @w_mouseacc = LabelEntry.new(f, 'Acceleration', 5)
+ @w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m'])
+ @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3, [1, 2000])
+ @w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0])
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Screen Saver settings
+ #
+ screen = TkLabelframe.new(@root, 'text'=>'Screen-saver Settings',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ @w_screenblank = TkRadioButton.new(screen, 'text'=>'Blank',
+ 'relief'=>'flat', 'anchor'=>'w',
+ 'variable'=>@w_screenbla,
+ 'value'=>'blank') {
+ def self.set(value)
+ if value == 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+
+ @w_screenpat = TkRadioButton.new(screen, 'text'=>'Pattern',
+ 'relief'=>'flat', 'anchor'=>'w',
+ 'variable'=>@w_screenbla,
+ 'value'=>'noblank') {
+ def self.set(value)
+ if value != 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+
+ @w_screentim = LabelEntry.new(screen, 'Timeout (s)', 5, [1, 100000])
+ @w_screencyc = LabelEntry.new(screen, 'Cycle (s)', 5, [1, 100000])
+
+ Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e')
+ Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e')
+ TkGrid.configure(@w_screenblank, @w_screenpat, 'sticky'=>'ew')
+
+ #
+ # Main window
+ #
+ param = {
+ 'side'=>'top', 'fill'=>'both', 'expand'=>'yes',
+ 'padx'=>'1m', 'pady'=>'1m'
+ }
+ btn_frame.pack('side'=>'top', 'fill'=>'both')
+ bell.pack(param)
+ kbd.pack(param)
+ mouse.pack(param)
+ screen.pack(param)
+
+ #
+ # Let the user resize our window
+ #
+ @root.minsize(10,10)
+ end
+
+ def initialize(title)
+ @root = TkRoot.new('title'=>title)
+
+ @kbdrep = 'on'
+ @w_kbdrep = TkVariable.new(@kbdrep)
+ def @w_kbdrep.get
+ self.value
+ end
+ def @w_kbdrep.set(val)
+ self.value=val
+ end
+
+ @kbdcli = 0
+
+ @bellvol = 100
+ @bellpit = 440
+ @belldur = 100
+
+ @mouseacc = "3/1"
+ @mousethr = 4
+
+ @screenbla = "blank"
+ @w_screenbla = TkVariable.new(@screenbla)
+ def @w_screenbla.get
+ self.value
+ end
+ def @w_screenbla.set(val)
+ self.value=val
+ end
+
+ @screentim = 600
+ @screencyc = 600
+
+ #
+ # Listen what "xset" tells us...
+ #
+ readsettings
+
+ #
+ # Create all windows
+ #
+ createwindows
+
+ #
+ # Write xset parameters
+ #
+ dispsettings
+ end
+end
+
+Xsettings.new(File.basename($0,'.rb'))
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/knightstour.rb b/ext/tk/sample/demos-en/knightstour.rb
new file mode 100644
index 0000000000..6f96a5be10
--- /dev/null
+++ b/ext/tk/sample/demos-en/knightstour.rb
@@ -0,0 +1,271 @@
+# Based on the widget demo of Tcl/Tk8.5.2
+# The following is the original copyright text.
+#----------------------------------------------------------------------------
+# Copyright (C) 2008 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# Calculate a Knight's tour of a chessboard.
+#
+# This uses Warnsdorff's rule to calculate the next square each
+# time. This specifies that the next square should be the one that
+# has the least number of available moves.
+#
+# Using this rule it is possible to get to a position where
+# there are no squares available to move into. In this implementation
+# this occurs when the starting square is d6.
+#
+# To solve this fault an enhancement to the rule is that if we
+# have a choice of squares with an equal score, we should choose
+# the one nearest the edge of the board.
+#
+# If the call to the Edgemost function is commented out you can see
+# this occur.
+#
+# You can drag the knight to a specific square to start if you wish.
+# If you let it repeat then it will choose random start positions
+# for each new tour.
+#----------------------------------------------------------------------------
+require 'tk'
+
+class Knights_Tour
+ # Return a list of accessible squares from a given square
+ def valid_moves(square)
+ moves = []
+ [
+ [-1,-2], [-2,-1], [-2,1], [-1,2], [1,2], [2,1], [2,-1], [1,-2]
+ ].each{|col_delta, row_delta|
+ col = (square % 8) + col_delta
+ row = (square.div(8)) + row_delta
+ moves << (row * 8 + col) if row > -1 && row < 8 && col > -1 && col < 8
+ }
+ moves
+ end
+
+ # Return the number of available moves for this square
+ def check_square(square)
+ valid_moves(square).find_all{|pos| ! @visited.include?(pos)}.length
+ end
+
+ # Select the next square to move to. Returns -1 if there are no available
+ # squares remaining that we can move to.
+ def next_square(square)
+ minimum = 9
+ nxt = -1
+ valid_moves(square).each{|pos|
+ unless @visited.include?(pos)
+ cnt = check_square(pos)
+ if cnt < minimum
+ minimum = cnt
+ nxt = pos
+ elsif cnt == minimum
+ nxt = edgemost(nxt, pos)
+ end
+ end
+ }
+ nxt
+ end
+
+ # Select the square nearest the edge of the board
+ def edgemost(nxt, pos)
+ col_A = 3 - ((3.5 - nxt % 8).abs.to_i)
+ col_B = 3 - ((3.5 - pos % 8).abs.to_i)
+ row_A = 3 - ((3.5 - nxt.div(8)).abs.to_i)
+ row_B = 3 - ((3.5 - pos.div(8)).abs.to_i)
+ (col_A * row_A < col_B * row_B)? nxt : pos
+ end
+
+ # Display a square number as a standard chess square notation.
+ def _N(square)
+ '%c%d' % [(97 + square % 8), (square.div(8) + 1)]
+ end
+
+ # Perform a Knight's move and schedule the next move.
+ def move_piece(last, square)
+ @log.insert(:end, "#{@visited.length}. #{_N last} -> #{_N square}\n", '')
+ @log.see(:end)
+ @board.itemconfigure(1+last, :state=>:normal, :outline=>'black')
+ @board.itemconfigure(1+square, :state=>:normal, :outline=>'red')
+ @knight.coords(@board.coords(1+square)[0..1])
+ @visited << square
+ if (nxt = next_square(square)) != -1
+ @after_id = Tk.after(@delay.numeric){move_piece(square, nxt) rescue nil}
+ else
+ @start_btn.state :normal
+ if @visited.length == 64
+ if @initial == square
+ @log.insert :end, 'Closed tour!'
+ else
+ @log.insert :end, "Success\n", {}
+ Tk.after(@delay.numeric * 2){tour(rand(64))} if @continuous.bool
+ end
+ else
+ @log.insert :end, "FAILED!\n", {}
+ end
+ end
+ end
+
+ # Begin a new tour of the board given a random start position
+ def tour(square = nil)
+ @visited.clear
+ @log.clear
+ @start_btn.state :disabled
+ 1.upto(64){|n|
+ @board.itemconfigure(n, :state=>:disabled, :outline=>'black')
+ }
+ unless square
+ square = @board.find_closest(*(@knight.coords << 0 << 65))[0].to_i - 1
+ end
+ @initial = square
+ Tk.after_idle{ move_piece(@initial, @initial) rescue nil }
+ end
+
+ def _stop
+ Tk.after_cancel(@after_id) rescue nil
+ end
+
+ def _exit
+ _stop
+ $knightstour.destroy
+ end
+
+ def set_delay(new)
+ @delay.numeric = new.to_i
+ end
+
+ def drag_start(w, x, y)
+ w.dtag('selected')
+ w.addtag('selected', :withtag, 'current')
+ @dragging = [x, y]
+ end
+
+ def drag_motion(w, x, y)
+ return unless @dragging
+ w.move('selected', x - @dragging[0], y - @dragging[1])
+ @dragging = [x, y]
+ end
+
+ def drag_end(w, x, y)
+ square = w.find_closest(x, y, 0, 65)
+ w.coords('selected', w.coords(square)[0..1])
+ w.dtag('selected')
+ @dragging = nil
+ end
+
+ def make_SeeDismiss
+ ## See Code / Dismiss
+ frame = Ttk::Frame.new($knightstour)
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'knightstour'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $knightstour.destroy
+ $knightstour = nil
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+ frame
+ end
+
+ def create_gui(parent = nil)
+ $knightstour.destroy rescue nil
+ $knightstour = Tk::Toplevel.new(parent, :title=>"Knight's tour")
+ $knightstour.withdraw
+ base_f = Ttk::Frame.new($knightstour)
+ @board = Tk::Canvas.new(base_f, :width=>240, :height=>240)
+ @log = Tk::Text.new(base_f, :width=>12, :height=>1,
+ :font=>'Arial 8', :background=>'white')
+ scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f))
+
+ @visited = []
+ @delay = TkVariable.new(600)
+ @continuous = TkVariable.new(false)
+
+ tool_f = Ttk::Frame.new($knightstour)
+ label = Ttk::Label.new(tool_f, :text=>'Speed')
+ scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay,
+ :command=>proc{|n| set_delay(n)})
+ check = Ttk::Checkbutton.new(tool_f, :text=>'Repeat',
+ :variable=>@continuous)
+ @start_btn = Ttk::Button.new(tool_f, :text=>'Start',
+ :command=>proc{tour()})
+ @exit_btn = Ttk::Button.new(tool_f, :text=>'Exit',
+ :command=>proc{_exit()})
+
+ 7.downto(0){|row|
+ 0.upto(7){|col|
+ if ((col & 1) ^ (row & 1)).zero?
+ fill = 'bisque'
+ dfill = 'bisque3'
+ else
+ fill = 'tan3'
+ dfill = 'tan4'
+ end
+ coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30]
+ @board.create(TkcRectangle, coords,
+ :fill=>fill, :disabledfill=>dfill,
+ :width=>2, :state=>:disabled)
+ }
+ }
+
+ @knight_font = TkFont.new(:size=>-24)
+ @knight = TkcText.new(@board, 0, 0, :font=>@knight_font,
+ :text=>Tk::UTF8_String.new('\u265e'),
+ :anchor=>'nw', # :tags=>'knight',
+ :fill=>'black', :activefill=>'#600000')
+ @knight.coords(@board.coords(rand(64)+1)[0..1])
+ @knight.bind('ButtonPress-1', '%W %x %y'){|w,x,y| drag_start(w,x,y)}
+ @knight.bind('Motion', '%W %x %y'){|w,x,y| drag_motion(w,x,y)}
+ @knight.bind('ButtonRelease-1', '%W %x %y'){|w,x,y| drag_end(w,x,y)}
+
+ Tk.grid(@board, @log, scr, :sticky=>'news')
+ base_f.grid_rowconfigure(0, :weight=>1)
+ base_f.grid_columnconfigure(0, :weight=>1)
+
+ Tk.grid(base_f, '-', '-', '-', '-', '-', :sticky=>'news')
+ widgets = [label, scale, check, @start_btn]
+ sg = nil
+ unless $RubyTk_WidgetDemo
+ widgets << @exit_btn
+ if Tk.windowingsystem != 'aqua'
+ #widgets.unshift(Ttk::SizeGrip.new(tool_f))
+ Ttk::SizeGrip.new(tool_f).pack(:side=>:right, :anchor=>'se')
+ end
+ end
+ Tk.pack(widgets, :side=>:right)
+ if Tk.windowingsystem == 'aqua'
+ TkPack.configure(widgets, :padx=>[4, 4], :pady=>[12, 12])
+ TkPack.configure(widgets[0], :padx=>[4, 24])
+ TkPack.configure(widgets[-1], :padx=>[16, 4])
+ end
+
+ Tk.grid(tool_f, '-', '-', '-', '-', '-', :sticky=>'ew')
+
+ if $RubyTk_WidgetDemo
+ Tk.grid(make_SeeDismiss(), '-', '-', '-', '-', '-', :sticky=>'ew')
+ end
+
+ $knightstour.grid_rowconfigure(0, :weight=>1)
+ $knightstour.grid_columnconfigure(0, :weight=>1)
+
+ $knightstour.bind('Control-F2'){TkConsole.show}
+ $knightstour.bind('Return'){@start_btn.invoke}
+ $knightstour.bind('Escape'){@exit_btn.invoke}
+ $knightstour.bind('Destroy'){ _stop }
+ $knightstour.protocol('WM_DELETE_WINDOW'){ _exit }
+
+ $knightstour.deiconify
+ $knightstour.tkwait_destroy
+ end
+
+ def initialize(parent = nil)
+ create_gui(parent)
+ end
+end
+
+Tk.root.withdraw unless $RubyTk_WidgetDemo
+Thread.new{Tk.mainloop} if __FILE__ == $0
+Knights_Tour.new
diff --git a/ext/tk/sample/demos-en/label.rb b/ext/tk/sample/demos-en/label.rb
new file mode 100644
index 0000000000..5be06eafee
--- /dev/null
+++ b/ext/tk/sample/demos-en/label.rb
@@ -0,0 +1,72 @@
+# label.rb
+#
+# This demonstration script creates a toplevel window containing
+# several label widgets.
+#
+# label widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($label_demo) && $label_demo
+ $label_demo.destroy
+ $label_demo = nil
+end
+
+# demo toplevel widget
+$label_demo = TkToplevel.new {|w|
+ title("Label Demonstration")
+ iconname("label")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "Five labels are displayed below: three textual ones on the left, and a bitmap label and a text label on the right. Labels are pretty boring because you can't do anything with them."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $label_demo
+ $label_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'label'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# label demo
+f_left = TkFrame.new(base_frame)
+f_right = TkFrame.new(base_frame)
+[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes',
+ 'padx'=>10, 'pady'=>10, 'fill'=>'both')}
+
+# label
+[ TkLabel.new(f_left, 'text'=>'First label'),
+ TkLabel.new(f_left, 'text'=>'Second label, raised',
+ 'relief'=>'raised'),
+ TkLabel.new(f_left, 'text'=>'Third label, sunken', 'relief'=>'sunken')
+].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')}
+
+# TkLabel.new(f_right) {
+Tk::Label.new(f_right) {
+ bitmap('@' + [$demo_dir,'..','images','face.xbm'].join(File::Separator))
+ borderwidth 2
+ relief 'sunken'
+}.pack('side'=>'top')
+
+TkLabel.new(f_right) { text 'Tcl/Tk Proprietor' }.pack('side'=>'top')
+
diff --git a/ext/tk/sample/demos-en/labelframe.rb b/ext/tk/sample/demos-en/labelframe.rb
new file mode 100644
index 0000000000..ad968bc061
--- /dev/null
+++ b/ext/tk/sample/demos-en/labelframe.rb
@@ -0,0 +1,95 @@
+# labelframe.rb
+#
+# This demonstration script creates a toplevel window containing
+# several labelframe widgets.
+#
+# based on "Id: labelframe.tcl,v 1.2 2001/10/30 11:21:50 dkf Exp"
+
+
+if defined?($labelframe_demo) && $labelframe_demo
+ $labelframe_demo.destroy
+ $labelframe_demo = nil
+end
+
+$labelframe_demo = TkToplevel.new {|w|
+ title("Labelframe Demonstration")
+ iconname("labelframe")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true)
+
+# Some information
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+Labelframes are used to group related widgets together. \
+The label may be either plain text or another widget. \
+If your Tk library linked to Ruby doesn't include a 'labelframe' widget, \
+this demo doesn't work. Please use later version of Tk \
+which supports a 'labelframe' widget.
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $labelframe_demo.destroy
+ $labelframe_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'labelframe'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+# Demo area
+w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
+ :expand=>true)
+
+# A group of radiobuttons in a labelframe
+TkLabelFrame.new(w, :text=>'Value',
+ :padx=>2, :pady=>2) {|f|
+ grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m')
+
+ v = TkVariable.new
+ (1..4).each{|i|
+ TkRadiobutton.new(f, :text=>"This is value #{i}",
+ :variable=>v, :value=>i) {
+ pack(:side=>:top, :fill=>:x, :pady=>2)
+ }
+ }
+}
+
+
+# Using a label window to control a group of options.
+$lfdummy = TkVariable.new(0)
+
+def lfEnableButtons(w)
+ TkWinfo.children(w).each{|child|
+ next if child.path =~ /\.cb$/
+ if $lfdummy == 1
+ child.state(:normal)
+ else
+ child.state(:disabled)
+ end
+ }
+end
+
+TkLabelFrame.new(w, :pady=>2, :padx=>2){|f|
+ TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
+ :text=>"Use this option.", :padx=>0) {|cb|
+ command proc{lfEnableButtons(f)}
+ f.labelwidget(cb)
+ }
+ grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m')
+
+ %w(Option1 Option2 Option3).each{|str|
+ TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2)
+ }
+
+ lfEnableButtons(f)
+}
+
+TkGrid.columnconfigure(w, [0,1], :weight=>1)
diff --git a/ext/tk/sample/demos-en/mclist.rb b/ext/tk/sample/demos-en/mclist.rb
new file mode 100644
index 0000000000..17019bb15b
--- /dev/null
+++ b/ext/tk/sample/demos-en/mclist.rb
@@ -0,0 +1,117 @@
+# mclist.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# tree widget configured as a multi-column listbox.
+#
+# based on "Id: mclist.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($mclist_demo) && $mclist_demo
+ $mclist_demo.destroy
+ $mclist_demo = nil
+end
+
+$mclist_demo = TkToplevel.new {|w|
+ title("Multi-Column List")
+ iconname("mclist")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true)
+
+## Explanatory text
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
+ :text=><<EOL).pack(:fill=>:x)
+Ttk is the new Tk themed widget set. \
+One of the widgets it includes is a tree widget, \
+which can be configured to display multiple columns of informational data \
+without displaying the tree itself. \
+This is a simple way to build a listbox that has multiple columns. \
+Clicking on the heading for a column will sort the data by that column. \
+You can also change the width of the columns \
+by dragging the boundary between them.
+EOL
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'mclist'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $mclist_demo.destroy
+ $mclist_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+container = Ttk::Frame.new(base_frame)
+tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency),
+ :show=>:headings)
+if Tk.windowingsystem != 'aqua'
+ vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Ttk::Scrollbar.new(base_frame))
+else
+ vsb = tree.yscrollbar(Tk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Tk::Scrollbar.new(base_frame))
+end
+
+container.pack(:fill=>:both, :expand=>true)
+Tk.grid(tree, vsb, :in=>container, :sticky=>'nsew')
+Tk.grid(hsb, :in=>container, :sticky=>'nsew')
+container.grid_columnconfigure(0, :weight=>1)
+container.grid_rowconfigure(0, :weight=>1)
+
+## The data we're going to insert
+data = [
+ ['Argentina', 'Buenos Aires', 'ARS'],
+ ['Australia', 'Canberra', 'AUD'],
+ ['Brazil', 'Brazilia', 'BRL'],
+ ['Canada', 'Ottawa', 'CAD'],
+ ['China', 'Beijing', 'CNY'],
+ ['France', 'Paris', 'EUR'],
+ ['Germany', 'Berlin', 'EUR'],
+ ['India', 'New Delhi', 'INR'],
+ ['Italy', 'Rome', 'EUR'],
+ ['Japan', 'Tokyo', 'JPY'],
+ ['Mexico', 'Mexico City', 'MXN'],
+ ['Russia', 'Moscow', 'RUB'],
+ ['South Africa', 'Pretoria', 'ZAR'],
+ ['United Kingdom', 'London', 'GBP'],
+ ['United States', 'Washington, D.C.', 'USD'],
+]
+
+## Code to insert the data nicely
+font = Ttk::Style.lookup(tree[:style], :font)
+cols = %w(country capital currency)
+cols.zip(%w(Country Capital Currency)).each{|col, name|
+ tree.heading_configure(col, :text=>name,
+ :command=>proc{sort_by(tree, col, false)})
+ tree.column_configure(col, :width=>TkFont.measure(font, name))
+}
+
+data.each{|country, capital, currency|
+ #tree.insert('', :end, :values=>[country, capital, currency])
+ tree.insert(nil, :end, :values=>[country, capital, currency])
+ cols.zip([country, capital, currency]).each{|col, val|
+ len = TkFont.measure(font, "#{val} ")
+ if tree.column_cget(col, :width) < len
+ tree.column_configure(col, :width=>len)
+ end
+ }
+}
+
+## Code to do the sorting of the tree contents when clicked on
+def sort_by(tree, col, direction)
+ tree.children(nil).map!{|row| [tree.get(row, col), row.id]} .
+ sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) .
+ each_with_index{|info, idx| tree.move(info[1], nil, idx)}
+
+ tree.heading_configure(col, :command=>proc{sort_by(tree, col, ! direction)})
+end
diff --git a/ext/tk/sample/demos-en/menu.rb b/ext/tk/sample/demos-en/menu.rb
new file mode 100644
index 0000000000..a458dbbc14
--- /dev/null
+++ b/ext/tk/sample/demos-en/menu.rb
@@ -0,0 +1,196 @@
+#
+# menus widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($menu_demo) && $menu_demo
+ $menu_demo.destroy
+ $menu_demo = nil
+end
+
+# demo toplevel widget
+$menu_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("menu")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($menu_demo).pack(:fill=>:both, :expand=>true)
+
+# menu frame
+$menu_frame = TkFrame.new(base_frame, 'relief'=>'raised', 'bd'=>2)
+$menu_frame.pack('side'=>'top', 'fill'=>'x')
+
+begin
+ windowingsystem = Tk.windowingsystem()
+rescue
+ windowingsystem = ""
+end
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ text("This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse.")
+ else
+ text("This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu.")
+ end
+}.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $menu_demo
+ $menu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'menu'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# menu
+TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|file_menu|
+ m.configure('menu'=>file_menu)
+ add('command', 'label'=>'Open...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Open..." entry'})
+ add('command', 'label'=>'New', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "New" entry'})
+ add('command', 'label'=>'Save', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save" entry'})
+ add('command', 'label'=>'Save As...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save As..." entry'})
+ add('separator')
+ add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print Setup..." entry'})
+ add('command', 'label'=>'Print...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print..." entry'})
+ add('separator')
+ add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu_demo.destroy})
+ }
+}
+
+if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ modifier = 'Command'
+elsif $tk_platform['platform'] == 'windows'
+ modifier = 'Control'
+else
+ modifier = 'Meta'
+end
+
+TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|basic_menu|
+ m.configure('menu'=>basic_menu)
+ add('command', 'label'=>'Long entry that does nothing')
+ ['A','B','C','D','E','F','G'].each{|c|
+ add('command', 'label'=>"Print letter \"#{c}\"",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
+ 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
+ $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
+ m.configure('menu'=>cascade_menu)
+ add('command', 'label'=>'Print hello',
+ 'command'=>proc{print "Hello\n"},
+ 'accelerator'=>"#{modifier}+H", 'underline'=>6)
+ $menu_demo.bind("#{modifier}-h", proc{print "Hello\n"})
+ add('command', 'label'=>'Print goodbye',
+ 'command'=>proc{print "Goodbye\n"},
+ 'accelerator'=>"#{modifier}+G", 'underline'=>6)
+ $menu_demo.bind("#{modifier}-g", proc{print "Goodbye\n"})
+
+ TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check|
+ cascade_menu.add('cascade', 'label'=>'Check buttons',
+ 'menu'=>cascade_check, 'underline'=>0)
+ oil = TkVariable.new(0)
+ add('check', 'label'=>'Oil checked', 'variable'=>oil)
+ trans = TkVariable.new(0)
+ add('check', 'label'=>'Transmission checked', 'variable'=>trans)
+ brakes = TkVariable.new(0)
+ add('check', 'label'=>'Brakes checked', 'variable'=>brakes)
+ lights = TkVariable.new(0)
+ add('check', 'label'=>'Lights checked', 'variable'=>lights)
+ add('separator')
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu_demo,
+ ['oil', oil],
+ ['trans', trans],
+ ['brakes', brakes],
+ ['lights', lights])} )
+ invoke 1
+ invoke 3
+ }
+
+ TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio|
+ cascade_menu.add('cascade', 'label'=>'Radio buttons',
+ 'menu'=>cascade_radio, 'underline'=>0)
+ pointSize = TkVariable.new
+ add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32)
+ add('separator')
+ style = TkVariable.new
+ add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
+ add('separator')
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu_demo,
+ ['pointSize', pointSize],
+ ['style', style])} )
+ invoke 1
+ invoke 7
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|icon_menu|
+ m.configure('menu'=>icon_menu)
+ add('command',
+ 'bitmap'=>'@'+[$demo_dir,'..',
+ 'images','pattern.xbm'].join(File::Separator),
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.',
+ 'bitmap'=>'', 'default'=>0,
+ 'buttons'=>'Dismiss')} )
+ ['info', 'questhead', 'error'].each{|icon|
+ add('command', 'bitmap'=>icon,
+ 'command'=>proc{print "You invoked the #{icon} bitmap\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|more_menu|
+ m.configure('menu'=>more_menu)
+ [ 'An entry','Another entry','Does nothing','Does almost nothing',
+ 'Make life meaningful' ].each{|i|
+ add('command', 'label'=>i,
+ 'command'=>proc{print "You invoked \"#{i}\"\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m) {|colors_menu|
+ m.configure('menu'=>colors_menu)
+ ['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
+ add('command', 'label'=>c, 'background'=>c,
+ 'command'=>proc{print "You invoked \"#{c}\"\n"})
+ }
+ }
+}
diff --git a/ext/tk/sample/demos-en/menu84.rb b/ext/tk/sample/demos-en/menu84.rb
new file mode 100644
index 0000000000..4fc53962e7
--- /dev/null
+++ b/ext/tk/sample/demos-en/menu84.rb
@@ -0,0 +1,215 @@
+#
+# menus widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($menu84_demo) && $menu84_demo
+ $menu84_demo.destroy
+ $menu84_demo = nil
+end
+
+# demo toplevel widget
+$menu84_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("menu84")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($menu84_demo).pack(:fill=>:both, :expand=>true)
+
+begin
+ windowingsystem = Tk.windowingsystem()
+rescue
+ windowingsystem = ""
+end
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ text("This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse.")
+ else
+ text("This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu.")
+ end
+}.pack('side'=>'top')
+
+
+menustatus = TkVariable.new(" ")
+TkFrame.new(base_frame) {|frame|
+ TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken',
+ 'bd'=>1, 'font'=>['Helvetica', '10'],
+ 'anchor'=>'w').pack('side'=>'left', 'padx'=>2,
+ 'expand'=>true, 'fill'=>'both')
+ pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
+}
+
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $menu84_demo
+ $menu84_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'menu84'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+# create menu frame
+$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false)
+
+# menu
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Open...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Open..." entry'})
+ add('command', 'label'=>'New', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "New" entry'})
+ add('command', 'label'=>'Save', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save" entry'})
+ add('command', 'label'=>'Save As...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Save As..." entry'})
+ add('separator')
+ add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print Setup..." entry'})
+ add('command', 'label'=>'Print...', 'command'=>proc{fail 'this is just a demo: no action has been defined for the "Print..." entry'})
+ add('separator')
+ add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy})
+}
+
+if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem = "classic" || windowingsystem = "aqua"
+ modifier = 'Command'
+elsif $tk_platform['platform'] == 'windows'
+ modifier = 'Control'
+else
+ modifier = 'Meta'
+end
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Long entry that does nothing')
+ ['A','B','C','D','E','F','G'].each{|c|
+ add('command', 'label'=>"Print letter \"#{c}\"",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
+ 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
+ $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
+ }
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Print hello',
+ 'command'=>proc{print "Hello\n"},
+ 'accelerator'=>"#{modifier}+H", 'underline'=>6)
+ $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"})
+ add('command', 'label'=>'Print goodbye',
+ 'command'=>proc{print "Goodbye\n"},
+ 'accelerator'=>"#{modifier}+G", 'underline'=>6)
+ $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"})
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
+ m.add('cascade', 'label'=>'Check buttons',
+ 'menu'=>cascade_check, 'underline'=>0)
+ oil = TkVariable.new(0)
+ add('check', 'label'=>'Oil checked', 'variable'=>oil)
+ trans = TkVariable.new(0)
+ add('check', 'label'=>'Transmission checked', 'variable'=>trans)
+ brakes = TkVariable.new(0)
+ add('check', 'label'=>'Brakes checked', 'variable'=>brakes)
+ lights = TkVariable.new(0)
+ add('check', 'label'=>'Lights checked', 'variable'=>lights)
+ add('separator')
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu84_demo,
+ ['oil', oil],
+ ['trans', trans],
+ ['brakes', brakes],
+ ['lights', lights])} )
+ invoke 1
+ invoke 3
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
+ m.add('cascade', 'label'=>'Radio buttons',
+ 'menu'=>cascade_radio, 'underline'=>0)
+ pointSize = TkVariable.new
+ add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32)
+ add('separator')
+ style = TkVariable.new
+ add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
+ add('separator')
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu84_demo,
+ ['pointSize', pointSize],
+ ['style', style])} )
+ invoke 1
+ invoke 7
+ }
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
+ add('command', 'hidemargin'=>1,
+ 'bitmap'=>'@'+[$demo_dir,'..',
+ 'images','pattern.xbm'].join(File::Separator),
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.',
+ 'bitmap'=>'', 'default'=>0,
+ 'buttons'=>'Dismiss')} )
+ ['info', 'questhead', 'error'].each{|icon|
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ 'command'=>proc{print "You invoked the #{icon} bitmap\n"})
+ }
+
+ entryconfigure(2, :columnbreak=>true)
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0)
+ [ 'An entry','Another entry','Does nothing','Does almost nothing',
+ 'Make life meaningful' ].each{|i|
+ add('command', 'label'=>i,
+ 'command'=>proc{print "You invoked \"#{i}\"\n"})
+ }
+
+ m.entryconfigure('Does almost nothing',
+ 'bitmap'=>'questhead', 'compound'=>'left',
+ 'command'=>proc{
+ TkDialog.new('title'=>'Compound Menu Entry',
+ 'message'=>'The menu entry you invoked'+
+ 'displays both a bitmap and '+
+ 'a text string. Other than '+
+ 'this, it isjust like any '+
+ 'other menu entry.',
+ 'buttons'=>['OK'], 'bitmap'=>'')
+ })
+}
+
+TkMenu.new($menu84_frame) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0)
+ ['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
+ add('command', 'label'=>c, 'background'=>c,
+ 'command'=>proc{print "You invoked \"#{c}\"\n"})
+ }
+}
+
+$menu84_demo.menu($menu84_frame)
+
+TkMenu.bind('<MenuSelect>', proc{|w|
+ begin
+ label = w.entrycget('active', 'label')
+ rescue
+ label = " "
+ end
+ menustatus.value = label
+ Tk.update(true)
+ }, '%W')
diff --git a/ext/tk/sample/demos-en/menubu.rb b/ext/tk/sample/demos-en/menubu.rb
new file mode 100644
index 0000000000..6e28e813b3
--- /dev/null
+++ b/ext/tk/sample/demos-en/menubu.rb
@@ -0,0 +1,237 @@
+# menubutton.rb
+#
+# This demonstration script creates a window with a bunch of menus
+# and cascaded menus using menubuttons.
+
+require "tkcanvas"
+
+def optionMenu(menubutton, varName, firstValue, *rest)
+ varName.value = firstValue
+ configoptions = {'textvariable'=>varName,'indicatoron'=>'on',
+ 'relief'=>'raised','borderwidth'=>2,'highlightthickness'=>2,
+ 'anchor'=>'c','direction'=>'flush'}
+ configoptions.each {|key, value|
+ menubutton.configure(key, value)
+ }
+ menu = TkMenu.new(menubutton) {
+ tearoff 'off'
+ add 'radio', 'label'=>firstValue, 'variable'=>varName
+ }
+ menubutton.menu(menu)
+ for i in rest
+ menu.add 'radio', 'label'=>i, 'variable'=>varName
+ end
+
+ return menu
+end
+
+if defined?($menubu_demo) && $menubu_demo
+ $menubu_demo.destroy
+ $menubu_demo = nil
+end
+
+$menubu_demo = TkToplevel.new {|w|
+ title("Menu Button Demonstration")
+ iconname("menubutton")
+}
+
+positionWindow($menubu_demo)
+
+base_frame = TkFrame.new($menubu_demo).pack(:fill=>:both, :expand=>true)
+
+# version check
+if $tk_version.to_f < 8.0
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ text("This is a demonstration of menubuttons. The \"Below\" menubutton pops its menu below the button; the \"Right\" button pops to the right, etc. There are two option menus directly below this text; one is just a standard menu and the other is a 16-color palette.")
+}.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $menubu_demo
+ $menubu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'menubu'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+else ; # Tk8.x
+
+body = TkFrame.new(base_frame)
+body.pack('expand'=>'yes', 'fill'=>'both')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+right = TkMenubutton.new(body) {
+ text "Right"
+ underline 0
+ direction 'right'
+ relief 'raised'
+}
+rightMenu = TkMenu.new(right) {
+ tearoff 0
+ add 'command', 'label'=>"Right menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""}
+ add 'command', 'label'=>"Right menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Right menu.\""}
+}
+right.menu(rightMenu)
+right.grid('row'=>1, 'column'=>0, 'sticky'=>'w')
+
+left = TkMenubutton.new(body) {
+ text "Left"
+ underline 0
+ direction 'left'
+ relief 'raised'
+}
+leftMenu = TkMenu.new(left) {
+ tearoff 0
+ add 'command', 'label'=>"Left menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""}
+ add 'command', 'label'=>"Left menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Left menu.\""}
+}
+left.menu(leftMenu)
+left.grid('row'=>1, 'column'=>2, 'sticky'=>'e')
+
+center = TkFrame.new(body) {
+ grid('row'=>1, 'column'=>1, 'sticky'=>'news')
+}
+
+above = TkMenubutton.new(body) {
+ text "Above"
+ underline 0
+ direction 'above'
+ relief 'raised'
+}
+aboveMenu = TkMenu.new(above) {
+ tearoff 0
+ add 'command', 'label'=>"Above menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Above menu.\""}
+ add 'command', 'label'=>"Above menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Above menu.\""}
+}
+above.menu(aboveMenu)
+above.grid('row'=>2, 'column'=>1, 'sticky'=>'s')
+
+center = TkFrame.new(body) {
+ grid('row'=>1, 'column'=>1, 'sticky'=>'news')
+}
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc {
+ tmppath = $menubu_demo
+ $menubu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc { showCode 'menubu' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m')
+
+msg = TkLabel.new(center) {
+# font $font
+ wraplength '4i'
+ justify 'left'
+ text "This is a demonstration of menubuttons. The \"Below\" menubutton pops its menu below the button; the \"Right\" button pops to the right, etc. There are two option menus directly below this text; one is just a standard menu and the other is a 16-color palette."
+}
+msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25)
+
+TkFrame.new(center) {|f|
+ menubuttonoptions = TkVariable.new
+ mbutton = TkMenubutton.new(f)
+ options = optionMenu(mbutton, menubuttonoptions,
+ 'one', 'two', 'three')
+ mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
+ paletteColor = TkVariable.new
+ colors = ['Black','red4','DarkGreen','NavyBlue', 'gray75',
+ 'Red','Green','Blue','gray50','Yellow','Cyan','Magenta',
+ 'White','Brown','DarkSeaGreen','DarkViolet']
+ colorMenuButton = TkMenubutton.new(f)
+ m = optionMenu(colorMenuButton, paletteColor, *colors)
+ begin
+ windowingsystem = Tk.windowingsystem()
+ rescue
+ windowingsystem = ""
+ end
+ if windowingsystem == "classic" || windowingsystem == "aqua"
+ topBorderColor = 'Black'
+ bottomBorderColor = 'Black'
+ else
+ topBorderColor = 'gray50'
+ bottomBorderColor = 'gray75'
+ end
+ for i in 0..15
+ image = TkPhotoImage.new('height'=>16, 'width'=>16)
+ image.put(topBorderColor, 0, 0, 16, 1)
+ image.put(topBorderColor, 0, 1, 1, 16)
+ image.put(bottomBorderColor, 0, 15, 16, 16)
+ image.put(bottomBorderColor, 15, 1, 16, 16)
+ image.put(colors[i], 1, 1, 15, 15)
+
+ selectimage = TkPhotoImage.new('height'=>16, 'width'=>16)
+ selectimage.put('Black', 0, 0, 16, 2)
+ selectimage.put('Black', 0, 2, 2, 16)
+ selectimage.put('Black', 2, 14, 16, 16)
+ selectimage.put('Black', 14, 2, 16, 14)
+ selectimage.put(colors[i], 2, 2, 14, 14)
+
+ m.entryconfigure(i, 'image'=>image, 'selectimage'=>selectimage, 'hidemargin'=>'on')
+ end
+ m.configure('tearoff', 'on')
+ for c in ['Black', 'gray75', 'gray50', 'White']
+ m.entryconfigure(c, 'columnbreak'=>1)
+ end
+ colorMenuButton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
+ pack 'padx'=>25, 'pady'=>25
+}
+
+end ; # Tk8.x
diff --git a/ext/tk/sample/demos-en/msgbox.rb b/ext/tk/sample/demos-en/msgbox.rb
new file mode 100644
index 0000000000..d3d66bfeb0
--- /dev/null
+++ b/ext/tk/sample/demos-en/msgbox.rb
@@ -0,0 +1,90 @@
+# msgbox.rb
+#
+# This demonstration script creates message boxes of various type
+#
+# message boxes widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($msgbox_demo) && $msgbox_demo
+ $msgbox_demo.destroy
+ $msgbox_demo = nil
+end
+
+# demo toplevel widget
+$msgbox_demo = TkToplevel.new {|w|
+ title("Message Box Demonstration")
+ iconname("messagebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($msgbox_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box.").pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $msgbox_demo
+ $msgbox_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'msgbox'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Message Box'
+ command proc{showMessageBox $msgbox_demo}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+$msgbox_leftframe = TkFrame.new(base_frame)
+$msgbox_rightframe = TkFrame.new(base_frame)
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top')
+TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxIcon = TkVariable.new('info')
+['error', 'info', 'question', 'warning'].each {|icon|
+ TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon,
+ 'relief'=>'flat', 'value'=>icon, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+TkLabel.new($msgbox_rightframe, 'text'=>'Type').pack('side'=>'top')
+TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxType = TkVariable.new('ok')
+['abortretryignore', 'ok', 'okcancel',
+ 'retrycancel', 'yesno', 'yesnocancel'].each {|type|
+ TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType,
+ 'relief'=>'flat', 'value'=>type, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+def showMessageBox(w)
+ button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
+ 'title'=>'Message', 'parent'=>w,
+ 'message'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon")
+
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
+ 'message'=>"You have selected \"#{button}\"")
+end
+
diff --git a/ext/tk/sample/demos-en/msgbox2.rb b/ext/tk/sample/demos-en/msgbox2.rb
new file mode 100644
index 0000000000..c227b59bb1
--- /dev/null
+++ b/ext/tk/sample/demos-en/msgbox2.rb
@@ -0,0 +1,91 @@
+# msgbox2.rb
+#
+# This demonstration script creates message boxes of various type
+#
+# message boxes widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($msgbox2_demo) && $msgbox2_demo
+ $msgbox2_demo.destroy
+ $msgbox2_demo = nil
+end
+
+# demo toplevel widget
+$msgbox2_demo = TkToplevel.new {|w|
+ title("Message Box Demonstration")
+ iconname("messagebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($msgbox2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"Choose the icon and type option of the message box. Then press the \"Message Box\" button to see the message box with both of a message and a detail.").pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $msgbox2_demo
+ $msgbox2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'msgbox2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Message Box'
+ command proc{showMessageBox2 $msgbox2_demo}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+$msgbox_leftframe = TkFrame.new(base_frame)
+$msgbox_rightframe = TkFrame.new(base_frame)
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkLabel.new($msgbox_leftframe, 'text'=>'Icon').pack('side'=>'top')
+TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxIcon = TkVariable.new('info')
+['error', 'info', 'question', 'warning'].each {|icon|
+ TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon,
+ 'relief'=>'flat', 'value'=>icon, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+TkLabel.new($msgbox_rightframe, 'text'=>'Type').pack('side'=>'top')
+TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxType = TkVariable.new('ok')
+['abortretryignore', 'ok', 'okcancel',
+ 'retrycancel', 'yesno', 'yesnocancel'].each {|type|
+ TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType,
+ 'relief'=>'flat', 'value'=>type, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+def showMessageBox2(w)
+ button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
+ 'title'=>'Message', 'parent'=>w,
+ 'message'=>"\"#{$msgboxType.value}\" Type MessageBox",
+ 'detail'=>"This is a \"#{$msgboxType.value}\" type messagebox with the \"#{$msgboxIcon.value}\" icon. Please click one of the following button.")
+
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
+ 'message'=>"You have selected \"#{button}\"")
+end
+
diff --git a/ext/tk/sample/demos-en/paned1.rb b/ext/tk/sample/demos-en/paned1.rb
new file mode 100644
index 0000000000..d3d66d1b16
--- /dev/null
+++ b/ext/tk/sample/demos-en/paned1.rb
@@ -0,0 +1,47 @@
+# paned1.rb
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows horizontally.
+#
+# based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp"
+
+if defined?($paned1_demo) && $paned1_demo
+ $paned1_demo.destroy
+ $paned1_demo = nil
+end
+
+$paned1_demo = TkToplevel.new {|w|
+ title("Horizontal Paned Window Demonstration")
+ iconname("paned1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.)
+If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'.
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $paned1_demo.destroy
+ $paned1_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'paned1'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+TkPanedwindow.new(base_frame, :orient=>:horizontal){|f|
+ add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'),
+ Tk::Label.new(f, :text=>"This is the\nright side", :bg=>'cyan'))
+
+ pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m')
+}
diff --git a/ext/tk/sample/demos-en/paned2.rb b/ext/tk/sample/demos-en/paned2.rb
new file mode 100644
index 0000000000..02293b0309
--- /dev/null
+++ b/ext/tk/sample/demos-en/paned2.rb
@@ -0,0 +1,94 @@
+# paned2.rb --
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows vertically.
+#
+# based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp"
+
+if defined?($paned2_demo) && $paned2_demo
+ $paned2_demo.destroy
+ $paned2_demo = nil
+end
+
+$paned2_demo = TkToplevel.new {|w|
+ title("Vertical Paned Window Demonstration")
+ iconname("paned2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+The sash between the two scrolled windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.)
+If your Tk library linked to Ruby doesn't include a 'panedwindow', this demo doesn't work. Please use later version of Tk which supports a 'panedwindow'.
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $paned2_demo.destroy
+ $paned2_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'paned2'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+paneList = TkVariable.new # define as normal variable (not array)
+paneList.value = [ # ruby's array --> tcl's list
+ 'List of Ruby/Tk Widgets',
+ 'TkButton',
+ 'TkCanvas',
+ 'TkCheckbutton',
+ 'TkEntry',
+ 'TkFrame',
+ 'TkLabel',
+ 'TkLabelframe',
+ 'TkListbox',
+ 'TkMenu',
+ 'TkMenubutton',
+ 'TkMessage',
+ 'TkPanedwindow',
+ 'TkRadiobutton',
+ 'TkScale',
+ 'TkScrollbar',
+ 'TkSpinbox',
+ 'TkText',
+ 'TkToplevel'
+]
+
+# Create the pane itself
+TkPanedwindow.new(base_frame, :orient=>:vertical){|f|
+ pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m')
+
+ add(TkFrame.new(f){|paned2_top|
+ TkListbox.new(paned2_top, :listvariable=>paneList) {
+ # Invert the first item to highlight it
+ itemconfigure(0, :background=>self.cget(:foreground),
+ :foreground=>self.cget(:background) )
+ yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right,
+ :fill=>:y))
+ pack(:fill=>:both, :expand=>true)
+ }
+ },
+
+ TkFrame.new(f, :height=>120) {|paned2_bottom|
+ # The bottom window is a text widget with scrollbar
+ paned2_xscr = TkScrollbar.new(paned2_bottom)
+ paned2_yscr = TkScrollbar.new(paned2_bottom)
+ paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) {
+ insert('1.0', "This is just a normal text widget")
+ xscrollbar(paned2_xscr)
+ yscrollbar(paned2_yscr)
+ }
+ Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew')
+ Tk.grid(paned2_xscr, :sticky=>'nsew')
+ TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1)
+ TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1)
+ } )
+}
diff --git a/ext/tk/sample/demos-en/pendulum.rb b/ext/tk/sample/demos-en/pendulum.rb
new file mode 100644
index 0000000000..306ac94a21
--- /dev/null
+++ b/ext/tk/sample/demos-en/pendulum.rb
@@ -0,0 +1,240 @@
+#
+# This demonstration illustrates how Tcl/Tk can be used to construct
+# simulations of physical systems.
+# (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+# destroy toplevel widget for this demo script
+if defined?($pendulum_demo) && $pendulum_demo
+ $pendulum_demo.destroy
+ $pendulum_demo = nil
+end
+
+# create toplevel widget
+$pendulum_demo = TkToplevel.new {|w|
+ title("Pendulum Animation Demonstration")
+ iconname("pendulum")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($pendulum_demo).pack(:fill=>:both, :expand=>true)
+
+# create label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text 'This demonstration shows how Ruby/Tk can be used to carry out animations that are linked to simulations of physical systems. In the left canvas is a graphical representation of the physical system itself, a simple pendulum, and in the right canvas is a graph of the phase space of the system, which is a plot of the angle (relative to the vertical) against the angular velocity. The pendulum bob may be repositioned by clicking and dragging anywhere on the left canvas.'
+}
+msg.pack('side'=>'top')
+
+# create frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $pendulum_demo
+ $pendulum_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Code'
+ command proc{showCode 'pendulum'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# animated wave
+class PendulumAnimationDemo
+ def initialize(frame)
+ # Create some structural widgets
+ @pane = TkPanedWindow.new(frame, :orient=>:horizontal).pack(:fill=>:both, :expand=>true)
+# @pane.add(@lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation'))
+# @pane.add(@lf2 = TkLabelFrame.new(@pane, :text=>'Phase Space'))
+ @lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation')
+ @lf2 = TkLabelFrame.new(@pane, :text=>'Phase Space')
+
+ # Create the canvas containing the graphical representation of the
+ # simulated system.
+ @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
+ :borderwidth=>2, :relief=>:sunken)
+ TkcText.new(@c, 5, 5, :anchor=>:nw,
+ :text=>'Click to Adjust Bob Start Position')
+ # Coordinates of these items don't matter; they will be set properly below
+ @plate = TkcLine.new(@c, 0, 25, 320, 25, :width=>2, :fill=>'grey50')
+ @rod = TkcLine.new(@c, 1, 1, 1, 1, :width=>3, :fill=>'black')
+ @bob = TkcOval.new(@c, 1, 1, 2, 2,
+ :width=>3, :fill=>'yellow', :outline=>'black')
+ TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'')
+
+ # pack
+ @c.pack(:fill=>:both, :expand=>true)
+
+ # Create the canvas containing the phase space graph; this consists of
+ # a line that gets gradually paler as it ages, which is an extremely
+ # effective visual trick.
+ @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white',
+ :borderwidth=>2, :relief=>:sunken)
+ @y_axis = TkcLine.new(@k, 160, 200, 160, 0, :fill=>'grey75', :arrow=>:last)
+ @x_axis = TkcLine.new(@k, 0, 100, 320, 100, :fill=>'grey75', :arrow=>:last)
+
+ @graph = {}
+ 90.step(0, -10){|i|
+ # Coordinates of these items don't matter;
+ # they will be set properly below
+ @graph[i] = TkcLine.new(@k, 0, 0, 1, 1, :smooth=>true, :fill=>"grey#{i}")
+ }
+
+ # labels
+ @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ :text=>'q', :font=>'Symbol 8')
+ @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ :text=>'dq', :font=>'Symbol 8')
+
+ # pack
+ @k.pack(:fill=>:both, :expand=>true)
+
+ # Initialize some variables
+ @points = []
+ @theta = 45.0
+ @dTheta = 0.0
+ @length = 150
+
+ # animation loop
+ @timer = TkTimer.new(15){ repeat }
+
+ # binding
+ @c.bindtags_unshift(btag = TkBindTag.new)
+ btag.bind('Destroy'){ @timer.stop }
+ btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)},
+ '%x %y')
+ btag.bind('B1-Motion', proc{|x, y| showPendulum(x.to_i, y.to_i)}, '%x %y')
+ btag.bind('ButtonRelease-1',
+ proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start },
+ '%x %y')
+
+ btag.bind('Configure', proc{|w| @plate.coords(0, 25, w.to_i, 25)}, '%w')
+
+ @k.bind('Configure', proc{|h, w|
+ h = h.to_i
+ w = w.to_i
+ @psh = h/2;
+ @psw = w/2
+ @x_axis.coords(2, @psh, w-2, @psh)
+ @y_axis.coords(@psw, h-2, @psw, 2)
+ @label_theta.coords(@psw-4, 6)
+ @label_dtheta.coords(w-6, @psh+4)
+ }, '%h %w')
+
+ # add
+ Tk.update
+ @pane.add(@lf1)
+ @pane.add(@lf2)
+
+ # init display
+ showPendulum
+
+ # animation start
+ @timer.start(500)
+ end
+
+ # This procedure makes the pendulum appear at the correct place on the
+ # canvas. If the additional arguments x, y are passed instead of computing
+ # the position of the pendulum from the length of the pendulum rod and its
+ # angle, the length and angle are computed in reverse from the given
+ # location (which is taken to be the centre of the pendulum bob.)
+ def showPendulum(x=nil, y=nil)
+ if x && y && (x != 160 || y != 25)
+ @dTheta = 0.0
+ x2 = x - 160
+ y2 = y - 25
+ @length = Math.hypot(x2, y2)
+ @theta = Math.atan2(x2,y2)*180/Math::PI
+ else
+ angle = @theta*Math::PI/180
+ x = 160 + @length*Math.sin(angle)
+ y = 25 + @length*Math.cos(angle)
+ end
+
+ @rod.coords(160, 25, x, y)
+ @bob.coords(x-15, y-15, x+15, y+15)
+ end
+
+ # Update the phase-space graph according to the current angle and the
+ # rate at which the angle is changing (the first derivative with
+ # respect to time.)
+ def showPhase
+ unless @psw && @psh
+ @psw = @k.width/2
+ @psh = @k.height/2
+ end
+ @points << @theta + @psw << -20*@dTheta + @psh
+ if @points.length > 100
+ @points = @points[-100..-1]
+ end
+ (0...100).step(10){|i|
+ first = - i
+ last = 11 - i
+ last = -1 if last >= 0
+ next if first > last
+ lst = @points[first..last]
+ @graph[i].coords(lst) if lst && lst.length >= 4
+ }
+ end
+
+ # This procedure is the "business" part of the simulation that does
+ # simple numerical integration of the formula for a simple rotational
+ # pendulum.
+ def recomputeAngle
+ scaling = 3000.0/@length/@length
+
+ # To estimate the integration accurately, we really need to
+ # compute the end-point of our time-step. But to do *that*, we
+ # need to estimate the integration accurately! So we try this
+ # technique, which is inaccurate, but better than doing it in a
+ # single step. What we really want is bound up in the
+ # differential equation:
+ # .. - sin theta
+ # theta + theta = -----------
+ # length
+ # But my math skills are not good enough to solve this!
+
+ # first estimate
+ firstDDTheta = -Math.sin(@theta * Math::PI/180) * scaling
+ midDTheta = @dTheta + firstDDTheta
+ midTheta = @theta + (@dTheta + midDTheta)/2
+ # second estimate
+ midDDTheta = -Math.sin(midTheta * Math::PI/180) * scaling
+ midDTheta = @dTheta + (firstDDTheta + midDDTheta)/2
+ midTheta = @theta + (@dTheta + midDTheta)/2
+ # Now we do a double-estimate approach for getting the final value
+ # first estimate
+ midDDTheta = -Math.sin(midTheta * Math::PI/180) * scaling
+ lastDTheta = midDTheta + midDDTheta
+ lastTheta = midTheta + (midDTheta+ lastDTheta)/2
+ # second estimate
+ lastDDTheta = -Math.sin(lastTheta * Math::PI/180) * scaling
+ lastDTheta = midDTheta + (midDDTheta + lastDDTheta)/2
+ lastTheta = midTheta + (midDTheta + lastDTheta)/2
+ # Now put the values back in our globals
+ @dTheta = lastDTheta
+ @theta = lastTheta
+ end
+
+ # This method ties together the simulation engine and the graphical
+ # display code that visualizes it.
+ def repeat
+ # Simulate
+ recomputeAngle
+
+ # Update the display
+ showPendulum
+ showPhase
+ end
+end
+
+# Start the animation processing
+PendulumAnimationDemo.new(base_frame)
diff --git a/ext/tk/sample/demos-en/plot.rb b/ext/tk/sample/demos-en/plot.rb
new file mode 100644
index 0000000000..f70daa3fb2
--- /dev/null
+++ b/ext/tk/sample/demos-en/plot.rb
@@ -0,0 +1,124 @@
+# plot.rb
+#
+# This demonstration script creates a canvas widget showing a 2-D
+# plot with data points that can be dragged with the mouse.
+#
+# 2-D plot widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($plot_demo) && $plot_demo
+ $plot_demo.destroy
+ $plot_demo = nil
+end
+
+# demo toplevel widget
+$plot_demo = TkToplevel.new {|w|
+ title("Plot Demonstration")
+ iconname("Plot")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"This window displays a canvas widget containing a simple 2-dimensional plot. You can doctor the data by dragging any of the points with mouse button 1."){
+ pack('side'=>'top')
+}
+
+# frame
+$plot_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $plot_demo
+ $plot_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'plot'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# font
+plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+
+# canvas
+$plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300)
+$plot_canvas.pack('side'=>'top', 'fill'=>'x')
+
+# plot
+TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2)
+TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2)
+TkcText.new($plot_canvas, 225, 20,
+ 'text'=>"A Simple Plot", 'font'=>plotFont, 'fill'=>'brown')
+
+(0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2)
+ TkcText.new($plot_canvas, x, 254,
+ 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n')
+}
+(0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2)
+ TkcText.new($plot_canvas, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e')
+}
+
+for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+end
+
+$plot_canvas.itembind('point', 'Any-Enter',
+ proc{$plot_canvas.itemconfigure 'current','fill','red'})
+$plot_canvas.itembind('point', 'Any-Leave',
+ proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'})
+$plot_canvas.itembind('point', '1',
+ proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y")
+$plot_canvas.itembind('point', 'ButtonRelease-1',
+ proc{$plot_canvas.dtag 'selected'})
+$plot_canvas.bind('B1-Motion',
+ proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y")
+
+$plot = {'lastX'=>0, 'lastY'=>0}
+
+# plotDown --
+# This method is invoked when the mouse is pressed over one of the
+# data points. It sets up state to allow the point to be dragged.
+#
+# Arguments:
+# w - The canvas window.
+# x, y - The coordinates of the mouse press.
+
+def plotDown (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $plot['lastX'] = x
+ $plot['lastY'] = y
+end
+
+# plotMove --
+# This method is invoked during mouse motion events. It drags the
+# current item.
+#
+# Arguments:
+# w - The canvas window.
+# x, y - The coordinates of the mouse.
+
+def plotMove (w, x, y)
+ w.move 'selected', x - $plot['lastX'], y - $plot['lastY']
+ $plot['lastX'] = x
+ $plot['lastY'] = y
+end
+
diff --git a/ext/tk/sample/demos-en/puzzle.rb b/ext/tk/sample/demos-en/puzzle.rb
new file mode 100644
index 0000000000..f16414aa4c
--- /dev/null
+++ b/ext/tk/sample/demos-en/puzzle.rb
@@ -0,0 +1,134 @@
+# puzzle.rb
+#
+# This demonstration script creates a 15-puzzle game using a collection
+# of buttons.
+#
+# widet demo 'puzzle' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($puzzle_demo) && $puzzle_demo
+ $puzzle_demo.destroy
+ $puzzle_demo = nil
+end
+
+# demo toplevel widget
+$puzzle_demo = TkToplevel.new {|w|
+ title("15-Puzzle Demonstration")
+ iconname("15-Puzzle")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($puzzle_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "A 15-puzzle appears below as a collection of buttons. Click on any of the pieces next to the space, and that piece will slide over the space. Continue this until the pieces are arranged in numerical order from upper-left to lower-right."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $puzzle_demo
+ $puzzle_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'puzzle'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+
+# Special trick: select a darker color for the space by creating a
+# scrollbar widget and using its trough color.
+begin
+ if Tk.windowingsystem() == 'aqua'
+ frameWidth = 168
+ frameHeight = 168
+ elsif Tk.default_widget_set == :Ttk
+ frameWidth = 148
+ frameHeight = 124
+ else
+ frameWidth = 120
+ frameHeight = 120
+ end
+rescue
+ frameWidth = 120
+ frameHeight = 120
+end
+
+# depend_on_button_width = true
+depend_on_button_width = false
+
+s = TkScrollbar.new(base_frame)
+base = TkFrame.new(base_frame) {
+ width frameWidth
+ height frameHeight
+ borderwidth 2
+ relief 'sunken'
+ bg s['troughcolor']
+}
+s.destroy
+base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c')
+
+def def_puzzleswitch_proc(w, num)
+ proc{puzzleSwitch w, num}
+end
+
+$xpos = {}
+$ypos = {}
+order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12]
+(0..14).each{|i|
+ num = order[i]
+ $xpos[num] = (i % 4) * 0.25
+ $ypos[num] = (i / 4) * 0.25
+ TkButton.new(base) {|w|
+ relief 'raised'
+ text num
+ highlightthickness 0
+ command def_puzzleswitch_proc(w, num)
+ if depend_on_button_width && (w.winfo_reqwidth * 4 > base.width)
+ base.width = w.winfo_reqwidth * 4
+ end
+ }.place('relx'=>$xpos[num], 'rely'=>$ypos[num],
+ 'relwidth'=>0.25, 'relheight'=>0.25)
+}
+$xpos['space'] = 0.75
+$ypos['space'] = 0.75
+
+
+# puzzleSwitch --
+# This procedure is invoked when the user clicks on a particular button;
+# if the button is next to the empty space, it moves the button into the
+# empty space.
+
+def puzzleSwitch(w, num)
+ if ( ($ypos[num] >= ($ypos['space'] - 0.01)) \
+ && ($ypos[num] <= ($ypos['space'] + 0.01)) \
+ && ($xpos[num] >= ($xpos['space'] - 0.26)) \
+ && ($xpos[num] <= ($xpos['space'] + 0.26))) \
+ || (($xpos[num] >= ($xpos['space'] - 0.01)) \
+ && ($xpos[num] <= ($xpos['space'] + 0.01)) \
+ && ($ypos[num] >= ($ypos['space'] - 0.26)) \
+ && ($ypos[num] <= ($ypos['space'] + 0.26)))
+ tmp = $xpos['space']
+ $xpos['space'] = $xpos[num]
+ $xpos[num] = tmp
+ tmp = $ypos['space']
+ $ypos['space'] = $ypos[num]
+ $ypos[num] = tmp
+ w.place('relx'=>$xpos[num], 'rely'=>$ypos[num])
+ end
+end
+
diff --git a/ext/tk/sample/demos-en/radio.rb b/ext/tk/sample/demos-en/radio.rb
new file mode 100644
index 0000000000..bde31508e1
--- /dev/null
+++ b/ext/tk/sample/demos-en/radio.rb
@@ -0,0 +1,86 @@
+# radio.rb
+#
+# This demonstration script creates a toplevel window containing
+# several radiobutton widgets.
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($radio_demo) && $radio_demo
+ $radio_demo.destroy
+ $radio_demo = nil
+end
+
+# demo toplevel widget
+$radio_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration")
+ iconname("radio")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "Two groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables."
+}
+msg.pack('side'=>'top')
+
+#
+size = TkVariable.new
+color = TkVariable.new
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $radio_demo
+ $radio_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'radio'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Variables'
+ command proc{
+ showVars(base_frame, ['size', size], ['color', color])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+f_left = TkFrame.new(base_frame)
+f_right = TkFrame.new(base_frame)
+f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+
+# radiobutton
+[10, 12, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "Point Size #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
+['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col|
+ TkRadioButton.new(f_right) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
diff --git a/ext/tk/sample/demos-en/radio2.rb b/ext/tk/sample/demos-en/radio2.rb
new file mode 100644
index 0000000000..72fc2c610c
--- /dev/null
+++ b/ext/tk/sample/demos-en/radio2.rb
@@ -0,0 +1,109 @@
+# radio2.rb
+#
+# This demonstration script creates a toplevel window containing
+# several radiobutton widgets.
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($radio2_demo) && $radio2_demo
+ $radio2_demo.destroy
+ $radio2_demo = nil
+end
+
+# demo toplevel widget
+$radio2_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration 2")
+ iconname("radio2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "Three groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables."
+}
+msg.pack('side'=>'top')
+
+#
+size = TkVariable.new
+color = TkVariable.new
+align = TkVariable.new
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $radio2_demo
+ $radio2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'radio2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'See Variables'
+ command proc{
+ showVars(base_frame,
+ ['size', size], ['color', color], ['compound', align])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size',
+ 'pady'=>2, 'padx'=>2)
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
+ 'pady'=>2, 'padx'=>2)
+f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment',
+ 'pady'=>2, 'padx'=>2)
+f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+
+# radiobutton
+[10, 12, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "Point Size #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
+}
+
+['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col|
+ TkRadioButton.new(f_mid) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ anchor 'w'
+ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
+}
+
+# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead',
+ 'compound'=>'left')
+label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
+label.height(TkWinfo.reqheight(label))
+abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a|
+ lower = a.downcase
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>lower, 'indicatoron'=>0, 'width'=>7,
+ 'command'=>proc{label.compound(align.value)})
+}
+
+Tk.grid('x', abtn[0])
+Tk.grid(abtn[1], label, abtn[2])
+Tk.grid('x', abtn[3])
diff --git a/ext/tk/sample/demos-en/radio3.rb b/ext/tk/sample/demos-en/radio3.rb
new file mode 100644
index 0000000000..8a147edda7
--- /dev/null
+++ b/ext/tk/sample/demos-en/radio3.rb
@@ -0,0 +1,117 @@
+# radio3.rb
+#
+# This demonstration script creates a toplevel window containing
+# several radiobutton widgets.
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($radio3_demo) && $radio3_demo
+ $radio3_demo.destroy
+ $radio3_demo = nil
+end
+
+# demo toplevel widget
+$radio3_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration 3")
+ iconname("radio3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "Three groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. When the 'Tristate' button is pressed, the radio buttons will display the tri-state mode. Selecting any radio button will return the buttons to their respective on/off state. Click the \"See Variables\" button to see the current values of the variables."
+}
+msg.grid(:row=>0, :column=>0, :columnspan=>3, :sticky=>'nsew')
+
+# variable
+size = TkVariable.new
+color = TkVariable.new
+align = TkVariable.new
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame, ['size', size],
+ ['color', color], ['compound', align])
+ }),
+ TkButton.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'radio3'}),
+ TkButton.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $radio3_demo
+ $radio3_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+ TkGrid(frame, :row=>3, :column=>0, :columnspan=>3, :sticky=>'nsew')
+}
+
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'Point Size',
+ 'pady'=>2, 'padx'=>2)
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'Color',
+ 'pady'=>2, 'padx'=>2)
+f_right = TkLabelFrame.new(base_frame, 'text'=>'Alignment',
+ 'pady'=>2, 'padx'=>2)
+f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
+f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
+f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkButton.new(base_frame, 'text'=>'Tristate',
+ 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){
+ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c')
+}
+
+# radiobutton
+[10, 12, 14, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "Point Size #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ tristatevalue 'multi'
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
+}
+
+['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col|
+ TkRadioButton.new(f_mid) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ anchor 'w'
+ tristatevalue 'multi'
+ command proc{f_mid.fg(color.value)}
+ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
+}
+
+# label = TkLabel.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'Label', 'bitmap'=>'questhead',
+ 'compound'=>'left')
+label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
+label.height(TkWinfo.reqheight(label))
+a_btn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a|
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7,
+ 'command'=>proc{label.compound(align.value)})
+}
+
+Tk.grid('x', a_btn[0])
+Tk.grid(a_btn[1], label, a_btn[2])
+Tk.grid('x', a_btn[3])
diff --git a/ext/tk/sample/demos-en/rmt b/ext/tk/sample/demos-en/rmt
new file mode 100644
index 0000000000..dcfb328fc8
--- /dev/null
+++ b/ext/tk/sample/demos-en/rmt
@@ -0,0 +1,268 @@
+#!/usr/bin/env ruby
+
+# rmt --
+# This script implements a simple remote-control mechanism for
+# Tk applications. It allows you to select an application and
+# then type commands to that application.
+
+require 'tk'
+
+class Rmt
+ def initialize(parent=nil)
+ win = self
+
+ unless parent
+ parent = TkRoot.new
+ end
+ root = TkWinfo.toplevel(parent)
+ root.minsize(1,1)
+
+ # The instance variable below keeps track of the remote application
+ # that we're sending to. If it's an empty string then we execute
+ # the commands locally.
+ @app = 'local'
+ @mode = 'Ruby'
+
+ # The instance variable below keeps track of whether we're in the
+ # middle of executing a command entered via the text.
+ @executing = 0
+
+ # The instance variable below keeps track of the last command executed,
+ # so it can be re-executed in response to !! commands.
+ @lastCommand = ""
+
+ # Create menu bar. Arrange to recreate all the information in the
+ # applications sub-menu whenever it is cascaded to.
+
+ TkFrame.new(root, 'relief'=>'raised', 'bd'=>2) {|f|
+ pack('side'=>'top', 'fill'=>'x')
+ TkMenubutton.new(f, 'text'=>'File', 'underline'=>0) {|mb|
+ TkMenu.new(mb) {|mf|
+ mb.menu(mf)
+ TkMenu.new(mf) {|ma|
+ postcommand proc{win.fillAppsMenu ma}
+ mf.add('cascade', 'label'=>'Select Application',
+ 'menu'=>ma, 'underline'=>0)
+ }
+ add('command', 'label'=>'Quit',
+ 'command'=>proc{root.destroy}, 'underline'=>0)
+ }
+ pack('side'=>'left')
+ }
+ }
+
+ # Create text window and scrollbar.
+
+ @txt = TkText.new(root, 'relief'=>'sunken', 'bd'=>2, 'setgrid'=>true) {
+ yscrollbar(TkScrollbar.new(root){pack('side'=>'right', 'fill'=>'y')})
+ pack('side'=>'left')
+ }
+
+ @promptEnd = TkTextMark.new(@txt, 'insert')
+
+ # Create a binding to forward commands to the target application,
+ # plus modify many of the built-in bindings so that only information
+ # in the current command can be deleted (can still set the cursor
+ # earlier in the text and select and insert; just can't delete).
+
+ @txt.bindtags([@txt, TkText, root, 'all'])
+ @txt.bind('Return', proc{
+ @txt.set_insert('end - 1c')
+ @txt.insert('insert', "\n")
+ win.invoke
+ Tk.callback_break
+ })
+ @txt.bind('Delete', proc{
+ begin
+ @txt.tag_remove('sel', 'sel.first', @promptEnd)
+ rescue
+ end
+ if @txt.tag_nextrange('sel', '1.0', 'end') == []
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ end
+ })
+ @txt.bind('BackSpace', proc{
+ begin
+ @txt.tag_remove('sel', 'sel.first', @promptEnd)
+ rescue
+ end
+ if @txt.tag_nextrange('sel', '1.0', 'end') == []
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ end
+ })
+ @txt.bind('Control-d', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Control-k', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ @txt.set_insert(@promptEnd)
+ end
+ })
+ @txt.bind('Control-t', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Meta-d', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Meta-BackSpace', proc{
+ if @txt.compare('insert', '<=', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Control-h', proc{
+ if @txt.compare('insert', '<=', @promptEnd)
+ Tk.callback_break
+ end
+ })
+
+ @txt.tag_configure('bold', 'font'=>['Courier', 12, 'bold'])
+
+ @app = Tk.appname('rmt')
+ if (@app =~ /^rmt(.*)$/)
+ root.title("Tk Remote Controller#{$1}")
+ root.iconname("Tk Remote#{$1}")
+ end
+ prompt
+ @txt.focus
+ #@app = TkWinfo.appname(TkRoot.new)
+ end
+
+ def tkTextInsert(w,s)
+ return if s == ""
+ begin
+ if w.compare('sel.first','<=','insert') \
+ && w.compare('sel.last','>=','insert')
+ w.tag_remove('sel', 'sel.first', @promptEnd)
+ w.delete('sel.first', 'sel.last')
+ end
+ rescue
+ end
+ w.insert('insert', s)
+ w.see('insert')
+ end
+
+ # The method below is used to print out a prompt at the
+ # insertion point (which should be at the beginning of a line
+ # right now).
+
+ def prompt
+ @txt.insert('insert', "#{@app}: ")
+ @promptEnd.set('insert')
+ @promptEnd.gravity = 'left'
+ @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd)
+ end
+
+ # The method below executes a command (it takes everything on the
+ # current line after the prompt and either sends it to the remote
+ # application or executes it locally, depending on "app".
+
+ def invoke
+ cmd = @txt.get(@promptEnd, 'insert')
+ @executing += 1
+ case (@mode)
+ when 'Tcl'
+ if Tk.info('complete', cmd)
+ if (cmd == "!!\n")
+ cmd = @lastCommand
+ else
+ @lastCommand = cmd
+ end
+ begin
+ msg = Tk.appsend(@app, false, cmd)
+ rescue
+ msg = "Error: #{$!}"
+ end
+ @txt.insert('insert', msg + "\n") if msg != ""
+ prompt
+ @promptEnd.set('insert')
+ end
+
+ when 'Ruby'
+ if (cmd == "!!\n")
+ cmd = @lastCommand
+ end
+ complete = true
+ begin
+ eval("proc{#{cmd}}")
+ rescue
+ complete = false
+ end
+ if complete
+ @lastCommand = cmd
+ begin
+# msg = Tk.appsend(@app, false,
+# 'ruby',
+# '"(' + cmd.gsub(/[][$"]/, '\\\\\&') + ').to_s"')
+ msg = Tk.rb_appsend(@app, false, cmd)
+ rescue
+ msg = "Error: #{$!}"
+ end
+ @txt.insert('insert', msg + "\n") if msg != ""
+ prompt
+ @promptEnd.set('insert')
+ end
+ end
+
+ @executing -= 1
+ @txt.yview_pickplace('insert')
+ end
+
+ # The following method is invoked to change the application that
+ # we're talking to. It also updates the prompt for the current
+ # command, unless we're in the middle of executing a command from
+ # the text item (in which case a new prompt is about to be output
+ # so there's no need to change the old one).
+
+ def newApp(appName, mode)
+ @app = appName
+ @mode = mode
+ if @executing == 0
+ @promptEnd.gravity = 'right'
+ @txt.delete("#{@promptEnd.path} linestart", @promptEnd)
+ @txt.insert(@promptEnd, "#{appName}: ")
+ @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd)
+ @promptEnd.gravity = 'left'
+ end
+ end
+
+ # The method below will fill in the applications sub-menu with a list
+ # of all the applications that currently exist.
+
+ def fillAppsMenu(menu)
+ win = self
+ begin
+ menu.delete(0,'last')
+ rescue
+ end
+ TkWinfo.interps.sort.each{|ip|
+ begin
+ if Tk.appsend(ip, false, 'info commands ruby') == ""
+ mode = 'Tcl'
+ else
+ mode = 'Ruby'
+ end
+ menu.add('command', 'label'=>format("%s (#{mode}/Tk)", ip),
+ 'command'=>proc{win.newApp ip, mode})
+ rescue
+ menu.add('command', 'label'=>format("%s (unknown Tk)", ip),
+ 'command'=>proc{win.newApp ip, mode}, 'state'=>'disabled')
+ end
+ }
+ menu.add('command', 'label'=>format("local (Ruby/Tk)"),
+ 'command'=>proc{win.newApp 'local', 'Ruby'})
+ end
+end
+
+Rmt.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/rolodex b/ext/tk/sample/demos-en/rolodex
new file mode 100644
index 0000000000..dfc4b2b245
--- /dev/null
+++ b/ext/tk/sample/demos-en/rolodex
@@ -0,0 +1,320 @@
+#!/usr/bin/env ruby
+#
+# rolodex --
+# This script is a part of Tom LaStrange's rolodex
+#
+# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp>
+# Time-stamp: "03/08/02 06:23:06 nagai"
+#
+
+require "tk"
+
+
+def show_help(topic,x=0,y=0)
+ if( topic.is_a?(TkWindow) )
+ w = TkWinfo.containing(x,y)
+ if( TkWinfo.exist?(w) )
+ topic = w
+ end
+ end
+
+ if( $helpTopics.include?(topic) )
+ msg = $helpTopics[topic]
+ else
+ msg = "Sorry, but no help is available for this topic"
+ end
+ TkDialog.new("title"=>"Rolodex Help",
+ "message"=>"Information on #{topic}:\n\n#{msg}",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+end
+
+def fillCard
+ clearAction
+ $root.frame.entry[1].insert(0,"Takaaki Tateishi")
+ $root.frame.entry[2].insert(0,"Japan Advanced Institute of Science and Techonology")
+ $root.frame.entry[3].insert(0,"1-1 Asahidai, Tatsunokuchi")
+ $root.frame.entry[4].insert(0,"Ishikawa 923-1292, Japan")
+ $root.frame.entry[5].insert(0,"private")
+ $root.frame.entry[6].insert(0,"***-***-****")
+ $root.frame.entry[7].insert(0,"***-***-****")
+end
+
+def addAction
+ for i in 1..7
+ STDERR.print format("%-12s %s\n",
+ RolodexFrame::LABEL[i],
+ $root.frame.entry[i].value)
+ end
+end
+
+def clearAction
+ for i in 1..7
+ $root.frame.entry[i].delete(0,"end")
+ end
+end
+
+def fileAction
+ TkDialog.new("title"=>"File Selection",
+ "message"=>"This is a dummy file selection dialog box.\n",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+ STDERR.print "dummy file name\n"
+end
+
+def deleteAction
+ result = TkDialog.new("title"=>"Confirm Action",
+ "message"=>"Are you sure?",
+ "default_button"=>0,
+ "buttons"=>["Cancel"])
+ if( result.value == 0 )
+ clearAction
+ end
+end
+
+
+class RolodexFrame < TkFrame
+ attr_reader :entry, :label
+
+ LABEL = ["","Name:","Address:","","","Home Phone:","Work Phone:","Fax:"]
+
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+ self["relief"] = "flat"
+
+ @i = []
+ @label = []
+ @entry = []
+ for i in 1..7
+ @i[i] = TkFrame.new(self)
+ @i[i].pack("side"=>"top",
+ "pady"=>2,
+ "anchor"=>"e")
+ @label[i] = TkLabel.new(@i[i],
+ "text"=>LABEL[i],
+ "anchor"=>"e")
+ @entry[i] = TkEntry.new(@i[i],
+ "width"=>30,
+ "relief"=>"sunken")
+ @entry[i].pack("side"=>"right")
+ @label[i].pack("side"=>"right")
+ end
+ end
+end
+
+class RolodexButtons < TkFrame
+ attr_reader :clear, :add, :search, :delete
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ @clear = TkButton.new(self,
+ "text" => "Clear")
+ @add = TkButton.new(self,
+ "text" => "Add")
+ @search = TkButton.new(self,
+ "text" => "Search")
+ @delete = TkButton.new(self,
+ "text" => "Delete")
+ for w in [@clear,@add,@search,@delete]
+ w.pack("side"=>"left", "padx"=>2)
+ end
+ end
+end
+
+class RolodexMenuFrame < TkFrame
+ attr_reader :file_menu, :help_menu, :file, :help
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ configure("relief"=>"raised",
+ "borderwidth"=>1)
+
+ @file = TkMenubutton.new(self,
+ "text"=>"File",
+ "underline"=>0)
+ @file_menu = TkMenu.new(@file)
+ @file_menu.add("command",
+ "label" => "Load ...",
+ "command" => proc{fileAction},
+ "underline" => 0)
+ @file_menu.add("command",
+ "label" => "Exit",
+ "command" => proc{$root.destroy},
+ "underline" => 0)
+ @file.menu(@file_menu)
+ @file.pack("side"=>"left")
+
+ @help = TkMenubutton.new(self,
+ "text"=>"Help",
+ "underline"=>0)
+ @help_menu = TkMenu.new(@help)
+ @help_menu.add("command",
+ "label"=>"On Context...",
+ "command"=>proc{show_help("context")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Help...",
+ "command"=>proc{show_help("help")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Window...",
+ "command"=>proc{show_help("window")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Keys...",
+ "command"=>proc{show_help("keys")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On version...",
+ "command"=>proc{show_help("version")},
+ "underline"=>3)
+ @help.menu(@help_menu)
+ @help.pack("side"=>"right")
+ end
+end
+
+class Rolodex < TkRoot
+ attr_reader :frame, :buttons, :menu
+
+ def initialize(*args)
+ super(*args)
+ @frame = RolodexFrame.new(self)
+ @frame.pack("side"=>"top",
+ "fill"=>"y",
+ "anchor"=>"center")
+ @buttons = RolodexButtons.new(self)
+ @buttons.pack("side"=>"bottom",
+ "pady"=>2,
+ "anchor"=>"center")
+ @menu = RolodexMenuFrame.new(self)
+ @menu.pack("before"=>@frame,
+ "side"=>"top",
+ "fill"=>"x")
+ end
+end
+
+$root = Rolodex.new
+
+$root.buttons.delete.configure("command"=>proc{deleteAction})
+$root.buttons.add.configure("command"=>proc{addAction})
+$root.buttons.clear.configure("command"=>proc{clearAction})
+$root.buttons.search.configure("command"=>proc{addAction; fillCard})
+
+$root.buttons.clear.configure("text"=>"Clear Ctrl+C")
+$root.bind("Control-c",proc{clearAction})
+
+$root.buttons.add.configure("text"=>"Add Ctrl+A")
+$root.bind("Control-a",proc{addAction})
+
+$root.buttons.search.configure("text"=>"Search Ctrl+S")
+$root.bind("Control-s",proc{addAction; fillCard})
+
+$root.buttons.delete.configure("text"=>"Delete... Ctrl+D")
+$root.bind("Control-d",proc{deleteAction})
+
+$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F")
+$root.bind("Control-f",proc{fileAction})
+
+$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q")
+$root.bind("Control-q",proc{$root.destroy})
+
+$root.frame.entry[1].focus
+
+$root.bind("Any-F1",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+$root.bind("Any-Help",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+
+
+$helpTopics = {}
+
+$helpTopics[$root.menu.file] = <<EOF
+This is the "file" menu. It can be used to invoke\
+some overall operations on the rolodex applications,\
+such as loading a file or exiting.
+EOF
+
+$helpTopics[$root.menu.file_menu.index(0)] = <<EOF
+The "Load" entry in the "File" menu posts a dialog box\
+that you can use to select a rolodex file
+EOF
+
+$helpTopics[$root.menu.file_menu.index(1)] = <<EOF
+The "Exit" entry in the "File" menu causes the rolodex\
+application to terminate
+EOF
+
+$helpTopics[$root.frame.entry[1]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's name
+EOF
+
+$helpTopics[$root.frame.entry[2]] = <<EOF
+In this field of the rolodex entry you should\
+type the first line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[3]] = <<EOF
+In this field of the rolodex entry you should\
+type the second line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[4]] = <<EOF
+In this field of the rolodex entry you should\
+type the third line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[5]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's home phone number, or "private"\
+if the person doesn't want his or he number publicized
+EOF
+
+$helpTopics[$root.frame.entry[6]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's work phone number
+EOF
+
+$helpTopics[$root.frame.entry[7]] = <<EOF
+In this field of the rolodex entry you should\
+type the phone number for the person's FAX machine
+EOF
+
+$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\
+the mouse over the window you're curious about and pressing the\
+Help or F1 keys. You can do this anytime.
+EOF
+
+$helpTopics["help"] = <<EOF
+This application provides only very crude help. Besides the\
+entries in this menu, you can get help on individual windows\
+by moving the mouse cursor over the window and pressing the\
+Help or F1 keys.
+EOF
+
+$helpTopics["window"] = <<EOF
+This window is a dummy rolodex application created as part of\
+Tom LaStrange's toolkit benchmark. It doesn't really do anything\
+useful except to demonstrate a few features of the Ruby/Tk.
+EOF
+
+$helpTopics["keys"] = <<EOF
+The following accelerator keys are defined for this application\
+(in addition to those already available for the entry windows):
+Ctrl+A: Add
+Ctrl+C: Clear
+Ctrl+D: Delete
+Ctrl+F: Enter file name
+Ctrl+Q: Exit application (quit)
+Ctrl+S: Search (dummy operation)
+EOF
+
+$helpTopics["version"] = <<EOF
+This is version 1.0.1.
+EOF
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/ruler.rb b/ext/tk/sample/demos-en/ruler.rb
new file mode 100644
index 0000000000..a9773699f7
--- /dev/null
+++ b/ext/tk/sample/demos-en/ruler.rb
@@ -0,0 +1,205 @@
+# ruler.rb
+#
+# This demonstration script creates a canvas widget that displays a ruler
+# with tab stops that can be set, moved, and deleted.
+#
+# ruler widget demo (called by 'widget')
+#
+
+# rulerMkTab --
+# This method creates a new triangular polygon in a canvas to
+# represent a tab stop.
+#
+# Arguments:
+# c - The canvas window.
+# x, y - Coordinates at which to create the tab stop.
+
+def rulerMkTab(c,x,y)
+ v = $demo_rulerInfo
+ TkcPolygon.new(c, x, y, x+v.size, y+v.size, x-v.size, y+v.size)
+end
+
+# toplevel widget
+if defined?($ruler_demo) && $ruler_demo
+ $ruler_demo.destroy
+ $ruler_demo = nil
+end
+
+# demo toplevel widget
+$ruler_demo = TkToplevel.new {|w|
+ title("Ruler Demonstration")
+ iconname("ruler")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"This canvas widget shows a mock-up of a ruler. You can create tab stops by dragging them out of the well to the right of the ruler. You can also drag existing tab stops. If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."){
+ pack('side'=>'top')
+}
+
+# frame
+$ruler_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $ruler_demo
+ $ruler_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'ruler'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas
+$ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c')
+$ruler_canvas.pack('side'=>'top', 'fill'=>'x')
+
+#
+unless Struct.const_defined?("RulerInfo")
+ $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
+ :top, :bottom, :size, :normalStyle,
+ :activeStyle, :deleteStyle).new
+end
+$demo_rulerInfo.grid = '.25c'
+$demo_rulerInfo.left = TkWinfo.fpixels($ruler_canvas, '1c')
+$demo_rulerInfo.right = TkWinfo.fpixels($ruler_canvas, '13c')
+$demo_rulerInfo.top = TkWinfo.fpixels($ruler_canvas, '1c')
+$demo_rulerInfo.bottom = TkWinfo.fpixels($ruler_canvas, '1.5c')
+$demo_rulerInfo.size = TkWinfo.fpixels($ruler_canvas, '.2c')
+$demo_rulerInfo.normalStyle = {'fill'=>'black'}
+if TkWinfo.depth($ruler_canvas) > 1
+ $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''}
+ $demo_rulerInfo.deleteStyle = {'fill'=>'red',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator)}
+else
+ $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''}
+ $demo_rulerInfo.deleteStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator)}
+end
+
+TkcLine.new($ruler_canvas,
+ '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1)
+(0..11).each{|i|
+ x = i+1
+ TkcLine.new($ruler_canvas, "#{x}c", '1c', "#{x}c", '0.6c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.25c", '1c', "#{x}.25c", '0.8c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.5c", '1c', "#{x}.5c", '0.7c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.75c", '1c', "#{x}.75c", '0.8c', 'width'=>1)
+ TkcText.new($ruler_canvas, "#{x}.15c", '0.75c', 'text'=>i, 'anchor'=>'sw')
+}
+
+$rulerTag_well = TkcTag.new($ruler_canvas)
+$ruler_canvas\
+.addtag_withtag($rulerTag_well,
+ TkcRectangle.new($ruler_canvas,
+ '13.2c', '1c', '13.8c', '0.5c',
+ 'outline'=>'black',
+ 'fill'=>($ruler_canvas\
+ .configinfo('background'))[4]) )
+$ruler_canvas\
+.addtag_withtag($rulerTag_well,
+ rulerMkTab($ruler_canvas,
+ TkWinfo.pixels($ruler_canvas, '13.5c'),
+ TkWinfo.pixels($ruler_canvas, '.65c') ) )
+
+$rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.itembind('tab', '1',
+ proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.bind('B1-Motion',
+ proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)})
+
+# rulerNewTab --
+# Does all the work of creating a tab stop, including creating the
+# triangle object and adding tags to it to give it tab behavior.
+#
+# Arguments:
+# c - The canvas window.
+# x, y - The coordinates of the tab stop.
+
+def rulerNewTab(c,x,y)
+ v = $demo_rulerInfo
+ c.addtag_withtag('active', rulerMkTab(c,x,y))
+ c.addtag_withtag('tab', 'active')
+ v.x = x
+ v.y = y
+ rulerMoveTab(c,x,y)
+end
+
+# rulerSelectTab --
+# This method is invoked when mouse button 1 is pressed over
+# a tab. It remembers information about the tab so that it can
+# be dragged interactively.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse (identifies the point by
+# which the tab was picked up for dragging).
+
+def rulerSelectTab(c,x,y)
+ v = $demo_rulerInfo
+ v.x = c.canvasx(x, v.grid)
+ v.y = v.top+2
+ c.addtag_withtag('active', 'current')
+ c.itemconfigure('active', v.activeStyle)
+ c.raise('active')
+end
+
+# rulerMoveTab --
+# This method is invoked during mouse motion events to drag a tab.
+# It adjusts the position of the tab, and changes its appearance if
+# it is about to be dragged out of the ruler.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse.
+
+def rulerMoveTab(c,x,y)
+ v = $demo_rulerInfo
+ return if c.find_withtag('active') == []
+ cx = c.canvasx(x,v.grid)
+ cy = c.canvasy(y)
+ cx = v.left if cx < v.left
+ cx = v.right if cx > v.right
+ if (cy >= v.top && cy <= v.bottom)
+ cy = v.top+2
+ c.itemconfigure('active', v.activeStyle)
+ else
+ cy = cy-v.size-2
+ c.itemconfigure('active', v.deleteStyle)
+ end
+ c.move('active', cx-v.x, cy-v.y)
+ v.x = cx
+ v.y = cy
+end
+
+# rulerReleaseTab --
+# This method is invoked during button release events that end
+# a tab drag operation. It deselects the tab and deletes the tab if
+# it was dragged out of the ruler.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse.
+
+def rulerReleaseTab(c)
+ v = $demo_rulerInfo
+ return if c.find_withtag('active') == []
+ if v.y != v.top+2
+ c.delete('active')
+ else
+ c.itemconfigure('active', v.normalStyle)
+ c.dtag('active')
+ end
+end
+
diff --git a/ext/tk/sample/demos-en/sayings.rb b/ext/tk/sample/demos-en/sayings.rb
new file mode 100644
index 0000000000..a4dcf37cdc
--- /dev/null
+++ b/ext/tk/sample/demos-en/sayings.rb
@@ -0,0 +1,106 @@
+# sayings.rb
+#
+# This demonstration script creates a listbox that can be scrolled
+# both horizontally and vertically. It displays a collection of
+# well-known sayings.
+#
+# listbox widget demo 'sayings' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($sayings_demo) && $sayings_demo
+ $sayings_demo.destroy
+ $sayings_demo = nil
+end
+
+# demo toplevel widget
+$sayings_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (well-known sayings)")
+ iconname("sayings")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($sayings_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "The listbox below contains a collection of well-known sayings. You can scan the list using either of the scrollbars or by dragging in the listbox window with button 2 pressed."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $sayings_demo
+ $sayings_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'sayings'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+sayings_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ sv = TkScrollbar.new(w)
+ sh = TkScrollbar.new(w, 'orient'=>'horizontal')
+ sayings_lbox = TkListbox.new(w) {
+ setgrid 1
+ width 20
+ height 10
+ yscrollcommand proc{|first,last| sv.set first,last}
+ xscrollcommand proc{|first,last| sh.set first,last}
+ }
+ sv.command(proc{|*args| sayings_lbox.yview(*args)})
+ sh.command(proc{|*args| sayings_lbox.xview(*args)})
+
+ if $tk_version =~ /^4\.[01]/
+ sv.pack('side'=>'right', 'fill'=>'y')
+ sh.pack('side'=>'bottom', 'fill'=>'x')
+ sayings_lbox.pack('expand'=>'yes', 'fill'=>'y')
+
+ else
+ sayings_lbox.grid('row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ sv.grid('row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ sh.grid('row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0)
+ end
+
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+sayings_lbox.insert(0,
+"Waste not, want not",
+"Early to bed and early to rise makes a man healthy, wealthy, and wise",
+"Ask not what your country can do for you, ask what you can do for your country",
+"I shall return",
+"NOT",
+"A picture is worth a thousand words",
+"User interfaces are hard to build",
+"Thou shalt not steal",
+"A penny for your thoughts",
+"Fool me once, shame on you; fool me twice, shame on me",
+"Every cloud has a silver lining",
+"Where there's smoke there's fire",
+"It takes one to know one",
+"Curiosity killed the cat; but satisfaction brought it back",
+"Take this job and shove it",
+"Up a creek without a paddle",
+"I'm mad as hell and I'm not going to take it any more",
+"An apple a day keeps the doctor away",
+"Don't look a gift horse in the mouth"
+)
+
diff --git a/ext/tk/sample/demos-en/search.rb b/ext/tk/sample/demos-en/search.rb
new file mode 100644
index 0000000000..7fb40d88b2
--- /dev/null
+++ b/ext/tk/sample/demos-en/search.rb
@@ -0,0 +1,187 @@
+# search.rb
+#
+# This demonstration script creates a collection of widgets that
+# allow you to load a file into a text widget, then perform searches
+# on that file.
+#
+# Text Search widget demo (called by 'widget')
+#
+
+# textLoadFile --
+# This method below loads a file into a text widget, discarding
+# the previous contents of the widget. Tags for the old widget are
+# not affected, however.
+#
+# Arguments:
+# w - The window into which to load the file. Must be a
+# text widget.
+# file - The name of the file to load. Must be readable.
+
+def textLoadFile(w,file)
+ w.delete('1.0', 'end')
+ f = open(file, 'r')
+ while(!f.eof?)
+ w.insert('end', f.read(1000))
+ end
+ f.close
+end
+
+# textSearch --
+# Search for all instances of a given string in a text widget and
+# apply a given tag to each instance found.
+#
+# Arguments:
+# w - The window in which to search. Must be a text widget.
+# string - The string to search for. The search is done using
+# exact matching only; no special characters.
+# tag - Tag to apply to each instance of a matching string.
+
+def textSearch(w, string, tag)
+ tag.remove('0.0', 'end')
+ return if string == ""
+ cur = '1.0'
+ loop {
+ cur, len = w.search_with_length(string, cur, 'end')
+ break if cur == ""
+ tag.add(cur, "#{cur} + #{len} char")
+ cur = w.index("#{cur} + #{len} char")
+ }
+end
+
+# textToggle --
+# This method is invoked repeatedly to invoke two commands at
+# periodic intervals. It normally reschedules itself after each
+# execution but if an error occurs (e.g. because the window was
+# deleted) then it doesn't reschedule itself.
+#
+# Arguments:
+# cmd1 - Command to execute when method is called.
+# sleep1 - Ms to sleep after executing cmd1 before executing cmd2.
+# cmd2 - Command to execute in the *next* invocation of this method.
+# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again.
+
+def textToggle(cmd1,sleep1,cmd2,sleep2)
+ sleep_list = [sleep2, sleep1]
+ TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep},
+ -1, cmd1, cmd2).start(sleep1)
+end
+
+# toplevel widget
+if defined?($search_demo) && $search_demo
+ $search_demo.destroy
+ $search_demo = nil
+end
+
+# demo toplevel widget
+$search_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Search and Highlight")
+ iconname("search")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($search_demo).pack(:fill=>:both, :expand=>true)
+
+# frame
+$search_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $search_demo
+ $search_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'search'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>'File name:',
+ 'width'=>13, 'anchor'=>'w').pack('side'=>'left')
+ $search_fileName = TkVariable.new
+ TkEntry.new(f, 'width'=>40,
+ 'textvariable'=>$search_fileName) {
+ pack('side'=>'left')
+ bind('Return', proc{textLoadFile($search_text, $search_fileName.value)
+ $search_string_entry.focus})
+ focus
+ }
+ TkButton.new(f, 'text'=>'Load File',
+ 'command'=>proc{textLoadFile($search_text,
+ $search_fileName.value)})\
+ .pack('side'=>'left', 'pady'=>5, 'padx'=>10)
+}.pack('side'=>'top', 'fill'=>'x')
+
+TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>'Search string:',
+ 'width'=>13, 'anchor'=>'w').pack('side'=>'left')
+ $search_searchString = TkVariable.new
+ $search_string_entry = TkEntry.new(f, 'width'=>40,
+ 'textvariable'=>$search_searchString) {
+ pack('side'=>'left')
+ bind('Return', proc{textSearch($search_text, $search_searchString.value,
+ $search_Tag)})
+ }
+ TkButton.new(f, 'text'=>'Highlight',
+ 'command'=>proc{textSearch($search_text,
+ $search_searchString.value,
+ $search_Tag)}) {
+ pack('side'=>'left', 'pady'=>5, 'padx'=>10)
+ }
+}.pack('side'=>'top', 'fill'=>'x')
+
+$search_text = TkText.new(base_frame, 'setgrid'=>true, 'wrap'=>'word') {|t|
+ $search_Tag = TkTextTag.new(t)
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| t.yview(*args)}) {|sc|
+ t.yscrollcommand(proc{|first,last| sc.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+}
+
+# Set up display styles for text highlighting.
+
+if TkWinfo.depth($search_demo) > 1
+ textToggle(proc{
+ $search_Tag.configure('background'=>'#ce5555',
+ 'foreground'=>'white')
+ },
+ 800,
+ proc{
+ $search_Tag.configure('background'=>'', 'foreground'=>'')
+ },
+ 200 )
+else
+ textToggle(proc{
+ $search_Tag.configure('background'=>'black',
+ 'foreground'=>'white')
+ },
+ 800,
+ proc{
+ $search_Tag.configure('background'=>'', 'foreground'=>'')
+ },
+ 200 )
+end
+$search_text.insert('1.0', "\
+This window demonstrates how to use the tagging facilities in text \
+widgets to implement a searching mechanism. First, type a file name \
+in the top entry, then type <Return> or click on \"Load File\". Then \
+type a string in the lower entry and type <Return> or click on \
+\"Load File\". This will cause all of the instances of the string to \
+be tagged with the tag \"search\", and it will arrange for the tag\'s \
+display attributes to change to make all of the strings blink.")
+$search_text.insert('end', "\
+The current directory to load a file is \"#{Dir.pwd}\".\
+")
+$search_text.set_insert '0.0'
+
+$search_fileName.value = ''
+$search_searchString.value = ''
+
+$search_text.width = 60
+$search_text.height = 20
diff --git a/ext/tk/sample/demos-en/spin.rb b/ext/tk/sample/demos-en/spin.rb
new file mode 100644
index 0000000000..d51b7e6619
--- /dev/null
+++ b/ext/tk/sample/demos-en/spin.rb
@@ -0,0 +1,65 @@
+# spin.rb --
+#
+# This demonstration script creates several spinbox widgets.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($spin_demo) && $spin_demo
+ $spin_demo.destroy
+ $spin_demo = nil
+end
+
+$spin_demo = TkToplevel.new {|w|
+ title("Spinbox Demonstration")
+ iconname("spin")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+Three different spin-boxes are displayed below. \
+You can add characters by pointing, clicking and typing. \
+The normal Motif editing characters are supported, along with \
+many Emacs bindings. For example, Backspace and Control-h \
+delete the character to the left of the insertion cursor and \
+Delete and Control-d delete the chararacter to the right of the \
+insertion cursor. For values that are too large to fit in the \
+window all at once, you can scan through the value by dragging \
+with mouse button2 pressed. Note that the first spin-box will \
+only permit you to type in integers, and the third selects from \
+a list of Australian cities.
+If your Tk library linked to Ruby doesn't include a 'spinbox' widget, \
+this demo doesn't work. Please use later version of Tk \
+which supports a 'spinbox' widget.
+EOL
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $spin_demo.destroy
+ $spin_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'spin'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+australianCities = [
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
+ 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs'
+]
+
+[
+ TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key,
+ :validatecommand=>[
+ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
+ ]),
+ TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5,
+ :format=>'%05.2f', :width=>10),
+ TkSpinbox.new(base_frame, :values=>australianCities, :width=>10)
+].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)}
diff --git a/ext/tk/sample/demos-en/square b/ext/tk/sample/demos-en/square
new file mode 100644
index 0000000000..bb66282154
--- /dev/null
+++ b/ext/tk/sample/demos-en/square
@@ -0,0 +1,81 @@
+#!/usr/bin/env ruby
+
+# square --
+# This script generates a demo application containing only
+# a "square" widget. It's only usable if Tk has been compiled
+# with tkSquare.c and with the -DSQUARE_DEMO compiler switch.
+# This demo arranges the following bindings for the widget:
+#
+# Button-1 press/drag: moves square to mouse
+# "a": toggle size animation on/off
+#
+
+require 'tk'
+require 'tkafter'
+
+class TkSquare<TkWindow
+ def create_self
+ begin
+ tk_call 'square', path
+ rescue
+ STDERR.print "\nSorry. Your Tk interpreter does not contain " +
+ 'a "square" demonstration widget.' +
+ "\n ( See documents included the Tcl/Tk source archive. )\n\n"
+ exit
+ end
+ end
+ def size(amount=nil)
+ if amount
+ tk_send 'size', amount
+ else
+ number(tk_send('size'))
+ end
+ end
+ def position(x,y)
+ tk_send 'position', x, y
+ end
+end
+
+$s = TkSquare.new{
+ pack('expand'=>'yes', 'fill'=>'both')
+ bind('1', proc{|x,y| center(x,y)}, '%s %y')
+ bind('B1-Motion', proc{|x,y| center(x,y)}, '%s %y')
+ bind('a', proc{animate})
+ focus
+}
+TkRoot.new.minsize(1,1)
+
+# The procedure below centers the square on a given position.
+
+def center(x,y)
+ a = $s.size
+ $s.position(x-(a/2), y-(a/2))
+end
+
+# The procedures below provide a simple form of animation where
+# the box changes size in a pulsing pattern: larger, smaller, larger,
+# and so on.
+
+$inc = 0
+
+def timer_proc
+ a = $s.size
+ return if $inc == 0
+ $inc = -3 if a >= 40
+ $inc = 3 if a <= 10
+ $s.size(a+$inc)
+end
+
+$timer = TkAfter.new(30, -1, proc{timer_proc})
+
+def animate
+ if $inc == 0
+ $inc = 3
+ $timer.start
+ else
+ $inc = 0
+ $timer.stop
+ end
+end
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/states.rb b/ext/tk/sample/demos-en/states.rb
new file mode 100644
index 0000000000..a5c01a867c
--- /dev/null
+++ b/ext/tk/sample/demos-en/states.rb
@@ -0,0 +1,80 @@
+# states.rb
+#
+# This demonstration script creates a listbox widget that displays
+# the names of the 50 states in the United States of America.
+#
+# listbox widget demo 'states' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($states_demo) && $states_demo
+ $states_demo.destroy
+ $states_demo = nil
+end
+
+# demo toplevel widget
+$states_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (states)")
+ iconname("states")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($states_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by scanning. To scan, press button 2 in the widget and drag up or down."
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $states_demo
+ $states_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'states'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+states_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w|
+ s = TkScrollbar.new(w)
+ states_lbox = TkListbox.new(w) {
+ setgrid 1
+ height 12
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| states_lbox.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+ins_data = [
+ 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
+ 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia',
+ 'Hawaii', 'Idaho', 'Illinois',
+ 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland',
+ 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri',
+ 'Montana', 'Nebraska', 'Nevada', 'New_Hampshire', 'New_Jersey', 'New_Mexico',
+ 'New_York', 'North_Carolina', 'North_Dakota',
+ 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode_Island',
+ 'South_Carolina', 'South_Dakota',
+ 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington',
+ 'West_Virginia', 'Wisconsin', 'Wyoming'
+]
+
+states_lbox.insert(0, *ins_data)
+
diff --git a/ext/tk/sample/demos-en/style.rb b/ext/tk/sample/demos-en/style.rb
new file mode 100644
index 0000000000..5c8777379e
--- /dev/null
+++ b/ext/tk/sample/demos-en/style.rb
@@ -0,0 +1,231 @@
+# style.rb
+#
+# This demonstration script creates a text widget that illustrates the
+# various display styles that may be set for tags.
+#
+# text (display styles) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($style_demo) && $style_demo
+ $style_demo.destroy
+ $style_demo = nil
+end
+
+# demo toplevel widget
+$style_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Display Styles")
+ iconname("style")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($style_demo).pack(:fill=>:both, :expand=>true)
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $style_demo
+ $style_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'style'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# text
+txt = TkText.new(base_frame){|t|
+ #
+ setgrid 'true'
+ #width 70
+ #height 32
+ wrap 'word'
+ font $font
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ #
+ family = 'Courier'
+
+ if $tk_version =~ /^4.*/
+ style_tag_bold = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*')
+ style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font)
+ style_tag_verybig = TkTextTag.new(t, 'font'=>'-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*')
+ # style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font)
+ style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*')
+ else
+ style_tag_bold = TkTextTag.new(t, 'font'=>[family, 12, :bold, :italic])
+ style_tag_big = TkTextTag.new(t, 'font'=>[family, 14, :bold])
+ style_tag_verybig = TkTextTag.new(t, 'font'=>['Helvetica', 24, :bold])
+ style_tag_small = TkTextTag.new(t, 'font'=>'Times 8 bold')
+ end
+###
+# case($tk_version)
+# when /^4.*/
+# style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font)
+# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font)
+# when /^8.*/
+# unless $style_demo_do_first
+# $style_demo_do_first = true
+# Tk.tk_call('font', 'create', '@bigascii',
+# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*')
+# Tk.tk_call('font', 'create', '@smallascii',
+# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*')
+# Tk.tk_call('font', 'create', '@cBigFont',
+# '-compound', '@bigascii @msg_knj')
+# Tk.tk_call('font', 'create', '@cSmallFont',
+# '-compound', '@smallascii @kanji')
+# end
+# style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont')
+# style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont')
+# end
+
+ #
+ if TkWinfo.depth($root).to_i > 1
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce')
+ style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red')
+ style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1)
+ style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1)
+ else
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'black',
+ 'foreground'=>'white')
+ style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
+ 'foreground'=>'white')
+ style_tag_raised = TkTextTag.new(t, 'background'=>'white',
+ 'relief'=>'raised', 'borderwidth'=>1)
+ style_tag_sunken = TkTextTag.new(t, 'background'=>'white',
+ 'relief'=>'sunken', 'borderwidth'=>1)
+ end
+
+ #
+ if $tk_version =~ /^4\.[01]/
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
+ 'bgstipple'=>'gray25')
+ else
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
+ 'bgstipple'=>'gray12')
+ end
+ style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50')
+ style_tag_underline = TkTextTag.new(t, 'underline'=>'on')
+ style_tag_overstrike = TkTextTag.new(t, 'overstrike'=>'on')
+ style_tag_right = TkTextTag.new(t, 'justify'=>'right')
+ style_tag_center = TkTextTag.new(t, 'justify'=>'center')
+ if $tk_version =~ /^4.*/
+ style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*')
+ style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*')
+ else
+ style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>[family, 10])
+ style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>[family, 10])
+ end
+ style_tag_margins = TkTextTag.new(t, 'lmargin1'=>'12m', 'lmargin2'=>'6m',
+ 'rmargin'=>'10m')
+ style_tag_spacing = TkTextTag.new(t, 'spacing1'=>'10p', 'spacing2'=>'2p',
+ 'lmargin1'=>'12m', 'lmargin2'=>'6m',
+ 'rmargin'=>'10m')
+
+ #
+ insert('end', 'Text widgets like this one allow you to display information in a
+variety of styles. Display styles are controlled using a mechanism
+called ')
+ insert('end', 'tags', style_tag_big)
+ insert('end', '. Tags are just textual names that you can apply to one
+or more ranges of characters within a text widget. You can configure
+tags with various display styles. If you do this, then the tagged
+characters will be displayed with the styles you chose. The
+available display styles are:
+')
+ insert('end', "\n1. Font.", style_tag_big)
+ insert('end', " You can choose any X font, ")
+ insert('end', "large", style_tag_verybig)
+ insert('end', " or ")
+ insert('end', "small", style_tag_small)
+ insert('end', ".\n")
+ insert('end', "\n2. Color.", style_tag_big)
+ insert('end', " You can change either the ")
+ insert('end', "background", style_tag_color1)
+ insert('end', " or ")
+ insert('end', "foreground", style_tag_color2)
+ insert('end', "\ncolor, or ")
+ insert('end', "both", style_tag_color1, style_tag_color2)
+ insert('end', ".\n")
+ insert('end', "\n3. Stippling.", style_tag_big)
+ insert('end', " You can cause either the ")
+ insert('end', "background", style_tag_bgstipple)
+ insert('end', " or ")
+ insert('end', "foreground", style_tag_fgstipple)
+ insert('end', "\ninformation to be drawn with a stipple fill instead of a solid fill.\n")
+ insert('end', "\n4. Underlining.", style_tag_big)
+ insert('end', " You can ")
+ insert('end', "underline", style_tag_underline)
+ insert('end', " ranges of text.\n")
+ insert('end', "\n5. Overstrikes.", style_tag_big)
+ insert('end', " You can ")
+ insert('end', "draw lines through", style_tag_overstrike)
+ insert('end', " ranges of text.\n")
+ insert('end', "\n6. 3-D effects.", style_tag_big)
+ insert('end', " You can arrange for the background to be drawn\nwith a border that makes characters appear either\n")
+ insert('end', "raised", style_tag_raised)
+ insert('end', " or ")
+ insert('end', "sunken", style_tag_sunken)
+ insert('end', ".\n")
+ insert('end', "\n7. Justification.", style_tag_big)
+ insert('end', " You can arrange for lines to be displayed\n")
+ insert('end', "left-justified,\n")
+ insert('end', "right-justified, or\n", style_tag_right)
+ insert('end', "centered.\n", style_tag_center)
+ insert('end', "\n8. Superscripts and subscripts.", style_tag_big)
+ insert('end', " You can control the vertical\n")
+ insert('end', "position of text to generate superscript effects like 10")
+ insert('end', "n", style_tag_super)
+ insert('end', " or\nsubscript effects like X")
+ insert('end', "i", style_tag_sub)
+ insert('end', ".\n")
+ insert('end', "\n9. Margins.", style_tag_big)
+ insert('end', " You can control the amount of extra space left")
+ insert('end', " on\neach side of the text:\n")
+ insert('end', "This paragraph is an example of the use of ", style_tag_margins)
+ insert('end', "margins. It consists of a single line of text ", style_tag_margins)
+ insert('end', "that wraps around on the screen. There are two ", style_tag_margins)
+ insert('end', "separate left margin values, one for the first ", style_tag_margins)
+ insert('end', "display line associated with the text line, ", style_tag_margins)
+ insert('end', "and one for the subsequent display lines, which ", style_tag_margins)
+ insert('end', "occur because of wrapping. There is also a ", style_tag_margins)
+ insert('end', "separate specification for the right margin, ", style_tag_margins)
+ insert('end', "which is used to choose wrap points for lines.\n", style_tag_margins)
+ insert('end', "\n10. Spacing.", style_tag_big)
+ insert('end', " You can control the spacing of lines with three\n")
+ insert('end', "separate parameters. \"Spacing1\" tells how much ")
+ insert('end', "extra space to leave\nabove a line, \"spacing3\" ")
+ insert('end', "tells how much space to leave below a line,\nand ")
+ insert('end', "if a text line wraps, \"spacing2\" tells how much ")
+ insert('end', "space to leave\nbetween the display lines that ")
+ insert('end', "make up the text line.\n")
+ insert('end', "These indented paragraphs illustrate how spacing ", style_tag_spacing)
+ insert('end', "can be used. Each paragraph is actually a ", style_tag_spacing)
+ insert('end', "single line in the text widget, which is ", style_tag_spacing)
+ insert('end', "word-wrapped by the widget.\n", style_tag_spacing)
+ insert('end', "Spacing1 is set to 10 points for this text, ", style_tag_spacing)
+ insert('end', "which results in relatively large gaps between ", style_tag_spacing)
+ insert('end', "the paragraphs. Spacing2 is set to 2 points, ", style_tag_spacing)
+ insert('end', "which results in just a bit of extra space ", style_tag_spacing)
+ insert('end', "within a pararaph. Spacing3 isn't used ", style_tag_spacing)
+ insert('end', "in this example.\n", style_tag_spacing)
+ insert('end', "To see where the space is, select ranges of ", style_tag_spacing)
+ insert('end', "text within these paragraphs. The selection ", style_tag_spacing)
+ insert('end', "highlight will cover the extra space.", style_tag_spacing)
+
+}
+
+txt.width 70
+txt.height 32
diff --git a/ext/tk/sample/demos-en/tcolor b/ext/tk/sample/demos-en/tcolor
new file mode 100644
index 0000000000..48cda6d1da
--- /dev/null
+++ b/ext/tk/sample/demos-en/tcolor
@@ -0,0 +1,526 @@
+#!/usr/bin/env ruby
+#
+# tcolor --
+# simple color editor which supports RGB, HSB and CYM color space
+#
+# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp)
+# last update: Thu Jun 18 06:32:35 JST 1998
+#
+
+require "tk"
+
+
+# use TkVariable instance for the variable which is changed by Tk interpreter
+
+$colorSpace = TkVariable.new(:rgb)
+$master = nil
+$red = 65535
+$green = 0
+$blue = 0
+$color = "#ffff00000000"
+$updating = TkVariable.new(0)
+$autoUpdate = TkVariable.new(1)
+$name = TkVariable.new($color)
+$command = TkVariable.new("print(%%,\"\n\")")
+# $command = TkVariable.new("")
+$label1 = TkVariable.new("label1")
+$label2 = TkVariable.new("label2")
+$label3 = TkVariable.new("label3")
+
+
+# setup the entry of the resourc database
+if (TkVarAccess.new('tcl_platform')['platform'] == 'unix')
+ TkOptionDB.add('*Entry.background', 'white')
+end
+
+
+# methods for events
+
+def rgbToHsv(red,green,blue)
+
+ if ( red > green )
+ max = red
+ min = green
+ else
+ max = green
+ min = red
+ end
+
+ if ( blue > max )
+ max = blue
+ else
+ if ( blue < min )
+ min = blue
+ end
+ end
+
+ range = max - min
+
+ if ( max == 0 )
+ sat = 0.0
+ else
+ sat = (max-min)/max
+ end
+
+ if ( sat == 0 )
+ hue = 0.0
+ else
+ rc = (max-red)/range
+ gc = (max-green)/range
+ bc = (max-blue)/range
+ if ( red == max )
+ hue = 0.166667 * (bc - gc)
+ else
+ if ( green == max )
+ hue = 0.166667 * (2.0 + rc - bc)
+ else
+ hue = 0.166667 * (4.0 + gc - rc)
+ end
+ end
+ if ( hue < 0.0 )
+ hue = hue + 1.0
+ end
+ end
+
+ [hue,sat,max/65535]
+end
+
+
+def hsbToRgb(hue,sat,value)
+ v = 65535.0 * value
+ if( sat == 0 )
+ ans = [v,v,v]
+ else
+ hue = hue*6.0
+ if ( hue >= 6 )
+ hue = 0.0
+ end
+ i = hue.to_i
+ f = hue - i
+ p = 65535.0 * value * (1.0 - sat)
+ q = 65535.0 * value * (1.0 - (sat * f))
+ t = 65535.0 * value * (1.0 - (sat * (1.0 - f)))
+ case i
+ when 0
+ ans = [v,t,p]
+ when 1
+ ans = [q,v,p]
+ when 2
+ ans = [p,v,t]
+ when 3
+ ans = [p,q,v]
+ when 4
+ ans = [t,p,v]
+ when 5
+ ans = [v,p,q]
+ else
+ raise(eException,"i value #{i} is out of range")
+ end
+ end
+ return ans
+end
+
+
+def _null_binding
+ Module.new.instance_eval{binding}
+end
+private :_null_binding
+
+def doUpdate
+ newCmd = $command.to_s.gsub("%%","\"#{$color}\"")
+ eval(newCmd, _null_binding)
+end
+
+
+def tc_scaleChanged
+ if( $updating.to_i == 1 )
+ return
+ end
+
+ $master = :scale if $master == nil
+
+ scale1 = $root.middle.middle.scale1
+ scale2 = $root.middle.middle.scale2
+ scale3 = $root.middle.middle.scale3
+
+ case $colorSpace.value.intern
+ when :rgb
+ $red = (scale1.get * 65.535).to_i
+ $green = (scale2.get * 65.535).to_i
+ $blue = (scale3.get * 65.535).to_i
+ when :cmy
+ $red = (65535 - scale1.get * 65.535).to_i
+ $green = (65535 - scale2.get * 65.535).to_i
+ $blue = (65535 - scale3.get * 65.535).to_i
+ when :hsb
+ list = hsbToRgb(scale1.get / 1000.0,
+ scale2.get / 1000.0,
+ scale3.get / 1000.0)
+ $red = list[0]
+ $green = list[1]
+ $blue = list[2]
+ else
+ raise(Exception,"unknown colorSpace")
+ end
+ $color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i)
+ $name.value = $color if $master == :scale
+ $root.middle.right.set_color($color)
+ if( $autoUpdate.to_i == 1 )
+ doUpdate
+ end
+ Tk.update(true)
+ $master = nil if $master == :scale
+end
+
+
+def tc_setScales
+ $updating.value = 1
+
+ scale1 = $root.middle.middle.scale1
+ scale2 = $root.middle.middle.scale2
+ scale3 = $root.middle.middle.scale3
+
+ case $colorSpace.value.intern
+ when :rgb
+ scale1.set($red / 65.535)
+ scale2.set($green / 65.535)
+ scale3.set($blue / 65.535)
+ when :cmy
+ scale1.set((65535 - $red) / 65.535)
+ scale2.set((65535 - $green) / 65.535)
+ scale3.set((65535 - $blue) / 65.535)
+ when :hsb
+ list = rgbToHsv($red,$green,$blue)
+ scale1.set( list[0] * 1000.0 )
+ scale2.set( list[1] * 1000.0 )
+ scale3.set( list[2] * 1000.0 )
+ else
+ raise(Exception,"unknown colorSpace")
+ end
+
+ $updating.value = 0
+end
+
+
+def tc_loadNamedColor(name)
+ $name.value = name
+ $master = :name if $master == nil
+ if name[0,1] != "#"
+ list = TkWinfo.rgb($root.middle.right.swatch,name)
+ $red = list[0]
+ $green = list[1]
+ $blue = list[2]
+ else
+ case name.length
+ when 4
+ fmt = /#(.{1})(.{1})(.{1})/
+ shift = 12
+ when 7
+ fmt = /#(.{2})(.{2})(.{2})/
+ shift = 8
+ when 10
+ fmt = /#(.{3})(.{3})(.{3})/
+ shift = 4
+ when 13
+ fmt = /#(.{4})(.{4})(.{4})/
+ shift = 0
+ else
+ raise(eException,"syntax error in color name \"#{name}\"")
+ end
+ name.scan(fmt){|strlist|
+ if strlist.length != 3
+ raise(eException,"syntax error in color name \"#{name}\"")
+ end
+ $red = strlist[0].hex
+ $green = strlist[1].hex
+ $blue = strlist[2].hex
+ }
+ $red = $red << shift
+ $green = $green << shift
+ $blue = $blue << shift
+ end
+
+ tc_setScales
+ $color = format("#%04x%04x%04x",$red,$green,$blue)
+ $root.middle.right.set_color($color)
+ if $autoUpdate.to_i == 1
+ doUpdate
+ end
+ Tk.update(true)
+ $master = nil if $master == :name
+end
+
+
+def changeColorSpace(space)
+ case space
+ when :rgb
+ $label1.value = "Red"
+ $label2.value = "Green"
+ $label3.value = "Blue"
+ when :cmy
+ $label1.value = "Cyan"
+ $label2.value = "Magenta"
+ $label3.value = "Yellow"
+ when :hsb
+ $label1.value = "Hue"
+ $label2.value = "Saturation"
+ $label3.value = "Brightness"
+ end
+ tc_setScales
+end
+
+
+# menu
+
+class TkColorMenuFrame<TkFrame
+ def initialize(parent)
+ super(parent,
+ "relief"=>"raised",
+ "borderwidth"=>"2")
+
+ # File menubutton
+ @file = TkMenubutton.new(self){|button|
+
+ # File menu
+ @file_menu = TkMenu.new(button){
+ add "radio",
+ "label" => "RGB color space",
+ "variable" => $colorSpace,
+ "value" => :rgb,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:rgb)}
+ add "radio",
+ "label" => "CMY color space",
+ "variable" => $colorSpace,
+ "value" => :cmy,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:cmy)}
+ add "radio",
+ "label" => "HSB color space",
+ "variable" => $colorSpace,
+ "value" => :hsb,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:hsb)}
+ add "separator"
+ add "radio",
+ "label" => "Automatic updates",
+ "variable" => $autoUpdate,
+ "value" => "1",
+ "underline" => "0"
+ add "radio",
+ "label" => "Manual updates",
+ "variable" => $autoUpdate,
+ "value" => "0",
+ "underline" => "0"
+ add "separator"
+ add "command",
+ "label" => "Exit program",
+ "underline" => "0",
+ "command" => proc{exit}
+ }
+
+ # assign File menu to File button
+ menu @file_menu
+
+ text "File"
+ underline "0"
+ }.pack("side"=>"left")
+
+ self
+ end
+end
+
+
+# bottom frame
+class TkColorBotFrame<TkFrame
+ def initialize(parent)
+ super(parent,
+ "relief"=> "raised",
+ "borderwidth"=> 2)
+
+ @commandLabel = TkLabel.new(self,
+ "text"=> "Command:")
+ @command = TkEntry.new(self,
+ "relief"=> "sunken",
+ "borderwidth"=> "2",
+ "textvariable"=> $command,
+ "font"=> "-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @update = TkButton.new(self,
+ "text"=> "Update",
+ "command"=> proc{doUpdate})
+ @commandLabel.pack("side"=>"left")
+ @update.pack("side"=>"right","pady"=>".1c","padx"=>".25c")
+ @command.pack("expand"=>"yes","fill"=>"x","ipadx"=>".25c")
+
+ self
+ end
+end
+
+
+# left side frame of middle level
+class TkColorMiddleLeftFrame<TkFrame
+ def initialize(parent)
+ super(parent)
+
+ for i in ["/usr/local/lib/X11rgb.txt","/usr/lib/X11/rgb.txt",
+ "/X11/R5/lib/X11/rgb.txt","/X11/R4/lib/rgb/rgb.txt",
+ "/usr/openwin/lib/X11/rgb.txt"]
+ if !File.readable?(i)
+ next
+ end
+ f = File.open(i)
+ @scroll = TkScrollbar.new(self,
+ "orient"=>"vertical",
+ "relief"=>"sunken",
+ "borderwidth"=>"2")
+ @scroll.pack("side"=>"right","fill"=>"y")
+ @names = TkListbox.new(self,
+ "width"=>"20",
+ "height"=>"12",
+ "yscrollcommand"=> proc{|first,last| @scroll.set first,last},
+ "relief"=>"sunken",
+ "borderwidth"=>"2",
+ "exportselection"=>"false")
+ @scroll.command(proc{|*args| @names.yview(*args)})
+ @names.bind("Double-1",proc{
+ tc_loadNamedColor(@names.get(@names.curselection))})
+ @names.pack("side"=>"left")
+ while (line = f.gets)
+ line.chop!
+ linelist = line.split(/[ \t]+/)
+ if linelist.length == 4
+ @names.insert("end",linelist[3])
+ end
+ end
+ f.close
+ break
+ end
+
+ self
+ end
+end
+
+
+# middle frame of middle level
+class TkColorMiddleMiddleFrame<TkFrame
+ attr_reader :scale1, :scale2, :scale3
+
+ def initialize(parent)
+ super(parent)
+
+ @f1 = TkFrame.new(self)
+ @f2 = TkFrame.new(self)
+ @f3 = TkFrame.new(self)
+ @f4 = TkFrame.new(self)
+
+ for f in [@f1,@f2,@f3]
+ f.pack("side"=>"top","expand"=>"yes")
+ end
+ @f4.pack("side"=>"top","expand"=>"yes","fill"=>"x")
+
+ @label1 = TkLabel.new(self,"textvariable"=>$label1)
+ @scale1 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale1.pack("side"=>"top","anchor"=>"w")
+ @label1.pack("side"=>"top","anchor"=>"w")
+
+ @label2 = TkLabel.new(self,"textvariable"=>$label2)
+ @scale2 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale2.pack("side"=>"top","anchor"=>"w")
+ @label2.pack("side"=>"top","anchor"=>"w")
+
+ @label3 = TkLabel.new(self,"textvariable"=>$label3)
+ @scale3 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale3.pack("side"=>"top","anchor"=>"w")
+ @label3.pack("side"=>"top","anchor"=>"w")
+
+ @nameLabel = TkLabel.new(self,"text"=>"Name:")
+ @name = TkEntry.new(self,"relief"=>"sunken","borderwidth"=>"2",
+ "textvariable"=>$name,"width"=>"10",
+ "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @nameLabel.pack("side"=>"left")
+ @name.pack("side"=>"right", "expand"=>"1", "fill"=>"x")
+ @name.bind("Return",proc{tc_loadNamedColor $name.to_s})
+
+ self
+ end
+end
+
+
+class TkColorMiddleRightFrame<TkFrame
+ attr_reader :swatch
+
+ def initialize(parent)
+ super(parent)
+ @swatch = TkFrame.new(self, "width"=>"2c", "height"=>"5c",
+ "background"=>$color)
+ @value = TkLabel.new(self,
+ "text"=>$color,
+ "width"=>"13",
+ "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @swatch.pack("side"=>"top","expand"=>"yes","fill"=>"both")
+ @value.pack("side"=>"bottom","pady"=>".25c")
+
+ self
+ end
+
+ def set_color(color)
+ @swatch["background"] = color
+ @value["text"] = color
+ end
+end
+
+
+
+# middle level frame
+class TkColorMiddleFrame<TkFrame
+ attr_reader :left, :middle, :right
+
+ def initialize(parent)
+ super(parent,
+ "relief"=> "raised",
+ "borderwidth"=> "2")
+
+ @left = TkColorMiddleLeftFrame.new(self)
+ @left.pack("side"=>"left","padx"=>".25c","pady"=>".25c")
+
+ @middle = TkColorMiddleMiddleFrame.new(self)
+ @middle.pack("side"=>"left","expand"=>"yes","fill"=>"y")
+
+ @right = TkColorMiddleRightFrame.new(self)
+ @right.pack("side"=>"left","padx"=>".25c","pady"=>".25c","anchor"=>"s")
+
+ self
+ end
+end
+
+
+class TkColor<TkRoot
+ attr_reader :menu, :bottom, :middle
+
+ def initialize(*args)
+ super(*args)
+ @menu = TkColorMenuFrame.new(self)
+ @menu.pack("side"=>"top", "fill"=>"x")
+
+ @bottom = TkColorBotFrame.new(self)
+ @bottom.pack("side"=>"bottom","fill"=>"x")
+
+ @middle = TkColorMiddleFrame.new(self)
+ @middle.pack("side"=>"top","fill"=>"both")
+
+ self
+ end
+end
+
+
+$root = TkColor.new
+changeColorSpace :rgb
+
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/text.rb b/ext/tk/sample/demos-en/text.rb
new file mode 100644
index 0000000000..2f72de7583
--- /dev/null
+++ b/ext/tk/sample/demos-en/text.rb
@@ -0,0 +1,128 @@
+# text.rb
+#
+# This demonstration script creates a text widget that describes
+# the basic editing functions.
+#
+# text (basic facilities) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($text_demo) && $text_demo
+ $text_demo.destroy
+ $text_demo = nil
+end
+
+# demo toplevel widget
+$text_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Basic Facilities")
+ iconname("text")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($text_demo).pack(:fill=>:both, :expand=>true)
+
+# version check
+if ((Tk::TK_VERSION.split('.').collect{|n| n.to_i} <=> [8,4]) < 0)
+ undo_support = false
+else
+ undo_support = true
+end
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $text_demo
+ $text_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'text'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# text
+TkText.new(base_frame){|t|
+ relief 'sunken'
+ bd 2
+ setgrid 1
+ height 30
+ if undo_support
+ undo true
+ autoseparators true
+ end
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ #
+ insert('0.0', <<EOT)
+This window is a text widget. It displays one or more lines of text
+and allows you to edit the text. Here is a summary of the things you
+can do to a text widget:
+
+1. Scrolling. Use the scrollbar to adjust the view in the text window.
+
+2. Scanning. Press mouse button 2 in the text window and drag up or down.
+This will drag the text at high speed to allow you to scan its contents.
+
+3. Insert text. Press mouse button 1 to set the insertion cursor, then
+type text. What you type will be added to the widget.
+
+4. Select. Press mouse button 1 and drag to select a range of characters.
+Once you've released the button, you can adjust the selection by pressing
+button 1 with the shift key down. This will reset the end of the
+selection nearest the mouse cursor and you can drag that end of the
+selection by dragging the mouse before releasing the mouse button.
+You can double-click to select whole words or triple-click to select
+whole lines.
+
+5. Delete and replace. To delete text, select the characters you'd like
+to delete and type Backspace or Delete. Alternatively, you can type new
+text, in which case it will replace the selected text.
+
+6. Copy the selection. To copy the selection into this window, select
+what you want to copy (either here or in another application), then
+click button 2 to copy the selection to the point of the mouse cursor.
+
+7. Edit. Text widgets support the standard Motif editing characters
+plus many Emacs editing characters. Backspace and Control-h erase the
+character to the left of the insertion cursor. Delete and Control-d
+erase the character to the right of the insertion cursor. Meta-backspace
+deletes the word to the left of the insertion cursor, and Meta-d deletes
+the word to the right of the insertion cursor. Control-k deletes from
+the insertion cursor to the end of the line, or it deletes the newline
+character if that is the only thing left on the line. Control-o opens
+a new line by inserting a newline character to the right of the insertion
+cursor. Control-t transposes the two characters on either side of the
+insertion cursor. #{
+ if undo_support
+ undo_text = "Control-z undoes the last editing action performed,\nand "
+ case $tk_platform['platform']
+ when "unix", "macintosh"
+ undo_text << "Control-Shift-z"
+ else # 'windows'
+ undo_text << "Control-y"
+ end
+ undo_text << "redoes undone edits."
+ else
+ ""
+ end
+}
+
+8. Resize the window. This widget has been configured with the "setGrid"
+option on, so that if you resize the window it will always resize to an
+even number of characters high and wide. Also, if you make the window
+narrow you can see that long lines automatically wrap around onto
+additional lines so that all the information is always visible.
+EOT
+
+ set_insert('0.0')
+}
diff --git a/ext/tk/sample/demos-en/textpeer.rb b/ext/tk/sample/demos-en/textpeer.rb
new file mode 100644
index 0000000000..20192fcd05
--- /dev/null
+++ b/ext/tk/sample/demos-en/textpeer.rb
@@ -0,0 +1,76 @@
+#
+# text widget peering demo (called by 'widget')
+#
+# based on Tcl/Tk8.5.0 widget demos
+
+if defined?($textpeer_demo) && $textpeer_demo
+ $textpeer_demo.destroy
+ $textpeer_demo = nil
+end
+
+# demo toplevel widget
+$textpeer_demo = TkToplevel.new {|w|
+ title("Text Wdget Peering Demonstration")
+ iconname("textpeer")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($textpeer_demo).pack(:fill=>:both, :expand=>true)
+
+count = [0]
+
+## Define a widget that we peer from; it won't ever actually be shown though
+first = TkText.new(base_frame, :widgetname=>"text#{count[0] += 1}")
+first.insert :end,"This is a coupled pair of text widgets; they are peers to "
+first.insert :end,"each other. They have the same underlying data model, but "
+first.insert :end,"can show different locations, have different current edit "
+first.insert :end,"locations, and have different selections. You can also "
+first.insert :end,"create additional peers of any of these text widgets using "
+first.insert :end,"the Make Peer button beside the text widget to clone, and "
+first.insert :end,"delete a particular peer widget using the Delete Peer "
+first.insert :end,"button."
+
+Tk.update_idletasks ## for 'first' widget
+
+## Procedures to make and kill clones; most of this is just so that the demo
+## looks nice...
+def makeClone(count, win, txt)
+ cnt = (count[0] += 1)
+ peer = TkText::Peer.new(txt, win, :widgetname=>"text#{cnt}")
+ sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}")
+ peer.yscrollbar sbar
+ b1 = TkButton.new(win, :widgetname=>"clone#{cnt}", :text=>'Make Peer',
+ :command=>proc{makeClone(count, win, peer)})
+ b2 = TkButton.new(win, :widgetname=>"kill#{cnt}", :text=>'Delete Peer',
+ :command=>proc{killClone(win, cnt)})
+ row = cnt * 2
+ TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row)
+ TkGrid.configure('^', '^', b2, :sticky=>'nsew', :row=>(row+=1))
+ TkGrid.configure(b1, b2, :sticky=>'new')
+ TkGrid.rowconfigure(win, b2, :weight=>1)
+end
+
+def killClone(win, cnt)
+ Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
+ "#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}")
+end
+
+## Now set up the GUI
+makeClone(count, base_frame, first)
+makeClone(count, base_frame, first)
+first.destroy
+
+## See Code / Dismiss buttons
+TkFrame.new(base_frame){|f|
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $textpeer_demo.destroy
+ $textpeer_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'textpeer'
+ }).pack(:side=>:left, :expand=>true)
+
+ TkGrid.configure(f, '-', '-', :sticky=>'ew', :row=>5000)
+}
+TkGrid.columnconfigure(base_frame, 0, :weight=>1)
diff --git a/ext/tk/sample/demos-en/timer b/ext/tk/sample/demos-en/timer
new file mode 100644
index 0000000000..6cb7c87e09
--- /dev/null
+++ b/ext/tk/sample/demos-en/timer
@@ -0,0 +1,136 @@
+#!/usr/bin/env ruby
+#
+# timer --
+# This script generates a counter with start,stop and reset buttons.
+#
+# Copyright (C) 1998 Takaaki Tateishi (ttate@jaist.ac.jp)
+# last update: Sat Jun 27 12:24:14 JST 1998
+#
+
+require "tk"
+require "thread"
+require "tkafter"
+
+$time = "0.00"
+$m = Mutex.new
+$loop = false
+
+def timer_stop
+ $loop = false
+ $m.lock
+end
+
+def timer_start
+ $loop = true
+ $m.unlock
+end
+
+def timer_reset
+ $time = "0.00"
+ $root.countframe.counter['text'] = $time
+end
+
+def timer_loop
+ if $loop
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ end
+ Tk.after(10,proc{timer_loop})
+end
+
+
+#
+# thread version
+#
+def timer_loop2
+ while true
+ $m.lock
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ sleep(0.01)
+ $m.unlock
+ end
+end
+
+#
+# TkAfter
+#
+def timer_loop3
+ if $loop
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ end
+end
+
+
+class CountFrame < TkFrame
+ attr_reader :counter
+
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+ @counter = TkLabel.new(self,
+ 'text'=>$time,
+ 'relief'=>'raised')
+ @counter.pack('fill'=>'both')
+ self
+ end
+end
+
+
+class ButtonFrame < TkFrame
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+=begin
+ @stop = TkButton.new(self,
+ 'text'=>'Stop',
+ 'command'=>proc{timer_stop})
+ @start = TkButton.new(self,
+ 'text'=>'Start',
+ 'command'=>proc{timer_start})
+=end
+ @stop = TkButton.new(self, :text=>'Stop', :state=>:disabled)
+ @start = TkButton.new(self, :text=>'Start', :state=>:normal)
+
+ @stop.command proc{
+ timer_stop
+ @start.state(:normal)
+ @stop.state(:disabled)
+ }
+ @start.command proc{
+ timer_start
+ @stop.state(:normal)
+ @start.state(:disabled)
+ }
+
+ @reset = TkButton.new(self,
+ 'text'=>'Reset',
+ 'command'=>proc{timer_reset})
+ for b in [@stop,@start,@reset]
+ b.pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+ end
+ end
+end
+
+
+class Timer < TkRoot
+ attr_reader :countframe
+
+ def initialize(*args)
+ super(*args)
+ @countframe = CountFrame.new(self)
+ @buttonframe = ButtonFrame.new(self)
+ for f in [@buttonframe,@countframe]
+ f.pack('side'=>'top', 'fill'=>'both')
+ end
+ self
+ end
+end
+
+
+$root = Timer.new
+
+#$thread = Thread.start{timer_loop2}
+#timer_loop
+TkAfter.new(10,-1,proc{timer_loop3}).start
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-en/tkencoding.rb b/ext/tk/sample/demos-en/tkencoding.rb
new file mode 100644
index 0000000000..727491a6ad
--- /dev/null
+++ b/ext/tk/sample/demos-en/tkencoding.rb
@@ -0,0 +1,42 @@
+# -*- ruby -*-
+#
+# tkencoding.rb
+# written by ttate@jaist.ac.jp
+
+class TclTkIp
+ alias __eval _eval
+ alias __invoke _invoke
+ private :__eval
+ private :__invoke
+
+ attr_accessor :encoding
+
+ def _eval(cmd)
+ if( @encoding )
+ _fromUTF8(__eval(_toUTF8(cmd,@encoding)),@encoding)
+ else
+ __eval(cmd)
+ end
+ end
+
+ def _invoke(*cmds)
+ if( @encoding )
+ cmds = cmds.collect{|cmd| _toUTF8(cmd,@encoding)}
+ _fromUTF8(__invoke(*cmds),@encoding)
+ else
+ __invoke(*cmds)
+ end
+ end
+end
+
+module Tk
+ INTERP = TkCore::INTERP
+
+ def encoding=(name)
+ INTERP.encoding = name
+ end
+
+ def encoding
+ INTERP.encoding
+ end
+end
diff --git a/ext/tk/sample/demos-en/toolbar.rb b/ext/tk/sample/demos-en/toolbar.rb
new file mode 100644
index 0000000000..e7cbeb4235
--- /dev/null
+++ b/ext/tk/sample/demos-en/toolbar.rb
@@ -0,0 +1,130 @@
+# toolbar.rb --
+#
+# This demonstration script creates a toolbar that can be torn off.
+#
+# based on "Id: toolbar.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($toolbar_demo) && $toolbar_demo
+ $toolbar_demo.destroy
+ $toolbar_demo = nil
+end
+
+$toolbar_demo = TkToplevel.new {|w|
+ title("Ttk Menu Buttons")
+ iconname("toolbar")
+ positionWindow(w)
+}
+
+base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true)
+
+if Tk.windowingsystem != 'aqua'
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
+This is a demonstration of how to do \
+a toolbar that is styled correctly \
+and which can be torn off (this feature reqrires Tcl/Tk8.5). \
+The buttons are configured to be \\u201Ctoolbar style\\u201D buttons by \
+telling them that they are to use the Toolbutton style. At the left \
+end of the toolbar is a simple marker that the cursor changes to a \
+movement icon over; drag that away from the toolbar to tear off the \
+whole toolbar into a separate toplevel widget. When the dragged-off \
+toolbar is no longer needed, just close it like any normal toplevel \
+and it will reattach to the window it was torn off from.
+EOL
+else
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i',
+ :text=>Tk::UTF8_String.new(<<EOL))
+This is a demonstration of how to do \
+a toolbar that is styled correctly. The buttons are configured to \
+be \\u201Ctoolbar style\\u201D buttons by telling them that they are \
+to use the Toolbutton style.
+EOL
+end
+
+## Set up the toolbar hull
+tbar_base = Tk::Frame.new(base_frame, # Must be a starndard Tk frame!
+ :widgetname=>'toolbar') # for window title
+sep = Ttk::Separator.new(base_frame)
+to_base = Ttk::Frame.new(tbar_base, :cursor=>'fleur')
+if Tk.windowingsystem != 'aqua'
+ to = Ttk::Separator.new(to_base, :orient=>:vertical)
+ to2 = Ttk::Separator.new(to_base, :orient=>:vertical)
+ to.pack(:fill=>:y, :expand=>true, :padx=>2, :side=>:left)
+ to2.pack(:fill=>:y, :expand=>true, :side=>:left)
+end
+
+contents = Ttk::Frame.new(tbar_base)
+Tk.grid(to_base, contents, :sticky=>'nsew')
+tbar_base.grid_columnconfigure(contents, :weight=>1)
+contents.grid_columnconfigure(1000, :weight=>1)
+
+if Tk.windowingsystem != 'aqua'
+ ## Bindings so that the toolbar can be torn off and reattached
+ to_base.bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ to. bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ to2. bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ def tbar_base.tearoff(w, x, y)
+ on_win = TkWinfo.containing(x, y)
+ return unless (on_win && on_win.path =~ /^#{@path}(\.|$)/)
+ self.grid_remove
+ w.grid_remove
+ self.wm_manage
+ # self.wm_title('Toolbar') # if you don't want to use its widget name as a window title.
+ self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(w) }
+ end
+ def tbar_base.untearoff(w)
+ self.wm_forget
+ w.grid
+ self.grid
+ end
+end
+
+## Some content for the rest of the toplevel
+text = TkText.new(base_frame, :width=>40, :height=>10)
+
+## Toolbar contents
+tb_btn = Ttk::Button.new(tbar_base, :text=>'Button', :style=>'Toolbutton',
+ :command=>proc{text.insert(:end, "Button Pressed\n")})
+tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'Check', :style=>'Toolbutton',
+ :variable=>(check = TkVariable.new),
+ :command=>proc{
+ text.insert(:end, "Check is #{check.value}\n")
+ })
+tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'Menu')
+tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families,
+ :state=>:readonly)
+tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn))
+menu.add(:command, :label=>'Just', :command=>proc{text.insert(:end, "Just\n")})
+menu.add(:command, :label=>'An', :command=>proc{text.insert(:end, "An\n")})
+menu.add(:command, :label=>'Example',
+ :command=>proc{text.insert(:end, "Example\n")})
+tb_combo.bind('<ComboboxSelected>'){ text.font.family = tb_combo.get }
+
+## Arrange contents
+Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo,
+ :in=>contents, :padx=>2, :sticky=>'ns')
+Tk.grid(tbar_base, :sticky=>'ew')
+Tk.grid(sep, :sticky=>'ew')
+Tk.grid(msg, :sticky=>'ew')
+Tk.grid(text, :sticky=>'nsew')
+base_frame.grid_rowconfigure(text, :weight=>1)
+base_frame.grid_columnconfigure(text, :weight=>1)
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'toolbar'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $toolbar_demo.destroy
+ $toolbar_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ Tk.grid(frame, :sticky=>'ew')
+}
diff --git a/ext/tk/sample/demos-en/tree.rb b/ext/tk/sample/demos-en/tree.rb
new file mode 100644
index 0000000000..69154ee076
--- /dev/null
+++ b/ext/tk/sample/demos-en/tree.rb
@@ -0,0 +1,119 @@
+# tree.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# tree widget.
+#
+# based on "Id: tree.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($tree_demo) && $tree_demo
+ $tree_demo.destroy
+ $tree_demo = nil
+end
+
+$tree_demo = TkToplevel.new {|w|
+ title("Directory Browser")
+ iconname("tree")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true)
+
+## Explanatory text
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
+ :text=><<EOL).pack(:fill=>:x)
+Ttk is the new Tk themed widget set. \
+One of the widgets it includes is a tree widget, \
+which allows the user to browse a hierarchical data-set such as a filesystem. \
+The tree widget not only allows for the tree part itself, \
+but it also supports an arbitrary number of additional columns \
+which can show additional data (in this case, the size of the files \
+found in your filesystem). \
+You can also change the width of the columns \
+by dragging the boundary between them.
+EOL
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'tree'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $tree_demo.destroy
+ $tree_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+## Code to populate the roots of the tree (can be more than one on Windows)
+def populate_roots(tree)
+ TkComm.simplelist(Tk.tk_call('file', 'volumes')).sort.each{|dir|
+ populate_tree(tree, tree.insert(nil, :end, :text=>dir,
+ :values=>[dir, 'directory']))
+ }
+end
+
+## Code to populate a node of the tree
+def populate_tree(tree, node)
+ return if tree.get(node, :type) != 'directory'
+
+ path = tree.get(node, :fullpath)
+ tree.delete(tree.children(node))
+ Dir.glob("#{path}/*").sort.each{|f|
+ type = File.ftype(f) rescue nil
+ id = tree.insert(node, :end,
+ :text=>File.basename(f), :values=>[f, type]).id
+ if type == 'directory'
+ ## Make it so that this node is openable
+ tree.insert(id, 0, :text=>'dummy')
+ tree.itemconfigure(id, :text=>File.basename(f))
+ elsif type == 'file'
+ size = File.size(f)
+ if size >= 1024*1024*1024
+ size = '%.1f GB' % (size.to_f/1024/1024/1024)
+ elsif size >= 1024*1024
+ size = '%.1f MB' % (size.to_f/1024/1024)
+ elsif size >= 1024
+ size = '%.1f KB' % (size.to_f/1024)
+ else
+ size = '%.1f bytes' % (size.to_f/1024)
+ end
+ tree.set(id, :size, size)
+ end
+ }
+
+ # Stop this code from rerunning on the current node
+ tree.set(node, :type, 'processed_directory')
+end
+
+## Create the tree and set it up
+tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size),
+ :displaycolumns=>['size'])
+if Tk.windowingsystem != 'aqua'
+ vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Ttk::Scrollbar.new(base_frame))
+else
+ vsb = tree.yscrollbar(Tk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Tk::Scrollbar.new(base_frame))
+end
+
+tree.heading_configure('#0', :text=>'Directory Structure')
+tree.heading_configure('size', :text=>'File Size')
+tree.column_configure('size', :stretch=>0, :width=>70)
+populate_roots(tree)
+tree.bind('<TreeviewOpen>', '%W'){|w| populate_tree(w, w.focus_item)}
+
+## Arrange the tree and its scrollbars in the toplevel
+container = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+container.lower
+Tk.grid(tree, vsb, :in=>container, :sticky=>'nsew')
+Tk.grid(hsb, :in=>container, :sticky=>'nsew')
+container.grid_columnconfigure(0, :weight=>1)
+container.grid_rowconfigure(0, :weight=>1)
diff --git a/ext/tk/sample/demos-en/ttkbut.rb b/ext/tk/sample/demos-en/ttkbut.rb
new file mode 100644
index 0000000000..a784efcc08
--- /dev/null
+++ b/ext/tk/sample/demos-en/ttkbut.rb
@@ -0,0 +1,139 @@
+# ttkbut.rb
+#
+# This demonstration script creates a toplevel window containing several
+# simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and
+# radiobuttons.
+#
+# based on "Id: ttkbut.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkbut_demo) && $ttkbut_demo
+ $ttkbut_demo.destroy
+ $ttkbut_demo = nil
+end
+
+$ttkbut_demo = TkToplevel.new {|w|
+ title("Simple Ttk Widgets")
+ iconname("ttkbut")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+Ttk is the new Tk themed widget set. This is a Ttk themed label, \
+and below are three groups of Ttk widgets in Ttk labelframes. \
+The first group are all buttons that set the current application theme \
+when pressed. The second group contains three sets of checkbuttons, \
+with a separator widget between the sets. Note that the "Enabled" \
+button controls whether all the other themed widgets in this toplevel are \
+in the disabled state. The third group has a collection of linked \
+radiobuttons.
+EOL
+
+## Add buttons for setting the theme
+buttons = Ttk::Labelframe.new(base_frame, :text=>'Buttons')
+# Ttk::Style.theme_names.each{|theme|
+# Ttk::Button.new(buttons, :text=>theme,
+# :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2)
+# }
+Ttk.themes.each{|theme|
+ Ttk::Button.new(buttons, :text=>theme,
+ :command=>proc{Ttk.set_theme theme}).pack(:pady=>2)
+}
+
+## Helper procedure for the top checkbutton
+def setState(root, value, *excepts)
+ return if excepts.member?(root)
+
+ ## Non-Ttk widgets (e.g. the toplevel) will fail, so make it silent
+ begin
+ root.state = value
+ rescue
+ end
+
+ ## Recursively invoke on all children of this root that are in the same
+ ## toplevel widget
+ root.winfo_children.each{|w|
+ setState(w, value, *excepts) if w.winfo_toplevel == root.winfo_toplevel
+ }
+end
+
+## Set up the checkbutton group
+checks = Ttk::Labelframe.new(base_frame, :text=>'Checkbuttons')
+enabled = TkVariable.new(true)
+e = Ttk::Checkbutton.new(checks, :text=>'Enabled', :variable=>enabled,
+ :command=>proc{
+ setState($ttkbut_demo,
+ ((enabled.bool)? "!disabled" : "disabled"),
+ e)
+ })
+
+## See ttk_widget(n) for other possible state flags
+sep1 = Ttk::Separator.new(checks)
+sep2 = Ttk::Separator.new(checks)
+
+cheese = TkVariable.new
+tomato = TkVariable.new
+basil = TkVariable.new
+oregano = TkVariable.new
+
+c1 = Ttk::Checkbutton.new(checks, :text=>'Cheese', :variable=>cheese)
+c2 = Ttk::Checkbutton.new(checks, :text=>'Tomato', :variable=>tomato)
+c3 = Ttk::Checkbutton.new(checks, :text=>'Basil', :variable=>basil)
+c4 = Ttk::Checkbutton.new(checks, :text=>'Oregano', :variable=>oregano)
+
+Tk.pack(e, sep1, c1, c2, sep2, c3, c4, :fill=>:x, :pady=>2)
+
+## Set up the radiobutton group
+radios = Ttk::Labelframe.new(base_frame, :text=>'Radiobuttons')
+
+happyness = TkVariable.new
+
+r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Great', :value=>'great')
+r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Good', :value=>'good')
+r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Ok', :value=>'ok')
+r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Poor', :value=>'poor')
+r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Awful', :value=>'awful')
+
+Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Variables',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame, ['enabled', enabled],
+ ['cheese', cheese], ['tomato', tomato],
+ ['basil', basil], ['oregano', oregano],
+ ['happyness', happyness])
+ }),
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkbut'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $ttkbut_demo
+ $ttkbut_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x, :expand=>true)
+}
+
+## Arrange things neatly
+f = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+f.lower
+Tk.grid(buttons, checks, radios, :in=>f, :sticky=>'nwe', :pady=>2, :padx=>3)
+f.grid_columnconfigure([0, 1, 2], :weight=>1, :uniform=>:yes)
diff --git a/ext/tk/sample/demos-en/ttkmenu.rb b/ext/tk/sample/demos-en/ttkmenu.rb
new file mode 100644
index 0000000000..9399568313
--- /dev/null
+++ b/ext/tk/sample/demos-en/ttkmenu.rb
@@ -0,0 +1,85 @@
+# ttkmenu.rb --
+#
+# This demonstration script creates a toplevel window containing several Ttk
+# menubutton widgets.
+#
+# based on "Id: ttkmenu.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkmenu_demo) && $ttkmenu_demo
+ $ttkmenu_demo.destroy
+ $ttkmenu_demo = nil
+end
+
+$ttkmenu_demo = TkToplevel.new {|w|
+ title("Ttk Menu Buttons")
+ iconname("ttkmenu")
+ positionWindow(w)
+}
+
+base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+Ttk is the new Tk themed widget set, \
+and one widget that is available in themed form is the menubutton. \
+Below are some themed menu buttons \
+that allow you to pick the current theme in use. \
+Notice how picking a theme changes the way \
+that the menu buttons themselves look, \
+and that the central menu button is styled differently \
+(in a way that is normally suitable for toolbars). \
+However, there are no themed menus; the standard Tk menus were judged \
+to have a sufficiently good look-and-feel on all platforms, \
+especially as they are implemented as native controls in many places.
+EOL
+
+Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
+
+## See Code / Dismiss
+Ttk::Frame.new($ttkmenu_demo) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkmenu'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkmenu_demo.destroy
+ $ttkmenu_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+b1 = Ttk::Menubutton.new(base_frame,:text=>'Select a theme',:direction=>:above)
+b2 = Ttk::Menubutton.new(base_frame,:text=>'Select a theme',:direction=>:left)
+b3 = Ttk::Menubutton.new(base_frame,:text=>'Select a theme',:direction=>:right)
+b4 = Ttk::Menubutton.new(base_frame,:text=>'Select a theme',:direction=>:flush,
+ :style=>Ttk::Menubutton.style('Toolbutton'))
+b5 = Ttk::Menubutton.new(base_frame,:text=>'Select a theme',:direction=>:below)
+
+b1.menu(m1 = Tk::Menu.new(b1, :tearoff=>false))
+b2.menu(m2 = Tk::Menu.new(b2, :tearoff=>false))
+b3.menu(m3 = Tk::Menu.new(b3, :tearoff=>false))
+b4.menu(m4 = Tk::Menu.new(b4, :tearoff=>false))
+b5.menu(m5 = Tk::Menu.new(b5, :tearoff=>false))
+
+Ttk.themes.each{|theme|
+ m1.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m2.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m3.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m4.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m5.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+}
+
+f = Ttk::Frame.new(base_frame).pack(:fill=>:x)
+f1 = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+f.lower
+
+f.grid_anchor(:center)
+TkGrid('x', b1, 'x', :in=>f, :padx=>3, :pady=>2)
+TkGrid(b2, b4, b3, :in=>f, :padx=>3, :pady=>2)
+TkGrid('x', b5, 'x', :in=>f, :padx=>3, :pady=>2)
diff --git a/ext/tk/sample/demos-en/ttknote.rb b/ext/tk/sample/demos-en/ttknote.rb
new file mode 100644
index 0000000000..bc0c7b369a
--- /dev/null
+++ b/ext/tk/sample/demos-en/ttknote.rb
@@ -0,0 +1,89 @@
+# ttknote.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# notebook widget.
+#
+# based on "Id: ttknote.tcl,v 1.5 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttknote_demo) && $ttknote_demo
+ $ttknote_demo.destroy
+ $ttknote_demo = nil
+end
+
+$ttknote_demo = TkToplevel.new {|w|
+ title("Ttk Notebook Widget")
+ iconname("ttknote")
+ positionWindow(w)
+}
+
+## See Code / Dismiss
+Ttk::Frame.new($ttknote_demo) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttknote'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttknote_demo.destroy
+ $ttknote_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+base_frame = Ttk::Frame.new($ttknote_demo).pack(:fill=>:both, :expand=>true)
+
+## Make the notebook and set up Ctrl+Tab traversal
+notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true,
+ :padx=>2, :pady=>3)
+notebook.enable_traversal
+
+## Popuplate the first pane
+f_msg = Ttk::Frame.new(notebook)
+msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :text=><<EOL)
+Ttk is the new Tk themed widget set. \
+One of the widgets it includes is the notebook widget, \
+which provides a set of tabs that allow the selection of a group of panels, \
+each with distinct content. \
+They are a feature of many modern user interfaces. \
+Not only can the tabs be selected with the mouse, \
+but they can also be switched between using Ctrl+Tab \
+when the notebook page heading itself is selected. \
+Note that the second tab is disabled, and cannot be selected.
+EOL
+neat = TkVariable.new
+after_id = nil
+msg_b = Ttk::Button.new(f_msg, :text=>'Neat!', :underline=>0,
+ :command=>proc{
+ neat.value = 'Yeah, I know...'
+ Tk.after_cancel(after_id) if after_id
+ after_id = Tk.after(500){neat.value = ''}
+ })
+msg_b.winfo_toplevel.bind('Alt-n'){ msg_b.focus; msg_b.invoke }
+msg_l = Ttk::Label.new(f_msg, :textvariable=>neat)
+notebook.add(f_msg, :text=>'Description', :underline=>0, :padding=>2)
+Tk.grid(msg_m, '-', :sticky=>'new', :pady=>2)
+Tk.grid(msg_b, msg_l, :pady=>[2, 4])
+f_msg.grid_rowconfigure(1, :weight=>1)
+f_msg.grid_columnconfigure([0, 1], :weight=>1, :uniform=>1)
+
+## Populate the second pane. Note that the content doesn't really matter
+f_disabled = Ttk::Frame.new(notebook)
+notebook.add(f_disabled, :text=>'Disabled', :state=>:disabled)
+
+## Popuplate the third pane
+f_editor = Ttk::Frame.new(notebook)
+notebook.add(f_editor, :text=>'Text Editor', :underline=>0)
+editor_t = Tk::Text.new(f_editor, :width=>40, :height=>10, :wrap=>:char)
+if Tk.windowingsystem != 'aqua'
+ editor_s = editor_t.yscrollbar(Ttk::Scrollbar.new(f_editor))
+else
+ editor_s = editor_t.yscrollbar(Tk::Scrollbar.new(f_editor))
+end
+editor_s.pack(:side=>:right, :fill=>:y, :padx=>[0,2], :pady=>2)
+editor_t.pack(:fill=>:both, :expand=>true, :padx=>[2,0], :pady=>2)
diff --git a/ext/tk/sample/demos-en/ttkpane.rb b/ext/tk/sample/demos-en/ttkpane.rb
new file mode 100644
index 0000000000..87c4dedeb2
--- /dev/null
+++ b/ext/tk/sample/demos-en/ttkpane.rb
@@ -0,0 +1,213 @@
+# ttkpane.rb --
+#
+# This demonstration script creates a Ttk pane with some content.
+#
+# based on "Id: ttkpane.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkpane_demo) && $ttkpane_demo
+ $ttkpane_demo.destroy
+ $ttkpane_demo = nil
+end
+
+$ttkpane_demo = TkToplevel.new {|w|
+ title("Themed Nested Panes")
+ iconname("ttkpane")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+This demonstration shows off a nested set of themed paned windows. \
+Their sizes can be changed by grabbing the area \
+between each contained pane and dragging the divider.
+EOL
+
+Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkpane'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkpane_demo.destroy
+ $ttkpane_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+outer = Ttk::Panedwindow.new(frame, :orient=>:horizontal)
+outer.add(in_left = Ttk::Panedwindow.new(outer, :orient=>:vertical))
+outer.add(in_right = Ttk::Panedwindow.new(outer, :orient=>:vertical))
+in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'Button'))
+in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>'Clocks'))
+in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'Progress'))
+in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'Text'))
+if Tk.windowingsystem == 'aqua'
+ [left_top, left_bot, right_top, right_bot].each{|w| w.padding(3) }
+end
+
+# Fill the button pane
+Ttk::Button.new(left_top, :text=>'Press Me',
+ :command=>proc{
+ Tk.messageBox(:type=>'ok', :icon=>'info', :message=>'Ouch!',
+ :detail=>'That hurt...', :parent=>base_frame,
+ :title=>'Button Pressed')
+ }).pack(:padx=>2, :pady=>5)
+
+
+zones_list = [
+ [':Europe/Berlin'],
+ [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'],
+ [':Africa/Johannesburg'],
+ [':Europe/London'],
+ [':America/Los_Angeles'],
+ [':Europe/Moscow'],
+ [':America/New_York'],
+ [':Asia/Singapore'],
+ [':Australia/Sydney'],
+ [':Asia/Tokyo'],
+]
+
+zones = []
+
+# Check tzinfo support
+if $tk_major_ver > 8 || ($tk_major_ver == 8 && $tk_minor_ver >= 5)
+ tzinfo = :tcl
+
+ # Force a pre-load of all the timezones needed; otherwise can end up
+ # poor-looking synch problems!
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ Tk.tk_call('clock', 'format', '0', '-timezone', zone)
+ rescue RuntimeError
+ # ignore
+ else
+ zones << [zone, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+else
+ begin
+ require 'tzinfo'
+ tzinfo = :tzinfo
+ rescue Exception
+ begin
+ require 'tzfile'
+ tzinfo = :tzfile
+ rescue Exception
+ tzinfo = nil
+ end
+ end
+
+ case tzinfo
+ when :tzinfo
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ tz = TZInfo::Timezone.get(zone[%r<[^:]+$>])
+ rescue Exception
+ # ignore
+ else
+ zones << [tz, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+ when :tzfile
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ tz = TZFile.create(zone[%r<[^:]+$>])
+ rescue Exception
+ # ignore
+ else
+ zones << [tz, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+ else
+ [ -7, -4, -2, -1, 0, +1, +3, +8, +9, +10 ].each{|zone|
+ zones << [zone, 'UTC%+03d00' % zone]
+ }
+ end
+end
+
+time = TkVariable.new_hash
+
+case tzinfo
+when :tcl
+ update_proc = proc{|now, tz, label|
+ time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
+ '-timezone', tz, '-format', '%T')
+ }
+when :tzinfo
+ update_proc = proc{|now, tz, label|
+ time[label] = tz.utc_to_local(now).strftime('%H:%M:%S')
+ }
+when :tzfile
+ update_proc = proc{|now, tz, label|
+ time[label] = tz.at(now.tv_sec).strftime('%H:%M:%S')
+ }
+else
+ update_proc = proc{|now, tz, label|
+ time[label] = (now + (tz * 3600)).strftime('%H:%M:%S')
+ }
+end
+
+# Fill the clocks pane
+zones.each_with_index{|(zone, label), idx|
+ Ttk::Separator.new(left_bot).pack(:fill=>:x) if idx > 0
+ Ttk::Label.new(left_bot, :text=>label, :anchor=>'w').pack(:fill=>:x)
+ Ttk::Label.new(left_bot, :textvariable=>time.ref(label),
+ :anchor=>'w').pack(:fill=>:x)
+}
+
+# Timer start
+every = proc{
+ now = Time.now.utc
+ zones.each{|zone, label| update_proc.call(now, zone, label) }
+}
+TkRTTimer.new(1000, -1, every).start(0, every)
+
+# Fill the progress pane
+Ttk::Progressbar.new(right_top, :mode=>:indeterminate).pack(:fill=>:both, :expand=>true).start
+
+# Fill the text pane
+if Tk.windowingsystem != 'aqua'
+ # The trick with the ttk::frame makes the text widget look like it fits with
+ # the current Ttk theme despite not being a themed widget itself. It is done
+ # by styling the frame like an entry, turning off the border in the text
+ # widget, and putting the text widget in the frame with enough space to allow
+ # the surrounding border to show through (2 pixels seems to be enough).
+ f = Ttk::Frame.new(right_bot, :style=>Ttk::Entry)
+ txt = TkText.new(frame, :wrap=>:word, :width=>30, :borderwidth=>0)
+ txt.pack(:fill=>:both, :expand=>true, :in=>f, :pady=>2, :padx=>2)
+ scr = txt.yscrollbar(Ttk::Scrollbar.new(frame))
+ scr.pack(:side=>:right, :fill=>:y, :in=>right_bot)
+ f.pack(:fill=>:both, :expand=>true)
+ outer.pack(:fill=>:both, :expand=>true)
+else
+ txt = TkText.new(frame, :wrap=>:word, :width=>30, :borderwidth=>0)
+ scr = txt.yscrollbar(TkScrollbar.new(frame))
+ scr.pack(:side=>:right, :fill=>:y, :in=>right_bot)
+ txt.pack(:fill=>:both, :expand=>true, :in=>right_bot)
+ outer.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>[6, 10])
+end
diff --git a/ext/tk/sample/demos-en/ttkprogress.rb b/ext/tk/sample/demos-en/ttkprogress.rb
new file mode 100644
index 0000000000..c341a9385f
--- /dev/null
+++ b/ext/tk/sample/demos-en/ttkprogress.rb
@@ -0,0 +1,66 @@
+# ttkprogress.rb --
+#
+# This demonstration script creates several progress bar widgets.
+#
+# based on "Id: ttkprogress.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkprogress_demo) && $ttkprogress_demo
+ $ttkprogress_demo.destroy
+ $ttkprogress_demo = nil
+end
+
+$ttkprogress_demo = TkToplevel.new {|w|
+ title("Progress Bar Demonstration")
+ iconname("ttkprogress")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=>Tk::UTF8_String.new(<<EOL)).pack(:side=>:top, :fill=>:x)
+Below are two progress bars. \
+The top one is a \\u201Cdeterminate\\u201D progress bar, \
+which is used for showing how far through a defined task the program has got. \
+The bottom one is an \\u201Cindeterminate\\u201D progress bar, \
+which is used to show that the program is busy \
+but does not know how long for. Both are run here in self-animated mode, \
+which can be turned on and off using the buttons underneath.
+EOL
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkprogress'}),
+ Ttk::Button.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkprogress_demo.destroy
+ $ttkprogress_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+p1 = Ttk::Progressbar.new(frame, :mode=>:determinate)
+p2 = Ttk::Progressbar.new(frame, :mode=>:indeterminate)
+
+start = Ttk::Button.new(frame, :text=>'Start Progress',
+ :command=>proc{ p1.start; p2.start })
+stop = Ttk::Button.new(frame, :text=>'Stop Progress',
+ :command=>proc{ p1.stop; p2.stop })
+
+Tk.grid(p1, '-', :pady=>5, :padx=>10)
+Tk.grid(p2, '-', :pady=>5, :padx=>10)
+Tk.grid(start, stop, :padx=>10, :pady=>5)
+start.grid_configure(:sticky=>'e')
+stop.grid_configure(:sticky=>'w')
+frame.grid_columnconfigure(:all, :weight=>1)
+
diff --git a/ext/tk/sample/demos-en/twind.rb b/ext/tk/sample/demos-en/twind.rb
new file mode 100644
index 0000000000..60a345d0b4
--- /dev/null
+++ b/ext/tk/sample/demos-en/twind.rb
@@ -0,0 +1,291 @@
+# twind.rb
+#
+# This demonstration script creates a text widget with a bunch of
+# embedded windows.
+#
+# text (embedded windows) widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($twind_demo) && $twind_demo
+ $twind_demo.destroy
+ $twind_demo = nil
+end
+
+# demo toplevel widget
+$twind_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Embedded Windows")
+ iconname("Embedded Windows")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($twind_demo).pack(:fill=>:both, :expand=>true)
+
+# frame
+$twind_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc{
+ tmppath = $twind_demo
+ $twind_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc{showCode 'twind'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+$twind_text = nil
+TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+ 'relief'=>'sunken') {|f|
+ $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font,
+ 'width'=>'70', 'height'=>35, 'wrap'=>'word',
+ 'highlightthickness'=>0, 'borderwidth'=>0 ){|t|
+ TkScrollbar.new(f) {|s|
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }.pack('side'=>'right', 'fill'=>'y')
+ }.pack('expand'=>'yes', 'fill'=>'both')
+}.pack('expand'=>'yes', 'fill'=>'both')
+
+#
+$tag_center = TkTextTag.new($twind_text,
+ 'justify' =>'center',
+ 'spacing1'=>'5m',
+ 'spacing3'=>'5m' )
+$tag_buttons = TkTextTag.new($twind_text,
+ 'lmargin1'=>'1c',
+ 'lmargin2'=>'1c',
+ 'rmargin' =>'1c',
+ 'spacing1'=>'3m',
+ 'spacing2'=>0,
+ 'spacing3'=>0 )
+
+$twind_text.insert('end', "A text widget can contain other widgets embedded ")
+$twind_text.insert('end', "it. These are called \"embedded windows\", ")
+$twind_text.insert('end', "and they can consist of arbitrary widgets. ")
+$twind_text.insert('end', "For example, here are two embedded button ")
+$twind_text.insert('end', "widgets. You can click on the first button to ")
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ #text 'ON'
+ text 'Turn On'
+ command proc{textWindOn $twind_text,$twind_buttons}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', " horizontal scrolling, which also turns off ")
+$twind_text.insert('end', "word wrapping. Or, you can click on the second ")
+$twind_text.insert('end', "button to\n")
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ #text 'OFF'
+ text 'Turn Off'
+ command proc{textWindOff $twind_text}
+ cursor 'top_left_arrow'
+ })
+
+$twind_text.insert('end', " horizontal scrolling and turn back on word wrapping.\n\n")
+$twind_text.insert('end', "Or, here is another example. If you ")
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text 'Click Here'
+ command proc{textWindPlot $twind_text}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', " a canvas displaying an x-y plot will appear right here.")
+$mark_plot = TkTextMark.new($twind_text, 'insert')
+$mark_plot.gravity='left'
+$twind_text.insert('end', " You can drag the data points around with the mouse, ")
+$twind_text.insert('end', "or you can click here to ")
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text 'Delete'
+ command proc{textWindDel $twind_text}
+ cursor 'top_left_arrow'
+ })
+
+$twind_text.insert('end', " the plot again.\n\n")
+$twind_text.insert('end', "You may also find it useful to put embedded windows in ")
+$twind_text.insert('end', "a text without any actual text. In this case the ")
+$twind_text.insert('end', "text widget acts like a geometry manager. For ")
+$twind_text.insert('end', "example, here is a collection of buttons laid out ")
+$twind_text.insert('end', "neatly into rows by the text widget. These buttons ")
+$twind_text.insert('end', "can be used to change the background color of the ")
+$twind_text.insert('end', "text widget (\"Default\" restores the color to ")
+$twind_text.insert('end', "its default). If you click on the button labeled ")
+$twind_text.insert('end', "\"Short\", it changes to a longer string so that ")
+$twind_text.insert('end', "you can see how the text widget automatically ")
+$twind_text.insert('end', "changes the layout. Click on the button again ")
+$twind_text.insert('end', "to restore the short string.\n")
+
+
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {|b|
+ text 'Default'
+ command proc{embDefBg $twind_text}
+ cursor 'top_left_arrow'
+ $tag_buttons.add('end')
+ },
+ 'padx'=>3 )
+embToggle = TkVariable.new('Short')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkCheckButton.new($twind_text) {
+ textvariable embToggle
+ indicatoron 0
+ variable embToggle
+ onvalue 'A much longer string'
+ offvalue 'Short'
+ cursor 'top_left_arrow'
+ pady 5
+ padx 2
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+
+[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
+ 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
+ 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
+ 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+].each{|twind_color|
+ TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text twind_color
+ cursor 'top_left_arrow'
+ command proc{$twind_text.bg twind_color}
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+}
+
+#
+def textWindOn (w,f)
+ if defined? $twind_scroll
+ begin
+ $twind_scroll.destroy
+ rescue
+ end
+ $twind_scroll = nil
+ end
+
+ base = TkWinfo.parent( TkWinfo.parent(w) )
+ $twind_scroll = TkScrollbar.new(base) {|s|
+ orient 'horizontal'
+ command proc{|*args| w.xview(*args)}
+ w.xscrollcommand proc{|first,last| s.set first,last}
+ w.wrap 'none'
+ pack('after'=>f, 'side'=>'bottom', 'fill'=>'x')
+ }
+
+ return nil
+end
+
+def textWindOff (w)
+ if defined? $twind_scroll
+ begin
+ $twind_scroll.destroy
+ rescue
+ end
+ $twind_scroll = nil
+ end
+ w.xscrollcommand ''
+ w.wrap 'word'
+end
+
+def textWindPlot (t)
+ if (defined? $twind_plot) && TkWinfo.exist?($twind_plot)
+ return
+ end
+
+ $twind_plot = TkCanvas.new(t) {
+ relief 'sunken'
+ width 450
+ height 300
+ cursor 'top_left_arrow'
+ }
+
+ if $tk_version =~ /^4.*/
+ font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+ else
+ font = 'Helvetica 18'
+ end
+
+ TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2)
+ TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2)
+ TkcText.new($twind_plot, 225, 20,
+ 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown')
+
+ (0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2)
+ TkcText.new($twind_plot, x, 254,
+ 'text'=>10*i, 'font'=>font, 'anchor'=>'n')
+ }
+ (0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2)
+ TkcText.new($twind_plot, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e')
+ }
+
+ for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+ end
+
+ $twind_plot.itembind('point', 'Any-Enter',
+ proc{$twind_plot.itemconfigure 'current', 'fill', 'red'})
+ $twind_plot.itembind('point', 'Any-Leave',
+ proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
+ $twind_plot.itembind('point', '1',
+ proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y")
+ $twind_plot.itembind('point', 'ButtonRelease-1',
+ proc{$twind_plot.dtag 'selected'})
+ $twind_plot.bind('B1-Motion',
+ proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y")
+ while ($twind_text.get($mark_plot) =~ /[ \t\n]/)
+ $twind_text.delete $mark_plot
+ end
+ $twind_text.insert $mark_plot,"\n"
+ TkTextWindow.new($twind_text, $mark_plot, 'window'=>$twind_plot)
+ $tag_center.add $mark_plot
+ $twind_text.insert $mark_plot,"\n"
+end
+
+$embPlot = {'lastX'=>0, 'lastY'=>0}
+
+def embPlotDown (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $embPlot['lastX'] = x
+ $embPlot['lastY'] = y
+end
+
+def embPlotMove (w, x, y)
+ w.move 'selected', x - $embPlot['lastX'], y - $embPlot['lastY']
+ $embPlot['lastX'] = x
+ $embPlot['lastY'] = y
+end
+
+def textWindDel (w)
+ if (defined? $twind_text) && TkWinfo.exist?($twind_plot)
+ $twind_text.delete $twind_plot
+ $twind_plot = nil
+ while ($twind_text.get($mark_plot) =~ /[ \t\n]/)
+ $twind_text.delete $mark_plot
+ end
+ $twind_text.insert $mark_plot," "
+ end
+end
+
+def embDefBg (w)
+ w['background'] = w.configinfo('background')[3]
+end
diff --git a/ext/tk/sample/demos-en/twind2.rb b/ext/tk/sample/demos-en/twind2.rb
new file mode 100644
index 0000000000..af7313dd82
--- /dev/null
+++ b/ext/tk/sample/demos-en/twind2.rb
@@ -0,0 +1,384 @@
+#
+# text (embedded windows) widget demo 2 (called by 'widget')
+#
+
+# delete toplevel widget
+if defined?($twind2_demo) && $twind2_demo
+ $twind2_demo.destroy
+ $twind2_demo = nil
+end
+
+# demo toplevel widget
+$twind2_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Embedded Windows 2")
+ iconname("Embedded Windows")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($twind2_demo).pack(:fill=>:both, :expand=>true)
+
+# frame
+$twind2_buttons = TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'See Code',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'twind2'}),
+ TkButton.new(frame, :text=>'Dismiss',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $twind2_demo
+ $twind2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+}
+$twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+$twind2_text = nil
+TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+ 'relief'=>'sunken') {|f|
+ $twind2_text = TkText.new(f, 'setgrid'=>true, 'font'=>$font,
+ # 'width'=>'70', 'height'=>35, 'wrap'=>'word',
+ 'width'=>'70', 'height'=>35, 'wrap'=>'char',
+ 'highlightthickness'=>0, 'borderwidth'=>0 ){|t|
+ TkScrollbar.new(f) {|s|
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }.pack('side'=>'right', 'fill'=>'y')
+ }.pack('expand'=>'yes', 'fill'=>'both')
+}.pack('expand'=>'yes', 'fill'=>'both')
+
+# text tags
+$tag2_center = TkTextTag.new($twind2_text,
+ 'justify' =>'center',
+ 'spacing1'=>'5m',
+ 'spacing3'=>'5m' )
+$tag2_buttons = TkTextTag.new($twind2_text,
+ 'lmargin1'=>'1c',
+ 'lmargin2'=>'1c',
+ 'rmargin' =>'1c',
+ 'spacing1'=>'3m',
+ 'spacing2'=>0,
+ 'spacing3'=>0 )
+
+# insert text
+$twind2_text.insert('end',
+ 'A text widget can contain many different kinds of items, ')
+$twind2_text.insert('end',
+ "both active and passive. It can lay these out in various ")
+$twind2_text.insert('end',
+ "ways, with wrapping, tabs, centering, etc. In addition, ")
+$twind2_text.insert('end',
+ "when the contents are too big for the window, smooth ")
+$twind2_text.insert('end', "scrolling in all directions is provided.\n\n")
+
+$twind2_text.insert('end', "A text widget can contain other widgets embedded ")
+$twind2_text.insert('end', "it. These are called \"embedded windows\", ")
+$twind2_text.insert('end', "and they can consist of arbitrary widgets. ")
+$twind2_text.insert('end', "For example, here are two embedded button ")
+$twind2_text.insert('end', "widgets. You can click on the first button to ")
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text 'ON'
+ command proc{textWindOn2 $twind2_text,$twind2_buttons}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', " horizontal scrolling, which also turns off ")
+$twind2_text.insert('end', "word wrapping. Or, you can click on the second ")
+$twind2_text.insert('end', "button to\n")
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text 'OFF'
+ command proc{textWindOff2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end',
+ " horizontal scrolling and turn back on word wrapping.\n\n")
+
+$twind2_text.insert('end', "Or, here is another example. If you ")
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text 'Click Here'
+ command proc{textWindPlot2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end',
+ " a canvas displaying an x-y plot will appear right here.")
+$mark2_plot = TkTextMark.new($twind2_text, 'insert')
+$mark2_plot.gravity='left'
+$twind2_text.insert('end',
+ " You can drag the data points around with the mouse, ")
+$twind2_text.insert('end', "or you can click here to ")
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text 'Delete'
+ command proc{textWindDel2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', " the plot again.\n\n")
+
+$twind2_text.insert('end',
+ "You may also find it useful to put embedded windows in ")
+$twind2_text.insert('end',
+ "a text without any actual text. In this case the ")
+$twind2_text.insert('end', "text widget acts like a geometry manager. For ")
+$twind2_text.insert('end',
+ "example, here is a collection of buttons laid out ")
+$twind2_text.insert('end',
+ "neatly into rows by the text widget. These buttons ")
+$twind2_text.insert('end',
+ "can be used to change the background color of the ")
+$twind2_text.insert('end', "text widget (\"Default\" restores the color to ")
+$twind2_text.insert('end',
+ "its default). If you click on the button labeled ")
+$twind2_text.insert('end', "\"Short\", it changes to a longer string so that ")
+$twind2_text.insert('end', "you can see how the text widget automatically ")
+$twind2_text.insert('end', "changes the layout. Click on the button again ")
+$twind2_text.insert('end', "to restore the short string.\n")
+
+btn_default = TkButton.new($twind2_text) {|b|
+ text 'Default'
+ command proc{embDefBg2 $twind2_text}
+ cursor 'top_left_arrow'
+}
+TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3)
+embToggle = TkVariable.new('Short')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkCheckButton.new($twind2_text) {
+ textvariable embToggle
+ indicatoron 0
+ variable embToggle
+ onvalue 'A much longer string'
+ offvalue 'Short'
+ cursor 'top_left_arrow'
+ pady 5
+ padx 2
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+
+[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
+ 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
+ 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
+ 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+].each{|twind_color|
+ TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text twind_color
+ cursor 'top_left_arrow'
+ command proc{$twind2_text.bg twind_color}
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+}
+
+$tag2_buttons.add(btn_default, 'end')
+
+$text_normal2 = {}
+$text_normal2['border'] = $twind2_text.cget('borderwidth')
+$text_normal2['highlight'] = $twind2_text.cget('highlightthickness')
+$text_normal2['pad'] = $twind2_text.cget('padx')
+
+$twind2_text.insert('end', "\nYou can also change the usual border width and ")
+$twind2_text.insert('end', "highlightthickness and padding.\n")
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big borders",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigB2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small borders",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallB2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big highlight",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigH2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small highlight",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallH2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big pad",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigP2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small pad",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallP2 $twind2_text
+ }))
+
+$twind2_text.insert('end',
+ "\n\nFinally, images fit comfortably in text widgets too:")
+
+TkTextImage.new($twind2_text, 'end',
+ 'image'=>TkBitmapImage.new(:file=>[
+ $demo_dir, '..',
+ 'images', 'face.xbm'
+ ].join(File::Separator)))
+
+# methods
+def textWinBigB2(w)
+ w.borderwidth 15
+end
+def textWinSmallB2(w)
+ w.borderwidth $text_normal2['border']
+end
+def textWinBigH2(w)
+ w.highlightthickness 15
+end
+def textWinSmallH2(w)
+ w.highlightthickness $text_normal2['highlight']
+end
+def textWinBigP2(w)
+ w.configure(:padx=>15, :pady=>15)
+end
+def textWinSmallP2(w)
+ w.configure(:padx=>$text_normal2['pad'], :pady=>$text_normal2['pad'])
+end
+
+def textWindOn2 (w,f)
+ if defined? $twind2_scroll
+ begin
+ $twind2_scroll.destroy
+ rescue
+ end
+ $twind2_scroll = nil
+ end
+
+ base = TkWinfo.parent( TkWinfo.parent(w) )
+ $twind2_scroll = TkScrollbar.new(base) {|s|
+ orient 'horizontal'
+ command proc{|*args| w.xview(*args)}
+ w.xscrollcommand proc{|first,last| s.set first,last}
+ w.wrap 'none'
+ pack('after'=>f, 'side'=>'bottom', 'fill'=>'x')
+ }
+
+ return nil
+end
+
+def textWindOff2 (w)
+ if defined? $twind2_scroll
+ begin
+ $twind2_scroll.destroy
+ rescue
+ end
+ $twind2_scroll = nil
+ end
+ w.xscrollcommand ''
+ #w.wrap 'word'
+ w.wrap 'char'
+end
+
+def textWindPlot2 (t)
+ if (defined? $twind2_plot) && (TkWinfo.exist?($twind2_plot))
+ return
+ end
+
+ $twind2_plot = TkCanvas.new(t) {
+ relief 'sunken'
+ width 450
+ height 300
+ cursor 'top_left_arrow'
+ }
+
+ #font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+ font = 'Helvetica 18'
+
+ TkcLine.new($twind2_plot, 100, 250, 400, 250, 'width'=>2)
+ TkcLine.new($twind2_plot, 100, 250, 100, 50, 'width'=>2)
+ TkcText.new($twind2_plot, 225, 20,
+ 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown')
+
+ (0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($twind2_plot, x, 250, x, 245, 'width'=>2)
+ TkcText.new($twind2_plot, x, 254,
+ 'text'=>10*i, 'font'=>font, 'anchor'=>'n')
+ }
+ (0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($twind2_plot, 100, y, 105, y, 'width'=>2)
+ TkcText.new($twind2_plot, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e')
+ }
+
+ for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+ end
+
+ $twind2_plot.itembind('point', 'Any-Enter',
+ proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'})
+ $twind2_plot.itembind('point', 'Any-Leave',
+ proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
+ $twind2_plot.itembind('point', '1',
+ proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y")
+ $twind2_plot.itembind('point', 'ButtonRelease-1',
+ proc{$twind2_plot.dtag 'selected'})
+ $twind2_plot.bind('B1-Motion',
+ proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y")
+ while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/)
+ $twind2_text.delete $mark2_plot
+ end
+ $twind2_text.insert $mark2_plot,"\n"
+ TkTextWindow.new($twind2_text, $mark2_plot, 'window'=>$twind2_plot)
+ $tag2_center.add $mark2_plot
+ $twind2_text.insert $mark2_plot,"\n"
+end
+
+$embPlot2 = {'lastX'=>0, 'lastY'=>0}
+
+def embPlotDown2 (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $embPlot2['lastX'] = x
+ $embPlot2['lastY'] = y
+end
+
+def embPlotMove2 (w, x, y)
+ w.move 'selected', x - $embPlot2['lastX'], y - $embPlot2['lastY']
+ $embPlot2['lastX'] = x
+ $embPlot2['lastY'] = y
+end
+
+def textWindDel2 (w)
+ if (defined? $twind2_text) && TkWinfo.exist?($twind2_plot)
+ $twind2_text.delete $twind2_plot
+ $twind2_plot = nil
+ while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/)
+ $twind2_text.delete $mark2_plot
+ end
+ $twind2_text.insert $mark2_plot," "
+ end
+end
+
+def embDefBg2 (w)
+ w['background'] = w.configinfo('background')[3]
+end
diff --git a/ext/tk/sample/demos-en/unicodeout.rb b/ext/tk/sample/demos-en/unicodeout.rb
new file mode 100644
index 0000000000..ee7b5afa15
--- /dev/null
+++ b/ext/tk/sample/demos-en/unicodeout.rb
@@ -0,0 +1,114 @@
+# unicodeout.rb --
+#
+# This demonstration script shows how you can produce output (in label
+# widgets) using many different alphabets.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($unicodeout_demo) && $unicodeout_demo
+ $unicodeout_demo.destroy
+ $unicodeout_demo = nil
+end
+
+$unicodeout_demo = TkToplevel.new {|w|
+ title("Unicode Label Demonstration")
+ iconname("unicodeout")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5.4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+This is a sample of Tk's support for languages that use non-Western \
+character sets. However, what you will actually see below depends \
+largely on what character sets you have installed, and what you see \
+for characters that are not present varies greatly between platforms as well. \
+Please try to click the 'See Code' button, \
+and click the 'Rerun Demo' button after editing \
+(the source file is not changed) \
+the definition of @@font on the Unicodeout_SampleFrame class.
+The strings are written in Tcl using UNICODE characters \
+using the \\uXXXX escape so as to do so in a portable fashion.
+
+ATTENTION:
+The strings are converted to the encoded string objects \
+(completed to rewrite Tcl's escapes) by Tk::UTF8_String method. \
+And the Tk::UTF8_String objects are passed to the label widgets.
+EOL
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'Dismiss', :width=>15, :command=>proc{
+ $unicodeout_demo.destroy
+ $unicodeout_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'See Code', :width=>15, :command=>proc{
+ showCode 'unicodeout'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+wait_msg = TkLabel.new(base_frame,
+ :text=>"Please wait while loading fonts...",
+ :font=>"Helvetica 12 italic").pack
+
+class Unicodeout_SampleFrame < TkFrame
+ @@font = $font
+ # @@font = 'Helvetica 14'
+ # @@font = 'Courier 12'
+ # @@font = 'clearlyu 16'
+ # @@font = 'fixed 12'
+ # @@font = 'Times 12'
+ # @@font = 'Newspaper 12'
+ # @@font = '{New century schoolbook} 12'
+
+ def initialize(base)
+ super(base)
+ grid_columnconfig(1, :weight=>1)
+ end
+
+ def add_sample(lang, *args)
+ sample_txt = Tk::UTF8_String(args.join(''))
+ l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
+ :anchor=>:nw, :pady=>0)
+ #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt,
+ s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
+ :anchor=>:nw, :width=>30, :pady=>0)
+ Tk.grid(l, s, :sticky=>:ew, :pady=>0)
+ l.grid_config(:padx, '1m')
+ end
+end
+f = Unicodeout_SampleFrame.new(base_frame)
+f.pack(:expand=>true, :fill=>:both, :padx=>'2m', :pady=>'1m')
+
+# Processing when some characters are missing might take a while, so make
+# sure we're displaying something in the meantime...
+
+oldCursor = $unicodeout_demo.cursor
+$unicodeout_demo.cursor('watch')
+Tk.update
+
+f.add_sample('Arabic',
+ '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94',
+ '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D')
+f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57')
+f.add_sample('Simpl. Chinese', '\u6C49\u8BED')
+f.add_sample('Greek',
+ '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ',
+ '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1')
+f.add_sample('Hebrew',
+ '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ',
+ '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9')
+f.add_sample('Japanese',
+ '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ',
+ '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA')
+f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00')
+f.add_sample('Russian',
+ '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ',
+ '\u044F\u0437\u044B\u043A')
+
+wait_msg.destroy
+$unicodeout_demo.cursor(oldCursor)
diff --git a/ext/tk/sample/demos-en/vscale.rb b/ext/tk/sample/demos-en/vscale.rb
new file mode 100644
index 0000000000..b05ed12072
--- /dev/null
+++ b/ext/tk/sample/demos-en/vscale.rb
@@ -0,0 +1,79 @@
+# vscale.rb
+#
+# This demonstration script shows an example with a vertical scale.
+
+require "tkcanvas"
+
+if defined?($vscale_demo) && $vscale_demo
+ $vscale_demo.destroy
+ $vscale_demo = nil
+end
+
+$vscale_demo = TkToplevel.new {|w|
+ title("Vertical Scale Demonstration")
+ iconname("vscale")
+}
+positionWindow($vscale_demo)
+
+base_frame = TkFrame.new($vscale_demo).pack(:fill=>:both, :expand=>true)
+
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '3.5i'
+ justify 'left'
+ text "An arrow and a vertical scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the size of the arrow."
+}
+msg.pack('side'=>'top', 'padx'=>'.5c')
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ text 'Dismiss'
+ command proc {
+ tmppath = $vscale_demo
+ $vscale_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'Show Code'
+ command proc { showCode 'vscale' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+def setHeight(w, height)
+ height = height + 21
+ y2 = height - 30
+ if y2 < 21
+ y2 = 21
+ end
+ w.coords 'poly',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20
+ w.coords 'line',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20
+end
+
+TkFrame.new(base_frame) {|frame|
+ borderwidth 10
+ canvas = TkCanvas.new(frame) {|c|
+ width 50
+ height 50
+ bd 0
+ highlightthickness 0
+ TkcPolygon.new(c, 0, 0, 1, 1, 2, 2) {
+ fill 'SeaGreen3'
+ tags 'poly'
+ }
+ TkcLine.new(c, 0, 0, 1, 1, 2, 2, 0, 0) {
+ fill 'black'
+ tags 'line'
+ }
+ }.pack('side'=>'left', 'anchor'=>'nw', 'fill'=>'y')
+ scale = TkScale.new(frame) {
+ orient 'vertical'
+ length 284
+ from 0
+ to 250
+ command proc{|value| setHeight(canvas, value)}
+ tickinterval 50
+ }.pack('side'=>'left', 'anchor'=>'ne')
+ scale.set 75
+}.pack
diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget
new file mode 100644
index 0000000000..fb49a746b9
--- /dev/null
+++ b/ext/tk/sample/demos-en/widget
@@ -0,0 +1,1087 @@
+#!/usr/bin/env ruby
+
+# widget --
+# This script demonstrates the various widgets provided by Tk,
+# along with many of the features of the Tk toolkit. This file
+# only contains code to generate the main window for the
+# application, which invokes individual demonstrations. The
+# code for the actual demonstrations is contained in separate
+# ".rb" files is this directory, which are sourced by this script
+# as needed.
+
+require 'tk'
+# require 'tkafter'
+
+### $DEBUG=1 ##########
+
+$RubyTk_WidgetDemo = true
+
+#----------------------------------------------------------------
+# The code below create the main window, consisting of a menu bar
+# and a text widget that explains how to use the program, plus lists
+# all of the demos as hypertext items.
+#----------------------------------------------------------------
+
+# widget demo directory
+# $demo_dir = File.dirname($0)
+$demo_dir = File.dirname(__FILE__)
+
+# root
+$root = TkRoot.new{title "Ruby/Tk Widget Demonstration"}
+
+# tk
+$tk_version = Tk::TK_VERSION
+$tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i}
+$tk_patchlevel = Tk::TK_PATCHLEVEL
+
+# tcl_platform
+$tk_platform = TkVarAccess.new('tcl_platform')
+
+#
+case($tk_version)
+when /^4.*/
+ $font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
+else
+ $font = TkFont.new('Helvetica -12')
+end
+
+# images
+$image = {}
+
+if $tk_major_ver >= 8
+$image['refresh'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAQAPMAAMz/zCpnKdb/1z9mPypbKBtLGy9NMPL/9Or+6+P+4j1Y
+ PwQKBP7//xMLFAYBCAEBASH5BAEAAAAALAAAAAAQABAAAwR0EAD3Gn0Vyw0e
+ ++CncU7IIAezMA/nhUqSLJizvSdCEEjy2ZIV46AwDAoDHwPYGSoEiUJAAGJ6
+ EDHBNCFINW5OqABKSFk/B9lUa94IDwIFgewFMwQDQwCZQCztTgM9Sl8SOEMG
+ KSAthiaOjBMPDhQONBiXABEAOw==
+EOD
+end
+
+if $tk_major_ver >= 8
+$image['view'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAQAPMAAMz/zP///8DAwICAgH9/fwAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAwRIcMhJB7h3hM33
+ KFjWdQQYap1QrCaGBmrRrS4nj5b53jOgbwXBKGACoYLDIuAoHCmZyYvR1rT5
+ RMAq8LqcIYGsrjPsW1XOmFUEADs=
+EOD
+end
+
+if $tk_major_ver >= 8
+$image['delete'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAOAKEAAIQAAO/n3v///////yH5BAEKAAIALAAAAAAQAA4AAAIm
+ lI9pAKHbIHNoV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AAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAACH5BAEAAEEALAAAAAAaABMAQAj/AIMIHBhkg0GC
+ CBMGIQEiQgseQT4oeCBBAokgRYYQ0JBixg8hRIiUUEBBYYmTByBwiCBCRYwH
+ CxY8cKFw4AogRXLqLAJkQ80gCBBg3BkxZswTNGh4MGqgQQUMJRHCwMkTSE+D
+ Pn8eCKBhxIMhO3ei2OHDBw6sWSlMMMoWgwwfMDZI8GBjx44NARZwEGGi5MkS
+ PcIWKRGz5YgLbAco+KkQBQoJIRgjdGEVq+SaJajqtNrzMgsPCmoIzqmDgmWE
+ KOBuUKAAwYabYTfs4OHjY0giGyhk4MAWRI4eKyRQqPgggYUXPH4A+XBAgwoK
+ DiIsCFxjA9sFEVQQCRJCAYAFDJxiKhAxvMTonEFimrhhYinTBgWiCvxLNX3M
+ DkkpsKV5OYhjBxCMYAICAigUEAA7
+EOD
+end
+
+#
+if $tk_major_ver >= 8
+ $root.add_menubar([[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]])
+else
+ TkMenubar.new($root,
+ [[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]]).pack('side'=>'top', 'fill'=>'x')
+end
+$root.bind('F1', proc{aboutBox})
+$root.bind('Control-q', proc{exit})
+
+=begin
+TkFrame.new($root){|frame|
+ TkMenubutton.new(frame){|button|
+ m = TkMenu.new(button) {
+ add 'command', 'label'=>'Quit', 'command'=>proc{exit}, 'underline'=>0
+ }
+ menu m
+ text 'File'
+ underline 0
+ }.pack('side'=>'left')
+}.pack('side'=>'top', 'fill'=>'x')
+=end
+
+#
+if $tk_version =~ /^4\.[01]/
+ scr = TkScrollbar.new($root, 'orient'=>'vertical')
+ txt = TkText.new($root) {
+ wrap 'word'
+ width 70
+ height 30
+ font $font
+ setgrid 'yes'
+ yscrollcommand proc{|first,last| scr.set first,last}
+ }
+ scr.command(proc{|*args| txt.yview(*args)})
+ scr.pack('side'=>'right', 'fill'=>'y')
+ txt.pack('expand'=>'yes', 'fill'=>'both')
+else
+ textFrame = TkFrame.new($root)
+ scr = TkScrollbar.new($root, 'orient'=>'vertical',
+ 'highlightthickness'=>0, 'takefocus'=>1) {
+ pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1)
+ }
+ txt = TkText.new($root) {
+ wrap 'word'
+ width 70
+ height 30
+ font $font
+ setgrid 'yes'
+ highlightthickness 0
+ padx 4
+ pady 2
+ takefocus 0
+ bd 1
+ yscrollcommand proc{|first,last| scr.set first,last}
+ }
+ scr.command(proc{|*args| txt.yview(*args)})
+# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1)
+# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both')
+# textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2)
+ textFrame.pack('expand'=>'yes', 'fill'=>'both')
+ # $root.withdraw.deiconify
+ Tk.update_idletasks
+ txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both')
+
+ statusBar = TkFrame.new($root) {|f|
+ if $tk_version =~ /^4.*/
+ statusfont = '-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*'
+ else
+ statusfont = 'Helvetica 10'
+ end
+ $statusBarLabel = \
+ TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
+ 'font'=>statusfont) \
+ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both')
+ TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
+ 'font'=>statusfont) \
+ .pack('side'=>'left', 'padx'=>2)
+ }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
+end
+
+# Create a bunch of tags to use in the text widget, such as those for
+# section titles and demo descriptions. Also define the bindings for
+# tags.
+
+if $tk_version =~ /^4.*/
+ tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*')
+else
+ tag_title = TkTextTag.new(txt, 'font'=>'Helvetica 18 bold')
+end
+
+# We put some "space" characters to the left and right of each demo description
+# so that the descriptions are highlighted only when the mouse cursor
+# is right over them (but not when the cursor is to their left or right)
+
+tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c')
+
+if TkWinfo.depth($root) == 1
+ tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'underline'=>1)
+ $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'underline'=>1)
+ tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white')
+else
+ tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'foreground'=>'blue', 'underline'=>1)
+ $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'foreground'=>'#303080', 'underline'=>1)
+# tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1,
+# 'background'=>'SeaGreen3')
+ tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red')
+end
+
+#tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')})
+tag_demo.bind('ButtonRelease-1',
+ proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y')
+
+lastLine = TkVariable.new("")
+newLine = TkVariable.new("")
+tag_demo.bind('Enter', proc{|x,y|
+ lastLine.value = txt.index("@#{x},#{y} linestart")
+ tag_hot.add(lastLine.value, "#{lastLine.value} lineend")
+ showStatus txt, txt.index("@#{x},#{y}")
+ },
+ '%x %y')
+tag_demo.bind('Leave',
+ proc{
+ tag_hot.remove('1.0','end')
+ txt.configure('cursor','xterm')
+ $statusBarLabel.configure('text'=>"")
+ })
+tag_demo.bind('Motion', proc{|x, y|
+ newLine.value = txt.index("@#{x},#{y} linestart")
+ if newLine.value != lastLine.value
+ tag_hot.remove('1.0','end')
+ lastLine.value = newLine.value
+ if ( txt.tag_names("@#{x},#{y}").find{|t|
+ t.kind_of?(String) && t =~ /^demo-/
+ } )
+ tag_hot.add(lastLine.value,
+ "#{lastLine.value} lineend -1 chars")
+ end
+ end
+ showStatus txt, txt.index("@#{x},#{y}")
+ },
+ '%x %y')
+
+# Create the text for the text widget.
+
+txt.insert('end', "Ruby/Tk Widget Demonstrations\n\n", tag_title)
+txt.insert('end', <<EOT)
+This application provides a front end for several short scripts that \
+demonstrate what you can do with Tk widgets. Each of the numbered \
+lines below describes a demonstration; you can click on it to invoke \
+the demonstration. Once the demonstration window appears, you can \
+click the "See Code" button to see the Ruby/Tk code that created the \
+demonstration. If you wish, you can edit the code and click the \
+"Rerun Demo" button in the code window to reinvoke the demonstration \
+with the modified code. \
+Don't worry about breaking the source code. \
+Your modifications are not reflected on the original file. \
+Please try many kind of changes.
+
+Some demo scripts require the recent version of Tk library \
+(e.g. Tk8.4 or later) \
+If your Tk library linked to Ruby doesn't support the functions \
+required by the demo script, the demo doesn't work. \
+In such a case, please re-compile tcltklib with the later Tk library \
+which supports the required functions.
+
+If your Tk supports Ttk (Tile) extension (included or installed), \
+please try the demo of Ttk extension (sample/tkextlib/tile/demo.rb) too.
+( Probably, Ttk extension \
+#{
+begin
+ require 'tkextlib/tile'
+ "is already installed on your environment"
+rescue
+ "is not installed on your environment yet"
+end
+}\
+. )
+Ttk extension is a standard feature of Tk8.5 or later.
+
+
+EOT
+
+txt.insert('end', "Labels, buttons, checkbuttons, and radiobuttons.\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Labels (text and bitmaps).\n", tag_demo, "demo-label")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Labels and UNICODE text. (if supported)\n", tag_demo, "demo-unicodeout")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Buttons.\n", tag_demo, "demo-button")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Checkbuttons (select any of a group).\n", tag_demo, "demo-check")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. Checkbuttons (if supported).\n", tag_demo, "demo-check2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. Radiobuttons (select one of a group).\n", tag_demo, "demo-radio")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. Radiobuttons (if supported 'compound' option).\n", tag_demo, "demo-radio2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "8. Radiobuttons (if supported).\n", tag_demo, "demo-radio3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "9. A 15-puzzle game made out of buttons.\n", tag_demo, "demo-puzzle")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "10. Iconic buttons that use bitmaps.\n", tag_demo, "demo-icon")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "11. Two labels displaying images.\n", tag_demo, "demo-image1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "12. A simple user interface for viewing images.\n", tag_demo, "demo-image2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "13. A simple user interface for viewing images. (if supported)\n", tag_demo, "demo-image3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "14. Labelled frames (if supported)\n", tag_demo, "demo-labelframe")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "15. The simple Themed Tk widgets (require Tile/Ttk extension)\n", tag_demo, "demo-ttkbut")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Listboxes\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 50 states.\n", tag_demo, "demo-states")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Colors: change the color scheme for the application.\n", "#{tag_demo.id} demo-colors")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. A collection of famous sayings.\n", tag_demo, "demo-sayings")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. A multi-column list of contries. (require Tile/Ttk extension)\n", tag_demo, "demo-mclist")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. A directory browser tree. (require Tile/Ttk extension)\n", tag_demo, "demo-tree")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Entries and Spin-boxes\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Without scrollbars.\n", tag_demo, "demo-entry1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. With scrollbars.\n", tag_demo, "demo-entry2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end',
+ "3. Validated entries and password fields. (if supported)\n",
+ tag_demo, "demo-entry3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Spin-boxes. (if supported)\n", tag_demo, "demo-spin")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. Combo-boxes. (require Tile/Ttk extension)\n", tag_demo, "demo-combo")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. Simple Rolodex-like form.\n", tag_demo, "demo-form")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Text\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Basic editable text.\n", tag_demo, "demo-text")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Text display styles.\n", tag_demo, "demo-style")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Hypertext (tag bindings).\n", tag_demo, "demo-bind")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. A text widget with embedded windows.\n", tag_demo, "demo-twind")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. A text widget with embedded windows. (if supported)\n", tag_demo, "demo-twind2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. A search tool built with a text widget.\n", tag_demo, "demo-search")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. Peering text widgets. (if supported)\n", tag_demo, "demo-textpeer")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Canvases\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. The canvas item types.\n", tag_demo, "demo-items")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. A simple 2-D plot.\n", tag_demo, "demo-plot")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Text items in canvases.\n", tag_demo, "demo-ctext")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. An editor for arrowheads on canvas lines.\n", tag_demo, "demo-arrow")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. A ruler with adjustable tab stops.\n", tag_demo, "demo-ruler")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. A building floor plan.\n", tag_demo, "demo-floor")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. A building floor plan. (another way to create canvas items)\n", tag_demo, "demo-floor2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "8. A simple scrollable canvas.\n", tag_demo, "demo-cscroll")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "9. A Knight's tour of the chess board. (require Tile/Ttk extension)\n", tag_demo, "demo-knightstour")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Scales and Progress Bars\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Vertical scale.\n", tag_demo.id, "demo-vscale")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Horizontal scale.\n", tag_demo.id, "demo-hscale")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Progress bar. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttkprogress")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Paned Windows and Notebooks\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Horizontal paned window. (if supported)\n", tag_demo.id, "demo-paned1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Vertical paned window. (if supported)\n", tag_demo.id, "demo-paned2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Themed nested panes. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttkpane")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Notebook widget. (require Tile/Ttk extension)\n", tag_demo.id, "demo-ttknote")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Menus and Toolbars\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Menus and cascades.\n", tag_demo, "demo-menu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Menus and cascades. (if supported)\n", tag_demo, "demo-menu84")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Menubuttons.\n", tag_demo, "demo-menubu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Themed menu buttons. (require Tile/Ttk extension)\n", tag_demo, "demo-ttkmenu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. Themed toolbar. (require Tile/Ttk extension)\n", tag_demo, "demo-toolbar")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Common Dialogs\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Message boxes.\n", tag_demo, "demo-msgbox")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Message boxes with detail text. (if supported)\n", tag_demo, "demo-msgbox2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. File selection dialog.\n", tag_demo, "demo-filebox")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. Color picker.\n", tag_demo, "demo-clrpick")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "Animation\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. Animated labels (if supported)\n", tag_demo, "demo-anilabel")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. Animated wave (if supported)\n", tag_demo, "demo-aniwave")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. Pendulum simulation (if supported)\n", tag_demo, "demo-pendulum")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. A celebration of Rube Goldberg (if supported)\n", tag_demo, "demo-goldberg")
+
+txt.insert('end', "\n")
+txt.insert('end', "Miscellaneous\n", tag_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. The built-in bitmaps.\n", tag_demo, "demo-bitmap")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. A dialog box with a local grab.\n", tag_demo, "demo-dialog1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. A dialog box with a global grab.\n", tag_demo, "demo-dialog2")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.state('disabled')
+scr.focus
+
+# positionWindow --
+# This procedure is invoked by most of the demos to position a
+# new demo window.
+#
+# Arguments:
+# w - The name of the window to position.
+
+def positionWindow(w)
+ w.geometry('+300+300')
+end
+
+# showVars --
+# Displays the values of one or more variables in a window, and
+# updates the display whenever any of the variables changes.
+#
+# Arguments:
+# w - Name of new window to create for display.
+# args - Any number of names of variables.
+
+$showVarsWin = {}
+def showVars1(parent, *args)
+ if $showVarsWin[parent.path]
+ begin
+ $showVarsWin[parent.path].destroy
+ rescue
+ end
+ end
+ w = TkToplevel.new(parent) {|w|
+ title "Variable values"
+ base = TkFrame.new(w).pack(:fill=>:both, :expand=>true)
+ TkLabel.new(base) {
+ text "Variable values:"
+ width 20
+ anchor 'center'
+ if $tk_version =~ /^4.*/
+ font '-Adobe-helvetica-medium-r-normal--*-180-*-*-*-*-*-*'
+ else
+ font 'Helvetica 14'
+ end
+ }.pack('side'=>'top', 'fill'=>'x')
+ len = 1
+ args.each{|vnam,vbody|
+ len = vnam.to_s.length if vnam.to_s.length > len
+ }
+ args.each{|vnam,vbody|
+ TkFrame.new(w){|f|
+ #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left')
+ TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left')
+ TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\
+ .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
+ }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x')
+ }
+ TkButton.new(base) {
+ text "OK"
+ command proc{w.destroy}
+ }.pack('side'=>'bottom', 'pady'=>2)
+ }
+ $showVarsWin[parent.path] = w
+end
+
+def showVars2(parent, *args)
+ if $showVarsWin[parent.path]
+ begin
+ $showVarsWin[parent.path].destroy
+ rescue
+ end
+ end
+ $showVarsWin[parent.path] = TkToplevel.new(parent) {|top|
+ title "Variable values"
+
+ base = TkFrame.new(top).pack(:fill=>:both, :expand=>true)
+
+ TkLabelFrame.new(base, :text=>"Variable values:",
+ :font=>{:family=>'Helvetica', :size=>14}){|f|
+ args.each{|vnam,vbody|
+ TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
+ TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'),
+ :padx=>2, :pady=>2, :sticky=>'w')
+ }
+
+ f.grid(:sticky=>'news', :padx=>4)
+ f.grid_columnconfig(1, :weight=>1)
+ f.grid_rowconfig(100, :weight=>1)
+ }
+ TkButton.new(base, :text=>"OK", :width=>8, :default=>:active,
+ :command=>proc{top.destroy}){|b|
+ top.bind('Return', proc{b.invoke})
+ top.bind('Escape', proc{b.invoke})
+
+ b.grid(:sticky=>'e', :padx=>4, :pady=>[6, 4])
+ }
+ base.grid_columnconfig(0, :weight=>1)
+ base.grid_rowconfig(0, :weight=>1)
+ }
+end
+
+if $tk_major_ver < 8
+ alias showVars showVars1
+elsif $tk_major_ver == 8 && $tk_minor_ver < 4
+ alias showVars showVars1
+else # ver >= 8.4
+ alias showVars showVars2
+end
+
+# Pseudo-Toplevel support
+module PseudoToplevel_Evaluable
+ def pseudo_toplevel_eval(body = Proc.new)
+ Thread.current[:TOPLEVEL] = self
+ begin
+ body.call
+ ensure
+ Thread.current[:TOPLEVEL] = nil
+ end
+ end
+
+ def pseudo_toplevel_evaluable?
+ @pseudo_toplevel_evaluable
+ end
+ def pseudo_toplevel_evaluable=(mode)
+ @pseudo_toplevel_evaluable = (mode)? true: false
+ end
+
+ def self.extended(mod)
+ mod.__send__(:extend_object, mod)
+ mod.instance_variable_set('@pseudo_toplevel_evaluable', true)
+ end
+end
+
+class Object
+ alias __method_missing__ method_missing
+ private :__method_missing__
+
+ def method_missing(id, *args)
+ begin
+ has_top = (top = Thread.current[:TOPLEVEL]) &&
+ top.respond_to?(:pseudo_toplevel_evaluable?) &&
+ top.pseudo_toplevel_evaluable? &&
+ top.respond_to?(id)
+ rescue Exception => e
+ has_top = false
+ end
+
+ if has_top
+ top.__send__(id, *args)
+ else
+ __method_missing__(id, *args)
+ end
+ end
+end
+
+class Proc
+ def initialize(*args)
+ super
+ @__pseudo_toplevel__ = Thread.current[:TOPLEVEL]
+ end
+
+ alias __call__ call
+ def call(*args, &b)
+ if top = @__pseudo_toplevel__
+ orig_top = Thread.current[:TOPLEVEL]
+ Thread.current[:TOPLEVEL] = top
+ begin
+ __call__(*args, &b)
+ ensure
+ Thread.current[:TOPLEVEL] = orig_top
+ end
+ else
+ __call__(*args, &b)
+ end
+ end
+end
+
+def proc(&b)
+ Proc.new(&b)
+end
+def lambda(&b)
+ Proc.new(&b)
+end
+
+def _null_binding
+ Module.new.instance_eval{extend PseudoToplevel_Evaluable}
+ # binding
+ # Module.new.instance_eval{binding}
+end
+private :_null_binding
+
+def eval_samplecode(code, file=nil)
+ #eval(code)
+ #_null_binding.pseudo_toplevel_eval{ eval(code) }
+ #Thread.new{ _null_binding.pseudo_toplevel_eval{ eval(code) } }
+ Thread.new{
+ _null_binding.pseudo_toplevel_eval{
+ begin
+ if file
+ eval(code, binding, "(eval:#{file})")
+ else
+ eval(code)
+ end
+ rescue Exception=>e
+ #p e
+ TkBgError.show(e.class.inspect + ': ' + e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------")
+ end
+ }
+ }
+ Tk.update rescue nil
+end
+
+# invoke --
+# This procedure is called when the user clicks on a demo description.
+# It is responsible for invoking the demonstration.
+#
+# Arguments:
+# txt - Name of text widget
+# index - The index of the character that the user clicked on.
+def invoke(txt, idx)
+ tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ return unless tag
+
+ cursor = txt.cget('cursor')
+ txt.cursor('watch')
+ Tk.update rescue nil
+ # eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
+ # Tk.update
+ eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
+ txt.cursor(cursor)
+
+ $tag_visited.add("#{idx} linestart +1 chars", "#{idx} lineend +1 chars")
+end
+=begin
+def invoke (txt, idx)
+ tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ return unless tag
+ current_cursor = txt.cget('cursor')
+ txt.cursor('watch')
+ Tk.update
+# eval `cat #{tag[5..-1]}.rb`
+# eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
+ eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
+ Tk.update
+# txt.cursor('xterm')
+ txt.cursor(current_cursor)
+
+ $tag_visited.add("#{idx} linestart +1 chars", "#{idx} lineend +1 chars")
+end
+=end
+# showStatus --
+#
+# Show the name of the demo program in the status bar. This procedure
+# is called when the user moves the cursor over a demo description.
+#
+
+def showStatus (txt, index)
+ tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ cursor = txt.cget('cursor')
+ unless tag
+ $statusBarLabel.configure('text', " ")
+ newcursor = 'xterm'
+ else
+ demoname = tag[5..-1]
+ $statusBarLabel.configure('text',
+ "Run the \"#{demoname}\" sample program")
+ newcursor = 'hand2'
+ end
+ txt.configure('cursor'=>newcursor) if cursor != newcursor
+end
+
+# showCode --
+# This procedure creates a toplevel window that displays the code for
+# a demonstration and allows it to be edited and reinvoked.
+#
+# Arguments:
+# demo - The name of the demonstration's window, which can be
+# used to derive the name of the file containing its code.
+
+def showCode1(demo)
+ file = "#{demo}.rb"
+ $code_window = nil unless defined? $code_window
+ if $code_window == nil || TkWinfo.exist?($code_window) == false
+ $code_window = TkToplevel.new(nil)
+ f = TkFrame.new($code_window)
+
+ TkButton.new(f) {
+ text "Dismiss"
+ command proc{
+ $code_window.destroy
+ $code_window = nil
+ }
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2, 'padx'=>25)
+ TkButton.new(f) {
+ text "Rerun Demo"
+ # command proc{eval($code_text.get('1.0','end'), _null_binding)}
+ command proc{eval_samplecode($code_text.get('1.0','end'), '<viewer>')}
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
+
+ TkLabel.new(f,'text'=>'line:').pack('side'=>'left')
+ linenum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+ TkLabel.new(f,'text'=>' pos:').pack('side'=>'left')
+ posnum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
+ f.pack('side'=>'bottom', 'expand'=>'true', 'fill'=>'x')
+
+ if $tk_version =~ /^4\.[01]/
+ s = TkScrollbar.new($code_window, 'orient'=>'vertical')
+ $code_text = TkText.new($code_window) {
+ height 40
+ setgrid 'yes'
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| $code_text.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ $code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both')
+ else
+ TkFrame.new($code_window) {|f|
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ hs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
+ 'orient'=>'horizontal')
+ vs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
+ 'orient'=>'vertical')
+ $code_text = TkText.new($code_window) {|t|
+ height 40
+ wrap 'word'
+ xscrollcommand proc{|first,last| hs.set first,last}
+ yscrollcommand proc{|first,last| vs.set first,last}
+ setgrid 'yes'
+ highlightthickness 0
+ pady 2
+ padx 3
+ hs.command(proc{|*args| $code_text.xview(*args)})
+ vs.command(proc{|*args| $code_text.yview(*args)})
+ }
+
+ $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+
+# JKC 2001-07-26: segfaults under 1.7.1 (2001-06-19) [i686-linux]
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ }
+ end
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
+ else
+ $code_window.deiconify
+ $code_window.raise
+ end
+
+ $code_window.title("Demo code: #{file}")
+ $code_window.iconname(file)
+# fid = open(file, 'r')
+ fid = open([$demo_dir, file].join(File::Separator), 'r')
+ $code_text.delete('1.0', 'end')
+ #$code_text.insert('1.0', `cat #{file}`)
+ $code_text.insert('1.0', fid.read)
+ #$code_mark = TkTextMark.new($code_text, '1.0')
+ #$code_text.set_insert('1.0')
+ TkTextMarkInsert.new($code_text,'1.0')
+
+ $set_linenum.call($code_text)
+
+ fid.close
+end
+
+def showCode2(demo)
+ file = "#{demo}.rb"
+ $code_window = nil unless defined? $code_window
+ if $code_window == nil || TkWinfo.exist?($code_window) == false
+ $code_window = TkToplevel.new(nil)
+ tf = TkFrame.new($code_window)
+ $code_text = TkText.new(tf, :font=>'Courier 10', :height=>30,
+ :wrap=>'word', :bd=>1, :setgrid=>true,
+ :highlightthickness=>0, :pady=>2, :padx=>3)
+ xscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
+ yscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
+ TkGrid($code_text, yscr, :sticky=>'news')
+ #TkGrid(xscr)
+ tf.grid_rowconfigure(0, :weight=>1)
+ tf.grid_columnconfigure(0, :weight=>1)
+
+ bf = TkFrame.new($code_window)
+
+ lf = TkFrame.new(bf)
+ TkLabel.new(lf, :text=>'line:').pack(:side=>:left)
+ linenum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+ TkLabel.new(lf, :text=>' pos:').pack(:side=>:left)
+ posnum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
+ b_dis = TkButton.new(bf, :text=>'Dismiss', :default=>:active,
+ :command=>proc{
+ $code_window.destroy
+ $code_window = nil
+ },
+ :image=>$image['delete'], :compound=>:left)
+ b_prn = TkButton.new(bf, :text=>'Print Code',
+ :command=>proc{printCode($code_text, file)},
+ :image=>$image['print'], :compound=>:left)
+ b_run = TkButton.new(bf, :text=>'Rerun Demo',
+ :command=>proc{
+ # eval($code_text.get('1.0','end'), _null_binding)
+ eval_samplecode($code_text.get('1.0','end'), '<viewer>')
+ },
+ :image=>$image['refresh'], :compound=>:left)
+
+ TkGrid(lf, 'x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
+ bf.grid_columnconfigure(1, :weight=>1)
+
+ TkGrid(tf, :sticky=>'news')
+ TkGrid(bf, :sticky=>'ew')
+ $code_window.grid_columnconfigure(0, :weight=>1)
+ $code_window.grid_rowconfigure(0, :weight=>1)
+
+ $code_window.bind('Return', proc{|win|
+ b_dis.invoke unless win.kind_of?(TkText)
+ }, '%W')
+ $code_window.bindinfo('Return').each{|cmd, arg|
+ $code_window.bind_append('Escape', cmd, arg)
+ }
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+ btag.bind('Configure', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
+ else
+ $code_window.deiconify
+ $code_window.raise
+ end
+
+ $code_window.title("Demo code: #{file}")
+ $code_window.iconname(file)
+ fid = open([$demo_dir, file].join(File::Separator), 'r')
+ $code_text.delete('1.0', 'end')
+ $code_text.insert('1.0', fid.read)
+ TkTextMarkInsert.new($code_text,'1.0')
+
+ $set_linenum.call($code_text)
+
+ fid.close
+end
+
+if $tk_major_ver < 8
+ alias showCode showCode1
+elsif $tk_major_ver == 8 && $tk_minor_ver < 4
+ alias showCode showCode1
+else # ver >= 8.4
+ alias showCode showCode2
+end
+
+
+# printCode --
+# Prints the source code currently displayed in the See Code dialog.
+# Much thanks to Arjen Markus for this.
+#
+# Arguments:
+# txt - Name of text widget containing code to print
+# file - Name of the original file (implicitly for title)
+
+def printCode(txt, file)
+ code = txt.get('1.0', 'end - 1c')
+ dir = '.'
+ dir = ENV['HOME'] if ENV['HOME']
+ dir = ENV['TMP'] if ENV['TMP']
+ dir = ENV['TEMP'] if ENV['TEMP']
+
+ fname = [dir, 'tkdemo-' + file].join(File::Separator)
+ open(fname, 'w'){|fid| fid.print(code)}
+ begin
+ case Tk::TCL_PLATFORM('platform')
+ when 'unix'
+ msg = `lp -c #{fname}`
+ unless $?.exitstatus == 0
+ Tk.messageBox(:title=>'Print spooling failure',
+ :message=>'Print spooling probably failed: ' + msg)
+ end
+ when 'windows'
+ begin
+ printTextWin32(fname)
+ rescue => e
+ Tk.messageBox(:title=>'Print spooling failure',
+ :message=>'Print spooling probably failed: ' +
+ e.message)
+ end
+ when 'macintosh'
+ Tk.messageBox(:title=>'Operation not Implemented',
+ :message=>'Oops, sorry: not implemented yet!')
+ else
+ Tk.messageBox(:title=>'Operation not Implemented',
+ :message=>'Wow! Unknown platform: ' +
+ Tk::TCL_PLATFORM('platform'))
+ end
+ ensure
+ File.delete(fname)
+ end
+end
+
+# printTextWin32 --
+# Print a file under Windows
+#
+# Arguments:
+# filename - Name of the file
+#
+def printTextWin32(fname)
+ require 'win32/registry'
+ begin
+ app = Win32::Registry::HKEY_CLASSES_ROOT['.txt']
+ pcmd = nil
+ Win32::Registry::HKEY_CLASSES_ROOT.open("#{app}\\shell\\print"){|reg|
+ pcmd = reg['command']
+ }
+ rescue
+ app = Tk.tk_call('auto_execok', 'notepad.exe')
+ pcmd = "#{app} /p %1"
+ end
+
+ pcmd.gsub!('%1', fname)
+ puts pcmd
+ cmd = Tk.tk_call('auto_execok', 'start') + ' /min ' + pcmd
+
+ msg = `#{cmd}`
+ unless $?.exitstatus == 0
+ fail RuntimeError, msg
+ end
+end
+
+# aboutBox
+#
+# Pops up a message box with an "about" message
+#
+def aboutBox
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
+ 'message'=>"Ruby/Tk widget demonstration Ver.1.7.1-en\n\n" +
+ "based on demos of Tk8.1 -- 8.5 " +
+ "( Copyright of Tcl/Tk demos:: " +
+ "(c) 1996-1997 Sun Microsystems, Inc. / " +
+ "(c) 1997-2000 Ajuba Solutions, Inc. / " +
+ "(c) 2001-2007 Donal K. Fellows / " +
+ "(c) 2002-2007 Daniel A. Steffen )\n\n" +
+ "Your Ruby & Tk Version ::\n" +
+ "Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}\n\n" +
+ "Ruby/Tk release date :: tcltklib #{TclTkLib::RELEASE_DATE}; tk #{Tk::RELEASE_DATE}")
+end
+
+#########################################
+# start demos if given at command line
+no_launcher = false
+if ARGV[0] == '-n'
+ ARGV.shift
+ no_launcher = true if ARGV.size > 0
+else
+ # show the root widget to make it lower then demo windows
+ Tk.update rescue nil
+end
+ARGV.each{|cmd|
+ if cmd =~ /(.*).rb/
+ cmd = $1
+ end
+ #eval(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join,
+ # _null_binding)
+ eval_samplecode(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join, cmd + '.rb')
+}
+if no_launcher
+ $root.withdraw # hide root window
+ Thread.start{
+ loop do
+ count = 0
+ $root.winfo_children.each{|w|
+ count += 1 if w.kind_of?(TkToplevel)
+ }
+ $root.destroy if count == 0
+ end
+ }
+end
+
+#########################################
+# start eventloop
+Tk.mainloop
+
diff --git a/ext/tk/sample/demos-jp/README b/ext/tk/sample/demos-jp/README
new file mode 100644
index 0000000000..4278124659
--- /dev/null
+++ b/ext/tk/sample/demos-jp/README
@@ -0,0 +1,54 @@
+
+ Ruby/Tk widget-demo
+ version 1.2 ( 2000/04/08 )
+ 永井@知能.九工大 (nagai@ai.kyutech.ac.jp)
+
+標準配布の Tcl/Tk 拡張パッケージを取り込んだ Ruby (以下 Ruby/Tk と呼びます)
+では,Tk widget を用いた GUI の作成を行うことができます.実際に GUI を作成
+していく場合には様々な実例がサンプルとして存在すると便利なのですが,Ruby/Tk
+にはそのような適当なサンプルスクリプト集合は存在しませんでした.それに対し,
+拡張パッケージの元である Tcl/Tk には,Tk widget を用いてどのようなことがで
+きるかを示すものとして widget-demo が存在しおり,Tcl/Tk を用いた GUI の作成
+を習得する際の代表的サンプルとなっています.本アーカイブは,Ruby/Tk の習得の
+ための代表的なサンプルスクリプトとすべく,Tcl/Tk の widget-demo を移植したも
+のです.
+
+今回のバージョンは ruby-1.4.x に対応としておきますが,旧バージョンに比べて,
+ほとんど変更はありません.ruby-1.1c2 以上なら動くと思います.ruby-1.5.x につ
+いてはテストしていません.そのため,非互換の影響が出ることがあるかもしれませ
+んが,その場合でも少しの修正で動かせると思います.組み込む Tk のバージョンは,
+4.2 でも 8.0 でも修正なく動かせるはずです.ただし,日本語版での移植となって
+いるため,日本語化された Tk をご利用ください.スクリプトのテストは,旧バージョ
+ンの際に Tk4.2jp と Tk8.0jp の上で行っています (完璧にではないですが).今回
+のバージョンでは ruby-1.4.x + Tk8.0jp 上での簡単なテストしか行っていませんが,
+修正というほどの修正はしていませんので問題はないと考えています.
+
+本アーカイブに含まれるスクリプトの多くは,元となっている Tcl/Tk 版に比較的近
+いスクリプト記述となるようにしています.そのため,Ruby/Tk のサンプルと言うに
+は,あまり Ruby らしくないとも言えるでしょう.にもかかわらず,そのような記述
+を取っている理由は,Ruby/Tk のドキュメント不足にあります.
+
+Tcl/Tk には適当な参考書が何冊か存在していますから,Ruby/Tk スクリプトを作成
+する際は,そのような Tcl/Tk の参考書で情報を補いながら作成することになると思
+います.各 widget の使用例として,Tcl/Tk の widget-demo を参照することもある
+でしょう.Ruby/Tk 版の記述を widget-demo を Tcl/Tk 版の記述に近いものにして
+おけば,その対比によって,Ruby/Tk の理解を早めることができると考えられます.
+一旦 Ruby/Tk での 各 widget の使用方法を習得してしまえば,Ruby らしいスクリ
+プトを作成することは難しくないでしょう.本アーカイブのスクリプトは,Ruby/Tk
+を最初に習得するまでの踏台として利用していただければ幸いです.
+
+widget-demo の移植にあたっては,次の方にも移植したスクリプトを提供していただ
+きました.ここに感謝の意を表します.
+
+ 立石@JAIST (ttate@jaist.ac.jp) さん
+ 平松祥史 (hiramatu@cdrom.co.jp) さん
+
+平松さんによる Ruby/Tk 入門の Web page (http://www.cdrom.co.jp/~hiramatu/)
+も Ruby/Tk の習得に有用と思えますので,ぜひご参照ください.
+
+また,前橋 (maebashi@iij.ad.jp) さんをはじめとして,widget-demo の移植に際し
+て必要となった Ruby の Tk 関連ライブラリ修正について,問題点,バグの指摘をし
+ていただいた方々にも感謝致します.
+
+そして最後に最大の感謝を Ruby 設計者の まつもと ゆきひろ (matz@netlab.co.jp)
+さんに捧げたいと思います.
diff --git a/ext/tk/sample/demos-jp/README.1st b/ext/tk/sample/demos-jp/README.1st
new file mode 100644
index 0000000000..68caf8b14d
--- /dev/null
+++ b/ext/tk/sample/demos-jp/README.1st
@@ -0,0 +1,20 @@
+このディレクトリには Ruby/Tk のデモスクリプトが収められています.
+
+'.rb' という拡張子を持っているファイルは,ランチャ─スクリプトで
+ある 'widget' から呼び出されるサブスクリプトです.それぞれ独立に
+は動きません.'widget' スクリプトから呼び出してください.
+
+もしランチャ─スクリプト 'widget' の起動と同時にいくつかのサブス
+クリプトを起動したければ,そのサブスクリプトの名前を引数として与
+えてください.
+( 例: /usr/local/bin/ruby widget button.rb entry1.rb text.rb )
+サブスクリプトの拡張子 '.rb' は省略することもできます.
+( 例: /usr/local/bin/ruby widget button entry1 text )
+
+もしランチャ─スクリプトのウィンドウが必要ない場合には,'-n' オ
+プションを与えてください.
+( 例: /usr/local/bin/ruby widget -n button.rb entry1.rb text.rb )
+
+他のファイル (browse1 や hello など) は単独で動かすことが可能です.
+
+ 2004/04/14 Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tk/sample/demos-jp/anilabel.rb b/ext/tk/sample/demos-jp/anilabel.rb
new file mode 100644
index 0000000000..c882f43f7e
--- /dev/null
+++ b/ext/tk/sample/demos-jp/anilabel.rb
@@ -0,0 +1,177 @@
+# -*- coding: utf-8 -*-
+#
+# animated label widget demo (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+# toplevel widget が存在すれば削除する
+if defined?($anilabel_demo) && $anilabel_demo
+ $anilabel_demo.destroy
+ $anilabel_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$anilabel_demo = TkToplevel.new {|w|
+ title("Animated Label Demonstration")
+ iconname("anilabel")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($anilabel_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には4つのアニメーションラベルが表示されています。左側にあるラベルは、内部のテキストメッセージをスクロールしたように見せることで動きを付けています。右側のラベルは、表示するイメージを変化させることで動きを与えています。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $anilabel_demo
+ $anilabel_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'anilabel'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# label demo 用フレーム生成
+f_left = TkLabelFrame.new(base_frame, :text=>'Scrolling Texts')
+f_right = TkLabelFrame.new(base_frame, :text=>'GIF Image')
+Tk.pack(f_left, f_right, 'side'=>'left', 'expand'=>'yes', 'fill'=>'both',
+ 'padx'=>10, 'pady'=>10)
+
+# animated label
+class AnimatedTextLabel < TkLabel
+ def initialize(*args)
+ super(*args)
+ @timer = TkTimer.new{ _animation_callback }
+ @timer.loop_exec = -1
+ # bind('Destroy'){ @timer.stop }
+ @btag = TkBindTag.new('Destroy'){ @timer.stop }
+ self.bindtags_unshift(@btag)
+ end
+
+ def _animation_callback()
+ txt = self.text
+ self.text = (txt[1..-1] << txt[0])
+ end
+ private :_animation_callback
+
+ def start(interval)
+ @timer.set_interval(interval)
+ @timer.start
+ end
+
+ def stop
+ @timer.stop
+ end
+end
+
+# animated image
+class AnimatedImageLabel < AnimatedTextLabel
+ def initialize(*args)
+ super(*args)
+ @destroy_image = false
+ @btag.bind_append('Destroy'){
+ if @destroy_image
+ begin
+ self.image.delete
+ rescue
+ end
+ end
+ }
+ end
+ attr_accessor :destroy_image
+
+ def _animation_callback()
+ img = self.image
+
+ fmt = img.format
+ if fmt.kind_of?(Array)
+ if fmt[1].kind_of?(Hash)
+ # fmt == ['GIF', {'index'=>idx}]
+ idx = fmt[1]['index']
+ else
+ # fmt == ['GIF', '-index', idx] :: Ruby1.8.2 returns this.
+ idx = fmt[2]
+ end
+ elsif fmt.kind_of?(String) && fmt =~ /GIF -index (\d+)/
+ idx = $1.to_i
+ else
+ idx = -1
+ end
+
+ begin
+ img.format("GIF -index #{idx + 1}")
+ rescue => e
+ img.format("GIF -index 0")
+ end
+ end
+ private :_animation_callback
+end
+
+# label 生成
+l1 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:ridge,
+ :font=>{:family=>'Courier', :size=>10})
+l2 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:groove,
+ :font=>{:family=>'Courier', :size=>10})
+l3 = AnimatedTextLabel.new(f_left, :borderwidth=>4, :relief=>:flat,
+ :font=>{:family=>'Courier', :size=>10}, :width=>18)
+Tk.pack(l1, l2, l3,
+ :side=>:top, :expand=>true, :anchor=>:w, :padx=>10, :pady=>10)
+
+limg = AnimatedImageLabel.new(f_right, :borderwidth=>0)
+limg.pack(:side=>:top, :expand=>true, :padx=>10, :pady=>10)
+
+# base64-encoded animated GIF file
+tclPowerdData = <<EOD
+ R0lGODlhKgBAAPQAAP//////zP//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hOGQA2TmIJZZhKKmmll2BqyWSXWUrZpQtpatlmk1c2
+ KaWRHeTZEJF8SqLDn/hhsOeQgBbqAh6DGqronxeARUIIACH5BAUeAAAALAUA
+ LgAFAAUAAAUM4CeKz/OV5YmqaRkCACH5BAUeAAEALAUALgAKAAUAAAUUICCK
+ z/OdJVCaa7p+7aOWcDvTZwgAIfkEBR4AAQAsCwAuAAkABQAABRPgA4zP95zA
+ eZqoWqqpyqLkZ38hACH5BAUKAAEALAcALgANAA4AAAU7ICA+jwiUJEqeKau+
+ r+vGaTmac63v/GP9HM7GQyx+jsgkkoRUHJ3Qx0cK/VQVTKtWwbVKn9suNunc
+ WkMAIfkEBQoAAAAsBwA3AAcABQAABRGgIHzk842j+Yjlt5KuO8JmCAAh+QQF
+ CgAAACwLADcABwAFAAAFEeAnfN9TjqP5oOWziq05lmUIACH5BAUKAAAALA8A
+ NwAHAAUAAAUPoPCJTymS3yiQj4qOcPmEACH5BAUKAAAALBMANwAHAAUAAAUR
+ oCB+z/MJX2o+I2miKimiawgAIfkEBQoAAAAsFwA3AAcABQAABRGgIHzfY47j
+ Q4qk+aHl+pZmCAAh+QQFCgAAACwbADcABwAFAAAFEaAgfs/zCV9qPiNJouo7
+ ll8IACH5BAUKAAAALB8ANwADAAUAAAUIoCB8o0iWZggAOw==
+EOD
+
+l1.text('* Slow Animation *').start(300)
+l2.text('* Fast Animation *').start(80)
+l3.text('This is a longer scrolling text in a widget that will not show the whole message at once. ').start(150)
+
+limg.destroy_image = true
+limg.image(TkPhotoImage.new(:format=>'GIF', :data=>tclPowerdData)).start(100)
diff --git a/ext/tk/sample/demos-jp/aniwave.rb b/ext/tk/sample/demos-jp/aniwave.rb
new file mode 100644
index 0000000000..866316c331
--- /dev/null
+++ b/ext/tk/sample/demos-jp/aniwave.rb
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+#
+# animated wave demo (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+# destroy toplevel widget for this demo script
+if defined?($aniwave_demo) && $aniwave_demo
+ $aniwave_demo.destroy
+ $aniwave_demo = nil
+end
+
+# create toplevel widget
+$aniwave_demo = TkToplevel.new {|w|
+ title("Animated Wave Demonstration")
+ iconname("aniwave")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($aniwave_demo).pack(:fill=>:both, :expand=>true)
+
+# create label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text 'このデモでは、ラインアイテムが一つだけ描かれたキャンバスウィジェットが表示されています。アニメーション処理は、そのラインアイテムの座標値を変更することで実現しています。'
+}
+msg.pack('side'=>'top')
+
+# create frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $aniwave_demo
+ $aniwave_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'aniwave'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# animated wave
+class AnimatedWaveDemo
+ def initialize(frame, dir=:left)
+ @direction = dir
+
+ # create canvas widget
+ @c = TkCanvas.new(frame, :width=>300, :height=>200,
+ :background=>'black')
+ @c.pack(:padx=>10, :pady=>10, :expand=>true)
+
+ # Creates a coordinates list of a wave.
+ @waveCoords = []
+ @backupCoords = []
+ n = 0
+ (-10..300).step(5){|n| @waveCoords << [n, 100]; @backupCoords << [n, 100] }
+ n = 305
+ @waveCoords << [n, 0]; @backupCoords << [n, 0]
+ @waveCoords << [n+5, 200]; @backupCoords << [n+5, 200]
+ @coordsLen = @waveCoords.length
+
+ # Create a smoothed line and arrange for its coordinates to be the
+ # contents of the variable waveCoords.
+ @line = TkcLine.new(@c, @waveCoords,
+ :width=>1, :fill=>'green', :smooth=>true)
+
+ # Main animation "loop".
+ # Theoretically 100 frames-per-second (==10ms between frames)
+ @timer = TkTimer.new(10){ basicMotion; reverser }
+
+ # Arrange for the animation loop to stop when the canvas is deleted
+ @c.bindtags_unshift(TkBindTag.new('Destroy'){ @timer.stop })
+ end
+
+ # Basic motion handler. Given what direction the wave is travelling
+ # in, it advances the y coordinates in the coordinate-list one step in
+ # that direction.
+ def basicMotion
+ @backupCoords, @waveCoords = @waveCoords, @backupCoords
+ (0...@coordsLen).each{|idx|
+ if @direction == :left
+ @waveCoords[idx][1] = @backupCoords[(idx+1 == @coordsLen)? 0: idx+1][1]
+ else
+ @waveCoords[idx][1] = @backupCoords[(idx == 0)? -1: idx-1][1]
+ end
+ }
+ @line.coords(@waveCoords)
+ end
+
+ # Oscillation handler. This detects whether to reverse the direction
+ # of the wave by checking to see if the peak of the wave has moved off
+ # the screen (whose size we know already.)
+ def reverser
+ if @waveCoords[0][1] < 10
+ @direction = :right
+ elsif @waveCoords[-1][1] < 10
+ @direction = :left
+ end
+ end
+
+ # animation control
+ def move
+ @timer.start
+ end
+
+ def stop
+ @timer.stop
+ end
+end
+
+# Start the animation processing
+AnimatedWaveDemo.new(base_frame, :left).move
diff --git a/ext/tk/sample/demos-jp/arrow.rb b/ext/tk/sample/demos-jp/arrow.rb
new file mode 100644
index 0000000000..2995f96d54
--- /dev/null
+++ b/ext/tk/sample/demos-jp/arrow.rb
@@ -0,0 +1,247 @@
+# -*- coding: utf-8 -*-
+#
+# arrowhead widget demo (called by 'widget')
+#
+
+# arrowSetup --
+# This method regenerates all the text and graphics in the canvas
+# window. It's called when the canvas is initially created, and also
+# whenever any of the parameters of the arrow head are changed
+# interactively.
+#
+# Arguments:
+# c - Name of the canvas widget.
+
+def arrowSetup(c)
+ v = $demo_arrowInfo
+
+ # Remember the current box, if there is one.
+ tags = c.gettags('current')
+ if tags != []
+ cur = tags.find{|t| t.kind_of?(String) && t =~ /^box[1-3]$/ }
+ else
+ cur = nil
+ end
+
+ # Create the arrow and outline.
+ c.delete('all')
+ TkcLine.new(c, v.x1, v.y, v.x2, v.y,
+ { 'width'=>10 * v.width,
+ 'arrowshape'=>[10*v.a, 10*v.b, 10*v.c],
+ 'arrow'=>'last'
+ }.update(v.bigLineStyle) )
+ xtip = v.x2 - 10*v.b
+ deltaY = 10*v.c + 5*v.width
+ TkcLine.new(c, v.x2, v.y, xtip, v.y + deltaY,
+ v.x2 - 10*v.a, v.y, xtip, v.y - deltaY, v.x2, v.y,
+ 'width'=>2, 'capstyle'=>'round', 'joinstyle'=>'round')
+
+ # Create the boxes for reshaping the line and arrowhead.
+ TkcRectangle.new(c, v.x2-10*v.a-5, v.y-5, v.x2-10*v.a+5, v.y+5,
+ {'tags'=>['box1', $arrowTag_box]}.update(v.boxStyle) )
+ TkcRectangle.new(c, xtip-5, v.y-deltaY-5, xtip+5, v.y-deltaY+5,
+ {'tags'=>['box2', $arrowTag_box]}.update(v.boxStyle) )
+ TkcRectangle.new(c, v.x1-5, v.y-5*v.width-5, v.x1+5, v.y-5*v.width+5,
+ {'tags'=>['box3', $arrowTag_box]}.update(v.boxStyle) )
+ c.itemconfigure cur, v.activeStyle if cur
+
+ # Create three arrows in actual size with the same parameters
+ TkcLine.new(c, v.x2+50, 0, v.x2+50, 1000, 'width'=>2)
+ tmp = v.x2+100
+ TkcLine.new(c, tmp, v.y-125, tmp, v.y-75, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+ TkcLine.new(c, tmp-25, v.y, tmp+25, v.y, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+ TkcLine.new(c, tmp-25, v.y+75, tmp+25, v.y+125, 'width'=>v.width,
+ 'arrow'=>'both', 'arrowshape'=>[v.a, v.b, v.c])
+
+ # Create a bunch of other arrows and text items showing the
+ # current dimensions.
+ tmp = v.x2+10
+ TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y-deltaY,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2+15, v.y-deltaY+5*v.c, 'text'=>v.c, 'anchor'=>'w')
+ tmp = v.x1-10
+ TkcLine.new(c, tmp, v.y-5*v.width, tmp, v.y+5*v.width,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x1-15, v.y, 'text'=>v.width, 'anchor'=>'e')
+ tmp = v.y+5*v.width+10*v.c+10
+ TkcLine.new(c, v.x2-10*v.a, tmp, v.x2, tmp,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2-5*v.a, tmp+5, 'text'=>v.a, 'anchor'=>'n')
+ tmp = tmp+25
+ TkcLine.new(c, v.x2-10*v.b, tmp, v.x2, tmp,
+ 'arrow'=>'both', 'arrowshape'=>v.smallTips)
+ TkcText.new(c, v.x2-5*v.b, tmp+5, 'text'=>v.b, 'anchor'=>'n')
+
+ if $tk_version =~ /^4.*/
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
+ 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
+ TkcText.new(c, v.x1, 330,
+ 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",'anchor'=>'w',
+ 'font'=>'-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*')
+ else
+ TkcText.new(c, v.x1, 310, 'text'=>"'width'=>#{v.width}", 'anchor'=>'w',
+ 'font'=>'Helvetica 18')
+ TkcText.new(c, v.x1, 330,
+ 'text'=>"'arrowshape'=>[#{v.a}, #{v.b}, #{v.c}]",
+ 'anchor'=>'w', 'font'=>'Helvetica 18')
+ end
+
+ v.count += 1
+end
+
+# toplevel widget が存在すれば削除する
+if defined?($arrow_demo) && $arrow_demo
+ $arrow_demo.destroy
+ $arrow_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$arrow_demo = TkToplevel.new {|w|
+ title("Arrowhead Editor Demonstration")
+ iconname("arrow")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($arrow_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"この widget で、キャンバスで使われるラインについて様々な幅や矢印の頭の形を試してみることができます。線の幅や矢印の形を変えるには、拡大された矢印についている 3つの四角をドラッグしてください。右側の矢印は普通の大きさでのサンプルを示しています。下のテキストはラインアイテムに対する設定オプションです。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$arrow_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $arrow_demo
+ $arrow_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'arrow'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$arrow_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas 設定
+$arrow_canvas = TkCanvas.new(base_frame, 'width'=>500, 'height'=>350,
+ 'relief'=>'sunken', 'borderwidth'=>2)
+$arrow_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+# 値設定
+unless Struct.const_defined?("ArrowInfo")
+ $demo_arrowInfo = Struct.new("ArrowInfo", :a, :b, :c, :width, :motionProc,
+ :x1, :x2, :y, :smallTips, :count,
+ :bigLineStyle, :boxStyle, :activeStyle).new
+end
+$demo_arrowInfo.a = 8
+$demo_arrowInfo.b = 10
+$demo_arrowInfo.c = 3
+$demo_arrowInfo.width = 2
+$demo_arrowInfo.motionProc = proc{}
+$demo_arrowInfo.x1 = 40
+$demo_arrowInfo.x2 = 350
+$demo_arrowInfo.y = 150
+$demo_arrowInfo.smallTips = [5, 5, 2]
+$demo_arrowInfo.count = 0
+if TkWinfo.depth($arrow_canvas) > 1
+ $demo_arrowInfo.bigLineStyle = {'fill'=>'SkyBlue1'}
+ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
+ $demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
+else
+ $demo_arrowInfo.bigLineStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)}
+ $demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
+ $demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1}
+end
+$arrowTag_box = TkcTag.new($arrow_canvas)
+arrowSetup $arrow_canvas
+$arrowTag_box.bind('Enter', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.activeStyle)})
+$arrowTag_box.bind('Leave', proc{$arrow_canvas.itemconfigure('current', $demo_arrowInfo.boxStyle)})
+$arrowTag_box.bind('B1-Enter', proc{})
+$arrowTag_box.bind('B1-Leave', proc{})
+$arrow_canvas.itembind('box1', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove1 $arrow_canvas, x, y}})
+$arrow_canvas.itembind('box2', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove2 $arrow_canvas, x, y}})
+$arrow_canvas.itembind('box3', '1',
+ proc{$demo_arrowInfo.motionProc \
+ = proc{|x,y| arrowMove3 $arrow_canvas, x, y}})
+$arrowTag_box.bind('B1-Motion',
+ proc{|x,y| $demo_arrowInfo.motionProc.call(x,y)}, "%x %y")
+$arrow_canvas.bind('Any-ButtonRelease-1', proc{arrowSetup $arrow_canvas})
+
+# arrowMove1 --
+# This method is called for each mouse motion event on box1 (the
+# one at the vertex of the arrow). It updates the controlling parameters
+# for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove1(c,x,y)
+ v = $demo_arrowInfo
+ newA = (v.x2+5-c.canvasx(x).round)/10
+ newA = 0 if newA < 0
+ newA = 25 if newA > 25
+ if newA != v.a
+ c.move('box1', 10*(v.a-newA), 0)
+ v.a = newA
+ end
+end
+
+# arrowMove2 --
+# This method is called for each mouse motion event on box2 (the
+# one at the trailing tip of the arrowhead). It updates the controlling
+# parameters for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove2(c,x,y)
+ v = $demo_arrowInfo
+ newB = (v.x2+5-c.canvasx(x).round)/10
+ newB = 0 if newB < 0
+ newB = 25 if newB > 25
+ newC = (v.y+5-c.canvasy(y).round-5*v.width)/10
+ newC = 0 if newC < 0
+ newC = 20 if newC > 20
+ if newB != v.b || newC != v.c
+ c.move('box2', 10*(v.b-newB), 10*(v.c-newC))
+ v.b = newB
+ v.c = newC
+ end
+end
+
+# arrowMove3 --
+# This method is called for each mouse motion event on box3 (the
+# one that controls the thickness of the line). It updates the
+# controlling parameters for the line and arrowhead.
+#
+# Arguments:
+# c - The name of the canvas window.
+# x, y - The coordinates of the mouse.
+
+def arrowMove3(c,x,y)
+ v = $demo_arrowInfo
+ newWidth = (v.y+2-c.canvasy(y).round)/5
+ newWidth = 0 if newWidth < 0
+ newWidth = 20 if newWidth > 20
+ if newWidth != v.width
+ c.move('box3', 0, 5*(v.width-newWidth))
+ v.width = newWidth
+ end
+end
+
diff --git a/ext/tk/sample/demos-jp/bind.rb b/ext/tk/sample/demos-jp/bind.rb
new file mode 100644
index 0000000000..efba6e6c01
--- /dev/null
+++ b/ext/tk/sample/demos-jp/bind.rb
@@ -0,0 +1,125 @@
+# -*- coding: utf-8 -*-
+#
+# text (tag bindings) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($bind_demo) && $bind_demo
+ $bind_demo.destroy
+ $bind_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$bind_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Tag Bindings")
+ iconname("bind")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($bind_demo).pack(:fill=>:both, :expand=>true)
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $bind_demo
+ $bind_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'bind'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# bind 用メソッド
+def tag_binding_for_bind_demo(tag, enter_style, leave_style)
+ tag.bind('Any-Enter', proc{tag.configure enter_style})
+ tag.bind('Any-Leave', proc{tag.configure leave_style})
+end
+
+# text 生成
+txt = TkText.new(base_frame){|t|
+ # 生成
+ setgrid 'true'
+ #width 60
+ #height 24
+ font $font
+ wrap 'word'
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ # スタイル設定
+ if TkWinfo.depth($root).to_i > 1
+ tagstyle_bold = {'background'=>'#43ce80', 'relief'=>'raised',
+ 'borderwidth'=>1}
+ tagstyle_normal = {'background'=>'', 'relief'=>'flat'}
+ else
+ tagstyle_bold = {'foreground'=>'white', 'background'=>'black'}
+ tagstyle_normal = {'foreground'=>'', 'background'=>''}
+ end
+
+ # テキスト挿入
+ insert 'insert', "テキストwidgetの表示スタイルを制御するのと同じタグのメカニズムを使って、テキストにTclのコマンドを割り当てることができます。これにより、マウスやキーボードのアクションで特定のTclのコマンドが実行されるようになります。例えば、下のキャンバスのデモプログラムについての説明文にはそのようなタグがついています。マウスを説明文の上に持っていくと説明文が光り、ボタン1を押すとその説明のデモが始まります。
+
+"
+ insert('end', '1. キャンバス widget に作ることのできるアイテムの種類全てに関するサンプル。', (d1 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '2. 簡単な 2次元のプロット。データを表す点を動かすことができる。', (d2 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '3. テキストアイテムのアンカーと行揃え。',
+ (d3 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '4. ラインアイテムのための矢印の頭の形のエディタ。',
+ (d4 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end', '5. タブストップを変更するための機能つきのルーラー。',
+ (d5 = TkTextTag.new(t)) )
+ insert('end', "\n\n")
+ insert('end',
+ '6. キャンバスがどうやってスクロールするのかを示すグリッド。',
+ (d6 = TkTextTag.new(t)) )
+
+ # binding
+ [d1, d2, d3, d4, d5, d6].each{|tag|
+ tag_binding_for_bind_demo(tag, tagstyle_bold, tagstyle_normal)
+ }
+ d1.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'items.rb'].join(File::Separator)}`, 'items.rb')
+ })
+ d2.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'plot.rb'].join(File::Separator)}`, 'plot.rb')
+ })
+ d3.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'ctext.rb'].join(File::Separator)}`, 'ctext.rb')
+ })
+ d4.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'arrow.rb'].join(File::Separator)}`, 'arrow.rb')
+ })
+ d5.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'ruler.rb'].join(File::Separator)}`, 'ruler.rb')
+ })
+ d6.bind('1',
+ proc{
+ eval_samplecode(`cat #{[$demo_dir,'cscroll.rb'].join(File::Separator)}`, 'cscroll.rb')
+ })
+
+ TkTextMarkInsert.new(t, '0.0')
+ configure('state','disabled')
+}
+
+txt.width 60
+txt.height 24
diff --git a/ext/tk/sample/demos-jp/bitmap.rb b/ext/tk/sample/demos-jp/bitmap.rb
new file mode 100644
index 0000000000..d84e9a5f09
--- /dev/null
+++ b/ext/tk/sample/demos-jp/bitmap.rb
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+#
+# bitmap widget demo (called by 'widget')
+#
+
+# bitmapRow --
+# Create a row of bitmap items in a window.
+#
+# Arguments:
+# w - The parent window that is to contain the row.
+# args - The names of one or more bitmaps, which will be displayed
+# in a new row across the bottom of w along with their
+# names.
+
+def bitmapRow(w,*args)
+ TkFrame.new(w){|row|
+ pack('side'=>'top', 'fill'=>'both')
+ for bitmap in args
+ TkFrame.new(row){|base|
+ pack('side'=>'left', 'fill'=>'both', 'pady'=>'.25c', 'padx'=>'.25c')
+ TkLabel.new(base, 'text'=>bitmap, 'width'=>9).pack('side'=>'bottom')
+ Tk::Label.new(base, 'bitmap'=>bitmap).pack('side'=>'bottom')
+ }
+ end
+ }
+end
+
+# toplevel widget が存在すれば削除する
+if defined?($bitmap_demo) && $bitmap_demo
+ $bitmap_demo.destroy
+ $bitmap_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$bitmap_demo = TkToplevel.new {|w|
+ title("Bitmap Demonstration")
+ iconname("bitmap")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($bitmap_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"このウィンドウには、Tk に組み込まれたすべてのビットマップが、それらの名前と共に表示されています。Tcl のスクリプト中では、それぞれの名前を用いて参照します。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$bitmap_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $bitmap_demo
+ $bitmap_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'bitmap'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$bitmap_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 設定
+TkFrame.new(base_frame){|f|
+ bitmapRow(f,'error','gray25','gray50','hourglass')
+ bitmapRow(f,'info','question','questhead','warning')
+ pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
+}
+
diff --git a/ext/tk/sample/demos-jp/browse1 b/ext/tk/sample/demos-jp/browse1
new file mode 100644
index 0000000000..568892e4a8
--- /dev/null
+++ b/ext/tk/sample/demos-jp/browse1
@@ -0,0 +1,63 @@
+#!/usr/bin/env ruby
+
+# browse --
+# This script generates a directory browser, which lists the working
+# directory and allow you to open files or subdirectories by
+# double-clicking.
+
+require 'tk'
+
+# Create a scrollbar on the right side of the main window and a listbox
+# on the left side.
+
+listbox = TkListbox.new(nil, 'relief'=>'sunken',
+ 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l|
+ TkScrollbar.new(nil, 'command'=>proc{|*args| l.yview *args}) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ l.yscrollcommand(proc{|first,last| s.set(first,last)})
+ }
+
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+}
+
+root = TkRoot.new
+root.minsize(1,1)
+
+# The procedure below is invoked to open a browser on a given file; if the
+# file is a directory then another instance of this program is invoked; if
+# the file is a regular file then the Mx editor is invoked to display
+# the file.
+
+def browse (dir, file)
+ file = dir + File::Separator + file if dir != '.'
+ type = File.ftype(file)
+ if type == 'directory'
+ system($0 + ' ' + file + ' &')
+ else
+ if type == 'file'
+ if ENV['EDITOR']
+ system(ENV['EDITOR'] + ' ' + file + ' &')
+ else
+ system('xedit ' + file + ' &')
+ end
+ else
+ STDOUT.print "\"#{file}\" isn't a directory or regular file"
+ end
+ end
+end
+
+# Fill the listbox with a list of all the files in the directory (run
+# the "ls" command to get that information).
+
+dir = ARGV[0] ? ARGV[0] : '.'
+open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname|
+ listbox.insert('end', fname.chomp)
+}
+
+# Set up bindings for the browser.
+
+Tk.bind_all('Control-c', proc{root.destroy})
+listbox.bind('Double-Button-1',
+ proc{TkSelection.get.each{|f| browse dir, f}})
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/browse2 b/ext/tk/sample/demos-jp/browse2
new file mode 100644
index 0000000000..1a511c8d29
--- /dev/null
+++ b/ext/tk/sample/demos-jp/browse2
@@ -0,0 +1,82 @@
+#!/usr/bin/env ruby
+
+# browse --
+# This script generates a directory browser, which lists the working
+# directory and allow you to open files or subdirectories by
+# double-clicking.
+
+require 'tk'
+
+class Browse
+ BROWSE_WIN_COUNTER = TkVariable.new(0)
+
+ def initialize(dir)
+ BROWSE_WIN_COUNTER.value = BROWSE_WIN_COUNTER.to_i + 1
+
+ # create base frame
+ base = TkToplevel.new {
+ minsize(1,1)
+ title('Browse : ' + dir)
+ }
+
+ # Create a scrollbar on the right side of the main window and a listbox
+ # on the left side.
+ list = TkListbox.new(base, 'relief'=>'sunken',
+ 'width'=>20, 'height'=>20, 'setgrid'=>'yes') {|l|
+ TkScrollbar.new(base, 'command'=>proc{|*args| l.yview *args}) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ l.yscrollcommand(proc{|first,last| s.set(first,last)})
+ }
+
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+
+ # Fill the listbox with a list of all the files in the directory (run
+ # the "ls" command to get that information).
+ open("|ls -a #{dir}", 'r'){|fid| fid.readlines}.each{|fname|
+ l.insert('end', fname.chomp)
+ }
+
+ }
+
+ # Set up bindings for the browser.
+ base.bind('Destroy', proc{
+ Browse::BROWSE_WIN_COUNTER.value = \
+ Browse::BROWSE_WIN_COUNTER.to_i - 1
+ })
+ base.bind('Control-c', proc{base.destroy})
+ list.bind('Double-Button-1',
+ proc{TkSelection.get.each{|f| self.browse dir, f}})
+ end
+
+ # The method below is invoked to open a browser on a given file; if the
+ # file is a directory then another instance of this program is invoked; if
+ # the file is a regular file then the Mx editor is invoked to display
+ # the file.
+ def browse (dir, file)
+ file = dir + File::Separator + file if dir != '.'
+ type = File.ftype(file)
+ if type == 'directory'
+ Browse.new(file)
+ else
+ if type == 'file'
+ if ENV['EDITOR']
+ system(ENV['EDITOR'] + ' ' + file + ' &')
+ else
+ system('xedit ' + file + ' &')
+ end
+ else
+ STDOUT.print "\"#{file}\" isn't a directory or regular file"
+ end
+ end
+ end
+
+end
+
+Browse.new(ARGV[0] ? ARGV[0] : '.')
+
+TkRoot.new {
+ withdraw
+ Browse::BROWSE_WIN_COUNTER.trace('w', proc{exit if Browse::BROWSE_WIN_COUNTER.to_i == 0})
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/button.rb b/ext/tk/sample/demos-jp/button.rb
new file mode 100644
index 0000000000..301100b057
--- /dev/null
+++ b/ext/tk/sample/demos-jp/button.rb
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+#
+# button widget demo (called by 'widget')
+#
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($button_demo) && $button_demo
+ $button_demo.destroy
+ $button_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$button_demo = TkToplevel.new {|w|
+ title("Button Demonstration")
+ iconname("button")
+ positionWindow(w)
+}
+
+# label 生成
+msg = TkLabel.new($button_demo) {
+ font $kanji_font
+ wraplength '4i'
+ justify 'left'
+ text "ボタンをクリックすると、ボタンの背景色がそのボタンに書かれている色になります。ボタンからボタンへの移動はタブを押すことでも可能です。またスペースで実行することができます。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+$button_buttons = Tk::Frame.new($button_demo) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $button_demo
+ $button_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'button'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# button 生成
+TkButton.new($button_demo){
+ text "Peach Puff"
+ width 10
+ command proc{
+ $button_demo.configure('bg','PeachPuff1')
+ $button_buttons.configure('bg','PeachPuff1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Light Blue"
+ width 10
+ command proc{
+ $button_demo.configure('bg','LightBlue1')
+ $button_buttons.configure('bg','LightBlue1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Sea Green"
+ width 10
+ command proc{
+ $button_demo.configure('bg','SeaGreen2')
+ $button_buttons.configure('bg','SeaGreen2')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
+
+TkButton.new($button_demo){
+ text "Yellow"
+ width 10
+ command proc{
+ $button_demo.configure('bg','Yellow1')
+ $button_buttons.configure('bg','Yellow1')
+ }
+}.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2)
diff --git a/ext/tk/sample/demos-jp/check.rb b/ext/tk/sample/demos-jp/check.rb
new file mode 100644
index 0000000000..422e898ec9
--- /dev/null
+++ b/ext/tk/sample/demos-jp/check.rb
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+#
+# checkbutton widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($check_demo) && $check_demo
+ $check_demo.destroy
+ $check_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$check_demo = TkToplevel.new {|w|
+ title("Checkbutton Demonstration")
+ iconname("check")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($check_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には 3 つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl 変数 ( TkVariable オブジェクトでアクセスできます ) にそのボタンの状態を示す値を設定します。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
+}
+msg.pack('side'=>'top')
+
+# 変数生成
+wipers = TkVariable.new(0)
+brakes = TkVariable.new(0)
+sober = TkVariable.new(0)
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $check_demo
+ $check_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'check'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+
+ TkButton.new(frame) {
+ text '変数参照'
+ command proc{
+ showVars(base_frame,
+ ['wipers', wipers], ['brakes', brakes], ['sober', sober])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+# checkbutton 生成
+[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober)
+].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')}
+
diff --git a/ext/tk/sample/demos-jp/check2.rb b/ext/tk/sample/demos-jp/check2.rb
new file mode 100644
index 0000000000..558e588535
--- /dev/null
+++ b/ext/tk/sample/demos-jp/check2.rb
@@ -0,0 +1,110 @@
+# -*- coding: utf-8 -*-
+#
+# checkbutton widget demo2 (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($check2_demo) && $check2_demo
+ $check2_demo.destroy
+ $check2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$check2_demo = TkToplevel.new {|w|
+ title("Checkbutton Demonstration 2")
+ iconname("check2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($check2_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には4つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl変数(TkVariableオブジェクトでアクセスできます)にそのボタンの状態を示す値を設定します。最初のボタンの状態は他の3つのボタンの状態にも依存して変化します。もし3つのボタンの一部だけにチェックが付けられている場合、最初のボタンはトライステート(3状態)モードでの表示を行います。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
+}
+msg.pack('side'=>'top')
+
+# 変数生成
+safety = TkVariable.new(0)
+wipers = TkVariable.new(0)
+brakes = TkVariable.new(0)
+sober = TkVariable.new(0)
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'変数参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars($check2_demo,
+ ['safety', safety], ['wipers', wipers],
+ ['brakes', brakes], ['sober', sober])
+ }),
+ TkButton.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'check2'}),
+ TkButton.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $check2_demo
+ $check2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+}.pack('side'=>'bottom', 'fill'=>'x')
+
+
+# checkbutton 生成
+TkCheckButton.new(base_frame, :text=>'安全性検査', :variable=>safety,
+ :relief=>:flat, :onvalue=>'all', :offvalue=>'none',
+ :tristatevalue=>'partial'){
+ pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
+[ TkCheckButton.new(base_frame, 'text'=>'ワイパー OK', 'variable'=>wipers),
+ TkCheckButton.new(base_frame, 'text'=>'ブレーキ OK', 'variable'=>brakes),
+ TkCheckButton.new(base_frame, 'text'=>'運転手 素面', 'variable'=>sober)
+].each{|w|
+ w.relief('flat')
+ w.pack('side'=>'top', 'padx'=>15, 'pady'=>2, 'anchor'=>'w')
+}
+
+# tristate check
+in_check = false
+tristate_check = proc{|n1,n2,op|
+ unless in_check
+ in_check = true
+ begin
+ if n1 == safety
+ if safety == 'none'
+ wipers.value = 0
+ brakes.value = 0
+ sober.value = 0
+ elsif safety == 'all'
+ wipers.value = 1
+ brakes.value = 1
+ sober.value = 1
+ end
+ else
+ if wipers == 1 && brakes == 1 && sober == 1
+ safety.value = 'all'
+ elsif wipers == 1 || brakes == 1 || sober == 1
+ safety.value = 'partial'
+ else
+ safety.value = 'none'
+ end
+ end
+ ensure
+ in_check = false
+ end
+ end
+}
+
+[wipers, brakes, sober, safety].each{|v| v.trace('w', tristate_check)}
diff --git a/ext/tk/sample/demos-jp/clrpick.rb b/ext/tk/sample/demos-jp/clrpick.rb
new file mode 100644
index 0000000000..df8c76a69d
--- /dev/null
+++ b/ext/tk/sample/demos-jp/clrpick.rb
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+#
+# widget demo prompts the user to select a color (called by 'widget')
+#
+# Note: don't support ttk_wrapper. work with standard widgets only.
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($clrpick_demo) && $clrpick_demo
+ $clrpick_demo.destroy
+ $clrpick_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$clrpick_demo = TkToplevel.new {|w|
+ title("Color Selection Dialogs")
+ iconname("colors")
+ positionWindow(w)
+}
+
+# label 生成
+#TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+Tk::Label.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"以下のボタンを押して、このウィンドウ上にあるウィジェットの前景色と背景色を選択して下さい。").pack('side'=>'top')
+
+# frame 生成
+# TkFrame.new($clrpick_demo) {|frame|
+Tk::Frame.new($clrpick_demo) {|frame|
+ # TkButton.new(frame) {
+ Tk::Button.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $clrpick_demo
+ $clrpick_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ # TkButton.new(frame) {
+ Tk::Button.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'clrpick'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# button 生成
+# TkButton.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'背景色を設定 ...') {|b|
+ command(proc{setColor $clrpick_demo, b, 'background',
+ ['background', 'highlightbackground']})
+ pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
+}
+
+# TkButton.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b|
+Tk::Button.new($clrpick_demo, 'text'=>'前景色を設定 ...') {|b|
+ command(proc{setColor $clrpick_demo, b, 'foreground', ['foreground']})
+ pack('side'=>'top', 'anchor'=>'c', 'pady'=>'2m')
+}
+
+def setColor(w,button,name,options)
+ w.grab
+ initialColor = button[name]
+ color = Tk.chooseColor('title'=>"Choose a #{name} color", 'parent'=>w,
+ 'initialcolor'=>initialColor)
+ if color != ""
+ setColor_helper(w,options,color)
+ end
+
+ w.grab('release')
+end
+
+def setColor_helper(w, options, color)
+ options.each{|opt|
+ begin
+ w[opt] = color
+ rescue
+ end
+ }
+ TkWinfo.children(w).each{|child|
+ setColor_helper child, options, color
+ }
+end
+
diff --git a/ext/tk/sample/demos-jp/colors.rb b/ext/tk/sample/demos-jp/colors.rb
new file mode 100644
index 0000000000..5e5f47cb04
--- /dev/null
+++ b/ext/tk/sample/demos-jp/colors.rb
@@ -0,0 +1,155 @@
+# -*- coding: utf-8 -*-
+#
+# listbox widget demo 'colors' (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($colors_demo) && $colors_demo
+ $colors_demo.destroy
+ $colors_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$colors_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (colors)")
+ iconname("colors")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($colors_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には色の名前が入ったスクロールバー付のリストボックスが表示されています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。ある色をボタン1(左ボタン)でダブルクリックするとアプリケーション全体がその色になります。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $colors_demo
+ $colors_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'colors'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+colors_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ s = TkScrollbar.new(w)
+ colors_lbox = TkListbox.new(w) {
+ setgrid 1
+ width 10
+ height 12
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| colors_lbox.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ colors_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+#colors_lbox.bind('Double-1', proc{TkPalette.setPalette TkSelection.get})
+colors_lbox.bind('Double-1', proc{
+ begin
+ TkPalette.setPalette TkSelection.get
+ rescue => e
+ p e
+ Tk.tk_call_without_enc('destroy', '.___tk_set_palette')
+ end
+ })
+
+ins_data = [
+ 'gray60','gray70','gray80','gray85','gray90','gray95',
+ 'snow1','snow2','snow3','snow4','seashell1','seashell2',
+ 'seashell3','seashell4','AntiqueWhite1','AntiqueWhite2',
+ 'AntiqueWhite3','AntiqueWhite4','bisque1','bisque2',
+ 'bisque3','bisque4','PeachPuff1','PeachPuff2',
+ 'PeachPuff3','PeachPuff4','NavajoWhite1','NavajoWhite2',
+ 'NavajoWhite3','NavajoWhite4','LemonChiffon1',
+ 'LemonChiffon2','LemonChiffon3','LemonChiffon4',
+ 'cornsilk1','cornsilk2','cornsilk3','cornsilk4',
+ 'ivory1','ivory2','ivory3','ivory4','honeydew1',
+ 'honeydew2','honeydew3','honeydew4','LavenderBlush1',
+ 'LavenderBlush2','LavenderBlush3','LavenderBlush4',
+ 'MistyRose1','MistyRose2','MistyRose3','MistyRose4',
+ 'azure1','azure2','azure3','azure4','SlateBlue1',
+ 'SlateBlue2','SlateBlue3','SlateBlue4','RoyalBlue1',
+ 'RoyalBlue2','RoyalBlue3','RoyalBlue4','blue1','blue2',
+ 'blue3','blue4','DodgerBlue1','DodgerBlue2',
+ 'DodgerBlue3','DodgerBlue4','SteelBlue1','SteelBlue2',
+ 'SteelBlue3','SteelBlue4','DeepSkyBlue1','DeepSkyBlue2',
+ 'DeepSkyBlue3','DeepSkyBlue4','SkyBlue1','SkyBlue2',
+ 'SkyBlue3','SkyBlue4','LightSkyBlue1','LightSkyBlue2',
+ 'LightSkyBlue3','LightSkyBlue4','SlateGray1',
+ 'SlateGray2','SlateGray3','SlateGray4',
+ 'LightSteelBlue1','LightSteelBlue2','LightSteelBlue3',
+ 'LightSteelBlue4','LightBlue1','LightBlue2',
+ 'LightBlue3','LightBlue4','LightCyan1','LightCyan2',
+ 'LightCyan3','LightCyan4','PaleTurquoise1',
+ 'PaleTurquoise2','PaleTurquoise3','PaleTurquoise4',
+ 'CadetBlue1','CadetBlue2','CadetBlue3','CadetBlue4',
+ 'turquoise1','turquoise2','turquoise3','turquoise4',
+ 'cyan1','cyan2','cyan3','cyan4','DarkSlateGray1',
+ 'DarkSlateGray2','DarkSlateGray3','DarkSlateGray4',
+ 'aquamarine1','aquamarine2','aquamarine3','aquamarine4',
+ 'DarkSeaGreen1','DarkSeaGreen2','DarkSeaGreen3',
+ 'DarkSeaGreen4','SeaGreen1','SeaGreen2','SeaGreen3',
+ 'SeaGreen4','PaleGreen1','PaleGreen2','PaleGreen3',
+ 'PaleGreen4','SpringGreen1','SpringGreen2',
+ 'SpringGreen3','SpringGreen4','green1','green2',
+ 'green3','green4','chartreuse1','chartreuse2',
+ 'chartreuse3','chartreuse4','OliveDrab1','OliveDrab2',
+ 'OliveDrab3','OliveDrab4','DarkOliveGreen1',
+ 'DarkOliveGreen2','DarkOliveGreen3','DarkOliveGreen4',
+ 'khaki1','khaki2','khaki3','khaki4','LightGoldenrod1',
+ 'LightGoldenrod2','LightGoldenrod3','LightGoldenrod4',
+ 'LightYellow1','LightYellow2','LightYellow3',
+ 'LightYellow4','yellow1','yellow2','yellow3','yellow4',
+ 'gold1','gold2','gold3','gold4','goldenrod1',
+ 'goldenrod2','goldenrod3','goldenrod4','DarkGoldenrod1',
+ 'DarkGoldenrod2','DarkGoldenrod3','DarkGoldenrod4',
+ 'RosyBrown1','RosyBrown2','RosyBrown3','RosyBrown4',
+ 'IndianRed1','IndianRed2','IndianRed3','IndianRed4',
+ 'sienna1','sienna2','sienna3','sienna4','burlywood1',
+ 'burlywood2','burlywood3','burlywood4','wheat1',
+ 'wheat2','wheat3','wheat4','tan1','tan2','tan3','tan4',
+ 'chocolate1','chocolate2','chocolate3','chocolate4',
+ 'firebrick1','firebrick2','firebrick3','firebrick4',
+ 'brown1','brown2','brown3','brown4','salmon1','salmon2',
+ 'salmon3','salmon4','LightSalmon1','LightSalmon2',
+ 'LightSalmon3','LightSalmon4','orange1','orange2',
+ 'orange3','orange4','DarkOrange1','DarkOrange2',
+ 'DarkOrange3','DarkOrange4','coral1','coral2','coral3',
+ 'coral4','tomato1','tomato2','tomato3','tomato4',
+ 'OrangeRed1','OrangeRed2','OrangeRed3','OrangeRed4',
+ 'red1','red2','red3','red4','DeepPink1','DeepPink2',
+ 'DeepPink3','DeepPink4','HotPink1','HotPink2',
+ 'HotPink3','HotPink4','pink1','pink2','pink3','pink4',
+ 'LightPink1','LightPink2','LightPink3','LightPink4',
+ 'PaleVioletRed1','PaleVioletRed2','PaleVioletRed3',
+ 'PaleVioletRed4','maroon1','maroon2','maroon3',
+ 'maroon4','VioletRed1','VioletRed2','VioletRed3',
+ 'VioletRed4','magenta1','magenta2','magenta3',
+ 'magenta4','orchid1','orchid2','orchid3','orchid4',
+ 'plum1','plum2','plum3','plum4','MediumOrchid1',
+ 'MediumOrchid2','MediumOrchid3','MediumOrchid4',
+ 'DarkOrchid1','DarkOrchid2','DarkOrchid3',
+ 'DarkOrchid4','purple1','purple2','purple3','purple4',
+ 'MediumPurple1','MediumPurple2','MediumPurple3',
+ 'MediumPurple4','thistle1','thistle2','thistle3', 'thistle4'
+]
+
+colors_lbox.insert(0, *ins_data)
diff --git a/ext/tk/sample/demos-jp/combo.rb b/ext/tk/sample/demos-jp/combo.rb
new file mode 100644
index 0000000000..8bbe36997d
--- /dev/null
+++ b/ext/tk/sample/demos-jp/combo.rb
@@ -0,0 +1,98 @@
+# -*- coding: utf-8 -*-
+#
+# combo.rb --
+#
+# This demonstration script creates several combobox widgets.
+#
+# based on "Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($combo_demo) && $combo_demo
+ $combo_demo.destroy
+ $combo_demo = nil
+end
+
+$combo_demo = TkToplevel.new {|w|
+ title("Combobox Demonstration")
+ iconname("combo")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($combo_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+以下では3種類のコンボボックスが表示されています.\
+最初のものは,エントリウィジェットと同じ様に,\
+ポイントしたり,クリックしたり,タイプしたりすることができます.\
+また,Returnキーを入力すれば現在の値がリストに追加され,\
+ドロップダウンリストから選択することができるようになります.\
+↓(下向き矢印)キーを押して表示されたリストから\
+矢印キーで他の候補を選んでReturnキーを押せば,値を選択できます.\
+2番目のコンボボックスは特定の値に固定されており,一切変更できません.\
+3番目のものはオーストラリアの都市のドロップダウンリストから\
+選択することだけが可能となっています.
+EOL
+
+## variables
+firstValue = TkVariable.new
+secondValue = TkVariable.new
+ozCity = TkVariable.new
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'変数参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame,
+ ['firstVariable', firstValue],
+ ['secondVariable', secondValue],
+ ['ozCity', ozCity])
+ }),
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'combo'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $combo_demo.destroy
+ $combo_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+australianCities = [
+ 'キャンベラ', 'シドニー', 'メルボルン', 'パース', 'アデレード',
+ 'ブリスベーン', 'ホバート', 'ダーウィン', 'アリス スプリングス'
+]
+
+
+secondValue.value = '変更不可'
+ozCity.value = 'シドニー'
+
+Tk.pack(Ttk::Labelframe.new(frame, :text=>'Fully Editable'){|f|
+ Ttk::Combobox.new(f, :textvariable=>firstValue){|b|
+ b.bind('Return', '%W'){|w|
+ w.values <<= w.value unless w.values.include?(w.value)
+ }
+ }.pack(:pady=>5, :padx=>10)
+ },
+
+ Ttk::LabelFrame.new(frame, :text=>'Disabled'){|f|
+ Ttk::Combobox.new(f, :textvariable=>secondValue, :state=>:disabled) .
+ pack(:pady=>5, :padx=>10)
+ },
+
+ Ttk::LabelFrame.new(frame, :text=>'Defined List Only'){|f|
+ Ttk::Combobox.new(f, :textvariable=>ozCity, :state=>:readonly,
+ :values=>australianCities) .
+ pack(:pady=>5, :padx=>10)
+ },
+
+ :side=>:top, :pady=>5, :padx=>10)
diff --git a/ext/tk/sample/demos-jp/cscroll.rb b/ext/tk/sample/demos-jp/cscroll.rb
new file mode 100644
index 0000000000..e993326aa9
--- /dev/null
+++ b/ext/tk/sample/demos-jp/cscroll.rb
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+#
+# simple scrollable canvas widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($cscroll_demo) && $cscroll_demo
+ $cscroll_demo.destroy
+ $cscroll_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$cscroll_demo = TkToplevel.new {|w|
+ title("Scrollable Canvas Demonstration")
+ iconname("cscroll")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($cscroll_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i',
+ 'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$cscroll_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $cscroll_demo
+ $cscroll_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'cscroll'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$cscroll_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 設定
+unless $tk_version =~ /^4\.[01]/
+ $cscroll_grid = TkFrame.new(base_frame) {
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+ }
+ TkGrid.rowconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
+end
+
+# canvas 設定
+$cscroll_canvas = TkCanvas.new(base_frame,
+ 'relief'=>'sunken', 'borderwidth'=>2,
+ 'scrollregion'=>['-11c', '-11c', '50c', '20c']
+ ) {|c|
+ if $tk_version =~ /^4\.[01]/
+ pack('expand'=>'yes', 'fill'=>'both')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}) {|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ if $tk_version =~ /^4\.[01]/
+ pack('side'=>'right', 'fill'=>'y')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+ }
+
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}) {|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ if $tk_version =~ /^4\.[01]/
+ pack('side'=>'bottom', 'fill'=>'x')
+ else
+ grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ end
+ }
+}
+
+bg = $cscroll_canvas.configinfo('bg')[4]
+(0..19).each{|i|
+ x = -10+3*i
+ y = -10
+ (0..9).each{|j|
+ TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c",
+ 'outline'=>'black', 'fill'=>bg, 'tags'=>'rect')
+ TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c",
+ 'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
+ y += 3
+ }
+}
+
+$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas})
+$cscroll_canvas.itembind('all', 'Any-Leave', proc{scrollLeave $cscroll_canvas})
+$cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas})
+$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas})
+$cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y')
+$cscroll_canvas.bind('B2-Motion',
+ proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
+
+def scrollEnter(c)
+ id = c.find_withtag('current')[0].id
+ id -= 1 if c.gettags('current').include?('text')
+ $oldFill = c.itemconfiginfo(id, 'fill')[4]
+ if TkWinfo.depth(c) > 1
+ c.itemconfigure(id, 'fill'=>'SeaGreen1')
+ else
+ c.itemconfigure(id, 'fill'=>'black')
+ c.itemconfigure(id+1, 'fill'=>'white')
+ end
+end
+
+def scrollLeave(c)
+ id = c.find_withtag('current')[0].id
+ id -= 1 if c.gettags('current').include?('text')
+ c.itemconfigure(id, 'fill'=>$oldFill)
+ c.itemconfigure(id+1, 'fill'=>'black')
+end
+
+def scrollButton(c)
+ id = c.find_withtag('current')[0].id
+ id += 1 unless c.gettags('current').include?('text')
+ print "You buttoned at #{c.itemconfiginfo(id,'text')[4]}\n"
+end
+
diff --git a/ext/tk/sample/demos-jp/ctext.rb b/ext/tk/sample/demos-jp/ctext.rb
new file mode 100644
index 0000000000..bb354c490e
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ctext.rb
@@ -0,0 +1,204 @@
+# -*- coding: utf-8 -*-
+#
+# Canvas Text widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($ctext_demo) && $ctext_demo
+ $ctext_demo.destroy
+ $ctext_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$ctext_demo = TkToplevel.new {|w|
+ title("Canvas Text Demonstration")
+ iconname("Text")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ctext_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"このウィンドウにはキャンバスwidgetのテキスト機能をデモするためのテキスト文字列が表示されています。マウスを四角の中に持っていき、クリックすると位置ぎめ用の点からの相対位置を変えたり、行揃えを変えたりすることができます。また以下のような編集のための簡単なバインディングをサポートしています。
+
+ 1. マウスを持っていき、クリックし、入力できます。
+ 2. ボタン1で選択できます。
+ 3. マウスの位置にボタン2で選択したテキストをコピーできます。
+ 4.バックスペースをコントロール-Hで挿入カーソルの直前の文字を削除します。
+ 5. Deleteキーは挿入カーソルの直後の文字を削除します。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$ctext_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $ctext_demo
+ $ctext_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'ctext'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$ctext_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas 生成
+$ctext_canvas = TkCanvas.new(base_frame, 'relief'=>'flat',
+ 'borderwidth'=>0, 'width'=>500, 'height'=>350)
+$ctext_canvas.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'both')
+
+# font 設定
+if $tk_version =~ /^4.*/
+ textFont = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
+else
+ textFont = 'Helvetica 24'
+end
+
+# canvas 設定
+TkcRectangle.new($ctext_canvas, 245, 195, 255, 205,
+ 'outline'=>'black', 'fill'=>'red')
+
+ctag_text_param = {
+ 'text'=>"これはキャンバスwidgetのテキスト機能をデモするための文字列です。\n上で述べたような編集を可能とするためのバインディングを施しています。",
+ 'width'=>440, 'anchor'=>'n', 'justify'=>'left'
+}
+if $tk_version =~ /^4.*/
+ ctag_text_param['font'] = '-*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*'
+ ctag_text_param['kanjifont'] = '-*-r-*--24-*-jisx0208.1983-0'
+else
+ ctag_text_param['font'] = 'Helvetica 24'
+end
+$ctag_text = TkcTag.new($ctext_canvas)
+$ctag_text.withtag(TkcText.new($ctext_canvas, 250, 200, ctag_text_param))
+
+$ctag_text.bind('1', proc{|x,y| textB1Press $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('B1-Motion', proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('Shift-1',
+ proc{|x,y| $ctext_canvas.seleect_adjust 'current', "@#{x},#{y}"},
+ "%x %y")
+$ctag_text.bind('Shift-B1-Motion',
+ proc{|x,y| textB1Move $ctext_canvas,x,y}, "%x %y")
+$ctag_text.bind('KeyPress', proc{|a| textInsert $ctext_canvas,a}, "%A")
+$ctag_text.bind('Return', proc{textInsert $ctext_canvas,"\n"})
+$ctag_text.bind('Control-h', proc{textBs $ctext_canvas})
+$ctag_text.bind('BackSpace', proc{textBs $ctext_canvas})
+$ctag_text.bind('Delete', proc{textDel $ctext_canvas})
+$ctag_text.bind('2', proc{|x,y| textPaste $ctext_canvas, "@#{x},#{y}"},
+ "%x %y")
+
+# Next, create some items that allow the text's anchor position
+# to be edited.
+
+def mkTextConfig(w,x,y,option,value,color)
+ item = TkcRectangle.new(w, x, y, x+30, y+30,
+ 'outline'=>'black', 'fill'=>color, 'width'=>1)
+ item.bind('1', proc{$ctag_text.configure option, value})
+ w.addtag_withtag('config', item)
+end
+
+x = 50
+y = 50
+color = 'LightSkyBlue1'
+mkTextConfig $ctext_canvas, x, y, 'anchor', 'se', color
+mkTextConfig $ctext_canvas, x+30, y, 'anchor', 's', color
+mkTextConfig $ctext_canvas, x+60, y, 'anchor', 'sw', color
+mkTextConfig $ctext_canvas, x, y+30, 'anchor', 'e', color
+mkTextConfig $ctext_canvas, x+30, y+30, 'anchor', 'center', color
+mkTextConfig $ctext_canvas, x+60, y+30, 'anchor', 'w', color
+mkTextConfig $ctext_canvas, x, y+60, 'anchor', 'ne', color
+mkTextConfig $ctext_canvas, x+30, y+60, 'anchor', 'n', color
+mkTextConfig $ctext_canvas, x+60, y+60, 'anchor', 'nw', color
+item = TkcRectangle.new($ctext_canvas, x+40, y+40, x+50, y+50,
+ 'outline'=>'black', 'fill'=>'red')
+item.bind('1', proc{$ctag_text.configure 'anchor', 'center'})
+if $tk_version =~ /^4.*/
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
+ 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*',
+ 'anchor'=>'s', 'fill'=>'brown')
+else
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Text Position',
+ 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
+end
+
+# Lastly, create some items that allow the text's justification to be
+# changed.
+
+x = 350
+y = 50
+color = 'SeaGreen2'
+mkTextConfig $ctext_canvas, x, y, 'justify', 'left', color
+mkTextConfig $ctext_canvas, x+30, y, 'justify', 'center', color
+mkTextConfig $ctext_canvas, x+60, y, 'justify', 'right', color
+if $tk_version =~ /^4.*/
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification',
+ 'font'=>'-*-times-medium-r-normal--*-240-*-*-*-*-*-*',
+ 'anchor'=>'s', 'fill'=>'brown')
+else
+ TkcText.new($ctext_canvas, x+45, y-5, 'text'=>'Justification',
+ 'font'=>'Times 24', 'anchor'=>'s', 'fill'=>'brown')
+end
+
+$ctext_canvas.itembind('config', 'Enter', proc{textEnter $ctext_canvas})
+$ctext_canvas.itembind('config', 'Leave',
+ proc{$ctext_canvas\
+ .itemconfigure('current',
+ 'fill'=>$textConfigFill)})
+
+$textConfigFill = ''
+
+def textEnter(w)
+ $textConfigFill = (w.itemconfiginfo 'current', 'fill')[4]
+ w.itemconfigure 'current', 'fill', 'black'
+end
+
+def textInsert(w, string)
+ return if string == ""
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ end
+ $ctag_text.insert 'insert', string
+end
+
+def textPaste(w, pos)
+ begin
+ $ctag_text.insert pos, TkSelection.get
+ rescue
+ end
+end
+
+def textB1Press(w,x,y)
+ w.icursor 'current', "@#{x},#{y}"
+ w.itemfocus 'current'
+ w.focus
+ w.select_from 'current', "@#{x},#{y}"
+end
+
+def textB1Move(w,x,y)
+ w.select_to 'current', "@#{x},#{y}"
+end
+
+def textBs(w)
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ char = $ctag_text.index('insert').to_i - 1
+ $ctag_text.dchars(char) if char >= 0
+ end
+end
+
+def textDel(w)
+ begin
+ $ctag_text.dchars 'sel.first', 'sel.last'
+ rescue
+ $ctag_text.dchars 'insert'
+ end
+end
+
diff --git a/ext/tk/sample/demos-jp/dialog1.rb b/ext/tk/sample/demos-jp/dialog1.rb
new file mode 100644
index 0000000000..e50c9071e5
--- /dev/null
+++ b/ext/tk/sample/demos-jp/dialog1.rb
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+#
+# a dialog box with a local grab (called by 'widget')
+#
+class TkDialog_Demo1 < TkDialog
+ ###############
+ private
+ ###############
+ def title
+ "Dialog with local grab"
+ end
+
+ def message
+ 'モーダルダイアログボックスです。Tk の "grab" コマンドを使用してダイアログボックスで「ローカルグラブ」しています。下のいずれかのボタンを実行することによって、このダイアログに答えるまで、このグラブによってアプリケーションの他のウィンドウでは、ポインタ関係のイベントを受け取ることができなくなっています。'
+ end
+
+ def bitmap
+ 'info'
+ end
+
+ def default_button
+ 0
+ end
+
+ def buttons
+# "了解 キャンセル コード参照"
+ ["了解", "キャンセル", "コード参照"]
+ end
+end
+
+ret = TkDialog_Demo1.new('message_config'=>{'wraplength'=>'4i'}).value
+case ret
+when 0
+ print "あなたは「了解」を押しましたね。\n"
+when 1
+ print "あなたは「キャンセル」を押しましたね。\n"
+when 2
+ showCode 'dialog1'
+end
diff --git a/ext/tk/sample/demos-jp/dialog2.rb b/ext/tk/sample/demos-jp/dialog2.rb
new file mode 100644
index 0000000000..3e7d9619a4
--- /dev/null
+++ b/ext/tk/sample/demos-jp/dialog2.rb
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+#
+# a dialog box with a global grab (called by 'widget')
+#
+class TkDialog_Demo2 < TkDialog
+ ###############
+ private
+ ###############
+ def title
+ "Dialog with global grab"
+ end
+
+ def message
+ 'このダイアログボックスはグローバルグラブを使用しています。下のボタンを実行するまで、ディスプレイ上のいかなるものとも対話できません。グローバルグラブを使用することは、まず良い考えではありません。どうしても必要になるまで使おうと思わないで下さい。'
+ end
+
+ def bitmap
+ 'info'
+ end
+
+ def default_button
+ 0
+ end
+
+ def buttons
+# "了解 キャンセル コード参照"
+ ["了解", "キャンセル", "コード参照"]
+ end
+end
+
+ret = TkDialog_Demo2.new('message_config'=>{'wraplength'=>'4i'},
+ 'prev_command'=>proc{|dialog|
+ Tk.after 100, proc{dialog.grab('global')}
+ }).value
+case ret
+when 0
+ print "あなたは「了解」を押しましたね。\n"
+when 1
+ print "あなたは「キャンセル」を押しましたね。\n"
+when 2
+ showCode 'dialog2'
+end
+
diff --git a/ext/tk/sample/demos-jp/doc.org/README b/ext/tk/sample/demos-jp/doc.org/README
new file mode 100644
index 0000000000..90677d3316
--- /dev/null
+++ b/ext/tk/sample/demos-jp/doc.org/README
@@ -0,0 +1,7 @@
+This directory contains a collection of demonstration programs that
+are translated into Japanese. You need to use a Japanized "wish" to
+see these Japanese-translated demonstration programs. You also need
+to put this directory ("demos.jp") at the next to "demos" since some
+of the programs refer to the image files at "demos".
+
+Please refer to the README file at "demos" for more detail.
diff --git a/ext/tk/sample/demos-jp/doc.org/README.JP b/ext/tk/sample/demos-jp/doc.org/README.JP
new file mode 100644
index 0000000000..42b4929378
--- /dev/null
+++ b/ext/tk/sample/demos-jp/doc.org/README.JP
@@ -0,0 +1,14 @@
+This directory contains "widget" demo for the Japanized Tcl7.6/Tk4.2.
+Most of the messages in the original are translated to Japanese.
+But other tools in this directory are not translated.
+
+Following 2 kanji fonts are defined at the beginning of the file "widget."
+
+ -*--24-*-jisx0208.1983-0
+ -*--16-*-jisx0208.1983-0
+
+These fonts are all part of the core distribution of X11R5, so
+if you are running X11R5, you don't have to modify the file.
+
+But if you don't have these fonts, replace them with appropriate ones.
+"-*--14-*-jisx0208.1983-0" will be a good choice.
diff --git a/ext/tk/sample/demos-jp/doc.org/README.tk80 b/ext/tk/sample/demos-jp/doc.org/README.tk80
new file mode 100644
index 0000000000..c71f977d74
--- /dev/null
+++ b/ext/tk/sample/demos-jp/doc.org/README.tk80
@@ -0,0 +1,46 @@
+This directory contains a collection of programs to demonstrate
+the features of the Tk toolkit. The programs are all scripts for
+"wish", a windowing shell. If wish has been installed in /usr/local
+then you can invoke any of the programs in this directory just
+by typing its file name to your command shell. Otherwise invoke
+wish with the file as its first argument, e.g., "wish hello".
+The rest of this file contains a brief description of each program.
+Files with names ending in ".tcl" are procedure packages used by one
+or more of the demo programs; they can't be used as programs by
+themselves so they aren't described below.
+
+hello - Creates a single button; if you click on it, a message
+ is typed and the application terminates.
+
+widget - Contains a collection of demonstrations of the widgets
+ currently available in the Tk library. Most of the .tcl
+ files are scripts for individual demos available through
+ the "widget" program.
+
+ixset - A simple Tk-based wrapper for the "xset" program, which
+ allows you to interactively query and set various X options
+ such as mouse acceleration and bell volume. Thanks to
+ Pierre David for contributing this example.
+
+rolodex - A mock-up of a simple rolodex application. It has much of
+ the user interface for such an application but no back-end
+ database. This program was written in response to Tom
+ LaStrange's toolkit benchmark challenge.
+
+tcolor - A color editor. Allows you to edit colors in several
+ different ways, and will also perform automatic updates
+ using "send".
+
+rmt - Allows you to "hook-up" remotely to any Tk application
+ on the display. Select an application with the menu,
+ then just type commands: they'll go to that application.
+
+timer - Displays a seconds timer with start and stop buttons.
+ Control-c and control-q cause it to exit.
+
+browse - A simple directory browser. Invoke it with and argument
+ giving the name of the directory you'd like to browse.
+ Double-click on files or subdirectories to browse them.
+ Control-c and control-q cause the program to exit.
+
+sccs id = SCCS: @(#) README 1.3 96/02/16 10:49:14
diff --git a/ext/tk/sample/demos-jp/doc.org/license.terms b/ext/tk/sample/demos-jp/doc.org/license.terms
new file mode 100644
index 0000000000..c0a44d3fc2
--- /dev/null
+++ b/ext/tk/sample/demos-jp/doc.org/license.terms
@@ -0,0 +1,39 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., and other parties. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/demos-jp/doc.org/license.terms.tk80 b/ext/tk/sample/demos-jp/doc.org/license.terms.tk80
new file mode 100644
index 0000000000..c0a44d3fc2
--- /dev/null
+++ b/ext/tk/sample/demos-jp/doc.org/license.terms.tk80
@@ -0,0 +1,39 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., and other parties. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/demos-jp/entry1.rb b/ext/tk/sample/demos-jp/entry1.rb
new file mode 100644
index 0000000000..9be677d12d
--- /dev/null
+++ b/ext/tk/sample/demos-jp/entry1.rb
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+#
+# entry (no scrollbars) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($entry1_demo) && $entry1_demo
+ $entry1_demo.destroy
+ $entry1_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$entry1_demo = TkToplevel.new {|w|
+ title("Entry Demonstration (no scrollbars)")
+ iconname("entry1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry1_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "3種類の異なるエントリが表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $entry1_demo
+ $entry1_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'entry1'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# entry 生成
+e1 = TkEntry.new(base_frame, 'relief'=>'sunken')
+e2 = TkEntry.new(base_frame, 'relief'=>'sunken')
+e3 = TkEntry.new(base_frame, 'relief'=>'sunken')
+[e1,e2,e3].each{|w| w.pack('side'=>'top', 'padx'=>10, 'pady'=>5, 'fill'=>'x')}
+
+# 初期値挿入
+e1.insert(0, '初期値')
+e2.insert('end', "このエントリには長い文字列が入っていて、")
+e2.insert('end', "長すぎてウィンドウには入り切らないので、")
+e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ")
+e2.insert('end', "ならないでしょう。")
+
diff --git a/ext/tk/sample/demos-jp/entry2.rb b/ext/tk/sample/demos-jp/entry2.rb
new file mode 100644
index 0000000000..5476d24ade
--- /dev/null
+++ b/ext/tk/sample/demos-jp/entry2.rb
@@ -0,0 +1,91 @@
+# -*- coding: utf-8 -*-
+#
+# entry (with scrollbars) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($entry2_demo) && $entry2_demo
+ $entry2_demo.destroy
+ $entry2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$entry2_demo = TkToplevel.new {|w|
+ title("Entry Demonstration (with scrollbars)")
+ iconname("entry2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry2_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "3種類の異なるエントリが各々スクロールバー付で表示されています。文字を入力するにはポインタを持って行き、クリックしてからタイプしてください。標準的なMotifの編集機能が、Emacsのキーバインドとともに、サポートされています。例えば、バックスペースとコントロール-Hはカーソルの左の文字を削除し、デリートキーとコントロール-Dはカーソルの右側の文字を削除します。長過ぎてウィンドウに入り切らないものは、マウスのボタン2を押したままドラッグすることでスクロールさせることができます。日本語を入力するのはコントロール-バックスラッシュです。kinput2が動いていれば入力することができます。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $entry2_demo
+ $entry2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'entry2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ # entry 1
+ s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e1 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s1.set first,last}
+ }
+ s1.command(proc{|*args| e1.xview(*args)})
+ e1.pack('side'=>'top', 'fill'=>'x')
+ s1.pack('side'=>'top', 'fill'=>'x')
+
+ # spacer
+ TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
+
+ # entry 2
+ s2 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e2 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s2.set first,last}
+ }
+ s2.command(proc{|*args| e2.xview(*args)})
+ e2.pack('side'=>'top', 'fill'=>'x')
+ s2.pack('side'=>'top', 'fill'=>'x')
+
+ # spacer
+ TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
+
+ # entry 3
+ s3 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
+ e3 = TkEntry.new(w, 'relief'=>'sunken') {
+ xscrollcommand proc{|first,last| s3.set first,last}
+ }
+ s3.command(proc{|*args| e3.xview(*args)})
+ e3.pack('side'=>'top', 'fill'=>'x')
+ s3.pack('side'=>'top', 'fill'=>'x')
+
+ # 初期値挿入
+ e1.insert(0, '初期値')
+ e2.insert('end', "このエントリには長い文字列が入っていて、")
+ e2.insert('end', "長すぎてウィンドウには入り切らないので、")
+ e2.insert('end', "実際の所終りまで見るにはスクロールさせなければ")
+ e2.insert('end', "ならないでしょう。")
+
+}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes')
+
diff --git a/ext/tk/sample/demos-jp/entry3.rb b/ext/tk/sample/demos-jp/entry3.rb
new file mode 100644
index 0000000000..59c698de62
--- /dev/null
+++ b/ext/tk/sample/demos-jp/entry3.rb
@@ -0,0 +1,225 @@
+# -*- coding: utf-8 -*-
+# entry3.rb --
+#
+# This demonstration script creates several entry widgets whose
+# permitted input is constrained in some way. It also shows off a
+# password entry.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($entry3_demo) && $entry3_demo
+ $entry3_demo.destroy
+ $entry3_demo = nil
+end
+
+$entry3_demo = TkToplevel.new {|w|
+ title("Constrained Entry Demonstration")
+ iconname("entry3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($entry3_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+以下には4種類のエントリボックスが表示されています.各エントリボックスは,\
+マウスクリックで選択し文字を打ち込むことが可能ですが,それぞれがどのような\
+入力を受け付けることができるかには制約が設けられています.\
+一つめのエントリボックスは整数と見なされる文字列か入力文字がない空の状態か\
+の場合だけを受け付け,問題がある場合はエントリボックスが点滅します\
+(フォーカスが去る時にチェックされます).\
+二つめのエントリボックスは,入力された文字列の長さが\
+10文字未満の場合だけを受け付け,制限を越えて書き込もうとしたときには\
+ベルを鳴らして知らせます.\
+三つめは米国の電話番号を受け付けるエントリボックスです.\
+アルファベットは,電話機のダイヤル上で対応づけられている数字に変換されます.\
+不適切な文字が入力されたり数字以外の文字の位置に数字を入力しようとしたり\
+した場合には警告のベルが鳴ります.\
+四つめのエントリボックスは,8文字までの入力を受け付ける\
+パスワードフィールドです(8文字以上は特に警告を出すことなく無視されます).\
+入力された文字はアスタリスク記号に置き換えて表示されます.
+EOL
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $entry3_demo.destroy
+ $entry3_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'entry3'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+# focusAndFlash --
+# Error handler for entry widgets that forces the focus onto the
+# widget and makes the widget flash by exchanging the foreground and
+# background colours at intervals of 200ms (i.e. at approximately
+# 2.5Hz).
+#
+# Arguments:
+# widget - entry widget to flash
+# fg - Initial foreground colour
+# bg - Initial background colour
+# count - Counter to control the number of times flashed
+def focusAndFlash(widget, fg, bg, count=5)
+ return if count <= 0
+ if fg && !fg.empty? && bg && !bg.empty?
+ TkTimer.new(200, count,
+ proc{widget.configure(:foreground=>bg, :background=>fg)},
+ proc{widget.configure(:foreground=>fg, :background=>bg)}
+ ).start
+ else
+ # TkTimer.new(150, 3){Tk.bell}.start
+ Tk.bell
+ TkTimer.new(200, count,
+ proc{widget.configure(:foreground=>'white',
+ :background=>'black')},
+ proc{widget.configure(:foreground=>'black',
+ :background=>'white')}
+ ).at_end{begin
+ widget.configure(:foreground=>fg,
+ :background=>bg)
+ rescue
+ # ignore
+ end}.start
+ end
+ widget.focus(true)
+end
+
+l1 = TkLabelFrame.new(base_frame, :text=>"整数エントリ")
+TkEntry.new(l1, :validate=>:focus,
+ :vcmd=>[
+ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
+ ]) {|e|
+ fg = e.foreground
+ bg = e.background
+ invalidcommand [proc{|w| focusAndFlash(w, fg, bg)}, '%W']
+ pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+}
+
+l2 = TkLabelFrame.new(base_frame, :text=>"長さ制約付きエントリ")
+TkEntry.new(l2, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :vcmd=>[proc{|s| s.length < 10}, '%P']
+ ).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+
+### PHONE NUMBER ENTRY ###
+# Note that the source to this is quite a bit longer as the behaviour
+# demonstrated is a lot more ambitious than with the others.
+
+# Initial content for the third entry widget
+entry3content = TkVariable.new("1-(000)-000-0000")
+
+# Mapping from alphabetic characters to numbers.
+$phoneNumberMap = {}
+Hash[*(%w(abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9))].each{|chars, n|
+ chars.split('').each{|c|
+ $phoneNumberMap[c] = n
+ $phoneNumberMap[c.upcase] = n
+ }
+}
+
+# phoneSkipLeft --
+# Skip over fixed characters in a phone-number string when moving left.
+#
+# Arguments:
+# widget - The entry widget containing the phone-number.
+def phoneSkipLeft(widget)
+ idx = widget.index('insert')
+ if idx == 8
+ # Skip back two extra characters
+ widget.cursor = idx - 2
+ elsif idx == 7 || idx == 12
+ # Skip back one extra character
+ widget.cursor = idx - 1
+ elsif idx <= 3
+ # Can't move any further
+ Tk.bell
+ Tk.callback_break
+ end
+end
+
+# phoneSkipRight --
+# Skip over fixed characters in a phone-number string when moving right.
+#
+# Arguments:
+# widget - The entry widget containing the phone-number.
+# add - Offset to add to index before calculation (used by validation.)
+def phoneSkipRight(widget, add = 0)
+ idx = widget.index('insert')
+ if (idx + add == 5)
+ # Skip forward two extra characters
+ widget.cursor = idx + 2
+ elsif (idx + add == 6 || idx + add == 10)
+ # Skip forward one extra character
+ widget.cursor = idx + 1
+ elsif (idx + add == 15 && add == 0)
+ # Can't move any further
+ Tk.bell
+ Tk.callback_break
+ end
+end
+
+# validatePhoneChange --
+# Checks that the replacement (mapped to a digit) of the given
+# character in an entry widget at the given position will leave a
+# valid phone number in the widget.
+#
+# widget - entry widget to validate
+# vmode - The widget's validation mode
+# idx - The index where replacement is to occur
+# char - The character (or string, though that will always be
+# refused) to be overwritten at that point.
+
+def validatePhoneChange(widget, vmode, idx, char)
+ return true if idx == nil
+ Tk.after_idle(proc{widget.configure(:validate=>vmode,
+ :invcmd=>proc{Tk.bell})})
+ if !(idx<3 || idx==6 || idx==7 || idx==11 || idx>15) && char =~ /[0-9A-Za-z]/
+ widget.delete(idx)
+ widget.insert(idx, $phoneNumberMap[char] || char)
+ Tk.after_idle(proc{phoneSkipRight(widget, -1)})
+ # Tk.update(true) # <- Don't work 'update' inter validation callback.
+ # It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1).
+ return true
+ end
+ return false
+end
+
+
+l3 = TkLabelFrame.new(base_frame, :text=>"米国電話番号エントリ")
+TkEntry.new(l3, :validate=>:key, :invcmd=>proc{Tk.bell},
+ :textvariable=>entry3content,
+ :vcmd=>[
+ proc{|w,v,i,s| validatePhoneChange(w,v,i,s)},
+ "%W %v %i %S"
+ ]){|e|
+ # Click to focus goes to the first editable character...
+ bind('FocusIn', proc{|d,w|
+ if d != "NotifyAncestor"
+ w.cursor = 3
+ Tk.after_idle(proc{w.selection_clear})
+ end
+ }, '%d %W')
+ bind('Left', proc{|w| phoneSkipLeft(w)}, '%W')
+ bind('Right', proc{|w| phoneSkipRight(w)}, '%W')
+ pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+}
+
+l4 = TkLabelFrame.new(base_frame, :text=>"パスワードエントリ")
+TkEntry.new(l4, :validate=>:key, :show=>'*',
+ :vcmd=>[
+ proc{|s| s.length <= 8},
+ '%P'
+ ]).pack(:fill=>:x, :expand=>true, :padx=>'1m', :pady=>'1m')
+
+TkFrame.new(base_frame){|f|
+ lower
+ TkGrid.configure(l1, l2, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew)
+ TkGrid.configure(l3, l4, :in=>f, :padx=>'3m', :pady=>'1m', :sticky=>:ew)
+ TkGrid.columnconfigure(f, [0,1], :uniform=>1)
+ pack(:fill=>:both, :expand=>true)
+}
diff --git a/ext/tk/sample/demos-jp/filebox.rb b/ext/tk/sample/demos-jp/filebox.rb
new file mode 100644
index 0000000000..fc014bc282
--- /dev/null
+++ b/ext/tk/sample/demos-jp/filebox.rb
@@ -0,0 +1,102 @@
+# -*- coding: utf-8 -*-
+#
+# widget demo prompts the user to select a file (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($filebox_demo) && $entry2_demo
+ $filebox_demo.destroy
+ $filebox_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$filebox_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("filebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($filebox_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
+ 'text'=>"エントリにファイル名を直接入力するか、\"Browse\" ボタンを押してファイル選択ダイアログからファイル名を選んで下さい。").pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $filebox_demo
+ $filebox_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'filebox'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+['開く', '保存'].each{|type|
+ TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>"ファイルを#{type}: ", 'anchor'=>'e')\
+ .pack('side'=>'left')
+
+ TkEntry.new(f, 'width'=>20) {|e|
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
+
+ TkButton.new(f, 'text'=>'Browse ...',
+ 'command'=>proc{fileDialog base_frame,e,type})\
+ .pack('side'=>'left')
+ }
+
+ pack('fill'=>'x', 'padx'=>'1c', 'pady'=>3)
+ }
+}
+
+$tk_strictMotif = TkVarAccess.new('tk_strictMotif')
+if ($tk_platform['platform'] == 'unix')
+ TkCheckButton.new(base_frame,
+ 'text'=>'Motifスタイルのダイアログを用いる',
+ 'variable'=>$tk_strictMotif,
+ 'onvalue'=>1, 'offvalue'=>0 ).pack('anchor'=>'c')
+end
+
+def fileDialog(w,ent,operation)
+ # Type names Extension(s) Mac File Type(s)
+ #
+ #--------------------------------------------------------
+ types = [
+ ['Text files', ['.txt','.doc'] ],
+ ['Text files', [], 'TEXT' ],
+ ['Ruby Scripts', ['.rb'], 'TEXT' ],
+ ['Tcl Scripts', ['.tcl'], 'TEXT' ],
+ ['C Source Files', ['.c','.h'] ],
+ ['All Source Files', ['.rb','.tcl','.c','.h'] ],
+ ['Image Files', ['.gif'] ],
+ ['Image Files', ['.jpeg','.jpg'] ],
+ ['Image Files', [], ['GIFF','JPEG']],
+ ['All files', '*' ]
+ ]
+
+ if operation == '開く'
+ file = Tk.getOpenFile('filetypes'=>types, 'parent'=>w)
+ else
+ file = Tk.getSaveFile('filetypes'=>types, 'parent'=>w,
+ 'initialfile'=>'Untitled',
+ 'defaultextension'=>'.txt')
+ end
+ if file != ""
+ ent.delete 0, 'end'
+ ent.insert 0, file
+ # ent.xview 'end'
+ Tk.update_idletasks # need this for Tk::Tile::Entry
+ # (to find right position of 'xview').
+ ent.xview(ent.index('end'))
+ end
+end
+
diff --git a/ext/tk/sample/demos-jp/floor.rb b/ext/tk/sample/demos-jp/floor.rb
new file mode 100644
index 0000000000..5101a026bb
--- /dev/null
+++ b/ext/tk/sample/demos-jp/floor.rb
@@ -0,0 +1,1721 @@
+# -*- coding: utf-8 -*-
+#
+# floorDisplay widget demo (called by 'widget')
+#
+
+# floorDisplay --
+# Recreate the floorplan display in the canvas given by "w". The
+# floor given by "active" is displayed on top with its office structure
+# visible.
+#
+# Arguments:
+# w - Name of the canvas window.
+# active - Number of active floor (1, 2, or 3).
+
+def floorDisplay(w,active)
+ return if $activeFloor == active
+
+ w.delete('all')
+ $activeFloor = active
+
+ # First go through the three floors, displaying the backgrounds for
+ # each floor.
+
+ floor_bg1(w,$floor_colors['bg1'],$floor_colors['outline1'])
+ floor_bg2(w,$floor_colors['bg2'],$floor_colors['outline2'])
+ floor_bg3(w,$floor_colors['bg3'],$floor_colors['outline3'])
+
+ # Raise the background for the active floor so that it's on top.
+
+ w.raise("floor#{active}")
+
+ # Create a dummy item just to mark this point in the display list,
+ # so we can insert highlights here.
+
+ TkcRectangle.new(w,0,100,1,101, 'fill'=>'', 'outline'=>'', 'tags'=>'marker')
+
+ # Add the walls and labels for the active floor, along with
+ # transparent polygons that define the rooms on the floor.
+ # Make sure that the room polygons are on top.
+
+ $floorLabels.clear
+ $floorItems.clear
+ send("floor_fg#{active}", w, $floor_colors['offices'])
+ w.raise('room')
+
+ # Offset the floors diagonally from each other.
+
+ w.move('floor1', '2c', '2c')
+ w.move('floor2', '1c', '1c')
+
+ # Create items for the room entry and its label.
+ TkcWindow.new(w, 600, 100, 'anchor'=>'w', 'window'=>$floor_entry)
+ TkcText.new(w, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ")
+ w['scrollregion'] = w.bbox('all')
+end
+
+# newRoom --
+# This method is invoked whenever the mouse enters a room
+# in the floorplan. It changes tags so that the current room is
+# highlighted.
+#
+# Arguments:
+# w - The name of the canvas window.
+
+def newRoom(w)
+ id = w.find_withtag('current')[0]
+ $currentRoom.value = $floorLabels[id.id] if id != ""
+ Tk.update(true)
+end
+
+# roomChanged --
+# This method is invoked whenever the currentRoom variable changes.
+# It highlights the current room and unhighlights any previous room.
+#
+# Arguments:
+# w - The canvas window displaying the floorplan.
+# args - Not used.
+
+def roomChanged(w,*args)
+ w.delete('highlight')
+ item = $floorItems[$currentRoom.value]
+ return if item == nil
+ new = TkcPolygon.new(w, *(w.coords(item)))
+ new.configure('fill'=>$floor_colors['active'], 'tags'=>'highlight')
+ w.raise(new, 'marker')
+end
+
+# floor_bg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg1(w,fill,outline)
+ TkcPolygon.new(w,347,80,349,82,351,84,353,85,363,92,375,99,386,104,
+ 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725,
+ 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327,
+ 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404,
+ 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325,
+ 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332,
+ 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363,
+ 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391,
+ 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7,
+ 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221,
+ 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5,
+ 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70,
+ 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill)
+ TkcLine.new(w,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ TkcLine.new(w,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg'])
+end
+
+# floor_bg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg2(w,fill,outline)
+ TkcPolygon.new(w,559,129,484,129,484,162,398,162,398,129,315,129,
+ 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391,
+ 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280,
+ 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644,
+ 367,802,367,802,129,725,129,725,133,559,133,559,129,
+ 'tags'=>['floor2','bg'], 'fill'=>fill)
+ TkcLine.new(w,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+end
+
+# floor_bg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor_bg3(w,fill,outline)
+ TkcPolygon.new(w,159,300,107,300,107,248,159,248,159,129,96,129,96,
+ 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ TkcPolygon.new(w,258,370,258,329,350,329,350,311,399,311,399,129,
+ 315,129,315,133,176,133,176,129,159,129,159,370,258,370,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ TkcLine.new(w,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ TkcLine.new(w,107,300,159,300,159,248,107,248,107,300,
+ 'fill'=>outline, 'tags'=>['floor3','bg'])
+end
+
+# floor_fg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the first
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg1(w,color)
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '101'
+ $floorItems['101'] = i
+ TkcText.new(w,358,209, 'text'=>'101', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Pub Lift1'
+ $floorItems['Pub Lift1'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Priv Lift1'
+ $floorItems['Priv Lift1'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,42,389,42,337,1,337,1,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '110'
+ $floorItems['110'] = i
+ TkcText.new(w,21.5,363, 'text'=>'110', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '109'
+ $floorItems['109'] = i
+ TkcText.new(w,67,363, 'text'=>'109', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,300,51,253,6,253,6,300,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '111'
+ $floorItems['111'] = i
+ TkcText.new(w,28.5,276.5, 'text'=>'111', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,98,248,98,309,79,309,79,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117B'
+ $floorItems['117B'] = i
+ TkcText.new(w,88.5,278.5, 'text'=>'117B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,251,51,204,6,204,6,251,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '112'
+ $floorItems['112'] = i
+ TkcText.new(w,28.5,227.5, 'text'=>'112', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,6,156,51,156,51,203,6,203,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '113'
+ $floorItems['113'] = i
+ TkcText.new(w,28.5,179.5, 'text'=>'113', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,85,169,79,169,79,192,85,192,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117A'
+ $floorItems['117A'] = i
+ TkcText.new(w,82,180.5, 'text'=>'117A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,77,302,77,168,53,168,53,302,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '117'
+ $floorItems['117'] = i
+ TkcText.new(w,65,235, 'text'=>'117', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,155,51,115,6,115,6,155,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '114'
+ $floorItems['114'] = i
+ TkcText.new(w,28.5,135, 'text'=>'114', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,95,115,53,115,53,168,95,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '115'
+ $floorItems['115'] = i
+ TkcText.new(w,74,141.5, 'text'=>'115', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,87,113,87,27,10,27,10,113,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '116'
+ $floorItems['116'] = i
+ TkcText.new(w,48.5,70, 'text'=>'116', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,89,91,128,91,128,113,89,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '118'
+ $floorItems['118'] = i
+ TkcText.new(w,108.5,102, 'text'=>'118', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,178,128,178,132,216,132,216,91,
+ 163,91,163,112,149,112,149,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '120'
+ $floorItems['120'] = i
+ TkcText.new(w,189.5,111.5, 'text'=>'120', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192,
+ 156,192,156,169,175,169,175,246,79,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '122'
+ $floorItems['122'] = i
+ TkcText.new(w,131,207.5, 'text'=>'122', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,169,154,169,154,191,138,191,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '121'
+ $floorItems['121'] = i
+ TkcText.new(w,146,180, 'text'=>'121', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,99,300,126,300,126,309,99,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106A'
+ $floorItems['106A'] = i
+ TkcText.new(w,112.5,304.5, 'text'=>'106A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '105'
+ $floorItems['105'] = i
+ TkcText.new(w,124.5,278.5, 'text'=>'105', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,174,309,174,300,152,300,152,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106B'
+ $floorItems['106B'] = i
+ TkcText.new(w,163,304.5, 'text'=>'106B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '104'
+ $floorItems['104'] = i
+ TkcText.new(w,184,278.5, 'text'=>'104', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,385,138,337,91,337,91,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '108'
+ $floorItems['108'] = i
+ TkcText.new(w,114.5,361, 'text'=>'108', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,256,337,140,337,140,385,256,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '107'
+ $floorItems['107'] = i
+ TkcText.new(w,198,361, 'text'=>'107', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,300,353,300,329,260,329,260,353,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Smoking'
+ $floorItems['Smoking'] = i
+ TkcText.new(w,280,341, 'text'=>'Smoking', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '123'
+ $floorItems['123'] = i
+ TkcText.new(w,245.5,190.5, 'text'=>'123', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '103'
+ $floorItems['103'] = i
+ TkcText.new(w,259,287, 'text'=>'103', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '124'
+ $floorItems['124'] = i
+ TkcText.new(w,356,150, 'text'=>'124', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '125'
+ $floorItems['125'] = i
+ TkcText.new(w,392,217.5, 'text'=>'125', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '126'
+ $floorItems['126'] = i
+ TkcText.new(w,436.5,185.5, 'text'=>'126', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,409,209,409,229,399,229,399,253,
+ 486,253,486,239,474,239,474,209,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '127'
+ $floorItems['127'] = i
+ TkcText.new(w,436.5,'231', 'text'=>'127', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,501,164,501,174,495,174,495,188,
+ 490,188,490,204,476,204,476,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'MShower'
+ $floorItems['MShower'] = i
+ TkcText.new(w,488.5,'184', 'text'=>'MShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Closet'
+ $floorItems['Closet'] = i
+ TkcText.new(w,502.5,190, 'text'=>'Closet', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'WShower'
+ $floorItems['WShower'] = i
+ TkcText.new(w,494.5,230, 'text'=>'WShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166,
+ 697,166,697,275,553,275,531,254,515,254,
+ 515,174,503,174,503,161,486,161,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '130'
+ $floorItems['130'] = i
+ TkcText.new(w,638.5,205, 'text'=>'130', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,308,242,339,242,339,248,342,248,
+ 342,246,397,246,397,276,393,276,
+ 393,309,300,309,300,248,308,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '102'
+ $floorItems['102'] = i
+ TkcText.new(w,367.5,278.5, 'text'=>'102', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,255,486,255,486,276,397,276,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '128'
+ $floorItems['128'] = i
+ TkcText.new(w,441.5,265.5, 'text'=>'128', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,510,309,486,309,486,255,530,255,
+ 552,277,561,277,561,325,510,325,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '129'
+ $floorItems['129'] = i
+ TkcText.new(w,535.5,293, 'text'=>'129', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,696,281,740,281,740,387,642,387,
+ 642,389,561,389,561,277,696,277,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '133'
+ $floorItems['133'] = i
+ TkcText.new(w,628.5,335, 'text'=>'133', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,742,387,742,281,800,281,800,387,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '132'
+ $floorItems['132'] = i
+ TkcText.new(w,771,334, 'text'=>'132', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,800,168,800,280,699,280,699,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '134'
+ $floorItems['134'] = i
+ TkcText.new(w,749.5,224, 'text'=>'134', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,726,131,726,166,800,166,800,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '135'
+ $floorItems['135'] = i
+ TkcText.new(w,763,148.5, 'text'=>'135', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366,
+ 304,312,396,312,396,288,400,288,404,288,
+ 409,290,413,292,418,297,421,302,422,309,
+ 421,318,417,325,411,330,405,332,397,333,
+ 344,333,340,334,336,336,335,338,332,342,
+ 331,347,332,351,334,354,336,357,341,359,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Ramona Stair'
+ $floorItems['Ramona Stair'] = i
+ TkcText.new(w,368,323, 'text'=>'Ramona Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20,
+ 122,28,123,32,123,68,220,68,220,87,90,87,90,23,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'University Stair'
+ $floorItems['University Stair'] = i
+ TkcText.new(w,155,77.5, 'text'=>'University Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56,
+ 358,48,363,39,365,29,348,25,335,22,321,14,
+ 300,5,283,1,260,0,246,0,242,2,236,4,231,8,
+ 227,13,223,17,221,22,220,34,260,34,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Plaza Stair'
+ $floorItems['Plaza Stair'] = i
+ TkcText.new(w,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49,
+ 323,56,337,70,350,83,365,94,377,100,
+ 386,104,386,128,220,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = 'Plaza Deck'
+ $floorItems['Plaza Deck'] = i
+ TkcText.new(w,303,81, 'text'=>'Plaza Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '106'
+ $floorItems['106'] = i
+ TkcText.new(w,131.5,318.5, 'text'=>'106', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115,
+ 95,128,114,128,114,151,157,151,157,153,112,153,
+ 112,130,97,130,97,168,175,168,175,131,146,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels[i.id] = '119'
+ $floorItems['119'] = i
+ TkcText.new(w,143.5,133, 'text'=>'119', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ TkcLine.new(w,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ TkcLine.new(w,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+end
+
+# floor_fg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the second
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg2(w,color)
+ i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222,
+ 800,222,800,168,748,168,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '238'
+ $floorItems['238'] = i
+ TkcText.new(w,774,195, 'text'=>'238', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '237'
+ $floorItems['237'] = i
+ TkcText.new(w,763,148.5, 'text'=>'237', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324,
+ 643,324,643,291,641,291,641,205,696,205,
+ 696,291,694,291,694,314,715,314,715,291,
+ 715,205,755,205,755,190,724,190,724,187,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '246'
+ $floorItems['246'] = i
+ TkcText.new(w,600,264, 'text'=>'246', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,694,279,643,279,643,314,694,314,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '247'
+ $floorItems['247'] = i
+ TkcText.new(w,668.5,296.5, 'text'=>'247', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246,
+ 397,246,397,255,476,255,476,250,482,250,559,250,
+ 559,274,482,274,482,278,396,278,396,274,232,274,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '202'
+ $floorItems['202'] = i
+ TkcText.new(w,285.5,260, 'text'=>'202', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196,
+ 306,196,306,180,175,180,175,169,156,169,
+ 156,196,176,196,176,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '206'
+ $floorItems['206'] = i
+ TkcText.new(w,143,267, 'text'=>'206', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,277,6,277,6,338,51,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '212'
+ $floorItems['212'] = i
+ TkcText.new(w,28.5,307.5, 'text'=>'212', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '245'
+ $floorItems['245'] = i
+ TkcText.new(w,521.5,300.5, 'text'=>'245', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,560,389,599,389,599,326,560,326,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '244'
+ $floorItems['244'] = i
+ TkcText.new(w,579.5,357.5, 'text'=>'244', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,601,389,601,326,643,326,643,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '243'
+ $floorItems['243'] = i
+ TkcText.new(w,622,357.5, 'text'=>'243', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,688,316,645,316,645,365,688,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '242'
+ $floorItems['242'] = i
+ TkcText.new(w,666.5,340.5, 'text'=>'242', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,802,367,759,367,759,226,802,226,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Barbecue Deck'
+ $floorItems['Barbecue Deck'] = i
+ TkcText.new(w,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,262,755,314,717,314,717,262,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '240'
+ $floorItems['240'] = i
+ TkcText.new(w,736,288, 'text'=>'240', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,316,689,316,689,365,755,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '241'
+ $floorItems['241'] = i
+ TkcText.new(w,722,340.5, 'text'=>'241', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,206,717,206,717,261,755,261,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '239'
+ $floorItems['239'] = i
+ TkcText.new(w,736,233.5, 'text'=>'239', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,695,277,643,277,643,206,695,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '248'
+ $floorItems['248'] = i
+ TkcText.new(w,669,241.5, 'text'=>'248', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,676,135,676,185,724,185,724,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '236'
+ $floorItems['236'] = i
+ TkcText.new(w,700,160, 'text'=>'236', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '235'
+ $floorItems['235'] = i
+ TkcText.new(w,651.5,160, 'text'=>'235', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,626,143,633,143,633,135,572,135,
+ 572,143,579,143,579,185,626,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '234'
+ $floorItems['234'] = i
+ TkcText.new(w,606,160, 'text'=>'234', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,135,571,135,571,145,578,145,
+ 578,185,527,185,527,131,557,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '233'
+ $floorItems['233'] = i
+ TkcText.new(w,552.5,158, 'text'=>'233', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,249,557,249,557,205,476,205,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '230'
+ $floorItems['230'] = i
+ TkcText.new(w,516.5,227, 'text'=>'230', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '232'
+ $floorItems['232'] = i
+ TkcText.new(w,500.5,158, 'text'=>'232', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,186,495,186,495,204,476,204,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '229'
+ $floorItems['229'] = i
+ TkcText.new(w,485.5,195, 'text'=>'229', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '227'
+ $floorItems['227'] = i
+ TkcText.new(w,436.5,185.5, 'text'=>'227', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '228'
+ $floorItems['228'] = i
+ TkcText.new(w,436.5,231, 'text'=>'228', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '226'
+ $floorItems['226'] = i
+ TkcText.new(w,392,217.5, 'text'=>'226', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '225'
+ $floorItems['225'] = i
+ TkcText.new(w,356.5,150, 'text'=>'225', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,198,306,198,306,249,234,249,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '224'
+ $floorItems['224'] = i
+ TkcText.new(w,270,223.5, 'text'=>'224', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '223'
+ $floorItems['223'] = i
+ TkcText.new(w,292,157, 'text'=>'223', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,268,179,221,179,221,135,268,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '222'
+ $floorItems['222'] = i
+ TkcText.new(w,244.5,157, 'text'=>'222', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,177,179,219,179,219,135,177,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '221'
+ $floorItems['221'] = i
+ TkcText.new(w,198,157, 'text'=>'221', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '204'
+ $floorItems['204'] = i
+ TkcText.new(w,324,301.5, 'text'=>'204', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '205'
+ $floorItems['205'] = i
+ TkcText.new(w,265.5,307, 'text'=>'205', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,256,385,256,340,212,340,212,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '207'
+ $floorItems['207'] = i
+ TkcText.new(w,234,362.5, 'text'=>'207', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,210,340,164,340,164,385,210,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '208'
+ $floorItems['208'] = i
+ TkcText.new(w,187,362.5, 'text'=>'208', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,115,340,162,340,162,385,115,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '209'
+ $floorItems['209'] = i
+ TkcText.new(w,138.5,362.5, 'text'=>'209', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,228,89,156,53,156,53,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '217'
+ $floorItems['217'] = i
+ TkcText.new(w,71,192, 'text'=>'217', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,169,97,169,97,190,89,190,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '217A'
+ $floorItems['217A'] = i
+ TkcText.new(w,93,179.5, 'text'=>'217A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '216'
+ $floorItems['216'] = i
+ TkcText.new(w,71,145.5, 'text'=>'216', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,179,51,135,6,135,6,179,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '215'
+ $floorItems['215'] = i
+ TkcText.new(w,28.5,157, 'text'=>'215', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,227,6,227,6,180,51,180,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '214'
+ $floorItems['214'] = i
+ TkcText.new(w,28.5,203.5, 'text'=>'214', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,275,6,275,6,229,51,229,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '213'
+ $floorItems['213'] = i
+ TkcText.new(w,28.5,252, 'text'=>'213', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,114,340,67,340,67,385,114,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '210'
+ $floorItems['210'] = i
+ TkcText.new(w,90.5,362.5, 'text'=>'210', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '211'
+ $floorItems['211'] = i
+ TkcText.new(w,33,364.5, 'text'=>'211', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '203'
+ $floorItems['203'] = i
+ TkcText.new(w,367.5,292.5, 'text'=>'203', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198,
+ 154,198,154,192,109,192,109,169,99,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '220'
+ $floorItems['220'] = i
+ TkcText.new(w,132.5,208.5, 'text'=>'220', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Priv Lift2'
+ $floorItems['Priv Lift2'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = 'Pub Lift 2'
+ $floorItems['Pub Lift 2'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift 2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '218'
+ $floorItems['218'] = i
+ TkcText.new(w,136,149.5, 'text'=>'218', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '219'
+ $floorItems['219'] = i
+ TkcText.new(w,132.5,180, 'text'=>'219', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels[i.id] = '201'
+ $floorItems['201'] = i
+ TkcText.new(w,358,209, 'text'=>'201', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ TkcLine.new(w,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+end
+
+# floor_fg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the third
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor_fg3(w,color)
+ i = TkcPolygon.new(w,89,228,89,180,70,180,70,228,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316'
+ $floorItems['316'] = i
+ TkcText.new(w,79.5,204, 'text'=>'316', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,115,368,162,368,162,323,115,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '309'
+ $floorItems['309'] = i
+ TkcText.new(w,138.5,345.5, 'text'=>'309', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,164,323,164,368,211,368,211,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '308'
+ $floorItems['308'] = i
+ TkcText.new(w,187.5,345.5, 'text'=>'308', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,256,368,212,368,212,323,256,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '307'
+ $floorItems['307'] = i
+ TkcText.new(w,234,345.5, 'text'=>'307', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '305'
+ $floorItems['305'] = i
+ TkcText.new(w,270.5,301.5, 'text'=>'305', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,219,251,203,244,203,244,219,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324B'
+ $floorItems['324B'] = i
+ TkcText.new(w,247.5,211, 'text'=>'324B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,249,244,249,244,232,251,232,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324A'
+ $floorItems['324A'] = i
+ TkcText.new(w,247.5,240.5, 'text'=>'324A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,223,135,223,179,177,179,177,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '320'
+ $floorItems['320'] = i
+ TkcText.new(w,200,157, 'text'=>'320', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,114,368,114,323,67,323,67,368,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '310'
+ $floorItems['310'] = i
+ TkcText.new(w,90.5,345.5, 'text'=>'310', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,277,23,321,68,321,68,277,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '312'
+ $floorItems['312'] = i
+ TkcText.new(w,45.5,299, 'text'=>'312', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,229,68,229,68,275,23,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '313'
+ $floorItems['313'] = i
+ TkcText.new(w,45.5,252, 'text'=>'313', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,68,227,23,227,23,180,68,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '314'
+ $floorItems['314'] = i
+ TkcText.new(w,40.5,203.5, 'text'=>'314', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,95,179,95,135,23,135,23,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '315'
+ $floorItems['315'] = i
+ TkcText.new(w,59,157, 'text'=>'315', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,99,226,99,204,91,204,91,226,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316B'
+ $floorItems['316B'] = i
+ TkcText.new(w,95,215, 'text'=>'316B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,91,202,99,202,99,180,91,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '316A'
+ $floorItems['316A'] = i
+ TkcText.new(w,95,191, 'text'=>'316A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198,
+ 174,198,174,226,101,226,101,179,97,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '319'
+ $floorItems['319'] = i
+ TkcText.new(w,141.5,209, 'text'=>'319', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '311'
+ $floorItems['311'] = i
+ TkcText.new(w,29.5,361, 'text'=>'311', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '318'
+ $floorItems['318'] = i
+ TkcText.new(w,132.5,180, 'text'=>'318', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '317'
+ $floorItems['317'] = i
+ TkcText.new(w,136,149.5, 'text'=>'317', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,274,194,274,221,306,221,306,194,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '323'
+ $floorItems['323'] = i
+ TkcText.new(w,290,207.5, 'text'=>'323', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,306,222,274,222,274,249,306,249,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '325'
+ $floorItems['325'] = i
+ TkcText.new(w,290,235.5, 'text'=>'325', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,263,179,224,179,224,135,263,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '321'
+ $floorItems['321'] = i
+ TkcText.new(w,243.5,157, 'text'=>'321', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,314,169,306,169,306,192,273,192,
+ 264,181,264,135,314,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '322'
+ $floorItems['322'] = i
+ TkcText.new(w,293.5,163.5, 'text'=>'322', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = 'Pub Lift3'
+ $floorItems['Pub Lift3'] = i
+ TkcText.new(w,323,223, 'text'=>'Pub Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = 'Priv Lift3'
+ $floorItems['Priv Lift3'] = i
+ TkcText.new(w,323,188, 'text'=>'Priv Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '303'
+ $floorItems['303'] = i
+ TkcText.new(w,373.5,292.5, 'text'=>'303', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,272,203,272,249,252,249,252,230,
+ 244,230,244,221,252,221,252,203,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '324'
+ $floorItems['324'] = i
+ TkcText.new(w,262,226, 'text'=>'324', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '304'
+ $floorItems['304'] = i
+ TkcText.new(w,324,301.5, 'text'=>'304', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '301'
+ $floorItems['301'] = i
+ TkcText.new(w,358,209, 'text'=>'301', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,397,246,377,246,377,185,397,185,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '327'
+ $floorItems['327'] = i
+ TkcText.new(w,387,215.5, 'text'=>'327', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '326'
+ $floorItems['326'] = i
+ TkcText.new(w,365.5,150, 'text'=>'326', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282,
+ 375,274,397,274,397,248,339,248,339,242,308,242,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '302'
+ $floorItems['302'] = i
+ TkcText.new(w,319.5,261, 'text'=>'302', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203,
+ 272,193,263,180,242,180,175,180,175,169,156,169,
+ 156,196,177,196,177,228,107,228,70,228,70,275,107,275,
+ 107,248,160,248,160,301,107,301,107,275,70,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels[i.id] = '306'
+ $floorItems['306'] = i
+ TkcText.new(w,200.5,284.5, 'text'=>'306', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ TkcLine.new(w,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ TkcLine.new(w,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+end
+
+# Below is the "main program" that creates the floorplan demonstration.
+
+# toplevel widget が存在すれば削除する
+if defined?($floor_demo) && $floor_demo
+ $floor_demo.destroy
+ $floor_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$floor_demo = TkToplevel.new {|w|
+ title("Floorplan Canvas Demonstration")
+ iconname("Floorplan")
+ positionWindow(w)
+ geometry('+20+20')
+ minsize(100,100)
+}
+
+base_frame = TkFrame.new($floor_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+ 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$floor_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $floor_demo
+ $floor_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'floor'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$floor_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# 変数設定
+$floorLabels = {}
+$floorItems = {}
+
+# canvas 設定
+if $tk_version =~ /^4\.[01]/
+ $floor_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
+ 'highlightthickness'=>2)
+ $floor_canvas = TkCanvas.new($floor_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ 'highlightthickness'=>0) {|c|
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}){|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ pack('side'=>'bottom', 'fill'=>'x')
+ }
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}){|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ }
+ $floor_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes')
+ $floor_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+else
+ TkFrame.new(base_frame) {|f|
+ pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+ h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal')
+ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical')
+
+ TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1|
+ $floor_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500,
+ 'borderwidth'=>0,
+ 'highlightthickness'=>0) {
+ xscrollcommand(proc{|first,last| h.set first,last})
+ yscrollcommand(proc{|first,last| v.set first,last})
+ pack('expand'=>'yes', 'fill'=>'both')
+ }
+ grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ }
+
+ v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ v.command(proc{|*args| $floor_canvas.yview(*args)})
+ h.command(proc{|*args| $floor_canvas.xview(*args)})
+ }
+end
+
+
+# Create an entry for displaying and typing in current room.
+
+$currentRoom = TkVariable.new
+$floor_entry = TkEntry.new($floor_canvas, 'width'=>10, 'relief'=>'sunken',
+ 'bd'=>2, 'textvariable'=>$currentRoom)
+
+# Choose colors, then fill in the floorplan.
+
+$floor_colors = {}
+if TkWinfo.depth($floor_canvas) > 1
+ $floor_colors['bg1'] = '#a9c1da'
+ $floor_colors['outline1'] = '#77889a'
+ $floor_colors['bg2'] = '#9ab0c6'
+ $floor_colors['outline2'] = '#687786'
+ $floor_colors['bg3'] = '#8ba0b3'
+ $floor_colors['outline3'] = '#596673'
+ $floor_colors['offices'] = 'Black'
+ $floor_colors['active'] = '#c4d1df'
+else
+ $floor_colors['bg1'] = 'white'
+ $floor_colors['outline1'] = 'black'
+ $floor_colors['bg2'] = 'white'
+ $floor_colors['outline2'] = 'black'
+ $floor_colors['bg3'] = 'white'
+ $floor_colors['outline3'] = 'black'
+ $floor_colors['offices'] = 'Black'
+ $floor_colors['active'] = 'black'
+end
+
+$activeFloor = ''
+floorDisplay $floor_canvas,3
+
+# Set up event bindings for canvas:
+
+$floor_canvas.itembind('floor1', '1', proc{floorDisplay $floor_canvas,1})
+$floor_canvas.itembind('floor2', '1', proc{floorDisplay $floor_canvas,2})
+$floor_canvas.itembind('floor3', '1', proc{floorDisplay $floor_canvas,3})
+$floor_canvas.itembind('room', 'Enter', proc{newRoom $floor_canvas})
+$floor_canvas.itembind('room', 'Leave', proc{$currentRoom.value = ''})
+$floor_canvas.bind('2', proc{|x,y| $floor_canvas.scan_mark x,y}, '%x %y')
+$floor_canvas.bind('B2-Motion',
+ proc{|x,y| $floor_canvas.scan_dragto x,y}, '%x %y')
+$floor_canvas.bind('Destroy', proc{$currentRoom.unset})
+$currentRoom.value = ''
+$currentRoom.trace('w',proc{roomChanged $floor_canvas})
+
diff --git a/ext/tk/sample/demos-jp/floor2.rb b/ext/tk/sample/demos-jp/floor2.rb
new file mode 100644
index 0000000000..7ca705c7bd
--- /dev/null
+++ b/ext/tk/sample/demos-jp/floor2.rb
@@ -0,0 +1,1719 @@
+# -*- coding: utf-8 -*-
+#
+# floorDisplay widget demo 2 (called by 'widget')
+#
+
+# floorDisplay2 --
+# Recreate the floorplan display in the canvas given by "w". The
+# floor given by "active" is displayed on top with its office structure
+# visible.
+#
+# Arguments:
+# w - Name of the canvas window.
+# active - Number of active floor (1, 2, or 3).
+
+def floorDisplay2(w,active)
+ return if $activeFloor2 == active
+
+ w.delete('all')
+ $activeFloor2 = active
+
+ # First go through the three floors, displaying the backgrounds for
+ # each floor.
+
+ floor2_bg1(w,$floor2_colors['bg1'],$floor2_colors['outline1'])
+ floor2_bg2(w,$floor2_colors['bg2'],$floor2_colors['outline2'])
+ floor2_bg3(w,$floor2_colors['bg3'],$floor2_colors['outline3'])
+
+ # Raise the background for the active floor so that it's on top.
+
+ w.raise("floor#{active}")
+
+ # Create a dummy item just to mark this point in the display list,
+ # so we can insert highlights here.
+
+ w.create(TkcRectangle,0,100,1,101,'fill'=>'','outline'=>'','tags'=>'marker')
+
+ # Add the walls and labels for the active floor, along with
+ # transparent polygons that define the rooms on the floor.
+ # Make sure that the room polygons are on top.
+
+ $floorLabels2.clear
+ $floorItems2.clear
+ send("floor2_fg#{active}", w, $floor2_colors['offices'])
+ w.raise('room')
+
+ # Offset the floors diagonally from each other.
+
+ w.move('floor1', '2c', '2c')
+ w.move('floor2', '1c', '1c')
+
+ # Create items for the room entry and its label.
+ w.create(TkcWindow, 600, 100, 'anchor'=>'w', 'window'=>$floor2_entry)
+ w.create(TkcText, 600, 100, 'anchor'=>'e', 'text'=>"部屋番号: ")
+ w['scrollregion'] = w.bbox('all')
+end
+
+# newRoom2 --
+# This method is invoked whenever the mouse enters a room
+# in the floorplan. It changes tags so that the current room is
+# highlighted.
+#
+# Arguments:
+# w - The name of the canvas window.
+
+def newRoom2(w)
+ id = w.find_withtag('current')[0]
+ $currentRoom2.value = $floorLabels2[id.id] if id != ""
+ Tk.update(true)
+end
+
+# roomChanged2 --
+# This method is invoked whenever the currentRoom variable changes.
+# It highlights the current room and unhighlights any previous room.
+#
+# Arguments:
+# w - The canvas window displaying the floorplan.
+# args - Not used.
+
+def roomChanged2(w,*args)
+ w.delete('highlight')
+ item = $floorItems2[$currentRoom2.value]
+ return if item == nil
+ new = TkcPolygon.new(w, *(w.coords(item)))
+ new.configure('fill'=>$floor2_colors['active'], 'tags'=>'highlight')
+ w.raise(new, 'marker')
+end
+
+# floor2_bg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg1(w,fill,outline)
+ w.create(TkcPolygon,347,80,349,82,351,84,353,85,363,92,375,99,386,104,
+ 386,129,398,129,398,162,484,162,484,129,559,129,559,133,725,
+ 133,725,129,802,129,802,389,644,389,644,391,559,391,559,327,
+ 508,327,508,311,484,311,484,278,395,278,395,288,400,288,404,
+ 288,409,290,413,292,418,297,421,302,422,309,421,318,417,325,
+ 411,330,405,332,397,333,344,333,340,334,336,336,335,338,332,
+ 342,331,347,332,351,334,354,336,357,341,359,340,360,335,363,
+ 331,365,326,366,304,366,304,355,258,355,258,387,60,387,60,391,
+ 0,391,0,337,3,337,3,114,8,114,8,25,30,25,30,5,93,5,98,5,104,7,
+ 110,10,116,16,119,20,122,28,123,32,123,68,220,68,220,34,221,
+ 22,223,17,227,13,231,8,236,4,242,2,246,0,260,0,283,1,300,5,
+ 321,14,335,22,348,25,365,29,363,39,358,48,352,56,337,70,
+ 344,76,347,80, 'tags'=>['floor1','bg'], 'fill'=>fill)
+ w.create(TkcLine,386,129,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,258,355,258,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,0,337,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,3,114,3,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,162,398,162, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,398,162,398,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,278,484,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,327,508,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,644,391,559,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,644,389,644,391, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,129,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,802,389,802,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,3,337,0,337, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,559,391,559,327, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,802,389,644,389, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,725,133,725,129, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,8,25,8,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,8,114,3,114, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,30,25,8,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,484,278,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,30,25,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,93,5,30,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,98,5,93,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,104,7,98,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,110,10,104,7, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,116,16,110,10, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,119,20,116,16, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,122,28,119,20, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,123,32,122,28, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,123,68,123,32, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,68,123,68, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,386,129,386,104, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,386,104,375,99, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,375,99,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,353,85,363,92, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,68,220,34, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,337,70,352,56, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,352,56,358,48, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,358,48,363,39, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,363,39,365,29, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,365,29,348,25, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,348,25,335,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,22,321,14, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,321,14,300,5, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,300,5,283,1, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,283,1,260,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,260,0,246,0, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,246,0,242,2, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,242,2,236,4, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,236,4,231,8, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,231,8,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,223,17,227,13, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,221,22,223,17, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,220,34,221,22, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,340,360,335,363, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,363,331,365, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,331,365,326,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,326,366,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,304,355,304,366, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,395,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,404,288,400,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,409,290,404,288, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,413,292,409,290, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,418,297,413,292, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,302,418,297, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,422,309,421,302, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,318,422,309, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,421,318,417,325, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,417,325,411,330, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,411,330,405,332, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,405,332,397,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,397,333,344,333, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,344,333,340,334, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,340,334,336,336, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,336,336,335,338, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,335,338,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,331,347,332,342, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,332,351,331,347, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,334,354,332,351, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,336,357,334,354, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,341,359,336,357, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,341,359,340,360, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,395,288,395,278, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,304,355,258,355, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,347,80,344,76, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,344,76,337,70, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,349,82,347,80, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,351,84,349,82, 'fill'=>outline, 'tags'=>['floor1','bg'])
+ w.create(TkcLine,353,85,351,84, 'fill'=>outline, 'tags'=>['floor1','bg'])
+end
+
+# floor2_bg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg2(w,fill,outline)
+ w.create(TkcPolygon,559,129,484,129,484,162,398,162,398,129,315,129,
+ 315,133,176,133,176,129,96,129,96,133,3,133,3,339,0,339,0,391,
+ 60,391,60,387,258,387,258,329,350,329,350,311,395,311,395,280,
+ 484,280,484,311,508,311,508,327,558,327,558,391,644,391,644,
+ 367,802,367,802,129,725,129,725,133,559,133,559,129,
+ 'tags'=>['floor2','bg'], 'fill'=>fill)
+ w.create(TkcLine,350,311,350,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,129,398,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,367,802,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,129,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,725,133,725,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,133,725,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,802,367,644,367, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,644,367,644,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,644,391,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,558,327,558,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,558,327,508,327, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,280,484,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,162,484,162, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,484,280,395,280, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,395,280,395,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,133,3,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,339,0,339, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,0,339,0,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,258,329,258,387, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,395,311,350,311, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,133,315,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,3,133,96,133, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,315,133,315,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,176,133,176,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+ w.create(TkcLine,96,133,96,129, 'fill'=>outline, 'tags'=>['floor2','bg'])
+end
+
+# floor2_bg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the background information for the first
+# floor.
+#
+# Arguments:
+# w - The canvas window.
+# fill - Fill color to use for the floor's background.
+# outline - Color to use for the floor's outline.
+
+def floor2_bg3(w,fill,outline)
+ w.create(TkcPolygon,159,300,107,300,107,248,159,248,159,129,96,129,96,
+ 133,21,133,21,331,0,331,0,391,60,391,60,370,159,370,159,300,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ w.create(TkcPolygon,258,370,258,329,350,329,350,311,399,311,399,129,
+ 315,129,315,133,176,133,176,129,159,129,159,370,258,370,
+ 'tags'=>['floor3','bg'], 'fill'=>fill)
+ w.create(TkcLine,96,133,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,176,129,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,315,133,176,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,315,133,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,129,315,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,311,399,129, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,399,311,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,350,329,350,311, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,258,370,258,329, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,370,258,370, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,370,60,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,0,391,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,21,331,0,331, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,21,331,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,96,133,21,133, 'fill'=>outline, 'tags'=>['floor3','bg'])
+ w.create(TkcLine,107,300,159,300,159,248,107,248,107,300,
+ 'fill'=>outline, 'tags'=>['floor3','bg'])
+end
+
+# floor2_fg1 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the first
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg1(w,color)
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '101'
+ $floorItems2['101'] = i
+ w.create(TkcText,358,209, 'text'=>'101', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Pub Lift1'
+ $floorItems2['Pub Lift1'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Priv Lift1'
+ $floorItems2['Priv Lift1'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift1', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,42,389,42,337,1,337,1,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '110'
+ $floorItems2['110'] = i
+ w.create(TkcText,21.5,363, 'text'=>'110', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,59,389,59,385,90,385,90,337,44,337,44,389,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '109'
+ $floorItems2['109'] = i
+ w.create(TkcText,67,363, 'text'=>'109', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,300,51,253,6,253,6,300,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '111'
+ $floorItems2['111'] = i
+ w.create(TkcText,28.5,276.5, 'text'=>'111', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,98,248,98,309,79,309,79,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117B'
+ $floorItems2['117B'] = i
+ w.create(TkcText,88.5,278.5, 'text'=>'117B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,251,51,204,6,204,6,251,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '112'
+ $floorItems2['112'] = i
+ w.create(TkcText,28.5,227.5, 'text'=>'112', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,6,156,51,156,51,203,6,203,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '113'
+ $floorItems2['113'] = i
+ w.create(TkcText,28.5,179.5, 'text'=>'113', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,85,169,79,169,79,192,85,192,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117A'
+ $floorItems2['117A'] = i
+ w.create(TkcText,82,180.5, 'text'=>'117A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,77,302,77,168,53,168,53,302,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '117'
+ $floorItems2['117'] = i
+ w.create(TkcText,65,235, 'text'=>'117', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,51,155,51,115,6,115,6,155,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '114'
+ $floorItems2['114'] = i
+ w.create(TkcText,28.5,135, 'text'=>'114', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,95,115,53,115,53,168,95,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '115'
+ $floorItems2['115'] = i
+ w.create(TkcText,74,141.5, 'text'=>'115', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,87,113,87,27,10,27,10,113,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '116'
+ $floorItems2['116'] = i
+ w.create(TkcText,48.5,70, 'text'=>'116', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,89,91,128,91,128,113,89,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '118'
+ $floorItems2['118'] = i
+ w.create(TkcText,108.5,102, 'text'=>'118', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,178,128,178,132,216,132,216,91,
+ 163,91,163,112,149,112,149,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '120'
+ $floorItems2['120'] = i
+ w.create(TkcText,189.5,111.5, 'text'=>'120', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,79,193,87,193,87,169,136,169,136,192,
+ 156,192,156,169,175,169,175,246,79,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '122'
+ $floorItems2['122'] = i
+ w.create(TkcText,131,207.5, 'text'=>'122', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,169,154,169,154,191,138,191,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '121'
+ $floorItems2['121'] = i
+ w.create(TkcText,146,180, 'text'=>'121', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,99,300,126,300,126,309,99,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106A'
+ $floorItems2['106A'] = i
+ w.create(TkcText,112.5,304.5, 'text'=>'106A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,128,299,128,309,150,309,150,248,99,248,99,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '105'
+ $floorItems2['105'] = i
+ w.create(TkcText,124.5,278.5, 'text'=>'105', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,174,309,174,300,152,300,152,309,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106B'
+ $floorItems2['106B'] = i
+ w.create(TkcText,163,304.5, 'text'=>'106B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,176,299,176,309,216,309,216,248,152,248,152,299,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '104'
+ $floorItems2['104'] = i
+ w.create(TkcText,184,278.5, 'text'=>'104', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,138,385,138,337,91,337,91,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '108'
+ $floorItems2['108'] = i
+ w.create(TkcText,114.5,361, 'text'=>'108', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,256,337,140,337,140,385,256,385,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '107'
+ $floorItems2['107'] = i
+ w.create(TkcText,198,361, 'text'=>'107', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,300,353,300,329,260,329,260,353,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Smoking'
+ $floorItems2['Smoking'] = i
+ w.create(TkcText,280,341, 'text'=>'Smoking', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,314,135,314,170,306,170,306,246,177,246,177,135,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '123'
+ $floorItems2['123'] = i
+ w.create(TkcText,245.5,190.5, 'text'=>'123', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,217,248,301,248,301,326,257,326,257,310,217,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '103'
+ $floorItems2['103'] = i
+ w.create(TkcText,259,287, 'text'=>'103', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,396,188,377,188,377,169,316,169,316,131,396,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '124'
+ $floorItems2['124'] = i
+ w.create(TkcText,356,150, 'text'=>'124', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,226,407,226,407,189,377,189,377,246,397,246,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '125'
+ $floorItems2['125'] = i
+ w.create(TkcText,392,217.5, 'text'=>'125', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,399,187,409,187,409,207,474,207,474,164,399,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '126'
+ $floorItems2['126'] = i
+ w.create(TkcText,436.5,185.5, 'text'=>'126', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,409,209,409,229,399,229,399,253,
+ 486,253,486,239,474,239,474,209,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '127'
+ $floorItems2['127'] = i
+ w.create(TkcText,436.5,'231', 'text'=>'127', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,501,164,501,174,495,174,495,188,
+ 490,188,490,204,476,204,476,164,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'MShower'
+ $floorItems2['MShower'] = i
+ w.create(TkcText,488.5,'184', 'text'=>'MShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,497,176,513,176,513,204,492,204,492,190,497,190,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Closet'
+ $floorItems2['Closet'] = i
+ w.create(TkcText,502.5,190, 'text'=>'Closet', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,476,237,476,206,513,206,513,254,488,254,488,237,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'WShower'
+ $floorItems2['WShower'] = i
+ w.create(TkcText,494.5,230, 'text'=>'WShower', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,486,131,558,131,558,135,724,135,724,166,
+ 697,166,697,275,553,275,531,254,515,254,
+ 515,174,503,174,503,161,486,161,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '130'
+ $floorItems2['130'] = i
+ w.create(TkcText,638.5,205, 'text'=>'130', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,308,242,339,242,339,248,342,248,
+ 342,246,397,246,397,276,393,276,
+ 393,309,300,309,300,248,308,248,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '102'
+ $floorItems2['102'] = i
+ w.create(TkcText,367.5,278.5, 'text'=>'102', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,397,255,486,255,486,276,397,276,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '128'
+ $floorItems2['128'] = i
+ w.create(TkcText,441.5,265.5, 'text'=>'128', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,510,309,486,309,486,255,530,255,
+ 552,277,561,277,561,325,510,325,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '129'
+ $floorItems2['129'] = i
+ w.create(TkcText,535.5,293, 'text'=>'129', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,696,281,740,281,740,387,642,387,
+ 642,389,561,389,561,277,696,277,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '133'
+ $floorItems2['133'] = i
+ w.create(TkcText,628.5,335, 'text'=>'133', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,742,387,742,281,800,281,800,387,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '132'
+ $floorItems2['132'] = i
+ w.create(TkcText,771,334, 'text'=>'132', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,800,168,800,280,699,280,699,168,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '134'
+ $floorItems2['134'] = i
+ w.create(TkcText,749.5,224, 'text'=>'134', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,726,131,726,166,800,166,800,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '135'
+ $floorItems2['135'] = i
+ w.create(TkcText,763,148.5, 'text'=>'135', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,340,360,335,363,331,365,326,366,304,366,
+ 304,312,396,312,396,288,400,288,404,288,
+ 409,290,413,292,418,297,421,302,422,309,
+ 421,318,417,325,411,330,405,332,397,333,
+ 344,333,340,334,336,336,335,338,332,342,
+ 331,347,332,351,334,354,336,357,341,359,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Ramona Stair'
+ $floorItems2['Ramona Stair'] = i
+ w.create(TkcText,368,323, 'text'=>'Ramona Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,30,23,30,5,93,5,98,5,104,7,110,10,116,16,119,20,
+ 122,28,123,32,123,68,220,68,220,87,90,87,90,23,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'University Stair'
+ $floorItems2['University Stair'] = i
+ w.create(TkcText,155,77.5, 'text'=>'University Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,282,37,295,40,312,49,323,56,337,70,352,56,
+ 358,48,363,39,365,29,348,25,335,22,321,14,
+ 300,5,283,1,260,0,246,0,242,2,236,4,231,8,
+ 227,13,223,17,221,22,220,34,260,34,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Plaza Stair'
+ $floorItems2['Plaza Stair'] = i
+ w.create(TkcText,317.5,28.5, 'text'=>'Plaza Stair', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,220,34,260,34,282,37,295,40,312,49,
+ 323,56,337,70,350,83,365,94,377,100,
+ 386,104,386,128,220,128,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = 'Plaza Deck'
+ $floorItems2['Plaza Deck'] = i
+ w.create(TkcText,303,81, 'text'=>'Plaza Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,257,336,77,336,6,336,6,301,77,301,77,310,257,310,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '106'
+ $floorItems2['106'] = i
+ w.create(TkcText,131.5,318.5, 'text'=>'106', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ i = TkcPolygon.new(w,146,110,162,110,162,91,130,91,130,115,95,115,
+ 95,128,114,128,114,151,157,151,157,153,112,153,
+ 112,130,97,130,97,168,175,168,175,131,146,131,
+ 'fill'=>'', 'tags'=>['floor1','room'])
+ $floorLabels2[i.id] = '119'
+ $floorItems2['119'] = i
+ w.create(TkcText,143.5,133, 'text'=>'119', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor1','label'])
+ w.create(TkcLine,155,191,155,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,96,129,96,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,169,176,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,176,247,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,247,340,224, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,376,246,376,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,307,247,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,147,129,176,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,202,133,176,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,352,258,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,0,337,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,3,114,3,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,237,52,273, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,189,52,225, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,140,52,177, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,306,395,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,531,254,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,475,178,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,502,162,398,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,129,398,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,383,188,376,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,188,408,194, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,398,227,398,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,227,398,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,222,408,227, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,206,408,210, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,408,208,475,208, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,278,484,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,327,508,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,644,391,559,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,644,389,644,391, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,514,205,475,205, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,189,496,187, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,149,725,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,129,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,389,802,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,739,167,802,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,396,188,408,188, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,0,337,9,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,58,337,21,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,43,391,43,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,105,337,75,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,91,387,91,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,154,337,117,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,139,387,139,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,227,337,166,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,337,251,337, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,328,302,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,302,355,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,311,302,311, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,484,278,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,395,294,395,278, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,473,278,473,275, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,473,256,473,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,533,257,531,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,553,276,551,274, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,276,553,276, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,559,391,559,327, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,389,644,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,741,314,741,389, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,280,698,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,707,280,698,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,802,280,731,280, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,741,280,741,302, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,698,167,727,167, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,725,137,725,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,514,254,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,175,514,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,502,175,502,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,475,166,475,162, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,496,176,496,175, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,491,189,496,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,491,205,491,189, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,238,475,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,240,487,238, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,487,252,487,254, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,315,133,304,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,256,133,280,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,247,270,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,307,247,294,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,214,133,232,133, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,247,217,266, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,309,217,291, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,217,309,172,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,154,309,148,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,175,300,175,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,151,300,175,300, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,151,247,151,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,237,78,265, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,286,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,106,309,78,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,130,309,125,309, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,99,309,99,247, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,127,299,99,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,127,309,127,299, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,155,191,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,137,169,137,191, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,171,78,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,78,190,78,218, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,86,192,86,169, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,86,192,78,192, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,301,3,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,286,52,301, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,252,3,252, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,203,3,203, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,3,156,52,156, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,8,25,8,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,63,114,3,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,75,114,97,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,108,114,129,114, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,129,114,129,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,52,114,52,128, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,132,89,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,88,25,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,88,114,88,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,144,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,147,111,147,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,111,147,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,109,162,111, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,162,96,162,89, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,218,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,218,89,218,119, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,8,25,88,25, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,258,337,258,328, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,129,96,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,302,355,258,355, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,386,104,386,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,377,100,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,365,94,377,100, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,350,83,365,94, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,337,70,350,83, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,337,70,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,312,49,323,56, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,295,40,312,49, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,282,37,295,40, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,260,34,282,37, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,253,34,260,34, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,386,128,386,104, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,156,152, 'fill'=>color, 'tags'=>['floor1','wall'])
+ w.create(TkcLine,113,152,113,129, 'fill'=>color, 'tags'=>['floor1','wall'])
+end
+
+# floor2_fg2 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the second
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg2(w,color)
+ i = TkcPolygon.new(w,748,188,755,188,755,205,758,205,758,222,
+ 800,222,800,168,748,168,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '238'
+ $floorItems2['238'] = i
+ w.create(TkcText,774,195, 'text'=>'238', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,726,188,746,188,746,166,800,166,800,131,726,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '237'
+ $floorItems2['237'] = i
+ w.create(TkcText,763,148.5, 'text'=>'237', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,497,187,497,204,559,204,559,324,641,324,
+ 643,324,643,291,641,291,641,205,696,205,
+ 696,291,694,291,694,314,715,314,715,291,
+ 715,205,755,205,755,190,724,190,724,187,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '246'
+ $floorItems2['246'] = i
+ w.create(TkcText,600,264, 'text'=>'246', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,694,279,643,279,643,314,694,314,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '247'
+ $floorItems2['247'] = i
+ w.create(TkcText,668.5,296.5, 'text'=>'247', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,232,250,308,250,308,242,339,242,339,246,
+ 397,246,397,255,476,255,476,250,482,250,559,250,
+ 559,274,482,274,482,278,396,278,396,274,232,274,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '202'
+ $floorItems2['202'] = i
+ w.create(TkcText,285.5,260, 'text'=>'202', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,53,228,53,338,176,338,233,338,233,196,
+ 306,196,306,180,175,180,175,169,156,169,
+ 156,196,176,196,176,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '206'
+ $floorItems2['206'] = i
+ w.create(TkcText,143,267, 'text'=>'206', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,277,6,277,6,338,51,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '212'
+ $floorItems2['212'] = i
+ w.create(TkcText,28.5,307.5, 'text'=>'212', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,276,486,276,486,309,510,309,510,325,557,325,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '245'
+ $floorItems2['245'] = i
+ w.create(TkcText,521.5,300.5, 'text'=>'245', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,560,389,599,389,599,326,560,326,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '244'
+ $floorItems2['244'] = i
+ w.create(TkcText,579.5,357.5, 'text'=>'244', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,601,389,601,326,643,326,643,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '243'
+ $floorItems2['243'] = i
+ w.create(TkcText,622,357.5, 'text'=>'243', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,688,316,645,316,645,365,688,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '242'
+ $floorItems2['242'] = i
+ w.create(TkcText,666.5,340.5, 'text'=>'242', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,802,367,759,367,759,226,802,226,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Barbecue Deck'
+ $floorItems2['Barbecue Deck'] = i
+ w.create(TkcText,780.5,296.5, 'text'=>'Barbecue Deck', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,262,755,314,717,314,717,262,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '240'
+ $floorItems2['240'] = i
+ w.create(TkcText,736,288, 'text'=>'240', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,316,689,316,689,365,755,365,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '241'
+ $floorItems2['241'] = i
+ w.create(TkcText,722,340.5, 'text'=>'241', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,755,206,717,206,717,261,755,261,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '239'
+ $floorItems2['239'] = i
+ w.create(TkcText,736,233.5, 'text'=>'239', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,695,277,643,277,643,206,695,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '248'
+ $floorItems2['248'] = i
+ w.create(TkcText,669,241.5, 'text'=>'248', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,676,135,676,185,724,185,724,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '236'
+ $floorItems2['236'] = i
+ w.create(TkcText,700,160, 'text'=>'236', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,675,135,635,135,635,145,628,145,628,185,675,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '235'
+ $floorItems2['235'] = i
+ w.create(TkcText,651.5,160, 'text'=>'235', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,626,143,633,143,633,135,572,135,
+ 572,143,579,143,579,185,626,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '234'
+ $floorItems2['234'] = i
+ w.create(TkcText,606,160, 'text'=>'234', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,557,135,571,135,571,145,578,145,
+ 578,185,527,185,527,131,557,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '233'
+ $floorItems2['233'] = i
+ w.create(TkcText,552.5,158, 'text'=>'233', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,249,557,249,557,205,476,205,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '230'
+ $floorItems2['230'] = i
+ w.create(TkcText,516.5,227, 'text'=>'230', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,164,486,164,486,131,525,131,525,185,476,185,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '232'
+ $floorItems2['232'] = i
+ w.create(TkcText,500.5,158, 'text'=>'232', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,476,186,495,186,495,204,476,204,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '229'
+ $floorItems2['229'] = i
+ w.create(TkcText,485.5,195, 'text'=>'229', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,474,207,409,207,409,187,399,187,399,164,474,164,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '227'
+ $floorItems2['227'] = i
+ w.create(TkcText,436.5,185.5, 'text'=>'227', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,399,228,399,253,474,253,474,209,409,209,409,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '228'
+ $floorItems2['228'] = i
+ w.create(TkcText,436.5,231, 'text'=>'228', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,397,246,397,226,407,226,407,189,377,189,377,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '226'
+ $floorItems2['226'] = i
+ w.create(TkcText,392,217.5, 'text'=>'226', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,377,169,316,169,316,131,397,131,397,188,377,188,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '225'
+ $floorItems2['225'] = i
+ w.create(TkcText,356.5,150, 'text'=>'225', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,198,306,198,306,249,234,249,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '224'
+ $floorItems2['224'] = i
+ w.create(TkcText,270,223.5, 'text'=>'224', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,270,179,306,179,306,170,314,170,314,135,270,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '223'
+ $floorItems2['223'] = i
+ w.create(TkcText,292,157, 'text'=>'223', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,268,179,221,179,221,135,268,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '222'
+ $floorItems2['222'] = i
+ w.create(TkcText,244.5,157, 'text'=>'222', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,177,179,219,179,219,135,177,135,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '221'
+ $floorItems2['221'] = i
+ w.create(TkcText,198,157, 'text'=>'221', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,299,327,349,327,349,284,341,284,341,276,299,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '204'
+ $floorItems2['204'] = i
+ w.create(TkcText,324,301.5, 'text'=>'204', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,234,276,297,276,297,327,257,327,257,338,234,338,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '205'
+ $floorItems2['205'] = i
+ w.create(TkcText,265.5,307, 'text'=>'205', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,256,385,256,340,212,340,212,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '207'
+ $floorItems2['207'] = i
+ w.create(TkcText,234,362.5, 'text'=>'207', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,210,340,164,340,164,385,210,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '208'
+ $floorItems2['208'] = i
+ w.create(TkcText,187,362.5, 'text'=>'208', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,115,340,162,340,162,385,115,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '209'
+ $floorItems2['209'] = i
+ w.create(TkcText,138.5,362.5, 'text'=>'209', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,228,89,156,53,156,53,228,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '217'
+ $floorItems2['217'] = i
+ w.create(TkcText,71,192, 'text'=>'217', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,169,97,169,97,190,89,190,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '217A'
+ $floorItems2['217A'] = i
+ w.create(TkcText,93,179.5, 'text'=>'217A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,89,156,89,168,95,168,95,135,53,135,53,156,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '216'
+ $floorItems2['216'] = i
+ w.create(TkcText,71,145.5, 'text'=>'216', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,179,51,135,6,135,6,179,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '215'
+ $floorItems2['215'] = i
+ w.create(TkcText,28.5,157, 'text'=>'215', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,227,6,227,6,180,51,180,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '214'
+ $floorItems2['214'] = i
+ w.create(TkcText,28.5,203.5, 'text'=>'214', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,51,275,6,275,6,229,51,229,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '213'
+ $floorItems2['213'] = i
+ w.create(TkcText,28.5,252, 'text'=>'213', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,114,340,67,340,67,385,114,385,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '210'
+ $floorItems2['210'] = i
+ w.create(TkcText,90.5,362.5, 'text'=>'210', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,59,389,59,385,65,385,65,340,1,340,1,389,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '211'
+ $floorItems2['211'] = i
+ w.create(TkcText,33,364.5, 'text'=>'211', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,393,309,350,309,350,282,342,282,342,276,393,276,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '203'
+ $floorItems2['203'] = i
+ w.create(TkcText,367.5,292.5, 'text'=>'203', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,99,191,91,191,91,226,174,226,174,198,
+ 154,198,154,192,109,192,109,169,99,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '220'
+ $floorItems2['220'] = i
+ w.create(TkcText,132.5,208.5, 'text'=>'220', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Priv Lift2'
+ $floorItems2['Priv Lift2'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = 'Pub Lift 2'
+ $floorItems2['Pub Lift 2'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift 2', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '218'
+ $floorItems2['218'] = i
+ w.create(TkcText,136,149.5, 'text'=>'218', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '219'
+ $floorItems2['219'] = i
+ w.create(TkcText,132.5,180, 'text'=>'219', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor2','room'])
+ $floorLabels2[i.id] = '201'
+ $floorItems2['201'] = i
+ w.create(TkcText,358,209, 'text'=>'201', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor2','label'])
+ w.create(TkcLine,641,186,678,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,350,757,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,634,133,634,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,634,144,627,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,572,133,572,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,572,144,579,144, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,129,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,174,197,175,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,175,197,175,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,206,757,221, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,396,188,408,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,727,189,725,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,747,167,802,167, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,747,167,747,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,755,189,739,189, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,769,224,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,802,224,802,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,802,129,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,189,725,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,186,690,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,676,133,676,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,627,144,627,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,629,186,593,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,579,144,579,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,559,129,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,725,133,559,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,162,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,559,129,484,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,526,129,526,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,540,186,581,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,528,186,523,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,511,186,475,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,496,190,496,186, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,496,205,496,202, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,205,527,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,205,539,205, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,205,558,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,249,475,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,662,206,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,206,675,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,278,642,278, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,642,291,642,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,695,291,695,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,208,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,206,716,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,221,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,793,224,802,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,262,716,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,220,716,264, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,716,315,716,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,315,703,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,325,757,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,757,367,644,367, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,689,367,689,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,647,315,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,659,315,691,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,600,325,600,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,627,325,644,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,644,391,644,315, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,615,325,575,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,644,391,558,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,563,325,558,325, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,391,558,314, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,327,508,327, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,275,484,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,558,302,558,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,508,327,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,311,508,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,275,484,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,208,408,208, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,206,408,210, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,222,408,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,227,398,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,227,398,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,408,188,408,194, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,383,188,376,188, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,188,398,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,162,484,162, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,475,162,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,254,475,254, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,484,280,395,280, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,395,311,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,197,293,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,278,197,233,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,233,197,233,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,179,284,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,233,249,278,249, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,269,179,269,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,220,179,220,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,191,110,191, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,90,190,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,98,169,98,190, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,133,52,165, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,214,52,177, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,226,52,262, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,274,52,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,234,275,234,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,226,339,258,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,211,387,211,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,214,339,177,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,258,387,60,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,3,133,3,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,165,339,129,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,117,339,80,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,68,339,59,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,0,339,46,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,0,339,0,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,60,387,60,391, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,258,329,258,387, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,395,311,350,311, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,398,129,315,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,133,315,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,3,133,96,133, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,66,387,66,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,115,387,115,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,163,387,163,339, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,234,275,276,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,288,275,309,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,298,275,298,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,341,283,350,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,321,275,341,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,375,275,395,275, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,307,250,307,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,376,245,376,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,245,340,224, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,293,250,307,250, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,271,179,238,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,226,179,195,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,176,129,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,182,179,176,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,174,169,176,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,162,169,90,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,96,169,96,129, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,175,227,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,90,190,90,227, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,179,3,179, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,228,3,228, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,52,276,3,276, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,110,191,110,169, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,155,189,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,350,283,350,329, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor2','wall'])
+ w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor2','wall'])
+end
+
+# floor2_fg3 --
+# This method represents part of the floorplan database. When
+# invoked, it instantiates the foreground information for the third
+# floor (office outlines and numbers).
+#
+# Arguments:
+# w - The canvas window.
+# color - Color to use for drawing foreground information.
+
+def floor2_fg3(w,color)
+ i = TkcPolygon.new(w,89,228,89,180,70,180,70,228,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316'
+ $floorItems2['316'] = i
+ w.create(TkcText,79.5,204, 'text'=>'316', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,115,368,162,368,162,323,115,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '309'
+ $floorItems2['309'] = i
+ w.create(TkcText,138.5,345.5, 'text'=>'309', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,164,323,164,368,211,368,211,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '308'
+ $floorItems2['308'] = i
+ w.create(TkcText,187.5,345.5, 'text'=>'308', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,256,368,212,368,212,323,256,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '307'
+ $floorItems2['307'] = i
+ w.create(TkcText,234,345.5, 'text'=>'307', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,244,276,297,276,297,327,260,327,260,321,244,321,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '305'
+ $floorItems2['305'] = i
+ w.create(TkcText,270.5,301.5, 'text'=>'305', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,219,251,203,244,203,244,219,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324B'
+ $floorItems2['324B'] = i
+ w.create(TkcText,247.5,211, 'text'=>'324B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,251,249,244,249,244,232,251,232,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324A'
+ $floorItems2['324A'] = i
+ w.create(TkcText,247.5,240.5, 'text'=>'324A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,223,135,223,179,177,179,177,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '320'
+ $floorItems2['320'] = i
+ w.create(TkcText,200,157, 'text'=>'320', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,114,368,114,323,67,323,67,368,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '310'
+ $floorItems2['310'] = i
+ w.create(TkcText,90.5,345.5, 'text'=>'310', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,277,23,321,68,321,68,277,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '312'
+ $floorItems2['312'] = i
+ w.create(TkcText,45.5,299, 'text'=>'312', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,23,229,68,229,68,275,23,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '313'
+ $floorItems2['313'] = i
+ w.create(TkcText,45.5,252, 'text'=>'313', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,68,227,23,227,23,180,68,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '314'
+ $floorItems2['314'] = i
+ w.create(TkcText,40.5,203.5, 'text'=>'314', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,95,179,95,135,23,135,23,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '315'
+ $floorItems2['315'] = i
+ w.create(TkcText,59,157, 'text'=>'315', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,99,226,99,204,91,204,91,226,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316B'
+ $floorItems2['316B'] = i
+ w.create(TkcText,95,215, 'text'=>'316B', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,91,202,99,202,99,180,91,180,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '316A'
+ $floorItems2['316A'] = i
+ w.create(TkcText,95,191, 'text'=>'316A', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,97,169,109,169,109,192,154,192,154,198,
+ 174,198,174,226,101,226,101,179,97,179,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '319'
+ $floorItems2['319'] = i
+ w.create(TkcText,141.5,209, 'text'=>'319', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,65,368,58,368,58,389,1,389,1,333,23,333,23,323,65,323,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '311'
+ $floorItems2['311'] = i
+ w.create(TkcText,29.5,361, 'text'=>'311', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,154,191,111,191,111,169,154,169,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '318'
+ $floorItems2['318'] = i
+ w.create(TkcText,132.5,180, 'text'=>'318', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,175,168,97,168,97,131,175,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '317'
+ $floorItems2['317'] = i
+ w.create(TkcText,136,149.5, 'text'=>'317', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,274,194,274,221,306,221,306,194,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '323'
+ $floorItems2['323'] = i
+ w.create(TkcText,290,207.5, 'text'=>'323', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,306,222,274,222,274,249,306,249,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '325'
+ $floorItems2['325'] = i
+ w.create(TkcText,290,235.5, 'text'=>'325', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,263,179,224,179,224,135,263,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '321'
+ $floorItems2['321'] = i
+ w.create(TkcText,243.5,157, 'text'=>'321', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,314,169,306,169,306,192,273,192,
+ 264,181,264,135,314,135,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '322'
+ $floorItems2['322'] = i
+ w.create(TkcText,293.5,163.5, 'text'=>'322', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,307,240,339,240,339,206,307,206,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = 'Pub Lift3'
+ $floorItems2['Pub Lift3'] = i
+ w.create(TkcText,323,223, 'text'=>'Pub Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,339,205,307,205,307,171,339,171,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = 'Priv Lift3'
+ $floorItems2['Priv Lift3'] = i
+ w.create(TkcText,323,188, 'text'=>'Priv Lift3', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,350,284,376,284,376,276,397,276,397,309,350,309,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '303'
+ $floorItems2['303'] = i
+ w.create(TkcText,373.5,292.5, 'text'=>'303', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,272,203,272,249,252,249,252,230,
+ 244,230,244,221,252,221,252,203,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '324'
+ $floorItems2['324'] = i
+ w.create(TkcText,262,226, 'text'=>'324', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,299,276,299,327,349,327,349,284,341,284,341,276,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '304'
+ $floorItems2['304'] = i
+ w.create(TkcText,324,301.5, 'text'=>'304', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,375,246,375,172,341,172,341,246,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '301'
+ $floorItems2['301'] = i
+ w.create(TkcText,358,209, 'text'=>'301', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,397,246,377,246,377,185,397,185,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '327'
+ $floorItems2['327'] = i
+ w.create(TkcText,387,215.5, 'text'=>'327', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,316,131,316,169,377,169,377,185,397,185,397,131,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '326'
+ $floorItems2['326'] = i
+ w.create(TkcText,365.5,150, 'text'=>'326', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,308,251,242,251,242,274,342,274,342,282,375, 282,
+ 375,274,397,274,397,248,339,248,339,242,308,242,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '302'
+ $floorItems2['302'] = i
+ w.create(TkcText,319.5,261, 'text'=>'302', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ i = TkcPolygon.new(w,70,321,242,321,242,200,259,200,259,203,272,203,
+ 272,193,263,180,242,180,175,180,175,169,156,169,
+ 156,196,177,196,177,228,107,228,70,228,70,275,107,275,
+ 107,248,160,248,160,301,107,301,107,275,70,275,
+ 'fill'=>'', 'tags'=>['floor3','room'])
+ $floorLabels2[i.id] = '306'
+ $floorItems2['306'] = i
+ w.create(TkcText,200.5,284.5, 'text'=>'306', 'fill'=>color,
+ 'anchor'=>'c', 'tags'=>['floor3','label'])
+ w.create(TkcLine,341,275,341,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,162,197,155,197, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,396,247,399,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,129,399,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,202,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,350,283,350,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,251,231,243,231, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,220,251,220, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,250,243,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,197,155,190, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,110,192,110,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,192,110,192, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,155,177,155,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,197,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,280,69,274, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,276,69,276, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,262,69,226, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,228,69,228, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,179,75,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,69,179,69,214, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,220,90,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,204,90,202, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,203,100,203, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,187,90,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,90,227,176,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,100,179,100,227, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,100,179,87,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,96,179,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,162,169,96,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,173,169,176,169, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,182,179,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,129,176,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,195,179,226,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,224,133,224,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,264,179,264,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,238,179,264,179, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,207,273,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,235,273,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,224,273,219, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,193,307,193, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,222,307,222, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,384,247,376,247, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,206,307,206, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,187,340,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,210,340,201, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,247,340,224, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,340,241,307,241, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,247,376,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,307,250,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,170,307,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,129,315,170, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,283,366,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,376,283,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,275,376,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,341,275,320,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,341,283,350,283, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,298,275,298,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,308,275,298,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,322,243,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,243,275,284,275, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,322,226,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,212,370,212,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,214,322,177,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,163,370,163,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,165,322,129,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,84,322,117,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,71,322,64,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,115,322,115,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,66,322,66,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,52,322,21,322, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,331,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,21,331,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,96,133,21,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,176,129,96,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,133,176,133, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,315,129,399,129, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,399,311,350,311, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,350,329,258,329, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,322,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,370,258,370, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,370,60,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,0,391,0,331, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,60,391,0,391, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,307,250,307,242, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,273,250,307,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+ w.create(TkcLine,258,250,243,250, 'fill'=>color, 'tags'=>['floor3','wall'])
+end
+
+# Below is the "main program" that creates the floorplan demonstration.
+
+# toplevel widget が存在すれば削除する
+if defined?($floor2_demo) && $floor2_demo
+ $floor2_demo.destroy
+ $floor2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$floor2_demo = TkToplevel.new {|w|
+ title("Floorplan Canvas Demonstration 2")
+ iconname("Floorplan2")
+ positionWindow(w)
+ geometry('+20+20')
+ minsize(100,100)
+}
+
+base_frame = TkFrame.new($floor2_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
+ 'text'=>"このウィンドウにはディジタルエクイップメント社のウェスタンリサーチラボラトリ (DECWRL) の間取りが書かれたキャンバス widget が入っています。これは 3階建てで、常にそのうちの1階分が選択、つまりその間取りが表示されるようになっています。ある階を選択するには、その上でマウスの左ボタンをクリックしてください。マウスが選択されている階の上を動くと、その下にある部屋の色が変わり、部屋番号が「部屋番号:」エントリに表示されます。また、エントリに部屋番号を書くとその部屋の色が変わります。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$floor2_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $floor2_demo
+ $floor2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'floor2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$floor2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# 変数設定
+$floorLabels2 = {}
+$floorItems2 = {}
+
+# canvas 設定
+if $tk_version =~ /^4\.[01]/
+ $floor2_canvas_frame = TkFrame.new(base_frame,'bd'=>2,'relief'=>'sunken',
+ 'highlightthickness'=>2)
+ $floor2_canvas = TkCanvas.new($floor2_canvas_frame,
+ 'width'=>900, 'height'=>500, 'borderwidth'=>0,
+ 'highlightthickness'=>0) {|c|
+ TkScrollbar.new(base_frame, 'orient'=>'horiz',
+ 'command'=>proc{|*args| c.xview(*args)}){|hs|
+ c.xscrollcommand(proc{|first,last| hs.set first,last})
+ pack('side'=>'bottom', 'fill'=>'x')
+ }
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| c.yview(*args)}){|vs|
+ c.yscrollcommand(proc{|first,last| vs.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ }
+ $floor2_canvas_frame.pack('side'=>'top','fill'=>'both', 'expand'=>'yes')
+ $floor2_canvas.pack('expand'=>'yes', 'fill'=>'both')
+
+else
+ TkFrame.new(base_frame) {|f|
+ pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+ h = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'horizontal')
+ v = TkScrollbar.new(f, 'highlightthickness'=>0, 'orient'=>'vertical')
+
+ TkFrame.new(f, 'bd'=>2, 'relief'=>'sunken') {|f1|
+ $floor2_canvas = TkCanvas.new(f1, 'width'=>900, 'height'=>500,
+ 'borderwidth'=>0,
+ 'highlightthickness'=>0) {
+ xscrollcommand(proc{|first,last| h.set first,last})
+ yscrollcommand(proc{|first,last| v.set first,last})
+ pack('expand'=>'yes', 'fill'=>'both')
+ }
+ grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ }
+
+ v.grid('padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ h.grid('padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ v.command(proc{|*args| $floor2_canvas.yview(*args)})
+ h.command(proc{|*args| $floor2_canvas.xview(*args)})
+ }
+end
+
+# Create an entry for displaying and typing in current room.
+
+$currentRoom2 = TkVariable.new
+$floor2_entry = TkEntry.new($floor2_canvas, 'width'=>10, 'relief'=>'sunken',
+ 'bd'=>2, 'textvariable'=>$currentRoom2)
+
+# Choose colors, then fill in the floorplan.
+
+$floor2_colors = {}
+if TkWinfo.depth($floor2_canvas) > 1
+ $floor2_colors['bg1'] = '#a9c1da'
+ $floor2_colors['outline1'] = '#77889a'
+ $floor2_colors['bg2'] = '#9ab0c6'
+ $floor2_colors['outline2'] = '#687786'
+ $floor2_colors['bg3'] = '#8ba0b3'
+ $floor2_colors['outline3'] = '#596673'
+ $floor2_colors['offices'] = 'Black'
+ $floor2_colors['active'] = '#c4d1df'
+else
+ $floor2_colors['bg1'] = 'white'
+ $floor2_colors['outline1'] = 'black'
+ $floor2_colors['bg2'] = 'white'
+ $floor2_colors['outline2'] = 'black'
+ $floor2_colors['bg3'] = 'white'
+ $floor2_colors['outline3'] = 'black'
+ $floor2_colors['offices'] = 'Black'
+ $floor2_colors['active'] = 'black'
+end
+
+$activeFloor2 = ''
+floorDisplay2 $floor2_canvas,3
+
+# Set up event bindings for canvas:
+
+$floor2_canvas.itembind('floor1', '1', proc{floorDisplay2 $floor2_canvas,1})
+$floor2_canvas.itembind('floor2', '1', proc{floorDisplay2 $floor2_canvas,2})
+$floor2_canvas.itembind('floor3', '1', proc{floorDisplay2 $floor2_canvas,3})
+$floor2_canvas.itembind('room', 'Enter', proc{newRoom2 $floor2_canvas})
+$floor2_canvas.itembind('room', 'Leave', proc{$currentRoom2.value = ''})
+$floor2_canvas.bind('2', proc{|x,y| $floor2_canvas.scan_mark x,y}, '%x %y')
+$floor2_canvas.bind('B2-Motion',
+ proc{|x,y| $floor2_canvas.scan_dragto x,y}, '%x %y')
+$floor2_canvas.bind('Destroy', proc{$currentRoom2.unset})
+$currentRoom2.value = ''
+$currentRoom2.trace('w',proc{roomChanged2 $floor2_canvas})
diff --git a/ext/tk/sample/demos-jp/form.rb b/ext/tk/sample/demos-jp/form.rb
new file mode 100644
index 0000000000..000fcb5091
--- /dev/null
+++ b/ext/tk/sample/demos-jp/form.rb
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+#
+# form widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($form_demo) && $form_demo
+ $form_demo.destroy
+ $form_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$form_demo = TkToplevel.new {|w|
+ title("Form Demonstration")
+ iconname("form")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($form_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "このウィンドウは簡単なフォーム入力用になっていて、さまざまなエントリに入力ができます。タブでエントリの切替えができます。"
+}
+msg.pack('side'=>'top', 'fill'=>'x')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $form_demo
+ $form_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'form'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# entry 生成
+form_data = []
+(1..5).each{|i|
+ f = TkFrame.new(base_frame, 'bd'=>2)
+ e = TkEntry.new(f, 'relief'=>'sunken', 'width'=>40)
+ l = TkLabel.new(f)
+ e.pack('side'=>'right')
+ l.pack('side'=>'left')
+ form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l}
+}
+
+# 文字列設定
+form_data[1]['label'].text('名前:')
+form_data[2]['label'].text('住所:')
+form_data[5]['label'].text('電話:')
+
+# pack
+(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')}
+
diff --git a/ext/tk/sample/demos-jp/goldberg.rb b/ext/tk/sample/demos-jp/goldberg.rb
new file mode 100644
index 0000000000..fc38d877db
--- /dev/null
+++ b/ext/tk/sample/demos-jp/goldberg.rb
@@ -0,0 +1,2011 @@
+# -*- coding: utf-8 -*-
+#
+# Ruby/Tk Goldverg demo (called by 'widget')
+#
+# Based on Tcl/Tk8.5a2 widget demos.
+# The following is the original comment of TkGoldberg.tcl.
+#
+#>>##+#################################################################
+#>>#
+#>># TkGoldberg.tcl
+#>># by Keith Vetter, March 13, 2003
+#>>#
+#>># "Man will always find a difficult means to perform a simple task"
+#>># Rube Goldberg
+#>>#
+#>># Reproduced here with permission.
+#>>#
+#>>##+#################################################################
+#>>#
+#>># Keith Vetter 2003-03-21: this started out as a simple little program
+#>># but was so much fun that it grew and grew. So I apologize about the
+#>># size but I just couldn't resist sharing it.
+#>>#
+#>># This is a whizzlet that does a Rube Goldberg type animation, the
+#>># design of which comes from an New Years e-card from IncrediMail.
+#>># That version had nice sound effects which I eschewed. On the other
+#>># hand, that version was in black and white (actually dark blue and
+#>># light blue) and this one is fully colorized.
+#>>#
+#>># One thing I learned from this project is that drawing filled complex
+#>># objects on a canvas is really hard. More often than not I had to
+#>># draw each item twice--once with the desired fill color but no
+#>># outline, and once with no fill but with the outline. Another trick
+#>># is erasing by drawing with the background color. Having a flood fill
+#>># command would have been extremely helpful.
+#>>#
+#>># Two wiki pages were extremely helpful: Drawing rounded rectangles
+#>># which I generalized into Drawing rounded polygons, and regular
+#>># polygons which allowed me to convert ovals and arcs into polygons
+#>># which could then be rotated (see Canvas Rotation). I also wrote
+#>># Named Colors to aid in the color selection.
+#>>#
+#>># I could comment on the code, but it's just 26 state machines with
+#>># lots of canvas create and move calls.
+
+if defined?($goldberg_demo) && $goldberg_demo
+ $goldberg_demo.destroy
+ $goldberg_demo = nil
+end
+
+# demo toplevel widget
+$goldberg_demo = TkToplevel.new {|w|
+ title("Tk Goldberg (demonstration)")
+ iconname("goldberg")
+# positionWindow(w)
+}
+
+base_frame = TkFrame.new($goldberg_demo).pack(:fill=>:both, :expand=>true)
+
+=begin
+# label
+msg = TkLabel.new($goldberg_demo) {
+ font 'Arial 10'
+ wraplength '4i'
+ justify 'left'
+ text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\n\"Man will always find a difficult means to perform a simple task\"\n - Rube Goldberg"
+}
+msg.pack('side'=>'top')
+=end
+
+=begin
+# frame
+TkFrame.new($goldberg_demo) {|frame|
+ TkButton.new(frame) {
+ text '閉じる'
+ command proc{
+ tmppath = $goldberg_demo
+ $goldberg_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'goldberg'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+=end
+
+#########################################
+
+class TkGoldberg_Demo
+ def initialize(parent)
+ @parent = parent
+
+ @S = {}
+ @S['title'] = 'Tk Goldberg'
+ @S['speed'] = TkVariable.new(5)
+ @S['cnt'] = TkVariable.new(0)
+ # @S['message'] = TkVariable.new("\\nWelcome\\nto\\nRuby/Tk")
+ @S['message'] = TkVariable.new("\\n ようこそ!\\nRuby/Tk\\nの\\n世界へ")
+ @S['pause'] = TkVariable.new
+ @S['details'] = TkVariable.new(true)
+
+ @S['mode'] = TkVariable.new(:MSTART, :symbol)
+ # :MSTART, :MGO, :MPAUSE, :MSSTEP, :MBSTEP, :MDONE, :MDEBUG
+
+ # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
+ @speed = [1, 10, 20, 50, 80, 100, 150, 200, 300, 400, 500]
+
+ # colors
+ @C = {}
+ @C['fg'] = 'black'
+ # @C['bg'] = 'gray75'
+ @C['bg'] = 'cornflowerblue'
+
+ @C['0'] = 'white'; @C['1a'] = 'darkgreen'; @C['1b'] = 'yellow'
+ @C['2'] = 'red'; @C['3a'] = 'green'; @C['3b'] = 'darkblue'
+ @C['4'] = @C['fg']; @C['5a'] = 'brown'; @C['5b'] = 'white'
+ @C['6'] = 'magenta'; @C['7'] = 'green'; @C['8'] = @C['fg']
+ @C['9'] = 'blue4'; @C['10a'] = 'white'; @C['10b'] = 'cyan'
+ @C['11a'] = 'yellow'; @C['11b'] = 'mediumblue'; @C['12'] = 'tan2'
+ @C['13a'] = 'yellow'; @C['13b'] = 'red'; @C['14'] = 'white'
+ @C['15a'] = 'green'; @C['15b'] = 'yellow'; @C['16'] = 'gray65'
+ @C['17'] = '#A65353'; @C['18'] = @C['fg']; @C['19'] = 'gray50'
+ @C['20'] = 'cyan'; @C['21'] = 'gray65'; @C['22'] = @C['20']
+ @C['23a'] = 'blue'; @C['23b'] = 'red'; @C['23c'] = 'yellow'
+ @C['24a'] = 'red'; @C['24b'] = 'white';
+
+ @STEP = TkVariable.new_hash
+ @STEP.default_value_type = :numeric
+
+ @XY = {}
+
+ @XY6 = {
+ '-1'=>[366, 207], '-2'=>[349, 204], '-3'=>[359, 193], '-4'=>[375, 192],
+ '-5'=>[340, 190], '-6'=>[349, 177], '-7'=>[366, 177], '-8'=>[380, 176],
+ '-9'=>[332, 172], '-10'=>[342, 161], '-11'=>[357, 164],
+ '-12'=>[372, 163], '-13'=>[381, 149], '-14'=>[364, 151],
+ '-15'=>[349, 146], '-16'=>[333, 148], '0'=>[357, 219],
+ '1'=>[359, 261], '2'=>[359, 291], '3'=>[359, 318], '4'=>[361, 324],
+ '5'=>[365, 329], '6'=>[367, 334], '7'=>[367, 340], '8'=>[366, 346],
+ '9'=>[364, 350], '10'=>[361, 355], '11'=>[359, 370], '12'=>[359, 391],
+ '13,0'=>[360, 456], '13,1'=>[376, 456], '13,2'=>[346, 456],
+ '13,3'=>[330, 456], '13,4'=>[353, 444], '13,5'=>[368, 443],
+ '13,6'=>[339, 442], '13,7'=>[359, 431], '13,8'=>[380, 437],
+ '13,9'=>[345, 428], '13,10'=>[328, 434], '13,11'=>[373, 424],
+ '13,12'=>[331, 420], '13,13'=>[360, 417], '13,14'=>[345, 412],
+ '13,15'=>[376, 410], '13,16'=>[360, 403]
+ }
+
+ @timer = TkTimer.new(@speed[@S['speed'].numeric]){|timer|
+ timer.set_interval(go)
+ }
+
+ do_display
+ reset
+
+ # Start everything going
+ @timer.start
+ end
+
+ def do_display()
+ @ctrl = TkFrame.new(@parent, :relief=>:ridge, :bd=>2, :padx=>5, :pady=>5)
+ @screen = TkFrame.new(@parent, :bd=>2,
+ :relief=>:raised).pack(:side=>:left, :fill=>:both,
+ :expand=>true)
+
+ @canvas = TkCanvas.new(@parent, :width=>850, :height=>700,
+ :bg=>@C['bg'], :highlightthickness=>0){
+ scrollregion([0, 0, 1000, 1000]) # Kludge to move everything up
+ yview_moveto(0.05)
+ }.pack(:in=>@screen, :side=>:top, :fill=>:both, :expand=>true)
+
+ @canvas.bind('3'){ @pause.invoke }
+ @canvas.bind('Destroy'){ @timer.stop }
+
+ do_ctrl_frame
+ do_detail_frame
+
+ # msg = TkLabel.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ msg = Tk::Label.new(@parent, :bg=>@C['bg'], :fg=>'white') {
+ font 'Arial 10'
+ wraplength 600
+ justify 'left'
+ text "これは、あなたが自分のアニメーションをいかに入り組んだものにできるかを示すというだけのためのデモです。ボールをクリックすれば物が動き始めます!\n\"Man will always find a difficult means to perform a simple task\" - Rube Goldberg"
+ }
+ msg.place(:in=>@canvas, :relx=>0, :rely=>0, :anchor=>:nw)
+
+ frame = TkFrame.new(@parent, :bg=>@C['bg'])
+
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ text '閉じる'
+ command proc{
+ tmppath = $goldberg_demo
+ $goldberg_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left')
+
+ # TkButton.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ Tk::Button.new(frame, :bg=>@C['bg'], :activebackground=>@C['bg']) {
+ text 'コード参照'
+ command proc{showCode 'goldberg'}
+ }.pack('side'=>'left', 'padx'=>5)
+
+ # @show = TkButton.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ @show = Tk::Button.new(frame, :text=>'>>', :command=>proc{show_ctrl},
+ :bg=>@C['bg'], :activebackground=>@C['bg'])
+ @show.pack('side'=>'left')
+ frame.place(:in=>@canvas, :relx=>1, :rely=>0, :anchor=>:ne)
+
+ Tk.update
+ end
+
+ def do_ctrl_frame
+ @start = Tk::Button.new(@parent, :text=>'Start', :bd=>6,
+ :command=>proc{do_button(0)})
+ if font = @start['font']
+ @start.font(font.weight('bold'))
+ end
+
+ @pause = TkCheckbutton.new(@parent, :text=>'Pause', :font=>font,
+ :command=>proc{do_button(1)}, :relief=>:raised,
+ :variable=>@S['pause'])
+
+ @step = TkButton.new(@parent, :text=>'Single Step', :font=>font,
+ :command=>proc{do_button(2)})
+ @bstep = TkButton.new(@parent, :text=>'Big Step', :font=>font,
+ :command=>proc{do_button(4)})
+ @reset = TkButton.new(@parent, :text=>'Reset', :font=>font,
+ :command=>proc{do_button(3)})
+
+ @details = TkFrame.new(@parent, :bd=>2, :relief=>:ridge)
+ @detail = TkCheckbutton.new(@parent, :text=>'Details', :font=>font,
+ :relief=>:raised, :variable=>@S['details'])
+
+ @msg_entry = TkEntry.new(@parent, :textvariable=>@S['message'],
+ :justify=>:center)
+ @speed_scale = TkScale.new(@parent, :orient=>:horizontal,
+ :from=>1, :to=>10, :font=>font,
+ :variable=>@S['speed'], :bd=>2,
+ :relief=>:ridge, :showvalue=>false)
+ @about = TkButton.new(@parent, :text=>'About',
+ :command=>proc{about}, :font=>font)
+
+ Tk.grid(@start, :in=>@ctrl, :row=>0, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(1, :minsize=>10)
+ Tk.grid(@pause, :in=>@ctrl, :row=>2, :sticky=>:ew)
+ Tk.grid(@step, :in=>@ctrl, :sticky=>:ew)
+ Tk.grid(@bstep, :in=>@ctrl, :sticky=>:ew)
+ Tk.grid(@reset, :in=>@ctrl, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(10, :minsize=>20)
+ Tk.grid(@details, :in=>@ctrl, :row=>11, :sticky=>:ew)
+ Tk.grid(@detail, :in=>@details, :row=>0, :sticky=>:ew)
+ @ctrl.grid_rowconfigure(50, :weight=>1)
+
+ @S['mode'].trace('w', proc{|*args| active_GUI(*args)})
+ @S['details'].trace('w', proc{|*args| active_GUI(*args)})
+ @S['speed'].trace('w', proc{|*args| active_GUI(*args)})
+
+ Tk.grid(@msg_entry, :in=>@ctrl, :row=>98, :sticky=>:ew, :pady=>5)
+ Tk.grid(@speed_scale, :in=>@ctrl, :row=>99, :sticky=>:ew)
+ Tk.grid(@about, :in=>@ctrl, :row=>100, :sticky=>:ew)
+
+ @reset.bind('3'){@S['mode'].value = -1} # Debugging
+ end
+
+ def do_detail_frame
+ @f_details = TkFrame.new(@details)
+
+ @label = TkLabel.new(@f_details, :textvariable=>@S['cnt'],
+ :bd=>1, :relief=>:solid, :bg=>'white')
+ Tk.grid(@label, '-', '-', '-', :sticky=>:ew, :row=>0)
+
+ idx = 1
+ loop {
+ break unless respond_to?("move#{idx}")
+ l = TkLabel.new(@f_details, :text=>idx, :anchor=>:e,
+ :width=>2, :bd=>1, :relief=>:solid, :bg=>'white')
+ @STEP[idx] = 0
+ ll = TkLabel.new(@f_details, :textvariable=>@STEP.ref(idx),
+ :width=>5, :bd=>1, :relief=>:solid, :bg=>'white')
+ row = (idx + 1)/2
+ col = ((idx + 1) & 1) * 2
+ Tk.grid(l, :sticky=>:ew, :row=>row, :column=>col)
+ Tk.grid(ll, :sticky=>:ew, :row=>row, :column=>(col + 1))
+ idx += 1
+ }
+ @f_details.grid_columnconfigure(1, :weight=>1)
+ end
+
+ def show_ctrl
+ if @ctrl.winfo_mapped?
+ @ctrl.pack_forget
+ @show.text('>>')
+ else
+ @ctrl.pack(:side=>:right, :fill=>:both, :ipady=>5)
+ @show.text('<<')
+ end
+ end
+
+ def draw_all
+ reset_step
+ @canvas.delete(:all)
+ idx = 0
+ loop{
+ m = "draw#{idx}"
+ break unless respond_to?(m)
+ send(m)
+ idx += 1
+ }
+ end
+
+ def active_GUI(var1, var2, op)
+ st = {false=>:disabled, true=>:normal}
+
+ m = @S['mode'].to_sym
+ @S['pause'].value = (m == :MPAUSE)
+ @start.state(st[m != :MGO])
+ @pause.state(st[m != :MSTART && m != :MDONE])
+ @step.state(st[m != :MGO && m != :MDONE])
+ @bstep.state(st[m != :MGO && m != :MDONE])
+ @reset.state(st[m != :MSTART])
+
+ if @S['details'].bool
+ Tk.grid(@f_details, :in=>@details, :row=>2, :sticky=>:ew)
+ else
+ Tk.grid_forget(@f_details)
+ end
+ @speed_scale.label("Speed: #{@S['speed'].value}")
+ end
+
+ def start
+ @S['mode'].value = :MGO
+ end
+
+ def do_button(what)
+ case what
+ when 0 # Start
+ reset if @S['mode'].to_sym == :MDONE
+ @S['mode'].value = :MGO
+
+ when 1 # Pause
+ @S['mode'].value = ((@S['pause'].bool)? :MPAUSE: :MGO)
+
+ when 2 # Step
+ @S['mode'].value = :MSSTEP
+
+ when 3 # Reset
+ reset
+
+ when 4 # Big step
+ @S['mode'].value = :MBSTEP
+ end
+ end
+
+ def go(who = nil)
+ now = Tk::Clock.clicks(:miliseconds)
+ if who # Start here for debugging
+ @S['active'] = [who]
+ @S['mode'].value = :MGO
+ end
+ return if @S['mode'].to_sym == :MDEBUG # Debugging
+ # If not paused, do the next move
+ n = next_step if @S['mode'].to_sym != :MPAUSE
+ @S['mode'].value = :MPAUSE if @S['mode'].to_sym == :MSSTEP # Single step
+ @S['mode'].value = :MSSTEP if @S['mode'].to_sym == :MBSTEP && n # big step
+ elapsed = Tk::Clock.clicks(:miliseconds) - now
+ delay = @speed[@S['speed'].to_i] - elapsed
+ delay = 1 if delay <= 0
+ return delay
+ end
+
+ def next_step
+ retval = false # Return value
+
+ if @S['mode'].to_sym != :MSTART && @S['mode'].to_sym != :MDONE
+ @S['cnt'].numeric += 1
+ end
+ alive = []
+ @S['active'].each{|who|
+ who = who.to_i
+ n = send("move#{who}")
+ if (n & 1).nonzero? # This guy still alive
+ alive << who
+ end
+ if (n & 2).nonzero? # Next guy is active
+ alive << (who + 1)
+ retval = true
+ end
+ if (n & 4).nonzero? # End of puzzle flag
+ @S['mode'].value = :MDONE # Done mode
+ @S['active'] = [] # No more animation
+ return true
+ end
+ }
+ @S['active'] = alive
+ return retval
+ end
+
+ def about
+ msg = "Ruby/Tk Version ::\nby Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)\n\n"
+ msg += "Original Version ::\n"
+ msg += "#{@S['title']}\nby Keith Vetter, March 2003\n(Reproduced by kind permission of the author)\n\n"
+ msg += "Man will always find a difficult means to perform a simple task"
+ msg += "\nRube Goldberg"
+ Tk.messageBox(:message=>msg, :title=>'About')
+ end
+
+ ################################################################
+ #
+ # All the drawing and moving routines
+ #
+
+ # START HERE! banner
+ def draw0
+ color = @C['0']
+ TkcText.new(@canvas,
+ # [579, 119], :text=>'START HERE!',
+ [558, 119], :text=>'ここからスタート!',
+ :fill=>color, :anchor=>:w,
+ :tag=>'I0', :font=>['Times Roman', 12, :italic, :bold])
+ TkcLine.new(@canvas, [719, 119, 763, 119], :tag=>'I0', :fill=>color,
+ :width=>5, :arrow=>:last, :arrowshape=>[18, 18, 5])
+ @canvas.itembind('I0', '1'){ start }
+ end
+
+ def move0(step = nil)
+ step = get_step(0, step)
+
+ if @S['mode'].to_sym != :MSTART # Start the ball rolling
+ move_abs('I0', [-100, -100]) # Hide the banner
+ return 2
+ end
+
+ pos = [
+ [673, 119], [678, 119], [683, 119], [688, 119],
+ [693, 119], [688, 119], [683, 119], [678, 119]
+ ]
+ step = step % pos.length
+ move_abs('I0', pos[step])
+ return 1
+ end
+
+ # Dropping ball
+ def draw1
+ color = @C['1a']
+ color2 = @C['1b']
+ TkcPolygon.new(@canvas,
+ [ 844, 133, 800, 133, 800, 346, 820, 346,
+ 820, 168, 844, 168, 844, 133 ],
+ :width=>3, :fill=>color, :outline=>'')
+ TkcPolygon.new(@canvas,
+ [ 771, 133, 685, 133, 685, 168, 751, 168,
+ 751, 346, 771, 346, 771, 133 ],
+ :width=>3, :fill=>color, :outline=>'')
+ TkcOval.new(@canvas, box(812, 122, 9),
+ :tag=>'I1', :fill=>color2, :outline=>'')
+
+ @canvas.itembind('I1', '1'){ start }
+ end
+
+ def move1(step = nil)
+ step = get_step(1, step)
+ pos = [
+ [807, 122], [802, 122], [797, 123], [793, 124], [789, 129], [785, 153],
+ [785, 203], [785, 278, :x], [785, 367], [810, 392], [816, 438],
+ [821, 503], [824, 585, :y], [838, 587], [848, 593], [857, 601],
+ [-100, -100]
+ ]
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I1', where)
+ move15a if where[2] == :y
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Lighting the match
+ def draw2
+ color = @C['2']
+
+ # Fulcrum
+ TkcPolygon.new(@canvas, [750, 369, 740, 392, 760, 392],
+ :fill=>@C['fg'], :outline=>@C['fg'])
+
+ # Strike box
+ TkcRectangle.new(@canvas, [628, 335, 660, 383],
+ :fill=>'', :outline=>@C['fg'])
+ (0..2).each{|y|
+ yy = 335 + y*16
+ TkcBitmap.new(@canvas, [628, yy], :bitmap=>'gray25',
+ :anchor=>:nw, :foreground=>@C['fg'])
+ TkcBitmap.new(@canvas, [644, yy], :bitmap=>'gray25',
+ :anchor=>:nw, :foreground=>@C['fg'])
+ }
+
+ # Lever
+ TkcLine.new(@canvas, [702, 366, 798, 366],
+ :fill=>@C['fg'], :width=>6, :tag=>'I2_0')
+
+ # R strap
+ TkcLine.new(@canvas, [712, 363, 712, 355],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_1')
+
+ # L strap
+ TkcLine.new(@canvas, [705, 363, 705, 355],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_2')
+
+ # Match stick
+ TkcLine.new(@canvas, [679, 356, 679, 360, 717, 360, 717, 356, 679, 356],
+ :fill=>@C['fg'], :width=>3, :tag=>'I2_3')
+
+ # Match head
+ TkcPolygon.new(@canvas,
+ [ 671, 352, 677.4, 353.9, 680, 358.5, 677.4, 363.1,
+ 671, 365, 664.6, 363.1, 662, 358.5, 664.6, 353.9 ],
+ :fill=>color, :outline=>color, :tag=>'I2_4')
+ end
+
+ def move2(step = nil)
+ step = get_step(2, step)
+
+ stages = [0, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1]
+ xy = []
+ xy[0] = [
+ 686, 333, 692, 323, 682, 316, 674, 309, 671, 295, 668, 307,
+ 662, 318, 662, 328, 671, 336
+ ]
+ xy[1] = [
+ 687, 331, 698, 322, 703, 295, 680, 320, 668, 297, 663, 311,
+ 661, 327, 671, 335
+ ]
+ xy[2] = [
+ 686, 331, 704, 322, 688, 300, 678, 283, 678, 283, 674, 298,
+ 666, 309, 660, 324, 672, 336
+ ]
+
+ if step >= stages.length
+ @canvas.delete('I2')
+ return 0
+ end
+
+ if step == 0 # Rotate the match
+ beta = 20
+
+ ox, oy = anchor('I2_0', :s) # Where to pivot
+
+ i = 0
+ until @canvas.find_withtag("I2_#{i}").empty?
+ rotate_item("I2_#{i}", ox, oy, beta)
+ i += 1
+ end
+
+ # For the flame
+ TkcPolygon.new(@canvas, [], :tag=>'I2', :smooth=>true, :fill=>@C['2'])
+
+ return 1
+ end
+ @canvas.coords('I2', xy[stages[step]])
+ return ((step == 7)? 3: 1)
+ end
+
+ # Weight and pulleys
+ def draw3
+ color = @C['3a']
+ color2 = @C['3b']
+
+ xy = [ [602, 296], [577, 174], [518, 174] ]
+ xy.each{|x, y| # 3 Pulleys
+ TkcOval.new(@canvas, box(x, y, 13),
+ :fill=>color, :outline=>@C['fg'], :width=>3)
+ TkcOval.new(@canvas, box(x, y, 2), :fill=>@C['fg'], :outline=>@C['fg'])
+ }
+
+ # Wall to flame
+ TkcLine.new(@canvas, [750, 309, 670, 309], :tag=>'I3_s',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+
+ # Flame to pulley 1
+ TkcLine.new(@canvas, [670, 309, 650, 309], :tag=>'I3_0',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+ TkcLine.new(@canvas, [650, 309, 600, 309], :tag=>'I3_1',
+ :width=>3, :fill=>@C['fg'], :smooth=>true)
+
+ # Pulley 1 half way to 2
+ TkcLine.new(@canvas, [589, 296, 589, 235], :tag=>'I3_2',
+ :width=>3, :fill=>@C['fg'])
+
+ # Pulley 1 other half to 2
+ TkcLine.new(@canvas, [589, 235, 589, 174], :width=>3, :fill=>@C['fg'])
+
+ # Across the top
+ TkcLine.new(@canvas, [577, 161, 518, 161], :width=>3, :fill=>@C['fg'])
+
+ # Down to weight
+ TkcLine.new(@canvas, [505, 174, 505, 205], :tag=>'I3_w',
+ :width=>3, :fill=>@C['fg'])
+
+ # Draw the weight as 2 circles, two rectangles and 1 rounded rectangle
+ x1, y1, x2, y2 = [515, 207, 495, 207]
+ TkcOval.new(@canvas, box(x1, y1, 6),
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+ TkcOval.new(@canvas, box(x2, y2, 6),
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+ TkcRectangle.new(@canvas, x1, y1 - 6, x2, y2 + 6,
+ :tag=>'I3_', :fill=>color2, :outline=>color2)
+
+ TkcPolygon.new(@canvas, round_rect([492, 220, 518, 263], 15),
+ :smooth=>true, :tag=>'I3_', :fill=>color2, :outline=>color2)
+
+ TkcLine.new(@canvas, [500, 217, 511, 217],
+ :tag=>'I3_', :fill=>color2, :width=>10)
+
+ # Bottom weight target
+ TkcLine.new(@canvas, [502, 393, 522, 393, 522, 465],
+ :tag=>'I3__', :fill=>@C['fg'], :joinstyle=>:miter, :width=>10)
+ end
+
+ def move3(step = nil)
+ step = get_step(3, step)
+
+ pos = [ [505, 247], [505, 297], [505, 386.5], [505, 386.5] ]
+ rope = []
+ rope[0] = [750, 309, 729, 301, 711, 324, 690, 300]
+ rope[1] = [750, 309, 737, 292, 736, 335, 717, 315, 712, 320]
+ rope[2] = [750, 309, 737, 309, 740, 343, 736, 351, 725, 340]
+ rope[3] = [750, 309, 738, 321, 746, 345, 742, 356]
+
+ return 0 if step >= pos.length
+
+ @canvas.delete("I3_#{step}") # Delete part of the rope
+ move_abs('I3_', pos[step]) # Move weight down
+ @canvas.coords('I3_s', rope[step]) # Flapping rope end
+ @canvas.coords('I3_w', [505, 174].concat(pos[step]))
+ if step == 2
+ @canvas.move('I3__', 0, 30)
+ return 2
+ end
+ return 1
+ end
+
+ # Cage and door
+ def draw4
+ color = @C['4']
+ x0, y0, x1, y1 = [527, 356, 611, 464]
+
+ # Horizontal bars
+ y0.step(y1, 12){|y|
+ TkcLine.new(@canvas, [x0, y, x1, y], :fill=>color, :width=>1)
+ }
+
+ # Vertical bars
+ x0.step(x1, 12){|x|
+ TkcLine.new(@canvas, [x, y0, x, y1], :fill=>color, :width=>1)
+ }
+
+ # Swing gate
+ TkcLine.new(@canvas, [518, 464, 518, 428],
+ :tag=>'I4', :fill=>color, :width=>1)
+ end
+
+ def move4(step = nil)
+ step = get_step(4, step)
+
+ angles = [-10, -20, -30, -30]
+ return 0 if step >= angles.length
+
+ rotate_item('I4', 518, 464, angles[step])
+ @canvas.raise('I4')
+
+ return((step == 3)? 3: 1)
+ end
+
+ # Mouse
+ def draw5
+ color = @C['5a']
+ color2 = @C['5b']
+
+ xy = [377, 248, 410, 248, 410, 465, 518, 465] # Mouse course
+ xy.concat [518, 428, 451, 428, 451, 212, 377, 212]
+
+ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'], :width=>3)
+
+ xy = [
+ 534.5, 445.5, 541, 440, 552, 436, 560, 436, 569, 440, 574, 446,
+ 575, 452, 574, 454, 566, 456, 554, 456, 545, 456, 537, 454, 530, 452
+ ]
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_0'], :fill=>color)
+
+ TkcLine.new(@canvas, [573, 452, 592, 458, 601, 460, 613, 456], # Tail
+ :tag=>['I5', 'I5_1'], :fill=>color, :smooth=>true, :width=>3)
+
+ xy = box(540, 446, 2) # Eye
+ xy = [540, 444, 541, 445, 541, 447, 540, 448, 538, 447, 538, 445]
+ TkcPolygon.new(@canvas, xy, :tag=>['I5', 'I5_2'], :fill=>@C['bg'],
+ :outline=>'', :smooth=>true)
+
+ xy = [538, 454, 535, 461] # Front leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_3'], :fill=>color, :width=>2)
+
+ xy = [566, 455, 569, 462] # Back leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_4'], :fill=>color, :width=>2)
+
+ xy = [544, 455, 545, 460] # 2nd front leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_5'], :fill=>color, :width=>2)
+
+ xy = [560, 455, 558, 460] # 2nd back leg
+ TkcLine.new(@canvas, xy, :tag=>['I5', 'I5_6'], :fill=>color, :width=>2)
+ end
+
+ def move5(step = nil)
+ step = get_step(5, step)
+
+ pos = [
+ [553, 452], [533, 452], [513, 452], [493, 452], [473, 452],
+ [463, 442, 30], [445.5, 441.5, 30], [425.5, 434.5, 30], [422, 414],
+ [422, 394], [422, 374], [422, 354], [422, 334], [422, 314], [422, 294],
+ [422, 274, -30], [422, 260.5, -30, :x], [422.5, 248.5, -28], [425, 237]
+ ]
+
+ return 0 if step >= pos.length
+
+ x, y, beta, nxt = pos[step]
+ move_abs('I5', [x, y])
+ if beta
+ ox, oy = centroid('I5_0')
+ (0..6).each{|id| rotate_item("I5_#{id}", ox, oy, beta) }
+ end
+ return 3 if nxt == :x
+ return 1
+ end
+
+ # Dropping gumballs
+ def draw6
+ color = @C['6']
+ xy = [324, 130, 391, 204] # Ball holder
+ xy = round_rect(xy, 10)
+ TkcPolygon.new(@canvas, xy, :smooth=>true,
+ :outline=>@C['fg'], :width=>3, :fill=>color)
+ xy = [339, 204, 376, 253] # Below the ball holder
+ TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>3,
+ :fill=>color, :tag=>'I6c')
+ xy = box(346, 339, 28)
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'') # Roter
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
+ :start=>80, :extent=>205)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>2, :style=>:arc,
+ :start=>-41, :extent=>85)
+
+ xy = box(346, 339, 15) # Center of rotor
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['fg'], :tag=>'I6m')
+ xy = [352, 312, 352, 254, 368, 254, 368, 322] # Top drop to rotor
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'')
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2)
+
+ xy = [353, 240, 367, 300] # Poke bottom hole
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+ xy = [341, 190, 375, 210] # Poke another hole
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+
+ xy = [
+ 368, 356, 368, 403, 389, 403, 389, 464, 320, 464, 320, 403,
+ 352, 403, 352, 366
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'',
+ :width=>2) # Below rotor
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2)
+ xy = box(275, 342, 7) # On/off rotor
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['fg'])
+ xy = [276, 334, 342, 325] # Fan belt top
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [276, 349, 342, 353] # Fan belt bottom
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = [337, 212, 337, 247] # What the mouse pushes
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I6_')
+ xy = [392, 212, 392, 247]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I6_')
+ xy = [337, 230, 392, 230]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>7, :tag=>'I6_')
+
+ who = -1 # All the balls
+ colors = %w(red cyan orange green blue darkblue)
+ colors *= 3
+
+ (0..16).each{|i|
+ loc = -i
+ color = colors[i]
+ x, y = @XY6["#{loc}"]
+ TkcOval.new(@canvas, box(x, y, 5),
+ :fill=>color, :outline=>color, :tag=>"I6_b#{i}")
+ }
+ draw6a(12) # The wheel
+ end
+
+ def draw6a(beta)
+ @canvas.delete('I6_0')
+ ox, oy = [346, 339]
+ (0..3).each{|i|
+ b = beta + i * 45
+ x, y = rotate_c(28, 0, 0, 0, b)
+ xy = [ox + x, oy + y, ox - x, oy - y]
+ TkcLine.new(@canvas, xy, :tag=>'I6_0', :fill=>@C['fg'], :width=>2)
+ }
+ end
+
+ def move6(step = nil)
+ step = get_step(6, step)
+
+ return 0 if step > 62
+
+ if step < 2 # Open gate for balls to drop
+ @canvas.move('I6_', -7, 0)
+ if step == 1 # Poke a hole
+ xy = [348, 226, 365, 240]
+ TkcRectangle.new(@canvas, xy, :fill=>@canvas.itemcget('I6c', :fill),
+ :outline=>'')
+ end
+ return 1
+ end
+
+ s = step - 1 # Do the gumball drop dance
+ (0..(((s - 1)/3).to_i)).each{|i|
+ tag = "I6_b#{i}"
+ break if @canvas.find_withtag(tag).empty?
+ loc = s - 3*i
+
+ if @XY6["#{loc},#{i}"]
+ move_abs(tag, @XY6["#{loc},#{i}"])
+ elsif @XY6["#{loc}"]
+ move_abs(tag, @XY6["#{loc}"])
+ end
+ }
+ if s % 3 == 1
+ first = (s + 2)/3
+ i = first
+ loop {
+ tag = "I6_b#{i}"
+ break if @canvas.find_withtag(tag).empty?
+ loc = first - i
+ move_abs(tag, @XY6["#{loc}"])
+ i += 1
+ }
+ end
+ if s >= 3 # Rotate the motor
+ idx = s % 3
+ draw6a(12 + s * 15)
+ end
+ return((s == 3)? 3 : 1)
+ end
+
+ # On/off switch
+ def draw7
+ color = @C['7']
+ xy = [198, 306, 277, 374] # Box
+ TkcRectangle.new(@canvas, xy, :outline=>@C['fg'], :width=>2,
+ :fill=>color, :tag=>'I7z')
+ @canvas.lower('I7z')
+ xy = [275, 343, 230, 349]
+ TkcLine.new(@canvas, xy, :tag=>'I7', :fill=>@C['fg'], :arrow=>:last,
+ :arrowshape=>[23, 23, 8], :width=>6)
+ xy = [225, 324] # On button
+ x, y = xy
+ TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg'])
+ xy = [218, 323] # On text
+ font = ['Times Roman', 8]
+ TkcText.new(@canvas, xy, :text=>'on', :anchor=>:e,
+ :fill=>@C['fg'], :font=>font)
+ xy = [225, 350] # Off button
+ x, y = xy
+ TkcOval.new(@canvas, box(x, y, 3), :fill=>@C['fg'], :outline=>@C['fg'])
+ xy = [218, 349] # Off text
+ TkcText.new(@canvas, xy, :text=>'off', :anchor=>:e,
+ :fill=>@C['fg'], :font=>font)
+ end
+
+ def move7(step = nil)
+ step = get_step(7, step)
+
+ numsteps = 30
+ return 0 if step > numsteps
+ beta = 30.0 / numsteps
+ rotate_item('I7', 275, 343, beta)
+
+ return((step == numsteps)? 3: 1)
+ end
+
+ # Electricity to the fan
+ def draw8
+ sine([271, 248, 271, 306], 5, 8, :tag=>'I8_s', :fill=>@C['8'], :width=>3)
+ end
+
+ def move8(step = nil)
+ step = get_step(8, step)
+
+ return 0 if step > 3
+ if step == 0
+ sparkle(anchor('I8_s', :s), 'I8')
+ return 1
+ elsif step == 1
+ move_abs('I8', anchor('I8_s', :c))
+ elsif step == 2
+ move_abs('I8', anchor('I8_s', :n))
+ else
+ @canvas.delete('I8')
+ end
+ return((step == 2)? 3: 1)
+ end
+
+ # Fan
+ def draw9
+ color = @C['9']
+ xy = [266, 194, 310, 220]
+ TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
+ xy = [280, 209, 296, 248]
+ TkcOval.new(@canvas, xy, :outline=>color, :fill=>color)
+ xy = [
+ 288, 249, 252, 249, 260, 240, 280, 234,
+ 296, 234, 316, 240, 324, 249, 288, 249
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>color, :smooth=>true)
+
+ xy = [248, 205, 265, 214, 264, 205, 265, 196] # Spinner
+ TkcPolygon.new(@canvas, xy, :fill=>color)
+
+ xy = [255, 206, 265, 234] # Fan blades
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I9_0')
+ xy = [255, 176, 265, 204]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I9_0')
+ xy = [255, 206, 265, 220]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>1, :tag=>'I9_1')
+ xy = [255, 190, 265, 204]
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'],
+ :width=>1, :tag=>'I9_1')
+ end
+
+ def move9(step = nil)
+ step = get_step(9, step)
+
+ if (step & 1).nonzero?
+ @canvas.itemconfigure('I9_0', :width=>4)
+ @canvas.itemconfigure('I9_1', :width=>1)
+ @canvas.lower('I9_1', 'I9_0')
+ else
+ @canvas.itemconfigure('I9_0', :width=>1)
+ @canvas.itemconfigure('I9_1', :width=>4)
+ @canvas.lower('I9_0', 'I9_1')
+ end
+ return 3 if step == 0
+ return 1
+ end
+
+ # Boat
+ def draw10
+ color = @C['10a']
+ color2 = @C['10b']
+ xy = [191, 230, 233, 230, 233, 178, 191, 178] # Sail
+ TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'],
+ :tag=>'I10')
+ xy = box(209, 204, 31) # Front
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie,
+ :start=>120, :extent=>120, :tag=>'I10')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>120, :extent=>120, :tag=>'I10')
+ xy = box(249, 204, 31) # Back
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3,
+ :style=>:pie, :start=>120, :extent=>120, :tag=>'I10')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>120, :extent=>120, :tag=>'I10')
+
+ xy = [200, 171, 200, 249] # Mast
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
+ xy = [159, 234, 182, 234] # Bow sprit
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
+ xy = [180, 234, 180, 251, 220, 251] # Hull
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>6, :tag=>'I10')
+
+ xy = [92, 255, 221, 255] # Waves
+ sine(xy, 2, 25, :fill=>color2, :width=>1, :tag=>'I10w')
+
+ xy = @canvas.coords('I10w')[4..-5] # Water
+ xy.concat([222, 266, 222, 277, 99, 277])
+ TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>color2)
+ xy = [222, 266, 222, 277, 97, 277, 97, 266] # Water bottom
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = box(239, 262, 17)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>95, :extent=>103)
+ xy = box(76, 266, 21)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :extent=>190)
+ end
+
+ def move10(step = nil)
+ step = get_step(10, step)
+
+ pos = [
+ [195, 212], [193, 212], [190, 212], [186, 212], [181, 212], [176, 212],
+ [171, 212], [166, 212], [161, 212], [156, 212], [151, 212], [147, 212],
+ [142, 212], [137, 212], [132, 212, :x], [127, 212], [121, 212],
+ [116, 212], [111, 212]
+ ]
+
+ return 0 if step >= pos.length
+
+ where = pos[step]
+ move_abs('I10', where)
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # 2nd ball drop
+ def draw11
+ color = @C['11a']
+ color2 = @C['11b']
+ xy = [23, 264, 55, 591] # Color the down tube
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>'')
+ xy = box(71, 460, 48) # Color the outer loop
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'')
+
+ xy = [55, 264, 55, 458] # Top right side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [55, 504, 55, 591] # Bottom right side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = box(71, 460, 48) # Outer loop
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>110, :extent=>-290, :tag=>'I11i')
+ xy = box(71, 460, 16) # Inner loop
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>'',
+ :width=>3, :tag=>'I11i')
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>@C['bg'], :width=>3)
+
+ xy = [23, 264, 23, 591] # Left side
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = box(1, 266, 23) # Top left curve
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3,
+ :style=>:arc, :extent=>90)
+
+ xy = box(75, 235, 9) # The ball
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>'',
+ :width=>3, :tag=>'I11')
+ end
+
+ def move11(step = nil)
+ step = get_step(11, step)
+
+ pos = [
+ [75, 235], [70, 235], [65, 237], [56, 240], [46, 247], [38, 266],
+ [38, 296], [38, 333], [38, 399], [38, 475], [74, 496], [105, 472],
+ [100, 437], [65, 423], [-100, -100], [38, 505], [38, 527, :x], [38, 591]
+ ]
+
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I11', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Hand
+ def draw12
+ xy = [
+ 20, 637, 20, 617, 20, 610, 20, 590, 40, 590, 40, 590,
+ 60, 590, 60, 610, 60, 610
+ ]
+ xy.concat([60, 610, 65, 620, 60, 631]) # Thumb
+ xy.concat([60, 631, 60, 637, 60, 662, 60, 669, 52, 669,
+ 56, 669, 50, 669, 50, 662, 50, 637])
+
+ y0 = 637 # Bumps for fingers
+ y1 = 645
+ 50.step(21, -10){|x|
+ x1 = x - 5
+ x2 = x - 10
+ xy << x << y0 << x1 << y1 << x2 << y0
+ }
+ TkcPolygon.new(@canvas, xy, :fill=>@C['12'], :outline=>@C['fg'],
+ :smooth=>true, :tag=>'I12', :width=>3)
+ end
+
+ def move12(step = nil)
+ step = get_step(12, step)
+
+ pos = [[42.5, 641, :x]]
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I12', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Fax
+ def draw13
+ color = @C['13a']
+ xy = [86, 663, 149, 663, 149, 704, 50, 704, 50, 681, 64, 681, 86, 671]
+ xy2 = [
+ 784, 663, 721, 663, 721, 704, 820, 704, 820, 681, 806, 681, 784, 671
+ ]
+ radii = [2, 9, 9, 8, 5, 5, 2]
+
+ round_poly(@canvas, xy, radii, :width=>3,
+ :outline=>@C['fg'], :fill=>color)
+ round_poly(@canvas, xy2, radii, :width=>3,
+ :outline=>@C['fg'], :fill=>color)
+
+ xy = [56, 677]
+ x, y = xy
+ TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I13')
+ xy = [809, 677]
+ x, y = xy
+ TkcRectangle.new(@canvas, box(x, y, 4), :fill=>'', :outline=>@C['fg'],
+ :width=>3, :tag=>'I13R')
+
+ xy = [112, 687] # Label
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
+ :font=>['Times Roman', 12, :bold])
+ xy = [762, 687]
+ TkcText.new(@canvas, xy, :text=>'FAX', :fill=>@C['fg'],
+ :font=>['Times Roman', 12, :bold])
+
+ xy = [138, 663, 148, 636, 178, 636] # Paper guide
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3)
+ xy = [732, 663, 722, 636, 692, 636]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>@C['fg'], :width=>3)
+
+ sine([149, 688, 720, 688], 5, 15,
+ :tag=>'I13_s', :fill=>@C['fg'], :width=>3)
+ end
+
+ def move13(step = nil)
+ step = get_step(13, step)
+
+ numsteps = 7
+
+ if step == numsteps + 2
+ move_abs('I13_star', [-100, -100])
+ @canvas.itemconfigure('I13R', :fill=>@C['13b'], :width=>2)
+ return 2
+ end
+ if step == 0 # Button down
+ @canvas.delete('I13')
+ sparkle([-100, -100], 'I13_star') # Create off screen
+ return 1
+ end
+ x0, y0 = anchor('I13_s', :w)
+ x1, y1 = anchor('I13_s', :e)
+ x = x0 + (x1 - x0) * (step - 1) / numsteps.to_f
+ move_abs('I13_star', [x, y0])
+ return 1
+ end
+
+ # Paper in fax
+ def draw14
+ color = @C['14']
+ xy = [102, 661, 113, 632, 130, 618] # Left paper edge
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14L_0')
+ xy = [148, 629, 125, 640, 124, 662] # Right paper edge
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14L_1')
+ draw14a('L')
+
+ xy = [
+ 768.0, 662.5, 767.991316225, 662.433786215, 767.926187912, 662.396880171
+ ]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14R_0')
+ @canvas.lower('I14R_0')
+ # NB. these numbers are VERY sensitive, you must start with final size
+ # and shrink down to get the values
+ xy = [
+ 745.947897349, 662.428358855, 745.997829056, 662.452239237, 746.0, 662.5
+ ]
+ TkcLine.new(@canvas, xy, :smooth=>true, :fill=>color,
+ :width=>3, :tag=>'I14R_1')
+ @canvas.lower('I14R_1')
+ end
+
+ def draw14a(side)
+ color = @C['14']
+ xy = @canvas.coords("I14#{side}_0")
+ xy2 = @canvas.coords("I14#{side}_1")
+ x0, y0, x1, y1, x2, y2 = xy
+ x3, y3, x4, y4, x5, y5 = xy2
+
+ zz = [
+ x0, y0, x0, y0, xy, x2, y2, x2, y2,
+ x3, y3, x3, y3, xy2, x5, y5, x5, y5
+ ].flatten
+ @canvas.delete("I14#{side}")
+ TkcPolygon.new(@canvas, zz, :tag=>"I14#{side}", :smooth=>true,
+ :fill=>color, :outline=>color, :width=>3)
+ @canvas.lower("I14#{side}")
+ end
+
+ def move14(step = nil)
+ step = get_step(14, step)
+
+ # Paper going down
+ sc = 0.9 - 0.05*step
+ if sc < 0.3
+ @canvas.delete('I14L')
+ return 0
+ end
+
+ ox, oy = @canvas.coords('I14L_0')
+ @canvas.scale('I14L_0', ox, oy, sc, sc)
+ ox, oy = @canvas.coords('I14L_1')[-2..-1]
+ @canvas.scale('I14L_1', ox, oy, sc, sc)
+ draw14a('L')
+
+ # Paper going up
+ sc = 0.35 + 0.05*step
+ sc = 1/sc
+
+ ox, oy = @canvas.coords('I14R_0')
+ @canvas.scale('I14R_0', ox, oy, sc, sc)
+ ox, oy = @canvas.coords('I14R_1')[-2..-1]
+ @canvas.scale('I14R_1', ox, oy, sc, sc)
+ draw14a('R')
+
+ return((step == 10)? 3: 1)
+ end
+
+ # Light beam
+ def draw15
+ color = @C['15a']
+ xy = [824, 599, 824, 585, 820, 585, 829, 585]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I15a')
+ xy = [789, 599, 836, 643]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [778, 610, 788, 632]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [766, 617, 776, 625]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+
+ xy = [633, 600, 681, 640]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>3)
+ xy = [635, 567, 657, 599]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
+ xy = [765, 557, 784, 583]
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2)
+
+ sine([658, 580, 765, 580], 3, 15,
+ :tag=>'I15_s', :fill=>@C['fg'], :width=>3)
+ end
+
+ def move15a
+ color = @C['15b']
+ @canvas.scale('I15a', 824, 599, 1, 0.3) # Button down
+ xy = [765, 621, 681, 621]
+ TkcLine.new(@canvas, xy, :dash=>'-', :width=>3, :fill=>color, :tag=>'I15')
+ end
+
+ def move15(step = nil)
+ step = get_step(15, step)
+
+ numsteps = 6
+
+ if step == numsteps + 2
+ move_abs('I15_star', [-100, -100])
+ return 2
+ end
+ if step == 0 # Break the light beam
+ sparkle([-100, -100], 'I15_star')
+ xy = [765, 621, 745, 621]
+ @canvas.coords('I15', xy)
+ return 1
+ end
+ x0, y0 = anchor('I15_s', :w)
+ x1, y1 = anchor('I15_s', :e)
+ x = x0 + (x1 - x0) * (step - 1) / numsteps.to_f
+ move_abs('I15_star', [x, y0])
+ return 1
+ end
+
+ # Bell
+ def draw16
+ color = @C['16']
+ xy = [722, 485, 791, 556]
+ TkcRectangle.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>3)
+ xy = box(752, 515, 25) # Bell
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'black',
+ :tag=>'I16b', :width=>2)
+ xy = box(752, 515, 5) # Bell button
+ TkcOval.new(@canvas, xy, :fill=>'black', :outline=>'black', :tag=>'I16b')
+
+ xy = [784, 523, 764, 549] # Clapper
+ TkcLine.new(@canvas, xy, :width=>3, :tag=>'I16c', :fill=>@C['fg'])
+ xy = box(784, 523, 4)
+ TkcOval.new(@canvas, xy, :fill=>@C['fg'], :outline=>@C['fg'], :tag=>'I16d')
+ end
+
+ def move16(step = nil)
+ step = get_step(16, step)
+
+ # Note: we never stop
+ ox, oy = [760, 553]
+ if (step & 1).nonzero?
+ beta = 12
+ @canvas.move('I16b', 3, 0)
+ else
+ beta = -12
+ @canvas.move('I16b', -3, 0)
+ end
+ rotate_item('I16c', ox, oy, beta)
+ rotate_item('I16d', ox, oy, beta)
+
+ return ((step == 1)? 3: 1)
+ end
+
+ # Cat
+ def draw17
+ color = @C['17']
+
+ xy = [584, 556, 722, 556]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+ xy = [584, 485, 722, 485]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)
+
+ xy = [664, 523, 717, 549] # Body
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :fill=>color, :width=>3,
+ :style=>:chord, :start=>128, :extent=>260, :tag=>'I17')
+
+ xy = [709, 554, 690, 543] # Paw
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color,
+ :width=>3, :tag=>'I17')
+ xy = [657, 544, 676, 555]
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :fill=>color,
+ :width=>3, :tag=>'I17')
+
+ xy = box(660, 535, 15) # Lower face
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
+ :start=>150, :extent=>240, :tag=>'I17_')
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:chord, :start=>150, :extent=>240, :tag=>'I17_')
+ xy = [674, 529, 670, 513, 662, 521, 658, 521, 650, 513, 647, 529] # Ears
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>'', :width=>1,
+ :tag=>['I17_', 'I17_c'])
+ xy = [652, 542, 628, 539] # Whiskers
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [652, 543, 632, 545]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [652, 546, 632, 552]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+
+ xy = [668, 543, 687, 538]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+ xy = [668, 544, 688, 546]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+ xy = [668, 547, 688, 553]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :tag=>['I17_', 'I17_w'])
+
+ xy = [649, 530, 654, 538, 659, 530] # Left eye
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ xy = [671, 530, 666, 538, 661, 530] # Right eye
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ xy = [655, 543, 660, 551, 665, 543] # Mouth
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2,
+ :smooth=>true, :tag=>'I17')
+ end
+
+ def move17(step = nil)
+ step = get_step(17, step)
+
+ if step == 0
+ @canvas.delete('I17') # Delete most of the cat
+ xy = [655, 543, 660, 535, 665, 543] # Mouth
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :smooth=>true, :tag=>'I17_')
+ xy = box(654, 530, 4) # Left eye
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
+ :tag=>'I17_')
+ xy = box(666, 530, 4) # Right eye
+ TkcOval.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :fill=>'',
+ :tag=>'I17_')
+
+ @canvas.move('I17_', 0, -20) # Move face up
+ xy = [652, 528, 652, 554] # Front leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [670, 528, 670, 554] # 2nd front leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+
+ xy = [ # Body
+ 675, 506, 694, 489, 715, 513, 715, 513, 715, 513, 716, 525,
+ 716, 525, 716, 525, 706, 530, 695, 530, 679, 535, 668, 527,
+ 668, 527, 668, 527, 675, 522, 676, 517, 677, 512
+ ]
+ TkcPolygon.new(@canvas, xy, :fill=>@canvas.itemcget('I17_c', :fill),
+ :outline=>@C['fg'], :width=>3, :smooth=>true,
+ :tag=>'I17_')
+ xy = [716, 514, 716, 554] # Back leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [694, 532, 694, 554] # 2nd back leg
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I17_')
+ xy = [715, 514, 718, 506, 719, 495, 716, 488] # Tail
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3,
+ :smooth=>true, :tag=>'I17_')
+
+ @canvas.raise('I17w') # Make whiskers visible
+ @canvas.move('I17_', -5, 0) # Move away from the wall a bit
+ return 2
+ end
+ return 0
+ end
+
+ # Sling shot
+ def draw18
+ color = @C['18']
+ xy = [721, 506, 627, 506] # Sling hold
+ TkcLine.new(@canvas, xy, :width=>4, :fill=>@C['fg'], :tag=>'I18')
+
+ xy = [607, 500, 628, 513] # Sling rock
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :tag=>'I18a')
+
+ xy = [526, 513, 606, 507, 494, 502] # Sling band
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>4, :tag=>'I18b')
+ xy = [485, 490, 510, 540, 510, 575, 510, 540, 535, 491] # Sling
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>6)
+ end
+
+ def move18(step = nil)
+ step = get_step(18, step)
+
+ pos = [
+ [587, 506], [537, 506], [466, 506], [376, 506], [266, 506, :x],
+ [136, 506], [16, 506], [-100, -100]
+ ]
+
+ b = []
+ b[0] = [490, 502, 719, 507, 524, 512] # Band collapsing
+ b[1] = [
+ 491, 503, 524, 557, 563, 505, 559, 496, 546, 506, 551, 525,
+ 553, 536, 538, 534, 532, 519, 529, 499
+ ]
+ b[2] = [
+ 491, 503, 508, 563, 542, 533, 551, 526, 561, 539, 549, 550, 530, 500
+ ]
+ b[3] = [
+ 491, 503, 508, 563, 530, 554, 541, 562, 525, 568, 519, 544, 530, 501
+ ]
+
+ return 0 if step >= pos.length
+
+ if step == 0
+ @canvas.delete('I18')
+ @canvas.itemconfigure('I18b', :smooth=>true)
+ end
+ if b[step]
+ @canvas.coords('I18b', b[step])
+ end
+
+ where = pos[step]
+ move_abs('I18a', where)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Water pipe
+ def draw19
+ color = @C['19']
+ xx = [[249, 181], [155, 118], [86, 55], [22, 0]]
+ xx.each{|x1, x2|
+ TkcRectangle.new(@canvas, x1, 453, x2, 467,
+ :fill=>color, :outline=>'', :tag=>'I19')
+ TkcLine.new(@canvas, x1, 453, x2, 453,
+ :fill=>@C['fg'], :width=>1) # Pipe top
+ TkcLine.new(@canvas, x1, 467, x2, 467,
+ :fill=>@C['fg'], :width=>1) # Pipe bottom
+ }
+ @canvas.raise('I11i')
+
+ xy = box(168, 460, 16) # Bulge by the joint
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc,
+ :start=>21, :extent=>136)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1, :style=>:arc,
+ :start=>-21, :extent=>-130)
+
+ xy = [249, 447, 255, 473] # First joint 26x6
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+
+ xy = box(257, 433, 34) # Bend up
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>0, :extent=>-91)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>-90)
+ xy = box(257, 433, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>0, :extent=>-92)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>-90)
+ xy = box(257, 421, 34) # Bend left
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>0, :extent=>91)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>90)
+ xy = box(257, 421, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>0, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>0, :extent=>90)
+ xy = box(243, 421, 34) # Bend down
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :width=>1,
+ :style=>:pie, :start=>90, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>90, :extent=>90)
+ xy = box(243, 421, 20)
+ TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>1,
+ :style=>:pie, :start=>90, :extent=>90)
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>1,
+ :style=>:arc, :start=>90, :extent=>90)
+
+ xy = [270, 427, 296, 433] # 2nd joint bottom
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [270, 421, 296, 427] # 2nd joint top
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [249, 382, 255, 408] # Third joint right
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [243, 382, 249, 408] # Third joint left
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+ xy = [203, 420, 229, 426] # Last joint
+ TkcRectangle.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>1)
+
+ xy = box(168, 460, 6) # Handle joint
+ TkcOval.new(@canvas, xy, :fill=>@C['fg'], :outline=>'', :tag=>'I19a')
+ xy = [168, 460, 168, 512] # Handle bar
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>5, :tag=>'I19b')
+ end
+
+ def move19(step = nil)
+ step = get_step(19, step)
+
+ angles = [30, 30, 30]
+ return 2 if step == angles.length
+ ox, oy = centroid('I19a')
+ rotate_item('I19b', ox, oy, angles[step])
+
+ return 1
+ end
+
+ # Water pouring
+ def draw20
+ # do nothing
+ end
+
+ def move20(step = nil)
+ step = get_step(20, step)
+
+ pos = [451, 462, 473, 484, 496, 504, 513, 523, 532]
+ freq = [20, 40, 40, 40, 40, 40, 40, 40, 40]
+ pos = [
+ [451, 20], [462, 40], [473, 40], [484, 40], [496, 40],
+ [504, 40], [513, 40], [523, 40], [532, 40, :x]
+ ]
+ return 0 if step >= pos.length
+
+ @canvas.delete('I20')
+ where = pos[step]
+ y, f = where
+ h20(y, f)
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ def h20(y, f)
+ color = @C['20']
+ @canvas.delete('I20')
+
+ sine([208, 428, 208, y], 4, f, :tag=>['I20', 'I20s'],
+ :width=>3, :fill=>color, :smooth=>true)
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ :fill=>color, :smooth=>1, :tag=>['I20', 'I20a'])
+ TkcLine.new(@canvas, @canvas.coords('I20s'), :width=>3,
+ :fill=>color, :smooth=>1, :tag=>['I20', 'I20b'])
+ @canvas.move('I20a', 8, 0)
+ @canvas.move('I20b', 16, 0)
+ end
+
+ # Bucket
+ def draw21
+ color = @C['21']
+ xy = [217, 451, 244, 490] # Right handle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21_a')
+ xy = [201, 467, 182, 490] # Left handle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21_a')
+
+ xy = [245, 490, 237, 535] # Right side
+ xy2 = [189, 535, 181, 490] # Left side
+ TkcPolygon.new(@canvas, xy + xy2, :fill=>color, :outline=>'',
+ :tag=>['I21', 'I21f'])
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>2, :tag=>'I21')
+ TkcLine.new(@canvas, xy2, :fill=>@C['fg'], :width=>2, :tag=>'I21')
+
+ xy = [182, 486, 244, 498] # Top
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>'', :width=>2,
+ :tag=>['I21', 'I21f'])
+ TkcOval.new(@canvas, xy, :fill=>'', :outline=>@C['fg'], :width=>2,
+ :tag=>['I21', 'I21t'])
+ xy = [189, 532, 237, 540] # Bottom
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'], :width=>2,
+ :tag=>['I21', 'I21b'])
+ end
+
+ def move21(step = nil)
+ step = get_step(21, step)
+
+ numsteps = 30
+ return 0 if step >= numsteps
+
+ x1, y1, x2, y2 = @canvas.coords('I21b')
+ # lx1, ly1, lx2, ly2 = @canvas.coords('I21t')
+ lx1, ly1, lx2, ly2 = [183, 492, 243, 504]
+
+ f = step / numsteps.to_f
+ y2 = y2 - 3
+ xx1 = x1 + (lx1 - x1) * f
+ yy1 = y1 + (ly1 - y1) * f
+ xx2 = x2 + (lx2 - x2) * f
+ yy2 = y2 + (ly2 - y2) * f
+
+ @canvas.itemconfigure('I21b', :fill=>@C['20'])
+ @canvas.delete('I21w')
+ TkcPolygon.new(@canvas, x2, y2, x1, y1, xx1, yy1, xx2, yy1,
+ :tag=>['I21', 'I21w'], :outline=>'', :fill=>@C['20'])
+ @canvas.lower('I21w', 'I21')
+ @canvas.raise('I21b')
+ @canvas.lower('I21f')
+
+ return((step == numsteps - 1)? 3: 1)
+ end
+
+ # Bucket drop
+ def draw22
+ # do nothing
+ end
+
+ def move22(step = nil)
+ step = get_step(22, step)
+ pos = [[213, 513], [213, 523], [213, 543, :x], [213, 583], [213, 593]]
+
+ @canvas.itemconfigure('I21f', :fill=>@C['22']) if step == 0
+ return 0 if step >= pos.length
+ where = pos[step]
+ move_abs('I21', where)
+ h20(where[1], 40)
+ @canvas.delete('I21_a') # Delete handles
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Blow dart
+ def draw23
+ color = @C['23a']
+ color2 = @C['23b']
+ color3 = @C['23c']
+
+ xy = [185, 623, 253, 650] # Block
+ TkcRectangle.new(@canvas, xy, :fill=>'black', :outline=>@C['fg'],
+ :width=>2, :tag=>'I23a')
+ xy = [187, 592, 241, 623] # Balloon
+ TkcOval.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b')
+ TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :tag=>'I23b',
+ :style=>:arc, :start=>12, :extent=>336)
+ xy = [239, 604, 258, 589, 258, 625, 239, 610] # Balloon nozzle
+ TkcPolygon.new(@canvas, xy, :outline=>'', :fill=>color, :tag=>'I23b')
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23b')
+
+ xy = [285, 611, 250, 603] # Dart body
+ TkcOval.new(@canvas, xy, :fill=>color2, :outline=>@C['fg'],
+ :width=>3, :tag=>'I23d')
+ xy = [249, 596, 249, 618, 264, 607, 249, 596] # Dart tail
+ TkcPolygon.new(@canvas, xy, :fill=>color3, :outline=>@C['fg'],
+ :width=>3, :tag=>'I23d')
+ xy = [249, 607, 268, 607] # Dart detail
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d')
+ xy = [285, 607, 305, 607] # Dart needle
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I23d')
+ end
+
+ def move23(step = nil)
+ step = get_step(23, step)
+
+ pos = [
+ [277, 607], [287, 607], [307, 607, :x], [347, 607], [407, 607],
+ [487, 607], [587, 607], [687, 607], [787, 607], [-100, -100]
+ ]
+
+ return 0 if step >= pos.length
+ if step <= 1
+ ox, oy = anchor('I23a', :n)
+ @canvas.scale('I23b', ox, oy, 0.9, 0.5)
+ end
+ where = pos[step]
+ move_abs('I23d', where)
+
+ return 3 if where[2] == :x
+ return 1
+ end
+
+ # Balloon
+ def draw24
+ color = @C['24a']
+ xy = [366, 518, 462, 665] # Balloon
+ TkcOval.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ :width=>3, :tag=>'I24')
+ xy = [414, 666, 414, 729] # String
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I24')
+ xy = [410, 666, 404, 673, 422, 673, 418, 666] # Nozzle
+ TkcPolygon.new(@canvas, xy, :fill=>color, :outline=>@C['fg'],
+ :width=>3, :tag=>'I24')
+
+ xy = [387, 567, 390, 549, 404, 542] # Reflections
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [395, 568, 399, 554, 413, 547]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [403, 570, 396, 555, 381, 553]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ xy = [408, 564, 402, 547, 386, 545]
+ TkcLine.new(@canvas, xy, :fill=>@C['fg'], :smooth=>true,
+ :width=>2, :tag=>'I24')
+ end
+
+ def move24(step = nil)
+ step = get_step(24, step)
+
+ return 0 if step > 4
+ return 2 if step == 4
+
+ if step == 0
+ @canvas.delete('I24') # Exploding balloon
+ xy = [
+ 347, 465, 361, 557, 271, 503, 272, 503, 342, 574, 259, 594,
+ 259, 593, 362, 626, 320, 737, 320, 740, 398, 691, 436, 738,
+ 436, 739, 476, 679, 528, 701, 527, 702, 494, 627, 548, 613,
+ 548, 613, 480, 574, 577, 473, 577, 473, 474, 538, 445, 508,
+ 431, 441, 431, 440, 400, 502, 347, 465, 347, 465
+ ]
+ TkcPolygon.new(@canvas, xy, :tag=>'I24', :fill=>@C['24b'],
+ :outline=>@C['24a'], :width=>10, :smooth=>true)
+ msg = Tk.subst(@S['message'].value)
+ TkcText.new(@canvas, centroid('I24'), :text=>msg, :tag=>['I24', 'I24t'],
+ :justify=>:center, :font=>['Times Roman', 18, :bold])
+ return 1
+ end
+
+ @canvas.itemconfigure('I24t', :font=>['Times Roman', 18 + 6*step, :bold])
+ @canvas.move('I24', 0, -60)
+ ox, oy = centroid('I24')
+ @canvas.scale('I24', ox, oy, 1.25, 1.25)
+ return 1
+ end
+
+ # Displaying the message
+ def move25(step = nil)
+ step = get_step(25, step)
+
+ if step == 0
+ @XY['25'] = Tk::Clock.clicks(:miliseconds)
+ return 1
+ end
+ elapsed = Tk::Clock.clicks(:miliseconds) - @XY['25']
+ return 1 if elapsed < 5000
+ return 2
+ end
+
+ # Collapsing balloon
+ def move26(step = nil)
+ step = get_step(26, step)
+
+ if step >= 3
+ @canvas.delete('I24', 'I26')
+ TkcText.new(@canvas, 430, 735, :anchor=>:s, :tag=>'I26',
+ #:text=>'click to continue',
+ :text=>'クリックでリセットします',
+ :font=>['Times Roman', 20, :bold])
+ @canvas.bind('1', proc{reset})
+ return 4
+ end
+
+ ox, oy = centroid('I24')
+ @canvas.scale('I24', ox, oy, 0.8, 0.8)
+ @canvas.move('I24', 0, 60)
+ @canvas.itemconfigure('I24t', :font=>['Times Roman', 30 - 6*step, :bold])
+ return 1
+ end
+
+ ################################################################
+ #
+ # Helper functions
+ #
+ def box(x, y, r)
+ [x - r, y - r, x + r, y + r]
+ end
+
+ def move_abs(item, xy)
+ x, y = xy
+ ox, oy = centroid(item)
+ dx = x - ox
+ dy = y - oy
+ @canvas.move(item, dx, dy)
+ end
+
+ def rotate_item(item, ox, oy, beta)
+ xy = @canvas.coords(item)
+ xy2 = []
+ 0.step(xy.length - 1, 2){|idx|
+ x, y = xy[idx, 2]
+ xy2.concat(rotate_c(x, y, ox, oy, beta))
+ }
+ @canvas.coords(item, xy2)
+ end
+
+ def rotate_c(x, y, ox, oy, beta)
+ # rotates vector (ox,oy)->(x,y) by beta degrees clockwise
+
+ x -= ox # Shift to origin
+ y -= oy
+
+ beta = beta * Math.atan(1) * 4 / 180.0 # Radians
+ xx = x * Math.cos(beta) - y * Math.sin(beta) # Rotate
+ yy = x * Math.sin(beta) + y * Math.cos(beta)
+
+ xx += ox # Shift back
+ yy += oy
+
+ [xx, yy]
+ end
+
+ def reset
+ draw_all
+ @canvas.bind_remove('1')
+ @S['mode'].value = :MSTART
+ @S['active'] = [0]
+ end
+
+ # Each Move## keeps its state info in STEP, this retrieves and increments it
+ def get_step(who, step)
+ if step
+ @STEP[who] = step
+ else
+ if !@STEP.exist?(who) || @STEP[who] == ""
+ @STEP[who] = 0
+ else
+ @STEP[who] += 1
+ end
+ end
+ @STEP[who]
+ end
+
+ def reset_step
+ @S['cnt'].value = 0
+ @STEP.keys.each{|k| @STEP[k] = ''}
+ end
+
+ def sine(xy0, amp, freq, opts = {})
+ x0, y0, x1, y1 = xy0
+ step = 2
+ xy = []
+ if y0 == y1 # Horizontal
+ x0.step(x1, step){|x|
+ beta = (x - x0) * 2 * Math::PI / freq
+ y = y0 + amp * Math.sin(beta)
+ xy << x << y
+ }
+ else
+ y0.step(y1, step){|y|
+ beta = (y - y0) * 2 * Math::PI / freq
+ x = x0 + amp * Math.sin(beta)
+ xy << x << y
+ }
+ end
+ TkcLine.new(@canvas, xy, opts)
+ end
+
+ def round_rect(xy, radius, opts={})
+ x0, y0, x3, y3 = xy
+ r = @canvas.winfo_pixels(radius)
+ d = 2 * r
+
+ # Make sure that the radius of the curve is less than 3/8 size of the box!
+ maxr = 0.75
+ if d > maxr * (x3 - x0)
+ d = maxr * (x3 - x0)
+ end
+ if d > maxr * (y3 - y0)
+ d = maxr * (y3 - y0)
+ end
+
+ x1 = x0 + d
+ x2 = x3 - d
+ y1 = y0 + d
+ y2 = y3 - d
+
+ xy = [x0, y0, x1, y0, x2, y0, x3, y0, x3, y1, x3, y2]
+ xy.concat([x3, y3, x2, y3, x1, y3, x0, y3, x0, y2, x0, y1])
+ return xy
+ end
+
+ def round_poly(canv, xy, radii, opts)
+ lenXY = xy.length
+ lenR = radii.length
+ if lenXY != 2*lenR
+ raise "wrong number of vertices and radii"
+ end
+
+ knots = []
+ x0 = xy[-2]; y0 = xy[-1]
+ x1 = xy[0]; y1 = xy[1]
+ xy << xy[0] << xy[1]
+
+ 0.step(lenXY - 1, 2){|i|
+ radius = radii[i/2]
+ r = canv.winfo_pixels(radius)
+
+ x2 = xy[i+2]; y2 = xy[i+3]
+ z = _round_poly2(x0, y0, x1, y1, x2, y2, r)
+ knots.concat(z)
+
+ x0 = x1; y0 = y1
+ x1 = x2; y1 = y2
+ }
+ TkcPolygon.new(canv, knots, {:smooth=>true}.update(opts))
+ end
+
+ def _round_poly2(x0, y0, x1, y1, x2, y2, radius)
+ d = 2 * radius
+ maxr = 0.75
+
+ v1x = x0 - x1
+ v1y = y0 - y1
+ v2x = x2 - x1
+ v2y = y2 - y1
+
+ vlen1 = Math.sqrt(v1x*v1x + v1y*v1y)
+ vlen2 = Math.sqrt(v2x*v2x + v2y*v2y)
+
+ if d > maxr * vlen1
+ d = maxr * vlen1
+ end
+ if d > maxr * vlen2
+ d = maxr * vlen2
+ end
+
+ xy = []
+ xy << (x1 + d * v1x / vlen1) << (y1 + d * v1y / vlen1)
+ xy << x1 << y1
+ xy << (x1 + d * v2x / vlen2) << (y1 + d * v2y / vlen2)
+
+ return xy
+ end
+
+ def sparkle(oxy, tag)
+ xy = [
+ [299, 283], [298, 302], [295, 314], [271, 331],
+ [239, 310], [242, 292], [256, 274], [281, 273]
+ ]
+ xy.each{|x, y|
+ TkcLine.new(@canvas, 271, 304, x, y,
+ :fill=>'white', :width=>3, :tag=>tag)
+ }
+ move_abs(tag, oxy)
+ end
+
+ def centroid(item)
+ anchor(item, :c)
+ end
+
+ def anchor(item, where)
+ x1, y1, x2, y2 = @canvas.bbox(item)
+ case(where)
+ when :n
+ y = y1
+ when :s
+ y = y2
+ else
+ y = (y1 + y2) / 2.0
+ end
+ case(where)
+ when :w
+ x = x1
+ when :e
+ x = x2
+ else
+ x = (x1 + x2) / 2.0
+ end
+ return [x, y]
+ end
+end
+
+TkGoldberg_Demo.new(base_frame)
diff --git a/ext/tk/sample/demos-jp/hello b/ext/tk/sample/demos-jp/hello
new file mode 100644
index 0000000000..e942f3d851
--- /dev/null
+++ b/ext/tk/sample/demos-jp/hello
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+require 'tk'
+
+TkButton.new(nil,
+ 'text'=>"こんにちは、世界",
+ 'command'=>proc{print "こんにちは、世界\n"; exit}
+).pack
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/hscale.rb b/ext/tk/sample/demos-jp/hscale.rb
new file mode 100644
index 0000000000..2dfbf38272
--- /dev/null
+++ b/ext/tk/sample/demos-jp/hscale.rb
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+require "tkcanvas"
+
+if defined?($hscale_demo) && $hscale_deom
+ $hscale_demo.destroy
+ $hscale_demo = nil
+end
+
+$hscale_demo = TkToplevel.new {|w|
+ title("Horizontal Scale Demonstration")
+ iconname("hscale")
+}
+positionWindow($hscale_demo)
+
+base_frame = TkFrame.new($hscale_demo).pack(:fill=>:both, :expand=>true)
+
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '3.5i'
+ justify 'left'
+ text "下には矢印が1つと水平なスケールが表示されています。\
+スケール上でマウスボタン1をクリック、またはドラッグすると\
+矢印の長さを変えることができます。"
+}
+msg.pack('side'=>'top')
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc {
+ tmppath = $hscale_demo
+ $hscale_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc { showCode 'hscale' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+def setWidth(w, width)
+ width = width + 21
+ x2 = width - 30
+ if x2 < 21
+ x2 = 21
+ end
+ w.coords 'poly',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15
+ w.coords 'line',20,15,20,35,x2,35,x2,45,width,25,x2,5,x2,15,20,15
+end
+
+TkFrame.new(base_frame) {|frame|
+ canvas = TkCanvas.new(frame) {|c|
+ width 50
+ height 50
+ bd 0
+ highlightthickness 0
+ TkcPolygon.new(c, '0', '0', '1', '1', '2', '2') {
+ fill 'DeepSkyBlue'
+ tags 'poly'
+ }
+ TkcLine.new(c, '0', '0', '1', '1', '2', '2', '0', '0') {
+ fill 'black'
+ tags 'line'
+ }
+ }.pack('side'=>'top', 'expand'=>'yes', 'anchor'=>'s', 'fill'=>'x', 'padx'=>'15')
+ scale = TkScale.new(frame) {
+ orient 'horizontal'
+ length 284
+ from 0
+ to 250
+ command proc{|value| setWidth(canvas, value)}
+ tickinterval 50
+ }.pack('side'=>'bottom', 'expand'=>'yes', 'anchor'=>'n')
+ scale.set 75
+}.pack('side'=>'top', 'fill'=>'x')
diff --git a/ext/tk/sample/demos-jp/icon.rb b/ext/tk/sample/demos-jp/icon.rb
new file mode 100644
index 0000000000..6b9e1a570a
--- /dev/null
+++ b/ext/tk/sample/demos-jp/icon.rb
@@ -0,0 +1,103 @@
+# -*- coding: utf-8 -*-
+#
+# iconic button widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($icon_demo) && $icon_demo
+ $icon_demo.destroy
+ $icon_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$icon_demo = TkToplevel.new {|w|
+ title("Iconic Button Demonstration")
+ iconname("icon")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($icon_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "このウィンドウにはラジオボタンとチェックボタン上にビットマップや画像を表示する 3 つの方法を示しています。左にあるのは2つのラジオボタンで、それぞれが、ビットマップと選択を示すインジケータでできています。中央にあるのは、選択済みかどうかによって異なる画像を表示するチェックボタンです。右側にあるのは選択済みかどうかによって背景色が変わるビットマップを表示するチェックボタンです。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $icon_demo
+ $icon_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'icon'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# image 生成
+flagup = \
+TkBitmapImage.new('file'=>[$demo_dir,'..',
+ 'images','flagup.xbm'].join(File::Separator),
+ 'maskfile'=>\
+ [$demo_dir,'..','images','flagup.xbm'].join(File::Separator))
+flagdown = \
+TkBitmapImage.new('file'=>[$demo_dir,'..',
+ 'images','flagdown.xbm'].join(File::Separator),
+ 'maskfile'=>\
+ [$demo_dir,'..',
+ 'images','flagdown.xbm'].join(File::Separator))
+
+# 変数生成
+letters = TkVariable.new
+
+# frame 生成
+TkFrame.new(base_frame, 'borderwidth'=>10){|w|
+ TkFrame.new(w) {|f|
+ # TkRadioButton.new(f){
+ Tk::RadioButton.new(f){
+ bitmap '@' + [$demo_dir,'..',
+ 'images','letters.xbm'].join(File::Separator)
+ variable letters
+ value 'full'
+ }.pack('side'=>'top', 'expand'=>'yes')
+
+ # TkRadioButton.new(f){
+ Tk::RadioButton.new(f){
+ bitmap '@' + [$demo_dir,'..',
+ 'images','noletter.xbm'].join(File::Separator)
+ variable letters
+ value 'empty'
+ }.pack('side'=>'top', 'expand'=>'yes')
+
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+ # TkCheckButton.new(w) {
+ Tk::CheckButton.new(w) {
+ image flagdown
+ selectimage flagup
+ indicatoron 0
+ selectcolor self['background']
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+ # TkCheckButton.new(w) {
+ Tk::CheckButton.new(w) {
+ bitmap '@' + [$demo_dir,'..',
+ 'images','letters.xbm'].join(File::Separator)
+ indicatoron 0
+ selectcolor 'SeaGreen1'
+ }.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
+
+}.pack('side'=>'top')
+
diff --git a/ext/tk/sample/demos-jp/image1.rb b/ext/tk/sample/demos-jp/image1.rb
new file mode 100644
index 0000000000..0c69b2a45f
--- /dev/null
+++ b/ext/tk/sample/demos-jp/image1.rb
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+#
+# two image widgets demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($image1_demo) && $image1_demo
+ $image1_demo.destroy
+ $image1_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$image1_demo = TkToplevel.new {|w|
+ title('Image Demonstration #1')
+ iconname("Image1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image1_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "このデモでは2つのラベル上に画像をそれぞれ表示しています。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $image1_demo
+ $image1_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'image1'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# image 生成
+image1a = \
+TkPhotoImage.new('file'=>[$demo_dir,'..',
+ 'images','earth.gif'].join(File::Separator))
+image1b = \
+TkPhotoImage.new('file'=>[$demo_dir,'..',
+ 'images','earthris.gif'].join(File::Separator))
+
+# label 生成
+#[ TkLabel.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'),
+# TkLabel.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken')
+#].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')}
+[ Tk::Label.new(base_frame, 'image'=>image1a, 'bd'=>1, 'relief'=>'sunken'),
+ Tk::Label.new(base_frame, 'image'=>image1b, 'bd'=>1, 'relief'=>'sunken')
+].each{|w| w.pack('side'=>'top', 'padx'=>'.5m', 'pady'=>'.5m')}
+
diff --git a/ext/tk/sample/demos-jp/image2.rb b/ext/tk/sample/demos-jp/image2.rb
new file mode 100644
index 0000000000..aa507c5b9b
--- /dev/null
+++ b/ext/tk/sample/demos-jp/image2.rb
@@ -0,0 +1,106 @@
+# -*- coding: utf-8 -*-
+#
+# widget demo 'load image' (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($image2_demo) && $image2_demo
+ $image2_demo.destroy
+ $image2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$image2_demo = TkToplevel.new {|w|
+ title('Image Demonstration #2')
+ iconname("Image2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image2_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "このデモではTkの photo image を使用して画像を見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $image2_demo
+ $image2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'image2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# 変数生成
+$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
+
+# image 生成
+$image2a = TkPhotoImage.new
+
+# ファイル名入力部
+TkLabel.new(base_frame, 'text'=>'ディレクトリ:')\
+.pack('side'=>'top', 'anchor'=>'w')
+
+image2_e = TkEntry.new(base_frame) {
+ width 30
+ textvariable $dirName
+}.pack('side'=>'top', 'anchor'=>'w')
+
+TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20)\
+.pack('side'=>'top', 'anchor'=>'w')
+
+TkLabel.new(base_frame, 'text'=>'ファイル:')\
+.pack('side'=>'top', 'anchor'=>'w')
+
+TkFrame.new(base_frame){|w|
+ s = TkScrollbar.new(w)
+ l = TkListbox.new(w) {
+ width 20
+ height 10
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| l.yview(*args)})
+ l.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y')
+ s.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y')
+ #l.insert(0,'earth.gif', 'earthris.gif', 'mickey.gif', 'teapot.ppm')
+ l.insert(0,'earth.gif', 'earthris.gif', 'teapot.ppm')
+ l.bind('Double-1', proc{|x,y| loadImage $image2a,l,x,y}, '%x %y')
+
+ image2_e.bind 'Return', proc{loadDir l}
+
+}.pack('side'=>'top', 'anchor'=>'w')
+
+# image 配置
+[ TkFrame.new(base_frame, 'height'=>'3m', 'width'=>20),
+ TkLabel.new(base_frame, 'text'=>'画像:'),
+ # TkLabel.new(base_frame, 'image'=>$image2a)
+ Tk::Label.new(base_frame, 'image'=>$image2a)
+].each{|w| w.pack('side'=>'top', 'anchor'=>'w')}
+
+# メソッド定義
+def loadDir(w)
+ w.delete(0,'end')
+ Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
+ w.insert('end',File.basename(f))
+ }
+end
+
+def loadImage(img,w,x,y)
+ img.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator))
+end
+
diff --git a/ext/tk/sample/demos-jp/image3.rb b/ext/tk/sample/demos-jp/image3.rb
new file mode 100644
index 0000000000..5c1ceb2816
--- /dev/null
+++ b/ext/tk/sample/demos-jp/image3.rb
@@ -0,0 +1,127 @@
+# -*- coding: utf-8 -*-
+# image3.rb
+#
+# This demonstration script creates a simple collection of widgets
+# that allow you to select and view images in a Tk label.
+#
+# widget demo 'load image' (called by 'widget')
+#
+
+# toplevel widget
+if defined?($image3_demo) && $image3_demo
+ $image3_demo.destroy
+ $image3_demo = nil
+end
+
+# demo toplevel widget
+$image3_demo = TkToplevel.new {|w|
+ title('Image Demonstration #3')
+ iconname("Image3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($image3_demo).pack(:fill=>:both, :expand=>true)
+
+#
+def loadDir3(w)
+ w.delete(0,'end')
+ Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
+ w.insert('end',File.basename(f))
+ }
+end
+
+# selectAndLoadDir3 --
+# This procedure pops up a dialog to ask for a directory to load into
+# the listobx and (if the user presses OK) reloads the directory
+# listbox from the directory named in the demo's entry.
+#
+# Arguments:
+# w - Name of the toplevel window of the demo.
+def selectAndLoadDir3(w, lbox)
+ dir = Tk.chooseDirectory(:initialdir=>$dirName.value,
+ :parent=>w, :mustexist=>true)
+ if dir.length > 0
+ $dirName.value = dir
+ loadDir3(lbox)
+ end
+end
+
+def loadImage3(w,x,y)
+ $image3a.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator))
+end
+
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "このデモではTkの photo image を使用して画像を 見ることができます。最初にエントリ内ににディレクトリ名を入れて下さい。次に下のリストボックスにこのディレクトリをロードするため、リターンを押してください。その後、画像を選択するためにリストボックスの中のファイル名をダブルクリックして下さい。"
+}
+msg.pack('side'=>'top')
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $image3_demo
+ $image3_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'image3'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# variable
+$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
+
+# image
+begin
+ $image3a.delete
+rescue
+end
+$image3a = TkPhotoImage.new
+
+#
+image3_f = TkFrame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+image3_df = TkLabelFrame.new(base_frame, :text=>'ディレクトリ:')
+
+image3_ff = TkLabelFrame.new(base_frame, :text=>'ファイル:',
+ :padx=>'2m', :pady=>'2m')
+image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) {
+ pack(:side=>:left, :fill=>:y, :expand=>true)
+ yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y,
+ :expand=>true))
+ insert(0, *(%w(earth.gif earthris.gif teapot.ppm)))
+ bind('Double-1', proc{|x,y| loadImage3(self, x, y)}, '%x %y')
+}
+
+image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
+ pack(:side=>:left, :fill=>:both, :padx=>'2m', :pady=>'2m', :expand=>true)
+ bind('Return', proc{loadDir3(image3_lbx)})
+}
+
+TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"ディレクトリ選択",
+ :command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) {
+ pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m')
+}
+
+image3_if = TkLabelFrame.new(base_frame, :text=>'イメージ:') {|f|
+ # TkLabel.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
+ Tk::Label.new(f, :image=>$image3a).pack(:padx=>'2m', :pady=>'2m')
+}
+
+Tk.grid(image3_df, '-',
+ :sticky=>:ew, :padx=>'1m', :pady=>'1m', :in=>image3_f)
+Tk.grid(image3_ff, image3_if,
+ :sticky=>:nw, :padx=>'1m', :pady=>'1m', :in=>image3_f)
+TkGrid.columnconfigure(image3_f, 1, :weight=>1)
+
diff --git a/ext/tk/sample/demos-jp/items.rb b/ext/tk/sample/demos-jp/items.rb
new file mode 100644
index 0000000000..b1d66f367b
--- /dev/null
+++ b/ext/tk/sample/demos-jp/items.rb
@@ -0,0 +1,379 @@
+# -*- coding: utf-8 -*-
+#
+# canvas item types widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($items_demo) && $items_demo
+ $items_demo.destroy
+ $items_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$items_demo = TkToplevel.new {|w|
+ title("Canvas Item Demonstration")
+ iconname("Items")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($items_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "このウィンドウにはキャンバス widget が入っており、その中にはキャンバス widget がサポートする様々なタイプのアイテムの例が入っています。次のような操作ができます。\n ボタン-1 ドラッグ:\tアイテムを動かす。\n ボタン-2 ドラッグ:\t見えている部分をずらす。\n ボタン-3 ドラッグ:\t領域を囲う。\n コントロール-F:\t領域の下のアイテムを表示する。"
+}.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $items_demo
+ $items_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'items'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+cvs = nil
+TkFrame.new(base_frame) {|cf|
+ # canvas 生成
+ cvs = TkCanvas.new(cf) {|c|
+ focus
+ scrollregion '0c 0c 30c 24c'
+ width '15c'
+ height '10c'
+ relief 'sunken'
+ borderwidth 2
+
+ hs = TkScrollbar.new(cf) {|s|
+ orient 'horizontal'
+ command proc{|*args| c.xview(*args)}
+ c.xscrollcommand proc{|first,last| s.set first,last}
+ }
+
+ vs = TkScrollbar.new(cf) {|s|
+ command proc{|*args| c.yview(*args)}
+ c.yscrollcommand proc{|first,last| s.set first,last}
+ }
+
+ if $tk_version =~ /^4\.[01]/
+ hs.pack('side'=>'bottom', 'fill'=>'x')
+ vs.pack('side'=>'right', 'fill'=>'y')
+ c.pack('in'=>cf, 'expand'=>'yes', 'fill'=>'both')
+
+ else
+ c.grid('in'=>cf, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ vs.grid('row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ hs.grid('row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ TkGrid.rowconfigure(cf, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(cf, 0, 'weight'=>1, 'minsize'=>0)
+
+ end
+
+ }
+}.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+# Display a 3x3 rectangular grid
+TkcRectangle.new(cvs, '0c', '0c', '30c', '24c', 'width'=>2)
+TkcLine.new(cvs, '0c', '8c', '30c', '8c', 'width'=>2)
+TkcLine.new(cvs, '0c', '16c', '30c', '16c', 'width'=>2)
+TkcLine.new(cvs, '10c', '0c', '10c', '24c', 'width'=>2)
+TkcLine.new(cvs, '20c', '0c', '20c', '24c', 'width'=>2)
+
+if $tk_version =~ /^4.*/
+ font1 = '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*'
+ font2 = '-Adobe-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*'
+else
+ font1 = 'Helvetica 12'
+ font2 = 'Helvetica 24 bold'
+end
+if TkWinfo.depth($root).to_i > 1
+ blue = 'DeepSkyBlue3'
+ red = 'red'
+ bisque = 'bisque3'
+ green = 'SeaGreen3'
+else
+ blue = 'black'
+ red = 'black'
+ bisque = 'black'
+ green = 'black'
+end
+
+# tag オブジェクトを生成
+$tag_item = TkcGroup.new(cvs)
+
+# Set up demos within each of the areas of the grid.
+TkcText.new(cvs, '5c', '.2c', 'text'=>'ライン', 'anchor'=>'n')
+TkcLine.new(cvs, '1c', '1c', '3c', '1c', '1c', '4c', '3c', '4c',
+ 'width'=>2, 'fill'=>blue, 'capstyle'=>'butt',
+ 'join'=>'miter', 'tags'=>$tag_item )
+TkcLine.new(cvs, '4.67c','1c','4.67c','4c', 'arrow'=>'last', 'tags'=>$tag_item)
+TkcLine.new(cvs, '6.33c','1c','6.33c','4c', 'arrow'=>'both', 'tags'=>$tag_item)
+TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c',
+ '4.8c','8.8c','1.2c','8.2c','1.2c','8.2c','4.6c','8.6c','4.6c',
+ '8.6c','1.4c','8.4c','1.4c','8.4c','4.4c',
+ 'width'=>3, 'fill'=>red, 'tags'=>$tag_item )
+TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item )
+TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c',
+ 'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round',
+ 'tags'=>$tag_item )
+
+TkcText.new(cvs, '15c', '.2c',
+ 'text'=>'曲線 (滑らかにつないだ直線)', 'anchor'=>'n')
+TkcLine.new(cvs, '11c','4c','11.5c','1c','13.5c','1c','14c','4c',
+ 'smooth'=>'on', 'fill'=>blue, 'tags'=>$tag_item )
+TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c',
+ 'smooth'=>'on', 'arrow'=>'both', 'width'=>3, 'tags'=>$tag_item )
+TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c',
+ '16.5c','4.5c','13.5c','7.5c','12c','6c',
+ 'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator),
+ 'fill'=>red, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '25c', '.2c', 'text'=>'多角形', 'anchor'=>'n')
+TkcPolygon.new(cvs, '21c','1.0c','22.5c','1.75c','24c','1.0c','23.25c','2.5c',
+ '24c','4.0c','22.5c','3.25c','21c','4.0c','21.75c','2.5c',
+ 'fill'=>'green', 'outline'=>'black', 'width'=>4,
+ 'tags'=>$tag_item )
+TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c',
+ '28c','1c','29c','1c','29c','4c','29c','4c',
+ 'fill'=>red, 'smooth'=>'on', 'tags'=> $tag_item)
+TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
+ '28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c',
+ '7.5c','22c','7.5c',
+ 'stipple'=>'@' + [$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator),
+ 'outline'=>'black', 'tags'=>$tag_item )
+
+TkcText.new(cvs, '5c', '8.2c', 'text'=>'矩形', 'anchor'=>'n')
+TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c',
+ 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
+TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c',
+ 'fill'=>green, 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'fill'=>blue, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '15c', '8.2c', 'text'=>'楕円', 'anchor'=>'n')
+TkcOval.new(cvs, '11c','9.5c','14c','12.5c',
+ 'outline'=>red, 'width'=>'3m', 'tags'=>$tag_item)
+TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c',
+ 'fill'=>green, 'tags'=>$tag_item )
+TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
+ 'stipple'=>'@'+[$demo_dir,'..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'fill'=>blue, 'tags'=>$tag_item )
+
+TkcText.new(cvs, '25c', '8.2c', 'text'=>'テキスト', 'anchor'=>'n')
+TkcRectangle.new(cvs, '22.4c','8.9c','22.6c','9.1c')
+TkcText.new(cvs, '22.5c', '9c', 'anchor'=>'n', 'font'=>font1, 'width'=>'4c',
+ 'text'=>'短いテキスト。ワードラップ、左揃え、アンカーは北(上)。□は各テキストのアンカーポイントを示す。', 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '25.4c','10.9c','25.6c','11.1c')
+TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue,
+ 'text'=>"いくつかの行。\nそれぞれ独立に\n行揃え。\n全て左端がアンカーされている。", 'justify'=>'center', 'tags'=>$tag_item )
+TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c')
+if $tk_version =~ /^4\.[01]/
+ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
+ 'stipple'=>'@' + [$demo_dir, '..',
+ 'images', 'grey.5'].join(File::Separator),
+ 'text'=>'Stippled characters', 'tags'=>$tag_item )
+else
+ TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
+ 'stipple'=>'gray50', 'text'=>'Stippled characters',
+ 'tags'=>$tag_item )
+end
+
+TkcText.new(cvs, '5c', '16.2c', 'text'=>'弧', 'anchor'=>'n')
+TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black',
+ 'start'=>45, 'extent'=>270, 'style'=>'pieslice', 'tags'=>$tag_item)
+#TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
+# 'outline'=>blue, 'start'=>135, 'extent'=>270,
+# 'outlinestipple'=>'@' + ['images', 'grey.25'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
+ 'outline'=>blue, 'start'=>135, 'extent'=>270,
+ 'outlinestipple'=>'@'+[$demo_dir, '..',
+ 'images','gray25.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice',
+ 'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90,
+ 'tags'=>$tag_item)
+TkcArc.new(cvs, '5.5c','20.5c','9.5c','23.5c', 'width'=>'4m', 'style'=>'chord',
+ 'fill'=>blue, 'outline'=>'', 'start'=>45, 'extent'=>270,
+ 'tags'=>$tag_item)
+
+TkcText.new(cvs, '15c', '16.2c', 'text'=>'ビットマップ', 'anchor'=>'n')
+#TkcBitmap.new(cvs, '13c','20c',
+# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcBitmap.new(cvs, '13c','20c',
+ 'bitmap'=>'@' + [$demo_dir, '..',
+ 'images', 'face.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+#TkcBitmap.new(cvs, '17c','18.5c',
+# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator),
+# 'tags'=>$tag_item)
+TkcBitmap.new(cvs, '17c','18.5c',
+ 'bitmap'=>'@' + [$demo_dir, '..',
+ 'images', 'noletter.xbm'].join(File::Separator),
+ 'tags'=>$tag_item)
+#TkcBitmap.new(cvs, '17c','21.5c',
+# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator),
+# 'tags'=>$tag_item)
+# ↓の形式でも可能
+TkcBitmap.new(cvs, '17c','21.5c') {
+ bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
+ tags $tag_item
+}
+#TkcBitmap.new(cvs, '17c','21.5c') {
+# bitmap '@' + ['images', 'letters'].join(File::Separator)
+# tags $tag_item
+#}
+
+TkcText.new(cvs, '25c', '16.2c', 'text'=>'ウィンドウ', 'anchor'=>'n')
+TkButton.new(cvs) {|b|
+ text '押してね'
+ command proc{butPress cvs, red}
+ TkcWindow.new(cvs, '21c','18c',
+ 'window'=>b, 'anchor'=>'nw', 'tags'=>$tag_item)
+}
+TkEntry.new(cvs, 'width'=>20, 'relief'=>'sunken') {|e|
+ insert 'end', '編集してね'
+ TkcWindow.new(cvs, '21c','21c',
+ 'window'=>e, 'anchor'=>'nw', 'tags'=>$tag_item)
+}
+TkScale.new(cvs, 'from'=>0, 'to'=>100, 'length'=>'6c', 'sliderlength'=>'.4c',
+ 'width'=>'.5c', 'tickinterval'=>0 ) {|scl|
+ TkcWindow.new(cvs, '28.5c','17.5c',
+ 'window'=>scl, 'anchor'=>'n', 'tags'=>$tag_item)
+}
+TkcText.new(cvs, '21c', '17.9c', 'text'=>'ボタン:', 'anchor'=>'sw')
+TkcText.new(cvs, '21c', '20.9c', 'text'=>'エントリ:', 'anchor'=>'sw')
+TkcText.new(cvs, '28.5c', '17.4c', 'text'=>'スケール:', 'anchor'=>'s')
+
+# Set up event bindings for canvas:
+cvs.itembind($tag_item, 'Any-Enter', proc{itemEnter cvs})
+cvs.itembind($tag_item, 'Any-Leave', proc{itemLeave cvs})
+cvs.bind('2', proc{|x,y| cvs.scan_mark x,y}, '%x %y')
+cvs.bind('B2-Motion', proc{|x,y| cvs.scan_dragto x,y}, '%x %y')
+cvs.bind('3', proc{|x,y| itemMark cvs,x,y}, '%x %y')
+cvs.bind('B3-Motion', proc{|x,y| itemStroke cvs,x,y}, '%x %y')
+cvs.bind('Control-f', proc{itemsUnderArea cvs})
+cvs.bind('1', proc{|x,y| itemStartDrag cvs,x,y}, '%x %y')
+cvs.bind('B1-Motion', proc{|x,y| itemDrag cvs,x,y}, '%x %y')
+# Utility methods for highlighting the item under the pointer
+
+$restoreCmd = nil
+def itemEnter (c)
+ if TkWinfo.depth(c).to_i == 1
+ $restoreCmd = nil
+ return
+ end
+ type = c.itemtype('current')
+ if type == TkcWindow
+ $restoreCmd = nil
+ return
+ end
+ if type == TkcBitmap
+ bg = (c.itemconfiginfo('current', 'background'))[4]
+ $restoreCmd = proc{c.itemconfigure 'current', 'background', bg}
+ c.itemconfigure 'current', 'background', 'SteelBlue2'
+ return
+ end
+ fill = (c.itemconfiginfo('current', 'fill'))[4]
+ if (type == TkcRectangle || type == TkcOval || type == TkcArc) && fill == []
+ outline = (c.itemconfiginfo('current', 'outline'))[4]
+ $restoreCmd = proc{c.itemconfigure 'current', 'outline', outline}
+ c.itemconfigure 'current', 'outline', 'SteelBlue2'
+ else
+ $restoreCmd = proc{c.itemconfigure 'current', 'fill', fill}
+ c.itemconfigure 'current', 'fill', 'SteelBlue2'
+ end
+end
+
+def itemLeave(c)
+ $restoreCmd.call if $restoreCmd
+end
+
+# Utility methods for stroking out a rectangle and printing what's
+# underneath the rectangle's area.
+
+def itemMark(c,x,y)
+ $areaX1 = c.canvasx(x)
+ $areaY1 = c.canvasy(y)
+ c.delete 'area'
+end
+
+def itemStroke(c,x,y)
+ x = c.canvasx(x)
+ y = c.canvasy(y)
+ if $areaX1 != x && $areaY1 != y
+ c.delete 'area'
+ c.addtag_withtag 'area', TkcRectangle.new(c, $areaX1, $areaY1, x, y,
+ '-outline', 'black')
+ $areaX2 = x
+ $areaY2 = y
+ end
+end
+
+def itemsUnderArea(c)
+ area = c.find_withtag('area')
+ items = []
+ c.find_enclosed($areaX1,$areaY1,$areaX2,$areaY2).each{|i|
+ items.push(i) if i.gettags.include?($tag_item)
+ }
+ print "Items enclosed by area: #{items.inspect}\n"; STDOUT.flush
+ items.clear
+ c.find_overlapping($areaX1,$areaY1,$areaX2,$areaY2).each{|i|
+ items.push(i) if i.gettags.include?($tag_item)
+ }
+ print "Items overlapping area: #{items.inspect}\n"; STDOUT.flush
+end
+
+$areaX1 = 0
+$areaY1 = 0
+$areaX2 = 0
+$areaY2 = 0
+
+# Utility methods to support dragging of items.
+
+def itemStartDrag(c,x,y)
+ $lastX = c.canvasx(x)
+ $lastY = c.canvasy(y)
+end
+
+def itemDrag(c,x,y)
+ x = c.canvasx(x)
+ y = c.canvasy(y)
+ c.move('current', x - $lastX, y - $lastY)
+ $lastX = x
+ $lastY = y
+end
+
+# Method that's invoked when the button embedded in the canvas
+# is invoked.
+
+def butPress(w,color)
+ i = TkcText.new(w, '25c', '18.1c',
+ 'text'=>'いてて!!', 'fill'=>color, 'anchor'=>'n')
+ Tk.after(500, proc{w.delete i})
+end
diff --git a/ext/tk/sample/demos-jp/ixset b/ext/tk/sample/demos-jp/ixset
new file mode 100644
index 0000000000..40a77f487c
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ixset
@@ -0,0 +1,333 @@
+#!/usr/bin/env ruby
+
+# ixset --
+# A nice interface to "xset" to change X server settings
+#
+
+require 'tk'
+
+class Xsettings
+ #
+ # Button actions
+ #
+ def quit
+ @root.destroy
+ end
+
+ def ok
+ writesettings
+ quit
+ end
+
+ def cancel
+ readsettings
+ dispsettings
+ end
+
+ # apply is just "writesettings"
+
+
+ #
+ # Read current settings
+ #
+ def readsettings
+ xfd = open("|xset q", 'r')
+ xfd.readlines.each{|line|
+ fields = line.chomp.strip.split(/\s+/)
+ case fields[0]
+ when "auto"
+ if fields[1] == 'repeat:'
+ @kbdrep = fields[2]
+ @w_kbdrep.set(@kbdrep)
+ @kbdcli = fields[6]
+ end
+
+ when "bell"
+ @bellvol = fields[2]
+ @bellpit = fields[5]
+ @belldur = fields[8]
+
+ when "acceleration:"
+ @mouseacc = fields[1]
+ @mousethr = fields[3]
+
+ when "prefer"
+ if fields[2] == 'yes'
+ @screenbla = 'blank'
+ else
+ @screenbla = 'noblank'
+ end
+ @w_screenbla.set(@screenbla)
+
+ when "timeout:"
+ @screentim = fields[1]
+ @screencyc = fields[3]
+
+ end
+ }
+
+ xfd.close
+ end
+
+ #
+ # Write settings into the X server
+ #
+ def writesettings
+ @bellvol = @w_bellvol.get
+ @bellpit = @w_bellpit.get
+ @belldur = @w_belldur.get
+
+ @kbdrep = @w_kbdrep.get
+ if @kbdrep == 'on'
+ @kbdcli = @w_kbdcli.get
+ else
+ @kbdcli = 'off'
+ end
+
+ @mouseacc = @w_mouseacc.get
+ @mousethr = @w_mousethr.get
+
+ @screentim = @w_screentim.get
+ @screencyc = @w_screencyc.get
+ @screenbla = @w_screenbla.get
+
+ system("xset \
+ b #{@bellvol} #{@bellpit} #{@belldur} \
+ c #{@kbdcli} \
+ r #{@kbdrep} \
+ m #{@mouseacc} #{@mousethr} \
+ s #{@screentim} #{@screencyc} \
+ s #{@screenbla}")
+ end
+
+ #
+ # Sends all settings to the window
+ #
+ def dispsettings
+ @w_bellvol.set(@bellvol)
+ @w_bellpit.set(@bellpit)
+ @w_belldur.set(@belldur)
+
+ @w_kbdonoff.set(@w_kbdrep.get)
+ @w_kbdcli.set(@kbdcli)
+
+ @w_mouseacc.set(@mouseacc)
+ @w_mousethr.set(@mousethr)
+
+ @w_screenblank.set(@w_screenbla.get)
+ @w_screenpat.set(@w_screenbla.get)
+
+ @w_screentim.set(@screentim)
+ @w_screencyc.set(@screencyc)
+ end
+
+ #
+ # Create all windows, and pack them
+ #
+ class LabelEntry
+ def initialize(parent, text, length)
+ @frame = TkFrame.new(parent)
+ TkLabel.new(@frame, 'text'=>text).pack('side'=>'left','expand'=>'y')
+ @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken') {
+ pack('side'=>'left','expand'=>'y')
+ }
+ end
+ def pack(keys)
+ @frame.pack(keys)
+ end
+ def get
+ @entry.value
+ end
+ def set(value)
+ @entry.delete(0,'end')
+ @entry.insert(0, value)
+ end
+ end
+
+ def createwindows
+ win = self
+
+ #
+ # Buttons
+ #
+ buttons = TkFrame.new(@root) {|f|
+ [ TkButton.new(f, 'command'=>proc{win.ok}, 'text'=>'Ok'),
+ TkButton.new(f, 'command'=>proc{win.writesettings}, 'text'=>'Apply'),
+ TkButton.new(f, 'command'=>proc{win.cancel}, 'text'=>'Cancel'),
+ TkButton.new(f, 'command'=>proc{win.quit}, 'text'=>'Quit') ].each{|b|
+ b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5)
+ }
+ }
+
+ #
+ # Bell settings
+ #
+ bell = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(bell, 'text'=>'Bell Settings')
+ @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>"Volume (%)")
+
+ f = TkFrame.new(bell)
+ @w_bellpit = LabelEntry.new(f, "Pitch (Hz)", 6)
+ @w_bellpit.pack('side'=>'left', 'padx'=>5)
+ @w_belldur = LabelEntry.new(f, "Duration (ms)", 6)
+ @w_belldur.pack('side'=>'right', 'padx'=>5)
+
+ l.pack('side'=>'top', 'expand'=>'yes')
+ @w_bellvol.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Keyboard settings
+ #
+ kbdonoff = nil
+ kbdcli = nil
+ kbd = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(kbd, 'text'=>'Keyboard Repeat Settings')
+ f = TkFrame.new(kbd)
+ @w_kbdonoff = TkCheckButton.new(f, 'text'=>'On', 'relief'=>'flat',
+ 'onvalue'=>'on', 'offvalue'=>'off',
+ 'variable'=>@w_kbdrep ) {
+ def self.set(value)
+ if value == 'on'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both')
+ }
+ @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>'Click Volume (%)')
+ @w_kbdcli.pack('side'=>'left', 'expand'=>'yes')
+ l.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x')
+
+ #
+ # Mouse settings
+ #
+ mouse = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(mouse, 'text'=>'Mouse Settings')
+ f = TkFrame.new(mouse)
+ @w_mouseacc = LabelEntry.new(f, 'Acceleration', 3)
+ @w_mouseacc.pack('side'=>'left')
+ @w_mousethr = LabelEntry.new(f, 'Threshold (pixels)', 3)
+ @w_mousethr.pack('side'=>'right')
+ l.pack('side'=>'top')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Screen Saver settings
+ #
+ screen = TkFrame.new(@root, 'relief'=>'raised', 'borderwidth'=>2)
+ l = TkLabel.new(screen, 'text'=>'Screen-saver Settings')
+ f = TkFrame.new(screen)
+ ff1 = TkFrame.new(f)
+ [ @w_screenblank = TkRadioButton.new(ff1, 'text'=>'Blank',
+ 'relief'=>'flat',
+ 'variable'=>@w_screenbla,
+ 'value'=>'blank') {
+ def self.set(value)
+ if value == 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ },
+ @w_screenpat = TkRadioButton.new(ff1, 'text'=>'Pattern',
+ 'relief'=>'flat',
+ 'variable'=>@w_screenbla,
+ 'value'=>'noblank') {
+ def self.set(value)
+ if value != 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+ ].each {|w| w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w') }
+
+ ff2 = TkFrame.new(f)
+ [ @w_screentim = LabelEntry.new(ff2, 'Timeout (s)', 5),
+ @w_screencyc = LabelEntry.new(ff2, 'Cycle (s)', 5) ].each{|w|
+ w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'e')
+ }
+
+ ff1.pack('side'=>'left')
+ ff2.pack('side'=>'left')
+
+ l.pack('side'=>'top')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Main window
+ #
+ buttons.pack('side'=>'top', 'fill'=>'both')
+ bell.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ kbd.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ mouse.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+ screen.pack('side'=>'top', 'fill'=>'both', 'ipady'=>5, 'expand'=>'yes')
+
+ #
+ # Let the user resize our window
+ #
+ @root.minsize(10,10)
+ end
+
+ def initialize
+ @root = TkRoot.new
+
+ @kbdrep = 'on'
+ @w_kbdrep = TkVariable.new(@kbdrep)
+ def @w_kbdrep.get
+ self.value
+ end
+ def @w_kbdrep.set(val)
+ self.value=val
+ end
+
+ @kbdcli = 0
+
+ @bellvol = 100
+ @bellpit = 440
+ @belldur = 100
+
+ @mouseacc = "3/1"
+ @mousethr = 4
+
+ @screenbla = "blank"
+ @w_screenbla = TkVariable.new(@screenbla)
+ def @w_screenbla.get
+ self.value
+ end
+ def @w_screenbla.set(val)
+ self.value=val
+ end
+
+ @screentim = 600
+ @screencyc = 600
+
+ #
+ # Listen what "xset" tells us...
+ #
+ readsettings
+
+ #
+ # Create all windows
+ #
+ createwindows
+
+ #
+ # Write xset parameters
+ #
+ dispsettings
+ end
+end
+
+Xsettings.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/ixset2 b/ext/tk/sample/demos-jp/ixset2
new file mode 100644
index 0000000000..e11ce2ac8f
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ixset2
@@ -0,0 +1,369 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+# ixset --
+# A nice interface to "xset" to change X server settings
+#
+
+require 'tk'
+
+class Xsettings
+ #
+ # Button actions
+ #
+ def quit
+ @root.destroy
+ end
+
+ def ok
+ writesettings
+ quit
+ end
+
+ def cancel
+ readsettings
+ dispsettings
+ @btn_APPLY.state(:disabled)
+ @btn_CANCEL.state(:disabled)
+ end
+
+ # apply is just "writesettings"
+ def apply
+ writesettings
+ @btn_APPLY.state(:disabled)
+ @btn_CANCEL.state(:disabled)
+ end
+
+ #
+ # Read current settings
+ #
+ def readsettings
+ xfd = open("|xset q", 'r')
+ xfd.readlines.each{|line|
+ fields = line.chomp.strip.split(/\s+/)
+ case fields[0]
+ when "auto"
+ if fields[1] == 'repeat:'
+ @kbdrep = fields[2]
+ @w_kbdrep.set(@kbdrep)
+ @kbdcli = fields[6]
+ end
+
+ when "bell"
+ @bellvol = fields[2]
+ @bellpit = fields[5]
+ @belldur = fields[8]
+
+ when "acceleration:"
+ @mouseacc = fields[1]
+ @mousethr = fields[3]
+
+ when "prefer"
+ if fields[2] == 'yes'
+ @screenbla = 'blank'
+ else
+ @screenbla = 'noblank'
+ end
+ @w_screenbla.set(@screenbla)
+
+ when "timeout:"
+ @screentim = fields[1]
+ @screencyc = fields[3]
+
+ end
+ }
+
+ xfd.close
+ end
+
+ #
+ # Write settings into the X server
+ #
+ def writesettings
+ @bellvol = @w_bellvol.get
+ @bellpit = @w_bellpit.get
+ @belldur = @w_belldur.get
+
+ @kbdrep = @w_kbdrep.get
+ if @kbdrep == 'on'
+ @kbdcli = @w_kbdcli.get
+ else
+ @kbdcli = 'off'
+ end
+
+ @mouseacc = @w_mouseacc.get
+ @mousethr = @w_mousethr.get
+
+ @screentim = @w_screentim.get
+ @screencyc = @w_screencyc.get
+ @screenbla = @w_screenbla.get
+
+ system("xset \
+ b #{@bellvol} #{@bellpit} #{@belldur} \
+ c #{@kbdcli} \
+ r #{@kbdrep} \
+ m #{@mouseacc} #{@mousethr} \
+ s #{@screentim} #{@screencyc} \
+ s #{@screenbla}")
+ end
+
+ #
+ # Sends all settings to the window
+ #
+ def dispsettings
+ @w_bellvol.set(@bellvol)
+ @w_bellpit.set(@bellpit)
+ @w_belldur.set(@belldur)
+
+ @w_kbdonoff.set(@w_kbdrep.get)
+ @w_kbdcli.set(@kbdcli)
+
+ @w_mouseacc.set(@mouseacc)
+ @w_mousethr.set(@mousethr)
+
+ @w_screenblank.set(@w_screenbla.get)
+ @w_screenpat.set(@w_screenbla.get)
+
+ @w_screentim.set(@screentim)
+ @w_screencyc.set(@screencyc)
+ end
+
+ #
+ # Create all windows, and pack them
+ #
+ class LabelEntry
+ def initialize(parent, text, length, range=[])
+ @frame = TkFrame.new(parent)
+ TkLabel.new(@frame, 'text'=>text).pack('side'=>'left')
+ if range.size > 0
+ @entry = TkSpinbox.new(@frame, 'width'=>length, 'relief'=>'sunken',
+ 'from'=>range[0], 'to'=>range[1])
+ else
+ @entry = TkEntry.new(@frame, 'width'=>length, 'relief'=>'sunken')
+ end
+ @entry.pack('side'=>'right','expand'=>'y', 'fill'=>'x')
+ end
+ def epath
+ @frame
+ end
+ def pack(keys)
+ @frame.pack(keys)
+ end
+ def get
+ @entry.value
+ end
+ def set(value)
+ @entry.delete(0,'end')
+ @entry.insert(0, value)
+ end
+ end
+
+ def createwindows
+ win = self
+
+ #
+ # Buttons
+ #
+ btn_frame = TkFrame.new(@root)
+ buttons = [
+ @btn_OK = TkButton.new(btn_frame, 'command'=>proc{win.ok},
+ 'default'=>'active', 'text'=>'了解'),
+ @btn_APPLY = TkButton.new(btn_frame, 'command'=>proc{win.writesettings},
+ 'default'=>'normal', 'text'=>'適用',
+ 'state'=>'disabled'),
+ @btn_CANCEL = TkButton.new(btn_frame, 'command'=>proc{win.cancel},
+ 'default'=>'normal', 'text'=>'取消',
+ 'state'=>'disabled'),
+ @btn_QUIT = TkButton.new(btn_frame, 'command'=>proc{win.quit},
+ 'default'=>'normal', 'text'=>'中止')
+ ]
+ buttons.each{|b| b.pack('side'=>'left', 'expand'=>'yes', 'pady'=>5) }
+
+ @root.bind('Return', proc{@btn_OK.flash; @btn_OK.invoke})
+ @root.bind('Escape', proc{@btn_QUIT.flash; @btn_QUIT.invoke})
+ @root.bind('1', proc{|w|
+ unless buttons.index(w)
+ @btn_APPLY.state(:normal)
+ @btn_CANCEL.state(:normal)
+ end
+ }, '%W')
+ @root.bind('Key', proc{|w, k|
+ unless buttons.index(w)
+ case k
+ when 'Return', 'Escape', 'Tab', /.*Shift.*/
+ # do nothing
+ else
+ @btn_APPLY.state(:normal)
+ @btn_CANCEL.state(:normal)
+ end
+ end
+ }, '%W %K')
+
+ #
+ # Bell settings
+ #
+ bell = TkLabelframe.new(@root, 'text'=>'ベル設定',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ @w_bellvol = TkScale.new(bell, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>"音量 (%)")
+
+ f = TkFrame.new(bell)
+ @w_bellpit = LabelEntry.new(f, "音程 (Hz)", 6, [25, 20000])
+ @w_bellpit.pack('side'=>'left', 'padx'=>5)
+ @w_belldur = LabelEntry.new(f, "持続時間 (ms)", 6, [1, 10000])
+ @w_belldur.pack('side'=>'right', 'padx'=>5)
+
+ @w_bellvol.pack('side'=>'top', 'expand'=>'yes')
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Keyboard settings
+ #
+ kbdonoff = nil
+ kbdcli = nil
+ kbd = TkLabelframe.new(@root, 'text'=>'キーボードリピート設定',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ f = TkFrame.new(kbd)
+ @w_kbdonoff = TkCheckButton.new(f, 'text'=>'クリック音あり',
+ 'relief'=>'flat',
+ 'onvalue'=>'on', 'offvalue'=>'off',
+ 'variable'=>@w_kbdrep ) {
+ def self.set(value)
+ if value == 'on'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x', 'padx'=>[0, '1m'])
+ }
+ @w_kbdcli = TkScale.new(f, 'from'=>0, 'to'=>100, 'length'=>200,
+ 'tickinterval'=>20, 'orient'=>'horizontal',
+ 'label'=>'クリック音量 (%)')
+ @w_kbdcli.pack('side'=>'left', 'expand'=>'yes',
+ 'fill'=>'x', 'padx'=>['1m', 0])
+ f.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'fill'=>'x')
+
+ #
+ # Mouse settings
+ #
+ mouse = TkLabelframe.new(@root, 'text'=>'マウス設定',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ f = TkFrame.new(mouse)
+ @w_mouseacc = LabelEntry.new(f, '加速量', 5)
+ @w_mouseacc.pack('side'=>'left', 'padx'=>[0, '1m'])
+ @w_mousethr = LabelEntry.new(f, '閾値 (pixels)', 3, [1, 2000])
+ @w_mousethr.pack('side'=>'right', 'padx'=>['1m', 0])
+ f.pack('side'=>'top', 'expand'=>'yes')
+
+ #
+ # Screen Saver settings
+ #
+ screen = TkLabelframe.new(@root, 'text'=>'スクリーンセーバ設定',
+ 'padx'=>'1.5m', 'pady'=>'1.5m')
+ @w_screenblank = TkRadioButton.new(screen, 'text'=>'ブランク表示',
+ 'relief'=>'flat', 'anchor'=>'w',
+ 'variable'=>@w_screenbla,
+ 'value'=>'blank') {
+ def self.set(value)
+ if value == 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+
+ @w_screenpat = TkRadioButton.new(screen, 'text'=>'パターン表示',
+ 'relief'=>'flat', 'anchor'=>'w',
+ 'variable'=>@w_screenbla,
+ 'value'=>'noblank') {
+ def self.set(value)
+ if value != 'blank'
+ self.select
+ else
+ self.deselect
+ end
+ end
+ }
+
+ @w_screentim = LabelEntry.new(screen, 'タイムアウト (s)', 5, [1, 100000])
+ @w_screencyc = LabelEntry.new(screen, '周期 (s)', 5, [1, 100000])
+
+ Tk.grid(@w_screenblank, @w_screentim, 'sticky'=>'e')
+ Tk.grid(@w_screenpat, @w_screencyc, 'sticky'=>'e')
+ TkGrid.configure(@w_screenblank, @w_screenpat, 'sticky'=>'ew')
+
+ #
+ # Main window
+ #
+ param = {
+ 'side'=>'top', 'fill'=>'both', 'expand'=>'yes',
+ 'padx'=>'1m', 'pady'=>'1m'
+ }
+ btn_frame.pack('side'=>'top', 'fill'=>'both')
+ bell.pack(param)
+ kbd.pack(param)
+ mouse.pack(param)
+ screen.pack(param)
+
+ #
+ # Let the user resize our window
+ #
+ @root.minsize(10,10)
+ end
+
+ def initialize(title)
+ @root = TkRoot.new('title'=>title)
+
+ @kbdrep = 'on'
+ @w_kbdrep = TkVariable.new(@kbdrep)
+ def @w_kbdrep.get
+ self.value
+ end
+ def @w_kbdrep.set(val)
+ self.value=val
+ end
+
+ @kbdcli = 0
+
+ @bellvol = 100
+ @bellpit = 440
+ @belldur = 100
+
+ @mouseacc = "3/1"
+ @mousethr = 4
+
+ @screenbla = "blank"
+ @w_screenbla = TkVariable.new(@screenbla)
+ def @w_screenbla.get
+ self.value
+ end
+ def @w_screenbla.set(val)
+ self.value=val
+ end
+
+ @screentim = 600
+ @screencyc = 600
+
+ #
+ # Listen what "xset" tells us...
+ #
+ readsettings
+
+ #
+ # Create all windows
+ #
+ createwindows
+
+ #
+ # Write xset parameters
+ #
+ dispsettings
+ end
+end
+
+Xsettings.new(File.basename($0,'.rb'))
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/knightstour.rb b/ext/tk/sample/demos-jp/knightstour.rb
new file mode 100644
index 0000000000..835a24c392
--- /dev/null
+++ b/ext/tk/sample/demos-jp/knightstour.rb
@@ -0,0 +1,273 @@
+# -*- coding: utf-8 -*-
+#
+# Based on the widget demo of Tcl/Tk8.5.2
+# The following is the original copyright text.
+#----------------------------------------------------------------------------
+# Copyright (C) 2008 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# Calculate a Knight's tour of a chessboard.
+#
+# This uses Warnsdorff's rule to calculate the next square each
+# time. This specifies that the next square should be the one that
+# has the least number of available moves.
+#
+# Using this rule it is possible to get to a position where
+# there are no squares available to move into. In this implementation
+# this occurs when the starting square is d6.
+#
+# To solve this fault an enhancement to the rule is that if we
+# have a choice of squares with an equal score, we should choose
+# the one nearest the edge of the board.
+#
+# If the call to the Edgemost function is commented out you can see
+# this occur.
+#
+# You can drag the knight to a specific square to start if you wish.
+# If you let it repeat then it will choose random start positions
+# for each new tour.
+#----------------------------------------------------------------------------
+require 'tk'
+
+class Knights_Tour
+ # Return a list of accessible squares from a given square
+ def valid_moves(square)
+ moves = []
+ [
+ [-1,-2], [-2,-1], [-2,1], [-1,2], [1,2], [2,1], [2,-1], [1,-2]
+ ].each{|col_delta, row_delta|
+ col = (square % 8) + col_delta
+ row = (square.div(8)) + row_delta
+ moves << (row * 8 + col) if row > -1 && row < 8 && col > -1 && col < 8
+ }
+ moves
+ end
+
+ # Return the number of available moves for this square
+ def check_square(square)
+ valid_moves(square).find_all{|pos| ! @visited.include?(pos)}.length
+ end
+
+ # Select the next square to move to. Returns -1 if there are no available
+ # squares remaining that we can move to.
+ def next_square(square)
+ minimum = 9
+ nxt = -1
+ valid_moves(square).each{|pos|
+ unless @visited.include?(pos)
+ cnt = check_square(pos)
+ if cnt < minimum
+ minimum = cnt
+ nxt = pos
+ elsif cnt == minimum
+ nxt = edgemost(nxt, pos)
+ end
+ end
+ }
+ nxt
+ end
+
+ # Select the square nearest the edge of the board
+ def edgemost(nxt, pos)
+ col_A = 3 - ((3.5 - nxt % 8).abs.to_i)
+ col_B = 3 - ((3.5 - pos % 8).abs.to_i)
+ row_A = 3 - ((3.5 - nxt.div(8)).abs.to_i)
+ row_B = 3 - ((3.5 - pos.div(8)).abs.to_i)
+ (col_A * row_A < col_B * row_B)? nxt : pos
+ end
+
+ # Display a square number as a standard chess square notation.
+ def _N(square)
+ '%c%d' % [(97 + square % 8), (square.div(8) + 1)]
+ end
+
+ # Perform a Knight's move and schedule the next move.
+ def move_piece(last, square)
+ @log.insert(:end, "#{@visited.length}. #{_N last} -> #{_N square}\n", '')
+ @log.see(:end)
+ @board.itemconfigure(1+last, :state=>:normal, :outline=>'black')
+ @board.itemconfigure(1+square, :state=>:normal, :outline=>'red')
+ @knight.coords(@board.coords(1+square)[0..1])
+ @visited << square
+ if (nxt = next_square(square)) != -1
+ @after_id = Tk.after(@delay.numeric){move_piece(square, nxt) rescue nil}
+ else
+ @start_btn.state :normal
+ if @visited.length == 64
+ if @initial == square
+ @log.insert :end, '周遊(closed tour)成功!'
+ else
+ @log.insert :end, "成功\n", {}
+ Tk.after(@delay.numeric * 2){tour(rand(64))} if @continuous.bool
+ end
+ else
+ @log.insert :end, "失敗!\n", {}
+ end
+ end
+ end
+
+ # Begin a new tour of the board given a random start position
+ def tour(square = nil)
+ @visited.clear
+ @log.clear
+ @start_btn.state :disabled
+ 1.upto(64){|n|
+ @board.itemconfigure(n, :state=>:disabled, :outline=>'black')
+ }
+ unless square
+ square = @board.find_closest(*(@knight.coords << 0 << 65))[0].to_i - 1
+ end
+ @initial = square
+ Tk.after_idle{ move_piece(@initial, @initial) rescue nil }
+ end
+
+ def _stop
+ Tk.after_cancel(@after_id) rescue nil
+ end
+
+ def _exit
+ _stop
+ $knightstour.destroy
+ end
+
+ def set_delay(new)
+ @delay.numeric = new.to_i
+ end
+
+ def drag_start(w, x, y)
+ w.dtag('selected')
+ w.addtag('selected', :withtag, 'current')
+ @dragging = [x, y]
+ end
+
+ def drag_motion(w, x, y)
+ return unless @dragging
+ w.move('selected', x - @dragging[0], y - @dragging[1])
+ @dragging = [x, y]
+ end
+
+ def drag_end(w, x, y)
+ square = w.find_closest(x, y, 0, 65)
+ w.coords('selected', w.coords(square)[0..1])
+ w.dtag('selected')
+ @dragging = nil
+ end
+
+ def make_SeeDismiss
+ ## See Code / Dismiss
+ frame = Ttk::Frame.new($knightstour)
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'knightstour'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $knightstour.destroy
+ $knightstour = nil
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+ frame
+ end
+
+ def create_gui(parent = nil)
+ $knightstour.destroy rescue nil
+ $knightstour = Tk::Toplevel.new(parent, :title=>"Knight's tour")
+ $knightstour.withdraw
+ base_f = Ttk::Frame.new($knightstour)
+ @board = Tk::Canvas.new(base_f, :width=>240, :height=>240)
+ @log = Tk::Text.new(base_f, :width=>12, :height=>1,
+ :font=>'Arial 8', :background=>'white')
+ scr = @log.yscrollbar(Ttk::Scrollbar.new(base_f))
+
+ @visited = []
+ @delay = TkVariable.new(600)
+ @continuous = TkVariable.new(false)
+
+ tool_f = Ttk::Frame.new($knightstour)
+ label = Ttk::Label.new(tool_f, :text=>'実行速度')
+ scale = Ttk::Scale.new(tool_f, :from=>8, :to=>2000, :variable=>@delay,
+ :command=>proc{|n| set_delay(n)})
+ check = Ttk::Checkbutton.new(tool_f, :text=>'反復',
+ :variable=>@continuous)
+ @start_btn = Ttk::Button.new(tool_f, :text=>'開始',
+ :command=>proc{tour()})
+ @exit_btn = Ttk::Button.new(tool_f, :text=>'終了',
+ :command=>proc{_exit()})
+
+ 7.downto(0){|row|
+ 0.upto(7){|col|
+ if ((col & 1) ^ (row & 1)).zero?
+ fill = 'bisque'
+ dfill = 'bisque3'
+ else
+ fill = 'tan3'
+ dfill = 'tan4'
+ end
+ coords = [col * 30 + 4, row * 30 + 4, col * 30 + 30, row * 30 + 30]
+ @board.create(TkcRectangle, coords,
+ :fill=>fill, :disabledfill=>dfill,
+ :width=>2, :state=>:disabled)
+ }
+ }
+
+ @knight_font = TkFont.new(:size=>-24)
+ @knight = TkcText.new(@board, 0, 0, :font=>@knight_font,
+ :text=>Tk::UTF8_String.new('\u265e'),
+ :anchor=>'nw', # :tags=>'knight',
+ :fill=>'black', :activefill=>'#600000')
+ @knight.coords(@board.coords(rand(64)+1)[0..1])
+ @knight.bind('ButtonPress-1', '%W %x %y'){|w,x,y| drag_start(w,x,y)}
+ @knight.bind('Motion', '%W %x %y'){|w,x,y| drag_motion(w,x,y)}
+ @knight.bind('ButtonRelease-1', '%W %x %y'){|w,x,y| drag_end(w,x,y)}
+
+ Tk.grid(@board, @log, scr, :sticky=>'news')
+ base_f.grid_rowconfigure(0, :weight=>1)
+ base_f.grid_columnconfigure(0, :weight=>1)
+
+ Tk.grid(base_f, '-', '-', '-', '-', '-', :sticky=>'news')
+ widgets = [label, scale, check, @start_btn]
+ sg = nil
+ unless $RubyTk_WidgetDemo
+ widgets << @exit_btn
+ if Tk.windowingsystem != 'aqua'
+ #widgets.unshift(Ttk::SizeGrip.new(tool_f))
+ Ttk::SizeGrip.new(tool_f).pack(:side=>:right, :anchor=>'se')
+ end
+ end
+ Tk.pack(widgets, :side=>:right)
+ if Tk.windowingsystem == 'aqua'
+ TkPack.configure(widgets, :padx=>[4, 4], :pady=>[12, 12])
+ TkPack.configure(widgets[0], :padx=>[4, 24])
+ TkPack.configure(widgets[-1], :padx=>[16, 4])
+ end
+
+ Tk.grid(tool_f, '-', '-', '-', '-', '-', :sticky=>'ew')
+
+ if $RubyTk_WidgetDemo
+ Tk.grid(make_SeeDismiss(), '-', '-', '-', '-', '-', :sticky=>'ew')
+ end
+
+ $knightstour.grid_rowconfigure(0, :weight=>1)
+ $knightstour.grid_columnconfigure(0, :weight=>1)
+
+ $knightstour.bind('Control-F2'){TkConsole.show}
+ $knightstour.bind('Return'){@start_btn.invoke}
+ $knightstour.bind('Escape'){@exit_btn.invoke}
+ $knightstour.bind('Destroy'){ _stop }
+ $knightstour.protocol('WM_DELETE_WINDOW'){ _exit }
+
+ $knightstour.deiconify
+ $knightstour.tkwait_destroy
+ end
+
+ def initialize(parent = nil)
+ create_gui(parent)
+ end
+end
+
+Tk.root.withdraw unless $RubyTk_WidgetDemo
+Thread.new{Tk.mainloop} if __FILE__ == $0
+Knights_Tour.new
diff --git a/ext/tk/sample/demos-jp/label.rb b/ext/tk/sample/demos-jp/label.rb
new file mode 100644
index 0000000000..700e6a61ce
--- /dev/null
+++ b/ext/tk/sample/demos-jp/label.rb
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+#
+# label widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($label_demo) && $label_demo
+ $label_demo.destroy
+ $label_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$label_demo = TkToplevel.new {|w|
+ title("Label Demonstration")
+ iconname("label")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($label_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には5つのラベルが表示されています。左側にはテキストラベルが3つあり、右側にはビットマップラベルとテキストラベルがあります。ラベルというのはあまり面白いものではありません。なぜなら眺める以外何もできないからです。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $label_demo
+ $label_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'label'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# label demo 用フレーム生成
+f_left = TkFrame.new(base_frame)
+f_right = TkFrame.new(base_frame)
+[f_left, f_right].each{|w| w.pack('side'=>'left', 'expand'=>'yes',
+ 'padx'=>10, 'pady'=>10, 'fill'=>'both')}
+
+# label 生成
+[ TkLabel.new(f_left, 'text'=>'最初のラベル'),
+ TkLabel.new(f_left, 'text'=>'2 番目。ちょっと浮き上がらせてみました',
+ 'relief'=>'raised'),
+ TkLabel.new(f_left, 'text'=>'3 番目。沈んでいます ', 'relief'=>'sunken')
+].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')}
+
+# TkLabel.new(f_right) {
+Tk::Label.new(f_right) {
+ bitmap('@' + [$demo_dir,'..','images','face.xbm'].join(File::Separator))
+ borderwidth 2
+ relief 'sunken'
+}.pack('side'=>'top')
+
+TkLabel.new(f_right) { text 'Tcl/Tk 所有者' }.pack('side'=>'top')
diff --git a/ext/tk/sample/demos-jp/labelframe.rb b/ext/tk/sample/demos-jp/labelframe.rb
new file mode 100644
index 0000000000..80e106c6e7
--- /dev/null
+++ b/ext/tk/sample/demos-jp/labelframe.rb
@@ -0,0 +1,102 @@
+# -*- coding: utf-8 -*-
+#
+# labelframe.rb
+#
+# This demonstration script creates a toplevel window containing
+# several labelframe widgets.
+#
+# based on "Id: labelframe.tcl,v 1.2 2001/10/30 11:21:50 dkf Exp"
+
+
+if defined?($labelframe_demo) && $labelframe_demo
+ $labelframe_demo.destroy
+ $labelframe_demo = nil
+end
+
+$labelframe_demo = TkToplevel.new {|w|
+ title("Labelframe Demonstration")
+ iconname("labelframe")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($labelframe_demo).pack(:fill=>:both, :expand=>true)
+
+# Some information
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+TkLabelFrame ウィジェットは関連する widget
+群をまとめて取り扱うために用いられます。ラ
+ベルは通常の文字列でも何らかのウィジェット
+でもかまいません。もしあなたが使っている
+Ruby にリンクされている Tk ライブラリが
+labelframe ウィジェットを実装していない
+場合、このデモはうまく動かないはずです。
+その場合には labelframe ウィジェットが実装
+されているようなより新しいバージョンの Tk
+を組み合わせて試すようにしてください。
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $labelframe_demo.destroy
+ $labelframe_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'labelframe'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+# Demo area
+w = TkFrame.new(base_frame).pack(:side=>:bottom, :fill=>:both,
+ :expand=>true)
+
+# A group of radiobuttons in a labelframe
+TkLabelFrame.new(w, :text=>'選択値',
+ :padx=>2, :pady=>2) {|f|
+ grid(:row=>0, :column=>0, :pady=>'2m', :padx=>'2m')
+
+ v = TkVariable.new
+ (1..4).each{|i|
+ TkRadiobutton.new(f, :text=>"This is value #{i}",
+ :variable=>v, :value=>i) {
+ pack(:side=>:top, :fill=>:x, :pady=>2)
+ }
+ }
+}
+
+
+# Using a label window to control a group of options.
+$lfdummy = TkVariable.new(0)
+
+def lfEnableButtons(w)
+ TkWinfo.children(w).each{|child|
+ next if child.path =~ /\.cb$/
+ if $lfdummy == 1
+ child.state(:normal)
+ else
+ child.state(:disabled)
+ end
+ }
+end
+
+TkLabelFrame.new(w, :pady=>2, :padx=>2){|f|
+ TkCheckButton.new(f, :widgetname=>'cb', :variable=>$lfdummy,
+ :text=>"オプションを使用", :padx=>0) {|cb|
+ command proc{lfEnableButtons(f)}
+ f.labelwidget(cb)
+ }
+ grid(:row=>0, :column=>1, :pady=>'2m', :padx=>'2m')
+
+ %w(オプション1 オプション2 オプション3).each{|str|
+ TkCheckbutton.new(f, :text=>str).pack(:side=>:top, :fill=>:x, :pady=>2)
+ }
+
+ lfEnableButtons(f)
+}
+
+TkGrid.columnconfigure(w, [0,1], :weight=>1)
diff --git a/ext/tk/sample/demos-jp/mclist.rb b/ext/tk/sample/demos-jp/mclist.rb
new file mode 100644
index 0000000000..67cec638eb
--- /dev/null
+++ b/ext/tk/sample/demos-jp/mclist.rb
@@ -0,0 +1,121 @@
+# -*- coding: utf-8 -*-
+#
+# mclist.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# tree widget configured as a multi-column listbox.
+#
+# based on "Id: mclist.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($mclist_demo) && $mclist_demo
+ $mclist_demo.destroy
+ $mclist_demo = nil
+end
+
+$mclist_demo = TkToplevel.new {|w|
+ title("Multi-Column List")
+ iconname("mclist")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($mclist_demo).pack(:fill=>:both, :expand=>true)
+
+## Explanatory text
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
+ :text=><<EOL).pack(:fill=>:x)
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+Ttk::Treeviewウィジェットは\
+Ttkウィジェットセットに含まれるウィジェットの一つで,\
+それが保持する木構造のデータそのものまでは表示することなく,\
+示したい情報をマルチカラムで表示させることができます.
+このサンプルは,複数のカラムを持ったリストボックスを作成する簡単な例です.
+各カラムのタイトル(heading)をクリックすれば,\
+そのカラムの情報に基づいてリストの並べ替えがなされるはずです.\
+また,カラムのタイトル間の区切り部分をドラッグすることで,\
+カラムの幅を変更することも可能です.
+EOL
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'mclist'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $mclist_demo.destroy
+ $mclist_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+container = Ttk::Frame.new(base_frame)
+tree = Ttk::Treeview.new(base_frame, :columns=>%w(country capital currency),
+ :show=>:headings)
+if Tk.windowingsystem != 'aquq'
+ vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Ttk::Scrollbar.new(base_frame))
+else
+ vsb = tree.yscrollbar(Tk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Tk::Scrollbar.new(base_frame))
+end
+
+container.pack(:fill=>:both, :expand=>true)
+Tk.grid(tree, vsb, :in=>container, :sticky=>'nsew')
+Tk.grid(hsb, :in=>container, :sticky=>'nsew')
+container.grid_columnconfigure(0, :weight=>1)
+container.grid_rowconfigure(0, :weight=>1)
+
+## The data we're going to insert
+data = [
+ ['アルゼンチン', 'ブエノスアイレス', 'ARS'],
+ ['オーストラリア', 'キャンベラ', 'AUD'],
+ ['ブラジル', 'ブラジリア', 'BRL'],
+ ['カナダ', 'オタワ', 'CAD'],
+ ['中国', '北京', 'CNY'],
+ ['フランス', 'パリ', 'EUR'],
+ ['ドイツ', 'ベルリン', 'EUR'],
+ ['インド', 'ニューデリー', 'INR'],
+ ['イタリア', 'ローマ', 'EUR'],
+ ['日本', '東京', 'JPY'],
+ ['メキシコ', 'メキシコシティ', 'MXN'],
+ ['ロシア', 'モスクワ', 'RUB'],
+ ['南アフリカ', 'プレトリア', 'ZAR'],
+ ['英国', 'ロンドン', 'GBP'],
+ ['アメリカ', 'ワシントン D.C.', 'USD'],
+]
+
+## Code to insert the data nicely
+font = Ttk::Style.lookup(tree[:style], :font)
+cols = %w(country capital currency)
+cols.zip(%w(国名 首都 通貨)).each{|col, name|
+ tree.heading_configure(col, :text=>name,
+ :command=>proc{sort_by(tree, col, false)})
+ tree.column_configure(col, :width=>TkFont.measure(font, name))
+}
+
+data.each{|country, capital, currency|
+ #tree.insert('', :end, :values=>[country, capital, currency])
+ tree.insert(nil, :end, :values=>[country, capital, currency])
+ cols.zip([country, capital, currency]).each{|col, val|
+ len = TkFont.measure(font, "#{val} ")
+ if tree.column_cget(col, :width) < len
+ tree.column_configure(col, :width=>len)
+ end
+ }
+}
+
+## Code to do the sorting of the tree contents when clicked on
+def sort_by(tree, col, direction)
+ tree.children(nil).map!{|row| [tree.get(row, col), row.id]} .
+ sort(&((direction)? proc{|x, y| y <=> x}: proc{|x, y| x <=> y})) .
+ each_with_index{|info, idx| tree.move(info[1], nil, idx)}
+
+ tree.heading_configure(col, :command=>proc{sort_by(tree, col, ! direction)})
+end
diff --git a/ext/tk/sample/demos-jp/menu.rb b/ext/tk/sample/demos-jp/menu.rb
new file mode 100644
index 0000000000..05ea7a9ec2
--- /dev/null
+++ b/ext/tk/sample/demos-jp/menu.rb
@@ -0,0 +1,201 @@
+# -*- coding: utf-8 -*-
+#
+# menus widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($menu_demo) && $menu_demo
+ $menu_demo.destroy
+ $menu_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$menu_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("menu")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($menu_demo).pack(:fill=>:both, :expand=>true)
+
+# menu frame 生成
+$menu_frame = TkFrame.new(base_frame, 'relief'=>'raised', 'bd'=>2)
+$menu_frame.pack('side'=>'top', 'fill'=>'x')
+
+begin
+ windowingsystem = Tk.windowingsystem()
+rescue
+ windowingsystem = ""
+end
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
+ else
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
+ end
+}.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $menu_demo
+ $menu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'menu'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# menu 生成
+TkMenubutton.new($menu_frame, 'text'=>'File', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|file_menu|
+ m.configure('menu'=>file_menu)
+ add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'})
+ add('separator')
+ add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'})
+ add('separator')
+ add('command', 'label'=>'終了', 'command'=>proc{$menu_demo.destroy})
+ }
+}
+
+if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ modifier = 'Command'
+elsif $tk_platform['platform'] == 'windows'
+ modifier = 'Control'
+else
+ modifier = 'Meta'
+end
+
+TkMenubutton.new($menu_frame, 'text'=>'Basic', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|basic_menu|
+ m.configure('menu'=>basic_menu)
+ add('command', 'label'=>'何もしない長いエントリ')
+ ['A','B','C','D','E','F','G'].each{|c|
+ # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
+ 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
+ $menu_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Cascades', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
+ m.configure('menu'=>cascade_menu)
+ add('command', 'label'=>'Print hello(こんにちは)',
+ 'command'=>proc{print "Hello(こんにちは)\n"},
+ 'accelerator'=>"#{modifier}+H", 'underline'=>6)
+ $menu_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"})
+ add('command', 'label'=>'Print goodbye(さようなら)',
+ 'command'=>proc{print "Goodbye(さようなら)\n"},
+ 'accelerator'=>"#{modifier}+G", 'underline'=>6)
+ $menu_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"})
+
+ # TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
+ TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_check|
+ cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)',
+ 'menu'=>cascade_check, 'underline'=>0)
+ oil = TkVariable.new(0)
+ add('check', 'label'=>'オイル点検', 'variable'=>oil)
+ trans = TkVariable.new(0)
+ add('check', 'label'=>'トランスミッション点検', 'variable'=>trans)
+ brakes = TkVariable.new(0)
+ add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes)
+ lights = TkVariable.new(0)
+ add('check', 'label'=>'ライト点検', 'variable'=>lights)
+ add('separator')
+ add('command', 'label'=>'現在の値を表示',
+ 'command'=>proc{showVars($menu_demo,
+ ['オイル点検', oil],
+ ['トランスミッション点検', trans],
+ ['ブレーキ点検', brakes],
+ ['ライト点検', lights])} )
+ invoke 1
+ invoke 3
+ }
+
+ #TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
+ TkMenu.new(cascade_menu, 'tearoff'=>false) {|cascade_radio|
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)',
+ 'menu'=>cascade_radio, 'underline'=>0)
+ pointSize = TkVariable.new
+ add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32)
+ add('separator')
+ style = TkVariable.new
+ add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic')
+ add('separator')
+ add('command', 'label'=>'現在の値を表示',
+ 'command'=>proc{showVars($menu_demo,
+ ['ポイントサイズ', pointSize],
+ ['スタイル', style])} )
+ invoke 1
+ invoke 7
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|icon_menu|
+ m.configure('menu'=>icon_menu)
+ add('command',
+ 'bitmap'=>'@'+[$demo_dir,'..',
+ 'images','pattern.xbm'].join(File::Separator),
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。',
+ 'bitmap'=>'', 'default'=>0,
+ 'buttons'=>'了解')} )
+ ['info', 'questhead', 'error'].each{|icon|
+ add('command', 'bitmap'=>icon,
+ 'command'=>proc{print "You invoked the #{icon} bitmap\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'More', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m, 'tearoff'=>false) {|more_menu|
+ m.configure('menu'=>more_menu)
+ [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない',
+ '人生を意義あるものに' ].each{|i|
+ add('command', 'label'=>i,
+ 'command'=>proc{print "You invoked \"#{i}\"\n"})
+ }
+ }
+}
+
+TkMenubutton.new($menu_frame, 'text'=>'Colors', 'underline'=>0) {|m|
+ pack('side'=>'left')
+ TkMenu.new(m) {|colors_menu|
+ m.configure('menu'=>colors_menu)
+ ['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
+ add('command', 'label'=>c, 'background'=>c,
+ 'command'=>proc{print "You invoked \"#{c}\"\n"})
+ }
+ }
+}
diff --git a/ext/tk/sample/demos-jp/menu84.rb b/ext/tk/sample/demos-jp/menu84.rb
new file mode 100644
index 0000000000..6a57279481
--- /dev/null
+++ b/ext/tk/sample/demos-jp/menu84.rb
@@ -0,0 +1,213 @@
+# -*- coding: utf-8 -*-
+#
+# menus widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($menu84_demo) && $menu84_demo
+ $menu84_demo.destroy
+ $menu84_demo = nil
+end
+
+# demo toplevel widget
+$menu84_demo = TkToplevel.new {|w|
+ title("File Selection Dialogs")
+ iconname("menu84")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($menu84_demo).pack(:fill=>:both, :expand=>true)
+
+begin
+ windowingsystem = Tk.windowingsystem()
+rescue
+ windowingsystem = ""
+end
+
+# label
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Command+x ('x'はコマンドキーシンボルに続けて表示されている文字です) とタイプすることによっても項目の機能を呼び出すことができます。最後のメニューは、マウスでウィンドウの外にドラッグすることによって、独立したパレットとなるように切り放すことが可能です。")
+ else
+ text("このウィンドウにはカスケードメニューを持つメニューバーが付けられています。Alt+x ('x'はメニュー上で下線が引かれた文字です) とタイプすることによってもメニューを呼び出すことができます。矢印キーを使って、メニュー間を移動することも可能です。メニューが表示されている時には、現在位置の項目をスペースキーで選択したり、下線が引かれた文字を入力することでその項目を選択したりすることができます。もし項目にアクセラレータの指定がなされていたならば、その指定されたキー入力を行うことで、メニューを表示させることなく直接その項目の機能を呼び出せます。最後のメニューは、メニューの最初の項目を選択することによって、独立したパレットとなるように切り放すことが可能です。")
+ end
+}.pack('side'=>'top')
+
+
+menustatus = TkVariable.new(" ")
+TkFrame.new(base_frame) {|frame|
+ TkLabel.new(frame, 'textvariable'=>menustatus, 'relief'=>'sunken',
+ 'bd'=>1, 'font'=>['Helvetica', '10'],
+ 'anchor'=>'w').pack('side'=>'left', 'padx'=>2,
+ 'expand'=>true, 'fill'=>'both')
+ pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
+}
+
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $menu84_demo
+ $menu84_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'menu84'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+# create menu frame
+$menu84_frame = TkMenu.new($menu84_demo, 'tearoff'=>false)
+
+# menu
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'File', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Open...', 'command'=>proc{fail 'これは単なるデモですから、"Open..." 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'New', 'command'=>proc{fail 'これは単なるデモですから、"New" 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Save', 'command'=>proc{fail 'これは単なるデモですから、"Save" 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Save As...', 'command'=>proc{fail 'これは単なるデモですから、"Save As..." 項目の機能は特に定義されてはいません。'})
+ add('separator')
+ add('command', 'label'=>'Print Setup...', 'command'=>proc{fail 'これは単なるデモですから、"Print Setup..." 項目の機能は特に定義されてはいません。'})
+ add('command', 'label'=>'Print...', 'command'=>proc{fail 'これは単なるデモですから、"Print..." 項目の機能は特に定義されてはいません。'})
+ add('separator')
+ add('command', 'label'=>'Dismiss Menus Demo', 'command'=>proc{$menu84_demo.destroy})
+}
+
+if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem = "classic" || windowingsystem = "aqua"
+ modifier = 'Command'
+elsif $tk_platform['platform'] == 'windows'
+ modifier = 'Control'
+else
+ modifier = 'Meta'
+end
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Basic', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Long entry that does nothing')
+ ['A','B','C','D','E','F','G'].each{|c|
+ add('command', 'label'=>"Print letter \"#{c}\"",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
+ 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
+ $menu84_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
+ }
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Cascades', 'menu'=>m, 'underline'=>0)
+ add('command', 'label'=>'Print hello',
+ 'command'=>proc{print "Hello\n"},
+ 'accelerator'=>"#{modifier}+H", 'underline'=>6)
+ $menu84_demo.bind("#{modifier}-h", proc{print "Hello\n"})
+ add('command', 'label'=>'Print goodbye',
+ 'command'=>proc{print "Goodbye\n"},
+ 'accelerator'=>"#{modifier}+G", 'underline'=>6)
+ $menu84_demo.bind("#{modifier}-g", proc{print "Goodbye\n"})
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
+ m.add('cascade', 'label'=>'Check button',
+ 'menu'=>cascade_check, 'underline'=>0)
+ oil = TkVariable.new(0)
+ add('check', 'label'=>'オイル検査', 'variable'=>oil)
+ trans = TkVariable.new(0)
+ add('check', 'label'=>'トランスミッション検査', 'variable'=>trans)
+ brakes = TkVariable.new(0)
+ add('check', 'label'=>'ブレーキ検査', 'variable'=>brakes)
+ lights = TkVariable.new(0)
+ add('check', 'label'=>'ライト検査', 'variable'=>lights)
+ add('separator')
+ add('command', 'label'=>'Show current values',
+ 'command'=>proc{showVars($menu84_demo,
+ ['オイル', oil],
+ ['トランスミッション', trans],
+ ['ブレーキ', brakes],
+ ['ライト', lights])} )
+ invoke 1
+ invoke 3
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
+ m.add('cascade', 'label'=>'Radio buttons',
+ 'menu'=>cascade_radio, 'underline'=>0)
+ pointSize = TkVariable.new
+ add('radio', 'label'=>'10 point', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 point', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 point', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 point', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 point', 'variable'=>pointSize, 'value'=>32)
+ add('separator')
+ style = TkVariable.new
+ add('radio', 'label'=>'Roman', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'Bold', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'Italic', 'variable'=>style, 'value'=>'italic')
+ add('separator')
+ add('command', 'label'=>'現在値の表示',
+ 'command'=>proc{showVars($menu84_demo,
+ ['pointSize', pointSize],
+ ['style', style])} )
+ invoke 1
+ invoke 7
+ }
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
+ add('command', 'hidemargin'=>1,
+ 'bitmap'=>'@'+[$demo_dir,'..',
+ 'images','pattern.xbm'].join(File::Separator),
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'text'=>'あなたが選択したメニュー項目は、文字列の代わりにビットマップイメージで項目を表示したものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。',
+ 'bitmap'=>'', 'default'=>0,
+ 'buttons'=>'閉じる')} )
+ ['info', 'questhead', 'error'].each{|icon|
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ 'command'=>proc{print "You invoked the #{icon} bitmap\n"})
+ }
+
+ entryconfigure(2, :columnbreak=>true)
+}
+
+TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
+ $menu84_frame.add('cascade', 'label'=>'More', 'menu'=>m, 'underline'=>0)
+ [ 'An entry','Another entry','Does nothing','Does almost nothing',
+ 'Make life meaningful' ].each{|i|
+ add('command', 'label'=>i,
+ 'command'=>proc{print "You invoked \"#{i}\"\n"})
+ }
+
+ m.entryconfigure('Does almost nothing',
+ 'bitmap'=>'questhead', 'compound'=>'left',
+ 'command'=>proc{
+ TkDialog.new('title'=>'Compound Menu Entry',
+ 'message'=>'あなたが選択したメニュー項目は、ビットマップイメージと文字列とを同時に一つの項目に表示するようにしたものです。それ以外の点では、ほかのメニュー項目との間で特に違いがあるわけではありません。',
+ 'buttons'=>['了解'], 'bitmap'=>'')
+ })
+}
+
+TkMenu.new($menu84_frame) {|m|
+ $menu84_frame.add('cascade', 'label'=>'Colors', 'menu'=>m, 'underline'=>0)
+ ['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
+ add('command', 'label'=>c, 'background'=>c,
+ 'command'=>proc{print "You invoked \"#{c}\"\n"})
+ }
+}
+
+$menu84_demo.menu($menu84_frame)
+
+TkMenu.bind('<MenuSelect>', proc{|w|
+ begin
+ label = w.entrycget('active', 'label')
+ rescue
+ label = " "
+ end
+ menustatus.value = label
+ Tk.update(true)
+ }, '%W')
diff --git a/ext/tk/sample/demos-jp/menu8x.rb b/ext/tk/sample/demos-jp/menu8x.rb
new file mode 100644
index 0000000000..77ecb5bcf3
--- /dev/null
+++ b/ext/tk/sample/demos-jp/menu8x.rb
@@ -0,0 +1,233 @@
+# -*- coding: utf-8 -*-
+#
+# menus widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($menu8x_demo) && $menu8x_demo
+ $menu8x_demo.destroy
+ $menu8x_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$menu8x_demo = TkToplevel.new {|w|
+ title("Menu Demonstration (Tk8.x)")
+ iconname("menu")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($menu8x_demo).pack(:fill=>:both, :expand=>true)
+
+# version check
+if $tk_version.to_f < 8.0
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。")
+}.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $menu8x_demo
+ $menu8x_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'menu8x'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+else ; # Tk8.x
+
+begin
+ windowingsystem = Tk.windowingsystem()
+rescue
+ windowingsystem = ""
+end
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Command-X を入力すると、Xがコマンドキー記号に続いて表示されている文字ならば、アクセラレータを使った項目起動を行うことができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
+ else
+ text("このウィンドウは様々なメニューとカスケードメニューから構成されています。Alt-X を入力すると、Xがメニューにアンダーライン付きで表示されている文字ならば、キーボードからの指定ができます。矢印キーでメニューのトラバースも可能です。メニューが指定された際には、スペースキーで実行することができます。あるいは、アンダーライン付きの文字を入力することでも実行できます。メニューのエントリがアクセラレータを持っている場合は、そのアクセラレータを入力することでメニューを指定することなしに実行することができます。メニュー要素中、最後のものは、そのメニューの最初の項目を選択することで独立させることができます。")
+ end
+}.pack('side'=>'top')
+
+# 状態表示の生成
+$menu8xstatus = TkVariable.new(" ")
+TkFrame.new(base_frame) {|frame|
+ TkLabel.new(frame, 'textvariable'=>$menu8xstatus, 'relief'=>'sunken',
+ 'bd'=>1, 'font'=>['Helvetica', '10'], 'anchor'=>'w')\
+ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $menu8x_demo
+ $menu8x_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'menu8x'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# menu 生成
+TkMenu.new($menu8x_demo, 'tearoff'=>false) {|m|
+ TkMenu.new(m, 'tearoff'=>false) {|file_menu|
+ m.add('cascade', 'label'=>'File', 'menu'=>file_menu, 'underline'=>0)
+ add('command', 'label'=>'開く ...', 'command'=>proc{fail 'これは、デモですので"開く ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'新規', 'command'=>proc{fail 'これは、デモですので"新規"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存', 'command'=>proc{fail 'これは、デモですので"保存"に対するアクションは定義されていません。'})
+ add('command', 'label'=>'保存(指定) ...', 'command'=>proc{fail 'これは、デモですので"保存(指定) ..."に対するアクションは定義されていません。'})
+ add('separator')
+ add('command', 'label'=>'プリント設定 ...', 'command'=>proc{fail 'これは、デモですので"プリント設定 ..."に対するアクションは定義されていません。'})
+ add('command', 'label'=>'プリント ...', 'command'=>proc{fail 'これは、デモですので"プリント ..."に対するアクションは定義されていません。'})
+ add('separator')
+ add('command', 'label'=>'終了', 'command'=>proc{$menu8x_demo.destroy})
+ }
+
+ if $tk_platform['platform'] == 'macintosh' ||
+ windowingsystem == "classic" || windowingsystem == "aqua"
+ modifier = 'Command'
+ elsif $tk_platform['platform'] == 'windows'
+ modifier = 'Control'
+ else
+ modifier = 'Meta'
+ end
+
+ TkMenu.new(m, 'tearoff'=>false) {|basic_menu|
+ m.add('cascade', 'label'=>'Basic', 'menu'=>basic_menu, 'underline'=>0)
+ add('command', 'label'=>'何もしない長いエントリ')
+ ['A','B','C','D','E','F','G'].each{|c|
+ # add('command', 'label'=>"文字 \"#{c}\" を印字", 'underline'=>4,
+ add('command', 'label'=>"Print letter \"#{c}\" (文字 \"#{c}\" を印字)",
+ 'underline'=>14, 'accelerator'=>"Meta+#{c}",
+ 'command'=>proc{print c,"\n"}, 'accelerator'=>"#{modifier}+#{c}")
+ $menu8x_demo.bind("#{modifier}-#{c.downcase}", proc{print c,"\n"})
+ }
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_menu|
+ m.add('cascade', 'label'=>'Cascades', 'menu'=>cascade_menu, 'underline'=>0)
+ add('command', 'label'=>'Print hello(こんにちは)',
+ 'command'=>proc{print "Hello(こんにちは)\n"},
+ 'accelerator'=>"#{modifier}+H", 'underline'=>6)
+ $menu8x_demo.bind("#{modifier}-h", proc{print "Hello(こんにちは)\n"})
+ add('command', 'label'=>'Print goodbye(さようなら)',
+ 'command'=>proc{print "Goodbye(さようなら)\n"},
+ 'accelerator'=>"#{modifier}+G", 'underline'=>6)
+ $menu8x_demo.bind("#{modifier}-g", proc{print "Goodbye(さようなら)\n"})
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_check|
+ cascade_menu.add('cascade', 'label'=>'Check buttons(チェックボタン)',
+ 'menu'=>cascade_check, 'underline'=>0)
+ oil = TkVariable.new(0)
+ add('check', 'label'=>'オイル点検', 'variable'=>oil)
+ trans = TkVariable.new(0)
+ add('check', 'label'=>'トランスミッション点検', 'variable'=>trans)
+ brakes = TkVariable.new(0)
+ add('check', 'label'=>'ブレーキ点検', 'variable'=>brakes)
+ lights = TkVariable.new(0)
+ add('check', 'label'=>'ライト点検', 'variable'=>lights)
+ add('separator')
+ add('command', 'label'=>'現在の値を表示',
+ 'command'=>proc{showVars($menu8x_demo,
+ ['オイル点検', oil],
+ ['トランスミッション点検', trans],
+ ['ブレーキ点検', brakes],
+ ['ライト点検', lights])} )
+ invoke 1
+ invoke 3
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|cascade_radio|
+ cascade_menu.add('cascade', 'label'=>'Radio buttons(ラジオボタン)',
+ 'menu'=>cascade_radio, 'underline'=>0)
+ pointSize = TkVariable.new
+ add('radio', 'label'=>'10 ポイント', 'variable'=>pointSize, 'value'=>10)
+ add('radio', 'label'=>'14 ポイント', 'variable'=>pointSize, 'value'=>14)
+ add('radio', 'label'=>'18 ポイント', 'variable'=>pointSize, 'value'=>18)
+ add('radio', 'label'=>'24 ポイント', 'variable'=>pointSize, 'value'=>24)
+ add('radio', 'label'=>'32 ポイント', 'variable'=>pointSize, 'value'=>32)
+ add('separator')
+ style = TkVariable.new
+ add('radio', 'label'=>'ローマン', 'variable'=>style, 'value'=>'roman')
+ add('radio', 'label'=>'ボールド', 'variable'=>style, 'value'=>'bold')
+ add('radio', 'label'=>'イタリック', 'variable'=>style, 'value'=>'italic')
+ add('separator')
+ add('command', 'label'=>'現在の値を表示',
+ 'command'=>proc{showVars($menu8x_demo,
+ ['ポイントサイズ', pointSize],
+ ['スタイル', style])} )
+ invoke 1
+ invoke 7
+ }
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|icon_menu|
+ m.add('cascade', 'label'=>'Icons', 'menu'=>icon_menu, 'underline'=>0)
+ add('command',
+ 'bitmap'=>'@'+[$demo_dir,'..',
+ 'images','pattern.xbm'].join(File::Separator),
+ 'hidemargin'=>1,
+ 'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
+ 'text'=>'今あなたが選択したメニューの項目はテキストではなくビットマップを表示していました。それ以外の点では他のメニュー項目と変わりません。',
+ 'bitmap'=>'', 'default'=>0,
+ 'buttons'=>'了解')} )
+ ['info', 'questhead', 'error'].each{|icon|
+ add('command', 'bitmap'=>icon, 'hidemargin'=>1,
+ 'command'=>proc{print "You invoked the #{icon} bitmap\n"})
+ }
+
+ entryconfigure(2, 'columnbreak'=>1)
+ }
+
+ TkMenu.new(m, 'tearoff'=>false) {|more_menu|
+ m.add('cascade', 'label'=>'More', 'menu'=>more_menu, 'underline'=>0)
+ [ 'エントリ','別のエントリ','何もしない','ほとんど何もしない',
+ '人生を意義あるものに' ].each{|i|
+ add('command', 'label'=>i,
+ 'command'=>proc{print "You invoked \"#{i}\"\n"})
+ }
+ }
+
+ TkMenu.new(m) {|colors_menu|
+ m.add('cascade', 'label'=>'Colors', 'menu'=>colors_menu, 'underline'=>1)
+ ['red', 'orange', 'yellow', 'green', 'blue'].each{|c|
+ add('command', 'label'=>c, 'background'=>c,
+ 'command'=>proc{print "You invoked \"#{c}\"\n"})
+ }
+ }
+
+ $menu8x_demo.configure('menu'=>m)
+}
+
+TkMenu.bind('<MenuSelect>',
+ proc{|w|
+ begin
+ label = w.entrycget('active', 'label')
+ rescue
+ label = ' '
+ end
+ $menu8xstatus.value = label
+ Tk.update('idletasks')
+ }, '%W')
+
+end ; # Tk 8.x
diff --git a/ext/tk/sample/demos-jp/menubu.rb b/ext/tk/sample/demos-jp/menubu.rb
new file mode 100644
index 0000000000..06f9eb875e
--- /dev/null
+++ b/ext/tk/sample/demos-jp/menubu.rb
@@ -0,0 +1,238 @@
+# -*- coding: utf-8 -*-
+require "tkcanvas"
+
+def optionMenu(menubutton, varName, firstValue, *rest)
+ varName.value = firstValue
+ configoptions = {'textvariable'=>varName,'indicatoron'=>'on',
+ 'relief'=>'raised','borderwidth'=>2,'highlightthickness'=>2,
+ 'anchor'=>'c','direction'=>'flush'}
+ configoptions.each {|key, value|
+ menubutton.configure(key, value)
+ }
+ menu = TkMenu.new(menubutton) {
+ tearoff 'off'
+ add 'radio', 'label'=>firstValue, 'variable'=>varName
+ }
+ menubutton.menu(menu)
+ for i in rest
+ menu.add 'radio', 'label'=>i, 'variable'=>varName
+ end
+
+ return menu
+end
+
+if defined?($menubu_demo) && $menubu_demo
+ $menubu_demo.destroy
+ $menubu_demo = nil
+end
+
+$menubu_demo = TkToplevel.new {|w|
+ title("Menu Button Demonstration")
+ iconname("menubutton")
+}
+
+positionWindow($menubu_demo)
+
+base_frame = TkFrame.new($menubu_demo).pack(:fill=>:both, :expand=>true)
+
+# version check
+if $tk_version.to_f < 8.0
+
+# label 生成
+TkLabel.new(base_frame,'font'=>$font,'wraplength'=>'4i','justify'=>'left') {
+ text("実行しようとしたスクリプトは Tk8.0 以上で利用できる機能を利用しているため、あなたの Ruby#{VERSION}/Tk#{$tk_version}#{(Tk::JAPANIZED_TK)? 'jp': ''} では正常に実行できません。よってデモの実行を中止しました。ただし、下のコード参照ボタンを押すことで、実行が中止されたスクリプトのソースを参照することは可能です。")
+}.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $menubu_demo
+ $menubu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'menubu'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+else ; # Tk8.x
+
+body = TkFrame.new(base_frame)
+body.pack('expand'=>'yes', 'fill'=>'both')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+below = TkMenubutton.new(body) {
+ text "Below"
+ underline 0
+ direction 'below'
+ relief 'raised'
+}
+belowMenu = TkMenu.new(below) {
+ tearoff 0
+ add 'command', 'label'=>"Below menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Below menu.\""}
+ add 'command', 'label'=>"Below menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Below menu.\""}
+}
+below.menu(belowMenu)
+below.grid('row'=>0, 'column'=>1, 'sticky'=>'n')
+
+right = TkMenubutton.new(body) {
+ text "Right"
+ underline 0
+ direction 'right'
+ relief 'raised'
+}
+rightMenu = TkMenu.new(right) {
+ tearoff 0
+ add 'command', 'label'=>"Right menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""}
+ add 'command', 'label'=>"Right menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Right menu.\""}
+}
+right.menu(rightMenu)
+right.grid('row'=>1, 'column'=>0, 'sticky'=>'w')
+
+left = TkMenubutton.new(body) {
+ text "Left"
+ underline 0
+ direction 'left'
+ relief 'raised'
+}
+leftMenu = TkMenu.new(left) {
+ tearoff 0
+ add 'command', 'label'=>"Left menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Left menu.\""}
+ add 'command', 'label'=>"Left menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Left menu.\""}
+}
+left.menu(leftMenu)
+left.grid('row'=>1, 'column'=>2, 'sticky'=>'e')
+
+center = TkFrame.new(body) {
+ grid('row'=>1, 'column'=>1, 'sticky'=>'news')
+}
+
+above = TkMenubutton.new(body) {
+ text "Above"
+ underline 0
+ direction 'above'
+ relief 'raised'
+}
+aboveMenu = TkMenu.new(above) {
+ tearoff 0
+ add 'command', 'label'=>"Above menu: first item", 'command'=>proc {puts "\"You have selected the first item from the Above menu.\""}
+ add 'command', 'label'=>"Above menu: second item", 'command'=>proc {puts "\"You have selected the second item from the Above menu.\""}
+}
+above.menu(aboveMenu)
+above.grid('row'=>2, 'column'=>1, 'sticky'=>'s')
+
+center = TkFrame.new(body) {
+ grid('row'=>1, 'column'=>1, 'sticky'=>'news')
+}
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc {
+ tmppath = $menubu_demo
+ $menubu_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc { showCode 'menubu' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x', 'pady'=>'2m')
+
+msg = TkLabel.new(center) {
+# font $font
+ wraplength '4i'
+ justify 'left'
+ text "これはメニューボタンのデモです。\"Below\"のボタンは\
+下にメニューを出し、\"Right\"のボタンは右にメニューを出して、\
+……となります。この文章の下には2つのオプションメニューがあります。\
+1つは普通のメニューで、もう1つは16色のパレットです。"
+}
+msg.pack('side'=>'top', 'padx'=>25, 'pady'=>25)
+
+TkFrame.new(center) {|f|
+ menubuttonoptions = TkVariable.new
+ mbutton = TkMenubutton.new(f)
+ options = optionMenu(mbutton, menubuttonoptions,
+ 'one', 'two', 'three')
+ mbutton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
+ paletteColor = TkVariable.new
+ colors = ['Black','red4','DarkGreen','NavyBlue', 'gray75',
+ 'Red','Green','Blue','gray50','Yellow','Cyan','Magenta',
+ 'White','Brown','DarkSeaGreen','DarkViolet']
+ colorMenuButton = TkMenubutton.new(f)
+ m = optionMenu(colorMenuButton, paletteColor, *colors)
+ begin
+ windowingsystem = Tk.windowingsystem()
+ rescue
+ windowingsystem = ""
+ end
+ if windowingsystem == "classic" || windowingsystem == "aqua"
+ topBorderColor = 'Black'
+ bottomBorderColor = 'Black'
+ else
+ topBorderColor = 'gray50'
+ bottomBorderColor = 'gray75'
+ end
+ for i in 0..15
+ image = TkPhotoImage.new('height'=>16, 'width'=>16)
+ image.put(topBorderColor, 0, 0, 16, 1)
+ image.put(topBorderColor, 0, 1, 1, 16)
+ image.put(bottomBorderColor, 0, 15, 16, 16)
+ image.put(bottomBorderColor, 15, 1, 16, 16)
+ image.put(colors[i], 1, 1, 15, 15)
+
+ selectimage = TkPhotoImage.new('height'=>16, 'width'=>16)
+ selectimage.put('Black', 0, 0, 16, 2)
+ selectimage.put('Black', 0, 2, 2, 16)
+ selectimage.put('Black', 2, 14, 16, 16)
+ selectimage.put('Black', 14, 2, 16, 14)
+ selectimage.put(colors[i], 2, 2, 14, 14)
+
+ m.entryconfigure(i, 'image'=>image, 'selectimage'=>selectimage, 'hidemargin'=>'on')
+ end
+ m.configure('tearoff', 'on')
+ for c in ['Black', 'gray75', 'gray50', 'White']
+ m.entryconfigure(c, 'columnbreak'=>1)
+ end
+ colorMenuButton.pack('side'=>'left', 'padx'=>25, 'pady'=>25)
+ pack 'padx'=>25, 'pady'=>25
+}
+
+end ; # Tk8.x
diff --git a/ext/tk/sample/demos-jp/msgbox.rb b/ext/tk/sample/demos-jp/msgbox.rb
new file mode 100644
index 0000000000..ec7b4f2bbc
--- /dev/null
+++ b/ext/tk/sample/demos-jp/msgbox.rb
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+#
+# message boxes widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($msgbox_demo) && $msgbox_demo
+ $msgbox_demo.destroy
+ $msgbox_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$msgbox_demo = TkToplevel.new {|w|
+ title("Message Box Demonstration")
+ iconname("messagebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($msgbox_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定したメッセージボックスが表示されます。").pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $msgbox_demo
+ $msgbox_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'msgbox'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'メッセージボックス'
+ command proc{showMessageBox $msgbox_demo}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+$msgbox_leftframe = TkFrame.new(base_frame)
+$msgbox_rightframe = TkFrame.new(base_frame)
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top')
+TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxIcon = TkVariable.new('info')
+['error', 'info', 'question', 'warning'].each {|icon|
+ TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon,
+ 'relief'=>'flat', 'value'=>icon, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top')
+TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxType = TkVariable.new('ok')
+['abortretryignore', 'ok', 'okcancel',
+ 'retrycancel', 'yesno', 'yesnocancel'].each {|type|
+ TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType,
+ 'relief'=>'flat', 'value'=>type, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+def showMessageBox(w)
+ button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
+ 'title'=>'Message', 'parent'=>w,
+ 'message'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。")
+
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
+ 'message'=>"あなたは \"#{button}\" を押しましたね。")
+end
+
diff --git a/ext/tk/sample/demos-jp/msgbox2.rb b/ext/tk/sample/demos-jp/msgbox2.rb
new file mode 100644
index 0000000000..ad6d936036
--- /dev/null
+++ b/ext/tk/sample/demos-jp/msgbox2.rb
@@ -0,0 +1,90 @@
+# -*- coding: utf-8 -*-
+#
+# message boxes widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($msgbox2_demo) && $msgbox2_demo
+ $msgbox2_demo.destroy
+ $msgbox2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$msgbox2_demo = TkToplevel.new {|w|
+ title("Message Box Demonstration")
+ iconname("messagebox")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($msgbox2_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"まず表示するアイコンとメッセージボックスの種類を選んで下さい。その後に\"メッセージボックス\"ボタンを押すと、指定された形式で、メッセージと詳細テキストとを持ったメッセージボックスが表示されます。").pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $msgbox2_demo
+ $msgbox2_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'msgbox2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'メッセージボックス'
+ command proc{showMessageBox2 $msgbox2_demo}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+$msgbox_leftframe = TkFrame.new(base_frame)
+$msgbox_rightframe = TkFrame.new(base_frame)
+$msgbox_leftframe .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+$msgbox_rightframe.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'y',
+ 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkLabel.new($msgbox_leftframe, 'text'=>'アイコン').pack('side'=>'top')
+TkFrame.new($msgbox_leftframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxIcon = TkVariable.new('info')
+['error', 'info', 'question', 'warning'].each {|icon|
+ TkRadioButton.new($msgbox_leftframe, 'text'=>icon, 'variable'=>$msgboxIcon,
+ 'relief'=>'flat', 'value'=>icon, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+TkLabel.new($msgbox_rightframe, 'text'=>'種類').pack('side'=>'top')
+TkFrame.new($msgbox_rightframe, 'relief'=>'ridge', 'bd'=>1, 'height'=>2)\
+.pack('side'=>'top', 'fill'=>'x', 'expand'=>'no')
+
+$msgboxType = TkVariable.new('ok')
+['abortretryignore', 'ok', 'okcancel',
+ 'retrycancel', 'yesno', 'yesnocancel'].each {|type|
+ TkRadioButton.new($msgbox_rightframe, 'text'=>type, 'variable'=>$msgboxType,
+ 'relief'=>'flat', 'value'=>type, 'width'=>16,
+ 'anchor'=>'w').pack('side'=>'top', 'pady'=>2,
+ 'anchor'=>'w', 'fill'=>'x')
+}
+
+def showMessageBox2(w)
+ button = Tk.messageBox('icon'=>$msgboxIcon.value, 'type'=>$msgboxType.value,
+ 'title'=>'Message', 'parent'=>w,
+ 'message'=>"\"#{$msgboxType.value}\"タイプのメッセージボックス",
+ 'detail'=>"これは\"#{$msgboxType.value}\"という種類のメッセージボックスで、\"#{$msgboxIcon.value}\"のアイコンが表示されています。下のボタンのいずれかを選択してクリックしてください。")
+
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'parent'=>w,
+ 'message'=>"あなたは \"#{button}\" を押しましたね。")
+end
+
diff --git a/ext/tk/sample/demos-jp/paned1.rb b/ext/tk/sample/demos-jp/paned1.rb
new file mode 100644
index 0000000000..53d2e7162b
--- /dev/null
+++ b/ext/tk/sample/demos-jp/paned1.rb
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+#
+# paned1.rb
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows horizontally.
+#
+# based on "Id: paned1.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp"
+
+if defined?($paned1_demo) && $paned1_demo
+ $paned1_demo.destroy
+ $paned1_demo = nil
+end
+
+$paned1_demo = TkToplevel.new {|w|
+ title("Horizontal Paned Window Demonstration")
+ iconname("paned1")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($paned1_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+下の色付けされた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。
+もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない
+場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような
+より新しいバージョンの Tk を組み合わせて試す
+ようにしてください。
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $paned1_demo.destroy
+ $paned1_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'paned1'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+TkPanedwindow.new(base_frame, :orient=>:horizontal){|f|
+ add(Tk::Label.new(f, :text=>"This is the\nleft side", :bg=>'yellow'),
+ Tk::Label.new(f, :text=>"This is the\nright side", :bg=>'cyan'))
+
+ pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m')
+}
diff --git a/ext/tk/sample/demos-jp/paned2.rb b/ext/tk/sample/demos-jp/paned2.rb
new file mode 100644
index 0000000000..65bd41c757
--- /dev/null
+++ b/ext/tk/sample/demos-jp/paned2.rb
@@ -0,0 +1,100 @@
+# -*- coding: utf-8 -*-
+#
+# paned2.rb --
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows vertically.
+#
+# based on "Id: paned2.tcl,v 1.1 2002/02/22 14:07:01 dkf Exp"
+
+if defined?($paned2_demo) && $paned2_demo
+ $paned2_demo.destroy
+ $paned2_demo = nil
+end
+
+$paned2_demo = TkToplevel.new {|w|
+ title("Vertical Paned Window Demonstration")
+ iconname("paned2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($paned2_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+下のスクロールバー付きのウィジェットが置かれた二つのウィンドウの間の仕切り枠は、一つの領域をそれぞれのウィンドウのために分割するためのものです。左ボタンで仕切りを操作すると、分割サイズ変更の操作途中では再表示はなされず、確定させたときに表示が更新されます。マウスによる仕切りの操作に追随してサイズを変更した表示がなわれるようにしたい場合は、マウスの中央ボタンを使ってください。
+もしあなたが使っている Ruby にリンクされている Tk ライブラリが panedwindow を実装していない
+場合、このデモはうまく動かないはずです。その場合には panedwindow が実装されているような
+より新しいバージョンの Tk を組み合わせて試す
+ようにしてください。
+EOL
+
+# The bottom buttons
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $paned2_demo.destroy
+ $paned2_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'paned2'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+paneList = TkVariable.new # define as normal variable (not array)
+paneList.value = [ # ruby's array --> tcl's list
+ 'Ruby/Tk のウィジェット一覧',
+ 'TkButton',
+ 'TkCanvas',
+ 'TkCheckbutton',
+ 'TkEntry',
+ 'TkFrame',
+ 'TkLabel',
+ 'TkLabelframe',
+ 'TkListbox',
+ 'TkMenu',
+ 'TkMenubutton',
+ 'TkMessage',
+ 'TkPanedwindow',
+ 'TkRadiobutton',
+ 'TkScale',
+ 'TkScrollbar',
+ 'TkSpinbox',
+ 'TkText',
+ 'TkToplevel'
+]
+
+# Create the pane itself
+TkPanedwindow.new(base_frame, :orient=>:vertical){|f|
+ pack(:side=>:top, :expand=>true, :fill=>:both, :pady=>2, :padx=>'2m')
+
+ add(TkFrame.new(f){|paned2_top|
+ TkListbox.new(paned2_top, :listvariable=>paneList) {
+ # Invert the first item to highlight it
+ itemconfigure(0, :background=>self.cget(:foreground),
+ :foreground=>self.cget(:background) )
+ yscrollbar(TkScrollbar.new(paned2_top).pack(:side=>:right,
+ :fill=>:y))
+ pack(:fill=>:both, :expand=>true)
+ }
+ },
+
+ TkFrame.new(f, :height=>120) {|paned2_bottom|
+ # The bottom window is a text widget with scrollbar
+ paned2_xscr = TkScrollbar.new(paned2_bottom)
+ paned2_yscr = TkScrollbar.new(paned2_bottom)
+ paned2_text = TkText.new(paned2_bottom, :width=>30, :wrap=>:non) {
+ insert('1.0', 'ここに配置されているのは、' +
+ 'ごく普通のテキストウィジェットです。')
+ xscrollbar(paned2_xscr)
+ yscrollbar(paned2_yscr)
+ }
+ Tk.grid(paned2_text, paned2_yscr, :sticky=>'nsew')
+ Tk.grid(paned2_xscr, :sticky=>'nsew')
+ TkGrid.columnconfigure(paned2_bottom, 0, :weight=>1)
+ TkGrid.rowconfigure(paned2_bottom, 0, :weight=>1)
+ } )
+}
diff --git a/ext/tk/sample/demos-jp/pendulum.rb b/ext/tk/sample/demos-jp/pendulum.rb
new file mode 100644
index 0000000000..60556fd70a
--- /dev/null
+++ b/ext/tk/sample/demos-jp/pendulum.rb
@@ -0,0 +1,242 @@
+# -*- coding: utf-8 -*-
+#
+# This demonstration illustrates how Tcl/Tk can be used to construct
+# simulations of physical systems.
+# (called by 'widget')
+#
+# based on Tcl/Tk8.5a2 widget demos
+
+# destroy toplevel widget for this demo script
+if defined?($pendulum_demo) && $pendulum_demo
+ $pendulum_demo.destroy
+ $pendulum_demo = nil
+end
+
+# create toplevel widget
+$pendulum_demo = TkToplevel.new {|w|
+ title("Pendulum Animation Demonstration")
+ iconname("pendulum")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($pendulum_demo).pack(:fill=>:both, :expand=>true)
+
+# create label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text 'このデモは、物理系のシミュレーションに関わるようなアニメーション実行するために Ruby/Tk をどのように用いることができるかを示しています。左側のキャンバスは単純な振り子である物理系自体のグラフィカル表現であるのに対し、右側のキャンバスは系の位相空間のグラフ(角速度と角度とをプロットしたもの)になっています。左側のキャンバス上でクリックおよびドラッグを行って振り子の重りの位置を変えてみてください。'
+}
+msg.pack('side'=>'top')
+
+# create frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $pendulum_demo
+ $pendulum_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'pendulum'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# animated wave
+class PendulumAnimationDemo
+ def initialize(frame)
+ # Create some structural widgets
+ @pane = TkPanedWindow.new(frame, :orient=>:horizontal).pack(:fill=>:both, :expand=>true)
+# @pane.add(@lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation'))
+# @pane.add(@lf2 = TkLabelFrame.new(@pane, :text=>'Phase Space'))
+ @lf1 = TkLabelFrame.new(@pane, :text=>'Pendulum Simulation')
+ @lf2 = TkLabelFrame.new(@pane, :text=>'Phase Space')
+
+ # Create the canvas containing the graphical representation of the
+ # simulated system.
+ @c = TkCanvas.new(@lf1, :width=>320, :height=>200, :background=>'white',
+ :borderwidth=>2, :relief=>:sunken)
+ TkcText.new(@c, 5, 5, :anchor=>:nw,
+ :text=>'Click to Adjust Bob Start Position')
+ # Coordinates of these items don't matter; they will be set properly below
+ @plate = TkcLine.new(@c, 0, 25, 320, 25, :width=>2, :fill=>'grey50')
+ @rod = TkcLine.new(@c, 1, 1, 1, 1, :width=>3, :fill=>'black')
+ @bob = TkcOval.new(@c, 1, 1, 2, 2,
+ :width=>3, :fill=>'yellow', :outline=>'black')
+ TkcOval.new(@c, 155, 20, 165, 30, :fill=>'grey50', :outline=>'')
+
+ # pack
+ @c.pack(:fill=>:both, :expand=>true)
+
+ # Create the canvas containing the phase space graph; this consists of
+ # a line that gets gradually paler as it ages, which is an extremely
+ # effective visual trick.
+ @k = TkCanvas.new(@lf2, :width=>320, :height=>200, :background=>'white',
+ :borderwidth=>2, :relief=>:sunken)
+ @y_axis = TkcLine.new(@k, 160, 200, 160, 0, :fill=>'grey75', :arrow=>:last)
+ @x_axis = TkcLine.new(@k, 0, 100, 320, 100, :fill=>'grey75', :arrow=>:last)
+
+ @graph = {}
+ 90.step(0, -10){|i|
+ # Coordinates of these items don't matter;
+ # they will be set properly below
+ @graph[i] = TkcLine.new(@k, 0, 0, 1, 1, :smooth=>true, :fill=>"grey#{i}")
+ }
+
+ # labels
+ @label_theta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ :text=>'q', :font=>'Symbol 8')
+ @label_dtheta = TkcText.new(@k, 0, 0, :anchor=>:ne,
+ :text=>'dq', :font=>'Symbol 8')
+
+ # pack
+ @k.pack(:fill=>:both, :expand=>true)
+
+ # Initialize some variables
+ @points = []
+ @theta = 45.0
+ @dTheta = 0.0
+ @length = 150
+
+ # animation loop
+ @timer = TkTimer.new(15){ repeat }
+
+ # binding
+ @c.bindtags_unshift(btag = TkBindTag.new)
+ btag.bind('Destroy'){ @timer.stop }
+ btag.bind('1', proc{|x, y| @timer.stop; showPendulum(x.to_i, y.to_i)},
+ '%x %y')
+ btag.bind('B1-Motion', proc{|x, y| showPendulum(x.to_i, y.to_i)}, '%x %y')
+ btag.bind('ButtonRelease-1',
+ proc{|x, y| showPendulum(x.to_i, y.to_i); @timer.start },
+ '%x %y')
+
+ btag.bind('Configure', proc{|w| @plate.coords(0, 25, w.to_i, 25)}, '%w')
+
+ @k.bind('Configure', proc{|h, w|
+ h = h.to_i
+ w = w.to_i
+ @psh = h/2;
+ @psw = w/2
+ @x_axis.coords(2, @psh, w-2, @psh)
+ @y_axis.coords(@psw, h-2, @psw, 2)
+ @label_theta.coords(@psw-4, 6)
+ @label_dtheta.coords(w-6, @psh+4)
+ }, '%h %w')
+
+ # add
+ Tk.update
+ @pane.add(@lf1)
+ @pane.add(@lf2)
+
+ # init display
+ showPendulum
+
+ # animation start
+ @timer.start(500)
+ end
+
+ # This procedure makes the pendulum appear at the correct place on the
+ # canvas. If the additional arguments x, y are passed instead of computing
+ # the position of the pendulum from the length of the pendulum rod and its
+ # angle, the length and angle are computed in reverse from the given
+ # location (which is taken to be the centre of the pendulum bob.)
+ def showPendulum(x=nil, y=nil)
+ if x && y && (x != 160 || y != 25)
+ @dTheta = 0.0
+ x2 = x - 160
+ y2 = y - 25
+ @length = Math.hypot(x2, y2)
+ @theta = Math.atan2(x2,y2)*180/Math::PI
+ else
+ angle = @theta*Math::PI/180
+ x = 160 + @length*Math.sin(angle)
+ y = 25 + @length*Math.cos(angle)
+ end
+
+ @rod.coords(160, 25, x, y)
+ @bob.coords(x-15, y-15, x+15, y+15)
+ end
+
+ # Update the phase-space graph according to the current angle and the
+ # rate at which the angle is changing (the first derivative with
+ # respect to time.)
+ def showPhase
+ unless @psw && @psh
+ @psw = @k.width/2
+ @psh = @k.height/2
+ end
+ @points << @theta + @psw << -20*@dTheta + @psh
+ if @points.length > 100
+ @points = @points[-100..-1]
+ end
+ (0...100).step(10){|i|
+ first = - i
+ last = 11 - i
+ last = -1 if last >= 0
+ next if first > last
+ lst = @points[first..last]
+ @graph[i].coords(lst) if lst && lst.length >= 4
+ }
+ end
+
+ # This procedure is the "business" part of the simulation that does
+ # simple numerical integration of the formula for a simple rotational
+ # pendulum.
+ def recomputeAngle
+ scaling = 3000.0/@length/@length
+
+ # To estimate the integration accurately, we really need to
+ # compute the end-point of our time-step. But to do *that*, we
+ # need to estimate the integration accurately! So we try this
+ # technique, which is inaccurate, but better than doing it in a
+ # single step. What we really want is bound up in the
+ # differential equation:
+ # .. - sin theta
+ # theta + theta = -----------
+ # length
+ # But my math skills are not good enough to solve this!
+
+ # first estimate
+ firstDDTheta = -Math.sin(@theta * Math::PI/180) * scaling
+ midDTheta = @dTheta + firstDDTheta
+ midTheta = @theta + (@dTheta + midDTheta)/2
+ # second estimate
+ midDDTheta = -Math.sin(midTheta * Math::PI/180) * scaling
+ midDTheta = @dTheta + (firstDDTheta + midDDTheta)/2
+ midTheta = @theta + (@dTheta + midDTheta)/2
+ # Now we do a double-estimate approach for getting the final value
+ # first estimate
+ midDDTheta = -Math.sin(midTheta * Math::PI/180) * scaling
+ lastDTheta = midDTheta + midDDTheta
+ lastTheta = midTheta + (midDTheta+ lastDTheta)/2
+ # second estimate
+ lastDDTheta = -Math.sin(lastTheta * Math::PI/180) * scaling
+ lastDTheta = midDTheta + (midDDTheta + lastDDTheta)/2
+ lastTheta = midTheta + (midDTheta + lastDTheta)/2
+ # Now put the values back in our globals
+ @dTheta = lastDTheta
+ @theta = lastTheta
+ end
+
+ # This method ties together the simulation engine and the graphical
+ # display code that visualizes it.
+ def repeat
+ # Simulate
+ recomputeAngle
+
+ # Update the display
+ showPendulum
+ showPhase
+ end
+end
+
+# Start the animation processing
+PendulumAnimationDemo.new(base_frame)
diff --git a/ext/tk/sample/demos-jp/plot.rb b/ext/tk/sample/demos-jp/plot.rb
new file mode 100644
index 0000000000..4147b35399
--- /dev/null
+++ b/ext/tk/sample/demos-jp/plot.rb
@@ -0,0 +1,126 @@
+# -*- coding: utf-8 -*-
+#
+# 2-D plot widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($plot_demo) && $plot_demo
+ $plot_demo.destroy
+ $plot_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$plot_demo = TkToplevel.new {|w|
+ title("Plot Demonstration")
+ iconname("Plot")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($plot_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'4i', 'justify'=>'left',
+ 'text'=>"このウィンドウは簡単な2次元のプロットを含んだキャンバス widgetです。表示された点をマウスボタン1でドラッグしてデータをいじることができます。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$plot_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $plot_demo
+ $plot_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'plot'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$plot_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# font 設定
+ if $tk_version =~ /^4.*/
+ plotFont = '-*-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+ else
+ font = 'Helvetica 18'
+ end
+
+# canvas 設定
+$plot_canvas = TkCanvas.new(base_frame,'relief'=>'raised','width'=>450,'height'=>300)
+$plot_canvas.pack('side'=>'top', 'fill'=>'x')
+
+# plot 生成
+TkcLine.new($plot_canvas, 100, 250, 400, 250, 'width'=>2)
+TkcLine.new($plot_canvas, 100, 250, 100, 50, 'width'=>2)
+TkcText.new($plot_canvas, 225, 20,
+ 'text'=>"簡単なプロット", 'font'=>plotFont, 'fill'=>'brown')
+
+(0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($plot_canvas, x, 250, x, 245, 'width'=>2)
+ TkcText.new($plot_canvas, x, 254,
+ 'text'=>10*i, 'font'=>plotFont, 'anchor'=>'n')
+}
+(0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($plot_canvas, 100, y, 105, y, 'width'=>2)
+ TkcText.new($plot_canvas, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>plotFont, 'anchor'=>'e')
+}
+
+for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($plot_canvas, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+end
+
+$plot_canvas.itembind('point', 'Any-Enter',
+ proc{$plot_canvas.itemconfigure 'current','fill','red'})
+$plot_canvas.itembind('point', 'Any-Leave',
+ proc{$plot_canvas.itemconfigure 'current','fill','SkyBlue2'})
+$plot_canvas.itembind('point', '1',
+ proc{|x,y| plotDown $plot_canvas,x,y}, "%x %y")
+$plot_canvas.itembind('point', 'ButtonRelease-1',
+ proc{$plot_canvas.dtag 'selected'})
+$plot_canvas.bind('B1-Motion',
+ proc{|x,y| plotMove $plot_canvas,x,y}, "%x %y")
+
+$plot = {'lastX'=>0, 'lastY'=>0}
+
+# plotDown --
+# This method is invoked when the mouse is pressed over one of the
+# data points. It sets up state to allow the point to be dragged.
+#
+# Arguments:
+# w - The canvas window.
+# x, y - The coordinates of the mouse press.
+
+def plotDown (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $plot['lastX'] = x
+ $plot['lastY'] = y
+end
+
+# plotMove --
+# This method is invoked during mouse motion events. It drags the
+# current item.
+#
+# Arguments:
+# w - The canvas window.
+# x, y - The coordinates of the mouse.
+
+def plotMove (w, x, y)
+ w.move 'selected', x - $plot['lastX'], y - $plot['lastY']
+ $plot['lastX'] = x
+ $plot['lastY'] = y
+end
+
diff --git a/ext/tk/sample/demos-jp/puzzle.rb b/ext/tk/sample/demos-jp/puzzle.rb
new file mode 100644
index 0000000000..dbcb423463
--- /dev/null
+++ b/ext/tk/sample/demos-jp/puzzle.rb
@@ -0,0 +1,131 @@
+# -*- coding: utf-8 -*-
+#
+# widet demo 'puzzle' (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($puzzle_demo) && $puzzle_demo
+ $puzzle_demo.destroy
+ $puzzle_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$puzzle_demo = TkToplevel.new {|w|
+ title("15-Puzzle Demonstration")
+ iconname("15-Puzzle")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($puzzle_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下の15-パズルはボタンを集めてできています。空いている所の隣のピースをクリックすると、そのピースがその空いている場所にスライドします。この操作を続け、ピースがその数の順に上から下、左から右に並ぶようにしてください。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $puzzle_demo
+ $puzzle_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'puzzle'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+#
+# Special trick: scrollbar widget を生成してその trough color を用いることで
+# 空白部分のための暗色を選択し,設定する
+#
+begin
+ if Tk.windowingsystem() == 'aqua'
+ frameWidth = 168
+ frameHeight = 168
+ elsif Tk.default_widget_set == :Ttk
+ frameWidth = 148
+ frameHeight = 124
+ else
+ frameWidth = 120
+ frameHeight = 120
+ end
+rescue
+ frameWidth = 120
+ frameHeight = 120
+end
+
+# depend_on_button_width = true
+depend_on_button_width = false
+
+s = TkScrollbar.new(base_frame)
+base = TkFrame.new(base_frame) {
+ width frameWidth
+ height frameHeight
+ borderwidth 2
+ relief 'sunken'
+ bg s['troughcolor']
+}
+s.destroy
+base.pack('side'=>'top', 'padx'=>'1c', 'pady'=>'1c')
+
+# proc のスコープを閉じるため,proc 生成メソッドを用意
+# こうしておかねば,ループ中で値が変化する num の影響を受けて
+# puzzleSwitch の第 2 引数が変化してしまい,期待通りにはならない.
+def def_puzzleswitch_proc(w, num)
+ proc{puzzleSwitch w, num}
+end
+
+$xpos = {}
+$ypos = {}
+order = [3,1,6,2,5,7,15,13,4,11,8,9,14,10,12]
+(0..14).each{|i|
+ num = order[i]
+ $xpos[num] = (i % 4) * 0.25
+ $ypos[num] = (i / 4) * 0.25
+ TkButton.new(base) {|w|
+ relief 'raised'
+ text num
+ highlightthickness 0
+ command def_puzzleswitch_proc(w, num)
+ if depend_on_button_width && (w.winfo_reqwidth * 4 > base.width)
+ base.width = w.winfo_reqwidth * 4
+ end
+ }.place('relx'=>$xpos[num], 'rely'=>$ypos[num],
+ 'relwidth'=>0.25, 'relheight'=>0.25)
+}
+$xpos['space'] = 0.75
+$ypos['space'] = 0.75
+
+############
+def puzzleSwitch(w, num)
+ if ( ($ypos[num] >= ($ypos['space'] - 0.01)) \
+ && ($ypos[num] <= ($ypos['space'] + 0.01)) \
+ && ($xpos[num] >= ($xpos['space'] - 0.26)) \
+ && ($xpos[num] <= ($xpos['space'] + 0.26))) \
+ || (($xpos[num] >= ($xpos['space'] - 0.01)) \
+ && ($xpos[num] <= ($xpos['space'] + 0.01)) \
+ && ($ypos[num] >= ($ypos['space'] - 0.26)) \
+ && ($ypos[num] <= ($ypos['space'] + 0.26)))
+ tmp = $xpos['space']
+ $xpos['space'] = $xpos[num]
+ $xpos[num] = tmp
+ tmp = $ypos['space']
+ $ypos['space'] = $ypos[num]
+ $ypos[num] = tmp
+ w.place('relx'=>$xpos[num], 'rely'=>$ypos[num])
+ end
+end
+
diff --git a/ext/tk/sample/demos-jp/radio.rb b/ext/tk/sample/demos-jp/radio.rb
new file mode 100644
index 0000000000..efb613593d
--- /dev/null
+++ b/ext/tk/sample/demos-jp/radio.rb
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($radio_demo) && $radio_demo
+ $radio_demo.destroy
+ $radio_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$radio_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration")
+ iconname("radio")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下には2つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
+}
+msg.pack('side'=>'top')
+
+# 変数生成
+size = TkVariable.new
+color = TkVariable.new
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $radio_demo
+ $radio_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'radio'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text '変数参照'
+ command proc{
+ showVars(base_frame, ['size', size], ['color', color])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+f_left = TkFrame.new(base_frame)
+f_right = TkFrame.new(base_frame)
+f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+
+# radiobutton 生成
+[10, 12, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "ポイントサイズ #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
+['赤', '緑', '青', '黄', '橙', '紫'].each {|col|
+ TkRadioButton.new(f_right) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')
+}
+
diff --git a/ext/tk/sample/demos-jp/radio2.rb b/ext/tk/sample/demos-jp/radio2.rb
new file mode 100644
index 0000000000..0633a8def1
--- /dev/null
+++ b/ext/tk/sample/demos-jp/radio2.rb
@@ -0,0 +1,112 @@
+# -*- coding: utf-8 -*-
+#
+# radio2.rb
+#
+# This demonstration script creates a toplevel window containing
+# several radiobutton widgets.
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($radio2_demo) && $radio2_demo
+ $radio2_demo.destroy
+ $radio2_demo = nil
+end
+
+# demo toplevel widget
+$radio2_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration 2")
+ iconname("radio2")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio2_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text "下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのボタンだけがそのグループの中で選択されます。各グループに対してそのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
+}
+msg.pack('side'=>'top')
+
+#
+size = TkVariable.new
+color = TkVariable.new
+align = TkVariable.new
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $radio2_demo
+ $radio2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'radio2'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text '変数参照'
+ command proc{
+ showVars(base_frame,
+ ['size', size], ['color', color], ['compound', align])
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ',
+ 'pady'=>2, 'padx'=>2)
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'色',
+ 'pady'=>2, 'padx'=>2)
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置',
+ 'pady'=>2, 'padx'=>2)
+f_left.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_mid.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+f_right.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'.5c', 'pady'=>'.5c')
+
+# radiobutton
+[10, 12, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "ポイントサイズ #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
+}
+
+['赤', '緑', '青', '黄', '橙', '紫'].each {|col|
+ TkRadioButton.new(f_mid) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ anchor 'w'
+ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
+}
+
+# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+ 'compound'=>'left')
+label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
+label.height(TkWinfo.reqheight(label))
+abtn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a|
+ lower = a.downcase
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>lower, 'indicatoron'=>0, 'width'=>7,
+ 'command'=>proc{label.compound(align.value)})
+}
+
+Tk.grid('x', abtn[0])
+Tk.grid(abtn[1], label, abtn[2])
+Tk.grid('x', abtn[3])
diff --git a/ext/tk/sample/demos-jp/radio3.rb b/ext/tk/sample/demos-jp/radio3.rb
new file mode 100644
index 0000000000..3356b6945b
--- /dev/null
+++ b/ext/tk/sample/demos-jp/radio3.rb
@@ -0,0 +1,119 @@
+# -*- coding: utf-8 -*-
+#
+# radio3.rb
+#
+# This demonstration script creates a toplevel window containing
+# several radiobutton widgets.
+#
+# radiobutton widget demo (called by 'widget')
+#
+
+# toplevel widget
+if defined?($radio3_demo) && $radio3_demo
+ $radio3_demo.destroy
+ $radio3_demo = nil
+end
+
+# demo toplevel widget
+$radio3_demo = TkToplevel.new {|w|
+ title("Radiobutton Demonstration 3")
+ iconname("radio3")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($radio3_demo).pack(:fill=>:both, :expand=>true)
+
+# label
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '5i'
+ justify 'left'
+ text '下には3つのラジオボタングループが表示されています。ボタンをクリックすると、そのグループに属するすべてのボタンの中でクリックしたボタンだけが選択された状態になります。各グループには、そのグループの中のどのボタンが選択されているかを示す変数が割り当てられています。「トライステート」ボタンが押されたときには、ラジオボタンの表示がトライステートモードになります。いずれかのボタンを選択すれば、ボタンの状態は元のように個々のボタンのon/off状態を示すようになります。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。'
+}
+msg.grid(:row=>0, :column=>0, :columnspan=>3, :sticky=>'nsew')
+
+# variable
+size = TkVariable.new
+color = TkVariable.new
+align = TkVariable.new
+
+# frame
+TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'変数参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame, ['size', size],
+ ['color', color], ['compound', align])
+ }),
+ TkButton.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'radio3'}),
+ TkButton.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $radio3_demo
+ $radio3_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+ TkGrid(frame, :row=>3, :column=>0, :columnspan=>3, :sticky=>'nsew')
+}
+
+# frame
+f_left = TkLabelFrame.new(base_frame, 'text'=>'文字サイズ',
+ 'pady'=>2, 'padx'=>2)
+f_mid = TkLabelFrame.new(base_frame, 'text'=>'色',
+ 'pady'=>2, 'padx'=>2)
+f_right = TkLabelFrame.new(base_frame, 'text'=>'ビットマップ配置',
+ 'pady'=>2, 'padx'=>2)
+f_left .grid('column'=>0, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
+f_mid .grid('column'=>1, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c', 'rowspan'=>2)
+f_right.grid('column'=>2, 'row'=>1, 'pady'=>'.5c', 'padx'=>'.5c')
+
+TkButton.new(base_frame, 'text'=>'トライステート',
+ 'command'=>proc{size.value = 'multi'; color.value = 'multi'}){
+ grid('column'=>2, 'row'=>2, 'pady'=>'.5c', 'padx'=>'.5c')
+}
+
+# radiobutton
+[10, 12, 14, 18, 24].each {|sz|
+ TkRadioButton.new(f_left) {
+ text "ポイントサイズ #{sz}"
+ variable size
+ relief 'flat'
+ value sz
+ tristatevalue 'multi'
+ }.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w', 'fill'=>'x')
+}
+
+['Red', 'Green', 'Blue', 'Yellow', 'Orange', 'Purple'].each {|col|
+ TkRadioButton.new(f_mid) {
+ text col
+ variable color
+ relief 'flat'
+ value col.downcase
+ anchor 'w'
+ tristatevalue 'multi'
+ command proc{f_mid.fg(color.value)}
+ }.pack('side'=>'top', 'pady'=>2, 'fill'=>'x')
+}
+
+# label = TkLabel.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+label = Tk::Label.new(f_right, 'text'=>'ラベル', 'bitmap'=>'questhead',
+ 'compound'=>'left')
+label.configure('width'=>TkWinfo.reqwidth(label), 'compound'=>'top')
+label.height(TkWinfo.reqheight(label))
+a_btn = ['Top', 'Left', 'Right', 'Bottom'].collect{|a|
+ TkRadioButton.new(f_right, 'text'=>a, 'variable'=>align, 'relief'=>'flat',
+ 'value'=>a.downcase, 'indicatoron'=>0, 'width'=>7,
+ 'command'=>proc{label.compound(align.value)})
+}
+
+Tk.grid('x', a_btn[0])
+Tk.grid(a_btn[1], label, a_btn[2])
+Tk.grid('x', a_btn[3])
diff --git a/ext/tk/sample/demos-jp/rmt b/ext/tk/sample/demos-jp/rmt
new file mode 100644
index 0000000000..dcfb328fc8
--- /dev/null
+++ b/ext/tk/sample/demos-jp/rmt
@@ -0,0 +1,268 @@
+#!/usr/bin/env ruby
+
+# rmt --
+# This script implements a simple remote-control mechanism for
+# Tk applications. It allows you to select an application and
+# then type commands to that application.
+
+require 'tk'
+
+class Rmt
+ def initialize(parent=nil)
+ win = self
+
+ unless parent
+ parent = TkRoot.new
+ end
+ root = TkWinfo.toplevel(parent)
+ root.minsize(1,1)
+
+ # The instance variable below keeps track of the remote application
+ # that we're sending to. If it's an empty string then we execute
+ # the commands locally.
+ @app = 'local'
+ @mode = 'Ruby'
+
+ # The instance variable below keeps track of whether we're in the
+ # middle of executing a command entered via the text.
+ @executing = 0
+
+ # The instance variable below keeps track of the last command executed,
+ # so it can be re-executed in response to !! commands.
+ @lastCommand = ""
+
+ # Create menu bar. Arrange to recreate all the information in the
+ # applications sub-menu whenever it is cascaded to.
+
+ TkFrame.new(root, 'relief'=>'raised', 'bd'=>2) {|f|
+ pack('side'=>'top', 'fill'=>'x')
+ TkMenubutton.new(f, 'text'=>'File', 'underline'=>0) {|mb|
+ TkMenu.new(mb) {|mf|
+ mb.menu(mf)
+ TkMenu.new(mf) {|ma|
+ postcommand proc{win.fillAppsMenu ma}
+ mf.add('cascade', 'label'=>'Select Application',
+ 'menu'=>ma, 'underline'=>0)
+ }
+ add('command', 'label'=>'Quit',
+ 'command'=>proc{root.destroy}, 'underline'=>0)
+ }
+ pack('side'=>'left')
+ }
+ }
+
+ # Create text window and scrollbar.
+
+ @txt = TkText.new(root, 'relief'=>'sunken', 'bd'=>2, 'setgrid'=>true) {
+ yscrollbar(TkScrollbar.new(root){pack('side'=>'right', 'fill'=>'y')})
+ pack('side'=>'left')
+ }
+
+ @promptEnd = TkTextMark.new(@txt, 'insert')
+
+ # Create a binding to forward commands to the target application,
+ # plus modify many of the built-in bindings so that only information
+ # in the current command can be deleted (can still set the cursor
+ # earlier in the text and select and insert; just can't delete).
+
+ @txt.bindtags([@txt, TkText, root, 'all'])
+ @txt.bind('Return', proc{
+ @txt.set_insert('end - 1c')
+ @txt.insert('insert', "\n")
+ win.invoke
+ Tk.callback_break
+ })
+ @txt.bind('Delete', proc{
+ begin
+ @txt.tag_remove('sel', 'sel.first', @promptEnd)
+ rescue
+ end
+ if @txt.tag_nextrange('sel', '1.0', 'end') == []
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ end
+ })
+ @txt.bind('BackSpace', proc{
+ begin
+ @txt.tag_remove('sel', 'sel.first', @promptEnd)
+ rescue
+ end
+ if @txt.tag_nextrange('sel', '1.0', 'end') == []
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ end
+ })
+ @txt.bind('Control-d', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Control-k', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ @txt.set_insert(@promptEnd)
+ end
+ })
+ @txt.bind('Control-t', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Meta-d', proc{
+ if @txt.compare('insert', '<', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Meta-BackSpace', proc{
+ if @txt.compare('insert', '<=', @promptEnd)
+ Tk.callback_break
+ end
+ })
+ @txt.bind('Control-h', proc{
+ if @txt.compare('insert', '<=', @promptEnd)
+ Tk.callback_break
+ end
+ })
+
+ @txt.tag_configure('bold', 'font'=>['Courier', 12, 'bold'])
+
+ @app = Tk.appname('rmt')
+ if (@app =~ /^rmt(.*)$/)
+ root.title("Tk Remote Controller#{$1}")
+ root.iconname("Tk Remote#{$1}")
+ end
+ prompt
+ @txt.focus
+ #@app = TkWinfo.appname(TkRoot.new)
+ end
+
+ def tkTextInsert(w,s)
+ return if s == ""
+ begin
+ if w.compare('sel.first','<=','insert') \
+ && w.compare('sel.last','>=','insert')
+ w.tag_remove('sel', 'sel.first', @promptEnd)
+ w.delete('sel.first', 'sel.last')
+ end
+ rescue
+ end
+ w.insert('insert', s)
+ w.see('insert')
+ end
+
+ # The method below is used to print out a prompt at the
+ # insertion point (which should be at the beginning of a line
+ # right now).
+
+ def prompt
+ @txt.insert('insert', "#{@app}: ")
+ @promptEnd.set('insert')
+ @promptEnd.gravity = 'left'
+ @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd)
+ end
+
+ # The method below executes a command (it takes everything on the
+ # current line after the prompt and either sends it to the remote
+ # application or executes it locally, depending on "app".
+
+ def invoke
+ cmd = @txt.get(@promptEnd, 'insert')
+ @executing += 1
+ case (@mode)
+ when 'Tcl'
+ if Tk.info('complete', cmd)
+ if (cmd == "!!\n")
+ cmd = @lastCommand
+ else
+ @lastCommand = cmd
+ end
+ begin
+ msg = Tk.appsend(@app, false, cmd)
+ rescue
+ msg = "Error: #{$!}"
+ end
+ @txt.insert('insert', msg + "\n") if msg != ""
+ prompt
+ @promptEnd.set('insert')
+ end
+
+ when 'Ruby'
+ if (cmd == "!!\n")
+ cmd = @lastCommand
+ end
+ complete = true
+ begin
+ eval("proc{#{cmd}}")
+ rescue
+ complete = false
+ end
+ if complete
+ @lastCommand = cmd
+ begin
+# msg = Tk.appsend(@app, false,
+# 'ruby',
+# '"(' + cmd.gsub(/[][$"]/, '\\\\\&') + ').to_s"')
+ msg = Tk.rb_appsend(@app, false, cmd)
+ rescue
+ msg = "Error: #{$!}"
+ end
+ @txt.insert('insert', msg + "\n") if msg != ""
+ prompt
+ @promptEnd.set('insert')
+ end
+ end
+
+ @executing -= 1
+ @txt.yview_pickplace('insert')
+ end
+
+ # The following method is invoked to change the application that
+ # we're talking to. It also updates the prompt for the current
+ # command, unless we're in the middle of executing a command from
+ # the text item (in which case a new prompt is about to be output
+ # so there's no need to change the old one).
+
+ def newApp(appName, mode)
+ @app = appName
+ @mode = mode
+ if @executing == 0
+ @promptEnd.gravity = 'right'
+ @txt.delete("#{@promptEnd.path} linestart", @promptEnd)
+ @txt.insert(@promptEnd, "#{appName}: ")
+ @txt.tag_add('bold', "#{@promptEnd.path} linestart", @promptEnd)
+ @promptEnd.gravity = 'left'
+ end
+ end
+
+ # The method below will fill in the applications sub-menu with a list
+ # of all the applications that currently exist.
+
+ def fillAppsMenu(menu)
+ win = self
+ begin
+ menu.delete(0,'last')
+ rescue
+ end
+ TkWinfo.interps.sort.each{|ip|
+ begin
+ if Tk.appsend(ip, false, 'info commands ruby') == ""
+ mode = 'Tcl'
+ else
+ mode = 'Ruby'
+ end
+ menu.add('command', 'label'=>format("%s (#{mode}/Tk)", ip),
+ 'command'=>proc{win.newApp ip, mode})
+ rescue
+ menu.add('command', 'label'=>format("%s (unknown Tk)", ip),
+ 'command'=>proc{win.newApp ip, mode}, 'state'=>'disabled')
+ end
+ }
+ menu.add('command', 'label'=>format("local (Ruby/Tk)"),
+ 'command'=>proc{win.newApp 'local', 'Ruby'})
+ end
+end
+
+Rmt.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/rolodex b/ext/tk/sample/demos-jp/rolodex
new file mode 100644
index 0000000000..2cc73e128f
--- /dev/null
+++ b/ext/tk/sample/demos-jp/rolodex
@@ -0,0 +1,320 @@
+#!/usr/bin/env ruby
+#
+# rolodex --
+# This script is a part of Tom LaStrange's rolodex
+#
+# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp>
+# Time-stamp: "03/08/02 12:45:21 nagai"
+#
+
+require "tk"
+
+
+def show_help(topic,x=0,y=0)
+ if( topic.is_a?(TkWindow) )
+ w = TkWinfo.containing(x,y)
+ if( TkWinfo.exist?(w) )
+ topic = w
+ end
+ end
+
+ if( $helpTopics.include?(topic) )
+ msg = $helpTopics[topic]
+ else
+ msg = "Sorry, but no help is available for this topic"
+ end
+ TkDialog.new("title"=>"Rolodex Help",
+ "message"=>"Information on #{topic}:\n\n#{msg}",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+end
+
+def fillCard
+ clearAction
+ $root.frame.entry[1].insert(0,"Takaaki Tateishi")
+ $root.frame.entry[2].insert(0,"Japan Advanced Institute of Science and Techonology")
+ $root.frame.entry[3].insert(0,"1-1 Asahidai, Tatsunokuchi")
+ $root.frame.entry[4].insert(0,"Ishikawa 923-1292, Japan")
+ $root.frame.entry[5].insert(0,"private")
+ $root.frame.entry[6].insert(0,"***-***-****")
+ $root.frame.entry[7].insert(0,"***-***-****")
+end
+
+def addAction
+ for i in 1..7
+ STDERR.print format("%-12s %s\n",
+ RolodexFrame::LABEL[i],
+ $root.frame.entry[i].value)
+ end
+end
+
+def clearAction
+ for i in 1..7
+ $root.frame.entry[i].delete(0,"end")
+ end
+end
+
+def fileAction
+ TkDialog.new("title"=>"File Selection",
+ "message"=>"This is a dummy file selection dialog box.\n",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+ STDERR.print "dummy file name\n"
+end
+
+def deleteAction
+ result = TkDialog.new("title"=>"Confirm Action",
+ "message"=>"Are you sure?",
+ "default_button"=>0,
+ "buttons"=>["Cancel"])
+ if( result.value == 0 )
+ clearAction
+ end
+end
+
+
+class RolodexFrame < TkFrame
+ attr_reader :entry, :label
+
+ LABEL = ["","Name:","Address:","","","Home Phone:","Work Phone:","Fax:"]
+
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+ self["relief"] = "flat"
+
+ @i = []
+ @label = []
+ @entry = []
+ for i in 1..7
+ @i[i] = TkFrame.new(self)
+ @i[i].pack("side"=>"top",
+ "pady"=>2,
+ "anchor"=>"e")
+ @label[i] = TkLabel.new(@i[i],
+ "text"=>LABEL[i],
+ "anchor"=>"e")
+ @entry[i] = TkEntry.new(@i[i],
+ "width"=>30,
+ "relief"=>"sunken")
+ @entry[i].pack("side"=>"right")
+ @label[i].pack("side"=>"right")
+ end
+ end
+end
+
+class RolodexButtons < TkFrame
+ attr_reader :clear, :add, :search, :delete
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ @clear = TkButton.new(self,
+ "text" => "Clear")
+ @add = TkButton.new(self,
+ "text" => "Add")
+ @search = TkButton.new(self,
+ "text" => "Search")
+ @delete = TkButton.new(self,
+ "text" => "Delete")
+ for w in [@clear,@add,@search,@delete]
+ w.pack("side"=>"left", "padx"=>2)
+ end
+ end
+end
+
+class RolodexMenuFrame < TkFrame
+ attr_reader :file_menu, :help_menu, :file, :help
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ configure("relief"=>"raised",
+ "borderwidth"=>1)
+
+ @file = TkMenubutton.new(self,
+ "text"=>"File",
+ "underline"=>0)
+ @file_menu = TkMenu.new(@file)
+ @file_menu.add("command",
+ "label" => "Load ...",
+ "command" => proc{fileAction},
+ "underline" => 0)
+ @file_menu.add("command",
+ "label" => "Exit",
+ "command" => proc{$root.destroy},
+ "underline" => 0)
+ @file.menu(@file_menu)
+ @file.pack("side"=>"left")
+
+ @help = TkMenubutton.new(self,
+ "text"=>"Help",
+ "underline"=>0)
+ @help_menu = TkMenu.new(@help)
+ @help_menu.add("command",
+ "label"=>"On Context...",
+ "command"=>proc{show_help("context")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Help...",
+ "command"=>proc{show_help("help")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Window...",
+ "command"=>proc{show_help("window")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On Keys...",
+ "command"=>proc{show_help("keys")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=>"On version...",
+ "command"=>proc{show_help("version")},
+ "underline"=>3)
+ @help.menu(@help_menu)
+ @help.pack("side"=>"right")
+ end
+end
+
+class Rolodex < TkRoot
+ attr_reader :frame, :buttons, :menu
+
+ def initialize(*args)
+ super(*args)
+ @frame = RolodexFrame.new(self)
+ @frame.pack("side"=>"top",
+ "fill"=>"y",
+ "anchor"=>"center")
+ @buttons = RolodexButtons.new(self)
+ @buttons.pack("side"=>"bottom",
+ "pady"=>2,
+ "anchor"=>"center")
+ @menu = RolodexMenuFrame.new(self)
+ @menu.pack("before"=>@frame,
+ "side"=>"top",
+ "fill"=>"x")
+ end
+end
+
+$root = Rolodex.new
+
+$root.buttons.delete.configure("command"=>proc{deleteAction})
+$root.buttons.add.configure("command"=>proc{addAction})
+$root.buttons.clear.configure("command"=>proc{clearAction})
+$root.buttons.search.configure("command"=>proc{addAction; fillCard})
+
+$root.buttons.clear.configure("text"=>"Clear Ctrl+C")
+$root.bind("Control-c",proc{clearAction})
+
+$root.buttons.add.configure("text"=>"Add Ctrl+A")
+$root.bind("Control-a",proc{addAction})
+
+$root.buttons.search.configure("text"=>"Search Ctrl+S")
+$root.bind("Control-s",proc{addAction; fillCard})
+
+$root.buttons.delete.configure("text"=>"Delete... Ctrl+D")
+$root.bind("Control-d",proc{deleteAction})
+
+$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F")
+$root.bind("Control-f",proc{fileAction})
+
+$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q")
+$root.bind("Control-q",proc{$root.destroy})
+
+$root.frame.entry[1].focus
+
+$root.bind("Any-F1",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+$root.bind("Any-Help",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+
+
+$helpTopics = {}
+
+$helpTopics[$root.menu.file] = <<EOF
+This is the "file" menu. It can be used to invoke\
+some overall operations on the rolodex applications,\
+such as loading a file or exiting.
+EOF
+
+$helpTopics[$root.menu.file_menu.index(0)] = <<EOF
+The "Load" entry in the "File" menu posts a dialog box\
+that you can use to select a rolodex file
+EOF
+
+$helpTopics[$root.menu.file_menu.index(1)] = <<EOF
+The "Exit" entry in the "File" menu causes the rolodex\
+application to terminate
+EOF
+
+$helpTopics[$root.frame.entry[1]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's name
+EOF
+
+$helpTopics[$root.frame.entry[2]] = <<EOF
+In this field of the rolodex entry you should\
+type the first line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[3]] = <<EOF
+In this field of the rolodex entry you should\
+type the second line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[4]] = <<EOF
+In this field of the rolodex entry you should\
+type the third line of the person's address
+EOF
+
+$helpTopics[$root.frame.entry[5]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's home phone number, or "private"\
+if the person doesn't want his or he number publicized
+EOF
+
+$helpTopics[$root.frame.entry[6]] = <<EOF
+In this field of the rolodex entry you should\
+type the person's work phone number
+EOF
+
+$helpTopics[$root.frame.entry[7]] = <<EOF
+In this field of the rolodex entry you should\
+type the phone number for the person's FAX machine
+EOF
+
+$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\
+the mouse over the window you're curious about and pressing the\
+Help or F1 keys. You can do this anytime.
+EOF
+
+$helpTopics["help"] = <<EOF
+This application provides only very crude help. Besides the\
+entries in this menu, you can get help on individual windows\
+by moving the mouse cursor over the window and pressing the\
+Help or F1 keys.
+EOF
+
+$helpTopics["window"] = <<EOF
+This window is a dummy rolodex application created as part of\
+Tom LaStrange's toolkit benchmark. It doesn't really do anything\
+useful except to demonstrate a few features of the Ruby/Tk.
+EOF
+
+$helpTopics["keys"] = <<EOF
+The following accelerator keys are defined for this application\
+(in addition to those already available for the entry windows):
+Ctrl+A: Add
+Ctrl+C: Clear
+Ctrl+D: Delete
+Ctrl+F: Enter file name
+Ctrl+Q: Exit application (quit)
+Ctrl+S: Search (dummy operation)
+EOF
+
+$helpTopics["version"] = <<EOF
+This is version 1.0.1.
+EOF
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/rolodex-j b/ext/tk/sample/demos-jp/rolodex-j
new file mode 100644
index 0000000000..f6e3afdacd
--- /dev/null
+++ b/ext/tk/sample/demos-jp/rolodex-j
@@ -0,0 +1,300 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+# rolodex --
+# このスクリプトは Tom LaStrange の rolodex の一部です。
+#
+# Copyright (C) 1998 by Takaaki Tateishi <ttate@jaist.ac.jp>
+# Time-stamp: "04/04/09 00:32:12 nagai"
+#
+
+require "tk"
+Tk.encoding = "utf-8"
+
+def show_help(topic,x=0,y=0)
+ if( topic.is_a?(TkWindow) )
+ w = TkWinfo.containing(x,y)
+ if( w.is_a?(TkWindow) )
+ if( TkWinfo.exist?(w) )
+ topic = w
+ end
+ end
+ end
+
+ if( $helpTopics.include?(topic) )
+ msg = $helpTopics[topic]
+ else
+ msg = "このトピックについてのヘルプはまだ使用できません"
+ end
+ TkDialog.new("title"=>"Rolodex Help",
+ "message"=>"「#{topic}」\n\n#{msg}",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+end
+
+def fillCard
+ clearAction
+ $root.frame.entry[1].insert(0, "立石 孝彰")
+ $root.frame.entry[2].insert(0, "923-1292 石川県")
+ $root.frame.entry[3].insert(0, "辰口町 旭台 1-1")
+ $root.frame.entry[4].insert(0, "北陸先端科学技術大学院大学")
+ $root.frame.entry[5].insert(0,"private")
+ $root.frame.entry[6].insert(0,"***-***-****")
+ $root.frame.entry[7].insert(0,"***-***-****")
+end
+
+def addAction
+ for i in 1..7
+ STDERR.print format("%-12s %s\n",
+ RolodexFrame::LABEL[i],
+ $root.frame.entry[i].value)
+ end
+end
+
+def clearAction
+ for i in 1..7
+ $root.frame.entry[i].delete(0,"end")
+ end
+end
+
+def fileAction
+ TkDialog.new("title"=>"File Selection",
+ "message"=>"これはファイル選択ダイアログのダミーです。\n",
+ "default_button"=>0,
+ "buttons"=>["OK"])
+ STDERR.print "dummy file name\n"
+end
+
+def deleteAction
+ result = TkDialog.new("title"=>"Confirm Action",
+ "message"=>"よろしいですか?",
+ "default_button"=>0,
+ "buttons"=>["キャンセル"])
+ if( result.value == 0 )
+ clearAction
+ end
+end
+
+
+class RolodexFrame < TkFrame
+ attr_reader :entry, :label
+
+ LABEL = ["","名前:","住所","","","電話(自宅):","電話(会社):","Fax:"]
+
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+ self["relief"] = "flat"
+ @i = []
+ @label = []
+ @entry = []
+ for i in 1..7
+ @i[i] = TkFrame.new(self)
+ @i[i].pack("side"=>"top",
+ "pady"=>2,
+ "anchor"=>"e")
+ @label[i] = TkLabel.new(@i[i],
+ "text"=>LABEL[i],
+ "anchor"=>"e")
+ @entry[i] = TkEntry.new(@i[i],
+ "width"=>30,
+ "relief"=>"sunken")
+ @entry[i].pack("side"=>"right")
+ @label[i].pack("side"=>"right")
+ end
+ end
+end
+
+class RolodexButtons < TkFrame
+ attr_reader :clear, :add, :search, :delete
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ @clear = TkButton.new(self,"text" => "クリアー")
+ @add = TkButton.new(self, "text" => "追加")
+ @search = TkButton.new(self, "text" => "検索")
+ @delete = TkButton.new(self, "text" => "消去")
+ for w in [@clear,@add,@search,@delete]
+ w.pack("side"=>"left", "padx"=>2)
+ end
+ end
+end
+
+class RolodexMenuFrame < TkFrame
+ attr_reader :file_menu, :help_menu, :file, :help
+
+ def initialize(parent,keys=nil)
+ super(parent,keys)
+ configure("relief"=>"raised",
+ "borderwidth"=>1)
+
+ @file = TkMenubutton.new(self,
+ "text"=> "ファイル",
+ "underline"=>0)
+ @file_menu = TkMenu.new(@file)
+ @file_menu.add("command",
+ "label" => "読み込み ...",
+ "command" => proc{fileAction},
+ "underline" => 0)
+ @file_menu.add("command",
+ "label" => "終了",
+ "command" => proc{$root.destroy},
+ "underline" => 0)
+ @file.menu(@file_menu)
+ @file.pack("side"=>"left")
+
+ @help = TkMenubutton.new(self,
+ "text"=> "ヘルプ",
+ "underline"=>0)
+ @help_menu = TkMenu.new(@help)
+ @help_menu.add("command",
+ "label"=> "コンテキストについて",
+ "command"=>proc{show_help("コンテキスト")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=> "ヘルプについて",
+ "command"=>proc{show_help("ヘルプ")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=> "ウィンドウについて",
+ "command"=>proc{show_help("ウィンドウ")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=> "キー操作について",
+ "command"=>proc{show_help("キー操作")},
+ "underline"=>3)
+ @help_menu.add("command",
+ "label"=> "バージョン情報",
+ "command"=>proc{show_help("バージョン情報")},
+ "underline"=>3)
+ @help.menu(@help_menu)
+ @help.pack("side"=>"right")
+ end
+end
+
+class Rolodex < TkRoot
+ attr_reader :frame, :buttons, :menu
+
+ def initialize(*args)
+ super(*args)
+ @frame = RolodexFrame.new(self)
+ @frame.pack("side"=>"top",
+ "fill"=>"y",
+ "anchor"=>"center")
+ @buttons = RolodexButtons.new(self)
+ @buttons.pack("side"=>"bottom",
+ "pady"=>2,
+ "anchor"=>"center")
+ @menu = RolodexMenuFrame.new(self)
+ @menu.pack("before"=>@frame,
+ "side"=>"top",
+ "fill"=>"x")
+ end
+end
+
+$root = Rolodex.new
+
+$root.buttons.delete.configure("command"=>proc{deleteAction})
+$root.buttons.add.configure("command"=>proc{addAction})
+$root.buttons.clear.configure("command"=>proc{clearAction})
+$root.buttons.search.configure("command"=>proc{addAction; fillCard})
+
+$root.buttons.clear.configure("text"=> "クリアー Ctrl+C")
+$root.bind("Control-c",proc{clearAction})
+
+$root.buttons.add.configure("text"=> "追加 Ctrl+A")
+$root.bind("Control-a",proc{addAction})
+
+$root.buttons.search.configure("text"=> "検索 Ctrl+S")
+$root.bind("Control-s",proc{addAction; fillCard})
+
+$root.buttons.delete.configure("text"=> "消去 Ctrl+D")
+$root.bind("Control-d",proc{deleteAction})
+
+$root.menu.file_menu.entryconfigure(1, "accel"=>"Ctrl+F")
+$root.bind("Control-f",proc{fileAction})
+
+$root.menu.file_menu.entryconfigure(2, "accel"=>"Ctrl+Q")
+$root.bind("Control-q",proc{$root.destroy})
+
+$root.frame.entry[1].focus
+
+$root.bind("Any-F1",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+$root.bind("Any-Help",
+ proc{|event| show_help(event.widget, event.x_root, event.y_root)})
+
+
+$helpTopics = {}
+
+$helpTopics[$root.menu.file] = <<EOF
+これは「ファイル」メニューです。「読み込み」や「終了」などを
+行なうことができます。
+EOF
+
+$helpTopics[$root.menu.file_menu.index(0)] = <<EOF
+ファイルの読み込みを行なうときに使います。
+EOF
+
+$helpTopics[$root.menu.file_menu.index(1)] = <<EOF
+アプリケーションを終了するときに使います。
+EOF
+
+$helpTopics[$root.frame.entry[1]] = <<EOF
+名前を記入するエントリです。
+EOF
+
+$helpTopics[$root.frame.entry[2]] = <<EOF
+住所を記入するエントリです。
+EOF
+
+$helpTopics[$root.frame.entry[3]] = <<EOF
+住所を記入するエントリです。
+EOF
+
+$helpTopics[$root.frame.entry[4]] = <<EOF
+住所を記入するエントリです。
+EOF
+
+$helpTopics[$root.frame.entry[5]] = <<EOF
+自宅の電話番号を記入するエントリです。公開\
+したくないときは private と記入します。
+EOF
+
+$helpTopics[$root.frame.entry[6]] = <<EOF
+会社の電話番号を記入するエントリです。
+EOF
+
+$helpTopics[$root.frame.entry[7]] = <<EOF
+FAX番号を記入するエントリです。
+EOF
+
+$helpTopics["コンテキスト"] = <<EOF
+Ruby/Tkではgrabの機構がないためこのアプリケーションでは\
+コンテキストヘルプはサポートされていません。
+しかし同じような効果をbindとマウスの位置のWedgetを知る\
+ことで得ることができます。
+EOF
+
+$helpTopics["ヘルプ"] = <<EOF
+マウスをウィンドウにあわせてF1キーを押すことによって\
+そのヘルプを見ることができます。
+EOF
+
+$helpTopics["ウィンドウ"] = <<EOF
+このウィンドウはダミーです。
+EOF
+
+$helpTopics["キー操作"] = <<EOF
+Ctrl+A: 追加
+Ctrl+C: クリアー
+Ctrl+D: 消去
+Ctrl+F: ファイル選択
+Ctrl+Q: 終了
+Ctrl+S: 検索
+EOF
+
+$helpTopics["バージョン情報"] = <<EOF
+バージョンは 1.0.1j です。
+EOF
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/ruler.rb b/ext/tk/sample/demos-jp/ruler.rb
new file mode 100644
index 0000000000..5c34a5a5da
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ruler.rb
@@ -0,0 +1,203 @@
+# -*- coding: utf-8 -*-
+#
+# ruler widget demo (called by 'widget')
+#
+
+# rulerMkTab --
+# This method creates a new triangular polygon in a canvas to
+# represent a tab stop.
+#
+# Arguments:
+# c - The canvas window.
+# x, y - Coordinates at which to create the tab stop.
+
+def rulerMkTab(c,x,y)
+ v = $demo_rulerInfo
+ TkcPolygon.new(c, x, y, x+v.size, y+v.size, x-v.size, y+v.size)
+end
+
+# toplevel widget が存在すれば削除する
+if defined?($ruler_demo) && $ruler_demo
+ $ruler_demo.destroy
+ $ruler_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$ruler_demo = TkToplevel.new {|w|
+ title("Ruler Demonstration")
+ iconname("ruler")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ruler_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+TkLabel.new(base_frame, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
+ 'text'=>"このキャンバスwidgetはルーラーの模型です。ルーラーの右にあるのはタブストップの井戸で、ここから引っ張ってくることによってタブストップを作ることができます。また、すでにあるタブストップを動かすこともできます。タブストップを上方または下方にかすれて表示されるまでドラッグすると、マウスボタンを離した時にそのタブストップは消えます。"){
+ pack('side'=>'top')
+}
+
+# frame 生成
+$ruler_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $ruler_demo
+ $ruler_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'ruler'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$ruler_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# canvas 設定
+$ruler_canvas = TkCanvas.new(base_frame, 'width'=>'14.8c', 'height'=>'2.5c')
+$ruler_canvas.pack('side'=>'top', 'fill'=>'x')
+
+# 値設定
+unless Struct.const_defined?("RulerInfo")
+ $demo_rulerInfo = Struct.new("RulerInfo", :grid, :left, :right, :x, :y,
+ :top, :bottom, :size, :normalStyle,
+ :activeStyle, :deleteStyle).new
+end
+$demo_rulerInfo.grid = '.25c'
+$demo_rulerInfo.left = TkWinfo.fpixels($ruler_canvas, '1c')
+$demo_rulerInfo.right = TkWinfo.fpixels($ruler_canvas, '13c')
+$demo_rulerInfo.top = TkWinfo.fpixels($ruler_canvas, '1c')
+$demo_rulerInfo.bottom = TkWinfo.fpixels($ruler_canvas, '1.5c')
+$demo_rulerInfo.size = TkWinfo.fpixels($ruler_canvas, '.2c')
+$demo_rulerInfo.normalStyle = {'fill'=>'black'}
+if TkWinfo.depth($ruler_canvas) > 1
+ $demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''}
+ $demo_rulerInfo.deleteStyle = {'fill'=>'red',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator)}
+else
+ $demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''}
+ $demo_rulerInfo.deleteStyle = {'fill'=>'black',
+ 'stipple'=>'@'+[$demo_dir, '..',
+ 'images', 'gray25.xbm'].join(File::Separator)}
+end
+
+TkcLine.new($ruler_canvas,
+ '1c', '0.5c', '1c', '1c', '13c', '1c', '13c', '0.5c', 'width'=>1)
+(0..11).each{|i|
+ x = i+1
+ TkcLine.new($ruler_canvas, "#{x}c", '1c', "#{x}c", '0.6c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.25c", '1c', "#{x}.25c", '0.8c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.5c", '1c', "#{x}.5c", '0.7c', 'width'=>1)
+ TkcLine.new($ruler_canvas, "#{x}.75c", '1c', "#{x}.75c", '0.8c', 'width'=>1)
+ TkcText.new($ruler_canvas, "#{x}.15c", '0.75c', 'text'=>i, 'anchor'=>'sw')
+}
+
+$rulerTag_well = TkcTag.new($ruler_canvas)
+$ruler_canvas\
+.addtag_withtag($rulerTag_well,
+ TkcRectangle.new($ruler_canvas,
+ '13.2c', '1c', '13.8c', '0.5c',
+ 'outline'=>'black',
+ 'fill'=>($ruler_canvas\
+ .configinfo('background'))[4]) )
+$ruler_canvas\
+.addtag_withtag($rulerTag_well,
+ rulerMkTab($ruler_canvas,
+ TkWinfo.pixels($ruler_canvas, '13.5c'),
+ TkWinfo.pixels($ruler_canvas, '.65c') ) )
+
+$rulerTag_well.bind('1', proc{|x,y| rulerNewTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.itembind('tab', '1',
+ proc{|x,y| rulerSelectTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.bind('B1-Motion',
+ proc{|x,y| rulerMoveTab($ruler_canvas,x,y)}, '%x %y')
+$ruler_canvas.bind('Any-ButtonRelease-1', proc{rulerReleaseTab($ruler_canvas)})
+
+# rulerNewTab --
+# Does all the work of creating a tab stop, including creating the
+# triangle object and adding tags to it to give it tab behavior.
+#
+# Arguments:
+# c - The canvas window.
+# x, y - The coordinates of the tab stop.
+
+def rulerNewTab(c,x,y)
+ v = $demo_rulerInfo
+ c.addtag_withtag('active', rulerMkTab(c,x,y))
+ c.addtag_withtag('tab', 'active')
+ v.x = x
+ v.y = y
+ rulerMoveTab(c,x,y)
+end
+
+# rulerSelectTab --
+# This method is invoked when mouse button 1 is pressed over
+# a tab. It remembers information about the tab so that it can
+# be dragged interactively.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse (identifies the point by
+# which the tab was picked up for dragging).
+
+def rulerSelectTab(c,x,y)
+ v = $demo_rulerInfo
+ v.x = c.canvasx(x, v.grid)
+ v.y = v.top+2
+ c.addtag_withtag('active', 'current')
+ c.itemconfigure('active', v.activeStyle)
+ c.raise('active')
+end
+
+# rulerMoveTab --
+# This method is invoked during mouse motion events to drag a tab.
+# It adjusts the position of the tab, and changes its appearance if
+# it is about to be dragged out of the ruler.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse.
+
+def rulerMoveTab(c,x,y)
+ v = $demo_rulerInfo
+ return if c.find_withtag('active') == []
+ cx = c.canvasx(x,v.grid)
+ cy = c.canvasy(y)
+ cx = v.left if cx < v.left
+ cx = v.right if cx > v.right
+ if (cy >= v.top && cy <= v.bottom)
+ cy = v.top+2
+ c.itemconfigure('active', v.activeStyle)
+ else
+ cy = cy-v.size-2
+ c.itemconfigure('active', v.deleteStyle)
+ end
+ c.move('active', cx-v.x, cy-v.y)
+ v.x = cx
+ v.y = cy
+end
+
+# rulerReleaseTab --
+# This method is invoked during button release events that end
+# a tab drag operation. It deselects the tab and deletes the tab if
+# it was dragged out of the ruler.
+#
+# Arguments:
+# c - The canvas widget.
+# x, y - The coordinates of the mouse.
+
+def rulerReleaseTab(c)
+ v = $demo_rulerInfo
+ return if c.find_withtag('active') == []
+ if v.y != v.top+2
+ c.delete('active')
+ else
+ c.itemconfigure('active', v.normalStyle)
+ c.dtag('active')
+ end
+end
+
diff --git a/ext/tk/sample/demos-jp/sayings.rb b/ext/tk/sample/demos-jp/sayings.rb
new file mode 100644
index 0000000000..cf4fe7b1b1
--- /dev/null
+++ b/ext/tk/sample/demos-jp/sayings.rb
@@ -0,0 +1,103 @@
+# -*- coding: utf-8 -*-
+#
+# listbox widget demo 'sayings' (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($sayings_demo) && $sayings_demo
+ $sayings_demo.destroy
+ $sayings_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$sayings_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (well-known sayings)")
+ iconname("sayings")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($sayings_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下のリストボックスにはいろいろな格言が入っています。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $sayings_demo
+ $sayings_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'sayings'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+sayings_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>10) {|w|
+ sv = TkScrollbar.new(w)
+ sh = TkScrollbar.new(w, 'orient'=>'horizontal')
+ sayings_lbox = TkListbox.new(w) {
+ setgrid 1
+ width 20
+ height 10
+ yscrollcommand proc{|first,last| sv.set first,last}
+ xscrollcommand proc{|first,last| sh.set first,last}
+ }
+ sv.command(proc{|*args| sayings_lbox.yview(*args)})
+ sh.command(proc{|*args| sayings_lbox.xview(*args)})
+
+ if $tk_version =~ /^4\.[01]/
+ sv.pack('side'=>'right', 'fill'=>'y')
+ sh.pack('side'=>'bottom', 'fill'=>'x')
+ sayings_lbox.pack('expand'=>'yes', 'fill'=>'y')
+
+ else
+ sayings_lbox.grid('row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ sv.grid('row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ sh.grid('row'=>1, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ TkGrid.rowconfigure(w, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(w, 0, 'weight'=>1, 'minsize'=>0)
+ end
+
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+sayings_lbox.insert(0,
+"Waste not, want not",
+"Early to bed and early to rise makes a man healthy, wealthy, and wise",
+"Ask not what your country can do for you, ask what you can do for your country",
+"I shall return",
+"NOT",
+"A picture is worth a thousand words",
+"User interfaces are hard to build",
+"Thou shalt not steal",
+"A penny for your thoughts",
+"Fool me once, shame on you; fool me twice, shame on me",
+"Every cloud has a silver lining",
+"Where there's smoke there's fire",
+"It takes one to know one",
+"Curiosity killed the cat",
+"Take this job and shove it",
+"Up a creek without a paddle",
+"I'm mad as hell and I'm not going to take it any more",
+"An apple a day keeps the doctor away",
+"Don't look a gift horse in the mouth"
+)
+
diff --git a/ext/tk/sample/demos-jp/search.rb b/ext/tk/sample/demos-jp/search.rb
new file mode 100644
index 0000000000..238450ae30
--- /dev/null
+++ b/ext/tk/sample/demos-jp/search.rb
@@ -0,0 +1,184 @@
+# -*- coding: utf-8 -*-
+#
+# Text Search widget demo (called by 'widget')
+#
+
+# textLoadFile --
+# This method below loads a file into a text widget, discarding
+# the previous contents of the widget. Tags for the old widget are
+# not affected, however.
+#
+# Arguments:
+# w - The window into which to load the file. Must be a
+# text widget.
+# file - The name of the file to load. Must be readable.
+
+def textLoadFile(w,file)
+ w.delete('1.0', 'end')
+ f = open(file, 'r')
+ while(!f.eof?)
+ w.insert('end', f.read(1000))
+ end
+ f.close
+end
+
+# textSearch --
+# Search for all instances of a given string in a text widget and
+# apply a given tag to each instance found.
+#
+# Arguments:
+# w - The window in which to search. Must be a text widget.
+# string - The string to search for. The search is done using
+# exact matching only; no special characters.
+# tag - Tag to apply to each instance of a matching string.
+
+def textSearch(w, string, tag)
+ tag.remove('0.0', 'end')
+ return if string == ""
+ cur = '1.0'
+ loop {
+ cur, len = w.search_with_length(string, cur, 'end')
+ break if cur == ""
+ tag.add(cur, "#{cur} + #{len} char")
+ cur = w.index("#{cur} + #{len} char")
+ }
+end
+
+# textToggle --
+# This method is invoked repeatedly to invoke two commands at
+# periodic intervals. It normally reschedules itself after each
+# execution but if an error occurs (e.g. because the window was
+# deleted) then it doesn't reschedule itself.
+#
+# Arguments:
+# cmd1 - Command to execute when method is called.
+# sleep1 - Ms to sleep after executing cmd1 before executing cmd2.
+# cmd2 - Command to execute in the *next* invocation of this method.
+# sleep2 - Ms to sleep after executing cmd2 before executing cmd1 again.
+
+def textToggle(cmd1,sleep1,cmd2,sleep2)
+ sleep_list = [sleep2, sleep1]
+ TkAfter.new(proc{sleep = sleep_list.shift; sleep_list.push(sleep); sleep},
+ -1, cmd1, cmd2).start(sleep1)
+end
+
+# toplevel widget が存在すれば削除する
+if defined?($search_demo) && $search_demo
+ $search_demo.destroy
+ $search_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$search_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Search and Highlight")
+ iconname("search")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($search_demo).pack(:fill=>:both, :expand=>true)
+
+# frame 生成
+$search_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $search_demo
+ $search_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'search'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$search_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>'ファイル名:',
+ 'width'=>13, 'anchor'=>'w').pack('side'=>'left')
+ $search_fileName = TkVariable.new
+ TkEntry.new(f, 'width'=>40,
+ 'textvariable'=>$search_fileName) {
+ pack('side'=>'left')
+ bind('Return', proc{textLoadFile($search_text, $search_fileName.value)
+ $search_string_entry.focus})
+ focus
+ }
+ TkButton.new(f, 'text'=>'読み込み',
+ 'command'=>proc{textLoadFile($search_text,
+ $search_fileName.value)})\
+ .pack('side'=>'left', 'pady'=>5, 'padx'=>10)
+}.pack('side'=>'top', 'fill'=>'x')
+
+TkFrame.new(base_frame) {|f|
+ TkLabel.new(f, 'text'=>'検索文字列:',
+ 'width'=>13, 'anchor'=>'w').pack('side'=>'left')
+ $search_searchString = TkVariable.new
+ $search_string_entry = TkEntry.new(f, 'width'=>40,
+ 'textvariable'=>$search_searchString) {
+ pack('side'=>'left')
+ bind('Return', proc{textSearch($search_text, $search_searchString.value,
+ $search_Tag)})
+ }
+ TkButton.new(f, 'text'=>'反転',
+ 'command'=>proc{textSearch($search_text,
+ $search_searchString.value,
+ $search_Tag)}) {
+ pack('side'=>'left', 'pady'=>5, 'padx'=>10)
+ }
+}.pack('side'=>'top', 'fill'=>'x')
+
+$search_text = TkText.new(base_frame, 'setgrid'=>true) {|t|
+ $search_Tag = TkTextTag.new(t)
+ TkScrollbar.new(base_frame, 'command'=>proc{|*args| t.yview(*args)}) {|sc|
+ t.yscrollcommand(proc{|first,last| sc.set first,last})
+ pack('side'=>'right', 'fill'=>'y')
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+}
+
+# Set up display styles for text highlighting.
+
+if TkWinfo.depth($search_demo) > 1
+ textToggle(proc{
+ $search_Tag.configure('background'=>'#ce5555',
+ 'foreground'=>'white')
+ },
+ 800,
+ proc{
+ $search_Tag.configure('background'=>'', 'foreground'=>'')
+ },
+ 200 )
+else
+ textToggle(proc{
+ $search_Tag.configure('background'=>'black',
+ 'foreground'=>'white')
+ },
+ 800,
+ proc{
+ $search_Tag.configure('background'=>'', 'foreground'=>'')
+ },
+ 200 )
+end
+$search_text.insert('1.0', "\
+このウィンドウは検索機構を実現するのにテキスト widget のタグ機能がどの \
+ように使われるのかをデモするものです。まず上のエントリにファイル名を入 \
+れ、<リターン> を押すか「ロード」ボタンを押してください。次にその下の \
+エントリに文字列を入力し、<リターン> を押すか「反転」ボタンを押してく \
+ださい。するとファイル中の、検索文字列と一致する部分に全て \"search_Tag\" \
+というタグがつけられ、タグの表示属性としてその文字列が点滅するように \
+設定されます。\n")
+$search_text.insert('end', "\
+ファイル読み込みのカレントディレクトリは \"#{Dir.pwd}\" です。\
+")
+$search_text.set_insert '0.0'
+
+$search_fileName.value = ''
+$search_searchString.value = ''
+
+$search_text.width = 60
+$search_text.height = 20
diff --git a/ext/tk/sample/demos-jp/spin.rb b/ext/tk/sample/demos-jp/spin.rb
new file mode 100644
index 0000000000..fd51a3f457
--- /dev/null
+++ b/ext/tk/sample/demos-jp/spin.rb
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+#
+# spin.rb --
+#
+# This demonstration script creates several spinbox widgets.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($spin_demo) && $spin_demo
+ $spin_demo.destroy
+ $spin_demo = nil
+end
+
+$spin_demo = TkToplevel.new {|w|
+ title("Spinbox Demonstration")
+ iconname("spin")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($spin_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+下には3種類のスピンボックスが表示されています。
+それぞれ、マウスで選択して文字を入力することができます。
+編集操作としては、Emacs 形式の多くに加えて、一般的な
+Motif 形式のキー操作がサポートされています。たとえば、
+Backspace と Control-h とは入力カーソルの左側の文字を
+削除し、Delete と Control-d とは右側の文字を削除します。
+入力枠の長さを越えるような長い文字列を入力した場合には、
+マウスのボタン2を押してドラッグすることで、入力文字列
+をスキャンすることが可能です。
+なお、最初のスピンボックスは、整数値とみなされるような
+文字列しか入力が許されないことに注意してください。また、
+3番目のスピンボックスで選択候補に現れるのはオーストラ
+リアの都市名のリストとなっています。
+もしあなたが使っている Ruby にリンクされている Tk ライ
+ブラリが spinbox ウィジェットを実装していない場合、この
+デモはうまく動かないはずです。その場合には spinbox ウィ
+ジェットが実装されているようなより新しいバージョンの Tk
+を組み合わせて試すようにしてください。
+EOL
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $spin_demo.destroy
+ $spin_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'spin'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+australianCities = [
+ 'Canberra', 'Sydney', 'Melbourne', 'Perth', 'Adelaide',
+ 'Brisbane', 'Hobart', 'Darwin', 'Alice Springs'
+]
+
+[
+ TkSpinbox.new(base_frame, :from=>1, :to=>10, :width=>10, :validate=>:key,
+ :validatecommand=>[
+ proc{|s| s == '' || /^[+-]?\d+$/ =~ s }, '%P'
+ ]),
+ TkSpinbox.new(base_frame, :from=>0, :to=>3, :increment=>0.5,
+ :format=>'%05.2f', :width=>10),
+ TkSpinbox.new(base_frame, :values=>australianCities, :width=>10)
+].each{|sbox| sbox.pack(:side=>:top, :pady=>5, :padx=>10)}
diff --git a/ext/tk/sample/demos-jp/square b/ext/tk/sample/demos-jp/square
new file mode 100644
index 0000000000..bb66282154
--- /dev/null
+++ b/ext/tk/sample/demos-jp/square
@@ -0,0 +1,81 @@
+#!/usr/bin/env ruby
+
+# square --
+# This script generates a demo application containing only
+# a "square" widget. It's only usable if Tk has been compiled
+# with tkSquare.c and with the -DSQUARE_DEMO compiler switch.
+# This demo arranges the following bindings for the widget:
+#
+# Button-1 press/drag: moves square to mouse
+# "a": toggle size animation on/off
+#
+
+require 'tk'
+require 'tkafter'
+
+class TkSquare<TkWindow
+ def create_self
+ begin
+ tk_call 'square', path
+ rescue
+ STDERR.print "\nSorry. Your Tk interpreter does not contain " +
+ 'a "square" demonstration widget.' +
+ "\n ( See documents included the Tcl/Tk source archive. )\n\n"
+ exit
+ end
+ end
+ def size(amount=nil)
+ if amount
+ tk_send 'size', amount
+ else
+ number(tk_send('size'))
+ end
+ end
+ def position(x,y)
+ tk_send 'position', x, y
+ end
+end
+
+$s = TkSquare.new{
+ pack('expand'=>'yes', 'fill'=>'both')
+ bind('1', proc{|x,y| center(x,y)}, '%s %y')
+ bind('B1-Motion', proc{|x,y| center(x,y)}, '%s %y')
+ bind('a', proc{animate})
+ focus
+}
+TkRoot.new.minsize(1,1)
+
+# The procedure below centers the square on a given position.
+
+def center(x,y)
+ a = $s.size
+ $s.position(x-(a/2), y-(a/2))
+end
+
+# The procedures below provide a simple form of animation where
+# the box changes size in a pulsing pattern: larger, smaller, larger,
+# and so on.
+
+$inc = 0
+
+def timer_proc
+ a = $s.size
+ return if $inc == 0
+ $inc = -3 if a >= 40
+ $inc = 3 if a <= 10
+ $s.size(a+$inc)
+end
+
+$timer = TkAfter.new(30, -1, proc{timer_proc})
+
+def animate
+ if $inc == 0
+ $inc = 3
+ $timer.start
+ else
+ $inc = 0
+ $timer.stop
+ end
+end
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/states.rb b/ext/tk/sample/demos-jp/states.rb
new file mode 100644
index 0000000000..2966e6d834
--- /dev/null
+++ b/ext/tk/sample/demos-jp/states.rb
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+#
+# listbox widget demo 'states' (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($states_demo) && $states_demo
+ $states_demo.destroy
+ $states_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$states_demo = TkToplevel.new {|w|
+ title("Listbox Demonstration (states)")
+ iconname("states")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($states_demo).pack(:fill=>:both, :expand=>true)
+
+# label 生成
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '4i'
+ justify 'left'
+ text "下にあるのは都道府県名が入ったスクロールバー付のリストボックスです。リストをスクロールさせるのはスクロールバーでもできますし、リストボックスの中でマウスのボタン2(中ボタン)を押したままドラッグしてもできます。"
+}
+msg.pack('side'=>'top')
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $states_demo
+ $states_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'states'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+states_lbox = nil
+TkFrame.new(base_frame, 'borderwidth'=>'.5c') {|w|
+ s = TkScrollbar.new(w)
+ states_lbox = TkListbox.new(w) {
+ setgrid 1
+ height 12
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| states_lbox.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ states_lbox.pack('side'=>'left', 'expand'=>1, 'fill'=>'both')
+}.pack('side'=>'top', 'expand'=>'yes', 'fill'=>'y')
+
+ins_data = [
+ '愛知','青森','秋田','石川','茨城','岩手','愛媛',
+ '大分','大阪','岡山','沖縄','香川','鹿児島','神奈川',
+ '岐阜','京都','熊本','群馬','高知','埼玉','佐賀',
+ '滋賀','静岡','島根','千葉','東京','徳島','栃木',
+ '鳥取','富山','長崎','長野','奈良','新潟','兵庫',
+ '広島','福井','福岡','福島','北海道','三重','宮城',
+ '宮崎','山形','山口','山梨','和歌山'
+]
+
+states_lbox.insert(0, *ins_data)
+
diff --git a/ext/tk/sample/demos-jp/style.rb b/ext/tk/sample/demos-jp/style.rb
new file mode 100644
index 0000000000..813fde7a78
--- /dev/null
+++ b/ext/tk/sample/demos-jp/style.rb
@@ -0,0 +1,270 @@
+# -*- coding: utf-8 -*-
+#
+# text (display styles) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($style_demo) && $style_demo
+ $style_demo.destroy
+ $style_demo = nil
+end
+
+
+# demo 用の toplevel widget を生成
+$style_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Display Styles")
+ iconname("style")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($style_demo).pack(:fill=>:both, :expand=>true)
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $style_demo
+ $style_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'style'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+
+# text 生成
+txt = TkText.new(base_frame){|t|
+ # 生成
+ setgrid 'true'
+ #width 70
+ #height 32
+ wrap 'word'
+ font $font
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ # テキストタグ設定 (フォント関連)
+ family = 'Courier'
+
+ if $tk_version =~ /^4.*/
+ style_tag_bold = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*')
+ style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font)
+ style_tag_verybig = TkTextTag.new(t, 'font'=>'-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*')
+ # style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font)
+ style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*')
+ else
+ style_tag_bold = TkTextTag.new(t, 'font'=>[family, 12, :bold, :italic])
+ style_tag_big = TkTextTag.new(t, 'font'=>[family, 14, :bold])
+ style_tag_verybig = TkTextTag.new(t, 'font'=>['Helvetica', 24, :bold])
+ style_tag_small = TkTextTag.new(t, 'font'=>'Times 8 bold')
+ end
+###
+# case($tk_version)
+# when /^4.*/
+# style_tag_big = TkTextTag.new(t, 'font'=>'-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*', 'kanjifont'=>$msg_kanji_font)
+# style_tag_small = TkTextTag.new(t, 'font'=>'-Adobe-Helvetica-Bold-R-Normal-*-100-*', 'kanjifont'=>$kanji_font)
+# when /^8.*/
+# unless $style_demo_do_first
+# $style_demo_do_first = true
+# Tk.tk_call('font', 'create', '@bigascii',
+# '-copy', '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*')
+# Tk.tk_call('font', 'create', '@smallascii',
+# '-copy', '-Adobe-Helvetica-Bold-R-Normal-*-100-*')
+# Tk.tk_call('font', 'create', '@cBigFont',
+# '-compound', '@bigascii @msg_knj')
+# Tk.tk_call('font', 'create', '@cSmallFont',
+# '-compound', '@smallascii @kanji')
+# end
+# style_tag_big = TkTextTag.new(t, 'font'=>'@cBigFont')
+# style_tag_small = TkTextTag.new(t, 'font'=>'@cSmallFont')
+# end
+
+ # テキストタグ設定 (色,レリーフ関連)
+ if TkWinfo.depth($root).to_i > 1
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'#a0b7ce')
+ style_tag_color2 = TkTextTag.new(t, 'foreground'=>'red')
+ style_tag_raised = TkTextTag.new(t, 'relief'=>'raised', 'borderwidth'=>1)
+ style_tag_sunken = TkTextTag.new(t, 'relief'=>'sunken', 'borderwidth'=>1)
+ else
+ style_tag_color1 = TkTextTag.new(t, 'background'=>'black',
+ 'foreground'=>'white')
+ style_tag_color2 = TkTextTag.new(t, 'background'=>'black',
+ 'foreground'=>'white')
+ style_tag_raised = TkTextTag.new(t, 'background'=>'white',
+ 'relief'=>'raised', 'borderwidth'=>1)
+ style_tag_sunken = TkTextTag.new(t, 'background'=>'white',
+ 'relief'=>'sunken', 'borderwidth'=>1)
+ end
+
+ # テキストタグ設定 (その他)
+ if $tk_version =~ /^4\.[01]/
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
+ 'bgstipple'=>'gray25')
+ else
+ style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
+ 'borderwidth'=>0,
+ 'bgstipple'=>'gray12')
+ end
+ style_tag_fgstipple = TkTextTag.new(t, 'fgstipple'=>'gray50')
+ style_tag_underline = TkTextTag.new(t, 'underline'=>'on')
+ style_tag_overstrike = TkTextTag.new(t, 'overstrike'=>'on')
+ style_tag_right = TkTextTag.new(t, 'justify'=>'right')
+ style_tag_center = TkTextTag.new(t, 'justify'=>'center')
+ if $tk_version =~ /^4.*/
+ style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*')
+ style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>'-Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*')
+ else
+ style_tag_super = TkTextTag.new(t, 'offset'=>'4p', 'font'=>[family, 10])
+ style_tag_sub = TkTextTag.new(t, 'offset'=>'-2p', 'font'=>[family, 10])
+ end
+ style_tag_margins = TkTextTag.new(t, 'lmargin1'=>'12m', 'lmargin2'=>'6m',
+ 'rmargin'=>'10m')
+ style_tag_spacing = TkTextTag.new(t, 'spacing1'=>'10p', 'spacing2'=>'2p',
+ 'lmargin1'=>'12m', 'lmargin2'=>'6m',
+ 'rmargin'=>'10m')
+
+ # テキスト挿入
+ insert('end', 'このようにテキスト widget は情報を様々なスタイルで表示すること
+ができます。')
+ insert('end', 'タグ', style_tag_big)
+ insert('end', 'というメカニズムでコントロールされます。
+タグとはテキスト widget 内のある文字 (の範囲)に対して適用できる
+単なる名前のことです。タグは様々な表示スタイルに設定できます。
+設定すると、そのタグのついた文字は指定したスタイルで表示される
+ようになります。使用できる表示スタイルは次の通りです。
+')
+ insert('end', '
+1. フォント', style_tag_big)
+ insert('end', ' どんな X のフォントでも使えます。')
+ insert('end', 'large', style_tag_verybig)
+ insert('end', '
+とか')
+# insert('end', '小さい', style_tag_small)
+ insert('end', 'small', style_tag_small)
+ insert('end', 'とか。
+')
+ insert('end', '
+2. 色', style_tag_big)
+ insert('end', ' ')
+ insert('end', '背景色', style_tag_color1)
+ insert('end', 'も')
+ insert('end', '前景色', style_tag_color2)
+ insert('end', 'も')
+ insert('end', '両方', style_tag_color1, style_tag_color2)
+ insert('end', 'とも変えることができます。
+')
+ insert('end', '
+3. 網かけ', style_tag_big)
+ insert('end', ' このように描画の際に')
+ insert('end', '背景も', style_tag_bgstipple)
+ insert('end', '文字も', style_tag_fgstipple)
+ insert('end', '単なる塗りつぶし
+でなく、網かけを使うことができます。
+')
+ insert('end', '
+4. 下線', style_tag_big)
+ insert('end', ' このように')
+ insert('end', '文字に下線を引く', style_tag_underline)
+ insert('end', 'ことができます。
+')
+ insert('end', '
+5. 打ち消し線', style_tag_big)
+ insert('end', ' このように')
+ insert('end', '文字に重ねて線を引く', style_tag_overstrike)
+ insert('end', 'ことができます。
+')
+ insert('end', '
+6. 3D 効果', style_tag_big)
+ insert('end', ' 背景に枠をつけて、文字を')
+ insert('end', '飛び出す', style_tag_raised)
+ insert('end', 'ようにしたり')
+ insert('end', '沈む', style_tag_sunken)
+ insert('end', '
+ようにできます。
+')
+ insert('end', '
+7. 行揃え', style_tag_big)
+ insert('end', ' このように行を
+')
+ insert('end', '左に揃えたり
+')
+ insert('end', '右に揃えたり
+', style_tag_right)
+ insert('end', '真中に揃えたりできます。
+', style_tag_center)
+ insert('end', '
+8. 肩付き文字と添字', style_tag_big)
+ insert('end', ' 10')
+ insert('end', 'n', style_tag_super)
+ insert('end', ' のように肩付き文字の効果や、')
+ insert('end', '
+X')
+ insert('end', 'i', style_tag_sub)
+ insert('end', 'のように添字の効果を出すことができます。
+')
+ insert('end', '
+9. マージン', style_tag_big)
+ insert('end', 'テキストの左側に余分な空白を置くことができます:
+')
+ insert('end', 'この段落はマージンの使用例です。スクリーン',
+ style_tag_margins)
+ insert('end', '上で折り返されて表示されている1行のテキストです。',
+ style_tag_margins)
+ insert('end', '左側には2種類のマージンを持ちます。', style_tag_margins)
+ insert('end', '1行目に対するものと、', style_tag_margins)
+ insert('end', '2行目以降の連続したマージン', style_tag_margins)
+ insert('end', 'です。また右側にもマージンがあります。', style_tag_margins)
+ insert('end', '行の折り返し位置を決めるために使用することができます。
+', style_tag_margins)
+ insert('end', '
+10. スペーシング', style_tag_big)
+ insert('end', '3つのパラメータで行のスペーシングを')
+ insert('end', '制御す
+ることができます。Spacing1で、行の')
+ insert('end', '上にどのくらいの空間を置くか、
+spacing3')
+ insert('end', 'で行の下にどのくらいの空間を置くか、')
+ insert('end', '行が折り返されているなら
+ば、spacing2で、')
+ insert('end', 'テキスト行を生成している行の間にどのくらい')
+ insert('end', 'の空間を置
+くかを示します。
+')
+ insert('end', 'これらのインデントされた段落はどのように',
+ style_tag_spacing)
+ insert('end', 'スペーシングがが行われるのかを示します。',
+ style_tag_spacing)
+ insert('end', '各段落は実際はテキストwidget', style_tag_spacing)
+ insert('end', 'の1行で、widgetによって折り畳まれています。
+', style_tag_spacing)
+ insert('end', 'Spacing1はこのテキストでは10pointに', style_tag_spacing)
+ insert('end', '設定されています。', style_tag_spacing)
+ insert('end', 'これにより、段落の間に大きな間隔が', style_tag_spacing)
+ insert('end', '存在しています。', style_tag_spacing)
+ insert('end', 'Spacing2は2pointに設定されています。', style_tag_spacing)
+ insert('end', 'これで段落の中にほんの少し間隔が存在しています。',
+ style_tag_spacing)
+ insert('end', 'Spacing3はこの例では使用されていません。
+', style_tag_spacing)
+ insert('end', '間隔がどこにあるかを見たければ、これらの段落の',
+ style_tag_spacing)
+ insert('end', 'なかでテキストを選択してください。選択の', style_tag_spacing)
+ insert('end', '反転した部分には余分にとられた間隔が', style_tag_spacing)
+ insert('end', '含まれています。
+', style_tag_spacing)
+
+}
+
+txt.width 70
+txt.height 32
diff --git a/ext/tk/sample/demos-jp/tcolor b/ext/tk/sample/demos-jp/tcolor
new file mode 100644
index 0000000000..f2d5458db4
--- /dev/null
+++ b/ext/tk/sample/demos-jp/tcolor
@@ -0,0 +1,534 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+# tcolor --
+# このスクリプトはRGB,HSB,CYM形式をサポートする
+# 簡易カラーエディタです。
+#
+# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp)
+# last update: Thu Jun 18 06:32:35 JST 1998
+#
+
+# まずはtk.rbを読み込む。
+
+require "tk"
+
+
+# Tkによって変更される変数はTkVariableのインスタンスを使う。
+
+$colorSpace = TkVariable.new(:rgb)
+$master = nil
+$red = 65535
+$green = 0
+$blue = 0
+$color = "#ffff00000000"
+$updating = TkVariable.new(0)
+$autoUpdate = TkVariable.new(1)
+$name = TkVariable.new($color)
+$command = TkVariable.new("print(%%,\"\n\")")
+# $command = TkVariable.new("")
+$label1 = TkVariable.new("label1")
+$label2 = TkVariable.new("label2")
+$label3 = TkVariable.new("label3")
+
+
+# リソースデータベースの設定
+if (TkVarAccess.new('tcl_platform')['platform'] == 'unix')
+ TkOptionDB.add('*Entry.background', 'white')
+end
+
+
+# 各イベント用のメソッド
+
+def rgbToHsv(red,green,blue)
+
+ if ( red > green )
+ max = red
+ min = green
+ else
+ max = green
+ min = red
+ end
+
+ if ( blue > max )
+ max = blue
+ else
+ if ( blue < min )
+ min = blue
+ end
+ end
+
+ range = max - min
+
+ if ( max == 0 )
+ sat = 0.0
+ else
+ sat = (max-min)/max
+ end
+
+ if ( sat == 0 )
+ hue = 0.0
+ else
+ rc = (max-red)/range
+ gc = (max-green)/range
+ bc = (max-blue)/range
+ if ( red == max )
+ hue = 0.166667 * (bc - gc)
+ else
+ if ( green == max )
+ hue = 0.166667 * (2.0 + rc - bc)
+ else
+ hue = 0.166667 * (4.0 + gc - rc)
+ end
+ end
+ if ( hue < 0.0 )
+ hue = hue + 1.0
+ end
+ end
+
+ [hue,sat,max/65535]
+end
+
+
+def hsbToRgb(hue,sat,value)
+ v = 65535.0 * value
+ if( sat == 0 )
+ ans = [v,v,v]
+ else
+ hue = hue*6.0
+ if ( hue >= 6 )
+ hue = 0.0
+ end
+ i = hue.to_i
+ f = hue - i
+ p = 65535.0 * value * (1.0 - sat)
+ q = 65535.0 * value * (1.0 - (sat * f))
+ t = 65535.0 * value * (1.0 - (sat * (1.0 - f)))
+ case i
+ when 0
+ ans = [v,t,p]
+ when 1
+ ans = [q,v,p]
+ when 2
+ ans = [p,v,t]
+ when 3
+ ans = [p,q,v]
+ when 4
+ ans = [t,p,v]
+ when 5
+ ans = [v,p,q]
+ else
+ raise(eException,"i value #{i} is out of range")
+ end
+ end
+ return ans
+end
+
+
+def _null_binding
+ Module.new.instance_eval{binding}
+end
+private :_null_binding
+
+def doUpdate
+ newCmd = $command.to_s.gsub("%%","\"#{$color}\"")
+ eval(newCmd, _null_binding)
+end
+
+
+def tc_scaleChanged
+ if( $updating.to_i == 1 )
+ return
+ end
+
+ $master = :scale if $master == nil
+
+ scale1 = $root.middle.middle.scale1
+ scale2 = $root.middle.middle.scale2
+ scale3 = $root.middle.middle.scale3
+
+ case $colorSpace.value.intern
+ when :rgb
+ $red = (scale1.get * 65.535).to_i
+ $green = (scale2.get * 65.535).to_i
+ $blue = (scale3.get * 65.535).to_i
+ when :cmy
+ $red = (65535 - scale1.get * 65.535).to_i
+ $green = (65535 - scale2.get * 65.535).to_i
+ $blue = (65535 - scale3.get * 65.535).to_i
+ when :hsb
+ list = hsbToRgb(scale1.get / 1000.0,
+ scale2.get / 1000.0,
+ scale3.get / 1000.0)
+ $red = list[0]
+ $green = list[1]
+ $blue = list[2]
+ else
+ raise(Exception,"unknown colorSpace")
+ end
+ $color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i)
+ $name.value = $color if $master == :scale
+ $root.middle.right.set_color($color)
+ if( $autoUpdate.to_i == 1 )
+ doUpdate
+ end
+ Tk.update(true)
+ $master = nil if $master == :scale
+end
+
+
+def tc_setScales
+ $updating.value = 1
+
+ scale1 = $root.middle.middle.scale1
+ scale2 = $root.middle.middle.scale2
+ scale3 = $root.middle.middle.scale3
+
+ case $colorSpace.value.intern
+ when :rgb
+ scale1.set($red / 65.535)
+ scale2.set($green / 65.535)
+ scale3.set($blue / 65.535)
+ when :cmy
+ scale1.set((65535 - $red) / 65.535)
+ scale2.set((65535 - $green) / 65.535)
+ scale3.set((65535 - $blue) / 65.535)
+ when :hsb
+ list = rgbToHsv($red,$green,$blue)
+ scale1.set( list[0] * 1000.0 )
+ scale2.set( list[1] * 1000.0 )
+ scale3.set( list[2] * 1000.0 )
+ else
+ raise(Exception,"unknown colorSpace")
+ end
+
+ $updating.value = 0
+end
+
+
+def tc_loadNamedColor(name)
+ $name.value = name
+ $master = :name if $master == nil
+ if name[0,1] != "#"
+ list = TkWinfo.rgb($root.middle.right.swatch,name)
+ $red = list[0]
+ $green = list[1]
+ $blue = list[2]
+ else
+ case name.length
+ when 4
+ fmt = /#(.{1})(.{1})(.{1})/
+ shift = 12
+ when 7
+ fmt = /#(.{2})(.{2})(.{2})/
+ shift = 8
+ when 10
+ fmt = /#(.{3})(.{3})(.{3})/
+ shift = 4
+ when 13
+ fmt = /#(.{4})(.{4})(.{4})/
+ shift = 0
+ else
+ raise(eException,"syntax error in color name \"#{name}\"")
+ end
+ name.scan(fmt){|strlist|
+ if strlist.length != 3
+ raise(eException,"syntax error in color name \"#{name}\"")
+ end
+ $red = strlist[0].hex
+ $green = strlist[1].hex
+ $blue = strlist[2].hex
+ }
+ $red = $red << shift
+ $green = $green << shift
+ $blue = $blue << shift
+ end
+
+ tc_setScales
+ $color = format("#%04x%04x%04x",$red,$green,$blue)
+ $root.middle.right.set_color($color)
+ if $autoUpdate.to_i == 1
+ doUpdate
+ end
+ Tk.update(true)
+ $master = nil if $master == :name
+end
+
+
+def changeColorSpace(space)
+ case space
+ when :rgb
+ $label1.value = "Red"
+ $label2.value = "Green"
+ $label3.value = "Blue"
+ when :cmy
+ $label1.value = "Cyan"
+ $label2.value = "Magenta"
+ $label3.value = "Yellow"
+ when :hsb
+ $label1.value = "Hue"
+ $label2.value = "Saturation"
+ $label3.value = "Brightness"
+ end
+ tc_setScales
+end
+
+
+
+
+
+# tcolor用のメニュー
+
+class TkColorMenuFrame<TkFrame
+ def initialize(parent)
+ super(parent,
+ "relief"=>"raised",
+ "borderwidth"=>"2")
+
+ # Fileメニューボタンの生成
+ @file = TkMenubutton.new(self){|button|
+
+ # Fileメニューの作成
+ @file_menu = TkMenu.new(button){
+ add "radio",
+ "label" => "RGB color space",
+ "variable" => $colorSpace,
+ "value" => :rgb,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:rgb)}
+ add "radio",
+ "label" => "CMY color space",
+ "variable" => $colorSpace,
+ "value" => :cmy,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:cmy)}
+ add "radio",
+ "label" => "HSB color space",
+ "variable" => $colorSpace,
+ "value" => :hsb,
+ "underline" => "0",
+ "command" => proc{changeColorSpace(:hsb)}
+ add "separator"
+ add "radio",
+ "label" => "Automatic updates",
+ "variable" => $autoUpdate,
+ "value" => "1",
+ "underline" => "0"
+ add "radio",
+ "label" => "Manual updates",
+ "variable" => $autoUpdate,
+ "value" => "0",
+ "underline" => "0"
+ add "separator"
+ add "command",
+ "label" => "Exit program",
+ "underline" => "0",
+ "command" => proc{exit}
+ }
+
+ # FileメニューとFileボタンを関連付ける
+ menu @file_menu
+
+ text "File"
+ underline "0"
+ }.pack("side"=>"left")
+
+ self
+ end
+end
+
+
+# 下部のフレームのためのクラス
+class TkColorBotFrame<TkFrame
+ def initialize(parent)
+ super(parent,
+ "relief"=> "raised",
+ "borderwidth"=> 2)
+
+ @commandLabel = TkLabel.new(self,
+ "text"=> "Command:")
+ @command = TkEntry.new(self,
+ "relief"=> "sunken",
+ "borderwidth"=> "2",
+ "textvariable"=> $command,
+ "font"=> "-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @update = TkButton.new(self,
+ "text"=> "Update",
+ "command"=> proc{doUpdate})
+ @commandLabel.pack("side"=>"left")
+ @update.pack("side"=>"right","pady"=>".1c","padx"=>".25c")
+ @command.pack("expand"=>"yes","fill"=>"x","ipadx"=>".25c")
+
+ self
+ end
+end
+
+
+# 中段左のフレーム
+class TkColorMiddleLeftFrame<TkFrame
+ def initialize(parent)
+ super(parent)
+
+ for i in ["/usr/local/lib/X11rgb.txt","/usr/lib/X11/rgb.txt",
+ "/X11/R5/lib/X11/rgb.txt","/X11/R4/lib/rgb/rgb.txt",
+ "/usr/openwin/lib/X11/rgb.txt"]
+ if !File.readable?(i)
+ next
+ end
+ f = File.open(i)
+ @scroll = TkScrollbar.new(self,
+ "orient"=>"vertical",
+ "relief"=>"sunken",
+ "borderwidth"=>"2")
+ @scroll.pack("side"=>"right","fill"=>"y")
+ @names = TkListbox.new(self,
+ "width"=>"20",
+ "height"=>"12",
+ "yscrollcommand"=> proc{|first,last| @scroll.set first,last},
+ "relief"=>"sunken",
+ "borderwidth"=>"2",
+ "exportselection"=>"false")
+ @scroll.command(proc{|*args| @names.yview(*args)})
+ @names.bind("Double-1",proc{
+ tc_loadNamedColor(@names.get(@names.curselection))})
+ @names.pack("side"=>"left")
+ while (line = f.gets)
+ line.chop!
+ linelist = line.split(/[ \t]+/)
+ if linelist.length == 4
+ @names.insert("end",linelist[3])
+ end
+ end
+ f.close
+ break
+ end
+
+ self
+ end
+end
+
+
+# 中段中央のフレーム
+class TkColorMiddleMiddleFrame<TkFrame
+ # @scale1,@scale2,@scale3を外部から参照のみ許可する。(変更不可)
+ attr_reader :scale1, :scale2, :scale3
+
+ def initialize(parent)
+ super(parent)
+
+ @f1 = TkFrame.new(self)
+ @f2 = TkFrame.new(self)
+ @f3 = TkFrame.new(self)
+ @f4 = TkFrame.new(self)
+
+ for f in [@f1,@f2,@f3]
+ f.pack("side"=>"top","expand"=>"yes")
+ end
+ @f4.pack("side"=>"top","expand"=>"yes","fill"=>"x")
+
+ @label1 = TkLabel.new(self,"textvariable"=>$label1)
+ @scale1 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale1.pack("side"=>"top","anchor"=>"w")
+ @label1.pack("side"=>"top","anchor"=>"w")
+
+ @label2 = TkLabel.new(self,"textvariable"=>$label2)
+ @scale2 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale2.pack("side"=>"top","anchor"=>"w")
+ @label2.pack("side"=>"top","anchor"=>"w")
+
+ @label3 = TkLabel.new(self,"textvariable"=>$label3)
+ @scale3 = TkScale.new(self,"from"=>"0","to"=>"1000","length"=>"6c",
+ "orient"=>"horizontal",
+ "command"=>proc{tc_scaleChanged})
+ @scale3.pack("side"=>"top","anchor"=>"w")
+ @label3.pack("side"=>"top","anchor"=>"w")
+
+ @nameLabel = TkLabel.new(self,"text"=>"Name:")
+ @name = TkEntry.new(self,"relief"=>"sunken","borderwidth"=>"2",
+ "textvariable"=>$name,"width"=>"10",
+ "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @nameLabel.pack("side"=>"left")
+ @name.pack("side"=>"right", "expand"=>"1", "fill"=>"x")
+ @name.bind("Return",proc{tc_loadNamedColor $name.to_s})
+
+ self
+ end
+end
+
+
+class TkColorMiddleRightFrame<TkFrame
+ attr_reader :swatch
+
+ def initialize(parent)
+ super(parent)
+ @swatch = TkFrame.new(self, "width"=>"2c", "height"=>"5c",
+ "background"=>$color)
+ @value = TkLabel.new(self,
+ "text"=>$color,
+ "width"=>"13",
+ "font"=>"-Adobe-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*")
+ @swatch.pack("side"=>"top","expand"=>"yes","fill"=>"both")
+ @value.pack("side"=>"bottom","pady"=>".25c")
+
+ self
+ end
+
+ def set_color(color)
+ @swatch["background"] = color
+ @value["text"] = color
+ end
+end
+
+
+
+# 中段のフレーム
+class TkColorMiddleFrame<TkFrame
+ attr_reader :left, :middle, :right
+
+ def initialize(parent)
+ super(parent,
+ "relief"=> "raised",
+ "borderwidth"=> "2")
+
+ @left = TkColorMiddleLeftFrame.new(self)
+ @left.pack("side"=>"left","padx"=>".25c","pady"=>".25c")
+
+ @middle = TkColorMiddleMiddleFrame.new(self)
+ @middle.pack("side"=>"left","expand"=>"yes","fill"=>"y")
+
+ @right = TkColorMiddleRightFrame.new(self)
+ @right.pack("side"=>"left","padx"=>".25c","pady"=>".25c","anchor"=>"s")
+
+ self
+ end
+end
+
+
+class TkColor<TkRoot
+ attr_reader :menu, :bottom, :middle
+
+ def initialize(*args)
+ super(*args)
+ @menu = TkColorMenuFrame.new(self)
+ @menu.pack("side"=>"top", "fill"=>"x")
+
+ @bottom = TkColorBotFrame.new(self)
+ @bottom.pack("side"=>"bottom","fill"=>"x")
+
+ @middle = TkColorMiddleFrame.new(self)
+ @middle.pack("side"=>"top","fill"=>"both")
+
+ self
+ end
+end
+
+
+$root = TkColor.new
+
+# イベントを待つ為にループに入る。
+changeColorSpace :rgb
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/text.rb b/ext/tk/sample/demos-jp/text.rb
new file mode 100644
index 0000000000..e698a79246
--- /dev/null
+++ b/ext/tk/sample/demos-jp/text.rb
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+#
+# text (basic facilities) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($text_demo) && $text_demo
+ $text_demo.destroy
+ $text_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$text_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Basic Facilities")
+ iconname("text")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($text_demo).pack(:fill=>:both, :expand=>true)
+
+# version check
+if ((Tk::TK_VERSION.split('.').collect{|n| n.to_i} <=> [8,4]) < 0)
+ undo_support = false
+else
+ undo_support = true
+end
+
+# frame 生成
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $text_demo
+ $text_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'text'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# text 生成
+TkText.new(base_frame){|t|
+ # 生成
+ relief 'sunken'
+ bd 2
+ setgrid 1
+ height 30
+ TkScrollbar.new(base_frame) {|s|
+ pack('side'=>'right', 'fill'=>'y')
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }
+ pack('expand'=>'yes', 'fill'=>'both')
+
+ # テキスト挿入
+ insert('0.0', <<EOT)
+このウィンドウはテキスト widget です。1行またはそれ以上のテキストを表
+示・編集することができます。以下はテキスト widget でできる操作について
+まとめたものです。
+
+1. スクロール。スクロールバーでテキストの表示部分を動かすことができます。
+
+2. スキャニング。テキストのウィンドウでマウスボタン2 (中ボタンを) を押
+して上下にドラッグしてください。そうするとテキストが高速でドラッグされ、
+内容をざっと眺めることができます。
+
+3. テキストの挿入。マウスボタン1 (左ボタン) を押し、挿入カーソルをセッ
+トしてからテキストを入力してください。入力したものが widget に入ります。
+
+4. 選択。ある範囲の文字を選択するにはマウスボタン1 を押し、ドラッグし
+てください。一度ボタンを離したら、シフトキーを押しながらボタン1 を押す
+ことで選択範囲の調整ができます。これは選択範囲の最後をマウスカーソルに
+最も近い位置にリセットし、ボタンを離す前にマウスをドラッグすることでさ
+らに選択範囲を調整できます。ダブルクリックでワードを、またトリプルクリッ
+クで行全体を選択することができます。
+
+5. 消去と置換。テキストを消去するには、消去したい文字を選択してバック
+スペースかデリートキーを入力してください。あるいは、新しいテキストを
+入力すると選択されたテキストと置換されます。
+
+6. 選択部分のコピー。選択部分をこのウィンドウの中のどこかにコピーする
+には、まずコピーしたい所を選択(ここで、あるいは別のアプリケーションで)
+し、ボタン 2 をクリックして、挿入カーソルの位置にコピーしてください。
+
+7. 編集。テキスト widget は Emacs のキーバインドに加えて標準的なの Motif
+の編集機能をサポートしています。バックスペースとコントロール-H は挿入
+カーソルの左側の文字を削除します。デリートキーとコントロール-D は挿入
+カーソルの右側の文字を削除します。Meta-バックスペースは挿入カーソルの
+右側の単語を削除し、Meta-D は挿入カーソルの左側の単語を削除します。
+コントロール-K は挿入カーソルから行末までを削除し、その位置に改行
+しかなかった場合は、改行を削除します。#{
+ if undo_support
+ undo_text = "Control-z は最後に行った変更の取り消し(undo)を行い、"
+ case $tk_platform['platform']
+ when "unix", "macintosh"
+ undo_text << "Control-Shift-z"
+ else # 'windows'
+ undo_text << "Control-y"
+ end
+ undo_text << "はundoした変更の再適用(redo)を行います。"
+ else
+ ""
+ end
+}
+
+
+8. ウィンドウのリサイズ。この widget は "setGrid" オプションをオンにし
+てありますので、ウィンドウをリサイズする時には高さと幅は常に文字高と文
+字幅の整数倍になります。また、ウィンドウを狭くした場合には長い行が自動
+的に折り返され、常に全ての内容が見えるようになっています。
+EOT
+
+ set_insert('0.0')
+}
+
diff --git a/ext/tk/sample/demos-jp/textpeer.rb b/ext/tk/sample/demos-jp/textpeer.rb
new file mode 100644
index 0000000000..4d896d2a12
--- /dev/null
+++ b/ext/tk/sample/demos-jp/textpeer.rb
@@ -0,0 +1,82 @@
+# -*- coding: utf-8 -*-
+#
+# text widget peering demo (called by 'widget')
+#
+# based on Tcl/Tk8.5.0 widget demos
+
+if defined?($textpeer_demo) && $textpeer_demo
+ $textpeer_demo.destroy
+ $textpeer_demo = nil
+end
+
+# demo toplevel widget
+$textpeer_demo = TkToplevel.new {|w|
+ title("Text Wdget Peering Demonstration")
+ iconname("textpeer")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($textpeer_demo).pack(:fill=>:both, :expand=>true)
+
+count = [0]
+
+## Define a widget that we peer from; it won't ever actually be shown though
+first = TkText.new(base_frame, :widgetname=>"text#{count[0] += 1}")
+first.insert :end,"このデモは一つの組を成したテキストウィジェットを示します。"
+first.insert :end,"それらのテキストウィジェットは対等(ピア;peer)の関係に"
+first.insert :end,"なっています。"
+first.insert :end,"それらは、基盤となるデータモデルは共通のものを持ちますが、"
+first.insert :end,"画面表示位置、編集位置、選択範囲(selection)については"
+first.insert :end,"独立に持つことができます。"
+first.insert :end,"各テキストウィジェットの脇にある"
+first.insert :end,"「ピア(peer)の作成」ボタンを使えば、"
+first.insert :end,"新たなピアを追加することが可能です。"
+first.insert :end,"また「ピア(peer)の消去」ボタンを使えば、"
+first.insert :end,"特定のピアウィジェットを消去することもできます。"
+
+Tk.update_idletasks ## for 'first' widget
+
+## Procedures to make and kill clones; most of this is just so that the demo
+## looks nice...
+def makeClone(count, win, txt)
+ cnt = (count[0] += 1)
+ peer = TkText::Peer.new(txt, win, :widgetname=>"text#{cnt}")
+ sbar = TkScrollbar.new(win, :widgetname=>"sb#{cnt}")
+ peer.yscrollbar sbar
+ b1 = TkButton.new(win, :widgetname=>"clone#{cnt}",
+ :text=>'ピア(peer)の作成',
+ :command=>proc{makeClone(count, win, peer)})
+ b2 = TkButton.new(win, :widgetname=>"kill#{cnt}",
+ :text=>'ピア(peer)の消去',
+ :command=>proc{killClone(win, cnt)})
+ row = cnt * 2
+ TkGrid.configure(peer, sbar, b1, :sticky=>'nsew', :row=>row)
+ TkGrid.configure('^', '^', b2, :sticky=>'nsew', :row=>(row+=1))
+ TkGrid.configure(b1, b2, :sticky=>'new')
+ TkGrid.rowconfigure(win, b2, :weight=>1)
+end
+
+def killClone(win, cnt)
+ Tk.destroy("#{win.path}.text#{cnt}", "#{win.path}.sb#{cnt}",
+ "#{win.path}.clone#{cnt}", "#{win.path}.kill#{cnt}")
+end
+
+## Now set up the GUI
+makeClone(count, base_frame, first)
+makeClone(count, base_frame, first)
+first.destroy
+
+## See Code / Dismiss buttons
+TkFrame.new(base_frame){|f|
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $textpeer_demo.destroy
+ $textpeer_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'textpeer'
+ }).pack(:side=>:left, :expand=>true)
+
+ TkGrid.configure(f, '-', '-', :sticky=>'ew', :row=>5000)
+}
+TkGrid.columnconfigure(base_frame, 0, :weight=>1)
diff --git a/ext/tk/sample/demos-jp/timer b/ext/tk/sample/demos-jp/timer
new file mode 100644
index 0000000000..6cb7c87e09
--- /dev/null
+++ b/ext/tk/sample/demos-jp/timer
@@ -0,0 +1,136 @@
+#!/usr/bin/env ruby
+#
+# timer --
+# This script generates a counter with start,stop and reset buttons.
+#
+# Copyright (C) 1998 Takaaki Tateishi (ttate@jaist.ac.jp)
+# last update: Sat Jun 27 12:24:14 JST 1998
+#
+
+require "tk"
+require "thread"
+require "tkafter"
+
+$time = "0.00"
+$m = Mutex.new
+$loop = false
+
+def timer_stop
+ $loop = false
+ $m.lock
+end
+
+def timer_start
+ $loop = true
+ $m.unlock
+end
+
+def timer_reset
+ $time = "0.00"
+ $root.countframe.counter['text'] = $time
+end
+
+def timer_loop
+ if $loop
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ end
+ Tk.after(10,proc{timer_loop})
+end
+
+
+#
+# thread version
+#
+def timer_loop2
+ while true
+ $m.lock
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ sleep(0.01)
+ $m.unlock
+ end
+end
+
+#
+# TkAfter
+#
+def timer_loop3
+ if $loop
+ $time = $time.succ
+ $root.countframe.counter['text'] = $time
+ end
+end
+
+
+class CountFrame < TkFrame
+ attr_reader :counter
+
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+ @counter = TkLabel.new(self,
+ 'text'=>$time,
+ 'relief'=>'raised')
+ @counter.pack('fill'=>'both')
+ self
+ end
+end
+
+
+class ButtonFrame < TkFrame
+ def initialize(parent=nil,keys=nil)
+ super(parent,keys)
+=begin
+ @stop = TkButton.new(self,
+ 'text'=>'Stop',
+ 'command'=>proc{timer_stop})
+ @start = TkButton.new(self,
+ 'text'=>'Start',
+ 'command'=>proc{timer_start})
+=end
+ @stop = TkButton.new(self, :text=>'Stop', :state=>:disabled)
+ @start = TkButton.new(self, :text=>'Start', :state=>:normal)
+
+ @stop.command proc{
+ timer_stop
+ @start.state(:normal)
+ @stop.state(:disabled)
+ }
+ @start.command proc{
+ timer_start
+ @stop.state(:normal)
+ @start.state(:disabled)
+ }
+
+ @reset = TkButton.new(self,
+ 'text'=>'Reset',
+ 'command'=>proc{timer_reset})
+ for b in [@stop,@start,@reset]
+ b.pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+ end
+ end
+end
+
+
+class Timer < TkRoot
+ attr_reader :countframe
+
+ def initialize(*args)
+ super(*args)
+ @countframe = CountFrame.new(self)
+ @buttonframe = ButtonFrame.new(self)
+ for f in [@buttonframe,@countframe]
+ f.pack('side'=>'top', 'fill'=>'both')
+ end
+ self
+ end
+end
+
+
+$root = Timer.new
+
+#$thread = Thread.start{timer_loop2}
+#timer_loop
+TkAfter.new(10,-1,proc{timer_loop3}).start
+
+Tk.mainloop
diff --git a/ext/tk/sample/demos-jp/toolbar.rb b/ext/tk/sample/demos-jp/toolbar.rb
new file mode 100644
index 0000000000..3ee7a5f9d8
--- /dev/null
+++ b/ext/tk/sample/demos-jp/toolbar.rb
@@ -0,0 +1,136 @@
+# -*- coding: utf-8 -*-
+#
+# toolbar.rb --
+#
+# This demonstration script creates a toolbar that can be torn off.
+#
+# based on "Id: toolbar.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($toolbar_demo) && $toolbar_demo
+ $toolbar_demo.destroy
+ $toolbar_demo = nil
+end
+
+$toolbar_demo = TkToplevel.new {|w|
+ title("Ttk Menu Buttons")
+ iconname("toolbar")
+ positionWindow(w)
+}
+
+base_frame = Ttk::Frame.new($toolbar_demo).pack(:fill=>:both, :expand=>true)
+
+if Tk.windowingsystem != 'aqua'
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+このデモでは,ツールバーをどのようにして適切にテーマ対応させるか,\
+また,どのようにして切り離し可能にするかを示しています\
+(ただし,ツールバーの切り離しにはTcl/Tk8.5以上の機能が必要です).\
+ツールバーのボタンは,'Toolbutton'スタイルを使用するように明示することで,\
+"toolbar style"ボタンとなるように属性設定されています.\
+ツールバーの左端には簡単なマーカーが置かれています.\
+マーカー上にマウスカーソルが来ると移動アイコンにカーソルが変化します.\
+そこでツールバーを動かすようにドラッグすると,\
+ツールバー全体を切り離して独立したトップレベルウィジェットに\
+することができます.\
+切り離したツールバーが不要となった時には,\
+一般的なトップレベルウィジェットと同様に単純に閉じることで,
+再び元のウィンドウに張り付けられるでしょう.
+EOL
+else
+ msg = Ttk::Label.new(base_frame, :wraplength=>'4i', :text=><<EOL)
+このデモでは,ツールバーをどのようにして適切にテーマ対応させるかを\
+示しています.\
+ツールバーのボタンは,'Toolbutton'スタイルを使用するように明示することで,\
+"toolbar style"ボタンとなるように属性設定されています.
+EOL
+end
+
+## Set up the toolbar hull
+tbar_base = Tk::Frame.new(base_frame, # Tk 標準の frame でなければなりません.
+ :widgetname=>'toolbar') # ウィンドウタイトル文字列とするために,ウィジェット名を明示しています.
+sep = Ttk::Separator.new(base_frame)
+to_base = Ttk::Frame.new(tbar_base, :cursor=>'fleur')
+if Tk.windowingsystem != 'aqua'
+ to = Ttk::Separator.new(to_base, :orient=>:vertical)
+ to2 = Ttk::Separator.new(to_base, :orient=>:vertical)
+ to.pack(:fill=>:y, :expand=>true, :padx=>2, :side=>:left)
+ to2.pack(:fill=>:y, :expand=>true, :side=>:left)
+end
+
+contents = Ttk::Frame.new(tbar_base)
+Tk.grid(to_base, contents, :sticky=>'nsew')
+tbar_base.grid_columnconfigure(contents, :weight=>1)
+contents.grid_columnconfigure(1000, :weight=>1)
+
+if Tk.windowingsystem != 'aqua'
+ ## Bindings so that the toolbar can be torn off and reattached
+ to_base.bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ to. bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ to2. bind('B1-Motion', '%X %Y'){|x, y| tbar_base.tearoff(to_base, x, y)}
+ def tbar_base.tearoff(w, x, y)
+ on_win = TkWinfo.containing(x, y)
+ return unless (on_win && on_win.path =~ /^#{@path}(\.|$)/)
+ self.grid_remove
+ w.grid_remove
+ self.wm_manage
+ # self.wm_title('Toolbar') # もしウィジェット名をウィンドウタイトルにしたくないなら,ここで設定してください
+ self.wm_protocol('WM_DELETE_WINDOW'){ self.untearoff(w) }
+ end
+ def tbar_base.untearoff(w)
+ self.wm_forget
+ w.grid
+ self.grid
+ end
+end
+
+## Some content for the rest of the toplevel
+text = TkText.new(base_frame, :width=>40, :height=>10)
+
+## Toolbar contents
+tb_btn = Ttk::Button.new(tbar_base, :text=>'ボタン', :style=>'Toolbutton',
+ :command=>proc{
+ text.insert(:end, "ボタンが押されました.\n")
+ })
+tb_chk = Ttk::Checkbutton.new(tbar_base, :text=>'チェックボタン',
+ :style=>'Toolbutton',
+ :variable=>(check = TkVariable.new),
+ :command=>proc{
+ text.insert(:end, "チェックボタンの値は#{check.value}です.\n")
+ })
+tb_mbtn = Ttk::Menubutton.new(tbar_base, :text=>'メニュー')
+tb_combo = Ttk::Combobox.new(tbar_base, :value=>TkFont.families,
+ :state=>:readonly)
+tb_mbtn.menu(menu = Tk::Menu.new(tb_mbtn))
+menu.add(:command, :label=>'Just', :command=>proc{text.insert(:end, "Just\n")})
+menu.add(:command, :label=>'An', :command=>proc{text.insert(:end, "An\n")})
+menu.add(:command, :label=>'Example',
+ :command=>proc{text.insert(:end, "Example\n")})
+tb_combo.bind('<ComboboxSelected>'){ text.font.family = tb_combo.get }
+
+## Arrange contents
+Tk.grid(tb_btn, tb_chk, tb_mbtn, tb_combo,
+ :in=>contents, :padx=>2, :sticky=>'ns')
+Tk.grid(tbar_base, :sticky=>'ew')
+Tk.grid(sep, :sticky=>'ew')
+Tk.grid(msg, :sticky=>'ew')
+Tk.grid(text, :sticky=>'nsew')
+base_frame.grid_rowconfigure(text, :weight=>1)
+base_frame.grid_columnconfigure(text, :weight=>1)
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'toolbar'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $toolbar_demo.destroy
+ $toolbar_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ Tk.grid(frame, :sticky=>'ew')
+}
diff --git a/ext/tk/sample/demos-jp/tree.rb b/ext/tk/sample/demos-jp/tree.rb
new file mode 100644
index 0000000000..3f3b18b677
--- /dev/null
+++ b/ext/tk/sample/demos-jp/tree.rb
@@ -0,0 +1,120 @@
+# -*- coding: utf-8 -*-
+#
+# tree.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# tree widget.
+#
+# based on "Id: tree.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($tree_demo) && $tree_demo
+ $tree_demo.destroy
+ $tree_demo = nil
+end
+
+$tree_demo = TkToplevel.new {|w|
+ title("Directory Browser")
+ iconname("tree")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($tree_demo).pack(:fill=>:both, :expand=>true)
+
+## Explanatory text
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i',
+ :justify=>:left, :anchor=>'n', :padding=>[10, 2, 10, 6],
+ :text=><<EOL).pack(:fill=>:x)
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+このサンプルは,ファイルシステムのような階層的なデータ集合を\
+参照できるようにしたTtk::Treeviewウィジェットを含んでいます.\
+Ttk::Treeviewウィジェットは,木構造自体の表示を可能にするだけでなく,\
+追加情報(このサンプルの場合はファイルサイズ)を表示するために\
+任意の個数の追加カラムも扱うこともできます.\
+また,カラムのタイトル間の区切り部分をドラッグすることで,\
+カラムの幅を変更することも可能です.
+EOL
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'tree'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $tree_demo.destroy
+ $tree_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+## Code to populate the roots of the tree (can be more than one on Windows)
+def populate_roots(tree)
+ TkComm.simplelist(Tk.tk_call('file', 'volumes')).sort.each{|dir|
+ populate_tree(tree, tree.insert(nil, :end, :text=>dir,
+ :values=>[dir, 'directory']))
+ }
+end
+
+## Code to populate a node of the tree
+def populate_tree(tree, node)
+ return if tree.get(node, :type) != 'directory'
+
+ path = tree.get(node, :fullpath)
+ tree.delete(tree.children(node))
+ Dir.glob("#{path}/*").sort.each{|f|
+ type = File.ftype(f) rescue nil
+ id = tree.insert(node, :end,
+ :text=>File.basename(f), :values=>[f, type]).id
+ if type == 'directory'
+ ## Make it so that this node is openable
+ tree.insert(id, 0, :text=>'dummy')
+ tree.itemconfigure(id, :text=>File.basename(f))
+ elsif type == 'file'
+ size = File.size(f)
+ if size >= 1024*1024*1024
+ size = '%.1f GB' % (size.to_f/1024/1024/1024)
+ elsif size >= 1024*1024
+ size = '%.1f MB' % (size.to_f/1024/1024)
+ elsif size >= 1024
+ size = '%.1f KB' % (size.to_f/1024)
+ else
+ size = '%.1f bytes' % (size.to_f/1024)
+ end
+ tree.set(id, :size, size)
+ end
+ }
+
+ # Stop this code from rerunning on the current node
+ tree.set(node, :type, 'processed_directory')
+end
+
+## Create the tree and set it up
+tree = Ttk::Treeview.new(base_frame, :columns=>%w(fullpath type size),
+ :displaycolumns=>['size'])
+if Tk.windowingsystem != 'aqua'
+ vsb = tree.yscrollbar(Ttk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Ttk::Scrollbar.new(base_frame))
+else
+ vsb = tree.yscrollbar(Tk::Scrollbar.new(base_frame))
+ hsb = tree.xscrollbar(Tk::Scrollbar.new(base_frame))
+end
+
+tree.heading_configure('#0', :text=>'Directory Structure')
+tree.heading_configure('size', :text=>'File Size')
+tree.column_configure('size', :stretch=>0, :width=>70)
+populate_roots(tree)
+tree.bind('<TreeviewOpen>', '%W'){|w| populate_tree(w, w.focus_item)}
+
+## Arrange the tree and its scrollbars in the toplevel
+container = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+container.lower
+Tk.grid(tree, vsb, :in=>container, :sticky=>'nsew')
+Tk.grid(hsb, :in=>container, :sticky=>'nsew')
+container.grid_columnconfigure(0, :weight=>1)
+container.grid_rowconfigure(0, :weight=>1)
diff --git a/ext/tk/sample/demos-jp/ttkbut.rb b/ext/tk/sample/demos-jp/ttkbut.rb
new file mode 100644
index 0000000000..ccde541019
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ttkbut.rb
@@ -0,0 +1,145 @@
+# -*- coding: utf-8 -*-
+#
+# ttkbut.rb
+#
+# This demonstration script creates a toplevel window containing several
+# simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and
+# radiobuttons.
+#
+# based on "Id: ttkbut.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkbut_demo) && $ttkbut_demo
+ $ttkbut_demo.destroy
+ $ttkbut_demo = nil
+end
+
+$ttkbut_demo = TkToplevel.new {|w|
+ title("Simple Ttk Widgets")
+ iconname("ttkbut")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkbut_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+今,あなたが目にしているのはTtkのテーマ化ラベルで,\
+下にはTtkのラベルフレームの中に三つのグループのTtkウィジェットが\
+表示されています.
+最初のグループは全てボタンであり,\
+それぞれクリックすれば現在のアプリケーションのテーマが設定されます.
+2番目のグループは三つのチェックボタン集合です.\
+各集合の間には,セパレータウィジェットが置かれています.\
+なお「有効化」ボタンは,このトップレベルウィジェット内の\
+他のすべてのテーマ化ウィジェットの状態(state)が"disabled"かどうかを\
+コントロールすることに注意してください.
+3番目のグループは関連付けられたラジオボタン集合となっています.
+EOL
+
+## Add buttons for setting the theme
+buttons = Ttk::Labelframe.new(base_frame, :text=>'ボタン')
+# Ttk::Style.theme_names.each{|theme|
+# Ttk::Button.new(buttons, :text=>theme,
+# :command=>proc{Ttk::Style.theme_use theme}).pack(:pady=>2)
+# }
+Ttk.themes.each{|theme|
+ Ttk::Button.new(buttons, :text=>theme,
+ :command=>proc{Ttk.set_theme theme}).pack(:pady=>2)
+}
+
+## Helper procedure for the top checkbutton
+def setState(root, value, *excepts)
+ return if excepts.member?(root)
+
+ ## Non-Ttk widgets (e.g. the toplevel) will fail, so make it silent
+ begin
+ root.state = value
+ rescue
+ end
+
+ ## Recursively invoke on all children of this root that are in the same
+ ## toplevel widget
+ root.winfo_children.each{|w|
+ setState(w, value, *excepts) if w.winfo_toplevel == root.winfo_toplevel
+ }
+end
+
+## Set up the checkbutton group
+checks = Ttk::Labelframe.new(base_frame, :text=>'チェックボタン')
+enabled = TkVariable.new(true)
+e = Ttk::Checkbutton.new(checks, :text=>'有効化', :variable=>enabled,
+ :command=>proc{
+ setState($ttkbut_demo,
+ ((enabled.bool)? "!disabled" : "disabled"),
+ e)
+ })
+
+## See ttk_widget(n) for other possible state flags
+sep1 = Ttk::Separator.new(checks)
+sep2 = Ttk::Separator.new(checks)
+
+cheese = TkVariable.new
+tomato = TkVariable.new
+basil = TkVariable.new
+oregano = TkVariable.new
+
+c1 = Ttk::Checkbutton.new(checks, :text=>'チーズ', :variable=>cheese)
+c2 = Ttk::Checkbutton.new(checks, :text=>'トマト', :variable=>tomato)
+c3 = Ttk::Checkbutton.new(checks, :text=>'バジル', :variable=>basil)
+c4 = Ttk::Checkbutton.new(checks, :text=>'オレガノ', :variable=>oregano)
+
+Tk.pack(e, sep1, c1, c2, sep2, c3, c4, :fill=>:x, :pady=>2)
+
+## Set up the radiobutton group
+radios = Ttk::Labelframe.new(base_frame, :text=>'ラジオボタン')
+
+happyness = TkVariable.new
+
+r1 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Great', :value=>'great')
+r2 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Good', :value=>'good')
+r3 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Ok', :value=>'ok')
+r4 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Poor', :value=>'poor')
+r5 = Ttk::Radiobutton.new(radios, :variable=>happyness,
+ :text=>'Awful', :value=>'awful')
+
+Tk.pack(r1, r2, r3, r4, r5, :fill=>:x, :padx=>3, :pady=>2)
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'変数参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{
+ showVars(base_frame, ['有効化', enabled],
+ ['チーズ', cheese], ['トマト', tomato],
+ ['バジル', basil], ['オレガノ', oregano],
+ ['幸福度', happyness])
+ }),
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkbut'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $ttkbut_demo
+ $ttkbut_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x, :expand=>true)
+}
+
+## Arrange things neatly
+f = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+f.lower
+Tk.grid(buttons, checks, radios, :in=>f, :sticky=>'nwe', :pady=>2, :padx=>3)
+f.grid_columnconfigure([0, 1, 2], :weight=>1, :uniform=>:yes)
diff --git a/ext/tk/sample/demos-jp/ttkmenu.rb b/ext/tk/sample/demos-jp/ttkmenu.rb
new file mode 100644
index 0000000000..aa9db5019f
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ttkmenu.rb
@@ -0,0 +1,91 @@
+# -*- coding: utf-8 -*-
+#
+# ttkmenu.rb --
+#
+# This demonstration script creates a toplevel window containing several Ttk
+# menubutton widgets.
+#
+# based on "Id: ttkmenu.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkmenu_demo) && $ttkmenu_demo
+ $ttkmenu_demo.destroy
+ $ttkmenu_demo = nil
+end
+
+$ttkmenu_demo = TkToplevel.new {|w|
+ title("Ttk Menu Buttons")
+ iconname("ttkmenu")
+ positionWindow(w)
+}
+
+base_frame = Ttk::Frame.new($ttkmenu_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+これによりテーマに対応することができるようになったウィジェットのひとつに\
+メニューボタンがあります.\
+以下では,テーマに対応したメニューボタンがいくつか表示されています.\
+それらを使って,現在使用中のテーマを変更することが可能です.\
+テーマの選択がメニューボタン自身の見掛けを変化させる様子や,\
+中央のメニューボタンだけが異なるスタイル\
+(ツールバーでの一般的な表示に適したもの)で表示されている様子に\
+注目してください.\
+なお,メニューボタンについてはテーマに対応したウィジェットがありますが,\
+メニューについてはテーマに対応したウィジェットは含まれていません.\
+その理由は,標準のTkのメニューウィジェットが\
+すべてのプラットホームで十分に良好な見掛けと操作性を持っている,\
+特に,多くの環境でその環境本来の操作体系となるように実装されていると\
+判断されたことによります.
+EOL
+
+Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
+
+## See Code / Dismiss
+Ttk::Frame.new($ttkmenu_demo) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkmenu'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkmenu_demo.destroy
+ $ttkmenu_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+b1 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:above)
+b2 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:left)
+b3 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:right)
+b4 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:flush,
+ :style=>Ttk::Menubutton.style('Toolbutton'))
+b5 = Ttk::Menubutton.new(base_frame,:text=>'テーマを選択',:direction=>:below)
+
+b1.menu(m1 = Tk::Menu.new(b1, :tearoff=>false))
+b2.menu(m2 = Tk::Menu.new(b2, :tearoff=>false))
+b3.menu(m3 = Tk::Menu.new(b3, :tearoff=>false))
+b4.menu(m4 = Tk::Menu.new(b4, :tearoff=>false))
+b5.menu(m5 = Tk::Menu.new(b5, :tearoff=>false))
+
+Ttk.themes.each{|theme|
+ m1.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m2.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m3.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m4.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+ m5.add(:command, :label=>theme, :command=>proc{Ttk.set_theme theme})
+}
+
+f = Ttk::Frame.new(base_frame).pack(:fill=>:x)
+f1 = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+f.lower
+
+f.grid_anchor(:center)
+TkGrid('x', b1, 'x', :in=>f, :padx=>3, :pady=>2)
+TkGrid(b2, b4, b3, :in=>f, :padx=>3, :pady=>2)
+TkGrid('x', b5, 'x', :in=>f, :padx=>3, :pady=>2)
diff --git a/ext/tk/sample/demos-jp/ttknote.rb b/ext/tk/sample/demos-jp/ttknote.rb
new file mode 100644
index 0000000000..f3b2fa5881
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ttknote.rb
@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+#
+# ttknote.rb --
+#
+# This demonstration script creates a toplevel window containing a Ttk
+# notebook widget.
+#
+# based on "Id: ttknote.tcl,v 1.5 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttknote_demo) && $ttknote_demo
+ $ttknote_demo.destroy
+ $ttknote_demo = nil
+end
+
+$ttknote_demo = TkToplevel.new {|w|
+ title("Ttk Notebook Widget")
+ iconname("ttknote")
+ positionWindow(w)
+}
+
+## See Code / Dismiss
+Ttk::Frame.new($ttknote_demo) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttknote'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttknote_demo.destroy
+ $ttknote_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+base_frame = Ttk::Frame.new($ttknote_demo).pack(:fill=>:both, :expand=>true)
+
+## Make the notebook and set up Ctrl+Tab traversal
+notebook = Ttk::Notebook.new(base_frame).pack(:fill=>:both, :expand=>true,
+ :padx=>2, :pady=>3)
+notebook.enable_traversal
+
+## Popuplate the first pane
+f_msg = Ttk::Frame.new(notebook)
+msg_m = Ttk::Label.new(f_msg, :font=>$font, :wraplength=>'5i',
+ :justify=>:left, :anchor=>'n', :text=><<EOL)
+Ttkとは,テーマ指定可能な新しいウィジェット集合です.\
+その中に含まれるウィジェットのひとつにノートブックウィジェットがあります.\
+ノートブックウィジェットは,\
+個別の内容を持ったパネルからの選択を可能にするような\
+タブの集合(タブセット)を定めます.\
+タブセットは最近の多くのユーザインターフェースで見られる機能です.\
+タブの選択は,マウスによるだけでなく,\
+ノートブックウィジェットのページの見出しが選択されている時であれば\
+Ctrl+Tabキーの入力によっても行うことができます.\
+このデモでは,見出しで下線付きの文字のキーとAltキーとを組み合わせることで\
+ページを選択することができるようにも設定しています.\
+ただし,2番目のタブは無効化されて選択できないようになっていることには\
+注意してください.
+EOL
+neat = TkVariable.new
+after_id = nil
+msg_b = Ttk::Button.new(f_msg, :text=>'すてきだ!(Neat!)', :underline=>6,
+ :command=>proc{
+ neat.value = 'あぁ,そのとおりさ...'
+ Tk.after_cancel(after_id) if after_id
+ after_id = Tk.after(500){neat.value = ''}
+ })
+msg_b.winfo_toplevel.bind('Alt-n'){ msg_b.focus; msg_b.invoke }
+msg_l = Ttk::Label.new(f_msg, :textvariable=>neat)
+notebook.add(f_msg, :text=>'説明(Description)', :underline=>3, :padding=>2)
+Tk.grid(msg_m, '-', :sticky=>'new', :pady=>2)
+Tk.grid(msg_b, msg_l, :pady=>[2, 4], :padx=>20)
+msg_b.grid_configure(:sticky=>'e')
+msg_l.grid_configure(:sticky=>'w')
+f_msg.grid_rowconfigure(1, :weight=>1)
+f_msg.grid_columnconfigure([0, 1], :weight=>1, :uniform=>1)
+
+## Populate the second pane. Note that the content doesn't really matter
+f_disabled = Ttk::Frame.new(notebook)
+notebook.add(f_disabled, :text=>'無効化されたタブ', :state=>:disabled)
+
+## Popuplate the third pane
+f_editor = Ttk::Frame.new(notebook)
+notebook.add(f_editor, :text=>'テキストエディタ(Text Editor)', :underline=>9)
+editor_t = Tk::Text.new(f_editor, :width=>40, :height=>10, :wrap=>:char)
+if Tk.windowingsystem != 'aqua'
+ editor_s = editor_t.yscrollbar(Ttk::Scrollbar.new(f_editor))
+else
+ editor_s = editor_t.yscrollbar(Tk::Scrollbar.new(f_editor))
+end
+editor_s.pack(:side=>:right, :fill=>:y, :padx=>[0,2], :pady=>2)
+editor_t.pack(:fill=>:both, :expand=>true, :padx=>[2,0], :pady=>2)
diff --git a/ext/tk/sample/demos-jp/ttkpane.rb b/ext/tk/sample/demos-jp/ttkpane.rb
new file mode 100644
index 0000000000..a5c1a08ec9
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ttkpane.rb
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+#
+# ttkpane.rb --
+#
+# This demonstration script creates a Ttk pane with some content.
+#
+# based on "Id: ttkpane.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkpane_demo) && $ttkpane_demo
+ $ttkpane_demo.destroy
+ $ttkpane_demo = nil
+end
+
+$ttkpane_demo = TkToplevel.new {|w|
+ title("Themed Nested Panes")
+ iconname("ttkpane")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkpane_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+このデモは,埋め込み関係にあるテーマ付きペインドウィンドウを示しています.\
+それぞれの大きさは,含まれているペインの間にあるエリアをつかんで\
+境界をドラッグすることで変更できます.
+EOL
+
+Ttk::Separator.new(base_frame).pack(:side=>:top, :fill=>:x)
+
+## See Code / Dismiss
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkpane'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkpane_demo.destroy
+ $ttkpane_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+outer = Ttk::Panedwindow.new(frame, :orient=>:horizontal)
+outer.add(in_left = Ttk::Panedwindow.new(outer, :orient=>:vertical))
+outer.add(in_right = Ttk::Panedwindow.new(outer, :orient=>:vertical))
+in_left.add(left_top = Ttk::Labelframe.new(in_left, :text=>'ボタン'))
+in_left.add(left_bot = Ttk::Labelframe.new(in_left, :text=>'時計'))
+in_right.add(right_top = Ttk::Labelframe.new(in_right, :text=>'プログレス'))
+in_right.add(right_bot = Ttk::Labelframe.new(in_right, :text=>'テキスト'))
+if Tk.windowingsystem == 'aqua'
+ [left_top, left_bot, right_top, right_bot].each{|w| w.padding(3) }
+end
+
+# Fill the button pane
+Ttk::Button.new(left_top, :text=>'押してね',
+ :command=>proc{
+ Tk.messageBox(:type=>'ok', :icon=>'info',
+ :message=>'いてて!',
+ :detail=>'That hurt...', :parent=>base_frame,
+ :title=>'Button Pressed')
+ }).pack(:padx=>2, :pady=>5)
+
+
+zones_list = [
+ [':Europe/Berlin'],
+ [':America/Argentina/Buenos_Aires', ':America/Buenos_Aires'],
+ [':Africa/Johannesburg'],
+ [':Europe/London'],
+ [':America/Los_Angeles'],
+ [':Europe/Moscow'],
+ [':America/New_York'],
+ [':Asia/Singapore'],
+ [':Australia/Sydney'],
+ [':Asia/Tokyo'],
+]
+
+zones = []
+
+# Check tzinfo support
+if $tk_major_ver > 8 || ($tk_major_ver == 8 && $tk_minor_ver >= 5)
+ tzinfo = :tcl
+
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ # Force a pre-load of all the timezones needed; otherwise can end up
+ # poor-looking synch problems!
+ Tk.tk_call('clock', 'format', '0', '-timezone', zone)
+ rescue RuntimeError
+ # ignore
+ else
+ zones << [zone, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+else
+ begin
+ require 'tzinfo'
+ tzinfo = :tzinfo
+ rescue Exception
+ begin
+ require 'tzfile'
+ tzinfo = :tzfile
+ rescue Exception
+ tzinfo = nil
+ end
+ end
+
+ case tzinfo
+ when :tzinfo
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ tz = TZInfo::Timezone.get(zone[%r<[^:]+$>])
+ rescue Exception
+ # ignore
+ else
+ zones << [tz, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+ when :tzfile
+ zones_list.each{|list|
+ list.each{|zone|
+ begin
+ tz = TZFile.create(zone[%r<[^:]+$>])
+ rescue Exception
+ # ignore
+ else
+ zones << [tz, zone[%r<[^/:]+$>].tr('_', ' ')]
+ break
+ end
+ }
+ }
+
+ else
+ [ -7, -4, -2, -1, 0, +1, +3, +8, +9, +10 ].each{|zone|
+ zones << [zone, 'UTC%+03d00' % zone]
+ }
+ end
+end
+
+time = TkVariable.new_hash
+
+case tzinfo
+when :tcl
+ update_proc = proc{|now, tz, label|
+ time[label] = Tk.tk_call('clock', 'format', now.tv_sec,
+ '-timezone', tz, '-format', '%T')
+ }
+when :tzinfo
+ update_proc = proc{|now, tz, label|
+ time[label] = tz.utc_to_local(now).strftime('%H:%M:%S')
+ }
+when :tzfile
+ update_proc = proc{|now, tz, label|
+ time[label] = tz.at(now.tv_sec).strftime('%H:%M:%S')
+ }
+else
+ update_proc = proc{|now, tz, label|
+ time[label] = (now + (tz * 3600)).strftime('%H:%M:%S')
+ }
+end
+
+# Fill the clocks pane
+zones.each_with_index{|(zone, label), idx|
+ Ttk::Separator.new(left_bot).pack(:fill=>:x) if idx > 0
+ Ttk::Label.new(left_bot, :text=>label, :anchor=>'w').pack(:fill=>:x)
+ Ttk::Label.new(left_bot, :textvariable=>time.ref(label),
+ :anchor=>'w').pack(:fill=>:x)
+}
+
+# Timer start
+every = proc{
+ now = Time.now.utc
+ zones.each{|zone, label| update_proc.call(now, zone, label) }
+}
+TkRTTimer.new(1000, -1, every).start(0, every)
+
+# Fill the progress pane
+Ttk::Progressbar.new(right_top, :mode=>:indeterminate).pack(:fill=>:both, :expand=>true).start
+
+# Fill the text pane
+if Tk.windowingsystem != 'aqua'
+ # The trick with the ttk::frame makes the text widget look like it fits with
+ # the current Ttk theme despite not being a themed widget itself. It is done
+ # by styling the frame like an entry, turning off the border in the text
+ # widget, and putting the text widget in the frame with enough space to allow
+ # the surrounding border to show through (2 pixels seems to be enough).
+ f = Ttk::Frame.new(right_bot, :style=>Ttk::Entry)
+ txt = TkText.new(frame, :wrap=>:word, :width=>30, :borderwidth=>0)
+ txt.pack(:fill=>:both, :expand=>true, :in=>f, :pady=>2, :padx=>2)
+ scr = txt.yscrollbar(Ttk::Scrollbar.new(frame))
+ scr.pack(:side=>:right, :fill=>:y, :in=>right_bot)
+ f.pack(:fill=>:both, :expand=>true)
+ outer.pack(:fill=>:both, :expand=>true)
+else
+ txt = TkText.new(frame, :wrap=>:word, :width=>30, :borderwidth=>0)
+ scr = txt.yscrollbar(TkScrollbar.new(frame))
+ scr.pack(:side=>:right, :fill=>:y, :in=>right_bot)
+ txt.pack(:fill=>:both, :expand=>true, :in=>right_bot)
+ outer.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>[6, 10])
+end
diff --git a/ext/tk/sample/demos-jp/ttkprogress.rb b/ext/tk/sample/demos-jp/ttkprogress.rb
new file mode 100644
index 0000000000..ec28253a9f
--- /dev/null
+++ b/ext/tk/sample/demos-jp/ttkprogress.rb
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+#
+# ttkprogress.rb --
+#
+# This demonstration script creates several progress bar widgets.
+#
+# based on "Id: ttkprogress.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp"
+
+if defined?($ttkprogress_demo) && $ttkprogress_demo
+ $ttkprogress_demo.destroy
+ $ttkprogress_demo = nil
+end
+
+$ttkprogress_demo = TkToplevel.new {|w|
+ title("Progress Bar Demonstration")
+ iconname("ttkprogress")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($ttkprogress_demo).pack(:fill=>:both, :expand=>true)
+
+Ttk::Label.new(base_frame, :font=>$font, :wraplength=>'4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top, :fill=>:x)
+下にあるのは二つのプログレスバーです.\
+上のものは"determinate"タイプのプログレスバーで,\
+例えばプログラムが与えられたタスクを終了するまでにどのくらいかかるかを\
+示すときなどに用いられます.\
+下のものは"indeterminate"タイプのプログレスバーで,\
+例えばプログラムが実行中(busy)であるものの\
+終了までにどれくらいかかるかは分からないという状態を\
+示すときなどに用いられます.\
+いずれのプログレスバーも,すぐ下にあるボタンを使うことで\
+自動アニメーションモードのON/OFFを切替えることができます.
+EOL
+
+## See Code / Dismiss buttons
+Ttk::Frame.new(base_frame) {|frame|
+ sep = Ttk::Separator.new(frame)
+ Tk.grid(sep, :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ Ttk::Button.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'ttkprogress'}),
+ Ttk::Button.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ $ttkprogress_demo.destroy
+ $ttkprogress_demo = nil
+ }),
+ :padx=>4, :pady=>4)
+ grid_columnconfigure(0, :weight=>1)
+ pack(:side=>:bottom, :fill=>:x)
+}
+
+frame = Ttk::Frame.new(base_frame).pack(:fill=>:both, :expand=>true)
+
+p1 = Ttk::Progressbar.new(frame, :mode=>:determinate)
+p2 = Ttk::Progressbar.new(frame, :mode=>:indeterminate)
+
+start = Ttk::Button.new(frame, :text=>'Start Progress',
+ :command=>proc{ p1.start; p2.start })
+stop = Ttk::Button.new(frame, :text=>'Stop Progress',
+ :command=>proc{ p1.stop; p2.stop })
+
+Tk.grid(p1, '-', :pady=>5, :padx=>10)
+Tk.grid(p2, '-', :pady=>5, :padx=>10)
+Tk.grid(start, stop, :padx=>10, :pady=>5)
+start.grid_configure(:sticky=>'e')
+stop.grid_configure(:sticky=>'w')
+frame.grid_columnconfigure(:all, :weight=>1)
+
diff --git a/ext/tk/sample/demos-jp/twind.rb b/ext/tk/sample/demos-jp/twind.rb
new file mode 100644
index 0000000000..f13a137cc3
--- /dev/null
+++ b/ext/tk/sample/demos-jp/twind.rb
@@ -0,0 +1,292 @@
+# -*- coding: utf-8 -*-
+#
+# text (embedded windows) widget demo (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($twind_demo) && $twind_demo
+ $twind_demo.destroy
+ $twind_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$twind_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Embedded Windows")
+ iconname("Embedded Windows")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($twind_demo).pack(:fill=>:both, :expand=>true)
+
+# frame 生成
+$twind_buttons = TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc{
+ tmppath = $twind_demo
+ $twind_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc{showCode 'twind'}
+ }.pack('side'=>'left', 'expand'=>'yes')
+}
+$twind_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+$twind_text = nil
+TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+ 'relief'=>'sunken') {|f|
+ $twind_text = TkText.new(f, 'setgrid'=>'true', 'font'=>$font,
+ 'width'=>'70', 'height'=>35, 'wrap'=>'word',
+ 'highlightthickness'=>0, 'borderwidth'=>0 ){|t|
+ TkScrollbar.new(f) {|s|
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }.pack('side'=>'right', 'fill'=>'y')
+ }.pack('expand'=>'yes', 'fill'=>'both')
+}.pack('expand'=>'yes', 'fill'=>'both')
+
+# タグ生成
+$tag_center = TkTextTag.new($twind_text,
+ 'justify' =>'center',
+ 'spacing1'=>'5m',
+ 'spacing3'=>'5m' )
+$tag_buttons = TkTextTag.new($twind_text,
+ 'lmargin1'=>'1c',
+ 'lmargin2'=>'1c',
+ 'rmargin' =>'1c',
+ 'spacing1'=>'3m',
+ 'spacing2'=>0,
+ 'spacing3'=>0 )
+
+# テキストの生成
+$twind_text.insert('end',
+ 'テキストwidget上に他のwidgetを組み込むことができます。')
+$twind_text.insert('end',
+ '組み込みウィンドウと呼ばれ、任意のwidgetが可能です。')
+$twind_text.insert('end',
+ '例えば、ここに2つのボタンwidgetが組み込まれています。')
+$twind_text.insert('end', '最初のボタンをクリックすと水平方向のスクロールを')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ #text 'ON'
+ text 'オン'
+ command proc{textWindOn $twind_text,$twind_buttons}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', "にします。また2つめのボタンをクリックすると\n")
+$twind_text.insert('end', '水平方向のスクロールを')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ #text 'OFF'
+ text 'オフ'
+ command proc{textWindOff $twind_text}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', 'にします。')
+
+$twind_text.insert('end', 'もうひとつの例です。')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text 'ここをクリック'
+ command proc{textWindPlot $twind_text}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', 'すると、x-yプロットがここに現れます。')
+$mark_plot = TkTextMark.new($twind_text, 'insert')
+$mark_plot.gravity='left'
+$twind_text.insert('end', 'マウスでデータを描画することができます。')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text '消去'
+ command proc{textWindDel $twind_text}
+ cursor 'top_left_arrow'
+ })
+$twind_text.insert('end', 'をクリックすると元に戻ります。
+
+')
+
+$twind_text.insert('end', '組み込みウィンドウだけをテキストwidget上に、実際の')
+$twind_text.insert('end', 'テキストはなしで組み込むことは便利です。')
+$twind_text.insert('end', 'この場合は、テキストwidgetはウィンドウマネージャの')
+$twind_text.insert('end', 'ように動作します。例えば、ここにはテキストwidgetに')
+$twind_text.insert('end', 'よってボタンがきれいに並べられています。')
+$twind_text.insert('end', 'これらのボタンで背景色を変えることができます')
+$twind_text.insert('end', '("Default"で元の色に戻すことができます)。')
+$twind_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが')
+$twind_text.insert('end', '変わります。すると自動的にテキストwidgetが')
+$twind_text.insert('end', 'レイアウトを整えてくれます。')
+$twind_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。
+
+')
+
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {|b|
+ text 'デフォルト'
+ command proc{embDefBg $twind_text}
+ cursor 'top_left_arrow'
+ $tag_buttons.add('end')
+ },
+ 'padx'=>3 )
+embToggle = TkVariable.new('Short')
+TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkCheckButton.new($twind_text) {
+ textvariable embToggle
+ indicatoron 0
+ variable embToggle
+ onvalue 'A much longer string'
+ offvalue 'Short'
+ cursor 'top_left_arrow'
+ pady 5
+ padx 2
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+
+[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
+ 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
+ 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
+ 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+].each{|twind_color|
+ TkTextWindow.new($twind_text, 'end',
+ 'window'=>TkButton.new($twind_text) {
+ text twind_color
+ cursor 'top_left_arrow'
+ command proc{$twind_text.bg twind_color}
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+}
+
+# メソッド定義
+def textWindOn (w,f)
+ if defined? $twind_scroll
+ begin
+ $twind_scroll.destroy
+ rescue
+ end
+ $twind_scroll = nil
+ end
+
+ base = TkWinfo.parent( TkWinfo.parent(w) )
+ $twind_scroll = TkScrollbar.new(base) {|s|
+ orient 'horizontal'
+ command proc{|*args| w.xview(*args)}
+ w.xscrollcommand proc{|first,last| s.set first,last}
+ w.wrap 'none'
+ pack('after'=>f, 'side'=>'bottom', 'fill'=>'x')
+ }
+
+ return nil
+end
+
+def textWindOff (w)
+ if defined? $twind_scroll
+ begin
+ $twind_scroll.destroy
+ rescue
+ end
+ $twind_scroll = nil
+ end
+ w.xscrollcommand ''
+ w.wrap 'word'
+end
+
+def textWindPlot (t)
+ if (defined? $twind_plot) && (TkWinfo.exist?($twind_plot))
+ return
+ end
+
+ $twind_plot = TkCanvas.new(t) {
+ relief 'sunken'
+ width 450
+ height 300
+ cursor 'top_left_arrow'
+ }
+
+ if $tk_version =~ /^4.*/
+ font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+ else
+ font = 'Helvetica 18'
+ end
+
+ TkcLine.new($twind_plot, 100, 250, 400, 250, 'width'=>2)
+ TkcLine.new($twind_plot, 100, 250, 100, 50, 'width'=>2)
+ TkcText.new($twind_plot, 225, 20,
+ 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown')
+
+ (0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($twind_plot, x, 250, x, 245, 'width'=>2)
+ TkcText.new($twind_plot, x, 254,
+ 'text'=>10*i, 'font'=>font, 'anchor'=>'n')
+ }
+ (0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($twind_plot, 100, y, 105, y, 'width'=>2)
+ TkcText.new($twind_plot, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e')
+ }
+
+ for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($twind_plot, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+ end
+
+ $twind_plot.itembind('point', 'Any-Enter',
+ proc{$twind_plot.itemconfigure 'current', 'fill', 'red'})
+ $twind_plot.itembind('point', 'Any-Leave',
+ proc{$twind_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
+ $twind_plot.itembind('point', '1',
+ proc{|x,y| embPlotDown $twind_plot,x,y}, "%x %y")
+ $twind_plot.itembind('point', 'ButtonRelease-1',
+ proc{$twind_plot.dtag 'selected'})
+ $twind_plot.bind('B1-Motion',
+ proc{|x,y| embPlotMove $twind_plot,x,y}, "%x %y")
+ while ($twind_text.get($mark_plot) =~ /[ \t\n]/)
+ $twind_text.delete $mark_plot
+ end
+ $twind_text.insert $mark_plot,"\n"
+ TkTextWindow.new($twind_text, $mark_plot, 'window'=>$twind_plot)
+ $tag_center.add $mark_plot
+ $twind_text.insert $mark_plot,"\n"
+end
+
+$embPlot = {'lastX'=>0, 'lastY'=>0}
+
+def embPlotDown (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $embPlot['lastX'] = x
+ $embPlot['lastY'] = y
+end
+
+def embPlotMove (w, x, y)
+ w.move 'selected', x - $embPlot['lastX'], y - $embPlot['lastY']
+ $embPlot['lastX'] = x
+ $embPlot['lastY'] = y
+end
+
+def textWindDel (w)
+ if (defined? $twind_text) && TkWinfo.exist?($twind_plot)
+ $twind_text.delete $twind_plot
+ $twind_plot = nil
+ while ($twind_text.get($mark_plot) =~ /[ \t\n]/)
+ $twind_text.delete $mark_plot
+ end
+ $twind_text.insert $mark_plot," "
+ end
+end
+
+def embDefBg (w)
+ w['background'] = w.configinfo('background')[3]
+end
diff --git a/ext/tk/sample/demos-jp/twind2.rb b/ext/tk/sample/demos-jp/twind2.rb
new file mode 100644
index 0000000000..a783ba4738
--- /dev/null
+++ b/ext/tk/sample/demos-jp/twind2.rb
@@ -0,0 +1,384 @@
+# -*- coding: utf-8 -*-
+#
+# text (embedded windows) widget demo 2 (called by 'widget')
+#
+
+# toplevel widget が存在すれば削除する
+if defined?($twind2_demo) && $twind2_demo
+ $twind2_demo.destroy
+ $twind2_demo = nil
+end
+
+# demo 用の toplevel widget を生成
+$twind2_demo = TkToplevel.new {|w|
+ title("Text Demonstration - Embedded Windows 2")
+ iconname("Embedded Windows")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($twind2_demo).pack(:fill=>:both, :expand=>true)
+
+# frame 生成
+$twind2_buttons = TkFrame.new(base_frame) {|frame|
+ TkGrid(TkFrame.new(frame, :height=>2, :relief=>:sunken, :bd=>2),
+ :columnspan=>4, :row=>0, :sticky=>'ew', :pady=>2)
+ TkGrid('x',
+ TkButton.new(frame, :text=>'コード参照',
+ :image=>$image['view'], :compound=>:left,
+ :command=>proc{showCode 'twind2'}),
+ TkButton.new(frame, :text=>'閉じる',
+ :image=>$image['delete'], :compound=>:left,
+ :command=>proc{
+ tmppath = $twind2_demo
+ $twind2_demo = nil
+ $showVarsWin[tmppath.path] = nil
+ tmppath.destroy
+ }),
+ :padx=>4, :pady=>4)
+ frame.grid_columnconfigure(0, :weight=>1)
+}
+$twind2_buttons.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+# frame 生成
+$twind2_text = nil
+TkFrame.new(base_frame, 'highlightthickness'=>2, 'borderwidth'=>2,
+ 'relief'=>'sunken') {|f|
+ $twind2_text = TkText.new(f, 'setgrid'=>true, 'font'=>$font,
+ # 'width'=>'70', 'height'=>35, 'wrap'=>'word',
+ 'width'=>'70', 'height'=>35, 'wrap'=>'char',
+ 'highlightthickness'=>0, 'borderwidth'=>0 ){|t|
+ TkScrollbar.new(f) {|s|
+ command proc{|*args| t.yview(*args)}
+ t.yscrollcommand proc{|first,last| s.set first,last}
+ }.pack('side'=>'right', 'fill'=>'y')
+ }.pack('expand'=>'yes', 'fill'=>'both')
+}.pack('expand'=>'yes', 'fill'=>'both')
+
+# タグ生成
+$tag2_center = TkTextTag.new($twind2_text,
+ 'justify' =>'center',
+ 'spacing1'=>'5m',
+ 'spacing3'=>'5m' )
+$tag2_buttons = TkTextTag.new($twind2_text,
+ 'lmargin1'=>'1c',
+ 'lmargin2'=>'1c',
+ 'rmargin' =>'1c',
+ 'spacing1'=>'3m',
+ 'spacing2'=>0,
+ 'spacing3'=>0 )
+
+# テキストの生成
+$twind2_text.insert('end', 'テキストウィジェットには色々な種類のアイテム')
+$twind2_text.insert('end', '(動的なものや静的なものの両方があります)を')
+$twind2_text.insert('end', '数多く含めることができます。そうしたアイテムは')
+$twind2_text.insert('end', '行替え、タブ、中央揃えなどの様々な方法で')
+$twind2_text.insert('end', '配置することができます。')
+$twind2_text.insert('end', '加えて、テキストウィジェットの内容物が')
+$twind2_text.insert('end', 'ウィンドウサイズに比べて大きすぎる場合でも')
+$twind2_text.insert('end', 'すべての方向にスムーズにスクロールさせて')
+$twind2_text.insert('end', '確認することが可能です。')
+$twind2_text.insert('end', "\n\n")
+$twind2_text.insert('end', 'テキストウィジェット上には他のウィジェットを')
+$twind2_text.insert('end', '含めることもできます。こうしたものは')
+$twind2_text.insert('end', '「埋め込みウィンドウ」と呼ばれ、その中に')
+$twind2_text.insert('end', 'いかなるウィジェットでも詰め込むことができます。')
+$twind2_text.insert('end', '例えば,ここには2つの')
+$twind2_text.insert('end', 'ボタンウィジェットが埋め込まれています。')
+$twind2_text.insert('end', '最初のボタンをクリックすると、')
+$twind2_text.insert('end', '水平方向のスクロールを ')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ #text 'ON'
+ text 'オン'
+ command proc{textWindOn2 $twind2_text,$twind2_buttons}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', "にします。また、2つめのボタンをクリックすると\n")
+$twind2_text.insert('end', '水平方向のスクロールを')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ #text 'OFF'
+ text 'オフ'
+ command proc{textWindOff2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', "にします。\n\n")
+
+$twind2_text.insert('end', '次はもうひとつの例です。')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text 'ここをクリック'
+ command proc{textWindPlot2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', 'すると、x-yプロットがここに現れます。')
+$mark2_plot = TkTextMark.new($twind2_text, 'insert')
+$mark2_plot.gravity='left'
+$twind2_text.insert('end', 'マウスでドラッグすることで、')
+$twind2_text.insert('end', 'プロット上のデータ点を移動することができます。')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text '消去'
+ command proc{textWindDel2 $twind2_text}
+ cursor 'top_left_arrow'
+ })
+$twind2_text.insert('end', 'をクリックすると元に戻ります。')
+$twind2_text.insert('end', "\n\n")
+
+$twind2_text.insert('end', '表示するテキストなしに埋め込みウィンドウだけを')
+$twind2_text.insert('end', 'テキストウィジェットに含めることも有用でしょう。')
+$twind2_text.insert('end', 'この場合、テキストウィジェットは')
+$twind2_text.insert('end', 'ジオメトリマネージャのように働きます。')
+$twind2_text.insert('end', '例えば、ここにはテキストウィジェットに')
+$twind2_text.insert('end', 'よってボタンがきれいに整列して配置されています。')
+$twind2_text.insert('end', 'これらのボタンをクリックすることで、')
+$twind2_text.insert('end', 'このテキストウィジェットの背景色を')
+$twind2_text.insert('end', '変えることができます("デフォルト"ボタンで')
+$twind2_text.insert('end', '元の色に戻すことができます)。')
+$twind2_text.insert('end', '"Short"というボタンをクリックすると文字列の長さが')
+$twind2_text.insert('end', '変わり、テキストウィジェットが自動的に')
+$twind2_text.insert('end', 'レイアウトを整える様子を見ることができます。')
+$twind2_text.insert('end', 'もう一度同じボタンを押すと元に戻ります。')
+$twind2_text.insert('end', "\n")
+
+btn_default = TkButton.new($twind2_text) {|b|
+ text 'デフォルト'
+ command proc{embDefBg2 $twind2_text}
+ cursor 'top_left_arrow'
+}
+TkTextWindow.new($twind2_text, 'end', 'window'=>btn_default, 'padx'=>3)
+embToggle = TkVariable.new('Short')
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkCheckButton.new($twind2_text) {
+ textvariable embToggle
+ indicatoron 0
+ variable embToggle
+ onvalue 'A much longer string'
+ offvalue 'Short'
+ cursor 'top_left_arrow'
+ pady 5
+ padx 2
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+
+[ 'AntiqueWhite3', 'Bisque1', 'Bisque2', 'Bisque3', 'Bisque4',
+ 'SlateBlue3', 'RoyalBlue1', 'SteelBlue2', 'DeepSkyBlue3', 'LightBlue1',
+ 'DarkSlateGray1', 'Aquamarine2', 'DarkSeaGreen2', 'SeaGreen1',
+ 'Yellow1', 'IndianRed1', 'IndianRed2', 'Tan1', 'Tan4'
+].each{|twind_color|
+ TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text) {
+ text twind_color
+ cursor 'top_left_arrow'
+ command proc{$twind2_text.bg twind_color}
+ },
+ 'padx'=>3,
+ 'pady'=>2 )
+}
+
+$tag2_buttons.add(btn_default, 'end')
+
+$text_normal2 = {}
+$text_normal2['border'] = $twind2_text.cget('borderwidth')
+$text_normal2['highlight'] = $twind2_text.cget('highlightthickness')
+$text_normal2['pad'] = $twind2_text.cget('padx')
+
+$twind2_text.insert('end', "\nborder width や highlightthickness, ")
+$twind2_text.insert('end', "padding を通常の値から変更することも可能です。\n")
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big borders",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigB2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small borders",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallB2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big highlight",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigH2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small highlight",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallH2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Big pad",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinBigP2 $twind2_text
+ }))
+
+TkTextWindow.new($twind2_text, 'end',
+ 'window'=>TkButton.new($twind2_text, :text=>"Small pad",
+ :cursor=>'top_left_arrow',
+ 'command'=>proc{
+ textWinSmallP2 $twind2_text
+ }))
+
+$twind2_text.insert('end', "\n\n更にイメージもテキストウィジェットに")
+$twind2_text.insert('end', "うまく配置できます:")
+
+TkTextImage.new($twind2_text, 'end',
+ 'image'=>TkBitmapImage.new(:file=>[
+ $demo_dir, '..',
+ 'images', 'face.xbm'
+ ].join(File::Separator)))
+
+# メソッド定義
+def textWinBigB2(w)
+ w.borderwidth 15
+end
+def textWinSmallB2(w)
+ w.borderwidth $text_normal2['border']
+end
+def textWinBigH2(w)
+ w.highlightthickness 15
+end
+def textWinSmallH2(w)
+ w.highlightthickness $text_normal2['highlight']
+end
+def textWinBigP2(w)
+ w.configure(:padx=>15, :pady=>15)
+end
+def textWinSmallP2(w)
+ w.configure(:padx=>$text_normal2['pad'], :pady=>$text_normal2['pad'])
+end
+
+def textWindOn2 (w,f)
+ if defined? $twind2_scroll
+ begin
+ $twind2_scroll.destroy
+ rescue
+ end
+ $twind2_scroll = nil
+ end
+
+ base = TkWinfo.parent( TkWinfo.parent(w) )
+ $twind2_scroll = TkScrollbar.new(base) {|s|
+ orient 'horizontal'
+ command proc{|*args| w.xview(*args)}
+ w.xscrollcommand proc{|first,last| s.set first,last}
+ w.wrap 'none'
+ pack('after'=>f, 'side'=>'bottom', 'fill'=>'x')
+ }
+
+ return nil
+end
+
+def textWindOff2 (w)
+ if defined? $twind2_scroll
+ begin
+ $twind2_scroll.destroy
+ rescue
+ end
+ $twind2_scroll = nil
+ end
+ w.xscrollcommand ''
+ #w.wrap 'word'
+ w.wrap 'char'
+end
+
+def textWindPlot2 (t)
+ if (defined? $twind2_plot) && (TkWinfo.exist?($twind2_plot))
+ return
+ end
+
+ $twind2_plot = TkCanvas.new(t) {
+ relief 'sunken'
+ width 450
+ height 300
+ cursor 'top_left_arrow'
+ }
+
+ #font = '-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*'
+ font = 'Helvetica 18'
+
+ TkcLine.new($twind2_plot, 100, 250, 400, 250, 'width'=>2)
+ TkcLine.new($twind2_plot, 100, 250, 100, 50, 'width'=>2)
+ TkcText.new($twind2_plot, 225, 20,
+ 'text'=>"A Simple Plot", 'font'=>font, 'fill'=>'brown')
+
+ (0..10).each {|i|
+ x = 100 + (i * 30)
+ TkcLine.new($twind2_plot, x, 250, x, 245, 'width'=>2)
+ TkcText.new($twind2_plot, x, 254,
+ 'text'=>10*i, 'font'=>font, 'anchor'=>'n')
+ }
+ (0..5).each {|i|
+ y = 250 - (i * 40)
+ TkcLine.new($twind2_plot, 100, y, 105, y, 'width'=>2)
+ TkcText.new($twind2_plot, 96, y,
+ 'text'=>"#{i*50}.0", 'font'=>font, 'anchor'=>'e')
+ }
+
+ for xx, yy in [[12,56],[20,94],[33,98],[32,120],[61,180],[75,160],[98,223]]
+ x = 100 + (3*xx)
+ y = 250 - (4*yy)/5
+ item = TkcOval.new($twind2_plot, x-6, y-6, x+6, y+6,
+ 'width'=>1, 'outline'=>'black', 'fill'=>'SkyBlue2')
+ item.addtag 'point'
+ end
+
+ $twind2_plot.itembind('point', 'Any-Enter',
+ proc{$twind2_plot.itemconfigure 'current', 'fill', 'red'})
+ $twind2_plot.itembind('point', 'Any-Leave',
+ proc{$twind2_plot.itemconfigure 'current', 'fill', 'SkyBlue2'})
+ $twind2_plot.itembind('point', '1',
+ proc{|x,y| embPlotDown2 $twind2_plot,x,y}, "%x %y")
+ $twind2_plot.itembind('point', 'ButtonRelease-1',
+ proc{$twind2_plot.dtag 'selected'})
+ $twind2_plot.bind('B1-Motion',
+ proc{|x,y| embPlotMove2 $twind2_plot,x,y}, "%x %y")
+ while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/)
+ $twind2_text.delete $mark2_plot
+ end
+ $twind2_text.insert $mark2_plot,"\n"
+ TkTextWindow.new($twind2_text, $mark2_plot, 'window'=>$twind2_plot)
+ $tag2_center.add $mark2_plot
+ $twind2_text.insert $mark2_plot,"\n"
+end
+
+$embPlot2 = {'lastX'=>0, 'lastY'=>0}
+
+def embPlotDown2 (w, x, y)
+ w.dtag 'selected'
+ w.addtag_withtag 'selected', 'current'
+ w.raise 'current'
+ $embPlot2['lastX'] = x
+ $embPlot2['lastY'] = y
+end
+
+def embPlotMove2 (w, x, y)
+ w.move 'selected', x - $embPlot2['lastX'], y - $embPlot2['lastY']
+ $embPlot2['lastX'] = x
+ $embPlot2['lastY'] = y
+end
+
+def textWindDel2 (w)
+ if (defined? $twind2_text) && TkWinfo.exist?($twind2_plot)
+ $twind2_text.delete $twind2_plot
+ $twind2_plot = nil
+ while ($twind2_text.get($mark2_plot) =~ /[ \t\n]/)
+ $twind2_text.delete $mark2_plot
+ end
+ $twind2_text.insert $mark2_plot," "
+ end
+end
+
+def embDefBg2 (w)
+ w['background'] = w.configinfo('background')[3]
+end
diff --git a/ext/tk/sample/demos-jp/unicodeout.rb b/ext/tk/sample/demos-jp/unicodeout.rb
new file mode 100644
index 0000000000..31596cf8fd
--- /dev/null
+++ b/ext/tk/sample/demos-jp/unicodeout.rb
@@ -0,0 +1,119 @@
+# -*- coding: utf-8 -*-
+#
+# unicodeout.rb --
+#
+# This demonstration script shows how you can produce output (in label
+# widgets) using many different alphabets.
+#
+# based on Tcl/Tk8.4.4 widget demos
+
+if defined?($unicodeout_demo) && $unicodeout_demo
+ $unicodeout_demo.destroy
+ $unicodeout_demo = nil
+end
+
+$unicodeout_demo = TkToplevel.new {|w|
+ title("Unicode Label Demonstration")
+ iconname("unicodeout")
+ positionWindow(w)
+}
+
+base_frame = TkFrame.new($unicodeout_demo).pack(:fill=>:both, :expand=>true)
+
+TkLabel.new(base_frame,
+ :font=>$font, :wraplength=>'5.4i', :justify=>:left,
+ :text=><<EOL).pack(:side=>:top)
+これは,Tkにおける非欧米文字集合を用いる言語に対するサポートについての\
+サンプルです.ただし,下の表示においてあなたが実際にどのような表示を\
+目にするかは,あなたの環境にどのような文字集合がインストールされているかに\
+大きく依存します.また,対象となる文字集合がインストールされていない場合に\
+どのような表示がなされるかもあなたの環境次第です.\
+「コード参照」ボタンを押してソースを表示し,\
+Unicodeout_SampleFrameクラスの@@fontの定義を書き換えて\
+(ファイルの内容は変更されません)\
+「再実行」ボタンのクリックを試してみてください.
+スクリプトが可搬性を持つように,文字列は\\uXXXXという\
+Tclのエスケープ表現を用いたUNICODE文字列で書かれています.\
+文字列は,Tk::UTF8_Stringメソッドによって,\
+「UTF8形式の文字列である」という\
+エンコード情報付きの文字列オブジェクト\
+(Tclのエスケープ表現の変換済み)に変換して\
+ラベルウィジェットに渡している点に注意してください.
+EOL
+#'
+
+TkFrame.new(base_frame){|f|
+ pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
+
+ TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
+ $unicodeout_demo.destroy
+ $unicodeout_demo = nil
+ }).pack(:side=>:left, :expand=>true)
+
+ TkButton.new(f, :text=>'コード参照', :width=>15, :command=>proc{
+ showCode 'unicodeout'
+ }).pack(:side=>:left, :expand=>true)
+}
+
+wait_msg = TkLabel.new(base_frame,
+ :text=>"フォント読み込みの完了まで" +
+ "しばらくお待ち下さい...",
+ :font=>"Helvetica 12 italic").pack
+
+class Unicodeout_SampleFrame < TkFrame
+ @@font = $font
+ # @@font = 'Helvetica 14'
+ # @@font = 'Courier 12'
+ # @@font = 'clearlyu 16'
+ # @@font = 'fixed 12'
+ # @@font = 'Times 12'
+ # @@font = 'Newspaper 12'
+ # @@font = '{New century schoolbook} 12'
+
+ def initialize(base)
+ super(base)
+ grid_columnconfig(1, :weight=>1)
+ end
+
+ def add_sample(lang, *args)
+ sample_txt = Tk::UTF8_String(args.join(''))
+ l = TkLabel.new(self, :font=>@@font, :text=>lang+':',
+ :anchor=>:nw, :pady=>0)
+ #s = TkLabel.new(self, :font=>@@font, :text=>sample_txt,
+ s = TkLabel.new(self, :font=>TkFont.new(@@font), :text=>sample_txt,
+ :anchor=>:nw, :width=>30, :pady=>0)
+ Tk.grid(l, s, :sticky=>:ew, :pady=>0)
+ l.grid_config(:padx, '1m')
+ end
+end
+f = Unicodeout_SampleFrame.new(base_frame)
+f.pack(:expand=>true, :fill=>:both, :padx=>'2m', :pady=>'1m')
+
+# Processing when some characters are missing might take a while, so make
+# sure we're displaying something in the meantime...
+
+oldCursor = $unicodeout_demo.cursor
+$unicodeout_demo.cursor('watch')
+Tk.update
+
+f.add_sample('Arabic',
+ '\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94',
+ '\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D')
+f.add_sample('Trad. Chinese', '\u4E2D\u570B\u7684\u6F22\u5B57')
+f.add_sample('Simpl. Chinese', '\u6C49\u8BED')
+f.add_sample('Greek',
+ '\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE ',
+ '\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1')
+f.add_sample('Hebrew',
+ '\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 ',
+ '\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9')
+f.add_sample('Japanese',
+ '\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, ',
+ '\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA')
+f.add_sample('Korean', '\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00')
+f.add_sample('Russian',
+ '\u0420\u0443\u0441\u0441\u043A\u0438\u0439 ',
+ '\u044F\u0437\u044B\u043A')
+
+wait_msg.destroy
+$unicodeout_demo.cursor(oldCursor)
diff --git a/ext/tk/sample/demos-jp/vscale.rb b/ext/tk/sample/demos-jp/vscale.rb
new file mode 100644
index 0000000000..6ae513bc33
--- /dev/null
+++ b/ext/tk/sample/demos-jp/vscale.rb
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+require "tkcanvas"
+
+if defined?($vscale_demo) && $vscale_demo
+ $vscale_demo.destroy
+ $vscale_demo = nil
+end
+
+$vscale_demo = TkToplevel.new {|w|
+ title("Vertical Scale Demonstration")
+ iconname("vscale")
+}
+positionWindow($vscale_demo)
+
+base_frame = TkFrame.new($vscale_demo).pack(:fill=>:both, :expand=>true)
+
+msg = TkLabel.new(base_frame) {
+ font $font
+ wraplength '3.5i'
+ justify 'left'
+# text "下には矢印が1つと乗直なスケールが表示されています。\
+#スケール上でマウスボタン1をクリック、またはドラッグすると\
+#矢印の長さを変えることができます。"
+ text "にはバーと縦型のスケールが表示されています。スケールでマウスのボタン1 をクリックするかドラッグしてバーの高さを変えることができます。終ったら「了解」ボタンを押してください。"
+}
+msg.pack('side'=>'top', 'padx'=>'.5c')
+
+TkFrame.new(base_frame) {|frame|
+ TkButton.new(frame) {
+ #text '了解'
+ text '閉じる'
+ command proc {
+ tmppath = $vscale_demo
+ $vscale_demo = nil
+ tmppath.destroy
+ }
+ }.pack('side'=>'left', 'expand'=>'yes')
+
+ TkButton.new(frame) {
+ text 'コード参照'
+ command proc { showCode 'vscale' }
+ }.pack('side'=>'left', 'expand'=>'yes')
+}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
+
+def setHeight(w, height)
+ height = height + 21
+ y2 = height - 30
+ if y2 < 21
+ y2 = 21
+ end
+ w.coords 'poly',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20
+ w.coords 'line',15,20,35,20,35,y2,45,y2,25,height,5,y2,15,y2,15,20
+end
+
+TkFrame.new(base_frame) {|frame|
+ borderwidth 10
+ canvas = TkCanvas.new(frame) {|c|
+ width 50
+ height 50
+ bd 0
+ highlightthickness 0
+ TkcPolygon.new(c, 0, 0, 1, 1, 2, 2) {
+ fill 'SeaGreen3'
+ tags 'poly'
+ }
+ TkcLine.new(c, 0, 0, 1, 1, 2, 2, 0, 0) {
+ fill 'black'
+ tags 'line'
+ }
+ }.pack('side'=>'left', 'anchor'=>'nw', 'fill'=>'y')
+ scale = TkScale.new(frame) {
+ orient 'vertical'
+ length 284
+ from 0
+ to 250
+ command proc{|value| setHeight(canvas, value)}
+ tickinterval 50
+ }.pack('side'=>'left', 'anchor'=>'ne')
+ scale.set 75
+}.pack
diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget
new file mode 100644
index 0000000000..5f5dfb9d70
--- /dev/null
+++ b/ext/tk/sample/demos-jp/widget
@@ -0,0 +1,1122 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+# 漢字コード設定 ( tk.rb のロード時の encoding 推定/設定に使われる )
+#if RUBY_VERSION < '1.9.0' ### !!!!!!!!!!!!!!
+unless defined?(::Encoding.default_external)
+ $KCODE = 'euc'
+else
+ DEFAULT_TK_ENCODING = 'EUC-JP'
+end
+
+# tk 関係ライブラリの読み込み
+require 'tk'
+# require 'tkafter'
+
+$RubyTk_WidgetDemo = true
+
+# widget demo directory 位置の獲得
+# $demo_dir = File.dirname($0)
+$demo_dir = File.dirname(__FILE__)
+
+# root の生成
+$root = TkRoot.new{title "Ruby/Tk Widget Demonstration"}
+
+# tk バージョンの取得
+$tk_version = Tk::TK_VERSION
+$tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i}
+$tk_patchlevel = Tk::TK_PATCHLEVEL
+
+# tcl_platform 情報へのアクセスオブジェクト
+$tk_platform = TkVarAccess.new('tcl_platform')
+
+# フォント設定
+#######
+case($tk_version)
+when /^4.*/
+ $font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
+ knjfont = '-*--16-*-jisx0208.1983-0'
+ $kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
+ knjfont)
+ TkOption.add('*kanjiFont', knjfont, 'startupFile')
+ $msg_kanji_font=TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
+ '-*--24-*-jisx0208.1983-0')
+
+#when '8.0'
+# $font = TkFont.new('Helvetica -12')
+# $kanji_font = TkFont.new('Helvetica -12', 'Mincho -12')
+# TkOption.add('*kanjiFont', knjfont, 'startupFile')
+# $msg_kanji_font=TkFont.new('Helvetica 16', 'Gothic 16 bold')
+
+when /^8.*/
+ $font = TkFont.new('Helvetica -12')
+ $kanji_font = TkFont.new('Helvetica -12', 'Mincho -12')
+ TkOption.add('*kanjiFont', knjfont, 'startupFile')
+ $msg_kanji_font=TkFont.new('Helvetica 14 bold', 'Gothic 14 bold')
+
+else
+ $font = TkFont.new('Helvetica 14', nil)
+ knjfont = '-*--16-*-jisx0208.1983-0'
+ $kanji_font = TkFont.new('Helvetic 14', knjfont)
+ TkOption.add('*kanjiFont', knjfont, 'startupFile')
+ $msg_kanji_font=TkFont.new('Helvetica 14',
+ '-*--24-*-jisx0208.1983-0')
+end
+#######
+
+# イメージ設定
+$image = {}
+
+if $tk_major_ver >= 8
+$image['refresh'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAQAPMAAMz/zCpnKdb/1z9mPypbKBtLGy9NMPL/9Or+6+P+4j1Y
+ PwQKBP7//xMLFAYBCAEBASH5BAEAAAAALAAAAAAQABAAAwR0EAD3Gn0Vyw0e
+ ++CncU7IIAezMA/nhUqSLJizvSdCEEjy2ZIV46AwDAoDHwPYGSoEiUJAAGJ6
+ EDHBNCFINW5OqABKSFk/B9lUa94IDwIFgewFMwQDQwCZQCztTgM9Sl8SOEMG
+ KSAthiaOjBMPDhQONBiXABEAOw==
+EOD
+end
+
+if $tk_major_ver >= 8
+$image['view'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAQAPMAAMz/zP///8DAwICAgH9/fwAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAwRIcMhJB7h3hM33
+ KFjWdQQYap1QrCaGBmrRrS4nj5b53jOgbwXBKGACoYLDIuAoHCmZyYvR1rT5
+ RMAq8LqcIYGsrjPsW1XOmFUEADs=
+EOD
+end
+
+if $tk_major_ver >= 8
+$image['delete'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
+ R0lGODlhEAAOAKEAAIQAAO/n3v///////yH5BAEKAAIALAAAAAAQAA4AAAIm
+ lI9pAKHbIHNoVhYhTdjlJ2AWKG2g+CldmB6rxo2uybYhbS80eRQAOw==
+EOD
+end
+
+if $tk_major_ver >= 8
+$image['print'] = TkPhotoImage.new(:height=>19, :format=>'GIF', :data=><<EOD)
+ R0lGODlhGgATAPcAACEQOTEpQjEpUkIpc0IxY0I5c0oxjEo5SlJCY1JCe1JK
+ UlpChFpCjFpGkFpSc1paa2NKc2NKnGNja2tapWtjc29KnHNanHNjc3NjrXNr
+ jHNrnHNzc3tjpXtrtXtzhICAgIRzvYSEjIZzqox7tYyEnIyMjJSEtZSEvZSM
+ lJyMtZyMvZyUlJyUrZyUvZycnKWctaWlpa2czq2lzrWtvbWtzrW1tb21xr21
+ 1sa9zs693s7OztbO3tbO597W1t7W7+fe7+fn5////+/n7+/v7+/v9////wAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAACH5BAEAAEEALAAAAAAaABMAQAj/AIMIHBhkg0GC
+ CBMGIQEiQgseQT4oeCBBAokgRYYQ0JBixg8hRIiUUEBBYYmTByBwiCBCRYwH
+ CxY8cKFw4AogRXLqLAJkQ80gCBBg3BkxZswTNGh4MGqgQQUMJRHCwMkTSE+D
+ Pn8eCKBhxIMhO3ei2OHDBw6sWSlMMMoWgwwfMDZI8GBjx44NARZwEGGi5MkS
+ PcIWKRGz5YgLbAco+KkQBQoJIRgjdGEVq+SaJajqtNrzMgsPCmoIzqmDgmWE
+ KOBuUKAAwYabYTfs4OHjY0giGyhk4MAWRI4eKyRQqPgggYUXPH4A+XBAgwoK
+ DiIsCFxjA9sFEVQQCRJCAYAFDJxiKhAxvMTonEFimrhhYinTBgWiCvxLNX3M
+ DkkpsKV5OYhjBxCMYAICAigUEAA7
+EOD
+end
+
+# メニュー設定
+if $tk_major_ver >= 8
+ $root.add_menubar([[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]])
+else
+ TkMenubar.new($root,
+ [[['File', 0],
+ ['About ... ', proc{aboutBox}, 0, '<F1>'],
+ '---',
+ ['Quit', proc{exit}, 0, 'Ctrl-Q']
+ ]]).pack('side'=>'top', 'fill'=>'x')
+end
+$root.bind('F1', proc{aboutBox})
+$root.bind('Control-q', proc{exit})
+
+=begin
+TkFrame.new($root){|frame|
+ TkMenubutton.new(frame){|button|
+ m = TkMenu.new(button) {
+ add 'command', 'label'=>'Quit', 'command'=>proc{exit}, 'underline'=>0
+ }
+ menu m
+ text 'File'
+ underline 0
+ }.pack('side'=>'left')
+}.pack('side'=>'top', 'fill'=>'x')
+=end
+
+# テキストボックスの生成
+if $tk_version =~ /^4\.[01]/
+ scr = TkScrollbar.new($root, 'orient'=>'vertical')
+ txt = TkText.new($root) {
+ #wrap 'word'
+ wrap 'char'
+ width 70
+ height 30
+ font $font
+ setgrid 'yes'
+ yscrollcommand proc{|first,last| scr.set first,last}
+ }
+ scr.command(proc{|*args| txt.yview(*args)})
+ scr.pack('side'=>'right', 'fill'=>'y')
+ txt.pack('expand'=>'yes', 'fill'=>'both')
+else
+ textFrame = TkFrame.new($root)
+ scr = TkScrollbar.new($root, 'orient'=>'vertical',
+ 'highlightthickness'=>0, 'takefocus'=>1) {
+ pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1)
+ }
+ txt = TkText.new($root) {
+ #wrap 'word'
+ wrap 'char'
+ width 70
+ height 30
+ font $font
+ setgrid 'yes'
+ highlightthickness 0
+ padx 4
+ pady 2
+ takefocus 0
+ bd 1
+ yscrollcommand proc{|first,last| scr.set first,last}
+ }
+ scr.command(proc{|*args| txt.yview(*args)})
+
+# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1)
+# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both')
+# textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2)
+ textFrame.pack('expand'=>'yes', 'fill'=>'both')
+ # $root.withdraw.deiconify
+ Tk.update_idletasks
+ txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both')
+
+ statusBar = TkFrame.new($root) {|f|
+ if $tk_version =~ /^4.*/
+ statusfont = '-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*'
+ else
+ statusfont = 'Helvetica 10'
+ end
+ $statusBarLabel = \
+ TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
+ 'font'=>statusfont) \
+ .pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both')
+ TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
+ 'font'=>statusfont) \
+ .pack('side'=>'left', 'padx'=>2)
+ }.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
+end
+
+# テキストタグ設定
+if $tk_version =~ /^4.*/
+ tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*')
+else
+ tag_title = TkTextTag.new(txt, 'font'=>'Helvetica 18 bold')
+end
+#tag_kanji_title = TkTextTag.new(txt, 'kanjifont'=>$msg_kanji_font)
+#tag_middle = TkTextTag.new(txt, 'kanjifont'=>$kanji_font)
+tag_kanji_title = TkTextTag.new(txt, 'font'=>$msg_kanji_font)
+tag_middle = TkTextTag.new(txt, 'font'=>$kanji_font)
+tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c')
+
+if TkWinfo.depth($root) == 1
+ tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'underline'=>1)
+ $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'underline'=>1)
+ tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white')
+else
+ tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'foreground'=>'blue', 'underline'=>1)
+ $tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
+ 'foreground'=>'#303080', 'underline'=>1)
+# tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1,
+# 'background'=>'SeaGreen3')
+ tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red')
+end
+
+#tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')})
+tag_demo.bind('ButtonRelease-1',
+ proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y')
+
+lastLine = TkVariable.new("")
+newLine = TkVariable.new("")
+tag_demo.bind('Enter', proc{|x,y|
+ lastLine.value = txt.index("@#{x},#{y} linestart")
+ tag_hot.add(lastLine.value, "#{lastLine.value} lineend")
+ showStatus txt, txt.index("@#{x},#{y}")
+ },
+ '%x %y')
+tag_demo.bind('Leave',
+ proc{
+ tag_hot.remove('1.0','end')
+ txt.configure('cursor','xterm')
+ $statusBarLabel.configure('text'=>"")
+ })
+tag_demo.bind('Motion', proc{|x, y|
+ newLine.value = txt.index("@#{x},#{y} linestart")
+ if newLine.value != lastLine.value
+ tag_hot.remove('1.0','end')
+ lastLine.value = newLine.value
+ if ( txt.tag_names("@#{x},#{y}").find{|t|
+ t.kind_of?(String) && t =~ /^demo-/
+ } )
+ tag_hot.add(lastLine.value,
+ "#{lastLine.value} lineend -1 chars")
+ end
+ end
+ showStatus txt, txt.index("@#{x},#{y}")
+ },
+ '%x %y')
+
+# テキスト生成
+txt.insert('end', 'Ruby/Tk : Widget', tag_title)
+#txt.insert('end', " デモンストレーション\n", tag_middle)
+txt.insert('end', " デモンストレーション\n", tag_kanji_title)
+txt.insert('end', <<"EOT")
+
+このアプリケーションは、Tk Widget を用いてどのようなことができるか\
+を示すための、いくつかの小さなスクリプトに対するフロントエンドを提\
+供しています。以下に順番に挙げられているデモンストレーションを実行\
+するにはマウスでクリックしてください。デモンストレーションのウィン\
+ドウが現れると、デモンストレーションを生成した Ruby/Tk のコードを見\
+るために、"コード参照"ボタンをクリックすることができます。あなたが\
+望むなら、そのコードを修正することができます。修正したコードでデモ\
+ンストレーションを再実行するためには、コードが書かれたウィンドウに\
+ある"デモ再実行" ボタンをクリックしてください。\
+コードを修正してもオリジナルのファイルが書き換えられることは\
+ありませんから、心配せずに色々な変更を試してみてください。
+
+一部のデモでは、比較的最近のバージョンの Tk でなければサポートして\
+いない機能を使って実装しています(例えば Tk8.4 以上など)。そのため、\
+そうした機能を持たない Tk ライブラリを使っている場合には、そうした\
+デモは正しく動きません。そのような機能が必要であれば、それをサポート\
+している Tk ライブラリを使うように tcltklib をコンパイルしなおして\
+ください。
+
+もしあなたの Tk が (最初から含むかインストールしたかにより) \
+Ttk (Tile) 拡張を利用できる状態であるなら、\
+Ttk 拡張のデモ (sample/tkextlib/tile/demo.rb) もぜひ試してみてください。
+( 多分,現在のあなたの環境には Ttk 拡張は\
+#{
+begin
+ require 'tkextlib/tile'
+ "すでに導入されています"
+rescue
+ "まだインストールされていません"
+end
+}\
+。)
+Ttk 拡張は、Tk8.5 以上では標準の機能として組み込まれています。
+
+
+EOT
+
+#txt.insert('end',"ラベル, ボタン, チェックボタン, ラジオボタン\n",tag_middle)
+txt.insert('end', "ラベル, ボタン, チェックボタン, ラジオボタン\n",
+ tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. ラベル (テキスト, ビットマップ)\n",
+ tag_demo, "demo-label")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. ラベルとUNICODEテキスト (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-unicodeout")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. ボタン \n", tag_demo, "demo-button")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. チェックボタン (複数を選択可能)\n",
+ tag_demo, "demo-check")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. 3状態チェックボタン (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-check2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. ラジオボタン (任意の一つを選択可能)\n",
+ tag_demo, "demo-radio")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. ラジオボタン (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-radio2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "8. 3状態ラジオボタン (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-radio3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "9. ボタンで作られた15-パズルゲーム\n",
+ tag_demo, "demo-puzzle")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "10. ビットマップを使用したアイコンボタン\n",
+ tag_demo, "demo-icon")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "11. 画像を表示する二つのラベル\n",
+ tag_demo, "demo-image1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "12. 画像を見るための簡単なユーザインターフェース\n",
+ tag_demo, "demo-image2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "13. 画像を見るための簡単なユーザインターフェース (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-image3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "14. ラベル付きフレーム (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-labelframe")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "15. テーマに対応したウィジェットの簡単な例 (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo, "demo-ttkbut")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "リストボックス\n", tag_middle)
+txt.insert('end', "リストボックス\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 都道府県.\n", tag_demo, "demo-states")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 色: アプリケーションのための配色を変える\n",
+ "#{tag_demo.id} demo-colors")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. 格言集\n", tag_demo, "demo-sayings")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. 国についてのマルチカラムリスト (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo, "demo-mclist")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. ディレクトリブラウザ (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo, "demo-tree")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "エントリとスピンボックス\n", tag_middle)
+txt.insert('end', "エントリ\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. スクロールバーなし\n", tag_demo, "demo-entry1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. スクロールバーあり\n", tag_demo, "demo-entry2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. 認証処理付きのエントリボックスとパスワードフィールド (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-entry3")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. スピンボックス (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-spin")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. コンボボックス (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo, "demo-combo")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. 簡単なフォーム\n", tag_demo, "demo-form")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "テキスト\n", tag_middle)
+txt.insert('end', "テキスト\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 基本的なテキスト\n", tag_demo, "demo-text")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 表示スタイル.\n", tag_demo, "demo-style")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. ハイパーテキスト(タグバインド).\n",
+ tag_demo, "demo-bind")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. ウィンドウを埋め込んだテキスト\n",
+ tag_demo, "demo-twind")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. ウィンドウを埋め込んだテキスト (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-twind2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. 検索\n", tag_demo, "demo-search")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. テキストウィジェットの対等化(peering) (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-textpeer")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "キャンバス\n", tag_middle)
+txt.insert('end', "キャンバス\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. アイテムの型\n", tag_demo, "demo-items")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 2 次元のプロット\n", tag_demo, "demo-plot")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. テキスト\n", tag_demo, "demo-ctext")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. 矢印の形\n", tag_demo, "demo-arrow")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. ルーラー\n", tag_demo, "demo-ruler")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. フロアプラン\n", tag_demo, "demo-floor")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "7. フロアプラン (異なるキャンバスアイテム作成方法を使用)\n", tag_demo, "demo-floor2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "8. スクロール可能なキャンバス\n",
+ tag_demo, "demo-cscroll")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "9. チェスボード上の騎士の巡回 (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo, "demo-knightstour")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "スケールとプログレスバー\n", tag_middle)
+txt.insert('end', "スケールとプログレスバー\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 垂直スケール\n", tag_demo.id, "demo-vscale")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 水平スケール\n", tag_demo.id, "demo-hscale")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. プログレスバー (Tile/Ttk拡張への対応が必要)\n", tag_demo.id, "demo-ttkprogress")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+txt.insert('end', "ペインドウィンドウとノートブック\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 水平方向 (機能に対応したバージョンのTkが必要)\n",
+ tag_demo.id, "demo-paned1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 垂直方向 (機能に対応したバージョンのTkが必要)\n",
+ tag_demo.id, "demo-paned2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. テーマに対応した埋め込みペイン (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo.id, "demo-ttkpane")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. ノートブックウィジェット (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo.id, "demo-ttknote")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "メニューとツールバー\n", tag_middle)
+txt.insert('end', "メニューとツールバー\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. メニューとカスケードを含んだウィンドウ\n",
+ tag_demo, "demo-menu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. メニューとカスケードを含んだウィンドウ (Tk8.x 専用)\n",
+ tag_demo, "demo-menu8x")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. 〃 (機能に対応したバージョンのTkが必要)\n",
+ tag_demo, "demo-menu84")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. メニューボタン (Tk8.x 専用)\n",
+ tag_demo, "demo-menubu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "5. テーマに対応したメニューボタン (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo.id, "demo-ttkmenu")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "6. テーマに対応したツールバー (Tile/Ttk拡張への対応が必要)\n",
+ tag_demo.id, "demo-toolbar")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "ダイアログウィンドウ\n", tag_middle)
+txt.insert('end', "ダイアログウィンドウ\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. メッセージボックス\n", tag_demo, "demo-msgbox")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 詳細テキスト付きのメッセージボックス (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-msgbox2")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. ファイル選択ダイアログ\n", tag_demo, "demo-filebox")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. 色選択ダイアログ\n", tag_demo, "demo-clrpick")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.insert('end', "\n")
+#txt.insert('end', "アニメーション\n", tag_middle)
+txt.insert('end', "アニメーション\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. アニメーションラベル (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-anilabel")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. 波形のアニメーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-aniwave")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. 振り子のシミュレーション (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-pendulum")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "4. A celebration of Rube Goldberg (機能に対応したバージョンのTkが必要)\n", tag_demo, "demo-goldberg")
+
+txt.insert('end', "\n")
+#txt.insert('end', "その他\n", tag_middle)
+txt.insert('end', "その他\n", tag_kanji_title)
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "1. 組み込みのビットマップ\n", tag_demo, "demo-bitmap")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "2. モーダルダイアログ(ローカルグラブ)\n",
+ tag_demo, "demo-dialog1")
+txt.insert('end', " \n ", tag_demospace)
+txt.insert('end', "3. モーダルダイアログ(グローバルグラブ)\n",
+ tag_demo, "demo-dialog2")
+txt.insert('end', " \n ", tag_demospace)
+
+txt.state('disabled')
+scr.focus
+
+################################
+# method 定義
+################################
+def positionWindow(w)
+ w.geometry('+300+300')
+end
+
+# 親ウィジェットと,変数名と TkVariable との組(配列)の並びを渡す
+$showVarsWin = {}
+def showVars1(parent, *args)
+ if $showVarsWin[parent.path]
+ begin
+ $showVarsWin[parent.path].destroy
+ rescue
+ end
+ end
+ top = TkToplevel.new(parent) {|w|
+ title "Variable values"
+ base = TkFrame.new(w).pack(:fill=>:both, :expand=>true)
+ TkLabel.new(base) {
+ text "変数値:"
+ width 20
+ anchor 'center'
+ if $tk_version =~ /^4.*/
+ font '-Adobe-helvetica-medium-r-normal--*-180-*-*-*-*-*-*'
+ else
+ font 'Helvetica 14'
+ end
+ }.pack('side'=>'top', 'fill'=>'x')
+ len = 1
+ args.each{|vnam,vbody|
+ len = vnam.to_s.length if vnam.to_s.length > len
+ }
+ args.each{|vnam,vbody|
+ TkFrame.new(base){|f|
+ #TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left')
+ TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left')
+ TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\
+ .pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
+ }.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x')
+ }
+ TkButton.new(base) {
+ text "了解"
+ command proc{w.destroy}
+ }.pack('side'=>'bottom', 'pady'=>2)
+ }
+ $showVarsWin[parent.path] = top
+end
+
+def showVars2(parent, *args)
+ if $showVarsWin[parent.path]
+ begin
+ $showVarsWin[parent.path].destroy
+ rescue
+ end
+ end
+ $showVarsWin[parent.path] = TkToplevel.new(parent) {|top|
+ title "Variable values"
+
+ base = TkFrame.new(top).pack(:fill=>:both, :expand=>true)
+
+ TkLabelFrame.new(base, :text=>"変数値:",
+ :font=>{:family=>'Helvetica', :size=>14}){|f|
+ args.each{|vnam,vbody|
+ TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
+ TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'),
+ :padx=>2, :pady=>2, :sticky=>'w')
+ }
+
+ f.grid(:sticky=>'news', :padx=>4)
+ f.grid_columnconfig(1, :weight=>1)
+ f.grid_rowconfig(100, :weight=>1)
+ }
+ TkButton.new(base, :text=>"了解", :width=>8, :default=>:active,
+ :command=>proc{top.destroy}){|b|
+ top.bind('Return', proc{b.invoke})
+ top.bind('Escape', proc{b.invoke})
+
+ b.grid(:sticky=>'e', :padx=>4, :pady=>[6, 4])
+ }
+ base.grid_columnconfig(0, :weight=>1)
+ base.grid_rowconfig(0, :weight=>1)
+ }
+end
+
+if $tk_major_ver < 8
+ alias showVars showVars1
+elsif $tk_major_ver == 8 && $tk_minor_ver < 4
+ alias showVars showVars1
+else # ver >= 8.4
+ alias showVars showVars2
+end
+
+# 疑似トップレベルサポート
+module PseudoToplevel_Evaluable
+ def pseudo_toplevel_eval(body = Proc.new)
+ Thread.current[:TOPLEVEL] = self
+ begin
+ body.call
+ ensure
+ Thread.current[:TOPLEVEL] = nil
+ end
+ end
+
+ def pseudo_toplevel_evaluable?
+ @pseudo_toplevel_evaluable
+ end
+ def pseudo_toplevel_evaluable=(mode)
+ @pseudo_toplevel_evaluable = (mode)? true: false
+ end
+
+ def self.extended(mod)
+ mod.__send__(:extend_object, mod)
+ mod.instance_variable_set('@pseudo_toplevel_evaluable', true)
+ end
+end
+
+class Object
+ alias __method_missing__ method_missing
+ private :__method_missing__
+
+ def method_missing(id, *args)
+ begin
+ has_top = (top = Thread.current[:TOPLEVEL]) &&
+ top.respond_to?(:pseudo_toplevel_evaluable?) &&
+ top.pseudo_toplevel_evaluable? &&
+ top.respond_to?(id)
+ rescue Exception => e
+ has_top = false
+ end
+
+ if has_top
+ top.__send__(id, *args)
+ else
+ __method_missing__(id, *args)
+ end
+ end
+end
+
+class Proc
+ def initialize(*args, &b)
+ super
+ @__pseudo_toplevel__ = Thread.current[:TOPLEVEL]
+ end
+
+ alias __call__ call
+ def call(*args, &b)
+ if top = @__pseudo_toplevel__
+ orig_top = Thread.current[:TOPLEVEL]
+ Thread.current[:TOPLEVEL] = top
+ begin
+ __call__(*args, &b)
+ ensure
+ Thread.current[:TOPLEVEL] = orig_top
+ end
+ else
+ __call__(*args, &b)
+ end
+ end
+end
+
+def proc(&b)
+ Proc.new(&b)
+end
+def lambda(&b)
+ Proc.new(&b)
+end
+
+def _null_binding
+ Module.new.instance_eval{extend PseudoToplevel_Evaluable}
+ # binding
+ # Module.new.instance_eval{binding}
+end
+private :_null_binding
+
+def eval_samplecode(code, file=nil)
+ #eval(code)
+ #_null_binding.pseudo_toplevel_eval{ eval(code) }
+ #Thread.new{ _null_binding.pseudo_toplevel_eval{ eval(code) } }
+ Thread.new{
+ _null_binding.pseudo_toplevel_eval{
+ begin
+ if file
+ eval(code, binding, "(eval:#{file})")
+ else
+ eval(code)
+ end
+ rescue Exception=>e
+ #p e
+ TkBgError.show(e.message + "\n" +
+ "\n---< backtrace of Ruby side >-----\n" +
+ e.backtrace.join("\n") +
+ "\n---< backtrace of Tk side >-------")
+ end
+ }
+ }
+ Tk.update rescue nil
+end
+
+# テキスト上での click に対する動作
+def invoke(txt, idx)
+ tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ return unless tag
+
+ cursor = txt.cget('cursor')
+ txt.cursor('watch')
+ Tk.update rescue nil
+ # eval(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, _null_binding)
+ # Tk.update
+ eval_samplecode(IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join, tag[5..-1] + '.rb')
+ txt.cursor(cursor)
+
+ $tag_visited.add("#{idx} linestart +1 chars", "#{idx} lineend +1 chars")
+end
+=begin
+def invoke (txt, idx)
+ tag = txt.tag_names(idx).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ return unless tag
+ current_cursor = txt.cget('cursor')
+ txt.cursor('watch')
+ Tk.update
+# eval `cat #{tag[5..-1]}.rb`
+# eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
+ eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
+ Tk.update
+# txt.cursor('xterm')
+ txt.cursor(current_cursor)
+
+ $tag_visited.add("#{idx} linestart +1 chars", "#{idx} lineend +1 chars")
+end
+=end
+
+# 状態表示
+def showStatus (txt, index)
+ tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/}
+ cursor = txt.cget('cursor')
+ unless tag
+ $statusBarLabel.configure('text', " ")
+ newcursor = 'xterm'
+ else
+ demoname = tag[5..-1]
+ $statusBarLabel.configure('text',
+ "サンプルプログラム \"#{demoname}\" の実行 ")
+ newcursor = 'hand2'
+ end
+ txt.configure('cursor'=>newcursor) if cursor != newcursor
+end
+
+# ソースコードの表示
+def showCode1(demo)
+ file = "#{demo}.rb"
+ $code_window = nil unless defined? $code_window
+ if $code_window == nil || TkWinfo.exist?($code_window) == false
+ $code_window = TkToplevel.new(nil)
+ f = TkFrame.new($code_window)
+
+ TkButton.new(f) {
+ #text "了解"
+ text "閉じる"
+ command proc{
+ $code_window.destroy
+ $code_window = nil
+ }
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
+ TkButton.new(f) {
+ text "再実行"
+ # command proc{eval($code_text.get('1.0','end'), _null_binding)}
+ command proc{eval_samplecode($code_text.get('1.0','end'), '<viewer>')}
+ }.pack('side'=>'right', 'expand'=>'false', 'pady'=>2)
+
+ TkLabel.new(f,'text'=>'line:').pack('side'=>'left')
+ linenum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+ TkLabel.new(f,'text'=>' pos:').pack('side'=>'left')
+ posnum =TkLabel.new(f,'text'=>'').pack('side'=>'left')
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
+ f.pack('side'=>'bottom', 'expand'=>'true', 'fill'=>'x')
+
+ if $tk_version =~ /^4\.[01]/
+ s = TkScrollbar.new($code_window, 'orient'=>'vertical')
+ $code_text = TkText.new($code_window) {
+ height 40
+ setgrid 'yes'
+ yscrollcommand proc{|first,last| s.set first,last}
+ }
+ s.command(proc{|*args| $code_text.yview(*args)})
+ s.pack('side'=>'right', 'fill'=>'y')
+ $code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both')
+ else
+ TkFrame.new($code_window) {|f|
+ pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
+
+ hs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
+ 'orient'=>'horizontal')
+ vs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
+ 'orient'=>'vertical')
+ $code_text = TkText.new($code_window) {|t|
+ height 40
+ #wrap 'word'
+ wrap 'char'
+ xscrollcommand proc{|first,last| hs.set first,last}
+ yscrollcommand proc{|first,last| vs.set first,last}
+ setgrid 'yes'
+ highlightthickness 0
+ pady 2
+ padx 3
+ hs.command(proc{|*args| $code_text.xview(*args)})
+ vs.command(proc{|*args| $code_text.yview(*args)})
+ }
+
+ $code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
+ 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
+# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
+ TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
+ }
+ end
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
+ else
+ $code_window.deiconify
+ $code_window.raise
+ end
+
+ $code_window.title("Demo code: #{file}")
+ $code_window.iconname(file)
+ code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read }
+ $code_text.delete('1.0', 'end')
+ code.force_encoding('EUC-JP') if defined?(::Encoding.default_external)
+ $code_text.insert('1.0', code)
+ TkTextMarkInsert.new($code_text,'1.0')
+ $set_linenum.call($code_text)
+end
+
+def showCode2(demo)
+ file = "#{demo}.rb"
+ $code_window = nil unless defined? $code_window
+ if $code_window == nil || TkWinfo.exist?($code_window) == false
+ $code_window = TkToplevel.new(nil)
+ tf = TkFrame.new($code_window)
+ $code_text = TkText.new(tf, :font=>'Courier 10', :height=>30,
+ :wrap=>'word', :bd=>1, :setgrid=>true,
+ :highlightthickness=>0, :pady=>2, :padx=>3)
+ xscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
+ yscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
+ TkGrid($code_text, yscr, :sticky=>'news')
+ #TkGrid(xscr)
+ tf.grid_rowconfigure(0, :weight=>1)
+ tf.grid_columnconfigure(0, :weight=>1)
+
+ bf = TkFrame.new($code_window)
+
+ lf = TkFrame.new(bf)
+ TkLabel.new(lf, :text=>'line:').pack(:side=>:left)
+ linenum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+ TkLabel.new(lf, :text=>' pos:').pack(:side=>:left)
+ posnum =TkLabel.new(lf, :text=>'').pack(:side=>:left)
+
+ $set_linenum = proc{|w|
+ line, pos = w.index('insert').split('.')
+ linenum.text = line
+ posnum.text = pos
+ }
+
+ #b_dis = TkButton.new(bf, :text=>'了解', :default=>:active,
+ b_dis = TkButton.new(bf, :text=>'閉じる', :default=>:active,
+ :command=>proc{
+ $code_window.destroy
+ $code_window = nil
+ },
+ :image=>$image['delete'], :compound=>:left)
+ b_prn = TkButton.new(bf, :text=>'印刷',
+ :command=>proc{printCode($code_text, file)},
+ :image=>$image['print'], :compound=>:left)
+ b_run = TkButton.new(bf, :text=>'再実行',
+ :command=>proc{
+ # eval($code_text.get('1.0','end'), _null_binding)
+ eval_samplecode($code_text.get('1.0','end'), '<viewer>')
+ },
+ :image=>$image['refresh'], :compound=>:left)
+
+ TkGrid(lf, 'x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
+ bf.grid_columnconfigure(1, :weight=>1)
+
+ TkGrid(tf, :sticky=>'news')
+ TkGrid(bf, :sticky=>'ew')
+ $code_window.grid_columnconfigure(0, :weight=>1)
+ $code_window.grid_rowconfigure(0, :weight=>1)
+
+ $code_window.bind('Return', proc{|win|
+ b_dis.invoke unless win.kind_of?(TkText)
+ }, '%W')
+ $code_window.bindinfo('Return').each{|cmd, arg|
+ $code_window.bind_append('Escape', cmd, arg)
+ }
+
+ btag = TkBindTag.new
+
+ btag.bind('Key', $set_linenum, '%W')
+ btag.bind('Button', $set_linenum, '%W')
+
+ btags = $code_text.bindtags
+ btags.insert(btags.index($code_text.class) + 1, btag)
+ $code_text.bindtags = btags
+
+ else
+ $code_window.deiconify
+ $code_window.raise
+ end
+
+ $code_window.title("Demo code: #{file}")
+ $code_window.iconname(file)
+ code = open([$demo_dir, file].join(File::Separator), 'r'){|fid| fid.read }
+ $code_text.delete('1.0', 'end')
+ code.force_encoding('EUC-JP') if defined?(::Encoding.default_external)
+ $code_text.insert('1.0', code)
+ TkTextMarkInsert.new($code_text,'1.0')
+ $set_linenum.call($code_text)
+end
+
+if $tk_major_ver < 8
+ alias showCode showCode1
+elsif $tk_major_ver == 8 && $tk_minor_ver < 4
+ alias showCode showCode1
+else # ver >= 8.4
+ alias showCode showCode2
+end
+
+
+# printCode --
+# Prints the source code currently displayed in the See Code dialog.
+# Much thanks to Arjen Markus for this.
+#
+# Arguments:
+# txt - Name of text widget containing code to print
+# file - Name of the original file (implicitly for title)
+
+def printCode(txt, file)
+ code = txt.get('1.0', 'end - 1c')
+ dir = '.'
+ dir = ENV['HOME'] if ENV['HOME']
+ dir = ENV['TMP'] if ENV['TMP']
+ dir = ENV['TEMP'] if ENV['TEMP']
+
+ fname = [dir, 'tkdemo-' + file].join(File::Separator)
+ open(fname, 'w'){|fid| fid.print(code)}
+ begin
+ case Tk::TCL_PLATFORM('platform')
+ when 'unix'
+ msg = `lp -c #{fname}`
+ unless $?.exitstatus == 0
+ Tk.messageBox(:title=>'Print spooling failure',
+ :message=>'エラーが発生しました.' +
+ '印刷に失敗したものと思われます : ' + msg)
+ end
+ when 'windows'
+ begin
+ printTextWin32(fname)
+ rescue => e
+ Tk.messageBox(:title=>'Print spooling failure',
+ :message=>'エラーが発生しました.' +
+ '印刷に失敗したものと思われます : ' +
+ e.message)
+ end
+ when 'macintosh'
+ Tk.messageBox(:title=>'Operation not Implemented',
+ :message=>'印刷機能はまだ実装されていません')
+ else
+ Tk.messageBox(:title=>'Operation not Implemented',
+ :message=>'検出された環境 ' +
+ Tk::TCL_PLATFORM('platform') +
+ ' は未知の環境であるため,' +
+ '印刷機能は実装されていません: ')
+ end
+ ensure
+ File.delete(fname)
+ end
+end
+
+# printTextWin32 --
+# Print a file under Windows
+#
+# Arguments:
+# filename - Name of the file
+#
+def printTextWin32(fname)
+ require 'win32/registry'
+ begin
+ app = Win32::Registry::HKEY_CLASSES_ROOT['.txt']
+ pcmd = nil
+ Win32::Registry::HKEY_CLASSES_ROOT.open("#{app}\\shell\\print"){|reg|
+ pcmd = reg['command']
+ }
+ rescue
+ app = Tk.tk_call('auto_execok', 'notepad.exe')
+ pcmd = "#{app} /p %1"
+ end
+
+ pcmd.gsub!('%1', fname)
+ puts pcmd
+ cmd = Tk.tk_call('auto_execok', 'start') + ' /min ' + pcmd
+
+ msg = `#{cmd}`
+ unless $?.exitstatus == 0
+ fail RuntimeError, msg
+ end
+end
+
+# aboutBox
+#
+# Pops up a message box with an "about" message
+#
+def aboutBox
+ Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
+ 'message'=>"Ruby/Tk ウィジェットデモ Ver.1.7.1-jp\n\n" +
+ "based on demos of Tk8.1 -- 8.5 " +
+ "( Copyright of Tcl/Tk demos:: " +
+ "(c) 1996-1997 Sun Microsystems, Inc. / " +
+ "(c) 1997-2000 Ajuba Solutions, Inc. / " +
+ "(c) 2001-2007 Donal K. Fellows / " +
+ "(c) 2002-2007 Daniel A. Steffen )\n\n" +
+ "Your Ruby & Tk Version ::\n" +
+ "Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}\n\n" +
+ "Ruby/Tk release date :: tcltklib #{TclTkLib::RELEASE_DATE}; tk #{Tk::RELEASE_DATE}")
+end
+
+####################################
+# 引数で指定されたデモを起動する
+no_launcher = false
+if ARGV[0] == '-n'
+ ARGV.shift
+ no_launcher = true if ARGV.size > 0
+else
+ # show the root widget to make it lower then demo windows
+ Tk.update rescue nil
+end
+ARGV.each{|cmd|
+ if cmd =~ /(.*).rb/
+ cmd = $1
+ end
+ #eval(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join,
+ # _null_binding)
+ eval_samplecode(IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join, cmd + '.rb')
+}
+if no_launcher
+ $root.withdraw # hide root window
+ Thread.start{
+ loop do
+ count = 0
+ $root.winfo_children.each{|w|
+ count += 1 if w.kind_of?(TkToplevel)
+ }
+ $root.destroy if count == 0
+ end
+ }
+end
+
+################################
+# イベント待ちに入る
+Tk.mainloop
diff --git a/ext/tk/sample/editable_listbox.rb b/ext/tk/sample/editable_listbox.rb
new file mode 100644
index 0000000000..890aec032e
--- /dev/null
+++ b/ext/tk/sample/editable_listbox.rb
@@ -0,0 +1,148 @@
+#
+# Tk::RbWidget::Editable_Listbox class
+#
+# When "DoubleClick-1" on a listbox item, the entry box is opend on the
+# item. And when hit "Return" key on the entry box after modifying the
+# text, the entry box is closed and the item is changed. Or when hit
+# "Escape" key, the entry box is closed without modification.
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+module Tk
+ module RbWidget
+ class Editable_Listbox < TkListbox
+ end
+ end
+end
+
+
+class Tk::RbWidget::Editable_Listbox < TkListbox
+ #------------------------------------
+ BindTag = TkBindTag.new_by_name(self.to_s.gsub(/::/, '#'))
+
+ BindTag.bind('FocusIn', :widget){|w|
+ w.instance_eval{
+ if idx = @ebox.pos
+ see(idx) if bbox(idx).empty?
+ @ebox.focus(true)
+ end
+ }
+ }
+
+ BindTag.bind('Double-1', :widget, :y){|w, y|
+ w.instance_eval{ _ebox_placer(nearest(y)) }
+ }
+
+ BindTag.bind('Return', :widget){|w|
+ w.instance_eval{
+ if idx = index(:active)
+ _ebox_placer(idx)
+ end
+ }
+ }
+ #------------------------------------
+
+ def configure(*args)
+ ret = super
+
+ case cget(:state)
+ when 'normal'
+ # do nothing
+ when 'disabled'
+ _ebox_erase
+ else # unknown
+ # do nothing
+
+ end
+
+ ret
+ end
+
+ def _ebox_move(idx)
+ return nil if cget(:state) == 'disabled'
+ x, y, w, h = bbox(idx)
+ return nil unless y && h
+ @ebox.place(:x => 0, :relwidth => 1.0,
+ :y => y - selectborderwidth,
+ :height => h + 2 * selectborderwidth)
+ @ebox.pos = idx
+ @ebox.focus
+ end
+
+ def _ebox_placer(idx)
+ return nil unless _ebox_move(idx)
+ @ebox.value = listvariable.list[idx]
+ @ebox.xview_moveto(self.xview[0])
+ end
+
+ def _ebox_erase
+ @ebox.place_forget
+ @ebox.pos = nil
+ end
+ private :_ebox_move, :_ebox_placer, :_ebox_erase
+
+ def _setup_ebox_bindings
+ # bindings for entry
+ @ebox.bind('Return'){
+ list = listvariable.list
+ list[@ebox.pos] = @ebox.value if @ebox.pos
+ listvariable.value = list
+ _ebox_erase
+ focus
+ }
+
+ @ebox.bind('Escape'){ _ebox_erase }
+ end
+ def _setup_listbox_bindings
+ # bindings for listbox
+ tags = bindtags
+ bindtags(tags.insert(tags.index(self) + 1, self.class::BindTag))
+ end
+ private :_setup_ebox_bindings, :_setup_listbox_bindings
+
+ def yview(*args)
+ if !@ebox.pos || bbox(@ebox.pos).empty?
+ @ebox.place_forget
+ else
+ _ebox_move(@ebox.pos)
+ end
+ super
+ end
+
+ def create_self(keys)
+ super(keys)
+
+ unless self.listvariable
+ self.listvariable = TkVariable.new(self.get(0, :end))
+ end
+
+ @ebox = TkEntry.new(self){
+ @pos = nil
+ def self.pos; @pos; end
+ def self.pos=(idx); @pos = idx; end
+ }
+
+ _setup_ebox_bindings
+ _setup_listbox_bindings
+ end
+end
+
+if $0 == __FILE__
+ #lbox0 = TkListbox.new.pack(:side=>:left)
+ #lbox0.insert(:end, 0,1,2,3,4,5,6,7,8,9,0,1,2,3)
+
+ scr = TkScrollbar.new.pack(:side=>:right, :fill=>:y)
+
+ lbox1 = Tk::RbWidget::Editable_Listbox.new.pack(:side=>:left)
+ lbox2 = Tk::RbWidget::Editable_Listbox.new.pack(:side=>:left)
+
+ scr.assign(lbox1, lbox2)
+
+ lbox1.insert(:end, *%w(a b c d e f g h i j k l m n))
+ lbox2.insert(:end, 0,1,2,3,4,5,6,7,8,9,0,1,2,3)
+
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/encstr_usage.rb b/ext/tk/sample/encstr_usage.rb
new file mode 100644
index 0000000000..39dc9c4018
--- /dev/null
+++ b/ext/tk/sample/encstr_usage.rb
@@ -0,0 +1,30 @@
+require 'tk'
+
+TkMessage.new(:width=>400, :text=><<EOM).pack
+This sample shows how to use Tk::EncodedString class. \
+This reads 'iso2022-kr' text (from discription of \
+Korean language environment of GNU Emacs 20.7.2) \
+and inserts the text into the text widget.
+EOM
+
+t1 = TkText.new(:height=>5).pack
+t2 = TkText.new(:height=>5).pack
+t3 = TkText.new(:height=>5).pack
+
+src_str = IO.readlines(File.join(File.dirname(__FILE__),'iso2022-kr.txt')).join
+
+t1.insert('end',
+ "use neither Tk::EncodedString class nor Tk.encoding= method\n\n")
+t1.insert('end', src_str)
+
+enc_str = Tk::EncodedString(src_str, 'iso2022-kr')
+t2.insert('end',
+ "use Tk::EncodedString class (Tk.encoding => '#{Tk.encoding}')\n\n")
+t2.insert('end', enc_str)
+
+Tk.encoding = 'iso2022-kr'
+t3.insert('end', "use Tk.encoding = 'iso2022-kr' (Tk.force_default_encoding? == #{Tk.force_default_encoding?})\n\n")
+
+t3.insert('end', src_str)
+
+Tk.mainloop
diff --git a/ext/tk/sample/figmemo_sample.rb b/ext/tk/sample/figmemo_sample.rb
new file mode 100644
index 0000000000..da6c41797e
--- /dev/null
+++ b/ext/tk/sample/figmemo_sample.rb
@@ -0,0 +1,456 @@
+#!/usr/bin/env ruby
+require 'tk'
+
+begin
+ # try to use Img extension
+ require 'tkextlib/tkimg'
+rescue Exception
+ # cannot use Img extension --> ignore
+end
+
+
+############################
+# scrolled_canvas
+class TkScrolledCanvas < TkCanvas
+ include TkComposite
+
+ def initialize_composite(keys={})
+ @h_scr = TkScrollbar.new(@frame)
+ @v_scr = TkScrollbar.new(@frame)
+
+ @canvas = TkCanvas.new(@frame)
+ @path = @canvas.path
+
+ @canvas.xscrollbar(@h_scr)
+ @canvas.yscrollbar(@v_scr)
+
+ TkGrid.rowconfigure(@frame, 0, :weight=>1, :minsize=>0)
+ TkGrid.columnconfigure(@frame, 0, :weight=>1, :minsize=>0)
+
+ @canvas.grid(:row=>0, :column=>0, :sticky=>'news')
+ @h_scr.grid(:row=>1, :column=>0, :sticky=>'ew')
+ @v_scr.grid(:row=>0, :column=>1, :sticky=>'ns')
+
+ delegate('DEFAULT', @canvas)
+ delegate('background', @canvas, @h_scr, @v_scr)
+ delegate('activebackground', @h_scr, @v_scr)
+ delegate('troughcolor', @h_scr, @v_scr)
+ delegate('repeatdelay', @h_scr, @v_scr)
+ delegate('repeatinterval', @h_scr, @v_scr)
+ delegate('borderwidth', @frame)
+ delegate('relief', @frame)
+
+ delegate_alias('canvasborderwidth', 'borderwidth', @canvas)
+ delegate_alias('canvasrelief', 'relief', @canvas)
+
+ delegate_alias('scrollbarborderwidth', 'borderwidth', @h_scr, @v_scr)
+ delegate_alias('scrollbarrelief', 'relief', @h_scr, @v_scr)
+
+ configure(keys) unless keys.empty?
+ end
+end
+
+############################
+class PhotoCanvas < TkScrolledCanvas
+
+USAGE = <<EOT
+--- WHAT IS ---
+You can write comments on the loaded image, and save it as a Postscipt
+file (original image file is not modified). Each comment is drawn as a
+set of an indicator circle, an arrow, and a memo text. See the following
+how to write comments.
+This can save the list of memo texts to another file. It may useful to
+search the saved Postscript file by the comments on them.
+This may not support multibyte characters (multibyte texts are broken on
+a Postscript file). It depends on features of canvas widgets of Tcl/Tk
+libraries linked your Ruby/Tk. If you use Tcl/Tk8.0-jp (Japanized Tcl/Tk),
+you can (possibly) get a Japanese Postscript file.
+
+--- BINDINGS ---
+* Button-1 : draw comments by following steps
+ 1st - Set center of a indicator circle.
+ 2nd - Set head position of an arrow.
+ 3rd - Set tail position of an arrow, and show an entry box.
+ Input a memo text and hit 'Enter' key to entry the comment.
+
+* Button-2-drag : scroll the canvas
+
+* Button-3 : when drawing, cancel current drawing
+
+* Double-Button-3 : delete the clicked comment (text, arrow, and circle)
+EOT
+
+ def initialize(*args)
+ super(*args)
+
+ self.highlightthickness = 0
+ self.selectborderwidth = 0
+
+ @photo = TkPhotoImage.new
+ @img = TkcImage.new(self, 0, 0, :image=>@photo)
+
+ width = self.width
+ height = self.height
+ @scr_region = [-width, -height, width, height]
+ self.scrollregion(@scr_region)
+ self.xview_moveto(0.25)
+ self.yview_moveto(0.25)
+
+ @col = 'red'
+ @font = 'Helvetica -12'
+
+ @memo_id_num = -1
+ @memo_id_head = 'memo_'
+ @memo_id_tag = nil
+ @overlap_d = 2
+
+ @state = TkVariable.new
+ @border = 2
+ @selectborder = 1
+ @delta = @border + @selectborder
+ @entry = TkEntry.new(self, :relief=>:ridge, :borderwidth=>@border,
+ :selectborderwidth=>@selectborder,
+ :highlightthickness=>0)
+ @entry.bind('Return'){@state.value = 0}
+
+ @mode = old_mode = 0
+
+ _state0()
+
+ bind('2', :x, :y){|x,y| scan_mark(x,y)}
+ bind('B2-Motion', :x, :y){|x,y| scan_dragto(x,y)}
+
+ bind('3'){
+ next if (old_mode = @mode) == 0
+ @items.each{|item| item.delete }
+ _state0()
+ }
+
+ bind('Double-3', :widget, :x, :y){|w, x, y|
+ next if old_mode != 0
+ x = w.canvasx(x)
+ y = w.canvasy(y)
+ tag = nil
+ w.find_overlapping(x - @overlap_d, y - @overlap_d,
+ x + @overlap_d, y + @overlap_d).find{|item|
+ ! (item.tags.find{|name|
+ if name =~ /^(#{@memo_id_head}\d+)$/
+ tag = $1
+ end
+ }.empty?)
+ }
+ w.delete(tag) if tag
+ }
+ end
+
+ #-----------------------------------
+ private
+ def _state0() # init
+ @mode = 0
+
+ @memo_id_num += 1
+ @memo_id_tag = @memo_id_head + @memo_id_num.to_s
+
+ @target = nil
+ @items = []
+ @mark = [0, 0]
+ bind_remove('Motion')
+ bind('ButtonRelease-1', proc{|x,y| _state1(x,y)}, '%x', '%y')
+ end
+
+ def _state1(x,y) # set center
+ @mode = 1
+
+ @target = TkcOval.new(self,
+ [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)],
+ :outline=>@col, :width=>3, :tags=>[@memo_id_tag])
+ @items << @target
+ @mark = [x,y]
+
+ bind('Motion', proc{|x,y| _state2(x,y)}, '%x', '%y')
+ bind('ButtonRelease-1', proc{|x,y| _state3(x,y)}, '%x', '%y')
+ end
+
+ def _state2(x,y) # create circle
+ @mode = 2
+
+ r = Integer(Math.sqrt((x-@mark[0])**2 + (y-@mark[1])**2))
+ @target.coords([canvasx(@mark[0] - r), canvasy(@mark[1] - r)],
+ [canvasx(@mark[0] + r), canvasy(@mark[1] + r)])
+ end
+
+ def _state3(x,y) # set line start
+ @mode = 3
+
+ @target = TkcLine.new(self,
+ [canvasx(x), canvasy(y)], [canvasx(x), canvasy(y)],
+ :arrow=>:first, :arrowshape=>[10, 14, 5],
+ :fill=>@col, :tags=>[@memo_id_tag])
+ @items << @target
+ @mark = [x, y]
+
+ bind('Motion', proc{|x,y| _state4(x,y)}, '%x', '%y')
+ bind('ButtonRelease-1', proc{|x,y| _state5(x,y)}, '%x', '%y')
+ end
+
+ def _state4(x,y) # create line
+ @mode = 4
+
+ @target.coords([canvasx(@mark[0]), canvasy(@mark[1])],
+ [canvasx(x), canvasy(y)])
+ end
+
+ def _state5(x,y) # set text
+ @mode = 5
+
+ if x - @mark[0] >= 0
+ justify = 'left'
+ dx = - @delta
+
+ if y - @mark[1] >= 0
+ anchor = 'nw'
+ dy = - @delta
+ else
+ anchor = 'sw'
+ dy = @delta
+ end
+ else
+ justify = 'right'
+ dx = @delta
+
+ if y - @mark[1] >= 0
+ anchor = 'ne'
+ dy = - @delta
+ else
+ anchor = 'se'
+ dy = @delta
+ end
+ end
+
+ bind_remove('Motion')
+
+ @entry.value = ''
+ @entry.configure(:justify=>justify, :font=>@font, :foreground=>@col)
+
+ ewin = TkcWindow.new(self, [canvasx(x)+dx, canvasy(y)+dy],
+ :window=>@entry, :state=>:normal, :anchor=>anchor,
+ :tags=>[@memo_id_tag])
+
+ @entry.focus
+ @entry.grab
+ @state.wait
+ @entry.grab_release
+
+ ewin.delete
+
+ @target = TkcText.new(self, [canvasx(x), canvasy(y)],
+ :anchor=>anchor, :justify=>justify,
+ :fill=>@col, :font=>@font, :text=>@entry.value,
+ :tags=>[@memo_id_tag])
+
+ _state0()
+ end
+
+ #-----------------------------------
+ public
+ def load_photo(filename)
+ @photo.configure(:file=>filename)
+ end
+
+ def modified?
+ ! ((find_withtag('all') - [@img]).empty?)
+ end
+
+ def fig_erase
+ (find_withtag('all') - [@img]).each{|item| item.delete}
+ end
+
+ def reset_region
+ width = @photo.width
+ height = @photo.height
+
+ if width > @scr_region[2]
+ @scr_region[0] = -width
+ @scr_region[2] = width
+ end
+
+ if height > @scr_region[3]
+ @scr_region[1] = -height
+ @scr_region[3] = height
+ end
+
+ self.scrollregion(@scr_region)
+ self.xview_moveto(0.25)
+ self.yview_moveto(0.25)
+ end
+
+ def get_texts
+ ret = []
+ find_withtag('all').each{|item|
+ if item.kind_of?(TkcText)
+ ret << item[:text]
+ end
+ }
+ ret
+ end
+end
+############################
+
+# define methods for menu
+def open_file(canvas, fname)
+ if canvas.modified?
+ ret = Tk.messageBox(:icon=>'warning',:type=>'okcancel',:default=>'cancel',
+ :message=>'Canvas may be modified. Realy erase? ')
+ return if ret == 'cancel'
+ end
+
+ filetypes = [
+ ['GIF Files', '.gif'],
+ ['GIF Files', [], 'GIFF'],
+ ['PPM Files', '.ppm'],
+ ['PGM Files', '.pgm']
+ ]
+
+ begin
+ if Tk::Img::package_version != ''
+ filetypes << ['JPEG Files', ['.jpg', '.jpeg']]
+ filetypes << ['PNG Files', '.png']
+ filetypes << ['PostScript Files', '.ps']
+ filetypes << ['PDF Files', '.pdf']
+ filetypes << ['Windows Bitmap Files', '.bmp']
+ filetypes << ['Windows Icon Files', '.ico']
+ filetypes << ['PCX Files', '.pcx']
+ filetypes << ['Pixmap Files', '.pixmap']
+ filetypes << ['SGI Files', '.sgi']
+ filetypes << ['Sun Raster Files', '.sun']
+ filetypes << ['TGA Files', '.tga']
+ filetypes << ['TIFF Files', '.tiff']
+ filetypes << ['XBM Files', '.xbm']
+ filetypes << ['XPM Files', '.xpm']
+ end
+ rescue
+ end
+
+ filetypes << ['ALL Files', '*']
+
+ fpath = Tk.getOpenFile(:filetypes=>filetypes)
+ return if fpath.empty?
+
+ begin
+ canvas.load_photo(fpath)
+ rescue => e
+ Tk.messageBox(:icon=>'error', :type=>'ok',
+ :message=>"Fail to read '#{fpath}'.\n#{e.message}")
+ end
+
+ canvas.fig_erase
+ canvas.reset_region
+
+ fname.value = fpath
+end
+
+# --------------------------------
+def save_memo(canvas, fname)
+ initname = fname.value
+ if initname != '-'
+ initname = File.basename(initname, File.extname(initname))
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'],
+ ['ALL Files', '*'] ],
+ :initialfile=>initname)
+ else
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Text Files', '.txt'],
+ ['ALL Files', '*'] ])
+ end
+ return if fpath.empty?
+
+ begin
+ fid = open(fpath, 'w')
+ rescue => e
+ Tk.messageBox(:icon=>'error', :type=>'ok',
+ :message=>"Fail to open '#{fname.value}'.\n#{e.message}")
+ end
+
+ begin
+ canvas.get_texts.each{|txt|
+ fid.print(txt, "\n")
+ }
+ ensure
+ fid.close
+ end
+end
+
+# --------------------------------
+def ps_print(canvas, fname)
+ initname = fname.value
+ if initname != '-'
+ initname = File.basename(initname, File.extname(initname))
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'],
+ ['ALL Files', '*'] ],
+ :initialfile=>initname)
+ else
+ fpath = Tk.getSaveFile(:filetypes=>[ ['Postscript Files', '.ps'],
+ ['ALL Files', '*'] ])
+ end
+ return if fpath.empty?
+
+ bbox = canvas.bbox('all')
+ canvas.postscript(:file=>fpath, :x=>bbox[0], :y=>bbox[1],
+ :width=>bbox[2] - bbox[0], :height=>bbox[3] - bbox[1])
+end
+
+# --------------------------------
+def quit(canvas)
+ ret = Tk.messageBox(:icon=>'warning', :type=>'okcancel',
+ :default=>'cancel',
+ :message=>'Realy quit? ')
+ exit if ret == 'ok'
+end
+
+# --------------------------------
+# setup root
+root = TkRoot.new(:title=>'Fig Memo')
+
+# create canvas frame
+canvas = PhotoCanvas.new(root).pack(:fill=>:both, :expand=>true)
+usage_frame = TkFrame.new(root, :relief=>:ridge, :borderwidth=>2)
+hide_btn = TkButton.new(usage_frame, :text=>'hide usage',
+ :font=>{:size=>8}, :pady=>1,
+ :command=>proc{usage_frame.unpack})
+hide_btn.pack(:anchor=>'e', :padx=>5)
+usage = TkLabel.new(usage_frame, :text=>PhotoCanvas::USAGE,
+ :font=>'Helvetica 8', :justify=>:left).pack
+
+show_usage = proc{
+ usage_frame.pack(:before=>canvas, :fill=>:x, :expand=>true)
+}
+
+fname = TkVariable.new('-')
+f = TkFrame.new(root, :relief=>:sunken, :borderwidth=>1).pack(:fill=>:x)
+label = TkLabel.new(f, :textvariable=>fname,
+ :font=>{:size=>-12, :weight=>:bold},
+ :anchor=>'w').pack(:side=>:left, :fill=>:x, :padx=>10)
+
+# create menu
+mspec = [
+ [ ['File', 0],
+ ['Show Usage', proc{show_usage.call}, 5],
+ '---',
+ ['Open Image File', proc{open_file(canvas, fname)}, 0],
+ ['Save Memo Texts', proc{save_memo(canvas, fname)}, 0],
+ '---',
+ ['Save Postscript', proc{ps_print(canvas, fname)}, 5],
+ '---',
+ ['Quit', proc{quit(canvas)}, 0]
+ ]
+]
+root.add_menubar(mspec)
+
+# manage wm_protocol
+root.protocol(:WM_DELETE_WINDOW){quit(canvas)}
+
+# show usage
+show_usage.call
+
+# --------------------------------
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/images/earth.gif b/ext/tk/sample/images/earth.gif
new file mode 100644
index 0000000000..2c229eb110
--- /dev/null
+++ b/ext/tk/sample/images/earth.gif
Binary files differ
diff --git a/ext/tk/sample/images/earthris.gif b/ext/tk/sample/images/earthris.gif
new file mode 100644
index 0000000000..c4ee473727
--- /dev/null
+++ b/ext/tk/sample/images/earthris.gif
Binary files differ
diff --git a/ext/tk/sample/images/face.xbm b/ext/tk/sample/images/face.xbm
new file mode 100644
index 0000000000..03d829f4d1
--- /dev/null
+++ b/ext/tk/sample/images/face.xbm
@@ -0,0 +1,173 @@
+#define face_width 108
+#define face_height 144
+#define face_x_hot 48
+#define face_y_hot 80
+static char face_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09,
+ 0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88,
+ 0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01,
+ 0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84,
+ 0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04,
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00,
+ 0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24,
+ 0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea,
+ 0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05,
+ 0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02,
+ 0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41,
+ 0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00,
+ 0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20,
+ 0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57,
+ 0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff,
+ 0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0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0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04,
+ 0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f,
+ 0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6,
+ 0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84,
+ 0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20,
+ 0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95,
+ 0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00,
+ 0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00,
+ 0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e,
+ 0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6,
+ 0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82,
+ 0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01,
+ 0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a,
+ 0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02,
+ 0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00,
+ 0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08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0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa,
+ 0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55,
+ 0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0,
+ 0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a,
+ 0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00,
+ 0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00,
+ 0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b,
+ 0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4,
+ 0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01,
+ 0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a,
+ 0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15,
+ 0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00,
+ 0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00,
+ 0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51,
+ 0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6,
+ 0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0x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+ 0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40,
+ 0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20,
+ 0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00,
+ 0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03,
+ 0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff,
+ 0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56,
+ 0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52,
+ 0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04,
+ 0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51,
+ 0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04,
+ 0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f,
+ 0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf,
+ 0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55,
+ 0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2,
+ 0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8,
+ 0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50,
+ 0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02,
+ 0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff,
+ 0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0,
+ 0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd,
+ 0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa,
+ 0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10,
+ 0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50,
+ 0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04,
+ 0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff,
+ 0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f,
+ 0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea,
+ 0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0,
+ 0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40,
+ 0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff,
+ 0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff,
+ 0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba,
+ 0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21,
+ 0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40,
+ 0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff,
+ 0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff,
+ 0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84,
+ 0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf,
+ 0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08,
+ 0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80,
+ 0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff,
+ 0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28,
+ 0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff,
+ 0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb,
+ 0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};
diff --git a/ext/tk/sample/images/flagdown.xbm b/ext/tk/sample/images/flagdown.xbm
new file mode 100644
index 0000000000..55abc51825
--- /dev/null
+++ b/ext/tk/sample/images/flagdown.xbm
@@ -0,0 +1,27 @@
+#define flagdown_width 48
+#define flagdown_height 48
+static char flagdown_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00,
+ 0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00,
+ 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04,
+ 0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07,
+ 0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07,
+ 0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07,
+ 0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03,
+ 0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00,
+ 0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00,
+ 0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
+ 0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
+ 0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00,
+ 0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
+ 0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00,
+ 0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
+ 0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a,
+ 0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19};
diff --git a/ext/tk/sample/images/flagup.xbm b/ext/tk/sample/images/flagup.xbm
new file mode 100644
index 0000000000..6eb0d846a3
--- /dev/null
+++ b/ext/tk/sample/images/flagup.xbm
@@ -0,0 +1,27 @@
+#define flagup_width 48
+#define flagup_height 48
+static char flagup_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00,
+ 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00,
+ 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00,
+ 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00,
+ 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00,
+ 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00,
+ 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00,
+ 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00,
+ 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00,
+ 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00,
+ 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00,
+ 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00,
+ 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00,
+ 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
+ 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a,
+ 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a,
+ 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a,
+ 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a,
+ 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a,
+ 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ext/tk/sample/images/gray25.xbm b/ext/tk/sample/images/gray25.xbm
new file mode 100644
index 0000000000..b234b3cb0b
--- /dev/null
+++ b/ext/tk/sample/images/gray25.xbm
@@ -0,0 +1,6 @@
+#define grey_width 16
+#define grey_height 16
+static char grey_bits[] = {
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};
diff --git a/ext/tk/sample/images/grey.25 b/ext/tk/sample/images/grey.25
new file mode 100644
index 0000000000..b234b3cb0b
--- /dev/null
+++ b/ext/tk/sample/images/grey.25
@@ -0,0 +1,6 @@
+#define grey_width 16
+#define grey_height 16
+static char grey_bits[] = {
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
+ 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};
diff --git a/ext/tk/sample/images/grey.5 b/ext/tk/sample/images/grey.5
new file mode 100644
index 0000000000..37688893f0
--- /dev/null
+++ b/ext/tk/sample/images/grey.5
@@ -0,0 +1,6 @@
+#define grey_width 16
+#define grey_height 16
+static char grey_bits[] = {
+ 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
+ 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
+ 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};
diff --git a/ext/tk/sample/images/letters.xbm b/ext/tk/sample/images/letters.xbm
new file mode 100644
index 0000000000..0f12568d1a
--- /dev/null
+++ b/ext/tk/sample/images/letters.xbm
@@ -0,0 +1,27 @@
+#define letters_width 48
+#define letters_height 48
+static char letters_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20,
+ 0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a,
+ 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21,
+ 0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21,
+ 0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21,
+ 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
+ 0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21,
+ 0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21,
+ 0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
+ 0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f,
+ 0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
+ 0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
+ 0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ext/tk/sample/images/noletter.xbm b/ext/tk/sample/images/noletter.xbm
new file mode 100644
index 0000000000..5774124efe
--- /dev/null
+++ b/ext/tk/sample/images/noletter.xbm
@@ -0,0 +1,27 @@
+#define noletters_width 48
+#define noletters_height 48
+static char noletters_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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00, 0x40, 0x70,
+ 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38,
+ 0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c,
+ 0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e,
+ 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07,
+ 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
+ 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
+ 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00};
diff --git a/ext/tk/sample/images/pattern.xbm b/ext/tk/sample/images/pattern.xbm
new file mode 100644
index 0000000000..df31baf789
--- /dev/null
+++ b/ext/tk/sample/images/pattern.xbm
@@ -0,0 +1,6 @@
+#define foo_width 16
+#define foo_height 16
+static char foo_bits[] = {
+ 0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92,
+ 0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72,
+ 0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06};
diff --git a/ext/tk/sample/images/tcllogo.gif b/ext/tk/sample/images/tcllogo.gif
new file mode 100644
index 0000000000..4603d4ff41
--- /dev/null
+++ b/ext/tk/sample/images/tcllogo.gif
Binary files differ
diff --git a/ext/tk/sample/images/teapot.ppm b/ext/tk/sample/images/teapot.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'multi-tk.rb', give option '--multi-tk'.
+# And if you want to use 'remote-tk.rb', give option '--remote-tk'.
+# If you want both, you don't need to give both options, because
+# 'remote-tk.rb' includes 'multi-tk.rb'.
+# ( There is no trouble even if you give both options. )
+#
+require 'remote-tk' if ARGV.delete('--remote-tk')
+require 'multi-tk' if ARGV.delete('--multi-tk')
+
+require "tk"
+module Tk
+ MAINLOOP = Thread.new{ mainloop }
+end
+
+require "irb"
+
+if __FILE__ == $0
+ IRB.start(__FILE__)
+else
+ # check -e option
+ if /^-e$/ =~ $0
+ IRB.start(__FILE__)
+ else
+ IRB.setup(__FILE__)
+ end
+end
diff --git a/ext/tk/sample/irbtkw.rbw b/ext/tk/sample/irbtkw.rbw
new file mode 100644
index 0000000000..b75ebca48d
--- /dev/null
+++ b/ext/tk/sample/irbtkw.rbw
@@ -0,0 +1,156 @@
+#!/usr/bin/env ruby
+#
+# irbtkw.rb : IRB console with Ruby/Tk
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+release = '2008/03/08'
+
+require 'tk'
+begin
+ require 'tktextio'
+rescue LoadError
+ require File.join(File.dirname(File.expand_path(__FILE__)), 'tktextio.rb')
+end
+
+require 'irb'
+
+if TkCore::WITH_ENCODING
+else
+ # $KCODE setup
+ case Tk.encoding
+ when 'shiftjis', 'cp932'
+ $KCODE='SJIS'
+ when 'euc-jp'
+ $KCODE='EUC'
+ when 'utf-8', 'unicode'
+ $KCODE='UTF8'
+ else
+ # unknown
+ end
+end
+
+# console setup
+top = TkToplevel.new(:title=>'IRB console')
+top.protocol(:WM_DELETE_WINDOW){ Tk.exit }
+
+case (Tk.windowingsystem)
+when 'win32'
+ fnt = ['MS Gothic', '-12']
+else
+ fnt = ['courier', '-12']
+end
+
+console = TkTextIO.new(top, :mode=>:console,
+ :width=>80).pack(:side=>:left,
+ :expand=>true, :fill=>:both)
+console.yscrollbar(TkScrollbar.new(top, :width=>10).pack(:before=>console,
+ :side=>:right,
+ :expand=>false,
+ :fill=>:y))
+
+# save original I/O
+out = $stdout
+err = $stderr
+
+irb_thread = nil
+ev_loop = Thread.new{
+ begin
+ Tk.mainloop
+ ensure
+ $stdout = out
+ $stderr = err
+ irb_thread.kill if irb_thread
+ end
+}
+
+# window position control
+root = Tk.root
+
+r_x = root.winfo_rootx
+r_y = root.winfo_rooty
+r_w = root.winfo_width
+
+t_x = top.winfo_rootx
+t_y = top.winfo_rooty
+t_w = top.winfo_width
+
+delta = 10
+
+ratio = 0.8
+s_w = (ratio * root.winfo_screenwidth).to_i
+
+if r_x < t_x
+ r_x, t_x = t_x, r_x
+end
+if t_x + t_w + r_w + delta < s_w
+ r_x = t_x + t_w + delta
+elsif t_w + r_w + delta < s_w
+ r_x = s_w - r_w
+ t_x = r_x - t_w
+else
+ r_x = s_w - r_w
+ t_x = 0
+end
+
+root.geometry("+#{r_x}+#{r_y}")
+top.geometry("+#{t_x}+#{t_y}")
+
+root.raise
+console.focus
+
+# I/O setup
+$stdin = console
+$stdout = console
+$stderr = console
+
+# dummy for rubyw.exe on Windows
+def STDIN.tty?
+ true
+end
+
+# IRB setup
+IRB.init_config(nil)
+IRB.conf[:USE_READLINE] = false
+IRB.init_error
+irb = IRB::Irb.new
+IRB.conf[:MAIN_CONTEXT] = irb.context
+
+class IRB::StdioInputMethod
+ def gets
+ prompt = "\n" << @prompt
+ $stdin.instance_eval{
+ flush
+ @prompt = prompt
+ _set_console_line
+ @prompt = nil
+ _see_pos
+ }
+
+ @line[@line_no += 1] = $stdin.gets
+ end
+end
+
+# IRB start
+$stdout.print("*** IRB console on Ruby/Tk (#{release}) ")
+irb_thread = Thread.new{
+ catch(:IRB_EXIT){
+ loop {
+ begin
+ irb.eval_input
+ rescue Exception
+ end
+ }
+ }
+}
+
+console.bind('Control-c'){
+ console.insert('end', "^C\n")
+ irb_thread.raise RubyLex::TerminateLineInput
+}
+
+irb_thread.join
+
+# exit
+ev_loop.kill
+Tk.exit
diff --git a/ext/tk/sample/iso2022-kr.txt b/ext/tk/sample/iso2022-kr.txt
new file mode 100644
index 0000000000..2e3fe6ea2a
--- /dev/null
+++ b/ext/tk/sample/iso2022-kr.txt
@@ -0,0 +1,2 @@
+Sample text:
+$)C Hangul (GQ1[) >H3gGO<<?d, >H3gGO=J4O1n
diff --git a/ext/tk/sample/menubar1.rb b/ext/tk/sample/menubar1.rb
new file mode 100644
index 0000000000..a233c6e088
--- /dev/null
+++ b/ext/tk/sample/menubar1.rb
@@ -0,0 +1,51 @@
+#
+# menubar sample 1 : use frame and menubuttons
+#
+
+require 'tk'
+
+radio_var = TkVariable.new('y')
+
+menu_spec = [
+ [['File', 0],
+ {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
+ '---',
+ ['Check_A', TkVariable.new(true), 6],
+ {:type=>'checkbutton', :label=>'Check_B',
+ :variable=>TkVariable.new, :underline=>6},
+ '---',
+ ['Radio_X', [radio_var, 'x'], 6, '', {:foreground=>'black'}],
+ ['Radio_Y', [radio_var, 'y'], 6],
+ ['Radio_Z', [radio_var, 'z'], 6],
+ '---',
+ ['cascade', [
+ ['sss', proc{p 'sss'}, 0],
+ ['ttt', proc{p 'ttt'}, 0],
+ ['uuu', proc{p 'uuu'}, 0],
+ ['vvv', proc{p 'vvv'}, 0],
+ ],
+ 0, '',
+ {:font=>'Courier 16 italic',
+ :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}],
+ '---',
+ ['Quit', proc{exit}, 0]],
+
+ [['Edit', 0],
+ ['Cut', proc{puts('Cut clicked')}, 2],
+ ['Copy', proc{puts('Copy clicked')}, 0],
+ ['Paste', proc{puts('Paste clicked')}, 0]],
+
+ [['Help', 0, {:menu_name=>'help'}],
+ ['About This', proc{puts('Ruby/Tk menubar sample 1')}, 6]]
+]
+
+menubar = TkMenubar.new(nil, menu_spec,
+ 'tearoff'=>false,
+ 'foreground'=>'grey40',
+ 'activeforeground'=>'red',
+ 'font'=>'Helvetia 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).')
+
+Tk.mainloop
diff --git a/ext/tk/sample/menubar2.rb b/ext/tk/sample/menubar2.rb
new file mode 100644
index 0000000000..e3cd68eaef
--- /dev/null
+++ b/ext/tk/sample/menubar2.rb
@@ -0,0 +1,56 @@
+#
+# menubar sample 2 : use 'menu' option of root/toplevel widget
+#
+
+require 'tk'
+
+radio_var = TkVariable.new('y')
+
+menu_spec = [
+ [['File', 0],
+ {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
+ '---',
+ ['Check_A', TkVariable.new(true), 6],
+ {:type=>'checkbutton', :label=>'Check_B',
+ :variable=>TkVariable.new, :underline=>6},
+ '---',
+ ['Radio_X', [radio_var, 'x'], 6, '', {:foreground=>'black'}],
+ ['Radio_Y', [radio_var, 'y'], 6],
+ ['Radio_Z', [radio_var, 'z'], 6],
+ '---',
+ ['cascade', [
+ ['sss', proc{p 'sss'}, 0],
+ ['ttt', proc{p 'ttt'}, 0],
+ ['uuu', proc{p 'uuu'}, 0],
+ ['vvv', proc{p 'vvv'}, 0],
+ ],
+ 0, '',
+ {:font=>'Courier 16 italic',
+ :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}],
+ '---',
+ ['Quit', proc{exit}, 0]],
+
+ [['Edit', 0],
+ ['Cut', proc{puts('Cut clicked')}, 2],
+ ['Copy', proc{puts('Copy clicked')}, 0],
+ ['Paste', proc{puts('Paste clicked')}, 0]],
+
+ [['Help', 0, {:menu_name=>'help'}],
+ ['About This', proc{puts('Ruby/Tk menubar sample 2')}, 6]]
+]
+
+mbar = Tk.root.add_menubar(menu_spec,
+ # followings are default configure options
+ 'tearoff'=>'false',
+ 'foreground'=>'grey40',
+ 'activeforeground'=>'red',
+ 'font'=>'Helvetia 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')
+
+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.')
+
+Tk.mainloop
diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb
new file mode 100644
index 0000000000..4f42f81c88
--- /dev/null
+++ b/ext/tk/sample/menubar3.rb
@@ -0,0 +1,72 @@
+#
+# menubar sample 3 : vertical layout menubar; use frame and menubuttons
+#
+
+require 'tk'
+
+radio_var = TkVariable.new('y')
+
+menu_spec = [
+ [['&File', true], # when underline option is ture, '&' index is the position
+ {:label=>'Open', :command=>proc{puts('Open clicked')}, :underline=>0},
+ '---',
+ ['Check_A', TkVariable.new(true), 6],
+ {:type=>'checkbutton', :label=>'Check_B',
+ :variable=>TkVariable.new, :underline=>6},
+ '---',
+ ['Radio_X', [radio_var, 'x'], /[XYZ]/, '', {:foreground=>'black'}],
+ ['Radio_Y', [radio_var, 'y'], /[XYZ]/],
+ ['Radio_Z', [radio_var, 'z'], /[XYZ]/], # use Regexp for underline position
+ '---',
+ ['cascade', [
+ ['sss', proc{p 'sss'}, 0],
+ ['ttt', proc{p 'ttt'}, 0],
+ ['uuu', proc{p 'uuu'}, 0],
+ ['vvv', proc{p 'vvv'}, 0],
+ ],
+ 0, '',
+ {:font=>'Courier 16 italic',
+ :menu_config=>{:font=>'Times -18 bold', :foreground=>'black'}}],
+ '---',
+ ['Quit', proc{exit}, 0]],
+
+ [['Edit', 0],
+ ['Cut', proc{puts('Cut clicked')}, 2],
+ ['Copy', proc{puts('Copy clicked')}, 0],
+ ['Paste', proc{puts('Paste clicked')}, 0]],
+
+ [['Help', 0, {:menu_name=>'help'}],
+ ['About This', proc{puts('Ruby/Tk menubar sample 3')}, "This"]]
+ # use string index for underline position
+]
+
+layout_proc = 'vertical'
+# The following procedure is same to 'layout_proc'=>'vertical'
+=begin
+layout_proc = proc{|parent, mbtn|
+ mbtn.direction :right
+ mbtn.pack(:side=>:top, :fill=>:x)
+
+ menu = mbtn.menu
+ cmd = proc{|m, dir|
+ Tk::Menu::TkInternalFunction.next_menu(m, dir) rescue nil
+ # ignore error when the internal function doesn't exist
+ }
+ menu.bind('Tab', cmd, :widget, 'forward')
+ menu.bind('Alt-Tab', cmd, :widget, 'backward')
+}
+=end
+
+menubar = TkMenubar.new(nil, menu_spec,
+ 'layout_proc'=>layout_proc,
+ 'tearoff'=>false,
+ 'foreground'=>'grey40',
+ 'activeforeground'=>'red',
+ 'font'=>'Helvetia 12 bold')
+menubar.pack('side'=>'left', 'fill'=>'y')
+
+TkText.new(:wrap=>'word').pack.insert('1.0', 'This sample script generates "Menu Sidebar".
+If "::tk::MenuNextMenuon" function is available your Tcl/Tk library, you will be able to move to the next menu by Tab key on the posted menu, or the previous menu by Alt + Tab key.
+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/menubar3.rb).')
+
+Tk.mainloop
diff --git a/ext/tk/sample/msgs_rb/README b/ext/tk/sample/msgs_rb/README
new file mode 100644
index 0000000000..781dda93ef
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/README
@@ -0,0 +1,3 @@
+Message catalogs in this directory depend on Tcl/Tk's message catalogs.
+Texts of each locale are copied from Tcl/Tk8.5a1 widget demos.
+Please refer to '../msgs_tk/README'.
diff --git a/ext/tk/sample/msgs_rb/cs.msg b/ext/tk/sample/msgs_rb/cs.msg
new file mode 100644
index 0000000000..199f2a73bd
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/cs.msg
@@ -0,0 +1,84 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ cs "Application Error", "Chyba programu"
+ cs "Blue", "Modr\341"
+ cs "Color", "Barva"
+ cs "Delete", "Smazat"
+ cs "Error", "Chyba"
+ cs "Exit", "Konec"
+ cs "Green", "Zelen\341"
+ cs "Red", "\\u010cerven\341"
+ cs "blue", "modr\341"
+ cs "green", "zelen\341"
+ cs "red", "\\u010derven\341"
+}
+
+TkMsgCatalog.new('::tk') {
+ cs "&Abort", "&P\\u0159eru\\u0161it"
+ cs "About...", "O programu..."
+ cs "All Files", "V\\u0161echny soubory"
+ cs "Application Error", "Chyba programu"
+ cs "&Blue", "&Modr\341"
+ cs "&Cancel", "&Zru\\u0161it"
+ cs "Cannot change to the directory \"%1\$s\".\nPermission denied.", "Nemohu zm\\u011bnit atku\341ln\355 adres\341\\u0159 na \"%1\$s\".\nP\\u0159\355stup odm\355tnut."
+ cs "Choose Directory", "V\375b\\u011br adres\341\\u0159e"
+ cs "Clear", "Smazat"
+ cs "Color", "Barva"
+ cs "Console", "Konzole"
+ cs "Copy", "Kop\355rovat"
+ cs "Cut", "Vy\\u0159\355znout"
+ cs "Delete", "Smazat"
+ cs "Details >>", "Detaily >>"
+ cs "Directory \"%1\$s\" does not exist.", "Adres\341\\u0159 \"%1\$s\" neexistuje."
+ cs "&Directory:", "&Adres\341\\u0159:"
+ cs "Error: %1\$s", "Chyba: %1\$s"
+ cs "Exit", "Konec"
+ cs "File \"%1\$s\" already exists.\n\n", "Soubor \"%1\$s\" ji\\u017e existuje.\n\n"
+ cs "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "Soubor \"%1\$s\" ji\\u017e existuje.\nChcete jej p\\u0159epsat?"
+ cs "File \"%1\$s\" does not exist.", "Soubor \"%1\$s\" neexistuje."
+ cs "File &name:", "&Jm\351no souboru:"
+ cs "File &names:", "&Jm\351na soubor\\u016f:"
+ cs "Files of &type:", "&Typy soubor\\u016f:"
+ cs "Fi&les:", "Sou&bory:"
+ cs "&Filter", "&Filtr"
+ cs "Fil&ter:", "Fil&tr:"
+ cs "&Green", "Ze&len\341"
+ cs "Hi"
+ cs "Hide Console", "Skr\375t konsolu"
+ cs "&Ignore", "&Ignorovat"
+ cs "Invalid file name \"%1\$s\".", "\\u0160patn\351 jm\351no souboru \"%1\$s\"."
+ cs "Log Files", "Log soubory"
+ cs "&No", "&Ne"
+ cs "&OK"
+ cs "Ok"
+ cs "Open", "Otev\\u0159\355t"
+ cs "&Open", "&Otev\\u0159\355t"
+ cs "Open Multiple Files", "Otev\\u0159\355t v\355ce soubor\\u016f"
+ cs "Paste", "Vlo\\u017eit"
+ cs "Quit", "Skon\\u010dit"
+ cs "&Red", " \\u010ce&rven\341"
+ cs "Replace existing file?", "Nahradit st\341vaj\355c\355 soubor?"
+ cs "&Retry", "Z&novu"
+ cs "&Save", "&Ulo\\u017eit"
+ cs "Save As", "Ulo\\u017eit jako"
+ cs "Save To Log", "Ulo\\u017eit do logu"
+ cs "Select Log File", "Vybrat log soubor"
+ cs "Select a file to source", "Vybrat soubor k nahr\341n\355"
+ cs "&Selection:", "&V\375b\\u011br:"
+ cs "Skip Messages", "P\\u0159esko\\u010dit zpr\341vy"
+ cs "Source...", "Nahr\341t..."
+ cs "Tcl Scripts", "Tcl skripty"
+ cs "Tcl for Windows", "Tcl pro Windows"
+ cs "Text Files", "Textov\351 soubory"
+ cs "&Yes", "&Ano"
+ cs "abort", "p\\u0159eru\\u0161it"
+ cs "blue", "modr\341"
+ cs "cancel", "zru\\u0161it"
+ cs "extension", "p\\u0159\355pona"
+ cs "extensions", "p\\u0159\355pony"
+ cs "green", "zelen\341"
+ cs "ignore", "ignorovat"
+ cs "ok"
+ cs "red", "\\u010derven\341"
+ cs "retry", "znovu"
+ cs "yes", "ano"
+}
diff --git a/ext/tk/sample/msgs_rb/de.msg b/ext/tk/sample/msgs_rb/de.msg
new file mode 100644
index 0000000000..283874df42
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/de.msg
@@ -0,0 +1,88 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ de "Application Error", "Applikationsfehler"
+ de "Blue", "Blau"
+ de "Color", "Farbe"
+ de "Delete", "L\\u00f6schen"
+ de "Error", "Fehler"
+ de "Exit", "Ende"
+ de "Green", "Gr\\u00fcn"
+ de "Red", "Rot"
+ de "blue", "blau"
+ de "green", "gr\\u00fcn"
+ de "red", "rot"
+}
+
+TkMsgCatalog.new('::tk') {
+ de "&Abort", "&Abbruch"
+ de "&About...", "&\\u00dcber..."
+ de "All Files", "Alle Dateien"
+ de "Application Error", "Applikationsfehler"
+ de "&Blue", "&Blau"
+ de "&Cancel", "&Abbruch"
+ de "Cannot change to the directory \"%1\$s\".\nPermission denied.", "Kann nicht in das Verzeichnis \"%1\$s\" wechseln.\nKeine Rechte vorhanden."
+ de "Choose Directory", "W\\u00e4hle Verzeichnis"
+ de "&Clear", "&R\\u00fccksetzen"
+ de "&Clear Console", "&Konsole l\\u00f6schen"
+ de "Color", "Farbe"
+ de "Console", "Konsole"
+ de "&Copy", "&Kopieren"
+ de "Cu&t", "Aus&schneiden"
+ de "&Delete", "&L\\u00f6schen"
+ de "Details >>"
+ de "Directory \"%1\$s\" does not exist.", "Das Verzeichnis \"%1\$s\" existiert nicht."
+ de "&Directory:", "&Verzeichnis:"
+ de "&Edit", "&Bearbieten"
+ de "Error: %1\$s", "Fehler: %1\$s"
+ de "E&xit", "&Ende"
+ de "&File", "&Datei"
+ de "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "Die Datei \"%1\$s\" ist bereits vorhanden.\nWollen sie diese Datei \\u00fcberschreiben ?"
+ de "File \"%1\$s\" already exists.\n\n", "Die Datei \"%1\$s\" ist bereits vorhanden.\n\n"
+ de "File \"%1\$s\" does not exist.", "Die Datei \"%1\$s\" existiert nicht."
+ de "File &name:", "Datei&name:"
+ de "File &names:", "Datei&namen:"
+ de "Files of &type:", "Dateien des &Typs:"
+ de "Fi&les:", "Dat&eien:"
+ de "&Filter"
+ de "Fil&ter:"
+ de "&Green", "&Gr\\u00fcn"
+ de "&Help", "&Hilfe"
+ de "Hi", "Hallo"
+ de "&Hide Console", "&Konsole unsichtbar machen"
+ de "&Ignore", "&Ignorieren"
+ de "Invalid file name \"%1\$s\".", "Ung\\u00fcltiger Dateiname \"%1\$s\"."
+ de "Log Files", "Protokolldatei"
+ de "&No", "&Nein"
+ de "OK"
+ de "Ok"
+ de "Open", "\\u00d6ffnen"
+ de "&Open", "\\u00d6&ffnen"
+ de "Open Multiple Files"
+ de "P&aste", "E&inf\\u00fcgen"
+ de "&Quit", "&Beenden"
+ de "&Red", "&Rot"
+ de "Replace existing file?", "Existierende Datei ersetzen?"
+ de "&Retry", "&Wiederholen"
+ de "&Save", "&Speichern"
+ de "Save As", "Speichern unter"
+ de "Save To Log", "In Protokoll speichern"
+ de "Select Log File", "Protokolldatei ausw\\u00e4hlen"
+ de "Select a file to source", "Auszuf\\u00fchrende Datei ausw\\u00e4hlen"
+ de "&Selection:", "Auswah&l:"
+ de "Skip Messages", "Weitere Nachrichten \\u00fcberspringen"
+ de "&Source...", "&Ausf\\u00fchren..."
+ de "Tcl Scripts", "Tcl-Skripte"
+ de "Tcl for Windows", "Tcl f\\u00fcr Windows"
+ de "Text Files", "Textdateien"
+ de "&Yes", "&Ja"
+ de "abort", "abbrechen"
+ de "blue", "blau"
+ de "cancel", "abbrechen"
+ de "extension", "Erweiterung"
+ de "extensions", "Erweiterungen"
+ de "green", "gr\\u00fcn"
+ de "ignore", "ignorieren"
+ de "ok"
+ de "red", "rot"
+ de "retry", "wiederholen"
+ de "yes", "ja"
+}
diff --git a/ext/tk/sample/msgs_rb/el.msg b/ext/tk/sample/msgs_rb/el.msg
new file mode 100644
index 0000000000..f314ae03eb
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/el.msg
@@ -0,0 +1,98 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ el 'Application Error', '\u039b\u03ac\u03b8\u03bf\u03c2 \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2'
+ el 'Blue', '\u039c\u03c0\u03bb\u03b5'
+ el 'Color', '\u03a7\u03c1\u03ce\u03bc\u03b1'
+ el 'Delete', '\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae'
+ el 'Error', '\u039b\u03ac\u03b8\u03bf\u03c2'
+ el 'Exit', '\u0388\u03be\u03bf\u03b4\u03bf\u03c2'
+ el 'Green', '\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf'
+ el 'Red', '\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf'
+ el 'blue', '\u03bc\u03c0\u03bb\u03b5'
+ el 'green', '\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf'
+ el 'red', '\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf'
+}
+
+TkMsgCatalog.new('::tk') {
+ el '&Abort', '\u03a4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2'
+ el 'About...', '\u03a3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac...'
+ el 'All Files', '\u038c\u03bb\u03b1 \u03c4\u03b1 \u0391\u03c1\u03c7\u03b5\u03af\u03b1'
+ el 'Application Error', '\u039b\u03ac\u03b8\u03bf\u03c2 \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2'
+ el '&Blue', '\u039c\u03c0\u03bb\u03b5'
+ el '&Cancel', '\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7'
+ el 'Cannot change to the directory "%1\$s".' "\n" 'Permission denied.', \
+ '\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u03ba\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5 \u03c3\u03b5 "%1\$s".' \
+ "\n" \
+ '\u0397 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9.'
+ el 'Choose Directory', '\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u039a\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5'
+ el 'Clear', '\u039a\u03b1\u03b8\u03b1\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2'
+ el 'Color', '\u03a7\u03c1\u03ce\u03bc\u03b1'
+ el 'Console', '\u039a\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1'
+ el 'Copy', '\u0391\u03bd\u03c4\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae'
+ el 'Cut', '\u0391\u03c0\u03bf\u03ba\u03bf\u03c0\u03ae'
+ el 'Delete', '\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae'
+ el 'Details >>', '\u039b\u03b5\u03c0\u03c4\u03bf\u03bc\u03ad\u03c1\u03b5\u03b9\u03b5\u03c2 >>'
+ el 'Directory "%1\$s", does not exist.', \
+ '\u039f \u03ba\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2 \'%1\$s\' \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.'
+ el '&Directory:', '&\u039a\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2:'
+ el 'Error: %1\$s', '\u039b\u03ac\u03b8\u03bf\u03c2: %1\$s'
+ el 'Exit', '\u0388\u03be\u03bf\u03b4\u03bf\u03c2'
+ el 'File "%1\$s" already exists.' "\n" 'Do you want to overwrite it?', \
+ '\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf "%1\$s" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.' \
+ "\n" \
+ '\u0398\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03b5\u03c0\u03b9\u03ba\u03b1\u03bb\u03c5\u03c6\u03b8\u03b5\u03af;'
+ el 'File "%1\$s" already exists.' "\n\n", \
+ '\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf "%1\$s" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.' "\n\n"
+ el 'File "%1\$s" does not exist.', \
+ '\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf "%1\$s" \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.'
+ el 'File &name:', '\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5:'
+ el 'File &names:', '\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd:'
+ el 'Files of &type:', '\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u03c4\u03bf\u03c5 &\u03c4\u03cd\u03c0\u03bf\u03c5:'
+ el 'Fi&les:', '\u0391\u03c1\u03c7\u03b5\u03af\u03b1:'
+ el '&Filter', '\u03a6\u03af\u03bb\u03c4\u03c1\u03bf'
+ el 'Fil&ter:', '\u03a6\u03af\u03bb\u03c4\u03c1\u03bf:'
+ el '&Green', '\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf'
+ el 'Hi', '\u0393\u03b5\u03b9\u03b1'
+ el 'Hide Console', '\u0391\u03c0\u03cc\u03ba\u03c1\u03c5\u03c8\u03b7 \u03ba\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1\u03c2'
+ el '&Ignore', '\u0391\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7'
+ el 'Invalid file name "%1\$s".', \
+ '\u0386\u03ba\u03c5\u03c1\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 "%1\$s".'
+ el 'Log Files', '\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2'
+ el '&No', '\u038c\u03c7\u03b9'
+ el '&OK', '\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9'
+ el '&Ok', '\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9'
+ el 'Open', '\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1'
+ el '&Open', '\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1'
+ el 'Open Multiple Files', \
+ '\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ce\u03bd \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd'
+ el 'Paste', '\u0395\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7'
+ el 'Quit', '\u0388\u03be\u03bf\u03b4\u03bf\u03c2'
+ el '&Red', '\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf'
+ el 'Replace existing file?', \
+ '\u0395\u03c0\u03b9\u03ba\u03ac\u03bb\u03c5\u03c8\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03bf\u03bd\u03c4\u03bf\u03c2 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5;'
+ el '&Retry', '\u03a0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac'
+ el '&Save', '\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7'
+ el 'Save As', '\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03b1\u03bd'
+ el 'Save To Log', '\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2'
+ el 'Select Log File', '\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2'
+ el 'Select a file to source', \
+ '\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03b3\u03b9\u03b1 \u03b5\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7'
+ el '&Selection:', '\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae:'
+ el 'Skip Messages', '\u0391\u03c0\u03bf\u03c6\u03c5\u03b3\u03ae \u03bc\u03c5\u03bd\u03b7\u03bc\u03ac\u03c4\u03c9\u03bd'
+ el 'Source...', '\u0395\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7...'
+ el 'Tcl Scripts', 'Tcl Scripts'
+ el 'Tcl for Windows', 'Tcl \u03b3\u03b9\u03b1 Windows'
+ el 'Text Files', '\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5'
+ el '&Yes', '\u039d\u03b1\u03b9'
+ el 'abort', '\u03c4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2'
+ el 'blue', '\u03bc\u03c0\u03bb\u03b5'
+ el 'cancel', '\u03b1\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7'
+ el 'extension', '\u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7'
+ el 'extensions', '\u03b5\u03c0\u03b5\u03ba\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2'
+ el 'green', '\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf'
+ el 'ignore', '\u03b1\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7'
+ el 'ok', '\u03b5\u03bd\u03c4\u03ac\u03be\u03b5\u03b9'
+ el 'red', '\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf'
+ el 'retry', '\u03c0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac'
+ el 'yes', '\u03bd\u03b1\u03b9'
+}
+
diff --git a/ext/tk/sample/msgs_rb/en.msg b/ext/tk/sample/msgs_rb/en.msg
new file mode 100644
index 0000000000..9b70239511
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/en.msg
@@ -0,0 +1,83 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ en "Application Error"
+ en "Blue"
+ en "Color"
+ en "Delete"
+ en "Error"
+ en "Green"
+ en "Red"
+ en "blue"
+ en "green"
+ en "red"
+}
+
+TkMsgCatalog.new('::tk') {
+ en "&Abort"
+ en "About..."
+ en "All Files"
+ en "Application Error"
+ en "&Blue"
+ en "&Cancel"
+ en "Cannot change to the directory \"%1\$s\".\nPermission denied."
+ en "Choose Directory"
+ en "Clear"
+ en "Color"
+ en "Console"
+ en "Copy"
+ en "Cut"
+ en "Delete"
+ en "Details >>"
+ en "Directory \"%1\$s\" does not exist."
+ en "&Directory:"
+ en "Error: %1\$s"
+ en "Exit"
+ en "File \"%1\$s\" already exists.\nDo you want to overwrite it?"
+ en "File \"%1\$s\" already exists.\n\n"
+ en "File \"%1\$s\" does not exist."
+ en "File &name:"
+ en "File &names:"
+ en "Files of &type:"
+ en "Fi&les:"
+ en "&Filter"
+ en "Fil&ter:"
+ en "&Green"
+ en "Hi"
+ en "Hide Console"
+ en "&Ignore"
+ en "Invalid file name \"%1\$s\"."
+ en "Log Files"
+ en "&No"
+ en "&OK"
+ en "Ok"
+ en "Open"
+ en "&Open"
+ en "Open Multiple Files"
+ en "Paste"
+ en "Quit"
+ en "&Red"
+ en "Replace existing file?"
+ en "&Retry"
+ en "&Save"
+ en "Save As"
+ en "Save To Log"
+ en "Select Log File"
+ en "Select a file to source"
+ en "&Selection:"
+ en "Skip Messages"
+ en "Source..."
+ en "Tcl Scripts"
+ en "Tcl for Windows"
+ en "Text Files"
+ en "&Yes"
+ en "abort"
+ en "blue"
+ en "cancel"
+ en "extension"
+ en "extensions"
+ en "green"
+ en "ignore"
+ en "ok"
+ en "red"
+ en "retry"
+ en "yes"
+}
diff --git a/ext/tk/sample/msgs_rb/en_gb.msg b/ext/tk/sample/msgs_rb/en_gb.msg
new file mode 100644
index 0000000000..97c58959b1
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/en_gb.msg
@@ -0,0 +1,7 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ en_gb 'Color', 'Colour'
+}
+
+TkMsgCatalog.new('::tk') {
+ en_gb 'Color', 'Colour'
+}
diff --git a/ext/tk/sample/msgs_rb/eo.msg b/ext/tk/sample/msgs_rb/eo.msg
new file mode 100644
index 0000000000..1630df5e83
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/eo.msg
@@ -0,0 +1,87 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ eo 'Application Error', 'Aplikoerraro'
+ eo 'Blue', 'Blua'
+ eo 'Color', 'Farbo'
+ eo 'Delete', 'Forprenu'
+ eo 'Error', 'Eraro'
+ eo 'Exit', 'Eliru'
+ eo 'Green', 'Verda'
+ eo 'Red', 'Rosa'
+ eo 'blue', 'blua'
+ eo 'green', 'verda'
+ eo 'red', 'ru\u011da'
+}
+
+TkMsgCatalog.new('::tk') {
+ eo '&Abort', '&\u0108esigo'
+ eo '&About...', 'Pri...'
+ eo 'All Files', '\u0108ioj dosieroj'
+ eo 'Application Error', 'Aplikoerraro'
+ eo '&Blue', '&Blua'
+ eo '&Cancel', '&Rezignu'
+ eo 'Cannot change to the directory "%1\$s".' "\n" 'Permission denied.', 'Neeble \u0109angi al dosierulon "%1\$s".' "\n" 'Vi ne rajtas tion.'
+ eo 'Choose Directory', 'Elektu Dosierujo'
+ eo '&Clear', '&Klaru'
+ eo '&Clear Console', '&Klaru konzolon'
+ eo 'Color', 'Farbo'
+ eo 'Console', 'Konzolo'
+ eo '&Copy', '&Kopiu'
+ eo 'Cu&t', '&Enpo\u015digu'
+ eo '&Delete', '&Forprenu'
+ eo 'Details >>', 'Detaloj >>'
+ eo 'Directory "%1\$s" does not exist.', 'La dosierujo "%1\$s" ne ekzistas.'
+ eo '&Directory:', '&Dosierujo:'
+ eo '&Edit', '&Redaktu'
+ eo 'Error: %1\$s', 'Eraro: %1\$s'
+ eo 'E&xit', '&Eliru'
+ eo '&File', '&Dosiero'
+ eo 'File "%1\$s" already exists.' "\n" 'Do you want to overwrite it?', 'La dosiero "%1\$s" jam ekzistas.' "\n" '\u0108u vi volas anstata\u00fbigi la dosieron?'
+ eo 'File "%1\$s" already exists.' "\n\n", 'La dosiero "%1\$s" jam egzistas.' "\n\n"
+ eo 'File "%1\$s" does not exist.', 'La dosierp "%1\$s" ne estas.'
+ eo 'File &name:', 'Dosiero&nomo:'
+ eo 'File &names:', 'Dosiero&nomoj:'
+ eo 'Files of &type:', 'Dosieroj de &Typo:'
+ eo 'Fi&les:', 'Do&sieroj:'
+ eo '&Filter', '&Filtrilo'
+ eo 'Fil&ter:', '&Filtrilo:'
+ eo '&Green', '&Verda'
+ eo '&Help', '&Helpu'
+ eo 'Hi', 'Saluton'
+ eo '&Hide Console', '&Ka\u015du konzolon'
+ eo '&Ignore', '&Ignoru'
+ eo 'Invalid file name "%1\$s".', 'Malvalida dosieronomo "%1\$s".'
+ eo 'Log Files', 'Protokolo'
+ eo '&No', '&Ne'
+ eo 'OK'
+ eo 'Ok'
+ eo 'Open', 'Malfermu'
+ eo '&Open', '&Malfermu'
+ eo 'Open Multiple Files', 'Melfermu multan dosierojn'
+ eo 'P&aste', '&Elpo\u015digi'
+ eo '&Quit', '&Finigu'
+ eo '&Red', '&Rosa'
+ eo 'Replace existing file?', '\u0108u anstata\u00fbu ekzistantan dosieron?'
+ eo '&Retry', '&Ripetu'
+ eo '&Save', '&Savu'
+ eo 'Save As', 'Savu kiel'
+ eo 'Save To Log', 'Savu en protokolon'
+ eo 'Select Log File', 'Elektu prokolodosieron'
+ eo 'Select a file to source', 'Elektu dosieron por interpreti'
+ eo '&Selection:', '&Elekto:'
+ eo 'Skip Messages', 'transsaltu pluajn mesa\u011dojn'
+ eo '&Source...', '&Fontoprogramo...'
+ eo 'Tcl Scripts', 'Tcl-skriptoj'
+ eo 'Tcl for Windows', 'Tcl por vindoso'
+ eo 'Text Files', 'Tekstodosierojn'
+ eo '&Yes', '&Jes'
+ eo 'abort', '\u0109esigo'
+ eo 'blue', 'blua'
+ eo 'cancel', 'rezignu'
+ eo 'extension', 'ekspansio'
+ eo 'extensions', 'ekspansioj'
+ eo 'green', 'verda'
+ eo 'ignore', 'ignorieren'
+ eo 'red', 'ru\u011da'
+ eo 'retry', 'ripetu'
+ eo 'yes', 'jes'
+}
diff --git a/ext/tk/sample/msgs_rb/es.msg b/ext/tk/sample/msgs_rb/es.msg
new file mode 100644
index 0000000000..38ca28fb8f
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/es.msg
@@ -0,0 +1,84 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ es "Application Error", "Error de la aplicaci\\u00f3n"
+ es "Blue", "Azul"
+ es "Color", "Color"
+ es "Delete", "Borrar"
+ es "Error", "Error"
+ es "Exit", "Salir"
+ es "Green", "Verde"
+ es "Red", "Rojo"
+ es "blue", "azul"
+ es "green", "verde"
+ es "red", "rojo"
+}
+
+TkMsgCatalog.new('::tk') {
+ es "&Abort", "&Abortar"
+ es "About...", "Acerca de ..."
+ es "All Files", "Todos los archivos"
+ es "Application Error", "Error de la aplicaci\\u00f3n"
+ es "&Blue", "&Azul"
+ es "&Cancel", "&Cancelar"
+ es "Cannot change to the directory \"%1\$s\".\nPermission denied.", "No es posible acceder al directorio \"%1\$s\".\nPermiso denegado."
+ es "Choose Directory", "Elegir directorio"
+ es "Clear", "Borrar"
+ es "Color", "Color"
+ es "Console", "Consola"
+ es "Copy", "Copiar"
+ es "Cut", "Cortar"
+ es "Delete", "Borrar"
+ es "Details >>", "Detalles >>"
+ es "Directory \"%1\$s\" does not exist.", "El directorio \"%1\$s\" no existe."
+ es "&Directory:", "&Directorio:"
+ es "Error: %1\$s", "Error: %1\$s"
+ es "Exit", "Salir"
+ es "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "El archivo \"%1\$s\" ya existe.\nDesea sobreescribirlo?"
+ es "File \"%1\$s\" already exists.\n\n", "El archivo \"%1\$s\" ya existe.\n\n"
+ es "File \"%1\$s\" does not exist.", "El archivo \"%1\$s\" no existe."
+ es "File &name:", "&Nombre de archivo:"
+ es "File &names:", "&Nombres de archivo:"
+ es "Files of &type:", "Archivos de &tipo:"
+ es "Fi&les:", "&Archivos:"
+ es "&Filter", "&Filtro"
+ es "Fil&ter:", "Fil&tro:"
+ es "&Green", "&Verde"
+ es "Hi", "Hola"
+ es "Hide Console", "Esconder la consola"
+ es "&Ignore", "&Ignorar"
+ es "Invalid file name \"%1\$s\".", "Nombre de archivo inv\\u00e1lido \"%1\$s\"."
+ es "Log Files", "Ficheros de traza"
+ es "&No", "&No"
+ es "&OK", "&OK"
+ es "Ok", "Ok"
+ es "Open", "Abrir"
+ es "&Open", "&Abrir"
+ es "Open Multiple Files", "Abrir m\\u00faltiples archivos"
+ es "Paste", "Pegar"
+ es "Quit", "Abandonar"
+ es "&Red", "&Rojo"
+ es "Replace existing file?", "Reemplazar el archivo existente?"
+ es "&Retry", "&Reintentar"
+ es "&Save", "&Salvar"
+ es "Save As", "Salvar como"
+ es "Save To Log", "Salvar al archivo de traza"
+ es "Select Log File", "Elegir un archivo de traza"
+ es "Select a file to source", "Seleccionar un archivo a evaluar"
+ es "&Selection:", "&Selecci\\u00f3n:"
+ es "Skip Messages", "Omitir los mensajes"
+ es "Source...", "Evaluar..."
+ es "Tcl Scripts", "Scripts Tcl"
+ es "Tcl for Windows", "Tcl para Windows"
+ es "Text Files", "Archivos de texto"
+ es "&Yes", "&S\\u00ed"
+ es "abort", "abortar"
+ es "blue", "azul"
+ es "cancel", "cancelar"
+ es "extension", "extensi\\u00f3n"
+ es "extensions", "extensiones"
+ es "green", "verde"
+ es "ignore", "ignorar"
+ es "ok", "ok"
+ es "red", "rojo"
+ es "retry", "reintentar"
+ es "yes", "s\\u00ed"
+}
diff --git a/ext/tk/sample/msgs_rb/fr.msg b/ext/tk/sample/msgs_rb/fr.msg
new file mode 100644
index 0000000000..ea85cf1a39
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/fr.msg
@@ -0,0 +1,84 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ fr 'Application Error', "Erreur d'application"
+ fr 'Blue', 'Bleu'
+ fr 'Color', 'Couleur'
+ fr 'Delete', 'Effacer'
+ fr 'Error', 'Erreur'
+ fr 'Exit', 'Quitter'
+ fr 'Green', 'Vert'
+ fr 'Red', 'Rouge'
+ fr 'blue', 'bleu'
+ fr 'green', 'vert'
+ fr 'red', 'rouge'
+}
+
+TkMsgCatalog.new('::tk') {
+ fr '&Abort', '&Annuler'
+ fr 'About...', '\u00c0 propos...'
+ fr 'All Files', 'Tous les fichiers'
+ fr 'Application Error', "Erreur d'application"
+ fr '&Blue', '&Bleu'
+ fr '&Cancel', '&Annuler'
+ fr 'Cannot change to the directory "%1\$s".' "\n" 'Permission denied.', 'Impossible d\'acc\u00e9der au r\u00e9pertoire "%1\$s".' "\n" 'Permission refus\u00e9e.'
+ fr 'Choose Directory', 'Choisir r\u00e9pertoire'
+ fr 'Clear', 'Effacer'
+ fr 'Color', 'Couleur'
+ fr 'Console'
+ fr 'Copy', 'Copier'
+ fr 'Cut', 'Couper'
+ fr 'Delete', 'Effacer'
+ fr 'Details >>', 'D\u00e9tails >>'
+ fr 'Directory "%1\$s" does not exist.', 'Le r\u00e9pertoire "%1\$s" n\'existe pas.'
+ fr '&Directory:', '&R\u00e9pertoire:'
+ fr 'Error: %1\$s', 'Erreur: %1\$s'
+ fr 'Exit', 'Quitter'
+ fr 'File "%1\$s" already exists.' "\n" 'Do you want to overwrite it?', 'Le fichier "%1\$s" existe d\u00e9j\u00e0.' "\n" 'Voulez-vous l\'\u00e9craser?'
+ fr 'File "%1\$s" already exists.' "\n\n", 'Le fichier "%1\$s" existe d\u00e9j\u00e0.' "\n\n"
+ fr 'File "%1\$s" does not exist.', 'Le fichier "%1\$s" n\'existe pas.'
+ fr 'File &name:', '&Nom de fichier:'
+ fr 'File &names:', '&Noms de fichiers:'
+ fr 'Files of &type:', '&Type de fichiers:'
+ fr 'Fi&les:', 'Fich&iers:'
+ fr '&Filter', '&Filtre'
+ fr 'Fil&ter:', 'Fil&tre:'
+ fr '&Green', '&Vert'
+ fr 'Hi', 'Salut'
+ fr 'Hide Console', 'Cacher la Console'
+ fr '&Ignore', '&Ignorer'
+ fr 'Invalid file name "%1\$s".', 'Nom de fichier invalide "%1\$s".'
+ fr 'Log Files', 'Fichiers de trace'
+ fr '&No', '&Non'
+ fr '&OK'
+ fr 'Ok'
+ fr 'Open', 'Ouvrir'
+ fr '&Open', '&Ouvrir'
+ fr 'Open Multiple Files', 'Ouvrir plusieurs fichiers'
+ fr 'Paste', 'Coller'
+ fr 'Quit', 'Quitter'
+ fr '&Red', '&Rouge'
+ fr 'Replace existing file?', 'Remplacer le fichier existant?'
+ fr '&Retry', '&R\u00e9-essayer'
+ fr '&Save', '&Sauvegarder'
+ fr 'Save As', 'Sauvegarder sous'
+ fr 'Save To Log', 'Sauvegarde au fichier de trace'
+ fr 'Select Log File', 'Choisir un fichier de trace'
+ fr 'Select a file to source', 'Choisir un fichier \u00e0 \u00e9valuer'
+ fr '&Selection:', '&S\u00e9lection:'
+ fr 'Skip Messages', 'Omettre les messages'
+ fr 'Source...', '\u00c9valuer...'
+ fr 'Tcl Scripts', 'Scripts Tcl'
+ fr 'Tcl for Windows', 'Tcl pour Windows'
+ fr 'Text Files', 'Fichiers texte'
+ fr '&Yes', '&Oui'
+ fr 'abort', 'abandonner'
+ fr 'blue', 'bleu'
+ fr 'cancel', 'annuler'
+ fr 'extension'
+ fr 'extensions'
+ fr 'green', 'vert'
+ fr 'ignore', 'ignorer'
+ fr 'ok'
+ fr 'red', 'rouge'
+ fr 'retry', 'r\u00e9essayer'
+ fr 'yes', 'oui'
+}
diff --git a/ext/tk/sample/msgs_rb/it.msg b/ext/tk/sample/msgs_rb/it.msg
new file mode 100644
index 0000000000..a180bdbd99
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/it.msg
@@ -0,0 +1,84 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ it "Application Error", "Errore dell' applicazione"
+ it "Blue", "Blu"
+ it "Color", "Colore"
+ it "Delete", "Incolla"
+ it "Error", "Errore"
+ it "Exit", "Esci"
+ it "Green", "Verde"
+ it "Red", "Rosso"
+ it "blue", "blu"
+ it "green", "verde"
+ it "red", "rosso"
+}
+
+TkMsgCatalog.new('::tk') {
+ it "&Abort", "&Interrompi"
+ it "About...", "Informazioni ..."
+ it "All Files", "Tutti i file"
+ it "Application Error", "Errore dell' applicazione"
+ it "&Blue", "&Blu"
+ it "&Cancel", "&Annulla"
+ it "Cannot change to the directory \"%1\$s\".\nPermission denied.", "Impossibile accedere alla directory \"%1\$s\".\nPermesso negato."
+ it "Choose Directory", "Scegli directory"
+ it "Clear", "Azzera"
+ it "Color", "Colore"
+ it "Console"
+ it "Copy", "Copia"
+ it "Cut", "Taglia"
+ it "Delete", "Incolla"
+ it "Details >>", "Dettagli >>"
+ it "Directory \"%1\$s\" does not exist.", "La directory \"%1\$s\" non esiste."
+ it "&Directory:"
+ it "Error: %1\$s", "Errore: %1\$s"
+ it "Exit", "Esci"
+ it "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "Il file \"%1\$s\" esiste gi\\u00e0.\nVuoi sovrascriverlo?"
+ it "File \"%1\$s\" already exists.\n\n", "Il file \"%1\$s\" esiste gi\\u00e0.\n\n"
+ it "File \"%1\$s\" does not exist.", "Il file \"%1\$s\" non esiste."
+ it "File &name:", "&Nome del file:"
+ it "File &names:", "&Nomi dei file:"
+ it "Files of &type:", "File di &tipo:"
+ it "Fi&les:", "Fi&le:"
+ it "&Filter", "&Filtro"
+ it "Fil&ter:", "Fil&tro:"
+ it "&Green", "&Verde"
+ it "Hi", "Salve"
+ it "Hide Console", "Nascondi la console"
+ it "&Ignore", "&Ignora"
+ it "Invalid file name \"%1\$s\".", "Nome di file non valido \"%1\$s\"."
+ it "Log Files", "File di log"
+ it "&No"
+ it "&OK"
+ it "Ok"
+ it "&Open", "A&pri"
+ it "Open", "Apri"
+ it "Open Multiple Files", "Apri file multipli"
+ it "Paste", "Incolla"
+ it "Quit", "Esci"
+ it "&Red", "&Rosso"
+ it "Replace existing file?", "Sostituisci il file esistente?"
+ it "&Retry", "&Riprova"
+ it "&Save", "&Salva"
+ it "Save As", "Salva come"
+ it "Save To Log", "Salva il log"
+ it "Select Log File", "Scegli un file di log"
+ it "Select a file to source", "Scegli un file da eseguire"
+ it "&Selection:", "&Selezione:"
+ it "Skip Messages", "Salta i messaggi"
+ it "Source...", "Esegui..."
+ it "Tcl Scripts", "Scripts Tcl"
+ it "Tcl for Windows", "Tcl per Windows"
+ it "Text Files", "File di testo"
+ it "&Yes", "&Si"
+ it "abort", "interrompi"
+ it "blue", "blu"
+ it "cancel", "annulla"
+ it "extension", "estensione"
+ it "extensions", "estensioni"
+ it "green", "verde"
+ it "ignore", "ignora"
+ it "ok"
+ it "red", "rosso"
+ it "retry", "riprova"
+ it "yes", "si"
+}
diff --git a/ext/tk/sample/msgs_rb/ja.msg b/ext/tk/sample/msgs_rb/ja.msg
new file mode 100644
index 0000000000..40587c1f1d
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/ja.msg
@@ -0,0 +1,13 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ ja 'Application Error', '\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30A8\u30E9\u30FC'
+ ja 'Blue', '\u9752'
+ ja 'Color', '\u80CC\u666F\u8272'
+ ja 'Delete', '\u6D88\u53BB'
+ ja 'Error', '\u30A8\u30E9\u30FC'
+ ja 'Exit', '\u7D42\u4E86'
+ ja 'Green', '\u7DD1'
+ ja 'Red', '\u8D64'
+ ja 'blue', '\u9752'
+ ja 'green', '\u7DD1'
+ ja 'red', '\u8D64'
+}
diff --git a/ext/tk/sample/msgs_rb/nl.msg b/ext/tk/sample/msgs_rb/nl.msg
new file mode 100644
index 0000000000..24e41dae86
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/nl.msg
@@ -0,0 +1,123 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ nl "Application Error", "Toepassingsfout"
+ nl "Blue", "Blauw"
+ nl "Color", "Kleur"
+ nl "Delete", "Wissen"
+ nl "Error", "Fout"
+ nl "Exit", "Be\\u00ebindigen"
+ nl "Green", "Groen"
+ nl "Red", "Rood"
+ nl "blue", "blauw"
+ nl "green", "groen"
+ nl "red", "rood"
+}
+
+TkMsgCatalog.new('::tk') {
+ nl "\"%1\$s\" must be an absolute pathname", "\"%1\$s\" moet een absolute pad-naam zijn"
+ nl "%1\$s is not a toplevel window", "%1\$s is geen toplevel window"
+ nl ", or", ", of"
+ nl "-default, -icon, -message, -parent, -title, or -type", "-default, -icon, -message, -parent, -title, of -type"
+ nl "-initialdir, -mustexist, -parent, or -title", "-initialdir, -mustexist, -parent, of -title"
+ nl "&Abort", "&Afbreken"
+ nl "About...", "Over..."
+ nl "All Files", "Alle Bestanden"
+ nl "Application Error", "Toepassingsfout"
+ nl "&Blue", "&Blauw"
+ nl "&Cancel", "&Annuleren"
+ nl "Cannot change to the directory \"%1\$s\".\nPermission denied.", "Kan niet naar map \"%1\$s\" gaan.\nU heeft hiervoor geen toestemming."
+ nl "Choose Directory", "Kies map"
+ nl "Clear", "Wissen"
+ nl "Clear entry, Press OK; Enter %1\$s, press OK", "Wis veld, Druk op OK; typ %1\$s in, druk op OK"
+ nl "&Clear Console", "&Wis Console"
+ nl "Color", "Kleur"
+ nl "Console"
+ nl "Copy", "Kopi\\u00ebren"
+ nl "Cut", "Knippen"
+ nl "Delete", "Wissen"
+ nl "Details"
+ nl "Details >>"
+ nl "Directory \"%1\$s\" does not exist.", "Map \"%1\$s\" bestaat niet."
+ nl "&Directory:", "&Map:"
+ nl "Edit", "Bewerken"
+ nl "Enter \"%1\$s\", press OK", "Typ \"%1\$s\", druk op OK"
+ nl "Enter \"%1\$s\", press OK, enter \"%2\$s\", press OK", "Typ \"%1\$s\", druk op OK, typ \"%2\$s\", druk op OK"
+ nl "Error: %1\$s", "Fout: %1\$s"
+ nl "Exit", "Be\\u00ebindigen"
+ nl "File", "Bestand"
+ nl "File \"%1\$s\" already exists.\n\n", "Bestand \"%1\$s\" bestaat al.\n\n"
+ nl "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "Bestand \"%1\$s\" bestaat al.\nWilt u het overschrijven?"
+ nl "File \"%1\$s\" does not exist.", "Bestand \"%1\$s\" bestaat niet."
+ nl "File &name:", "Bestands&naam:"
+ nl "File &names:", "Bestands&namen:"
+ nl "Files of &type:", "Bestanden van het &type:"
+ nl "Fi&les:", "&Bestanden:"
+ nl "&Filter"
+ nl "Fil&ter:"
+ nl "&Green", "&Groen"
+ nl "Hi", "H\\u00e9"
+ nl "Hide Console", "Verberg Console"
+ nl "&Ignore", "&Negeren"
+ nl "Invalid file name \"%1\$s\".", "Ongeldige bestandsnaam \"%1\$s\"."
+ nl "Log Files", "Log Bestanden"
+ nl "&No", "&Nee"
+ nl "&OK"
+ nl "Ok"
+ nl "&Open", "&Openen"
+ nl "Open", "Openen"
+ nl "Open Multiple Files", "Open meerdere bestanden"
+ nl "Paste", "Plakken"
+ nl "Please press %1\$s", "Druk op %1\$s, A.U.B."
+ nl "Please press ok", "Druk op ok, A.U.B."
+ nl "Press Cancel", "Druk op Annuleren"
+ nl "Press Ok", "Druk op Ok"
+ nl "Quit", "Stoppen"
+ nl "&Red", "&Rood"
+ nl "Replace existing file?", "Vervang bestaand bestand?"
+ nl "&Retry", "&Herhalen"
+ nl "&Save", "Op&slaan"
+ nl "Save As", "Opslaan als"
+ nl "Save To Log", "Opslaan naar Log"
+ nl "Select Log File", "Selecteer Log bestand"
+ nl "Select a file to source", "Selecteer bronbestand"
+ nl "&Selection:", "&Selectie:"
+ nl "Skip Messages", "Berichten overslaan"
+ nl "Source...", "Bron..."
+ nl "Tcl Scripts"
+ nl "Tcl for Windows", "Tcl voor Windows"
+ nl "Text Files", "Tekstbestanden"
+ nl "&Yes", "&Ja"
+ nl "abort", "afbreken"
+ nl "abort, retry, ignore, ok, cancel, no, or yes", "afbreken, opnieuw, negeren, ok, annuleren, nee, of ja"
+ nl "abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel", "abortretryignore, ok, okcancel, retrycancel, yesno, of yesnocancel"
+ nl "bad %1\$s value \"%2\$s\": must be %3\$s", "verkeerde %1\$s waarde \"%2\$s\": moet zijn %3\$s"
+ nl "bad file type \"%1\$s\", should be", "verkeerd bestandstype \"%1\$s\", moet zijn"
+ nl "bad option \"%1\$s\": should be %2\$s", "verkeerde optie \"%1\$s\": moet zijn %2\$s"
+ nl "bad window path name \"%1\$s\"", "verkeerde window-padnaam \"%1\$s\""
+ nl "blue", "blauw"
+ nl "can't post %1\$s: it isn't a descendant of %2\$s (this is a new requirement in Tk versions 3.0 and later)", "kan %1\$s niet verzenden: het is geen afstammeling van %2\$s (dit is een nieuwe eis in Tk versies 3.0 en later)"
+ nl "cancel", "annuleren"
+ nl "default button index greater than number of buttons specified for tk_dialog", "default knop index is groter dan het aantal knoppen beschikbaar voor tk_dialog"
+ nl "display name to use (current one otherwise)", "te gebruiken schermnaam (anders huidige scherm)"
+ nl "error, info, question, or warning", "error, info, question, of warning"
+ nl "extension"
+ nl "extensions"
+ nl "focus group \"%1\$s\" doesn't exist", "focusgroep \"%1\$s\" bestaat niet"
+ nl "green", "groen"
+ nl "history event %1\$s"
+ nl "ignore", "negeren"
+ nl "invalid default button \"%1\$s\"", "ongeldige default knop \"%1\$s\""
+ nl "macType"
+ nl "macTypes"
+ nl "must specify a background color", "een achtergrondkleur is verplicht"
+ nl "name of the slave interpreter", "naam van de slaaf-interpreter"
+ nl "no winfo screen . nor env(DISPLAY)", "geen winfo scherm . noch env(DISPLAY)"
+ nl "ok"
+ nl "red", "rood"
+ nl "retry", "opnieuw"
+ nl "should contain 5 or 4 elements", "moet 4 of 5 elementen bevatten"
+ nl "spec"
+ nl "tk_chooseDirectory command", "tk_chooseDirectory opdracht"
+ nl "tk_chooseDirectory command, cancel gives null", "tk_chooseDirectory opdracht, annuleren geeft lege waarde"
+ nl "tk_chooseDirectory command, initialdir", "tk_chooseDirectory opdracht, initi\\u00eble map"
+ nl "yes", "ja"
+}
diff --git a/ext/tk/sample/msgs_rb/pl.msg b/ext/tk/sample/msgs_rb/pl.msg
new file mode 100644
index 0000000000..0b3b4445c2
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/pl.msg
@@ -0,0 +1,87 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ pl 'Application Error', 'Bl\u0105d w Programie'
+ pl 'Blue', 'Niebieski'
+ pl 'Color', 'Kolor'
+ pl 'Delete', 'Usu\u0144'
+ pl 'Error', 'B\u0142\u0105d'
+ pl 'Exit', 'Zako\u0144cz'
+ pl 'Green', 'Zielony'
+ pl 'Red', 'Czerwonz'
+ pl 'blue', 'niebieski'
+ pl 'green', 'zielony'
+ pl 'red', 'czerwony'
+}
+
+TkMsgCatalog.new('::tk') {
+ pl '&Abort', '&Anuluj'
+ pl '&About...', 'O Programie...'
+ pl 'All Files', 'Wszystkie pliki'
+ pl 'Application Error', 'Bl\u0105d w Programie'
+ pl '&Blue', '&Niebieski'
+ pl '&Cancel', '&Anuluj'
+ pl 'Cannot change to the directory "%1\$s".' "\n" 'Permission denied.', 'Katalog "%1\$s" nie mo\u017ce zosta\u0107 odczytany lub nie istnieje.'
+ pl 'Choose Directory', 'Wybierz katalog'
+ pl '&Clear', '&Wyczy\u015b\u0107'
+ pl '&Clear Console', '&Wyczy\u015b\u0107 konsol\u0119'
+ pl 'Color', 'Kolor'
+ pl 'Console', 'Konsola'
+ pl '&Copy', '&Kopiuj'
+ pl 'Cu&t', '&Wytnij'
+ pl '&Delete', '&Usu\u0144'
+ pl 'Details >>', 'Detale >>'
+ pl 'Directory "%1\$s" does not exist.', 'Katalog "%1\$s" nie istniej.'
+ pl '&Directory:', '&Katalog:'
+ pl '&Edit', '&Edytuj'
+ pl 'Error: %1\$s', 'B\u0142\u0105d: %1\$s'
+ pl 'E&xit', '&Zako\u0144cz'
+ pl '&File', '&Plik'
+ pl 'File "%1\$s" already exists.' "\n" 'Do you want to overwrite it?', 'Plik "%1\$s" ju\u017c istnieje.' "\n" 'Czy chcesz go zast\u0105pi\u0107?'
+ pl 'File "%1\$s" already exists.' "\n\n", 'Plik "%1\$s" ju\u017c istnieje. ' "\n\n"
+ pl 'File "%1\$s" does not exist.', 'Plik "%1\$s" nie istnieje.'
+ pl 'File &name:', 'Nazwa &pliku:'
+ pl 'File &names:', 'Nazwy &plik\u00f3w:'
+ pl 'Files of &type:', 'Pliki &typu:'
+ pl 'Fi&les:', 'Pli&ki:'
+ pl '&Filter', '&Filter'
+ pl 'Fil&ter:', '&Filter:'
+ pl '&Green', '&Zielony'
+ pl '&Help', '&Pomoc'
+ pl 'Hi', 'Witaj'
+ pl '&Hide Console', '&Schowaj konsol\u0119'
+ pl '&Ignore', '&Ignoruj'
+ pl 'Invalid file name "%1\$s".', 'Niew\u0142a\u015bciwa nazwa pliku "%1\$s".'
+ pl 'Log Files', 'Protoko\u0142uj'
+ pl '&No', '&Nie'
+ pl 'OK'
+ pl 'Ok'
+ pl 'Open', 'Wczytaj'
+ pl '&Open', '&Wczytaj'
+ pl 'Open Multiple Files', 'Wczytuj wiele plik\u00f3w'
+ pl 'P&aste', '&Wklej'
+ pl '&Quit', '&Zako\u0144cz'
+ pl '&Red', '&Czerwonz'
+ pl 'Replace existing file?', 'Czy zost\u0105pi\u0107 instniej\u0105cy plik?'
+ pl '&Retry', '&Powt\u00f3rz'
+ pl '&Save', '&Zapisz'
+ pl 'Save As', 'Zapisz jako'
+ pl 'Save To Log', 'Wpisz do protoko\u0142u'
+ pl 'Select Log File', 'Wybierz plik proko\u0142u'
+ pl 'Select a file to source', 'Wybierz plik do wykonania'
+ pl '&Selection:', '&Wyb\u00f3r:'
+ pl 'Skip Messages', 'Omi\u0144 pozosta\u0142e komunikaty'
+ pl '&Source...', '&Kod \u017ar\u00f3d\u0142owy...'
+ pl 'Tcl Scripts', 'Tcl-skrypty'
+ pl 'Tcl for Windows', 'Tcl dla Okienek (Windows)'
+ pl 'Text Files', 'Pliki Tekstowe'
+ pl '&Yes', '&Tak'
+ pl 'abort', 'zako\u0144cz'
+ pl 'blue', 'niebieski'
+ pl 'cancel', 'anuluj'
+ pl 'extension', 'rozszerzenie'
+ pl 'extensions', 'rozszerzenia'
+ pl 'green', 'zielony'
+ pl 'ignore', 'ignoruj'
+ pl 'red', 'czerwony'
+ pl 'retry', 'potw\u00f3rz'
+ pl 'yes', 'tak'
+}
diff --git a/ext/tk/sample/msgs_rb/ru.msg b/ext/tk/sample/msgs_rb/ru.msg
new file mode 100644
index 0000000000..752cd42619
--- /dev/null
+++ b/ext/tk/sample/msgs_rb/ru.msg
@@ -0,0 +1,87 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ ru 'Application Error', '\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435'
+ ru 'Blue', ' \u0413\u043e\u043b\u0443\u0431\u043e\u0439'
+ ru 'Color', '\u0426\u0432\u0435\u0442'
+ ru 'Delete', '\u0423\u0434\u0430\u043b\u0438\u0442\u044c'
+ ru 'Error', '\u041e\u0448\u0438\u0431\u043a\u0430'
+ ru 'Exit', '\u0412\u044b\u0445\u043e\u0434'
+ ru 'Green', '\u0417\u0435\u043b\u0435\u043d\u044b\u0439'
+ ru 'Red', '\u041a\u0440\u0430\u0441\u043d\u044b\u0439'
+ ru 'blue', ' \u0433\u043e\u043b\u0443\u0431\u043e\u0439'
+ ru 'green', ' \u0437\u0435\u043b\u0435\u043d\u044b\u0439'
+ ru 'red', ' \u043a\u0440\u0430\u0441\u043d\u044b\u0439'
+}
+
+TkMsgCatalog.new('::tk') {
+ ru '&Abort', '&\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c'
+ ru 'About...', '\u041f\u0440\u043e...'
+ ru 'All Files', '\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b'
+ ru 'Application Error', '\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435'
+ ru '&Blue', ' &\u0413\u043e\u043b\u0443\u0431\u043e\u0439'
+ ru '&Cancel', '\u041e\u0442&\u043c\u0435\u043d\u0430'
+ ru 'Cannot change to the directory "%1\$s".' "\n" 'Permission denied.' \
+ '\u041d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 "%1\$s".' "\n" '\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430'
+ ru 'Choose Directory', '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433'
+ ru 'Clear', '\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c'
+ ru 'Color', '\u0426\u0432\u0435\u0442'
+ ru 'Console', '\u041a\u043e\u043d\u0441\u043e\u043b\u044c'
+ ru 'Copy', '\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c'
+ ru 'Cut', '\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c'
+ ru 'Delete', '\u0423\u0434\u0430\u043b\u0438\u0442\u044c'
+ ru 'Details >>', '\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 >>'
+ ru 'Directory "%1\$s" does not exist.', '\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 "%1\$s" \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.'
+ ru '&Directory:', '&\u041a\u0430\u0442\u0430\u043b\u043e\u0433:'
+ ru 'Error: %1\$s', '\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s'
+ ru 'Exit', '\u0412\u044b\u0445\u043e\u0434'
+ ru 'File "%1\$s" already exists.' "\n" 'Do you want to overwrite it?' \
+ '\u0424\u0430\u0439\u043b "%1\$s" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.' "\n" '\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e?'
+ ru 'File "%1\$s" already exists.' "\n\n", '\u0424\u0430\u0439\u043b "%1\$s" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.' "\n\n"
+ ru 'File "%1\$s" does not exist.', '\u0424\u0430\u0439\u043b "%1\$s" \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d.'
+ ru 'File &name:', '&\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430:'
+ ru 'File &names:', '&\u0418\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432:'
+ ru 'Files of &type:', '&\u0422\u0438\u043f \u0444\u0430\u0439\u043b\u043e\u0432:'
+ ru 'Fi&les:', '\u0424\u0430\u0439&\u043b\u044b:'
+ ru '&Filter', '&\u0424\u0438\u043b\u044c\u0442\u0440'
+ ru 'Fil&ter:', '\u0424\u0438\u043b\u044c&\u0442\u0440:'
+ ru '&Green', ' &\u0417\u0435\u043b\u0435\u043d\u044b\u0439'
+ ru 'Hi', '\u041f\u0440\u0438\u0432\u0435\u0442'
+ ru 'Hide Console', '\u0421\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c'
+ ru '&Ignore', '&\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c'
+ ru 'Invalid file name "%1\$s".', '\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 "%1\$s".'
+ ru 'Log Files', '\u0424\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u0430'
+ ru '&No', '&\u041d\u0435\u0442'
+ ru '&OK', '&\u041e\u041a'
+ ru 'Ok', '\u0414\u0430'
+ ru 'Open', '\u041e\u0442\u043a\u0440\u044b\u0442\u044c'
+ ru '&Open', '&\u041e\u0442\u043a\u0440\u044b\u0442\u044c'
+ ru 'Open Multiple Files', '\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432'
+ ru 'Paste', '\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c'
+ ru 'Quit', '\u0412\u044b\u0445\u043e\u0434'
+ ru '&Red', ' &\u041a\u0440\u0430\u0441\u043d\u044b\u0439'
+ ru 'Replace existing file?', '\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b?'
+ ru '&Retry', '&\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c'
+ ru '&Save', '&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c'
+ ru 'Save As', '\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a'
+ ru 'Save To Log', '\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b'
+ ru 'Select Log File', '\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b'
+ ru 'Select a file to source', '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438'
+ ru '&Selection:', '&Selection:'
+ ru 'Skip Messages', '\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f'
+ ru 'Source...', '\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b...'
+ ru 'Tcl Scripts', '\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 TCL'
+ ru 'Tcl for Windows', 'TCL \u0434\u043b\u044f Windows'
+ ru 'Text Files', '\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b'
+ ru '&Yes', '&\u0414\u0430'
+ ru 'abort', '\u043e\u0442\u043c\u0435\u043d\u0430'
+ ru 'blue', ' \u0433\u043e\u043b\u0443\u0431\u043e\u0439'
+ ru 'cancel', '\u043e\u0442\u043c\u0435\u043d\u0430'
+ ru 'extension', '\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435'
+ ru 'extensions', '\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f'
+ ru 'green', ' \u0437\u0435\u043b\u0435\u043d\u044b\u0439'
+ ru 'ignore', '\u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c'
+ ru 'ok', '\u043e\u043a'
+ ru 'red', ' \u043a\u0440\u0430\u0441\u043d\u044b\u0439'
+ ru 'retry', '\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c'
+ ru 'yes', '\u0434\u0430'
+}
+
diff --git a/ext/tk/sample/msgs_rb2/README b/ext/tk/sample/msgs_rb2/README
new file mode 100644
index 0000000000..f6a904b3b6
--- /dev/null
+++ b/ext/tk/sample/msgs_rb2/README
@@ -0,0 +1,5 @@
+Message catalogs in this directory are written in encodings except
+UTF-8. As if you have a trouble to edit UTF-8 text, you can write
+message catalogs in your familier encoding.
+
+Please see '../msgs_rb/README' too.
diff --git a/ext/tk/sample/msgs_rb2/de.msg b/ext/tk/sample/msgs_rb2/de.msg
new file mode 100644
index 0000000000..0d6c82d9e5
--- /dev/null
+++ b/ext/tk/sample/msgs_rb2/de.msg
@@ -0,0 +1,88 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ de 'Application Error', 'Applikationsfehler'
+ de 'Blue', 'Blau'
+ de 'Color', 'Farbe'
+ de 'Delete', 'Lschen', 'iso8859-1'
+ de 'Error', 'Fehler'
+ de 'Exit', 'Ende'
+ de 'Green', 'Grn', 'iso8859-1'
+ de 'Red', 'Rot'
+ de 'blue', 'blau'
+ de 'green', 'grn', 'iso8859-1'
+ de 'red', 'rot'
+}
+
+TkMsgCatalog.new('::tk') {
+ de "&Abort", "&Abbruch"
+ de "&About...", "&ber...", 'iso8859-1'
+ de "All Files", "Alle Dateien"
+ de "Application Error", "Applikationsfehler"
+ de "&Blue", "&Blau"
+ de "&Cancel", "&Abbruch"
+ de "Cannot change to the directory \"%1\$s\".\nPermission denied.", "Kann nicht in das Verzeichnis \"%1\$s\" wechseln.\nKeine Rechte vorhanden."
+ de "Choose Directory", "Whle Verzeichnis", 'iso8859-1'
+ de "&Clear", "&Rcksetzen", 'iso8859-1'
+ de "&Clear Console", "&Konsole lschen", 'iso8859-1'
+ de "Color", "Farbe"
+ de "Console", "Konsole"
+ de "&Copy", "&Kopieren"
+ de "Cu&t", "Aus&schneiden"
+ de '&Delete', '&Lschen', 'iso8859-1'
+ de "Details >>"
+ de "Directory \"%1\$s\" does not exist.", "Das Verzeichnis \"%1\$s\" existiert nicht."
+ de "&Directory:", "&Verzeichnis:"
+ de "&Edit", "&Bearbieten"
+ de "Error: %1\$s", "Fehler: %1\$s"
+ de "E&xit", "&Ende"
+ de "&File", "&Datei"
+ de "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "Die Datei \"%1\$s\" ist bereits vorhanden.\nWollen sie diese Datei berschreiben ?", 'iso8859-1'
+ de "File \"%1\$s\" already exists.\n\n", "Die Datei \"%1\$s\" ist bereits vorhanden.\n\n"
+ de "File \"%1\$s\" does not exist.", "Die Datei \"%1\$s\" existiert nicht."
+ de "File &name:", "Datei&name:"
+ de "File &names:", "Datei&namen:"
+ de "Files of &type:", "Dateien des &Typs:"
+ de "Fi&les:", "Dat&eien:"
+ de "&Filter"
+ de "Fil&ter:"
+ de '&Green', '&Grn', 'iso8859-1'
+ de "&Help", "&Hilfe"
+ de "Hi", "Hallo"
+ de "&Hide Console", "&Konsole unsichtbar machen"
+ de "&Ignore", "&Ignorieren"
+ de "Invalid file name \"%1\$s\".", "Ungltiger Dateiname \"%1\$s\".", 'iso8859-1'
+ de "Log Files", "Protokolldatei"
+ de "&No", "&Nein"
+ de "OK"
+ de "Ok"
+ de "Open", "ffnen", 'iso8859-1'
+ de "&Open", "&ffnen", 'iso8859-1'
+ de "Open Multiple Files"
+ de "P&aste", "E&infgen", 'iso8859-1'
+ de "&Quit", "&Beenden"
+ de "&Red", "&Rot"
+ de "Replace existing file?", "Existierende Datei ersetzen?"
+ de "&Retry", "&Wiederholen"
+ de "&Save", "&Speichern"
+ de "Save As", "Speichern unter"
+ de "Save To Log", "In Protokoll speichern"
+ de "Select Log File", "Protokolldatei auswhlen", 'iso8859-1'
+ de "Select a file to source", "Auszufhrende Datei auswhlen", 'iso8859-1'
+ de "&Selection:", "Auswah&l:"
+ de "Skip Messages", "Weitere Nachrichten berspringen", 'iso8859-1'
+ de "&Source...", "&Ausfhren...", 'iso8859-1'
+ de "Tcl Scripts", "Tcl-Skripte"
+ de "Tcl for Windows", "Tcl fr Windows", 'iso8859-1'
+ de "Text Files", "Textdateien"
+ de "&Yes", "&Ja"
+ de "abort", "abbrechen"
+ de "blue", "blau"
+ de "cancel", "abbrechen"
+ de "extension", "Erweiterung"
+ de "extensions", "Erweiterungen"
+ de 'green', 'grn', 'iso8859-1'
+ de "ignore", "ignorieren"
+ de "ok"
+ de "red", "rot"
+ de "retry", "wiederholen"
+ de "yes", "ja"
+}
diff --git a/ext/tk/sample/msgs_rb2/ja.msg b/ext/tk/sample/msgs_rb2/ja.msg
new file mode 100644
index 0000000000..54a105b61f
--- /dev/null
+++ b/ext/tk/sample/msgs_rb2/ja.msg
@@ -0,0 +1,85 @@
+TkMsgCatalog.new('::tkmsgcat_demo') {
+ ja 'Application Error', 'アプリケーションエラー', 'utf-8'
+ ja 'Blue', '青', 'utf-8'
+ ja 'Color', '色選択', 'utf-8'
+ ja 'Delete', '消去', 'utf-8'
+ ja 'Error', 'エラー', 'utf-8'
+ ja 'Exit', '終了', 'utf-8'
+ ja 'Green', '緑', 'utf-8'
+ ja 'Red', '赤', 'utf-8'
+ ja 'blue', '青', 'utf-8'
+ ja 'green', '緑', 'utf-8'
+ ja 'red', '赤', 'utf-8'
+}
+
+TkMsgCatalog.new('::tk') {
+ ja "&Abort", '中止', 'utf-8'
+ ja "About..."
+ ja "All Files", 'すべてのファイル', 'utf-8'
+ ja "Application Error", 'アプリケーションエラー', 'utf-8'
+ ja "&Blue", '青', 'utf-8'
+ ja "&Cancel", '取り消し', 'utf-8'
+ ja "Cannot change to the directory \"%1\$s\".\nPermission denied.", "ディレクトリ \"%1\$s\" に変更できません.\n許可がありません.", 'utf-8'
+ ja "Choose Directory", 'ディレクトリを選択', 'utf-8'
+ ja "Clear", '消去', 'utf-8'
+ ja "Color", '色', 'utf-8'
+ ja "Console", 'コンソール', 'utf-8'
+ ja "Copy", 'コピー', 'utf-8'
+ ja "Cut", '切り取り', 'utf-8'
+ ja "Delete", '消去', 'utf-8'
+ ja "Details >>", '詳細 >>', 'utf-8'
+ ja "Directory \"%1\$s\" does not exist.", '"%1$s" というディレクトリは存在しません.', 'utf-8'
+ ja "&Directory:", 'ディレクトリ', 'utf-8'
+ ja "Error: %1\$s"
+ ja "Exit", '終了', 'utf-8'
+ ja "File \"%1\$s\" already exists.\nDo you want to overwrite it?", "\"%1\$s\" というファイルは既に存在しています.\n書き換えますか?", 'utf-8'
+ ja "File \"%1\$s\" already exists.\n\n", "\"%1\$s\" というファイルは既に存在しています.\n\n", 'utf-8'
+ ja "File \"%1\$s\" does not exist.", '"%1$s" というファイルは存在しません.', 'utf-8'
+ ja "File &name:", 'ファイル名', 'utf-8'
+ ja "File &names:", 'ファイル名', 'utf-8'
+ ja "Files of &type:", 'ファイル形式', 'utf-8'
+ ja "Fi&les:", 'ファイル', 'utf-8'
+ ja "&Filter", 'フィルター', 'utf-8'
+ ja "Fil&ter:", 'フィルター', 'utf-8'
+ ja "&Green", '緑', 'utf-8'
+ ja "Hi", 'こんにちは', 'utf-8'
+ ja "Hide Console", 'コンソールを隠す', 'utf-8'
+ ja "&Ignore", '無視', 'utf-8'
+ ja "Invalid file name \"%1\$s\".", '"%1$s" は不正なファイル名です.', 'utf-8'
+ ja "Log Files", 'ログファイル', 'utf-8'
+ ja "&No", 'いいえ', 'utf-8'
+ ja "&OK", '了解', 'utf-8'
+ ja "OK", '了解', 'utf-8'
+ ja "Ok", '了解', 'utf-8'
+ ja "Open", '開く', 'utf-8'
+ ja "&Open", '開く', 'utf-8'
+ ja "Open Multiple Files", '複数のファイルを開く', 'utf-8'
+ ja "Paste", '貼り付け', 'utf-8'
+ ja "Quit", '終了', 'utf-8'
+ ja "&Red", '赤', 'utf-8'
+ ja "Replace existing file?", '既存のファイルを置き換えますか?', 'utf-8'
+ ja "&Retry", '再実行', 'utf-8'
+ ja "&Save", '保存', 'utf-8'
+ ja "Save As", '名前を付けて保存', 'utf-8'
+ ja "Save To Log", 'ログを保存', 'utf-8'
+ ja "Select Log File", 'ログファイルを選択', 'utf-8'
+ ja "Select a file to source", 'ソースファイルを選択', 'utf-8'
+ ja "&Selection:", '選択', 'utf-8'
+ ja "Skip Messages", 'メッセージをとばす', 'utf-8'
+ ja "Source...", 'ソース...', 'utf-8'
+ ja "Tcl Scripts", 'Tcl スクリプト', 'utf-8'
+ ja "Tcl for Windows"
+ ja "Text Files", 'テキストファイル', 'utf-8'
+ ja "&Yes", 'はい', 'utf-8'
+ ja "abort", '中止', 'utf-8'
+ ja "blue", '青', 'utf-8'
+ ja "cancel", '取り消し', 'utf-8'
+ ja "extension", '拡張子', 'utf-8'
+ ja "extensions", '拡張子', 'utf-8'
+ ja "green", '緑', 'utf-8'
+ ja "ignore", '無視', 'utf-8'
+ ja "ok", '了解', 'utf-8'
+ ja "red", '赤', 'utf-8'
+ ja "retry", '再実行', 'utf-8'
+ ja "yes", 'はい', 'utf-8'
+}
diff --git a/ext/tk/sample/msgs_tk/README b/ext/tk/sample/msgs_tk/README
new file mode 100644
index 0000000000..949ee7a896
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/README
@@ -0,0 +1,4 @@
+Almost all of Message-Catalog files in this directory are quoted
+from Tcl/Tk8.5a1 source archive (only a little are modified for
+'tkmsgcat-load_tk.rb'). Please read the file 'license.terms' in
+this directory (That was included in demo directory of Tcl/Tk8.5a1).
diff --git a/ext/tk/sample/msgs_tk/cs.msg b/ext/tk/sample/msgs_tk/cs.msg
new file mode 100644
index 0000000000..697070985e
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/cs.msg
@@ -0,0 +1,84 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset cs "Application Error" "Chyba programu"
+ ::msgcat::mcset cs "Blue" "Modr\341"
+ ::msgcat::mcset cs "Color" "Barva"
+ ::msgcat::mcset cs "Delete" "Smazat"
+ ::msgcat::mcset cs "Error" "Chyba"
+ ::msgcat::mcset cs "Exit" "Konec"
+ ::msgcat::mcset cs "Green" "Zelen\341"
+ ::msgcat::mcset cs "Red" "\u010cerven\341"
+ ::msgcat::mcset cs "blue" "modr\341"
+ ::msgcat::mcset cs "green" "zelen\341"
+ ::msgcat::mcset cs "red" "\u010derven\341"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset cs "&Abort" "&P\u0159eru\u0161it"
+ ::msgcat::mcset cs "About..." "O programu..."
+ ::msgcat::mcset cs "All Files" "V\u0161echny soubory"
+ ::msgcat::mcset cs "Application Error" "Chyba programu"
+ ::msgcat::mcset cs "&Blue" "&Modr\341"
+ ::msgcat::mcset cs "&Cancel" "&Zru\u0161it"
+ ::msgcat::mcset cs "Cannot change to the directory \"%1\$s\".\nPermission denied." "Nemohu zm\u011bnit atku\341ln\355 adres\341\u0159 na \"%1\$s\".\nP\u0159\355stup odm\355tnut."
+ ::msgcat::mcset cs "Choose Directory" "V\375b\u011br adres\341\u0159e"
+ ::msgcat::mcset cs "Clear" "Smazat"
+ ::msgcat::mcset cs "Color" "Barva"
+ ::msgcat::mcset cs "Console" "Konzole"
+ ::msgcat::mcset cs "Copy" "Kop\355rovat"
+ ::msgcat::mcset cs "Cut" "Vy\u0159\355znout"
+ ::msgcat::mcset cs "Delete" "Smazat"
+ ::msgcat::mcset cs "Details >>" "Detaily >>"
+ ::msgcat::mcset cs "Directory \"%1\$s\" does not exist." "Adres\341\u0159 \"%1\$s\" neexistuje."
+ ::msgcat::mcset cs "&Directory:" "&Adres\341\u0159:"
+ ::msgcat::mcset cs "Error: %1\$s" "Chyba: %1\$s"
+ ::msgcat::mcset cs "Exit" "Konec"
+ ::msgcat::mcset cs "File \"%1\$s\" already exists.\n\n" "Soubor \"%1\$s\" ji\u017e existuje.\n\n"
+ ::msgcat::mcset cs "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Soubor \"%1\$s\" ji\u017e existuje.\nChcete jej p\u0159epsat?"
+ ::msgcat::mcset cs "File \"%1\$s\" does not exist." "Soubor \"%1\$s\" neexistuje."
+ ::msgcat::mcset cs "File &name:" "&Jm\351no souboru:"
+ ::msgcat::mcset cs "File &names:" "&Jm\351na soubor\u016f:"
+ ::msgcat::mcset cs "Files of &type:" "&Typy soubor\u016f:"
+ ::msgcat::mcset cs "Fi&les:" "Sou&bory:"
+ ::msgcat::mcset cs "&Filter" "&Filtr"
+ ::msgcat::mcset cs "Fil&ter:" "Fil&tr:"
+ ::msgcat::mcset cs "&Green" "Ze&len\341"
+ ::msgcat::mcset cs "Hi"
+ ::msgcat::mcset cs "Hide Console" "Skr\375t konsolu"
+ ::msgcat::mcset cs "&Ignore" "&Ignorovat"
+ ::msgcat::mcset cs "Invalid file name \"%1\$s\"." "\u0160patn\351 jm\351no souboru \"%1\$s\"."
+ ::msgcat::mcset cs "Log Files" "Log soubory"
+ ::msgcat::mcset cs "&No" "&Ne"
+ ::msgcat::mcset cs "&OK"
+ ::msgcat::mcset cs "Ok"
+ ::msgcat::mcset cs "Open" "Otev\u0159\355t"
+ ::msgcat::mcset cs "&Open" "&Otev\u0159\355t"
+ ::msgcat::mcset cs "Open Multiple Files" "Otev\u0159\355t v\355ce soubor\u016f"
+ ::msgcat::mcset cs "Paste" "Vlo\u017eit"
+ ::msgcat::mcset cs "Quit" "Skon\u010dit"
+ ::msgcat::mcset cs "&Red" " \u010ce&rven\341"
+ ::msgcat::mcset cs "Replace existing file?" "Nahradit st\341vaj\355c\355 soubor?"
+ ::msgcat::mcset cs "&Retry" "Z&novu"
+ ::msgcat::mcset cs "&Save" "&Ulo\u017eit"
+ ::msgcat::mcset cs "Save As" "Ulo\u017eit jako"
+ ::msgcat::mcset cs "Save To Log" "Ulo\u017eit do logu"
+ ::msgcat::mcset cs "Select Log File" "Vybrat log soubor"
+ ::msgcat::mcset cs "Select a file to source" "Vybrat soubor k nahr\341n\355"
+ ::msgcat::mcset cs "&Selection:" "&V\375b\u011br:"
+ ::msgcat::mcset cs "Skip Messages" "P\u0159esko\u010dit zpr\341vy"
+ ::msgcat::mcset cs "Source..." "Nahr\341t..."
+ ::msgcat::mcset cs "Tcl Scripts" "Tcl skripty"
+ ::msgcat::mcset cs "Tcl for Windows" "Tcl pro Windows"
+ ::msgcat::mcset cs "Text Files" "Textov\351 soubory"
+ ::msgcat::mcset cs "&Yes" "&Ano"
+ ::msgcat::mcset cs "abort" "p\u0159eru\u0161it"
+ ::msgcat::mcset cs "blue" "modr\341"
+ ::msgcat::mcset cs "cancel" "zru\u0161it"
+ ::msgcat::mcset cs "extension" "p\u0159\355pona"
+ ::msgcat::mcset cs "extensions" "p\u0159\355pony"
+ ::msgcat::mcset cs "green" "zelen\341"
+ ::msgcat::mcset cs "ignore" "ignorovat"
+ ::msgcat::mcset cs "ok"
+ ::msgcat::mcset cs "red" "\u010derven\341"
+ ::msgcat::mcset cs "retry" "znovu"
+ ::msgcat::mcset cs "yes" "ano"
+}
diff --git a/ext/tk/sample/msgs_tk/de.msg b/ext/tk/sample/msgs_tk/de.msg
new file mode 100644
index 0000000000..437f2ed9e7
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/de.msg
@@ -0,0 +1,88 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset de "Application Error" "Applikationsfehler"
+ ::msgcat::mcset de "Blue" "Blau"
+ ::msgcat::mcset de "Color" "Farbe"
+ ::msgcat::mcset de "Delete" "L\u00f6schen"
+ ::msgcat::mcset de "Error" "Fehler"
+ ::msgcat::mcset de "Exit" "Ende"
+ ::msgcat::mcset de "Green" "Gr\u00fcn"
+ ::msgcat::mcset de "Red" "Rot"
+ ::msgcat::mcset de "blue" "blau"
+ ::msgcat::mcset de "green" "gr\u00fcn"
+ ::msgcat::mcset de "red" "rot"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset de "&Abort" "&Abbruch"
+ ::msgcat::mcset de "&About..." "&\u00dcber..."
+ ::msgcat::mcset de "All Files" "Alle Dateien"
+ ::msgcat::mcset de "Application Error" "Applikationsfehler"
+ ::msgcat::mcset de "&Blue" "&Blau"
+ ::msgcat::mcset de "&Cancel" "&Abbruch"
+ ::msgcat::mcset de "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kann nicht in das Verzeichnis \"%1\$s\" wechseln.\nKeine Rechte vorhanden."
+ ::msgcat::mcset de "Choose Directory" "W\u00e4hle Verzeichnis"
+ ::msgcat::mcset de "&Clear" "&R\u00fccksetzen"
+ ::msgcat::mcset de "&Clear Console" "&Konsole l\u00f6schen"
+ ::msgcat::mcset de "Color" "Farbe"
+ ::msgcat::mcset de "Console" "Konsole"
+ ::msgcat::mcset de "&Copy" "&Kopieren"
+ ::msgcat::mcset de "Cu&t" "Aus&schneiden"
+ ::msgcat::mcset de "&Delete" "&L\u00f6schen"
+ ::msgcat::mcset de "Details >>"
+ ::msgcat::mcset de "Directory \"%1\$s\" does not exist." "Das Verzeichnis \"%1\$s\" existiert nicht."
+ ::msgcat::mcset de "&Directory:" "&Verzeichnis:"
+ ::msgcat::mcset de "&Edit" "&Bearbieten"
+ ::msgcat::mcset de "Error: %1\$s" "Fehler: %1\$s"
+ ::msgcat::mcset de "E&xit" "&Ende"
+ ::msgcat::mcset de "&File" "&Datei"
+ ::msgcat::mcset de "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Die Datei \"%1\$s\" ist bereits vorhanden.\nWollen sie diese Datei \u00fcberschreiben ?"
+ ::msgcat::mcset de "File \"%1\$s\" already exists.\n\n" "Die Datei \"%1\$s\" ist bereits vorhanden.\n\n"
+ ::msgcat::mcset de "File \"%1\$s\" does not exist." "Die Datei \"%1\$s\" existiert nicht."
+ ::msgcat::mcset de "File &name:" "Datei&name:"
+ ::msgcat::mcset de "File &names:" "Datei&namen:"
+ ::msgcat::mcset de "Files of &type:" "Dateien des &Typs:"
+ ::msgcat::mcset de "Fi&les:" "Dat&eien:"
+ ::msgcat::mcset de "&Filter"
+ ::msgcat::mcset de "Fil&ter:"
+ ::msgcat::mcset de "&Green" "&Gr\u00fcn"
+ ::msgcat::mcset de "&Help" "&Hilfe"
+ ::msgcat::mcset de "Hi" "Hallo"
+ ::msgcat::mcset de "&Hide Console" "&Konsole unsichtbar machen"
+ ::msgcat::mcset de "&Ignore" "&Ignorieren"
+ ::msgcat::mcset de "Invalid file name \"%1\$s\"." "Ung\u00fcltiger Dateiname \"%1\$s\"."
+ ::msgcat::mcset de "Log Files" "Protokolldatei"
+ ::msgcat::mcset de "&No" "&Nein"
+ ::msgcat::mcset de "OK"
+ ::msgcat::mcset de "Ok"
+ ::msgcat::mcset de "Open" "\u00d6ffnen"
+ ::msgcat::mcset de "&Open" "\u00d6&ffnen"
+ ::msgcat::mcset de "Open Multiple Files"
+ ::msgcat::mcset de "P&aste" "E&inf\u00fcgen"
+ ::msgcat::mcset de "&Quit" "&Beenden"
+ ::msgcat::mcset de "&Red" "&Rot"
+ ::msgcat::mcset de "Replace existing file?" "Existierende Datei ersetzen?"
+ ::msgcat::mcset de "&Retry" "&Wiederholen"
+ ::msgcat::mcset de "&Save" "&Speichern"
+ ::msgcat::mcset de "Save As" "Speichern unter"
+ ::msgcat::mcset de "Save To Log" "In Protokoll speichern"
+ ::msgcat::mcset de "Select Log File" "Protokolldatei ausw\u00e4hlen"
+ ::msgcat::mcset de "Select a file to source" "Auszuf\u00fchrende Datei ausw\u00e4hlen"
+ ::msgcat::mcset de "&Selection:" "Auswah&l:"
+ ::msgcat::mcset de "Skip Messages" "Weitere Nachrichten \u00fcberspringen"
+ ::msgcat::mcset de "&Source..." "&Ausf\u00fchren..."
+ ::msgcat::mcset de "Tcl Scripts" "Tcl-Skripte"
+ ::msgcat::mcset de "Tcl for Windows" "Tcl f\u00fcr Windows"
+ ::msgcat::mcset de "Text Files" "Textdateien"
+ ::msgcat::mcset de "&Yes" "&Ja"
+ ::msgcat::mcset de "abort" "abbrechen"
+ ::msgcat::mcset de "blue" "blau"
+ ::msgcat::mcset de "cancel" "abbrechen"
+ ::msgcat::mcset de "extension" "Erweiterung"
+ ::msgcat::mcset de "extensions" "Erweiterungen"
+ ::msgcat::mcset de "green" "gr\u00fcn"
+ ::msgcat::mcset de "ignore" "ignorieren"
+ ::msgcat::mcset de "ok"
+ ::msgcat::mcset de "red" "rot"
+ ::msgcat::mcset de "retry" "wiederholen"
+ ::msgcat::mcset de "yes" "ja"
+}
diff --git a/ext/tk/sample/msgs_tk/el.msg b/ext/tk/sample/msgs_tk/el.msg
new file mode 100644
index 0000000000..ee75af3ced
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/el.msg
@@ -0,0 +1,103 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset el "Application Error" "\u039b\u03ac\u03b8\u03bf\u03c2 \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2"
+ ::msgcat::mcset el "Blue" "\u039c\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "Color" "\u03a7\u03c1\u03ce\u03bc\u03b1"
+ ::msgcat::mcset el "Delete" "\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae"
+ ::msgcat::mcset el "Error" "\u039b\u03ac\u03b8\u03bf\u03c2"
+ ::msgcat::mcset el "Exit" "\u0388\u03be\u03bf\u03b4\u03bf\u03c2"
+ ::msgcat::mcset el "Green" "\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "Red" "\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "blue" "\u03bc\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "green" "\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "red" "\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+}
+
+
+# followings are same to original file included into Tk8.5a1's widget demos.
+
+## Messages for the Greek (Hellenic - "el") language.
+## Please report any changes/suggestions to:
+## petasis@iit.demokritos.gr
+
+namespace eval ::tk {
+ ::msgcat::mcset el "&Abort" "\u03a4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "About..." "\u03a3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac..."
+ ::msgcat::mcset el "All Files" "\u038c\u03bb\u03b1 \u03c4\u03b1 \u0391\u03c1\u03c7\u03b5\u03af\u03b1"
+ ::msgcat::mcset el "Application Error" "\u039b\u03ac\u03b8\u03bf\u03c2 \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2"
+ ::msgcat::mcset el "&Blue" "\u039c\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "&Cancel" "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7"
+ ::msgcat::mcset el \
+"Cannot change to the directory \"%1\$s\".\nPermission denied." \
+"\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u03ba\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5 \u03c3\u03b5 \"%1\$s\".\n\u0397 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9."
+ ::msgcat::mcset el "Choose Directory" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u039a\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5"
+ ::msgcat::mcset el "Clear" "\u039a\u03b1\u03b8\u03b1\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "Color" "\u03a7\u03c1\u03ce\u03bc\u03b1"
+ ::msgcat::mcset el "Console" "\u039a\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1"
+ ::msgcat::mcset el "Copy" "\u0391\u03bd\u03c4\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae"
+ ::msgcat::mcset el "Cut" "\u0391\u03c0\u03bf\u03ba\u03bf\u03c0\u03ae"
+ ::msgcat::mcset el "Delete" "\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae"
+ ::msgcat::mcset el "Details >>" "\u039b\u03b5\u03c0\u03c4\u03bf\u03bc\u03ad\u03c1\u03b5\u03b9\u03b5\u03c2 >>"
+ ::msgcat::mcset el "Directory \"%1\$s\" does not exist." \
+ "\u039f \u03ba\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2 \"%1\$s\" \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9."
+ ::msgcat::mcset el "&Directory:" "&\u039a\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2:"
+ ::msgcat::mcset el "Error: %1\$s" "\u039b\u03ac\u03b8\u03bf\u03c2: %1\$s"
+ ::msgcat::mcset el "Exit" "\u0388\u03be\u03bf\u03b4\u03bf\u03c2"
+ ::msgcat::mcset el \
+ "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.\n\u0398\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03b5\u03c0\u03b9\u03ba\u03b1\u03bb\u03c5\u03c6\u03b8\u03b5\u03af;"
+ ::msgcat::mcset el "File \"%1\$s\" already exists.\n\n" \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.\n\n"
+ ::msgcat::mcset el "File \"%1\$s\" does not exist." \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9."
+ ::msgcat::mcset el "File &name:" "\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5:"
+ ::msgcat::mcset el "File &names:" "\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd:"
+ ::msgcat::mcset el "Files of &type:" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u03c4\u03bf\u03c5 &\u03c4\u03cd\u03c0\u03bf\u03c5:"
+ ::msgcat::mcset el "Fi&les:" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1:"
+ ::msgcat::mcset el "&Filter" "\u03a6\u03af\u03bb\u03c4\u03c1\u03bf"
+ ::msgcat::mcset el "Fil&ter:" "\u03a6\u03af\u03bb\u03c4\u03c1\u03bf:"
+ ::msgcat::mcset el "&Green" "\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "Hi" "\u0393\u03b5\u03b9\u03b1"
+ ::msgcat::mcset el "Hide Console" "\u0391\u03c0\u03cc\u03ba\u03c1\u03c5\u03c8\u03b7 \u03ba\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1\u03c2"
+ ::msgcat::mcset el "&Ignore" "\u0391\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "Invalid file name \"%1\$s\"." \
+ "\u0386\u03ba\u03c5\u03c1\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \"%1\$s\"."
+ ::msgcat::mcset el "Log Files" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "&No" "\u038c\u03c7\u03b9"
+ ::msgcat::mcset el "&OK" "\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "&Ok" "\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "Open" "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1"
+ ::msgcat::mcset el "&Open" "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1"
+ ::msgcat::mcset el "Open Multiple Files" \
+ "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ce\u03bd \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd"
+ ::msgcat::mcset el "Paste" "\u0395\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "Quit" "\u0388\u03be\u03bf\u03b4\u03bf\u03c2"
+ ::msgcat::mcset el "&Red" "\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "Replace existing file?" \
+ "\u0395\u03c0\u03b9\u03ba\u03ac\u03bb\u03c5\u03c8\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03bf\u03bd\u03c4\u03bf\u03c2 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5;"
+ ::msgcat::mcset el "&Retry" "\u03a0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac"
+ ::msgcat::mcset el "&Save" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7"
+ ::msgcat::mcset el "Save As" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03b1\u03bd"
+ ::msgcat::mcset el "Save To Log" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "Select Log File" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "Select a file to source" \
+ "\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03b3\u03b9\u03b1 \u03b5\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7"
+ ::msgcat::mcset el "&Selection:" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae:"
+ ::msgcat::mcset el "Skip Messages" "\u0391\u03c0\u03bf\u03c6\u03c5\u03b3\u03ae \u03bc\u03c5\u03bd\u03b7\u03bc\u03ac\u03c4\u03c9\u03bd"
+ ::msgcat::mcset el "Source..." "\u0395\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7..."
+ ::msgcat::mcset el "Tcl Scripts" "Tcl Scripts"
+ ::msgcat::mcset el "Tcl for Windows" "Tcl \u03b3\u03b9\u03b1 Windows"
+ ::msgcat::mcset el "Text Files" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5"
+ ::msgcat::mcset el "&Yes" "\u039d\u03b1\u03b9"
+ ::msgcat::mcset el "abort" "\u03c4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "blue" "\u03bc\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "cancel" "\u03b1\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7"
+ ::msgcat::mcset el "extension" "\u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7"
+ ::msgcat::mcset el "extensions" "\u03b5\u03c0\u03b5\u03ba\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2"
+ ::msgcat::mcset el "green" "\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "ignore" "\u03b1\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "ok" "\u03b5\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "red" "\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "retry" "\u03c0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac"
+ ::msgcat::mcset el "yes" "\u03bd\u03b1\u03b9"
+}
+
diff --git a/ext/tk/sample/msgs_tk/en.msg b/ext/tk/sample/msgs_tk/en.msg
new file mode 100644
index 0000000000..de586d195e
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/en.msg
@@ -0,0 +1,83 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset en "Application Error"
+ ::msgcat::mcset en "Blue"
+ ::msgcat::mcset en "Color"
+ ::msgcat::mcset en "Delete"
+ ::msgcat::mcset en "Error"
+ ::msgcat::mcset en "Green"
+ ::msgcat::mcset en "Red"
+ ::msgcat::mcset en "blue"
+ ::msgcat::mcset en "green"
+ ::msgcat::mcset en "red"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset en "&Abort"
+ ::msgcat::mcset en "About..."
+ ::msgcat::mcset en "All Files"
+ ::msgcat::mcset en "Application Error"
+ ::msgcat::mcset en "&Blue"
+ ::msgcat::mcset en "&Cancel"
+ ::msgcat::mcset en "Cannot change to the directory \"%1\$s\".\nPermission denied."
+ ::msgcat::mcset en "Choose Directory"
+ ::msgcat::mcset en "Clear"
+ ::msgcat::mcset en "Color"
+ ::msgcat::mcset en "Console"
+ ::msgcat::mcset en "Copy"
+ ::msgcat::mcset en "Cut"
+ ::msgcat::mcset en "Delete"
+ ::msgcat::mcset en "Details >>"
+ ::msgcat::mcset en "Directory \"%1\$s\" does not exist."
+ ::msgcat::mcset en "&Directory:"
+ ::msgcat::mcset en "Error: %1\$s"
+ ::msgcat::mcset en "Exit"
+ ::msgcat::mcset en "File \"%1\$s\" already exists.\nDo you want to overwrite it?"
+ ::msgcat::mcset en "File \"%1\$s\" already exists.\n\n"
+ ::msgcat::mcset en "File \"%1\$s\" does not exist."
+ ::msgcat::mcset en "File &name:"
+ ::msgcat::mcset en "File &names:"
+ ::msgcat::mcset en "Files of &type:"
+ ::msgcat::mcset en "Fi&les:"
+ ::msgcat::mcset en "&Filter"
+ ::msgcat::mcset en "Fil&ter:"
+ ::msgcat::mcset en "&Green"
+ ::msgcat::mcset en "Hi"
+ ::msgcat::mcset en "Hide Console"
+ ::msgcat::mcset en "&Ignore"
+ ::msgcat::mcset en "Invalid file name \"%1\$s\"."
+ ::msgcat::mcset en "Log Files"
+ ::msgcat::mcset en "&No"
+ ::msgcat::mcset en "&OK"
+ ::msgcat::mcset en "Ok"
+ ::msgcat::mcset en "Open"
+ ::msgcat::mcset en "&Open"
+ ::msgcat::mcset en "Open Multiple Files"
+ ::msgcat::mcset en "Paste"
+ ::msgcat::mcset en "Quit"
+ ::msgcat::mcset en "&Red"
+ ::msgcat::mcset en "Replace existing file?"
+ ::msgcat::mcset en "&Retry"
+ ::msgcat::mcset en "&Save"
+ ::msgcat::mcset en "Save As"
+ ::msgcat::mcset en "Save To Log"
+ ::msgcat::mcset en "Select Log File"
+ ::msgcat::mcset en "Select a file to source"
+ ::msgcat::mcset en "&Selection:"
+ ::msgcat::mcset en "Skip Messages"
+ ::msgcat::mcset en "Source..."
+ ::msgcat::mcset en "Tcl Scripts"
+ ::msgcat::mcset en "Tcl for Windows"
+ ::msgcat::mcset en "Text Files"
+ ::msgcat::mcset en "&Yes"
+ ::msgcat::mcset en "abort"
+ ::msgcat::mcset en "blue"
+ ::msgcat::mcset en "cancel"
+ ::msgcat::mcset en "extension"
+ ::msgcat::mcset en "extensions"
+ ::msgcat::mcset en "green"
+ ::msgcat::mcset en "ignore"
+ ::msgcat::mcset en "ok"
+ ::msgcat::mcset en "red"
+ ::msgcat::mcset en "retry"
+ ::msgcat::mcset en "yes"
+}
diff --git a/ext/tk/sample/msgs_tk/en_gb.msg b/ext/tk/sample/msgs_tk/en_gb.msg
new file mode 100644
index 0000000000..1aa5b49380
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/en_gb.msg
@@ -0,0 +1,7 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset en_gb Color Colour
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset en_gb Color Colour
+}
diff --git a/ext/tk/sample/msgs_tk/eo.msg b/ext/tk/sample/msgs_tk/eo.msg
new file mode 100644
index 0000000000..e683cef297
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/eo.msg
@@ -0,0 +1,87 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset eo "Application Error" "Aplikoerraro"
+ ::msgcat::mcset eo "Blue" "Blua"
+ ::msgcat::mcset eo "Color" "Farbo"
+ ::msgcat::mcset eo "Delete" "Forprenu"
+ ::msgcat::mcset eo "Error" "Eraro"
+ ::msgcat::mcset eo "Exit" "Eliru"
+ ::msgcat::mcset eo "Green" "Verda"
+ ::msgcat::mcset eo "Red" "Rosa"
+ ::msgcat::mcset eo "blue" "blua"
+ ::msgcat::mcset eo "green" "verda"
+ ::msgcat::mcset eo "red" "ru\u011da"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset eo "&Abort" "&\u0108esigo"
+ ::msgcat::mcset eo "&About..." "Pri..."
+ ::msgcat::mcset eo "All Files" "\u0108ioj dosieroj"
+ ::msgcat::mcset eo "Application Error" "Aplikoerraro"
+ ::msgcat::mcset eo "&Blue" "&Blua"
+ ::msgcat::mcset eo "&Cancel" "&Rezignu"
+ ::msgcat::mcset eo "Cannot change to the directory \"%1\$s\".\nPermission denied." "Neeble \u0109angi al dosierulon \"%1\$s\".\nVi ne rajtas tion."
+ ::msgcat::mcset eo "Choose Directory" "Elektu Dosierujo"
+ ::msgcat::mcset eo "&Clear" "&Klaru"
+ ::msgcat::mcset eo "&Clear Console" "&Klaru konzolon"
+ ::msgcat::mcset eo "Color" "Farbo"
+ ::msgcat::mcset eo "Console" "Konzolo"
+ ::msgcat::mcset eo "&Copy" "&Kopiu"
+ ::msgcat::mcset eo "Cu&t" "&Enpo\u015digu"
+ ::msgcat::mcset eo "&Delete" "&Forprenu"
+ ::msgcat::mcset eo "Details >>" "Detaloj >>"
+ ::msgcat::mcset eo "Directory \"%1\$s\" does not exist." "La dosierujo \"%1\$s\" ne ekzistas."
+ ::msgcat::mcset eo "&Directory:" "&Dosierujo:"
+ ::msgcat::mcset eo "&Edit" "&Redaktu"
+ ::msgcat::mcset eo "Error: %1\$s" "Eraro: %1\$s"
+ ::msgcat::mcset eo "E&xit" "&Eliru"
+ ::msgcat::mcset eo "&File" "&Dosiero"
+ ::msgcat::mcset eo "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "La dosiero \"%1\$s\" jam ekzistas.\n\u0108u vi volas anstata\u00fbigi la dosieron?"
+ ::msgcat::mcset eo "File \"%1\$s\" already exists.\n\n" "La dosiero \"%1\$s\" jam egzistas. \n\n"
+ ::msgcat::mcset eo "File \"%1\$s\" does not exist." "La dosierp \"%1\$s\" ne estas."
+ ::msgcat::mcset eo "File &name:" "Dosiero&nomo:"
+ ::msgcat::mcset eo "File &names:" "Dosiero&nomoj:"
+ ::msgcat::mcset eo "Files of &type:" "Dosieroj de &Typo:"
+ ::msgcat::mcset eo "Fi&les:" "Do&sieroj:"
+ ::msgcat::mcset eo "&Filter" "&Filtrilo"
+ ::msgcat::mcset eo "Fil&ter:" "&Filtrilo:"
+ ::msgcat::mcset eo "&Green" "&Verda"
+ ::msgcat::mcset eo "&Help" "&Helpu"
+ ::msgcat::mcset eo "Hi" "Saluton"
+ ::msgcat::mcset eo "&Hide Console" "&Ka\u015du konzolon"
+ ::msgcat::mcset eo "&Ignore" "&Ignoru"
+ ::msgcat::mcset eo "Invalid file name \"%1\$s\"." "Malvalida dosieronomo \"%1\$s\"."
+ ::msgcat::mcset eo "Log Files" "Protokolo"
+ ::msgcat::mcset eo "&No" "&Ne"
+ ::msgcat::mcset eo "OK"
+ ::msgcat::mcset eo "Ok"
+ ::msgcat::mcset eo "Open" "Malfermu"
+ ::msgcat::mcset eo "&Open" "&Malfermu"
+ ::msgcat::mcset eo "Open Multiple Files" "Melfermu multan dosierojn"
+ ::msgcat::mcset eo "P&aste" "&Elpo\u015digi"
+ ::msgcat::mcset eo "&Quit" "&Finigu"
+ ::msgcat::mcset eo "&Red" "&Rosa"
+ ::msgcat::mcset eo "Replace existing file?" "\u0108u anstata\u00fbu ekzistantan dosieron?"
+ ::msgcat::mcset eo "&Retry" "&Ripetu"
+ ::msgcat::mcset eo "&Save" "&Savu"
+ ::msgcat::mcset eo "Save As" "Savu kiel"
+ ::msgcat::mcset eo "Save To Log" "Savu en protokolon"
+ ::msgcat::mcset eo "Select Log File" "Elektu prokolodosieron"
+ ::msgcat::mcset eo "Select a file to source" "Elektu dosieron por interpreti"
+ ::msgcat::mcset eo "&Selection:" "&Elekto:"
+ ::msgcat::mcset eo "Skip Messages" "transsaltu pluajn mesa\u011dojn"
+ ::msgcat::mcset eo "&Source..." "&Fontoprogramo..."
+ ::msgcat::mcset eo "Tcl Scripts" "Tcl-skriptoj"
+ ::msgcat::mcset eo "Tcl for Windows" "Tcl por vindoso"
+ ::msgcat::mcset eo "Text Files" "Tekstodosierojn"
+ ::msgcat::mcset eo "&Yes" "&Jes"
+ ::msgcat::mcset eo "abort" "\u0109esigo"
+ ::msgcat::mcset eo "blue" "blua"
+ ::msgcat::mcset eo "cancel" "rezignu"
+ ::msgcat::mcset eo "extension" "ekspansio"
+ ::msgcat::mcset eo "extensions" "ekspansioj"
+ ::msgcat::mcset eo "green" "verda"
+ ::msgcat::mcset eo "ignore" "ignorieren"
+ ::msgcat::mcset eo "red" "ru\u011da"
+ ::msgcat::mcset eo "retry" "ripetu"
+ ::msgcat::mcset eo "yes" "jes"
+}
diff --git a/ext/tk/sample/msgs_tk/es.msg b/ext/tk/sample/msgs_tk/es.msg
new file mode 100644
index 0000000000..62ce33d5cc
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/es.msg
@@ -0,0 +1,84 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset es "Application Error" "Error de la aplicaci\u00f3n"
+ ::msgcat::mcset es "Blue" "Azul"
+ ::msgcat::mcset es "Color" "Color"
+ ::msgcat::mcset es "Delete" "Borrar"
+ ::msgcat::mcset es "Error" "Error"
+ ::msgcat::mcset es "Exit" "Salir"
+ ::msgcat::mcset es "Green" "Verde"
+ ::msgcat::mcset es "Red" "Rojo"
+ ::msgcat::mcset es "blue" "azul"
+ ::msgcat::mcset es "green" "verde"
+ ::msgcat::mcset es "red" "rojo"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset es "&Abort" "&Abortar"
+ ::msgcat::mcset es "About..." "Acerca de ..."
+ ::msgcat::mcset es "All Files" "Todos los archivos"
+ ::msgcat::mcset es "Application Error" "Error de la aplicaci\u00f3n"
+ ::msgcat::mcset es "&Blue" "&Azul"
+ ::msgcat::mcset es "&Cancel" "&Cancelar"
+ ::msgcat::mcset es "Cannot change to the directory \"%1\$s\".\nPermission denied." "No es posible acceder al directorio \"%1\$s\".\nPermiso denegado."
+ ::msgcat::mcset es "Choose Directory" "Elegir directorio"
+ ::msgcat::mcset es "Clear" "Borrar"
+ ::msgcat::mcset es "Color" "Color"
+ ::msgcat::mcset es "Console" "Consola"
+ ::msgcat::mcset es "Copy" "Copiar"
+ ::msgcat::mcset es "Cut" "Cortar"
+ ::msgcat::mcset es "Delete" "Borrar"
+ ::msgcat::mcset es "Details >>" "Detalles >>"
+ ::msgcat::mcset es "Directory \"%1\$s\" does not exist." "El directorio \"%1\$s\" no existe."
+ ::msgcat::mcset es "&Directory:" "&Directorio:"
+ ::msgcat::mcset es "Error: %1\$s" "Error: %1\$s"
+ ::msgcat::mcset es "Exit" "Salir"
+ ::msgcat::mcset es "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "El archivo \"%1\$s\" ya existe.\nDesea sobreescribirlo?"
+ ::msgcat::mcset es "File \"%1\$s\" already exists.\n\n" "El archivo \"%1\$s\" ya existe.\n\n"
+ ::msgcat::mcset es "File \"%1\$s\" does not exist." "El archivo \"%1\$s\" no existe."
+ ::msgcat::mcset es "File &name:" "&Nombre de archivo:"
+ ::msgcat::mcset es "File &names:" "&Nombres de archivo:"
+ ::msgcat::mcset es "Files of &type:" "Archivos de &tipo:"
+ ::msgcat::mcset es "Fi&les:" "&Archivos:"
+ ::msgcat::mcset es "&Filter" "&Filtro"
+ ::msgcat::mcset es "Fil&ter:" "Fil&tro:"
+ ::msgcat::mcset es "&Green" "&Verde"
+ ::msgcat::mcset es "Hi" "Hola"
+ ::msgcat::mcset es "Hide Console" "Esconder la consola"
+ ::msgcat::mcset es "&Ignore" "&Ignorar"
+ ::msgcat::mcset es "Invalid file name \"%1\$s\"." "Nombre de archivo inv\u00e1lido \"%1\$s\"."
+ ::msgcat::mcset es "Log Files" "Ficheros de traza"
+ ::msgcat::mcset es "&No" "&No"
+ ::msgcat::mcset es "&OK" "&OK"
+ ::msgcat::mcset es "Ok" "Ok"
+ ::msgcat::mcset es "Open" "Abrir"
+ ::msgcat::mcset es "&Open" "&Abrir"
+ ::msgcat::mcset es "Open Multiple Files" "Abrir m\u00faltiples archivos"
+ ::msgcat::mcset es "Paste" "Pegar"
+ ::msgcat::mcset es "Quit" "Abandonar"
+ ::msgcat::mcset es "&Red" "&Rojo"
+ ::msgcat::mcset es "Replace existing file?" "Reemplazar el archivo existente?"
+ ::msgcat::mcset es "&Retry" "&Reintentar"
+ ::msgcat::mcset es "&Save" "&Salvar"
+ ::msgcat::mcset es "Save As" "Salvar como"
+ ::msgcat::mcset es "Save To Log" "Salvar al archivo de traza"
+ ::msgcat::mcset es "Select Log File" "Elegir un archivo de traza"
+ ::msgcat::mcset es "Select a file to source" "Seleccionar un archivo a evaluar"
+ ::msgcat::mcset es "&Selection:" "&Selecci\u00f3n:"
+ ::msgcat::mcset es "Skip Messages" "Omitir los mensajes"
+ ::msgcat::mcset es "Source..." "Evaluar..."
+ ::msgcat::mcset es "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset es "Tcl for Windows" "Tcl para Windows"
+ ::msgcat::mcset es "Text Files" "Archivos de texto"
+ ::msgcat::mcset es "&Yes" "&S\u00ed"
+ ::msgcat::mcset es "abort" "abortar"
+ ::msgcat::mcset es "blue" "azul"
+ ::msgcat::mcset es "cancel" "cancelar"
+ ::msgcat::mcset es "extension" "extensi\u00f3n"
+ ::msgcat::mcset es "extensions" "extensiones"
+ ::msgcat::mcset es "green" "verde"
+ ::msgcat::mcset es "ignore" "ignorar"
+ ::msgcat::mcset es "ok" "ok"
+ ::msgcat::mcset es "red" "rojo"
+ ::msgcat::mcset es "retry" "reintentar"
+ ::msgcat::mcset es "yes" "s\u00ed"
+}
diff --git a/ext/tk/sample/msgs_tk/fr.msg b/ext/tk/sample/msgs_tk/fr.msg
new file mode 100644
index 0000000000..ebbba48ca1
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/fr.msg
@@ -0,0 +1,84 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset fr "Application Error" "Erreur d'application"
+ ::msgcat::mcset fr "Blue" "Bleu"
+ ::msgcat::mcset fr "Color" "Couleur"
+ ::msgcat::mcset fr "Delete" "Effacer"
+ ::msgcat::mcset fr "Error" "Erreur"
+ ::msgcat::mcset fr "Exit" "Quitter"
+ ::msgcat::mcset fr "Green" "Vert"
+ ::msgcat::mcset fr "Red" "Rouge"
+ ::msgcat::mcset fr "blue" "bleu"
+ ::msgcat::mcset fr "green" "vert"
+ ::msgcat::mcset fr "red" "rouge"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset fr "&Abort" "&Annuler"
+ ::msgcat::mcset fr "About..." "\u00c0 propos..."
+ ::msgcat::mcset fr "All Files" "Tous les fichiers"
+ ::msgcat::mcset fr "Application Error" "Erreur d'application"
+ ::msgcat::mcset fr "&Blue" "&Bleu"
+ ::msgcat::mcset fr "&Cancel" "&Annuler"
+ ::msgcat::mcset fr "Cannot change to the directory \"%1\$s\".\nPermission denied." "Impossible d'acc\u00e9der au r\u00e9pertoire \"%1\$s\".\nPermission refus\u00e9e."
+ ::msgcat::mcset fr "Choose Directory" "Choisir r\u00e9pertoire"
+ ::msgcat::mcset fr "Clear" "Effacer"
+ ::msgcat::mcset fr "Color" "Couleur"
+ ::msgcat::mcset fr "Console"
+ ::msgcat::mcset fr "Copy" "Copier"
+ ::msgcat::mcset fr "Cut" "Couper"
+ ::msgcat::mcset fr "Delete" "Effacer"
+ ::msgcat::mcset fr "Details >>" "D\u00e9tails >>"
+ ::msgcat::mcset fr "Directory \"%1\$s\" does not exist." "Le r\u00e9pertoire \"%1\$s\" n'existe pas."
+ ::msgcat::mcset fr "&Directory:" "&R\u00e9pertoire:"
+ ::msgcat::mcset fr "Error: %1\$s" "Erreur: %1\$s"
+ ::msgcat::mcset fr "Exit" "Quitter"
+ ::msgcat::mcset fr "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Le fichier \"%1\$s\" existe d\u00e9j\u00e0.\nVoulez-vous l'\u00e9craser?"
+ ::msgcat::mcset fr "File \"%1\$s\" already exists.\n\n" "Le fichier \"%1\$s\" existe d\u00e9j\u00e0.\n\n"
+ ::msgcat::mcset fr "File \"%1\$s\" does not exist." "Le fichier \"%1\$s\" n'existe pas."
+ ::msgcat::mcset fr "File &name:" "&Nom de fichier:"
+ ::msgcat::mcset fr "File &names:" "&Noms de fichiers:"
+ ::msgcat::mcset fr "Files of &type:" "&Type de fichiers:"
+ ::msgcat::mcset fr "Fi&les:" "Fich&iers:"
+ ::msgcat::mcset fr "&Filter" "&Filtre"
+ ::msgcat::mcset fr "Fil&ter:" "Fil&tre:"
+ ::msgcat::mcset fr "&Green" "&Vert"
+ ::msgcat::mcset fr "Hi" "Salut"
+ ::msgcat::mcset fr "Hide Console" "Cacher la Console"
+ ::msgcat::mcset fr "&Ignore" "&Ignorer"
+ ::msgcat::mcset fr "Invalid file name \"%1\$s\"." "Nom de fichier invalide \"%1\$s\"."
+ ::msgcat::mcset fr "Log Files" "Fichiers de trace"
+ ::msgcat::mcset fr "&No" "&Non"
+ ::msgcat::mcset fr "&OK"
+ ::msgcat::mcset fr "Ok"
+ ::msgcat::mcset fr "Open" "Ouvrir"
+ ::msgcat::mcset fr "&Open" "&Ouvrir"
+ ::msgcat::mcset fr "Open Multiple Files" "Ouvrir plusieurs fichiers"
+ ::msgcat::mcset fr "Paste" "Coller"
+ ::msgcat::mcset fr "Quit" "Quitter"
+ ::msgcat::mcset fr "&Red" "&Rouge"
+ ::msgcat::mcset fr "Replace existing file?" "Remplacer le fichier existant?"
+ ::msgcat::mcset fr "&Retry" "&R\u00e9-essayer"
+ ::msgcat::mcset fr "&Save" "&Sauvegarder"
+ ::msgcat::mcset fr "Save As" "Sauvegarder sous"
+ ::msgcat::mcset fr "Save To Log" "Sauvegarde au fichier de trace"
+ ::msgcat::mcset fr "Select Log File" "Choisir un fichier de trace"
+ ::msgcat::mcset fr "Select a file to source" "Choisir un fichier \u00e0 \u00e9valuer"
+ ::msgcat::mcset fr "&Selection:" "&S\u00e9lection:"
+ ::msgcat::mcset fr "Skip Messages" "Omettre les messages"
+ ::msgcat::mcset fr "Source..." "\u00c9valuer..."
+ ::msgcat::mcset fr "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset fr "Tcl for Windows" "Tcl pour Windows"
+ ::msgcat::mcset fr "Text Files" "Fichiers texte"
+ ::msgcat::mcset fr "&Yes" "&Oui"
+ ::msgcat::mcset fr "abort" "abandonner"
+ ::msgcat::mcset fr "blue" "bleu"
+ ::msgcat::mcset fr "cancel" "annuler"
+ ::msgcat::mcset fr "extension"
+ ::msgcat::mcset fr "extensions"
+ ::msgcat::mcset fr "green" "vert"
+ ::msgcat::mcset fr "ignore" "ignorer"
+ ::msgcat::mcset fr "ok"
+ ::msgcat::mcset fr "red" "rouge"
+ ::msgcat::mcset fr "retry" "r\u00e9essayer"
+ ::msgcat::mcset fr "yes" "oui"
+}
diff --git a/ext/tk/sample/msgs_tk/it.msg b/ext/tk/sample/msgs_tk/it.msg
new file mode 100644
index 0000000000..b144fcc073
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/it.msg
@@ -0,0 +1,84 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset it "Application Error" "Errore dell' applicazione"
+ ::msgcat::mcset it "Blue" "Blu"
+ ::msgcat::mcset it "Color" "Colore"
+ ::msgcat::mcset it "Delete" "Incolla"
+ ::msgcat::mcset it "Error" "Errore"
+ ::msgcat::mcset it "Exit" "Esci"
+ ::msgcat::mcset it "Green" "Verde"
+ ::msgcat::mcset it "Red" "Rosso"
+ ::msgcat::mcset it "blue" "blu"
+ ::msgcat::mcset it "green" "verde"
+ ::msgcat::mcset it "red" "rosso"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset it "&Abort" "&Interrompi"
+ ::msgcat::mcset it "About..." "Informazioni ..."
+ ::msgcat::mcset it "All Files" "Tutti i file"
+ ::msgcat::mcset it "Application Error" "Errore dell' applicazione"
+ ::msgcat::mcset it "&Blue" "&Blu"
+ ::msgcat::mcset it "&Cancel" "&Annulla"
+ ::msgcat::mcset it "Cannot change to the directory \"%1\$s\".\nPermission denied." "Impossibile accedere alla directory \"%1\$s\".\nPermesso negato."
+ ::msgcat::mcset it "Choose Directory" "Scegli directory"
+ ::msgcat::mcset it "Clear" "Azzera"
+ ::msgcat::mcset it "Color" "Colore"
+ ::msgcat::mcset it "Console"
+ ::msgcat::mcset it "Copy" "Copia"
+ ::msgcat::mcset it "Cut" "Taglia"
+ ::msgcat::mcset it "Delete" "Incolla"
+ ::msgcat::mcset it "Details >>" "Dettagli >>"
+ ::msgcat::mcset it "Directory \"%1\$s\" does not exist." "La directory \"%1\$s\" non esiste."
+ ::msgcat::mcset it "&Directory:"
+ ::msgcat::mcset it "Error: %1\$s" "Errore: %1\$s"
+ ::msgcat::mcset it "Exit" "Esci"
+ ::msgcat::mcset it "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Il file \"%1\$s\" esiste gi\u00e0.\nVuoi sovrascriverlo?"
+ ::msgcat::mcset it "File \"%1\$s\" already exists.\n\n" "Il file \"%1\$s\" esiste gi\u00e0.\n\n"
+ ::msgcat::mcset it "File \"%1\$s\" does not exist." "Il file \"%1\$s\" non esiste."
+ ::msgcat::mcset it "File &name:" "&Nome del file:"
+ ::msgcat::mcset it "File &names:" "&Nomi dei file:"
+ ::msgcat::mcset it "Files of &type:" "File di &tipo:"
+ ::msgcat::mcset it "Fi&les:" "Fi&le:"
+ ::msgcat::mcset it "&Filter" "&Filtro"
+ ::msgcat::mcset it "Fil&ter:" "Fil&tro:"
+ ::msgcat::mcset it "&Green" "&Verde"
+ ::msgcat::mcset it "Hi" "Salve"
+ ::msgcat::mcset it "Hide Console" "Nascondi la console"
+ ::msgcat::mcset it "&Ignore" "&Ignora"
+ ::msgcat::mcset it "Invalid file name \"%1\$s\"." "Nome di file non valido \"%1\$s\"."
+ ::msgcat::mcset it "Log Files" "File di log"
+ ::msgcat::mcset it "&No"
+ ::msgcat::mcset it "&OK"
+ ::msgcat::mcset it "Ok"
+ ::msgcat::mcset it "&Open" "A&pri"
+ ::msgcat::mcset it "Open" "Apri"
+ ::msgcat::mcset it "Open Multiple Files" "Apri file multipli"
+ ::msgcat::mcset it "Paste" "Incolla"
+ ::msgcat::mcset it "Quit" "Esci"
+ ::msgcat::mcset it "&Red" "&Rosso"
+ ::msgcat::mcset it "Replace existing file?" "Sostituisci il file esistente?"
+ ::msgcat::mcset it "&Retry" "&Riprova"
+ ::msgcat::mcset it "&Save" "&Salva"
+ ::msgcat::mcset it "Save As" "Salva come"
+ ::msgcat::mcset it "Save To Log" "Salva il log"
+ ::msgcat::mcset it "Select Log File" "Scegli un file di log"
+ ::msgcat::mcset it "Select a file to source" "Scegli un file da eseguire"
+ ::msgcat::mcset it "&Selection:" "&Selezione:"
+ ::msgcat::mcset it "Skip Messages" "Salta i messaggi"
+ ::msgcat::mcset it "Source..." "Esegui..."
+ ::msgcat::mcset it "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset it "Tcl for Windows" "Tcl per Windows"
+ ::msgcat::mcset it "Text Files" "File di testo"
+ ::msgcat::mcset it "&Yes" "&Si"
+ ::msgcat::mcset it "abort" "interrompi"
+ ::msgcat::mcset it "blue" "blu"
+ ::msgcat::mcset it "cancel" "annulla"
+ ::msgcat::mcset it "extension" "estensione"
+ ::msgcat::mcset it "extensions" "estensioni"
+ ::msgcat::mcset it "green" "verde"
+ ::msgcat::mcset it "ignore" "ignora"
+ ::msgcat::mcset it "ok"
+ ::msgcat::mcset it "red" "rosso"
+ ::msgcat::mcset it "retry" "riprova"
+ ::msgcat::mcset it "yes" "si"
+}
diff --git a/ext/tk/sample/msgs_tk/ja.msg b/ext/tk/sample/msgs_tk/ja.msg
new file mode 100644
index 0000000000..44a25839db
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/ja.msg
@@ -0,0 +1,13 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset ja "Application Error" "\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30A8\u30E9\u30FC"
+ ::msgcat::mcset ja "Blue" "\u9752"
+ ::msgcat::mcset ja "Color" "\u80CC\u666F\u8272"
+ ::msgcat::mcset ja "Delete" "\u6D88\u53BB"
+ ::msgcat::mcset ja "Error" "\u30A8\u30E9\u30FC"
+ ::msgcat::mcset ja "Exit" "\u7D42\u4E86"
+ ::msgcat::mcset ja "Green" "\u7DD1"
+ ::msgcat::mcset ja "Red" "\u8D64"
+ ::msgcat::mcset ja "blue" "\u9752"
+ ::msgcat::mcset ja "green" "\u7DD1"
+ ::msgcat::mcset ja "red" "\u8D64"
+}
diff --git a/ext/tk/sample/msgs_tk/license.terms b/ext/tk/sample/msgs_tk/license.terms
new file mode 100644
index 0000000000..c0a44d3fc2
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/license.terms
@@ -0,0 +1,39 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., and other parties. The following
+terms apply to all files associated with the software unless explicitly
+disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/msgs_tk/nl.msg b/ext/tk/sample/msgs_tk/nl.msg
new file mode 100644
index 0000000000..d9642e808c
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/nl.msg
@@ -0,0 +1,123 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset nl "Application Error" "Toepassingsfout"
+ ::msgcat::mcset nl "Blue" "Blauw"
+ ::msgcat::mcset nl "Color" "Kleur"
+ ::msgcat::mcset nl "Delete" "Wissen"
+ ::msgcat::mcset nl "Error" "Fout"
+ ::msgcat::mcset nl "Exit" "Be\u00ebindigen"
+ ::msgcat::mcset nl "Green" "Groen"
+ ::msgcat::mcset nl "Red" "Rood"
+ ::msgcat::mcset nl "blue" "blauw"
+ ::msgcat::mcset nl "green" "groen"
+ ::msgcat::mcset nl "red" "rood"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset nl "\"%1\$s\" must be an absolute pathname" "\"%1\$s\" moet een absolute pad-naam zijn"
+ ::msgcat::mcset nl "%1\$s is not a toplevel window" "%1\$s is geen toplevel window"
+ ::msgcat::mcset nl ", or" ", of"
+ ::msgcat::mcset nl "-default, -icon, -message, -parent, -title, or -type" "-default, -icon, -message, -parent, -title, of -type"
+ ::msgcat::mcset nl "-initialdir, -mustexist, -parent, or -title" "-initialdir, -mustexist, -parent, of -title"
+ ::msgcat::mcset nl "&Abort" "&Afbreken"
+ ::msgcat::mcset nl "About..." "Over..."
+ ::msgcat::mcset nl "All Files" "Alle Bestanden"
+ ::msgcat::mcset nl "Application Error" "Toepassingsfout"
+ ::msgcat::mcset nl "&Blue" "&Blauw"
+ ::msgcat::mcset nl "&Cancel" "&Annuleren"
+ ::msgcat::mcset nl "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kan niet naar map \"%1\$s\" gaan.\nU heeft hiervoor geen toestemming."
+ ::msgcat::mcset nl "Choose Directory" "Kies map"
+ ::msgcat::mcset nl "Clear" "Wissen"
+ ::msgcat::mcset nl "Clear entry, Press OK; Enter %1\$s, press OK" "Wis veld, Druk op OK; typ %1\$s in, druk op OK"
+ ::msgcat::mcset nl "&Clear Console" "&Wis Console"
+ ::msgcat::mcset nl "Color" "Kleur"
+ ::msgcat::mcset nl "Console"
+ ::msgcat::mcset nl "Copy" "Kopi\u00ebren"
+ ::msgcat::mcset nl "Cut" "Knippen"
+ ::msgcat::mcset nl "Delete" "Wissen"
+ ::msgcat::mcset nl "Details"
+ ::msgcat::mcset nl "Details >>"
+ ::msgcat::mcset nl "Directory \"%1\$s\" does not exist." "Map \"%1\$s\" bestaat niet."
+ ::msgcat::mcset nl "&Directory:" "&Map:"
+ ::msgcat::mcset nl "Edit" "Bewerken"
+ ::msgcat::mcset nl "Enter \"%1\$s\", press OK" "Typ \"%1\$s\", druk op OK"
+ ::msgcat::mcset nl "Enter \"%1\$s\", press OK, enter \"%2\$s\", press OK" "Typ \"%1\$s\", druk op OK, typ \"%2\$s\", druk op OK"
+ ::msgcat::mcset nl "Error: %1\$s" "Fout: %1\$s"
+ ::msgcat::mcset nl "Exit" "Be\u00ebindigen"
+ ::msgcat::mcset nl "File" "Bestand"
+ ::msgcat::mcset nl "File \"%1\$s\" already exists.\n\n" "Bestand \"%1\$s\" bestaat al.\n\n"
+ ::msgcat::mcset nl "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Bestand \"%1\$s\" bestaat al.\nWilt u het overschrijven?"
+ ::msgcat::mcset nl "File \"%1\$s\" does not exist." "Bestand \"%1\$s\" bestaat niet."
+ ::msgcat::mcset nl "File &name:" "Bestands&naam:"
+ ::msgcat::mcset nl "File &names:" "Bestands&namen:"
+ ::msgcat::mcset nl "Files of &type:" "Bestanden van het &type:"
+ ::msgcat::mcset nl "Fi&les:" "&Bestanden:"
+ ::msgcat::mcset nl "&Filter"
+ ::msgcat::mcset nl "Fil&ter:"
+ ::msgcat::mcset nl "&Green" "&Groen"
+ ::msgcat::mcset nl "Hi" "H\u00e9"
+ ::msgcat::mcset nl "Hide Console" "Verberg Console"
+ ::msgcat::mcset nl "&Ignore" "&Negeren"
+ ::msgcat::mcset nl "Invalid file name \"%1\$s\"." "Ongeldige bestandsnaam \"%1\$s\"."
+ ::msgcat::mcset nl "Log Files" "Log Bestanden"
+ ::msgcat::mcset nl "&No" "&Nee"
+ ::msgcat::mcset nl "&OK"
+ ::msgcat::mcset nl "Ok"
+ ::msgcat::mcset nl "&Open" "&Openen"
+ ::msgcat::mcset nl "Open" "Openen"
+ ::msgcat::mcset nl "Open Multiple Files" "Open meerdere bestanden"
+ ::msgcat::mcset nl "Paste" "Plakken"
+ ::msgcat::mcset nl "Please press %1\$s" "Druk op %1\$s, A.U.B."
+ ::msgcat::mcset nl "Please press ok" "Druk op ok, A.U.B."
+ ::msgcat::mcset nl "Press Cancel" "Druk op Annuleren"
+ ::msgcat::mcset nl "Press Ok" "Druk op Ok"
+ ::msgcat::mcset nl "Quit" "Stoppen"
+ ::msgcat::mcset nl "&Red" "&Rood"
+ ::msgcat::mcset nl "Replace existing file?" "Vervang bestaand bestand?"
+ ::msgcat::mcset nl "&Retry" "&Herhalen"
+ ::msgcat::mcset nl "&Save" "Op&slaan"
+ ::msgcat::mcset nl "Save As" "Opslaan als"
+ ::msgcat::mcset nl "Save To Log" "Opslaan naar Log"
+ ::msgcat::mcset nl "Select Log File" "Selecteer Log bestand"
+ ::msgcat::mcset nl "Select a file to source" "Selecteer bronbestand"
+ ::msgcat::mcset nl "&Selection:" "&Selectie:"
+ ::msgcat::mcset nl "Skip Messages" "Berichten overslaan"
+ ::msgcat::mcset nl "Source..." "Bron..."
+ ::msgcat::mcset nl "Tcl Scripts"
+ ::msgcat::mcset nl "Tcl for Windows" "Tcl voor Windows"
+ ::msgcat::mcset nl "Text Files" "Tekstbestanden"
+ ::msgcat::mcset nl "&Yes" "&Ja"
+ ::msgcat::mcset nl "abort" "afbreken"
+ ::msgcat::mcset nl "abort, retry, ignore, ok, cancel, no, or yes" "afbreken, opnieuw, negeren, ok, annuleren, nee, of ja"
+ ::msgcat::mcset nl "abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel" "abortretryignore, ok, okcancel, retrycancel, yesno, of yesnocancel"
+ ::msgcat::mcset nl "bad %1\$s value \"%2\$s\": must be %3\$s" "verkeerde %1\$s waarde \"%2\$s\": moet zijn %3\$s"
+ ::msgcat::mcset nl "bad file type \"%1\$s\", should be" "verkeerd bestandstype \"%1\$s\", moet zijn"
+ ::msgcat::mcset nl "bad option \"%1\$s\": should be %2\$s" "verkeerde optie \"%1\$s\": moet zijn %2\$s"
+ ::msgcat::mcset nl "bad window path name \"%1\$s\"" "verkeerde window-padnaam \"%1\$s\""
+ ::msgcat::mcset nl "blue" "blauw"
+ ::msgcat::mcset nl "can't post %1\$s: it isn't a descendant of %2\$s (this is a new requirement in Tk versions 3.0 and later)" "kan %1\$s niet verzenden: het is geen afstammeling van %2\$s (dit is een nieuwe eis in Tk versies 3.0 en later)"
+ ::msgcat::mcset nl "cancel" "annuleren"
+ ::msgcat::mcset nl "default button index greater than number of buttons specified for tk_dialog" "default knop index is groter dan het aantal knoppen beschikbaar voor tk_dialog"
+ ::msgcat::mcset nl "display name to use (current one otherwise)" "te gebruiken schermnaam (anders huidige scherm)"
+ ::msgcat::mcset nl "error, info, question, or warning" "error, info, question, of warning"
+ ::msgcat::mcset nl "extension"
+ ::msgcat::mcset nl "extensions"
+ ::msgcat::mcset nl "focus group \"%1\$s\" doesn't exist" "focusgroep \"%1\$s\" bestaat niet"
+ ::msgcat::mcset nl "green" "groen"
+ ::msgcat::mcset nl "history event %1\$s"
+ ::msgcat::mcset nl "ignore" "negeren"
+ ::msgcat::mcset nl "invalid default button \"%1\$s\"" "ongeldige default knop \"%1\$s\""
+ ::msgcat::mcset nl "macType"
+ ::msgcat::mcset nl "macTypes"
+ ::msgcat::mcset nl "must specify a background color" "een achtergrondkleur is verplicht"
+ ::msgcat::mcset nl "name of the slave interpreter" "naam van de slaaf-interpreter"
+ ::msgcat::mcset nl "no winfo screen . nor env(DISPLAY)" "geen winfo scherm . noch env(DISPLAY)"
+ ::msgcat::mcset nl "ok"
+ ::msgcat::mcset nl "red" "rood"
+ ::msgcat::mcset nl "retry" "opnieuw"
+ ::msgcat::mcset nl "should contain 5 or 4 elements" "moet 4 of 5 elementen bevatten"
+ ::msgcat::mcset nl "spec"
+ ::msgcat::mcset nl "tk_chooseDirectory command" "tk_chooseDirectory opdracht"
+ ::msgcat::mcset nl "tk_chooseDirectory command, cancel gives null" "tk_chooseDirectory opdracht, annuleren geeft lege waarde"
+ ::msgcat::mcset nl "tk_chooseDirectory command, initialdir" "tk_chooseDirectory opdracht, initi\u00eble map"
+ ::msgcat::mcset nl "yes" "ja"
+}
diff --git a/ext/tk/sample/msgs_tk/pl.msg b/ext/tk/sample/msgs_tk/pl.msg
new file mode 100644
index 0000000000..2699e42bdf
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/pl.msg
@@ -0,0 +1,87 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset pl "Application Error" "Bl\u0105d w Programie"
+ ::msgcat::mcset pl "Blue" "Niebieski"
+ ::msgcat::mcset pl "Color" "Kolor"
+ ::msgcat::mcset pl "Delete" "Usu\u0144"
+ ::msgcat::mcset pl "Error" "B\u0142\u0105d"
+ ::msgcat::mcset pl "Exit" "Zako\u0144cz"
+ ::msgcat::mcset pl "Green" "Zielony"
+ ::msgcat::mcset pl "Red" "Czerwonz"
+ ::msgcat::mcset pl "blue" "niebieski"
+ ::msgcat::mcset pl "green" "zielony"
+ ::msgcat::mcset pl "red" "czerwony"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset pl "&Abort" "&Anuluj"
+ ::msgcat::mcset pl "&About..." "O Programie..."
+ ::msgcat::mcset pl "All Files" "Wszystkie pliki"
+ ::msgcat::mcset pl "Application Error" "Bl\u0105d w Programie"
+ ::msgcat::mcset pl "&Blue" "&Niebieski"
+ ::msgcat::mcset pl "&Cancel" "&Anuluj"
+ ::msgcat::mcset pl "Cannot change to the directory \"%1\$s\".\nPermission denied." "Katalog \"%1\$s\" nie mo\u017ce zosta\u0107 odczytany lub nie istnieje."
+ ::msgcat::mcset pl "Choose Directory" "Wybierz katalog"
+ ::msgcat::mcset pl "&Clear" "&Wyczy\u015b\u0107"
+ ::msgcat::mcset pl "&Clear Console" "&Wyczy\u015b\u0107 konsol\u0119"
+ ::msgcat::mcset pl "Color" "Kolor"
+ ::msgcat::mcset pl "Console" "Konsola"
+ ::msgcat::mcset pl "&Copy" "&Kopiuj"
+ ::msgcat::mcset pl "Cu&t" "&Wytnij"
+ ::msgcat::mcset pl "&Delete" "&Usu\u0144"
+ ::msgcat::mcset pl "Details >>" "Detale >>"
+ ::msgcat::mcset pl "Directory \"%1\$s\" does not exist." "Katalog \"%1\$s\" nie istniej."
+ ::msgcat::mcset pl "&Directory:" "&Katalog:"
+ ::msgcat::mcset pl "&Edit" "&Edytuj"
+ ::msgcat::mcset pl "Error: %1\$s" "B\u0142\u0105d: %1\$s"
+ ::msgcat::mcset pl "E&xit" "&Zako\u0144cz"
+ ::msgcat::mcset pl "&File" "&Plik"
+ ::msgcat::mcset pl "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Plik \"%1\$s\" ju\u017c istnieje.\nCzy chcesz go zast\u0105pi\u0107?"
+ ::msgcat::mcset pl "File \"%1\$s\" already exists.\n\n" "Plik \"%1\$s\" ju\u017c istnieje. \n\n"
+ ::msgcat::mcset pl "File \"%1\$s\" does not exist." "Plik \"%1\$s\" nie istnieje."
+ ::msgcat::mcset pl "File &name:" "Nazwa &pliku:"
+ ::msgcat::mcset pl "File &names:" "Nazwy &plik\u00f3w:"
+ ::msgcat::mcset pl "Files of &type:" "Pliki &typu:"
+ ::msgcat::mcset pl "Fi&les:" "Pli&ki:"
+ ::msgcat::mcset pl "&Filter" "&Filter"
+ ::msgcat::mcset pl "Fil&ter:" "&Filter:"
+ ::msgcat::mcset pl "&Green" "&Zielony"
+ ::msgcat::mcset pl "&Help" "&Pomoc"
+ ::msgcat::mcset pl "Hi" "Witaj"
+ ::msgcat::mcset pl "&Hide Console" "&Schowaj konsol\u0119"
+ ::msgcat::mcset pl "&Ignore" "&Ignoruj"
+ ::msgcat::mcset pl "Invalid file name \"%1\$s\"." "Niew\u0142a\u015bciwa nazwa pliku \"%1\$s\"."
+ ::msgcat::mcset pl "Log Files" "Protoko\u0142uj"
+ ::msgcat::mcset pl "&No" "&Nie"
+ ::msgcat::mcset pl "OK"
+ ::msgcat::mcset pl "Ok"
+ ::msgcat::mcset pl "Open" "Wczytaj"
+ ::msgcat::mcset pl "&Open" "&Wczytaj"
+ ::msgcat::mcset pl "Open Multiple Files" "Wczytuj wiele plik\u00f3w"
+ ::msgcat::mcset pl "P&aste" "&Wklej"
+ ::msgcat::mcset pl "&Quit" "&Zako\u0144cz"
+ ::msgcat::mcset pl "&Red" "&Czerwonz"
+ ::msgcat::mcset pl "Replace existing file?" "Czy zost\u0105pi\u0107 instniej\u0105cy plik?"
+ ::msgcat::mcset pl "&Retry" "&Powt\u00f3rz"
+ ::msgcat::mcset pl "&Save" "&Zapisz"
+ ::msgcat::mcset pl "Save As" "Zapisz jako"
+ ::msgcat::mcset pl "Save To Log" "Wpisz do protoko\u0142u"
+ ::msgcat::mcset pl "Select Log File" "Wybierz plik proko\u0142u"
+ ::msgcat::mcset pl "Select a file to source" "Wybierz plik do wykonania"
+ ::msgcat::mcset pl "&Selection:" "&Wyb\u00f3r:"
+ ::msgcat::mcset pl "Skip Messages" "Omi\u0144 pozosta\u0142e komunikaty"
+ ::msgcat::mcset pl "&Source..." "&Kod \u017ar\u00f3d\u0142owy..."
+ ::msgcat::mcset pl "Tcl Scripts" "Tcl-skrypty"
+ ::msgcat::mcset pl "Tcl for Windows" "Tcl dla Okienek (Windows)"
+ ::msgcat::mcset pl "Text Files" "Pliki Tekstowe"
+ ::msgcat::mcset pl "&Yes" "&Tak"
+ ::msgcat::mcset pl "abort" "zako\u0144cz"
+ ::msgcat::mcset pl "blue" "niebieski"
+ ::msgcat::mcset pl "cancel" "anuluj"
+ ::msgcat::mcset pl "extension" "rozszerzenie"
+ ::msgcat::mcset pl "extensions" "rozszerzenia"
+ ::msgcat::mcset pl "green" "zielony"
+ ::msgcat::mcset pl "ignore" "ignoruj"
+ ::msgcat::mcset pl "red" "czerwony"
+ ::msgcat::mcset pl "retry" "potw\u00f3rz"
+ ::msgcat::mcset pl "yes" "tak"
+}
diff --git a/ext/tk/sample/msgs_tk/ru.msg b/ext/tk/sample/msgs_tk/ru.msg
new file mode 100644
index 0000000000..db009a4a52
--- /dev/null
+++ b/ext/tk/sample/msgs_tk/ru.msg
@@ -0,0 +1,87 @@
+namespace eval ::tkmsgcat_demo {
+ ::msgcat::mcset ru "Application Error" "\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435"
+ ::msgcat::mcset ru "Blue" " \u0413\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "Color" "\u0426\u0432\u0435\u0442"
+ ::msgcat::mcset ru "Delete" "\u0423\u0434\u0430\u043b\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Error" "\u041e\u0448\u0438\u0431\u043a\u0430"
+ ::msgcat::mcset ru "Exit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "Green" "\u0417\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Red" "\u041a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "blue" " \u0433\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "green" " \u0437\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "red" " \u043a\u0440\u0430\u0441\u043d\u044b\u0439"
+}
+
+namespace eval ::tk {
+ ::msgcat::mcset ru "&Abort" "&\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c"
+ ::msgcat::mcset ru "About..." "\u041f\u0440\u043e..."
+ ::msgcat::mcset ru "All Files" "\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b"
+ ::msgcat::mcset ru "Application Error" "\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435"
+ ::msgcat::mcset ru "&Blue" " &\u0413\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "&Cancel" "\u041e\u0442&\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "Cannot change to the directory \"%1\$s\".\nPermission denied." \
+ "\u041d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \"%1\$s\".\n\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430"
+ ::msgcat::mcset ru "Choose Directory" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433"
+ ::msgcat::mcset ru "Clear" "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Color" "\u0426\u0432\u0435\u0442"
+ ::msgcat::mcset ru "Console" "\u041a\u043e\u043d\u0441\u043e\u043b\u044c"
+ ::msgcat::mcset ru "Copy" "\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Cut" "\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Delete" "\u0423\u0434\u0430\u043b\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Details >>" "\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 >>"
+ ::msgcat::mcset ru "Directory \"%1\$s\" does not exist." "\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \"%1\$s\" \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442."
+ ::msgcat::mcset ru "&Directory:" "&\u041a\u0430\u0442\u0430\u043b\u043e\u0433:"
+ ::msgcat::mcset ru "Error: %1\$s" "\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s"
+ ::msgcat::mcset ru "Exit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \
+ "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e?"
+ ::msgcat::mcset ru "File \"%1\$s\" already exists.\n\n" "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\n"
+ ::msgcat::mcset ru "File \"%1\$s\" does not exist." "\u0424\u0430\u0439\u043b \"%1\$s\" \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d."
+ ::msgcat::mcset ru "File &name:" "&\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430:"
+ ::msgcat::mcset ru "File &names:" "&\u0418\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432:"
+ ::msgcat::mcset ru "Files of &type:" "&\u0422\u0438\u043f \u0444\u0430\u0439\u043b\u043e\u0432:"
+ ::msgcat::mcset ru "Fi&les:" "\u0424\u0430\u0439&\u043b\u044b:"
+ ::msgcat::mcset ru "&Filter" "&\u0424\u0438\u043b\u044c\u0442\u0440"
+ ::msgcat::mcset ru "Fil&ter:" "\u0424\u0438\u043b\u044c&\u0442\u0440:"
+ ::msgcat::mcset ru "&Green" " &\u0417\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Hi" "\u041f\u0440\u0438\u0432\u0435\u0442"
+ ::msgcat::mcset ru "Hide Console" "\u0421\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c"
+ ::msgcat::mcset ru "&Ignore" "&\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Invalid file name \"%1\$s\"." "\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \"%1\$s\"."
+ ::msgcat::mcset ru "Log Files" "\u0424\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u0430"
+ ::msgcat::mcset ru "&No" "&\u041d\u0435\u0442"
+ ::msgcat::mcset ru "&OK" "&\u041e\u041a"
+ ::msgcat::mcset ru "Ok" "\u0414\u0430"
+ ::msgcat::mcset ru "Open" "\u041e\u0442\u043a\u0440\u044b\u0442\u044c"
+ ::msgcat::mcset ru "&Open" "&\u041e\u0442\u043a\u0440\u044b\u0442\u044c"
+ ::msgcat::mcset ru "Open Multiple Files" "\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432"
+ ::msgcat::mcset ru "Paste" "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Quit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "&Red" " &\u041a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Replace existing file?" "\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b?"
+ ::msgcat::mcset ru "&Retry" "&\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
+ ::msgcat::mcset ru "&Save" "&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Save As" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a"
+ ::msgcat::mcset ru "Save To Log" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b"
+ ::msgcat::mcset ru "Select Log File" "\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b"
+ ::msgcat::mcset ru "Select a file to source" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438"
+ ::msgcat::mcset ru "&Selection:" "&Selection:"
+ ::msgcat::mcset ru "Skip Messages" "\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f"
+ ::msgcat::mcset ru "Source..." "\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b..."
+ ::msgcat::mcset ru "Tcl Scripts" "\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 TCL"
+ ::msgcat::mcset ru "Tcl for Windows" "TCL \u0434\u043b\u044f Windows"
+ ::msgcat::mcset ru "Text Files" "\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b"
+ ::msgcat::mcset ru "&Yes" "&\u0414\u0430"
+ ::msgcat::mcset ru "abort" "\u043e\u0442\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "blue" " \u0433\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "cancel" "\u043e\u0442\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "extension" "\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435"
+ ::msgcat::mcset ru "extensions" "\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f"
+ ::msgcat::mcset ru "green" " \u0437\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "ignore" "\u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c"
+ ::msgcat::mcset ru "ok" "\u043e\u043a"
+ ::msgcat::mcset ru "red" " \u043a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "retry" "\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
+ ::msgcat::mcset ru "yes" "\u0434\u0430"
+}
+
diff --git a/ext/tk/sample/multi-ip_sample.rb b/ext/tk/sample/multi-ip_sample.rb
new file mode 100644
index 0000000000..eccf0201f8
--- /dev/null
+++ b/ext/tk/sample/multi-ip_sample.rb
@@ -0,0 +1,103 @@
+#!/usr/bin/env ruby
+# This script is a sample of MultiTkIp class
+
+require "multi-tk"
+
+# create slave interpreters
+trusted_slave = MultiTkIp.new_slave
+safe_slave1 = MultiTkIp.new_safeTk
+safe_slave2 = MultiTkIp.new_safeTk('fill'=>:none, 'expand'=>false)
+#safe_slave2 = MultiTkIp.new_safeTk('fill'=>:none)
+#safe_slave2 = MultiTkIp.new_safeTk('expand'=>false)
+
+cmd = Proc.new{|txt|
+ #####################
+ ## from TkTimer2.rb
+
+ if TkCore::INTERP.safe?
+ # safeTk doesn't have permission to call 'wm' command
+ else
+ root = TkRoot.new(:title=>'timer sample')
+ end
+ label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \
+ .pack(:side=>:bottom, :fill=>:both)
+
+ tick = proc{|aobj|
+ cnt = aobj.return_value + 5
+ label.text format("%d.%02d", *(cnt.divmod(100)))
+ cnt
+ }
+
+ timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 })
+
+=begin
+ TkButton.new(:text=>'Start') {
+ command proc{ timer.continue unless timer.running? }
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+ }
+ TkButton.new(:text=>'Restart') {
+ command proc{ timer.restart(0, proc{ label.text('0.00'); 0 }) }
+ pack('side'=>'right','fill'=>'both','expand'=>'yes')
+ }
+ TkButton.new(:text=>'Stop') {
+ command proc{ timer.stop if timer.running? }
+ pack('side'=>'right','fill'=>'both','expand'=>'yes')
+ }
+=end
+ b_start = TkButton.new(:text=>'Start', :state=>:disabled) {
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+ }
+
+ b_stop = TkButton.new(:text=>'Stop', :state=>:normal) {
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+ }
+
+ b_start.command {
+ timer.continue
+ b_stop.state(:normal)
+ b_start.state(:disabled)
+ }
+
+ b_stop.command {
+ timer.stop
+ b_start.state(:normal)
+ b_stop.state(:disabled)
+ }
+
+ TkButton.new(:text=>'Reset', :state=>:normal) {
+ command { timer.reset }
+ pack('side'=>'right', 'fill'=>'both', 'expand'=>'yes')
+ }
+
+ ev_quit = TkVirtualEvent.new('Control-c', 'Control-q')
+ Tk.root.bind(ev_quit, proc{Tk.exit}).focus
+}
+
+# call on the default master interpreter
+trusted_slave.eval_proc(cmd, 'trusted') # label -> .w00012
+safe_slave1.eval_proc(cmd, 'safe1') # label -> .w00016
+safe_slave2.eval_proc(cmd, 'safe2') # label -> .w00020
+cmd.call('master') # label -> .w00024
+
+#second_master = MultiTkIp.new(&cmd)
+#second_master = MultiTkIp.new(:safe=>2){p [:second_master, $SAFE]}
+
+TkTimer.new(2000, -1, proc{p ['safe1', safe_slave1.deleted?]}).start
+TkTimer.new(2000, -1, proc{p ['safe2', safe_slave2.deleted?]}).start
+TkTimer.new(2000, -1, proc{p ['trusted', trusted_slave.deleted?]}).start
+
+TkTimer.new(5000, 1,
+ proc{
+ safe_slave1.eval_proc{Tk.root.destroy}
+ safe_slave1.delete
+ print "*** The safe_slave1 is deleted by the timer.\n"
+ }).start
+
+TkTimer.new(10000, 1,
+ proc{
+ trusted_slave.eval_proc{Tk.root.destroy}
+ trusted_slave.delete
+ print "*** The trusted_slave is deleted by the timer.\n"
+ }).start
+
+Tk.mainloop
diff --git a/ext/tk/sample/multi-ip_sample2.rb b/ext/tk/sample/multi-ip_sample2.rb
new file mode 100644
index 0000000000..79c78dec4a
--- /dev/null
+++ b/ext/tk/sample/multi-ip_sample2.rb
@@ -0,0 +1,29 @@
+require 'multi-tk.rb'
+
+th = Thread.new{Tk.mainloop}
+
+TkLabel.new(:text=>'this is a primary master').pack
+
+ip1 = MultiTkIp.new_slave(:safe=>1)
+ip2 = MultiTkIp.new_slave(:safe=>2)
+
+cmd = proc{|s|
+ require 'tk'
+
+ TkButton.new(:text=>'b1: p self', :command=>proc{p self}).pack(:fill=>:x)
+ sleep s
+ TkButton.new(:text=>'b2: p $SAFE', :command=>proc{p $SAFE}).pack(:fill=>:x)
+ sleep s
+ TkButton.new(:text=>'b3: p MultiTkIp.ip_name',
+ :command=>proc{p MultiTkIp.ip_name}).pack(:fill=>:x)
+ sleep s
+ TkButton.new(:text=>'EXIT', :command=>proc{exit}).pack(:fill=>:x)
+
+ Tk.mainloop
+}
+
+Thread.new{ip1.eval_proc(cmd, 1.1)}
+Thread.new{ip2.eval_proc(cmd, 0.3)}
+cmd.call(0.7)
+
+th.join
diff --git a/ext/tk/sample/optobj_sample.rb b/ext/tk/sample/optobj_sample.rb
new file mode 100644
index 0000000000..a781254a28
--- /dev/null
+++ b/ext/tk/sample/optobj_sample.rb
@@ -0,0 +1,67 @@
+#!/usr/bin/env ruby
+#
+# sample script of Tk::OptionObj
+#
+require "tk"
+
+optobj = Tk::OptionObj.new('foreground'=>'red', 'background'=>'black')
+
+f = TkFrame.new.pack(:side=>:left, :anchor=>:n, :padx=>5, :pady=>30)
+
+b1 = TkButton.new(f, :text=>'AAA').pack(:fill=>:x)
+b2 = TkButton.new(f, :text=>'BBB').pack(:fill=>:x)
+b3 = TkButton.new(f, :text=>'CCC').pack(:fill=>:x)
+
+optobj.assign( b1,
+ [ b2, 'configure',
+ { 'foreground'=>'background',
+ 'background'=>'foreground' } ],
+ [ b3, nil,
+ { 'foreground'=>'background',
+ 'activeforeground'=>nil,
+ 'background'=>['foreground', 'activeforeground'] } ] )
+
+optobj.update('activeforeground'=>'yellow')
+
+TkButton.new(f){
+ configure( optobj.assign(self) + {:text=>'DDD'} )
+ pack(:fill=>:x)
+}
+
+TkButton.new(f){
+ configure( optobj.assign([self, nil,
+ {'foreground'=>'activeforeground',
+ 'background'=>'foreground',
+ 'activeforeground'=>'background'}]) \
+ + {:text=>'EEE', :relief=>:groove, :borderwidth=>5} )
+ pack(:fill=>:x)
+}
+
+optobj.notify # To apply the convert_key ( 3rd element of widget info
+ # (that is, {'foreground'=>'activeforeground', ,,, } )
+ # of the 'EEE' button
+
+TkButton.new(f, :text=>'toggle',
+ :command=>proc{
+ fg = optobj['foreground']
+ bg = optobj['background']
+ optobj.configure('foreground'=>bg, 'background'=>fg)
+ }).pack(:fill=>:x, :pady=>10)
+
+TkButton.new(f, :text=>'exit',
+ :command=>proc{exit}).pack(:fill=>:x, :pady=>10)
+
+TkFrame.new{|f|
+ pack(:side=>:right, :expand=>true, :fill=>:both)
+ TkLabel.new(f, :text=>'source::').pack(:anchor=>:w)
+ TkFrame.new(f){|ff|
+ TkText.new(ff){
+ yscrollbar(TkScrollbar.new(ff){pack(:fill=>:y, :side=>:right)})
+ insert('end', File.read(__FILE__))
+ pack(:side=>:left, :expand=>true, :fill=>:both)
+ }
+ pack(:expand=>true, :fill=>:both)
+ }
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/propagate.rb b/ext/tk/sample/propagate.rb
new file mode 100644
index 0000000000..66f14aeb72
--- /dev/null
+++ b/ext/tk/sample/propagate.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'tk'
+
+TkLabel.new(:text=>"Please click the bottom frame").pack
+
+f = TkFrame.new(:width=>400, :height=>100, :background=>'yellow',
+ :relief=>'ridge', :borderwidth=>5).pack
+
+# TkPack.propagate(f, false) # <== important!!
+f.pack_propagate(false) # <== important!!
+
+list = (1..3).collect{|n|
+ TkButton.new(f, :text=>"button#{'-X'*n}"){
+ command proc{
+ puts "button#{'-X'*n}"
+ self.unpack
+ }
+ }
+}
+
+list.unshift(nil)
+
+f.bind('1', proc{
+ w = list.shift
+ w.unpack if w
+ list.push(w)
+ list[0].pack(:expand=>true, :anchor=>:center) if list[0]
+ })
+
+Tk.mainloop
diff --git a/ext/tk/sample/remote-ip_sample.rb b/ext/tk/sample/remote-ip_sample.rb
new file mode 100644
index 0000000000..f6eed9e985
--- /dev/null
+++ b/ext/tk/sample/remote-ip_sample.rb
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+require 'remote-tk'
+
+puts <<EOM
+This sample controls the other Tk interpreter (Ruby/Tk, Tcl/Tk, and so on)
+which running on the other process. For this purpose, Ruby/Tk uses Tcl/Tk's
+'send' command. Availability of the command depends on your GUI environment.
+If this script doesn't work, please check your environment (see Tcl/Tk FAQ).
+EOM
+#'
+
+unless (wish = TkWinfo.interps.find{|ip| ip =~ /^wish/})
+ puts ''
+ puts 'Please start "wish" (Tcl/Tk shell) before running this sample script.'
+ exit 1
+end
+
+ip = RemoteTkIp.new(wish)
+ip.eval_proc{TkButton.new(:command=>proc{puts 'This procesure is on the controller-ip (Ruby/Tk)'}, :text=>'print on Ruby/Tk (controller-ip)').pack(:fill=>:x)}
+ip.eval_proc{TkButton.new(:command=>'puts {This procesure is on the remote-ip (wish)}', :text=>'print on wish (remote-ip)').pack(:fill=>:x)}
+
+# If your remote-ip is Ruby/Tk, you can control the remote Ruby by
+# 'ruby' or 'ruby_eval' or 'ruby_cmd' on the Tk interpreter.
+if ip.is_rubytk?
+ ip.eval_proc{TkButton.new(:command=>'ruby {p 111; p Array.new(3,"ruby")}', :text=>'ruby cmd on the remote-ip').pack(:fill=>:x)}
+end
+
+ip.eval_proc{TkButton.new(:command=>'exit', :text=>'QUIT').pack(:fill=>:x)}
+
+TkButton.new(:command=>proc{exit}, :text=>'QUIT',
+ :padx=>10, :pady=>7).pack(:padx=>10, :pady=>7)
+
+Tk.mainloop
diff --git a/ext/tk/sample/remote-ip_sample2.rb b/ext/tk/sample/remote-ip_sample2.rb
new file mode 100644
index 0000000000..d8cf3c7650
--- /dev/null
+++ b/ext/tk/sample/remote-ip_sample2.rb
@@ -0,0 +1,56 @@
+#!/usr/bin/env ruby
+
+require 'remote-tk'
+
+# start sub-process
+ip_name = 'remote_ip'
+ip_list = TkWinfo.interps
+fork{
+ exec "/usr/bin/env ruby -r tk -e \"Tk.appname('#{ip_name}');Tk.mainloop\""
+}
+sleep 1 until (app = (TkWinfo.interps - ip_list)[0]) && app =~ /^#{ip_name}/
+p TkWinfo.interps
+
+# create RemoteTkIp object
+ip = RemoteTkIp.new(app)
+
+# setup remote-ip window
+btns = []
+ip.eval_proc{
+ btns <<
+ TkButton.new(:command=>proc{
+ puts 'This procesure is on the controller-ip (Ruby-side)'
+ },
+ :text=>'print on controller-ip (Ruby-side)').pack(:fill=>:x)
+
+ btns <<
+ TkButton.new(:command=>
+ 'puts {This procesure is on the remote-ip (Tk-side)}',
+ :text=>'print on remote-ip (Tk-side)').pack(:fill=>:x)
+
+ btns <<
+ TkButton.new(:command=>
+ 'ruby {
+ puts "This procedure is on the remote-ip (Ruby-side)"
+ p Array.new(3,"ruby")
+ }',
+ :text=>'ruby cmd on the remote-ip').pack(:fill=>:x)
+
+ TkButton.new(:command=>'exit', :text=>'QUIT').pack(:fill=>:x)
+}
+
+# setup controller-ip window
+btns.each_with_index{|btn, idx|
+ # The scope of the eval-block of 'eval_proc' method is different from
+ # the enternal. If you want to pass local values to the eval-block,
+ # use arguments of eval_proc method. They are passed to block-arguments.
+ TkButton.new(:command=>proc{ip.eval_proc(btn){|b| b.flash}},
+ :text=>"flash button-#{idx}",
+ :padx=>10).pack(:padx=>10, :pady=>2)
+}
+
+TkButton.new(:command=>proc{exit}, :text=>'QUIT',
+ :padx=>10, :pady=>7).pack(:padx=>10, :pady=>7)
+
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/resource.en b/ext/tk/sample/resource.en
new file mode 100644
index 0000000000..39b4013971
--- /dev/null
+++ b/ext/tk/sample/resource.en
@@ -0,0 +1,13 @@
+!
+! see Tcl/Tk's "options" manual for "Database Name" and "Database Class"
+!
+*BtnFrame.borderWidth: 5
+*BtnFrame.relief: ridge
+*BtnFrame.Button.background: wheat
+*BtnFrame.Button.foreground: red
+*hello.text: HELLO
+*quit.text: QUIT
+*BTN_CMD.show_msg: {|arg| print "($SAFE=#{$SAFE}) ";\
+ print "Hello!! This is a sample of #{arg}.";\
+ print "(<<< $SAFE=#{$SAFE})\n"}
+*BTN_CMD.bye_msg: {print "($SAFE=#{$SAFE} >>>) Good-bye(<<< $SAFE=#{$SAFE})\n"}
diff --git a/ext/tk/sample/resource.ja b/ext/tk/sample/resource.ja
new file mode 100644
index 0000000000..a61390f95d
--- /dev/null
+++ b/ext/tk/sample/resource.ja
@@ -0,0 +1,13 @@
+!
+! see Tcl/Tk's "options" manual for "Database Name" and "Database Class"
+!
+*BtnFrame.borderWidth: 5
+*BtnFrame.relief: ridge
+*BtnFrame.Button.background: wheat
+*BtnFrame.Button.foreground: red
+*hello.text: ˤ
+*quit.text: λ
+*BTN_CMD.show_msg: {|arg| print "($SAFE=#{$SAFE} >>>) ";\
+ print "ˤϡ #{arg} ΥץǤ";\
+ print "(<<< $SAFE=#{$SAFE})\n"}
+*BTN_CMD.bye_msg: {print "($SAFE=#{$SAFE} >>>) 褦ʤ顥(<<< $SAFE=#{$SAFE})\n"}
diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb
new file mode 100644
index 0000000000..38131c0155
--- /dev/null
+++ b/ext/tk/sample/safe-tk.rb
@@ -0,0 +1,134 @@
+#!/usr/bin/env ruby
+# This script is a sample of MultiTkIp class
+
+require "multi-tk"
+
+###############################
+
+TkLabel.new(:text=>'This is the Default Master Ipnterpreter').pack(:padx=>5, :pady=>3)
+TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack(:pady=>3)
+TkFrame.new(:borderwidth=>2, :height=>3,
+ :relief=>:sunken).pack(:fill=>:x, :expand=>true,
+ :padx=>10, :pady=>7)
+
+safe0_p = proc{|*args| p args}
+
+###############################
+
+puts "---- create a safe slave IP with Ruby's safe-level == 1 ----------"
+ip = MultiTkIp.new_safe_slave(1){|*args| safe0_p["safe_slave safe_level == #{$SAFE}", args]}
+
+puts "\n---- create procs ----------"
+puts 'x = proc{p [\'proc x\', "$SAFE==#{$SAFE}"]; exit}'
+#x = proc{p ['proc x', "$SAFE==#{$SAFE}"]; exit}
+x = proc{p ['proc x', "$SAFE==#{$SAFE}"]; exit}
+TkLabel.new(:text=>'x = proc{p [\'proc x\', "$SAFE==#{$SAFE}"]; exit}',
+ :anchor=>:w).pack(:fill=>:x)
+
+puts 'y = proc{|label| p [\'proc y\', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}'
+y = proc{|label| p ['proc y', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}
+TkLabel.new(:text=>'y = proc{|label| p [\'proc y\', "$SAFE==#{$SAFE}", label]; label.text($SAFE)}',
+ :anchor=>:w).pack(:fill=>:x)
+
+puts 'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}'
+z = proc{p ['proc z', "$SAFE==#{$SAFE}"]; exit}
+TkLabel.new(:text=>'z = proc{p [\'proc z\', "$SAFE==#{$SAFE}"]; exit}',
+ :anchor=>:w).pack(:fill=>:x)
+
+puts "\n---- call 1st eval_proc ----------"
+print 'lbl = '
+p lbl = ip.eval_proc{
+ TkLabel.new(:text=>"1st eval_proc : $SAFE == #{$SAFE}").pack
+
+ f = TkFrame.new.pack
+ TkLabel.new(f, :text=>"$SAFE == ").pack(:side=>:left)
+ # TkLabel.new(f, :text=>" (<-- 'lbl' widget is here)").pack(:side=>:right)
+ l = TkLabel.new(f).pack(:side=>:right)
+
+ TkButton.new(:text=>':command=>proc{l.text($SAFE)}',
+ :command=>proc{l.text($SAFE)}).pack(:fill=>:x, :padx=>5)
+ TkButton.new(:text=>':command=>x', :command=>x).pack(:fill=>:x, :padx=>5)
+ TkButton.new(:text=>':command=>proc{exit}',
+ :command=>proc{
+ safe0_p["'exit' is called at $SAFE=#{$SAFE}"];exit}
+ ).pack(:fill=>:x, :padx=>5)
+ TkFrame.new(:borderwidth=>2, :height=>3,
+ :relief=>:sunken).pack(:fill=>:x, :expand=>true,
+ :padx=>10, :pady=>7)
+ l # return the label widget
+}
+
+puts "\n---- change the safe slave IP's safe-level ==> 3 ----------"
+ip.safe_level = 3
+
+puts "\n---- call 2nd eval_proc ----------"
+p ip.eval_proc(proc{
+ TkLabel.new(:text=>"2nd eval_proc : $SAFE == #{$SAFE}").pack
+ f = TkFrame.new.pack
+ TkLabel.new(f, :text=>"$SAFE == ").pack(:side=>:left)
+ l = TkLabel.new(f, :text=>$SAFE).pack(:side=>:right)
+ TkButton.new(:text=>':command=>proc{l.text($SAFE)}',
+ :command=>proc{l.text($SAFE)}).pack(:fill=>:x,
+ :padx=>5)
+ TkButton.new(:text=>':command=>proc{y.call(l)}',
+ :command=>proc{y.call(l)}).pack(:fill=>:x,
+ :padx=>5)
+ TkButton.new(:text=>':command=>proc{Proc.new(&y).call(l)}',
+ :command=>proc{
+ Proc.new(&y).call(l)
+ }).pack(:fill=>:x, :padx=>5)
+ TkButton.new(:text=>':command=>proc{MultiTkIp._proc_on_current_safelevel(y).call(l)}',
+ :command=>proc{
+ MultiTkIp._proc_on_current_safelevel(y).call(l)
+ }).pack(:fill=>:x, :padx=>5)
+if false && Object.const_defined?(:RubyVM) && ::RubyVM.class == Class
+ TkButton.new(:text=>':command=>proc{Thread.new(l, &y).value}',
+ :command=>proc{
+ Thread.new(l, &y).value
+ }).pack(:fill=>:x, :padx=>5)
+else
+ # KNOWN BUG::
+ # Current multi-tk.rb cannot support long term threads on callbacks.
+ # Such a thread freezes the Ruby/Tk process.
+end
+ TkButton.new(:text=>':command=>proc{z.call}',
+ :command=>proc{z.call}).pack(:fill=>:x, :padx=>5)
+ TkFrame.new(:borderwidth=>2, :height=>3,
+ :relief=>:sunken).pack(:fill=>:x, :expand=>true,
+ :padx=>10, :pady=>7)
+ })
+
+puts "\n---- call 1st and 2nd eval_str ----------"
+p bind = ip.eval_str('
+ TkLabel.new(:text=>"1st and 2nd eval_str : $SAFE == #{$SAFE}").pack
+ f = TkFrame.new.pack
+ TkLabel.new(f, :text=>"$SAFE == ").pack(:side=>:left)
+ l = TkLabel.new(f, :text=>$SAFE).pack(:side=>:right)
+ TkButton.new(:text=>":command=>proc{y.call(l)}",
+ :command=>proc{y.call(l)}).pack(:fill=>:x, :padx=>5)
+ binding
+', binding)
+
+p ip.eval_str("
+ TkButton.new(:text=>':command=>proc{ l.text = $SAFE }',
+ :command=>proc{ l.text = $SAFE }).pack(:fill=>:x, :padx=>5)
+ TkFrame.new(:borderwidth=>2, :height=>3,
+ :relief=>:sunken).pack(:fill=>:x, :expand=>true,
+ :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
+}
+p ip.eval_proc{
+ TkButton.new(:text=>':command=>proc{ lbl.text = $SAFE }',
+ :command=>proc{ lbl.text = $SAFE }).pack(:fill=>:x, :padx=>5)
+}
+
+puts "\n---- start event-loop ( current $SAFE == #{$SAFE} ) ----------"
+
+Tk.mainloop
diff --git a/ext/tk/sample/scrollframe.rb b/ext/tk/sample/scrollframe.rb
new file mode 100644
index 0000000000..e9d8af7ebf
--- /dev/null
+++ b/ext/tk/sample/scrollframe.rb
@@ -0,0 +1,249 @@
+#
+# Tk::RbWidget::ScrollFrame class
+#
+# This widget class is a frame widget with scrollbars.
+# The ScrollFrame doesn't propagate the size of embedded widgets.
+# When it is configured, scrollregion of the container is changed.
+#
+# Scrollbars can be toggled by Tk::RbWidget::ScrollFrame#vscroll & hscroll.
+# If horizontal or virtical scrollbar is turned off, the horizontal
+# or virtical size of embedded widgets is propagated.
+#
+# Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+module Tk::RbWidget; end
+
+class Tk::RbWidget::ScrollFrame < TkFrame
+ include TkComposite
+
+ DEFAULT_WIDTH = 200
+ DEFAULT_HEIGHT = 200
+
+ def initialize_composite(keys={})
+ @frame.configure(:width=>DEFAULT_WIDTH, :height=>DEFAULT_HEIGHT)
+
+ # create scrollbars
+ @h_scroll = TkScrollbar.new(@frame, 'orient'=>'horizontal')
+ @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical')
+
+ # create a canvas widget
+ @canvas = TkCanvas.new(@frame,
+ :borderwidth=>0, :selectborderwidth=>0,
+ :highlightthickness=>0)
+
+ # allignment
+ TkGrid.rowconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0)
+ @canvas.grid('row'=>0, 'column'=>0, 'sticky'=>'news')
+ @frame.grid_propagate(false)
+
+ # assign scrollbars
+ @canvas.xscrollbar(@h_scroll)
+ @canvas.yscrollbar(@v_scroll)
+
+ # convert hash keys
+ keys = _symbolkey2str(keys)
+
+ # check options for the frame
+ framekeys = {}
+ if keys.key?('classname')
+ keys['class'] = keys.delete('classname')
+ end
+ if @classname = keys.delete('class')
+ framekeys['class'] = @classname
+ end
+ if @colormap = keys.delete('colormap')
+ framekeys['colormap'] = @colormap
+ end
+ if @container = keys.delete('container')
+ framekeys['container'] = @container
+ end
+ if @visual = keys.delete('visual')
+ framekeys['visual'] = @visual
+ end
+ if @classname.kind_of? TkBindTag
+ @db_class = @classname
+ @classname = @classname.id
+ elsif @classname
+ @db_class = TkDatabaseClass.new(@classname)
+ else
+ @db_class = self.class
+ @classname = @db_class::WidgetClassName
+ end
+
+ # create base frame
+ @base = TkFrame.new(@canvas, framekeys)
+
+ # embed base frame
+ @cwin = TkcWindow.new(@canvas, [0, 0], :window=>@base, :anchor=>'nw')
+ @canvas.scrollregion(@cwin.bbox)
+
+ # binding to reset scrollregion
+ @base.bind('Configure'){ _reset_scrollregion(nil, nil) }
+
+ # set default receiver of method calls
+ @path = @base.path
+
+ # scrollbars ON
+ vscroll(keys.delete('vscroll'){true})
+ hscroll(keys.delete('hscroll'){true})
+
+ # please check the differences of the following definitions
+ option_methods(
+ :scrollbarwidth
+ )
+
+ # set receiver widgets for configure methods (with alias)
+ delegate_alias('scrollbarrelief', 'relief', @h_scroll, @v_scroll)
+
+ # set receiver widgets for configure methods
+ delegate('DEFAULT', @base)
+ delegate('background', @frame, @base, @canvas, @h_scroll, @v_scroll)
+ delegate('width', @frame)
+ delegate('height', @frame)
+ delegate('activebackground', @h_scroll, @v_scroll)
+ delegate('troughcolor', @h_scroll, @v_scroll)
+ delegate('repeatdelay', @h_scroll, @v_scroll)
+ delegate('repeatinterval', @h_scroll, @v_scroll)
+ delegate('borderwidth', @frame)
+ delegate('relief', @frame)
+
+ # do configure
+ configure keys unless keys.empty?
+ end
+
+ # callback for Configure event
+ def _reset_scrollregion(h_mod=nil, v_mod=nil)
+ cx1, cy1, cx2, cy2 = @canvas.scrollregion
+ x1, y1, x2, y2 = @cwin.bbox
+ @canvas.scrollregion([x1, y1, x2, y2])
+
+ if h_mod.nil? && v_mod.nil?
+ if x2 != cx2 && TkGrid.info(@h_scroll).size == 0
+ @frame.grid_propagate(true)
+ @canvas.width = x2
+ Tk.update_idletasks
+ @frame.grid_propagate(false)
+ end
+ if y2 != cy2 && TkGrid.info(@v_scroll).size == 0
+ @frame.grid_propagate(true)
+ @canvas.height = y2
+ Tk.update_idletasks
+ @frame.grid_propagate(false)
+ end
+ else
+ @h_scroll.ungrid if h_mod == false
+ @v_scroll.ungrid if v_mod == false
+
+ h_flag = (TkGrid.info(@h_scroll).size == 0)
+ v_flag = (TkGrid.info(@v_scroll).size == 0)
+
+ @frame.grid_propagate(true)
+
+ @canvas.width = (h_flag)? x2: @canvas.winfo_width
+ @canvas.height = (v_flag)? y2: @canvas.winfo_height
+
+ @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew') if h_mod
+ @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns') if v_mod
+
+ Tk.update_idletasks
+
+ @frame.grid_propagate(false)
+ end
+ end
+ private :_reset_scrollregion
+
+ # forbid to change binding of @base frame
+ def bind(*args)
+ @frame.bind(*args)
+ end
+ def bind_append(*args)
+ @frame.bind_append(*args)
+ end
+ def bind_remove(*args)
+ @frame.bind_remove(*args)
+ end
+ def bindinfo(*args)
+ @frame.bindinfo(*args)
+ end
+
+ # set width of scrollbar
+ def scrollbarwidth(width = nil)
+ if width
+ @h_scroll.width(width)
+ @v_scroll.width(width)
+ else
+ @h_scroll.width
+ end
+ end
+
+ # vertical scrollbar : ON/OFF
+ def vscroll(mode)
+ Tk.update_idletasks
+ st = TkGrid.info(@v_scroll)
+ if mode && st.size == 0 then
+ @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns')
+ _reset_scrollregion(nil, true)
+ elsif !mode && st.size != 0 then
+ _reset_scrollregion(nil, false)
+ else
+ _reset_scrollregion(nil, nil)
+ end
+ self
+ end
+
+ # horizontal scrollbar : ON/OFF
+ def hscroll(mode)
+ Tk.update_idletasks
+ st = TkGrid.info(@h_scroll)
+ if mode && st.size == 0 then
+ _reset_scrollregion(true, nil)
+ elsif !mode && st.size != 0 then
+ _reset_scrollregion(false, nil)
+ else
+ _reset_scrollregion(nil, nil)
+ end
+ self
+ end
+end
+
+# test
+if __FILE__ == $0
+ f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10,
+ :width=>300, :height=>200)
+ f.pack(:expand=>true, :fill=>:both)
+
+ TkButton.new(f, :text=>'foo button', :command=>proc{puts 'foo'}).pack
+ TkButton.new(f, :text=>'baaar button', :command=>proc{puts 'baaar'}).pack
+ TkButton.new(f, :text=>'baz button', :command=>proc{puts 'baz'}).pack
+ TkButton.new(f, :text=>'hoge hoge button',
+ :command=>proc{puts 'hoge hoge'}).pack(:side=>:bottom)
+
+ # f.hscroll(false)
+
+ # add a text widget
+ Tk.after(3000){
+ t = TkText.new(f).pack(:expand=>true, :fill=>:both)
+ t.insert(:end, "An example of Tk::RbWidget::ScrollFrame widget.\n\n")
+ t.insert(:end, "Here is a text widget.\n")
+ t.insert(:end, "Please resize the application window, ")
+ t.insert(:end, "and try the scrollbars ")
+ t.insert(:end, "to move the view of packed widgets.\n")
+ }
+
+ # remove a vertical scrollbar, and then the scrollframe is not scrollable.
+ Tk.after(6000){ f.vscroll(false) }
+
+ # add a vertical scrollbar, and make the scrollframe scrollable.
+ Tk.after(9000){ f.vscroll(true) }
+
+ # remove a horizontal scrollbar, and then the scrollframe is not scrollable.
+ Tk.after(12000){ f.hscroll(false) }
+
+ # add a horizontal scrollbar, and make the scrollframe scrollable.
+ Tk.after(15000){ f.hscroll(true) }
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tcltklib/batsu.gif b/ext/tk/sample/tcltklib/batsu.gif
new file mode 100644
index 0000000000..880cc73e09
--- /dev/null
+++ b/ext/tk/sample/tcltklib/batsu.gif
Binary files differ
diff --git a/ext/tk/sample/tcltklib/lines0.tcl b/ext/tk/sample/tcltklib/lines0.tcl
new file mode 100644
index 0000000000..8ed3c5e1c1
--- /dev/null
+++ b/ext/tk/sample/tcltklib/lines0.tcl
@@ -0,0 +1,42 @@
+#! /usr/local/bin/wish
+
+proc drawlines {} {
+ puts [clock format [clock seconds]]
+
+ for {set j 0} {$j < 100} {incr j} {
+ puts -nonewline "*"
+ flush stdout
+ if {$j & 1} {
+ set c "blue"
+ } {
+ set c "red"
+ }
+ for {set i 0} {$i < 100} {incr i} {
+# .a create line $i 0 0 [expr 500 - $i] -fill $c
+ }
+ }
+
+ puts [clock format [clock seconds]]
+
+ for {set j 0} {$j < 100} {incr j} {
+ puts -nonewline "*"
+ flush stdout
+ if {$j & 1} {
+ set c "blue"
+ } {
+ set c "red"
+ }
+ for {set i 0} {$i < 100} {incr i} {
+ .a create line $i 0 0 [expr 500 - $i] -fill $c
+ }
+ }
+
+ puts [clock format [clock seconds]]
+# destroy .
+}
+
+canvas .a -height 500 -width 500
+button .b -text draw -command drawlines
+pack .a .b -side left
+
+# eof
diff --git a/ext/tk/sample/tcltklib/lines1.rb b/ext/tk/sample/tcltklib/lines1.rb
new file mode 100644
index 0000000000..9f21ae6377
--- /dev/null
+++ b/ext/tk/sample/tcltklib/lines1.rb
@@ -0,0 +1,50 @@
+#! /usr/local/bin/ruby
+
+require "tcltk"
+
+def drawlines()
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+# $a.e("create line", i, 0, 0, 500 - i, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+ $a.e("create line", i, 0, 0, 500 - i, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+# $ip.commands()["destroy"].e($root)
+end
+
+$ip = TclTkInterpreter.new()
+$root = $ip.rootwidget()
+$a = TclTkWidget.new($ip, $root, "canvas", "-height 500 -width 500")
+$c = TclTkCallback.new($ip, proc{drawlines()})
+$b = TclTkWidget.new($ip, $root, "button", "-text draw -command", $c)
+
+$ip.commands()["pack"].e($a, $b, "-side left")
+
+TclTk.mainloop
+
+# eof
diff --git a/ext/tk/sample/tcltklib/lines2.rb b/ext/tk/sample/tcltklib/lines2.rb
new file mode 100644
index 0000000000..e459589f50
--- /dev/null
+++ b/ext/tk/sample/tcltklib/lines2.rb
@@ -0,0 +1,54 @@
+#! /usr/local/bin/ruby
+
+require "tk"
+
+def drawlines()
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+# TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+ TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+# Tk.root.destroy
+end
+
+$a = TkCanvas.new{
+ height(500)
+ width(500)
+}
+
+$b = TkButton.new{
+ text("draw")
+ command(proc{drawlines()})
+}
+
+TkPack.configure($a, $b, {"side"=>"left"})
+
+Tk.mainloop
+
+# eof
diff --git a/ext/tk/sample/tcltklib/lines3.rb b/ext/tk/sample/tcltklib/lines3.rb
new file mode 100644
index 0000000000..caa50f92e7
--- /dev/null
+++ b/ext/tk/sample/tcltklib/lines3.rb
@@ -0,0 +1,54 @@
+#! /usr/local/bin/ruby
+
+require "tk"
+
+def drawlines()
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+# $a.create(TkcLine, i, 0, 0, 500 - i, "fill"=>col)
+ end
+ end
+
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+ $a.create(TkcLine, i, 0, 0, 500 - i, "fill"=>col)
+ end
+ end
+
+ print Time.now, "\n"
+# Tk.root.destroy
+end
+
+$a = TkCanvas.new{
+ height(500)
+ width(500)
+}
+
+$b = TkButton.new{
+ text("draw")
+ command(proc{drawlines()})
+}
+
+TkPack.configure($a, $b, {"side"=>"left"})
+
+Tk.mainloop
+
+# eof
diff --git a/ext/tk/sample/tcltklib/lines4.rb b/ext/tk/sample/tcltklib/lines4.rb
new file mode 100644
index 0000000000..7a1175bce0
--- /dev/null
+++ b/ext/tk/sample/tcltklib/lines4.rb
@@ -0,0 +1,54 @@
+#! /usr/local/bin/ruby
+
+require "tk"
+
+def drawlines()
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+# TkCore::INTERP.__invoke($a.path, "create", "line", i.to_s, '0', '0', (500 - i).to_s, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+
+ for j in 0 .. 99
+ print "*"
+ $stdout.flush
+ if (j & 1) != 0
+ col = "blue"
+ else
+ col = "red"
+ end
+ for i in 0 .. 99
+ TkCore::INTERP.__invoke($a.path, "create", "line", i.to_s, '0', '0', (500 - i).to_s, "-fill", col)
+ end
+ end
+
+ print Time.now, "\n"
+# Tk.root.destroy
+end
+
+$a = TkCanvas.new{
+ height(500)
+ width(500)
+}
+
+$b = TkButton.new{
+ text("draw")
+ command(proc{drawlines()})
+}
+
+TkPack.configure($a, $b, {"side"=>"left"})
+
+Tk.mainloop
+
+# eof
diff --git a/ext/tk/sample/tcltklib/maru.gif b/ext/tk/sample/tcltklib/maru.gif
new file mode 100644
index 0000000000..2c0202892e
--- /dev/null
+++ b/ext/tk/sample/tcltklib/maru.gif
Binary files differ
diff --git a/ext/tk/sample/tcltklib/safeTk.rb b/ext/tk/sample/tcltklib/safeTk.rb
new file mode 100644
index 0000000000..5d2c60e700
--- /dev/null
+++ b/ext/tk/sample/tcltklib/safeTk.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tcltklib'
+
+master = TclTkIp.new
+slave_name = 'slave0'
+slave = master.create_slave(slave_name, true)
+master._eval("::safe::interpInit #{slave_name}")
+master._eval("::safe::loadTk #{slave_name}")
+
+master._invoke('label', '.l1', '-text', 'master')
+master._invoke('pack', '.l1', '-padx', '30', '-pady', '50')
+master._eval('label .l2 -text {root widget of master-ip}')
+master._eval('pack .l2 -padx 30 -pady 50')
+
+slave._invoke('label', '.l1', '-text', 'slave')
+slave._invoke('pack', '.l1', '-padx', '30', '-pady', '50')
+slave._eval('label .l2 -text {root widget of slave-ip}')
+slave._eval('pack .l2 -padx 30 -pady 20')
+slave._eval('label .l3 -text {( container frame widget of master-ip )}')
+slave._eval('pack .l3 -padx 30 -pady 20')
+
+TclTkLib.mainloop
diff --git a/ext/tk/sample/tcltklib/sample0.rb b/ext/tk/sample/tcltklib/sample0.rb
new file mode 100644
index 0000000000..0ac303ae9e
--- /dev/null
+++ b/ext/tk/sample/tcltklib/sample0.rb
@@ -0,0 +1,39 @@
+#! /usr/local/bin/ruby -vd
+
+# tcltklib ライブラリのテスト
+
+require "tcltklib"
+
+def test
+ # インタプリタを生成する
+ ip1 = TclTkIp.new()
+
+ # 評価してみる
+ print ip1._return_value().inspect, "\n"
+ print ip1._eval("puts {abc}").inspect, "\n"
+
+ # ボタンを作ってみる
+ print ip1._return_value().inspect, "\n"
+ print ip1._eval("button .lab -text exit -command \"destroy .\"").inspect,
+ "\n"
+ print ip1._return_value().inspect, "\n"
+ print ip1._eval("pack .lab").inspect, "\n"
+ print ip1._return_value().inspect, "\n"
+
+ # インタプリタから ruby コマンドを評価してみる
+# print ip1._eval(%q/ruby {print "print by ruby\n"}/).inspect, "\n"
+ print ip1._eval(%q+puts [ruby {print "print by ruby\n"; "puts by tcl/tk"}]+).inspect, "\n"
+ print ip1._return_value().inspect, "\n"
+
+ # もう一つインタプリタを生成してみる
+ ip2 = TclTkIp.new()
+ ip2._eval("button .lab -text test -command \"puts test ; destroy .\"")
+ ip2._eval("pack .lab")
+
+ TclTkLib.mainloop
+end
+
+test
+GC.start
+
+print "exit\n"
diff --git a/ext/tk/sample/tcltklib/sample1.rb b/ext/tk/sample/tcltklib/sample1.rb
new file mode 100644
index 0000000000..3235edfe0d
--- /dev/null
+++ b/ext/tk/sample/tcltklib/sample1.rb
@@ -0,0 +1,634 @@
+#! /usr/local/bin/ruby -d
+# -*- encoding: utf-8 -*-
+# -d オプションを付けると, デバッグ情報を表示する.
+
+# tcltk ライブラリのサンプル
+
+# まず, ライブラリを require する.
+require "tcltk"
+
+# 以下は, Test1 のインスタンスの initialize() で,
+# tcl/tk に関する処理を行う例である.
+# 必ずしもそのようにする必要は無く,
+# (もし, そうしたければ) class の外で tcl/tk に関する処理を行っても良い.
+
+class Test1
+ # 初期化(インタプリタを生成してウィジェットを生成する).
+ def initialize()
+
+ #### 使う前のおまじない
+
+ # インタプリタの生成.
+ ip = TclTkInterpreter.new()
+ # コマンドに対応するオブジェクトを c に設定しておく.
+ c = ip.commands()
+ # 使用するコマンドに対応するオブジェクトは変数に入れておく.
+ append, bind, button, destroy, incr, info, label, place, set, wm =
+ c.values_at(
+ "append", "bind", "button", "destroy", "incr", "info", "label", "place",
+ "set", "wm")
+
+ #### tcl/tk のコマンドに対応するオブジェクト(TclTkCommand)の操作
+
+ # 実行する時は, e() メソッドを使う.
+ # (以下は, tcl/tk における info command r* を実行.)
+ print info.e("command", "r*"), "\n"
+ # 引数は, まとめた文字列にしても同じ.
+ print info.e("command r*"), "\n"
+ # 変数を用いなくとも実行できるが, 見ためが悪い.
+ print c["info"].e("command", "r*"), "\n"
+ # インタプリタのメソッドとしても実行できるが, 効率が悪い.
+ print ip.info("command", "r*"), "\n"
+
+ ####
+
+ # 以下, 生成したオブジェクトは変数に代入しておかないと
+ # GC の対象になってしまう.
+
+ #### tcl/tk の変数に対応するオブジェクト(TclTkVariable)の操作
+
+ # 生成と同時に値を設定する.
+ v1 = TclTkVariable.new(ip, "20")
+ # 読み出しは get メソッドを使う.
+ print v1.get(), "\n"
+ # 設定は set メソッドを使う.
+ v1.set(40)
+ print v1.get(), "\n"
+ # set コマンドを使って読み出し, 設定は可能だが見ためが悪い.
+ # e() メソッド等の引数に直接 TclTkObject や数値を書いても良い.
+ set.e(v1, 30)
+ print set.e(v1), "\n"
+ # tcl/tk のコマンドで変数を操作できる.
+ incr.e(v1)
+ print v1.get(), "\n"
+ append.e(v1, 10)
+ print v1.get(), "\n"
+
+ #### tcl/tk のウィジェットに対応するオブジェクト(TclTkWidget)の操作
+
+ # ルートウィジェットを取り出す.
+ root = ip.rootwidget()
+ # ウィジェットの操作.
+ root.e("configure -height 300 -width 300")
+ # タイトルを付けるときは wm を使う.
+ wm.e("title", root, $0)
+ # 親ウィジェットとコマンドを指定して, ウィジェットを作る.
+ l1 = TclTkWidget.new(ip, root, label, "-text {type `x' to print}")
+ # place すると表示される.
+ place.e(l1, "-x 0 -rely 0.0 -relwidth 1 -relheight 0.1")
+ # コマンド名は文字列で指定しても良いが, 見ためが悪い.
+ # (コマンド名は独立した引数でなければならない.)
+ l2 = TclTkWidget.new(ip, root, "label")
+ # ウィジェットの操作.
+ l2.e("configure -text {type `q' to exit}")
+ place.e(l2, "-x 0 -rely 0.1 -relwidth 1 -relheight 0.1")
+
+ #### tcl/tk のコールバックに対応するオブジェクト(TclTkCallback)の操作
+
+ # コールバックを生成する.
+ c1 = TclTkCallback.new(ip, proc{sample(ip, root)})
+ # コールバックを持つウィジェットを生成する.
+ b1 = TclTkWidget.new(ip, root, button, "-text sample -command", c1)
+ place.e(b1, "-x 0 -rely 0.2 -relwidth 1 -relheight 0.1")
+ # イベントループを抜けるには destroy.e(root) する.
+ c2 = TclTkCallback.new(ip, proc{destroy.e(root)})
+ b2 = TclTkWidget.new(ip, root, button, "-text exit -command", c2)
+ place.e(b2, "-x 0 -rely 0.3 -relwidth 1 -relheight 0.1")
+
+ #### イベントのバインド
+ # script の追加 (bind tag sequence +script) は今のところできない.
+ # (イテレータ変数の設定がうまくいかない.)
+
+ # 基本的にはウィジェットに対するコールバックと同じ.
+ c3 = TclTkCallback.new(ip, proc{print("q pressed\n"); destroy.e(root)})
+ bind.e(root, "q", c3)
+ # bind コマンドで % 置換によりパラメータを受け取りたいときは,
+ # proc{} の後ろに文字列で指定すると,
+ # 置換結果をイテレータ変数を通して受け取ることができる.
+ # ただし proc{} の後ろの文字列は,
+ # bind コマンドに与えるコールバック以外で指定してはいけない.
+ c4 = TclTkCallback.new(ip, proc{|i| print("#{i} pressed\n")}, "%A")
+ bind.e(root, "x", c4)
+ # TclTkCallback を GC の対象にしたければ,
+ # dcb() (または deletecallbackkeys()) する必要がある.
+ cb = [c1, c2, c3, c4]
+ c5 = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, root, w)}, "%W")
+ bind.e(root, "<Destroy>", c5)
+ cb.push(c5)
+
+ #### tcl/tk のイメージに対応するオブジェクト(TclTkImage)の操作
+
+ # データを指定して生成する.
+ i1 = TclTkImage.new(ip, "photo", "-file maru.gif")
+ # ラベルに張り付けてみる.
+ l3 = TclTkWidget.new(ip, root, label, "-relief raised -image", i1)
+ place.e(l3, "-x 0 -rely 0.4 -relwidth 0.2 -relheight 0.2")
+ # 空のイメージを生成して後で操作する.
+ i2 = TclTkImage.new(ip, "photo")
+ # イメージを操作する.
+ i2.e("copy", i1)
+ i2.e("configure -gamma 0.5")
+ l4 = TclTkWidget.new(ip, root, label, "-relief raised -image", i2)
+ place.e(l4, "-relx 0.2 -rely 0.4 -relwidth 0.2 -relheight 0.2")
+
+ ####
+ end
+
+ # サンプルのためのウィジェットを生成する.
+ def sample(ip, parent)
+ bind, button, destroy, grid, toplevel, wm = ip.commands().values_at(
+ "bind", "button", "destroy", "grid", "toplevel", "wm")
+
+ ## toplevel
+
+ # 新しいウインドウを開くには, toplevel を使う.
+ t1 = TclTkWidget.new(ip, parent, toplevel)
+ # タイトルを付けておく
+ wm.e("title", t1, "sample")
+
+ # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする.
+ cb = []
+ cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W"))
+ bind.e(t1, "<Destroy>", c)
+
+ # ボタンの生成.
+ wid = []
+ # toplevel ウィジェットを破壊するには destroy する.
+ cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text close -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_label(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text label -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_button(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text button -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_checkbutton(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text checkbutton -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_radiobutton(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text radiobutton -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_scale(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text scale -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_entry(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text entry -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_text(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text text -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_raise(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text raise/lower -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_modal(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text message/modal -command",
+ c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_menu(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text menu -command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_listbox(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text listbox/scrollbar",
+ "-command", c))
+ cb.push(c = TclTkCallback.new(ip, proc{test_canvas(ip, t1)}))
+ wid.push(TclTkWidget.new(ip, t1, button, "-text canvas -command", c))
+
+ # grid で表示する.
+ ro = co = 0
+ wid.each{|w|
+ grid.e(w, "-row", ro, "-column", co, "-sticky news")
+ ro += 1
+ if ro == 7
+ ro = 0
+ co += 1
+ end
+ }
+ end
+
+ # inittoplevel(ip, parent, title)
+ # 以下の処理をまとめて行う.
+ # 1. toplevel ウィジェットを作成する.
+ # 2. コールバックを登録する配列を用意し, toplevel ウィジェットの
+ # <Destroy> イベントにコールバックを削除する手続きを登録する.
+ # 3. クローズボタンを作る.
+ # 作成した toplevel ウィジェット, クローズボタン, コールバック登録用変数
+ # を返す.
+ # ip: インタプリタ
+ # parent: 親ウィジェット
+ # title: toplevel ウィジェットのウインドウのタイトル
+ def inittoplevel(ip, parent, title)
+ bind, button, destroy, toplevel, wm = ip.commands().values_at(
+ "bind", "button", "destroy", "toplevel", "wm")
+
+ # 新しいウインドウを開くには, toplevel を使う.
+ t1 = TclTkWidget.new(ip, parent, toplevel)
+ # タイトルを付けておく
+ wm.e("title", t1, title)
+
+ # ウィジェットが破壊されたとき, コールバックが GC の対象になるようにする.
+ cb = []
+ cb.push(c = TclTkCallback.new(ip, proc{|w| TclTk.dcb(cb, t1, w)}, "%W"))
+ bind.e(t1, "<Destroy>", c)
+ # close ボタンを作っておく.
+ # toplevel ウィジェットを破壊するには destroy する.
+ cb.push(c = TclTkCallback.new(ip, proc{destroy.e(t1)}))
+ b1 = TclTkWidget.new(ip, t1, button, "-text close -command", c)
+
+ return t1, b1, cb
+ end
+
+ # label のサンプル.
+ def test_label(ip, parent)
+ button, global, label, pack = ip.commands().values_at(
+ "button", "global", "label", "pack")
+ t1, b1, cb = inittoplevel(ip, parent, "label")
+
+ ## label
+
+ # いろいろな形のラベル.
+ l1 = TclTkWidget.new(ip, t1, label, "-text {default(flat)}")
+ l2 = TclTkWidget.new(ip, t1, label, "-text raised -relief raised")
+ l3 = TclTkWidget.new(ip, t1, label, "-text sunken -relief sunken")
+ l4 = TclTkWidget.new(ip, t1, label, "-text groove -relief groove")
+ l5 = TclTkWidget.new(ip, t1, label, "-text ridge -relief ridge")
+ l6 = TclTkWidget.new(ip, t1, label, "-bitmap error")
+ l7 = TclTkWidget.new(ip, t1, label, "-bitmap questhead")
+
+ # pack しても表示される.
+ pack.e(b1, l1, l2, l3, l4, l5, l6, l7, "-pady 3")
+
+ ## -textvariable
+
+ # tcltk ライブラリの実装では, コールバックは tcl/tk の``手続き''を通して
+ # 呼ばれる. したがって, コールバックの中で(大域)変数にアクセスするときは,
+ # global する必要がある.
+ # global する前に変数に値を設定してしまうとエラーになるので,
+ # tcl/tk における表現形だけ生成して, 実際に値を設定しないように,
+ # 2 番目の引数には nil を与える.
+ v1 = TclTkVariable.new(ip, nil)
+ global.e(v1)
+ v1.set(100)
+ # -textvariable で変数を設定する.
+ l6 = TclTkWidget.new(ip, t1, label, "-textvariable", v1)
+ # コールバックの中から変数を操作する.
+ cb.push(c = TclTkCallback.new(ip, proc{
+ global.e(v1); v1.set(v1.get().to_i + 10)}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text +10 -command", c)
+ cb.push(c = TclTkCallback.new(ip, proc{
+ global.e(v1); v1.set(v1.get().to_i - 10)}))
+ b3 = TclTkWidget.new(ip, t1, button, "-text -10 -command", c)
+ pack.e(l6, b2, b3)
+ end
+
+ # button のサンプル.
+ def test_button(ip, parent)
+ button, pack = ip.commands().values_at("button", "pack")
+ t1, b1, cb = inittoplevel(ip, parent, "button")
+
+ ## button
+
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
+ b3 = b4 = nil
+ cb.push(c = TclTkCallback.new(ip, proc{b3.e("flash"); b4.e("flash")}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text flash -command", c)
+ cb.push(c = TclTkCallback.new(ip, proc{b2.e("configure -state normal")}))
+ b3 = TclTkWidget.new(ip, t1, button, "-text normal -command", c)
+ cb.push(c = TclTkCallback.new(ip, proc{b2.e("configure -state disabled")}))
+ b4 = TclTkWidget.new(ip, t1, button, "-text disable -command", c)
+ pack.e(b1, b2, b3, b4)
+ end
+
+ # checkbutton のサンプル.
+ def test_checkbutton(ip, parent)
+ checkbutton, global, pack = ip.commands().values_at(
+ "checkbutton", "global", "pack")
+ t1, b1, cb = inittoplevel(ip, parent, "checkbutton")
+
+ ## checkbutton
+
+ v1 = TclTkVariable.new(ip, nil)
+ global.e(v1)
+ # -variable で変数を設定する.
+ ch1 = TclTkWidget.new(ip, t1, checkbutton, "-onvalue on -offvalue off",
+ "-textvariable", v1, "-variable", v1)
+ pack.e(b1, ch1)
+ end
+
+ # radiobutton のサンプル.
+ def test_radiobutton(ip, parent)
+ global, label, pack, radiobutton = ip.commands().values_at(
+ "global", "label", "pack", "radiobutton")
+ t1, b1, cb = inittoplevel(ip, parent, "radiobutton")
+
+ ## radiobutton
+
+ v1 = TclTkVariable.new(ip, nil)
+ global.e(v1)
+ # ヌルストリングは "{}" で指定する.
+ v1.set("{}")
+ l1 = TclTkWidget.new(ip, t1, label, "-textvariable", v1)
+ # -variable で同じ変数を指定すると同じグループになる.
+ ra1 = TclTkWidget.new(ip, t1, radiobutton,
+ "-text radio1 -value r1 -variable", v1)
+ ra2 = TclTkWidget.new(ip, t1, radiobutton,
+ "-text radio2 -value r2 -variable", v1)
+ cb.push(c = TclTkCallback.new(ip, proc{global.e(v1); v1.set("{}")}))
+ ra3 = TclTkWidget.new(ip, t1, radiobutton,
+ "-text clear -value r3 -variable", v1, "-command", c)
+ pack.e(b1, l1, ra1, ra2, ra3)
+ end
+
+ # scale のサンプル.
+ def test_scale(ip, parent)
+ global, pack, scale = ip.commands().values_at(
+ "global", "pack", "scale")
+ t1, b1, cb = inittoplevel(ip, parent, "scale")
+
+ ## scale
+
+ v1 = TclTkVariable.new(ip, nil)
+ global.e(v1)
+ v1.set(219)
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
+ sca1 = nil
+ cb.push(c = TclTkCallback.new(ip, proc{global.e(v1); v = v1.get();
+ sca1.e("configure -background", format("#%02x%02x%02x", v, v, v))}))
+ sca1 = TclTkWidget.new(ip, t1, scale,
+ "-label scale -orient h -from 0 -to 255 -variable", v1, "-command", c)
+ pack.e(b1, sca1)
+ end
+
+ # entry のサンプル.
+ def test_entry(ip, parent)
+ button, entry, global, pack = ip.commands().values_at(
+ "button", "entry", "global", "pack")
+ t1, b1, cb = inittoplevel(ip, parent, "entry")
+
+ ## entry
+
+ v1 = TclTkVariable.new(ip, nil)
+ global.e(v1)
+ # ヌルストリングは "{}" で指定する.
+ v1.set("{}")
+ en1 = TclTkWidget.new(ip, t1, entry, "-textvariable", v1)
+ cb.push(c = TclTkCallback.new(ip, proc{
+ global.e(v1); print(v1.get(), "\n"); v1.set("{}")}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text print -command", c)
+ pack.e(b1, en1, b2)
+ end
+
+ # text のサンプル.
+ def test_text(ip, parent)
+ button, pack, text = ip.commands().values_at(
+ "button", "pack", "text")
+ t1, b1, cb = inittoplevel(ip, parent, "text")
+
+ ## text
+
+ te1 = TclTkWidget.new(ip, t1, text)
+ cb.push(c = TclTkCallback.new(ip, proc{
+ # 1 行目の 0 文字目から最後までを表示し, 削除する.
+ print(te1.e("get 1.0 end")); te1.e("delete 1.0 end")}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text print -command", c)
+ pack.e(b1, te1, b2)
+ end
+
+ # raise/lower のサンプル.
+ def test_raise(ip, parent)
+ button, frame, lower, pack, raise = ip.commands().values_at(
+ "button", "frame", "lower", "pack", "raise")
+ t1, b1, cb = inittoplevel(ip, parent, "raise/lower")
+
+ ## raise/lower
+
+ # button を隠すテストのために, frame を使う.
+ f1 = TclTkWidget.new(ip, t1, frame)
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
+ b2 = nil
+ cb.push(c = TclTkCallback.new(ip, proc{raise.e(f1, b2)}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text raise -command", c)
+ cb.push(c = TclTkCallback.new(ip, proc{lower.e(f1, b2)}))
+ b3 = TclTkWidget.new(ip, t1, button, "-text lower -command", c)
+ lower.e(f1, b3)
+
+ pack.e(b2, b3, "-in", f1)
+ pack.e(b1, f1)
+ end
+
+ # modal なウィジェットのサンプル.
+ def test_modal(ip, parent)
+ button, frame, message, pack, tk_chooseColor, tk_getOpenFile,
+ tk_messageBox = ip.commands().values_at(
+ "button", "frame", "message", "pack", "tk_chooseColor",
+ "tk_getOpenFile", "tk_messageBox")
+ # 最初に load されていないライブラリは ip.commands() に存在しないので,
+ # TclTkLibCommand を生成する必要がある.
+ tk_dialog = TclTkLibCommand.new(ip, "tk_dialog")
+ t1, b1, cb = inittoplevel(ip, parent, "message/modal")
+
+ ## message
+
+ mes = "これは message ウィジェットのテストです."
+ mes += "以下は modal なウィジェットのテストです."
+ me1 = TclTkWidget.new(ip, t1, message, "-text {#{mes}}")
+
+ ## modal
+
+ # tk_messageBox
+ cb.push(c = TclTkCallback.new(ip, proc{
+ print tk_messageBox.e("-type yesnocancel -message messageBox",
+ "-icon error -default cancel -title messageBox"), "\n"}))
+ b2 = TclTkWidget.new(ip, t1, button, "-text messageBox -command", c)
+ # tk_dialog
+ cb.push(c = TclTkCallback.new(ip, proc{
+ # ウィジェット名を生成するためにダミーの frame を生成.
+ print tk_dialog.e(TclTkWidget.new(ip, t1, frame),
+ "dialog dialog error 2 yes no cancel"), "\n"}))
+ b3 = TclTkWidget.new(ip, t1, button, "-text dialog -command", c)
+ # tk_chooseColor
+ cb.push(c = TclTkCallback.new(ip, proc{
+ print tk_chooseColor.e("-title chooseColor"), "\n"}))
+ b4 = TclTkWidget.new(ip, t1, button, "-text chooseColor -command", c)
+ # tk_getOpenFile
+ cb.push(c = TclTkCallback.new(ip, proc{
+ print tk_getOpenFile.e("-defaultextension .rb",
+ "-filetypes {{{Ruby Script} {.rb}} {{All Files} {*}}}",
+ "-title getOpenFile"), "\n"}))
+ b5 = TclTkWidget.new(ip, t1, button, "-text getOpenFile -command", c)
+
+ pack.e(b1, me1, b2, b3, b4, b5)
+ end
+
+ # menu のサンプル.
+ def test_menu(ip, parent)
+ global, menu, menubutton, pack = ip.commands().values_at(
+ "global", "menu", "menubutton", "pack")
+ tk_optionMenu = TclTkLibCommand.new(ip, "tk_optionMenu")
+ t1, b1, cb = inittoplevel(ip, parent, "menu")
+
+ ## menu
+
+ # menubutton を生成する.
+ mb1 = TclTkWidget.new(ip, t1, menubutton, "-text menu")
+ # menu を生成する.
+ me1 = TclTkWidget.new(ip, mb1, menu)
+ # mb1 から me1 が起動されるようにする.
+ mb1.e("configure -menu", me1)
+
+ # cascade で起動される menu を生成する.
+ me11 = TclTkWidget.new(ip, me1, menu)
+ # radiobutton のサンプル.
+ v1 = TclTkVariable.new(ip, nil); global.e(v1); v1.set("r1")
+ me11.e("add radiobutton -label radio1 -value r1 -variable", v1)
+ me11.e("add radiobutton -label radio2 -value r2 -variable", v1)
+ me11.e("add radiobutton -label radio3 -value r3 -variable", v1)
+ # cascade により mb11 が起動されるようにする.
+ me1.e("add cascade -label cascade -menu", me11)
+
+ # checkbutton のサンプル.
+ v2 = TclTkVariable.new(ip, nil); global.e(v2); v2.set("none")
+ me1.e("add checkbutton -label check -variable", v2)
+ # separator のサンプル.
+ me1.e("add separator")
+ # command のサンプル.
+ v3 = nil
+ cb.push(c = TclTkCallback.new(ip, proc{
+ global.e(v1, v2, v3); print "v1: ", v1.get(), ", v2: ", v2.get(),
+ ", v3: ", v3.get(), "\n"}))
+ me1.e("add command -label print -command", c)
+
+ ## tk_optionMenu
+
+ v3 = TclTkVariable.new(ip, nil); global.e(v3); v3.set("opt2")
+ om1 = TclTkWidget.new(ip, t1, tk_optionMenu, v3, "opt1 opt2 opt3 opt4")
+
+ pack.e(b1, mb1, om1, "-side left")
+ end
+
+ # listbox のサンプル.
+ def test_listbox(ip, parent)
+ clipboard, frame, grid, listbox, lower, menu, menubutton, pack, scrollbar,
+ selection = ip.commands().values_at(
+ "clipboard", "frame", "grid", "listbox", "lower", "menu", "menubutton",
+ "pack", "scrollbar", "selection")
+ t1, b1, cb = inittoplevel(ip, parent, "listbox")
+
+ ## listbox/scrollbar
+
+ f1 = TclTkWidget.new(ip, t1, frame)
+ # コールバック内で参照する変数は先に宣言しておかなければならない.
+ li1 = sc1 = sc2 = nil
+ # 実行時に, 後ろにパラメータがつくコールバックは,
+ # イテレータ変数でそのパラメータを受け取ることができる.
+ # (複数のパラメータはひとつの文字列にまとめられる.)
+ cb.push(c1 = TclTkCallback.new(ip, proc{|i| li1.e("xview", i)}))
+ cb.push(c2 = TclTkCallback.new(ip, proc{|i| li1.e("yview", i)}))
+ cb.push(c3 = TclTkCallback.new(ip, proc{|i| sc1.e("set", i)}))
+ cb.push(c4 = TclTkCallback.new(ip, proc{|i| sc2.e("set", i)}))
+ # listbox
+ li1 = TclTkWidget.new(ip, f1, listbox,
+ "-xscrollcommand", c3, "-yscrollcommand", c4,
+ "-selectmode extended -exportselection true")
+ for i in 1..20
+ li1.e("insert end {line #{i} line #{i} line #{i} line #{i} line #{i}}")
+ end
+ # scrollbar
+ sc1 = TclTkWidget.new(ip, f1, scrollbar, "-orient horizontal -command", c1)
+ sc2 = TclTkWidget.new(ip, f1, scrollbar, "-orient vertical -command", c2)
+
+ ## selection/clipboard
+
+ mb1 = TclTkWidget.new(ip, t1, menubutton, "-text edit")
+ me1 = TclTkWidget.new(ip, mb1, menu)
+ mb1.e("configure -menu", me1)
+ cb.push(c = TclTkCallback.new(ip, proc{
+ # clipboard をクリア.
+ clipboard.e("clear")
+ # selection から文字列を読み込み clipboard に追加する.
+ clipboard.e("append {#{selection.e('get')}}")}))
+ me1.e("add command -label {selection -> clipboard} -command",c)
+ cb.push(c = TclTkCallback.new(ip, proc{
+ # li1 をクリア.
+ li1.e("delete 0 end")
+ # clipboard から文字列を取り出し, 1 行ずつ
+ selection.e("get -selection CLIPBOARD").split(/\n/).each{|line|
+ # li1 に挿入する.
+ li1.e("insert end {#{line}}")}}))
+ me1.e("add command -label {clipboard -> listbox} -command",c)
+
+ grid.e(li1, "-row 0 -column 0 -sticky news")
+ grid.e(sc1, "-row 1 -column 0 -sticky ew")
+ grid.e(sc2, "-row 0 -column 1 -sticky ns")
+ grid.e("rowconfigure", f1, "0 -weight 100")
+ grid.e("columnconfigure", f1, "0 -weight 100")
+ f2 = TclTkWidget.new(ip, t1, frame)
+ lower.e(f2, b1)
+ pack.e(b1, mb1, "-in", f2, "-side left")
+ pack.e(f2, f1)
+ end
+
+ # canvas のサンプル.
+ def test_canvas(ip, parent)
+ canvas, lower, pack = ip.commands().values_at("canvas", "lower", "pack")
+ t1, b1, cb = inittoplevel(ip, parent, "canvas")
+
+ ## canvas
+
+ ca1 = TclTkWidget.new(ip, t1, canvas, "-width 400 -height 300")
+ lower.e(ca1, b1)
+ # rectangle を作る.
+ idr = ca1.e("create rectangle 10 10 20 20")
+ # oval を作る.
+ ca1.e("create oval 60 10 100 50")
+ # polygon を作る.
+ ca1.e("create polygon 110 10 110 30 140 10")
+ # line を作る.
+ ca1.e("create line 150 10 150 30 190 10")
+ # arc を作る.
+ ca1.e("create arc 200 10 250 50 -start 0 -extent 90 -style pieslice")
+ # i1 は本当は, どこかで破壊しなければならないが, 面倒なので放ってある.
+ i1 = TclTkImage.new(ip, "photo", "-file maru.gif")
+ # image を作る.
+ ca1.e("create image 100 100 -image", i1)
+ # bitmap を作る.
+ ca1.e("create bitmap 260 50 -bitmap questhead")
+ # text を作る.
+ ca1.e("create text 320 50 -text {drag rectangle}")
+ # window を作る(クローズボタン).
+ ca1.e("create window 200 200 -window", b1)
+
+ # bind により rectangle を drag できるようにする.
+ cb.push(c = TclTkCallback.new(ip, proc{|i|
+ # i に x と y を受け取るので, 取り出す.
+ x, y = i.split(/ /); x = x.to_f; y = y.to_f
+ # 座標を変更する.
+ ca1.e("coords current #{x - 5} #{y - 5} #{x + 5} #{y + 5}")},
+ # x, y 座標を空白で区切ったものをイテレータ変数へ渡すように指定.
+ "%x %y"))
+ # rectangle に bind する.
+ ca1.e("bind", idr, "<B1-Motion>", c)
+
+ pack.e(ca1)
+ end
+end
+
+# test driver
+
+if ARGV.size == 0
+ print "#{$0} n で, n 個のインタプリタを起動します.\n"
+ n = 1
+else
+ n = ARGV[0].to_i
+end
+
+print "start\n"
+ip = []
+
+# インタプリタ, ウィジェット等の生成.
+for i in 1 .. n
+ ip.push(Test1.new())
+end
+
+# 用意ができたらイベントループに入る.
+TclTk.mainloop()
+print "exit from mainloop\n"
+
+# インタプリタが GC されるかのテスト.
+ip = []
+print "GC.start\n" if $DEBUG
+GC.start() if $DEBUG
+print "end\n"
+
+exit
+
+# end
diff --git a/ext/tk/sample/tcltklib/sample2.rb b/ext/tk/sample/tcltklib/sample2.rb
new file mode 100644
index 0000000000..1acc180680
--- /dev/null
+++ b/ext/tk/sample/tcltklib/sample2.rb
@@ -0,0 +1,451 @@
+#!/usr/local/bin/ruby
+#----------------------> pretty simple othello game <-----------------------
+# othello.rb
+#
+# version 0.3
+# maeda shugo (shuto@po.aianet.ne.jp)
+#---------------------------------------------------------------------------
+
+# Sep. 17, 1997 modified by Y. Shigehiro for tcltk library
+# maeda shugo (shugo@po.aianet.ne.jp) 氏による
+# (ruby/tk で書かれていた) ruby のサンプルプログラム
+# http://www.aianet.or.jp/~shugo/ruby/othello.rb.gz
+# を tcltk ライブラリを使うように, 機械的に変更してみました.
+#
+# なるべくオリジナルと同じになるようにしてあります.
+
+require "observer"
+require "tcltk"
+$ip = TclTkInterpreter.new()
+$root = $ip.rootwidget()
+$button, $canvas, $checkbutton, $frame, $label, $pack, $update, $wm =
+ $ip.commands().values_at(
+ "button", "canvas", "checkbutton", "frame", "label", "pack", "update", "wm")
+
+class Othello
+
+ EMPTY = 0
+ BLACK = 1
+ WHITE = - BLACK
+
+ attr :in_com_turn
+ attr :game_over
+
+ class Board
+
+ include Observable
+
+ DIRECTIONS = [
+ [-1, -1], [-1, 0], [-1, 1],
+ [ 0, -1], [ 0, 1],
+ [ 1, -1], [ 1, 0], [ 1, 1]
+ ]
+
+ attr_accessor :com_disk
+
+ def initialize(othello)
+ @othello = othello
+ reset
+ end
+
+ def notify_observers(*arg)
+ if @observer_peers != nil
+ super(*arg)
+ end
+ end
+
+ def reset
+ @data = [
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, WHITE, BLACK, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, BLACK, WHITE, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY],
+ [EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY]
+ ]
+ changed
+ notify_observers
+ end
+
+ def man_disk
+ return - @com_disk
+ end
+
+ def other_disk(disk)
+ return - disk
+ end
+
+ def get_disk(row, col)
+ return @data[row][col]
+ end
+
+ def reverse_to(row, col, my_disk, dir_y, dir_x)
+ y = row
+ x = col
+ begin
+ y += dir_y
+ x += dir_x
+ if y < 0 || x < 0 || y > 7 || x > 7 ||
+ @data[y][x] == EMPTY
+ return
+ end
+ end until @data[y][x] == my_disk
+ begin
+ @data[y][x] = my_disk
+ changed
+ notify_observers(y, x)
+ y -= dir_y
+ x -= dir_x
+ end until y == row && x == col
+ end
+
+ def put_disk(row, col, disk)
+ @data[row][col] = disk
+ changed
+ notify_observers(row, col)
+ DIRECTIONS.each do |dir|
+ reverse_to(row, col, disk, *dir)
+ end
+ end
+
+ def count_disk(disk)
+ num = 0
+ @data.each do |rows|
+ rows.each do |d|
+ if d == disk
+ num += 1
+ end
+ end
+ end
+ return num
+ end
+
+ def count_point_to(row, col, my_disk, dir_y, dir_x)
+ return 0 if @data[row][col] != EMPTY
+ count = 0
+ loop do
+ row += dir_y
+ col += dir_x
+ break if row < 0 || col < 0 || row > 7 || col > 7
+ case @data[row][col]
+ when my_disk
+ return count
+ when other_disk(my_disk)
+ count += 1
+ when EMPTY
+ break
+ end
+ end
+ return 0
+ end
+
+ def count_point(row, col, my_disk)
+ count = 0
+ DIRECTIONS.each do |dir|
+ count += count_point_to(row, col, my_disk, *dir)
+ end
+ return count
+ end
+
+ def corner?(row, col)
+ return (row == 0 && col == 0) ||
+ (row == 0 && col == 7) ||
+ (row == 7 && col == 0) ||
+ (row == 7 && col == 7)
+ end
+
+ def search(my_disk)
+ max = 0
+ max_row = nil
+ max_col = nil
+ for row in 0 .. 7
+ for col in 0 .. 7
+ buf = count_point(row, col, my_disk)
+ if (corner?(row, col) && buf > 0) || max < buf
+ max = buf
+ max_row = row
+ max_col = col
+ end
+ end
+ end
+ return max_row, max_col
+ end
+ end #--------------------------> class Board ends here
+
+ class BoardView < TclTkWidget
+
+ BACK_GROUND_COLOR = "DarkGreen"
+ HILIT_BG_COLOR = "green"
+ BORDER_COLOR = "black"
+ BLACK_COLOR = "black"
+ WHITE_COLOR = "white"
+ STOP_COLOR = "red"
+
+ attr :left
+ attr :top
+ attr :right
+ attr :bottom
+
+ class Square
+
+ attr :oval, TRUE
+ attr :row
+ attr :col
+
+ def initialize(view, row, col)
+ @view = view
+ @id = @view.e("create rectangle",
+ *(view.tk_rect(view.left + col,
+ view.top + row,
+ view.left + col + 1,
+ view.top + row + 1) \
+ << "-fill #{BACK_GROUND_COLOR}") )
+ @row = row
+ @col = col
+ @view.e("itemconfigure", @id,
+ "-width 0.5m -outline #{BORDER_COLOR}")
+ @view.e("bind", @id, "<Any-Enter>", TclTkCallback.new($ip, proc{
+ if @oval == nil
+ view.e("itemconfigure", @id, "-fill #{HILIT_BG_COLOR}")
+ end
+ }))
+ @view.e("bind", @id, "<Any-Leave>", TclTkCallback.new($ip, proc{
+ view.e("itemconfigure", @id, "-fill #{BACK_GROUND_COLOR}")
+ }))
+ @view.e("bind", @id, "<ButtonRelease-1>", TclTkCallback.new($ip,
+ proc{
+ view.click_square(self)
+ }))
+ end
+
+ def blink(color)
+ @view.e("itemconfigure", @id, "-fill #{color}")
+ $update.e()
+ sleep(0.1)
+ @view.e("itemconfigure", @id, "-fill #{BACK_GROUND_COLOR}")
+ end
+ end #-----------------------> class Square ends here
+
+ def initialize(othello, board)
+ super($ip, $root, $canvas)
+ @othello = othello
+ @board = board
+ @board.add_observer(self)
+
+ @squares = Array.new(8)
+ for i in 0 .. 7
+ @squares[i] = Array.new(8)
+ end
+ @left = 1
+ @top = 0.5
+ @right = @left + 8
+ @bottom = @top + 8
+
+ i = self.e("create rectangle", *tk_rect(@left, @top, @right, @bottom))
+ self.e("itemconfigure", i,
+ "-width 1m -outline #{BORDER_COLOR} -fill #{BACK_GROUND_COLOR}")
+
+ for row in 0 .. 7
+ for col in 0 .. 7
+ @squares[row][col] = Square.new(self, row, col)
+ end
+ end
+
+ update
+ end
+
+ def tk_rect(left, top, right, bottom)
+ return left.to_s + "c", top.to_s + "c",
+ right.to_s + "c", bottom.to_s + "c"
+ end
+
+ def clear
+ each_square do |square|
+ if square.oval != nil
+ self.e("delete", square.oval)
+ square.oval = nil
+ end
+ end
+ end
+
+ def draw_disk(row, col, disk)
+ if disk == EMPTY
+ if @squares[row][col].oval != nil
+ self.e("delete", @squares[row][col].oval)
+ @squares[row][col].oval = nil
+ end
+ return
+ end
+
+ $update.e()
+ sleep(0.05)
+ oval = @squares[row][col].oval
+ if oval == nil
+ oval = self.e("create oval", *tk_rect(@left + col + 0.2,
+ @top + row + 0.2,
+ @left + col + 0.8,
+ @top + row + 0.8))
+ @squares[row][col].oval = oval
+ end
+ case disk
+ when BLACK
+ color = BLACK_COLOR
+ when WHITE
+ color = WHITE_COLOR
+ else
+ fail format("Unknown disk type: %d", disk)
+ end
+ self.e("itemconfigure", oval, "-outline #{color} -fill #{color}")
+ end
+
+ def update(row = nil, col = nil)
+ if row && col
+ draw_disk(row, col, @board.get_disk(row, col))
+ else
+ each_square do |square|
+ draw_disk(square.row, square.col,
+ @board.get_disk(square.row, square.col))
+ end
+ end
+ @othello.show_point
+ end
+
+ def each_square
+ @squares.each do |rows|
+ rows.each do |square|
+ yield(square)
+ end
+ end
+ end
+
+ def click_square(square)
+ if @othello.in_com_turn || @othello.game_over ||
+ @board.count_point(square.row,
+ square.col,
+ @board.man_disk) == 0
+ square.blink(STOP_COLOR)
+ return
+ end
+ @board.put_disk(square.row, square.col, @board.man_disk)
+ @othello.com_turn
+ end
+
+ private :draw_disk
+ public :update
+ end #----------------------> class BoardView ends here
+
+ def initialize
+ @msg_label = TclTkWidget.new($ip, $root, $label)
+ $pack.e(@msg_label)
+
+ @board = Board.new(self)
+ @board_view = BoardView.new(self, @board)
+ #### added by Y. Shigehiro
+ ## board_view の大きさを設定する.
+ x1, y1, x2, y2 = @board_view.e("bbox all").split(/ /).collect{|i| i.to_f}
+ @board_view.e("configure -width", x2 - x1)
+ @board_view.e("configure -height", y2 - y1)
+ ## scrollregion を設定する.
+ @board_view.e("configure -scrollregion {", @board_view.e("bbox all"),
+ "}")
+ #### ここまで
+ $pack.e(@board_view, "-fill both -expand true")
+
+ panel = TclTkWidget.new($ip, $root, $frame)
+
+ @play_black = TclTkWidget.new($ip, panel, $checkbutton,
+ "-text {com is black} -command", TclTkCallback.new($ip, proc{
+ switch_side
+ }))
+ $pack.e(@play_black, "-side left")
+
+ quit = TclTkWidget.new($ip, panel, $button, "-text Quit -command",
+ TclTkCallback.new($ip, proc{
+ exit
+ }))
+ $pack.e(quit, "-side right -fill x")
+
+ reset = TclTkWidget.new($ip, panel, $button, "-text Reset -command",
+ TclTkCallback.new($ip, proc{
+ reset_game
+ }))
+ $pack.e(reset, "-side right -fill x")
+
+ $pack.e(panel, "-side bottom -fill x")
+
+# root = Tk.root
+ $wm.e("title", $root, "Othello")
+ $wm.e("iconname", $root, "Othello")
+
+ @board.com_disk = WHITE
+ @game_over = FALSE
+
+ TclTk.mainloop
+ end
+
+ def switch_side
+ if @in_com_turn
+ @play_black.e("toggle")
+ else
+ @board.com_disk = @board.man_disk
+ com_turn unless @game_over
+ end
+ end
+
+ def reset_game
+ if @board.com_disk == BLACK
+ @board.com_disk = WHITE
+ @play_black.e("toggle")
+ end
+ @board_view.clear
+ @board.reset
+ $wm.e("title", $root, "Othello")
+ @game_over = FALSE
+ end
+
+ def com_turn
+ @in_com_turn = TRUE
+ $update.e()
+ sleep(0.5)
+ begin
+ com_disk = @board.count_disk(@board.com_disk)
+ man_disk = @board.count_disk(@board.man_disk)
+ if @board.count_disk(EMPTY) == 0
+ if man_disk == com_disk
+ $wm.e("title", $root, "{Othello - Draw!}")
+ elsif man_disk > com_disk
+ $wm.e("title", $root, "{Othello - You Win!}")
+ else
+ $wm.e("title", $root, "{Othello - You Loose!}")
+ end
+ @game_over = TRUE
+ break
+ elsif com_disk == 0
+ $wm.e("title", $root, "{Othello - You Win!}")
+ @game_over = TRUE
+ break
+ elsif man_disk == 0
+ $wm.e("title", $root, "{Othello - You Loose!}")
+ @game_over = TRUE
+ break
+ end
+ row, col = @board.search(@board.com_disk)
+ break if row == nil || col == nil
+ @board.put_disk(row, col, @board.com_disk)
+ end while @board.search(@board.man_disk) == [nil, nil]
+ @in_com_turn = FALSE
+ end
+
+ def show_point
+ black = @board.count_disk(BLACK)
+ white = @board.count_disk(WHITE)
+ @msg_label.e("configure -text",
+ %Q/{#{format("BLACK: %.2d WHITE: %.2d", black, white)}}/)
+ end
+end #----------------------> class Othello ends here
+
+Othello.new
+
+#----------------------------------------------> othello.rb ends here
diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb
new file mode 100644
index 0000000000..f3d083c33d
--- /dev/null
+++ b/ext/tk/sample/tkalignbox.rb
@@ -0,0 +1,235 @@
+#
+# tkalignbox.rb : align widgets with same width/height
+#
+# by Hidetoshi NAGAI
+#
+# The box size depends on 'reqheight' and 'reqwidth' of contained widgets.
+# If you want to give the box size when those requested sizes are 0,
+# please set box.propagate = false (See the test routine at the tail of
+# this file).
+
+require 'tk'
+
+module Tk
+ module RbWidget
+ class AlignBox < TkFrame
+ end
+ end
+end
+
+class Tk::RbWidget::AlignBox < TkFrame
+ def initialize(*args)
+ if self.class == Tk::RbWidget::AlignBox
+ fail RuntimeError, "Tk::AlignBox is an abstract class"
+ end
+ @padx = 0
+ @pady = 0
+ if args[-1].kind_of? Hash
+ keys = _symbolkey2str(args.pop)
+ @padx = keys.delete('padx') || 0
+ @pady = keys.delete('pady') || 0
+ args.push(keys)
+ end
+ super(*args)
+ @max_width = 0
+ @max_height = 0
+ @propagate = true
+ @widgets = []
+ end
+
+ def _set_framesize
+ fail RuntimeError, "Tk::AlignBox is an abstract class"
+ end
+ private :_set_framesize
+
+ def _place_config(widget, idx, cnt)
+ fail RuntimeError, "Tk::AlignBox is an abstract class"
+ end
+ private :_place_config
+
+ def align
+ widgets = []
+ @widgets.each{|w| widgets << w if w.winfo_exist?}
+ @widgets = widgets
+ cnt = @widgets.size.to_f
+ @widgets.each_with_index{|w, idx| _place_config(w, idx, cnt)}
+ @widgets = widgets
+ _set_framesize if @propagate
+ self
+ end
+
+ def add(*widgets)
+ widgets.each{|w|
+ unless w.kind_of? TkWindow
+ fail RuntimeError, "#{w.inspect} is not a widget instance."
+ end
+ @widgets.delete(w)
+ @widgets << w
+ sz = w.winfo_reqwidth
+ @max_width = sz if @max_width < sz
+ sz = w.winfo_reqheight
+ @max_height = sz if @max_height < sz
+ }
+ align
+ end
+
+ def <<(widget)
+ add(widget)
+ end
+
+ def insert(idx, widget)
+ unless widget.kind_of? TkWindow
+ fail RuntimeError, "#{widget.inspect} is not a widget instance."
+ end
+ @widgets.delete(widget)
+ @widgets[idx,0] = widget
+ sz = widget.winfo_reqwidth
+ @max_width = sz if @max_width < sz
+ sz = widget.winfo_reqheight
+ @max_height = sz if @max_height < sz
+ align
+ end
+
+ def delete(idx)
+ ret = @widgets.delete_at(idx)
+ @req_size = 0
+ @widget.each{|w|
+ sz = w.winfo_reqwidth
+ @max_width = sz if @max_width < sz
+ sz = w.winfo_reqheight
+ @max_height = sz if @max_height < sz
+ }
+ align
+ ret
+ end
+
+ def padx(size = nil)
+ if size
+ @padx = size
+ align
+ else
+ @padx
+ end
+ end
+
+ def pady(size = nil)
+ if size
+ @pady = size
+ align
+ else
+ @pady
+ end
+ end
+
+ attr_accessor :propagate
+end
+
+class Tk::RbWidget::HBox < Tk::RbWidget::AlignBox
+ def _set_framesize
+ bd = self.borderwidth
+ self.width((@max_width + 2*@padx) * @widgets.size + 2*bd)
+ self.height(@max_height + 2*@pady + 2*bd)
+ end
+ private :_set_framesize
+
+ def _place_config(widget, idx, cnt)
+ widget.place_in(self,
+ 'relx'=>idx/cnt, 'x'=>@padx,
+ 'rely'=>0, 'y'=>@pady,
+ 'relwidth'=>1.0/cnt, 'width'=>-2*@padx,
+ 'relheight'=>1.0, 'height'=>-2*@pady)
+ end
+ private :_place_config
+end
+Tk::RbWidget::HLBox = Tk::RbWidget::HBox
+
+class Tk::RbWidget::HRBox < Tk::RbWidget::HBox
+ def _place_config(widget, idx, cnt)
+ widget.place_in(self,
+ 'relx'=>(cnt - idx - 1)/cnt, 'x'=>@padx,
+ 'rely'=>0, 'y'=>@pady,
+ 'relwidth'=>1.0/cnt, 'width'=>-2*@padx,
+ 'relheight'=>1.0, 'height'=>-2*@pady)
+ end
+ private :_place_config
+end
+
+class Tk::RbWidget::VBox < Tk::RbWidget::AlignBox
+ def _set_framesize
+ bd = self.borderwidth
+ self.width(@max_width + 2*@padx + 2*bd)
+ self.height((@max_height + 2*@pady) * @widgets.size + 2*bd)
+ end
+ private :_set_framesize
+
+ def _place_config(widget, idx, cnt)
+ widget.place_in(self,
+ 'relx'=>0, 'x'=>@padx,
+ 'rely'=>idx/cnt, 'y'=>@pady,
+ 'relwidth'=>1.0, 'width'=>-2*@padx,
+ 'relheight'=>1.0/cnt, 'height'=>-2*@pady)
+ end
+ private :_place_config
+end
+Tk::RbWidget::VTBox = Tk::RbWidget::VBox
+
+class Tk::RbWidget::VBBox < Tk::RbWidget::VBox
+ def _place_config(widget, idx, cnt)
+ widget.place_in(self,
+ 'relx'=>0, 'x'=>@padx,
+ 'rely'=>(cnt - idx - 1)/cnt, 'y'=>@pady,
+ 'relwidth'=>1.0, 'width'=>-2*@padx,
+ 'relheight'=>1.0/cnt, 'height'=>-2*@pady)
+ end
+ private :_place_config
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ f = Tk::RbWidget::HBox.new(:borderwidth=>3, :relief=>'ridge').pack
+ f.add(TkButton.new(f, :text=>'a'),
+ TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'),
+ TkButton.new(f, :text=>'aaa'),
+ TkButton.new(f, :text=>'aaaa'))
+
+ f = Tk::RbWidget::HBox.new(:borderwidth=>3, :relief=>'ridge',
+ :padx=>7, :pady=>3, :background=>'yellow').pack
+ f.add(TkButton.new(f, :text=>'a'),
+ TkButton.new(f, :text=>'aa', :font=>'Helvetica 16'),
+ TkButton.new(f, :text=>'aaa'),
+ TkButton.new(f, :text=>'aaaa'))
+
+ f = Tk::RbWidget::VBox.new(:borderwidth=>5,
+ :relief=>'groove').pack(:fill=>:y, :expand=>true)
+ f.add(TkButton.new(f, :text=>'a'),
+ TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'),
+ TkButton.new(f, :text=>'aaa'),
+ TkButton.new(f, :text=>'aaaa'))
+
+ f = Tk::RbWidget::HRBox.new(:borderwidth=>3,
+ :relief=>'raised').pack(:fill=>:x)
+ f.add(TkButton.new(f, :text=>'a'),
+ TkButton.new(f, :text=>'aa'),
+ TkButton.new(f, :text=>'aaa'))
+
+ f = Tk::RbWidget::VBBox.new(:borderwidth=>3,
+ :relief=>'ridge').pack(:fill=>:x)
+ f.propagate = false
+ f.height 100
+ f.add(TkFrame.new(f){|ff|
+ TkButton.new(ff, :text=>'a').pack(:pady=>4, :padx=>6,
+ :fill=>:both, :expand=>true)
+ },
+ TkFrame.new(f){|ff|
+ TkButton.new(ff, :text=>'aa').pack(:pady=>4, :padx=>6,
+ :fill=>:both, :expand=>true)
+ },
+ TkFrame.new(f){|ff|
+ TkButton.new(ff, :text=>'aaaa').pack(:pady=>4, :padx=>6,
+ :fill=>:both, :expand=>true)
+ })
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb
new file mode 100644
index 0000000000..2daa522601
--- /dev/null
+++ b/ext/tk/sample/tkballoonhelp.rb
@@ -0,0 +1,220 @@
+#
+# tkballoonhelp.rb : simple balloon help widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# Add a balloon help to a widget.
+# This widget has only poor featureas. If you need more useful features,
+# please try to use the Tix extension of Tcl/Tk under Ruby/Tk.
+#
+# The interval time to display a balloon help is defined 'interval' option
+# (default is 750ms).
+#
+require 'tk'
+
+module Tk
+ module RbWidget
+ class BalloonHelp<TkLabel
+ end
+ end
+end
+class Tk::RbWidget::BalloonHelp<TkLabel
+ DEFAULT_FOREGROUND = 'black'
+ DEFAULT_BACKGROUND = 'white'
+ DEFAULT_INTERVAL = 750
+
+ def _balloon_binding(interval)
+ @timer = TkAfter.new(interval, 1, proc{show})
+ def @timer.interval(val)
+ @sleep_time = val
+ end
+ @bindtag = TkBindTag.new
+ @bindtag.bind('Enter', proc{@timer.start})
+ @bindtag.bind('Motion', proc{@timer.restart; erase})
+ @bindtag.bind('Any-ButtonPress', proc{@timer.restart; erase})
+ @bindtag.bind('Leave', proc{@timer.stop; erase})
+ tags = @parent.bindtags
+ idx = tags.index(@parent)
+ unless idx
+ ppath = TkComm.window(@parent.path)
+ idx = tags.index(ppath) || 0
+ end
+ tags[idx,0] = @bindtag
+ @parent.bindtags(tags)
+ end
+ private :_balloon_binding
+
+ def initialize(parent=nil, keys={})
+ @parent = parent || Tk.root
+
+ @frame = TkToplevel.new(@parent)
+ @frame.withdraw
+ @frame.overrideredirect(true)
+ @frame.transient(TkWinfo.toplevel(@parent))
+ @epath = @frame.path
+
+ if keys
+ keys = _symbolkey2str(keys)
+ else
+ keys = {}
+ end
+
+ @command = keys.delete('command')
+
+ @interval = keys.delete('interval'){DEFAULT_INTERVAL}
+ _balloon_binding(@interval)
+
+ # @label = TkLabel.new(@frame, 'background'=>'bisque').pack
+ @label = TkLabel.new(@frame,
+ 'foreground'=>DEFAULT_FOREGROUND,
+ 'background'=>DEFAULT_BACKGROUND).pack
+ @label.configure(_symbolkey2str(keys)) unless keys.empty?
+ @path = @label
+ end
+
+ def epath
+ @epath
+ end
+
+ def interval(val)
+ if val
+ @timer.interval(val)
+ else
+ @interval
+ end
+ end
+
+ def command(cmd = Proc.new)
+ @command = cmd
+ self
+ end
+
+ def show
+ x = TkWinfo.pointerx(@parent)
+ y = TkWinfo.pointery(@parent)
+ @frame.geometry("+#{x+1}+#{y+1}")
+
+ if @command
+ case @command.arity
+ when 0
+ @command.call
+ when 2
+ @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent))
+ when 3
+ @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
+ self)
+ else
+ @command.call(x - TkWinfo.rootx(@parent), y - TkWinfo.rooty(@parent),
+ self, @parent)
+ end
+ end
+
+ @frame.deiconify
+ @frame.raise
+
+ begin
+ @org_cursor = @parent.cget('cursor')
+ rescue
+ @org_cursor = @parent['cursor']
+ end
+ begin
+ @parent.configure('cursor', 'crosshair')
+ rescue
+ @parent.cursor('crosshair')
+ end
+ end
+
+ def erase
+ begin
+ @parent.configure('cursor', @org_cursor)
+ rescue
+ @parent.cursor(@org_cursor)
+ end
+ @frame.withdraw
+ end
+
+ def destroy
+ @frame.destroy
+ end
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ TkButton.new('text'=>'This button has a balloon help') {|b|
+ pack('fill'=>'x')
+ Tk::RbWidget::BalloonHelp.new(b, 'text'=>' Message ')
+ }
+ TkButton.new('text'=>'This button has another balloon help') {|b|
+ pack('fill'=>'x')
+ Tk::RbWidget::BalloonHelp.new(b,
+ 'text'=>"CONFIGURED MESSAGE\nchange colors, and so on",
+ 'interval'=>200, 'font'=>'courier',
+ 'background'=>'gray', 'foreground'=>'red')
+ }
+
+ sb = TkScrollbox.new.pack(:fill=>:x)
+ sb.insert(:end, *%w(aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm))
+=begin
+ # CASE1 : command takes no arguemnt
+ bh = Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
+ :relief=>:ridge, :background=>'white',
+ :command=>proc{
+ y = TkWinfo.pointery(sb) - TkWinfo.rooty(sb)
+ bh.text "current index == #{sb.nearest(y)}"
+ })
+=end
+=begin
+ # CASE2 : command takes 2 arguemnts
+ bh = Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
+ :relief=>:ridge, :background=>'white',
+ :command=>proc{|x, y|
+ bh.text "current index == #{sb.nearest(y)}"
+ })
+=end
+=begin
+ # CASE3 : command takes 3 arguemnts
+ Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
+ :relief=>:ridge, :background=>'white',
+ :command=>proc{|x, y, bhelp|
+ bhelp.text "current index == #{sb.nearest(y)}"
+ })
+=end
+=begin
+ # CASE4a : command is a Proc object and takes 4 arguemnts
+ cmd = proc{|x, y, bhelp, parent|
+ bhelp.text "current index == #{parent.nearest(y)}"
+ }
+
+ Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
+ :relief=>:ridge, :background=>'white',
+ :command=>cmd)
+
+ sb2 = TkScrollbox.new.pack(:fill=>:x)
+ sb2.insert(:end, *%w(AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL MMM))
+ Tk::RbWidget::BalloonHelp.new(sb2, :interval=>500,
+ :padx=>5, :relief=>:raised,
+ :background=>'gray25', :foreground=>'white',
+ :command=>cmd)
+=end
+#=begin
+ # CASE4b : command is a Method object and takes 4 arguemnts
+ def set_msg(x, y, bhelp, parent)
+ bhelp.text "current index == #{parent.nearest(y)}"
+ end
+ cmd = self.method(:set_msg)
+
+ Tk::RbWidget::BalloonHelp.new(sb, :interval=>500,
+ :relief=>:ridge, :background=>'white',
+ :command=>cmd)
+
+ sb2 = TkScrollbox.new.pack(:fill=>:x)
+ sb2.insert(:end, *%w(AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK LLL MMM))
+ Tk::RbWidget::BalloonHelp.new(sb2, :interval=>500,
+ :padx=>5, :relief=>:raised,
+ :background=>'gray25', :foreground=>'white',
+ :command=>cmd)
+#=end
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkbiff.rb b/ext/tk/sample/tkbiff.rb
new file mode 100644
index 0000000000..c0953a1b1b
--- /dev/null
+++ b/ext/tk/sample/tkbiff.rb
@@ -0,0 +1,155 @@
+#!/usr/bin/env ruby
+
+if ARGV[0] != '-d'
+ unless $DEBUG
+ exit if fork
+ end
+else
+ ARGV.shift
+end
+
+if ARGV.length == 0
+ if ENV['MAIL']
+ $spool = ENV['MAIL']
+ else
+ $spool = '/var/spool/mail/' + ENV['USER']
+ end
+else
+ $spool = ARGV[0]
+end
+
+require "parsedate"
+require "base64"
+
+include ParseDate
+
+class Mail
+ def Mail.new(f)
+ if !f.kind_of?(IO)
+ f = open(f, "r")
+ me = super
+ f.close
+ else
+ me = super
+ end
+ return me
+ end
+
+ def initialize(f)
+ @header = {}
+ @body = []
+ while line = f.gets()
+ line.chop!
+ next if /^From / =~ line # skip From-line
+ break if /^$/ =~ line # end of header
+ if /^(\S+):\s*(.*)/ =~ line
+ @header[attr = $1.capitalize] = $2
+ elsif attr
+ sub(/^\s*/, '')
+ @header[attr] += "\n" + $_
+ end
+ end
+
+ return unless $_
+
+ while line = f.gets()
+ break if /^From / =~ line
+ @body.push($_)
+ end
+ end
+
+ def header
+ return @header
+ end
+
+ def body
+ return @body
+ end
+
+end
+
+require "tkscrollbox"
+
+my_appname = Tk.appname('tkbiff')
+$top = TkRoot.new
+if ((TkWinfo.interps($top) - [my_appname]).find{|ip| ip =~ /^tkbiff/})
+ STDERR.print("Probably other 'tkbiff's are running. Bye.\n")
+ exit
+end
+
+$top.withdraw
+$list = TkScrollbox.new($top) {
+ relief 'raised'
+ width 80
+ height 8
+ setgrid 'yes'
+ pack
+}
+TkButton.new($top) {
+ text 'Dismiss'
+ command proc {$top.withdraw}
+ pack('fill'=>'both','expand'=>'yes')
+}
+$top.bind "Control-c", proc{exit}
+$top.bind "Control-q", proc{exit}
+$top.bind "space", proc{exit}
+
+$spool_size = 0
+$check_time = Time.now
+
+def check
+ $check_time = Time.now
+ size = File.size($spool)
+ if size and size != $spool_size
+ $spool_size = size
+ pop_up if size > 0
+ end
+ Tk.after 5000, proc{check}
+end
+
+if defined? Thread
+ Thread.start do
+ loop do
+ sleep 600
+ if Time.now - $check_time > 200
+ Tk.after 5000, proc{check}
+ end
+ end
+ end
+end
+
+def pop_up
+ outcount = 0;
+ $list.delete 0, 'end'
+ f = open($spool, "r")
+ while !f.eof?
+ mail = Mail.new(f)
+ date, from, subj = mail.header['Date'], mail.header['From'], mail.header['Subject']
+ next if !date
+ y = m = d = 0
+ y, m, d = parsedate(date) if date
+ from = "sombody@somewhere" if ! from
+ subj = "(nil)" if ! subj
+ from = decode_b(from)
+ subj = decode_b(subj)
+ $list.insert 'end', format('%-02d/%02d/%02d [%-28.28s] %s',y,m,d,from,subj)
+ outcount += 1
+ end
+ f.close
+ if outcount == 0
+ $list.insert 'end', "You have no mail."
+ else
+ $list.see 'end'
+ end
+ $top.deiconify
+ Tk.after 2000, proc{$top.iconify}
+end
+
+$list.insert 'end', "You have no mail."
+check
+Tk.after 2000, proc{$top.iconify}
+begin
+ Tk.mainloop
+rescue
+ `echo #$! > /tmp/tkbiff`
+end
diff --git a/ext/tk/sample/tkbrowse.rb b/ext/tk/sample/tkbrowse.rb
new file mode 100644
index 0000000000..56d5a80fcf
--- /dev/null
+++ b/ext/tk/sample/tkbrowse.rb
@@ -0,0 +1,79 @@
+#!/usr/bin/env ruby
+#
+# This script generates a directory browser, which lists the working
+# directory and allows you to open files or subdirectories by
+# double-clicking.
+
+# Create a scrollbar on the right side of the main window and a listbox
+# on the left side.
+
+require "tkscrollbox"
+
+# The procedure below is invoked to open a browser on a given file; if the
+# file is a directory then another instance of this program is invoked; if
+# the file is a regular file then the Mx editor is invoked to display
+# the file.
+
+$dirlist = {}
+
+def browsedir (dir)
+ if $dirlist.key? dir
+ $dirlist[dir]
+ else
+ top = if $dirlist.size > 0 then TkToplevel.new else nil end
+ list = TkScrollbox.new(top) {
+ relief 'raised'
+ width 20
+ height 20
+ setgrid 'yes'
+ pack
+ }
+ list.insert 'end', *`ls #{dir}`.split
+
+ # Set up bindings for the browser.
+
+ list.focus
+ list.bind "Control-q", proc{exit}
+ list.bind "Control-c", proc{exit}
+ list.bind "Control-p", proc{
+ print "selection <", TkSelection.get, ">\n"
+ }
+
+ list.bind "Double-Button-1", proc{
+ for i in TkSelection.get.split
+ print "clicked ", i, "\n"
+ browse dir, i
+ end
+ }
+ $dirlist[dir] = list
+ end
+end
+
+def browse (dir, file)
+ file="#{dir}/#{file}"
+ if File.directory? file
+ browsedir(file)
+ else
+ if File.file? file
+ if ENV['EDITOR']
+ system format("%s %s&", ENV['EDITOR'], file)
+ else
+ system "xedit #{file}&"
+ end
+ else
+ STDERR.print "\"#{file}\" isn't a directory or regular file"
+ end
+ end
+end
+
+# Fill the listbox with a list of all the files in the directory (run
+# the "ls" command to get that information).
+
+if ARGV.length>0
+ dir = ARGV[0]
+else
+ dir="."
+end
+
+browsedir(dir)
+Tk.mainloop
diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb
new file mode 100644
index 0000000000..c38bde10d4
--- /dev/null
+++ b/ext/tk/sample/tkcombobox.rb
@@ -0,0 +1,497 @@
+#
+# tkcombobox.rb : auto scrollbox & combobox
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+module Tk
+ module RbWidget
+ class AutoScrollListbox < TkListbox
+ end
+ class Combobox < TkEntry
+ end
+ end
+end
+
+class Tk::RbWidget::AutoScrollListbox
+ include TkComposite
+
+ @@up_bmp = TkBitmapImage.new(:data=><<EOD)
+#define up_arrow_width 9
+#define up_arrow_height 9
+static unsigned char up_arrow_bits[] = {
+ 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x38, 0x00, 0x38, 0x00, 0x7c, 0x00,
+ 0x7c, 0x00, 0xfe, 0x00, 0x00, 0x00};
+EOD
+
+ @@down_bmp = TkBitmapImage.new(:data=><<EOD)
+#define up_arrow_width 9
+#define up_arrow_height 9
+static unsigned char down_arrow_bits[] = {
+ 0x00, 0x00, 0xfe, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x38, 0x00,
+ 0x10, 0x00, 0x10, 0x00, 0x00, 0x00};
+EOD
+
+ ############################
+ private
+ ############################
+ def initialize_composite(keys={})
+ keys = _symbolkey2str(keys)
+
+ @initwait = keys.delete('startwait'){300}
+ @interval = keys.delete('interval'){150}
+ @initwait -= @interval
+ @initwait = 0 if @initwait < 0
+
+ @lbox = TkListbox.new(@frame, :borderwidth=>0)
+ @path = @lbox.path
+ TkPack.propagate(@lbox, false)
+
+ @scr = TkScrollbar.new(@frame, :width=>10)
+
+ @lbox.yscrollcommand(proc{|*args| @scr.set(*args); _config_proc})
+ @scr.command(proc{|*args| @lbox.yview(*args); _config_proc})
+
+ @up_arrow = TkLabel.new(@lbox, :image=>@@up_bmp,
+ :relief=>:raised, :borderwidth=>1)
+ @down_arrow = TkLabel.new(@lbox, :image=>@@down_bmp,
+ :relief=>:raised, :borderwidth=>1)
+
+ _init_binding
+
+ @lbox.pack(:side=>:left, :fill=>:both, :expand=>:true)
+
+ delegate('DEFAULT', @lbox)
+ delegate('background', @frame, @scr)
+ delegate('activebackground', @scr)
+ delegate('troughcolor', @scr)
+ delegate('repeatdelay', @scr)
+ delegate('repeatinterval', @scr)
+ delegate('relief', @frame)
+ delegate('borderwidth', @frame)
+
+ delegate_alias('arrowrelief', 'relief', @up_arrow, @down_arrow)
+ delegate_alias('arrowborderwidth', 'borderwidth', @up_arrow, @down_arrow)
+
+ scrollbar(keys.delete('scrollbar')){false}
+
+ configure keys unless keys.empty?
+ end
+
+ def _show_up_arrow
+ unless @up_arrow.winfo_mapped?
+ @up_arrow.pack(:side=>:top, :fill=>:x)
+ end
+ end
+
+ def _show_down_arrow
+ unless @down_arrow.winfo_mapped?
+ @down_arrow.pack(:side=>:bottom, :fill=>:x)
+ end
+ end
+
+ def _set_sel(idx)
+ @lbox.activate(idx)
+ @lbox.selection_clear(0, 'end')
+ @lbox.selection_set(idx)
+ end
+
+ def _check_sel(cidx, tidx = nil, bidx = nil)
+ _set_sel(cidx)
+ unless tidx
+ tidx = @lbox.nearest(0)
+ tidx += 1 if tidx > 0
+ end
+ unless bidx
+ bidx = @lbox.nearest(10000)
+ bidx -= 1 if bidx < @lbox.index('end') - 1
+ end
+ if cidx > bidx
+ _set_sel(bidx)
+ end
+ if cidx < tidx
+ _set_sel(tidx)
+ end
+ end
+
+ def _up_proc
+ cidx = @lbox.curselection[0]
+ idx = @lbox.nearest(0)
+ if idx >= 0
+ @lbox.see(idx - 1)
+ _set_sel(idx)
+ @up_arrow.pack_forget if idx == 1
+ @up_timer.stop if idx == 0
+ _show_down_arrow if @lbox.bbox('end') == []
+ end
+ if cidx && cidx > 0 && (idx == 0 || cidx == @lbox.nearest(10000))
+ _set_sel(cidx - 1)
+ end
+ end
+
+ def _down_proc
+ cidx = @lbox.curselection[0]
+ eidx = @lbox.index('end') - 1
+ idx = @lbox.nearest(10000)
+ if idx <= eidx
+ @lbox.see(idx + 1)
+ _set_sel(cidx + 1) if cidx < eidx
+ @down_arrow.pack_forget if idx + 1 == eidx
+ @down_timer.stop if idx == eidx
+ _show_up_arrow if @lbox.bbox(0) == []
+ end
+ if cidx && cidx < eidx && (eidx == idx || cidx == @lbox.nearest(0))
+ _set_sel(cidx + 1)
+ end
+ end
+
+ def _key_UP_proc
+ cidx = @lbox.curselection[0]
+ _set_sel(cidx = @lbox.index('activate')) unless cidx
+ cidx -= 1
+ if cidx == 0
+ @up_arrow.pack_forget
+ elsif cidx == @lbox.nearest(0)
+ @lbox.see(cidx - 1)
+ end
+ end
+
+ def _key_DOWN_proc
+ cidx = @lbox.curselection[0]
+ _set_sel(cidx = @lbox.index('activate')) unless cidx
+ cidx += 1
+ if cidx == @lbox.index('end') - 1
+ @down_arrow.pack_forget
+ elsif cidx == @lbox.nearest(10000)
+ @lbox.see(cidx + 1)
+ end
+ end
+
+ def _config_proc
+ if @lbox.size == 0
+ @up_arrow.pack_forget
+ @down_arrow.pack_forget
+ return
+ end
+ tidx = @lbox.nearest(0)
+ bidx = @lbox.nearest(10000)
+ if tidx > 0
+ _show_up_arrow
+ tidx += 1
+ else
+ @up_arrow.pack_forget unless @up_timer.running?
+ end
+ if bidx < @lbox.index('end') - 1
+ _show_down_arrow
+ bidx -= 1
+ else
+ @down_arrow.pack_forget unless @down_timer.running?
+ end
+ cidx = @lbox.curselection[0]
+ _check_sel(cidx, tidx, bidx) if cidx
+ end
+
+ def _init_binding
+ @up_timer = TkAfter.new(@interval, -1, proc{_up_proc})
+ @down_timer = TkAfter.new(@interval, -1, proc{_down_proc})
+
+ @up_timer.set_start_proc(@initwait, proc{})
+ @down_timer.set_start_proc(@initwait, proc{})
+
+ @up_arrow.bind('Enter', proc{@up_timer.start})
+ @up_arrow.bind('Leave', proc{@up_timer.stop if @up_arrow.winfo_mapped?})
+ @down_arrow.bind('Enter', proc{@down_timer.start})
+ @down_arrow.bind('Leave', proc{@down_timer.stop if @down_arrow.winfo_mapped?})
+
+ @lbox.bind('Configure', proc{_config_proc})
+ @lbox.bind('Enter', proc{|y| _set_sel(@lbox.nearest(y))}, '%y')
+ @lbox.bind('Motion', proc{|y|
+ @up_timer.stop if @up_timer.running?
+ @down_timer.stop if @down_timer.running?
+ _check_sel(@lbox.nearest(y))
+ }, '%y')
+
+ @lbox.bind('Up', proc{_key_UP_proc})
+ @lbox.bind('Down', proc{_key_DOWN_proc})
+ end
+
+ ############################
+ public
+ ############################
+ def scrollbar(mode)
+ if mode
+ @scr.pack(:side=>:right, :fill=>:y)
+ else
+ @scr.pack_forget
+ end
+ end
+end
+
+################################################
+
+class Tk::RbWidget::Combobox < TkEntry
+ include TkComposite
+
+ @@down_btn_bmp = TkBitmapImage.new(:data=><<EOD)
+#define down_arrow_width 11
+#define down_arrow_height 11
+static unsigned char down_arrow_bits[] = {
+ 0x00, 0x00, 0xfe, 0x03, 0xfc, 0x01, 0xfc, 0x01, 0xf8, 0x00, 0xf8, 0x00,
+ 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00};
+EOD
+
+ @@up_btn_bmp = TkBitmapImage.new(:data=><<EOD)
+#define up_arrow_width 11
+#define up_arrow_height 11
+static unsigned char up_arrow_bits[] = {
+ 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x70, 0x00, 0x70, 0x00, 0xf8, 0x00,
+ 0xf8, 0x00, 0xfc, 0x01, 0xfc, 0x01, 0xfe, 0x03, 0x00, 0x00};
+EOD
+
+ def _button_proc(dir = true)
+ return if @ent.state == 'disabled'
+ @btn.relief(:sunken)
+ x = @frame.winfo_rootx
+ y = @frame.winfo_rooty
+ if dir
+ @top.geometry("+#{x}+#{y + @frame.winfo_height}")
+ else
+ @btn.image(@@up_btn_bmp)
+ @top.geometry("+#{x}+#{y - @top.winfo_reqheight}")
+ end
+ @top.deiconify
+ @lst.focus
+
+ if (idx = values.index(@ent.value))
+ @lst.see(idx - 1)
+ @lst.activate(idx)
+ @lst.selection_set(idx)
+ elsif @lst.size > 0
+ @lst.see(0)
+ @lst.activate(0)
+ @lst.selection_set(0)
+ end
+ @top.grab
+
+ begin
+ @wait_var.tkwait
+ if (idx = @wait_var.to_i) >= 0
+ # @ent.value = @lst.get(idx)
+ _set_entry_value(@lst.get(idx))
+ end
+ @top.withdraw
+ @btn.relief(:raised)
+ @btn.image(@@down_btn_bmp)
+ rescue
+ ensure
+ begin
+ @top.grab(:release)
+ @ent.focus
+ rescue
+ end
+ end
+ end
+ private :_button_proc
+
+ def _init_bindings
+ @btn.bind('1', proc{_button_proc(true)})
+ @btn.bind('3', proc{_button_proc(false)})
+
+ @lst.bind('1', proc{|y| @wait_var.value = @lst.nearest(y)}, '%y')
+ @lst.bind('Return', proc{@wait_var.value = @lst.curselection[0]})
+
+ cancel = TkVirtualEvent.new('2', '3', 'Escape')
+ @lst.bind(cancel, proc{@wait_var.value = -1})
+ end
+ private :_init_bindings
+
+ def _set_entry_value(val)
+ @ent.textvariable.value = val
+ end
+ private :_set_entry_value
+
+ #----------------------------------------------------
+
+ def _state_control(value = None)
+ if value == None
+ # get
+ @ent.state
+ else
+ # set
+ @ent.state(value.to_s)
+ case value = @ent.state # regulate 'state' string
+ when 'normal', 'readonly'
+ @btn.state 'normal'
+ when 'disabled'
+ @btn.state 'disabled'
+ else
+ # unknown : do nothing
+ end
+ end
+ end
+ private :_state_control
+
+ def __methodcall_optkeys # { key=>method, ... }
+ {'state' => :_state_control}
+ end
+ private :__methodcall_optkeys
+
+ #----------------------------------------------------
+
+ def _textvariable_control(var = None)
+ if var == None
+ # get
+ ((var = @ent.textvariable) === @default_var)? nil: var
+ else
+ # set
+ @var = var
+ tk_send('configure', '-textvariable', (@var)? var: @default_var)
+ end
+ end
+ private :_textvariable_control
+
+ #----------------------------------------------------
+
+ def initialize_composite(keys={})
+ keys = _symbolkey2str(keys)
+
+ @btn = TkLabel.new(@frame, :relief=>:raised, :borderwidth=>2,
+ :image=>@@down_btn_bmp).pack(:side=>:right,
+ :ipadx=>2, :fill=>:y)
+ @ent = TkEntry.new(@frame).pack(:side=>:left)
+ @path = @ent.path
+
+ @top = TkToplevel.new(@btn, :borderwidth=>1, :relief=>:raised) {
+ withdraw
+ transient
+ overrideredirect(true)
+ }
+
+ startwait = keys.delete('startwait'){300}
+ interval = keys.delete('interval'){150}
+ @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true,
+ :startwait=>startwait,
+ :interval=>interval)
+ @lst.pack(:fill=>:both, :expand=>true)
+ @ent_list = []
+
+ @wait_var = TkVariable.new
+ @var = @default_var = TkVariable.new
+
+ @ent.textvariable @default_var
+
+ _init_bindings
+
+ option_methods('textvariable' => :_textvariable_control)
+
+ delegate('DEFAULT', @ent)
+ delegate('height', @lst)
+ delegate('relief', @frame)
+ delegate('borderwidth', @frame)
+
+ delegate('arrowrelief', @lst)
+ delegate('arrowborderwidth', @lst)
+
+ delegate('state', false)
+
+ if mode = keys.delete('scrollbar')
+ scrollbar(mode)
+ end
+
+ configure keys unless keys.empty?
+ end
+ private :initialize_composite
+
+ def scrollbar(mode)
+ @lst.scrollbar(mode)
+ end
+
+ def _reset_width
+ len = @ent.width
+ @lst.get(0, 'end').each{|l| len = l.length if l.length > len}
+ @lst.width(len + 1)
+ end
+ private :_reset_width
+
+ def add(ent)
+ ent = ent.to_s
+ unless @ent_list.index(ent)
+ @ent_list << ent
+ @lst.insert('end', ent)
+ end
+ _reset_width
+ self
+ end
+
+ def remove(ent)
+ ent = ent.to_s
+ @ent_list.delete(ent)
+ if idx = @lst.get(0, 'end').index(ent)
+ @lst.delete(idx)
+ end
+ _reset_width
+ self
+ end
+
+ def values(ary = nil)
+ if ary
+ @lst.delete(0, 'end')
+ @ent_list.clear
+ ary.each{|ent| add(ent)}
+ _reset_width
+ self
+ else
+ @lst.get(0, 'end')
+ end
+ end
+
+ def see(idx)
+ @lst.see(@lst.index(idx) - 1)
+ end
+
+ def list_index(idx)
+ @lst.index(idx)
+ end
+end
+
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+# e0 = Tk::RbWidget::Combobox.new.pack
+# e0.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu))
+
+ v = TkVariable.new
+ e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true,
+ :textvariable=>v,
+ :arrowrelief=>:flat, :arrowborderwidth=>0,
+ :startwait=>400, :interval=>200).pack
+ e.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu))
+ #e.see(e.list_index('end') - 2)
+ e.value = 'cc'
+ TkFrame.new{|f|
+ fnt = TkFont.new('Helvetica 10')
+ TkLabel.new(f, :font=>fnt, :text=>'TkCombobox value :').pack(:side=>:left)
+ TkLabel.new(f, :font=>fnt, :textvariable=>v).pack(:side=>:left)
+ }.pack
+
+ TkFrame.new(:relief=>:raised, :borderwidth=>2,
+ :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3)
+
+ l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove,
+ :borderwidth=>4,:height=>7,
+ :width=>20).pack(:fill=>:both,
+ :expand=>true)
+ (0..20).each{|i| l.insert('end', "line #{i}")}
+
+ TkFrame.new(:relief=>:ridge, :borderwidth=>3){
+ TkButton.new(self, :text=>'ON',
+ :command=>proc{l.scrollbar(true)}).pack(:side=>:left)
+ TkButton.new(self, :text=>'OFF',
+ :command=>proc{l.scrollbar(false)}).pack(:side=>:right)
+ pack(:fill=>:x)
+ }
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkdialog.rb b/ext/tk/sample/tkdialog.rb
new file mode 100644
index 0000000000..eb8cd04796
--- /dev/null
+++ b/ext/tk/sample/tkdialog.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/env ruby
+require "tk"
+
+root = TkFrame.new
+top = TkFrame.new(root) {
+ relief 'raised'
+ border 1
+}
+msg = TkMessage.new(top) {
+ text "File main.c hasn't been saved to disk since \
+it was last modified. What should I do?"
+ justify 'center'
+ aspect 200
+ font '-Adobe-helvetica-medium-r-normal--*-240*'
+ pack('padx'=>5, 'pady'=>5, 'expand'=>'yes')
+}
+top.pack('fill'=>'both')
+root.pack
+
+bot = TkFrame.new(root) {
+ relief 'raised'
+ border 1
+}
+
+TkFrame.new(bot) { |left|
+ relief 'sunken'
+ border 1
+ pack('side'=>'left', 'expand'=>'yes', 'padx'=>10, 'pady'=> 10)
+ TkButton.new(left) {
+ text "Save File"
+ command "quit 'save'"
+ pack('expand'=>'yes','padx'=>6,'pady'=> 6)
+ top.bind "Enter", proc{state 'active'}
+ msg.bind "Enter", proc{state 'active'}
+ bot.bind "Enter", proc{state 'active'}
+ top.bind "Leave", proc{state 'normal'}
+ msg.bind "Leave", proc{state 'normal'}
+ bot.bind "Leave", proc{state 'normal'}
+ Tk.root.bind "ButtonRelease-1", proc{quit 'save'}
+ Tk.root.bind "Return", proc{quit 'save'}
+ }
+}
+TkButton.new(bot) {
+ text "Quit Anyway"
+ command "quit 'quit'"
+ pack('side'=>'left', 'expand'=>'yes', 'padx'=>10)
+}
+TkButton.new(bot) {
+ text "Return To Editor"
+ command "quit 'return'"
+ pack('side'=>'left', 'expand'=>'yes', 'padx'=>10)
+}
+bot.pack
+root.pack('side'=>'top', 'fill'=>'both', 'expand'=>'yes')
+
+def quit(button)
+ print "You pressed the \"#{button}\" button; bye-bye!\n"
+ exit
+end
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/ICONS/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/ICONS/Orig_LICENSE.txt
new file mode 100644
index 0000000000..71e359559a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/ICONS/Orig_LICENSE.txt
@@ -0,0 +1,61 @@
+
+ #########################################################################
+ ### The following text is the original file of the Tcl/Tk extension. ###
+ ### Icon data files ( those are 'tkIcons', 'tkIcons-sample.kde', and ###
+ ### 'tkIcons.kde' ) are quoted from the source archive of ICONS ###
+ ### extension. As the following document describes, those icon images ###
+ ### are not applied the license. ###
+ #########################################################################
+
+
+IMPORTANT LICENSE INFORMATION
+=============================
+
+The following terms (based on the standard TCL/TK license) apply to all files
+contained in this package, <b>except</b> the icon images.
+
+The icon images can be freely distributed. If you require clarification of
+copyright/license details for the images, please contact the appropriate
+creator/maintainer.
+
+ICONS: LICENSE TERMS
+====================
+
+This software (ICONS) is Copyright 2002 by Adrian Davis (adrian@satisoft.com).
+The following terms apply to all files associated with the software except
+where noted above.
+
+The author hereby grants permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that
+this notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file
+where they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+OR MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense,
+the software shall be classified as "Commercial Computer Software"
+and the Government shall have only "Restricted Rights" as defined in
+Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing,
+the authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/tkextlib/ICONS/tkIcons b/ext/tk/sample/tkextlib/ICONS/tkIcons
new file mode 100644
index 0000000000..0d5b2c8695
--- /dev/null
+++ b/ext/tk/sample/tkextlib/ICONS/tkIcons
@@ -0,0 +1,195 @@
+actattach16:act act16 16:photo:16 16:R0lGOD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dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+actcheck16:act act16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAAACH5BAEAAAAALAAAAAAQABAAAAM2CLrc/itAF8RkdVyVye4FpzUgJwijORCGUhDDOZbLG6Nd2xjwibIQ2y80sRGIl4IBuWk6Af4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+actcross16:act act16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/PwCBMQCBEQCBIQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMuCLrc/hCGFyYLQjQsquLDQ2ScEEJjZkYfyQKlJa2j7AQnMM7NfucLze1FLD78CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+actexit16:act act16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBDQyNHR2dCH5BAEAAAAALAAAAAAQABAAAAI4hI+pFrHb3nEg1iWiDiINCwYDko0V9XUTda6I1TIsUMpGinyzbB6ZeGuoEr+GUDL4CXqSphPhLwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+acthelp16:act act16 16:photo:16 16:R0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bHGBMj1daARgEjLyN03kPZc09FfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+appboxes16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBMT+xAT+BASCBATCBMT+/AT+/ASChATCxPz+xPz+BISCBMTCBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEEgZwrwYBCFqvhs3DNYXjChRlWBRjIRqGN4UuEUczMZxsDeXykdEsDQVVSLhQxhBCkVlmXA+KVHFYhFYOoHbMGN6pTQaW8YYiQmcG+q16a0+Zipw+4e9B/gjACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+appbox16:app app16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+xISCBMTCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANECKoR6ys2IVqokF08yMTA1gwkYX5WQK5ma4VceTYPxXnBWdtY6+0834/Bowgzm6APWRQcH4TiMhPK2WYRiZWW7XK7/gQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+appbrowser16:app app16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBFxONCROfCRKfKx6LNy+bNTOpGSS1DRupAwyXBRSnPTSjPTqvOzqzMzSvHSSlKy6ZDxutAxCpBQ2XBxepLTKvPzqzPzy5OTShLS2dLSqRFR2jBRerBQ+jOTixOzet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0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+appclock16:app app16 16:photo:16 16:R0lGODlhEAAQAIIAALy+vAQCBPwCBMQCBIQCBISChPz+/MTCxCH5BAAAAAAALAAAAAAQABAAAANbCLHcrSLKOZcYmDSCsR1aUABAsXDDJwJGa5SBFwgaWxbCG3CWaBwG3C8Y67FawpYiNQscg65fsVkYuoAmJs1pBR522lQB6ILJLqHRwQQOZzYdZnw+dzruDIA/AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+appdate16:app app16 16:photo:16 16:R0lGODlhEAAQAIQAAASC/AQCBPzerPyqXMRaBIQCBISChPz+/KSipMTCxPz+BMTCBPwCBPz+xPzCxMQCBISCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVxICCOQGCeJjkGwkC8RFEEavkax2G8dB0QuRyhhzoBg8MSYsncJXKJZIDZHCoWP1ogGIwGrtnSgUFmHLyNRHhrdpjRamnO/SYkromHdnxwnwkKVxByZW8DgQsQM2JcfwZXO0MBCZSVBgMuLzJaRZ0pfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+apppencil16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/IQCBMQCBPzCxAQCBPz+/MTCxISChDQyNKSipEQCBAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARDEMhJZRBD1H2z3lMnjKCFjUJQimOgcmcbELCXzjXq0hV785WCQYcDFQjDXeloMByKG6YTAdwIDAlqSZJSVFeKLcUfAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+appsheet16:app app16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBAT+/Pz+/KSipPz+BAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANFCBDc7iqIKUW98WkWpx1DAIphR41ouWya+YVpoBAaCKtMoRfsyue8WGC3YxBii5+RtiEWmASFdDVs6GRTKfCa7UK6AH8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+apptool16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBISChGRmZMTCxKSipLS2tHx6fPz+/OTm5FxaXOzu7DQyNMzOzAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAReEMhAq7wYBDECKVSGBcbRfcEYauSZXgFCrEEXgDCSeIEyzKSXZoBYVCoJVIqBGByKu0Cy8QHxmgNngWCkGgqsGWFseu6oMApoXHAWhWnKrv0UqeYDe0YO10/6fhJ+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+apptools16:app app16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBExKTERCRAQCBOzu7Nze3MzKzLy+vCxqZBQ2NJyanKyqrGRiZDRydKza3FRWVPT29LSytDw6PMTm5EySjCxaXGRaJFSanCRSVGxqbPTmvMSqVJTW1GSurHS6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DJLQXsupTJmeEIN4TB5nII20wp8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+cal5days16:cal cal16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANMCLrMEUDIOUS9AFLLhx8LIRZjKYbj55GioRRwoQ5x4QIiIdMmcec7jy53q81qP9OO5VMAj8RXTFWzOZW95HDLdEEM4LA4nIE0zgp/AgAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+cal7days16:cal cal16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANPCLrMEUDIOUS9AFLLhx8LIRZjKYbj55GioRRwoQ5x4QIiwcp0fucsj873qvGMv5Jw2FIACUsW4WakGW1O046I05qmGYBhTC6TM5CGWuFPAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+calappointment16:cal cal16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBPwCBAQC/AQCjPz+/MTCxPz+BISCBISChKSipAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAARbEMhJaQhA6D1E/wDGeeRgDhOhFoTBEi+REgdrIHScSEVvAD9Xr7cDqGSGpFEnQSqTv2NxCFQ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AAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZbihUiz60FPnfaA0iBpBVGdHEYWxToEoSHBRHHM9AgSEQRcj+AYkYAJxIPKQFUJiOdTJQFIDU6dYzKKFhTCM+E5g4mXaDAyrlogEG+DGTecA7wsP8EcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connectno16:connect connect16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBAQCBERCBPz+/MTCxMTGxISChFxaXMzGzKSipAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARPEMhJq704axBEHoPUEdhQGMNYFuwxkKInDYjBniEnwMCQIIebSzXx/WwsFK+YMABZikWuYlrUCtZpEYv4WRPaHhb064YB41kCfJFSQBh/BAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+connectyes16:connect connect16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/KSipDQyNMTCxMTGxISChFxaXMzGzAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZxCjgsAtDtUlCOA1gJQ4kl/IDatAoF7xxkS6GgEBr6jAobCyBX42SQBxMOx6A8MhiGASR8YDgrYsNEeJ0zaEGZY7uoH2oB6nOUwtbdLaVOeTUwo/8UcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY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ZlbGNvci5jb20AOw==
+devfloppyunmount16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBMTCxARmZPz+/FSWlLSytKSipERCRIyOjISChOTm5HRydNza3GRiZFRSVCH5BAEAAAAALAAAAAAQABAAAARcEMgJQqCYBjFu1hxReN82EOhYGieaklJwHIjrqnGCJLqNWhUFYoFQCG1FgWXIIDIYNQKCoawQGI0swuFAbKsxgmDsfZjBkwDBsNM90Jot9A3DbBD0Dwiur9QnfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+devnetwork16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBISChPz+/Nza3ARaZESanCyKlARudARGTLy+vNzq7ARmbMTCxARufAROVMzOzKSipARyfOzq7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVmICAGZFmKQiACweCSBImq41AYB5IodLq2hwWO0ejRWDac48Gb/QKNqNRoqspmrVcAUuIJBANS8sBIFCORUgooPEh4J8B67NgdsVBp9C5XWfl9LRMTCyReX19hARNojWlWLH+AAH4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+devpc16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBISChHx+fPz+/AQCBAQC/AT+/AQCxAQChAT+BLy+vAR+BAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARYEIAgqK1YzsG754QUDERpmkEpkkXrtoK6EcVgHIibhnNx564Yb0TDvQq7FQ34EiqPOhn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NHTmpvy3rxnnwQh1mUI52o6rCu6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav1uparrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIYhI+py+0PWwhxzmetzFpxnnxfRJbmufgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+nav2downarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIfhI+pq+EPXYpxUckoO3AjbF3dJwahllXe6AFgC8d+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+nav2leftarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pyxf5VohmSlsxmpjTzAHeN5ak6UHpqKRi2GpwvH3Q3eT64RcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav2rightarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pq5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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZfQIBwSCwaj8hhQJAkDggFQxMQIBwQhUSyqlgwsFpjg6BwPCARySSstC4eFAqEURlYhoMLBpPRUDYcHXt7RgUeFB8gIU0BIoiKjAcUIwiLSQUkJRsmGIwJJwmEU6OkfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+playeject16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+py+0R3IFQUtruXVqn3kkWyIARR4rqKvoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+playend16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+py8Eb3ENRggrxjRnrVIWcIoYd91FaenysMU6wTNeLXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+playpause16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIfhI+py+1vgoxzyUCxrZd18ClfmIyVyJ1lqkHuC0N+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+playstart16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pyxudwlNyguqkqRZh3h0gl43hpoElqlHt9UKw7NG27BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+playstop16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+1vgpySUWpvXXqrHmSaeJEYhKYq6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textblock16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py40Bo5SOzRvrwlgrfnkJOIkPaaaJXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textbold16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIihI+py70BowPQ1HZpwNv212Vg9IGHmIjoWa4ey5DSRNd+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textbottom16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIVhI+py+0Po5y0hYtzrkB7zH0fN/kFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textcenter16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsnRkqtDnhu1zHfFSpjaY4PavgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textitalic16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+0BgztwUmmjBXX3jE0auHHhM5Yq4xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textleft16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsgRoqr3Vnt102fFSJjUC6nlPoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textmiddle16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIXhI+py+0PT5i01pisphjt3UmfFZYm5hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textmove16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsg2kfZvblXbwTg10WlA4rjyvgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textright16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+pm+EPIZstSrqsDhhv1ylfFE5jiYwX6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textsortdec16:text text16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BPwCBAQCBAQC/FxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM5CBDM+uKp8KiMsmaAs82dtnGeCHnNp4TjNQ4jq8CbDNOroIe3ROyEx2A4vOgkOBzgFxQ6Xa0owJ8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textsortinc16:text text16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BAQC/AQCBPwCBFxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM4CAqxLm61CGBs81FMrQxgpnhKJlaXFJHUGg0w7DrDUmvtPQo8qyuEHoHW6hEVv+DQFvuhWtCFPwEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIlhI8Jwe2/AmpTynqPTXSqrnBM+I0kdmpmGmUp+K4nPMvhYx9+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+texttop16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIWhI9pwe2uYnq0yQtqxbz7D4biSIZ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textunder16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pu+FxXoOIKpds1oBH7hlYxYxRCaIZ01lhJbHy9tTv7BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewchoose16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMzCLrcGlAs6UAYgwLdLtEcI4ygQo7VVp2oupGpG4vmaUVTemX523qlFcw0a4RqNlkx5k8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewdetailed16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMmCLrc/i1IAVkYg1Z1iRYUKCqitp1oikqBWV3ZOnhkWNagqu+qnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewicon16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMwCLrcG1AwGOQbw6qANeCEB3pCSZpO6pgowJZqLKuUGE0dnuEhf8IL1kz1shSHDX8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewmag-16:view view16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBCQmJDw+PAwODAQCBMza3NTm5MTW1HyChOTy9Mzq7Kze5K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ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewtext16:view view16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIchI+py40BTQSwuovp3DXkv1ia1IHmIXLiyWJ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+viewtree16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBDQyNPz+/PzerAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAMuCLHcri4yGISlj4kxcANgNRBQCIbL6U1Su7bB62rXvGydG25kqpwfIGxILBr9CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+actattach22:act act22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBMTCxPz+/DQyNKSipAQCBISChFxaXDw6PAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARrEMgJgqA4zzus/gLhFd5HCcZAXqsphYPUdhcYFNRcZnvdtpnDqPTbUWgAJKBYwzBlw+bRo3xmkNWoBgm0OrVLn3GC9RgCk8DhUw7c0rHPr4CDu5SYQNyEt7uSY3p/UAKFhYKDSQOLiwgFdhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+actbookmark22:act act22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBCQmJCwqLMTGxAQC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Fi9vjeeNUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textbold22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIxhI+py+0Powm0VnknjVkH2AEhE45LZ55Wqn6e65TsMc5eYosbksswubJIhsSiccgvAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textcenter22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUbz3Sh7yIWfFHKjVl4nmFrr1Lpr7LwkjeeIUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textitalic22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py+0P4wqUSlQvttrkDnyaOHIdeaGRupplAIauVM3xjeeOUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textleft22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+pyw0B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5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewchoose22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBFRSVExKTDQyNPz69PTq5Pz+/OzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARTEMhJq70466Cl+AMxBVwnFIVRAmQHCIeBrC1L3tQgJ/SaEbeeC1PLBHE2ybFI9A1HzstHEIK6YCmhDTmBybQaHYJn7QC5zKeytIQe1+pKNE6P2yMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewdetailed22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz+/Pz69PTq5AQCBOzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAQ+EMhJq7046817+MLQUQFRGMc4lQaSAkcMx3QltMmrDrSu/sCgEPgJhIiFk89DaL1qPRnlhsgBebWhdstVESIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewicon22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz69PTq5AQCBPz+/OzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARWEMhJq7046z2DF0PlBeAVEERhiKhqHgWyUgEsX0KczFOO7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FOzKpFRWVFxWXOzexPTexCH5BAEAAAAALAAAAAAWABYAAARPEMhJq704g6A779kHCORAgNskFMYhakE8FkjyBcoWv+JwJItXaELYCTFHlCSpZKKcoB5jYHpOGgUadLKbIRw3jhEzQDyCSuI4zW673yhDBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
diff --git a/ext/tk/sample/tkextlib/ICONS/tkIcons-sample.kde b/ext/tk/sample/tkextlib/ICONS/tkIcons-sample.kde
new file mode 100644
index 0000000000..51f76a0488
--- /dev/null
+++ b/ext/tk/sample/tkextlib/ICONS/tkIcons-sample.kde
@@ -0,0 +1,658 @@
+1downarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIYhI+py+0PUZi0zmTtypflV0VdRJbm6fgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+1leftarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAP///wAAACH5BAEAAAAALAAAAAAQABAAAAIdhI+pyxqdwoNGTmgvy9px/IEWBWRkKZ2oWrKu4hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+1rightarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIdhI+pyxCtwoNHTmpvy3rxnnwQh1mUI52o6rCu6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+1uparrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIYhI+py+0PWwhxzmetzFpxnnxfRJbmufgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+2downarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIfhI+pq+EPXYpxUckoO3AjbF3dJwahllXe6AFgC8d+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+2leftarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pyxf5VohmSlsxmpjTzAHeN5ak6UHpqKRi2GpwvH3Q3eT64RcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+2rightarrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pq5HOAjQyVnqfhHue7oAaKH5kiW0AmnLqaHomkj02g+e6XwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+2uparrow-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIghI+pyxfR0HsRzNnuXVqn3mVQZWFRyIDjp65Ga5Ly4hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+abs-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAQABAAAAIwhI95ocn2GlySTiME1iC+DIKdNWxANl4HaqWr055cy6Bs6dahmJsyXVFFJJ7gyF8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+airbrush-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/AQCBPzCxMQCBIQCBPz+/MTCxKSipFxaXDQyNISChAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARUEMhJZxCjanBH3hY2EFJgVt0YcEW7liLxBoVxzPHL2msqUzSeT2c5HBC5jQmROKgAhCgKEVBQo6YAqVQIHBQ93ZbmBWt+nDJRgiYMvmuoThWXT/wRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+attach-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBPz+/AQCBAAAACH5BAEAAAAALAAAAAAQABAAAAI2hAOCxg2h0nJHyEshi9HpxU1GOCLdZoKpQ15nibUoprKp9lh2oucUxsBRXsJh4Hjs/QTMpr8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+back-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBBRSdBRObCQ2TBxObISevAQCBNzu/BRGZPz6/FzC3Pz+/HTS5ByyzJze7Mzq9ITC3AQWLAyWvBSavFyuxAwaLAwSHBRafBSOrDzW5AyixCS61ETW3CzG1AQeLAweLAxefBSStEze7CSWtCyatBSCnBRWfAwmPBRWdByixAQSHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZiQIBwSCwah4HjUTBQFgkFg3MoKBykU0QhoUAIAuAksbpgNByPxQMSGVsVDYlkIqdUiJYLJqORbDgcHRseRR8gISIaEyMkGCVYRBEmeyAnlgaQkSgpmU4RAZ1OKqFOpFNGfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+blend-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBARCRAQCBASChATCxATCBASCBAAAACH5BAEAAAAALAAAAAAQABAAAANHCLrc/izISauYI5NduvlXMIjEQBSnUYCYxnmsSJrouhqh6J4wLo0mWuqWy5heN58seBrGdEdeMgQsNW0ggXbL7Qog4HDDnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+bookmark_add-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy6vERGRFRWVDQyNKSipAQCBMTGxKyurISChJSSlJyanHR2dIyKjPz+xISGhPz+BGxubMTCBHx+fPz+/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVfICACwWieY1CibCCsrBkMb0zchTEcNYsIiYHiwIOdEAvigdFQGE0Ix4NBbSAgsWjk+jBIAlcUYrJASChnSXZSoUDelKfoKpFALJA61ueGI2IAZmhogGFmCGGAgXsifiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+bookmark_folder-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExKTBQWFOTi5OTm5CwqLPz+/PTy9Ozu7FRSVNza3PT29KSmpAQ6XARqnNTS1JyenGRiZJTa9Mzq9JzO5MTGxIyOjKSipFxeXMzOzDw+PDy65FTC7HS2zMzm7MzKzKSenASq5Bx+rBSGrFyqzLSytDw6NAR+zBRejBxqnLSyrERCRIyqvDRujKyurMTCvOzq7AQ2VDQ2NNze3KyqrGxqbLS2tLy6vCwuLDw6PAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAawQIAQEBAMh4GjcEAoCAQGYSCpDBwQiQJBEVhQj1YGo1DoNqZTx8PhODAWZUik0ZAkHRNKZe0IWC4RGBkBGhsOHB0eFR97bBdcICEbAA4iIyQlioxrGhEmJ5QoKSoqJCOZiw4rGixEYi0uo6WYDi8wkwAsCTFksLIuMi+tADMLNAsLEBAgLSMpMjW4RCc2MCAgFjA3MA4R0kgzGS84Ny8vDqBKSDkKETUOOurqAQagfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+bookmark-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy+vERGRFRWVDQ2NKSmpAQCBKyurMTGxISChJyanHR2dIyKjGxubHRydGRmZIyOjFxeXHx6fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVbICACwWieY1CibCCsrBkMb0zchSEcNYskCtqBBzshFkOGQFk0IRqOxqPBODRHCMhCQKteRc9FI/KQWGOIyFYgkDC+gPR4snCcfRGKOIKIgSMQE31+f4OEYCZ+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+bookmark_toolbar-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy6vERGRFRWVDQ2NKSipAQCBKyqrMTCxKyurISGhJSSlJyanHR2dIyKjGxubIyOjISChHx+fPz+/MTGxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVpICACwWieY1CibCCsrBkMb0zchTEcNYskCsXiwIOdEAzioeFIGE2IB6RBbT5HiAhEIpk6Y9kJBMJoHK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ZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+brackets-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAQABAAAAIzhI8JwXocllMxTlSREGY/2W2iJ1nAEAJklpCfeXAJG8sY6JGowY7jW0sBL0NiqTGBAPwFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+charset-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAInhI+pqxH8kFsvsgtm1vvEaoBZSH6j5FSaRY4me4pyq1ochuf6fvgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+colorize-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPz+BAQCBPz+/MTCxISC/AQChMTC/ERCBPyqXMRaBATCxASChPzerKSipMT+/MQCBATCBASCBARCRISChMT+xDQyNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVnICAGgWieZyCQKGuqZPkGgwyv60gONRDvNlqt9Pv5BgRCYVj8IQ3L4qE4KFiZzRiP90MgEj+FYtGLIRiJQaMxUDjIxFoi8YBAIo3FQjIJ7iAUERNqDTI6PBGJfT0oFVpsMSgzkSh+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+colorpicker-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBARCBDQyNMT+xATCBASCBPz+/FxaXISChAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAQ/EMhJZRCjahBIMdlmeV8gBl3xCabWGarBihwBz+eB2O0WHIFEp1f5BU1EilFI4wCZtGWy+JwWj00OynrNTvwRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+completion-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+/Ly+vHx+fAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM/CLrcGjBKCYK4+NoMs+jWIBIdZ50QuWGgMASD+oGnO5beR+x7UE3AyGKV0wxnpeSxyDoGN74Hszl8QhxYhj8BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+configure-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBISChGRmZMTCxKSipLS2tHx6fPz+/OTm5FxaXOzu7DQyNMzOzAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAReEMhAq7wYBDECKVSGBcbRfcEYauSZXgFCrEEXgDCSeIEyzKSXZoBYVCoJVIqBGByKu0Cy8QHxmgNngWCkGgqsGWFseu6oMApoXHAWhWnKrv0UqeYDe0YO10/6fhJ+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+connect_creating-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBISCBAQCBPz+/MTCxMTGxISChFxaXMzGzKSipAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZbihUiz60FPnfaA0iBpBVGdHEYWxToEoSHBRHHM9AgSEQRcj+AYkYAJxIPKQFUJiOdTJQFIDU6dYzKKFhTCM+E5g4mXaDAyrlogEG+DGTecA7wsP8EcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connect_established-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/KSipDQyNMTCxMTGxISChFxaXMzGzAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZxCjgsAtDtUlCOA1gJQ4kl/IDatAoF7xxkS6GgEBr6jAobCyBX42SQBxMOx6A8MhiGASR8YDgrYsNEeJ0zaEGZY7uoH2oB6nOUwtbdLaVOeTUwo/8UcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connect_no-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBAQCBERCBPz+/MTCxMTGxISChFxaXMzGzKSipAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARPEMhJq704axBEHoPUEdhQGMNYFuwxkKInDYjBniEnwMCQIIebSzXx/WwsFK+YMABZikWuYlrUCtZpEYv4WRPaHhb064YB41kCfJFSQBh/BA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8CSKYIw8kDRSfDiUmJ4xCIxMoKSoRJRMrJyy5uhMtLisTLCQkC8bHGBMj1daARgEjLyN03kPZc09FfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+contexthelp-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQChAQCBAAAACH5BAEAAAAALAAAAAAQABAAAAIzhH+hIeiwVmtOUcjENaxqjVjhByaBSZZVl24Y1V6iEVMzkD4bqD700bshgh1fzwd0IfwFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+crop-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBMT+xATCBASCBISChPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAM0CLrc/iG+FsQgYapKbp7c4IFCZ2FQOQQE6oSl9Koxabrz/eVDDXat3atAlEEMSKFmyfAnAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+decrypted-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaVAQCBKSipDQyNMTCxISChFxaLFxSJExGHEQ+FCQiDBwaDBweDGxiLHxyNHRuPIR+RIyGZJSSfFxaRGxmLJyaXNzWpNTOnMzGnMS+jJSKTGReLKyqjPTu1NzarLSufKyibJySXIyGVGxiNFxaXLSytPT29Ozu7OTi5NTS1KyurGxqVCQeDJSSjLS2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pb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+exit-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBDQyNHR2dCH5BAEAAAAALAAAAAAQABAAAAI4hI+pFrHb3nEg1iWiDiINCwYDko0V9XUTda6I1TIsUMpGinyzbB6ZeGuoEr+GUDL4CXqSphPhLwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+fileclose-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCQiJBwaHAQCBDQyNDw6PFxaXFRSVERGRCwqLAwODGRiZHx6fPz+/GxqbAwKDCQmJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVaICCOZGmeqBgEwjCkRGEcSKK4JrEcBrMgAdeLVDg0GguGsYEbBQyGYyN6FDoPDIf0+LCKBIgetQERDgGDBGIpNY8GioAU0m6KXFw883w3+/l9f4AkfimGIn4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+filefind-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBCQmJDw+PBQSFAQCBMza3NTm5MTW1HyChOT29Ozq7MTq7Kze5Kzm7Oz6/NTy9Iza5GzGzKzS1Nzy9Nz29Kzq9HTGzHTK1Lza3AwKDLzu9JTi7HTW5GTCzITO1Mzq7Hza5FTK1ESyvHzKzK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ZWxjb3IuY29tADs=
+idea-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+BPzerPz+xPyqXPz+/ISChFxaXKSipDQyNAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARMEEgZap14BjG6CJkmEMVQCF+4mQPBpthWtuYJxkJJGK6dbQRCgMBB3XCDzQamMhpDGlvuCFUyoQDLBUsJHBDUKuKQCKsUCIVZtc34IwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+int-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBIQChAQCBAwODAQGBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMwCKqx/iw0CNukzuJ8d1yCAAziIyliCKjck1ZuaV4igZ1r+raongE4j8YT6QiJC38CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+locationbar_erase-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAIshI+py40Bo1SywgSFiDq+oG3hZHDhVpUmagFrl7pgN3oqPNuqpe+8Awwi/AUAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+lock-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaVAQCBKSipDQyNMTCxISChFxaLFxSJEQ+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AQ4QTfowNPoAzJIeRJCyjm8kVRIkWIzSkXhwxJtYAKgp9VrFi5QoWKFZ5+AgEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+matrix-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBIQChCH5BAEAAAAALAAAAAAQABAAAAIrhI9pwQHt4Jru2Vsjna919lXKeEimh6UZp1lrCEvkfILyirOby3q1OEv4CwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+misc-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChMTCxDQyNFxaXKSipPz+/CH5BAEAAAAALAAAAAAQABAAAANdCLobwbAFMciLwBFSihBEFHSG8QnmpQQEBX6loI5G5QTlcMgrZSmEmsGxKqRWNV3hMrFlBtDoA1eTEaKHJdMYhR6+gxkF++UMGbiDzvDVioyHAJSHcchuGLQq4k8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+move-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhA8RyKja2HtRrmrxNfDszm3JMpXmiULg6Hyto4kYO49Tfdc04xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+news_subscribe-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/ERCBDQyNAQCBPz+/FxaXIQCBMQCBKSipMTCxATCBMT+xISChASCBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARsEEgZxLxYDlJsvsJGDN0nFQRhpKR3DSJxrGMphYQgpDI9WLhdTtjjAFApXZI30m2UQwICVigcEzzolKAYIAIFBAKbQjQX3YGGISZvFtzFQr1uDxT4PH0yYE8FCg0/Jn0MAwsNOiY3IQMBEn4RACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+news_unsubscribe-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/ERCBDQyNAQCBPz+/FxaXIQCBMQCBMTCxPzCxKSipAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARiEEgZxLxYDlJsvsJGDN0nFQRhpKR3DSJxrGMphYQgpDI9WLhdTtjjAFApXZI30m2UwxjsiOApB4kNLFtQKKopxeCQxR4GAJIXPCInzmhN9zvCljNq8ZvswmzhZHEfOhpofhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+next-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBFwyXAQCBOze9BwCHNx21LQCvPSi5NRi7AAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAQ3EMhJqwUhAMG7DQOxdVwFFuI1nYZIethwIK0aFwjtwrfh15c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BQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+paintbrush-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBMTC/AQChPz+/MTCxKSipDQyNCH5BAEAAAAALAAAAAAQABAAAAM7CLrMIS2qN2Sj1U4xugaYZxFE1wUaURQnKpFBYQTuFRiyXDsCd8y7RYhmCQ2IkiHywmkFN84ibfrxJwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+paren-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAQABAAAAI3hI+JEQq8mnvyzSOhEWJ3CgLcOILV4IlfUx1cwirfYiEvXL83arANSer5UipM5tIzXjRCh8ZfAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+pencil-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/IQCBMQCBPzCxAQCBPz+/MTCxISChDQyNKSipEQCBAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARDEMhJZRBD1H2z3lMnjKCFjUJQimOgcmcbELCXzjXq0hV785WCQYcDFQjDXeloMByKG6YTAdwIDAlqSZJSVFeKLcUfAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+player_eject-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+py+0R3IFQUtruXVqn3kkWyIARR4rqKvoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+player_end-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+py8Eb3ENRggrxjRnrVIWcIoYd91FaenysMU6wTNeLXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+player_pause-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIfhI+py+1vgoxzyUCxrZd18ClfmIyVyJ1lqkHuC0N+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+player_start-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pyxudwlNyguqkqRZh3h0gl43hpoElqlHt9UKw7NG27BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+player_stop-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+1vgpySUWpvXXqrHmSaeJEYhKYq6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+previous-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBFwyXOzC7PTq9OTK7IQyhBwCHNRi7LQCzPSi5IQ6jLwKzORy7AAAAAAAACH5BAEAAAAALAAAAAAQABAAAAQ8EMhJKwg4W5o1EGAIbt8wEERhHJ0mIEmiLAH5IYxi1JcnvTOeTdDYcVo1gfHY+hxs0IkvSpV2qtgswB8BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+prod-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBIQChCH5BAEAAAAALAAAAAAQABAAAAIihI+py50Bo4SKHlsDwk9fn21gJzIcV37miKpuZ0nOTBt+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+queue-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBMTC/Pz+/CH5BAEAAAAALAAAAAAQABAAAAI5hI+pFrEahGgPtCinS2GMlknU0Xkflm2l6YEiw8aRGssTXLe3lZsznvuRViw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dmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+rotate_ccw-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBFxaXIQChEQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM0CLrcHjA6JcK4ET68MrNDoIgjOYbdJ4IXagIa3IqVFAMEOqpfn067ErBxG0qGsCJyyQT4EwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+rotate_cw-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBIQChFxaXEQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMzCLrcHjA6FaG4YbS6At5BR31UKI4mADGhd31rpbmCuZ6qQLA8XvqT2+QhHLKKxqSy4U8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+rotate-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBFxaXIQChEQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM0CLrcHjA6JcK4ET68MrNDoIgjOYbdJ4IXagIa3IqVFAMEOqpfn067ErBxG0qGsCJyyQT4EwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+rsub-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBIQChAAAACH5BAEAAAAALAAAAAAQABAAAAInhI8Jwd26YJBUTVvT1Rlt3x2f6DjQeQiGigLCC7crK7+yC9sty/oFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+rsup-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBIQChAQCBAAAACH5BAEAAAAALAAAAAAQABAAAAImhI+pGtZ7gpwQyWofnnQ7I4SiuAjlqZgpmqgti7gxfMh1OY6LXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+run-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/ISChKSipMTCxLS2tLy+vMzOzMTGxNTS1AAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARlEMgJQqDYyiDGrR8oWJxnCcQXDMU4GEYqFN4UEHB+FEhtv7EBIYEohkjBkwJBqggEMB+ncHhaBsDUZmbAXq67EecQ02x2CMWzkAs504gCO3qcDZjkl11FMJVIN0cqHSpuGYYSfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+signature-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAFxaXPwCBAQCBDQyNPz+/KSipERCBAQChISCBMTCBPz+xMTC/AQC/MTCxPzerAAAACH5BAEAAAEALAAAAAAQABAAAARwEMhJZwgCiM17DoMkEGRpAmGhmSxhAOrakim6DgeLJApRhCPCgJRT8AhGEVFIQigAxgSQsBgwms8oIrDKDZNGxJY7GuYQULHhQj4shAmAuNAQsFc9xY4uUNgvMiQOBIMOfncjeUhICocXAx6RfwF+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+spellcheck-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPzCxPwCBMQCBIQCBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM7CLrcGuHBNZ+NIOJ9O4MTaH2e1nDoiFYZJjgwIAzwy8yEgy84RhWDQa4HCwAHxJgxSPApC83YyQnwJwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+sqrt-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBIQChAQCBAwODAQGBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMyCLrcDiHK6eIL9WmsmwWCAAyiwkGKGILihzLq8p1s9onE9a48Iy28ko/WgRCLyGTDnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+stamp-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+xMTCBISCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANCCLr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SRMRaVKxybMxaVEQWFMQuJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaaQIAQEBAMCAWDYcgkHhAJxYLRcDQBggckIplQKpaLdRh4YDIaSWa94Vw6woAHgv6AMKGPaMQhwQMJJRkfhHmEJhdvRCcgGSCEkCgpbnAECiorGYYfLCItlAAFCygQj5AfbYlwBQwVE5AukG6KBi8tMC0fLi0pHxyzcAAxFxwmMny/wEwOxMm/qlcdJCSJ1H5XQh3a28HY3kx+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+sum-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBIQChCH5BAEAAAAALAAAAAAQABAAAAIdhI+py60BowyPJriwQ3qb7oGNyJCZtZHixHpu4xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_block-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py40Bo5SOzRvrwlgrfnkJOIkPaaaJXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_bold-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIihI+py70BowPQ1HZpwNv212Vg9IGHmIjoWa4ey5DSRNd+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+text-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIlhI8Jwe2/AmpTynqPTXSqrnBM+I0kdmpmGmUp+K4nPMvhYx9+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+text_italic-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+0BgztwUmmjBXX3jE0auHHhM5Yq4xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_under-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pu+FxXoOIKpds1oBH7hlYxYxRCaIZ01lhJbHy9tTv7BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+toggle_log-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBATCxMTCBPz+xPz+/ERCBASChISCBARCRAAAAAAAAA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AAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMzCLrcGlAs6UAYgwLdLtEcI4ygQo7VVp2oupGpG4vmaUVTemX523qlFcw0a4RqNlkx5k8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+view_detailed-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMmCLrc/i1IAVkYg1Z1iRYUKCqitp1oikqBWV3ZOnhkWNagqu+qnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+view_icon-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMwCLrcG1AwGOQbw6qANeCEB3pCSZpO6pgowJZqLKuUGE0dnuEhf8IL1kz1shSHDX8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewmag--16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBCQmJDw+PAwODAQCBMza3NTm5MTW1HyChOTy9Mzq7Kze5Kzm7OT29Oz6/Nzy9Lzu7JTW3GTCzLza3NTy9Nz29Ize7HTGzHzK1AwKDMTq7Kzq9JTi7HTW5HzGzMzu9KzS1IzW5Iza5FTK1ESyvLTa3HT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Oi8vd3d3LmRldmVsY29yLmNvbQA7
+viewmag+-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBCQmJDw+PAwODAQCBMza3NTm5MTW1HyChOTy9Mzq7Kze5Kzm7OT29Oz6/Nzy9Lzu7JTW3GTCzLza3NTy9Nz29Ize7HTGzHzK1AwKDMTq7Kzq9JTi7HTW5HzGzMzu9KzS1IzW5Iza5FTK1ESyvLTa3HTK1GzGzGzG1DyqtIzK1AT+/AQGBATCxHRydMTCxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaBQIAQEBAMhkikgFAwHAiC5FCASCQUCwYiKiU0HA9IRAIhSAcTSuXBsFwwk0wyYNBANpyOxPMxIzMgCyEiHSMkGCV+SAQQJicoJCllUgBUECEeKhAIBCuUSxMKIFArBIpJBCxmLQQuL6cAsLECrqeys7WxpqZdtK9Ct8C0fsHAZn5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+view_multicolumn-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMwCLrc/ixI0WSgKoyBl+beQFACpo1AqXbKCr1wLAMWS08hGG3dSZqin4sxnBmPD38CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+view_text-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIchI+py40BTQSwuovp3DXkv1ia1IHmIXLiyWJ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+view_tree-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBDQyNPz+/PzerAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAMuCLHcri4yGISlj4kxcANgNRBQCIbL6U1Su7bB62rXvGydG25kqpwfIGxILBr9CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+window_fullscreen-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAASC/AQCBNTW1MzOzMTGxLy6vKyurJyenHR2dOTm5Pz+/IQCBOTm1Pz+9Pz+7Pz+5OTmzOTmxOTm3Pz+3OTmvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVuICCOZAkEaKquqzAQRWEYR32gSK7vO5oowKAQmPAtjkPFccEwLoaNhuPYDCSeT2B0+lhAfMHF1kF+PL5W7ZhrjqAk4gW53J0s3AG4nP6Y2BcUKAxLZn1+S4EBDAwQEIsUDBQRFJSJLJcoJpojfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+window_new-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAFxaXGRmZFRWVGQmhFwmfFxeXOTm5MTCxLy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93d3cuZGV2ZWxjb3IuY29tADs=
+wizard-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+xPz+BMTCBPz+/MTCxISChDQyNAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAREEMhJg6BYWhAGv5k2EKMXToSgEqc1DEIhvGAWpOvJFSXZyoXOxxY0BDahQDGg4xgOxmbgiWDqpoeqlGrVcZuSbLfpjwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+abbrowser-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBKSipMTCxISChPyqXPzerPz+xPz+/FxaXAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARhEMgJQqC4Xms1tkIgDEMYXpMYEEJRCIT6Ea5R2DHFtQZBG6dNoHQrsAyH14DDWiENBsQhBtskEs4Dohe4oiqE5So2zElECEKCrCYgQmcRVnRKnFIdC0L4/az7GXiBg4N+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+access-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBGRufLzi7PT6/NTq9OTy9MTm7LTW5LTS5LTO5KzC1FyGrExSXHzG3Gy+3FSStPz+/ESGpFSmxEySvEyKrER6nERylExqjFSSrKze7EyCrDxulKzG3GSuzGSitEyWvER2nEx6pKzO5DxmhLze7DxqjExihERadLS6xERulEyOrLTC1KzK3ERWbERujFRefGR+nKTO3LS6zLS+zFRmbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAQABAAAAa1QEBgSCwWhYIBocA0CA6IhEKwYAQKDccDAolIJpSK5aKwFhyYDGSQoWgqm4uFYyV0PAeIIPIeayZlVw4OFV19FxoSGoFnH1tcayASIRciVgYfEWoQIxcLk4gHlxQCnJBcJBUSdAEHhQediSV5ExWBBxYQGSZelLkHJyhWsHmSISkHKpsrViwWJ1xPXCAtesIBCiUaGHm6LiYvLybXMAQCMQosBwcoMjIzMTQMAC0M9vf49wB+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+acroread-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIEAAASC/PwCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAIlhI+pELshmkOhzmTvyZrFDglRxVEiGUoUualtx7gOC36gDGt+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+agent-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBKSipISChPz+BMTCBISCBERCBCH5BAEAAAAALAAAAAAQABAAAANLCLrcHkFBt4IY8EYKYCAT9xVBYRhbM5KFeaRVy56oSsgQ/TLrB567ym10ChiCnRIRaJx8lDdd86UkEWjHaURZwlKRHpM0xPOYGf4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+aktion-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAI5hG+hIuigAmMvLTlfnJiePQndt4SMFFioeaagaEbvySlQF6I2BLPRwYntDLlaylH8VXLDpaiJ8BcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+alevt-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/Pz+/AQCBAT+BPwCBAT+/Pz+BMTCxCH5BAEAAAAALAAAAAAQABAAAANFCLrc/i3ISadQYQhSehFecAGiYJ6oiJmaZrymSrKCJhinXLYmHo+l2skn0KGOPwyBUHPhOrqKVIWsmhqHyqhhPUG+Cn8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+applixware-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBKSipAAAACH5BAEAAAAALAAAAAAQABAAAAIyhI+pGbsBHYtHCGARbMhms1HVB0TieJhcl23liXkinAmhy7732UL9GnsZeixczChB+AsAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+ark-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/PwCBAQCBPyCBPzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANCCLoQwTBK6dy8WNQgptAbB33DQGzlx3xE65RpBwgtCw9sR7e1gO8EGYs3DMoUH5rPq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apps apps16 16:photo:16 16:R0lGODlhEAAQAIQAAASC/AQCBPz+xISCBPz+/ISChPz+BIQChFxaXMRaBPyqXIQCBPzC/MT+/MTCxMQCxPzCxMT+xMTCBPzerMQCBPwCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAWLIBCMwhgMJqCKRBEIpWAMBRGsQXG8sIAiLpwNZpAFEAcbjlc0OI9BVcAWSDgHT9MtF1AsZrmamNpNBAyjwgCxpo0U5h1jOhg0HAMbPHB4QNIDEQIRDi5xfgFzBBITIxJUBQ8UD305EhIwEi45FQ+dFVMSES+PIy2nLgUSBpcGQVomqKc3K7WwIwB+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+input_devices_settings-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/MTCxHx+fISChKSipKSirATCxAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARQEMgQpL03iEEx1gOxdR5YbCJXZUbqjusUhGitZkFri0VFUodXoTfjWCi6oY8Skxl6k4FhxZRRRxMC1TBdWn0CAbcZQFAH4WnGjDPiPICYPwIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+kab-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChFxaXKSipDQyNAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANICLocHiyqIMQYUE5Ses8S1V0FGInFIJTalKpsS5FxKDxB/EzV4GUBQsXR87BQnRtNtxphf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pb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+kcmpci-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAADQyNATCBASCBKSipFxaXAQCBMTC/ISChAQC/IQCBPyCBPz+xPwCBMTCxPz+/AAAACH5BAEAAAwALAAAAAAQABAAAARVEMhJqww4a33F+EL4jUI3EEXoEWzaFbAKzyUQeLihDqrpHQhBQkHyqY49iWCxbDKfJQbASYUCpJbslcHter+NQ3gsLo8bBYd6zWYf0u24GjWr22f+CAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+kcmprocessor-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBKSipMTCxISChFxaXDQyNAAAACH5BAEAAAAALAAAAAAQABAAAAM7CLrc/jDGQCWgIleH88jCdgXgB4JVQJxsVgQXIQvrWdwwJc/0jcOG0Y7gqwQVQR3R+EgyJcGjZUoF+BMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+kcmscsi-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+/MTCxKSipISChAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANCCLoQwZAFIV6UYgxi79Qa52WDE3bKV6YOpFpO3L5pJcckLBB8/wQEDezWAQpZqIWxFNAUkqkg6HmJOqGuArUqwfoTACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmV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h0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+kdvi-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/MTCxCH5BAEAAAAALAAAAAAQABAAAAJCRI4ZwCYPo1gsiIHHxY86KXmWdiGkCA1Wp6Htc07NOsEv2oVyldLHbuBgEhORJhOxGEkkiLJybCZ3iqrD08hmF/4CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+keditbookmarks-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy+vERGRFRWVDQ2NKSmpAQCBKyurMTGxISChJyanHR2dIyKjGxubHRydGRmZIyOjFxeXHx6fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVbICACwWieY1CibCCsrBkMb0zchSEcNYskCtqBBzshFkOGQFk0IRqOxqPBODRHCMhCQKteRc9FI/KQWGOIyFYgkDC+gPR4snCcfRGKOIKIgSMQE31+f4OEYCZ+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+kedit-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBASCBPz+xPyqXERCBARCBISChMTCxPz+/FxaXAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARXEMgpQ6B4WnGzDgJHWWMYdkAwEF1QFKe2oqDZztr7GpfKjrvAAeFDpQq8ISIRYBotSoTUkiC2ostqYps49BSKIVfaBbcC4MMWcTAbU+iw21NBk+gjuj8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+key_bindings-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChPz+/MTCxAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANMCAoRy2IEuYIQDsrBld0NN4XaJF5iCppWxBGtCscEAbkDfH2wh+ogiudD5AhvoZWoJEFtckBTE1dzKKfQjMtUjfQUzizjeBN7HgB/AgAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+keyboard-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChPz+/MTCxAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANBCLrR+zCIGWCcI1cLpNCa5YHZsCmj2QTlxrZmmRFVSs4E7X13TqMTXsl36gSHuSIQQ+QYP0kncPCTokzWh3LhTwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+keyboard_layout-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPz+BAQCBPwCBMT+/AQC/Pz+/PzCxKSipISChAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARSEEgZqr1hUjFIEQXBZVogDt/XYWxgoEVFzEUt3MGNm7SND4aarPfBFQYCQmtpiTErh+ahMK1SqVHoYcvtUptX67SWDXTPXWltva5q0WfEs+WPAAAh/mhDcm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ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+kpresenter-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwC/AQCBMQCxPwCBAT+/MTCBASChATCxPz+BPz+/ASCBAT+BKSipAQC/AQChARCBCH5BAEAAAAALAAAAAAQABAAAARhEMhJq70YhM2D5UIYDARHBUWxEcRgHKgncWyLuPEc1MOAJLfBRsNSEBYbH8kw3BEUyABjZHzJdsiGI6AYLBQG5qykDSy+jwdLpimj1aVhe7tIr00a6Q4uP02dfRVygRZ+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+kruler-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBFRGDPTijPzmnKSGDOzWdPTahOTGXOzOZOTKXNzCTNy6RNS2NMyqHNSuJCH5BAEAAAAALAAAAAAQABAAAARkEMhJKwg4643FEIQHimHRfaiYmoFxvMLhwi5r3IaA37rBIomgABhEDBM/hHLJVCBYCwFjYVxQBdYFi8GQertSLqshaJgFZbK5wXI4BO63W/Bwt+HzON7BKvj/gIAcgxoWhhN+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+kscd-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/AQCBKSipFxaXARCRPyqXPwCBAT+BMTCxMT+/AT+/PzCxASCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARbEIRJa5Ui672nsNYgegFhFoRhCuJAEgcsE+wYfHIc0y3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Vyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+looknfeel-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIQAAASC/ERGRExKTLy+vKSmpAQCBPTy9Pz+/IwKFLQWNPT29GwOFExOTIyKPHx2NPz2pIQSHLwWNMzGXFxaLLSytERCHCQmJNze3GxubLS2tHR2dAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAWNICCKgVCWYwoEwUAMhXEQhhocRuHCMpIgiJVBptC9DojDIrFYwRS4wgGJZAIYuwL00Ej6FjOGEXZwPByQCNjAyrnKj4NkAqYUBIIoXC5pVGYUFgIXU2Z8fgdGFhgZiRqHf1EDFgCJGAcafX9aUSIFlxoFBX8vMYmemKJSY6Ijn6oHF26tKbAEGCaUKX4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+lyx-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBAQChARCRKSipASChFxaXISChPyCBATCxPyqXMT+/Pz+xPzerPz+/AAAACH5BAEAAAAALAAAAAAQABAAAARZEMg5Q6C4BnGzHsRgeVZRGIbYaekxuAFijUGRBOqMKPxlJQsLQxjoVWyWBsMxNEp+iRuj2VvVCklHLCZjiRrawGFmNQUajQ129RwYyCMSau2pcNh1AB7jjwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+mathematica-16:apps apps16 16:photo:16 16:R0lGODlhEAA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C4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+noatun-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBCQ2PARehAwODASCtASi5ASq7JTK5PT29MzS1JyipISGjAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARlEMgJgrg3zDHkCEQoEhrnVYXBDUVRdmagHjT7AnExHPtg3LldzYXr4FA6juHnMXZkqaiGMpEtOdOmETpAIEy473fV9Xphq7P6DEgMFIpFWm1sJ+4JBec8SFAnd3pveH+AeHcSfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+package_applications-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIUAAFxaXGRmZFRWVARehAxehFxeXOTm5MTGxKze7JzO3ITC1HSyzGSmvFSWtESKpCx6nBxulNze3MTCxAQCBByezByWxBSOtBSGrAx2nAxqlARijARafARWdARSdARKbARGZARCXOzu7Pz+/Pz+9Ozu5Nza3Pz+7NzexPz+5NzivGxqbGxubNze1NS+vPTCvMzKzLz6vLzevPwCBNzevAwOBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADIALAAAAAAQABAAAAamQEBAMCAMikfjQMAsGA6IhGLBaDgeEEJEMhFIJBRKxXLBYDKajeTQBQAGG05n7vl8QABBNyTq+/8iIyRdJSJrgCMjJiYnhCIHEn+JiygpXQaGB32JKgErKiuNAoV+iQIGLBItLhOOgYkrmAYvLikwl6+Lo5gTtjFdLMHCKy8vEyITxV2tzBMFMTCWIgYlEzLX2NcwMy4vstngAS4tLyUGNODprdl+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZX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ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+package_settings-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBISChGRmZMTCxKSipLS2tHx6fPz+/OTm5FxaXOzu7DQyNMzOzAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAReEMhAq7wYBDECKVSGBcbRfcEYauSZXgFCrEEXgDCSeIEyzKSXZoBYVCoJVIqBGByKu0Cy8QHxmgNngWCkGgqsGWFseu6oMApoXHAWhWnKrv0UqeYDe0YO10/6fhJ+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+package_system-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBGxqFAQCBPz+/PTqtOTOfMSyPNze3Ozi5KyeLMTCxMzGzKSipOTe5MTGxAAAACH5BAEAAAAALAAAAAAQABAAAARfEMhJQah4ihFunsFAEIVXCVJACIJhoBK6CerawsA8HAhbuAnYZrBDKBYMWpCy4S2QSRazyBIwrrjcoNFQzK4KR1bQcHhZjGM2BgWLMYJ2enForHPJtNj+kfHvcB8AfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+package_toys-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBJxyLJRqJGxKFIReHKR6NJx2NMSmbEwyFKyGTMSibFw6FMSqdCQWDIxeHNS6hAQCBDQiDNS+jOzexCwiDCQiHLyeXFxGHLSWXJwuJGweFH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ieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+panel_settings-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBMTCxPz+/PzerISChPyqXAAAACH5BAEAAAAALAAAAAAQABAAAANKCLobwRAG4SJw7w5BswoEkQXbRn0h5ggF14FhbIhb68SiOgnbLRsPEovjwwVLRIdhCfwMiR/VZ1A7WS4tntWyynquq+01+h1//AkAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+password-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+/MTCBPz+BISCBPz+xAAAACH5BAEAAAAALAAAAAAQABAAAANECLrcGi6CIAKUKwxSb/ZasXWPMFwBQRQiZwlqAVnEGbRwKz/ndMep3QNUqKV6kpQh6HFoCIaBMDmQTpOsJsaC6XoZ/gQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+penguin-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+/ISChPz+BMTCBISCBAAAACH5BAEAAAAALAAAAAAQABAAAANHCLrRsTC6F6UId1TYiNtMQRQNqARDOlAgJrzlhr7vqlUufbHMoMO8k+8XY4yGtc9pREIORKRTYVoYDgxUVmBqmGCLJzDYnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2Z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XNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+window_list-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCRiXCRaVPz+/CRmZFRWVISGhMTCxESSjPT29DR6dDyOhDyCfPTy9CxqZOzu7Ozq7ERubOTm5ARehAxefPz6/ByaxBSOvBSGrAxynAxqlBR6nBRylAxmhARWdFxaXCH5BAEAAAAALAAAAAAQABAAAAWHICCKQTCeqCgMhJCihXEYSPuKRWIoC6PYsEZikHA4FA4CEJdoJh4QgXRwiOAeQudDIpEZIpPwhCImhyGGAmBSOVgumExG055w1ZPZhpPpUDwzExBqAAUDhxUVTQ0QEgWOOIcDiU1QjoSFFYiKDZYFmAWJlE9bkCM5iouWpiIfBa6frrKYAH4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+winprops-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBPz+/ASChATCxISChFxaXKSipPz+xMTCxMTCBPwCBAAAAAAAAAAAAAAAAAAAACH5BAEAAAoALAAAAAAQABAAAARXEMhJqwxAjM23wBMhjGQJEFKhriwrGUcsE3JsvPWBFAAiT7BaIYAA/HAxWk9CO9wAwd0SkJA9g8NiomnDoYqnHDAGroqRyVy3F2i7326LnKKo2+94hT8CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+wp-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBAQCxAQChKSipPz+xPz+/ARCRFxaXEQCBMTCxPyqXDQyNPzerISChISCBASCBERCBMTC/AAAA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CLrc/jC+oIK9Lgg7RuietWhCSWkkVZUbEBBnWxXFSVP1eLt7kPM3X86nEhJrtx/P0tuNilCVZEqtNvwJACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+3floppy_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBMTCxARmZPz+/FSWlLSytKSipERCRIyOjISChOTm5HRydNza3GRiZFRSVASCBARCBDTSJIT+bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVrICCOQBCQKBkIw5mqLFG47zoQ+FwbN57TosDhgPD5dMEEIqE04kwlBWKBUEiNVYFpyqAyGEUCgqEtERiNNMLhQKzLQYJg7n7Y4aMAwbCUPvAQeWNgfzQQETAIhSMQEogwgBITQEGGEREmfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+3floppy_unmount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBMTCxARmZPz+/FSWlLSytKSipERCRIyOjISChOTm5HRydNza3GRiZFRSVCH5BAEAAAAALAAAAAAQABAAAARcEMgJQqCYBjFu1hxReN82EOhYGieaklJwHIjrqnGCJLqNWhUFYoFQCG1FgWXIIDIYNQKCoawQGI0swuFAbKsxgmDsfZjBkwDBsNM90Jot9A3DbBD0Dwiur9QnfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+5floppy_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBFxaXPz+/DQyNISChASCBARCBMT+xAT+BAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARMEMgJQqCYBiFu1sIwdJ+0hSKZnZw4ehPLoW88c0Q7X7JABLlbp+eT/UyzgpADqwgKxKYpeIMZQNWJ4YBhWRHcrgpgQCSkJu3hYPFHAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+5floppy_unmount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBFxaXPz+/DQyNISChAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM+CLoQwZAFIV6UYox61cwaF32UtlkLSYFnulJEuT6qQATxW9W2enurgo6CaggKvKIn91K6mh0gMepydqwAfwIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+cdaudio_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaXISChNTS1MzKzMTGxMy+vNSytAQCBOzq7OTi5Nza3Oy6vPy2tOTStPz6/Ozu7Nze3MTKxOS2tOzOvNTqvLT2tDw+BPTy9MzOzLS2tPy+tLz+tLz2tLSynLzqvLzavLTOtNTW1KSipPz+/LzKvMTCxDQyNASCBARCBDTSJIT+bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BA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hDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+mo_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBKSipDQyNPz+/MTC/PzC/ISChASCBARCBMT+xAT+BAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARTEMgJQqCYBjFu1hxBeN82iCIJDgWaYhtntC4ZCzItdhWOD7mdwHLrAAczoKViIh6Vto5lcDjglppp9UpCTALULRaASGS5E4TCnB2rFyqJO5Gw+CMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+mo_unmount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBKSipDQyNPz+/MTC/PzC/ISChCH5BAEAAAAALAAAAAAQABAAAANHCLoQwZAFMV6UlBB759Aahw0FGEITZZQmlwoqq1UNDA/xLDhvhQ8rnKPh4f2EropjcDjAhpJl8ylaBJhTaCelvRC7XqLXnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nfs_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBExKTGRmZPz+/ExOTMTCxAQCBDw6PCwqLIyCRHxyNCQiJOzmxMSybFxSHHRmLIx+NFROHERCRFxaXASCBARCBDTSJIT+bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAA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HR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+tablet-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBMTC/Pz+/MTCxFxaXKSipAAAACH5BAEAAAAALAAAAAAQABAAAANECLrc/iosCUEQlEYdRp6dZ4lgKBBEp1kmmpLRMBQu6qWLEdYBn+81F0wnC8oCK+LAQDgGDIaG0vOMPnRIaEUBtW6//gQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+zip_mount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIMAAPz+BAQCBFxaXMTCxPz+/ASChPwCBKSipASCBARCBMT+xAT+BAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARTEMgJQqCYBiFs1lwwdF8VEsR4YVuXoirYFcWbkmY31wPqma2ZwReqBEODQutwEY04oeWqMniGOEzW4HAVZAEImVSCSLDGYIX5/EMoFtNSOWHxRwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+zip_unmount-16:devices devices16 16:photo:16 16:R0lGODlhEAAQAIIAAPz+BAQCBFxaXMTCxPz+/ASChPwCBKSipCH5BAEAAAAALAAAAAAQABAAAANICLoQwZAFIVyUNIx6WybE9kBTFYIiVhXFGXJetbYDaHnlathZk2eDQunw0GwomeGoMThmKETS4PAURCMlZccHXXYct60Y4E8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+blockdevice-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBMT+xAT+BASCBMT+/ATCBAT+/ARCRPz+xARCBPz+BATCxISCBDQyNMTCBCH5BAEAAAAALAAAAAAQABAAAARhEMgZwrwYBCFsvhs3eF8wDMJAVBVmnupazKRmGDFxzMVBBjcDQXfYHRA/QmKpKBYRSMoysVgwGEeoJ1ClLhpXhlbiqJobjcA1Sn48qug06+JwP+I1UMCNzmcqaR8lghN+EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+chardevice-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBMTCxISChPz+/MQCBPwCBAAAACH5BAEAAAAALAAAAAAQABAAAANCCBDcHkoFQasVUIrBe8fRNDwMAWojMTZmtmzByp6v7LQhTOLadbkxj3AUWZAcxcUgyYwQm8wYoOCCLgoGK5Nq9ScAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+desktop-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBExKTDQyNHRydFRWVKyqpGxubExOTERCRLy6vFxaXBweHFRKPFxeXAQCBIyKjCwqLMS+tKyurDw+PNze3ERGPPTu5Pz+/Pz6/Nza3MzOzKSipISChOzq7NTW1Ly+vHx2ZOzm3Ix2XJx2XIyOjKyqrJSSlPTexPTixKR2VKxyPCQiJPTy9JSWlHRmTOzSrMzKzJyCbKR+XCwuLOTi5CQmJAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Tk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+file_locked-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBFxaXDQyNAQCBMTCxPz+/KSipPz+xISCBERCBAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARTEEgQahVijMmD/oRAbBw1FCgaFFrppeo5didsZTSMDoRBSi/dgfUz6Sq7XGp1CByKQZUUWjsgrtcENYXNUodWhAahVRa65G9hmGgnnpzMZ/7xRwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+folder_blue-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBAQCBExKTBwWHMzKzOzq7ERCRExGTCwqLARqnAQ+ZHR2dKyqrNTOzHx2fCQiJMTi9NTu9HzC3AxmnAQ+XPTm7Dy67DymzITC3IzG5AxypHRydKymrMzOzOzu7BweHByy9AyGtFyy1IzG3NTu/ARupFRSVByazBR6rAyGvFyuzJTK3MTm9BR+tAxWhHS61MTi7Pz+/IymvCxulBRelAx2rHS63Pz6/PTy9PTu9Nza3ISitBRupFSixNTS1CxqnDQyNMzGzOTi5MTCxMTGxGxubGxqbLy2vLSutGRiZLy6vLSytKyurDQuNFxaXKSipDw6PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfDgACCAAECg4eIAAMEBQYHCImDBg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QA7
+folder_green_open-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBAQCBExKTBQWFNze3Ozq7ERCRCwqLPz+/PTy9PT29FRSVHRydIR+fISCfOzu7OTm5OTi5MzGxAxOLByCRJSKfIRyVERGRKTmvNTu3KTWvOzi1OzizIx6XIyCdFTOfGzSjITClAxGJOTSvNTCnNTW1Dw+PAxKJCTCVCyWVGy2jAQ6XMyyjMzKzByuZCR+TCyGVNTm3HRmTLy6vJSypESCXGReVLSurDQ2NNTS1MzOzKSipGRiZMTGxMTCxJyanDQyNLSytKyqrCwuLDw6PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfCgACCAAECg4eIAAMEBQYCB4mHAQgJCowLAQYMAYiTDQ4FCgoPEBESnBMUExMIoBUWFaEKBRIXExgZGqoTChscFR0epQYTHyAhGrkUIhMcIyQWJSYAJygpKSrIyissFi0GABMuLzAv19kaMRMyM+ABojQ15ObYEzYz0wAGBQUbBPHkYNQQcQMcABwEEhLIkUMHjRQvTuzIRwgHjx45evTwMWPGiR8GJQGxcWNGkBtCTlBMFGDIgh9CJhCJ1OkADgB+AgEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+folder_grey-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExKTBwWHMzKzOzq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QcAAcMJSaIeHonKCMpkxMqAismKyuIixMsH5MBDw8eJS0mJpcdByYSkwAcEQUEBC4lo7UHL7sXwMAkKTAeogceu0QXMRIwFjISMxITNNNDARcmLx8zNTUH4F64NDUTNlHsk35BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+folder_home-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBDw6PBQWFCQiJAQCBFxeXMTCxJyanDwyLDQqLFRSVLSytJSSlISChCQmJERGRFRWVGxubKSmpJyenGRmZLy+vOzq7OTi5Ly6vGRiZPTy9Pz6/OTm5ExOTPT29BwaHNza3NS6tKx6XGQqBNy6pIyKjDwGBOzOvJSWlDQyNIRaLNRiBGwmBNyidLxWBHxGFNySXCwqLKyqrNR6LKxGBNTS1NTW1Jw+BEweDDQ2NAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaoQIBwCAgIiEjAgAAoGA6I5DBBUBgWjIZDqnwYGgVIoTGQQgyRiGRCgZCR1nTFcsFkHm9hBp2paDYbHAsZHW9eERkYGh4eGx4ag3gfSgMTIBshIiMkGyAlCCZTEpciJyQjGxcoKUQBEhcbKiQrLB4XEltDrhcaKi0utbcJra8bLzDAGrcxrTIXHi8zNCypEsO6EzU2IzQ3ONoTzK0BCAkDMQkIOTFlAH5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+folder_html-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBAQCBERGRBQWFMzKzOzq7CwqLDw6NARqnAQ+XHR2dKyqrOTm5ExKTERCRHRydMTi7NTu9HS+1KSmpBweHDy67DyixHS61ITG3AxypByu7DxinBw+ZERmdIySjITC3ARypExOTDRurIR2RPTSdJyulEyGvBw+bFSyzJTK3LzKvPzivOTixNTChLSybGyCfCRSnBQqRASGtFyuzDw+PCRShPzy5OzerOTShKyaTEx6pCxerGRufBR+rOTezPTShNy6bER+1BxCfBQuRAxelFSixBw2VISq3GySrPTWlHyanIyitFSO3IymtCRujAxWhCRqlCQ6XGyWvNS2bFyGvDxuvCRSpLy+vMS+vGxqbFyO1GSi3EyO1FRaVCQuPLS2tDxyzKyWNFxaNCQyPGxubCxajERSVExKNJyenAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfZgACCAAECg4eIAAMEBQICBomDBwgJCgsEDA0BDg8BhwYQERKUDxOYDAyeghQVFhehGBmVlwwOqxobHB0eH6EfIAkPIYIiIyQlJhsnKBcpvrYiKissLS4vMDEyFjOvNAA1LDY3ODk6Oyc8PTIyFzQ1Jj42P0A6QTtCQ0REIEUORkdIkihZwsSekBhNnDyBciCKiSNSplDRUcWKkRhXCGDJYgiGli1cpuTocsILjytfFmRpACAGRTBhRogZgzHlAjKGWnIoY+bMgRgBDHRBo/LAIZoxuhwKatRPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+folder_image-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPz+BAQCBExKTBQWFMzKzOTm5CwuLERCRARqnAQ+XHR2dKSmpHRydCQiJMTi7NTu9HS+1Dy67DyixITC3BR2pBweHByu7ASGtFSyzHS61AxypExOTBSazBRupJQOFBS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QoRKFStXjpQk0QHLBgDRrEzJomULlwFHukhYgMWLIANfwIAJw+WKmDFkAjQoA8BPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+folder_violet-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExKTBwWHMzKzOzq7ERCRExGTCwqLHQWhEQOVHR2dKyqrNTS1PTy9Hx2fCQiJOTK7OzW9LyKzGxubLRW1JxOtLyCzMSS1HwijKSipLQ61HwinKxuvHQajFRSVJQytIQqlKRqvMSe1GQebHQihLSCxNzG5Pz+/KyStHQ6hPz6/PTu9Nza3KSGrJxmrOzm7MzOzDw6PDQyNOTi5MzGzMTCxGxqbLy6vLSytHRudGRiZLy2vDQuNFxaXDQ6NCH5BAEAAAAALAAAAAAQABAAAAaoQIAQEBAMj0jAgFAwHBDJoSGhWDAaDkPxEThCIpIJlcJgFgpdIaRiuYAxGcVD02gKBxuOpXPBvD1VH2ogISEceiIXI2ATBmohJAklGYaIJieOAAIoBSkqJCUlHJUmmQYrDiwFLS6foRwvpqkwMCstDTGtJCoyQjMELTQttw01Nsc3B0MBMxQ2DSfGNjg5OplHzDs5ODw5DMlRQgE9PhoMOjPh2BA/AH5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+folder_violet_open-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBAQCBExKTBQWFOTi5OTm5CwqLPz+/PTy7Ozu7HRydISCfPT29Ozq7Nze3MTGxEQOTGwahDwKRJSKfIx6XOzi1Pz6/MTKxNSi5OTS7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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfRgACCAAGFhoaDiQECjIwDAQQBiYKLBZYFBgcFkZMICQoLlwwNDgQPghAREhMUCBUWBRcMGBmnEBobHB0eHyAhIg4CIxenJCUmJygpKisVLAIGLSMPJBQuJi8wMTIzNCEWJjU2Dzc4OTo7PD0yK94DPj9AQUIUQ0QwFDFFRjchRz5IbARJEkLJkiVMmDRx8uQBlCgbgDyQMmUKlYpTqlSsYsXFFSwTK2bRMmWkyCxbuICkmKVlySwvpXTh4mWilJs4c3bB8uXLqUEBHggdSvSBn0AAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+link-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBFxaXPz+/AQCBKSipAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMgCLrc/jDKSau9OL/AuwxCKAzfOIwlcZIRKLJQMMyz5CcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+network-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBISChPz+/Nza3ARaZESanCyKlARudARGTLy+vNzq7ARmbMTCxARufAROVMzOzKSipARyfOzq7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVmICAGZFmKQiACweCSBImq41AYB5IodLq2hwWO0ejRWDac48Gb/QKNqNRoqspmrVcAUuIJBANS8sBIFCORUgooPEh4J8B67NgdsVBp9C5XWfl9LRMTCyReX19hARNojWlWLH+AAH4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+pipe-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChMTCxPz+/ARCBFxaXASChCH5BAEAAAAALAAAAAAQABAAAAM2CLoazpAFIV6UYZB6Yd5BtwRbEYqkYIqAQRir6KpnN8cdCddXivcbAy+S2qEOAuPx8MtZRP4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+shredder-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBERCBAQCBMTCBPz+xFxaXPz+/AQChISCBISC/DQyNPz+BARCRAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARcEMgZhBUzgzuIH4G2FYThnZUlCab5Ed0hC6nZ3Yh8JIKyLjCYboeZKIK6BDHTGwyViopEoWAkdwfqoKhIKLFUwXY79coUtLG4CFAcOOstWyNWyEXMO57p2/vxfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+socket-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+xMTCBFxaXKSipDQyNPz+/MTCxISChAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARKEMgZpr1SjFqx1QHoTaA4AuV2EmmHEUUxsKoHB7FMGPbhI7gCgnchII6+AyJBtBhjx0KC2TsIp9QXcpm1HafNEQF8mhAOCdfEHwEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+trashcan_empty-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBKSipERCBARCRPz+/MTCxISChFxaXAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARREEgZapiYWjGIvVNQjEZ5BKUAApVgjEWJzCtAnIGgC8eZ5bre7ICosQQFVY9Y/CGVwiYmlwwsac7qVRp6WqNGKpQZ9m7DojH2t+lVMtMP3B8BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+trashcan_full-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/Pz+xATCxMTCxMTCBKSipPyqXISCBFxaXISChAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARbEIAQJJU4BzEoIdSFbcNQnIVhBJ02GAeFIGxZjUl8KoHRagfeYqgo3kaxQOEwXPAyk4Mgtgg6jxYp1foETgPEKzSgBXOx0W9VIfZu2d3R5t3WhA5BEdQSQgP8EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+www-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBFxaXNze3LSyrJyanPz+/Ozq7GxqbDxinBw+ZERmdIySjHRydMzOzPT29CwuNDRurIR2RPTSdJyulEyGvBw+bLzCxIyKhGxubERCPLzKvPzivOTixNTChLSybGyCfCRSnBQqPLy6vOTi3Ly2rCRShPzy5OzerLyaVEx6nCxerGRyhOTezPTShNy6bEx6rER6zDRitBxCfPTu5PTq3LyqjBw2VISq3GySrPTWlHyanIyitFSO3LSqpPTm1DQyNCQ6XHSq3GyWvDxuvCRSpKyurOzizAQCBCxGZCRKZExGLDQuHAwaLBQWHKymnPTmxOzaxHx+fMTCvOzWvLymhHRmVExGPOTOpExOTERCRLyedBwaHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfWgACCAAGFhoaDiQECjIwDAQQBiYKLBZYFBgcFkZMICQoLlwwNDgQPghAREhMUCBUWBRcMGBmnEBobHB0eHyAhIg4jJBenJRwmJxIoKSoVKwIGwg8lFCwmLS4vMDEyIRYzNDUPNjc4OTo7PDAq3T0+Pj0/QBRBQi4UL0NENiFFPkbijoRAkiSJEiVLmDR54OQJFHEPREQRIWWihYlRMkCZQuXBgyIBihSpIjLAowBWroj7gaUIlpYvXWLJUuWKlgdbHvz44XHnzgdVami5qUinR50/efoJBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+zip-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBIQChPzC/AQCBMQCxAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMeCBCh/i+IAesShNo4+v5gKI5kaZ7oxzCilLVvq/kJACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+cal1day-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANOCLrMEUDIOUS9AFLLhx8LIRZjKYZmMRCkaChFLHty/AIiS3y6q+QtT49wq8VotRtQJGwRf6Zmrlj7DJLQXsupTJmeEIN4TB5nII20wp8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+cal5days-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANMCLrMEUDIOUS9AFLLhx8LIRZjKYbj55GioRRwoQ5x4QIiIdMmcec7jy53q81qP9OO5VMAj8RXTFWzOZW95HDLdEEM4LA4nIE0zgp/AgAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+cal7days-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANPCLrMEUDIOUS9AFLLhx8LIRZjKYbj55GioRRwoQ5x4QIiwcp0fucsj873qvGMv5Jw2FIACUsW4WakGW1O046I05qmGYBhTC6TM5CGWuFPAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+calappointment-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBPwCBAQC/AQCjPz+/MTCxPz+BISCBISChKSipAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAARbEMhJaQhA6D1E/wDGeeRgDhOhFoTBEi+REgdrIHScSEVvAD9Xr7cDqGSGpFEnQSqTv2NxCFQOiU1VEAiTZmstHFg1vQKuw+LxxfYaV/AuOQRI2O/4ewhT6Uv8EQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+calbell-16:korganizer korganizer16 16:photo:16 16:R0lGODlhDwAOAIIAAPwCBISCBPz+BIQCBMTCxISChPz+/AQCBCH5BAEAAAAALAAAAAAPAA4AAAM+CLrR+zCIAWsgLVRGRBhOVQiG94WPVAbHaZHYAWqRYLbge88RsbInGuBCEhRYrZYm4xk4nYdoKzKIbiKHawIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+callist-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBPwCBAQC/AQCjPz+/KSipPzerMRaBEQCBAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAARDEMhJaQhA6D1E/wDGeeRgDhOhruyatjBRSIRxxOsMEAdC0BUZDcfSEYvDo3Bn++2Cxt7RqFxWhZiCdsvdhjCVsMQfAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+calmonth-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANSCLrMEUDIOUS9AFLLhx8LIRZjKYbiRxLFIBpK0Q6z7MkwkJIe8b0KEeuWchFysuStVsjtfMbeMQitWpG25YfmNK1WU53XNIUYzug0OgNpuBX+BAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+caltoday-16:korganizer korganizer16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBPwCBAQC/AQCjPz+/MTCxKSipPyCBMRaBPyqXAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAARTEMhJaQhA6D1E/wDGeeRgDhOhFmurpi5LyIQhFfiBIAfuFzaAioBIJBCummRYPCaDPh3vhwsOZdihNfa8Ub/AJXemFZPPNBvGwG672yFMZS7xRwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+caltodo-16:korganizer korganizer16 16:photo:16 16:R0lGODlh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AAAAAAQABAAAAIdhI+py60BY2QwhVYdytpw/WFXF1LjcW6S1LVu6xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_all-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIjhI+pq+FuHjwyRInqfRkDTXkgQ5YLOH6it00pyqqcPJk26RcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_bottom-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAInRIynGe0PFTQz2kdxzHf72iSiRDpc2F1niaafBroYQNe2fdx6HfgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_fall-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIrRIyneRYP4wPUKWmr3E5b+DVh9GkYuFALiqnsJp6nObYZB5ow2a3Jvwv6CwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+border_horizontal-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAImRIynGe0PFTQz2kdxzHf7CoTiSB7kKUpa1Vlc86rtSjvxnOSL4hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_inside-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIrRIygxxYPF4zzyenqxfVk2m0g9lnKiabqqoYl43YwGcqiFWv22zRnD/AXAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+border_left-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAInBHKJmxYPY3TyVCozsjMbrk3gM27KyZDlioVQS3qwO7Nl6KC6q/kFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_outline-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIrhI8ZybgQYoTy2YqtwVTunVVfN3HQsaTnc5Kp2Ibw5Zm0PHJ2w7O8I5P5CwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+border_remove-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIjRIynGe0PFTQz2kdxzHf72iSiRDpc2F1niaafBrraSMuQXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_right-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAInRIynaOEPH5hRRVrzbJBLn32g1TXJuWBdpYYiy47hBl+yRqH6HfoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_top-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAImhI8ZyRgPo3xgVnmnprbvnUEhx1XmgpLRmH7e+rowFssleuaBXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_up-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAItRIynwOEPH0vRuGkjnFKjpmgX2FVkuBwNhapZKZ3VyMKcGJPv5eJmAkz5RP4CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_vertical-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAAQCBPwCBCH5BAEAAAEALAAAAAAQABAAAAIrRIygxxYPF4zzyenqxfVk2m0g9llmsiCmVjJh65Jh59GtGMuzqqQNDQz4CwAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+cell_edit-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/ISChCH5BAEAAAAALAAAAAAQABAAAAIshI+pm+EPnwmi2msDoLgLzQWDV4HlSJof6qki+W0nrMKlbN9bxGvMDwwG/QUAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+cell_layout-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+/PzerMTCxPyqXHx+fAAAACH5BAEAAAAALAAAAAAQABAAAANCCLrc/i3ISacKIuutA8ACxWUeJg0DqBHhd6ZiRpQBag9F2n13FRis0q1QUAmCvFuKRTAYWhIi0bhz+SqQrHbL9ScAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+chart-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBAQCxAQC/AT+/MTC/Pz+BAAAACH5BAEAAAAALAAAAAAQABAAAANMCLocHiyuIASU6lE7Xx7DdgEBQVwBKE4mqlZjeT4vl7VFkYZUjOuGkMFiuJ1yKUNAWTQGkEKDknUESpdXkkYjnWIWzOVX0SyPJwx/AgAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+comment-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+BPz+/Hx+BAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM5CLrc/i3ISacKYuStuwhAMBATKRHkAGJeu60qagqmuHK4B6Pn3N0u147Ha8FyOVCowlRCntAo1J8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+deletecell-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPz+/PwCBMQCBISChAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANICLrc/i3ISacKIuutA8BcKAwfNwwmQYDZoJ6tWrBZoRKuXIb2XRS7UG4wC25yOIGHFvu9PJ8KcRbQOVzAheoxbRCyDOKj4E8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+delete_table-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPz+/PwCBMQCBISChAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANPCLHcDDCIOSUVAaqLeY5O+G2XRQVDdA0DNxCEwrwEu9AFORVw3ee6Cu8HFKFgA2AQQ6uNTJNXYZgCNZKFBay4IhQuMBUFW/LKZlkHoOBPAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+dissociatecell-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAASC/AQCBPz+/PwCBCH5BAEAAAAALAAAAAAQABAAAAI0hI+pm+EPoQlC0GqxnfV2HUzR6HDWgA5Bqppr+qIhcMUqO5Oki+M87KN1ejCRTsJIKhP+AgAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+first_letter_upper-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIohI+py72RIJOHRmBt3QaGz2GVBGJfKW4aiXhX2sHxbKKneDv6zht+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+fontsizedown-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAInhI+pELHqmIkQNZrwfXYvzE1fBUrWoZniOjWdp0agjLL2i7rhDvgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+fontsizeup-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pEeoNIFyIzXStw3q/T4VVhJHHlDGjgZ6n1bLyCrqPyuJe4hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+funct-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+py60R3IkRVHQzo9BwD1qhqGneRU4gSqlVJ8Zy0mKPhOe6XwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+insertcell-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBPz+/Pz+BATCBAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAM7CLoa/k7IKQCEdNobc+UOMCijCD5jGjAMOowrIc/Wm77ATIe2leuETcrEYpSOJ88HpNxwmqdi40Tl+BMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+inserttable-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAIuRI6JwCH/HBSBmUlxbarvO0nQJ0aa5XWodjZsiKbJGrbgaMuzW8M87jPoDgx/AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+lower-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIqhI+pELHqmIkQNZrwfXYvzE0QKGniQWmNhbYSeqXn6zJOBJLTuuuh4i8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+mergecell-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/ATCBCH5BAEAAAAALAAAAAAQABAAAAIyhI+pm+EPoQlC0GqxnfV2HUzR6HDWgKZpCFyBCrMurMoPvZovPsgd39MBbaQI44hU+AsAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+money-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPz+BPwCBASCBATCBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM+CLrcHMHJIEaUD16sqIUcQAne5pQaBglkZS6lxb6dRoIAQTzuphcFXWeW0xl/utIPGDQOSUdnA7IUhoocfwIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+oscilloscope-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBOTm5Hx+fLy+vAQCfAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANKCLrcGjDK+IS9494AgrbEJ3CeUBRWpp2daaHhhZKuq75jh8pxTRaEQbAgFAIHv1VvR/vsdrnSCmdpagYnjfXS27Q+N29nQuYA/AkAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+percent-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIkhI+py70RUHxxQmosu6BOdWkNR35PVm1etqEsaKXnwTn2DfgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+precminus-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAIthH8RiJvrmHogVoXNtFRDpjUf6JWkeUoXlpGBAMfC+cowbd+uwL54/rMFZf4CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+precplus-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAQABAAAAI2hG8Rp4y9IGgszqhyspLueYHih43hiX7Iui5XprGTQNeCPNNBje86L9vBdr2a7xY0AllHm78AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+removecell-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAAQCBASC/Pz+/PwCBCH5BAEAAAEALAAAAAAQABAAAAI5hG+hq+IvAGPwydlqxAohvnjHMChkR6YDcKaougZqCMdyGYqSG+jXKQtoNkGTUHPBDJMTH+jJ8RcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+removecomment-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPz+BPz+/Hx+BPwCBMQCBISChCH5BAEAAAAALAAAAAAQABAAAANVCLrc/i3ISacKYuStuwhAMBATKRHkUIScUBSeahhigBbzK+HGgXmHmYHXC41MqKDwcGDFMryCz4gi3YQwkKiFY+ZAoYrUF5g1HV3G7DFuFBvSx8GfAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+resizecol-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBFxaXAQCBDQyNPz+/AAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMyCLrcG0A4CZ90saohuv+XEgxYxkDhQp2lyIBwKhB0bct2TuB6zfe7F5D26xV1x9zFnwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+resizerow-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBFxaXAQCBPz+/CH5BAEAAAAALAAAAAAQABAAAAIyhI+pmxHinph0GnqH3hoIDwocd3zZ2F0lmoInWq5s/I60xw5hmF8WPnNAhJUK44hM+AsAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+series-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBGRiZAAAACH5BAEAAAAALAAAAAAQABAAAAIjhI+py+0fUGRhGrswVtr1FgiGsGlhZVWAuarr9byyB8f24hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+sort_decrease-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BPwCBAQCBAQC/FxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM5CBDM+uKp8KiMsmaAs82dtnGeCHnNp4TjNQ4jq8CbDNOroIe3ROyEx2A4vOgkOBzgFxQ6Xa0owJ8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+sort_incr-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BAQC/AQCBPwCBFxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM4CAqxLm61CGBs81FMrQxgpnhKJlaXFJHUGg0w7DrDUmvtPQo8qyuEHoHW6hEVv+DQFvuhWtCFPwEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+special_paste-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+xPz+BNTS1MzGLMRaBMzOzPz+rPyqXPz+/MzGNDQyNKSipAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARoEMgJQhBySGx7IEQwFKMWGKgRHNZRIAJSVAm6usIwCEo+BDWVJ/CKzYAplWJZItGSgSVPZBEgU9EFQyGyWoK25XJ4DTO2iob6CxVLe2ys4rw9e8HKd8ybVJ7ndgEVQz09e1YUEmQefhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+strike_out-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBGRiZAAAACH5BAEAAAAALAAAAAAQABAAAAIghI+py+0BgwOS1gXnuS/b6ClCpCUcclJMmKIGWcby5BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_bottom-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIVhI+py+0Po5y0hYtzrkB7zH0fN/kFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+text_center-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsnRkqtDnhu1zHfFSpjaY4PavgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+text_left-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsgRoqr3Vnt102fFSJjUC6nlPoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+text_middle-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIXhI+py+0PT5i01pisphjt3UmfFZYm5hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_multirow-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsg2kfZvblXbwTg10WlA4rjyvgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+text_right-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+pm+EPIZstSrqsDhhv1ylfFE5jiYwX6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_top-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIWhI9pwe2uYnq0yQtqxbz7D4biSIZ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+upper-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+pEeoNIFyIzXStw3q/dR2hhEVcJqamuq6Z9brlNtKMeHuKXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+vertical_text-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIihI+pFrHqQHynTRrvyxQ12YWQWJGMpC0f2E1psr4eaj5+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciA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mgwz884PEq9PT4NYkPLP9jZQikN3d4AKVrjKePp3gZBACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+blend-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAQmJAQyNAQ6PARGRARSVARmZARubARuXARmTARiPAReLARaHARKBAROBAQCBERydESChESOjESanESmpESytES+vETKzETKtETCpES+lES2fESybESqXESiRAQ+PARiZARybASGhASWlASmpAS6tASynASqhASiZASaTASSNASKHAR+BARiBARydAR+fAS2tARKTDRaXARaXASOjASKdASCZAR+TAR2PARuJARqFAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa3QIBwSCwaj8ikcslcBp6CAaFQMBwOiIRiwWg4HA9hAAKJSCaUiuVywWQ0G07H4wkDxp8CKCQakUolJicoKSorLC12eHouL34lMIKEhoiKEFMgLn0kMIGDhSyVYhADjJuAkoWHiaMEMXuOnJ6Tq5alBpp+nSeflKx3l6a6s6CiwKWZm52pvpaue8rEzaPIubLMta2Mscu9ob8BMgIfBDPJNDQ1Njc4OTotDXYP8/T19vZN+fr7SXRBACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+bookmark_add-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBCwqLCQiJCQmJMTGxAQCBLy+vLSytERGRFRWVKyurKyqrLS2tKSmpHR2dJSWlKSipISGhGxubIyOjGxqbIyKjFxaXGRmZHx+fPz+NGRiZPz+ZPz+HMTCBKSiHPz+jFxeXPz+XPz+tPz+zPz+/AAAAAAAAAAAAAAAAAAAAAA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AAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI+hI+pyw0Bo5wR0TttUJDv0yWhRopfaYzguaKt6aasrGFYbVPxM/O7Snv9WEAfTIgMKpNGWU63emYc1GrVUAAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_bottom-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIyhI+pyw3xIpwyOgOv1dvl+2lhMzIlyZ1KQLUVm8Zch4ozbcq6l7L+D4QhgsTf7Xi0FwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_fall-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI/hI+pyw3xIpwypgBRdg/v9h2eyBnZCIKYxX2oEsJruVKjHS8vk3duKZnpHKjeRSTU0HYpTcxWgRqB1KrVYC8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_horizontal-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIyhI+pyw3xIpwyOgOv1dvl+2lhMzIlyZ1KwLbuyybw7KY216Einpv377FRhhUV78igFwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_inside-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI7hI+pyw3xIgxTRvcg1oku3njbBx4liV3dqYbsSsXyLBr0Pad1iCovsmOwgjbdz9TrGHWWSeWZikoXhgIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_left-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI6hI+pyw0Rnox0ygNXdG9z43Xal30gUiYhk5LoenJQRVtti5FwE+Kx4+O9RrIda6gwDmvMi+kJjTIMBQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+border_outline-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI8hI+pyw0Bo5ww0SttcKci/ymgMTZl+Yjbt3Jn26lautX0A+OizHJkjsrper7XbkZ0ATEYDZPii0qnU3sBACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_remove-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIthI+pyw3xIpwyOgOv1dvl+2lhMzIlyZ1KQLUVm8Zch4ozbcq6F7s+fgsKb4YCACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_right-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI7hI+pyw3xIpzyQRdVuIZj+3nHhogOiZng+I1qoqIdRVfbWy5y1u5M7MFphB1dsDULGXO15goJjUoRhgIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_top-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIyhI+pyw0Bo5ww0SvdCdrw7oGfNnZlczIpKorc+8RwZbZgXOc2uevOqpjJhrCb8QgwFAAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+border_up-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI/hI+pyw3xIpwyOgNRyPq+zTkcuIQKaV3T1pgHinmfm7AUedMa64Vw3bLJMr9TiZcSFUsnkw54q0Rl1KrVYSgAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_vertical-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI6hI+pyw3xIgxTRvcg1oku3njbBx4liV3dqYbsalFeJTp1iCovcjNsb9iZhMFcJwXUxTJLYuoJjR7sBQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+bottom-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAw2VCRKZDRSbBxCXJTC1Mzi7Nzq9NTm9Bx2nAQCBNzu9JzG3Hy+1HzG3IzO5BRmjPz6/LTe7Dy61AyStCTC1FzC1AyGrETS3ETC1ETa5BRulAyuzBRylAw+XMTe7Gy+3CSqzAyexBTC3DR+nIS21KTW5Nzu/KzO3FzC3Pz+/ByixEze7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAaXQIBwSCwaj8ikcnkMBAQDgjPAFAYKhsMBkVBUAYEFo+F4QLzVQEQyoVTOX/XBcsHA0+vMRbNBMwkRDhxuHX5GTlIeHh8gISIjFAEeiVRECiQlDAUmgxQjIhwiJHdFlycoKSIUFCEjGiGkRpcqCxYijxorsUezcxYsuoZJsxLAu0qXB7DCTJfHvArR0tPSSNTX1V/a20J2QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+brace-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAWABYAAAJRhI+pGbHYVHzQnUnrtXn7/gEYIJRHKRgYZraGuXLp28LcNL/Dqd4cYmJYRqegsKcY5DRIUhHYFDlQJGMuVn1ljdhqjhoiZrogKbMjFh/LHUMBACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+brackets-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAWABYAAAJRhI+pyw0Bg3vxwImu0Zha2XkbaAjmYQrjh6qnCpwcB8evTGp1PKDrnzglZqTWDsg5DI5IUE1Yatpc0BrRFr2xfiljJlecXEPjDjG5iIRDCHsBACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+centrejust-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIhhI+py+1vgpy0TogztlT7j3CiBJbZWJlqg4rry7jw/BoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+charset-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIIAAPwCBAQCBAQGBFxaXAwKDBQWFAAAAAAAACH5BAEAAAAALAAAAAAWABYAAANLCLrc/jDKuQK1zmKo3/YVJSpBSZYmKaTkAAwYoQwFELjvpisyaTM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moyOBTEtB2sXuhU6XAENC2a6z9AKCwq+1tAN3E2J3ySkIQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+connect_creating-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBPz+BMTCBISCBAQCBPz+/MTCxOTi5AQGBNze3Ly6vISChNza3FxaXKSipAAAACH5BAEAAAAALAAAAAAWABYAAAR4EMhJqwzY6omD+MNGdR8YilNZnug0qGzrqrL1lnV1fyJBVB6VQEMoGH4ADGwQkxQPBwMiKGA2J8VEAnq0tgiKg5aL/C7C2gTjKCM0zowDQ8tuNQznNL7cKzjOUQsNfER+gguIg19+Pm6ChBZFDmWNi5M5FIyYFHQRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connect_established-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBKyirPz+/KymrOTi5KSipMzCzNza3OTe5Ozi7MzGzPTq9OTm5ISChMS+xFxaXNze3GReZIyCjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAWLICCOZGmeaBkAQpoGg7C6JizTQT7CxPwOwFWgYPChYIXkIHC4uQKGAiKRKCyNpxxUUVViVYNFLkqtLo+DAkMMLXQPXwAy2WCTF4544FGtKuwPDhB6DnxuUmyCcXIQhV1uYoMuEAcOBxEKCHg6TzGFCJUSizuejROKOAM9OY2SnUU7nD89NCcDsLUnIQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+connect_no-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBPz+BMTCBERCBAQCBPz+/MTCxOTi5Nze3OTm5Ly6vNza3ISChFxaXKSipAAAACH5BAEAAAAALAAAAAAWABYAAARiEMhJq7046827/+AVCKE0Dh9BAGdaGISAToFGFMcBU+11I4hDYseSZQiKwwKoI/QwBIYiuFDCZseGdIlYEjUNg1SpY6w2N4cUIW6cjwW1lsFwo+MqgtZuw0/ydw5vH34lBhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+contents2-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAQCBDyGhCyCfFSWlESOjDyKjDSGhCx+fGSinGSenFyanEySjHSqpHSqrGympEySlBx2dISytHyyrCR6dKTGxHyurHSurHyytGSipCR6fARmZFSalEyWlBRubAxubBRydDyKhDSChLSytPz+/MzKzIyOjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbFQIBwSCwaj8ikMhBQIpmCQdM5ZBIKhgNiugwkFAsCI7pNMhuOxkNBgBgEiAi3GkBLJpJHYgEpaClyREwVFhcSEhgOGQoMfgMaERtcARQBFRMYExZ6HB0FUYAekkIBHxqWFmlrC1haESAfG6MBGx+VFRgKYH0hInGRklO0ppYXCwwMWQiQHkwjgrWnFRdYZHIBJCTP0LaWGAcDW9jZ2nMAw9IWTOQkJSZMRsOV49nu8E+19PbmR7TY+1TovONH5V7Ag0QM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yJFOow4S3Hkx9oNDDZgXPU0h1wcSIgEGUw4ibVET5WoWMKksePHpdxmyKADAEIWly9HJtQkQJMmlAgZCAQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+contexthelp-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBAQChAAAACH5BAEAAAAALAAAAAAWABYAAAJQhI8Qy5F/ghBsLuOgpHHy+0hZ94HINiqWwoQrtjYpNqJ0A8Hcjbs73yPNZEHVDygTJohJWqiZe0JPM5ajtXxFMkXnklqNgsPiWzmHPatzhgIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+crop-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBMT+xASyBASCBASaBISChMTCxPz+/AAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARUEMhJq704681r+EFHBcIwEKFImmfKkURhoh1cyO0rxEWZa7bezIUJ7gg04O62A22MyeeyF1XymrUSs5pZmbA61u+FLBOBhrThozq4D2cgYo6IawwRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+decrypted-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIYAAPwCBGxqbFxaXExOTEQ+RAQCBPz+/PTy9Ozq7Nza3NTS1KSipFRSVOTi5Hx2fJSSlKyqrJyenJyW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6eyFTBmN1TA5OvLDjJksWb58OVMGDRqWjAYdmU79SIvpjqJr104nEAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+editshred-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBFRSVExKTERCRDw6PDQyNCwuLBweHBwaHAwODAwKDAQCBExOTNze3NTW1MTGxLS2tJyanOze1Pz+/Ozu7BQSFCwqLDw+POTi5MzKxPTu7LyyrIR+fCQmJPz6/Pz69Pzy7Pz29OzaxPTu5PTq3PTm3My6pPzu5PTq5NS+rPTm1PTi1PTezOzWxPz27MyynOzSvMyulOzOtOzKrMymhOzGpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbpQIAwIBgMCAXDAZFQLBbCqJTRqFobjgdkEYFKowPJZEyeUBqVR/crHDTKZYplovZKCW84+YKZZNZSBXl6EwEEBhVPXxZihGMaGRscdkIdg4QeEnVfCH2OHyAhIhuUAAiXZSEhIyQlJqWnjiEnKCWupRWoYyEgJK0SKaUKjam0JCorLMFfC6iqx8giLa/MGAsT1wsuCyULKwssC9RSzdkfCyALKuALLQsvpeXYIQso3gsiCzALMfENC+dGcMNHUAY/f+jq3ctncMYCGggFrsvHcEGNh/EyPFmg8cmrJxAVkVO0EUDJklHoBAEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+edittrash-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAQCBERGRExOTDQyNISChBQSFCQiJCwuLPT29Nze3GxqbDw6PGxubHR2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+kkqdUiXCdWW74SzYkAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+leftjust-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIihI+py+1vgpy0Tohzs1T7z3CiBJbQWJnqg4rre7jwTBtGAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+locationbar_erase-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBPz+/AAAACH5BAEAAAAALAAAAAAWABYAAAJChI+py+0PX5i0VmbzVboHPgmCJVoJJY5haR5VGsCa+6ZqZ2Sy95E2n0OVdi2A8EacIIS+YpC3WUIpi6kygs1qsYYCACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+lock-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIYAAPwCBHRudFxaXExGTERCRAwGDGxubPz+/Pz2/Ozm7Nza3NTS1KympFRSVHR2dNTO1JSSlKyqrKSipDQyNMTGxDw+PLSutKymrMTCxAQCBHRqLBQODJyanDQuFFxSJFRSJFRGJERCHExCHISChHxyLEQ6HGRaJExKHLSmbLy2fOzitPz23KSiZHxuNHxyNJSOTNTOnMTCjLSudKSaXJSKRJyOTOTetNzWpHxuPOTi5MzKzLS2tFxWXOzq7Ly6vOTe5Ix+RLSqdNzSpLyydKy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Gou9oDuS1hlqnkxu/niVQB6kYHzAiJYoUK7paLrxpr6GMJjWeqlFGirEaQhcDHQJnEQX2/1kMBv08Yu1ttNkFRr1ikHjIiYYjDjSWLIbUAAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+pencil-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAASC/IQCBPwCBPyChMQCBPzCxAQCBPz+/MzKzISChKyqrDQyNEQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARYEMhJ6wxiEMtpIAWxddwXiqRlikSQeiAbuC+wirNR322gv7zcLobzDU+9XypoBBKTR1lz+RTWDgip8nUwZK1XLyIx5XoVicX2RUAo1DVKi7GOBxjxfNwQAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+percent-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIzhI+py+0P4wkU1XfDhBdo/zndF4qh1pkGKYFk2XpTqoJr9G5YfmOz3hixfBZa7IhMJg0FACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+player_eject-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBDQyNAwKDJSWlFRSVBQSFKymrOzq7HRydERCRPz+/MzGzISGhJyenKSmpGxqbJyWnJSOlKSepLy2vIyOjGRiZPTu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R6wWAYpFR2YWSobvL5vFgfDaEMDIivMRBEsD9HcQgMWvecDLB0tZ0btsfJa9vLXU/X6/P3+b0EAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+player_pause-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBAwODMTCxKSmpJSWlFRSVAQGBBwaHLSutOzq7Ly6vCQeJPz+/Hx2fBQWFGxubLSytJSOlBQOFAwKDJSSlJyWnIyOjHRydNze3GRiZAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAWBICCOZGmeaKqubOumQSDEgRjPMSoMRGEcol3vh0IkFAtDDWBEKlGMRKPgEIii0yrqIS1ArADu9KuLNCSOSdCMVp8ohEZFC4DL6SaBpXGh6/l4JX8XZACDhXkYCn1LAoqMUBAZEhBLDJKUSyYBGmhPAJyemiU0NDaloy+qq6ytI8whACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+player_start-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBDQyNAQCBExOTAwKDAQGBJSSlHx+fBQSFMTCxKymrFRSVOzu7GxqbLSytLy6vJyanPz+/GReZBwaHHRydKSepKSipGRiZJyWnAwODLSutKSmpISChPTu9ISGhFxaXJSWlIyGjJSOlERCRIyKjDw2PIyOjLy2vOzm7Dw6PLS2tCQmJOTe5GxmbDQ2NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa7QIBwSCwaj8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HRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+prec_minus-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBKSipPz+/CH5BAEAAAAALAAAAAAWABYAAAJAhI+py62RgnRnGguZ3BlTYIHdl13jh3goFpIleggvTK8ctw76Pswav/MtAkCd8NHj9HLFY6S4JEGdqdumtjAUAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+prec_plus-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBKSipPz+/CH5BAEAAAAALAAAAAAWABYAAAJHhI+py22hgjwSonktxBZU7GnhkyXc6JmmeDpnG2lg1YCOInT3zrvfxwsMhsSBrkYUDo8MpTEZNH6M0SV058xWi1Tsj9ZjGAoAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+previous-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBOzC7PTq9NSG1MxW3LQCzNRi7MRGzLQCvPz2/NRq3ORy7HQCdJwClAAAACH5BAEAAAAALAAAAAAWABYAAARUEMhJq70Yh813rl1HheInBYIwrEJwktxJFEbRmuOBJIXivp5LQLcj+HCnBaPBMBhdMBBjw0w8ccEA0/EzdQHaHywmnIyDyDSIrG4LQ+64OSqvx+kRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+prod-22:actions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bQA7
+rightjust-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIhhI+py+1vgpy0Toizjvbur3WiBJbhSJnqgorri7nwDBoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+rsub-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBIQChAAAACH5BAEAAAAALAAAAAAWABYAAAI+hI+pFu3f1gmSVUBrlnt19SUhMk5XaWnnqrYc+2rQfNWHIBi4feP+zssBdkJez5gAIodDYbH2+yGBymXCUAAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+rsup-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBIQChAQCBAAAACH5BAEAAAAALAAAAAAWABYAAAI6hI+pyxBhXlOv1omggxon6VFdGG1laFmkyQLCC8fvJNB2U+M3k/P70gP+FEHiMFFEHhFJJk0GXUkNBQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+run-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAQCBOzq5MzOzPTy9KyurNze3PTy7IyOjOTi5MTGxNza3MTCxMzKzHx+fOTm5NTSzNTS1NTW1FxaXAQGBLy+vJSWlGxqbGRmZIyKhDw6PAQGDJyenAwKDLy6vLSytBQSFLy6tKyqrHR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sIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+spellcheck-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAASC/AQCBFxaXBQWFAwKDPzCxPwaHPwiJNQGBOxKTPQ6PNQCBGwCBPQ+POwCBPwqLMwCBHwCBBwCBFQCBLQCBPwCBBQCBCQCBPQCBOQCBDQCBFwCBJQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAWGICCOZGmeaAoErMi+4xuQgQAI8yoKw2rfOZ1LRIgJh0hhDncsyXKypNMIKAKbNGpwFjxukcza7jt8xmCAgkpVMKxRhQOCnTAVFAtGqtBwLEgFDxAREigBExQVFRAibYNdJhaIigmODBdvF4gYDwoZDBpvIhKIGYOFoi4bHBGQogESqKlvBiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+sqrt-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIIAAPwCBIQChAQCBBwaHAQGBAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAANPCLrc/jDCQKutkcqQJeCP5k3g6IjCIAjAynYt0brzUn7gW++i0i8CGcNiuyl0NlyysYKhXgQdUvmcNZtDTo/mmvo+ptMvjDOSzWey+mFIAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+start-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAw2VAQCBCRGZAxCZGyavExmjHyatOTy9CxihISevPz+/KzO3BRylAw+XDRWbPz6/FzC3CSuzDyexJzO5Mzq9CxSdAQO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UfMyzBdQIFKsodob0VNDWzwppuKxMRrx6iNjcitNA4bh+iEzkwojc66JkOOxcf7G35PBE9KS1MEUGgIQOIFfk++KjRw9wJgUUIZvhRoyLDFCliQDQisUWLGCJOeNx4hKCGkyhPGnqCoKVLl1liypyZxUAQACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+sum-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBIQChCH5BAEAAAAALAAAAAAWABYAAAIyhI+py+1/gpyUMrvm1bdhFTgfhIykYZ4pyZ2o5EZwDLSurc7ZFnqZDgLKKsQe7QihFwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_block-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUWzvNzo33GfFl5jVlonlTrr1DbvFi9vjeeNUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_bold-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIxhI+py+0Powm0VnknjVkH2AEhE45LZ55Wqn6e65TsMc5eYosbksswubJIhsSiccgvAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+text_center-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUbz3Sh7yIWfFHKjVl4nmFrr1Lpr7LwkjeeIUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBBwaHAwKDBQSFLy+vLS2tJSWlBQWFKyqrFRSVCwqLDQyNNTS1GxqbFxaXJyanIyOjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAVcICCOZGmKQSoMaZsShBsQBdAapHvgaIDUqUPJlRjSbAoT0fRDKgODRbF0PLUYjZO2F2Bst9evNix+dsvDlGKK5jraudQb7qbX6a2HEJ+ycyF+LRE8ZTI+fX5oGCEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_italic-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py+0P4wqUSlQvttrkDnyaOHIdeaGRupplAIauVM3xjeeOUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_left-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+pyw0Bo5zB2UXz3Sp7yG2fFJajVjonmIor2TJvfL0wjecIXQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_right-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUfz3SZ7yIXdF4kWqZkbCqoMO7kXLC+wVOe6YRQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text_under-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIvhI+py+0PowmUnhpeVVnb1DkbCI1I2JhX+Z0sOr2cTHpwK7a4rUr+hAnufsTirwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+toggle_log-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIYAAAQCBAQ2NPwCBATW1KSWfBweHATS1Pz+/Ozm1GxiTATOzPz6/Pz69ATGxKSahOzaxPzy5HxuVLSmlOTazPz27AS+vPT29NzClPTexHxuXLSmjAyKhPTy9KyehNy+lPTy5Pz29HxyXNzWxAS2tOzexPzy7IR6Z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BybQaHYJn7QC5zKeytIQe1+pKNE6P2yMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+view_detailed-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz+/Pz69PTq5AQCBOzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAQ+EMhJq7046817+MLQUQFRGMc4lQaSAkcMx3QltMmrDrSu/sCgEPgJhIiFk89DaL1qPRnlhsgBebWhdstVESIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+view_icon-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz69PTq5AQCBPz+/OzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARWEMhJq7046z2DF0PlBeAVEERhiKhqHgWyUgEsX0KczFOO7JeBYciTCImc5ITIXDKHyqhU9AnRqq9UEVDTvmLbGhin2/qAliOUot5OLc81IO5+2+8WewQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewmag--22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBBQSFJyanKy2tLzCxHyChNTa3Nzq7Nz29Nzy9Mzy9MTu9OTy9Nzi5Oz6/OT29MTi5Kzi7NTy9KTm7JzW3ITO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h/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+view_text-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIkhI+py+0Po2ShBlOxzbP7n2yaJoLm+ZTcxqHuC6hXzML2HVEFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+view_tree-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBFRSVExKTDQyNPz+/Pz69Pzu5PTq5OzaxBQOFOzKpFRWVFxWXOzexPTexCH5BAEAAAAALAAAAAAWABYAAARPEMhJq704g6A779kHCORAgNskFMYhakE8FkjyBcoWv+JwJItXaELYCTFHlCSpZKKcoB5jYHpOGgUadLKbIRw3jhEzQDyCSuI4zW673yhDBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+window_fullscreen-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBNTW1NTS1MzOzMTGxLy+vLy6vLS2tKyurKyqrKSmpKSipJyenMzKzMTCxLSytFxaXPz+/Pz+9Pz+7IQCBMzOvMzOtPz+1MzOrPz+5Pz+3MzOpMzOnMzOxAAAACH5BAEAAAAALAAAAAAWABYAAAWxICCOZGmeKBqsbOu+rjAQRFEYxoEkibIwjUZMRnAUHjkEpPcLriLQqHQ6XRUk2Kw2O+l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+wizard-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBNzaTPz6BAQCBPz+BExKBMzOTPz+rPz+3ISCBPTyhISCLISChPz+xOTiVPz+/MTCxKSipKyqrExOTDw+PDQyNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAV+ICCOZAkEZqoKqoqKAzHAb1sIxhAQwWAQhRaJd0AcdgkhqaBAOBUL5WjAaD6TUqog0DAildqcg+cDtgaPACTCiM0AOhV6sG4DWOAHnf2uyfV1b1lsgVIwEgwTFHaGA2yKFYJgiJCSQo6JFJGGcJSalkKPn5wimZukAJWoIgYhACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
diff --git a/ext/tk/sample/tkextlib/ICONS/tkIcons.kde b/ext/tk/sample/tkextlib/ICONS/tkIcons.kde
new file mode 100644
index 0000000000..0d5b2c8695
--- /dev/null
+++ b/ext/tk/sample/tkextlib/ICONS/tkIcons.kde
@@ -0,0 +1,195 @@
+actattach16:act act16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBPz+/AQCBAAAACH5BAEAAAAALAAAAAAQABAAAAI2hAOCxg2h0nJHyEshi9HpxU1GOCLdZoKpQ15nibUoprKp9lh2oucUxsBRXsJh4Hjs/QTMpr8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+actbookmark16:act act16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy+vERGRFRWVDQ2NKSmpAQCBKyurMTGxISChJyanHR2dIyKjGxubHRydGRmZ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h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+actcross16:act act16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/PwCBMQCBEQCBIQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMuCLrc/hCGFyYLQjQsquLDQ2ScEEJjZkYfyQKlJa2j7AQnMM7NfucLze1FLD78CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+actexit16:act act16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBDQyNHR2dCH5BAEAAAAALAAAAAAQABAAAAI4hI+pFrHb3nEg1iWiDiINCwYDko0V9XUTda6I1TIsUMpGinyzbB6ZeGuoEr+GUDL4CXqSphPhLwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+acthelp16:act act16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQ6XAQCBCyCvARSjAQ+ZGSm1ARCbEyWzESOxIy63ARalAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAQ/EEgQqhUz00GEJx2WFUY3BZw5HYh4cu6mSkEy06B72LHkiYFST0NRLIaa4I0oQyZhTKInSq2eAlaaMAuYEv0RACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+actitemadd16:act act16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCB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ldmVsY29yLmNvbQA7
+appdate16:app app16 16:photo:16 16:R0lGODlhEAAQAIQAAASC/AQCBPzerPyqXMRaBIQCBISChPz+/KSipMTCxPz+BMTCBPwCBPz+xPzCxMQCBISCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVxICCOQGCeJjkGwkC8RFEEavkax2G8dB0QuRyhhzoBg8MSYsncJXKJZIDZHCoWP1ogGIwGrtnSgUFmHLyNRHhrdpjRamnO/SYkromHdnxwnwkKVxByZW8DgQsQM2JcfwZXO0MBCZSVBgMuLzJaRZ0pfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+apppencil16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAASC/IQCBMQCBPzCxAQCBPz+/MTCxISChDQyNKSipEQCBAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARDEMhJZRBD1H2z3lMnjKCFjUJQimOgcmcbELCXzjXq0hV785WCQYcDFQjDXeloMByKG6YTAdwIDAlqSZJSVFeKLcUfAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+appsheet16:app app16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBAT+/Pz+/KSipPz+BAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANFCBDc7iqIKUW98WkWpx1DAIphR41ouWya+YVpoBAaCKtMoRfsyue8WGC3YxBii5+RtiEWmASFdDVs6GRTKfCa7UK6AH8CACH+aENyZWF0ZWQgY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RlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+appuser16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/MTCxISChMT+/ATCxASChFxaXAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMg5gw00yyDGIAR1YUDggeFWFIZhnSBZrsZxdIOFEGTA2oeBAHeyuGwvzxBlYdUOLROMFzDQntJPrNoqAKUBaqnV+k57ZORruykHDj2LqIzUVKp1u0iuB/gjACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+appusers16:app app16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBMTCxISChAT+BMRaBPyqXARCBPz+/FxaXAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARLEIRJa5Ui673nsGAgeKE1Bl9AUEXbiqTlFlZaGUZoszm4BzhDAVf5BYbAXI+TAR6CS2ZGSZSEiIIqYIsSIEaJ7GRrlY7J1lKA7I8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+appwp16:app app16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBKSinJyOfPz27Pzy7AwKDExOTJyWlERCRKSelPz69LyyrKymnPz+/MS2fDQyJAQCBOTazLSiXOzivMS2jKSSVOzmxPz25NzSpPTu5KyebOzixNTGjOTWpMSydMSybCwqF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hwsOZdihNfa8Ub/AJXemFZPPNBvGwG672yFMZS7xRwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+caltodo16:cal cal16 16:photo:16 16:R0lGODlhEAAQAIMAAAQCBAT+BAQC/AQCjPz+/MTCxPzCxKSipPwCBMQCBIQCBAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAARaEMhJaQhA6D1E/wDGeeRgDhOhFmurpi5LyMYhFXiuFwZiA6qZYbbqJX5BIw2RAPxwAAWCyWMCCsiXFGEEErKz6LQZfOqiTR1YJiGq1rFyyHmo2+/1EKbCl/gjACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connecting16:connect connect16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBISCBAQCBPz+/MTCxMTGxISChFxaXMzGzKSipAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZbihUiz60FPnfaA0iBpBVGdHEYWxToEoSHBRHHM9AgSEQRcj+AYkYAJxIPKQFUJiOdTJQFIDU6dYzKKFhTCM+E5g4mXaDAyrlogEG+DGTecA7wsP8EcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connectno16:connect connect16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBAQCBERCBPz+/MTCxMTGxISChFxaXMz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KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+devnetwork16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBISChPz+/Nza3ARaZESanCyKlARudARGTLy+vNzq7ARmbMTCxARufAROVMzOzKSipARyfOzq7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVmICAGZFmKQiACweCSBImq41AYB5IodLq2hwWO0ejRWDac48Gb/QKNqNRoqspmrVcAUuIJBANS8sBIFCORUgooPEh4J8B67NgdsVBp9C5XWfl9LRMTCyReX19hARNojWlWLH+AAH4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+devpc16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBISChHx+fPz+/AQCBAQC/AT+/AQCxAQChAT+BLy+vAR+BAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARYEIAgqK1YzsG754QUDERpmkEpkkXrtoK6EcVgHIibhnNx564Yb0TDvQq7FQ34EiqPOhnREqhWSUPsyZSQAbbg7GcMEgwUiYVivTa1R+y4XEGoWO/4AMAfAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+devscanner16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBAQCBPz+/MT+/ASChARCRATCxMTCxFxaXKSipDQyNAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARTEMgJgqWBVivEldkUdKSXhVjZfenommglDERh3Tc4E4ZRHAGgkEPr9X6H5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5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav1downarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIYhI+py+0PUZi0zmTtypflV0VdRJbm6fgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+nav1leftarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAP///wAAACH5BAEAAAAALAAAAAAQABAAAAIdhI+pyxqdwoNGTmgvy9px/IEWBWRkKZ2oWrKu4hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav1rightarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIdhI+pyxCtwoNHTmpvy3rxnnwQh1mUI52o6rCu6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav1uparrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIYhI+py+0PWwhxzmetzFpxnnxfRJbmufgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ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IAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+py+0R3IFQUtruXVqn3kkWyIARR4rqKvoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+playend16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+py8Eb3ENRggrxjRnrVIWcIoYd91FaenysMU6wTNeLXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+playpause16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIfhI+py+1vgoxzyUCxrZd18ClfmIyVyJ1lqkHuC0N+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+playstart16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pyxudwlNyguqkqRZh3h0gl43hpoElqlHt9UKw7NG27BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+playstop16:play play16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+1vgpySUWpvXXqrHmSaeJEYhKYq6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textblock16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py40Bo5SOzRvrwlgrfnkJOIkPaaaJXwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textbold16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIihI+py70BowPQ1HZpwNv212Vg9IGHmIjoWa4ey5DSRNd+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textbottom16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIVhI+py+0Po5y0hYtzrkB7zH0fN/kFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textcenter16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsnRkqtDnhu1zHfFSpjaY4PavgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textitalic16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+py+0BgztwUmmjBXX3jE0auHHhM5Yq4xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textleft16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsgRoqr3Vnt102fFSJjUC6nlPoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textmiddle16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIXhI+py+0PT5i01pisphjt3UmfFZYm5hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textmove16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+pm+EPIZsg2kfZvblXbwTg10WlA4rjyvgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textright16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIahI+pm+EPIZstSrqsDhhv1ylfFE5jiYwX6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textsortdec16:text text16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BPwCBAQCBAQC/FxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM5CBDM+uKp8KiMsmaAs82dtnGeCHnNp4TjNQ4jq8CbDNOroIe3ROyEx2A4vOgkOBzgFxQ6Xa0owJ8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+textsortinc16:text text16 16:photo:16 16:R0lGODlhEAAQAIIAAAT+BAQC/AQCBPwCBFxaXAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM4CAqxLm61CGBs81FMrQxgpnhKJlaXFJHUGg0w7DrDUmvtPQo8qyuEHoHW6hEVv+DQFvuhWtCFPwEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+text16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIlhI8Jwe2/AmpTynqPTXSqrnBM+I0kdmpmGmUp+K4nPMvhYx9+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+texttop16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIWhI9pwe2uYnq0yQtqxbz7D4biSIZ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textunder16:text text16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIjhI+pu+FxXoOIKpds1oBH7hlYxYxRCaIZ01lhJbHy9tTv7BcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewchoose16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMzCLrcGlAs6UAYgwLdLtEcI4ygQo7VVp2oupGpG4vmaUVTemX523qlFcw0a4RqNlkx5k8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewdetailed16: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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaBQIAQEBAMhkikgFAwHAiC5FCASCQUCwYiKiU0HA9IRAIhSAcTSuXBsFwwk0wyYNBANpyOxPMxIzMgCyEiHSMkGCV+SAQQJicoJCllUgBUECEeKhAIBCuUSxMKIFArBIpJBCxmLQQuL6cAsLECrqeys7WxpqZdtK9Ct8C0fsHAZn5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewmulticolumn16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMwCLrc/ixI0WSgKoyBl+beQFACpo1AqXbKCr1wLAMWS08hGG3dSZqin4sxnBmPD38CACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewtext16:view view16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIchI+py40BTQSwuovp3DXkv1ia1IHmIXLiyWJ+AQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+viewtree16:view view16 16:photo:16 16:R0lGODlhEAAQAIIAAAQCBPwCBDQyNPz+/PzerAAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAMu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sbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textcenter22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUbz3Sh7yIWfFHKjVl4nmFrr1Lpr7LwkjeeIUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textitalic22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py+0P4wqUSlQvttrkDnyaOHIdeaGRupplAIauVM3xjeeOUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textleft22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+pyw0Bo5zB2UXz3Sp7yG2fFJajVjonmIor2TJvfL0wjecIXQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textright22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUfz3SZ7yIXdF4kWqZkbCqoMO7kXLC+wVOe6YRQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2Z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NPz+/Pz69PTq5AQCBOzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARTEMhJq7046813+MJQfUF4BURhHGO6noSBsEcNoDJtS4KcsJQe4ncZ1HYT47HDbDqfUAnJRJmKLIGCCjjJbmE5wBI3EyOFxKCPS1EiJW52dE6vZyIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewtext22:view view22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIkhI+py+0Po2ShBlOxzbP7n2yaJoLm+ZTcxqHuC6hXzML2HVEFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewtree22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBFRSVExKTDQyNPz+/Pz69Pzu5PTq5OzaxBQOFOzKpFRWVFxWXOzexPTexCH5BAEAAAAALAAAAAAWABYAAARPEMhJq704g6A779kHCORAgNskFMYhakE8FkjyBcoWv+JwJItXaELYCTFHlCSpZKKcoB5jYHpOGgUadLKbIRw3jhEzQDyCSuI4zW673yhDBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
diff --git a/ext/tk/sample/tkextlib/ICONS/viewIcons.rb b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
new file mode 100644
index 0000000000..02ba19a629
--- /dev/null
+++ b/ext/tk/sample/tkextlib/ICONS/viewIcons.rb
@@ -0,0 +1,329 @@
+#!/usr/bin/env ruby
+#
+# viewIcons.rb
+#
+# -- Display icons from icon library.
+#
+# -- Copy the clicked icon data (command string of creating
+# a TkPhotoImage instance) to the clipboard.
+#
+require 'tk'
+require 'tkextlib/ICONS'
+
+class ViewIcons
+ #####################################
+ private
+ #####################################
+ def _create_controls
+ @controls = base = TkFrame.new
+ columns = TkFrame.new(base)
+ line1 = TkFrame.new(base, :height=>2, :borderwidth=>1, :relief=>:sunken)
+ line2 = TkFrame.new(base, :height=>2, :borderwidth=>1, :relief=>:sunken)
+
+ lbl_library = TkLabel.new(base, :font=>@boldfont, :text=>'Library')
+ lbl_groups = TkLabel.new(base, :font=>@boldfont, :text=>'Groups')
+ lbl_columns = TkLabel.new(base, :font=>@boldfont, :text=>'Columns')
+
+ ent_library = TkEntry.new(base, :width=>50, :textvariable=>@library)
+ ent_groups = TkEntry.new(base, :width=>50, :textvariable=>@groups)
+
+ btn_browse = TkButton.new(base, :text=>'Browse',
+ :command=>method(:select_icons))
+ btn_view = TkButton.new(base, :text=>'View',
+ :command=>method(:display_icons))
+ btn_exit = TkButton.new(base, :text=>'Exit', :command=>proc{exit})
+
+ @column_btns = {}
+ 6.step(20, 2){|i|
+ @column_btns[i] = TkButton.new(columns,
+ :text=>i.to_s, :width=>2,
+ :command=>proc{set_columns(i)}
+ ).pack(:side=>:left)
+ }
+ @column_btns[@columns][:relief] = :sunken
+
+ lbl_library.grid(:row=>0, :column=>0, :padx=>4)
+ ent_library.grid(:row=>0, :column=>1)
+ btn_browse.grid(:row=>0, :column=>2, :padx=>4, :pady=>2, :sticky=>:ew)
+
+ line1.grid(:row=>1, :column=>0, :pady=>2, :columnspan=>3, :sticky=>:ew)
+
+ lbl_groups.grid(:row=>2, :column=>0, :padx=>4)
+ ent_groups.grid(:row=>2, :column=>1)
+ btn_view.grid(:row=>2, :column=>2, :padx=>4, :pady=>2, :sticky=>:ew)
+
+ line1.grid(:row=>3, :column=>0, :pady=>2, :columnspan=>3, :sticky=>:ew)
+
+ lbl_columns.grid(:row=>4, :column=>0, :padx=>4)
+ columns.grid(:row=>4, :column=>1, :padx=>2, :sticky=>:ew)
+ btn_exit.grid(:row=>4, :column=>2, :padx=>4, :pady=>2, :sticky=>:ew)
+
+ base.pack
+
+ ent_library.bind('Return', method(:display_icons), '')
+ ent_groups.bind('Return', method(:display_icons), '')
+ end
+
+ def _create_display
+ base = TkFrame.new(:borderwidth=>2, :relief=>:sunken)
+
+ @icons_window = icons = TkCanvas.new(base)
+ xscr = icons.xscrollbar(TkScrollbar.new(base))
+ yscr = icons.yscrollbar(TkScrollbar.new(base))
+
+ icons.grid(:row=>0, :column=>0, :sticky=>:news)
+ yscr.grid(:row=>0, :column=>1, :sticky=>:ns)
+ xscr.grid(:row=>1, :column=>0, :sticky=>:ew)
+ base.grid_columnconfigure(0, :weight=>1)
+ base.grid_columnconfigure(1, :weight=>0)
+ base.grid_rowconfigure(0, :weight=>1)
+ base.grid_rowconfigure(1, :weight=>0)
+ # yscr.pack(:side=>:right, :fill=>:y)
+ # xscr.pack(:side=>:bottom, :fill=>:x)
+ # icons.pack(:side=>:left, :fill=>:both, :expand=>true)
+
+ @icons_layout = TkFrame.new(icons).pack
+ TkcWindow.create(icons, 0, 0, :anchor=>:nw, :window=>@icons_layout)
+ @icons_layout.bind('Configure', method(:layout_resize), '')
+
+ base.pack(:expand=>true, :fill=>:both)
+ end
+
+ def _create_info_window
+ @info_window = TkToplevel.new(:background=>'lightyellow', :borderwidth=>1,
+ :relief=>:solid){|w|
+ lbl_name = TkLabel.new(w, :text=>'Name', :background=>'lightyellow',
+ :font=>@boldfont, :justify=>:left)
+ lbl_grps = TkLabel.new(w, :text=>'Groups', :background=>'lightyellow',
+ :font=>@boldfont, :justify=>:left)
+ lbl_type = TkLabel.new(w, :text=>'Type', :background=>'lightyellow',
+ :font=>@boldfont, :justify=>:left)
+ lbl_size = TkLabel.new(w, :text=>'Size', :background=>'lightyellow',
+ :font=>@boldfont, :justify=>:left)
+
+ lbl_name.grid(:row=>0, :column=>0, :sticky=>:w)
+ lbl_grps.grid(:row=>1, :column=>0, :sticky=>:w)
+ lbl_type.grid(:row=>2, :column=>0, :sticky=>:w)
+ lbl_size.grid(:row=>3, :column=>0, :sticky=>:w)
+
+ @name = TkLabel.new(w, :background=>'lightyellow', :justify=>:left)
+ @grps = TkLabel.new(w, :background=>'lightyellow', :justify=>:left)
+ @type = TkLabel.new(w, :background=>'lightyellow', :justify=>:left)
+ @size = TkLabel.new(w, :background=>'lightyellow', :justify=>:left)
+
+ @name.grid(:row=>0, :column=>1, :sticky=>:w)
+ @grps.grid(:row=>1, :column=>1, :sticky=>:w)
+ @type.grid(:row=>2, :column=>1, :sticky=>:w)
+ @size.grid(:row=>3, :column=>1, :sticky=>:w)
+
+ def name(txt)
+ @name['text'] = txt
+ end
+ def groups(txt)
+ @grps['text'] = txt
+ end
+ def type(txt)
+ @type['text'] = txt
+ end
+ def size(txt)
+ @size['text'] = txt
+ end
+
+ overrideredirect(true)
+ withdraw
+ }
+ end
+
+ def initialize(init_path = Tk::LIBRARY)
+ init_path = Tk::LIBRARY unless init_path
+ init_path = File.expand_path(init_path)
+ if File.directory?(init_path)
+ @initial_dir = init_path
+ @initial_file = 'tkIcons'
+ else
+ @initial_dir = File.dirname(init_path)
+ @initial_file = File.basename(init_path)
+ end
+
+ if Tk::PLATFORM['platform'] == 'unix'
+ TkOption.add('*HighlightThickness', 0)
+ end
+
+ @columns = 14
+ @command = ""
+
+ @delay_timer = nil
+
+ dummy = TkLabel.new
+ @font = dummy.font
+ @boldfont = TkFont.new(@font, :weight=>:bold)
+ @icons = {}
+ @icon_name = {}
+ @icon_info = {}
+
+ @library = TkVariable.new(File.join(@initial_dir, @initial_file))
+ @groups = TkVariable.new('*')
+
+ _create_controls
+
+ _create_display
+
+ _create_info_window
+
+ Tk.root.title('viewIcons')
+ layout_resize
+ Tk.root.resizable(false, true)
+
+ display_icons
+ end
+
+ def init_info(item, name)
+ @icon_name[item] = name
+
+ item.bind('Button-1', method(:clip_info), '%W')
+ item.bind('Enter', method(:delay_info), '%W')
+ item.bind('Leave', method(:cancel_info), '')
+ end
+
+ def delay_info(item)
+ cancel_info
+ @delay_timer = TkTimer.new(200, 1, proc{ show_info(item) }).start
+ end
+
+ def cancel_info
+ if @delay_timer
+ @delay_timer.cancel
+ @delay_timer = nil
+ end
+ @info_window.withdraw
+ end
+
+ def show_info(item)
+ name, groups, type, size = @icon_info[@icon_name[item]]
+ @info_window.name(name)
+ @info_window.groups(groups)
+ @info_window.type(type)
+ @info_window.size(size)
+
+ info_x = item.winfo_rootx + 10
+ info_y = item.winfo_rooty + item.winfo_height
+
+ @info_window.geometry("+#{info_x}+#{info_y}")
+ @info_window.deiconify
+
+ @info_window.raise
+
+ @delay_timer = nil
+ end
+
+ def primary_transfer(offset, max_chars)
+ @command
+ end
+
+ def lost_selection
+ @command = ""
+ end
+
+ def clip_info(item)
+ name = @icon_name[item]
+ data_width = 60
+
+ cmd = "#{name} = TkPhotoImage.new(:data=><<'EOD')\n"
+
+ icon_data = Tk::ICONS.query(name, :file=>@library.value, :items=>'d')[0][0]
+
+ icon_data.scan(/.{1,#{data_width}}/m){|s| cmd << ' ' << s << "\n"}
+
+ cmd << "EOD\n"
+
+ @command = cmd
+
+ TkClipboard.clear
+ TkClipboard.append(@command)
+
+ if Tk::PLATFORM['platform'] == 'unix'
+ TkSelection.handle(Tk.root, method(:primary_transfer),
+ :selection=>'PRIMARY')
+ TkSelection.set_owner(Tk.root, :selection=>'PRIMARY',
+ :command=>method(:lost_selection))
+ end
+
+ Tk.bell
+ end
+
+ def layout_resize
+ Tk.update
+ bbox = @icons_window.bbox('all')
+ width = @controls.winfo_width - @icons_window.yscrollbar.winfo_width - 8
+
+ @icons_window.configure(:width=>width, :scrollregion=>bbox,
+ :xscrollincrement=>'0.1i',
+ :yscrollincrement=>'0.1i')
+ end
+
+ def select_icons
+ new_lib = Tk.getOpenFile(:initialdir=>@initial_dir,
+ :initialfile=>'tkIcons',
+ :title=>'Select Icon Library',
+ :filetypes=>[
+ ['Icon Libraries', ['tkIcons*']],
+ ['All Files', ['*']]
+ ])
+
+ @library.value = new_lib if new_lib.length != 0
+ display_icons
+ end
+
+ def display_icons
+ column = 0
+ limit = @columns - 1
+ row = 0
+
+ unless File.exist?(@library.value)
+ Tk.messageBox(:icon=>'warning', :message=>'File does not exist',
+ :title=>'viewIcons')
+ return
+ end
+
+ cursor = Tk.root[:cursor]
+ Tk.root[:cursor] = 'watch'
+
+ Tk::ICONS.delete(@icons)
+
+ @icons_frame.destroy if @icons_frame
+ @icons_frame = TkFrame.new(@icons_layout).pack
+
+ @icons = Tk::ICONS.create(:file=>@library.value, :group=>@groups.value)
+
+ Tk::ICONS.query(:file=>@library.value, :group=>@groups.value).each{|inf|
+ name = inf[0]
+ @icon_info[name] = inf
+
+ lbl = TkLabel.new(@icons_frame, :image=>"::icon::#{name}")
+ lbl.grid(:column=>column, :row=>row, :padx=>3, :pady=>3)
+ # lbl.grid_columnconfigure column
+
+ init_info(lbl, name)
+
+ if column == limit
+ column = 0
+ row += 1
+ else
+ column += 1
+ end
+ }
+
+ Tk.root[:cursor] = cursor
+ end
+
+ def set_columns(columns)
+ @columns = columns
+ 6.step(20, 2){|i| @column_btns[i][:relief] = :raised }
+ @column_btns[@columns][:relief] = :sunken
+ display_icons
+ end
+end
+
+ViewIcons.new(ARGV[0])
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/barchart5.rb b/ext/tk/sample/tkextlib/blt/barchart5.rb
new file mode 100644
index 0000000000..86101b200d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/barchart5.rb
@@ -0,0 +1,101 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+load File.join(File.dirname(File.expand_path(__FILE__)),
+ 'scripts', 'stipples.rb')
+
+TkOption.add('*graph.x.Title', 'X Axis Label')
+TkOption.add('*graph.y.Title', 'Y Axis Label')
+TkOption.add('*graph.title', 'A Simple Barchart')
+TkOption.add('*graph.x.Font', 'Times 10')
+TkOption.add('*graph.Element.Relief', :raised)
+
+visual = Tk.root.winfo_screenvisual
+if visual != 'staticgray' && visual != 'grayscale'
+ TkOption.add('*graph.LineMarker.color', 'yellow')
+ TkOption.add('*graph.Element.Background', 'white')
+ TkOption.add('*graph.Legend.activeForeground', 'pink')
+ TkOption.add('*print.background', 'yellow')
+ TkOption.add('*quit.background', 'red')
+ TkOption.add('*graph.background', 'palegreen')
+ TkOption.add('*graph.plotBackground', 'lightblue')
+end
+
+htext = Tk::BLT::Htext.new(:widgetname=>'.htext', :text=><<EOD)
+ This is an example of the barchart widget. The barchart has
+ many components; x and y axis, legend, crosshairs, elements, etc.
+ To create a postscript file "bar.ps", press the %%
+
+ ruby {
+ b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window,
+ :widgetname=>'print', :text=>'Print',
+ :command=>proc{
+ $graph.postsript(:output=>'bar.ps')
+ })
+ Tk::BLT::Htext::Htext_Widget.window.append(b)
+ }
+
+%% button.
+%%
+
+ ruby {
+ $graph = Tk::BLT::Barchart.new(:widgetname=>'.htext.graph',
+ :relief=>:raised, :borderwidth=>2)
+ $graph.xaxis_configure(:rotate=>90, :stepsize=>0)
+ Tk::BLT::Htext::Htext_Widget.window.append($graph,
+ :fill=>:both, :padx=>4)
+ }
+
+%%
+ Hit the %%
+
+ ruby {
+ b = TkButton.new(Tk::BLT::Htext::Htext_Widget.window,
+ :widgetname=>'quit', :text=>'Quit',
+ :command=>proc{ exit })
+ Tk::BLT::Htext::Htext_Widget.window.append(b)
+ }
+
+%% button when you've seen enough.%%
+
+ ruby {
+ l = TkLabel.new(Tk::BLT::Htext::Htext_Widget.window, :bitmap=>'BLT')
+ Tk::BLT::Htext::Htext_Widget.window.append(l, :padx=>20)
+ }
+
+%%
+EOD
+
+names = %w(One Two Three Four Five Six Seven Eight)
+if visual == 'staticgray' || visual == 'grayscale'
+ fgcolors = %w(white white white white white white white white)
+ bgcolors = %w(black black black black black black black black)
+else
+ fgcolors = %w(yellow orange red magenta purple blue cyan green)
+ bgcolors = %w(yellow4 orange4 red4 magenta4 purple4 blue4 cyan4 green4)
+end
+
+numColors = names.length
+
+Tk::TCL_PRECISION.value = 15
+
+x = Tk::BLT::Vector.new
+y = Tk::BLT::Vector.new
+x.seq(-5.0, 5.0, 0.2)
+y.expr("sin(#{x})")
+barWidth = 0.19
+
+$graph.element_create('sin', :relief=>:raised, :borderwidth=>1,
+ :x=>x, :y=>y, :barwidth=>barWidth)
+
+Tk::BLT::Table.add(Tk.root, htext, :fill=>:both)
+
+Tk.root.minsize(0, 0)
+
+Tk::BLT.zoom_stack($graph)
+Tk::BLT.crosshairs($graph)
+Tk::BLT.active_legend($graph)
+Tk::BLT.closest_point($graph)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/calendar.rb b/ext/tk/sample/tkextlib/blt/calendar.rb
new file mode 100644
index 0000000000..86d34043dc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/calendar.rb
@@ -0,0 +1,117 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/blt'
+
+require 'date'
+
+dir = File.join(File.dirname(File.expand_path(__FILE__)), 'images')
+file = File.join(dir, 'chalk.gif')
+active = File.join(dir, 'rain.gif')
+
+texture1 = TkPhotoImage.new(:file=>file)
+texture2 = TkPhotoImage.new(:file=>active)
+
+TkOption.add('*Tile', texture1)
+
+TkOption.add('*HighlightThickness', 0)
+TkOption.add('*calendar.weekframe*Tile', texture2)
+TkOption.add('*Calendar.Label.borderWidth', 0)
+TkOption.add('*Calendar.Label.relief', :sunken)
+TkOption.add('*Calendar.Frame.borderWidth', 2)
+TkOption.add('*Calendar.Frame.relief', :raised)
+TkOption.add('*Calendar.Label.font', 'Helvetica 11')
+TkOption.add('*Calendar.Label.foreground', 'navyblue')
+TkOption.add('*button.foreground', 'navyblue')
+TkOption.add('*background', 'grey85')
+TkOption.add('*Label.ipadX', 200)
+
+TkOption.add('*tile', texture2)
+
+class BLT_Calendar_sample
+ @@monthInfo = [
+ nil, # dummy
+ ['January', 31],
+ ['February', 28],
+ ['March', 31],
+ ['April', 30],
+ ['May', 31],
+ ['June', 30],
+ ['July', 31],
+ ['August', 31],
+ ['Septembar', 30],
+ ['October', 31],
+ ['November', 30],
+ ['December', 31]
+ ]
+
+ @@abbrDays = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
+
+ def initialize()
+ today = Date.today
+
+ if TkComm.bool(Tk.info(:commands, '.calendar'))
+ Tk.destroy('.calendar')
+ end
+ cal = Tk::BLT::Tile::Frame.new(:widgetname=>'.calendar',
+ :classname=>'Calendar',
+ :width=>'3i', :height=>'3i')
+
+ mon = Tk::BLT::Tile::Label.new(cal, :font=>'Courier 14 bold',
+ :text=>"#{@@monthInfo[today.month][0]} " +
+ "#{today.year}")
+ Tk::BLT::Table.add(cal, mon, [1, 0], :cspan=>7, :pady=>10)
+
+ week_f = Tk::BLT::Tile::Frame.new(cal, :widgetname=>'weekframe',
+ :relief=>:sunken, :borderwidth=>1)
+ Tk::BLT::Table.add(cal, week_f, [2, 0], :columnspan=>7, :fill=>:both)
+
+ @@abbrDays.each_with_index{|dayName, idx|
+ Tk::BLT::Table.add(cal,
+ Tk::BLT::Tile::Label.new(cal, :text=>dayName,
+ :font=>'Helvetica 12'),
+ [2, idx], :pady=>2, :padx=>2)
+ }
+
+ Tk::BLT::Table.itemconfigure(cal, 'c*', 'r2', :pad=>4)
+
+ numDays = @@monthInfo[today.month][1]
+ week = 0
+ cnt = 1
+
+ wkday = today.wday - ((today.day - 1) % 7)
+ wkday += 7 if wkday < 0
+
+ while cnt <= numDays
+ Tk::BLT::Table.add(cal,
+ Tk::BLT::Tile::Label.new(cal, :text=>cnt){
+ self.configure(:borderwidth=>1,
+ :relief=>:sunken) if cnt == today.day
+ },
+ [week+3, wkday], :fill=>:both, :ipadx=>10, :ipady=>4)
+ cnt += 1
+ wkday += 1
+ if wkday == 7
+ week += 1
+ wkday = 0
+ end
+ end
+
+ Tk::BLT::Tile::Frame.new(cal, :borderwidth=>1, :relief=>:sunken){|f|
+ Tk::BLT::Table.add(f,
+ Tk::BLT::Tile::Button.new(f, :widgetname=>'button',
+ :command=>proc{exit},
+ :borderwidth=>2,
+ :text=>'Quit'),
+ :padx=>4, :pady=>4)
+ Tk::BLT::Table.add(cal, f, [week+4, 5], :cspan=>2, :pady=>4)
+ }
+
+ Tk::BLT::Table.add(Tk.root, cal, :fill=>:both)
+ Tk::BLT::Table.itemconfigure(cal, 'r0', :resize=>:none)
+ end
+end
+
+BLT_Calendar_sample.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/graph6.rb b/ext/tk/sample/tkextlib/blt/graph6.rb
new file mode 100644
index 0000000000..b3eeb81231
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/graph6.rb
@@ -0,0 +1,2222 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/blt'
+
+Tk::TCL_PRECISION.value = 15
+
+[
+ ['*Graph.Width', '10i'],
+ ['*Graph.leftMargin', '.75i'],
+ ['*Graph.Height', '6i'],
+ ['*Graph.plotBackground', 'black'],
+ ['*LineMarker.color', 'white'],
+ ['*LineMarker.Dashes', 5],
+ ['*TextMarker.foreground', 'white'],
+ ['*TextMarker.Background', ''],
+
+ ['*Graph.x.hide', true],
+ ['*Graph.x.title', ''],
+ ['*Graph.y.rotate', 90],
+ # ['*Graph.y.stepSize', 2.0],
+ ['*Graph.title', ''],
+ ['*graph.Title', 'Example s27'],
+ ['*graph.x.hide', false],
+ ['*graph.topMargin', 0],
+ ['*graph.bottomMargin', 0],
+ ['*x.Title', 'Time'],
+ ['*y.Title', 'Signals'],
+ ['*Pixels', 1],
+
+ ['*Reduce', 0.5],
+ ['*bufferElements', false],
+
+ ['*Element.color', 'green4'],
+ ['*Element.ScaleSymbols', true],
+ ['*Element.Color', 'grey70'],
+ ['*Element.Symbol', :none],
+ ['*Element.LineWidth', 1],
+ # ['*Element.Smooth', :natural],
+ ['*Element.Smooth', :catrom],
+
+ ['*activeLine.LineWidth', 2],
+ ['*activeLine.Color', 'white'],
+ ['*activeLine.Color', 'green1'],
+
+ # ['*Legend.Hide', true],
+ ['*Legend.Position', :right],
+ ['*Legend.Relief', :flat],
+ ['*Legend.activeRelief', :sunken],
+ ['*Legend.borderWidth', 2],
+ #['*Legend.Font', '-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*'],
+ ['*Legend.Font', 'Helvetica -10'],
+ ['*Grid.hide', false],
+ ['*Grid.dashes', [1, 5]],
+
+ # ['*foreground', 'white'],
+ ['*zoomOutline.outline', 'yellow'],
+].each{|k, v| TkOption.add(k, v)}
+
+##############################
+
+class BLT_Graph_Demo
+ def initialize
+ @graph = Tk::BLT::Graph.new(:widgetname=>'graph')
+
+ @root = Tk.root
+ @root.minsize(0, 0)
+
+ _set_vectors()
+ (1..39).each{|i| @graph.element_create("V#{i}", :x=>@x, :y=>@v[i])}
+
+ @top = Tk::BLT::Tile::Toplevel.new
+=begin
+ legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend',
+ :without_creating=>true)
+ @graph.legend_configure(:position=>legend)
+=end
+ # legend = @graph.legend_window_create(@top, :widgetname=>'legend')
+ legend = @graph.legend_window_create(@top)
+ legend.pack(:fill=>:both, :expand=>true)
+
+ Tk::BLT::Table.add(@root, @graph, [0,0], :fill=>:both)
+
+ @quit_btn = Tk::BLT::Tile::Button.new(:text=>' quit ', :background=>'red',
+ :command=>proc{exit})
+ Tk::BLT::Table.add(@root, @quit_btn, [1,0], :anchor=>:e, :padx=>10)
+
+ @graph.zoom_stack
+ @graph.crosshairs
+ @graph.closest_point
+ @graph.print_key
+
+ @graph.legend_bind(:all, 'ButtonRelease-1',
+ proc{|w| highlightTrace(w)}, '%W')
+ @graph.legend_bind(:all, 'ButtonRelease-3',
+ proc{|w|
+ w.legend_deactivate('*')
+ active = w.element_activate
+ w.element_deactivate(*active)
+ }, '%W')
+ end
+
+ private
+
+ def _set_vectors
+ @x = Tk::BLT::Vector.new(:variable=>'')
+ @v = []
+ (1..39).each{|i| @v[i] = Tk::BLT::Vector.new(:variable=>'')}
+
+ @x.set(<<-'EOD')
+ 0 1e-10 2e-10 3e-10 4e-10 5e-10 6e-10 7e-10 8e-10 9e-10
+ 1e-09 1.1e-09 1.2e-09 1.3e-09 1.4e-09 1.5e-09 1.6e-09 1.7e-09
+ 1.8e-09 1.9e-09 2e-09 2.1e-09 2.2e-09 2.3e-09 2.4e-09 2.5e-09
+ 2.6e-09 2.7e-09 2.8e-09 2.9e-09 3e-09 3.1e-09 3.2e-09 3.3e-09
+ 3.4e-09 3.5e-09 3.6e-09 3.7e-09 3.8e-09 3.9e-09 4e-09 4.1e-09
+ 4.2e-09 4.3e-09 4.4e-09 4.5e-09 4.6e-09 4.7e-09 4.8e-09
+ 4.9e-09 5e-09 5.1e-09 5.2e-09 5.3e-09 5.4e-09 5.5e-09 5.6e-09
+ 5.7e-09 5.8e-09 5.9e-09 6e-09 6.1e-09 6.2e-09 6.3e-09 6.4e-09
+ 6.5e-09 6.6e-09 6.7e-09 6.8e-09 6.9e-09 7e-09 7.1e-09 7.2e-09
+ 7.3e-09 7.4e-09 7.5e-09 7.6e-09 7.7e-09 7.8e-09 7.9e-09
+ 8e-09 8.1e-09 8.2e-09 8.3e-09 8.4e-09 8.5e-09 8.6e-09 8.7e-09
+ 8.8e-09 8.9e-09 9e-09 9.1e-09 9.2e-09 9.3e-09 9.4e-09 9.5e-09
+ 9.6e-09 9.7e-09 9.8e-09 9.9e-09 1e-08 1.01e-08 1.02e-08
+ 1.03e-08 1.04e-08 1.05e-08 1.06e-08 1.07e-08 1.08e-08 1.09e-08
+ 1.1e-08 1.11e-08 1.12e-08 1.13e-08 1.14e-08 1.15e-08 1.16e-08
+ 1.17e-08 1.18e-08 1.19e-08 1.2e-08 1.21e-08 1.22e-08 1.23e-08
+ 1.24e-08 1.25e-08 1.26e-08 1.27e-08 1.28e-08 1.29e-08 1.3e-08
+ 1.31e-08 1.32e-08 1.33e-08 1.34e-08 1.35e-08 1.36e-08 1.37e-08
+ 1.38e-08 1.39e-08 1.4e-08 1.41e-08 1.42e-08 1.43e-08 1.44e-08
+ 1.45e-08 1.46e-08 1.47e-08 1.48e-08 1.49e-08 1.5e-08 1.51e-08
+ 1.52e-08 1.53e-08 1.54e-08 1.55e-08 1.56e-08 1.57e-08 1.58e-08
+ 1.59e-08 1.6e-08 1.61e-08 1.62e-08 1.63e-08 1.64e-08 1.65e-08
+ 1.66e-08 1.67e-08 1.68e-08 1.69e-08 1.7e-08 1.71e-08 1.72e-08
+ 1.73e-08 1.74e-08 1.75e-08 1.76e-08 1.77e-08 1.78e-08 1.79e-08
+ 1.8e-08 1.81e-08 1.82e-08 1.83e-08 1.84e-08 1.85e-08 1.86e-08
+ 1.87e-08 1.88e-08 1.89e-08 1.9e-08 1.91e-08 1.92e-08 1.93e-08
+ 1.94e-08 1.95e-08 1.96e-08 1.97e-08 1.98e-08 1.99e-08 2e-08
+ 2.01e-08 2.02e-08 2.03e-08 2.04e-08 2.05e-08 2.06e-08 2.07e-08
+ 2.08e-08 2.09e-08 2.1e-08 2.11e-08 2.12e-08 2.13e-08 2.14e-08
+ 2.15e-08 2.16e-08 2.17e-08 2.18e-08 2.19e-08 2.2e-08 2.21e-08
+ 2.22e-08 2.23e-08 2.24e-08 2.25e-08 2.26e-08 2.27e-08 2.28e-08
+ 2.29e-08 2.3e-08 2.31e-08 2.32e-08 2.33e-08 2.34e-08 2.35e-08
+ 2.36e-08 2.37e-08 2.38e-08 2.39e-08 2.4e-08 2.41e-08 2.42e-08
+ 2.43e-08 2.44e-08 2.45e-08 2.46e-08 2.47e-08 2.48e-08 2.49e-08
+ 2.5e-08 2.51e-08 2.52e-08 2.53e-08 2.54e-08 2.55e-08 2.56e-08
+ 2.57e-08 2.58e-08 2.59e-08 2.6e-08 2.61e-08 2.62e-08 2.63e-08
+ 2.64e-08 2.65e-08 2.66e-08 2.67e-08 2.68e-08 2.69e-08 2.7e-08
+ 2.71e-08 2.72e-08 2.73e-08 2.74e-08 2.75e-08 2.76e-08 2.77e-08
+ 2.78e-08 2.79e-08 2.8e-08 2.81e-08 2.82e-08 2.83e-08 2.84e-08
+ 2.85e-08 2.86e-08 2.87e-08 2.88e-08 2.89e-08 2.9e-08 2.91e-08
+ 2.92e-08 2.93e-08 2.94e-08 2.95e-08 2.96e-08 2.97e-08 2.98e-08
+ 2.99e-08 3e-08 3.01e-08 3.02e-08 3.03e-08 3.04e-08 3.05e-08
+ 3.06e-08 3.07e-08 3.08e-08 3.09e-08 3.1e-08 3.11e-08 3.12e-08
+ 3.13e-08 3.14e-08 3.15e-08 3.16e-08 3.17e-08 3.18e-08 3.19e-08
+ 3.2e-08 3.21e-08 3.22e-08 3.23e-08 3.24e-08 3.25e-08 3.26e-08
+ 3.27e-08 3.28e-08 3.29e-08 3.3e-08 3.31e-08 3.32e-08 3.33e-08
+ 3.34e-08 3.35e-08 3.36e-08 3.37e-08 3.38e-08 3.39e-08 3.4e-08
+ 3.41e-08 3.42e-08 3.43e-08 3.44e-08 3.45e-08 3.46e-08 3.47e-08
+ 3.48e-08 3.49e-08 3.5e-08 3.51e-08 3.52e-08 3.53e-08 3.54e-08
+ 3.55e-08 3.56e-08 3.57e-08 3.58e-08 3.59e-08 3.6e-08
+ EOD
+
+ @v[1].set(<<-'EOD')
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 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 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 4 3 2 1 2.13718e-14 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0
+ EOD
+
+ @v[7].set(<<-'EOD')
+ 5 5.16904 4.84159 3.34542 0.317102 0.103304 0.0275721 0.0221534
+ 0.017689 0.0142639 0.0113974 0.00918238 0.00742541 0.00616602
+ 0.00481195 0.00397049 -0.0659889 -0.025671 0.165495 0.986891
+ 3.05229 4.55511 4.91611 4.98192 4.99428 4.99833 4.99095
+ 4.97295 4.95493 4.93428 4.90723 4.94799 4.98584 4.99566
+ 4.99813 4.99907 4.99947 4.99965 4.99976 4.99984 4.99989
+ 4.99992 4.99994 4.99996 4.99998 5.00002 5.00006 5.00002
+ 4.99996 4.99994 4.99999 5.00003 5.00002 5 4.99997 4.99997
+ 4.99997 4.99997 4.99997 4.99996 4.99997 4.99997 4.99998
+ 4.99998 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99998 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.16575
+ 4.69986 2.43862 0.0230224 0.035229 -0.0210607 -0.0292766
+ -0.0172693 -0.00271479 -0.000912251 -0.000349106 -0.000116866
+ -4.24733e-05 -1.39536e-05 -3.01179e-05 -0.0657192 -0.0204835
+ 0.183378 1.07181 3.118 4.46472 4.84158 4.94795 4.98173 4.99236
+ 4.99762 5.01939 5.0433 5.05332 5.04959 5.03955 5.02851 5.02052
+ 5.01422 5.00965 5.00631 5.00405 5.00248 5.00083 5.00012
+ 5.00209 5.00387 5.00347 4.99917 4.99213 4.98411 4.97521
+ 4.96332 4.94601 4.9304 4.94633 4.97936 4.99264 4.99685 4.99857
+ 4.99925 4.99954 4.9997 4.99973 4.9997 4.99973 4.99979 4.99983
+ 4.99986 4.99988 4.9999 4.9999 4.99992 4.99993 4.99994 4.99995
+ 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 5 5 5.14242 4.76101 3.16003 0.299374
+ 0.0645506 -0.000498424 -2.45108e-05 -2.27986e-05 -5.24401e-05
+ -4.9884e-05 -4.92491e-05 -2.93354e-05 -3.21402e-05 -2.11851e-05
+ -3.37925e-05 -0.0657892 -0.020563 0.182582 1.06058 3.12484
+ 4.46552 4.84146 4.95102 4.98556 4.99472 4.99806 4.99909
+ 4.99955 4.99976 4.99994 4.99992 5.00029 4.99967 4.99849
+ 4.99736 4.99884 5.00099 5.00377 5.00215 4.99994 4.99893
+ 4.99788 4.99862 5.00055 5.00134 5.00127 5.00073 5.00039
+ 5.00018 5.00006 5.00001 4.99985 5.00026 5.00018 5.00003
+ 4.99981 4.99985 4.99987 4.99985 4.99982 4.99982 4.99982
+ 4.99983 4.99985 4.99987 4.99989 4.99991 4.99992 4.99994
+ 4.99995 4.99995 4.99994 4.99994 4.99996 4.99999 5.00002
+ 5.00008 5.00009 5.00006 5.00001 5 4.99999 4.99998 4.99997
+ 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
+ 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998 4.99998
+ 4.99998
+ EOD
+
+ @v[8].set(<<-'EOD')
+ 5 5.03758 5.04711 4.96911 4.20882 3.96295 4.01117 4.15521
+ 4.2967 4.42274 4.5295 4.6176 4.69014 4.74831 4.7966 4.83537
+ 4.80526 4.787 4.79295 4.88588 5.08978 5.15615 5.10778 5.07718
+ 5.06652 5.08225 4.9744 4.52977 3.77452 2.69426 1.15294 0.245509
+ 0.0981544 0.0567527 0.0367487 0.0252578 0.0180599 0.0133837
+ 0.0101497 0.0078616 0.00620186 0.00499056 0.0041027 0.00344223
+ 0.00295808 0.00260089 0.00229887 0.00200817 0.00176397 0.00160116
+ 0.00147381 0.00134645 0.00125029 0.00116043 0.00107371 0.00101981
+ 0.000965921 0.000912028 0.000858135 0.000804242 0.000761669
+ 0.00072672 0.000691771 0.000656823 0.000621874 0.000588722
+ 0.00057041 0.000552098 0.000533785 0.000515473 0.000497162
+ 0.00047885 0.000460537 0.000442226 0.000423914 0.000405601
+ 0.000388399 0.000378694 0.000368989 0.000359284 0.00034958
+ 0.000339875 0.00033017 0.000320465 0.00031076 0.000301055
+ 0.00029135 0.000282207 0.000276247 0.000270287 0.000264327
+ 0.000258367 0.000252407 0.000246447 0.000240487 0.000234527
+ 0.000228567 0.000222607 0.000217086 0.000213696 0.000210307
+ 0.000206918 0.000203528 0.000200139 0.00019675 0.00019336
+ 0.000189971 0.000186582 0.000183192 0.000179803 0.000176414
+ 0.000173025 0.000169635 0.000166246 0.000162857 0.000159467
+ 0.000156078 0.000152689 0.000149299 0.00014591 0.00014255
+ 0.0316021 0.163272 0.348732 0.603651 0.35745 0.135965 0.0707354
+ 0.0314595 0.0201047 0.00994945 0.00389601 0.00138839 0.00060778
+ 0.000329648 0.000492396 -0.0732035 -0.0844077 -0.0789062
+ -0.0390837 0.0197559 0.0183094 -0.00180099 -0.0189565 -0.0424144
+ -0.0735904 -0.0892423 0.285039 1.13702 2.10809 2.95826 3.60164
+ 4.0435 4.35771 4.57254 4.71769 4.81329 4.87534 4.91487 4.94264
+ 4.97375 5.01526 5.06517 5.10154 5.06259 4.89005 4.5787 4.12226
+ 3.46151 2.49023 1.2586 0.32725 0.116753 0.0701865 0.0455509
+ 0.0286914 0.0178176 0.0117599 0.00902715 0.00760583 0.00637745
+ 0.00543811 0.00439377 0.00352448 0.0030151 0.00285771 0.002465
+ 0.00203114 0.00173004 0.0014839 0.00125177 0.00105327 0.000894905
+ 0.000766372 0.000658894 0.000569105 0.000492114 0.000427938
+ 0.000370217 0.000314758 0.000266569 0.000233726 0.000209048
+ 0.000191957 0.000177169 0.000166604 0.000161 0.000157314
+ 0.000143828 0.000130342 0.000116857 0.000103371 8.98855e-05
+ 7.63998e-05 6.29141e-05 5.76583e-05 5.30027e-05 4.8347e-05
+ 4.36913e-05 3.90357e-05 3.438e-05 2.97243e-05 2.72507e-05
+ 2.59083e-05 2.45659e-05 2.32235e-05 2.18811e-05 2.05387e-05
+ 1.91963e-05 1.78539e-05 1.65115e-05 1.51691e-05 1.38267e-05
+ 1.24843e-05 1.11419e-05 9.79954e-06 8.51574e-06 7.69807e-06
+ 6.8804e-06 6.06273e-06 5.24506e-06 0.0287318 0.0317111 -0.0320087
+ -0.103609 0.0369639 0.0121128 0.00961197 0.00934971 0.00820853
+ 0.00699769 0.00607002 0.00535541 0.00476552 0.00427601 0.00376357
+ -0.073012 -0.0866964 -0.0809538 -0.038005 0.0277001 0.0188906
+ 0.00614597 0.00373629 0.00489787 0.0146573 0.0191052 0.0151708
+ 0.0124224 0.0105859 0.00879272 0.00729464 0.0070047 0.00449575
+ -0.00626652 -0.0252417 -0.0147287 0.022538 0.0822905 0.0947372
+ 0.0657516 0.0445506 0.0316753 0.0220971 0.0158101 0.0140971
+ 0.0161498 0.0139876 0.0122447 0.0106994 0.009397 0.00822236
+ 0.00686509 0.00797431 0.00751269 0.00671173 0.00595243 0.00524633
+ 0.00459528 0.00401688 0.00350109 0.00303954 0.00260569 0.00222792
+ 0.00191033 0.00163917 0.00140949 0.00121464 0.0010471 0.000900638
+ 0.000768847 0.000645236 0.000524807 0.000460275 0.000442237
+ 0.000446775 0.000397026 0.000301585 0.000228994 0.000190894
+ 0.000166569 0.000152261 0.000137953 0.000123644 0.000109336
+ 9.50281e-05 8.56557e-05 7.78437e-05 7.00318e-05 6.22198e-05
+ 5.44079e-05 4.87539e-05 4.57761e-05 4.27982e-05 3.98203e-05
+ 3.68425e-05 3.38646e-05 3.08868e-05 2.79089e-05 2.4931e-05
+ 2.19532e-05 1.89753e-05 1.75244e-05 1.64095e-05 1.52946e-05
+ 1.41797e-05 1.30648e-05 1.19499e-05 1.0835e-05 9.72011e-06
+ 8.60521e-06 7.4903e-06 6.5117e-06 6.10334e-06 5.69497e-06
+ 5.2866e-06 4.87824e-06 4.46987e-06 4.06151e-06 3.65314e-06
+ 3.24477e-06
+ EOD
+
+ @v[9].set(<<-'EOD')
+ 1.86175 1.99708 2.07867 2.01211 2.43309 3.27194 3.63896
+ 3.90426 4.11074 4.27932 4.41496 4.52543 4.61491 4.68862
+ 4.7479 4.79666 4.72895 4.68886 4.70354 4.81353 5.01568 5.14184
+ 5.10482 5.07362 5.05143 5.03638 5.02323 5.01465 5.00853
+ 5.00383 4.99985 5.00454 5.00652 5.00546 5.00411 5.003 5.00214
+ 5.00151 5.00106 5.00073 5.0005 5.00034 5.00023 5.00015 5.0001
+ 5.00005 5 5.00001 5.00005 5.00005 5.00003 5 4.99998 4.99996
+ 4.99994 4.99995 4.99997 4.99998 5 5.00001 5.00002 5.00002
+ 5.00003 5.00003 5.00003 5.00003 5.00003 5.00003 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
+ 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.17392 4.94828 3.78491
+ 1.52079 0.608874 0.244031 0.127087 0.0552995 0.0361032 0.0169025
+ 0.006364 0.00217624 0.000921391 0.000457305 0.000786754
+ -0.120016 -0.148054 -0.15898 -0.0801463 0.16463 0.174017
+ 0.0799249 0.0318788 0.0129696 0.00483397 0.0025677 0.0042079
+ 0.00350003 0.00178404 -8.72902e-05 -0.00128497 -0.00142213
+ -0.00130018 -0.00106874 -0.000789207 -0.000824335 -0.00104518
+ -0.00136799 -0.004366 -0.0102621 -0.0109254 -0.00649259
+ -0.00194842 0.00029793 0.00148673 0.00221085 0.00228291
+ 0.00185261 0.00139687 0.00148183 0.00562266 0.00844119 0.00754627
+ 0.00657396 0.00591212 0.00539269 0.0049282 0.00448417 0.0040572
+ 0.00363719 0.00320392 0.00279607 0.00243938 0.00211505 0.00182302
+ 0.00156254 0.0013341 0.00113834 0.000971865 0.00082776 0.000706193
+ 0.000602499 0.000515059 0.000441401 0.00037897 0.000325459
+ 0.00028083 0.000242096 0.000207274 0.000176444 0.000150372
+ 0.000126407 0.000103373 9.05522e-05 8.53555e-05 8.63685e-05
+ 9.02593e-05 8.37346e-05 7.72099e-05 7.06852e-05 6.41605e-05
+ 5.76358e-05 5.11112e-05 4.45865e-05 4.08176e-05 3.72497e-05
+ 3.36818e-05 3.01138e-05 2.65459e-05 2.2978e-05 1.94101e-05
+ 1.76154e-05 1.67399e-05 1.58645e-05 1.4989e-05 1.41136e-05
+ 1.32381e-05 1.23626e-05 1.14872e-05 1.06117e-05 9.73629e-06
+ 8.86083e-06 7.98538e-06 7.10993e-06 6.23447e-06 5.44363e-06
+ 5.32578e-06 5.20792e-06 5.09007e-06 4.97222e-06 0.0784323
+ 0.0474527 -0.0764232 -0.151146 0.0615785 0.0144489 0.00974161
+ 0.00947176 0.00849005 0.00728201 0.00630581 0.00554032 0.00487809
+ 0.00441504 0.00384139 -0.118943 -0.149894 -0.161173 -0.0825299
+ 0.171686 0.176912 0.0816085 0.0335236 0.013791 0.0056976
+ 0.00238833 0.00105348 0.000526199 0.00025969 0.000396026
+ 0.000837835 0.00170131 0.00196699 -0.000553314 -0.0061621
+ -0.0111895 -0.0142698 -0.0124608 -0.00795847 -0.00467822
+ -0.0043058 -0.00874449 -0.0118584 -0.00871386 -0.00377892
+ 1.95244e-05 0.00218952 0.00325486 0.00386497 0.00422837
+ 0.00446883 0.00447065 0.00486647 0.00547838 0.00565398 0.00559092
+ 0.00538752 0.00507015 0.00466305 0.00420756 0.00373465 0.00328404
+ 0.00287059 0.00250057 0.00216124 0.00184861 0.00156815 0.00134624
+ 0.00117857 0.00103412 0.0008948 0.000761012 0.000619853
+ 0.000462614 0.000319965 0.000287666 0.000356415 0.000379946
+ 0.000339183 0.00027972 0.000252982 0.000226244 0.000199507
+ 0.000172769 0.000146031 0.000130097 0.000117578 0.000105059
+ 9.25401e-05 8.00213e-05 7.11204e-05 6.67061e-05 6.22918e-05
+ 5.78775e-05 5.34632e-05 4.90489e-05 4.46346e-05 4.02203e-05
+ 3.5806e-05 3.13916e-05 2.69773e-05 2.4827e-05 2.31747e-05
+ 2.15225e-05 1.98702e-05 1.8218e-05 1.65658e-05 1.49135e-05
+ 1.32613e-05 1.1609e-05 9.95678e-06 8.50108e-06 7.86765e-06
+ 7.23422e-06 6.60079e-06 5.96736e-06 5.33393e-06 4.7005e-06
+ 4.06707e-06 3.43363e-06
+ EOD
+
+ @v[10].set(<<-'EOD')
+ 1.86175 1.99308 2.16619 2.46661 3.09359 3.76864 4.31299
+ 4.65564 4.83425 4.92153 4.96157 4.98063 4.98649 4.99039
+ 4.9945 4.9972 4.96206 4.89882 4.83865 4.83202 4.91016 5.04479
+ 5.06078 5.04827 5.03474 5.0246 5.01639 5.00996 5.00569 5.00239
+ 5.00043 5.00296 5.00437 5.00382 5.00287 5.00208 5.00148
+ 5.00104 5.00073 5.0005 5.00034 5.00023 5.00016 5.00011 5.00008
+ 5.00007 5.00007 5.00004 5 4.99998 4.99998 4.99997 4.99998
+ 4.99999 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
+ 5.00001 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5.10081
+ 5.10949 4.98359 5.00733 5.15145 4.37298 2.36126 0.470759
+ 0.0577238 0.0115884 0.00262611 0.000671499 0.000389038 0.000291291
+ 0.000317347 -0.0167823 -0.0158344 -0.0140559 0.0104849 0.0865874
+ 0.107813 0.0524688 0.0214369 0.00876443 0.00341595 0.00170778
+ 0.00259042 0.0022241 0.00118519 1.10217e-06 -0.000784506
+ -0.000948169 -0.000856256 -0.000696719 -0.000485987 -0.000724787
+ -0.000981491 -0.001454 -0.00552498 -0.0114992 -0.0105266
+ -0.00543527 -0.000982798 0.00127356 0.00224212 0.00275439
+ 0.00281098 0.0025471 0.00230368 0.00222576 0.00485522 0.00729453
+ 0.00691796 0.0062615 0.00573987 0.0052688 0.00481185 0.00436934
+ 0.00394326 0.00352712 0.00309978 0.00270038 0.00235335 0.00203742
+ 0.00175256 0.00150067 0.00128126 0.00109323 0.000933619
+ 0.000795113 0.000678182 0.00057843 0.000494345 0.000423609
+ 0.000363821 0.000312766 0.000269856 0.000232389 0.000198382
+ 0.000168126 0.00014267 0.000119293 9.69034e-05 8.5669e-05
+ 8.26828e-05 8.64066e-05 9.26665e-05 8.5454e-05 7.82416e-05
+ 7.10291e-05 6.38167e-05 5.66043e-05 4.93918e-05 4.21794e-05
+ 3.86073e-05 3.53007e-05 3.19941e-05 2.86876e-05 2.5381e-05
+ 2.20744e-05 1.87678e-05 1.70933e-05 1.62648e-05 1.54363e-05
+ 1.46079e-05 1.37794e-05 1.2951e-05 1.21225e-05 1.12941e-05
+ 1.04656e-05 9.63716e-06 8.80871e-06 7.98026e-06 7.1518e-06
+ 6.32335e-06 5.5374e-06 5.08959e-06 4.64178e-06 4.19397e-06
+ 3.74616e-06 0.0438026 0.0242078 -0.0602019 -0.0840866 0.00148461
+ -0.00292489 0.000442098 0.00219489 0.00281478 0.00290756
+ 0.00277945 0.00263896 0.00240099 0.00223283 0.001947 -0.0153629
+ -0.0148815 -0.0128673 0.0126017 0.0905161 0.11051 0.0538958
+ 0.022562 0.00935726 0.00397422 0.00172534 0.000790207 0.000416322
+ 0.000191632 0.000469721 0.0009779 0.00192566 0.00200688
+ -0.0016502 -0.00733932 -0.0128113 -0.0147608 -0.0115456
+ -0.00668995 -0.00401368 -0.00463908 -0.0101197 -0.0118993
+ -0.0076276 -0.00262656 0.000813059 0.00264455 0.00350796
+ 0.00399494 0.0043049 0.00451658 0.00444739 0.00503842 0.00559516
+ 0.00568213 0.00556459 0.0053176 0.00496654 0.00454337 0.00408592
+ 0.00362171 0.00317793 0.00277001 0.00240394 0.00207009 0.00176575
+ 0.00149725 0.00129045 0.00114257 0.00101135 0.000871672
+ 0.000723764 0.000580438 0.000427507 0.000296956 0.000281834
+ 0.000376628 0.000412266 0.000367547 0.000295305 0.000264513
+ 0.000233721 0.000202929 0.000172137 0.000141345 0.000124721
+ 0.000112577 0.000100433 8.82893e-05 7.61453e-05 6.75517e-05
+ 6.33609e-05 5.91701e-05 5.49792e-05 5.07884e-05 4.65976e-05
+ 4.24067e-05 3.82159e-05 3.40251e-05 2.98342e-05 2.56434e-05
+ 2.36401e-05 2.21181e-05 2.05961e-05 1.90741e-05 1.75521e-05
+ 1.60301e-05 1.45081e-05 1.29861e-05 1.14641e-05 9.94208e-06
+ 8.59252e-06 7.96439e-06 7.33626e-06 6.70813e-06 6.07999e-06
+ 5.45186e-06 4.82373e-06 4.1956e-06 3.56747e-06
+ EOD
+
+ @v[11].set(<<-'EOD')
+ 1.86175 1.73419 1.42874 1.04055 0.943004 0.268275 0.0826455
+ 0.0388346 0.0214104 0.0135431 0.00961322 0.00712846 0.00588262
+ 0.00432397 0.00377774 0.00270134 -0.00393731 -0.00542187
+ -0.00126596 0.0113777 0.0134522 0.00477056 -0.00211067 -0.00229253
+ -0.00173355 -0.00122404 -0.00113426 -0.000744931 -0.000520112
+ -0.000410048 -0.000220439 0.000508104 5.15856e-05 -0.000112593
+ -0.000118917 -9.57394e-05 -7.15727e-05 -5.11847e-05 -3.58275e-05
+ -2.47166e-05 -1.68866e-05 -1.14082e-05 -7.66646e-06 -5.12139e-06
+ -3.63426e-06 -3.01815e-06 -2.64862e-06 -1.4947e-06 -1.91403e-07
+ -2.5763e-08 -7.73699e-07 -1.52164e-06 -1.07268e-06 -3.81696e-07
+ 2.6727e-07 4.75489e-07 6.83708e-07 8.91926e-07 1.10014e-06
+ 1.30836e-06 1.2482e-06 1.00726e-06 7.66311e-07 5.25364e-07
+ 2.84417e-07 6.27857e-08 7.43904e-10 -6.12979e-08 -1.2334e-07
+ -1.85382e-07 -2.47423e-07 -3.09465e-07 -3.71507e-07 -4.33549e-07
+ -4.95591e-07 -5.57633e-07 -6.04571e-07 -5.4944e-07 -4.9431e-07
+ -4.3918e-07 -3.84049e-07 -3.28919e-07 -2.73789e-07 -2.18659e-07
+ -1.63528e-07 -1.08398e-07 -5.32678e-08 1.062e-09 5.08502e-08
+ 1.00638e-07 1.50427e-07 2.00215e-07 2.50003e-07 2.99791e-07
+ 3.4958e-07 3.99368e-07 4.49156e-07 4.98944e-07 5.34512e-07
+ 5.01032e-07 4.67553e-07 4.34073e-07 4.00593e-07 3.67113e-07
+ 3.33633e-07 3.00153e-07 2.66674e-07 2.33194e-07 1.99714e-07
+ 1.66234e-07 1.32754e-07 9.92744e-08 6.57945e-08 3.23147e-08
+ -1.16513e-09 -3.4645e-08 -6.81248e-08 -1.01605e-07 -1.35084e-07
+ -1.68564e-07 -2.18729e-07 0.0114926 -0.0245378 -0.111828
+ 0.0964775 1.61491 3.22668 4.22041 4.54492 4.82845 4.94868
+ 4.98588 4.99609 4.9981 4.99908 4.99788 4.98395 4.99294 4.99724
+ 5.01939 5.0471 5.00902 4.98194 4.98496 4.99188 4.99623 4.99862
+ 5.00025 4.99974 4.99953 4.99946 4.99958 5.00012 4.99997
+ 4.99992 4.99988 4.99985 4.9998 4.9997 4.9988 4.99806 4.99982
+ 5.00143 5.00159 5.00098 5.00053 5.00028 5.00007 4.99977
+ 4.99992 5.00005 5.00133 5.0009 4.99993 4.99972 4.99975 4.9998
+ 4.99982 4.99983 4.99983 4.99983 4.99983 4.99984 4.99986
+ 4.99987 4.99989 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995
+ 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99998
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 5 5 5.01457 4.99482 4.96561 4.99326
+ 5.03452 5.00424 5.00101 5.00045 5.00004 4.99965 4.99997
+ 4.99994 4.99958 4.99999 4.99936 4.9839 4.99248 4.99717 5.01976
+ 5.04869 5.0087 4.98143 4.98488 4.99199 4.99622 4.9983 4.99928
+ 4.99971 4.99986 5.00031 5.00022 5.00035 5.0001 4.99884 4.99811
+ 4.99803 4.99887 5.00078 5.00151 5.00116 5.00007 4.99843
+ 4.99915 5.00107 5.00168 5.00141 5.00092 5.00055 5.0003 5.00016
+ 5.0001 5.00001 5.00016 5.0002 5.00009 4.99993 4.99975 4.99984
+ 4.99991 4.99991 4.99982 4.99974 4.99974 4.99985 4.99995
+ 4.99999 4.99998 5.00004 5.00013 5.00015 5.00007 4.99988
+ 4.99982 4.99985 4.99995 5.00006 5.0002 5.00025 5.0002 5.00009
+ 5.00006 5.00004 5.00002 5 4.99998 4.99997 4.99998 4.99998
+ 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
+ 4.99998 4.99998 4.99998
+ EOD
+
+ @v[12].set(<<-'EOD')
+ 5 5.16975 4.78685 2.94241 0.126698 0.0487004 -0.00422591
+ -0.00130689 -0.000486756 -0.000195875 -0.000108988 -6.66736e-05
+ -7.26005e-05 -5.63608e-05 -3.81859e-05 -2.123e-05 -0.0646846
+ -0.0184474 0.182248 1.06731 3.10988 4.46133 4.84133 4.95113
+ 4.98364 4.99455 4.99694 4.99727 4.9994 4.99975 5.0001 5.00132
+ 5.00089 5.00039 5.00019 5.00011 5.00006 5.00005 5.00004
+ 5.00001 4.99992 4.99992 5.00002 5.00013 5.00017 5.00009
+ 4.99992 4.99991 4.99994 4.99996 4.99998 4.99999 5.00001
+ 5.00004 5.00006 5.00005 5.00004 5.00003 5.00002 5.00001
+ 5 4.99999 4.99999 4.99998 4.99998 4.99997 4.99997 4.99998
+ 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999
+ 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 5 5.14699 4.78074
+ 3.19424 0.305663 0.0611255 -0.00179951 -0.0012032 0.000405978
+ 0.000989399 0.000445194 0.000191447 8.30476e-05 3.96236e-05
+ 1.91866e-05 1.70665e-05 -0.0655239 -0.0210234 0.1827 1.06848
+ 3.11554 4.46518 4.84212 4.94853 4.98244 4.99434 4.9997 5.00081
+ 5.00009 4.99972 4.99985 4.99974 4.9995 4.99949 4.99958 4.99973
+ 4.99948 4.99914 4.99874 4.99946 5.00309 5.0091 5.01576 5.01835
+ 5.01852 5.0176 5.01625 5.01479 5.01345 5.01264 5.011 5.01092
+ 5.01344 5.01363 5.01289 5.01184 5.01071 5.00956 5.00848
+ 5.00751 5.00663 5.00577 5.00497 5.00427 5.00365 5.0031 5.00264
+ 5.00224 5.00191 5.00163 5.00138 5.00117 5.00099 5.00083
+ 5.00071 5.00061 5.00053 5.00045 5.00037 5.00029 5.00022
+ 5.00019 5.0002 5.00023 5.00024 5.00023 5.00023 5.00022 5.0002
+ 5.00018 5.00016 5.00014 5.00011 5.00009 5.00007 5.00006
+ 5.00005 5.00005 5.00004 5.00003 5.00002 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5.14298 4.79809 3.32704
+ 0.498385 0.105773 0.0160646 0.0319912 0.0299434 0.0240102
+ 0.0185844 0.0130411 0.0106532 0.00864871 0.00744519 0.00660887
+ -0.0612913 -0.0203719 0.174998 0.991787 3.06292 4.60005
+ 4.93058 4.98917 5.00033 4.9999 4.99909 4.9966 4.9955 4.99488
+ 4.99374 4.9943 5.00131 5.00506 4.99311 4.96288 4.93567 4.92439
+ 4.94236 4.9732 4.98864 4.99458 5.00031 5.00694 5.01525 5.01945
+ 5.01998 5.01953 5.01874 5.01766 5.0164 5.01509 5.01326 5.01423
+ 5.01455 5.01361 5.01245 5.01122 5.01002 5.00888 5.00783
+ 5.00687 5.00596 5.00514 5.00442 5.00379 5.00325 5.00279
+ 5.0024 5.00208 5.0018 5.00153 5.00126 5.00107 5.00094 5.00085
+ 5.00078 5.00072 5.00063 5.00053 5.00042 5.00038 5.00034
+ 5.0003 5.00027 5.00023 5.00021 5.00019 5.00017 5.00015 5.00013
+ 5.00012 5.00011 5.0001 5.0001 5.00009 5.00008 5.00007 5.00007
+ 5.00006 5.00005 5.00005 5.00004 5.00004 5.00003 5.00003
+ 5.00002 5.00002 5.00002 5.00001 5.00001 5 5 5 5.00001 5.00001
+ 5.00001 5.00002 5.00002 5.00002 5.00002
+ EOD
+
+ @v[13].set(<<-'EOD')
+ 9.73784e-10 0.0189926 0.0926769 0.206309 0.111533 0.0953491
+ 0.0426966 0.0214177 0.0117943 0.00741442 0.00528816 0.00398417
+ 0.0032967 0.00266499 0.00206647 0.00158788 -0.0371391 -0.0439528
+ -0.0408653 -0.0188706 0.0150241 0.0126852 0.00209817 -0.000239206
+ -5.31488e-05 0.000876324 -0.00451221 -0.0165223 -0.0284127
+ -0.0427584 -0.0502453 -0.0257366 -0.00903938 -0.00376456
+ -0.00233385 -0.00169922 -0.00130397 -0.00102542 -0.000811435
+ -0.000648115 -0.000529266 -0.00043795 -0.00036574 -0.00030716
+ -0.00026221 -0.000229662 -0.000205112 -0.000181038 -0.000162045
+ -0.000148988 -0.000137633 -0.000126278 -0.000115562 -0.000104976
+ -9.49324e-05 -9.0585e-05 -8.62375e-05 -8.18901e-05 -7.75426e-05
+ -7.31952e-05 -6.93752e-05 -6.59106e-05 -6.24461e-05 -5.89815e-05
+ -5.55169e-05 -5.22412e-05 -5.05263e-05 -4.88114e-05 -4.70966e-05
+ -4.53817e-05 -4.36668e-05 -4.19519e-05 -4.0237e-05 -3.85222e-05
+ -3.68073e-05 -3.50924e-05 -3.34782e-05 -3.25442e-05 -3.16102e-05
+ -3.06763e-05 -2.97423e-05 -2.88083e-05 -2.78744e-05 -2.69404e-05
+ -2.60064e-05 -2.50725e-05 -2.41385e-05 -2.32635e-05 -2.27232e-05
+ -2.21829e-05 -2.16426e-05 -2.11023e-05 -2.0562e-05 -2.00217e-05
+ -1.94814e-05 -1.89411e-05 -1.84007e-05 -1.78604e-05 -1.73647e-05
+ -1.70853e-05 -1.68059e-05 -1.65265e-05 -1.62471e-05 -1.59677e-05
+ -1.56883e-05 -1.54089e-05 -1.51295e-05 -1.48501e-05 -1.45707e-05
+ -1.42913e-05 -1.40119e-05 -1.37325e-05 -1.34531e-05 -1.31737e-05
+ -1.28943e-05 -1.26149e-05 -1.23355e-05 -1.20561e-05 -1.17767e-05
+ -1.14973e-05 -1.10954e-05 0.0152675 0.0228237 -0.00460678
+ -0.0341525 0.0232109 -0.0138039 -0.0416538 -0.0458764 -0.0201967
+ -0.00878316 -0.00379173 -0.00164621 -0.000785131 -0.00037575
+ -0.000352375 -0.0545586 -0.0746881 -0.0771865 -0.05386 -0.0022199
+ 0.0136703 0.00633526 0.00138826 -0.00108934 0.0038886 0.0298077
+ 0.0475776 0.0481003 0.0464167 0.047818 0.042789 0.035207
+ 0.0264423 0.0193959 0.0151614 0.00624257 -0.00913057 -0.0310696
+ -0.0430238 0.016426 0.189762 0.49025 0.820116 1.13919 1.43549
+ 1.70658 1.95183 2.17414 2.38506 2.5657 2.73958 2.97905 3.21403
+ 3.43025 3.62645 3.8028 3.96002 4.09996 4.22443 4.33427 4.42886
+ 4.51097 4.5817 4.64326 4.6957 4.74132 4.7797 4.81298 4.84102
+ 4.86512 4.88523 4.90224 4.91649 4.92846 4.93868 4.94755
+ 4.95483 4.96114 4.96682 4.97161 4.97502 4.9776 4.97944 4.98141
+ 4.98319 4.98467 4.98585 4.9869 4.98796 4.98902 4.99008 4.99114
+ 4.9922 4.99326 4.9938 4.99429 4.99479 4.99528 4.99578 4.99628
+ 4.99677 4.99704 4.99718 4.99733 4.99747 4.99762 4.99777
+ 4.99791 4.99806 4.9982 4.99835 4.9985 4.99864 4.99879 4.99893
+ 4.99907 4.99916 4.99925 4.99934 4.99943 5.01473 4.92293
+ 4.61974 4.0316 3.7835 3.74195 3.78344 3.87272 3.97386 4.07319
+ 4.16686 4.25256 4.33126 4.40264 4.46697 4.49249 4.51807
+ 4.55803 4.64055 4.78574 4.86074 4.88334 4.8999 4.91455 4.92814
+ 4.93926 4.94761 4.95433 4.95907 4.9654 4.98317 5.0208 5.05134
+ 4.85852 4.16041 3.00077 1.68376 0.672707 0.240838 0.0794725
+ -0.0106347 -0.00879443 0.107196 0.368163 0.701424 1.03581
+ 1.3601 1.6678 1.95731 2.22701 2.47544 2.69099 2.92327 3.16648
+ 3.3877 3.59067 3.77344 3.93584 4.08066 4.20863 4.32065 4.41791
+ 4.50211 4.57423 4.63614 4.68888 4.73377 4.7721 4.80519 4.83338
+ 4.85732 4.87815 4.89514 4.90927 4.92108 4.93122 4.94014
+ 4.94845 4.95601 4.96251 4.96576 4.969 4.97225 4.9755 4.97874
+ 4.98087 4.98265 4.98442 4.9862 4.98797 4.98924 4.9899 4.99055
+ 4.9912 4.99186 4.99251 4.99316 4.99381 4.99447 4.99512 4.99577
+ 4.99609 4.99634 4.99659 4.99683 4.99708 4.99732 4.99757
+ 4.99782 4.99806 4.99831 4.99853 4.99863 4.99873 4.99883
+ 4.99893 4.99903 4.99913 4.99923 4.99933
+ EOD
+
+ @v[14].set(<<-'EOD')
+ 1.86175 2.00147 1.85141 1.0654 0.275481 0.205547 0.0712627
+ 0.0313387 0.0151431 0.00864531 0.00593861 0.00438111 0.0037479
+ 0.00305857 0.00221221 0.0017081 -0.0896128 -0.109079 -0.121356
+ -0.0542001 0.175821 0.177442 0.0814591 0.0333042 0.0134909
+ 0.00625777 0.00100092 -0.00552776 -0.00411139 -0.00150395
+ -0.000564784 3.48169e-05 -0.000287014 -0.000538515 -0.000456537
+ -0.000325677 -0.000275468 -0.000166452 -8.27481e-05 -8.28704e-05
+ -7.47644e-05 -4.60552e-05 -2.61481e-06 2.26359e-05 2.53852e-05
+ -1.39853e-06 -4.23456e-05 -4.0907e-05 -2.8501e-05 -1.5945e-05
+ -9.01122e-06 -2.07747e-06 1.49328e-06 4.38398e-06 6.84248e-06
+ 4.76711e-06 2.69173e-06 6.16362e-07 -1.45901e-06 -3.53438e-06
+ -4.14256e-06 -3.76238e-06 -3.3822e-06 -3.00202e-06 -2.62184e-06
+ -2.24878e-06 -1.93456e-06 -1.62033e-06 -1.3061e-06 -9.91867e-07
+ -6.77638e-07 -3.63409e-07 -4.91792e-08 2.6505e-07 5.7928e-07
+ 8.93509e-07 1.16076e-06 1.11055e-06 1.06034e-06 1.01014e-06
+ 9.59927e-07 9.09719e-07 8.59511e-07 8.09302e-07 7.59094e-07
+ 7.08886e-07 6.58678e-07 5.99251e-07 4.87523e-07 3.75795e-07
+ 2.64068e-07 1.5234e-07 4.06119e-08 -7.1116e-08 -1.82844e-07
+ -2.94572e-07 -4.063e-07 -5.18027e-07 -6.08517e-07 -5.95879e-07
+ -5.83241e-07 -5.70604e-07 -5.57966e-07 -5.45328e-07 -5.3269e-07
+ -5.20053e-07 -5.07415e-07 -4.94777e-07 -4.8214e-07 -4.69502e-07
+ -4.56864e-07 -4.44226e-07 -4.31589e-07 -4.18951e-07 -4.06313e-07
+ -3.93676e-07 -3.81038e-07 -3.684e-07 -3.55762e-07 -3.43125e-07
+ 1.06736e-05 0.0797407 0.0437947 -0.0645098 -0.0877312 0.0653203
+ -0.00621184 -0.0353188 -0.0491378 -0.0251957 -0.0110996
+ -0.00481123 -0.0020941 -0.000998038 -0.000478747 -0.000445332
+ -0.102046 -0.135753 -0.154351 -0.0827509 0.163348 0.174012
+ 0.0794822 0.0310624 0.0112213 0.00249061 0.00130764 0.00181315
+ 0.00163875 0.00101454 0.000497435 0.000195258 5.31901e-05
+ 2.4607e-05 6.62736e-05 7.90718e-05 4.0372e-05 -0.000141184
+ -0.000280623 5.5608e-05 0.000799565 0.000920189 0.000931616
+ 0.000494527 0.000162303 -8.24884e-05 -0.000183938 -0.000203899
+ -0.000144788 -9.87063e-05 -0.000227929 2.93932e-05 0.000208563
+ 1.88958e-06 -7.6335e-05 -0.000172472 -0.000165656 -0.000145889
+ -0.000177311 -0.000191058 -0.000168287 -0.00015755 -0.00013142
+ -8.10488e-05 -6.36115e-05 -7.8699e-05 -8.11282e-05 -7.98625e-05
+ -5.98807e-05 -3.40879e-05 -1.95464e-05 -1.79247e-05 -4.45514e-05
+ -7.47995e-05 -8.7682e-05 -7.50806e-05 -3.25561e-05 -4.34114e-05
+ -7.69099e-05 -0.000141101 -0.00018743 -0.000148471 -5.06546e-05
+ 0.000120195 0.000177635 0.000177052 0.000146344 9.75126e-05
+ 8.31233e-05 6.8734e-05 5.43447e-05 3.99554e-05 2.55661e-05
+ 1.11768e-05 -3.21253e-06 -3.88937e-06 -3.56628e-06 -3.24318e-06
+ -2.92008e-06 -2.59699e-06 -2.27389e-06 -1.9508e-06 -1.73227e-06
+ -1.56796e-06 -1.40365e-06 -1.23934e-06 -1.07503e-06 -9.10722e-07
+ -7.46412e-07 -5.82101e-07 -4.1779e-07 -2.5348e-07 -8.91694e-08
+ 7.51412e-08 2.39452e-07 4.03762e-07 5.95733e-07 1.00771e-06
+ 1.41969e-06 1.83167e-06 2.24365e-06 0.0828257 0.231038 0.465438
+ 1.54516 2.8461 3.19221 3.40395 3.6382 3.80758 3.93848 4.04882
+ 4.15428 4.247 4.32917 4.40235 4.36941 4.397 4.48862 4.64552
+ 4.86595 5.03475 5.0348 5.02627 5.01967 5.01542 5.00925 4.98613
+ 4.9519 4.91581 4.87357 4.82302 4.80403 4.82565 4.86102 4.89483
+ 4.92253 4.94428 4.96257 4.97608 4.98373 4.98823 4.99182
+ 4.99437 4.99635 4.99745 4.99802 4.99843 4.99873 4.99895
+ 4.99912 4.99925 4.99931 4.99962 4.99973 4.99972 4.99971
+ 4.9997 4.99969 4.9997 4.99971 4.99973 4.99974 4.99976 4.99978
+ 4.9998 4.99982 4.99985 4.99987 4.99989 4.9999 4.99991 4.99991
+ 4.99993 4.99994 4.99997 5.00001 5.00006 5.00008 5.00006
+ 5.00002 5 4.99999 4.99998 4.99997 4.99995 4.99995 4.99995
+ 4.99995 4.99995 4.99995 4.99995 4.99996 4.99997 4.99997
+ 4.99998 4.99999 5 5 5.00001 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5 5 5 4.99999 4.99999 4.99999
+ EOD
+
+ @v[15].set(<<-'EOD')
+ 1.86175 2.00199 2.08919 1.84314 1.08254 0.214737 0.0377351
+ 0.00952455 0.00232763 0.000563614 0.000263477 0.000148642
+ 0.000285086 0.000242592 7.34699e-05 -1.53467e-05 -0.0161874
+ -0.0157876 -0.0141194 0.0132576 0.0903272 0.109938 0.0535295
+ 0.0224216 0.00940945 0.00466825 -0.000649972 -0.00654752
+ -0.00333248 -0.00103671 -0.000508276 -5.8896e-05 -0.00043938
+ -0.000544704 -0.00044444 -0.000307093 -0.00024517 -0.000154538
+ -8.78602e-05 -7.10461e-05 -6.06485e-05 -3.91039e-05 -8.45988e-06
+ 9.43442e-06 1.28351e-05 -2.16734e-06 -2.6142e-05 -2.54768e-05
+ -1.88997e-05 -1.17906e-05 -7.3808e-06 -2.97101e-06 1.19146e-07
+ 2.94246e-06 5.38942e-06 3.88851e-06 2.38761e-06 8.86704e-07
+ -6.14201e-07 -2.11511e-06 -2.59565e-06 -2.38885e-06 -2.18205e-06
+ -1.97525e-06 -1.76845e-06 -1.56241e-06 -1.36258e-06 -1.16276e-06
+ -9.62939e-07 -7.63116e-07 -5.63293e-07 -3.6347e-07 -1.63647e-07
+ 3.61756e-08 2.35999e-07 4.35822e-07 6.07653e-07 5.90323e-07
+ 5.72994e-07 5.55665e-07 5.38336e-07 5.21007e-07 5.03678e-07
+ 4.86349e-07 4.6902e-07 4.51691e-07 4.34361e-07 4.11899e-07
+ 3.60315e-07 3.08731e-07 2.57146e-07 2.05562e-07 1.53977e-07
+ 1.02393e-07 5.08082e-08 -7.76222e-10 -5.23607e-08 -1.03945e-07
+ -1.47815e-07 -1.54225e-07 -1.60635e-07 -1.67045e-07 -1.73455e-07
+ -1.79864e-07 -1.86274e-07 -1.92684e-07 -1.99094e-07 -2.05504e-07
+ -2.11914e-07 -2.18324e-07 -2.24734e-07 -2.31144e-07 -2.37554e-07
+ -2.43964e-07 -2.50373e-07 -2.56783e-07 -2.63193e-07 -2.69603e-07
+ -2.76013e-07 -2.82423e-07 2.92534e-06 0.0446777 0.024278
+ -0.0518987 -0.0636547 0.00983929 -0.000518204 -0.000265194
+ 0.000154772 0.000299538 3.12715e-05 -3.18225e-05 -2.48268e-05
+ -1.16701e-05 -6.05117e-06 7.61116e-06 -0.0163668 -0.0158244
+ -0.0141177 0.0100085 0.0857144 0.107784 0.051862 0.0204448
+ 0.00629858 0.000967736 0.00121674 0.00190276 0.00154009
+ 0.000860922 0.000410386 0.000164585 3.99493e-05 1.93797e-05
+ 5.67594e-05 0.000110126 2.49925e-05 -7.17815e-05 -0.000142299
+ -1.63109e-05 0.000439529 0.000562489 0.000594599 0.000326164
+ 0.000126423 -4.26063e-05 -0.000122927 -0.000114152 -6.72706e-05
+ -6.41242e-05 -0.000135588 2.61507e-05 0.000134036 6.43734e-06
+ -4.6223e-05 -0.000112047 -0.000101388 -8.67847e-05 -0.000117664
+ -0.000133957 -0.000116558 -0.000100873 -7.65448e-05 -4.44964e-05
+ -3.6677e-05 -5.26632e-05 -5.45172e-05 -5.13545e-05 -3.73869e-05
+ -1.99732e-05 -1.0907e-05 -1.10081e-05 -3.02609e-05 -5.18517e-05
+ -6.13597e-05 -5.30706e-05 -2.39572e-05 -3.24146e-05 -5.70062e-05
+ -0.000103448 -0.000135376 -0.0001024 -2.39007e-05 0.000110929
+ 0.000151226 0.000142044 0.000105922 5.62834e-05 4.78476e-05
+ 3.94117e-05 3.09759e-05 2.25401e-05 1.41042e-05 5.66837e-06
+ -2.76747e-06 -3.08639e-06 -2.81341e-06 -2.54043e-06 -2.26745e-06
+ -1.99447e-06 -1.72149e-06 -1.44851e-06 -1.26226e-06 -1.12096e-06
+ -9.79661e-07 -8.38363e-07 -6.97065e-07 -5.55768e-07 -4.1447e-07
+ -2.73173e-07 -1.31875e-07 9.42259e-09 1.5072e-07 2.92018e-07
+ 4.33315e-07 5.74613e-07 7.10363e-07 8.01984e-07 8.93604e-07
+ 9.85225e-07 1.07685e-06 0.04474 0.0928765 0.141327 0.0176048
+ -0.071675 -0.0124613 0.989022 2.28104 3.40619 4.21417 4.67173
+ 4.87438 4.96044 4.98996 4.99858 4.96672 4.89502 4.79391
+ 4.76433 4.8387 4.98612 5.0161 5.01722 5.01437 5.01256 4.99827
+ 4.95807 4.9209 4.88217 4.83006 4.78461 4.80759 4.85548 4.89604
+ 4.9254 4.94617 4.96126 4.97374 4.98255 4.98792 4.99126 4.99361
+ 4.99554 4.99699 4.99792 4.99846 4.99881 4.99905 4.99924
+ 4.99938 4.99949 4.99955 4.9997 4.9998 4.99982 4.99982 4.99982
+ 4.99982 4.99982 4.99983 4.99984 4.99985 4.99986 4.99987
+ 4.99988 4.99989 4.9999 4.99992 4.99993 4.99994 4.99995 4.99995
+ 4.99996 4.99996 4.99998 4.99999 5.00001 5.00002 5.00002
+ 5.00001 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ EOD
+
+ @v[16].set(<<-'EOD')
+ 1.86175 1.73073 1.50572 1.89001 3.39004 4.36034 4.79012
+ 4.93798 4.98305 4.99539 4.9979 4.99904 4.99772 4.9983 4.99935
+ 4.99975 4.98837 4.99456 4.99728 5.01838 5.04568 5.00759
+ 4.98112 4.98479 4.99197 4.99641 4.99747 4.99775 5.00043
+ 5.0007 5.00035 5.00023 4.99976 5.00002 5.00007 5.0002 4.99993
+ 5.00003 5.00021 5.00006 4.99993 4.99992 5.00002 5.00013
+ 5.00017 5.00009 4.99992 4.99991 4.99993 4.99996 4.99998
+ 4.99999 5.00001 5.00003 5.00005 5.00004 5.00004 5.00003
+ 5.00002 5.00001 5 4.99999 4.99999 4.99998 4.99998 4.99997
+ 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 5 5.01498 4.99342 4.96899 5.00301 5.02627 4.9977
+ 4.99548 4.99757 5.00277 5.00245 5.0014 5.00069 5.00032 5.00014
+ 5.00009 4.9867 4.99262 4.99607 5.01805 5.04713 5.00927 4.98184
+ 4.98483 4.9914 4.99616 4.99902 4.9999 4.99987 4.99979 4.99981
+ 4.99989 4.99994 4.99998 5.0002 5.00001 5.00008 5.00008 5.0001
+ 5.00021 5.00032 5.00025 5.00019 5.00006 5.00007 4.99994
+ 4.99997 4.99999 5.00023 5.00008 4.99993 4.99998 4.99986
+ 4.99982 5.00003 4.99985 4.99996 5.00014 5 4.99984 4.99979
+ 4.99982 4.99993 5.00008 5.00011 5.00002 4.99996 4.9999 4.99994
+ 5.00001 5.00007 5.00009 4.99995 4.99978 4.99971 4.99976
+ 4.99997 4.99996 4.99989 4.99972 4.99955 4.99953 4.99959
+ 4.99976 4.9999 5.00005 5.00023 5.00039 5.00034 5.00029 5.00024
+ 5.00019 5.00014 5.00009 5.00004 5.00003 5.00002 5.00001
+ 5 5 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
+ 5.00001 5.00002 5.00003 5.00004 5.01564 5.03395 5.04932
+ 5.11868 3.92502 1.31888 0.163888 0.0946876 0.0789578 0.0565084
+ 0.0260333 0.0156986 0.00907667 0.00613629 0.00468417 -0.00174008
+ -0.0021422 0.000586962 0.0124937 0.0147977 0.00838454 0.00039383
+ -0.000522021 -0.000426598 -0.000290214 -0.00173713 -0.00384132
+ -0.00382945 -0.00429219 -0.00580193 -0.00393246 0.0017543
+ 0.00423045 0.00408931 0.0031976 0.00245457 0.00187293 0.00159068
+ 0.00105697 0.000609902 0.000358825 0.000334125 0.000212708
+ 0.000168116 8.97349e-05 5.21578e-05 3.84527e-05 2.93033e-05
+ 2.10067e-05 1.59954e-05 1.13917e-05 5.49738e-06 2.77217e-05
+ 6.51259e-06 -6.65468e-06 2.09837e-06 -6.617e-06 -4.80187e-06
+ 1.55031e-06 4.26536e-06 7.69457e-07 -1.46213e-06 -7.25202e-07
+ 3.26501e-06 6.55807e-06 7.524e-06 6.07209e-06 6.00701e-06
+ 5.41166e-06 3.86573e-06 1.10651e-06 -2.74603e-06 -2.18566e-06
+ 2.3658e-06 8.59956e-06 8.35046e-06 2.90621e-06 -8.75982e-07
+ -1.87189e-06 -2.1528e-06 -1.94875e-06 -1.74471e-06 -1.54067e-06
+ -1.33662e-06 -1.13258e-06 -8.40567e-07 -5.20743e-07 -2.00918e-07
+ 1.18906e-07 4.38731e-07 6.11382e-07 6.01529e-07 5.91675e-07
+ 5.81822e-07 5.71968e-07 5.62115e-07 5.52261e-07 5.42407e-07
+ 5.32554e-07 5.227e-07 5.12847e-07 4.72812e-07 4.26137e-07
+ 3.79462e-07 3.32786e-07 2.86111e-07 2.39436e-07 1.92761e-07
+ 1.46086e-07 9.94107e-08 5.27356e-08 -2.77779e-10 -7.98079e-08
+ -1.59338e-07 -2.38868e-07 -3.18398e-07 -3.97928e-07 -4.77458e-07
+ -5.56988e-07 -6.36519e-07
+ EOD
+
+ @v[17].set(<<-'EOD')
+ 5 5.16963 4.84136 3.33754 0.316206 0.103113 0.0273341 0.0221102
+ 0.0177008 0.0143758 0.0115203 0.00929231 0.00752716 0.00625439
+ 0.00489872 0.00403656 -0.0657317 -0.0256467 0.165394 0.985963
+ 3.05067 4.55799 4.89728 4.92464 4.8882 4.90592 4.97315 4.99241
+ 4.99694 4.99845 4.99905 4.99939 4.99959 4.99971 4.9998 4.99986
+ 4.9999 4.99993 4.99995 4.99996 4.99997 4.99998 4.99998 4.99999
+ 4.99999 4.99999 4.99999 4.99999 5 5.00001 5.00003 5.00005
+ 5.00004 5.00002 5 4.99999 4.99999 4.99998 4.99998 4.99997
+ 4.99997 4.99998 4.99998 4.99999 4.99999 5 5 5 5 5 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
+ 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
+ 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5 5 5 5.00025 5.1657 4.69981 2.43895
+ 0.0229743 0.0351406 -0.0211974 -0.0312063 -0.0160331 -0.0021718
+ -0.000766597 -0.000251052 -5.49363e-05 -3.36364e-06 -2.01983e-06
+ -9.70575e-06 -0.0657007 -0.0205247 0.183332 1.07163 3.11839
+ 4.46213 4.84163 4.95195 4.99159 5.02084 5.04029 5.04138
+ 5.0271 5.00445 4.97957 4.95702 4.95231 4.97819 4.99191 4.9963
+ 4.99822 4.99878 4.99903 4.99925 4.99942 4.9995 4.99954 4.99957
+ 4.99961 4.99966 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
+ 4.99988 4.9999 4.99991 4.99992 4.99994 4.99995 4.99995 4.99996
+ 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001 5.00001
+ 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.14239 4.76219
+ 3.16574 0.299969 0.0631609 -0.00118611 -0.00026052 -5.96333e-05
+ -1.44904e-05 -4.3859e-06 -2.99454e-06 1.10547e-06 4.84662e-06
+ 1.30971e-05 2.23082e-05 -0.0655844 -0.0204818 0.182507 1.05954
+ 3.12277 4.46735 4.83915 4.94512 4.97679 4.98654 4.9966 5.00833
+ 5.00776 5.00432 5.00199 5.00086 5.00033 5.00008 5 5.00001
+ 5 5.00005 5.00002 4.99981 4.99991 4.99998 4.99979 4.99979
+ 4.99984 4.9998 4.9998 5.00006 5.00002 5.00001 5 5 4.99992
+ 4.99998 4.99999 5.00002 5.00014 4.99999 4.99987 4.99993
+ 5.00003 5.00011 5.00005 4.99996 4.99987 4.99985 4.99994
+ 5.00009 5.0001 5 4.99993 4.99997 5.00008 5.00015 5.00021
+ 5.00021 5.00007 4.99978 4.99965 4.99973 4.9999 4.99992 4.99995
+ 4.99997 4.99999 5.00001 5.00002 5.00001 5.00001 5.00001
+ 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001 5.00001 5.00002
+ 5.00002 5.00002
+ EOD
+
+ @v[18].set(<<-'EOD')
+ 5 5.0333 5.02472 4.92559 4.18383 3.93923 3.9961 4.14293
+ 4.28591 4.41336 4.52157 4.61101 4.68472 4.7439 4.79294 4.83239
+ 4.80697 4.78808 4.79322 4.8838 5.08529 5.21863 4.88852 3.90198
+ 2.14586 0.383977 0.101103 0.0525711 0.0318287 0.020895 0.0146908
+ 0.010831 0.00830272 0.00656377 0.00532066 0.00440078 0.00369956
+ 0.00315713 0.00272614 0.00237965 0.00209659 0.00186339 0.00167014
+ 0.0015081 0.00137172 0.00125607 0.00115393 0.00106076 0.000980166
+ 0.000918015 0.000862837 0.00080766 0.000763488 0.000721541
+ 0.000680825 0.000653026 0.000625226 0.000597426 0.000569627
+ 0.000541827 0.000519087 0.000499756 0.000480424 0.000461093
+ 0.000441761 0.000423291 0.000411941 0.00040059 0.00038924
+ 0.000377889 0.000366539 0.000355188 0.000343838 0.000332487
+ 0.000321137 0.000309786 0.000299055 0.000292509 0.000285963
+ 0.000279417 0.000272871 0.000266325 0.000259779 0.000253233
+ 0.000246686 0.00024014 0.000233594 0.000227387 0.0002231
+ 0.000218813 0.000214526 0.00021024 0.000205953 0.000201666
+ 0.000197379 0.000193092 0.000188805 0.000184519 0.000180526
+ 0.000177963 0.0001754 0.000172837 0.000170274 0.000167711
+ 0.000165148 0.000162585 0.000160022 0.000157459 0.000154895
+ 0.000152332 0.000149769 0.000147206 0.000144643 0.00014208
+ 0.000139517 0.000136954 0.000134391 0.000131828 0.000129265
+ 0.000126702 0.000132838 0.0311184 0.163151 0.34986 0.604501
+ 0.357125 0.136137 0.0711304 0.0346959 0.0212674 0.00872193
+ 0.00252206 0.000455269 7.59332e-05 2.91532e-05 0.000320562
+ -0.0720911 -0.0840491 -0.0791345 -0.0404143 0.0182035 -0.0235871
+ -0.0426072 -0.0597501 0.00824773 0.481404 1.32496 2.11949
+ 2.57317 2.58202 2.15054 1.33786 0.45702 0.153772 0.0913584
+ 0.0604989 0.0421591 0.0271456 0.0170021 0.0115815 0.00907886
+ 0.00742466 0.00626096 0.00531127 0.00450501 0.00381927 0.00323718
+ 0.00274374 0.00232494 0.00196885 0.00166686 0.00141134 0.00119437
+ 0.0010109 0.000855534 0.000723378 0.000611408 0.000516704
+ 0.000436769 0.000369523 0.000313026 0.00026526 0.000223976
+ 0.000188972 0.000159042 0.000134148 0.000112688 9.49738e-05
+ 7.97877e-05 6.721e-05 5.65115e-05 4.77194e-05 4.03591e-05
+ 3.42848e-05 2.92627e-05 2.50435e-05 2.1412e-05 1.84532e-05
+ 1.58624e-05 1.34673e-05 1.14461e-05 1.00935e-05 9.12375e-06
+ 8.50202e-06 7.81431e-06 7.20729e-06 6.73936e-06 6.3702e-06
+ 5.90049e-06 5.43077e-06 4.96105e-06 4.49133e-06 4.02162e-06
+ 3.5519e-06 3.08218e-06 2.79099e-06 2.51281e-06 2.23463e-06
+ 1.95645e-06 1.67827e-06 1.40009e-06 1.12191e-06 1.01376e-06
+ 9.9375e-07 9.73741e-07 9.53733e-07 9.33724e-07 9.13715e-07
+ 8.93707e-07 8.73698e-07 8.5369e-07 8.33681e-07 8.13673e-07
+ 7.93664e-07 7.73655e-07 7.53647e-07 7.21781e-07 5.956e-07
+ 4.69419e-07 3.43239e-07 2.17058e-07 0.0284032 0.0374438
+ -0.0157543 -0.0680497 0.0504768 0.0100294 0.00222261 0.000528697
+ 0.000132929 3.99489e-05 2.46066e-05 4.56327e-06 -6.54853e-06
+ 1.33783e-05 -3.68221e-05 -0.0724498 -0.0843663 -0.0792935
+ -0.0406426 0.0200019 0.0426259 0.0220753 0.00668555 -0.000968483
+ 0.024662 0.0383437 0.0911513 0.087848 0.0602076 0.0390559
+ 0.0260573 0.0180444 0.012974 0.00985409 0.00788132 0.0064228
+ 0.005545 0.00453571 0.00364245 0.00310278 0.00270523 0.00236439
+ 0.0020945 0.00186808 0.00167493 0.00151731 0.00138594 0.00126945
+ 0.00116695 0.0010762 0.000996366 0.000928387 0.000864414
+ 0.000808258 0.000759574 0.000713865 0.000666712 0.000632716
+ 0.000601262 0.000572163 0.000543986 0.000515253 0.0004897
+ 0.000468112 0.000449313 0.000432981 0.000417911 0.000401307
+ 0.000382712 0.000366678 0.000355736 0.000349171 0.000335727
+ 0.000317091 0.000296086 0.000283543 0.000277366 0.000272233
+ 0.000267001 0.000263147 0.000256699 0.000250251 0.000243803
+ 0.000237355 0.000230907 0.000225424 0.000220247 0.000215069
+ 0.000209892 0.000204714 0.000200213 0.000196548 0.000192884
+ 0.00018922 0.000185556 0.000181892 0.000178228 0.000174564
+ 0.0001709 0.000167236 0.000163572 0.000160824 0.000158279
+ 0.000155733 0.000153187 0.000150641 0.000148095 0.000145549
+ 0.000143003 0.000140457 0.000137911 0.000135457 0.000133386
+ 0.000131315 0.000129245 0.000127174 0.000125103 0.000123032
+ 0.000120961 0.000118891
+ EOD
+
+ @v[19].set(<<-'EOD')
+ 1.86175 1.99994 2.0833 2.01627 2.42503 3.25769 3.62134 3.88827
+ 4.09688 4.26773 4.40529 4.51734 4.60827 4.68313 4.74346
+ 4.79302 4.72815 4.68959 4.70421 4.81316 5.01375 5.14493
+ 5.10305 5.0699 5.04484 5.03751 5.03348 5.02504 5.01799 5.01271
+ 5.00895 5.00628 5.0044 5.00309 5.00216 5.00151 5.00105 5.00073
+ 5.00051 5.00034 5.00023 5.00015 5.0001 5.00007 5.00003 4.99998
+ 4.99993 4.99993 4.99995 4.99999 5.00001 5.00003 5.00002
+ 5.00001 5 5 5 5 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00017 5.17398
+ 4.94779 3.78508 1.52302 0.608808 0.244311 0.126053 0.0597175
+ 0.038422 0.0158174 0.00481338 0.00107847 0.000301256 0.000114861
+ 0.00059489 -0.118904 -0.147478 -0.158986 -0.080544 0.165361
+ 0.171378 0.0776087 0.0435738 0.0428235 0.0423755 0.0347695
+ 0.0225061 0.0155539 0.0121357 0.0107997 0.0103976 0.0124406
+ 0.016814 0.0167556 0.0149852 0.01459 0.0141182 0.0131934
+ 0.0120286 0.0108692 0.0097184 0.00855881 0.00744912 0.00643877
+ 0.00554044 0.00475165 0.00406535 0.00347158 0.00295981 0.00251995
+ 0.00214318 0.00182101 0.00154613 0.00131196 0.0011119 0.000941587
+ 0.000796999 0.000674582 0.000571283 0.000484276 0.000410649
+ 0.000347005 0.000292984 0.000246715 0.000208143 0.00017489
+ 0.000147412 0.000123854 0.000104332 8.77229e-05 7.40686e-05
+ 6.2637e-05 5.32e-05 4.53946e-05 3.88343e-05 3.31864e-05
+ 2.85905e-05 2.45725e-05 2.08671e-05 1.77301e-05 1.55911e-05
+ 1.40153e-05 1.29421e-05 1.18693e-05 1.09815e-05 1.03484e-05
+ 9.87664e-06 9.14446e-06 8.41228e-06 7.68011e-06 6.94793e-06
+ 6.21575e-06 5.48357e-06 4.7514e-06 4.38454e-06 4.04432e-06
+ 3.7041e-06 3.36388e-06 3.02366e-06 2.68344e-06 2.34322e-06
+ 2.15196e-06 2.03791e-06 1.92386e-06 1.80982e-06 1.69577e-06
+ 1.58173e-06 1.46768e-06 1.35363e-06 1.23959e-06 1.12554e-06
+ 1.0115e-06 8.9745e-07 7.83404e-07 6.69358e-07 4.76113e-07
+ -3.47071e-07 -1.17025e-06 -1.99344e-06 -2.81662e-06 0.0783754
+ 0.0500262 -0.0659563 -0.120914 0.0815957 0.0154255 0.00347177
+ 0.000840357 0.000214582 6.54655e-05 3.91709e-05 8.07396e-06
+ -4.44265e-07 1.74384e-05 -4.52725e-05 -0.119379 -0.147984
+ -0.159247 -0.0824604 0.169014 0.177628 0.0758742 0.010558
+ -0.0346506 -0.0710288 -0.0838952 -0.0599521 -0.034568 -0.0181615
+ -0.00968034 -0.00547115 -0.00333511 -0.00232468 -0.00181159
+ -0.00143841 -0.00116601 -0.000839755 -0.000569764 -0.000578683
+ -0.000490551 -0.000411712 -0.000437859 -0.000408185 -0.000356644
+ -0.000311332 -0.000269006 -0.000221396 -0.000210054 -0.0001923
+ -0.000175122 -0.000161039 -0.0001428 -0.000126123 -0.000127893
+ -8.14516e-05 -0.000120166 -0.000154909 -0.000112733 -8.40377e-05
+ -7.11342e-05 -8.09538e-05 -9.77789e-05 -9.82402e-05 -7.73531e-05
+ -5.28255e-05 -3.1096e-05 -1.87967e-05 -1.96552e-05 -4.16655e-05
+ -5.77185e-05 -5.24142e-05 -2.83153e-05 -1.90012e-05 -1.54415e-05
+ -2.52569e-05 -6.23747e-05 -0.000130543 -0.000149394 -0.000110886
+ -4.35517e-05 -4.17084e-05 -3.98651e-05 -3.80218e-05 -3.61785e-05
+ -3.43352e-05 -3.36249e-05 -3.32729e-05 -3.29208e-05 -3.25687e-05
+ -3.22166e-05 -3.17143e-05 -3.10258e-05 -3.03372e-05 -2.96486e-05
+ -2.89601e-05 -2.82715e-05 -2.75829e-05 -2.68944e-05 -2.62058e-05
+ -2.55173e-05 -2.48287e-05 -2.43043e-05 -2.38159e-05 -2.33276e-05
+ -2.28393e-05 -2.2351e-05 -2.18626e-05 -2.13743e-05 -2.0886e-05
+ -2.03977e-05 -1.99093e-05 -1.945e-05 -1.91122e-05 -1.87744e-05
+ -1.84366e-05 -1.80987e-05 -1.77609e-05 -1.74231e-05 -1.70853e-05
+ -1.67474e-05
+ EOD
+
+ @v[20].set(<<-'EOD')
+ 1.86175 1.99724 2.17266 2.48439 3.15933 3.85231 4.38091
+ 4.69033 4.85034 4.92851 4.96453 4.98188 4.98736 4.991 4.99482
+ 4.9973 4.96422 4.89989 4.83907 4.83151 4.90868 5.04854 5.06104
+ 5.04571 5.03219 5.03025 5.02273 5.01707 5.0123 5.0087 5.00611
+ 5.00429 5.00301 5.00211 5.00148 5.00103 5.00072 5.0005 5.00035
+ 5.00024 5.00016 5.00011 5.00007 5.00005 5.00003 5.00001
+ 4.99999 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
+ 5 5 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
+ 5 5 4.99981 5.10081 5.10903 4.98404 5.00999 5.14946 4.36501
+ 2.23938 0.325144 0.00660272 -0.0102186 -0.0082401 -0.00556785
+ -0.00374178 -0.00264763 -0.00202823 -0.0182241 -0.0169551
+ -0.0150395 0.0103736 0.0877592 0.104382 0.0515938 0.0373818
+ 0.0411547 0.0397009 0.0308946 0.0205793 0.0154037 0.0129191
+ 0.0119327 0.011527 0.0124295 0.0161152 0.0161076 0.0145391
+ 0.0144541 0.0139287 0.0129215 0.0117239 0.0105795 0.00942983
+ 0.00827423 0.00718354 0.00619954 0.00532868 0.00456631 0.00390448
+ 0.00333254 0.00284003 0.00241714 0.00205524 0.0017458 0.00148202
+ 0.00125739 0.0010655 0.000902213 0.000763611 0.000646279
+ 0.000547291 0.000463934 0.000393401 0.000332424 0.000280655
+ 0.000236328 0.000199386 0.000167536 0.000141218 0.000118654
+ 9.99559e-05 8.40479e-05 7.09694e-05 6.00188e-05 5.09786e-05
+ 4.3502e-05 3.72191e-05 3.18114e-05 2.74071e-05 2.35539e-05
+ 1.99967e-05 1.69871e-05 1.49449e-05 1.3451e-05 1.24492e-05
+ 1.14256e-05 1.05669e-05 9.94487e-06 9.47514e-06 8.77318e-06
+ 8.07123e-06 7.36927e-06 6.66731e-06 5.96536e-06 5.2634e-06
+ 4.56144e-06 4.23044e-06 3.92649e-06 3.62254e-06 3.31858e-06
+ 3.01463e-06 2.71068e-06 2.40673e-06 2.23063e-06 2.12082e-06
+ 2.01102e-06 1.90121e-06 1.7914e-06 1.68159e-06 1.57178e-06
+ 1.46197e-06 1.35216e-06 1.24235e-06 1.13255e-06 1.02274e-06
+ 9.12929e-07 8.0312e-07 6.33171e-07 -1.51288e-08 -6.63428e-07
+ -1.31173e-06 -1.96003e-06 0.0437517 0.0265689 -0.0515377
+ -0.0658688 0.010727 -0.000511921 -8.36924e-05 2.13278e-05
+ 1.45207e-05 4.54862e-06 -6.14726e-06 2.0062e-06 1.02709e-06
+ 1.4152e-05 -3.08225e-05 -0.0166501 -0.0157139 -0.013957
+ 0.0107537 0.0873717 0.111302 0.0454129 -0.00530142 -0.0468336
+ -0.0790063 -0.0826944 -0.0534753 -0.0288705 -0.0149009 -0.00801592
+ -0.0046342 -0.00291835 -0.00213019 -0.00170055 -0.001352
+ -0.00110593 -0.000742655 -0.000532042 -0.000544742 -0.000479206
+ -0.000407307 -0.000403575 -0.000366209 -0.000324161 -0.000286183
+ -0.000247579 -0.000214281 -0.000203435 -0.000186896 -0.000171033
+ -0.00015779 -0.000145259 -0.000128069 -0.000122647 -9.89398e-05
+ -0.000114926 -0.000132195 -0.000107872 -8.91015e-05 -7.87996e-05
+ -8.14061e-05 -8.9098e-05 -8.83368e-05 -7.6122e-05 -6.14668e-05
+ -4.75402e-05 -3.81855e-05 -3.69696e-05 -4.78656e-05 -5.61346e-05
+ -5.35007e-05 -4.1459e-05 -3.35411e-05 -2.52374e-05 -2.37479e-05
+ -4.6406e-05 -9.41884e-05 -0.000109222 -8.52676e-05 -4.25166e-05
+ -4.10125e-05 -3.95085e-05 -3.80045e-05 -3.65004e-05 -3.49964e-05
+ -3.41627e-05 -3.3541e-05 -3.29193e-05 -3.22976e-05 -3.16758e-05
+ -3.10334e-05 -3.03653e-05 -2.96971e-05 -2.9029e-05 -2.83609e-05
+ -2.76928e-05 -2.70246e-05 -2.63565e-05 -2.56884e-05 -2.50203e-05
+ -2.43521e-05 -2.38716e-05 -2.34324e-05 -2.29932e-05 -2.25539e-05
+ -2.21147e-05 -2.16755e-05 -2.12362e-05 -2.0797e-05 -2.03578e-05
+ -1.99186e-05 -1.95079e-05 -1.9217e-05 -1.8926e-05 -1.8635e-05
+ -1.8344e-05 -1.8053e-05 -1.7762e-05 -1.74711e-05 -1.71801e-05
+ EOD
+
+ @v[21].set(<<-'EOD')
+ 1.86175 1.73273 1.42016 1.02483 0.944013 0.274107 0.0823742
+ 0.0379366 0.020816 0.0132952 0.00955525 0.00717008 0.00592286
+ 0.00437379 0.00383557 0.00273694 -0.0037467 -0.0054191 -0.00131454
+ 0.0112179 0.0133918 0.00519747 -0.00260113 -0.00252847 -0.00181292
+ 0.000183398 -0.000667607 -0.000750747 -0.000594314 -0.000433904
+ -0.000308985 -0.000217858 -0.000152926 -0.000107454 -7.54076e-05
+ -5.2675e-05 -3.66299e-05 -2.54341e-05 -1.75095e-05 -1.18848e-05
+ -7.97289e-06 -5.30239e-06 -3.53615e-06 -2.38504e-06 -2.40158e-06
+ -3.84485e-06 -5.29435e-06 -2.57099e-06 1.95189e-06 3.55083e-06
+ 2.06179e-06 5.72753e-07 3.30469e-07 3.40296e-07 3.60221e-07
+ 4.86081e-07 6.1194e-07 7.37799e-07 8.63659e-07 9.89518e-07
+ 9.21274e-07 7.22275e-07 5.23276e-07 3.24277e-07 1.25278e-07
+ -5.59467e-08 -9.03265e-08 -1.24706e-07 -1.59086e-07 -1.93466e-07
+ -2.27846e-07 -2.62226e-07 -2.96605e-07 -3.30985e-07 -3.65365e-07
+ -3.99745e-07 -4.24266e-07 -3.82163e-07 -3.40061e-07 -2.97959e-07
+ -2.55857e-07 -2.13755e-07 -1.71652e-07 -1.2955e-07 -8.7448e-08
+ -4.53457e-08 -3.24353e-09 3.76901e-08 7.19937e-08 1.06297e-07
+ 1.40601e-07 1.74904e-07 2.09208e-07 2.43512e-07 2.77815e-07
+ 3.12119e-07 3.46422e-07 3.80726e-07 4.04507e-07 3.77191e-07
+ 3.49876e-07 3.22561e-07 2.95246e-07 2.67931e-07 2.40616e-07
+ 2.13301e-07 1.85986e-07 1.58671e-07 1.31356e-07 1.04041e-07
+ 7.67256e-08 4.94105e-08 2.20955e-08 -5.21962e-09 -3.25347e-08
+ -5.98498e-08 -8.71649e-08 -1.1448e-07 -1.41795e-07 -1.6911e-07
+ 7.87893e-06 0.0114592 -0.0245712 -0.111637 0.0961324 1.61168
+ 3.22343 4.20442 4.53535 4.83834 4.95464 4.98874 4.99746
+ 4.99883 4.99948 4.99815 4.98431 4.99298 4.99718 5.01948
+ 5.04749 5.008 4.98243 4.98985 4.99781 4.99887 4.99679 4.99616
+ 4.99743 4.99859 4.99936 4.99972 5.00058 5.00123 5.0002 4.99945
+ 4.99983 4.9998 4.99966 4.99958 4.99956 4.99956 4.99956 4.99958
+ 4.99961 4.99965 4.99969 4.99973 4.99977 4.9998 4.99983 4.99985
+ 4.99987 4.99989 4.99991 4.99992 4.99993 4.99994 4.99995
+ 4.99996 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00001 5.00001
+ 5.00001 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5 5 5 4.99999 4.99998 4.99997 4.99996 5.01454
+ 4.99566 4.96796 4.99819 5.03232 5.00034 4.99867 4.99937
+ 4.99977 4.99992 4.99997 4.99999 5.00001 5.00021 4.99974
+ 4.98462 4.99301 4.99723 5.01936 5.04807 5.00929 4.9789 4.97876
+ 4.98244 4.9863 4.99575 5.0069 5.00863 5.00624 5.00357 5.0019
+ 5.00098 5.00048 5.00025 5.00016 5.00011 5.00013 5.00009
+ 4.99982 4.99994 5.00005 4.99994 4.99988 4.99989 4.99997
+ 5.00003 5.00005 5.00002 5.00001 5.00001 5.00001 4.99993
+ 4.99999 5 5.00021 4.99997 4.99981 5 5.00009 5.0001 5.00001
+ 4.99991 4.9999 5 5.00011 5.00017 5.00018 5.00018 5.00014
+ 5.00007 4.99999 4.9999 4.9999 5.00001 5.00016 5.00014 4.99999
+ 4.99993 4.99999 5.00009 5.00007 5.00006 5.00004 5.00003
+ 5.00001 5.00001 5 4.99999 4.99998 4.99997 4.99997 4.99997
+ 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
+ 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5 5
+ EOD
+
+ @v[22].set(<<-'EOD')
+ 7.10441e-10 0.00107105 0.000637109 -0.00236346 -0.018079
+ -0.0120077 -0.00217059 0.00266679 0.00403383 0.00403836
+ 0.00356705 0.00303303 0.00244716 0.00198586 0.0016855 0.00136497
+ -3.96022e-05 -0.000367409 -3.77079e-05 0.00194085 0.00506964
+ -0.0400214 -0.0402572 0.0524434 0.286234 0.803011 1.44795
+ 2.02473 2.54768 3.02748 3.4415 3.78287 4.09667 4.35152 4.53987
+ 4.67614 4.77407 4.84319 4.89227 4.92702 4.95119 4.96764
+ 4.97846 4.98557 4.98982 4.99209 4.99371 4.99569 4.99727
+ 4.99802 4.99834 4.99867 4.99892 4.99915 4.99936 4.99939
+ 4.99943 4.99946 4.9995 4.99953 4.99957 4.9996 4.99963 4.99967
+ 4.9997 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978 4.9998
+ 4.99981 4.99982 4.99983 4.99984 4.99985 4.99986 4.99986
+ 4.99986 4.99987 4.99987 4.99988 4.99988 4.99989 4.99989
+ 4.9999 4.9999 4.9999 4.9999 4.99991 4.99991 4.99991 4.99991
+ 4.99992 4.99992 4.99992 4.99992 4.99993 4.99993 4.99993
+ 4.99993 4.99993 4.99993 4.99993 4.99993 4.99994 4.99994
+ 4.99994 4.99994 4.99994 4.99994 4.99994 4.99994 4.99995
+ 4.99995 4.99995 4.99995 4.99995 4.99995 4.99995 5.00145
+ 5.00659 5.01209 5.01931 5.00279 4.99273 4.99217 4.99295
+ 4.99471 4.99594 4.99696 4.9978 4.99844 4.99891 4.99924 4.99635
+ 4.99699 4.99813 5.00068 5.00307 5.0588 4.96365 4.54012 3.6307
+ 2.35176 1.0322 0.354379 0.115986 0.0435668 0.0245112 0.020786
+ 0.0164656 0.0118409 0.00849698 0.00597078 0.0040105 0.0026076
+ 0.0016597 0.00118185 0.00121067 0.00153587 0.00174836 0.00136519
+ -0.000189116 -0.00315555 -0.00646603 -0.00898042 -0.010203
+ -0.0110896 -0.0123764 -0.00953841 -0.00225795 0.000818314
+ 0.00152252 0.00150269 0.00119025 0.000767068 0.000308852
+ -3.79272e-05 -0.00019691 -0.000186642 -9.73653e-05 -8.49784e-06
+ 2.04147e-05 -9.91086e-06 -1.55959e-05 -1.80499e-05 -1.77097e-05
+ -1.51548e-05 -1.1978e-05 -9.84916e-06 -1.29728e-05 -1.67235e-05
+ -1.74153e-05 -1.39958e-05 -5.92272e-06 -8.08216e-06 -1.53077e-05
+ -2.92531e-05 -3.91049e-05 -2.98935e-05 -7.32122e-06 3.18534e-05
+ 4.39134e-05 4.18753e-05 3.22759e-05 1.86766e-05 1.58432e-05
+ 1.30098e-05 1.01765e-05 7.34312e-06 4.50975e-06 1.67639e-06
+ -1.15697e-06 -1.23877e-06 -1.11991e-06 -1.00106e-06 -8.82208e-07
+ -7.63355e-07 -6.44502e-07 -5.2565e-07 -4.29318e-07 -3.44661e-07
+ -2.60004e-07 -1.75347e-07 -9.06904e-08 -6.03349e-09 7.86234e-08
+ 1.6328e-07 2.47937e-07 3.32594e-07 4.17251e-07 5.01908e-07
+ 5.86565e-07 6.71222e-07 7.36123e-07 6.43886e-07 5.5165e-07
+ 4.59414e-07 3.67178e-07 0.000334759 -4.60833e-05 -0.00106139
+ -0.00166624 0.000859563 0.00102606 0.00410037 0.00419931
+ 0.00518997 0.00459791 0.00503125 0.00523877 0.00452158 0.00339924
+ 0.00233399 0.000876915 0.000546439 0.000444299 0.000983968
+ 0.00119304 -0.0429422 -0.0403983 0.0534896 0.288013 0.807345
+ 1.44247 2.03448 2.57021 3.05049 3.47332 3.8131 4.1009 4.34677
+ 4.53512 4.67127 4.76531 4.82526 4.86593 4.89586 4.91904
+ 4.93806 4.95348 4.96597 4.97629 4.9843 4.98983 4.99335 4.9957
+ 4.99741 4.99864 4.99946 4.99994 5.00047 5.00073 5.00086
+ 5.00092 5.00094 5.00091 5.00087 5.00081 5.00074 5.00067
+ 5.00059 5.00052 5.00046 5.0004 5.00034 5.0003 5.00026 5.00022
+ 5.00019 5.00016 5.00014 5.00012 5.0001 5.00009 5.00007 5.00006
+ 5.00006 5.00005 5.00004 5.00004 5.00004 5.00003 5.00003
+ 5.00003 5.00002 5.00002 5.00002 5.00002 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5.00001 5.00001
+ 5.00001 5.00001 5.00002 5.00002
+ EOD
+
+ @v[23].set(<<-'EOD')
+ 5 5.00284 5.01266 5.01895 4.98936 4.99575 4.99217 4.99545
+ 4.99775 4.99894 4.99946 4.99968 4.99975 4.99977 4.99986
+ 4.9999 4.99528 4.99808 5.00039 5.00392 5.00512 4.99985 4.99863
+ 4.99942 4.99992 5.00017 4.99897 4.99803 4.99784 4.99739
+ 4.99883 5.00365 5.00298 5.00133 5.00048 5.00019 5.00008
+ 5.00005 5.00004 5.00003 5.00002 5.00002 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5 5 4.99999 4.99997 4.99995 4.99996
+ 4.99998 5 5.00001 5.00001 5.00002 5.00002 5.00003 5.00003
+ 5.00002 5.00002 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99998 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00002
+ 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5 5 5 5 5 5 5 5.00217 5.00108 4.99547 4.99658 5.00667
+ 4.99641 4.99532 4.99938 5.00328 5.00222 5.00114 5.00052
+ 5.00024 5.00011 5.00009 4.99285 4.99591 4.99897 5.00403
+ 5.00786 5.00318 4.99942 4.9992 4.99949 5.001 5.00408 5.00319
+ 5.00063 4.99995 5.00014 4.99982 4.99832 4.99838 4.99865
+ 4.99912 4.99836 4.99735 4.99606 4.99814 5.00958 5.02973
+ 5.05293 5.06103 4.99342 4.80726 4.50744 4.07509 3.41358
+ 2.37924 1.03194 0.261552 0.142392 0.0904482 0.0555071 0.0322869
+ 0.018289 0.0113802 0.00875182 0.00757055 0.00629906 0.00523
+ 0.00403349 0.0031953 0.00280864 0.00286119 0.00250389 0.00202815
+ 0.001723 0.00147312 0.0012411 0.00104401 0.000886204 0.000758277
+ 0.000651915 0.00056348 0.000487966 0.000424048 0.000365613
+ 0.000308178 0.000258725 0.000228061 0.000207976 0.000198491
+ 0.00018518 0.000172716 0.000163197 0.000155007 0.000141734
+ 0.000128461 0.000115188 0.000101915 8.86417e-05 7.53686e-05
+ 6.20956e-05 5.69164e-05 5.23275e-05 4.77385e-05 4.31495e-05
+ 3.85605e-05 3.39716e-05 2.93826e-05 2.69449e-05 2.56224e-05
+ 2.42999e-05 2.29774e-05 2.16549e-05 2.03324e-05 1.90099e-05
+ 1.76873e-05 1.63648e-05 1.50423e-05 1.37198e-05 1.23973e-05
+ 1.10748e-05 9.75232e-06 8.48447e-06 7.65129e-06 6.81811e-06
+ 5.98494e-06 5.15176e-06 0.00056893 -0.00787906 -0.0217381
+ -0.0370066 -0.00770505 0.00659312 0.00975477 0.00949456
+ 0.00777552 0.00655645 0.00568776 0.00508782 0.00458121 0.00410187
+ 0.00365665 0.0015121 0.00160863 0.00263181 0.00638941 0.00772607
+ 0.00225583 0.0010843 0.000882939 0.000801563 0.00075632
+ 0.000554992 0.000435131 0.0003474 0.000217667 0.000491602
+ 0.0012267 0.00250446 0.000212058 -0.0174972 -0.0527527 -0.0479071
+ 0.194908 1.45838 3.40677 4.49242 4.86894 4.97215 5.01218
+ 5.04342 5.06228 5.03069 4.87169 4.57056 4.11523 3.38264
+ 2.19691 0.715839 0.172818 0.102162 0.0627162 0.0363388 0.020289
+ 0.0119414 0.00826608 0.0066417 0.00549092 0.00492505 0.00439443
+ 0.0037156 0.00306471 0.00247451 0.00195965 0.0014822 0.0010815
+ 0.000904464 0.0010514 0.00152308 0.00120752 0.000228447
+ -0.00102833 -0.00116644 -0.00042067 4.78758e-05 5.09599e-05
+ -4.45756e-05 -3.22966e-06 3.81163e-05 7.94622e-05 0.000120808
+ 0.000162154 0.000161895 0.000148481 0.000135068 0.000121654
+ 0.000108241 9.81453e-05 9.2164e-05 8.61827e-05 8.02014e-05
+ 7.42201e-05 6.82388e-05 6.22576e-05 5.62763e-05 5.0295e-05
+ 4.43137e-05 3.83324e-05 3.54323e-05 3.321e-05 3.09877e-05
+ 2.87654e-05 2.65431e-05 2.43209e-05 2.20986e-05 1.98763e-05
+ 1.7654e-05 1.54317e-05 1.34612e-05 1.25441e-05 1.1627e-05
+ 1.07099e-05 9.79276e-06 8.87564e-06 7.95851e-06 7.04139e-06
+ 6.12427e-06
+ EOD
+
+ @v[24].set(<<-'EOD')
+ 5 5.01099 5.00866 4.97845 4.92369 4.9273 4.97413 4.9929
+ 4.99826 4.99958 4.99978 5.00005 4.99968 4.99959 5.00014
+ 4.99979 4.99914 4.99982 5.00023 5.00295 5.00664 4.99854
+ 4.99647 5.00438 5.01722 5.03681 5.04766 5.04799 5.04867
+ 5.04873 5.04685 5.04413 5.0367 5.02505 5.01726 5.01183 5.00806
+ 5.00549 5.00371 5.00246 5.00162 5.00105 5.00069 5.00045
+ 5.00031 5.00024 5.00019 5.00012 5.00007 5.00004 5.00001
+ 4.99998 4.99999 4.99999 5 5.00001 5.00001 5.00002 5.00002
+ 5.00003 5.00003 5.00003 5.00002 5.00002 5.00001 5.00001
+ 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 5 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5.00418 4.99953 4.99152
+ 4.99807 5.00497 5.00112 5.00055 5.00038 5.00018 5.00006
+ 5.00006 5.00007 5.00006 5.00004 5.00004 4.99853 4.99945
+ 4.99998 5.00304 5.00935 5.00742 4.99181 4.97421 4.93603
+ 4.8853 4.8927 4.93984 4.97458 4.99039 4.99614 4.99801 4.99851
+ 4.99869 4.99924 5.00108 5.00181 5.00119 5.00059 5.00031
+ 5.00022 5.00018 5.00011 5.00001 5.00006 4.99981 4.99977
+ 4.99982 5.00012 4.99993 5.00008 5.00043 5.00048 5.00024
+ 5.00008 4.99984 4.99993 5.00011 4.99996 4.9998 4.99977 4.9998
+ 4.99993 5.00008 5.00011 5.00002 4.99995 4.99989 4.99993
+ 5 5.00007 5.00009 4.99994 4.99977 4.9997 4.99975 4.99996
+ 4.99996 4.99988 4.9997 4.99952 4.9995 4.99956 4.99973 4.99988
+ 5.00005 5.00025 5.00042 5.00036 5.00031 5.00025 5.0002 5.00014
+ 5.00009 5.00003 5.00002 5.00001 5.00001 5 4.99999 4.99998
+ 4.99998 4.99997 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5.00284
+ 5.00442 5.00381 4.98997 4.99092 5.00733 5.07791 4.98237
+ 4.86434 4.76835 4.74067 4.79278 4.85094 4.90068 4.93603
+ 4.95698 4.96984 4.97856 4.98869 4.99904 5.0005 4.99524 5.00181
+ 5.01878 5.05177 5.07986 4.98917 4.56217 3.68 2.3539 1.18541
+ 0.505772 0.221044 0.115287 0.0760938 0.0589194 0.0476784
+ 0.0457213 0.0412911 0.033889 0.0259741 0.0191452 0.0139018
+ 0.0100235 0.00711788 0.00497657 0.00349368 0.00250021 0.00176179
+ 0.00121843 0.000838368 0.000582711 0.000423458 0.000294608
+ 0.000201251 0.000133748 8.6227e-05 5.44252e-05 3.30514e-05
+ 1.93926e-05 1.09814e-05 5.29857e-06 1.92247e-06 3.08708e-07
+ -3.74311e-07 -6.11121e-07 -7.27807e-07 -4.87604e-07 -4.80493e-07
+ -9.15925e-07 -2.03774e-06 -4.01128e-06 -2.46644e-06 2.10626e-06
+ 8.22422e-06 1.04922e-05 9.83047e-06 7.27106e-06 3.29654e-06
+ -2.06736e-06 -2.18019e-06 -2.29303e-06 -2.40586e-06 -2.51869e-06
+ -2.63153e-06 -2.24615e-06 -1.70325e-06 -1.16036e-06 -6.17468e-07
+ -7.45754e-08 2.45198e-07 2.88285e-07 3.31373e-07 3.7446e-07
+ 4.17548e-07 4.60635e-07 5.03723e-07 5.4681e-07 5.89898e-07
+ 6.32985e-07 6.76073e-07 6.19054e-07 5.4001e-07 4.60967e-07
+ 3.81923e-07 3.02879e-07 2.23836e-07 1.44792e-07 6.57488e-08
+ -1.32948e-08 -9.23383e-08 -1.6698e-07 -2.23206e-07 -2.79432e-07
+ -3.35658e-07 -3.91884e-07 -4.48109e-07 -5.04335e-07 -5.60561e-07
+ -6.16787e-07
+ EOD
+
+ @v[25].set(<<-'EOD')
+ 1.34824 1.35838 1.36465 1.34675 1.29167 1.23161 1.2201 1.2185
+ 1.2181 1.21798 1.21793 1.21788 1.21785 1.21782 1.21779 1.21776
+ 1.21655 1.21656 1.21669 1.21871 1.22421 1.22247 1.21858
+ 1.2228 1.23803 1.27737 1.10647 0.395248 0.0600669 0.027687
+ 0.0192374 0.015425 0.0130881 0.00977445 0.00696598 0.00491122
+ 0.00341952 0.00237078 0.00162339 0.00109178 0.000726647
+ 0.000478886 0.00031568 0.000207902 0.000143494 0.000109768
+ 8.62987e-05 5.69775e-05 3.36547e-05 2.30356e-05 1.86108e-05
+ 1.41861e-05 1.08293e-05 7.68835e-06 4.79593e-06 4.51019e-06
+ 4.22444e-06 3.9387e-06 3.65295e-06 3.36721e-06 3.04559e-06
+ 2.69981e-06 2.35403e-06 2.00825e-06 1.66247e-06 1.34508e-06
+ 1.26225e-06 1.17941e-06 1.09657e-06 1.01373e-06 9.30893e-07
+ 8.48054e-07 7.65216e-07 6.82378e-07 5.9954e-07 5.16702e-07
+ 4.37489e-07 3.82774e-07 3.2806e-07 2.73346e-07 2.18632e-07
+ 1.63917e-07 1.09203e-07 5.4489e-08 -2.2523e-10 -5.49395e-08
+ -1.09654e-07 -1.52862e-07 -1.3079e-07 -1.08718e-07 -8.6646e-08
+ -6.45739e-08 -4.25019e-08 -2.04298e-08 1.64229e-09 2.37144e-08
+ 4.57864e-08 6.78585e-08 8.71693e-08 9.30725e-08 9.89758e-08
+ 1.04879e-07 1.10782e-07 1.16685e-07 1.22589e-07 1.28492e-07
+ 1.34395e-07 1.40298e-07 1.46201e-07 1.52105e-07 1.58008e-07
+ 1.63911e-07 1.69814e-07 1.75718e-07 1.81621e-07 1.87524e-07
+ 1.93427e-07 1.9933e-07 2.05234e-07 2.11137e-07 2.19788e-07
+ 0.000393944 -0.000218983 -0.00105784 0.00172403 -0.00027134
+ -0.000204147 8.79968e-06 5.93762e-05 5.83554e-05 4.13815e-05
+ 3.71369e-05 3.03372e-05 2.25336e-05 1.5986e-05 1.07284e-05
+ -7.5239e-05 5.60593e-05 6.97571e-05 0.000667617 0.000960856
+ 0.00131749 -0.00759564 -0.0217897 -0.0450321 -0.076646 -0.128569
+ -0.186391 -0.202175 -0.206953 -0.2082 -0.208416 -0.208669
+ -0.208934 -0.209111 -0.209234 -0.209329 -0.209389 -0.209416
+ -0.2094 -0.209329 -0.20926 -0.209204 -0.209208 -0.209285
+ -0.209454 -0.209641 -0.20977 -0.209811 -0.209833 -0.209887
+ -0.209653 -0.209127 -0.208893 -0.208811 -0.208777 -0.208758
+ -0.208747 -0.20874 -0.208726 -0.208697 -0.208657 -0.208611
+ -0.208565 -0.208524 -0.208488 -0.208451 -0.208412 -0.208373
+ -0.208333 -0.208294 -0.208256 -0.208219 -0.208183 -0.208145
+ -0.208107 -0.208066 -0.208029 -0.207993 -0.207959 -0.207923
+ -0.207883 -0.207838 -0.207789 -0.207747 -0.20771 -0.207675
+ -0.207642 -0.207605 -0.207568 -0.207531 -0.207494 -0.207457
+ -0.20742 -0.207383 -0.207346 -0.207308 -0.207271 -0.207233
+ -0.207196 -0.207158 -0.207121 -0.207084 -0.207046 -0.207009
+ -0.206972 -0.206935 -0.206898 -0.206861 -0.206823 -0.206786
+ -0.206749 -0.206712 -0.206675 -0.206638 -0.2066 -0.206563
+ -0.206526 -0.206489 -0.206452 -0.206415 -0.203384 -0.20015
+ -0.196872 -0.205024 -0.210727 -0.206779 -0.0685263 0.586138
+ 1.4665 2.22945 2.77554 3.076 3.24926 3.34515 3.40164 3.43006
+ 3.43713 3.43075 3.42886 3.4384 3.46567 3.49025 3.51287 3.53821
+ 3.57841 3.39846 2.80753 2.22947 1.7549 1.30429 0.707786
+ 0.303206 0.131352 0.0671706 0.0429955 0.032461 0.0257161
+ 0.0239521 0.0217397 0.0179705 0.0138745 0.0102813 0.00749643
+ 0.0054328 0.00386817 0.0027004 0.00189442 0.00135552 0.000954715
+ 0.000659981 0.000453435 0.000313993 0.000231347 0.000159665
+ 0.000108122 7.10528e-05 4.50233e-05 2.77892e-05 1.62765e-05
+ 8.9893e-06 4.5471e-06 1.54614e-06 -1.6542e-07 -8.68508e-07
+ -1.04369e-06 -9.63086e-07 -8.44294e-07 -6.57339e-07 -7.35885e-07
+ -9.80056e-07 -1.39772e-06 -2.10199e-06 -1.37474e-06 6.13269e-07
+ 3.3028e-06 4.60941e-06 4.91053e-06 4.14186e-06 2.45258e-06
+ -8.7388e-09 -3.59647e-07 -7.10554e-07 -1.06146e-06 -1.41237e-06
+ -1.76328e-06 -1.63073e-06 -1.34534e-06 -1.05995e-06 -7.74561e-07
+ -4.8917e-07 -2.95733e-07 -2.16326e-07 -1.3692e-07 -5.75135e-08
+ 2.18929e-08 1.01299e-07 1.80706e-07 2.60112e-07 3.39519e-07
+ 4.18925e-07 4.98332e-07 4.83984e-07 4.4901e-07 4.14035e-07
+ 3.79061e-07 3.44087e-07 3.09112e-07 2.74138e-07 2.39163e-07
+ 2.04189e-07 1.69215e-07 1.26002e-07 4.83213e-08 -2.9359e-08
+ -1.07039e-07 -1.8472e-07 -2.624e-07 -3.4008e-07 -4.1776e-07
+ -4.95441e-07
+ EOD
+
+ @v[26].set(<<-'EOD')
+ 7.10441e-10 0.000309731 -0.000308186 -0.001694 -0.00360784
+ 8.40909e-05 0.00203175 0.0012896 0.000596548 0.000277191
+ 0.000161134 0.000120439 8.4915e-05 9.49929e-05 6.18812e-05
+ 1.65433e-05 1.89682e-05 3.97578e-05 4.95446e-05 0.000225325
+ 0.000214579 -0.00230134 -0.000451102 0.00997237 0.0341443
+ 0.0449314 0.0424411 0.0341996 0.0315315 0.0308892 0.0291614
+ 0.024365 0.0190282 0.0188976 0.017238 0.0138526 0.0105645
+ 0.00778548 0.00561753 0.0039871 0.00279554 0.00194075 0.0013468
+ 0.000934775 0.000664723 0.000498911 0.000377384 0.000254183
+ 0.000163421 0.000120773 9.65058e-05 7.22384e-05 5.60316e-05
+ 4.14549e-05 2.79516e-05 2.57096e-05 2.34677e-05 2.12257e-05
+ 1.89837e-05 1.67417e-05 1.46737e-05 1.27228e-05 1.07719e-05
+ 8.82099e-06 6.87009e-06 5.0896e-06 4.71705e-06 4.34451e-06
+ 3.97196e-06 3.59941e-06 3.22686e-06 2.85431e-06 2.48176e-06
+ 2.10921e-06 1.73666e-06 1.36411e-06 1.02855e-06 9.42931e-07
+ 8.57316e-07 7.71701e-07 6.86086e-07 6.00471e-07 5.14856e-07
+ 4.29241e-07 3.43626e-07 2.58011e-07 1.72396e-07 9.85409e-08
+ 9.14091e-08 8.42773e-08 7.71456e-08 7.00138e-08 6.2882e-08
+ 5.57503e-08 4.86185e-08 4.14867e-08 3.4355e-08 2.72232e-08
+ 2.05821e-08 1.63235e-08 1.2065e-08 7.80643e-09 3.54786e-09
+ -7.10696e-10 -4.96926e-09 -9.22782e-09 -1.34864e-08 -1.77449e-08
+ -2.20035e-08 -2.62621e-08 -3.05206e-08 -3.47792e-08 -3.90378e-08
+ -4.32963e-08 -4.75549e-08 -5.18134e-08 -5.6072e-08 -6.03306e-08
+ -6.45891e-08 -6.88477e-08 -8.76373e-06 0.000131607 -0.00021685
+ -0.000433027 0.00047234 0.000211593 -0.000189601 3.2492e-05
+ 0.000575955 7.72235e-05 -0.000285172 -0.000242061 -0.000135112
+ -3.50117e-05 -2.75868e-05 5.48974e-05 1.80604e-07 5.48911e-05
+ 3.97478e-05 0.000192909 0.000297932 0.00402253 -0.0122366
+ -0.047853 -0.0963082 -0.108071 -0.0567275 -0.0239271 -0.0178628
+ -0.0233027 -0.031853 -0.0400843 -0.0482725 -0.0576154 -0.0627218
+ -0.0511236 -0.0279524 -0.0150986 -0.00931091 -0.00652876
+ -0.00479286 -0.00344346 -0.00249578 -0.0019532 -0.00157977
+ -0.00131848 -0.00111251 -0.000939229 -0.000797445 -0.000708384
+ -0.000630452 -0.000539722 -0.000508862 -0.000480596 -0.000439484
+ -0.000407217 -0.000363866 -0.000329506 -0.000318642 -0.000307362
+ -0.000286511 -0.000266253 -0.000242943 -0.000218107 -0.000204661
+ -0.00020241 -0.000194435 -0.000185062 -0.000173042 -0.000160549
+ -0.000151407 -0.000145626 -0.000145976 -0.000147342 -0.000145288
+ -0.000137979 -0.000124481 -0.000123218 -0.000127453 -0.000139006
+ -0.000145486 -0.000129764 -9.82749e-05 -4.72596e-05 -3.08671e-05
+ -3.28834e-05 -4.52254e-05 -6.25389e-05 -6.32516e-05 -6.39643e-05
+ -6.4677e-05 -6.53897e-05 -6.61023e-05 -6.6815e-05 -6.75277e-05
+ -6.61005e-05 -6.45173e-05 -6.29341e-05 -6.13509e-05 -5.97676e-05
+ -5.81844e-05 -5.66012e-05 -5.54231e-05 -5.4455e-05 -5.3487e-05
+ -5.25189e-05 -5.15508e-05 -5.05828e-05 -4.96147e-05 -4.86466e-05
+ -4.76785e-05 -4.67105e-05 -4.57424e-05 -4.47743e-05 -4.38063e-05
+ -4.28382e-05 -4.18821e-05 -4.10211e-05 -4.016e-05 -3.9299e-05
+ -3.8438e-05 4.29885e-05 5.14113e-05 -0.000127986 -0.000611463
+ -0.000149428 0.000882394 0.00297059 -0.00405825 -0.00591067
+ -0.00546997 -0.00158744 0.00190677 0.00298403 0.00268595
+ 0.00196161 0.00130289 0.000783347 0.000520683 0.000565306
+ 0.00053419 -0.00224696 -0.000920818 0.0132755 0.0322504
+ 0.0442808 0.0638615 0.0701007 0.0539356 0.0247771 0.056244
+ 0.294266 0.831368 1.45424 2.02898 2.54559 2.9937 3.35333
+ 3.72609 4.06363 4.32789 4.52413 4.66504 4.7652 4.83637 4.88631
+ 4.92109 4.94464 4.96046 4.97218 4.98079 4.98679 4.99076
+ 4.99361 4.99555 4.99686 4.99783 4.99853 4.99902 4.99936
+ 4.99959 4.99973 4.99983 4.9999 4.99993 4.99996 4.99998 5
+ 5.00001 5 4.99999 4.99997 4.99994 4.99993 4.99994 4.99996
+ 4.99999 5.00004 5.00006 5.00005 5.00003 5.00002 5.00001
+ 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 5 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99998
+ EOD
+
+ @v[27].set(<<-'EOD')
+ 5 4.99984 4.99796 4.99478 4.9889 4.98738 4.98896 4.99087
+ 4.99262 4.99419 4.99552 4.99659 4.99743 4.99807 4.99855
+ 4.9989 4.99894 4.99908 4.99935 5.00001 5.0007 5.00132 5.00032
+ 4.99976 5.00134 5.00339 5.00315 5.00157 5.00091 5.00058
+ 5.00012 4.99944 4.99886 4.9994 4.99934 4.99899 4.99876 4.99868
+ 4.99872 4.99883 4.99898 4.99914 4.9993 4.99944 4.99956 4.99967
+ 4.99976 4.99982 4.99986 4.9999 4.99993 4.99997 4.99997 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5.00009 5.00028 5.00015 4.99983
+ 5.00036 4.99996 4.99834 4.99783 5.00383 5.00734 5.00387
+ 5.00058 4.99893 4.99836 4.99832 4.99854 4.99873 4.99905
+ 4.99927 4.99952 4.99969 4.99834 4.99536 4.99163 4.99073
+ 5.0053 5.03631 5.03103 4.9008 4.62503 4.21887 3.70902 3.09967
+ 2.35791 1.41912 0.519675 0.210458 0.131362 0.0980819 0.0708209
+ 0.0471701 0.0323272 0.0253535 0.0199144 0.0152615 0.0117228
+ 0.00917696 0.00738117 0.00609292 0.00512664 0.00436184 0.0037961
+ 0.00331639 0.00289006 0.0025477 0.00226529 0.00202925 0.00182793
+ 0.00165474 0.00150531 0.00137529 0.00125983 0.00115603 0.00106455
+ 0.000982977 0.000911255 0.000846819 0.000790092 0.000738698
+ 0.000692816 0.00065107 0.000613595 0.000579642 0.000548935
+ 0.00052106 0.000495598 0.000472174 0.000450849 0.000431118
+ 0.000412667 0.000395868 0.000381319 0.000368487 0.000357327
+ 0.000344212 0.000330334 0.00031622 0.000303298 0.000295809
+ 0.00028832 0.000280831 0.000273342 0.000265853 0.000258364
+ 0.000250875 0.000245118 0.000239488 0.000233857 0.000228227
+ 0.000222596 0.000216966 0.000211336 0.000207047 0.000203455
+ 0.000199863 0.00019627 0.000192678 0.000189085 0.000185493
+ 0.0001819 0.000178308 0.000174716 0.000171123 0.000167531
+ 0.000163938 0.000160346 0.000156835 0.000153973 0.00015111
+ 0.000148248 0.000145385 0.000296579 -3.96718e-05 -0.000449085
+ 0.000323433 0.000750086 0.000268264 0.000149028 -0.000100249
+ 7.00956e-05 0.00012605 0.00022592 0.000193036 0.000120453
+ 8.07865e-05 7.65771e-05 -3.27828e-05 0.000116759 0.000169498
+ 0.000409804 0.000414965 0.00092323 -0.00590633 -0.0175477
+ -0.032433 -0.0559842 -0.0820373 0.0688484 0.626629 1.32929
+ 2.01657 2.60925 3.12329 3.38952 3.14128 2.38463 1.23802
+ 0.316019 0.107832 0.0694707 0.051837 0.035247 0.0209999
+ 0.0116618 0.00967674 0.00789182 0.00574566 0.00386872 0.00258612
+ 0.00167126 0.00104169 0.000641093 0.000401246 0.000277928
+ 0.000171775 0.000102266 5.89376e-05 3.29258e-05 1.80463e-05
+ 1.0057e-05 6.4571e-06 5.10093e-06 4.06791e-06 3.62716e-06
+ 3.63321e-06 3.99625e-06 4.64368e-06 5.20886e-06 4.77728e-06
+ 3.23919e-06 1.14113e-06 -1.29416e-06 -4.15607e-06 -1.88532e-06
+ 5.24411e-06 1.38678e-05 1.28823e-05 3.6758e-06 -2.52285e-06
+ -3.97133e-06 -4.03071e-06 -3.37154e-06 -2.71238e-06 -2.05321e-06
+ -1.39404e-06 -7.34872e-07 -3.73325e-07 -1.05873e-07 1.61578e-07
+ 4.2903e-07 6.96482e-07 8.18468e-07 7.60065e-07 7.01662e-07
+ 6.43258e-07 5.84855e-07 5.26452e-07 4.68049e-07 4.09646e-07
+ 3.51243e-07 2.9284e-07 2.34437e-07 1.71213e-07 1.06928e-07
+ 4.2644e-08 -2.16403e-08 -8.59247e-08 -1.50209e-07 -2.14493e-07
+ -2.78778e-07 -3.43062e-07 -4.07346e-07 -4.55065e-07 -4.3348e-07
+ -4.11896e-07 -3.90311e-07 -3.68726e-07 -3.47141e-07 -3.25556e-07
+ -3.03971e-07 -2.82386e-07
+ EOD
+
+ @v[28].set(<<-'EOD')
+ 0.368163 0.361756 0.327463 0.269513 0.149476 0.0805716 0.0501146
+ 0.03403 0.0230886 0.0160474 0.0116071 0.00870013 0.00679614
+ 0.00542384 0.00432512 0.00340653 -0.00129719 -0.00399429
+ -0.00318719 0.00443085 0.0150156 0.0334147 0.0132288 -0.0189751
+ -0.0508377 -0.0252174 -0.0142489 -0.00675908 -0.0038653
+ -0.00243423 -0.00168891 -0.00120901 -0.000900426 -0.000685575
+ -0.000557595 -0.000457268 -0.000377427 -0.000315269 -0.000266613
+ -0.000228397 -0.000198283 -0.000174248 -0.000154886 -0.00013892
+ -0.000125864 -0.000115189 -0.000105841 -9.66611e-05 -8.84262e-05
+ -8.23872e-05 -7.74668e-05 -7.25463e-05 -6.79992e-05 -6.35276e-05
+ -5.92413e-05 -5.68994e-05 -5.45574e-05 -5.22154e-05 -4.98735e-05
+ -4.75315e-05 -4.54981e-05 -4.36726e-05 -4.18471e-05 -4.00216e-05
+ -3.81961e-05 -3.64559e-05 -3.54209e-05 -3.43858e-05 -3.33508e-05
+ -3.23157e-05 -3.12807e-05 -3.02456e-05 -2.92105e-05 -2.81755e-05
+ -2.71404e-05 -2.61054e-05 -2.51232e-05 -2.44984e-05 -2.38736e-05
+ -2.32487e-05 -2.26239e-05 -2.19991e-05 -2.13742e-05 -2.07494e-05
+ -2.01246e-05 -1.94998e-05 -1.88749e-05 -1.82865e-05 -1.79044e-05
+ -1.75224e-05 -1.71403e-05 -1.67582e-05 -1.63762e-05 -1.59941e-05
+ -1.56121e-05 -1.523e-05 -1.4848e-05 -1.44659e-05 -1.41138e-05
+ -1.39075e-05 -1.37011e-05 -1.34947e-05 -1.32883e-05 -1.30819e-05
+ -1.28755e-05 -1.26691e-05 -1.24627e-05 -1.22563e-05 -1.205e-05
+ -1.18436e-05 -1.16372e-05 -1.14308e-05 -1.12244e-05 -1.1018e-05
+ -1.08116e-05 -1.06052e-05 -1.03988e-05 -1.01924e-05 -9.98605e-06
+ -9.77966e-06 -2.85319e-05 0.00281092 0.00180106 -0.000981083
+ 0.00551926 -0.00119763 -0.0295069 -0.0367677 0.064749 0.119022
+ 0.0882007 0.0552062 0.03418 0.0223243 0.015545 0.011949
+ 0.00757134 0.00667655 0.00583243 0.00644443 0.00650959 -0.0302575
+ -0.0437806 -0.0355466 0.0381776 0.282109 0.674178 1.07582
+ 1.45189 1.789 2.08649 2.34663 2.57245 2.81211 3.04778 3.2523
+ 3.45877 3.65593 3.83396 3.9923 4.13368 4.25864 4.36719 4.46064
+ 4.54086 4.60962 4.66835 4.71838 4.76094 4.79716 4.82796
+ 4.85413 4.87634 4.89518 4.91116 4.92476 4.93631 4.94608
+ 4.95434 4.9613 4.96715 4.97211 4.97638 4.98001 4.98312 4.98571
+ 4.98795 4.98979 4.99138 4.99269 4.99381 4.99474 4.99551
+ 4.99615 4.99668 4.99713 4.99752 4.99783 4.99811 4.99836
+ 4.99858 4.99873 4.99884 4.99892 4.999 4.99907 4.99912 4.99916
+ 4.99921 4.99926 4.99932 4.99937 4.99942 4.99948 4.99953
+ 4.99956 4.99958 4.99961 4.99963 4.99966 4.99968 4.99971
+ 4.99972 4.99973 4.99974 4.99975 4.99976 4.99977 4.99978
+ 4.99979 4.9998 4.9998 4.99981 4.99982 4.99983 4.99984 4.99985
+ 4.99986 4.99986 4.99987 4.99987 5.00498 5.00354 4.99359
+ 4.98981 5.00498 5.00099 5.00041 5.00022 5.00015 5.00012
+ 5.0001 5.00008 5.00005 5.00003 5 4.99431 4.99459 4.99591
+ 5.00087 5.01029 5.03935 4.92784 4.51643 3.78356 2.68745
+ 1.43417 0.583128 0.205094 0.0777337 0.0391566 0.02723 0.023883
+ 0.018808 0.010165 0.00254623 -0.00377463 -0.0038097 0.00144145
+ 0.00267231 0.00193045 0.00144538 0.00121758 0.00112893 0.00109424
+ 0.0010226 0.000948072 0.000882573 0.000826996 0.000776391
+ 0.000729719 0.000686499 0.000647333 0.000610108 0.000575631
+ 0.000545069 0.000515485 0.000488514 0.000465316 0.000443215
+ 0.000422454 0.00040292 0.00038488 0.000368472 0.000353628
+ 0.000339643 0.000326197 0.000313483 0.000302884 0.000294038
+ 0.000284003 0.000270941 0.000254925 0.000246511 0.000244089
+ 0.000245538 0.000242099 0.000235728 0.000227482 0.000218001
+ 0.000207257 0.000202127 0.000196997 0.000191868 0.000186738
+ 0.000181608 0.00017758 0.000173899 0.000170219 0.000166538
+ 0.000162857 0.000159576 0.00015679 0.000154005 0.000151219
+ 0.000148433 0.000145647 0.000142861 0.000140076 0.00013729
+ 0.000134504 0.000131718 0.000129603 0.000127635 0.000125668
+ 0.0001237 0.000121732 0.000119765 0.000117797 0.000115829
+ 0.000113862 0.000111894 0.000109993 0.000108372 0.000106751
+ 0.00010513 0.000103509 0.000101887 0.000100266 9.86449e-05
+ 9.70237e-05
+ EOD
+
+ @v[29].set(<<-'EOD')
+ 5 4.99899 4.99654 4.99327 4.9863 4.98954 4.99212 4.99378
+ 4.9951 4.99624 4.99715 4.99786 4.99839 4.99879 4.99909 4.99931
+ 4.99922 4.99933 4.99971 5.00064 5.00084 5.00123 4.99865
+ 4.99853 4.99983 5.00457 5.00242 5.00105 5.00062 5.00042
+ 4.99971 4.9994 4.9992 4.9996 4.99955 4.99932 4.99918 4.99915
+ 4.99919 4.99927 4.99937 4.99948 4.99957 4.99966 4.99974
+ 4.9998 4.99985 4.99989 4.99992 4.99993 4.99994 4.99994 4.99996
+ 4.99998 5 5 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
+ 5.00001 5.00001 5 5 5 5 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5
+ 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5 5 5 5 5 5 4.9997 4.99998 4.99954 4.99963
+ 5.00059 4.99945 4.99732 4.99957 5.00919 5.00558 5.00033
+ 4.99851 4.9983 4.99854 4.99871 4.99928 4.99914 4.99939 4.99952
+ 4.9998 4.99976 4.99744 4.99598 4.99478 4.99806 5.01911 5.04602
+ 5.05469 5.01317 4.89484 4.69655 4.42036 4.06069 3.60793
+ 3.12531 2.72975 2.45187 2.25081 2.09841 1.98509 1.90211
+ 1.84084 1.79411 1.7574 1.72763 1.70283 1.68188 1.66389 1.64823
+ 1.63438 1.62201 1.61088 1.60081 1.59163 1.58323 1.57549
+ 1.56835 1.56173 1.55558 1.54985 1.54451 1.53951 1.53479
+ 1.53035 1.52615 1.5222 1.51845 1.5149 1.51153 1.50834 1.50529
+ 1.5024 1.49964 1.497 1.49449 1.49208 1.48977 1.48755 1.48542
+ 1.48336 1.48138 1.47948 1.47765 1.4759 1.47419 1.47255 1.47096
+ 1.46949 1.46823 1.46696 1.4657 1.46444 1.46317 1.46191 1.46065
+ 1.45956 1.4585 1.45743 1.45636 1.45529 1.45422 1.45315 1.45226
+ 1.45145 1.45064 1.44983 1.44902 1.44821 1.4474 1.44659 1.44579
+ 1.44498 1.44417 1.44336 1.44255 1.44174 1.44094 1.44019
+ 1.43944 1.43868 1.43793 1.43765 1.43679 1.43515 1.43405
+ 1.43478 1.43387 1.43345 1.43184 1.43086 1.43021 1.43003
+ 1.42988 1.42944 1.42883 1.42818 1.42702 1.42642 1.42595
+ 1.42586 1.42616 1.42783 1.41733 1.38106 1.30738 1.3877 2.09819
+ 3.05285 3.58059 3.77601 3.87609 4.02557 4.24887 4.4608 4.60411
+ 4.72109 4.8255 4.90465 4.97379 5.01253 5.01532 5.01239 5.0092
+ 5.00665 5.00474 5.00333 5.00232 5.00163 5.00117 5.00082
+ 5.00057 5.00039 5.00027 5.00019 5.00013 5.00009 5.00006
+ 5.00004 5.00003 5.00002 5.00001 5.00001 5 5 5 4.99998 4.99995
+ 4.99992 4.99996 5.00005 5.00012 5.00008 4.99996 4.9999 4.99985
+ 4.99986 4.99997 5.00021 5.0003 5.00024 5.00009 5.00007 5.00005
+ 5.00003 5.00001 4.99998 4.99998 4.99998 4.99999 4.99999
+ 5 5 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00002 5.00002 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99998
+ 4.99998 4.99998
+ EOD
+
+ @v[30].set(<<-'EOD')
+ 7.10441e-10 5.70385e-05 0.000226143 0.000131916 -0.000887764
+ -8.01837e-05 -3.49653e-05 9.40039e-05 0.000118663 0.000108025
+ 8.6059e-05 6.33268e-05 4.99295e-05 3.16843e-05 3.60692e-05
+ 2.07572e-05 -8.6375e-05 3.44583e-05 8.07397e-05 0.000196296
+ 0.000115615 -7.12768e-05 -0.000129812 -4.18679e-05 7.94364e-05
+ 0.000182034 -5.41226e-05 -0.000451819 -0.000713937 -0.00129863
+ -0.00262186 -0.00213417 -0.00133767 0.000775698 0.000969902
+ 0.000549281 0.000280946 0.000140321 8.6919e-05 7.22446e-05
+ 6.5631e-05 6.45263e-05 6.63087e-05 7.17391e-05 7.59042e-05
+ 7.59172e-05 7.03353e-05 6.33558e-05 5.31136e-05 4.64278e-05
+ 4.40594e-05 4.16909e-05 4.05674e-05 3.96957e-05 3.87875e-05
+ 3.74977e-05 3.62079e-05 3.49181e-05 3.36283e-05 3.23385e-05
+ 3.12427e-05 3.02775e-05 2.93124e-05 2.83472e-05 2.7382e-05
+ 2.64613e-05 2.59077e-05 2.5354e-05 2.48004e-05 2.42468e-05
+ 2.36931e-05 2.31395e-05 2.25859e-05 2.20322e-05 2.14786e-05
+ 2.0925e-05 2.03916e-05 1.9995e-05 1.95984e-05 1.92019e-05
+ 1.88053e-05 1.84087e-05 1.80122e-05 1.76156e-05 1.7219e-05
+ 1.68225e-05 1.64259e-05 1.6051e-05 1.57991e-05 1.55471e-05
+ 1.52952e-05 1.50433e-05 1.47913e-05 1.45394e-05 1.42875e-05
+ 1.40356e-05 1.37836e-05 1.35317e-05 1.32978e-05 1.31513e-05
+ 1.30048e-05 1.28583e-05 1.27118e-05 1.25653e-05 1.24188e-05
+ 1.22724e-05 1.21259e-05 1.19794e-05 1.18329e-05 1.16864e-05
+ 1.15399e-05 1.13934e-05 1.12469e-05 1.11005e-05 1.0954e-05
+ 1.08075e-05 1.0661e-05 1.05145e-05 1.0368e-05 1.02215e-05
+ 1.76447e-05 7.21516e-05 -3.59786e-05 -0.000159618 0.000156236
+ 0.000135106 -0.000336402 -0.000302283 0.000699323 0.000473866
+ -0.000156146 -0.000225625 -0.000123592 -3.78116e-05 8.47472e-06
+ 2.43387e-06 -7.44762e-05 7.80111e-05 9.43608e-05 0.000170159
+ 8.83919e-05 -0.00018802 -0.000373512 -0.000390597 0.000156875
+ 0.0032343 0.00776304 -0.000566905 -0.00760695 -0.0159226
+ -0.0245989 -0.0331402 -0.0100902 0.067837 0.266702 0.910818
+ 1.82282 2.69714 3.43247 3.98325 4.32893 4.51529 4.67087
+ 4.79288 4.87574 4.92797 4.95902 4.97655 4.98622 4.99195
+ 4.99526 4.99735 4.9991 4.99974 4.99982 4.99974 4.99961 4.9995
+ 4.99943 4.9994 4.9994 4.99942 4.99944 4.99948 4.99952 4.99956
+ 4.99961 4.99965 4.9997 4.99974 4.99977 4.99981 4.99983 4.99986
+ 4.99988 4.9999 4.99991 4.99992 4.99993 4.99994 4.99995 4.99995
+ 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999 4.99999
+ 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001 5
+ 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 5 5.00019 4.99888 4.99663 4.99457 4.99902
+ 5.00229 5.00323 5.00302 5.0023 5.0015 5.00085 5.00041 5.00013
+ 4.99993 4.99979 4.99948 4.99954 4.99983 5.00055 5.00109
+ 5.00009 4.9987 4.998 4.99755 4.99676 4.99618 5.01091 5.05272
+ 5.04156 4.80112 4.27692 3.42343 2.23953 0.967179 0.429813
+ 0.540757 1.32991 2.32147 3.14903 3.78143 4.22325 4.47978
+ 4.59448 4.69875 4.79798 4.87419 4.92339 4.95249 4.97174
+ 4.98408 4.99124 4.99478 4.99729 4.99868 4.9992 4.99941 4.99947
+ 4.99946 4.99943 4.9994 4.99939 4.9994 4.99942 4.99946 4.99951
+ 4.99956 4.99961 4.99967 4.99973 4.99977 4.9998 4.99981 4.99983
+ 4.99984 4.99987 4.99992 5.00001 5.00005 5.00001 4.99994
+ 4.99995 4.99995 4.99996 4.99996 4.99996 4.99997 4.99997
+ 4.99997 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
+ 4.99998 4.99998 4.99998
+ EOD
+
+ @v[31].set(<<-'EOD')
+ 1.8179e-09 -5.28841e-06 -1.44913e-05 -3.62932e-05 -9.75719e-05
+ 0.000141781 3.73396e-05 -1.65603e-05 -1.5271e-05 -6.73884e-06
+ 4.40157e-06 -4.85345e-06 -1.02964e-05 2.03126e-05 -1.89457e-05
+ -8.75564e-06 7.67422e-06 4.71103e-06 1.29798e-05 6.13469e-06
+ -1.14363e-05 -0.0394563 -0.0477298 -0.0622012 -0.0519225
+ 0.262499 0.943611 1.67052 2.31017 2.84028 3.28467 3.61582
+ 3.85887 4.13011 4.36511 4.54063 4.67013 4.76408 4.83263
+ 4.8825 4.91837 4.94373 4.96117 4.97318 4.98093 4.98562 4.98906
+ 4.99267 4.99539 4.99666 4.99731 4.99797 4.99844 4.99887
+ 4.99927 4.99933 4.99938 4.99944 4.99949 4.99955 4.9996 4.99965
+ 4.9997 4.99975 4.9998 4.99985 4.99986 4.99987 4.99989 4.9999
+ 4.99991 4.99992 4.99993 4.99995 4.99996 4.99997 4.99998
+ 4.99998 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
+ 5.00001 5.00001 5 5 5 5 5 5 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99997 5.00002 5.00004 5.0001 5.0001 4.99987 5.00009
+ 5.00021 5.00002 5.00004 4.99988 5.00013 4.99993 5.00026
+ 4.99973 5 5.00006 5.00009 5.00004 5.00004 5.04854 4.82711
+ 4.04208 2.64155 0.838902 0.19014 0.0982549 0.0723197 0.0576863
+ 0.0427644 0.0301979 0.020146 0.0135728 0.00980358 0.00774482
+ 0.00586604 0.0036687 0.00211511 0.00121906 0.000647581 0.000828436
+ 0.00190938 0.00224254 0.00199956 0.00165488 0.00135612 0.00113715
+ 0.000984181 0.000877175 0.000789973 0.000741139 0.000689338
+ 0.000625676 0.000586082 0.000550152 0.000529573 0.000505606
+ 0.000482117 0.000460574 0.000441649 0.000424674 0.000408398
+ 0.000391914 0.000376272 0.000361487 0.000348181 0.000336045
+ 0.000324466 0.000313545 0.000303046 0.000293056 0.00028356
+ 0.000274586 0.000266155 0.000258279 0.000250938 0.000243789
+ 0.000236912 0.000230244 0.000224186 0.000219291 0.000215346
+ 0.000212468 0.000207291 0.000200862 0.00019368 0.000186767
+ 0.000183515 0.000180263 0.00017701 0.000173758 0.000170506
+ 0.000167253 0.000164001 0.000161164 0.000158357 0.00015555
+ 0.000152743 0.000149936 0.000147129 0.000144322 0.000142066
+ 0.000140096 0.000138127 0.000136157 0.000134187 0.000132218
+ 0.000130248 0.000128278 0.000126308 0.000124339 0.000122369
+ 0.000120399 0.000118429 0.00011646 0.000114527 0.000112892
+ 0.000111258 0.000109623 0.000107988 0.000103598 6.86052e-05
+ 3.337e-05 7.00783e-05 0.000218764 0.000221318 0.000118593
+ -0.000113962 5.78552e-05 9.42068e-05 0.000237037 0.000171302
+ 0.0001033 6.16066e-05 5.52908e-05 6.30233e-05 7.01897e-05
+ 8.48573e-05 0.000106859 8.37213e-05 -0.0391541 -0.047722
+ -0.0618454 -0.0169804 0.345725 1.03426 1.74825 2.37152 2.88737
+ 3.32173 3.66761 3.9707 4.17762 3.98832 3.30483 2.09737 0.710892
+ 0.148159 0.0707463 0.0555808 0.045618 0.0319116 0.0199589
+ 0.0133357 0.00898528 0.00586075 0.00375478 0.00245443 0.00156038
+ 0.000962344 0.000590953 0.000375107 0.000250243 0.00015882
+ 0.000100203 6.18122e-05 3.7372e-05 2.23009e-05 1.32569e-05
+ 8.29437e-06 5.72457e-06 3.96832e-06 2.98935e-06 2.59699e-06
+ 2.75024e-06 3.38689e-06 4.0453e-06 3.50095e-06 1.64988e-06
+ -3.84371e-07 -2.03828e-06 -3.46401e-06 -1.24301e-06 4.63458e-06
+ 1.14104e-05 1.02619e-05 2.15487e-06 -2.98487e-06 -3.67221e-06
+ -2.94279e-06 -2.58649e-06 -2.23019e-06 -1.87389e-06 -1.5176e-06
+ -1.1613e-06 -7.92127e-07 -4.18889e-07 -4.56502e-08 3.27588e-07
+ 7.00827e-07 8.79539e-07 8.17025e-07 7.5451e-07 6.91996e-07
+ 6.29481e-07 5.66966e-07 5.04452e-07 4.41937e-07 3.79422e-07
+ 3.16908e-07 2.54393e-07 1.90078e-07 1.25366e-07 6.0654e-08
+ -4.05776e-09 -6.87696e-08 -1.33481e-07 -1.98193e-07 -2.62905e-07
+ -3.27617e-07 -3.92329e-07 -4.40392e-07 -4.18802e-07 -3.97213e-07
+ -3.75624e-07 -3.54035e-07 -3.32446e-07 -3.10856e-07 -2.89267e-07
+ -2.67678e-07
+ EOD
+
+ @v[32].set(<<-'EOD')
+ 1.10294 1.10297 1.10291 1.10277 1.10259 1.10294 1.10313
+ 1.10306 1.10299 1.10296 1.10295 1.10295 1.10294 1.10294
+ 1.10294 1.10294 1.10294 1.10294 1.10294 1.10296 1.10296
+ 1.00547 0.998599 1.5201 2.49297 3.31258 3.73162 3.84757
+ 3.92505 4.02965 4.16599 4.30294 4.41541 4.52886 4.64414
+ 4.73865 4.81065 4.86391 4.90315 4.93188 4.95258 4.96726
+ 4.97738 4.98436 4.98888 4.99162 4.99363 4.99573 4.99731
+ 4.99804 4.99843 4.99881 4.99909 4.99934 4.99957 4.9996 4.99964
+ 4.99967 4.9997 4.99973 4.99977 4.9998 4.99983 4.99986 4.99988
+ 4.99991 4.99992 4.99992 4.99993 4.99994 4.99994 4.99995
+ 4.99996 4.99996 4.99997 4.99997 4.99998 4.99998 4.99999
+ 4.99999 4.99999 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 5.00028 4.99988 4.99968
+ 5.00019 4.99987 5.00021 4.99973 4.99977 4.99996 4.99997
+ 5.0002 4.99957 5.00026 4.99947 5.00074 5.00003 4.99987 4.99979
+ 5.00008 4.99997 5.08794 5.05993 4.76875 3.99197 3.10174
+ 2.5197 2.21771 2.04 1.92235 1.83874 1.77592 1.72665 1.686
+ 1.65276 1.6286 1.61299 1.60039 1.58934 1.57954 1.57083 1.56306
+ 1.55604 1.54963 1.54375 1.53832 1.53331 1.52865 1.52432
+ 1.52026 1.51645 1.51287 1.50949 1.50629 1.50327 1.50039
+ 1.49766 1.49505 1.49257 1.49019 1.48792 1.48574 1.48365
+ 1.48164 1.47971 1.47784 1.47604 1.47431 1.47264 1.47102
+ 1.46945 1.46794 1.46647 1.46505 1.46367 1.46233 1.46103
+ 1.45976 1.45853 1.45733 1.45616 1.45502 1.45392 1.45284
+ 1.45179 1.45076 1.44975 1.4488 1.44795 1.44711 1.44626 1.44541
+ 1.44457 1.44372 1.44287 1.44212 1.44138 1.44063 1.43989
+ 1.43914 1.4384 1.43766 1.43701 1.43641 1.43581 1.43522 1.43462
+ 1.43402 1.43342 1.43282 1.43223 1.43163 1.43103 1.43043
+ 1.42984 1.42924 1.42865 1.42808 1.42752 1.42695 1.42639
+ 1.42584 1.42529 1.42472 1.42412 1.42365 1.42326 1.42304
+ 1.42162 1.42082 1.42032 1.42029 1.42026 1.41995 1.41947
+ 1.41894 1.41841 1.4179 1.41742 1.41699 1.41656 1.32097 1.30963
+ 1.78765 2.64656 3.35764 3.747 3.86589 3.94217 4.04185 4.18453
+ 4.3561 4.53439 4.68621 4.74905 4.77848 4.84629 4.91261 4.97541
+ 5.01284 5.01548 5.01248 5.00924 5.00666 5.00475 5.00334
+ 5.00234 5.00164 5.00118 5.00083 5.00058 5.0004 5.00028 5.00019
+ 5.00013 5.00009 5.00007 5.00004 5.00003 5.00002 5.00001
+ 5.00001 5.00001 5 5 4.99999 4.99995 4.99992 4.99996 5.00006
+ 5.00012 5.00009 4.99997 4.9999 4.99985 4.99986 4.99997 5.00021
+ 5.00031 5.00024 5.0001 5.00007 5.00005 5.00003 5.00001 4.99998
+ 4.99998 4.99999 4.99999 4.99999 5 5 5 5 5 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00002 5.00002 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5
+ 5 4.99999 4.99999 4.99999 4.99998 4.99998 4.99998
+ EOD
+
+ @v[33].set(<<-'EOD')
+ 5 5.00012 5.00023 5.0003 4.99972 4.99988 4.99984 4.99991
+ 4.99996 4.99999 5.00008 5.00009 4.99986 5.00003 5.00007
+ 4.99995 4.9999 4.99997 5.00013 5.00014 5.00013 4.99701 4.99763
+ 4.99742 4.99998 5.02836 5.07262 4.96856 4.57267 3.85637
+ 2.79544 1.45942 0.408016 0.084885 0.0271375 0.0119294 0.00707546
+ 0.0051087 0.00373035 0.00264737 0.00186477 0.00130379 0.000915857
+ 0.000653121 0.000483893 0.000380852 0.000302362 0.000219498
+ 0.000154435 0.000121928 0.000104026 8.61242e-05 7.48526e-05
+ 6.49216e-05 5.56238e-05 5.29689e-05 5.03139e-05 4.7659e-05
+ 4.5004e-05 4.23491e-05 4.00356e-05 3.79522e-05 3.58687e-05
+ 3.37852e-05 3.17018e-05 2.97592e-05 2.89804e-05 2.82016e-05
+ 2.74228e-05 2.66441e-05 2.58653e-05 2.50865e-05 2.43077e-05
+ 2.35289e-05 2.27501e-05 2.19714e-05 2.12346e-05 2.07821e-05
+ 2.03295e-05 1.98769e-05 1.94244e-05 1.89718e-05 1.85192e-05
+ 1.80667e-05 1.76141e-05 1.71615e-05 1.6709e-05 1.62828e-05
+ 1.60061e-05 1.57294e-05 1.54527e-05 1.5176e-05 1.48993e-05
+ 1.46226e-05 1.43459e-05 1.40692e-05 1.37925e-05 1.35158e-05
+ 1.3262e-05 1.31191e-05 1.29761e-05 1.28332e-05 1.26903e-05
+ 1.25474e-05 1.24045e-05 1.22615e-05 1.21186e-05 1.19757e-05
+ 1.18328e-05 1.16898e-05 1.15469e-05 1.1404e-05 1.12611e-05
+ 1.11182e-05 1.09752e-05 1.08323e-05 1.06894e-05 1.05465e-05
+ 1.04036e-05 1.02606e-05 1.00185e-05 3.8343e-05 -3.06781e-05
+ -0.000111758 0.000111673 0.000130815 -0.000210491 -0.000231304
+ 0.000310226 0.000265303 3.0878e-05 -4.48405e-05 -1.2852e-05
+ -7.84469e-06 3.29986e-05 -1.23286e-05 -6.07871e-05 5.35082e-05
+ 7.69194e-05 0.000126221 6.57178e-05 0.00223349 -0.0148854
+ -0.0476636 -0.0491447 0.220125 1.11174 2.03988 2.90209 3.61069
+ 4.13554 4.50679 4.71501 4.83916 4.91027 4.95284 4.98086
+ 4.99151 4.98651 4.97113 4.95075 4.93102 4.93683 4.95457
+ 4.97071 4.98212 4.98948 4.99386 4.99636 4.99785 4.9987 4.99927
+ 4.99989 5.00014 5.00007 4.99988 4.99982 4.99976 4.99973
+ 4.99972 4.99972 4.99973 4.99974 4.99975 4.99977 4.99979
+ 4.99981 4.99984 4.99986 4.99988 4.99989 4.99991 4.99992
+ 4.99993 4.99994 4.99995 4.99996 4.99996 4.99997 4.99997
+ 4.99998 4.99998 4.99998 4.99998 4.99999 4.99999 4.99999
+ 4.99999 5 5 5 5.00001 5.00001 5.00001 5.00002 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 5 4.99999 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999 4.99999
+ 4.99999 4.99999 4.99999 5 5.00012 4.99946 4.99839 4.99733
+ 4.99948 5.00114 5.00158 5.00147 5.00113 5.00073 5.00043
+ 5.0002 5.00006 4.99995 4.99986 4.99973 4.99976 4.9999 5.00029
+ 5.00055 4.99704 4.99734 4.9972 5.00278 5.03354 5.07184 4.94057
+ 4.51936 3.75638 2.60982 1.23803 0.315016 0.0796102 0.0252894
+ 0.0165723 0.0827785 0.491298 1.40686 2.33436 3.1251 3.7691
+ 4.22201 4.49976 4.68115 4.80513 4.88509 4.93208 4.95861
+ 4.97579 4.98655 4.99268 4.99571 4.99771 4.99881 4.99929
+ 4.99954 4.99965 4.9997 4.99971 4.99971 4.99971 4.99971 4.99972
+ 4.99974 4.99976 4.99978 4.99981 4.99984 4.99987 4.99989
+ 4.99991 4.99991 4.99992 4.99992 4.99993 4.99997 5.00003
+ 5.00006 5.00004 5.00001 5 4.99999 4.99998 4.99998 4.99997
+ 4.99997 4.99997 4.99998 4.99998 4.99998 4.99999 4.99999
+ 4.99999 4.99999 5 5 5 5 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5 5 5 5 5 5 5 4.99999
+ 4.99999 4.99999 4.99999 4.99998 4.99998
+ EOD
+
+ @v[34].set(<<-'EOD')
+ 5 5.00207 5.00813 5.01486 5.00156 5.0018 4.99861 4.99844
+ 4.99888 4.9993 4.99956 4.99971 4.99979 4.99983 4.99987 4.99989
+ 4.99671 4.9974 4.99864 5.00131 5.00377 5.0021 5.00039 4.99993
+ 5.00004 5.0009 5.00109 4.99636 4.98617 4.96778 4.92047 4.89528
+ 4.91112 4.9559 4.98286 4.99369 4.99812 4.99951 4.99994 5.00014
+ 5.00008 4.99994 4.99984 4.99989 4.99998 5.00004 5.00004
+ 5.00006 5.00005 5.00001 4.99997 4.99992 4.99993 4.99994
+ 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
+ 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996 4.99996
+ 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
+ 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
+ 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997 4.99997
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998
+ 4.99998 4.99998 4.99998 4.99998 5.00131 5.00072 4.9977 4.99811
+ 5.00325 4.99647 4.98948 4.99459 5.00262 5.00276 5.00156
+ 5.00072 5.0003 5.00013 4.99995 4.99668 4.99775 4.99917 5.00173
+ 5.00386 5.00188 4.99888 4.99757 4.99951 5.01712 5.0557 5.07088
+ 5.07704 5.07758 5.06958 5.04223 5.03331 5.0279 5.03408 5.07611
+ 5.01911 4.68594 3.99152 2.92195 1.69878 0.809 0.344091 0.154663
+ 0.0788717 0.0467212 0.0336168 0.0280514 0.0254947 0.024173
+ 0.0223567 0.0220555 0.0271514 0.0295872 0.0296052 0.0283971
+ 0.0264726 0.0241813 0.0218244 0.0195349 0.017368 0.0152495
+ 0.013295 0.0115444 0.00996982 0.00857091 0.00733891 0.00627261
+ 0.0053494 0.00456316 0.00388373 0.00331073 0.00282181 0.00240991
+ 0.00206389 0.00177187 0.00152283 0.00131167 0.00112558 0.000954373
+ 0.000805726 0.00069326 0.000600991 0.000525743 0.00047355
+ 0.00044359 0.000434815 0.000436053 0.000402511 0.000368969
+ 0.000335427 0.000301886 0.000268344 0.000234802 0.00020126
+ 0.000184967 0.000169932 0.000154896 0.000139861 0.000124825
+ 0.00010979 9.47546e-05 8.67896e-05 8.24901e-05 7.81906e-05
+ 7.38911e-05 6.95915e-05 6.5292e-05 6.09925e-05 5.66929e-05
+ 5.23934e-05 4.80939e-05 4.37943e-05 3.94948e-05 3.51953e-05
+ 3.08957e-05 2.67968e-05 2.42936e-05 2.17904e-05 1.92872e-05
+ 1.6784e-05 0.00125927 -0.00794344 -0.0305499 -0.0621697
+ -0.0463796 -0.0224608 -0.00538381 0.00546086 0.0108675 0.012883
+ 0.0131787 0.0127271 0.0119702 0.0110398 0.0100635 0.00649617
+ 0.00489388 0.00545863 0.0098351 0.0167428 0.0126563 0.00697542
+ 0.00427027 0.00330002 0.00390774 0.00408999 -0.00259143
+ -0.0160578 -0.0451849 -0.0409651 0.1301 0.597429 1.3848
+ 2.63426 3.81272 4.51373 4.8412 4.98731 4.88165 4.37165 3.40034
+ 2.17681 1.12217 0.505129 0.219703 0.104992 0.0622333 0.0448317
+ 0.0355782 0.0311867 0.0293529 0.0274615 0.0288739 0.0307845
+ 0.0304909 0.029245 0.0273602 0.0251006 0.022697 0.0202765
+ 0.0179357 0.0157106 0.0136562 0.0117951 0.0101273 0.00865784
+ 0.00739394 0.00634364 0.00551356 0.00480538 0.00415747 0.00356084
+ 0.00297585 0.00236711 0.00181853 0.00160713 0.00169822 0.00166542
+ 0.00145504 0.00120252 0.00109259 0.000982658 0.00087273
+ 0.000762802 0.000652874 0.000584068 0.000528263 0.000472458
+ 0.000416653 0.000360848 0.000321155 0.000301442 0.000281729
+ 0.000262016 0.000242303 0.00022259 0.000202877 0.000183164
+ 0.000163451 0.000143738 0.000124025 0.000114582 0.000107399
+ 0.000100216 9.30332e-05 8.58502e-05 7.86672e-05 7.14841e-05
+ 6.43011e-05 5.7118e-05 4.9935e-05 4.35378e-05 4.04281e-05
+ 3.73184e-05 3.42088e-05 3.10991e-05 2.79894e-05 2.48798e-05
+ 2.17701e-05 1.86604e-05
+ EOD
+
+ @v[35].set(<<-'EOD')
+ 7.24585e-12 2.21843e-05 3.20014e-05 1.25076e-05 -2.44947e-05
+ 1.8425e-05 5.50546e-06 3.53025e-05 -1.07551e-05 -3.94383e-06
+ -2.27848e-06 -9.04789e-05 7.44215e-05 -2.7662e-05 0.000200038
+ -2.11998e-05 -2.09011e-05 2.37098e-05 2.18751e-05 -2.28422e-05
+ -6.23659e-05 3.58241e-05 1.76386e-05 -4.28311e-05 0.000355626
+ 0.00156903 0.00100999 -0.0085304 -0.02067 -0.0389485 -0.0651568
+ -0.128475 -0.314362 -0.406837 -0.421558 -0.421277 -0.418176
+ -0.414481 -0.410845 -0.407348 -0.403971 -0.400716 -0.397582
+ -0.394563 -0.391658 -0.388866 -0.386178 -0.383585 -0.381094
+ -0.378789 -0.376569 -0.37435 -0.372256 -0.370188 -0.36815
+ -0.366422 -0.364694 -0.362967 -0.361239 -0.359511 -0.357888
+ -0.356334 -0.354781 -0.353227 -0.351674 -0.350152 -0.348888
+ -0.347625 -0.346361 -0.345098 -0.343834 -0.342571 -0.341307
+ -0.340044 -0.33878 -0.337517 -0.336279 -0.335215 -0.334152
+ -0.333088 -0.332024 -0.330961 -0.329897 -0.328833 -0.32777
+ -0.326706 -0.325642 -0.324601 -0.323683 -0.322766 -0.321849
+ -0.320932 -0.320014 -0.319097 -0.31818 -0.317263 -0.316345
+ -0.315428 -0.314545 -0.313825 -0.313106 -0.312387 -0.311667
+ -0.310948 -0.310228 -0.309509 -0.308789 -0.30807 -0.307351
+ -0.306631 -0.305912 -0.305192 -0.304473 -0.303754 -0.303034
+ -0.302315 -0.301595 -0.300876 -0.300157 -0.299437 -0.298716
+ -0.29798 -0.297329 -0.296691 -0.295837 -0.29516 -0.294725
+ -0.294044 -0.292917 -0.292351 -0.291965 -0.291365 -0.290687
+ -0.290027 -0.289376 -0.288772 -0.288193 -0.287505 -0.286892
+ -0.28626 -0.285714 -0.284545 -0.289246 -0.298717 -0.298492
+ -0.214163 0.181451 0.0749974 0.0454707 0.0292987 0.0196837
+ 0.0124119 0.00884715 0.00527181 0.00585821 0.0296361 0.169856
+ 0.361207 0.538856 0.67469 0.685933 0.392802 0.17772 0.0813085
+ 0.0424601 0.0246654 0.0175258 0.0144256 0.0129859 0.012205
+ 0.0112846 0.010933 0.0134813 0.0147254 0.0147981 0.0142156
+ 0.0132732 0.0121355 0.0109587 0.00981238 0.00872731 0.00767007
+ 0.00669346 0.00581341 0.00502167 0.00431819 0.00369842 0.00316168
+ 0.00269663 0.00230035 0.00195801 0.00166928 0.00142286 0.00121522
+ 0.00104072 0.000893384 0.000767675 0.000661268 0.000567659
+ 0.000481766 0.000407101 0.000350044 0.000302721 0.000263424
+ 0.000236813 0.00022199 0.000218182 0.000219548 0.0002027
+ 0.000185853 0.000169006 0.000152158 0.000135311 0.000118463
+ 0.000101616 9.33782e-05 8.57685e-05 7.81588e-05 7.0549e-05
+ 6.29393e-05 5.53296e-05 4.77199e-05 4.36954e-05 4.15296e-05
+ 3.93637e-05 3.71978e-05 3.50319e-05 3.28661e-05 3.07002e-05
+ 2.85343e-05 2.63685e-05 2.42026e-05 2.20367e-05 1.98709e-05
+ 1.7705e-05 1.55391e-05 1.34772e-05 1.22416e-05 1.10061e-05
+ 9.77055e-06 8.535e-06 0.000631271 -0.00362586 -0.0146235
+ -0.0308486 -0.0237466 -0.0117522 -0.00304171 0.00251033
+ 0.00531986 0.0063897 0.00657351 0.00636494 0.00599705 0.00553442
+ 0.00505994 0.00330925 0.00246671 0.0027006 0.00473161 0.00830333
+ 0.00649147 0.00356815 0.00217448 0.00187579 0.00270447 0.00219543
+ -0.00546118 -0.0179576 -0.0445306 -0.0649309 0.0197935 0.473629
+ 0.87268 0.269542 0.0086094 0.0844602 0.606456 1.04929 0.906014
+ 0.916205 0.919425 0.872867 0.556244 0.262457 0.11838 0.0571226
+ 0.0333451 0.0237133 0.0185096 0.0159617 0.0148663 0.0138683
+ 0.0144081 0.0153797 0.0152551 0.0146487 0.0137192 0.0125973
+ 0.0113996 0.0101903 0.00901851 0.00790495 0.00687502 0.00593994
+ 0.00510092 0.00436111 0.00372439 0.0031945 0.00277537 0.00241888
+ 0.002095 0.00179943 0.00150419 0.00119264 0.00090934 0.000802394
+ 0.000852816 0.000838368 0.000730842 0.000601028 0.000546616
+ 0.000492205 0.000437793 0.000383381 0.000328969 0.00029454
+ 0.000266428 0.000238317 0.000210205 0.000182093 0.000162091
+ 0.000152145 0.000142198 0.000132252 0.000122306 0.000112359
+ 0.000102413 9.24665e-05 8.25201e-05 7.25738e-05 6.26274e-05
+ 5.78553e-05 5.42216e-05 5.05878e-05 4.69541e-05 4.33204e-05
+ 3.96867e-05 3.60529e-05 3.24192e-05 2.87855e-05 2.51518e-05
+ 2.19153e-05 2.03406e-05 1.8766e-05 1.71913e-05 1.56167e-05
+ 1.4042e-05 1.24674e-05 1.08927e-05 9.31806e-06
+ EOD
+
+ @v[36].set(<<-'EOD')
+ 5 5.01426 5.02852 5.01923 4.77685 4.56471 4.52338 4.56813
+ 4.63122 4.693 4.74776 4.79385 4.83258 4.86358 4.88918 4.91021
+ 4.90553 4.89733 4.89554 4.91953 5.00757 5.07101 5.06318
+ 5.05241 5.05535 5.08042 5.07251 4.90973 4.56136 3.98637
+ 3.237 2.67216 2.33678 2.13529 2.00544 1.91429 1.84638 1.79461
+ 1.75338 1.71958 1.69175 1.6686 1.64918 1.63258 1.61836 1.60607
+ 1.59506 1.58483 1.57575 1.56847 1.56193 1.55538 1.54968
+ 1.54416 1.5388 1.53523 1.53165 1.52807 1.52449 1.52091 1.51771
+ 1.51477 1.51182 1.50888 1.50593 1.50309 1.50113 1.49917
+ 1.4972 1.49524 1.49328 1.49132 1.48935 1.48739 1.48543 1.48346
+ 1.48157 1.48012 1.47868 1.47724 1.47579 1.47435 1.47291
+ 1.47146 1.47002 1.46857 1.46713 1.46574 1.46462 1.4635 1.46238
+ 1.46126 1.46014 1.45902 1.4579 1.45678 1.45567 1.45455 1.45349
+ 1.45275 1.45201 1.45127 1.45053 1.44979 1.44905 1.44831
+ 1.44757 1.44683 1.44609 1.44535 1.44461 1.44387 1.44313
+ 1.44239 1.44165 1.44091 1.44017 1.43943 1.43869 1.43795
+ 1.43721 1.43874 1.43976 1.43619 1.43182 1.43726 1.43084
+ 1.42587 1.42383 1.42642 1.42728 1.42736 1.4271 1.42669 1.42621
+ 1.42569 1.41703 1.41244 1.41019 1.41199 1.41833 1.42502
+ 1.41504 1.37535 1.28381 1.44779 2.33713 3.25835 3.67554
+ 3.84975 4.01125 4.2253 4.45433 4.62215 4.74478 4.82998 4.8868
+ 4.92396 4.94768 4.96498 4.98537 5.0128 5.04467 5.06722 5.06535
+ 5.01475 4.91956 4.80647 4.7242 4.7059 4.73552 4.76379 4.81684
+ 4.87376 4.92276 4.96112 4.9884 5.0045 5.00999 5.00933 5.00619
+ 5.00384 5.00342 5.00373 5.00362 5.00309 5.00272 5.00239
+ 5.00204 5.00172 5.00146 5.00124 5.00105 5.00089 5.00076
+ 5.00065 5.00057 5.00048 5.00041 5.00034 5.00028 5.00023
+ 5.00019 5.00015 5.00015 5.00016 5.0002 5.00023 5.00021 5.00019
+ 5.00017 5.00015 5.00012 5.0001 5.00008 5.00007 5.00006 5.00005
+ 5.00004 5.00003 5.00002 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00002 5.00002 5.00002 5.00002
+ 5.00002 5.00002 5.00002 5.00002 5.00002 5.00002 5.00001
+ 5.00001 5.00001 5.00062 4.99506 4.9835 4.96726 4.9728 4.97877
+ 4.98675 4.9966 5.00406 5.00679 5.00629 5.00561 5.00487 5.00429
+ 5.00384 5.002 5.00164 5.00229 5.00484 5.00769 5.00019 5.00242
+ 5.01319 5.0335 5.07265 5.10129 5.11485 5.12551 5.13953 5.16048
+ 5.18862 5.22811 5.25656 5.25627 5.19975 4.9139 4.24745 3.43732
+ 2.8202 2.43224 2.17409 2.01333 1.93951 1.94622 1.98861 2.02217
+ 2.05383 2.08376 2.11184 2.13793 2.16191 2.18267 2.20502
+ 2.22837 2.24958 2.26901 2.28648 2.302 2.31582 2.32802 2.33869
+ 2.34795 2.35596 2.36282 2.3687 2.37371 2.37797 2.38161 2.38476
+ 2.38743 2.3897 2.39168 2.39329 2.39463 2.39575 2.39671 2.39756
+ 2.39835 2.39907 2.39968 2.39999 2.4003 2.40061 2.40091 2.40122
+ 2.40142 2.40159 2.40176 2.40193 2.4021 2.40222 2.40228 2.40234
+ 2.4024 2.40247 2.40253 2.40259 2.40265 2.40271 2.40277 2.40284
+ 2.40287 2.40289 2.40291 2.40294 2.40296 2.40298 2.40301
+ 2.40303 2.40305 2.40308 2.4031 2.40311 2.40312 2.40313 2.40314
+ 2.40315 2.40316 2.40317 2.40318
+ EOD
+
+ @v[37].set(<<-'EOD')
+ 5 5.01732 5.03181 5.05944 5.12686 5.20725 5.28103 5.31254
+ 5.32901 5.33709 5.3408 5.34257 5.34311 5.34347 5.34386 5.34411
+ 5.3406 5.33484 5.32942 5.32904 5.33644 5.34869 5.35001 5.34882
+ 5.34758 5.34672 5.34599 5.34496 5.34364 5.34165 5.33712
+ 5.33502 5.3366 5.34067 5.34306 5.34398 5.34434 5.34442 5.34443
+ 5.34443 5.34441 5.34439 5.34437 5.34437 5.34438 5.34438
+ 5.34438 5.34438 5.34438 5.34437 5.34437 5.34436 5.34436
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437 5.34437
+ 5.34437 5.34437 5.34437 5.34437 5.34437 5.35377 5.35451
+ 5.34265 5.34488 5.35861 5.28622 4.90033 4.75027 4.89731
+ 4.97098 4.99293 4.99832 4.99909 4.99956 4.99858 4.99829
+ 4.9998 5.00035 5.0038 5.00989 5.00251 4.99438 4.9953 4.99761
+ 4.99985 5.00152 5.0011 5.00046 4.99996 4.99925 4.99862 4.99919
+ 4.99961 5.00048 5.00234 4.99654 4.98235 4.95936 4.83738
+ 4.53021 4.21004 4.00593 3.91207 3.88059 3.87822 3.89117
+ 3.91278 3.94044 3.97376 4.01152 4.05052 4.10679 4.17908
+ 4.25673 4.33414 4.40875 4.47879 4.54342 4.60258 4.65595
+ 4.70291 4.74414 4.78018 4.81185 4.83915 4.86291 4.88301
+ 4.90048 4.91528 4.92802 4.9387 4.94777 4.95539 4.9618 4.96725
+ 4.97195 4.97588 4.97932 4.98247 4.98512 4.98697 4.98831
+ 4.98919 4.99015 4.99101 4.99169 4.99222 4.99282 4.99341
+ 4.994 4.9946 4.99519 4.99578 4.99638 4.99667 4.99693 4.9972
+ 4.99747 4.99773 4.998 4.99827 4.99841 4.99849 4.99856 4.99864
+ 4.99872 4.9988 4.99888 4.99896 4.99904 4.99911 4.99919 4.99927
+ 4.99935 4.99943 4.9995 4.99955 4.9996 4.99965 4.9997 5.00736
+ 4.98252 4.87516 4.66727 4.49142 4.43103 4.4301 4.4571 4.49729
+ 4.5407 4.5835 4.62363 4.66114 4.69577 4.72738 4.74632 4.75971
+ 4.77576 4.80671 4.87073 4.91665 4.93252 4.94418 4.95331
+ 4.96094 4.96727 4.97148 4.97471 4.97612 4.98276 5.00247
+ 5.04086 5.08628 5.10673 5.08887 5.0564 5.02767 5.01336 4.99685
+ 4.97422 4.90866 4.67035 4.33117 4.07888 3.94432 3.89105
+ 3.88174 3.89292 3.91442 3.94564 3.98708 4.0355 4.09134 4.16315
+ 4.24088 4.31918 4.39527 4.46693 4.53337 4.59405 4.6486 4.69693
+ 4.73938 4.77617 4.80809 4.83551 4.85895 4.87894 4.89596
+ 4.91081 4.92417 4.93651 4.94552 4.95198 4.9565 4.96096 4.96523
+ 4.96972 4.97428 4.97868 4.98064 4.9826 4.98455 4.98651 4.98847
+ 4.98967 4.99064 4.9916 4.99257 4.99353 4.99422 4.99457 4.99493
+ 4.99528 4.99563 4.99598 4.99633 4.99668 4.99703 4.99738
+ 4.99773 4.9979 4.99804 4.99817 4.9983 4.99843 4.99856 4.99869
+ 4.99883 4.99896 4.99909 4.99921 4.99926 4.99931 4.99937
+ 4.99942 4.99948 4.99953 4.99959 4.99964
+ EOD
+
+ @v[38].set(<<-'EOD')
+ 4.49849 4.53282 4.58329 4.66625 4.83345 4.97823 5.0207 5.01816
+ 5.01116 5.00595 5.00296 5.00148 5.00073 5.00062 5.00033
+ 5.0003 4.99864 4.99661 4.99652 4.99928 5.00361 5.12573 5.17251
+ 5.22612 5.33479 5.44503 5.44432 5.44379 5.44334 5.443 5.44276
+ 5.44258 5.44246 5.44238 5.44232 5.44228 5.44225 5.44223
+ 5.44221 5.4422 5.44219 5.44219 5.44218 5.44218 5.44218 5.44218
+ 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
+ 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217
+ 5.44217 5.44217 5.44217 5.44217 5.44217 5.44217 5.44216
+ 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
+ 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216 5.44216
+ 5.44216 5.44216 5.44216 5.44216 5.44215 5.44215 5.44215
+ 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
+ 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
+ 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215 5.44215
+ 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214 5.44214
+ 5.44214 5.44214 5.44214 5.44214 5.44212 5.45159 5.45236
+ 5.44064 5.44307 5.45616 5.38122 4.77163 3.53297 2.74466
+ 2.34448 2.11802 1.9783 1.88656 1.82001 1.77389 1.72955 1.69632
+ 1.66971 1.6526 1.65236 1.56034 1.53764 1.97139 2.75096 3.39212
+ 3.74042 3.82345 3.85696 3.88547 3.91862 3.9585 4.00467 4.05903
+ 4.1254 4.19533 4.26791 4.34517 4.42112 4.49238 4.55807 4.6179
+ 4.6713 4.71815 4.75889 4.79418 4.82456 4.85062 4.87291 4.89196
+ 4.90823 4.92209 4.93388 4.9439 4.95242 4.95968 4.96585 4.97108
+ 4.9755 4.97923 4.98237 4.98503 4.98732 4.98927 4.99094 4.99233
+ 4.99353 4.99452 4.99538 4.99608 4.99668 4.99718 4.9976 4.99794
+ 4.99822 4.99847 4.99867 4.99884 4.99899 4.99913 4.99924
+ 4.99932 4.99938 4.99943 4.99947 4.99951 4.99953 4.99955
+ 4.99958 4.99961 4.99964 4.99967 4.99969 4.99972 4.99975
+ 4.99977 4.99978 4.99979 4.99981 4.99982 4.99983 4.99985
+ 4.99986 4.99986 4.99987 4.99987 4.99988 4.99988 4.99988
+ 4.99989 4.99989 4.9999 4.9999 4.99991 4.99991 4.99992 4.99992
+ 4.99993 4.99993 4.99993 4.99994 5.00381 5.00064 4.99246
+ 4.99823 5.00349 5.00076 5.00033 5.00015 5.00009 5.00007
+ 5.00005 5.00004 5.00003 5.00002 4.99988 4.99732 4.99728
+ 4.9978 5.00187 5.00927 5.08712 5.07654 4.92855 4.4863 3.76162
+ 3.00049 2.49834 2.20883 2.03492 1.92384 1.84676 1.79021
+ 1.74716 1.7132 1.68576 1.66309 1.64406 1.62785 1.61383 1.60162
+ 1.59081 1.58117 1.57253 1.56473 1.55765 1.55117 1.54527
+ 1.53988 1.53485 1.53012 1.5257 1.5216 1.51773 1.51411 1.51071
+ 1.50746 1.50438 1.50146 1.49868 1.49603 1.4935 1.49109 1.48878
+ 1.48657 1.48445 1.48242 1.48046 1.47858 1.47677 1.47502
+ 1.47333 1.4717 1.47012 1.46859 1.46711 1.46568 1.46428 1.46292
+ 1.4616 1.46034 1.45923 1.45812 1.45701 1.4559 1.45479 1.45378
+ 1.45279 1.45181 1.45082 1.44983 1.44893 1.44813 1.44732
+ 1.44652 1.44571 1.44491 1.4441 1.4433 1.44249 1.44169 1.44089
+ 1.44019 1.43951 1.43883 1.43815 1.43747 1.4368 1.43612 1.43544
+ 1.43476 1.43408 1.43342 1.43283 1.43223 1.43163 1.43104
+ 1.43044 1.42984 1.42924 1.42865
+ EOD
+
+ @v[39].set(<<-'EOD')
+ 5 5.01048 5.01221 4.98887 4.76261 4.54943 4.51564 4.56249
+ 4.62621 4.68843 4.74374 4.79044 4.82972 4.86127 4.88724
+ 4.90862 4.90791 4.89858 4.89589 4.91767 5.00405 5.16956
+ 5.12391 4.7557 3.87953 3.01124 2.48482 2.20424 2.03812 1.92679
+ 1.84956 1.79256 1.74907 1.71487 1.68724 1.6644 1.64513 1.6287
+ 1.61446 1.60197 1.59095 1.58117 1.57245 1.5646 1.55752 1.55109
+ 1.54516 1.53958 1.53444 1.53008 1.52606 1.52205 1.51843
+ 1.5149 1.51146 1.50893 1.50639 1.50387 1.50133 1.4988 1.49651
+ 1.49436 1.49222 1.49007 1.48793 1.48585 1.48433 1.4828 1.48128
+ 1.47975 1.47823 1.4767 1.47518 1.47365 1.47213 1.4706 1.46912
+ 1.46795 1.46678 1.46561 1.46444 1.46327 1.4621 1.46093 1.45976
+ 1.45859 1.45741 1.45628 1.45534 1.45441 1.45347 1.45254
+ 1.4516 1.45067 1.44973 1.4488 1.44786 1.44693 1.44604 1.44539
+ 1.44475 1.4441 1.44345 1.44281 1.44216 1.44151 1.44086 1.44022
+ 1.43957 1.43892 1.43828 1.43763 1.43698 1.43633 1.43569
+ 1.43504 1.43439 1.43375 1.4331 1.43245 1.4318 1.43157 1.43089
+ 1.43001 1.43042 1.42899 1.42439 1.42216 1.43447 1.44048
+ 1.43705 1.43314 1.43039 1.42861 1.42739 1.42651 1.42548
+ 1.42488 1.4243 1.42392 1.4235 1.32443 1.31149 1.78169 2.64844
+ 3.43211 3.95252 4.20231 4.3746 4.49948 4.58929 4.65742 4.71183
+ 4.77057 4.83196 4.88354 4.92894 4.96625 4.99235 5.00651
+ 5.00941 5.00813 5.00689 5.00588 5.00504 5.00431 5.00368
+ 5.00314 5.00268 5.00228 5.00194 5.00165 5.0014 5.00118 5.001
+ 5.00085 5.00072 5.00061 5.00052 5.00044 5.00037 5.00031
+ 5.00027 5.00022 5.00019 5.00016 5.00013 5.00011 5.00009
+ 5.00008 5.00007 5.00006 5.00005 5.00004 5.00003 5.00003
+ 5.00003 5.00002 5.00002 5.00002 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001 5.00001
+ 5.00001 5.00001 5 5 5 5 5 4.99999 4.99999 4.99999 4.99998
+ 4.99998 4.99998 4.99998 4.99998 4.99998 4.99998 4.99999
+ 4.99999 4.99999 4.99999 4.99999 4.99999 5 5 5 5 5.00001
+ 5.00002 5.00003 5.00004 5.00022 4.99974 4.99942 4.99997
+ 5.00063 5.00002 5.00003 4.99994 4.99998 4.99999 5 5 5 5
+ 5 4.99981 4.99998 5.00004 5.00036 5.00049 5.12012 5.16315
+ 5.19712 5.21835 4.87874 4.10151 3.31555 2.74207 2.38075
+ 2.15872 2.01614 1.91886 1.84852 1.79401 1.75052 1.71508
+ 1.68672 1.66467 1.64602 1.62985 1.61576 1.60343 1.59256
+ 1.58287 1.57418 1.56632 1.55922 1.55282 1.54687 1.54132
+ 1.53618 1.53143 1.52698 1.52282 1.51895 1.51527 1.5118 1.50851
+ 1.5054 1.50244 1.49963 1.49695 1.4944 1.49196 1.48963 1.4874
+ 1.48527 1.48322 1.48124 1.47934 1.47751 1.47574 1.47403
+ 1.47239 1.4708 1.46926 1.46777 1.46632 1.46491 1.46355 1.46237
+ 1.4612 1.46002 1.45884 1.45766 1.45659 1.45555 1.45451 1.45346
+ 1.45242 1.45147 1.45062 1.44978 1.44894 1.44809 1.44725
+ 1.4464 1.44556 1.44472 1.44387 1.44303 1.4423 1.44159 1.44088
+ 1.44017 1.43947 1.43876 1.43805 1.43734 1.43664 1.43593
+ 1.43524 1.43462 1.434 1.43338 1.43276 1.43213 1.43151 1.43089
+ 1.43027
+ EOD
+ end
+
+ def highlightTrace(graph)
+ entry = graph.legend_get(:current)
+ active_list = graph.legend_activate
+ if active_list.include?(entry)
+ graph.legend_deactivate(entry)
+ graph.element_deactivate(entry)
+ else
+ graph.legend_activate(entry)
+ graph.element_activate(entry)
+ end
+ end
+
+end
+
+BLT_Graph_Demo.new
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/graph7.rb b/ext/tk/sample/tkextlib/blt/graph7.rb
new file mode 100644
index 0000000000..8b31b28c91
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/graph7.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+length = 250000
+graph = Tk::BLT::Graph.new(:title=>"Scatter Plot\n#{length} points")
+graph.xaxis_configure(:loose=>false, :title=>'X Axis Label')
+graph.yaxis_configure(:title=>'Y Axis Label')
+graph.legend_configure(:activerelief=>:sunken, :background=>'')
+
+Tk::BLT::Table.add(Tk.root, graph, [0,0], :fill=>:both)
+
+v_x = Tk::BLT::Vector.new(length)
+v_y = Tk::BLT::Vector.new(length)
+v_x.expr("random(#{v_x})")
+v_y.expr("random(#{v_y})")
+v_x.sort(v_y)
+
+plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square,
+ :color=>'green4', :fill=>'green2',
+ :linewidth=>0, :outlinewidth=>1,
+ :pixels=>4, :label=>'plot',
+ :xdata=>v_x, :ydata=>v_y)
+
+Tk.root.minsize(0, 0)
+
+#graph.zoom_stack
+#graph.crosshairs
+#graph.active_legend
+#graph.closest_point
+Tk::BLT.zoom_stack(graph)
+Tk::BLT.crosshairs(graph)
+Tk::BLT.active_legend(graph)
+Tk::BLT.closest_point(graph)
+
+Tk::BLT::Busy.hold(graph)
+Tk.update
+Tk::BLT::Busy.release(graph)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/graph7a.rb b/ext/tk/sample/tkextlib/blt/graph7a.rb
new file mode 100644
index 0000000000..8def766060
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/graph7a.rb
@@ -0,0 +1,63 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+file = File.join(File.dirname(File.expand_path(__FILE__)),
+ 'images', 'buckskin.gif')
+bgTexture = TkPhotoImage.new(:file=>file)
+
+TkOption.add('*Graph.Tile', bgTexture)
+TkOption.add('*Label.Tile', bgTexture)
+TkOption.add('*Frame.Tile', bgTexture)
+TkOption.add('*Htext.Tile', bgTexture)
+TkOption.add('*TileOffset', 0)
+TkOption.add('*HighlightThickness', 0)
+TkOption.add('*Element.ScaleSybols', false)
+TkOption.add('*Element.Smooth', :linear)
+TkOption.add('*activeLine.Color', 'yellow4')
+TkOption.add('*activeLine.Fill', 'yellow')
+TkOption.add('*activeLine.LineWidth', 0)
+TkOption.add('*Element.Pixels', 3)
+TkOption.add('*Graph.halo', '7i')
+
+if Tk.root.winfo_screenvisual != 'staticgray'
+ TkOption.add('*print.background', 'yellow')
+ TkOption.add('*quit.background', 'red')
+end
+
+length = 250000
+graph = Tk::BLT::Graph.new(:title=>"Scatter Plot\n#{length} points")
+graph.xaxis_configure(:loose=>false, :title=>'X Axis Label')
+graph.yaxis_configure(:title=>'Y Axis Label')
+graph.legend_configure(:activerelief=>:sunken, :background=>'')
+
+Tk::BLT::Table.add(Tk.root, graph, [0,0], :fill=>:both)
+
+v_x = Tk::BLT::Vector.new(length)
+v_y = Tk::BLT::Vector.new(length)
+v_x.expr("random(#{v_x})")
+v_y.expr("random(#{v_y})")
+v_x.sort(v_y)
+
+plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square,
+ :color=>'green4', :fill=>'green2',
+ :linewidth=>0, :outlinewidth=>1,
+ :pixels=>4, :label=>'plot',
+ :xdata=>v_x, :ydata=>v_y)
+
+Tk.root.minsize(0, 0)
+
+#graph.zoom_stack
+#graph.crosshairs
+#graph.active_legend
+#graph.closest_point
+Tk::BLT.zoom_stack(graph)
+Tk::BLT.crosshairs(graph)
+Tk::BLT.active_legend(graph)
+Tk::BLT.closest_point(graph)
+
+Tk::BLT::Busy.hold(graph)
+Tk.update
+Tk::BLT::Busy.release(graph)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/graph7b.rb b/ext/tk/sample/tkextlib/blt/graph7b.rb
new file mode 100644
index 0000000000..8b00f154b2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/graph7b.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+length = 250000
+graph = Tk::BLT::Graph.new(:title=>"Scatter Plot\n#{length} points")
+graph.xaxis_configure(:loose=>false, :title=>'X Axis Label')
+graph.yaxis_configure(:title=>'Y Axis Label')
+graph.legend_configure(:activerelief=>:sunken, :background=>'')
+
+Tk::BLT::Table.add(Tk.root, graph, [0,0], :fill=>:both)
+
+x = Array.new(length)
+y = Array.new(length)
+(0...length).each{|i|
+ x[i] = rand
+ y[i] = rand
+}
+
+plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square,
+ :color=>'green4', :fill=>'green2',
+ :linewidth=>0, :outlinewidth=>1,
+ :pixels=>4, :label=>'plot',
+ :xdata=>x, :ydata=>y)
+
+Tk.root.minsize(0, 0)
+
+#graph.zoom_stack
+#graph.crosshairs
+#graph.active_legend
+#graph.closest_point
+Tk::BLT.zoom_stack(graph)
+Tk::BLT.crosshairs(graph)
+Tk::BLT.active_legend(graph)
+Tk::BLT.closest_point(graph)
+
+Tk::BLT::Busy.hold(graph)
+Tk.update
+Tk::BLT::Busy.release(graph)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/graph7c.rb b/ext/tk/sample/tkextlib/blt/graph7c.rb
new file mode 100644
index 0000000000..d4ed1a66ad
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/graph7c.rb
@@ -0,0 +1,45 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+length = 250000
+graph = Tk::BLT::Graph.new(:title=>"Scatter Plot\n#{length} points")
+graph.xaxis_configure(:loose=>false, :title=>'X Axis Label')
+graph.yaxis_configure(:title=>'Y Axis Label')
+graph.legend_configure(:activerelief=>:sunken, :background=>'')
+
+Tk::BLT::Table.add(Tk.root, graph, [0,0], :fill=>:both)
+
+v_x = Tk::BLT::Vector.new(length)
+v_y = Tk::BLT::Vector.new(length)
+x = Array.new(length)
+y = Array.new(length)
+(0...length).each{|i|
+ x[i] = rand
+ y[i] = rand
+}
+v_x.set(x)
+v_y.set(y)
+
+plot = Tk::BLT::PlotComponent::Element.new(graph, :symbol=>:square,
+ :color=>'green4', :fill=>'green2',
+ :linewidth=>0, :outlinewidth=>1,
+ :pixels=>4, :label=>'plot',
+ :xdata=>v_x, :ydata=>v_y)
+
+Tk.root.minsize(0, 0)
+
+#graph.zoom_stack
+#graph.crosshairs
+#graph.active_legend
+#graph.closest_point
+Tk::BLT.zoom_stack(graph)
+Tk::BLT.crosshairs(graph)
+Tk::BLT.active_legend(graph)
+Tk::BLT.closest_point(graph)
+
+Tk::BLT::Busy.hold(graph)
+Tk.update
+Tk::BLT::Busy.release(graph)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/images/buckskin.gif b/ext/tk/sample/tkextlib/blt/images/buckskin.gif
new file mode 100644
index 0000000000..e2d7be9d62
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/images/buckskin.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/blt/images/chalk.gif b/ext/tk/sample/tkextlib/blt/images/chalk.gif
new file mode 100644
index 0000000000..30d29a7221
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/images/chalk.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/blt/images/qv100.t.gif b/ext/tk/sample/tkextlib/blt/images/qv100.t.gif
new file mode 100644
index 0000000000..1e738ee86b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/images/qv100.t.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/blt/images/rain.gif b/ext/tk/sample/tkextlib/blt/images/rain.gif
new file mode 100644
index 0000000000..d7bb417939
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/images/rain.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/blt/images/sample.gif b/ext/tk/sample/tkextlib/blt/images/sample.gif
new file mode 100644
index 0000000000..1d8a4010c3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/images/sample.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/blt/pareto.rb b/ext/tk/sample/tkextlib/blt/pareto.rb
new file mode 100644
index 0000000000..bf9a1ec749
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/pareto.rb
@@ -0,0 +1,90 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/blt'
+
+# Example of a pareto chart.
+#
+# The pareto chart mixes line and bar elements in the same graph.
+# Each processing operating is represented by a bar element. The
+# total accumulated defects is displayed with a single line element.
+b = Tk::BLT::Barchart.new(:title=>'Defects Found During Inspection',
+ :font=>'Helvetica 12', :plotpady=>[12, 4],
+ :width=>'6i', :height=>'5i')
+Tk::BLT::Table.add(Tk.root, b, :fill=>:both)
+
+data = [
+ ["Spot Weld", 82, 'yellow'],
+ ["Lathe", 49, 'orange'],
+ ["Gear Cut", 38, 'green'],
+ ["Drill", 24, 'blue'],
+ ["Grind", 17, 'red'],
+ ["Lapping", 12, 'brown'],
+ ["Press", 8, 'purple'],
+ ["De-burr", 4, 'pink'],
+ ["Packaging", 3, 'cyan'],
+ ["Other", 12, 'magenta']
+]
+
+# Create an X-Y graph line element to trace the accumulated defects.
+b.line_create('accum', :label=>'', :symbol=>:none, :color=>'red')
+
+# Define a bitmap to be used to stipple the background of each bar.
+pattern1 = Tk::BLT::Bitmap.define([ [4, 4], [1, 2, 4, 8] ])
+
+# For each process, create a bar element to display the magnitude.
+count = 0
+sum = 0
+ydata = [0]
+xdata = [0]
+labels = []
+
+data.each{|label, value, color|
+ count += 1
+ b.element_create(label, :xdata=>count, :ydata=>value, :foreground=>color,
+ :relief=>:solid, :borderwidth=>1, :stipple=>pattern1,
+ :background=>'lightblue')
+ labels[count] = label
+ # Get the total number of defects.
+ sum += value
+ ydata << sum
+ xdata << count
+}
+
+# Configure the coordinates of the accumulated defects,
+# now that we know what they are.
+b.element_configure('accum', :xdata=>xdata, :ydata=>ydata)
+
+# Add text markers to label the percentage of total at each point.
+xdata.zip(ydata){|x, y|
+ percent = (y * 100.0) / sum
+ if x == 0
+ text = ' 0%'
+ else
+ text = '%.1f' % percent
+ end
+ b.marker_create(:text, :coords=>[x, y], :text=>text, :font=>'Helvetica 10',
+ :foreground=>'red4', :anchor=>:center, :yoffset=>-5)
+}
+
+# Display an auxillary y-axis for percentages.
+b.axis_configure('y2', :hide=>false, :min=>0.0, :max=>100.0,
+ :title=>'Percentage')
+
+# Title the y-axis
+b.axis_configure('y', :title=>'Defects')
+
+# Configure the x-axis to display the process names, instead of numbers.
+b.axis_configure('x', :title=>'Process', :rotate=>90, :subdivisions=>0,
+ :command=>proc{|w, val|
+ val = val.round
+ labels[val]? labels[val]: val
+ })
+
+# No legend needed.
+b.legend_configure(:hide=>true)
+
+# Configure the grid lines.
+b.gridline_configure(:mapx=>:x, :color=>'lightblue')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/plot1.rb b/ext/tk/sample/tkextlib/blt/plot1.rb
new file mode 100644
index 0000000000..07dff48292
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/plot1.rb
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+graph = Tk::BLT::Graph.new.pack
+plot = Tk::BLT::PlotComponent::Element.new(graph, :linewidth=>0, :label=>'foo')
+plot.data([[1.0, 3.4], [1.1, 2.8], [1.2, 3.1], [1.4, 2.9]].flatten)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/plot1b.rb b/ext/tk/sample/tkextlib/blt/plot1b.rb
new file mode 100644
index 0000000000..8a3ce8216d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/plot1b.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+graph = Tk::BLT::Graph.new.pack
+plot = graph.element_create
+plot.configure(:linewidth=>0, :label=>'foo',
+ :data=>[[1.0, 3.4], [1.1, 2.8], [1.2, 3.1], [1.4, 2.9]].flatten)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/readme.txt b/ext/tk/sample/tkextlib/blt/readme.txt
new file mode 100644
index 0000000000..8ac1044b0b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/readme.txt
@@ -0,0 +1,2 @@
+The scripts and image files in this directory are based on demo files
+of Tcl/Tk's BLT extension.
diff --git a/ext/tk/sample/tkextlib/blt/scripts/stipples.rb b/ext/tk/sample/tkextlib/blt/scripts/stipples.rb
new file mode 100644
index 0000000000..47f3c4d063
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/scripts/stipples.rb
@@ -0,0 +1,156 @@
+$stipples = {} unless $stipples
+
+$stipples['bdiagonal1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define bdiagonal1_width 8
+#define bdiagonal1_height 8
+static unsigned char bdiagonal1_bits[] = {
+ 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11};
+EOD
+
+$stipples['bdiagonal2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define bdiagonal2_width 8
+#define bdiagonal2_height 8
+static unsigned char bdiagonal2_bits[] = {
+ 0x08, 0x04, 0x02, 0x01, 0x80, 0x40, 0x20, 0x10};
+EOD
+
+$stipples['checker2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define checker2_width 8
+#define checker2_height 8
+static unsigned char checker2_bits[] = {
+ 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc};
+EOD
+
+
+$stipples['checker3'] = Tk::BLT::Bitmap.new(<<EOD)
+#define checker3_width 8
+#define checker3_height 8
+static unsigned char checker3_bits[] = {
+ 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0};
+EOD
+
+$stipples['cross1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define cross1_width 8
+#define cross1_height 8
+static unsigned char cross_bits[] = {
+ 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa};
+EOD
+
+$stipples['cross2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define cross2_width 8
+#define cross2_height 8
+static unsigned char cross2_bits[] = {
+ 0xff, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88};
+EOD
+
+$stipples['cross3'] = Tk::BLT::Bitmap.new(<<EOD)
+#define cross3_width 8
+#define cross3_height 8
+static unsigned char cross3_bits[] = {
+ 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+EOD
+
+$stipples['crossdiag'] = Tk::BLT::Bitmap.new(<<EOD)
+#define crossdiag_width 8
+#define crossdiag_height 8
+static unsigned char crossdiag2_bits[] = {
+ 0x18, 0x24, 0x42, 0x81, 0x81, 0x42, 0x24, 0x18};
+EOD
+
+$stipples['dot1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define dot1_width 8
+#define dot1_height 8
+static unsigned char dot1_bits[] = {
+ 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
+EOD
+
+$stipples['dot2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define dot2_width 8
+#define dot2_height 8
+static unsigned char dot2_bits[] = {
+ 0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, 0x00};
+EOD
+
+$stipples['dot3'] = Tk::BLT::Bitmap.new(<<EOD)
+#define dot3_width 8
+#define dot3_height 8
+static unsigned char dot3_bits[] = {
+ 0x11, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00};
+EOD
+
+$stipples['dot4'] = Tk::BLT::Bitmap.new(<<EOD)
+#define dot4_width 8
+#define dot4_height 8
+static unsigned char dot4_bits[] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+EOD
+
+$stipples['fdiagonal1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define fdiagonal1_width 8
+#define fdiagonal1_height 8
+static unsigned char fdiagonal1_bits[] = {
+ 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88};
+EOD
+
+$stipples['fdiagonal2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define fdiagonal2_width 8
+#define fdiagonal2_height 8
+static unsigned char fdiagonal2_bits[] = {
+ 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08};
+EOD
+
+$stipples['hline1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define hline1_width 8
+#define hline1_height 8
+static unsigned char hline1_bits[] = {
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00};
+EOD
+
+$stipples['hline2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define hline2_width 8
+#define hline2_height 8
+static unsigned char hline2_bits[] = {
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00};
+EOD
+
+$stipples['lbottom'] = Tk::BLT::Bitmap.new(<<EOD)
+#define lbottom_width 8
+#define lbottom_height 8
+static unsigned char lbottom_bits[] = {
+ 0x00, 0x11, 0x11, 0x77, 0x00, 0x11, 0x11, 0x77};
+EOD
+
+$stipples['ltop'] = Tk::BLT::Bitmap.new(<<EOD)
+#define ltop_width 8
+#define ltop_height 8
+static unsigned char ltop_bits[] = {
+ 0xee, 0x88, 0x88, 0x00, 0xee, 0x88, 0x88, 0x00};
+EOD
+
+$stipples['rbottom'] = Tk::BLT::Bitmap.new(<<EOD)
+#define rbottom_width 8
+#define rbottom_height 8
+static unsigned char rbottom_bits[] = {
+ 0x00, 0x88, 0x88, 0xee, 0x00, 0x88, 0x88, 0xee};
+EOD
+
+$stipples['rtop'] = Tk::BLT::Bitmap.new(<<EOD)
+#define rtop_width 8
+#define rtop_height 8
+static unsigned char rtop_bits[] = {
+ 0x77, 0x11, 0x11, 0x00, 0x77, 0x11, 0x11, 0x00};
+EOD
+
+$stipples['vline1'] = Tk::BLT::Bitmap.new(<<EOD)
+#define vline1_width 8
+#define vline1_height 8
+static unsigned char vline1_bits[] = {
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55};
+EOD
+
+$stipples['vline2'] = Tk::BLT::Bitmap.new(<<EOD)
+#define vline2_width 8
+#define vline2_height 8
+static unsigned char vline2_bits[] = {
+ 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33};
+EOD
diff --git a/ext/tk/sample/tkextlib/blt/winop1.rb b/ext/tk/sample/tkextlib/blt/winop1.rb
new file mode 100644
index 0000000000..97c31aa295
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/winop1.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+file = File.join(File.dirname(File.expand_path(__FILE__)),
+ 'images', 'sample.gif')
+if File.exist?(file)
+ src = TkPhotoImage.new(:file=>file)
+else
+ fail RuntimeError, 'no image file'
+end
+
+width = src.width
+height = src.height
+
+TkOption.add('*Label.font', '*helvetica*10*')
+TkOption.add('*Label.background', 'white')
+
+l_img0 = TkLabel.new(:image=>src)
+l_hdr0 = TkLabel.new(:text=>"#{width} x #{height}")
+l_ftr0 = TkLabel.new(:text=>'100%')
+Tk.root.background('white')
+
+(2..10).each{|i|
+ iw = width/i
+ ih = height/i
+ r = '%6g'%(100.0/i)
+ dst = TkPhotoImage.new(:width=>iw, :height=>ih)
+ Tk::BLT::Winop.image_resample(src, dst, :sinc)
+ l_hdr = TkLabel.new(:text=>"#{iw} x #{ih}")
+ l_ftr = TkLabel.new(:text=>"#{r}%")
+ l_img = TkLabel.new(:image=>dst)
+ Tk::BLT::Table.add(Tk.root,
+ [0,i], l_hdr,
+ [1,i], l_img,
+ [2,i], l_ftr)
+ Tk.update
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/blt/winop2.rb b/ext/tk/sample/tkextlib/blt/winop2.rb
new file mode 100644
index 0000000000..d59c43ba22
--- /dev/null
+++ b/ext/tk/sample/tkextlib/blt/winop2.rb
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/blt'
+
+file = File.join(File.dirname(File.expand_path(__FILE__)),
+ 'images', 'qv100.t.gif')
+if File.exist?(file)
+ src = TkPhotoImage.new(:file=>file)
+else
+ fail RuntimeError, 'no image file'
+end
+
+width = src.width
+height = src.height
+
+TkOption.add('*Label.font', '*helvetica*10*')
+TkOption.add('*Label.background', 'white')
+
+[0, 90, 180, 270, 360, 45].each_with_index{|r, i|
+ dest = TkPhotoImage.new
+ Tk::BLT::Winop.image_rotate(src, dest, r)
+ l_txt = TkLabel.new(:text=>"#{r} degrees")
+ l_img = TkLabel.new(:image=>dest)
+ Tk::BLT::Table.add(Tk.root, [0,i], l_img, [1,i], l_txt)
+ Tk.update
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt
new file mode 100644
index 0000000000..16ddca4e3c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt
@@ -0,0 +1,53 @@
+
+ ######################################################################
+ ### The following text is the original 'LICENSE.txt' of BWidget ###
+ ### extension. ###
+ ### Original Tcl source files are not include in this directory, ###
+ ### because of all of them are rewritten to Ruby files. ###
+ ### However, the bitmap data files ('bwidgtet.xbm' and 'x1.xbm') ###
+ ### included in this directory are quoted from BWidget source ###
+ ### archive. So, those bitmaps are under the following license. ###
+ ######################################################################
+
+
+BWidget ToolKit
+Copyright (c) 1998-1999 UNIFIX.
+Copyright (c) 2001-2002 ActiveState Corp.
+
+The following terms apply to all files associated with the software
+unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/tkextlib/bwidget/basic.rb b/ext/tk/sample/tkextlib/bwidget/basic.rb
new file mode 100644
index 0000000000..060baf8a6c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/basic.rb
@@ -0,0 +1,198 @@
+#
+# basic demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoBasic
+ @@var = TkVariable.new_hash
+ @@after = nil
+ @@count = 0
+
+ def self.create(nb)
+ frame = nb.insert('end', 'demoBasic', :text=>'Basic')
+ topf = TkFrame.new(frame)
+
+ titf1 = Tk::BWidget::TitleFrame.new(topf, :text=>'Label')
+ titf2 = Tk::BWidget::TitleFrame.new(topf, :text=>'Entry')
+
+ titf3 = Tk::BWidget::TitleFrame.new(frame, :text=>'Button and ArrowButton')
+
+ _label(titf1.get_frame)
+ _entry(titf2.get_frame)
+ _button(titf3.get_frame)
+
+ Tk.pack(titf1, titf2, :side=>:left, :fill=>:both, :padx=>4, :expand=>true)
+ topf.pack(:pady=>2, :fill=>:x)
+ titf3.pack(:pady=>2, :padx=>4, :fill=>:x)
+ end
+
+ def self._label(parent)
+ lab = Tk::BWidget::Label.new(parent, :text=>'This is a Label widget',
+ :helptext=>'Label widget')
+ chk = TkCheckbutton.new(parent, :text=>'Disabled',
+ :variable=>@@var.ref(lab, 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
+ :command=>proc{lab[:state] = @@var[lab, 'state']})
+ lab.pack(:anchor=>:w, :pady=>4)
+ chk.pack(:anchor=>:w)
+ end
+
+ def self._entry(parent)
+ ent = Tk::BWidget::Entry.new(parent, :text=>'Press enter',
+ :helptext=>'Entry widtet',
+ :command=>proc{
+ @@var['entcmd'] = 'command called'
+ Tk.after(500, proc{@@var['entcmd'] = ''})
+ })
+
+ chk1 = TkCheckbutton.new(parent, :text=>'Disabled',
+ :variable=>@@var.ref(ent, 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
+ :command=>proc{ent.state = @@var[ent, 'state']})
+
+ chk2 = TkCheckbutton.new(parent, :text=>'Non editable',
+ :variable=>@@var.ref(ent, 'editable'),
+ :onvalue=>false, :offvalue=>true,
+ :command=>proc{
+ ent.editable = @@var[ent, 'editable']
+ })
+
+ lab = TkLabel.new(parent, :textvariable=>@@var.ref('entcmd'),
+ :foreground=>'red')
+
+ ent.pack(:pady=>4, :anchor=>:w)
+ Tk.pack(chk1, chk2, :anchor=>:w)
+ lab.pack(:pady=>4)
+ end
+
+ def self._button(parent)
+ frame = TkFrame.new(parent)
+ but = Tk::BWidget::Button.new(frame, :text=>'Press me!',
+ :repeatdelay=>300,
+ :command=>proc{_butcmd('command')},
+ :helptext=>'This is a Button widget')
+
+ sep1 = Tk::BWidget::Separator.new(frame, :orient=>:vertical)
+ arr1 = Tk::BWidget::ArrowButton.new(frame, :type=>:button,
+ :width=>25, :height=>25, :repeatdelay=>300,
+ :command=>proc{_butcmd('command')},
+ :helptext=>"This is an ArrowButton widget\nof type button")
+
+ sep2 = Tk::BWidget::Separator.new(frame, :orient=>:vertical)
+ arr2 = Tk::BWidget::ArrowButton.new(frame, :type=>:arrow,
+ :width=>25, :height=>25, :relief=>:sunken,
+ :ipadx=>0, :ipady=>0, :repeatdelay=>300,
+ :command=>proc{_butcmd('command')},
+ :helptext=>"This is an ArrowButton widget\nof type arrow")
+
+ but.pack(:side=>:left, :padx=>4)
+ sep1.pack(:side=>:left, :padx=>4, :fill=>:y)
+ arr1.pack(:side=>:left, :padx=>4)
+ sep2.pack(:side=>:left, :padx=>4, :fill=>:y)
+ arr2.pack(:side=>:left, :padx=>4)
+ frame.pack
+
+ Tk::BWidget::Separator.new(parent,
+ :orient=>:horizontal).pack(:fill=>:x, :pady=>10)
+
+ labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Command',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
+ subf = labf1.get_frame
+ chk1 = TkCheckbutton.new(subf, :text=>'Disabled',
+ :variable=>@@var.ref('bstate'),
+ :onvalue=>'disabled', :offvalue=>'normal',
+ :command=>proc{_bstate(@@var['bstate'],
+ but, arr1, arr2)})
+ chk2 = TkCheckbutton.new(subf, :text=>"Use armcommand/\ndisarmcommand",
+ :variable=>@@var.ref('barmcmd'),
+ :command=>proc{_barmcmd(@@var['barmcmd'],
+ but, arr1, arr2)})
+ Tk.pack(chk1, chk2, :anchor=>:w)
+
+ label = TkLabel.new(parent, :textvariable=>@@var.ref('butcmd'),
+ :foreground=>'red').pack(:side=>:bottom, :pady=>4)
+
+ labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Direction',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
+ subf = labf2.get_frame
+ @@var['bside'] = :top
+ [:top, :left, :bottom, :right].each{|dir|
+ TkRadiobutton.new(subf, :text=>"#{dir} arrow",
+ :variable=>@@var.ref('bside'), :value=>dir,
+ :command=>proc{_bside(@@var['bside'], arr1, arr2)}
+ ).pack(:anchor=>:w)
+ }
+
+ labf3 = Tk::BWidget::LabelFrame.new(parent, :text=>'Relief',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
+ subf = labf3.get_frame
+ @@var['brelief'] = :raised
+ [ %w(raised sunken ridge groove), %w(flat solid link)].each{|lrelief|
+ f = TkFrame.new(subf)
+ lrelief.each{|relief|
+ TkRadiobutton.new(f, :text=>relief,
+ :variable=>@@var.ref('brelief'), :value=>relief,
+ :command=>proc{
+ _brelief(@@var['brelief'], but, arr1, arr2)
+ }).pack(:anchor=>:w)
+ }
+ f.pack(:side=>:left, :padx=>2, :anchor=>:n)
+ }
+ Tk.pack(labf1, labf2, labf3, :side=>:left, :fill=>:y, :padx=>4)
+ end
+
+ def self._bstate(state, but, arr1, arr2)
+ [but, arr1, arr2].each{|b| b[:state] = state}
+ end
+
+ def self._brelief(relief, but, arr1, arr2)
+ but[:relief] = relief
+ if relief.to_s != 'link'
+ [arr1, arr2].each{|arr| arr[:relief] = relief}
+ end
+ end
+
+ def self._bside(side, *args)
+ args.each{|arr| arr[:dir] = side}
+ end
+
+ def self._barmcmd(value, but, arr1, arr2)
+ if TkComm.bool(value)
+ but.configure(:armcommand=>proc{_butcmd('arm')},
+ :disarmcommand=>proc{_butcmd('disarm')},
+ :command=>'')
+ [arr1, arr2].each{|arr|
+ arr.configure(:armcommand=>proc{_butcmd('arm')},
+ :disarmcommand=>proc{_butcmd('disarm')},
+ :command=>'')
+ }
+ else
+ but.configure(:armcommand=>'', :disarmcommand=>'',
+ :command=>proc{_butcmd('command')})
+ [arr1, arr2].each{|arr|
+ arr.configure(:armcommand=>'', :disarmcommand=>'',
+ :command=>proc{_butcmd('command')})
+ }
+ end
+ end
+
+ def self._butcmd(reason)
+ unless @@after
+ @@after = TkTimer.new(500, 1, proc{@@var['butcmd'] = ''})
+ end
+ @@after.stop
+ if (reason == 'arm')
+ @@count += 1
+ @@var['butcmd'] = "#{reason} command called (#{@@count})"
+ else
+ @@count = 0
+ @@var['butcmd'] = "#{reason} command called"
+ end
+ @@after.start
+ end
+end
diff --git a/ext/tk/sample/tkextlib/bwidget/bwidget.xbm b/ext/tk/sample/tkextlib/bwidget/bwidget.xbm
new file mode 100644
index 0000000000..5451ebb9c0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/bwidget.xbm
@@ -0,0 +1,46 @@
+#define bwidget_width 76
+#define bwidget_height 64
+static char bwidget_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0xb6,0x6d,0xdb,0x16,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0xdb,0xb6,0x6d,0xab,0x00,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x75,
+ 0x01,0x00,0x00,0x00,0xf0,0x00,0x6d,0xdb,0xb6,0xad,0x02,0x00,0x00,0x00,0xf0,
+ 0x00,0xb6,0x6d,0xdb,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x55,
+ 0x05,0x00,0x00,0x00,0xf0,0x00,0xda,0xb6,0xad,0x6d,0x0b,0x00,0x00,0x00,0xf0,
+ 0x00,0x6b,0x03,0xc0,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x56,0x05,0x00,0x55,
+ 0x0d,0x00,0x00,0x00,0xf0,0x00,0xbb,0x05,0x80,0xdb,0x06,0x00,0x00,0x00,0xf0,
+ 0x00,0xca,0x06,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,0x00,0xb6,0x02,0x00,0xaa,
+ 0x0a,0x00,0x00,0x00,0xf0,0x00,0xab,0x05,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,
+ 0x00,0xdd,0x06,0x00,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0x55,
+ 0x05,0x00,0x00,0x00,0xf0,0x00,0xb7,0x05,0xc0,0xda,0x02,0x00,0x00,0x00,0xf0,
+ 0x00,0xd9,0x06,0x50,0x6b,0x01,0x00,0x00,0x00,0xf0,0x00,0x56,0xb5,0xad,0xad,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0xdb,0xd6,0x76,0x15,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x6a,0xab,0xaa,0x2d,0x00,0x00,0x00,0x00,0xf0,0x00,0x56,0x75,0xad,0xb6,
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,0xb5,0xeb,0x5a,0x00,0x9f,0xcf,0xef,0x07,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0x8f,0xff,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x87,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0xff,0x03,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x03,0xff,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0xfc,0x01,0xff,0x03,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0};
diff --git a/ext/tk/sample/tkextlib/bwidget/demo.rb b/ext/tk/sample/tkextlib/bwidget/demo.rb
new file mode 100644
index 0000000000..3eb98818f3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/demo.rb
@@ -0,0 +1,243 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/bwidget'
+
+module DemoVar
+ @_wfont = nil
+ @notebook = nil
+ @mainframe = nil
+ @status = TkVariable.new
+ @prgtext = TkVariable.new
+ @prgindic = TkVariable.new
+ @font = nil
+ @font_name = nil
+ @toolbar1 = TkVariable.new(true)
+ @toolbar2 = TkVariable.new(true)
+end
+class << DemoVar
+ attr_accessor :_wfont, :notebook, :mainframe, :font, :font_name
+ attr_reader :status, :prgtext, :prgindic, :toolbar1, :toolbar2
+end
+
+class BWidget_Demo
+ DEMODIR = File.dirname(File.expand_path(__FILE__))
+
+ %w(manager basic select dnd tree tmpldlg).each{|f|
+ require File.join(DEMODIR, f << '.rb')
+ }
+
+ def initialize
+ TkOption.add('*TitleFrame.l.font', 'helvetica 11 bold italic')
+
+ root = TkRoot.new(:title=>'BWidget demo')
+ root.withdraw
+
+ _create
+
+ Tk::BWidget.place(root, 0, 0, :center)
+ root.deiconify
+ root.raise
+ root.focus(true)
+
+ root.geometry(root.geometry)
+ end
+
+ def _create
+ DemoVar.prgtext.value = 'Please wait while loading font...'
+ DemoVar.prgindic.value = -1
+
+ intro = _create_intro
+
+ Tk.update
+
+ Tk::BWidget::SelectFont.load_font
+
+ descmenu = [
+ '&File', 'all', 'file', 0, [
+ ['command', 'E&xit', [], 'Exit BWidget demo', [],
+ {:command=>proc{exit}}]
+ ],
+ '&Options', 'all', 'options', 0, [
+ ['checkbutton', 'Toolbar &1', ['all', 'option'],
+ 'Show/hide toolbar 1', [],
+ { :variable=>DemoVar.toolbar1,
+ :command=>proc{
+ DemoVar.mainframe.show_toolbar(0, DemoVar.toolbar1.value)
+ }
+ }
+ ],
+ ['checkbutton', 'Toolbar &2', ['all', 'option'],
+ 'Show/hide toolbar 2', [],
+ { :variable=>DemoVar.toolbar2,
+ :command=>proc{
+ DemoVar.mainframe.show_toolbar(1, DemoVar.toolbar2.value)
+ }
+ }
+ ]
+ ]
+ ]
+
+ DemoVar.prgtext.value = 'Creating MainFrame...'
+ DemoVar.prgindic.value = 0
+
+ DemoVar.mainframe = Tk::BWidget::MainFrame.new(
+ :menu=>descmenu,
+ :textvariable=>DemoVar.status,
+ :progressvar=>DemoVar.prgindic
+ )
+
+ # toobar 1 creation
+ DemoVar.prgindic.numeric += 1
+
+ DemoVar.mainframe.add_toolbar{|tb1|
+ Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox|
+ add(:image=>Tk::BWidget::Bitmap.new('new'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Create a new file" icon'},
+ :helptext=>"Create a new file")
+
+ add(:image=>Tk::BWidget::Bitmap.new('open'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Open an existing file" icon'},
+ :helptext=>"Open an existing file")
+
+ add(:image=>Tk::BWidget::Bitmap.new('save'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Save file" icon'},
+ :helptext=>"Save file")
+
+ pack(:side=>:left, :anchor=>:w)
+ }
+
+ Tk::BWidget::Separator.new(tb1, :orient=>:vertical){
+ pack(:side=>:left, :fill=>:y, :padx=>4, :anchor=>:w)
+ }
+
+ DemoVar.prgindic.numeric += 1
+
+ Tk::BWidget::ButtonBox.new(tb1, :spacing=>0, :padx=>1, :pady=>1){|bbox|
+ add(:image=>Tk::BWidget::Bitmap.new('cut'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Cut selection" icon'},
+ :helptext=>"Cut selection")
+
+ add(:image=>Tk::BWidget::Bitmap.new('copy'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Copy selection" icon'},
+ :helptext=>"Copy selection")
+
+ add(:image=>Tk::BWidget::Bitmap.new('paste'),
+ :highlightthickness=>0, :takefocus=>0, :relief=>:link,
+ :borderwidth=>1, :padx=>1, :pady=>1,
+ :command=>proc{puts 'select "Paste selection" icon'},
+ :helptext=>"Paste selection")
+
+ pack(:side=>:left, :anchor=>:w)
+ }
+ }
+
+ # toolbar 2 creation
+ DemoVar.prgindic.numeric += 1
+
+ tb2 = DemoVar.mainframe.add_toolbar
+ DemoVar._wfont = Tk::BWidget::SelectFont::Toolbar.new(tb2,
+ :command=>proc{update_font(DemoVar._wfont[:font])}
+ )
+ DemoVar.font = DemoVar._wfont[:font]
+ DemoVar._wfont.pack(:side=>:left, :anchor=>:w)
+
+ DemoVar.mainframe.add_indicator(
+ :text=>"BWidget #{Tk::BWidget.package_version}"
+ )
+ DemoVar.mainframe.add_indicator(:textvariable=>'tk_patchLevel')
+
+ # NoteBook creation
+ DemoVar.notebook = Tk::BWidget::NoteBook.new(DemoVar.mainframe.get_frame)
+
+ DemoVar.prgtext.value = "Creating Manager..."
+ DemoVar.prgindic.numeric += 1
+ DemoManager.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Creating Basic..."
+ DemoVar.prgindic.numeric += 1
+ DemoBasic.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Creating Select..."
+ DemoVar.prgindic.numeric += 1
+ DemoSelect.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Creating Dialog..."
+ DemoVar.prgindic.numeric += 1
+ DemoDialog.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Creating Drag and Drop..."
+ DemoVar.prgindic.numeric += 1
+ DemoDnD.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Creating Tree..."
+ DemoVar.prgindic.numeric += 1
+ DemoTree.create(DemoVar.notebook)
+
+ DemoVar.prgtext.value = "Done"
+ DemoVar.prgindic.numeric += 1
+
+ DemoVar.notebook.compute_size
+ DemoVar.notebook.pack(:fill=>:both, :expand=>true, :padx=>4, :pady=>4)
+ DemoVar.notebook.raise(DemoVar.notebook.get_page(0))
+
+ DemoVar.mainframe.pack(:fill=>:both, :expand=>true)
+
+ Tk.update_idletasks
+
+ intro.destroy
+ end
+
+ def update_font(newfont)
+ root = Tk.root
+ root[:cursor] = 'watch'
+ if newfont != '' && DemoVar.font != newfont
+ DemoVar._wfont[:font] = newfont
+ DemoVar.notebook[:font] = newfont
+ DemoVar.font = newfont
+ end
+ root[:cursor] = ''
+ end
+
+ def _create_intro
+ top = TkToplevel.new(:relief=>:raised, :borderwidth=>2)
+ top.withdraw
+ top.overrideredirect(true)
+
+ ximg = TkLabel.new(top, :bitmap=>"@#{File.join(DEMODIR,'x1.xbm')}",
+ :foreground=>'grey90', :background=>'white')
+ bwimg = TkLabel.new(ximg, :bitmap=>"@#{File.join(DEMODIR,'bwidget.xbm')}",
+ :foreground=>'grey90', :background=>'white')
+ frame = TkFrame.new(ximg, :background=>'white')
+ TkLabel.new(frame, :text=>'Loading demo',
+ :background=>'white', :font=>'times 8').pack
+ TkLabel.new(frame, :textvariable=>DemoVar.prgtext,
+ :background=>'white', :font=>'times 8', :width=>35).pack
+ Tk::BWidget::ProgressBar.new(frame, :width=>50, :height=>10,
+ :background=>'white',
+ :variable=>DemoVar.prgindic,
+ :maximum=>10).pack
+ frame.place(:x=>0, :y=>0, :anchor=>:nw)
+ bwimg.place(:relx=>1, :rely=>1, :anchor=>:se)
+ ximg.pack
+ Tk::BWidget.place(top, 0, 0, :center)
+ top.deiconify
+
+ top
+ end
+end
+
+module DemoVar
+ Demo = BWidget_Demo.new
+end
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/bwidget/dnd.rb b/ext/tk/sample/tkextlib/bwidget/dnd.rb
new file mode 100644
index 0000000000..b1b1cf60ff
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/dnd.rb
@@ -0,0 +1,46 @@
+#
+# dnd demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoDnD
+ def self.create(nb)
+ frame = nb.insert('end', 'demoDnD', :text=>'Drag and Drop')
+
+ titf1 = Tk::BWidget::TitleFrame.new(frame, :text=>'Drag source')
+ subf = titf1.get_frame
+
+ ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry',
+ :labelwidth=>14, :dragenabled=>true,
+ :dragevent=>3)
+ labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (text)',
+ :width=>14)
+ f = labf1.get_frame
+ lab = Tk::BWidget::Label.new(f, :text=>'Drag this text',
+ :dragenabled=>true, :dragevent=>3).pack
+
+ labf2 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label (bitmap)',
+ :width=>14)
+ f = labf2.get_frame
+ lab = Tk::BWidget::Label.new(f, :bitmap=>'info',
+ :dragenabled=>true, :dragevent=>3).pack
+
+ Tk.pack(ent1, labf1, labf2, :side=>:top, :fill=>:x, :pady=>4)
+
+ titf2 = Tk::BWidget::TitleFrame.new(frame, :text=>'Drop targets')
+ subf = titf2.get_frame
+
+ ent1 = Tk::BWidget::LabelEntry.new(subf, :label=>'Entry',
+ :labelwidth=>14, :dropenabled=>true)
+ labf1 = Tk::BWidget::LabelFrame.new(subf, :text=>'Label', :width=>14)
+ f = labf1.get_frame
+ lab = Tk::BWidget::Label.new(f, :dropenabled=>true,
+ :highlightthickness=>1).pack(:fill=>:x)
+ Tk.pack(ent1, labf1, :side=>:top, :fill=>:x, :pady=>4)
+ Tk.pack(titf1, titf2, :pady=>4)
+
+ frame
+ end
+end
diff --git a/ext/tk/sample/tkextlib/bwidget/manager.rb b/ext/tk/sample/tkextlib/bwidget/manager.rb
new file mode 100644
index 0000000000..a59afb8b86
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/manager.rb
@@ -0,0 +1,150 @@
+#
+# manager demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoManager
+ @@progress = TkVariable.new(false)
+ @@status = TkVariable.new('Compute in progress...')
+ @@homogeneous = TkVariable.new(false)
+ @@constw = TkVariable.new
+ @@afterobj = nil
+
+ def self.create(nb)
+ frame = nb.insert('end', 'demoManager', :text=>'Manager')
+
+ topf = TkFrame.new(frame)
+ titf1 = Tk::BWidget::TitleFrame.new(topf, :text=>"MainFrame")
+ titf2 = Tk::BWidget::TitleFrame.new(topf, :text=>"NoteBook")
+ titf3 = Tk::BWidget::TitleFrame.new(frame, :text=>"Paned & ScrolledWindow")
+
+ _mainframe(titf1.get_frame)
+ _notebook(titf2.get_frame)
+ _paned(titf3.get_frame)
+
+ Tk.pack(titf1, titf2, :padx=>4, :side=>:left, :fill=>:both, :expand=>true)
+ Tk.pack(topf, :fill=>:x, :pady=>2)
+ Tk.pack(titf3, :pady=>2, :padx=>4, :fill=>:both, :expand=>true)
+
+ frame
+ end
+
+ def self._mainframe(parent)
+ labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Toolbar',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>2)
+ subf = labf1.get_frame
+ chk1 = TkCheckbutton.new(subf, :text=>'View toolbar 1',
+ :variable=>DemoVar.toolbar1,
+ :command=>proc{
+ DemoVar.mainframe.show_toolbar(
+ 0, DemoVar.toolbar1.value
+ )
+ })
+ chk2 = TkCheckbutton.new(subf, :text=>'View toolbar 2',
+ :variable=>DemoVar.toolbar2,
+ :command=>proc{
+ DemoVar.mainframe.show_toolbar(
+ 1, DemoVar.toolbar2.value
+ )
+ })
+
+ Tk.pack(chk1, chk2, :anchor=>:w, :fill=>:x)
+ labf1.pack(:fill=>:both)
+
+ labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Status bar',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>2)
+ subf = labf2.get_frame
+ chk1 = TkCheckbutton.new(subf, :text=>"Show Progress\nindicator",
+ :justify=>:left, :variable=>@@progress,
+ :command=>proc{ _show_progress })
+ chk1.pack(:anchor=>:w, :fill=>:x)
+
+ Tk.pack(labf1, labf2, :side=>:left, :padx=>4, :fill=>:both)
+ end
+
+ def self._notebook(parent)
+ TkCheckbutton.new(parent, :text=>'Homogeneous label',
+ :variable=>@@homogeneous,
+ :command=>proc{
+ DemoVar.notebook[:homogeneous] = @@homogeneous.value
+ }).pack(:side=>:left, :anchor=>:n, :fill=>:x)
+ end
+
+ def self._paned(parent)
+ pw1 = Tk::BWidget::PanedWindow.new(parent, :side=>:top)
+ pane = pw1.add(:minsize=>100)
+
+ pw2 = Tk::BWidget::PanedWindow.new(pane, :side=>:left)
+ pane1 = pw2.add(:minsize=>100)
+ pane2 = pw2.add(:minsize=>100)
+
+ pane3 = pw1.add(:minsize=>100)
+
+ [pane1, pane2].each{|pane|
+ sw = Tk::BWidget::ScrolledWindow.new(pane)
+ lb = TkListbox.new(sw, :height=>8, :width=>20, :highlightthickness=>0)
+ (1..8).each{|i| lb.insert('end', "Valur #{i}") }
+ sw.set_widget(lb)
+ sw.pack(:fill=>:both, :expand=>true)
+ }
+
+ sw = Tk::BWidget::ScrolledWindow.new(pane3, :relief=>:sunken,
+ :borderwidth=>2)
+ sf = Tk::BWidget::ScrollableFrame.new(sw)
+ sw.set_widget(sf)
+ subf = sf.get_frame
+ lab = TkLabel.new(subf, :text=>'This is a ScrollableFrame')
+ chk = TkCheckbutton.new(subf, :text=>'Constrained with',
+ :variable=>@@constw, :command=>proc{
+ sf['constrainedwidth'] = @@constw.value
+ })
+ lab.pack
+ chk.pack(:anchor=>:w)
+ chk.bind('FocusIn', proc{sf.see(chk)})
+ (0..20).each{|i|
+ ent = TkEntry.new(subf, :width=>50).pack(:fill=>:x, :pady=>4)
+ ent.bind('FocusIn', proc{sf.see(ent)})
+ ent.insert('end', "Text field #{i}")
+ }
+
+ Tk.pack(sw, pw2, pw1, :fill=>:both, :expand=>true)
+ end
+
+ def self._show_progress
+ unless @@afterobj
+ @@afterobj = TkTimer.new(30, -1, proc{_update_progress})
+ end
+ if @@progress.bool
+ DemoVar.status.value = 'Compute in progress...'
+ DemoVar.prgindic.value = 0
+ DemoVar.mainframe.show_statusbar(:progression)
+ @@afterobj.start unless @@afterobj.running?
+ else
+ DemoVar.status.value = ''
+ DemoVar.mainframe.show_statusbar(:status)
+ @@afterobj.stop
+ end
+ end
+
+ def self._update_progress
+ if @@progress.bool
+ if DemoVar.prgindic.numeric < 100
+ DemoVar.prgindic.numeric += 5
+ else
+ @@progress.value = false
+ DemoVar.mainframe.show_statusbar(:status)
+ DemoVar.status.value = 'Done'
+ @@afterobj.stop
+ Tk.after(500, proc{ DemoVar.status.value = '' })
+ end
+ else
+ @@afterobj.stop
+ end
+ end
+
+end
+
diff --git a/ext/tk/sample/tkextlib/bwidget/select.rb b/ext/tk/sample/tkextlib/bwidget/select.rb
new file mode 100644
index 0000000000..3a1a810e14
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/select.rb
@@ -0,0 +1,82 @@
+#
+# select demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoSelect
+ @@var = TkVariable.new_hash
+
+ def self.create(nb)
+ frame = nb.insert('end', 'demoSelect', :text=>'Spin & Combo')
+
+ titf1 = Tk::BWidget::TitleFrame.new(frame, :text=>'SpinBox')
+ subf = titf1.get_frame
+ spin = Tk::BWidget::SpinBox.new(subf, :range=>[1, 100, 1],
+ :textvariable=>@@var.ref('spin', 'var'),
+ :helptext=>'This is the SpinBox')
+ ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var',
+ :labelwidth=>10, :labelanchor=>:w,
+ :textvariable=>@@var.ref('spin', 'var'),
+ :editable=>0,
+ :helptext=>"This is an Entry reflecting\nthe linked var of SpinBox")
+ labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1,
+ :helptext=>'Modify some options of SpinBox')
+ subf = labf.get_frame
+ chk1 = TkCheckbutton.new(subf, :text=>'Non editable',
+ :variable=>@@var.ref('spin', 'editable'),
+ :onvalue=>false, :offvalue=>true,
+ :command=>proc{
+ spin.editable(@@var['spin', 'editable'])
+ })
+ chk2 = TkCheckbutton.new(subf, :text=>'Disabled',
+ :variable=>@@var.ref('spin', 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
+ :command=>proc{
+ spin.state(@@var['spin', 'state'])
+ })
+ Tk.pack(chk1, chk2, :side=>:left, :anchor=>:w)
+ Tk.pack(spin, ent, labf, :pady=>4, :fill=>:x)
+ titf1.pack
+
+ titf2 = Tk::BWidget::TitleFrame.new(frame, :text=>'ComboBox')
+ subf = titf2.get_frame
+ combo = Tk::BWidget::ComboBox.new(subf,
+ :textvariable=>@@var.ref('combo', 'var'),
+ :values=>[
+ 'first value', 'second value',
+ 'third value', 'fourth value',
+ 'fifth value'
+ ],
+ :helptext=>'This is the ComboBox')
+ ent = Tk::BWidget::LabelEntry.new(subf, :label=>'Linked var',
+ :labelwidth=>10, :labelanchor=>:w,
+ :textvariable=>@@var.ref('combo', 'var'),
+ :editable=>0, :helptext=>"This is an Entry reflecting\nthe linked var of ComboBox")
+ labf = Tk::BWidget::LabelFrame.new(subf, :text=>'Options', :side=>:top,
+ :anchor=>:w, :relief=>:sunken,
+ :borderwidth=>1, :helptext=>'Modify some options of ComboBox')
+ subf = labf.get_frame
+ chk1 = TkCheckbutton.new(subf, :text=>'Non editable',
+ :variable=>@@var.ref('combo', 'editable'),
+ :onvalue=>false, :offvalue=>true,
+ :command=>proc{
+ combo.editable(@@var['combo', 'editable'])
+ })
+ chk2 = TkCheckbutton.new(subf, :text=>'Disabled',
+ :variable=>@@var.ref('combo', 'state'),
+ :onvalue=>'disabled', :offvalue=>'normal',
+ :command=>proc{
+ combo.state(@@var['combo', 'state'])
+ })
+
+ Tk.pack(chk1, chk2, :side=>:left, :anchor=>:w)
+ Tk.pack(combo, ent, labf, :pady=>4, :fill=>:x)
+ Tk.pack(titf1, titf2, :pady=>4)
+
+ frame
+ end
+end
diff --git a/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
new file mode 100644
index 0000000000..da2c9678c0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb
@@ -0,0 +1,221 @@
+#
+# templdlg demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoDialog
+ @@tmpl = TkVariable.new_hash
+ @@msg = TkVariable.new_hash
+ @@msgdlg = nil
+ @@progmsg = TkVariable.new
+ @@progval = TkVariable.new
+ @@progdlg = nil
+ @@resources = TkVariable.new('en')
+
+ def self.create(nb)
+ frame = nb.insert('end', 'demoDlg', :text=>'Dialog')
+
+ titf1 = Tk::BWidget::TitleFrame.new(frame, :text=>'Resources')
+ titf2 = Tk::BWidget::TitleFrame.new(frame, :text=>'Template Dialog')
+ titf3 = Tk::BWidget::TitleFrame.new(frame, :text=>'Message Dialog')
+ titf4 = Tk::BWidget::TitleFrame.new(frame, :text=>'Other dialog')
+
+ subf = titf1.get_frame
+ cmd = proc{ TkOption.read_file(File.join(Tk::BWidget::LIBRARY, 'lang',
+ @@resources.value + '.rc')) }
+ Tk.pack(TkRadiobutton.new(subf, :text=>'English', :value=>'en',
+ :variable=>@@resources, :command=>cmd),
+ TkRadiobutton.new(subf, :text=>'French', :value=>'fr',
+ :variable=>@@resources, :command=>cmd),
+ TkRadiobutton.new(subf, :text=>'German', :value=>'de',
+ :variable=>@@resources, :command=>cmd),
+ :side=>:left)
+
+ _tmpldlg(titf2.get_frame)
+ _msgdlg(titf3.get_frame)
+ _stddlg(titf4.get_frame)
+
+ titf1.pack(:fill=>:x, :pady=>2, :padx=>2)
+ titf4.pack(:side=>:bottom, :fill=>:x, :pady=>2, :padx=>2)
+ Tk.pack(titf2, titf3, :side=>:left, :padx=>2, :fill=>:both, :expand=>true)
+ end
+
+ def self._tmpldlg(parent)
+ @@tmpl['side'] = :bottom
+ @@tmpl['anchor'] = :c
+
+ labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button side',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
+ subf = labf1.get_frame
+ Tk.pack(TkRadiobutton.new(subf, :text=>'Bottom', :value=>:bottom,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Left', :value=>:left,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Right', :value=>:right,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Top', :value=>:top,
+ :variable=>@@tmpl.ref('side'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
+
+ labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Button anchor',
+ :side=>:top, :anchor=>:w,
+ :relief=>:sunken, :borderwidth=>1)
+ subf = labf2.get_frame
+ Tk.pack(TkRadiobutton.new(subf, :text=>'North', :value=>:n,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'West', :value=>:w,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'East', :value=>:e,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'South', :value=>:s,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Center', :value=>:c,
+ :variable=>@@tmpl.ref('anchor'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
+
+ sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal)
+ button = TkButton.new(parent, :text=>'Show', :command=>proc{_show_tmpldlg})
+
+ button.pack(:side=>:bottom)
+ sep.pack(:side=>:bottom, :fill=>:x, :pady=>10)
+ Tk.pack(labf1, labf2, :side=>:left, :padx=>4, :anchor=>:n)
+ end
+
+ def self._msgdlg(parent)
+ @@msg['type'] = 'ok'
+ @@msg['icon'] = 'info'
+
+ labf1 = Tk::BWidget::LabelFrame.new(parent, :text=>'Type', :side=>:top,
+ :anchor=>:w, :relief=>:sunken,
+ :borderwidth=>1)
+ subf = labf1.get_frame
+ Tk.pack(TkRadiobutton.new(subf, :text=>'Ok', :value=>'ok',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Ok, Cancel', :value=>'okcancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Retry, Cancel',
+ :value=>'retrycancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Yes, No', :value=>'yesno',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Yes, No, Cancel',
+ :value=>'yesnocancel',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Abort, Retry, Ignore',
+ :value=>'abortretryignore',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
+
+ Tk.pack(TkRadiobutton.new(subf, :text=>'User', :value=>'user',
+ :variable=>@@msg.ref('type'), :anchor=>:w),
+ Tk::BWidget::Entry.new(subf, :textvariable=>@@msg.ref('buttons')),
+ :side=>:left)
+
+ labf2 = Tk::BWidget::LabelFrame.new(parent, :text=>'Icon', :side=>:top,
+ :anchor=>:w, :relief=>:sunken,
+ :borderwidth=>1)
+ subf = labf2.get_frame
+ Tk.pack(TkRadiobutton.new(subf, :text=>'Information', :value=>'info',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Question', :value=>'question',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Warning', :value=>'warning',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ TkRadiobutton.new(subf, :text=>'Error', :value=>'error',
+ :variable=>@@msg.ref('icon'), :anchor=>:w),
+ :fill=>:x, :anchor=>:w)
+
+ sep = Tk::BWidget::Separator.new(parent, :orient=>:horizontal)
+ button = TkButton.new(parent, :text=>'Show', :command=>proc{_show_msgdlg})
+
+ button.pack(:side=>:bottom)
+ sep.pack(:side=>:bottom, :fill=>:x, :pady=>10)
+ Tk.pack(labf1, labf2, :side=>:left, :padx=>4, :anchor=>:n)
+ end
+
+ def self._stddlg(parent)
+ Tk.pack(TkButton.new(parent, :text=>'Select a color '){|w|
+ command(proc{DemoDialog._show_color(w)})
+ },
+ TkButton.new(parent, :text=>'Font selector dialog',
+ :command=>proc{_show_fontdlg}),
+ TkButton.new(parent, :text=>'Progression dialog',
+ :command=>proc{_show_progdlg}),
+ TkButton.new(parent, :text=>'Password dialog',
+ :command=>proc{_show_passdlg}),
+ :side=>:left, :padx=>5, :anchor=>:w)
+ end
+
+ def self._show_color(w)
+ dlg = Tk::BWidget::SelectColor.new(w, :color=>w.background)
+ color = dlg.menu([:below, w])
+ unless color.empty?
+ w.background(color)
+ end
+ end
+
+ def self._show_tmpldlg
+ dlg = Tk::BWidget::Dialog.new(:relative=>Tk.root, :modal=>:local,
+ :separator=>true, :title=>'Template dialog',
+ :side=>@@tmpl['side'],
+ :anchor=>@@tmpl['anchor'],
+ :default=>0, :cancel=>1)
+ dlg.add('name'=>'ok')
+ dlg.add('name'=>'cancel')
+ TkMessage.new(dlg.get_frame, :text=>"Template\nDialog", :justify=>:center,
+ :anchor=>:c, :width=>80).pack(:fill=>:both, :expand=>true,
+ :padx=>100, :pady=>100)
+ dlg.draw
+ dlg.destroy
+ end
+
+ def self._show_msgdlg
+ @@msgdlg.destroy if @@msgdlg
+ @@msgdlg = Tk::BWidget::MessageDlg.new(:relative=>Tk.root,
+ :message=>'Message for MessageBox',
+ :type=>@@msg['type'],
+ :icon=>@@msg['icon'],
+ :buttons=>@@msg['buttons'])
+ @@msgdlg.create
+ end
+
+ def self._show_fontdlg
+ font = Tk::BWidget::SelectFont.new(:relative=>Tk.root,
+ :font=>DemoVar.font).create
+ DemoVar::Demo.update_font(font)
+ end
+
+ def self._show_progdlg
+ @@progmsg.value = "Compute in progress..."
+ @@progval.value = 0
+
+ @@progdlg = Tk::BWidget::ProgressDlg.new(:relative=>Tk.root,
+ :title=>'Wait...',
+ :type=>'infinite', :width=>20,
+ :textvariable=>@@progmsg,
+ :variable=>@@progval,
+ :stop=>'Stop') {
+ command(proc{self.destroy})
+ create
+ }
+ _update_progdlg
+ end
+
+ def self._update_progdlg
+ TkTimer.new(20, -1, proc{
+ if @@progdlg && @@progdlg.winfo_exist?
+ @@progval.value = 2
+ else
+ stop
+ end
+ }).start
+ end
+
+ def self._show_passdlg
+ Tk::BWidget::PasswdDlg.new(:relative=>Tk.root).create
+ end
+end
+
diff --git a/ext/tk/sample/tkextlib/bwidget/tree.rb b/ext/tk/sample/tkextlib/bwidget/tree.rb
new file mode 100644
index 0000000000..9ef6569d16
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/tree.rb
@@ -0,0 +1,289 @@
+#
+# templdlg demo --- called from demo.rb
+#
+unless Object.const_defined?('DemoVar')
+ fail RuntimeError, "This is NOT a stand alone script. This script is called from 'demo.rb'. "
+end
+
+module DemoTree
+ @@count = 0
+ @@dblclick = false
+ @@top = nil
+
+ def self.create(nb)
+ frame = nb.insert('end', 'demoTree', :text=>'Tree')
+ pw = Tk::BWidget::PanedWindow.new(frame, :side=>:top)
+
+ pane = pw.add(:weight=>1)
+ title = Tk::BWidget::TitleFrame.new(pane, :text=>'Directory tree')
+ sw = Tk::BWidget::ScrolledWindow.new(title.get_frame,
+ :relief=>:sunken, :borderwidth=>2)
+ tree = Tk::BWidget::Tree.new(sw, :relief=>:flat, :borderwidth=>0,
+ :width=>15, :highlightthickness=>0,
+ :redraw=>false, :dropenabled=>true,
+ :dragenabled=>true, :dragevent=>3,
+ :droptypes=>[
+ 'TREE_NODE', [
+ :copy, [],
+ :move, [],
+ :link, []
+ ],
+ 'LISTBOX_ITEM', [
+ :copy, [],
+ :move, [],
+ :link, []
+ ]
+ ],
+ :opencmd=>proc{|node|
+ moddir(1, tree, node)
+ },
+ :closecmd=>proc{|node|
+ moddir(0, tree, node)
+ })
+ sw.set_widget(tree)
+
+ sw.pack(:side=>:top, :expand=>true, :fill=>:both)
+ title.pack(:fill=>:both, :expand=>true)
+
+ pane = pw.add(:weight=>2)
+ lf = Tk::BWidget::TitleFrame.new(pane, :text=>'Content')
+ sw = Tk::BWidget::ScrolledWindow.new(lf.get_frame,
+ :scrollbar=>:horizontal,
+ :auto=>:none, :relief=>:sunken,
+ :borderwidth=>2)
+
+ list = Tk::BWidget::ListBox.new(sw, :relief=>:flat, :borderwidth=>0,
+ :highlightthickness=>0, :width=>20,
+ :multicolumn=>true, :redraw=>false,
+ :dragevent=>3, :dropenabled=>true,
+ :dragenabled=>true,
+ :droptypes=>[
+ 'TREE_NODE', [
+ :copy, [],
+ :move, [],
+ :link, []
+ ],
+ 'LISTBOX_ITEM', [
+ :copy, [],
+ :move, [],
+ :link, []
+ ]
+ ])
+ sw.set_widget(list)
+
+ Tk.pack(sw, lf, :fill=>:both, :expand=>true)
+
+ pw.pack(:fill=>:both, :expand=>true)
+
+ tree.textbind('ButtonPress-1',
+ proc{|node, ev| select('tree', 1, tree, list, node)})
+ tree.textbind('Double-ButtonPress-1',
+ proc{|node, ev| select('tree', 2, tree, list, node)})
+
+ list.textbind('ButtonPress-1',
+ proc{|node, ev| select('list', 1, tree, list, node)})
+ list.textbind('Double-ButtonPress-1',
+ proc{|node, ev| select('list', 2, tree, list, node)})
+
+ list.imagebind('Double-ButtonPress-1',
+ proc{|node, ev| select('list', 2, tree, list, node)})
+
+ nb.itemconfigure('demoTree',
+ :createcmd=>proc{|*args| init(tree, list, *args)},
+ :raisecmd=>proc{
+ Tk.root.geometry =~
+ /\d+x\d+([+-]{1,2}\d+)([+-]{1,2}\d+)/
+ global_w = ($1 || 0).to_i
+ global_h = ($2 || 0).to_i
+ if @@top
+ Tk::BWidget.place(@@top, 0, 0, :at,
+ global_w - Tk.root.winfo_screenwidth, global_h)
+ @@top.deiconify
+ Tk.root.bind('Unmap', proc{@@top.withdraw})
+ Tk.root.bind('Map', proc{@@top.deiconify})
+ Tk.root.bind('Configure', proc{|w|
+ if w == Tk.root
+ Tk.root.geometry =~
+ /\d+x\d+([+-]{1,2}\d+)([+-]{1,2}\d+)/
+ global_w = ($1 || 0).to_i
+ global_h = ($2 || 0).to_i
+ Tk::BWidget.place(@@top, 0, 0, :at,
+ global_w - Tk.root.winfo_screenwidth,
+ global_h)
+ end
+ }, '%W')
+ end
+ },
+ :leavecmd=>proc{
+ @@top.withdraw if @@top
+ Tk.root.bind_remove('Unmap')
+ Tk.root.bind_remove('Map')
+ Tk.root.bind_remove('Configure')
+ true
+ })
+ end
+
+ def self.init(tree, list, *args)
+ @@count = 0
+ if Tk::PLATFORM['platform'] == 'unix'
+ rootdir = File.expand_path('~')
+ else
+ rootdir = 'c:'
+ end
+
+ tree.insert('end', 'root', 'home',
+ :text=>rootdir, :data=>rootdir, :open=>true,
+ :image=>Tk::BWidget::Bitmap.new('openfold'))
+ getdir(tree, 'home', rootdir)
+ select('tree', 1, tree, list, 'home')
+ tree.redraw(true)
+ list.redraw(true)
+
+ @@top = TkToplevel.new
+ @@top.withdraw
+ @@top.protocol('WM_DELETE_WINDOW'){
+ # don't kill me
+ }
+ @@top.resizable(false, false)
+ @@top.title('Drag rectangle to scroll directory tree')
+ @@top.transient(Tk.root)
+ Tk::BWidget::ScrollView.new(@@top, :window=>tree, :fill=>'white',
+ :width=>300, :height=>300, :relief=>:sunken,
+ :bd=>1).pack(:fill=>:both, :expand=>true)
+ end
+
+ def self.getdir(tree, node, path)
+ lentries = Dir.glob(File.join(path, '*')).sort
+ lfiles = []
+ lentries.each{|f|
+ basename = File.basename(f)
+ if File.directory?(f)
+ Tk::BWidget::Tree::Node.new(tree, node,
+ :index=>'end', :text=>basename,
+ :image=>Tk::BWidget::Bitmap.new('folder'),
+ :drawcross=>:allways, :data=>f)
+ @@count += 1
+ else
+ lfiles << basename
+ end
+ }
+ tree.itemconfigure(node, :drawcross=>:auto, :data=>lfiles)
+ end
+
+ def self.moddir(idx, tree, node)
+ if (idx != 0 && tree.itemcget(node, :drawcross).to_s == 'allways')
+ getdir(tree, node, tree.itemcget(node, :data))
+ if tree.nodes(node).empty?
+ tree.itemconfigure(node, :image=>Tk::BWidget::Bitmap.new('folder'))
+ else
+ tree.itemconfigure(node, :image=>Tk::BWidget::Bitmap.new('openfold'))
+ end
+ else
+ img = %w(folder openfold)[idx] || 'openfold'
+ tree.itemconfigure(node, :image=>Tk::BWidget::Bitmap.new(img))
+ end
+ end
+
+ def self.select(where, num, tree, list, node)
+ @@dblclick = true
+ if num == 1
+ if (where == 'tree' &&
+ tree.selection_get.find{|x|
+ TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
+ })
+ @@dblclick = false
+ Tk.after(500, proc{edit('tree', tree, list, node)})
+ return
+ end
+ if (where == 'list' &&
+ list.selection_get.find{|x|
+ TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
+ })
+ @@dblclick = false
+ Tk.after(500, proc{edit('list', tree, list, node)})
+ return
+ end
+ if where == 'tree'
+ select_node(tree, list, node)
+ else
+ list.selection_set(node)
+ end
+ elsif (where == 'list' && tree.exist?(node))
+ parent = tree.parent(node)
+ while TkUtil._get_eval_string(parent) != 'root'
+ tree.itemconfigure(parent, :open=>true)
+ parent = tree.parent(parent)
+ end
+ select_node(tree, list, node)
+ end
+ end
+
+ def self.select_node(tree, list, node)
+ tree.selection_set(node)
+ Tk.update
+ list.delete(*(list.items(0, 'end')))
+
+ dir = tree.itemcget(node, :data)
+ if tree.itemcget(node, :drawcross).to_s == 'allways'
+ getdir(tree, node, dir)
+ dir = tree.itemcget(node, :data)
+ end
+
+ tree.nodes(node).each{|subnode|
+ list.insert('end', subnode,
+ :text=>tree.itemcget(subnode, :text),
+ :image=>Tk::BWidget::Bitmap.new('folder'))
+ }
+
+ TkComm.simplelist(dir).each{|f|
+ Tk::BWidget::ListBox::Item.new(list, 'end', :text=>f,
+ :image=>Tk::BWidget::Bitmap.new('file'))
+ }
+ end
+
+ def self.edit(where, tree, list, node)
+ return if @@dblclick
+
+ if (where == 'tree' &&
+ tree.selection_get.find{|x|
+ TkUtil._get_eval_string(x) == TkUtil._get_eval_string(node)
+ })
+ res = tree.edit(node, tree.itemcget(node, :text))
+ if res != ''
+ tree.itemconfigure(node, :text=>res)
+ if list.exist?(node)
+ list.itemconfigure(node, :text=>res)
+ end
+ tree.selection_set(node)
+ end
+ return
+ end
+
+ if (where == 'list')
+ res = list.edit(node, list.igemcget(node, :text))
+ if res != ''
+ list.itemconfigure(node, :text=>res)
+ if tree.exist?(node)
+ tree.itemconfigure(node, :text=>res)
+ else
+ cursel = tree.selection_get[0]
+ index = list.index(node) - tree.nodes(cursel).size
+ data = TkComm.simplelist(tree.itemcget(cursel, :data))
+ data[index] = res
+ tree.itemconfigure(cursel, :date=>data)
+ end
+ list.selection_set(node)
+ end
+ end
+ end
+
+ def self.expand(tree, but)
+ unless (cur = tree.selection_get).empty?
+ if TkComm.bool(but)
+ tree.opentree(cur)
+ else
+ tree.closetree(cur)
+ end
+ end
+ end
+end
diff --git a/ext/tk/sample/tkextlib/bwidget/x1.xbm b/ext/tk/sample/tkextlib/bwidget/x1.xbm
new file mode 100644
index 0000000000..6137a118f8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/bwidget/x1.xbm
@@ -0,0 +1,2258 @@
+#define x1_width 626
+#define x1_height 428
+static char x1_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x03,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0xf8,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0x3f,0x00,0x00,0x00,0xc0,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0xfc,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0xf8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0xfe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x80,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xc0,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xfc,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0xfe,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x80,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xc0,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xfd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0x01,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x01,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0x7f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0x3f,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0x1f,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xff,0x1f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0x0f,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x07,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x07,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0x03,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0x01,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x01,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0x7f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0x7f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x3f,0x00,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x06,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xfd,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xfc,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfc,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0xfc,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfc,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xfc,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0xfc,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xfc,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0xfc,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0xfc,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xfc,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xfc,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0xfc,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0xfc,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfc,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xfc,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0xfc,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xfc,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xfc,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0xfc,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0xfc,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xfc,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0xfc,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0xfc,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0xfc,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfc,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfc,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0xfc,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0xfc,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0xfc,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0xfc,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0xfc,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xfc,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xfc,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0xfc,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0xfc,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xfc,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xfc,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0xfc,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0xfc,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xfc,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0xfc,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0xfc,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0xfc,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0xfc,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0xfc,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0xfc,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xfc,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xfc,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0xfc,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0xfc,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfc,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xfc,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0xfc,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0xfc,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xfc,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xfc,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0xfc,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0xfc,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xfc,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xfc,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0xfc,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0xfc,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0xfc,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xfc,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xfc,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0xfc,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0xfc,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0xfc,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0xfc,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0xc0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xc0,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xe0,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0xf0,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xf8,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xfc,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0xfc,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0xfe,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x80,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0xc0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xe0,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0xf8,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xfc,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0x07,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0xff,0xff,0x03,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0x01,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x3f,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x3f,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0x1f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x0f,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0x7f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x1f,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0x03,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0x03,0x00,
+ 0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xc0,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x7f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xf8,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
+ 0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x01,0x00,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0x1f,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0x01,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xc0,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0x7f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xf8,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xfc,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfe,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x07,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0xc0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x80,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf8,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0xf8,
+ 0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,
+ 0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x80,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x80,0x0f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0xc0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x80,
+ 0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xfc};
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt
new file mode 100644
index 0000000000..8392da7cec
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt
@@ -0,0 +1,42 @@
+
+ #######################################################################
+ ### The following text is the original 'license.terms' of iwidgets ###
+ ### extension. ###
+ ### Original Tcl source files are not include in this directory, ###
+ ### because of all of them are rewritten to Ruby files. ###
+ ### However, the image data files in the 'images' directory are ###
+ ### quoted from iwidgets source archive. ###
+ #######################################################################
+
+
+This software is copyrighted by DSC Technologies and private individual
+contributors. The copyright holder is specifically listed in the header
+of each file. The following terms apply to all files associated with the
+software unless explicitly disclaimed in individual files by private
+contributors.
+
+Copyright 1997 DSC Technologies Corporation
+
+Permission to use, copy, modify, distribute and license this software and
+its documentation for any purpose, and without fee or written agreement
+with DSC, is hereby granted, provided that the above copyright notice
+appears in all copies and that both the copyright notice and warranty
+disclaimer below appear in supporting documentation, and that the names of
+DSC Technologies Corporation or DSC Communications Corporation not be used
+in advertising or publicity pertaining to the software without specific,
+written prior permission.
+
+DSC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND NON-INFRINGEMENT.
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND
+DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ENHANCEMENTS, OR MODIFICATIONS. IN NO EVENT SHALL DSC BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+RESTRICTED RIGHTS: Use, duplication or disclosure by the government
+is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
+of the Rights in Technical Data and Computer Software Clause as DFARS
+252.227-7013 and FAR 52.227-19.
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/box.xbm b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/box.xbm
new file mode 100644
index 0000000000..7498e15de2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/box.xbm
@@ -0,0 +1,14 @@
+#define Tool_32_box_width 32
+#define Tool_32_box_height 32
+static unsigned char Tool_32_box_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x20, 0x00, 0x00, 0x08,
+ 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08,
+ 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08,
+ 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08,
+ 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08,
+ 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x08,
+ 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif
new file mode 100644
index 0000000000..bd45628aa7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gif
new file mode 100644
index 0000000000..f91b9e9d1e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gif
new file mode 100644
index 0000000000..7319f1dcb0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gif
new file mode 100644
index 0000000000..4258b17591
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gif
new file mode 100644
index 0000000000..e462be033f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gif
new file mode 100644
index 0000000000..dddcb8044b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gif
new file mode 100644
index 0000000000..bc8f18c00d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/line.xbm b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/line.xbm
new file mode 100644
index 0000000000..4622ae978b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/line.xbm
@@ -0,0 +1,14 @@
+#define lineOp_width 32
+#define lineOp_height 32
+static unsigned char lineOp_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
+ 0xf0, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00,
+ 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3c, 0x00,
+ 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0x01,
+ 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x0f,
+ 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gif
new file mode 100644
index 0000000000..4a5be66e76
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gif
new file mode 100644
index 0000000000..9c68ad35f5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gif
new file mode 100644
index 0000000000..bed862c8c4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/oval.xbm b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/oval.xbm
new file mode 100644
index 0000000000..856bd43785
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/oval.xbm
@@ -0,0 +1,14 @@
+#define ovalOp_width 32
+#define ovalOp_height 32
+static unsigned char ovalOp_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00,
+ 0x00, 0x1c, 0x70, 0x00, 0x00, 0x03, 0x80, 0x01, 0x80, 0x00, 0x00, 0x02,
+ 0x40, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x10,
+ 0x10, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x20,
+ 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x10,
+ 0x10, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x04,
+ 0x80, 0x00, 0x00, 0x02, 0x00, 0x03, 0x80, 0x01, 0x00, 0x1c, 0x70, 0x00,
+ 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gif
new file mode 100644
index 0000000000..9974f23bf5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/points.xbm b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/points.xbm
new file mode 100644
index 0000000000..c50aa4c5f3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/points.xbm
@@ -0,0 +1,14 @@
+#define dotPencilOp_width 32
+#define dotPencilOp_height 32
+static unsigned char dotPencilOp_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x12, 0x00,
+ 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x80, 0x04, 0x00,
+ 0x00, 0x80, 0x04, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
+ 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00,
+ 0x00, 0x90, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00,
+ 0x00, 0x24, 0x00, 0x18, 0x00, 0x24, 0x00, 0x18, 0x00, 0x12, 0x00, 0x00,
+ 0x00, 0x12, 0x00, 0x30, 0x00, 0x0e, 0x00, 0x30, 0x00, 0x06, 0x00, 0x00,
+ 0x00, 0x06, 0x0c, 0x30, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x30, 0xa0, 0x01,
+ 0x00, 0x60, 0xb0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gif
new file mode 100644
index 0000000000..2b595bb9b7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gif
new file mode 100644
index 0000000000..d321f17457
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gif
new file mode 100644
index 0000000000..00d26febf6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gif
new file mode 100644
index 0000000000..d1ceb1a5c4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gif b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gif
new file mode 100644
index 0000000000..f885c9ca5f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/text.xbm b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/text.xbm
new file mode 100644
index 0000000000..ffb0686303
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/text.xbm
@@ -0,0 +1,14 @@
+#define font_edit_width 32
+#define font_edit_height 32
+static unsigned char font_edit_bits[] = {
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x1c,
+ 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x80, 0x7b,
+ 0x00, 0x00, 0x80, 0x7e, 0x00, 0x00, 0xc0, 0xfd, 0x00, 0x00, 0x60, 0xfb,
+ 0x00, 0x00, 0xb0, 0xf7, 0x00, 0x00, 0xd0, 0xef, 0x00, 0x00, 0xf8, 0xdf,
+ 0x00, 0x00, 0xd4, 0x7f, 0x00, 0x00, 0xaa, 0x1f, 0x00, 0x00, 0x15, 0x0f,
+ 0x00, 0x80, 0x82, 0x06, 0x03, 0x40, 0x01, 0x01, 0x07, 0xa0, 0x80, 0x00,
+ 0x0f, 0x10, 0x40, 0x00, 0x1f, 0x08, 0x20, 0x00, 0x3b, 0xe4, 0x1f, 0x00,
+ 0x73, 0x1a, 0x00, 0x00, 0xe3, 0x07, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00,
+ 0xe3, 0x03, 0x00, 0x00, 0x7b, 0x07, 0x00, 0x00, 0x1f, 0x06, 0x00, 0x00,
+ 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
new file mode 100644
index 0000000000..2b7cd45205
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# sample 1
+p bb1 = Tk::Iwidgets::Buttonbox.new
+p bb1.add('Yes', :text=>'Yes', :command=>proc{puts 'Yes'})
+p bb1.add('No', :text=>'No', :command=>proc{puts 'No'})
+p bb1.add('Maybe', :text=>'Maybe', :command=>proc{puts 'Maybe'})
+bb1.default('Yes')
+bb1.pack(:expand=>true, :fill=>:both, :pady=>5)
+print "\n"
+
+# sample 2
+p bb2 = Tk::Iwidgets::Buttonbox.new
+p btn1 = bb2.add(:text=>'Yes', :command=>proc{puts 'Yes'})
+p btn2 = bb2.add(:text=>'No', :command=>proc{puts 'No'})
+p btn3 = bb2.add(:text=>'Maybe', :command=>proc{puts 'Maybe'})
+bb2.default(btn1)
+bb2.pack(:expand=>true, :fill=>:both, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
new file mode 100644
index 0000000000..bb09b4dfd3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Calendar.new(:command=>proc{|arg| puts(arg.date)},
+ :weekendbackground=>'mistyrose',
+ :weekdaybackground=>'ghostwhite',
+ :outline=>'black', :startday=>'wednesday',
+ :days=>%w(We Th Fr Sa Su Mo Tu)).pack
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
new file mode 100644
index 0000000000..c7c043000a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Canvasprintbox.new(:orient=>:landscape, :stretch=>1) \
+ .pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
new file mode 100644
index 0000000000..ea8d63e6eb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Canvasprintdialog.new.activate
+
+Tk.mainloop
+
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
new file mode 100644
index 0000000000..bae0eba73a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+cb = Tk::Iwidgets::Checkbox.new
+cb.add('bold', :text=>'Bold')
+cb.add('italic', :text=>'Italic')
+cb.add('underline', :text=>'Underline')
+cb.select('underline')
+cb.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
new file mode 100644
index 0000000000..36847538d6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb
@@ -0,0 +1,32 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+#
+# Non-editable Dropdown Combobox
+#
+cb1 = Tk::Iwidgets::Combobox.new(:labeltext=>'Month:',
+ :selectioncommand=>proc{
+ puts(cb1.get_curselection)
+ },
+ :editable=>false, :listheight=>185,
+ :popupcursor=>'hand1')
+
+cb1.insert_list('end', *%w(Jan Feb Mar Apr May June Jul Aug Sept Oct Nov Dec))
+
+
+#
+# Editable Dropdown Combobox
+#
+cb2 = Tk::Iwidgets::Combobox.new(:labeltext=>'Operating System:',
+ :selectioncommand=>proc{
+ puts(cb2.get_curselection)
+ })
+
+cb2.insert_list('end', *%w(Linux HP-UX SunOS Solaris Irix))
+cb2.insert_entry('end', 'L')
+
+cb1.pack(:padx=>10, :pady=>10, :fill=>:x)
+cb2.pack(:padx=>10, :pady=>10, :fill=>:x)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
new file mode 100644
index 0000000000..5727879217
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Dateentry.new.pack
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
new file mode 100644
index 0000000000..12d498245d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+df = Tk::Iwidgets::Datefield.new(:command=>proc{puts(df.get)})
+df.pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
new file mode 100644
index 0000000000..3449cd4b3d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Thread.new{Tk.mainloop}
+
+d = Tk::Iwidgets::Dialog.new(:modality=>:application)
+
+d.buttonconfigure('OK', :command=>proc{puts 'OK'; d.deactivate true})
+d.buttonconfigure('Apply', :command=>proc{puts 'Apply'})
+d.buttonconfigure('Cancel', :command=>proc{puts 'Cancel'; d.deactivate false})
+d.buttonconfigure('Help', :command=>proc{puts 'Help'})
+
+TkListbox.new(d.child_site, :relief=>:sunken).pack(:expand=>true, :fill=>:both)
+
+if TkComm.bool(d.activate)
+ puts "Exit via OK button"
+else
+ puts "Exit via Cancel button"
+end
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
new file mode 100644
index 0000000000..00ee99786c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+ds = Tk::Iwidgets::Dialogshell.new(:modality=>:none)
+
+ds.add('OK', :text=>'OK', :command=>proc{puts 'OK'; ds.deactivate})
+ds.add('Cancel', :text=>'Cancel', :command=>proc{puts 'Cancel'; ds.deactivate})
+ds.default('OK')
+
+TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7,
+ :command=>proc{puts ds.activate}).pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
new file mode 100644
index 0000000000..682c853e47
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+djl = Tk::Iwidgets::Disjointlistbox.new.pack(:fill=>:both, :expand=>true,
+ :padx=>10, :pady=>10)
+djl.set_lhs(*[0,2,4,5])
+djl.set_rhs(3,6)
+
+djl.insert_lhs(1,7,8)
+djl.insert_rhs(9)
+
+p djl.get_lhs
+p djl.get_rhs
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
new file mode 100644
index 0000000000..8563a0894d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# use Tk::UTF8_String() for a utf8 charecter
+#
+#########################################################
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>Tk::UTF8_String("\267"),
+ ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
new file mode 100644
index 0000000000..d8ccdf8555
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# set $KCODE to 'utf' for a utf8 charecter
+#
+#########################################################
+unless defined?(::Encoding.default_external)
+ $KCODE='utf'
+else
+ DEFAULT_TK_ENCODING = 'UTF-8'
+end
+
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>"\267", ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
new file mode 100644
index 0000000000..327f90893c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+#########################################################
+#
+# set Tk.encoding = 'utf-8' for a utf8 charecter
+#
+#########################################################
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk.encoding = 'utf-8'
+
+TkOption.add('*textBackground', 'white')
+
+ef = Tk::Iwidgets::Entryfield.new(:command=>proc{puts "Return Pressed"})
+
+fef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Fixed:',
+ :fixed=>10, :width=>12)
+
+nef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Numeric:',
+ :validate=>:numeric, :width=>12)
+
+aef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Alphabetic:',
+ :validate=>:alphabetic, :width=>12,
+ :invalid=>proc{
+ puts "Alphabetic contents invalid"
+ })
+
+pef = Tk::Iwidgets::Entryfield.new(:labeltext=>'Password:', :width=>12,
+ :show=>"\267", ## <=== utf8 character
+ :command=>proc{puts "Return Pressed"})
+
+Tk::Iwidgets::Labeledwidget.alignlabels(ef, fef, nef, aef, pef)
+
+ef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+fef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+nef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+aef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+pef.pack(:fil=>:x, :expand=>true, :padx=>10, :pady=>5)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
new file mode 100644
index 0000000000..4944c72ea5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info',
+ :background=>'bisque', :activeforeground=>'red',
+ :bitmapforeground=>'blue', :defaultring=>true,
+ :command=>proc{
+ puts "Bisque is beautiful"
+ }).pack(:expand=>true)
+
+#img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../../../images/earthris.gif'))
+img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/clear.gif'))
+
+Tk::Iwidgets::Extbutton.new(:text=>'Image example', :relief=>:ridge,
+ :image=>img, :imagepos=>:e, :font=>'9x15bold',
+ :activebackground=>'lightyellow',
+ :background=>'lightgreen').pack(:expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
new file mode 100644
index 0000000000..63e4be2fee
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Extfileselectionbox.new.pack(:padx=>10, :pady=>10,
+ :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
new file mode 100644
index 0000000000..c1a9b3defd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+#
+# Non-modal example
+#
+nmfsd = Tk::Iwidgets::Extfileselectiondialog.new(:title=>'Non-Modal')
+nmfsd.buttonconfigure('OK', :command=>proc{
+ puts "You selected #{nmfsd.get}"
+ nmfsd.deactivate
+ })
+nmfsd.activate
+
+#
+# Modal example
+#
+mfsd = Tk::Iwidgets::Extfileselectiondialog.new(:modality=>:application)
+mfsd.center
+if TkComm.bool(mfsd.activate)
+ puts "You selected #{mfsd.get}"
+else
+ puts "You cancelled the dialog"
+end
+
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
new file mode 100644
index 0000000000..7b87a029ed
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Feedback.new(:labeltext=>'Status', :steps=>20){|fb|
+ pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
+ TkTimer.new(500, 20, proc{fb.step}).start(2500)
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
new file mode 100644
index 0000000000..3a5b513bde
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Fileselectionbox.new.pack(:padx=>10, :pady=>10,
+ :fill=>:both, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
new file mode 100644
index 0000000000..ff22b2f643
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+#
+# Non-modal example
+#
+nmfsd = Tk::Iwidgets::Fileselectiondialog.new(:title=>'Non-Modal')
+nmfsd.buttonconfigure('OK', :command=>proc{
+ puts "You selected #{nmfsd.get}"
+ nmfsd.deactivate
+ })
+nmfsd.activate
+
+#
+# Modal example
+#
+mfsd = Tk::Iwidgets::Fileselectiondialog.new(:modality=>:application)
+mfsd.center
+if TkComm.bool(mfsd.activate)
+ puts "You selected #{mfsd.get}"
+else
+ puts "You cancelled the dialog"
+end
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb
new file mode 100644
index 0000000000..110efb9b96
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+st = Tk::Iwidgets::Scrolledtext.new.pack
+st.insert('end', "Now is the time for all good men\n")
+st.insert('end', "to come to the aid of their country")
+
+fd = Tk::Iwidgets::Finddialog.new(:textwidget=>st)
+fd.center(st)
+fd.activate
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
new file mode 100644
index 0000000000..085070e652
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+def get_files(file)
+ dir = (file.empty?)? ENV['HOME'] : TkComm._fromUTF8(file)
+ Dir.chdir(dir) rescue return ''
+ Dir['*'].sort.collect{|f|
+ [TkComm._toUTF8(File.join(dir, f)), TkComm._toUTF8(f)]
+ }
+end
+
+Tk::Iwidgets::Hierarchy.new(:querycommand=>proc{|arg| get_files(arg.node)},
+ :visibleitems=>'30x15',
+ :labeltext=>ENV['HOME']).pack(:side=>:left,
+ :expand=>true,
+ :fill=>:both)
+
+# Tk::Iwidgets::Hierarchy.new(:querycommand=>[proc{|n| get_files(n)}, '%n'],
+# :visibleitems=>'30x15',
+# :labeltext=>ENV['HOME']).pack(:side=>:left,
+# :expand=>true,
+# :fill=>:both)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb b/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb
new file mode 100644
index 0000000000..f9c92bf6dc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+dir = '/usr/local/ActiveTcl/demos/IWidgets/html/'
+href = [ 'hyperhelp.n', 'buttonbox.n', 'calendar.n' ]
+
+hh = Tk::Iwidgets::Hyperhelp.new(:topics=>href, :helpdir=>dir)
+hh.show_topic('hyperhelp.n')
+hh.activate
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb
new file mode 100644
index 0000000000..4e2e21e727
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+lf = Tk::Iwidgets::Labeledframe.new(:labeltext=>'Entry Frame', :labelpos=>:n)
+lf.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>10)
+
+cs = lf.child_site
+
+Tk::Iwidgets::Entryfield.new(cs, :labeltext=>'Name:').pack(:side=>:top, :fill=>:x)
+Tk::Iwidgets::Spinint.new(cs, :labeltext=>'Number:').pack(:side=>:top, :fill=>:x)
+Tk::Iwidgets::Pushbutton.new(cs, :text=>'Details:').pack(:side=>:top, :fill=>:x)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
new file mode 100644
index 0000000000..577550af55
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+lw = Tk::Iwidgets::Labeledwidget.new(:labeltext=>'Canvas Widget',
+ :labelpos=>:s)
+lw.pack(:fill=>:both, :expand=>true, :padx=>10, :pady=>10)
+
+cw = TkCanvas.new(lw.child_site, :relief=>:raised, :width=>200, :height=>200,
+ :borderwidth=>3, :background=>:white)
+cw.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
new file mode 100644
index 0000000000..c9677f2270
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb
@@ -0,0 +1,64 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mw = Tk::Iwidgets::Mainwindow.new
+
+mw.menubar.add(:menubutton, 'file', :text=>'File', :underline=>0,
+ :padx=>8, :pady=>2, :menu=>[
+ [:options, {:tearoff=>false}],
+
+ [:command, 'new', {
+ :label=>'New', :underline=>0,
+ :helpstr=>'Create a new file'
+ }
+ ],
+
+ [:command, 'open', {
+ :label=>'Open ...', :underline=>0,
+ :helpstr=>'Open an existing file'
+ }
+ ],
+
+ [:command, 'save', {
+ :label=>'Save', :underline=>0,
+ :helpstr=>'Save the current file'
+ }
+ ],
+
+ [:command, 'saveas', {
+ :label=>'Save As', :underline=>5,
+ :helpstr=>'Save the file as a different name'
+ }
+ ],
+
+ [:command, 'print', {
+ :label=>'Print', :underline=>0,
+ :helpstr=>'Print the file'
+ }
+ ],
+
+ [:separator, 'sep1'],
+
+ [:command, 'close', {
+ :label=>'Close', :underline=>0,
+ :helpstr=>'Close the file'
+ }
+ ],
+
+ [:separator, 'sep2'],
+
+ [:command, 'exit', {
+ :label=>'Exit', :underline=>1,
+ :helpstr=>'Exit this application'
+ }
+ ],
+
+ nil
+ ])
+
+Tk::Iwidgets::Scrolledtext.new(mw.child_site).pack(:fill=>:both, :expand=>true)
+
+mw.activate
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
new file mode 100644
index 0000000000..e01275217d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb
@@ -0,0 +1,124 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+helpvar = TkVariable.new
+viewmode = TkVariable.new
+
+menu_spec = [
+ [:menubutton, 'file', {
+ :text=>'File', :menu=>[
+ [:options, {:tearoff=>false}],
+
+ [:command, 'new', {
+ :label=>'New', :helpstr=>'Open new document',
+ :command=>proc{puts 'NEW'}
+ }
+ ],
+
+ [:command, 'close', {
+ :label=>'Close', :helpstr=>'Close current document',
+ :command=>proc{puts 'CLOSE'}
+ }
+ ],
+
+ [:separator, 'sep1'],
+
+ [:command, 'exit', {
+ :label=>'Exit', :helpstr=>'Exit application',
+ :command=>proc{exit}
+ }
+ ]
+ ]
+ }
+ ],
+
+ [:menubutton, 'edit', {
+ :text=>'Edit', :menu=>[
+ [:options, {:tearoff=>false}],
+
+ [:command, 'undo', {
+ :label=>'Undo', :underline=>0,
+ :helpstr=>'Undo last command',
+ :command=>proc{puts 'UNDO'}
+ }
+ ],
+
+ [:separator, 'sep2'],
+
+ [:command, 'cut', {
+ :label=>'Cut', :underline=>1,
+ :helpstr=>'Cut selection to clipboard',
+ :command=>proc{puts 'CUT'}
+ }
+ ],
+
+ [:command, 'copy', {
+ :label=>'Copy', :underline=>1,
+ :helpstr=>'Copy selection to clipboard',
+ :command=>proc{puts 'COPY'}
+ }
+ ],
+
+ [:command, 'paste', {
+ :label=>'Paste', :underline=>0,
+ :helpstr=>'Paste clipboard contents',
+ :command=>proc{puts 'PASTE'}
+ }
+ ]
+ ]
+ }
+ ],
+
+ [:menubutton, 'options', {
+ :text=>'Options', :menu=>[
+ [:options, {:tearoff=>false, :selectcolor=>'blue'}],
+
+ [:radiobutton, 'byName', {
+ :variable=>viewmode, :value=>'NAME',
+ :label=>'by Name', :helpstr=>'View files by name order',
+ :command=>proc{puts 'NAME'}
+ }
+ ],
+
+ [:radiobutton, 'byDate', {
+ :variable=>viewmode, :value=>'DATE',
+ :label=>'by Date', :helpstr=>'View files by date order',
+ :command=>proc{puts 'DATE'}
+ }
+ ],
+
+ [:cascade, 'prefs', {
+ :label=>'Preferences', :menu=>[
+ [:command, 'colors', {
+ :label=>'Colors...', :helpstr=>'Change text colors',
+ :command=>proc{puts 'COLORS'}
+ }
+ ],
+
+ [:command, 'fonts', {
+ :label=>'Fonts...', :helpstr=>'Change text font',
+ :command=>proc{puts 'COLORS'}
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+]
+
+#mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar,
+# :menubuttons=>menu_spec)
+mb = Tk::Iwidgets::Menubar.new(:helpvariable=>helpvar)
+mb.configure(:menubuttons=>menu_spec)
+
+fr = TkFrame.new(:width=>300, :height=>300)
+ef = TkEntry.new(:textvariable=>helpvar)
+
+mb.pack(:anchor=>:nw, :fill=>:x, :expand=>true)
+fr.pack(:fill=>:both, :expand=>true)
+ef.pack(:anchor=>:sw, :fill=>:x, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
new file mode 100644
index 0000000000..477c916e07
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+helpvar = TkVariable.new
+viewmode = TkVariable.new
+
+mb = Tk::Iwidgets::Menubar.new
+mb.menubuttons = [
+ [:menubutton, 'file', {
+ :text=>'File', :menu=>[
+ [:command, 'new', {:label=>'New'}],
+ [:command, 'close', {:label=>'Close'}],
+ [:separator, 'sep1'],
+ [:command, 'quit', {:label=>'Quit'}]
+ ]
+ }
+ ],
+ [:menubutton, 'edit', {:text=>'Edit'}]
+]
+
+mb.add(:command, '.edit.undo', :label=>'Undo', :underline=>0)
+mb.add(:separator, '.edit.sep2')
+mb.add(:command, '.edit.cut', :label=>'Cut', :underline=>1)
+mb.add(:command, '.edit.copy', :label=>'Copy', :underline=>1)
+mb.add(:command, '.edit.paste', :label=>'Paste', :underline=>0)
+
+mb.add(:menubutton, '.options', :text=>'Options', :menu=>[
+ [:radiobutton, 'byName', {
+ :variable=>viewmode, :value=>'NAME', :label=>'by Name'}
+ ],
+ [:radiobutton, 'byDate', {
+ :variable=>viewmode, :value=>'DATE', :label=>'by Date'}
+ ]
+ ])
+
+mb.add(:cascade, '.options.prefs', :label=>'Preferences', :menu=>[
+ [:command, 'colors', {:label=>'Colors...'}],
+ [:command, 'fonts', {:label=>'Fonts...'}]
+ ])
+
+mb.pack(:side=>:left, :anchor=>:nw, :fill=>:x, :expand=>true)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
new file mode 100644
index 0000000000..87b2d38907
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic,
+ :labeltext=>'Messages', :labelpos=>:n,
+ :height=>120, :width=>550,
+ :savedir=>'/tmp', :textbackground=>'#d9d9d9')
+mb.pack(:padx=>5, :pady=>5, :fill=>:both, :expand=>true)
+
+mb.type_add('ERROR', :background=>'red', :foreground=>'white', :bell=>true)
+mb.type_add('WARNING', :background=>'yellow', :foreground=>'black')
+mb.type_add('INFO', :background=>'white', :foreground=>'black')
+
+mb.issue('This is an error message in red with a beep', 'ERROR')
+mb.issue('This warning message in yellow', 'WARNING')
+mb.issue('This is an informational message', 'INFO')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
new file mode 100644
index 0000000000..5278883568
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic,
+ :labeltext=>'Messages', :labelpos=>:n,
+ :height=>120, :width=>550,
+ :savedir=>'/tmp', :textbackground=>'#d9d9d9')
+mb.pack(:padx=>5, :pady=>5, :fill=>:both, :expand=>true)
+
+error = mb.type_add(:background=>'red', :foreground=>'white', :bell=>true)
+warning = mb.type_add(:background=>'yellow', :foreground=>'black')
+info = mb.type_add(:background=>'white', :foreground=>'black')
+
+mb.issue('This is an error message in red with a beep', error)
+mb.issue('This warning message in yellow', warning)
+mb.issue('This is an informational message', info)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
new file mode 100644
index 0000000000..52799f206c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+#
+# Standard question message dialog used for confirmation.
+#
+md = Tk::Iwidgets::Messagedialog.new(:title=>'Message Dialog',
+ :text=>'Are you sure ? ',
+ :bitmap=>'questhead', :modality=>:global)
+
+md.buttonconfigure('OK', :text=>'Yes')
+md.buttonconfigure('Cancel', :text=>'No')
+
+if TkComm.bool(md.activate)
+ md.text('Are you really sure ? ')
+ if TkComm.bool(md.activate)
+ puts 'Yes'
+ else
+ puts 'No'
+ end
+else
+ puts 'No'
+end
+
+md.destroy
+
+#
+# Copyright notice with automatic deactivation.
+#
+bmp = '@' + File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/text.xbm')
+
+cr = Tk::Iwidgets::Messagedialog.new(:title=>'Copyright',
+ :bitmap=>bmp, :imagepos=>:n,
+ :text=>"Copyright 200x XXX Corporation\nAll rights reserved")
+
+cr.hide('Cancel')
+
+cr.activate
+Tk.after(7000, proc{cr.deactivate; Tk.root.destroy})
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
new file mode 100644
index 0000000000..4d460e8802
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# Create the tabnotebook widget and pack it.
+nb = Tk::Iwidgets::Notebook.new(:width=>100, :height=>100)
+nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
+ :side=>:left, :padx=>10, :pady=>10)
+
+# Add two pages to the tabnotebook,
+# labelled "Page One" and "Page Two"
+nb.add(:label=>'Page One')
+nb.add(:label=>'Page Two')
+
+# Get the child site frames of these two pages.
+page1CS = nb.child_site(0)
+page2CS = nb.child_site('Page Two')
+
+# Create buttons on each page of the tabnotebook.
+TkButton.new(page1CS, :text=>'Button One').pack
+TkButton.new(page2CS, :text=>'Button Two').pack
+
+# Select the first page of the tabnotebook.
+nb.select(0)
+
+# Create the scrollbar and associate the scrollbar
+# and the notebook together, then pack the scrollbar
+nb.scrollbar(TkScrollbar.new).pack(:fill=>:y, :expand=>true, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
new file mode 100644
index 0000000000..576a9c18d0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# Create the tabnotebook widget and pack it.
+nb = Tk::Iwidgets::Notebook.new(:width=>100, :height=>100)
+nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
+ :side=>:top, :padx=>10, :pady=>0)
+
+# Add two pages to the tabnotebook,
+# labelled "Page One" and "Page Two"
+nb.add(:label=>'Page One')
+nb.add(:label=>'Page Two')
+
+# Get the child site frames of these two pages.
+page1CS = nb.child_site(0)
+page2CS = nb.child_site('Page Two')
+
+# Create buttons on each page of the tabnotebook.
+TkButton.new(page1CS, :text=>'Button One').pack
+TkButton.new(page2CS, :text=>'Button Two').pack
+
+# Select the first page of the tabnotebook.
+nb.select(0)
+
+# Create the scrollbar and associate the scrollbar
+# and the notebook together, then pack the scrollbar
+nb.xscrollbar(TkScrollbar.new).pack(:fill=>:x, :expand=>true, :padx=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
new file mode 100644
index 0000000000..2b921ffab9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+om = Tk::Iwidgets::Optionmenu.new(:labelmargin=>5, :labelpos=>:w,
+ :labeltext=>"Operating System :")
+
+om.insert('end', 'Unix', 'VMS', 'Linux', 'OS/2', 'Windows NT', 'DOS')
+om.sort_ascending
+om.select('Linux')
+
+om.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
new file mode 100644
index 0000000000..88fc401483
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+pw = Tk::Iwidgets::Panedwindow.new(:width=>300, :height=>300)
+
+pw.add('top')
+pw.add('middle', :margin=>10)
+pw.add('bottom', :margin=>10, :minimum=>10)
+
+pw.pack(:fill=>:both, :expand=>true)
+
+pw.child_site_list.each{|pane|
+ TkButton.new(pane, :text=>pane.path, :relief=>:raised,
+ :borderwidth=>2).pack(:fill=>:both, :expand=>true)
+}
+
+pw.fraction(50,30,20)
+pw.paneconfigure(0, :minimum=>20)
+pw.paneconfigure('bottom', :margin=>15)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
new file mode 100644
index 0000000000..96987d529c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+pw = Tk::Iwidgets::Panedwindow.new(:width=>300, :height=>300)
+
+top = pw.add
+middle = pw.add(:margin=>10)
+bottom = pw.add(:margin=>10, :minimum=>10)
+
+pw.pack(:fill=>:both, :expand=>true)
+
+pw.child_site_list.each{|pane|
+ TkButton.new(pane, :text=>pane.path, :relief=>:raised,
+ :borderwidth=>2).pack(:fill=>:both, :expand=>true)
+}
+
+pw.fraction(50,30,20)
+pw.paneconfigure(0, :minimum=>20) # 0 == pw.index(top)
+pw.paneconfigure(bottom, :margin=>15)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
new file mode 100644
index 0000000000..d92a26ead9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+TkOption.add('*textBackground', 'white')
+
+pd = Tk::Iwidgets::Promptdialog.new(:modality=>:global, :title=>'Password',
+ :labeltext=>'Password:', :show=>'*')
+pd.hide('Apply')
+
+if TkComm.bool(pd.activate)
+ puts "Password entered: #{pd.get}"
+else
+ puts "Password prompt cancelled"
+end
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
new file mode 100644
index 0000000000..e76dda88c6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Pushbutton.new(:text=>'Hello',
+ :command=>proc{puts 'Hello World'},
+ :defaultring=>true).pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb
new file mode 100644
index 0000000000..9cd6a002b0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+rb = Tk::Iwidgets::Radiobox.new(:labeltext=>'Fonts')
+rb.add('times', :text=>'Times')
+rb.add('helvetica', :text=>'Helvetica')
+rb.add('courier', :text=>'Courier')
+rb.add('symbol', :text=>'Symbol')
+rb.select('courier')
+rb.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb
new file mode 100644
index 0000000000..92c94b96bb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+sc = Tk::Iwidgets::Scrolledcanvas.new
+
+sc.create(TkcRectangle, 100, 100, 400, 400, :fill=>'red')
+TkcRectangle.new(sc, 300, 300, 600, 600, :fill=>'green')
+TkcRectangle.new(sc, [[200, 200], [500, 500]], :fill=>'blue')
+
+sc.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
new file mode 100644
index 0000000000..e5bd90a1cb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+sf = Tk::Iwidgets::Scrolledframe.new(:width=>150, :height=>180,
+ :labeltext=>'scrolledframe')
+cs = sf.child_site
+
+TkButton.new(cs, :text=>'Hello').pack(:pady=>10)
+TkButton.new(cs, :text=>'World').pack(:pady=>10)
+TkButton.new(cs, :text=>'This is a test').pack(:pady=>10)
+TkButton.new(cs, :text=>'This is a really big button').pack(:pady=>10)
+TkButton.new(cs, :text=>'This is another really big button').pack(:pady=>10)
+TkButton.new(cs, :text=>'This is the last really big button').pack(:pady=>10)
+
+sf.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
new file mode 100644
index 0000000000..2b675f802c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+sh = Tk::Iwidgets::Scrolledhtml.new(:fontname=>'helvetica',
+ :linkcommand=>proc{|href|
+ sh.import_link(href)
+ })
+sh.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+sh.import(Tk.getOpenFile(:title=>'select HTML document'))
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
new file mode 100644
index 0000000000..bf2c60191f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+slb = Tk::Iwidgets::Scrolledlistbox.new(:selectmode=>:single,
+ :vscrollmode=>:static,
+ :hscrollmode=>:dynamic,
+ :labeltext=>'List',
+ :selectioncommand=>proc{
+ puts(slb.get_curselection)
+ },
+ :dblclickcommand=>proc{
+ puts('Double Click')
+ puts(slb.get_curselection)
+ })
+slb.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+slb.insert('end', *['Hello', 'Out There', 'World'])
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
new file mode 100644
index 0000000000..41498e67f7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+st = Tk::Iwidgets::Scrolledtext.new(:hscrollmode=>:dynamic, :wrap=>:none,
+ :labeltext=>'Password File')
+st.pack(:expand=>true, :fill=>:both, :padx=>10, :pady=>10)
+
+st.import('/etc/passwd')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
new file mode 100644
index 0000000000..74684974b1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+sb = Tk::Iwidgets::Selectionbox.new.pack(:padx=>10, :pady=>10,
+ :fill=>:both, :expand=>true)
+
+sb.insert_items('end', *['Hello', 'Out There', 'World'])
+
+TkLabel.new(sb.child_site,
+ :text=>'Child Site is Here').pack(:fill=>:x, :padx=>10, :pady=>10)
+
+sb.insert_items(2, 'Cruel Cruel')
+
+sb.selection_set(1)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
new file mode 100644
index 0000000000..d53391f2f3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mainloop = Thread.new{Tk.mainloop}
+
+TkButton.new(:text=>'QUIT',
+ :command=>proc{Tk.root.destroy}).pack(:padx=>10, :pady=>10)
+
+Tk::Iwidgets::Selectiondialog.new.activate
+
+mainloop.join
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
new file mode 100644
index 0000000000..6d01280141
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+sh = Tk::Iwidgets::Shell.new(:modality=>:application,
+ :padx=>20, :pady=>20, :title=>'Shell')
+
+TkButton.new(:text=>'ACTIVATE', :padx=>7, :pady=>7,
+ :command=>proc{puts sh.activate}).pack(:padx=>10, :pady=>10)
+
+TkLabel.new(sh.child_site, :text=>'SHELL').pack
+TkButton.new(sh.child_site, :text=>'YES',
+ :command=>proc{sh.deactivate 'press YES'}).pack(:fill=>:x)
+TkButton.new(sh.child_site, :text=>'NO',
+ :command=>proc{sh.deactivate 'press NO'}).pack(:fill=>:x)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb
new file mode 100644
index 0000000000..17197a66b7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Spindate.new.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
new file mode 100644
index 0000000000..e2dde01b18
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb
@@ -0,0 +1,10 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+TkOption.add('*textBackground', 'white')
+
+Tk::Iwidgets::Spinint.new(:labeltext=>'Temperature', :labelpos=>:w, :width=>5,
+ :fixed=>true, :range=>[32, 212]).pack(:pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
new file mode 100644
index 0000000000..6a20b0eb87
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb
@@ -0,0 +1,33 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+class Spinner_demo < TkWindow
+ Months = %w(January February March April May June July August September October November December)
+
+ def block_input(c)
+ false
+ end
+
+ def spin_month(step)
+ index = Months.index(@spinner.get) + step
+ index = 11 if index < 0
+ index = 0 if index > 11
+
+ @spinner.value = Months[index]
+ end
+
+ def initialize(parent=nil)
+ @spinner = Tk::Iwidgets::Spinner.new(parent, :labeltext=>'Month : ',
+ :width=>10, :fixed=>10,
+ :validate=>proc{|c| block_input},
+ :decrement=>proc{spin_month -1},
+ :increment=>proc{spin_month 1})
+ @path = @spinner
+ @spinner.insert(0, Months[0])
+ end
+end
+
+Spinner_demo.new.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb
new file mode 100644
index 0000000000..2c13884b94
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Spintime.new.pack(:padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
new file mode 100644
index 0000000000..382b34d3ce
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# Create the tabnotebook widget and pack it.
+tn = Tk::Iwidgets::Tabnotebook.new(:width=>300, :height=>100)
+tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
+ :side=>:left, :padx=>10, :pady=>10)
+
+# Add two pages to the tabnotebook,
+# labelled "Page One" and "Page Two"
+tn.add(:label=>'Page One')
+tn.add(:label=>'Page Two')
+
+# Get the child site frames of these two pages.
+page1CS = tn.child_site(0)
+page2CS = tn.child_site('Page Two')
+
+# Create buttons on each page of the tabnotebook.
+TkButton.new(page1CS, :text=>'Button One').pack
+TkButton.new(page2CS, :text=>'Button Two').pack
+
+# Select the first page of the tabnotebook.
+tn.select(0)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
new file mode 100644
index 0000000000..2689759bde
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# Create the tabnotebook widget and pack it.
+tn = Tk::Iwidgets::Tabnotebook.new(:width=>300, :height=>100)
+tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
+ :side=>:top, :padx=>10, :pady=>0)
+
+# Add two pages to the tabnotebook,
+# labelled "Page One" and "Page Two"
+tn.add(:label=>'Page One')
+tn.add(:label=>'Page Two')
+
+# Get the child site frames of these two pages.
+page1CS = tn.child_site(0)
+page2CS = tn.child_site('Page Two')
+
+# Create buttons on each page of the tabnotebook.
+TkButton.new(page1CS, :text=>'Button One').pack
+TkButton.new(page2CS, :text=>'Button Two').pack
+
+# Select the first page of the tabnotebook.
+tn.select(0)
+
+# Create the scrollbar
+# and the notebook together, then pack the scrollbar
+tn.xscrollbar(TkScrollbar.new).pack(:fill=>:x, :expand=>true, :padx=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb b/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb
new file mode 100644
index 0000000000..90be46b40b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb
@@ -0,0 +1,34 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+# Create a listbox with two items (one and two)
+l = TkListbox.new(:selectmode=>:single, :exportselection=>false).pack
+l.insert('end', 'one')
+l.insert('end', 'two')
+l.selection_set(0)
+
+# Define a proc that knows how to select an item
+# from a list given an index from the tabset -command callback.
+selectItem = proc{|item|
+ l.selection_clear(l.curselection)
+ l.selection_set(item)
+ l.see(item)
+}
+
+# Create a tabset, set its -command to call selectItem
+# Add two labels to the tabset (one and two).
+ts = Tk::Iwidgets::Tabset.new(:command=>selectItem)
+ts.add(:label=>1)
+ts.add(:label=>2)
+ts.select(0)
+ts.pack(:fill=>:x, :expand=>true)
+
+# Define a proc that knows how to select a tab
+# given a y pixel coordinate from the list..
+selectTab = proc{|y| ts.select(l.nearest(y)) }
+
+# bind button 1 press to the selectTab procedure.
+l.bind('ButtonPress-1', proc{|y| selectTab.call(y) }, '%y')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb b/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb
new file mode 100644
index 0000000000..465939947b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Tk::Iwidgets::Timeentry.new.pack
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb b/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb
new file mode 100644
index 0000000000..bb5945048d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+tf = Tk::Iwidgets::Timefield.new(:command=>proc{puts(tf.get)})
+tf.pack(:fill=>:x, :expand=>true, :padx=>10, :pady=>10)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
new file mode 100644
index 0000000000..608efd0af1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb
@@ -0,0 +1,152 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+##########################################
+# icon images
+editcopy22 = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODlhFgAWAIUAAPwCBBQSFPz+/DQyNISChDw6PMzKzMTGxERGRIyKjFxa
+ XMTCvKSmpHR2dPz6/Pz29PTq3MS2rPz69MTCxFxWVHx6dJyWjNzSzPz27Pzy
+ 7Pzu5PTm3NTKvIR+fJyGfHxuZHxqXNTCtPTq5PTi1PTezNS+rExOTFRORMyy
+ lPTaxOzWxOzSvNze3NTOxMy2nMyulMyqjAQCBAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbY
+ QIBwSCwahYGkUnk0BgTQ6IAQaBKfUWhBYKhaAU+CgXAQIAyChLeJzSIQhcH6
+ GFaM0QtGY5kstqEODw8QEQELAhJTc08KBBMEFBUWDRcBE1pca20SGBkaEBsc
+ AY5maFRIAgoLHRQRHh8gIQFlZnByqA8ZGSIQIyQjJQEmYgJ5p2ACrK4gJx4g
+ KIZZAgdeAQ4ZI9kjKSor0AwEjeAs1S0cHAslLi4vMDDRWeRIfEsxMeET4ATy
+ VoYLC5fizXEiAR84BeMG+pEm8EsAFhAjSlR4hR6fLxiF0AkCACH+aENyZWF0
+ ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5
+ OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2
+ ZWxjb3IuY29tADs=
+EOD
+
+editcut22 = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODlhFgAWAIMAAPwCBAQCBAwCBPz+/OTi5JyanOzq7DQyNGxq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mVyc2lvbiAyLjUNCqkgRGV2ZWxD
+ b3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3
+ dy5kZXZlbGNvci5jb20AOw==
+EOD
+
+##########################################
+
+bmp_dir = File.join(File.dirname(File.expand_path(__FILE__)),
+ '../catalog_demo/images')
+
+##########################################
+
+status_var = TkVariable.new
+radio_var = TkVariable.new
+check_var1 = TkVariable.new
+check_var2 = TkVariable.new
+
+tb = Tk::Iwidgets::Toolbar.new(:helpvariable=>status_var)
+
+##########################################
+
+tb.add(:button, :helpstr=>'Copy It', :image=>editcopy22,
+ :balloonstr=>'Copy', :command=>proc{puts 'Copy It'})
+
+tb.add(:button, :helpstr=>'Cut It', :image=>editcut22,
+ :balloonstr=>'Cut', :command=>proc{puts 'Cut It'})
+
+tb.add(:button, :helpstr=>'Paste It', :image=>editpaste22,
+ :balloonstr=>'Paste', :command=>proc{puts 'Paste It'})
+
+tb.add(:button, :helpstr=>'Delete It', :image=>editdelete22,
+ :balloonstr=>'Delete', :command=>proc{puts 'Delete It'})
+
+#--------------------------------
+
+tb.add(:frame, :borderwidth=>1, :width=>10, :height=>10)
+
+#--------------------------------
+
+tb.add(:radiobutton, :variable=>radio_var, :value=>'Box',
+ :bitmap=>"@#{bmp_dir}/box.xbm",
+ :helpstr=>'Radio Button #1', :balloonstr=>'Radio',
+ :command=>proc{puts 'Radio Button "Box"'})
+
+tb.add(:radiobutton, :variable=>radio_var, :value=>'Line',
+ :bitmap=>"@#{bmp_dir}/line.xbm",
+ :helpstr=>'Radio Button #2', :balloonstr=>'Radio',
+ :command=>proc{puts 'Radio Button "Line"'})
+
+tb.add(:radiobutton, :variable=>radio_var, :value=>'Oval',
+ :bitmap=>"@#{bmp_dir}/oval.xbm",
+ :helpstr=>'Radio Button #3', :balloonstr=>'Radio',
+ :command=>proc{puts 'Radio Button "Oval"'})
+
+#--------------------------------
+
+tb.add(:frame, :borderwidth=>1, :width=>10, :height=>10)
+
+#--------------------------------
+
+tb.add(:checkbutton, :variable=>check_var1, :onvalue=>'yes', :offvalue=>'no',
+ :image=>text22, :command=>proc{puts 'Checkbutton 1'})
+
+tb.add(:checkbutton, :variable=>check_var2, :onvalue=>'yes', :offvalue=>'no',
+ :bitmap=>"@#{bmp_dir}/points.xbm", :command=>proc{puts 'Checkbutton 2'})
+
+tb.pack(:side=>:top, :anchor=>:nw)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
new file mode 100644
index 0000000000..2af53ba63b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+Thread.new{
+ trap('INT') {puts 'catch SIGINT'}
+ sleep 5
+ trap('INT', 'DEFAULT')
+}
+
+Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no,
+ :width=>155, :height=>155){|w|
+ w.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
+ # TkTimer.new(1000, -1, proc{w.show; Tk.update}).start
+ TkTimer.new(25, -1, proc{w.show; Tk.update}).start
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt
new file mode 100644
index 0000000000..975f23e3f1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt
@@ -0,0 +1,46 @@
+
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+ >>> The following text is the original 'license.term' of tklib <<<
+ >>> extension. <<<
+ >>> Original Tcl files are not include in this directory, because <<<
+ >>> of all of them are rewritten to Ruby files. <<<
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+This software is copyrighted by Ajuba Solutions and other parties.
+The following terms apply to all files associated with the software unless
+explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/tkextlib/tcllib/datefield.rb b/ext/tk/sample/tkextlib/tcllib/datefield.rb
new file mode 100644
index 0000000000..3550af7d23
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/datefield.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/ruby
+
+require 'tk'
+require 'tkextlib/tcllib/datefield'
+require 'parsedate'
+
+Tk.root.title('Datefield example')
+
+
+my_date1 = TkVariable.new
+my_date2 = TkVariable.new
+my_date1.trace('w'){
+ begin
+ t = Time.local(*(ParseDate.parsedate(my_date1.value)))
+ my_date2.value = t.strftime('%A')
+ rescue
+ # ignore error
+ end
+}
+
+df = Tk::Tcllib::Datefield.new(:textvariable=>my_date1)
+Tk.grid(TkLabel.new(:text=>'Enter a date:', :anchor=>:e), df, :sticky=>:ew)
+Tk.grid(TkLabel.new(:text=>'That date ia a:', :anchor=>:e),
+ TkLabel.new(:textvariable=>my_date2, :relief=>:sunken, :width=>12),
+ :sticky=>:ew)
+
+df.set_focus
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
new file mode 100644
index 0000000000..7f35a3833c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb
@@ -0,0 +1,158 @@
+#!/usr/bin/ruby
+
+require 'tk'
+require 'tkextlib/tcllib/plotchart'
+
+###############################
+
+c1 = TkCanvas.new(:background=>'white', :width=>400, :height=>200)
+c2 = TkCanvas.new(:background=>'white', :width=>400, :height=>200)
+c3 = TkCanvas.new(:background=>'white', :width=>400, :height=>200)
+Tk.pack(c1,c2,c3, :fill=>:both, :side=>:top)
+
+h = TkToplevel.new(:title=>'h')
+hc1 = TkCanvas.new(h, :background=>'white', :width=>400, :height=>200)
+hc2 = TkCanvas.new(h, :background=>'white', :width=>400, :height=>200)
+Tk.pack(hc1,hc2, :fill=>:both, :side=>:top)
+
+v = TkToplevel.new(:title=>'v')
+vc1 = TkCanvas.new(v, :background=>'white', :width=>400, :height=>200)
+vc2 = TkCanvas.new(v, :background=>'white', :width=>400, :height=>200)
+vc3 = TkCanvas.new(v, :background=>'white', :width=>400, :height=>200)
+Tk.pack(vc1,vc2,vc3, :fill=>:both, :side=>:top)
+
+###############################
+
+s = Tk::Tcllib::Plotchart::XYPlot.new(c1, [0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0])
+
+
+xd = 5.0
+yd = 20.0
+xold = 0.0
+yold = 50.0
+
+s.dataconfig('series1', :color=>'red')
+
+(0..19).each{|i|
+ xnew = xold + xd
+ ynew = yold + (rand() - 0.5) * yd
+ ynew2 = yold + (rand() - 0.5) * 2.0 * yd
+ s.plot('series1', xnew, ynew)
+ s.plot('series2', xnew, ynew2)
+ xold = xnew
+ yold = ynew
+}
+
+s.xtext "X-coordinate"
+s.ytext "Y-data"
+s.title "Aha!"
+
+c1.wait_visibility
+
+s.save_plot "aha.ps"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::Piechart.new(c2)
+
+s.plot([ ["Long names", 10], ["Short names", 30],
+ ["Average", 40], ["Ultra-short names", 5] ])
+
+#
+# Note: title should be shifted up
+# - distinguish a separate title area
+#
+s.title "Okay - this works"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::PolarPlot.new(c3, [3.0, 1.0])
+
+0.step(359, 10){|angle|
+ rad = 1.0+Math.cos(angle*Math::PI/180.0)
+ s.plot('cardioid', rad, angle)
+}
+
+s.title "Cardioid"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::Barchart.new(hc1, %w(A B C D E),
+ [0.0, 10.0, 2.0], 2)
+
+s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red')
+s.plot('series2', [0.0, 3.0, 7.0, 9.3, 2.0], 'green')
+s.title "Arbitrary data"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::Barchart.new(hc2, %w(A B C D E),
+ [0.0, 20.0, 5.0], :stacked)
+
+s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red')
+s.plot('series2', [0.0, 3.0, 7.0, 9.3, 2.0], 'green')
+s.title "Stacked diagram"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc1, [0.0, 10.0, 2.0],
+ %w(A B C D E), 2)
+
+s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red')
+s.plot('series2', [0.0, 3.0, 7.0, 9.3, 2.0], 'green')
+s.title "Arbitrary data"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::HorizontalBarchart.new(vc2, [0.0, 20.0, 5.0],
+ %w(A B C D E), :stacked)
+
+s.plot('series1', [1.0, 4.0, 6.0, 1.0, 7.0], 'red')
+s.plot('series2', [0.0, 3.0, 7.0, 9.3, 2.0], 'green')
+s.title "Stacked diagram"
+
+###############################
+
+s = Tk::Tcllib::Plotchart::Timechart.new(vc3, "1 january 2004",
+ "31 december 2004", 4)
+
+s.period("Spring", "1 march 2004", "1 june 2004", 'green')
+s.period("Summer", "1 june 2004", "1 september 2004", 'yellow')
+s.vertline("1 jan", "1 january 2004")
+s.vertline("1 apr", "1 april 2004")
+s.vertline("1 jul", "1 july 2004")
+s.vertline("1 oct", "1 october 2004")
+s.milestone("Longest day", "21 july 2004")
+s.title "Seasons (northern hemisphere)"
+
+###############################
+
+z = TkToplevel.new(:title=>'3D')
+
+zc1 = TkCanvas.new(z, :background=>'white', :width=>400, :height=>300)
+zc2 = TkCanvas.new(z, :background=>'white', :width=>400, :height=>250)
+Tk.pack(zc1,zc2)
+
+s = Tk::Tcllib::Plotchart::Plot3D.new(zc1,
+ [0, 10, 3], [-10, 10, 10], [0, 10, 2.5])
+
+s.title "3D Plot"
+s.plot_function{|x, y|
+ # cowboyhat
+ x1 = x.to_f/9.0
+ y1 = y.to_f/9.0
+ 3.0 * (1.0-(x1*x1+y1*y1))*(1.0-(x1*x1+y1*y1))
+}
+
+s = Tk::Tcllib::Plotchart::Plot3D.new(zc2,
+ [0, 10, 3], [-10, 10, 10], [0, 10, 2.5])
+s.title "3D Plot - data "
+s.colour("green", "black")
+s.plot_data([ [1.0, 2.0, 1.0, 0.0],
+ [1.1, 3.0, 1.1, -0.5],
+ [3.0, 1.0, 4.0, 5.0] ])
+
+###############################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
new file mode 100644
index 0000000000..cb657a40d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb
@@ -0,0 +1,71 @@
+#!/usr/bin/ruby
+
+require 'tk'
+require 'tkextlib/tcllib/plotchart'
+
+###############################
+
+c1 = TkCanvas.new(:background=>'white', :width=>400, :height=>200)
+c2 = TkCanvas.new(:background=>'white', :width=>400, :height=>200)
+Tk.pack(c1,c2, :fill=>:both, :side=>:top)
+
+###############################
+# Set up a strip chart
+###############################
+slipchart = Tk::Tcllib::Plotchart::Stripchart.new(c1, [0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0])
+
+TkTimer.new(500, -1, proc{|obj| # obj --> TkTimer object
+ slipchart, xold, xd, yold, yd = obj.return_value
+ xnew = xold + xd
+ ynew = yold + (rand() - 0.5) * yd
+ ynew2 = yold + (rand() - 0.5) * 2.0 * yd
+ slipchart.plot('series1', xnew, ynew)
+ slipchart.plot('series2', xnew, ynew2)
+ obj.stop if xnew >= 200
+ [slipchart, xnew, xd, ynew, yd] # return_value
+ }).start(100, proc{
+ # init return_value
+ [slipchart, 0.0, 15.0, 50.0, 30.0]
+ })
+
+slipchart.title "Aha!"
+
+###############################
+# Set up an isometric plot
+###############################
+s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0],
+ :noaxes)
+
+s.set_zoom_pan
+
+s.plot('rectangle', [10.0, 10.0, 50.0, 50.0], 'green')
+s.plot('filled-rectangle', [20.0, 20.0, 40.0, 40.0], 'red')
+s.plot('filled-circle', [70.0, 70.0, 40.0], 'yellow')
+s.plot('circle', [70.0, 70.0, 42.0])
+
+###############################
+# Check the symbols
+###############################
+h = TkToplevel.new(:title=>'h')
+c = TkCanvas.new(h, :bg=>'white', :width=>400, :height=>200).pack(:fill=>:both)
+
+s = Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0])
+s.dataconfig('series1', :colour=>'red', :type=>:symbol)
+s.dataconfig('series2', :colour=>'green', :type=>:both)
+
+s.yconfig(:format=>"%12.2e")
+
+x = 5.0
+%w(plus cross circle up down dot upfilled downfilled).each{|sym|
+ s.dataconfig('series1', :symbol=>sym)
+ s.dataconfig('series2', :symbol=>sym)
+ s.plot('series1', x, 50.0)
+ s.plot('series2', x, 20)
+ x += 10
+}
+
+##############################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
new file mode 100644
index 0000000000..66b8fe706a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb
@@ -0,0 +1,83 @@
+#!/usr/bin/ruby
+
+require 'tk'
+require 'tkextlib/tcllib/plotchart'
+
+###############################
+# Set up a strip chart
+###############################
+
+Tk::Tcllib::Plotchart::Stripchart.new([0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0],
+ :background=>'white',
+ :width=>400, :height=>200){|chart|
+ title "Aha!"
+ pack(:fill=>:both, :side=>:top)
+
+ series1 = Tk::Tcllib::Plotchart::PlotSeries.new(chart)
+ series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart)
+
+ xd = 15.0
+ yd = 30.0
+
+ TkTimer.new(500, -1, proc{|obj| # obj --> TkTimer object
+ xold, yold = obj.return_value
+ xnew = xold + xd
+ ynew = yold + (rand() - 0.5) * yd
+ ynew2 = yold + (rand() - 0.5) * 2.0 * yd
+
+ series1.plot(xnew, ynew)
+ series2.plot(xnew, ynew2)
+
+ obj.stop if xnew >= 200
+
+ [xnew, ynew] # return_value
+ }).start(100, proc{ [0.0, 50.0] }) # init return_value
+}
+
+###############################
+# Set up an isometric plot
+###############################
+Tk::Tcllib::Plotchart::IsometricPlot.new([0.0, 100.0], [0.0, 200.0], :noaxes,
+ :background=>'white',
+ :width=>400, :height=>200){|chart|
+ pack(:fill=>:both, :side=>:top)
+ set_zoom_pan
+
+ chart.plot('rectangle', [10.0, 10.0, 50.0, 50.0], 'green')
+ chart.plot('filled-rectangle', [20.0, 20.0, 40.0, 40.0], 'red')
+ chart.plot('filled-circle', [70.0, 70.0, 40.0], 'yellow')
+ chart.plot('circle', [70.0, 70.0, 42.0])
+}
+
+###############################
+# Check the symbols
+###############################
+TkToplevel.new(:title=>'h'){|h|
+ Tk::Tcllib::Plotchart::XYPlot.new(h, [0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0],
+ :bg=>'white',
+ :width=>400, :height=>200){|chart|
+ pack(:fill=>:both)
+
+ yconfig(:format=>"%12.2e")
+
+ series1 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'red',
+ :type=>:symbol)
+ series2 = Tk::Tcllib::Plotchart::PlotSeries.new(chart, :colour=>'green',
+ :type=>:both)
+
+ x = 5.0
+ %w(plus cross circle up down dot upfilled downfilled).each{|sym|
+ series1.dataconfig(:symbol=>sym)
+ series2.dataconfig(:symbol=>sym)
+ series1.plot(x, 50.0)
+ series2.plot(x, 20)
+ x += 10
+ }
+ }
+}
+
+##############################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tcllib/xyplot.rb b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
new file mode 100644
index 0000000000..2aa101efcb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tcllib/xyplot.rb
@@ -0,0 +1,17 @@
+#!/usr/bin/ruby
+
+require 'tk'
+require 'tkextlib/tcllib/plotchart'
+
+TkCanvas.new(:background=>'white', :width=>400, :height=>200){|c|
+ pack(:fill=>:both)
+ Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0],
+ [0.0, 100.0, 20.0]){
+ [ [0.0, 32.0], [10.0, 50.0], [25.0, 60.0], [78.0, 11.0] ].each{|x, y|
+ plot('series1', x, y)
+ }
+ title("Data series")
+ }
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tile/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/tile/Orig_LICENSE.txt
new file mode 100644
index 0000000000..2326ef21fa
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/Orig_LICENSE.txt
@@ -0,0 +1,30 @@
+
+ ######################################################################
+ ### The following text is the original 'license.terms' of tile ###
+ ### extension. ###
+ ######################################################################
+
+
+LICENSE ("MIT-style")
+
+This software is Copyright (C) 2003 Joe English and other parties.
+
+The following terms apply to all files associated with this software
+unless explicitly disclaimed in individual files.
+
+The author(s) hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS for a PARTICULAR PURPOSE. IN NO EVENT
+shall the AUTHORS of THIS SOFTWARE be LIABLE to ANY PARTY for
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, or CONSEQUENTIAL DAMAGES
+arising out of the USE of THIS SOFTWARE and its DOCUMENTATION.
diff --git a/ext/tk/sample/tkextlib/tile/demo.rb b/ext/tk/sample/tkextlib/tile/demo.rb
new file mode 100644
index 0000000000..260ca00022
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/demo.rb
@@ -0,0 +1,983 @@
+#!/usr/bin/env ruby
+#
+# Demo for 'tile' package.
+#
+require 'tk'
+
+demodir = File.dirname($0)
+themesdir = File.join(demodir, 'themes')
+Tk::AUTO_PATH.lappend('.', demodir, themesdir)
+
+Dir.foreach(themesdir){|name|
+ next if name == '.' || name == '..'
+ dir = File.join(themesdir, name)
+ Tk::AUTO_PATH.lappend(dir) if File.directory?(dir)
+}
+
+require 'tkextlib/tile'
+
+def version?(ver)
+ TkPackage.vcompare(Tk::Tile.package_version, ver) >= 0
+end
+
+# define Tcl/Tk procedures for compatibility
+Tk::Tile.__define_LoadImages_proc_for_compatibility__!
+Tk::Tile::Style.__define_wrapper_proc_for_compatibility__!
+
+unless Tk::Tile::Style.theme_names.include?('step')
+ Tk::Tile::Style.theme_create('step')
+end
+
+Tk.load_tclscript(File.join(demodir, 'toolbutton.tcl'))
+Tk.load_tclscript(File.join(demodir, 'repeater.tcl'))
+
+# This forces an update of the available packages list. It's required
+# for package names to find the themes in demos/themes/*.tcl
+## Tk.tk_call(TkPackage.unknown_proc, 'Tcl', TkPackage.provide('Tcl'))
+## --> This doesn't work.
+## Because, unknown_proc may be "command + some arguments".
+Tk.ip_eval("#{TkPackage.unknown_proc} Tcl #{TkPackage.provide('Tcl')}")
+
+TkRoot.new{
+ title 'Tile demo'
+ iconname 'Tile demo'
+}
+
+# The descriptive names of the builtin themes.
+$THEMELIST = [
+ ['default', 'Default'],
+ ['classic', 'Classic'],
+ ['alt', 'Revitalized'],
+ ['winnative', 'Windows native'],
+ ['xpnative', 'XP Native'],
+ ['aqua', 'Aqua'],
+]
+
+$V = TkVariable.new_hash(:THEME => 'default',
+ :COMPOUND => 'top',
+ :CONSOLE => false,
+ :MENURADIO1 => 'One',
+ :MENUCHECK1 => true,
+ :PBMODE => 'determinate',
+ :SELECTED => true,
+ :CHOICE => 2)
+
+# Add in any available loadable themes.
+TkPackage.names.find_all{|n| n =~ /^(tile|ttk)::theme::/}.each{|pkg|
+ name = pkg.split('::')[-1]
+ unless $THEMELIST.assoc(name)
+ $THEMELIST << [name, Tk.tk_call('string', 'totitle', name)]
+ end
+}
+
+# Add theme definition written by ruby
+$RUBY_THEMELIST = []
+begin
+ load(File.join(demodir, 'themes', 'kroc.rb'), true)
+rescue => e
+raise e
+ $RUBY_THEMELIST << ['kroc-rb', 'Kroc (by Ruby)', false]
+else
+ $RUBY_THEMELIST << ['kroc-rb', 'Kroc (by Ruby)', true]
+end
+
+def makeThemeControl(parent)
+ c = Tk::Tile::Labelframe.new(parent, :text=>'Theme')
+ $THEMELIST.each{|theme, name|
+ b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme,
+ :variable=>$V.ref(:THEME),
+ :command=>proc{setTheme(theme)})
+ b.grid(:sticky=>:ew)
+ unless (TkPackage.names.find{|n| n =~ /(tile|ttk)::theme::#{theme}/})
+ b.ttk_state(:disabled)
+ end
+ }
+ $RUBY_THEMELIST.each{|theme, name, available|
+ b = Tk::Tile::Radiobutton.new(c, :text=>name, :value=>theme,
+ :variable=>$V.ref(:THEME),
+ :command=>proc{setTheme(theme)})
+ b.grid(:sticky=>:ew)
+ b.ttk_state(:disabled) unless available
+ }
+ c
+end
+
+def makeThemeMenu(parent)
+ m = TkMenu.new(parent)
+ $THEMELIST.each{|theme, name|
+ m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME),
+ :value=>theme, :command=>proc{setTheme(theme)})
+ unless (TkPackage.names.find{|n| n =~ /(tile|ttk)::theme::#{theme}/})
+ m.entryconfigure(:end, :state=>:disabled)
+ end
+ }
+ $RUBY_THEMELIST.each{|theme, name, available|
+ m.add(:radiobutton, :label=>name, :variable=>$V.ref(:THEME),
+ :value=>theme, :command=>proc{setTheme(theme)})
+ m.entryconfigure(:end, :state=>:disabled) unless available
+ }
+ m
+end
+
+def setTheme(theme)
+ if (pkg = TkPackage.names.find{|n| n =~ /(tile|ttk)::theme::#{theme}/})
+ unless Tk::Tile::Style.theme_names.find{|n| n == theme}
+ TkPackage.require(pkg)
+ end
+ end
+ Tk::Tile::Style.theme_use(theme)
+end
+
+#
+# Load icons...
+#
+$BUTTONS = ['open', 'new', 'save']
+$CHECKBOXES = ['bold', 'italic']
+$ICON = {}
+
+def loadIcons(file)
+ Tk.load_tclscript(file)
+ img_data = TkVarAccess.new('ImgData')
+ img_data.keys.each{|icon|
+ $ICON[icon] = TkPhotoImage.new(:data=>img_data[icon])
+ }
+end
+
+loadIcons(File.join(demodir, 'iconlib.tcl'))
+
+#
+# Utilities:
+#
+def foreachWidget(wins, cmd)
+ wins.each{|w|
+ cmd.call(w)
+ foreachWidget(w.winfo_children, cmd)
+ }
+end
+
+# sbstub
+# Used as the :command option for a scrollbar,
+# updates the scrollbar's position.
+#
+def sbstub(sb, cmd, num, units = 'units')
+ num = TkComm.number(num)
+ case cmd.to_s
+ when 'moveto'
+ sb.set(num, num+0.5)
+
+ when 'scroll'
+ if units.to_s == 'pages'
+ delta = 0.2
+ else
+ delta = 0.05
+ end
+ current = sb.get
+ sb.set(current[0] + delta * num, current[1] + delta * num)
+ end
+end
+
+# ... for debugging:
+TkBindTag::ALL.bind('ButtonPress-3', proc{|w| $W = w}, '%W')
+TkBindTag::ALL.bind('Control-ButtonPress-3', proc{|w| w.set_focus}, '%W')
+
+def showHelp()
+ Tk.messageBox(:message=>'No help yet...')
+end
+
+#
+# See toolbutton.tcl.
+TkOption.add('*Toolbar.relief', :groove)
+TkOption.add('*Toolbar.borderWidth', 2)
+
+TkOption.add('*Toolbar.Button.Pad', 2)
+
+$ROOT = Tk.root
+$BASE = $ROOT
+Tk.destroy(*($ROOT.winfo_children))
+
+$TOOLBARS = []
+
+#
+# Toolbar button standard vs. tile comparison:
+#
+def makeToolbars
+ #
+ # Tile toolbar:
+ #
+ tb = Tk::Tile::Frame.new($BASE, :class=>'Toolbar')
+ $TOOLBARS << tb
+ i = 0
+ $BUTTONS.each{|icon|
+ i += 1
+ Tk::Tile::Button.new(tb, :text=>icon, :image=>$ICON[icon],
+ :compound=>$V[:COMPOUND],
+ :style=>:Toolbutton).grid(:row=>0, :column=>i,
+ :sticky=>:news)
+ }
+ $CHECKBOXES.each{|icon|
+ i += 1
+ Tk::Tile::Checkbutton.new(tb, :text=>icon, :image=>$ICON[icon],
+ :variable=>$V.ref(icon),
+ :compound=>$V[:COMPOUND],
+ :style=>:Toolbutton).grid(:row=>0, :column=>i,
+ :sticky=>:news)
+ }
+
+ mb = Tk::Tile::Menubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'],
+ :compound=>$V[:COMPOUND])
+ mb.configure(:menu=>makeCompoundMenu(mb))
+ i += 1
+ mb.grid(:row=>0, :column=>i, :sticky=>:news)
+
+ i += 1
+ tb.grid_columnconfigure(i, :weight=>1)
+
+ #
+ # Standard toolbar:
+ #
+ tb = TkFrame.new($BASE, :class=>'Toolbar')
+ $TOOLBARS << tb
+ i = 0
+ $BUTTONS.each{|icon|
+ i += 1
+ TkButton.new(tb, :text=>icon, :image=>$ICON[icon],
+ :compound=>$V[:COMPOUND], :relief=>:flat,
+ :overrelief=>:raised).grid(:row=>0, :column=>i,
+ :sticky=>:news)
+ }
+ $CHECKBOXES.each{|icon|
+ i += 1
+ TkCheckbutton.new(tb, :text=>icon, :image=>$ICON[icon],
+ :variable=>$V.ref(icon), :compound=>$V[:COMPOUND],
+ :indicatoron=>false, :selectcolor=>'', :relief=>:flat,
+ :overrelief=>:raised).grid(:row=>0, :column=>i,
+ :sticky=>:news)
+ }
+
+ mb = TkMenubutton.new(tb, :text=>'toolbar', :image=>$ICON['file'],
+ :compound=>$V[:COMPOUND])
+ mb.configure(:menu=>makeCompoundMenu(mb))
+ i += 1
+ mb.grid(:row=>0, :column=>i, :sticky=>:news)
+
+ i += 1
+ tb.grid_columnconfigure(i, :weight=>1)
+end
+
+#
+# Toolbar :compound control:
+#
+def makeCompoundMenu(mb)
+ menu = TkMenu.new(mb)
+ %w(text image none top bottom left right center).each{|str|
+ menu.add(:radiobutton, :label=>Tk.tk_call('string', 'totitle', str),
+ :variable=>$V.ref(:COMPOUND), :value=>str,
+ :command=>proc{ changeToolbars() })
+ }
+ menu
+end
+
+makeToolbars()
+
+## CONTROLS
+control = Tk::Tile::Frame.new($BASE)
+
+#
+# Overall theme control:
+#
+makeThemeControl(control).grid(:sticky=>:news, :padx=>6, :ipadx=>6)
+control.grid_rowconfigure(99, :weight=>1)
+
+def changeToolbars
+ foreachWidget($TOOLBARS,
+ proc{|w|
+ begin
+ w.compound($V[:COMPOUND])
+ rescue
+ end
+ })
+end
+
+def scrolledWidget(parent, klass, themed, *args)
+ if themed
+ f = Tk::Tile::Frame.new(parent)
+ t = klass.new(f, *args)
+ vs = Tk::Tile::Scrollbar.new(f)
+ hs = Tk::Tile::Scrollbar.new(f)
+ else
+ f = TkFrame.new(parent)
+ t = klass.new(f, *args)
+ vs = TkScrollbar.new(f)
+ hs = TkScrollbar.new(f)
+ end
+ t.yscrollbar(vs)
+ t.xscrollbar(hs)
+
+ TkGrid.configure(t, vs, :sticky=>:news)
+ TkGrid.configure(hs, 'x', :sticky=>:news)
+ TkGrid.rowconfigure(f, 0, :weight=>1)
+ TkGrid.columnconfigure(f, 0, :weight=>1)
+
+ [f, t]
+end
+
+#
+# Notebook demonstration:
+#
+def makeNotebook
+ nb = Tk::Tile::Notebook.new($BASE, :padding=>6)
+ nb.enable_traversal
+ client = Tk::Tile::Frame.new(nb)
+ nb.add(client, :text=>'Demo', :underline=>0)
+ nb.select(client)
+
+ scales = Tk::Tile::Frame.new(nb)
+ nb.add(scales, :text=>'Scales')
+ combo = Tk::Tile::Frame.new(nb)
+ nb.add(combo, :text=>'Combobox', :underline=>7)
+ tree = Tk::Tile::Frame.new(nb)
+ nb.add(tree, :text=>'Tree')
+ others = Tk::Tile::Frame.new(nb)
+ nb.add(others, :text=>'Others', :underline=>4)
+
+ [nb, client, scales, combo, tree, others]
+end
+
+nb, client, scales, combo, tree, others = makeNotebook()
+
+#
+# Side-by side check, radio, and menu button comparison:
+#
+def fillMenu(menu)
+ %w(above below left right flush).each{|dir|
+ menu.add(:command, :label=>Tk.tk_call('string', 'totitle', dir),
+ :command=>proc{ menu.winfo_parent.direction(dir) })
+ }
+ menu.add(:cascade, :label=>'Submenu', :menu=>(submenu = TkMenu.new(menu)))
+ submenu.add(:command, :label=>'Subcommand 1')
+ submenu.add(:command, :label=>'Subcommand 2')
+ submenu.add(:command, :label=>'Subcommand 3')
+
+ menu.add(:separator)
+ menu.add(:command, :label=>'Quit', :command=>proc{Tk.root.destroy})
+end
+
+l = Tk::Tile::Labelframe.new(client, :text=>'Themed', :padding=>6)
+r = TkLabelframe.new(client, :text=>'Standard', :padx=>6, :pady=>6)
+
+## Styled frame
+cb = Tk::Tile::Checkbutton.new(l, :text=>'Checkbutton',
+ :variable=>$V.ref(:SELECTED), :underline=>2)
+rb1 = Tk::Tile::Radiobutton.new(l, :text=>'One', :variable=>$V.ref(:CHOICE),
+ :value=>1, :underline=>0)
+rb2 = Tk::Tile::Radiobutton.new(l, :text=>'Two', :variable=>$V.ref(:CHOICE),
+ :value=>2)
+rb3 = Tk::Tile::Radiobutton.new(l, :text=>'Three',
+ :variable=>$V.ref(:CHOICE),
+ :value=>3, :underline=>0)
+btn = Tk::Tile::Button.new(l, :text=>'Button', :underline=>0)
+
+mb = Tk::Tile::Menubutton.new(l, :text=>'Menubutton', :underline=>2)
+m = TkMenu.new(mb)
+mb.menu(m)
+fillMenu(m)
+
+$entryText = TkVariable.new('Entry widget')
+e = Tk::Tile::Entry.new(l, :textvariable=>$entryText)
+e.selection_range(6, :end)
+
+ltext_f, ltext = scrolledWidget(l, TkText, true,
+ :width=>12, :height=>5, :wrap=>:none)
+# NOTE TO MAINTAINERS:
+# The checkbuttons are -sticky ew / -expand x on purpose:
+# it demonstrates one of the differences between TCheckbuttons
+# and standard checkbuttons.
+#
+Tk.grid(cb, :sticky=>:ew)
+Tk.grid(rb1, :sticky=>:ew)
+Tk.grid(rb2, :sticky=>:ew)
+Tk.grid(rb3, :sticky=>:ew)
+Tk.grid(btn, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(mb, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(e, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(ltext_f, :sticky=>:news)
+
+TkGrid.columnconfigure(l, 0, :weight=>1)
+TkGrid.rowconfigure(l, 7, :weight=>1) # text widget (grid is a PITA)
+
+## Orig frame
+cb = TkCheckbutton.new(r, :text=>'Checkbutton', :variable=>$V.ref(:SELECTED))
+rb1 = TkRadiobutton.new(r, :text=>'One',
+ :variable=>$V.ref(:CHOICE), :value=>1)
+rb2 = TkRadiobutton.new(r, :text=>'Two', :variable=>$V.ref(:CHOICE),
+ :value=>2, :underline=>1)
+rb3 = TkRadiobutton.new(r, :text=>'Three',
+ :variable=>$V.ref(:CHOICE), :value=>3)
+btn = TkButton.new(r, :text=>'Button')
+
+mb = TkMenubutton.new(r, :text=>'Menubutton', :underline=>3, :takefocus=>true)
+m = TkMenu.new(mb)
+mb.menu(m)
+$V[:rmbIndicatoron] = mb.indicatoron
+m.add(:checkbutton, :label=>'Indicator?', #'
+ :variable=>$V.ref(:rmbIndicatoron),
+ :command=>proc{mb.indicatoron($V[:rmbIndicatoron])})
+m.add(:separator)
+fillMenu(m)
+
+e = TkEntry.new(r, :textvariable=>$entryText)
+
+rtext_f, rtext = scrolledWidget(r, TkText, false,
+ :width=>12, :height=>5, :wrap=>:none)
+
+Tk.grid(cb, :sticky=>:ew)
+Tk.grid(rb1, :sticky=>:ew)
+Tk.grid(rb2, :sticky=>:ew)
+Tk.grid(rb3, :sticky=>:ew)
+Tk.grid(btn, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(mb, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(e, :sticky=>:ew, :padx=>2, :pady=>2)
+Tk.grid(rtext_f, :sticky=>:news)
+
+TkGrid.columnconfigure(l, 0, :weight=>1)
+TkGrid.rowconfigure(l, 7, :weight=>1) # text widget (grid is a PITA)
+
+Tk.grid(l, r, :sticky=>:news, :padx=>6, :pady=>6)
+TkGrid.rowconfigure(client, 0, :weight=>1)
+TkGrid.columnconfigure(client, [0, 1], :weight=>1)
+
+#
+# Add some text to the text boxes:
+#
+msgs = [
+"The cat crept into the crypt, crapped and crept out again",
+"Peter Piper picked a peck of pickled peppers",
+"How much wood would a woodchuck chuck if a woodchuck could chuck wood",
+"He thrusts his fists against the posts and still insists he sees the ghosts",
+"Who put the bomb in the bom-b-bom-b-bom,",
+"Is this your sister's sixth zither, sir?",
+"Who put the ram in the ramalamadingdong?",
+"I am not the pheasant plucker, I'm the pheasant plucker's mate."
+]
+
+nmsgs = msgs.size
+(0...50).each{|n|
+ msg = msgs[n % nmsgs]
+ ltext.insert(:end, "#{n}: #{msg}\n")
+ rtext.insert(:end, "#{n}: #{msg}\n")
+}
+#
+# Scales and sliders pane:
+#
+l = Tk::Tile::Labelframe.new(scales, :text=>'Themed', :padding=>6)
+r = TkLabelframe.new(scales, :text=>'Standard', :padx=>6, :pady=>6)
+
+if version?('0.6')
+
+ # thremed frame
+ scale = Tk::Tile::Scale.new(l, :orient=>:horizontal, :from=>0, :to=>100,
+ :variable=>$V.ref(:SCALE))
+ vscale = Tk::Tile::Scale.new(l, :orient=>:vertical, :from=>0, :to=>100,
+ :variable=>$V.ref(:VSCALE))
+ progress = Tk::Tile::Progressbar.new(l, :orient=>:horizontal, :maximum=>100)
+ vprogress = Tk::Tile::Progressbar.new(l, :orient=>:vertical, :maximum=>100)
+
+ if true
+ def progress.inverted(w, value)
+ if w.mode == 'indeterminate'
+ w.value(value)
+ else
+ w.value(w.maximum - value)
+ end
+ end
+ scale.command {|value| progress.value(value)}
+ vscale.command {|value| progress.inverted(vprogress, value) }
+ else
+ # This would also work, but the Tk scale widgets
+ # in the right hand pane cause some interference when
+ # in autoincrement/indeterminate mode.
+ #
+ progress.variable $V.ref(:SCALE)
+ vprogress.variable $V.ref(:VSCALE)
+ end
+
+ scale.set(50)
+ vscale.set(50)
+
+ lmode = Tk::Tile::Label.new(l, :text=>'Progress bar mode')
+ pbmode0 = Tk::Tile::Radiobutton.new(l, :variable=>$V.ref(:PBMODE),
+ :text=>'determinate', :value=>'determinate',
+ :command=>proc{pbMode(progress, vprogress)})
+ pbmode1 = Tk::Tile::Radiobutton.new(l, :variable=>$V.ref(:PBMODE),
+ :text=>'indeterminate', :value=>'indeterminate',
+ :command=>proc{pbMode(progress, vprogress)})
+ def pbMode(progress, vprogress)
+ if vprogress.mode != $V[:PBMODE]
+ vprogress.value(vprogress.maximum - vprogress.value)
+ end
+
+ progress.mode $V[:PBMODE]
+ vprogress.mode $V[:PBMODE]
+ end
+
+ start = Tk::Tile::Button.new(l, :text=>"Start",
+ :command=>proc{pbStart(progress, vprogress)})
+ def pbStart(progress, vprogress)
+ # $V[:PBMODE] = 'indeterminate'
+ pbMode(progress, vprogress)
+ progress.start 10
+ vprogress.start
+ end
+
+ stop = Tk::Tile::Button.new(l, :text=>'Stop',
+ :command=>proc{pbStop(progress, vprogress)})
+ def pbStop(progress, vprogress)
+ progress.stop
+ vprogress.stop
+ end
+
+ Tk.grid(scale, :columnspan=>2, :sticky=>'ew')
+ Tk.grid(progress, :columnspan=>2, :sticky=>'ew')
+ Tk.grid(vscale, vprogress, :sticky=>'nws')
+
+ Tk.grid(lmode, :sticky=>'we', :columnspan=>2)
+ Tk.grid(pbmode0, :sticky=>'we', :columnspan=>2)
+ Tk.grid(pbmode1, :sticky=>'we', :columnspan=>2)
+ Tk.grid(start, :sticky=>'we', :columnspan=>2)
+ Tk.grid(stop, :sticky=>'we', :columnspan=>2)
+
+ l.grid_columnconfigure(0, :weight=>1)
+ l.grid_columnconfigure(1, :weight=>1)
+ l.grid_rowconfigure(99, :weight=>1)
+
+ # standard frame
+ TkScale.new(r, :orient=>:horizontal, :from=>0, :to=>100,
+ :variable=>$V.ref(:SCALE)).grid(:sticky=>'news')
+ TkScale.new(r, :orient=>:vertical, :from=>0, :to=>100,
+ :variable=>$V.ref(:VSCALE)).grid(:sticky=>'nws')
+
+ r.grid_columnconfigure(0, :weight=>1)
+ r.grid_columnconfigure(1, :weight=>1)
+ r.grid_rowconfigure(99, :weight=>1)
+
+else # tile 0.5 or earlier
+
+ # themed frame
+ scale = Tk::Tile::Scale.new(l, :variable=>$V.ref(:SCALE),
+ :orient=>:horizontal, :from=>0, :to=>100)
+ vscale = Tk::Tile::Scale.new(l, :variable=>$V.ref(:VSCALE),
+ :orient=>:vertical, :from=>-25, :to=>25)
+
+ progress = Tk::Tile::Progress.new(l,
+ :orient=>:horizontal, :from=>0, :to=>100)
+ vprogress = Tk::Tile::Progress.new(l,
+ :orient=>:vertical, :from=>-25, :to=>25)
+
+ if true
+ scale.command{|value| progress.set(value)}
+ vscale.command{|value| vprogress.set(value)}
+ else # this would also work. (via TkVariable#trace)
+ v1 = scale.variable
+ v2 = vscale.variable
+ v1.trace('w', proc{ progress.set(v1.value) })
+ v2.trace('w', proc{ vprogress.set(v2.value) })
+ end
+
+ Tk.grid(scale, :columnspan=>2, :sticky=>:ew)
+ Tk.grid(progress, :columnspan=>2, :sticky=>:ew)
+ Tk.grid(vscale, vprogress, :sticky=>:nws)
+ TkGrid.columnconfigure(l, 0, :weight=>1)
+ TkGrid.columnconfigure(l, 1, :weight=>1)
+
+ # standard frame
+ TkScale.new(r, :variable=>$V.ref(:SCALE),
+ :orient=>:horizontal, :from=>0, :to=>100).grid(:sticky=>'news')
+ TkScale.new(r, :variable=>$V.ref(:VSCALE),
+ :orient=>:vertical, :from=>-25, :to=>25).grid(:sticky=>'nws')
+
+ TkGrid.columnconfigure(r, 0, :weight=>1)
+ TkGrid.columnconfigure(r, 1, :weight=>1)
+end
+
+# layout frames
+Tk.grid(l, r, :sticky=>'nwes', :padx=>6, :pady=>6)
+scales.grid_columnconfigure(0, :weight=>1)
+scales.grid_columnconfigure(1, :weight=>1)
+scales.grid_rowconfigure(0, :weight=>1)
+
+#
+# Command box:
+#
+cmd = Tk::Tile::Frame.new($BASE)
+b_close = Tk::Tile::Button.new(cmd, :text=>'Close',
+ :underline=>0, :default=>:normal,
+ :command=>proc{Tk.root.destroy})
+b_help = Tk::Tile::Button.new(cmd, :text=>'Help', :underline=>0,
+ :default=>:normal, :command=>proc{showHelp()})
+Tk.grid('x', b_close, b_help, :pady=>[6, 4], :padx=>4)
+TkGrid.columnconfigure(cmd, 0, :weight=>1)
+
+#
+# Set up accelerators:
+#
+$ROOT.bind('KeyPress-Escape', proc{Tk.event_generate(b_close, '<Invoke>')})
+$ROOT.bind('<Help>', proc{Tk.event_generate(b_help, '<Invoke>')})
+Tk::Tile::KeyNav.enableMnemonics($ROOT)
+Tk::Tile::KeyNav.defaultButton(b_help)
+
+Tk.grid($TOOLBARS[0], '-', :sticky=>:ew)
+Tk.grid($TOOLBARS[1], '-', :sticky=>:ew)
+Tk.grid(control, nb, :sticky=>:news)
+Tk.grid(cmd, '-', :sticky=>:ew)
+TkGrid.columnconfigure($ROOT, 1, :weight=>1)
+TkGrid.rowconfigure($ROOT, 2, :weight=>1)
+
+#
+# Add a menu
+#
+menu = TkMenu.new($BASE)
+$ROOT.menu(menu)
+m_file = TkMenu.new(menu, :tearoff=>0)
+menu.add(:cascade, :label=>'File', :underline=>0, :menu=>m_file)
+m_file.add(:command, :label=>'Open', :underline=>0,
+ :compound=>:left, :image=>$ICON['open'])
+m_file.add(:command, :label=>'Save', :underline=>0,
+ :compound=>:left, :image=>$ICON['save'])
+m_file.add(:separator)
+m_f_test = TkMenu.new(menu, :tearoff=>0)
+m_file.add(:cascade, :label=>'Test submenu', :underline=>0, :menu=>m_f_test)
+m_file.add(:checkbutton, :label=>'Text check', :underline=>5,
+ :variable=>$V.ref(:MENUCHECK1))
+m_file.insert(:end, :separator)
+
+if Tk.windowingsystem != 'x11'
+ TkConsole.create
+ m_file.insert(:end, :checkbutton, :label=>'Console', :underline=>5,
+ :variable=>$V.ref(:CONSOLE), :command=>proc{toggle_console()})
+ def toggle_console
+ if TkComm.bool($V[:CONSOLE])
+ TkConsole.show
+ else
+ TkConsole.hide
+ end
+ end
+end
+
+m_file.add(:command, :label=>'Exit', :underline=>1,
+ :command=>proc{Tk.event_generate(b_close, '<Invoke>')})
+
+%w(One Two Three Four).each{|lbl|
+ m_f_test.add(:radiobutton, :label=>lbl, :variable=>$V.ref(:MENURADIO1))
+}
+
+# Add Theme menu.
+#
+menu.add(:cascade, :label=>'Theme', :underline=>3,
+ :menu=>makeThemeMenu(menu))
+
+setTheme($V[:THEME])
+
+#
+# Combobox demo pane:
+#
+values = %w(list abc def ghi jkl mno pqr stu vwx yz)
+2.times {|i|
+ cb = Tk::Tile::Combobox.new(
+ combo, :values=>values, :textvariable=>$V.ref(:COMBO))
+ cb.pack(:side=>:top, :padx=>2, :pady=>2, :expand=>false, :fill=>:x)
+ if i == 1
+ cb.ttk_state :readonly
+ begin
+ cb.current = 3 # ignore if unsupported (tile0.4)
+ rescue
+ end
+ end
+}
+
+#
+# Treeview widget demo pane:
+#
+if version?('0.5')
+
+ treeview = nil # avoid 'undefined' error
+ scrollbar = Tk::Tile::Scrollbar.new(tree,
+ :command=>proc{|*args| treeview.yview(*args)})
+ treeview = Tk::Tile::Treeview.new(tree, :columns=>%w(Class), :padding=>4,
+ :yscrollcommand=>proc{|*args| scrollbar.set(*args)})
+
+ Tk.grid(treeview, scrollbar, :sticky=>'news')
+ tree.grid_columnconfigure(0, :weight=>1)
+ tree.grid_rowconfigure(0, :weight=>1)
+ tree.grid_propagate(0)
+
+ # Add initial tree node:
+ # Later nodes will be added in <<TreeviewOpen>> binding.
+ treeview.insert('', 0, :id=>'.', :text=>'Main Window', :open=>false,
+ :values=>[TkWinfo.classname('.')])
+ treeview.headingconfigure('#0', :text=>'Widget')
+ treeview.headingconfigure('Class', :text=>'Class')
+ treeview.bind('<TreeviewOpen>', proc{fillTree(treeview)})
+
+ def fillTree(treeview)
+ id = treeview.focus_item
+ unless TkWinfo.exist?(id)
+ treeview.delete(id)
+ end
+ # Replace tree item children with current list of child windows.
+ treeview.delete(treeview.children(id))
+ for child in TkWinfo.children(id)
+ treeview.insert(id, :end, :id=>child, :text=>TkWinfo.appname(child),
+ :open=>false, :values=>[TkWinfo.classname(child)])
+ unless TkWinfo.children(child).empty?
+ # insert dummy child to show [+] indicator
+ treeview.insert(child, :end)
+ end
+ end
+ end
+
+else
+ Tk::Tile::Label.new(tree,
+ :text=>'Treeview is supported on tile 0.5 or later...').pack
+end
+
+#
+# Other demos:
+#
+$Timers = {:StateMonitor=>nil, :FocusMonitor=>nil}
+
+begin
+ msg = Tk::Tile::Label.new(others, :justify=>:left, :wraplength=>300)
+rescue
+ msg = TkMessage.new(others, :aspect=>200)
+end
+
+$Desc = {}
+
+showDescription = TkBindTag.new
+showDescription.bind('Enter', proc{|w| msg.text($Desc[w.path])}, '%W')
+showDescription.bind('Leave', proc{|w| msg.text('')}, '%W')
+
+[
+ [ :trackStates, "Widget states...",
+ "Display/modify widget state bits" ],
+
+ [ :scrollbarResizeDemo, "Scrollbar resize behavior...",
+ "Shows how Tile and standard scrollbars differ when they're sized too large" ],
+
+ [ :trackFocus, "Track keyboard focus..." ,
+ "Display the name of the widget that currently has focus" ],
+
+ [ :repeatDemo, "Repeating buttons...",
+ "Demonstrates custom classes (see demos/repeater.tcl)" ]
+
+].each{|demo_cmd, label, description|
+ b = Tk::Tile::Button.new(others, :text=>label,
+ :command=>proc{ self.__send__(demo_cmd) })
+ $Desc[b.path] = description
+ b.bindtags <<= showDescription
+
+ b.pack(:side=>:top, :expand=>false, :fill=>:x, :padx=>6, :pady=>6)
+}
+
+msg.pack(:side=>:bottom, :expand=>true, :fill=>:both)
+
+
+#
+# Scrollbar resize demo:
+#
+$scrollbars = nil
+
+def scrollbarResizeDemo
+ if $scrollbars
+ begin
+ $scrollbars.destroy
+ rescue
+ end
+ end
+ $scrollbars = TkToplevel.new(:title=>'Scrollbars', :geometry=>'200x200')
+ f = TkFrame.new($scrollbars, :height=>200)
+ tsb = Tk::Tile::Scrollbar.new(f, :command=>proc{|*args| sbstub(tsb, *args)})
+ sb = TkScrollbar.new(f, :command=>proc{|*args| sbstub(sb, *args)})
+ Tk.grid(tsb, sb, :sticky=>:news)
+
+ sb.set(0, 0.5) # prevent backwards-compatibility mode for old SB
+
+ f.grid_columnconfigure(0, :weight=>1)
+ f.grid_columnconfigure(1, :weight=>1)
+ f.grid_rowconfigure(0, :weight=>1)
+
+ f.pack(:expand=>true, :fill=>:both)
+end
+
+#
+# Track focus demo:
+#
+$FocusInf = TkVariable.new_hash
+$focus = nil
+
+def trackFocus
+ if $focus
+ begin
+ $focus.destroy
+ rescue
+ end
+ end
+ $focus = TkToplevel.new(:title=>'Keyboard focus')
+ i = 0
+ [
+ ["Focus widget:", :Widget],
+ ["Class:", :WidgetClass],
+ ["Next:", :WidgetNext],
+ ["Grab:", :Grab],
+ ["Status:", :GrabStatus]
+ ].each{|label, var_index|
+ Tk.grid(Tk::Tile::Label.new($focus, :text=>label, :anchor=>:e),
+ Tk::Tile::Label.new($focus,
+ :textvariable=>$FocusInf.ref(var_index),
+ :width=>40, :anchor=>:w, :relief=>:groove),
+ :sticky=>:ew)
+ i += 1
+ }
+ $focus.grid_columnconfigure(1, :weight=>1)
+ $focus.grid_rowconfigure(i, :weight=>1)
+
+ $focus.bind('Destroy', proc{Tk.after_cancel($Timers[:FocusMonitor])})
+ focusMonitor
+end
+
+def focusMonitor
+ $FocusInf[:Widget] = focus_win = Tk.focus
+ if focus_win
+ $FocusInf[:WidgetClass] = focus_win.winfo_classname
+ $FocusInf[:WidgetNext] = Tk.focus_next(focus_win)
+ else
+ $FocusInf[:WidgetClass] = $FocusInf[:WidgetNext] = ''
+ end
+
+ $FocusInf[:Grab] = grab_wins = Tk.current_grabs
+ unless grab_wins.empty?
+ $FocusInf[:GrabStatus] = grab_wins[0].grab_status
+ else
+ $FocusInf[:GrabStatus] = ''
+ end
+
+ $Timers[:FocusMonitor] = Tk.after(200, proc{ focusMonitor() })
+end
+
+#
+# Widget state demo:
+#
+$Widget = TkVariable.new
+
+TkBindTag::ALL.bind('Control-Shift-ButtonPress-1',
+ proc{|w|
+ $Widget.value = w
+ updateStates()
+ Tk.callback_break
+ }, '%W')
+$states_list = %w(active disabled focus pressed selected
+ background indeterminate invalid default)
+$states_btns = {}
+$states = nil
+
+$State = TkVariable.new_hash
+
+def trackStates
+ if $states
+ begin
+ $state.destroy
+ rescue
+ end
+ end
+ $states = TkToplevel.new(:title=>'Widget states')
+
+ l_inf = Tk::Tile::Label.new($states, :text=>"Press Control-Shift-Button-1 on any widget")
+
+ l_lw = Tk::Tile::Label.new($states, :text=>'Widget:',
+ :anchor=>:e, :relief=>:groove)
+ l_w = Tk::Tile::Label.new($states, :textvariable=>$Widget,
+ :anchor=>:w, :relief=>:groove)
+
+ Tk.grid(l_inf, '-', :sticky=>:ew, :padx=>6, :pady=>6)
+ Tk.grid(l_lw, l_w, :sticky=>:ew)
+
+ $states_list.each{|st|
+ cb = Tk::Tile::Checkbutton.new($states, :text=>st,
+ :variable=>$State.ref(st),
+ :command=>proc{ changeState(st) })
+ $states_btns[st] = cb
+ Tk.grid('x', cb, :sticky=>:nsew)
+ }
+
+ $states.grid_columnconfigure(1, :weight=>1)
+
+ f_cmd = Tk::Tile::Frame.new($states)
+ Tk.grid('x', f_cmd, :sticky=>:nse)
+
+ b_close = Tk::Tile::Button.new(f_cmd, :text=>'Close',
+ :command=>proc{ $states.destroy })
+ Tk.grid('x', b_close, :padx=>4, :pady=>[6,4])
+ f_cmd.grid_columnconfigure(0, :weight=>1)
+
+ $states.bind('KeyPress-Escape', proc{Tk.event_generate(b_close, '<Invoke>')})
+
+ $states.bind('Destroy', proc{Tk.after_cancel($Timers[:StateMonitor])})
+ stateMonitor()
+end
+
+def stateMonitor
+ updateStates() if $Widget.value != ''
+ $Timers[:StateMonitor] = Tk.after(200, proc{ stateMonitor() })
+end
+
+def updateStates
+ $states_list.each{|st|
+ begin
+ $State[st] = $Widget.window.ttk_instate(st)
+ rescue
+ $states_btns[st].ttk_state('disabled')
+ else
+ $states_btns[st].ttk_state('!disabled')
+ end
+ }
+end
+
+def changeState(st)
+ if $Widget.value != ''
+ if $State.bool_element(st)
+ $Widget.window.ttk_state(st)
+ else
+ $Widget.window.ttk_state("!#{st}")
+ end
+ end
+end
+
+#
+# Repeating buttons demo:
+#
+def repeatDemo
+ if defined?($repeatDemo) && $repeatDemo.exist?
+ $repeatDemo.deiconify; return
+ end
+ $repeatDemo = TkToplevel.new(:title=>'Repeating button')
+
+ f = Tk::Tile::Frame.new($repeatDemo)
+ b = Tk::Tile::Button.new(f, :class=>'Repeater', :text=>'Press and hold')
+ if version?('0.6')
+ p = Tk::Tile::Progressbar.new(f, :orient=>:horizontal, :maximum=>10)
+ else # progressbar is not supported
+ p = Tk::Tile::Progress.new(f, :orient=>:horizontal, :from=>0, :to=>10)
+ def p.step
+ i = self.get + 1
+ i = self.from if i > self.to
+ self.set(i)
+ end
+ end
+ b.command {p.step}
+
+ b.pack(:side=>:left, :expand=>false, :fill=>:none, :padx=>6, :pady=>6)
+ p.pack(:side=>:right, :expand=>true, :fill=>:x, :padx=>6, :pady=>6)
+ f.pack(:expand=>true, :fill=>:both)
+end
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tile/iconlib.tcl b/ext/tk/sample/tkextlib/tile/iconlib.tcl
new file mode 100644
index 0000000000..9a93ece504
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/iconlib.tcl
@@ -0,0 +1,110 @@
+array set ImgData {
+bold {R0lGODlhEAAQAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAQABAAAAI6hI+py60U3wj+
+RYQFJYRvEWFBCeFbRFhQQvhG8YPgX0RYUEL4FhEWlBC+RYQFJYQPFN8IPqYut/8hBQA7}
+copy {R0lGODlhEAAQAJEAANnZ2QAAAP///wAAhCH5BAEAAAAALAAAAAAQABAAAAJUhI8JFJ/gY4iI
+UEL4FyIiFIXgW0iEUDgfACBI9pzMAAGRiIghWSMDECR7JEKGtkFIRFBG+TIQKDQxtgzcDcmX
+IfgwQrFlCD4MyZch+EDzj+Bj6mYBADs=}
+cut {R0lGODlhEAAQAJEAANnZ2QAAAAAAhP///yH5BAEAAAAALAAAAAAQABAAAAJFhI+pcUHwEeIi
+E0gACIKPEAFBIXy0gMg8EhM+YmQiKSL4eAIiJMI/EQEhQGYGYiQIQAg+iAkIATIzECMBIgT/
+RBARERlSADs=}
+dragfile {R0lGODlhGAAYAKIAANnZ2TMzM////wAAAJmZmf///////////yH5BAEAAAAALAAAAAAYABgA
+AAPACBi63IqgC4GiyxwogaAbKLrMgSKBoBoousyBogEACIGiyxwoKgGAECI4uiyCExMTOACB
+osuNpDoAGCI4uiyCIkREOACBosutSDoAgSI4usyCIjQAGCi63Iw0ACEoOLrMgiI0ABgoutyM
+NAAhKDi6zIIiNAAYKLrcjDQAISg4usyCIjQAGCi63Iw0AIGiiqPLIyhCA4CBosvNSAMQKKo4
+ujyCIjQAGCi63Iw0AIGiy81IAxCBpMu9GAMAgKPL3QgJADs=}
+dragicon {R0lGODlhGAAYALMAANnZ2TMzM/////8zM8zMzGYAAAAAAJmZmQCZMwAzZgCZzGZmZv//////
+/////////yH5BAEAAAAALAAAAAAYABgAAAT/EMAgJ60SAjlBgEJOSoMIEMgZoJCT0iADBFIG
+KOSkNMwAAABhwiHnIEKIIIQQAQIZhBBwyDmKEMIEE0yABoAghIBDzlGEENDIaQAIQgg45BwF
+CinPOccAECYcUiKEEBFCiHPgMQAEIcQYYyABBUGIQCHlMQCEScZAAhKEEApCECGOARAEIQQp
+BRGIpAyCJCGOASBAISdEcqJAVBLiGABggELOAJGUKyiVhDgGABigkJMEhNAKSqkEhTgGgCCl
+FCQEGIJSSiUhjgEgQCEnJVBJmYQ4BoAAhZyTQCVnEuIYAAIUckoCk5xSiGMACFDISSs9BoBg
+rRXQMQAEKOSklR4DEUAI8MhJ6wwGAACgkZNWCkAEADs=}
+error {R0lGODlhIAAgAKIAANnZ2YQAAP8AAISEhP///////////////yH5BAEAAAAALAAAAAAgACAA
+AAP/CLoMGLqKoMvtGIqiqxEYCLrcioGiyxwIusyBgaLLLRiBoMsQKLrcjYGgu4Giy+2CAkFX
+A0WX2wXFIOgGii7trkCEohsDCACBoktEKLpKhISiGwAIECiqSKooukiqKKoxgACBooukKiIo
+SKoouj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wAA/wAAAP///////yH5BAEAAAAALAAAAAAgACAA
+AAP/CLoMGLqKoMvtGCo4uhKBgaDLDRghOLqsghEIuryBgqPLPSiBoMsQOLojhEQkOLpTCLob
+OLqKpIujq4WgC4Gju0i6OLpbCKohOLorhEQkOLorhaAQOLrc3qgCIARHl9sbSQUEji4j6RKO
+Lk9hQODosiKp4ujyFIbi6LIiqeLo8hSG4uiyIqni6PIUhuLosiKp4ujyFIYKji4PkiqOLkth
+BASOLg+SKo4uV2AEhODoMpIqju5KYShA4Ogqku7i6E4FRgAAYOHocvugiohAUC0cXe7GiohA
+0IUSHF3uQamICATdrULB0WUVrIqIQNBlCCwVHF2pwsJQRdDlDYyoKsHRPMLQDQRdbsDQqBmc
+wlBF0OV2jJqZwggEXW5vVDMVgaDL7Y5qKgJBl9sfVUUg6HL7AxSKoMvtr1AEgi5DAgA7}
+italic {R0lGODlhEAAQAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAQABAAAAIrhI+py+1A4hN8
+hIjINBITPlpEZBqJCR8tIjKNxISPFhGZQOITfExdbv9FCgA7}
+new {R0lGODlhEAAQAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAQABAAAAJFhI95FN8IvgXJ
+jyD4ECQ/JAh+kPyICIIdJP+CYAfJvyDYQfIvCHaQ/AuCHST/gmAHyb8g2EHyLwh2kPwLgk3x
+MQg+pu4WADs=}
+open {R0lGODlhEAAQAKIAANnZ2QAAAP//AP///4SEAP///////////yH5BAEAAAAALAAAAAAQABAA
+AANZCLrczigUQZc1EDQgEHSZAwMgIhB0NQIDQkYwdANBNUZwZGQEJxBUQwZlZGRQAkE1RnAE
+Q5dVcCSQdDcAYySQdDcAISSQdDcAASKQdDcAAQBDlwNBl9sfApQAOw==}
+openfold {R0lGODlhEAANAKIAANnZ2YSEhP///8bGxv//AAAAAP///////yH5BAEAAAAALAAAAAAQAA0A
+AANgCIqhiqDLgaIaCLoagkNDIxi6AIFCQ0M4KKpRgCFDQzg0NIQThaH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B0uQqrcHSZAiMAAJBw
+dFcKS3B0lwIjAkGVcHS5GykiAkEXSHB0uQeFIiIQdJcIBUeXVZAoIgJBT5chkFRwdIUICUMV
+QZc3MIKIBEcJQzcQdLkBQ4NmcAhDFUGX2zFoZggjEHS5vRHNUASCLrc7oqEIBF1uf0QUgaDL
+7Q9QKIIut79CEQi6DAkAOw==}
+redo {R0lGODlhEAAQAJEAANnZ2QAAhP///////yH5BAEAAAAALAAAAAAQABAAAAIvhI+py+1vSByC
+jxAYQXDMwsyAggQAQBB8iwgMgg8REQgUwqbYBDsIPqYutz+MgBQAOw==}
+save {R0lGODlhEAAQAJEAANnZ2QAAAISEAP///yH5BAEAAAAALAAAAAAQABAAAAJWhI9pFB8RIIRC
++BYQFqQQvkWEBSmEbyFhQQrhW0hYkEL4FhIWpBC+hYQFSYxvIgFAoXy0AAiSGP8kAIIkxgcI
+CSBEQvEBQgIIkVB8gJAAAhgfj+BjWgEAOw==}
+underline {R0lGODlhEAAQAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAQABAAAAI3hI+py60UBy4I
+vkVcBMG/iIsg+BdxEQT/Ii6C4F/ERRD8i7gIgn8RF0HwkWITfExFin8EH1OXCwA7}
+undo {R0lGODlhEAAQAJEAANnZ2QAAhP///////yH5BAEAAAAALAAAAAAQABAAAAIuhI+py+2vSByC
+HxdxQCHsCIg7oAAAEUHwLTAiKIQPgRSbYMfd3VEIH1OX2x8mUgA7}
+warning {R0lGODlhIAAgAKIAANnZ2YSEAP//AMbGxgAAAISEhP///////yH5BAEAAAAALAAAAAAgACAA
+AAP/CLq8gREIutz+KESGEHS5vVGIiAxSIehy+6JAUaUqBF1uBxQoukOFhaDL7RgoukKFhaDL
+3RgoujqEVQi63IyBortUWAi63IuBostDWIWgy60YIjKERCMiSFUIutyAISKCpCoiOFSFoMsd
+KCpIqiKCQlUIusyBooqkKiIoQ1UIuryBooqkiqJKVQi6rIGii6SKojpUWAi6DIGiG0RIgaJL
+VQi6HCi6MoREg6I7VFgIuhsoukqEhKKrVFgIuhoouhuEgaKrQ1iFoAuBortDOCi6S4WFoBso
+uiyEostDWIWgGii63K6IqgAAIVB0WQaJBkV3h7AKAAJFl4WQiFB0mQoLRyBQdFkJiQhFl4ew
+CgJFl3WQaFB0WQirIFB0ud0RVVWg6HJ7o6GqAgwUXW5fNFRVhQCBpMvti0oVABCwdLndEehi
+6XI7I4AEADs=}
+}
diff --git a/ext/tk/sample/tkextlib/tile/readme.txt b/ext/tk/sample/tkextlib/tile/readme.txt
new file mode 100644
index 0000000000..6c4a5cf543
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/readme.txt
@@ -0,0 +1,2 @@
+All of *.tcl and under themes/ directory (except kroc.rb) are
+quoted from Tcl/Tk's Tile extension. Please read Orig_LICENSE.txt.
diff --git a/ext/tk/sample/tkextlib/tile/repeater.tcl b/ext/tk/sample/tkextlib/tile/repeater.tcl
new file mode 100644
index 0000000000..43beb9430a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/repeater.tcl
@@ -0,0 +1,117 @@
+#
+# $Id$
+#
+# Demonstration of custom classes.
+#
+# The Tile button doesn't have built-in support for autorepeat.
+# Instead of adding -repeatdelay and -repeatinterval options,
+# and all the extra binding scripts required to deal with them,
+# we create a custom widget class for autorepeating buttons.
+#
+# Usage:
+# ttk::button .b -class Repeater [... other options ...]
+#
+# TODO:
+# Use system settings for repeat interval and initial delay.
+#
+# Notes:
+# Repeater buttons work more like scrollbar arrows than
+# Tk repeating buttons: they fire once immediately when
+# first pressed, and $State(delay) specifies the initial
+# interval before the button starts autorepeating.
+#
+
+namespace eval tile::Repeater {
+ variable State
+ set State(timer) {} ;# [after] id of repeat script
+ set State(interval) 100 ;# interval between repetitions
+ set State(delay) 300 ;# delay after initial invocation
+}
+
+### Class bindings.
+#
+
+bind Repeater <Enter> { %W state active }
+bind Repeater <Leave> { %W state !active }
+
+bind Repeater <Key-space> { tile::Repeater::Activate %W }
+bind Repeater <<Invoke>> { tile::Repeater::Activate %W }
+
+bind Repeater <ButtonPress-1> { tile::Repeater::Press %W }
+bind Repeater <ButtonRelease-1> { tile::Repeater::Release %W }
+bind Repeater <B1-Leave> { tile::Repeater::Pause %W }
+bind Repeater <B1-Enter> { tile::Repeater::Resume %W } ;# @@@ see below
+
+# @@@ Workaround for metacity-induced bug:
+bind Repeater <B1-Enter> \
+ { if {"%d" ne "NotifyUngrab"} { tile::Repeater::Resume %W } }
+
+### Binding procedures.
+#
+
+## Activate -- Keyboard activation binding.
+# Simulate clicking the button, and invoke the command once.
+#
+proc tile::Repeater::Activate {w} {
+ $w instate disabled { return }
+ set oldState [$w state pressed]
+ update idletasks; after 100
+ $w state $oldState
+ after idle [list $w invoke]
+}
+
+## Press -- ButtonPress-1 binding.
+# Invoke the command once and start autorepeating after
+# $State(delay) milliseconds.
+#
+proc tile::Repeater::Press {w} {
+ variable State
+ $w instate disabled { return }
+ $w state pressed
+ $w invoke
+ after cancel $State(timer)
+ set State(timer) [after $State(delay) [list tile::Repeater::Repeat $w]]
+}
+
+## Release -- ButtonRelease binding.
+# Stop repeating.
+#
+proc tile::Repeater::Release {w} {
+ variable State
+ $w state !pressed
+ after cancel $State(timer)
+}
+
+## Pause -- B1-Leave binding
+# Temporarily suspend autorepeat.
+#
+proc tile::Repeater::Pause {w} {
+ variable State
+ $w state !pressed
+ after cancel $State(timer)
+}
+
+## Resume -- B1-Enter binding
+# Resume autorepeat.
+#
+proc tile::Repeater::Resume {w} {
+ variable State
+ $w instate disabled { return }
+ $w state pressed
+ $w invoke
+ after cancel $State(timer)
+ set State(timer) [after $State(interval) [list tile::Repeater::Repeat $w]]
+}
+
+## Repeat -- Timer script
+# Invoke the command and reschedule another repetition
+# after $State(interval) milliseconds.
+#
+proc tile::Repeater::Repeat {w} {
+ variable State
+ $w instate disabled { return }
+ $w invoke
+ set State(timer) [after $State(interval) [list tile::Repeater::Repeat $w]]
+}
+
+#*EOF*
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl b/ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl
new file mode 100644
index 0000000000..68733e8ad2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl
@@ -0,0 +1,149 @@
+# blue.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# blue.tcl,v 1.27 2005/10/08 14:56:57 jenglish Exp
+#
+#
+
+namespace eval tile::theme::blue {
+
+ package provide tile::theme::blue 0.7
+
+ set imgdir [file join [file dirname [info script]] blue]
+ array set I [tile::LoadImages $imgdir *.gif]
+
+ array set colors {
+ -frame "#6699cc"
+ -lighter "#bcd2e8"
+ -window "#e6f3ff"
+ -selectbg "#ffff33"
+ -selectfg "#000000"
+ -disabledfg "#666666"
+ }
+
+ style theme create blue -settings {
+
+ style default . \
+ -borderwidth 1 \
+ -background $colors(-frame) \
+ -fieldbackground $colors(-window) \
+ -troughcolor $colors(-lighter) \
+ -selectbackground $colors(-selectbg) \
+ -selectforeground $colors(-selectfg) \
+ ;
+ style map . -foreground [list disabled $colors(-disabledfg)]
+
+ ## Buttons.
+ #
+ style default TButton -padding "10 0"
+ style layout TButton {
+ Button.button -children {
+ Button.focus -children {
+ Button.padding -children {
+ Button.label
+ }
+ }
+ }
+ }
+
+ style element create button image $I(button-n) \
+ -map [list pressed $I(button-p) active $I(button-h)] \
+ -border 4 -sticky ew
+
+ style element create Checkbutton.indicator image $I(check-nu) \
+ -width 24 -sticky w -map [list \
+ {!disabled active selected} $I(check-hc) \
+ {!disabled active} $I(check-hu) \
+ {!disabled selected} $I(check-nc) ]
+
+ style element create Radiobutton.indicator image $I(radio-nu) \
+ -width 24 -sticky w -map [list \
+ {!disabled active selected} $I(radio-hc) \
+ {!disabled active} $I(radio-hu) \
+ selected $I(radio-nc) ]
+
+ style default TMenubutton -relief raised -padding {10 2}
+
+ ## Toolbar buttons.
+ #
+ style default Toolbutton \
+ -width 0 -relief flat -borderwidth 2 -padding 4 \
+ -background $colors(-frame) -foreground #000000 ;
+ style map Toolbutton -background [list active $colors(-selectbg)]
+ style map Toolbutton -foreground [list active $colors(-selectfg)]
+ style map Toolbutton -relief {
+ disabled flat
+ selected sunken
+ pressed sunken
+ active raised
+ }
+
+ ## Entry widgets.
+ #
+ style default TEntry \
+ -selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont
+ style default TCombobox \
+ -selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont
+
+ ## Notebooks.
+ #
+ style default TNotebook.Tab -padding {4 2 4 2}
+ style map TNotebook.Tab \
+ -background \
+ [list selected $colors(-frame) active $colors(-lighter)] \
+ -padding [list selected {4 4 4 2}]
+
+ ## Labelframes.
+ #
+ style default TLabelframe -borderwidth 2 -relief groove
+
+ ## Scrollbars.
+ #
+ style layout Vertical.TScrollbar {
+ Scrollbar.trough -children {
+ Scrollbar.uparrow -side top
+ Scrollbar.downarrow -side bottom
+ Scrollbar.uparrow -side bottom
+ Vertical.Scrollbar.thumb -side top -expand true -sticky ns
+ }
+ }
+
+ style layout Horizontal.TScrollbar {
+ Scrollbar.trough -children {
+ Scrollbar.leftarrow -side left
+ Scrollbar.rightarrow -side right
+ Scrollbar.leftarrow -side right
+ Horizontal.Scrollbar.thumb -side left -expand true -sticky we
+ }
+ }
+
+ style element create Horizontal.Scrollbar.thumb image $I(sb-thumb) \
+ -map [list {pressed !disabled} $I(sb-thumb-p)] -border 3
+
+ style element create Vertical.Scrollbar.thumb image $I(sb-vthumb) \
+ -map [list {pressed !disabled} $I(sb-vthumb-p)] -border 3
+
+ foreach dir {up down left right} {
+ style element create ${dir}arrow image $I(arrow${dir}) \
+ -map [list \
+ disabled $I(arrow${dir}) \
+ pressed $I(arrow${dir}-p) \
+ active $I(arrow${dir}-h)] \
+ -border 1 -sticky {}
+ }
+
+ ## Scales.
+ #
+ style element create Scale.slider \
+ image $I(slider) -map [list {pressed !disabled} $I(slider-p)]
+
+ style element create Vertical.Scale.slider \
+ image $I(vslider) -map [list {pressed !disabled} $I(vslider-p)]
+
+ style element create Horizontal.Progress.bar \
+ image $I(sb-thumb) -border 2
+ style element create Vertical.Progress.bar \
+ image $I(sb-vthumb) -border 2
+
+ }
+}
+
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gif
new file mode 100644
index 0000000000..3c1be9d880
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gif
new file mode 100644
index 0000000000..1cb36ec554
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gif
new file mode 100644
index 0000000000..e363c362ed
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gif
new file mode 100644
index 0000000000..cbc3db2756
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gif
new file mode 100644
index 0000000000..14d541b03e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gif
new file mode 100644
index 0000000000..32584a34b2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gif
new file mode 100644
index 0000000000..913e9da94b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gif
new file mode 100644
index 0000000000..d02208fcf7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gif
new file mode 100644
index 0000000000..2b0f1fd07b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gif
new file mode 100644
index 0000000000..6059bae094
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gif
new file mode 100644
index 0000000000..20b6a824f4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gif
new file mode 100644
index 0000000000..5857616228
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gif
new file mode 100644
index 0000000000..0947f43b90
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gif
new file mode 100644
index 0000000000..d9845283a5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcf b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcf
new file mode 100644
index 0000000000..e38ed19e61
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcf
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gif
new file mode 100644
index 0000000000..e819b1b951
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gif
new file mode 100644
index 0000000000..b753aead97
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gif
new file mode 100644
index 0000000000..74dbb799a2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gif
new file mode 100644
index 0000000000..8f3d9114a3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gif
new file mode 100644
index 0000000000..6f360ffd62
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gif
new file mode 100644
index 0000000000..f7c21fb0c3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gif
new file mode 100644
index 0000000000..a006630388
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gif
new file mode 100644
index 0000000000..0281de37d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gif
new file mode 100644
index 0000000000..58ec60c1db
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gif
new file mode 100644
index 0000000000..6cfaa416d1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gif
new file mode 100644
index 0000000000..d9bfc0a7be
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gif
new file mode 100644
index 0000000000..930d7fd9ff
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gif
new file mode 100644
index 0000000000..060be5dd41
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gif
new file mode 100644
index 0000000000..c1c089de3e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gif
new file mode 100644
index 0000000000..1805c2dc7c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gif
new file mode 100644
index 0000000000..bc37b31c3d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gif b/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gif
new file mode 100644
index 0000000000..d3745c7f62
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl b/ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl
new file mode 100644
index 0000000000..4facac70d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl
@@ -0,0 +1,6 @@
+# Package index for tile demo pixmap themes.
+
+if {[file isdirectory [file join $dir blue]]} {
+ package ifneeded tile::theme::blue 0.7 \
+ [list source [file join $dir blue.tcl]]
+}
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl
new file mode 100644
index 0000000000..60c59be0ca
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl
@@ -0,0 +1,194 @@
+# keramik.tcl -
+#
+# A sample pixmap theme for the tile package.
+#
+# Copyright (c) 2004 Googie
+# Copyright (c) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# $Id$
+
+package require Tk 8.4; # minimum version for Tile
+package require tile 0.5; # depends upon tile 0.5
+
+namespace eval tile {
+ namespace eval theme {
+ namespace eval keramik {
+ variable version 0.3.2
+ }
+ }
+}
+
+namespace eval tile::theme::keramik {
+
+ variable imgdir [file join [file dirname [info script]] keramik]
+ variable I
+ array set I [tile::LoadImages $imgdir *.gif]
+
+ variable colors
+ array set colors {
+ -frame "#cccccc"
+ -lighter "#cccccc"
+ -window "#ffffff"
+ -selectbg "#eeeeee"
+ -selectfg "#000000"
+ -disabledfg "#aaaaaa"
+ }
+
+ style theme create keramik -parent alt -settings {
+
+
+ # -----------------------------------------------------------------
+ # Theme defaults
+ #
+ style default . \
+ -borderwidth 1 \
+ -background $colors(-frame) \
+ -troughcolor $colors(-lighter) \
+ -font TkDefaultFont \
+ ;
+
+ style map . -foreground [list disabled $colors(-disabledfg)]
+
+ # -----------------------------------------------------------------
+ # Button elements
+ # - the button has a large rounded border and needs a bit of
+ # horizontal padding.
+ # - the checkbutton and radiobutton have the focus drawn around
+ # the whole widget - hence the new layouts.
+ #
+ style layout TButton {
+ Button.background
+ Button.button -children {
+ Button.focus -children {
+ Button.label
+ }
+ }
+ }
+ style layout Toolbutton {
+ Toolbutton.background
+ Toolbutton.button -children {
+ Toolbutton.focus -children {
+ Toolbutton.label
+ }
+ }
+ }
+ style element create button image $I(button-n) \
+ -border {8 6 8 16} -padding {6 6} -sticky news \
+ -map [list {pressed !disabled} $I(button-p) \
+ {active !selected} $I(button-h) \
+ selected $I(button-s) \
+ disabled $I(button-d)]
+ style default TButton -padding {10 6}
+
+ style element create Toolbutton.button image $I(tbar-n) \
+ -border {2 8 2 16} -padding {2 2} -sticky news \
+ -map [list {pressed !disabled} $I(tbar-p) \
+ {active !selected} $I(tbar-a) \
+ selected $I(tbar-p)]
+
+ style element create Checkbutton.indicator image $I(check-u) \
+ -width 20 -sticky w \
+ -map [list selected $I(check-c)]
+
+ style element create Radiobutton.indicator image $I(radio-u) \
+ -width 20 -sticky w \
+ -map [list selected $I(radio-c)]
+
+ # The layout for the menubutton is modified to have a button element
+ # drawn on top of the background. This means we can have transparent
+ # pixels in the button element. Also, the pixmap has a special
+ # region on the right for the arrow. So we draw the indicator as a
+ # sibling element to the button, and draw it after (ie on top of) the
+ # button image.
+ style layout TMenubutton {
+ Menubutton.background
+ Menubutton.button -children {
+ Menubutton.focus -children {
+ Menubutton.padding -children {
+ Menubutton.label -side left -expand true
+ }
+ }
+ }
+ Menubutton.indicator -side right
+ }
+ style element create Menubutton.button image $I(mbut-n) \
+ -map [list {active !disabled} $I(mbut-a) \
+ {pressed !disabled} $I(mbut-a) \
+ {disabled} $I(mbut-d)] \
+ -border {7 10 29 15} -padding {7 4 29 4} -sticky news
+ style element create Menubutton.indicator image $I(mbut-arrow-n) \
+ -width 11 -sticky w -padding {0 0 18 0}
+
+ # -----------------------------------------------------------------
+ # Scrollbars, scale and progress elements
+ # - the scrollbar has three arrow buttons, two at the bottom and
+ # one at the top.
+ #
+ style layout Vertical.TScrollbar {
+ Scrollbar.background
+ Scrollbar.trough -children {
+ Scrollbar.uparrow -side top
+ Scrollbar.downarrow -side bottom
+ Scrollbar.uparrow -side bottom
+ Vertical.Scrollbar.thumb -side top -expand true -sticky ns
+ }
+ }
+
+ style layout Horizontal.TScrollbar {
+ Scrollbar.background
+ Scrollbar.trough -children {
+ Scrollbar.leftarrow -side left
+ Scrollbar.rightarrow -side right
+ Scrollbar.leftarrow -side right
+ Horizontal.Scrollbar.thumb -side left -expand true -sticky we
+ }
+ }
+
+ style default TScrollbar -width 16
+
+ style element create Horizontal.Scrollbar.thumb image $I(hsb-n) \
+ -border {6 4} -width 15 -height 16 -sticky news \
+ -map [list {pressed !disabled} $I(hsb-p)]
+
+ style element create Vertical.Scrollbar.thumb image $I(vsb-n) \
+ -border {4 6} -width 16 -height 15 -sticky news \
+ -map [list {pressed !disabled} $I(vsb-p)]
+
+ style element create Scale.slider image $I(hslider-n) \
+ -border 3
+
+ style element create Vertical.Scale.slider image $I(vslider-n) \
+ -border 3
+
+ style element create Horizontal.Progress.bar image $I(hsb-n) \
+ -border {6 4}
+
+ style element create Vertical.Progress.bar image $I(vsb-n) \
+ -border {4 6}
+
+ style element create uparrow image $I(arrowup-n) \
+ -map [list {pressed !disabled} $I(arrowup-p)]
+
+ style element create downarrow image $I(arrowdown-n) \
+ -map [list {pressed !disabled} $I(arrowdown-p)]
+
+ style element create rightarrow image $I(arrowright-n) \
+ -map [list {pressed !disabled} $I(arrowright-p)]
+
+ style element create leftarrow image $I(arrowleft-n) \
+ -map [list {pressed !disabled} $I(arrowleft-p)]
+
+ # -----------------------------------------------------------------
+ # Notebook elements
+ #
+ style element create tab image $I(tab-n) \
+ -map [list selected $I(tab-p) active $I(tab-p)] \
+ -border {6 6 6 2} -height 12
+
+ ## Labelframes.
+ #
+ style default TLabelframe -borderwidth 2 -relief groove
+ }
+}
+
+package provide tile::theme::keramik $::tile::theme::keramik::version
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gif
new file mode 100644
index 0000000000..2d84f29c60
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gif
new file mode 100644
index 0000000000..52ee752641
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gif
new file mode 100644
index 0000000000..ff309c56f2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gif
new file mode 100644
index 0000000000..2159f274a5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gif
new file mode 100644
index 0000000000..905fa7ed1d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gif
new file mode 100644
index 0000000000..0323332f30
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gif
new file mode 100644
index 0000000000..20dcadb30e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gif
new file mode 100644
index 0000000000..129169e4c4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gif
new file mode 100644
index 0000000000..fe9bf98f81
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gif
new file mode 100644
index 0000000000..210734d1ae
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gif
new file mode 100644
index 0000000000..5e1eafa854
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gif
new file mode 100644
index 0000000000..bfd74889f8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gif
new file mode 100644
index 0000000000..1095ed7583
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gif
new file mode 100644
index 0000000000..06e8795df8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gif
new file mode 100644
index 0000000000..3c02fcbe81
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gif
new file mode 100644
index 0000000000..1d93973c75
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gif
new file mode 100644
index 0000000000..18fbae08ab
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gif
new file mode 100644
index 0000000000..334e8e4a40
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gif
new file mode 100644
index 0000000000..2e2f1c2f10
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gif
new file mode 100644
index 0000000000..48197cbfc9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gif
new file mode 100644
index 0000000000..4a294b4984
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gif
new file mode 100644
index 0000000000..65c0e4efa2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gif
new file mode 100644
index 0000000000..c8257c9336
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gif
new file mode 100644
index 0000000000..215a73821c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gif
new file mode 100644
index 0000000000..03099a95be
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gif
new file mode 100644
index 0000000000..abec6aba40
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gif
new file mode 100644
index 0000000000..2c223ba2c5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gif
new file mode 100644
index 0000000000..77ef8a26cf
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gif
new file mode 100644
index 0000000000..3179b87ad9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gif
new file mode 100644
index 0000000000..be01e4a72a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gif
new file mode 100644
index 0000000000..0bb39e91ff
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gif b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gif
new file mode 100644
index 0000000000..cf03d7f325
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl b/ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl
new file mode 100644
index 0000000000..cedec328f8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl
@@ -0,0 +1,15 @@
+# pkgIndex.tcl for additional tile pixmap themes.
+#
+# We don't provide the package is the image subdirectory isn't present,
+# or we don't have the right version of Tcl/Tk
+#
+# To use this automatically within tile, the tile-using application should
+# use tile::availableThemes and tile::setTheme
+#
+# $Id$
+
+if {![file isdirectory [file join $dir keramik]]} { return }
+if {![package vsatisfies [package provide Tcl] 8.4]} { return }
+
+package ifneeded tile::theme::keramik 0.3.2 \
+ [list source [file join $dir keramik.tcl]]
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc.rb b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
new file mode 100644
index 0000000000..72a7c6901d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc.rb
@@ -0,0 +1,226 @@
+#
+# kroc.rb
+#
+# based on:
+# >> kroc.tcl - Copyright (C) 2004 David Zolli <kroc@kroc.tk>
+#
+
+imgdir = File.join(File.dirname(__FILE__), 'kroc', 'kroc')
+$images = Tk::Tile.load_images(imgdir, '*.gif')
+
+if TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
+ $TNotebook_Tab = Tk::Tile::TNotebook.style('Tab')
+else
+ $TNotebook_Tab = 'Tab.TNotebook'
+end
+
+def kroc_rb_settings
+ # Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F',
+ # :troughcolor=>'#F8C278', :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default(Tk.root, :background=>'#FCB64F',
+ # :troughcolor=>'#F8C278', :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default('.', :background=>'#FCB64F',
+ # :troughcolor=>'#F8C278', :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default(nil, :background=>'#FCB64F',
+ # :troughcolor=>'#F8C278', :borderwidth=>1)
+ # or
+ Tk::Tile::Style.default(:background=>'#FCB64F', :troughcolor=>'#F8C278',
+ :borderwidth=>1)
+ # Tk::Tile::Style.default(TkRoot, :font=>Tk::Tile::Font::Default,
+ # :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default(Tk.root, :font=>Tk::Tile::Font::Default,
+ # :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default('.', :font=>Tk::Tile::Font::Default,
+ # :borderwidth=>1)
+ # or
+ # Tk::Tile::Style.default(nil, :font=>Tk::Tile::Font::Default,
+ # :borderwidth=>1)
+ # or
+ Tk::Tile::Style.default(:font=>Tk::Tile::Font::Default, :borderwidth=>1)
+
+ # Tk::Tile::Style.map(TkRoot, :background=>[:active, '#694418'])
+ # or
+ # Tk::Tile::Style.map(Tk.root, :background=>[:active, '#694418'])
+ # or
+ # Tk::Tile::Style.map('.', :background=>[:active, '#694418'])
+ # or
+ # Tk::Tile::Style.map(nil, :background=>[:active, '#694418'])
+ # or
+ Tk::Tile::Style.map(:background=>[:active, '#694418'])
+ Tk::Tile::Style.map(:foreground=>[:disabled, '#B2B2B2', :active, '#FFE7CB'])
+
+ # Tk::Tile::Style.default('TButton', :padding=>[10,4])
+ Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4])
+
+ # Tk::Tile::Style.default('TNotebook.Tab',
+ Tk::Tile::Style.default($TNotebook_Tab,
+ :padding=>[10, 3], :font=>Tk::Tile::Font::Default)
+ # Tk::Tile::Style.map('TNotebook.Tab',
+ Tk::Tile::Style.map($TNotebook_Tab,
+ :background=>[:selected, '#FCB64F', '', '#FFE6BA'],
+ :foreground=>['', 'black'],
+ :padding=>[:selected, [10, 6, 10, 3]])
+
+ # Tk::Tile::Style.map('TScrollbar',
+ Tk::Tile::Style.map(Tk::Tile::TScrollbar,
+ :background=>[:pressed, '#694418'],
+ :arrowcolor=>[:pressed, '#FEF7CB'],
+ :relief=>[:pressed, :sunken])
+
+ # Tk::Tile::Style.layout('Vertical.TScrollbar',
+ Tk::Tile::Style.layout(Tk::Tile.style('Vertical', Tk::Tile::TScrollbar),
+ ['Scrollbar.trough', {:children=>[
+ 'Scrollbar.uparrow', {:side=>:top},
+ 'Scrollbar.downarrow', {:side=>:bottom},
+ 'Scrollbar.uparrow', {:side=>:bottom},
+ 'Scrollbar.thumb', {:side=>:top, :expand=>true}
+ ]}
+ ])
+
+ # Tk::Tile::Style.layout('Horizontal.TScrollbar',
+ Tk::Tile::Style.layout(Tk::Tile.style('Horizontal', Tk::Tile::TScrollbar),
+ ['Scrollbar.trough', {:children=>[
+ 'Scrollbar.leftarrow', {:side=>:left},
+ 'Scrollbar.rightarrow', {:side=>:right},
+ 'Scrollbar.leftarrow', {:side=>:right},
+ 'Scrollbar.thumb', {:side=>:left, :expand=>true}
+ ]}
+ ])
+
+ #
+ # Elements:
+ #
+ if Tk::Tile::TILE_SPEC_VERSION_ID >= 8
+ Tk::Tile::Style.element_create('Button.button',
+ :image,
+ [ $images['button-n'],
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
+ ], :border=>3, :sticky=>:ew)
+
+ Tk::Tile::Style.element_create('Checkbutton.indicator',
+ :image,
+ [ $images['check-nu'],
+ [:pressed, :selected],$images['check-nc'],
+ :pressed, $images['check-nu'],
+ [:active, :selected], $images['check-hc'],
+ :active, $images['check-hu'],
+ :selected, $images['check-nc'],
+ ], :sticky=>:w)
+
+ Tk::Tile::Style.element_create('Radiobutton.indicator',
+ :image,
+ [ $images['radio-nu'],
+ [:pressed,:selected],$images['radio-nc'],
+ :pressed, $images['radio-nu'],
+ [:active,:selected], $images['radio-hc'],
+ :active, $images['radio-hu'],
+ :selected, $images['radio-nc'],
+ ], :sticky=>:w)
+
+ elsif TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
+ Tk::Tile::Style.element_create('Button.button',
+ :image, $images['button-n'],
+ :map=>[
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
+ ], :border=>3, :sticky=>:ew)
+
+ Tk::Tile::Style.element_create('Checkbutton.indicator',
+ :image, $images['check-nu'],
+ :map=>[
+ [:pressed, :selected],$images['check-nc'],
+ :pressed, $images['check-nu'],
+ [:active, :selected], $images['check-hc'],
+ :active, $images['check-hu'],
+ :selected, $images['check-nc'],
+ ], :sticky=>:w)
+
+ Tk::Tile::Style.element_create('Radiobutton.indicator',
+ :image, $images['radio-nu'],
+ :map=>[
+ [:pressed, :selected],$images['radio-nc'],
+ :pressed, $images['radio-nu'],
+ [:active, :selected], $images['radio-hc'],
+ :active, $images['radio-hu'],
+ :selected, $images['radio-nc'],
+ ], :sticky=>:w)
+
+ else # tile 0.4 or earlier
+ Tk::Tile::Style.element_create('Button.button', :pixmap,
+ :images=>[
+ :pressed, $images['button-p'],
+ :active, $images['button-h'],
+ '', $images['button-n']
+ ], :border=>3, :tiling=>:tile)
+
+ Tk::Tile::Style.element_create('Checkbutton.indicator', :pixmap,
+ :images=>[
+ [:pressed, :selected],$images['check-nc'],
+ :pressed, $images['check-nu'],
+ [:active, :selected], $images['check-hc'],
+ :active, $images['check-hu'],
+ :selected, $images['check-nc'],
+ '', $images['check-nu'],
+ ], :tiling=>:fixed)
+
+ Tk::Tile::Style.element_create('Radiobutton.indicator', :pixmap,
+ :images=>[
+ [:pressed, :selected],$images['radio-nc'],
+ :pressed, $images['radio-nu'],
+ [:active, :selected], $images['radio-hc'],
+ :active, $images['radio-hu'],
+ :selected, $images['radio-nc'],
+ '', $images['radio-nu'],
+ ], :tiling=>:fixed)
+
+ end
+
+ #
+ # Settings:
+ #
+ # Tk::Tile::Style.layout(Tk::Tile::TButton,
+ Tk::Tile::Style.layout('TButton', [
+ 'Button.button', {:children=>[
+ 'Button.focus', {:children=>[
+ 'Button.padding', {:children=>[
+ 'Button.label', {:expand=>true, :sticky=>''}
+ ]}
+ ]}
+ ]}
+ ])
+
+ # Tk::Tile::Style.layout(Tk::Tile::TCheckbutton,
+ Tk::Tile::Style.layout('TCheckbutton', [
+ 'Checkbutton.background', # this is not needed in tile 0.5 or later
+ 'Checkbutton.border', {:children=>[
+ 'Checkbutton.padding', {:children=>[
+ 'Checkbutton.indicator', {:side=>:left},
+ 'Checkbutton.focus', {:side=>:left, :children=>[
+ 'Checkbutton.label'
+ ]}
+ ]}
+ ]}
+ ])
+
+ # Tk::Tile::Style.layout(Tk::Tile::TRadiobutton,
+ Tk::Tile::Style.layout('TRadiobutton', [
+ 'Radiobutton.background', # this is not needed in tile 0.5 or later
+ 'Radiobutton.border', {:children=>[
+ 'Radiobutton.padding', {:children=>[
+ 'Radiobutton.indicator', {:side=>:left},
+ 'Radiobutton.focus', {:expand=>true, :sticky=>:w, :children=>[
+ 'Radiobutton.label', {:side=>:right, :expand=>true}
+ ]}
+ ]}
+ ]}
+ ])
+end
+
+Tk::Tile::Style.theme_create('kroc-rb', :parent=>'alt',
+ :settings=>proc{ kroc_rb_settings() })
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl
new file mode 100644
index 0000000000..b2cd79679a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl
@@ -0,0 +1,163 @@
+# kroc.tcl - Copyright (C) 2004 David Zolli <kroc@kroc.tk>
+#
+# A sample pixmap theme for the tile package.
+
+#package require tile::pixmap
+
+namespace eval tile {
+ namespace eval kroc {
+ variable version 0.0.1
+ }
+}
+
+namespace eval tile::kroc {
+
+ set imgdir [file join [file dirname [info script]] kroc]
+ array set Images [tile::LoadImages $imgdir *.gif]
+
+ if {[package vsatisfies [package provide tile] 0.5]} {
+ set TNoteBook_Tab TNotebook.Tab
+ } else {
+ set TNoteBook_Tab Tab.TNotebook
+ }
+
+ style theme create kroc -parent alt -settings {
+
+ style default . -background #FCB64F -troughcolor #F8C278 -borderwidth 1
+ style default . -font TkDefaultFont -borderwidth 1
+ style map . -background [list active #694418]
+ style map . -foreground [list disabled #B2B2B2 active #FFE7CB]
+
+ style default TButton -padding "10 4"
+
+ style default $TNoteBook_Tab -padding {10 3} -font TkDefaultFont
+ style map $TNoteBook_Tab \
+ -background [list selected #FCB64F {} #FFE6BA] \
+ -foreground [list {} black] \
+ -padding [list selected {10 6 10 3}]
+
+ style map TScrollbar \
+ -background { pressed #694418} \
+ -arrowcolor { pressed #FFE7CB } \
+ -relief { pressed sunken } \
+ ;
+
+ style layout Vertical.TScrollbar {
+ Scrollbar.trough -children {
+ Scrollbar.uparrow -side top
+ Scrollbar.downarrow -side bottom
+ Scrollbar.uparrow -side bottom
+ Scrollbar.thumb -side top -expand true
+ }
+ }
+
+ style layout Horizontal.TScrollbar {
+ Scrollbar.trough -children {
+ Scrollbar.leftarrow -side left
+ Scrollbar.rightarrow -side right
+ Scrollbar.leftarrow -side right
+ Scrollbar.thumb -side left -expand true
+ }
+ }
+
+ #
+ # Elements:
+ #
+ if {[package vsatisfies [package provide tile] 0.5]} {
+
+ style element create Button.button image $Images(button-n) \
+ -map [list \
+ pressed $Images(button-p) \
+ active $Images(button-h) \
+ ] -border 3 -sticky ew
+
+ style element create Checkbutton.indicator image $Images(check-nu) \
+ -map [list \
+ {pressed selected} $Images(check-nc) \
+ pressed $Images(check-nu) \
+ {active selected} $Images(check-hc) \
+ active $Images(check-hu) \
+ selected $Images(check-nc) \
+ ] -sticky w
+
+ style element create Radiobutton.indicator image $Images(radio-nu) \
+ -map [list \
+ {pressed selected} $Images(radio-nc) \
+ pressed $Images(radio-nu) \
+ {active selected} $Images(radio-hc) \
+ active $Images(radio-hu) \
+ selected $Images(radio-nc) \
+ ] -sticky w
+
+ } else {
+
+ style element create Button.button pixmap -images [list \
+ pressed $Images(button-p) \
+ active $Images(button-h) \
+ {} $Images(button-n) \
+ ] -border 3 -tiling tile
+
+ style element create Checkbutton.indicator pixmap -images [list \
+ {pressed selected} $Images(check-nc) \
+ pressed $Images(check-nu) \
+ {active selected} $Images(check-hc) \
+ active $Images(check-hu) \
+ selected $Images(check-nc) \
+ {} $Images(check-nu) \
+ ] -tiling fixed
+
+ style element create Radiobutton.indicator pixmap -images [list \
+ {pressed selected} $Images(radio-nc) \
+ pressed $Images(radio-nu) \
+ {active selected} $Images(radio-hc) \
+ active $Images(radio-hu) \
+ selected $Images(radio-nc) \
+ {} $Images(radio-nu) \
+ ] -tiling fixed
+
+ }
+
+ #
+ # Settings: (*button.background is not needed in tile 0.5 or above)
+ #
+ style layout TButton {
+ Button.button -children {
+ Button.focus -children {
+ Button.padding -children {
+ Button.label -expand true -sticky {}
+ }
+ }
+ }
+ }
+
+ style layout TCheckbutton {
+ Checkbutton.border -children {
+ Checkbutton.background
+ Checkbutton.padding -children {
+ Checkbutton.indicator -side left
+ Checkbutton.focus -side left -children {
+ Checkbutton.label
+ }
+ }
+ }
+ }
+
+ style layout TRadiobutton {
+ Radiobutton.border -children {
+ Radiobutton.background
+ Radiobutton.padding -children {
+ Radiobutton.indicator -side left
+ Radiobutton.focus -expand true -sticky w -children {
+ Radiobutton.label -side right -expand true
+ }
+ }
+ }
+ }
+
+ } }
+
+# -------------------------------------------------------------------------
+
+package provide tile::theme::kroc $::tile::kroc::version
+
+# -------------------------------------------------------------------------
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gif
new file mode 100644
index 0000000000..e7a140dede
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gif
new file mode 100644
index 0000000000..78b506ddeb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gif
new file mode 100644
index 0000000000..a5a4e90be1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gif
new file mode 100644
index 0000000000..41503c5ebd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gif
new file mode 100644
index 0000000000..b3e512ca67
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gif
new file mode 100644
index 0000000000..a28c288fce
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gif
new file mode 100644
index 0000000000..5c23931bbc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gif
new file mode 100644
index 0000000000..359fe1cc8b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gif
new file mode 100644
index 0000000000..9f46b37926
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gif
new file mode 100644
index 0000000000..6437f33a7a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gif b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gif
new file mode 100644
index 0000000000..2d2aac8597
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl b/ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl
new file mode 100644
index 0000000000..de4f3d4555
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl
@@ -0,0 +1,15 @@
+# pkgIndex.tcl for additional tile pixmap themes.
+#
+# We don't provide the package is the image subdirectory isn't present,
+# or we don't have the right version of Tcl/Tk
+#
+# To use this automatically within tile, the tile-using application should
+# use tile::availableThemes and tile::setTheme
+#
+# $Id$
+
+if {![file isdirectory [file join $dir kroc]]} { return }
+if {![package vsatisfies [package provide Tcl] 8.4]} { return }
+
+package ifneeded tile::theme::kroc 0.0.1 \
+ [list source [file join $dir kroc.tcl]]
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl b/ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl
new file mode 100644
index 0000000000..f402a73f10
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl
@@ -0,0 +1,16 @@
+# pkgIndex.tcl for additional tile pixmap themes.
+#
+# We don't provide the package is the image subdirectory isn't present,
+# or we don't have the right version of Tcl/Tk
+#
+# To use this automatically within tile, the tile-using application should
+# use tile::availableThemes and tile::setTheme
+#
+# $Id$
+
+if {![file isdirectory [file join $dir plastik]]} { return }
+if {![package vsatisfies [package provide Tcl] 8.4]} { return }
+
+package ifneeded tile::theme::plastik 0.3.1 \
+ [list source [file join $dir plastik.tcl]]
+
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl
new file mode 100644
index 0000000000..ea6ed74162
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl
@@ -0,0 +1,125 @@
+# plastik.tcl - Copyright (C) 2004 Googie
+#
+# A sample pixmap theme for the tile package.
+#
+# Copyright (c) 2004 Googie
+# Copyright (c) 2005 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# $Id$
+
+package require Tk 8.4
+package require tile 0.5
+
+namespace eval tile::theme::plastik {
+
+ variable version 0.3.1
+ package provide tile::theme::plastik $version
+
+ variable imgdir [file join [file dirname [info script]] plastik]
+ variable Images;
+ array set Images [tile::LoadImages $imgdir *.gif]
+
+ variable colors
+ array set colors {
+ -frame "#cccccc"
+ -disabledfg "#aaaaaa"
+ -selectbg "#657a9e"
+ -selectfg "#ffffff"
+ }
+
+style theme create plastik -parent default -settings {
+ style default . \
+ -background $colors(-frame) \
+ -troughcolor $colors(-frame) \
+ -selectbackground $colors(-selectbg) \
+ -selectforeground $colors(-selectfg) \
+ -font TkDefaultFont \
+ -borderwidth 1 \
+ ;
+
+ style map . -foreground [list disabled $colors(-disabledfg)]
+
+ #
+ # Layouts:
+ #
+ style layout Vertical.TScrollbar {
+ Scrollbar.background
+ Scrollbar.trough -children {
+ Scrollbar.uparrow -side top
+ Scrollbar.downarrow -side bottom
+ Scrollbar.uparrow -side bottom
+ Vertical.Scrollbar.thumb -side top -expand true -sticky ns
+ }
+ }
+
+ style layout Horizontal.TScrollbar {
+ Scrollbar.background
+ Scrollbar.trough -children {
+ Scrollbar.leftarrow -side left
+ Scrollbar.rightarrow -side right
+ Scrollbar.leftarrow -side right
+ Horizontal.Scrollbar.thumb -side left -expand true -sticky we
+ }
+ }
+
+ style layout TButton {
+ Button.button -children {
+ Button.focus -children {
+ Button.padding -children {
+ Button.label -side left -expand true
+ }
+ }
+ }
+ }
+
+ #
+ # Elements:
+ #
+ style element create Button.button image $Images(button-n) \
+ -border 4 -sticky ew \
+ -map [list pressed $Images(button-p) active $Images(button-h)]
+
+ style element create Checkbutton.indicator image $Images(check-nu) \
+ -sticky {} -map [list \
+ {active selected} $Images(check-hc) \
+ {pressed selected} $Images(check-pc) \
+ active $Images(check-hu) \
+ selected $Images(check-nc) \
+ ]
+
+ style element create Radiobutton.indicator image $Images(radio-nu) \
+ -sticky {} -map [list \
+ {active selected} $Images(radio-hc) \
+ {pressed selected} $Images(radio-pc) \
+ active $Images(radio-hu) \
+ selected $Images(radio-nc) \
+ ]
+
+ style element create Horizontal.Scrollbar.thumb \
+ image $Images(hsb-n) -border 3 -sticky ew
+ style element create Vertical.Scrollbar.thumb \
+ image $Images(vsb-n) -border 3 -sticky ns
+
+ style element create Scale.slider \
+ image $Images(hslider-n) -sticky {}
+ style element create Vertical.Scale.slider \
+ image $Images(vslider-n) -sticky {}
+
+ style element create Scrollbar.uparrow image $Images(arrowup-n) \
+ -map [list pressed $Images(arrowup-p)] -sticky {}
+ style element create Scrollbar.downarrow image $Images(arrowdown-n) \
+ -map [list pressed $Images(arrowdown-p)] -sticky {}
+ style element create Scrollbar.leftarrow image $Images(arrowleft-n) \
+ -map [list pressed $Images(arrowleft-p)] -sticky {}
+ style element create Scrollbar.rightarrow image $Images(arrowright-n) \
+ -map [list pressed $Images(arrowright-p)] -sticky {}
+
+ #
+ # Settings:
+ #
+ style default TButton -width -10
+ style default TNotebook.Tab -padding {6 2 6 2}
+ style default TLabelframe -borderwidth 2 -relief groove
+
+} }
+
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gif
new file mode 100644
index 0000000000..d914e7a3d3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gif
new file mode 100644
index 0000000000..abffaa49f6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gif
new file mode 100644
index 0000000000..9939ae1d50
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gif
new file mode 100644
index 0000000000..1a45ef2e4b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gif
new file mode 100644
index 0000000000..f4b563fed2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gif
new file mode 100644
index 0000000000..5459d5e615
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gif
new file mode 100644
index 0000000000..118290cd95
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gif
new file mode 100644
index 0000000000..89f9b38c73
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gif
new file mode 100644
index 0000000000..548f3769df
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gif
new file mode 100644
index 0000000000..49a25909f3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gif
new file mode 100644
index 0000000000..e83f7ed985
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gif
new file mode 100644
index 0000000000..b279fa50d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gif
new file mode 100644
index 0000000000..5b4fb4f037
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gif
new file mode 100644
index 0000000000..b139e02a09
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gif
new file mode 100644
index 0000000000..fbe391f9d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gif
new file mode 100644
index 0000000000..75a3bd635c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gif
new file mode 100644
index 0000000000..b8ea07ea92
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gif
new file mode 100644
index 0000000000..ce8f28404f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gif
new file mode 100644
index 0000000000..33917715b0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gif
new file mode 100644
index 0000000000..88925d0e1d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gif
new file mode 100644
index 0000000000..f8723d367a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gif
new file mode 100644
index 0000000000..fb5140e6a1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gif
new file mode 100644
index 0000000000..176225d9e1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gif
new file mode 100644
index 0000000000..85bac4579e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gif b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gif
new file mode 100644
index 0000000000..cf887f9855
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tile/toolbutton.tcl b/ext/tk/sample/tkextlib/tile/toolbutton.tcl
new file mode 100644
index 0000000000..91e9ad18bb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tile/toolbutton.tcl
@@ -0,0 +1,152 @@
+#
+# $Id$
+#
+# Demonstration of custom widget styles.
+#
+
+#
+# ~ BACKGROUND
+#
+# Checkbuttons in toolbars have a very different appearance
+# than regular checkbuttons: there's no indicator, they
+# "pop up" when the mouse is over them, and they appear sunken
+# when selected.
+#
+# Tk added partial support for toolbar-style buttons in 8.4
+# with the "-overrelief" option, and TIP #82 added further
+# support with the "-offrelief" option. So to get a toolbar-style
+# checkbutton, you can configure it with:
+#
+# checkbutton .cb \
+# -indicatoron false -selectcolor {} -relief flat -overrelief raised
+#
+# Behind the scenes, Tk has a lot of rather complicated logic
+# to implement this checkbutton style; see library/button.tcl,
+# generic/tkButton.c, and the platform-specific files unix/tkUnixButton.c
+# et al. for the full details.
+#
+# The tile widget set has a better way: custom styles.
+# Since the appearance is completely controlled by the theme engine,
+# we can define a new "Toolbutton" style and just use:
+#
+# checkbutton .cb -style Toolbutton
+#
+#
+# ~ DEMONSTRATION
+#
+# The tile built-in themes (default, "alt", windows, and XP)
+# already include Toolbutton styles. This script will add
+# them to the "step" and "blue" themes as a demonstration.
+#
+# (Note: Pushbuttons and radiobuttons can also use the "Toolbutton"
+# style; see demo.tcl.)
+#
+
+style theme settings "step" {
+
+#
+# First, we use [style layout] to define what elements to
+# use and how they're arranged. Toolbuttons are pretty
+# simple, consisting of a border, some internal padding,
+# and a label. (See also the TScrollbar layout definition
+# in demos/blue.tcl for a more complicated layout spec.)
+#
+ style layout Toolbutton {
+ Toolbutton.background
+ Toolbutton.border -children {
+ Toolbutton.padding -children {
+ Toolbutton.label
+ }
+ }
+ }
+
+# (Actually the above isn't strictly necessary, since the same layout
+# is defined in the default theme; we could have inherited it
+# instead.)
+#
+# Next, specify default values for element options.
+# For many options (like -background), the defaults
+# inherited from the parent style are sufficient.
+#
+ style default Toolbutton -width 0 -padding 1 -relief flat -borderwidth 2
+
+#
+# Finally, use [style map] to specify state-specific
+# resource values. We want a flat relief if the widget is
+# disabled, sunken if it's selected (on) or pressed,
+# and raised when it's active (the mouse pointer is
+# over the widget). Each state-value pair is checked
+# in order, and the first matching state takes precedence.
+#
+ style map Toolbutton -relief {
+ disabled flat
+ selected sunken
+ pressed sunken
+ active raised
+ }
+}
+
+#
+# Now for the "blue" theme. (Since the purpose of this
+# theme is to show what *can* be done, not necessarily what
+# *should* be done, the following makes some questionable
+# design decisions from an aesthetic standpoint.)
+#
+if {![catch {package require tile::theme::blue}]} {
+style theme settings "blue" {
+
+ #
+ # Default values:
+ #
+ style default Toolbutton \
+ -width 0 -relief flat -borderwidth 2 \
+ -background #6699CC -foreground #000000 ;
+
+ #
+ # Configure state-specific values for -relief, as before:
+ #
+ style map Toolbutton -relief {
+ disabled flat
+ selected sunken
+ pressed sunken
+ active raised
+ }
+
+ #
+ # Adjust the -padding at the same time, to enhance
+ # the raised/sunken illusion:
+ #
+ style default Toolbutton -padding 4
+ style map Toolbutton -padding {
+ disabled {4}
+ selected {6 6 2 2}
+ pressed {6 6 2 2}
+ active {2 2 6 6}
+ }
+
+ #
+ # ... and change the foreground and background colors
+ # when the mouse cursor is over the widget:
+ #
+ style map Toolbutton -background {
+ active #008800
+ } -foreground {
+ active #FFFFFF
+ }
+}
+
+}
+
+#
+# ~ A final note:
+#
+# TIP #82 also says: "When -indicatoron is off and the button itself
+# is on, the relief continues to be hard-coded to sunken. For symmetry,
+# we might consider adding another -onrelief option to cover this
+# case. But it is difficult to imagine ever wanting to change the
+# value of -onrelief so it has been omitted from this TIP.
+# If there as strong desire to have -onrelief, it can be added later."
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+# The Tile project aims to make sure that this never needs to happen.
+#
diff --git a/ext/tk/sample/tkextlib/tkHTML/Orig_COPYRIGHT.txt b/ext/tk/sample/tkextlib/tkHTML/Orig_COPYRIGHT.txt
new file mode 100644
index 0000000000..2b3757bb23
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/Orig_COPYRIGHT.txt
@@ -0,0 +1,12 @@
+
+The following text is the original 'COPYRIGHT' file of tkHTML.
+
+-----------------------------------------------------------------------
+Most of the source code for the Tk Html widget has been place in the
+public domain. You can do with it whatever you want. However, some
+files have been copied from other sources and contain copyrights.
+A copyright notice appears separately at the top of each source file.
+-----------------------------------------------------------------------
+
+In this sample, HTML documents are quoted in the 'tests' directory of
+tkHTML source tree. There were no copyright notice in the directory.
diff --git a/ext/tk/sample/tkextlib/tkHTML/README b/ext/tk/sample/tkextlib/tkHTML/README
new file mode 100644
index 0000000000..0b9f799cbd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/README
@@ -0,0 +1,12 @@
+
+ [ TkHtml widget example ]
+
+The directory page1 -- page4 are referd from "test" directory of
+original TkHtml extension's source archive.
+( see http://www.hwaci.com/sw/tkhtml/index.html )
+
+You can see the HTML documents on the 'hv.rb' or 'ss.rb' sample script.
+
+ e.g.
+ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH /usr/local/bin/ruby ./hv.rb page1/index.html
+
diff --git a/ext/tk/sample/tkextlib/tkHTML/hv.rb b/ext/tk/sample/tkextlib/tkHTML/hv.rb
new file mode 100644
index 0000000000..920eb15f5a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/hv.rb
@@ -0,0 +1,313 @@
+#!/usr/bin/env ruby
+#
+# This script implements the "hv" application. Type "hv FILE" to
+# view FILE as HTML.
+#
+# This application is used for testing the HTML widget. It can
+# also server as an example of how to use the HTML widget.
+#
+require 'tk'
+require 'tkextlib/tkHTML'
+
+root = TkRoot.new(:title=>'HTML File Viewer', :iconname=>'HV')
+
+file = ARGV[0]
+
+#
+# These images are used in place of GIFs or of form elements
+#
+biggray = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhPAA+APAAALi4uAAAACwAAAAAPAA+AAACQISPqcvtD6OctNqLs968+w+G4kiW5omm
+ 6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNFgsAO///
+EOD
+
+smgray = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhOAAYAPAAALi4uAAAACwAAAAAOAAYAAACI4SPqcvtD6OctNqLs968+w+G4kiW5omm
+ 6sq27gvH8kzX9m0VADv/
+EOD
+
+nogifbig = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhJAAkAPEAAACQkADQ0PgAAAAAACwAAAAAJAAkAAACmISPqcsQD6OcdJqKM71PeK15
+ AsSJH0iZY1CqqKSurfsGsex08XuTuU7L9HywHWZILAaVJssvgoREk5PolFo1XrHZ29IZ8oo0
+ HKEYVDYbyc/jFhz2otvdcyZdF68qeKh2DZd3AtS0QWcDSDgWKJXY+MXS9qY4+JA2+Vho+YPp
+ FzSjiTIEWslDQ1rDhPOY2sXVOgeb2kBbu1AAADv/
+EOD
+
+nogifsm = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhEAAQAPEAAACQkADQ0PgAAAAAACwAAAAAEAAQAAACNISPacHtD4IQz80QJ60as25d
+ 3idKZdR0IIOm2ta0Lhw/Lz2S1JqvK8ozbTKlEIVYceWSjwIAO///
+EOD
+
+#
+# define variables
+#
+ul_hyper = TkVariable.new(0)
+show_tbl = TkVariable.new(0)
+show_img = TkVariable.new(1)
+
+#
+# A font chooser routine.
+#
+# html[:fontcommand] = pick_font
+pick_font = proc{|size, attrs|
+ puts "FontCmd: #{size} #{attrs}"
+ [ ((attrs =~ /fixed/)? 'courier': 'charter'),
+ (12 * (1.2**(size.to_f - 4.0))).to_i,
+ ((attrs =~ /italic/)? 'italic': 'roman'),
+ ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')
+}
+
+#
+# This routine is called for each form element
+#
+form_cmd = proc{|n, cmd, style, *args|
+ # puts "FormCmd: $n $cmd $args"
+ case cmd
+ when 'select', 'textarea', 'input'
+ TkLabel.new(:widgetname=>args[0], :image=>nogifsm)
+ end
+}
+
+#
+# This routine is called for every <IMG> markup
+#
+images = {}
+old_imgs = {}
+big_imgs = {}
+
+hotkey = {}
+
+move_big_image = proc{|b|
+ if big_imgs.key?(b)
+ b.copy(big_imgs[b])
+ big_imgs[b].delete
+ big_imgs.delete(b)
+ Tk.update
+ end
+}
+
+image_cmd = proc{|*args|
+ if show_img.bool
+ smgray
+ else
+ fn = args[0]
+
+ if old_imgs.key?(fn)
+ images[fn] = old_imgs[fn]
+ old_imgs.delete(fn)
+ images[fn]
+
+ else
+ begin
+ img = TkPhotoImage.new(:file=>fn)
+ rescue
+ smgray
+ else
+ if img.width * img.height > 20000
+ b = TkPhotoImage.new(:width=>img.width, :height=>img.height)
+ big_imgs[b] = img
+ img = b
+ Tk.after_idle(proc{ move_big_image.call(b) })
+ end
+
+ images[fn] = img
+ img
+ end
+ end
+ end
+}
+
+#
+# This routine is called for every <SCRIPT> markup
+#
+script_cmd = proc{|*args|
+ # puts "ScriptCmd: #{args.inspect}"
+}
+
+# This routine is called for every <APPLET> markup
+#
+applet_cmd = proc{|w, arglist|
+ # puts "AppletCmd: w=#{w} arglist=#{arglist}"
+ TkLabel.new(w, :text=>"The Applet #{w}", :bd=>2, :relief=>raised)
+}
+
+#
+# Construct the main HTML viewer
+#
+html = Tk::HTML_Widget.new(:padx=>5, :pady=>9,
+ :formcommand=>form_cmd,
+ :imagecommand=>image_cmd,
+ :scriptcommand=>script_cmd,
+ :appletcommand=>applet_cmd,
+ :underlinehyperlinks=>0,
+ :bg=>'white', :tablerelief=>:raised)
+vscr = html.yscrollbar(TkScrollbar.new)
+hscr = html.xscrollbar(TkScrollbar.new)
+
+Tk.grid(html, vscr, :sticky=>:news)
+Tk.grid(hscr, :sticky=>:ew)
+Tk.root.grid_columnconfigure(0, :weight=>1)
+Tk.root.grid_columnconfigure(1, :weight=>0)
+Tk.root.grid_rowconfigure(0, :weight=>1)
+Tk.root.grid_rowconfigure(1, :weight=>0)
+
+#
+# This procedure is called when the user clicks on a hyperlink.
+#
+priv = {}
+last_file = ''
+
+# Read a file
+#
+read_file = proc{|name|
+ begin
+ fp = open(name, 'r')
+ ret = fp.read(File.size(name))
+ rescue
+ ret = nil
+ fp = nil
+ Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
+ :type=>:ok)
+ ensure
+ fp.close if fp
+ end
+ ret
+}
+
+# Clear the screen.
+#
+clear_screen = proc{
+ html.clear
+ old_imgs.clear
+ big_imgs.clear
+ hotkey.clear
+ images.each{|k, v| old_imgs[k] = v }
+ images.clear
+}
+
+# Load a file into the HTML widget
+#
+load_file = proc{|name|
+ if (doc = read_file.call(name))
+ clear_screen.call
+ last_file = name
+ html.configure(:base=>name)
+ html.parse(doc)
+ old_imgs.clear
+ end
+}
+
+href_binding = proc{|x, y|
+ # koba & dg marking text
+ html.selection_clear
+ priv['mark'] = "@#{x},#{y}"
+ lst = html.href(x, y)
+
+ unless lst.size.zero?
+ lnk, target = lst
+
+ if lnk != ""
+ if lnk =~ /^#{last_file}#(.*)$/
+ html.yview($1)
+ else
+ load_file.call(lnk)
+ end
+ end
+ end
+}
+html.clipping_window.bind('1', href_binding, '%x %y')
+
+# marking text with the mouse and copying to the clipboard just with tkhtml2.0 working
+html.clipping_window.bind('B1-Motion', proc{|w, x, y|
+ w.selection_set(priv['mark'], "@#{x},#{y}")
+ TkClipboard.clear
+ # avoid tkhtml0.0 errors
+ # anyone can fix this for tkhtml0.0
+ begin
+ TkClipboard.append(TkSelection.get)
+ rescue
+ end
+ }, '%W %x %y')
+
+# This procedure is called when the user selects the File/Open
+# menu option.
+#
+last_dir = Dir.pwd
+sel_load = proc{
+ filetypes = [
+ ['Html Files', ['.html', '.htm']],
+ ['All Files', '*']
+ ]
+
+ f = Tk.getOpenFile(:initialdir=>last_dir, :filetypes=>filetypes)
+ if f != ''
+ load_file.call(f)
+ last_dir = File.dirname(f)
+ end
+}
+
+# Refresh the current file.
+#
+refresh = proc{|*args|
+ load_file.call(last_file)
+}
+
+# This binding changes the cursor when the mouse move over
+# top of a hyperlink.
+#
+Tk::HTML_Widget::ClippingWindow.bind('Motion', proc{|w, x, y|
+ parent = w.winfo_parent
+ url = parent.href(x, y)
+ unless url.empty?
+ parent[:cursor] = 'hand2'
+ else
+ parent[:cursor] = ''
+ end
+ }, '%W %x %y')
+#
+# Setup menu
+#
+menu_spec = [
+ [['File', 0],
+ ['Open', sel_load, 0],
+ ['Refresh', refresh, 0],
+ '---',
+ ['Exit', proc{exit}, 1]],
+
+ [['View', 0],
+ ['Underline Hyperlinks', ul_hyper],
+ ['Show Table Structure', show_tbl],
+ ['Show Images', show_img]]
+]
+
+mbar = Tk.root.add_menubar(menu_spec)
+
+#
+# Setup trace
+#
+ul_hyper.trace('w', proc{
+ html[:underlinehyperlinks] = ul_hyper.value
+ refresh.call
+ })
+
+show_tbl.trace('w', proc{
+ if show_tbl.bool
+ html[:tablerelief] = :flat
+ else
+ html[:tablerelief] = :raised
+ end
+ refresh.call
+ })
+
+show_img.trace('w', refresh)
+
+# If an arguent was specified, read it into the HTML widget.
+#
+Tk.update
+if file && file != ""
+ load_file.call(file)
+end
+
+#####################################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image1 b/ext/tk/sample/tkextlib/tkHTML/page1/image1
new file mode 100644
index 0000000000..31e96b6797
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image1
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image10 b/ext/tk/sample/tkextlib/tkHTML/page1/image10
new file mode 100644
index 0000000000..80a8f81686
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image10
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image11 b/ext/tk/sample/tkextlib/tkHTML/page1/image11
new file mode 100644
index 0000000000..e8cb01d450
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image11
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image12 b/ext/tk/sample/tkextlib/tkHTML/page1/image12
new file mode 100644
index 0000000000..c317bbd5cc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image12
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image13 b/ext/tk/sample/tkextlib/tkHTML/page1/image13
new file mode 100644
index 0000000000..ac4b3cd594
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image13
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image14 b/ext/tk/sample/tkextlib/tkHTML/page1/image14
new file mode 100644
index 0000000000..c3b02558e3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image14
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image2 b/ext/tk/sample/tkextlib/tkHTML/page1/image2
new file mode 100644
index 0000000000..da26d7092e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image2
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image3 b/ext/tk/sample/tkextlib/tkHTML/page1/image3
new file mode 100644
index 0000000000..d91cdfafab
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image3
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image4 b/ext/tk/sample/tkextlib/tkHTML/page1/image4
new file mode 100644
index 0000000000..5fdf70c0e5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image4
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image5 b/ext/tk/sample/tkextlib/tkHTML/page1/image5
new file mode 100644
index 0000000000..67cd14d78d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image5
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image6 b/ext/tk/sample/tkextlib/tkHTML/page1/image6
new file mode 100644
index 0000000000..9e05aa0f36
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image6
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image7 b/ext/tk/sample/tkextlib/tkHTML/page1/image7
new file mode 100644
index 0000000000..879656d45c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image7
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image8 b/ext/tk/sample/tkextlib/tkHTML/page1/image8
new file mode 100644
index 0000000000..8c647c4f00
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image8
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/image9 b/ext/tk/sample/tkextlib/tkHTML/page1/image9
new file mode 100644
index 0000000000..3a7707589b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/image9
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page1/index.html b/ext/tk/sample/tkextlib/tkHTML/page1/index.html
new file mode 100644
index 0000000000..af87289c28
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page1/index.html
@@ -0,0 +1,115 @@
+<HTML><HEAD><TITLE>Slashdot:News for Nerds. Stuff that Matters.</TITLE> </HEAD>
+<BODY bgcolor="#000000" text="#000000" link="#006666" vlink="#000000">
+<center><a href="http://209.207.224.220/redir.pl?1463" target="_top"><img src="image1" alt="Click Here to enter the Sweepstakes" border="2" width="468" height="60"></a></center> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD WIDTH="1"><SCRIPT LANGUAGE="JAVASCRIPT">
+<!-- now="now" ="" new="new" Date();="Date();" tail="tail" ="" now.getTime();="now.getTime();" document.write("<IMG="document.write("<IMG" SRC="http://209.207.224.245/Slashdot/pc.gif?/slashhead.inc,"+" tail="tail" +="+" "=""" WIDTH="1" HEIGHT="1><BR>");" -->
+</SCRIPT>
+<NOSCRIPT>
+<IMG SRC="image2" WIDTH="1" HEIGHT="1">
+</NOSCRIPT></TD></TR></TABLE><P>
+<TABLE bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
+ <TR>
+ <TD valign="top" align="left" valign="top"><A href="http://slashdot.org/"><IMG src="image3" width="275" height="72" border="0" alt="Welcome to Slashdot"></A></TD>
+ <TD><A href="http://slashdot.org/search.pl?topic=linux"><IMG SRC="image4" width="60" height="70" border="0" alt="Linux"></A></TD>
+<TD><A href="http://slashdot.org/search.pl?topic=news"><IMG SRC="image5" width="34" height="44" border="0" alt="News"></A></TD>
+<TD><A href="http://slashdot.org/search.pl?topic=usa"><IMG SRC="image6" width="80" height="61" border="0" alt="United States"></A></TD>
+<TD><A href="http://slashdot.org/search.pl?topic=ed"><IMG SRC="image7" width="87" height="64" border="0" alt="Education"></A></TD>
+<TD><A href="http://slashdot.org/search.pl?topic=space"><IMG SRC="image8" width="73" height="59" border="0" alt="Space"></A></TD>
+
+</TR></TABLE>
+<TABLE width="99%" align="center" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF"><TR>
+<TD valign="top" rowspan="5"><NOBR><FONT size="2"><B>
+&nbsp;<A href="/faq.shtml">faq</A> <BR>
+&nbsp;<A href="/code.shtml">code</A> <BR>
+&nbsp;<A href="/awards.shtml">awards</A> <BR>
+&nbsp;<A href="http://Andover.Net/privacy.html">privacy</A> <BR>
+&nbsp;<A href="http://slashnet.org">slashNET</A> <BR>
+&nbsp;<A href="/search.pl">older stuff</A> <BR>
+&nbsp;<A href="http://cmdrtaco.net">rob's page</A> <BR>
+&nbsp;<A href="/users.pl?op=preferences">preferences</A> <BR>
+&nbsp;<A href="http://Andover.Net">andover.net</A> <BR>
+&nbsp;<A href="/submit.pl">submit story</A> <BR>
+&nbsp;<A href="/advertising.shtml">advertising</A> <BR>
+&nbsp;<A href="/supporters.shtml">supporters</A> <BR>
+&nbsp;<A href="/pollBooth.pl">past polls</A> <BR>
+&nbsp;<A href="/topics.shtml">topics</A> <BR>
+&nbsp;<A href="/about.shtml">about</A> <BR>
+&nbsp;<A href="/jobs.shtml">jobs</A> <BR>
+&nbsp;<A href="/hof.shtml">hof</A>
+
+</B></FONT></NOBR>
+ <P><TABLE border="0" cellpadding="1" cellspacing="0" align="center" bgcolor="#CCCCCC"><TR>
+ <TD><FONT size="2" color="#000000"><B> Sections</B></FONT></TD></TR>
+ <TR><TD><TABLE border="0" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF" width="100%"><TR><TD><FONT color="#000000" size="2"><NOBR>
+1/23<BR>
+<B><A href="http://slashdot.org/index.pl?section=apache">apache</A></B><BR>
+1/29 (3)<BR>
+<B><A href="http://slashdot.org/index.pl?section=askslashdot">askslashdot</A></B><BR>
+1/27<BR>
+<B><A href="http://slashdot.org/index.pl?section=awards">awards</A></B><BR>
+1/29 (2)<BR>
+<B><A href="http://slashdot.org/index.pl?section=books">books</A></B><BR>
+1/27<BR>
+<B><A href="http://slashdot.org/index.pl?section=bsd">bsd</A></B><BR>
+1/28 (2)<BR>
+<B><A href="http://slashdot.org/index.pl?section=features">features</A></B><BR>
+1/28 (2)<BR>
+<B><A href="http://slashdot.org/index.pl?section=interviews">interviews</A></B><BR>
+1/19<BR>
+<B><A href="http://slashdot.org/index.pl?section=radio">radio</A></B><BR>
+1/27 (2)<BR>
+<B><A href="http://slashdot.org/index.pl?section=science">science</A></B><BR>
+1/28 (3)<BR>
+<B><A href="http://slashdot.org/index.pl?section=yro">yro</A></B><BR> </NOBR></FONT></TD></TR></TABLE><TR>
+ <TD><A href="http://andover.net"><FONT size="2" color="#000000"><B>Andover.Net</B></FONT></A></TD></TR>
+ <TR><TD><TABLE border="0" cellspacing="1" cellpadding="1" bgcolor="#FFFFFF"><TR><TD>
+<FONT color="#000000" size="2"><NOBR><A href="http://www.andovernews.com">AndoverNews</A><BR><A href="http://www.askreggie.com">Ask Reggie</A><BR><A href="http://www.davecentral.com">DaveCentral</A><BR><A href="http://www.freecode.com">FreeCode</A><BR><A href="http://www.mediabuilder.com">MediaBuilder</A><BR> </NOBR></FONT></TD></TR></TABLE></TD></TR></TABLE></P>
+ <P></P>
+</TD><TD valign="top" align="left"><FONT color="#000000"> <TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Who Bought Linux.Net?</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=linux"><IMG src="image4" width="60" height="70" border="0" align="right" hspace="20" vspace="10" alt="Linux"></A> <B>Posted by <A href="http://CmdrTaco.net">CmdrTaco</A> on Saturday January 29, @10:52AM</B><BR> <FONT size="2"><B>from the this-game-again dept.</B></FONT><BR> So Fred VanKampen (who has to hold the record for most money made by reselling two domain names) e-mailed us to say that the Domain Name for 'Linux.Net' has been sold. He won't say to whom, but it supposedly will be announced at LinuxWorld next week. Of course we have no idea what he got for the entry, but the rumors were that he made several million when he sold <A href="http://www.linux.com">Linux.com</A> to <A href="http://www.valinux.com">VA Linux</A>. Hopefully he'll take me for a ride in his yacht. ;) <P><B>( </B><A href="http://slashdot.org/articles/00/01/29/0837235.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/29/0837235&mode=thread&threshold=0">58</A> of <A href="http://slashdot.org/article.pl?sid=00/01/29/0837235&mode=thread&threshold=-1">62</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Book Reviews: E-Mails from (Over?) The Edge</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=news"><IMG src="image5" width="34" height="44" border="0" align="right" hspace="20" vspace="10" alt="News"></A> <B>Posted by <A href="http://hemos.net">Hemos</A> on Saturday January 29, @10:43AM</B><BR> <FONT size="2"><B>from the touching-story dept.</B></FONT><BR> I'd like to thank the author of this book for sending it to me. Nick's written a book that's touching and endearing, and one that's well worth reading for everyone who's ever had social struggles to deal with. As well, his involvement with the fine folks of <a href="http://www.thevenue.org">TheVenue</a>. I'll warn you - it's not a tech text. But it's still worth reading. Click below to read more. <P><B>( </B><A href="http://slashdot.org/books/00/01/24/1146250.shtml"><B>Read More...</B></A> | <A href="http://slashdot.org/article.pl?sid=00/01/24/1146250&mode=nocomment">6197 bytes in body</A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/24/1146250&mode=thread&threshold=0">6</A> of <A href="http://slashdot.org/article.pl?sid=00/01/24/1146250&mode=thread&threshold=-1">22</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Linux Kernel 2.3.41</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=linux"><IMG src="image4" width="60" height="70" border="0" align="right" hspace="20" vspace="10" alt="Linux"></A> <B>Posted by <A href="http://CmdrTaco.net">CmdrTaco</A> on Saturday January 29, @10:21AM</B><BR> <FONT size="2"><B>from the download-compile-reboot-repeat dept.</B></FONT><BR> <A href="mailto:bwhitehead@nospam.acm.org">sdriver</A> writes <I>"For those of us who enjoy *panic*, *oops*, and suddenly seeing their video BIOS... the newest version is out! Be the first on your block to submit a new patch! ;) "</I> If you don't know where to get it, you probably should stick to your warm and cuddly 2.2.x kernel *grin*. Now outta my way, I wanna crash my laptop! <P><B>( </B><A href="http://slashdot.org/articles/00/01/29/0834223.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/29/0834223&mode=thread&threshold=0">52</A> of <A href="http://slashdot.org/article.pl?sid=00/01/29/0834223&mode=thread&threshold=-1">57</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Congress Still Figuring Out E-Mail</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=usa"><IMG src="image6" width="80" height="61" border="0" align="right" hspace="20" vspace="10" alt="United States"></A> <B>Posted by <A href="mailto:roblimo@slashdot.org">Roblimo</A> on Saturday January 29, @07:28AM</B><BR> <FONT size="2"><B>from the voice-of-the-people-can-get-awfully-loud dept.</B></FONT><BR> Jett writes <I>" <A href="http://www.vote.com/">Vote.com</A> has <A href="http://www.vote.com/magazine/editorials/editorial1843752.phtml">an interesting article</A> in their Webmag Fifth Estate about how congressmen have responded to the popularity of e-mail in their daily operations. Quote: 'Of the 440 voting and non-voting House of Representatives members, 22 have no e-mail at all. Even House Speaker Dennis Hastert is wired only halfway -- his office receives e-mail, but does not respond to it. And while all U.S. senators have e-mail, they, like their House counterparts, routinely shun non-constituent mail -- even though they chair committees whose decisions affect the entire country.'"</I> <P><B>( </B><A href="http://slashdot.org/articles/00/01/28/2311232.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/28/2311232&mode=thread&threshold=0">66</A> of <A href="http://slashdot.org/article.pl?sid=00/01/28/2311232&mode=thread&threshold=-1">66</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Ask Slashdot: Sci Fi Literature 101?</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=ed"><IMG src="image7" width="87" height="64" border="0" align="right" hspace="20" vspace="10" alt="Education"></A> <B>Posted by <A href="http://exit118.com/">Cliff</A> on Saturday January 29, @06:56AM</B><BR> <FONT size="2"><B>from the recommendations-wanted dept.</B></FONT><BR> ohlaadee asks: <I>"My niece (she's 13) wants to start reading science fiction. I do too. I gave us both Asimov's </I>_The Foundation_<I>&nbsp; for Christmas. We'll read it together. I suppose we could spend the rest of our lives just reading Asimov, but I'm wondering what books and movies you folks would come up with? What does the /. recommended Science Fiction 101 list include?"</I> <P><B>( </B><A href="http://slashdot.org/askslashdot/00/01/22/1946244.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/22/1946244&mode=thread&threshold=0">345</A> of <A href="http://slashdot.org/article.pl?sid=00/01/22/1946244&mode=thread&threshold=-1">345</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Could Distributed.Net Help the Mars Polar Lander?</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=space"><IMG src="image8" width="73" height="59" border="0" align="right" hspace="20" vspace="10" alt="Space"></A> <B>Posted by <A href="mailto:roblimo@slashdot.org">Roblimo</A> on Saturday January 29, @03:35AM</B><BR> <FONT size="2"><B>from the food-for-thought dept.</B></FONT><BR> Anonymous Coward writes <I>"This official JPL <A href="http://mpfwww.jpl.nasa.gov/msp98/news/mpl000127.html">press release</A> describes the current attempt to listen for faint signals from the Mars Lander. They get three windows a day, and it takes 18 hours to process data because the signal is so weak (if it's really there). Too bad they don't have a deal with <A href="http://www.distributed.net"> distributed.net</A>."</I> Interesting thought. Is anyone at distributed.net or JPL interested in pursuing it? <P><B>( </B><A href="http://slashdot.org/articles/00/01/28/2318246.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/28/2318246&mode=thread&threshold=0">99</A> of <A href="http://slashdot.org/article.pl?sid=00/01/28/2318246&mode=thread&threshold=-1">102</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>iCrave TV Loses Battle against U.S. Broadcasters</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=tv"><IMG src="image10" width="50" height="50" border="0" align="right" hspace="20" vspace="10" alt="Television"></A> <B>Posted by <A href="mailto:roblimo@slashdot.org">Roblimo</A> on Saturday January 29, @12:21AM</B><BR> <FONT size="2"><B>from the shut-down-just-before-the-super-bowl dept.</B></FONT><BR> <A href="mailto:doran@brandx.net">Doran</A> writes <I>"C|Net has <a href="http://news.cnet.com/news/0-1004-200-1535528.html">this story</a> about how the Canadian company <a href="http://www.icravetv.com">iCraveTV.com</a> has lost its latest battle in U.S. courts over whether it can rebroadcast TV signals over the Web. The broadcasters say it's theft, while iCraveTV sez it's just doing what's legal for other cable TV companies in Canada (ie. rebroadcasting TV). Of course, by framing the streaming video iCraveTV is doing more than just rebroadcasting, they're also adding more commercial content, which the broadcasters feel dilutes their TV commercials. "</I> <P><B>( </B><A href="http://slashdot.org/articles/00/01/29/0010203.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/29/0010203&mode=thread&threshold=0">152</A> of <A href="http://slashdot.org/article.pl?sid=00/01/29/0010203&mode=thread&threshold=-1">170</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Win2k Security holes found</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=microsoft"><IMG src="image11" width="75" height="55" border="0" align="right" hspace="20" vspace="10" alt="Microsoft"></A> <B>Posted by <A href="mailto:heunique@slashdot.org">HeUnique</A> on Friday January 28, @04:58PM</B><BR> <FONT size="2"><B>from the and-it's-not-even-out-yet dept.</B></FONT><BR> According to a story posted by <a href="http://www.zdnn.com">ZDNN</a>, <a href="http://www.zdnet.com/zdnn/stories/news/0,4586,2429334,00.html?chkpt=zdnntop">two security holes</a> have been found on Windows 2000, and that's even before the official release of Windows 2000! Administrators who rush to incorporate the patch from MS beware - according to one of the talkback posts on ZDNN, the patch creates a new problem with Windows 2000 news server service. <P><B>( </B><A href="http://slashdot.org/articles/00/01/28/1653228.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/28/1653228&mode=thread&threshold=0">510</A> of <A href="http://slashdot.org/article.pl?sid=00/01/28/1653228&mode=thread&threshold=-1">534</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Encryption Debate at Mitnick Trial</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=encryption"><IMG src="image12" width="80" height="70" border="0" align="right" hspace="20" vspace="10" alt="Encryption"></A> <B>Posted by <A href="http://hemos.net">Hemos</A> on Friday January 28, @03:33PM</B><BR> <FONT size="2"><B>from the gimmie-the-data dept.</B></FONT><BR> A number of people have written about <A HREF="http://nytimes.com/library/tech/00/01/cyber/cyberlaw/28law.html">the latest twist</a> in the Mitnick case. Kevin wants to get his data back, but the government is refusing to do so until he gives them the key. Apparently, the government is unable to crack the encryption that he's got on it - you'd think after having the data for five years, they'd be able to brute-force the darn thing. It's a NYT article - free login required. <P><B>( </B><A href="http://slashdot.org/articles/00/01/28/1320253.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/28/1320253&mode=thread&threshold=0">504</A> of <A href="http://slashdot.org/article.pl?sid=00/01/28/1320253&mode=thread&threshold=-1">521</A> </B>comments <B>)</B> <P><TABLE width="99%" cellpadding="0" cellspacing="0" border="0"><TR><TD valign="top" bgcolor="#006666"><IMG src="image9" width="13" height="16" alt="" align="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Forum: Future Ports of Games to Linux</B></FONT></TD> </TR></TABLE><A href="http://slashdot.org/search.pl?topic=games"><IMG src="image13" width="80" height="56" border="0" align="right" hspace="20" vspace="10" alt="Games"></A> <B>Posted by <A href="http://CmdrTaco.net">CmdrTaco</A> on Friday January 28, @02:26PM</B><BR> <FONT size="2"><B>from the it's-been-awhile dept.</B></FONT><BR> It's been a long time since I posted an open forum like this, but I'm curious what people think on this one. What games do you most want to see ported to Linux in the next few months? Of course, for me personally it's StarCraft and Diablo 2, but I'm curious what games have come out or are due soon that people would most like to see a port of (and note that WINE doesn't count. ;) <P><B>( </B><A href="http://slashdot.org/articles/00/01/28/1257211.shtml"><B>Read More...</B></A> | <B><A href="http://slashdot.org/article.pl?sid=00/01/28/1257211&mode=thread&threshold=0">648</A> of <A href="http://slashdot.org/article.pl?sid=00/01/28/1257211&mode=thread&threshold=-1">652</A> </B>comments <B>)</B> <P></TD><TD width="210" align="center" valign="top"><TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B><A HREF="/index.pl?section=features"><FONT COLOR="#FFFFFF">Features</FONT></A></B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><A href="/vote.pl">Voting has begun</A> for the $100k <A href="/index.pl?section=awards">Slashdot Beanie Awards</A>. Talk amongst yourselves and choose who deserves the cash. <P>The latest installment of <A href="http://www.thesync.com/geeks">Geeks in Space</A> is up at <A href="http://www.thesync.com">The Sync</A>. Listen to CmdrTaco, Hemos, and Nate talk about the latest events to happen - or not happen in the computer world. <P>Perhaps you are seeking Jon Katz's series of articles related to recent events in Colorado. These articles include <A href="/article.pl?sid=99/04/25/1438249">Voices from the Hellmouth</A>, <A href="/article.pl?sid=99/04/27/0310247">More Stories from the Hellmouth</A> or <A href="/article.pl?sid=99/04/29/0124247">The Price of Being Different</A>, <P>For something different, try reading a little essay <A href="/article.pl?sid=99/03/31/0137221">Thoughts from the Furnace</A> about the internet, and flame. <p> And for a bit of an amusing take on the Open Source world, check out <a href="/article.pl?sid=99/08/24/1327256&mode=thread">Open Source as an Ant Farm</a> <P><B>Update: 01/03 03:10</B> by <B><A href="http://cowboyneal.org">CowboyNeal</a></B>: <P align="right"><B><A href="/features/">Past Features</A></B> <!-- end="end" features="features" block="block" --></FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B><A HREF="http://slashdot.org/index.pl?section=askslashdot"><FONT COLOR="#FFFFFF">Ask Slashdot</FONT></A></B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1946244">Sci Fi Literature 101?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/192226">Linux and Satellite Internet Services</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1843258">Open Defensive Patents?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1825252">Technologies That Shaped the Last Century?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1958212">Disk Repair Tools for Linux?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1955215">Why Can't the Command-Line be More Standardized?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1928235">Packet Radio Networking with PalmOS?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1817211">Cheap Rackmount Enclosures/Systems?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1950249">Open Source Software and Tax Breaks?</A> <li><A HREF="http://slashdot.org/article.pl?sid=00/01/22/1917207">Building an Upgradable Dual Processor System</A> <P> if you have a question for Ask Slashdot, send it to <A href="mailto:askslashdot@slashdot.org">askslashdot@slashdot.org</A></FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B><A HREF="/users.pl"><FONT COLOR="#FFFFFF">Slashdot Login</FONT></A></B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><FORM action="/users.pl" METHOD="POST"> <B>Nickname:</B><BR> <INPUT type="text" name="unickname" size="20" value=""><BR> <B>Password:</B><BR> <INPUT type="hidden" name="returnto" value="index.pl"> <INPUT type="password" name="upasswd" size="20"><BR> <INPUT type="submit" name="op" value="userlogin"> </FORM> Don't have an account yet? <A href="/users.pl">Go Create One</A>. A user account will allow you to customize all these <A href="/cheesyportal.shtml">nutty little boxes</A>, tailor the stories you see, as well as remember your comment viewing preferences.</FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Slashdot Poll</B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><FORM action="http://slashdot.org/pollBooth.pl"> <INPUT type="hidden" name="qid" value="techadvance"> <B>The Tech Advance I Most Want Is:</B><BR><INPUT type="radio" name="aid" value="1">Nanotechnology<BR><INPUT type="radio" name="aid" value="2">Cold Fusion<BR><INPUT type="radio" name="aid" value="3">Powerful Fuel Cells<BR><INPUT type="radio" name="aid" value="4">Hard Wiring my Body<BR><INPUT type="radio" name="aid" value="5">Universal Strong Crypto<BR><INPUT type="radio" name="aid" value="6">Interstellar Travel<BR><INPUT type="radio" name="aid" value="7">Cybernetic Body Armor<BR><INPUT type="radio" name="aid" value="8">ColecoVision<BR><INPUT type="submit" value="Vote"> [ <A href="http://slashdot.org/pollBooth.pl?qid=techadvance&aid=-1"><B>Results</B></A> | <A href="http://slashdot.org/pollBooth.pl?"><B>Polls</B></A> ] <BR>Comments:<B>656</B> | Votes:<B>29121</B></FORM> </FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Older Stuff</B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><P><B><A href="http://slashdot.org/index.pl?section=&issue=730512&mode=thread"><FONT size="4">Friday</FONT></A> January 28</B> <LI><A href="http://slashdot.org/articles/00/01/28/1110258.shtml">Abstract Programming and GPL Enforcement</A> (235) <LI><A href="http://slashdot.org/interviews/00/01/28/1225206.shtml">Interview: FreeDOS Leader Jim Hall Answers</A> (86) <LI><A href="http://slashdot.org/articles/00/01/28/116240.shtml">Open Source's Achilles Heel</A> (466) <LI><A href="http://slashdot.org/features/00/01/26/1915230.shtml">The Virtue of Communal Instincts</A> (237) <LI><A href="http://slashdot.org/articles/00/01/28/0723223.shtml">Gartner Group Debunking Open Source Myths</A> (165) <LI><A href="http://slashdot.org/yro/00/01/28/0917229.shtml">DoubleClick Taken to Court</A> (310) <LI><A href="http://slashdot.org/articles/00/01/28/0718209.shtml">Updated Slash & Server 51</A> (81) <LI><A href="http://slashdot.org/articles/00/01/28/089230.shtml">XMMS 1.0.0 Released</A> (128) <LI><A href="http://slashdot.org/askslashdot/00/01/22/192226.shtml">Linux and Satellite Internet Services</A> (138) <LI><A href="http://slashdot.org/articles/00/01/27/1811221.shtml">UN Wants to Combat Online Racism</A> (531) <P><B><A href="http://slashdot.org/index.pl?section=&issue=730511&mode=thread"><FONT size="4">Thursday</FONT></A> January 27</B> <LI><A href="http://slashdot.org/yro/00/01/27/2330205.shtml">Crackdowns, Fools and the MPAA</A> (351) <LI><A href="http://slashdot.org/articles/00/01/27/0832215.shtml">Heroes of Might and Magic III Demo Released</A> (157) <LI><A href="http://slashdot.org/science/00/01/27/1345241.shtml">Sandia Labs Venture Into Nanotechnology</A> (117) <LI><A href="http://slashdot.org/articles/00/01/27/0931237.shtml">CA Announces Program Ports to Linux</A> (195) <LI><A href="http://slashdot.org/interviews/00/01/27/1118251.shtml">Interview: Larry Augustin Finally Answers</A> (210) <LI><A href="http://slashdot.org/awards/00/01/27/0855252.shtml">Final Call for Voting in Slashdot's Beanie Awards</A> (178) <LI><A href="http://slashdot.org/features/00/01/26/197211.shtml">Transmeta Code Morphing != Just In Time</A> (449) <LI><A href="http://slashdot.org/books/00/01/24/1150256.shtml">Intrusion Detection</A> (65) <LI><A href="http://slashdot.org/science/00/01/27/0824239.shtml">Using Enzymes to Help Fight CO2 Build-Up</A> (165) <LI><A href="http://slashdot.org/articles/00/01/27/0712217.shtml">Jon Johansen on ABC World News Tonight</A> (415) <P align="right"><BR><A href="http://slashdot.org/search.pl?section=&min=30"><B>Older Articles</B></A><BR><A href="http://slashdot.org/index.pl?section=&mode=thread&issue=730512"><B>Yesterday's Edition</B></A> </FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B><A HREF="/index.pl?section=books"><FONT COLOR="#FFFFFF">Book Reviews</FONT></A></B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><p>Jon Katz, Resident Gasbag, has a new, very appropriate book coming out soon, <a href="http://www.thinkgeek.com">Geeks</a>. Preorder now and receive the book early. <p>For probably the best fiction read around, check out Neal Stephenson's <cite><a href="/article.pl?sid=99/06/23/139229&mode=thread">Cryptonomicon</a></cite>, an engaging read about WWII, cryptography and buried treasure. And data vaults. <p>If you've been doing a lot of work in Perl, you've probably figured out you really need <cite><a href="/article.pl?sid=99/05/10/2238254&mode=thread">Perl in a Nutshell</a></cite> or <cite><a href="/article.pl?sid=99/01/29/1035246&mode=thread">The Perl Cookbook</a></cite>. If you're still learning, grab <cite><a href="/books/older/980526096229.shtml">Programming Perl</a></cite>. <p>And if you want to learn more about how to become a better coder, grab <cite><a href="/article.pl?sid=99/06/28/1417229&mode=thread">The Unified Software Development Process</a></cite> or <cite><a href="/article.pl?sid=99/04/08/1512209&mode=thread">The Practice of Programming</cite></a> Additionally, check out <cite><a href="http://slashdot.org/article.pl?sid=99/09/16/1333202&mode=thread">Refactoring: Improving the Design of Existing Code</a></cite> . <p>Developing a large application? Grab Eric Greenberg's excellent <cite><a href="/article.pl?sid=99/07/13/1943258&mode=thread">Network Application Frameworks</cite></a>. <P>Visit <A href="/index.pl?section=books">Our Book Reviews Section</A> for more. <br> <B>Update: 11/12 05:19</B> by <B><A href="mailto:hemos@slashdot.org">H</A></B>:</FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B>Quick Links</B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><B>Cool Sites:</B> <LI><A href="http://www.linux.com">Linux.com</A> (What <B>is</B> Linux?) <LI><A href="http://everything.blockstackers.com">Everything</A> (Blow your Mind) <LI><A href="http://www.geekculture.com/geekycomics/Aftery2k/aftery2kmain.html">After Y2k</A> (<I>This</I> is Post-Apocalyptic?) <LI><A href="http://www.userfriendly.org">User Friendly</A> (Laugh) <LI><A href="http://themes.org">Themes.org</A> (Make X Perty) <P><B>Support Slashdot:</B> <LI><A href="http://www.thinkgeek.com">ThinkGeek</A> (Clothe Yourself in Slashdot) <LI><A href="http://cdnow.com/from=sr-302791">CDnow</A> (Support <A href="http://www.cdnow.com/gift/malda@slashdot.org">Rob's Who Habit</A>) <LI><A href="http://adfu.slashdot.org">Slashdot Advertiser Index</A></FONT></TD> </TR> </TABLE><P> <TABLE cellpadding="1" cellspacing="0" border="0" width="200" align="center"> <TR bgcolor="#006666"> <TD valign="top"><FONT size="4" color="#FFFFFF" face="arial,helvetica"><B><A HREF="http://freshmeat.net"><FONT COLOR="#FFFFFF">Freshmeat</FONT></A></B></FONT></TD> </TR><TR><TD bgcolor="#CCCCCC"><FONT color="#000000" size="2"><P><FONT size="4" color="#006666"><B>January</B></FONT><BR> <LI><A href="http://freshmeat.net/news/2000/01/29/949208399.html">We should get this out of the door now</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949159642.html">Is Linux for Crazies?</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949156343.html">SQN Linux 1.6</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949156277.html">Limo 0.3.2</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949156237.html">Fusion GS 1.3</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949145887.html">MMR 1.5.4</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949142835.html">KUPS 0.3.4</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949142815.html">3DSE patch for XMMS 4</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949139763.html">Linux 2.3.41</A> <LI><A href="http://freshmeat.net/news/2000/01/29/949139751.html">Free Code for Linux S/390</A> <FORM METHOD="post" ACTION="http://core.freshmeat.net/search.php3"> <FONT size="3" color="#006666"><B>Search Freshmeat:</B></FONT><BR> <INPUT TYPE="hidden" NAME="link" VALUE="freshmeat.net"> <INPUT TYPE="text" NAME="query"> </FORM> <P align="right"><A href="http://freshmeat.net"><B>More Meat...</B></A></FONT></TD> </TR> </TABLE><P> </FONT></TD>
+ </TR>
+ </TABLE><TABLE cellpadding="0" cellspacing="0" border="0" width="99%" align="center" bgcolor="ffffff">
+ <TR>
+ <TD colspan="4" align="center"><IMG src="image14" alt="" width="80%" height="1" hspace="10" vspace="30"></TD>
+ </TR><TR>
+ <TD align="center"><FONT size="2" face="arial,helvetica">
+ <FORM method="GET" action="http://slashdot.org/search.pl">
+ <INPUT type="name" name="query" value="" width="20" size="20" length="20">
+ <INPUT type="submit" value="Search">
+ </FORM>
+ </FONT>
+ </TD>
+ <TD bgcolor="#ffffff" width="25"> &nbsp; </TD>
+ <TD align="center">
+ <FONT size="2" face="arial,helvetica"><I>Wasn't there something about a PASCAL programmer knowing the value of
+everything and the Wirth of nothing?
+<TD>&nbsp;</TD></I></FONT>
+ </FONT>
+ </TD></TR>
+ <TR><TD colspan="4" align="center">
+ <FONT size="1" color="#006666" face="arial,helvetica">
+
+ All trademarks and copyrights on this
+ page are owned by their respective owners. Comments
+ are owned by the Poster.
+ The Rest 1997-2000 <A href="http://Andover.Net">Andover.Net</A>.
+</FONT></CENTER>
+ </TD>
+ </TR>
+ </TABLE>
+ <CENTER>
+ <FONT size="2" color="#006666">
+
+ [ <A href="http://slashdot.org/"><Font color="#ffffff">home</FONT></A> |
+ <A href="http://slashdot.org/awards.shtml"><Font color="#ffffff">awards</FONT></A> |
+ <A href="http://slashdot.org/supporters.shtml"><FONT color="#ffffff">supporters</FONT></A> |
+ <A href="http://CmdrTaco.net"><FONT color="#ffffff">rob's homepage</FONT></A> |
+ <A href="http://slashdot.org/submit.pl"><FONT color="#ffffff">contribute story</FONT></A> |
+ <A href="http://slashdot.org/search.pl"><FONT color="#ffffff">older articles</FONT></A> |
+ <A href="http://Andover.Net"><FONT color="#ffffff">Andover.Net</FONT></A> |
+ <A href="http://slashdot.org/advertising.shtml"><FONT color="#ffffff">advertising</FONT></A> |
+ <A href="http://slashdot.org/pollBooth.pl"><FONT color="#ffffff">past polls</FONT></A> |
+ <A href="http://slashdot.org/about.shtml"><FONT color="#ffffff">about</FONT></A> |
+ <A href="http://slashdot.org/faq.shtml"><FONT color="#ffffff">faq</FONT></A> ]
+ </FONT>
+ </CENTER>
+</BODY>
+</HTML>
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image1 b/ext/tk/sample/tkextlib/tkHTML/page2/image1
new file mode 100644
index 0000000000..2ed6ddcfe1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image1
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image10 b/ext/tk/sample/tkextlib/tkHTML/page2/image10
new file mode 100644
index 0000000000..3021b68990
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image10
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image11 b/ext/tk/sample/tkextlib/tkHTML/page2/image11
new file mode 100644
index 0000000000..41d1fe3666
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image11
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image12 b/ext/tk/sample/tkextlib/tkHTML/page2/image12
new file mode 100644
index 0000000000..655a686541
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image12
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image13 b/ext/tk/sample/tkextlib/tkHTML/page2/image13
new file mode 100644
index 0000000000..97d5950e8c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image13
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image14 b/ext/tk/sample/tkextlib/tkHTML/page2/image14
new file mode 100644
index 0000000000..6d73ad833c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image14
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image15 b/ext/tk/sample/tkextlib/tkHTML/page2/image15
new file mode 100644
index 0000000000..90cc3b2b16
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image15
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image16 b/ext/tk/sample/tkextlib/tkHTML/page2/image16
new file mode 100644
index 0000000000..93aa853cf1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image16
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image17 b/ext/tk/sample/tkextlib/tkHTML/page2/image17
new file mode 100644
index 0000000000..f46f0308cd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image17
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image18 b/ext/tk/sample/tkextlib/tkHTML/page2/image18
new file mode 100644
index 0000000000..3badd5e909
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image18
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image19 b/ext/tk/sample/tkextlib/tkHTML/page2/image19
new file mode 100644
index 0000000000..bd4f6d9677
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image19
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image2 b/ext/tk/sample/tkextlib/tkHTML/page2/image2
new file mode 100644
index 0000000000..7566dda25d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image2
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image20 b/ext/tk/sample/tkextlib/tkHTML/page2/image20
new file mode 100644
index 0000000000..358fa95f63
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image20
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image21 b/ext/tk/sample/tkextlib/tkHTML/page2/image21
new file mode 100644
index 0000000000..c81aa52588
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image21
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image22 b/ext/tk/sample/tkextlib/tkHTML/page2/image22
new file mode 100644
index 0000000000..6cbd63022a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image22
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image23 b/ext/tk/sample/tkextlib/tkHTML/page2/image23
new file mode 100644
index 0000000000..e8173a7456
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image23
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image24 b/ext/tk/sample/tkextlib/tkHTML/page2/image24
new file mode 100644
index 0000000000..bffd4b4956
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image24
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image25 b/ext/tk/sample/tkextlib/tkHTML/page2/image25
new file mode 100644
index 0000000000..c656fa4f30
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image25
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image26 b/ext/tk/sample/tkextlib/tkHTML/page2/image26
new file mode 100644
index 0000000000..bc93fdb259
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image26
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image27 b/ext/tk/sample/tkextlib/tkHTML/page2/image27
new file mode 100644
index 0000000000..6ad0eff1e7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image27
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image28 b/ext/tk/sample/tkextlib/tkHTML/page2/image28
new file mode 100644
index 0000000000..88f0d7cea6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image28
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image29 b/ext/tk/sample/tkextlib/tkHTML/page2/image29
new file mode 100644
index 0000000000..e0704183b3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image29
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image3 b/ext/tk/sample/tkextlib/tkHTML/page2/image3
new file mode 100644
index 0000000000..ac3fa33e6f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image3
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image30 b/ext/tk/sample/tkextlib/tkHTML/page2/image30
new file mode 100644
index 0000000000..4a41950434
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image30
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image31 b/ext/tk/sample/tkextlib/tkHTML/page2/image31
new file mode 100644
index 0000000000..60f13ed564
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image31
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image32 b/ext/tk/sample/tkextlib/tkHTML/page2/image32
new file mode 100644
index 0000000000..04ddc4e8d7
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image32
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image33 b/ext/tk/sample/tkextlib/tkHTML/page2/image33
new file mode 100644
index 0000000000..c1ecfff6c4
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image33
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image34 b/ext/tk/sample/tkextlib/tkHTML/page2/image34
new file mode 100644
index 0000000000..3dfd5d76e2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image34
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image35 b/ext/tk/sample/tkextlib/tkHTML/page2/image35
new file mode 100644
index 0000000000..aea44f3017
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image35
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image36 b/ext/tk/sample/tkextlib/tkHTML/page2/image36
new file mode 100644
index 0000000000..baef0e0380
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image36
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image37 b/ext/tk/sample/tkextlib/tkHTML/page2/image37
new file mode 100644
index 0000000000..6c6ba52b45
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image37
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image38 b/ext/tk/sample/tkextlib/tkHTML/page2/image38
new file mode 100644
index 0000000000..e298e04b29
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image38
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image39 b/ext/tk/sample/tkextlib/tkHTML/page2/image39
new file mode 100644
index 0000000000..e16e2f10d5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image39
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image4 b/ext/tk/sample/tkextlib/tkHTML/page2/image4
new file mode 100644
index 0000000000..9e5e46b7e5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image4
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image5 b/ext/tk/sample/tkextlib/tkHTML/page2/image5
new file mode 100644
index 0000000000..646a6d9a51
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image5
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image6 b/ext/tk/sample/tkextlib/tkHTML/page2/image6
new file mode 100644
index 0000000000..7df417c710
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image6
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image7 b/ext/tk/sample/tkextlib/tkHTML/page2/image7
new file mode 100644
index 0000000000..0e6ac10aff
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image7
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image8 b/ext/tk/sample/tkextlib/tkHTML/page2/image8
new file mode 100644
index 0000000000..ba7fb476b9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image8
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/image9 b/ext/tk/sample/tkextlib/tkHTML/page2/image9
new file mode 100644
index 0000000000..b1cad73ae9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/image9
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page2/index.html b/ext/tk/sample/tkextlib/tkHTML/page2/index.html
new file mode 100644
index 0000000000..1c67be6c0b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page2/index.html
@@ -0,0 +1,433 @@
+<html>
+<head>
+ <title>Tcl Resource Center</title>
+</head>
+
+<body bgcolor="white" text="black">
+
+ <!-- MenuTopLevel Resource Software Extensions -->
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="120" valign="TOP"><a href="/"><img src="image1" width="120" height="79" alt="Scriptics" border="0"></a></td>
+ <td valign="top" width="548">
+
+ <!-- Table to hold tabs -->
+ <table cellpadding="0" cellspacing="0" border="0" width="548">
+ <tr>
+ <td valign="top" align="right" colspan="15" width="548"><a name="TOP"><img src="image2" width="548" height="9" alt="Tcl/Tk" border="0"></a></td>
+ </tr>
+ <tr>
+ <td valign="top" align="right" colspan="15" width="548"><img src="image3" width="482" height="34" alt="Scripting Solutions for eBusiness Integration" border="0"></td>
+ </tr>
+ <tr>
+ <td width="18" valign="TOP"><img src="image4" width="18" height="36" alt="" border="0"></td>
+ <td width="58"><a href="/products/" onMouseOver="msover(4, 'http://images.scriptics.com/images/ProductsMouseOff.gif') ; return true ;" onMouseOut="msover(4, 'http://images.scriptics.com/images/ProductsOff.gif') ; return true ;"><img src="image5" width="58" height="36" alt="Products" border="0"></a></td>
+ <td width="14" valign="TOP"><img src="image6" width="14" height="36" alt="" border="0"></td>
+ <td width="69"><a href="/customers/" onMouseOver="msover(6, 'http://images.scriptics.com/images/CustomersMouseOff.gif') ; return true ;" onMouseOut="msover(6, 'http://images.scriptics.com/images/CustomersOff.gif') ; return true ;"><img src="image7" width="69" height="36" alt="Customers" border="0"></a></td>
+ <td width="14" valign="TOP"><img src="image6" width="14" height="36" alt="" border="0"></td>
+ <td width="60"><a href="/partners/" onMouseOver="msover(8, 'http://images.scriptics.com/images/PartnersMouseOff.gif') ; return true ;" onMouseOut="msover(8, 'http://images.scriptics.com/images/PartnersOff.gif') ; return true ;"><img src="image8" width="60" height="36" alt="Partners" border="0"></a></td>
+ <td width="14" valign="TOP"><img src="image6" width="14" height="36" alt="" border="0"></td>
+ <td width="56"><a href="/services/" onMouseOver="msover(10, 'http://images.scriptics.com/images/ServicesMouseOff.gif') ; return true ;" onMouseOut="msover(10, 'http://images.scriptics.com/images/ServicesOff.gif') ; return true ;"><img src="image9" width="56" height="36" alt="Services" border="0"></a></td>
+ <td width="14" valign="TOP"><img src="image10" width="14" height="36" alt="" border="0"></td>
+ <td width="88"><a href="/resource/" onMouseOver="msover(12, 'http://images.scriptics.com/images/ResourceMouseOn.gif') ; return true ;" onMouseOut="msover(12, 'http://images.scriptics.com/images/ResourceOn.gif') ; return true ;"><img src="image11" width="88" height="36" alt="Tcl Resources" border="0"></a></td>
+ <td width="14" valign="TOP"><img src="image12" width="14" height="36" alt="" border="0"></td>
+ <td width="57"><a href="/company/" onMouseOver="msover(14, 'http://images.scriptics.com/images/CompanyMouseOff.gif') ; return true ;" onMouseOut="msover(14, 'http://images.scriptics.com/images/CompanyOff.gif') ; return true ;"><img src="image13" width="57" height="36" alt="Company" border="0"></a></td>
+ <td width="8" valign="TOP"><img src="image14" width="8" height="36" alt="" border="0"></td>
+ <td width="50" valign="TOP"><img src="image15" width="50" height="36" alt="" border="0"></td>
+ <td width="14" valign="TOP"><img src="image16" width="14" height="36" alt="" border="0"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table> <script language="Javascript">
+ <!--
+ function msover(num, file )
+ {
+ old = (((navigator.appName=='Netscape') &&
+ (parseInt(navigator.appVersion)<=3.0 )))
+ if ( !old ) {
+ document.images[num].src=file
+ }
+ }
+ //-->
+ </SCRIPT>
+
+<!-- MenuSubLevel Resource Software Extensions Tk -->
+
+<table cellpadding="0" cellspacing="0" border="0">
+
+<!-- Left Hand Column-->
+
+<tr><td valign="top" width="120"><table cellpadding="0" cellspacing="0" border="0" width="120">
+ <tr>
+ <td width="120" valign="TOP"><img src="image17" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/"><img src="image18" width="120" height="11" alt="Software" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image19" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/tcltk/"><img src="image20" width="120" height="11" alt="Tcl/Tk Core" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image19" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/applications/"><img src="image21" width="120" height="11" alt="Applications" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image22" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/extensions/"><img src="image23" width="120" height="11" alt="Extensions" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image24" width="120" height="6" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/patches/"><img src="image25" width="120" height="11" alt="Patches" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image19" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/java/"><img src="image26" width="120" height="11" alt="Tcl &amp; Java" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image19" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/ports/"><img src="image27" width="120" height="11" alt="Tcl/Tk Ports" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image19" width="120" height="4" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/software/tools/"><img src="image28" width="120" height="11" alt="Tools" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image29" width="120" height="6" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/doc/"><img src="image30" width="120" height="11" alt="Documentation" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image31" width="120" height="5" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/resource/community/"><img src="image32" width="120" height="11" alt="Community" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image31" width="120" height="5" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/live/bydate"><img src="image33" width="120" height="11" alt="What's New" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image31" width="120" height="5" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/forms/urlnote.html"><img src="image34" width="120" height="11" alt="Add URL" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image31" width="120" height="5" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/live/keyword"><img src="image35" width="120" height="11" alt="Keyword Search" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image31" width="120" height="5" alt="" border="0"></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><a href="/live/sitemap"><img src="image36" width="120" height="11" alt="Index" border="0"></a></td>
+ </tr>
+ <tr>
+ <td width="120" valign="TOP"><img src="image37" width="120" height="6" alt="" border="0"></td>
+ </tr>
+</table><!-- End Left Column --></td><!-- Right Hand Column --><td valign="top" width="548" align="left"><table cellpadding="0" cellspacing="0" border="0" width="548">
+ <tr>
+ <td width="295" valign="TOP"><img src="image38" width="295" height="42" alt="Resource" border="0"></td>
+ <td width="187" valign="bottom" align="right"><FORM action="/live/keyword"><img src="image39" width="46" height="24" alt="" border="0"><INPUT TYPE="TEXT" SIZE="10" MAXLENGTH="35" NAME="keywords"><INPUT type="IMAGE" border="0" img="img" src="http://images.scriptics.com/images/Go.gif" value="submit" width="33" height="24"></FORM>
+ </tr>
+ </table>
+ <!-- 2 Columns for spacer -->
+ <table cellpadding="0" cellspacing="0" border="0" width="548">
+ <tr>
+ <!-- Spacer Column -->
+ <td valign="top" width="10">
+ &nbsp;
+ </td>
+
+
+ <td valign="top" width="548"><font face="Geneva, Helvetica, Arial" size="2"><h1>Tcl Resource Center</h1>
+<font size="+1"><a href="/resource/">Top</a>&gt;<a href="/resource/software/" ="">Software Central</a>&gt;<a href="/resource/software/extensions/" ="">Extensions</a>&gt;Tk Widgets</font><font size="-1"><br>Viewed by name (<a href="/resource/software/extensions/tk/?sortby=date">By date</a>)</font><br>
+<p>Tk is a toolkit for building graphical user interfaces with Tcl.
+ Your Tcl/Tk scripts run on UNIX, Windows, and Macintosh.<p>
+<font face="Geneva, Helvetica, Arial"><ul></ul></font><dl>
+<dt><b><a href="http://marge.phys.washington.edu/%7Ezager/blt80-unoff-exe.zip" ="">BLT 8.0 Unofficial zip and DLL</a></b>
+<dd>This is a compiled version of BLT 8.0 "unofficial" for
+the Windows platform. <a href="/live/annotate?url=http%3a%2f%2fmarge%2ephys%2ewashington%2eedu%2f%257Ezager%2fblt80%2dunoff%2dexe%2ezip">Edit</a>
+ <i><font size="-1">(September 24, 1999 06:31)</font></i><dt><b><a href="ftp://ftp.neosoft.com/languages/tcl/sorted/unknown/blt8.0p2-unoff.tgz" ="">BLT 8.0p2 Unofficial tar file</a><a name="bltunoff"></a></b>
+<dd>This is a contributed patch to make BLT compatible with Tcl/Tk 8.0p2. While still "unofficial", it is widely used.
+ Make sure you get the 8.0p2 version because the 8.0 version does
+ not compile under windows.
+ There is also a <a href="ftp://ftp.neosoft.com/languages/sorted/devel/blt2.3-8.1.tar.gz">2.3-8.1 version</a> that has been patched to work with 8.1.
+ <a href="ftp://ftp.neosoft.com/languages/tcl/sorted/unknown/blt8.0p2-unoff.README">README file</a>. <a href="/live/annotate?url=ftp%3a%2f%2fftp%2eneosoft%2ecom%2flanguages%2ftcl%2fsorted%2funknown%2fblt8%2e0p2%2dunoff%2etgz">Edit</a>
+ <i><font size="-1">(August 30, 1999 06:38)</font></i><dt><b><a href="http://www.tcltk.com/blt/" ="">BLT Home Page</a></b>
+<dd>
+ Author <b>George Howlett</b>, Version <b>2.3</b>,
+ Works with <b>Tk 4.1 through Tk 8.1</b>
+<br><a href="ftp://ftp.tcltk.com/pub/blt/">Download</a>, <a href="ftp://ftp.tcltk.com/pub/blt/BLT2.3.tar.gz">BLT2.3.tar.gz</a>, <a href="ftp://ftp.tcltk.com/pub/blt/BLT2.4h.tar.gz">BLT2.4h.tar.gz</a>, <a href="ftp://ftp.tcltk.com/pub/blt/BLT2.4i.tar.gz">BLT2.4i.tar.gz</a>, <a href="ftp://ftp.tcltk.com/pub/blt/blt2.4i-for-8.0.exe">blt2.4i-for-8.0.exe</a>, <a href="ftp://ftp.tcltk.com/pub/blt/blt2.4i-for-8.1.exe">blt2.4i-for-8.1.exe</a><br>BLT is a set of widgets for Tk, including a graph widget,
+bar chart, drag&drop, a simple command tracer, and much more.
+The 2.4 release, which is still under development, works with 8.0
+or higher.
+There are also an "<a href="#bltunoff">unofficial</a>" release for 8.0p2
+and 8.1a2 that were not done by the author. <a href="/live/annotate?url=http%3a%2f%2fwww%2etcltk%2ecom%2fblt%2f">Edit</a>
+ <i><font size="-1">(October 26, 1999 09:43)</font></i><dt><b><a href="http://www.unifix-online.com/BWidget/index.html" ="">BWidget</a></b>
+<dd>A set of native Tk 8.x Widgets using Tcl8.x namespaces.
+The ToolKit is available under Unix/X11 and Windows.
+The BWidget(s) have a professional look&feel as in other
+well known Toolkits (Tix or Incr Widget) but the concept is
+radically different because everything is native
+so no platform compilation, no compiled extension
+library are needed. The code is 100 Pure Tcl/Tk.
+More 30 components : Notebook, PageManager, Tree, PanedWindow, ButtonBox,
+ScrollView, ComboBox, SpinBox, ListBox, SelectFont, SelectColor,
+ProgressBare ... <a href="/live/annotate?url=http%3a%2f%2fwww%2eunifix%2donline%2ecom%2fBWidget%2findex%2ehtml">Edit</a>
+ <i><font size="-1">(September 06, 1999 09:58)</font></i><dt><b><a href="http://purl.oclc.org/net/nijtmans/dash.html" ="">Dash Patch for Tk</a></b>
+<dd>This patch has many enhancements to the Tk and its canvas
+widget, including dashed lines, smoothed polygons,
+and performance enhancements. <a href="/live/annotate?url=http%3a%2f%2fpurl%2eoclc%2eorg%2fnet%2fnijtmans%2fdash%2ehtml">Edit</a>
+ <i><font size="-1">(November 21, 1999 06:33)</font></i><dt><b><a href="http://www.hwaci.com/sw/et" ="">Embedded Tk (et)</a></b>
+<dd>
+ Author <b><a href="mailto:drh@acm.org" ="">Richard Hipp</a></b>, Version <b>8.0b5</b>,
+ Works with <b>Tk 4.0, 4.1, 4.2, 8.0</b>
+<br>Download: <a href="http://www.hwaci.com/sw/et/et80b5.tar.gz">et80b5.tar.gz</a><br>Embedded Tk or ``ET'' is tool for making stand-alone executables out of a mixture of C or C++ and Tcl/Tk.
+Using ET you can invoke a short Tcl/Tk script in the middle of a C routine, or you can invoke a C routine in the
+middle of a Tcl/Tk script. ET also bundles external Tcl/Tk scripts (including the standard Tcl/Tk startup scripts)
+into the executable so that the executable can be run on another binary-compatible computer that doesn't have
+Tcl/Tk installed. <a href="/live/annotate?url=http%3a%2f%2fwww%2ehwaci%2ecom%2fsw%2fet">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:35)</font></i><dt><b><a href="http://www.purl.org/net/hobbs/tcl/script/tkcon/" ="">Enhanced Tk Console (TkCon)</a></b>
+<dd>
+ Author <b><a href="mailto:jeffrey.hobbs@oen.siemens.de" ="">Jeff Hobbs</a></b>, Version <b>1.3</b>,
+ Works with <b>Tk 4.1 through Tk 8.1</b>
+<br>Download: <a href="http://www.purl.org/net/hobbs/tcl/script/tkcon/tkcon.tar.gz">tkcon.tar.gz</a><br>TkCon is a replacement for the standard console that comes with Tk (on Windows/Mac, but also works on
+
+Unix). The console itself provides many more features than the standard console. <a href="/live/annotate?url=http%3a%2f%2fwww%2epurl%2eorg%2fnet%2fhobbs%2ftcl%2fscript%2ftkcon%2f">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:06)</font></i><dt><b><a href="http://www.scriptmeridian.org/projects/tk/" ="">Frontier-Tk ScriptMeridian project</a></b>
+<dd>This project seeks to integrate the Tk toolkit
+with the Frontier scripting language. <a href="/live/annotate?url=http%3a%2f%2fwww%2escriptmeridian%2eorg%2fprojects%2ftk%2f">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:36)</font></i><dt><b><a href="http://purl.oclc.org/net/nijtmans/img.html" ="">Img image format extension</a></b>
+<dd>This package enhances Tk, adding support for many other Image formats:
+BMP, XBM, XPM, GIF (with transparency), PNG,
+JPEG, TIFF and postscript.
+This is implemented as a shared library that can be dynamically loaded into
+Tcl/Tk.
+ <a href="/live/annotate?url=http%3a%2f%2fpurl%2eoclc%2eorg%2fnet%2fnijtmans%2fimg%2ehtml">Edit</a>
+ <i><font size="-1">(November 21, 1999 06:35)</font></i><dt><b><a href="http://purl.oclc.org/net/oakley/tcl/mclistbox/index.html" ="">mclistbox - a multi-column listbox widget</a></b>
+<dd>mclistbox is a multi-column listbox that is
+written in pure tcl and runs on all platforms
+that support tcl/tk 8.0 or higher. This widget
+requires no other extensions; it is completely
+standalone. <a href="/live/annotate?url=http%3a%2f%2fpurl%2eoclc%2eorg%2fnet%2foakley%2ftcl%2fmclistbox%2findex%2ehtml">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:37)</font></i><dt><b><a href="http://home.t-online.de/home/dshepherd/tkview.htm" ="">MFC views C++ class for embedding Tk</a></b>
+<dd>The idea of embedding Tk in MFC windows always seemed very enticing but information was sparse and contradictory - on a
+ scale between "very easy" and "not yet possible". The only thing for it was to have a go and lo, it wasn't that hard after all.
+ CTkView is a C++ class which can be used in MFC SDI or MDI applications. An instance of CTkView hosts an embedded Tk
+ toplevel widget and performs some management chores for the widget so that it can size, update and react correctly to Windows
+ events. <a href="/live/annotate?url=http%3a%2f%2fhome%2et%2donline%2ede%2fhome%2fdshepherd%2ftkview%2ehtm">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:38)</font></i><dt><b><a href="http://www.cs.umd.edu/hcil/pad++" ="">Pad++</a></b>
+<dd>
+ Author <b><a href="mailto:pad-info@cs.umd.edu" ="">Ben Bederson et al</a></b>, Version <b>0.9p1</b>,
+ Works with <b>8.0</b>
+<br>Download: <a href="http://www.cs.umd.edu/hcil/pad++/download.html">download.html</a><br>Pad++ is a Tk widget that provides a Zoomable User Interface (ZUI) that supports real-time interactive zoomable graphics in a fashion similar to the Tk Canvas widget. Pad++ supports tens of thousands of objects which include text, images, graphics, portals, lenses, simple html (and more), including transparency and rotation. <a href="/live/annotate?url=http%3a%2f%2fwww%2ecs%2eumd%2eedu%2fhcil%2fpad%2b%2b">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:39)</font></i><dt><b><a href="http://home.t-online.de/home/sesam.com/freeware.htm" ="">Progressbar</a></b>
+<dd>Progressbar is a megawidget written in pure tcl (ie: no compiling required - runs on all platforms Macintosh, Unix, Windows).
+Its primary purpose is to show the progress of any action in percent. <a href="/live/annotate?url=http%3a%2f%2fhome%2et%2donline%2ede%2fhome%2fsesam%2ecom%2ffreeware%2ehtm">Edit</a>
+ <i><font size="-1">(January 24, 2000 09:19)</font></i><dt><b><a href="http://jfontain.free.fr/" ="">scwoop (Simple Composite Widget Object Oriented Package)</a></b>
+<dd>Scwoop is a composite widget (also known as mega widget) extension to the great Tk widget library. Scwoop is
+entirely written in Tcl using the stooop (Simple Tcl Only Object Oriented Programming) extension. <a href="/live/annotate?url=http%3a%2f%2fjfontain%2efree%2efr%2f">Edit</a>
+ <i><font size="-1">(January 09, 2000 02:10)</font></i><dt><b><a href="http://www2.clearlight.com/~oakley/tcl/supertext.html" ="">Supertext - tk text widget with unlimited undo</a></b>
+<dd>
+ Author <b><a href="mailto:oakley@channelpoint.com" ="">Bryan Oakley</a></b>, Version <b>1.0b1</b>,
+ Works with <b>Tcl 8.0</b>
+<br>Download: <a href="http://www2.clearlight.com/~oakley/tcl/supertext.tcl">supertext.tcl</a><br>Supertext is a package that provides a tk text widget with full undo and the ability to execute procedures both before and after a text
+widget command has been processed. Supertext may be used as-is, or for the brave it may be used in place of the standard text
+widget. <a href="/live/annotate?url=http%3a%2f%2fwww2%2eclearlight%2ecom%2f%7eoakley%2ftcl%2fsupertext%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:06)</font></i><dt><b><a href="http://www.hwaci.com/sw/tk/nbpi.html" ="">Tabbed Notebook Widget</a></b>
+<dd>
+ Author <b><a href="mailto:drh@acm.org" ="">Richard Hipp</a></b>, Version <b>1.0</b>,
+ Works with <b>Tk 4.1 or later.</b>
+<br>Download: <a href="http://www.hwaci.com/sw/tk/notebook.tcl">notebook.tcl</a><br>This implements a tabbed notebook using
+a canvas widget and embedded frames.
+This is pure Tcl
+code - not a C extension. <a href="/live/annotate?url=http%3a%2f%2fwww%2ehwaci%2ecom%2fsw%2ftk%2fnbpi%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:08)</font></i><dt><b><a href="http://www.tcltk.com/ellson/ftp/Gdtclft2.0.README" ="">Tcl GD - graphics</a></b>
+<dd>
+ Author <b>John Ellson and Spencer Thomas</b>, Version <b>2.0</b>,
+ Works with <b>8.0 and higher</b>
+<br>Download: <a href="http://www.tcltk.com/ellson/ftp/Gdtclft2.0.tar.gz">Gdtclft2.0.tar.gz</a><br>
+ Thomas Boutell's Gd package provides a convenient way to generate
+ PNG images with a C program. If you prefer Tcl for CGI
+ applications, you'll want the TCL GD extension. <a href="/live/annotate?url=http%3a%2f%2fwww%2etcltk%2ecom%2fellson%2fftp%2fGdtclft2%2e0%2eREADME">Edit</a>
+ <i><font size="-1">(August 19, 1999 14:52)</font></i><dt><b><a href="http://www.stratasys.com/software/metagui" ="">The Meta-GUI Tools</a></b>
+<dd>The Meta-GUI tools provide a framework for quickly building full
+GUI applications. The GUI is rendered by a run-time engine
+based on a hierarchical set of definitions you provide. At the bottom
+of the hierarchy are abstract data types such as length, angle,
+string, etc., and these are used to progressively build up frames,
+dialogs, toolbars, menus, and operations. <a href="/live/annotate?url=http%3a%2f%2fwww%2estratasys%2ecom%2fsoftware%2fmetagui">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:10)</font></i><dt><b><a href="http://jfontain.free.fr/" ="">Tkpiechart Home Page</a></b>
+<dd>Tkpiechart is a Tcl-only extension that allows the programmer to create and dynamically update 2D or 3D pie
+charts in a Tcl/Tk application. This uses the stooop package and builds
+pie charts on a Tk canvas. <a href="/live/annotate?url=http%3a%2f%2fjfontain%2efree%2efr%2f">Edit</a>
+ <i><font size="-1">(January 09, 2000 02:12)</font></i><dt><b><a href="http://www.cygnus.com/~irox/tkprint/" ="">TkPrint</a></b>
+<dd>TkPrint is an extension that allows you to print from a
+ Tk widget. <a href="/live/annotate?url=http%3a%2f%2fwww%2ecygnus%2ecom%2f%7eirox%2ftkprint%2f">Edit</a>
+ <i><font size="-1">(October 11, 1999 09:58)</font></i><dt><b><a href="http://www.purl.org/net/hobbs/tcl/capp/" ="">TkTable Home Page</a></b>
+<dd>The TkTable widget. The <code>table</code> command creates a
+2-dimensional grid of cells. The table can use a Tcl array variable or Tcl
+
+command for data storage and retrieval. <a href="/live/annotate?url=http%3a%2f%2fwww%2epurl%2eorg%2fnet%2fhobbs%2ftcl%2fcapp%2f">Edit</a>
+ <i><font size="-1">(November 18, 1999 09:25)</font></i><dt><b><a href="http://ftp.austintx.net/users/jatucker/TkTextmatrix/default.htm" ="">TkTextMatrix (spreadsheet)</a></b>
+<dd>
+ Author <b><a href="mailto:jatucker@austin.dsccc.com" ="">John Arthur Tucker</a></b>, Version <b>4.1</b>,
+ Works with <b>Tk 4.1</b>
+<br>Download: <a href="http://ftp.austintx.net/users/jatucker/TkTextmatrix/download.htm">download.htm</a>, <a href="http://ftp.austintx.net/users/jatucker/TkTextmatrix/textmatrix4.1.tar.gz">textmatrix4.1.tar.gz</a><br>A Tcl/Tk spreadsheet widget, TkTextmatrix, which is implemented in C++ and is
+ basically a Tk Canvas widget plus extra behavior for manipulating rows and columns of cell
+ items many times faster than with a plain Tk Canvas. It actually inserts text nearly as fast
+ as the Tk Text widget. If you work with or are interested in creating your own Tcl/Tk widgets
+ in C++, you might want to take a look at the C++ widget library included with this
+ distribution. <a href="/live/annotate?url=http%3a%2f%2fftp%2eaustintx%2enet%2fusers%2fjatucker%2fTkTextmatrix%2fdefault%2ehtm">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:14)</font></i><dt><b><a href="http://www.cs.umd.edu/~bederson/Togl.html" ="">ToGL - a Tk Open GL widget</a></b>
+<dd>Togl is a Tk widget for OpenGL rendering. Togl is based on OGLTK, originally written by Benjamin Bederson at the
+University of New Mexico (who has since moved to the University of Maryland). Togl adds the new features:
+<ul>
+<li> color-index mode support including color allocation functions
+<li> support for requesting stencil, accumulation, alpha buffers, etc
+<li> multiple OpenGL drawing widgets
+<li> OpenGL extension testing from Tcl
+<li> simple, portable font support
+<li> overlay plane support
+</ul>
+Togl allows one to create and manage a special Tk/OpenGL widget with Tcl and render into it with a C program. That is,
+a typical Togl program will have Tcl code for managing the user interface and a C program for computations and
+OpenGL rendering. <a href="/live/annotate?url=http%3a%2f%2fwww%2ecs%2eumd%2eedu%2f%7ebederson%2fTogl%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:14)</font></i><dt><b><a href="http://www.hwaci.com/sw/tk/treepi.html" ="">Tree Widget</a></b>
+<dd>This implements a tree display in a canvas widget.
+It is similar in layout to that of the
+Windows explorer file viewer. This is pure Tcl
+code - not a C extension. <a href="/live/annotate?url=http%3a%2f%2fwww%2ehwaci%2ecom%2fsw%2ftk%2ftreepi%2ehtml">Edit</a>
+ <i><font size="-1">(September 29, 1999 14:37)</font></i><dt><b><a href="http://www.du.edu/~mschwart/tcl-tk.htm" ="">Windows Extensions for Tcl/Tk (Michael Schwartz)</a></b>
+<dd>This site has pointers to several extensions specific to the
+Windows platform. The extensions provide printing,
+a MAPI interface to send email, and an interface to manipulate
+.INI files, among other things. <a href="/live/annotate?url=http%3a%2f%2fwww%2edu%2eedu%2f%7emschwart%2ftcl%2dtk%2ehtm">Edit</a>
+ <i><font size="-1">(October 07, 1999 10:50)</font></i><dt><b><a href="http://www.tcltk.com/iwidgets/" ="">[incr Widgets] Home Page</a></b>
+<dd>[incr Widgets] is a set of megawidgets (combo boxes, etc.) that are
+upon the [incr Tcl] object system and the [incr Tk] megawidget
+framework. This comes bundled with the
+<a href="http://www.tcltk.com/itcl/">[incr Tcl]</a> distributions. <a href="/live/annotate?url=http%3a%2f%2fwww%2etcltk%2ecom%2fiwidgets%2f">Edit</a>
+ <i><font size="-1">(September 05, 1999 16:08)</font></i><dt><b><a href="http://www1.clearlight.com/~oakley/tcl/combobox/index.html" ="">combobox</a></b>
+<dd>
+ Author <b><a href="mailto:oakley@channelpoint.com" ="">Bryan Oakley</a></b>, Version <b>1.03</b>,
+ Works with <b>8.x</b>
+<br>Download: <a href="http://www1.clearlight.com/~oakley/tcl/combobox/combobox.tcl">combobox.tcl</a><br>combobox is a pure-tcl implementation of a combobox widget. It is
+entirely self contained and does not require any other OO or megawidget
+extension. It supports both editable and non-editable entries, and
+provides the ability to call a procedure anytime the value of the combobox
+changes. <a href="/live/annotate?url=http%3a%2f%2fwww1%2eclearlight%2ecom%2f%7eoakley%2ftcl%2fcombobox%2findex%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:15)</font></i><dt><b><a href="http://www.multimania.com/droche/rnotebook/index.html" ="">Rnotebook</a></b>
+<dd>
+ Author <b><a href="mailto:dan@lectra.com" ="">Daniel Roche</a></b>, Version <b>1.0</b>,
+ Works with <b>8.0 or higher</b>
+<br>Download: <a href="http://www.multimania.com/droche/rnotebook/index.html">index.html</a><br>This implements a resizeable notebook
+widget in pure tcl/tk <a href="/live/annotate?url=http%3a%2f%2fwww%2emultimania%2ecom%2fdroche%2frnotebook%2findex%2ehtml">Edit</a>
+ <i><font size="-1">(August 19, 1999 15:39)</font></i><dt><b><a href="http://www.tregar.com/samdi.html" ="">saMDI v1.0a1 Multi-Document Interface Extension</a></b>
+<dd>A multi-document interface (MDI) extension for TCL/Tk 8.0.
+This is a common interface format in Microsoft Windows that lets a parent window contain multiple child windows.
+In effect you get a window manager inside a window!
+Uses and includes the STOOOP object-oriented extension by
+Jean-Luc Fontaine.
+saMDI v1.0a1 GPL Copyright 1998 Sam Tregar. <a href="/live/annotate?url=http%3a%2f%2fwww%2etregar%2ecom%2fsamdi%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:07)</font></i><dt><b><a href="http://tix.mne.com/htdocs/tix/index.html" ="">Tix Support Site</a></b>
+<dd>
+ Author <b><a href="mailto:tix@mne.com" ="">Ioi Lam, (adopted by Gregg Squires)</a></b>, Version <b>4.1</b>,
+ Works with <b>Tcl 7.4 through Tcl 8.0</b>
+<br><a href="ftp://ftp.tix.mne.com/pub/tix/">Download</a>, <a href="ftp://ftp.tix.mne.com/pub/tix/Tix4.1.0.006.tar.gz">Tix4.1.0.006.tar.gz</a>, <a href="ftp://ftp.tix.mne.com/pub/tix/Tix41p6.zip">Tix41p6.zip</a>, <a href="ftp://ftp.tix.mne.com/pub/tix/win41p6bin.zip">win41p6bin.zip</a><br><b>Tix has found a new home!</b>
+ <br>
+ Tix provides over 40 new Tk including the
+combo box, file selection dialogs, paned widget,
+notebook, hierarchical list, directory tree, and more.
+ <a href="/live/annotate?url=http%3a%2f%2ftix%2emne%2ecom%2fhtdocs%2ftix%2findex%2ehtml">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:11)</font></i><dt><b><a href="ftp://ftp.archive.eso.org/pub/tree" ="">Tk Tree Widget (C++)</a></b>
+<dd>Tk Tree widget for Tcl8.0.3.
+
+This version contains (optional) support for \[incr Tcl\] and \[incr Tk\]
+version 3.0.
+<br>
+With the tree widget, you can display a tree in a Tk canvas. The nodes
+can be made up of any number of canvas items or even other Tk widgets.
+You create the objects that make up a node and the line that connects
+it to its parent and pass them to the tree widget. After this the tree
+widget manages the positions of the nodes and end points of the tree
+lines. Operations are available for inserting, moving and removing
+nodes and subtrees and for querrying the position of a node in the
+tree. The tree can be displayed horizontally or vertically.
+ <a href="/live/annotate?url=ftp%3a%2f%2fftp%2earchive%2eeso%2eorg%2fpub%2ftree">Edit</a>
+ <i><font size="-1">(August 25, 1999 03:14)</font></i><dt><b><a href="http://www.purl.org/net/hobbs/tcl/script/widget/" ="">widget, simple megawidget package</a></b>
+<dd>
+ Author <b><a href="mailto:jeffrey.hobbs@oen.siemens.de" ="">Jeffrey Hobbs</a></b>, Version <b>0.9</b>,
+ Works with <b>Tcl/Tk 8.0 or higher</b>
+<br>Download: <a href="http://www.purl.org/net/hobbs/tcl/script/widget/widget-0.9.tar.gz">widget-0.9.tar.gz</a><br>This is a package of
+ megawidgets (i.e., compound widgets) that work almost exactly like Tk widgets.
+ You can also build your own new megawidgets.
+Includes: combobox, hierarchy, console, progressbar,
+tabnotebook, validating entry, pane geometry manager, baloon help. <a href="/live/annotate?url=http%3a%2f%2fwww%2epurl%2eorg%2fnet%2fhobbs%2ftcl%2fscript%2fwidget%2f">Edit</a>
+ <i><font size="-1">(August 23, 1999 12:16)</font></i></dl>
+<hr><p><center><font size="-1" face="Geneva, Helvetica, Arial"><br><a href="#TOP"><b>Top</b></a><br><!-- key ResourceSoftwareExtensions --><a href="/">Home</a>
+ | <a href="/products/">Products</a>
+ | <a href="/customers/">Customers</a>
+ | <a href="/partners/">Partners</a>
+ | <a href="/services/">Services</a>
+ | <a href="/resource/">Tcl Resources</a>
+ | <a href="/company/">Company</a>
+<br><a href="/live/keyword">Search</a>
+ | <a href="/live/map">Site Map</a>
+ | <a href="/company/feedback.html?url=%2fresource%2fsoftware%2fextensions%2ftk%2f">Feedback</a>
+ | <a href="/company/contact.html">Contact Us</a>
+ | <a href="mailto:info@scriptics.com">info@scriptics.com</a>
+
+ <SCRIPT LANGUAGE="Javascript">
+<!--
+ browser = (((navigator.appName == "Netscape") &&(parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName =="Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))
+
+ if ( browser )
+ {
+ over = new MakeImageArray(10)
+ over[0].src = "http://images.scriptics.com/images/ProductsMouseOff.gif"
+ over[1].src = "http://images.scriptics.com/images/CustomersMouseOff.gif"
+ over[2].src = "http://images.scriptics.com/images/PartnersMouseOff.gif"
+ over[3].src = "http://images.scriptics.com/images/ServicesMouseOff.gif"
+ over[4].src = "http://images.scriptics.com/images/ResourceMouseOff.gif"
+ over[5].src = "http://images.scriptics.com/images/CompanyMouseOff.gif"
+ over[6].src = "http://images.scriptics.com/images/homeMainRollover1.gif"
+ over[7].src = "http://images.scriptics.com/images/homeMainRollover2.gif"
+ over[8].src = "http://images.scriptics.com/images/homeMainRollover3.gif"
+ over[9].src = "http://images.scriptics.com/images/homeMainRollover3.gif"
+
+ }
+
+ function MakeImageArray(n) {
+ this.length = n
+ for (var i = 0; i<=n; i++)="i++)" {="{" this[i]="this[i]" ="" new="new" Image()="Image()" }="}" return="return" this="this" }="}" //="//" --="--">
+ </SCRIPT><br>
+ <font size="2">
+ &copy; 1998-2000 Scriptics Corporation. All rights reserved.
+ <a href="/legal_notice.html">Legal Notice</a> | <A href="" /privacy.html="/privacy.html">
+ Privacy Statement</a>
+ </td></tr></table></td></tr></table>
+</Body>
+</Html>
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image1 b/ext/tk/sample/tkextlib/tkHTML/page3/image1
new file mode 100644
index 0000000000..814d1e8f08
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image1
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image10 b/ext/tk/sample/tkextlib/tkHTML/page3/image10
new file mode 100644
index 0000000000..45001faf05
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image10
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image11 b/ext/tk/sample/tkextlib/tkHTML/page3/image11
new file mode 100644
index 0000000000..7c4c170f21
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image11
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image12 b/ext/tk/sample/tkextlib/tkHTML/page3/image12
new file mode 100644
index 0000000000..903e7344a6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image12
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image13 b/ext/tk/sample/tkextlib/tkHTML/page3/image13
new file mode 100644
index 0000000000..226d4f68c2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image13
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image14 b/ext/tk/sample/tkextlib/tkHTML/page3/image14
new file mode 100644
index 0000000000..8e8c71814c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image14
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image2 b/ext/tk/sample/tkextlib/tkHTML/page3/image2
new file mode 100644
index 0000000000..2ddeb3258c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image2
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image3 b/ext/tk/sample/tkextlib/tkHTML/page3/image3
new file mode 100644
index 0000000000..1651ba7e41
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image3
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image4 b/ext/tk/sample/tkextlib/tkHTML/page3/image4
new file mode 100644
index 0000000000..b565c8dd0e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image4
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image5 b/ext/tk/sample/tkextlib/tkHTML/page3/image5
new file mode 100644
index 0000000000..e1268b81c0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image5
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image6 b/ext/tk/sample/tkextlib/tkHTML/page3/image6
new file mode 100644
index 0000000000..1a6b260b40
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image6
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image7 b/ext/tk/sample/tkextlib/tkHTML/page3/image7
new file mode 100644
index 0000000000..cec7aa04d8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image7
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image8 b/ext/tk/sample/tkextlib/tkHTML/page3/image8
new file mode 100644
index 0000000000..ad0d748d65
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image8
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/image9 b/ext/tk/sample/tkextlib/tkHTML/page3/image9
new file mode 100644
index 0000000000..46ade3018b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/image9
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page3/index.html b/ext/tk/sample/tkextlib/tkHTML/page3/index.html
new file mode 100644
index 0000000000..a04470e659
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page3/index.html
@@ -0,0 +1,2787 @@
+<html><body bgcolor="white">
+<hr>
+<h1 align="center">Embedding Tcl in C/C++ Applications</h1>
+
+ <table width="100%">
+ <tr><td valign="top" align="left" width="46%">
+ <b>Presented At:</b>
+ <blockquote>
+ The&nbsp;Tcl2K&nbsp;Conference<br>
+ Austin, Texas<br>
+ <nobr>9:00am, February 15, 2000</nobr><br>
+ </blockquote>
+ </td>
+ <td width="5%">&nbsp;</td>
+ <td valign="top" align="left" width="46%">
+ <b>Instructor:</b>
+ <blockquote>
+ D. Richard Hipp<br>
+ drh@hwaci.com<br>
+ http://www.hwaci.com/drh/<br>
+ 704.948.4565
+ </blockquote>
+ </td></tr>
+ </table><p>
+ <center><table border="2">
+ <tr><td>
+ <p align="center">
+ Copies of these notes, example source code,<br>and other
+ resources related to this tutorial<br>are available online at
+ <a href="http://www.hwaci.com/tcl2k/">
+ http://www.hwaci.com/tcl2k/</a></p>
+ <p align="center"><small>$Id$</small></p></td></tr>
+ </table>
+ </center>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Tutorial Outline</h2>
+<p><ul><li>Introduction</li>
+<li>Building It Yourself</li>
+<ul><li>"Hello, World!" using Tcl</li>
+<li>Tcl scripts as C strings</li>
+<li>Adding new Tcl commands</li>
+<li>A tour of the Tcl API</li>
+<li>Tcl initialization scripts</li>
+<li>Adding Tk</li>
+</ul><li>Tools Survey</li>
+<li>Mktclapp</li>
+<ul><li>"Hello World" using mktclapp</li>
+<li>Adding C code</li>
+<li>Other Features</li>
+<li>Invoking Tcl from C</li>
+<li>Running mktclapp directly</li>
+<li>Real-world examples</li>
+</ul><li>Summary</li>
+</ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Embedding Tcl in C/C++ Applications</h2>
+<p><ul><li>You know how to program in Tcl/Tk</li></ul><ul><li>You know how to program in C/C++</li></ul><ul><li>This tutorial is about how to do both at the same time.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Why Mix C With Tcl/Tk?</h2>
+<p><ul><li>Use C for the things C is good at and Tcl for the things
+ Tcl is good at.</li></ul><ul><li>Generate standalone executables.
+ <ul><li>Eliminate the need to install Tcl/Tk.</li>
+ <li>Prevent problems when the wrong version of Tcl/Tk is installed.</li>
+ </ul></li></ul><ul><li>Prevent end users from changing the source code.
+ <ul><li>Keeps users from creating new bugs.</li>
+ <li>Protects proprietary code.</li>
+ </ul></li></ul><ul><li>Office politics</li></ul><ul><li>Use Tcl/Tk as a portability layer for a large C program</li></ul><ul><li>Use Tcl as a testing interface</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Why Mix C With Tcl/Tk?</h2>
+<p><blockquote><big><b>
+ "Use C for the things C is good at and use Tcl/Tk for the things
+ Tcl/Tk is good at."
+ </b></blockquote></p><p>
+
+ <table width="100%">
+ <tr><td valign="top" align="left" width="46%">
+ <b>C is good at:</b>
+ <ul>
+ <li>Speed</li>
+ <li>Complex data structures</li>
+ <li>Computation</li>
+ <li>Interacting with hardware</li>
+ <li>Byte-by-byte data analysis</li>
+ </ul>
+ </td>
+ <td width="5%">&nbsp;</td>
+ <td valign="top" align="left" width="46%">
+ <b>Tcl/Tk is good at:</b>
+ <ul>
+ <li>Building a user interface</li>
+ <li>Manipulation of strings</li>
+ <li>Portability</li>
+ <li>Opening sockets</li>
+ <li>Handling events</li>
+ </ul>
+ </td></tr>
+ </table>
+<br clear="both"><p><hr></p>
+<h2 align="center">Programming Models</h2>
+<table width="100%">
+<tr><td valign="top" width="49%">
+
+ <p><b>Mainstream Tcl Programming Model:</b></p>
+</td>
+<td width="2%">&nbsp;</td>
+<td valign="top" width="49%">
+
+ <p><b>Embedded Tcl Programming Model:&nbsp;&nbsp;</b></p>
+</td></tr>
+<tr><td valign="top" width="49%">
+
+ <ul><li>Add bits of C code to a large Tcl program</li></ul>
+</td>
+<td width="2%">&nbsp;</td>
+<td valign="top" width="49%">
+
+ <ul><li>Add bits of Tcl code to a large C program</li></ul>
+</td></tr>
+<tr><td valign="top" width="49%">
+
+ <ul><li>Main Tcl script loads extensions written in C</li></ul>
+</td>
+<td width="2%">&nbsp;</td>
+<td valign="top" width="49%">
+
+ <ul><li>Main C procedure invokes the Tcl interpreter</li></ul>
+</td></tr>
+<tr><td valign="top" width="49%">
+
+ <ul><li>Tcl/Tk is a programming language</li></ul>
+</td>
+<td width="2%">&nbsp;</td>
+<td valign="top" width="49%">
+
+ <ul><li>Tcl/Tk is a C library</li></ul>
+</td></tr>
+<tr><td valign="top" width="49%">
+
+ <center><img src="image1"><br>
+ Most of the Tcl2K conference is about</center>
+</td>
+<td width="2%">&nbsp;</td>
+<td valign="top" width="49%">
+
+ <center><img src="image1"><br>
+ This tutorial is about</center>
+</td></tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using The Tcl Library</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h></tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Always include &lt;tcl.h></td>
+</tr>
+<tr><td valign="center">
+<small><tt>int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Create a new Tcl interpreter</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;"puts&nbsp;{Hello,&nbsp;World!}");</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Execute a Tcl command.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Compiling "Hello, World!"</h2>
+<p><p><b>Unix:</b></p>
+ <blockquote><tt>
+ $ gcc hello.c -ltcl -lm -ldl<br>
+ $ ./a.out<br>
+ Hello, World!</tt></blockquote>
+
+ <p><b>Windows using Cygwin:</b></p>
+ <blockquote><tt>
+ C:> gcc hello.c -ltcl80 -lm<br>
+ C:> a.exe<br>
+ Hello, World!</tt></blockquote>
+
+ <p><b>Windows using Mingw32:</b></p>
+ <blockquote><tt>
+ C:> gcc -mno-cygwin hello.c -ltcl82 -lm<br>
+ </tt></blockquote>
+<table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>Also works with VC++</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Where Does <tt>-ltcl</tt> Come From On Unix?</h2>
+<p><p>Build it yourself using these steps:</p></p><p>
+<p><ul><li>Get tcl8.2.2.tar.gz from Scriptics</li></ul><ul><li><tt>zcat tcl8.2.2.tar.gz | tar vx </tt></li></ul><ul><li><tt>cd tcl8.2.2/unix</tt></li></ul><ul><li><tt>./configure --disable-shared</tt></li></ul><ul><li><tt>make</tt></li></ul><ul><li>Move <b>libtcl8.2.a</b> to your lib directory.</li></ul><ul><li>Copy <b>../generic/tcl.h</b> into /usr/include.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">What Other Libraries Are Required For Unix?</h2>
+<p><ul><li>The sequence of <b>-l</b> options after <b>-ltcl</b>
+ varies from system to system</li></ul><ul><li>Observe what libraries the TCL makefile inserts when
+ it is building <b>tclsh</b></li></ul><ul><li>Examples in this talk are for RedHat Linux 6.0 for Intel</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">How To Compile Under Unix Without Installing Tcl</h2>
+<p><p>Specify the *.a file directly:</p>
+ <blockquote><pre>
+ $ gcc -I../tcl8.2.2/generic hello.c \
+ ../tcl8.2.2/unix/libtcl8.2.a -lm -ldl
+ $ strip a.out
+ $ ./a.out
+ Hello, World!</pre></blockquote>
+
+ <p>Or, tell the C compiler where to look for *.a files:</p>
+ <blockquote><pre>
+ $ gcc -I../tcl8.2.2/generic hello.c \
+ -L../tcl8.2.2/unix -ltcl -lm -ldl
+ $ strip a.out
+ $ ./a.out
+ Hello, World!</pre></blockquote>
+<table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>The <tt>-I../tcl8.2.2</tt> argument
+ tells the compiler where to
+ find <tt>&lt;tcl.h&gt;</tt>.</p></b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">What's "Cygwin"?</h2>
+<p><ul><li>An implementation of GCC/G++ and all development tools
+ for Windows95/98/NT/2000</li></ul><ul><li>Available for free download at
+ <blockquote>
+ <tt>http://sourceware.cygnus.com/cygwin/</tt>
+ </blockquote></li></ul><ul><li>Also available shrink-wrapped at your local software retailer or
+ online at
+ <blockquote>
+ <tt>http://www.cygnus.com/cygwin/index.html</tt>
+ </blockquote></li></ul><ul><li>Programs compiled using Cygwin require a special
+ DLL (<b>cygwin1.dll</b>) that provides a POSIX system API</li></ul><ul><li>Cygwin1.dll cannot be shipped with proprietary programs
+ without purchasing a license from Cygnus.</li></ul><ul><li>Mingw32 is the same compiler as Cygwin, but generates
+ binaries that do not use cygwin1.dll</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Where Does <tt>-ltcl82</tt> Come From On Windows?</h2>
+<p><p>Build it like this:</p></p><p>
+<p><ul><li>Get <b>tcl82.lib</b> and <b>tcl82.dll</b> from Scriptics.</li></ul><ul><li><tt>echo EXPORTS >tcl82.def</tt></li></ul><ul><li><tt>nm tcl82.lib | grep 'T _' | sed 's/.* T _//' >>tcl82.def</tt></li></ul><ul><li><tt>dlltool --def tcl82.def --dllname tcl82.dll --output-lib libtcl82.a</tt></li></ul><ul><li>Move <b>libtcl82.a</b> to the lib directory and <b>tcl82.dll</b>
+ to the bin directory.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Where Does Your Code Go?</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Your&nbsp;application&nbsp;code&nbsp;goes&nbsp;here&nbsp;*/</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Insert C code here to do whatever it is your program is
+ suppose to do</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Building A Simple TCLSH</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;char&nbsp;*z;<br>
+&nbsp;&nbsp;char&nbsp;zLine[2000];<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;while(&nbsp;fgets(zLine,sizeof(zLine),stdin)&nbsp;){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Get one line of input</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zLine);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Execute the input as Tcl.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;=&nbsp;Tcl_GetStringResult(interp);<br>
+&nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;z[0]&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("PX\n",&nbsp;z);<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Print result if not empty</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>What if user types more than 2000 characters?</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Building A Simple TCLSH</h2>
+<p>Use TCL to handle input. Allows input lines of unlimited length.</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+/*&nbsp;Tcl&nbsp;code&nbsp;to&nbsp;implement&nbsp;the<br>
+**&nbsp;input&nbsp;loop&nbsp;*/<br>
+static&nbsp;char&nbsp;zLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;"while&nbsp;{![eof&nbsp;stdin]}&nbsp;{\n"</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"&nbsp;&nbsp;set&nbsp;line&nbsp;[gets&nbsp;stdin]\n"</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Get one line of input</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"&nbsp;&nbsp;set&nbsp;result&nbsp;[eval&nbsp;$line]\n"</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Execute input as Tcl</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"&nbsp;&nbsp;if&nbsp;{$result!=\"\"}&nbsp;{puts&nbsp;$result}\n"</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Print result</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"}\n"<br>
+;<br>
+&nbsp;<br>
+<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zLoop);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Run the Tcl input loop</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>But what about commands that span multiple lines of input?</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Better Handling Of Command-Line Input</h2>
+<p>The file "input.tcl"</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>set&nbsp;line&nbsp;{}<br>
+while&nbsp;{![eof&nbsp;stdin]}&nbsp;{</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if&nbsp;{$line!=""}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;">&nbsp;"<br>
+&nbsp;&nbsp;}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;"%&nbsp;"<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;flush&nbsp;stdout</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Prompt for user input. The prompt is normally &quot;%&quot;
+ but changes to &quot;&gt;&quot; if the current line is a continuation.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;append&nbsp;line&nbsp;[gets&nbsp;stdin]<br>
+&nbsp;&nbsp;if&nbsp;{[info&nbsp;complete&nbsp;$line]}&nbsp;{</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;{[catch&nbsp;{uplevel&nbsp;#0&nbsp;$line}&nbsp;result]}&nbsp;{</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">If the command is complete, execute it.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;stderr&nbsp;"Error:&nbsp;$result"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;elseif&nbsp;{$result!=""}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;$result<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;line&nbsp;{}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;append&nbsp;line&nbsp;\n<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">If the command is incomplete, append a newline and get
+ another line of text.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Better Handling Of Command-Line Input</h2>
+<p>The file "input.c"</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;"source&nbsp;input.tcl");</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Read and execute the input loop</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>But now the program is not standalone!</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Converting Scripts Into C Strings</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;"set&nbsp;line&nbsp;{}\n"<br>
+&nbsp;&nbsp;"while&nbsp;{![eof&nbsp;stdin]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;if&nbsp;{$line!=\"\"}&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;\">&nbsp;\"\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;}&nbsp;else&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;\"%&nbsp;\"\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;}\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;flush&nbsp;stdout\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;append&nbsp;line&nbsp;[gets&nbsp;stdin]\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;if&nbsp;{[info&nbsp;complete&nbsp;$line]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;{[catch&nbsp;{uplevel&nbsp;#0&nbsp;$line}&nbsp;result]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;stderr&nbsp;\"Error:&nbsp;$result\"\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;elseif&nbsp;{$result!=\"\"}&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;$result\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;}\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;line&nbsp;{}\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;}&nbsp;else&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;append&nbsp;line&nbsp;\\n\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;}\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Compile Tcl Scripts Into C Programs</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Actual&nbsp;code&nbsp;omitted&nbsp;*/<br>
+;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Copy and paste the converted Tcl script here</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Execute the Tcl code</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Converting Scripts To Strings<br>Using SED Or TCLSH</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>sed&nbsp;-e&nbsp;'s/\\/\\\\/g'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Convert <b>\</b> into <b>\\</b></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'s/"/\\"/g'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Convert <b>"</b> into <b>\"</b></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'s/^/&nbsp;&nbsp;"/'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Add <b>"</b> to start of each line</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'s/$/\\n"/'&nbsp;input.tcl</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Add <b>\n"</b> to end of each line</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+&nbsp;<br>
+<br>
+&nbsp;<br>
+<br>
+while&nbsp;{![eof&nbsp;stdin]}&nbsp;{<br>
+&nbsp;&nbsp;set&nbsp;line&nbsp;[gets&nbsp;stdin]</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;regsub&nbsp;-all&nbsp;{\}&nbsp;$line&nbsp;{&amp;&amp;}&nbsp;line</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Convert <b>\</b> into <b>\\</b></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;regsub&nbsp;-all&nbsp;{"}&nbsp;$line&nbsp;{\"}&nbsp;line</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Convert <b>"</b> into <b>\"</b></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;puts&nbsp;"\"$line\\n\""</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Add <b>"</b> in front and <b>\n"</b> at the end</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Converting Scripts Into C Strings</h2>
+<p>You may want to save space by removing comments and extra whitespace
+ from scripts.</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;"set&nbsp;line&nbsp;{}\n"<br>
+&nbsp;&nbsp;"while&nbsp;{![eof&nbsp;stdin]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"if&nbsp;{$line!=\"\"}&nbsp;{\n"<br>
+&nbsp;&nbsp;"puts&nbsp;-nonewline&nbsp;\">&nbsp;\"\n"<br>
+&nbsp;&nbsp;"}&nbsp;else&nbsp;{\n"<br>
+&nbsp;&nbsp;"puts&nbsp;-nonewline&nbsp;\"%&nbsp;\"\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+&nbsp;&nbsp;"flush&nbsp;stdout\n"<br>
+&nbsp;&nbsp;"append&nbsp;line&nbsp;[gets&nbsp;stdin]\n"<br>
+&nbsp;&nbsp;"if&nbsp;{[info&nbsp;complete&nbsp;$line]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"if&nbsp;{[catch&nbsp;{uplevel&nbsp;#0&nbsp;$line}&nbsp;result]}&nbsp;{\n"<br>
+&nbsp;&nbsp;"puts&nbsp;stderr&nbsp;\"Error:&nbsp;$result\"\n"<br>
+&nbsp;&nbsp;"}&nbsp;elseif&nbsp;{$result!=\"\"}&nbsp;{\n"<br>
+&nbsp;&nbsp;"puts&nbsp;$result\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+&nbsp;&nbsp;"set&nbsp;line&nbsp;{}\n"<br>
+&nbsp;&nbsp;"}&nbsp;else&nbsp;{\n"<br>
+&nbsp;&nbsp;"append&nbsp;line&nbsp;\\n\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Converting Scripts To Strings</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>sed&nbsp;-e&nbsp;'s/\\/\\\\/g'&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;-e&nbsp;'s/"/\\"/g'&nbsp;\&nbsp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'/^&nbsp;*#/d'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Delete lines that begin with #</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'/^&nbsp;*$/d'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Delete blank lines</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'s/^&nbsp;*/&nbsp;&nbsp;"/'&nbsp;\&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Delete leading spaces</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;-e&nbsp;'s/$/\\n"/'&nbsp;input.tcl<br>
+&nbsp;<br>
+<br>
+&nbsp;<br>
+<br>
+&nbsp;<br>
+while&nbsp;{![eof&nbsp;stdin]}&nbsp;{<br>
+&nbsp;&nbsp;set&nbsp;line&nbsp;[gets&nbsp;stdin]</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;set&nbsp;line&nbsp;[string&nbsp;trimleft&nbsp;$line]</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Remove leading space</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if&nbsp;{$line==""}&nbsp;continue</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Delete blank lines</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if&nbsp;{[string&nbsp;index&nbsp;$line&nbsp;0]=="#"}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;continue<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Delete lines starting with #</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;regsub&nbsp;-all&nbsp;{\}&nbsp;$line&nbsp;{&amp;&amp;}&nbsp;line<br>
+&nbsp;&nbsp;regsub&nbsp;-all&nbsp;{"}&nbsp;$line&nbsp;{\"}&nbsp;line<br>
+&nbsp;&nbsp;puts&nbsp;"\"$line\\n\""<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Removing Comments Or Leading Space<br>Will Break Some Tcl Scripts!</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>image&nbsp;create&nbsp;bitmap&nbsp;smiley&nbsp;-data&nbsp;{</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>#define&nbsp;smile_width&nbsp;15<br>
+#define&nbsp;smile_height&nbsp;15</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">These lines begin with # but are not comment</td>
+</tr>
+<tr><td valign="center">
+<small><tt>static&nbsp;unsigned&nbsp;char&nbsp;smile_bits[]&nbsp;=&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;0xc0,&nbsp;0x01,&nbsp;0x30,&nbsp;0x06,&nbsp;0x0c,&nbsp;0x18,<br>
+&nbsp;&nbsp;&nbsp;0x04,&nbsp;0x10,&nbsp;0x22,&nbsp;0x22,&nbsp;0x52,&nbsp;0x25,<br>
+&nbsp;&nbsp;&nbsp;0x01,&nbsp;0x40,&nbsp;0x01,&nbsp;0x40,&nbsp;0x01,&nbsp;0x40,<br>
+&nbsp;&nbsp;&nbsp;0x12,&nbsp;0x24,&nbsp;0xe2,&nbsp;0x23,&nbsp;0x04,&nbsp;0x10,<br>
+&nbsp;&nbsp;&nbsp;0x0c,&nbsp;0x18,&nbsp;0x30,&nbsp;0x06,&nbsp;0xc0,&nbsp;0x01};<br>
+}<br>
+&nbsp;<br>
+<br>
+&nbsp;<br>
+text&nbsp;.t<br>
+pack&nbsp;.t<br>
+.t&nbsp;insert&nbsp;end&nbsp;[string&nbsp;trim&nbsp;{</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>She&nbsp;walks&nbsp;in&nbsp;beauty,&nbsp;like&nbsp;the&nbsp;night<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Of&nbsp;cloudless&nbsp;climes&nbsp;and&nbsp;starry&nbsp;skies;<br>
+And&nbsp;all&nbsp;that's&nbsp;best&nbsp;of&nbsp;dark&nbsp;and&nbsp;bright<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Meet&nbsp;in&nbsp;her&nbsp;aspect&nbsp;and&nbsp;her&nbsp;eyes;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Indentation is deleted on lines 2
+ and 4</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}]&nbsp;<br>
+&nbsp;<br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>Problems like these are rare</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Adding A "continue" Command</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>set&nbsp;line&nbsp;{}<br>
+while&nbsp;{![eof&nbsp;stdin]}&nbsp;{<br>
+&nbsp;&nbsp;if&nbsp;{$line!=""}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;">&nbsp;"<br>
+&nbsp;&nbsp;}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;-nonewline&nbsp;"%&nbsp;"<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;flush&nbsp;stdout<br>
+&nbsp;&nbsp;append&nbsp;line&nbsp;[gets&nbsp;stdin]<br>
+&nbsp;&nbsp;if&nbsp;{[info&nbsp;complete&nbsp;$line]}&nbsp;{</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;{[lindex&nbsp;$line&nbsp;0]=="continue"}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Break out of the loop if the command
+ is "continue"</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;elseif&nbsp;{[catch&nbsp;{uplevel&nbsp;#0&nbsp;$line}&nbsp;result]}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;stderr&nbsp;"Error:&nbsp;$result"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;elseif&nbsp;{$result!=""}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts&nbsp;$result<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;line&nbsp;{}<br>
+&nbsp;&nbsp;}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;append&nbsp;line&nbsp;\n<br>
+&nbsp;&nbsp;}<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Stop For Tcl Input At Various Points<br>In A C Program</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;Input&nbsp;loop&nbsp;as&nbsp;a&nbsp;C&nbsp;string&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Application&nbsp;C&nbsp;code&nbsp;*/</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Do some computation</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Stop for some Tcl input</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;More&nbsp;application&nbsp;C&nbsp;code&nbsp;*/</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Do more computation</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Stop for more Tcl input</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Finish&nbsp;up&nbsp;the&nbsp;application&nbsp;*/</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Finish the computation</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Using Tcl For Testing</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;Input&nbsp;loop&nbsp;as&nbsp;a&nbsp;C&nbsp;string&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+#ifdef&nbsp;TESTING<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Create interpreter only if TESTING
+ is defined</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();<br>
+#endif<br>
+&nbsp;&nbsp;/*&nbsp;Application&nbsp;C&nbsp;code&nbsp;*/</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>#ifdef&nbsp;TESTING<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+#endif</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Accept command-line input only if TESTING
+ is defined</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;More&nbsp;application&nbsp;C&nbsp;code&nbsp;*/<br>
+#ifdef&nbsp;TESTING<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+#endif<br>
+&nbsp;&nbsp;/*&nbsp;Finish&nbsp;up&nbsp;the&nbsp;application&nbsp;*/<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Creating A New Tcl Command In C</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+int&nbsp;NewCmd(</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;void&nbsp;*clientData,<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp,<br>
+&nbsp;&nbsp;int&nbsp;argc,<br>
+&nbsp;&nbsp;char&nbsp;**argv</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">The Tcl command is implemented as
+ a C function with four arguments.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>){<br>
+&nbsp;&nbsp;printf("Hello,&nbsp;World!\n");</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;TCL_OK;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Returns TCL_OK or TCL_ERROR</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;code&nbsp;omitted...&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_CreateCommand(interp,&nbsp;"helloworld",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NewCmd,&nbsp;0,&nbsp;0);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Tell the interpreter which C function to call when the
+ "helloworld" Tcl command is executed</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Linkage From Tcl To C</h2>
+<p><p align="center"><img src="image4"></p></p><p><ul><li>3rd parameter of Tcl_CreateCommand() is a pointer to the C subroutine
+ that implements the command.</li></ul><ul><li>4th parameter to Tcl_CreateCommand() becomes the 1st parameter to
+ the C routine whenever the Tcl command is executed.</li></ul><ul><li>1st parameter to Tcl_CreateCommand() must be a valid Tcl interpreter.
+ The same pointer appears as the second parameter to the C routine
+ whenever the Tcl command is executed.</li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Linkage From Tcl To C</h2>
+<p><p align="center"><img src="image5"></p></p><p><ul><li>5th parameter of Tcl_CreateCommand() is a pointer to the C subroutine
+ that is called when the Tcl command is deleted.</li></ul><ul><li>4th parameter to Tcl_CreateCommand() becomes the 1st parameter to
+ the C routine.</li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">When To Use A Delete Proc</h2>
+<p>Examples of where the delete proc is used in standard Tcl/Tk:</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>button&nbsp;.b&nbsp;-text&nbsp;Hello<br>
+pack&nbsp;.b</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>rename&nbsp;.b&nbsp;{}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Deleting the <b>.b</b> command causes the button to be destroyed</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+&nbsp;<br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>image&nbsp;create&nbsp;photo&nbsp;smiley&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;-file&nbsp;smiley.gif</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>rename&nbsp;smiley&nbsp;{}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Deleting the <b>smiley</b> command destroys the image and reclaims the
+ memory used to hold the image</td>
+</tr>
+</table>
+<p><ul><li>Always use a delete proc if the clientData is a pointer to
+ malloced memory or some other resource that needs freeing</li></ul><ul><li>Delete procs are never used in the Tcl core but are used
+ extensively in Tk</li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Linkage From Tcl To C</h2>
+<p>The <tt>argc</tt> and <tt>argv</tt> parameters work just like in
+ <tt>main()</tt></p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>helloworld&nbsp;one&nbsp;{two&nbsp;three}&nbsp;four</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><tt>argc = 4<br>
+ argv[0] = "helloworld"<br>
+ argv[1] = "one"<br>
+ argv[2] = "two three"<br>
+ argv[3] = "four"<br>
+ argv[4] = NULL</tt></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">A Short-Cut</h2>
+<p>In a program with many new Tcl commands implemented in C, it becomes
+ tedious to type the same four parameters over and over again. So
+ we define a short-cut.</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#define&nbsp;TCLARGS&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;*clientData,&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Tcl_Interp&nbsp;*interp,&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;argc,&nbsp;\&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;*argv</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Define TCLARGS once in a header file</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;<br>
+&nbsp;<br>
+&nbsp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>int&nbsp;NewCmd(TCLARGS){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Use the TCLARGS macro to define new C functions
+ that implement Tcl commands.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;/*&nbsp;implementation...&nbsp;*/<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>For brevity, we will use the TCLARGS macro during the
+ rest of this talk.</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Returning A Value From C Back To Tcl</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>int&nbsp;NewCmd(TCLARGS){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Note that the C function returns an "int"</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;TCL_OK;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Return value is TCL_OK or TCL_ERROR</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><ul><li>TCL_OK and TCL_ERROR are defined in &lt;tcl.h&gt;</li></ul><ul><li>Other valid return values TCL_RETURN, TCL_BREAK and TCL_CONTINUE
+ are rarely used</li></ul><ul><li>Common mistake: forgetting to return TCL_OK</li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Returning A Value From C Back To Tcl</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>int&nbsp;NewCmd(TCLARGS){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_SetResult(interp,"Hello!",TCL_STATIC);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Set the result to "Hello!"</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><ul><li>Result should be the text of an error message if you
+ return TCL_ERROR.</li></ul><ul><li>3rd argument to Tcl_SetResult() can be TCL_STATIC,
+ TCL_DYNAMIC, TCL_VOLATILE, or a function pointer.</li></ul><ul><li>Also consider using Tcl_AppendResult().</li></ul><ul><li>Direct access to <tt>interp->result</tt> is deprecated.</li></ul><ul><li>See the man pages for details.</li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The Tcl_Obj Interface</h2>
+<p><ul><li>A new way to write Tcl commands in C code</li></ul><ul><li>First introduced in Tcl8.0</li></ul><ul><li>Can be much faster, especially for lists or numeric values.</li></ul><ul><li>Able to handle arbitrary binary data.</li></ul><ul><li>More difficult to program.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">The Tcl_Obj Interface</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>int&nbsp;NewObjCmd(<br>
+&nbsp;&nbsp;void&nbsp;*clientData,<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp,<br>
+&nbsp;&nbsp;int&nbsp;objc,</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Obj&nbsp;*const*&nbsp;objv</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">4th parameter is an array Tcl_Objs, not an array of strings</td>
+</tr>
+<tr><td valign="center">
+<small><tt>){<br>
+&nbsp;&nbsp;/*&nbsp;Implementation...&nbsp;*/<br>
+&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}<br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;code&nbsp;omitted...&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_CreateObjCommand(interp,&nbsp;"newcmd",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NewObjCmd,&nbsp;0,&nbsp;0);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Use a different function to register the command</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The Tcl_Obj Interface</h2>
+<p><ul><li>There are countless access methods for reading information from and
+ placing information in Tcl_Objs. Always use the access methods.</li></ul><ul><li>Details provided at Lee Bernhard's talk this afternoon.</li></ul><ul><li>Definitely use Tcl_Objs if you are writing a new Tcl extension.</li></ul><ul><li>Tcl_Objs address some of the weaknesses of Tcl relative to C/C++.
+ <ul>
+ <li> Tcl_Objs are faster </li>
+ <li> Tcl_Objs work with binary data </li>
+ </ul>
+ But C/C++ is faster still and better for working with binary data.</li></ul><ul><li>When mixing C/C++ with Tcl/Tk the benefits of Tcl_Objs are
+ less important. Using Tcl_Objs in this context may not be
+ worth the extra trouble.</li></ul><ul><li>This talk will focus on the string interface.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Nickel Tour Of The Tcl API</h2>
+<p><p><b>Memory allocation functions</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Alloc<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Free<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Realloc<br>
+</tt></small></td>
+</table></center><p><b>Functions useful in the implementation of new Tcl commands</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_AppendElement<br>
+ Tcl_AppendResult<br>
+ Tcl_GetBoolean<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_GetDouble<br>
+ Tcl_GetInt<br>
+ Tcl_GetStringResult<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_ResetResult<br>
+ Tcl_SetResult<br>
+</tt></small></td>
+</table></center><p><b>Functions for controlling the Tcl interpreter</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_CreateCommand<br>
+ Tcl_CreateInterp<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_CreateObjCommand<br>
+ Tcl_DeleteCommand<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_DeleteInterp<br>
+ Tcl_Exit<br>
+</tt></small></td>
+</table></center></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Nickel Tour Of The Tcl API</h2>
+<p><p><b>I/O functions</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Close<br>
+ Tcl_Eof<br>
+ Tcl_Flush<br>
+ Tcl_GetChannel<br>
+ Tcl_GetChannelMode<br>
+ Tcl_GetChannelName<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Gets<br>
+ Tcl_OpenCommandChannel<br>
+ Tcl_OpenFileChannel<br>
+ Tcl_OpenTcpClient<br>
+ Tcl_OpenTcpServer<br>
+ Tcl_Read<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Seek<br>
+ Tcl_Tell<br>
+ Tcl_Ungets<br>
+ Tcl_Write<br>
+ Tcl_WriteChars<br>
+</tt></small></td>
+</table></center><p><b>Names and meanings of system error codes</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_ErrnoId<br>
+ Tcl_ErrnoMsg<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_GetErrno<br>
+ Tcl_SetErrno<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_SignalId<br>
+ Tcl_SignalMsg<br>
+</tt></small></td>
+</table></center></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Nickel Tour Of The Tcl API</h2>
+<p><p><b>General Operating System Calls</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Access<br>
+ Tcl_Chdir<br>
+ Tcl_GetCwd<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_GetHostName<br>
+ Tcl_GetNameOfExecutable<br>
+ Tcl_Sleep<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Stat<br>
+</tt></small></td>
+</table></center><p><b>String Manipulation And Comparison</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Concat<br>
+ Tcl_Merge<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_SplitList<br>
+ Tcl_StringCaseMatch<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_StringMatch<br>
+</tt></small></td>
+</table></center><p><b>Dynamically Resizable Strings</b></p>
+<center><table width="90%"><tr>
+<td width="49%" valign="top"><small><tt>
+ Tcl_DStringAppend<br>
+ Tcl_DStringAppendElement<br>
+ Tcl_DStringEndSublist<br>
+ Tcl_DStringInit<br>
+ Tcl_DStringLength<br>
+</tt></small></td>
+<td width="49%" valign="top"><small><tt>
+ Tcl_DStringResult<br>
+ Tcl_DStringSetLength<br>
+ Tcl_DStringStartSublist<br>
+ Tcl_DStringValue<br>
+</tt></small></td>
+</table></center></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Nickel Tour Of The Tcl API</h2>
+<p><p><b>Event Handlers</b></p>
+<center><table width="90%"><tr>
+<td width="49%" valign="top"><small><tt>
+ Tcl_CancelIdleCall<br>
+ Tcl_CreateChannelHandler<br>
+ Tcl_CreateTimerHandler<br>
+ Tcl_DeleteChannelHandler<br>
+</tt></small></td>
+<td width="49%" valign="top"><small><tt>
+ Tcl_DeleteTimerHandler<br>
+ Tcl_DoOneEvent<br>
+ Tcl_DoWhenIdle<br>
+</tt></small></td>
+</table></center><p><b>Functions For Reading And Writing Tcl Variables</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_GetVar<br>
+ Tcl_GetVar2<br>
+ Tcl_LinkVar<br>
+ Tcl_SetVar<br>
+ Tcl_SetVar2<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_TraceVar<br>
+ Tcl_TraceVar2<br>
+ Tcl_UnlinkVar<br>
+ Tcl_UnsetVar<br>
+ Tcl_UnsetVar2<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_UntraceVar<br>
+ Tcl_UntraceVar2<br>
+ Tcl_UpdateLinkedVar<br>
+</tt></small></td>
+</table></center><p><b>Functions For Executing Tcl Code</b></p>
+<center><table width="90%"><tr>
+<td width="32%" valign="top"><small><tt>
+ Tcl_Eval<br>
+ Tcl_EvalFile<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_EvalObj<br>
+ Tcl_GlobalEval<br>
+</tt></small></td>
+<td width="32%" valign="top"><small><tt>
+ Tcl_GlobalEvalObj<br>
+ Tcl_VarEval<br>
+</tt></small></td>
+</table></center></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Nickel Tour Of The Tcl API</h2>
+<p><p><b>Functions For Dealing With Unicode</b></p>
+<center><table width="90%"><tr>
+<td width="49%" valign="top"><small><tt>
+ Tcl_NumUtfChars<br>
+ Tcl_UniCharAtIndex<br>
+ Tcl_UniCharIsAlnum<br>
+ Tcl_UniCharIsAlpha<br>
+ Tcl_UniCharIsControl<br>
+ Tcl_UniCharIsDigit<br>
+ Tcl_UniCharIsGraph<br>
+ Tcl_UniCharIsLower<br>
+ Tcl_UniCharIsPrint<br>
+ Tcl_UniCharIsPunct<br>
+ Tcl_UniCharIsSpace<br>
+ Tcl_UniCharIsUpper<br>
+ Tcl_UniCharIsWordChar<br>
+ Tcl_UniCharLen<br>
+ Tcl_UniCharNcmp<br>
+ Tcl_UniCharToLower<br>
+ Tcl_UniCharToTitle<br>
+</tt></small></td>
+<td width="49%" valign="top"><small><tt>
+ Tcl_UniCharToUpper<br>
+ Tcl_UniCharToUtf<br>
+ Tcl_UniCharToUtfDString<br>
+ Tcl_UtfAtIndex<br>
+ Tcl_UtfBackslash<br>
+ Tcl_UtfCharComplete<br>
+ Tcl_UtfFindFirst<br>
+ Tcl_UtfFindLast<br>
+ Tcl_UtfNcasecmp<br>
+ Tcl_UtfNcmp<br>
+ Tcl_UtfNext<br>
+ Tcl_UtfPrev<br>
+ Tcl_UtfToLower<br>
+ Tcl_UtfToTitle<br>
+ Tcl_UtfToUniChar<br>
+ Tcl_UtfToUniCharDString<br>
+ Tcl_UtfToUpper<br>
+</tt></small></td>
+</table></center>
+ <p><b>Functions For Dealing With Tcl_Objs</b></p>
+ <blockquote><i>Too numerous to list...</i></blockquote></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Documentation Of The Tcl API</h2>
+<p><ul><li>Tcl comes with excellent man pages</li></ul><ul><li>"Use the source, Luke"</li></ul><ul><li>See <tt>tclDecl.h</tt> for a list of API functions</li></ul><ul><li>The header comments on the implementation of API functions usually
+ gives a good description of what the function does and how it should
+ be used.</li></ul><ul><li>Most API functions are used within Tcl and Tk. Use grep to locate
+ examples.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Initialization Scripts</h2>
+<p><ul><li>Run the mini TCLSH implemented above and execute the <tt>parray</tt> command</li></ul><ul><li>It doesn't work! What's wrong? </p></li></li></ul><ul><li><tt>parray</tt> is really a Tcl proc that is read in when the
+ interpreter is initialized. </p></li></li></ul><ul><li><tt>parray</tt> (and several other commands) are stored in a
+ handful of &quot;Initialization Scripts&quot; </p></li></li></ul><ul><li>All the initialization scripts are stored in the
+ &quot;Tcl Library&quot; - a directory on the host
+ computer. </p></li></li></ul><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>Invoke the Tcl_Init() function to locate and read the
+ Tcl initialization scripts.</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>Tcl_Init()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;code&nbsp;omitted...&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Init(interp);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Locate and read the initialization scripts</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Call&nbsp;Tcl_CreateCommand()?&nbsp;*/<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>But Tcl_Init() can fail. We need to check its return value...</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>Tcl_Init()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+static&nbsp;char&nbsp;zInputLoop[]&nbsp;=&nbsp;<br>
+&nbsp;&nbsp;/*&nbsp;Tcl&nbsp;code&nbsp;omitted...&nbsp;*/<br>
+;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;Tcl_Init(interp)!=TCL_OK&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;fprintf(stderr,"Tcl_Init()&nbsp;failed:&nbsp;PX",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tcl_GetStringResult(interp));<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Print error message if Tcl_Init() fails</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Call&nbsp;Tcl_CreateCommand()?&nbsp;*/<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>But now the program is not standalone.</b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">How <tt>Tcl_Init()</tt> Works</h2>
+<p><ul><li>Computes the value of variable <tt>tcl_libPath</tt>.</li></ul><ul><li>Invokes the procedure named &quot;<tt>tclInit</tt>&quot;</li></ul><ul><li>A default <tt>tclInit</tt> procedure is built into Tcl.
+ You can define an alternative <tt>tclInit</tt> procedure
+ prior to calling <tt>Tcl_Init()</tt>.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">The Default <tt>initTcl</tt> Procedure</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>set&nbsp;errors&nbsp;{}<br>
+set&nbsp;dirs&nbsp;{}<br>
+if&nbsp;{[info&nbsp;exists&nbsp;tcl_library]}&nbsp;{<br>
+&nbsp;&nbsp;lappend&nbsp;dirs&nbsp;$tcl_library<br>
+}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;if&nbsp;{[info&nbsp;exists&nbsp;env(TCL_LIBRARY)]}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;lappend&nbsp;dirs&nbsp;$env(TCL_LIBRARY)<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;lappend&nbsp;dirs&nbsp;$tclDefaultLibrary<br>
+&nbsp;&nbsp;unset&nbsp;tclDefaultLibrary<br>
+&nbsp;&nbsp;set&nbsp;dirs&nbsp;[concat&nbsp;$dirs&nbsp;$tcl_libPath]<br>
+}<br>
+foreach&nbsp;i&nbsp;$dirs&nbsp;{<br>
+&nbsp;&nbsp;set&nbsp;tcl_library&nbsp;$i<br>
+&nbsp;&nbsp;set&nbsp;tclfile&nbsp;[file&nbsp;join&nbsp;$i&nbsp;init.tcl]<br>
+&nbsp;&nbsp;if&nbsp;{[file&nbsp;exists&nbsp;$tclfile]}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;{![catch&nbsp;{uplevel&nbsp;#0&nbsp;[list&nbsp;source&nbsp;$tclfile]}&nbsp;msg]}&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append&nbsp;errors&nbsp;"$tclfile:&nbsp;$msg\n$errorInfo\n"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;}<br>
+}<br>
+error&nbsp;"Can't&nbsp;find&nbsp;a&nbsp;usable&nbsp;init.tcl&nbsp;..."</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The Default Initialization Sequence</h2>
+<p><ul><li>The <tt>tclInit</tt> procedure locates and sources the <tt>init.tcl</tt>
+ script. The directory that contains <tt>init.tcl</tt> is stored in
+ the <tt>tcl_library</tt> variable.</li></ul><ul><li>The <tt>init.tcl</tt> script creates an <tt>unknown</tt> procedure.
+ The <tt>unknown</tt> procedure will run whenever Tcl encounters an
+ unknown command.</li></ul><ul><li>The <tt>unknown</tt> procedure consults the file <tt>tclIndex</tt> in the
+ <tt>tcl_library</tt> directory to see if the command is defined by one of
+ the initialization scripts.</li></ul><ul><li>The <tt>unknown</tt> procedure sources any needed initialization scripts
+ and retries the command.</li></ul><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>Commands defined in the initialization scripts are loaded
+ on demand.</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Standalone Initialization Techniques</h2>
+<p><p><b>Manually execute all initialization scripts</b></p>
+<ul><li>Convert all initialization scripts into C strings and
+ put them in the executable.</li></ul><ul><li>Call <tt>Tcl_Eval()</tt> on each initialization script and omit the
+ call to <tt>Tcl_Init()</tt></li></ul><ul><li>Or, redefine <tt>tclInit</tt> so that it does not attempt to source
+ <tt>init.tcl</tt> then call <tt>Tcl_Eval()</tt> on each initialization
+ script after <tt>Tcl_Init()</tt> returns.</li></ul><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>This approach is not recommended</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Standalone Initialization Techniques</h2>
+<p><p><b>Redefining the builtin <tt>source</tt> command</b></p>
+<ul><li>Convert all initialization scripts into C strings and
+ put them in the executable.</li></ul><ul><li>Create a new <tt>source</tt> command that
+ calls <tt>Tcl_Eval()</tt> on the appropriate built-in string
+ instead of reading from the disk.</li></ul><ul><li>Read from disk if the named file is not one that is built in.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Redefining <tt>source</tt></h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>static&nbsp;char&nbsp;zInitTcl[]&nbsp;=&nbsp;"...";<br>
+static&nbsp;char&nbsp;zParrayTcl[]&nbsp;=&nbsp;"...";</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Scripts <tt>init.tcl</tt> and <tt>parray.tcl</tt></td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+int&nbsp;NewSourceCmd(TCLARGS){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;!strcmp(argv[1],"/builtin/init.tcl")&nbsp;)<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;Tcl_Eval(interp,&nbsp;zInitTcl);<br>
+&nbsp;&nbsp;if(&nbsp;!strcmp(argv[1],"/builtin/parray.tcl")&nbsp;)<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;Tcl_Eval(interp,&nbsp;zParrayTcl);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Call <tt>Tcl_Eval()</tt> on builtin strings if the names match</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;Tcl_EvalFile(interp,&nbsp;argv[1]);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Call <tt>Tcl_EvalFile()</tt> if no match</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;setenv("TCL_LIBRARY","/builtin");</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Causes <tt>tclInit</tt> to look for <tt>init.tcl</tt> in <tt>/builtin</tt></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_CreateCommand(interp,&nbsp;"source",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NewSourceCmd,&nbsp;0,&nbsp;0);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Redefine <tt>source</tt></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Init(interp);<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Redefining <tt>source</tt></h2>
+<p><ul><li>This approach works for all versions of Tcl and Tk.</li></ul><ul><li>Also need to redefine the "<tt>file exists</tt>" Tcl command since it
+ too is used by <tt>tclInit</tt>.</li></ul><ul><li>To verify that the program is really standalone, remove the call
+ to <tt>Tcl_EvalFile()</tt>.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Standalone Initialization Techniques</h2>
+<p><p><b>Use the <tt>Tcl</tt>*<tt>InsertProc()</tt> functions</b></p>
+<ul><li>Three routines that overload basic file I/O operations:
+ <ul>
+ <li> <tt>TclStatInsertProc()</tt> </li>
+ <li> <tt>TclAccessInsertProc()</tt> </li>
+ <li> <tt>TclOpenFileChannelInsertProc()</tt> </li>
+ </ul></li></ul><ul><li>Allows us to implement a virtual filesystem that overlays the
+ real filesystem.</li></ul><ul><li>The virtual filesystem contains all the initialization scripts
+ as compiled-in strings. The initialization scripts look like
+ they are resident on disk even though they are built in.</li></ul><ul><li>These functions first appeared in Tcl8.0.3.
+ Presumably to support TclPro Wrapper.</li></ul><ul><li>The only documentation is comments on the code.
+ See the Tcl source file <tt>generic/tclIOUtil.c</tt></li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>TclStatInsertProc()</tt> Function</h2>
+<p><ul><li>Sole argument is a pointer to a function whose interface is the
+ same as <tt>stat()</tt></li></ul><ul><li>Functions are stacked. Tcl tries each <tt>stat</tt> function on the
+ list, beginning with the most recently inserted, until one succeeds.</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>TclStatInsertProc()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tclInt.h></tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Rather than <tt>&lt;tcl.h&gt;</tt>!</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+static&nbsp;int<br>
+BltinFileStat(char&nbsp;*path,struct&nbsp;stat&nbsp;*buf){<br>
+&nbsp;&nbsp;char&nbsp;*zData;<br>
+&nbsp;&nbsp;int&nbsp;nData;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;zData&nbsp;=&nbsp;FindBuiltinFile(path,&nbsp;0,&nbsp;&amp;nData);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Check if <tt>path</tt> is a builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;zData==0&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;-1;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Fail if <tt>path</tt> is not a builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;memset(buf,&nbsp;0,&nbsp;sizeof(*buf));<br>
+&nbsp;&nbsp;buf->st_mode&nbsp;=&nbsp;0400;<br>
+&nbsp;&nbsp;buf->st_size&nbsp;=&nbsp;nData;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Success if it is builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;TclStatInsertProc(BltinFileStat);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Register new <tt>stat</tt> function</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();<br>
+&nbsp;&nbsp;Tcl_Init(interp);<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>TclAccessInsertProc()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tclInt.h></tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Rather than <tt>&lt;tcl.h&gt;</tt>!</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+/*&nbsp;BltinFileStat()&nbsp;not&nbsp;shown...&nbsp;*/<br>
+&nbsp;<br>
+static&nbsp;int<br>
+BltinFileAccess(char&nbsp;*path,&nbsp;int&nbsp;mode){<br>
+&nbsp;&nbsp;char&nbsp;*zData;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;mode&nbsp;&amp;&nbsp;3&nbsp;)&nbsp;return&nbsp;-1;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">All builtins are read-only</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;zData&nbsp;=&nbsp;FindBuiltinFile(path,&nbsp;0,&nbsp;&amp;nData);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Check if <tt>path</tt> is a builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;zData==0&nbsp;)&nbsp;return&nbsp;-1;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Fail if <tt>path</tt> is not a builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;0;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Success if it is builtin</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;TclStatInsertProc(BltinFileStat);<br>
+&nbsp;&nbsp;TclAccessInsertProc(BltinFileAccess);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Register new <tt>stat</tt> and <tt>access</tt> functions</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();<br>
+&nbsp;&nbsp;Tcl_Init(interp);<br>
+&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zInputLoop);<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>TclOpenFileChannelInsertProc()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>static&nbsp;Tcl_Channel&nbsp;BuiltinFileOpen(<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp,&nbsp;&nbsp;&nbsp;/*&nbsp;The&nbsp;TCL&nbsp;interpreter&nbsp;doing&nbsp;the&nbsp;open&nbsp;*/<br>
+&nbsp;&nbsp;char&nbsp;*zFilename,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Name&nbsp;of&nbsp;the&nbsp;file&nbsp;to&nbsp;open&nbsp;*/<br>
+&nbsp;&nbsp;char&nbsp;*modeString,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Mode&nbsp;string&nbsp;for&nbsp;the&nbsp;open&nbsp;(ignored)&nbsp;*/<br>
+&nbsp;&nbsp;int&nbsp;permissions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Permissions&nbsp;for&nbsp;a&nbsp;newly&nbsp;created&nbsp;file&nbsp;(ignored)&nbsp;*/<br>
+){<br>
+&nbsp;&nbsp;char&nbsp;*zData;<br>
+&nbsp;&nbsp;BuiltinFileStruct&nbsp;*p;<br>
+&nbsp;&nbsp;int&nbsp;nData;<br>
+&nbsp;&nbsp;char&nbsp;zName[50];<br>
+&nbsp;&nbsp;Tcl_Channel&nbsp;chan;<br>
+&nbsp;&nbsp;static&nbsp;int&nbsp;count&nbsp;=&nbsp;1;<br>
+&nbsp;<br>
+&nbsp;&nbsp;zData&nbsp;=&nbsp;FindBuiltinFile(zFilename,&nbsp;1,&nbsp;&amp;nData);<br>
+&nbsp;&nbsp;if(&nbsp;zData==0&nbsp;)&nbsp;return&nbsp;NULL;<br>
+&nbsp;&nbsp;p&nbsp;=&nbsp;(BuiltinFileStruct*)Tcl_Alloc(&nbsp;sizeof(BuiltinFileStruct)&nbsp;);<br>
+&nbsp;&nbsp;if(&nbsp;p==0&nbsp;)&nbsp;return&nbsp;NULL;<br>
+&nbsp;&nbsp;p->zData&nbsp;=&nbsp;zData;<br>
+&nbsp;&nbsp;p->nData&nbsp;=&nbsp;nData;<br>
+&nbsp;&nbsp;p->cursor&nbsp;=&nbsp;0;<br>
+&nbsp;&nbsp;sprintf(zName,"etbi_bffffc7c_8049b04",((int)BuiltinFileOpen)>>12,count++);<br>
+&nbsp;&nbsp;chan&nbsp;=&nbsp;Tcl_CreateChannel(&amp;builtinChannelType,&nbsp;zName,&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(ClientData)p,&nbsp;TCL_READABLE);<br>
+&nbsp;&nbsp;return&nbsp;chan;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">The <tt>TclOpenFileChannelInsertProc()</tt> Function</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>static&nbsp;Tcl_ChannelType&nbsp;builtinChannelType&nbsp;=&nbsp;{<br>
+&nbsp;&nbsp;"builtin",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Type&nbsp;name.&nbsp;*/<br>
+&nbsp;&nbsp;NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Always&nbsp;non-blocking.*/<br>
+&nbsp;&nbsp;BuiltinFileClose,&nbsp;&nbsp;&nbsp;/*&nbsp;Close&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;BuiltinFileInput,&nbsp;&nbsp;&nbsp;/*&nbsp;Input&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;BuiltinFileOutput,&nbsp;&nbsp;/*&nbsp;Output&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;BuiltinFileSeek,&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Seek&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Set&nbsp;option&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Get&nbsp;option&nbsp;proc.&nbsp;*/<br>
+&nbsp;&nbsp;BuiltinFileWatch,&nbsp;&nbsp;&nbsp;/*&nbsp;Watch&nbsp;for&nbsp;events&nbsp;on&nbsp;console.&nbsp;*/<br>
+&nbsp;&nbsp;BuiltinFileHandle,&nbsp;&nbsp;/*&nbsp;Get&nbsp;a&nbsp;handle&nbsp;from&nbsp;the&nbsp;device.&nbsp;*/<br>
+};</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p>
+ <p>For additional information see:</p>
+ <ul>
+ <li>The man page for <tt>Tcl_CreateChannel()</tt></li>
+ <li>Tk source code file <tt>generic/tkConsole.c</tt></li>
+ </ul>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Initializing Tk</h2>
+<p><ul><li>All the same initialization script issues as Tcl</li></ul><ul><li>Tk initialization scripts are in a different directory
+ than the Tcl initialization scripts - the "Tk Library"</li></ul><ul><li>Call <tt>Tk_Init()</tt> after <tt>Tcl_Init()</tt></li></ul><ul><li>Must have an event loop or Tk will not work!</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Implementing An Event Loop</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>button&nbsp;.b&nbsp;-text&nbsp;Hello&nbsp;-command&nbsp;exit<br>
+pack&nbsp;.b</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Create a Tk interface</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>bind&nbsp;.&nbsp;&lt;Destroy>&nbsp;{<br>
+&nbsp;&nbsp;if&nbsp;{![winfo&nbsp;exists&nbsp;.]}&nbsp;exit<br>
+}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Close the application when the main window
+ is destroyed</td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>while&nbsp;1&nbsp;{vwait&nbsp;forever}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">The event loop</td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using Tk</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tk.h><br>
+&nbsp;<br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>static&nbsp;char&nbsp;zHello[]&nbsp;=&nbsp;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">The application code</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"button&nbsp;.b&nbsp;"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;"-text&nbsp;{Hello,&nbsp;World}&nbsp;"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;"-command&nbsp;exit\n"<br>
+&nbsp;&nbsp;"pack&nbsp;.b\n";<br>
+&nbsp;<br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>static&nbsp;char&nbsp;zEventLoop[]&nbsp;=</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">The event loop</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;"bind&nbsp;.&nbsp;&lt;Destroy>&nbsp;{\n"<br>
+&nbsp;&nbsp;"&nbsp;&nbsp;if&nbsp;{![winfo&nbsp;exists&nbsp;.]}&nbsp;exit\n"<br>
+&nbsp;&nbsp;"}\n"<br>
+&nbsp;&nbsp;"while&nbsp;1&nbsp;{vwait&nbsp;forever}\n";<br>
+&nbsp;<br>
+<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;Tcl_Interp&nbsp;*interp;<br>
+&nbsp;&nbsp;interp&nbsp;=&nbsp;Tcl_CreateInterp();</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Init(interp);<br>
+&nbsp;&nbsp;Tk_Init(interp);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">We really should check the return values of the init functions...</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zHello);</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_Eval(interp,&nbsp;zEventLoop);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">The event loop never returns</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*NOTREACHED*/<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Compiling "Hello, World!" For Tk</h2>
+<p><p><b>Unix:</b></p>
+ <blockquote><pre>
+ $ gcc hello.c -ltk -L/usr/X11R6/lib \
+ -lX11 -ltcl -lm -ldl
+ $ ./a.out</pre></blockquote>
+
+ <p><b>Windows using Cygwin:</b></p>
+ <blockquote><pre>
+ C:> gcc hello.c -mwindows -ltk80 -ltcl80 -lm
+ C:> a.exe</pre></blockquote>
+
+ <p><b>Windows using Mingw32:</b></p>
+ <blockquote><pre>
+ C:> gcc -mno-cygwin hello.c -mwindows \
+ -ltk82 -ltcl82 -lm
+ C:> a.exe</pre></blockquote></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Making The Program Standalone</h2>
+<p><p>To make a Tcl application standalone you have to convert the following
+ initialization scripts to C strings and compile them into the
+ executable:</p>
+ <table><tr>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;auto.tcl<br>
+ &nbsp;&nbsp;history.tcl<br>
+ &nbsp;&nbsp;init.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;ldAout.tcl<br>
+ &nbsp;&nbsp;package.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;parray.tcl<br>
+ &nbsp;&nbsp;safe.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;tclIndex<br>
+ &nbsp;&nbsp;word.tcl
+ </tt></td>
+ </tr></table>
+
+ <p>To make a Tk application standalone requires these additional
+ initialization scripts from the Tk Library:</p>
+ <table><tr>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;bgerror.tcl<br>
+ &nbsp;&nbsp;button.tcl<br>
+ &nbsp;&nbsp;clrpick.tcl<br>
+ &nbsp;&nbsp;comdlg.tcl<br>
+ &nbsp;&nbsp;console.tcl<br>
+ &nbsp;&nbsp;dialog.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;entry.tcl<br>
+ &nbsp;&nbsp;focus.tcl<br>
+ &nbsp;&nbsp;listbox.tcl<br>
+ &nbsp;&nbsp;menu.tcl<br>
+ &nbsp;&nbsp;msgbox.tcl<br>
+ &nbsp;&nbsp;optMenu.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;palette.tcl<br>
+ &nbsp;&nbsp;safetk.tcl<br>
+ &nbsp;&nbsp;scale.tcl<br>
+ &nbsp;&nbsp;scrlbar.tcl<br>
+ &nbsp;&nbsp;tclIndex<br>
+ &nbsp;&nbsp;tearoff.tcl
+ </tt></td>
+ <td valign="top"><tt>
+ &nbsp;&nbsp;text.tcl<br>
+ &nbsp;&nbsp;tk.tcl<br>
+ &nbsp;&nbsp;tkfbox.tcl<br>
+ &nbsp;&nbsp;xmfbox.tcl
+ </tt></td>
+ </tr></table>
+
+ <p>Total of about 13K lines and 400K bytes of text or 9K lines and
+ 250K bytes if you strip comments and leading spaces</p></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">A Review Of The Features We Want</h2>
+<p><ol type="A">
+ <li value="1">
+ Combine C/C++ with Tcl/Tk into a single executable.</dd>
+ </li></ol>
+
+ <ol type="A">
+ <li value="2">
+ The executable should be standalone. It must not depend
+ on files not normally found on the system.
+ </li></ol>
+
+ <ol type="A">
+ <li value="3">
+ It should be difficult for end users to alter the program
+ (and introduce bugs).
+ </li></ol></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Available Programming Aids</h2>
+<p><p>Several tools are available. The chart below shows which tools
+ help achieve which objectives.</p>
+
+ <center><table border="2">
+ <tr>
+ <td></td>
+ <td colspan="3" align="center">
+ <b>Features The Tool Helps To Achieve</b></td>
+ </tr>
+ <tr>
+ <td align="center"><b>Tool Name</b></td>
+ <td align="center">Mix C and Tcl</td>
+ <td align="center">Standalone</td>
+ <td align="center">Hide Source</td>
+ </tr>
+ <tr>
+ <td>SWIG</td>
+ <td align="center"><img src="image6"></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>TclPro Wrapper</td>
+ <td>&nbsp;</td>
+ <td align="center"><img src="image6"></td>
+ <td align="center"><img src="image6"></td>
+ </tr>
+ <tr>
+ <td>FreeWrap</td>
+ <td>&nbsp;</td>
+ <td align="center"><img src="image6"></td>
+ <td align="center"><img src="image6"></td>
+ </tr>
+ <tr>
+ <td>Wrap</td>
+ <td>&nbsp;</td>
+ <td align="center"><img src="image6"></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>mktclapp</td>
+ <td align="center"><img src="image6"></td>
+ <td align="center"><img src="image6"></td>
+ <td align="center"><img src="image6"></td>
+ </tr>
+ </table></center></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">SWIG</h2>
+<table><tr><td valign="top"><img src="image7"></td>
+<td valign="top"><p><ul><li>Creates an interface between an existing C/C++ library and a high-level
+ programming language. Support for:
+ <ul>
+ <li> Tcl/Tk </li>
+ <li> Perl </li>
+ <li> Python </li>
+ <li> Java </li>
+ <li> Eiffel </li>
+ <li> Guile </li>
+ </ul></li></ul><ul><li>No changes required to C/C++ code. Can be used with legacy libraries.</li></ul><ul><li>Generates an extension, not a standalone binary</li></ul><ul><li>The tutorial on SWIG was yesterday afternoon.</li></ul><ul><li>http://www.swig.org/</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Wrapper Programs</h2>
+<table><tr><td valign="top"><img src="image8"></td>
+<td valign="top"><p><ul><li>Convert a pure Tcl/Tk program into a standalone binary</li></ul><ul><li>Several wrapper programs are available:
+ <ul>
+ <li> TclPro Wrapper - http://www.scriptics.com/ </li>
+ <li> FreeWrap - http://www.albany.net/~dlabelle/freewrap/freewrap.html </li>
+ <li> Wrap - http://members1.chello.nl/~j.nijtmans/wrap.html </li>
+ </ul></li></ul><ul><li>No C compiler required!</li></ul><ul><li>TclPro will convert Tcl script into bytecode so that it cannot be
+ easily read by the end user. FreeWrap encrypts the scripts.</li></ul><ul><li>FreeWrap uses compression on its executable.
+ Wrap uses compression on both the executable and on the bundled script files.</li></ul><ul><li>Usually include extensions like winico and/or BLT</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">mktclapp</h2>
+<table><tr><td valign="top"><img src="image9"></td>
+<td valign="top"><p><ul><li>Mix C/C++ with Tcl/Tk into a standalone binary</li></ul>
+<ul><li><tt>mktclapp</tt> generates an application initialization file
+ that contains Tcl scripts as strings and makes all necessary calls
+ to <tt>Tcl_Init</tt>, <tt>Tcl_CreateCommand</tt>,
+ <tt>Tcl</tt>*<tt>InsertProc</tt>, etc.</li></ul><ul><li>Features to make it easier to write new Tcl command in C</li></ul><ul><li><tt>xmktclapp.tcl</tt> provides a GUI interface to <tt>mktclapp</tt></li></ul><ul><li>http://www.hwaci.com/sw/mktclapp/</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using Mktclapp</h2>
+<p><ul><li>Download <tt>mktclapp.c</tt> and <tt>xmktclapp.tcl</tt> from
+ http://www.hwaci.com/sw/mktclapp/</li></ul><ul><li>Compile <tt>mktclapp</tt>:
+ <blockquote><pre>
+ cc -o mktclapp mktclapp.c
+ </pre></blockquote></li></ul><ul><li>Create "Hello, World!" as a Tcl script in file <tt>hw.tcl</tt>:
+ <blockquote><pre>
+ button .b -text {Hello, World!} -command exit
+ pack .b
+ </pre></blockquote></li></ul><ul><li>Launch xmktclapp:
+ <blockquote><pre>
+ wish xmktclapp.tcl
+ </pre></blockquote></li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using Mktclapp</h2>
+<table width="100%"><tr><td valign="top"><p><ul><li>Set "Command Line Input?" to "None"</li></ul><ul><li>Set "Standalone?" to "Yes"</li></ul><ul><li>Enter "<tt>hw.mta</tt>" for the Configuration File</li></ul><ul><li>Enter "<tt>hw.c</tt>" for the Output C File</li></ul></p></td>
+<td valign="top" align="right"><img src="image10"></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using Mktclapp</h2>
+<table width="100%"><tr><td valign="top"><p><ul><li>Go to the "Tcl Scripts" page</li></ul><ul><li>Press "Insert" and add <tt>hw.tcl</tt> to the list of
+ Tcl scripts</li></ul><ul><li>Change the "Startup Script" to be <tt>hw.tcl</tt>.</li></ul><ul><li>Select File/Build and File/Exit</li></ul></p></td>
+<td valign="top" align="right"><img src="image11"></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">"Hello, World!" Using Mktclapp</h2>
+<p><ul><li>Mktclapp generates <tt>hw.c</tt>.
+ Compile it something like this:
+ <pre>
+ cc hw.c -ltk -L/usr/X11R6/lib -lX11 -ltcl -lm -ldl
+ </pre></li></ul><ul><li>Or, if using Cygwin:
+ <pre>
+ gcc hw.c -mwindows -ltk80 -ltcl80 -lm
+ </pre></li></ul><ul><li>Or, if using Mingw32:
+ <pre>
+ gcc -mno-cygwin hw.c -mwindows -ltk82 -ltcl82 -lm
+ </pre></li></ul><ul><li>And you're done!</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Adding C Code To Your Program</h2>
+<p>Put the new C code in a new source file named "<tt>add.c</tt>"</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"hw.h"</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Generated by mktclapp</td>
+</tr>
+<tr><td valign="center">
+<small><tt></tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>int&nbsp;ET_COMMAND_add(ET_TCLARGS){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><tt>ET_TCLARGS</tt> is a macro defined in <tt>hw.h</tt></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;int&nbsp;a,&nbsp;b;<br>
+&nbsp;&nbsp;char&nbsp;zResult[30];<br>
+&nbsp;&nbsp;a&nbsp;=&nbsp;atoi(argv[1]);<br>
+&nbsp;&nbsp;b&nbsp;=&nbsp;atoi(argv[2]);<br>
+&nbsp;&nbsp;sprintf(zResult,&nbsp;"-1073742724",&nbsp;a+b);<br>
+&nbsp;&nbsp;Tcl_SetResult(interp,&nbsp;zResult,&nbsp;TCL_VOLATILE);<br>
+&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Adding C Code To Your Program</h2>
+<table width="100%"><tr><td valign="top"><p><ul><li>Go to the "C/C++ Modules" page of xmktclapp.tcl</li></ul>
+<ul><li>Press "Insert" and add <tt>add.c</tt> to the list of
+ C/C++ modules</p></li></ul></li></ul><ul><li>Select File/Build and File/Exit</li></ul></p></td>
+<td valign="top" align="right"><img src="image12"></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Adding C Code To Your Program</h2>
+<p><ul><li>Compile as follows:
+ <pre>
+ cc add.c hw.c -ltk -L/usr/X11R6/lib -ltcl -lm -ldl
+ </pre></li></ul><ul><li>Or construct a Makefile that compiles <tt>add.c</tt> into <tt>add.o</tt>
+ and <tt>hw.c</tt> into <tt>hw.o</tt> and then links them.</li></ul><ul><li>Compile the same way for Windows except use the usual Windows
+ libraries and options...</li></ul><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>Don't have to worry with <tt>Tcl_CreateCommand()</tt> - Mktclapp takes
+ care of that automatically.</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Checking Parameters In The <tt>add</tt> Command</h2>
+<p>Modify <tt>add.c</tt> to insure the <tt>add</tt> command
+ is called with exactly two integer arguments</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"hw.h"<br>
+&nbsp;<br>
+int&nbsp;ET_COMMAND_add(ET_TCLARGS){<br>
+&nbsp;&nbsp;int&nbsp;a,&nbsp;b;<br>
+&nbsp;&nbsp;char&nbsp;zResult[30];</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;argc!=3&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Tcl_AppendResult(interp,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"wrong&nbsp;#&nbsp;args:&nbsp;should&nbsp;be:&nbsp;\"",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;argv[0],&nbsp;"&nbsp;VALUE&nbsp;VALUE\"",&nbsp;0);<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Report an error if there are not exactly
+ 2 arguments</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;Tcl_GetInt(interp,&nbsp;argv[1],&nbsp;&amp;a)!=TCL_OK&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Report an error if the first argument is
+ not an integer</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;Tcl_GetInt(interp,&nbsp;argv[2],&nbsp;&amp;b)!=TCL_OK&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Do the same for the second argument</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;sprintf(zResult,&nbsp;"-1073742724",&nbsp;a+b);<br>
+&nbsp;&nbsp;Tcl_SetResult(interp,&nbsp;zResult,&nbsp;TCL_VOLATILE);<br>
+&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Using The Tcl_Obj Interface</h2>
+<p>In the file <tt>objadd.c</tt> put this code:</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"hw.h"</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+int&nbsp;ET_OBJCOMMAND_add2(ET_OBJARGS){<br>
+&nbsp;&nbsp;int&nbsp;a,&nbsp;b;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Use "<tt>ET_OBJCOMMAND</tt>" instead of "<tt>ET_COMMAND</tt>" and
+ "<tt>ET_OBJARGS</tt>" instead of "<tt>ET_TCLARGS</tt>"</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;objc!=3&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Tcl_WrongNumArgs(interp,&nbsp;1,&nbsp;objv,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"number&nbsp;number");<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">A special routine for "wrong # args" error</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;Tcl_GetIntFromObj(interp,&nbsp;objv[1],&nbsp;&amp;a)&nbsp;){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Instead of <tt>Tcl_GetInt</tt></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;if(&nbsp;Tcl_GetIntFromObj(interp,&nbsp;objv[2],&nbsp;&amp;b)&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_SetIntObj(Tcl_GetObjResult(interp),&nbsp;a+b);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Result stored as integer, not a string</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Speed Of Tcl_Obj Versus "char*" Interfaces</h2>
+<p><ul><li>Compile both <tt>add</tt> and <tt>add2</tt> into the same executable.</li></ul><ul><li>Compare their speeds:
+ <pre>
+ time {add 123456 654321} 10000
+ <font color="blue">26 microseconds per iteration</font>
+ time {add2 123456 654321} 10000
+ <font color="blue">4 microseconds per iteration</font>
+ </pre></li></ul><ul><li>The Tcl_Obj version is 650 faster!</li></ul><ul><li>Replace the addition with a "real" computation that takes
+ 10 milliseconds.</li></ul><ul><li>Now the Tcl_Obj version is only 0.2 faster!</li></ul><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>In many real-world problems, the Tcl_Obj interface has no noticeable
+ speed advantage over the string interface.</b></td></tr></table></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">More About Built-in Tcl Scripts</h2>
+<table><tr><td valign="top"><img src="image11"></td>
+<td valign="top"><p><ul><li>Comments and leading white-space are removed from the
+ script by default. Use the "Don't Strip Comments"
+ button to change this.</li></ul><ul><li>The file name must exactly match the name that is
+ used by the <tt>source</tt> command.</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Locations Of Libraries</h2>
+<table><tr><td valign="top"><img src="image13"></td>
+<td valign="top"><p><ul><li>Tells mktclapp where to look for script libraries.</li></ul><ul><li>All Tcl scripts in the indicated directories are
+ compiled into the <tt>appinit.c</tt> file.</li></ul><ul><li>Comments and extra white-space are removed.
+ There is no way to turn this off.</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Built-in Binary Data Files</h2>
+<table><tr><td valign="top"><img src="image14"></td>
+<td valign="top"><p><ul><li>Arbitrary files become part of the virtual filesystem</li></ul><ul><li>No comment or white-space removal is attempted</li></ul><ul><li>Useful for images or other binary data</li></ul></p></td></tr></table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">New Commands In Namespaces</h2>
+<p>Two underscores (__) are replaced by two colons (::) in
+ command names, thus giving the ability to define new commands
+ in a namespace</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;hw.h></tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt><br>
+int&nbsp;ET_COMMAND_adder__add(ET_TCLARGS){<br>
+&nbsp;&nbsp;int&nbsp;a,&nbsp;b;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Creates the Tcl command called "<tt>adder::add</tt>"</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;char&nbsp;*zResult[30];<br>
+&nbsp;&nbsp;if(&nbsp;argc!=3&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Tcl_AppendResult(interp,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"wrong&nbsp;#&nbsp;args:&nbsp;should&nbsp;be:&nbsp;\"",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;argv[0],&nbsp;"&nbsp;VALUE&nbsp;VALUE\"",&nbsp;0);<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;if(&nbsp;Tcl_GetInt(interp,&nbsp;argv[1],&nbsp;&amp;a)!=TCL_OK&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;if(&nbsp;Tcl_GetInt(interp,&nbsp;argv[1],&nbsp;&amp;b)!=TCL_OK&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}<br>
+&nbsp;&nbsp;sprintf(zResult,&nbsp;"-1073742724",&nbsp;a+b);<br>
+&nbsp;&nbsp;Tcl_SetResult(interp,&nbsp;zResult,&nbsp;TCL_VOLATILE);<br>
+&nbsp;&nbsp;return&nbsp;TCL_OK;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Adding Your Own <tt>main()</tt></h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;/*&nbsp;Application&nbsp;specific&nbsp;initialization&nbsp;*/</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Et_Init(argc,&nbsp;argv);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Never returns!</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*NOTREACHED*/<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><table><tr><td valign="top"><img src="image3"></td>
+<td valign="top"><b>The "Autofork" feature is disabled if you supply your own <tt>main()</tt></b></td></tr></table>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Initializing The Tcl Interpreter</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+int&nbsp;counter&nbsp;=&nbsp;0;<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){<br>
+&nbsp;&nbsp;&nbsp;Et_Init(argc,&nbsp;argv);<br>
+&nbsp;&nbsp;&nbsp;/*NOTREACHED*/<br>
+&nbsp;&nbsp;&nbsp;return&nbsp;0;<br>
+}<br>
+&nbsp;<br>
+int&nbsp;Et_AppInit(Tcl_Interp&nbsp;*interp){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;if(&nbsp;Blt_Init(Interp)&nbsp;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;TCL_ERROR;<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Example: Initialize an extension</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Tcl_LinkVar(interp,&nbsp;"counter",&nbsp;&amp;counter,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TCL_LINK_INT);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Or link a C variable to a Tcl variable</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return&nbsp;TCL_OK;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Return TCL_OK if successful</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Writing Your Own Event Loop</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>void&nbsp;Et_CustomMainLoop(Tcl_Interp&nbsp;*interp){</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Replaces the default event loop</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;return;</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Ex: Return without handling any events.</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Et_Init(argc,&nbsp;argv);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">This now returns after initializing Tcl</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*&nbsp;Application&nbsp;code&nbsp;here&nbsp;*/<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Writing Your Own Event Loop</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;&lt;tcl.h><br>
+&nbsp;<br>
+void&nbsp;Et_CustomMainLoop(Tcl_Interp&nbsp;*interp){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;for(;;){<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Tcl_DoOneEvent(TCL_ALL_EVENTS|TCL_DONT_WAIT);<br>
+&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Other&nbsp;processing...&nbsp;*/<br>
+&nbsp;&nbsp;}</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Intermix processing and event handling</td>
+</tr>
+<tr><td valign="center">
+<small><tt>}<br>
+&nbsp;<br>
+int&nbsp;main(int&nbsp;argc,&nbsp;char&nbsp;**argv){</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;Et_Init(argc,&nbsp;argv);</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Never returns</td>
+</tr>
+<tr><td valign="center">
+<small><tt>&nbsp;&nbsp;/*NOTREACHED*/<br>
+&nbsp;&nbsp;return&nbsp;0;<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Mktclapp Initialization Sequence</h2>
+<p><ul><li>Initialization starts when the <tt>Et_Init()</tt>
+ function is called either by client code or by
+ the <tt>main()</tt> that mktclapp generates</li></ul><ul><li>Create the main Tcl interpreter</li></ul><ul><li>Construct the virtual filesystem overlay by redefining
+ the <tt>source</tt> command and by using the
+ <tt>Tcl</tt>*<tt>InsertProc()</tt> functions</li></ul><ul><li>Call <tt>Et_PreInit()</tt> if the client defines it</li></ul><ul><li>Call <tt>Tcl_Init()</tt> and <tt>Tk_Init()</tt></li></ul><ul><li>Call <tt>Tcl_CreateCommand()</tt> and <tt>Tcl_CreateObjCommand()</tt>
+ for every <tt>ET_COMMAND_</tt>* and <tt>ET_OBJCOMMAND_</tt>* function
+ in the client code</li></ul><ul><li>Call <tt>Et_AppInit()</tt> if the client defines it</li></ul><ul><li>Run the main Tcl script if there is one</li></ul><ul><li>Call <tt>Et_CustomMainLoop()</tt> if defined by client code or
+ else run the built-in event loop</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Invoking Tcl From C</h2>
+<p><ul><li>Use one of the built-in evaluation functions:
+ <center><table width="80%">
+ <tr><td valign="top" width="50%"><ul>
+ <li> Tcl_Eval() </li>
+ <li> Tcl_VarEval() </li>
+ <li> Tcl_EvalFile() </li>
+ <li> Tcl_GlobalEval() </li>
+ </ul></td>
+ <td valign="top" width="50%"><ul>
+ <li> Tcl_EvalObj() </li>
+ <li> Tcl_GlobalEvalObj() </li>
+ </ul></td></tr>
+ </table></center></li></ul><ul><li>Mktclapp provides evaluation functions with variable argument
+ lists as in <tt>printf()</tt>:
+ <ul>
+ <li> Et_EvalF() </li>
+ <li> Et_GlobalEvalF() </li>
+ </ul></li></ul><ul><li>Mktclapp provides a global variable <tt>Et_Interp</tt> which is
+ a pointer to the main interpreter</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Invoking Tcl From C</h2>
+<p>Example: A C function that pops up an error message dialog box</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"appinit.h"<br>
+&nbsp;<br>
+void&nbsp;ErrMsg(char&nbsp;*zMsg){<br>
+&nbsp;&nbsp;Tcl_SetVar(Et_Interp,&nbsp;"zMsg",&nbsp;zMsg,&nbsp;TCL_GLOBAL_ONLY);<br>
+&nbsp;&nbsp;Tcl_GlobalEval(Et_Interp,&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;"tk_messageBox&nbsp;-icon&nbsp;error&nbsp;-msg&nbsp;$zMsg&nbsp;-type&nbsp;ok");<br>
+&nbsp;&nbsp;Tcl_UnsetVar(Et_Interp,&nbsp;"zMsg",&nbsp;TCL_GLOBAL_ONLY);<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Invoking Tcl From C</h2>
+<p>The same C function implemented using <tt>Et_EvalF()</tt> instead
+ of <tt>Tcl_GlobalEval()</tt></p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"appinit.h"<br>
+&nbsp;<br>
+void&nbsp;ErrMsg(char&nbsp;*zMsg){<br>
+&nbsp;&nbsp;Et_EvalF(Et_Interp,&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;"tk_messageBox&nbsp;-icon&nbsp;error&nbsp;-msg&nbsp;{PX}&nbsp;-type&nbsp;ok",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;zMsg);<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p>
+ <ul><li>
+ Suppose the function is called as follows:
+ <blockquote>
+ <tt>ErrMsg("Syntax error near \"}\"");</tt>
+ </blockquote>
+ </li></ul>
+
+ <ul><li>
+ The command that gets executed is:
+ <pre>
+ tk_messageBox -icon error -msg \
+ {Syntax error near "}"} -type ok
+ </pre>
+ </li></ul>
+
+ <ul><li>
+ But this is an ill-formed Tcl command!
+ </li></ul>
+</p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Invoking Tcl From C</h2>
+<p>Use the "<tt></tt>" format to generate a quoted string</p><p>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#include&nbsp;"appinit.h"<br>
+&nbsp;<br>
+void&nbsp;ErrMsg(char&nbsp;*zMsg){<br>
+&nbsp;&nbsp;Et_EvalF(Et_Interp,&nbsp;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;"tk_messageBox&nbsp;-icon&nbsp;error&nbsp;-msg&nbsp;\"%\"&nbsp;-type&nbsp;ok",<br>
+&nbsp;&nbsp;&nbsp;&nbsp;zMsg);<br>
+}</tt></small></td>
+<td></td><td></td><td></td><td></td>
+</tr>
+</table>
+<p><ul><li>The <tt></tt> puts a backslash before all characters that
+ are special to Tcl</li></ul><ul><li>The Tcl command becomes:
+ <pre>
+ tk_messageBox -icon error -msg \
+ "Syntax error near \"\}\"" -type ok
+ </pre></li></ul></p>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Other Functions Provided By Mktclapp</h2>
+<p><ul><li><tt>void Et_ResultF(Tcl_Interp*, ...);</tt></li></ul><ul><li><tt>char *Et_DStringAppendF(Tcl_DString*, ...);</tt></li></ul><ul><li><tt>int Et_AppendObjF(Tcl_Obj*, ...);</tt></li></ul><ul><li><tt>char *mprintf(const char *format, ...);<br>
+ char *vmprintf(const char *format, va_list);</tt></li></ul><ul><li><tt>void Et_NewBuiltinFile(char *filename, char *data, int amt);</tt></li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Operating Mktclapp From The Command Line</h2>
+<p><ul><li>Generate the <tt>appinit.h</tt> header file like this:
+ <blockquote>
+ <tt>mktclapp -header &gt;appinit.h</tt>
+ </blockquote></li></ul><ul><li>Generate the <tt>appinit.c</tt> file like this:
+ <blockquote>
+ <tt>mktclapp -f appinit.mta >appinit.c</tt>
+ </blockquote></li></ul><ul><li>The <tt>*.mta</tt> file is just a list of command-line options</li></ul><ul><li>Enter
+ <blockquote>
+ <tt>mktclapp -help</tt>
+ </blockquote>
+ to get a list of available options</li></ul><ul><li>Look at MTA files generated by xmktclapp.tcl for examples</li></ul></p>
+<br clear="both"><p><hr></p>
+<h2 align="center">Format Of An MTA File</h2>
+<table cellspacing="0" cellpadding="0" border="0">
+<tr><td valign="center">
+<small><tt>#&nbsp;Configuration&nbsp;file&nbsp;generated&nbsp;by&nbsp;xmktclapp<br>
+#&nbsp;Hand&nbsp;editing&nbsp;is&nbsp;not&nbsp;recommended<br>
+#</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Comments begin with one #</td>
+</tr>
+<tr><td valign="center">
+<small><tt>##&nbsp;Autofork&nbsp;No<br>
+##&nbsp;CFile:add.c&nbsp;1<br>
+##&nbsp;CFile:objadd.c&nbsp;1<br>
+##&nbsp;CmdLine&nbsp;Console<br>
+##&nbsp;ConfigFile&nbsp;hw.mta<br>
+##&nbsp;Data:check.gif&nbsp;1<br>
+##&nbsp;MainScript&nbsp;hw.tcl<br>
+##&nbsp;Mode&nbsp;Tcl/Tk<br>
+##&nbsp;NoSource&nbsp;No<br>
+##&nbsp;OutputFile&nbsp;hw.c<br>
+##&nbsp;Shroud&nbsp;No<br>
+##&nbsp;Standalone&nbsp;Yes<br>
+##&nbsp;TclFile:hw.tcl&nbsp;1<br>
+##&nbsp;TclLib&nbsp;/usr/lib/tcl8.0<br>
+##&nbsp;TkLib&nbsp;/usr/lib/tk8.0</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">Lines beginning with two #s are used
+ by xmktclapp.tcl and ignored by mktclapp</td>
+</tr>
+<tr><td valign="center">
+<small><tt>-console<br>
+-main-script&nbsp;"hw.tcl"<br>
+-tcl-library&nbsp;"/usr/lib/tcl8.0"<br>
+-tk-library&nbsp;"/usr/lib/tk8.0"<br>
+"add.c"<br>
+"objadd.c"<br>
+-i&nbsp;"check.gif"<br>
+-strip-tcl&nbsp;"hw.tcl"</tt></small></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center"><img src="image2"></td>
+<td>&nbsp;&nbsp;</td>
+<td valign="center">All other lines are read by mktclapp and
+ ignored by xmktclapp.tcl</td>
+</tr>
+</table>
+
+<br clear="both"><p><hr></p>
+<h2 align="center">Summary</h2>
+<p><ul><li>Use Tcl for the things Tcl is good at and use C/C++ for the things that
+ C/C++ is good at</li></ul><ul><li>Use wrapper programs to make pure Tcl programs standalone</li></ul><ul><li>Use mktclapp to combine Tcl/Tk with C/C++ into a standalone</li></ul></p>
+<br clear="both"><p><hr></p>
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image1 b/ext/tk/sample/tkextlib/tkHTML/page4/image1
new file mode 100644
index 0000000000..da26d7092e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image1
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image2 b/ext/tk/sample/tkextlib/tkHTML/page4/image2
new file mode 100644
index 0000000000..e176a96a55
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image2
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image3 b/ext/tk/sample/tkextlib/tkHTML/page4/image3
new file mode 100644
index 0000000000..e829d3712c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image3
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image4 b/ext/tk/sample/tkextlib/tkHTML/page4/image4
new file mode 100644
index 0000000000..f14ea13547
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image4
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image5 b/ext/tk/sample/tkextlib/tkHTML/page4/image5
new file mode 100644
index 0000000000..4ef6277226
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image5
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image6 b/ext/tk/sample/tkextlib/tkHTML/page4/image6
new file mode 100644
index 0000000000..1adb261b40
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image6
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image7 b/ext/tk/sample/tkextlib/tkHTML/page4/image7
new file mode 100644
index 0000000000..ba0d26ec18
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image7
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image8 b/ext/tk/sample/tkextlib/tkHTML/page4/image8
new file mode 100644
index 0000000000..8b81d58e27
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image8
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/image9 b/ext/tk/sample/tkextlib/tkHTML/page4/image9
new file mode 100644
index 0000000000..f0a352f9d0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/image9
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tkHTML/page4/index.html b/ext/tk/sample/tkextlib/tkHTML/page4/index.html
new file mode 100644
index 0000000000..c7bfde35a5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/page4/index.html
@@ -0,0 +1,768 @@
+<!DOCTYPE HTML="HTML" PUBLIC="PUBLIC" "-//W3C//DTD=""-//W3C//DTD" HTML="HTML" 4.0="4.0" Transitional//EN"="Transitional//EN"">
+<HTML>
+<HEAD>
+<TITLE>[fm] welcome to freshmeat.net</TITLE>
+<STYLE TYPE="text/css"><!-- A:link {text-decoration: none}A:visited{text-decoration:none}A:active{text-decoration:none}--></STYLE>
+</HEAD>
+<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#336699" VLINK="#336699" ALINK="#336699">
+<BR><CENTER><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD WIDTH="1"><SCRIPT LANGUAGE="JAVASCRIPT">
+<!--
+now = new Date();
+tail = now.getTime();
+document.write("<IMG SRC='http://209.207.224.246/FreshMeat/Core/pc.gif?/index.php3," + tail + "' WIDTH=1 HEIGHT=1><BR>");
+//-->
+</SCRIPT>
+<NOSCRIPT>
+<IMG SRC="image1" WIDTH="1" HEIGHT="1"><BR>
+</NOSCRIPT></TD></TR></TABLE>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD WIDTH="468"><SCRIPT LANGUAGE="JAVASCRIPT">
+<!--
+now = new Date();
+tail = now.getTime();
+AltText = "\"Please click here.\"";
+document.write("<A HREF='http://ads.freshmeat.net/cgi-bin/ad_click.pl?index,tsof0001en'>")
+document.write("<IMG SRC='http://ads.freshmeat.net/tsof0001en.gif?" + tail + "' WIDTH=468 HEIGHT=60 ALT=" + AltText + "></A><BR>");
+//-->
+</SCRIPT>
+<NOSCRIPT>
+<A HREF="http://ads.freshmeat.net/cgi-bin/ad_click.pl?index,tsof0001en"><IMG SRC="image2" WIDTH="468" HEIGHT="60" ALT="Please click here."></A><BR>
+</NOSCRIPT></TD></TR></TABLE>
+
+<TABLE CELLSPACING="0" CELLPADDING="2" BORDER="0" WIDTH="97%"><TR>
+<TD ALIGN="left" VALIGN="bottom"><A HREF="/"><IMG SRC="image3" BORDER="0" ALT="freshmeat.net" WIDTH="300" HEIGHT="65"></A></TD>
+<TD VALIGN="bottom" ALIGN="left" ROWSPAN="2"><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<FORM METHOD="get" ACTION="/search.php3">
+<SMALL>find: <INPUT TYPE="text" SIZE="15" NAME="query"></SMALL></FORM></FONT></TD>
+<TD ALIGN="right" VALIGN="bottom"><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<A HREF="http://www.linux.com"><FONT COLOR="#000000"><B><SMALL>linux.com partner</SMALL></B></FONT></A><BR>
+<TABLE CELLSPACING="0" CELLPADDING="1" BORDER="0" WIDTH="100%"><TR>
+<TD ALIGN="right"><SMALL><NOBR><FONT FACE="Lucida,Verdana,Helvetica,Arial"><B><A HREF="/">news</A> |<BR>
+<A HREF="/appindex/">appindex</A> |<BR>
+<A HREF="/editorials/">editorials</A> |</B></FONT></NOBR></SMALL></TD>
+<TD ALIGN="right"><SMALL><NOBR><FONT FACE="Lucida,Verdana,Helvetica,Arial"><B><A HREF="/lounge/">lounge</A> |<BR>
+<A HREF="/contrib.php3">contribute</A> |<BR>
+<A HREF="/feedback.php3">feedback</A> |</B></FONT></NOBR></SMALL></TD>
+<TD ALIGN="right"><SMALL><NOBR><FONT FACE="Lucida,Verdana,Helvetica,Arial"><B><A HREF="/about.php3">about</A> |<BR>
+<A HREF="/awards.php3">awards</A> |<BR>
+<A HREF="/faq.php3">FAQ</A> |</B></FONT></NOBR></SMALL></TD>
+</TR></TABLE></TD>
+</TR></TABLE>
+<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
+<TR BGCOLOR="#000000"><TD><IMG SRC="image4" WIDTH="1" HEIGHT="2" ALT=""></TD></TR></TABLE>
+<TABLE CELLSPACING="0" CELLPADDING="3" BORDER="0" WIDTH="100%" BGCOLOR="#BBDDFF">
+<TR><TD ALIGN="center" VALIGN="top">
+<BR>
+<FONT FACE="Lucida,Verdana,Helvetica,Arial">
+
+
+<SMALL><B>sort by: [ <A HREF="/news/2000/01/29/">date</A> | <A HREF="/news/list.php3?day=/2000/01/29/&orderby=name">name</A> | <A HREF="/news/list.php3?day=/2000/01/29/&orderby=urgency">urgency</A> ]</B></SMALL><BR></TD><TD>&nbsp;</TD></TR><TR><TD VALIGN="top" ALIGN="center"><FONT FACE="Lucida,Verdana,Helvetica,Arial"><TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">We should get this out of the door now</FONT></B><BR>
+<SMALL><B><A HREF="mailto:scoop@freshmeat.net">scoop</A> - January 29th 2000, 23:59 EST</B></SMALL>
+<P>Everyone else is talking about it, so we should announce it ourselves
+before you start to think it's a government hoax. <A HREF="http://server51.freshmeat.net/">Server 51</A> is our new hosting service for Open Source projects, based on Super Cool Space Alien Technology(TM). We hadn't planned to announce it quite so soon, and it's still in the alpha stage as we work day and night at integrating SCSAT with our terrestrial systems, but feel free to take a look around and see what's going on. When we're out of the testing stage and ready to make room for your project, we'll send word via your implants. Be listening.
+
+
+
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949208399.html">comments (8)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>Category: freshmeat
+</SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+ <A HREF="http://server51.freshmeat.net"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">Is Linux for Crazies?</FONT></B><BR>
+<SMALL><B><A HREF="mailto:jeff.covey@pobox.com">jeff covey</A> - January 29th 2000, 23:59 EST</B></SMALL>
+<P>Ray Woodcock writes: "In terms relevant to Linux, this freshmeat
+editorial glances at the tendency of mainstream viewpoints to dismiss
+other viewpoints as 'fringe,' the propensity of dissident movements to
+splinter into factions before they can effectively counter their
+primary adversaries, and the difficulty of creating stability without
+squelching curiosity."
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949208340.html">comments (2), 2065 words in body</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>Category: Editorial
+</SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+ &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">RabbIT 2.0.2</FONT></B><BR>
+<SMALL><B><A HREF="mailto:d94-rol@nada.kth.se">Ernimril</A> - January 29th 2000, 18:29 EST</B></SMALL>
+<DIV ALIGN="justify"><P>RabbIt is the mutating, caching webproxy which is used to speed up surfing over slow links like modems. It does this by removing advertising and background images and scaling down images to low quality JPEGs. RabbIT is written in Java and should be able to run on any platform. It does depend upon an image converter if imagescaleing is on. The recommended image converter is "convert" from the ImageMagick package.</DIV>
+<P><B>Changes:</B> Fixes have been made for a few bugs concerning keep alive and the HTTP response header, a bug with NT and cache directories, a bug concerning requests without a response body, a bug in GZIPHandler that caused it to not gzip already compressed (gzip or compress) streams, a bug in HTTPHeader regarding response phrases that are multiline, and a few bugs in ImageHandler and NCache. GZIPHandler has been built as an intermediate(*) to FilterHandler (this means that it is possible to gzip text/plain, etc., without filtering those streams) uuencoding has been added to the Coder, RabbIT now uses HTTP/1.1, HTMLParser now compiles cleanly with Jikes, and GeneralHeader has been created to allow for HTTPFooter (which is useful when sending chunked data).
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949188564.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: freely distributable</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/daemons/proxy.html"><FONT COLOR="#FFFFFF">Daemons/Proxy</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/902659138/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/902659138/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/1998/08/09/902659138.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<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>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">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: OpenSource</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/sound.html"><FONT COLOR="#FFFFFF">Console/Sound</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/935430877/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/935430877/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/935430877/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/08/23/935430877.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">mod_dtcl 0.7.3</FONT></B><BR>
+<SMALL><B><A HREF="mailto:davidw@prosa.it">David Welton</A> - January 29th 2000, 18:11 EST</B></SMALL>
+<DIV ALIGN="justify"><P>Mod_dtcl is a free/open source implementation of server-parsed Tcl under Apache. It allows you to tightly integrate HTML with Tcl, a widely-used scripting language with many years of development invested in it. There are also many external Tcl modules that you can load into mod_dtcl, to create images, access databases, etc.</DIV>
+<P><B>Changes:</B> A major overhaul of header handling and internal buffering, and the addition of the ability to handle binary data.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949187471.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/web/development.html"><FONT COLOR="#FFFFFF">Web/Development</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/917925309/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/917925309/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/917925309/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/02/01/917925309.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">CoreLinux++ 0.4.6</FONT></B><BR>
+<SMALL><B><A HREF="mailto:frankc@users.sourceforge.net">Frank V. Castellucci</A> - January 29th 2000, 18:07 EST</B></SMALL>
+<DIV ALIGN="justify"><P>CoreLinux++ is an initiative to normalize methods and conventions for OOA/OOD/C++ development for Linux, materialized in a set of Open Source C++ class libraries (libcorelinux++ and libcoreframework++) to support common patterns and exploit the C++ standards.</DIV>
+<P><B>Changes:</B> This release adds AbstractFactory and AssociativeIterator analysis, design, implementations, test code, a CVS daily tarball, a Patch Submission facility and updated FAQ, Web Pages, and defect reporting guidelines.
+<P><B>Urgency:</B> medium
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949187233.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: LGPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/development/libraries.html"><FONT COLOR="#FFFFFF">Development/Libraries</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/944077775/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/944077775/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/944077775/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/12/01/944077775.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">scribe 0.2</FONT></B><BR>
+<SMALL><B><A HREF="mailto:kahlage@logoncafe.net">ChromeBob</A> - January 29th 2000, 12:12 EST</B></SMALL>
+<DIV ALIGN="justify"><P>scribe writes functions prototypes for your C code, so you don't have to. It also compares unique functions between source code files and will 'extern' when appropriate. C++ methods support is also planned.</DIV>
+<P><B>Changes:</B> A fix for an fflush() bug and better documentation.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949165962.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/development/tools.html"><FONT COLOR="#FFFFFF">Development/Tools</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/946661656/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/946661656/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/1999/12/31/946661656.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">E theme updater 0.1</FONT></B><BR>
+<SMALL><B><A HREF="mailto:hallvar@ii.uib.no">Hallvar Helleseth</A> - January 29th 2000, 12:04 EST</B></SMALL>
+<DIV ALIGN="justify"><P>E theme Updater is a bash script to automatically update all of your Enlightenment themes from e.themes.org.</DIV>
+<P><B>Changes:</B> Initial release.
+
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949165472.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/misc.html"><FONT COLOR="#FFFFFF">Console/Misc</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/949164501/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/949164501/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/2000/01/29/949164501.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">Powertweak-Linux 0.1.7</FONT></B><BR>
+<SMALL><B><A HREF="mailto:dave@denial.force9.co.uk">Dave Jones</A> - January 29th 2000, 12:03 EST</B></SMALL>
+<DIV ALIGN="justify"><P>Powertweak-Linux is a port of the Microsoft Windows tool of the same name rewritten from the ground up. Its main function is to tune your system to its optimal performance settings. Currently, it tunes PCI chipsets and can set /proc/sys entries.</DIV>
+<P><B>Changes:</B> A major GUI overhaul, the ability to generate configuration files, extended PCI information tabs, extra information support for the Matrox G200, and numerous other bugfixes & improvements.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949165416.html">comments (2)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/system.html"><FONT COLOR="#FFFFFF">Console/System</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/930836224/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/930836224/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/930836224/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/07/01/930836224.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">Pexeso Beta</FONT></B><BR>
+<SMALL><B><A HREF="mailto:pavolkrigler@pobox.sk">Pavol Krigler</A> - January 29th 2000, 11:55 EST</B></SMALL>
+<DIV ALIGN="justify"><P>pexeso is a simple graphic card game for one or two players.</DIV>
+<P><B>Changes:</B> Initial public release.
+
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164956.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: Freeware</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/games.html"><FONT COLOR="#FFFFFF">Console/Games</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/949141436/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/949141436/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/2000/01/29/949141436.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">XZX 2.9.2</FONT></B><BR>
+<SMALL><B><A HREF="mailto:Erik.Kunze@fantasy.muc.de">E. Kunze</A> - January 29th 2000, 11:54 EST</B></SMALL>
+<DIV ALIGN="justify"><P>XZX is a portable emulator of ZX Spectrum 48K/128K/+3 (8-bit home computers made by Sir Clive Sinclair) and Pentagon/Scorpion (Spectrum clones made in Russia) for machines running UNIX and the X Window system. XZX is completely written in C and emulates Spectrum 48K, 128K, +2 and +3, Pentagon and Scorpion, Interface I with up to 8 microdrives, Multiface 128 and Multiface 3, BetaDisk 128 interface by Technology Research Ltd with 4 disk drives, +D interface by Miles Gordon Technology with 2 disk drives, Kempston mouse, Kempston joystick and built-in machine code monitor.</DIV>
+<P><B>Changes:</B> Lots of feature improvement and bug fixes. Most parts of the audio support has been rewritten for different UNICES.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164896.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: Shareware</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/x11/emulators.html"><FONT COLOR="#FFFFFF">X11/Emulators</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/936956384/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/936956384/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/936956384/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/09/10/936956384.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">DistroLib 0.4</FONT></B><BR>
+<SMALL><B><A HREF="mailto:phir@gcu-squad.org">PhiR</A> - January 29th 2000, 11:54 EST</B></SMALL>
+<DIV ALIGN="justify"><P>DistroLib is an abstraction library designed to make the development of distributed application easier. Its main target is currently compute-bound tasks based on a one server, many clients model (much like distributed.net), but it is quite generic and could be used for any client/server app. It is lightweight, easy-to-use, and relies heavily on threads.</DIV>
+<P><B>Changes:</B> Important bug fixes and command history support.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164869.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/development/libraries.html"><FONT COLOR="#FFFFFF">Development/Libraries</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/942588431/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/942588431/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/942588431/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/11/14/942588431.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">ToutDoux 1.1.7</FONT></B><BR>
+<SMALL><B><A HREF="mailto:yeupou@altern.org">yeupou</A> - January 29th 2000, 11:54 EST</B></SMALL>
+<DIV ALIGN="justify"><P>ToutDoux is a project manager which lets you design a plan of action using a tree structure, with translations in French and English.</DIV>
+<P><B>Changes:</B> A new menu and XML standard for save files.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164843.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/gnome/tools.html"><FONT COLOR="#FFFFFF">GNOME/Tools</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/944433411/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/944433411/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/1999/12/05/944433411.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">goMP 1.0.3</FONT></B><BR>
+<SMALL><B><A HREF="mailto:dioxine@poulet.org">Gautier</A> - January 29th 2000, 11:52 EST</B></SMALL>
+<DIV ALIGN="justify"><P>goMP is a set of CGI scripts that allows you to remotely control, via a Web browser, a computer acting as an MP3 jukebox. This program is very useful for someone who's got a dedicated computer with a lot of MP3 files but that doesn't have any output and input devices except network and sound card. It's main advantages are built-in cataloging, fast access to music, and no special software needed on the client side.</DIV>
+<P><B>Changes:</B> Bugfixes, a password-protected config page, basic search function, easier installation thanks to an install script, and relocation of HTML docs and CGIs to a subdirectory.
+<P><B>Urgency:</B> medium
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164772.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: Artistic</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/web/tools.html"><FONT COLOR="#FFFFFF">Web/Tools</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/948492962/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/948492962/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/948492962/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/2000/01/21/948492962.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">APSEND 1.40</FONT></B><BR>
+<SMALL><B><A HREF="mailto:sventek@gmx.net">M.K.</A> - January 29th 2000, 11:50 EST</B></SMALL>
+<DIV ALIGN="justify"><P>APSEND is a TCP/IP packet sender to test firewalls and other network applications. It also includes a syn flood option, the land DoS attack, and a DoS attack against tcpdump running on a UNIX-based system. Future updates will include support for a scripting language to construct TCP packets and a few more options and protocols like UDP and ICMP. A port of APSEND from Perl to C is planned as well.</DIV>
+<P><B>Changes:</B> The stream attack, bugfixes, and rewrites for parts of the code.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164633.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/networking.html"><FONT COLOR="#FFFFFF">Console/Networking</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/941654429/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/941654429/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/941654429/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/11/03/941654429.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">ecasound 1.6.12r10</FONT></B><BR>
+<SMALL><B><A HREF="mailto:kaiv@wakkanet.fi">Kai Vehmanen</A> - January 29th 2000, 11:48 EST</B></SMALL>
+<DIV ALIGN="justify"><P>Ecasound is a software package designed for multitrack audio processing. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling. Ecasound supports a wide range of audio inputs, outputs and effect algorithms. Ecasound has a chain-based design that allows effects to be easily combined both in series and in parallel. Oscillators and MIDI-CCs can be used for controlling effect parameters. Includes a versatile console mode interface, a Qt-based X-interface and various command-line utils suitable for batch processing.</DIV>
+<P><B>Changes:</B> Support for 24- and 32-bit audio formats and for ALSA 0.5, multichannel noisegate, a new 2nd order lowpass filter, some ia-mode commands, and various bugfixes and low-level improvements.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164529.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/sound.html"><FONT COLOR="#FFFFFF">Console/Sound</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/931819147/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/931819147/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/931819147/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/07/12/931819147.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">SCEZ 20000129</FONT></B><BR>
+<SMALL><B><A HREF="mailto:m032@mbsks.franken.de">endergone Zwiebeltuete</A> - January 29th 2000, 11:46 EST</B></SMALL>
+<DIV ALIGN="justify"><P>SCEZ is a library that should make the handling of smart cards (not memory cards) and card readers as simple as possible and be at the same time small and easily portable. Currently supported are Dumb Mouse, CT-API and Towitoko readers and Schlumberger Cryptoflex, Gemplus GPK4000, GSM SIM and Telesec SigG cards. A PKCS#15 implementation is in the design phase. There are ports to PalmOS and MS-Windows available.</DIV>
+<P><B>Changes:</B> More card and reader drivers, and an application to read out GSM SIM card (phone book and SMS) and write it to the card.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164394.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: BSD type</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/development/libraries.html"><FONT COLOR="#FFFFFF">Development/Libraries</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/939677525/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/939677525/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/1999/10/11/939677525.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">Comicq 0.2.0</FONT></B><BR>
+<SMALL><B><A HREF="mailto:terminal6@submail.net">Terminal6</A> - January 29th 2000, 11:45 EST</B></SMALL>
+<DIV ALIGN="justify"><P>COMICQ is a command line ICQ messaging tool that allows a user to connect to ICQ using your UIN and password, then sends a message to the destination UIN.</DIV>
+<P><B>Changes:</B> Several bugfixes, icq99a compliance, and a new option --ip that allows you to get any user's IP by their UIN.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164350.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/communication.html"><FONT COLOR="#FFFFFF">Console/Communication</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/948389309/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/948389309/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="/appindex/2000/01/20/948389309.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">senv 0.2</FONT></B><BR>
+<SMALL><B><A HREF="mailto:kojak@ids.pl">Zbyszek Sobiecki</A> - January 29th 2000, 11:44 EST</B></SMALL>
+<DIV ALIGN="justify"><P>Senv allows you to run programs with a specified environment. It can set uid, gid, root directory, working directory, limits, and environment variables. It is useful in init scripts and as a shell for users for setting resource limits and environment variables. You can create sets of configurations and specify the one to use from command line.</DIV>
+<P><B>Changes:</B> Login shell limits and environment setting for users, permanent resource limits for specified groups of users and environment variables, and other minor bugfixes.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949164259.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: GPL</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/console/administration.html"><FONT COLOR="#FFFFFF">Console/Administration</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/944953892/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/changelog/944953892/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/12/11/944953892.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="97%" BORDER="0" BGCOLOR="#000000"><TR><TD COLSPAN="2">
+<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B><FONT SIZE="+2">XZX 2.9.2</FONT></B><BR>
+<SMALL><B><A HREF="mailto:Erik.Kunze@fantasy.muc.de">E. Kunze</A> - January 29th 2000, 10:55 EST</B></SMALL>
+<DIV ALIGN="justify"><P>XZX is a portable emulator of ZX Spectrum 48K/128K/+3 (8-bit home computers made by Sir Clive Sinclair) and Pentagon/Scorpion (Spectrum clones made in Russia) for machines running UNIX and the X Window system. XZX is completely written in C and emulates Spectrum 48K, 128K, +2 and +3, Pentagon and Scorpion, Interface I with up to 8 microdrives, Multiface 128 and Multiface 3, BetaDisk 128 interface by Technology Research Ltd with 4 disk drives, +D interface by Miles Gordon Technology with 2 disk drives, Kempston mouse, Kempston joystick and built-in machine code monitor.</DIV>
+<P><B>Changes:</B> Lots of feature improvement and bug fixes. Most parts of the audio support has been rewritten for different UNICES.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949161354.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&nbsp;<FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#FFFFFF"><B><SMALL>License: Shareware</SMALL></B><BR>
+<B><SMALL>&nbsp;Category: <A HREF="/appindex/x11/emulators.html"><FONT COLOR="#FFFFFF">X11/Emulators</FONT></A></SMALL></B></FONT></FONT></TD><TD ALIGN="right">
+<A HREF="http://apps.freshmeat.net/download/936956384/"><IMG SRC="image6" WIDTH="21" HEIGHT="21" BORDER="0" ALT="download"></A> <A HREF="http://apps.freshmeat.net/homepage/936956384/"><IMG SRC="image5" WIDTH="21" HEIGHT="21" BORDER="0" ALT="homepage"></A> <A HREF="http://apps.freshmeat.net/changelog/936956384/"><IMG SRC="image8" WIDTH="21" HEIGHT="21" BORDER="0" ALT="changelog"></A> <A HREF="/appindex/1999/09/10/936956384.html"><IMG SRC="image7" WIDTH="21" HEIGHT="21" BORDER="0" ALT="appindex record"></A> &nbsp;
+</TD></TR></TABLE>
+<HR WIDTH="0" SIZE="0">
+
+
+<P><SMALL><CENTER><B>[ <A HREF="/news/2000/01/29/">full page for today</A> | <A HREF="/news/2000/01/28/">yesterday's edition</A> ]</SMALL></B></CENTER></FONT></TD><TD WIDTH="27%" VALIGN="top" ALIGN="center"><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">navigator</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/29/"><FONT COLOR="#000000">full page for today</FONT></A><BR>
+- <A HREF="/news/2000/01/28/"><FONT COLOR="#000000">yesterday's edition</FONT></A><BR>
+- <A HREF="news://news.freshmeat.net/"><FONT COLOR="#000000"><B>new:</B> fm news via NNTP</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">eye catcher</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<B>Free Shirts</B><BR>We give away a free freshmeat t-shirt every week for the best comment added to an application announcement or story posted on freshmeat.
+<P><B>#freshmeat</B><BR>If you want to chat about what's new on freshmeat and hang out with other fm lounge lizards and the fm staff, head over to #freshmeat on irc.freshmeat.net, part of <A HREF="http://openprojects.nu/">The Open Projects Network</A>.
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">site notes</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/29/949208399.html"><FONT COLOR="#000000">We should get this out of the door now (Jan 29th)</FONT></A><BR>
+- <A HREF="/news/2000/01/01/946704535.html"><FONT COLOR="#000000">freshmeat Y2K report (Jan 01st)</FONT></A><BR>
+- <A HREF="/news/1999/08/16/934862340.html"><FONT COLOR="#000000">Assorted freshmeat notes (Aug 16th)</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">recent editorials</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/29/949208340.html"><FONT COLOR="#000000">Is Linux for Crazies? (Jan 29th)</FONT></A><BR>
+- <A HREF="/news/2000/01/22/948603540.html"><FONT COLOR="#000000">A New Business Plan for Free Software (Jan 22nd)</FONT></A><BR>
+- <A HREF="/news/2000/01/15/947998740.html"><FONT COLOR="#000000">Is Linux Going to Reunite the UNIX Market? (Jan 15th)</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">andover.net</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+<BR><CENTER><A HREF="http://andover.net"><IMG SRC="image9" BORDER="0" WIDTH="150" HEIGHT="43" ALT="Mirror Logo"></A></CENTER><P>
+- <A HREF="http://www.animfactory.com/"><FONT COLOR="#000000">Animation Factory</FONT></A><BR>
+- <A HREF="http://www.davecentral.com/"><FONT COLOR="#000000">DaveCentral</FONT></A><BR>
+- <A HREF="http://www.freecode.com/"><FONT COLOR="#000000">FreeCode</FONT></A><BR>
+- <A HREF="http://www.InternetTrafficReport.com/"><FONT COLOR="#000000">Internet Traffic Report</FONT></A><BR>
+- <A HREF="http://www.ITManagersJournal.com/"><FONT COLOR="#000000">IT Manager's Journal</FONT></A><BR>
+- <A HREF="http://www.mediabuilder.com/"><FONT COLOR="#000000">MediaBuilder</FONT></A><BR>
+- <A HREF="http://slashdot.org/"><FONT COLOR="#000000">Slashdot</FONT></A><BR>
+- <A HREF="http://www.slaughterhouse.com/"><FONT COLOR="#000000">Slaughterhouse</FONT></A><BR>
+- <A HREF="http://www.techmailings.com/"><FONT COLOR="#000000">TechMailings</FONT></A><BR>
+- <A HREF="http://www.techsightings.com/"><FONT COLOR="#000000">TechSightings</FONT></A><BR>
+<BR><CENTER><B>E-Commerce</B></CENTER><P>
+- <A HREF="http://www.thinkgeek.com"><FONT COLOR="#000000">ThinkGeek (Stuff for smart masses)</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000">supported sites</FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://www.userfriendly.org"><FONT COLOR="#000000">Userfriendly.org</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com"><FONT COLOR="#000000">SecurityFocus</FONT></A><BR>
+- <A HREF="http://copyleft.net"><FONT COLOR="#000000">copyleft</FONT></A><BR>
+- <A HREF="http://filewatcher.org"><FONT COLOR="#000000">Filewatcher</FONT></A><BR>
+- <A HREF="http://www.linux.com"><FONT COLOR="#000000">Linux.com</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org"><FONT COLOR="#000000">LinuxTelephony</FONT></A><BR>
+- <A HREF="http://www.linuxtoday.com"><FONT COLOR="#000000">LinuxToday</FONT></A><BR>
+- <A HREF="http://openprojects.nu/services/irc.html"><FONT COLOR="#000000">Openprojects</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com"><FONT COLOR="#000000">32bitsonline</FONT></A><BR>
+- <A HREF="http://www.gnu.org"><FONT COLOR="#000000">The GNU Project</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="/news/2000/01/29/"><font color="#000000">saturday</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/29/949208399.html"><FONT COLOR="#000000">We should get this out of the door now</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949208340.html"><FONT COLOR="#000000">Is Linux for Crazies?</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949188564.html"><FONT COLOR="#000000">RabbIT 2.0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949187896.html"><FONT COLOR="#000000">nmpg 1.1.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949187471.html"><FONT COLOR="#000000">mod_dtcl 0.7.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949187233.html"><FONT COLOR="#000000">CoreLinux++ 0.4.6</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949165962.html"><FONT COLOR="#000000">scribe 0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949165472.html"><FONT COLOR="#000000">E theme updater 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949165416.html"><FONT COLOR="#000000">Powertweak-Linux 0.1.7</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164956.html"><FONT COLOR="#000000">Pexeso Beta</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164896.html"><FONT COLOR="#000000">XZX 2.9.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164869.html"><FONT COLOR="#000000">DistroLib 0.4</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164843.html"><FONT COLOR="#000000">ToutDoux 1.1.7</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164772.html"><FONT COLOR="#000000">goMP 1.0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164633.html"><FONT COLOR="#000000">APSEND 1.40</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164529.html"><FONT COLOR="#000000">ecasound 1.6.12r10</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164394.html"><FONT COLOR="#000000">SCEZ 20000129</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164350.html"><FONT COLOR="#000000">Comicq 0.2.0</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949164259.html"><FONT COLOR="#000000">senv 0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949161354.html"><FONT COLOR="#000000">XZX 2.9.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949161036.html"><FONT COLOR="#000000">log4j 0.7.5</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949156343.html"><FONT COLOR="#000000">SQN Linux 1.6</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949156277.html"><FONT COLOR="#000000">Limo 0.3.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949156237.html"><FONT COLOR="#000000">Fusion GS 1.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949145887.html"><FONT COLOR="#000000">MMR 1.5.4</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949142835.html"><FONT COLOR="#000000">KUPS 0.3.4</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949142815.html"><FONT COLOR="#000000">3DSE patch for XMMS 4</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949139763.html"><FONT COLOR="#000000">Linux 2.3.41</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949139751.html"><FONT COLOR="#000000">Free Code for Linux S/390</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135979.html"><FONT COLOR="#000000">CircleMUD 3.0 beta patchlevel 17</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135938.html"><FONT COLOR="#000000">NiL Isn't Liero 000128</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135913.html"><FONT COLOR="#000000">OpenSSH Unix Port 1.2.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135889.html"><FONT COLOR="#000000">KBoxes! 1.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135867.html"><FONT COLOR="#000000">phpLanParty 0.23</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135509.html"><FONT COLOR="#000000">DGen/SDL 1.20</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135482.html"><FONT COLOR="#000000">EdcomLib 1.0 alpha 5</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135309.html"><FONT COLOR="#000000">Etherboot 4.4.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135205.html"><FONT COLOR="#000000">BLADE 0.18.0</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135115.html"><FONT COLOR="#000000">Sapphire 0.13.7</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949135070.html"><FONT COLOR="#000000">ippl 1.99.3</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134977.html"><FONT COLOR="#000000">Saint 1.5patch1</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134943.html"><FONT COLOR="#000000">Zircon 1.18.232</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134927.html"><FONT COLOR="#000000">nmap 2.3BETA14</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134901.html"><FONT COLOR="#000000">xterm patch #124</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134817.html"><FONT COLOR="#000000">MyThreads-Links v0.5.2</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134633.html"><FONT COLOR="#000000">sudo 1.6.2p1</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134552.html"><FONT COLOR="#000000">MIT Photonic-Bands 0.10</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134246.html"><FONT COLOR="#000000">Launcher 0.86</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134179.html"><FONT COLOR="#000000">nano 0.8.1</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134103.html"><FONT COLOR="#000000">Gtk-- 1.1.8</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949134049.html"><FONT COLOR="#000000">tkchooser 0.65</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949133420.html"><FONT COLOR="#000000">XShipWars 1.33a</FONT></A><BR>
+- <A HREF="/news/2000/01/29/949133280.html"><FONT COLOR="#000000">Lamerpad 0.1</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="/news/2000/01/28/"><font color="#000000">friday</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/28/949117833.html"><FONT COLOR="#000000">fsv 0.9</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949117711.html"><FONT COLOR="#000000">popsneaker 0.1.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949114716.html"><FONT COLOR="#000000">eyep-updater.sh 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949113240.html"><FONT COLOR="#000000">W3Mail 0.5.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949113214.html"><FONT COLOR="#000000">The Urgent Decision 0.9.9</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949112269.html"><FONT COLOR="#000000">LTSP 1.02</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949112198.html"><FONT COLOR="#000000">Production BASIC 0.2.12</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949112123.html"><FONT COLOR="#000000">Postfix 19991231-pl03</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949109732.html"><FONT COLOR="#000000">Mp3 Commander 0.7</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949109324.html"><FONT COLOR="#000000">iManager 1.0.1b</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949108399.html"><FONT COLOR="#000000">Eterm 0.9</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949108308.html"><FONT COLOR="#000000">dqd_dirindex 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949108087.html"><FONT COLOR="#000000">Tidings 1.0.4</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949108026.html"><FONT COLOR="#000000">localscan 2.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949107922.html"><FONT COLOR="#000000">WMKeyboard 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949107834.html"><FONT COLOR="#000000">fcmp 1.0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949107767.html"><FONT COLOR="#000000">Akkord 0.3.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949107649.html"><FONT COLOR="#000000">HiM 0.1.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949106305.html"><FONT COLOR="#000000">cdrecord 1.8</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949103400.html"><FONT COLOR="#000000">eMixer 0.05.5</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949103187.html"><FONT COLOR="#000000">FreeVSD 1.4.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949103096.html"><FONT COLOR="#000000">Common C++ Libraries 0.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949095155.html"><FONT COLOR="#000000">Moonshine 1.0beta2</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949095112.html"><FONT COLOR="#000000">swim 0.3.5</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949095009.html"><FONT COLOR="#000000">Xmame/xmess 0.36b15.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949094448.html"><FONT COLOR="#000000">pcmcia-cs 3.1.9</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949091509.html"><FONT COLOR="#000000">gPS 0.5.2</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949091415.html"><FONT COLOR="#000000">Snort 1.5.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949090436.html"><FONT COLOR="#000000">Pygmy Linux 0.7 beta</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949090237.html"><FONT COLOR="#000000">Intro to Bash Programming HOWTO 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084379.html"><FONT COLOR="#000000">GNU Pth 1.3b2</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084356.html"><FONT COLOR="#000000">Laonux 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084304.html"><FONT COLOR="#000000">x-wvdial 0.12</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084188.html"><FONT COLOR="#000000">Intro to Bash Programming HOWTO 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084106.html"><FONT COLOR="#000000">Catalog 1.02</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949084062.html"><FONT COLOR="#000000">harvest 1.5.20-kj-0.9</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949068306.html"><FONT COLOR="#000000">wmseti 0.3.0a</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949057272.html"><FONT COLOR="#000000">RIG 1.02</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949057019.html"><FONT COLOR="#000000">FreeAddr 0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949056939.html"><FONT COLOR="#000000">GtkAda 1.2.5</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949056664.html"><FONT COLOR="#000000">dot.conf 0.6.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949055099.html"><FONT COLOR="#000000">dep.pl 1.28.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949054980.html"><FONT COLOR="#000000">Prae's Scripts 1.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949044301.html"><FONT COLOR="#000000">Project Clock 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949044285.html"><FONT COLOR="#000000">Xtheater 0.2.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949040013.html"><FONT COLOR="#000000">i-no Chart 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949039945.html"><FONT COLOR="#000000">spliff 0.8.1</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949038953.html"><FONT COLOR="#000000">Regexx 0.95</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949038316.html"><FONT COLOR="#000000">RBook 0.5.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949036742.html"><FONT COLOR="#000000">RIG 1.01</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949036714.html"><FONT COLOR="#000000">wchat 1.2.0</FONT></A><BR>
+- <A HREF="/news/2000/01/28/949036428.html"><FONT COLOR="#000000">PCCS MySQLDatabase Admin Tool 1.2.2</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="/news/2000/01/27/"><font color="#000000">thursday</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="/news/2000/01/27/949033332.html"><FONT COLOR="#000000">CADUBI 1.1b1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949032987.html"><FONT COLOR="#000000">Angus' Chess Clock 0.8.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949032555.html"><FONT COLOR="#000000">MP3 Report Generator 1.0.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949032518.html"><FONT COLOR="#000000">4DOM 0.9.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949032386.html"><FONT COLOR="#000000">4XSLT 0.8.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949031346.html"><FONT COLOR="#000000">OpenNaken 1.10</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949025747.html"><FONT COLOR="#000000">iManager 1.0b</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949025168.html"><FONT COLOR="#000000">QuakeForge 0.1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949023271.html"><FONT COLOR="#000000">pylice 0.7.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949023250.html"><FONT COLOR="#000000">Solfege 0.6.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949023151.html"><FONT COLOR="#000000">xinetd 2.1.8.7p1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949022849.html"><FONT COLOR="#000000">jac 0.13</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949022803.html"><FONT COLOR="#000000">Xmms 1.0.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949022319.html"><FONT COLOR="#000000">KSrnd 0.97</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021877.html"><FONT COLOR="#000000">getpg / UW-IMAP 0.54</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021849.html"><FONT COLOR="#000000">getpg 0.53</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021824.html"><FONT COLOR="#000000">setserial 2.17</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021250.html"><FONT COLOR="#000000">Pan 0.7.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021216.html"><FONT COLOR="#000000">jwhois 2.4.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949021126.html"><FONT COLOR="#000000">Kmp3 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949020964.html"><FONT COLOR="#000000">xPine 0.0.12</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949019905.html"><FONT COLOR="#000000">Avenger's News System 2.1 Alpha</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949019709.html"><FONT COLOR="#000000">RIG 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949019321.html"><FONT COLOR="#000000">scroller 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949018347.html"><FONT COLOR="#000000">Perl EyeP Client 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949017796.html"><FONT COLOR="#000000">sfront 0.54</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949017631.html"><FONT COLOR="#000000">XFrisk 1.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949016202.html"><FONT COLOR="#000000">Moffy 0.0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949015348.html"><FONT COLOR="#000000">Solid POP3 0.14</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949014200.html"><FONT COLOR="#000000">php3guest 1.5</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949013630.html"><FONT COLOR="#000000">crUD 01.27.2000</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949013380.html"><FONT COLOR="#000000">crUD 01.27.2000</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949012979.html"><FONT COLOR="#000000">Free Pascal Compiler 0.99.14</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949012771.html"><FONT COLOR="#000000">gtk-font-hack 0.2-gtk-1.2.6</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949009233.html"><FONT COLOR="#000000">Linux 2.2.15pre5</FONT></A><BR>
+- <A HREF="/news/2000/01/27/949005620.html"><FONT COLOR="#000000">krunseti 0.2.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948996446.html"><FONT COLOR="#000000">CompuPic 5.0.1036</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948995905.html"><FONT COLOR="#000000">gfontview 0.3.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948995819.html"><FONT COLOR="#000000">authlocal 1.0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948995600.html"><FONT COLOR="#000000">bigwig 1.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948995501.html"><FONT COLOR="#000000">CAFire 0.0.11</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948995429.html"><FONT COLOR="#000000">ANVLOGIN 2.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994944.html"><FONT COLOR="#000000">sawmill.el 1.9</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994810.html"><FONT COLOR="#000000">Perlsh 20000127</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994776.html"><FONT COLOR="#000000">sitescooper 2.1.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994691.html"><FONT COLOR="#000000">MHDns 1.4</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994419.html"><FONT COLOR="#000000">JChemPaint 0.5</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994364.html"><FONT COLOR="#000000">Filesystems HOWTO 0.7.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948994343.html"><FONT COLOR="#000000">KSnes9x 1.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948993513.html"><FONT COLOR="#000000">Mozilla M13</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948993439.html"><FONT COLOR="#000000">edna 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948993409.html"><FONT COLOR="#000000">GMasqdialer 0.99.8</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948993341.html"><FONT COLOR="#000000">spliff 0.8</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948992808.html"><FONT COLOR="#000000">MultiSeti 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970667.html"><FONT COLOR="#000000">rude 0.50</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970605.html"><FONT COLOR="#000000">cgi-util++ 0.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970479.html"><FONT COLOR="#000000">Cricket 0.72</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970458.html"><FONT COLOR="#000000">nuni 0.04</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970379.html"><FONT COLOR="#000000">Ksetiwatch 0.3.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970358.html"><FONT COLOR="#000000">SiteMgrYAP 0.1.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970322.html"><FONT COLOR="#000000">phpLanParty 0.21</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970285.html"><FONT COLOR="#000000">Glitter Newsreader 0.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970263.html"><FONT COLOR="#000000">Fastresolve 2.4</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970164.html"><FONT COLOR="#000000">ColdSync 1.1.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970080.html"><FONT COLOR="#000000">DDD 3.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948970032.html"><FONT COLOR="#000000">X Northern Captain 4.2.1</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969919.html"><FONT COLOR="#000000">abcde 1.0.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969659.html"><FONT COLOR="#000000">Gnapster 1.3.2</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969551.html"><FONT COLOR="#000000">xmix 1.0 Alpha</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969488.html"><FONT COLOR="#000000">gtktetcolor 0.3</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969412.html"><FONT COLOR="#000000">muttzilla 0.40</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969395.html"><FONT COLOR="#000000">muttzilla 0.40</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969337.html"><FONT COLOR="#000000">asp2php 0.73.6</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969217.html"><FONT COLOR="#000000">mod_ticket 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948969078.html"><FONT COLOR="#000000">MegaHAL for Eggdrop .01</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948968456.html"><FONT COLOR="#000000">Jetty 2.3.5</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948968386.html"><FONT COLOR="#000000">xlpotdb 1.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948968341.html"><FONT COLOR="#000000">Koala Complete MUD Server 0.1.1a</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948968255.html"><FONT COLOR="#000000">mcountd 0.4</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948967933.html"><FONT COLOR="#000000">cdbackup 0.5.0</FONT></A><BR>
+- <A HREF="/news/2000/01/27/948967908.html"><FONT COLOR="#000000">The Java SSH/Telnet Application/Applet 2.0 RC1</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://slashdot.org"><font color="#000000">slashdot</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/29/1534255"><FONT COLOR="#000000">Petition Apple for Linux QuickTime</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/29/1223249"><FONT COLOR="#000000">GNUstep 0.6.5 freeze</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/28/2324203"><FONT COLOR="#000000">YETI@Home</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/29/1024215"><FONT COLOR="#000000">Documents Unsealed in Microsoft/Caldera Case</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/29/0837235"><FONT COLOR="#000000">Who Bought Linux.Net?</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/24/1146250"><FONT COLOR="#000000">E-Mails from (Over?) The Edge</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/29/0834223"><FONT COLOR="#000000">Linux Kernel 2.3.41</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/28/2311232"><FONT COLOR="#000000">Congress Still Figuring Out E-Mail</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/22/1946244"><FONT COLOR="#000000">Sci Fi Literature 101?</FONT></A><BR>
+- <A HREF="http://slashdot.org/article.pl?sid=00/01/28/2318246"><FONT COLOR="#000000">Could Distributed.Net Help the Mars Polar Lander?</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://www.securityfocus.com"><font color="#000000">securityfocus</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.zdnet.com/zdnn/stories/news/0,4586,2429334,00.html?chkpt=zdnntop"><FONT COLOR="#000000">Win2000 security hole a 'major threat'</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.computerworld.com/home/print.nsf/all/000128e45a"><FONT COLOR="#000000">Visa acknowledges cracker break-ins</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.zdnet.com/sr/stories/column/0,4712,2429536,00.html"><FONT COLOR="#000000">What's Wrong With Microsoft Security?</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.zdnet.com/pcweek/stories/news/0,4153,2429334,00.html"><FONT COLOR="#000000">Microsoft posts first Win2K security patch</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=tools&id=1018"><FONT COLOR="#000000">Libnids 1.12</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.theregister.co.uk/000127-000005.html"><FONT COLOR="#000000">New hack attack is greater threat than imagined</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=news&id=http://www.mercurycenter.com/svtech/news/indepth/docs/hacker012700.htm"><FONT COLOR="#000000">Student charged with hacking</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=library&id=63"><FONT COLOR="#000000">Building and Managing Virtual Private Networks (book)</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=library&id=111"><FONT COLOR="#000000">Threats, Vulnerabilities and Real-Worl Responses: The Foundations of the TruSecure Process</FONT></A><BR>
+- <A HREF="http://www.securityfocus.com/level2/?go=library&id=1701"><FONT COLOR="#000000">The Hundredth Window : Protecting Your Privacy and Security in the Age of the Internet (boo</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://www.bebits.com"><font color="#000000">bebits</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://www.bebits.com/app/706/"><FONT COLOR="#000000">Pe 3.0a3</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/757/"><FONT COLOR="#000000">Rarscript 1.5</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/736/"><FONT COLOR="#000000">CD Manager 0.66a beta</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/174/"><FONT COLOR="#000000">TraX 1.1</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/785/"><FONT COLOR="#000000">BeMath 1.2.2</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/784/"><FONT COLOR="#000000">simple blackjack 1</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/758/"><FONT COLOR="#000000">HtmlTree 0.5.3</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/783/"><FONT COLOR="#000000">Yacp 0.1</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/222/"><FONT COLOR="#000000">TicTacToe 1.5</FONT></A><BR>
+- <A HREF="http://www.bebits.com/app/706/"><FONT COLOR="#000000">Pe 3.0a2</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://linuxtoday.com"><font color="#000000">linuxtoday</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://linuxtoday.com/story.php3?sn=15878"><FONT COLOR="#000000">Linux Journal: KDE--The Next Generation</FONT></A><BR>
+- <A HREF="http://linuxtoday.com/story.php3?sn=15876"><FONT COLOR="#000000">Kernel Cousin gimp-devel #11 Is Out</FONT></A><BR>
+- <A HREF="http://linuxtoday.com/story.php3?sn=15875"><FONT COLOR="#000000">Infoworld: Corel Linux OS ideal for the desktop</FONT></A><BR>
+- <A HREF="http://linuxtoday.com/story.php3?sn=15874"><FONT COLOR="#000000">Technology Evaluation: IBM Jumps on the Linux Bandwagon with Both Feet, Sort Of</FONT></A><BR>
+- <A HREF="http://linuxtoday.com/story.php3?sn=15873"><FONT COLOR="#000000">Tobias Hvekamp: European Union acknowledges</FONT></A><BR>
+- <A HREF=""><FONT COLOR="#000000">&</FONT></A><BR>
+- <A HREF=""><FONT COLOR="#000000">#34;Open Source Software</FONT></A><BR>
+- <A HREF=""><FONT COLOR="#000000">&</FONT></A><BR>
+- <A HREF=""><FONT COLOR="#000000">#34;</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://www.linuxtelephony.org"><font color="#000000">linuxtelephony</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=208&r=0"><FONT COLOR="#000000">Traverse Technologies releases NETspider-U in US</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=207&r=0"><FONT COLOR="#000000">Quicknet releases new GPL'd Linux Drivers!</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=206&r=0"><FONT COLOR="#000000">Natural Microsystems Delivers Carrier-Class Linux</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=205&r=0"><FONT COLOR="#000000">Quicknet is hiring programmers of all kinds!</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=204&r=0"><FONT COLOR="#000000">Babylon MLPPP Software Released under GPL</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=202&r=0"><FONT COLOR="#000000">Linux Telephony Server Project?</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=203&r=0"><FONT COLOR="#000000">Vovida Networks to Hire Telephony Software Engineers</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=200&r=0"><FONT COLOR="#000000">SPIRO-Linux Introduces Web-Enabled Phone Administration</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=199&r=0"><FONT COLOR="#000000">LinuxTelephony sponsors area at LinuxFest 2000</FONT></A><BR>
+- <A HREF="http://www.linuxtelephony.org/article.cgi?i=198&r=0"><FONT COLOR="#000000">GSM-Mobile Switching Center (MSC) with Linux-PC</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
+<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
+<TR><TD ALIGN="center" BGCOLOR="#EEEEEE"><B><FONT FACE="Lucida,Verdana,Helvetica,Arial"><FONT COLOR="#000000"><a href="http://www.32bitsonline.com"><font color="#000000">32bitsonline</font></a></FONT></FONT></B></TD></TR><TR><TD BGCOLOR="#FFFFFF"><SMALL><FONT FACE="Lucida,Verdana,Helvetica,Arial">
+- <A HREF="http://www.32bitsonline.com/article.php3?file=issues/200001/homeworld&page=1
+"><FONT COLOR="#000000">Game: Homeworld</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001271a&page=1
+"><FONT COLOR="#000000">DVD Lawsuit Spreads Its Own 'Trade Secrets'</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001272&page=1
+"><FONT COLOR="#000000">Register.com Adds 'One-step' Domain Registration</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/article.php3?file=issues/200001/webevent&page=1
+"><FONT COLOR="#000000">WebEvent: Keeping you organized</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001273a&page=1
+"><FONT COLOR="#000000">Y2K Officers Defend $100 Bil Investment</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/article.php3?file=issues/200001/jan2000_john_berger&page=1
+"><FONT COLOR="#000000">DON'T BE FOOLED</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001274&page=1
+"><FONT COLOR="#000000">Microsoft Scorns Think-Tank's Breakup Idea</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001275a&page=1
+"><FONT COLOR="#000000">Yahoo Accused Of Stalking Internet Users</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/news.php3?news=news/200001/nb200001276a&page=1
+"><FONT COLOR="#000000">eToys.com Settles Spat With Swiss Artist Group</FONT></A><BR>
+- <A HREF="http://www.32bitsonline.com/
+"><FONT COLOR="#000000">[more articles/news]</FONT></A><BR>
+&nbsp;</FONT></SMALL></TD></TR></TABLE></TD></TR></TABLE><P>
+<BR><BR></FONT>
+</TD></TR></TABLE>
+<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
+<TR BGCOLOR="#000000"><TD><IMG SRC="image4" WIDTH="1" HEIGHT="2" ALT=""></TD></TR></TABLE>
+</CENTER>
+<TABLE CELLSPACING="0" CELLPADDING="2" WIDTH="100%" BORDER="0"><TR>
+<TD VALIGN="top" ALIGN="center"><FONT FACE="Lucida,Verdana,Helvetica,Arial"><SMALL>copyright 1997-2000 <A HREF="http://andover.net">Andover.Net</A> -
+icons courtesy of <A HREF="mailto:tigert@gimp.org">tigert@gimp.org</A> -
+code revision <A HREF="http://freshmeat.net/ChangeLog">20000101</A> -
+our <A HREF="http://www.andover.net/privacy.html">privacy policy</A></SMALL></FONT></TD>
+</TR></TABLE>
+</BODY>
+</HTML>
+
+
diff --git a/ext/tk/sample/tkextlib/tkHTML/ss.rb b/ext/tk/sample/tkextlib/tkHTML/ss.rb
new file mode 100644
index 0000000000..45d4d87d69
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkHTML/ss.rb
@@ -0,0 +1,436 @@
+#!/usr/bin/env ruby
+#
+# This script implements the "ss" application. "ss" implements
+# a presentation slide-show based on HTML slides.
+#
+require 'tk'
+require 'tkextlib/tkHTML'
+
+file = ARGV[0]
+
+class TkHTML_File_Viewer
+ include TkComm
+
+# These are images to use with the actual image specified in a
+# "<img>" markup can't be found.
+#
+@@biggray = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhPAA+APAAALi4uAAAACwAAAAAPAA+AAACQISPqcvtD6OctNqLs968+w+G4kiW5omm
+ 6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNFgsAO///
+EOD
+
+@@smgray = TkPhotoImage.new(:data=><<'EOD')
+ R0lGODdhOAAYAPAAALi4uAAAACwAAAAAOAAYAAACI4SPqcvtD6OctNqLs968+w+G4kiW5omm
+ 6sq27gvH8kzX9m0VADv/
+EOD
+
+ def initialize(file = nil)
+ @root = TkRoot.new(:title=>'HTML File Viewer', :iconname=>'HV')
+ @fswin = nil
+
+ @html = nil
+ @html_fs = nil
+
+ @hotkey = {}
+
+ @applet_arg = TkVarAccess.new_hash('AppletArg')
+
+ @images = {}
+ @old_imgs = {}
+ @big_imgs = {}
+
+ @last_dir = Dir.pwd
+
+ @last_file = ''
+
+ @key_block = false
+
+ Tk::HTML_Widget::ClippingWindow.bind('1',
+ proc{|w, ksym| key_press(w, ksym)},
+ '%W Down')
+ Tk::HTML_Widget::ClippingWindow.bind('3',
+ proc{|w, ksym| key_press(w, ksym)},
+ '%W Up')
+ Tk::HTML_Widget::ClippingWindow.bind('2',
+ proc{|w, ksym| key_press(w, ksym)},
+ '%W Down')
+
+ Tk::HTML_Widget::ClippingWindow.bind('KeyPress',
+ proc{|w, ksym| key_press(w, ksym)},
+ '%W %K')
+
+ ############################################
+ #
+ # Build the half-size view of the page
+ #
+ menu_spec = [
+ [['File', 0],
+ ['Open', proc{sel_load()}, 0],
+ ['Full Screen', proc{fullscreen()}, 0],
+ ['Refresh', proc{refresh()}, 0],
+ '---',
+ ['Exit', proc{exit}, 1]]
+ ]
+
+ mbar = @root.add_menubar(menu_spec)
+
+ @html = Tk::HTML_Widget.new(:width=>512, :height=>384,
+ :padx=>5, :pady=>9,
+ :formcommand=>proc{|*args| form_cmd(*args)},
+ :imagecommand=>proc{|*args|
+ image_cmd(1, *args)
+ },
+ :scriptcommand=>proc{|*args|
+ script_cmd(*args)
+ },
+ :appletcommand=>proc{|*args|
+ applet_cmd(*args)
+ },
+ :hyperlinkcommand=>proc{|*args|
+ hyper_cmd(*args)
+ },
+ :fontcommand=>proc{|*args|
+ pick_font(*args)
+ },
+ :appletcommand=>proc{|*args|
+ run_applet('small', *args)
+ },
+ :bg=>'white', :tablerelief=>:raised)
+
+ @html.token_handler('meta', proc{|*args| meta(@html, *args)})
+
+ vscr = @html.yscrollbar(TkScrollbar.new)
+ hscr = @html.xscrollbar(TkScrollbar.new)
+
+ Tk.grid(@html, vscr, :sticky=>:news)
+ Tk.grid(hscr, :sticky=>:ew)
+ @root.grid_columnconfigure(0, :weight=>1)
+ @root.grid_columnconfigure(1, :weight=>0)
+ @root.grid_rowconfigure(0, :weight=>1)
+ @root.grid_rowconfigure(1, :weight=>0)
+
+ ############################################
+
+ @html.clipwin.focus
+
+ # If an arguent was specified, read it into the HTML widget.
+ #
+ Tk.update
+ if file && file != ""
+ load_file(file)
+ end
+ end
+
+ #
+ # A font chooser routine.
+ #
+ # html[:fontcommand] = pick_font
+ def pick_font(size, attrs)
+ # puts "FontCmd: #{size} #{attrs}"
+ [ ((attrs =~ /fixed/)? 'courier': 'charter'),
+ (12 * (1.2**(size.to_f - 4.0))).to_i,
+ ((attrs =~ /italic/)? 'italic': 'roman'),
+ ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')
+ end
+
+ # This routine is called to pick fonts for the fullscreen view.
+ #
+ def pick_font_fs(size, attrs)
+ baseFontSize = 24
+
+ # puts "FontCmd: #{size} #{attrs}"
+ [ ((attrs =~ /fixed/)? 'courier': 'charter'),
+ (baseFontSize * (1.2**(size.to_f - 4.0))).to_i,
+ ((attrs =~ /italic/)? 'italic': 'roman'),
+ ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')
+ end
+
+ #
+ #
+ def hyper_cmd(*args)
+ puts "HyperlinkCommand: #{args.inspect}"
+ end
+
+ # This routine is called to run an applet
+ #
+ def run_applet(size, w, arglist)
+ applet_arg.value = Hash[*simplelist(arglist)]
+
+ return unless @applet_arg.key?('src')
+
+ src = @html.remove(@applet_arg['src'])
+
+ @applet_arg['window'] = w
+ @applet_arg['fontsize'] = size
+
+ begin
+ Tk.load_tclscript(src)
+ rescue => e
+ puts "Applet error: #{e.message}"
+ end
+ end
+
+ #
+ #
+ def form_cmd(n, cmd, *args)
+ # p [n, cmd, *args]
+ end
+
+ #
+ #
+ def move_big_image(b)
+ return unless @big_imgs.key?(b)
+ b.copy(@big_imgs[b])
+ @big_imgs[b].delete
+ @big_imgs.delete(b)
+ end
+
+ def image_cmd(hs, *args)
+ fn = args[0]
+
+ if @old_imgs.key?(fn)
+ return (@images[fn] = @old_imgs.delete(fn))
+ end
+
+ begin
+ img = TkPhotoImage.new(:file=>fn)
+ rescue
+ return ((hs)? @@smallgray: @@biggray)
+ end
+
+ if hs
+ img2 = TkPhotoImage.new
+ img2.copy(img, :subsample=>[2,2])
+ img.delete
+ img = img2
+ end
+
+ if img.width * img.height > 20000
+ b = TkPhotoImage.new(:width=>img.width, :height=>img.height)
+ @big_imgs[b] = img
+ img = b
+ Tk.after_idle(proc{ move_big_image(b) })
+ end
+
+ @images[fn] = img
+
+ img
+ end
+
+ #
+ # This routine is called for every <SCRIPT> markup
+ #
+ def script_cmd(*args)
+ # puts "ScriptCmd: #{args.inspect}"
+ end
+
+ # This routine is called for every <APPLET> markup
+ #
+ def applet_cmd(w, arglist)
+ # puts "AppletCmd: w=#{w} arglist=#{arglist}"
+ #TkLabel.new(w, :text=>"The Applet #{w}", :bd=>2, :relief=>raised)
+ end
+
+ # This binding fires when there is a click on a hyperlink
+ #
+ def href_binding(w, x, y)
+ lst = w.href(x, y)
+ unless lst.empty?
+ process_url(lst)
+ end
+ end
+
+ #
+ #
+ def sel_load
+ filetypes = [
+ ['Html Files', ['.html', '.htm']],
+ ['All Files', '*']
+ ]
+
+ f = Tk.getOpenFile(:initialdir=>@last_dir, :filetypes=>filetypes)
+ if f != ''
+ load_file(f)
+ @last_dir = File.dirname(f)
+ end
+ end
+
+ # Clear the screen.
+ #
+ def clear_screen
+ if @html_fs && @html_fs.exist?
+ w = @html_fs
+ else
+ w = @html
+ end
+ w.clear
+ @old_imgs.clear
+ @big_imgs.clear
+ @hotkey.clear
+ @images.each{|k, v| @old_imgs[k] = v }
+ @images.clear
+ end
+
+ # Read a file
+ #
+ def read_file(name)
+ begin
+ fp = open(name, 'r')
+ ret = fp.read(File.size(name))
+ rescue
+ ret = nil
+ fp = nil
+ Tk.messageBox(:icon=>'error', :message=>"fail to open '#{name}'",
+ :type=>:ok)
+ ensure
+ fp.close if fp
+ end
+ ret
+ end
+
+ # Process the given URL
+ #
+ def process_url(url)
+ case url[0]
+ when /^file:/
+ load_file(url[0][5..-1])
+ when /^exec:/
+ Tk.ip_eval(url[0][5..-1].tr('\\', ' '))
+ else
+ load_file(url[0])
+ end
+ end
+
+ # Load a file into the HTML widget
+ #
+ def load_file(name)
+ return unless (doc = read_file(name))
+ clear_screen()
+ @last_file = name
+ if @html_fs && @html_fs.exist?
+ w = @html_fs
+ else
+ w = @html
+ end
+ w.configure(:base=>name)
+ w.parse(doc)
+ w.configure(:cursor=>'top_left_arrow')
+ @old_imgs.clear
+ end
+
+ # Refresh the current file.
+ #
+ def refresh(*args)
+ load_file(@last_file) if @last_file
+ end
+
+ # This routine is called whenever a "<meta>" markup is seen.
+ #
+ def meta(w, tag, alist)
+ v = Hash[*simplelist(alist)]
+
+ if v.key?('key') && v.key?('href')
+ @hotkey[v['key']] = w.resolve(v['href'])
+ end
+
+ if v.key?('next')
+ @hotkey['Down'] =v['next']
+ end
+
+ if v.key?('prev')
+ @hotkey['Up'] =v['prev']
+ end
+
+ if v.key?('other')
+ @hotkey['o'] =v['other']
+ end
+ end
+
+ # Go from full-screen mode back to window mode.
+ #
+ def fullscreen_off
+ @fswin.destroy
+ @root.deiconify
+ Tk.update
+ @root.raise
+ @html.clipwin.focus
+ clear_screen()
+ @old_imgs.clear
+ refresh()
+ end
+
+ # Go from window mode to full-screen mode.
+ #
+ def fullscreen
+ if @fswin && @fswin.exist?
+ @fswin.deiconify
+ Tk.update
+ @fswin.raise
+ return
+ end
+
+ width = @root.winfo_screenwidth
+ height = @root.winfo_screenheight
+ @fswin = TkToplevel.new(:overrideredirect=>true,
+ :geometry=>"#{width}x#{height}+0+0")
+
+ @html_fs = Tk::HTML_Widget.new(@fswin, :padx=>5, :pady=>9,
+ :formcommand=>proc{|*args|
+ form_cmd(*args)
+ },
+ :imagecommand=>proc{|*args|
+ image_cmd(0, *args)
+ },
+ :scriptcommand=>proc{|*args|
+ script_cmd(*args)
+ },
+ :appletcommand=>proc{|*args|
+ applet_cmd(*args)
+ },
+ :hyperlinkcommand=>proc{|*args|
+ hyper_cmd(*args)
+ },
+ :appletcommand=>proc{|*args|
+ run_applet('big', *args)
+ },
+ :fontcommand=>proc{|*args|
+ pick_font_fs(*args)
+ },
+ :bg=>'white', :tablerelief=>:raised,
+ :cursor=>:tcross) {
+ pack(:fill=>:both, :expand=>true)
+ token_handler('meta', proc{|*args| meta(self, *args)})
+ }
+
+ clear_screen()
+ @old_imgs.clear
+ refresh()
+ Tk.update
+ @html_fs.clipwin.focus
+ end
+
+ #
+ #
+ def key_press(w, keysym)
+ return if @key_block
+ @key_block = true
+ Tk.after(250, proc{@key_block = false})
+
+ if @hotkey.key?(keysym)
+ process_url(@hotkey[keysym])
+ end
+ case keysym
+ when 'Escape'
+ if @fswin && @fswin.exist?
+ fullscreen_off()
+ else
+ fullscreen()
+ end
+ end
+ end
+end
+############################################
+
+TkHTML_File_Viewer.new(file)
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tkimg/demo.rb b/ext/tk/sample/tkextlib/tkimg/demo.rb
new file mode 100644
index 0000000000..8016c263a6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkimg/demo.rb
@@ -0,0 +1,1478 @@
+#!/usr/bin/env ruby
+#
+# Tk::Img demo
+#
+# -- This script is based on demo.tcl of Tcl/Tk's 'Img' extension.
+# Image data in this script is those of demo.tcl.
+# Please read 'license_terms_of_Img_extension' file.
+#
+require 'tk'
+require 'tkextlib/tkimg'
+
+#
+# Make the Image format available.
+#
+class TkImg_demo
+ def initialize
+ img_version = Tk::Img.package_version
+
+ @typeFrame = Hash.new
+ @imgPriv = Hash.new
+
+ root = TkRoot.new(:title=>'Tests for available image formats')
+
+ root.winfo_children.each{|w| w.destroy}
+ TkImage.names{|img| img.delete}
+
+ f = TkFrame.new
+ TkButton.new(f, :text=>'Dismiss', :command=>proc{exit}).pack(:side=>:left)
+ f.pack(:side=>:top, :expand=>:y, :fill=>:both)
+
+ TkMessage.new(:aspect=>900, :text=>format('This page shows the available image formats of the Img extension (Img version %s, using Tcl/Tk %s)', img_version, Tk::TK_PATCHLEVEL)).pack(:side=>:top, :expand=>:y, :fill=>:both)
+ end
+
+##############################
+
+ def update_animated_gif(w, method, num)
+ return unless @imgPriv[w]
+
+ if @imgPriv[w][:args]
+ im = TkPhotoImage.new
+ im.copy(@imgPriv[w][num])
+ num += 1
+ begin
+ im.configure(@imgPriv[w][:args].merge(:format=>[:gif, {:index=>num}]))
+ im.configure(:data=>'', :file=>'') #free storage
+ @imgPriv[w][num] = im
+ rescue
+ @imgPriv[w].delete(:args)
+ if num > 1
+ num = 0
+ im = @imgPriv[w][num]
+ else
+ # this is not an animated GIF; just stop
+ @imgPriv[w].delete(0)
+ return
+ end
+ end
+ else
+ num += 1
+ num = 0 unless @imgPriv[w][num]
+ im = @imgPriv[w][num]
+ end
+ begin
+ w.__send__(method, im)
+ Tk.update_idletasks
+ Tk.after(20, proc{update_animated_gif(w, method, num)})
+ rescue
+ @imgPriv[w].delete(:args)
+ @imgPriv[w].each{|im|
+ @im.delete
+ @imgPriv.delete(im)
+ }
+ end
+ end
+
+ def show_animated_gif(keys)
+ w = TkLabel.new
+ begin
+ im = TkPhotoImage.new(keys.merge(:format=>[:gif, {:index=>0}]))
+ im.configure(:data=>'', :file=>'', :format=>'') #free storage
+ w.image(im)
+ @imgPriv[w] ||= Hash.new
+ @imgPriv[w][0] = im
+ @imgPriv[w][:args] = keys
+ Tk.update_idletasks
+ Tk.after(20, proc{update_animated_gif(w, :image, 0)})
+ rescue => e
+ w.configure(:text=>"error displaying animated gif:\n#{e.message}",
+ :image=>'', :relief=>:ridge)
+ end
+ w.pack
+ end
+
+ def show_image(fmt, type, data)
+ fmt = fmt.to_s.capitalize
+ unless @typeFrame[fmt]
+ @typeFrame[fmt] = TkFrame.new.pack(:side=>:top, :expand=>true, :fill=>:x)
+ TkLabel.new(@typeFrame[fmt], :text=>"#{fmt} : ").pack(:side=>:left)
+ end
+ begin
+ f = TkFrame.new(@typeFrame[fmt],
+ :borderwidth=>2, :relief=>:ridge).pack(:side=>:left)
+ im = TkPhotoImage.new(:data=>data)
+ im['data'] = ''
+ TkLabel.new(f, :image=>im).pack
+ TkLabel.new(f, :text=>type, :borderwidth=>0, :pady=>0, :padx=>2,
+ :font=>'Helvetica 8').pack
+ rescue => e
+ TkMessage.new(f, :text=>"error displaying #{type} image: #{e.message}",
+ :aspect=>250).pack
+ end
+ Tk.update
+ end
+
+end
+
+##############
+
+demo = TkImg_demo.new
+
+##############
+
+demo.show_animated_gif(:data=><<'ENDofIMG')
+R0lGODlhYgIEAIIAAQAAACQAJEkASW0AbZIAkrYAttsA2/8A/yH/C05FVFNDQVBFMi4wAwEA
+AAAh+QQABgD/ACwAAAAAYgIEAAIDuUg63CMwwiCCvQAHwLv/YCiOZGmeaKqubOu+pZXNV03d
+kuAwysLoucjNlpFtYMikcslsOp+ijbRow1EiD12jtyA4INnJZGg8HmfQtHrNb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GxMCDAoBAAEAAAABAAECCwoABwgTBxQTIAEADAoBAAEAAAABAAEC
+CwoAByIUBxMTBwsADAoBAAEAAAABAAERCgoACAshEwYTExgEDAoBAAEAAAABAAEBCgoACAkb
+ExYTExsDDAoBAAEAAAABAAEACgoACAgTFCATExMCDAoBAAEAAAABAAEACgoACBYTFAcUExMf
+CwoAAwkAAAAAAAEAAQAKCgAJBBMTCRQTEwELAAoKAAMJAAAAAAABAAEACgoACQMTEwkXExMe
+CwAKCgADCQAAAAAAAQABAAoKAAgCFxMcHRMVBwsKAAMJAAAAAAABAAEACgoABwIJExsZExMA
+DQoBAAEAAAABAAEADAoABhMTGhMTFAwKAQABAAAAAQABAAsKAAkJExMXExMTAgsACgoBAAEA
+AAABAAERCwoBBwYTAQcBCQoKAQABAAAAAQABAgsKAQcGEwAEGAILDQgKAQABAAAAAQABAgsK
+AQcHEwAEAAsQCwcKAQEBAAAAAQABBAsKAQkBFAYTAAQACwoPBwoBAgEAAAABAAEECAoADw8L
+CgsZExMTGAkBAAsLDgAHCgEEAQAAAAEAAQUICgAFDwoKCgMABBMADwkKCwoLDgsKEAsKCgoF
+AAAAAAEAAQYNCgEZBBMECgAEDgoKDAQKAQcBAAAAAQABBwkKAA4PCgoKFhcTExMYCgoKCwcK
+AQgBAAAAAQABBwgKAAwLDgsKCgsCFBMTExUKCgEJAQAAAAEAAQgHCgADDwoMAAQKAAYLARIT
+EwkLCgEAAAABAAEJBwoABA0LChAECgAFCwIAEQsACwoBAAAAAQABCQcKAAUNCwoOCwAFCgEL
+AQsMCgEAAAABAAEJBwoABg8PCgoMCxIKAQAAAAEACAoABwsMCwoNDgsAEQoBAAAAAQANCgEL
+EgoBAAAAAQAgCgECAAABACAKAQMAAAEAFgoACwkEBgcHCQkJCgoFAAAAAA0AAAABAgMEBQYH
+CAkJAAgKAQYMAAAAIgAAAQ==
+ENDofIMG
+end
+
+demo.show_image('bmp', '32-bit', <<'ENDofIMG')
+Qk2GFAAAAAAAADYAAAAoAAAAIgAAADIAAAABABgAAAAAAFAUAABtCwAAbQsAAAAAAAAAAAAA
+////ZmbMmZnMmZn/zMz/7u7u////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////AAD///8A
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wzM8wzM8wzM8wzM8wzM8wzM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///8AAP///wAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///wAA////ADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMMzPM////AAD///8AM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wzM8z///8AAP///wAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzDNmzP///wAA////ADPMADPMADPMADPMAADMADPMADPM
+ADPMAADMADPMADPMADPMAADMADPMADPMADPMZmbMADPMADPMAADMADPMADPMADPMAADMADPM
+AADMADPMADPMADPMADPMADPMZmbM////AAD///8zM8wAM8wAM8wAAMz///9mZswAM8wAM8yZ
+mf9mmcwAAMwAM8zMzP9mZswAM8wAAMyZmf8AM8wAM8zu7u5mmcwAM8wzM8z///8zM8z///8z
+M8wAM8wAM8wAM8wAM8xmZsz///8AAP///zMzzAAzzAAzzAAAzP///wAAzAAzzJmZ/zMzzAAA
+zAAzzAAzzJmZ/zMzzAAzzAAAzGZmzAAzzAAAzP///wAAzAAzzAAAzP///////wAzzAAzzAAz
+zAAzzAAzzAAzzJmZzP///wAA////MzPMADPMADPMADPM////ADPMADPMMzPMZmbM////AADM
+ADPMmZn/MzPMADPMMzPMADPMADPMADPM////ADPMADPMAADM////ZmbMADPMADPMADPMADPM
+ADPMADPMmZn/////AAD///8zZswAM8wAM8wAAMz///8AM8wAM8wAM8wAM8wAM8wAM8wAM8yZ
+mf8zM8wAM8xmmcwAAMwAM8wAAMz///8AAMwAM8wAAMz///8AM8wzM8wAM8wAM8wAM8wAM8wA
+M8yZmf////8AAP///2ZmzAAzzAAzzAAzzAAAzAAzzAAzzAAzzAAzzAAzzAAzzAAzzJnM/zMz
+zAAzzJnM/wAAzAAzzAAzzAAAzAAzzAAzzAAzzP///wAAzAAzzAAzzAAzzAAzzAAzzAAzzMzM
+/////wAA////ZmbMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM
+3d3dMzOZADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMzMz/////
+AAD///9mmcwAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wzM8yZZjPMzJmZ
+MwAAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8zu7u7///8AAP//
+/5mZzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzDMzzJlmAGYzZsyZZpkzAJmZ
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///////wAA////mZn/
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMAADMzJlmmTMAMzOZmWYzmTMAmWYzMzPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////////AAD///+Zmf8AM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wzZszMzP+ZMwAzM8yZZgCZMwCZMwCZmf8AM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///////8AAP///5mZ/wAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzJlmAGZmzJlmAGYzM5kzAMzM/wAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///////wAA////zMz/ADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMM2bMmTMAZmbMmWYAmTMAZmb/7u7uADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPM////////AAD////MzP8AM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8yIiIiZZgBmZsyZMwCZMwBmZswAAMwAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8z///////8AAP///93d3QAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAAzHd3d5kzAGaZzJkzAJkzAGYzZpmZ/wAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzP///////wAA////7u7uADPMADPMADPMADPMADPMADPMADPMADPM
+ADPMADPMMzPMZjMzmTMAZpn/mTMAmTMAZjMzmcz/ADPMADPMADPMADPMADPMADPMADPMADPM
+ADPMADPMADPMADPM////////AAD///////8AM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wzZsyZMwCZZgBmZv+ZMwCZMwCZMwDMzP8AM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8z///////8AAP///////wAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzGaZ
+/5kzAJlmAGZmzJlmAJkzAJkzAMz//wAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAz
+zDMzzP///////wAA////////ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMmZn/mTMA
+mTMAMzPMmWYAmTMAmTMA7u7uAADMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMMzPM
+////////AAD///////8AM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8yZzP+ZMwCZMwAz
+M8yZZjOZMwCZMwC7u7sAAMwAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wzM8z/////
+//8AAP///////wAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzMzM/5lmM5kzADMzZsyZ
+M5kzADMzmWZmzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzDMzzP///////wAA
+////////ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMzMz/MzPMmTMAZjMzzJlmmTMA
+mTMAADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////////AAD/////
+//8AM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8yZMwCZMwCZmZmZMwCZMwCZ
+ZgAAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///////8AAP///////wAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzDMzzJkzAJkzAJlmM5kzAJkzAJkzAMzM
+/wAAzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///////wAA////3d3dADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMZmbMmTMAmTMAmTMAmTMAmTMAmTMAZmbMMzPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////////AAD////MzP8AM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8xmZsyZMwCZMwCZMwCZMwCZMwCZMwBmM2bMzP8AAMwA
+mf8AM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///////8AAP///8zM/wAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzGZmzJkzAJkzAJkzAJkzAJkzAJkzAJkzAP///wAAzACZzAAA
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzO7u7v///wAA////mZn/ADPMADPMADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMMzPMmWYAmTMAmTMAmTMAmTMAmTMAmTMA////AADMADPMAGbMADPM
+ADPMADPMADPMADPMADPMADPMzMz/////AAD///+Zmf8AM8wAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wAZswAAMwAM8wAAMzMmWaZMwCZMwCZMwBmM2YzM8zu7u7///8AAMwAAMwA//8AM8wAM8wA
+M8wAM8wAM8wAM8wAM8yZmf////8AAP///5mZzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzABm
+zAAzzAAzzAAzzJnM/5kzAJkzAJkzAJkzADMzzAAzzAAAzAAzzAAAzAD//wAAzAAzzACZzAAA
+zAAzzAAzzAAzzJmZzP///wAA////ZpnMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM
+ADPMADPMADPMzJlmmTMAmTMAmTMAmTMAADPMADPMADPMADPMAP//ADPMADPMAMz/ADPMADPM
+ADPMADPMZmbM////AAD///9mZswAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAZswAM8wA
+M8wAM8xmmf+ZZjOZMwCZMwCZMwBmM2YAM8wAM8wAM8wAAMwAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wzZsz///8AAP///2ZmzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAAzAD//wAAzAAzzAAz
+zAAAzMzM/5lmAJkzAJkzAJkzADMzmQAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzDMz
+zP///wAA////M2bMADPMADPMADPMADPMADPMADPMADPMAGbMADPMAMz/ADPMADPMADPMADPM
+AADM7u7uzJmZmTMAmTMAMzPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////
+AAD///8zM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAmf8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/mcz/mZn/mZnMZpnMZmbM
+M2bMMzPMMzPMADPMADPMADPMADPMADPMADPMADPMADPMZpnM////////////////////////
+////////////////////////AAD/////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+//////////////////8AAA==
+ENDofIMG
+
+demo.show_image('gif', 'gif87a', <<'ENDofIMG')
+R0lGODdhQAAoAPcAAAAAADgoOHBgYJiIkIB4iJCAiIB4gGBIUGhggKiYmLCYoLiooHBocMCA
+eJBocLCYmMCooKiQkKCAgGBASIiAiGhYeLiQiIhoaJhwcJh4gMCYkMCgoMCoqKiQiEBAWEg4
+QMiwoMioqMComLCIiFhAWIBgaJhweHBgcLiQkIiAgDg4UIhwgHhgYJh4cMiooFBQcGBYeJiA
+iIBwgIh4iKCAiKB4eHhYYGhIWKiIiEhAWFBIYEhAaEhIaHBYcHBgeFBQeHBogHBQYHBQWGBA
+UFhQaGBYaFhYeKCIkLCQmHhYaGBIWLCYiFBAYEhAYFhQYFBIaFhYcKCIiKCQkKiIkLCIgHBQ
+aIhwcJiAeIBgcJBwcLCQiKiAeKB4gHhwgNCwqMiwqIBoeHBYaJh4eMCYmJBweGhYYNC4qEg4
+UEA4WGBQWEBAYFBQaHBoeFhQcGhgeGhYcMiwsJB4cGBIYNjIwEAwSMCgmHhocFBAWNDAuNDI
+uIBweGBYcHhoeDgwQGhgaKCIgNjQuKiAgNjIuKiIgKCAeKCQiEhIWFBIUGBQaNC4sGBQcGBY
+YMi4sGhYWFhIYFhIaFhQWHhoaLCQkDg4SHBgaJB4gJB4eLiYmLiomGhYaEhIYFhYaIh4gHho
+gGhgcIBoaGBIaHhgcNDAsFBAUGhQYLigoLioqJiIgGhQaFA4SFhIWHhweFBIWJiAgIh4eFhI
+UHBYYIhweEg4WLiYkDg4WGBQYEA4SEA4UMCwqIhocHhgaJB4iJCAgFhASEBAUEhAUIBocFhA
+UKCQmHhgeEgwSNjQwEg4SLCgmDgwUGhQWLCgoEAwUFBASLigmEAwQGhIUFg4SIhoeEgwQKiY
+kFA4UDgwSJiIiIBwcKiQmLCooLCYkDgoQP//////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+/////////////////////////////////ywAAAAAQAAoAAAI/gABCBxIsKDBggEEDBhAoICB
+AwcjSpxIMSKCBAoWIGDQoIGDBxAURJBAoKLJkwcnUKgQoYEFlxcwdOyYoYGGDRw6eEDJc+IH
+CSBCiHg5YiaJEjM7mjgBAkUKAip6Sh24YqYGmUkbYGDRwoWGlxocvIABI4aMGVN70qiRNSkL
+Gzda4BhhIoeOHTx6+PjxwwcCIGlPouiI4WUDFkFYCLlhYwiLBkU73iBShAgRAkaMHCGAIDBF
+JBpmXkiiZMiQCagzLEFRgi0GDUyaONHx5MkLKFFCSOns+eCUBlRKVIErxIYVG1ewsMiixYSW
+LVxQkIDRpDqRJF1gVPDyhQDg3gSB/mQAwyKMmBJjpoAhU6bKCjMgMGxZAuIMmjRq0KhpsmbN
+EjZtuHEEAgQ4Ad5ACLxRQhkZwBHHGHKMAcccdFxhBgpU1FGDHUzc0QESduDhxRx56DEHHnvs
+4R0ffRzYhREwYOHHH4BUEQgZYYlgoSBfjCHIBh0MAoEdAxBSiCGHIJLIHHCYwEEFQHRhx4Ew
+LLCHIm4sIggjc9RhgQhzgEAIIGSEAAIgjShhwhwN4MGEI4/sAIkjSEQiCRJYuAHEJL0RwMge
+ejzBBiV6VGKJFpcMskUcFyQygoiEbAABJn9kogkaa+RgwCZEMEEEBlNw4gMbiPQ2QyeefAKK
+GpT0cAIk/jjEgQIKggAiiAMgUAFZIkiEIkokozyigyakLFLBGzb8IcUDPXjSGxArlGJKKKcg
+sQAqdojAlQMaCDLGHIlk8EkqiFhQBxJL5BAGE0yo4gQaTBTAQAYc2NGDZ4UAYcoOhfBxwiql
+nFGGDQ3UwMIFGsyBAgs19MBKDg0IQUoroqCRgweO5OCKJjo4osEYBXjySmAE/JBCDHBMUUkT
+T6AxiktgvXTDDbDEUoEsF8ySQxl8LJEGLTugUUQtllBQyyqW8DFyWggY8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h4gHho
+gGhgcIBoaGBIaHhgcNDAsFBAUGhQYLigoLioqJiIgGhQaFA4SFhIWHhweFBIWJiAgIh4eFhI
+UHBYYIhweEg4WLiYkDg4WGBQYEA4SEA4UMCwqIhocHhgaJB4iJCAgFhASEBAUEhAUIBocFhA
+UKCQmHhgeEgwSNjQwEg4SLCgmDgwUGhQWLCgoEAwUFBASLigmEAwQGhIUFg4SIhoeEgwQKiY
+kFA4UDgwSJiIiIBwcKiQmLCooLCYkDgoQP//////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+/////////////////////////////////yH5BAEAAAAALAAAAABAACgAAAj+AAEIHEiwoMGC
+AQQMGECggIEDByNKnEgxIoIEChYgYNCggYMHEBREkECgosmTBydQqBChgQWXFzB07JihgYYN
+HDp4QMlz4gcJIEKIeDliJokSMzuaOAECRQoCKnpKHbhipgaZSRtgYNHChYaXGhy8gAEjhowZ
+U3vSqJE1KQsbN1rgGGEih44dPHr4+PHDBwIgaU+i6IjhZQMWQVgIuWFjCIsGRTveIFKECBEC
+RowcIYAgMEUkGmZeSKJkyJAJqDMsQVGCLQYNTJo40fHkyQsoUUJI6ez54JQGVEpUgSvEhhUb
+V7CwyKLFhJYtXFCQgNGkOpEkXWBU8PKFAODeBIH+ZADDIoyYEmOmgCFTpsoKMyAwbFkC4gya
+NGrQqGmyZs0SNm24cQQCBDgB3kAIvFFCGRnAEccYcowBxxx0XGEGClTUUYMdTNzRARJ24OHF
+HHnoMQcee+zhHR99HNiFETBg4ccfgFQRCBlhiWChIF+MIcgGHQwCgR0DEFKIIYcgksgccJjA
+QQVAdGHHgTAssIcibiwiCCNz1GGBCHOAQAggZIQAAiCNKGHCHA3gwYQjj+wAiSNIRCIJEli4
+AcQkvRHAyB56PMEGJXpUYokWlwyyRRwXJDKCiIRsAAEmf2SiCRpr5GDAJkQwQQQGU3DiAxuI
+9DZDJ558AooalPRwAiT+OMSBAgqCACKIAyBQAVkiSIQiSiSjPKKDJqQsUsEbNvwhxQM9eNIb
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gAAxoRgQ58AgDKOMY04qAHIszxQANQBicSYIkv
+BAEHeMCFFgaBMA3gIAtZqMMRYHEBXUwgEgxwgi2MIRBIRKESqhgFNQ4kEFsUAICpaMYGXkGF
+L6BACziYRgcI4c9eYIEQExjGNALQiFtUQyCUSAMpfnEGClJVIASoACdO0YwHgIEQCkABLrIw
+iGaUwhKWaMYgrHGMWdzgCAKwgypcwQle6OEXt4AEU+8qEASwwQ2qWIAUekEJG9QBAqbggBXE
+EIUFKKMUDxjYxACMMQ1SuMIKVqiEHYoACVZwliAIuMYAEoCNViwgGwm4RASagYlsmOK42khA
+NjhRgALwQQ+R6AQD3PAGTfy2IAgwQHSzAYFsYOMYzZCEMh4wi2w4170ytYYwrGFdTxDhoN8t
+yCQKkIIIJEAbSFBAApTh3gUYOBvKIG4EBlAACsgABnvIQX4jAgRHzAAbGF6vAo5xCWVMYxpI
+kEIEYsCLU6yAEnadsESgUIABRCEK2IhABIQh4wHQgAbWsCwfnLANFZskAJ2YQUN2UYAYzIDE
+XWADDO5A1YAAADs=
+ENDofIMG
+
+teapot = <<'ENDofIMG'
+",
+".. c #998074",
+"#. c #84aadc",
+"a. c #c47e55",
+"b. c #4c6ea0",
+"c. c #d48a64",
+"d. c #ecccbc",
+"e. c #8c6252",
+"f. c #b1a094",
+"g. c #714628",
+"h. c #af8a76",
+"i. c #2c5284",
+"j. c #98745f",
+"k. c #8f5124",
+"l. c #844614",
+"m. c #5074a6",
+"n. c #aeb2b9",
+"o. c #3e291c",
+"p. c #44689b",
+"q. c #4c2705",
+"r. c #1b2b43",
+"s. c #e1c8bb",
+"t. c #dd782d",
+"u. c #9c5824",
+"v. c #547aac",
+"w. c #906e5a",
+"x. c #545253",
+"y. c #e07e33",
+"z. c #bcaeac",
+"A. c #aeb6bc",
+"B. c #6f737b",
+"C. c #7e5942",
+"D. c #b55e1a",
+"E. c #7c5134",
+"F. c #8c7a70",
+"G. c #62524d",
+"H. c #bc8a6c",
+"I. c #936754",
+"J. c #6e6d75",
+"K. c #8cb0e2",
+"L. c #d4beb4",
+"M. c #2a201a",
+"N. c #c48664",
+"O. c #412105",
+"P. c #a95a19",
+"Q. c #747a7c",
+"R. c #2a2e33",
+"S. c #484c53",
+"T. c #8690a1",
+"U. c #6c524c",
+"V. c #505967",
+"W. c #040204",
+"X. c #8cb6e4",
+"Y. c #8f4912",
+"Z. c #846e5c",
+"0. c #244a7c",
+"1. c #dcc2b6",
+"2. c #33261b",
+"3. c #81736c",
+"4. c #3c3b46",
+"5. c #735f53",
+"6. c #545e69",
+"7. c #bc7c58",
+"8. c #4c2f1d",
+"9. c #a4806b",
+".# c #604c4c",
+"## c #d4916b",
+"a# c #5c80b2",
+"b# c #e3d3cd",
+"c# c #c8ad9a",
+"d# c #bf6c2e",
+"e# c #08121c",
+"f# c #9c5e34",
+"g# c #9298a1",
+"h# c #8b7f7c",
+"i# c #835f44",
+"j# c #a46e54",
+"k# c #474649",
+"l# c #a65d26",
+"m# c #be6420",
+"n# c #7c9ed2",
+"o# c #ac622c",
+"p# c #726e6c",
+"q# c #e1a684",
+"r# c #a48676",
+"s# c #54464c",
+"t# c #a0a4ac",
+"u# c #b37b5a",
+"v# c #947a70",
+"w# c #543d31",
+"x# c #743e12",
+"y# c #98bcee",
+"z# c #d49e7c",
+"A# c #64320c",
+"B# c #d4cac6",
+"C# c #2c3642",
+"D# c #6e686b",
+"E# c #5c463e",
+"F# c #7f7575",
+"G# c #bcb2b0",
+"H# c #979dac",
+"I# c #a47a61",
+"J# c #8c9094",
+"K# c #1c262c",
+"L# c #d3c3bc",
+"M# c #9cc2f4",
+"N# c #af7455",
+"O# c #fcad5f",
+"P# c #6486b8",
+"Q# c #d4742d",
+"R# c #6d4e3d",
+"S# c #242224",
+"T# c #3b444c",
+"U# c #181515",
+"V# c #6e4024",
+"W# c #749bcc",
+"X# c #afabac",
+"Y# c #7e6a64",
+"Z# c #343634",
+"0# c #e8ac8a",
+"1# c #343a44",
+"2# c #b18f7a",
+"3# c #dda07f",
+"4# c #6f380d",
+"5# c #2f5684",
+"6# c #a08d86",
+"7# c #5f6068",
+"8# c #625751",
+"9# c #16253b",
+".a c #94b6e9",
+"#a c #dfcec8",
+"aa c #3c6194",
+"ba c #ecdad3",
+"ca c #948a89",
+"da c #a4c8fa",
+"ea c #bcb6b8",
+"fa c #604432",
+"ga c #cc6d29",
+"ha c #949ea4",
+"ia c #413024",
+"ja c #a48a7a",
+"ka c #9a867d",
+"la c #1c1a1c",
+"ma c #342116",
+"na c #bc8364",
+"oa c #9c8674",
+"pa c #844e25",
+"qa c #3c4a5c",
+"ra c #582c0d",
+"sa c #c7835a",
+"ta c #613c24",
+"ua c #614b41",
+"va c #adaeb5",
+"wa c #805c4c",
+"xa c #0a0b0f",
+"ya c #c4b2ac",
+"za c #648abc",
+"Aa c #af846a",
+"Ba c #c68a69",
+"Ca c #483c39",
+"Da c #7f400d",
+"Ea c #646e74",
+"Fa c #a85515",
+"Ga c #042244",
+"Ha c #816759",
+"Ia c #95817c",
+"Ja c #9c9aa1",
+"Ka c #9c6b54",
+"La c #7e4924",
+"Ma c #0c1a2c",
+"Na c #5f595f",
+"Oa c #6f615e",
+"Pa c #474149",
+"Qa c #8c9aac",
+"Ra c #cbbeb8",
+"Sa c #806e68",
+"Ta c #82624e",
+"Ua c #949294",
+"Va c #b4652c",
+"Wa c #9c9ea4",
+"Xa c #72574c",
+"Ya c #2a303e",
+"Za c #bc9175",
+"0a c #9c7a64",
+"1a c #261a13",
+"2a c #aca6ac",
+"3a c #341a04",
+"4a c #593520",
+"5a c #d49878",
+"6a c #26282c",
+"7a c #475261",
+"8a c #3f3535",
+"9a c #63676f",
+".b c #a47255",
+"#b c #bc967c",
+"ab c #52433a",
+"bb c #80a4d6",
+"cb c #544c4c",
+"db c #bc723c",
+"eb c #645e54",
+"fb c #a4abb4",
+"gb c #c89070",
+"hb c #8c7469",
+"ib c #c7b8b3",
+" ",
+" ",
+" ",
+" wawae.e.wa ",
+" .#j#N#7.a.db.# ",
+" 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r#r#1.s.M#M#y#a#a#a#M#M#y#y#daM#dadada ",
+" .a.aX..aX..aX..aD#SaF..ay#y#.aX..am.m.........s.s.9.9.r#r#r#r#kakar#M#M#a#a#a#a#a#a#M#M#M#M#dadada ",
+" K.X..a.a.a.a.aH#vab#1.y#X.X.y#y#y#y#v.v...s.d.d.d.s.r#r#h.jajajar#a#M#v.a#a#a#a#a#a#P#dadadaM# "};
+ENDofIMG
+
+demo.show_image('xpm', 'color', "/* XPM */
+static char * teapot[] = {
+\"64 48 204 2\",
+\" c #145ec4#{teapot}")
+
+demo.show_image('xpm', 'transparent', "/* XPM */
+static char * teapot[] = {
+\"64 48 204 2\",
+\" s None c None#{teapot}")
+
+demo.show_image('xbm', 'bitmap', <<'ENDofIMG')
+#define flagup_width 48
+#define flagup_height 48
+static char flagup_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00,
+ 0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00,
+ 0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00,
+ 0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00,
+ 0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00,
+ 0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00,
+ 0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00,
+ 0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00,
+ 0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00,
+ 0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00,
+ 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00,
+ 0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00,
+ 0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00,
+ 0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
+ 0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a,
+ 0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a,
+ 0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a,
+ 0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
+ 0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a,
+ 0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a,
+ 0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ENDofIMG
+
+demo.show_image('png', 'color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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAkAABJAAAAAACSSSRJAABtJABtJACSbSSSSSTbtm22km3btm3btm3btm22km3/
+km22bUn/25L/27b/25Lbtm3btpLbkm3/27bbtpLbtm22km3/25L/27b//7b/27b//////9v/
+/////9v/////tpL/km1tJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABtAABJAABJAABJAACSJCRJ
+AABtJABtAACSSSRtJACSbSSSSSTbkm222222km22bUm2kknbtpLb25K2km22kknbtpLbtm3b
+tpLbtm22km3btpK2km3btpLb25L//9v/25L/25Lb29v//7b/27b//7b/27b/25Lb29v/27bb
+tpL//9v//////7b///////////////+2bUkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABJAABJAABJAABJAABJJACSSSSSJABtSQCSSSSSSSSSSSSSJCSSSSS2
+bUmSSSSSJABtJABtAACSSSS2kkm2bUnbkkm2kkn/25K2kknbtm22km3bkm22km3/tm3btm3b
+tm3btpLbkm22km22kkm2kknbtm3bkpL/25L/27b//7b/27b//7b/////tm3btpL/27b/tm3b
+tpLbtm3//7b/25L//9v/////////////////////2/8AAAAAAAAAAAAAAACSSSQkAABtJABJ
+AABtJABJAABJAABJAACSSSRtSQBtJABtSSS2kkmSJCSSJCSSSSSSSSSSSSSSSSSSSSSSSSRt
+JACSSSSSSSS2bUm2km3//9u2bUm2bUm2bUm2SSS2bUm2bUm2km2SSSSSSSTbtm3btpL/25K2
+km3btkm2km3btm22km3bkm3btpL/25K2tm3bkm22km3btm22bUm2bUm2bUm2kkm2bUnbtm22
+tm3bkm3b25L//9v///////////8ADgEAAAMAAAABAEAAAAEBAAMAAAABACgAAAECAAMAAAAD
+AAAetgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAESAAMAAAABAAEAAAEV
+AAMAAAABAAMAAAEWAAMAAAABACgAAAEXAAQAAAABAAAeAAEaAAUAAAABAAAevAEbAAUAAAAB
+AAAexAEcAAMAAAABAAEAAAEoAAMAAAABAAIAAAAAAAAACAAIAAgSwAAAAAQAABLAAAAABAAA
+ENDofIMG
+
+demo.show_image('tiff', 'packbits compressed', <<'ENDofIMG')
+TU0AKgAABAqBAMEAgQDBAIEAwQCBAMEAgQDBAIEAwQCBAMEAgQDBAIEAwQCBAMEAgQDBAIEA
+wQCBAMEAgQDBAIEAwQCbAAvb///bttu2tv+Sttv/tv7bA/8AJEm8AKEA/v8G2///ttvbtv3b
+Df+2ttttttu2ttu22//b//+/AKMACCQAttvbJG2S2////7YR/wAkSSRtkm2Sttv//9v//22S
+/9v//8IAoQADkrbbtv/b/7b+2wD//gARttvbJG2SAAAkkrbbttvbkrbbwgCcAAAk9wD/JAUA
+JCSSttv+AAGStv/b///CAJcA/0n+AAJJbZL/AP8k/wAIkra2AEkA29v/wgCBAMEAgQDBAIEA
+wQCBAMEAgQDBAIEAwQCBAMEAgQDBAIEAwQCBAMEAgQDBAIEAwQD9///b//8B2///2/7/gQDQ
+AB5tJACSbSS2bUnbkm22km3btm22kkn/25L//9ttJAAkgQDgACOSSSSSSSTbkm2SSSSSSSSS
+JACSSSS2bUm2bUm2bUn/27b//9v3/w3btv+2bdu2bf//2//btvb/AdskigADJAAASfwAU5JJ
+JEkAAG0kAG0kAJJtJJJJJNu2bbaSbdu2bdu2bdu2bbaSbf+SbbZtSf/bkv/btv/bktu2bdu2
+ktuSbf/bttu2ktu2bbaSbf/bkv/btv//tv/btvz/ANv8/wDb/f8GtpL/km1tJLUAYm0AAEkA
+AEkAAEkAAJIkJEkAAG0kAG0AAJJJJG0kAJJtJJJJJNuSbbbbbbaSbbZtSbaSSdu2ktvbkraS
+bbaSSdu2ktu2bdu2ktu2bbaSbdu2kraSbdu2ktvbkv//2//bkv/bkv7b//8Mtv/btv//tv/b
+tv/bkv7bCP/bttu2kv//2/z/ALb1/wK2bUnXAH9JAABJAABJAABJAABJJACSSSSSJABtSQCS
+SSSSSSSSSSSSJCSSSSS2bUmSSSSSJABtJABtAACSSSS2kkm2bUnbkkm2kkn/25K2kknbtm22
+km3bkm22km3/tm3btm3btm3btpLbkm22km22kkm2kknbtm3bkpL/25L/27b//7b/2wO2//+2
+/f8Ztm3btpL/27b/tm3btpLbtm3//7b/25L//9vx/wHb//UAAZJJ/yT/AH9tJABJAABtJABJ
+AABJAABJAACSSSRtSQBtJABtSSS2kkmSJCSSJCSSSSSSSSSSSSSSSSSSSSSSSSRtJACSSSSS
+SSS2bUm2km3//9u2bUm2bUm2bUm2SSS2bUm2bUm2km2SSSSSSSTbtm3btpL/25K2km3btkm2
+km3btm22km3bkjBt27aS/9uStrZt25JttpJt27Zttm1Jtm1Jtm1JtpJJtm1J27ZttrZt25Jt
+29uS///b+P8ADgEAAAMAAAABAEAAAAEBAAMAAAABACgAAAECAAMAAAADAAAEuAEDAAMAAAAB
+gAUAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAESAAMAAAABAAEAAAEVAAMAAAABAAMAAAEW
+AAMAAAABACgAAAEXAAQAAAABAAAEAgEaAAUAAAABAAAEvgEbAAUAAAABAAAExgEcAAMAAAAB
+AAEAAAEoAAMAAAABAAIAAAAAAAAACAAIAAgSwAAAAAQAABLAAAAABAAA
+ENDofIMG
+
+if false
+demo.show_image('tiff', 'pixarlog compressed', <<'ENDofIMG')
+TU0AKgAAA3Z4nO2aIWzbUBCGz7HjYyVTNDAp0CgKDRorCauiSGFjRmWRxs0rlQ2FlUWKrLKQ
+sIDK1BoyjFRUjZSF7f13eYnjpZOmdeuU3Wc1se+dn17uf/ee5SuRYRiGYRiGYRiGYRiGYRiG
+YRg/YxVt3EG04IpLJkqocJ8VD6S1746ELsOP8UNMxO1J9MbDPQs2EvOKcV66uOsZoo34lwxb
+JraMfEsif+S06Lrj74/5XNi2iG6jdbCKruMRz3gdfKUbF/OFi/c0vHbzf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wAAAAEAKAAAARcABAAAAAEAAANuARoABQAAAAEAAAQqARsABQAA
+AAEAAAQyARwAAwAAAAEAAQAAASgAAwAAAAEAAgAAAAAAAAAIAAgACBLAAAAABAAAEsAAAAAE
+AAA=
+ENDofIMG
+end
+
+if false
+demo.show_image('tiff', 'logluv compressed', <<'ENDofIMG')
+TU0AKgAAAAgADgEAAAMAAAABAEAAAAEBAAMAAAABACgAAAECAAMAAAADAAAAtgEDAAMAAAAB
+h3QAAAEGAAMAAAABAAIAAAERAAQAAAABAAAAAAESAAMAAAABAAEAAAEVAAMAAAABAAMAAAEW
+AAMAAAABACgAAAEXAAQAAAABAAAAAAEaAAUAAAABAAAAvAEbAAUAAAABAAAAxAEcAAMAAAAB
+AAEAAAEoAAMAAAABAAIAAAAAAAAAEAAQABASwAAAAAQAABLAAAAABAAA
+ENDofIMG
+end
+
+demo.show_image('tiff', 'jpeg compressed', <<'ENDofIMG')
+TU0AKgAABID/2P/AABEIACgAQAMAEQABEQACEQD/2gAMAwAAAQACAAA/APn+vn+vn+iiiiii
+iiiiiiiiiiiiiiiiiiiiiiiiiiitK28O63e28VxaaNqE8ExIilitXZXIODtIGDyCOPStO18O
+a5e28VxaaNqNxBLny5IrV3V8Eg4IGDyCPqDWtZ+FvEOo2kd3Y6Dql1bS/wCrmgs5HR+SOCBg
+8gj6g1m1mkEEgggjqDWUysjFWUqwOCCMEGikpKKKKKKKKKKKKKKUHBB449RRXdXHxU16+nt5
+Ll1j8li5MDOTIxdWJYOzKSMMF3KwG4jHTHo83xl8QXs8U92Y1aJWASAMAxZkO472ZSQA4G5W
+A3YwRjb6mfjj4guZ4pblYYhEr/u7VWHmMzIcszuwyAHC5Vgu7G054x/GPiGDxNqtvqEcLRz/
+AGcR3LFAvmSB3wwwTxsKcEnbjaCQorA8e+J7bxbrdvqcEDRzfZViunaNU82QM3zgAnjaUGCT
+jG0HAFcx8QfFlt4z1221aK18i4+yrFdt5ap50iu+HwCTymzgkkY25IUE87XLVydFFFFF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++awarnpJlkTIOnI9Aic1o1LsuEHuMdIyHTgrPyVTVKsM/YfuRzY4odxz3v2KBfaf021aDQqi
+E2q3SYs0QxN1cdSOHnW0i8uWyYoR79dFIK95nedr5HhObRRmctXuUC9uNR31AAAOAQAAAwAA
+AAEAQAAAAQEAAwAAAAEAKAAAAQIAAwAAAAMAAAJWAQMAAwAAAAGAsgAAAQYAAwAAAAEAAgAA
+AREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAwAAARYAAwAAAAEAKAAAARcABAAA
+AAEAAAGfARoABQAAAAEAAAJcARsABQAAAAEAAAJkARwAAwAAAAEAAQAAASgAAwAAAAEAAgAA
+AAAAAAAIAAgACBLAAAAABAAAEsAAAAAEAAA=
+ENDofIMG
+
+if Tk::PLATFORM['platform'] != 'windows'
+demo.show_image('other', 'postscript', <<'ENDofIMG')
+%!PS-Adobe-3
+%%Title: postscript.ps
+%%BoundingBox: 66 648 146 720
+%%Pages: 1
+%%DocumentProcSets: Adobe_distill 0.96
+%%EndComments
+%%BeginProcSet: Adobe_distill 0.96
+/PROLOGUE 30 40 add dict def
+ % 30 procedure entries + room for 40 cached font dictionaries
+ PROLOGUE begin
+ /clip { } def % causes problems. remove if "clip" is needed
+ /bdef { bind def } bind def /ldef { load def } bdef
+ /T { moveto show } bdef /A { moveto ashow } bdef
+ /W { moveto widthshow } bdef /AW { moveto awidthshow } bdef
+ /f /fill ldef /R { { rlineto } repeat } bdef
+ /r /rlineto ldef /L { { lineto } repeat } bdef
+ /m /moveto ldef /l { moveto lineto stroke } bdef
+ /x { 0 rlineto } bdef /y { 0 exch rlineto } bdef
+ /c /curveto ldef /cp /closepath ldef
+ /s /stroke ldef /w /setlinewidth ldef
+ /g /setgray ldef /j /setlinejoin ldef
+ /d /setdash ldef /F /setfont ldef
+ /C /setcmykcolor where { /setcmykcolor get }{ %ifelse
+ { %def
+ 1 sub 3 { 3 index add neg dup 0 lt { pop 0 } if 3 1 roll } repeat
+ setrgbcolor
+ } bind
+ } ifelse def
+ /selectfont where { pop }{ %ifelse
+ /selectfont { exch findfont exch scalefont setfont } bdef
+ } ifelse
+ /MF { exch findfont exch makefont setfont } bdef
+ /FF /selectfont ldef
+ /DF { selectfont currentfont def } bdef
+ /BEGINPAGE { pop /pagesave save def } bdef
+ /ENDPAGE { pop pagesave restore showpage } def
+ /REMAP { %def
+ FontDirectory 2 index known { pop pop pop } { %ifelse
+ findfont dup length dict begin
+ { 1 index /FID ne {def}{pop pop} ifelse } forall
+ exch dup length 0 gt { /Encoding exch def }{ pop } ifelse
+ currentdict end definefont pop
+ } ifelse
+ } bdef
+ /RECODE { %def
+ 3 -1 roll 1 index findfont /Encoding get 256 array copy exch
+ 0 exch { %forall
+ dup type/nametype eq
+ { 3 {2 index} repeat put pop 1 add }{ exch pop }ifelse
+ } forall pop 3 1 roll REMAP
+ } bdef
+ end %PROLOGUE
+%%EndProcSet: Adobe_distill 0.96
+%%EndProlog
+%%BeginSetup
+PROLOGUE begin
+%%EndSetup
+%%Page: 1 1
+1 BEGINPAGE
+1 g
+2 setlinecap
+144 53 m
+390 x
+-19 y
+-390 x
+eofill
+0 g
+1.268 w
+0 setlinecap
+4 setmiterlimit
+[] 0 d
+109.698 714.182 m
+111.525 713.672 112.472 713.234 113.624 712.431 c
+-22.3128 -25.8381 r
+97.4019 682.652 103.794 672.84 100.329 664.844 c
+102.034 675.687 90.7436 683.82 84.1099 684.842 c
+25.588 29.3407 r
+f
+1.0361 w
+f
+f
+91.8805 654.468 m
+96.0255 654.285 100.155 654.188 104.481 654.188 c
+113.804 654.188 122.752 654.636 131.141 655.44 c
+134.222 655.737 136.724 658.133 137.108 661.279 c
+137.79 666.855 138.107 672.696 138.107 678.705 c
+138.107 684.714 137.79 690.555 137.108 696.131 c
+136.724 699.277 134.222 701.674 131.141 701.97 c
+127.476 702.321 123.704 702.604 119.84 702.813 c
+119.84 702.813 103.842 668.373 102.231 664.827 c
+99.8549 659.595 96.601 655.765 91.8805 654.468 c
+f
+0.7851 w
+77.8202 655.44 m
+74.7171 655.948 72.2887 657.716 71.8525 661.279 c
+71.1725 666.855 70.8549 672.696 70.8549 678.705 c
+70.8549 684.714 71.1725 690.555 71.8525 696.131 c
+72.2381 699.277 74.7417 701.674 77.8202 701.97 c
+82.1335 702.383 86.5932 702.702 91.1764 702.916 c
+8.16241 9.07727 r
+99.2863 711.98 101.266 712.345 102.996 711.921 c
+-28.4564 -32.9334 r
+80.6983 681.906 98.7446 677.354 98.7446 666.708 c
+98.7446 655.332 86.3243 654.054 77.8202 655.44 c
+f
+0.0843 w
+139.67 644.154 m
+140.194 644.154 140.619 644.576 140.619 645.098 c
+140.619 645.619 140.194 646.042 139.67 646.042 c
+139.146 646.042 138.721 645.619 138.721 645.098 c
+138.721 644.576 139.146 644.154 139.67 644.154 c
+1 ENDPAGE
+%%Trailer
+end %PROLOGUE
+%%Pages: 1
+%%EOF
+ENDofIMG
+end
+
+if false
+demo.show_image('other', 'pdf', <<'ENDofIMG')
+JVBERi0xLjIKJcfsj6IKNCAwIG9iago8PC9MZW5ndGggNSAwIFIvRmlsdGVyIC9GbGF0ZURl
+Y29kZT4+CnN0cmVhbQp4nF1TSY7cQAy7+xX1AkFbaXlG3jBAgAAzh/z/Esp2uyeDPhhUayEp
+FZMsnt/9/fg6/h6y/hzCHdS1UlyodH0dIrJJNyIWlLpE1OcLrGQOjLg6MOIm6+NoMULWiopN
+bevz6HRiaUQ0aKMHW1L7itQitGA2UvwdDuhoIaw8zSN3UOVqTnILNLAiXQVy3NNvCvQs+M57
+Zv4Gj6LivWK7UxS0dDCknBGl2jNY6MKoKmBkljwYfQUD2d8ZqjkKgINASEyEfCq208nc0Fon
+YSdZIiFy7IldQmbACe4FraKUfVYkzEAgarhgIBJyvIGi+IYrCWqm4I6UJ4mvV4PmfTW4J3TI
+tZCHQzdmDqeLY7Jgpf6IAG7KKVAsLAMBxWIEqrEvuAAc8xXp2Rtgkdhp038B7PfcCyQZ5WDV
+oXIuWGdCI387SO/G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PRgo=
+ENDofIMG
+end
+
+#######################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension b/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension
new file mode 100644
index 0000000000..23238e9c66
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension
@@ -0,0 +1,41 @@
+This software is copyrighted by Jan Nijtmans (the maintainer)
+and a lot of other people who contributed code (most notably
+Andreas Kupries, Thomas G. Lane, Ioi K. Lam, Mario Weilguni
+and Roger E Critchlow Jr).
+The following terms apply to all files associated with the
+software unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/ext/tk/sample/tkextlib/tkimg/readme.txt b/ext/tk/sample/tkextlib/tkimg/readme.txt
new file mode 100644
index 0000000000..8fd1a3e67d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tkimg/readme.txt
@@ -0,0 +1,3 @@
+The script 'demo.rb' is based on 'demo.tcl' of Tcl/Tk's 'Img' extension.
+Image data in 'demo.rb' is those of 'demo.tcl'.
+Please read 'license_terms_of_Img_extension' file.
diff --git a/ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt
new file mode 100644
index 0000000000..b06b0b463b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt
@@ -0,0 +1,52 @@
+
+ #######################################################################
+ ### The following text is the original 'license.txt' of tktable ###
+ ### extension. ###
+ ### Original Tcl source files are not include in this directory, ###
+ ### because of all of them are rewritten to Ruby files. ###
+ ### However, the image data file is quoted from iwidgets source ###
+ ### archive. ###
+ #######################################################################
+
+
+ * COPYRIGHT AND LICENSE TERMS *
+
+(This file blatantly stolen from Tcl/Tk license and adapted - thus assume
+it falls under similar license terms).
+
+This software is copyrighted by Jeffrey Hobbs <jeff.hobbs@acm.org>. The
+following terms apply to all files associated with the software unless
+explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute, and
+license this software and its documentation for any purpose, provided that
+existing copyright notices are retained in all copies and that this notice
+is included verbatim in any distributions. No written agreement, license,
+or royalty fee is required for any of the authorized uses.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS
+PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO
+OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+RESTRICTED RIGHTS: Use, duplication or disclosure by the U.S. government
+is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
+of the Rights in Technical Data and Computer Software Clause as DFARS
+252.227-7013 and FAR 52.227-19.
+
+SPECIAL NOTES:
+
+This software also falls under the bourbon_ware clause:
+
+ Should you find this software useful in your daily work, you should
+ feel obliged to take the author out for a drink if the opportunity
+ presents itself. The user may feel exempt from this clause if they
+ are under 21 or think the author has already partaken of too many
+ drinks.
diff --git a/ext/tk/sample/tkextlib/tktable/basic.rb b/ext/tk/sample/tkextlib/tktable/basic.rb
new file mode 100644
index 0000000000..dddbb776dc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/basic.rb
@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+##
+## basic.rb
+##
+## This demo shows the basic use of the table widget
+##
+## ( based on 'basic.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+ary = TkVariable.new_hash
+rows = 8
+cols = 8
+
+# fill table variable
+((-(rows))..rows).each{|x|
+ ((-(cols))..cols).each{|y|
+ ary[x,y] = "r#{x},c#{y}"
+ }
+}
+
+lbl = TkLabel.new(:text=>"TkTable v1 Example")
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary,
+ :width=>6, :height=>6,
+ :titlerows=>1, :titlecols=>2,
+ :roworigin=>-1, :colorigin=>-2,
+ :rowstretchmode=>:last, :colstretchmode=>:last,
+ :rowtagcommand=>proc{|row|
+ row = Integer(row)
+ (row>0 && row%2 == 1)? 'OddRow': ''
+ },
+ :coltagcommand=>proc{|col|
+ col = Integer(col)
+ (col>0 && col%2 == 1)? 'OddCol': ''
+ },
+ :selectmode=>:extended, :sparsearray=>false)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
+
+Tk.grid(lbl, '-', :sticky=>:ew)
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+Tk.grid(btn, :sticky=>:ew, :columnspan=>2)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(1, :weight=>1)
+
+table.tag_configure('OddRow', :bg=>'orange', :fg=>'purple')
+table.tag_configure('OddCol', :bg=>'brown', :fg=>'pink')
+
+table.set_width([-2, 7], [-1, 7], [1, 5], [2, 8], [4, 14])
+
+puts "Table is #{table.path} with array #{(table['variable'])}"
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/buttons.rb b/ext/tk/sample/tkextlib/tktable/buttons.rb
new file mode 100644
index 0000000000..e35c137a28
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/buttons.rb
@@ -0,0 +1,76 @@
+#!/usr/bin/env ruby
+##
+## buttons.rb
+##
+## demonstrates the simulation of a button array
+##
+## ( based on 'buttons.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+# create the table
+tab = TkVariable.new_hash
+rows = 20
+cols = 20
+
+table = Tk::TkTable.new(:rows=>rows + 1, :cols=>cols + 1,
+ :variable=>tab, :titlerows=>1, :titlecols=>1,
+ :roworigin=>-1, :colorigin=>-1,
+ :colwidth=>4, :width=>8, :height=>8,
+ :cursor=>'top_left_arrow', :borderwidth=>2,
+ :flashmode=>false, :state=>:disabled)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(0, :weight=>1)
+
+# set up tags for the various states of the buttons
+table.tag_configure('OFF', :bg=>'red', :relief=>:raised)
+table.tag_configure('ON', :bg=>'green', :relief=>:sunken)
+table.tag_configure('sel', :bg=>'gray75', :relief=>:flat)
+
+# clean up if mouse leaves the widget
+table.bind('Leave', proc{|w| w.selection_clear_all}, '%W')
+
+# highlight the cell under the mouse
+table.bind('Motion', proc{|w, x, y|
+ Tk.callback_break if w.selection_include?(TkComm._at(x,y))
+ w.selection_clear_all
+ w.selection_set(TkComm._at(x,y))
+ Tk.callback_break
+ ## "break" prevents the call to tkTableCheckBorder
+ }, '%W %x %y')
+
+# mousebutton 1 toggles the value of the cell
+# use of "selection includes" would work here
+table.bind('1', proc{|w, x, y|
+ #rc = w.curselection[0]
+ rc = w.index(TkComm._at(x,y))
+ if tab[rc] == 'ON'
+ tab[rc] = 'OFF'
+ w.tag_cell('OFF', rc)
+ else
+ tab[rc] = 'ON'
+ w.tag_cell('ON', rc)
+ end}, '%W %x %y')
+
+
+# inititialize the array, titles, and celltags
+0.step(rows){|i|
+ tab[i,-1] = i
+ 0.step(cols){|j|
+ if i == 0
+ tab[-1,j] = j
+ end
+ tab[i,j] = "OFF"
+ table.tag_cell('OFF', "#{i},#{j}")
+ }
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/command.rb b/ext/tk/sample/tkextlib/tktable/command.rb
new file mode 100644
index 0000000000..e697ccf3bf
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/command.rb
@@ -0,0 +1,89 @@
+#!/usr/bin/env ruby
+##
+## command.rb
+##
+## This demo shows the use of the table widget's -command options
+##
+## ( based on 'command.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+# create the table
+data = TkVariable.new_hash
+rows = 10
+cols = 10
+
+# fill table variable
+((-(rows))..rows).each{|x|
+ ((-(cols))..cols).each{|y|
+ data[x,y] = "#{x} x #{y}"
+ }
+}
+
+lbl = TkLabel.new(:text=>"TkTable :command Example")
+cur_var = TkVariable.new
+current = TkLabel.new(:textvariable=>cur_var, :width=>5)
+ent_var = TkVariable.new
+entry = TkEntry.new(:textvariable=>ent_var)
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols,
+ :command=>[proc{|mode, cell, val|
+ if (mode == :w)
+ data[cell] = val
+ else
+ begin
+ data[cell] # exist
+ rescue
+ '' # not exist
+ end
+ end
+ }, '%i %C %s'],
+ :width=>6, :height=>6,
+ :titlerows=>1, :titlecols=>1,
+ :roworigin=>-1, :colorigin=>-1,
+ :rowstretchmode=>:last, :colstretchmode=>:last,
+ :rowtagcommand=>proc{|row|
+ row = Integer(row)
+ (row>0 && row%2 == 1)? 'OddRow': ''
+ },
+ :coltagcommand=>proc{|col|
+ col = Integer(col)
+ (col>0 && col%2 == 1)? 'OddCol': ''
+ },
+ :selectmode=>:extended, :flashmode=>true,
+ :rowstretch=>:unset, :colstretch=>:unset,
+ :browsecommand=>[proc{|w, s|
+ cur_var.value = s
+ ent_var.value = w.get(s)
+ }, '%W %S'],
+ :validate=>true,
+ :validatecommand=>proc{|e|
+ ent_var.value = e.new_value; true
+ })
+=begin
+ :validatecommand=>[
+ proc{|s|
+ ent_var.value = s; true
+ }, '%S'])
+=end
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+entry.bind('Return', proc{|w| table.curvalue = w.value}, '%W')
+
+Tk.grid(lbl, '-', '-', :sticky=>:ew)
+Tk.grid(current, entry, '-', :sticky=>:ew)
+Tk.grid(table, '-', sy, :sticky=>:news)
+Tk.grid(sx, '-', :sticky=>:ew)
+
+Tk.root.grid_columnconfig(1, :weight=>1)
+Tk.root.grid_rowconfig(2, :weight=>1)
+
+table.tag_configure('OddRow', :bg=>'orange', :fg=>'purple')
+table.tag_configure('OddCol', :bg=>'brown', :fg=>'pink')
+
+puts "Table is #{table.path}"
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/debug.rb b/ext/tk/sample/tkextlib/tktable/debug.rb
new file mode 100644
index 0000000000..016d5b353e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/debug.rb
@@ -0,0 +1,101 @@
+#!/usr/bin/env ruby
+##
+## debug.rb
+##
+## This demo uses most features of the table widget
+##
+## ( based on 'debug.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+# create the table
+ary = TkVariable.new_hash
+rows = 25
+cols = 20
+
+# fill table variable
+((-(rows))..rows).each{|x|
+ ((-(cols))..cols).each{|y|
+ ary[x,y] = "r#{x},c#{y}"
+ }
+}
+
+lbl = TkLabel.new(:text=>"TkTable v2 Example")
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary,
+ :width=>6, :height=>6,
+ :titlerows=>1, :titlecols=>2,
+ :roworigin=>-5, :colorigin=>-2,
+ :coltagcommand=>proc{|col|
+ col = Integer(col)
+ (col>0 && col%2 == 1)? 'OddCol': ''
+ },
+ :selectmode=>:extended, :flashmode=>true,
+ :rowstretch=>:unset, :colstretch=>:unset,
+ :selecttitles=>false, :drawmode=>:single)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
+
+Tk.grid(lbl, '-', :sticky=>:ew)
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+Tk.grid(btn, :sticky=>:ew, :columnspan=>2)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(1, :weight=>1)
+
+table.tag_configure('OddCol', :bg=>'brown', :fg=>'pink')
+table.tag_configure('title', :bg=>'red', :fg=>'green', :relief=>:sunken)
+table.tag_configure('dis', :state=>:disabled)
+
+first = table[:colorigin]
+%w(n s e w nw ne sw se c).each_with_index{|anchor, idx|
+ table.tag_configure(anchor, :anchor=>anchor)
+ table.tag_row(anchor, idx)
+ table.set([idx,first], anchor)
+}
+courier = TkFont.new(:family=>'Courier', :size=>10)
+table.tag_configure('s', :font=>courier, :justify=>:center)
+
+logo = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), 'tcllogo.gif'))
+table.tag_configure('logo', :image=>logo, :showtext=>true)
+table.tag_cell('logo', [1,2], [2,3], [4,1])
+table.tag_cell('dis', [2,1], [1,-1], [3,0])
+table.set_width([-2,8], [-1,9], [0, 12], [4, 14])
+
+table.set([1,1], "multi-line\ntext\nmight be\ninteresting",
+ [3,2], "more\nmulti-line\nplaying\n",
+ [2,2], "null\0byte")
+
+# This is in the row span
+l = TkLabel.new(table, :text=>'Window s', :bg=>'yellow')
+table.window_configure([6,0], :sticky=>:s, :window=>l)
+
+# This is in the row titles
+l = TkLabel.new(table, :text=>'Window ne', :bg=>'yellow')
+table.window_configure([4,-1], :sticky=>:ne, :window=>l)
+
+# This will get swallowed by a span
+l = TkLabel.new(table, :text=>'Window ew', :bg=>'yellow')
+table.window_configure([5,3], :sticky=>:ew, :window=>l)
+
+# This is in the col titles
+l = TkLabel.new(table, :text=>'Window news', :bg=>'yellow')
+table.window_configure([-5,1], :sticky=>:news, :window=>l)
+
+l = TkLabel.new(table.winfo_parent, :text=>'Sibling l', :bg=>'orange')
+table.window_configure([5,1], :sticky=>:news, :window=>l)
+
+if table.span_list.empty?
+ table.set_spans([-1,-2], [0,3], [1,2], [0,5], [3,2], [2,2], [6,0], [4,0])
+end
+
+puts "Table is #{table.path} with array #{(table['variable'])}"
+
+# table.postscript(:file=>'out.ps', :first=>:origin, :last=>[2,2])
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/dynarows.rb b/ext/tk/sample/tkextlib/tktable/dynarows.rb
new file mode 100644
index 0000000000..cc72a021cf
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/dynarows.rb
@@ -0,0 +1,99 @@
+#!/usr/bin/env ruby
+##
+## dynarows.rb
+##
+## This demos shows the use of the validation mechanism of the table
+## and uses the table's cache (no -command or -variable) with a cute
+## dynamic row routine.
+##
+## ( based on 'dynarows.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+def table_validate(w, idx)
+ return unless idx =~ /^(\d+),(\d+)$/
+ row = Integer($1)
+ col = Integer($2)
+ val = w.get(idx)
+
+ [w, idx]
+ nrows = w[:rows]
+ return if row == nrows - 1 && val == ''
+
+ begin
+ time = Tk.tk_call('clock', 'scan', val)
+ date = []
+ Tk.tk_call('clock', 'format', time,
+ :format=>'%m %d %Y').split(' ').each{|item|
+ date << item.sub(/^\s*0*/,'')
+ }
+ w.set(idx, date.join('/'))
+ if row == nrows - 1
+ if w.get([row,1]) != '' && w.get([row,2]) != ''
+ w.tag_row_reset(row)
+ w.set([row,0], row)
+ nrows += 1
+ row += 1
+ w.configure(:rows=>nrows)
+ w.tag_row('unset', row)
+ w.set([row,0], '*')
+ w.see([row,1])
+ w.activate([row,1])
+ end
+ end
+ rescue
+ Tk.bell
+ w.activate(idx)
+ w.selection_clear_all
+ w.selection_set(:active)
+ w.see(:active)
+ end
+end
+
+
+lbl = TkLabel.new(:text=>"Dynamic Date Validated Rows")
+
+table = Tk::TkTable.new(:rows=>2, :cols=>3, :cache=>1, :selecttype=>:row,
+ :titlerows=>1, :titlecols=>1, :height=>5,
+ :colstretch=>:unset, :rowstretch=>:unset,
+ :autoclear=>true,
+ :browsecommand=>[
+ proc{|w,s| table_validate(w, s)},
+ '%W %s'
+ ])
+table.set([0,1], 'Begin', [0,2], 'End', [1,0], '*')
+table.tag_configure('unset', :fg=>'#008811')
+table.tag_configure('title', :fg=>'red')
+table.tag_row('unset', 1)
+table.set_width(0,3)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+Tk.grid(lbl, '-', :sticky=>:ew)
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(1, :weight=>1)
+
+rtn_proc = proc{|w|
+ r = w.row_index(:active)
+ c = w.col_index(:active)
+
+ if c == 2
+ r += 1
+ w.activate([r,1])
+ else
+ c += 1
+ w.activate([r,c])
+ end
+ w.see(:active)
+ Tk.callback_break
+}
+
+table.bind('Return', rtn_proc, '%W')
+table.bind('KP_Enter', rtn_proc, '%W')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/maxsize.rb b/ext/tk/sample/tkextlib/tktable/maxsize.rb
new file mode 100644
index 0000000000..74e136c49c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/maxsize.rb
@@ -0,0 +1,67 @@
+#!/usr/bin/env ruby
+##
+## maxsize.rb
+##
+## This demo uses a really big table. The big startup time is in
+## filling the table's Tcl array var.
+##
+## ( based on 'maxsize.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+ary = TkVariable.new_hash
+rows = 40000
+cols = 10
+
+# fill table variable
+((-(rows))..rows).each{|x|
+ ((-(cols))..cols).each{|y|
+ ary[x,y] = "#{x},#{y}"
+ }
+}
+
+lbl = TkLabel.new(:text=>"TkTable v2 Example")
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :variable=>ary,
+ :width=>6, :height=>8,
+ :titlerows=>1, :titlecols=>1,
+ :coltagcommand=>proc{|col|
+ col = Integer(col)
+ (col>0 && col%2 == 1)? 'OddCol': ''
+ },
+ :selectmode=>:extended,
+ :colstretch=>:unset, :rowstretch=>:unset,
+ :selecttitles=>false, :drawmode=>:slow)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
+
+Tk.grid(lbl, '-', :sticky=>:ew)
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+Tk.grid(btn, :sticky=>:ew, :columnspan=>2)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(1, :weight=>1)
+
+table.tag_configure('OddCol', :bg=>'brown', :fg=>'pink')
+table.tag_configure('title', :bg=>'red', :fg=>'blue', :relief=>:sunken)
+table.tag_configure('dis', :state=>:disabled)
+
+first = table[:colorigin]
+%w(n s e w nw ne sw se c).each_with_index{|anchor, idx|
+ table.tag_configure(anchor, :anchor=>anchor)
+ table.tag_row(anchor, idx)
+ table.set([idx,first], anchor)
+}
+courier = TkFont.new(:family=>'Courier', :size=>10)
+table.tag_configure('s', :font=>courier, :justify=>:center)
+
+table.set_width([-2, 8], [-1, 9], [0, 12], [4, 14])
+
+puts "Table is #{table.path} with array #{(table['variable'])}"
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/spreadsheet.rb b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
new file mode 100644
index 0000000000..2953b2e597
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/spreadsheet.rb
@@ -0,0 +1,137 @@
+#!/usr/bin/env ruby
+##
+## spreadsheet.rb
+##
+## This demos shows how you can simulate a 3D table
+## and has other basic features to begin a basic spreadsheet
+##
+## ( based on 'spreadsheet.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+rows = 10
+cols = 10
+cur_var = TkVariable.new
+table_list = Hash.new{|hash, key| hash[key] = TkVariable.new_hash}
+page = TkVariable.new('AA')
+color = Hash.new('pink')
+color['AA'] = 'orange'
+color['BB'] = 'blue'
+color['CC'] = 'green'
+
+def colorize(num)
+ num = Integer(num)
+ return 'colored' if (num > 0 && num % 2 == 1)
+end
+
+def fill_table(tbl_list, page, r=10, c=10)
+ ary = tbl_list[page]
+
+ (0...r).each{|i|
+ (0...c).each{|j|
+ if i!=0 && j!=0
+ ary[i,j] = "#{page} #{i},#{j}"
+ elsif i!=0
+ ary[i,j] = i.to_s
+ else
+ ary[i,j] = (64+j).chr
+ end
+ }
+ }
+end
+
+def changepage(tbl_list, tbl, ent, col, var, elem, op)
+ if elem != ''
+ page = var[elem]
+ else
+ page = var.value
+ end
+ if tbl[:variable] != tbl_list[page].id
+ tbl.selection_clear_all
+ tbl.variable(tbl_list[page])
+ ent.textvariable(tbl_list[page].ref('active'))
+ tbl.activate('origin')
+ tbl.tag_configure('colored', :bg=>col[page])
+ tbl.see('active')
+ end
+end
+
+lbl = TkLabel.new(:text=>"TkTable v1 Spreadsheet Example")
+
+current = TkLabel.new(:textvariable=>cur_var, :width=>5)
+entry = TkEntry.new(:textvariable=>table_list[page.value].ref('active'))
+lpage = TkLabel.new(:text=>'PAGE:', :width=>6, :anchor=>:e)
+optmenu = TkOptionMenubutton.new(page, *(%w(AA BB CC DD)))
+
+fill_table(table_list, page.value)
+fill_table(table_list, 'BB', Integer(rows/2), Integer(cols/2))
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :width=>5, :height=>5,
+ :variable=>table_list[page.value],
+ :titlerows=>1, :titlecols=>1,
+ :coltagcommand=>proc{|n| colorize(n)},
+ :flashmode=>true, :selectmode=>:extended,
+ :colstretch=>:unset, :rowstretch=>:unset,
+ :browsecommand=>proc{|e| cur_var.value = e.new_index})
+
+page.trace(:w, proc{|var, elem, op|
+ changepage(table_list, table, entry, color, var, elem, op)
+ })
+
+table.tag_configure('colored', :bg=>color[page.value])
+table.tag_configure('title', :fg=>'red', :relief=>:groove)
+table.tag_configure('blue', :bg=>'blue')
+table.tag_configure('green', :bg=>'green')
+
+table.tag_cell('green', [6,3], [5,7], [4,9])
+table.tag_cell('blue', [8,8])
+table.tag_row('blue', 7)
+table.tag_col('blue', 6, 8)
+table.set_width([0, 3], [2, 7])
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
+
+Tk.grid(lbl, '-', '-', '-', '-', :sticky=>:ew)
+Tk.grid(current, entry, lpage, optmenu, '-', :sticky=>:ew)
+Tk.grid(table, '-', '-', '-', sy, :sticky=>:ns)
+Tk.grid(sx, '-', '-', '-', :sticky=>:ew)
+Tk.grid(btn, '-', '-', '-', '-', :sticky=>:ew)
+
+Tk.root.grid_columnconfig(1, :weight=>1)
+Tk.root.grid_rowconfig(2, :weight=>1)
+
+table.grid_configure(:sticky=>:news)
+
+entry.bind('Return', proc{
+ r = table.row_index(:active)
+ c = table.col_index(:active)
+ rmax = table[:rows]
+ cmax = table[:cols]
+
+ c += 1
+ if c == cmax
+ c = table[:titlecols]
+ r += 1
+ if r == rmax
+ r = table[:titlerows]
+ end
+ end
+ table.activate([r, c])
+ table.see('active')
+ })
+
+menu = TkMenu.new
+m_file = TkMenu.new(menu)
+Tk.root.menu(menu)
+menu.add(:cascade, :label=>'File', :underline=>0, :menu=>m_file)
+m_file.add(:command, :label=>'Fill Array',
+ :command=>proc{ fill_table(table_list, page.value) })
+m_file.add(:command, :label=>'Quit', :command=>proc{exit})
+
+puts "Table is #{table.path} with array #{(table['variable'])}"
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/tktable/tcllogo.gif b/ext/tk/sample/tkextlib/tktable/tcllogo.gif
new file mode 100644
index 0000000000..4603d4ff41
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/tcllogo.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/tktable/valid.rb b/ext/tk/sample/tkextlib/tktable/valid.rb
new file mode 100644
index 0000000000..98e9c3855a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/tktable/valid.rb
@@ -0,0 +1,88 @@
+#!/usr/bin/env ruby
+##
+## valid.rb
+##
+## This demos shows the use of the validation mechanism of the table
+## and uses the table's cache (no -command or -variable)
+##
+## ( based on 'valid.tcl' included source archive of tktable extension )
+##
+require 'tk'
+require 'tkextlib/tktable'
+
+rows = 10
+cols = 10
+
+def colorize(num)
+ num = Integer(num)
+ return 'colored' if (num > 0 && num % 2 == 1)
+end
+
+def fill_headers(w, r=10, c=10)
+ (1..(r-1)).each{|i| w.set([i,0], i.to_s)}
+
+ (1..(c-1)).each{|j|
+ if j % 3 == 1
+ w.set([0,j], 'AlphaNum')
+ elsif j % 2 == 1
+ w.set([0,j], 'Alpha')
+ elsif j != 0
+ w.set([0,j], 'Real')
+ end
+ }
+end
+
+def validate_proc(c, val)
+ if c % 3 == 1
+ # AlphaNum
+ regexp = /^[A-Za-z0-9 ]*$/
+ elsif c % 2 == 1
+ # Alpha
+ regexp = /^[A-Za-z ]*$/
+ elsif c != 0
+ # 'Real'
+ regexp = /^[-+]?[0-9]*\.?[0-9]*([0-9]\.?e[-+]?[0-9]*)?$/
+ end
+ if val =~ regexp
+ return true
+ else
+ Tk.bell
+ return false
+ end
+end
+
+lbl = TkLabel.new(:text=>"TkTable v1 Validated Table Example")
+
+table = Tk::TkTable.new(:rows=>rows, :cols=>cols, :cache=>1,
+ :width=>5, :height=>5, :titlerows=>1, :titlecols=>1,
+ :coltagcommand=>proc{|n| colorize(n)},
+ :flashmode=>true, :selectmode=>:extended,
+ :colstretch=>:unset, :rowstretch=>:unset,
+ :validate=>true,
+ :validatecommand=>proc{|e|
+ unless e.widget.tag_include?('title', e.index)
+ validate_proc(e.column, e.new_value)
+ end } )
+
+fill_headers(table)
+
+table.tag_configure('colored', :bg=>'lightblue')
+table.tag_configure('title', :fg=>'red')
+table.set_width(0,3)
+
+sx = table.xscrollbar(TkScrollbar.new)
+sy = table.yscrollbar(TkScrollbar.new)
+
+btn = TkButton.new(:text=>'Exit', :command=>proc{exit})
+
+Tk.grid(lbl, '-', :sticky=>:ew)
+Tk.grid(table, sy, :sticky=>:news)
+Tk.grid(sx, :sticky=>:ew)
+Tk.grid(btn, '-', :sticky=>:ew)
+
+Tk.root.grid_columnconfig(0, :weight=>1)
+Tk.root.grid_rowconfig(1, :weight=>1)
+
+puts "Table is #{table.path}"
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/treectrl/bitmaps.rb b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
new file mode 100644
index 0000000000..0d8b37b81e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/bitmaps.rb
@@ -0,0 +1,76 @@
+#
+# Demo: Bitmaps
+#
+def demoBitmaps(t)
+ #if $Version_1_1_OrLater
+ if @has_bgimg
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items',
+ :showheader=>false, :backgroundimage=>@images['sky'])
+ else
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:browse, :orient=>:horizontal, :wrap=>'5 items',
+ :showheader=>false)
+ end
+
+ if $HasColumnCreate
+ t.column_create(:itembackground=>['gray90', []])
+ else
+ t.column_configure(0, :itembackground=>['gray90', []])
+ end
+
+ t.element_create('elemTxt', :text,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('elemSelTxt', :rect, :showfocus=>true,
+ :fill=>[@SystemHighlight, ['selected', 'focus']])
+ t.element_create('elemSelBmp', :rect, :outlinewidth=>4,
+ :outline=>[@SystemHighlight, ['selected', 'focus']])
+ t.element_create('elemBmp', :bitmap,
+ :foreground=>[@SystemHighlight, ['selected', 'focus']],
+ :background=>'linen',
+ :bitmap=>['question' ['selected']])
+
+ s = t.style_create('STYLE', :orient=>:vertical)
+ t.style_elements(s, ['elemSelBmp', 'elemBmp', 'elemSelTxt', 'elemTxt'])
+ t.style_layout(s, 'elemSelBmp', :union=>'elemBmp', :ipadx=>6, :ipady=>6)
+ t.style_layout(s, 'elemBmp', :pady=>[0, 6], :expand=>:we)
+ t.style_layout(s, 'elemSelTxt', :union=>'elemTxt', :ipadx=>2)
+ t.style_layout(s, 'elemTxt', :expand=>:we)
+
+ # Set default item style
+ if $Version_1_1_OrLater
+ t.defaultstyle = [s]
+ end
+
+ bitmap_names = %w(error gray75 gray50 gray25 gray12
+ hourglass info questhead question warning)
+
+ bitmap_names.each{|name|
+ i = t.item_create
+ unless $Version_1_1_OrLater
+ t.item_style_set(i, 0, s)
+ end
+ t.item_text(i, 0, name)
+ t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name)
+ t.item_lastchild(:root, i)
+ }
+
+ bitmap_names.each{|name|
+ i = t.item_create
+ t.item_style_set(i, 0, s)
+ t.item_text(i, 0, name)
+ if true
+ t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name,
+ :foreground=>['brown', ''],
+ :background=>['', ''])
+ else
+ t.item_element_configure(i, 0, 'elemBmp', :bitmap=>name,
+ :foreground=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'brown', []
+ ],
+ :background=>['', []])
+ end
+ t.item_lastchild(:root, i)
+ }
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/demo.rb b/ext/tk/sample/tkextlib/treectrl/demo.rb
new file mode 100644
index 0000000000..564a005bdc
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/demo.rb
@@ -0,0 +1,1305 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/treectrl'
+
+$ScriptDir = File.dirname(File.expand_path(__FILE__))
+
+$HasColumnCreate = Tk::TreeCtrl::HasColumnCreateCommand
+
+$Version_1_1_OrLater = (TkPackage.vcompare(Tk::TreeCtrl.package_version, '1.1') >= 0)
+
+#if Hash.instance_methods.include?(:key)
+if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
+ # ruby 1.9.x --> use Hash#key
+ # Because Hash#index show warning "Hash#index is deprecated; use Hash#key".
+else
+ # ruby 1.8.x --> use Hash#index
+ class Hash
+ alias key index
+ end
+end
+
+class TkTreeCtrl_demo
+ def initialize(dir)
+ @ScriptDir = dir || '.'
+
+ @thisPlatform = Tk::PLATFORM['platform']
+ if @thisPlatform == 'unix' && Tk.windowingsystem == 'aqua'
+ @thisPlatform = 'macosx'
+ end
+
+ @RandomN = [500]
+
+ @images = Hash.new
+ @sel_images = Hash.new
+
+ @popup = Hash.new
+ @mTree = Hash.new
+ @mHeader = Hash.new
+
+ @non_clear_list = []
+
+ @demoCmd = Hash.new
+ @demoFile = Hash.new
+
+ # Get default colors
+ w = TkListbox.new
+ @SystemButtonFace = w[:highlightbackground]
+ @SystemHighlight = w[:selectbackground]
+ @SystemHighlightText = w[:selectforeground]
+ w.destroy
+
+ ####################
+
+ make_source_window()
+ make_menubar()
+ make_main_window()
+
+ if $Version_1_1_OrLater
+ begin
+ @tree2[:backgroundimage]
+ @has_bgimg = true
+ rescue
+ @has_bgimg = false
+ end
+ else
+ @has_bgimg = false
+ end
+
+ ####################
+
+ make_list_popup()
+ make_header_popup()
+
+ init_pics('sky')
+
+ ####################
+
+ @tree2.bind('ButtonPress-3',
+ proc{|w, x, y, rootx, rooty|
+ show_list_popup(w, x, y, rootx, rooty)
+ }, '%W %x %y %X %Y')
+
+ # Allow "scan" bindings
+ if @thisPlatform == 'windows'
+ @tree2.bind_remove('Control-ButtonPress-3')
+ end
+
+ ####################
+
+ init_demo_scripts_module()
+ load_demo_scripts()
+ init_demo_list()
+
+ ####################
+
+ @tree1.notify_bind(@tree1, 'Selection',
+ proc{|c, t|
+ if c == 1
+ item = t.selection_get[0]
+ demo_set(@demoCmd[item], @demoFile[item])
+ end
+ }, '%c %T')
+
+ # When one item is selected in the demo list, display the styles in
+ # that item.
+ # See DemoClear for why the tag "DontDelete" is used
+ @tree2.notify_bind('DontDelete', 'Selection',
+ proc{|c, t|
+ display_styles_in_item(t.selection_get[0]) if c == 1
+ }, '%c %T')
+ end
+
+ ##########################
+
+ def init_pics(*args)
+ args.each{|pat|
+ unless TkImage.names.find{|img| (name = @images.key(img)) && File.fnmatch(pat, name)}
+ Dir.glob(File.join(@ScriptDir, 'pics', "#{pat}.gif")).each{|file|
+ name = File.basename(file, '.gif')
+ img = TkPhotoImage.new(:file=>file)
+ @images[name] = img
+ @sel_images[name] = TkPhotoImage.new
+ @sel_images[name].copy(img)
+ Tk::TreeCtrl.image_tint(@sel_images[name], @SystemHighlight, 128)
+ }
+ end
+ }
+ end
+
+ ##########################
+
+ private
+
+ def make_menubar
+ menuspec = [
+ [['File']]
+ ]
+ if Tk::PLATFORM['platform'] != 'unix'
+ TkConsole.create
+ TkConsole.eval('.console conf -height 8')
+ menuspec[0] << ['Console', proc{
+ if TkComm.bool(TkConsole.eval('winfo ismapped .'))
+ TkConsole.hide
+ else
+ TkConsole.show
+ end
+ }]
+ end
+ menuspec[0] << ['View Source', proc{toggle_source_window()}]
+ menuspec[0] << ['Quit', proc{exit}]
+ Tk.root.add_menubar(menuspec)
+ end
+
+ def make_source_window
+ @src_top = TkToplevel.new
+ f = TkFrame.new(@src_top, :borderwidth=>0)
+ case @thisPlatform
+ when 'unix'
+ font = TkFont.new(['Courier', -12])
+ else
+ font = TkFont.new(['Courier', 9])
+ end
+
+ @src_txt = TkText.new(f, :font=>font, :tabs=>font.measure('1234'),
+ :wrap=>:none)
+ xscr = @src_txt.xscrollbar(TkScrollbar.new(f))
+ yscr = @src_txt.yscrollbar(TkScrollbar.new(f))
+
+ f.pack(:expand=>true, :fill=>:both)
+ f.grid_columnconfigure(0, :weight=>1)
+ f.grid_rowconfigure(0, :weight=>1)
+ @src_txt.grid(:row=>0, :column=>0, :sticky=>:news)
+ xscr.grid(:row=>1, :column=>0, :sticky=>:we)
+ yscr.grid(:row=>0, :column=>1, :sticky=>:ns)
+
+ @src_top.protocol('WM_DELETE_WINDOW', proc{@src_top.withdraw})
+ @src_top.geometry('-0+0')
+ @src_top.withdraw
+ end
+
+ def show_source(file)
+ @src_top.title("Demo Source: #{file}")
+ @src_txt.value = IO.read(File.join(@ScriptDir, file))
+ @src_txt.set_insert('1.0')
+ end
+
+ def toggle_source_window
+ if @src_top.winfo_mapped?
+ @src_top.withdraw
+ else
+ @src_top.deiconify
+ end
+ end
+
+ def tree_plus_scrollbars_in_a_frame(parent, h, v)
+ f = TkFrame.new(parent, :borderwidth=>1, :relief=>:sunken)
+ case @thisPlatform
+ when 'unix'
+ font = TkFont.new(['Helvetica', -12])
+ else
+ # There is a bug on my Win98 box with Tk_MeasureChars() and
+ # MS Sans Serif 8.
+ font = TkFont.new(['MS Sans', 8])
+ end
+
+ tree = Tk::TreeCtrl.new(f, :highlightthickness=>0,
+ :borderwidth=>0, :font=>font)
+ tree[:xscrollincrement] = 20
+ tree.debug_configure(:enable=>false, :display=>false)
+
+ if h
+ h_scr = TkScrollbar.new(f, :orient=>:horizontal,
+ :command=>proc{|*args| tree.xview(*args)})
+ tree.notify_bind(h_scr, 'Scroll-x',
+ proc{|w, l, u| w.set(l, u)}, '%W %l %u')
+ h_scr.bind('ButtonPress-1', proc{tree.set_focus})
+ end
+
+ if v
+ v_scr = TkScrollbar.new(f, :orient=>:vertical,
+ :command=>proc{|*args| tree.yview(*args)})
+ tree.notify_bind(v_scr, 'Scroll-y',
+ proc{|w, l, u| w.set(l, u)}, '%W %l %u')
+ v_scr.bind('ButtonPress-1', proc{tree.set_focus})
+ end
+
+ f.grid_columnconfigure(0, :weight=>1)
+ f.grid_rowconfigure(0, :weight=>1)
+ tree.grid(:row=>0, :column=>0, :sticky=>:news)
+ h_scr.grid(:row=>1, :column=>0, :sticky=>:we) if h
+ v_scr.grid(:row=>0, :column=>1, :sticky=>:ns) if v
+
+ [f, tree]
+ end
+
+ def make_main_window
+ Tk.root.title('Tk::TreeCtrl Demo')
+
+ case @thisPlatform
+ when 'macosx'
+ Tk.root.geometry('+40+40')
+ else
+ Tk.root.geometry('+0+30')
+ end
+
+ pane1 = TkPanedWindow.new(:orient=>:vertical, :borderwidth=>0)
+ pane2 = TkPanedWindow.new(:orient=>:horizontal, :borderwidth=>0)
+
+ # Tree + scrollbar: demos
+ f1, @tree1 = tree_plus_scrollbars_in_a_frame(nil, false, true)
+ @tree1.configure(:showbuttons=>false, :showlines=>:false,
+ :showroot=>false, :height=>100)
+ if $HasColumnCreate
+ @tree1.column_create(:text=>'List of Demos',
+ :expand=>true, :button=>false)
+ else
+ @tree1.column_configure(0, :text=>'List of Demos',
+ :expand=>true, :button=>false)
+ end
+
+ # Tree + scrollbar: styles + elements in list
+ f4, @tree4 = tree_plus_scrollbars_in_a_frame(nil, false, true)
+ @tree4.configure(:showroot=>false, :height=>140)
+ if $HasColumnCreate
+ @tree4.column_create(:text=>'Elements and Styles',
+ :expand=>true, :button=>false)
+ else
+ @tree4.column_configure(0, :text=>'Elements and Styles',
+ :expand=>true, :button=>false)
+ end
+
+ # Tree + scrollbar: styles + elements in selected item
+ f3, @tree3 = tree_plus_scrollbars_in_a_frame(nil, false, true)
+ @tree3.configure(:showroot=>false)
+ if $HasColumnCreate
+ @tree3.column_create(:text=>'Styles in Item',
+ :expand=>true, :button=>false)
+ else
+ @tree3.column_configure(0, :text=>'Styles in Item',
+ :expand=>true, :button=>false)
+ end
+
+ pane1.add(f1, f4, f3, :height=>150)
+ pane1.pack(:expand=>true, :fill=>:both)
+
+ # Frame on right
+ f2_base = TkFrame.new
+
+ # Tree + scrollbars
+ f2, @tree2 = tree_plus_scrollbars_in_a_frame(f2_base, true, true)
+ @tree2.configure(:indent=>19)
+ @tree2.debug_configure(:enable=>false, :display=>true,
+ :erasecolor=>'pink', :displaydelay=>30)
+
+ # Give it a big border to debug drawing
+ @tree2.configure(:borderwidth=>6, :relief=>:ridge, :highlightthickness=>3)
+
+ f2_base.grid_columnconfigure(0, :weight=>1)
+ f2_base.grid_rowconfigure(0, :weight=>1)
+ f2.grid(:row=>0, :column=>0, :sticky=>:news, :pady=>0)
+
+ pane2.add(pane1, :width=>200)
+ pane2.add(f2_base, :width=>450)
+
+ pane2.pack(:expand=>true, :fill=>:both)
+
+ ###
+ # A treectrl widget can generate the following built-in events:
+ # <ActiveItem> called when the active item changes
+ # <Collapse-before> called before an item is closed
+ # <Collapse-after> called after an item is closed
+ # <Expand-before> called before an item is opened
+ # <Expand-after> called after an item is opened
+ # <Selection> called when items are added to or removed from the selection
+ # <Scroll-x> called when horizontal scroll position changes
+ # <Scroll-y> called when vertical scroll position changes
+ #
+ # The application programmer can define custom events to be
+ # generated by the "T notify generate" command. The following events
+ # are generated by the example bindings.
+
+ @tree2.notify_install_event('Header')
+ @tree2.notify_install_detail('Header', 'invoke')
+
+ @tree2.notify_install_event('Drag')
+ @tree2.notify_install_detail('Drag', 'begin')
+ @tree2.notify_install_detail('Drag', 'end')
+ @tree2.notify_install_detail('Drag', 'receive')
+
+ @tree2.notify_install_event('Edit')
+ @tree2.notify_install_detail('Edit', 'accept')
+ end
+
+ def make_list_popup
+ @popup[:bgimg] = TkVariable.new
+ @popup[:bgmode] = TkVariable.new
+ @popup[:debug] = Hash.new{|h, k| h[k] = TkVariable.new}
+ @popup[:doublebuffer] = TkVariable.new
+ @popup[:linestyle] = TkVariable.new
+ @popup[:orient] = TkVariable.new
+ @popup[:selectmode] = TkVariable.new
+ @popup[:show] = Hash.new{|h, k| h[k] = TkVariable.new}
+
+ menuspec = [
+ [ 'Collapse', [], nil, '', {:menu_config=>{:tearoff=>false}} ],
+
+ [ 'Expand', [], nil, '', {:menu_config=>{:tearoff=>false}} ]
+ ]
+
+ # if $Version_1_1_OrLater
+ if @has_bgimg
+ menuspec << \
+ [ 'Background Image',
+ [
+ [ 'none', [@popup[:bgimg], 'none'], nil, '',
+ {:command=>proc{@tree2.backgroundimage = ''}} ],
+ [ 'sky', [@popup[:bgimg], 'sky'], nil, '',
+ {:command=>proc{
+ @tree2.backgroundimage = @images[@popup[:bgimg].value]}} ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ]
+ end
+
+ menuspec.concat([
+ [ 'Background Mode',
+ %w(column index row visindex).collect{|val|
+ [ val, [@popup[:bgmode], val] , nil, '',
+ {:command=>proc{@tree2.backgroundmode = @popup[:bgmode].value}} ]
+ },
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Debug',
+ [
+ [ 'Data', @popup[:debug][:data], nil, '',
+ {:command=>proc{
+ @tree2.debug_configure(:data=>@popup[:debug][:data].value)
+ }
+ } ],
+ [ 'Display', @popup[:debug][:display], nil, '',
+ {:command=>proc{
+ @tree2.debug_configure(:display=>@popup[:debug][:display].value)
+ }
+ } ],
+ [ 'Enable', @popup[:debug][:enable], nil, '',
+ {:command=>proc{
+ @tree2.debug_configure(:enable=>@popup[:debug][:enable].value)
+ }
+ } ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Buffering',
+ [
+ [ 'none', [@popup[:doublebuffer], 'none'], nil, '',
+ {:command=>proc{
+ @tree2.doublebuffer = @popup[:doublebuffer].value
+ }
+ } ],
+ [ 'item', [@popup[:doublebuffer], 'item'], nil, '',
+ {:command=>proc{
+ @tree2.doublebuffer = @popup[:doublebuffer].value
+ }
+ } ],
+ [ 'window', [@popup[:doublebuffer], 'window'], nil, '',
+ {:command=>proc{
+ @tree2.doublebuffer = @popup[:doublebuffer].value
+ }
+ } ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Line style',
+ [
+ [ 'dot', [@popup[:linestyle], 'dot'], nil, '',
+ {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ],
+ [ 'solid', [@popup[:linestyle], 'solid'], nil, '',
+ {:command=>proc{@tree2.linestyle = @popup[:linestyle].value}} ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Orient',
+ [
+ [ 'Horizontal', [@popup[:orient], 'horizontal'], nil, '',
+ {:command=>proc{@tree2.orient = @popup[:orient].value}} ],
+ [ 'Vertical', [@popup[:orient], 'vertical'], nil, '',
+ {:command=>proc{@tree2.orient = @popup[:orient].value}} ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Selectmode',
+ %w(list browse extended multiple single).collect{|val|
+ [ val, [@popup[:selectmode], val] , nil, '',
+ {:command=>proc{@tree2.selectmode = @popup[:selectmode].value}} ]
+ },
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Show',
+ [
+ [ 'Buttons', @popup[:show][:buttons], nil, '',
+ {:command=>proc{
+ @tree2.showbuttons = @popup[:show][:buttons].value
+ }
+ } ],
+ [ 'Header', @popup[:show][:header], nil, '',
+ {:command=>proc{
+ @tree2.showheader = @popup[:show][:header].value
+ }
+ } ],
+ [ 'Lines', @popup[:show][:lines], nil, '',
+ {:command=>proc{
+ @tree2.showlines = @popup[:show][:lines].value
+ }
+ } ],
+ [ 'Root', @popup[:show][:root], nil, '',
+ {:command=>proc{
+ @tree2.showroot = @popup[:show][:root].value
+ }
+ } ],
+ [ 'Root Button', @popup[:show][:rootbutton], nil, '',
+ {:command=>proc{
+ @tree2.showrootbutton = @popup[:show][:rootbutton].value
+ }
+ } ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}}
+ ],
+
+ [ 'Visible', [], nil, '', {:menu_config=>{:tearoff=>false}} ]
+ ])
+
+ m = TkMenu.new_menuspec(menuspec, @tree2, false)
+ @non_clear_list << m
+ @mTree[@tree2] = m
+ end
+
+ def show_list_popup(w, x, y, rootx, rooty)
+ id = w.identify(x, y)
+ unless id.empty?
+ if id[0] == 'header'
+ col = id[1]
+ @popup[:column].value = col
+ @popup[:arrow].value = w.column_cget(col, :arrow)
+ @popup[:arrowside].value = w.column_cget(col, :arrowside)
+ @popup[:arrowgravity].value = w.column_cget(col, :arrowgravity)
+ @popup[:expand].value = w.column_cget(col, :expand)
+ @popup[:squeeze].value = w.column_cget(col, :squeeze)
+ @popup[:justify].value = w.column_cget(col, :justify)
+ @mHeader[w].popup(rootx, rooty)
+ return
+ end
+ end
+
+ m = @mTree[w].entrycget('Collapse', :menu)
+ m.delete(0, :end)
+ if $Version_1_1_OrLater
+ m.add_command(:label=>'All', :command=>proc{w.item_collapse(:all)})
+ else
+ m.add_command(:label=>'All', :command=>proc{w.collapse(:all)})
+ end
+ unless id.empty?
+ if id[0] == 'item'
+ item = id[1]
+ if $Version_1_1_OrLater
+ m.add_command(:label=>"Item #{item}",
+ :command=>proc{w.item_collapse(item)})
+ m.add_command(:label=>"Item #{item} (recurse)",
+ :command=>proc{w.item_collapse_recurse(item)})
+ else
+ m.add_command(:label=>"Item #{item}",
+ :command=>proc{w.collapse(item)})
+ m.add_command(:label=>"Item #{item} (recurse)",
+ :command=>proc{w.collapse_recurse(item)})
+ end
+ end
+ end
+
+ m = @mTree[w].entrycget('Expand', :menu)
+ m.delete(0, :end)
+ if $Version_1_1_OrLater
+ m.add_command(:label=>'All', :command=>proc{w.item_expand(:all)})
+ else
+ m.add_command(:label=>'All', :command=>proc{w.expand(:all)})
+ end
+ unless id.empty?
+ if id[0] == 'item'
+ item = id[1]
+ if $Version_1_1_OrLater
+ m.add_command(:label=>"Item #{item}",
+ :command=>proc{w.item_expand(item)})
+ m.add_command(:label=>"Item #{item} (recurse)",
+ :command=>proc{w.item_expand_recurse(item)})
+ else
+ m.add_command(:label=>"Item #{item}",
+ :command=>proc{w.expand(item)})
+ m.add_command(:label=>"Item #{item} (recurse)",
+ :command=>proc{w.expand_recurse(item)})
+ end
+ end
+ end
+
+ [:data, :display, :enable].each{|k|
+ @popup[:debug][k].value = w.debug_cget(k)
+ }
+ # if $Version_1_1_OrLater
+ if @has_bgimg
+ @popup[:bgimg].value = @images.key(w[:backgroundimage])
+ end
+ @popup[:bgmode].value = w[:backgroundmode]
+ @popup[:doublebuffer].value = w[:doublebuffer]
+ @popup[:linestyle].value = w[:linestyle]
+ @popup[:orient].value = w[:orient]
+ @popup[:selectmode].value = w[:selectmode]
+ @popup[:show][:buttons].value = w[:showbuttons]
+ @popup[:show][:header].value = w[:showheader]
+ @popup[:show][:lines].value = w[:showlines]
+ @popup[:show][:root].value = w[:showroot]
+ @popup[:show][:rootbutton].value = w[:showrootbutton]
+
+ m = @mTree[w].entrycget('Visible', :menu)
+ m.delete(0, :end)
+ @popup[:visible] = []
+ (0...(w.numcolumns)).each{|i|
+ @popup[:visible][i] = TkVariable.new(w.column_cget(i, :visible))
+ txt = w.column_cget(i, :text)
+ img_name = w.column_cget(i, :image)
+ img_name = @images.key(img_name) if img_name.kind_of?(TkImage)
+ m.add_checkbutton(:variable=>@popup[:visible][i],
+ :label=>"Column #{i} \"#{txt}\" [#{img_name}]",
+ :command=>proc{w.column_configure(i, :visible=>@popup[:visible][i].value)})
+ }
+
+ @mTree[w].popup(rootx, rooty)
+ end
+
+ def make_header_popup
+ @popup[:column] = TkVariable.new unless @popup[:column]
+ @popup[:arrow] = TkVariable.new
+ @popup[:arrowside] = TkVariable.new
+ @popup[:arrowgravity] = TkVariable.new
+ @popup[:expand] = TkVariable.new
+ @popup[:squeeze] = TkVariable.new
+ @popup[:justify] = TkVariable.new
+
+ menuspec = [
+ [ 'Arrow',
+ [
+ [ 'None', [@popup[:arrow], 'none'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value, :arrow=>:none)
+ }
+ } ],
+ [ 'Up', [@popup[:arrow], 'up'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value, :arrow=>:up)
+ }
+ } ],
+ [ 'Down', [@popup[:arrow], 'down'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value, :arrow=>:down)
+ }
+ } ],
+
+ '---',
+
+ [ 'Side Left', [@popup[:arrowside], 'left'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :arrowside=>:left)
+ }
+ } ],
+ [ 'Side Right', [@popup[:arrowside], 'right'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :arrowside=>:right)
+ }
+ } ],
+
+ '---',
+
+ [ 'Gravity Left', [@popup[:arrowgravity], 'left'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :arrowgravity=>:left)
+ }
+ } ],
+ [ 'Gravity Right', [@popup[:arrowgravity], 'right'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :arrowgravity=>:right)
+ }
+ } ],
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}} ],
+
+ [ 'Expand', @popup[:expand], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :expand=>@popup[:expand].value)
+ }
+ } ],
+
+ [ 'Squeeze', @popup[:squeeze], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :squeeze=>@popup[:squeeze].value)
+ }
+ } ],
+
+ [ 'Justify',
+ [
+ [ 'Left', [@popup[:justify], 'left'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value, :justify=>:left)
+ }
+ } ],
+ [ 'Center', [@popup[:justify], 'center'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :justify=>:center)
+ }
+ } ],
+ [ 'Right', [@popup[:justify], 'right'], nil, '',
+ {:command=>proc{
+ @tree2.column_configure(@popup[:column].value,
+ :justify=>:right)
+ }
+ } ]
+ ],
+ nil, '', {:menu_config=>{:tearoff=>false}} ]
+ ]
+
+ m = TkMenu.new_menuspec(menuspec, @tree2, false)
+ @non_clear_list << m
+ @mHeader[@tree2] = m
+ end
+
+ ###########################
+
+ def init_demo_scripts_module
+ @demo_scripts = Module.new
+
+ master = self
+
+ has_bgimg = @has_bgimg
+
+ scriptDir = @ScriptDir
+
+ thisPlatform = @thisPlatform
+
+ randomN = @RandomN
+
+ images = @images
+ sel_images = @sel_images
+
+ systemButtonFace = @SystemButtonFace
+ systemHighlight = @SystemHighlight
+ systemHighlightText = @SystemHighlightText
+
+ def master._pub_display_styles_in_item(item)
+ display_styles_in_item(item)
+ end
+ proc_disp_styles_in_item = proc{|item|
+ master._pub_display_styles_in_item(item)
+ }
+
+ @demo_scripts.instance_eval{
+ @master = master
+
+ @has_bgimg = has_bgimg
+
+ @display_styles_in_item = proc_disp_styles_in_item
+
+ @Priv = TkVarAccess.new('::TreeCtrl::Priv')
+
+ @ScriptDir = scriptDir
+
+ @thisPlatform = thisPlatform
+
+ @RandomN = randomN
+
+ @images = images
+ @sel_images = sel_images
+
+ @SystemButtonFace = systemButtonFace
+ @SystemHighlight = systemHighlight
+ @SystemHighlightText = systemHighlightText
+ }
+
+ class << @demo_scripts
+ def _get_binding
+ binding
+ end
+ private :_get_binding
+
+ def load_demo(file)
+ puts "load \"#{file}\"" if $DEBUG
+ begin
+ eval(IO.readlines(file).join, _get_binding())
+ rescue Exception => e
+ bt = e.backtrace
+
+ if bt[0] =~ /^([^:]+):(\d+):/
+ errline = $2.to_i
+ else
+ raise e
+ end
+
+ if bt[1] =~ /^([^:]+):(\d+):/
+ bt.unshift("#{file}:#{errline - $2.to_i + 1}")
+ raise e
+ else
+ raise e
+ end
+ end
+ end
+
+ def init_pics(*args)
+ @master.init_pics(*args)
+ end
+ end
+ end
+
+ def load_demo_scripts
+ # demo sources
+ [
+ 'bitmaps',
+ 'explorer',
+ 'help',
+ 'imovie',
+ 'layout',
+ 'mailwasher',
+ 'outlook-folders',
+ 'outlook-newgroup',
+ 'random',
+ 'www-options'
+ ].each{|f|
+ @demo_scripts.load_demo(File.join(@ScriptDir, "#{f}.rb"))
+ }
+ end
+
+ ###########################
+
+ def init_demo_list
+ @tree1.element_create('e1', :text,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ @tree1.element_create('e2', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus'],
+ ])
+ @tree1.style_create('s1')
+ @tree1.style_elements('s1', ['e2', 'e1'])
+
+ # Tk listbox has linespace + 1 height
+ @tree1.style_layout('s1', 'e2', :union=>['e1'],
+ :ipadx=>2, :ipady=>[0, 1], :iexpand=>:e)
+
+ if $Version_1_1_OrLater
+ @tree1.defaultstyle = 's1'
+ end
+
+ ###
+ [
+ ["Random #{@RandomN[0]} Items", :demoRandom, 'random.rb'],
+ ["Random #{@RandomN[0]} Items, Button Images", :demoRandom2, 'random.rb'],
+ ["Outlook Express (Folders)", :demoOutlookFolders, 'outlook-folders.rb'],
+ ["Outlook Express (Newsgroup)", :demoOutlookNewsgroup, 'outlook-newgroup.rb'],
+ ["Explorer (Details)", :demoExplorerDetails, 'explorer.rb'],
+ ["Explorer (List)", :demoExplorerList, 'explorer.rb'],
+ ["Explorer (Large icons)", :demoExplorerLargeIcons, 'explorer.rb'],
+ ["Explorer (Small icons)", :demoExplorerSmallIcons, 'explorer.rb'],
+ ["Internet Options", :demoInternetOptions, 'www-options.rb'],
+ ["Help Contents", :demoHelpContents, 'help.rb'],
+ ["Layout", :demoLayout, 'layout.rb'],
+ ["MailWasher", :demoMailWasher, 'mailwasher.rb'],
+ ["Bitmaps", :demoBitmaps, 'bitmaps.rb'],
+ ["iMovie", :demoIMovie, 'imovie.rb']
+ ].each{|label, cmd, file|
+ item = @tree1.item_create
+ @tree1.item_lastchild(:root, item)
+ unless $Version_1_1_OrLater
+ @tree1.item_style_set(item, 0, 's1')
+ end
+ @tree1.item_text(item, 0, label)
+ @demoCmd[item] = cmd
+ @demoFile[item] = file
+ }
+
+ @tree1.yview_moveto(0.0)
+ end
+
+ def demo_set(cmd, file)
+ demo_clear()
+ clicks = Tk::Clock.clicks
+ @demo_scripts.__send__(cmd, @tree2)
+ clicks = Tk::Clock.clicks - clicks
+ puts "set list in #{'%.2g'%(clicks/1000000.0)} seconds (#{clicks} clicks)"
+ @tree2.xview_moveto(0)
+ @tree2.yview_moveto(0)
+ Tk.update
+ display_styles_in_list()
+ show_source(file)
+ end
+
+ def display_styles_in_list
+ # Create elements and styles the first time this is called
+ if @tree4.style_names.empty?
+ @tree4.element_create('e1', :text,
+ :fill=>[@SystemHighlightText,['selected','focus']])
+ @tree4.element_create('e2', :text,
+ :fill=>[
+ @SystemHighlightText, ['selected','focus'],
+ '', ['selected','!focus'],
+ 'blue', []
+ ])
+ @tree4.element_create('e3', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected','focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ @tree4.style_create('s1')
+ @tree4.style_elements('s1', ['e3', 'e1'])
+ @tree4.style_layout('s1', 'e3', :union=>['e1'], :ipadx=>1, :ipady=>[0,1])
+
+ @tree4.style_create('s2')
+ @tree4.style_elements('s2', ['e3', 'e1', 'e2'])
+ @tree4.style_layout('s2', 'e1', :padx=>[0,4])
+ @tree4.style_layout('s2', 'e3', :union=>['e1', 'e2'],
+ :ipadx=>1, :ipady=>[0,1])
+ end
+
+ # Clear the list
+ @tree4.item_delete(:all)
+
+ # One item for each element in the demo list
+ @tree2.element_names.sort.each{|elem|
+ if $Version_1_1_OrLater
+ item = @tree4.item_create(:button=>true)
+ @tree4.item_collapse(item)
+ else
+ item = @tree4.item_create
+ @tree4.item_hasbutton(item, true)
+ @tree4.collapse(item)
+ end
+ @tree4.item_style_set(item, 0, 's1')
+ @tree4.item_text(item, 0,
+ "Element #{elem} (#{@tree2.element_type(elem)})")
+
+ # One item for each configuration option for this element
+ @tree2.element_configinfo(elem).each{|name, x, y, default, current|
+ item2 = @tree4.item_create
+
+ if default == current
+ @tree4.item_style_set(item2, 0, 's1')
+ @tree4.item_complex(item2, [
+ ['e1', {:text=>"#{name} #{current.inspect}"}]
+ ])
+ else
+ @tree4.item_style_set(item2, 0, 's2')
+ @tree4.item_complex(item2, [
+ ['e1', {:text=>name}],
+ ['e2', {:text=>current.inspect}]
+ ])
+ end
+
+ @tree4.item_lastchild(item, item2)
+ }
+
+ @tree4.item_lastchild(:root, item)
+ }
+
+ # One item for each style in the demo list
+ @tree2.style_names.sort.each{|sty|
+ if $Version_1_1_OrLater
+ item = @tree4.item_create(:button=>true)
+ @tree4.item_collapse(item)
+ else
+ item = @tree4.item_create
+ @tree4.item_hasbutton(item, true)
+ @tree4.collapse(item)
+ end
+ @tree4.item_style_set(item, 0, 's1')
+ @tree4.item_text(item, 0, "Style #{sty}")
+
+ # One item for each element in the style
+ @tree2.style_elements(sty).each{|elem|
+ if $Version_1_1_OrLater
+ item2 = @tree4.item_create(:button=>true)
+ @tree4.item_collapse(item2)
+ else
+ item2 = @tree4.item_create
+ @tree4.item_hasbutton(item2, true)
+ @tree4.collapse(item2)
+ end
+ @tree4.item_style_set(item2, 0, 's1')
+ @tree4.item_text(item2, 0,
+ "Element #{elem} (#{@tree2.element_type(elem)})")
+
+ # One item for each layout option for this element in this style
+ @tree2.style_layout(sty, elem).each{|k, v|
+ item3 = @tree4.item_create
+ unless $Version_1_1_OrLater
+ @tree4.item_hasbutton(item3, false)
+ end
+ @tree4.item_style_set(item3, 0, 's1')
+ @tree4.item_text(item3, 0, "#{k} #{v.inspect}")
+ @tree4.item_lastchild(item2, item3)
+ }
+
+ @tree4.item_lastchild(item, item2)
+ }
+
+ @tree4.item_lastchild(:root, item)
+ }
+
+ @tree4.xview_moveto(0)
+ @tree4.yview_moveto(0)
+ end
+
+ def display_styles_in_item(item)
+ @tree3.column_configure(0, :text=>"Styles in item #{@tree2.index(item)}")
+
+ # Create elements and styles the first time this is called
+ if @tree3.style_names.empty?
+ @tree3.element_create('e1', :text,
+ :fill=>[@SystemHighlightText,['selected','focus']])
+ @tree3.element_create('e2', :text,
+ :fill=>[
+ @SystemHighlightText, ['selected','focus'],
+ '', ['selected','!focus'],
+ 'blue', []
+ ])
+ @tree3.element_create('e3', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected','focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ @tree3.style_create('s1')
+ @tree3.style_elements('s1', ['e3', 'e1'])
+ @tree3.style_layout('s1', 'e3', :union=>['e1'], :ipadx=>1, :ipady=>[0,1])
+
+ @tree3.style_create('s2')
+ @tree3.style_elements('s2', ['e3', 'e1', 'e2'])
+ @tree3.style_layout('s2', 'e1', :padx=>[0,4])
+ @tree3.style_layout('s2', 'e3', :union=>['e1', 'e2'],
+ :ipadx=>1, :ipady=>[0,1])
+ end
+ # Clear the list
+ @tree3.item_delete(:all)
+
+ # One item for each item-column
+ column = 0
+ @tree2.item_style_set(item).each{|sty|
+ item2 = @tree3.item_create
+ if $Version_1_1_OrLater
+ @tree3.item_collapse(item2)
+ else
+ @tree3.collapse(item2)
+ end
+ @tree3.item_style_set(item2, 0, 's1')
+ @tree3.item_element_configure(item2, 0, 'e1',
+ :text=>"Column #{column}: Style #{sty}")
+
+ button = false
+
+ # One item for each element in this style
+ unless sty.to_s.empty?
+ @tree2.item_style_elements(item, column).each{|elem|
+ button = true
+ if $Version_1_1_OrLater
+ item3 = @tree3.item_create(:button=>true)
+ else
+ item3 = @tree3.item_create
+ @tree3.item_hasbutton(item3, true)
+ end
+ if $Version_1_1_OrLater
+ @tree3.item_collapse(item3)
+ else
+ @tree3.collapse(item3)
+ end
+ @tree3.item_style_set(item3, 0, 's1')
+ @tree3.item_element_configure(item3, 0, 'e1',
+ :text=>"Element #{elem} (#{@tree2.element_type(elem)})")
+
+ # One item for each configuration option in this element
+ @tree2.item_element_configinfo(item, column, elem) \
+ .each{|name, x, y, default, current|
+ item4 = @tree3.item_create
+ masterDefault = @tree2.element_cget(elem, name)
+ sameAsMaster = (masterDefault == current)
+ if !sameAsMaster && current == ''
+ sameAsMaster = true
+ current = masterDefault
+ end
+
+ if sameAsMaster
+ @tree3.item_style_set(item4, 0, 's1')
+ @tree3.item_complex(item4, [
+ ['e1',
+ {:text=>"#{name} #{current.inspect}"}]
+ ])
+ else
+ @tree3.item_style_set(item4, 0, 's2')
+ @tree3.item_complex(item4, [
+ ['e1', {:text=>name}],
+ ['e2', {:text=>current.inspect}]
+ ])
+ end
+ @tree3.item_lastchild(item3, item4)
+ }
+ @tree3.item_lastchild(item2, item3)
+ }
+ if $Version_1_1_OrLater
+ @tree3.item_configure(item2, :button=>true) if button
+ else
+ @tree3.item_hasbutton(item2, true) if button
+ end
+ end
+ @tree3.item_lastchild(:root, item2)
+ column += 1
+ }
+
+ @tree3.xview_moveto(0)
+ @tree3.yview_moveto(0)
+ end
+
+ def demo_clear
+ # Clear the demo list
+ @tree2.item_delete(:all)
+
+ # Clear all bindings on the demo list added by the previous demo.
+ # This is why DontDelete is used for the <Selection> binding.
+ @tree2.notify_bindinfo(@tree2).each{|ev|
+ @tree2.notify_bind_remove(@tree2, ev)
+ }
+
+ # Clear all run-time states
+ @tree2.state_names.each{|st| @tree2.state_undefine(st) }
+
+ # Clear the styles-in-item list
+ @tree3.item_delete(:all)
+
+ # Delete columns in demo list
+ while (@tree2.numcolumns > 0)
+ @tree2.column_delete(0)
+ end
+
+ # Delete all styles in demo list
+ @tree2.style_delete(*(@tree2.style_names))
+
+ # Delete all elements in demo list
+ @tree2.element_delete(*(@tree2.element_names))
+
+ if $Version_1_1_OrLater
+ @tree2.item_configure(:root, :button=>false)
+ @tree2.item_expand(:root)
+ else
+ @tree2.item_hasbutton(:root, false)
+ @tree2.expand(:root)
+ end
+
+ # Restore some happy defaults to the demo list
+ # if $Version_1_1_OrLater
+ if @has_bgimg
+ @tree2.configure(:orient=>:vertical, :wrap=>'',
+ :xscrollincrement=>0, :yscrollincrement=>0,
+ :itemheight=>0, :showheader=>true,
+ :background=>'white', :scrollmargin=>0,
+ :xscrolldelay=>50, :yscrolldelay=>50,
+ :openbuttonimage=>'', :closedbuttonimage=>'',
+ :backgroundmode=>:row, :treecolumn=>0, :indent=>19,
+ :defaultstyle=>'', :backgroundimage=>'')
+ else
+ @tree2.configure(:orient=>:vertical, :wrap=>'',
+ :xscrollincrement=>0, :yscrollincrement=>0,
+ :itemheight=>0, :showheader=>true,
+ :background=>'white', :scrollmargin=>0,
+ :xscrolldelay=>50, :yscrolldelay=>50,
+ :openbuttonimage=>'', :closedbuttonimage=>'',
+ :backgroundmode=>:row, :treecolumn=>0, :indent=>19)
+ end
+
+ # Restore default bindings to the demo list
+ @tree2.bindtags = [ @tree2, Tk::TreeCtrl, @tree2.winfo_toplevel, :all ]
+
+ @tree2.winfo_children.each{|w|
+ w.destroy unless @non_clear_list.include?(w)
+ }
+ end
+end
+
+TkTreeCtrl_demo.new($ScriptDir)
+
+##############################################
+
+def cursor_window(top = nil)
+ top.destroy if top.kind_of?(TkWindow) && top.winfo_exist?
+ top = TkToplevel.new(:title=>'Cursor Window')
+
+ c = TkCanvas.new(top, :background=>'white',
+ :width=>50*10, :highlightthickness=>0,
+ :borderwidth=>0).pack(:expand=>true, :fill=>:both)
+ cursors = %w(
+ X_cursor
+ arrow
+ based_arrow_down
+ based_arrow_up
+ boat
+ bogosity
+ bottom_left_corner
+ bottom_right_corner
+ bottom_side
+ bottom_tee
+ box_spiral
+ center_ptr
+ circle
+ clock
+ coffee_mug
+ cross
+ cross_reverse
+ crosshair
+ diamond_cross
+ dot
+ dotbox
+ double_arrow
+ draft_large
+ draft_small
+ draped_box
+ exchange
+ fleur
+ gobbler
+ gumby
+ hand1
+ hand2
+ heart
+ icon
+ iron_cross
+ left_ptr
+ left_side
+ left_tee
+ leftbutton
+ ll_angle
+ lr_angle
+ man
+ middlebutton
+ mouse
+ pencil
+ pirate
+ plus
+ question_arrow
+ right_ptr
+ right_side
+ right_tee
+ rightbutton
+ rtl_logo
+ sailboat
+ sb_down_arrow
+ sb_h_double_arrow
+ sb_left_arrow
+ sb_right_arrow
+ sb_up_arrow
+ sb_v_double_arrow
+ shuttle
+ sizing
+ spider
+ spraycan
+ star
+ target
+ tcross
+ top_left_arrow
+ top_left_corner
+ top_right_corner
+ top_side
+ top_tee
+ trek
+ ul_angle
+ umbrella
+ ur_angle
+ watch
+ xterm
+ )
+
+ orig_cursor = c.cursor
+ col = 0
+ row = 0
+
+ cursors.each{|cur|
+ x = col * 50
+ y = row * 40
+
+ begin
+ c.cursor = cur
+
+ r = TkcRectangle.new(c, x, y, x+50, y+40,
+ :fill=>'gray90', :outline=>'black', :width=>2)
+ t = TkcText.new(c, x+50/2, y+4, :text=>cur, :anchor=>:n, :width=>42)
+
+ col += 1
+ if col >= 10
+ col = 0
+ row += 1
+ end
+
+ r.bind('Enter', proc{c.cursor = cur; r.fill = 'linen'})
+ r.bind('Leave', proc{c.cursor = ''; r.fill = 'gray90'})
+
+ t.bind('Enter', proc{c.cursor = cur})
+ t.bind('Leave', proc{c.cursor = ''})
+ rescue
+ c.cursor = orig_cursor
+ end
+ }
+
+ c.cursor = orig_cursor
+ c.height = (row + 1) * 40
+end
+
+cursor_window()
+
+##############################################
+
+# A little screen magnifier for X11
+if Tk::PLATFORM['platform'] == 'unix' && Tk.windowingsystem != 'aqua'
+ def show_loupe(setting=nil)
+ loupe = (setting.kind_of?(Hash))? setting: {}
+ loupe[:zoom] = 3 unless loupe[:zoom]
+ loupe[:x] = 0 unless loupe[:x]
+ loupe[:y] = 0 unless loupe[:y]
+ loupe[:auto] = true unless loupe[:auto]
+ loupe[:delay] = 500 unless loupe[:delay]
+ loupe[:image] =
+ TkPhotoImage.new(:width=>150, :height=>150) unless loupe[:image]
+
+ top = TkToplevel.new(:geometry=>'-0+30',
+ :title=>'A little screen magnifier for X11')
+ TkLabel.new(top, :image=>loupe[:image]).pack
+
+ TkTimer.new(proc{loupe[:delay]}, -1, proc{
+ x, y = TkWinfo.pointerxy(Tk.root)
+ if loupe[:auto] || loupe[:x] != x || loupe[:y] != y
+ w = loupe[:image].width
+ h = loupe[:image].height
+ Tk::TreeCtrl.loupe(loupe[:image], x, y, w, h, loupe[:zoom])
+ loupe[:x] = x
+ loupe[:y] = y
+ end
+ }).start
+ end
+
+ show_loupe()
+end
+
+##############################################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/treectrl/explorer.rb b/ext/tk/sample/tkextlib/treectrl/explorer.rb
new file mode 100644
index 0000000000..1b8c2a8287
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/explorer.rb
@@ -0,0 +1,430 @@
+
+def demoExplorerAux(t, dir_proc, file_proc)
+ base_dir = File.dirname(File.dirname(@ScriptDir))
+
+ clicks = Tk::Clock.clicks
+ globDirs = Dir.glob(File.join(base_dir, '*')).find_all{|file|
+ FileTest.directory?(file)
+ }
+ clickGlobDirs = Tk::Clock.clicks - clicks
+
+ clicks = Tk::Clock.clicks
+ list = globDirs.sort
+ clickSortDirs = Tk::Clock.clicks - clicks
+
+ clicks = Tk::Clock.clicks
+ list.each{|file| dir_proc.call(file)}
+ clickAddDirs = Tk::Clock.clicks - clicks
+
+ clicks = Tk::Clock.clicks
+ globFiles = Dir.glob(File.join(base_dir, '*')).find_all{|file|
+ FileTest.file?(file)
+ }
+ clickGlobFiles = Tk::Clock.clicks - clicks
+
+ clicks = Tk::Clock.clicks
+ list = globFiles.sort
+ clickSortFiles = Tk::Clock.clicks - clicks
+
+ clicks = Tk::Clock.clicks
+ list.each{|file| file_proc.call(file)}
+ clickAddFiles = Tk::Clock.clicks - clicks
+
+ gd = '%.2g' % (clickGlobDirs / 1000000.0)
+ sd = '%.2g' % (clickSortDirs / 1000000.0)
+ ad = '%.2g' % (clickAddDirs / 1000000.0)
+ gf = '%.2g' % (clickGlobFiles / 1000000.0)
+ sf = '%.2g' % (clickSortFiles / 1000000.0)
+ af = '%.2g' % (clickAddFiles / 1000000.0)
+
+ puts "dirs(#{globDirs.length}) glob/sort/add #{gd}/#{sd}/#{ad} files(#{globFiles.length}) glob/sort/add #{gf}/#{sf}/#{af}"
+
+ @Priv[:DirCnt, t] = globDirs.length
+end
+
+#
+# Demo: explorer files
+#
+def demoExplorerDetails(t)
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:extended,
+ :xscrollincrement=>20, :scrollmargin=>16,
+ :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50])
+
+ init_pics('small-*')
+
+ if $HasColumnCreate
+ t.column_create(:text=>'Name', :tag=>'name',
+ :width=>200, :arrow=>:up, :arrowpad=>6)
+ t.column_create(:text=>'Size', :tag=>'size', :justify=>:right,
+ :width=>60, :arrowside=>:left, :arrowgravity=>:right)
+ t.column_create(:text=>'Type', :tag=>'type', :width=>120)
+ t.column_create(:text=>'Modified', :tag=>'modified', :width=>130)
+ else
+ t.column_configure(0, :text=>'Name', :tag=>'name',
+ :width=>200, :arrow=>:up, :arrowpad=>6)
+ t.column_configure(1, :text=>'Size', :tag=>'size', :justify=>:right,
+ :width=>60, :arrowside=>:left, :arrowgravity=>:right)
+ t.column_configure(2, :text=>'Type', :tag=>'type', :width=>120)
+ t.column_configure(3, :text=>'Modified', :tag=>'modified', :width=>130)
+ end
+
+ t.element_create('e1', :image,
+ :image=>[
+ @sel_images['small-folder'], ['selected'],
+ @images['small-folder'], []
+ ])
+ t.element_create('e2', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('txtType', :text, :lines=>1)
+ t.element_create('txtSize', :text, :lines=>1,
+ :datatype=>:integer, :format=>'%dKB')
+ t.element_create('txtDate', :text, :lines=>1,
+ :datatype=>:time, :format=>'%d/%m/%y %I:%M %p')
+ t.element_create('e4', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ # image + text
+ s = t.style_create('styName', :orient=>:horizontal)
+ t.style_elements(s, ['e4', 'e1', 'e2'])
+ t.style_layout(s, 'e1', :expand=>:ns)
+ t.style_layout(s, 'e2', :padx=>[2,0], :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e2'], :iexpand=>:ns, :ipadx=>2)
+
+ # column 1: text
+ s = t.style_create('stySize')
+ t.style_elements(s, ['txtSize'])
+ t.style_layout(s, 'txtSize', :padx=>6, :squeeze=>:x, :expand=>:ns)
+
+ # column 2: text
+ s = t.style_create('styType')
+ t.style_elements(s, ['txtType'])
+ t.style_layout(s, 'txtType', :padx=>6, :squeeze=>:x, :expand=>:ns)
+
+ # column 3: text
+ s = t.style_create('styDate')
+ t.style_elements(s, ['txtDate'])
+ t.style_layout(s, 'txtDate', :padx=>6, :squeeze=>:x, :expand=>:ns)
+
+ @Priv[:edit, t] = ['e2']
+ @Priv[:sensitive, t] = [ ['name', 'styName', 'e1', 'e2'] ]
+ @Priv[:dragimage, t] = [ ['name', 'styName', 'e1', 'e2'] ]
+
+ t.notify_bind(t, 'Edit-accept',
+ proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t')
+
+ dir_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'styName', 2, 'styType', 3, 'styDate')
+ t.item_complex(item,
+ [['e2', {:text=>File.basename(file)}]],
+ [],
+ [['txtType', {:text=>'Folder'}]],
+ [['txtDate', {:data=>File.mtime(file).tv_sec}]])
+ t.item_lastchild(:root, item)
+ }
+
+ file_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'styName', 1, 'stySize',
+ 2, 'styType', 3, 'styDate')
+
+ ext = File.extname(file)
+ case ext
+ when '.dll'
+ img = 'small-dll'
+ when '.exe'
+ img = 'small-exe'
+ when '.txt'
+ img = 'small-txt'
+ else
+ img = 'small-file'
+ end
+
+ type = ext.upcase
+ type = type[1..-1] << ' ' unless type.empty?
+ type << 'File'
+
+ t.item_complex(item,
+ [
+ ['e1', {:image=>[@sel_images[img], ['selected'],
+ @images[img], []]}],
+ ['e2', {:text=>File.basename(file)}]
+ ],
+ [ ['txtSize', {:data=>File.size(file)/1024 + 1}] ],
+ [ ['txtType', {:text=>type}] ],
+ [ ['txtDate', {:data=>File.mtime(file).tv_sec}] ]
+ )
+ t.item_lastchild(:root, item)
+ }
+
+ demoExplorerAux(t, dir_proc, file_proc)
+
+ @SortColumn = 0
+ t.notify_bind(t, 'Header-invoke',
+ proc{|w, c| explorerHeaderInvoke(t, w, c)}, '%T %C')
+
+ t.bindtags = [ t, 'TreeCtrlFileList', Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
+
+def explorerHeaderInvoke(t, w, c)
+ if (c == @SortColumn)
+ if t.column_cget(@SortColumn, :arrow) == 'down'
+ order = :increasing
+ arrow = :up
+ else
+ order = :decreasing
+ arrow = :down
+ end
+ else
+ if t.column_cget(@SortColumn, :arrow) == 'down'
+ order = :decreasing
+ arrow = :down
+ else
+ order = :increasing
+ arrow = :up
+ end
+ t.column_configure(@SortColumn, :arrow=>:none)
+ @SortColumn = c
+ end
+
+ t.column_configure(c, :arrow=>arrow)
+ dirCount = TkComm.number(@Priv[:DirCnt, t])
+ lastDir = dirCount - 1
+ case t.column_cget(c, :tag)
+ when 'name'
+ if dirCount > 0
+ t.item_sort(:root, order, {:last=>"root child #{lastDir}"},
+ {:column=>c, :dictionary=>true})
+ end
+ if dirCount < t.numitems - 1
+ t.item_sort(:root, order, {:first=>"root child #{dirCount}"},
+ {:column=>c, :dictionary=>true})
+ end
+
+ when 'size'
+ if dirCount < t.numitems - 1
+ t.item_sort(:root, order, {:first=>"root child #{dirCount}"},
+ {:column=>c, :integer=>true},
+ {:column=>'name', :dictionary=>true})
+ end
+
+ when 'type'
+ if dirCount < t.numitems - 1
+ t.item_sort(:root, order, {:first=>"root child #{dirCount}"},
+ {:column=>c, :dictionary=>true},
+ {:column=>'name', :dictionary=>true})
+ end
+
+ when 'modified'
+ if dirCount > 0
+ t.item_sort(:root, order, {:last=>"root child #{lastDir}"},
+ {:column=>c, :integer=>true},
+ {:column=>'name', :dictionary=>true})
+ end
+ if dirCount < t.numitems - 1
+ t.item_sort(:root, order, {:first=>"root child #{dirCount}"},
+ {:column=>c, :integer=>true},
+ {:column=>'name', :dictionary=>true})
+ end
+
+ end
+end
+
+def demoExplorerLargeIcons(t)
+ # Item height is 32 for icon, 4 padding, 3 lines of text
+ itemHeight = 32 + 4 + t.font.metrics(:linespace) * 3
+
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:extended, :wrap=>:window, :orient=>:horizontal,
+ :itemheight=>itemHeight, :showheader=>false, :scrollmargin=>16,
+ :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50])
+
+ init_pics('big-*')
+
+ if $HasColumnCreate
+ t.column_create(:width=>75)
+ else
+ t.column_configure(0, :width=>75)
+ end
+
+ t.element_create('elemImg', :image,
+ :image=>[
+ @sel_images['big-folder'], ['selected'],
+ @images['big-folder'], []
+ ])
+ t.element_create('elemTxt', :text, :justify=>:center,
+ :lines=>1, :width=>71, :wrap=>:word,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('elemSel', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected']
+ ])
+
+ # image + text
+ s = t.style_create('STYLE', :orient=>:vertical)
+ t.style_elements(s, ['elemSel', 'elemImg', 'elemTxt'])
+ t.style_layout(s, 'elemImg', :expand=>:we)
+ t.style_layout(s, 'elemTxt',
+ :pady=>[4,0], :padx=>2, :squeeze=>:x, :expand=>:we)
+ t.style_layout(s, 'elemSel', :union=>['elemTxt'])
+
+ @Priv[:edit, t] = ['elemTxt']
+ @Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
+ @Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
+
+ t.notify_bind(t, 'Edit-accept',
+ proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t')
+
+ dir_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'STYLE')
+ t.item_text(item, 0, File.basename(file))
+ t.item_lastchild(:root, item)
+ }
+
+ file_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'STYLE')
+
+ ext = File.extname(file)
+ case ext
+ when '.dll'
+ img = 'big-dll'
+ when '.exe'
+ img = 'big-exe'
+ when '.txt'
+ img = 'big-txt'
+ else
+ img = 'big-file'
+ end
+
+ type = ext.upcase
+ type = type[1..-1] << ' ' unless type.empty?
+ type << 'File'
+
+ t.item_complex(item,
+ [
+ ['elemImg', {:image=>[@sel_images[img], ['selected'],
+ @images[img], []]}],
+ ['elemTxt', {:text=>File.basename(file)}]
+ ])
+ t.item_lastchild(:root, item)
+ }
+
+ demoExplorerAux(t, dir_proc, file_proc)
+
+ t.activate(t.index('root firstchild'))
+
+ t.notify_bind(t, 'ActiveItem',
+ proc{|w, a, c|
+ w.item_element_configure(a, 0, 'elemTxt', :lines=>'')
+ w.item_element_configure(c, 0, 'elemTxt', :lines=>3)
+ }, '%T %p %c')
+
+ t.bindtags = [ t, 'TreeCtrlFileList', Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
+
+# Tree is horizontal, wrapping occurs at right edge of window, each item
+# is as wide as the smallest needed multiple of 110 pixels
+def demoExplorerSmallIcons(t)
+ demoExplorerList(t)
+ t.configure(:orient=>:horizontal, :xscrollincrement=>0)
+ t.column_configure(0, :width=>'', :stepwidth=>110, :widthhack=>false)
+end
+
+# Tree is vertical, wrapping occurs at bottom of window, each range has the
+# same width (as wide as the longest item), xscrollincrement is by range
+def demoExplorerList(t)
+ height = t.font.metrics(:linespace) + 2
+ height = 18 if height < 18
+
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:extended, :wrap=>:window,
+ :showheader=>false, :scrollmargin=>16,
+ :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50])
+
+ init_pics('small-*')
+
+ if $HasColumnCreate
+ t.column_create(:widthhack=>true)
+ else
+ t.column_configure(0, :widthhack=>true)
+ end
+
+ t.element_create('elemImg', :image,
+ :image=>[
+ @sel_images['small-folder'], ['selected'],
+ @images['small-folder'], []
+ ])
+ t.element_create('elemTxt', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('elemSel', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ # image + text
+ s = t.style_create('STYLE')
+ t.style_elements(s, ['elemSel', 'elemImg', 'elemTxt'])
+ t.style_layout(s, 'elemImg', :expand=>:ns)
+ t.style_layout(s, 'elemTxt', :squeeze=>:x, :expand=>:ns, :padx=>[2,0])
+ t.style_layout(s, 'elemSel', :union=>['elemTxt'], :iexpand=>:ns, :ipadx=>2)
+
+ @Priv[:edit, t] = ['elemTxt']
+ @Priv[:sensitive, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
+ @Priv[:dragimage, t] = [ [0, 'STYLE', 'elemImg', 'elemTxt'] ]
+
+ t.notify_bind(t, 'Edit-accept',
+ proc{|w, i, tt| w.item_text(i, 0, tt)}, '%T %I %t')
+
+ dir_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'STYLE')
+ t.item_text(item, 0, File.basename(file))
+ t.item_lastchild(:root, item)
+ }
+
+ file_proc = proc{|file|
+ item = t.item_create
+ t.item_style_set(item, 0, 'STYLE')
+
+ ext = File.extname(file)
+ case ext
+ when '.dll'
+ img = 'small-dll'
+ when '.exe'
+ img = 'small-exe'
+ when '.txt'
+ img = 'small-txt'
+ else
+ img = 'small-file'
+ end
+
+ type = ext.upcase
+ type = type[1..-1] << ' ' unless type.empty?
+ type << 'File'
+
+ t.item_complex(item,
+ [
+ ['elemImg', {:image=>[@sel_images[img], ['selected'],
+ @images[img], []]}],
+ ['elemTxt', {:text=>File.basename(file)}]
+ ])
+ t.item_lastchild(:root, item)
+ }
+
+ demoExplorerAux(t, dir_proc, file_proc)
+
+ t.activate(t.item_firstchild(:root))
+
+ t.bindtags = [ t, 'TreeCtrlFileList', Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/help.rb b/ext/tk/sample/tkextlib/treectrl/help.rb
new file mode 100644
index 0000000000..31ec9eb3f8
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/help.rb
@@ -0,0 +1,404 @@
+#
+# Demo: Help contents
+#
+def demoHelpContents(t)
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:browse)
+
+ init_pics('help-*')
+
+ if $Version_1_1_OrLater
+ t.column_create(:text=>'Help Contents')
+ else # TreeCtrl 1.0
+ t.column_configure(0, :text=>'Help Contents')
+ end
+
+ # Define a new item state
+ t.state_define('mouseover')
+
+ t.element_create('e1', :image, :image=>@images['help-page'])
+ t.element_create('e2', :image, :image=>[
+ @images['help-book-open'], ['open'],
+ @images['help-book-closed'], [],
+ ])
+ t.element_create('e3', :text,
+ :font=>[t.font.dup.underline(true), ['mouseover']],
+ :fill=>[
+ @SystemHighlightText, ['selected', 'focus'],
+ 'blue', ['mouseover']
+ ])
+ t.element_create('e4', :rect, :showfocus=>true,
+ :fill=>[@SystemHighlight, ['selected', 'focus']])
+
+ # book
+ s = t.style_create('s1')
+ t.style_elements(s, ['e4', 'e1', 'e3'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ # page
+ s = t.style_create('s2')
+ t.style_elements(s, ['e4', 'e2', 'e3'])
+ t.style_layout(s, 'e2', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ parentList = [:root, '', '', '', '', '', '']
+ parent = :root
+ [
+ [0, 's1', "Welcome to Help"],
+ [0, 's2', "Introducing Windows 98"],
+ [1, 's2', "How to Use Help"],
+ [2, 's1', "Find a topic"],
+ [2, 's1', "Get more out of help"],
+ [1, 's2', "Register Your Software"],
+ [2, 's1', "Registering Windows 98 online"],
+ [1, 's2', "What's New in Windows 98"],
+ [2, 's1', "Innovative, easy-to-use features"],
+ [2, 's1', "Improved reliability"],
+ [2, 's1', "A faster operating system"],
+ [2, 's1', "True Web integration"],
+ [2, 's1', "More entertaining and fun"],
+ [1, 's2', "If You're New to Windows 98"],
+ [2, 's2', "Tips for Macintosh Users"],
+ [3, 's1', "Why does the mouse have two buttons?"]
+ ].each{|depth, style, text|
+ item = t.item_create
+ t.item_style_set(item, 0, style)
+ t.item_element_configure(item, 0, 'e3', :text=>text)
+ if $Version_1_1_OrLater
+ t.item_collapse(item)
+ else # TreeCtrl 1.0
+ t.collapse(item)
+ end
+ t.item_lastchild(parentList[depth], item)
+ depth += 1
+ parentList[depth] = item
+ }
+
+ treeCtrlHelp = TkBindTag.new
+
+ treeCtrlHelp.bind('Double-ButtonPress-1',
+ proc{|w, x, y|
+ if w.identify(x, y)[0] == 'header'
+ Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
+ else
+ helpButton1(w, x, y)
+ end
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('ButtonPress-1',
+ proc{|w, x, y|
+ helpButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Button1-Motion',
+ proc{|w, x, y|
+ helpMotion1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Button1-Leave',
+ proc{|w, x, y|
+ helpLeave1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('ButtonRelease-1',
+ proc{|w, x, y|
+ helpRelease1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Motion', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
+
+ treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
+
+ treeCtrlHelp.bind('KeyPress-Return',
+ proc{|w, x, y|
+ if w.selection_get.length == 1
+ if $Version_1_1_OrLater
+ w.item_toggle(w.selection_get[0])
+ else # TreeCtrl 1.0
+ w.toggle(w.selection_get[0])
+ end
+ end
+ Tk.callback_break
+ }, '%W %x %y')
+
+ @Priv[:help, :prev] = ''
+
+ t.bindtags = [ t, treeCtrlHelp, Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
+
+# This is an alternate implementation that does not define a new item state
+# to change the appearance of the item under the cursor.
+def demoHelpContents2(t)
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:browse)
+
+ init_pics('help-*')
+
+ if $Version_1_1_OrLater
+ t.column_create(:text=>'Help Contents')
+ else # TreeCtrl 1.0
+ t.column_configure(0, :text=>'Help Contents')
+ end
+
+ t.element_create('e1', :image, :image=>@images['help-page'])
+ t.element_create('e2', :image, :image=>[
+ @images['help-book-open'], ['open'],
+ @images['help-book-closed'], [],
+ ])
+ t.element_create('e3', :text,
+ :fill=>[
+ @SystemHighlightText, ['selected', 'focus'],
+ 'blue', []
+ ])
+ t.element_create('e4', :rect, :showfocus=>true,
+ :fill=>[@SystemHighligh, ['selected', 'focus']])
+ t.element_create('e5', :text, :font=>t.font.dup.underline(true),
+ :fill=>[
+ @SystemHighlightText, ['selected', 'focus'],
+ 'blue', []
+ ])
+
+ # book
+ s = t.style_create('s1')
+ t.style_elements(s, ['e4', 'e1', 'e3'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ # page
+ s = t.style_create('s2')
+ t.style_elements(s, ['e4', 'e2', 'e3'])
+ t.style_layout(s, 'e2', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ # book (focus)
+ s = t.style_create('s1.f')
+ t.style_elements(s, ['e4', 'e1', 'e5'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e5', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e5'], :iexpand=>:ns, :ipadx=>2)
+
+ # page (focus)
+ s = t.style_create('s2')
+ t.style_elements(s, ['e4', 'e2', 'e5'])
+ t.style_layout(s, 'e2', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e5', :expand=>:ns)
+ t.style_layout(s, 'e4', :union=>['e5'], :iexpand=>:ns, :ipadx=>2)
+
+ parentList = [:root, '', '', '', '', '', '']
+ parent = :root
+ [
+ [0, 's1', "Welcome to Help"],
+ [0, 's2', "Introducing Windows 98"],
+ [1, 's2', "How to Use Help"],
+ [2, 's1' "Find a topic"],
+ [2, 's1', "Get more out of help"],
+ [1, 's2', "Register Your Software"],
+ [2, 's1', "Registering Windows 98 online"],
+ [1, 's2', "What's New in Windows 98"],
+ [2, 's1', "Innovative, easy-to-use features"],
+ [2, 's1', "Improved reliability"],
+ [2, 's1', "A faster operating system"],
+ [2, 's1', "True Web integration"],
+ [2, 's1', "More entertaining and fun"],
+ [1, 's2', "If You're New to Windows 98"],
+ [2, 's2', "Tips for Macintosh Users"],
+ [3, 's1', "Why does the mouse have two buttons?"]
+ ].each{|depth, style, text|
+ item = t.item_create
+ t.item_style_set(item, 0, style)
+ t.item_element_configure(item, 0, 'e3', :text=>text)
+ if $Version_1_1_OrLater
+ t.item_collapse(item)
+ else # TreeCtrl 1.0
+ t.collapse(item)
+ end
+ t.item_lastchild(parentList[depth], item)
+ depth += 1
+ parentList[depth] = item
+ }
+
+ treeCtrlHelp = TkBindTag.new
+
+ treeCtrlHelp.bind('Double-ButtonPress-1',
+ proc{|w, x, y|
+ if w.identify(x, y)[0] == 'header'
+ Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
+ else
+ helpButton1(w, x, y)
+ end
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('ButtonPress-1',
+ proc{|w, x, y|
+ helpButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Button1-Motion',
+ proc{|w, x, y|
+ helpMotion1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Button1-Leave',
+ proc{|w, x, y|
+ helpLeave1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('ButtonRelease-1',
+ proc{|w, x, y|
+ helpRelease1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlHelp.bind('Motion', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
+
+ treeCtrlHelp.bind('Leave', proc{|w, x, y| helpMotion(w, x, y) }, '%W %x %y')
+
+ treeCtrlHelp.bind('KeyPress-Return',
+ proc{|w, x, y|
+ if w.selection_get.length == 1
+ w.item_toggle(w.selection_get[0])
+ end
+ Tk.callback_break
+ }, '%W %x %y')
+
+ @Priv[:help, :prev] = ''
+
+ t.bindtags = [ t, treeCtrlHelp, Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
+
+def helpButton1(w, x, y)
+ w.set_focus
+ id = w.identify(x, y)
+ @Priv['buttonMode'] = ''
+ if id[0] == 'header'
+ Tk::TreeCtrl::BindCallback.buttonPress1(w, x, y)
+ elsif id[0] == 'item'
+ item = id[1]
+ # didn't click an element
+ return if id.length != 6
+ if w.selection_includes(item)
+ w.toggle(item)
+ return
+ end
+ if w.selection_get.length > 0
+ item2 = w.selection_get[0]
+ if $Version_1_1_OrLater
+ w.item_collapse(item2)
+ else # TreeCtrl 1.0
+ w.collapse(item2)
+ end
+ w.item_ancestors(item2).each{|i|
+ if $Version_1_1_OrLater
+ w.item_collapse(i) if w.compare(item, '!=', i)
+ else # TreeCtrl 1.0
+ w.collapse(i) if w.compare(item, '!=', i)
+ end
+ }
+ end
+ w.activate(item)
+ if $Version_1_1_OrLater
+ w.item_ancestors(item).each{|i|
+ w.item_expand(i)
+ }
+ w.item_toggle(item)
+ else # TreeCtrl 1.0
+ w.expand(*(w.item_ancestors(item)))
+ w.toggle(item)
+ end
+ w.selection_modify(item, :all)
+ end
+end
+
+def helpMotion1(w, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.motion1(w, x, y)
+ end
+end
+
+def helpLeave1(w, x, y)
+ # This is called when I do ButtonPress-1 on Unix for some reason,
+ # and buttonMode is undefined.
+ return unless @Priv.exist?('buttonMode')
+ case @Priv['buttonMode']
+ when 'header'
+ w.column_configure(@Priv['column'], :sunken=>false)
+ end
+end
+
+def helpRelease1(w, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.release1(w, x, y)
+ end
+ @Priv['buttonMode'] = ''
+end
+
+def helpMotion(w, x, y)
+ id = w.identify(x, y)
+ if id.empty?
+ elsif id[0] == 'header'
+ elsif id[0] == 'item'
+ item = id[1]
+ if id.length == 6
+ if @Priv[:help, :prev] != TkComm._get_eval_string(item)
+ if @Priv[:help, :prev] != ''
+ w.item_state_set(@Priv[:help, :prev], '!mouseover')
+ end
+ w.item_state_set(item, 'mouseover')
+ @Priv[:help, :prev] = item
+ end
+ return
+ end
+ end
+ if @Priv[:help, :prev] != ''
+ w.item_state_set(@Priv[:help, :prev], '!mouseover')
+ @Priv[:help, :prev] = ''
+ end
+end
+
+# Alternate implementation doesn't rely on mouseover state
+def helpMotion2(w, x, y)
+ id = w.identify(x, y)
+ if id[0] == 'header'
+ elsif !id.empty?
+ item = id[1]
+ if id.kength == 6
+ if @Priv[:help, :prev] != TkComm._get_eval_string(item)
+ if @Priv[:help, :prev] != ''
+ style = w.item_style_set(@Priv[:help, :prev], 0)
+ style.sub!(/\.f$/, '')
+ w.item_style_map(@Priv[:help, :prev], 0, style, ['e5', 'e3'])
+ end
+ style = w.item_style_set(item, 0)
+ w.item_style_map(item, 0, style + '.f', ['e3', 'e5'])
+ @Priv[:help, :prev] = item
+ end
+ return
+ end
+ end
+ if @Priv[:help, :prev] != ''
+ style = w.item_style_set(@Priv[:help, :prev], 0)
+ style.sub!(/\.f$/, '')
+ w.item_style_map(@Priv[:help, :prev], 0, style, ['e5', 'e3'])
+ @Priv[:help, :prev] = ''
+ end
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/imovie.rb b/ext/tk/sample/tkextlib/treectrl/imovie.rb
new file mode 100644
index 0000000000..72134ebda6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/imovie.rb
@@ -0,0 +1,130 @@
+#
+# Demo: iMovie
+#
+def demoIMovie(t)
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :selectmode=>:browse, :orient=>:horizontal, :wrap=>:window,
+ :showheader=>false, :background=>'#dcdcdc')
+
+ if $HasColumnCreate
+ t.column_create
+ end
+
+ init_pics('imovie-*')
+
+ case @thisPlatform
+ when 'macintosh', 'macosx'
+ font1 = TkFont.new(['Geneva', 9])
+ font2 = TkFont.new(['Geneva', 10])
+ when 'unix'
+ font1 = TkFont.new(['Helvetica', -12])
+ font2 = TkFont.new(['Helvetica', -14])
+ else
+ font1 = TkFont.new(['Helvetica', 8])
+ font2 = TkFont.new(['Helvetica', 10])
+ end
+
+ t.element_create('elemTime', :text, :font=>font1)
+ t.element_create('elemName', :text, :font=>font2, :lines=>1, :width=>80)
+ t.element_create('elemRect', :rect, :outline=>'#827878', :outlinewidth=>1,
+ :fill=>['#ffdc5a', ['selected'], 'white', []])
+ t.element_create('elemImg', :image)
+ t.element_create('elemShadow', :rect, :outline=>'gray', :outlinewidth=>1,
+ :open=>:wn)
+
+ s = t.style_create('STYLE', :orient=>:vertical)
+ t.style_elements(s, [
+ 'elemShadow', 'elemRect', 'elemTime',
+ 'elemImg', 'elemName'
+ ])
+ t.style_layout(s, 'elemShadow', :detach=>true,
+ :padx=>[1,2], :pady=>[1,2], :iexpand=>:es)
+ t.style_layout(s, 'elemTime', :padx=>[2,0])
+ t.style_layout(s, 'elemImg', :pady=>[0,1])
+ t.style_layout(s, 'elemName', :expand=>:we, :ipady=>[0,2], :padx=>[0,3],
+ :squeeze=>:x)
+ t.style_layout(s, 'elemRect', :union=>['elemTime', 'elemImg', 'elemName'],
+ :ipadx=>6, :padx=>[0,3], :pady=>[0,3])
+
+ # Set default item style
+ if $Version_1_1_OrLater
+ t.defaultstyle([s])
+ end
+
+ (0..4).each{|i|
+ [
+ ['15:20', 'Clip 1', @images['imovie-01']],
+ ['19:18', 'Clip 2', @images['imovie-02']],
+ ['07:20', 'Clip 3', @images['imovie-03']],
+ ['07:20', 'Clip 4', @images['imovie-04']],
+ ['07:20', 'Clip 5', @images['imovie-05']],
+ ['07:20', 'Clip 6', @images['imovie-06']],
+ ['07:20', 'Clip 7', @images['imovie-07']]
+ ].each{|time, name, image|
+ item = t.item_create
+ unless $Version_1_1_OrLater
+ t.item_style_set(item, 0, s)
+ end
+ t.item_element_configure(item, 0, 'elemTime', :text=>time)
+ t.item_element_configure(item, 0, 'elemName', :text=>name)
+ t.item_element_configure(item, 0, 'elemImg', :image=>image)
+ t.item_lastchild(:root, item)
+ }
+ }
+
+ t.notify_bind(t, 'Edit-accept', proc{|w, i, c, e, tt|
+ w.item_element_configure(i, c, e, :text=>tt)
+ }, '%T %I %C %E %t')
+
+ iMovie = TkBindTag.new
+ iMovie.bind('ButtonPress-1', proc{|w, x, y|
+ iMovieButton1(w, x, y)
+ }, '%W %x %y')
+
+ t.bindtags = [t, iMovie, Tk::TreeCtrl, t.winfo_toplevel, TkBindTag::ALL]
+end
+
+def iMovieButton1(w, x, y)
+ w.set_focus
+ id = w.identify(x,y)
+
+ if id.empty?
+ # Click outside any item
+
+ elsif id[0] == 'header'
+ # Click in header
+ Tk::TreeCtrl::BindCallback.buttonPress1(w, x, y)
+
+ elsif id[0] == 'item'
+ # Click in item
+ Tk::TreeCtrl::BindCallback.buttonPress1(w, x, y)
+ Tk.update
+ where, item, arg1, arg2, arg3, arg4 = id
+ case arg1
+ when 'column'
+ i = id[1]
+ if id.length == 6
+ e = id[-1]
+ if e == 'elemName'
+ exists = TkWinfo.exist?(w.path + '.entry')
+ Tk::TreeCtrl::BindCallback.entryOpen(w, i, 0, e)
+ ent = TkComm.window(w.path + '.entry')
+ unless exists
+ ent.configure(:borderwidth=>0, :justify=>:center,
+ :background=>'#ffdc5a')
+ x1, y1, x2, y2 = w.item_bbox(i, 0, e)
+ ent.place(:y=>y1 - 1)
+ end
+ ent.selection_clear
+ x1, y1, x2, y2 = w.item_bbox(i)
+ ent.place(:x=>x1 + 1, :width=>x2 - x1 - 5)
+ puts "@#{x - (x1 + 1)}"
+ # ent.icursor = ent.index("@#{x - (x1 + 1)}")
+ ent.icursor = ent.index(TkComm._at(x - (x1 + 1)))
+ end
+ end
+ end
+ end
+
+ Tk.callback_break
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/layout.rb b/ext/tk/sample/tkextlib/treectrl/layout.rb
new file mode 100644
index 0000000000..488abe2aa9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/layout.rb
@@ -0,0 +1,159 @@
+#
+# Demo: Layout
+#
+def demoLayout(t)
+ t.configure(:showroot=>false, :showrootbutton=>true, :showbuttons=>true,
+ :showlines=>true, :itemheight=>0, :selectmode=>:browse)
+
+ if $HasColumnCreate
+ t.column_create(:text=>'Layout')
+ else
+ t.column_configure(0, :text=>'Layout')
+ end
+
+ t.element_create('e1', :rect, :width=>30, :height=>30, :fill=>'gray20')
+ t.element_create('e2', :rect, :width=>30, :height=>30, :fill=>'gray40',
+ :outline=>'blue', :outlinewidth=>3)
+ t.element_create('e3', :rect, :fill=>'gray60')
+ t.element_create('e4', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'], 'gray80', []
+ ])
+ t.element_create('e5', :rect, :fill=>'{sky blue}', :width=>20, :height=>20)
+ t.element_create('e6', :rect, :fill=>'{sea green}', :width=>30, :height=>16)
+ t.element_create('e7', :rect, :fill=>'{sky blue}', :width=>30, :height=>16)
+ t.element_create('e8', :rect, :fill=>'gray70', :height=>1)
+
+ s = t.style_create('s1')
+ t.style_elements(s, ['e4', 'e3', 'e1', 'e2', 'e5', 'e6', 'e7'])
+ t.style_layout(s, 'e1', :padx=>[28, 4], :pady=>4)
+ t.style_layout(s, 'e2', :expand=>:es, :padx=>[0, 38])
+ t.style_layout(s, 'e3', :union=>['e1', 'e2'], :ipadx=>4, :ipady=>4, :pady=>2)
+ t.style_layout(s, 'e4', :detach=>true, :iexpand=>:es)
+ t.style_layout(s, 'e5', :detach=>true, :padx=>[2,0], :pady=>2, :iexpand=>:s)
+ t.style_layout(s, 'e6', :detach=>true, :expand=>:ws,
+ :padx=>[0,2], :pady=>[2,0])
+ t.style_layout(s, 'e7', :detach=>true, :expand=>:wn,
+ :padx=>[0,2], :pady=>[0,2])
+
+ if $Version_1_1_OrLater
+ i = t.item_create(:button=>true)
+ else
+ i = t.item_create
+ t.item_hasbutton(i, true)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_lastchild(:root, i)
+ parent = i
+
+ i = t.item_create()
+ unless $Version_1_1_OrLater
+ t.item_hasbutton(i, false)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_lastchild(parent, i)
+
+ ###
+
+ s = t.style_create('s2')
+ t.style_elements(s, ['e4', 'e3', 'e1'])
+ t.style_layout(s, 'e1', :padx=>8, :pady=>8, :iexpand=>:e)
+ t.style_layout(s, 'e3', :union=>['e1'], :ipadx=>[20,4], :ipady=>[4,12])
+ t.style_layout(s, 'e4', :detach=>true, :iexpand=>:es)
+
+ if $Version_1_1_OrLater
+ i = t.item_create(:button=>true)
+ else
+ i = t.item_create
+ t.item_hasbutton(i, true)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_lastchild(:root, i)
+
+ i2 = t.item_create()
+ unless $Version_1_1_OrLater
+ t.item_hasbutton(i2, false)
+ end
+ t.item_style_set(i2, 0, s)
+ t.item_lastchild(i, i2)
+
+ ###
+
+ s = t.style_create('s3')
+ t.style_elements(s, ['e4', 'e3', 'e1', 'e5', 'e6'])
+ t.style_layout(s, 'e4', :union=>['e1', 'e6'], :ipadx=>8, :ipady=>[8,0])
+ t.style_layout(s, 'e3', :union=>['e1', 'e5'], :ipadx=>4, :ipady=>4)
+ t.style_layout(s, 'e5', :ipady=>[0,20])
+
+ if $Version_1_1_OrLater
+ i = t.item_create(:button=>true)
+ else
+ i = t.item_create
+ t.item_hasbutton(i, true)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_lastchild(:root, i)
+
+ i2 = t.item_create()
+ unless $Version_1_1_OrLater
+ t.item_hasbutton(i2, false)
+ end
+ t.item_style_set(i2, 0, s)
+ t.item_lastchild(i, i2)
+
+ ###
+
+ t.element_create('eb', :border, :background=>@SystemButtonFace,
+ :relief=>[:sunken, ['selected'], :raised, []],
+ :thickness=>2, :filled=>true)
+ t.element_create('et', :text)
+
+ text = "Here is a text element surrounded by a border element.\nResize the column to watch me wrap."
+
+ s = t.style_create('e4')
+ t.style_elements(s, ['eb', 'et'])
+ t.style_layout(s, 'eb', :union=>['et'], :ipadx=>2, :ipady=>2)
+ t.style_layout(s, 'et', :squeeze=>:x)
+
+ if $Version_1_1_OrLater
+ i = t.item_create(:button=>true)
+ else
+ i = t.item_create
+ t.item_hasbutton(i, true)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_text(i, 0, text)
+ t.item_lastchild(:root, i)
+ parent = i
+
+ i = t.item_create()
+ unless $Version_1_1_OrLater
+ t.item_hasbutton(i, false)
+ end
+ t.item_style_set(i, 0, s)
+ t.item_text(i, 0, text)
+ t.item_lastchild(parent, i)
+
+ ###
+
+ styleNum = 5
+ [
+ [:horizontal, [:s, :ns, :n]],
+ [:vertical, [:e, :we, :w]]
+ ].each{|orient, expandList|
+ expandList.each{|expand|
+ s = t.style_create("s#{styleNum}", :orient=>orient)
+ t.style_elements(s, ['e4', 'e8', 'e2', 'e5', 'e6'])
+ t.style_layout(s, 'e4', :detach=>true, :iexpand=>:es)
+ t.style_layout(s, 'e8', :detach=>true, :expand=>:n, :iexpand=>:e)
+ t.style_layout(s, 'e2', :expand=>expand)
+ t.style_layout(s, 'e5', :expand=>expand)
+ t.style_layout(s, 'e6', :expand=>expand)
+ styleNum += 1
+
+ i = t.item_create()
+ t.item_style_set(i, 0, s)
+ t.item_lastchild(:root, i)
+ }
+ }
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/mailwasher.rb b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
new file mode 100644
index 0000000000..1b51bb9b21
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/mailwasher.rb
@@ -0,0 +1,269 @@
+#
+# Demo: MailWasher
+#
+def demoMailWasher(t)
+ init_pics('*checked')
+
+ height = t.font.metrics(:linespace) + 2
+ height = 18 if height < 18
+
+ t.configure(:showroot=>false, :showrootbutton=>false, :showbuttons=>false,
+ :showlines=>false, :itemheight=>height, :selectmode=>:browse,
+ :xscrollincrement=>1)
+
+ pad = 4
+
+ if $Version_1_1_OrLater
+ t.column_create(:text=>'Delete', :textpadx=>pad, :tag=>'delete')
+ t.column_create(:text=>'Bounce', :textpadx=>pad, :tag=>'bounce')
+ t.column_create(:text=>'Status', :width=>80, :textpadx=>pad,
+ :tag=>'status')
+ t.column_create(:text=>'Size', :width=>40, :textpadx=>pad,
+ :justify=>:right, :tag=>'size')
+ t.column_create(:text=>'From', :width=>140, :textpadx=>pad, :tag=>'from')
+ t.column_create(:text=>'Subject', :width=>240, :textpadx=>pad,
+ :tag=>'subject')
+ t.column_create(:text=>'Received', :textpadx=>pad, :arrow=>:up,
+ :arrowpad=>[4,0], :tag=>'received')
+ t.column_create(:text=>'Attachments', :textpadx=>pad, :tag=>'attachments')
+
+ t.state_define('CHECK')
+
+ t.element_create('imgCheck', :image, :image=>[
+ @images['checked'], ['CHECK'], @images['unchecked'], []
+ ])
+
+ else # TreeCtrl 1.0
+ t.column_configure(0, :text=>'Delete', :textpadx=>pad, :tag=>'delete')
+ t.column_configure(1, :text=>'Bounce', :textpadx=>pad, :tag=>'bounce')
+ t.column_configure(2, :text=>'Status', :width=>80, :textpadx=>pad,
+ :tag=>'status')
+ t.column_configure(3, :text=>'Size', :width=>40, :textpadx=>pad,
+ :justify=>:right, :tag=>'size')
+ t.column_configure(4, :text=>'From', :width=>140, :textpadx=>pad,
+ :tag=>'from')
+ t.column_configure(5, :text=>'Subject', :width=>240, :textpadx=>pad,
+ :tag=>'subject')
+ t.column_configure(6, :text=>'Received', :textpadx=>pad, :arrow=>:up,
+ :arrowpad=>[4,0], :tag=>'received')
+ t.column_configure(7, :text=>'Attachments', :textpadx=>pad,
+ :tag=>'attachments')
+
+ t.element_create('imgOff', :image, :image=>@images['unchecked'])
+ t.element_create('imgOn', :image, :image=>@images['checked'])
+ end
+
+ t.element_create('border', :rect, :open=>:nw, :outline=>'gray',
+ :outlinewidth=>1, :fill=>[@SystemHighlight, ['selected']])
+ t.element_create('txtAny', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected']])
+ t.element_create('txtNone', :text, :text=>'none', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected']])
+ t.element_create('txtYes', :text, :text=>'yes', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected']])
+ t.element_create('txtNormal', :text, :text=>'Normal', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected'], '#006800', []])
+ t.element_create('txtPossSpam', :text, :text=>'Possible Spam', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected'], '#787800', []])
+ t.element_create('txtProbSpam', :text, :text=>'Probably Spam', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected'], '#FF9000', []])
+ t.element_create('txtBlacklist', :text, :text=>'Blacklisted', :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected'], '#FF5800', []])
+
+ if $Version_1_1_OrLater
+ s = t.style_create('styCheck')
+ t.style_elements(s, ['border', 'imgCheck'])
+ t.style_layout(s, 'border', :detach=>true, :iexpand=>:es)
+ t.style_layout(s, 'imgCheck', :expand=>:news)
+ else
+ ['Off', 'On'].each{|name|
+ s = t.style_create('sty' << name)
+ i = 'img' << name
+ t.style_elements(s, ['border', i])
+ t.style_layout(s, 'border', :detach=>true, :iexpand=>:es)
+ t.style_layout(s, i, :expand=>:news)
+ }
+ end
+
+ pad = 4
+
+ %w(Any None Yes Normal PossSpam ProbSpam Blacklist).each{|name|
+ s = t.style_create('sty' << name)
+ e = 'txt' << name
+ t.style_elements(s, ['border', e])
+ t.style_layout(s, 'border', :detach=>true, :iexpand=>:es)
+ t.style_layout(s, e, :padx=>pad, :squeeze=>:x, :expand=>:ns)
+ }
+
+ [
+ ['baldy@spammer.com', "Your hair is thinning"],
+ ['flat@spammer.com', "Your breasts are too small"],
+ ['tiny@spammer.com', "Your penis is too small"],
+ ['dumbass@spammer.com', "You are not very smart"],
+ ['bankrobber@spammer.com', "You need more money"],
+ ['loser@spammer.com', "You need better friends"],
+ ['gossip@spammer.com', "Find out what your coworkers think about you"],
+ ['whoami@spammer.com', "Find out what you think about yourself"],
+ ['downsized@spammer.com', "You need a better job"],
+ ['poorhouse@spammer.com', "Your mortgage is a joke"],
+ ['spam4ever@spammer.com', "You need more spam"]
+ ].each{|frm, subj|
+ item = t.item_create
+ status = ['styNormal','styPossSpam','styProbSpam','styBlacklist'][rand(4)]
+ attachments = ['styNone','styYes'][rand(2)]
+
+ if $Version_1_1_OrLater
+ delete = [false, true][rand(2)]
+ bounce = [false, true][rand(2)]
+ t.item_style_set(item,
+ 0, 'styCheck', 1, 'styCheck', 2, status, 3, 'styAny',
+ 4, 'styAny', 5, 'styAny', 6, 'styAny', 7, attachments)
+ t.item_state_forcolumn(item, 'delete', 'CHECK') if delete
+ t.item_state_forcolumn(item, 'bounce', 'CHECK') if bounce
+
+ else # TreeCtrl 1.0
+ delete = ['styOn', 'styOff'][rand(2)]
+ bounce = ['styOn', 'styOff'][rand(2)]
+ t.item_style_set(item,
+ 0, delete, 1, bounce, 2, status, 3, 'styAny',
+ 4, 'styAny', 5, 'styAny', 6, 'styAny', 7, attachments)
+ end
+
+ bytes = 512 + rand(1024 * 12)
+ size = "#{bytes / 1024 + 1}KB"
+ seconds = Tk::Clock.seconds - rand(100000)
+ received = Tk::Clock.format(seconds, '%d/%m/%y %I:%M %p')
+ t.item_text(item, 3, size, 4, frm, 5, subj, 6, received)
+ t.item_lastchild(:root, item)
+ }
+
+ sortColumn = 6
+ t.notify_bind(t, 'Header-invoke',
+ proc{|c, w|
+ if c == sortColumn
+ if w.column_cget(sortColumn, :arrow) == 'down'
+ order = :increasing
+ arrow = :up
+ else
+ order = :decreasing
+ arrow = :down
+ end
+ else
+ if w.column_cget(sortColumn, :arrow) == 'down'
+ order = :decreasing
+ arrow = :down
+ else
+ order = :increasing
+ arrow = :up
+ end
+ w.column_configure(sortColumn, :arrow=>:none)
+ sortColumn = c
+ end
+ w.column_configure(c, :arrow=>arrow)
+ case w.column_cget(c, :tag)
+ when 'bounce', 'delete'
+ w.item_sort(:root, order,
+ {
+ :column=>c,
+ :command=>proc{|item1, item2|
+ compareOnOff(w, c, item1, item2)
+ }
+ },
+ { :column=>'subject', :dictionary=>true })
+ when 'status'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true })
+ when 'from'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
+ { :column=>'subject', :dictionary=>true })
+ when 'subject'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true })
+ when 'size'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
+ { :column=>'subject', :dictionary=>true })
+ when 'received'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
+ { :column=>'subject', :dictionary=>true })
+ when 'attachments'
+ w.item_sort(:root, order,
+ { :column=>c, :dictionary=>true },
+ { :column=>'subject', :dictionary=>true })
+ end
+ }, '%C %T')
+
+ mailWasher = TkBindTag.new
+
+ if $Version_1_1_OrLater
+ mailWasher.bind('ButtonPress-1',
+ proc{|w, x, y|
+ id = w.identify(x, y)
+ if id.empty?
+ elsif id[0] == 'header'
+ else
+ what, item, where, arg1, arg2, arg3 = id
+ if where == 'column'
+ tag = w.column_cget(arg1, :tag)
+ if tag == 'delete' || tag == 'bounce'
+ w.item_state_forcolumn(item, arg1, '~CHECK')
+ end
+ end
+ end
+ }, '%W %x %y')
+ else # TreeCtrl 1.0
+ mailWasher.bind('ButtonPress-1',
+ proc{|w, x, y|
+ id = w.identify(x, y)
+ if id.empty?
+ elsif id[0] == 'header'
+ else
+ what, item, where, arg1, arg2, arg3 = id
+ if where == 'column'
+ tag = w.column_cget(arg1, :tag)
+ if tag == 'delete' || tag == 'bounce'
+ style = w.item_style_set(item, arg1)
+ if style == 'styOn'
+ style = 'styOff'
+ else
+ style = 'styOn'
+ end
+ w.item_style_set(item, arg1, style)
+ @display_styles_in_item.call(item)
+ end
+ end
+ end
+ }, '%W %x %y')
+ end
+
+ t.bindtags = [t, mailWasher, Tk::TreeCtrl, t.winfo_toplevel, TkBindTag::ALL]
+end
+
+if $Version_1_1_OrLater
+ def compareOnOff(w, c, item1, item2)
+ s1 = w.item_state_forcolumn(item1, c)
+ s2 = w.item_state_forcolumn(item2, c)
+ if (s1 == s2)
+ 0
+ elsif (s1 == 'CHECK')
+ -1
+ else
+ 1
+ end
+ end
+
+else # TreeCtrl 1.0
+ def compareOnOff(w, c, item1, item2)
+ s1 = w.item_style_set(item1, c)
+ s2 = w.item_style_set(item2, c)
+ if (s1 == s2)
+ 0
+ elsif (s1 == 'styOff')
+ -1
+ else
+ 1
+ end
+ end
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
new file mode 100644
index 0000000000..d966807866
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb
@@ -0,0 +1,124 @@
+#
+# Demo: Outlook Express folder list
+#
+def demoOutlookFolders(t)
+ init_pics('outlook-*')
+
+ height = t.font.metrics(:linespace) + 2
+ height = 18 if height < 18
+
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>true,
+ :showroot=>true, :showrootbutton=>false, :showbuttons=>true)
+
+ if $HasColumnCreate
+ t.column_create(:text=>'Folders')
+ else
+ t.column_configure(0, :text=>'Folders')
+ end
+
+ t.element_create('e1', :image)
+ t.element_create('e2', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('e3', :text, :lines=>1, :font=>t.font.dup.weight(:bold),
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('e4', :text, :fill=>'blue')
+ t.element_create('e5', :image, :image=>@images['outlook-folder'])
+ t.element_create('e6', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ # image + text
+ s = t.style_create('s1')
+ t.style_elements(s, ['e6', 'e1', 'e2'])
+ t.style_layout(s, 'e1', :expand=>:ns)
+ t.style_layout(s, 'e2', :padx=>[4,0], :expand=>:ns, :squeeze=>:x)
+ t.style_layout(s, 'e6', :union=>['e2'], :iexpand=>:ns, :ipadx=>2)
+
+ # image + text + text
+ s = t.style_create('s2')
+ t.style_elements(s, ['e6', 'e1', 'e3', 'e4'])
+ t.style_layout(s, 'e1', :expand=>:ns)
+ t.style_layout(s, 'e3', :padx=>4, :expand=>:ns, :squeeze=>:x)
+ t.style_layout(s, 'e4', :expand=>:ns)
+ t.style_layout(s, 'e6', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ # folder + text
+ s = t.style_create('s3')
+ t.style_elements(s, ['e6', 'e5', 'e2'])
+ t.style_layout(s, 'e5', :expand=>:ns)
+ t.style_layout(s, 'e2', :padx=>[4,0], :expand=>:ns, :squeeze=>:x)
+ t.style_layout(s, 'e6', :union=>['e2'], :iexpand=>:ns, :ipadx=>2)
+
+ # folder + text + text
+ s = t.style_create('s4')
+ t.style_elements(s, ['e6', 'e5', 'e3', 'e4'])
+ t.style_layout(s, 'e5', :expand=>:ns)
+ t.style_layout(s, 'e3', :padx=>4, :expand=>:ns, :squeeze=>:x)
+ t.style_layout(s, 'e4', :expand=>:ns)
+ t.style_layout(s, 'e6', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ t.item_style_set(:root, 0, 's1')
+ t.item_complex(:root,
+ [
+ ['e1', {:image=>@images['outlook-main']}],
+ ['e2', {:text=>'Outlook Express'}]
+ ])
+
+ parentList = [:root, '', '', '', '', '', '']
+ parent = :root
+ [
+ [0, :local, "Local Folders", true, 0],
+ [1, :inbox, 'Inbox', false, 5],
+ [1, :outbox, 'Outbox', false, 0],
+ [1, :sent, "Sent Items", false, 0],
+ [1, :deleted, "Deleted Items", false, 50],
+ [1, :draft, 'Drafts', false, 0],
+ [1, :folder, "Messages to Dad", false, 0],
+ [1, :folder, "Messages to Sis", false, 0],
+ [1, :folder, "Messages to Me", false, 0],
+ [2, :folder, "2001", false, 0],
+ [2, :folder, "2000", false, 0],
+ [2, :folder, "1999", false, 0],
+ [0, :server, "news.gmane.org", true, 0],
+ [1, :group, "gmane.comp.lang.lua.general", false, 498]
+ ].each{|depth, img, text, button, unread|
+ if $Version_1_1_OrLater
+ item = t.item_create(:button=>button)
+ else
+ item = t.item_create
+ t.item_hasbutton(item, button)
+ end
+ if img == :folder
+ if unread != 0
+ t.item_style_set(item, 0, 's4')
+ t.item_complex(item,
+ [['e3', {:text=>text}], ['e4', {:text=>"(#{unread})"}]])
+ else
+ t.item_style_set(item, 0, 's3')
+ t.item_complex(item, [['e2', {:text=>text}]])
+ end
+ else
+ if unread != 0
+ t.item_style_set(item, 0, 's2')
+ t.item_complex(item,
+ [
+ ['e1', {:image=>@images["outlook-#{img}"]}],
+ ['e3', {:text=>text}],
+ ['e4', {:text=>"(#{unread})"}]
+ ])
+ else
+ t.item_style_set(item, 0, 's1')
+ t.item_complex(item,
+ [
+ ['e1', {:image=>@images["outlook-#{img}"]}],
+ ['e2', {:text=>text}]
+ ])
+ end
+ end
+ t.item_lastchild(parentList[depth], item)
+ depth += 1
+ parentList[depth] = item
+ }
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
new file mode 100644
index 0000000000..3495522e5c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb
@@ -0,0 +1,448 @@
+#
+# Demo: Outlook Express newsgroup messages
+#
+def demoOutlookNewsgroup(t)
+ init_pics('outlook-*')
+
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
+ :showroot=>false, :showrootbutton=>false, :showbuttons=>true)
+
+ if $Version_1_1_OrLater
+ t.column_create(:image=>@images['outlook-clip'], :tag=>'clip')
+ t.column_create(:image=>@images['outlook-arrow'], :tag=>'arrow')
+ t.column_create(:image=>@images['outlook-watch'], :tag=>'watch')
+ t.column_create(:text=>'Subject', :width=>250, :tag=>'subject')
+ t.column_create(:text=>'From', :width=>150, :tag=>'from')
+ t.column_create(:text=>'Sent', :width=>150, :tag=>'sent')
+ t.column_create(:text=>'Size', :width=>60, :justify=>:right, :tag=>'size')
+ else # TreeCtrl 1.0
+ t.column_configure(0, :image=>@images['outlook-clip'], :tag=>'clip')
+ t.column_configure(1, :image=>@images['outlook-arrow'], :tag=>'arrow')
+ t.column_configure(2, :image=>@images['outlook-watch'], :tag=>'watch')
+ t.column_configure(3, :text=>'Subject', :width=>250, :tag=>'subject')
+ t.column_configure(4, :text=>'From', :width=>150, :tag=>'from')
+ t.column_configure(5, :text=>'Sent', :width=>150, :tag=>'sent')
+ t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right,
+ :tag=>'size')
+ end
+
+ # Would be nice if I could specify a column -tag too
+ t.treecolumn = 3
+
+ # State for a read message
+ t.state_define('read')
+
+ # State for a message with unread descendants
+ t.state_define('unread')
+
+ t.element_create('elemImg', :image,
+ :image=>[
+ @sel_images['outlook-read-2'],
+ ['selected', 'read', 'unread', '!open'],
+ @images['outlook-read-2'], ['read', 'unread', '!open'],
+ @sel_images['outlook-read'], ['selected', 'read'],
+ @images['outlook-read'], ['read'],
+ @sel_images['outlook-unread'], ['selected'],
+ @images['outlook-unread'], []
+ ])
+ t.element_create('elemTxt', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']],
+ :font=>[
+ t.font.dup.weight(:bold), ['read', 'unread', '!open'],
+ t.font.dup.weight(:bold), ['!read']
+ ])
+ t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+ t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+ t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ # Image + text
+ s = t.style_create('s1')
+ t.style_elements(s, ['sel.e', 'elemImg', 'elemTxt'])
+ t.style_layout(s, 'elemImg', :expand=>:ns)
+ t.style_layout(s, 'elemTxt', :padx=>[2,6], :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.e', :union=>['elemTxt'],
+ :iexpand=>:nes, :ipadx=>[2,0])
+
+ # Text
+ s = t.style_create('s2.we')
+ t.style_elements(s, ['sel.we', 'elemTxt'])
+ t.style_layout(s, 'elemTxt', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.we', :detach=>true, :iexpand=>:es)
+
+ # Text
+ s = t.style_create('s2.w')
+ t.style_elements(s, ['sel.w', 'elemTxt'])
+ t.style_layout(s, 'elemTxt', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.w', :detach=>true, :iexpand=>:es)
+
+ # Set default item style
+ if $Version_1_1_OrLater
+ t.defaultstyle = ['', '', '', 's1', 's2.we', 's2.we', 's2.w']
+ end
+
+ msgCnt = 100
+ thread = 0
+
+ @Message = Hash.new{|k, v| k[v] = Hash.new}
+ @Message[:count][0] = 0
+
+ items = [t.index(:root)]
+
+ (1...(msgCnt)).each{|i|
+ item_i = t.item_create
+ item_j = nil
+ j = nil
+ loop {
+ j = rand(i)
+ item_j = items[j]
+ break if j == 0
+ next if t.depth(item_j) == 5
+ next if @Message[:count][@Message[:thread][item_j]] == 15
+ break
+ }
+ t.item_lastchild(item_j, item_i)
+
+ @Message[:read][item_i] = (rand(2) == 0)
+ if j == 0
+ thread += 1
+ @Message[:thread][item_i] = thread
+ @Message[:seconds][item_i] = (Tk::Clock.seconds - rand(500000))
+ @Message[:seconds2][item_i] = @Message[:seconds][item_i]
+ @Message[:count][thread] = 1
+ else
+ @Message[:thread][item_i] = @Message[:thread][item_j]
+ @Message[:seconds][item_i] = (@Message[:seconds2][item_j] + rand(10000))
+ @Message[:seconds2][item_i] = @Message[:seconds][item_i]
+ @Message[:seconds2][item_j] = @Message[:seconds][item_i]
+ @Message[:count][@Message[:thread][item_j]] += 1
+ end
+ items << item_i
+ }
+
+ (1...(msgCnt)).each{|i|
+ item_i = items[i]
+ subject = "This is thread number #{@Message[:thread][item_i]}"
+ from = 'somebody@somewhere.net'
+ sent = Tk::Clock.format(@Message[:seconds][item_i], "%d/%m/%y %I:%M %p")
+ size = "#{1 + rand(10)}KB"
+
+ # This message has been read
+ t.item_state_set(item_i, 'read') if @Message[:read][item_i]
+
+ # This message has unread descendants
+ t.item_state_set(item_i, 'unread') if anyUnreadDescendants(t, item_i)
+
+ if t.item_numchildren(item_i) > 0
+ if $Version_1_1_OrLater
+ t.item_configure(item_i, :button=>true)
+ else # TreeCtrl 1.0
+ t.item_hasbutton(item_i, true)
+ end
+
+ # Collapse some messages
+ if $Version_1_1_OrLater
+ t.item_collapse(item_i) if rand(2) == 0
+ else # TreeCtrl 1.0
+ t.collapse(item_i) if rand(2) == 0
+ end
+ end
+
+ unless $Version_1_1_OrLater
+ t.item_style_set(item_i, 3, 's1', 4, 's2.we', 5, 's2.we', 6, 's2.w')
+ end
+ t.item_text(item_i, 3, subject, 4, from, 5, sent, 6, size)
+ }
+
+ # Do something when the selection changes
+ t.notify_bind(t, 'Selection',
+ proc{|w|
+ if w.selection_count == 1
+ # One item is selected
+ if @Message[:afterId][:id]
+ Tk.after_cancel(@Message[:afterId][:id])
+ end
+ @Message[:afterId][:item] = w.selection_get[0]
+ @Message[:afterId][:id] = Tk.after(500, proc{
+ messageReadDelayed(w)
+ })
+ end
+ }, '%T')
+end
+
+def messageReadDelayed(t)
+ @Message[:afterId].delete(:id)
+ i = @Message[:afterId][:item]
+ return unless t.selection_includes(i)
+
+ # This message is not read
+ unless @Message[:read][i]
+ # Read the message
+ t.item_state_set(i, 'read')
+ @Message[:read][i] = true
+
+ # Check ancestors (except root)
+ t.item_ancestors(i)[0..-2].each{|i2|
+ # This ancestor has no more unread descendants
+ t.item_state_set(i2, '!unread') unless anyUnreadDescendants(t, i2)
+ }
+ end
+end
+
+# Alternate implementation which does not rely on run-time states
+def demoOutlookNewsgroup2(t)
+ init_pics('outlook-*')
+
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+ t.configure(:itemheight=>height, :selectmode=>:browse, :showlines=>false,
+ :showroot=>false, :showrootbutton=>false, :showbuttons=>true)
+
+ if $Version_1_1_OrLater
+ t.column_create(:image=>@images['outlook-clip'], :tag=>'clip')
+ t.column_create(:image=>@images['outlook-arrow'], :tag=>'arrow')
+ t.column_create(:image=>@images['outlook-watch'], :tag=>'watch')
+ t.column_create(:text=>'Subject', :width=>250, :tag=>'subject')
+ t.column_create(:text=>'From', :width=>150, :tag=>'from')
+ t.column_create(:text=>'Sent', :width=>150, :tag=>'sent')
+ t.column_create(:text=>'Size', :width=>60, :justify=>:right, :tag=>'size')
+ else # TreeCtrl 1.0
+ t.column_configure(0, :image=>@images['outlook-clip'], :tag=>'clip')
+ t.column_configure(1, :image=>@images['outlook-arrow'], :tag=>'arrow')
+ t.column_configure(2, :image=>@images['outlook-watch'], :tag=>'watch')
+ t.column_configure(3, :text=>'Subject', :width=>250, :tag=>'subject')
+ t.column_configure(4, :text=>'From', :width=>150, :tag=>'from')
+ t.column_configure(5, :text=>'Sent', :width=>150, :tag=>'sent')
+ t.column_configure(6, :text=>'Size', :width=>60, :justify=>:right,
+ :tag=>'size')
+ end
+
+ t.treecolumn = 3
+
+ t.element_create('image.unread', :image, :image=>@images['outlook-unread'])
+ t.element_create('image.read', :image, :image=>@images['outlook-read'])
+ t.element_create('image.read2', :image, :image=>@images['outlook-read-2'])
+ t.element_create('text.read', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('text.unread', :text, :lines=>1,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']],
+ :font=>t.font.dup.weight(:bold))
+ t.element_create('sel.e', :rect, :open=>:e, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+ t.element_create('sel.w', :rect, :open=>:w, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+ t.element_create('sel.we', :rect, :open=>:we, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ # Image + text
+ s = t.style_create('unread')
+ t.style_elements(s, ['sel.e', 'image.unread', 'text.unread'])
+ t.style_layout(s, 'image.unread', :expand=>:ns)
+ t.style_layout(s, 'text.unread', :padx=>[2,6], :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.e', :union=>['text.unread'],
+ :iexpand=>:nes, :ipadx=>[2,0])
+
+ # Image + text
+ s = t.style_create('read')
+ t.style_elements(s, ['sel.e', 'image.read', 'text.read'])
+ t.style_layout(s, 'image.read', :expand=>:ns)
+ t.style_layout(s, 'text.read', :padx=>[2,6], :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.e', :union=>['text.read'],
+ :iexpand=>:nes, :ipadx=>[2,0])
+
+ # Image + text
+ s = t.style_create('read2')
+ t.style_elements(s, ['sel.e', 'image.read2', 'text.unread'])
+ t.style_layout(s, 'image.read2', :expand=>:ns)
+ t.style_layout(s, 'text.unread', :padx=>[2,6], :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.e', :union=>['text.unread'],
+ :iexpand=>:nes, :ipadx=>[2,0])
+
+ # Text
+ s = t.style_create('unread.we')
+ t.style_elements(s, ['sel.we', 'text.unread'])
+ t.style_layout(s, 'text.unread', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.we', :detach=>true, :iexpand=>:es)
+
+ # Text
+ s = t.style_create('read.we')
+ t.style_elements(s, ['sel.we', 'text.read'])
+ t.style_layout(s, 'text.read', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.we', :detach=>true, :iexpand=>:es)
+
+ # Text
+ s = t.style_create('unread.w')
+ t.style_elements(s, ['sel.w', 'text.unread'])
+ t.style_layout(s, 'text.unread', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.w', :detach=>true, :iexpand=>:es)
+
+ # Text
+ s = t.style_create('read.w')
+ t.style_elements(s, ['sel.w', 'text.read'])
+ t.style_layout(s, 'text.read', :padx=>6, :squeeze=>:x, :expand=>:ns)
+ t.style_layout(s, 'sel.w', :detach=>true, :iexpand=>:es)
+
+ msgCnt = 100
+ thread = 0
+
+ @Message = Hash.new{|k, v| k[v] = Hash.new}
+ @Message[:count][0] = 0
+
+ (1...(msgCnt)).each{|i|
+ t.item_create
+ j = nil
+ loop {
+ j = rand(i)
+ break if j == 0
+ next if t.depth(j) == 5
+ next if @Message[:count][@Message[:thread][j]] == 15
+ break
+ }
+ t.item_lastchild(j, i)
+
+ @Message[:read][i] = (rand(2) == 0)
+ if j == 0
+ thread += 1
+ @Message[:thread][i] = thread
+ @Message[:seconds][i] = (Tk::Clock.seconds - rand(500000))
+ @Message[:seconds2][i] = @Message[:seconds][i]
+ @Message[:count][thread] = 1
+ else
+ @Message[:thread][i] = @Message[:thread][j]
+ @Message[:seconds][i] = (@Message[:seconds2][j] + rand(10000))
+ @Message[:seconds2][i] = @Message[:seconds][i]
+ @Message[:seconds2][j] = @Message[:seconds][i]
+ @Message[:count][@Message[:thread][j]] += 1
+ end
+ }
+
+ (1...(msgCnt)).each{|i|
+ subject = "This is thread number #{@Message[:thread][i]}"
+ from = 'somebody@somewhere.net'
+ sent = Tk::Clock.format(@Message[:seconds][i], "%d/%m/%y %I:%M %p")
+ size = "#{1 + rand(10)}KB"
+ if @Message[:read][i]
+ style = 'read'
+ style2 = 'read2'
+ else
+ style = 'unread'
+ style2 = 'unread2'
+ end
+ t.item_style_set(i, 3, style, 4, "#{style2}.we", 5, "#{style2}.we",
+ 6, "#{style2}.w")
+ t.item_text(i, 3, subject, 4, from, 5, sent, 6, size)
+ if t.item_numchildren(i) > 0
+ t.item_configure(item_i, :button=>true)
+ end
+ }
+
+ # Do something when the selection changes
+ t.notify_bind(t, 'Selection',
+ proc{|w|
+ if w.selection_count == 1
+ i = t.selection_get[0]
+ unless @Message[:read][i]
+ if t.item_isopen(i) || !anyUnreadDescendants(t, i)
+ # unread -> read
+ t.item_style_map(i, 'subject', 'read',
+ ['text.unread', 'text.read'])
+ t.item_style_map(i, 'from', 'read.we',
+ ['text.unread', 'text.read'])
+ t.item_style_map(i, 'sent', 'read.we',
+ ['text.unread', 'text.read'])
+ t.item_style_map(i, 'size', 'read.w',
+ ['text.unread', 'text.read'])
+ else
+ # unread -> read2
+ t.item_style_map(i, 'subject', 'read2',
+ ['text.unread', 'text.unread'])
+ end
+
+ @Message[:read][i] = true
+ @display_styles_in_item.call(i)
+ end
+ end
+ }, '%T')
+
+ t.notify_bind(t, 'Expand-after',
+ proc{|w, i|
+ if @Messge[:read][i] && anyUnreadDescendants(t, i)
+ # read2 -> read
+ t.item_style_map(i, 'subject', 'read',
+ ['text.unread', 'text.read'])
+ # unread -> read
+ t.item_style_map(i, 'from', 'read.we',
+ ['text.unread', 'text.read'])
+ t.item_style_map(i, 'sent', 'read.we',
+ ['text.unread', 'text.read'])
+ t.item_style_map(i, 'size', 'read.w',
+ ['text.unread', 'text.read'])
+ end
+ }, '%T %I')
+
+ t.notify_bind(t, 'Collapse-after',
+ proc{|w, i|
+ if @Messge[:read][i] && anyUnreadDescendants(t, i)
+ # read -> read2
+ t.item_style_map(i, 'subject', 'read2',
+ ['text.read', 'text.unread'])
+ # read -> unread
+ t.item_style_map(i, 'from', 'unread.we',
+ ['text.read', 'text.unread'])
+ t.item_style_map(i, 'sent', 'unread.we',
+ ['text.read', 'text.unread'])
+ t.item_style_map(i, 'size', 'unread.w',
+ ['text.read', 'text.unread'])
+ end
+ }, '%T %I')
+
+ (1...(msgCnt)).each{|i|
+ if rand(2) == 0
+ if t.item_numchildren(i) > 0
+ if $Version_1_1_OrLater
+ t.item_collapse(i)
+ else # TreeCtrl 1.0
+ t.collapse(i)
+ end
+ end
+ end
+ }
+end
+
+def anyUnreadDescendants(t, i)
+ itemList = []
+ item = t.item_firstchild(i)
+ itemList.push(item) if item != ''
+
+ while item = itemList.pop
+ return true unless @Message[:read][item]
+
+ item2 = t.item_nextsibling(item)
+ itemList.push(item2) if item2 != ''
+ item2 = t.item_firstchild(item)
+ itemList.push(item2) if item2 != ''
+ end
+ false
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/big-dll.gif b/ext/tk/sample/tkextlib/treectrl/pics/big-dll.gif
new file mode 100644
index 0000000000..09170c0e26
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/big-dll.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/big-exe.gif b/ext/tk/sample/tkextlib/treectrl/pics/big-exe.gif
new file mode 100644
index 0000000000..e19aac1a2d
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/big-exe.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/big-file.gif b/ext/tk/sample/tkextlib/treectrl/pics/big-file.gif
new file mode 100644
index 0000000000..6c752312a3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/big-file.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/big-folder.gif b/ext/tk/sample/tkextlib/treectrl/pics/big-folder.gif
new file mode 100644
index 0000000000..186c9749fd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/big-folder.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/big-txt.gif b/ext/tk/sample/tkextlib/treectrl/pics/big-txt.gif
new file mode 100644
index 0000000000..a93492586e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/big-txt.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/checked.gif b/ext/tk/sample/tkextlib/treectrl/pics/checked.gif
new file mode 100644
index 0000000000..3b9b176ab3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/checked.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/file.gif b/ext/tk/sample/tkextlib/treectrl/pics/file.gif
new file mode 100644
index 0000000000..a64c2a06bd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/file.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gif b/ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gif
new file mode 100644
index 0000000000..0a064376c9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/folder-open.gif b/ext/tk/sample/tkextlib/treectrl/pics/folder-open.gif
new file mode 100644
index 0000000000..3fac27ffd9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/folder-open.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gif b/ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gif
new file mode 100644
index 0000000000..0a0497bfa3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gif b/ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gif
new file mode 100644
index 0000000000..40656c5194
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/help-page.gif b/ext/tk/sample/tkextlib/treectrl/pics/help-page.gif
new file mode 100644
index 0000000000..e1ce1d72f5
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/help-page.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gif
new file mode 100644
index 0000000000..5fd9215551
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gif
new file mode 100644
index 0000000000..3d2d1c17c2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gif
new file mode 100644
index 0000000000..9fccf12b51
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gif
new file mode 100644
index 0000000000..eff851c9bb
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gif
new file mode 100644
index 0000000000..ad00c827f6
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gif
new file mode 100644
index 0000000000..238bf162ac
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gif b/ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gif
new file mode 100644
index 0000000000..a9287e1b1c
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gif
new file mode 100644
index 0000000000..e64866a394
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gif
new file mode 100644
index 0000000000..cf652beff2
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-print.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-print.gif
new file mode 100644
index 0000000000..7ac25b10e9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-print.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gif
new file mode 100644
index 0000000000..90ef62971f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gif
new file mode 100644
index 0000000000..9de742c198
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-search.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-search.gif
new file mode 100644
index 0000000000..1f9a047701
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-search.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/internet-security.gif b/ext/tk/sample/tkextlib/treectrl/pics/internet-security.gif
new file mode 100644
index 0000000000..86d3943786
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/internet-security.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gif b/ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gif
new file mode 100644
index 0000000000..81302c80c1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gif b/ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gif
new file mode 100644
index 0000000000..0a2cd80040
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gif
new file mode 100644
index 0000000000..b1c2afd426
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gif
new file mode 100644
index 0000000000..8578132702
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gif
new file mode 100644
index 0000000000..7cc8369b4b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gif
new file mode 100644
index 0000000000..f19585050f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gif
new file mode 100644
index 0000000000..b3f733563b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gif
new file mode 100644
index 0000000000..29ad9b466e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gif
new file mode 100644
index 0000000000..f41d804444
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gif
new file mode 100644
index 0000000000..0c74970d32
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gif
new file mode 100644
index 0000000000..92325fa85f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gif
new file mode 100644
index 0000000000..c7e80527a0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gif
new file mode 100644
index 0000000000..2f15a3af05
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gif
new file mode 100644
index 0000000000..a6f956207a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gif
new file mode 100644
index 0000000000..963b56c4c9
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gif
new file mode 100644
index 0000000000..c950845d62
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gif
new file mode 100644
index 0000000000..3df4b99439
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gif b/ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gif
new file mode 100644
index 0000000000..87ec861312
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/sky.gif b/ext/tk/sample/tkextlib/treectrl/pics/sky.gif
new file mode 100644
index 0000000000..b7fbf14a0a
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/sky.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/small-dll.gif b/ext/tk/sample/tkextlib/treectrl/pics/small-dll.gif
new file mode 100644
index 0000000000..d8875ec23f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/small-dll.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/small-exe.gif b/ext/tk/sample/tkextlib/treectrl/pics/small-exe.gif
new file mode 100644
index 0000000000..69d30beacd
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/small-exe.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/small-file.gif b/ext/tk/sample/tkextlib/treectrl/pics/small-file.gif
new file mode 100644
index 0000000000..f340662879
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/small-file.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/small-folder.gif b/ext/tk/sample/tkextlib/treectrl/pics/small-folder.gif
new file mode 100644
index 0000000000..ad1b24da84
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/small-folder.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/small-txt.gif b/ext/tk/sample/tkextlib/treectrl/pics/small-txt.gif
new file mode 100644
index 0000000000..cdc7cbfe99
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/small-txt.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/pics/unchecked.gif b/ext/tk/sample/tkextlib/treectrl/pics/unchecked.gif
new file mode 100644
index 0000000000..833e48268b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/pics/unchecked.gif
Binary files differ
diff --git a/ext/tk/sample/tkextlib/treectrl/random.rb b/ext/tk/sample/tkextlib/treectrl/random.rb
new file mode 100644
index 0000000000..43aca63283
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/random.rb
@@ -0,0 +1,508 @@
+#
+def random_N
+ @RandomN[0] || 500
+end
+
+#
+# Demo: random N items
+#
+def demoRandom(t)
+ init_pics('folder-*', 'small-*')
+
+ height = t.font.metrics(:linespace)
+ height = 18 if height < 18
+ t.configure(:itemheight=>height, :selectmode=>:extended,
+ :showroot=>true, :showrootbutton=>true, :showbuttons=>true,
+ :showlines=>true, :scrollmargin=>16,
+ :xscrolldelay=>[500, 50], :yscrolldelay=>[500, 50])
+
+ if $Version_1_1_OrLater
+ t.column_create(:expand=>true, :text=>'Item',
+ :itembackground=>['#e0e8f0', []], :tag=>'item')
+ t.column_create(:text=>'Parent', :justify=>:center,
+ :itembackground=>['gray90', []], :tag=>'parent')
+ t.column_create(:text=>'Depth', :justify=>:center,
+ :itembackground=>['linen', []], :tag=>'depth')
+ else # TreeCtrl 1.0
+ t.column_configure(0, :expand=>true, :text=>'Item',
+ :itembackground=>['#e0e8f0', []], :tag=>'item')
+ t.column_configure(1, :text=>'Parent', :justify=>:center,
+ :itembackground=>['gray90', []], :tag=>'parent')
+ t.column_configure(2, :text=>'Depth', :justify=>:center,
+ :itembackground=>['linen', []], :tag=>'depth')
+ end
+
+ t.element_create('e1', :image, :image=>[
+ @images['folder-open'], ['open'],
+ @images['folder-closed'], []
+ ])
+ t.element_create('e2', :image, :image=>@images['small-file'])
+ t.element_create('e3', :text,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('e4', :text, :fill=>'blue')
+ t.element_create('e6', :text)
+ t.element_create('e5', :rect, :showfocus=>true,
+ :fill=>[
+ @SystemHighlight, ['selected', 'focus'],
+ 'gray', ['selected', '!focus']
+ ])
+
+ s = t.style_create('s1')
+ t.style_elements(s, ['e5', 'e1', 'e3', 'e4'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e4', :padx=>[0,6], :expand=>:ns)
+ t.style_layout(s, 'e5', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ s = t.style_create('s2')
+ t.style_elements(s, ['e5', 'e2', 'e3'])
+ t.style_layout(s, 'e2', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e3', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e5', :union=>['e3'], :iexpand=>:ns, :ipadx=>2)
+
+ s = t.style_create('s3')
+ t.style_elements(s, ['e6'])
+ t.style_layout(s, 'e6', :padx=>6, :expand=>:ns)
+
+ @Priv[:sensitive, t] = [
+ [:item, 's1', 'e5', 'e1', 'e3'],
+ [:item, 's2', 'e5', 'e2', 'e3']
+ ]
+ @Priv[:dragimage, t] = [
+ [:item, 's1', 'e1', 'e3'],
+ [:item, 's2', 'e2', 'e3']
+ ]
+
+ clicks = Tk::Clock.clicks
+ items = [ t.index(:root) ]
+ (1...(random_N())).each{|i|
+ item_i = t.item_create
+ item_j = nil
+ loop {
+ j = rand(i)
+ item_j = items[j]
+ break if t.depth(item_j) < 5
+ }
+ if $Version_1_1_OrLater
+ t.item_collapse(item_i) if rand(2) == 0
+ else # TreeCtrl 1.0
+ t.collapse(item_i) if rand(2) == 0
+ end
+ if rand(2) == 0
+ t.item_lastchild(item_j, item_i)
+ else
+ t.item_firstchild(item_j, item_i)
+ end
+ items << item_i
+ }
+ puts "created #{random_N() - 1} items in #{Tk::Clock.clicks - clicks} clicks"
+
+ clicks = Tk::Clock.clicks
+ (0...(random_N())).each{|i|
+ item_i = items[i]
+ numChildren = t.item_numchildren(item_i)
+ if numChildren > 0
+ if $Version_1_1_OrLater
+ t.item_configure(item_i, :button=>true)
+ else # TreeCtrl 1.0
+ t.item_hasbutton(item_i, true)
+ end
+ t.item_style_set(item_i, 0, 's1', 1, 's3', 2, 's3')
+ t.item_complex(item_i,
+ [ ['e3', {:text=>"Item #{i}"}],
+ ['e4', {:text=>"(#{numChildren})"}] ],
+ [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ],
+ [ ['e6', {:text=>"#{t.depth(item_i)}"}] ])
+ else
+ t.item_style_set(item_i, 1, 's3', 2, 's3', 0, 's2')
+ t.item_complex(item_i,
+ [ ['e3', {:text=>"Item #{i}"}] ],
+ [ ['e6', {:text=>"#{t.item_parent(item_i)}"}] ],
+ [ ['e6', {:text=>"#{t.depth(item_i)}"}] ])
+ end
+ }
+ puts "configured #{random_N()} items in #{Tk::Clock.clicks - clicks} clicks"
+
+ treeCtrlRandom = TkBindTag.new
+
+ treeCtrlRandom.bind('Double-ButtonPress-1',
+ proc{|w, x, y|
+ Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('Control-ButtonPress-1',
+ proc{|w, x, y|
+ @Priv['selectMode'] = :toggle
+ randomButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('Shift-ButtonPress-1',
+ proc{|w, x, y|
+ @Priv['selectMode'] = :add
+ randomButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('ButtonPress-1',
+ proc{|w, x, y|
+ @Priv['selectMode'] = :set
+ randomButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('Button1-Motion',
+ proc{|w, x, y|
+ randomMotion1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('Button1-Leave',
+ proc{|w, x, y|
+ randomLeave1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ treeCtrlRandom.bind('ButtonRelease-1',
+ proc{|w, x, y|
+ randomRelease1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ t.bindtags = [ t, treeCtrlRandom, Tk::TreeCtrl, t.winfo_toplevel, :all ]
+end
+
+def randomButton1(t, x, y)
+ t.set_focus
+ id = t.identify(x, y)
+ puts id.inspect
+ @Priv['buttonMode'] = ''
+
+ # Click outside any item
+ if id.empty?
+ t.selection_clear
+
+ # Click in header
+ elsif id[0] == 'header'
+ Tk::TreeCtrl::BindCallback.buttonPress1(t, x, y)
+
+ # Click in item
+ else
+ where, item, arg1, arg2, arg3, arg4 = id
+ case arg1
+ when 'button'
+ if $Version_1_1_OrLater
+ t.item_toggle(item)
+ else # TreeCtrl 1.0
+ t.toggle(item)
+ end
+
+ when 'line'
+ if $Version_1_1_OrLater
+ t.item_toggle(arg2)
+ else # TreeCtrl 1.0
+ t.toggle(arg2)
+ end
+
+ when 'column'
+ ok = false
+ # Clicked an element
+ if id.length == 6
+ column = id[3]
+ e = id[5]
+ @Priv.list_element(:sensitive, t).each{|lst|
+ c, s, *eList = TkComm.simplelist(lst)
+ next if column != t.column_index(c)
+ next if t.item_style_set(item, c) != s
+ next if eList.find{|le| le == e} == nil
+ ok = true
+ break
+ }
+ end
+ unless ok
+ t.selection_clear
+ return
+ end
+
+ @Priv[:drag, :motion] = 0
+ @Priv[:drag, :x] = t.canvasx(x)
+ @Priv[:drag, :y] = t.canvasy(y)
+ @Priv[:drop] = ''
+
+ if @Priv['selectMode'] == 'add'
+ Tk::TreeCtrl::BindCallback.beginExtend(t, item)
+ elsif @Priv['selectMode'] == 'toggle'
+ Tk::TreeCtrl::BindCallback.beginToggle(t, item)
+ elsif ! t.selection_includes(item)
+ Tk::TreeCtrl::BindCallback.beginSelect(t, item)
+ end
+ t.activate(item)
+
+ if t.selection_includes(item)
+ @Priv['buttonMode'] = 'drag'
+ end
+ end
+ end
+end
+
+def randomMotion1(t, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.motion1(t, x, y)
+ when 'drag'
+ randomAutoScanCheck(t, x, y)
+ randomMotion(t, x, y)
+ end
+end
+
+def randomMotion(t, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.motion1(t, x, y)
+
+ when 'drag'
+ # Detect initial mouse movement
+ unless @Priv.bool_element(:drag, :motion)
+ @Priv[:selection] = t.selection_get
+ @Priv[:drop] = ''
+ t.dragimage_clear
+ # For each selected item, add 2nd and 3rd elements of
+ # column "item" to the dragimage
+ @Priv.list_element(:selection).each{|i|
+ @Priv.list_element(:dragimage,t).each{|lst|
+ c, s, *eList = TkComm.simplelist(lst)
+ if t.item_style_set(i, c) == s
+ t.dragimage_add(i, c, *eList)
+ end
+ }
+ }
+ @Priv[:drag,:motion] = true
+ end
+
+ # Find the item under the cursor
+ cursor = 'X_cursor'
+ drop = ''
+ id = t.identify(x, y)
+ ok = false
+ if !id.empty? && id[0] == 'item' && id.length == 6
+ item = id[1]
+ column = id[3]
+ e = id[5]
+ @Priv.list_element(:sensitive,t).each{|lst|
+ c, s, *eList = TkComm.simplelist(lst)
+ next if column != t.column_index(c)
+ next if t.item_style_set(item, c) != s
+ next unless eList.find{|val| val.to_s == e.to_s}
+ ok = true
+ break
+ }
+ ok = true if @Priv.list_element(:sensitive,t).find{|val| TkComm.simplelist(val).index(e)}
+ end
+
+ if ok
+ # If the item is not in the pre-drag selection
+ # (i.e. not being dragged) see if we can drop on it
+ unless @Priv.list_element(:selection).find{|val| val.to_s == item.to_s}
+ drop = item
+ # We can drop if dragged item isn't an ancestor
+ @Priv.list_element(:selection).each{|item2|
+ if t.item_isancestor(item2, item)
+ drop = ''
+ break
+ end
+ }
+ if drop != ''
+ x1, y1, x2, y2 = t.item_bbox(drop)
+ if y < y1 + 3
+ cursor = 'top_side'
+ @Priv[:drop,:pos] = 'prevsibling'
+ elsif y >= y2 - 3
+ cursor = 'bottom_side'
+ @Priv[:drop,:pos] = 'nextsibling'
+ else
+ cursor = ''
+ @Priv[:drop,:pos] = 'lastchild'
+ end
+ end
+ end
+ end
+
+ t[:cursor] = cursor if t[:cursor] != cursor
+
+ # Select the item under the cursor (if any) and deselect
+ # the previous drop-item (if any)
+ t.selection_modify(drop, @Priv[:drop])
+ @Priv[:drop] = drop
+
+ # Show the dragimage in its new position
+ x = t.canvasx(x) - @Priv.numeric_element(:drag,:x)
+ y = t.canvasx(y) - @Priv.numeric_element(:drag,:y)
+ t.dragimage_offset(x, y)
+ t.dragimage_configure(:visible=>true)
+ end
+end
+
+def randomLeave1(t, x, y)
+ # This is called when I do ButtonPress-1 on Unix for some reason,
+ # and buttonMode is undefined.
+ return unless @Priv.exist?('buttonMode')
+ case @Priv['buttonMode']
+ when 'header'
+ Tk::TreeCtrl::BindCallback.leave1(t, x, y)
+ end
+end
+
+def randomRelease1(t, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.release1(t, x, y)
+ when 'drag'
+ Tk::TreeCtrl::BindCallback.autoScanCancel(t)
+ t.dragimage_configure(:visible=>false)
+ t.selection_modify('', @Priv[:drop])
+ t[:cursor] = ''
+ if @Priv[:drop] != ''
+ randomDrop(t, @Priv[:drop], @Priv.list_element(:selection),
+ @Priv[:drop, :pos])
+ end
+ end
+ @Priv['buttonMode'] = ''
+end
+
+def randomDrop(t, target, src, pos)
+ parentList = []
+ case pos
+ when 'lastchild'
+ parent = target
+ when 'prevsibling'
+ parent = t.item_parent(target)
+ when 'nextsibling'
+ parent = t.item_parent(target)
+ end
+ src.each{|item|
+ # Ignore any item whose ancestor is also selected
+ ignore = false
+ t.item_ancestors(item).each{|ancestor|
+ if src.find{|val| val.to_s == ancestor.to_s}
+ ignore = true
+ break
+ end
+ }
+ next if ignore
+
+ # Update the old parent of this moved item later
+ unless parentList.find{|val| val.to_s == item.to_s}
+ parentList << t.item_parent(item)
+ end
+
+ # Add to target
+ t.__send__("item_#{pos}", target, item)
+
+ # Update text: parent
+ t.item_element_configure(item, 'parent', 'e6', :text=>parent)
+
+ # Update text: depth
+ t.item_element_configure(item, 'depth', 'e6', :text=>t.depth(item))
+
+ # Recursively update text: depth
+ itemList = []
+ item = t.item_firstchild(item)
+ itemList << item if item != ''
+
+ while item = itemList.pop
+ t.item_element_configure(item, 'depth', 'e6', :text=>t.depth(item))
+
+ item2 = t.item_nextsibling(item)
+ itemList << item2 if item2 != ''
+
+ item2 = t.item_firstchild(item)
+ itemList << item2 if item2 != ''
+ end
+ }
+
+ # Update items that lost some children
+ parentList.each{|item|
+ numChildren = t.item_numchildren(item)
+ if numChildren == 0
+ if $Version_1_1_OrLater
+ t.item_configure(item, :button=>false)
+ else # TreeCtrl 1.0
+ t.item_hasbutton(item, false)
+ end
+ t.item_style_map(item, 'item', 's2', ['e3', 'e3'])
+ else
+ t.item_element_configure(item, 'item', 'e4', :text=>"(#{numChildren})")
+ end
+ }
+
+ # Update the target that gained some children
+ if t.item_style_set(parent, 0) != 's1'
+ if $Version_1_1_OrLater
+ t.item_configure(parent, :button=>true)
+ else # TreeCtrl 1.0
+ t.item_hasbutton(parent, true)
+ end
+ t.item_style_map(parent, 'item', 's1', ['e3', 'e3'])
+ end
+ numChildren = t.item_numchildren(parent)
+ t.item_element_configure(parent, 'item', 'e4', :text=>"(#{numChildren})")
+end
+
+# Same as TreeCtrl::AutoScanCheck, but calls RandomMotion and
+# RandomAutoScanCheckAux
+def randomAutoScanCheck(t, x, y)
+ x1, y1, x2, y2 = t.contentbox
+ margin = t.winfo_pixels(t.scrollmargin)
+ if x < x1 + margin || x >= x2 - margin || y < y1 + margin || y >= y2 - margin
+ if ! @Priv.exist?(:autoscan, :afterId, t)
+ if y >= y2 - margin
+ t.yview(:scroll, 1, :units)
+ delay = t.yscrolldelay
+ elsif y < y1 + margin
+ t.yview(:scroll, -1, :units)
+ delay = t.yscrolldelay
+ elsif x >= x2 - margin
+ t.xview(:scroll, 1, :units)
+ delay = t.xscrolldelay
+ elsif x < x1 + margin
+ t.xview(:scroll, -1, :units)
+ delay = t.xscrolldelay
+ end
+ if @Priv.exist?(:autoscan, :scanning, t)
+ delay = delay[1] if delay.kind_of?(Array)
+ else
+ delay = delay[0] if delay.kind_of?(Array)
+ @Priv[:autoscan, :scanning, t] = true
+ end
+ case @Priv['buttonMode']
+ when 'drag', 'marquee'
+ randomMotion(t, x, y)
+ end
+ @Priv[:autoscan, :afterId, t] =
+ Tk.after(delay, proc{ randomAutoScanCheckAux(t) })
+ end
+ return
+ end
+ Tk::TreeCtrl::BindCallback.autoScanCancel(t)
+end
+
+def randomAutoScanCheckAux(t)
+ @Priv.unset(:autoscan, :afterId, t)
+ x = t.winfo_pointerx - t.winfo_rootx
+ y = t.winfo_pointery - t.winfo_rooty
+ randomAutoScanCheck(t, x, y)
+end
+
+#
+# Demo: random N items, button images
+#
+def demoRandom2(t)
+ demoRandom(t)
+
+ init_pics('mac-*')
+
+ t.configure(:openbuttonimage=>@images['mac-collapse'],
+ :closedbuttonimage=>@images['mac-expand'],
+ :showlines=>false)
+end
diff --git a/ext/tk/sample/tkextlib/treectrl/readme.txt b/ext/tk/sample/tkextlib/treectrl/readme.txt
new file mode 100644
index 0000000000..81e13b24aa
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/readme.txt
@@ -0,0 +1,2 @@
+The scripts and image files in this directory are based on demo files
+of Tcl/Tk's TreeCtrl extension.
diff --git a/ext/tk/sample/tkextlib/treectrl/www-options.rb b/ext/tk/sample/tkextlib/treectrl/www-options.rb
new file mode 100644
index 0000000000..6a3e9c2201
--- /dev/null
+++ b/ext/tk/sample/tkextlib/treectrl/www-options.rb
@@ -0,0 +1,303 @@
+def demoInternetOptions (t)
+ @Option = TkVarAccess.new_hash('::Option')
+
+ height = t.font.metrics(:linespace) + 2
+ height = 18 if height < 18
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:browse)
+
+ init_pics('internet-*')
+
+ if $HasColumnCreate
+ t.column_create(:text=>'Internet Options')
+ else
+ t.column_configure(0, :text=>'Internet Options')
+ end
+
+ t.state_define('check')
+ t.state_define('radio')
+ t.state_define('on')
+
+ t.element_create('e1', :image, :image=>[
+ @images['internet-check-on'], ['check', 'on'],
+ @images['internet-check-off'], ['check'],
+ @images['internet-radio-on'], ['radio', 'on'],
+ @images['internet-radio-off'], ['radio']
+ ])
+ t.element_create('e2', :text,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('e3', :rect, :showfocus=>true,
+ :fill=>[@SystemHighlight, ['selected', 'focus']])
+
+ s = t.style_create('s1')
+ t.style_elements(s, ['e3', 'e1', 'e2'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e2', :expand=>:ns)
+ t.style_layout(s, 'e3', :union=>['e2'], :iexpand=>:ns, :ipadx=>2)
+
+ parentList = [:root, '', '', '', '', '', '']
+ parent = :root
+ [
+ [0, :print, "Printing", "", ""],
+ [1, :off, "Print background colors and images", "o1", ""],
+ [0, :search, "Search from Address bar", "", ""],
+ [1, :search, "When searching", "", ""],
+ [2, :off, "Display results, and go to the most likely sites",
+ "o2", "r1"],
+ [2, :off, "Do not search from the Address bar", "o3", "r1"],
+ [2, :off, "Just display the results in the main window",
+ "o4", "r1"],
+ [2, :on, "Just go to the most likely site", "o5", "r1"],
+ [0, :security, "Security", "", ""],
+ [1, :on, "Check for publisher's certificate revocation", "o5", ""],
+ [1, :off, "Check for server certificate revocation (requires restart)",
+ "o6", ""]
+ ].each{|depth, setting, text, option, group|
+ item = t.item_create()
+ t.item_style_set(item, 0, 's1')
+ t.item_element_configure(item, 0, 'e2', :text=>text)
+ @Option[:option, item] = option
+ @Option[:group, item] = group
+ if setting == :on || setting == :off
+ @Option[:setting, item] = setting
+ if group == ''
+ t.item_state_set(item, 'check')
+ if setting == :on
+ t.item_state_set(item, 'on')
+ end
+ else
+ if setting == :on
+ @Option[:current, group] = item
+ t.item_state_set(item, 'on')
+ end
+ t.item_state_set(item, 'radio')
+ end
+ else
+ t.item_element_configure(item, 0, 'e1',
+ :image=>@images["internet-#{setting}"])
+ end
+ t.item_lastchild(parentList[depth], item)
+ depth += 1
+ parentList[depth] = item
+ }
+
+ treeCtrlOption = TkBindTag.new
+ treeCtrlOption.bind('Double-ButtonPress-1', proc{|w, x, y|
+ Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
+ }, '%W %x %y')
+ treeCtrlOption.bind('ButtonPress-1', proc{|w, x, y|
+ optionButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('Button1-Motion', proc{|w, x, y|
+ optionMotion1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('Button1-Leave', proc{|w, x, y|
+ optionLeave1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('ButtonRelease-1', proc{|w, x, y|
+ optionRelease1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ t.bindtags = [
+ t, treeCtrlOption, Tk::TreeCtrl, t.winfo_toplevel, TkBindTag::ALL
+ ]
+end
+
+def optionButton1(w, x, y)
+ w.set_focus
+ id = w.identify(x, y)
+ if id[0] == 'header'
+ Tk::TreeCtrl::BindCallback.buttonPress1(w, x, y)
+ elsif id.empty?
+ @Priv['buttonMode'] = ''
+ else
+ @Priv['buttonMode'] = ''
+ item = id[1]
+ w.selection_modify(item, :all)
+ w.activate(item)
+ return if @Option[:option, item] == ''
+ group = @Option[:group, item]
+ if group == ''
+ # a checkbutton
+ w.item_state_set(item, '~on')
+ if @Option[:setting, item] == 'on'
+ setting = :off
+ else
+ setting = :on
+ end
+ @Option[:setting, item] = setting
+ else
+ # a radiobutton
+ current = @Option[:current, group]
+ return if current == item.to_s
+ w.item_state_set(current, '!on')
+ w.item_state_set(item, 'on')
+ @Option[:setting, item] = :on
+ @Option[:current, group] = item
+ end
+ end
+end
+
+# Alternate implementation that doesn't rely on run-time styles
+def demoInternetOptions_2(t)
+ height = t.font.metrics(:linespace) + 2
+ height = 18 if height < 18
+ t.configure(:showroot=>false, :showbuttons=>false, :showlines=>false,
+ :itemheight=>height, :selectmode=>:browse)
+
+ init_pics('internet-*')
+
+ t.column_configure(0, :text=>'Internet Options')
+
+ t.element_create('e1', :image)
+ t.element_create('e2', :text,
+ :fill=>[@SystemHighlightText, ['selected', 'focus']])
+ t.element_create('e3', :rect, :showfocus=>true,
+ :fill=>[@SystemHighlight, ['selected', 'focus']])
+
+ s = t.style_create('s1')
+ t.style_elements('s1', ['e3', 'e1', 'e2'])
+ t.style_layout(s, 'e1', :padx=>[0,4], :expand=>:ns)
+ t.style_layout(s, 'e2', :expand=>:ns)
+ t.style_layout(s, 'e3', :union=>['e2'], :iexpand=>:ns, :ipadx=>2)
+
+ parentList = [:root, '', '', '', '', '', '']
+ parent = :root
+ [
+ [0, :print, "Printing", "", ""],
+ [1, :off, "Print background colors and images", "o1", ""],
+ [0, :search, "Search from Address bar", "", ""],
+ [1, :search, "When searching", "", ""],
+ [2, :off, "Display results, and go to the most likely sites",
+ "o2", "r1"],
+ [2, :off, "Do not search from the Address bar", "o3", "r1"],
+ [2, :off, "Just display the results in the main window",
+ "o4", "r1"],
+ [2, :on, "Just go to the most likely site", "o5", "r1"],
+ [0, :security, "Security", "", ""],
+ [1, :on, "Check for publisher's certificate revocation", "o5", ""],
+ [1, :off, "Check for server certificate revocation (requires restart)",
+ "o6", ""]
+ ].each{|depth, setting, text, option, group|
+ item = t.item_create()
+ t.item_style_set(item, 0, 's1')
+ t.item_element_configure(item, 0, 'e2', :text=>text)
+ @Option[:option, item] = option
+ @Option[:group, item] = group
+ if setting == :on || setting == :off
+ @Option[:setting, item] = setting
+ if group == ''
+ img = @images["internet-check-#{setting}"]
+ t.item_element_configure(item, 0, 'e1', :image=>img)
+ else
+ if setting == :on
+ @Option[:current, group] = item
+ end
+ img = @images["internet-radio-#{setting}"]
+ t.item_element_configure(item, 0, 'e1', :image=>img)
+ end
+ else
+ t.item_element_configure(item, 0, 'e1',
+ :image=>@images["internet-#{setting}"])
+ end
+ t.item_lastchild(parentList[depth], item)
+ depth += 1
+ parentList[depth] = item
+ }
+
+ treeCtrlOption = TkBindTag.new
+ treeCtrlOption.bind('Double-ButtonPress-1', proc{|w, x, y|
+ Tk::TreeCtrl::BindCallback.doubleButton1(w, x, y)
+ }, '%W %x %y')
+ treeCtrlOption.bind('ButtonPress-1', proc{|w, x, y|
+ optionButton1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('Button1-Motion', proc{|w, x, y|
+ optionMotion1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('Button1-Leave', proc{|w, x, y|
+ optionLeave1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+ treeCtrlOption.bind('ButtonRelease-1', proc{|w, x, y|
+ optionRelease1(w, x, y)
+ Tk.callback_break
+ }, '%W %x %y')
+
+ t.bindtags = [
+ t, treeCtrlOption, Tk::TreeCtrl, t.winfo_toplevel, TkBindTag::ALL
+ ]
+end
+
+def optionButton1_2(w, x, y)
+ w.set_focus
+ id = w.identify(x, y)
+ if id[0] == 'header'
+ Tk::TreeCtrl::BindCallback.buttonPress1(w, x, y)
+ elsif id.empty?
+ @Priv['buttonMode'] = ''
+ else
+ @Priv['buttonMode'] = ''
+ item = id[1]
+ w.selection_modify(item, :all)
+ w.activate(item)
+ return if @Option[:option, item] == ''
+ group = @Option[:group, item]
+ if group == ''
+ # a checkbutton
+ if @Option[:setting, item] == 'on'
+ setting = :off
+ else
+ setting = :on
+ end
+ w.item_element_configure(item, 0, 'e1',
+ :image=>@images["internet-check-#{setting}"])
+ @Option[:setting, item] = setting
+ else
+ # a radiobutton
+ current = @Option[:current, group]
+ return if current == item.to_s
+ w.item_element_configure(current, 0, 'e1',
+ :image=>@images["internet-radio-off"])
+ w.item_element_configure(item, 0, 'e1',
+ :image=>@images["internet-radio-on"])
+ @Option[:setting, item] = :on
+ @Option[:current, group] = item
+ end
+ end
+end
+
+def optionMotion1(w, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.motion1(w, x, y)
+ end
+end
+
+def optionLeave1(w, x, y)
+ # This is called when I do ButtonPress-1 on Unix for some reason,
+ # and buttonMode is undefined.
+ begin
+ mode = @Priv['buttonMode']
+ rescue
+ else
+ case mode
+ when 'header'
+ t.column_configure(@Priv['column'], :sunken=>false)
+ end
+ end
+end
+
+def optionRelease1(w, x, y)
+ case @Priv['buttonMode']
+ when 'resize', 'header'
+ Tk::TreeCtrl::BindCallback.release1(w, x, y)
+ end
+ @Priv['buttonMode'] = ''
+end
diff --git a/ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt b/ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt
new file mode 100644
index 0000000000..f2e0edcf42
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt
@@ -0,0 +1,51 @@
+
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+ >>> The following text is the original 'license.txt' of vu extension. <<<
+ >>> Original Tcl source files are not include in this directory, <<<
+ >>> because of all of them are rewritten to Ruby files. <<<
+ >>> However, the bitmap data file included in this directory is the <<<
+ >>> same file of vu extension. So, the bitmap data file is under the <<<
+ >>> following license. <<<
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ * COPYRIGHT AND LICENSE TERMS *
+
+(This file blatantly stolen from Tcl/Tk license and adapted - thus assume
+it falls under similar license terms).
+
+This software is copyrighted by Jeffrey Hobbs <jeff.hobbs@acm.org> and
+others. The following terms apply to all files associated with the
+software unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute, and
+license this software and its documentation for any purpose, provided that
+existing copyright notices are retained in all copies and that this notice
+is included verbatim in any distributions. No written agreement, license,
+or royalty fee is required for any of the authorized uses.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS
+PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO
+OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+RESTRICTED RIGHTS: Use, duplication or disclosure by the U.S. government
+is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
+of the Rights in Technical Data and Computer Software Clause as DFARS
+252.227-7013 and FAR 52.227-19.
+
+SPECIAL NOTES:
+
+This software also falls under the bourbon_ware clause:
+
+ Should you find this software useful in your daily work, you should
+ feel obliged to take the author out for a drink if the opportunity
+ presents itself. The user may feel exempt from this clause if they
+ are under 21 or think the author has already partaken of too many
+ drinks.
diff --git a/ext/tk/sample/tkextlib/vu/README.txt b/ext/tk/sample/tkextlib/vu/README.txt
new file mode 100644
index 0000000000..ce5f371fac
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/README.txt
@@ -0,0 +1,50 @@
+
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+ >>> The following text is the original 'README.txt' of <<<
+ >>> vu extension demos. <<<
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+##
+## DESCRIPTION OF DEMOS
+##
+
+canvItems.tcl
+ old demo of all canvas chart items, useful to find memory leaks.
+ <1> prints out the additional memory usage (charts.so + script)
+
+canvSticker.tcl
+ Heribert Dahms original "demo.tcl"
+ <p> creates DEMO.ps
+
+canvSticker2.tcl
+ compares "sticker" and "text"; press <1>, <2> or <1> ...
+ <p> creates DEMO.ps
+
+dial.tcl
+ demo of variations of the dial widget.
+
+load.tcl
+ Just a utility file, not a real demo.
+
+m128_000.xbm
+ XBM pic used by sticker and canvItems demos
+
+oscilloscope.tcl
+ the heart of a Realtime Oscilloscope,where the PCs joystick
+ port gives 4 digtal inputs and 4 analog 8 bit values with an
+ resolution of ~1 millisecond (!!!) running Realtime Linux.
+ <p> creates DEMO.ps
+
+pie.tcl
+ The magic 3D spinning pie chart!
+
+vu.tcl
+ demo fo Vu widgets
+
+canvLabel.tcl
+ 'label' is a canvas item just like 'text', but with -angle
+ rotation of the string. This is not built in by default, as
+ it requires the internal Tk headers.
+ press <1>, <2> or <1> ...
+ <p> creates DEMO.ps
+
diff --git a/ext/tk/sample/tkextlib/vu/canvItems.rb b/ext/tk/sample/tkextlib/vu/canvItems.rb
new file mode 100644
index 0000000000..364f87613b
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/canvItems.rb
@@ -0,0 +1,90 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/charts'
+
+#######################################
+
+xbm = File.join(File.dirname(File.expand_path(__FILE__)), 'm128_000.xbm')
+
+sval = [ 11, 22, 33, 44, 55, 66, 77, 88, 99 ]
+
+l0 = TkLabel.new(:width=>128, :height=>128,
+ :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left)
+
+c0 = TkCanvas.new(:width=>80, :height=>80,
+ :insertwidth=>0, :highlightthickness=>0,
+ :selectborderwidth=>0, :borderwidth=>2,
+ :relief=>:ridge).place(:in=>l0, :relx=>0.5, :rely=>0.5,
+ :anchor=>:c)
+
+st = Tk::Vu::TkcStripchart.new(c0, 3, 3, 80, 80,
+ :background=>"#b7c0d7", :fill=>'slategray3',
+ :jumpscroll=>1, :outline=>'black',
+ :scaleline=>'blue', :stripline=>'red',
+ :selected=>1, :values=>sval)
+
+TkcText.create(c0, 40, 40,
+ :text=>Tk::TCL_PATCHLEVEL, :fill=>'cyan', :tags=>'text')
+
+
+l1 = TkLabel.new(:width=>128, :height=>128,
+ :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left)
+
+c1 = TkCanvas.new(:width=>80, :height=>80,
+ :insertwidth=>0, :highlightthickness=>0,
+ :selectborderwidth=>0, :borderwidth=>2,
+ :relief=>:ridge).place(:in=>l1, :relx=>0.5, :rely=>0.5,
+ :anchor=>:c)
+
+bar1 = Tk::Vu::TkcBarchart.new(c1, 3, 3, 80, 80,
+ :background=>"#b7c0d7", :scalevalue=>10.0,
+ :autocolor=>true, :selected=>1,
+ :outline=>'black', :barline=>'yellow',
+ :scalelinestyle=>0)
+
+bar2 = Tk::Vu::TkcBarchart.new(c1, 53, 3, 80, 80,
+ :background=>"#b7c0d7", :scalevalue=>10.0,
+ :autocolor=>true, :selected=>1,
+ :outline=>'black', :fill=>"#b7c0d7",
+ :barline=>'red', :scalelinestyle=>22)
+
+
+l2 = TkLabel.new(:width=>128, :height=>128,
+ :bitmap=>"@#{xbm}", :relief=>:groove).pack(:side=>:left)
+
+c2 = TkCanvas.new(:width=>80, :height=>80,
+ :insertwidth=>0, :highlightthickness=>0,
+ :selectborderwidth=>0, :borderwidth=>2,
+ :relief=>:ridge).place(:in=>l2, :relx=>0.5, :rely=>0.5,
+ :anchor=>:c)
+
+begin
+ stick = Tk::Vu::TkcSticker.new(c2, 3, 3, 80, 80,
+ :text=>"Tcl/Tk", :space=>0, :color=>'red',
+ :outline=>'red', :font=>'Helvetica 14 bold',
+ :fill=>'', :stipple=>'', :bar=>'blue',
+ :orient=>:vertical, :anchor=>:s,
+ :relheight=>1.0, :relwidth=>0.15,
+ :relx=>0.1, :rely=>0.0)
+rescue
+ stick = nil
+ TkcText.new(c2, 40, 10, :text=>"No Sticker Item")
+end
+
+c_do = proc{
+ st[:values] = rand() * 100
+
+ bar1[:values] = rand() * 10
+ bar2[:values] = rand() * 10
+
+ stick[:rely] = rand() * 100 * 0.01 if stick
+}
+
+c0.bind('1', c_do)
+
+TkTimer.new(100, -1, c_do).start
+
+Tk.root.bind('q', proc{exit})
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker.rb b/ext/tk/sample/tkextlib/vu/canvSticker.rb
new file mode 100644
index 0000000000..85713ebcf3
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/canvSticker.rb
@@ -0,0 +1,82 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/charts'
+
+#######################################
+
+Tk.root.geometry('+30+30')
+
+delay = 2000
+
+c = TkCanvas.new.pack
+
+begin
+ st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10)
+rescue
+ Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
+ :message=>"This build of vu does not include the sticker item")
+ exit
+end
+#st.delete
+
+steps = []
+
+steps << proc{
+ # I used a 75dpi screen for testing, but others should make no difference!
+ puts 'You\'ll see a small upright rectangle with "He" inside.'
+ st = Tk::Vu::TkcSticker.new(c, '6m', '10m', '13m', '27m', :text=>'Hello')
+}
+
+steps << proc{
+ puts 'You\'ll see the whole "Hello" drawn rotated 90 degrees.'
+ st[:orient] = :vertical
+}
+
+steps << proc{
+ puts 'The rectangle shrinks and the text is clipped to "Hell"'
+ #st.coords('6m', '10m', '13m', '20m')
+ st.coords('6m', '10m', '13m', '17m')
+}
+
+steps << proc{
+ puts 'Now you\'ll read "ello"'
+ st[:lefttrunc] = true
+}
+
+steps << proc{
+ puts 'Enlarging the rectangle shows the complete "Hello" again'
+ st.scale(0, 0, 3, 3)
+}
+
+steps << proc{
+ puts 'This time the text is repeated: "Hello", approx. 5mm space, "Hello"'
+ st[:space] = '5m'
+}
+
+steps << proc{
+ puts 'A vertical bar appears in the lower right region and text jumps to the left.'
+ st.configure(:anchor=>:n, :relw=>0.3, :relh=>0.7,
+ :relx=>0.6, :rely=>0.3, :bar=>'red')
+}
+
+steps << proc{
+ puts 'Paint the backgound.'
+ st[:fill] = 'yellow'
+}
+
+steps << proc{
+ puts "Let's test stippling."
+ st[:stipple] = 'gray25'
+}
+
+steps << proc{
+ puts 'Finally a large outline forces a single "Hello" and shrinks the bar.'
+ st[:width] = '6m'
+}
+
+Tk.root.bind('q', proc{exit})
+
+TkTimer.new(delay, 1, *steps).start
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/canvSticker2.rb b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
new file mode 100644
index 0000000000..3d9495ffb0
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/canvSticker2.rb
@@ -0,0 +1,101 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/charts'
+
+#######################################
+
+c = TkCanvas.new.pack
+
+begin
+ st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10)
+rescue
+ Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
+ :message=>"This build of vu does not include the sticker item")
+ exit
+end
+
+c.destroy
+
+#---
+#--- set STRING {{x0 y0 x1 y1} {...text...} {resize point: center}
+
+#sti_conf = [ [10, 10, 180, 180], "Sticker äöüß@²³¼½¾", :center ]
+#txt_conf = [ [210, 210], "Text äöüß@²³¼½¾", :center ]
+sti_conf = [ [10, 10, 350, 350],
+ Tk::UTF8_String('Sticker \u00E4\u00F6\u00FC\u00DF\u0040\u00B2\u00B3\u00BC\u00BD\u00BE'),
+ :center ]
+txt_conf = [ [250, 250],
+ Tk::UTF8_String('Text \u00E4\u00F6\u00FC\u00DF\u0040\u00B2\u00B3\u00BC\u00BD\u00BE'),
+ :center ]
+
+#p sti_conf
+
+fnt = TkFont.new('Helvetica 24 bold')
+
+#---GUI
+c = TkCanvas.new(:width=>500, :height=>500, :bg=>'aquamarine3').pack
+
+#---CRRW Use the technique of eval the coord ...
+sti = Tk::Vu::TkcSticker.new(c, sti_conf[0]){
+ anchor sti_conf[2]
+ bar 'black'
+ color 'red'
+ fill ''
+ font fnt
+ lefttrunc 0
+ outline ''
+ relheight 0.0
+ relwidth 0.0
+ relx 0.0
+ rely 0.0
+ space 0
+ stipple ''
+ tags 'sti'
+ text sti_conf[1]
+ width 0
+ orient :vertical
+ minwidth 0
+ minheight 0
+ maxwidth 32767
+ maxheight 32767
+}
+
+txt = TkcText.new(c, txt_conf[0]){
+ activefill ''
+ activestipple ''
+ anchor txt_conf[2]
+ disabledfill ''
+ disabledstipple ''
+ fill 'blue'
+ font fnt
+ justify :left
+ offset '0,0'
+ state ''
+ stipple ''
+ tags ['tex']
+ text txt_conf[1]
+ width 0
+}
+
+#---BINDINGS
+c.bind('2', proc{
+ sti[:orient] = :horizontal
+ txt[:width] = 0 # horizontal
+ })
+
+c.bind('3', proc{
+ sti[:orient] = :vertical
+ txt[:width] = 1 # top down
+ })
+
+Tk.root.bind('p', proc{
+ c.postscript(:file=>'DEMO.ps')
+ puts "DEMO.ps printed"
+ })
+
+Tk.root.bind('q', proc{exit})
+
+#####################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/dial_demo.rb b/ext/tk/sample/tkextlib/vu/dial_demo.rb
new file mode 100644
index 0000000000..f1f2f110b1
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/dial_demo.rb
@@ -0,0 +1,113 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/dial'
+
+#######################################
+
+v_volume = TkVariable.new
+v_speed = TkVariable.new
+v_dir = TkVariable.new
+v_rot = TkVariable.new
+v_linked = TkVariable.new
+v_needle = TkVariable.new
+
+volume = Tk::Vu::Dial.new(:label=>"Volume", :from=>-0.1, :to=>0.1,
+ :resolution=>0.001, :minortickinterval=>0.01,
+ :tickinterval=>0.1, :beginangle=>-20,
+ :endangle=>260, :variable=>v_volume)
+
+speed = Tk::Vu::Dial.new(:label=>"Speed", :from=>2000, :to=>100,
+ :resolution=>10, :tickinterval=>100,
+ :minortickinterval=>0, :variable=>v_speed,
+ :showtags=>:label, :showvalue=>false)
+
+speed.set_tag_constrain(100, 'Fast', 2000, 'Slow')
+
+fwd = Tk::Vu::Dial.new(:from=>-10.0, :to=>-20.0, :resolution=>0.1,
+ :tickinterval=>5.0, :minortickinterval=>1.0,
+ :variable=>v_dir)
+
+rev = Tk::Vu::Dial.new(:from=>-20.0, :to=>-10.0, :resolution=>0.1,
+ :tickinterval=>5.0, :minortickinterval=>1.0,
+ :variable=>v_dir)
+
+small = Tk::Vu::Dial.new(:font=>"Helvetica -10", :from=>0, :to=>10,
+ :resolution=>0.05, :tickinterval=>2,
+ :minortickinterval=>0.5, :radius=>20,
+ :dialcolor=>'red2', :activebackground=>'red',
+ :variable=>v_rot)
+
+large = Tk::Vu::Dial.new(:font=>"Helvetica -8", :from=>0, :to=>10,
+ :resolution=>0.05, :tickinterval=>1,
+ :minortickinterval=>0.25, :radius=>40,
+ :dialcolor=>'red2', :activebackground=>'red',
+ :variable=>v_rot)
+
+turn = Tk::Vu::Dial.new(:needlecolor=>'red', :label=>"Linked",
+ :variable=>v_linked)
+
+scale = TkScale.new(:label=>"Linked", :variable=>v_linked)
+
+d1 = Tk::Vu::Dial.new(:resolution=>0.0001, :from=>-0.1, :to=>0.1,
+ :showvalue=>true, :minortickinterval=>0.01,
+ :tickinterval=>0.1, :radius=>30, :label=>"Dial",
+ :beginangle=>-20, :endangle=>260, :variable=>v_needle,
+ :relief=>:raised)
+
+d2 = Tk::Vu::Dial.new(:resolution=>0.01, :from=>-0.1, :to=>0.1,
+ :showvalue=>true, :minortickinterval=>0.01,
+ :tickinterval=>0.1, :radius=>30, :label=>"Dial 2",
+ :beginangle=>-20, :endangle=>260, :variable=>v_needle,
+ :dialrelief=>:flat, :needlecolor=>'red',
+ :needletype=>:triangle, :relief=>:sunken)
+
+d3 = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1,
+ :showvalue=>true, :minortickinterval=>0.01,
+ :tickinterval=>0.1, :radius=>30, :label=>"Dial 3",
+ :beginangle=>-20, :endangle=>260, :variable=>v_needle,
+ :dialrelief=>:flat, :needlecolor=>'blue',
+ :needletype=>:arc, :relief=>:ridge)
+
+f_btns = TkFrame.new
+f_sep = TkFrame.new(:height=>2, :relief=>:sunken, :bd=>1)
+
+
+v_volume.value = -0.1
+v_speed.value = 500
+
+update = TkTimer.new(proc{v_speed.numeric}, -1, proc{
+ if v_volume == volume[:to]
+ v_volume.numeric = volume[:from]
+ else
+ v_volume.numeric += volume[:resolution]
+ end
+ })
+
+b_start = TkButton.new(:text=>"Start", :command=>proc{update.start})
+b_stop = TkButton.new(:text=>"Stop", :command=>proc{update.stop})
+b_exit = TkButton.new(:text=>"Exit", :command=>proc{exit})
+
+Tk.grid(b_start, :in=>f_btns, :sticky=>:ew, :padx=>4, :pady=>4)
+Tk.grid(b_stop, :in=>f_btns, :sticky=>:ew, :padx=>4, :pady=>4)
+f_btns.grid_columnconfigure(0, :weight=>1)
+
+Tk.grid(f_btns, speed, volume, :sticky=>:news)
+Tk.grid(f_sep, '-', '-', :sticky=>:news)
+Tk.grid(fwd, rev, d1, :sticky=>:news)
+Tk.grid(small, large, d2, :sticky=>:news)
+Tk.grid(turn, scale, d3, :sticky=>:news)
+
+Tk.grid(b_exit, '-', '-', :sticky=>:ew, :padx=>4, :pady=>4)
+
+Tk.root.grid_columnconfigure(0, :weight=>1)
+Tk.root.grid_columnconfigure(1, :weight=>1)
+Tk.root.grid_columnconfigure(2, :weight=>1)
+
+Tk.root.grid_rowconfigure(0, :weight=>1)
+Tk.root.grid_rowconfigure(2, :weight=>1)
+Tk.root.grid_rowconfigure(3, :weight=>1)
+Tk.root.grid_rowconfigure(4, :weight=>1)
+
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/m128_000.xbm b/ext/tk/sample/tkextlib/vu/m128_000.xbm
new file mode 100644
index 0000000000..455e3c5e0f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/m128_000.xbm
@@ -0,0 +1,174 @@
+#define m128_000_width 128
+#define m128_000_height 128
+static unsigned char m128_000_bits[] = {
+ 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff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0x03,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/ext/tk/sample/tkextlib/vu/oscilloscope.rb b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
new file mode 100644
index 0000000000..1efe13ce01
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/oscilloscope.rb
@@ -0,0 +1,68 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/charts'
+
+#---USAGE
+info = "...the heart of a Realtime Oscilloscope, where the PCIs
+joystick port gives 4 digtal inputs and 4 analog 8 bit
+values with an resolution of ~1 millisecond (!!!)
+running Realtime Linux.
+<p> creates DEMO.ps
+<B1-Motion> see what happens"
+puts info
+
+#---GEOMETRY
+geo_fr = [10, 10, 210, 180]
+geo_ch0 = [10, 10, 210, 90]
+geo_ch1 = [10, 90, 210, 180]
+geo_t1 = [15, 88]
+
+#---GUI
+c = TkCanvas.new(:width=>220, :height=>190).pack(:fill=>:both, :expand=>true)
+
+#---background
+TkcRectangle.new(c, geo_fr, :width=>4, :fill=>'aquamarine3',
+ :tags=>['osc', 'frbg'])
+
+#---channel 0
+ch0 = Tk::Vu::TkcStripchart.new(c, geo_ch0,
+ :fill=>'', :jumpscroll=>false,
+ :outline=>'', :scaleline=>'',
+ :stripline=>'cyan', :tags=>['osc', 'ch0'])
+
+#---channel 1
+ch1 = Tk::Vu::TkcStripchart.new(c, geo_ch1,
+ :fill=>'', :jumpscroll=>0,
+ :outline=>'', :scaleline=>'',
+ :stripline=>'red', :tags=>['osc', 'ch1'])
+
+#---frame
+TkcRectangle.new(c, geo_fr, :width=>4, :tags=>['osc', 'frfg'])
+
+#---position
+txt1 = TkcText.new(c, geo_t1, :text=>"B1-Motion: X:%X\tY:%Y",
+ :anchor=>:nw, :tags=>['osc', 'txt1'])
+
+#---BINDINGS
+c.bind('B1-Motion', proc{|x, y, xx, yy|
+ ch0[:values] = x
+ ch1[:values] = y
+ txt1[:text] = "B1-Motion: X:#{xx}\tY:#{yy}"
+ }, '%x %y %X %Y')
+
+Tk.root.bind('v', proc{
+ puts ch0[:values].join(' ')
+ puts ch0[:values].size
+ })
+
+Tk.root.bind('p', proc{
+ c.postscript(:file=>'DEMO.ps')
+ puts "DEMO.ps printed"
+ })
+
+Tk.root.bind('q', proc{exit})
+
+#####################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/pie.rb b/ext/tk/sample/tkextlib/vu/pie.rb
new file mode 100644
index 0000000000..c8f9276e4e
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/pie.rb
@@ -0,0 +1,56 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu/pie'
+
+pie = Tk::Vu::Pie.new(:label=>"My Revolving Budget"){
+ itemconfigure('Welfare', :value=>3.004)
+ itemconfigure('Military', :value=>7.006)
+ itemconfigure('Transport', :value=>1.6, :explode=>15)
+ itemconfigure('Parks', :value=>0.9)
+ itemconfigure('Schools', :value=>2)
+ itemconfigure('Debt', :value=>4, :explode=>10)
+
+ configure(:angle=>10, :origin=>90, :shadow=>10)
+}
+
+spin = TkTimer.new(60, -1, proc{|obj|
+ pie.configure(:origin=>pie[:origin] + 1)
+})
+
+f = TkFrame.new
+fast_btn = TkButton.new(f, :text=>"Spin Faster", :command=>proc{spin.start})
+slow_btn = TkButton.new(f, :text=>"Spin Slower", :command=>proc{spin.stop})
+quit_btn = TkButton.new(f, :text=>"Exit", :command=>proc{exit})
+
+Tk.grid(pie, :sticky=>:news)
+Tk.grid(f, :sticky=>:ew)
+
+Tk.pack(fast_btn, slow_btn, quit_btn,
+ :in=>f, :side=>:left, :fill=>:both, :expand=>true, :padx=>6, :pady=>4)
+
+Tk.root.grid_columnconfigure(0, :weight=>1)
+Tk.root.grid_rowconfigure(0, :weight=>1)
+
+priv = {
+ :x=>0, :y=>0, :pie_in=>false, :angle=>pie[:angle], :origin=>pie[:origin]
+}
+
+pie.bind('ButtonPress-1', proc{|w, x, y|
+ priv[:x] = x
+ priv[:y] = y
+ priv[:pie_in] = (w.winfo_width/1.8 > x)
+ priv[:angle] = w[:angle]
+ priv[:origin] = w[:origin]
+ }, '%W %x %y')
+
+pie.bind('B1-Motion', proc{|w, x, y|
+ if priv[:pie_in]
+ w.configure(:angle=>priv[:angle] + (priv[:y] - y)/3,
+ :origin=>(priv[:origin] +
+ ((w.winfo_height/2.2 > y)? -1: 1) *
+ (priv[:x] - x)/3) % 360)
+ end
+ }, '%W %x %y')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkextlib/vu/vu_demo.rb b/ext/tk/sample/tkextlib/vu/vu_demo.rb
new file mode 100644
index 0000000000..358d32495f
--- /dev/null
+++ b/ext/tk/sample/tkextlib/vu/vu_demo.rb
@@ -0,0 +1,67 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+require 'tkextlib/vu'
+
+#######################################
+
+puts "Show off barchart and dial widgets"
+
+speed = TkVariable.new(0)
+
+dial = Tk::Vu::Dial.new(:resolution=>0.001, :from=>-0.1, :to=>0.1,
+ :showvalue=>true, :minortickinterval=>0.01,
+ :tickinterval=>0.1, :radius=>50, :label=>"Dial",
+ :beginangle=>-20, :endangle=>260, :dialcolor=>'red3',
+ :active=>'red2', :variable=>speed)
+
+bar = Tk::Vu::Bargraph.new(:from=>0, :to=>100, :relief=>:groove,
+ :border=>2, :label=>"Bar Chart")
+
+#######################################
+
+green = 25
+blue = 50
+purple = 75
+current = 50
+
+def rand_bool
+
+end
+
+update = TkTimer.new(200, -1, proc{
+ if (rand() - 0.5 + speed.numeric * 3) > 0
+ current += 1
+ else
+ current -= 1
+ end
+ bar.set(current)
+ if current < green
+ current = 100 if current <= 0
+ bar[:barcolor] = 'green'
+ elsif current < blue
+ bar[:barcolor] = 'blue'
+ elsif current < purple
+ bar[:barcolor] = 'purple'
+ else
+ bar[:barcolor] = 'red'
+ current = 0 if current >= 100
+ end
+ })
+
+#######################################
+
+gobar = TkButton.new(:text=>"Start", :command=>proc{update.start})
+nobar = TkButton.new(:text=>"Stop", :command=>proc{update.stop})
+quit = TkButton.new(:text=>"Exit", :command=>proc{exit})
+
+Tk.grid('x', gobar, :sticky=>:ew, :padx=>4, :pady=>4)
+Tk.grid(dial, bar, :sticky=>:news)
+Tk.grid('x', nobar, :sticky=>:ew, :padx=>4, :pady=>4)
+Tk.grid(quit, '-', '-', :sticky=>:ew, :padx=>4, :pady=>4)
+Tk.root.grid_columnconfigure(2, :weight=>1)
+Tk.root.grid_rowconfigure(1, :weight=>1)
+
+#######################################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkfrom.rb b/ext/tk/sample/tkfrom.rb
new file mode 100644
index 0000000000..f51f7f5d85
--- /dev/null
+++ b/ext/tk/sample/tkfrom.rb
@@ -0,0 +1,132 @@
+#!/usr/bin/env ruby
+
+require "parsedate"
+require "base64"
+
+include ParseDate
+
+class Mail
+ def Mail.new(f)
+ if !f.kind_of?(IO)
+ f = open(f, "r")
+ me = super(f)
+ f.close
+ else
+ me = super
+ end
+ return me
+ end
+
+ def initialize(f)
+ @header = {}
+ @body = []
+ while line = f.gets()
+ $_.chop!
+ next if /^From / =~ line # skip From-line
+ break if /^$/ =~ line # end of header
+ if /^(\S+):\s*(.*)/ =~ line
+ @header[attr = $1.capitalize] = $2
+ elsif attr
+ sub(/^\s*/, '')
+ @header[attr] += "\n" + $_
+ end
+ end
+
+ return unless $_
+
+ while line = f.gets()
+ break if /^From / =~ line
+ @body.push($_)
+ end
+ end
+
+ def header
+ return @header
+ end
+
+ def body
+ return @body
+ end
+
+end
+
+if ARGV.length == 0
+ if ENV['MAIL']
+ ARGV[0] = ENV['MAIL']
+ elsif ENV['USER']
+ ARGV[0] = '/var/spool/mail/' + ENV['USER']
+ elsif ENV['LOGNAME']
+ ARGV[0] = '/var/spool/mail/' + ENV['LOGNAME']
+ end
+end
+
+require "tk"
+list = scroll = nil
+TkFrame.new{|f|
+ list = TkListbox.new(f) {
+ yscroll proc{|*idx|
+ scroll.set *idx
+ }
+ relief 'raised'
+# geometry "80x5"
+ width 80
+ height 5
+ setgrid 'yes'
+ pack('side'=>'left','fill'=>'both','expand'=>'yes')
+ }
+ scroll = TkScrollbar.new(f) {
+ command proc{|idx|
+ list.yview *idx
+ }
+ pack('side'=>'right','fill'=>'y')
+ }
+ pack
+}
+root = Tk.root
+TkButton.new(root) {
+ text 'Dismiss'
+ command proc {exit}
+ pack('fill'=>'both','expand'=>'yes')
+}
+root.bind "Control-c", proc{exit}
+root.bind "Control-q", proc{exit}
+root.bind "space", proc{exit}
+
+$outcount = 0;
+for file in ARGV
+ next unless File.exist?(file)
+ atime = File.atime(file)
+ mtime = File.mtime(file)
+ f = open(file, "r")
+ begin
+ until f.eof
+ mail = Mail.new(f)
+ date = mail.header['Date']
+ next unless date
+ from = mail.header['From']
+ subj = mail.header['Subject']
+ y = m = d = 0
+ y, m, d = parsedate(date) if date
+ from = "sombody@somewhere" unless from
+ subj = "(nil)" unless subj
+ from = decode_b(from)
+ subj = decode_b(subj)
+ list.insert 'end', format('%-02d/%02d/%02d [%-28.28s] %s',y,m,d,from,subj)
+ $outcount += 1
+ end
+ ensure
+ f.close
+ File.utime(atime, mtime, file)
+ list.see 'end'
+ end
+end
+
+limit = 10000
+if $outcount == 0
+ list.insert 'end', "You have no mail."
+ limit = 2000
+end
+Tk.after limit, proc{
+ exit
+}
+Tk.mainloop
diff --git a/ext/tk/sample/tkhello.rb b/ext/tk/sample/tkhello.rb
new file mode 100644
index 0000000000..597c1f6242
--- /dev/null
+++ b/ext/tk/sample/tkhello.rb
@@ -0,0 +1,10 @@
+require "tk"
+
+TkButton.new(nil,
+ :text => 'hello',
+ :command => proc{print "hello\n"}).pack(:fill=>'x')
+TkButton.new(nil,
+ :text => 'quit',
+ :command => proc{exit}).pack(:fill=>'x')
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkline.rb b/ext/tk/sample/tkline.rb
new file mode 100644
index 0000000000..3124c2fe0c
--- /dev/null
+++ b/ext/tk/sample/tkline.rb
@@ -0,0 +1,47 @@
+
+require "tkclass"
+
+$tkline_init = FALSE
+def start_random
+ return if $tkline_init
+ $tkline_init = TRUE
+ if defined? Thread
+ Thread.start do
+ loop do
+ sleep 2
+ Line.new($c, rand(400), rand(200), rand(400), rand(200))
+ end
+ end
+ end
+end
+
+Label.new('text'=>'Please press or drag button-1').pack
+
+$c = Canvas.new
+$c.pack
+$start_x = start_y = 0
+
+def do_press(x, y)
+ $start_x = x
+ $start_y = y
+ $current_line = Line.new($c, x, y, x, y)
+ start_random
+end
+def do_motion(x, y)
+ if $current_line
+ $current_line.coords $start_x, $start_y, x, y
+ end
+end
+
+def do_release(x, y)
+ if $current_line
+ $current_line.coords $start_x, $start_y, x, y
+ $current_line.fill 'black'
+ $current_line = nil
+ end
+end
+
+$c.bind("1", proc{|e| do_press e.x, e.y})
+$c.bind("B1-Motion", proc{|x, y| do_motion x, y}, "%x %y")
+$c.bind("ButtonRelease-1", proc{|x, y| do_release x, y}, "%x %y")
+Tk.mainloop
diff --git a/ext/tk/sample/tkmenubutton.rb b/ext/tk/sample/tkmenubutton.rb
new file mode 100644
index 0000000000..8ae1359425
--- /dev/null
+++ b/ext/tk/sample/tkmenubutton.rb
@@ -0,0 +1,135 @@
+#!/usr/bin/env ruby
+#
+# menubutton sample : based on sample menubuttons on the Tcl/Tk demo script
+#
+require 'tk'
+
+TkLabel.new(:text=>'Sample of TkMenubutton').pack(:side=>:top)
+
+TkFrame.new{|f|
+ pack(:side=>:top)
+
+
+ TkMenubutton.new(:parent=>f, :text=>'Right', :underline=>0,
+ :direction=>:right, :relief=>:raised){|mb|
+ menu TkMenu.new(:parent=>mb, :tearoff=>0){
+ add(:command, :label=>'Right menu: first item',
+ :command=>proc{print 'You have selected the first item' +
+ " from the Right menu.\n"})
+ add(:command, :label=>'Right menu: second item',
+ :command=>proc{print 'You have selected the second item' +
+ " from the Right menu.\n"})
+ }
+ pack(:side=>:left, :padx=>25, :pady=>25)
+ }
+
+ TkMenubutton.new(:parent=>f, :text=>'Below', :underline=>0,
+ :direction=>:below, :relief=>:raised){|mb|
+ menu(TkMenu.new(:parent=>mb, :tearoff=>0){
+ add(:command, :label=>'Below menu: first item',
+ :command=>proc{print 'You have selected the first item' +
+ " from the Below menu.\n"})
+ add(:command, :label=>'Below menu: second item',
+ :command=>proc{print 'You have selected the second item' +
+ " from the Below menu.\n"})
+ })
+ pack(:side=>:left, :padx=>25, :pady=>25)
+ }
+
+ TkMenubutton.new(:parent=>f, :text=>'Above', :underline=>0,
+ :direction=>:above, :relief=>:raised){|mb|
+ menu TkMenu.new(:parent=>mb, :tearoff=>0){
+ add(:command, :label=>'Above menu: first item',
+ :command=>proc{print 'You have selected the first item' +
+ " from the Above menu.\n"})
+ add(:command, :label=>'Above menu: second item',
+ :command=>proc{print 'You have selected the second item' +
+ " from the Above menu.\n"})
+ }
+ pack(:side=>:left, :padx=>25, :pady=>25)
+ }
+
+ TkMenubutton.new(:parent=>f, :text=>'Left', :underline=>0,
+ :direction=>:left, :relief=>:raised){|mb|
+ menu(TkMenu.new(:parent=>mb, :tearoff=>0){
+ add(:command, :label=>'Left menu: first item',
+ :command=>proc{print 'You have selected the first item' +
+ " from the Left menu.\n"})
+ add(:command, :label=>'Left menu: second item',
+ :command=>proc{print 'You have selected the second item' +
+ " from the Left menu.\n"})
+ })
+ pack(:side=>:left, :padx=>25, :pady=>25)
+ }
+}
+
+############################
+TkFrame.new(:borderwidth=>2, :relief=>:sunken,
+ :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20)
+############################
+
+TkLabel.new(:text=>'Sample of TkOptionMenu').pack(:side=>:top)
+
+colors = %w(Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50
+ Yellow Cyan Magenta White Brown DarkSeaGreen DarkViolet)
+
+TkFrame.new{|f|
+ pack(:side=>:top)
+
+ b1 = TkOptionMenubutton .
+ new(:parent=>f, :values=>%w(one two three)) .
+ pack(:side=>:left, :padx=>25, :pady=>25)
+
+ b2 = TkOptionMenubutton.new(:parent=>f, :values=>colors) {|optMB|
+ colors.each{|color|
+ no_sel = TkPhotoImage.new(:height=>16, :width=>16){
+ put 'gray50', *[ 0, 0, 16, 1]
+ put 'gray50', *[ 0, 1, 1, 16]
+ put 'gray75', *[ 0, 15, 16, 16]
+ put 'gray75', *[15, 1, 16, 16]
+ put color, *[ 1, 1, 15, 15]
+ }
+ sel = TkPhotoImage.new(:height=>16, :width=>16){
+ put 'Black', *[ 0, 0, 16, 2]
+ put 'Black', *[ 0, 2, 2, 16]
+ put 'Black', *[ 2, 14, 16, 16]
+ put 'Black', *[14, 2, 16, 14]
+ put color, *[ 2, 2, 14, 14]
+ }
+ optMB.entryconfigure(color, :hidemargin=>1,
+ :image=>no_sel, :selectimage=>sel)
+ }
+ optMB.menuconfigure(:tearoff, 1)
+ %w(Black gray75 gray50 White).each{|color|
+ optMB.entryconfigure(color, :columnbreak=>true)
+ }
+ pack(:side=>:left, :padx=>25, :pady=>25)
+ }
+
+ TkButton.new(:parent=>f){
+ text 'show values'
+ command proc{p [b1.value, b2.value]}
+ pack(:side=>:left, :padx=>25, :pady=>5, :anchor=>:s)
+ }
+}
+
+############################
+TkFrame.new(:borderwidth=>2, :relief=>:sunken,
+ :height=>5).pack(:side=>:top, :fill=>:x, :padx=>20)
+############################
+
+root = TkRoot.new(:title=>'menubutton samples')
+
+TkButton.new(root, :text=>'exit', :command=>proc{exit}){
+ pack(:side=>:top, :padx=>25, :pady=>5, :anchor=>:e)
+}
+
+# VirtualEvent <<MenuSelect>> on Tcl/Tk ==> '<MenuSelect>' on Ruby/Tk
+# ( remove the most external <, > for Ruby/Tk notation )
+TkMenu.bind('<MenuSelect>', proc{|widget|
+ p widget.entrycget('active', :label)
+ }, '%W')
+
+############################
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkmsgcat-load_rb.rb b/ext/tk/sample/tkmsgcat-load_rb.rb
new file mode 100644
index 0000000000..98a91fadf4
--- /dev/null
+++ b/ext/tk/sample/tkmsgcat-load_rb.rb
@@ -0,0 +1,102 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+
+demo_dir = File.dirname($0)
+msgcat_dir = [demo_dir, 'msgs_rb'].join(File::Separator)
+top_win = nil
+#msgcat = TkMsgCatalog.new('::tk')
+msgcat = TkMsgCatalog.new('::tkmsgcat_demo')
+default_locale = msgcat.locale
+#msgcat.load_rb(msgcat_dir)
+msgcat.load(msgcat_dir)
+
+col_proc = TkComm.install_bind(proc{|w, color, frame, label|
+ TkComm.window(frame).background(color)
+ Tk.update
+ TkComm.window(label).text(
+ msgcat["%1$s:: %2$s", 'Color',
+ color.capitalize])
+ w.flash; w.flash
+ Tk.callback_break;
+ }, "%W")
+
+del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
+
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+ msgcat['Application Error'])})
+
+show_sample = proc{|loc|
+ top_win = TkToplevel.new(:title=>loc)
+
+ msgcat.locale = loc
+ #msgcat.load_rb(msgcat_dir)
+ msgcat.load(msgcat_dir)
+
+ TkLabel.new(top_win){
+ text "preferences:: #{msgcat.preferences.join(' ')}"
+ pack(:pady=>10, :padx=>10)
+ }
+
+ lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s",
+ 'Color', '']).pack(:anchor=>'w')
+
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
+ :expand=>true, :fill=>:both)
+
+ TkFrame.new(bg){|f|
+ ['blue', 'green', 'red'].each{|col|
+ TkButton.new(f, :text=>msgcat[col]){
+ bind('ButtonRelease-1', col_proc, "#{col} #{bg.path} #{lbl.path}")
+ }.pack(:fill=>:x)
+ }
+ }.pack(:anchor=>'center', :pady=>15)
+
+ TkFrame.new(top_win){|f|
+ TkButton.new(f, :text=>msgcat['Delete'],
+ :command=>del_proc).pack(:side=>:right, :padx=>5)
+ TkButton.new(f, :text=>msgcat['Error'],
+ :command=>err_proc).pack(:side=>:left, :padx=>5)
+ }.pack(:side=>:bottom, :fill=>:x)
+
+ top_win
+}
+
+
+# listbox for locale list
+TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
+
+TkFrame.new{|f|
+ TkButton.new(f, :text=>msgcat['Exit'],
+ :command=>proc{exit}).pack(:side=>:right, :padx=>5)
+}.pack(:side=>:bottom, :fill=>:x)
+
+f = TkFrame.new.pack(:side=>:top, :fill=>:both, :expand=>true)
+lbox = TkListbox.new(f).pack(:side=>:left, :fill=>:both, :expand=>true)
+lbox.yscrollbar(TkScrollbar.new(f, :width=>12).pack(:side=>:right, :fill=>:y))
+
+lbox.bind('ButtonRelease-1'){|ev|
+ idx = lbox.index("@#{ev.x},#{ev.y}")
+ if idx == 0
+ loc = default_locale
+ else
+ loc = lbox.get(idx)
+ end
+ if top_win != nil && top_win.exist?
+ top_win.destroy
+ end
+ top_win = show_sample.call(loc)
+}
+
+lbox.insert('end', 'default')
+
+Dir.entries(msgcat_dir).sort.each{|f|
+ if f =~ /^(.*).msg$/
+ lbox.insert('end', $1)
+ end
+}
+
+top_win = show_sample.call(default_locale)
+
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/tkmsgcat-load_rb2.rb b/ext/tk/sample/tkmsgcat-load_rb2.rb
new file mode 100644
index 0000000000..05512a3131
--- /dev/null
+++ b/ext/tk/sample/tkmsgcat-load_rb2.rb
@@ -0,0 +1,102 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+
+demo_dir = File.dirname($0)
+msgcat_dir = [demo_dir, 'msgs_rb2'].join(File::Separator)
+top_win = nil
+#msgcat = TkMsgCatalog.new('::tk')
+msgcat = TkMsgCatalog.new('::tkmsgcat_demo')
+default_locale = msgcat.locale
+#msgcat.load_rb(msgcat_dir)
+msgcat.load(msgcat_dir)
+
+col_proc = TkComm.install_bind(proc{|w, color, frame, label|
+ TkComm.window(frame).background(color)
+ Tk.update
+ TkComm.window(label).text(
+ msgcat["%1$s:: %2$s", 'Color',
+ color.capitalize])
+ w.flash; w.flash
+ Tk.callback_break;
+ }, "%W")
+
+del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
+
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+ msgcat['Application Error'])})
+
+show_sample = proc{|loc|
+ top_win = TkToplevel.new(:title=>loc)
+
+ msgcat.locale = loc
+ #msgcat.load_rb(msgcat_dir)
+ msgcat.load(msgcat_dir)
+
+ TkLabel.new(top_win){
+ text "preferences:: #{msgcat.preferences.join(' ')}"
+ pack(:pady=>10, :padx=>10)
+ }
+
+ lbl = TkLabel.new(top_win, :text=>msgcat["%1$s:: %2$s",
+ 'Color', '']).pack(:anchor=>'w')
+
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
+ :expand=>true, :fill=>:both)
+
+ TkFrame.new(bg){|f|
+ ['blue', 'green', 'red'].each{|col|
+ TkButton.new(f, :text=>msgcat[col]){
+ bind('ButtonRelease-1', col_proc, "#{col} #{bg.path} #{lbl.path}")
+ }.pack(:fill=>:x)
+ }
+ }.pack(:anchor=>'center', :pady=>15)
+
+ TkFrame.new(top_win){|f|
+ TkButton.new(f, :text=>msgcat['Delete'],
+ :command=>del_proc).pack(:side=>:right, :padx=>5)
+ TkButton.new(f, :text=>msgcat['Error'],
+ :command=>err_proc).pack(:side=>:left, :padx=>5)
+ }.pack(:side=>:bottom, :fill=>:x)
+
+ top_win
+}
+
+
+# listbox for locale list
+TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
+
+TkFrame.new{|f|
+ TkButton.new(f, :text=>msgcat['Exit'],
+ :command=>proc{exit}).pack(:side=>:right, :padx=>5)
+}.pack(:side=>:bottom, :fill=>:x)
+
+f = TkFrame.new.pack(:side=>:top, :fill=>:both, :expand=>true)
+lbox = TkListbox.new(f).pack(:side=>:left, :fill=>:both, :expand=>true)
+lbox.yscrollbar(TkScrollbar.new(f, :width=>12).pack(:side=>:right, :fill=>:y))
+
+lbox.bind('ButtonRelease-1'){|ev|
+ idx = lbox.index("@#{ev.x},#{ev.y}")
+ if idx == 0
+ loc = default_locale
+ else
+ loc = lbox.get(idx)
+ end
+ if top_win != nil && top_win.exist?
+ top_win.destroy
+ end
+ top_win = show_sample.call(loc)
+}
+
+lbox.insert('end', 'default')
+
+Dir.entries(msgcat_dir).sort.each{|f|
+ if f =~ /^(.*).msg$/
+ lbox.insert('end', $1)
+ end
+}
+
+top_win = show_sample.call(default_locale)
+
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/tkmsgcat-load_tk.rb b/ext/tk/sample/tkmsgcat-load_tk.rb
new file mode 100644
index 0000000000..703f471e19
--- /dev/null
+++ b/ext/tk/sample/tkmsgcat-load_tk.rb
@@ -0,0 +1,118 @@
+#!/usr/bin/env ruby
+
+require 'tk'
+
+demo_dir = File.dirname($0)
+msgcat_dir = [demo_dir, 'msgs_tk'].join(File::Separator)
+top_win = nil
+#msgcat = TkMsgCatalog.new('::tk')
+msgcat = TkMsgCatalog.new('::tkmsgcat_demo')
+default_locale = msgcat.locale
+msgcat.load_tk(msgcat_dir)
+
+col_proc = TkComm.install_bind(proc{|w, color, frame, label|
+ TkComm.window(frame).background(color)
+ Tk.update
+ TkComm.window(label).text(
+ msgcat.mc("%1$s:: %2$s", 'Color',
+ color.capitalize))
+ w.flash; w.flash
+ Tk.callback_break;
+ }, "%W")
+
+del_proc = TkComm.install_cmd(proc{top_win.destroy; top_win = nil})
+
+err_proc = TkComm.install_cmd(proc{fail(RuntimeError,
+ msgcat.mc('Application Error'))})
+
+show_sample = proc{|loc|
+ top_win = TkToplevel.new(:title=>loc)
+
+ msgcat.locale = loc
+ msgcat.load_tk(msgcat_dir)
+
+ TkLabel.new(top_win){
+ text "preferences:: #{msgcat.preferences.join(' ')}"
+ pack(:pady=>10, :padx=>10)
+ }
+
+ lbl = TkLabel.new(top_win, :text=>msgcat.mc("%1$s:: %2$s",
+ 'Color', '')).pack(:anchor=>'w')
+
+ bg = TkFrame.new(top_win).pack(:ipadx=>20, :ipady=>10,
+ :expand=>true, :fill=>:both)
+
+ TkFrame.new(bg){|f|
+ ['blue', 'green', 'red'].each{|col|
+ TkButton.new(f, :text=>msgcat.mc(col)){
+ bind('ButtonRelease-1', col_proc, "#{col} #{bg.path} #{lbl.path}")
+ }.pack(:fill=>:x)
+=begin
+ TkButton.new(f, :text=>msgcat.mc(col),
+ :command=>proc{
+ bg.background col
+ lbl.text msgcat.mc("%1$s:: %2$s", 'Color', col.capitalize)
+ }).pack(:fill=>:x)
+=end
+ }
+ }.pack(:anchor=>'center', :pady=>15)
+
+ TkFrame.new(top_win){|f|
+ TkButton.new(f, :text=>msgcat.mc('Delete'),
+ :command=>del_proc).pack(:side=>:right, :padx=>5)
+ TkButton.new(f, :text=>msgcat.mc('Error'),
+ :command=>err_proc).pack(:side=>:left, :padx=>5)
+=begin
+ TkButton.new(f, :text=>msgcat.mc('Delete'),
+ :command=>proc{
+ top_win.destroy
+ top_win = nil
+ }).pack(:side=>:right, :padx=>5)
+ TkButton.new(f, :text=>msgcat.mc('Error'),
+ :command=>proc{
+ fail RuntimeError, msgcat.mc('Application Error')
+ }).pack(:side=>:left, :padx=>5)
+=end
+ }.pack(:side=>:bottom, :fill=>:x)
+
+ top_win
+}
+
+
+# listbox for locale list
+TkLabel.new(:text=>"Please click a locale.").pack(:padx=>5, :pady=>3)
+
+TkFrame.new{|f|
+ TkButton.new(f, :text=>msgcat.mc('Exit'),
+ :command=>proc{exit}).pack(:side=>:right, :padx=>5)
+}.pack(:side=>:bottom, :fill=>:x)
+
+f = TkFrame.new.pack(:side=>:top, :fill=>:both, :expand=>true)
+lbox = TkListbox.new(f).pack(:side=>:left, :fill=>:both, :expand=>true)
+lbox.yscrollbar(TkScrollbar.new(f, :width=>12).pack(:side=>:right, :fill=>:y))
+
+lbox.bind('ButtonRelease-1'){|ev|
+ idx = lbox.index("@#{ev.x},#{ev.y}")
+ if idx == 0
+ loc = default_locale
+ else
+ loc = lbox.get(idx)
+ end
+ if top_win != nil && top_win.exist?
+ top_win.destroy
+ end
+ top_win = show_sample.call(loc)
+}
+
+lbox.insert('end', 'default')
+
+Dir.entries(msgcat_dir).sort.each{|f|
+ if f =~ /^(.*).msg$/
+ lbox.insert('end', $1)
+ end
+}
+
+top_win = show_sample.call(default_locale)
+
+# start eventloop
+Tk.mainloop
diff --git a/ext/tk/sample/tkmulticolumnlist.rb b/ext/tk/sample/tkmulticolumnlist.rb
new file mode 100644
index 0000000000..a1b3a1a2fa
--- /dev/null
+++ b/ext/tk/sample/tkmulticolumnlist.rb
@@ -0,0 +1,743 @@
+#
+# tkmulticolumnlist.rb : multiple column list widget on scrollable frame
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+class TkMultiColumnList < TkText
+ include TkComposite
+
+ # lbox_height : height of listboxes (pixel)
+ # title_info : array [ [<title_string>,<init_width>], ... ]
+ # keys : hash {<option>=><value>, ... }
+ def initialize_composite(lbox_height, title_info, keys={})
+ # argument check
+ if (! title_info.kind_of? Array) or (title_info.size < 2)
+ raise
+ end
+
+ # mode
+ @keep_minsize = true
+ @show_each_hscr = true
+ @show_win_hscr = true
+
+ # init arrays
+ @base_list = []
+ @rel_list = []
+ @title_list = []
+ @title_cmd = []
+ @lbox_list = []
+ @hscr_list = []
+
+ # decide total width
+ @lbox_total = title_info.size
+ @width_total = 0
+ title_info.each{|title, width, cmd|
+ @width_total += width.to_f
+ @title_cmd << cmd
+ }
+
+ # rel-table of label=>index
+ @name_index = {}
+
+ # size definition
+ @window_width = @width_total
+ @sash = 5
+ @scrbar_width = 15
+ @scrbar_border = 3
+ @lbox_border = 1
+ @title_border = 3
+ @h_l_thick = 0
+
+ # init status
+ @mode = :title
+ @command = nil
+
+ # virtical scrollbar
+ @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'width'=>@scrbar_width)
+
+ # horizontal scrollbar
+ @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'width'=>@scrbar_width)
+
+ # create base flames
+ @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_title = TkFrame.new(@c_title, 'width'=>@width_total)
+ @w_title = TkcWindow.new(@c_title, 0, 0,
+ 'window'=>@f_title, 'anchor'=>'nw')
+
+ @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_lbox = TkFrame.new(@c_lbox, 'width'=>@width_total)
+ @w_lbox = TkcWindow.new(@c_lbox, 0, 0, 'window'=>@f_lbox, 'anchor'=>'nw')
+
+ @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_hscr = TkFrame.new(@c_hscr, 'width'=>@width_total)
+ @w_hscr = TkcWindow.new(@c_hscr, 0, 0, 'window'=>@f_hscr, 'anchor'=>'nw')
+
+ # create each listbox
+ sum = 0.0
+ @rel_list << sum/@width_total
+ title_info.each_with_index{|(label, width), idx|
+ # set relation between label and index
+ if @name_index.include?(label)
+ @name_index[label] << idx
+ else
+ @name_index[label] = [idx]
+ end
+
+ # calculate relative positioning
+ sum += width
+ @rel_list << sum/@width_total
+
+ # title field
+ f = TkFrame.new(@f_title, 'width'=>width)
+ base = [f]
+
+ title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border,
+ 'relief'=>'raised', 'highlightthickness'=>@h_l_thick)
+ title_binding(title, idx)
+ title.pack('fill'=>'x')
+
+ @title_list << title
+
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relheight'=>1.0,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ # listbox field
+ f = TkFrame.new(@f_lbox, 'width'=>width)
+ base << f
+ @lbox_list << TkText.new(f, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@lbox_border,
+ 'takefocus'=>false,
+ 'wrap'=>'none') {
+
+ bindtags(bindtags - [TkText])
+
+ @seltag = TkTextTag.new(self, 'background'=>'#b3b3b3',
+ 'borderwidth'=>1, 'relief'=>'raised')
+ def self.nearest(y)
+ self.index("@1,#{y}").split('.')[0].to_i
+ end
+
+ def self.select_clear(first, last=nil)
+ first = "#{first}.0" if first.kind_of?(Integer)
+ first = self.index(first.to_s + ' linestart')
+ last = first unless last
+ last = "#{last}.0" if first.kind_of?(Integer)
+ last = self.index(last.to_s + ' + 1 lines linestart')
+ @seltag.remove(first, last)
+ end
+
+ def self.select_set(first, last=nil)
+ first = "#{first}.0" if first.kind_of?(Integer)
+ first = self.index(first.to_s + ' linestart')
+ last = first unless last
+ last = "#{last}.0" if first.kind_of?(Integer)
+ last = self.index(last.to_s + ' + 1 lines linestart')
+ @seltag.add(first, last)
+ end
+
+ def self.select_index
+ self.index(@seltag.first).split('.')[0].to_i
+ end
+
+ pack('fill'=>'both', 'expand'=>true)
+ }
+
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0)
+
+ # scrollbar field
+ f = TkFrame.new(@f_hscr, 'width'=>width)
+ base << f
+ @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width,
+ 'borderwidth'=>@scrbar_border,
+ 'highlightthickness'=>@h_l_thick
+ ).pack('fill'=>'x', 'anchor'=>'w')
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ @lbox_list[idx].xscrollbar(@hscr_list[idx])
+
+ # add new base
+ @base_list << base
+ }
+
+ # pad
+ @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised',
+ 'borderwidth'=>@title_border,
+ 'highlightthickness'=>@h_l_thick)
+
+ @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken',
+ 'borderwidth'=>1,
+ 'highlightthickness'=>@h_l_thick)
+
+ # height check
+ title_height = 0
+ @title_list.each{|w|
+ h = w.winfo_reqheight
+ title_height = h if title_height < h
+ }
+
+ hscr_height = 0
+ @hscr_list.each{|w|
+ h = w.winfo_reqheight
+ hscr_height = h if hscr_height < h
+ }
+
+ @f_title.height title_height
+ @f_lbox.height lbox_height
+ @f_hscr.height hscr_height
+
+ # set control procedure for virtical scroll
+ @v_scroll.assign(*@lbox_list)
+
+ # set control procedure for horizoncal scroll
+ @h_scroll.assign(@c_title, @c_lbox, @c_hscr)
+
+ # binding for listboxes
+ @lbox_list.each_with_index{|l, idx|
+ l.bind('Button-1', proc{|w, y|
+ @frame.focus
+ select_line(w, w.nearest(y))
+ }, '%W %y')
+ l.bind('B1-Motion', proc{|w, y|
+ select_line(w, w.nearest(y))
+ }, '%W %y')
+ l.bind('Double-Button-1', proc{
+ @command.call(get_select) if @command
+ })
+
+ l.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W')
+ l.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W')
+
+ l.bind('Button-2', proc{|x, y|
+ @lbox_mark_x = x
+ @lbox_list.each{|lbox| lbox.scan_mark(x, y)}
+ }, '%x %y')
+ l.bind('B2-Motion', proc{|x, y|
+ @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)}
+ l.scan_dragto(x, y)
+ }, '%x %y')
+ }
+
+ bbox = @w_title.bbox
+ @c_title.height(bbox[3])
+ @c_title.scrollregion(bbox)
+
+ bbox = @w_lbox.bbox
+ @c_lbox.height(bbox[3])
+ @c_lbox.scrollregion(bbox)
+
+ if @show_each_hscr
+ bbox = @w_hscr.bbox
+ @c_hscr.height(bbox[3])
+ @c_hscr.scrollregion(bbox)
+ end
+
+ # binding
+ @frame.takefocus(true)
+ @frame.bind('Key-Up', proc{select_shift(@lbox_list[0], -1)})
+ @frame.bind('Key-Down', proc{select_shift(@lbox_list[0], 1)})
+ @frame.bind('Return', proc{@command.call(get_select) if @command})
+
+ # alignment
+ TkGrid.rowconfigure(@frame, 0, 'weight'=>0)
+ TkGrid.rowconfigure(@frame, 1, 'weight'=>1)
+ TkGrid.rowconfigure(@frame, 2, 'weight'=>0)
+ TkGrid.rowconfigure(@frame, 3, 'weight'=>0)
+ TkGrid.columnconfigure(@frame, 0, 'weight'=>1)
+ TkGrid.columnconfigure(@frame, 1, 'weight'=>0)
+ TkGrid.columnconfigure(@frame, 2, 'weight'=>0)
+ @v_scroll.grid('row'=>1, 'column'=>2, 'sticky'=>'ns')
+ @c_title.grid('row'=>0, 'column'=>0, 'sticky'=>'news')
+ @f_title_pad.grid('row'=>0, 'column'=>2, 'sticky'=>'news')
+ @c_lbox.grid('row'=>1, 'column'=>0, 'sticky'=>'news')
+ @c_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew') if @show_each_hscr
+ @h_scroll.grid('row'=>3, 'column'=>0, 'sticky'=>'ew') if @show_win_hscr
+ @f_scr_pad.grid('row'=>2, 'rowspan'=>2, 'column'=>2, 'sticky'=>'news')
+
+ # binding for 'Configure' event
+ @c_lbox.bind('Configure',
+ proc{|height, width| reconstruct(height, width)},
+ '%h %w')
+
+ # set default receiver of method calls
+ @path = @frame.path
+
+ # configure options
+ keys = {} unless keys
+ keys = _symbolkey2str(keys)
+
+ # command
+ cmd = keys.delete('command')
+ command(cmd) if cmd
+
+ # 'scrollbarwidth' option == 'width' option of scrollbars
+ width = keys.delete('scrollbarwidth')
+ scrollbarwidth(width) if width
+
+ # options for listbox titles
+ title_font = keys.delete('titlefont')
+ titlefont(title_font) if title_font
+
+ title_fg = keys.delete('titleforeground')
+ titleforeground(title_fg) if title_fg
+
+ title_bg = keys.delete('titlebackground')
+ titlebackground(title_bg) if title_bg
+
+ # set receivers for configure methods
+ delegate('DEFAULT', *@lbox_list)
+ delegate('activebackground', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('troughcolor', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('repeatdelay', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('repeatinterval', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('borderwidth', @frame)
+ delegate('width', @c_lbox, @c_title, @c_hscr)
+ delegate('relief', @frame)
+
+ # configure
+ configure(keys) if keys.size > 0
+ end
+ private :initialize_composite
+
+ # keep_minsize?
+ def keep_minsize?
+ @keep_minsize
+ end
+ def keep_minsize(bool)
+ @keep_minsize = bool
+ end
+
+ # each hscr
+ def show_each_hscr
+ @show_each_hscr = true
+ @c_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew')
+ end
+ def hide_each_hscr
+ @show_each_hscr = false
+ @c_hscr.ungrid
+ end
+
+ # window hscroll
+ def show_win_hscr
+ @show_win_hscr = true
+ @h_scroll.grid('row'=>3, 'column'=>0, 'sticky'=>'ew')
+ end
+ def hide_win_hscr
+ @show_each_hscr = false
+ @h_scroll.ungrid
+ end
+
+ # set command
+ def command(cmd)
+ @command = cmd
+ self
+ end
+
+ # set scrollbar width
+ def scrollbarwidth(width)
+ @scrbar_width = width
+ @v_scroll['width'] = @scrbar_width
+ @h_scroll['width'] = @scrbar_width
+ @hscr_list.each{|hscr| hscr['width'] = @scrbar_width}
+ self
+ end
+
+ # set scrollbar border
+ def scrollbarborder(width)
+ @scrbar_border = width
+ @v_scroll['border'] = @scrbar_border
+ @h_scroll['border'] = @scrbar_border
+ @hscr_list.each{|hscr| hscr['border'] = @scrbar_border}
+ self
+ end
+
+ # set listbox borders
+ def listboxborder(width)
+ @lbox_border = width
+ @lbox_list.each{|w| w['border'] = @lbox_border}
+ self
+ end
+
+ # set listbox relief
+ def listboxrelief(relief)
+ @lbox_list.each{|w| w['relief'] = relief}
+ self
+ end
+
+ # set title borders
+ def titleborder(width)
+ @title_border = width
+ @f_title_pad['border'] = @title_border
+ @title_list.each{|label| label['border'] = @title_border}
+ self
+ end
+
+ # set title font
+ def titlefont(font)
+ @title_list.each{|label| label['font'] = font}
+ title_height = 0
+ @title_list.each{|w|
+ h = w.winfo_reqheight
+ title_height = h if title_height < h
+ }
+ @f_title.height title_height
+ bbox = @w_title.bbox
+ @c_title.height(bbox[3])
+ @c_title.scrollregion(bbox)
+ self
+ end
+
+ # set title foreground color
+ def titleforeground(fg)
+ @title_list.each{|label| label['foreground'] = fg}
+ self
+ end
+
+ # set title background color
+ def titlebackground(bg)
+ @f_title_pad['background'] = bg
+ @title_list.each{|label| label['background'] = bg}
+ self
+ end
+
+ # set title cmds
+ def titlecommand(idx, cmd=Proc.new)
+ @title_cmd[idx] = cmd
+ end
+
+ # call title cmds
+ def titleinvoke(idx)
+ @title_cmd[idx].call if @title_cmd[idx]
+ end
+
+ # get label widgets of listbox titles
+ def titlelabels(*indices)
+ @title_list[*indices]
+ end
+
+ # get listbox widgets
+ def columns(*indices)
+ @lbox_list[*indices]
+ end
+
+ def delete(*idx)
+ idx = idx.collect{|i|
+ if i.kind_of?(Integer)
+ "#{i}.0"
+ else
+ i.to_s
+ end
+ }
+ @lbox_list.collect{|lbox| lbox.delete(*idx)}
+ end
+
+ def get(idx_s, idx_e=nil)
+ unless idx_e
+ if idx_s.kind_of?(Integer)
+ idx_s = "#{idx_s}.0"
+ idx_e = "#{idx_s} lineend"
+ else
+ idx_s = idx_s.to_s
+ idx_e = "#{idx_s} lineend"
+ end
+ @lbox_list.collect{|lbox|
+ lbox.get(idx_s, idx_e)
+ }
+ else
+ if idx_s.kind_of?(Integer)
+ idx_s = "#{idx_s}.0"
+ else
+ idx_s = idx_s.to_s
+ end
+ if idx_e.kind_of?(Integer)
+ idx_e = "#{idx_e}.end"
+ else
+ idx_e = "#{idx_e} lineend"
+ end
+ list = @lbox_list.collect{|lbox| lbox.get(idx_s, idx_e).split(/\n/)}
+ result = []
+ list[0].each_with_index{|line, index|
+ result << list.collect{|lines| lines[index]}
+ }
+ result
+ end
+ end
+
+ def get_select
+ get(@lbox_list[0].select_index)
+ end
+
+ def _line_array_to_hash(line)
+ result = {}
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ result[label] = line[indices[0]]
+ else
+ result[label] = indices.collect{|index| line[index]}
+ end
+ }
+ result
+ end
+ private :_line_array_to_hash
+
+ def get_by_hash(*idx)
+ get_result = get(*idx)
+ if idx.size == 1
+ _line_array_to_hash(get_result)
+ else
+ get_result.collect{|line| _line_array_to_hash(line)}
+ end
+ end
+
+ def insert(idx, *lines)
+ lbox_ins = []
+ (0..@lbox_list.size).each{lbox_ins << []}
+
+ if idx.kind_of?(Integer)
+ idx = "#{idx}.0"
+ else
+ idx = idx.to_s
+ end
+
+ if @lbox_list[0].index('1.0 + 1 char') == @lbox_list[0].index('end')
+ cr = ""
+ else
+ cr = "\n"
+ end
+
+ lines.each{|line|
+ if line.kind_of? Hash
+ array = []
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ array[indices[0]] = line[label]
+ else
+ if line[label].kind_of? Array
+ indices.each_with_index{|index, num|
+ array[index] = line[label][num]
+ }
+ else
+ array[indices[0]] = line[label]
+ end
+ end
+ }
+ line = array
+ end
+
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ lbox_ins[indices[0]] << line[indices[0]]
+ else
+ indices.each{|index| lbox_ins[index] << line[index]}
+ end
+ }
+ }
+
+ @lbox_list.each_with_index{|lbox, index|
+ lbox.insert(idx, cr + lbox_ins[index].join("\n")) if lbox_ins[index]
+ }
+ end
+
+ def select_clear(first, last=None)
+ @lbox_list.each{|lbox| lbox.sel_clear(first, last=None)}
+ end
+
+ def select_set(first, last=None)
+ @lbox_list.each{|lbox| lbox.sel_set(first, last=None)}
+ end
+
+ ###########################################
+ private
+
+ def reconstruct(height, width)
+ if @keep_minsize && width <= @width_total
+ @f_title.width(@width_total)
+ @f_lbox.width(@width_total)
+ @f_hscr.width(@width_total) if @show_each_hscr
+ @window_width = @width_total
+ else
+ @f_title.width(width)
+ @f_lbox.width(width)
+ @f_hscr.width(width) if @show_each_hscr
+ @window_width = width
+ end
+
+ @f_lbox.height(height)
+
+ @c_title.scrollregion(@w_title.bbox)
+ @c_lbox.scrollregion(@w_lbox.bbox)
+ @c_hscr.scrollregion(@w_hscr.bbox) if @show_each_hscr
+
+ (0..(@rel_list.size - 2)).each{|idx|
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+ }
+ end
+
+ def resize(x)
+ idx = @sel_sash
+ return if idx == 0
+
+ # adjustment of relative positioning
+ delta = (x - @x) / @frame_width
+ if delta < @rel_list[idx-1] - @rel_list[idx] + (2*@sash/@frame_width)
+ delta = @rel_list[idx-1] - @rel_list[idx] + (2*@sash/@frame_width)
+ elsif delta > @rel_list[idx+1] - @rel_list[idx] - (2*@sash/@frame_width)
+ delta = @rel_list[idx+1] - @rel_list[idx] - (2*@sash/@frame_width)
+ end
+ @rel_list[idx] += delta
+
+ # adjustment of leftside widget of the sash
+ title, lbox, hscr = @base_list[idx - 1]
+ title.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+ lbox.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+
+ # adjustment of rightside widget of the sash
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+
+ # update reference position
+ @x = x
+ end
+
+ def motion_cb(w, x, idx)
+ if x <= @sash && idx > 0
+ w.cursor 'sb_h_double_arrow'
+ @mode = :sash
+ @sel_sash = idx
+ elsif x >= w.winfo_width - @sash && idx < @lbox_total - 1
+ w.cursor 'sb_h_double_arrow'
+ @mode = :sash
+ @sel_sash = idx + 1
+ else
+ w.cursor ""
+ @mode = :title
+ @sel_sash = 0
+ end
+ end
+
+ def title_binding(title, index)
+ title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ "%W %x #{index}")
+
+ title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ "%W %x #{index}")
+
+ title.bind('Leave', proc{|w| w.cursor ""}, "%W")
+
+ title.bind('Button-1',
+ proc{|w, x|
+ if @mode == :sash
+ @x = x
+ @frame_width = TkWinfo.width(@f_title).to_f
+ else
+ title.relief 'sunken'
+ end
+ },
+ '%W %X')
+
+ title.bind('ButtonRelease-1',
+ proc{|w, x, idx|
+ i = idx.to_i
+ if @mode == :title && @title_cmd[i].kind_of?(Proc)
+ @title_cmd[i].call
+ end
+ title.relief 'raised'
+ motion_cb(w,x,i)
+ },
+ "%W %x #{index}")
+
+ title.bind('B1-Motion', proc{|x| resize(x) if @mode == :sash}, "%X")
+ end
+
+ ########################
+ def select_line(w, idx)
+ @lbox_list.each{|l|
+ l.select_clear(1, 'end')
+ l.select_set(idx)
+ }
+ w.select_set(idx)
+ end
+
+ def select_shift(w, dir)
+ head = w.index('@1,1').split('.')[0].to_i
+ tail = w.index("@1,#{w.winfo_height - 1}").split('.')[0].to_i - 1
+ idx = w.select_index + dir
+ last = w.index('end - 1 char').split('.')[0].to_i
+ if idx < 1
+ idx = 1
+ elsif idx > last
+ idx = last
+ end
+ @lbox_list.each{|l|
+ l.select_clear(1, 'end')
+ l.select_set(idx)
+ }
+ if head > idx
+ @lbox_list.each{|l| l.yview('scroll', -1, 'units')}
+ elsif tail < idx
+ @lbox_list.each{|l| l.yview('scroll', 1, 'units')}
+ end
+ end
+ ########################
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ l = TkMultiColumnList.new(nil, 200,
+ [ ['L1', 200, proc{p 'click L1'}],
+ ['L2', 100],
+ ['L3', 200] ],
+ 'width'=>350,
+ #'titleforeground'=>'yellow',
+ 'titleforeground'=>'white',
+ #'titlebackground'=>'navy',
+ 'titlebackground'=>'blue',
+ 'titlefont'=>'courier'
+ ).pack('fill'=>'both', 'expand'=>true)
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
+ 'cccccccccccccccccccccccccccccccccccccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ p l.columns(1)
+ p l.columns(1..3)
+ p l.columns(1,2)
+
+ l.command proc{|line_info| p line_info}
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkmultilistbox.rb b/ext/tk/sample/tkmultilistbox.rb
new file mode 100644
index 0000000000..7791649c4b
--- /dev/null
+++ b/ext/tk/sample/tkmultilistbox.rb
@@ -0,0 +1,654 @@
+#
+# tkmultilistbox.rb : multiple listbox widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+class TkMultiListbox < TkListbox
+ include TkComposite
+
+ # lbox_height : height of listboxes (pixel)
+ # title_info : array [ [<title_string>,<init_width>], ... ]
+ # keys : hash {<option>=><value>, ... }
+ def initialize_composite(lbox_height, title_info, keys={})
+ # argument check
+ if (! title_info.kind_of? Array) or (title_info.size < 2)
+ raise
+ end
+
+ # decide total width
+ @width_total = 0
+ title_info.each{|title, width| @width_total += width.to_f}
+
+ # virtical scrollbar
+ @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical')
+
+ # init arrays
+ @base_list = []
+ @rel_list = []
+ @title_list = []
+ @lbox_list = []
+ @hscr_list = []
+
+ # rel-table of label=>index
+ @name_index = {}
+
+ # create base flames
+ @f_title = TkFrame.new(@frame, 'width'=>@width_total)
+ @f_lbox = TkFrame.new(@frame,
+ 'width'=>@width_total, 'height'=>lbox_height)
+ @f_hscr = TkFrame.new(@frame, 'width'=>@width_total,
+ 'height'=>@v_scroll.cget('width') +
+ 2 * @v_scroll.cget('borderwidth'))
+
+ # dummy label to keep the hight of title space
+ TkLabel.new(@f_title, 'text'=>' ').pack
+
+ # create each listbox
+ sum = 0.0
+ @rel_list << sum/@width_total
+ title_info.each_with_index{|(label, width), idx|
+ # set relation between label and index
+ if @name_index.include?(label)
+ @name_index[label] << idx
+ else
+ @name_index[label] = [idx]
+ end
+
+ # calculate relative positioning
+ sum += width
+ @rel_list << sum/@width_total
+
+ # title field
+ f = TkFrame.new(@f_title, 'width'=>width)
+ base = [f]
+ @title_list << TkLabel.new(f, 'text'=>label).pack('fill'=>'x')
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-6,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ # listbox field
+ f = TkFrame.new(@f_lbox, 'width'=>width)
+ base << f
+ @lbox_list << TkListbox.new(f).pack('fill'=>'both', 'expand'=>true)
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0)
+
+ # scrollbar field
+ f = TkFrame.new(@f_hscr, 'width'=>width)
+ base << f
+ @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal') .
+ pack('fill'=>'x', 'anchor'=>'w')
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>-4,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ @lbox_list[idx].xscrollcommand proc{|first, last|
+ @hscr_list[idx].set first, last
+ }
+ @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args}
+
+ # add new base
+ @base_list << base
+ }
+
+ # create tab
+ @tab_list = [nil]
+ (1..(@rel_list.size - 2)).each{|idx|
+ tab = TkFrame.new(@f_title, 'cursor'=>'sb_h_double_arrow',
+ 'width'=>6, 'borderwidth'=>2, 'relief'=>'raised')
+ @tab_list << tab
+ tab.place('relx'=>@rel_list[idx], 'anchor'=>'ne', 'relheight'=>0.95)
+ tab.bind('Button-1',
+ proc{|x| @x = x; @frame_width = TkWinfo.width(@f_title).to_f},
+ '%X')
+ tab.bind('B1-Motion', proc{|x, idx| resize(x, idx.to_i)}, "%X #{idx}")
+ }
+
+ # set control procedure for virtical scroll
+ @lbox_list.each{|lbox|
+ lbox.yscrollcommand proc{|first, last|
+ @v_scroll.set first, last
+ }
+ }
+ @v_scroll.command proc{|*args| @lbox_list.each{|lbox| lbox.yview *args} }
+
+ # binding for listboxes
+ @mode = {}
+ @mode['browse'] = browse_mode_bindtag
+ @mode['single'] = single_mode_bindtag
+ @mode['extended'] = extended_mode_bindtag
+ @mode['multiple'] = multiple_mode_bindtag
+ @current_mode = 'browse'
+ @lbox_list.each{|l|
+ l.bind('Shift-Key-Left',
+ proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W')
+ l.bind('Shift-Key-Right',
+ proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W')
+
+ l.bind('Button-2', proc{|x, y|
+ @lbox_mark_x = x
+ @lbox_list.each{|lbox| lbox.scan_mark(x, y)}
+ }, '%x %y')
+ l.bind('B2-Motion', proc{|x, y|
+ @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)}
+ l.scan_dragto(x, y)
+ }, '%x %y')
+
+ l.bindtags(l.bindtags.unshift(@mode[@current_mode]))
+ }
+
+ # alignment
+ TkGrid.rowconfigure(@frame, 0, 'weight'=>0)
+ TkGrid.rowconfigure(@frame, 1, 'weight'=>1)
+ TkGrid.rowconfigure(@frame, 2, 'weight'=>0)
+ TkGrid.columnconfigure(@frame, 0, 'weight'=>1)
+ TkGrid.columnconfigure(@frame, 1, 'weight'=>0)
+ @v_scroll.grid('row'=>1, 'column'=>1, 'sticky'=>'ns')
+ @f_title.grid('row'=>0, 'column'=>0, 'sticky'=>'news')
+ @f_lbox.grid('row'=>1, 'column'=>0, 'sticky'=>'news')
+ @f_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew')
+
+ # binding for 'Configure' event
+ @frame.bind('Configure', proc{reconstruct})
+
+ # set default receiver of method calls
+ @path = @lbox_list[0].path
+
+ # configure options
+ keys = {} unless keys
+ keys = _symbolkey2str(keys)
+
+ # 'mode' option of listboxes
+ sel_mode = keys.delete('mode')
+ mode(sel_mode) if sel_mode
+
+ # 'scrollbarwidth' option == 'width' option of scrollbars
+ width = keys.delete('scrollbarwidth')
+ scrollbarwidth(width) if width
+
+ # options for listbox titles
+ title_font = keys.delete('titlefont')
+ title_fg = keys.delete('titleforeground')
+ title_bg = keys.delete('titlebackground')
+ if title_font or title_fg or title_bg
+ titleconfig(title_font, title_fg, title_bg)
+ end
+
+ # set receivers for configure methods
+ delegate('DEFAULT', *@lbox_list)
+ delegate('activebackground', @v_scroll, *@hscr_list)
+ delegate('troughcolor', @v_scroll, *@hscr_list)
+ delegate('repeatdelay', @v_scroll, *@hscr_list)
+ delegate('repeatinterval', @v_scroll, *@hscr_list)
+ delegate('borderwidth', @frame)
+ delegate('relief', @frame)
+
+ # configure
+ configure(keys) if keys.size > 0
+ end
+ private :initialize_composite
+
+ # set 'mode' option of listboxes
+ def mode(sel_mode)
+ @lbox_list.each{|l|
+ tags = l.bindtags
+ tags = tags - [ @mode[@current_mode] ]
+ l.bindtags(tags.unshift(@mode[sel_mode]))
+ @current_mode = sel_mode
+ }
+ end
+
+ # set scrollbar width
+ def scrollbarwidth(width)
+ @v_scroll['width'] = width
+ @hscr_list.each{|hscr| hscr['width'] = width}
+ @f_hscr['height'] = width + 2 * @v_scroll.cget('borderwidth')
+ end
+
+ # set options of titles
+ def titleconfig(font, fg, bg)
+ keys = {}
+ keys['font'] = font if font
+ keys['foreground'] = fg if fg
+ keys['background'] = bg if bg
+ @title_list.each{|label| label.configure(keys)}
+ end
+
+ # get label widgets of listbox titles
+ def titlelabels(*indices)
+ @title_list[*indices]
+ end
+
+ # get listbox widgets
+ def columns(*indices)
+ @lbox_list[*indices]
+ end
+
+ def activate(idx)
+ @lbox_list.each{|lbox| lbox.activate(idx)}
+ end
+
+ def bbox(idx)
+ @lbox_list.collect{|lbox| lbox.bbox(idx)}
+ end
+
+ def delete(*idx)
+ @lbox_list.collect{|lbox| lbox.delete(*idx)}
+ end
+
+ def get(*idx)
+ if idx.size == 1
+ @lbox_list.collect{|lbox| lbox.get(*idx)}
+ else
+ list = @lbox_list.collect{|lbox| lbox.get(*idx)}
+ result = []
+ list[0].each_with_index{|line, index|
+ result << list.collect{|lines| lines[index]}
+ }
+ result
+ end
+ end
+
+ def _line_array_to_hash(line)
+ result = {}
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ result[label] = line[indices[0]]
+ else
+ result[label] = indices.collect{|index| line[index]}
+ end
+ }
+ result
+ end
+ private :_line_array_to_hash
+
+ def get_by_hash(*idx)
+ get_result = get(*idx)
+ if idx.size == 1
+ _line_array_to_hash(get_result)
+ else
+ get_result.collect{|line| _line_array_to_hash(line)}
+ end
+ end
+
+ def insert(idx, *lines)
+ lbox_ins = []
+ (0..@lbox_list.size).each{lbox_ins << []}
+
+ lines.each{|line|
+ if line.kind_of? Hash
+ array = []
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ array[indices[0]] = line[label]
+ else
+ if line[label].kind_of? Array
+ indices.each_with_index{|index, num|
+ array[index] = line[label][num]
+ }
+ else
+ array[indices[0]] = line[label]
+ end
+ end
+ }
+ line = array
+ end
+
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ lbox_ins[indices[0]] << line[indices[0]]
+ else
+ indices.each{|index| lbox_ins[index] << line[index]}
+ end
+ }
+ }
+
+ @lbox_list.each_with_index{|lbox, index|
+ lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index]
+ }
+ end
+
+ def selection_anchor(index)
+ @lbox_list.each{|lbox| lbox.selection_anchor(index)}
+ end
+
+ def selection_clear(first, last=None)
+ @lbox_list.each{|lbox| lbox.selection_clear(first, last=None)}
+ end
+
+ def selection_set(first, last=None)
+ @lbox_list.each{|lbox| lbox.selection_set(first, last=None)}
+ end
+
+ ###########################################
+ private
+
+ def reconstruct
+ (0..(@rel_list.size - 2)).each{|idx|
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ tab = @tab_list[idx]
+ tab.place('relx'=>@rel_list[idx]) if tab
+ }
+ end
+
+ def resize(x, idx)
+ # adjustment of relative positioning
+ delta = (x - @x) / @frame_width
+ if delta < @rel_list[idx-1] - @rel_list[idx] + 0.02
+ delta = @rel_list[idx-1] - @rel_list[idx] + 0.02
+ elsif delta > @rel_list[idx+1] - @rel_list[idx] - 0.02
+ delta = @rel_list[idx+1] - @rel_list[idx] - 0.02
+ end
+ @rel_list[idx] += delta
+
+ # adjustment of leftside widget of the tab
+ title, lbox, hscr = @base_list[idx - 1]
+ title.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+ lbox.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+
+ # adjustment of the tab position
+ @tab_list[idx].place('relx'=>@rel_list[idx])
+
+ # adjustment of rightside widget of the tab
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+
+ # update reference position
+ @x = x
+ end
+
+ #################################
+ def browse_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_line(w, w.nearest(y))}, '%W %y')
+ t.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-slash',
+ proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+
+ t
+ end
+
+ ########################
+ def single_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-slash',
+ proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-backslash',
+ proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}})
+
+ t
+ end
+
+ ########################
+ def extended_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
+ t.bind('B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+ t.bind('Shift-B1-Motion',
+ proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Control-Button-1',
+ proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Control-B1-Motion',
+ proc{|w, y| select_drag(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W')
+
+ t.bind('Shift-Up', proc{|w| select_expand(w, -1)}, '%W')
+ t.bind('Shift-Down', proc{|w| select_expand(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W')
+
+ t.bind('Control-Shift-Home', proc{|w| select_range(w, 0)}, '%W')
+ t.bind('Control-Shift-End', proc{|w| select_range(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_active(w)}, '%W')
+ t.bind('Select', proc{|w| select_active(w)}, '%W')
+ t.bind('Control-slash', proc{|w| select_all}, '%W')
+ t.bind('Control-backslash', proc{|w| clear_all}, '%W')
+
+ t
+ end
+
+ ########################
+ def multiple_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y')
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W')
+
+ t.bind('Control-Shift-Home', proc{|w| active_line(w, 0)}, '%W')
+ t.bind('Control-Shift-End', proc{|w| active_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_active(w)}, '%W')
+ t.bind('Select', proc{|w| select_active(w)}, '%W')
+ t.bind('Control-slash', proc{|w| select_all}, '%W')
+ t.bind('Control-backslash', proc{|w| clear_all}, '%W')
+
+ t
+ end
+
+ ########################
+ def active_line(w, idx)
+ @lbox_list.each{|l| l.activate(idx)}
+ end
+
+ def select_only(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_range(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.selection_set('anchor', idx)
+ }
+ end
+
+ def select_toggle(w, idx)
+ st = w.selection_includes(idx)
+ @lbox_list.each{|l|
+ l.selection_anchor(idx)
+ if st == 1
+ l.selection_clear(idx)
+ else
+ l.selection_set(idx)
+ end
+ }
+ end
+
+ def select_drag(w, idx)
+ st = w.selection_includes('anchor')
+ @lbox_list.each{|l|
+ if st == 1
+ l.selection_set('anchor', idx)
+ else
+ l.selection_clear('anchor', idx)
+ end
+ }
+ end
+
+ def select_line(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ w.selection_set('anchor')
+ end
+
+ def select_line2(w, idx)
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_line3(w, idx)
+ @lbox_list.each{|l|
+ l.selection_set(idx)
+ }
+ end
+
+ def select_active(w)
+ idx = l.activate(idx)
+ @lbox_list.each{|l|
+ l.selection_set(idx)
+ }
+ end
+
+ def select_expand(w, dir)
+ idx = w.index('active').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_set(idx)
+ }
+ end
+
+ def active_shift(w, dir)
+ idx = w.index('active').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_anchor(idx)
+ }
+ end
+
+ def select_shift(w, dir)
+ idx = w.index('anchor').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_all
+ @lbox_list.each{|l|
+ l.selection_set(0, 'end')
+ }
+ end
+
+ def clear_all
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ }
+ end
+
+ def focus_shift(w, dir)
+ idx = @lbox_list.index(w) + dir
+ return if idx < 0
+ return if idx >= @lbox_list.size
+ @lbox_list[idx].focus
+ end
+ ########################
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ f = TkFrame.new(nil, 'width'=>300,
+ 'height'=>200).pack('fill'=>'both', 'expand'=>'true')
+ #f = TkFrame.new.pack('fill'=>'both', 'expand'=>'true')
+ l = TkMultiListbox.new(f, 150,
+ [ ['L1', 100],
+ ['L2', 200],
+ ['L3', 50] ],
+ 'titlefont'=>'courier',
+ 'titleforeground'=>'yellow',
+ 'titlebackground'=>'navy'
+ ).pack('fill'=>'both', 'expand'=>true)
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ p l.columns(1)
+ p l.columns(1..3)
+ p l.columns(1,2)
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkmultilistframe.rb b/ext/tk/sample/tkmultilistframe.rb
new file mode 100644
index 0000000000..7c0aac9a9e
--- /dev/null
+++ b/ext/tk/sample/tkmultilistframe.rb
@@ -0,0 +1,940 @@
+#
+# tkmultilistframe.rb : multiple listbox widget on scrollable frame
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+class TkMultiListFrame < TkListbox
+ include TkComposite
+
+ # lbox_height : height of listboxes (pixel)
+ # title_info : array [ [<title_string>,<init_width>], ... ]
+ # keys : hash {<option>=><value>, ... }
+ def initialize_composite(lbox_height, title_info, keys={})
+ # argument check
+ if (! title_info.kind_of? Array) or (title_info.size < 2)
+ raise
+ end
+
+ # mode
+ @keep_minsize = true
+ @show_each_hscr = true
+ @show_win_hscr = true
+
+ # init arrays
+ @base_list = []
+ @rel_list = []
+ @title_list = []
+ @title_cmd = []
+ @lbox_list = []
+ @hscr_list = []
+
+ # decide total width
+ @lbox_total = title_info.size
+ @width_total = 0
+ title_info.each{|title, width, cmd|
+ @width_total += width.to_f
+ @title_cmd << cmd
+ }
+
+ # rel-table of label=>index
+ @name_index = {}
+
+ # size definition
+ @window_width = @width_total
+ @sash = 5
+ @scrbar_width = 15
+ @scrbar_border = 3
+ @lbox_border = 1
+ @title_border = 3
+ @h_l_thick = 0
+
+ # init status
+ @mode = :title
+
+ # virtical scrollbar
+=begin
+ @v_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'orient'=>'vertical', 'width'=>@scrbar_width)
+=end
+ @v_scroll = TkYScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'width'=>@scrbar_width)
+
+ # horizontal scrollbar
+=begin
+ @h_scroll = TkScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'orient'=>'horizontal', 'width'=>@scrbar_width)
+=end
+ @h_scroll = TkXScrollbar.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@scrbar_border,
+ 'width'=>@scrbar_width)
+
+ # create base flames
+ @c_title = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_title = TkFrame.new(@c_title, 'width'=>@width_total)
+ @w_title = TkcWindow.new(@c_title, 0, 0,
+ 'window'=>@f_title, 'anchor'=>'nw')
+
+ @c_lbox = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_lbox = TkFrame.new(@c_lbox, 'width'=>@width_total)
+ @w_lbox = TkcWindow.new(@c_lbox, 0, 0, 'window'=>@f_lbox, 'anchor'=>'nw')
+
+ @c_hscr = TkCanvas.new(@frame, 'highlightthickness'=>@h_l_thick,
+ 'width'=>@window_width)
+ @f_hscr = TkFrame.new(@c_hscr, 'width'=>@width_total)
+ @w_hscr = TkcWindow.new(@c_hscr, 0, 0, 'window'=>@f_hscr, 'anchor'=>'nw')
+
+ # create each listbox
+ sum = 0.0
+ @rel_list << sum/@width_total
+ title_info.each_with_index{|(label, width), idx|
+ # set relation between label and index
+ if @name_index.include?(label)
+ @name_index[label] << idx
+ else
+ @name_index[label] = [idx]
+ end
+
+ # calculate relative positioning
+ sum += width
+ @rel_list << sum/@width_total
+
+ # title field
+ f = TkFrame.new(@f_title, 'width'=>width)
+ base = [f]
+
+ title = TkLabel.new(f, 'text'=>label, 'borderwidth'=>@title_border,
+ 'relief'=>'raised', 'highlightthickness'=>@h_l_thick)
+ title_binding(title, idx)
+ title.pack('fill'=>'x')
+
+ @title_list << title
+
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relheight'=>1.0,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+ # listbox field
+ f = TkFrame.new(@f_lbox, 'width'=>width)
+ base << f
+ @lbox_list << TkListbox.new(f, 'highlightthickness'=>@h_l_thick,
+ 'borderwidth'=>@lbox_border
+ ).pack('fill'=>'both', 'expand'=>true)
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx], 'relheight'=>1.0)
+
+ # scrollbar field
+ f = TkFrame.new(@f_hscr, 'width'=>width)
+ base << f
+=begin
+ @hscr_list << TkScrollbar.new(f, 'orient'=>'horizontal',
+ 'width'=>@scrbar_width,
+ 'borderwidth'=>@scrbar_border,
+ 'highlightthickness'=>@h_l_thick
+ ).pack('fill'=>'x', 'anchor'=>'w')
+=end
+ @hscr_list << TkXScrollbar.new(f, 'width'=>@scrbar_width,
+ 'borderwidth'=>@scrbar_border,
+ 'highlightthickness'=>@h_l_thick
+ ).pack('fill'=>'x', 'anchor'=>'w')
+ f.place('relx'=>@rel_list[idx], 'y'=>0, 'anchor'=>'nw', 'width'=>1,
+ 'relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+
+=begin
+ @lbox_list[idx].xscrollcommand proc{|first, last|
+ @hscr_list[idx].set first, last
+ }
+ @hscr_list[idx].command proc{|*args| @lbox_list[idx].xview *args}
+=end
+ @lbox_list[idx].xscrollbar(@hscr_list[idx])
+
+ # add new base
+ @base_list << base
+ }
+
+ # pad
+ # @f_title_pad = TkFrame.new(@frame)
+ @f_title_pad = TkFrame.new(@frame, 'relief'=>'raised',
+ 'borderwidth'=>@title_border,
+ 'highlightthickness'=>@h_l_thick)
+
+ @f_scr_pad = TkFrame.new(@frame, 'relief'=>'sunken',
+ 'borderwidth'=>1,
+ 'highlightthickness'=>@h_l_thick)
+
+ # height check
+ title_height = 0
+ @title_list.each{|w|
+ h = w.winfo_reqheight
+ title_height = h if title_height < h
+ }
+
+ hscr_height = 0
+ @hscr_list.each{|w|
+ h = w.winfo_reqheight
+ hscr_height = h if hscr_height < h
+ }
+
+ @f_title.height title_height
+ @f_lbox.height lbox_height
+ @f_hscr.height hscr_height
+
+ # set control procedure for virtical scroll
+=begin
+ @lbox_list.each{|lbox|
+ lbox.yscrollcommand proc{|first, last|
+ @v_scroll.set first, last
+ }
+ }
+ @v_scroll.command proc{|*args| @lbox_list.each{|lbox| lbox.yview *args} }
+=end
+ @v_scroll.assign(*@lbox_list)
+
+ # set control procedure for horizoncal scroll
+=begin
+ @c_title.xscrollcommand proc{|first, last|
+ @h_scroll.set first, last
+ }
+ @c_lbox.xscrollcommand proc{|first, last|
+ @h_scroll.set first, last
+ }
+ @c_hscr.xscrollcommand proc{|first, last|
+ @h_scroll.set first, last
+ }
+ @h_scroll.command proc{|*args|
+ @c_title.xview *args
+ @c_lbox.xview *args
+ @c_hscr.xview *args if @show_each_hscr
+ }
+=end
+ @h_scroll.assign(@c_title, @c_lbox, @c_hscr)
+
+ # binding for listboxes
+ @lbox_mode = {}
+ @lbox_mode['browse'] = browse_mode_bindtag
+ @lbox_mode['single'] = single_mode_bindtag
+ @lbox_mode['extended'] = extended_mode_bindtag
+ @lbox_mode['multiple'] = multiple_mode_bindtag
+ @current_mode = 'browse'
+ @lbox_list.each_with_index{|l, idx|
+ l.bind('Shift-Key-Left',
+ proc{|w| focus_shift(w, -1); Tk.callback_break}, '%W')
+ l.bind('Shift-Key-Right',
+ proc{|w| focus_shift(w, 1); Tk.callback_break}, '%W')
+
+ l.bind('Button-2', proc{|x, y|
+ @lbox_mark_x = x
+ @lbox_list.each{|lbox| lbox.scan_mark(x, y)}
+ }, '%x %y')
+ l.bind('B2-Motion', proc{|x, y|
+ @lbox_list.each{|lbox| lbox.scan_dragto(@lbox_mark_x, y)}
+ l.scan_dragto(x, y)
+ }, '%x %y')
+
+ l.bindtags(l.bindtags.unshift(@lbox_mode[@current_mode]))
+ }
+
+ bbox = @w_title.bbox
+ @c_title.height(bbox[3])
+ @c_title.scrollregion(bbox)
+
+ bbox = @w_lbox.bbox
+ @c_lbox.height(bbox[3])
+ @c_lbox.scrollregion(bbox)
+
+ if @show_each_hscr
+ bbox = @w_hscr.bbox
+ @c_hscr.height(bbox[3])
+ @c_hscr.scrollregion(bbox)
+ end
+
+ # alignment
+ TkGrid.rowconfigure(@frame, 0, 'weight'=>0)
+ TkGrid.rowconfigure(@frame, 1, 'weight'=>1)
+ TkGrid.rowconfigure(@frame, 2, 'weight'=>0)
+ TkGrid.rowconfigure(@frame, 3, 'weight'=>0)
+ TkGrid.columnconfigure(@frame, 0, 'weight'=>1)
+ TkGrid.columnconfigure(@frame, 1, 'weight'=>0)
+ TkGrid.columnconfigure(@frame, 2, 'weight'=>0)
+ @v_scroll.grid('row'=>1, 'column'=>2, 'sticky'=>'ns')
+ @c_title.grid('row'=>0, 'column'=>0, 'sticky'=>'news')
+ @f_title_pad.grid('row'=>0, 'column'=>2, 'sticky'=>'news')
+ @c_lbox.grid('row'=>1, 'column'=>0, 'sticky'=>'news')
+ @c_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew') if @show_each_hscr
+ @h_scroll.grid('row'=>3, 'column'=>0, 'sticky'=>'ew') if @show_win_hscr
+ @f_scr_pad.grid('row'=>2, 'rowspan'=>2, 'column'=>2, 'sticky'=>'news')
+
+ # binding for 'Configure' event
+ @c_lbox.bind('Configure',
+ proc{|height, width| reconstruct(height, width)},
+ '%h %w')
+
+ # set default receiver of method calls
+ @path = @lbox_list[0].path
+
+ # configure options
+ keys = {} unless keys
+ keys = _symbolkey2str(keys)
+
+ # 'mode' option of listboxes
+ sel_mode = keys.delete('mode')
+ mode(sel_mode) if sel_mode
+
+ # 'scrollbarwidth' option == 'width' option of scrollbars
+ width = keys.delete('scrollbarwidth')
+ scrollbarwidth(width) if width
+
+ # options for listbox titles
+ title_font = keys.delete('titlefont')
+ titlefont(title_font) if title_font
+
+ title_fg = keys.delete('titleforeground')
+ titleforeground(title_fg) if title_fg
+
+ title_bg = keys.delete('titlebackground')
+ titlebackground(title_bg) if title_bg
+
+ # set receivers for configure methods
+ delegate('DEFAULT', *@lbox_list)
+ delegate('activebackground', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('troughcolor', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('repeatdelay', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('repeatinterval', @v_scroll, @h_scroll, *@hscr_list)
+ delegate('borderwidth', @frame)
+ delegate('width', @c_lbox, @c_title, @c_hscr)
+ delegate('relief', @frame)
+
+ # configure
+ configure(keys) if keys.size > 0
+ end
+ private :initialize_composite
+
+ # set 'mode' option of listboxes
+ def mode(sel_mode)
+ @lbox_list.each{|l|
+ tags = l.bindtags
+ tags = tags - [ @lbox_mode[@current_mode] ]
+ l.bindtags(tags.unshift(@lbox_mode[sel_mode]))
+ @current_mode = sel_mode
+ }
+ end
+
+ # keep_minsize?
+ def keep_minsize?
+ @keep_minsize
+ end
+ def keep_minsize(bool)
+ @keep_minsize = bool
+ end
+
+ # each hscr
+ def show_each_hscr
+ @show_each_hscr = true
+ @c_hscr.grid('row'=>2, 'column'=>0, 'sticky'=>'ew')
+ end
+ def hide_each_hscr
+ @show_each_hscr = false
+ @c_hscr.ungrid
+ end
+
+ # window hscroll
+ def show_win_hscr
+ @show_win_hscr = true
+ @h_scroll.grid('row'=>3, 'column'=>0, 'sticky'=>'ew')
+ end
+ def hide_win_hscr
+ @show_each_hscr = false
+ @h_scroll.ungrid
+ end
+
+ # set scrollbar width
+ def scrollbarwidth(width)
+ @scrbar_width = width
+ @v_scroll['width'] = @scrbar_width
+ @h_scroll['width'] = @scrbar_width
+ @hscr_list.each{|hscr| hscr['width'] = @scrbar_width}
+ self
+ end
+
+ # set scrollbar border
+ def scrollbarborder(width)
+ @scrbar_border = width
+ @v_scroll['border'] = @scrbar_border
+ @h_scroll['border'] = @scrbar_border
+ @hscr_list.each{|hscr| hscr['border'] = @scrbar_border}
+ self
+ end
+
+ # set listbox borders
+ def listboxborder(width)
+ @lbox_border = width
+ @lbox_list.each{|w| w['border'] = @lbox_border}
+ self
+ end
+
+ # set listbox relief
+ def listboxrelief(relief)
+ @lbox_list.each{|w| w['relief'] = relief}
+ self
+ end
+
+ # set title borders
+ def titleborder(width)
+ @title_border = width
+ @f_title_pad['border'] = @title_border
+ @title_list.each{|label| label['border'] = @title_border}
+ self
+ end
+
+ # set title font
+ def titlefont(font)
+ @title_list.each{|label| label['font'] = font}
+ title_height = 0
+ @title_list.each{|w|
+ h = w.winfo_reqheight
+ title_height = h if title_height < h
+ }
+ @f_title.height title_height
+ bbox = @w_title.bbox
+ @c_title.height(bbox[3])
+ @c_title.scrollregion(bbox)
+ self
+ end
+
+ # set title foreground color
+ def titleforeground(fg)
+ @title_list.each{|label| label['foreground'] = fg}
+ self
+ end
+
+ # set title background color
+ def titlebackground(bg)
+ @f_title_pad['background'] = bg
+ @title_list.each{|label| label['background'] = bg}
+ self
+ end
+
+ # set title cmds
+ def titlecommand(idx, cmd=Proc.new)
+ @title_cmd[idx] = cmd
+ end
+
+ # call title cmds
+ def titleinvoke(idx)
+ @title_cmd[idx].call if @title_cmd[idx]
+ end
+
+ # get label widgets of listbox titles
+ def titlelabels(*indices)
+ @title_list[*indices]
+ end
+
+ # get listbox widgets
+ def columns(*indices)
+ @lbox_list[*indices]
+ end
+
+ def activate(idx)
+ @lbox_list.each{|lbox| lbox.activate(idx)}
+ end
+
+ def bbox(idx)
+ @lbox_list.collect{|lbox| lbox.bbox(idx)}
+ end
+
+ def delete(*idx)
+ @lbox_list.collect{|lbox| lbox.delete(*idx)}
+ end
+
+ def get(*idx)
+ if idx.size == 1
+ @lbox_list.collect{|lbox| lbox.get(*idx)}
+ else
+ list = @lbox_list.collect{|lbox| lbox.get(*idx)}
+ result = []
+ list[0].each_with_index{|line, index|
+ result << list.collect{|lines| lines[index]}
+ }
+ result
+ end
+ end
+
+ def _line_array_to_hash(line)
+ result = {}
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ result[label] = line[indices[0]]
+ else
+ result[label] = indices.collect{|index| line[index]}
+ end
+ }
+ result
+ end
+ private :_line_array_to_hash
+
+ def get_by_hash(*idx)
+ get_result = get(*idx)
+ if idx.size == 1
+ _line_array_to_hash(get_result)
+ else
+ get_result.collect{|line| _line_array_to_hash(line)}
+ end
+ end
+
+ def insert(idx, *lines)
+ lbox_ins = []
+ (0..@lbox_list.size).each{lbox_ins << []}
+
+ lines.each{|line|
+ if line.kind_of? Hash
+ array = []
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ array[indices[0]] = line[label]
+ else
+ if line[label].kind_of? Array
+ indices.each_with_index{|index, num|
+ array[index] = line[label][num]
+ }
+ else
+ array[indices[0]] = line[label]
+ end
+ end
+ }
+ line = array
+ end
+
+ @name_index.each_pair{|label, indices|
+ if indices.size == 1
+ lbox_ins[indices[0]] << line[indices[0]]
+ else
+ indices.each{|index| lbox_ins[index] << line[index]}
+ end
+ }
+ }
+
+ @lbox_list.each_with_index{|lbox, index|
+ lbox.insert(idx, *lbox_ins[index]) if lbox_ins[index]
+ }
+ end
+
+ def selection_anchor(index)
+ @lbox_list.each{|lbox| lbox.selection_anchor(index)}
+ end
+
+ def selection_clear(first, last=None)
+ @lbox_list.each{|lbox| lbox.selection_clear(first, last=None)}
+ end
+
+ def selection_set(first, last=None)
+ @lbox_list.each{|lbox| lbox.selection_set(first, last=None)}
+ end
+
+ ###########################################
+ private
+
+ def reconstruct(height, width)
+ if @keep_minsize && width <= @width_total
+ @f_title.width(@width_total)
+ @f_lbox.width(@width_total)
+ @f_hscr.width(@width_total) if @show_each_hscr
+ @window_width = @width_total
+ else
+ @f_title.width(width)
+ @f_lbox.width(width)
+ @f_hscr.width(width) if @show_each_hscr
+ @window_width = width
+ end
+
+ @f_lbox.height(height)
+
+ @c_title.scrollregion(@w_title.bbox)
+ @c_lbox.scrollregion(@w_lbox.bbox)
+ @c_hscr.scrollregion(@w_hscr.bbox) if @show_each_hscr
+
+ (0..(@rel_list.size - 2)).each{|idx|
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx])
+ }
+ end
+
+ def resize(x)
+ idx = @sel_sash
+ return if idx == 0
+
+ # adjustment of relative positioning
+ delta = (x - @x) / @frame_width
+ if delta < @rel_list[idx-1] - @rel_list[idx] + (2*@sash/@frame_width)
+ delta = @rel_list[idx-1] - @rel_list[idx] + (2*@sash/@frame_width)
+ elsif delta > @rel_list[idx+1] - @rel_list[idx] - (2*@sash/@frame_width)
+ delta = @rel_list[idx+1] - @rel_list[idx] - (2*@sash/@frame_width)
+ end
+ @rel_list[idx] += delta
+
+ # adjustment of leftside widget of the sash
+ title, lbox, hscr = @base_list[idx - 1]
+ title.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+ lbox.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx] - @rel_list[idx-1])
+
+ # adjustment of rightside widget of the sash
+ title, lbox, hscr = @base_list[idx]
+ title.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+ lbox.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx], 'relheight'=>1.0)
+ hscr.place('relwidth'=>@rel_list[idx+1] - @rel_list[idx],
+ 'relx'=>@rel_list[idx])
+
+ # update reference position
+ @x = x
+ end
+
+ def motion_cb(w, x, idx)
+ if x <= @sash && idx > 0
+ w.cursor 'sb_h_double_arrow'
+ @mode = :sash
+ @sel_sash = idx
+ elsif x >= w.winfo_width - @sash && idx < @lbox_total - 1
+ w.cursor 'sb_h_double_arrow'
+ @mode = :sash
+ @sel_sash = idx + 1
+ else
+ w.cursor ""
+ @mode = :title
+ @sel_sash = 0
+ end
+ end
+
+ def title_binding(title, index)
+ title.bind('Motion', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ "%W %x #{index}")
+
+ title.bind('Enter', proc{|w, x, idx| motion_cb(w, x, idx.to_i)},
+ "%W %x #{index}")
+
+ title.bind('Leave', proc{|w| w.cursor ""}, "%W")
+
+ title.bind('Button-1',
+ proc{|w, x|
+ if @mode == :sash
+ @x = x
+ @frame_width = TkWinfo.width(@f_title).to_f
+ else
+ title.relief 'sunken'
+ end
+ },
+ '%W %X')
+
+ title.bind('ButtonRelease-1',
+ proc{|w, x, idx|
+ i = idx.to_i
+ if @mode == :title && @title_cmd[i].kind_of?(Proc)
+ @title_cmd[i].call
+ end
+ title.relief 'raised'
+ motion_cb(w,x,i)
+ },
+ "%W %x #{index}")
+
+ title.bind('B1-Motion', proc{|x| resize(x) if @mode == :sash}, "%X")
+ end
+
+ #################################
+ def browse_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_line(w, w.nearest(y))}, '%W %y')
+ t.bind('B1-Motion', proc{|w, y| select_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-slash',
+ proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+
+ t
+ end
+
+ ########################
+ def single_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| select_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| select_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Select', proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-slash',
+ proc{|w| select_line(w, w.index('active').to_i)}, '%W')
+ t.bind('Control-backslash',
+ proc{@lbox_list.each{|l| l.selection_clear(0, 'end')}})
+
+ t
+ end
+
+ ########################
+ def extended_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_only(w, w.nearest(y))}, '%W %y')
+ t.bind('B1-Motion', proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Shift-Button-1',
+ proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+ t.bind('Shift-B1-Motion',
+ proc{|w, y| select_range(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Control-Button-1',
+ proc{|w, y| select_toggle(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Control-B1-Motion',
+ proc{|w, y| select_drag(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W')
+
+ t.bind('Shift-Up', proc{|w| select_expand(w, -1)}, '%W')
+ t.bind('Shift-Down', proc{|w| select_expand(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W')
+
+ t.bind('Control-Shift-Home', proc{|w| select_range(w, 0)}, '%W')
+ t.bind('Control-Shift-End', proc{|w| select_range(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_active(w)}, '%W')
+ t.bind('Select', proc{|w| select_active(w)}, '%W')
+ t.bind('Control-slash', proc{|w| select_all}, '%W')
+ t.bind('Control-backslash', proc{|w| clear_all}, '%W')
+
+ t
+ end
+
+ ########################
+ def multiple_mode_bindtag
+ t = TkBindTag.new
+ t.bind('Button-1',
+ proc{|w, y| w.focus; select_line3(w, w.nearest(y))}, '%W %y')
+ t.bind('ButtonRelease-1',
+ proc{|w, y| active_line(w, w.nearest(y))}, '%W %y')
+
+ t.bind('Key-Up', proc{|w| active_shift(w, -1)}, '%W')
+ t.bind('Key-Down', proc{|w| active_shift(w, 1)}, '%W')
+
+ t.bind('Control-Home', proc{|w| select_line2(w, 0)}, '%W')
+ t.bind('Control-End', proc{|w| select_line2(w, 'end')}, '%W')
+
+ t.bind('Control-Shift-Home', proc{|w| active_line(w, 0)}, '%W')
+ t.bind('Control-Shift-End', proc{|w| active_line(w, 'end')}, '%W')
+
+ t.bind('space', proc{|w| select_active(w)}, '%W')
+ t.bind('Select', proc{|w| select_active(w)}, '%W')
+ t.bind('Control-slash', proc{|w| select_all}, '%W')
+ t.bind('Control-backslash', proc{|w| clear_all}, '%W')
+
+ t
+ end
+
+ ########################
+ def active_line(w, idx)
+ @lbox_list.each{|l| l.activate(idx)}
+ end
+
+ def select_only(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_range(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.selection_set('anchor', idx)
+ }
+ end
+
+ def select_toggle(w, idx)
+ st = w.selection_includes(idx)
+ @lbox_list.each{|l|
+ l.selection_anchor(idx)
+ if st == 1
+ l.selection_clear(idx)
+ else
+ l.selection_set(idx)
+ end
+ }
+ end
+
+ def select_drag(w, idx)
+ st = w.selection_includes('anchor')
+ @lbox_list.each{|l|
+ if st == 1
+ l.selection_set('anchor', idx)
+ else
+ l.selection_clear('anchor', idx)
+ end
+ }
+ end
+
+ def select_line(w, idx)
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ w.selection_set('anchor')
+ end
+
+ def select_line2(w, idx)
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_line3(w, idx)
+ @lbox_list.each{|l|
+ l.selection_set(idx)
+ }
+ end
+
+ def select_active(w)
+ idx = l.activate(idx)
+ @lbox_list.each{|l|
+ l.selection_set(idx)
+ }
+ end
+
+ def select_expand(w, dir)
+ idx = w.index('active').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_set(idx)
+ }
+ end
+
+ def active_shift(w, dir)
+ idx = w.index('active').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.activate(idx)
+ l.selection_anchor(idx)
+ }
+ end
+
+ def select_shift(w, dir)
+ idx = w.index('anchor').to_i + dir
+ if idx < 0
+ idx = 0
+ elsif idx >= w.size
+ idx = w.size - 1
+ end
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ l.activate(idx)
+ l.selection_anchor(idx)
+ l.selection_set('anchor')
+ }
+ end
+
+ def select_all
+ @lbox_list.each{|l|
+ l.selection_set(0, 'end')
+ }
+ end
+
+ def clear_all
+ @lbox_list.each{|l|
+ l.selection_clear(0, 'end')
+ }
+ end
+
+ def focus_shift(w, dir)
+ idx = @lbox_list.index(w) + dir
+ return if idx < 0
+ return if idx >= @lbox_list.size
+ @lbox_list[idx].focus
+ end
+ ########################
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ l = TkMultiListFrame.new(nil, 200,
+ [ ['L1', 200, proc{p 'click L1'}],
+ ['L2', 100],
+ ['L3', 200] ],
+ 'width'=>350,
+ #'titleforeground'=>'yellow',
+ 'titleforeground'=>'white',
+ #'titlebackground'=>'navy',
+ 'titlebackground'=>'blue',
+ 'titlefont'=>'courier'
+ ).pack('fill'=>'both', 'expand'=>true)
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
+ 'cccccccccccccccccccccccccccccccccccccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbbbbb','ccccccccccccccccc'])
+ l.insert('end', [1,2,3])
+ l.insert('end', [4,5,6], [4,5,6])
+ p l.columns(1)
+ p l.columns(1..3)
+ p l.columns(1,2)
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tkoptdb-safeTk.rb b/ext/tk/sample/tkoptdb-safeTk.rb
new file mode 100644
index 0000000000..7502e30667
--- /dev/null
+++ b/ext/tk/sample/tkoptdb-safeTk.rb
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+
+require 'multi-tk'
+
+TkMessage.new(:text => <<EOM).pack
+This is a sample of the safe-Tk slave interpreter. \
+On the slave interpreter, 'tkoptdb.rb' demo is running.
+( NOTE:: a safe-Tk interpreter can't read options \
+from a file. Options are given by the master interpreter \
+in this script. )
+The window shown this message is a root widget of \
+the default master interpreter. The other window \
+is a toplevel widget of the master interpreter, and it \
+has a container frame of the safe-Tk slave interpreter.
+'exit' on the slave interpreter exits the slave only. \
+You can also delete the slave by the button on the toplevel widget.
+EOM
+
+if ENV['LANG'] =~ /^ja/
+ # read Japanese resource
+ ent = TkOptionDB.read_entries(File.expand_path('resource.ja',
+ File.dirname(__FILE__)),
+ 'utf-8')
+else
+ # read English resource
+ ent = TkOptionDB.read_entries(File.expand_path('resource.en',
+ File.dirname(__FILE__)))
+end
+
+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.
+ ent.each{|pat, val| Tk.tk_call('option', 'add', pat, val)}
+}
+
+print "ip.eval_proc{$SAFE} ==> ", ip.eval_proc{$SAFE}, "\n"
+
+print "\ncall 'ip.wait_on_mainloop = false'\n"
+print "If 'ip.wait_on_mainloop? == true', ",
+ "when 'mainloop' is called on 'ip.eval_proc', ",
+ "'ip.eval_proc' does't return while the root window exists.\n",
+ "If you want to avoid that, set wait_on_mainloop to false. ",
+ "Then the mainloop in the eval_proc returns soon ",
+ "and the following steps are evaluated. \n",
+ "If you hate the both of them, use 'ip.bg_eval_proc' or ",
+ "wrap 'ip.eval_proc' by a thread.\n"
+
+ip.wait_on_mainloop = false
+
+ret = ip.eval_proc{
+ # When a block is given to 'eval_proc' method,
+ # the block is evaluated on the IP's current safe level.
+ # So, the followings raises an exception.
+ # An Exception object of the exception is returned as a
+ # return value of this method.
+
+ load file
+}
+print "\nip.eval_proc{}, which includes insecure operiation in the given block, returns an exception object: ", ret.inspect, "\n"
+
+print "If a proc object is given, the proc is evaluated on the safe-level which is kept on the proc :: ip.eval_proc( proc{$SAFE} ) ==> ", ip.eval_proc(proc{$SAFE}), "\n"
+
+safe0_cmd = Proc.new{
+ print 'safe0_cmd safe-level == ', $SAFE, "\n"
+ # This proc object keeps current safe-level ($SAFE==0).
+ load file
+}
+ip.eval_proc{safe0_cmd.call}
+
+# Tk.mainloop is ignored on the slave-IP
+Tk.mainloop
diff --git a/ext/tk/sample/tkoptdb.rb b/ext/tk/sample/tkoptdb.rb
new file mode 100644
index 0000000000..0171e465b3
--- /dev/null
+++ b/ext/tk/sample/tkoptdb.rb
@@ -0,0 +1,106 @@
+#!/usr/bin/env ruby
+#
+# sample script of TkOptionDB
+#
+# If 'LANG' environment variable's value is started by 'ja',
+# then read Japanese resource data and display Japanese button text.
+# In other case, read English resource data and display English text.
+#
+require "tk"
+
+if __FILE__ == $0 || !TkCore::INTERP.safe?
+ if ENV['LANG'] =~ /^ja/
+ # read Japanese resource
+ TkOptionDB.read_with_encoding(File.expand_path('resource.ja',
+ File.dirname(__FILE__)),
+ 'utf-8')
+ else
+ # read English resource
+ TkOptionDB.readfile(File.expand_path('resource.en',
+ File.dirname(__FILE__)))
+ end
+end
+
+# 'show_msg' and 'bye_msg' procedures can be defined on BTN_CMD resource.
+# Those procedures are called under $SAFE==2
+cmd = TkOptionDB.new_proc_class(:BTN_CMD, [:show_msg, :bye_msg], 3) {
+ # If you want to check resource string (str),
+ # please define __check_proc_string__(str) like this.
+ class << self
+ def __check_proc_string__(str)
+ print "($SAFE=#{$SAFE} >>>) check!! str.tainted?::#{str.tainted?}"
+ str.untaint
+ print "==>#{str.tainted?} (<<< $SAFE=#{$SAFE}): "
+ str
+ end
+ private :__check_proc_string__
+ end
+}
+
+# following two frame widgets use same database entry
+TkFrame.new(:class=>'BtnFrame'){|f|
+ pack(:padx=>5, :pady=>5)
+ TkButton.new(:parent=>f, :widgetname=>'hello'){
+ command proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.show_msg(TkOptionDB.inspect)
+ print "(<<< $SAFE=#{$SAFE})"
+ }
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+ TkButton.new(:command=>proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.bye_msg
+ print "(<<< $SAFE=#{$SAFE} ) : "
+ exit
+ },
+ :parent=>f, :widgetname=>'quit'){
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+}
+
+class BtnFrame < TkFrame; end
+BtnFrame.new{|f|
+ pack(:padx=>5, :pady=>5)
+ TkButton.new(:parent=>f, :widgetname=>'hello'){
+ command proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.show_msg(TkOptionDB.inspect)
+ print "(<<< $SAFE=#{$SAFE})"
+ }
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+ TkButton.new(:command=>proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.bye_msg
+ print "(<<< $SAFE=#{$SAFE})"
+ exit
+ },
+ :parent=>f, :widgetname=>'quit'){
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+}
+
+# if unknown class, use default option values
+TkFrame.new(:class=>'BtnFrame2'){|f|
+ pack(:padx=>5, :pady=>5)
+ TkButton.new(:parent=>f, :widgetname=>'hello'){
+ command proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.show_msg(TkOptionDB.inspect)
+ print "(<<< $SAFE=#{$SAFE})"
+ }
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+ TkButton.new(:command=>proc{
+ print "($SAFE=#{$SAFE} >>>) : "
+ cmd.bye_msg
+ print "(<<< $SAFE=#{$SAFE})"
+ exit
+ },
+ :parent=>f, :widgetname=>'quit'){
+ pack(:fill=>:x, :padx=>10, :pady=>10)
+ }
+}
+
+Tk.mainloop
diff --git a/ext/tk/sample/tkrttimer.rb b/ext/tk/sample/tkrttimer.rb
new file mode 100644
index 0000000000..1f9cbd9eb5
--- /dev/null
+++ b/ext/tk/sample/tkrttimer.rb
@@ -0,0 +1,77 @@
+#!/usr/bin/env ruby
+# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
+
+require "tk"
+
+root = TkRoot.new(:title=>'realtime timer sample')
+
+f1 = TkFrame.new(:borderwidth=>2, :relief=>:ridge)
+f1.pack(:side=>:bottom, :fill=>:both)
+TkLabel.new(f1, :text=>'use TkTimer (TkAfter) class').pack(:anchor=>:center)
+label1 = TkLabel.new(:parent=>f1, :relief=>:raised,
+ :width=>10).pack(:fill=>:both)
+
+f2 = TkFrame.new(:borderwidth=>2, :relief=>:ridge)
+f2.pack(:side=>:bottom, :fill=>:both)
+TkLabel.new(f2, :text=>'use TkRTTimer class').pack
+label2 = TkLabel.new(:parent=>f2, :relief=>:raised,
+ :width=>10).pack(:fill=>:both)
+
+TkLabel.new(:padx=>10, :pady=>5, :justify=>'left', :text=><<EOT).pack
+Interval setting of each timer object is 10 ms.
+Each timer object counts up the value on each callback
+(the value is not the clock data).
+The count of the TkTimer object is delayed by execution
+time of callbacks and inaccuracy of interval.
+On the other hand, the count of the TkRTTimer object is
+not delayed. Its callback interval is not accurate too.
+But it can compute error correction about the time when
+a callback should start.
+EOT
+
+# define the procedure repeated by the TkTimer object
+tick = proc{|aobj| #<== TkTimer object
+ cnt = aobj.return_value + 1 # return_value keeps a result of the last proc
+ label = aobj.current_args[0]
+ label.text format("%d.%02d", *(cnt.divmod(100)))
+ cnt #==> return value is kept by TkTimer object
+ # (so, can be send to the next repeat-proc)
+}
+
+timer1 = TkTimer.new(10, -1, [tick, label1]) # 10 ms interval
+timer2 = TkRTTimer.new(10, -1, [tick, label2]) # 10 ms interval
+
+timer1.start(0, proc{ label1.text('0.00'); 0 })
+timer2.start(0, proc{ label2.text('0.00'); 0 })
+
+b_start = TkButton.new(:text=>'Start', :state=>:disabled) {
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+}
+
+b_stop = TkButton.new(:text=>'Stop', :state=>:normal) {
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+}
+
+b_start.command {
+ timer1.continue
+ timer2.continue
+ b_stop.state(:normal)
+ b_start.state(:disabled)
+}
+
+b_stop.command {
+ timer1.stop
+ timer2.stop
+ b_start.state(:normal)
+ b_stop.state(:disabled)
+}
+
+TkButton.new(:text=>'Reset', :state=>:normal) {
+ command { timer1.reset; timer2.reset }
+ pack(:side=>:right, :fill=>:both, :expand=>:yes)
+}
+
+ev_quit = TkVirtualEvent.new('Control-c', 'Control-q')
+Tk.root.bind(ev_quit, proc{Tk.exit}).focus
+
+Tk.mainloop
diff --git a/ext/tk/sample/tksleep_sample.rb b/ext/tk/sample/tksleep_sample.rb
new file mode 100644
index 0000000000..23f6eca54e
--- /dev/null
+++ b/ext/tk/sample/tksleep_sample.rb
@@ -0,0 +1,29 @@
+require 'tk'
+
+v = TkVariable.new(0)
+l = TkLabel.new(:textvariable=>v).pack(:pady=>[1, 10])
+
+a = TkButton.new(:text=>"button A :: proc{p ['AAA', v.value]}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
+a.command{p ['AAA', v.value]}
+
+TkLabel.new(:text=>'Callback of the button B returns LIFO order').pack
+b = TkButton.new(:text=>"button B :: proc{n = v.value; p ['B:start', n]; Tk.sleep(10000); p ['B:end', n]}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
+b.command{n = v.value; p ['B:start', n]; Tk.sleep(10000); p ['B:end', n]}
+
+TkLabel.new(:text=>'Callback of the button C returns FIFO order').pack
+c = TkButton.new(:text=>"button C :: proc{n = v.value; Thread.new{p ['C:start', n]; Tk.sleep(10000); p ['C:end', n]}}").pack(:fill=>:x, :pady=>[1, 15], :padx=>15)
+c.command{n = v.value; Thread.new{p ['C:start', n]; Tk.sleep(10000); p ['C:end', n]}}
+
+TkLabel.new(:text=>'Callback of the button D blocks eventloop (no respond to event)').pack
+d = TkButton.new(:text=>"button D :: proc{n = v.value; p ['D:start', n]; sleep(10); p ['D:end', n]}").pack(:fill=>:x, :pady=>[1,15], :padx=>15)
+d.command{n = v.value; p ['D:start', n]; sleep(10); p ['D:end', n]}
+
+TkLabel.new(:text=>'Callback of the button E is another way to avoid eventloop blocking').pack
+e = TkButton.new(:text=>"button E :: proc{n = v.value; Thread.new{p ['D:start', n]; sleep(10); p ['D:end', n]}}").pack(:fill=>:x, :pady=>[1,15], :padx=>15)
+e.command{n = v.value; Thread.new{p ['D:start', n]; sleep(10); p ['D:end', n]}}
+
+TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
+
+TkTimer.new(500, -1){v.numeric += 1}.start
+
+Tk.mainloop
diff --git a/ext/tk/sample/tktextframe.rb b/ext/tk/sample/tktextframe.rb
new file mode 100644
index 0000000000..d6584beeb8
--- /dev/null
+++ b/ext/tk/sample/tktextframe.rb
@@ -0,0 +1,281 @@
+#
+# tktextframe.rb : a sample of TkComposite
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+module Tk::ScrollbarComposite
+ include TkComposite
+
+ def component_construct_keys
+ # If a component requires options for construction,
+ # return an Array of option-keys.
+ []
+ end
+ private :component_construct_keys
+
+ def create_component(keys={})
+ # This method must return the created component widget.
+ end
+ private :create_component
+
+ def component_delegates
+ # if want to override default option-methods or delegates,
+ # please define here.
+ end
+ private :component_delegates
+
+ def define_delegates
+ # option methods for scrollbars
+ option_methods([:scrollbarwidth, :get_scrollbarwidth])
+
+ # set receiver widgets for configure methods (with alias)
+ delegate_alias('scrollbarrelief', 'relief', @h_scroll, @v_scroll)
+ delegate_alias('framebackground', 'background',
+ @frame, @h_scroll, @v_scroll)
+ delegate_alias('activeframebackground', 'activebackground',
+ @h_scroll, @v_scroll)
+
+ # set receiver widgets for configure methods
+ delegate('DEFAULT', @component)
+ delegate('troughcolor', @h_scroll, @v_scroll)
+ delegate('repeatdelay', @h_scroll, @v_scroll)
+ delegate('repeatinterval', @h_scroll, @v_scroll)
+ delegate('borderwidth', @frame)
+ delegate('relief', @frame)
+
+ component_delegates
+ end
+ private :define_delegates
+
+ DEFAULT_VSCROLL = true
+ DEFAULT_HSCROLL = true
+
+ def initialize_composite(keys={})
+ keys = _symbolkey2str(keys)
+
+ # create scrollbars
+ @v_scroll = TkScrollbar.new(@frame, 'orient'=>'vertical')
+ @h_scroll = TkScrollbar.new(@frame, 'orient'=>'horizontal')
+
+ # create a component
+ construct_keys = {}
+ ((component_construct_keys.map{|k| k.to_s}) & keys.keys).each{|k|
+ construct_keys[k] = keys.delete(k)
+ }
+
+ # create a component (the component must be scrollable)
+ @component = create_component(construct_keys)
+
+ # set default receiver of method calls
+ @path = @component.path
+
+ # assign scrollbars
+ @component.xscrollbar(@h_scroll)
+ @component.yscrollbar(@v_scroll)
+
+ # allignment
+ TkGrid.rowconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0)
+ TkGrid.columnconfigure(@frame, 0, 'weight'=>1, 'minsize'=>0)
+ @component.grid('row'=>0, 'column'=>0, 'sticky'=>'news')
+
+ # scrollbars ON
+ vscroll(keys.delete('vscroll'){self.class::DEFAULT_VSCROLL})
+ hscroll(keys.delete('hscroll'){self.class::DEFAULT_HSCROLL})
+
+ # do configure
+ define_delegates
+
+ # do configure
+ configure keys unless keys.empty?
+ end
+ private :initialize_composite
+
+ # get/set width of scrollbar
+ def get_scrollbarwidth
+ @v_scroll.width
+ end
+ def set_scrollbarwidth(width)
+ @v_scroll.width(width)
+ @h_scroll.width(width)
+ end
+ alias :scrollbarwidth :set_scrollbarwidth
+
+ def hook_vscroll_on(*args); end
+ def hook_vscroll_off(*args); end
+ def hook_hscroll_on(*args); end
+ def hook_hscroll_off(*args); end
+ private :hook_vscroll_on,:hook_vscroll_off,:hook_hscroll_on,:hook_hscroll_off
+
+ # vertical scrollbar : ON/OFF
+ def vscroll(mode, *args)
+ st = TkGrid.info(@v_scroll)
+ if mode && st.size == 0 then
+ @v_scroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns')
+ hook_vscroll_on(*args)
+ elsif !mode && st.size != 0 then
+ @v_scroll.ungrid
+ hook_vscroll_off(*args)
+ end
+ self
+ end
+
+ # horizontal scrollbar : ON/OFF
+ def hscroll(mode, *args)
+ st = TkGrid.info(@h_scroll)
+ if mode && st.size == 0 then
+ @h_scroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew')
+ hook_hscroll_on(*args)
+ elsif !mode && st.size != 0 then
+ @h_scroll.ungrid
+ hook_hscroll_off(*args)
+ end
+ self
+ end
+end
+
+################################################
+
+class TkTextFrame < TkText
+ include Tk::ScrollbarComposite
+
+ # def component_construct_keys; []; end
+ # private :component_construct_keys
+
+ def create_component(keys={})
+ # keys has options which are listed by component_construct_keys method.
+ @text = TkText.new(@frame, 'wrap'=>'none')
+ @text.configure(keys) unless keys.empty?
+
+ # option methods for component
+ option_methods(
+ [:textbackground, nil, :textbg_info],
+ :textborderwidth,
+ :textrelief
+ )
+
+ # return the created componet
+ @text
+ end
+ private :create_component
+
+ # def component_delegates; end
+ # private :component_delegates
+
+ def hook_hscroll_on(wrap_mode=nil)
+ if wrap_mode
+ wrap wrap_mode
+ else
+ wrap 'none' # => self.wrap('none')
+ end
+ end
+ def hook_hscroll_off(wrap_mode)
+ wrap wrap_mode # => self.wrap(wrap_mode)
+ end
+ def hscroll(mode, wrap_mode="char")
+ super
+ end
+
+ # set background color of text widget
+ def textbackground(color = nil)
+ if color
+ @text.background(color)
+ else
+ @text.background
+ end
+ end
+
+ def textbg_info
+ info = @text.configinfo(:background)
+ if TkComm::GET_CONFIGINFO_AS_ARRAY
+ info[0] = 'textbackground'
+ info
+ else # ! TkComm::GET_CONFIGINFO_AS_ARRAY
+ {'textbackground' => info['background']}
+ end
+ end
+
+ # get/set borderwidth of text widget
+ def set_textborderwidth(width)
+ @text.borderwidth(width)
+ end
+ def get_textborderwidth
+ @text.borderwidth
+ end
+ def textborderwidth(width = nil)
+ if width
+ set_textborderwidth(width)
+ else
+ get_textborderwidth
+ end
+ end
+
+ # set relief of text widget
+ def textrelief(type)
+ @text.relief(type)
+ end
+end
+
+################################################
+# test
+################################################
+if __FILE__ == $0
+ TkLabel.new(:text=>'TkTextFrame is an example of Tk::ScrollbarComposite module.').pack
+ f = TkFrame.new.pack('fill'=>'x')
+ #t = TkTextFrame.new.pack
+ t = TkTextFrame.new(:textborderwidth=>3,
+ :textrelief=>:ridge,
+ :scrollbarrelief=>:ridge).pack
+ p t.configinfo
+ TkButton.new(f, 'text'=>'vscr OFF',
+ 'command'=>proc{t.vscroll(false)}).pack('side'=>'right')
+ TkButton.new(f, 'text'=>'vscr ON',
+ 'command'=>proc{t.vscroll(true)}).pack('side'=>'right')
+ TkButton.new(f, 'text'=>'hscr ON',
+ 'command'=>proc{t.hscroll(true)}).pack('side'=>'left')
+ TkButton.new(f, 'text'=>'hscr OFF',
+ 'command'=>proc{t.hscroll(false)}).pack('side'=>'left')
+
+ ############################################
+
+ # Tk.default_widget_set = :Ttk
+
+ TkFrame.new.pack(:pady=>10)
+ TkLabel.new(:text=>'The following is another example of Tk::ScrollbarComposite module.').pack
+
+ #----------------------------------
+ class ScrListbox < TkListbox
+ include Tk::ScrollbarComposite
+
+ DEFAULT_HSCROLL = false
+
+ def create_component(keys={})
+ TkListbox.new(@frame, keys)
+ end
+ private :create_component
+ end
+ #----------------------------------
+
+ f = TkFrame.new.pack(:pady=>5)
+ lbox = ScrListbox.new(f).pack(:side=>:left)
+ lbox.value = %w(aa bb cc dd eeeeeeeeeeeeeeeeeeeeeeeeee ffffffffff gg hh ii jj kk ll mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm nn oo pp qq)
+ fb = TkFrame.new(f).pack(:expand=>true, :fill=>:y, :padx=>5)
+ TkButton.new(fb, 'text'=>'lbox hscr OFF',
+ 'command'=>proc{lbox.hscroll(false)}).pack(:side=>:bottom,
+ :fill=>:x)
+ TkButton.new(fb, 'text'=>'lbox hscr ON',
+ 'command'=>proc{lbox.hscroll(true)}).pack(:side=>:bottom,
+ :fill=>:x)
+ TkFrame.new(fb).pack(:pady=>5, :side=>:bottom)
+ TkButton.new(fb, 'text'=>'lbox vscr OFF',
+ 'command'=>proc{lbox.vscroll(false)}).pack(:side=>:bottom,
+ :fill=>:x)
+ TkButton.new(fb, 'text'=>'lbox vscr ON',
+ 'command'=>proc{lbox.vscroll(true)}).pack(:side=>:bottom,
+ :fill=>:x)
+
+ ############################################
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tktextio.rb b/ext/tk/sample/tktextio.rb
new file mode 100644
index 0000000000..679a2b7142
--- /dev/null
+++ b/ext/tk/sample/tktextio.rb
@@ -0,0 +1,1060 @@
+#!/usr/bin/env ruby
+#
+# TkTextIO class :: handling I/O stream on a TkText widget
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# NOTE: TkTextIO supports 'character' (not 'byte') access only.
+# So, for example, TkTextIO#getc returns a character, TkTextIO#pos
+# means the character position, TkTextIO#read(size) counts by
+# characters, and so on.
+# Of course, it is available to make TkTextIO class to suuport
+# 'byte' access. However, it may break multi-byte characters.
+# and then, displayed string on the text widget may be garbled.
+# I think that it is not good on the supposed situation of using
+# TkTextIO.
+#
+require 'tk'
+require 'tk/text'
+require 'tk/textmark'
+require 'thread'
+
+class TkTextIO < TkText
+ # keep safe level
+ @@create_queues = proc{ [Queue.new, Mutex.new, Queue.new, Mutex.new] }
+
+ OPT_DEFAULTS = {
+ 'mode' => nil,
+ 'overwrite' => false,
+ 'text' => nil,
+ 'show' => :pos,
+ 'wrap' => 'char',
+ 'sync' => true,
+ 'prompt' => nil,
+ 'prompt_cmd' => nil,
+ 'hist_size' => 1000,
+ }
+
+ def create_self(keys)
+ opts = _get_io_params((keys.kind_of?(Hash))? keys: {})
+
+ super(keys)
+
+ @count_var = TkVariable.new
+
+ @write_buffer = ''
+ @read_buffer = ''
+ @buf_size = 0
+ @buf_max = 1024
+
+ @write_buf_queue, @write_buf_mutex,
+ @read_buf_queue, @read_buf_mutex = @@create_queues.call
+
+ @idle_flush = TkTimer.new(:idle, 1, proc{ @flusher.run rescue nil })
+ @timer_flush = TkTimer.new(250, -1, proc{ @flusher.run rescue nil })
+
+ @flusher = Thread.new{ loop { Thread.stop; flush() } }
+
+ @receiver = Thread.new{
+ begin
+ loop {
+ str = @write_buf_queue.deq
+ @write_buf_mutex.synchronize { @write_buffer << str }
+ @idle_flush.start
+ }
+ ensure
+ @flusher.kill
+ end
+ }
+
+ @timer_flush.start
+
+ _setup_io(opts)
+ end
+ private :create_self
+
+ def destroy
+ @flusher.kill rescue nil
+
+ @idle_flush.stop rescue nil
+ @timer_flush.stop rescue nil
+
+ @receiver.kill rescue nil
+
+ super()
+ end
+
+ ####################################
+
+ def _get_io_params(keys)
+ opts = {}
+ self.class.const_get(:OPT_DEFAULTS).each{|k, v|
+ if keys.has_key?(k)
+ opts[k] = keys.delete(k)
+ else
+ opts[k] = v
+ end
+ }
+ opts
+ end
+
+ def _setup_io(opts)
+ unless defined? @txtpos
+ @txtpos = TkTextMark.new(self, '1.0')
+ else
+ @txtpos.set('1.0')
+ end
+ @txtpos.gravity = :left
+
+ @lineno = 0
+ @line_offset = 0
+
+ @hist_max = opts['hist_size'].to_i
+ @hist_index = 0
+ @history = Array.new(@hist_max)
+ @history[0] = ''
+
+ self['wrap'] = wrap
+
+ self.show_mode = opts['show']
+
+ self.value = opts['text'] if opts['text']
+
+ @overwrite = (opts['overwrite'])? true: false
+
+ @sync = opts['sync']
+
+ @prompt = opts['prompt']
+ @prompt_cmd = opts['prompt_cmd']
+
+ @open = {:r => true, :w => true} # default is 'r+'
+
+ @console_mode = false
+ @end_of_stream = false
+ @console_buffer = nil
+
+ case opts['mode']
+ when nil
+ # do nothing
+
+ when :console, 'console'
+ @console_mode = true
+ # @console_buffer = TkTextIO.new(:mode=>'r')
+ @console_buffer = self.class.new(:mode=>'r')
+ self.show_mode = :insert
+
+ when 'r', 'rb'
+ @open[:r] = true; @open[:w] = nil
+
+ when 'r+', 'rb+', 'r+b'
+ @open[:r] = true; @open[:w] = true
+
+ when 'w', 'wb'
+ @open[:r] = nil; @open[:w] = true
+ self.value=''
+
+ when 'w+', 'wb+', 'w+b'
+ @open[:r] = true; @open[:w] = true
+ self.value=''
+
+ when 'a', 'ab'
+ @open[:r] = nil; @open[:w] = true
+ @txtpos.set('end - 1 char')
+ @txtpos.gravity = :right
+
+ when 'a+', 'ab+', 'a+b'
+ @open[:r] = true; @open[:w] = true
+ @txtpos.set('end - 1 char')
+ @txtpos.gravity = :right
+
+ else
+ fail ArgumentError, "unknown mode `#{opts['mode']}'"
+ end
+
+ unless defined? @ins_head
+ @ins_head = TkTextMark.new(self, 'insert')
+ @ins_head.gravity = :left
+ end
+
+ unless defined? @ins_tail
+ @ins_tail = TkTextMark.new(self, 'insert')
+ @ins_tail.gravity = :right
+ end
+
+ unless defined? @tmp_mark
+ @tmp_mark = TkTextMark.new(self, 'insert')
+ @tmp_mark.gravity = :left
+ end
+
+ if @console_mode
+ _set_console_line
+ _setup_console_bindings
+ end
+ end
+ private :_get_io_params, :_setup_io
+
+ def _set_console_line
+ @tmp_mark.set(@ins_tail)
+
+ mark_set('insert', 'end')
+
+ prompt = ''
+ prompt << @prompt_cmd.call if @prompt_cmd
+ prompt << @prompt if @prompt
+ insert(@tmp_mark, prompt)
+
+ @ins_head.set(@ins_tail)
+ @ins_tail.set('insert')
+
+ @txtpos.set(@tmp_mark)
+
+ _see_pos
+ end
+
+ def _replace_console_line(str)
+ self.delete(@ins_head, @ins_tail)
+ self.insert(@ins_head, str)
+ end
+
+ def _get_console_line
+ @tmp_mark.set(@ins_tail)
+ s = self.get(@ins_head, @tmp_mark)
+ _set_console_line
+ s
+ end
+ private :_set_console_line, :_replace_console_line, :_get_console_line
+
+ def _cb_up
+ @history[@hist_index].replace(self.get(@ins_head, @ins_tail))
+ @hist_index += 1
+ @hist_index -= 1 if @hist_index >= @hist_max || !@history[@hist_index]
+ _replace_console_line(@history[@hist_index]) if @history[@hist_index]
+ Tk.callback_break
+ end
+ def _cb_down
+ @history[@hist_index].replace(self.get(@ins_head, @ins_tail))
+ @hist_index -= 1
+ @hist_index = 0 if @hist_index < 0
+ _replace_console_line(@history[@hist_index]) if @history[@hist_index]
+ Tk.callback_break
+ end
+ def _cb_left
+ if @console_mode && compare('insert', '<=', @ins_head)
+ mark_set('insert', @ins_head)
+ Tk.callback_break
+ end
+ end
+ def _cb_backspace
+ if @console_mode && compare('insert', '<=', @ins_head)
+ Tk.callback_break
+ end
+ end
+ def _cb_ctrl_a
+ if @console_mode
+ mark_set('insert', @ins_head)
+ Tk.callback_break
+ end
+ end
+ def _cb_ctrl_u
+ if @console_mode
+ mark_set('insert', @ins_head)
+ delete('insert', 'insert lineend')
+ Tk.callback_break
+ end
+ end
+ private :_cb_up, :_cb_down, :_cb_left, :_cb_backspace,
+ :_cb_ctrl_a, :_cb_ctrl_u
+
+ def _setup_console_bindings
+ @bindtag = TkBindTag.new
+
+ tags = self.bindtags
+ tags[tags.index(self)+1, 0] = @bindtag
+ self.bindtags = tags
+
+ @bindtag.bind('Return'){
+ insert('end - 1 char', "\n")
+ if (str = _get_console_line)
+ @read_buf_queue.push(str)
+
+ @history[0].replace(str.chomp)
+ @history.pop
+ @history.unshift('')
+ @hist_index = 0
+ end
+
+ Tk.update
+ Tk.callback_break
+ }
+ @bindtag.bind('Alt-Return'){
+ Tk.callback_continue
+ }
+
+ @bindtag.bind('FocusIn'){
+ if @console_mode
+ mark_set('insert', @ins_tail)
+ Tk.callback_break
+ end
+ }
+
+ ins_mark = TkTextMark.new(self, 'insert')
+
+ @bindtag.bind('ButtonPress'){
+ if @console_mode
+ ins_mark.set('insert')
+ end
+ }
+
+ @bindtag.bind('ButtonRelease-1'){
+ if @console_mode && compare('insert', '<=', @ins_head)
+ mark_set('insert', ins_mark)
+ Tk.callback_break
+ end
+ }
+
+ @bindtag.bind('ButtonRelease-2', '%x %y'){|x, y|
+ if @console_mode
+ # paste a text at 'insert' only
+ x1, y1, x2, y2 = bbox(ins_mark)
+ unless x == x1 && y == y1
+ Tk.event_generate(self, 'ButtonRelease-2', :x=>x1, :y=>y1)
+ Tk.callback_break
+ end
+ end
+ }
+
+ @bindtag.bind('Up'){ _cb_up }
+ @bindtag.bind('Control-p'){ _cb_up }
+
+ @bindtag.bind('Down'){ _cb_down }
+ @bindtag.bind('Control-n'){ _cb_down }
+
+ @bindtag.bind('Left'){ _cb_left }
+ @bindtag.bind('Control-b'){ _cb_left }
+
+ @bindtag.bind('BackSpace'){ _cb_backspace }
+ @bindtag.bind('Control-h'){ _cb_backspace }
+
+ @bindtag.bind('Home'){ _cb_ctrl_a }
+ @bindtag.bind('Control-a'){ _cb_ctrl_a }
+
+ @bindtag.bind('Control-u'){ _cb_ctrl_u }
+ end
+ private :_setup_console_bindings
+
+ def _block_read(size = nil, ret = '', block_mode = true)
+ return '' if size == 0
+ return nil if ! @read_buf_queue && @read_buffer.empty?
+ ret = '' unless ret.kind_of?(String)
+ ret.replace('') unless ret.empty?
+
+ if block_mode == nil # partial
+ if @read_buffer.empty?
+ ret << @read_buffer.slice!(0..-1)
+ return ret
+ end
+ end
+
+ if size.kind_of?(Numeric)
+ loop{
+ @read_buf_mutex.synchronize {
+ buf_len = @read_buffer.length
+ if buf_len >= size
+ ret << @read_buffer.slice!(0, size)
+ return ret
+ else
+ ret << @read_buffer.slice!(0..-1)
+ size -= buf_len
+ return ret unless @read_buf_queue
+ end
+ }
+ @read_buffer << @read_buf_queue.pop
+ }
+ else # readline
+ rs = (size)? size: $/
+ rs = rs.to_s if rs.kind_of?(Regexp)
+ loop{
+ @read_buf_mutex.synchronize {
+ if (str = @read_buffer.slice!(/\A(.*)(#{rs})/m))
+ ret << str
+ return ret
+ else
+ ret << @read_buffer.slice!(0..-1)
+ return ret unless @read_buf_queue
+ end
+ }
+ @read_buffer << @read_buf_queue.pop
+ }
+ end
+ end
+
+ def _block_write
+ ###### currently, not support
+ end
+ private :_block_read, :_block_write
+
+ ####################################
+
+ def <<(obj)
+ _write(obj)
+ self
+ end
+
+ def binmode
+ self
+ end
+
+ def clone
+ fail NotImplementedError, 'cannot clone TkTextIO'
+ end
+ def dup
+ fail NotImplementedError, 'cannot duplicate TkTextIO'
+ end
+
+ def close
+ close_read
+ close_write
+ nil
+ end
+ def close_read
+ @open[:r] = false if @open[:r]
+ nil
+ end
+ def close_write
+ @open[:w] = false if @opne[:w]
+ nil
+ end
+
+ def closed?(dir=nil)
+ case dir
+ when :r, 'r'
+ !@open[:r]
+ when :w, 'w'
+ !@open[:w]
+ else
+ !@open[:r] && !@open[:w]
+ end
+ end
+
+ def _check_readable
+ fail IOError, "not opened for reading" if @open[:r].nil?
+ fail IOError, "closed stream" if !@open[:r]
+ end
+ def _check_writable
+ fail IOError, "not opened for writing" if @open[:w].nil?
+ fail IOError, "closed stream" if !@open[:w]
+ end
+ private :_check_readable, :_check_writable
+
+ def each_line(rs = $/)
+ _check_readable
+ while(s = self.gets(rs))
+ yield(s)
+ end
+ self
+ end
+ alias each each_line
+
+ def each_char
+ _check_readable
+ while(c = self.getc)
+ yield(c)
+ end
+ self
+ end
+ alias each_byte each_char
+
+ def eof?
+ compare(@txtpos, '==', 'end - 1 char')
+ end
+ alias eof eof?
+
+ def fcntl(*args)
+ fail NotImplementedError, "fcntl is not implemented on #{self.class}"
+ end
+
+ def fsync
+ 0
+ end
+
+ def fileno
+ nil
+ end
+
+ def flush
+ Thread.pass
+ if @open[:w] || ! @write_buffer.empty?
+ @write_buf_mutex.synchronize {
+ _sync_write_buf(@write_buffer)
+ @write_buffer[0..-1] = ''
+ }
+ end
+ self
+ end
+
+ def getc
+ return _block_read(1) if @console_mode
+
+ _check_readable
+ return nil if eof?
+ c = get(@txtpos)
+ @txtpos.set(@txtpos + '1 char')
+ _see_pos
+ c
+ end
+
+ def gets(rs = $/)
+ return _block_read(rs) if @console_mode
+
+ _check_readable
+ return nil if eof?
+ _readline(rs)
+ end
+
+ def ioctrl(*args)
+ fail NotImplementedError, 'iocntl is not implemented on TkTextIO'
+ end
+
+ def isatty
+ false
+ end
+ def tty?
+ false
+ end
+
+ def lineno
+ @lineno + @line_offset
+ end
+
+ def lineno=(num)
+ @line_offset = num - @lineno
+ num
+ end
+
+ def overwrite?
+ @overwrite
+ end
+
+ def overwrite=(ovwt)
+ @overwrite = (ovwt)? true: false
+ end
+
+ def pid
+ nil
+ end
+
+ def index_pos
+ index(@txtpos)
+ end
+ alias tell_index index_pos
+
+ def index_pos=(idx)
+ @txtpos.set(idx)
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ _see_pos
+ idx
+ end
+
+ def pos
+ s = get('1.0', @txtpos)
+ number(tk_call('string', 'length', s))
+ end
+ alias tell pos
+
+ def pos=(idx)
+ seek(idx, IO::SEEK_SET)
+ idx
+ end
+
+ def pos_gravity
+ @txtpos.gravity
+ end
+
+ def pos_gravity=(side)
+ @txtpos.gravity = side
+ side
+ end
+
+ def print(arg=$_, *args)
+ _check_writable
+ args.unshift(arg)
+ args.map!{|val| (val == nil)? 'nil': val.to_s }
+ str = args.join($,)
+ str << $\ if $\
+ _write(str)
+ nil
+ end
+ def printf(*args)
+ _check_writable
+ _write(sprintf(*args))
+ nil
+ end
+
+ def putc(c)
+ _check_writable
+ c = c.chr if c.kind_of?(Fixnum)
+ _write(c)
+ c
+ end
+
+ def puts(*args)
+ _check_writable
+ if args.empty?
+ _write("\n")
+ return nil
+ end
+ args.each{|arg|
+ if arg == nil
+ _write("nil\n")
+ elsif arg.kind_of?(Array)
+ puts(*arg)
+ elsif arg.kind_of?(String)
+ _write(arg.chomp)
+ _write("\n")
+ else
+ begin
+ arg = arg.to_ary
+ puts(*arg)
+ rescue
+ puts(arg.to_s)
+ end
+ end
+ }
+ nil
+ end
+
+ def _read(len)
+ epos = @txtpos + "#{len} char"
+ s = get(@txtpos, epos)
+ @txtpos.set(epos)
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ _see_pos
+ s
+ end
+ private :_read
+
+ def read(len=nil, buf=nil)
+ return _block_read(len, buf) if @console_mode
+
+ _check_readable
+ if len
+ return "" if len == 0
+ return nil if eof?
+ s = _read(len)
+ else
+ s = get(@txtpos, 'end - 1 char')
+ @txtpos.set('end - 1 char')
+ _see_pos
+ end
+ buf.replace(s) if buf.kind_of?(String)
+ s
+ end
+
+ def readchar
+ return _block_read(1) if @console_mode
+
+ _check_readable
+ fail EOFError if eof?
+ c = get(@txtpos)
+ @txtpos.set(@txtpos + '1 char')
+ _see_pos
+ c
+ end
+
+ def _readline(rs = $/)
+ if rs == nil
+ s = get(@txtpos, 'end - 1 char')
+ @txtpos.set('end - 1 char')
+ elsif rs == ''
+ @count_var.value # make it global
+ idx = tksearch_with_count([:regexp], @count_var,
+ "\n(\n)+", @txtpos, 'end - 1 char')
+ if idx
+ s = get(@txtpos, idx) << "\n"
+ @txtpos.set("#{idx} + #{@count_var.value} char")
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ else
+ s = get(@txtpos, 'end - 1 char')
+ @txtpos.set('end - 1 char')
+ end
+ else
+ @count_var.value # make it global
+ idx = tksearch_with_count(@count_var, rs, @txtpos, 'end - 1 char')
+ if idx
+ s = get(@txtpos, "#{idx} + #{@count_var.value} char")
+ @txtpos.set("#{idx} + #{@count_var.value} char")
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ else
+ s = get(@txtpos, 'end - 1 char')
+ @txtpos.set('end - 1 char')
+ end
+ end
+
+ _see_pos
+ @lineno += 1
+ $_ = s
+ end
+ private :_readline
+
+ def readline(rs = $/)
+ return _block_readline(rs) if @console_mode
+
+ _check_readable
+ fail EOFError if eof?
+ _readline(rs)
+ end
+
+ def readlines(rs = $/)
+ if @console_mode
+ lines = []
+ while (line = _block_readline(rs))
+ lines << line
+ end
+ return lines
+ end
+
+ _check_readable
+ lines = []
+ until(eof?)
+ lines << _readline(rs)
+ end
+ $_ = nil
+ lines
+ end
+
+ def readpartial(maxlen, buf=nil)
+ #return @console_buffer.readpartial(maxlen, buf) if @console_mode
+ return _block_read(maxlen, buf, nil) if @console_mode
+
+ _check_readable
+ fail EOFError if eof?
+ s = _read(maxlen)
+ buf.replace(s) if buf.kind_of?(String)
+ s
+ end
+
+ def reopen(*args)
+ fail NotImplementedError, 'reopen is not implemented on TkTextIO'
+ end
+
+ def rewind
+ @txtpos.set('1.0')
+ _see_pos
+ @lineno = 0
+ @line_offset = 0
+ self
+ end
+
+ def seek(offset, whence=IO::SEEK_SET)
+ case whence
+ when IO::SEEK_SET
+ offset = "1.0 + #{offset} char" if offset.kind_of?(Numeric)
+ @txtpos.set(offset)
+
+ when IO::SEEK_CUR
+ offset = "#{offset} char" if offset.kind_of?(Numeric)
+ @txtpos.set(@txtpos + offset)
+
+ when IO::SEEK_END
+ offset = "#{offset} char" if offset.kind_of?(Numeric)
+ @txtpos.set("end - 1 char + #{offset}")
+
+ else
+ fail Errno::EINVAL, 'invalid whence argument'
+ end
+
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ _see_pos
+
+ 0
+ end
+ alias sysseek seek
+
+ def _see_pos
+ see(@show) if @show
+ end
+ private :_see_pos
+
+ def show_mode
+ (@show == @txtpos)? :pos : @show
+ end
+
+ def show_mode=(mode)
+ # define show mode when file position is changed.
+ # mode == :pos or "pos" or true :: see current file position.
+ # mode == :insert or "insert" :: see insert cursor position.
+ # mode == nil or false :: do nothing
+ # else see 'mode' position ('mode' should be text index or mark)
+ case mode
+ when :pos, 'pos', true
+ @show = @txtpos
+ when :insert, 'insert'
+ @show = :insert
+ when nil, false
+ @show = false
+ else
+ begin
+ index(mode)
+ rescue
+ fail ArgumentError, 'invalid show-position'
+ end
+ @show = mode
+ end
+
+ _see_pos
+
+ mode
+ end
+
+ def stat
+ fail NotImplementedError, 'stat is not implemented on TkTextIO'
+ end
+
+ def sync
+ @sync
+ end
+
+ def sync=(mode)
+ @sync = mode
+ end
+
+ def sysread(len, buf=nil)
+ return _block_read(len, buf) if @console_mode
+
+ _check_readable
+ fail EOFError if eof?
+ s = _read(len)
+ buf.replace(s) if buf.kind_of?(String)
+ s
+ end
+
+ def syswrite(obj)
+ _write(obj)
+ end
+
+ def to_io
+ self
+ end
+
+ def trancate(len)
+ delete("1.0 + #{len} char", :end)
+ 0
+ end
+
+ def ungetc(c)
+ if @console_mode
+ @read_buf_mutex.synchronize {
+ @read_buffer[0,0] = c.chr
+ }
+ return nil
+ end
+
+ _check_readable
+ c = c.chr if c.kind_of?(Fixnum)
+ if compare(@txtpos, '>', '1.0')
+ @txtpos.set(@txtpos - '1 char')
+ delete(@txtpos)
+ insert(@txtpos, tk_call('string', 'range', c, 0, 1))
+ @txtpos.set(@txtpos - '1 char') if @txtpos.gravity == 'right'
+ _see_pos
+ else
+ fail IOError, 'cannot ungetc at head of stream'
+ end
+ nil
+ end
+
+=begin
+ def _write(obj)
+ #s = _get_eval_string(obj)
+ s = (obj.kind_of?(String))? obj: obj.to_s
+ n = number(tk_call('string', 'length', s))
+ delete(@txtpos, @txtpos + "#{n} char") if @overwrite
+ self.insert(@txtpos, s)
+ @txtpos.set(@txtpos + "#{n} char")
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+ _see_pos
+ Tk.update if @sync
+ n
+ end
+ private :_write
+=end
+#=begin
+ def _sync_write_buf(s)
+ if (n = number(tk_call('string', 'length', s))) > 0
+ delete(@txtpos, @txtpos + "#{n} char") if @overwrite
+ self.insert(@txtpos, s)
+ #Tk.update
+
+ @txtpos.set(@txtpos + "#{n} char")
+ @txtpos.set('end - 1 char') if compare(@txtpos, '>=', :end)
+
+ @ins_head.set(@txtpos) if compare(@txtpos, '>', @ins_head)
+
+ _see_pos
+ end
+ self
+ end
+ private :_sync_write_buf
+
+ def _write(obj)
+ s = (obj.kind_of?(String))? obj: obj.to_s
+ n = number(tk_call('string', 'length', s))
+ @write_buf_queue.enq(s)
+ if @sync
+ Thread.pass
+ Tk.update
+ end
+ n
+ end
+ private :_write
+#=end
+
+ def write(obj)
+ _check_writable
+ _write(obj)
+ end
+end
+
+####################
+# TEST
+####################
+if __FILE__ == $0
+ ev_loop = Thread.new{Tk.mainloop}
+
+ f = TkFrame.new.pack
+ #tio = TkTextIO.new(f, :show=>:nil,
+ #tio = TkTextIO.new(f, :show=>:pos,
+ tio = TkTextIO.new(f, :show=>:insert,
+ :text=>">>> This is an initial text line. <<<\n\n"){
+# yscrollbar(TkScrollbar.new(f).pack(:side=>:right, :fill=>:y))
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+ }
+
+ Tk.update
+
+ $stdin = tio
+ $stdout = tio
+ $stderr = tio
+
+ STDOUT.print("\n========= TkTextIO#gets for inital text ========\n\n")
+
+ while(s = gets)
+ STDOUT.print(s)
+ end
+
+ STDOUT.print("\n============ put strings to TkTextIO ===========\n\n")
+
+ puts "On this sample, a text widget works as if it is a I/O stream."
+ puts "Please see the code."
+ puts
+ printf("printf message: %d %X\n", 123456, 255)
+ puts
+ printf("(output by 'p' method) This TkTextIO object is ...\n")
+ p tio
+ print(" [ Current wrap mode of this object is 'char'. ]\n")
+ puts
+ warn("This is a warning message generated by 'warn' method.")
+ puts
+ puts "current show_mode is #{tio.show_mode}."
+ if tio.show_mode == :pos
+ puts "So, you can see the current file position on this text widget."
+ else
+ puts "So, you can see the position '#{tio.show_mode}' on this text widget."
+ end
+ print("Please scroll up this text widget to see the head of lines.\n")
+ print("---------------------------------------------------------\n")
+
+ STDOUT.print("\n=============== TkTextIO#readlines =============\n\n")
+
+ tio.seek(0)
+ lines = readlines
+ STDOUT.puts(lines.inspect)
+
+ STDOUT.print("\n================== TkTextIO#each ===============\n\n")
+
+ tio.rewind
+ tio.each{|line| STDOUT.printf("%2d: %s\n", tio.lineno, line.chomp)}
+
+ STDOUT.print("\n================================================\n\n")
+
+ STDOUT.print("\n========= reverse order (seek by lines) ========\n\n")
+
+ tio.seek(-1, IO::SEEK_END)
+ begin
+ begin
+ tio.seek(:linestart, IO::SEEK_CUR)
+ rescue
+ # maybe use old version of tk/textmark.rb
+ tio.seek('0 char linestart', IO::SEEK_CUR)
+ end
+ STDOUT.print(gets)
+ tio.seek('-1 char linestart -1 char', IO::SEEK_CUR)
+ end while(tio.pos > 0)
+
+ STDOUT.print("\n================================================\n\n")
+
+ tio.seek(0, IO::SEEK_END)
+
+ STDOUT.print("tio.sync == #{tio.sync}\n")
+# tio.sync = false
+# STDOUT.print("tio.sync == #{tio.sync}\n")
+
+ (0..10).each{|i|
+ STDOUT.print("#{i}\n")
+ s = ''
+ (0..1000).each{ s << '*' }
+ print(s)
+ }
+ print("\n")
+ print("\n=========================================================\n\n")
+
+ s = ''
+ timer = TkTimer.new(:idle, -1, proc{
+ #STDOUT.print("idle call\n")
+ unless s.empty?
+ print(s)
+ s = ''
+ end
+ }).start
+ (0..10).each{|i|
+ STDOUT.print("#{i}\n")
+ (0..1000).each{ s << '*' }
+ }
+# timer.stop
+ until s.empty?
+ sleep 0.1
+ end
+ timer.stop
+
+=begin
+ tio.sync = false
+ print("\n")
+ #(0..10000).each{ putc('*') }
+ (0..10).each{|i|
+ STDOUT.print("#{i}\n")
+ (0..1000).each{ putc('*') }
+ }
+
+ (0..10).each{|i|
+ STDOUT.print("#{i}\n")
+ s = ''
+ (0..1000).each{ s << '*' }
+ print(s)
+ }
+=end
+
+ num = 0
+# io = TkTextIO.new(:mode=>:console, :prompt=>'').pack
+#=begin
+ io = TkTextIO.new(:mode=>:console,
+ :prompt_cmd=>proc{
+ s = "[#{num}]"
+ num += 1
+ s
+ },
+ :prompt=>'-> ').pack
+#=end
+ Thread.new{loop{sleep 2; io.puts 'hoge'}}
+ Thread.new{loop{p io.gets}}
+
+ ev_loop.join
+end
diff --git a/ext/tk/sample/tktimer.rb b/ext/tk/sample/tktimer.rb
new file mode 100644
index 0000000000..b1adb5b506
--- /dev/null
+++ b/ext/tk/sample/tktimer.rb
@@ -0,0 +1,50 @@
+#!/usr/bin/env ruby
+# This script generates a counter with start and stop buttons.
+
+require "tk"
+$label = TkLabel.new {
+ text '0.00'
+ relief 'raised'
+ width 10
+ pack('side'=>'bottom', 'fill'=>'both')
+}
+
+TkButton.new {
+ text 'Start'
+ command proc {
+ if $stopped
+ $stopped = FALSE
+ tick
+ end
+ }
+ pack('side'=>'left','fill'=>'both','expand'=>'yes')
+}
+TkButton.new {
+ text 'Stop'
+ command proc{
+ exit if $stopped
+ $stopped = TRUE
+ }
+ pack('side'=>'right','fill'=>'both','expand'=>'yes')
+}
+
+$seconds=0
+$hundredths=0
+$stopped=TRUE
+
+def tick
+ if $stopped then return end
+ Tk.after 50, proc{tick}
+ $hundredths+=5
+ if $hundredths >= 100
+ $hundredths=0
+ $seconds+=1
+ end
+ $label.text format("%d.%02d", $seconds, $hundredths)
+end
+
+root = Tk.root
+root.bind "Control-c", proc{root.destroy}
+root.bind "Control-q", proc{root.destroy}
+Tk.root.focus
+Tk.mainloop
diff --git a/ext/tk/sample/tktimer2.rb b/ext/tk/sample/tktimer2.rb
new file mode 100644
index 0000000000..125115e863
--- /dev/null
+++ b/ext/tk/sample/tktimer2.rb
@@ -0,0 +1,47 @@
+#!/usr/bin/env ruby
+# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
+
+require "tk"
+
+# new notation :
+# * symbols are acceptable as keys or values of the option hash
+# * the parent widget can be given by :parent key on the option hash
+root = TkRoot.new(:title=>'timer sample')
+label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \
+ .pack(:side=>:bottom, :fill=>:both)
+
+# define the procedure repeated by the TkTimer object
+tick = proc{|aobj| #<== TkTimer object
+ cnt = aobj.return_value + 5 # return_value keeps a result of the last proc
+ label.text format("%d.%02d", *(cnt.divmod(100)))
+ cnt #==> return value is kept by TkTimer object
+ # (so, can be send to the next repeat-proc)
+}
+
+timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 })
+ # ==> repeat-interval : (about) 50 ms,
+ # repeat : infinite (-1) times,
+ # repeat-procedure : tick (only one, in this case)
+ #
+ # ==> wait-before-call-init-proc : 0 ms,
+ # init_proc : proc{ label.text('0.00'); 0 }
+ #
+ # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->....
+
+TkButton.new(:text=>'Start') {
+ command proc{ timer.continue unless timer.running? }
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+}
+TkButton.new(:text=>'Restart') {
+ command proc{ timer.restart(0, proc{ label.text('0.00'); 0 }) }
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+}
+TkButton.new(:text=>'Stop') {
+ command proc{ timer.stop if timer.running? }
+ pack('side'=>'right','fill'=>'both','expand'=>'yes')
+}
+
+ev_quit = TkVirtualEvent.new('Control-c', 'Control-q')
+Tk.root.bind(ev_quit, proc{Tk.exit}).focus
+
+Tk.mainloop
diff --git a/ext/tk/sample/tktimer3.rb b/ext/tk/sample/tktimer3.rb
new file mode 100644
index 0000000000..08e8a3cad4
--- /dev/null
+++ b/ext/tk/sample/tktimer3.rb
@@ -0,0 +1,59 @@
+#!/usr/bin/env ruby
+# This script is a re-implementation of tktimer.rb with TkTimer(TkAfter) class.
+
+require "tk"
+
+# new notation :
+# * symbols are acceptable as keys or values of the option hash
+# * the parent widget can be given by :parent key on the option hash
+root = TkRoot.new(:title=>'timer sample')
+label = TkLabel.new(:parent=>root, :relief=>:raised, :width=>10) \
+ .pack(:side=>:bottom, :fill=>:both)
+
+# define the procedure repeated by the TkTimer object
+tick = proc{|aobj| #<== TkTimer object
+ cnt = aobj.return_value + 5 # return_value keeps a result of the last proc
+ label.text format("%d.%02d", *(cnt.divmod(100)))
+ cnt #==> return value is kept by TkTimer object
+ # (so, can be send to the next repeat-proc)
+}
+
+timer = TkTimer.new(50, -1, tick).start(0, proc{ label.text('0.00'); 0 })
+ # ==> repeat-interval : (about) 50 ms,
+ # repeat : infinite (-1) times,
+ # repeat-procedure : tick (only one, in this case)
+ #
+ # ==> wait-before-call-init-proc : 0 ms,
+ # init_proc : proc{ label.text('0.00'); 0 }
+ #
+ # (0ms)-> init_proc ->(50ms)-> tick ->(50ms)-> tick ->....
+
+b_start = TkButton.new(:text=>'Start', :state=>:disabled) {
+ pack(:side=>:left, :fill=>:both, :expand=>true)
+}
+
+b_stop = TkButton.new(:text=>'Stop', :state=>:normal) {
+ pack('side'=>'left', 'fill'=>'both', 'expand'=>'yes')
+}
+
+b_start.command {
+ timer.continue
+ b_stop.state(:normal)
+ b_start.state(:disabled)
+}
+
+b_stop.command {
+ timer.stop
+ b_start.state(:normal)
+ b_stop.state(:disabled)
+}
+
+TkButton.new(:text=>'Reset', :state=>:normal) {
+ command { timer.reset }
+ pack(:side=>:right, :fill=>:both, :expand=>:yes)
+}
+
+ev_quit = TkVirtualEvent.new('Control-c', 'Control-q')
+Tk.root.bind(ev_quit, proc{Tk.exit}).focus
+
+Tk.mainloop
diff --git a/ext/tk/sample/tktree.rb b/ext/tk/sample/tktree.rb
new file mode 100644
index 0000000000..4eb7f60627
--- /dev/null
+++ b/ext/tk/sample/tktree.rb
@@ -0,0 +1,103 @@
+##########################################################################
+# TkTree widget class
+#
+# see <http://wiki.tcl.tk/10615>
+#
+# Note: optional argument '-font' of the Tcl library is changed to
+# 'itemfont' on this Ruby library, because of avoiding font
+# operation trouble in 'initialize' method ( see the following
+# test script ).
+#
+##########################################################################
+require 'tk'
+
+class TkTree < TkCanvas
+ TCL_SCRIPT_PATH = File.join(File.dirname(__FILE__), 'tktree.tcl')
+
+ def create_self(keys)
+ args = [@path]
+ if keys.kind_of?(Hash)
+ font = keys.delete('itemfont')
+# font = hash_kv(font) if font.kind_of?(Hash)
+ keys['font'] = font if font
+# args.concat(hash_kv(keys))
+ args << keys
+ end
+ begin
+ tk_call('::tktree::treecreate', *args)
+ rescue NameError, RuntimeError
+ Tk.load_tclscript(TkTree::TCL_SCRIPT_PATH)
+ tk_call('::tktree::treecreate', *args)
+ end
+ end
+
+ def newitem(itempath, keys = nil)
+ if keys.kind_of?(Hash)
+ keys = _symbolkey2str(keys)
+ font = keys.delete('itemfont')
+# font = hash_kv(font) if font.kind_of?(Hash)
+ keys['font'] = font if font
+# tk_call('::tktree::newitem', @path, itempath, *hash_kv(keys))
+ tk_call('::tktree::newitem', @path, itempath, keys)
+ else
+ tk_call('::tktree::newitem', @path, itempath)
+ end
+ end
+
+ def delitem(itempath)
+ tk_call('::tktree::delitem', @path, itempath)
+ end
+
+ def labelat(xpos, ypos)
+ tk_call('::tktree::delitem', @path, xpos, ypos)
+ end
+
+ def getselection
+ tk_call('::tktree::getselection', @path)
+ end
+
+ def setselection(itempath)
+ tk_call('::tktree::getselection', @path, itempath)
+ end
+end
+
+
+##########################################################################
+# test script
+##########################################################################
+if __FILE__ == $0
+ TkLabel.new(:text=><<EOL, :relief=>:ridge, :justify=>:left).pack
+
+ This is a sample to use a Tcl library script on Ruby/Tk.
+ This sample loads tktree.tcl (see <http://wiki.tcl.tk/10615>)
+ and calls functions of the Tcl script.
+EOL
+
+ items = %w(/group1/item1 /group1/item2 /group1/subgroup/item1 /group2/item1 /item1)
+
+ tr1 = TkTree.new.pack(:expand=>true, :fill=>:both)
+ tr1.focus
+
+ items.each{|item|
+ tr1.newitem(item,
+ :command=>proc{Tk.messageBox(:message=>"#{item} executed")})
+ }
+
+ f = TkFrame.new.pack(:expand=>true, :fill=>:both)
+ tr2 = TkTree.new(f, :bg=>'black', #:itemfont=>{:family=>'Times', :size=>14},
+ :textcolor=>'red', :bd=>4, :relief=>:ridge,
+ :selectbackground=>'darkBlue', :selectforeground=>'yellow',
+ :selectborderwidth=>3, :linecolor=>'yellow') {
+ yscrollbar(TkScrollbar.new(f, :width=>10).pack(:side=>:right, :fill=>:y))
+ xscrollbar(TkScrollbar.new(f, :width=>10).pack(:side=>:bottom, :fill=>:x))
+ pack(:expand=>true, :fill=>:both)
+ }
+
+ items.each{|item|
+ tr2.newitem(item, :textcolor=>'green', :image=>'',
+ :itemfont=>{:family=>'Times', :size=>10},
+ :command=>proc{Tk.messageBox(:message=>"#{item} executed")})
+ }
+
+ Tk.mainloop
+end
diff --git a/ext/tk/sample/tktree.tcl b/ext/tk/sample/tktree.tcl
new file mode 100644
index 0000000000..a5e47eb776
--- /dev/null
+++ b/ext/tk/sample/tktree.tcl
@@ -0,0 +1,305 @@
+#
+# This Tcl/Tk script is quoted from <http://wiki.tcl.tk/10615>.
+#
+ package require Tk
+ namespace eval ::tktree {
+
+ # Images used for open and close state of subgroups
+ set ::tktree::imgcollapse [image create photo .tktreeopenbm -data {
+ R0lGODdhCQAJAIAAAAEBAf///ywAAAAACQAJAAACEISPoRvG614D80x5ZXyogwIAOw==}]
+ set ::tktree::imgexpand [image create photo .tktreeclosebm -data {
+ R0lGODdhCQAJAIAAAAEBAf///ywAAAAACQAJAAACEYSPoRu28KCSDSJLc44s3lMAADs=}]
+ ###Default images for groups and children
+ set ::tktree::imgsubgroups [image create photo .tktreeimgfolder -data {
+ R0lGODlhEAANAKIAANnZ2Xh4eLi4uPj4APj4+AAAAP///////yH5BAEAAAAA
+ LAAAAAAQAA0AAANkCIChiqDLITgyEgi6GoIjIyMYugCBpMsaWBA0giMjIzgy
+ UYBBMjIoIyODEgVBODIygiMjE1gQJIMyMjIoI1GAQSMjODIyghMFQSgjI4My
+ MhJYEDSCIyMjODJRgKHLXAiApcsMmAA7}]
+ set ::tktree::imgchildren [image create photo .tktreeimgfile -data {
+ R0lGODlhDQAQAKIAANnZ2Xh4ePj4+Li4uAAAAP///////////yH5BAEAAAAA
+ LAAAAAANABAAAANSGLoLgACBoqsRCBAoujqCASGDojtESCEihCREIjgUKLo8
+ hCGCpCsySIGiy0MYIki6IoMUKLo8hCGCpCsySIGiy0MYKLo8hIGiy0MYOLo8
+ SLrMCQA7}]
+
+ #### Swtich all subgroups of a layer to open or close
+ proc ::tktree::switchlayer {win opn {layer /}} {
+ variable cfg
+ foreach child $cfg($win,$layer:subgroups) {
+ set cfg($win,$child:open) $opn
+ switchlayer $win $opn $child
+ }
+ buildwhenidle $win
+ }
+
+ #### will open or close the item given
+ proc ::tktree::switchstate {win item} {
+ set ::tktree::cfg($win,$item:open) [expr ! $::tktree::cfg($win,$item:open)]
+ buildwhenidle $win
+ }
+
+ #### Select the next item up or down
+ proc ::tktree::updown {win down} {
+ variable cfg
+ set index [lsearch -exact $cfg($win,sortlist) $cfg($win,selection)]
+ if {$down} {incr index} {incr index -1}
+ if {$index < 0} {set index end} elseif {$index >= [llength $cfg($win,sortlist)]} {set index 0}
+ setselection $win [lindex $cfg($win,sortlist) $index]
+ }
+
+ #### left-right button binding commands
+ proc ::tktree::leftright {win right} {
+ variable cfg
+ set item $cfg($win,selection)
+ set index [lsearch -exact $cfg($win,sortlist) $item]
+ set parentindex [lsearch -exact $cfg($win,sortlist) [file dirname $item]]
+ if {$parentindex == -1} {set parentindex [expr $index - 1]}
+ if {$cfg($win,$item:group)} {
+ if {$right} {
+ if {$cfg($win,$item:open)} {incr index} {set cfg($win,$item:open) 1}
+ } else {
+ if {$cfg($win,$item:open)} {set cfg($win,$item:open) 0} {set index $parentindex}
+ }
+ } else {
+ if {$right} {incr index} {set index $parentindex}
+ }
+ if {$index < 0} {set index end} elseif {$index >= [llength $cfg($win,sortlist)]} {set index 0}
+ setselection $win [lindex $cfg($win,sortlist) $index]
+ buildwhenidle $win
+ }
+
+ #### will return the pathname of the item at x and y cooridinates
+ proc ::tktree::labelat {win x y} {
+ set x [$win canvasx $x]; set y [$win canvasy $y]
+ foreach m [$win find overlapping $x $y $x $y] {
+ if {[info exists ::tktree::cfg($win,tag:$m)]} {return $::tktree::cfg($win,tag:$m)}
+ }
+ return ""
+ }
+
+ #### will return the path of the current selection in the given tree widget
+ proc ::tktree::getselection {win} {
+ return $::tktree::cfg($win,selection)
+ }
+
+ #### adjust the scrollview to show the selected item as needed
+ proc ::tktree::scrolladjust {win tag} {
+ update
+ set item [$win bbox $tag]
+ set region [$win cget -scrollregion]
+ foreach {axis idx1 idx2} {yview 1 3 xview 0 2} {
+ set range [expr abs([lindex $region $idx2]) - abs([lindex $region $idx1])]
+ set itemtop [lindex $item $idx1]; set itembot [lindex $item $idx2]
+ set viewtop [expr $range * [lindex [$win $axis] 0]]
+ set viewbot [expr $range * [lindex [$win $axis] 1]]
+ if {$itembot > $viewbot} {$win $axis moveto [expr ($itembot. - $viewbot + $viewtop) / $range]}
+ if {$itemtop < $viewtop} {$win $axis moveto [expr $itemtop. / $range]}
+ }
+ }
+
+ #### will set the current selection to the given item on the given tree
+ proc ::tktree::setselection {win item} {
+ variable cfg
+ if {![llength $cfg($win,sortlist)]} {return}
+ if {$item eq ""} {set item [lindex $cfg($win,sortlist) 0]}
+ if {![info exists cfg($win,$item:tag)]} {set item [lindex $cfg($win,sortlist) 0]}
+ if {[$win gettags $cfg($win,$item:tag)] ne ""} {
+ $win select from $cfg($win,$item:tag) 0
+ $win select to $cfg($win,$item:tag) end
+ set cfg($win,selection) $item
+ scrolladjust $win $cfg($win,$item:tag)
+ } {
+ setselection $win "/[lindex $cfg($win,/:sortlist) 0]"
+ }
+ }
+
+ #### will delete the item given from the tree given
+ proc ::tktree::delitem {win item} {
+ variable cfg
+ if {$item eq "/"} {
+ array unset cfg $win,* ; catch {destroy $win}
+ } {
+ set group [file dirname $item]
+ if {$cfg($win,$item:group)} {set type subgroups} {set type children}
+ set index [lsearch -exact $cfg($win,$group:$type) $item]
+ set cfg($win,$group:$type) [lreplace $cfg($win,$group:$type) $index $index]
+ array unset cfg $win,$item*
+ buildwhenidle $win
+ }
+ }
+
+ #### create a new item in the tree and rebuild the widget
+ proc ::tktree::newitem {win item args} {
+ variable cfg
+ if {[string index $item 0] ne "/"} {set item /$item}
+ if {[string index $item end] eq "/"} {
+ set subgroup 1
+ set type subgroups
+ set item [string range $item 0 end-1]
+ set cfg($win,$item:command) [list ::tktree::switchstate $win $item]
+ } {
+ set subgroup 0
+ set type children
+ set cfg($win,$item:command) {}
+ }
+ #Build parent group if needed
+ set group [file dirname $item]
+ if {![info exists cfg($win,$group:open)]} {newitem $win "$group\/"}
+ lappend cfg($win,$group:$type) $item
+ #Configure the new item
+ set cfg($win,$item:group) $subgroup
+ set cfg($win,$item:subgroups) {}
+ set cfg($win,$item:children) {}
+ set cfg($win,$item:sortlist) {}
+ set cfg($win,$item:tags) {}
+ set cfg($win,$item:open) 0
+ set cfg($win,$item:image) {}
+ set cfg($win,$item:textcolor) $cfg($win,textcolor)
+ set cfg($win,$item:font) $cfg($win,font)
+ if {$cfg($win,images)} {set cfg($win,$item:image) [eval list \$::tktree::img$type]}
+ foreach {confitem confval} $args {
+ switch -exact -- $confitem {
+ -textcolor {set cfg($win,$item:textcolor) $confval}
+ -command {set cfg($win,$item:command) $confval}
+ -image {set cfg($win,$item:image) $confval}
+ -font {set cfg($win,$item:font) $confval}
+ }
+ }
+ buildwhenidle $win
+ }
+
+ #### Draw the given layer of the tree on the canvas starting at xposition
+ proc ::tktree::buildlayer {win layer xpos} {
+ variable cfg
+ #Record y positions for vertical line later on
+ set ystart $cfg($win,y); set yend $cfg($win,y)
+ if {$layer eq "/"} {set cfg($win,sortlist) ""}
+ foreach child $cfg($win,$layer:sortlist) {
+ lappend cfg($win,sortlist) $child
+ #Check spacing required for images
+ set imgwidth 0; set imgheight 0
+ if {[string length $cfg($win,$child:image)]} {
+ set imgwidth [expr ([image width $cfg($win,$child:image)] + 2) / 2]
+ set imgheight [expr ([image height $cfg($win,$child:image)] + 2) / 2]
+ }
+ #find X-axis points for image, horiz line, and text
+ if {$imgwidth} {
+ set centerX [expr $imgwidth + $xpos + 7]
+ set rightX [expr $xpos + 7]
+ set textX [expr ($imgwidth * 2) + $xpos + 10]
+ } {
+ set centerX [expr $xpos + 10]
+ set rightX [expr $centerX + 4]
+ set textX [expr $rightX + 1]
+ }
+ #Find the proper amount to increment the y axis
+ set fontheight [lindex [font metrics $cfg($win,$child:font)] 5]
+ set yincr [expr ($fontheight + 1) / 2]
+ if {$imgheight > $yincr} {set yincr $imgheight}
+ incr cfg($win,y) $yincr
+ #Draw the horizonal line
+ $win create line $xpos $cfg($win,y) $rightX $cfg($win,y) -fill $cfg($win,linecolor)
+ set yend $cfg($win,y)
+ #Draw the image, if it exists
+ if {$imgwidth} {
+ set it [$win create image $centerX $cfg($win,y) -image $cfg($win,$child:image)]
+ $win bind $it <1> [list ::tktree::setselection $win $child]
+ }
+ #Draw text and store tags for reference
+ set cfg($win,$child:tag) [$win create text $textX $cfg($win,y) \
+ -text [file tail $child] -font $cfg($win,$child:font) -anchor w -tags x -fill $cfg($win,$child:textcolor)]
+ set cfg($win,tag:$cfg($win,$child:tag)) $child
+ #Command binding
+ $win bind $cfg($win,$child:tag) <1> [list ::tktree::setselection $win $child]
+ $win bind $cfg($win,$child:tag) <Double-1> $cfg($win,$child:command)
+ #next step up on the y axis
+ incr cfg($win,y) $yincr
+ #If its a group, add open-close functionality
+ if {$cfg($win,$child:group)} {
+ if {$cfg($win,$child:open)} {set img collapse} {set img expand}
+ set ocimg [$win create image $xpos [expr $cfg($win,y) - $yincr] -image [eval list \$::tktree::img$img]]
+ $win bind $ocimg <1> [list ::tktree::switchstate $win $child]
+ if {$cfg($win,$child:open)} {buildlayer $win $child $centerX}
+ }
+ }
+ #Vertical line
+ $win lower [$win create line $xpos [expr $ystart - 7] $xpos $yend -fill $cfg($win,linecolor)]
+ }
+
+ #### sort the layer by subgroups then children
+ proc ::tktree::sortlayer {win {layer /}} {
+ variable cfg
+ set cfg($win,$layer:subgroups) [lsort -dictionary $cfg($win,$layer:subgroups)]
+ set cfg($win,$layer:children) [lsort -dictionary $cfg($win,$layer:children)]
+ set cfg($win,$layer:sortlist) [join [list $cfg($win,$layer:subgroups) $cfg($win,$layer:children)]]
+ foreach group $cfg($win,$layer:subgroups) {sortlayer $win $group}
+ }
+
+ #### build the tree at the given path
+ proc ::tktree::buildtree {win} {
+ variable cfg
+ $win delete all
+ sortlayer $win
+ set xpos 5
+ set cfg($win,y) 5
+ #Draw global expand/contract button, if needed
+ if {[string length $cfg($win,/:subgroups)] && $cfg($win,expandall)} {
+ set exp 0
+ foreach subgroup $cfg($win,/:subgroups) {incr exp $cfg($win,$subgroup:open)}
+ if {$exp} {set type collapse} {set type expand}
+ set ocimg [$win create image 1 1 -image [eval list \$::tktree::img$type] -anchor w]
+ $win bind $ocimg <1> [list ::tktree::switchlayer $win [expr ! $exp]]
+ }
+ #Build the layers and set initial selection
+ buildlayer $win / $xpos
+ $win config -scrollregion [$win bbox all]
+ setselection $win $cfg($win,selection)
+ }
+
+ #### internal use - set up a handle to build the tree when everything is idle
+ proc ::tktree::buildwhenidle {win} {
+ catch {after cancel $::tktree::cfg($win,buildHandle)}
+ set ::tktree::cfg($win,buildHandle) [after idle [list ::tktree::buildtree $win]]
+ }
+
+ #### will create a new tree widget at the given path
+ proc ::tktree::treecreate {win args} {
+ variable cfg
+ #Default configuration for new tree
+ set cfg($win,selection) {}
+ set cfg($win,selidx) {}
+ set cfg($win,/:subgroups) {}
+ set cfg($win,/:children) {}
+ set cfg($win,/:open) 1
+ set cfg($win,images) 1
+ set cfg($win,expandall) 1
+ set cfg($win,linecolor) black
+ set cfg($win,textcolor) black
+ set cfg($win,font) {-family Helvetica -size 10}
+ #Parse and setup custom configuration options
+ set canvascfg ""
+ foreach {item val} $args {
+ switch -- $item {
+ -linecolor {set cfg($win,linecolor) $val}
+ -textcolor {set cfg($win,textcolor) $val}
+ -font {set cfg($win,font) $val}
+ -images {set cfg($win,images) $val}
+ -expandall {set cfg($win,expandall) $val}
+ default {lappend canvascfg $item $val}
+ }
+ }
+ #Build the canvas
+ eval {canvas $win -takefocus 1} $canvascfg
+ bind $win <Destroy> [list ::tktree::delitem $win /]
+ bind $win <1> [list focus $win]
+ bind $win <Return> {eval $::tktree::cfg(%W,[::tktree::getselection %W]:command)}
+ bind $win <space> {eval $::tktree::cfg(%W,[::tktree::getselection %W]:command)}
+ bind $win <Up> [list ::tktree::updown $win 0]
+ bind $win <Down> [list ::tktree::updown $win 1]
+ bind $win <Left> [list ::tktree::leftright $win 0]
+ bind $win <Right> [list ::tktree::leftright $win 1]
+
+ #Build the tree when idle
+ buildwhenidle $win
+ }
+ }
+
diff --git a/ext/tk/sample/ttk_wrapper.rb b/ext/tk/sample/ttk_wrapper.rb
new file mode 100644
index 0000000000..e4eb9c7964
--- /dev/null
+++ b/ext/tk/sample/ttk_wrapper.rb
@@ -0,0 +1,154 @@
+#!/usr/bin/env ruby
+#
+# ttk_wrapper.rb -- use Ttk widgets as default on old Ruby/Tk scripts
+#
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+version = '0.1.3'
+#
+##########################################################################
+# parse commandline arguments
+##########################################################################
+require 'optparse'
+opt = OptionParser.new("Usage: #{$0} [options] rubytk_script" << "\n " <<
+ "Ruby/Tk script wrapper. Use Ttk widgets as default.")
+opt.version = version
+
+OPTS = {}
+OPTS[:themedir] = []
+OPTS[:rb_theme] = []
+OPTS[:theme] = 'default'
+
+opt.on('-l', '--list', 'list available theme names'){|v| OPTS[:list] = true}
+opt.on('-t', '--theme theme', 'theme name'){|v| OPTS[:theme] = v}
+opt.on('-d', '--themedir themes_dir', 'directory of theme definitions'){|v|
+ OPTS[:themedir] << v
+}
+opt.on('-r', '--rubytheme rb_theme', 'theme definition file (ruby script)'){|v|
+ OPTS[:rb_theme] << v
+}
+opt.on('-v', '--verbose', 'print verbose messages'){|v| OPTS[:verbose] = true}
+
+opt.parse!(ARGV)
+
+
+##########################################################################
+# load Ttk (Tile) extension
+##########################################################################
+require 'tk'
+
+begin
+ require 'tkextlib/tile'
+ Tk.default_widget_set = :Ttk
+rescue LoadError
+ if OPTS[:verbose]
+ print "warning: fail to load 'Ttk' extension. use standard widgets.\n"
+ end
+end
+
+if OPTS[:verbose]
+ print "current default widget set is '#{Tk.default_widget_set}'\n"
+end
+
+
+##########################################################################
+# define Tcl/Tk procedures for compatibility.
+# those are required when want to use themes included
+# in "sample/tkextlib/tile/demo.rb".
+##########################################################################
+Tk::Tile.__define_LoadImages_proc_for_compatibility__!
+Tk::Tile::Style.__define_wrapper_proc_for_compatibility__!
+
+
+##########################################################################
+# use themes defined on the demo of Ttk (Tile) extension
+##########################################################################
+demodir = File.dirname(__FILE__)
+demo_themesdir = File.expand_path(File.join(demodir, 'tkextlib', 'tile', 'themes'))
+
+Tk::AUTO_PATH.lappend(*OPTS[:themedir]) unless OPTS[:themedir].empty?
+Tk::AUTO_PATH.lappend('.', demodir, demo_themesdir)
+
+OPTS[:themedir] << demo_themesdir
+print "theme-dirs: #{OPTS[:themedir].inspect}\n" if OPTS[:verbose]
+
+OPTS[:themedir].each{|themesdir|
+ if File.directory?(themesdir)
+ Dir.foreach(themesdir){|name|
+ next if name == '.' || name == '..'
+ path = File.join(themesdir, name)
+ Tk::AUTO_PATH.lappend(path) if File.directory?(path)
+ }
+ end
+}
+
+# This forces an update of the available packages list. It's required
+# for package names to find the themes in demos/themes/*.tcl
+Tk.ip_eval("#{TkPackage.unknown_proc} Tcl #{TkPackage.provide('Tcl')}")
+
+# load themes written in Ruby.
+themes_by_ruby = [File.join(demo_themesdir, 'kroc.rb')]
+themes_by_ruby.concat OPTS[:rb_theme]
+print "ruby-themes: #{themes_by_ruby.inspect}\n" if OPTS[:verbose]
+
+themes_by_ruby.each{|f|
+ begin
+ load(f, true)
+ rescue LoadError
+ print "fail to load \"#{f}\"\n" if OPTS[:verbose]
+ end
+}
+
+
+##########################################################################
+# ignore unsupported options of Ttk widgets
+##########################################################################
+TkConfigMethod.__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__! true
+TkItemConfigMethod.__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__! true
+
+
+##########################################################################
+# set theme of widget style
+##########################################################################
+if OPTS[:list] || OPTS[:verbose]
+ print "supported theme names: #{Tk::Tile.themes.inspect}\n"
+ exit if OPTS[:list] && ARGV.empty?
+end
+print "use theme: \"#{OPTS[:theme]}\"\n" if OPTS[:theme] && OPTS[:verbose]
+#setTheme(OPTS[:theme]) if OPTS[:theme]
+Tk::Tile.set_theme(OPTS[:theme]) if OPTS[:theme]
+
+
+##########################################################################
+# replace $0 and $RPAGRAM_NAME
+##########################################################################
+# When the expand_path of the target script is long, ruby sometimes
+# fails to set the path to $0 (the path string is trimmed).
+# The following replaces $0 and $PROGNAME to avoid such trouble.
+progname_obj = $0.dup
+$program_name = progname_obj
+
+alias $REAL_PROGRAM_NAME $0
+alias $PROGRAM_NAME $program_name
+alias $0 $program_name
+
+trace_var(:$program_name){|val|
+ unless progname_obj.object_id == val.object_id
+ progname_obj.replace(val.to_s)
+ $program_name = progname_obj
+ end
+}
+
+
+##########################################################################
+# load script
+##########################################################################
+if (path = ARGV.shift) && (script = File.expand_path(path))
+ print "load script \"#{script}\"\n" if OPTS[:verbose]
+ $0 = script
+ load(script)
+else
+ print "Error: no script is given.\n"
+ print opt.help
+ exit(1)
+end
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
new file mode 100644
index 0000000000..6c82c7a7bb
--- /dev/null
+++ b/ext/tk/stubs.c
@@ -0,0 +1,592 @@
+/************************************************
+
+ stubs.c - Tcl/Tk stubs support
+
+************************************************/
+
+#include "ruby.h"
+#include "stubs.h"
+
+#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+
+#include <tcl.h>
+#include <tk.h>
+
+/*------------------------------*/
+
+#ifdef __MACOS__
+# include <tkMac.h>
+# include <Quickdraw.h>
+
+static int call_macinit = 0;
+
+static void
+_macinit()
+{
+ if (!call_macinit) {
+ tcl_macQdPtr = &qd; /* setup QuickDraw globals */
+ Tcl_MacSetEventProc(TkMacConvertEvent); /* setup event handler */
+ call_macinit = 1;
+ }
+}
+#endif
+
+/*------------------------------*/
+
+static int nativethread_checked = 0;
+
+static void
+_nativethread_consistency_check(ip)
+ Tcl_Interp *ip;
+{
+ if (nativethread_checked || ip == (Tcl_Interp *)NULL) {
+ return;
+ }
+
+ /* If the variable "tcl_platform(threaded)" exists,
+ then the Tcl interpreter was compiled with threads enabled. */
+ if (Tcl_GetVar2(ip, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != (char*)NULL) {
+#ifdef HAVE_NATIVETHREAD
+ /* consistent */
+#else
+ rb_warn("Inconsistency. Loaded Tcl/Tk libraries are enabled nativethread-support. But `tcltklib' is not. The inconsistency causes SEGV or other troubles frequently.");
+#endif
+ } else {
+#ifdef HAVE_NATIVETHREAD
+ rb_warning("Inconsistency.`tcltklib' is enabled nativethread-support. But loaded Tcl/Tk libraries are not. (Probably, the inconsistency doesn't cause any troubles.)");
+#else
+ /* consistent */
+#endif
+ }
+
+ Tcl_ResetResult(ip);
+
+ nativethread_checked = 1;
+}
+
+/*------------------------------*/
+
+#if defined USE_TCL_STUBS && defined USE_TK_STUBS
+
+#if defined _WIN32 || defined __CYGWIN__
+# ifdef HAVE_RUBY_RUBY_H
+# include "ruby/util.h"
+# else
+# include "util.h"
+# endif
+# include <windows.h>
+ typedef HINSTANCE DL_HANDLE;
+# define DL_OPEN LoadLibrary
+# define DL_SYM GetProcAddress
+# define TCL_INDEX 4
+# define TK_INDEX 3
+# define TCL_NAME "tcl89"
+# define TK_NAME "tk89"
+# undef DLEXT
+# define DLEXT ".dll"
+#elif defined HAVE_DLOPEN
+# include <dlfcn.h>
+ typedef void *DL_HANDLE;
+# define DL_OPEN(file) dlopen(file, RTLD_LAZY|RTLD_GLOBAL)
+# define DL_SYM dlsym
+# define TCL_INDEX 8
+# define TK_INDEX 7
+# define TCL_NAME "libtcl8.9"
+# define TK_NAME "libtk8.9"
+# ifdef __APPLE__
+# undef DLEXT
+# define DLEXT ".dylib"
+# endif
+#endif
+
+static DL_HANDLE tcl_dll = (DL_HANDLE)0;
+static DL_HANDLE tk_dll = (DL_HANDLE)0;
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_open_tcl_dll(char *appname)
+#else
+ruby_open_tcl_dll(appname)
+ char *appname;
+#endif
+{
+ void (*p_Tcl_FindExecutable)(const char *);
+ int n;
+ char *ruby_tcl_dll = 0;
+
+ if (tcl_dll) return TCLTK_STUBS_OK;
+
+ ruby_tcl_dll = getenv("RUBY_TCL_DLL");
+#if defined _WIN32
+ if (ruby_tcl_dll) ruby_tcl_dll = ruby_strdup(ruby_tcl_dll);
+#endif
+ if (ruby_tcl_dll) {
+ tcl_dll = (DL_HANDLE)DL_OPEN(ruby_tcl_dll);
+ } else {
+ char tcl_name[] = TCL_NAME DLEXT;
+ /* examine from 8.9 to 8.1 */
+ for (n = '9'; n > '0'; n--) {
+ tcl_name[TCL_INDEX] = n;
+ tcl_dll = (DL_HANDLE)DL_OPEN(tcl_name);
+ if (tcl_dll)
+ break;
+ }
+ }
+
+#if defined _WIN32
+ if (ruby_tcl_dll) ruby_xfree(ruby_tcl_dll);
+#endif
+
+ if (!tcl_dll)
+ return NO_TCL_DLL;
+
+ p_Tcl_FindExecutable = (void (*)(const char *))DL_SYM(tcl_dll, "Tcl_FindExecutable");
+ if (!p_Tcl_FindExecutable)
+ return NO_FindExecutable;
+
+ if (appname) {
+ p_Tcl_FindExecutable(appname);
+ } else {
+ p_Tcl_FindExecutable("ruby");
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+ruby_open_tk_dll()
+{
+ int n;
+ char *ruby_tk_dll = 0;
+
+ if (!tcl_dll) {
+ /* int ret = ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
+ int ret = ruby_open_tcl_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ if (ret != TCLTK_STUBS_OK) return ret;
+ }
+
+ if (tk_dll) return TCLTK_STUBS_OK;
+
+ ruby_tk_dll = getenv("RUBY_TK_DLL");
+ if (ruby_tk_dll) {
+ tk_dll = (DL_HANDLE)DL_OPEN(ruby_tk_dll);
+ } else {
+ char tk_name[] = TK_NAME DLEXT;
+ /* examine from 8.9 to 8.1 */
+ for (n = '9'; n > '0'; n--) {
+ tk_name[TK_INDEX] = n;
+ tk_dll = (DL_HANDLE)DL_OPEN(tk_name);
+ if (tk_dll)
+ break;
+ }
+ }
+
+ if (!tk_dll)
+ return NO_TK_DLL;
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_open_tcltk_dll(char *appname)
+#else
+ruby_open_tcltk_dll(appname)
+ char *appname;
+#endif
+{
+ return( ruby_open_tcl_dll(appname) || ruby_open_tk_dll() );
+}
+
+int
+tcl_stubs_init_p()
+{
+ return(tclStubsPtr != (TclStubs*)NULL);
+}
+
+int
+tk_stubs_init_p()
+{
+ return(tkStubsPtr != (TkStubs*)NULL);
+}
+
+
+Tcl_Interp *
+#ifdef HAVE_PROTOTYPES
+ruby_tcl_create_ip_and_stubs_init(int *st)
+#else
+ruby_tcl_create_ip_and_stubs_init(st)
+ int *st;
+#endif
+{
+ Tcl_Interp *tcl_ip;
+
+ if (st) *st = 0;
+
+ if (tcl_stubs_init_p()) {
+ tcl_ip = Tcl_CreateInterp();
+
+ if (!tcl_ip) {
+ if (st) *st = FAIL_CreateInterp;
+ return (Tcl_Interp*)NULL;
+ }
+
+ _nativethread_consistency_check(tcl_ip);
+
+ return tcl_ip;
+
+ } else {
+ Tcl_Interp *(*p_Tcl_CreateInterp)();
+ Tcl_Interp *(*p_Tcl_DeleteInterp)();
+
+ if (!tcl_dll) {
+ /* int ret = ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
+ int ret = ruby_open_tcl_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+
+ if (ret != TCLTK_STUBS_OK) {
+ if (st) *st = ret;
+ return (Tcl_Interp*)NULL;
+ }
+ }
+
+ p_Tcl_CreateInterp
+ = (Tcl_Interp *(*)())DL_SYM(tcl_dll, "Tcl_CreateInterp");
+ if (!p_Tcl_CreateInterp) {
+ if (st) *st = NO_CreateInterp;
+ return (Tcl_Interp*)NULL;
+ }
+
+ p_Tcl_DeleteInterp
+ = (Tcl_Interp *(*)())DL_SYM(tcl_dll, "Tcl_DeleteInterp");
+ if (!p_Tcl_DeleteInterp) {
+ if (st) *st = NO_DeleteInterp;
+ return (Tcl_Interp*)NULL;
+ }
+
+ tcl_ip = (*p_Tcl_CreateInterp)();
+ if (!tcl_ip) {
+ if (st) *st = FAIL_CreateInterp;
+ return (Tcl_Interp*)NULL;
+ }
+
+ if (!Tcl_InitStubs(tcl_ip, "8.1", 0)) {
+ if (st) *st = FAIL_Tcl_InitStubs;
+ (*p_Tcl_DeleteInterp)(tcl_ip);
+ return (Tcl_Interp*)NULL;
+ }
+
+ _nativethread_consistency_check(tcl_ip);
+
+ return tcl_ip;
+ }
+}
+
+int
+ruby_tcl_stubs_init()
+{
+ int st;
+ Tcl_Interp *tcl_ip;
+
+ if (!tcl_stubs_init_p()) {
+ tcl_ip = ruby_tcl_create_ip_and_stubs_init(&st);
+
+ if (!tcl_ip) return st;
+
+ Tcl_DeleteInterp(tcl_ip);
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_tk_stubs_init(Tcl_Interp *tcl_ip)
+#else
+ruby_tk_stubs_init(tcl_ip)
+ Tcl_Interp *tcl_ip;
+#endif
+{
+ Tcl_ResetResult(tcl_ip);
+
+ if (tk_stubs_init_p()) {
+ if (Tk_Init(tcl_ip) == TCL_ERROR) {
+ return FAIL_Tk_Init;
+ }
+ } else {
+ int (*p_Tk_Init)(Tcl_Interp *);
+
+ if (!tk_dll) {
+ int ret = ruby_open_tk_dll();
+ if (ret != TCLTK_STUBS_OK) return ret;
+ }
+
+ p_Tk_Init = (int (*)(Tcl_Interp *))DL_SYM(tk_dll, "Tk_Init");
+ if (!p_Tk_Init)
+ return NO_Tk_Init;
+
+#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__)
+ /*
+ FIX ME : dirty hack for Mac OS X frameworks.
+ With stubs, fails to find Resource/Script directory of Tk.framework.
+ So, teach it to a Tcl interpreter by an environment variable.
+ e.g. when $tcl_library ==
+ /Library/Frameworks/Tcl.framwwork/8.5/Resources/Scripts
+ ==> /Library/Frameworks/Tk.framwwork/8.5/Resources/Scripts
+ */
+ if (Tcl_Eval(tcl_ip,
+ "if {[array get env TK_LIBRARY] == {}} { set env(TK_LIBRARY) [regsub -all -nocase {(t)cl} $tcl_library {\\1k}] }"
+ ) != TCL_OK) {
+ return FAIL_Tk_Init;
+ }
+#endif
+
+ if ((*p_Tk_Init)(tcl_ip) == TCL_ERROR)
+ return FAIL_Tk_Init;
+
+ if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
+ return FAIL_Tk_InitStubs;
+
+#ifdef __MACOS__
+ _macinit();
+#endif
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_tk_stubs_safeinit(Tcl_Interp *tcl_ip)
+#else
+ruby_tk_stubs_safeinit(tcl_ip)
+ Tcl_Interp *tcl_ip;
+#endif
+{
+ Tcl_ResetResult(tcl_ip);
+
+ if (tk_stubs_init_p()) {
+ if (Tk_SafeInit(tcl_ip) == TCL_ERROR)
+ return FAIL_Tk_Init;
+ } else {
+ int (*p_Tk_SafeInit)(Tcl_Interp *);
+
+ if (!tk_dll) {
+ int ret = ruby_open_tk_dll();
+ if (ret != TCLTK_STUBS_OK) return ret;
+ }
+
+ p_Tk_SafeInit = (int (*)(Tcl_Interp *))DL_SYM(tk_dll, "Tk_SafeInit");
+ if (!p_Tk_SafeInit)
+ return NO_Tk_Init;
+
+ if ((*p_Tk_SafeInit)(tcl_ip) == TCL_ERROR)
+ return FAIL_Tk_Init;
+
+ if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
+ return FAIL_Tk_InitStubs;
+
+#ifdef __MACOS__
+ _macinit();
+#endif
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+ruby_tcltk_stubs()
+{
+ int st;
+ Tcl_Interp *tcl_ip;
+
+ /* st = ruby_open_tcltk_dll(RSTRING_PTR(rb_argv0)); */
+ st = ruby_open_tcltk_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ switch(st) {
+ case NO_FindExecutable:
+ return -7;
+ case NO_TCL_DLL:
+ case NO_TK_DLL:
+ return -1;
+ }
+
+ tcl_ip = ruby_tcl_create_ip_and_stubs_init(&st);
+ if (!tcl_ip) {
+ switch(st) {
+ case NO_CreateInterp:
+ case NO_DeleteInterp:
+ return -2;
+ case FAIL_CreateInterp:
+ return -3;
+ case FAIL_Tcl_InitStubs:
+ return -5;
+ }
+ }
+
+ st = ruby_tk_stubs_init(tcl_ip);
+ switch(st) {
+ case NO_Tk_Init:
+ Tcl_DeleteInterp(tcl_ip);
+ return -4;
+ case FAIL_Tk_Init:
+ case FAIL_Tk_InitStubs:
+ Tcl_DeleteInterp(tcl_ip);
+ return -6;
+ }
+
+ Tcl_DeleteInterp(tcl_ip);
+
+ return 0;
+}
+
+/*###################################################*/
+#else /* ! USE_TCL_STUBS || ! USE_TK_STUBS) */
+/*###################################################*/
+
+static int open_tcl_dll = 0;
+static int call_tk_stubs_init = 0;
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_open_tcl_dll(char *appname)
+#else
+ruby_open_tcl_dll(appname)
+ char *appname;
+#endif
+{
+ if (appname) {
+ Tcl_FindExecutable(appname);
+ } else {
+ Tcl_FindExecutable("ruby");
+ }
+ open_tcl_dll = 1;
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+ruby_open_tk_dll()
+{
+ if (!open_tcl_dll) {
+ /* ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
+ ruby_open_tcl_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_open_tcltk_dll(char *appname)
+#else
+ruby_open_tcltk_dll(appname)
+ char *appname;
+#endif
+{
+ return( ruby_open_tcl_dll(appname) || ruby_open_tk_dll() );
+}
+
+int
+tcl_stubs_init_p()
+{
+ return 1;
+}
+
+int
+tk_stubs_init_p()
+{
+ return call_tk_stubs_init;
+}
+
+Tcl_Interp *
+#ifdef HAVE_PROTOTYPES
+ruby_tcl_create_ip_and_stubs_init(int *st)
+#else
+ruby_tcl_create_ip_and_stubs_init(st)
+ int *st;
+#endif
+{
+ Tcl_Interp *tcl_ip;
+
+ if (!open_tcl_dll) {
+ /* ruby_open_tcl_dll(RSTRING_PTR(rb_argv0)); */
+ ruby_open_tcl_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ }
+
+ if (st) *st = 0;
+ tcl_ip = Tcl_CreateInterp();
+ if (!tcl_ip) {
+ if (st) *st = FAIL_CreateInterp;
+ return (Tcl_Interp*)NULL;
+ }
+
+ _nativethread_consistency_check(tcl_ip);
+
+ return tcl_ip;
+}
+
+int
+ruby_tcl_stubs_init()
+{
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_tk_stubs_init(Tcl_Interp *tcl_ip)
+#else
+ruby_tk_stubs_init(tcl_ip)
+ Tcl_Interp *tcl_ip;
+#endif
+{
+ if (Tk_Init(tcl_ip) == TCL_ERROR)
+ return FAIL_Tk_Init;
+
+ if (!call_tk_stubs_init) {
+#ifdef __MACOS__
+ _macinit();
+#endif
+ call_tk_stubs_init = 1;
+ }
+
+ return TCLTK_STUBS_OK;
+}
+
+int
+#ifdef HAVE_PROTOTYPES
+ruby_tk_stubs_safeinit(Tcl_Interp *tcl_ip)
+#else
+ruby_tk_stubs_safeinit(tcl_ip)
+ Tcl_Interp *tcl_ip;
+#endif
+{
+#if TCL_MAJOR_VERSION >= 8
+ if (Tk_SafeInit(tcl_ip) == TCL_ERROR)
+ return FAIL_Tk_Init;
+
+ if (!call_tk_stubs_init) {
+#ifdef __MACOS__
+ _macinit();
+#endif
+ call_tk_stubs_init = 1;
+ }
+
+ return TCLTK_STUBS_OK;
+
+#else /* TCL_MAJOR_VERSION < 8 */
+
+ return FAIL_Tk_Init;
+#endif
+}
+
+int
+ruby_tcltk_stubs()
+{
+ /* Tcl_FindExecutable(RSTRING_PTR(rb_argv0)); */
+ Tcl_FindExecutable(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ return 0;
+}
+
+#endif
diff --git a/ext/tk/stubs.h b/ext/tk/stubs.h
new file mode 100644
index 0000000000..7c913fb393
--- /dev/null
+++ b/ext/tk/stubs.h
@@ -0,0 +1,33 @@
+#include <tcl.h>
+
+extern int ruby_open_tcl_dll(char *);
+extern int ruby_open_tk_dll();
+extern int ruby_open_tcltk_dll(char *);
+extern int tcl_stubs_init_p();
+extern int tk_stubs_init_p();
+extern Tcl_Interp *ruby_tcl_create_ip_and_stubs_init(int*);
+extern int ruby_tcl_stubs_init();
+extern int ruby_tk_stubs_init(Tcl_Interp*);
+extern int ruby_tk_stubs_safeinit(Tcl_Interp*);
+extern int ruby_tcltk_stubs();
+
+/* no error */
+#define TCLTK_STUBS_OK (0)
+
+/* return value of ruby_open_tcl_dll() */
+#define NO_TCL_DLL (1)
+#define NO_FindExecutable (2)
+
+/* return value of ruby_open_tk_dll() */
+#define NO_TK_DLL (-1)
+
+/* status value of ruby_tcl_create_ip_and_stubs_init(st) */
+#define NO_CreateInterp (3)
+#define NO_DeleteInterp (4)
+#define FAIL_CreateInterp (5)
+#define FAIL_Tcl_InitStubs (6)
+
+/* return value of ruby_tk_stubs_init() */
+#define NO_Tk_Init (7)
+#define FAIL_Tk_Init (8)
+#define FAIL_Tk_InitStubs (9)
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
new file mode 100644
index 0000000000..c67b0207c5
--- /dev/null
+++ b/ext/tk/tcltklib.c
@@ -0,0 +1,11058 @@
+/*
+ * tcltklib.c
+ * Aug. 27, 1997 Y. Shigehiro
+ * Oct. 24, 1997 Y. Matsumoto
+ */
+
+#define TCLTKLIB_RELEASE_DATE "2010-08-25"
+/* #define CREATE_RUBYTK_KIT */
+
+#include "ruby.h"
+
+#ifdef HAVE_RUBY_ENCODING_H
+#include "ruby/encoding.h"
+#endif
+#ifndef RUBY_VERSION
+#define RUBY_VERSION "(unknown version)"
+#endif
+#ifndef RUBY_RELEASE_DATE
+#define RUBY_RELEASE_DATE "unknown release-date"
+#endif
+
+#ifdef HAVE_RB_THREAD_CHECK_TRAP_PENDING
+static int rb_thread_critical; /* dummy */
+int rb_thread_check_trap_pending();
+#else
+/* use rb_thread_critical on Ruby 1.8.x */
+#include "rubysig.h"
+#define rb_thread_check_trap_pending() (0+rb_trap_pending)
+#endif
+
+#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+#if !defined(RSTRING_LENINT)
+#define RSTRING_LENINT(s) ((int)RSTRING_LEN(s))
+#endif
+#if !defined(RARRAY_PTR)
+#define RARRAY_PTR(s) (RARRAY(s)->ptr)
+#define RARRAY_LEN(s) (RARRAY(s)->len)
+#endif
+
+#ifdef OBJ_UNTRUST
+#define RbTk_OBJ_UNTRUST(x) do {OBJ_TAINT(x); OBJ_UNTRUST(x);} while (0)
+#else
+#define RbTk_OBJ_UNTRUST(x) OBJ_TAINT(x)
+#endif
+#define RbTk_ALLOC_N(type, n) (type *)ckalloc((int)(sizeof(type) * (n)))
+
+#if defined(HAVE_RB_PROC_NEW) && !defined(RUBY_VM)
+/* Ruby 1.8 :: rb_proc_new() was hidden from intern.h at 2008/04/22 */
+extern VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE));
+#endif
+
+#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
+#include <stdio.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 <string.h>
+
+#if !defined HAVE_VSNPRINTF && !defined vsnprintf
+# ifdef WIN32
+ /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+# define vsnprintf _vsnprintf
+# else
+# ifdef HAVE_RUBY_RUBY_H
+# include "ruby/missing.h"
+# else
+# include "missing.h"
+# endif
+# endif
+#endif
+
+#include <tcl.h>
+#include <tk.h>
+
+#ifndef HAVE_RUBY_NATIVE_THREAD_P
+#define ruby_native_thread_p() is_ruby_native_thread()
+#undef RUBY_USE_NATIVE_THREAD
+#else
+#define RUBY_USE_NATIVE_THREAD 1
+#endif
+
+#ifndef HAVE_RB_ERRINFO
+#define rb_errinfo() (ruby_errinfo+0) /* cannot be l-value */
+#else
+VALUE rb_errinfo(void);
+#endif
+#ifndef HAVE_RB_SAFE_LEVEL
+#define rb_safe_level() (ruby_safe_level+0)
+#endif
+#ifndef HAVE_RB_SOURCEFILE
+#define rb_sourcefile() (ruby_sourcefile+0)
+#endif
+
+#include "stubs.h"
+
+#ifndef TCL_ALPHA_RELEASE
+#define TCL_ALPHA_RELEASE 0 /* "alpha" */
+#define TCL_BETA_RELEASE 1 /* "beta" */
+#define TCL_FINAL_RELEASE 2 /* "final" */
+#endif
+
+static struct {
+ int major;
+ int minor;
+ int type; /* ALPHA==0, BETA==1, FINAL==2 */
+ int patchlevel;
+} tcltk_version = {0, 0, 0, 0};
+
+static void
+set_tcltk_version()
+{
+ if (tcltk_version.major) return;
+
+ Tcl_GetVersion(&(tcltk_version.major),
+ &(tcltk_version.minor),
+ &(tcltk_version.patchlevel),
+ &(tcltk_version.type));
+}
+
+#if TCL_MAJOR_VERSION >= 8
+# ifndef CONST84
+# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */
+# define CONST84
+# else /* unknown (maybe TCL_VERSION >= 8.5) */
+# ifdef CONST
+# define CONST84 CONST
+# else
+# define CONST84
+# endif
+# endif
+# endif
+#else /* TCL_MAJOR_VERSION < 8 */
+# ifdef CONST
+# define CONST84 CONST
+# else
+# define CONST
+# define CONST84
+# endif
+#endif
+
+#ifndef CONST86
+# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 5 /* Tcl8.0.x -- 8.5.x */
+# define CONST86
+# else
+# define CONST86 CONST84
+# endif
+#endif
+
+/* copied from eval.c */
+#define TAG_RETURN 0x1
+#define TAG_BREAK 0x2
+#define TAG_NEXT 0x3
+#define TAG_RETRY 0x4
+#define TAG_REDO 0x5
+#define TAG_RAISE 0x6
+#define TAG_THROW 0x7
+#define TAG_FATAL 0x8
+
+/* for ruby_debug */
+#define DUMP1(ARG1) if (ruby_debug) { fprintf(stderr, "tcltklib: %s\n", ARG1); fflush(stderr); }
+#define DUMP2(ARG1, ARG2) if (ruby_debug) { fprintf(stderr, "tcltklib: ");\
+fprintf(stderr, ARG1, ARG2); fprintf(stderr, "\n"); fflush(stderr); }
+#define DUMP3(ARG1, ARG2, ARG3) if (ruby_debug) { fprintf(stderr, "tcltklib: ");\
+fprintf(stderr, ARG1, ARG2, ARG3); fprintf(stderr, "\n"); fflush(stderr); }
+/*
+#define DUMP1(ARG1)
+#define DUMP2(ARG1, ARG2)
+#define DUMP3(ARG1, ARG2, ARG3)
+*/
+
+/* release date */
+static const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
+
+/* finalize_proc_name */
+static const char finalize_hook_name[] = "INTERP_FINALIZE_HOOK";
+
+static void ip_finalize _((Tcl_Interp*));
+
+static int at_exit = 0;
+
+#ifdef HAVE_RUBY_ENCODING_H
+static VALUE cRubyEncoding;
+
+/* encoding */
+static int ENCODING_INDEX_UTF8;
+static int ENCODING_INDEX_BINARY;
+#endif
+static VALUE ENCODING_NAME_UTF8;
+static VALUE ENCODING_NAME_BINARY;
+
+static VALUE create_dummy_encoding_for_tk_core _((VALUE, VALUE, VALUE));
+static VALUE create_dummy_encoding_for_tk _((VALUE, VALUE));
+static int update_encoding_table _((VALUE, VALUE, VALUE));
+static VALUE encoding_table_get_name_core _((VALUE, VALUE, VALUE));
+static VALUE encoding_table_get_obj_core _((VALUE, VALUE, VALUE));
+static VALUE encoding_table_get_name _((VALUE, VALUE));
+static VALUE encoding_table_get_obj _((VALUE, VALUE));
+static VALUE create_encoding_table _((VALUE));
+static VALUE ip_get_encoding_table _((VALUE));
+
+
+/* for callback break & continue */
+static VALUE eTkCallbackReturn;
+static VALUE eTkCallbackBreak;
+static VALUE eTkCallbackContinue;
+
+static VALUE eLocalJumpError;
+
+static VALUE eTkLocalJumpError;
+static VALUE eTkCallbackRetry;
+static VALUE eTkCallbackRedo;
+static VALUE eTkCallbackThrow;
+
+static VALUE tcltkip_class;
+
+static ID ID_at_enc;
+static ID ID_at_interp;
+
+static ID ID_encoding_name;
+static ID ID_encoding_table;
+
+static ID ID_stop_p;
+static ID ID_alive_p;
+static ID ID_kill;
+static ID ID_join;
+static ID ID_value;
+
+static ID ID_call;
+static ID ID_backtrace;
+static ID ID_message;
+
+static ID ID_at_reason;
+static ID ID_return;
+static ID ID_break;
+static ID ID_next;
+
+static ID ID_to_s;
+static ID ID_inspect;
+
+static VALUE ip_invoke_real _((int, VALUE*, VALUE));
+static VALUE ip_invoke _((int, VALUE*, VALUE));
+static VALUE ip_invoke_with_position _((int, VALUE*, VALUE, Tcl_QueuePosition));
+static VALUE tk_funcall _((VALUE(), int, VALUE*, VALUE));
+static VALUE callq_safelevel_handler _((VALUE, VALUE));
+
+/* Tcl's object type */
+#if TCL_MAJOR_VERSION >= 8
+static const char Tcl_ObjTypeName_ByteArray[] = "bytearray";
+static CONST86 Tcl_ObjType *Tcl_ObjType_ByteArray;
+
+static const char Tcl_ObjTypeName_String[] = "string";
+static CONST86 Tcl_ObjType *Tcl_ObjType_String;
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
+#define IS_TCL_BYTEARRAY(obj) ((obj)->typePtr == Tcl_ObjType_ByteArray)
+#define IS_TCL_STRING(obj) ((obj)->typePtr == Tcl_ObjType_String)
+#define IS_TCL_VALID_STRING(obj) ((obj)->bytes != (char*)NULL)
+#endif
+#endif
+
+#ifndef HAVE_RB_HASH_LOOKUP
+#define rb_hash_lookup rb_hash_aref
+#endif
+
+#ifndef HAVE_RB_THREAD_ALIVE_P
+#define rb_thread_alive_p(thread) rb_funcall2((thread), ID_alive_p, 0, NULL)
+#endif
+
+/* safe Tcl_Eval and Tcl_GlobalEval */
+static int
+#ifdef HAVE_PROTOTYPES
+tcl_eval(Tcl_Interp *interp, const char *cmd)
+#else
+tcl_eval(interp, cmd)
+ Tcl_Interp *interp;
+ const char *cmd; /* don't have to be writable */
+#endif
+{
+ char *buf = strdup(cmd);
+ int ret;
+
+ Tcl_AllowExceptions(interp);
+ ret = Tcl_Eval(interp, buf);
+ free(buf);
+ return ret;
+}
+
+#undef Tcl_Eval
+#define Tcl_Eval tcl_eval
+
+static int
+#ifdef HAVE_PROTOTYPES
+tcl_global_eval(Tcl_Interp *interp, const char *cmd)
+#else
+tcl_global_eval(interp, cmd)
+ Tcl_Interp *interp;
+ const char *cmd; /* don't have to be writable */
+#endif
+{
+ char *buf = strdup(cmd);
+ int ret;
+
+ Tcl_AllowExceptions(interp);
+ ret = Tcl_GlobalEval(interp, buf);
+ free(buf);
+ return ret;
+}
+
+#undef Tcl_GlobalEval
+#define Tcl_GlobalEval tcl_global_eval
+
+/* Tcl_{Incr|Decr}RefCount for tcl7.x or earlier */
+#if TCL_MAJOR_VERSION < 8
+#define Tcl_IncrRefCount(obj) (1)
+#define Tcl_DecrRefCount(obj) (1)
+#endif
+
+/* Tcl_GetStringResult for tcl7.x or earlier */
+#if TCL_MAJOR_VERSION < 8
+#define Tcl_GetStringResult(interp) ((interp)->result)
+#endif
+
+/* Tcl_[GS]etVar2Ex for tcl8.0 */
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+static Tcl_Obj *
+Tcl_GetVar2Ex(interp, name1, name2, flags)
+ Tcl_Interp *interp;
+ CONST char *name1;
+ CONST char *name2;
+ int flags;
+{
+ Tcl_Obj *nameObj1, *nameObj2 = NULL, *retObj;
+
+ nameObj1 = Tcl_NewStringObj((char*)name1, -1);
+ Tcl_IncrRefCount(nameObj1);
+
+ if (name2) {
+ nameObj2 = Tcl_NewStringObj((char*)name2, -1);
+ Tcl_IncrRefCount(nameObj2);
+ }
+
+ retObj = Tcl_ObjGetVar2(interp, nameObj1, nameObj2, flags);
+
+ if (name2) {
+ Tcl_DecrRefCount(nameObj2);
+ }
+
+ Tcl_DecrRefCount(nameObj1);
+
+ return retObj;
+}
+
+static Tcl_Obj *
+Tcl_SetVar2Ex(interp, name1, name2, newValObj, flags)
+ Tcl_Interp *interp;
+ CONST char *name1;
+ CONST char *name2;
+ Tcl_Obj *newValObj;
+ int flags;
+{
+ Tcl_Obj *nameObj1, *nameObj2 = NULL, *retObj;
+
+ nameObj1 = Tcl_NewStringObj((char*)name1, -1);
+ Tcl_IncrRefCount(nameObj1);
+
+ if (name2) {
+ nameObj2 = Tcl_NewStringObj((char*)name2, -1);
+ Tcl_IncrRefCount(nameObj2);
+ }
+
+ retObj = Tcl_ObjSetVar2(interp, nameObj1, nameObj2, newValObj, flags);
+
+ if (name2) {
+ Tcl_DecrRefCount(nameObj2);
+ }
+
+ Tcl_DecrRefCount(nameObj1);
+
+ return retObj;
+}
+#endif
+
+/* from tkAppInit.c */
+
+#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 4)
+# if !defined __MINGW32__ && !defined __BORLANDC__
+/*
+ * The following variable is a special hack that is needed in order for
+ * Sun shared libraries to be used for Tcl.
+ */
+
+extern int matherr();
+int *tclDummyMathPtr = (int *) matherr;
+# endif
+#endif
+
+/*---- module TclTkLib ----*/
+
+struct invoke_queue {
+ Tcl_Event ev;
+ int argc;
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **argv;
+#else /* TCL_MAJOR_VERSION < 8 */
+ char **argv;
+#endif
+ VALUE interp;
+ int *done;
+ int safe_level;
+ VALUE result;
+ VALUE thread;
+};
+
+struct eval_queue {
+ Tcl_Event ev;
+ char *str;
+ int len;
+ VALUE interp;
+ int *done;
+ int safe_level;
+ VALUE result;
+ VALUE thread;
+};
+
+struct call_queue {
+ Tcl_Event ev;
+ VALUE (*func)();
+ int argc;
+ VALUE *argv;
+ VALUE interp;
+ int *done;
+ int safe_level;
+ VALUE result;
+ VALUE thread;
+};
+
+void
+invoke_queue_mark(struct invoke_queue *q)
+{
+ rb_gc_mark(q->interp);
+ rb_gc_mark(q->result);
+ rb_gc_mark(q->thread);
+}
+
+void
+eval_queue_mark(struct eval_queue *q)
+{
+ rb_gc_mark(q->interp);
+ rb_gc_mark(q->result);
+ rb_gc_mark(q->thread);
+}
+
+void
+call_queue_mark(struct call_queue *q)
+{
+ int i;
+
+ for(i = 0; i < q->argc; i++) {
+ rb_gc_mark(q->argv[i]);
+ }
+
+ rb_gc_mark(q->interp);
+ rb_gc_mark(q->result);
+ rb_gc_mark(q->thread);
+}
+
+
+static VALUE eventloop_thread;
+static Tcl_Interp *eventloop_interp;
+#ifdef RUBY_USE_NATIVE_THREAD
+Tcl_ThreadId tk_eventloop_thread_id; /* native thread ID of Tcl interpreter */
+#endif
+static VALUE eventloop_stack;
+static int window_event_mode = ~0;
+
+static VALUE watchdog_thread;
+
+Tcl_Interp *current_interp;
+
+/* thread control strategy */
+/* multi-tk works with the following settings only ???
+ : CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1
+ : USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0
+ : DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 0
+*/
+#ifdef RUBY_USE_NATIVE_THREAD
+#define CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1
+#define USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0
+#define DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 1
+#else /* ! RUBY_USE_NATIVE_THREAD */
+#define CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1
+#define USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0
+#define DO_THREAD_SCHEDULE_AT_CALLBACK_DONE 0
+#endif
+
+#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
+static int have_rb_thread_waiting_for_value = 0;
+#endif
+
+/*
+ * 'event_loop_max' is a maximum events which the eventloop processes in one
+ * term of thread scheduling. 'no_event_tick' is the count-up value when
+ * there are no event for processing.
+ * 'timer_tick' is a limit of one term of thread scheduling.
+ * If 'timer_tick' == 0, then not use the timer for thread scheduling.
+ */
+#ifdef RUBY_USE_NATIVE_THREAD
+#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
+#define DEFAULT_NO_EVENT_TICK 10/*counts*/
+#define DEFAULT_NO_EVENT_WAIT 5/*milliseconds ( 1 -- 999 ) */
+#define WATCHDOG_INTERVAL 10/*milliseconds ( 1 -- 999 ) */
+#define DEFAULT_TIMER_TICK 0/*milliseconds ( 0 -- 999 ) */
+#define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */
+#else /* ! RUBY_USE_NATIVE_THREAD */
+#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
+#define DEFAULT_NO_EVENT_TICK 10/*counts*/
+#define DEFAULT_NO_EVENT_WAIT 20/*milliseconds ( 1 -- 999 ) */
+#define WATCHDOG_INTERVAL 10/*milliseconds ( 1 -- 999 ) */
+#define DEFAULT_TIMER_TICK 0/*milliseconds ( 0 -- 999 ) */
+#define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */
+#endif
+
+#define EVENT_HANDLER_TIMEOUT 100/*milliseconds*/
+
+static int event_loop_max = DEFAULT_EVENT_LOOP_MAX;
+static int no_event_tick = DEFAULT_NO_EVENT_TICK;
+static int no_event_wait = DEFAULT_NO_EVENT_WAIT;
+static int timer_tick = DEFAULT_TIMER_TICK;
+static int req_timer_tick = DEFAULT_TIMER_TICK;
+static int run_timer_flag = 0;
+
+static int event_loop_wait_event = 0;
+static int event_loop_abort_on_exc = 1;
+static int loop_counter = 0;
+
+static int check_rootwidget_flag = 0;
+
+
+/* call ruby interpreter */
+#if TCL_MAJOR_VERSION >= 8
+static int ip_ruby_eval _((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*));
+static int ip_ruby_cmd _((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST*));
+#else /* TCL_MAJOR_VERSION < 8 */
+static int ip_ruby_eval _((ClientData, Tcl_Interp *, int, char **));
+static int ip_ruby_cmd _((ClientData, Tcl_Interp *, int, char **));
+#endif
+
+struct cmd_body_arg {
+ VALUE receiver;
+ ID method;
+ VALUE args;
+};
+
+/*----------------------------*/
+/* use Tcl internal functions */
+/*----------------------------*/
+#ifndef TCL_NAMESPACE_DEBUG
+#define TCL_NAMESPACE_DEBUG 0
+#endif
+
+#if TCL_NAMESPACE_DEBUG
+
+#if TCL_MAJOR_VERSION >= 8
+EXTERN struct TclIntStubs *tclIntStubsPtr;
+#endif
+
+/*-- Tcl_GetCurrentNamespace --*/
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5
+/* Tcl7.x doesn't have namespace support. */
+/* Tcl8.5+ has definition of Tcl_GetCurrentNamespace() in tclDecls.h */
+# ifndef Tcl_GetCurrentNamespace
+EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace _((Tcl_Interp *));
+# endif
+# if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
+# ifndef Tcl_GetCurrentNamespace
+# ifndef FunctionNum_of_GetCurrentNamespace
+#define FunctionNum_of_GetCurrentNamespace 124
+# endif
+struct DummyTclIntStubs_for_GetCurrentNamespace {
+ int magic;
+ struct TclIntStubHooks *hooks;
+ void (*func[FunctionNum_of_GetCurrentNamespace])();
+ Tcl_Namespace * (*tcl_GetCurrentNamespace) _((Tcl_Interp *));
+};
+
+#define Tcl_GetCurrentNamespace \
+ (((struct DummyTclIntStubs_for_GetCurrentNamespace *)tclIntStubsPtr)->tcl_GetCurrentNamespace)
+# endif
+# endif
+#endif
+
+/* namespace check */
+/* ip_null_namespace(Tcl_Interp *interp) */
+#if TCL_MAJOR_VERSION < 8
+#define ip_null_namespace(interp) (0)
+#else /* support namespace */
+#define ip_null_namespace(interp) \
+ (Tcl_GetCurrentNamespace(interp) == (Tcl_Namespace *)NULL)
+#endif
+
+/* rbtk_invalid_namespace(tcltkip *ptr) */
+#if TCL_MAJOR_VERSION < 8
+#define rbtk_invalid_namespace(ptr) (0)
+#else /* support namespace */
+#define rbtk_invalid_namespace(ptr) \
+ ((ptr)->default_ns == (Tcl_Namespace*)NULL || Tcl_GetCurrentNamespace((ptr)->ip) != (ptr)->default_ns)
+#endif
+
+/*-- Tcl_PopCallFrame & Tcl_PushCallFrame --*/
+#if TCL_MAJOR_VERSION >= 8
+# ifndef CallFrame
+typedef struct CallFrame {
+ Tcl_Namespace *nsPtr;
+ int dummy1;
+ int dummy2;
+ char *dummy3;
+ struct CallFrame *callerPtr;
+ struct CallFrame *callerVarPtr;
+ int level;
+ char *dummy7;
+ char *dummy8;
+ int dummy9;
+ char* dummy10;
+} CallFrame;
+# endif
+
+# if !defined(TclGetFrame) && !defined(TclGetFrame_TCL_DECLARED)
+EXTERN int TclGetFrame _((Tcl_Interp *, CONST char *, CallFrame **));
+# endif
+# if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
+# ifndef TclGetFrame
+# ifndef FunctionNum_of_GetFrame
+#define FunctionNum_of_GetFrame 32
+# endif
+struct DummyTclIntStubs_for_GetFrame {
+ int magic;
+ struct TclIntStubHooks *hooks;
+ void (*func[FunctionNum_of_GetFrame])();
+ int (*tclGetFrame) _((Tcl_Interp *, CONST char *, CallFrame **));
+};
+#define TclGetFrame \
+ (((struct DummyTclIntStubs_for_GetFrame *)tclIntStubsPtr)->tclGetFrame)
+# endif
+# endif
+
+# if !defined(Tcl_PopCallFrame) && !defined(Tcl_PopCallFrame_TCL_DECLARED)
+EXTERN void Tcl_PopCallFrame _((Tcl_Interp *));
+EXTERN int Tcl_PushCallFrame _((Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int));
+# endif
+# if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
+# ifndef Tcl_PopCallFrame
+# ifndef FunctionNum_of_PopCallFrame
+#define FunctionNum_of_PopCallFrame 128
+# endif
+struct DummyTclIntStubs_for_PopCallFrame {
+ int magic;
+ struct TclIntStubHooks *hooks;
+ void (*func[FunctionNum_of_PopCallFrame])();
+ void (*tcl_PopCallFrame) _((Tcl_Interp *));
+ int (*tcl_PushCallFrame) _((Tcl_Interp *, Tcl_CallFrame *, Tcl_Namespace *, int));
+};
+
+#define Tcl_PopCallFrame \
+ (((struct DummyTclIntStubs_for_PopCallFrame *)tclIntStubsPtr)->tcl_PopCallFrame)
+#define Tcl_PushCallFrame \
+ (((struct DummyTclIntStubs_for_PopCallFrame *)tclIntStubsPtr)->tcl_PushCallFrame)
+# endif
+# endif
+
+#else /* Tcl7.x */
+# ifndef CallFrame
+typedef struct CallFrame {
+ Tcl_HashTable varTable;
+ int level;
+ int argc;
+ char **argv;
+ struct CallFrame *callerPtr;
+ struct CallFrame *callerVarPtr;
+} CallFrame;
+# endif
+# ifndef Tcl_CallFrame
+#define Tcl_CallFrame CallFrame
+# endif
+
+# if !defined(TclGetFrame) && !defined(TclGetFrame_TCL_DECLARED)
+EXTERN int TclGetFrame _((Tcl_Interp *, CONST char *, CallFrame **));
+# endif
+
+# if !defined(Tcl_PopCallFrame) && !defined(Tcl_PopCallFrame_TCL_DECLARED)
+typedef struct DummyInterp {
+ char *dummy1;
+ char *dummy2;
+ int dummy3;
+ Tcl_HashTable dummy4;
+ Tcl_HashTable dummy5;
+ Tcl_HashTable dummy6;
+ int numLevels;
+ int maxNestingDepth;
+ CallFrame *framePtr;
+ CallFrame *varFramePtr;
+} DummyInterp;
+
+static void
+Tcl_PopCallFrame(interp)
+ Tcl_Interp *interp;
+{
+ DummyInterp *iPtr = (DummyInterp*)interp;
+ CallFrame *frame = iPtr->varFramePtr;
+
+ /* **** DUMMY **** */
+ iPtr->framePtr = frame.callerPtr;
+ iPtr->varFramePtr = frame.callerVarPtr;
+
+ return TCL_OK;
+}
+
+/* dummy */
+#define Tcl_Namespace char
+
+static int
+Tcl_PushCallFrame(interp, framePtr, nsPtr, isProcCallFrame)
+ Tcl_Interp *interp;
+ Tcl_CallFrame *framePtr;
+ Tcl_Namespace *nsPtr;
+ int isProcCallFrame;
+{
+ DummyInterp *iPtr = (DummyInterp*)interp;
+ CallFrame *frame = (CallFrame *)framePtr;
+
+ /* **** DUMMY **** */
+ Tcl_InitHashTable(&frame.varTable, TCL_STRING_KEYS);
+ if (iPtr->varFramePtr != NULL) {
+ frame.level = iPtr->varFramePtr->level + 1;
+ } else {
+ frame.level = 1;
+ }
+ frame.callerPtr = iPtr->framePtr;
+ frame.callerVarPtr = iPtr->varFramePtr;
+ iPtr->framePtr = &frame;
+ iPtr->varFramePtr = &frame;
+
+ return TCL_OK;
+}
+# endif
+
+#endif
+
+#endif /* TCL_NAMESPACE_DEBUG */
+
+
+/*---- class TclTkIp ----*/
+struct tcltkip {
+ Tcl_Interp *ip; /* the interpreter */
+#if TCL_NAMESPACE_DEBUG
+ Tcl_Namespace *default_ns; /* default namespace */
+#endif
+#ifdef RUBY_USE_NATIVE_THREAD
+ Tcl_ThreadId tk_thread_id; /* native thread ID of Tcl interpreter */
+#endif
+ int has_orig_exit; /* has original 'exit' command ? */
+ Tcl_CmdInfo orig_exit_info; /* command info of original 'exit' command */
+ int ref_count; /* reference count of rbtk_preserve_ip call */
+ int allow_ruby_exit; /* allow exiting ruby by 'exit' function */
+ int return_value; /* return value */
+};
+
+static struct tcltkip *
+get_ip(self)
+ VALUE self;
+{
+ struct tcltkip *ptr;
+
+ Data_Get_Struct(self, struct tcltkip, ptr);
+ if (ptr == 0) {
+ /* rb_raise(rb_eTypeError, "uninitialized TclTkIp"); */
+ return((struct tcltkip *)NULL);
+ }
+ if (ptr->ip == (Tcl_Interp*)NULL) {
+ /* rb_raise(rb_eRuntimeError, "deleted IP"); */
+ return((struct tcltkip *)NULL);
+ }
+ return ptr;
+}
+
+static int
+deleted_ip(ptr)
+ struct tcltkip *ptr;
+{
+ if (!ptr || !ptr->ip || Tcl_InterpDeleted(ptr->ip)
+#if TCL_NAMESPACE_DEBUG
+ || rbtk_invalid_namespace(ptr)
+#endif
+ ) {
+ DUMP1("ip is deleted");
+ return 1;
+ }
+ return 0;
+}
+
+/* increment/decrement reference count of tcltkip */
+static int
+rbtk_preserve_ip(ptr)
+ struct tcltkip *ptr;
+{
+ ptr->ref_count++;
+ if (ptr->ip == (Tcl_Interp*)NULL) {
+ /* deleted IP */
+ ptr->ref_count = 0;
+ } else {
+ Tcl_Preserve((ClientData)ptr->ip);
+ }
+ return(ptr->ref_count);
+}
+
+static int
+rbtk_release_ip(ptr)
+ struct tcltkip *ptr;
+{
+ ptr->ref_count--;
+ if (ptr->ref_count < 0) {
+ ptr->ref_count = 0;
+ } else if (ptr->ip == (Tcl_Interp*)NULL) {
+ /* deleted IP */
+ ptr->ref_count = 0;
+ } else {
+ Tcl_Release((ClientData)ptr->ip);
+ }
+ return(ptr->ref_count);
+}
+
+
+static VALUE
+#ifdef HAVE_STDARG_PROTOTYPES
+create_ip_exc(VALUE interp, VALUE exc, const char *fmt, ...)
+#else
+create_ip_exc(interp, exc, fmt, va_alist)
+ VALUE interp:
+ VALUE exc;
+ const char *fmt;
+ va_dcl
+#endif
+{
+ va_list args;
+ VALUE msg;
+ VALUE einfo;
+ struct tcltkip *ptr = get_ip(interp);
+
+ va_init_list(args,fmt);
+ msg = rb_vsprintf(fmt, args);
+ va_end(args);
+ einfo = rb_exc_new_str(exc, msg);
+ rb_ivar_set(einfo, ID_at_interp, interp);
+ if (ptr) {
+ Tcl_ResetResult(ptr->ip);
+ }
+
+ return einfo;
+}
+
+
+/*####################################################################*/
+#if defined CREATE_RUBYTK_KIT || defined CREATE_RUBYKIT
+
+/*--------------------------------------------------------*/
+
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 84
+#error Ruby/Tk-Kit requires Tcl/Tk8.4 or later.
+#endif
+
+/*--------------------------------------------------------*/
+
+/* Many part of code to support Ruby/Tk-Kit is quoted from Tclkit. */
+/* But, never ask Tclkit community about Ruby/Tk-Kit. */
+/* Please ask Ruby (Ruby/Tk) community (e.g. "ruby-dev" mailing list). */
+/*
+----<< license terms of TclKit (from kitgen's "README" file) >>---------------
+The Tclkit-specific sources are license free, they just have a copyright. Hold
+the author(s) harmless and any lawful use is permitted.
+
+This does *not* apply to any of the sources of the other major Open Source
+Software used in Tclkit, which each have very liberal BSD/MIT-like licenses:
+
+ * Tcl/Tk, TclVFS, Thread, Vlerq, Zlib
+------------------------------------------------------------------------------
+ */
+/* Tcl/Tk stubs may work, but probably it is meaningless. */
+#if defined USE_TCL_STUBS || defined USE_TK_STUBS
+# error Not support Tcl/Tk stubs with Ruby/Tk-Kit or Rubykit.
+#endif
+
+#ifndef KIT_INCLUDES_ZLIB
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
+#define KIT_INCLUDES_ZLIB 1
+#else
+#define KIT_INCLUDES_ZLIB 0
+#endif
+#endif
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
+EXTERN Tcl_Obj* TclGetStartupScriptPath();
+EXTERN void TclSetStartupScriptPath _((Tcl_Obj*));
+#define Tcl_GetStartupScript(encPtr) TclGetStartupScriptPath()
+#define Tcl_SetStartupScript(path,enc) TclSetStartupScriptPath(path)
+#endif
+#if !defined(TclSetPreInitScript) && !defined(TclSetPreInitScript_TCL_DECLARED)
+EXTERN char* TclSetPreInitScript _((char *));
+#endif
+
+#ifndef KIT_INCLUDES_TK
+# define KIT_INCLUDES_TK 1
+#endif
+/* #define KIT_INCLUDES_ITCL 1 */
+/* #define KIT_INCLUDES_THREAD 1 */
+
+Tcl_AppInitProc Vfs_Init, Rechan_Init;
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
+Tcl_AppInitProc Pwb_Init;
+#endif
+
+#ifdef KIT_LITE
+Tcl_AppInitProc Vlerq_Init, Vlerq_SafeInit;
+#else
+Tcl_AppInitProc Mk4tcl_Init;
+#endif
+
+#if defined TCL_THREADS && defined KIT_INCLUDES_THREAD
+Tcl_AppInitProc Thread_Init;
+#endif
+
+#if KIT_INCLUDES_ZLIB
+Tcl_AppInitProc Zlib_Init;
+#endif
+
+#ifdef KIT_INCLUDES_ITCL
+Tcl_AppInitProc Itcl_Init;
+#endif
+
+#ifdef _WIN32
+Tcl_AppInitProc Dde_Init, Dde_SafeInit, Registry_Init;
+#endif
+
+/*--------------------------------------------------------*/
+
+#define RUBYTK_KITPATH_CONST_NAME "RUBYTK_KITPATH"
+
+static char *rubytk_kitpath = NULL;
+
+static char rubytkkit_preInitCmd[] =
+"proc tclKitPreInit {} {\n"
+ "rename tclKitPreInit {}\n"
+ "load {} rubytk_kitpath\n"
+#if KIT_INCLUDES_ZLIB
+ "catch {load {} zlib}\n"
+#endif
+#ifdef KIT_LITE
+ "load {} vlerq\n"
+ "namespace eval ::vlerq {}\n"
+ "if {[catch { vlerq open $::tcl::kitpath } ::vlerq::starkit_root]} {\n"
+ "set n -1\n"
+ "} else {\n"
+ "set files [vlerq get $::vlerq::starkit_root 0 dirs 0 files]\n"
+ "set n [lsearch [vlerq get $files * name] boot.tcl]\n"
+ "}\n"
+ "if {$n >= 0} {\n"
+ "array set a [vlerq get $files $n]\n"
+#else
+ "load {} Mk4tcl\n"
+#if defined KIT_VFS_WRITABLE && !defined CREATE_RUBYKIT
+ /* running command cannot open itself for writing */
+ "mk::file open exe $::tcl::kitpath\n"
+#else
+ "mk::file open exe $::tcl::kitpath -readonly\n"
+#endif
+ "set n [mk::select exe.dirs!0.files name boot.tcl]\n"
+ "if {[llength $n] == 1} {\n"
+ "array set a [mk::get exe.dirs!0.files!$n]\n"
+#endif
+ "if {![info exists a(contents)]} { error {no boot.tcl file} }\n"
+ "if {$a(size) != [string length $a(contents)]} {\n"
+ "set a(contents) [zlib decompress $a(contents)]\n"
+ "}\n"
+ "if {$a(contents) eq \"\"} { error {empty boot.tcl} }\n"
+ "uplevel #0 $a(contents)\n"
+#if 0
+ "} elseif {[lindex $::argv 0] eq \"-init-\"} {\n"
+ "uplevel #0 { source [lindex $::argv 1] }\n"
+ "exit\n"
+#endif
+ "} else {\n"
+ /* When cannot find VFS data, try to use a real directory */
+ "set vfsdir \"[file rootname $::tcl::kitpath].vfs\"\n"
+ "if {[file isdirectory $vfsdir]} {\n"
+ "set ::tcl_library [file join $vfsdir lib tcl$::tcl_version]\n"
+ "set ::tcl_libPath [list $::tcl_library [file join $vfsdir lib]]\n"
+ "catch {uplevel #0 [list source [file join $vfsdir config.tcl]]}\n"
+ "uplevel #0 [list source [file join $::tcl_library init.tcl]]\n"
+ "set ::auto_path $::tcl_libPath\n"
+ "} else {\n"
+ "error \"\n $::tcl::kitpath has no VFS data to start up\"\n"
+ "}\n"
+ "}\n"
+"}\n"
+"tclKitPreInit"
+;
+
+#if 0
+/* Not use this script.
+ It's a memo to support an initScript for Tcl interpreters in the future. */
+static const char initScript[] =
+"if {[file isfile [file join $::tcl::kitpath main.tcl]]} {\n"
+ "if {[info commands console] != {}} { console hide }\n"
+ "set tcl_interactive 0\n"
+ "incr argc\n"
+ "set argv [linsert $argv 0 $argv0]\n"
+ "set argv0 [file join $::tcl::kitpath main.tcl]\n"
+"} else continue\n"
+;
+#endif
+
+/*--------------------------------------------------------*/
+
+static char*
+set_rubytk_kitpath(const char *kitpath)
+{
+ if (kitpath) {
+ int len = (int)strlen(kitpath);
+ if (rubytk_kitpath) {
+ ckfree(rubytk_kitpath);
+ }
+
+ rubytk_kitpath = (char *)ckalloc(len + 1);
+ memcpy(rubytk_kitpath, kitpath, len);
+ rubytk_kitpath[len] = '\0';
+ }
+ return rubytk_kitpath;
+}
+
+/*--------------------------------------------------------*/
+
+#ifdef WIN32
+#define DEV_NULL "NUL"
+#else
+#define DEV_NULL "/dev/null"
+#endif
+
+static void
+check_tclkit_std_channels()
+{
+ Tcl_Channel chan;
+
+ /*
+ * We need to verify if we have the standard channels and create them if
+ * not. Otherwise internals channels may get used as standard channels
+ * (like for encodings) and panic.
+ */
+ chan = Tcl_GetStdChannel(TCL_STDIN);
+ if (chan == NULL) {
+ chan = Tcl_OpenFileChannel(NULL, DEV_NULL, "r", 0);
+ if (chan != NULL) {
+ Tcl_SetChannelOption(NULL, chan, "-encoding", "utf-8");
+ }
+ Tcl_SetStdChannel(chan, TCL_STDIN);
+ }
+ chan = Tcl_GetStdChannel(TCL_STDOUT);
+ if (chan == NULL) {
+ chan = Tcl_OpenFileChannel(NULL, DEV_NULL, "w", 0);
+ if (chan != NULL) {
+ Tcl_SetChannelOption(NULL, chan, "-encoding", "utf-8");
+ }
+ Tcl_SetStdChannel(chan, TCL_STDOUT);
+ }
+ chan = Tcl_GetStdChannel(TCL_STDERR);
+ if (chan == NULL) {
+ chan = Tcl_OpenFileChannel(NULL, DEV_NULL, "w", 0);
+ if (chan != NULL) {
+ Tcl_SetChannelOption(NULL, chan, "-encoding", "utf-8");
+ }
+ Tcl_SetStdChannel(chan, TCL_STDERR);
+ }
+}
+
+/*--------------------------------------------------------*/
+
+static int
+rubytk_kitpathObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
+{
+ const char* str;
+ if (objc == 2) {
+ set_rubytk_kitpath(Tcl_GetString(objv[1]));
+ } else if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?path?");
+ }
+ str = rubytk_kitpath ? rubytk_kitpath : Tcl_GetNameOfExecutable();
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(str, -1));
+ return TCL_OK;
+}
+
+/*
+ * Public entry point for ::tcl::kitpath.
+ * Creates both link variable name and Tcl command ::tcl::kitpath.
+ */
+static int
+rubytk_kitpath_init(Tcl_Interp *interp)
+{
+ Tcl_CreateObjCommand(interp, "::tcl::kitpath", rubytk_kitpathObjCmd, 0, 0);
+ if (Tcl_LinkVar(interp, "::tcl::kitpath", (char *) &rubytk_kitpath,
+ TCL_LINK_STRING | TCL_LINK_READ_ONLY) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+
+ Tcl_CreateObjCommand(interp, "::tcl::rubytk_kitpath", rubytk_kitpathObjCmd, 0, 0);
+ if (Tcl_LinkVar(interp, "::tcl::rubytk_kitpath", (char *) &rubytk_kitpath,
+ TCL_LINK_STRING | TCL_LINK_READ_ONLY) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+
+ if (rubytk_kitpath == NULL) {
+ /*
+ * XXX: We may want to avoid doing this to allow tcl::kitpath calls
+ * XXX: to obtain changes in nameofexe, if they occur.
+ */
+ set_rubytk_kitpath(Tcl_GetNameOfExecutable());
+ }
+
+ return Tcl_PkgProvide(interp, "rubytk_kitpath", "1.0");
+}
+
+/*--------------------------------------------------------*/
+
+static void
+init_static_tcltk_packages()
+{
+ /*
+ * Ensure that std channels exist (creating them if necessary)
+ */
+ check_tclkit_std_channels();
+
+#ifdef KIT_INCLUDES_ITCL
+ Tcl_StaticPackage(0, "Itcl", Itcl_Init, NULL);
+#endif
+#ifdef KIT_LITE
+ Tcl_StaticPackage(0, "Vlerq", Vlerq_Init, Vlerq_SafeInit);
+#else
+ Tcl_StaticPackage(0, "Mk4tcl", Mk4tcl_Init, NULL);
+#endif
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 85
+ Tcl_StaticPackage(0, "pwb", Pwb_Init, NULL);
+#endif
+ Tcl_StaticPackage(0, "rubytk_kitpath", rubytk_kitpath_init, NULL);
+ Tcl_StaticPackage(0, "rechan", Rechan_Init, NULL);
+ Tcl_StaticPackage(0, "vfs", Vfs_Init, NULL);
+#if KIT_INCLUDES_ZLIB
+ Tcl_StaticPackage(0, "zlib", Zlib_Init, NULL);
+#endif
+#if defined TCL_THREADS && defined KIT_INCLUDES_THREAD
+ Tcl_StaticPackage(0, "Thread", Thread_Init, Thread_SafeInit);
+#endif
+#ifdef _WIN32
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION > 84
+ Tcl_StaticPackage(0, "dde", Dde_Init, Dde_SafeInit);
+#else
+ Tcl_StaticPackage(0, "dde", Dde_Init, NULL);
+#endif
+ Tcl_StaticPackage(0, "registry", Registry_Init, NULL);
+#endif
+#ifdef KIT_INCLUDES_TK
+ Tcl_StaticPackage(0, "Tk", Tk_Init, Tk_SafeInit);
+#endif
+}
+
+/*--------------------------------------------------------*/
+
+static int
+call_tclkit_init_script(Tcl_Interp *interp)
+{
+#if 0
+ /* Currently, do nothing in this function.
+ It's a memo (quoted from kitInit.c of Tclkit)
+ to support an initScript for Tcl interpreters in the future. */
+ if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) {
+ const char *encoding = NULL;
+ Tcl_Obj* path = Tcl_GetStartupScript(&encoding);
+ Tcl_SetStartupScript(Tcl_GetObjResult(interp), encoding);
+ if (path == NULL) {
+ Tcl_Eval(interp, "incr argc -1; set argv [lrange $argv 1 end]");
+ }
+ }
+#endif
+
+ return 1;
+}
+
+/*--------------------------------------------------------*/
+
+#ifdef __WIN32__
+/* #include <tkWinInt.h> *//* conflict definition of struct timezone */
+/* #include <tkIntPlatDecls.h> */
+/* #include <windows.h> */
+EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance);
+void rbtk_win32_SetHINSTANCE(const char *module_name)
+{
+ /* TCHAR szBuf[256]; */
+ HINSTANCE hInst;
+
+ /* hInst = GetModuleHandle(NULL); */
+ /* hInst = GetModuleHandle("tcltklib.so"); */
+ hInst = GetModuleHandle(module_name);
+ TkWinSetHINSTANCE(hInst);
+
+ /* GetModuleFileName(hInst, szBuf, sizeof(szBuf) / sizeof(TCHAR)); */
+ /* MessageBox(NULL, szBuf, TEXT("OK"), MB_OK); */
+}
+#endif
+
+/*--------------------------------------------------------*/
+
+static void
+setup_rubytkkit()
+{
+ init_static_tcltk_packages();
+
+ {
+ ID const_id;
+ const_id = rb_intern(RUBYTK_KITPATH_CONST_NAME);
+
+ if (rb_const_defined(rb_cObject, const_id)) {
+ volatile VALUE pathobj;
+ pathobj = rb_const_get(rb_cObject, const_id);
+
+ if (rb_obj_is_kind_of(pathobj, rb_cString)) {
+#ifdef HAVE_RUBY_ENCODING_H
+ pathobj = rb_str_export_to_enc(pathobj, rb_utf8_encoding());
+#endif
+ set_rubytk_kitpath(RSTRING_PTR(pathobj));
+ }
+ }
+ }
+
+#ifdef CREATE_RUBYTK_KIT
+ if (rubytk_kitpath == NULL) {
+#ifdef __WIN32__
+ /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */
+ {
+ volatile VALUE basename;
+ basename = rb_funcall(rb_cFile, rb_intern("basename"), 1,
+ rb_str_new2(rb_sourcefile()));
+ rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename));
+ }
+#endif
+ set_rubytk_kitpath(rb_sourcefile());
+ }
+#endif
+
+ if (rubytk_kitpath == NULL) {
+ set_rubytk_kitpath(Tcl_GetNameOfExecutable());
+ }
+
+ TclSetPreInitScript(rubytkkit_preInitCmd);
+}
+
+/*--------------------------------------------------------*/
+
+#endif /* defined CREATE_RUBYTK_KIT || defined CREATE_RUBYKIT */
+/*####################################################################*/
+
+
+/**********************************************************************/
+
+/* stub status */
+static void
+tcl_stubs_check()
+{
+ if (!tcl_stubs_init_p()) {
+ int st = ruby_tcl_stubs_init();
+ switch(st) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_TCL_DLL:
+ rb_raise(rb_eLoadError, "tcltklib: fail to open tcl_dll");
+ case NO_FindExecutable:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_FindExecutable");
+ case NO_CreateInterp:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_CreateInterp()");
+ case NO_DeleteInterp:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_DeleteInterp()");
+ case FAIL_CreateInterp:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to create a new IP to call Tcl_InitStubs()");
+ case FAIL_Tcl_InitStubs:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to Tcl_InitStubs()");
+ default:
+ rb_raise(rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tcl_stubs_init()", st);
+ }
+ }
+}
+
+
+static VALUE
+tcltkip_init_tk(interp)
+ VALUE interp;
+{
+ struct tcltkip *ptr = get_ip(interp);
+
+#if TCL_MAJOR_VERSION >= 8
+ int st;
+
+ if (Tcl_IsSafe(ptr->ip)) {
+ DUMP1("Tk_SafeInit");
+ st = ruby_tk_stubs_safeinit(ptr->ip);
+ switch(st) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_Tk_Init:
+ return rb_exc_new2(rb_eLoadError,
+ "tcltklib: can't find Tk_SafeInit()");
+ case FAIL_Tk_Init:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: fail to Tk_SafeInit(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ case FAIL_Tk_InitStubs:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: fail to Tk_InitStubs(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ default:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: unknown error(%d) on ruby_tk_stubs_safeinit", st);
+ }
+ } else {
+ DUMP1("Tk_Init");
+ st = ruby_tk_stubs_init(ptr->ip);
+ switch(st) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_Tk_Init:
+ return rb_exc_new2(rb_eLoadError,
+ "tcltklib: can't find Tk_Init()");
+ case FAIL_Tk_Init:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: fail to Tk_Init(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ case FAIL_Tk_InitStubs:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: fail to Tk_InitStubs(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ default:
+ return create_ip_exc(interp, rb_eRuntimeError,
+ "tcltklib: unknown error(%d) on ruby_tk_stubs_init", st);
+ }
+ }
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tk_Init");
+ if (ruby_tk_stubs_init(ptr->ip) != TCLTK_STUBS_OK) {
+ return rb_exc_new2(rb_eRuntimeError, ptr->ip->result);
+ }
+#endif
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ ptr->tk_thread_id = Tcl_GetCurrentThread();
+#endif
+
+ return Qnil;
+}
+
+
+/* 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()
+{
+ volatile VALUE exc = rbtk_pending_exception;
+
+ if (!NIL_P(exc) && rb_obj_is_kind_of(exc, rb_eException)) {
+ DUMP1("find a pending exception");
+ if (rbtk_eventloop_depth > 0
+ || rbtk_internal_eventloop_handler > 0
+ ) {
+ return 1; /* pending */
+ } else {
+ rbtk_pending_exception = Qnil;
+
+ if (rb_obj_is_kind_of(exc, eTkCallbackRetry)) {
+ DUMP1("pending_exception_check0: call rb_jump_tag(retry)");
+ rb_jump_tag(TAG_RETRY);
+ } else if (rb_obj_is_kind_of(exc, eTkCallbackRedo)) {
+ DUMP1("pending_exception_check0: call rb_jump_tag(redo)");
+ rb_jump_tag(TAG_REDO);
+ } else if (rb_obj_is_kind_of(exc, eTkCallbackThrow)) {
+ DUMP1("pending_exception_check0: call rb_jump_tag(throw)");
+ rb_jump_tag(TAG_THROW);
+ }
+
+ rb_exc_raise(exc);
+ }
+ } else {
+ return 0;
+ }
+
+ UNREACHABLE;
+}
+
+static int
+pending_exception_check1(thr_crit_bup, ptr)
+ int thr_crit_bup;
+ struct tcltkip *ptr;
+{
+ volatile VALUE exc = rbtk_pending_exception;
+
+ if (!NIL_P(exc) && rb_obj_is_kind_of(exc, rb_eException)) {
+ DUMP1("find a pending exception");
+
+ if (rbtk_eventloop_depth > 0
+ || rbtk_internal_eventloop_handler > 0
+ ) {
+ return 1; /* pending */
+ } else {
+ rbtk_pending_exception = Qnil;
+
+ if (ptr != (struct tcltkip *)NULL) {
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (rb_obj_is_kind_of(exc, eTkCallbackRetry)) {
+ DUMP1("pending_exception_check1: call rb_jump_tag(retry)");
+ rb_jump_tag(TAG_RETRY);
+ } else if (rb_obj_is_kind_of(exc, eTkCallbackRedo)) {
+ DUMP1("pending_exception_check1: call rb_jump_tag(redo)");
+ rb_jump_tag(TAG_REDO);
+ } else if (rb_obj_is_kind_of(exc, eTkCallbackThrow)) {
+ DUMP1("pending_exception_check1: call rb_jump_tag(throw)");
+ rb_jump_tag(TAG_THROW);
+ }
+ rb_exc_raise(exc);
+ }
+ } else {
+ return 0;
+ }
+
+ UNREACHABLE;
+}
+
+
+/* call original 'exit' command */
+static void
+call_original_exit(ptr, state)
+ struct tcltkip *ptr;
+ int state;
+{
+ int thr_crit_bup;
+ Tcl_CmdInfo *info;
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj *cmd_obj;
+ Tcl_Obj *state_obj;
+#endif
+ DUMP1("original_exit is called");
+
+ if (!(ptr->has_orig_exit)) return;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_ResetResult(ptr->ip);
+
+ info = &(ptr->orig_exit_info);
+
+ /* memory allocation for arguments of this command */
+#if TCL_MAJOR_VERSION >= 8
+ state_obj = Tcl_NewIntObj(state);
+ Tcl_IncrRefCount(state_obj);
+
+ if (info->isNativeObjectProc) {
+ Tcl_Obj **argv;
+#define USE_RUBY_ALLOC 0
+#if USE_RUBY_ALLOC
+ argv = (Tcl_Obj **)ALLOC_N(Tcl_Obj *, 3);
+#else /* not USE_RUBY_ALLOC */
+ argv = RbTk_ALLOC_N(Tcl_Obj *, 3);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+#endif
+ cmd_obj = Tcl_NewStringObj("exit", 4);
+ Tcl_IncrRefCount(cmd_obj);
+
+ argv[0] = cmd_obj;
+ argv[1] = state_obj;
+ argv[2] = (Tcl_Obj *)NULL;
+
+ ptr->return_value
+ = (*(info->objProc))(info->objClientData, ptr->ip, 2, argv);
+
+ Tcl_DecrRefCount(cmd_obj);
+
+#if USE_RUBY_ALLOC
+ xfree(argv);
+#else /* not USE_RUBY_ALLOC */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+#endif
+#undef USE_RUBY_ALLOC
+
+ } else {
+ /* string interface */
+ CONST84 char **argv;
+#define USE_RUBY_ALLOC 0
+#if USE_RUBY_ALLOC
+ argv = ALLOC_N(char *, 3); /* XXXXXXXXXX */
+#else /* not USE_RUBY_ALLOC */
+ argv = RbTk_ALLOC_N(CONST84 char *, 3);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+#endif
+ argv[0] = (char *)"exit";
+ /* argv[1] = Tcl_GetString(state_obj); */
+ argv[1] = Tcl_GetStringFromObj(state_obj, (int*)NULL);
+ argv[2] = (char *)NULL;
+
+ ptr->return_value = (*(info->proc))(info->clientData, ptr->ip, 2, argv);
+
+#if USE_RUBY_ALLOC
+ xfree(argv);
+#else /* not USE_RUBY_ALLOC */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+#endif
+#undef USE_RUBY_ALLOC
+ }
+
+ Tcl_DecrRefCount(state_obj);
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ {
+ /* string interface */
+ char **argv;
+#define USE_RUBY_ALLOC 0
+#if USE_RUBY_ALLOC
+ argv = (char **)ALLOC_N(char *, 3);
+#else /* not USE_RUBY_ALLOC */
+ argv = RbTk_ALLOC_N(char *, 3);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+#endif
+ argv[0] = "exit";
+ argv[1] = RSTRING_PTR(rb_fix2str(INT2NUM(state), 10));
+ argv[2] = (char *)NULL;
+
+ ptr->return_value = (*(info->proc))(info->clientData, ptr->ip,
+ 2, argv);
+
+#if USE_RUBY_ALLOC
+ xfree(argv);
+#else /* not USE_RUBY_ALLOC */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree(argv);
+#endif
+#endif
+#endif
+#undef USE_RUBY_ALLOC
+ }
+#endif
+ DUMP1("complete original_exit");
+
+ rb_thread_critical = thr_crit_bup;
+}
+
+/* Tk_ThreadTimer */
+static Tcl_TimerToken timer_token = (Tcl_TimerToken)NULL;
+
+/* timer callback */
+static void _timer_for_tcl _((ClientData));
+static void
+_timer_for_tcl(clientData)
+ ClientData clientData;
+{
+ int thr_crit_bup;
+
+ /* struct invoke_queue *q, *tmp; */
+ /* VALUE thread; */
+
+ DUMP1("call _timer_for_tcl");
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_DeleteTimerHandler(timer_token);
+
+ run_timer_flag = 1;
+
+ if (timer_tick > 0) {
+ timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl,
+ (ClientData)0);
+ } else {
+ timer_token = (Tcl_TimerToken)NULL;
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* rb_thread_schedule(); */
+ /* tick_counter += event_loop_max; */
+}
+
+#ifdef RUBY_USE_NATIVE_THREAD
+#if USE_TOGGLE_WINDOW_MODE_FOR_IDLE
+static int
+toggle_eventloop_window_mode_for_idle()
+{
+ if (window_event_mode & TCL_IDLE_EVENTS) {
+ /* idle -> event */
+ window_event_mode |= TCL_WINDOW_EVENTS;
+ window_event_mode &= ~TCL_IDLE_EVENTS;
+ return 1;
+ } else {
+ /* event -> idle */
+ window_event_mode |= TCL_IDLE_EVENTS;
+ window_event_mode &= ~TCL_WINDOW_EVENTS;
+ return 0;
+ }
+}
+#endif
+#endif
+
+static VALUE
+set_eventloop_window_mode(self, mode)
+ VALUE self;
+ VALUE mode;
+{
+
+ if (RTEST(mode)) {
+ window_event_mode = ~0;
+ } else {
+ window_event_mode = ~TCL_WINDOW_EVENTS;
+ }
+
+ return mode;
+}
+
+static VALUE
+get_eventloop_window_mode(self)
+ VALUE self;
+{
+ if ( ~window_event_mode ) {
+ return Qfalse;
+ } else {
+ return Qtrue;
+ }
+}
+
+static VALUE
+set_eventloop_tick(self, tick)
+ VALUE self;
+ VALUE tick;
+{
+ int ttick = NUM2INT(tick);
+ int thr_crit_bup;
+
+
+ if (ttick < 0) {
+ rb_raise(rb_eArgError,
+ "timer-tick parameter must be 0 or positive number");
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* delete old timer callback */
+ Tcl_DeleteTimerHandler(timer_token);
+
+ timer_tick = req_timer_tick = ttick;
+ if (timer_tick > 0) {
+ /* start timer callback */
+ timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl,
+ (ClientData)0);
+ } else {
+ timer_token = (Tcl_TimerToken)NULL;
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ return tick;
+}
+
+static VALUE
+get_eventloop_tick(self)
+ VALUE self;
+{
+ return INT2NUM(timer_tick);
+}
+
+static VALUE
+ip_set_eventloop_tick(self, tick)
+ VALUE self;
+ VALUE tick;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return get_eventloop_tick(self);
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return get_eventloop_tick(self);
+ }
+ return set_eventloop_tick(self, tick);
+}
+
+static VALUE
+ip_get_eventloop_tick(self)
+ VALUE self;
+{
+ return get_eventloop_tick(self);
+}
+
+static VALUE
+set_no_event_wait(self, wait)
+ VALUE self;
+ VALUE wait;
+{
+ int t_wait = NUM2INT(wait);
+
+
+ if (t_wait <= 0) {
+ rb_raise(rb_eArgError,
+ "no_event_wait parameter must be positive number");
+ }
+
+ no_event_wait = t_wait;
+
+ return wait;
+}
+
+static VALUE
+get_no_event_wait(self)
+ VALUE self;
+{
+ return INT2NUM(no_event_wait);
+}
+
+static VALUE
+ip_set_no_event_wait(self, wait)
+ VALUE self;
+ VALUE wait;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return get_no_event_wait(self);
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return get_no_event_wait(self);
+ }
+ return set_no_event_wait(self, wait);
+}
+
+static VALUE
+ip_get_no_event_wait(self)
+ VALUE self;
+{
+ return get_no_event_wait(self);
+}
+
+static VALUE
+set_eventloop_weight(self, loop_max, no_event)
+ VALUE self;
+ VALUE loop_max;
+ VALUE no_event;
+{
+ int lpmax = NUM2INT(loop_max);
+ int no_ev = NUM2INT(no_event);
+
+
+ if (lpmax <= 0 || no_ev <= 0) {
+ rb_raise(rb_eArgError, "weight parameters must be positive numbers");
+ }
+
+ event_loop_max = lpmax;
+ no_event_tick = no_ev;
+
+ return rb_ary_new3(2, loop_max, no_event);
+}
+
+static VALUE
+get_eventloop_weight(self)
+ VALUE self;
+{
+ return rb_ary_new3(2, INT2NUM(event_loop_max), INT2NUM(no_event_tick));
+}
+
+static VALUE
+ip_set_eventloop_weight(self, loop_max, no_event)
+ VALUE self;
+ VALUE loop_max;
+ VALUE no_event;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return get_eventloop_weight(self);
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return get_eventloop_weight(self);
+ }
+ return set_eventloop_weight(self, loop_max, no_event);
+}
+
+static VALUE
+ip_get_eventloop_weight(self)
+ VALUE self;
+{
+ return get_eventloop_weight(self);
+}
+
+static VALUE
+set_max_block_time(self, time)
+ VALUE self;
+ VALUE time;
+{
+ struct Tcl_Time tcl_time;
+ VALUE divmod;
+
+ switch(TYPE(time)) {
+ case T_FIXNUM:
+ 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]);
+ 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);
+
+ default:
+ {
+ VALUE tmp = rb_funcall(time, ID_inspect, 0, 0);
+ rb_raise(rb_eArgError, "invalid value for time: '%s'",
+ StringValuePtr(tmp));
+ }
+ }
+
+ Tcl_SetMaxBlockTime(&tcl_time);
+
+ return Qnil;
+}
+
+static VALUE
+lib_evloop_thread_p(self)
+ VALUE self;
+{
+ if (NIL_P(eventloop_thread)) {
+ return Qnil; /* no eventloop */
+ } else if (rb_thread_current() == eventloop_thread) {
+ return Qtrue; /* is eventloop */
+ } else {
+ return Qfalse; /* not eventloop */
+ }
+}
+
+static VALUE
+lib_evloop_abort_on_exc(self)
+ VALUE self;
+{
+ if (event_loop_abort_on_exc > 0) {
+ return Qtrue;
+ } else if (event_loop_abort_on_exc == 0) {
+ return Qfalse;
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE
+ip_evloop_abort_on_exc(self)
+ VALUE self;
+{
+ return lib_evloop_abort_on_exc(self);
+}
+
+static VALUE
+lib_evloop_abort_on_exc_set(self, val)
+ VALUE self, val;
+{
+ if (RTEST(val)) {
+ event_loop_abort_on_exc = 1;
+ } else if (NIL_P(val)) {
+ event_loop_abort_on_exc = -1;
+ } else {
+ event_loop_abort_on_exc = 0;
+ }
+ return lib_evloop_abort_on_exc(self);
+}
+
+static VALUE
+ip_evloop_abort_on_exc_set(self, val)
+ VALUE self, val;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return lib_evloop_abort_on_exc(self);
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return lib_evloop_abort_on_exc(self);
+ }
+ return lib_evloop_abort_on_exc_set(self, val);
+}
+
+static VALUE
+lib_num_of_mainwindows_core(self, argc, argv)
+ VALUE self;
+ int argc; /* dummy */
+ VALUE *argv; /* dummy */
+{
+ if (tk_stubs_init_p()) {
+ return INT2FIX(Tk_GetNumMainWindows());
+ } else {
+ return INT2FIX(0);
+ }
+}
+
+static VALUE
+lib_num_of_mainwindows(self)
+ VALUE self;
+{
+#ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
+ return tk_funcall(lib_num_of_mainwindows_core, 0, (VALUE*)NULL, self);
+#else
+ return lib_num_of_mainwindows_core(self, 0, (VALUE*)NULL);
+#endif
+}
+
+void
+rbtk_EventSetupProc(ClientData clientData, int flag)
+{
+ Tcl_Time tcl_time;
+ tcl_time.sec = 0;
+ tcl_time.usec = 1000L * (long)no_event_tick;
+ Tcl_SetMaxBlockTime(&tcl_time);
+}
+
+void
+rbtk_EventCheckProc(ClientData clientData, int flag)
+{
+ rb_thread_schedule();
+}
+
+
+#ifdef RUBY_USE_NATIVE_THREAD /* Ruby 1.9+ !!! */
+static VALUE
+#ifdef HAVE_PROTOTYPES
+call_DoOneEvent_core(VALUE flag_val)
+#else
+call_DoOneEvent_core(flag_val)
+ VALUE flag_val;
+#endif
+{
+ int flag;
+
+ flag = FIX2INT(flag_val);
+ if (Tcl_DoOneEvent(flag)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+static VALUE
+#ifdef HAVE_PROTOTYPES
+call_DoOneEvent(VALUE flag_val)
+#else
+call_DoOneEvent(flag_val)
+ VALUE flag_val;
+#endif
+{
+ return tk_funcall(call_DoOneEvent_core, 0, (VALUE*)NULL, flag_val);
+}
+
+#else /* Ruby 1.8- */
+static VALUE
+#ifdef HAVE_PROTOTYPES
+call_DoOneEvent(VALUE flag_val)
+#else
+call_DoOneEvent(flag_val)
+ VALUE flag_val;
+#endif
+{
+ int flag;
+
+ flag = FIX2INT(flag_val);
+ if (Tcl_DoOneEvent(flag)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+#endif
+
+
+#if 0
+static VALUE
+#ifdef HAVE_PROTOTYPES
+eventloop_sleep(VALUE dummy)
+#else
+eventloop_sleep(dummy)
+ VALUE dummy;
+#endif
+{
+ struct timeval t;
+
+ if (no_event_wait <= 0) {
+ return Qnil;
+ }
+
+ t.tv_sec = 0;
+ t.tv_usec = (int)(no_event_wait*1000.0);
+
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on eventloop_sleep()");
+ }
+#endif
+#endif
+
+ DUMP2("eventloop_sleep: rb_thread_wait_for() at thread : %"PRIxVALUE, rb_thread_current());
+ rb_thread_wait_for(t);
+ DUMP2("eventloop_sleep: finish at thread : %"PRIxVALUE, rb_thread_current());
+
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on eventloop_sleep()");
+ }
+#endif
+#endif
+
+ return Qnil;
+}
+#endif
+
+#define USE_EVLOOP_THREAD_ALONE_CHECK_FLAG 0
+
+#if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG
+static int
+get_thread_alone_check_flag()
+{
+#ifdef RUBY_USE_NATIVE_THREAD
+ return 0;
+#else
+ set_tcltk_version();
+
+ if (tcltk_version.major < 8) {
+ /* Tcl/Tk 7.x */
+ return 1;
+ } else if (tcltk_version.major == 8) {
+ if (tcltk_version.minor < 5) {
+ /* Tcl/Tk 8.0 - 8.4 */
+ return 1;
+ } else if (tcltk_version.minor == 5) {
+ if (tcltk_version.type < TCL_FINAL_RELEASE) {
+ /* Tcl/Tk 8.5a? - 8.5b? */
+ return 1;
+ } else {
+ /* Tcl/Tk 8.5.x */
+ return 0;
+ }
+ } else {
+ /* Tcl/Tk 8.6 - 8.9 ?? */
+ return 0;
+ }
+ } else {
+ /* Tcl/Tk 9+ ?? */
+ return 0;
+ }
+#endif
+}
+#endif
+
+#define TRAP_CHECK() do { \
+ if (trap_check(check_var) == 0) return 0; \
+} while (0)
+
+static int
+trap_check(int *check_var)
+{
+ DUMP1("trap check");
+
+#ifdef RUBY_VM
+ if (rb_thread_check_trap_pending()) {
+ if (check_var != (int*)NULL) {
+ /* wait command */
+ return 0;
+ }
+ else {
+ rb_thread_check_ints();
+ }
+ }
+#else
+ if (rb_trap_pending) {
+ run_timer_flag = 0;
+ if (rb_prohibit_interrupt || check_var != (int*)NULL) {
+ /* pending or on wait command */
+ return 0;
+ } else {
+ rb_trap_exec();
+ }
+ }
+#endif
+
+ return 1;
+}
+
+static int
+check_eventloop_interp()
+{
+ DUMP1("check eventloop_interp");
+ if (eventloop_interp != (Tcl_Interp*)NULL
+ && Tcl_InterpDeleted(eventloop_interp)) {
+ DUMP2("eventloop_interp(%p) was deleted", eventloop_interp);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+lib_eventloop_core(check_root, update_flag, check_var, interp)
+ int check_root;
+ int update_flag;
+ int *check_var;
+ Tcl_Interp *interp;
+{
+ volatile VALUE current = eventloop_thread;
+ int found_event = 1;
+ int event_flag;
+#if 0
+ struct timeval t;
+#endif
+ int thr_crit_bup;
+ int status;
+ int depth = rbtk_eventloop_depth;
+#if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG
+ int thread_alone_check_flag = 1;
+#else
+ enum {thread_alone_check_flag = 1};
+#endif
+
+ if (update_flag) DUMP1("update loop start!!");
+
+#if 0
+ t.tv_sec = 0;
+ t.tv_usec = 1000 * no_event_wait;
+#endif
+
+ Tcl_DeleteTimerHandler(timer_token);
+ run_timer_flag = 0;
+ if (timer_tick > 0) {
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl,
+ (ClientData)0);
+ rb_thread_critical = thr_crit_bup;
+ } else {
+ timer_token = (Tcl_TimerToken)NULL;
+ }
+
+#if USE_EVLOOP_THREAD_ALONE_CHECK_FLAG
+ /* version check */
+ thread_alone_check_flag = get_thread_alone_check_flag();
+#endif
+
+ for(;;) {
+ if (check_eventloop_interp()) return 0;
+
+ if (thread_alone_check_flag && rb_thread_alone()) {
+ DUMP1("no other thread");
+ event_loop_wait_event = 0;
+
+ if (update_flag) {
+ event_flag = update_flag;
+ /* event_flag = update_flag | TCL_DONT_WAIT; */ /* for safety */
+ } else {
+ event_flag = TCL_ALL_EVENTS;
+ /* event_flag = TCL_ALL_EVENTS | TCL_DONT_WAIT; */
+ }
+
+ if (timer_tick == 0 && update_flag == 0) {
+ timer_tick = NO_THREAD_INTERRUPT_TIME;
+ timer_token = Tcl_CreateTimerHandler(timer_tick,
+ _timer_for_tcl,
+ (ClientData)0);
+ }
+
+ if (check_var != (int *)NULL) {
+ if (*check_var || !found_event) {
+ return found_event;
+ }
+ if (interp != (Tcl_Interp*)NULL
+ && Tcl_InterpDeleted(interp)) {
+ /* IP for check_var is deleted */
+ return 0;
+ }
+ }
+
+ /* found_event = Tcl_DoOneEvent(event_flag); */
+ found_event = RTEST(rb_protect(call_DoOneEvent,
+ INT2FIX(event_flag), &status));
+ if (status) {
+ switch (status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception
+ = rb_exc_new2(rb_eException, "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+
+ if (!NIL_P(rbtk_pending_exception)) {
+ if (rbtk_eventloop_depth == 0) {
+ VALUE exc = rbtk_pending_exception;
+ rbtk_pending_exception = Qnil;
+ rb_exc_raise(exc);
+ } else {
+ return 0;
+ }
+ }
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL"));
+ } else {
+ rb_exc_raise(rb_errinfo());
+ }
+ }
+ }
+
+ if (depth != rbtk_eventloop_depth) {
+ DUMP2("DoOneEvent(1) abnormal exit!! %d",
+ rbtk_eventloop_depth);
+ }
+
+ if (check_var != (int*)NULL && !NIL_P(rbtk_pending_exception)) {
+ DUMP1("exception on wait");
+ return 0;
+ }
+
+ if (pending_exception_check0()) {
+ /* pending -> upper level */
+ return 0;
+ }
+
+ if (update_flag != 0) {
+ if (found_event) {
+ DUMP1("next update loop");
+ continue;
+ } else {
+ DUMP1("update complete");
+ return 0;
+ }
+ }
+
+ TRAP_CHECK();
+ if (check_eventloop_interp()) return 0;
+
+ DUMP1("check Root Widget");
+ if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) {
+ run_timer_flag = 0;
+ TRAP_CHECK();
+ return 1;
+ }
+
+ if (loop_counter++ > 30000) {
+ /* fprintf(stderr, "loop_counter > 30000\n"); */
+ loop_counter = 0;
+ }
+
+ } else {
+ int tick_counter;
+
+ DUMP1("there are other threads");
+ event_loop_wait_event = 1;
+
+ found_event = 1;
+
+ if (update_flag) {
+ event_flag = update_flag; /* for safety */
+ /* event_flag = update_flag | TCL_DONT_WAIT; */ /* for safety */
+ } else {
+ event_flag = TCL_ALL_EVENTS;
+ /* event_flag = TCL_ALL_EVENTS | TCL_DONT_WAIT; */
+ }
+
+ timer_tick = req_timer_tick;
+ tick_counter = 0;
+ while(tick_counter < event_loop_max) {
+ if (check_var != (int *)NULL) {
+ if (*check_var || !found_event) {
+ return found_event;
+ }
+ if (interp != (Tcl_Interp*)NULL
+ && Tcl_InterpDeleted(interp)) {
+ /* IP for check_var is deleted */
+ return 0;
+ }
+ }
+
+ if (NIL_P(eventloop_thread) || current == eventloop_thread) {
+ int st;
+ int status;
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (update_flag) {
+ st = RTEST(rb_protect(call_DoOneEvent,
+ INT2FIX(event_flag), &status));
+ } else {
+ st = RTEST(rb_protect(call_DoOneEvent,
+ INT2FIX(event_flag & window_event_mode),
+ &status));
+#if USE_TOGGLE_WINDOW_MODE_FOR_IDLE
+ if (!st) {
+ if (toggle_eventloop_window_mode_for_idle()) {
+ /* idle-mode -> event-mode*/
+ tick_counter = event_loop_max;
+ } else {
+ /* event-mode -> idle-mode */
+ tick_counter = 0;
+ }
+ }
+#endif
+ }
+#else
+ /* st = Tcl_DoOneEvent(event_flag); */
+ st = RTEST(rb_protect(call_DoOneEvent,
+ INT2FIX(event_flag), &status));
+#endif
+
+#if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE
+ if (have_rb_thread_waiting_for_value) {
+ have_rb_thread_waiting_for_value = 0;
+ rb_thread_schedule();
+ }
+#endif
+
+ if (status) {
+ switch (status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception
+ = rb_exc_new2(rb_eException,
+ "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+
+ if (!NIL_P(rbtk_pending_exception)) {
+ if (rbtk_eventloop_depth == 0) {
+ VALUE exc = rbtk_pending_exception;
+ rbtk_pending_exception = Qnil;
+ rb_exc_raise(exc);
+ } else {
+ return 0;
+ }
+ }
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL"));
+ } else {
+ rb_exc_raise(rb_errinfo());
+ }
+ }
+ }
+
+ if (depth != rbtk_eventloop_depth) {
+ DUMP2("DoOneEvent(2) abnormal exit!! %d",
+ rbtk_eventloop_depth);
+ return 0;
+ }
+
+ TRAP_CHECK();
+
+ if (check_var != (int*)NULL
+ && !NIL_P(rbtk_pending_exception)) {
+ DUMP1("exception on wait");
+ return 0;
+ }
+
+ if (pending_exception_check0()) {
+ /* pending -> upper level */
+ return 0;
+ }
+
+ if (st) {
+ tick_counter++;
+ } else {
+ if (update_flag != 0) {
+ DUMP1("update complete");
+ return 0;
+ }
+
+ tick_counter += no_event_tick;
+
+#if 0
+ /* rb_thread_wait_for(t); */
+ rb_protect(eventloop_sleep, Qnil, &status);
+
+ if (status) {
+ switch (status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception
+ = rb_exc_new2(rb_eException,
+ "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+
+ if (!NIL_P(rbtk_pending_exception)) {
+ if (rbtk_eventloop_depth == 0) {
+ VALUE exc = rbtk_pending_exception;
+ rbtk_pending_exception = Qnil;
+ rb_exc_raise(exc);
+ } else {
+ return 0;
+ }
+ }
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rb_exc_raise(rb_exc_new2(rb_eFatal,
+ "FATAL"));
+ } else {
+ rb_exc_raise(rb_errinfo());
+ }
+ }
+ }
+#endif
+ }
+
+ } else {
+ DUMP2("sleep eventloop %"PRIxVALUE, current);
+ DUMP2("eventloop thread is %"PRIxVALUE, eventloop_thread);
+ /* rb_thread_stop(); */
+ rb_thread_sleep_forever();
+ }
+
+ if (!NIL_P(watchdog_thread) && eventloop_thread != current) {
+ return 1;
+ }
+
+ TRAP_CHECK();
+ if (check_eventloop_interp()) return 0;
+
+ DUMP1("check Root Widget");
+ if (check_root && tk_stubs_init_p() && Tk_GetNumMainWindows() == 0) {
+ run_timer_flag = 0;
+ TRAP_CHECK();
+ return 1;
+ }
+
+ if (loop_counter++ > 30000) {
+ /* fprintf(stderr, "loop_counter > 30000\n"); */
+ loop_counter = 0;
+ }
+
+ if (run_timer_flag) {
+ /*
+ DUMP1("timer interrupt");
+ run_timer_flag = 0;
+ */
+ break; /* switch to other thread */
+ }
+ }
+
+ DUMP1("thread scheduling");
+ rb_thread_schedule();
+ }
+
+ DUMP1("check interrupts");
+#if defined(RUBY_USE_NATIVE_THREAD) || defined(RUBY_VM)
+ if (update_flag == 0) rb_thread_check_ints();
+#else
+ if (update_flag == 0) CHECK_INTS;
+#endif
+
+ }
+ return 1;
+}
+
+
+struct evloop_params {
+ int check_root;
+ int update_flag;
+ int *check_var;
+ Tcl_Interp *interp;
+ int thr_crit_bup;
+};
+
+VALUE
+lib_eventloop_main_core(args)
+ VALUE args;
+{
+ struct evloop_params *params = (struct evloop_params *)args;
+
+ check_rootwidget_flag = params->check_root;
+
+ Tcl_CreateEventSource(rbtk_EventSetupProc, rbtk_EventCheckProc, (ClientData)args);
+
+ if (lib_eventloop_core(params->check_root,
+ params->update_flag,
+ params->check_var,
+ params->interp)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+VALUE
+lib_eventloop_main(args)
+ VALUE args;
+{
+ return lib_eventloop_main_core(args);
+
+#if 0
+ volatile VALUE ret;
+ int status = 0;
+
+ ret = rb_protect(lib_eventloop_main_core, args, &status);
+
+ switch (status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception
+ = rb_exc_new2(rb_eException, "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ return Qnil;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ return Qnil;
+ }
+
+ return ret;
+#endif
+}
+
+VALUE
+lib_eventloop_ensure(args)
+ VALUE args;
+{
+ struct evloop_params *ptr = (struct evloop_params *)args;
+ volatile VALUE current_evloop = rb_thread_current();
+
+ Tcl_DeleteEventSource(rbtk_EventSetupProc, rbtk_EventCheckProc, (ClientData)args);
+
+ DUMP2("eventloop_ensure: current-thread : %"PRIxVALUE, current_evloop);
+ DUMP2("eventloop_ensure: eventloop-thread : %"PRIxVALUE, eventloop_thread);
+ if (eventloop_thread != current_evloop) {
+ DUMP2("finish eventloop %"PRIxVALUE" (NOT current eventloop)", current_evloop);
+
+ rb_thread_critical = ptr->thr_crit_bup;
+
+ xfree(ptr);
+ /* ckfree((char*)ptr); */
+
+ return Qnil;
+ }
+
+ while((eventloop_thread = rb_ary_pop(eventloop_stack))) {
+ DUMP2("eventloop-ensure: new eventloop-thread -> %"PRIxVALUE,
+ eventloop_thread);
+
+ if (eventloop_thread == current_evloop) {
+ rbtk_eventloop_depth--;
+ DUMP2("eventloop %"PRIxVALUE" : back from recursive call", current_evloop);
+ break;
+ }
+
+ if (NIL_P(eventloop_thread)) {
+ Tcl_DeleteTimerHandler(timer_token);
+ timer_token = (Tcl_TimerToken)NULL;
+
+ break;
+ }
+
+ if (RTEST(rb_thread_alive_p(eventloop_thread))) {
+ DUMP2("eventloop-enshure: wake up parent %"PRIxVALUE, eventloop_thread);
+ rb_thread_wakeup(eventloop_thread);
+
+ break;
+ }
+ }
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (NIL_P(eventloop_thread)) {
+ tk_eventloop_thread_id = (Tcl_ThreadId) 0;
+ }
+#endif
+
+ rb_thread_critical = ptr->thr_crit_bup;
+
+ xfree(ptr);
+ /* ckfree((char*)ptr);*/
+
+ DUMP2("finish current eventloop %"PRIxVALUE, current_evloop);
+ return Qnil;
+}
+
+static VALUE
+lib_eventloop_launcher(check_root, update_flag, check_var, interp)
+ int check_root;
+ int update_flag;
+ int *check_var;
+ Tcl_Interp *interp;
+{
+ volatile VALUE parent_evloop = eventloop_thread;
+ struct evloop_params *args = ALLOC(struct evloop_params);
+ /* struct evloop_params *args = RbTk_ALLOC_N(struct evloop_params, 1); */
+
+ tcl_stubs_check();
+
+ eventloop_thread = rb_thread_current();
+#ifdef RUBY_USE_NATIVE_THREAD
+ tk_eventloop_thread_id = Tcl_GetCurrentThread();
+#endif
+
+ if (parent_evloop == eventloop_thread) {
+ 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 %"PRIxVALUE, parent_evloop);
+ while(!RTEST(rb_funcall(parent_evloop, ID_stop_p, 0))) {
+ DUMP2("parent_evloop %"PRIxVALUE" doesn't stop", parent_evloop);
+ rb_thread_run(parent_evloop);
+ }
+ DUMP1("succeed to stop parent");
+ }
+
+ rb_ary_push(eventloop_stack, parent_evloop);
+
+ DUMP3("tcltklib: eventloop-thread : %"PRIxVALUE" -> %"PRIxVALUE"\n",
+ parent_evloop, eventloop_thread);
+
+ args->check_root = check_root;
+ args->update_flag = update_flag;
+ args->check_var = check_var;
+ args->interp = interp;
+ args->thr_crit_bup = rb_thread_critical;
+
+ rb_thread_critical = Qfalse;
+
+#if 0
+ return rb_ensure(lib_eventloop_main, (VALUE)args,
+ lib_eventloop_ensure, (VALUE)args);
+#endif
+ return rb_ensure(lib_eventloop_main_core, (VALUE)args,
+ lib_eventloop_ensure, (VALUE)args);
+}
+
+/* execute Tk_MainLoop */
+static VALUE
+lib_mainloop(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE check_rootwidget;
+
+ if (rb_scan_args(argc, argv, "01", &check_rootwidget) == 0) {
+ check_rootwidget = Qtrue;
+ } else if (RTEST(check_rootwidget)) {
+ check_rootwidget = Qtrue;
+ } else {
+ check_rootwidget = Qfalse;
+ }
+
+ return lib_eventloop_launcher(RTEST(check_rootwidget), 0,
+ (int*)NULL, (Tcl_Interp*)NULL);
+}
+
+static VALUE
+ip_mainloop(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ volatile VALUE ret;
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return Qnil;
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return Qnil;
+ }
+
+ eventloop_interp = ptr->ip;
+ ret = lib_mainloop(argc, argv, self);
+ eventloop_interp = (Tcl_Interp*)NULL;
+ return ret;
+}
+
+
+static VALUE
+watchdog_evloop_launcher(check_rootwidget)
+ VALUE check_rootwidget;
+{
+ return lib_eventloop_launcher(RTEST(check_rootwidget), 0,
+ (int*)NULL, (Tcl_Interp*)NULL);
+}
+
+#define EVLOOP_WAKEUP_CHANCE 3
+
+static VALUE
+lib_watchdog_core(check_rootwidget)
+ VALUE check_rootwidget;
+{
+ VALUE evloop;
+ int prev_val = -1;
+ int chance = 0;
+ int check = RTEST(check_rootwidget);
+ struct timeval t0, t1;
+
+ t0.tv_sec = 0;
+ t0.tv_usec = (long)((NO_THREAD_INTERRUPT_TIME)*1000.0);
+ t1.tv_sec = 0;
+ t1.tv_usec = (long)((WATCHDOG_INTERVAL)*1000.0);
+
+ /* check other watchdog thread */
+ if (!NIL_P(watchdog_thread)) {
+ if (RTEST(rb_funcall(watchdog_thread, ID_stop_p, 0))) {
+ rb_funcall(watchdog_thread, ID_kill, 0);
+ } else {
+ return Qnil;
+ }
+ }
+ watchdog_thread = rb_thread_current();
+
+ /* watchdog start */
+ do {
+ if (NIL_P(eventloop_thread)
+ || (loop_counter == prev_val && chance >= EVLOOP_WAKEUP_CHANCE)) {
+ /* start new eventloop thread */
+ 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 %"PRIxVALUE, evloop);
+ loop_counter = -1;
+ chance = 0;
+ rb_thread_run(evloop);
+ } else {
+ prev_val = loop_counter;
+ if (RTEST(rb_funcall(eventloop_thread, ID_stop_p, 0))) {
+ ++chance;
+ } else {
+ chance = 0;
+ }
+ if (event_loop_wait_event) {
+ rb_thread_wait_for(t0);
+ } else {
+ rb_thread_wait_for(t1);
+ }
+ /* rb_thread_schedule(); */
+ }
+ } while(!check || !tk_stubs_init_p() || Tk_GetNumMainWindows() != 0);
+
+ return Qnil;
+}
+
+VALUE
+lib_watchdog_ensure(arg)
+ VALUE arg;
+{
+ eventloop_thread = Qnil; /* stop eventloops */
+#ifdef RUBY_USE_NATIVE_THREAD
+ tk_eventloop_thread_id = (Tcl_ThreadId) 0;
+#endif
+ return Qnil;
+}
+
+static VALUE
+lib_mainloop_watchdog(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE check_rootwidget;
+
+#ifdef RUBY_VM
+ rb_raise(rb_eNotImpError,
+ "eventloop_watchdog is not implemented on Ruby VM.");
+#endif
+
+ if (rb_scan_args(argc, argv, "01", &check_rootwidget) == 0) {
+ check_rootwidget = Qtrue;
+ } else if (RTEST(check_rootwidget)) {
+ check_rootwidget = Qtrue;
+ } else {
+ check_rootwidget = Qfalse;
+ }
+
+ return rb_ensure(lib_watchdog_core, check_rootwidget,
+ lib_watchdog_ensure, Qnil);
+}
+
+static VALUE
+ip_mainloop_watchdog(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return Qnil;
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return Qnil;
+ }
+ return lib_mainloop_watchdog(argc, argv, self);
+}
+
+
+/* thread-safe(?) interaction between Ruby and Tk */
+struct thread_call_proc_arg {
+ VALUE proc;
+ int *done;
+};
+
+void
+_thread_call_proc_arg_mark(struct thread_call_proc_arg *q)
+{
+ rb_gc_mark(q->proc);
+}
+
+static VALUE
+_thread_call_proc_core(arg)
+ VALUE arg;
+{
+ struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
+ return rb_funcall(q->proc, ID_call, 0);
+}
+
+static VALUE
+_thread_call_proc_ensure(arg)
+ VALUE arg;
+{
+ struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
+ *(q->done) = 1;
+ return Qnil;
+}
+
+static VALUE
+_thread_call_proc(arg)
+ VALUE arg;
+{
+ struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg;
+
+ return rb_ensure(_thread_call_proc_core, (VALUE)q,
+ _thread_call_proc_ensure, (VALUE)q);
+}
+
+static VALUE
+#ifdef HAVE_PROTOTYPES
+_thread_call_proc_value(VALUE th)
+#else
+_thread_call_proc_value(th)
+ VALUE th;
+#endif
+{
+ return rb_funcall(th, ID_value, 0);
+}
+
+static VALUE
+lib_thread_callback(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct thread_call_proc_arg *q;
+ VALUE proc, th, ret;
+ int status;
+
+ if (rb_scan_args(argc, argv, "01", &proc) == 0) {
+ proc = rb_block_proc();
+ }
+
+ q = (struct thread_call_proc_arg *)ALLOC(struct thread_call_proc_arg);
+ /* q = RbTk_ALLOC_N(struct thread_call_proc_arg, 1); */
+ q->proc = proc;
+ q->done = (int*)ALLOC(int);
+ /* q->done = RbTk_ALLOC_N(int, 1); */
+ *(q->done) = 0;
+
+ /* create call-proc thread */
+ th = rb_thread_create(_thread_call_proc, (void*)q);
+
+ rb_thread_schedule();
+
+ /* start sub-eventloop */
+ lib_eventloop_launcher(/* not check root-widget */0, 0,
+ q->done, (Tcl_Interp*)NULL);
+
+ if (RTEST(rb_thread_alive_p(th))) {
+ rb_funcall(th, ID_kill, 0);
+ ret = Qnil;
+ } else {
+ ret = rb_protect(_thread_call_proc_value, th, &status);
+ }
+
+ xfree(q->done);
+ xfree(q);
+ /* ckfree((char*)q->done); */
+ /* ckfree((char*)q); */
+
+ if (NIL_P(rbtk_pending_exception)) {
+ /* return rb_errinfo(); */
+ if (status) {
+ rb_exc_raise(rb_errinfo());
+ }
+ } else {
+ VALUE exc = rbtk_pending_exception;
+ rbtk_pending_exception = Qnil;
+ /* return exc; */
+ rb_exc_raise(exc);
+ }
+
+ return ret;
+}
+
+
+/* do_one_event */
+static VALUE
+lib_do_one_event_core(argc, argv, self, is_ip)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+ int is_ip;
+{
+ volatile VALUE vflags;
+ int flags;
+ int found_event;
+
+ if (!NIL_P(eventloop_thread)) {
+ rb_raise(rb_eRuntimeError, "eventloop is already running");
+ }
+
+ tcl_stubs_check();
+
+ if (rb_scan_args(argc, argv, "01", &vflags) == 0) {
+ flags = TCL_ALL_EVENTS | TCL_DONT_WAIT;
+ } else {
+ Check_Type(vflags, T_FIXNUM);
+ flags = FIX2INT(vflags);
+ }
+
+ if (rb_safe_level() >= 4 || (rb_safe_level() >=1 && OBJ_TAINTED(vflags))) {
+ flags |= TCL_DONT_WAIT;
+ }
+
+ if (is_ip) {
+ /* check IP */
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return Qfalse;
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ flags |= TCL_DONT_WAIT;
+ }
+ }
+
+ /* found_event = Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT); */
+ found_event = Tcl_DoOneEvent(flags);
+
+ if (pending_exception_check0()) {
+ return Qfalse;
+ }
+
+ if (found_event) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+static VALUE
+lib_do_one_event(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ return lib_do_one_event_core(argc, argv, self, 0);
+}
+
+static VALUE
+ip_do_one_event(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ return lib_do_one_event_core(argc, argv, self, 0);
+}
+
+
+static void
+ip_set_exc_message(interp, exc)
+ Tcl_Interp *interp;
+ VALUE exc;
+{
+ char *buf;
+ Tcl_DString dstr;
+ volatile VALUE msg;
+ int thr_crit_bup;
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
+ volatile VALUE enc;
+ Tcl_Encoding encoding;
+#endif
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ msg = rb_funcall(exc, ID_message, 0, 0);
+ StringValue(msg);
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
+ enc = rb_attr_get(exc, ID_at_enc);
+ if (NIL_P(enc)) {
+ enc = rb_attr_get(msg, ID_at_enc);
+ }
+ if (NIL_P(enc)) {
+ encoding = (Tcl_Encoding)NULL;
+ } 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);
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc));
+ }
+
+ /* to avoid a garbled error message dialog */
+ /* buf = ALLOC_N(char, (RSTRING(msg)->len)+1);*/
+ /* memcpy(buf, RSTRING(msg)->ptr, RSTRING(msg)->len);*/
+ /* buf[RSTRING(msg)->len] = 0; */
+ buf = ALLOC_N(char, RSTRING_LENINT(msg)+1);
+ /* buf = ckalloc(RSTRING_LENINT(msg)+1); */
+ memcpy(buf, RSTRING_PTR(msg), RSTRING_LEN(msg));
+ buf[RSTRING_LEN(msg)] = 0;
+
+ Tcl_DStringInit(&dstr);
+ Tcl_DStringFree(&dstr);
+ Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LENINT(msg), &dstr);
+
+ Tcl_AppendResult(interp, Tcl_DStringValue(&dstr), (char*)NULL);
+ DUMP2("error message:%s", Tcl_DStringValue(&dstr));
+ Tcl_DStringFree(&dstr);
+ xfree(buf);
+ /* ckfree(buf); */
+
+#else /* TCL_VERSION <= 8.0 */
+ Tcl_AppendResult(interp, RSTRING_PTR(msg), (char*)NULL);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+}
+
+static VALUE
+TkStringValue(obj)
+ VALUE obj;
+{
+ switch(TYPE(obj)) {
+ case T_STRING:
+ return obj;
+
+ case T_NIL:
+ return rb_str_new2("");
+
+ case T_TRUE:
+ return rb_str_new2("1");
+
+ case T_FALSE:
+ return rb_str_new2("0");
+
+ case T_ARRAY:
+ return rb_funcall(obj, ID_join, 1, rb_str_new2(" "));
+
+ default:
+ if (rb_respond_to(obj, ID_to_s)) {
+ return rb_funcall(obj, ID_to_s, 0, 0);
+ }
+ }
+
+ return rb_funcall(obj, ID_inspect, 0, 0);
+}
+
+static int
+#ifdef HAVE_PROTOTYPES
+tcl_protect_core(Tcl_Interp *interp, VALUE (*proc)(VALUE), VALUE data)
+#else
+tcl_protect_core(interp, proc, data) /* should not raise exception */
+ Tcl_Interp *interp;
+ VALUE (*proc)();
+ VALUE data;
+#endif
+{
+ volatile VALUE ret, exc = Qnil;
+ int status = 0;
+ int thr_crit_bup = rb_thread_critical;
+
+ Tcl_ResetResult(interp);
+
+ rb_thread_critical = Qfalse;
+ ret = rb_protect(proc, data, &status);
+ rb_thread_critical = Qtrue;
+ if (status) {
+ char *buf;
+ VALUE old_gc;
+ volatile VALUE type, str;
+
+ old_gc = rb_gc_disable();
+
+ switch(status) {
+ case TAG_RETURN:
+ type = eTkCallbackReturn;
+ goto error;
+ case TAG_BREAK:
+ type = eTkCallbackBreak;
+ goto error;
+ case TAG_NEXT:
+ type = eTkCallbackContinue;
+ goto error;
+ error:
+ str = rb_str_new2("LocalJumpError: ");
+ rb_str_append(str, rb_obj_as_string(rb_errinfo()));
+ exc = rb_exc_new3(type, str);
+ break;
+
+ case TAG_RETRY:
+ if (NIL_P(rb_errinfo())) {
+ DUMP1("rb_protect: retry");
+ exc = rb_exc_new2(eTkCallbackRetry, "retry jump error");
+ } else {
+ exc = rb_errinfo();
+ }
+ break;
+
+ case TAG_REDO:
+ if (NIL_P(rb_errinfo())) {
+ DUMP1("rb_protect: redo");
+ exc = rb_exc_new2(eTkCallbackRedo, "redo jump error");
+ } else {
+ exc = rb_errinfo();
+ }
+ break;
+
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ exc = rb_exc_new2(rb_eException, "unknown exception");
+ } else {
+ exc = rb_errinfo();
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ exc = rb_exc_new2(rb_eFatal, "FATAL");
+ } else {
+ exc = rb_errinfo();
+ }
+ break;
+
+ case TAG_THROW:
+ if (NIL_P(rb_errinfo())) {
+ DUMP1("rb_protect: throw");
+ exc = rb_exc_new2(eTkCallbackThrow, "throw jump error");
+ } else {
+ exc = rb_errinfo();
+ }
+ break;
+
+ default:
+ buf = ALLOC_N(char, 256);
+ /* buf = ckalloc(sizeof(char) * 256); */
+ sprintf(buf, "unknown loncaljmp status %d", status);
+ exc = rb_exc_new2(rb_eException, buf);
+ xfree(buf);
+ /* ckfree(buf); */
+ break;
+ }
+
+ if (old_gc == Qfalse) rb_gc_enable();
+
+ ret = Qnil;
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ Tcl_ResetResult(interp);
+
+ /* status check */
+ if (!NIL_P(exc)) {
+ volatile VALUE eclass = rb_obj_class(exc);
+ volatile VALUE backtrace;
+
+ DUMP1("(failed)");
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ DUMP1("set backtrace");
+ if (!NIL_P(backtrace = rb_funcall(exc, ID_backtrace, 0, 0))) {
+ backtrace = rb_ary_join(backtrace, rb_str_new2("\n"));
+ Tcl_AddErrorInfo(interp, StringValuePtr(backtrace));
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ ip_set_exc_message(interp, exc);
+
+ if (eclass == eTkCallbackReturn)
+ return TCL_RETURN;
+
+ if (eclass == eTkCallbackBreak)
+ return TCL_BREAK;
+
+ if (eclass == eTkCallbackContinue)
+ return TCL_CONTINUE;
+
+ if (eclass == rb_eSystemExit || eclass == rb_eInterrupt) {
+ rbtk_pending_exception = exc;
+ return TCL_RETURN;
+ }
+
+ if (rb_obj_is_kind_of(exc, eTkLocalJumpError)) {
+ rbtk_pending_exception = exc;
+ return TCL_ERROR;
+ }
+
+ if (rb_obj_is_kind_of(exc, eLocalJumpError)) {
+ VALUE reason = rb_ivar_get(exc, ID_at_reason);
+
+ if (RB_TYPE_P(reason, T_SYMBOL)) {
+ if (SYM2ID(reason) == ID_return)
+ return TCL_RETURN;
+
+ if (SYM2ID(reason) == ID_break)
+ return TCL_BREAK;
+
+ if (SYM2ID(reason) == ID_next)
+ return TCL_CONTINUE;
+ }
+ }
+
+ return TCL_ERROR;
+ }
+
+ /* result must be string or nil */
+ if (!NIL_P(ret)) {
+ /* copy result to the tcl interpreter */
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ ret = TkStringValue(ret);
+ DUMP1("Tcl_AppendResult");
+ Tcl_AppendResult(interp, RSTRING_PTR(ret), (char *)NULL);
+
+ rb_thread_critical = thr_crit_bup;
+ }
+
+ DUMP2("(result) %s", NIL_P(ret) ? "nil" : RSTRING_PTR(ret));
+
+ return TCL_OK;
+}
+
+static int
+tcl_protect(interp, proc, data)
+ Tcl_Interp *interp;
+ VALUE (*proc)();
+ VALUE data;
+{
+ int code;
+
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on tcl_protect()");
+ }
+#endif
+#endif
+
+#ifdef RUBY_VM
+ code = tcl_protect_core(interp, proc, data);
+#else
+ do {
+ int old_trapflag = rb_trap_immediate;
+ rb_trap_immediate = 0;
+ code = tcl_protect_core(interp, proc, data);
+ rb_trap_immediate = old_trapflag;
+ } while (0);
+#endif
+
+ return code;
+}
+
+static int
+#if TCL_MAJOR_VERSION >= 8
+ip_ruby_eval(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ Tcl_Obj *CONST argv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+ip_ruby_eval(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+#endif
+{
+ char *arg;
+ int thr_crit_bup;
+ int code;
+
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+ /* ruby command has 1 arg. */
+ if (argc != 2) {
+#if 0
+ rb_raise(rb_eArgError,
+ "wrong number of arguments (%d for 1)", argc - 1);
+#else
+ char buf[sizeof(int)*8 + 1];
+ Tcl_ResetResult(interp);
+ sprintf(buf, "%d", argc-1);
+ Tcl_AppendResult(interp, "wrong number of arguments (",
+ buf, " for 1)", (char *)NULL);
+ rbtk_pending_exception = rb_exc_new2(rb_eArgError,
+ Tcl_GetStringResult(interp));
+ return TCL_ERROR;
+#endif
+ }
+
+ /* get C string from Tcl object */
+#if TCL_MAJOR_VERSION >= 8
+ {
+ char *str;
+ int len;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ str = Tcl_GetStringFromObj(argv[1], &len);
+ arg = ALLOC_N(char, len + 1);
+ /* arg = ckalloc(sizeof(char) * (len + 1)); */
+ memcpy(arg, str, len);
+ arg[len] = 0;
+
+ rb_thread_critical = thr_crit_bup;
+
+ }
+#else /* TCL_MAJOR_VERSION < 8 */
+ arg = argv[1];
+#endif
+
+ /* evaluate the argument string by ruby */
+ DUMP2("rb_eval_string(%s)", arg);
+
+ code = tcl_protect(interp, rb_eval_string, (VALUE)arg);
+
+#if TCL_MAJOR_VERSION >= 8
+ xfree(arg);
+ /* ckfree(arg); */
+#endif
+
+ return code;
+}
+
+
+/* Tcl command `ruby_cmd' */
+static VALUE
+ip_ruby_cmd_core(arg)
+ struct cmd_body_arg *arg;
+{
+ volatile VALUE ret;
+ int thr_crit_bup;
+
+ DUMP1("call ip_ruby_cmd_core");
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qfalse;
+ ret = rb_apply(arg->receiver, arg->method, arg->args);
+ 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
+}
+
+static VALUE
+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);
+ } else {
+ /* global variable omitted '$' */
+ char *buf;
+ size_t len;
+
+ len = strlen(str);
+ buf = ALLOC_N(char, len + 2);
+ /* buf = ckalloc(sizeof(char) * (len + 2)); */
+ buf[0] = '$';
+ memcpy(buf + 1, str, len);
+ buf[len + 1] = 0;
+ receiver = rb_gv_get(buf);
+ xfree(buf);
+ /* ckfree(buf); */
+ }
+
+ return receiver;
+}
+
+/* ruby_cmd receiver method arg ... */
+static int
+#if TCL_MAJOR_VERSION >= 8
+ip_ruby_cmd(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ Tcl_Obj *CONST argv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+ip_ruby_cmd(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+#endif
+{
+ volatile VALUE receiver;
+ volatile ID method;
+ volatile VALUE args;
+ char *str;
+ int i;
+ int len;
+ struct cmd_body_arg *arg;
+ int thr_crit_bup;
+ VALUE old_gc;
+ int code;
+
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+ if (argc < 3) {
+#if 0
+ rb_raise(rb_eArgError, "too few arguments");
+#else
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "too few arguments", (char *)NULL);
+ rbtk_pending_exception = rb_exc_new2(rb_eArgError,
+ Tcl_GetStringResult(interp));
+ return TCL_ERROR;
+#endif
+ }
+
+ /* get arguments from Tcl objects */
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ old_gc = rb_gc_disable();
+
+ /* get receiver */
+#if TCL_MAJOR_VERSION >= 8
+ str = Tcl_GetStringFromObj(argv[1], &len);
+#else /* TCL_MAJOR_VERSION < 8 */
+ str = argv[1];
+#endif
+ DUMP2("receiver:%s",str);
+ /* receiver = rb_protect(ip_ruby_cmd_receiver_get, (VALUE)str, &code); */
+ receiver = ip_ruby_cmd_receiver_get(str);
+ if (NIL_P(receiver)) {
+#if 0
+ rb_raise(rb_eArgError,
+ "unknown class/module/global-variable '%s'", str);
+#else
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "unknown class/module/global-variable '",
+ str, "'", (char *)NULL);
+ rbtk_pending_exception = rb_exc_new2(rb_eArgError,
+ Tcl_GetStringResult(interp));
+ if (old_gc == Qfalse) rb_gc_enable();
+ return TCL_ERROR;
+#endif
+ }
+
+ /* get metrhod */
+#if TCL_MAJOR_VERSION >= 8
+ str = Tcl_GetStringFromObj(argv[2], &len);
+#else /* TCL_MAJOR_VERSION < 8 */
+ str = argv[2];
+#endif
+ method = rb_intern(str);
+
+ /* get args */
+ args = rb_ary_new2(argc - 2);
+ for(i = 3; i < argc; i++) {
+ VALUE s;
+#if TCL_MAJOR_VERSION >= 8
+ str = Tcl_GetStringFromObj(argv[i], &len);
+ s = rb_tainted_str_new(str, len);
+#else /* TCL_MAJOR_VERSION < 8 */
+ str = argv[i];
+ s = rb_tainted_str_new2(str);
+#endif
+ DUMP2("arg:%s",str);
+#ifndef HAVE_STRUCT_RARRAY_LEN
+ rb_ary_push(args, s);
+#else
+ RARRAY(args)->ptr[RARRAY(args)->len++] = s;
+#endif
+ }
+
+ if (old_gc == Qfalse) rb_gc_enable();
+ rb_thread_critical = thr_crit_bup;
+
+ /* allocate */
+ arg = ALLOC(struct cmd_body_arg);
+ /* arg = RbTk_ALLOC_N(struct cmd_body_arg, 1); */
+
+ arg->receiver = receiver;
+ arg->method = method;
+ arg->args = args;
+
+ /* evaluate the argument string by ruby */
+ code = tcl_protect(interp, ip_ruby_cmd_core, (VALUE)arg);
+
+ xfree(arg);
+ /* ckfree((char*)arg); */
+
+ return code;
+}
+
+
+/*****************************/
+/* relpace of 'exit' command */
+/*****************************/
+static int
+#if TCL_MAJOR_VERSION >= 8
+#ifdef HAVE_PROTOTYPES
+ip_InterpExitObjCmd(ClientData clientData, Tcl_Interp *interp,
+ int argc, Tcl_Obj *CONST argv[])
+#else
+ip_InterpExitObjCmd(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ Tcl_Obj *CONST argv[];
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+#ifdef HAVE_PROTOTYPES
+ip_InterpExitCommand(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
+#else
+ip_InterpExitCommand(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+#endif
+#endif
+{
+ DUMP1("start ip_InterpExitCommand");
+ if (interp != (Tcl_Interp*)NULL
+ && !Tcl_InterpDeleted(interp)
+#if TCL_NAMESPACE_DEBUG
+ && !ip_null_namespace(interp)
+#endif
+ ) {
+ Tcl_ResetResult(interp);
+ /* Tcl_Preserve(interp); */
+ /* Tcl_Eval(interp, "interp eval {} {destroy .}; interp delete {}"); */
+ if (!Tcl_InterpDeleted(interp)) {
+ ip_finalize(interp);
+
+ Tcl_DeleteInterp(interp);
+ Tcl_Release(interp);
+ }
+ }
+ return TCL_OK;
+}
+
+static int
+#if TCL_MAJOR_VERSION >= 8
+#ifdef HAVE_PROTOTYPES
+ip_RubyExitObjCmd(ClientData clientData, Tcl_Interp *interp,
+ int argc, Tcl_Obj *CONST argv[])
+#else
+ip_RubyExitObjCmd(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ Tcl_Obj *CONST argv[];
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+#ifdef HAVE_PROTOTYPES
+ip_RubyExitCommand(ClientData clientData, Tcl_Interp *interp,
+ int argc, char *argv[])
+#else
+ip_RubyExitCommand(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+#endif
+#endif
+{
+ int state;
+ char *cmd, *param;
+#if TCL_MAJOR_VERSION < 8
+ char *endptr;
+ cmd = argv[0];
+#endif
+
+ DUMP1("start ip_RubyExitCommand");
+
+#if TCL_MAJOR_VERSION >= 8
+ /* cmd = Tcl_GetString(argv[0]); */
+ cmd = Tcl_GetStringFromObj(argv[0], (int*)NULL);
+#endif
+
+ if (argc < 1 || argc > 2) {
+ /* argument error */
+ Tcl_AppendResult(interp,
+ "wrong number of arguments: should be \"",
+ cmd, " ?returnCode?\"", (char *)NULL);
+ return TCL_ERROR;
+ }
+
+ if (interp == (Tcl_Interp*)NULL) return TCL_OK;
+
+ Tcl_ResetResult(interp);
+
+ if (rb_safe_level() >= 4 || Tcl_IsSafe(interp)) {
+ if (!Tcl_InterpDeleted(interp)) {
+ ip_finalize(interp);
+
+ Tcl_DeleteInterp(interp);
+ Tcl_Release(interp);
+ }
+ return TCL_OK;
+ }
+
+ switch(argc) {
+ case 1:
+ /* rb_exit(0); */ /* not return if succeed */
+ Tcl_AppendResult(interp,
+ "fail to call \"", cmd, "\"", (char *)NULL);
+
+ rbtk_pending_exception = rb_exc_new2(rb_eSystemExit,
+ Tcl_GetStringResult(interp));
+ rb_iv_set(rbtk_pending_exception, "status", INT2FIX(0));
+
+ return TCL_RETURN;
+
+ case 2:
+#if TCL_MAJOR_VERSION >= 8
+ if (Tcl_GetIntFromObj(interp, argv[1], &state) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ /* param = Tcl_GetString(argv[1]); */
+ param = Tcl_GetStringFromObj(argv[1], (int*)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ state = (int)strtol(argv[1], &endptr, 0);
+ if (*endptr) {
+ Tcl_AppendResult(interp,
+ "expected integer but got \"",
+ argv[1], "\"", (char *)NULL);
+ return TCL_ERROR;
+ }
+ param = argv[1];
+#endif
+ /* rb_exit(state); */ /* not return if succeed */
+
+ Tcl_AppendResult(interp, "fail to call \"", cmd, " ",
+ param, "\"", (char *)NULL);
+
+ rbtk_pending_exception = rb_exc_new2(rb_eSystemExit,
+ Tcl_GetStringResult(interp));
+ rb_iv_set(rbtk_pending_exception, "status", INT2FIX(state));
+
+ return TCL_RETURN;
+
+ default:
+ /* arguemnt error */
+ Tcl_AppendResult(interp,
+ "wrong number of arguments: should be \"",
+ cmd, " ?returnCode?\"", (char *)NULL);
+ return TCL_ERROR;
+ }
+}
+
+
+/**************************/
+/* based on tclEvent.c */
+/**************************/
+
+/*********************/
+/* replace of update */
+/*********************/
+#if TCL_MAJOR_VERSION >= 8
+static int ip_rbUpdateObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int
+ip_rbUpdateObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int ip_rbUpdateCommand _((ClientData, Tcl_Interp *, int, char *[]));
+static int
+ip_rbUpdateCommand(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ int flags = 0;
+ static CONST char *updateOptions[] = {"idletasks", (char *) NULL};
+ enum updateOptions {REGEXP_IDLETASKS};
+
+ DUMP1("Ruby's 'update' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on ip_ruby_eval()");
+ }
+#endif
+#endif
+
+ Tcl_ResetResult(interp);
+
+ if (objc == 1) {
+ flags = TCL_DONT_WAIT;
+
+ } else if (objc == 2) {
+#if TCL_MAJOR_VERSION >= 8
+ int optionIndex;
+ if (Tcl_GetIndexFromObj(interp, objv[1], (CONST84 char **)updateOptions,
+ "option", 0, &optionIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ switch ((enum updateOptions) optionIndex) {
+ case REGEXP_IDLETASKS: {
+ flags = TCL_IDLE_EVENTS;
+ break;
+ }
+ default: {
+ rb_bug("ip_rbUpdateObjCmd: bad option index to UpdateOptions");
+ }
+ }
+#else
+ if (strncmp(objv[1], "idletasks", strlen(objv[1])) != 0) {
+ Tcl_AppendResult(interp, "bad option \"", objv[1],
+ "\": must be idletasks", (char *) NULL);
+ return TCL_ERROR;
+ }
+ flags = TCL_IDLE_EVENTS;
+#endif
+ } else {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "[ idletasks ]");
+#else
+# if TCL_MAJOR_VERSION >= 8
+ int dummy;
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ Tcl_GetStringFromObj(objv[0], &dummy),
+ " [ idletasks ]\"",
+ (char *) NULL);
+# else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ objv[0], " [ idletasks ]\"", (char *) NULL);
+# endif
+#endif
+ return TCL_ERROR;
+ }
+
+ Tcl_Preserve(interp);
+
+ /* call eventloop */
+ /* ret = lib_eventloop_core(0, flags, (int *)NULL);*/ /* ignore result */
+ lib_eventloop_launcher(0, flags, (int *)NULL, interp); /* ignore result */
+
+ /* exception check */
+ if (!NIL_P(rbtk_pending_exception)) {
+ Tcl_Release(interp);
+
+ /*
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)) {
+ */
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)
+ || rb_obj_is_kind_of(rbtk_pending_exception, rb_eInterrupt)) {
+ return TCL_RETURN;
+ } else{
+ return TCL_ERROR;
+ }
+ }
+
+ /* trap check */
+ if (rb_thread_check_trap_pending()) {
+ Tcl_Release(interp);
+
+ return TCL_RETURN;
+ }
+
+ /*
+ * Must clear the interpreter's result because event handlers could
+ * have executed commands.
+ */
+
+ DUMP2("last result '%s'", Tcl_GetStringResult(interp));
+ Tcl_ResetResult(interp);
+ Tcl_Release(interp);
+
+ DUMP1("finish Ruby's 'update'");
+ return TCL_OK;
+}
+
+
+/**********************/
+/* update with thread */
+/**********************/
+struct th_update_param {
+ VALUE thread;
+ int done;
+};
+
+static void rb_threadUpdateProc _((ClientData));
+static void
+rb_threadUpdateProc(clientData)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+{
+ struct th_update_param *param = (struct th_update_param *) clientData;
+
+ DUMP1("threadUpdateProc is called");
+ param->done = 1;
+ rb_thread_wakeup(param->thread);
+
+ return;
+}
+
+#if TCL_MAJOR_VERSION >= 8
+static int ip_rb_threadUpdateObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int
+ip_rb_threadUpdateObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int ip_rb_threadUpdateCommand _((ClientData, Tcl_Interp *, int,
+ char *[]));
+static int
+ip_rb_threadUpdateCommand(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+# if 0
+ int flags = 0;
+# endif
+ struct th_update_param *param;
+ static CONST char *updateOptions[] = {"idletasks", (char *) NULL};
+ enum updateOptions {REGEXP_IDLETASKS};
+ volatile VALUE current_thread = rb_thread_current();
+ struct timeval t;
+
+ DUMP1("Ruby's 'thread_update' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on ip_rb_threadUpdateCommand()");
+ }
+#endif
+#endif
+
+ if (rb_thread_alone()
+ || NIL_P(eventloop_thread) || eventloop_thread == current_thread) {
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("call ip_rbUpdateObjCmd");
+ return ip_rbUpdateObjCmd(clientData, interp, objc, objv);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("call ip_rbUpdateCommand");
+ return ip_rbUpdateCommand(clientData, interp, objc, objv);
+#endif
+ }
+
+ DUMP1("start Ruby's 'thread_update' body");
+
+ Tcl_ResetResult(interp);
+
+ if (objc == 1) {
+# if 0
+ flags = TCL_DONT_WAIT;
+# endif
+ } else if (objc == 2) {
+#if TCL_MAJOR_VERSION >= 8
+ int optionIndex;
+ if (Tcl_GetIndexFromObj(interp, objv[1], (CONST84 char **)updateOptions,
+ "option", 0, &optionIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ switch ((enum updateOptions) optionIndex) {
+ case REGEXP_IDLETASKS: {
+# if 0
+ flags = TCL_IDLE_EVENTS;
+# endif
+ break;
+ }
+ default: {
+ rb_bug("ip_rb_threadUpdateObjCmd: bad option index to UpdateOptions");
+ }
+ }
+#else
+ if (strncmp(objv[1], "idletasks", strlen(objv[1])) != 0) {
+ Tcl_AppendResult(interp, "bad option \"", objv[1],
+ "\": must be idletasks", (char *) NULL);
+ return TCL_ERROR;
+ }
+# if 0
+ flags = TCL_IDLE_EVENTS;
+# endif
+#endif
+ } else {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "[ idletasks ]");
+#else
+# if TCL_MAJOR_VERSION >= 8
+ int dummy;
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ Tcl_GetStringFromObj(objv[0], &dummy),
+ " [ idletasks ]\"",
+ (char *) NULL);
+# else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ objv[0], " [ idletasks ]\"", (char *) NULL);
+# endif
+#endif
+ return TCL_ERROR;
+ }
+
+ DUMP1("pass argument check");
+
+ /* param = (struct th_update_param *)Tcl_Alloc(sizeof(struct th_update_param)); */
+ param = RbTk_ALLOC_N(struct th_update_param, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)param);
+#endif
+ param->thread = current_thread;
+ param->done = 0;
+
+ DUMP1("set idle proc");
+ Tcl_DoWhenIdle(rb_threadUpdateProc, (ClientData) param);
+
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ while(!param->done) {
+ DUMP1("wait for complete idle proc");
+ /* rb_thread_stop(); */
+ /* rb_thread_sleep_forever(); */
+ rb_thread_wait_for(t);
+ if (NIL_P(eventloop_thread)) {
+ break;
+ }
+ }
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+ DUMP1("finish Ruby's 'thread_update'");
+ return TCL_OK;
+}
+
+
+/***************************/
+/* replace of vwait/tkwait */
+/***************************/
+#if TCL_MAJOR_VERSION >= 8
+static int ip_rbVwaitObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int ip_rb_threadVwaitObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int ip_rbTkWaitObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int ip_rb_threadTkWaitObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+#else
+static int ip_rbVwaitCommand _((ClientData, Tcl_Interp *, int, char *[]));
+static int ip_rb_threadVwaitCommand _((ClientData, Tcl_Interp *, int,
+ char *[]));
+static int ip_rbTkWaitCommand _((ClientData, Tcl_Interp *, int, char *[]));
+static int ip_rb_threadTkWaitCommand _((ClientData, Tcl_Interp *, int,
+ char *[]));
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+static char *VwaitVarProc _((ClientData, Tcl_Interp *,
+ CONST84 char *,CONST84 char *, int));
+static char *
+VwaitVarProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ CONST84 char *name1; /* Name of variable. */
+ CONST84 char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#else /* TCL_MAJOR_VERSION < 8 */
+static char *VwaitVarProc _((ClientData, Tcl_Interp *, char *, char *, int));
+static char *
+VwaitVarProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ char *name1; /* Name of variable. */
+ char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#endif
+{
+ int *donePtr = (int *) clientData;
+
+ *donePtr = 1;
+ return (char *) NULL;
+}
+
+#if TCL_MAJOR_VERSION >= 8
+static int
+ip_rbVwaitObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Not used */
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int
+ip_rbVwaitCommand(clientData, interp, objc, objv)
+ ClientData clientData; /* Not used */
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ int ret, done, foundEvent;
+ char *nameString;
+ int dummy;
+ int thr_crit_bup;
+
+ DUMP1("Ruby's 'vwait' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+#if 0
+ if (!rb_thread_alone()
+ && eventloop_thread != Qnil
+ && eventloop_thread != rb_thread_current()) {
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("call ip_rb_threadVwaitObjCmd");
+ return ip_rb_threadVwaitObjCmd(clientData, interp, objc, objv);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("call ip_rb_threadVwaitCommand");
+ return ip_rb_threadVwaitCommand(clientData, interp, objc, objv);
+#endif
+ }
+#endif
+
+ Tcl_Preserve(interp);
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on ip_rbVwaitCommand()");
+ }
+#endif
+#endif
+
+ Tcl_ResetResult(interp);
+
+ if (objc != 2) {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "name");
+#else
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ /* nameString = Tcl_GetString(objv[0]); */
+ nameString = Tcl_GetStringFromObj(objv[0], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[0];
+#endif
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ nameString, " name\"", (char *) NULL);
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_IncrRefCount(objv[1]);
+ /* nameString = Tcl_GetString(objv[1]); */
+ nameString = Tcl_GetStringFromObj(objv[1], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[1];
+#endif
+
+ /*
+ if (Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ VwaitVarProc, (ClientData) &done) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ VwaitVarProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ done = 0;
+
+ foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0,
+ 0, &done, interp));
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_UntraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ VwaitVarProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* exception check */
+ if (!NIL_P(rbtk_pending_exception)) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+
+/*
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)) {
+*/
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)
+ || rb_obj_is_kind_of(rbtk_pending_exception, rb_eInterrupt)) {
+ return TCL_RETURN;
+ } else{
+ return TCL_ERROR;
+ }
+ }
+
+ /* trap check */
+ if (rb_thread_check_trap_pending()) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+
+ return TCL_RETURN;
+ }
+
+ /*
+ * Clear out the interpreter's result, since it may have been set
+ * by event handlers.
+ */
+
+ Tcl_ResetResult(interp);
+ if (!foundEvent) {
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_AppendResult(interp, "can't wait for variable \"", nameString,
+ "\": would wait forever", (char *) NULL);
+
+ rb_thread_critical = thr_crit_bup;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+ return TCL_OK;
+}
+
+
+/**************************/
+/* based on tkCmd.c */
+/**************************/
+#if TCL_MAJOR_VERSION >= 8
+static char *WaitVariableProc _((ClientData, Tcl_Interp *,
+ CONST84 char *,CONST84 char *, int));
+static char *
+WaitVariableProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ CONST84 char *name1; /* Name of variable. */
+ CONST84 char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#else /* TCL_MAJOR_VERSION < 8 */
+static char *WaitVariableProc _((ClientData, Tcl_Interp *,
+ char *, char *, int));
+static char *
+WaitVariableProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ char *name1; /* Name of variable. */
+ char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#endif
+{
+ int *donePtr = (int *) clientData;
+
+ *donePtr = 1;
+ return (char *) NULL;
+}
+
+static void WaitVisibilityProc _((ClientData, XEvent *));
+static void
+WaitVisibilityProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ XEvent *eventPtr; /* Information about event (not used). */
+{
+ int *donePtr = (int *) clientData;
+
+ if (eventPtr->type == VisibilityNotify) {
+ *donePtr = 1;
+ }
+ if (eventPtr->type == DestroyNotify) {
+ *donePtr = 2;
+ }
+}
+
+static void WaitWindowProc _((ClientData, XEvent *));
+static void
+WaitWindowProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ int *donePtr = (int *) clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ *donePtr = 1;
+ }
+}
+
+#if TCL_MAJOR_VERSION >= 8
+static int
+ip_rbTkWaitObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int
+ip_rbTkWaitCommand(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window window;
+ int done, index;
+ static CONST char *optionStrings[] = { "variable", "visibility", "window",
+ (char *) NULL };
+ enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
+ char *nameString;
+ int ret, dummy;
+ int thr_crit_bup;
+
+ DUMP1("Ruby's 'tkwait' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+#if 0
+ if (!rb_thread_alone()
+ && eventloop_thread != Qnil
+ && eventloop_thread != rb_thread_current()) {
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("call ip_rb_threadTkWaitObjCmd");
+ return ip_rb_threadTkWaitObjCmd((ClientData)tkwin, interp, objc, objv);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("call ip_rb_threadTkWaitCommand");
+ return ip_rb_threadTkWwaitCommand((ClientData)tkwin, interp, objc, objv);
+#endif
+ }
+#endif
+
+ Tcl_Preserve(interp);
+ Tcl_ResetResult(interp);
+
+ if (objc != 3) {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "variable|visibility|window name");
+#else
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ Tcl_GetStringFromObj(objv[0], &dummy),
+ " variable|visibility|window name\"",
+ (char *) NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ objv[0], " variable|visibility|window name\"",
+ (char *) NULL);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /*
+ if (Tcl_GetIndexFromObj(interp, objv[1],
+ (CONST84 char **)optionStrings,
+ "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_GetIndexFromObj(interp, objv[1],
+ (CONST84 char **)optionStrings,
+ "option", 0, &index);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+#else /* TCL_MAJOR_VERSION < 8 */
+ {
+ int c = objv[1][0];
+ size_t length = strlen(objv[1]);
+
+ if ((c == 'v') && (strncmp(objv[1], "variable", length) == 0)
+ && (length >= 2)) {
+ index = TKWAIT_VARIABLE;
+ } else if ((c == 'v') && (strncmp(objv[1], "visibility", length) == 0)
+ && (length >= 2)) {
+ index = TKWAIT_VISIBILITY;
+ } else if ((c == 'w') && (strncmp(objv[1], "window", length) == 0)) {
+ index = TKWAIT_WINDOW;
+ } else {
+ Tcl_AppendResult(interp, "bad option \"", objv[1],
+ "\": must be variable, visibility, or window",
+ (char *) NULL);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+ }
+#endif
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_IncrRefCount(objv[2]);
+ /* nameString = Tcl_GetString(objv[2]); */
+ nameString = Tcl_GetStringFromObj(objv[2], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[2];
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ switch ((enum options) index) {
+ case TKWAIT_VARIABLE:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ /*
+ if (Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ done = 0;
+ /* lib_eventloop_core(check_rootwidget_flag, 0, &done); */
+ lib_eventloop_launcher(check_rootwidget_flag, 0, &done, interp);
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_UntraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done);
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* exception check */
+ if (!NIL_P(rbtk_pending_exception)) {
+ Tcl_Release(interp);
+
+ /*
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)) {
+ */
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)
+ || rb_obj_is_kind_of(rbtk_pending_exception, rb_eInterrupt)) {
+ return TCL_RETURN;
+ } else{
+ return TCL_ERROR;
+ }
+ }
+
+ /* trap check */
+ if (rb_thread_check_trap_pending()) {
+ Tcl_Release(interp);
+
+ return TCL_RETURN;
+ }
+
+ break;
+
+ case TKWAIT_VISIBILITY:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* This function works on the Tk eventloop thread only. */
+ if (!tk_stubs_init_p() || Tk_MainWindow(interp) == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ }
+
+ if (window == NULL) {
+ Tcl_AppendResult(interp, ": tkwait: ",
+ "no main-window (not Tk application?)",
+ (char*)NULL);
+ rb_thread_critical = thr_crit_bup;
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ Tk_CreateEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ done = 0;
+ /* lib_eventloop_core(check_rootwidget_flag, 0, &done); */
+ lib_eventloop_launcher(check_rootwidget_flag, 0, &done, interp);
+
+ /* exception check */
+ if (!NIL_P(rbtk_pending_exception)) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(interp);
+
+ /*
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)) {
+ */
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)
+ || rb_obj_is_kind_of(rbtk_pending_exception, rb_eInterrupt)) {
+ return TCL_RETURN;
+ } else{
+ return TCL_ERROR;
+ }
+ }
+
+ /* trap check */
+ if (rb_thread_check_trap_pending()) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(interp);
+
+ return TCL_RETURN;
+ }
+
+ if (done != 1) {
+ /*
+ * Note that we do not delete the event handler because it
+ * was deleted automatically when the window was destroyed.
+ */
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", nameString,
+ "\" was deleted before its visibility changed",
+ (char *) NULL);
+
+ rb_thread_critical = thr_crit_bup;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ Tk_DeleteEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ break;
+
+ case TKWAIT_WINDOW:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* This function works on the Tk eventloop thread only. */
+ if (!tk_stubs_init_p() || Tk_MainWindow(interp) == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ if (window == NULL) {
+ Tcl_AppendResult(interp, ": tkwait: ",
+ "no main-window (not Tk application?)",
+ (char*)NULL);
+ rb_thread_critical = thr_crit_bup;
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ Tk_CreateEventHandler(window, StructureNotifyMask,
+ WaitWindowProc, (ClientData) &done);
+
+ rb_thread_critical = thr_crit_bup;
+
+ done = 0;
+ /* lib_eventloop_core(check_rootwidget_flag, 0, &done); */
+ lib_eventloop_launcher(check_rootwidget_flag, 0, &done, interp);
+
+ /* exception check */
+ if (!NIL_P(rbtk_pending_exception)) {
+ Tcl_Release(interp);
+
+ /*
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)) {
+ */
+ if (rb_obj_is_kind_of(rbtk_pending_exception, rb_eSystemExit)
+ || rb_obj_is_kind_of(rbtk_pending_exception, rb_eInterrupt)) {
+ return TCL_RETURN;
+ } else{
+ return TCL_ERROR;
+ }
+ }
+
+ /* trap check */
+ if (rb_thread_check_trap_pending()) {
+ Tcl_Release(interp);
+
+ return TCL_RETURN;
+ }
+
+ /*
+ * Note: there's no need to delete the event handler. It was
+ * deleted automatically when the window was destroyed.
+ */
+ break;
+ }
+
+ /*
+ * Clear out the interpreter's result, since it may have been set
+ * by event handlers.
+ */
+
+ Tcl_ResetResult(interp);
+ Tcl_Release(interp);
+ return TCL_OK;
+}
+
+/****************************/
+/* vwait/tkwait with thread */
+/****************************/
+struct th_vwait_param {
+ VALUE thread;
+ int done;
+};
+
+#if TCL_MAJOR_VERSION >= 8
+static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *,
+ CONST84 char *,CONST84 char *, int));
+static char *
+rb_threadVwaitProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ CONST84 char *name1; /* Name of variable. */
+ CONST84 char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#else /* TCL_MAJOR_VERSION < 8 */
+static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *,
+ char *, char *, int));
+static char *
+rb_threadVwaitProc(clientData, interp, name1, name2, flags)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp; /* Interpreter containing variable. */
+ char *name1; /* Name of variable. */
+ char *name2; /* Second part of variable name. */
+ int flags; /* Information about what happened. */
+#endif
+{
+ struct th_vwait_param *param = (struct th_vwait_param *) clientData;
+
+ if (flags & (TCL_INTERP_DESTROYED | TCL_TRACE_DESTROYED)) {
+ param->done = -1;
+ } else {
+ param->done = 1;
+ }
+ if (param->done != 0) rb_thread_wakeup(param->thread);
+
+ return (char *)NULL;
+}
+
+#define TKWAIT_MODE_VISIBILITY 1
+#define TKWAIT_MODE_DESTROY 2
+
+static void rb_threadWaitVisibilityProc _((ClientData, XEvent *));
+static void
+rb_threadWaitVisibilityProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ XEvent *eventPtr; /* Information about event (not used). */
+{
+ struct th_vwait_param *param = (struct th_vwait_param *) clientData;
+
+ if (eventPtr->type == VisibilityNotify) {
+ param->done = TKWAIT_MODE_VISIBILITY;
+ }
+ if (eventPtr->type == DestroyNotify) {
+ param->done = TKWAIT_MODE_DESTROY;
+ }
+ if (param->done != 0) rb_thread_wakeup(param->thread);
+}
+
+static void rb_threadWaitWindowProc _((ClientData, XEvent *));
+static void
+rb_threadWaitWindowProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to integer to set to 1. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ struct th_vwait_param *param = (struct th_vwait_param *) clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ param->done = TKWAIT_MODE_DESTROY;
+ }
+ if (param->done != 0) rb_thread_wakeup(param->thread);
+}
+
+#if TCL_MAJOR_VERSION >= 8
+static int
+ip_rb_threadVwaitObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int
+ip_rb_threadVwaitCommand(clientData, interp, objc, objv)
+ ClientData clientData; /* Not used */
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ struct th_vwait_param *param;
+ char *nameString;
+ int ret, dummy;
+ int thr_crit_bup;
+ volatile VALUE current_thread = rb_thread_current();
+ struct timeval t;
+
+ DUMP1("Ruby's 'thread_vwait' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+ if (rb_thread_alone() || eventloop_thread == current_thread) {
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("call ip_rbVwaitObjCmd");
+ return ip_rbVwaitObjCmd(clientData, interp, objc, objv);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("call ip_rbVwaitCommand");
+ return ip_rbVwaitCommand(clientData, interp, objc, objv);
+#endif
+ }
+
+ Tcl_Preserve(interp);
+ Tcl_ResetResult(interp);
+
+ if (objc != 2) {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "name");
+#else
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ /* nameString = Tcl_GetString(objv[0]); */
+ nameString = Tcl_GetStringFromObj(objv[0], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[0];
+#endif
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ nameString, " name\"", (char *) NULL);
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_IncrRefCount(objv[1]);
+ /* nameString = Tcl_GetString(objv[1]); */
+ nameString = Tcl_GetStringFromObj(objv[1], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[1];
+#endif
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* param = (struct th_vwait_param *)Tcl_Alloc(sizeof(struct th_vwait_param)); */
+ param = RbTk_ALLOC_N(struct th_vwait_param, 1);
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)param);
+#endif
+ param->thread = current_thread;
+ param->done = 0;
+
+ /*
+ if (Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ while(!param->done) {
+ /* rb_thread_stop(); */
+ /* rb_thread_sleep_forever(); */
+ rb_thread_wait_for(t);
+ if (NIL_P(eventloop_thread)) {
+ break;
+ }
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (param->done > 0) {
+ Tcl_UntraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param);
+ }
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[1]);
+#endif
+ Tcl_Release(interp);
+ return TCL_OK;
+}
+
+#if TCL_MAJOR_VERSION >= 8
+static int
+ip_rb_threadTkWaitObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int
+ip_rb_threadTkWaitCommand(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ struct th_vwait_param *param;
+ Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window window;
+ int index;
+ static CONST char *optionStrings[] = { "variable", "visibility", "window",
+ (char *) NULL };
+ enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
+ char *nameString;
+ int ret, dummy;
+ int thr_crit_bup;
+ volatile VALUE current_thread = rb_thread_current();
+ struct timeval t;
+
+ DUMP1("Ruby's 'thread_tkwait' is called");
+ if (interp == (Tcl_Interp*)NULL) {
+ rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError,
+ "IP is deleted");
+ return TCL_ERROR;
+ }
+
+ if (rb_thread_alone() || eventloop_thread == current_thread) {
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("call ip_rbTkWaitObjCmd");
+ 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");
+ return ip_rbTkWaitCommand(clientData, interp, objc, objv);
+#endif
+ }
+
+ Tcl_Preserve(interp);
+ Tcl_Preserve(tkwin);
+
+ Tcl_ResetResult(interp);
+
+ if (objc != 3) {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "variable|visibility|window name");
+#else
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ Tcl_GetStringFromObj(objv[0], &dummy),
+ " variable|visibility|window name\"",
+ (char *) NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ objv[0], " variable|visibility|window name\"",
+ (char *) NULL);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ /*
+ if (Tcl_GetIndexFromObj(interp, objv[1],
+ (CONST84 char **)optionStrings,
+ "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_GetIndexFromObj(interp, objv[1],
+ (CONST84 char **)optionStrings,
+ "option", 0, &index);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+#else /* TCL_MAJOR_VERSION < 8 */
+ {
+ int c = objv[1][0];
+ size_t length = strlen(objv[1]);
+
+ if ((c == 'v') && (strncmp(objv[1], "variable", length) == 0)
+ && (length >= 2)) {
+ index = TKWAIT_VARIABLE;
+ } else if ((c == 'v') && (strncmp(objv[1], "visibility", length) == 0)
+ && (length >= 2)) {
+ index = TKWAIT_VISIBILITY;
+ } else if ((c == 'w') && (strncmp(objv[1], "window", length) == 0)) {
+ index = TKWAIT_WINDOW;
+ } else {
+ Tcl_AppendResult(interp, "bad option \"", objv[1],
+ "\": must be variable, visibility, or window",
+ (char *) NULL);
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+ }
+#endif
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_IncrRefCount(objv[2]);
+ /* nameString = Tcl_GetString(objv[2]); */
+ nameString = Tcl_GetStringFromObj(objv[2], &dummy);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[2];
+#endif
+
+ /* param = (struct th_vwait_param *)Tcl_Alloc(sizeof(struct th_vwait_param)); */
+ param = RbTk_ALLOC_N(struct th_vwait_param, 1);
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)param);
+#endif
+ param->thread = current_thread;
+ param->done = 0;
+
+ rb_thread_critical = thr_crit_bup;
+
+ switch ((enum options) index) {
+ case TKWAIT_VARIABLE:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ /*
+ if (Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ */
+ ret = Tcl_TraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param);
+
+ rb_thread_critical = thr_crit_bup;
+
+ if (ret != TCL_OK) {
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release(param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ while(!param->done) {
+ /* rb_thread_stop(); */
+ /* rb_thread_sleep_forever(); */
+ rb_thread_wait_for(t);
+ if (NIL_P(eventloop_thread)) {
+ break;
+ }
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (param->done > 0) {
+ Tcl_UntraceVar(interp, nameString,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ rb_threadVwaitProc, (ClientData) param);
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ break;
+
+ case TKWAIT_VISIBILITY:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if 0 /* variable 'tkwin' must keep the token of MainWindow */
+ if (!tk_stubs_init_p() || Tk_MainWindow(interp) == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ }
+#else
+ if (!tk_stubs_init_p() || tkwin == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ /* Tk_NameToWindow() returns right token on non-eventloop thread */
+ Tcl_CmdInfo info;
+ if (Tcl_GetCommandInfo(interp, ".", &info)) { /* check root */
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ } else {
+ window = NULL;
+ }
+ }
+#endif
+
+ if (window == NULL) {
+ Tcl_AppendResult(interp, ": thread_tkwait: ",
+ "no main-window (not Tk application?)",
+ (char*)NULL);
+
+ rb_thread_critical = thr_crit_bup;
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release(param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+ Tcl_Preserve(window);
+
+ Tk_CreateEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ rb_threadWaitVisibilityProc, (ClientData) param);
+
+ rb_thread_critical = thr_crit_bup;
+
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ while(param->done != TKWAIT_MODE_VISIBILITY) {
+ if (param->done == TKWAIT_MODE_DESTROY) break;
+ /* rb_thread_stop(); */
+ /* rb_thread_sleep_forever(); */
+ rb_thread_wait_for(t);
+ if (NIL_P(eventloop_thread)) {
+ break;
+ }
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* when a window is destroyed, no need to call Tk_DeleteEventHandler */
+ if (param->done != TKWAIT_MODE_DESTROY) {
+ Tk_DeleteEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ rb_threadWaitVisibilityProc,
+ (ClientData) param);
+ }
+
+ if (param->done != 1) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", nameString,
+ "\" was deleted before its visibility changed",
+ (char *) NULL);
+
+ rb_thread_critical = thr_crit_bup;
+
+ Tcl_Release(window);
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release(param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ Tcl_Release(window);
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ break;
+
+ case TKWAIT_WINDOW:
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if 0 /* variable 'tkwin' must keep the token of MainWindow */
+ if (!tk_stubs_init_p() || Tk_MainWindow(interp) == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ }
+#else
+ if (!tk_stubs_init_p() || tkwin == (Tk_Window)NULL) {
+ window = NULL;
+ } else {
+ /* Tk_NameToWindow() returns right token on non-eventloop thread */
+ Tcl_CmdInfo info;
+ if (Tcl_GetCommandInfo(interp, ".", &info)) { /* check root */
+ window = Tk_NameToWindow(interp, nameString, tkwin);
+ } else {
+ window = NULL;
+ }
+ }
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[2]);
+#endif
+
+ if (window == NULL) {
+ Tcl_AppendResult(interp, ": thread_tkwait: ",
+ "no main-window (not Tk application?)",
+ (char*)NULL);
+
+ rb_thread_critical = thr_crit_bup;
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release(param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_ERROR;
+ }
+
+ Tcl_Preserve(window);
+
+ Tk_CreateEventHandler(window, StructureNotifyMask,
+ rb_threadWaitWindowProc, (ClientData) param);
+
+ rb_thread_critical = thr_crit_bup;
+
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ while(param->done != TKWAIT_MODE_DESTROY) {
+ /* rb_thread_stop(); */
+ /* rb_thread_sleep_forever(); */
+ rb_thread_wait_for(t);
+ if (NIL_P(eventloop_thread)) {
+ break;
+ }
+ }
+
+ Tcl_Release(window);
+
+ /* when a window is destroyed, no need to call Tk_DeleteEventHandler
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ Tk_DeleteEventHandler(window, StructureNotifyMask,
+ rb_threadWaitWindowProc, (ClientData) param);
+
+ rb_thread_critical = thr_crit_bup;
+ */
+
+ break;
+ } /* end of 'switch' statement */
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)param, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 1 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)param);
+#else
+ /* Tcl_Free((char *)param); */
+ ckfree((char *)param);
+#endif
+#endif
+
+ /*
+ * Clear out the interpreter's result, since it may have been set
+ * by event handlers.
+ */
+
+ Tcl_ResetResult(interp);
+
+ Tcl_Release(tkwin);
+ Tcl_Release(interp);
+ return TCL_OK;
+}
+
+static VALUE
+ip_thread_vwait(self, var)
+ VALUE self;
+ VALUE var;
+{
+ VALUE argv[2];
+ volatile VALUE cmd_str = rb_str_new2("thread_vwait");
+
+ argv[0] = cmd_str;
+ argv[1] = var;
+
+ return ip_invoke_with_position(2, argv, self, TCL_QUEUE_TAIL);
+}
+
+static VALUE
+ip_thread_tkwait(self, mode, target)
+ VALUE self;
+ VALUE mode;
+ VALUE target;
+{
+ VALUE argv[3];
+ volatile VALUE cmd_str = rb_str_new2("thread_tkwait");
+
+ argv[0] = cmd_str;
+ argv[1] = mode;
+ argv[2] = target;
+
+ return ip_invoke_with_position(3, argv, self, TCL_QUEUE_TAIL);
+}
+
+
+/* delete slave interpreters */
+#if TCL_MAJOR_VERSION >= 8
+static void
+delete_slaves(ip)
+ Tcl_Interp *ip;
+{
+ int thr_crit_bup;
+ Tcl_Interp *slave;
+ Tcl_Obj *slave_list, *elem;
+ char *slave_name;
+ int i, len;
+
+ DUMP1("delete slaves");
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (!Tcl_InterpDeleted(ip) && Tcl_Eval(ip, "interp slaves") == TCL_OK) {
+ slave_list = Tcl_GetObjResult(ip);
+ Tcl_IncrRefCount(slave_list);
+
+ if (Tcl_ListObjLength((Tcl_Interp*)NULL, slave_list, &len) == TCL_OK) {
+ for(i = 0; i < len; i++) {
+ Tcl_ListObjIndex((Tcl_Interp*)NULL, slave_list, i, &elem);
+
+ if (elem == (Tcl_Obj*)NULL) continue;
+
+ Tcl_IncrRefCount(elem);
+
+ /* get slave */
+ /* slave_name = Tcl_GetString(elem); */
+ slave_name = Tcl_GetStringFromObj(elem, (int*)NULL);
+ DUMP2("delete slave:'%s'", slave_name);
+
+ Tcl_DecrRefCount(elem);
+
+ slave = Tcl_GetSlave(ip, slave_name);
+ if (slave == (Tcl_Interp*)NULL) continue;
+
+ if (!Tcl_InterpDeleted(slave)) {
+ /* call ip_finalize */
+ ip_finalize(slave);
+
+ Tcl_DeleteInterp(slave);
+ /* Tcl_Release(slave); */
+ }
+ }
+ }
+
+ Tcl_DecrRefCount(slave_list);
+ }
+
+ rb_thread_critical = thr_crit_bup;
+}
+#else /* TCL_MAJOR_VERSION < 8 */
+static void
+delete_slaves(ip)
+ Tcl_Interp *ip;
+{
+ int thr_crit_bup;
+ Tcl_Interp *slave;
+ int argc;
+ char **argv;
+ char *slave_list;
+ char *slave_name;
+ int i, len;
+
+ DUMP1("delete slaves");
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (!Tcl_InterpDeleted(ip) && Tcl_Eval(ip, "interp slaves") == TCL_OK) {
+ slave_list = ip->result;
+ if (Tcl_SplitList((Tcl_Interp*)NULL,
+ slave_list, &argc, &argv) == TCL_OK) {
+ for(i = 0; i < argc; i++) {
+ slave_name = argv[i];
+
+ DUMP2("delete slave:'%s'", slave_name);
+
+ slave = Tcl_GetSlave(ip, slave_name);
+ if (slave == (Tcl_Interp*)NULL) continue;
+
+ if (!Tcl_InterpDeleted(slave)) {
+ /* call ip_finalize */
+ ip_finalize(slave);
+
+ Tcl_DeleteInterp(slave);
+ }
+ }
+ }
+ }
+
+ rb_thread_critical = thr_crit_bup;
+}
+#endif
+
+
+/* finalize operation */
+static void
+#ifdef HAVE_PROTOTYPES
+lib_mark_at_exit(VALUE self)
+#else
+lib_mark_at_exit(self)
+ VALUE self;
+#endif
+{
+ at_exit = 1;
+}
+
+static int
+#if TCL_MAJOR_VERSION >= 8
+#ifdef HAVE_PROTOTYPES
+ip_null_proc(ClientData clientData, Tcl_Interp *interp,
+ int argc, Tcl_Obj *CONST argv[])
+#else
+ip_null_proc(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ Tcl_Obj *CONST argv[];
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+#ifdef HAVE_PROTOTYPES
+ip_null_proc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
+#else
+ip_null_proc(clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+#endif
+#endif
+{
+ Tcl_ResetResult(interp);
+ return TCL_OK;
+}
+
+static void
+ip_finalize(ip)
+ Tcl_Interp *ip;
+{
+ Tcl_CmdInfo info;
+ int thr_crit_bup;
+
+ VALUE rb_debug_bup, rb_verbose_bup;
+ /* When ruby is exiting, printing debug messages in some callback
+ operations from Tcl-IP sometimes cause SEGV. I don't know the
+ reason. But I got SEGV when calling "rb_io_write(rb_stdout, ...)".
+ So, in some part of this function, debug mode and verbose mode
+ are disabled. If you know the reason, please fix it.
+ -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) */
+
+ DUMP1("start ip_finalize");
+
+ if (ip == (Tcl_Interp*)NULL) {
+ DUMP1("ip is NULL");
+ return;
+ }
+
+ if (Tcl_InterpDeleted(ip)) {
+ DUMP2("ip(%p) is already deleted", ip);
+ return;
+ }
+
+#if TCL_NAMESPACE_DEBUG
+ if (ip_null_namespace(ip)) {
+ DUMP2("ip(%p) has null namespace", ip);
+ return;
+ }
+#endif
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ rb_debug_bup = ruby_debug;
+ rb_verbose_bup = ruby_verbose;
+
+ Tcl_Preserve(ip);
+
+ /* delete slaves */
+ delete_slaves(ip);
+
+ /* shut off some connections from Tcl-proc to Ruby */
+ if (at_exit) {
+ /* NOTE: Only when at exit.
+ Because, ruby removes objects, which depends on the deleted
+ interpreter, on some callback operations.
+ It is important for GC. */
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_CreateObjCommand(ip, "ruby", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(ip, "ruby_eval", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(ip, "ruby_cmd", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_CreateCommand(ip, "ruby", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateCommand(ip, "ruby_eval", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateCommand(ip, "ruby_cmd", ip_null_proc,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#endif
+ /*
+ rb_thread_critical = thr_crit_bup;
+ return;
+ */
+ }
+
+ /* delete root widget */
+#ifdef RUBY_VM
+ /* cause SEGV on Ruby 1.9 */
+#else
+ DUMP1("check `destroy'");
+ if (Tcl_GetCommandInfo(ip, "destroy", &info)) {
+ DUMP1("call `destroy .'");
+ Tcl_GlobalEval(ip, "catch {destroy .}");
+ }
+#endif
+#if 1
+ DUMP1("destroy root widget");
+ if (tk_stubs_init_p() && Tk_MainWindow(ip) != (Tk_Window)NULL) {
+ /*
+ * On Ruby VM, this code piece may be not called, because
+ * Tk_MainWindow() returns NULL on a native thread except
+ * the thread which initialize Tk environment.
+ * Of course, that is a problem. But maybe not so serious.
+ * All widgets are destroyed when the Tcl interp is deleted.
+ * At then, Ruby may raise exceptions on the delete hook
+ * callbacks which registered for the deleted widgets, and
+ * may fail to clear objects which depends on the widgets.
+ * Although it is the problem, it is possibly avoidable by
+ * rescuing exceptions and the finalize hook of the interp.
+ */
+ Tk_Window win = Tk_MainWindow(ip);
+
+ DUMP1("call Tk_DestroyWindow");
+ ruby_debug = Qfalse;
+ ruby_verbose = Qnil;
+ if (! (((Tk_FakeWin*)win)->flags & TK_ALREADY_DEAD)) {
+ Tk_DestroyWindow(win);
+ }
+ ruby_debug = rb_debug_bup;
+ ruby_verbose = rb_verbose_bup;
+ }
+#endif
+
+ /* call finalize-hook-proc */
+ DUMP1("check `finalize-hook-proc'");
+ if ( Tcl_GetCommandInfo(ip, finalize_hook_name, &info)) {
+ DUMP2("call finalize hook proc '%s'", finalize_hook_name);
+ ruby_debug = Qfalse;
+ ruby_verbose = Qnil;
+ Tcl_GlobalEval(ip, finalize_hook_name);
+ ruby_debug = rb_debug_bup;
+ ruby_verbose = rb_verbose_bup;
+ }
+
+ DUMP1("check `foreach' & `after'");
+ if ( Tcl_GetCommandInfo(ip, "foreach", &info)
+ && Tcl_GetCommandInfo(ip, "after", &info) ) {
+ DUMP1("cancel after callbacks");
+ ruby_debug = Qfalse;
+ ruby_verbose = Qnil;
+ Tcl_GlobalEval(ip, "catch {foreach id [after info] {after cancel $id}}");
+ ruby_debug = rb_debug_bup;
+ ruby_verbose = rb_verbose_bup;
+ }
+
+ Tcl_Release(ip);
+
+ DUMP1("finish ip_finalize");
+ ruby_debug = rb_debug_bup;
+ ruby_verbose = rb_verbose_bup;
+ rb_thread_critical = thr_crit_bup;
+}
+
+
+/* destroy interpreter */
+static void
+ip_free(ptr)
+ struct tcltkip *ptr;
+{
+ int thr_crit_bup;
+
+ DUMP2("free Tcl Interp %p", ptr->ip);
+ if (ptr) {
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if ( ptr->ip != (Tcl_Interp*)NULL
+ && !Tcl_InterpDeleted(ptr->ip)
+ && Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL
+ && !Tcl_InterpDeleted(Tcl_GetMaster(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;
+ return;
+ }
+
+ if (ptr->ip == (Tcl_Interp*)NULL) {
+ DUMP1("ip_free is called for deleted IP");
+ xfree(ptr);
+ /* ckfree((char*)ptr); */
+ rb_thread_critical = thr_crit_bup;
+ return;
+ }
+
+ if (!Tcl_InterpDeleted(ptr->ip)) {
+ ip_finalize(ptr->ip);
+
+ Tcl_DeleteInterp(ptr->ip);
+ Tcl_Release(ptr->ip);
+ }
+
+ ptr->ip = (Tcl_Interp*)NULL;
+ xfree(ptr);
+ /* ckfree((char*)ptr); */
+
+ rb_thread_critical = thr_crit_bup;
+ }
+
+ DUMP1("complete freeing Tcl Interp");
+}
+
+
+/* create and initialize interpreter */
+static VALUE ip_alloc _((VALUE));
+static VALUE
+ip_alloc(self)
+ VALUE self;
+{
+ return Data_Wrap_Struct(self, 0, ip_free, 0);
+}
+
+static void
+ip_replace_wait_commands(interp, mainWin)
+ Tcl_Interp *interp;
+ Tk_Window mainWin;
+{
+ /* replace 'vwait' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"vwait\")");
+ Tcl_CreateObjCommand(interp, "vwait", ip_rbVwaitObjCmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"vwait\")");
+ Tcl_CreateCommand(interp, "vwait", ip_rbVwaitCommand,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* replace 'tkwait' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"tkwait\")");
+ Tcl_CreateObjCommand(interp, "tkwait", ip_rbTkWaitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"tkwait\")");
+ Tcl_CreateCommand(interp, "tkwait", ip_rbTkWaitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* add 'thread_vwait' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"thread_vwait\")");
+ Tcl_CreateObjCommand(interp, "thread_vwait", ip_rb_threadVwaitObjCmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"thread_vwait\")");
+ Tcl_CreateCommand(interp, "thread_vwait", ip_rb_threadVwaitCommand,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* add 'thread_tkwait' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"thread_tkwait\")");
+ Tcl_CreateObjCommand(interp, "thread_tkwait", ip_rb_threadTkWaitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"thread_tkwait\")");
+ Tcl_CreateCommand(interp, "thread_tkwait", ip_rb_threadTkWaitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* replace 'update' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"update\")");
+ Tcl_CreateObjCommand(interp, "update", ip_rbUpdateObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"update\")");
+ Tcl_CreateCommand(interp, "update", ip_rbUpdateCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* add 'thread_update' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"thread_update\")");
+ Tcl_CreateObjCommand(interp, "thread_update", ip_rb_threadUpdateObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"thread_update\")");
+ Tcl_CreateCommand(interp, "thread_update", ip_rb_threadUpdateCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+}
+
+
+#if TCL_MAJOR_VERSION >= 8
+static int
+ip_rb_replaceSlaveTkCmdsObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+#else /* TCL_MAJOR_VERSION < 8 */
+static int
+ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ char *objv[];
+#endif
+{
+ char *slave_name;
+ Tcl_Interp *slave;
+ Tk_Window mainWin;
+
+ if (objc != 2) {
+#ifdef Tcl_WrongNumArgs
+ Tcl_WrongNumArgs(interp, 1, objv, "slave_name");
+#else
+ char *nameString;
+#if TCL_MAJOR_VERSION >= 8
+ nameString = Tcl_GetStringFromObj(objv[0], (int*)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ nameString = objv[0];
+#endif
+ Tcl_AppendResult(interp, "wrong number of arguments: should be \"",
+ nameString, " slave_name\"", (char *) NULL);
+#endif
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+ slave_name = Tcl_GetStringFromObj(objv[1], (int*)NULL);
+#else
+ slave_name = objv[1];
+#endif
+
+ slave = Tcl_GetSlave(interp, slave_name);
+ if (slave == NULL) {
+ Tcl_AppendResult(interp, "cannot find slave \"",
+ slave_name, "\"", (char *)NULL);
+ return TCL_ERROR;
+ }
+ mainWin = Tk_MainWindow(slave);
+
+ /* replace 'exit' command --> 'interp_exit' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateObjCommand(slave, "exit", ip_InterpExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateCommand(slave, "exit", ip_InterpExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* replace vwait and tkwait */
+ ip_replace_wait_commands(slave, mainWin);
+
+ return TCL_OK;
+}
+
+
+#if TCL_MAJOR_VERSION >= 8
+static int ip_rbNamespaceObjCmd _((ClientData, Tcl_Interp *, int,
+ Tcl_Obj *CONST []));
+static int
+ip_rbNamespaceObjCmd(clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ Tcl_CmdInfo info;
+ int ret;
+
+ if (!Tcl_GetCommandInfo(interp, "__orig_namespace_command__", &(info))) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp,
+ "invalid command name \"namespace\"", (char*)NULL);
+ return TCL_ERROR;
+ }
+
+ rbtk_eventloop_depth++;
+ /* DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth); */
+
+ if (info.isNativeObjectProc) {
+ ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
+ } else {
+ /* string interface */
+ int i;
+ char **argv;
+
+ /* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
+ argv = RbTk_ALLOC_N(char *, (objc + 1));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+
+ for(i = 0; i < objc; i++) {
+ /* argv[i] = Tcl_GetString(objv[i]); */
+ argv[i] = Tcl_GetStringFromObj(objv[i], (int*)NULL);
+ }
+ argv[objc] = (char *)NULL;
+
+ ret = (*(info.proc))(info.clientData, interp,
+ objc, (CONST84 char **)argv);
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* Tcl_Free((char*)argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+ }
+
+ /* DUMP2("namespace wrapper exit depth == %d", rbtk_eventloop_depth); */
+ rbtk_eventloop_depth--;
+
+ return ret;
+}
+#endif
+
+static void
+ip_wrap_namespace_command(interp)
+ Tcl_Interp *interp;
+{
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_CmdInfo orig_info;
+
+ if (!Tcl_GetCommandInfo(interp, "namespace", &(orig_info))) {
+ return;
+ }
+
+ if (orig_info.isNativeObjectProc) {
+ Tcl_CreateObjCommand(interp, "__orig_namespace_command__",
+ orig_info.objProc, orig_info.objClientData,
+ orig_info.deleteProc);
+ } else {
+ Tcl_CreateCommand(interp, "__orig_namespace_command__",
+ orig_info.proc, orig_info.clientData,
+ orig_info.deleteProc);
+ }
+
+ Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *)NULL);
+#endif
+}
+
+
+/* call when interpreter is deleted */
+static void
+#ifdef HAVE_PROTOTYPES
+ip_CallWhenDeleted(ClientData clientData, Tcl_Interp *ip)
+#else
+ip_CallWhenDeleted(clientData, ip)
+ ClientData clientData;
+ Tcl_Interp *ip;
+#endif
+{
+ int thr_crit_bup;
+ /* Tk_Window main_win = (Tk_Window) clientData; */
+
+ DUMP1("start ip_CallWhenDeleted");
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ ip_finalize(ip);
+
+ DUMP1("finish ip_CallWhenDeleted");
+ rb_thread_critical = thr_crit_bup;
+}
+
+/*--------------------------------------------------------*/
+
+/* initialize interpreter */
+static VALUE
+ip_init(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct tcltkip *ptr; /* tcltkip data struct */
+ VALUE argv0, opts;
+ int cnt;
+ int st;
+ 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);
+ ptr = ALLOC(struct tcltkip);
+ /* ptr = RbTk_ALLOC_N(struct tcltkip, 1); */
+ DATA_PTR(self) = ptr;
+#ifdef RUBY_USE_NATIVE_THREAD
+ ptr->tk_thread_id = 0;
+#endif
+ ptr->ref_count = 0;
+ ptr->allow_ruby_exit = 1;
+ ptr->return_value = 0;
+
+ /* from Tk_Main() */
+ DUMP1("Tcl_CreateInterp");
+ ptr->ip = ruby_tcl_create_ip_and_stubs_init(&st);
+ if (ptr->ip == NULL) {
+ switch(st) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_TCL_DLL:
+ rb_raise(rb_eLoadError, "tcltklib: fail to open tcl_dll");
+ case NO_FindExecutable:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_FindExecutable");
+ case NO_CreateInterp:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_CreateInterp()");
+ case NO_DeleteInterp:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_DeleteInterp()");
+ case FAIL_CreateInterp:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to create a new IP");
+ case FAIL_Tcl_InitStubs:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to Tcl_InitStubs()");
+ default:
+ rb_raise(rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tcl_create_ip_and_stubs_init", st);
+ }
+ }
+
+#if TCL_MAJOR_VERSION >= 8
+#if TCL_NAMESPACE_DEBUG
+ DUMP1("get current namespace");
+ if ((ptr->default_ns = Tcl_GetCurrentNamespace(ptr->ip))
+ == (Tcl_Namespace*)NULL) {
+ rb_raise(rb_eRuntimeError, "a new Tk interpreter has a NULL namespace");
+ }
+#endif
+#endif
+
+ rbtk_preserve_ip(ptr);
+ DUMP2("IP ref_count = %d", ptr->ref_count);
+ current_interp = ptr->ip;
+
+ ptr->has_orig_exit
+ = Tcl_GetCommandInfo(ptr->ip, "exit", &(ptr->orig_exit_info));
+
+#if defined CREATE_RUBYTK_KIT || defined CREATE_RUBYKIT
+ call_tclkit_init_script(current_interp);
+
+# if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION > 84
+ {
+ Tcl_DString encodingName;
+ Tcl_GetEncodingNameFromEnvironment(&encodingName);
+ if (strcmp(Tcl_DStringValue(&encodingName), Tcl_GetEncodingName(NULL))) {
+ /* fails, so we set a variable and do it in the boot.tcl script */
+ Tcl_SetSystemEncoding(NULL, Tcl_DStringValue(&encodingName));
+ }
+ Tcl_SetVar(current_interp, "tclkit_system_encoding", Tcl_DStringValue(&encodingName), 0);
+ Tcl_DStringFree(&encodingName);
+ }
+# endif
+#endif
+
+ /* set variables */
+ Tcl_Eval(ptr->ip, "set argc 0; set argv {}; set argv0 tcltklib.so");
+
+ cnt = rb_scan_args(argc, argv, "02", &argv0, &opts);
+ switch(cnt) {
+ case 2:
+ /* options */
+ if (NIL_P(opts) || opts == Qfalse) {
+ /* without Tk */
+ with_tk = 0;
+ } else {
+ /* Tcl_SetVar(ptr->ip, "argv", StringValuePtr(opts), 0); */
+ Tcl_SetVar(ptr->ip, "argv", StringValuePtr(opts), TCL_GLOBAL_ONLY);
+ Tcl_Eval(ptr->ip, "set argc [llength $argv]");
+ }
+ case 1:
+ /* argv0 */
+ if (!NIL_P(argv0)) {
+ if (strncmp(StringValuePtr(argv0), "-e", 3) == 0
+ || strncmp(StringValuePtr(argv0), "-", 2) == 0) {
+ Tcl_SetVar(ptr->ip, "argv0", "ruby", TCL_GLOBAL_ONLY);
+ } else {
+ /* Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), 0); */
+ Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0),
+ TCL_GLOBAL_ONLY);
+ }
+ }
+ case 0:
+ /* no args */
+ ;
+ }
+
+ /* from Tcl_AppInit() */
+ DUMP1("Tcl_Init");
+#if (defined CREATE_RUBYTK_KIT || defined CREATE_RUBYKIT) && (!defined KIT_LITE) && (10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION == 85)
+ /*************************************************************************/
+ /* 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 temporarily hiding ::chan. */
+ /*************************************************************************/
+ Tcl_Eval(ptr->ip, "catch {rename ::chan ::_tmp_chan}");
+ if (Tcl_Init(ptr->ip) == TCL_ERROR) {
+ rb_raise(rb_eRuntimeError, "%s", Tcl_GetStringResult(ptr->ip));
+ }
+ Tcl_Eval(ptr->ip, "catch {rename ::_tmp_chan ::chan}");
+#else
+ if (Tcl_Init(ptr->ip) == TCL_ERROR) {
+ rb_raise(rb_eRuntimeError, "%s", Tcl_GetStringResult(ptr->ip));
+ }
+#endif
+
+ st = ruby_tcl_stubs_init();
+ /* from Tcl_AppInit() */
+ if (with_tk) {
+ DUMP1("Tk_Init");
+ st = ruby_tk_stubs_init(ptr->ip);
+ switch(st) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_Tk_Init:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tk_Init()");
+ case FAIL_Tk_Init:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_Init(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ case FAIL_Tk_InitStubs:
+ rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_InitStubs(). %s",
+ Tcl_GetStringResult(ptr->ip));
+ default:
+ rb_raise(rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tk_stubs_init", st);
+ }
+
+ DUMP1("Tcl_StaticPackage(\"Tk\")");
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_StaticPackage(ptr->ip, "Tk", Tk_Init, Tk_SafeInit);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_StaticPackage(ptr->ip, "Tk", Tk_Init,
+ (Tcl_PackageInitProc *) NULL);
+#endif
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ /* set Tk thread ID */
+ ptr->tk_thread_id = Tcl_GetCurrentThread();
+#endif
+ /* get main window */
+ mainWin = Tk_MainWindow(ptr->ip);
+ Tk_Preserve((ClientData)mainWin);
+ }
+
+ /* add ruby command to the interpreter */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"ruby\")");
+ Tcl_CreateObjCommand(ptr->ip, "ruby", ip_ruby_eval, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateObjCommand(\"ruby_eval\")");
+ Tcl_CreateObjCommand(ptr->ip, "ruby_eval", ip_ruby_eval, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateObjCommand(\"ruby_cmd\")");
+ Tcl_CreateObjCommand(ptr->ip, "ruby_cmd", ip_ruby_cmd, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"ruby\")");
+ Tcl_CreateCommand(ptr->ip, "ruby", ip_ruby_eval, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateCommand(\"ruby_eval\")");
+ Tcl_CreateCommand(ptr->ip, "ruby_eval", ip_ruby_eval, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateCommand(\"ruby_cmd\")");
+ Tcl_CreateCommand(ptr->ip, "ruby_cmd", ip_ruby_cmd, (ClientData)NULL,
+ (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* add 'interp_exit', 'ruby_exit' and replace 'exit' command */
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"interp_exit\")");
+ Tcl_CreateObjCommand(ptr->ip, "interp_exit", ip_InterpExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateObjCommand(\"ruby_exit\")");
+ Tcl_CreateObjCommand(ptr->ip, "ruby_exit", ip_RubyExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"ruby_exit\"");
+ Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"interp_exit\")");
+ Tcl_CreateCommand(ptr->ip, "interp_exit", ip_InterpExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateCommand(\"ruby_exit\")");
+ Tcl_CreateCommand(ptr->ip, "ruby_exit", ip_RubyExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"ruby_exit\"");
+ Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* replace vwait and tkwait */
+ ip_replace_wait_commands(ptr->ip, mainWin);
+
+ /* wrap namespace command */
+ ip_wrap_namespace_command(ptr->ip);
+
+ /* define command to replace commands which depend on slave's MainWindow */
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_CreateObjCommand(ptr->ip, "__replace_slave_tk_commands__",
+ ip_rb_replaceSlaveTkCmdsObjCmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_CreateCommand(ptr->ip, "__replace_slave_tk_commands__",
+ ip_rb_replaceSlaveTkCmdsCommand,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* set finalizer */
+ Tcl_CallWhenDeleted(ptr->ip, ip_CallWhenDeleted, (ClientData)mainWin);
+
+ if (mainWin != (Tk_Window)NULL) {
+ Tk_Release((ClientData)mainWin);
+ }
+
+ return self;
+}
+
+static VALUE
+ip_create_slave_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ VALUE *argv;
+{
+ struct tcltkip *master = get_ip(interp);
+ struct tcltkip *slave = ALLOC(struct tcltkip);
+ /* struct tcltkip *slave = RbTk_ALLOC_N(struct tcltkip, 1); */
+ VALUE safemode;
+ VALUE name;
+ int safe;
+ int thr_crit_bup;
+ Tk_Window mainWin;
+
+ /* ip is deleted? */
+ if (deleted_ip(master)) {
+ return rb_exc_new2(rb_eRuntimeError,
+ "deleted master cannot create a new slave");
+ }
+
+ name = argv[0];
+ safemode = argv[1];
+
+ if (Tcl_IsSafe(master->ip) == 1) {
+ safe = 1;
+ } else if (safemode == Qfalse || NIL_P(safemode)) {
+ safe = 0;
+ } else {
+ safe = 1;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if 0
+ /* init Tk */
+ if (RTEST(with_tk)) {
+ volatile VALUE exc;
+ if (!tk_stubs_init_p()) {
+ exc = tcltkip_init_tk(interp);
+ if (!NIL_P(exc)) {
+ rb_thread_critical = thr_crit_bup;
+ return exc;
+ }
+ }
+ }
+#endif
+
+ /* create slave-ip */
+#ifdef RUBY_USE_NATIVE_THREAD
+ /* slave->tk_thread_id = 0; */
+ slave->tk_thread_id = master->tk_thread_id; /* == current thread */
+#endif
+ slave->ref_count = 0;
+ slave->allow_ruby_exit = 0;
+ slave->return_value = 0;
+
+ slave->ip = Tcl_CreateSlave(master->ip, StringValuePtr(name), safe);
+ if (slave->ip == NULL) {
+ rb_thread_critical = thr_crit_bup;
+ return rb_exc_new2(rb_eRuntimeError,
+ "fail to create the new slave interpreter");
+ }
+#if TCL_MAJOR_VERSION >= 8
+#if TCL_NAMESPACE_DEBUG
+ slave->default_ns = Tcl_GetCurrentNamespace(slave->ip);
+#endif
+#endif
+ rbtk_preserve_ip(slave);
+
+ slave->has_orig_exit
+ = Tcl_GetCommandInfo(slave->ip, "exit", &(slave->orig_exit_info));
+
+ /* replace 'exit' command --> 'interp_exit' command */
+ mainWin = (tk_stubs_init_p())? Tk_MainWindow(slave->ip): (Tk_Window)NULL;
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateObjCommand(slave->ip, "exit", ip_InterpExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateCommand(slave->ip, "exit", ip_InterpExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* replace vwait and tkwait */
+ ip_replace_wait_commands(slave->ip, mainWin);
+
+ /* wrap namespace command */
+ ip_wrap_namespace_command(slave->ip);
+
+ /* define command to replace cmds which depend on slave-slave's MainWin */
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_CreateObjCommand(slave->ip, "__replace_slave_tk_commands__",
+ ip_rb_replaceSlaveTkCmdsObjCmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ Tcl_CreateCommand(slave->ip, "__replace_slave_tk_commands__",
+ ip_rb_replaceSlaveTkCmdsCommand,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ /* set finalizer */
+ Tcl_CallWhenDeleted(slave->ip, ip_CallWhenDeleted, (ClientData)mainWin);
+
+ rb_thread_critical = thr_crit_bup;
+
+ return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave);
+}
+
+static VALUE
+ip_create_slave(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct tcltkip *master = get_ip(self);
+ VALUE safemode;
+ VALUE name;
+ VALUE callargv[2];
+
+ /* ip is deleted? */
+ if (deleted_ip(master)) {
+ rb_raise(rb_eRuntimeError,
+ "deleted master cannot create a new slave interpreter");
+ }
+
+ /* argument check */
+ if (rb_scan_args(argc, argv, "11", &name, &safemode) == 1) {
+ safemode = Qfalse;
+ }
+ if (Tcl_IsSafe(master->ip) != 1
+ && (safemode == Qfalse || NIL_P(safemode))) {
+ }
+
+ StringValue(name);
+ callargv[0] = name;
+ callargv[1] = safemode;
+
+ return tk_funcall(ip_create_slave_core, 2, callargv, self);
+}
+
+
+/* self is slave of master? */
+static VALUE
+ip_is_slave_of_p(self, master)
+ VALUE self, master;
+{
+ if (!rb_obj_is_kind_of(master, tcltkip_class)) {
+ rb_raise(rb_eArgError, "expected TclTkIp object");
+ }
+
+ if (Tcl_GetMaster(get_ip(self)->ip) == get_ip(master)->ip) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+
+/* create console (if supported) */
+#if defined(MAC_TCL) || defined(__WIN32__)
+#if TCL_MAJOR_VERSION < 8 \
+ || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0) \
+ || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 \
+ && (TCL_RELEASE_LEVEL == TCL_ALPHA_RELEASE \
+ || (TCL_RELEASE_LEVEL == TCL_BETA_RELEASE \
+ && TCL_RELEASE_SERIAL < 2) ) )
+EXTERN void TkConsoleCreate _((void));
+#endif
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 \
+ && ( (TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE \
+ && TCL_RELEASE_SERIAL == 0) \
+ || (TCL_RELEASE_LEVEL == TCL_BETA_RELEASE \
+ && TCL_RELEASE_SERIAL >= 2) )
+EXTERN void TkConsoleCreate_ _((void));
+#endif
+#endif
+static VALUE
+ip_create_console_core(interp, argc, argv)
+ VALUE interp;
+ int argc; /* dummy */
+ VALUE *argv; /* dummy */
+{
+ struct tcltkip *ptr = get_ip(interp);
+
+ if (!tk_stubs_init_p()) {
+ tcltkip_init_tk(interp);
+ }
+
+ if (Tcl_GetVar(ptr->ip,"tcl_interactive",TCL_GLOBAL_ONLY) == (char*)NULL) {
+ Tcl_SetVar(ptr->ip, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
+ }
+
+#if TCL_MAJOR_VERSION > 8 \
+ || (TCL_MAJOR_VERSION == 8 \
+ && (TCL_MINOR_VERSION > 1 \
+ || (TCL_MINOR_VERSION == 1 \
+ && TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE \
+ && TCL_RELEASE_SERIAL >= 1) ) )
+ Tk_InitConsoleChannels(ptr->ip);
+
+ if (Tk_CreateConsoleWindow(ptr->ip) != TCL_OK) {
+ rb_raise(rb_eRuntimeError, "fail to create console-window");
+ }
+#else
+#if defined(MAC_TCL) || defined(__WIN32__)
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 \
+ && ( (TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE && TCL_RELEASE_SERIAL == 0) \
+ || (TCL_RELEASE_LEVEL == TCL_BETA_RELEASE && TCL_RELEASE_SERIAL >= 2) )
+ TkConsoleCreate_();
+#else
+ TkConsoleCreate();
+#endif
+
+ if (TkConsoleInit(ptr->ip) != TCL_OK) {
+ rb_raise(rb_eRuntimeError, "fail to create console-window");
+ }
+#else
+ rb_notimplement();
+#endif
+#endif
+
+ return interp;
+}
+
+static VALUE
+ip_create_console(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ return tk_funcall(ip_create_console_core, 0, (VALUE*)NULL, self);
+}
+
+/* make ip "safe" */
+static VALUE
+ip_make_safe_core(interp, argc, argv)
+ VALUE interp;
+ int argc; /* dummy */
+ VALUE *argv; /* dummy */
+{
+ struct tcltkip *ptr = get_ip(interp);
+ Tk_Window mainWin;
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_exc_new2(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ if (Tcl_MakeSafe(ptr->ip) == TCL_ERROR) {
+ /* return rb_exc_new2(rb_eRuntimeError,
+ Tcl_GetStringResult(ptr->ip)); */
+ return create_ip_exc(interp, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ }
+
+ ptr->allow_ruby_exit = 0;
+
+ /* replace 'exit' command --> 'interp_exit' command */
+ mainWin = (tk_stubs_init_p())? Tk_MainWindow(ptr->ip): (Tk_Window)NULL;
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+
+ return interp;
+}
+
+static VALUE
+ip_make_safe(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ return tk_funcall(ip_make_safe_core, 0, (VALUE*)NULL, self);
+}
+
+/* is safe? */
+static VALUE
+ip_is_safe_p(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ if (Tcl_IsSafe(ptr->ip)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+/* allow_ruby_exit? */
+static VALUE
+ip_allow_ruby_exit_p(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ if (ptr->allow_ruby_exit) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+/* allow_ruby_exit = mode */
+static VALUE
+ip_allow_ruby_exit_set(self, val)
+ VALUE self, val;
+{
+ struct tcltkip *ptr = get_ip(self);
+ Tk_Window mainWin;
+
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ if (Tcl_IsSafe(ptr->ip)) {
+ rb_raise(rb_eSecurityError,
+ "insecure operation on a safe interpreter");
+ }
+
+ /*
+ * Because of cross-threading, the following line may fail to find
+ * the MainWindow, even if the Tcl/Tk interpreter has one or more.
+ * But it has no problem. Current implementation of both type of
+ * the "exit" command don't need maiinWin token.
+ */
+ mainWin = (tk_stubs_init_p())? Tk_MainWindow(ptr->ip): (Tk_Window)NULL;
+
+ if (RTEST(val)) {
+ ptr->allow_ruby_exit = 1;
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"ruby_exit\"");
+ Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"ruby_exit\"");
+ Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+ return Qtrue;
+
+ } else {
+ ptr->allow_ruby_exit = 0;
+#if TCL_MAJOR_VERSION >= 8
+ DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\"");
+ Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand,
+ (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
+#endif
+ return Qfalse;
+ }
+}
+
+/* delete interpreter */
+static VALUE
+ip_delete(self)
+ VALUE self;
+{
+ int thr_crit_bup;
+ struct tcltkip *ptr = get_ip(self);
+
+ /* if (ptr == (struct tcltkip *)NULL || ptr->ip == (Tcl_Interp*)NULL) { */
+ if (deleted_ip(ptr)) {
+ DUMP1("delete deleted IP");
+ return Qnil;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ DUMP1("delete interp");
+ if (!Tcl_InterpDeleted(ptr->ip)) {
+ DUMP1("call ip_finalize");
+ ip_finalize(ptr->ip);
+
+ Tcl_DeleteInterp(ptr->ip);
+ Tcl_Release(ptr->ip);
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ return Qnil;
+}
+
+
+/* is deleted? */
+static VALUE
+ip_has_invalid_namespace_p(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ if (ptr == (struct tcltkip *)NULL || ptr->ip == (Tcl_Interp *)NULL) {
+ /* deleted IP */
+ return Qtrue;
+ }
+
+#if TCL_NAMESPACE_DEBUG
+ if (rbtk_invalid_namespace(ptr)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+#else
+ return Qfalse;
+#endif
+}
+
+static VALUE
+ip_is_deleted_p(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ if (deleted_ip(ptr)) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+static VALUE
+ip_has_mainwindow_p_core(self, argc, argv)
+ VALUE self;
+ int argc; /* dummy */
+ VALUE *argv; /* dummy */
+{
+ struct tcltkip *ptr = get_ip(self);
+
+ if (deleted_ip(ptr) || !tk_stubs_init_p()) {
+ return Qnil;
+ } else if (Tk_MainWindow(ptr->ip) == (Tk_Window)NULL) {
+ return Qfalse;
+ } else {
+ return Qtrue;
+ }
+}
+
+static VALUE
+ip_has_mainwindow_p(self)
+ VALUE self;
+{
+ return tk_funcall(ip_has_mainwindow_p_core, 0, (VALUE*)NULL, self);
+}
+
+
+/*** ruby string <=> tcl object ***/
+#if TCL_MAJOR_VERSION >= 8
+static VALUE
+get_str_from_obj(obj)
+ Tcl_Obj *obj;
+{
+ int len, binary = 0;
+ const char *s;
+ volatile VALUE str;
+
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ s = Tcl_GetStringFromObj(obj, &len);
+#else
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 3
+ /* TCL_VERSION 8.1 -- 8.3 */
+ if (Tcl_GetCharLength(obj) != Tcl_UniCharLen(Tcl_GetUnicode(obj))) {
+ /* possibly binary string */
+ s = (char *)Tcl_GetByteArrayFromObj(obj, &len);
+ binary = 1;
+ } else {
+ /* possibly text string */
+ s = Tcl_GetStringFromObj(obj, &len);
+ }
+#else /* TCL_VERSION >= 8.4 */
+ if (IS_TCL_BYTEARRAY(obj)) {
+ s = (char *)Tcl_GetByteArrayFromObj(obj, &len);
+ binary = 1;
+ } else {
+ s = Tcl_GetStringFromObj(obj, &len);
+ }
+
+#endif
+#endif
+ str = s ? rb_str_new(s, len) : rb_str_new2("");
+ if (binary) {
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
+ } else {
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_UTF8);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_UTF8);
+#endif
+ }
+ return str;
+}
+
+static Tcl_Obj *
+get_obj_from_str(str)
+ VALUE str;
+{
+ const char *s = StringValuePtr(str);
+
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ return Tcl_NewStringObj((char*)s, RSTRING_LEN(str));
+#else /* TCL_VERSION >= 8.1 */
+ VALUE enc = rb_attr_get(str, ID_at_enc);
+
+ if (!NIL_P(enc)) {
+ StringValue(enc);
+ if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
+ /* binary string */
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
+ } else {
+ /* text string */
+ return Tcl_NewStringObj(s, RSTRING_LENINT(str));
+ }
+#ifdef HAVE_RUBY_ENCODING_H
+ } else if (rb_enc_get_index(str) == ENCODING_INDEX_BINARY) {
+ /* binary string */
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
+#endif
+ } else if (memchr(s, 0, RSTRING_LEN(str))) {
+ /* probably binary string */
+ return Tcl_NewByteArrayObj((const unsigned char *)s, RSTRING_LENINT(str));
+ } else {
+ /* probably text string */
+ return Tcl_NewStringObj(s, RSTRING_LENINT(str));
+ }
+#endif
+}
+#endif /* ruby string <=> tcl object */
+
+static VALUE
+ip_get_result_string_obj(interp)
+ Tcl_Interp *interp;
+{
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj *retObj;
+ volatile VALUE strval;
+
+ retObj = Tcl_GetObjResult(interp);
+ Tcl_IncrRefCount(retObj);
+ strval = get_str_from_obj(retObj);
+ RbTk_OBJ_UNTRUST(strval);
+ Tcl_ResetResult(interp);
+ Tcl_DecrRefCount(retObj);
+ return strval;
+#else
+ return rb_tainted_str_new2(interp->result);
+#endif
+}
+
+/* call Tcl/Tk functions on the eventloop thread */
+static VALUE
+callq_safelevel_handler(arg, callq)
+ VALUE arg;
+ VALUE callq;
+{
+ struct call_queue *q;
+
+ Data_Get_Struct(callq, struct call_queue, q);
+ DUMP2("(safe-level handler) $SAFE = %d", q->safe_level);
+ rb_set_safe_level(q->safe_level);
+ return((q->func)(q->interp, q->argc, q->argv));
+}
+
+static int call_queue_handler _((Tcl_Event *, int));
+static int
+call_queue_handler(evPtr, flags)
+ Tcl_Event *evPtr;
+ int flags;
+{
+ struct call_queue *q = (struct call_queue *)evPtr;
+ volatile VALUE ret;
+ volatile VALUE q_dat;
+ volatile VALUE thread = q->thread;
+ struct tcltkip *ptr;
+
+ DUMP2("do_call_queue_handler : evPtr = %p", evPtr);
+ DUMP2("call_queue_handler thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
+
+ if (*(q->done)) {
+ DUMP1("processed by another event-loop");
+ return 0;
+ } else {
+ DUMP1("process it on current event-loop");
+ }
+
+ if (RTEST(rb_thread_alive_p(thread))
+ && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
+ DUMP1("caller is not yet ready to receive the result -> pending");
+ return 0;
+ }
+
+ /* process it */
+ *(q->done) = 1;
+
+ /* deleted ipterp ? */
+ ptr = get_ip(q->interp);
+ if (deleted_ip(ptr)) {
+ /* deleted IP --> ignore */
+ return 1;
+ }
+
+ /* incr internal handler mark */
+ rbtk_internal_eventloop_handler++;
+
+ /* 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);
+ 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:%"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;
+ ret = (VALUE)NULL;
+
+ /* decr internal handler mark */
+ rbtk_internal_eventloop_handler--;
+
+ /* complete */
+ *(q->done) = -1;
+
+ /* unlink ruby objects */
+ q->argv = (VALUE*)NULL;
+ q->interp = (VALUE)NULL;
+ q->result = (VALUE)NULL;
+ q->thread = (VALUE)NULL;
+
+ /* back to caller */
+ if (RTEST(rb_thread_alive_p(thread))) {
+ 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);
+#else
+ rb_thread_run(thread);
+#endif
+ DUMP1("finish back to caller");
+#if DO_THREAD_SCHEDULE_AT_CALLBACK_DONE
+ rb_thread_schedule();
+#endif
+ } else {
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
+ }
+
+ /* end of handler : remove it */
+ return 1;
+}
+
+static VALUE
+tk_funcall(func, argc, argv, obj)
+ VALUE (*func)();
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ struct call_queue *callq;
+ struct tcltkip *ptr;
+ int *alloc_done;
+ int thr_crit_bup;
+ int is_tk_evloop_thread;
+ volatile VALUE current = rb_thread_current();
+ volatile VALUE ip_obj = obj;
+ volatile VALUE result;
+ volatile VALUE ret;
+ struct timeval t;
+
+ if (!NIL_P(ip_obj) && rb_obj_is_kind_of(ip_obj, tcltkip_class)) {
+ ptr = get_ip(ip_obj);
+ if (deleted_ip(ptr)) return Qnil;
+ } else {
+ ptr = (struct tcltkip *)NULL;
+ }
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (ptr) {
+ /* on Tcl interpreter */
+ is_tk_evloop_thread = (ptr->tk_thread_id == (Tcl_ThreadId) 0
+ || ptr->tk_thread_id == Tcl_GetCurrentThread());
+ } else {
+ /* on Tcl/Tk library */
+ is_tk_evloop_thread = (tk_eventloop_thread_id == (Tcl_ThreadId) 0
+ || tk_eventloop_thread_id == Tcl_GetCurrentThread());
+ }
+#else
+ is_tk_evloop_thread = 1;
+#endif
+
+ if (is_tk_evloop_thread
+ && (NIL_P(eventloop_thread) || current == eventloop_thread)
+ ) {
+ if (NIL_P(eventloop_thread)) {
+ DUMP2("tk_funcall from thread:%"PRIxVALUE" but no eventloop", current);
+ } else {
+ DUMP2("tk_funcall from current eventloop %"PRIxVALUE, current);
+ }
+ result = (func)(ip_obj, argc, argv);
+ if (rb_obj_is_kind_of(result, rb_eException)) {
+ rb_exc_raise(result);
+ }
+ return result;
+ }
+
+ DUMP2("tk_funcall from thread %"PRIxVALUE" (NOT current eventloop)", current);
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* allocate memory (argv cross over thread : must be in heap) */
+ if (argv) {
+ /* VALUE *temp = ALLOC_N(VALUE, argc); */
+ VALUE *temp = RbTk_ALLOC_N(VALUE, argc);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)temp); /* XXXXXXXX */
+#endif
+ MEMCPY(temp, argv, VALUE, argc);
+ argv = temp;
+ }
+
+ /* allocate memory (keep result) */
+ /* alloc_done = (int*)ALLOC(int); */
+ alloc_done = RbTk_ALLOC_N(int, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
+#endif
+ *alloc_done = 0;
+
+ /* allocate memory (freed by Tcl_ServiceEvent) */
+ /* callq = (struct call_queue *)Tcl_Alloc(sizeof(struct call_queue)); */
+ callq = RbTk_ALLOC_N(struct call_queue, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve(callq);
+#endif
+
+ /* allocate result obj */
+ result = rb_ary_new3(1, Qnil);
+
+ /* construct event data */
+ callq->done = alloc_done;
+ callq->func = func;
+ callq->argc = argc;
+ callq->argv = argv;
+ callq->interp = ip_obj;
+ callq->result = result;
+ callq->thread = current;
+ callq->safe_level = rb_safe_level();
+ callq->ev.proc = call_queue_handler;
+
+ /* add the handler to Tcl event queue */
+ DUMP1("add handler");
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (ptr && ptr->tk_thread_id) {
+ /* Tcl_ThreadQueueEvent(ptr->tk_thread_id,
+ &(callq->ev), TCL_QUEUE_HEAD); */
+ Tcl_ThreadQueueEvent(ptr->tk_thread_id,
+ (Tcl_Event*)callq, TCL_QUEUE_HEAD);
+ Tcl_ThreadAlert(ptr->tk_thread_id);
+ } else if (tk_eventloop_thread_id) {
+ /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id,
+ &(callq->ev), TCL_QUEUE_HEAD); */
+ Tcl_ThreadQueueEvent(tk_eventloop_thread_id,
+ (Tcl_Event*)callq, TCL_QUEUE_HEAD);
+ Tcl_ThreadAlert(tk_eventloop_thread_id);
+ } else {
+ /* Tcl_QueueEvent(&(callq->ev), TCL_QUEUE_HEAD); */
+ Tcl_QueueEvent((Tcl_Event*)callq, TCL_QUEUE_HEAD);
+ }
+#else
+ /* Tcl_QueueEvent(&(callq->ev), TCL_QUEUE_HEAD); */
+ Tcl_QueueEvent((Tcl_Event*)callq, TCL_QUEUE_HEAD);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* wait for the handler to be processed */
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ DUMP2("callq wait for handler (current thread:%"PRIxVALUE")", current);
+ while(*alloc_done >= 0) {
+ 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:%"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:%"PRIxVALUE")", current);
+
+ /* get result & free allocated memory */
+ ret = RARRAY_PTR(result)[0];
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)alloc_done); /* XXXXXXXX */
+#else
+ /* free(alloc_done); */
+ ckfree((char*)alloc_done);
+#endif
+#endif
+ /* if (argv) free(argv); */
+ if (argv) {
+ /* if argv != NULL, alloc as 'temp' */
+ int i;
+ for(i = 0; i < argc; i++) { argv[i] = (VALUE)NULL; }
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ ckfree((char*)argv);
+#endif
+#endif
+ }
+
+#if 0 /* callq is freed by Tcl_ServiceEvent */
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release(callq);
+#else
+ ckfree((char*)callq);
+#endif
+#endif
+
+ /* exception? */
+ if (rb_obj_is_kind_of(ret, rb_eException)) {
+ 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)));
+ }
+
+ DUMP1("exit tk_funcall");
+ return ret;
+}
+
+
+/* eval string in tcl by Tcl_Eval() */
+#if TCL_MAJOR_VERSION >= 8
+struct call_eval_info {
+ struct tcltkip *ptr;
+ Tcl_Obj *cmd;
+};
+
+static VALUE
+#ifdef HAVE_PROTOTYPES
+call_tcl_eval(VALUE arg)
+#else
+call_tcl_eval(arg)
+ VALUE arg;
+#endif
+{
+ struct call_eval_info *inf = (struct call_eval_info *)arg;
+
+ Tcl_AllowExceptions(inf->ptr->ip);
+ inf->ptr->return_value = Tcl_EvalObj(inf->ptr->ip, inf->cmd);
+
+ return Qnil;
+}
+#endif
+
+static VALUE
+ip_eval_real(self, cmd_str, cmd_len)
+ VALUE self;
+ char *cmd_str;
+ int cmd_len;
+{
+ volatile VALUE ret;
+ struct tcltkip *ptr = get_ip(self);
+ int thr_crit_bup;
+
+#if TCL_MAJOR_VERSION >= 8
+ /* call Tcl_EvalObj() */
+ {
+ Tcl_Obj *cmd;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ cmd = Tcl_NewStringObj(cmd_str, cmd_len);
+ Tcl_IncrRefCount(cmd);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ Tcl_DecrRefCount(cmd);
+ rb_thread_critical = thr_crit_bup;
+ ptr->return_value = TCL_OK;
+ return rb_tainted_str_new2("");
+ } else {
+ int status;
+ struct call_eval_info inf;
+
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+
+#if 0
+ ptr->return_value = Tcl_EvalObj(ptr->ip, cmd);
+ /* ptr->return_value = Tcl_GlobalEvalObj(ptr->ip, cmd); */
+#else
+ inf.ptr = ptr;
+ inf.cmd = cmd;
+ ret = rb_protect(call_tcl_eval, (VALUE)&inf, &status);
+ switch(status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception = rb_exc_new2(rb_eException,
+ "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ }
+#endif
+ }
+
+ Tcl_DecrRefCount(cmd);
+
+ }
+
+ if (pending_exception_check1(thr_crit_bup, ptr)) {
+ rbtk_release_ip(ptr);
+ return rbtk_pending_exception;
+ }
+
+ /* if (ptr->return_value == TCL_ERROR) { */
+ if (ptr->return_value != TCL_OK) {
+ if (event_loop_abort_on_exc > 0 && !Tcl_InterpDeleted(ptr->ip)) {
+ volatile VALUE exc;
+
+ switch (ptr->return_value) {
+ case TCL_RETURN:
+ exc = create_ip_exc(self, eTkCallbackReturn,
+ "ip_eval_real receives TCL_RETURN");
+ case TCL_BREAK:
+ exc = create_ip_exc(self, eTkCallbackBreak,
+ "ip_eval_real receives TCL_BREAK");
+ case TCL_CONTINUE:
+ exc = create_ip_exc(self, eTkCallbackContinue,
+ "ip_eval_real receives TCL_CONTINUE");
+ default:
+ exc = create_ip_exc(self, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ }
+
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return exc;
+ } else {
+ if (event_loop_abort_on_exc < 0) {
+ rb_warning("%s (ignore)", Tcl_GetStringResult(ptr->ip));
+ } else {
+ rb_warn("%s (ignore)", Tcl_GetStringResult(ptr->ip));
+ }
+ Tcl_ResetResult(ptr->ip);
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return rb_tainted_str_new2("");
+ }
+ }
+
+ /* pass back the result (as string) */
+ ret = ip_get_result_string_obj(ptr->ip);
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return ret;
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ DUMP2("Tcl_Eval(%s)", cmd_str);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ ptr->return_value = TCL_OK;
+ return rb_tainted_str_new2("");
+ } else {
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+ ptr->return_value = Tcl_Eval(ptr->ip, cmd_str);
+ /* ptr->return_value = Tcl_GlobalEval(ptr->ip, cmd_str); */
+ }
+
+ if (pending_exception_check1(thr_crit_bup, ptr)) {
+ rbtk_release_ip(ptr);
+ return rbtk_pending_exception;
+ }
+
+ /* if (ptr->return_value == TCL_ERROR) { */
+ if (ptr->return_value != TCL_OK) {
+ volatile VALUE exc;
+
+ switch (ptr->return_value) {
+ case TCL_RETURN:
+ exc = create_ip_exc(self, eTkCallbackReturn,
+ "ip_eval_real receives TCL_RETURN");
+ case TCL_BREAK:
+ exc = create_ip_exc(self, eTkCallbackBreak,
+ "ip_eval_real receives TCL_BREAK");
+ case TCL_CONTINUE:
+ exc = create_ip_exc(self, eTkCallbackContinue,
+ "ip_eval_real receives TCL_CONTINUE");
+ default:
+ exc = create_ip_exc(self, rb_eRuntimeError, "%s", ptr->ip->result);
+ }
+
+ rbtk_release_ip(ptr);
+ return exc;
+ }
+ DUMP2("(TCL_Eval result) %d", ptr->return_value);
+
+ /* pass back the result (as string) */
+ ret = ip_get_result_string_obj(ptr->ip);
+ rbtk_release_ip(ptr);
+ return ret;
+#endif
+}
+
+static VALUE
+evq_safelevel_handler(arg, evq)
+ VALUE arg;
+ VALUE evq;
+{
+ struct eval_queue *q;
+
+ Data_Get_Struct(evq, struct eval_queue, q);
+ DUMP2("(safe-level handler) $SAFE = %d", q->safe_level);
+ rb_set_safe_level(q->safe_level);
+ return ip_eval_real(q->interp, q->str, q->len);
+}
+
+int eval_queue_handler _((Tcl_Event *, int));
+int
+eval_queue_handler(evPtr, flags)
+ Tcl_Event *evPtr;
+ int flags;
+{
+ struct eval_queue *q = (struct eval_queue *)evPtr;
+ volatile VALUE ret;
+ volatile VALUE q_dat;
+ volatile VALUE thread = q->thread;
+ struct tcltkip *ptr;
+
+ DUMP2("do_eval_queue_handler : evPtr = %p", evPtr);
+ DUMP2("eval_queue_thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
+
+ if (*(q->done)) {
+ DUMP1("processed by another event-loop");
+ return 0;
+ } else {
+ DUMP1("process it on current event-loop");
+ }
+
+ if (RTEST(rb_thread_alive_p(thread))
+ && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
+ DUMP1("caller is not yet ready to receive the result -> pending");
+ return 0;
+ }
+
+ /* process it */
+ *(q->done) = 1;
+
+ /* deleted ipterp ? */
+ ptr = get_ip(q->interp);
+ if (deleted_ip(ptr)) {
+ /* deleted IP --> ignore */
+ return 1;
+ }
+
+ /* incr internal handler mark */
+ rbtk_internal_eventloop_handler++;
+
+ /* check safe-level */
+ if (rb_safe_level() != q->safe_level) {
+#ifdef HAVE_NATIVETHREAD
+#ifndef RUBY_USE_NATIVE_THREAD
+ if (!ruby_native_thread_p()) {
+ rb_bug("cross-thread violation on eval_queue_handler()");
+ }
+#endif
+#endif
+ /* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */
+ q_dat = Data_Wrap_Struct(rb_cData,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);
+ q_dat = (VALUE)NULL;
+ } else {
+ ret = ip_eval_real(q->interp, q->str, q->len);
+ }
+
+ /* set result */
+ RARRAY_PTR(q->result)[0] = ret;
+ ret = (VALUE)NULL;
+
+ /* decr internal handler mark */
+ rbtk_internal_eventloop_handler--;
+
+ /* complete */
+ *(q->done) = -1;
+
+ /* unlink ruby objects */
+ q->interp = (VALUE)NULL;
+ q->result = (VALUE)NULL;
+ q->thread = (VALUE)NULL;
+
+ /* back to caller */
+ if (RTEST(rb_thread_alive_p(thread))) {
+ 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);
+#else
+ rb_thread_run(thread);
+#endif
+ DUMP1("finish back to caller");
+#if DO_THREAD_SCHEDULE_AT_CALLBACK_DONE
+ rb_thread_schedule();
+#endif
+ } else {
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
+ }
+
+ /* end of handler : remove it */
+ return 1;
+}
+
+static VALUE
+ip_eval(self, str)
+ VALUE self;
+ VALUE str;
+{
+ struct eval_queue *evq;
+#ifdef RUBY_USE_NATIVE_THREAD
+ struct tcltkip *ptr;
+#endif
+ char *eval_str;
+ int *alloc_done;
+ int thr_crit_bup;
+ volatile VALUE current = rb_thread_current();
+ volatile VALUE ip_obj = self;
+ volatile VALUE result;
+ volatile VALUE ret;
+ Tcl_QueuePosition position;
+ struct timeval t;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ StringValue(str);
+ rb_thread_critical = thr_crit_bup;
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ ptr = get_ip(ip_obj);
+ DUMP2("eval status: ptr->tk_thread_id %p", ptr->tk_thread_id);
+ DUMP2("eval status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
+#else
+ DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
+#endif
+ DUMP2("status: eventloopt_thread %"PRIxVALUE, eventloop_thread);
+
+ if (
+#ifdef RUBY_USE_NATIVE_THREAD
+ (ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread())
+ &&
+#endif
+ (NIL_P(eventloop_thread) || current == eventloop_thread)
+ ) {
+ if (NIL_P(eventloop_thread)) {
+ DUMP2("eval from thread:%"PRIxVALUE" but no eventloop", current);
+ } else {
+ 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)) {
+ rb_exc_raise(result);
+ }
+ return result;
+ }
+
+ DUMP2("eval from thread %"PRIxVALUE" (NOT current eventloop)", current);
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* allocate memory (keep result) */
+ /* alloc_done = (int*)ALLOC(int); */
+ alloc_done = RbTk_ALLOC_N(int, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
+#endif
+ *alloc_done = 0;
+
+ /* eval_str = ALLOC_N(char, RSTRING_LEN(str) + 1); */
+ eval_str = ckalloc(RSTRING_LENINT(str) + 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)eval_str); /* XXXXXXXX */
+#endif
+ memcpy(eval_str, RSTRING_PTR(str), RSTRING_LEN(str));
+ eval_str[RSTRING_LEN(str)] = 0;
+
+ /* allocate memory (freed by Tcl_ServiceEvent) */
+ /* evq = (struct eval_queue *)Tcl_Alloc(sizeof(struct eval_queue)); */
+ evq = RbTk_ALLOC_N(struct eval_queue, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve(evq);
+#endif
+
+ /* allocate result obj */
+ result = rb_ary_new3(1, Qnil);
+
+ /* construct event data */
+ evq->done = alloc_done;
+ evq->str = eval_str;
+ evq->len = RSTRING_LENINT(str);
+ evq->interp = ip_obj;
+ evq->result = result;
+ evq->thread = current;
+ evq->safe_level = rb_safe_level();
+ evq->ev.proc = eval_queue_handler;
+
+ position = TCL_QUEUE_TAIL;
+
+ /* add the handler to Tcl event queue */
+ DUMP1("add handler");
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (ptr->tk_thread_id) {
+ /* Tcl_ThreadQueueEvent(ptr->tk_thread_id, &(evq->ev), position); */
+ Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)evq, position);
+ Tcl_ThreadAlert(ptr->tk_thread_id);
+ } else if (tk_eventloop_thread_id) {
+ Tcl_ThreadQueueEvent(tk_eventloop_thread_id, (Tcl_Event*)evq, position);
+ /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id,
+ &(evq->ev), position); */
+ Tcl_ThreadAlert(tk_eventloop_thread_id);
+ } else {
+ /* Tcl_QueueEvent(&(evq->ev), position); */
+ Tcl_QueueEvent((Tcl_Event*)evq, position);
+ }
+#else
+ /* Tcl_QueueEvent(&(evq->ev), position); */
+ Tcl_QueueEvent((Tcl_Event*)evq, position);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* wait for the handler to be processed */
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ DUMP2("evq wait for handler (current thread:%"PRIxVALUE")", current);
+ while(*alloc_done >= 0) {
+ 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:%"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:%"PRIxVALUE")", current);
+
+ /* get result & free allocated memory */
+ ret = RARRAY_PTR(result)[0];
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)alloc_done); /* XXXXXXXX */
+#else
+ /* free(alloc_done); */
+ ckfree((char*)alloc_done);
+#endif
+#endif
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)eval_str, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)eval_str); /* XXXXXXXX */
+#else
+ /* free(eval_str); */
+ ckfree(eval_str);
+#endif
+#endif
+#if 0 /* evq is freed by Tcl_ServiceEvent */
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release(evq);
+#else
+ ckfree((char*)evq);
+#endif
+#endif
+
+ if (rb_obj_is_kind_of(ret, rb_eException)) {
+ 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)));
+ }
+
+ return ret;
+}
+
+
+static int
+ip_cancel_eval_core(interp, msg, flag)
+ Tcl_Interp *interp;
+ VALUE msg;
+ int flag;
+{
+#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
+ rb_raise(rb_eNotImpError,
+ "cancel_eval is supported Tcl/Tk8.6 or later.");
+
+ UNREACHABLE;
+#else
+ Tcl_Obj *msg_obj;
+
+ if (NIL_P(msg)) {
+ msg_obj = NULL;
+ } else {
+ msg_obj = Tcl_NewStringObj(RSTRING_PTR(msg), RSTRING_LEN(msg));
+ Tcl_IncrRefCount(msg_obj);
+ }
+
+ return Tcl_CancelEval(interp, msg_obj, 0, flag);
+#endif
+}
+
+static VALUE
+ip_cancel_eval(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE retval;
+
+ if (rb_scan_args(argc, argv, "01", &retval) == 0) {
+ retval = Qnil;
+ }
+ if (ip_cancel_eval_core(get_ip(self)->ip, retval, 0) == TCL_OK) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+#ifndef TCL_CANCEL_UNWIND
+#define TCL_CANCEL_UNWIND 0x100000
+#endif
+static VALUE
+ip_cancel_eval_unwind(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ int flag = 0;
+ VALUE retval;
+
+ if (rb_scan_args(argc, argv, "01", &retval) == 0) {
+ retval = Qnil;
+ }
+
+ flag |= TCL_CANCEL_UNWIND;
+ if (ip_cancel_eval_core(get_ip(self)->ip, retval, flag) == TCL_OK) {
+ return Qtrue;
+ } else {
+ return Qfalse;
+ }
+}
+
+/* restart Tk */
+static VALUE
+lib_restart_core(interp, argc, argv)
+ VALUE interp;
+ int argc; /* dummy */
+ VALUE *argv; /* dummy */
+{
+ volatile VALUE exc;
+ struct tcltkip *ptr = get_ip(interp);
+ int thr_crit_bup;
+
+
+ /* tcl_stubs_check(); */ /* already checked */
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_exc_new2(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+
+ /* destroy the root wdiget */
+ ptr->return_value = Tcl_Eval(ptr->ip, "destroy .");
+ /* ignore ERROR */
+ DUMP2("(TCL_Eval result) %d", ptr->return_value);
+ Tcl_ResetResult(ptr->ip);
+
+#if TCL_MAJOR_VERSION >= 8
+ /* delete namespace ( tested on tk8.4.5 ) */
+ ptr->return_value = Tcl_Eval(ptr->ip, "namespace delete ::tk::msgcat");
+ /* ignore ERROR */
+ DUMP2("(TCL_Eval result) %d", ptr->return_value);
+ Tcl_ResetResult(ptr->ip);
+#endif
+
+ /* delete trace proc ( tested on tk8.4.5 ) */
+ ptr->return_value = Tcl_Eval(ptr->ip, "trace vdelete ::tk_strictMotif w ::tk::EventMotifBindings");
+ /* ignore ERROR */
+ DUMP2("(TCL_Eval result) %d", ptr->return_value);
+ Tcl_ResetResult(ptr->ip);
+
+ /* execute Tk_Init or Tk_SafeInit */
+ exc = tcltkip_init_tk(interp);
+ if (!NIL_P(exc)) {
+ rb_thread_critical = thr_crit_bup;
+ rbtk_release_ip(ptr);
+ return exc;
+ }
+
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* return Qnil; */
+ return interp;
+}
+
+static VALUE
+lib_restart(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+
+ tcl_stubs_check();
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ return tk_funcall(lib_restart_core, 0, (VALUE*)NULL, self);
+}
+
+
+static VALUE
+ip_restart(self)
+ VALUE self;
+{
+ struct tcltkip *ptr = get_ip(self);
+
+
+ tcl_stubs_check();
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_raise(rb_eRuntimeError, "interpreter is deleted");
+ }
+
+ if (Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL) {
+ /* slave IP */
+ return Qnil;
+ }
+ return lib_restart(self);
+}
+
+static VALUE
+lib_toUTF8_core(ip_obj, src, encodename)
+ VALUE ip_obj;
+ VALUE src;
+ VALUE encodename;
+{
+ volatile VALUE str = src;
+
+#ifdef TCL_UTF_MAX
+# if 0
+ Tcl_Interp *interp;
+# endif
+ Tcl_Encoding encoding;
+ Tcl_DString dstr;
+ int taint_flag = OBJ_TAINTED(str);
+ struct tcltkip *ptr;
+ char *buf;
+ int thr_crit_bup;
+#endif
+
+ tcl_stubs_check();
+
+ if (NIL_P(src)) {
+ return rb_str_new2("");
+ }
+
+#ifdef TCL_UTF_MAX
+ if (NIL_P(ip_obj)) {
+# if 0
+ interp = (Tcl_Interp *)NULL;
+# endif
+ } else {
+ ptr = get_ip(ip_obj);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+# if 0
+ interp = (Tcl_Interp *)NULL;
+ } else {
+ interp = ptr->ip;
+# endif
+ }
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (NIL_P(encodename)) {
+ 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);
+#else
+ enc = rb_attr_get(str, ID_at_enc);
+#endif
+ if (NIL_P(enc)) {
+ if (NIL_P(ip_obj)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ enc = rb_attr_get(ip_obj, ID_at_enc);
+ if (NIL_P(enc)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ /* StringValue(enc); */
+ enc = rb_funcall(enc, ID_to_s, 0, 0);
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
+ if (!RSTRING_LEN(enc)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL,
+ RSTRING_PTR(enc));
+ if (encoding == (Tcl_Encoding)NULL) {
+ rb_warning("Tk-interp has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc));
+ }
+ }
+ }
+ }
+ } else {
+ StringValue(enc);
+ if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+ rb_thread_critical = thr_crit_bup;
+ return str;
+ }
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL,
+ RSTRING_PTR(enc));
+ if (encoding == (Tcl_Encoding)NULL) {
+ rb_warning("string has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc));
+ }
+ }
+ } else {
+ encoding = (Tcl_Encoding)NULL;
+ }
+ } else {
+ StringValue(encodename);
+ if (strcmp(RSTRING_PTR(encodename), "binary") == 0) {
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+ rb_thread_critical = thr_crit_bup;
+ return str;
+ }
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(encodename)); */
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(encodename));
+ if (encoding == (Tcl_Encoding)NULL) {
+ /*
+ rb_warning("unknown encoding name '%s'",
+ RSTRING_PTR(encodename));
+ */
+ rb_raise(rb_eArgError, "unknown encoding name '%s'",
+ RSTRING_PTR(encodename));
+ }
+ }
+
+ StringValue(str);
+ if (!RSTRING_LEN(str)) {
+ rb_thread_critical = thr_crit_bup;
+ return str;
+ }
+ buf = ALLOC_N(char, RSTRING_LEN(str)+1);
+ /* buf = ckalloc(sizeof(char) * (RSTRING_LENINT(str)+1)); */
+ memcpy(buf, RSTRING_PTR(str), RSTRING_LEN(str));
+ buf[RSTRING_LEN(str)] = 0;
+
+ Tcl_DStringInit(&dstr);
+ Tcl_DStringFree(&dstr);
+ /* Tcl_ExternalToUtfDString(encoding,buf,strlen(buf),&dstr); */
+ Tcl_ExternalToUtfDString(encoding, buf, RSTRING_LENINT(str), &dstr);
+
+ /* str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); */
+ /* str = rb_str_new2(Tcl_DStringValue(&dstr)); */
+ str = rb_str_new(Tcl_DStringValue(&dstr), Tcl_DStringLength(&dstr));
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_UTF8);
+#endif
+ if (taint_flag) RbTk_OBJ_UNTRUST(str);
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_UTF8);
+
+ /*
+ if (encoding != (Tcl_Encoding)NULL) {
+ Tcl_FreeEncoding(encoding);
+ }
+ */
+ Tcl_DStringFree(&dstr);
+
+ xfree(buf);
+ /* ckfree(buf); */
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ return str;
+}
+
+static VALUE
+lib_toUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE str, encodename;
+
+ if (rb_scan_args(argc, argv, "11", &str, &encodename) == 1) {
+ encodename = Qnil;
+ }
+ return lib_toUTF8_core(Qnil, str, encodename);
+}
+
+static VALUE
+ip_toUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE str, encodename;
+
+ if (rb_scan_args(argc, argv, "11", &str, &encodename) == 1) {
+ encodename = Qnil;
+ }
+ return lib_toUTF8_core(self, str, encodename);
+}
+
+static VALUE
+lib_fromUTF8_core(ip_obj, src, encodename)
+ VALUE ip_obj;
+ VALUE src;
+ VALUE encodename;
+{
+ volatile VALUE str = src;
+
+#ifdef TCL_UTF_MAX
+ Tcl_Interp *interp;
+ Tcl_Encoding encoding;
+ Tcl_DString dstr;
+ int taint_flag = OBJ_TAINTED(str);
+ char *buf;
+ int thr_crit_bup;
+#endif
+
+ tcl_stubs_check();
+
+ if (NIL_P(src)) {
+ return rb_str_new2("");
+ }
+
+#ifdef TCL_UTF_MAX
+ if (NIL_P(ip_obj)) {
+ interp = (Tcl_Interp *)NULL;
+ } else if (get_ip(ip_obj) == (struct tcltkip *)NULL) {
+ interp = (Tcl_Interp *)NULL;
+ } else {
+ interp = get_ip(ip_obj)->ip;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ if (NIL_P(encodename)) {
+ volatile VALUE enc;
+
+ if (RB_TYPE_P(str, T_STRING)) {
+ enc = rb_attr_get(str, ID_at_enc);
+ if (!NIL_P(enc)) {
+ StringValue(enc);
+ if (strcmp(RSTRING_PTR(enc), "binary") == 0) {
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+ rb_thread_critical = thr_crit_bup;
+ return str;
+ }
+#ifdef HAVE_RUBY_ENCODING_H
+ } else if (rb_enc_get_index(str) == ENCODING_INDEX_BINARY) {
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+ rb_thread_critical = thr_crit_bup;
+ return str;
+#endif
+ }
+ }
+
+ if (NIL_P(ip_obj)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ enc = rb_attr_get(ip_obj, ID_at_enc);
+ if (NIL_P(enc)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ /* StringValue(enc); */
+ enc = rb_funcall(enc, ID_to_s, 0, 0);
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
+ if (!RSTRING_LEN(enc)) {
+ encoding = (Tcl_Encoding)NULL;
+ } else {
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL,
+ RSTRING_PTR(enc));
+ if (encoding == (Tcl_Encoding)NULL) {
+ rb_warning("Tk-interp has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc));
+ } else {
+ encodename = rb_obj_dup(enc);
+ }
+ }
+ }
+ }
+
+ } else {
+ StringValue(encodename);
+
+ if (strcmp(RSTRING_PTR(encodename), "binary") == 0) {
+ Tcl_Obj *tclstr;
+ char *s;
+ int len;
+
+ StringValue(str);
+ tclstr = Tcl_NewStringObj(RSTRING_PTR(str), RSTRING_LENINT(str));
+ Tcl_IncrRefCount(tclstr);
+ s = (char*)Tcl_GetByteArrayFromObj(tclstr, &len);
+ str = rb_tainted_str_new(s, len);
+ s = (char*)NULL;
+ Tcl_DecrRefCount(tclstr);
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_BINARY);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_BINARY);
+
+ rb_thread_critical = thr_crit_bup;
+ return str;
+ }
+
+ /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(encodename)); */
+ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(encodename));
+ if (encoding == (Tcl_Encoding)NULL) {
+ /*
+ rb_warning("unknown encoding name '%s'",
+ RSTRING_PTR(encodename));
+ encodename = Qnil;
+ */
+ rb_raise(rb_eArgError, "unknown encoding name '%s'",
+ RSTRING_PTR(encodename));
+ }
+ }
+
+ StringValue(str);
+
+ if (RSTRING_LEN(str) == 0) {
+ rb_thread_critical = thr_crit_bup;
+ return rb_tainted_str_new2("");
+ }
+
+ buf = ALLOC_N(char, RSTRING_LEN(str)+1);
+ /* buf = ckalloc(sizeof(char) * (RSTRING_LENINT(str)+1)); */
+ memcpy(buf, RSTRING_PTR(str), RSTRING_LEN(str));
+ buf[RSTRING_LEN(str)] = 0;
+
+ Tcl_DStringInit(&dstr);
+ Tcl_DStringFree(&dstr);
+ /* Tcl_UtfToExternalDString(encoding,buf,strlen(buf),&dstr); */
+ Tcl_UtfToExternalDString(encoding,buf,RSTRING_LENINT(str),&dstr);
+
+ /* str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); */
+ /* str = rb_str_new2(Tcl_DStringValue(&dstr)); */
+ str = rb_str_new(Tcl_DStringValue(&dstr), Tcl_DStringLength(&dstr));
+#ifdef HAVE_RUBY_ENCODING_H
+ if (interp) {
+ /* can access encoding_table of TclTkIp */
+ /* -> try to use encoding_table */
+ VALUE tbl = ip_get_encoding_table(ip_obj);
+ VALUE encobj = encoding_table_get_obj(tbl, encodename);
+ rb_enc_associate_index(str, rb_to_encoding_index(encobj));
+ } else {
+ /* cannot access encoding_table of TclTkIp */
+ /* -> try to find on Ruby Encoding */
+ rb_enc_associate_index(str, rb_enc_find_index(RSTRING_PTR(encodename)));
+ }
+#endif
+
+ if (taint_flag) RbTk_OBJ_UNTRUST(str);
+ rb_ivar_set(str, ID_at_enc, encodename);
+
+ /*
+ if (encoding != (Tcl_Encoding)NULL) {
+ Tcl_FreeEncoding(encoding);
+ }
+ */
+ Tcl_DStringFree(&dstr);
+
+ xfree(buf);
+ /* ckfree(buf); */
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ return str;
+}
+
+static VALUE
+lib_fromUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE str, encodename;
+
+ if (rb_scan_args(argc, argv, "11", &str, &encodename) == 1) {
+ encodename = Qnil;
+ }
+ return lib_fromUTF8_core(Qnil, str, encodename);
+}
+
+static VALUE
+ip_fromUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE str, encodename;
+
+ if (rb_scan_args(argc, argv, "11", &str, &encodename) == 1) {
+ encodename = Qnil;
+ }
+ return lib_fromUTF8_core(self, str, encodename);
+}
+
+static VALUE
+lib_UTF_backslash_core(self, str, all_bs)
+ VALUE self;
+ VALUE str;
+ int all_bs;
+{
+#ifdef TCL_UTF_MAX
+ char *src_buf, *dst_buf, *ptr;
+ int read_len = 0, dst_len = 0;
+ int taint_flag = OBJ_TAINTED(str);
+ int thr_crit_bup;
+
+ tcl_stubs_check();
+
+ StringValue(str);
+ if (!RSTRING_LEN(str)) {
+ return str;
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* src_buf = ALLOC_N(char, RSTRING_LEN(str)+1); */
+ src_buf = ckalloc(RSTRING_LENINT(str)+1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)src_buf); /* XXXXXXXX */
+#endif
+ memcpy(src_buf, RSTRING_PTR(str), RSTRING_LEN(str));
+ src_buf[RSTRING_LEN(str)] = 0;
+
+ /* dst_buf = ALLOC_N(char, RSTRING_LEN(str)+1); */
+ dst_buf = ckalloc(RSTRING_LENINT(str)+1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)dst_buf); /* XXXXXXXX */
+#endif
+
+ ptr = src_buf;
+ while(RSTRING_LEN(str) > ptr - src_buf) {
+ if (*ptr == '\\' && (all_bs || *(ptr + 1) == 'u')) {
+ dst_len += Tcl_UtfBackslash(ptr, &read_len, (dst_buf + dst_len));
+ ptr += read_len;
+ } else {
+ *(dst_buf + (dst_len++)) = *(ptr++);
+ }
+ }
+
+ str = rb_str_new(dst_buf, dst_len);
+ if (taint_flag) RbTk_OBJ_UNTRUST(str);
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_enc_associate_index(str, ENCODING_INDEX_UTF8);
+#endif
+ rb_ivar_set(str, ID_at_enc, ENCODING_NAME_UTF8);
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)src_buf, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)src_buf); /* XXXXXXXX */
+#else
+ /* free(src_buf); */
+ ckfree(src_buf);
+#endif
+#endif
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)dst_buf, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)dst_buf); /* XXXXXXXX */
+#else
+ /* free(dst_buf); */
+ ckfree(dst_buf);
+#endif
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+#endif
+
+ return str;
+}
+
+static VALUE
+lib_UTF_backslash(self, str)
+ VALUE self;
+ VALUE str;
+{
+ return lib_UTF_backslash_core(self, str, 0);
+}
+
+static VALUE
+lib_Tcl_backslash(self, str)
+ VALUE self;
+ VALUE str;
+{
+ return lib_UTF_backslash_core(self, str, 1);
+}
+
+static VALUE
+lib_get_system_encoding(self)
+ VALUE self;
+{
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
+ tcl_stubs_check();
+ return rb_str_new2(Tcl_GetEncodingName((Tcl_Encoding)NULL));
+#else
+ return Qnil;
+#endif
+}
+
+static VALUE
+lib_set_system_encoding(self, enc_name)
+ VALUE self;
+ VALUE enc_name;
+{
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
+ tcl_stubs_check();
+
+ if (NIL_P(enc_name)) {
+ Tcl_SetSystemEncoding((Tcl_Interp *)NULL, (CONST char *)NULL);
+ return lib_get_system_encoding(self);
+ }
+
+ enc_name = rb_funcall(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'",
+ RSTRING_PTR(enc_name));
+ }
+
+ return enc_name;
+#else
+ return Qnil;
+#endif
+}
+
+
+/* invoke Tcl proc */
+struct invoke_info {
+ struct tcltkip *ptr;
+ Tcl_CmdInfo cmdinfo;
+#if TCL_MAJOR_VERSION >= 8
+ int objc;
+ Tcl_Obj **objv;
+#else
+ int argc;
+ char **argv;
+#endif
+};
+
+static VALUE
+#ifdef HAVE_PROTOTYPES
+invoke_tcl_proc(VALUE arg)
+#else
+invoke_tcl_proc(arg)
+ VALUE arg;
+#endif
+{
+ struct invoke_info *inf = (struct invoke_info *)arg;
+ int i, len;
+#if TCL_MAJOR_VERSION >= 8
+ int argc = inf->objc;
+ char **argv = (char **)NULL;
+#endif
+
+ /* memory allocation for arguments of this command */
+#if TCL_MAJOR_VERSION >= 8
+ if (!inf->cmdinfo.isNativeObjectProc) {
+ /* string interface */
+ /* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
+ argv = RbTk_ALLOC_N(char *, (argc+1));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+ for (i = 0; i < argc; ++i) {
+ argv[i] = Tcl_GetStringFromObj(inf->objv[i], &len);
+ }
+ argv[argc] = (char *)NULL;
+ }
+#endif
+
+ Tcl_ResetResult(inf->ptr->ip);
+
+ /* Invoke the C procedure */
+#if TCL_MAJOR_VERSION >= 8
+ if (inf->cmdinfo.isNativeObjectProc) {
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData,
+ inf->ptr->ip, inf->objc, inf->objv);
+ }
+ else
+#endif
+ {
+#if TCL_MAJOR_VERSION >= 8
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
+ argc, (CONST84 char **)argv);
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
+ inf->argc, inf->argv);
+#endif
+ }
+
+ return Qnil;
+}
+
+
+#if TCL_MAJOR_VERSION >= 8
+static VALUE
+ip_invoke_core(interp, objc, objv)
+ VALUE interp;
+ int objc;
+ Tcl_Obj **objv;
+#else
+static VALUE
+ip_invoke_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ char **argv;
+#endif
+{
+ struct tcltkip *ptr;
+ Tcl_CmdInfo info;
+ char *cmd;
+ int len;
+ int thr_crit_bup;
+ int unknown_flag = 0;
+
+#if 1 /* wrap tcl-proc call */
+ struct invoke_info inf;
+ int status;
+#else
+#if TCL_MAJOR_VERSION >= 8
+ int argc = objc;
+ char **argv = (char **)NULL;
+ /* Tcl_Obj *resultPtr; */
+#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);
+#else /* TCL_MAJOR_VERSION < 8 */
+ cmd = argv[0];
+#endif
+
+ /* get the data struct */
+ ptr = get_ip(interp);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_tainted_str_new2("");
+ }
+
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+
+ /* map from the command name to a C procedure */
+ DUMP2("call Tcl_GetCommandInfo, %s", cmd);
+ if (!Tcl_GetCommandInfo(ptr->ip, cmd, &info)) {
+ DUMP1("error Tcl_GetCommandInfo");
+ DUMP1("try auto_load (call 'unknown' command)");
+ if (!Tcl_GetCommandInfo(ptr->ip,
+#if TCL_MAJOR_VERSION >= 8
+ "::unknown",
+#else
+ "unknown",
+#endif
+ &info)) {
+ DUMP1("fail to get 'unknown' command");
+ /* if (event_loop_abort_on_exc || cmd[0] != '.') { */
+ if (event_loop_abort_on_exc > 0) {
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ /*rb_ip_raise(obj,rb_eNameError,"invalid command name `%s'",cmd);*/
+ return create_ip_exc(interp, rb_eNameError,
+ "invalid command name `%s'", cmd);
+ } else {
+ if (event_loop_abort_on_exc < 0) {
+ rb_warning("invalid command name `%s' (ignore)", cmd);
+ } else {
+ rb_warn("invalid command name `%s' (ignore)", cmd);
+ }
+ Tcl_ResetResult(ptr->ip);
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ return rb_tainted_str_new2("");
+ }
+ } else {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **unknown_objv;
+#else
+ char **unknown_argv;
+#endif
+ DUMP1("find 'unknown' command -> set arguemnts");
+ unknown_flag = 1;
+
+#if TCL_MAJOR_VERSION >= 8
+ /* unknown_objv = (Tcl_Obj **)ALLOC_N(Tcl_Obj *, objc+2); */
+ unknown_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc+2));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)unknown_objv); /* XXXXXXXX */
+#endif
+ unknown_objv[0] = Tcl_NewStringObj("::unknown", 9);
+ Tcl_IncrRefCount(unknown_objv[0]);
+ memcpy(unknown_objv + 1, objv, sizeof(Tcl_Obj *)*objc);
+ unknown_objv[++objc] = (Tcl_Obj*)NULL;
+ objv = unknown_objv;
+#else
+ /* unknown_argv = (char **)ALLOC_N(char *, argc+2); */
+ unknown_argv = RbTk_ALLOC_N(char *, (argc+2));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)unknown_argv); /* XXXXXXXX */
+#endif
+ unknown_argv[0] = strdup("unknown");
+ memcpy(unknown_argv + 1, argv, sizeof(char *)*argc);
+ unknown_argv[++argc] = (char *)NULL;
+ argv = unknown_argv;
+#endif
+ }
+ }
+ DUMP1("end Tcl_GetCommandInfo");
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+#if 1 /* wrap tcl-proc call */
+ /* setup params */
+ inf.ptr = ptr;
+ inf.cmdinfo = info;
+#if TCL_MAJOR_VERSION >= 8
+ inf.objc = objc;
+ inf.objv = objv;
+#else
+ inf.argc = argc;
+ inf.argv = argv;
+#endif
+
+ /* invoke tcl-proc */
+ rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
+ switch(status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception = rb_exc_new2(rb_eException,
+ "unknown exception");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ break;
+
+ case TAG_FATAL:
+ if (NIL_P(rb_errinfo())) {
+ rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL");
+ } else {
+ rbtk_pending_exception = rb_errinfo();
+ }
+ }
+
+#else /* !wrap tcl-proc call */
+
+ /* memory allocation for arguments of this command */
+#if TCL_MAJOR_VERSION >= 8
+ if (!info.isNativeObjectProc) {
+ int i;
+
+ /* string interface */
+ /* argv = (char **)ALLOC_N(char *, argc+1); */
+ argv = RbTk_ALLOC_N(char *, (argc+1));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)argv); /* XXXXXXXX */
+#endif
+ for (i = 0; i < argc; ++i) {
+ argv[i] = Tcl_GetStringFromObj(objv[i], &len);
+ }
+ argv[argc] = (char *)NULL;
+ }
+#endif
+
+ Tcl_ResetResult(ptr->ip);
+
+ /* Invoke the C procedure */
+#if TCL_MAJOR_VERSION >= 8
+ if (info.isNativeObjectProc) {
+ ptr->return_value = (*info.objProc)(info.objClientData, ptr->ip,
+ objc, objv);
+#if 0
+ /* get the string value from the result object */
+ resultPtr = Tcl_GetObjResult(ptr->ip);
+ Tcl_SetResult(ptr->ip, Tcl_GetStringFromObj(resultPtr, &len),
+ TCL_VOLATILE);
+#endif
+ }
+ else
+#endif
+ {
+#if TCL_MAJOR_VERSION >= 8
+ ptr->return_value = (*info.proc)(info.clientData, ptr->ip,
+ argc, (CONST84 char **)argv);
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ ptr->return_value = (*info.proc)(info.clientData, ptr->ip,
+ argc, argv);
+#endif
+ }
+#endif /* ! wrap tcl-proc call */
+
+ /* free allocated memory for calling 'unknown' command */
+ if (unknown_flag) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(objv[0]);
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)objv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)objv); /* XXXXXXXX */
+#else
+ /* free(objv); */
+ ckfree((char*)objv);
+#endif
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+ free(argv[0]);
+ /* ckfree(argv[0]); */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)argv, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)argv); /* XXXXXXXX */
+#else
+ /* free(argv); */
+ ckfree((char*)argv);
+#endif
+#endif
+#endif
+ }
+
+ /* exception on mainloop */
+ if (pending_exception_check1(thr_crit_bup, ptr)) {
+ return rbtk_pending_exception;
+ }
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* if (ptr->return_value == TCL_ERROR) { */
+ if (ptr->return_value != TCL_OK) {
+ if (event_loop_abort_on_exc > 0 && !Tcl_InterpDeleted(ptr->ip)) {
+ switch (ptr->return_value) {
+ case TCL_RETURN:
+ return create_ip_exc(interp, eTkCallbackReturn,
+ "ip_invoke_core receives TCL_RETURN");
+ case TCL_BREAK:
+ return create_ip_exc(interp, eTkCallbackBreak,
+ "ip_invoke_core receives TCL_BREAK");
+ case TCL_CONTINUE:
+ return create_ip_exc(interp, eTkCallbackContinue,
+ "ip_invoke_core receives TCL_CONTINUE");
+ default:
+ return create_ip_exc(interp, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ }
+
+ } else {
+ if (event_loop_abort_on_exc < 0) {
+ rb_warning("%s (ignore)", Tcl_GetStringResult(ptr->ip));
+ } else {
+ rb_warn("%s (ignore)", Tcl_GetStringResult(ptr->ip));
+ }
+ Tcl_ResetResult(ptr->ip);
+ return rb_tainted_str_new2("");
+ }
+ }
+
+ /* pass back the result (as string) */
+ return ip_get_result_string_obj(ptr->ip);
+}
+
+
+#if TCL_MAJOR_VERSION >= 8
+static Tcl_Obj **
+#else /* TCL_MAJOR_VERSION < 8 */
+static char **
+#endif
+alloc_invoke_arguments(argc, argv)
+ int argc;
+ VALUE *argv;
+{
+ int i;
+ int thr_crit_bup;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **av;
+#else /* TCL_MAJOR_VERSION < 8 */
+ char **av;
+#endif
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* memory allocation */
+#if TCL_MAJOR_VERSION >= 8
+ /* av = ALLOC_N(Tcl_Obj *, argc+1);*/ /* XXXXXXXXXX */
+ av = RbTk_ALLOC_N(Tcl_Obj *, (argc+1));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)av); /* XXXXXXXX */
+#endif
+ for (i = 0; i < argc; ++i) {
+ av[i] = get_obj_from_str(argv[i]);
+ Tcl_IncrRefCount(av[i]);
+ }
+ av[argc] = NULL;
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ /* string interface */
+ /* av = ALLOC_N(char *, argc+1); */
+ av = RbTk_ALLOC_N(char *, (argc+1));
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)av); /* XXXXXXXX */
+#endif
+ for (i = 0; i < argc; ++i) {
+ av[i] = strdup(StringValuePtr(argv[i]));
+ }
+ av[argc] = NULL;
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ return av;
+}
+
+static void
+free_invoke_arguments(argc, av)
+ int argc;
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **av;
+#else /* TCL_MAJOR_VERSION < 8 */
+ char **av;
+#endif
+{
+ int i;
+
+ for (i = 0; i < argc; ++i) {
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_DecrRefCount(av[i]);
+ av[i] = (Tcl_Obj*)NULL;
+#else /* TCL_MAJOR_VERSION < 8 */
+ free(av[i]);
+ av[i] = (char*)NULL;
+#endif
+ }
+#if TCL_MAJOR_VERSION >= 8
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)av, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)av); /* XXXXXXXX */
+#else
+ ckfree((char*)av);
+#endif
+#endif
+#else /* TCL_MAJOR_VERSION < 8 */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)av, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)av); /* XXXXXXXX */
+#else
+ /* free(av); */
+ ckfree((char*)av);
+#endif
+#endif
+#endif
+}
+
+static VALUE
+ip_invoke_real(argc, argv, interp)
+ int argc;
+ VALUE *argv;
+ VALUE interp;
+{
+ VALUE v;
+ struct tcltkip *ptr; /* tcltkip data struct */
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **av = (Tcl_Obj **)NULL;
+#else /* TCL_MAJOR_VERSION < 8 */
+ char **av = (char **)NULL;
+#endif
+
+ DUMP2("invoke_real called by thread:%"PRIxVALUE, rb_thread_current());
+
+ /* get the data struct */
+ ptr = get_ip(interp);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_tainted_str_new2("");
+ }
+
+ /* allocate memory for arguments */
+ av = alloc_invoke_arguments(argc, argv);
+
+ /* Invoke the C procedure */
+ Tcl_ResetResult(ptr->ip);
+ v = ip_invoke_core(interp, argc, av);
+
+ /* free allocated memory */
+ free_invoke_arguments(argc, av);
+
+ return v;
+}
+
+VALUE
+ivq_safelevel_handler(arg, ivq)
+ VALUE arg;
+ VALUE ivq;
+{
+ struct invoke_queue *q;
+
+ Data_Get_Struct(ivq, struct invoke_queue, q);
+ DUMP2("(safe-level handler) $SAFE = %d", q->safe_level);
+ rb_set_safe_level(q->safe_level);
+ return ip_invoke_core(q->interp, q->argc, q->argv);
+}
+
+int invoke_queue_handler _((Tcl_Event *, int));
+int
+invoke_queue_handler(evPtr, flags)
+ Tcl_Event *evPtr;
+ int flags;
+{
+ struct invoke_queue *q = (struct invoke_queue *)evPtr;
+ volatile VALUE ret;
+ volatile VALUE q_dat;
+ volatile VALUE thread = q->thread;
+ struct tcltkip *ptr;
+
+ DUMP2("do_invoke_queue_handler : evPtr = %p", evPtr);
+ DUMP2("invoke queue_thread : %"PRIxVALUE, rb_thread_current());
+ DUMP2("added by thread : %"PRIxVALUE, thread);
+
+ if (*(q->done)) {
+ DUMP1("processed by another event-loop");
+ return 0;
+ } else {
+ DUMP1("process it on current event-loop");
+ }
+
+ if (RTEST(rb_thread_alive_p(thread))
+ && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) {
+ DUMP1("caller is not yet ready to receive the result -> pending");
+ return 0;
+ }
+
+ /* process it */
+ *(q->done) = 1;
+
+ /* deleted ipterp ? */
+ ptr = get_ip(q->interp);
+ if (deleted_ip(ptr)) {
+ /* deleted IP --> ignore */
+ return 1;
+ }
+
+ /* incr internal handler mark */
+ rbtk_internal_eventloop_handler++;
+
+ /* 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);
+ 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:%"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;
+ ret = (VALUE)NULL;
+
+ /* decr internal handler mark */
+ rbtk_internal_eventloop_handler--;
+
+ /* complete */
+ *(q->done) = -1;
+
+ /* unlink ruby objects */
+ q->interp = (VALUE)NULL;
+ q->result = (VALUE)NULL;
+ q->thread = (VALUE)NULL;
+
+ /* back to caller */
+ if (RTEST(rb_thread_alive_p(thread))) {
+ 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);
+#else
+ rb_thread_run(thread);
+#endif
+ DUMP1("finish back to caller");
+#if DO_THREAD_SCHEDULE_AT_CALLBACK_DONE
+ rb_thread_schedule();
+#endif
+ } else {
+ DUMP2("caller is dead (caller thread:%"PRIxVALUE")", thread);
+ DUMP2(" (current thread:%"PRIxVALUE")", rb_thread_current());
+ }
+
+ /* end of handler : remove it */
+ return 1;
+}
+
+static VALUE
+ip_invoke_with_position(argc, argv, obj, position)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+ Tcl_QueuePosition position;
+{
+ struct invoke_queue *ivq;
+#ifdef RUBY_USE_NATIVE_THREAD
+ struct tcltkip *ptr;
+#endif
+ int *alloc_done;
+ int thr_crit_bup;
+ volatile VALUE current = rb_thread_current();
+ volatile VALUE ip_obj = obj;
+ volatile VALUE result;
+ volatile VALUE ret;
+ struct timeval t;
+
+#if TCL_MAJOR_VERSION >= 8
+ Tcl_Obj **av = (Tcl_Obj **)NULL;
+#else /* TCL_MAJOR_VERSION < 8 */
+ char **av = (char **)NULL;
+#endif
+
+ if (argc < 1) {
+ rb_raise(rb_eArgError, "command name missing");
+ }
+
+#ifdef RUBY_USE_NATIVE_THREAD
+ ptr = get_ip(ip_obj);
+ DUMP2("invoke status: ptr->tk_thread_id %p", ptr->tk_thread_id);
+ DUMP2("invoke status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
+#else
+ DUMP2("status: Tcl_GetCurrentThread %p", Tcl_GetCurrentThread());
+#endif
+ DUMP2("status: eventloopt_thread %"PRIxVALUE, eventloop_thread);
+
+ if (
+#ifdef RUBY_USE_NATIVE_THREAD
+ (ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread())
+ &&
+#endif
+ (NIL_P(eventloop_thread) || current == eventloop_thread)
+ ) {
+ if (NIL_P(eventloop_thread)) {
+ DUMP2("invoke from thread:%"PRIxVALUE" but no eventloop", current);
+ } else {
+ DUMP2("invoke from current eventloop %"PRIxVALUE, current);
+ }
+ result = ip_invoke_real(argc, argv, ip_obj);
+ if (rb_obj_is_kind_of(result, rb_eException)) {
+ rb_exc_raise(result);
+ }
+ return result;
+ }
+
+ DUMP2("invoke from thread %"PRIxVALUE" (NOT current eventloop)", current);
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* allocate memory (for arguments) */
+ av = alloc_invoke_arguments(argc, argv);
+
+ /* allocate memory (keep result) */
+ /* alloc_done = (int*)ALLOC(int); */
+ alloc_done = RbTk_ALLOC_N(int, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)alloc_done); /* XXXXXXXX */
+#endif
+ *alloc_done = 0;
+
+ /* allocate memory (freed by Tcl_ServiceEvent) */
+ /* ivq = (struct invoke_queue *)Tcl_Alloc(sizeof(struct invoke_queue)); */
+ ivq = RbTk_ALLOC_N(struct invoke_queue, 1);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)ivq); /* XXXXXXXX */
+#endif
+
+ /* allocate result obj */
+ result = rb_ary_new3(1, Qnil);
+
+ /* construct event data */
+ ivq->done = alloc_done;
+ ivq->argc = argc;
+ ivq->argv = av;
+ ivq->interp = ip_obj;
+ ivq->result = result;
+ ivq->thread = current;
+ ivq->safe_level = rb_safe_level();
+ ivq->ev.proc = invoke_queue_handler;
+
+ /* add the handler to Tcl event queue */
+ DUMP1("add handler");
+#ifdef RUBY_USE_NATIVE_THREAD
+ if (ptr->tk_thread_id) {
+ /* Tcl_ThreadQueueEvent(ptr->tk_thread_id, &(ivq->ev), position); */
+ Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)ivq, position);
+ Tcl_ThreadAlert(ptr->tk_thread_id);
+ } else if (tk_eventloop_thread_id) {
+ /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id,
+ &(ivq->ev), position); */
+ Tcl_ThreadQueueEvent(tk_eventloop_thread_id,
+ (Tcl_Event*)ivq, position);
+ Tcl_ThreadAlert(tk_eventloop_thread_id);
+ } else {
+ /* Tcl_QueueEvent(&(ivq->ev), position); */
+ Tcl_QueueEvent((Tcl_Event*)ivq, position);
+ }
+#else
+ /* Tcl_QueueEvent(&(ivq->ev), position); */
+ Tcl_QueueEvent((Tcl_Event*)ivq, position);
+#endif
+
+ rb_thread_critical = thr_crit_bup;
+
+ /* wait for the handler to be processed */
+ t.tv_sec = 0;
+ t.tv_usec = (long)((EVENT_HANDLER_TIMEOUT)*1000.0);
+
+ 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:%"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:%"PRIxVALUE")", current);
+
+ /* get result & free allocated memory */
+ ret = RARRAY_PTR(result)[0];
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)alloc_done); /* XXXXXXXX */
+#else
+ /* free(alloc_done); */
+ ckfree((char*)alloc_done);
+#endif
+#endif
+
+#if 0 /* ivq is freed by Tcl_ServiceEvent */
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)ivq, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release(ivq);
+#else
+ ckfree((char*)ivq);
+#endif
+#endif
+#endif
+
+ /* free allocated memory */
+ free_invoke_arguments(argc, av);
+
+ /* exception? */
+ if (rb_obj_is_kind_of(ret, rb_eException)) {
+ 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)));
+ }
+
+ DUMP1("exit ip_invoke");
+ return ret;
+}
+
+
+/* get return code from Tcl_Eval() */
+static VALUE
+ip_retval(self)
+ VALUE self;
+{
+ struct tcltkip *ptr; /* tcltkip data struct */
+
+ /* get the data strcut */
+ ptr = get_ip(self);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_tainted_str_new2("");
+ }
+
+ return (INT2FIX(ptr->return_value));
+}
+
+static VALUE
+ip_invoke(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_TAIL);
+}
+
+static VALUE
+ip_invoke_immediate(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ /* POTENTIALY INSECURE : can create infinite loop */
+ return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_HEAD);
+}
+
+
+/* access Tcl variables */
+static VALUE
+ip_get_variable2_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ VALUE *argv;
+{
+ struct tcltkip *ptr = get_ip(interp);
+ int thr_crit_bup;
+ volatile VALUE varname, index, flag;
+
+ varname = argv[0];
+ index = argv[1];
+ flag = argv[2];
+
+ /*
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+ */
+
+#if TCL_MAJOR_VERSION >= 8
+ {
+ Tcl_Obj *ret;
+ volatile VALUE strval;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ rb_thread_critical = thr_crit_bup;
+ return rb_tainted_str_new2("");
+ } else {
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+ ret = Tcl_GetVar2Ex(ptr->ip, RSTRING_PTR(varname),
+ NIL_P(index) ? NULL : RSTRING_PTR(index),
+ FIX2INT(flag));
+ }
+
+ if (ret == (Tcl_Obj*)NULL) {
+ volatile VALUE exc;
+ /* exc = rb_exc_new2(rb_eRuntimeError,
+ Tcl_GetStringResult(ptr->ip)); */
+ exc = create_ip_exc(interp, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return exc;
+ }
+
+ Tcl_IncrRefCount(ret);
+ strval = get_str_from_obj(ret);
+ RbTk_OBJ_UNTRUST(strval);
+ Tcl_DecrRefCount(ret);
+
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return(strval);
+ }
+#else /* TCL_MAJOR_VERSION < 8 */
+ {
+ char *ret;
+ volatile VALUE strval;
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_tainted_str_new2("");
+ } else {
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+ ret = Tcl_GetVar2(ptr->ip, RSTRING_PTR(varname),
+ NIL_P(index) ? NULL : RSTRING_PTR(index),
+ FIX2INT(flag));
+ }
+
+ if (ret == (char*)NULL) {
+ volatile VALUE exc;
+ exc = rb_exc_new2(rb_eRuntimeError, Tcl_GetStringResult(ptr->ip));
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return exc;
+ }
+
+ strval = rb_tainted_str_new2(ret);
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+
+ return(strval);
+ }
+#endif
+}
+
+static VALUE
+ip_get_variable2(self, varname, index, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+ VALUE flag;
+{
+ VALUE argv[3];
+ VALUE retval;
+
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+
+ argv[0] = varname;
+ argv[1] = index;
+ argv[2] = flag;
+
+ retval = tk_funcall(ip_get_variable2_core, 3, argv, self);
+
+ if (NIL_P(retval)) {
+ return rb_tainted_str_new2("");
+ } else {
+ return retval;
+ }
+}
+
+static VALUE
+ip_get_variable(self, varname, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE flag;
+{
+ return ip_get_variable2(self, varname, Qnil, flag);
+}
+
+static VALUE
+ip_set_variable2_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ VALUE *argv;
+{
+ struct tcltkip *ptr = get_ip(interp);
+ int thr_crit_bup;
+ volatile VALUE varname, index, value, flag;
+
+ varname = argv[0];
+ index = argv[1];
+ value = argv[2];
+ flag = argv[3];
+
+ /*
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+ StringValue(value);
+ */
+
+#if TCL_MAJOR_VERSION >= 8
+ {
+ Tcl_Obj *valobj, *ret;
+ volatile VALUE strval;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ valobj = get_obj_from_str(value);
+ Tcl_IncrRefCount(valobj);
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ Tcl_DecrRefCount(valobj);
+ rb_thread_critical = thr_crit_bup;
+ return rb_tainted_str_new2("");
+ } else {
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+ ret = Tcl_SetVar2Ex(ptr->ip, RSTRING_PTR(varname),
+ NIL_P(index) ? NULL : RSTRING_PTR(index),
+ valobj, FIX2INT(flag));
+ }
+
+ Tcl_DecrRefCount(valobj);
+
+ if (ret == (Tcl_Obj*)NULL) {
+ volatile VALUE exc;
+ /* exc = rb_exc_new2(rb_eRuntimeError,
+ Tcl_GetStringResult(ptr->ip)); */
+ exc = create_ip_exc(interp, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+ return exc;
+ }
+
+ Tcl_IncrRefCount(ret);
+ strval = get_str_from_obj(ret);
+ RbTk_OBJ_UNTRUST(strval);
+ Tcl_DecrRefCount(ret);
+
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+
+ return(strval);
+ }
+#else /* TCL_MAJOR_VERSION < 8 */
+ {
+ CONST char *ret;
+ volatile VALUE strval;
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return rb_tainted_str_new2("");
+ } else {
+ /* Tcl_Preserve(ptr->ip); */
+ rbtk_preserve_ip(ptr);
+ ret = Tcl_SetVar2(ptr->ip, RSTRING_PTR(varname),
+ NIL_P(index) ? NULL : RSTRING_PTR(index),
+ RSTRING_PTR(value), FIX2INT(flag));
+ }
+
+ if (ret == (char*)NULL) {
+ return rb_exc_new2(rb_eRuntimeError, ptr->ip->result);
+ }
+
+ strval = rb_tainted_str_new2(ret);
+
+ /* Tcl_Release(ptr->ip); */
+ rbtk_release_ip(ptr);
+ rb_thread_critical = thr_crit_bup;
+
+ return(strval);
+ }
+#endif
+}
+
+static VALUE
+ip_set_variable2(self, varname, index, value, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+ VALUE value;
+ VALUE flag;
+{
+ VALUE argv[4];
+ VALUE retval;
+
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+ StringValue(value);
+
+ argv[0] = varname;
+ argv[1] = index;
+ argv[2] = value;
+ argv[3] = flag;
+
+ retval = tk_funcall(ip_set_variable2_core, 4, argv, self);
+
+ if (NIL_P(retval)) {
+ return rb_tainted_str_new2("");
+ } else {
+ return retval;
+ }
+}
+
+static VALUE
+ip_set_variable(self, varname, value, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE value;
+ VALUE flag;
+{
+ return ip_set_variable2(self, varname, Qnil, value, flag);
+}
+
+static VALUE
+ip_unset_variable2_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ VALUE *argv;
+{
+ struct tcltkip *ptr = get_ip(interp);
+ volatile VALUE varname, index, flag;
+
+ varname = argv[0];
+ index = argv[1];
+ flag = argv[2];
+
+ /*
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+ */
+
+ /* ip is deleted? */
+ if (deleted_ip(ptr)) {
+ return Qtrue;
+ }
+
+ ptr->return_value = Tcl_UnsetVar2(ptr->ip, RSTRING_PTR(varname),
+ NIL_P(index) ? NULL : RSTRING_PTR(index),
+ FIX2INT(flag));
+
+ if (ptr->return_value == TCL_ERROR) {
+ if (FIX2INT(flag) & TCL_LEAVE_ERR_MSG) {
+ /* return rb_exc_new2(rb_eRuntimeError,
+ Tcl_GetStringResult(ptr->ip)); */
+ return create_ip_exc(interp, rb_eRuntimeError, "%s",
+ Tcl_GetStringResult(ptr->ip));
+ }
+ return Qfalse;
+ }
+ return Qtrue;
+}
+
+static VALUE
+ip_unset_variable2(self, varname, index, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+ VALUE flag;
+{
+ VALUE argv[3];
+ VALUE retval;
+
+ StringValue(varname);
+ if (!NIL_P(index)) StringValue(index);
+
+ argv[0] = varname;
+ argv[1] = index;
+ argv[2] = flag;
+
+ retval = tk_funcall(ip_unset_variable2_core, 3, argv, self);
+
+ if (NIL_P(retval)) {
+ return rb_tainted_str_new2("");
+ } else {
+ return retval;
+ }
+}
+
+static VALUE
+ip_unset_variable(self, varname, flag)
+ VALUE self;
+ VALUE varname;
+ VALUE flag;
+{
+ return ip_unset_variable2(self, varname, Qnil, flag);
+}
+
+static VALUE
+ip_get_global_var(self, varname)
+ VALUE self;
+ VALUE varname;
+{
+ return ip_get_variable(self, varname,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+static VALUE
+ip_get_global_var2(self, varname, index)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+{
+ return ip_get_variable2(self, varname, index,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+static VALUE
+ip_set_global_var(self, varname, value)
+ VALUE self;
+ VALUE varname;
+ VALUE value;
+{
+ return ip_set_variable(self, varname, value,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+static VALUE
+ip_set_global_var2(self, varname, index, value)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+ VALUE value;
+{
+ return ip_set_variable2(self, varname, index, value,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+static VALUE
+ip_unset_global_var(self, varname)
+ VALUE self;
+ VALUE varname;
+{
+ return ip_unset_variable(self, varname,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+static VALUE
+ip_unset_global_var2(self, varname, index)
+ VALUE self;
+ VALUE varname;
+ VALUE index;
+{
+ return ip_unset_variable2(self, varname, index,
+ INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
+}
+
+
+/* treat Tcl_List */
+static VALUE
+lib_split_tklist_core(ip_obj, list_str)
+ VALUE ip_obj;
+ VALUE list_str;
+{
+ Tcl_Interp *interp;
+ volatile VALUE ary, elem;
+ int idx;
+ int taint_flag = OBJ_TAINTED(list_str);
+#ifdef HAVE_RUBY_ENCODING_H
+ int list_enc_idx;
+ volatile VALUE list_ivar_enc;
+#endif
+ int result;
+ VALUE old_gc;
+
+ tcl_stubs_check();
+
+ if (NIL_P(ip_obj)) {
+ interp = (Tcl_Interp *)NULL;
+ } else if (get_ip(ip_obj) == (struct tcltkip *)NULL) {
+ interp = (Tcl_Interp *)NULL;
+ } else {
+ interp = get_ip(ip_obj)->ip;
+ }
+
+ StringValue(list_str);
+#ifdef HAVE_RUBY_ENCODING_H
+ list_enc_idx = rb_enc_get_index(list_str);
+ list_ivar_enc = rb_ivar_get(list_str, ID_at_enc);
+#endif
+
+ {
+#if TCL_MAJOR_VERSION >= 8
+ /* object style interface */
+ Tcl_Obj *listobj;
+ int objc;
+ Tcl_Obj **objv;
+ int thr_crit_bup;
+
+ listobj = get_obj_from_str(list_str);
+
+ Tcl_IncrRefCount(listobj);
+
+ result = Tcl_ListObjGetElements(interp, listobj, &objc, &objv);
+
+ if (result == TCL_ERROR) {
+ Tcl_DecrRefCount(listobj);
+ if (interp == (Tcl_Interp*)NULL) {
+ rb_raise(rb_eRuntimeError, "can't get elements from list");
+ } else {
+ rb_raise(rb_eRuntimeError, "%s", Tcl_GetStringResult(interp));
+ }
+ }
+
+ for(idx = 0; idx < objc; idx++) {
+ Tcl_IncrRefCount(objv[idx]);
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ ary = rb_ary_new2(objc);
+ if (taint_flag) RbTk_OBJ_UNTRUST(ary);
+
+ old_gc = rb_gc_disable();
+
+ for(idx = 0; idx < objc; idx++) {
+ elem = get_str_from_obj(objv[idx]);
+ if (taint_flag) RbTk_OBJ_UNTRUST(elem);
+
+#ifdef HAVE_RUBY_ENCODING_H
+ if (rb_enc_get_index(elem) == ENCODING_INDEX_BINARY) {
+ rb_enc_associate_index(elem, ENCODING_INDEX_BINARY);
+ rb_ivar_set(elem, ID_at_enc, ENCODING_NAME_BINARY);
+ } else {
+ rb_enc_associate_index(elem, list_enc_idx);
+ rb_ivar_set(elem, ID_at_enc, list_ivar_enc);
+ }
+#endif
+ /* RARRAY(ary)->ptr[idx] = elem; */
+ rb_ary_push(ary, elem);
+ }
+
+ /* RARRAY(ary)->len = objc; */
+
+ if (old_gc == Qfalse) rb_gc_enable();
+
+ rb_thread_critical = thr_crit_bup;
+
+ for(idx = 0; idx < objc; idx++) {
+ Tcl_DecrRefCount(objv[idx]);
+ }
+
+ Tcl_DecrRefCount(listobj);
+
+#else /* TCL_MAJOR_VERSION < 8 */
+ /* string style interface */
+ int argc;
+ char **argv;
+
+ if (Tcl_SplitList(interp, RSTRING_PTR(list_str),
+ &argc, &argv) == TCL_ERROR) {
+ if (interp == (Tcl_Interp*)NULL) {
+ rb_raise(rb_eRuntimeError, "can't get elements from list");
+ } else {
+ rb_raise(rb_eRuntimeError, "%s", interp->result);
+ }
+ }
+
+ ary = rb_ary_new2(argc);
+ if (taint_flag) RbTk_OBJ_UNTRUST(ary);
+
+ old_gc = rb_gc_disable();
+
+ for(idx = 0; idx < argc; idx++) {
+ if (taint_flag) {
+ elem = rb_tainted_str_new2(argv[idx]);
+ } else {
+ elem = rb_str_new2(argv[idx]);
+ }
+ /* rb_ivar_set(elem, ID_at_enc, rb_str_new2("binary")); */
+ /* RARRAY(ary)->ptr[idx] = elem; */
+ rb_ary_push(ary, elem)
+ }
+ /* RARRAY(ary)->len = argc; */
+
+ if (old_gc == Qfalse) rb_gc_enable();
+#endif
+ }
+
+ return ary;
+}
+
+static VALUE
+lib_split_tklist(self, list_str)
+ VALUE self;
+ VALUE list_str;
+{
+ return lib_split_tklist_core(Qnil, list_str);
+}
+
+
+static VALUE
+ip_split_tklist(self, list_str)
+ VALUE self;
+ VALUE list_str;
+{
+ return lib_split_tklist_core(self, list_str);
+}
+
+static VALUE
+lib_merge_tklist(argc, argv, obj)
+ int argc;
+ VALUE *argv;
+ VALUE obj;
+{
+ int num, len;
+ int *flagPtr;
+ char *dst, *result;
+ volatile VALUE str;
+ int taint_flag = 0;
+ int thr_crit_bup;
+ VALUE old_gc;
+
+ if (argc == 0) return rb_str_new2("");
+
+ tcl_stubs_check();
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ old_gc = rb_gc_disable();
+
+ /* based on Tcl/Tk's Tcl_Merge() */
+ /* flagPtr = ALLOC_N(int, argc); */
+ flagPtr = RbTk_ALLOC_N(int, argc);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)flagPtr); /* XXXXXXXXXX */
+#endif
+
+ /* pass 1 */
+ len = 1;
+ for(num = 0; num < argc; num++) {
+ if (OBJ_TAINTED(argv[num])) taint_flag = 1;
+ dst = StringValuePtr(argv[num]);
+#if TCL_MAJOR_VERSION >= 8
+ len += Tcl_ScanCountedElement(dst, RSTRING_LENINT(argv[num]),
+ &flagPtr[num]) + 1;
+#else /* TCL_MAJOR_VERSION < 8 */
+ len += Tcl_ScanElement(dst, &flagPtr[num]) + 1;
+#endif
+ }
+
+ /* pass 2 */
+ /* result = (char *)Tcl_Alloc(len); */
+ result = (char *)ckalloc(len);
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Preserve((ClientData)result);
+#endif
+ dst = result;
+ for(num = 0; num < argc; num++) {
+#if TCL_MAJOR_VERSION >= 8
+ len = Tcl_ConvertCountedElement(RSTRING_PTR(argv[num]),
+ RSTRING_LENINT(argv[num]),
+ dst, flagPtr[num]);
+#else /* TCL_MAJOR_VERSION < 8 */
+ len = Tcl_ConvertElement(RSTRING_PTR(argv[num]), dst, flagPtr[num]);
+#endif
+ dst += len;
+ *dst = ' ';
+ dst++;
+ }
+ if (dst == result) {
+ *dst = 0;
+ } else {
+ dst[-1] = 0;
+ }
+
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)flagPtr, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)flagPtr);
+#else
+ /* free(flagPtr); */
+ ckfree((char*)flagPtr);
+#endif
+#endif
+
+ /* create object */
+ str = rb_str_new(result, dst - result - 1);
+ if (taint_flag) RbTk_OBJ_UNTRUST(str);
+#if 0 /* use Tcl_EventuallyFree */
+ Tcl_EventuallyFree((ClientData)result, TCL_DYNAMIC); /* XXXXXXXX */
+#else
+#if 0 /* use Tcl_Preserve/Release */
+ Tcl_Release((ClientData)result); /* XXXXXXXXXXX */
+#else
+ /* Tcl_Free(result); */
+ ckfree(result);
+#endif
+#endif
+
+ if (old_gc == Qfalse) rb_gc_enable();
+ rb_thread_critical = thr_crit_bup;
+
+ return str;
+}
+
+static VALUE
+lib_conv_listelement(self, src)
+ VALUE self;
+ VALUE src;
+{
+ int len, scan_flag;
+ volatile VALUE dst;
+ int taint_flag = OBJ_TAINTED(src);
+ int thr_crit_bup;
+
+ tcl_stubs_check();
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ StringValue(src);
+
+#if TCL_MAJOR_VERSION >= 8
+ len = Tcl_ScanCountedElement(RSTRING_PTR(src), RSTRING_LENINT(src),
+ &scan_flag);
+ dst = rb_str_new(0, len + 1);
+ len = Tcl_ConvertCountedElement(RSTRING_PTR(src), RSTRING_LENINT(src),
+ RSTRING_PTR(dst), scan_flag);
+#else /* TCL_MAJOR_VERSION < 8 */
+ len = Tcl_ScanElement(RSTRING_PTR(src), &scan_flag);
+ dst = rb_str_new(0, len + 1);
+ len = Tcl_ConvertElement(RSTRING_PTR(src), RSTRING_PTR(dst), scan_flag);
+#endif
+
+ rb_str_resize(dst, len);
+ if (taint_flag) RbTk_OBJ_UNTRUST(dst);
+
+ rb_thread_critical = thr_crit_bup;
+
+ return dst;
+}
+
+static VALUE
+lib_getversion(self)
+ VALUE self;
+{
+ set_tcltk_version();
+
+ return rb_ary_new3(4, INT2NUM(tcltk_version.major),
+ INT2NUM(tcltk_version.minor),
+ INT2NUM(tcltk_version.type),
+ INT2NUM(tcltk_version.patchlevel));
+}
+
+static VALUE
+lib_get_reltype_name(self)
+ VALUE self;
+{
+ set_tcltk_version();
+
+ switch(tcltk_version.type) {
+ case TCL_ALPHA_RELEASE:
+ return rb_str_new2("alpha");
+ case TCL_BETA_RELEASE:
+ return rb_str_new2("beta");
+ case TCL_FINAL_RELEASE:
+ return rb_str_new2("final");
+ default:
+ rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number");
+ }
+
+ UNREACHABLE;
+}
+
+
+static VALUE
+tcltklib_compile_info()
+{
+ volatile VALUE ret;
+ size_t size;
+ static CONST char form[]
+ = "tcltklib %s :: Ruby%s (%s) %s pthread :: Tcl%s(%s)/Tk%s(%s) %s";
+ char *info;
+
+ size = strlen(form)
+ + strlen(TCLTKLIB_RELEASE_DATE)
+ + strlen(RUBY_VERSION)
+ + strlen(RUBY_RELEASE_DATE)
+ + strlen("without")
+ + strlen(TCL_PATCH_LEVEL)
+ + strlen("without stub")
+ + strlen(TK_PATCH_LEVEL)
+ + strlen("without stub")
+ + strlen("unknown tcl_threads");
+
+ info = ALLOC_N(char, size);
+ /* info = ckalloc(sizeof(char) * size); */ /* SEGV */
+
+ sprintf(info, form,
+ TCLTKLIB_RELEASE_DATE,
+ RUBY_VERSION, RUBY_RELEASE_DATE,
+#ifdef HAVE_NATIVETHREAD
+ "with",
+#else
+ "without",
+#endif
+ TCL_PATCH_LEVEL,
+#ifdef USE_TCL_STUBS
+ "with stub",
+#else
+ "without stub",
+#endif
+ TK_PATCH_LEVEL,
+#ifdef USE_TK_STUBS
+ "with stub",
+#else
+ "without stub",
+#endif
+#ifdef WITH_TCL_ENABLE_THREAD
+# if WITH_TCL_ENABLE_THREAD
+ "with tcl_threads"
+# else
+ "without tcl_threads"
+# endif
+#else
+ "unknown tcl_threads"
+#endif
+ );
+
+ ret = rb_obj_freeze(rb_str_new2(info));
+
+ xfree(info);
+ /* ckfree(info); */
+
+ return ret;
+}
+
+
+/*###############################################*/
+
+static VALUE
+create_dummy_encoding_for_tk_core(interp, name, error_mode)
+ VALUE interp;
+ VALUE name;
+ VALUE error_mode;
+{
+ get_ip(interp);
+
+
+ StringValue(name);
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
+ if (Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(name)) == (Tcl_Encoding)NULL) {
+ if (RTEST(error_mode)) {
+ rb_raise(rb_eArgError, "invalid Tk encoding name '%s'",
+ RSTRING_PTR(name));
+ } else {
+ return Qnil;
+ }
+ }
+#endif
+
+#ifdef HAVE_RUBY_ENCODING_H
+ if (RTEST(rb_define_dummy_encoding(RSTRING_PTR(name)))) {
+ int idx = rb_enc_find_index(StringValueCStr(name));
+ return rb_enc_from_encoding(rb_enc_from_index(idx));
+ } else {
+ if (RTEST(error_mode)) {
+ rb_raise(rb_eRuntimeError, "fail to create dummy encoding for '%s'",
+ RSTRING_PTR(name));
+ } else {
+ return Qnil;
+ }
+ }
+
+ UNREACHABLE;
+#else
+ return name;
+#endif
+}
+static VALUE
+create_dummy_encoding_for_tk(interp, name)
+ VALUE interp;
+ VALUE name;
+{
+ return create_dummy_encoding_for_tk_core(interp, name, Qtrue);
+}
+
+
+#ifdef HAVE_RUBY_ENCODING_H
+static int
+update_encoding_table(table, interp, error_mode)
+ VALUE table;
+ VALUE interp;
+ VALUE error_mode;
+{
+ struct tcltkip *ptr;
+ int retry = 0;
+ int i, idx, objc;
+ Tcl_Obj **objv;
+ Tcl_Obj *enc_list;
+ volatile VALUE encname = Qnil;
+ volatile VALUE encobj = Qnil;
+
+ /* interpreter check */
+ if (NIL_P(interp)) return 0;
+ ptr = get_ip(interp);
+ if (ptr == (struct tcltkip *) NULL) return 0;
+ if (deleted_ip(ptr)) return 0;
+
+ /* get Tcl's encoding list */
+ Tcl_GetEncodingNames(ptr->ip);
+ enc_list = Tcl_GetObjResult(ptr->ip);
+ Tcl_IncrRefCount(enc_list);
+
+ if (Tcl_ListObjGetElements(ptr->ip, enc_list,
+ &objc, &objv) != TCL_OK) {
+ Tcl_DecrRefCount(enc_list);
+ /* rb_raise(rb_eRuntimeError, "failt to get Tcl's encoding names");*/
+ return 0;
+ }
+
+ /* check each encoding name */
+ for(i = 0; i < objc; i++) {
+ encname = rb_str_new2(Tcl_GetString(objv[i]));
+ if (NIL_P(rb_hash_lookup(table, encname))) {
+ /* new Tk encoding -> add to table */
+ idx = rb_enc_find_index(StringValueCStr(encname));
+ if (idx < 0) {
+ encobj = create_dummy_encoding_for_tk_core(interp,encname,error_mode);
+ } else {
+ encobj = rb_enc_from_encoding(rb_enc_from_index(idx));
+ }
+ encname = rb_obj_freeze(encname);
+ rb_hash_aset(table, encname, encobj);
+ if (!NIL_P(encobj) && NIL_P(rb_hash_lookup(table, encobj))) {
+ rb_hash_aset(table, encobj, encname);
+ }
+ retry = 1;
+ }
+ }
+
+ Tcl_DecrRefCount(enc_list);
+
+ return retry;
+}
+
+static VALUE
+encoding_table_get_name_core(table, enc_arg, error_mode)
+ VALUE table;
+ VALUE enc_arg;
+ VALUE error_mode;
+{
+ volatile VALUE enc = enc_arg;
+ volatile VALUE name = Qnil;
+ volatile VALUE tmp = Qnil;
+ volatile VALUE interp = rb_ivar_get(table, ID_at_interp);
+ struct tcltkip *ptr = (struct tcltkip *) NULL;
+ int idx;
+
+ /* deleted interp ? */
+ if (!NIL_P(interp)) {
+ ptr = get_ip(interp);
+ if (deleted_ip(ptr)) {
+ ptr = (struct tcltkip *) NULL;
+ }
+ }
+
+ /* encoding argument check */
+ /* 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);
+ }
+ }
+ /* 2nd: Encoding.default_internal */
+ if (NIL_P(enc)) {
+ enc = rb_enc_default_internal();
+ }
+ /* 3rd: encoding system of Tcl/Tk */
+ if (NIL_P(enc)) {
+ enc = rb_str_new2(Tcl_GetEncodingName((Tcl_Encoding)NULL));
+ }
+ /* 4th: Encoding.default_external */
+ if (NIL_P(enc)) {
+ enc = rb_enc_default_external();
+ }
+ /* 5th: Encoding.locale_charmap */
+ if (NIL_P(enc)) {
+ enc = rb_locale_charmap(rb_cEncoding);
+ }
+
+ if (RTEST(rb_obj_is_kind_of(enc, cRubyEncoding))) {
+ /* Ruby's Encoding object */
+ name = rb_hash_lookup(table, enc);
+ if (!NIL_P(name)) {
+ /* find */
+ return name;
+ }
+
+ /* is it new ? */
+ /* update check of Tk encoding names */
+ if (update_encoding_table(table, interp, error_mode)) {
+ /* add new relations to the table */
+ /* RETRY: registered Ruby encoding? */
+ name = rb_hash_lookup(table, enc);
+ if (!NIL_P(name)) {
+ /* find */
+ return name;
+ }
+ }
+ /* fail to find */
+
+ } else {
+ /* String or Symbol? */
+ name = rb_funcall(enc, ID_to_s, 0, 0);
+
+ if (!NIL_P(rb_hash_lookup(table, name))) {
+ /* find */
+ return name;
+ }
+
+ /* is it new ? */
+ idx = rb_enc_find_index(StringValueCStr(name));
+ if (idx >= 0) {
+ enc = rb_enc_from_encoding(rb_enc_from_index(idx));
+
+ /* registered Ruby encoding? */
+ tmp = rb_hash_lookup(table, enc);
+ if (!NIL_P(tmp)) {
+ /* find */
+ return tmp;
+ }
+
+ /* update check of Tk encoding names */
+ if (update_encoding_table(table, interp, error_mode)) {
+ /* add new relations to the table */
+ /* RETRY: registered Ruby encoding? */
+ tmp = rb_hash_lookup(table, enc);
+ if (!NIL_P(tmp)) {
+ /* find */
+ return tmp;
+ }
+ }
+ }
+ /* fail to find */
+ }
+
+ if (RTEST(error_mode)) {
+ enc = rb_funcall(enc_arg, ID_to_s, 0, 0);
+ rb_raise(rb_eArgError, "unsupported Tk encoding '%s'", RSTRING_PTR(enc));
+ }
+ return Qnil;
+}
+static VALUE
+encoding_table_get_obj_core(table, enc, error_mode)
+ VALUE table;
+ VALUE enc;
+ VALUE error_mode;
+{
+ volatile VALUE obj = Qnil;
+
+ obj = rb_hash_lookup(table,
+ encoding_table_get_name_core(table, enc, error_mode));
+ if (RTEST(rb_obj_is_kind_of(obj, cRubyEncoding))) {
+ return obj;
+ } else {
+ return Qnil;
+ }
+}
+
+#else /* ! HAVE_RUBY_ENCODING_H */
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
+static int
+update_encoding_table(table, interp, error_mode)
+ VALUE table;
+ VALUE interp;
+ VALUE error_mode;
+{
+ struct tcltkip *ptr;
+ int retry = 0;
+ int i, objc;
+ Tcl_Obj **objv;
+ Tcl_Obj *enc_list;
+ volatile VALUE encname = Qnil;
+
+ /* interpreter check */
+ if (NIL_P(interp)) return 0;
+ ptr = get_ip(interp);
+ if (ptr == (struct tcltkip *) NULL) return 0;
+ if (deleted_ip(ptr)) return 0;
+
+ /* get Tcl's encoding list */
+ Tcl_GetEncodingNames(ptr->ip);
+ enc_list = Tcl_GetObjResult(ptr->ip);
+ Tcl_IncrRefCount(enc_list);
+
+ if (Tcl_ListObjGetElements(ptr->ip, enc_list, &objc, &objv) != TCL_OK) {
+ Tcl_DecrRefCount(enc_list);
+ /* rb_raise(rb_eRuntimeError, "failt to get Tcl's encoding names"); */
+ return 0;
+ }
+
+ /* get encoding name and set it to table */
+ for(i = 0; i < objc; i++) {
+ encname = rb_str_new2(Tcl_GetString(objv[i]));
+ if (NIL_P(rb_hash_lookup(table, encname))) {
+ /* new Tk encoding -> add to table */
+ encname = rb_obj_freeze(encname);
+ rb_hash_aset(table, encname, encname);
+ retry = 1;
+ }
+ }
+
+ Tcl_DecrRefCount(enc_list);
+
+ return retry;
+}
+
+static VALUE
+encoding_table_get_name_core(table, enc, error_mode)
+ VALUE table;
+ VALUE enc;
+ VALUE error_mode;
+{
+ volatile VALUE name = Qnil;
+
+ enc = rb_funcall(enc, ID_to_s, 0, 0);
+ name = rb_hash_lookup(table, enc);
+
+ if (!NIL_P(name)) {
+ /* find */
+ return name;
+ }
+
+ /* update check */
+ if (update_encoding_table(table, rb_ivar_get(table, ID_at_interp),
+ error_mode)) {
+ /* add new relations to the table */
+ /* RETRY: registered Ruby encoding? */
+ name = rb_hash_lookup(table, enc);
+ if (!NIL_P(name)) {
+ /* find */
+ return name;
+ }
+ }
+
+ if (RTEST(error_mode)) {
+ rb_raise(rb_eArgError, "unsupported Tk encoding '%s'", RSTRING_PTR(enc));
+ }
+ return Qnil;
+}
+static VALUE
+encoding_table_get_obj_core(table, enc, error_mode)
+ VALUE table;
+ VALUE enc;
+ VALUE error_mode;
+{
+ return encoding_table_get_name_core(table, enc, error_mode);
+}
+
+#else /* Tcl/Tk 7.x or 8.0 */
+static VALUE
+encoding_table_get_name_core(table, enc, error_mode)
+ VALUE table;
+ VALUE enc;
+ VALUE error_mode;
+{
+ return Qnil;
+}
+static VALUE
+encoding_table_get_obj_core(table, enc, error_mode)
+ VALUE table;
+ VALUE enc;
+ VALUE error_mode;
+{
+ return Qnil;
+}
+#endif /* end of dependency for the version of Tcl/Tk */
+#endif
+
+static VALUE
+encoding_table_get_name(table, enc)
+ VALUE table;
+ VALUE enc;
+{
+ return encoding_table_get_name_core(table, enc, Qtrue);
+}
+static VALUE
+encoding_table_get_obj(table, enc)
+ VALUE table;
+ VALUE enc;
+{
+ return encoding_table_get_obj_core(table, enc, Qtrue);
+}
+
+#ifdef HAVE_RUBY_ENCODING_H
+static VALUE
+create_encoding_table_core(arg, interp)
+ VALUE arg;
+ VALUE interp;
+{
+ struct tcltkip *ptr = get_ip(interp);
+ volatile VALUE table = rb_hash_new();
+ volatile VALUE encname = Qnil;
+ volatile VALUE encobj = Qnil;
+ int i, idx, objc;
+ Tcl_Obj **objv;
+ Tcl_Obj *enc_list;
+
+#ifdef HAVE_RB_SET_SAFE_LEVEL_FORCE
+ rb_set_safe_level_force(0);
+#else
+ rb_set_safe_level(0);
+#endif
+
+ /* set 'binary' encoding */
+ encobj = rb_enc_from_encoding(rb_enc_from_index(ENCODING_INDEX_BINARY));
+ rb_hash_aset(table, ENCODING_NAME_BINARY, encobj);
+ rb_hash_aset(table, encobj, ENCODING_NAME_BINARY);
+
+
+ /* Tcl stub check */
+ tcl_stubs_check();
+
+ /* get Tcl's encoding list */
+ Tcl_GetEncodingNames(ptr->ip);
+ enc_list = Tcl_GetObjResult(ptr->ip);
+ Tcl_IncrRefCount(enc_list);
+
+ if (Tcl_ListObjGetElements(ptr->ip, enc_list, &objc, &objv) != TCL_OK) {
+ Tcl_DecrRefCount(enc_list);
+ rb_raise(rb_eRuntimeError, "failt to get Tcl's encoding names");
+ }
+
+ /* get encoding name and set it to table */
+ for(i = 0; i < objc; i++) {
+ int name2obj, obj2name;
+
+ name2obj = 1; obj2name = 1;
+ encname = rb_obj_freeze(rb_str_new2(Tcl_GetString(objv[i])));
+ idx = rb_enc_find_index(StringValueCStr(encname));
+ if (idx < 0) {
+ /* fail to find ruby encoding -> check known encoding */
+ if (strcmp(RSTRING_PTR(encname), "identity") == 0) {
+ name2obj = 1; obj2name = 0;
+ idx = ENCODING_INDEX_BINARY;
+
+ } else if (strcmp(RSTRING_PTR(encname), "shiftjis") == 0) {
+ name2obj = 1; obj2name = 0;
+ idx = rb_enc_find_index("Shift_JIS");
+
+ } else if (strcmp(RSTRING_PTR(encname), "unicode") == 0) {
+ name2obj = 1; obj2name = 0;
+ idx = ENCODING_INDEX_UTF8;
+
+ } else if (strcmp(RSTRING_PTR(encname), "symbol") == 0) {
+ name2obj = 1; obj2name = 0;
+ idx = rb_enc_find_index("ASCII-8BIT");
+
+ } else {
+ /* regist dummy encoding */
+ name2obj = 1; obj2name = 1;
+ }
+ }
+
+ if (idx < 0) {
+ /* unknown encoding -> create dummy */
+ encobj = create_dummy_encoding_for_tk(interp, encname);
+ } else {
+ encobj = rb_enc_from_encoding(rb_enc_from_index(idx));
+ }
+
+ if (name2obj) {
+ DUMP2("create_encoding_table: name2obj: %s", RSTRING_PTR(encname));
+ rb_hash_aset(table, encname, encobj);
+ }
+ if (obj2name) {
+ DUMP2("create_encoding_table: obj2name: %s", RSTRING_PTR(encname));
+ rb_hash_aset(table, encobj, encname);
+ }
+ }
+
+ Tcl_DecrRefCount(enc_list);
+
+ rb_ivar_set(table, ID_at_interp, interp);
+ rb_ivar_set(interp, ID_encoding_table, table);
+
+ return table;
+}
+
+#else /* ! HAVE_RUBY_ENCODING_H */
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1)
+static VALUE
+create_encoding_table_core(arg, interp)
+ VALUE arg;
+ VALUE interp;
+{
+ struct tcltkip *ptr = get_ip(interp);
+ volatile VALUE table = rb_hash_new();
+ volatile VALUE encname = Qnil;
+ int i, objc;
+ Tcl_Obj **objv;
+ Tcl_Obj *enc_list;
+
+
+ /* set 'binary' encoding */
+ rb_hash_aset(table, ENCODING_NAME_BINARY, ENCODING_NAME_BINARY);
+
+ /* get Tcl's encoding list */
+ Tcl_GetEncodingNames(ptr->ip);
+ enc_list = Tcl_GetObjResult(ptr->ip);
+ Tcl_IncrRefCount(enc_list);
+
+ if (Tcl_ListObjGetElements(ptr->ip, enc_list, &objc, &objv) != TCL_OK) {
+ Tcl_DecrRefCount(enc_list);
+ rb_raise(rb_eRuntimeError, "failt to get Tcl's encoding names");
+ }
+
+ /* get encoding name and set it to table */
+ for(i = 0; i < objc; i++) {
+ encname = rb_obj_freeze(rb_str_new2(Tcl_GetString(objv[i])));
+ rb_hash_aset(table, encname, encname);
+ }
+
+ Tcl_DecrRefCount(enc_list);
+
+ rb_ivar_set(table, ID_at_interp, interp);
+ rb_ivar_set(interp, ID_encoding_table, table);
+
+ return table;
+}
+
+#else /* Tcl/Tk 7.x or 8.0 */
+static VALUE
+create_encoding_table_core(arg, interp)
+ VALUE arg;
+ VALUE interp;
+{
+ volatile VALUE table = rb_hash_new();
+ rb_ivar_set(interp, ID_encoding_table, table);
+ return table;
+}
+#endif
+#endif
+
+static VALUE
+create_encoding_table(interp)
+ VALUE interp;
+{
+ return rb_funcall(rb_proc_new(create_encoding_table_core, interp),
+ ID_call, 0);
+}
+
+static VALUE
+ip_get_encoding_table(interp)
+ VALUE interp;
+{
+ volatile VALUE table = Qnil;
+
+ table = rb_ivar_get(interp, ID_encoding_table);
+
+ if (NIL_P(table)) {
+ /* initialize encoding_table */
+ table = create_encoding_table(interp);
+ rb_define_singleton_method(table, "get_name", encoding_table_get_name, 1);
+ rb_define_singleton_method(table, "get_obj", encoding_table_get_obj, 1);
+ }
+
+ return table;
+}
+
+
+/*###############################################*/
+
+/*
+ * The following is based on tkMenu.[ch]
+ * of Tcl/Tk (Tk8.0 -- Tk8.5b1) source code.
+ */
+#if TCL_MAJOR_VERSION >= 8
+
+#define MASTER_MENU 0
+#define TEAROFF_MENU 1
+#define MENUBAR 2
+
+struct dummy_TkMenuEntry {
+ int type;
+ struct dummy_TkMenu *menuPtr;
+ /* , and etc. */
+};
+
+struct dummy_TkMenu {
+ Tk_Window tkwin;
+ Display *display;
+ Tcl_Interp *interp;
+ Tcl_Command widgetCmd;
+ struct dummy_TkMenuEntry **entries;
+ int numEntries;
+ int active;
+ int menuType; /* MASTER_MENU, TEAROFF_MENU, or MENUBAR */
+ Tcl_Obj *menuTypePtr;
+ /* , and etc. */
+};
+
+struct dummy_TkMenuRef {
+ struct dummy_TkMenu *menuPtr;
+ char *dummy1;
+ char *dummy2;
+ char *dummy3;
+};
+
+#if 0 /* was available on Tk8.0 -- Tk8.4 */
+EXTERN struct dummy_TkMenuRef *TkFindMenuReferences(Tcl_Interp*, char*);
+#else /* based on Tk8.0 -- Tk8.5.0 */
+#define MENU_HASH_KEY "tkMenus"
+#endif
+
+#endif
+
+static VALUE
+ip_make_menu_embeddable_core(interp, argc, argv)
+ VALUE interp;
+ int argc;
+ VALUE *argv;
+{
+#if TCL_MAJOR_VERSION >= 8
+ volatile VALUE menu_path;
+ struct tcltkip *ptr = get_ip(interp);
+ struct dummy_TkMenuRef *menuRefPtr = NULL;
+ XEvent event;
+ Tcl_HashTable *menuTablePtr;
+ Tcl_HashEntry *hashEntryPtr;
+
+ menu_path = argv[0];
+ StringValue(menu_path);
+
+#if 0 /* was available on Tk8.0 -- Tk8.4 */
+ menuRefPtr = TkFindMenuReferences(ptr->ip, RSTRING_PTR(menu_path));
+#else /* based on Tk8.0 -- Tk8.5b1 */
+ if ((menuTablePtr
+ = (Tcl_HashTable *) Tcl_GetAssocData(ptr->ip, MENU_HASH_KEY, NULL))
+ != NULL) {
+ if ((hashEntryPtr
+ = Tcl_FindHashEntry(menuTablePtr, RSTRING_PTR(menu_path)))
+ != NULL) {
+ menuRefPtr = (struct dummy_TkMenuRef *) Tcl_GetHashValue(hashEntryPtr);
+ }
+ }
+#endif
+
+ if (menuRefPtr == (struct dummy_TkMenuRef *) NULL) {
+ rb_raise(rb_eArgError, "not a menu widget, or invalid widget path");
+ }
+
+ if (menuRefPtr->menuPtr == (struct dummy_TkMenu *) NULL) {
+ rb_raise(rb_eRuntimeError,
+ "invalid menu widget (maybe already destroyed)");
+ }
+
+ if ((menuRefPtr->menuPtr)->menuType != MENUBAR) {
+ rb_raise(rb_eRuntimeError,
+ "target menu widget must be a MENUBAR type");
+ }
+
+ (menuRefPtr->menuPtr)->menuType = TEAROFF_MENU;
+#if 0 /* cause SEGV */
+ {
+ /* char *s = "tearoff"; */
+ char *s = "normal";
+ /* Tcl_SetStringObj((menuRefPtr->menuPtr)->menuTypePtr, s, strlen(s));*/
+ (menuRefPtr->menuPtr)->menuTypePtr = Tcl_NewStringObj(s, strlen(s));
+ /* Tcl_IncrRefCount((menuRefPtr->menuPtr)->menuTypePtr); */
+ /* (menuRefPtr->menuPtr)->menuType = TEAROFF_MENU; */
+ (menuRefPtr->menuPtr)->menuType = MASTER_MENU;
+ }
+#endif
+
+#if 0 /* was available on Tk8.0 -- Tk8.4 */
+ TkEventuallyRecomputeMenu(menuRefPtr->menuPtr);
+ TkEventuallyRedrawMenu(menuRefPtr->menuPtr,
+ (struct dummy_TkMenuEntry *)NULL);
+#else /* based on Tk8.0 -- Tk8.5b1 */
+ memset((void *) &event, 0, sizeof(event));
+ event.xany.type = ConfigureNotify;
+ event.xany.serial = NextRequest(Tk_Display((menuRefPtr->menuPtr)->tkwin));
+ event.xany.send_event = 0; /* FALSE */
+ event.xany.window = Tk_WindowId((menuRefPtr->menuPtr)->tkwin);
+ event.xany.display = Tk_Display((menuRefPtr->menuPtr)->tkwin);
+ event.xconfigure.window = event.xany.window;
+ Tk_HandleEvent(&event);
+#endif
+
+#else /* TCL_MAJOR_VERSION <= 7 */
+ rb_notimplement();
+#endif
+
+ return interp;
+}
+
+static VALUE
+ip_make_menu_embeddable(interp, menu_path)
+ VALUE interp;
+ VALUE menu_path;
+{
+ VALUE argv[1];
+
+ argv[0] = menu_path;
+ return tk_funcall(ip_make_menu_embeddable_core, 1, argv, interp);
+}
+
+
+/*###############################################*/
+
+/*---- initialization ----*/
+void
+Init_tcltklib()
+{
+ int ret;
+
+ VALUE lib = rb_define_module("TclTkLib");
+ VALUE ip = rb_define_class("TclTkIp", rb_cObject);
+
+ VALUE ev_flag = rb_define_module_under(lib, "EventFlag");
+ VALUE var_flag = rb_define_module_under(lib, "VarAccessFlag");
+ VALUE release_type = rb_define_module_under(lib, "RELEASE_TYPE");
+
+ /* --------------------------------------------------------------- */
+
+ tcltkip_class = ip;
+
+ /* --------------------------------------------------------------- */
+
+#ifdef HAVE_RUBY_ENCODING_H
+ rb_global_variable(&cRubyEncoding);
+ cRubyEncoding = rb_path2class("Encoding");
+
+ ENCODING_INDEX_UTF8 = rb_enc_to_index(rb_utf8_encoding());
+ ENCODING_INDEX_BINARY = rb_enc_find_index("binary");
+#endif
+
+ rb_global_variable(&ENCODING_NAME_UTF8);
+ rb_global_variable(&ENCODING_NAME_BINARY);
+
+ ENCODING_NAME_UTF8 = rb_obj_freeze(rb_str_new2("utf-8"));
+ ENCODING_NAME_BINARY = rb_obj_freeze(rb_str_new2("binary"));
+
+ /* --------------------------------------------------------------- */
+
+ rb_global_variable(&eTkCallbackReturn);
+ rb_global_variable(&eTkCallbackBreak);
+ rb_global_variable(&eTkCallbackContinue);
+
+ rb_global_variable(&eventloop_thread);
+ rb_global_variable(&eventloop_stack);
+ rb_global_variable(&watchdog_thread);
+
+ rb_global_variable(&rbtk_pending_exception);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_const(lib, "COMPILE_INFO", tcltklib_compile_info());
+
+ rb_define_const(lib, "RELEASE_DATE",
+ rb_obj_freeze(rb_str_new2(tcltklib_release_date)));
+
+ rb_define_const(lib, "FINALIZE_PROC_NAME",
+ rb_str_new2(finalize_hook_name));
+
+ /* --------------------------------------------------------------- */
+
+#ifdef __WIN32__
+# define TK_WINDOWING_SYSTEM "win32"
+#else
+# ifdef MAC_TCL
+# define TK_WINDOWING_SYSTEM "classic"
+# else
+# ifdef MAC_OSX_TK
+# define TK_WINDOWING_SYSTEM "aqua"
+# else
+# define TK_WINDOWING_SYSTEM "x11"
+# endif
+# endif
+#endif
+ rb_define_const(lib, "WINDOWING_SYSTEM",
+ rb_obj_freeze(rb_str_new2(TK_WINDOWING_SYSTEM)));
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_const(ev_flag, "NONE", INT2FIX(0));
+ rb_define_const(ev_flag, "WINDOW", INT2FIX(TCL_WINDOW_EVENTS));
+ rb_define_const(ev_flag, "FILE", INT2FIX(TCL_FILE_EVENTS));
+ rb_define_const(ev_flag, "TIMER", INT2FIX(TCL_TIMER_EVENTS));
+ rb_define_const(ev_flag, "IDLE", INT2FIX(TCL_IDLE_EVENTS));
+ rb_define_const(ev_flag, "ALL", INT2FIX(TCL_ALL_EVENTS));
+ rb_define_const(ev_flag, "DONT_WAIT", INT2FIX(TCL_DONT_WAIT));
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_const(var_flag, "NONE", INT2FIX(0));
+ rb_define_const(var_flag, "GLOBAL_ONLY", INT2FIX(TCL_GLOBAL_ONLY));
+#ifdef TCL_NAMESPACE_ONLY
+ rb_define_const(var_flag, "NAMESPACE_ONLY", INT2FIX(TCL_NAMESPACE_ONLY));
+#else /* probably Tcl7.6 */
+ rb_define_const(var_flag, "NAMESPACE_ONLY", INT2FIX(0));
+#endif
+ rb_define_const(var_flag, "LEAVE_ERR_MSG", INT2FIX(TCL_LEAVE_ERR_MSG));
+ rb_define_const(var_flag, "APPEND_VALUE", INT2FIX(TCL_APPEND_VALUE));
+ rb_define_const(var_flag, "LIST_ELEMENT", INT2FIX(TCL_LIST_ELEMENT));
+#ifdef TCL_PARSE_PART1
+ rb_define_const(var_flag, "PARSE_VARNAME", INT2FIX(TCL_PARSE_PART1));
+#else /* probably Tcl7.6 */
+ rb_define_const(var_flag, "PARSE_VARNAME", INT2FIX(0));
+#endif
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_module_function(lib, "get_version", lib_getversion, -1);
+ rb_define_module_function(lib, "get_release_type_name",
+ lib_get_reltype_name, -1);
+
+ rb_define_const(release_type, "ALPHA", INT2FIX(TCL_ALPHA_RELEASE));
+ rb_define_const(release_type, "BETA", INT2FIX(TCL_BETA_RELEASE));
+ rb_define_const(release_type, "FINAL", INT2FIX(TCL_FINAL_RELEASE));
+
+ /* --------------------------------------------------------------- */
+
+ eTkCallbackReturn = rb_define_class("TkCallbackReturn", rb_eStandardError);
+ eTkCallbackBreak = rb_define_class("TkCallbackBreak", rb_eStandardError);
+ eTkCallbackContinue = rb_define_class("TkCallbackContinue",
+ rb_eStandardError);
+
+ /* --------------------------------------------------------------- */
+
+ eLocalJumpError = rb_const_get(rb_cObject, rb_intern("LocalJumpError"));
+
+ eTkLocalJumpError = rb_define_class("TkLocalJumpError", eLocalJumpError);
+
+ eTkCallbackRetry = rb_define_class("TkCallbackRetry", eTkLocalJumpError);
+ eTkCallbackRedo = rb_define_class("TkCallbackRedo", eTkLocalJumpError);
+ eTkCallbackThrow = rb_define_class("TkCallbackThrow", eTkLocalJumpError);
+
+ /* --------------------------------------------------------------- */
+
+ ID_at_enc = rb_intern("@encoding");
+ ID_at_interp = rb_intern("@interp");
+ ID_encoding_name = rb_intern("encoding_name");
+ ID_encoding_table = rb_intern("encoding_table");
+
+ ID_stop_p = rb_intern("stop?");
+#ifndef HAVE_RB_THREAD_ALIVE_P
+ ID_alive_p = rb_intern("alive?");
+#endif
+ ID_kill = rb_intern("kill");
+ ID_join = rb_intern("join");
+ ID_value = rb_intern("value");
+
+ ID_call = rb_intern("call");
+ ID_backtrace = rb_intern("backtrace");
+ ID_message = rb_intern("message");
+
+ ID_at_reason = rb_intern("@reason");
+ ID_return = rb_intern("return");
+ ID_break = rb_intern("break");
+ ID_next = rb_intern("next");
+
+ ID_to_s = rb_intern("to_s");
+ ID_inspect = rb_intern("inspect");
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_module_function(lib, "mainloop", lib_mainloop, -1);
+ rb_define_module_function(lib, "mainloop_thread?",
+ lib_evloop_thread_p, 0);
+ rb_define_module_function(lib, "mainloop_watchdog",
+ lib_mainloop_watchdog, -1);
+ rb_define_module_function(lib, "do_thread_callback",
+ lib_thread_callback, -1);
+ rb_define_module_function(lib, "do_one_event", lib_do_one_event, -1);
+ rb_define_module_function(lib, "mainloop_abort_on_exception",
+ lib_evloop_abort_on_exc, 0);
+ rb_define_module_function(lib, "mainloop_abort_on_exception=",
+ lib_evloop_abort_on_exc_set, 1);
+ rb_define_module_function(lib, "set_eventloop_window_mode",
+ set_eventloop_window_mode, 1);
+ rb_define_module_function(lib, "get_eventloop_window_mode",
+ get_eventloop_window_mode, 0);
+ rb_define_module_function(lib, "set_eventloop_tick",set_eventloop_tick,1);
+ rb_define_module_function(lib, "get_eventloop_tick",get_eventloop_tick,0);
+ rb_define_module_function(lib, "set_no_event_wait", set_no_event_wait, 1);
+ rb_define_module_function(lib, "get_no_event_wait", get_no_event_wait, 0);
+ rb_define_module_function(lib, "set_eventloop_weight",
+ set_eventloop_weight, 2);
+ rb_define_module_function(lib, "set_max_block_time", set_max_block_time,1);
+ rb_define_module_function(lib, "get_eventloop_weight",
+ get_eventloop_weight, 0);
+ rb_define_module_function(lib, "num_of_mainwindows",
+ lib_num_of_mainwindows, 0);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_module_function(lib, "_split_tklist", lib_split_tklist, 1);
+ rb_define_module_function(lib, "_merge_tklist", lib_merge_tklist, -1);
+ rb_define_module_function(lib, "_conv_listelement",
+ lib_conv_listelement, 1);
+ rb_define_module_function(lib, "_toUTF8", lib_toUTF8, -1);
+ rb_define_module_function(lib, "_fromUTF8", lib_fromUTF8, -1);
+ rb_define_module_function(lib, "_subst_UTF_backslash",
+ lib_UTF_backslash, 1);
+ rb_define_module_function(lib, "_subst_Tcl_backslash",
+ lib_Tcl_backslash, 1);
+
+ rb_define_module_function(lib, "encoding_system",
+ lib_get_system_encoding, 0);
+ rb_define_module_function(lib, "encoding_system=",
+ lib_set_system_encoding, 1);
+ rb_define_module_function(lib, "encoding",
+ lib_get_system_encoding, 0);
+ rb_define_module_function(lib, "encoding=",
+ lib_set_system_encoding, 1);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_alloc_func(ip, ip_alloc);
+ rb_define_method(ip, "initialize", ip_init, -1);
+ rb_define_method(ip, "create_slave", ip_create_slave, -1);
+ rb_define_method(ip, "slave_of?", ip_is_slave_of_p, 1);
+ rb_define_method(ip, "make_safe", ip_make_safe, 0);
+ rb_define_method(ip, "safe?", ip_is_safe_p, 0);
+ rb_define_method(ip, "allow_ruby_exit?", ip_allow_ruby_exit_p, 0);
+ rb_define_method(ip, "allow_ruby_exit=", ip_allow_ruby_exit_set, 1);
+ rb_define_method(ip, "delete", ip_delete, 0);
+ rb_define_method(ip, "deleted?", ip_is_deleted_p, 0);
+ rb_define_method(ip, "has_mainwindow?", ip_has_mainwindow_p, 0);
+ rb_define_method(ip, "invalid_namespace?", ip_has_invalid_namespace_p, 0);
+ rb_define_method(ip, "_eval", ip_eval, 1);
+ rb_define_method(ip, "_cancel_eval", ip_cancel_eval, -1);
+ rb_define_method(ip, "_cancel_eval_unwind", ip_cancel_eval_unwind, -1);
+ rb_define_method(ip, "_toUTF8", ip_toUTF8, -1);
+ rb_define_method(ip, "_fromUTF8", ip_fromUTF8, -1);
+ rb_define_method(ip, "_thread_vwait", ip_thread_vwait, 1);
+ rb_define_method(ip, "_thread_tkwait", ip_thread_tkwait, 2);
+ rb_define_method(ip, "_invoke", ip_invoke, -1);
+ rb_define_method(ip, "_immediate_invoke", ip_invoke_immediate, -1);
+ rb_define_method(ip, "_return_value", ip_retval, 0);
+
+ rb_define_method(ip, "_create_console", ip_create_console, 0);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_method(ip, "create_dummy_encoding_for_tk",
+ create_dummy_encoding_for_tk, 1);
+ rb_define_method(ip, "encoding_table", ip_get_encoding_table, 0);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_method(ip, "_get_variable", ip_get_variable, 2);
+ rb_define_method(ip, "_get_variable2", ip_get_variable2, 3);
+ rb_define_method(ip, "_set_variable", ip_set_variable, 3);
+ rb_define_method(ip, "_set_variable2", ip_set_variable2, 4);
+ rb_define_method(ip, "_unset_variable", ip_unset_variable, 2);
+ rb_define_method(ip, "_unset_variable2", ip_unset_variable2, 3);
+ rb_define_method(ip, "_get_global_var", ip_get_global_var, 1);
+ rb_define_method(ip, "_get_global_var2", ip_get_global_var2, 2);
+ rb_define_method(ip, "_set_global_var", ip_set_global_var, 2);
+ rb_define_method(ip, "_set_global_var2", ip_set_global_var2, 3);
+ rb_define_method(ip, "_unset_global_var", ip_unset_global_var, 1);
+ rb_define_method(ip, "_unset_global_var2", ip_unset_global_var2, 2);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_method(ip, "_make_menu_embeddable", ip_make_menu_embeddable, 1);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_method(ip, "_split_tklist", ip_split_tklist, 1);
+ rb_define_method(ip, "_merge_tklist", lib_merge_tklist, -1);
+ rb_define_method(ip, "_conv_listelement", lib_conv_listelement, 1);
+
+ /* --------------------------------------------------------------- */
+
+ rb_define_method(ip, "mainloop", ip_mainloop, -1);
+ rb_define_method(ip, "mainloop_watchdog", ip_mainloop_watchdog, -1);
+ rb_define_method(ip, "do_one_event", ip_do_one_event, -1);
+ rb_define_method(ip, "mainloop_abort_on_exception",
+ ip_evloop_abort_on_exc, 0);
+ rb_define_method(ip, "mainloop_abort_on_exception=",
+ ip_evloop_abort_on_exc_set, 1);
+ rb_define_method(ip, "set_eventloop_tick", ip_set_eventloop_tick, 1);
+ rb_define_method(ip, "get_eventloop_tick", ip_get_eventloop_tick, 0);
+ rb_define_method(ip, "set_no_event_wait", ip_set_no_event_wait, 1);
+ rb_define_method(ip, "get_no_event_wait", ip_get_no_event_wait, 0);
+ rb_define_method(ip, "set_eventloop_weight", ip_set_eventloop_weight, 2);
+ rb_define_method(ip, "get_eventloop_weight", ip_get_eventloop_weight, 0);
+ rb_define_method(ip, "set_max_block_time", set_max_block_time, 1);
+ rb_define_method(ip, "restart", ip_restart, 0);
+
+ /* --------------------------------------------------------------- */
+
+ eventloop_thread = Qnil;
+ eventloop_interp = (Tcl_Interp*)NULL;
+
+#ifndef DEFAULT_EVENTLOOP_DEPTH
+#define DEFAULT_EVENTLOOP_DEPTH 7
+#endif
+ eventloop_stack = rb_ary_new2(DEFAULT_EVENTLOOP_DEPTH);
+ RbTk_OBJ_UNTRUST(eventloop_stack);
+
+ watchdog_thread = Qnil;
+
+ rbtk_pending_exception = Qnil;
+
+ /* --------------------------------------------------------------- */
+
+#ifdef HAVE_NATIVETHREAD
+ /* if ruby->nativethread-support and tcltklib->doesn't,
+ the following will cause link-error. */
+ ruby_native_thread_p();
+#endif
+
+ /* --------------------------------------------------------------- */
+
+ rb_set_end_proc(lib_mark_at_exit, 0);
+
+ /* --------------------------------------------------------------- */
+
+ ret = ruby_open_tcl_dll(rb_argv0 ? RSTRING_PTR(rb_argv0) : 0);
+ switch(ret) {
+ case TCLTK_STUBS_OK:
+ break;
+ case NO_TCL_DLL:
+ rb_raise(rb_eLoadError, "tcltklib: fail to open tcl_dll");
+ case NO_FindExecutable:
+ rb_raise(rb_eLoadError, "tcltklib: can't find Tcl_FindExecutable");
+ default:
+ rb_raise(rb_eLoadError, "tcltklib: unknown error(%d) on ruby_open_tcl_dll", ret);
+ }
+
+ /* --------------------------------------------------------------- */
+
+#if defined CREATE_RUBYTK_KIT || defined CREATE_RUBYKIT
+ setup_rubytkkit();
+#endif
+
+ /* --------------------------------------------------------------- */
+
+ /* Tcl stub check */
+ tcl_stubs_check();
+
+ Tcl_ObjType_ByteArray = Tcl_GetObjType(Tcl_ObjTypeName_ByteArray);
+ Tcl_ObjType_String = Tcl_GetObjType(Tcl_ObjTypeName_String);
+
+ /* --------------------------------------------------------------- */
+
+ (void)call_original_exit;
+}
+
+/* eof */
diff --git a/ext/tk/tkutil/depend b/ext/tk/tkutil/depend
new file mode 100644
index 0000000000..fd63e230f0
--- /dev/null
+++ b/ext/tk/tkutil/depend
@@ -0,0 +1 @@
+tkutil.o: tkutil.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
new file mode 100644
index 0000000000..9ffde75657
--- /dev/null
+++ b/ext/tk/tkutil/extconf.rb
@@ -0,0 +1,11 @@
+begin
+ 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("strndup", "string.h")
+
+ create_makefile('tkutil')
+end
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
new file mode 100644
index 0000000000..cb387c5bd4
--- /dev/null
+++ b/ext/tk/tkutil/tkutil.c
@@ -0,0 +1,1870 @@
+/************************************************
+
+ tkutil.c -
+
+ $Author$
+ created at: Fri Nov 3 00:47:54 JST 1995
+
+************************************************/
+
+#define TKUTIL_RELEASE_DATE "2010-03-26"
+
+#include "ruby.h"
+
+#ifdef RUBY_VM
+static int rb_thread_critical; /* dummy */
+#else
+/* On Ruby 1.8.x, use rb_thread_critical (defined at rubysig.h) */
+#include "rubysig.h"
+#endif
+#ifdef HAVE_RUBY_ST_H
+#include "ruby/st.h"
+#else
+#include "st.h"
+#endif
+
+#if !defined(RHASH_TBL)
+#define RHASH_TBL(h) (RHASH(h)->tbl)
+#endif
+#if !defined(RSTRING_PTR)
+#define RSTRING_PTR(s) (RSTRING(s)->ptr)
+#define RSTRING_LEN(s) (RSTRING(s)->len)
+#endif
+#if !defined(RARRAY_PTR)
+#define RARRAY_PTR(s) (RARRAY(s)->ptr)
+#define RARRAY_LEN(s) (RARRAY(s)->len)
+#endif
+
+#if defined(HAVE_STRNDUP) && !defined(_GNU_SOURCE)
+extern char *strndup(const char* _ptr, size_t _len);
+#endif
+
+static VALUE cMethod;
+
+static VALUE cTclTkLib;
+
+static VALUE cTkObject;
+static VALUE cTkCallbackEntry;
+
+static VALUE TK_None;
+
+static VALUE cCB_SUBST;
+static VALUE cSUBST_INFO;
+
+static VALUE ENCODING_NAME_UTF8; /* for saving GC cost */
+
+static ID ID_split_tklist;
+static ID ID_toUTF8;
+static ID ID_fromUTF8;
+static ID ID_path;
+static ID ID_at_path;
+static ID ID_at_enc;
+static ID ID_to_eval;
+static ID ID_to_s;
+static ID ID_source;
+static ID ID_downcase;
+static ID ID_install_cmd;
+static ID ID_merge_tklist;
+static ID ID_encoding;
+static ID ID_encoding_system;
+static ID ID_call;
+
+static ID ID_SUBST_INFO;
+
+static VALUE CALLBACK_TABLE;
+static unsigned long CALLBACK_ID_NUM = 0;
+
+/*************************************/
+
+#if defined(HAVE_RB_OBJ_INSTANCE_EXEC) && !defined(RUBY_VM)
+extern VALUE rb_obj_instance_exec _((int, VALUE*, VALUE));
+#endif
+static VALUE
+tk_s_new(argc, argv, klass)
+ int argc;
+ VALUE *argv;
+ VALUE klass;
+{
+ VALUE obj = rb_class_new_instance(argc, argv, klass);
+
+ if (rb_block_given_p()) {
+#ifndef HAVE_RB_OBJ_INSTANCE_EXEC
+ rb_obj_instance_eval(0, 0, obj);
+#else
+ rb_obj_instance_exec(1, &obj, obj);
+#endif
+ }
+ return obj;
+}
+
+/*************************************/
+
+static VALUE
+tkNone_to_s(self)
+ VALUE self;
+{
+ return rb_str_new2("");
+}
+
+static VALUE
+tkNone_inspect(self)
+ VALUE self;
+{
+ return rb_str_new2("None");
+}
+
+/*************************************/
+
+static VALUE
+tk_obj_untrust(self, obj)
+ VALUE self;
+ VALUE obj;
+{
+#ifdef HAVE_RB_OBJ_TAINT
+ rb_obj_taint(obj);
+#endif
+#ifdef HAVE_RB_OBJ_UNTRUST
+ rb_obj_untrust(obj);
+#endif
+
+ return obj;
+}
+
+static VALUE
+tk_eval_cmd(argc, argv, self)
+ int argc;
+ VALUE argv[];
+ VALUE self;
+{
+ volatile VALUE cmd, rest;
+
+ rb_scan_args(argc, argv, "1*", &cmd, &rest);
+ return rb_eval_cmd(cmd, rest, 0);
+}
+
+static VALUE
+tk_do_callback(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+#if 0
+ volatile VALUE id;
+ volatile VALUE rest;
+
+ rb_scan_args(argc, argv, "1*", &id, &rest);
+ return rb_apply(rb_hash_aref(CALLBACK_TABLE, id), ID_call, rest);
+#endif
+ return rb_funcall2(rb_hash_aref(CALLBACK_TABLE, argv[0]),
+ ID_call, argc - 1, argv + 1);
+}
+
+static const char cmd_id_head[] = "ruby_cmd TkUtil callback ";
+static const char cmd_id_prefix[] = "cmd";
+
+static VALUE
+tk_install_cmd_core(cmd)
+ VALUE 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_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);
+}
+
+static VALUE
+tk_install_cmd(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ volatile VALUE cmd;
+
+#if 0
+ if (rb_scan_args(argc, argv, "01", &cmd) == 0) {
+ cmd = rb_block_proc();
+ }
+ return tk_install_cmd_core(cmd);
+#endif
+ if (argc == 0) {
+ cmd = rb_block_proc();
+ } else {
+ cmd = argv[0];
+ }
+ return tk_install_cmd_core(cmd);
+}
+
+static VALUE
+tk_uninstall_cmd(self, cmd_id)
+ VALUE self;
+ VALUE cmd_id;
+{
+ size_t head_len = strlen(cmd_id_head);
+ size_t prefix_len = strlen(cmd_id_prefix);
+
+ StringValue(cmd_id);
+ if (strncmp(cmd_id_head, RSTRING_PTR(cmd_id), head_len) != 0) {
+ return Qnil;
+ }
+ if (strncmp(cmd_id_prefix,
+ RSTRING_PTR(cmd_id) + head_len, prefix_len) != 0) {
+ return Qnil;
+ }
+
+ return rb_hash_delete(CALLBACK_TABLE,
+ rb_str_new2(RSTRING_PTR(cmd_id) + head_len));
+}
+
+static VALUE
+tk_toUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ return rb_funcall2(cTclTkLib, ID_toUTF8, argc, argv);
+}
+
+static VALUE
+tk_fromUTF8(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ return rb_funcall2(cTclTkLib, ID_fromUTF8, argc, argv);
+}
+
+static VALUE
+fromDefaultEnc_toUTF8(str, self)
+ VALUE str;
+ VALUE self;
+{
+ VALUE argv[1];
+
+ argv[0] = str;
+ return tk_toUTF8(1, argv, self);
+}
+
+#if 0
+static VALUE
+fromUTF8_toDefaultEnc(str, self)
+ VALUE str;
+ VALUE self;
+{
+ VALUE argv[1];
+
+ argv[0] = str;
+ return tk_fromUTF8(1, argv, self);
+}
+#endif
+
+static int
+to_strkey(key, value, hash)
+ VALUE key;
+ VALUE value;
+ VALUE hash;
+{
+ rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value);
+ return ST_CHECK;
+}
+
+static VALUE
+tk_symbolkey2str(self, keys)
+ VALUE self;
+ VALUE keys;
+{
+ volatile VALUE new_keys = rb_hash_new();
+
+ if (NIL_P(keys)) return new_keys;
+ keys = rb_convert_type(keys, T_HASH, "Hash", "to_hash");
+ st_foreach_check(RHASH_TBL(keys), to_strkey, new_keys, Qundef);
+ return new_keys;
+}
+
+static VALUE get_eval_string_core _((VALUE, VALUE, VALUE));
+static VALUE ary2list _((VALUE, VALUE, VALUE));
+static VALUE ary2list2 _((VALUE, VALUE, VALUE));
+static VALUE hash2list _((VALUE, VALUE));
+static VALUE hash2list_enc _((VALUE, VALUE));
+static VALUE hash2kv _((VALUE, VALUE, VALUE));
+static VALUE hash2kv_enc _((VALUE, VALUE, VALUE));
+
+static VALUE
+ary2list(ary, enc_flag, self)
+ VALUE ary;
+ VALUE enc_flag;
+ VALUE self;
+{
+ long idx, idx2, size, size2;
+ int req_chk_flag;
+ volatile VALUE val, val2, str_val;
+ volatile VALUE dst;
+ volatile VALUE sys_enc, dst_enc, str_enc;
+
+ sys_enc = rb_funcall(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);
+ }
+
+ if (NIL_P(enc_flag)) {
+ dst_enc = sys_enc;
+ req_chk_flag = 1;
+ } 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);
+ req_chk_flag = 0;
+ }
+
+ /* size = RARRAY_LEN(ary); */
+ size = 0;
+ for(idx = 0; idx < RARRAY_LEN(ary); idx++) {
+ if (RB_TYPE_P(RARRAY_PTR(ary)[idx], T_HASH)) {
+ size += 2 * RHASH_SIZE(RARRAY_PTR(ary)[idx]);
+ } else {
+ size++;
+ }
+ }
+
+ dst = rb_ary_new2(size);
+ for(idx = 0; idx < RARRAY_LEN(ary); idx++) {
+ val = RARRAY_PTR(ary)[idx];
+ str_val = Qnil;
+ switch(TYPE(val)) {
+ case T_ARRAY:
+ str_val = ary2list(val, enc_flag, self);
+ rb_ary_push(dst, str_val);
+
+ 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);
+ } else {
+ str_enc = sys_enc;
+ }
+ if (!rb_str_cmp(str_enc, dst_enc)) {
+ dst_enc = Qtrue;
+ req_chk_flag = 0;
+ }
+ }
+
+ break;
+
+ case T_HASH:
+ /* rb_ary_push(dst, hash2list(val, self)); */
+ if (RTEST(enc_flag)) {
+ val = hash2kv_enc(val, Qnil, self);
+ } else {
+ val = hash2kv(val, Qnil, self);
+ }
+ size2 = RARRAY_LEN(val);
+ for(idx2 = 0; idx2 < size2; idx2++) {
+ val2 = RARRAY_PTR(val)[idx2];
+ switch(TYPE(val2)) {
+ case T_ARRAY:
+ str_val = ary2list(val2, enc_flag, self);
+ rb_ary_push(dst, str_val);
+ break;
+
+ case T_HASH:
+ if (RTEST(enc_flag)) {
+ str_val = hash2list_enc(val2, self);
+ } else {
+ str_val = hash2list(val2, self);
+ }
+ rb_ary_push(dst, str_val);
+ break;
+
+ default:
+ if (val2 != TK_None) {
+ str_val = get_eval_string_core(val2, enc_flag, self);
+ rb_ary_push(dst, str_val);
+ }
+ }
+
+ 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);
+ } else {
+ str_enc = sys_enc;
+ }
+ if (!rb_str_cmp(str_enc, dst_enc)) {
+ dst_enc = Qtrue;
+ req_chk_flag = 0;
+ }
+ }
+ }
+ break;
+
+ default:
+ if (val != TK_None) {
+ str_val = get_eval_string_core(val, enc_flag, self);
+ rb_ary_push(dst, str_val);
+
+ 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);
+ } else {
+ str_enc = sys_enc;
+ }
+ if (!rb_str_cmp(str_enc, dst_enc)) {
+ dst_enc = Qtrue;
+ req_chk_flag = 0;
+ }
+ }
+ }
+ }
+ }
+
+ if (RTEST(dst_enc) && !NIL_P(sys_enc)) {
+ for(idx = 0; idx < RARRAY_LEN(dst); idx++) {
+ str_val = RARRAY_PTR(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;
+ }
+ val = rb_apply(cTclTkLib, ID_merge_tklist, dst);
+ 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 {
+ rb_ivar_set(val, ID_at_enc, ENCODING_NAME_UTF8);
+ }
+ return val;
+ } else {
+ return rb_apply(cTclTkLib, ID_merge_tklist, dst);
+ }
+}
+
+static VALUE
+ary2list2(ary, enc_flag, self)
+ VALUE ary;
+ VALUE enc_flag;
+ VALUE self;
+{
+ long idx, size;
+ int req_chk_flag;
+ volatile VALUE val, str_val;
+ volatile VALUE dst;
+ volatile VALUE sys_enc, dst_enc, str_enc;
+
+ sys_enc = rb_funcall(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);
+ }
+
+ if (NIL_P(enc_flag)) {
+ dst_enc = sys_enc;
+ req_chk_flag = 1;
+ } 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);
+ 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];
+ str_val = Qnil;
+ switch(TYPE(val)) {
+ case T_ARRAY:
+ str_val = ary2list(val, enc_flag, self);
+ break;
+
+ case T_HASH:
+ if (RTEST(enc_flag)) {
+ str_val = hash2list(val, self);
+ } else {
+ str_val = hash2list_enc(val, self);
+ }
+ break;
+
+ default:
+ if (val != TK_None) {
+ str_val = get_eval_string_core(val, enc_flag, self);
+ }
+ }
+
+ if (!NIL_P(str_val)) {
+ rb_ary_push(dst, str_val);
+
+ 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);
+ } else {
+ str_enc = sys_enc;
+ }
+ if (!rb_str_cmp(str_enc, dst_enc)) {
+ dst_enc = Qtrue;
+ req_chk_flag = 0;
+ }
+ }
+ }
+ }
+
+ if (RTEST(dst_enc) && !NIL_P(sys_enc)) {
+ for(idx = 0; idx < RARRAY_LEN(dst); idx++) {
+ str_val = RARRAY_PTR(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;
+ }
+ val = rb_apply(cTclTkLib, ID_merge_tklist, dst);
+ 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 {
+ rb_ivar_set(val, ID_at_enc, ENCODING_NAME_UTF8);
+ }
+ return val;
+ } else {
+ return rb_apply(cTclTkLib, ID_merge_tklist, dst);
+ }
+}
+
+static VALUE
+key2keyname(key)
+ VALUE key;
+{
+ return rb_str_append(rb_str_new2("-"), rb_funcall(key, ID_to_s, 0, 0));
+}
+
+static VALUE
+assoc2kv(assoc, ary, self)
+ VALUE assoc;
+ VALUE ary;
+ VALUE self;
+{
+ long i, j, len;
+ volatile VALUE pair;
+ volatile VALUE val;
+ volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
+
+ len = RARRAY_LEN(assoc);
+
+ for(i = 0; i < len; i++) {
+ pair = RARRAY_PTR(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]);
+
+ case 1:
+ rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+
+ case 0:
+ continue;
+
+ default:
+ rb_ary_push(dst, key2keyname(RARRAY_PTR(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_push(dst, val);
+ }
+ }
+
+ if (NIL_P(ary)) {
+ return dst;
+ } else {
+ return rb_ary_plus(ary, dst);
+ }
+}
+
+static VALUE
+assoc2kv_enc(assoc, ary, self)
+ VALUE assoc;
+ VALUE ary;
+ VALUE self;
+{
+ long i, j, len;
+ volatile VALUE pair;
+ volatile VALUE val;
+ volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
+
+ len = RARRAY_LEN(assoc);
+
+ for(i = 0; i < len; i++) {
+ pair = RARRAY_PTR(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));
+
+ case 1:
+ rb_ary_push(dst, key2keyname(RARRAY_PTR(pair)[0]));
+
+ case 0:
+ continue;
+
+ default:
+ rb_ary_push(dst, key2keyname(RARRAY_PTR(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_push(dst, get_eval_string_core(val, Qtrue, self));
+ }
+ }
+
+ if (NIL_P(ary)) {
+ return dst;
+ } else {
+ return rb_ary_plus(ary, dst);
+ }
+}
+
+static int
+push_kv(key, val, args)
+ VALUE key;
+ VALUE val;
+ VALUE args;
+{
+ volatile VALUE ary;
+
+ ary = RARRAY_PTR(args)[0];
+
+#if 0
+ rb_ary_push(ary, key2keyname(key));
+ if (val != TK_None) rb_ary_push(ary, val);
+#endif
+ rb_ary_push(ary, key2keyname(key));
+
+ if (val == TK_None) return ST_CHECK;
+
+ rb_ary_push(ary, get_eval_string_core(val, Qnil, RARRAY_PTR(args)[1]));
+
+ return ST_CHECK;
+}
+
+static VALUE
+hash2kv(hash, ary, self)
+ VALUE hash;
+ VALUE ary;
+ VALUE self;
+{
+ volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash));
+ volatile VALUE args = rb_ary_new3(2, dst, self);
+
+ st_foreach_check(RHASH_TBL(hash), push_kv, args, Qundef);
+
+ if (NIL_P(ary)) {
+ return dst;
+ } else {
+ return rb_ary_concat(ary, dst);
+ }
+}
+
+static int
+push_kv_enc(key, val, args)
+ VALUE key;
+ VALUE val;
+ VALUE args;
+{
+ volatile VALUE ary;
+
+ ary = RARRAY_PTR(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]));
+ }
+#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]));
+
+ return ST_CHECK;
+}
+
+static VALUE
+hash2kv_enc(hash, ary, self)
+ VALUE hash;
+ VALUE ary;
+ VALUE self;
+{
+ volatile VALUE dst = rb_ary_new2(2 * RHASH_SIZE(hash));
+ volatile VALUE args = rb_ary_new3(2, dst, self);
+
+ st_foreach_check(RHASH_TBL(hash), push_kv_enc, args, Qundef);
+
+ if (NIL_P(ary)) {
+ return dst;
+ } else {
+ return rb_ary_concat(ary, dst);
+ }
+}
+
+static VALUE
+hash2list(hash, self)
+ VALUE hash;
+ VALUE self;
+{
+ return ary2list2(hash2kv(hash, Qnil, self), Qfalse, self);
+}
+
+
+static VALUE
+hash2list_enc(hash, self)
+ VALUE hash;
+ VALUE self;
+{
+ return ary2list2(hash2kv_enc(hash, Qnil, self), Qfalse, self);
+}
+
+static VALUE
+tk_hash_kv(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ volatile VALUE hash, enc_flag, ary;
+
+ ary = Qnil;
+ enc_flag = Qnil;
+ switch(argc) {
+ case 3:
+ ary = argv[2];
+ case 2:
+ enc_flag = argv[1];
+ case 1:
+ hash = argv[0];
+ break;
+ case 0:
+ rb_raise(rb_eArgError, "too few arguments");
+ default: /* >= 3 */
+ rb_raise(rb_eArgError, "too many arguments");
+ }
+
+ switch(TYPE(hash)) {
+ case T_ARRAY:
+ if (RTEST(enc_flag)) {
+ return assoc2kv_enc(hash, ary, self);
+ } else {
+ return assoc2kv(hash, ary, self);
+ }
+
+ case T_HASH:
+ if (RTEST(enc_flag)) {
+ return hash2kv_enc(hash, ary, self);
+ } else {
+ return hash2kv(hash, ary, self);
+ }
+
+ case T_NIL:
+ if (NIL_P(ary)) {
+ return rb_ary_new();
+ } else {
+ return ary;
+ }
+
+ default:
+ if (hash == TK_None) {
+ if (NIL_P(ary)) {
+ return rb_ary_new();
+ } else {
+ return ary;
+ }
+ }
+ rb_raise(rb_eArgError, "Hash is expected for 1st argument");
+ }
+
+ UNREACHABLE;
+}
+
+static VALUE
+get_eval_string_core(obj, enc_flag, self)
+ VALUE obj;
+ VALUE enc_flag;
+ VALUE self;
+{
+ switch(TYPE(obj)) {
+ case T_FLOAT:
+ case T_FIXNUM:
+ case T_BIGNUM:
+ return rb_funcall(obj, ID_to_s, 0, 0);
+
+ case T_STRING:
+ if (RTEST(enc_flag)) {
+ if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) {
+ return rb_funcall(self, ID_toUTF8, 1, obj);
+ } else {
+ return fromDefaultEnc_toUTF8(obj, self);
+ }
+ } else {
+ return obj;
+ }
+
+ case T_SYMBOL:
+ if (RTEST(enc_flag)) {
+ if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) {
+ return rb_funcall(self, ID_toUTF8, 1,
+ rb_str_dup(rb_sym2str(obj)));
+ } else {
+ return fromDefaultEnc_toUTF8(rb_sym2str(obj), self);
+ }
+ } else {
+#ifdef HAVE_RB_SYM_TO_S
+ return rb_sym_to_s(obj);
+#else
+ return rb_sym2str(obj);
+#endif
+ }
+
+ case T_HASH:
+ if (RTEST(enc_flag)) {
+ return hash2list_enc(obj, self);
+ } else {
+ return hash2list(obj, self);
+ }
+
+ case T_ARRAY:
+ return ary2list(obj, enc_flag, self);
+
+ case T_FALSE:
+ return rb_str_new2("0");
+
+ case T_TRUE:
+ return rb_str_new2("1");
+
+ case T_NIL:
+ return rb_str_new2("");
+
+ case T_REGEXP:
+ return rb_funcall(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),
+ enc_flag, self);
+ }
+
+ if (rb_obj_is_kind_of(obj, rb_cProc)
+ || rb_obj_is_kind_of(obj, cMethod)
+ || rb_obj_is_kind_of(obj, cTkCallbackEntry)) {
+ if (rb_obj_respond_to(self, ID_install_cmd, Qtrue)) {
+ return rb_funcall(self, ID_install_cmd, 1, obj);
+ } else {
+ return tk_install_cmd_core(obj);
+ }
+ }
+
+ 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),
+ 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),
+ enc_flag, self);
+ } else if (rb_obj_respond_to(obj, ID_to_s, Qtrue)) {
+ return rb_funcall(obj, ID_to_s, 0, 0);
+ }
+ }
+
+ rb_warning("fail to convert '%+"PRIsVALUE"' to string for Tk", obj);
+
+ return obj;
+}
+
+static VALUE
+tk_get_eval_string(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ volatile VALUE obj, enc_flag;
+
+ if (rb_scan_args(argc, argv, "11", &obj, &enc_flag) == 1) {
+ enc_flag = Qnil;
+ }
+
+ return get_eval_string_core(obj, enc_flag, self);
+}
+
+static VALUE
+tk_get_eval_enc_str(self, obj)
+ VALUE self;
+ VALUE obj;
+{
+ if (obj == TK_None) {
+ return obj;
+ } else {
+ return get_eval_string_core(obj, Qtrue, self);
+ }
+}
+
+static VALUE
+tk_conv_args(argc, argv, self)
+ int argc;
+ VALUE *argv; /* [0]:base_array, [1]:enc_mode, [2]..[n]:args */
+ VALUE self;
+{
+ int idx;
+ long size;
+ volatile VALUE dst;
+ int thr_crit_bup;
+ VALUE old_gc;
+
+ if (argc < 2) {
+ rb_raise(rb_eArgError, "too few arguments");
+ }
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+ old_gc = rb_gc_disable();
+
+ for(size = 0, idx = 2; idx < argc; idx++) {
+ if (RB_TYPE_P(argv[idx], T_HASH)) {
+ size += 2 * RHASH_SIZE(argv[idx]);
+ } else {
+ size++;
+ }
+ }
+ /* dst = rb_ary_new2(argc - 2); */
+ dst = rb_ary_new2(size);
+ for(idx = 2; idx < argc; idx++) {
+ if (RB_TYPE_P(argv[idx], T_HASH)) {
+ if (RTEST(argv[1])) {
+ hash2kv_enc(argv[idx], dst, self);
+ } else {
+ hash2kv(argv[idx], dst, self);
+ }
+ } else if (argv[idx] != TK_None) {
+ rb_ary_push(dst, get_eval_string_core(argv[idx], argv[1], self));
+ }
+ }
+
+ if (old_gc == Qfalse) rb_gc_enable();
+ rb_thread_critical = thr_crit_bup;
+
+ return rb_ary_plus(argv[0], dst);
+}
+
+
+/*************************************/
+
+static VALUE
+tcl2rb_bool(self, value)
+ VALUE self;
+ VALUE value;
+{
+ if (RB_TYPE_P(value, T_FIXNUM)) {
+ if (NUM2INT(value) == 0) {
+ return Qfalse;
+ } else {
+ return Qtrue;
+ }
+ }
+
+ if (value == Qtrue || value == Qfalse) {
+ return value;
+ }
+
+ rb_check_type(value, T_STRING);
+
+ value = rb_funcall(value, ID_downcase, 0);
+
+ if (RSTRING_PTR(value) == (char*)NULL) return Qnil;
+
+ if (RSTRING_PTR(value)[0] == '\0'
+ || strcmp(RSTRING_PTR(value), "0") == 0
+ || strcmp(RSTRING_PTR(value), "no") == 0
+ || strcmp(RSTRING_PTR(value), "off") == 0
+ || strcmp(RSTRING_PTR(value), "false") == 0) {
+ return Qfalse;
+ } else {
+ return Qtrue;
+ }
+}
+
+#if 0
+static VALUE
+tkstr_to_dec(value)
+ VALUE value;
+{
+ return rb_cstr_to_inum(RSTRING_PTR(value), 10, 1);
+}
+#endif
+
+static VALUE
+tkstr_to_int(value)
+ VALUE value;
+{
+ return rb_cstr_to_inum(RSTRING_PTR(value), 0, 1);
+}
+
+static VALUE
+tkstr_to_float(value)
+ VALUE value;
+{
+ return rb_float_new(rb_cstr_to_dbl(RSTRING_PTR(value), 1));
+}
+
+static VALUE
+tkstr_invalid_numstr(value)
+ VALUE value;
+{
+ rb_raise(rb_eArgError,
+ "invalid value for Number: '%s'", RSTRING_PTR(value));
+ return Qnil; /*dummy*/
+}
+
+static VALUE
+tkstr_rescue_float(value)
+ VALUE value;
+{
+ return rb_rescue2(tkstr_to_float, value,
+ tkstr_invalid_numstr, value,
+ rb_eArgError, 0);
+}
+
+static VALUE
+tkstr_to_number(value)
+ VALUE value;
+{
+ rb_check_type(value, T_STRING);
+
+ if (RSTRING_PTR(value) == (char*)NULL) return INT2FIX(0);
+
+ return rb_rescue2(tkstr_to_int, value,
+ tkstr_rescue_float, value,
+ rb_eArgError, 0);
+}
+
+static VALUE
+tcl2rb_number(self, value)
+ VALUE self;
+ VALUE value;
+{
+ return tkstr_to_number(value);
+}
+
+static VALUE
+tkstr_to_str(value)
+ VALUE value;
+{
+ char * ptr;
+ long len;
+
+ ptr = RSTRING_PTR(value);
+ len = RSTRING_LEN(value);
+
+ if (len > 1 && *ptr == '{' && *(ptr + len - 1) == '}') {
+ return rb_str_new(ptr + 1, len - 2);
+ }
+ return value;
+}
+
+static VALUE
+tcl2rb_string(self, value)
+ VALUE self;
+ VALUE value;
+{
+ rb_check_type(value, T_STRING);
+
+ if (RSTRING_PTR(value) == (char*)NULL) return rb_tainted_str_new2("");
+
+ return tkstr_to_str(value);
+}
+
+static VALUE
+tcl2rb_num_or_str(self, value)
+ VALUE self;
+ VALUE value;
+{
+ rb_check_type(value, T_STRING);
+
+ if (RSTRING_PTR(value) == (char*)NULL) return rb_tainted_str_new2("");
+
+ return rb_rescue2(tkstr_to_number, value,
+ tkstr_to_str, value,
+ rb_eArgError, 0);
+}
+
+static VALUE
+tcl2rb_num_or_nil(self, value)
+ VALUE self;
+ VALUE value;
+{
+ rb_check_type(value, T_STRING);
+
+ if (RSTRING_LEN(value) == 0) return Qnil;
+
+ return tkstr_to_number(value);
+}
+
+
+/*************************************/
+
+#define CBSUBST_TBL_MAX (256)
+struct cbsubst_info {
+ long full_subst_length;
+ long keylen[CBSUBST_TBL_MAX];
+ char *key[CBSUBST_TBL_MAX];
+ char type[CBSUBST_TBL_MAX];
+ ID ivar[CBSUBST_TBL_MAX];
+ VALUE proc;
+ VALUE aliases;
+};
+
+static void
+subst_mark(ptr)
+ struct cbsubst_info *ptr;
+{
+ rb_gc_mark(ptr->proc);
+ rb_gc_mark(ptr->aliases);
+}
+
+static void
+subst_free(ptr)
+ struct cbsubst_info *ptr;
+{
+ int i;
+
+ if (ptr) {
+ for(i = 0; i < CBSUBST_TBL_MAX; i++) {
+ if (ptr->key[i] != NULL) {
+ free(ptr->key[i]); /* allocated by malloc */
+ ptr->key[i] = NULL;
+ }
+ }
+ xfree(ptr); /* allocated by ALLOC */
+ }
+}
+
+static VALUE
+allocate_cbsubst_info(struct cbsubst_info **inf_ptr)
+{
+ struct cbsubst_info *inf;
+ volatile VALUE proc, aliases;
+ int idx;
+
+ inf = ALLOC(struct cbsubst_info);
+
+ inf->full_subst_length = 0;
+
+ for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
+ inf->keylen[idx] = 0;
+ inf->key[idx] = NULL;
+ inf->type[idx] = '\0';
+ inf->ivar[idx] = (ID) 0;
+ }
+
+ proc = rb_hash_new();
+ inf->proc = proc;
+
+ aliases = rb_hash_new();
+ inf->aliases = aliases;
+
+ if (inf_ptr != (struct cbsubst_info **)NULL) *inf_ptr = inf;
+
+ return Data_Wrap_Struct(cSUBST_INFO, subst_mark, subst_free, inf);
+}
+
+static void
+cbsubst_init()
+{
+ rb_const_set(cCB_SUBST, ID_SUBST_INFO,
+ allocate_cbsubst_info((struct cbsubst_info **)NULL));
+}
+
+static VALUE
+cbsubst_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE 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);
+
+ 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++]);
+ if (idx >= argc) break;
+ }
+
+ return self;
+}
+
+static VALUE
+cbsubst_ret_val(self, val)
+ VALUE self;
+ VALUE val;
+{
+ /* This method may be overwritten on some sub-classes. */
+ /* This method is used for converting from ruby's callback-return-value */
+ /* to tcl's value (e.g. validation procedure of entry widget). */
+ return val;
+}
+
+static int
+each_attr_def(key, value, klass)
+ VALUE key, value, klass;
+{
+ ID key_id, value_id;
+
+ if (key == Qundef) return ST_CONTINUE;
+
+ switch(TYPE(key)) {
+ case T_STRING:
+ key_id = rb_intern_str(key);
+ break;
+ case T_SYMBOL:
+ key_id = SYM2ID(key);
+ break;
+ default:
+ rb_raise(rb_eArgError,
+ "includes invalid key(s). expected a String or a Symbol");
+ }
+
+ switch(TYPE(value)) {
+ case T_STRING:
+ value_id = rb_intern_str(value);
+ break;
+ case T_SYMBOL:
+ value_id = SYM2ID(value);
+ break;
+ default:
+ rb_raise(rb_eArgError,
+ "includes invalid value(s). expected a String or a Symbol");
+ }
+
+ rb_alias(klass, key_id, value_id);
+
+ return ST_CONTINUE;
+}
+
+static VALUE
+cbsubst_def_attr_aliases(self, tbl)
+ VALUE self;
+ VALUE tbl;
+{
+ struct cbsubst_info *inf;
+
+ 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);
+
+ rb_hash_foreach(tbl, each_attr_def, self);
+
+ return rb_funcall(inf->aliases, rb_intern("update"), 1, tbl);
+}
+
+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 (!RB_TYPE_P(sym, T_SYMBOL)) return sym;
+
+ Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
+ struct cbsubst_info, inf);
+
+ if (!NIL_P(ret = rb_hash_aref(inf->aliases, sym))) {
+ str = rb_sym2str(ret);
+ } else {
+ str = rb_sym2str(sym);
+ }
+
+ id = rb_intern_str(rb_sprintf("@%"PRIsVALUE, str));
+
+ for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
+ if (inf->ivar[idx] == id) break;
+ }
+ 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;
+}
+
+static VALUE
+cbsubst_get_subst_arg(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct cbsubst_info *inf;
+ VALUE str;
+ char *buf, *ptr;
+ int i, idx;
+ long len;
+ ID id;
+ volatile VALUE arg_sym, ret;
+
+ Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
+ struct cbsubst_info, inf);
+
+ ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
+
+ for(i = 0; i < argc; i++) {
+ switch(TYPE(argv[i])) {
+ case T_STRING:
+ 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_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_sym2str(ret);
+ }
+
+ 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++) = ' ';
+ }
+
+ *ptr = '\0';
+
+ ret = rb_str_new2(buf);
+
+ xfree(buf);
+
+ return ret;
+}
+
+static VALUE
+cbsubst_get_subst_key(self, str)
+ VALUE self;
+ VALUE str;
+{
+ struct cbsubst_info *inf;
+ volatile VALUE list;
+ volatile VALUE ret;
+ VALUE keyval;
+ long i, len, keylen;
+ int idx;
+ char *buf, *ptr, *key;
+
+ list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
+ len = RARRAY_LEN(list);
+
+ Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
+ struct cbsubst_info, inf);
+
+ ptr = buf = ALLOC_N(char, inf->full_subst_length + len + 1);
+
+ for(i = 0; i < len; i++) {
+ keyval = RARRAY_PTR(list)[i];
+ key = RSTRING_PTR(keyval);
+ if (*key == '%') {
+ if (*(key + 2) == '\0') {
+ /* single char */
+ *(ptr++) = *(key + 1);
+ } else {
+ /* search longname-key */
+ keylen = RSTRING_LEN(keyval) - 1;
+ for(idx = 0; idx < CBSUBST_TBL_MAX; idx++) {
+ if (inf->keylen[idx] != keylen) continue;
+ if ((unsigned char)inf->key[idx][0] != (unsigned char)*(key + 1)) continue;
+ if (strncmp(inf->key[idx], key + 1, keylen)) continue;
+ break;
+ }
+ if (idx < CBSUBST_TBL_MAX) {
+ *(ptr++) = (unsigned char)idx;
+ } else {
+ *(ptr++) = ' ';
+ }
+ }
+ } else {
+ *(ptr++) = ' ';
+ }
+ }
+ *ptr = '\0';
+
+ ret = rb_str_new2(buf);
+ xfree(buf);
+ return ret;
+}
+
+static VALUE
+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;
+
+ Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
+ struct cbsubst_info, inf);
+
+ ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
+ keys_ptr = keys_buf = ALLOC_N(char, CBSUBST_TBL_MAX + 1);
+
+ 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++) = ' ';
+ }
+
+ *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;
+}
+
+static VALUE
+cbsubst_table_setup(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ volatile VALUE cbsubst_obj;
+ volatile VALUE key_inf;
+ volatile VALUE longkey_inf;
+ volatile VALUE proc_inf;
+ VALUE inf;
+ ID id;
+ struct cbsubst_info *subst_inf;
+ long idx, len;
+ unsigned char chr;
+
+ /* accept (key_inf, proc_inf) or (key_inf, longkey_inf, procinf) */
+ if (rb_scan_args(argc, argv, "21", &key_inf, &longkey_inf, &proc_inf) == 2) {
+ proc_inf = longkey_inf;
+ longkey_inf = rb_ary_new();
+ }
+
+ /* check the number of longkeys */
+ if (RARRAY_LEN(longkey_inf) > 125 /* from 0x80 to 0xFD */) {
+ rb_raise(rb_eArgError, "too many longname-key definitions");
+ }
+
+ /* init */
+ cbsubst_obj = allocate_cbsubst_info(&subst_inf);
+
+ /*
+ * keys : array of [subst, type, ivar]
+ * subst ==> char code or string
+ * 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 (!RB_TYPE_P(inf, T_ARRAY)) continue;
+
+ if (RB_TYPE_P(RARRAY_PTR(inf)[0], T_STRING)) {
+ chr = *(RSTRING_PTR(RARRAY_PTR(inf)[0]));
+ } else {
+ chr = NUM2CHR(RARRAY_PTR(inf)[0]);
+ }
+ if (RB_TYPE_P(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->full_subst_length += 3;
+
+ id = SYM2ID(RARRAY_PTR(inf)[2]);
+ subst_inf->ivar[chr] = rb_intern_str(rb_sprintf("@%"PRIsVALUE, rb_id2str(id)));
+
+ rb_attr(self, id, 1, 0, Qtrue);
+ }
+
+
+ /*
+ * longkeys : array of [name, type, ivar]
+ * name ==> longname key string
+ * 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 (!RB_TYPE_P(inf, T_ARRAY)) continue;
+
+ 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 (RB_TYPE_P(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->full_subst_length += (subst_inf->keylen[chr] + 2);
+
+ id = SYM2ID(RARRAY_PTR(inf)[2]);
+ subst_inf->ivar[chr] = rb_intern_str(rb_sprintf("@%"PRIsVALUE, rb_id2str(id)));
+
+ rb_attr(self, id, 1, 0, Qtrue);
+ }
+
+ /*
+ * procs : array of [type, proc]
+ * 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 (!RB_TYPE_P(inf, T_ARRAY)) continue;
+ rb_hash_aset(subst_inf->proc,
+ (RB_TYPE_P(RARRAY_PTR(inf)[0], T_STRING)?
+ INT2FIX(*(RSTRING_PTR(RARRAY_PTR(inf)[0]))) :
+ RARRAY_PTR(inf)[0]),
+ RARRAY_PTR(inf)[1]);
+ }
+
+ rb_const_set(self, ID_SUBST_INFO, cbsubst_obj);
+
+ return self;
+}
+
+static VALUE
+cbsubst_get_extra_args_tbl(self)
+ VALUE self;
+{
+ return rb_ary_new();
+}
+
+static VALUE
+cbsubst_scan_args(self, arg_key, val_ary)
+ VALUE self;
+ VALUE arg_key;
+ VALUE val_ary;
+{
+ struct cbsubst_info *inf;
+ long idx;
+ unsigned char *keyptr = (unsigned char*)RSTRING_PTR(arg_key);
+ long keylen = RSTRING_LEN(arg_key);
+ long vallen = RARRAY_LEN(val_ary);
+ unsigned char type_chr;
+ volatile VALUE dst = rb_ary_new2(vallen);
+ volatile VALUE proc;
+ int thr_crit_bup;
+ VALUE old_gc;
+
+ thr_crit_bup = rb_thread_critical;
+ rb_thread_critical = Qtrue;
+
+ old_gc = rb_gc_disable();
+
+ Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
+ struct cbsubst_info, inf);
+
+ for(idx = 0; idx < vallen; idx++) {
+ if (idx >= keylen) {
+ proc = Qnil;
+ } else if (*(keyptr + idx) == ' ') {
+ proc = Qnil;
+ } else {
+ if (type_chr = inf->type[*(keyptr + idx)]) {
+ proc = rb_hash_aref(inf->proc, INT2FIX((int)type_chr));
+ } else {
+ proc = Qnil;
+ }
+ }
+
+ if (NIL_P(proc)) {
+ rb_ary_push(dst, RARRAY_PTR(val_ary)[idx]);
+ } else {
+ rb_ary_push(dst, rb_funcall(proc, ID_call, 1,
+ RARRAY_PTR(val_ary)[idx]));
+ }
+ }
+
+ if (old_gc == Qfalse) rb_gc_enable();
+ rb_thread_critical = thr_crit_bup;
+
+ return dst;
+}
+
+static VALUE
+cbsubst_inspect(self)
+ VALUE self;
+{
+ return rb_str_new2("CallbackSubst");
+}
+
+static VALUE
+substinfo_inspect(self)
+ VALUE self;
+{
+ return rb_str_new2("SubstInfo");
+}
+
+/*************************************/
+
+static VALUE
+tk_cbe_inspect(self)
+ VALUE self;
+{
+ return rb_str_new2("TkCallbackEntry");
+}
+
+/*************************************/
+
+static VALUE
+tkobj_path(self)
+ VALUE self;
+{
+ return rb_ivar_get(self, ID_at_path);
+}
+
+
+/*************************************/
+/* release date */
+const char tkutil_release_date[] = TKUTIL_RELEASE_DATE;
+
+void
+Init_tkutil()
+{
+ VALUE cTK = rb_define_class("TkKernel", rb_cObject);
+ VALUE mTK = rb_define_module("TkUtil");
+
+ /* --------------------- */
+
+ rb_define_const(mTK, "RELEASE_DATE",
+ rb_obj_freeze(rb_str_new2(tkutil_release_date)));
+
+ /* --------------------- */
+ rb_global_variable(&cMethod);
+ cMethod = rb_const_get(rb_cObject, rb_intern("Method"));
+
+ ID_path = rb_intern("path");
+ ID_at_path = rb_intern("@path");
+ ID_at_enc = rb_intern("@encoding");
+ ID_to_eval = rb_intern("to_eval");
+ ID_to_s = rb_intern("to_s");
+ ID_source = rb_intern("source");
+ ID_downcase = rb_intern("downcase");
+ ID_install_cmd = rb_intern("install_cmd");
+ ID_merge_tklist = rb_intern("_merge_tklist");
+ ID_encoding = rb_intern("encoding");
+ ID_encoding_system = rb_intern("encoding_system");
+ ID_call = rb_intern("call");
+
+ /* --------------------- */
+ cCB_SUBST = rb_define_class_under(mTK, "CallbackSubst", rb_cObject);
+ rb_define_singleton_method(cCB_SUBST, "inspect", cbsubst_inspect, 0);
+
+ cSUBST_INFO = rb_define_class_under(cCB_SUBST, "Info", rb_cObject);
+ rb_define_singleton_method(cSUBST_INFO, "inspect", substinfo_inspect, 0);
+
+ ID_SUBST_INFO = rb_intern("SUBST_INFO");
+ rb_define_singleton_method(cCB_SUBST, "ret_val", cbsubst_ret_val, 1);
+ rb_define_singleton_method(cCB_SUBST, "scan_args", cbsubst_scan_args, 2);
+ rb_define_singleton_method(cCB_SUBST, "_sym2subst",
+ cbsubst_sym_to_subst, 1);
+ rb_define_singleton_method(cCB_SUBST, "subst_arg",
+ cbsubst_get_subst_arg, -1);
+ rb_define_singleton_method(cCB_SUBST, "_get_subst_key",
+ cbsubst_get_subst_key, 1);
+ rb_define_singleton_method(cCB_SUBST, "_get_all_subst_keys",
+ cbsubst_get_all_subst_keys, 0);
+ rb_define_singleton_method(cCB_SUBST, "_setup_subst_table",
+ cbsubst_table_setup, -1);
+ rb_define_singleton_method(cCB_SUBST, "_get_extra_args_tbl",
+ cbsubst_get_extra_args_tbl, 0);
+ rb_define_singleton_method(cCB_SUBST, "_define_attribute_aliases",
+ cbsubst_def_attr_aliases, 1);
+
+ rb_define_method(cCB_SUBST, "initialize", cbsubst_initialize, -1);
+
+ cbsubst_init();
+
+ /* --------------------- */
+ rb_global_variable(&cTkCallbackEntry);
+ cTkCallbackEntry = rb_define_class("TkCallbackEntry", cTK);
+ rb_define_singleton_method(cTkCallbackEntry, "inspect", tk_cbe_inspect, 0);
+
+ /* --------------------- */
+ rb_global_variable(&cTkObject);
+ cTkObject = rb_define_class("TkObject", cTK);
+ rb_define_method(cTkObject, "path", tkobj_path, 0);
+
+ /* --------------------- */
+ rb_require("tcltklib");
+ rb_global_variable(&cTclTkLib);
+ cTclTkLib = rb_const_get(rb_cObject, rb_intern("TclTkLib"));
+ ID_split_tklist = rb_intern("_split_tklist");
+ ID_toUTF8 = rb_intern("_toUTF8");
+ ID_fromUTF8 = rb_intern("_fromUTF8");
+
+ /* --------------------- */
+ rb_define_singleton_method(cTK, "new", tk_s_new, -1);
+
+ /* --------------------- */
+ rb_global_variable(&TK_None);
+ TK_None = rb_obj_alloc(rb_cObject);
+ rb_define_const(mTK, "None", TK_None);
+ rb_define_singleton_method(TK_None, "to_s", tkNone_to_s, 0);
+ rb_define_singleton_method(TK_None, "inspect", tkNone_inspect, 0);
+ OBJ_FREEZE(TK_None);
+
+ /* --------------------- */
+ rb_global_variable(&CALLBACK_TABLE);
+ CALLBACK_TABLE = rb_hash_new();
+
+ /* --------------------- */
+ rb_define_singleton_method(mTK, "untrust", tk_obj_untrust, 1);
+
+ rb_define_singleton_method(mTK, "eval_cmd", tk_eval_cmd, -1);
+ rb_define_singleton_method(mTK, "callback", tk_do_callback, -1);
+ rb_define_singleton_method(mTK, "install_cmd", tk_install_cmd, -1);
+ rb_define_singleton_method(mTK, "uninstall_cmd", tk_uninstall_cmd, 1);
+ rb_define_singleton_method(mTK, "_symbolkey2str", tk_symbolkey2str, 1);
+ rb_define_singleton_method(mTK, "hash_kv", tk_hash_kv, -1);
+ rb_define_singleton_method(mTK, "_get_eval_string",
+ tk_get_eval_string, -1);
+ rb_define_singleton_method(mTK, "_get_eval_enc_str",
+ tk_get_eval_enc_str, 1);
+ rb_define_singleton_method(mTK, "_conv_args", tk_conv_args, -1);
+
+ rb_define_singleton_method(mTK, "bool", tcl2rb_bool, 1);
+ rb_define_singleton_method(mTK, "number", tcl2rb_number, 1);
+ rb_define_singleton_method(mTK, "string", tcl2rb_string, 1);
+ rb_define_singleton_method(mTK, "num_or_str", tcl2rb_num_or_str, 1);
+ rb_define_singleton_method(mTK, "num_or_nil", tcl2rb_num_or_nil, 1);
+
+ rb_define_method(mTK, "_toUTF8", tk_toUTF8, -1);
+ rb_define_method(mTK, "_fromUTF8", tk_fromUTF8, -1);
+ rb_define_method(mTK, "_symbolkey2str", tk_symbolkey2str, 1);
+ rb_define_method(mTK, "hash_kv", tk_hash_kv, -1);
+ rb_define_method(mTK, "_get_eval_string", tk_get_eval_string, -1);
+ rb_define_method(mTK, "_get_eval_enc_str", tk_get_eval_enc_str, 1);
+ rb_define_method(mTK, "_conv_args", tk_conv_args, -1);
+
+ rb_define_method(mTK, "bool", tcl2rb_bool, 1);
+ rb_define_method(mTK, "number", tcl2rb_number, 1);
+ rb_define_method(mTK, "string", tcl2rb_string, 1);
+ rb_define_method(mTK, "num_or_str", tcl2rb_num_or_str, 1);
+ rb_define_method(mTK, "num_or_nil", tcl2rb_num_or_nil, 1);
+
+ /* --------------------- */
+ rb_global_variable(&ENCODING_NAME_UTF8);
+ ENCODING_NAME_UTF8 = rb_obj_freeze(rb_str_new2("utf-8"));
+
+ /* --------------------- */
+}
diff --git a/ext/win32/extconf.rb b/ext/win32/extconf.rb
index ceab4ef4f4..7aa2c93684 100644
--- a/ext/win32/extconf.rb
+++ b/ext/win32/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
-if $mswin||$mingw||$cygwin
+if (compiled?('dl') or 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 d03ecc1c46..4d7d4887a5 100644
--- a/ext/win32/lib/Win32API.rb
+++ b/ext/win32/lib/Win32API.rb
@@ -1,35 +1,19 @@
# -*- ruby -*-
-# frozen_string_literal: true
-
# for backward compatibility
-warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use dl directly instead" if $VERBOSE
-require 'fiddle/import'
+require 'dl'
class Win32API
DLL = {}
- TYPEMAP = {"0" => Fiddle::TYPE_VOID, "S" => Fiddle::TYPE_VOIDP, "I" => Fiddle::TYPE_LONG}
- POINTER_TYPE = Fiddle::SIZEOF_VOIDP == Fiddle::SIZEOF_LONG_LONG ? 'q*' : 'l!*'
-
- WIN32_TYPES = "VPpNnLlIi"
- DL_TYPES = "0SSI"
+ TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
+ POINTER_TYPE = DL::SIZEOF_VOIDP == DL::SIZEOF_LONG_LONG ? 'q*' : 'l!*'
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
- @proto = [import].join.tr(WIN32_TYPES, DL_TYPES).sub(/^(.)0*$/, '\1')
- import = @proto.chars.map {|win_type| TYPEMAP[win_type.tr(WIN32_TYPES, DL_TYPES)]}
- export = TYPEMAP[export.tr(WIN32_TYPES, DL_TYPES)]
- calltype = Fiddle::Importer.const_get(:CALL_TYPE_TO_ABI)[calltype]
-
- handle = DLL[dllname] ||=
- begin
- Fiddle.dlopen(dllname)
- rescue Fiddle::DLError
- raise unless File.extname(dllname).empty?
- Fiddle.dlopen(dllname + ".dll")
- end
-
- @func = Fiddle::Function.new(handle[func], import, export, calltype)
- rescue Fiddle::DLError => e
+ @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
raise LoadError, e.message, e.backtrace
end
@@ -39,7 +23,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 2bef016c29..5936bb6900 100644
--- a/ext/win32/lib/win32/importer.rb
+++ b/ext/win32/lib/win32/importer.rb
@@ -1,9 +1,14 @@
-# frozen_string_literal: false
-require 'fiddle/import'
+begin
+ require 'fiddle/import'
+ importer = Fiddle::Importer
+rescue LoadError
+ require 'dl/import'
+ importer = DL::Importer
+end
module Win32
end
Win32.module_eval do
- Importer = Fiddle::Importer
+ Importer = importer
end
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index ea04bb34bf..74cc77dc9f 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'win32/importer'
module Win32
@@ -67,7 +66,6 @@ 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)
@@ -175,20 +173,10 @@ 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
- 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
+ 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
end
attr_reader :code
end
@@ -234,8 +222,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 RegDeleteValueW(void *, void *)",
- "long RegDeleteKeyW(void *, void *)",
+ "long RegDeleteValue(void *, void *)",
+ "long RegDeleteKey(void *, void *)",
"long RegFlushKey(void *)",
"long RegCloseKey(void *)",
"long RegQueryInfoKey(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *)",
@@ -302,7 +290,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.byteslice(0, unpackdw(size) * WCHAR_SIZE)
+ name[0, unpackdw(size)]
end
def EnumKey(hkey, index)
@@ -310,7 +298,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.byteslice(0, unpackdw(size) * WCHAR_SIZE), unpackqw(wtime) ]
+ [ name[0, unpackdw(size)], unpackqw(wtime) ]
end
def QueryValue(hkey, name)
@@ -327,17 +315,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.bytesize + WCHAR_SIZE
+ size ||= data.size + 1
end
check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
end
def DeleteValue(hkey, name)
- check RegDeleteValueW.call(hkey, make_wstr(name))
+ check RegDeleteValue.call(hkey, make_wstr(name))
end
def DeleteKey(hkey, name)
- check RegDeleteKeyW.call(hkey, make_wstr(name))
+ check RegDeleteKey.call(hkey, make_wstr(name))
end
def FlushKey(hkey)
@@ -378,16 +366,15 @@ 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
- ].inject([]) do |ary, type|
- type.freeze
- ary[Constants.const_get(type)] = type
- ary
- end.freeze
+ ].each do |type|
+ @@type2name[Constants.const_get(type)] = type
+ end
#
# Convert registry type value to readable string.
@@ -635,7 +622,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
# Array of String
# :REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD
# Integer
- # :REG_BINARY, REG_NONE
+ # :REG_BINARY
# String (contains binary data)
#
# When rtype is specified, the value type must be included by
@@ -643,16 +630,14 @@ 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.map{|t|Registry.type2name(t)}.join(', ')}] but #{
- Registry.type2name(type)} present)"
+ raise TypeError, "Type mismatch (expect #{rtype.inspect} but #{type} present)"
end
case type
when REG_SZ, REG_EXPAND_SZ
[ type, data.encode(name.encoding, WCHAR).chop ]
when REG_MULTI_SZ
[ type, data.encode(name.encoding, WCHAR).split(/\0/) ]
- when REG_BINARY, REG_NONE
+ when REG_BINARY
[ type, data ]
when REG_DWORD
[ type, API.unpackdw(data) ]
@@ -661,7 +646,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 #{Registry.type2name(type)} is not supported."
+ raise TypeError, "Type #{type} is not supported."
end
end
@@ -684,7 +669,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 #{Registry.type2name(type)} is not supported."
+ raise TypeError, "Type #{type} is not supported."
end
end
@@ -748,7 +733,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
when REG_MULTI_SZ
data = data.to_a.map {|s| s.encode(WCHAR)}.join(WCHAR_NUL) << WCHAR_NUL
termsize = WCHAR_SIZE
- when REG_BINARY, REG_NONE
+ when REG_BINARY
data = data.to_s
when REG_DWORD
data = API.packdw(data.to_i)
@@ -757,7 +742,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 #{Registry.type2name(type)}"
+ raise TypeError, "Unsupported type #{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 340a9b9d2b..b5c11bf878 100644
--- a/ext/win32/lib/win32/resolv.rb
+++ b/ext/win32/lib/win32/resolv.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
=begin
= Win32 DNS and DHCP I/F
@@ -9,7 +8,6 @@ require 'win32/registry'
module Win32
module Resolv
API = Registry::API
- Error = Registry::Error
def self.get_hosts_path
path = get_hosts_dir
@@ -34,47 +32,19 @@ module Win32
end
[ search, nameserver ]
end
- end
-end
-begin
- require 'win32/resolv.so'
-rescue LoadError
-end
-
-nt = Module.new do
- break true if [nil].pack("p").size > 4
+module Kernel32
extend Importer
- dlload "kernel32.dll"
- getv = extern "int GetVersionExA(void *)", :stdcall
- info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
- getv.call(info)
- break info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
+ dlload "kernel32"
end
-if not nt
- require_relative 'resolv9x'
- # return # does not work yet
-else
-module Win32
+getv = Kernel32.extern "int GetVersionExA(void *)", :stdcall
+info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
+getv.call(info)
+if info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
#====================================================================
# Windows NT
#====================================================================
- module Resolv
- 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
-
+ module_eval <<-'__EOS__', __FILE__, __LINE__+1
TCPIP_NT = 'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
class << self
@@ -87,7 +57,7 @@ module Win32
def get_info
search = nil
- nameserver = get_dns_server_list
+ nameserver = []
Registry::HKEY_LOCAL_MACHINE.open(TCPIP_NT) do |reg|
begin
slist = reg.read_s('SearchList')
@@ -112,17 +82,22 @@ module Win32
end
reg.open('Interfaces') do |h|
- h.each_key do |iface, |
+ h.each_key do |iface,|
h.open(iface) do |regif|
- next unless ns = %w[NameServer DhcpNameServer].find do |key|
- begin
- ns = regif.read_s(key)
- rescue Registry::Error
- else
- break ns.split(/[,\s]\s*/) unless ns.empty?
+ begin
+ [ 'NameServer', 'DhcpNameServer' ].each do |key|
+ begin
+ ns = regif.read_s(key)
+ rescue
+ else
+ unless ns.empty?
+ nameserver.concat(ns.split(/[,\s]\s*/))
+ break
+ end
+ end
end
+ rescue Registry::Error
end
- next if (nameserver & ns).empty?
if add_search
begin
@@ -144,6 +119,260 @@ module Win32
[ search.uniq, nameserver.uniq ]
end
end
- end
+ __EOS__
+else
+#====================================================================
+# Windows 9x
+#====================================================================
+ module_eval <<-'__EOS__', __FILE__, __LINE__+1
+ TCPIP_9X = 'SYSTEM\CurrentControlSet\Services\VxD\MSTCP'
+ DHCP_9X = 'SYSTEM\CurrentControlSet\Services\VxD\DHCP'
+ WINDOWS = 'Software\Microsoft\Windows\CurrentVersion'
+
+ class << self
+ # private
+
+ def get_hosts_dir
+ Registry::HKEY_LOCAL_MACHINE.open(WINDOWS) do |reg|
+ reg.read_s_expand('SystemRoot')
+ end
+ end
+
+ def get_info
+ search = []
+ nameserver = []
+ begin
+ Registry::HKEY_LOCAL_MACHINE.open(TCPIP_9X) do |reg|
+ if reg.read_s("EnableDNS") == "1"
+ domain = reg.read_s("Domain")
+ ns = reg.read_s("NameServer")
+ slist = reg.read_s("SearchList")
+ search << domain unless domain.empty?
+ search.concat(slist.split(/,\s*/))
+ nameserver.concat(ns.split(/[,\s]\s*/))
+ end
+ end
+ rescue Registry::Error
+ end
+
+ dhcpinfo = get_dhcpinfo
+ search.concat(dhcpinfo[0])
+ nameserver.concat(dhcpinfo[1])
+ [ search, nameserver ]
+ end
+
+ def get_dhcpinfo
+ macaddrs = {}
+ ipaddrs = {}
+ WsControl.get_iflist.each do |index, macaddr, *ipaddr|
+ macaddrs[macaddr] = 1
+ ipaddr.each { |ipaddr| ipaddrs[ipaddr] = 1 }
+ end
+ iflist = [ macaddrs, ipaddrs ]
+
+ search = []
+ nameserver = []
+ version = -1
+ Registry::HKEY_LOCAL_MACHINE.open(DHCP_9X) do |reg|
+ begin
+ version = API.unpackdw(reg.read_bin("Version"))
+ rescue Registry::Error
+ end
+
+ reg.each_key do |key,|
+ catch(:not_used) do
+ reg.open(key) do |regdi|
+ dom, ns = get_dhcpinfo_key(version, regdi, iflist)
+ search << dom if dom
+ nameserver.concat(ns) if ns
+ end
+ end
+ end
+ end
+ [ search, nameserver ]
+ end
+
+ def get_dhcpinfo_95(reg)
+ dhcp = reg.read_bin("DhcpInfo")
+ [
+ API.unpackdw(dhcp[4..7]),
+ API.unpackdw(dhcp[8..11]),
+ 1,
+ dhcp[45..50],
+ reg.read_bin("OptionInfo"),
+ ]
+ end
+
+ def get_dhcpinfo_98(reg)
+ [
+ API.unpackdw(reg.read_bin("DhcpIPAddress")),
+ API.unpackdw(reg.read_bin("DhcpSubnetMask")),
+ API.unpackdw(reg.read_bin("HardwareType")),
+ reg.read_bin("HardwareAddress"),
+ reg.read_bin("OptionInfo"),
+ ]
+ end
+
+ def get_dhcpinfo_key(version, reg, iflist)
+ info = case version
+ when 1
+ get_dhcpinfo_95(reg)
+ when 2
+ get_dhcpinfo_98(reg)
+ else
+ begin
+ get_dhcpinfo_98(reg)
+ rescue Registry::Error
+ get_dhcpinfo_95(reg)
+ end
+ end
+ ipaddr, netmask, hwtype, macaddr, opt = info
+ throw :not_used unless
+ ipaddr and ipaddr != 0 and
+ netmask and netmask != 0 and
+ macaddr and macaddr.size == 6 and
+ hwtype == 1 and
+ iflist[0][macaddr] and iflist[1][ipaddr]
+
+ size = opt.size
+ idx = 0
+ while idx <= size
+ opttype = opt[idx]
+ optsize = opt[idx + 1]
+ optval = opt[idx + 2, optsize]
+ case opttype
+ when 0xFF ## term
+ break
+ when 0x0F ## domain
+ domain = optval.chomp("\0")
+ when 0x06 ## dns
+ nameserver = optval.scan(/..../).collect { |addr|
+ "%d.%d.%d.%d" % addr.unpack('C4')
+ }
+ end
+ idx += optsize + 2
+ end
+ [ domain, nameserver ]
+ rescue Registry::Error
+ throw :not_used
+ end
+ end
+
+ module WsControl
+ module WSock32
+ extend Importer
+ dlload "wsock32.dll"
+ end
+ WsControl = WSock32.extern "int WsControl(int, int, void *, void *, void *, void *", :stdcall
+ WSAGetLastError = WSock32.extern "int WSAGetLastError(void)", :stdcall
+
+ MAX_TDI_ENTITIES = 512
+ IPPROTO_TCP = 6
+ WSCTL_TCP_QUERY_INFORMATION = 0
+ INFO_CLASS_GENERIC = 0x100
+ INFO_CLASS_PROTOCOL = 0x200
+ INFO_TYPE_PROVIDER = 0x100
+ ENTITY_LIST_ID = 0
+ GENERIC_ENTITY = 0
+ CL_NL_ENTITY = 0x301
+ IF_ENTITY = 0x200
+ ENTITY_TYPE_ID = 1
+ CL_NL_IP = 0x303
+ IF_MIB = 0x202
+ IF_MIB_STATS_ID = 1
+ IP_MIB_ADDRTABLE_ENTRY_ID = 0x102
+
+ def self.wsctl(tei_entity, tei_instance,
+ toi_class, toi_type, toi_id,
+ buffsize)
+ reqinfo = [
+ ## TDIEntityID
+ tei_entity, tei_instance,
+ ## TDIObjectID
+ toi_class, toi_type, toi_id,
+ ## TCP_REQUEST_INFORMATION_EX
+ ""
+ ].pack('VVVVVa16')
+ reqsize = API.packdw(reqinfo.size)
+ buff = "\0" * buffsize
+ buffsize = API.packdw(buffsize)
+ result = WsControl.call(
+ IPPROTO_TCP,
+ WSCTL_TCP_QUERY_INFORMATION,
+ reqinfo, reqsize,
+ buff, buffsize)
+ if result != 0
+ raise RuntimeError, "WsControl failed.(#{result})"
+ end
+ [ buff, API.unpackdw(buffsize) ]
+ end
+ private_class_method :wsctl
+
+ def self.get_iflist
+ # Get TDI Entity List
+ entities, size =
+ wsctl(GENERIC_ENTITY, 0,
+ INFO_CLASS_GENERIC,
+ INFO_TYPE_PROVIDER,
+ ENTITY_LIST_ID,
+ MAX_TDI_ENTITIES * 8) # sizeof(TDIEntityID)
+ entities = entities[0, size].
+ scan(/.{8}/).
+ collect { |e| e.unpack('VV') }
+
+ # Get MIB Interface List
+ iflist = []
+ ifcount = 0
+ entities.each do |entity, instance|
+ if( (entity & IF_ENTITY)>0 )
+ ifcount += 1
+ etype, = wsctl(entity, instance,
+ INFO_CLASS_GENERIC,
+ INFO_TYPE_PROVIDER,
+ ENTITY_TYPE_ID,
+ 4)
+ if( (API.unpackdw(etype) & IF_MIB)==IF_MIB )
+ ifentry, = wsctl(entity, instance,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IF_MIB_STATS_ID,
+ 21 * 4 + 8 + 130) # sizeof(IFEntry)
+ iflist << [
+ API.unpackdw(ifentry[0,4]),
+ ifentry[20, 6]
+ ]
+ end
+ end
+ end
+
+ # Get IP Addresses
+ entities.each do |entity, instance|
+ if entity == CL_NL_ENTITY
+ etype, = wsctl(entity, instance,
+ INFO_CLASS_GENERIC,
+ INFO_TYPE_PROVIDER,
+ ENTITY_TYPE_ID,
+ 4)
+ if API.unpackdw(etype) == CL_NL_IP
+ ipentries, = wsctl(entity, instance,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ADDRTABLE_ENTRY_ID,
+ 24 * (ifcount+1)) # sizeof(IPAddrEntry)
+ ipentries.scan(/.{24}/) do |ipentry|
+ ipaddr, index = ipentry.unpack('VV')
+ if ifitem = iflist.assoc(index)
+ ifitem << ipaddr
+ end
+ end
+ end
+ end
+ end
+ iflist
+ end
+ end
+ __EOS__
end
+#====================================================================
+ end
end
diff --git a/ext/win32/lib/win32/resolv9x.rb b/ext/win32/lib/win32/resolv9x.rb
deleted file mode 100644
index a409d59c0c..0000000000
--- a/ext/win32/lib/win32/resolv9x.rb
+++ /dev/null
@@ -1,253 +0,0 @@
-#====================================================================
-# Windows 9x
-#====================================================================
-module Win32
- module Resolv
- TCPIP_9X = 'SYSTEM\CurrentControlSet\Services\VxD\MSTCP'
- DHCP_9X = 'SYSTEM\CurrentControlSet\Services\VxD\DHCP'
- WINDOWS = 'Software\Microsoft\Windows\CurrentVersion'
-
- class << self
- # private
-
- def get_hosts_dir
- Registry::HKEY_LOCAL_MACHINE.open(WINDOWS) do |reg|
- reg.read_s_expand('SystemRoot')
- end
- end
-
- def get_info
- search = []
- nameserver = []
- begin
- Registry::HKEY_LOCAL_MACHINE.open(TCPIP_9X) do |reg|
- if reg.read_s("EnableDNS") == "1"
- domain = reg.read_s("Domain")
- ns = reg.read_s("NameServer")
- slist = reg.read_s("SearchList")
- search << domain unless domain.empty?
- search.concat(slist.split(/,\s*/))
- nameserver.concat(ns.split(/[,\s]\s*/))
- end
- end
- rescue Registry::Error
- end
-
- dhcpinfo = get_dhcpinfo
- search.concat(dhcpinfo[0])
- nameserver.concat(dhcpinfo[1])
- [ search, nameserver ]
- end
-
- def get_dhcpinfo
- macaddrs = {}
- ipaddrs = {}
- WsControl.get_iflist.each do |index, macaddr, *ipaddr|
- macaddrs[macaddr] = 1
- ipaddr.each { |ipaddr| ipaddrs[ipaddr] = 1 }
- end
- iflist = [ macaddrs, ipaddrs ]
-
- search = []
- nameserver = []
- version = -1
- Registry::HKEY_LOCAL_MACHINE.open(DHCP_9X) do |reg|
- begin
- version = API.unpackdw(reg.read_bin("Version"))
- rescue Registry::Error
- end
-
- reg.each_key do |key, |
- catch(:not_used) do
- reg.open(key) do |regdi|
- dom, ns = get_dhcpinfo_key(version, regdi, iflist)
- search << dom if dom
- nameserver.concat(ns) if ns
- end
- end
- end
- end
- [ search, nameserver ]
- end
-
- def get_dhcpinfo_95(reg)
- dhcp = reg.read_bin("DhcpInfo")
- [
- API.unpackdw(dhcp[4..7]),
- API.unpackdw(dhcp[8..11]),
- 1,
- dhcp[45..50],
- reg.read_bin("OptionInfo"),
- ]
- end
-
- def get_dhcpinfo_98(reg)
- [
- API.unpackdw(reg.read_bin("DhcpIPAddress")),
- API.unpackdw(reg.read_bin("DhcpSubnetMask")),
- API.unpackdw(reg.read_bin("HardwareType")),
- reg.read_bin("HardwareAddress"),
- reg.read_bin("OptionInfo"),
- ]
- end
-
- def get_dhcpinfo_key(version, reg, iflist)
- info = case version
- when 1
- get_dhcpinfo_95(reg)
- when 2
- get_dhcpinfo_98(reg)
- else
- begin
- get_dhcpinfo_98(reg)
- rescue Registry::Error
- get_dhcpinfo_95(reg)
- end
- end
- ipaddr, netmask, hwtype, macaddr, opt = info
- throw :not_used unless
- ipaddr and ipaddr != 0 and
- netmask and netmask != 0 and
- macaddr and macaddr.size == 6 and
- hwtype == 1 and
- iflist[0][macaddr] and iflist[1][ipaddr]
-
- size = opt.size
- idx = 0
- while idx <= size
- opttype = opt[idx]
- optsize = opt[idx + 1]
- optval = opt[idx + 2, optsize]
- case opttype
- when 0xFF ## term
- break
- when 0x0F ## domain
- domain = optval.chomp("\0")
- when 0x06 ## dns
- nameserver = optval.scan(/..../).collect { |addr|
- "%d.%d.%d.%d" % addr.unpack('C4')
- }
- end
- idx += optsize + 2
- end
- [ domain, nameserver ]
- rescue Registry::Error
- throw :not_used
- end
- end
-
- module WsControl
- module WSock32
- extend Importer
- dlload "wsock32.dll"
- end
- WsControl = WSock32.extern "int WsControl(int, int, void *, void *, void *, void *)", :stdcall
- WSAGetLastError = WSock32.extern "int WSAGetLastError(void)", :stdcall
-
- MAX_TDI_ENTITIES = 512
- IPPROTO_TCP = 6
- WSCTL_TCP_QUERY_INFORMATION = 0
- INFO_CLASS_GENERIC = 0x100
- INFO_CLASS_PROTOCOL = 0x200
- INFO_TYPE_PROVIDER = 0x100
- ENTITY_LIST_ID = 0
- GENERIC_ENTITY = 0
- CL_NL_ENTITY = 0x301
- IF_ENTITY = 0x200
- ENTITY_TYPE_ID = 1
- CL_NL_IP = 0x303
- IF_MIB = 0x202
- IF_MIB_STATS_ID = 1
- IP_MIB_ADDRTABLE_ENTRY_ID = 0x102
-
- def self.wsctl(tei_entity, tei_instance,
- toi_class, toi_type, toi_id,
- buffsize)
- reqinfo = [
- ## TDIEntityID
- tei_entity, tei_instance,
- ## TDIObjectID
- toi_class, toi_type, toi_id,
- ## TCP_REQUEST_INFORMATION_EX
- ""
- ].pack('VVVVVa16')
- reqsize = API.packdw(reqinfo.size)
- buff = "\0" * buffsize
- buffsize = API.packdw(buffsize)
- result = WsControl.call(
- IPPROTO_TCP,
- WSCTL_TCP_QUERY_INFORMATION,
- reqinfo, reqsize,
- buff, buffsize)
- if result != 0
- raise RuntimeError, "WsControl failed.(#{result})"
- end
- [ buff, API.unpackdw(buffsize) ]
- end
- private_class_method :wsctl
-
- def self.get_iflist
- # Get TDI Entity List
- entities, size =
- wsctl(GENERIC_ENTITY, 0,
- INFO_CLASS_GENERIC,
- INFO_TYPE_PROVIDER,
- ENTITY_LIST_ID,
- MAX_TDI_ENTITIES * 8) # sizeof(TDIEntityID)
- entities = entities[0, size].
- scan(/.{8}/).
- collect { |e| e.unpack('VV') }
-
- # Get MIB Interface List
- iflist = []
- ifcount = 0
- entities.each do |entity, instance|
- if( (entity & IF_ENTITY)>0 )
- ifcount += 1
- etype, = wsctl(entity, instance,
- INFO_CLASS_GENERIC,
- INFO_TYPE_PROVIDER,
- ENTITY_TYPE_ID,
- 4)
- if( (API.unpackdw(etype) & IF_MIB)==IF_MIB )
- ifentry, = wsctl(entity, instance,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IF_MIB_STATS_ID,
- 21 * 4 + 8 + 130) # sizeof(IFEntry)
- iflist << [
- API.unpackdw(ifentry[0,4]),
- ifentry[20, 6]
- ]
- end
- end
- end
-
- # Get IP Addresses
- entities.each do |entity, instance|
- if entity == CL_NL_ENTITY
- etype, = wsctl(entity, instance,
- INFO_CLASS_GENERIC,
- INFO_TYPE_PROVIDER,
- ENTITY_TYPE_ID,
- 4)
- if API.unpackdw(etype) == CL_NL_IP
- ipentries, = wsctl(entity, instance,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ADDRTABLE_ENTRY_ID,
- 24 * (ifcount+1)) # sizeof(IPAddrEntry)
- ipentries.scan(/.{24}/) do |ipentry|
- ipaddr, index = ipentry.unpack('VV')
- if ifitem = iflist.assoc(index)
- ifitem << ipaddr
- end
- end
- end
- end
- end
- iflist
- end
- end
- end
-end
diff --git a/ext/win32/lib/win32/sspi.rb b/ext/win32/lib/win32/sspi.rb
index 8103893d7f..4645e1b306 100644
--- a/ext/win32/lib/win32/sspi.rb
+++ b/ext/win32/lib/win32/sspi.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = win32/sspi.rb
#
@@ -73,7 +72,7 @@ module Win32
end
end
- # Creates binary representations of a SecBufferDesc structure,
+ # Creates binary representaiton of a SecBufferDesc structure,
# including the SecBuffer contained inside.
class SecurityBuffer
diff --git a/ext/win32/resolv/extconf.rb b/ext/win32/resolv/extconf.rb
deleted file mode 100644
index 01f3df730a..0000000000
--- a/ext/win32/resolv/extconf.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-if have_library('iphlpapi', 'GetNetworkParams')
- create_makefile('win32/resolv')
-end
diff --git a/ext/win32/resolv/resolv.c b/ext/win32/resolv/resolv.c
deleted file mode 100644
index f19243ccc1..0000000000
--- a/ext/win32/resolv/resolv.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <ruby.h>
-#include <ruby/encoding.h>
-#include <windows.h>
-#ifndef NTDDI_VERSION
-#define NTDDI_VERSION 0x06000000
-#endif
-#include <iphlpapi.h>
-
-static VALUE
-w32error_make_error(DWORD e)
-{
- VALUE code = ULONG2NUM(e);
- return rb_class_new_instance(1, &code, rb_path2class("Win32::Resolv::Error"));
-}
-
-static void
-w32error_raise(DWORD e)
-{
- rb_exc_raise(w32error_make_error(e));
-}
-
-static VALUE
-get_dns_server_list(VALUE self)
-{
- FIXED_INFO *fixedinfo = NULL;
- ULONG buflen = 0;
- DWORD ret;
- VALUE buf, nameservers = Qnil;
-
- ret = GetNetworkParams(NULL, &buflen);
- if (ret != NO_ERROR && ret != ERROR_BUFFER_OVERFLOW) {
- w32error_raise(ret);
- }
- fixedinfo = ALLOCV(buf, buflen);
- ret = GetNetworkParams(fixedinfo, &buflen);
- if (ret == NO_ERROR) {
- const IP_ADDR_STRING *ipaddr = &fixedinfo->DnsServerList;
- nameservers = rb_ary_new();
- do {
- const char *s = ipaddr->IpAddress.String;
- if (!*s) continue;
- if (strcmp(s, "0.0.0.0") == 0) continue;
- rb_ary_push(nameservers, rb_str_new_cstr(s));
- } while ((ipaddr = ipaddr->Next) != NULL);
- }
- ALLOCV_END(buf);
- if (ret != NO_ERROR) w32error_raise(ret);
-
- return nameservers;
-}
-
-void
-InitVM_resolv(void)
-{
- VALUE mWin32 = rb_define_module("Win32");
- VALUE resolv = rb_define_module_under(mWin32, "Resolv");
- VALUE singl = rb_singleton_class(resolv);
- rb_define_private_method(singl, "get_dns_server_list", get_dns_server_list, 0);
-}
-
-void
-Init_resolv(void)
-{
- InitVM(resolv);
-}
diff --git a/ext/win32ole/extconf.rb b/ext/win32ole/extconf.rb
index d2044663a9..52c3d6bdfb 100644
--- a/ext/win32ole/extconf.rb
+++ b/ext/win32ole/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#----------------------------------
# extconf.rb
# $Revision$
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb
deleted file mode 100644
index 635510b277..0000000000
--- a/ext/win32ole/lib/win32ole.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-begin
- require 'win32ole.so'
-rescue LoadError
- # do nothing
-end
-
-if defined?(WIN32OLE)
- # WIN32OLE
- class WIN32OLE
-
- #
- # By overriding Object#methods, WIN32OLE might
- # work well with did_you_mean gem.
- # This is experimental.
- #
- # require 'win32ole'
- # dict = WIN32OLE.new('Scripting.Dictionary')
- # dict.Ade('a', 1)
- # #=> Did you mean? Add
- #
- def methods(*args)
- super + ole_methods_safely.map(&:name)
- end
-
- private
-
- def ole_methods_safely
- ole_methods
- rescue WIN32OLEQueryInterfaceError
- []
- end
- end
-end
diff --git a/ext/win32ole/lib/win32ole/property.rb b/ext/win32ole/lib/win32ole/property.rb
index fea047cd19..a68bad9af8 100644
--- a/ext/win32ole/lib/win32ole/property.rb
+++ b/ext/win32ole/lib/win32ole/property.rb
@@ -1,4 +1,3 @@
-# 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 4fe1d0c2a9..c8cd38e732 100644
--- a/ext/win32ole/sample/excel1.rb
+++ b/ext/win32ole/sample/excel1.rb
@@ -1,9 +1,8 @@
-# frozen_string_literal: false
require 'win32ole'
application = WIN32OLE.new('Excel.Application')
-application.visible = true
+application.visible = TRUE
workbook = application.Workbooks.Add();
worksheet = workbook.Worksheets(1);
@@ -27,11 +26,8 @@ range = worksheet.Range("A1:D2");
range.Select
chart = workbook.Charts.Add;
-workbook.saved = true;
-
-print "Now quit Excel... Please enter."
-gets
-
+workbook.saved = TRUE;
+sleep 0.5
application.ActiveWorkbook.Close(0);
application.Quit();
diff --git a/ext/win32ole/sample/excel2.rb b/ext/win32ole/sample/excel2.rb
index 47a5715f84..95af61ceb6 100644
--- a/ext/win32ole/sample/excel2.rb
+++ b/ext/win32ole/sample/excel2.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'win32ole'
# -4100 is the value for the Excel constant xl3DColumn.
@@ -8,7 +7,7 @@ ChartTypeVal = -4100;
excel = WIN32OLE.new("excel.application")
# Create and rotate the chart
-excel.visible = true;
+excel.visible = TRUE;
excel.Workbooks.Add();
excel.Range("a1").value = 3;
excel.Range("a2").value = 2;
@@ -24,8 +23,5 @@ i.step(180, 10) do |rot|
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 72aee2a929..0f96717063 100644
--- a/ext/win32ole/sample/excel3.rb
+++ b/ext/win32ole/sample/excel3.rb
@@ -1,10 +1,9 @@
-# frozen_string_literal: false
require 'win32ole'
#application = WIN32OLE.new('Excel.Application.5')
application = WIN32OLE.new('Excel.Application')
-application.visible = true
+application.visible = TRUE
workbook = application.Workbooks.Add();
sheet = workbook.Worksheets(1);
sheetS = workbook.Worksheets
@@ -12,10 +11,3 @@ 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 4db64eed30..11dc861e0b 100644
--- a/ext/win32ole/sample/ie.rb
+++ b/ext/win32ole/sample/ie.rb
@@ -1,8 +1,7 @@
-# frozen_string_literal: false
require 'win32ole'
url = 'http://www.ruby-lang.org/'
ie = WIN32OLE.new('InternetExplorer.Application')
-ie.visible = true
+ie.visible = TRUE
ie.gohome
print "Now navigate Ruby home page... Please enter."
gets
diff --git a/ext/win32ole/sample/ieconst.rb b/ext/win32ole/sample/ieconst.rb
index 363a4f8153..2c6a7a383c 100644
--- a/ext/win32ole/sample/ieconst.rb
+++ b/ext/win32ole/sample/ieconst.rb
@@ -1,4 +1,3 @@
-# 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 5d0536028b..8b279ddaae 100644
--- a/ext/win32ole/sample/ienavi.rb
+++ b/ext/win32ole/sample/ienavi.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'win32ole'
$urls = []
@@ -9,7 +8,7 @@ end
def stop_msg_loop
puts "Now Stop IE..."
- $LOOP = false;
+ $LOOP = FALSE;
end
def default_handler(event, *args)
@@ -20,7 +19,7 @@ def default_handler(event, *args)
end
ie = WIN32OLE.new('InternetExplorer.Application')
-ie.visible = true
+ie.visible = TRUE
ie.gohome
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents')
@@ -29,7 +28,7 @@ ev.on_event {|*args| default_handler(*args)}
ev.on_event("NavigateComplete") {|url| navigate(url)}
ev.on_event("Quit") {|*args| stop_msg_loop}
-$LOOP = true
+$LOOP = TRUE
while ($LOOP)
WIN32OLE_EVENT.message_loop
end
diff --git a/ext/win32ole/sample/ienavi2.rb b/ext/win32ole/sample/ienavi2.rb
index 3248393077..67977e28ab 100644
--- a/ext/win32ole/sample/ienavi2.rb
+++ b/ext/win32ole/sample/ienavi2.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'win32ole'
class IEHandler
diff --git a/ext/win32ole/sample/oledirs.rb b/ext/win32ole/sample/oledirs.rb
index e52a0fd7ac..dbacc2131d 100644
--- a/ext/win32ole/sample/oledirs.rb
+++ b/ext/win32ole/sample/oledirs.rb
@@ -1,4 +1,3 @@
-# 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 4b088a774f..aa0288ddbb 100644
--- a/ext/win32ole/sample/olegen.rb
+++ b/ext/win32ole/sample/olegen.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#-----------------------------
# olegen.rb
# $Revision$
diff --git a/ext/win32ole/sample/xml.rb b/ext/win32ole/sample/xml.rb
index 36c3db32ef..4b1a54dc75 100644
--- a/ext/win32ole/sample/xml.rb
+++ b/ext/win32ole/sample/xml.rb
@@ -1,4 +1,3 @@
-# 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 9d0b1b0431..a99bff2257 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -26,7 +26,7 @@
const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
#endif
-#define WIN32OLE_VERSION "1.8.8"
+#define WIN32OLE_VERSION "1.8.2"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -36,13 +36,13 @@ typedef HWND (WINAPI FNHTMLHELP)(HWND hwndCaller, LPCSTR pszFile,
typedef BOOL (FNENUMSYSEMCODEPAGES) (CODEPAGE_ENUMPROC, DWORD);
VALUE cWIN32OLE;
-#if defined(RB_THREAD_SPECIFIC) && (defined(__CYGWIN__))
+#if defined(RB_THREAD_SPECIFIC) && (defined(__CYGWIN__) || defined(__MINGW32__))
static RB_THREAD_SPECIFIC BOOL g_ole_initialized;
# define g_ole_initialized_init() ((void)0)
# define g_ole_initialized_set(val) (g_ole_initialized = (val))
#else
static volatile DWORD g_ole_initialized_key = TLS_OUT_OF_INDEXES;
-# define g_ole_initialized (TlsGetValue(g_ole_initialized_key)!=0)
+# define g_ole_initialized (BOOL)TlsGetValue(g_ole_initialized_key)
# define g_ole_initialized_init() (g_ole_initialized_key = TlsAlloc())
# define g_ole_initialized_set(val) TlsSetValue(g_ole_initialized_key, (void*)(val))
#endif
@@ -50,18 +50,17 @@ static volatile DWORD g_ole_initialized_key = TLS_OUT_OF_INDEXES;
static BOOL g_uninitialize_hooked = FALSE;
static BOOL g_cp_installed = FALSE;
static BOOL g_lcid_installed = FALSE;
-static BOOL g_running_nano = FALSE;
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 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;
@@ -98,9 +97,8 @@ static void load_conv_function51932(void);
static UINT ole_init_cp(void);
static void ole_freeexceptinfo(EXCEPINFO *pExInfo);
static VALUE ole_excepinfo2msg(EXCEPINFO *pExInfo);
-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 void ole_free(struct oledata *pole);
+static LPWSTR ole_mb2wc(char *pm, int len);
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);
@@ -167,22 +165,8 @@ static VALUE ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE ty
static VALUE fole_method_help(VALUE self, VALUE cmdname);
static VALUE fole_activex_initialize(VALUE self);
-static void com_hash_free(void *ptr);
-static void com_hash_mark(void *ptr);
-static size_t com_hash_size(const void *ptr);
-static void check_nano_server(void);
-
-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 void init_enc2cp(void);
+static void free_enc2cp(void);
static HRESULT (STDMETHODCALLTYPE mf_QueryInterface)(
IMessageFilter __RPC_FAR * This,
@@ -351,7 +335,7 @@ static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )(
Win32OLEIDispatch* p = (Win32OLEIDispatch*)This;
*/
char* psz = ole_wc2mb(*rgszNames); // support only one method
- ID nameid = rb_check_id_cstr(psz, (long)strlen(psz), cWIN32OLE_enc);
+ ID nameid = rb_intern(psz);
free(psz);
if ((ID)(DISPID)nameid != nameid) return E_NOINTERFACE;
*rgDispId = (DISPID)nameid;
@@ -385,13 +369,13 @@ static /* [local] */ HRESULT ( STDMETHODCALLTYPE Invoke )(
mid = rb_intern("value");
}
}
- v = rb_funcallv(p->obj, mid, args, parg);
+ v = rb_funcall2(p->obj, mid, args, parg);
ole_val2variant(v, pVarResult);
return S_OK;
}
BOOL
-ole_initialized(void)
+ole_initialized()
{
return g_ole_initialized;
}
@@ -402,6 +386,7 @@ 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++;
@@ -423,13 +408,14 @@ rbtime2vtdate(VALUE tmobj)
double t;
double nsec;
- st.wYear = RB_FIX2INT(rb_funcall(tmobj, rb_intern("year"), 0));
- st.wMonth = RB_FIX2INT(rb_funcall(tmobj, rb_intern("month"), 0));
- st.wDay = RB_FIX2INT(rb_funcall(tmobj, rb_intern("mday"), 0));
- st.wHour = RB_FIX2INT(rb_funcall(tmobj, rb_intern("hour"), 0));
- st.wMinute = RB_FIX2INT(rb_funcall(tmobj, rb_intern("min"), 0));
- st.wSecond = RB_FIX2INT(rb_funcall(tmobj, rb_intern("sec"), 0));
- st.wMilliseconds = 0;
+ memset(&st, 0, sizeof(SYSTEMTIME));
+ 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;
SystemTimeToVariantTime(&st, &t);
/*
@@ -437,7 +423,7 @@ rbtime2vtdate(VALUE tmobj)
* wMilliseconds of SYSTEMTIME struct.
* So, we need to calculate milliseconds by ourselves.
*/
- nsec = RB_FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0));
+ nsec = FIX2INT(rb_funcall(tmobj, rb_intern("nsec"), 0));
nsec /= 1000000.0;
nsec /= (24.0 * 3600.0);
nsec /= 1000;
@@ -450,35 +436,27 @@ vtdate2rbtime(double date)
SYSTEMTIME st;
VALUE v;
double msec;
- double sec;
VariantTimeToSystemTime(date, &st);
v = rb_funcall(rb_cTime, rb_intern("new"), 6,
- RB_INT2FIX(st.wYear),
- RB_INT2FIX(st.wMonth),
- RB_INT2FIX(st.wDay),
- RB_INT2FIX(st.wHour),
- RB_INT2FIX(st.wMinute),
- RB_INT2FIX(st.wSecond));
- st.wYear = RB_FIX2INT(rb_funcall(v, rb_intern("year"), 0));
- st.wMonth = RB_FIX2INT(rb_funcall(v, rb_intern("month"), 0));
- st.wDay = RB_FIX2INT(rb_funcall(v, rb_intern("mday"), 0));
- st.wHour = RB_FIX2INT(rb_funcall(v, rb_intern("hour"), 0));
- st.wMinute = RB_FIX2INT(rb_funcall(v, rb_intern("min"), 0));
- st.wSecond = RB_FIX2INT(rb_funcall(v, rb_intern("sec"), 0));
- st.wMilliseconds = 0;
- SystemTimeToVariantTime(&st, &sec);
+ INT2FIX(st.wYear),
+ INT2FIX(st.wMonth),
+ INT2FIX(st.wDay),
+ INT2FIX(st.wHour),
+ INT2FIX(st.wMinute),
+ INT2FIX(st.wSecond));
/*
* 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 = fabs(date);
+ msec -= floor(date);
msec *= 24 * 60;
msec -= floor(msec);
msec *= 60;
- if (msec >= 59) {
- msec -= 60;
- }
+ msec -= st.wSecond;
+ msec = round(msec * 1000);
+ msec /= 1000;
if (msec != 0) {
return rb_funcall(v, rb_intern("+"), 1, rb_float_new(msec));
}
@@ -578,13 +556,11 @@ 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 && need_conv_function51932())
+#define conv_51932(cp) ((cp) == 51932 && (load_conv_function51932(), 1))
static void
set_ole_codepage(UINT cp)
@@ -692,25 +668,6 @@ 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)
{
@@ -718,17 +675,32 @@ ole_wc2mb_alloc(LPWSTR pw, char *(alloc)(UINT size, void *arg), void *arg)
UINT size = 0;
if (conv_51932(cWIN32OLE_cp)) {
#ifndef pIMultiLanguage
- ole_ml_wc2mb_conv(pw, NULL, size, {});
+ 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);
+ }
pm = alloc(size, arg);
- if (size) ole_ml_wc2mb_conv(pw, pm, size, xfree(pm));
+ 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);
+ }
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;
}
@@ -819,67 +791,39 @@ ole_initialize(void)
}
if(g_ole_initialized == FALSE) {
- if(g_running_nano) {
- hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
- } else {
- hr = OleInitialize(NULL);
- }
+ hr = OleInitialize(NULL);
if(FAILED(hr)) {
ole_raise(hr, rb_eRuntimeError, "fail: OLE initialize");
}
g_ole_initialized_set(TRUE);
- if (g_running_nano == FALSE) {
- hr = CoRegisterMessageFilter(&imessage_filter, &previous_filter);
- if(FAILED(hr)) {
- previous_filter = NULL;
- ole_raise(hr, rb_eRuntimeError, "fail: install OLE MessageFilter");
- }
+ hr = CoRegisterMessageFilter(&imessage_filter, &previous_filter);
+ if(FAILED(hr)) {
+ previous_filter = NULL;
+ ole_raise(hr, rb_eRuntimeError, "fail: install OLE MessageFilter");
}
}
}
static void
-ole_free(void *ptr)
+ole_free(struct oledata *pole)
{
- struct oledata *pole = ptr;
OLE_FREE(pole->pDispatch);
free(pole);
}
-static size_t ole_size(const void *ptr)
-{
- return ptr ? sizeof(struct oledata) : 0;
-}
-
-struct oledata *
-oledata_get_struct(VALUE ole)
-{
- struct oledata *pole;
- TypedData_Get_Struct(ole, struct oledata, &ole_datatype, pole);
- return pole;
-}
-
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(tbl, (VALUE)enc | FIXNUM_FLAG, &data)) {
- cp = RB_FIX2INT((VALUE)data);
+ if (st_lookup(enc2cp_table, (st_data_t)enc, &data)) {
+ cp = (int)data;
} else {
cp = ole_encoding2cp(enc);
if (code_page_installed(cp) ||
@@ -891,45 +835,63 @@ ole_vstr2wc(VALUE vstr)
cp == CP_UTF7 ||
cp == CP_UTF8 ||
cp == 51932) {
- st_insert(tbl, (VALUE)enc | FIXNUM_FLAG, RB_INT2FIX(cp));
+ st_insert(enc2cp_table, (st_data_t)enc, (st_data_t)cp);
} else {
rb_raise(eWIN32OLERuntimeError, "not installed Windows codepage(%d) according to `%s'", cp, rb_enc_name(enc));
}
}
- pw = ole_mb2wc(RSTRING_PTR(vstr), RSTRING_LENINT(vstr), cp);
- RB_GC_GUARD(vstr);
+ 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);
return pw;
}
static LPWSTR
-ole_mb2wc(char *pm, int len, UINT cp)
+ole_mb2wc(char *pm, int len)
{
UINT size = 0;
LPWSTR pw;
- if (conv_51932(cp)) {
+ if (conv_51932(cWIN32OLE_cp)) {
#ifndef pIMultiLanguage
DWORD dw = 0;
UINT n = len;
HRESULT hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cp, pm, &n, NULL, &size);
+ &dw, cWIN32OLE_cp, pm, &n, NULL, &size);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
}
pw = SysAllocStringLen(NULL, size);
- n = len;
hr = pIMultiLanguage->lpVtbl->ConvertStringToUnicode(pIMultiLanguage,
- &dw, cp, pm, &n, pw, &size);
+ &dw, cWIN32OLE_cp, pm, &n, pw, &size);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cp);
+ ole_raise(hr, eWIN32OLERuntimeError, "fail to convert CP%d to Unicode", cWIN32OLE_cp);
}
- return pw;
#endif
+ return pw;
}
- size = MultiByteToWideChar(cp, 0, pm, len, NULL, 0);
- pw = SysAllocStringLen(NULL, size);
- pw[size-1] = 0;
- MultiByteToWideChar(cp, 0, pm, len, pw, size);
+ size = MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, NULL, 0);
+ pw = SysAllocStringLen(NULL, size - 1);
+ MultiByteToWideChar(cWIN32OLE_cp, 0, pm, len, pw, size);
return pw;
}
@@ -1247,16 +1209,18 @@ ole_val_ary2variant_ary(VALUE val, VARIANT *var, VARTYPE vt)
void
ole_val2variant(VALUE val, VARIANT *var)
{
- struct oledata *pole = NULL;
+ struct oledata *pole;
+ struct olevariantdata *pvar;
if(rb_obj_is_kind_of(val, cWIN32OLE)) {
- pole = oledata_get_struct(val);
+ Data_Get_Struct(val, struct oledata, pole);
OLE_ADDREF(pole->pDispatch);
V_VT(var) = VT_DISPATCH;
V_DISPATCH(var) = pole->pDispatch;
return;
}
if (rb_obj_is_kind_of(val, cWIN32OLE_VARIANT)) {
- ole_variant2variant(val, var);
+ Data_Get_Struct(val, struct olevariantdata, pvar);
+ VariantCopy(var, &(pvar->var));
return;
}
if (rb_obj_is_kind_of(val, cWIN32OLE_RECORD)) {
@@ -1278,16 +1242,7 @@ ole_val2variant(VALUE val, VARIANT *var)
break;
case T_FIXNUM:
V_VT(var) = VT_I4;
- {
- long v = RB_NUM2LONG(val);
- V_I4(var) = (LONG)v;
-#if SIZEOF_LONG > 4
- if (V_I4(var) != v) {
- V_I8(var) = v;
- V_VT(var) = VT_I8;
- }
-#endif
- }
+ V_I4(var) = NUM2INT(val);
break;
case T_BIGNUM:
V_VT(var) = VT_R8;
@@ -1350,8 +1305,8 @@ default_inspect(VALUE self, const char *class_name)
static VALUE
ole_set_member(VALUE self, IDispatch *dispatch)
{
- struct oledata *pole = NULL;
- pole = oledata_get_struct(self);
+ struct oledata *pole;
+ Data_Get_Struct(self, struct oledata, pole);
if (pole->pDispatch) {
OLE_RELEASE(pole->pDispatch);
pole->pDispatch = NULL;
@@ -1367,7 +1322,7 @@ fole_s_allocate(VALUE klass)
struct oledata *pole;
VALUE obj;
ole_initialize();
- obj = TypedData_Make_Struct(klass, struct oledata, &ole_datatype, pole);
+ obj = Data_Make_Struct(klass,struct oledata,0,ole_free,pole);
pole->pDispatch = NULL;
return obj;
}
@@ -1494,58 +1449,58 @@ ole_variant2val(VARIANT *pvar)
break;
case VT_I1:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_I1REF(pvar));
+ obj = INT2NUM((long)*V_I1REF(pvar));
else
- obj = RB_INT2NUM((long)V_I1(pvar));
+ obj = INT2NUM((long)V_I1(pvar));
break;
case VT_UI1:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_UI1REF(pvar));
+ obj = INT2NUM((long)*V_UI1REF(pvar));
else
- obj = RB_INT2NUM((long)V_UI1(pvar));
+ obj = INT2NUM((long)V_UI1(pvar));
break;
case VT_I2:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_I2REF(pvar));
+ obj = INT2NUM((long)*V_I2REF(pvar));
else
- obj = RB_INT2NUM((long)V_I2(pvar));
+ obj = INT2NUM((long)V_I2(pvar));
break;
case VT_UI2:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_UI2REF(pvar));
+ obj = INT2NUM((long)*V_UI2REF(pvar));
else
- obj = RB_INT2NUM((long)V_UI2(pvar));
+ obj = INT2NUM((long)V_UI2(pvar));
break;
case VT_I4:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_I4REF(pvar));
+ obj = INT2NUM((long)*V_I4REF(pvar));
else
- obj = RB_INT2NUM((long)V_I4(pvar));
+ obj = INT2NUM((long)V_I4(pvar));
break;
case VT_UI4:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_UI4REF(pvar));
+ obj = INT2NUM((long)*V_UI4REF(pvar));
else
- obj = RB_INT2NUM((long)V_UI4(pvar));
+ obj = INT2NUM((long)V_UI4(pvar));
break;
case VT_INT:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_INTREF(pvar));
+ obj = INT2NUM((long)*V_INTREF(pvar));
else
- obj = RB_INT2NUM((long)V_INT(pvar));
+ obj = INT2NUM((long)V_INT(pvar));
break;
case VT_UINT:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM((long)*V_UINTREF(pvar));
+ obj = INT2NUM((long)*V_UINTREF(pvar));
else
- obj = RB_INT2NUM((long)V_UINT(pvar));
+ obj = INT2NUM((long)V_UINT(pvar));
break;
#if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
@@ -1591,22 +1546,18 @@ ole_variant2val(VARIANT *pvar)
case VT_BSTR:
{
- BSTR bstr;
if(V_ISBYREF(pvar))
- bstr = *V_BSTRREF(pvar);
+ obj = ole_wc2vstr(*V_BSTRREF(pvar), FALSE);
else
- bstr = V_BSTR(pvar);
- obj = (SysStringLen(bstr) == 0)
- ? rb_str_new2("")
- : ole_wc2vstr(bstr, FALSE);
+ obj = ole_wc2vstr(V_BSTR(pvar), FALSE);
break;
}
case VT_ERROR:
if(V_ISBYREF(pvar))
- obj = RB_INT2NUM(*V_ERRORREF(pvar));
+ obj = INT2NUM(*V_ERRORREF(pvar));
else
- obj = RB_INT2NUM(V_ERROR(pvar));
+ obj = INT2NUM(V_ERROR(pvar));
break;
case VT_BOOL:
@@ -1809,9 +1760,7 @@ ole_const_load(ITypeLib *pTypeLib, VALUE klass, VALUE self)
*pName = toupper((int)*pName);
id = rb_intern(pName);
if (rb_is_const_id(id)) {
- if(!rb_const_defined_at(klass, id)) {
- rb_define_const(klass, pName, val);
- }
+ rb_define_const(klass, pName, val);
}
else {
rb_hash_aset(constant, rb_str_new2(pName), val);
@@ -1855,7 +1804,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, cWIN32OLE_cp);
+ pbuf = ole_mb2wc(clsid, -1);
hr = CLSIDFromString(pbuf, pclsid);
SysFreeString(pbuf);
}
@@ -2053,7 +2002,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
{
VALUE ole;
VALUE klass;
- struct oledata *pole = NULL;
+ struct oledata *pole;
ITypeInfo *pTypeInfo;
ITypeLib *pTypeLib;
unsigned int index;
@@ -2069,16 +2018,16 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eTypeError, "2nd parameter must be Class or Module");
}
if (rb_obj_is_kind_of(ole, cWIN32OLE)) {
- pole = oledata_get_struct(ole);
+ OLEData_Get_Struct(ole, pole);
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
if(FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
OLE_RELEASE(pTypeInfo);
if(!RB_TYPE_P(klass, T_NIL)) {
@@ -2135,9 +2084,9 @@ reference_count(struct oledata * pole)
static VALUE
fole_s_reference_count(VALUE self, VALUE obj)
{
- struct oledata * pole = NULL;
- pole = oledata_get_struct(obj);
- return RB_INT2NUM(reference_count(pole));
+ struct oledata * pole;
+ OLEData_Get_Struct(obj, pole);
+ return INT2NUM(reference_count(pole));
}
/*
@@ -2153,14 +2102,14 @@ static VALUE
fole_s_free(VALUE self, VALUE obj)
{
ULONG n = 0;
- struct oledata * pole = NULL;
- pole = oledata_get_struct(obj);
+ struct oledata * pole;
+ OLEData_Get_Struct(obj, pole);
if(pole->pDispatch) {
if (reference_count(pole) > 0) {
n = OLE_RELEASE(pole->pDispatch);
}
}
- return RB_INT2NUM(n);
+ return INT2NUM(n);
}
static HWND
@@ -2177,10 +2126,10 @@ ole_show_help(VALUE helpfile, VALUE helpcontext)
if (!pfnHtmlHelp)
return hwnd;
hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile),
- 0x0f, RB_NUM2INT(helpcontext));
+ 0x0f, NUM2INT(helpcontext));
if (hwnd == 0)
hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile),
- 0, RB_NUM2INT(helpcontext));
+ 0, NUM2INT(helpcontext));
return hwnd;
}
@@ -2237,7 +2186,7 @@ fole_s_show_help(int argc, VALUE *argv, VALUE self)
static VALUE
fole_s_get_code_page(VALUE self)
{
- return RB_INT2FIX(cWIN32OLE_cp);
+ return INT2FIX(cWIN32OLE_cp);
}
static BOOL CALLBACK
@@ -2274,7 +2223,7 @@ code_page_installed(UINT cp)
static VALUE
fole_s_set_code_page(VALUE self, VALUE vcp)
{
- UINT cp = RB_FIX2INT(vcp);
+ UINT cp = FIX2INT(vcp);
set_ole_codepage(cp);
/*
* Should this method return old codepage?
@@ -2294,7 +2243,7 @@ fole_s_set_code_page(VALUE self, VALUE vcp)
static VALUE
fole_s_get_locale(VALUE self)
{
- return RB_INT2FIX(cWIN32OLE_lcid);
+ return INT2FIX(cWIN32OLE_lcid);
}
static BOOL
@@ -2329,7 +2278,7 @@ lcid_installed(LCID lcid)
static VALUE
fole_s_set_locale(VALUE self, VALUE vlcid)
{
- LCID lcid = RB_FIX2INT(vlcid);
+ LCID lcid = FIX2INT(vlcid);
if (lcid_installed(lcid)) {
cWIN32OLE_lcid = lcid;
} else {
@@ -2376,7 +2325,7 @@ fole_s_create_guid(VALUE self)
* You must not use these method.
*/
-/* :nodoc: */
+/* :nodoc */
static VALUE
fole_s_ole_initialize(VALUE self)
{
@@ -2384,7 +2333,7 @@ fole_s_ole_initialize(VALUE self)
return Qnil;
}
-/* :nodoc: */
+/* :nodoc */
static VALUE
fole_s_ole_uninitialize(VALUE self)
{
@@ -2442,16 +2391,12 @@ fole_s_ole_uninitialize(VALUE self)
/*
* call-seq:
* WIN32OLE.new(server, [host]) -> WIN32OLE object
- * WIN32OLE.new(server, license: 'key') -> WIN32OLE object
*
* Returns a new WIN32OLE object(OLE Automation object).
* The first argument server specifies OLE Automation server.
* The first argument should be CLSID or PROGID.
* If second argument host specified, then returns OLE Automation
* object on host.
- * If :license keyword argument is provided,
- * IClassFactory2::CreateInstanceLic is used to create instance of
- * licensed server.
*
* WIN32OLE.new('Excel.Application') # => Excel OLE Automation WIN32OLE object.
* WIN32OLE.new('{00024500-0000-0000-C000-000000000046}') # => Excel OLE Automation WIN32OLE object.
@@ -2462,19 +2407,13 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
VALUE svr_name;
VALUE host;
VALUE others;
- VALUE opts;
HRESULT hr;
CLSID clsid;
OLECHAR *pBuf;
- OLECHAR *key_buf;
IDispatch *pDispatch;
- IClassFactory2 * pIClassFactory2;
void *p;
- static ID keyword_ids[1];
- VALUE kwargs[1];
-
rb_call_super(0, 0);
- rb_scan_args(argc, argv, "11*:", &svr_name, &host, &others, &opts);
+ rb_scan_args(argc, argv, "11*", &svr_name, &host, &others);
StringValue(svr_name);
if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
@@ -2503,35 +2442,9 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
StringValuePtr(svr_name));
}
- if (!keyword_ids[0]) {
- keyword_ids[0] = rb_intern_const("license");
- }
- rb_get_kwargs(opts, keyword_ids, 0, 1, kwargs);
-
- if (kwargs[0] == Qundef) {
- /* get IDispatch interface */
- hr = CoCreateInstance(
- &clsid,
- NULL,
- CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
- &IID_IDispatch,
- &p
- );
- } else {
- hr = CoGetClassObject(
- &clsid,
- CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
- NULL,
- &IID_IClassFactory2,
- (LPVOID)&pIClassFactory2
- );
- if (hr == S_OK) {
- key_buf = ole_vstr2wc(kwargs[0]);
- hr = pIClassFactory2->lpVtbl->CreateInstanceLic(pIClassFactory2, NULL, NULL, &IID_IDispatch, key_buf, &p);
- SysFreeString(key_buf);
- OLE_RELEASE(pIClassFactory2);
- }
- }
+ /* get IDispatch interface */
+ hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
+ &IID_IDispatch, &p);
pDispatch = p;
if(FAILED(hr)) {
ole_raise(hr, eWIN32OLERuntimeError,
@@ -2565,7 +2478,7 @@ hash2named_arg(VALUE key, VALUE val, VALUE pop)
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
if (RB_TYPE_P(key, T_SYMBOL)) {
- key = rb_sym2str(key);
+ key = rb_sym_to_s(key);
}
/* pNamedArgs[0] is <method name>, so "index + 1" */
@@ -2598,7 +2511,7 @@ static VALUE
ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
{
LCID lcid = cWIN32OLE_lcid;
- struct oledata *pole = NULL;
+ struct oledata *pole;
HRESULT hr;
VALUE cmd;
VALUE paramS;
@@ -2618,6 +2531,7 @@ 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);
@@ -2632,9 +2546,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
rb_raise(rb_eTypeError, "method is wrong type (expected String or Symbol)");
}
if (RB_TYPE_P(cmd, T_SYMBOL)) {
- cmd = rb_sym2str(cmd);
+ cmd = rb_sym_to_s(cmd);
}
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
if(!pole->pDispatch) {
rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
}
@@ -2648,7 +2562,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
&wcmdname, 1, lcid, &DispID);
SysFreeString(wcmdname);
if(FAILED(hr)) {
- return rb_eNoMethodError;
+ ole_raise(hr, rb_eNoMethodError,
+ "unknown property or method: `%s'",
+ StringValuePtr(cmd));
}
}
@@ -2710,11 +2626,8 @@ 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)) {
- 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;
+ Data_Get_Struct(param, struct olevariantdata, pvar);
+ VariantCopy(&op.dp.rgvarg[n], &(pvar->var));
} else {
ole_val2variant(param, &realargs[n]);
V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;
@@ -2850,24 +2763,21 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
static VALUE
fole_invoke(int argc, VALUE *argv, VALUE self)
{
- VALUE v = ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
- if (v == rb_eNoMethodError) {
- return rb_call_super(argc, argv);
- }
- return v;
+ return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
}
static VALUE
ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
{
HRESULT hr;
- struct oledata *pole = NULL;
+ struct oledata *pole;
unsigned int argErr = 0;
EXCEPINFO excepinfo;
VARIANT result;
DISPPARAMS dispParams;
VARIANTARG* realargs = NULL;
- int i, j; VALUE obj = Qnil;
+ int i, j;
+ VALUE obj = Qnil;
VALUE tp, param;
VALUE v;
VARTYPE vt;
@@ -2878,7 +2788,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);
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
dispParams.cArgs = RARRAY_LEN(args);
dispParams.rgvarg = ALLOCA_N(VARIANTARG, dispParams.cArgs);
@@ -2888,7 +2798,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
VariantInit(&realargs[i]);
VariantInit(&dispParams.rgvarg[i]);
tp = rb_ary_entry(types, j);
- vt = (VARTYPE)RB_FIX2INT(tp);
+ vt = (VARTYPE)FIX2INT(tp);
V_VT(&dispParams.rgvarg[i]) = vt;
param = rb_ary_entry(args, j);
if (param == Qnil)
@@ -3023,7 +2933,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
dispParams.rgdispidNamedArgs[0] = DISPID_PROPERTYPUT;
}
- hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, RB_NUM2INT(dispid),
+ hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, NUM2INT(dispid),
&IID_NULL, cWIN32OLE_lcid,
dispkind,
&dispParams, &result,
@@ -3032,7 +2942,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
if (FAILED(hr)) {
v = ole_excepinfo2msg(&excepinfo);
ole_raise(hr, eWIN32OLERuntimeError, "(in OLE method `<dispatch id:%d>': )%s",
- RB_NUM2INT(dispid),
+ NUM2INT(dispid),
StringValuePtr(v));
}
@@ -3121,11 +3031,7 @@ fole_setproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types)
static VALUE
fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self)
{
- VALUE v = ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, TRUE);
- if (v == rb_eNoMethodError) {
- return rb_call_super(argc, argv);
- }
- return v;
+ return ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, TRUE);
}
/*
@@ -3144,11 +3050,7 @@ fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self)
static VALUE
fole_setproperty(int argc, VALUE *argv, VALUE self)
{
- VALUE v = ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, FALSE);
- if (v == rb_eNoMethodError) {
- return rb_call_super(argc, argv);
- }
- return v;
+ return ole_invoke(argc, argv, self, DISPATCH_PROPERTYPUT, FALSE);
}
/*
@@ -3170,17 +3072,13 @@ fole_setproperty(int argc, VALUE *argv, VALUE self)
static VALUE
fole_getproperty_with_bracket(int argc, VALUE *argv, VALUE self)
{
- VALUE v = ole_invoke(argc, argv, self, DISPATCH_PROPERTYGET, TRUE);
- if (v == rb_eNoMethodError) {
- return rb_call_super(argc, argv);
- }
- return v;
+ return ole_invoke(argc, argv, self, DISPATCH_PROPERTYGET, TRUE);
}
static VALUE
ole_propertyput(VALUE self, VALUE property, VALUE value)
{
- struct oledata *pole = NULL;
+ struct oledata *pole;
unsigned argErr;
unsigned int index;
HRESULT hr;
@@ -3202,7 +3100,7 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
VariantInit(&propertyValue[1]);
memset(&excepinfo, 0, sizeof(excepinfo));
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
/* get ID from property name */
pBuf[0] = ole_vstr2wc(property);
@@ -3246,8 +3144,8 @@ ole_propertyput(VALUE self, VALUE property, VALUE value)
static VALUE
fole_free(VALUE self)
{
- struct oledata *pole = NULL;
- pole = oledata_get_struct(self);
+ struct oledata *pole;
+ OLEData_Get_Struct(self, pole);
OLE_FREE(pole->pDispatch);
pole->pDispatch = NULL;
return Qnil;
@@ -3296,7 +3194,7 @@ fole_each(VALUE self)
{
LCID lcid = cWIN32OLE_lcid;
- struct oledata *pole = NULL;
+ struct oledata *pole;
unsigned int argErr;
EXCEPINFO excepinfo;
@@ -3315,7 +3213,7 @@ fole_each(VALUE self)
dispParams.cArgs = 0;
memset(&excepinfo, 0, sizeof(excepinfo));
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DISPID_NEWENUM,
&IID_NULL, lcid,
DISPATCH_METHOD | DISPATCH_PROPERTYGET,
@@ -3324,7 +3222,7 @@ fole_each(VALUE self)
if (FAILED(hr)) {
VariantClear(&result);
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to get IEnum Interface");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to get IEnum Interface");
}
if (V_VT(&result) == VT_UNKNOWN) {
@@ -3340,7 +3238,7 @@ fole_each(VALUE self)
}
if (FAILED(hr) || !pEnum) {
VariantClear(&result);
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to get IEnum Interface");
+ ole_raise(hr, rb_eRuntimeError, "failed to get IEnum Interface");
}
VariantClear(&result);
@@ -3357,32 +3255,30 @@ fole_each(VALUE self)
static VALUE
fole_missing(int argc, VALUE *argv, VALUE self)
{
- VALUE mid, org_mid, sym, v;
+ ID id;
const char* mname;
- long n;
+ size_t n;
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
- mid = org_mid = argv[0];
- sym = rb_check_symbol(&mid);
- if (!NIL_P(sym)) mid = rb_sym2str(sym);
- mname = StringValueCStr(mid);
+ id = rb_to_id(argv[0]);
+ mname = rb_id2name(id);
if(!mname) {
rb_raise(rb_eRuntimeError, "fail: unknown method or property");
}
- n = RSTRING_LEN(mid);
+ n = strlen(mname);
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (n >= LONG_MAX) {
+ rb_raise(rb_eRuntimeError, "too long method or property name");
+ }
+#endif
if(mname[n-1] == '=') {
rb_check_arity(argc, 2, 2);
- argv[0] = rb_enc_associate(rb_str_subseq(mid, 0, n-1), cWIN32OLE_enc);
+ argv[0] = rb_enc_str_new(mname, (long)(n-1), cWIN32OLE_enc);
return ole_propertyput(self, argv[0], argv[1]);
}
else {
- argv[0] = rb_enc_associate(rb_str_dup(mid), cWIN32OLE_enc);
- v = ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
- if (v == rb_eNoMethodError) {
- argv[0] = org_mid;
- return rb_call_super(argc, argv);
- }
- return v;
+ argv[0] = rb_enc_str_new(mname, (long)n, cWIN32OLE_enc);
+ return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
}
}
@@ -3399,7 +3295,7 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo,
-1,
@@ -3409,7 +3305,7 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &i);
OLE_RELEASE(pTypeInfo);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
for (i = 0; i < count; i++) {
@@ -3433,9 +3329,9 @@ ole_methods(VALUE self, int mask)
ITypeInfo *pTypeInfo;
HRESULT hr;
VALUE methods;
- struct oledata *pole = NULL;
+ struct oledata *pole;
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
methods = rb_ary_new();
hr = typeinfo_from_ole(pole, &pTypeInfo);
@@ -3526,15 +3422,15 @@ fole_type(VALUE self)
{
ITypeInfo *pTypeInfo;
HRESULT hr;
- struct oledata *pole = NULL;
+ struct oledata *pole;
LCID lcid = cWIN32OLE_lcid;
VALUE type = Qnil;
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
hr = pole->pDispatch->lpVtbl->GetTypeInfo( pole->pDispatch, 0, lcid, &pTypeInfo );
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
type = ole_type_from_itypeinfo(pTypeInfo);
OLE_RELEASE(pTypeInfo);
@@ -3558,17 +3454,17 @@ fole_type(VALUE self)
static VALUE
fole_typelib(VALUE self)
{
- struct oledata *pole = NULL;
+ struct oledata *pole;
HRESULT hr;
ITypeInfo *pTypeInfo;
LCID lcid = cWIN32OLE_lcid;
VALUE vtlib = Qnil;
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
vtlib = ole_typelib_from_itypeinfo(pTypeInfo);
OLE_RELEASE(pTypeInfo);
@@ -3594,7 +3490,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
HRESULT hr;
OLECHAR *pBuf;
IID iid;
- struct oledata *pole = NULL;
+ struct oledata *pole;
IDispatch *pDispatch;
void *p;
@@ -3607,7 +3503,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
StringValuePtr(str_iid));
}
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
if(!pole->pDispatch) {
rb_raise(rb_eRuntimeError, "failed to get dispatch interface");
}
@@ -3615,7 +3511,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &iid,
&p);
if(FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError,
+ ole_raise(hr, eWIN32OLERuntimeError,
"failed to get interface `%s'",
StringValuePtr(str_iid));
}
@@ -3636,7 +3532,7 @@ fole_query_interface(VALUE self, VALUE str_iid)
static VALUE
fole_respond_to(VALUE self, VALUE method)
{
- struct oledata *pole = NULL;
+ struct oledata *pole;
BSTR wcmdname;
DISPID DispID;
HRESULT hr;
@@ -3644,9 +3540,9 @@ fole_respond_to(VALUE self, VALUE method)
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
if (RB_TYPE_P(method, T_SYMBOL)) {
- method = rb_sym2str(method);
+ method = rb_sym_to_s(method);
}
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
wcmdname = ole_vstr2wc(method);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
&wcmdname, 1, cWIN32OLE_lcid, &DispID);
@@ -3825,7 +3721,7 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
break;
default:
typestr = rb_str_new2("Unknown Type ");
- rb_str_concat(typestr, rb_fix2str(RB_INT2FIX(pTypeDesc->vt), 10));
+ rb_str_concat(typestr, rb_fix2str(INT2FIX(pTypeDesc->vt), 10));
break;
}
if (typedetails != Qnil)
@@ -3849,14 +3745,14 @@ fole_method_help(VALUE self, VALUE cmdname)
{
ITypeInfo *pTypeInfo;
HRESULT hr;
- struct oledata *pole = NULL;
+ struct oledata *pole;
VALUE obj;
SafeStringValue(cmdname);
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
hr = typeinfo_from_ole(pole, &pTypeInfo);
if(FAILED(hr))
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to get ITypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to get ITypeInfo");
obj = create_win32ole_method(pTypeInfo, cmdname);
@@ -3890,13 +3786,13 @@ fole_method_help(VALUE self, VALUE cmdname)
static VALUE
fole_activex_initialize(VALUE self)
{
- struct oledata *pole = NULL;
+ struct oledata *pole;
IPersistMemory *pPersistMemory;
void *p;
HRESULT hr = S_OK;
- pole = oledata_get_struct(self);
+ OLEData_Get_Struct(self, pole);
hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &IID_IPersistMemory, &p);
pPersistMemory = p;
@@ -3920,10 +3816,10 @@ typelib_from_val(VALUE obj, ITypeLib **pTypeLib)
{
LCID lcid = cWIN32OLE_lcid;
HRESULT hr;
- struct oledata *pole = NULL;
+ struct oledata *pole;
unsigned int index;
ITypeInfo *pTypeInfo;
- pole = oledata_get_struct(obj);
+ OLEData_Get_Struct(obj, pole);
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if (FAILED(hr)) {
@@ -3935,51 +3831,22 @@ typelib_from_val(VALUE obj, ITypeLib **pTypeLib)
}
static void
-com_hash_free(void *ptr)
+init_enc2cp(void)
{
- st_table *tbl = ptr;
- st_free_table(tbl);
+ enc2cp_table = st_init_numtable();
}
static void
-com_hash_mark(void *ptr)
-{
- st_table *tbl = ptr;
- rb_mark_hash(tbl);
-}
-
-static size_t
-com_hash_size(const void *ptr)
+free_enc2cp(void)
{
- const st_table *tbl = ptr;
- return st_memsize(tbl);
+ st_free_table(enc2cp_table);
}
-static void
-check_nano_server(void)
-{
- HKEY hsubkey;
- LONG err;
- const char * subkey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Server\\ServerLevels";
- const char * regval = "NanoServer";
-
- err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &hsubkey);
- if (err == ERROR_SUCCESS) {
- err = RegQueryValueEx(hsubkey, regval, NULL, NULL, NULL, NULL);
- if (err == ERROR_SUCCESS) {
- g_running_nano = TRUE;
- }
- RegCloseKey(hsubkey);
- }
-}
-
-
void
Init_win32ole(void)
{
cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT;
g_ole_initialized_init();
- check_nano_server();
com_vtbl.QueryInterface = QueryInterface;
com_vtbl.AddRef = AddRef;
@@ -3996,12 +3863,7 @@ Init_win32ole(void)
message_filter.RetryRejectedCall = mf_RetryRejectedCall;
message_filter.MessagePending = mf_MessagePending;
- enc2cp_hash = TypedData_Wrap_Struct(0, &win32ole_hash_datatype, 0);
- RTYPEDDATA_DATA(enc2cp_hash) = st_init_numtable();
- rb_gc_register_mark_object(enc2cp_hash);
-
- com_hash = TypedData_Wrap_Struct(0, &win32ole_hash_datatype, 0);
- RTYPEDDATA_DATA(com_hash) = st_init_numtable();
+ com_hash = Data_Wrap_Struct(rb_cData, rb_mark_hash, st_free_table, st_init_numtable());
rb_gc_register_mark_object(com_hash);
cWIN32OLE = rb_define_class("WIN32OLE", rb_cObject);
@@ -4083,7 +3945,7 @@ Init_win32ole(void)
* p WIN32OLE::ARGV # => [10, 20, 30]
*
* You can use WIN32OLE_VARIANT object to retrieve the value of reference
- * arguments instead of referring WIN32OLE::ARGV.
+ * arguments instead of refering WIN32OLE::ARGV.
*
*/
rb_define_const(cWIN32OLE, "ARGV", rb_ary_new());
@@ -4091,50 +3953,50 @@ Init_win32ole(void)
/*
* 0: ANSI code page. See WIN32OLE.codepage and WIN32OLE.codepage=.
*/
- rb_define_const(cWIN32OLE, "CP_ACP", RB_INT2FIX(CP_ACP));
+ 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", RB_INT2FIX(CP_OEMCP));
+ rb_define_const(cWIN32OLE, "CP_OEMCP", INT2FIX(CP_OEMCP));
/*
* 2
*/
- rb_define_const(cWIN32OLE, "CP_MACCP", RB_INT2FIX(CP_MACCP));
+ 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", RB_INT2FIX(CP_THREAD_ACP));
+ 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", RB_INT2FIX(CP_SYMBOL));
+ 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", RB_INT2FIX(CP_UTF7));
+ 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", RB_INT2FIX(CP_UTF8));
+ 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", RB_INT2FIX(LOCALE_SYSTEM_DEFAULT));
+ 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", RB_INT2FIX(LOCALE_USER_DEFAULT));
+ rb_define_const(cWIN32OLE, "LOCALE_USER_DEFAULT", INT2FIX(LOCALE_USER_DEFAULT));
Init_win32ole_variant_m();
Init_win32ole_typelib();
@@ -4147,5 +4009,7 @@ Init_win32ole(void)
Init_win32ole_record();
Init_win32ole_error();
+ init_enc2cp();
+ atexit((void (*)(void))free_enc2cp);
ole_init_cp();
}
diff --git a/ext/win32ole/win32ole.h b/ext/win32ole/win32ole.h
index c019930397..880fe86466 100644
--- a/ext/win32ole/win32ole.h
+++ b/ext/win32ole/win32ole.h
@@ -85,13 +85,13 @@
#ifdef HAVE_LONG_LONG
#define I8_2_NUM LL2NUM
#define UI8_2_NUM ULL2NUM
-#define NUM2I8 RB_NUM2LL
-#define NUM2UI8 RB_NUM2ULL
+#define NUM2I8 NUM2LL
+#define NUM2UI8 NUM2ULL
#else
-#define I8_2_NUM RB_INT2NUM
-#define UI8_2_NUM RB_UINT2NUM
-#define NUM2I8 RB_NUM2INT
-#define NUM2UI8 RB_NUM2UINT
+#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
@@ -112,10 +112,16 @@ struct oledata {
IDispatch *pDispatch;
};
+#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");\
+ }\
+}
+
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);
@@ -129,7 +135,7 @@ VALUE ole_wc2vstr(LPWSTR pw, BOOL isfree);
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-BOOL ole_initialized(void);
+BOOL ole_initialized();
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);
diff --git a/ext/win32ole/win32ole_error.c b/ext/win32ole/win32ole_error.c
index 022527617e..f122b2aa1b 100644
--- a/ext/win32ole/win32ole_error.c
+++ b/ext/win32ole/win32ole_error.c
@@ -61,8 +61,7 @@ ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...)
}
void
-Init_win32ole_error(void)
-{
+Init_win32ole_error() {
/*
* Document-class: WIN32OLERuntimeError
*
@@ -80,5 +79,4 @@ Init_win32ole_error(void)
*
*/
eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
- eWIN32OLEQueryInterfaceError = rb_define_class("WIN32OLEQueryInterfaceError", eWIN32OLERuntimeError);
}
diff --git a/ext/win32ole/win32ole_error.h b/ext/win32ole/win32ole_error.h
index 296eb101ad..aa0a42c8c0 100644
--- a/ext/win32ole/win32ole_error.h
+++ b/ext/win32ole/win32ole_error.h
@@ -2,8 +2,7 @@
#define WIN32OLE_ERROR_H 1
VALUE eWIN32OLERuntimeError;
-VALUE eWIN32OLEQueryInterfaceError;
-NORETURN(PRINTF_ARGS(void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...), 3, 4));
-void Init_win32ole_error(void);
+void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...);
+void Init_win32ole_error();
#endif
diff --git a/ext/win32ole/win32ole_event.c b/ext/win32ole/win32ole_event.c
index 899480d7d0..55b884ff1b 100644
--- a/ext/win32ole/win32ole_event.c
+++ b/ext/win32ole/win32ole_event.c
@@ -6,8 +6,6 @@
* <code>WIN32OLE_EVENT</code> objects controls OLE event.
*/
-RUBY_EXTERN void rb_write_error_str(VALUE mesg);
-
typedef struct {
struct IEventSinkVtbl * lpVtbl;
} IEventSink, *PEVENTSINK;
@@ -50,7 +48,7 @@ struct IEventSinkVtbl {
};
typedef struct tagIEVENTSINKOBJ {
- const IEventSinkVtbl *lpVtbl;
+ IEventSinkVtbl *lpVtbl;
DWORD m_cRef;
IID m_iid;
long m_event_id;
@@ -69,23 +67,9 @@ 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,
-};
+static BOOL g_IsEventSinkVtblInitialized = FALSE;
+
+static IEventSinkVtbl vtEventSink;
void EVENTSINK_Destructor(PIEVENTSINKOBJ);
static void ole_val2ptr_variant(VALUE val, VARIANT *var);
@@ -102,8 +86,7 @@ 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 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);
@@ -122,13 +105,6 @@ 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,
@@ -307,9 +283,19 @@ STDMETHODIMP EVENTSINK_GetIDsOfNames(
}
PIEVENTSINKOBJ
-EVENTSINK_Constructor(void)
-{
+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;
@@ -342,19 +328,19 @@ ole_val2ptr_variant(VALUE val, VARIANT *var)
case T_FIXNUM:
switch(V_VT(var)) {
case (VT_UI1 | VT_BYREF) :
- *V_UI1REF(var) = RB_NUM2CHR(val);
+ *V_UI1REF(var) = NUM2CHR(val);
break;
case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)RB_NUM2INT(val);
+ *V_I2REF(var) = (short)NUM2INT(val);
break;
case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = RB_NUM2INT(val);
+ *V_I4REF(var) = NUM2INT(val);
break;
case (VT_R4 | VT_BYREF) :
- *V_R4REF(var) = (float)RB_NUM2INT(val);
+ *V_R4REF(var) = (float)NUM2INT(val);
break;
case (VT_R8 | VT_BYREF) :
- *V_R8REF(var) = RB_NUM2INT(val);
+ *V_R8REF(var) = NUM2INT(val);
break;
default:
break;
@@ -363,10 +349,10 @@ ole_val2ptr_variant(VALUE val, VARIANT *var)
case T_FLOAT:
switch(V_VT(var)) {
case (VT_I2 | VT_BYREF) :
- *V_I2REF(var) = (short)RB_NUM2INT(val);
+ *V_I2REF(var) = (short)NUM2INT(val);
break;
case (VT_I4 | VT_BYREF) :
- *V_I4REF(var) = RB_NUM2INT(val);
+ *V_I4REF(var) = NUM2INT(val);
break;
case (VT_R4 | VT_BYREF) :
*V_R4REF(var) = (float)NUM2DBL(val);
@@ -417,7 +403,7 @@ hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS
for (i = 0; i < len - 1; i++) {
key = WC2VSTR(bstrs[i + 1]);
- val = rb_hash_aref(hash, RB_UINT2NUM(i));
+ val = rb_hash_aref(hash, INT2FIX(i));
if (val == Qnil)
val = rb_hash_aref(hash, key);
if (val == Qnil)
@@ -470,7 +456,7 @@ rescue_callback(VALUE arg)
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_str(error);
+ rb_write_error(StringValuePtr(error));
rb_backtrace();
ruby_finalize();
exit(-1);
@@ -490,7 +476,7 @@ find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
ITypeInfo *pImplTypeInfo;
TYPEATTR *pImplTypeAttr;
- struct oledata *pole = NULL;
+ struct oledata *pole;
unsigned int index;
unsigned int count;
int type;
@@ -500,7 +486,7 @@ find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
BOOL is_found = FALSE;
LCID lcid = cWIN32OLE_lcid;
- pole = oledata_get_struct(ole);
+ OLEData_Get_Struct(ole, pole);
pDispatch = pole->pDispatch;
@@ -714,9 +700,9 @@ find_default_source(VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
TYPEATTR *pTypeAttr;
TYPEATTR *pTypeAttr2 = NULL;
- struct oledata *pole = NULL;
+ struct oledata *pole;
- pole = oledata_get_struct(ole);
+ OLEData_Get_Struct(ole, pole);
pDispatch = pole->pDispatch;
hr = pDispatch->lpVtbl->QueryInterface(pDispatch,
&IID_IProvideClassInfo2,
@@ -865,9 +851,8 @@ ole_delete_event(VALUE ary, VALUE ev)
static void
-oleevent_free(void *ptr)
+ole_event_free(struct oleeventdata *poleev)
{
- struct oleeventdata *poleev = ptr;
if (poleev->pConnectionPoint) {
poleev->pConnectionPoint->lpVtbl->Unadvise(poleev->pConnectionPoint, poleev->dwCookie);
OLE_RELEASE(poleev->pConnectionPoint);
@@ -877,18 +862,12 @@ oleevent_free(void *ptr)
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);
+ obj = Data_Make_Struct(klass,struct oleeventdata,0,ole_event_free,poleev);
poleev->dwCookie = 0;
poleev->pConnectionPoint = NULL;
poleev->event_id = 0;
@@ -901,7 +880,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
{
VALUE ole, itf;
- struct oledata *pole = NULL;
+ struct oledata *pole;
char *pitf;
HRESULT hr;
IID iid;
@@ -935,14 +914,14 @@ ev_advise(int argc, VALUE *argv, VALUE self)
ole_raise(hr, rb_eRuntimeError, "interface not found");
}
- pole = oledata_get_struct(ole);
+ 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, eWIN32OLEQueryInterfaceError,
+ ole_raise(hr, rb_eRuntimeError,
"failed to query IConnectionPointContainer");
}
pContainer = p;
@@ -953,7 +932,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
OLE_RELEASE(pContainer);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to query IConnectionPoint");
+ ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
}
pIEV = EVENTSINK_Constructor();
pIEV->m_iid = iid;
@@ -961,10 +940,10 @@ ev_advise(int argc, VALUE *argv, VALUE self)
(IUnknown*)pIEV,
&dwCookie);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "Advise Error");
+ ole_raise(hr, rb_eRuntimeError, "Advise Error");
}
- TypedData_Get_Struct(self, struct oleeventdata, &oleevent_datatype, poleev);
+ Data_Get_Struct(self, struct oleeventdata, poleev);
pIEV->m_event_id = evs_length();
pIEV->pTypeInfo = pTypeInfo;
poleev->dwCookie = dwCookie;
@@ -997,8 +976,7 @@ fev_initialize(int argc, VALUE *argv, VALUE self)
}
static void
-ole_msg_loop(void)
-{
+ole_msg_loop() {
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
TranslateMessage(&msg);
@@ -1036,7 +1014,7 @@ 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);
+ Data_Get_Struct(self, struct oleeventdata, poleev);
if (poleev->pConnectionPoint == NULL) {
rb_raise(eWIN32OLERuntimeError, "IConnectionPoint not found. You must call advise at first.");
}
@@ -1046,7 +1024,7 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
if (RB_TYPE_P(event, T_SYMBOL)) {
- event = rb_sym2str(event);
+ event = rb_sym_to_s(event);
}
}
data = rb_ary_new3(4, rb_block_proc(), event, args, is_ary_arg);
@@ -1136,7 +1114,7 @@ fev_off_event(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
if (RB_TYPE_P(event, T_SYMBOL)) {
- event = rb_sym2str(event);
+ event = rb_sym_to_s(event);
}
}
events = rb_ivar_get(self, id_events);
@@ -1166,7 +1144,7 @@ static VALUE
fev_unadvise(VALUE self)
{
struct oleeventdata *poleev;
- TypedData_Get_Struct(self, struct oleeventdata, &oleevent_datatype, poleev);
+ Data_Get_Struct(self, struct oleeventdata, poleev);
if (poleev->pConnectionPoint) {
ole_msg_loop();
evs_delete(poleev->event_id);
@@ -1262,7 +1240,7 @@ fev_get_handler(VALUE self)
}
void
-Init_win32ole_event(void)
+Init_win32ole_event()
{
ary_ole_event = rb_ary_new();
rb_gc_register_mark_object(ary_ole_event);
diff --git a/ext/win32ole/win32ole_event.h b/ext/win32ole/win32ole_event.h
index f1a5aa234d..509be05ea9 100644
--- a/ext/win32ole/win32ole_event.h
+++ b/ext/win32ole/win32ole_event.h
@@ -1,6 +1,6 @@
#ifndef WIN32OLE_EVENT_H
#define WIN32OLE_EVENT_H 1
-void Init_win32ole_event(void);
+void Init_win32ole_event();
#endif
diff --git a/ext/win32ole/win32ole_method.c b/ext/win32ole/win32ole_method.c
index 456a45cfc4..672ec5c0e0 100644
--- a/ext/win32ole/win32ole_method.c
+++ b/ext/win32ole/win32ole_method.c
@@ -1,10 +1,9 @@
#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 void olemethod_free(struct olemethoddata *polemethod);
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);
@@ -42,35 +41,14 @@ 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)
+olemethod_free(struct olemethoddata *polemethod)
{
- 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)
{
@@ -83,7 +61,7 @@ ole_method_sub(VALUE self, ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALU
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
@@ -119,7 +97,7 @@ ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
VALUE methods = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
}
ole_methods_sub(0, pTypeInfo, methods, mask);
@@ -148,7 +126,7 @@ olemethod_from_typeinfo(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
}
method = ole_method_sub(self, 0, pTypeInfo, name);
if (method != Qnil) {
@@ -179,7 +157,7 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods,
WORD i;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs; i++) {
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
@@ -225,11 +203,11 @@ 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);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
pmethod->pTypeInfo = pTypeInfo;
OLE_ADDREF(pTypeInfo);
pmethod->pOwnerTypeInfo = pOwnerTypeInfo;
- OLE_ADDREF(pOwnerTypeInfo);
+ if(pOwnerTypeInfo) OLE_ADDREF(pOwnerTypeInfo);
pmethod->index = index;
rb_ivar_set(self, rb_intern("name"), name);
return self;
@@ -240,9 +218,9 @@ folemethod_s_allocate(VALUE klass)
{
struct olemethoddata *pmethod;
VALUE obj;
- obj = TypedData_Make_Struct(klass,
- struct olemethoddata,
- &olemethod_datatype, pmethod);
+ obj = Data_Make_Struct(klass,
+ struct olemethoddata,
+ 0, olemethod_free, pmethod);
pmethod->pTypeInfo = NULL;
pmethod->pOwnerTypeInfo = NULL;
pmethod->index = 0;
@@ -308,7 +286,7 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetFuncDesc");
+ ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -329,7 +307,7 @@ static VALUE
folemethod_return_type(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_return_type(pmethod->pTypeInfo, pmethod->index);
}
@@ -344,7 +322,7 @@ ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index)
if (FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
- vvt = RB_INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
+ vvt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return vvt;
}
@@ -363,7 +341,7 @@ static VALUE
folemethod_return_vtype(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_return_vtype(pmethod->pTypeInfo, pmethod->index);
}
@@ -397,7 +375,7 @@ static VALUE
folemethod_return_type_detail(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_return_type_detail(pmethod->pTypeInfo, pmethod->index);
}
@@ -410,7 +388,7 @@ ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if(FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc");
- invkind = RB_INT2FIX(pFuncDesc->invkind);
+ invkind = INT2FIX(pFuncDesc->invkind);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return invkind;
}
@@ -420,16 +398,16 @@ ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index)
{
VALUE type = rb_str_new2("UNKNOWN");
VALUE invkind = ole_method_invkind(pTypeInfo, method_index);
- if((RB_FIX2INT(invkind) & INVOKE_PROPERTYGET) &&
- (RB_FIX2INT(invkind) & INVOKE_PROPERTYPUT) ) {
+ if((FIX2INT(invkind) & INVOKE_PROPERTYGET) &&
+ (FIX2INT(invkind) & INVOKE_PROPERTYPUT) ) {
type = rb_str_new2("PROPERTY");
- } else if(RB_FIX2INT(invkind) & INVOKE_PROPERTYGET) {
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYGET) {
type = rb_str_new2("PROPERTYGET");
- } else if(RB_FIX2INT(invkind) & INVOKE_PROPERTYPUT) {
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUT) {
type = rb_str_new2("PROPERTYPUT");
- } else if(RB_FIX2INT(invkind) & INVOKE_PROPERTYPUTREF) {
+ } else if(FIX2INT(invkind) & INVOKE_PROPERTYPUTREF) {
type = rb_str_new2("PROPERTYPUTREF");
- } else if(RB_FIX2INT(invkind) & INVOKE_FUNC) {
+ } else if(FIX2INT(invkind) & INVOKE_FUNC) {
type = rb_str_new2("FUNC");
}
return type;
@@ -449,7 +427,7 @@ static VALUE
folemethod_invkind(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_invkind(pmethod->pTypeInfo, pmethod->index);
}
@@ -468,7 +446,7 @@ static VALUE
folemethod_invoke_kind(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_invoke_kind(pmethod->pTypeInfo, pmethod->index);
}
@@ -505,7 +483,7 @@ static VALUE
folemethod_visible(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_visible(pmethod->pTypeInfo, pmethod->index);
}
@@ -587,7 +565,7 @@ static VALUE
folemethod_event(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
if (!pmethod->pOwnerTypeInfo)
return Qfalse;
return ole_method_event(pmethod->pOwnerTypeInfo,
@@ -610,7 +588,7 @@ folemethod_event_interface(VALUE self)
BSTR name;
struct olemethoddata *pmethod;
HRESULT hr;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ 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))
@@ -668,7 +646,7 @@ static VALUE
folemethod_helpstring(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_helpstring(pmethod->pTypeInfo, pmethod->index);
}
@@ -698,7 +676,7 @@ static VALUE
folemethod_helpfile(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_helpfile(pmethod->pTypeInfo, pmethod->index);
}
@@ -712,7 +690,7 @@ ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
&helpcontext, NULL);
if (FAILED(hr))
return Qnil;
- return RB_INT2FIX(helpcontext);
+ return INT2FIX(helpcontext);
}
/*
@@ -728,7 +706,7 @@ static VALUE
folemethod_helpcontext(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_helpcontext(pmethod->pTypeInfo, pmethod->index);
}
@@ -741,7 +719,7 @@ ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return dispid;
- dispid = RB_INT2NUM(pFuncDesc->memid);
+ dispid = INT2NUM(pFuncDesc->memid);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return dispid;
}
@@ -759,7 +737,7 @@ static VALUE
folemethod_dispid(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_dispid(pmethod->pTypeInfo, pmethod->index);
}
@@ -772,7 +750,7 @@ ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return offset_vtbl;
- offset_vtbl = RB_INT2FIX(pFuncDesc->oVft);
+ offset_vtbl = INT2FIX(pFuncDesc->oVft);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return offset_vtbl;
}
@@ -790,7 +768,7 @@ static VALUE
folemethod_offset_vtbl(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_offset_vtbl(pmethod->pTypeInfo, pmethod->index);
}
@@ -803,7 +781,7 @@ ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return size_params;
- size_params = RB_INT2FIX(pFuncDesc->cParams);
+ size_params = INT2FIX(pFuncDesc->cParams);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return size_params;
}
@@ -822,7 +800,7 @@ static VALUE
folemethod_size_params(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_size_params(pmethod->pTypeInfo, pmethod->index);
}
@@ -835,7 +813,7 @@ ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return size_opt_params;
- size_opt_params = RB_INT2FIX(pFuncDesc->cParamsOpt);
+ size_opt_params = INT2FIX(pFuncDesc->cParamsOpt);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return size_opt_params;
}
@@ -853,7 +831,7 @@ static VALUE
folemethod_size_opt_params(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_size_opt_params(pmethod->pTypeInfo, pmethod->index);
}
@@ -906,7 +884,7 @@ static VALUE
folemethod_params(VALUE self)
{
struct olemethoddata *pmethod;
- TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod);
+ Data_Get_Struct(self, struct olemethoddata, pmethod);
return ole_method_params(pmethod->pTypeInfo, pmethod->index);
}
@@ -923,7 +901,7 @@ folemethod_inspect(VALUE self)
return default_inspect(self, "WIN32OLE_METHOD");
}
-void Init_win32ole_method(void)
+void Init_win32ole_method()
{
cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate);
diff --git a/ext/win32ole/win32ole_method.h b/ext/win32ole/win32ole_method.h
index ff2898ebeb..58005dd73f 100644
--- a/ext/win32ole/win32ole_method.h
+++ b/ext/win32ole/win32ole_method.h
@@ -11,6 +11,5 @@ 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);
+void Init_win32ole_method();
#endif
diff --git a/ext/win32ole/win32ole_param.c b/ext/win32ole/win32ole_param.c
index 52905b3e8e..661bd23578 100644
--- a/ext/win32ole/win32ole_param.c
+++ b/ext/win32ole/win32ole_param.c
@@ -8,8 +8,7 @@ struct oleparamdata {
UINT index;
};
-static void oleparam_free(void *ptr);
-static size_t oleparam_size(const void *ptr);
+static void oleparam_free(struct oleparamdata *pole);
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);
@@ -28,32 +27,19 @@ static VALUE ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT ind
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)
+oleparam_free(struct oleparamdata *pole)
{
- 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);
+ Data_Get_Struct(obj, struct oleparamdata, pparam);
pparam->pTypeInfo = pTypeInfo;
OLE_ADDREF(pTypeInfo);
@@ -74,9 +60,9 @@ foleparam_s_allocate(VALUE klass)
{
struct oleparamdata *pparam;
VALUE obj;
- obj = TypedData_Make_Struct(klass,
- struct oleparamdata,
- &oleparam_datatype, pparam);
+ obj = Data_Make_Struct(klass,
+ struct oleparamdata,
+ 0, oleparam_free, pparam);
pparam->pTypeInfo = NULL;
pparam->method_index = 0;
pparam->index = 0;
@@ -111,7 +97,7 @@ oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_inde
rb_raise(rb_eIndexError, "index of param must be in 1..%d", len);
}
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
pparam->pTypeInfo = pTypeInfo;
OLE_ADDREF(pTypeInfo);
pparam->method_index = method_index;
@@ -122,10 +108,10 @@ oleparam_ole_param_from_index(VALUE self, ITypeInfo *pTypeInfo, UINT method_inde
return self;
}
-static VALUE
-oleparam_ole_param(VALUE self, VALUE olemethod, int n)
+static VALUE oleparam_ole_param(VALUE self, VALUE olemethod, int n)
{
- struct olemethoddata *pmethod = olemethod_data_get_struct(olemethod);
+ struct olemethoddata *pmethod;
+ Data_Get_Struct(olemethod, struct olemethoddata, pmethod);
return oleparam_ole_param_from_index(self, pmethod->pTypeInfo, pmethod->index, n);
}
@@ -142,14 +128,13 @@ oleparam_ole_param(VALUE self, VALUE olemethod, int n)
* param = WIN32OLE_PARAM.new(method, 2) # => #<WIN32OLE_PARAM:Overwrite=true>
*
*/
-static VALUE
-foleparam_initialize(VALUE self, VALUE olemethod, VALUE 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 = RB_FIX2INT(n);
+ idx = FIX2INT(n);
return oleparam_ole_param(self, olemethod, idx);
}
@@ -198,7 +183,7 @@ static VALUE
foleparam_ole_type(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_ole_type(pparam->pTypeInfo, pparam->method_index,
pparam->index);
}
@@ -232,7 +217,7 @@ static VALUE
foleparam_ole_type_detail(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_ole_type_detail(pparam->pTypeInfo, pparam->method_index,
pparam->index);
}
@@ -262,11 +247,10 @@ ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT
* param1 = method.params[0]
* puts param1.input? # => true
*/
-static VALUE
-foleparam_input(VALUE self)
+static VALUE foleparam_input(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
pparam->index, PARAMFLAG_FIN);
}
@@ -290,11 +274,10 @@ foleparam_input(VALUE self)
* Headers false
* Processed true
*/
-static VALUE
-foleparam_output(VALUE self)
+static VALUE foleparam_output(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
pparam->index, PARAMFLAG_FOUT);
}
@@ -309,11 +292,10 @@ foleparam_output(VALUE self)
* param1 = method.params[0]
* puts "#{param1.name} #{param1.optional?}" # => Filename true
*/
-static VALUE
-foleparam_optional(VALUE self)
+static VALUE foleparam_optional(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
pparam->index, PARAMFLAG_FOPT);
}
@@ -329,11 +311,10 @@ foleparam_optional(VALUE self)
* param = method.params[0]
* puts "#{param.name} #{param.retval?}" # => name true
*/
-static VALUE
-foleparam_retval(VALUE self)
+static VALUE foleparam_retval(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index,
pparam->index, PARAMFLAG_FRETVAL);
}
@@ -390,11 +371,10 @@ ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
* TextCodepage
* TextVisualLayout
*/
-static VALUE
-foleparam_default(VALUE self)
+static VALUE foleparam_default(VALUE self)
{
struct oleparamdata *pparam;
- TypedData_Get_Struct(self, struct oleparamdata, &oleparam_datatype, pparam);
+ Data_Get_Struct(self, struct oleparamdata, pparam);
return ole_param_default(pparam->pTypeInfo, pparam->method_index,
pparam->index);
}
@@ -420,7 +400,7 @@ foleparam_inspect(VALUE self)
}
void
-Init_win32ole_param(void)
+Init_win32ole_param()
{
cWIN32OLE_PARAM = rb_define_class("WIN32OLE_PARAM", rb_cObject);
rb_define_alloc_func(cWIN32OLE_PARAM, foleparam_s_allocate);
diff --git a/ext/win32ole/win32ole_param.h b/ext/win32ole/win32ole_param.h
index 7e2650cb44..24fcdc0fb2 100644
--- a/ext/win32ole/win32ole_param.h
+++ b/ext/win32ole/win32ole_param.h
@@ -2,7 +2,7 @@
#define WIN32OLE_PARAM_H
VALUE create_win32ole_param(ITypeInfo *pTypeInfo, UINT method_index, UINT index, VALUE name);
-void Init_win32ole_param(void);
+void Init_win32ole_param();
#endif
diff --git a/ext/win32ole/win32ole_record.c b/ext/win32ole/win32ole_record.c
index e8838832a7..b7ce75bbee 100644
--- a/ext/win32ole/win32ole_record.c
+++ b/ext/win32ole/win32ole_record.c
@@ -7,8 +7,7 @@ struct olerecorddata {
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 void olerecord_free(struct olerecorddata *pvar);
static VALUE folerecord_s_allocate(VALUE klass);
static VALUE folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj);
static VALUE folerecord_to_h(VALUE self);
@@ -20,12 +19,6 @@ 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)
{
@@ -68,7 +61,7 @@ hash2olerec(VALUE key, VALUE val, VALUE rec)
HRESULT hr;
if (val != Qnil) {
- TypedData_Get_Struct(rec, struct olerecorddata, &olerecord_datatype, prec);
+ Data_Get_Struct(rec, struct olerecorddata, prec);
pri = prec->pri;
VariantInit(&var);
ole_val2variant(val, &var);
@@ -91,7 +84,7 @@ ole_rec2variant(VALUE rec, VARIANT *var)
IRecordInfo *pri;
HRESULT hr;
VALUE fields;
- TypedData_Get_Struct(rec, struct olerecorddata, &olerecord_datatype, prec);
+ Data_Get_Struct(rec, struct olerecorddata, prec);
pri = prec->pri;
if (pri) {
hr = pri->lpVtbl->GetSize(pri, &size);
@@ -133,7 +126,7 @@ olerecord_set_ivar(VALUE obj, IRecordInfo *pri, void *prec)
void *pdata = NULL;
struct olerecorddata *pvar;
- TypedData_Get_Struct(obj, struct olerecorddata, &olerecord_datatype, pvar);
+ Data_Get_Struct(obj, struct olerecorddata, pvar);
OLE_ADDREF(pri);
OLE_RELEASE(pvar->pri);
pvar->pri = pri;
@@ -213,8 +206,7 @@ create_win32ole_record(IRecordInfo *pri, void *prec)
*/
static void
-olerecord_free(void *ptr) {
- struct olerecorddata *pvar = ptr;
+olerecord_free(struct olerecorddata *pvar) {
OLE_FREE(pvar->pri);
if (pvar->pdata) {
free(pvar->pdata);
@@ -222,30 +214,11 @@ olerecord_free(void *ptr) {
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);
+ obj = Data_Make_Struct(klass, struct olerecorddata, 0, olerecord_free, pvar);
pvar->pri = NULL;
pvar->pdata = NULL;
return obj;
@@ -288,7 +261,7 @@ folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj) {
rb_raise(rb_eArgError, "1st argument should be String or Symbol");
}
if (RB_TYPE_P(typename, T_SYMBOL)) {
- typename = rb_sym2str(typename);
+ typename = rb_sym_to_s(typename);
}
hr = S_OK;
@@ -452,7 +425,7 @@ folerecord_method_missing(int argc, VALUE *argv, VALUE self)
{
VALUE name;
rb_check_arity(argc, 1, 2);
- name = rb_sym2str(argv[0]);
+ name = rb_sym_to_s(argv[0]);
#if SIZEOF_SIZE_T > SIZEOF_LONG
{
@@ -508,7 +481,7 @@ folerecord_ole_instance_variable_get(VALUE self, VALUE name)
}
sname = name;
if (RB_TYPE_P(name, T_SYMBOL)) {
- sname = rb_sym2str(name);
+ sname = rb_sym_to_s(name);
}
return olerecord_ivar_get(self, sname);
}
@@ -547,7 +520,7 @@ folerecord_ole_instance_variable_set(VALUE self, VALUE name, VALUE val)
}
sname = name;
if (RB_TYPE_P(name, T_SYMBOL)) {
- sname = rb_sym2str(name);
+ sname = rb_sym_to_s(name);
}
return olerecord_ivar_set(self, sname, val);
}
@@ -590,7 +563,7 @@ folerecord_inspect(VALUE self)
}
void
-Init_win32ole_record(void)
+Init_win32ole_record()
{
cWIN32OLE_RECORD = rb_define_class("WIN32OLE_RECORD", rb_cObject);
rb_define_alloc_func(cWIN32OLE_RECORD, folerecord_s_allocate);
diff --git a/ext/win32ole/win32ole_record.h b/ext/win32ole/win32ole_record.h
index ea431e91f7..2f84d104cc 100644
--- a/ext/win32ole/win32ole_record.h
+++ b/ext/win32ole/win32ole_record.h
@@ -5,6 +5,6 @@ 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);
+void Init_win32ole_record();
#endif
diff --git a/ext/win32ole/win32ole_type.c b/ext/win32ole/win32ole_type.c
index e6ac402ecf..00db09e191 100644
--- a/ext/win32ole/win32ole_type.c
+++ b/ext/win32ole/win32ole_type.c
@@ -4,8 +4,7 @@ struct oletypedata {
ITypeInfo *pTypeInfo;
};
-static void oletype_free(void *ptr);
-static size_t oletype_size(const void *ptr);
+static void oletype_free(struct oletypedata *poletype);
static VALUE foletype_s_ole_classes(VALUE self, VALUE typelib);
static VALUE foletype_s_typelibs(VALUE self);
static VALUE foletype_s_progids(VALUE self);
@@ -47,12 +46,6 @@ 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
*
@@ -60,23 +53,16 @@ static const rb_data_type_t oletype_datatype = {
*/
static void
-oletype_free(void *ptr)
+oletype_free(struct oletypedata *poletype)
{
- 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);
+ Data_Get_Struct(self, struct oletypedata, ptype);
return ptype->pTypeInfo;
}
@@ -185,10 +171,10 @@ static VALUE
oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name)
{
struct oletypedata *ptype;
- TypedData_Get_Struct(self, struct oletypedata, &oletype_datatype, ptype);
+ Data_Get_Struct(self, struct oletypedata, ptype);
rb_ivar_set(self, rb_intern("name"), name);
ptype->pTypeInfo = pTypeInfo;
- OLE_ADDREF(pTypeInfo);
+ if(pTypeInfo) OLE_ADDREF(pTypeInfo);
return self;
}
@@ -198,7 +184,7 @@ foletype_s_allocate(VALUE klass)
struct oletypedata *poletype;
VALUE obj;
ole_initialize();
- obj = TypedData_Make_Struct(klass,struct oletypedata, &oletype_datatype, poletype);
+ obj = Data_Make_Struct(klass,struct oletypedata,0,oletype_free,poletype);
poletype->pTypeInfo = NULL;
return obj;
}
@@ -468,7 +454,7 @@ ole_type_major_version(ITypeInfo *pTypeInfo)
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- ver = RB_INT2FIX(pTypeAttr->wMajorVerNum);
+ ver = INT2FIX(pTypeAttr->wMajorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
}
@@ -497,7 +483,7 @@ ole_type_minor_version(ITypeInfo *pTypeInfo)
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- ver = RB_INT2FIX(pTypeAttr->wMinorVerNum);
+ ver = INT2FIX(pTypeAttr->wMinorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
}
@@ -526,7 +512,7 @@ ole_type_typekind(ITypeInfo *pTypeInfo)
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
- typekind = RB_INT2FIX(pTypeAttr->typekind);
+ typekind = INT2FIX(pTypeAttr->typekind);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return typekind;
}
@@ -645,7 +631,7 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo)
&helpcontext, NULL);
if(FAILED(hr))
return Qnil;
- return RB_INT2FIX(helpcontext);
+ return INT2FIX(helpcontext);
}
/*
@@ -883,7 +869,7 @@ foletype_inspect(VALUE self)
return default_inspect(self, "WIN32OLE_TYPE");
}
-void Init_win32ole_type(void)
+void Init_win32ole_type()
{
cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
diff --git a/ext/win32ole/win32ole_type.h b/ext/win32ole/win32ole_type.h
index a26bf3e043..086d36a241 100644
--- a/ext/win32ole/win32ole_type.h
+++ b/ext/win32ole/win32ole_type.h
@@ -4,5 +4,5 @@ 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);
+void Init_win32ole_type();
#endif
diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c
index 35376c644b..f5ecd4c05c 100644
--- a/ext/win32ole/win32ole_typelib.c
+++ b/ext/win32ole/win32ole_typelib.c
@@ -9,8 +9,7 @@ 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 void oletypelib_free(struct oletypelibdata *poletypelib);
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);
@@ -31,12 +30,6 @@ 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)
{
@@ -106,7 +99,7 @@ ITypeLib *
itypelib(VALUE self)
{
struct oletypelibdata *ptlib;
- TypedData_Get_Struct(self, struct oletypelibdata, &oletypelib_datatype, ptlib);
+ Data_Get_Struct(self, struct oletypelibdata, ptlib);
return ptlib->pTypeLib;
}
@@ -189,32 +182,25 @@ static VALUE
oletypelib_set_member(VALUE self, ITypeLib *pTypeLib)
{
struct oletypelibdata *ptlib;
- TypedData_Get_Struct(self, struct oletypelibdata, &oletypelib_datatype, ptlib);
+ Data_Get_Struct(self, struct oletypelibdata, ptlib);
ptlib->pTypeLib = pTypeLib;
return self;
}
static void
-oletypelib_free(void *ptr)
+oletypelib_free(struct oletypelibdata *poletypelib)
{
- 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);
+ obj = Data_Make_Struct(klass, struct oletypelibdata, 0, oletypelib_free, poletypelib);
poletypelib->pTypeLib = NULL;
return obj;
}
@@ -399,7 +385,9 @@ foletypelib_initialize(VALUE self, VALUE args)
HRESULT hr = S_OK;
len = RARRAY_LEN(args);
- rb_check_arity(len, 1, 3);
+ if (len < 1 || len > 3) {
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..3)", len);
+ }
typelib = rb_ary_entry(args, 0);
@@ -539,7 +527,7 @@ foletypelib_major_version(VALUE self)
pTypeLib = itypelib(self);
oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- major = RB_INT2NUM(pTLibAttr->wMajorVerNum);
+ major = INT2NUM(pTLibAttr->wMajorVerNum);
pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
return major;
}
@@ -561,7 +549,7 @@ foletypelib_minor_version(VALUE self)
ITypeLib *pTypeLib;
pTypeLib = itypelib(self);
oletypelib_get_libattr(pTypeLib, &pTLibAttr);
- minor = RB_INT2NUM(pTLibAttr->wMinorVerNum);
+ minor = INT2NUM(pTLibAttr->wMinorVerNum);
pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr);
return minor;
}
@@ -823,7 +811,7 @@ foletypelib_inspect(VALUE self)
}
void
-Init_win32ole_typelib(void)
+Init_win32ole_typelib()
{
cWIN32OLE_TYPELIB = rb_define_class("WIN32OLE_TYPELIB", rb_cObject);
rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0);
diff --git a/ext/win32ole/win32ole_typelib.h b/ext/win32ole/win32ole_typelib.h
index 9fc117fcb4..160ed61743 100644
--- a/ext/win32ole/win32ole_typelib.h
+++ b/ext/win32ole/win32ole_typelib.h
@@ -3,7 +3,7 @@
VALUE cWIN32OLE_TYPELIB;
-void Init_win32ole_typelib(void);
+void Init_win32ole_typelib();
ITypeLib * itypelib(VALUE self);
VALUE typelib_file(VALUE ole);
VALUE create_win32ole_typelib(ITypeLib *pTypeLib);
diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
index 3dc9972ee7..85f3341f98 100644
--- a/ext/win32ole/win32ole_variable.c
+++ b/ext/win32ole/win32ole_variable.c
@@ -5,8 +5,7 @@ struct olevariabledata {
UINT index;
};
-static void olevariable_free(void *ptr);
-static size_t olevariable_size(const void *ptr);
+static void olevariable_free(struct olevariabledata *polevar);
static VALUE folevariable_name(VALUE self);
static VALUE ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index);
static VALUE folevariable_ole_type(VALUE self);
@@ -22,26 +21,13 @@ 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)
+olevariable_free(struct olevariabledata *polevar)
{
- 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
*
@@ -52,8 +38,8 @@ 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);
+ VALUE obj = Data_Make_Struct(cWIN32OLE_VARIABLE, struct olevariabledata,
+ 0,olevariable_free,pvar);
pvar->pTypeInfo = pTypeInfo;
OLE_ADDREF(pTypeInfo);
pvar->index = index;
@@ -125,7 +111,7 @@ static VALUE
folevariable_ole_type(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_ole_type(pvar->pTypeInfo, pvar->index);
}
@@ -159,7 +145,7 @@ static VALUE
folevariable_ole_type_detail(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_ole_type_detail(pvar->pTypeInfo, pvar->index);
}
@@ -203,7 +189,7 @@ static VALUE
folevariable_value(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_value(pvar->pTypeInfo, pvar->index);
}
@@ -249,7 +235,7 @@ static VALUE
folevariable_visible(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_visible(pvar->pTypeInfo, pvar->index);
}
@@ -305,7 +291,7 @@ static VALUE
folevariable_variable_kind(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_kind(pvar->pTypeInfo, pvar->index);
}
@@ -319,7 +305,7 @@ ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index)
if (FAILED(hr))
return kind;
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
- kind = RB_INT2FIX(pVarDesc->varkind);
+ kind = INT2FIX(pVarDesc->varkind);
return kind;
}
@@ -345,7 +331,7 @@ static VALUE
folevariable_varkind(VALUE self)
{
struct olevariabledata *pvar;
- TypedData_Get_Struct(self, struct olevariabledata, &olevariable_datatype, pvar);
+ Data_Get_Struct(self, struct olevariabledata, pvar);
return ole_variable_varkind(pvar->pTypeInfo, pvar->index);
}
@@ -365,7 +351,7 @@ folevariable_inspect(VALUE self)
return make_inspect("WIN32OLE_VARIABLE", detail);
}
-void Init_win32ole_variable(void)
+void Init_win32ole_variable()
{
cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
diff --git a/ext/win32ole/win32ole_variable.h b/ext/win32ole/win32ole_variable.h
index 704dc13508..dbb27acf9b 100644
--- a/ext/win32ole/win32ole_variable.h
+++ b/ext/win32ole/win32ole_variable.h
@@ -3,6 +3,6 @@
VALUE cWIN32OLE_VARIABLE;
VALUE create_win32ole_variable(ITypeInfo *pTypeInfo, UINT index, VALUE name);
-void Init_win32ole_variable(void);
+void Init_win32ole_variable();
#endif
diff --git a/ext/win32ole/win32ole_variant.c b/ext/win32ole/win32ole_variant.c
index eb0a463f93..b0cc5ee5df 100644
--- a/ext/win32ole/win32ole_variant.c
+++ b/ext/win32ole/win32ole_variant.c
@@ -1,12 +1,6 @@
#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 olevariant_free(struct olevariantdata *pvar);
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);
@@ -23,27 +17,14 @@ 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)
+olevariant_free(struct olevariantdata *pvar)
{
- 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)
{
@@ -155,12 +136,12 @@ ole_val2variant_err(VALUE val, VARIANT *var)
if (rb_obj_is_kind_of(v, cWIN32OLE_VARIANT)) {
v = folevariant_value(v);
}
- if (!(FIXNUM_P(v) || RB_TYPE_P(v, T_BIGNUM) || v == Qnil)) {
+ 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) = RB_NUM2LONG(val);
+ V_ERROR(var) = NUM2LONG(val);
} else {
V_ERROR(var) = 0;
}
@@ -259,7 +240,7 @@ folevariant_s_allocate(VALUE klass)
struct olevariantdata *pvar;
VALUE obj;
ole_initialize();
- obj = TypedData_Make_Struct(klass, struct olevariantdata, &olevariant_datatype, pvar);
+ obj = Data_Make_Struct(klass,struct olevariantdata,0,olevariant_free,pvar);
VariantInit(&(pvar->var));
VariantInit(&(pvar->realvar));
return obj;
@@ -294,12 +275,12 @@ folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt)
ole_initialize();
- vt = RB_NUM2UINT(vvt);
+ 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);
+ Data_Get_Struct(obj, struct olevariantdata, pvar);
dim = RARRAY_LEN(elems);
psab = ALLOC_N(SAFEARRAYBOUND, dim);
@@ -309,7 +290,7 @@ folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt)
}
for (i = 0; i < dim; i++) {
- psab[i].cElements = RB_FIX2INT(rb_ary_entry(elems, i));
+ psab[i].cElements = FIX2INT(rb_ary_entry(elems, i));
psab[i].lLbound = 0;
}
@@ -409,18 +390,20 @@ folevariant_initialize(VALUE self, VALUE args)
struct olevariantdata *pvar;
len = RARRAY_LEN(args);
- rb_check_arity(len, 1, 3);
+ 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);
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(self, struct olevariantdata, pvar);
if (len == 1) {
ole_val2variant(val, &(pvar->var));
} else {
vvt = rb_ary_entry(args, 1);
- vt = RB_NUM2INT(vvt);
+ vt = NUM2INT(vvt);
if ((vt & VT_TYPEMASK) == VT_RECORD) {
rb_raise(rb_eArgError, "not supported VT_RECORD WIN32OLE_VARIANT object");
}
@@ -435,7 +418,7 @@ get_locked_safe_array(VALUE val)
struct olevariantdata *pvar;
SAFEARRAY *psa = NULL;
HRESULT hr;
- TypedData_Get_Struct(val, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(val, struct olevariantdata, pvar);
if (!(V_VT(&(pvar->var)) & VT_ARRAY)) {
rb_raise(rb_eTypeError, "variant type is not VT_ARRAY.");
}
@@ -465,7 +448,7 @@ ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa)
rb_raise(rb_eRuntimeError, "failed to allocate memory for indices");
}
for (i = 0; i < dim; i++) {
- pid[i] = RB_NUM2INT(ary[i]);
+ pid[i] = NUM2INT(ary[i]);
}
return pid;
}
@@ -489,9 +472,9 @@ unlock_safe_array(SAFEARRAY *psa)
* 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.)
+ * 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
@@ -510,7 +493,7 @@ folevariant_ary_aref(int argc, VALUE *argv, VALUE self)
LONG *pid;
HRESULT hr;
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(self, struct olevariantdata, pvar);
if (!V_ISARRAY(&(pvar->var))) {
rb_raise(eWIN32OLERuntimeError,
"`[]' is not available for this variant type object");
@@ -544,9 +527,9 @@ folevariant_ary_aref(int argc, VALUE *argv, VALUE self)
* 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.)
+ * 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
@@ -567,7 +550,7 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
HRESULT hr;
VOID *p = NULL;
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(self, struct olevariantdata, pvar);
if (!V_ISARRAY(&(pvar->var))) {
rb_raise(eWIN32OLERuntimeError,
"`[]' is not available for this variant type object");
@@ -602,7 +585,7 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
*
* Returns Ruby object value from OLE variant.
* obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
- * obj.value # => "1" (not Integer object, but String object "1")
+ * obj.value # => "1" (not Fixnum object, but String object "1")
*
*/
static VALUE
@@ -613,7 +596,7 @@ folevariant_value(VALUE self)
VARTYPE vt;
int dim;
SAFEARRAY *psa;
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(self, struct olevariantdata, pvar);
val = ole_variant2val(&(pvar->var));
vt = V_VT(&(pvar->var));
@@ -648,8 +631,8 @@ static VALUE
folevariant_vartype(VALUE self)
{
struct olevariantdata *pvar;
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
- return RB_INT2FIX(V_VT(&pvar->var));
+ Data_Get_Struct(self, struct olevariantdata, pvar);
+ return INT2FIX(V_VT(&pvar->var));
}
/*
@@ -659,7 +642,7 @@ folevariant_vartype(VALUE self)
* 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.
- * This method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY).
+ * 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
@@ -671,7 +654,7 @@ folevariant_set_value(VALUE self, VALUE val)
{
struct olevariantdata *pvar;
VARTYPE vt;
- TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
+ Data_Get_Struct(self, struct olevariantdata, 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,
@@ -682,15 +665,7 @@ folevariant_set_value(VALUE self, VALUE val)
}
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)
+Init_win32ole_variant()
{
cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
@@ -706,19 +681,19 @@ Init_win32ole_variant(void)
* represents VT_EMPTY OLE object.
*/
rb_define_const(cWIN32OLE_VARIANT, "Empty",
- rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, RB_INT2FIX(VT_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, RB_INT2FIX(VT_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, RB_INT2FIX(VT_DISPATCH)));
+ rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, Qnil, INT2FIX(VT_DISPATCH)));
/*
* represents VT_ERROR variant with DISP_E_PARAMNOTFOUND.
@@ -728,5 +703,5 @@ Init_win32ole_variant(void)
* 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), RB_INT2FIX(VT_ERROR)));
+ 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
index efe7ea8bef..500a273a4f 100644
--- a/ext/win32ole/win32ole_variant.h
+++ b/ext/win32ole/win32ole_variant.h
@@ -1,9 +1,13 @@
#ifndef WIN32OLE_VARIANT_H
#define WIN32OLE_VARIANT_H 1
+struct olevariantdata {
+ VARIANT realvar;
+ VARIANT var;
+};
+
VALUE cWIN32OLE_VARIANT;
-void ole_variant2variant(VALUE val, VARIANT *var);
-void Init_win32ole_variant(void);
+void Init_win32ole_variant();
#endif
diff --git a/ext/win32ole/win32ole_variant_m.c b/ext/win32ole/win32ole_variant_m.c
index 4d76fdc790..ff05c1d11b 100644
--- a/ext/win32ole/win32ole_variant_m.c
+++ b/ext/win32ole/win32ole_variant_m.c
@@ -1,7 +1,6 @@
#include "win32ole.h"
-void Init_win32ole_variant_m(void)
-{
+void Init_win32ole_variant_m() {
/*
* Document-module: WIN32OLE::VARIANT
*
@@ -17,133 +16,133 @@ void Init_win32ole_variant_m(void)
/*
* represents VT_EMPTY type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", RB_INT2FIX(VT_EMPTY));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", INT2FIX(VT_EMPTY));
/*
* represents VT_NULL type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", RB_INT2FIX(VT_NULL));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", INT2FIX(VT_NULL));
/*
* represents VT_I2 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_I2", RB_INT2FIX(VT_I2));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I2", INT2FIX(VT_I2));
/*
* represents VT_I4 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_I4", RB_INT2FIX(VT_I4));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I4", INT2FIX(VT_I4));
/*
* represents VT_R4 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_R4", RB_INT2FIX(VT_R4));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R4", INT2FIX(VT_R4));
/*
* represents VT_R8 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_R8", RB_INT2FIX(VT_R8));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_R8", INT2FIX(VT_R8));
/*
* represents VT_CY type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_CY", RB_INT2FIX(VT_CY));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_CY", INT2FIX(VT_CY));
/*
* represents VT_DATE type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", RB_INT2FIX(VT_DATE));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", INT2FIX(VT_DATE));
/*
* represents VT_BSTR type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", RB_INT2FIX(VT_BSTR));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", INT2FIX(VT_BSTR));
/*
* represents VT_USERDEFINED type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", RB_INT2FIX(VT_USERDEFINED));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", INT2FIX(VT_USERDEFINED));
/*
* represents VT_PTR type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", RB_INT2FIX(VT_PTR));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", INT2FIX(VT_PTR));
/*
* represents VT_DISPATCH type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", RB_INT2FIX(VT_DISPATCH));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", INT2FIX(VT_DISPATCH));
/*
* represents VT_ERROR type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", RB_INT2FIX(VT_ERROR));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", INT2FIX(VT_ERROR));
/*
* represents VT_BOOL type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", RB_INT2FIX(VT_BOOL));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", INT2FIX(VT_BOOL));
/*
* represents VT_VARIANT type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", RB_INT2FIX(VT_VARIANT));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", INT2FIX(VT_VARIANT));
/*
* represents VT_UNKNOWN type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", RB_INT2FIX(VT_UNKNOWN));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", INT2FIX(VT_UNKNOWN));
/*
* represents VT_I1 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_I1", RB_INT2FIX(VT_I1));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I1", INT2FIX(VT_I1));
/*
* represents VT_UI1 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", RB_INT2FIX(VT_UI1));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", INT2FIX(VT_UI1));
/*
* represents VT_UI2 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", RB_INT2FIX(VT_UI2));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", INT2FIX(VT_UI2));
/*
* represents VT_UI4 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", RB_INT2FIX(VT_UI4));
+ 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", RB_INT2FIX(VT_I8));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_I8", INT2FIX(VT_I8));
/*
* represents VT_UI8 type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", RB_INT2FIX(VT_UI8));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", INT2FIX(VT_UI8));
#endif
/*
* represents VT_INT type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_INT", RB_INT2FIX(VT_INT));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_INT", INT2FIX(VT_INT));
/*
* represents VT_UINT type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", RB_INT2FIX(VT_UINT));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", INT2FIX(VT_UINT));
/*
* represents VT_ARRAY type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", RB_INT2FIX(VT_ARRAY));
+ rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", INT2FIX(VT_ARRAY));
/*
* represents VT_BYREF type constant.
*/
- rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", RB_INT2FIX(VT_BYREF));
+ 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
index afbef30218..56dabc1276 100644
--- a/ext/win32ole/win32ole_variant_m.h
+++ b/ext/win32ole/win32ole_variant_m.h
@@ -2,6 +2,6 @@
#define WIN32OLE_VARIANT_M_H 1
VALUE mWIN32OLE_VARIANT;
-void Init_win32ole_variant_m(void);
+void Init_win32ole_variant_m();
#endif
diff --git a/ext/zlib/depend b/ext/zlib/depend
index bfba309dae..9d47df2a8d 100644
--- a/ext/zlib/depend
+++ b/ext/zlib/depend
@@ -1,18 +1,5 @@
-# AUTOGENERATED DEPENDENCIES START
-zlib.o: $(RUBY_EXTCONF_H)
-zlib.o: $(arch_hdrdir)/ruby/config.h
-zlib.o: $(hdrdir)/ruby/backward.h
-zlib.o: $(hdrdir)/ruby/defines.h
-zlib.o: $(hdrdir)/ruby/encoding.h
-zlib.o: $(hdrdir)/ruby/intern.h
-zlib.o: $(hdrdir)/ruby/io.h
-zlib.o: $(hdrdir)/ruby/missing.h
-zlib.o: $(hdrdir)/ruby/onigmo.h
-zlib.o: $(hdrdir)/ruby/oniguruma.h
-zlib.o: $(hdrdir)/ruby/ruby.h
-zlib.o: $(hdrdir)/ruby/st.h
-zlib.o: $(hdrdir)/ruby/subst.h
-zlib.o: $(hdrdir)/ruby/thread.h
-zlib.o: $(top_srcdir)/include/ruby.h
-zlib.o: zlib.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h \
+ $(hdrdir)/ruby/thread.h
diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb
index fd2f168522..b4348ceca7 100644
--- a/ext/zlib/extconf.rb
+++ b/ext/zlib/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# extconf.rb
#
@@ -13,66 +12,7 @@ dir_config 'zlib'
if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and
have_header('zlib.h') then
- have_zlib = true
-else
- unless File.directory?(zsrc = "#{$srcdir}/zlib")
- dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}}
- dirs.delete_if {|x| !File.directory?(x)}
- zsrc = dirs.max_by {|x| x.scan(/\d+/).map(&:to_i)}
- end
- if zsrc
- addconf = [
- "ZSRC = $(srcdir)/#{File.basename(zsrc)}\n",
- "all:\n",
- ]
- $INCFLAGS << " -I$(ZSRC)"
- if $mswin or $mingw
- dll = "zlib1.dll"
- $extso << dll
- $cleanfiles << "$(topdir)/#{dll}" << "$(ZIMPLIB)"
- zmk = "\t$(MAKE) -f $(ZMKFILE) TOP=$(ZSRC)"
- if $nmake
- zmkfile = "$(ZSRC)/win32/Makefile.msc"
- m = "#{zsrc}/win32/Makefile.msc"
- else
- zmkfile = "$(ZSRC)/win32/Makefile.gcc"
- m = "#{zsrc}/win32/Makefile.gcc"
- zmk += " PREFIX="
- zmk << CONFIG['CC'][/(.*-)gcc([^\/]*)\z/, 1]
- zmk << " CC=$(CC)" if $2
- end
- m = File.read(m)
- zimplib = m[/^IMPLIB[ \t]*=[ \t]*(\S+)/, 1]
- $LOCAL_LIBS << " " << zimplib
- unless $nmake or /^TOP[ \t]/ =~ m
- m.gsub!(/win32\/zlib\.def/, '$(TOP)/\&')
- m.gsub!(/^(\t.*[ \t])(\S+\.rc)/, '\1-I$(<D) $<')
- m = "TOP = .\n""VPATH=$(TOP)\n" + m
- zmkfile = File.basename(zmkfile)
- File.rename(zmkfile, zmkfile+".orig") if File.exist?(zmkfile)
- File.write(zmkfile, m)
- end
- addconf.push(
- "ZMKFILE = #{zmkfile}\n",
- "ZIMPLIB = #{zimplib}\n",
- "$(TARGET_SO): $(ZIMPLIB)\n",
- "$(ZIMPLIB):\n",
- "#{zmk} $@\n",
- "install-so: $(topdir)/#{dll}",
- "$(topdir)/#{dll}: $(ZIMPLIB)\n",
- "\t$(Q) $(COPY) #{dll} $(@D)\n",
- "clean: clean-zsrc\n",
- "clean-zsrc:\n",
- "#{zmk} clean\n",
- )
- end
- Logging.message "using zlib in #{zsrc}\n"
- $defs << "-DHAVE_ZLIB_H"
- have_zlib = true
- end
-end
-if have_zlib
defines = []
Logging::message 'checking for kind of operating system... '
@@ -80,6 +20,8 @@ if have_zlib
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'
@@ -94,6 +36,7 @@ if have_zlib
'OS_VMS' => 'VMS',
'OS_UNIX' => 'Unix',
'OS_ATARI' => 'Atari',
+ 'OS_OS2' => 'OS/2',
'OS_MACOS' => 'MacOS',
'OS_TOPS20' => 'TOPS20',
'OS_WIN32' => 'Win32',
@@ -112,21 +55,10 @@ if have_zlib
$defs.concat(defines.collect{|d|' -D'+d})
- if zsrc
- $defs << "-DHAVE_CRC32_COMBINE"
- $defs << "-DHAVE_ADLER32_COMBINE"
- $defs << "-DHAVE_TYPE_Z_CRC_T"
- else
- have_func('crc32_combine', 'zlib.h')
- have_func('adler32_combine', 'zlib.h')
- have_type('z_crc_t', 'zlib.h')
- end
+ have_func('crc32_combine', 'zlib.h')
+ have_func('adler32_combine', 'zlib.h')
+ have_type('z_crc_t', 'zlib.h')
- create_makefile('zlib') {|conf|
- if zsrc
- conf.concat addconf if addconf
- end
- conf
- }
+ create_makefile('zlib')
end
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 4cae484937..af45b6f884 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -52,6 +52,8 @@ max_uint(long n)
#define MAX_UINT(n) (uInt)(n)
#endif
+#define sizeof(x) ((int)sizeof(x))
+
static ID id_dictionaries;
/*--------- Prototypes --------*/
@@ -72,7 +74,6 @@ struct zstream_run_args;
static void zstream_init(struct zstream*, const struct zstream_funcs*);
static void zstream_expand_buffer(struct zstream*);
static void zstream_expand_buffer_into(struct zstream*, unsigned long);
-static int zstream_expand_buffer_non_stream(struct zstream *z);
static void zstream_append_buffer(struct zstream*, const Bytef*, long);
static VALUE zstream_detach_buffer(struct zstream*);
static VALUE zstream_shift_buffer(struct zstream*, long);
@@ -87,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(void*);
-static void zstream_free(void*);
+static void zstream_mark(struct zstream*);
+static void zstream_free(struct zstream*);
static VALUE zstream_new(VALUE, const struct zstream_funcs*);
static struct zstream *get_zstream(VALUE);
static void zstream_finalize(struct zstream*);
@@ -133,8 +134,8 @@ static VALUE rb_inflate_set_dictionary(VALUE, VALUE);
#if GZIP_SUPPORT
struct gzfile;
-static void gzfile_mark(void*);
-static void gzfile_free(void*);
+static void gzfile_mark(struct gzfile*);
+static void gzfile_free(struct gzfile*);
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);
@@ -197,7 +198,7 @@ static VALUE rb_gzwriter_s_allocate(VALUE);
static VALUE rb_gzwriter_s_open(int, VALUE*, VALUE);
static VALUE rb_gzwriter_initialize(int, VALUE*, VALUE);
static VALUE rb_gzwriter_flush(int, VALUE*, VALUE);
-static VALUE rb_gzwriter_write(int, VALUE*, VALUE);
+static VALUE rb_gzwriter_write(VALUE, VALUE);
static VALUE rb_gzwriter_putc(VALUE, VALUE);
static VALUE rb_gzreader_s_allocate(VALUE);
@@ -386,7 +387,10 @@ checksum_long(uLong (*func)(uLong, const Bytef*, uInt), uLong sum, const Bytef *
#endif
static VALUE
-do_checksum(int argc, VALUE *argv, uLong (*func)(uLong, const Bytef*, uInt))
+do_checksum(argc, argv, func)
+ int argc;
+ VALUE *argv;
+ uLong (*func)(uLong, const Bytef*, uInt);
{
VALUE str, vsum;
unsigned long sum;
@@ -451,7 +455,7 @@ rb_zlib_adler32(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2)
{
- return ULONG2NUM(
+ return ULONG2NUM(
adler32_combine(NUM2ULONG(adler1), NUM2ULONG(adler2), NUM2LONG(len2)));
}
#else
@@ -461,7 +465,7 @@ rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2)
/*
* Document-method: Zlib.crc32
*
- * call-seq: Zlib.crc32(string, crc)
+ * call-seq: Zlib.crc32(string, adler)
*
* 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
@@ -489,7 +493,7 @@ rb_zlib_crc32(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_zlib_crc32_combine(VALUE klass, VALUE crc1, VALUE crc2, VALUE len2)
{
- return ULONG2NUM(
+ return ULONG2NUM(
crc32_combine(NUM2ULONG(crc1), NUM2ULONG(crc2), NUM2LONG(len2)));
}
#else
@@ -528,6 +532,7 @@ rb_zlib_crc_table(VALUE obj)
struct zstream {
unsigned long flags;
VALUE buf;
+ long buf_filled;
VALUE input;
z_stream stream;
const struct zstream_funcs {
@@ -550,7 +555,6 @@ struct zstream {
#define ZSTREAM_IS_FINISHED(z) ((z)->flags & ZSTREAM_FLAG_FINISHED)
#define ZSTREAM_IS_CLOSING(z) ((z)->flags & ZSTREAM_FLAG_CLOSING)
#define ZSTREAM_IS_GZFILE(z) ((z)->flags & ZSTREAM_FLAG_GZFILE)
-#define ZSTREAM_BUF_FILLED(z) (NIL_P((z)->buf) ? 0 : RSTRING_LEN((z)->buf))
#define ZSTREAM_EXPAND_BUFFER_OK 0
@@ -600,6 +604,7 @@ zstream_init(struct zstream *z, const struct zstream_funcs *func)
{
z->flags = 0;
z->buf = Qnil;
+ z->buf_filled = 0;
z->input = Qnil;
z->stream.zalloc = zlib_mem_alloc;
z->stream.zfree = zlib_mem_free;
@@ -624,11 +629,11 @@ zstream_expand_buffer(struct zstream *z)
}
if (!ZSTREAM_IS_GZFILE(z) && rb_block_given_p()) {
- long buf_filled = ZSTREAM_BUF_FILLED(z);
- if (buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ if (z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
int state = 0;
VALUE self = (VALUE)z->stream.opaque;
+ rb_str_resize(z->buf, z->buf_filled);
rb_obj_reveal(z->buf, rb_cString);
OBJ_INFECT(z->buf, self);
@@ -644,11 +649,23 @@ zstream_expand_buffer(struct zstream *z)
}
else {
zstream_expand_buffer_into(z,
- ZSTREAM_AVAIL_OUT_STEP_MAX - buf_filled);
+ ZSTREAM_AVAIL_OUT_STEP_MAX - z->buf_filled);
}
}
else {
- zstream_expand_buffer_non_stream(z);
+ if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
+ }
+ else {
+ long inc = z->buf_filled / 2;
+ if (inc < ZSTREAM_AVAIL_OUT_STEP_MIN) {
+ inc = ZSTREAM_AVAIL_OUT_STEP_MIN;
+ }
+ rb_str_resize(z->buf, z->buf_filled + inc);
+ z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
+ (int)inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
+ }
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
}
}
@@ -658,14 +675,15 @@ zstream_expand_buffer_into(struct zstream *z, unsigned long size)
if (NIL_P(z->buf)) {
/* I uses rb_str_new here not rb_str_buf_new because
rb_str_buf_new makes a zero-length string. */
- z->buf = rb_str_buf_new(size);
+ z->buf = rb_str_new(0, size);
+ z->buf_filled = 0;
z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
z->stream.avail_out = MAX_UINT(size);
rb_obj_hide(z->buf);
}
else if (z->stream.avail_out != size) {
- rb_str_modify_expand(z->buf, size);
- z->stream.next_out = (Bytef*)RSTRING_END(z->buf);
+ rb_str_resize(z->buf, z->buf_filled + size);
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
z->stream.avail_out = MAX_UINT(size);
}
}
@@ -682,24 +700,34 @@ zstream_expand_buffer_protect(void *ptr)
}
static int
-zstream_expand_buffer_non_stream(struct zstream *z)
+zstream_expand_buffer_without_gvl(struct zstream *z)
{
- long inc, len = ZSTREAM_BUF_FILLED(z);
+ char * new_str;
+ long inc, len;
- if (rb_str_capacity(z->buf) - len >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
+ if (RSTRING_LEN(z->buf) - z->buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
z->stream.avail_out = ZSTREAM_AVAIL_OUT_STEP_MAX;
}
else {
- inc = len / 2;
+ inc = z->buf_filled / 2;
if (inc < ZSTREAM_AVAIL_OUT_STEP_MIN) {
inc = ZSTREAM_AVAIL_OUT_STEP_MIN;
}
- rb_str_modify_expand(z->buf, inc);
+ len = z->buf_filled + inc;
+
+ new_str = ruby_xrealloc(RSTRING(z->buf)->as.heap.ptr, len + 1);
+
+ /* from rb_str_resize */
+ RSTRING(z->buf)->as.heap.ptr = new_str;
+ RSTRING(z->buf)->as.heap.ptr[len] = '\0'; /* sentinel */
+ RSTRING(z->buf)->as.heap.len =
+ RSTRING(z->buf)->as.heap.aux.capa = len;
+
z->stream.avail_out = (inc < ZSTREAM_AVAIL_OUT_STEP_MAX) ?
(int)inc : ZSTREAM_AVAIL_OUT_STEP_MAX;
}
- z->stream.next_out = (Bytef*)RSTRING_END(z->buf);
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
return ZSTREAM_EXPAND_BUFFER_OK;
}
@@ -710,14 +738,15 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, long len)
if (NIL_P(z->buf)) {
z->buf = rb_str_buf_new(len);
rb_str_buf_cat(z->buf, (const char*)src, len);
+ z->buf_filled = len;
z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf);
z->stream.avail_out = 0;
rb_obj_hide(z->buf);
return;
}
- if ((long)rb_str_capacity(z->buf) < ZSTREAM_BUF_FILLED(z) + len) {
- rb_str_modify_expand(z->buf, len);
+ if (RSTRING_LEN(z->buf) < z->buf_filled + len) {
+ rb_str_resize(z->buf, z->buf_filled + len);
z->stream.avail_out = 0;
}
else {
@@ -728,8 +757,9 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, long len)
z->stream.avail_out = 0;
}
}
- rb_str_cat(z->buf, (const char *)src, len);
- z->stream.next_out = (Bytef*)RSTRING_END(z->buf);
+ memcpy(RSTRING_PTR(z->buf) + z->buf_filled, src, len);
+ z->buf_filled += len;
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
}
#define zstream_append_buffer2(z,v) \
@@ -752,12 +782,14 @@ zstream_detach_buffer(struct zstream *z)
}
else {
dst = z->buf;
+ rb_str_resize(dst, z->buf_filled);
rb_obj_reveal(dst, rb_cString);
}
OBJ_INFECT(dst, self);
z->buf = Qnil;
+ z->buf_filled = 0;
z->stream.next_out = 0;
z->stream.avail_out = 0;
@@ -773,20 +805,18 @@ static VALUE
zstream_shift_buffer(struct zstream *z, long len)
{
VALUE dst;
- char *bufptr;
- long buflen = ZSTREAM_BUF_FILLED(z);
+ long buflen;
- if (buflen <= len) {
+ if (z->buf_filled <= len) {
return zstream_detach_buffer(z);
}
- bufptr = RSTRING_PTR(z->buf);
- dst = rb_str_new(bufptr, len);
- buflen -= len;
- memmove(bufptr, bufptr + len, buflen);
- rb_str_set_len(z->buf, buflen);
- z->stream.next_out = (Bytef*)RSTRING_END(z->buf);
- buflen = (long)rb_str_capacity(z->buf) - ZSTREAM_BUF_FILLED(z);
+ 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);
+ z->stream.next_out = (Bytef*)RSTRING_PTR(z->buf) + z->buf_filled;
+ buflen = RSTRING_LEN(z->buf) - z->buf_filled;
if (buflen > ZSTREAM_AVAIL_OUT_STEP_MAX) {
buflen = ZSTREAM_AVAIL_OUT_STEP_MAX;
}
@@ -798,17 +828,13 @@ zstream_shift_buffer(struct zstream *z, long len)
static void
zstream_buffer_ungets(struct zstream *z, const Bytef *b, unsigned long len)
{
- char *bufptr;
- long filled;
-
- if (NIL_P(z->buf) || (long)rb_str_capacity(z->buf) <= ZSTREAM_BUF_FILLED(z)) {
+ if (NIL_P(z->buf) || RSTRING_LEN(z->buf) - z->buf_filled == 0) {
zstream_expand_buffer_into(z, len);
}
- RSTRING_GETMEM(z->buf, bufptr, filled);
- memmove(bufptr + len, bufptr, filled);
- memmove(bufptr, b, len);
- rb_str_set_len(z->buf, filled + len);
+ memmove(RSTRING_PTR(z->buf) + len, RSTRING_PTR(z->buf), z->buf_filled);
+ memmove(RSTRING_PTR(z->buf), b, len);
+ z->buf_filled+=len;
if (z->stream.avail_out > 0) {
if (len > z->stream.avail_out) len = z->stream.avail_out;
z->stream.next_out+=len;
@@ -819,8 +845,17 @@ zstream_buffer_ungets(struct zstream *z, const Bytef *b, unsigned long len)
static void
zstream_buffer_ungetbyte(struct zstream *z, int c)
{
- Bytef cc = (Bytef)c;
- zstream_buffer_ungets(z, &cc, 1);
+ if (NIL_P(z->buf) || RSTRING_LEN(z->buf) - z->buf_filled == 0) {
+ zstream_expand_buffer(z);
+ }
+
+ memmove(RSTRING_PTR(z->buf) + 1, RSTRING_PTR(z->buf), z->buf_filled);
+ RSTRING_PTR(z->buf)[0] = (char)c;
+ z->buf_filled++;
+ if (z->stream.avail_out > 0) {
+ z->stream.next_out++;
+ z->stream.avail_out--;
+ }
}
static void
@@ -849,8 +884,9 @@ zstream_discard_input(struct zstream *z, long len)
z->input = Qnil;
}
else {
- z->input = rb_str_substr(z->input, len,
- RSTRING_LEN(z->input) - len);
+ memmove(RSTRING_PTR(z->input), RSTRING_PTR(z->input) + len,
+ RSTRING_LEN(z->input) - len);
+ rb_str_resize(z->input, RSTRING_LEN(z->input) - len);
}
}
@@ -897,6 +933,7 @@ zstream_reset(struct zstream *z)
}
z->flags = ZSTREAM_FLAG_READY;
z->buf = Qnil;
+ z->buf_filled = 0;
z->stream.next_out = 0;
z->stream.avail_out = 0;
zstream_reset_input(z);
@@ -937,7 +974,7 @@ zstream_run_func(void *ptr)
while (!args->interrupt) {
n = z->stream.avail_out;
err = z->func->run(&z->stream, flush);
- rb_str_set_len(z->buf, ZSTREAM_BUF_FILLED(z) + (n - z->stream.avail_out));
+ z->buf_filled += n - z->stream.avail_out;
if (err == Z_STREAM_END) {
z->flags &= ~ZSTREAM_FLAG_IN_STREAM;
@@ -964,9 +1001,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 {
- state = zstream_expand_buffer_non_stream(z);
+ } else {
+ state = zstream_expand_buffer_without_gvl(z);
}
if (state) {
@@ -995,7 +1031,7 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
{
struct zstream_run_args args;
int err;
- VALUE guard = Qnil;
+ volatile VALUE guard = Qnil;
args.z = z;
args.flush = flush;
@@ -1052,7 +1088,7 @@ loop:
if (z->stream.avail_in > 0) {
zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
- RB_GC_GUARD(guard); /* prevent tail call to make guard effective */
+ RB_GC_GUARD(guard) = Qnil; /* prevent tail call to make guard effective */
}
if (args.jump_state)
@@ -1099,9 +1135,8 @@ zstream_sync(struct zstream *z, Bytef *src, long len)
}
static void
-zstream_mark(void *p)
+zstream_mark(struct zstream *z)
{
- struct zstream *z = p;
rb_gc_mark(z->buf);
rb_gc_mark(z->input);
}
@@ -1117,36 +1152,22 @@ zstream_finalize(struct zstream *z)
}
static void
-zstream_free(void *p)
+zstream_free(struct zstream *z)
{
- 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 = TypedData_Make_Struct(klass, struct zstream, &zstream_data_type, z);
+ obj = Data_Make_Struct(klass, struct zstream,
+ zstream_mark, zstream_free, z);
zstream_init(z, funcs);
z->stream.opaque = (voidpf)obj;
return obj;
@@ -1160,7 +1181,7 @@ get_zstream(VALUE obj)
{
struct zstream *z;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
if (!ZSTREAM_IS_READY(z)) {
rb_raise(cZError, "stream is not ready");
}
@@ -1283,7 +1304,7 @@ rb_zstream_flush_next_in(VALUE obj)
struct zstream *z;
VALUE dst;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
dst = zstream_detach_input(z);
OBJ_INFECT(dst, obj);
return dst;
@@ -1303,7 +1324,7 @@ rb_zstream_flush_next_out(VALUE obj)
{
struct zstream *z;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
return zstream_detach_buffer(z);
}
@@ -1316,7 +1337,7 @@ static VALUE
rb_zstream_avail_out(VALUE obj)
{
struct zstream *z;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
return rb_uint2inum(z->stream.avail_out);
}
@@ -1331,6 +1352,7 @@ rb_zstream_set_avail_out(VALUE obj, VALUE size)
{
struct zstream *z = get_zstream(obj);
+ Check_Type(size, T_FIXNUM);
zstream_expand_buffer_into(z, FIX2INT(size));
return size;
}
@@ -1342,7 +1364,7 @@ static VALUE
rb_zstream_avail_in(VALUE obj)
{
struct zstream *z;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
return INT2FIX(NIL_P(z->input) ? 0 : (int)(RSTRING_LEN(z->input)));
}
@@ -1381,7 +1403,7 @@ rb_zstream_data_type(VALUE obj)
static VALUE
rb_zstream_adler(VALUE obj)
{
- return rb_uint2inum(get_zstream(obj)->stream.adler);
+ return rb_uint2inum(get_zstream(obj)->stream.adler);
}
/*
@@ -1400,7 +1422,7 @@ static VALUE
rb_zstream_closed_p(VALUE obj)
{
struct zstream *z;
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
return ZSTREAM_IS_READY(z) ? Qfalse : Qtrue;
}
@@ -1416,7 +1438,7 @@ rb_zstream_closed_p(VALUE obj)
#define FIXNUMARG(val, ifnil) \
(NIL_P((val)) ? (ifnil) \
- : (FIX2INT((val))))
+ : ((void)Check_Type((val), T_FIXNUM), FIX2INT((val))))
#define ARG_LEVEL(val) FIXNUMARG((val), Z_DEFAULT_COMPRESSION)
#define ARG_WBITS(val) FIXNUMARG((val), MAX_WBITS)
@@ -1512,7 +1534,7 @@ rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
int err;
rb_scan_args(argc, argv, "04", &level, &wbits, &memlevel, &strategy);
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
err = deflateInit2(&z->stream, ARG_LEVEL(level), Z_DEFLATED,
ARG_WBITS(wbits), ARG_MEMLEVEL(memlevel),
@@ -1536,7 +1558,7 @@ rb_deflate_init_copy(VALUE self, VALUE orig)
struct zstream *z1, *z2;
int err;
- TypedData_Get_Struct(self, struct zstream, &zstream_data_type, z1);
+ Data_Get_Struct(self, struct zstream, z1);
z2 = get_zstream(orig);
if (z1 == z2) return self;
@@ -1546,6 +1568,7 @@ rb_deflate_init_copy(VALUE self, VALUE orig)
}
z1->input = NIL_P(z2->input) ? Qnil : rb_str_dup(z2->input);
z1->buf = NIL_P(z2->buf) ? Qnil : rb_str_dup(z2->buf);
+ z1->buf_filled = z2->buf_filled;
z1->flags = z2->flags;
return self;
@@ -1729,26 +1752,23 @@ rb_deflate_params(VALUE obj, VALUE v_level, VALUE v_strategy)
int level, strategy;
int err;
uInt n;
- long filled;
level = ARG_LEVEL(v_level);
strategy = ARG_STRATEGY(v_strategy);
n = z->stream.avail_out;
err = deflateParams(&z->stream, level, strategy);
- filled = n - z->stream.avail_out;
+ z->buf_filled += n - z->stream.avail_out;
while (err == Z_BUF_ERROR) {
rb_warning("deflateParams() returned Z_BUF_ERROR");
zstream_expand_buffer(z);
- rb_str_set_len(z->buf, RSTRING_LEN(z->buf) + filled);
n = z->stream.avail_out;
err = deflateParams(&z->stream, level, strategy);
- filled = n - z->stream.avail_out;
+ z->buf_filled += n - z->stream.avail_out;
}
if (err != Z_OK) {
raise_zlib_error(err, z->stream.msg);
}
- rb_str_set_len(z->buf, RSTRING_LEN(z->buf) + filled);
return Qnil;
}
@@ -1817,7 +1837,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.
@@ -1857,7 +1877,7 @@ rb_inflate_initialize(int argc, VALUE *argv, VALUE obj)
int err;
rb_scan_args(argc, argv, "01", &wbits);
- TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
+ Data_Get_Struct(obj, struct zstream, z);
err = inflateInit2(&z->stream, ARG_WBITS(wbits));
if (err != Z_OK) {
@@ -1948,8 +1968,7 @@ 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);
@@ -2178,18 +2197,18 @@ struct gzfile {
struct zstream z;
VALUE io;
int level;
- int os_code; /* for header */
time_t mtime; /* for header */
+ int os_code; /* 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;
@@ -2201,16 +2220,14 @@ struct gzfile {
#define GZFILE_FLAG_FOOTER_FINISHED (ZSTREAM_FLAG_UNUSED << 2)
#define GZFILE_IS_FINISHED(gz) \
- (ZSTREAM_IS_FINISHED(&(gz)->z) && ZSTREAM_BUF_FILLED(&(gz)->z) == 0)
+ (ZSTREAM_IS_FINISHED(&(gz)->z) && (gz)->z.buf_filled == 0)
#define GZFILE_READ_SIZE 2048
static void
-gzfile_mark(void *p)
+gzfile_mark(struct gzfile *gz)
{
- struct gzfile *gz = p;
-
rb_gc_mark(gz->io);
rb_gc_mark(gz->orig_name);
rb_gc_mark(gz->comment);
@@ -2220,9 +2237,8 @@ gzfile_mark(void *p)
}
static void
-gzfile_free(void *p)
+gzfile_free(struct gzfile *gz)
{
- struct gzfile *gz = p;
struct zstream *z = &gz->z;
if (ZSTREAM_IS_READY(z)) {
@@ -2237,27 +2253,16 @@ gzfile_free(void *p)
xfree(gz);
}
-static size_t
-gzfile_memsize(const void *p)
+static VALUE
+gzfile_new(klass, funcs, endfunc)
+ VALUE klass;
+ const struct zstream_funcs *funcs;
+ void (*endfunc)(struct gzfile *);
{
- 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
-};
+ VALUE obj;
+ struct gzfile *gz;
-static void
-gzfile_init(struct gzfile *gz, const struct zstream_funcs *funcs, void (*endfunc)(struct gzfile *))
-{
+ obj = Data_Make_Struct(klass, struct gzfile, gzfile_mark, gzfile_free, gz);
zstream_init(&gz->z, funcs);
gz->z.flags |= ZSTREAM_FLAG_GZFILE;
gz->io = Qnil;
@@ -2277,16 +2282,7 @@ gzfile_init(struct gzfile *gz, const struct zstream_funcs *funcs, void (*endfunc
gz->ecopts = Qnil;
gz->cbuf = 0;
gz->path = Qnil;
-}
-
-static VALUE
-gzfile_new(VALUE klass, const struct zstream_funcs *funcs, void (*endfunc)(struct gzfile *))
-{
- VALUE obj;
- struct gzfile *gz;
- obj = TypedData_Make_Struct(klass, struct gzfile, &gzfile_data_type, gz);
- gzfile_init(gz, funcs, endfunc);
return obj;
}
@@ -2327,7 +2323,7 @@ gzfile_write_raw(struct gzfile *gz)
{
VALUE str;
- if (ZSTREAM_BUF_FILLED(&gz->z) > 0) {
+ if (gz->z.buf_filled > 0) {
str = zstream_detach_buffer(&gz->z);
OBJ_TAINT(str); /* for safe */
rb_funcall(gz->io, id_write, 1, str);
@@ -2375,10 +2371,6 @@ gzfile_read_raw_ensure(struct gzfile *gz, long size)
{
VALUE str;
- if (gz->io == Qundef) { /* Zlib.gunzip */
- if (NIL_P(gz->z.input) || RSTRING_LEN(gz->z.input) < size)
- rb_raise(cGzError, "unexpected end of string");
- }
while (NIL_P(gz->z.input) || RSTRING_LEN(gz->z.input) < size) {
str = gzfile_read_raw(gz);
if (NIL_P(str)) return 0;
@@ -2496,7 +2488,7 @@ gzfile_make_header(struct gzfile *gz)
gzfile_set32((unsigned long)gz->mtime, &buf[4]);
buf[8] = extraflags;
buf[9] = gz->os_code;
- zstream_append_buffer(&gz->z, buf, (long)sizeof(buf));
+ zstream_append_buffer(&gz->z, buf, sizeof(buf));
if (!NIL_P(gz->orig_name)) {
zstream_append_buffer2(&gz->z, gz->orig_name);
@@ -2517,7 +2509,7 @@ gzfile_make_footer(struct gzfile *gz)
gzfile_set32(gz->crc, buf);
gzfile_set32(gz->z.stream.total_in, &buf[4]);
- zstream_append_buffer(&gz->z, buf, (long)sizeof(buf));
+ zstream_append_buffer(&gz->z, buf, sizeof(buf));
gz->z.flags |= GZFILE_FLAG_FOOTER_FINISHED;
}
@@ -2645,7 +2637,7 @@ gzfile_write(struct gzfile *gz, Bytef *str, long len)
static long
gzfile_read_more(struct gzfile *gz)
{
- VALUE str;
+ volatile VALUE str;
while (!ZSTREAM_IS_FINISHED(&gz->z)) {
str = gzfile_read_raw(gz);
@@ -2658,11 +2650,10 @@ 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 (ZSTREAM_BUF_FILLED(&gz->z) > 0) break;
+ if (gz->z.buf_filled > 0) break;
}
- return ZSTREAM_BUF_FILLED(&gz->z);
+ return gz->z.buf_filled;
}
static void
@@ -2673,7 +2664,7 @@ gzfile_calc_crc(struct gzfile *gz, VALUE str)
}
else {
gz->crc = checksum_long(crc32, gz->crc, (Bytef*)RSTRING_PTR(str) + gz->ungetc,
- RSTRING_LEN(str) - gz->ungetc);
+ RSTRING_LEN(str) - gz->ungetc);
gz->ungetc = 0;
}
}
@@ -2703,7 +2694,7 @@ gzfile_fill(struct gzfile *gz, long len)
rb_raise(rb_eArgError, "negative length %ld given", len);
if (len == 0)
return 0;
- while (!ZSTREAM_IS_FINISHED(&gz->z) && ZSTREAM_BUF_FILLED(&gz->z) < len) {
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled < len) {
gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
@@ -2712,7 +2703,7 @@ gzfile_fill(struct gzfile *gz, long len)
}
return -1;
}
- return len < ZSTREAM_BUF_FILLED(&gz->z) ? len : ZSTREAM_BUF_FILLED(&gz->z);
+ return len < gz->z.buf_filled ? len : gz->z.buf_filled;
}
static VALUE
@@ -2747,7 +2738,7 @@ gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
return outbuf;
}
}
- while (!ZSTREAM_IS_FINISHED(&gz->z) && ZSTREAM_BUF_FILLED(&gz->z) == 0) {
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled == 0) {
gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
@@ -2765,7 +2756,6 @@ 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 */
@@ -2801,7 +2791,7 @@ gzfile_getc(struct gzfile *gz)
int len;
len = rb_enc_mbmaxlen(gz->enc);
- while (!ZSTREAM_IS_FINISHED(&gz->z) && ZSTREAM_BUF_FILLED(&gz->z) < len) {
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled < len) {
gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
@@ -2819,7 +2809,7 @@ gzfile_getc(struct gzfile *gz)
gz->cbuf = ALLOC_N(char, GZFILE_CBUF_CAPA);
}
ss = sp = (const unsigned char*)RSTRING_PTR(gz->z.buf);
- se = sp + ZSTREAM_BUF_FILLED(&gz->z);
+ se = sp + gz->z.buf_filled;
ds = dp = (unsigned char *)gz->cbuf;
de = (unsigned char *)ds + GZFILE_CBUF_CAPA;
(void)rb_econv_convert(gz->ec, &sp, se, &dp, de, ECONV_PARTIAL_INPUT|ECONV_AFTER_OUTPUT);
@@ -2937,7 +2927,7 @@ get_gzfile(VALUE obj)
{
struct gzfile *gz;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
if (!ZSTREAM_IS_READY(&gz->z)) {
rb_raise(cGzError, "closed gzip stream");
}
@@ -3003,7 +2993,7 @@ gzfile_ensure_close(VALUE obj)
{
struct gzfile *gz;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
if (ZSTREAM_IS_READY(&gz->z)) {
gzfile_close(gz, 1);
}
@@ -3070,7 +3060,9 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
{
VALUE io, filename;
- rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
+ if (argc < 1) {
+ rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
+ }
filename = argv[0];
io = rb_file_open_str(filename, mode);
argv[0] = io;
@@ -3194,20 +3186,7 @@ rb_gzfile_set_lineno(VALUE obj, VALUE lineno)
* Document-method: Zlib::GzipWriter#mtime=
*
* Specify the modification time (+mtime+) in the gzip header.
- * Using an Integer.
- *
- * Setting the mtime in the gzip header does not effect the
- * mtime of the file generated. Different utilities that
- * expand the gzipped files may use the mtime
- * header. For example the gunzip utility can use the `-N`
- * flag which will set the resultant file's mtime to the
- * value in the header. By default many tools will set
- * the mtime of the expanded file to the mtime of the
- * gzipped file, not the mtime in the header.
- *
- * If you do not set an mtime, the default value will be the time
- * when compression started. Setting a value of 0 indicates
- * no time stamp is available.
+ * Using a Fixnum or Integer
*/
static VALUE
rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
@@ -3282,13 +3261,9 @@ rb_gzfile_set_comment(VALUE obj, VALUE str)
static VALUE
rb_gzfile_close(VALUE obj)
{
- struct gzfile *gz;
+ struct gzfile *gz = get_gzfile(obj);
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;
@@ -3322,7 +3297,7 @@ static VALUE
rb_gzfile_closed_p(VALUE obj)
{
struct gzfile *gz;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
return NIL_P(gz->io) ? Qtrue : Qfalse;
}
@@ -3393,14 +3368,7 @@ static VALUE
rb_gzfile_total_out(VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
- uLong total_out = gz->z.stream.total_out;
- long buf_filled = ZSTREAM_BUF_FILLED(&gz->z);
-
- if (total_out >= (uLong)buf_filled) {
- return rb_uint2inum(total_out - buf_filled);
- } else {
- return LONG2FIX(-(buf_filled - (long)total_out));
- }
+ return rb_uint2inum(gz->z.stream.total_out - gz->z.buf_filled);
}
/*
@@ -3415,7 +3383,7 @@ static VALUE
rb_gzfile_path(VALUE obj)
{
struct gzfile *gz;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
return gz->path;
}
@@ -3513,7 +3481,7 @@ rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
}
rb_scan_args(argc, argv, "12", &io, &level, &strategy);
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
/* this is undocumented feature of zlib */
gz->level = ARG_LEVEL(level);
@@ -3566,23 +3534,17 @@ rb_gzwriter_flush(int argc, VALUE *argv, VALUE obj)
* Same as IO.
*/
static VALUE
-rb_gzwriter_write(int argc, VALUE *argv, VALUE obj)
+rb_gzwriter_write(VALUE obj, VALUE str)
{
struct gzfile *gz = get_gzfile(obj);
- size_t total = 0;
-
- while (argc-- > 0) {
- VALUE str = *argv++;
- if (!RB_TYPE_P(str, T_STRING))
- str = rb_obj_as_string(str);
- if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) {
- str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2);
- }
- gzfile_write(gz, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str));
- total += RSTRING_LEN(str);
- RB_GC_GUARD(str);
+
+ if (!RB_TYPE_P(str, T_STRING))
+ str = rb_obj_as_string(str);
+ if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) {
+ str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2);
}
- return SIZET2NUM(total);
+ gzfile_write(gz, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str));
+ return INT2FIX(RSTRING_LEN(str));
}
/*
@@ -3628,7 +3590,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 as an IO, or -IO-like, object.
+ * be used an IO, or -IO-like, object.
*
* Zlib::GzipReader.open('hoge.gz') {|gz|
* print gz.read
@@ -3721,7 +3683,7 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
struct gzfile *gz;
int err;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
rb_scan_args(argc, argv, "1:", &io, &opt);
/* this is undocumented feature of zlib */
@@ -3766,7 +3728,7 @@ static VALUE
rb_gzreader_unused(VALUE obj)
{
struct gzfile *gz;
- TypedData_Get_Struct(obj, struct gzfile, &gzfile_data_type, gz);
+ Data_Get_Struct(obj, struct gzfile, gz);
return gzfile_reader_get_unused(gz);
}
@@ -3955,7 +3917,6 @@ 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;
}
@@ -3979,7 +3940,7 @@ gzreader_skip_linebreaks(struct gzfile *gz)
char *p;
int n;
- while (ZSTREAM_BUF_FILLED(&gz->z) == 0) {
+ while (gz->z.buf_filled == 0) {
if (GZFILE_IS_FINISHED(gz)) return;
gzfile_read_more(gz);
}
@@ -3987,10 +3948,10 @@ gzreader_skip_linebreaks(struct gzfile *gz)
p = RSTRING_PTR(gz->z.buf);
while (n++, *(p++) == '\n') {
- if (n >= ZSTREAM_BUF_FILLED(&gz->z)) {
+ if (n >= gz->z.buf_filled) {
str = zstream_detach_buffer(&gz->z);
gzfile_calc_crc(gz, str);
- while (ZSTREAM_BUF_FILLED(&gz->z) == 0) {
+ while (gz->z.buf_filled == 0) {
if (GZFILE_IS_FINISHED(gz)) return;
gzfile_read_more(gz);
}
@@ -4014,7 +3975,7 @@ static long
gzreader_charboundary(struct gzfile *gz, long n)
{
char *s = RSTRING_PTR(gz->z.buf);
- char *e = s + ZSTREAM_BUF_FILLED(&gz->z);
+ char *e = s + gz->z.buf_filled;
char *p = rb_enc_left_char_head(s, s + n, e, gz->enc);
long l = p - s;
if (l < n) {
@@ -4035,7 +3996,7 @@ static VALUE
gzreader_gets(int argc, VALUE *argv, VALUE obj)
{
struct gzfile *gz = get_gzfile(obj);
- VALUE rs;
+ volatile VALUE rs;
VALUE dst;
const char *rsptr;
char *p, *res;
@@ -4098,8 +4059,7 @@ 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;
@@ -4109,9 +4069,9 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
gzreader_skip_linebreaks(gz);
}
- while (ZSTREAM_BUF_FILLED(&gz->z) < rslen) {
+ while (gz->z.buf_filled < rslen) {
if (ZSTREAM_IS_FINISHED(&gz->z)) {
- if (ZSTREAM_BUF_FILLED(&gz->z) > 0) gz->lineno++;
+ if (gz->z.buf_filled > 0) gz->lineno++;
return gzfile_read(gz, rslen);
}
gzfile_read_more(gz);
@@ -4121,13 +4081,13 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
n = rslen;
for (;;) {
long filled;
- if (n > ZSTREAM_BUF_FILLED(&gz->z)) {
+ if (n > gz->z.buf_filled) {
if (ZSTREAM_IS_FINISHED(&gz->z)) break;
gzfile_read_more(gz);
p = RSTRING_PTR(gz->z.buf) + n - rslen;
}
if (!rspara) rscheck(rsptr, rslen, rs);
- filled = ZSTREAM_BUF_FILLED(&gz->z);
+ filled = gz->z.buf_filled;
if (limit > 0 && filled >= limit) {
filled = limit;
}
@@ -4136,15 +4096,14 @@ 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;
p++, n++;
}
}
- if (maxlen > 1 && n == limit && (ZSTREAM_BUF_FILLED(&gz->z) > n || !ZSTREAM_IS_FINISHED(&gz->z))) {
+ if (maxlen > 1 && n == limit && (gz->z.buf_filled > n || !ZSTREAM_IS_FINISHED(&gz->z))) {
n = gzreader_charboundary(gz, n);
}
@@ -4154,7 +4113,6 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
if (rspara) {
gzreader_skip_linebreaks(gz);
}
- RB_GC_GUARD(rs);
return gzfile_newstr(gz, dst);
}
@@ -4239,187 +4197,10 @@ 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);
-}
-
-static VALUE
-zlib_gzip_ensure(VALUE arg)
-{
- struct gzfile *gz = (struct gzfile *)arg;
- rb_rescue((VALUE(*)())gz->end, arg, NULL, Qnil);
- return Qnil;
-}
-
-static void
-zlib_gzip_end(struct gzfile *gz)
-{
- gz->z.flags |= ZSTREAM_FLAG_CLOSING;
- zstream_run(&gz->z, (Bytef*)"", 0, Z_FINISH);
- gzfile_make_footer(gz);
- zstream_end(&gz->z);
-}
-
-#define OPTHASH_GIVEN_P(opts) \
- (argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
-static ID id_level, id_strategy;
-static VALUE zlib_gzip_run(VALUE arg);
-
-/*
- * call-seq:
- * Zlib.gzip(src, level: nil, strategy: nil) -> String
- *
- * Gzip the given +string+. Valid values of level are
- * Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION,
- * Zlib::DEFAULT_COMPRESSION (default), or an integer from 0 to 9.
- *
- * This method is almost equivalent to the following code:
- *
- * def gzip(string, level: nil, strategy: nil)
- * sio = StringIO.new
- * sio.binmode
- * gz = Zlib::GzipWriter.new(sio, level, strategy)
- * gz.write(string)
- * gz.close
- * sio.string
- * end
- *
- * See also Zlib.gunzip
- *
- */
-static VALUE
-zlib_s_gzip(int argc, VALUE *argv, VALUE klass)
-{
- struct gzfile gz0;
- struct gzfile *gz = &gz0;
- int err;
- VALUE src, opts, level=Qnil, strategy=Qnil, args[2];
-
- if (OPTHASH_GIVEN_P(opts)) {
- ID keyword_ids[2];
- VALUE kwargs[2];
- keyword_ids[0] = id_level;
- keyword_ids[1] = id_strategy;
- rb_get_kwargs(opts, keyword_ids, 0, 2, kwargs);
- if (kwargs[0] != Qundef) {
- level = kwargs[0];
- }
- if (kwargs[1] != Qundef) {
- strategy = kwargs[1];
- }
- }
- rb_scan_args(argc, argv, "10", &src);
- StringValue(src);
- gzfile_init(gz, &deflate_funcs, zlib_gzip_end);
- gz->level = ARG_LEVEL(level);
- err = deflateInit2(&gz->z.stream, gz->level, Z_DEFLATED,
- -MAX_WBITS, DEF_MEM_LEVEL, ARG_STRATEGY(strategy));
- if (err != Z_OK) {
- zlib_gzip_end(gz);
- raise_zlib_error(err, gz->z.stream.msg);
- }
- ZSTREAM_READY(&gz->z);
- args[0] = (VALUE)gz;
- args[1] = src;
- return rb_ensure(zlib_gzip_run, (VALUE)args, zlib_gzip_ensure, (VALUE)gz);
-}
-
-static VALUE
-zlib_gzip_run(VALUE arg)
-{
- VALUE *args = (VALUE *)arg;
- struct gzfile *gz = (struct gzfile *)args[0];
- VALUE src = args[1];
- long len;
-
- gzfile_make_header(gz);
- len = RSTRING_LEN(src);
- if (len > 0) {
- Bytef *ptr = (Bytef *)RSTRING_PTR(src);
- gz->crc = checksum_long(crc32, gz->crc, ptr, len);
- zstream_run(&gz->z, ptr, len, Z_NO_FLUSH);
- }
- gzfile_close(gz, 0);
- return zstream_detach_buffer(&gz->z);
-}
-
-static void
-zlib_gunzip_end(struct gzfile *gz)
-{
- gz->z.flags |= ZSTREAM_FLAG_CLOSING;
- zstream_end(&gz->z);
-}
-
-static VALUE zlib_gunzip_run(VALUE arg);
-
-/*
- * call-seq:
- * Zlib.gunzip(src) -> String
- *
- * Decode the given gzipped +string+.
- *
- * This method is almost equivalent to the following code:
- *
- * def gunzip(string)
- * sio = StringIO.new(string)
- * gz = Zlib::GzipReader.new(sio, encoding: Encoding::ASCII_8BIT)
- * gz.read
- * ensure
- * gz&.close
- * end
- *
- * See also Zlib.gzip
- */
-static VALUE
-zlib_gunzip(VALUE klass, VALUE src)
-{
- struct gzfile gz0;
- struct gzfile *gz = &gz0;
- int err;
-
- StringValue(src);
-
- gzfile_init(gz, &inflate_funcs, zlib_gunzip_end);
- err = inflateInit2(&gz->z.stream, -MAX_WBITS);
- if (err != Z_OK) {
- raise_zlib_error(err, gz->z.stream.msg);
- }
- gz->io = Qundef;
- gz->z.input = src;
- ZSTREAM_READY(&gz->z);
- return rb_ensure(zlib_gunzip_run, (VALUE)gz, zlib_gzip_ensure, (VALUE)gz);
-}
-
-static VALUE
-zlib_gunzip_run(VALUE arg)
-{
- struct gzfile *gz = (struct gzfile *)arg;
- VALUE dst;
-
- gzfile_read_header(gz);
- dst = zstream_detach_buffer(&gz->z);
- gzfile_calc_crc(gz, dst);
- if (!ZSTREAM_IS_FINISHED(&gz->z)) {
- rb_raise(cGzError, "unexpected end of file");
- }
- if (NIL_P(gz->z.input)) {
- rb_raise(cNoFooter, "footer is not found");
- }
- gzfile_check_footer(gz);
- return dst;
-}
-
#endif /* GZIP_SUPPORT */
void
-Init_zlib(void)
+Init_zlib()
{
VALUE mZlib, cZStream, cDeflate, cInflate;
#if GZIP_SUPPORT
@@ -4524,7 +4305,7 @@ Init_zlib(void)
* pre-compressed data to a deflate stream.
*/
rb_define_const(mZlib, "NO_COMPRESSION", INT2FIX(Z_NO_COMPRESSION));
- /* Fastest compression level, but with the lowest space savings. */
+ /* Fastest compression level, but with with 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));
@@ -4655,7 +4436,7 @@ Init_zlib(void)
rb_define_alloc_func(cGzipWriter, rb_gzwriter_s_allocate);
rb_define_method(cGzipWriter, "initialize", rb_gzwriter_initialize,-1);
rb_define_method(cGzipWriter, "flush", rb_gzwriter_flush, -1);
- rb_define_method(cGzipWriter, "write", rb_gzwriter_write, -1);
+ rb_define_method(cGzipWriter, "write", rb_gzwriter_write, 1);
rb_define_method(cGzipWriter, "putc", rb_gzwriter_putc, 1);
rb_define_method(cGzipWriter, "<<", rb_gzwriter_addstr, 1);
rb_define_method(cGzipWriter, "printf", rb_gzwriter_printf, -1);
@@ -4684,10 +4465,6 @@ Init_zlib(void)
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);
-
- rb_define_singleton_method(mZlib, "gzip", zlib_s_gzip, -1);
- rb_define_singleton_method(mZlib, "gunzip", zlib_gunzip, 1);
/* The OS code of current host */
rb_define_const(mZlib, "OS_CODE", INT2FIX(OS_CODE));
@@ -4722,8 +4499,6 @@ Init_zlib(void)
/* OS code for unknown hosts */
rb_define_const(mZlib, "OS_UNKNOWN", INT2FIX(OS_UNKNOWN));
- id_level = rb_intern("level");
- id_strategy = rb_intern("strategy");
#endif /* GZIP_SUPPORT */
}
diff --git a/ext/zlib/zlib.gemspec b/ext/zlib/zlib.gemspec
deleted file mode 100644
index bdb32f0ea5..0000000000
--- a/ext/zlib/zlib.gemspec
+++ /dev/null
@@ -1,25 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-Gem::Specification.new do |spec|
- spec.name = "zlib"
- spec.version = "1.0.0"
- spec.date = '2017-12-11'
- spec.authors = ["Yukihiro Matsumoto", "UENO Katsuhiro"]
- spec.email = ["matz@ruby-lang.org", nil]
-
- spec.summary = %q{Ruby interface for the zlib compression/decompression library}
- spec.description = %q{Ruby interface for the zlib compression/decompression library}
- spec.homepage = "https://github.com/ruby/zlib"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/zlib/extconf.rb", "ext/zlib/zlib.c", "zlib.gemspec"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.extensions = "ext/zlib/extconf.rb"
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "rake-compiler"
-end
diff --git a/file.c b/file.c
index 3bf092c05c..34b2693430 100644
--- a/file.c
+++ b/file.c
@@ -23,20 +23,15 @@
#include <CoreFoundation/CFString.h>
#endif
-#include "id.h"
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/util.h"
-#include "ruby/thread.h"
#include "dln.h"
-#include "encindex.h"
+#include "internal.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>
@@ -65,13 +60,16 @@ int flock(int, int);
#include <pwd.h>
#endif
-#ifdef HAVE_SYS_SYSMACROS_H
-#include <sys/sysmacros.h>
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/utime.h"
+# include "nacl/stat.h"
+# include "nacl/unistd.h"
+#endif
+
+
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
@@ -90,68 +88,73 @@ int flock(int, int);
/* define system APIs */
#ifdef _WIN32
-#include "win32/file.h"
-#define STAT(p, s) rb_w32_ustati128((p), (s))
+#define STAT(p, s) rb_w32_ustati64((p), (s))
#undef lstat
-#define lstat(p, s) rb_w32_ulstati128((p), (s))
+#define lstat(p, s) rb_w32_ustati64((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 utimensat
-#define utimensat(s, p, t, f) rb_w32_uutimensat((s), (p), (t), (f))
+#undef utime
+#define utime(p, t) rb_w32_uutime((p), (t))
#undef link
#define link(f, t) rb_w32_ulink((f), (t))
#undef unlink
#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 _WIN32 || defined __APPLE__
-# define USE_OSPATH 1
-# define TO_OSPATH(str) rb_str_encode_ospath(str)
-#else
-# define USE_OSPATH 0
-# define TO_OSPATH(str) (str)
-#endif
-
-/* utime may fail if time is out-of-range for the FS [ruby-dev:38277] */
-#if defined DOSISH || defined __CYGWIN__
-# define UTIME_EINVAL
-#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;
-#define insecure_obj_p(obj, level) ((level) > 0 && OBJ_TAINTED(obj))
+#define insecure_obj_p(obj, level) ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj)))
static VALUE
file_path_convert(VALUE name)
{
#ifndef _WIN32 /* non Windows == Unix */
- 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)) {
+ 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)) {
/* 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
@@ -183,7 +186,10 @@ rb_get_path_check_to_string(VALUE obj, int level)
return obj;
}
CONST_ID(to_path, "to_path");
- tmp = rb_check_funcall_default(obj, to_path, 0, 0, obj);
+ tmp = rb_check_funcall(obj, to_path, 0, 0);
+ if (tmp == Qundef) {
+ tmp = obj;
+ }
StringValue(tmp);
return tmp;
}
@@ -197,14 +203,12 @@ rb_get_path_check_convert(VALUE obj, VALUE tmp, int level)
}
check_path_encoding(tmp);
- if (!rb_str_to_cstr(tmp)) {
- rb_raise(rb_eArgError, "path name contains null byte");
- }
+ StringValueCStr(tmp);
return rb_str_new4(tmp);
}
-VALUE
+static VALUE
rb_get_path_check(VALUE obj, int level)
{
VALUE tmp = rb_get_path_check_to_string(obj, level);
@@ -226,27 +230,26 @@ rb_get_path(VALUE obj)
VALUE
rb_str_encode_ospath(VALUE path)
{
-#if USE_OSPATH
- int encidx = ENCODING_GET(path);
#ifdef _WIN32
- if (encidx == ENCINDEX_ASCII) {
- encidx = rb_filesystem_encindex();
+ rb_encoding *enc = rb_enc_get(path);
+ rb_encoding *utf8 = rb_utf8_encoding();
+ if (enc == rb_ascii8bit_encoding()) {
+ enc = rb_filesystem_encoding();
}
-#endif
- if (encidx != ENCINDEX_UTF_8) {
- rb_encoding *enc = rb_enc_from_index(encidx);
- rb_encoding *utf8 = rb_utf8_encoding();
+ if (enc != utf8) {
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_append_normalized_ospath(VALUE str, const char *ptr, long len)
+rb_str_normalize_ospath0(const char *ptr, long len)
{
+ VALUE str;
CFIndex buflen = 0;
CFRange all;
CFStringRef s = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault,
@@ -254,15 +257,14 @@ rb_str_append_normalized_ospath(VALUE str, 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);
- 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);
+ 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);
CFRelease(m);
CFRelease(s);
return str;
@@ -283,19 +285,16 @@ 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 */
- static const char invalid[3] = "\xEF\xBF\xBD";
- rb_str_append_normalized_ospath(str, p1, p-p1);
- rb_str_cat(str, invalid, sizeof(invalid));
+ rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
+ rb_str_cat2(str, "\xEF\xBF\xBD");
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_normalized_ospath(str, p1, p-p1);
+ rb_str_append(str, rb_str_normalize_ospath0(p1, p-p1));
}
rb_str_cat(str, p, l);
p += l;
@@ -306,116 +305,28 @@ rb_str_normalize_ospath(const char *ptr, long len)
}
}
if (p - p1 > 0) {
- rb_str_append_normalized_ospath(str, p1, p-p1);
+ rb_str_append(str, rb_str_normalize_ospath0(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
-#define apply2args(n) (rb_check_arity(argc, n, UNLIMITED_ARGUMENTS), argc-=n)
-
-struct apply_filename {
- const char *ptr;
- VALUE path;
-};
-
-struct apply_arg {
- int i;
- int argc;
- int errnum;
- int (*func)(const char *, void *);
- void *arg;
- struct apply_filename fn[1]; /* flexible array */
-};
-
-static void *
-no_gvl_apply2files(void *ptr)
+static long
+apply2files(void (*func)(const char *, VALUE, void *), VALUE vargs, void *arg)
{
- struct apply_arg *aa = ptr;
-
- for (aa->i = 0; aa->i < aa->argc; aa->i++) {
- if (aa->func(aa->fn[aa->i].ptr, aa->arg) < 0) {
- aa->errnum = errno;
- break;
- }
- }
- return 0;
-}
-
-#ifdef UTIME_EINVAL
-NORETURN(static void utime_failed(struct apply_arg *));
-static int utime_internal(const char *, void *);
-#endif
-
-static VALUE
-apply2files(int (*func)(const char *, void *), int argc, VALUE *argv, void *arg)
-{
- VALUE v;
- const size_t size = sizeof(struct apply_filename);
- const long len = (long)(offsetof(struct apply_arg, fn) + (size * argc));
- struct apply_arg *aa = ALLOCV(v, len);
-
- aa->errnum = 0;
- aa->argc = argc;
- aa->arg = arg;
- aa->func = func;
-
- for (aa->i = 0; aa->i < argc; aa->i++) {
- VALUE path = rb_get_path(argv[aa->i]);
+ long i;
+ volatile VALUE path;
+ for (i=0; i<RARRAY_LEN(vargs); i++) {
+ const char *s;
+ path = rb_get_path(RARRAY_AREF(vargs, i));
path = rb_str_encode_ospath(path);
- aa->fn[aa->i].ptr = RSTRING_PTR(path);
- aa->fn[aa->i].path = path;
+ s = RSTRING_PTR(path);
+ (*func)(s, path, arg);
}
- rb_thread_call_without_gvl(no_gvl_apply2files, aa, RUBY_UBF_IO, 0);
- if (aa->errnum) {
-#ifdef UTIME_EINVAL
- if (func == utime_internal) {
- utime_failed(aa);
- }
-#endif
- rb_syserr_fail_path(aa->errnum, aa->fn[aa->i].path);
- }
- if (v) {
- ALLOCV_END(v);
- }
- return LONG2FIX(argc);
+ return RARRAY_LEN(vargs);
}
/*
@@ -426,13 +337,6 @@ apply2files(int (*func)(const char *, void *), int argc, VALUE *argv, void *arg)
* Returns the pathname used to create <i>file</i> as a string. Does
* not normalize the name.
*
- * The pathname may not point to the file corresponding to <i>file</i>.
- * For instance, the pathname becomes void when the file has been
- * moved or deleted.
- *
- * This method raises <code>IOError</code> for a <i>file</i> created using
- * <code>File::Constants::TMPFILE</code> because they don't have a pathname.
- *
* File.new("testfile").path #=> "testfile"
* File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx"
*
@@ -445,38 +349,32 @@ rb_file_path(VALUE obj)
fptr = RFILE(rb_io_taint_check(obj))->fptr;
rb_io_check_initialized(fptr);
-
- if (NIL_P(fptr->pathv)) {
- rb_raise(rb_eIOError, "File is unnamed (TMPFILE?)");
- }
-
+ if (NIL_P(fptr->pathv)) return Qnil;
return rb_obj_taint(rb_str_dup(fptr->pathv));
}
static size_t
stat_memsize(const void *p)
{
- return sizeof(struct stat);
+ return p ? sizeof(struct stat) : 0;
}
static const rb_data_type_t stat_data_type = {
"stat",
{NULL, RUBY_TYPED_DEFAULT_FREE, stat_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, 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 obj;
+ return TypedData_Wrap_Struct(klass, &stat_data_type, nst);
}
VALUE
@@ -542,7 +440,7 @@ rb_stat_cmp(VALUE self, VALUE other)
/*
* call-seq:
- * stat.dev -> integer
+ * stat.dev -> fixnum
*
* Returns an integer representing the device on which <i>stat</i>
* resides.
@@ -558,7 +456,7 @@ rb_stat_dev(VALUE self)
/*
* call-seq:
- * stat.dev_major -> integer
+ * stat.dev_major -> fixnum
*
* Returns the major part of <code>File_Stat#dev</code> or
* <code>nil</code>.
@@ -571,7 +469,7 @@ static VALUE
rb_stat_dev_major(VALUE self)
{
#if defined(major)
- return DEVT2NUM(major(get_stat(self)->st_dev));
+ return INT2NUM(major(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@@ -579,7 +477,7 @@ rb_stat_dev_major(VALUE self)
/*
* call-seq:
- * stat.dev_minor -> integer
+ * stat.dev_minor -> fixnum
*
* Returns the minor part of <code>File_Stat#dev</code> or
* <code>nil</code>.
@@ -592,7 +490,7 @@ static VALUE
rb_stat_dev_minor(VALUE self)
{
#if defined(minor)
- return DEVT2NUM(minor(get_stat(self)->st_dev));
+ return INT2NUM(minor(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@@ -600,7 +498,7 @@ rb_stat_dev_minor(VALUE self)
/*
* call-seq:
- * stat.ino -> integer
+ * stat.ino -> fixnum
*
* Returns the inode number for <i>stat</i>.
*
@@ -611,13 +509,7 @@ rb_stat_dev_minor(VALUE self)
static VALUE
rb_stat_ino(VALUE self)
{
-#ifdef HAVE_STRUCT_STAT_ST_INOHIGH
- /* assume INTEGER_PACK_LSWORD_FIRST and st_inohigh is just next of st_ino */
- return rb_integer_unpack(&get_stat(self)->st_ino, 2,
- SIZEOF_STRUCT_STAT_ST_INO, 0,
- INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER|
- INTEGER_PACK_2COMP);
-#elif SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG
+#if SIZEOF_STRUCT_STAT_ST_INO > SIZEOF_LONG
return ULL2NUM(get_stat(self)->st_ino);
#else
return ULONG2NUM(get_stat(self)->st_ino);
@@ -626,7 +518,7 @@ rb_stat_ino(VALUE self)
/*
* call-seq:
- * stat.mode -> integer
+ * stat.mode -> fixnum
*
* Returns an integer representing the permission bits of
* <i>stat</i>. The meaning of the bits is platform dependent; on
@@ -645,7 +537,7 @@ rb_stat_mode(VALUE self)
/*
* call-seq:
- * stat.nlink -> integer
+ * stat.nlink -> fixnum
*
* Returns the number of hard links to <i>stat</i>.
*
@@ -663,7 +555,7 @@ rb_stat_nlink(VALUE self)
/*
* call-seq:
- * stat.uid -> integer
+ * stat.uid -> fixnum
*
* Returns the numeric user id of the owner of <i>stat</i>.
*
@@ -679,7 +571,7 @@ rb_stat_uid(VALUE self)
/*
* call-seq:
- * stat.gid -> integer
+ * stat.gid -> fixnum
*
* Returns the numeric group id of the owner of <i>stat</i>.
*
@@ -695,7 +587,7 @@ rb_stat_gid(VALUE self)
/*
* call-seq:
- * stat.rdev -> integer or nil
+ * stat.rdev -> fixnum or nil
*
* Returns an integer representing the device type on which
* <i>stat</i> resides. Returns <code>nil</code> if the operating
@@ -717,7 +609,7 @@ rb_stat_rdev(VALUE self)
/*
* call-seq:
- * stat.rdev_major -> integer
+ * stat.rdev_major -> fixnum
*
* Returns the major part of <code>File_Stat#rdev</code> or
* <code>nil</code>.
@@ -738,7 +630,7 @@ rb_stat_rdev_major(VALUE self)
/*
* call-seq:
- * stat.rdev_minor -> integer
+ * stat.rdev_minor -> fixnum
*
* Returns the minor part of <code>File_Stat#rdev</code> or
* <code>nil</code>.
@@ -759,7 +651,7 @@ rb_stat_rdev_minor(VALUE self)
/*
* call-seq:
- * stat.size -> integer
+ * stat.size -> fixnum
*
* Returns the size of <i>stat</i> in bytes.
*
@@ -828,7 +720,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 = (long)st->st_atimensec;
+ ts.tv_nsec = st->st_atimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -852,7 +744,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 = (long)st->st_mtimensec;
+ ts.tv_nsec = st->st_mtimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -876,7 +768,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 = (long)st->st_ctimensec;
+ ts.tv_nsec = st->st_ctimensec;
#else
ts.tv_nsec = 0;
#endif
@@ -963,8 +855,7 @@ rb_stat_ctime(VALUE self)
* stat.birthtime -> aTime
*
* Returns the birth time for <i>stat</i>.
- *
- * If the platform doesn't have birthtime, raises NotImplementedError.
+ * If the platform doesn't have birthtime, returns <i>ctime</i>.
*
* File.write("testfile", "foo")
* sleep 10
@@ -1066,73 +957,65 @@ rb_stat_inspect(VALUE self)
return str;
}
-typedef struct no_gvl_stat_data {
- struct stat *st;
- union {
- const char *path;
- int fd;
- } file;
-} no_gvl_stat_data;
-
-static VALUE
-no_gvl_fstat(void *data)
-{
- no_gvl_stat_data *arg = data;
- return (VALUE)fstat(arg->file.fd, arg->st);
-}
-
static int
-fstat_without_gvl(int fd, struct stat *st)
-{
- no_gvl_stat_data data;
-
- data.file.fd = fd;
- data.st = st;
-
- return (int)(VALUE)rb_thread_io_blocking_region(no_gvl_fstat, &data, fd);
-}
-
-static void *
-no_gvl_stat(void * data)
-{
- no_gvl_stat_data *arg = data;
- return (void *)(VALUE)STAT(arg->file.path, arg->st);
-}
-
-static int
-stat_without_gvl(const char *path, struct stat *st)
+rb_stat(VALUE file, struct stat *st)
{
- no_gvl_stat_data data;
+ VALUE tmp;
- data.file.path = path;
- data.st = st;
+ rb_secure(2);
+ tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
+ if (!NIL_P(tmp)) {
+ rb_io_t *fptr;
- return (int)(VALUE)rb_thread_call_without_gvl(no_gvl_stat, &data,
- RUBY_UBF_IO, NULL);
+ GetOpenFile(tmp, fptr);
+ return fstat(fptr->fd, st);
+ }
+ FilePathValue(file);
+ file = rb_str_encode_ospath(file);
+ return STAT(StringValueCStr(file), st);
}
-static int
-rb_stat(VALUE file, struct stat *st)
+#ifdef _WIN32
+static HANDLE
+w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
{
VALUE tmp;
- int result;
+ HANDLE f, ret = 0;
- tmp = rb_check_convert_type_with_id(file, T_FILE, "IO", idTo_io);
+ tmp = rb_check_convert_type(*file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
rb_io_t *fptr;
GetOpenFile(tmp, fptr);
- result = fstat_without_gvl(fptr->fd, st);
- file = tmp;
+ f = (HANDLE)rb_w32_get_osfhandle(fptr->fd);
+ if (f == (HANDLE)-1) return INVALID_HANDLE_VALUE;
}
else {
- FilePathValue(file);
- file = rb_str_encode_ospath(file);
- result = stat_without_gvl(RSTRING_PTR(file), st);
+ VALUE tmp;
+ WCHAR *ptr;
+ int len;
+ VALUE v;
+
+ FilePathValue(*file);
+ tmp = rb_str_encode_ospath(*file);
+ len = MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, NULL, 0);
+ ptr = ALLOCV_N(WCHAR, v, len);
+ MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, ptr, len);
+ f = CreateFileW(ptr, 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ ALLOCV_END(v);
+ if (f == INVALID_HANDLE_VALUE) return f;
+ ret = f;
}
- RB_GC_GUARD(file);
- return result;
+ if (GetFileType(f) == FILE_TYPE_DISK) {
+ ZeroMemory(st, sizeof(*st));
+ if (GetFileInformationByHandle(f, st)) return ret;
+ }
+ if (ret) CloseHandle(ret);
+ return INVALID_HANDLE_VALUE;
}
+#endif
/*
* call-seq:
@@ -1151,8 +1034,7 @@ rb_file_s_stat(VALUE klass, VALUE fname)
struct stat st;
FilePathValue(fname);
- fname = rb_str_encode_ospath(fname);
- if (stat_without_gvl(RSTRING_PTR(fname), &st) < 0) {
+ if (rb_stat(fname, &st) < 0) {
rb_sys_fail_path(fname);
}
return rb_stat_new(&st);
@@ -1186,27 +1068,6 @@ rb_io_stat(VALUE obj)
return rb_stat_new(&st);
}
-#ifdef HAVE_LSTAT
-static void *
-no_gvl_lstat(void *ptr)
-{
- no_gvl_stat_data *arg = ptr;
- return (void *)(VALUE)lstat(arg->file.path, arg->st);
-}
-
-static int
-lstat_without_gvl(const char *path, struct stat *st)
-{
- no_gvl_stat_data data;
-
- data.file.path = path;
- data.st = st;
-
- return (int)(VALUE)rb_thread_call_without_gvl(no_gvl_lstat, &data,
- RUBY_UBF_IO, NULL);
-}
-#endif /* HAVE_LSTAT */
-
/*
* call-seq:
* File.lstat(file_name) -> stat
@@ -1227,9 +1088,10 @@ 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_without_gvl(StringValueCStr(fname), &st) == -1) {
+ if (lstat(StringValueCStr(fname), &st) == -1) {
rb_sys_fail_path(fname);
}
return rb_stat_new(&st);
@@ -1260,10 +1122,11 @@ 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);
- if (lstat_without_gvl(RSTRING_PTR(path), &st) == -1) {
+ if (lstat(RSTRING_PTR(path), &st) == -1) {
rb_sys_fail_path(fptr->pathv);
}
return rb_stat_new(&st);
@@ -1275,7 +1138,7 @@ rb_file_lstat(VALUE obj)
static int
rb_group_member(GETGROUPS_T gid)
{
-#if defined(_WIN32) || !defined(HAVE_GETGROUPS)
+#ifdef _WIN32
return FALSE;
#else
int rv = FALSE;
@@ -1371,54 +1234,6 @@ eaccess(const char *path, int mode)
}
#endif
-struct access_arg {
- const char *path;
- int mode;
-};
-
-static void *
-nogvl_eaccess(void *ptr)
-{
- struct access_arg *aa = ptr;
-
- return (void *)(VALUE)eaccess(aa->path, aa->mode);
-}
-
-static int
-rb_eaccess(VALUE fname, int mode)
-{
- struct access_arg aa;
-
- FilePathValue(fname);
- fname = rb_str_encode_ospath(fname);
- aa.path = StringValueCStr(fname);
- aa.mode = mode;
-
- return (int)(VALUE)rb_thread_call_without_gvl(nogvl_eaccess, &aa,
- RUBY_UBF_IO, 0);
-}
-
-static void *
-nogvl_access(void *ptr)
-{
- struct access_arg *aa = ptr;
-
- return (void *)(VALUE)access(aa->path, aa->mode);
-}
-
-static int
-rb_access(VALUE fname, int mode)
-{
- struct access_arg aa;
-
- FilePathValue(fname);
- fname = rb_str_encode_ospath(fname);
- aa.path = StringValueCStr(fname);
- aa.mode = mode;
-
- return (int)(VALUE)rb_thread_call_without_gvl(nogvl_access, &aa,
- RUBY_UBF_IO, 0);
-}
/*
* Document-class: FileTest
@@ -1512,9 +1327,10 @@ 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_without_gvl(StringValueCStr(fname), &st) < 0) return Qfalse;
+ if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse;
if (S_ISLNK(st.st_mode)) return Qtrue;
#endif
@@ -1657,13 +1473,16 @@ 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 and group id of this process. See eaccess(3).
+ * user id of this process.
*/
static VALUE
rb_file_readable_p(VALUE obj, VALUE fname)
{
- if (rb_eaccess(fname, R_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1672,13 +1491,16 @@ 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 and group id of this process. See access(3).
+ * user id of this process.
*/
static VALUE
rb_file_readable_real_p(VALUE obj, VALUE fname)
{
- if (rb_access(fname, R_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1692,7 +1514,7 @@ rb_file_readable_real_p(VALUE obj, VALUE fname)
/*
* call-seq:
- * File.world_readable?(file_name) -> integer or nil
+ * File.world_readable?(file_name) -> fixnum or nil
*
* If <i>file_name</i> is readable by others, returns an integer
* representing the file permission bits of <i>file_name</i>. Returns
@@ -1725,13 +1547,16 @@ 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 and group id of this process. See eaccess(3).
+ * user id of this process.
*/
static VALUE
rb_file_writable_p(VALUE obj, VALUE fname)
{
- if (rb_eaccess(fname, W_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1740,19 +1565,22 @@ 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 and group id of this process. See access(3)
+ * user id of this process.
*/
static VALUE
rb_file_writable_real_p(VALUE obj, VALUE fname)
{
- if (rb_access(fname, W_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse;
return Qtrue;
}
/*
* call-seq:
- * File.world_writable?(file_name) -> integer or nil
+ * File.world_writable?(file_name) -> fixnum or nil
*
* If <i>file_name</i> is writable by others, returns an integer
* representing the file permission bits of <i>file_name</i>. Returns
@@ -1785,13 +1613,16 @@ 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 and group id of this process. See eaccess(3).
+ * user id of this process.
*/
static VALUE
rb_file_executable_p(VALUE obj, VALUE fname)
{
- if (rb_eaccess(fname, X_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (eaccess(StringValueCStr(fname), X_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1800,13 +1631,16 @@ 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 and group id of this process. See access(3).
+ * user id of this process.
*/
static VALUE
rb_file_executable_real_p(VALUE obj, VALUE fname)
{
- if (rb_access(fname, X_OK) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse;
return Qtrue;
}
@@ -1936,7 +1770,10 @@ check3rdbyte(VALUE fname, int mode)
{
struct stat st;
- if (rb_stat(fname, &st) < 0) return Qfalse;
+ rb_secure(2);
+ FilePathValue(fname);
+ fname = rb_str_encode_ospath(fname);
+ if (STAT(StringValueCStr(fname), &st) < 0) return Qfalse;
if (st.st_mode & mode) return Qtrue;
return Qfalse;
}
@@ -2015,18 +1852,49 @@ rb_file_sticky_p(VALUE obj, VALUE fname)
static VALUE
rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
{
-#ifndef _WIN32
+#ifndef DOSISH
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
- extern VALUE rb_w32_file_identical_p(VALUE, VALUE);
- return rb_w32_file_identical_p(fname1, fname2);
+# 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 (f2 == INVALID_HANDLE_VALUE) return Qfalse;
+ if (f2) CloseHandle(f2);
+
+ if (st1.dwVolumeSerialNumber == st2.dwVolumeSerialNumber &&
+ 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;
#endif
+ return Qtrue;
}
/*
@@ -2044,9 +1912,8 @@ rb_file_s_size(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
- int e = errno;
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
return OFFT2NUM(st.st_size);
}
@@ -2112,9 +1979,10 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
{
struct stat st;
+ rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
- if (lstat_without_gvl(StringValueCStr(fname), &st) == -1) {
+ if (lstat(StringValueCStr(fname), &st) == -1) {
rb_sys_fail_path(fname);
}
@@ -2125,7 +1993,7 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
* call-seq:
* File.atime(file_name) -> time
*
- * Returns the last access time for the named file as a Time object.
+ * Returns the last access time for the named file as a Time object).
*
* _file_name_ can be an IO object.
*
@@ -2139,9 +2007,8 @@ rb_file_s_atime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
- int e = errno;
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
return stat_atime(&st);
}
@@ -2151,7 +2018,7 @@ rb_file_s_atime(VALUE klass, VALUE fname)
* file.atime -> time
*
* Returns the last access time (a <code>Time</code> object)
- * for <i>file</i>, or epoch if <i>file</i> has not been accessed.
+ * for <i>file</i>, or epoch if <i>file</i> has not been accessed.
*
* File.new("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
*
@@ -2188,9 +2055,8 @@ rb_file_s_mtime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
- int e = errno;
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
return stat_mtime(&st);
}
@@ -2240,9 +2106,8 @@ rb_file_s_ctime(VALUE klass, VALUE fname)
struct stat st;
if (rb_stat(fname, &st) < 0) {
- int e = errno;
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
return stat_ctime(&st);
}
@@ -2282,9 +2147,9 @@ rb_file_ctime(VALUE obj)
*
* _file_name_ can be an IO object.
*
- * File.birthtime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
+ * Note that on Windows (NTFS), returns creation time (birth time).
*
- * If the platform doesn't have birthtime, raises NotImplementedError.
+ * File.birthtime("testfile") #=> Wed Apr 09 08:53:13 CDT 2003
*
*/
@@ -2294,9 +2159,8 @@ 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);
+ rb_sys_fail_path(fname);
}
return stat_birthtime(&st);
}
@@ -2311,9 +2175,9 @@ rb_file_s_birthtime(VALUE klass, VALUE fname)
*
* Returns the birth time for <i>file</i>.
*
- * File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
+ * Note that on Windows (NTFS), returns creation time (birth time).
*
- * If the platform doesn't have birthtime, raises NotImplementedError.
+ * File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
*
*/
@@ -2359,10 +2223,11 @@ rb_file_size(VALUE obj)
return OFFT2NUM(st.st_size);
}
-static int
-chmod_internal(const char *path, void *mode)
+static void
+chmod_internal(const char *path, VALUE pathv, void *mode)
{
- return chmod(path, *(mode_t *)mode);
+ if (chmod(path, *(int *)mode) < 0)
+ rb_sys_fail_path(pathv);
}
/*
@@ -2381,12 +2246,17 @@ chmod_internal(const char *path, void *mode)
static VALUE
rb_file_s_chmod(int argc, VALUE *argv)
{
- mode_t mode;
+ VALUE vmode;
+ VALUE rest;
+ int mode;
+ long n;
- apply2args(1);
- mode = NUM2MODET(*argv++);
+ rb_secure(2);
+ rb_scan_args(argc, argv, "1*", &vmode, &rest);
+ mode = NUM2INT(vmode);
- return apply2files(chmod_internal, argc, argv, &mode);
+ n = apply2files(chmod_internal, rest, &mode);
+ return LONG2FIX(n);
}
/*
@@ -2407,23 +2277,18 @@ rb_file_chmod(VALUE obj, VALUE vmode)
{
rb_io_t *fptr;
int mode;
-#if !defined HAVE_FCHMOD || !HAVE_FCHMOD
+#ifndef HAVE_FCHMOD
VALUE path;
#endif
+ rb_secure(2);
mode = NUM2INT(vmode);
GetOpenFile(obj, fptr);
#ifdef HAVE_FCHMOD
- 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 (fchmod(fptr->fd, mode) == -1)
+ rb_sys_fail_path(fptr->pathv);
+#else
if (NIL_P(fptr->pathv)) return Qnil;
path = rb_str_encode_ospath(fptr->pathv);
if (chmod(RSTRING_PTR(path), mode) == -1)
@@ -2434,10 +2299,11 @@ rb_file_chmod(VALUE obj, VALUE vmode)
}
#if defined(HAVE_LCHMOD)
-static int
-lchmod_internal(const char *path, void *mode)
+static void
+lchmod_internal(const char *path, VALUE pathv, void *mode)
{
- return lchmod(path, *(mode_t *)mode);
+ if (lchmod(path, (int)(VALUE)mode) < 0)
+ rb_sys_fail_path(pathv);
}
/*
@@ -2453,12 +2319,16 @@ lchmod_internal(const char *path, void *mode)
static VALUE
rb_file_s_lchmod(int argc, VALUE *argv)
{
- mode_t mode;
+ VALUE vmode;
+ VALUE rest;
+ long mode, n;
- apply2args(1);
- mode = NUM2MODET(*argv++);
+ rb_secure(2);
+ rb_scan_args(argc, argv, "1*", &vmode, &rest);
+ mode = NUM2INT(vmode);
- return apply2files(lchmod_internal, argc, argv, &mode);
+ n = apply2files(lchmod_internal, rest, (void *)(long)mode);
+ return LONG2FIX(n);
}
#else
#define rb_file_s_lchmod rb_f_notimplement
@@ -2487,11 +2357,12 @@ struct chown_args {
rb_gid_t group;
};
-static int
-chown_internal(const char *path, void *arg)
+static void
+chown_internal(const char *path, VALUE pathv, void *arg)
{
struct chown_args *args = arg;
- return chown(path, args->owner, args->group);
+ if (chown(path, args->owner, args->group) < 0)
+ rb_sys_fail_path(pathv);
}
/*
@@ -2512,13 +2383,17 @@ chown_internal(const char *path, void *arg)
static VALUE
rb_file_s_chown(int argc, VALUE *argv)
{
+ VALUE o, g, rest;
struct chown_args arg;
+ long n;
- apply2args(2);
- arg.owner = to_uid(*argv++);
- arg.group = to_gid(*argv++);
+ rb_secure(2);
+ rb_scan_args(argc, argv, "2*", &o, &g, &rest);
+ arg.owner = to_uid(o);
+ arg.group = to_gid(g);
- return apply2files(chown_internal, argc, argv, &arg);
+ n = apply2files(chown_internal, rest, &arg);
+ return LONG2FIX(n);
}
/*
@@ -2546,6 +2421,7 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
VALUE path;
#endif
+ rb_secure(2);
o = to_uid(owner);
g = to_gid(group);
GetOpenFile(obj, fptr);
@@ -2563,11 +2439,12 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
}
#if defined(HAVE_LCHOWN)
-static int
-lchown_internal(const char *path, void *arg)
+static void
+lchown_internal(const char *path, VALUE pathv, void *arg)
{
struct chown_args *args = arg;
- return lchown(path, args->owner, args->group);
+ if (lchown(path, args->owner, args->group) < 0)
+ rb_sys_fail_path(pathv);
}
/*
@@ -2584,13 +2461,17 @@ lchown_internal(const char *path, void *arg)
static VALUE
rb_file_s_lchown(int argc, VALUE *argv)
{
+ VALUE o, g, rest;
struct chown_args arg;
+ long n;
- apply2args(2);
- arg.owner = to_uid(*argv++);
- arg.group = to_gid(*argv++);
+ rb_secure(2);
+ rb_scan_args(argc, argv, "2*", &o, &g, &rest);
+ arg.owner = to_uid(o);
+ arg.group = to_gid(g);
- return apply2files(lchown_internal, argc, argv, &arg);
+ n = apply2files(lchown_internal, rest, &arg);
+ return LONG2FIX(n);
}
#else
#define rb_file_s_lchown rb_f_notimplement
@@ -2599,25 +2480,17 @@ rb_file_s_lchown(int argc, VALUE *argv)
struct utime_args {
const struct timespec* tsp;
VALUE atime, mtime;
- int follow; /* Whether to act on symlinks (1) or their referent (0) */
};
-#ifdef UTIME_EINVAL
-NORETURN(static void utime_failed(struct apply_arg *));
+#if defined DOSISH || defined __CYGWIN__
+NORETURN(static void utime_failed(VALUE, const struct timespec *, VALUE, VALUE));
static void
-utime_failed(struct apply_arg *aa)
+utime_failed(VALUE path, const struct timespec *tsp, VALUE atime, VALUE mtime)
{
- int e = aa->errnum;
- VALUE path = aa->fn[aa->i].path;
- struct utime_args *ua = aa->arg;
-
- if (ua->tsp && e == EINVAL) {
+ if (tsp && errno == EINVAL) {
VALUE e[2], a = Qnil, m = Qnil;
int d = 0;
- VALUE atime = ua->atime;
- VALUE mtime = ua->mtime;
-
if (!NIL_P(atime)) {
a = rb_inspect(atime);
}
@@ -2639,48 +2512,35 @@ utime_failed(struct apply_arg *aa)
e[1] = INT2FIX(EINVAL);
rb_exc_raise(rb_class_new_instance(2, e, rb_eSystemCallError));
}
+ errno = EINVAL;
}
- rb_syserr_fail_path(e, path);
+ rb_sys_fail_path(path);
}
+#else
+#define utime_failed(path, tsp, atime, mtime) rb_sys_fail_path(path)
#endif
#if defined(HAVE_UTIMES)
-static int
-utime_internal(const char *path, void *arg)
+static void
+utime_internal(const char *path, VALUE pathv, void *arg)
{
struct utime_args *v = arg;
const struct timespec *tsp = v->tsp;
struct timeval tvbuf[2], *tvp = NULL;
-#if defined(HAVE_UTIMENSAT)
+#ifdef HAVE_UTIMENSAT
static int try_utimensat = 1;
-# ifdef AT_SYMLINK_NOFOLLOW
- static int try_utimensat_follow = 1;
-# else
- const int try_utimensat_follow = 0;
-# endif
- int flags = 0;
- if (v->follow ? try_utimensat_follow : try_utimensat) {
-# ifdef AT_SYMLINK_NOFOLLOW
- if (v->follow) {
- flags = AT_SYMLINK_NOFOLLOW;
- }
-# endif
-
- if (utimensat(AT_FDCWD, path, tsp, flags) < 0) {
+ if (try_utimensat) {
+ if (utimensat(AT_FDCWD, path, tsp, 0) < 0) {
if (errno == ENOSYS) {
-# ifdef AT_SYMLINK_NOFOLLOW
- try_utimensat_follow = 0;
-# endif
- if (!v->follow)
- try_utimensat = 0;
+ try_utimensat = 0;
goto no_utimensat;
}
- return -1; /* calls utime_failed */
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
- return 0;
+ return;
}
no_utimensat:
#endif
@@ -2692,10 +2552,8 @@ no_utimensat:
tvbuf[1].tv_usec = (int)(tsp[1].tv_nsec / 1000);
tvp = tvbuf;
}
-#ifdef HAVE_LUTIMES
- if (v->follow) return lutimes(path, tvp);
-#endif
- return utimes(path, tvp);
+ if (utimes(path, tvp) < 0)
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
#else
@@ -2707,8 +2565,8 @@ struct utimbuf {
};
#endif
-static int
-utime_internal(const char *path, void *arg)
+static void
+utime_internal(const char *path, VALUE pathv, void *arg)
{
struct utime_args *v = arg;
const struct timespec *tsp = v->tsp;
@@ -2718,84 +2576,46 @@ utime_internal(const char *path, void *arg)
utbuf.modtime = tsp[1].tv_sec;
utp = &utbuf;
}
- return utime(path, utp);
+ if (utime(path, utp) < 0)
+ utime_failed(pathv, tsp, v->atime, v->mtime);
}
#endif
-static VALUE
-utime_internal_i(int argc, VALUE *argv, int follow)
-{
- struct utime_args args;
- struct timespec tss[2], *tsp = NULL;
-
- apply2args(2);
- args.atime = *argv++;
- args.mtime = *argv++;
-
- args.follow = follow;
-
- if (!NIL_P(args.atime) || !NIL_P(args.mtime)) {
- tsp = tss;
- tsp[0] = rb_time_timespec(args.atime);
- if (args.atime == args.mtime)
- tsp[1] = tsp[0];
- else
- tsp[1] = rb_time_timespec(args.mtime);
- }
- args.tsp = tsp;
-
- return apply2files(utime_internal, argc, argv, &args);
-}
-
/*
* call-seq:
* File.utime(atime, mtime, file_name,...) -> integer
*
- * Sets the access and modification times of each named file to the
- * first two arguments. If a file is a symlink, this method acts upon
- * its referent rather than the link itself; for the inverse
- * behavior see File.lutime. Returns the number of file
- * names in the argument list.
+ * Sets the access and modification times of each
+ * named file to the first two arguments. Returns
+ * the number of file names in the argument list.
*/
static VALUE
rb_file_s_utime(int argc, VALUE *argv)
{
- return utime_internal_i(argc, argv, FALSE);
-}
+ VALUE rest;
+ struct utime_args args;
+ struct timespec tss[2], *tsp = NULL;
+ long n;
-#if defined(HAVE_UTIMES) && (defined(HAVE_LUTIMES) || (defined(HAVE_UTIMENSAT) && defined(AT_SYMLINK_NOFOLLOW)))
+ rb_secure(2);
+ rb_scan_args(argc, argv, "2*", &args.atime, &args.mtime, &rest);
-/*
- * call-seq:
- * File.lutime(atime, mtime, file_name,...) -> integer
- *
- * Sets the access and modification times of each named file to the
- * first two arguments. If a file is a symlink, this method acts upon
- * the link itself as opposed to its referent; for the inverse
- * behavior, see File.utime. Returns the number of file
- * names in the argument list.
- */
+ 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);
+ }
+ args.tsp = tsp;
-static VALUE
-rb_file_s_lutime(int argc, VALUE *argv)
-{
- return utime_internal_i(argc, argv, TRUE);
+ n = apply2files(utime_internal, rest, &args);
+ return LONG2FIX(n);
}
-#else
-#define rb_file_s_lutime rb_f_notimplement
-#endif
-#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));
+NORETURN(static void sys_fail2(VALUE,VALUE));
static void
-syserr_fail2_in(const char *func, int e, VALUE s1, VALUE s2)
+sys_fail2(VALUE s1, VALUE s2)
{
VALUE str;
#ifdef MAX_PATH
@@ -2804,19 +2624,15 @@ syserr_fail2_in(const char *func, int e, VALUE s1, VALUE s2)
const int max_pathlen = MAXPATHLEN;
#endif
- if (e == EEXIST) {
- rb_syserr_fail_path(e, rb_str_ellipsize(s2, max_pathlen));
+ if (errno == EEXIST) {
+ rb_sys_fail_path(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, ")");
-#ifdef RUBY_FUNCTION_NAME_STRING
- rb_syserr_fail_path_in(func, e, str);
-#else
- rb_syserr_fail_path(e, str);
-#endif
+ rb_sys_fail_path(str);
}
#ifdef HAVE_LINK
@@ -2835,6 +2651,7 @@ syserr_fail2_in(const char *func, int e, 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);
@@ -2865,6 +2682,7 @@ 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);
@@ -2880,6 +2698,8 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
#endif
#ifdef HAVE_READLINK
+static VALUE rb_readlink(VALUE path);
+
/*
* call-seq:
* File.readlink(link_name) -> file_name
@@ -2894,48 +2714,21 @@ rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_readlink(VALUE klass, VALUE path)
{
- return rb_readlink(path, rb_filesystem_encoding());
-}
-
-#ifndef _WIN32
-struct readlink_arg {
- const char *path;
- char *buf;
- size_t size;
-};
-
-static void *
-nogvl_readlink(void *ptr)
-{
- struct readlink_arg *ra = ptr;
-
- return (void *)(VALUE)readlink(ra->path, ra->buf, ra->size);
-}
-
-static ssize_t
-readlink_without_gvl(VALUE path, VALUE buf, size_t size)
-{
- struct readlink_arg ra;
-
- ra.path = RSTRING_PTR(path);
- ra.buf = RSTRING_PTR(buf);
- ra.size = size;
-
- return (ssize_t)rb_thread_call_without_gvl(nogvl_readlink, &ra,
- RUBY_UBF_IO, 0);
+ return rb_readlink(path);
}
-VALUE
-rb_readlink(VALUE path, rb_encoding *enc)
+static VALUE
+rb_readlink(VALUE path)
{
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, enc);
- while ((rv = readlink_without_gvl(path, v, size)) == size
+ v = rb_enc_str_new(0, size, rb_filesystem_encoding());
+ while ((rv = readlink(RSTRING_PTR(path), RSTRING_PTR(v), size)) == size
#ifdef _AIX
|| (rv < 0 && errno == ERANGE) /* quirky behavior of GPFS */
#endif
@@ -2945,23 +2738,22 @@ rb_readlink(VALUE path, rb_encoding *enc)
rb_str_set_len(v, size);
}
if (rv < 0) {
- int e = errno;
rb_str_resize(v, 0);
- rb_syserr_fail_path(e, path);
+ rb_sys_fail_path(path);
}
rb_str_resize(v, rv);
return v;
}
-#endif
#else
#define rb_file_s_readlink rb_f_notimplement
#endif
-static int
-unlink_internal(const char *path, void *arg)
+static void
+unlink_internal(const char *path, VALUE pathv, void *arg)
{
- return unlink(path);
+ if (unlink(path) < 0)
+ rb_sys_fail_path(pathv);
}
/*
@@ -2971,32 +2763,17 @@ unlink_internal(const char *path, void *arg)
*
* Deletes the named files, returning the number of names
* passed as arguments. Raises an exception on any error.
- * Since the underlying implementation relies on the
- * <code>unlink(2)</code> system call, the type of
- * exception raised depends on its error type (see
- * https://linux.die.net/man/2/unlink) and has the form of
- * e.g. <code>Errno::ENOENT</code>.
- *
* See also <code>Dir::rmdir</code>.
*/
static VALUE
-rb_file_s_unlink(int argc, VALUE *argv, VALUE klass)
+rb_file_s_unlink(VALUE klass, VALUE args)
{
- return apply2files(unlink_internal, argc, argv, 0);
-}
-
-struct rename_args {
- const char *src;
- const char *dst;
-};
+ long n;
-static void *
-no_gvl_rename(void *ptr)
-{
- struct rename_args *ra = ptr;
-
- return (void *)(VALUE)rename(ra->src, ra->dst);
+ rb_secure(2);
+ n = apply2files(unlink_internal, args, 0);
+ return LONG2FIX(n);
}
/*
@@ -3012,31 +2789,33 @@ no_gvl_rename(void *ptr)
static VALUE
rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
{
- struct rename_args ra;
+ const char *src, *dst;
VALUE f, t;
+ rb_secure(2);
FilePathValue(from);
FilePathValue(to);
f = rb_str_encode_ospath(from);
t = rb_str_encode_ospath(to);
- ra.src = StringValueCStr(f);
- ra.dst = StringValueCStr(t);
+ src = StringValueCStr(f);
+ dst = StringValueCStr(t);
#if defined __CYGWIN__
errno = 0;
#endif
- if ((int)(VALUE)rb_thread_call_without_gvl(no_gvl_rename, &ra,
- RUBY_UBF_IO, 0) < 0) {
- int e = errno;
+ if (rename(src, dst) < 0) {
#if defined DOSISH
- switch (e) {
+ switch (errno) {
case EEXIST:
- if (chmod(ra.dst, 0666) == 0 &&
- unlink(ra.dst) == 0 &&
- rename(ra.src, ra.dst) == 0)
+#if defined (__EMX__)
+ case EACCES:
+#endif
+ if (chmod(dst, 0666) == 0 &&
+ unlink(dst) == 0 &&
+ rename(src, dst) == 0)
return INT2FIX(0);
}
#endif
- syserr_fail2(e, from, to);
+ sys_fail2(from, to);
}
return INT2FIX(0);
@@ -3060,19 +2839,20 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_umask(int argc, VALUE *argv)
{
- mode_t omask = 0;
+ int omask = 0;
+ rb_secure(2);
if (argc == 0) {
omask = umask(0);
umask(omask);
}
else if (argc == 1) {
- omask = umask(NUM2MODET(argv[0]));
+ omask = umask(NUM2INT(argv[0]));
}
else {
rb_check_arity(argc, 0, 1);
}
- return MODET2NUM(omask);
+ return INT2FIX(omask);
}
#ifdef __CYGWIN__
@@ -3085,38 +2865,24 @@ rb_file_s_umask(int argc, VALUE *argv)
#endif
#ifdef FILE_ALT_SEPARATOR
#define isdirsep(x) ((x) == '/' || (x) == FILE_ALT_SEPARATOR)
-# ifdef DOSISH
static const char file_alt_separator[] = {FILE_ALT_SEPARATOR, '\0'};
-# endif
#else
#define isdirsep(x) ((x) == '/')
#endif
#ifndef USE_NTFS
-#if defined _WIN32
+#if defined _WIN32 || defined __CYGWIN__
#define USE_NTFS 1
#else
#define USE_NTFS 0
#endif
#endif
-#ifndef USE_NTFS_ADS
-# if USE_NTFS
-# define USE_NTFS_ADS 1
-# else
-# define USE_NTFS_ADS 0
-# endif
-#endif
#if USE_NTFS
#define istrailinggarbage(x) ((x) == '.' || (x) == ' ')
#else
#define istrailinggarbage(x) 0
#endif
-#if USE_NTFS_ADS
-# define isADS(x) ((x) == ':')
-#else
-# define isADS(x) 0
-#endif
#define Next(p, e, enc) ((p) + rb_enc_mbclen((p), (e), (enc)))
#define Inc(p, e, enc) ((p) = Next((p), (e), (enc)))
@@ -3154,9 +2920,9 @@ getcwdofdrv(int drv)
of a particular drive is to change chdir() to that drive,
so save the old cwd before chdir()
*/
- oldcwd = ruby_getcwd();
+ oldcwd = my_getcwd();
if (chdir(drive) == 0) {
- drvcwd = ruby_getcwd();
+ drvcwd = my_getcwd();
chdir(oldcwd);
xfree(oldcwd);
}
@@ -3287,17 +3053,17 @@ static char *
ntfs_tail(const char *path, const char *end, rb_encoding *enc)
{
while (path < end && *path == '.') path++;
- while (path < end && !isADS(*path)) {
+ while (path < end && *path != ':') {
if (istrailinggarbage(*path)) {
const char *last = path++;
while (path < end && istrailinggarbage(*path)) path++;
- if (path >= end || isADS(*path)) return (char *)last;
+ if (path >= end || *path == ':') return (char *)last;
}
else if (isdirsep(*path)) {
const char *last = path++;
while (path < end && isdirsep(*path)) path++;
if (path >= end) return (char *)last;
- if (isADS(*path)) path++;
+ if (*path == ':') path++;
}
else {
Inc(path, end, enc);
@@ -3323,45 +3089,22 @@ 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;
- int encidx;
+ rb_encoding *enc;
dirlen = strlen(dir);
rb_str_resize(result, dirlen);
memcpy(buf = RSTRING_PTR(result), dir, dirlen);
- encidx = rb_filesystem_encindex();
- rb_enc_associate_index(result, encidx);
+ enc = rb_filesystem_encoding();
+ rb_enc_associate(result, enc);
#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 = '/';
@@ -3375,84 +3118,30 @@ VALUE
rb_home_dir_of(VALUE user, VALUE result)
{
#ifdef HAVE_PWD_H
- struct passwd *pwPtr;
-#else
- extern char *getlogin(void);
- const char *pwPtr = 0;
- # define endpwent() ((void)0)
-#endif
- const char *dir, *username = RSTRING_PTR(user);
- rb_encoding *enc = rb_enc_get(user);
-#if defined _WIN32
- rb_encoding *fsenc = rb_utf8_encoding();
-#else
- rb_encoding *fsenc = rb_filesystem_encoding();
-#endif
- if (enc != fsenc) {
- dir = username = RSTRING_PTR(rb_str_conv_enc(user, enc, fsenc));
- }
-
-#ifdef HAVE_PWD_H
- pwPtr = getpwnam(username);
-#else
- if (strcasecmp(username, getlogin()) == 0)
- dir = pwPtr = getenv("HOME");
-#endif
+ struct passwd *pwPtr = getpwnam(RSTRING_PTR(user));
if (!pwPtr) {
endpwent();
+#endif
rb_raise(rb_eArgError, "user %"PRIsVALUE" doesn't exist", user);
- }
#ifdef HAVE_PWD_H
- dir = pwPtr->pw_dir;
-#endif
- copy_home_path(result, dir);
+ }
+ copy_home_path(result, pwPtr->pw_dir);
endpwent();
+#endif
return result;
}
-#ifndef _WIN32
VALUE
rb_default_home_dir(VALUE result)
{
const char *dir = getenv("HOME");
-
-#if defined HAVE_PWD_H
- if (!dir) {
- const char *login = getlogin();
- if (login) {
- struct passwd *pw = getpwnam(login);
- if (pw) {
- copy_home_path(result, pw->pw_dir);
- endpwent();
- return result;
- }
- endpwent();
- rb_raise(rb_eArgError, "couldn't find HOME for login `%s' -- expanding `~'",
- login);
- }
- else {
- rb_raise(rb_eArgError, "couldn't find login name -- expanding `~'");
- }
- }
-#endif
if (!dir) {
rb_raise(rb_eArgError, "couldn't find HOME environment -- expanding `~'");
}
return copy_home_path(result, dir);
}
-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
-}
-
+#ifndef _WIN32
static char *
append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encoding *fsenc)
{
@@ -3460,15 +3149,12 @@ 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 (NORMALIZE_UTF8PATH || *enc != fsenc) {
- rb_encoding *direnc = rb_enc_check(fname, dirname = ospath_new(dir, dirlen, fsenc));
+ if (*enc != fsenc) {
+ rb_encoding *direnc = rb_enc_check(fname, dirname = rb_enc_str_new(dir, dirlen, fsenc));
if (direnc != fsenc) {
dirname = rb_str_conv_enc(dirname, fsenc, direnc);
RSTRING_GETMEM(dirname, cwdp, dirlen);
}
- else if (NORMALIZE_UTF8PATH) {
- RSTRING_GETMEM(dirname, cwdp, dirlen);
- }
*enc = direnc;
}
do {buflen *= 2;} while (dirlen > buflen);
@@ -3577,7 +3263,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
p = pend;
}
else {
- char *e = append_fspath(result, fname, ruby_getcwd(), &enc, fsenc);
+ char *e = append_fspath(result, fname, my_getcwd(), &enc, fsenc);
tainted = 1;
BUFINIT();
p = e;
@@ -3661,7 +3347,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
case ' ': {
const char *e = s;
while (s < fend && istrailinggarbage(*s)) s++;
- if (s >= fend) {
+ if (!*s) {
s = e;
goto endpath;
}
@@ -3674,25 +3360,17 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
case '\\':
#endif
if (s > b) {
- WITH_ROOTDIFF(BUFCOPY(b, 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;
*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;
}
@@ -3700,25 +3378,24 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
if (s > b) {
#if USE_NTFS
-# if USE_NTFS_ADS
static const char prime[] = ":$DATA";
enum {prime_len = sizeof(prime) -1};
-# endif
endpath:
-# if USE_NTFS_ADS
if (s > b + prime_len && strncasecmp(s - prime_len, prime, prime_len) == 0) {
/* alias of stream */
/* get rid of a bug of x64 VC++ */
- if (isADS(*(s - (prime_len+1)))) {
+ if (*(s - (prime_len+1)) == ':') {
s -= prime_len + 1; /* prime */
}
else if (memchr(b, ':', s - prime_len - b)) {
s -= prime_len; /* alternative */
}
}
-# endif
#endif
- BUFCOPY(b, s-b);
+ rb_str_set_len(result, p-buf+1);
+ BUFCHECK(bdiff + (s-b) >= buflen);
+ memcpy(++p, b, s-b);
+ p += s-b;
rb_str_set_len(result, p-buf);
}
if (p == skiproot(buf, p + !!*p, enc) - 1) p++;
@@ -3728,7 +3405,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;
- int encidx;
+ rb_encoding *enc;
WCHAR *wstr;
WIN32_FIND_DATAW wfd;
HANDLE h;
@@ -3745,7 +3422,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
struct stat st;
p = (char *)s;
len = strlen(p);
- if (lstat_without_gvl(buf, &st) == 0 && S_ISLNK(st.st_mode)) {
+ if (lstat(buf, &st) == 0 && S_ISLNK(st.st_mode)) {
is_symlink = 1;
if (len > 4 && STRCASECMP(p + len - 4, ".lnk") != 0) {
lnk_added = 1;
@@ -3781,15 +3458,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));
- encidx = ENCODING_GET(result);
+ enc = rb_enc_get(result);
tmp = result;
- if (encidx != ENCINDEX_UTF_8 && rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT) {
+ if (enc != rb_utf8_encoding() && rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT) {
tmp = rb_str_encode_ospath(result);
}
len = MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, NULL, 0);
wstr = ALLOCV_N(WCHAR, v, len);
MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, wstr, len);
- if (tmp != result) rb_str_set_len(tmp, 0);
+ if (tmp != result) rb_str_resize(tmp, 0);
h = FindFirstFileW(wstr, &wfd);
ALLOCV_END(v);
if (h != INVALID_HANDLE_VALUE) {
@@ -3807,16 +3484,14 @@ 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);
- if (tmp == result) {
+ 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);
BUFCHECK(bdiff + len >= buflen);
- 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();
+ memcpy(p, RSTRING_PTR(tmp), len);
rb_str_resize(tmp, 0);
}
p += len;
@@ -3903,8 +3578,14 @@ rb_file_expand_path_fast(VALUE fname, VALUE dname)
VALUE
rb_file_s_expand_path(int argc, const VALUE *argv)
{
- rb_check_arity(argc, 1, 2);
- return rb_file_expand_path(argv[0], argc > 1 ? argv[1] : Qnil);
+ VALUE fname, dname;
+
+ if (argc == 1) {
+ return rb_file_expand_path(argv[0], Qnil);
+ }
+ rb_scan_args(argc, argv, "11", &fname, &dname);
+
+ return rb_file_expand_path(fname, dname);
}
VALUE
@@ -3930,20 +3611,18 @@ rb_file_absolute_path(VALUE fname, VALUE dname)
VALUE
rb_file_s_absolute_path(int argc, const VALUE *argv)
{
- rb_check_arity(argc, 1, 2);
- return rb_file_absolute_path(argv[0], argc > 1 ? argv[1] : Qnil);
-}
+ VALUE fname, dname;
-enum rb_realpath_mode {
- RB_REALPATH_CHECK,
- RB_REALPATH_DIR,
- RB_REALPATH_STRICT,
- RB_REALPATH_MODE_MAX
-};
+ if (argc == 1) {
+ return rb_file_absolute_path(argv[0], Qnil);
+ }
+ rb_scan_args(argc, argv, "11", &fname, &dname);
-static int
-realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE fallback,
- VALUE loopcheck, enum rb_realpath_mode mode, int last)
+ return rb_file_absolute_path(fname, dname);
+}
+
+static void
+realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE loopcheck, int strict, int last)
{
const char *pend = unresolved + strlen(unresolved);
rb_encoding *enc = rb_enc_get(*resolvedp);
@@ -3984,11 +3663,8 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE f
checkval = rb_hash_aref(loopcheck, testpath);
if (!NIL_P(checkval)) {
if (checkval == ID2SYM(resolving)) {
- if (mode == RB_REALPATH_CHECK) {
- errno = ELOOP;
- return -1;
- }
- rb_syserr_fail_path(ELOOP, testpath);
+ errno = ELOOP;
+ rb_sys_fail_path(testpath);
}
else {
*resolvedp = rb_str_dup(checkval);
@@ -3997,49 +3673,44 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE f
else {
struct stat sbuf;
int ret;
- ret = lstat_without_gvl(RSTRING_PTR(testpath), &sbuf);
+ VALUE testpath2 = rb_str_encode_ospath(testpath);
+#ifdef __native_client__
+ ret = stat(RSTRING_PTR(testpath2), &sbuf);
+#else
+ ret = lstat(RSTRING_PTR(testpath2), &sbuf);
+#endif
if (ret == -1) {
- int e = errno;
- if (e == ENOENT && !NIL_P(fallback)) {
- if (stat_without_gvl(RSTRING_PTR(fallback), &sbuf) == 0) {
- rb_str_replace(*resolvedp, fallback);
- return 0;
- }
- }
- if (mode == RB_REALPATH_CHECK) return -1;
- if (e == ENOENT) {
- if (mode == RB_REALPATH_STRICT || !last || *unresolved_firstsep)
- rb_syserr_fail_path(e, testpath);
+ if (errno == ENOENT) {
+ if (strict || !last || *unresolved_firstsep)
+ rb_sys_fail_path(testpath);
*resolvedp = testpath;
break;
}
else {
- rb_syserr_fail_path(e, testpath);
+ rb_sys_fail_path(testpath);
}
}
#ifdef HAVE_READLINK
if (S_ISLNK(sbuf.st_mode)) {
VALUE link;
- VALUE link_orig = Qnil;
+ volatile VALUE link_orig = Qnil;
const char *link_prefix, *link_names;
long link_prefixlen;
rb_hash_aset(loopcheck, testpath, ID2SYM(resolving));
- link = rb_readlink(testpath, enc);
+ link = rb_readlink(testpath);
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;
if (link_prefixlen > 0) {
- rb_encoding *tmpenc, *linkenc = rb_enc_get(link);
+ rb_encoding *enc, *linkenc = rb_enc_get(link);
link_orig = link;
link = rb_str_subseq(link, 0, link_prefixlen);
- tmpenc = rb_enc_check(*resolvedp, link);
- if (tmpenc != linkenc) link = rb_str_conv_enc(link, linkenc, tmpenc);
+ enc = rb_enc_check(*resolvedp, link);
+ if (enc != linkenc) link = rb_str_conv_enc(link, linkenc, enc);
*resolvedp = link;
*prefixlenp = link_prefixlen;
}
- if (realpath_rec(prefixlenp, resolvedp, link_names, testpath,
- loopcheck, mode, !*unresolved_firstsep))
- return -1;
+ realpath_rec(prefixlenp, resolvedp, link_names, loopcheck, strict, *unresolved_firstsep == '\0');
RB_GC_GUARD(link_orig);
rb_hash_aset(loopcheck, testpath, rb_str_dup_frozen(*resolvedp));
}
@@ -4053,33 +3724,39 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE f
}
}
}
- return 0;
}
-static VALUE
-rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode)
+#ifdef __native_client__
+VALUE
+rb_realpath_internal(VALUE basedir, VALUE path, int strict)
+{
+ return path;
+}
+#else
+VALUE
+rb_realpath_internal(VALUE basedir, VALUE path, int strict)
{
long prefixlen;
VALUE resolved;
- VALUE unresolved_path;
+ volatile VALUE unresolved_path;
VALUE loopcheck;
- VALUE curdir = Qnil;
+ volatile VALUE curdir = Qnil;
- rb_encoding *enc, *origenc;
+ rb_encoding *enc;
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);
if (!NIL_P(basedir)) {
FilePathValue(basedir);
- basedir = TO_OSPATH(rb_str_dup_frozen(basedir));
+ basedir = rb_str_dup_frozen(basedir);
}
- enc = rb_enc_get(unresolved_path);
- origenc = enc;
- unresolved_path = TO_OSPATH(unresolved_path);
RSTRING_GETMEM(unresolved_path, ptr, len);
path_names = skipprefixroot(ptr, ptr + len, rb_enc_get(unresolved_path));
if (ptr != path_names) {
@@ -4096,7 +3773,7 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode
}
}
- curdir = rb_dir_getwd_ospath();
+ curdir = rb_dir_getwd();
RSTRING_GETMEM(curdir, ptr, len);
curdir_names = skipprefixroot(ptr, ptr + len, rb_enc_get(curdir));
resolved = rb_str_subseq(curdir, 0, curdir_names - ptr);
@@ -4104,6 +3781,7 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode
root_found:
RSTRING_GETMEM(resolved, prefixptr, prefixlen);
pend = prefixptr + prefixlen;
+ enc = rb_enc_get(resolved);
ptr = chompdirsep(prefixptr, pend, enc);
if (ptr < pend) {
prefixlen = ++ptr - prefixptr;
@@ -4118,52 +3796,17 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode
}
#endif
- 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) {
- if (realpath_rec(&prefixlen, &resolved, curdir_names, Qnil, loopcheck, mode, 0))
- return Qnil;
- }
- if (basedir_names) {
- if (realpath_rec(&prefixlen, &resolved, basedir_names, Qnil, loopcheck, mode, 0))
- return Qnil;
- }
- if (realpath_rec(&prefixlen, &resolved, path_names, Qnil, loopcheck, mode, 1))
- return Qnil;
-
- if (origenc != rb_enc_get(resolved)) {
- if (rb_enc_str_asciionly_p(resolved)) {
- rb_enc_associate(resolved, origenc);
- }
- else {
- resolved = rb_str_conv_enc(resolved, NULL, origenc);
- }
- }
+ if (curdir_names)
+ realpath_rec(&prefixlen, &resolved, curdir_names, loopcheck, 1, 0);
+ if (basedir_names)
+ realpath_rec(&prefixlen, &resolved, basedir_names, loopcheck, 1, 0);
+ realpath_rec(&prefixlen, &resolved, path_names, loopcheck, strict, 1);
- rb_obj_taint(resolved);
- RB_GC_GUARD(unresolved_path);
- RB_GC_GUARD(curdir);
+ OBJ_TAINT(resolved);
return resolved;
}
-
-VALUE
-rb_realpath_internal(VALUE basedir, VALUE path, int strict)
-{
- const enum rb_realpath_mode mode =
- strict ? RB_REALPATH_STRICT : RB_REALPATH_DIR;
- return rb_check_realpath_internal(basedir, path, mode);
-}
-
-VALUE
-rb_check_realpath(VALUE basedir, VALUE path)
-{
- return rb_check_realpath_internal(basedir, path, RB_REALPATH_CHECK);
-}
+#endif
/*
* call-seq:
@@ -4181,9 +3824,8 @@ rb_check_realpath(VALUE basedir, VALUE path)
static VALUE
rb_file_s_realpath(int argc, VALUE *argv, VALUE klass)
{
- VALUE basedir = (rb_check_arity(argc, 1, 2) > 1) ? argv[1] : Qnil;
- VALUE path = argv[0];
- FilePathValue(path);
+ VALUE path, basedir;
+ rb_scan_args(argc, argv, "11", &path, &basedir);
return rb_realpath_internal(basedir, path, 1);
}
@@ -4202,9 +3844,8 @@ rb_file_s_realpath(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_file_s_realdirpath(int argc, VALUE *argv, VALUE klass)
{
- VALUE basedir = (rb_check_arity(argc, 1, 2) > 1) ? argv[1] : Qnil;
- VALUE path = argv[0];
- FilePathValue(path);
+ VALUE path, basedir;
+ rb_scan_args(argc, argv, "11", &path, &basedir);
return rb_realpath_internal(basedir, path, 0);
}
@@ -4311,8 +3952,7 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
* call-seq:
* File.basename(file_name [, suffix] ) -> base_name
*
- * Returns the last component of the filename given in
- * <i>file_name</i> (after first stripping trailing separators),
+ * Returns the last component of the filename given in <i>file_name</i>,
* which can be formed using both <code>File::SEPARATOR</code> and
* <code>File::ALT_SEPARATOR</code> as the separator when
* <code>File::ALT_SEPARATOR</code> is not <code>nil</code>. If
@@ -4333,13 +3973,10 @@ rb_file_s_basename(int argc, VALUE *argv)
long f, n;
rb_encoding *enc;
- fext = Qnil;
- if (rb_check_arity(argc, 1, 2) == 2) {
- fext = argv[1];
+ if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) {
StringValue(fext);
enc = check_path_encoding(fext);
}
- fname = argv[0];
FilePathStringValue(fname);
if (NIL_P(fext) || !(enc = rb_enc_compatible(fname, fext))) {
enc = rb_enc_get(fname);
@@ -4375,10 +4012,9 @@ rb_file_s_basename(int argc, VALUE *argv)
* File.dirname(file_name) -> dir_name
*
* Returns all components of the filename given in <i>file_name</i>
- * except the last one (after first stripping trailing separators).
- * The filename can be formed using both <code>File::SEPARATOR</code>
- * and <code>File::ALT_SEPARATOR</code> as the separator when
- * <code>File::ALT_SEPARATOR</code> is not <code>nil</code>.
+ * except the last one. The filename can be formed using both
+ * <code>File::SEPARATOR</code> and <code>File::ALT_SEPARATOR</code> as the
+ * separator when <code>File::ALT_SEPARATOR</code> is not <code>nil</code>.
*
* File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work"
*/
@@ -4465,7 +4101,7 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
if (*p == '.') dot = p;
p++;
}
- if (!*p || isADS(*p)) {
+ if (!*p || *p == ':') {
p = last;
break;
}
@@ -4476,7 +4112,7 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
#endif
}
#if USE_NTFS
- else if (isADS(*p)) {
+ else if (*p == ':') {
break;
}
#endif
@@ -4512,8 +4148,7 @@ 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(".a/b/d/test.rb") #=> ".rb"
- * File.extname("foo.") #=> ""
+ * File.extname("foo.") #=> ""
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
* File.extname(".profile.sh") #=> ".sh"
@@ -4570,20 +4205,23 @@ static VALUE
rb_file_s_split(VALUE klass, VALUE path)
{
FilePathStringValue(path); /* get rid of converting twice */
- return rb_assoc_new(rb_file_dirname(path), rb_file_s_basename(1,&path));
+ return rb_assoc_new(rb_file_s_dirname(Qnil, path), rb_file_s_basename(1,&path));
}
-static VALUE rb_file_join(VALUE ary);
+static VALUE separator;
+
+static VALUE rb_file_join(VALUE ary, VALUE sep);
static VALUE
-file_inspect_join(VALUE ary, VALUE arg, int recur)
+file_inspect_join(VALUE ary, VALUE argp, int recur)
{
- if (recur || ary == arg) rb_raise(rb_eArgError, "recursive array");
- return rb_file_join(arg);
+ VALUE *arg = (VALUE *)argp;
+ if (recur || ary == arg[0]) rb_raise(rb_eArgError, "recursive array");
+ return rb_file_join(arg[0], arg[1]);
}
static VALUE
-rb_file_join(VALUE ary)
+rb_file_join(VALUE ary, VALUE sep)
{
long len, i;
VALUE result, tmp;
@@ -4604,13 +4242,16 @@ rb_file_join(VALUE ary)
len += 10;
}
}
- len += RARRAY_LEN(ary) - 1;
+ if (!NIL_P(sep)) {
+ StringValue(sep);
+ len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
+ }
result = rb_str_buf_new(len);
RBASIC_CLEAR_CLASS(result);
OBJ_INFECT(result, ary);
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp = RARRAY_AREF(ary, i);
- switch (OBJ_BUILTIN_TYPE(tmp)) {
+ switch (TYPE(tmp)) {
case T_STRING:
if (!checked) check_path_encoding(tmp);
StringValueCStr(tmp);
@@ -4620,7 +4261,11 @@ rb_file_join(VALUE ary)
rb_raise(rb_eArgError, "recursive array");
}
else {
- tmp = rb_exec_recursive(file_inspect_join, ary, tmp);
+ VALUE args[2];
+
+ args[0] = tmp;
+ args[1] = sep;
+ tmp = rb_exec_recursive(file_inspect_join, ary, (VALUE)args);
}
break;
default:
@@ -4631,13 +4276,15 @@ rb_file_join(VALUE ary)
if (i == 0) {
rb_enc_copy(result, tmp);
}
- else {
+ else if (!NIL_P(sep)) {
tail = chompdirsep(name, name + len, rb_enc_get(result));
if (RSTRING_PTR(tmp) && isdirsep(RSTRING_PTR(tmp)[0])) {
rb_str_set_len(result, tail - name);
}
else if (!*tail) {
- rb_str_cat(result, "/", 1);
+ enc = rb_enc_check(result, sep);
+ rb_str_buf_append(result, sep);
+ rb_enc_associate(result, enc);
}
}
enc = rb_enc_check(result, tmp);
@@ -4654,7 +4301,7 @@ rb_file_join(VALUE ary)
* File.join(string, ...) -> string
*
* Returns a new string formed by joining the strings using
- * <code>"/"</code>.
+ * <code>File::SEPARATOR</code>.
*
* File.join("usr", "mail", "gumby") #=> "usr/mail/gumby"
*
@@ -4663,46 +4310,10 @@ rb_file_join(VALUE ary)
static VALUE
rb_file_s_join(VALUE klass, VALUE args)
{
- return rb_file_join(args);
+ return rb_file_join(args, separator);
}
#if defined(HAVE_TRUNCATE) || defined(HAVE_CHSIZE)
-struct truncate_arg {
- const char *path;
-#if defined(HAVE_TRUNCATE)
-#define NUM2POS(n) NUM2OFFT(n)
- off_t pos;
-#else
-#define NUM2POS(n) NUM2LONG(n)
- long pos;
-#endif
-};
-
-static void *
-nogvl_truncate(void *ptr)
-{
- struct truncate_arg *ta = ptr;
-#ifdef HAVE_TRUNCATE
- return (void *)(VALUE)truncate(ta->path, ta->pos);
-#else /* defined(HAVE_CHSIZE) */
- {
- int tmpfd = rb_cloexec_open(ta->path, 0, 0);
-
- if (tmpfd < 0)
- return (void *)-1;
- rb_update_max_fd(tmpfd);
- if (chsize(tmpfd, ta->pos) < 0) {
- int e = errno;
- close(tmpfd);
- errno = e;
- return (void *)-1;
- }
- close(tmpfd);
- return 0;
- }
-#endif
-}
-
/*
* call-seq:
* File.truncate(file_name, integer) -> 0
@@ -4721,18 +4332,36 @@ nogvl_truncate(void *ptr)
static VALUE
rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
{
- struct truncate_arg ta;
- int r;
+#ifdef HAVE_TRUNCATE
+#define NUM2POS(n) NUM2OFFT(n)
+ off_t pos;
+#else
+#define NUM2POS(n) NUM2LONG(n)
+ long pos;
+#endif
- ta.pos = NUM2POS(len);
+ rb_secure(2);
+ pos = NUM2POS(len);
FilePathValue(path);
path = rb_str_encode_ospath(path);
- ta.path = StringValueCStr(path);
-
- r = (int)(VALUE)rb_thread_call_without_gvl(nogvl_truncate, &ta,
- RUBY_UBF_IO, NULL);
- if (r < 0)
+#ifdef HAVE_TRUNCATE
+ if (truncate(StringValueCStr(path), pos) < 0)
rb_sys_fail_path(path);
+#else /* defined(HAVE_CHSIZE) */
+ {
+ int tmpfd;
+
+ if ((tmpfd = rb_cloexec_open(StringValueCStr(path), 0, 0)) < 0) {
+ rb_sys_fail_path(path);
+ }
+ rb_update_max_fd(tmpfd);
+ if (chsize(tmpfd, pos) < 0) {
+ close(tmpfd);
+ rb_sys_fail_path(path);
+ }
+ close(tmpfd);
+ }
+#endif
return INT2FIX(0);
#undef NUM2POS
}
@@ -4741,29 +4370,6 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
#endif
#if defined(HAVE_FTRUNCATE) || defined(HAVE_CHSIZE)
-struct ftruncate_arg {
- int fd;
-#if defined(HAVE_FTRUNCATE)
-#define NUM2POS(n) NUM2OFFT(n)
- off_t pos;
-#else
-#define NUM2POS(n) NUM2LONG(n)
- long pos;
-#endif
-};
-
-static VALUE
-nogvl_ftruncate(void *ptr)
-{
- struct ftruncate_arg *fa = ptr;
-
-#ifdef HAVE_FTRUNCATE
- return (VALUE)ftruncate(fa->fd, fa->pos);
-#else /* defined(HAVE_CHSIZE) */
- return (VALUE)chsize(fa->fd, fa->pos);
-#endif
-}
-
/*
* call-seq:
* file.truncate(integer) -> 0
@@ -4782,18 +4388,28 @@ static VALUE
rb_file_truncate(VALUE obj, VALUE len)
{
rb_io_t *fptr;
- struct ftruncate_arg fa;
+#if defined(HAVE_FTRUNCATE)
+#define NUM2POS(n) NUM2OFFT(n)
+ off_t pos;
+#else
+#define NUM2POS(n) NUM2LONG(n)
+ long pos;
+#endif
- fa.pos = NUM2POS(len);
+ rb_secure(2);
+ pos = NUM2POS(len);
GetOpenFile(obj, fptr);
if (!(fptr->mode & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "not opened for writing");
}
rb_io_flush_raw(obj, 0);
- fa.fd = fptr->fd;
- if ((int)rb_thread_io_blocking_region(nogvl_ftruncate, &fa, fa.fd) < 0) {
+#ifdef HAVE_FTRUNCATE
+ if (ftruncate(fptr->fd, pos) < 0)
rb_sys_fail_path(fptr->pathv);
- }
+#else /* defined(HAVE_CHSIZE) */
+ if (chsize(fptr->fd, pos) < 0)
+ rb_sys_fail_path(fptr->pathv);
+#endif
return INT2FIX(0);
#undef NUM2POS
}
@@ -4886,6 +4502,7 @@ 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;
@@ -4894,8 +4511,7 @@ 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) {
- int e = errno;
- switch (e) {
+ switch (errno) {
case EAGAIN:
case EACCES:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
@@ -4916,17 +4532,19 @@ rb_file_flock(VALUE obj, VALUE operation)
break;
default:
- rb_syserr_fail_path(e, fptr->pathv);
+ rb_sys_fail_path(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++) {
@@ -5090,9 +4708,8 @@ rb_f_test(int argc, VALUE *argv)
CHECK(1);
if (rb_stat(fname, &st) == -1) {
- int e = errno;
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
switch (cmd) {
@@ -5112,28 +4729,22 @@ 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 (t1.tv_sec == t2.tv_sec && t1.tv_nsec == t2.tv_nsec) return Qtrue;
+ if (st1.st_mtime == st2.st_mtime) return Qtrue;
return Qfalse;
case '>':
- if (t1.tv_sec > t2.tv_sec) return Qtrue;
- if (t1.tv_sec == t2.tv_sec && t1.tv_nsec > t2.tv_nsec) return Qtrue;
+ if (st1.st_mtime > st2.st_mtime) return Qtrue;
return Qfalse;
case '<':
- if (t1.tv_sec < t2.tv_sec) return Qtrue;
- if (t1.tv_sec == t2.tv_sec && t1.tv_nsec < t2.tv_nsec) return Qtrue;
+ if (st1.st_mtime < st2.st_mtime) return Qtrue;
return Qfalse;
}
}
@@ -5175,6 +4786,7 @@ 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) {
@@ -5473,7 +5085,7 @@ rb_stat_R(VALUE obj)
/*
* call-seq:
- * stat.world_readable? -> integer or nil
+ * stat.world_readable? -> fixnum or nil
*
* If <i>stat</i> is readable by others, returns an integer
* representing the file permission bits of <i>stat</i>. Returns
@@ -5488,9 +5100,8 @@ static VALUE
rb_stat_wr(VALUE obj)
{
#ifdef S_IROTH
- 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));
+ if ((get_stat(obj)->st_mode & (S_IROTH)) == S_IROTH) {
+ return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
}
else {
return Qnil;
@@ -5566,7 +5177,7 @@ rb_stat_W(VALUE obj)
/*
* call-seq:
- * stat.world_writable? -> integer or nil
+ * stat.world_writable? -> fixnum or nil
*
* If <i>stat</i> is writable by others, returns an integer
* representing the file permission bits of <i>stat</i>. Returns
@@ -5581,9 +5192,8 @@ static VALUE
rb_stat_ww(VALUE obj)
{
#ifdef S_IROTH
- 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));
+ if ((get_stat(obj)->st_mode & (S_IWOTH)) == S_IWOTH) {
+ return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
}
else {
return Qnil;
@@ -5777,59 +5387,6 @@ 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
-
-#ifdef HAVE_MKFIFO
-struct mkfifo_arg {
- const char *path;
- mode_t mode;
-};
-
-static void *
-nogvl_mkfifo(void *ptr)
-{
- struct mkfifo_arg *ma = ptr;
-
- return (void *)(VALUE)mkfifo(ma->path, ma->mode);
-}
-
-/*
- * 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).
- */
-
-static VALUE
-rb_file_s_mkfifo(int argc, VALUE *argv)
-{
- VALUE path;
- struct mkfifo_arg ma;
-
- ma.mode = 0666;
- rb_check_arity(argc, 1, 2);
- if (argc > 1) {
- ma.mode = NUM2MODET(argv[1]);
- }
- path = argv[0];
- FilePathValue(path);
- path = rb_str_encode_ospath(path);
- ma.path = RSTRING_PTR(path);
- if (rb_thread_call_without_gvl(nogvl_mkfifo, &ma, RUBY_UBF_IO, 0)) {
- rb_sys_fail_path(path);
- }
- return INT2FIX(0);
-}
-#else
-#define rb_file_s_mkfifo rb_f_notimplement
-#endif
-
VALUE rb_mFConst;
void
@@ -5872,7 +5429,7 @@ path_check_0(VALUE path, int execpath)
char *p = 0, *s;
if (!rb_is_absolute_path(p0)) {
- char *buf = ruby_getcwd();
+ char *buf = my_getcwd();
VALUE newpath;
newpath = rb_str_new2(buf);
@@ -5894,9 +5451,9 @@ path_check_0(VALUE path, int execpath)
&& !(p && execpath && (st.st_mode & S_ISVTX))
#endif
&& !access(p0, W_OK)) {
- rb_enc_warn(enc, "Insecure world writable dir %s in %sPATH, mode 0%"
- PRI_MODET_PREFIX"o",
- p0, (execpath ? "" : "LOAD_"), st.st_mode);
+ rb_warn("Insecure world writable dir %s in %sPATH, mode 0%"
+ PRI_MODET_PREFIX"o",
+ p0, (execpath ? "" : "LOAD_"), st.st_mode);
if (p) *p = '/';
RB_GC_GUARD(path);
return 0;
@@ -5944,52 +5501,25 @@ rb_path_check(const char *path)
return 1;
}
-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
+#ifdef __native_client__
+__attribute__((noinline))
+#endif
int
rb_file_load_ok(const char *path)
{
int ret = 1;
- /*
- 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);
+ int fd = rb_cloexec_open(path, O_RDONLY, 0);
if (fd == -1) return 0;
rb_update_max_fd(fd);
- ret = ruby_is_fd_loadable(fd);
+#if !defined DOSISH
+ {
+ struct stat st;
+ if (fstat(fd, &st) || !S_ISREG(st.st_mode)) {
+ ret = 0;
+ }
+ }
+#endif
(void)close(fd);
return ret;
}
@@ -6079,7 +5609,6 @@ 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;
}
@@ -6100,7 +5629,7 @@ rb_find_file_safe(VALUE path, int safe_level)
if (f[0] == '~') {
tmp = file_expand_path_1(path);
if (safe_level >= 1 && OBJ_TAINTED(tmp)) {
- rb_raise(rb_eSecurityError, "loading from unsafe file %"PRIsVALUE, tmp);
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
path = copy_path_class(tmp, path);
f = RSTRING_PTR(path);
@@ -6109,7 +5638,7 @@ rb_find_file_safe(VALUE path, int safe_level)
if (expanded || rb_is_absolute_path(f) || is_explicit_relative(f)) {
if (safe_level >= 1 && !fpath_check(path)) {
- rb_raise(rb_eSecurityError, "loading from unsafe path %"PRIsVALUE, path);
+ rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
}
if (!rb_file_load_ok(f)) return 0;
if (!expanded)
@@ -6132,7 +5661,6 @@ 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 {
@@ -6141,7 +5669,7 @@ rb_find_file_safe(VALUE path, int safe_level)
found:
if (safe_level >= 1 && !fpath_check(tmp)) {
- rb_raise(rb_eSecurityError, "loading from unsafe file %"PRIsVALUE, tmp);
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
return copy_path_class(tmp, path);
@@ -6168,7 +5696,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>.
@@ -6203,8 +5731,6 @@ static const char null_device[] =
void
Init_File(void)
{
- VALUE separator;
-
rb_mFileTest = rb_define_module("FileTest");
rb_cFile = rb_define_class("File", rb_cIO);
@@ -6221,7 +5747,6 @@ Init_File(void)
define_filetest_function("executable_real?", rb_file_executable_real_p, 1);
define_filetest_function("file?", rb_file_file_p, 1);
define_filetest_function("zero?", rb_file_zero_p, 1);
- define_filetest_function("empty?", rb_file_zero_p, 1);
define_filetest_function("size?", rb_file_size_p, 1);
define_filetest_function("size", rb_file_s_size, 1);
define_filetest_function("owned?", rb_file_owned_p, 1);
@@ -6254,18 +5779,16 @@ Init_File(void)
rb_define_singleton_method(rb_cFile, "chown", rb_file_s_chown, -1);
rb_define_singleton_method(rb_cFile, "lchmod", rb_file_s_lchmod, -1);
rb_define_singleton_method(rb_cFile, "lchown", rb_file_s_lchown, -1);
- rb_define_singleton_method(rb_cFile, "lutime", rb_file_s_lutime, -1);
rb_define_singleton_method(rb_cFile, "link", rb_file_s_link, 2);
rb_define_singleton_method(rb_cFile, "symlink", rb_file_s_symlink, 2);
rb_define_singleton_method(rb_cFile, "readlink", rb_file_s_readlink, 1);
- rb_define_singleton_method(rb_cFile, "unlink", rb_file_s_unlink, -1);
- rb_define_singleton_method(rb_cFile, "delete", rb_file_s_unlink, -1);
+ rb_define_singleton_method(rb_cFile, "unlink", rb_file_s_unlink, -2);
+ rb_define_singleton_method(rb_cFile, "delete", rb_file_s_unlink, -2);
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);
@@ -6275,7 +5798,7 @@ Init_File(void)
rb_define_singleton_method(rb_cFile, "extname", rb_file_s_extname, 1);
rb_define_singleton_method(rb_cFile, "path", rb_file_s_path, 1);
- separator = rb_fstring_cstr("/");
+ separator = rb_obj_freeze(rb_usascii_str_new2("/"));
/* separates directory parts in path */
rb_define_const(rb_cFile, "Separator", separator);
rb_define_const(rb_cFile, "SEPARATOR", separator);
@@ -6289,7 +5812,7 @@ Init_File(void)
rb_define_const(rb_cFile, "ALT_SEPARATOR", Qnil);
#endif
/* path list separator */
- rb_define_const(rb_cFile, "PATH_SEPARATOR", rb_fstring_cstr(PATH_SEP));
+ rb_define_const(rb_cFile, "PATH_SEPARATOR", rb_obj_freeze(rb_str_new2(PATH_SEP)));
rb_define_method(rb_cIO, "stat", rb_io_stat, 0); /* this is IO's method */
rb_define_method(rb_cFile, "lstat", rb_file_lstat, 0);
@@ -6352,11 +5875,6 @@ 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));
@@ -6381,10 +5899,6 @@ 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));
@@ -6396,7 +5910,7 @@ Init_File(void)
rb_define_const(rb_mFConst, "LOCK_NB", INT2FIX(LOCK_NB));
/* Name of the null device */
- rb_define_const(rb_mFConst, "NULL", rb_fstring_cstr(null_device));
+ rb_define_const(rb_mFConst, "NULL", rb_obj_freeze(rb_usascii_str_new2(null_device)));
rb_define_method(rb_cFile, "path", rb_file_path, 0);
rb_define_method(rb_cFile, "to_path", rb_file_path, 0);
diff --git a/gc.c b/gc.c
index c02ac627f0..5ee5beea26 100644
--- a/gc.c
+++ b/gc.c
@@ -11,10 +11,7 @@
**********************************************************************/
-#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/ruby.h"
#include "ruby/st.h"
#include "ruby/re.h"
#include "ruby/io.h"
@@ -23,19 +20,20 @@
#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 "ruby_assert.h"
-#include "debug_counter.h"
+#include <assert.h>
-#undef rb_data_object_wrap
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
#ifndef HAVE_MALLOC_USABLE_SIZE
# ifdef _WIN32
@@ -73,6 +71,12 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/resource.h"
+# undef HAVE_POSIX_MEMALIGN
+# undef HAVE_MEMALIGN
+
+#endif
#if defined _WIN32 || defined __CYGWIN__
#include <windows.h>
@@ -96,12 +100,12 @@ rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val)
}
#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_INIT_SLOTS
+#define GC_HEAP_INIT_SLOTS 10000
+#endif
#ifndef GC_HEAP_GROWTH_FACTOR
#define GC_HEAP_GROWTH_FACTOR 1.8
#endif
@@ -113,13 +117,10 @@ rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val)
#endif
#ifndef GC_HEAP_FREE_SLOTS_MIN_RATIO
-#define GC_HEAP_FREE_SLOTS_MIN_RATIO 0.20
-#endif
-#ifndef GC_HEAP_FREE_SLOTS_GOAL_RATIO
-#define GC_HEAP_FREE_SLOTS_GOAL_RATIO 0.40
+#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.65
+#define GC_HEAP_FREE_SLOTS_MAX_RATIO 0.8
#endif
#ifndef GC_MALLOC_LIMIT_MIN
@@ -152,7 +153,7 @@ rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val)
#define PRINT_ROOT_TICKS 0
#endif
-#define USE_TICK_T (PRINT_ENTER_EXIT_TICK || PRINT_MEASURE_LINE || PRINT_ROOT_TICKS)
+#define USE_TICK_T (PRINT_ENTER_EXIT_TICK || PRINT_MEASURE_LINE)
#define TICK_TYPE 1
typedef struct {
@@ -160,20 +161,13 @@ typedef struct {
size_t heap_free_slots;
double growth_factor;
size_t growth_max_slots;
-
- double heap_free_slots_min_ratio;
- double heap_free_slots_goal_ratio;
- double heap_free_slots_max_ratio;
double oldobject_limit_factor;
-
size_t malloc_limit_min;
size_t malloc_limit_max;
double malloc_limit_growth_factor;
-
size_t oldmalloc_limit_min;
size_t oldmalloc_limit_max;
double oldmalloc_limit_growth_factor;
-
VALUE gc_stress;
} ruby_gc_params_t;
@@ -182,21 +176,16 @@ static ruby_gc_params_t gc_params = {
GC_HEAP_FREE_SLOTS,
GC_HEAP_GROWTH_FACTOR,
GC_HEAP_GROWTH_MAX_SLOTS,
-
- GC_HEAP_FREE_SLOTS_MIN_RATIO,
- GC_HEAP_FREE_SLOTS_GOAL_RATIO,
- GC_HEAP_FREE_SLOTS_MAX_RATIO,
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:
@@ -215,47 +204,21 @@ static ruby_gc_params_t gc_params = {
* 5: sweep
*/
#ifndef RGENGC_DEBUG
-#ifdef RUBY_DEVEL
-#define RGENGC_DEBUG -1
-#else
#define RGENGC_DEBUG 0
#endif
-#endif
-#if RGENGC_DEBUG < 0 && !defined(_MSC_VER)
-# define RGENGC_DEBUG_ENABLED(level) (-(RGENGC_DEBUG) >= (level) && ruby_rgengc_debug >= (level))
-#else
-# define RGENGC_DEBUG_ENABLED(level) ((RGENGC_DEBUG) >= (level))
-#endif
-int ruby_rgengc_debug;
/* RGENGC_CHECK_MODE
* 0: disable all assertions
* 1: enable assertions (to debug RGenGC)
* 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
+ * 4: enable livness check
* 5: show all references
*/
#ifndef RGENGC_CHECK_MODE
#define RGENGC_CHECK_MODE 0
#endif
-#if RGENGC_CHECK_MODE > 0
-#define GC_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RGENGC_CHECK_MODE > 0, expr, #expr)
-#else
-#define GC_ASSERT(expr) ((void)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
@@ -324,14 +287,6 @@ int ruby_rgengc_debug;
#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 */
@@ -397,7 +352,7 @@ typedef struct gc_profile_record {
#endif
} gc_profile_record;
-#if defined(_MSC_VER) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
#pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */
#endif
@@ -420,21 +375,11 @@ typedef struct RVALUE {
struct RStruct rstruct;
struct RBignum bignum;
struct RFile file;
+ struct RNode node;
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;
- rb_env_t env;
- struct rb_imemo_alloc_struct alloc;
- rb_ast_t ast;
- } imemo;
+ struct RSymbol symbol;
struct {
struct RBasic basic;
VALUE v1;
@@ -448,7 +393,7 @@ typedef struct RVALUE {
#endif
} RVALUE;
-#if defined(_MSC_VER) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
#pragma pack(pop)
#endif
@@ -496,17 +441,16 @@ typedef struct rb_heap_struct {
struct heap_page *using_page;
struct heap_page *pages;
struct heap_page *sweep_pages;
-#if GC_ENABLE_INCREMENTAL_MARK
struct heap_page *pooled_pages;
-#endif
- size_t total_pages; /* total page count in a heap */
- size_t total_slots; /* total slot count (about total_pages * HEAP_PAGE_OBJ_LIMIT) */
+
+ 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_mode {
- gc_mode_none,
- gc_mode_marking,
- gc_mode_sweeping
+enum gc_stat {
+ gc_stat_none,
+ gc_stat_marking,
+ gc_stat_sweeping
};
typedef struct rb_objspace {
@@ -520,13 +464,12 @@ typedef struct rb_objspace {
} malloc_params;
struct {
- unsigned int mode : 2;
+ 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
@@ -559,7 +502,10 @@ typedef struct rb_objspace {
size_t allocatable_pages;
size_t sorted_length;
RVALUE *range[2];
- size_t freeable_pages;
+
+ size_t swept_slots;
+ size_t min_free_slots;
+ size_t max_free_slots;
/* final */
size_t final_slots;
@@ -623,10 +569,11 @@ typedef struct rb_objspace {
VALUE parent_object;
int need_major_gc;
size_t last_major_gc;
- size_t uncollectible_wb_unprotected_objects;
- size_t uncollectible_wb_unprotected_objects_limit;
+ size_t remembered_wb_unprotected_objects;
+ size_t remembered_wb_unprotected_objects_limit;
size_t old_objects;
size_t old_objects_limit;
+ size_t old_objects_at_gc_start;
#if RGENGC_ESTIMATE_OLDMALLOC
size_t oldmalloc_increase;
@@ -638,69 +585,61 @@ 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;
-#ifndef HEAP_PAGE_ALIGN_LOG
+#ifndef HEAP_ALIGN_LOG
/* default tiny heap size: 16KB */
-#define HEAP_PAGE_ALIGN_LOG 14
+#define HEAP_ALIGN_LOG 14
#endif
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
enum {
- HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
- HEAP_PAGE_ALIGN_MASK = (~(~0UL << HEAP_PAGE_ALIGN_LOG)),
+ HEAP_ALIGN = (1UL << HEAP_ALIGN_LOG),
+ HEAP_ALIGN_MASK = (~(~0UL << HEAP_ALIGN_LOG)),
REQUIRED_SIZE_BY_MALLOC = (sizeof(size_t) * 5),
- HEAP_PAGE_SIZE = (HEAP_PAGE_ALIGN - REQUIRED_SIZE_BY_MALLOC),
- HEAP_PAGE_OBJ_LIMIT = (unsigned int)((HEAP_PAGE_SIZE - sizeof(struct heap_page_header))/sizeof(struct RVALUE)),
- HEAP_PAGE_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_PAGE_SIZE, sizeof(struct RVALUE)), BITS_BITLENGTH),
- HEAP_PAGE_BITMAP_SIZE = (BITS_SIZE * HEAP_PAGE_BITMAP_LIMIT),
- HEAP_PAGE_BITMAP_PLANES = USE_RGENGC ? 4 : 1 /* RGENGC: mark, unprotected, uncollectible, marking */
+ HEAP_SIZE = (HEAP_ALIGN - REQUIRED_SIZE_BY_MALLOC),
+ HEAP_OBJ_LIMIT = (unsigned int)((HEAP_SIZE - sizeof(struct heap_page_header))/sizeof(struct RVALUE)),
+ HEAP_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_SIZE, sizeof(struct RVALUE)), BITS_BITLENGTH),
+ HEAP_BITMAP_SIZE = ( BITS_SIZE * HEAP_BITMAP_LIMIT),
+ HEAP_BITMAP_PLANES = USE_RGENGC ? 3 : 1 /* RGENGC: mark bits, rememberset bits and oldgen bits */
};
struct heap_page {
+ struct heap_page_body *body;
struct heap_page *prev;
- short total_slots;
- short free_slots;
- short final_slots;
- struct {
- unsigned int before_sweep : 1;
- unsigned int has_remembered_objects : 1;
- unsigned int has_uncollectible_shady_objects : 1;
- unsigned int in_tomb : 1;
- } flags;
+ rb_heap_t *heap;
+ int total_slots;
+ int free_slots;
+ int final_slots;
struct heap_page *free_next;
RVALUE *start;
RVALUE *freelist;
struct heap_page *next;
+ struct {
+ unsigned int before_sweep : 1;
+ unsigned int has_remembered_objects : 1;
+ unsigned int has_long_lived_shady_objects : 1;
+ } flags;
+
#if USE_RGENGC
- bits_t wb_unprotected_bits[HEAP_PAGE_BITMAP_LIMIT];
+ 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_PAGE_BITMAP_LIMIT];
+ /* the following three bitmaps are cleared at the beggining of full GC */
+ bits_t mark_bits[HEAP_BITMAP_LIMIT];
#if USE_RGENGC
- bits_t uncollectible_bits[HEAP_PAGE_BITMAP_LIMIT];
- bits_t marking_bits[HEAP_PAGE_BITMAP_LIMIT];
+ bits_t long_lived_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_PAGE_ALIGN_MASK)))
+#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_PAGE_ALIGN_MASK)/sizeof(RVALUE))
+#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))
@@ -713,26 +652,19 @@ struct heap_page {
/* 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_LONG_LIVED_BITS(x) (&GET_HEAP_PAGE(x)->long_lived_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
-#ifndef ENABLE_VM_OBJSPACE
-# define ENABLE_VM_OBJSPACE 1
-#endif
-
/* Aliases */
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-#define rb_objspace (*rb_objspace_of(GET_VM()))
-#define rb_objspace_of(vm) ((vm)->objspace)
+#define rb_objspace (*GET_VM()->objspace)
#else
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT_MIN}};
-#define rb_objspace_of(vm) (&rb_objspace)
#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
@@ -743,8 +675,10 @@ VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#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_allocatable_pages objspace->heap_pages.allocatable_pages
-#define heap_pages_freeable_pages objspace->heap_pages.freeable_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
#define heap_pages_deferred_final objspace->heap_pages.deferred_final
#define heap_eden (&objspace->eden_heap)
@@ -756,50 +690,21 @@ VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#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
-static inline enum gc_mode
-gc_mode_verify(enum gc_mode mode)
-{
-#if RGENGC_CHECK_MODE > 0
- switch (mode) {
- case gc_mode_none:
- case gc_mode_marking:
- case gc_mode_sweeping:
- break;
- default:
- rb_bug("gc_mode_verify: unreachable (%d)", (int)mode);
- }
-#endif
- return mode;
-}
-
-#define gc_mode(objspace) gc_mode_verify((enum gc_mode)(objspace)->flags.mode)
-#define gc_mode_set(objspace, mode) ((objspace)->flags.mode = (unsigned int)gc_mode_verify(mode))
-
-#define is_marking(objspace) (gc_mode(objspace) == gc_mode_marking)
-#define is_sweeping(objspace) (gc_mode(objspace) == gc_mode_sweeping)
-#if USE_RGENGC
+#define is_marking(objspace) ((objspace)->flags.stat == gc_stat_marking)
+#define is_sweeping(objspace) ((objspace)->flags.stat == gc_stat_sweeping)
#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
+#define is_incremental_marking(objspace) 0
#endif
+#define is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && (heap)->sweep_pages != 0)
#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
+#define will_be_incremental_marking(objspace) 0
#endif
-#define has_sweeping_pages(heap) ((heap)->sweep_pages != 0)
-#define is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap))
#if SIZEOF_LONG == SIZEOF_VOIDP
# define nonspecial_obj_id(obj) (VALUE)((SIGNED_VALUE)(obj)|FIXNUM_FLAG)
@@ -829,9 +734,6 @@ int ruby_gc_debug_indent = 0;
VALUE rb_mGC;
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);
static void rb_objspace_call_finalizer(rb_objspace_t *objspace);
@@ -855,22 +757,18 @@ 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_rest(rb_objspace_t *objspace);
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 inline void gc_mark(rb_objspace_t *objspace, VALUE ptr);
+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);
@@ -879,7 +777,6 @@ 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);
@@ -909,10 +806,10 @@ static inline void gc_prof_set_heap_info(rb_objspace_t *);
#define gc_prof_enabled(objspace) ((objspace)->profile.run && (objspace)->profile.current_record)
#ifdef HAVE_VA_ARGS_MACRO
-# define gc_report(level, objspace, ...) \
- if (!RGENGC_DEBUG_ENABLED(level)) {} else gc_report_body(level, objspace, __VA_ARGS__)
+# 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_ENABLED(0)) {} else gc_report_body
+# 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);
@@ -964,17 +861,6 @@ tick(void)
return ((unsigned long long)lo)|( ((unsigned long long)hi)<<32);
}
-#elif defined(__powerpc64__) && GCC_VERSION_SINCE(4,8,0)
-typedef unsigned long long tick_t;
-#define PRItick "llu"
-
-static __inline__ tick_t
-tick(void)
-{
- unsigned long long val = __builtin_ppc_get_timebase();
- return val;
-}
-
#elif defined(_WIN32) && defined(_MSC_VER)
#include <intrin.h>
typedef unsigned __int64 tick_t;
@@ -1022,23 +908,20 @@ tick(void)
#define MEASURE_LINE(expr) expr
#endif /* USE_TICK_T */
-#define FL_CHECK2(name, x, pred) \
- ((RGENGC_CHECK_MODE && SPECIAL_CONST_P(x)) ? \
- (rb_bug(name": SPECIAL_CONST (%p)", (void *)(x)), 0) : (pred))
-#define FL_TEST2(x,f) FL_CHECK2("FL_TEST2", x, FL_TEST_RAW((x),(f)) != 0)
-#define FL_SET2(x,f) FL_CHECK2("FL_SET2", x, RBASIC(x)->flags |= (f))
-#define FL_UNSET2(x,f) FL_CHECK2("FL_UNSET2", x, RBASIC(x)->flags &= ~(f))
+#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_LONG_LIVED_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_LONG_LIVED_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_WB_UNPROTECTED(apge, obj) MARKED_IN_BITMAP((page)->wb_unprotected_bits, (obj))
+#define RVALUE_PAGE_LONG_LIVED(page, obj) MARKED_IN_BITMAP((page)->long_lived_bits, (obj))
#define RVALUE_PAGE_MARKING(page, obj) MARKED_IN_BITMAP((page)->marking_bits, (obj))
#define RVALUE_OLD_AGE 3
@@ -1057,34 +940,25 @@ RVALUE_FLAGS_AGE(VALUE flags)
#endif /* USE_RGENGC */
-
-#if RGENGC_CHECK_MODE == 0
static inline VALUE
check_rvalue_consistency(const VALUE obj)
{
- return obj;
-}
-#else
-static VALUE
-check_rvalue_consistency(const VALUE obj)
-{
+#if RGENGC_CHECK_MODE > 0
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)) {
+ if (!is_pointer_to_heap(objspace, (void *)obj)) {
rb_bug("check_rvalue_consistency: %p is not a Ruby object.", (void *)obj);
}
+ else if (SPECIAL_CONST_P(obj)) {
+ rb_bug("check_rvalue_consistency: %p is a special const.", (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));
+ int wb_unprotected_bit = RVALUE_WB_UNPROTECTED_BITMAP(obj) != 0;
+ int long_lived_bit = RVALUE_LONG_LIVED_BITMAP(obj) != 0;
+ int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
+
+ if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("check_rvalue_consistency: %p is T_NONE", obj_info(obj));
+ if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("check_rvalue_consistency: %p is T_ZOMBIE", obj_info(obj));
obj_memsize_of((VALUE)obj, FALSE);
/* check generation
@@ -1094,18 +968,11 @@ check_rvalue_consistency(const VALUE obj)
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 (!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 (!is_full_marking(objspace) && long_lived_bit && age != RVALUE_OLD_AGE && !wb_unprotected_bit) {
+ rb_bug("check_rvalue_consistency: %s is long lived, but not old (age: %d) and not WB unprotected.\n", obj_info(obj), age);
}
-
- 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);
- }
- if (remembered_bit && age != RVALUE_OLD_AGE) {
- rb_bug("check_rvalue_consistency: %s is rememberd, but not old (age: %d).", obj_info(obj), age);
- }
+ if (!is_marking(objspace) && !is_sweeping(objspace) && long_lived_bit && RVALUE_MARK_BITMAP(obj) == 0) {
+ rb_bug("check_rvalue_consistency: %s is long lived, but is not marked while !gc.", obj_info(obj));
}
/*
@@ -1115,13 +982,13 @@ check_rvalue_consistency(const VALUE obj)
* 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));
+ if (RVALUE_MARKING_BITMAP(obj)) {
+ if (!is_marking(objspace) && !RVALUE_MARK_BITMAP(obj)) rb_bug("check_rvalue_consistency: %s is marking, but not marked.", obj_info(obj));
}
}
+#endif
return obj;
}
-#endif
static inline int
RVALUE_MARKED(VALUE obj)
@@ -1153,10 +1020,10 @@ RVALUE_REMEMBERED(VALUE obj)
}
static inline int
-RVALUE_UNCOLLECTIBLE(VALUE obj)
+RVALUE_LONG_LIVED(VALUE obj)
{
check_rvalue_consistency(obj);
- return RVALUE_UNCOLLECTIBLE_BITMAP(obj) != 0;
+ return RVALUE_LONG_LIVED_BITMAP(obj) != 0;
}
static inline int
@@ -1183,9 +1050,9 @@ RVALUE_AGE(VALUE obj)
#endif
static inline void
-RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
+RVALUE_PROMOTE_RAW(rb_objspace_t *objspace, VALUE obj)
{
- MARK_IN_BITMAP(&page->uncollectible_bits[0], obj);
+ MARK_IN_BITMAP(GET_HEAP_LONG_LIVED_BITS(obj), obj);
objspace->rgengc.old_objects++;
#if RGENGC_PROFILE >= 2
@@ -1194,12 +1061,6 @@ RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(rb_objspace_t *objspace, struct heap_page *pag
#endif
}
-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_FLAGS_AGE_SET(VALUE flags, int age)
{
@@ -1223,7 +1084,7 @@ RVALUE_AGE_INC(rb_objspace_t *objspace, VALUE obj)
RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(flags, age);
if (age == RVALUE_OLD_AGE) {
- RVALUE_OLD_UNCOLLECTIBLE_SET(objspace, obj);
+ RVALUE_PROMOTE_RAW(objspace, obj);
}
check_rvalue_consistency(obj);
}
@@ -1233,10 +1094,10 @@ static inline void
RVALUE_AGE_SET_OLD(rb_objspace_t *objspace, VALUE obj)
{
check_rvalue_consistency(obj);
- GC_ASSERT(!RVALUE_OLD_P(obj));
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, RVALUE_OLD_AGE);
- RVALUE_OLD_UNCOLLECTIBLE_SET(objspace, obj);
+ RVALUE_PROMOTE_RAW(objspace, obj);
check_rvalue_consistency(obj);
}
@@ -1246,7 +1107,7 @@ static inline void
RVALUE_AGE_SET_CANDIDATE(rb_objspace_t *objspace, VALUE obj)
{
check_rvalue_consistency(obj);
- GC_ASSERT(!RVALUE_OLD_P(obj));
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, RVALUE_OLD_AGE - 1);
@@ -1257,18 +1118,14 @@ 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);
+ CLEAR_IN_BITMAP(GET_HEAP_LONG_LIVED_BITS(obj), obj);
}
static inline void
RVALUE_DEMOTE(rb_objspace_t *objspace, VALUE obj)
{
check_rvalue_consistency(obj);
- GC_ASSERT(RVALUE_OLD_P(obj));
-
- if (!is_incremental_marking(objspace) && RVALUE_REMEMBERED(obj)) {
- CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
- }
+ if (RGENGC_CHECK_MODE) assert(RVALUE_OLD_P(obj));
RVALUE_DEMOTE_RAW(objspace, obj);
@@ -1280,18 +1137,13 @@ RVALUE_DEMOTE(rb_objspace_t *objspace, VALUE 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);
- GC_ASSERT(!RVALUE_OLD_P(obj));
+ if (RGENGC_CHECK_MODE) assert(!RVALUE_OLD_P(obj));
+
+ RBASIC(obj)->flags = RVALUE_FLAGS_AGE_SET(RBASIC(obj)->flags, 0);
- RVALUE_AGE_RESET_RAW(obj);
check_rvalue_consistency(obj);
}
@@ -1321,28 +1173,24 @@ RVALUE_WHITE_P(VALUE obj)
--------------------------- ObjectSpace -----------------------------
*/
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
rb_objspace_t *
rb_objspace_alloc(void)
{
-#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)
{
- 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;
@@ -1366,67 +1214,43 @@ rb_objspace_free(rb_objspace_t *objspace)
heap_pages_lomem = 0;
heap_pages_himem = 0;
- objspace->eden_heap.total_pages = 0;
+ objspace->eden_heap.page_length = 0;
objspace->eden_heap.total_slots = 0;
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);
}
-
-static void
-heap_pages_expand_sorted_to(rb_objspace_t *objspace, size_t next_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);
-
- 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 (sorted == 0) {
- rb_memerror();
- }
-
- heap_pages_sorted_length = next_length;
-}
+#endif
static void
heap_pages_expand_sorted(rb_objspace_t *objspace)
{
- /* usually heap_allocatable_pages + heap_eden->total_pages == heap_pages_sorted_length
- * beacuse heap_allocatable_pages contains heap_tomb->total_pages (recycle heap_tomb pages).
- * howerver, if there are pages which do not have empty slots, then try to create new pages
- * so that the additional allocatable_pages counts (heap_tomb->total_pages) are added.
- */
size_t next_length = heap_allocatable_pages;
- next_length += heap_eden->total_pages;
- next_length += heap_tomb->total_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);
- }
+ struct heap_page **sorted;
+ size_t size = next_length * sizeof(struct heap_page *);
- GC_ASSERT(heap_allocatable_pages + heap_eden->total_pages <= heap_pages_sorted_length);
- GC_ASSERT(heap_allocated_pages <= heap_pages_sorted_length);
-}
+ gc_report(3, objspace, "heap_pages_expand_sorted: next_length: %d, size: %d\n", (int)next_length, (int)size);
-static void
-heap_allocatable_pages_set(rb_objspace_t *objspace, size_t s)
-{
- heap_allocatable_pages = s;
- heap_pages_expand_sorted(objspace);
-}
+ 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 (sorted == 0) {
+ rb_memerror();
+ }
+ heap_pages_sorted_length = next_length;
+ }
+}
static inline void
heap_page_add_freeobj(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
@@ -1452,21 +1276,14 @@ heap_add_freepage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *pa
}
}
-#if GC_ENABLE_INCREMENTAL_MARK
-static inline int
+static inline void
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)
@@ -1476,7 +1293,8 @@ heap_unlink_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *pag
if (heap->pages == page) heap->pages = page->next;
page->prev = NULL;
page->next = NULL;
- heap->total_pages--;
+ page->heap = NULL;
+ heap->page_length--;
heap->total_slots -= page->total_slots;
}
@@ -1485,7 +1303,7 @@ heap_page_free(rb_objspace_t *objspace, struct heap_page *page)
{
heap_allocated_pages--;
objspace->profile.total_freed_pages++;
- aligned_free(GET_PAGE_BODY(page->start));
+ aligned_free(page->body);
free(page);
}
@@ -1494,22 +1312,29 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
{
size_t i, j;
- if (heap_tomb->pages) {
+ 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->flags.in_tomb && page->free_slots == page->total_slots) {
- heap_unlink_page(objspace, heap_tomb, page);
- heap_page_free(objspace, page);
- }
- else {
- if (i != j) {
- heap_pages_sorted[j] = page;
+ 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;
}
- j++;
+ else if (i == j) {
+ return; /* no need to check rest pages */
+ }
+ }
+ if (i != j) {
+ heap_pages_sorted[j] = page;
}
+ j++;
}
- GC_ASSERT(j == heap_allocated_pages);
+ if (RGENGC_CHECK_MODE) assert(j == heap_allocated_pages);
}
}
@@ -1520,10 +1345,10 @@ heap_page_allocate(rb_objspace_t *objspace)
struct heap_page *page;
struct heap_page_body *page_body = 0;
size_t hi, lo, mid;
- int limit = HEAP_PAGE_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_PAGE_ALIGN, HEAP_PAGE_SIZE);
+ page_body = (struct heap_page_body *)aligned_malloc(HEAP_ALIGN, HEAP_SIZE);
if (page_body == 0) {
rb_memerror();
}
@@ -1535,14 +1360,7 @@ heap_page_allocate(rb_objspace_t *objspace)
rb_memerror();
}
- /* 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_PAGE_SIZE - (int)((VALUE)start - (VALUE)page_body))/(int)sizeof(RVALUE);
- }
- end = start + limit;
+ page->body = page_body;
/* setup heap_pages_sorted */
lo = 0;
@@ -1552,17 +1370,16 @@ heap_page_allocate(rb_objspace_t *objspace)
mid = (lo + hi) / 2;
mid_page = heap_pages_sorted[mid];
- if (mid_page->start < start) {
+ if (mid_page->body < page_body) {
lo = mid + 1;
}
- else if (mid_page->start > start) {
+ else if (mid_page->body > page_body) {
hi = mid;
}
else {
rb_bug("same heap page is allocated: %p at %"PRIuVALUE, (void *)page_body, (VALUE)mid);
}
}
-
if (hi < heap_allocated_pages) {
MEMMOVE(&heap_pages_sorted[hi+1], &heap_pages_sorted[hi], struct heap_page_header*, heap_allocated_pages - hi);
}
@@ -1570,17 +1387,18 @@ heap_page_allocate(rb_objspace_t *objspace)
heap_pages_sorted[hi] = page;
heap_allocated_pages++;
-
- GC_ASSERT(heap_eden->total_pages + heap_allocatable_pages <= heap_pages_sorted_length);
- GC_ASSERT(heap_eden->total_pages + heap_tomb->total_pages == heap_allocated_pages - 1);
- GC_ASSERT(heap_allocated_pages <= heap_pages_sorted_length);
-
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);
+ if (RGENGC_CHECK_MODE) assert(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 - (int)((VALUE)start - (VALUE)page_body))/(int)sizeof(RVALUE);
}
+ end = start + limit;
if (heap_pages_lomem == 0 || heap_pages_lomem > start) heap_pages_lomem = start;
if (heap_pages_himem < end) heap_pages_himem = end;
@@ -1601,48 +1419,37 @@ heap_page_allocate(rb_objspace_t *objspace)
static struct heap_page *
heap_page_resurrect(rb_objspace_t *objspace)
{
- struct heap_page *page = heap_tomb->pages;
+ struct heap_page *page;
- while (page) {
- if (page->freelist != NULL) {
- heap_unlink_page(objspace, heap_tomb, page);
- return page;
- }
- page = page->next;
+ if ((page = heap_tomb->pages) != NULL) {
+ heap_unlink_page(objspace, heap_tomb, page);
+ return page;
}
-
-
-
return NULL;
}
static struct heap_page *
heap_page_create(rb_objspace_t *objspace)
{
- struct heap_page *page;
+ struct heap_page *page = heap_page_resurrect(objspace);
const char *method = "recycle";
-
- heap_allocatable_pages--;
-
- page = heap_page_resurrect(objspace);
-
if (page == NULL) {
page = heap_page_allocate(objspace);
method = "allocate";
}
- if (0) fprintf(stderr, "heap_page_create: %s - %p, heap_allocated_pages: %d, heap_allocated_pages: %d, tomb->total_pages: %d\n",
- method, page, (int)heap_pages_sorted_length, (int)heap_allocated_pages, (int)heap_tomb->total_pages);
+ 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;
}
static void
heap_add_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
{
- page->flags.in_tomb = (heap == heap_tomb);
+ page->heap = heap;
page->next = heap->pages;
if (heap->pages) heap->pages->prev = page;
heap->pages = page;
- heap->total_pages++;
+ heap->page_length++;
heap->total_slots += page->total_slots;
}
@@ -1659,63 +1466,38 @@ heap_add_pages(rb_objspace_t *objspace, rb_heap_t *heap, size_t add)
{
size_t i;
- heap_allocatable_pages_set(objspace, add);
-
+ heap_allocatable_pages = add;
+ heap_pages_expand_sorted(objspace);
for (i = 0; i < add; i++) {
heap_assign_page(objspace, heap);
}
-
- GC_ASSERT(heap_allocatable_pages == 0);
+ heap_allocatable_pages = 0;
}
static size_t
-heap_extend_pages(rb_objspace_t *objspace, size_t free_slots, size_t total_slots)
+heap_extend_pages(rb_objspace_t *objspace)
{
- double goal_ratio = gc_params.heap_free_slots_goal_ratio;
- size_t used = heap_allocated_pages + heap_allocatable_pages;
- size_t next_used;
-
- if (goal_ratio == 0.0) {
- next_used = (size_t)(used * gc_params.growth_factor);
- }
- else {
- /* Find `f' where free_slots = f * total_slots * goal_ratio
- * => f = (total_slots - free_slots) / ((1 - goal_ratio) * total_slots)
- */
- double f = (double)(total_slots - free_slots) / ((1 - goal_ratio) * total_slots);
-
- if (f > gc_params.growth_factor) f = gc_params.growth_factor;
- if (f < 1.0) f = 1.1;
-
- next_used = (size_t)(f * used);
-
- if (0) {
- fprintf(stderr,
- "free_slots(%8"PRIuSIZE")/total_slots(%8"PRIuSIZE")=%1.2f,"
- " G(%1.2f), f(%1.2f),"
- " used(%8"PRIuSIZE") => next_used(%8"PRIuSIZE")\n",
- free_slots, total_slots, free_slots/(double)total_slots,
- goal_ratio, f, used, next_used);
- }
- }
+ 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 = (size_t)(used + gc_params.growth_max_slots/HEAP_PAGE_OBJ_LIMIT);
- if (next_used > max_used) next_used = max_used;
+ 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;
}
- return next_used - used;
+ return next_used_limit - used;
}
static void
heap_set_increment(rb_objspace_t *objspace, size_t additional_pages)
{
- size_t used = heap_eden->total_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_set(objspace, next_used_limit - used);
+ heap_allocatable_pages = next_used_limit - used;
+ heap_pages_expand_sorted(objspace);
gc_report(1, objspace, "heap_set_increment: heap_allocatable_pages is %d\n", (int)heap_allocatable_pages);
}
@@ -1724,12 +1506,9 @@ static int
heap_increment(rb_objspace_t *objspace, rb_heap_t *heap)
{
if (heap_allocatable_pages > 0) {
- gc_report(1, objspace, "heap_increment: heap_pages_sorted_length: %d, heap_pages_inc: %d, heap->total_pages: %d\n",
- (int)heap_pages_sorted_length, (int)heap_allocatable_pages, (int)heap->total_pages);
-
- GC_ASSERT(heap_allocatable_pages + heap_eden->total_pages <= heap_pages_sorted_length);
- GC_ASSERT(heap_allocated_pages <= heap_pages_sorted_length);
-
+ 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;
}
@@ -1739,18 +1518,14 @@ heap_increment(rb_objspace_t *objspace, rb_heap_t *heap)
static void
heap_prepare(rb_objspace_t *objspace, rb_heap_t *heap)
{
- GC_ASSERT(heap->free_pages == NULL);
+ if (RGENGC_CHECK_MODE) assert(heap->free_pages == NULL);
-#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);
}
-#endif
if (heap->free_pages == NULL &&
(will_be_incremental_marking(objspace) || heap_increment(objspace, heap) == FALSE) &&
@@ -1765,14 +1540,14 @@ heap_get_freeobj_from_next_freepage(rb_objspace_t *objspace, rb_heap_t *heap)
struct heap_page *page;
RVALUE *p;
- while (heap->free_pages == NULL) {
+ while (UNLIKELY(heap->free_pages == NULL)) {
heap_prepare(objspace, heap);
}
page = heap->free_pages;
heap->free_pages = page->free_next;
heap->using_page = page;
- GC_ASSERT(page->free_slots != 0);
+ if (RGENGC_CHECK_MODE) assert(page->free_slots != 0);
p = page->freelist;
page->freelist = NULL;
page->free_slots = 0;
@@ -1780,16 +1555,6 @@ heap_get_freeobj_from_next_freepage(rb_objspace_t *objspace, rb_heap_t *heap)
}
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;
@@ -1810,60 +1575,70 @@ 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_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
+gc_event_hook_body(rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
{
- EXEC_EVENT_HOOK(ec, event, ec->cfp->self, 0, 0, 0, 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(gc_event_hook_needed_p(objspace, event))) { \
- gc_event_hook_body(GET_EC(), (objspace), (event), (data)); \
+ if (UNLIKELY((objspace)->hook_events & (event))) { \
+ gc_event_hook_body((objspace), (event), (data)); \
} \
} while (0)
-static inline VALUE
-newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_protected, rb_objspace_t *objspace, VALUE obj)
+static VALUE
+newobj_of(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3)
{
- GC_ASSERT(BUILTIN_TYPE(obj) == T_NONE);
- GC_ASSERT((flags & FL_WB_PROTECTED) == 0);
+ rb_objspace_t *objspace = &rb_objspace;
+ 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);
+
+ if (RGENGC_CHECK_MODE > 0) assert(BUILTIN_TYPE(obj) == T_NONE);
/* OBJSETUP */
- RBASIC(obj)->flags = flags;
+ RBASIC(obj)->flags = flags & ~FL_WB_PROTECTED;
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 RGENGC_CHECK_MODE
- GC_ASSERT(RVALUE_MARKED(obj) == FALSE);
- GC_ASSERT(RVALUE_MARKING(obj) == FALSE);
- GC_ASSERT(RVALUE_OLD_P(obj) == FALSE);
- GC_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));
- }
+ assert(RVALUE_MARKED(obj) == FALSE);
+ assert(RVALUE_MARKING(obj) == FALSE);
+ assert(RVALUE_OLD_P(obj) == FALSE);
+ assert(RVALUE_WB_UNPROTECTED(obj) == FALSE);
+ 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)) {
+ if ((flags & FL_WB_PROTECTED) == 0) {
MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
}
#endif
#if RGENGC_PROFILE
- if (wb_protected) {
+ if (flags & FL_WB_PROTECTED) {
objspace->profile.total_generated_normal_object_count++;
#if RGENGC_PROFILE >= 2
objspace->profile.generated_normal_object_count_types[BUILTIN_TYPE(obj)]++;
@@ -1878,214 +1653,61 @@ newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_prote
#endif
#if GC_DEBUG
- RANY(obj)->file = rb_source_location_cstr(&RANY(obj)->line);
- GC_ASSERT(!SPECIAL_CONST_P(obj)); /* check alignment */
+ RANY(obj)->file = rb_sourcefile();
+ RANY(obj)->line = rb_sourceline();
+ assert(!SPECIAL_CONST_P(obj)); /* check alignment */
#endif
objspace->total_allocated_objects++;
-
- 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;
-}
-
-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);
+ gc_report(5, objspace, "newobj: %s\n", obj_info(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)
-{
- GC_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)
-{
- GC_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, FALSE);
+ return newobj_of(0, T_NONE, 0, 0, 0);
}
VALUE
rb_newobj_of(VALUE klass, VALUE flags)
{
- return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED);
+ return newobj_of(klass, flags, 0, 0, 0);
}
-#define UNEXPECTED_NODE(func) \
- rb_bug(#func"(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, \
- BUILTIN_TYPE(obj), (void*)(obj), RBASIC(obj)->flags)
-
-#undef rb_imemo_new
-
-VALUE
-rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
+NODE*
+rb_node_newnode(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
{
- VALUE flags = T_IMEMO | (type << FL_USHIFT);
- return newobj_of(v0, flags, v1, v2, v3, TRUE);
-}
-
-rb_imemo_alloc_t *
-rb_imemo_alloc_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
-{
- VALUE flags = T_IMEMO | (imemo_alloc << FL_USHIFT);
- return (rb_imemo_alloc_t *)newobj_of(v0, flags, v1, v2, v3, FALSE);
-}
-
-#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)
-{
- 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;
+ 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);
+ nd_set_type(n, type);
+ return n;
}
-#endif
VALUE
-rb_data_object_wrap(VALUE klass, void *datap, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
+rb_data_object_alloc(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, FALSE);
+ return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap);
}
-#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_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)
+rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *type)
{
if (klass) Check_Type(klass, T_CLASS);
- 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;
+ return newobj_of(klass, T_DATA | (type->flags & ~T_MASK), (VALUE)type, (VALUE)1, (VALUE)datap);
}
size_t
rb_objspace_data_type_memsize(VALUE obj)
{
- 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);
- }
+ if (RTYPEDDATA_P(obj) && RTYPEDDATA_TYPE(obj)->function.dsize) {
+ return RTYPEDDATA_TYPE(obj)->function.dsize(RTYPEDDATA_DATA(obj));
+ }
+ else {
+ return 0;
}
- return 0;
}
const char *
@@ -2099,7 +1721,6 @@ rb_objspace_data_type_name(VALUE obj)
}
}
-PUREFUNC(static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr);)
static inline int
is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
{
@@ -2129,19 +1750,45 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
return FALSE;
}
-static enum rb_id_table_iterator_result
-free_const_entry_i(VALUE value, void *data)
+static int
+free_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ rb_method_entry_t *me = (rb_method_entry_t *)value;
+ if (!me->mark) {
+ rb_free_method_entry(me);
+ }
+ return ST_CONTINUE;
+}
+
+static 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(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 ID_TABLE_CONTINUE;
+ return ST_CONTINUE;
}
void
-rb_free_const_table(struct rb_id_table *tbl)
+rb_free_const_table(st_table *tbl)
{
- rb_id_table_foreach_values(tbl, free_const_entry_i, 0);
- rb_id_table_free(tbl);
+ st_foreach(tbl, free_const_entry_i, 0);
+ st_free_table(tbl);
}
static inline void
@@ -2165,8 +1812,6 @@ make_io_zombie(rb_objspace_t *objspace, VALUE obj)
static int
obj_free(rb_objspace_t *objspace, VALUE obj)
{
- RB_DEBUG_COUNTER_INC(obj_free);
-
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_FREEOBJ, obj);
switch (BUILTIN_TYPE(obj)) {
@@ -2191,7 +1836,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
CHECK(RVALUE_WB_UNPROTECTED);
CHECK(RVALUE_MARKED);
CHECK(RVALUE_MARKING);
- CHECK(RVALUE_UNCOLLECTIBLE);
+ CHECK(RVALUE_LONG_LIVED);
#undef CHECK
#endif
#endif
@@ -2201,15 +1846,13 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
if (!(RANY(obj)->as.basic.flags & ROBJECT_EMBED) &&
RANY(obj)->as.object.as.heap.ivptr) {
xfree(RANY(obj)->as.object.as.heap.ivptr);
- RB_DEBUG_COUNTER_INC(obj_obj_ptr);
- }
- else {
- RB_DEBUG_COUNTER_INC(obj_obj_embed);
}
break;
case T_MODULE:
case T_CLASS:
- rb_id_table_free(RCLASS_M_TBL(obj));
+ if (RCLASS_M_TBL_WRAPPER(obj)) {
+ rb_free_m_tbl_wrapper(RCLASS_M_TBL_WRAPPER(obj));
+ }
if (RCLASS_IV_TBL(obj)) {
st_free_table(RCLASS_IV_TBL(obj));
}
@@ -2301,13 +1944,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
case T_COMPLEX:
break;
case T_ICLASS:
- /* 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));
- }
+ /* iClass shares table with the module */
if (RCLASS_EXT(obj)->subclasses) {
rb_class_detach_subclasses(obj);
RCLASS_EXT(obj)->subclasses = NULL;
@@ -2328,8 +1965,8 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
case T_NODE:
- UNEXPECTED_NODE(obj_free);
- break;
+ rb_gc_free_node(obj);
+ break; /* no need to free iv_tbl */
case T_STRUCT:
if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
@@ -2344,29 +1981,6 @@ obj_free(rb_objspace_t *objspace, VALUE 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;
- case imemo_env:
- GC_ASSERT(VM_ENV_ESCAPED_P(RANY(obj)->as.imemo.env.ep));
- xfree((VALUE *)RANY(obj)->as.imemo.env.env);
- break;
- case imemo_alloc:
- xfree(RANY(obj)->as.imemo.alloc.ptr);
- break;
- case imemo_ast:
- rb_ast_free(&RANY(obj)->as.imemo.ast);
- 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);
@@ -2386,11 +2000,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_PAGE_OBJ_LIMIT);
+ heap_add_pages(objspace, heap_eden, gc_params.heap_init_slots / HEAP_OBJ_LIMIT);
init_mark_stack(&objspace->mark_stack);
#ifdef USE_SIGALTSTACK
@@ -2407,14 +2023,6 @@ Init_heap(void)
finalizer_table = st_init_numtable();
}
-void
-Init_gc_stress(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
-
- gc_stress_set(objspace, ruby_initial_gc_stress);
-}
-
typedef int each_obj_callback(void *, void *, size_t, void *);
struct each_obj_args {
@@ -2426,18 +2034,20 @@ static VALUE
objspace_each_objects(VALUE arg)
{
size_t i;
+ struct heap_page_body *last_body = 0;
struct heap_page *page;
- RVALUE *pstart = NULL, *pend;
+ RVALUE *pstart, *pend;
rb_objspace_t *objspace = &rb_objspace;
struct each_obj_args *args = (struct each_obj_args *)arg;
i = 0;
while (i < heap_allocated_pages) {
- while (0 < i && pstart < heap_pages_sorted[i-1]->start) i--;
- while (i < heap_allocated_pages && heap_pages_sorted[i]->start <= pstart) i++;
+ while (0 < i && last_body < heap_pages_sorted[i-1]->body) i--;
+ 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->total_slots;
@@ -2538,20 +2148,14 @@ internal_object_p(VALUE obj)
if (p->as.basic.flags) {
switch (BUILTIN_TYPE(p)) {
- case T_NODE:
- UNEXPECTED_NODE(internal_object_p);
- break;
case T_NONE:
- case T_IMEMO:
case T_ICLASS:
+ case T_NODE:
case T_ZOMBIE:
break;
case T_CLASS:
- if (!p->as.basic.klass) break;
- if (FL_TEST(obj, FL_SINGLETON)) {
- return rb_singleton_class_internal_p(obj);
- }
- return 0;
+ if (FL_TEST(p, FL_SINGLETON))
+ break;
default:
if (!p->as.basic.klass) break;
return 0;
@@ -2598,7 +2202,7 @@ os_obj_of(VALUE of)
/*
* call-seq:
- * ObjectSpace.each_object([module]) {|obj| ... } -> integer
+ * ObjectSpace.each_object([module]) {|obj| ... } -> fixnum
* ObjectSpace.each_object([module]) -> an_enumerator
*
* Calls the block once for each living, nonimmediate object in this
@@ -2695,9 +2299,7 @@ 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. 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.
+ * was destroyed.
*
*/
@@ -2732,20 +2334,6 @@ 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 {
@@ -2780,52 +2368,38 @@ rb_gc_copy_finalizer(VALUE dest, VALUE obj)
}
static VALUE
-run_single_final(VALUE final, VALUE objid)
+run_single_final(VALUE arg)
{
- const VALUE cmd = RARRAY_AREF(final, 1);
- const int level = OBJ_TAINTED(cmd) ?
- RUBY_SAFE_LEVEL_MAX : FIX2INT(RARRAY_AREF(final, 0));
-
- rb_set_safe_level_force(level);
- return rb_check_funcall(cmd, idCall, 1, &objid);
+ VALUE *args = (VALUE *)arg;
+ rb_eval_cmd(args[0], args[1], (int)args[2]);
+ return Qnil;
}
static void
run_finalizer(rb_objspace_t *objspace, VALUE obj, VALUE table)
{
long i;
- enum ruby_tag_type state;
- volatile struct {
- VALUE errinfo;
- VALUE objid;
- rb_control_frame_t *cfp;
- long finished;
- int safe;
- } saved;
- rb_execution_context_t * volatile ec = GET_EC();
-#define RESTORE_FINALIZER() (\
- ec->cfp = saved.cfp, \
- rb_set_safe_level_force(saved.safe), \
- rb_set_errinfo(saved.errinfo))
-
- saved.safe = rb_safe_level();
- saved.errinfo = rb_errinfo();
- saved.objid = nonspecial_obj_id(obj);
- saved.cfp = ec->cfp;
- saved.finished = 0;
-
- EC_PUSH_TAG(ec);
- state = EC_EXEC_TAG();
- if (state != TAG_NONE) {
- ++saved.finished; /* skip failed finalizer */
- }
- for (i = saved.finished;
- RESTORE_FINALIZER(), i<RARRAY_LEN(table);
- saved.finished = ++i) {
- run_single_final(RARRAY_AREF(table, i), saved.objid);
- }
- EC_POP_TAG();
-#undef RESTORE_FINALIZER
+ int status;
+ VALUE args[3];
+ VALUE objid = nonspecial_obj_id(obj);
+
+ if (RARRAY_LEN(table) > 0) {
+ args[1] = rb_obj_freeze(rb_ary_new3(1, objid));
+ }
+ else {
+ args[1] = 0;
+ }
+
+ 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;
+ rb_protect(run_single_final, (VALUE)args, &status);
+ if (status)
+ rb_set_errinfo(Qnil);
+ }
}
static void
@@ -2858,6 +2432,7 @@ finalize_list(rb_objspace_t *objspace, VALUE zombie)
page->free_slots++;
heap_page_add_freeobj(objspace, GET_HEAP_PAGE(zombie), zombie);
+ heap_pages_swept_slots++;
objspace->profile.total_freed_objects++;
zombie = next_zombie;
@@ -2869,7 +2444,7 @@ finalize_deferred(rb_objspace_t *objspace)
{
VALUE zombie;
- while ((zombie = ATOMIC_VALUE_EXCHANGE(heap_pages_deferred_final, 0)) != 0) {
+ while ((zombie = (VALUE)ATOMIC_PTR_EXCHANGE(heap_pages_deferred_final, 0)) != 0) {
finalize_list(objspace, zombie);
}
}
@@ -2877,7 +2452,7 @@ finalize_deferred(rb_objspace_t *objspace)
static void
gc_finalize_deferred(void *dmy)
{
- rb_objspace_t *objspace = dmy;
+ rb_objspace_t *objspace = &rb_objspace;
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
finalize_deferred(objspace);
ATOMIC_SET(finalizing, 0);
@@ -2891,9 +2466,9 @@ rb_gc_finalize_deferred(void)
}
static void
-gc_finalize_deferred_register(rb_objspace_t *objspace)
+gc_finalize_deferred_register(void)
{
- if (rb_postponed_job_register_one(0, gc_finalize_deferred, objspace) == 0) {
+ if (rb_postponed_job_register_one(0, gc_finalize_deferred, 0) == 0) {
rb_bug("gc_finalize_deferred_register: can't register finalizer.");
}
}
@@ -2937,11 +2512,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
/* run finalizers */
finalize_deferred(objspace);
- GC_ASSERT(heap_pages_deferred_final == 0);
-
- gc_rest(objspace);
- /* prohibit incremental GC */
- objspace->flags.dont_incremental = 1;
+ assert(heap_pages_deferred_final == 0);
/* force to run finalizer */
while (finalizer_table->num_entries) {
@@ -2957,13 +2528,10 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
}
}
- /* prohibit GC because force T_DATA finalizers can break an object graph consistency */
- dont_gc = 1;
-
- /* running data/file finalizers are part of garbage collection */
+ /* finalizers are part of garbage collection */
gc_enter(objspace, "rb_objspace_call_finalizer");
- /* run data/file object's finalizers */
+ /* run data 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) {
@@ -3005,7 +2573,6 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
ATOMIC_SET(finalizing, 0);
}
-PUREFUNC(static inline int is_id_value(rb_objspace_t *objspace, VALUE ptr));
static inline int
is_id_value(rb_objspace_t *objspace, VALUE ptr)
{
@@ -3124,7 +2691,7 @@ id2ref(VALUE obj, VALUE objid)
if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
ID symid = ptr / sizeof(RVALUE);
- if (rb_id2str(symid) == 0)
+ if (rb_id2name(symid) == 0)
rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
return ID2SYM(symid);
}
@@ -3135,9 +2702,6 @@ 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;
}
@@ -3151,14 +2715,13 @@ id2ref(VALUE obj, VALUE objid)
*
* Returns an integer identifier for +obj+.
*
- * 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.
- *
- * Note: that some objects of builtin classes are reused for optimization.
- * This is the case for immediate values and frozen string literals.
+ * 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.
*
+ * Note that some objects of builtin classes are reused for optimization.
+ * This is the case for immediate values and frozen string litterals.
* Immediate values are not passed by reference but are passed by value:
- * +nil+, +true+, +false+, Fixnums, Symbols, and some Floats.
+ * +nil+, +true+, +false+, Fixnums, Symbols. Some Floats may be immediates too.
*
* Object.new.object_id == Object.new.object_id # => false
* (21 * 2).object_id == (21 * 2).object_id # => true
@@ -3213,6 +2776,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
@@ -3237,8 +2804,11 @@ obj_memsize_of(VALUE obj, int use_all_types)
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 += rb_id_table_memsize(RCLASS_M_TBL(obj));
+ size += st_memsize(RCLASS_M_TBL(obj));
}
if (RCLASS_EXT(obj)) {
if (RCLASS_IV_TBL(obj)) {
@@ -3251,18 +2821,11 @@ obj_memsize_of(VALUE obj, int use_all_types)
size += st_memsize(RCLASS(obj)->ptr->iv_tbl);
}
if (RCLASS(obj)->ptr->const_tbl) {
- size += rb_id_table_memsize(RCLASS(obj)->ptr->const_tbl);
+ size += st_memsize(RCLASS(obj)->ptr->const_tbl);
}
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;
@@ -3275,8 +2838,8 @@ obj_memsize_of(VALUE obj, int use_all_types)
}
break;
case T_REGEXP:
- if (RREGEXP_PTR(obj)) {
- size += onig_memsize(RREGEXP_PTR(obj));
+ if (RREGEXP(obj)->ptr) {
+ size += onig_memsize(RREGEXP(obj)->ptr);
}
break;
case T_DATA:
@@ -3297,10 +2860,9 @@ obj_memsize_of(VALUE obj, int use_all_types)
break;
case T_RATIONAL:
case T_COMPLEX:
- case T_IMEMO:
- if (imemo_type_p(obj, imemo_alloc)) {
- size += RANY(obj)->as.imemo.alloc.cnt * sizeof(VALUE);
- }
+ break;
+ case T_ICLASS:
+ /* iClass shares table with the module */
break;
case T_FLOAT:
@@ -3314,7 +2876,7 @@ obj_memsize_of(VALUE obj, int use_all_types)
break;
case T_NODE:
- UNEXPECTED_NODE(obj_memsize_of);
+ if (use_all_types) size += rb_node_memsize(obj);
break;
case T_STRUCT:
@@ -3332,7 +2894,7 @@ obj_memsize_of(VALUE obj, int use_all_types)
BUILTIN_TYPE(obj), (void*)obj);
}
- return size + sizeof(RVALUE);
+ return size;
}
size_t
@@ -3354,7 +2916,7 @@ set_zero(st_data_t key, st_data_t val, st_data_t arg)
* call-seq:
* ObjectSpace.count_objects([result_hash]) -> hash
*
- * Counts all objects grouped by type.
+ * Counts objects for each type.
*
* It returns a hash, such as:
* {
@@ -3368,19 +2930,9 @@ 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.
*
*/
@@ -3454,8 +3006,8 @@ 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);
COUNT_TYPE(T_ZOMBIE);
#undef COUNT_TYPE
@@ -3497,14 +3049,16 @@ gc_setup_mark_bits(struct heap_page *page)
{
#if USE_RGENGC
/* copy oldgen bitmap to mark bitmap */
- memcpy(&page->mark_bits[0], &page->uncollectible_bits[0], HEAP_PAGE_BITMAP_SIZE);
+ memcpy(&page->mark_bits[0], &page->long_lived_bits[0], HEAP_BITMAP_SIZE);
#else
/* clear mark bitmap */
- memset(&page->mark_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
+ memset(&page->mark_bits[0], 0, HEAP_BITMAP_SIZE);
#endif
}
-static inline int
+/* 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;
@@ -3524,7 +3078,7 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
bits[BITMAP_INDEX(p)] |= BITMAP_BIT(p)-1;
bits[BITMAP_INDEX(pend)] |= ~(BITMAP_BIT(pend) - 1);
- for (i=0; i < HEAP_PAGE_BITMAP_LIMIT; i++) {
+ for (i=0; i < HEAP_BITMAP_LIMIT; i++) {
bitset = ~bits[i];
if (bitset) {
p = offset + i * BITS_BITLENGTH;
@@ -3532,11 +3086,11 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
if (bitset & 1) {
switch (BUILTIN_TYPE(p)) {
default: { /* majority case */
- gc_report(2, objspace, "page_sweep: free %p\n", (void *)p);
+ gc_report(2, objspace, "page_sweep: free %s\n", obj_info((VALUE)p));
#if USE_RGENGC && RGENGC_CHECK_MODE
if (!is_full_marking(objspace)) {
- if (RVALUE_OLD_P((VALUE)p)) rb_bug("page_sweep: %p - old while minor GC.", (void *)p);
- if (rgengc_remembered(objspace, (VALUE)p)) rb_bug("page_sweep: %p - remembered.", (void *)p);
+ 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)) {
@@ -3580,7 +3134,7 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
(int)sweep_page->total_slots,
freed_slots, empty_slots, final_slots);
- sweep_page->free_slots = freed_slots + empty_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;
@@ -3588,13 +3142,11 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
if (heap_pages_deferred_final && !finalizing) {
rb_thread_t *th = GET_THREAD();
if (th) {
- gc_finalize_deferred_register(objspace);
+ gc_finalize_deferred_register();
}
}
gc_report(2, objspace, "page_sweep: end.\n");
-
- return freed_slots + empty_slots;
}
/* allocate additional minimum page to work */
@@ -3610,30 +3162,18 @@ gc_heap_prepare_minimum_pages(rb_objspace_t *objspace, rb_heap_t *heap)
}
}
-static const char *
-gc_mode_name(enum gc_mode mode)
-{
- switch (mode) {
- case gc_mode_none: return "none";
- case gc_mode_marking: return "marking";
- case gc_mode_sweeping: return "sweeping";
- default: rb_bug("gc_mode_name: unknown mode: %d", (int)mode);
- }
-}
-
static void
-gc_mode_transition(rb_objspace_t *objspace, enum gc_mode mode)
+gc_stat_transition(rb_objspace_t *objspace, enum gc_stat stat)
{
#if RGENGC_CHECK_MODE
- enum gc_mode prev_mode = gc_mode(objspace);
- switch (prev_mode) {
- case gc_mode_none: GC_ASSERT(mode == gc_mode_marking); break;
- case gc_mode_marking: GC_ASSERT(mode == gc_mode_sweeping); break;
- case gc_mode_sweeping: GC_ASSERT(mode == gc_mode_none); break;
+ 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
- if (0) fprintf(stderr, "gc_mode_transition: %s->%s\n", gc_mode_name(gc_mode(objspace)), gc_mode_name(mode));
- gc_mode_set(objspace, mode);
+ objspace->flags.stat = stat;
}
static void
@@ -3641,10 +3181,8 @@ 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) {
@@ -3662,25 +3200,54 @@ __attribute__((noinline))
static void
gc_sweep_start(rb_objspace_t *objspace)
{
- gc_mode_transition(objspace, gc_mode_sweeping);
- gc_sweep_start_heap(objspace, heap_eden);
+ rb_heap_t *heap;
+ size_t total_limit_slot;
+
+ gc_stat_transition(objspace, gc_stat_sweeping);
+
+ /* sweep unlinked method entries */
+ if (GET_VM()->unlinked_method_entry_list) {
+ rb_sweep_method_entry(GET_VM());
+ }
+
+ /* 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 * 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 * 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;
+ }
+ if (0) fprintf(stderr, "heap_pages_min_free_slots: %d, heap_pages_max_free_slots: %d\n",
+ (int)heap_pages_min_free_slots, (int)heap_pages_max_free_slots);
+
+ heap = heap_eden;
+ gc_sweep_start_heap(objspace, heap);
}
static void
gc_sweep_finish(rb_objspace_t *objspace)
{
- gc_report(1, objspace, "gc_sweep_finish\n");
+ rb_heap_t *heap = heap_eden;
+
+ 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);
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_allocatable_pages < heap_tomb->total_pages) {
- heap_allocatable_pages_set(objspace, heap_tomb->total_pages);
+ if (heap_allocatable_pages < heap_tomb->page_length) {
+ heap_allocatable_pages = heap_tomb->page_length;
}
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_END_SWEEP, 0);
- gc_mode_transition(objspace, gc_mode_none);
+ gc_stat_transition(objspace, gc_stat_none);
#if RGENGC_CHECK_MODE >= 2
gc_verify_internal_consistency(Qnil);
@@ -3690,15 +3257,11 @@ gc_sweep_finish(rb_objspace_t *objspace)
static int
gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
{
- struct heap_page *sweep_page = heap->sweep_pages;
- int unlink_limit = 3;
-#if GC_ENABLE_INCREMENTAL_MARK
+ struct heap_page *sweep_page = heap->sweep_pages, *next;
int need_pool = will_be_incremental_marking(objspace) ? TRUE : FALSE;
+ int unlink_limit = 3;
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;
@@ -3707,39 +3270,31 @@ gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
#endif
while (sweep_page) {
- struct heap_page *next_sweep_page = heap->sweep_pages = sweep_page->next;
- int free_slots = gc_page_sweep(objspace, heap, sweep_page);
+ heap->sweep_pages = next = sweep_page->next;
+ gc_page_sweep(objspace, heap, sweep_page);
- if (sweep_page->final_slots + free_slots == sweep_page->total_slots &&
- heap_pages_freeable_pages > 0 &&
+ if (sweep_page->final_slots + sweep_page->free_slots == sweep_page->total_slots &&
unlink_limit > 0) {
- heap_pages_freeable_pages--;
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 (free_slots > 0) {
-#if GC_ENABLE_INCREMENTAL_MARK
+ else if (sweep_page->free_slots > 0) {
if (need_pool) {
- if (heap_add_poolpage(objspace, heap, sweep_page)) {
- need_pool = FALSE;
- }
+ need_pool = FALSE;
+ heap_add_poolpage(objspace, heap, sweep_page);
}
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;
}
- sweep_page = next_sweep_page;
+ sweep_page = next;
}
if (heap->sweep_pages == NULL) {
@@ -3758,16 +3313,17 @@ gc_sweep_rest(rb_objspace_t *objspace)
{
rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
- while (has_sweeping_pages(heap)) {
- gc_sweep_step(objspace, heap);
+ if (is_lazy_sweeping(heap)) {
+ while (is_lazy_sweeping(heap)) {
+ gc_sweep_step(objspace, heap);
+ }
}
}
-#if GC_ENABLE_LAZY_SWEEP
static void
gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *heap)
{
- GC_ASSERT(dont_gc == FALSE);
+ if (RGENGC_CHECK_MODE) assert(dont_gc == FALSE);
gc_enter(objspace, "sweep_continue");
#if USE_RGENGC
@@ -3778,7 +3334,6 @@ gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *heap)
gc_sweep_step(objspace, heap);
gc_exit(objspace, "sweep_continue");
}
-#endif
static void
gc_sweep(rb_objspace_t *objspace)
@@ -3871,7 +3426,7 @@ push_mark_stack_chunk(mark_stack_t *stack)
{
stack_chunk_t *next;
- GC_ASSERT(stack->index == stack->limit);
+ if (RGENGC_CHECK_MODE) assert(stack->index == stack->limit);
if (stack->cache_size > 0) {
next = stack->cache;
@@ -3894,12 +3449,13 @@ pop_mark_stack_chunk(mark_stack_t *stack)
stack_chunk_t *prev;
prev = stack->chunk->next;
- GC_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) || (RGENGC_CHECK_MODE >= 4)
static void
free_stack_chunks(mark_stack_t *stack)
{
@@ -3912,6 +3468,7 @@ free_stack_chunks(mark_stack_t *stack)
chunk = next;
}
}
+#endif
static void
push_mark_stack(mark_stack_t *stack, VALUE data)
@@ -3985,14 +3542,14 @@ init_mark_stack(mark_stack_t *stack)
/* Marking */
#ifdef __ia64
-#define SET_STACK_END (SET_MACHINE_STACK_END(&ec->machine.stack_end), ec->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(&ec->machine.stack_end)
+#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine.stack_end)
#endif
-#define STACK_START (ec->machine.stack_start)
-#define STACK_END (ec->machine.stack_end)
-#define STACK_LEVEL_MAX (ec->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)
@@ -4018,51 +3575,40 @@ ruby_get_stack_grow_direction(volatile VALUE *addr)
size_t
ruby_stack_length(VALUE **p)
{
- rb_execution_context_t *ec = GET_EC();
+ rb_thread_t *th = GET_THREAD();
SET_STACK_END;
if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END);
return STACK_LENGTH;
}
-#define PREVENT_STACK_OVERFLOW 1
-#ifndef PREVENT_STACK_OVERFLOW
#if !(defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK))
-# define PREVENT_STACK_OVERFLOW 1
-#else
-# define PREVENT_STACK_OVERFLOW 0
-#endif
-#endif
-#if PREVENT_STACK_OVERFLOW
static int
-stack_check(rb_execution_context_t *ec, int water_mark)
+stack_check(int water_mark)
{
int ret;
+ rb_thread_t *th = GET_THREAD();
SET_STACK_END;
ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark;
#ifdef __ia64
if (!ret) {
- ret = (VALUE*)rb_ia64_bsp() - ec->machine.register_stack_start >
- ec->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;
}
-#else
-#define stack_check(ec, water_mark) FALSE
#endif
-#define STACKFRAME_FOR_CALL_CFUNC 838
-
-int
-rb_ec_stack_check(rb_execution_context_t *ec)
-{
- return stack_check(ec, STACKFRAME_FOR_CALL_CFUNC);
-}
+#define STACKFRAME_FOR_CALL_CFUNC 512
int
ruby_stack_check(void)
{
- return stack_check(GET_EC(), STACKFRAME_FOR_CALL_CFUNC);
+#if defined(POSIX_SIGNAL) && defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
+ return 0;
+#else
+ return stack_check(STACKFRAME_FOR_CALL_CFUNC);
+#endif
}
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
@@ -4093,9 +3639,10 @@ rb_gc_mark_locations(const VALUE *start, const VALUE *end)
gc_mark_locations(&rb_objspace, start, end);
}
-static void
-gc_mark_values(rb_objspace_t *objspace, long n, const VALUE *values)
+void
+rb_gc_mark_values(long n, const VALUE *values)
{
+ rb_objspace_t *objspace = &rb_objspace;
long i;
for (i=0; i<n; i++) {
@@ -4103,41 +3650,44 @@ gc_mark_values(rb_objspace_t *objspace, long n, const VALUE *values)
}
}
-void
-rb_gc_mark_values(long n, const VALUE *values)
-{
- rb_objspace_t *objspace = &rb_objspace;
- gc_mark_values(objspace, n, values);
-}
+#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
+
+struct mark_tbl_arg {
+ rb_objspace_t *objspace;
+};
static int
mark_entry(st_data_t key, st_data_t value, st_data_t data)
{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
- gc_mark(objspace, (VALUE)value);
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)value);
return ST_CONTINUE;
}
static void
mark_tbl(rb_objspace_t *objspace, st_table *tbl)
{
+ struct mark_tbl_arg arg;
if (!tbl || tbl->num_entries == 0) return;
- st_foreach(tbl, mark_entry, (st_data_t)objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_entry, (st_data_t)&arg);
}
static int
mark_key(st_data_t key, st_data_t value, st_data_t data)
{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
- gc_mark(objspace, (VALUE)key);
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)key);
return ST_CONTINUE;
}
static void
mark_set(rb_objspace_t *objspace, st_table *tbl)
{
+ struct mark_tbl_arg arg;
if (!tbl) return;
- st_foreach(tbl, mark_key, (st_data_t)objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_key, (st_data_t)&arg);
}
void
@@ -4149,18 +3699,19 @@ rb_mark_set(st_table *tbl)
static int
mark_keyvalue(st_data_t key, st_data_t value, st_data_t data)
{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
-
- gc_mark(objspace, (VALUE)key);
- gc_mark(objspace, (VALUE)value);
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)key);
+ gc_mark(arg->objspace, (VALUE)value);
return ST_CONTINUE;
}
static void
mark_hash(rb_objspace_t *objspace, st_table *tbl)
{
+ struct mark_tbl_arg arg;
if (!tbl) return;
- st_foreach(tbl, mark_keyvalue, (st_data_t)objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_keyvalue, (st_data_t)&arg);
}
void
@@ -4174,73 +3725,79 @@ 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->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;
+ 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;
}
+ break;
+ default:
+ break; /* ignore */
}
}
-static enum rb_id_table_iterator_result
-mark_method_entry_i(VALUE me, void *data)
+void
+rb_mark_method_entry(const rb_method_entry_t *me)
{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
+ mark_method_entry(&rb_objspace, me);
+}
- gc_mark(objspace, me);
- return ID_TABLE_CONTINUE;
+static int
+mark_method_entry_i(st_data_t key, st_data_t value, st_data_t data)
+{
+ const rb_method_entry_t *me = (const rb_method_entry_t *)value;
+ struct mark_tbl_arg *arg = (void*)data;
+ mark_method_entry(arg->objspace, me);
+ return ST_CONTINUE;
}
static void
-mark_m_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
+mark_m_tbl_wrapper(rb_objspace_t *objspace, struct method_table_wrapper *wrapper)
{
- if (tbl) {
- rb_id_table_foreach_values(tbl, mark_method_entry_i, objspace);
+ struct mark_tbl_arg arg;
+ if (!wrapper || !wrapper->tbl) return;
+ if (LIKELY(objspace->mark_func_data == 0) && !is_incremental_marking(objspace)) {
+ /* 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;
}
+ arg.objspace = objspace;
+ st_foreach(wrapper->tbl, mark_method_entry_i, (st_data_t)&arg);
}
-static enum rb_id_table_iterator_result
-mark_const_entry_i(VALUE value, void *data)
+static int
+mark_const_entry_i(st_data_t key, st_data_t value, st_data_t data)
{
const rb_const_entry_t *ce = (const rb_const_entry_t *)value;
- rb_objspace_t *objspace = data;
-
- gc_mark(objspace, ce->value);
- gc_mark(objspace, ce->file);
- return ID_TABLE_CONTINUE;
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, ce->value);
+ gc_mark(arg->objspace, ce->file);
+ return ST_CONTINUE;
}
static void
-mark_const_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
+mark_const_tbl(rb_objspace_t *objspace, st_table *tbl)
{
+ struct mark_tbl_arg arg;
if (!tbl) return;
- rb_id_table_foreach_values(tbl, mark_const_entry_i, objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_const_entry_i, (st_data_t)&arg);
}
#if STACK_GROW_DIRECTION < 0
@@ -4253,11 +3810,8 @@ mark_const_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
((start) = STACK_END, (end) = STACK_START) : ((start) = STACK_START, (end) = STACK_END+(appendix)))
#endif
-static void mark_stack_locations(rb_objspace_t *objspace, const rb_execution_context_t *ec,
- const VALUE *stack_start, const VALUE *stack_end);
-
static void
-mark_current_machine_context(rb_objspace_t *objspace, rb_execution_context_t *ec)
+mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
{
union {
rb_jmp_buf j;
@@ -4277,34 +3831,26 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_execution_context_t *ec
mark_locations_array(objspace, save_regs_gc_mark.v, numberof(save_regs_gc_mark.v));
- mark_stack_locations(objspace, ec, stack_start, stack_end);
+ rb_gc_mark_locations(stack_start, stack_end);
+#ifdef __ia64
+ rb_gc_mark_locations(th->machine.register_stack_start, th->machine.register_stack_end);
+#endif
+#if defined(__mc68000__)
+ mark_locations_array(objspace, (VALUE*)((char*)STACK_END + 2),
+ (STACK_START - STACK_END));
+#endif
}
void
-rb_gc_mark_machine_stack(const rb_execution_context_t *ec)
+rb_gc_mark_machine_stack(rb_thread_t *th)
{
rb_objspace_t *objspace = &rb_objspace;
VALUE *stack_start, *stack_end;
GET_STACK_BOUNDS(stack_start, stack_end, 0);
- mark_stack_locations(objspace, ec, stack_start, stack_end);
-}
-
-static void
-mark_stack_locations(rb_objspace_t *objspace, const rb_execution_context_t *ec,
- const VALUE *stack_start, const VALUE *stack_end)
-{
-
- gc_mark_locations(objspace, stack_start, stack_end);
+ rb_gc_mark_locations(stack_start, stack_end);
#ifdef __ia64
- gc_mark_locations(objspace,
- ec->machine.register_stack_start,
- ec->machine.register_stack_end);
-#endif
-#if defined(__mc68000__)
- gc_mark_locations(objspace,
- (VALUE*)((char*)stack_start + 2),
- (VALUE*)((char*)stack_end - 2));
+ rb_gc_mark_locations(th->machine.register_stack_start, th->machine.register_stack_end);
#endif
}
@@ -4345,12 +3891,12 @@ static int
gc_remember_unprotected(rb_objspace_t *objspace, VALUE obj)
{
struct heap_page *page = GET_HEAP_PAGE(obj);
- bits_t *uncollectible_bits = &page->uncollectible_bits[0];
+ bits_t *bits = &page->long_lived_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 (!MARKED_IN_BITMAP(bits, obj)) {
+ page->flags.has_long_lived_shady_objects = TRUE;
+ MARK_IN_BITMAP(bits, obj);
+ objspace->rgengc.remembered_wb_unprotected_objects++;
#if RGENGC_PROFILE > 0
objspace->profile.total_remembered_shady_object_count++;
@@ -4401,7 +3947,7 @@ rgengc_check_relation(rb_objspace_t *objspace, VALUE obj)
}
}
- GC_ASSERT(old_parent == objspace->rgengc.parent_object);
+ if (RGENGC_CHECK_MODE) assert(old_parent == objspace->rgengc.parent_object);
#endif
}
@@ -4428,17 +3974,21 @@ gc_aging(rb_objspace_t *objspace, VALUE obj)
#if USE_RGENGC
struct heap_page *page = GET_HEAP_PAGE(obj);
- GC_ASSERT(RVALUE_MARKING(obj) == FALSE);
+#if RGENGC_CHECK_MODE
+ assert(RVALUE_MARKING(obj) == FALSE);
+#endif
+
check_rvalue_consistency(obj);
- if (!RVALUE_PAGE_WB_UNPROTECTED(page, obj)) {
+ if (RVALUE_PAGE_WB_UNPROTECTED(page, obj) == 0) {
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)) {
- GC_ASSERT(RVALUE_PAGE_UNCOLLECTIBLE(page, obj) == FALSE);
- RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(objspace, page, obj);
+ if (RGENGC_CHECK_MODE) assert(RVALUE_PAGE_LONG_LIVED(page, obj) == FALSE);
+ MARK_IN_BITMAP(page->long_lived_bits, obj);
+ objspace->rgengc.old_objects++;
}
}
check_rvalue_consistency(obj);
@@ -4447,8 +3997,6 @@ gc_aging(rb_objspace_t *objspace, VALUE obj)
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)
{
@@ -4463,7 +4011,7 @@ gc_mark_ptr(rb_objspace_t *objspace, VALUE obj)
}
}
-static inline void
+static void
gc_mark(rb_objspace_t *objspace, VALUE obj)
{
if (!is_markable_object(objspace, obj)) return;
@@ -4500,69 +4048,6 @@ gc_mark_set_parent(rb_objspace_t *objspace, VALUE obj)
}
static void
-gc_mark_imemo(rb_objspace_t *objspace, VALUE obj)
-{
- switch (imemo_type(obj)) {
- case imemo_env:
- {
- const rb_env_t *env = (const rb_env_t *)obj;
- GC_ASSERT(VM_ENV_ESCAPED_P(env->ep));
- gc_mark_values(objspace, (long)env->env_size, env->env);
- VM_ENV_FLAGS_SET(env->ep, VM_ENV_FLAG_WB_REQUIRED);
- gc_mark(objspace, (VALUE)rb_vm_env_prev_env(env));
- gc_mark(objspace, (VALUE)env->iseq);
- }
- 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;
- case imemo_alloc:
- {
- const rb_imemo_alloc_t *m = &RANY(obj)->as.imemo.alloc;
- do {
- rb_gc_mark_locations(m->ptr, m->ptr + m->cnt);
- } while ((m = m->next) != NULL);
- }
- return;
- case imemo_ast:
- rb_ast_mark(&RANY(obj)->as.imemo.ast);
- return;
- case imemo_parser_strterm:
- rb_strterm_mark(obj);
- return;
-#if VM_CHECK_MODE > 0
- default:
- VM_UNREACHABLE(gc_mark_imemo);
-#endif
- }
-}
-
-static void
gc_mark_children(rb_objspace_t *objspace, VALUE obj)
{
register RVALUE *any = RANY(obj);
@@ -4579,35 +4064,24 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
break;
case T_NODE:
- UNEXPECTED_NODE(rb_gc_mark);
- break;
-
- case T_IMEMO:
- gc_mark_imemo(objspace, obj);
- return;
+ obj = rb_gc_mark_node(&any->as.node);
+ if (obj) gc_mark(objspace, obj);
+ return; /* no need to mark class. */
}
gc_mark(objspace, any->as.basic.klass);
switch (BUILTIN_TYPE(obj)) {
+ case T_ICLASS:
case T_CLASS:
case T_MODULE:
- mark_m_tbl(objspace, RCLASS_M_TBL(obj));
+ mark_m_tbl_wrapper(objspace, RCLASS_M_TBL_WRAPPER(obj));
if (!RCLASS_EXT(obj)) break;
mark_tbl(objspace, RCLASS_IV_TBL(obj));
mark_const_tbl(objspace, RCLASS_CONST_TBL(obj));
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)) {
gc_mark(objspace, any->as.array.as.heap.aux.shared);
@@ -4633,20 +4107,18 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
break;
case T_DATA:
- {
- 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);
- }
+ if (RTYPEDDATA_P(obj)) {
+ RUBY_DATA_FUNC mark_func = any->as.typeddata.type->function.dmark;
+ if (mark_func) (*mark_func)(DATA_PTR(obj));
+ }
+ else {
+ if (any->as.data.dmark) (*any->as.data.dmark)(DATA_PTR(obj));
}
break;
case T_OBJECT:
{
- uint32_t i, len = ROBJECT_NUMIV(obj);
+ long i, len = ROBJECT_NUMIV(obj);
VALUE *ptr = ROBJECT_IVPTR(obj);
for (i = 0; i < len; i++) {
gc_mark(objspace, *ptr++);
@@ -4724,8 +4196,7 @@ gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
mark_stack_t *mstack = &objspace->mark_stack;
VALUE obj;
#if GC_ENABLE_INCREMENTAL_MARK
- size_t marked_slots_at_the_beginning = objspace->marked_slots;
- size_t popped_count = 0;
+ size_t marked_slots_at_the_beggining = objspace->marked_slots;
#endif
while (pop_mark_stack(mstack, &obj)) {
@@ -4742,9 +4213,8 @@ gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
rb_bug("gc_mark_stacked_objects: incremental, but marking bit is 0");
}
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
- popped_count++;
- if (popped_count + (objspace->marked_slots - marked_slots_at_the_beginning) > count) {
+ if (objspace->marked_slots - marked_slots_at_the_beggining > count) {
break;
}
}
@@ -4754,7 +4224,9 @@ gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
#endif
}
- if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(Qnil);
+ if (RGENGC_CHECK_MODE >= 3) {
+ gc_verify_internal_consistency(Qnil);
+ }
if (is_mark_stack_empty(mstack)) {
shrink_stack_chunk_cache(mstack);
@@ -4804,8 +4276,12 @@ static void
gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
{
struct gc_list *list;
- rb_execution_context_t *ec = GET_EC();
- rb_vm_t *vm = rb_ec_vm_ptr(ec);
+ rb_thread_t *th = GET_THREAD();
+ if (categoryp) *categoryp = "xxx";
+
+#if USE_RGENGC
+ objspace->rgengc.parent_object = Qfalse;
+#endif
#if PRINT_ROOT_TICKS
tick_t start_tick = tick();
@@ -4817,12 +4293,6 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
}
#endif
- 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) { \
@@ -4845,14 +4315,14 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
MARK_CHECKPOINT("vm");
SET_STACK_END;
- rb_vm_mark(vm);
- if (vm->self) gc_mark(objspace, vm->self);
+ rb_vm_mark(th->vm);
+ if (th->vm->self) gc_mark_set(objspace, th->vm->self);
MARK_CHECKPOINT("finalizers");
mark_tbl(objspace, finalizer_table);
MARK_CHECKPOINT("machine_context");
- mark_current_machine_context(objspace, ec);
+ mark_current_machine_context(objspace, th);
MARK_CHECKPOINT("encodings");
rb_gc_mark_encodings();
@@ -4869,7 +4339,12 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
MARK_CHECKPOINT("global_tbl");
rb_gc_mark_global_tbl();
- if (stress_to_class) rb_gc_mark(stress_to_class);
+ /* mark generic instance variables for special constants */
+ MARK_CHECKPOINT("generic_ivars");
+ rb_mark_generic_ivar_tbl();
+
+ MARK_CHECKPOINT("live_method_entries");
+ rb_gc_mark_unlinked_live_method_entries(th->vm);
MARK_CHECKPOINT("finish");
#undef MARK_CHECKPOINT
@@ -5029,7 +4504,7 @@ objspace_allrefs(rb_objspace_t *objspace)
}
static int
-objspace_allrefs_destruct_i(st_data_t key, st_data_t value, void *ptr)
+objspaec_allrefs_destruct_i(st_data_t key, st_data_t value, void *ptr)
{
struct reflist *refs = (struct reflist *)value;
reflist_destruct(refs);
@@ -5039,7 +4514,7 @@ objspace_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, objspace_allrefs_destruct_i, 0);
+ st_foreach(refs, objspaec_allrefs_destruct_i, 0);
st_free_table(refs);
}
@@ -5141,12 +4616,12 @@ check_generation_i(const VALUE child, void *ptr)
struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
const VALUE parent = data->parent;
- if (RGENGC_CHECK_MODE) GC_ASSERT(RVALUE_OLD_P(parent));
+ if (RGENGC_CHECK_MODE) assert(RVALUE_OLD_P(parent));
if (!RVALUE_OLD_P(child)) {
if (!RVALUE_REMEMBERED(parent) &&
!RVALUE_REMEMBERED(child) &&
- !RVALUE_UNCOLLECTIBLE(child)) {
+ !RVALUE_LONG_LIVED(child)) {
fprintf(stderr, "verify_internal_consistency_reachable_i: WB miss (O->Y) %s -> %s\n", obj_info(parent), obj_info(child));
data->err_count++;
}
@@ -5192,7 +4667,7 @@ verify_internal_consistency_i(void *page_start, void *page_end, size_t stride, v
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 (RVALUE_WB_UNPROTECTED(obj) && RVALUE_LONG_LIVED(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) */
@@ -5211,7 +4686,7 @@ verify_internal_consistency_i(void *page_start, void *page_end, size_t stride, v
}
else {
if (BUILTIN_TYPE(obj) == T_ZOMBIE) {
- GC_ASSERT(RBASIC(obj)->flags == T_ZOMBIE);
+ if (RGENGC_CHECK_MODE) assert(RBASIC(obj)->flags == T_ZOMBIE);
data->zombie_object_count++;
}
}
@@ -5228,17 +4703,11 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
unsigned int has_remembered_shady = FALSE;
unsigned int has_remembered_old = FALSE;
int rememberd_old_objects = 0;
- int free_objects = 0;
- int zombie_objects = 0;
for (i=0; i<page->total_slots; i++) {
- VALUE val = (VALUE)&page->start[i];
- if (RBASIC(val) == 0) free_objects++;
- if (BUILTIN_TYPE(val) == T_ZOMBIE) zombie_objects++;
- if (RVALUE_PAGE_UNCOLLECTIBLE(page, val) && RVALUE_PAGE_WB_UNPROTECTED(page, val)) {
- has_remembered_shady = TRUE;
- }
- if (RVALUE_PAGE_MARKING(page, val)) {
+ VALUE obj = (VALUE)&page->start[i];
+ if (RVALUE_PAGE_LONG_LIVED(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++;
}
@@ -5248,30 +4717,20 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
page->flags.has_remembered_objects == FALSE && has_remembered_old == TRUE) {
for (i=0; i<page->total_slots; i++) {
- VALUE val = (VALUE)&page->start[i];
- if (RVALUE_PAGE_MARKING(page, val)) {
- fprintf(stderr, "marking -> %s\n", obj_info(val));
+ 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) {
+ if (page->flags.has_long_lived_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) : "");
}
- if (0) {
- /* free_slots may not equal to free_objects */
- if (page->free_slots != free_objects) {
- rb_bug("page %p's free_slots should be %d, but %d\n", page, (int)page->free_slots, free_objects);
- }
- }
- if (page->final_slots != zombie_objects) {
- rb_bug("page %p's final_slots should be %d, but %d\n", page, (int)page->final_slots, zombie_objects);
- }
-
return rememberd_old_objects;
#else
return 0;
@@ -5279,29 +4738,20 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
}
static int
-gc_verify_heap_pages_(rb_objspace_t *objspace, struct heap_page *page)
+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);
- }
+ if (page->flags.has_remembered_objects == FALSE)
+ rememberd_old_objects += gc_verify_heap_page(objspace, page, Qfalse);
page = page->next;
}
return rememberd_old_objects;
}
-static int
-gc_verify_heap_pages(rb_objspace_t *objspace)
-{
- int rememberd_old_objects = 0;
- rememberd_old_objects = gc_verify_heap_pages_(objspace, heap_eden->pages);
- rememberd_old_objects = gc_verify_heap_pages_(objspace, heap_tomb->pages);
- return rememberd_old_objects;
-}
-
/*
* call-seq:
* GC.verify_internal_consistency -> nil
@@ -5313,7 +4763,7 @@ gc_verify_heap_pages(rb_objspace_t *objspace)
* if RGenGC is supported.
*/
static VALUE
-gc_verify_internal_consistency(VALUE dummy)
+gc_verify_internal_consistency(VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
struct verify_internal_consistency_struct data = {0};
@@ -5346,17 +4796,17 @@ gc_verify_internal_consistency(VALUE dummy)
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 number: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace_live_slots(objspace), data.live_object_count);
+ 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 number: expect %"PRIuSIZE", but %"PRIuSIZE".", 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 number: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace->rgengc.uncollectible_wb_unprotected_objects, data.remembered_shady_count);
+ if (objspace->rgengc.remembered_wb_unprotected_objects != data.remembered_shady_count) {
+ rb_bug("inconsistent old slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace->rgengc.remembered_wb_unprotected_objects, data.remembered_shady_count);
}
}
#endif
@@ -5390,12 +4840,6 @@ gc_verify_internal_consistency(VALUE dummy)
return Qnil;
}
-void
-rb_gc_verify_internal_consistency(void)
-{
- gc_verify_internal_consistency(Qnil);
-}
-
/* marks */
static void
@@ -5403,33 +4847,30 @@ 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_mode_transition(objspace, gc_mode_marking);
+ gc_stat_transition(objspace, gc_stat_marking);
+
+ objspace->marked_slots = 0;
#if USE_RGENGC
- if (full_mark) {
-#if GC_ENABLE_INCREMENTAL_MARK
- objspace->rincgc.step_slots = (objspace->marked_slots * 2) / ((objspace->rincgc.pooled_slots / HEAP_PAGE_OBJ_LIMIT) + 1);
+ objspace->rgengc.old_objects_at_gc_start = objspace->rgengc.old_objects;
- 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
+ if (full_mark) {
objspace->flags.during_minor_gc = FALSE;
objspace->profile.major_gc_count++;
- objspace->rgengc.uncollectible_wb_unprotected_objects = 0;
+ objspace->rgengc.remembered_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->rgengc.old_objects +
+ objspace->rgengc.remembered_wb_unprotected_objects; /* long lived 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));
@@ -5448,7 +4889,7 @@ gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
RVALUE *offset = p - NUM_IN_PAGE(p);
size_t j;
- for (j=0; j<HEAP_PAGE_BITMAP_LIMIT; j++) {
+ for (j=0; j<HEAP_BITMAP_LIMIT; j++) {
bits_t bits = mark_bits[j] & wbun_bits[j];
if (bits) {
@@ -5457,8 +4898,10 @@ gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
do {
if (bits & 1) {
gc_report(2, objspace, "gc_marks_wb_unprotected_objects: marked shady: %s\n", obj_info((VALUE)p));
- GC_ASSERT(RVALUE_WB_UNPROTECTED((VALUE)p));
- GC_ASSERT(RVALUE_MARKED((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++;
@@ -5472,6 +4915,7 @@ gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
gc_mark_stacked_objects_all(objspace);
}
+#endif
static struct heap_page *
heap_move_pooled_pages_to_free_pages(rb_heap_t *heap)
@@ -5486,7 +4930,6 @@ heap_move_pooled_pages_to_free_pages(rb_heap_t *heap)
return page;
}
-#endif
static int
gc_marks_finish(rb_objspace_t *objspace)
@@ -5531,7 +4974,7 @@ gc_marks_finish(rb_objspace_t *objspace)
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.remembered_wb_unprotected_objects_limit = (size_t)(objspace->rgengc.remembered_wb_unprotected_objects * r);
objspace->rgengc.old_objects_limit = (size_t)(objspace->rgengc.old_objects * r);
}
#endif
@@ -5540,77 +4983,45 @@ gc_marks_finish(rb_objspace_t *objspace)
gc_marks_check(objspace, gc_check_after_marks_i, "after_marks");
#endif
- {
- /* decide full GC is needed or not */
+ { /* decide full GC is needed or not */
rb_heap_t *heap = heap_eden;
- size_t total_slots = heap_allocatable_pages * HEAP_PAGE_OBJ_LIMIT + heap->total_slots;
- size_t sweep_slots = total_slots - objspace->marked_slots; /* will be swept slots */
- size_t max_free_slots = (size_t)(total_slots * gc_params.heap_free_slots_max_ratio);
- size_t min_free_slots = (size_t)(total_slots * gc_params.heap_free_slots_min_ratio);
- int full_marking = is_full_marking(objspace);
-
- GC_ASSERT(heap->total_slots >= objspace->marked_slots);
-
- /* setup free-able page counts */
- if (max_free_slots < gc_params.heap_init_slots) max_free_slots = gc_params.heap_init_slots;
-
- if (sweep_slots > max_free_slots) {
- heap_pages_freeable_pages = (sweep_slots - max_free_slots) / HEAP_PAGE_OBJ_LIMIT;
- }
- else {
- heap_pages_freeable_pages = 0;
- }
+ 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 */
- /* check free_min */
- if (min_free_slots < gc_params.heap_free_slots) min_free_slots = gc_params.heap_free_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 (sweep_slots < min_free_slots) {
- if (!full_marking) {
- if (objspace->profile.count - objspace->rgengc.last_major_gc < RVALUE_OLD_AGE) {
- full_marking = TRUE;
- /* do not update last_major_gc, because full marking is not done. */
- goto increment;
- }
- else {
- gc_report(1, objspace, "gc_marks_finish: next is full GC!!)\n");
- objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_NOFREE;
- }
+ 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 {
- increment:
gc_report(1, objspace, "gc_marks_finish: heap_set_increment!!\n");
- heap_set_increment(objspace, heap_extend_pages(objspace, sweep_slots, total_slots));
+ 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 (full_marking) {
- /* 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);
- }
-
- if (objspace->rgengc.uncollectible_wb_unprotected_objects > objspace->rgengc.uncollectible_wb_unprotected_objects_limit) {
+#if USE_RGENGC
+ if (objspace->rgengc.remembered_wb_unprotected_objects > objspace->rgengc.remembered_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");
-#else /* USE_RGENGC */
- if (sweep_slots < min_free_slots) {
- gc_report(1, objspace, "gc_marks_finish: heap_set_increment!!\n");
- heap_set_increment(objspace, heap_extend_pages(objspace, sweep_slot, total_slot));
- heap_increment(objspace, heap);
- }
#endif
}
@@ -5619,11 +5030,10 @@ gc_marks_finish(rb_objspace_t *objspace)
return TRUE;
}
-#if GC_ENABLE_INCREMENTAL_MARK
static void
gc_marks_step(rb_objspace_t *objspace, int slots)
{
- GC_ASSERT(is_marking(objspace));
+ if (RGENGC_CHECK_MODE) assert(is_marking(objspace));
if (gc_mark_stacked_objects_incremental(objspace, slots)) {
if (gc_marks_finish(objspace)) {
@@ -5631,18 +5041,14 @@ gc_marks_step(rb_objspace_t *objspace, int slots)
gc_sweep(objspace);
}
}
- if (0) fprintf(stderr, "objspace->marked_slots: %d\n", (int)objspace->marked_slots);
}
-#endif
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
if (is_incremental_marking(objspace)) {
do {
@@ -5658,21 +5064,20 @@ gc_marks_rest(rb_objspace_t *objspace)
gc_sweep(objspace);
}
-#if GC_ENABLE_INCREMENTAL_MARK
static void
gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap)
{
int slots = 0;
const char *from;
- GC_ASSERT(dont_gc == FALSE);
+ 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_PAGE_OBJ_LIMIT) {
+ while (heap->pooled_pages && slots < HEAP_OBJ_LIMIT) {
struct heap_page *page = heap_move_pooled_pages_to_free_pages(heap);
slots += page->free_slots;
}
@@ -5685,7 +5090,7 @@ gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap)
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);
+ gc_marks_step(objspace, slots);
}
else {
gc_report(2, objspace, "gc_marks_continue: no more pooled pages (stack depth: %d).\n", (int)mark_stack_size(&objspace->mark_stack));
@@ -5696,7 +5101,6 @@ gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap)
gc_exit(objspace, "marks_continue");
}
-#endif
static void
gc_marks(rb_objspace_t *objspace, int full_mark)
@@ -5779,7 +5183,7 @@ rgengc_remembersetbits_set(rb_objspace_t *objspace, VALUE obj)
struct heap_page *page = GET_HEAP_PAGE(obj);
bits_t *bits = &page->marking_bits[0];
- GC_ASSERT(!is_incremental_marking(objspace));
+ if (RGENGC_CHECK_MODE) assert(!is_incremental_marking(objspace));
if (MARKED_IN_BITMAP(bits, obj)) {
return FALSE;
@@ -5844,25 +5248,25 @@ rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
gc_report(1, objspace, "rgengc_rememberset_mark: start\n");
while (page) {
- if (page->flags.has_remembered_objects | page->flags.has_uncollectible_shady_objects) {
+ if (page->flags.has_remembered_objects | page->flags.has_long_lived_shady_objects) {
RVALUE *p = page->start;
RVALUE *offset = p - NUM_IN_PAGE(p);
- bits_t bitset, bits[HEAP_PAGE_BITMAP_LIMIT];
+ bits_t bitset, bits[HEAP_BITMAP_LIMIT];
bits_t *marking_bits = page->marking_bits;
- bits_t *uncollectible_bits = page->uncollectible_bits;
+ bits_t *long_lived_bits = page->long_lived_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++;
+ if (page->flags.has_remembered_objects && page->flags.has_long_lived_shady_objects) has_both++;
else if (page->flags.has_remembered_objects) has_old++;
- else if (page->flags.has_uncollectible_shady_objects) has_shady++;
+ else if (page->flags.has_long_lived_shady_objects) has_shady++;
#endif
- for (j=0; j<HEAP_PAGE_BITMAP_LIMIT; j++) {
- bits[j] = marking_bits[j] | (uncollectible_bits[j] & wb_unprotected_bits[j]);
+ for (j=0; j<HEAP_BITMAP_LIMIT; j++) {
+ bits[j] = marking_bits[j] | (long_lived_bits[j] & wb_unprotected_bits[j]);
marking_bits[j] = 0;
}
page->flags.has_remembered_objects = FALSE;
- for (j=0; j < HEAP_PAGE_BITMAP_LIMIT; j++) {
+ for (j=0; j < HEAP_BITMAP_LIMIT; j++) {
bitset = bits[j];
if (bitset) {
@@ -5872,8 +5276,11 @@ rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
if (bitset & 1) {
VALUE obj = (VALUE)p;
gc_report(2, objspace, "rgengc_rememberset_mark: mark %s\n", obj_info(obj));
- GC_ASSERT(RVALUE_UNCOLLECTIBLE(obj));
- GC_ASSERT(RVALUE_OLD_P(obj) || RVALUE_WB_UNPROTECTED(obj));
+
+ if (RGENGC_CHECK_MODE) {
+ assert(RVALUE_LONG_LIVED(obj));
+ assert(RVALUE_OLD_P(obj) || RVALUE_WB_UNPROTECTED(obj));
+ }
gc_mark_children(objspace, obj);
}
@@ -5904,10 +5311,10 @@ 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_PAGE_BITMAP_SIZE);
- memset(&page->marking_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- memset(&page->uncollectible_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- page->flags.has_uncollectible_shady_objects = FALSE;
+ memset(&page->mark_bits[0], 0, HEAP_BITMAP_SIZE);
+ memset(&page->marking_bits[0], 0, HEAP_BITMAP_SIZE);
+ memset(&page->long_lived_bits[0], 0, HEAP_BITMAP_SIZE);
+ page->flags.has_long_lived_shady_objects = FALSE;
page->flags.has_remembered_objects = FALSE;
page = page->next;
}
@@ -5915,42 +5322,25 @@ rgengc_mark_and_rememberset_clear(rb_objspace_t *objspace, rb_heap_t *heap)
/* RGENGC: APIs */
-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)
+void
+rb_gc_writebarrier_generational(VALUE a, VALUE b)
{
+ rb_objspace_t *objspace = &rb_objspace;
+
if (RGENGC_CHECK_MODE) {
- 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(a)) rb_bug("rb_gc_writebarrier_generational: %s is not an old object.", obj_info(a));
+ if ( RVALUE_OLD_P(b)) rb_bug("rb_gc_writebarrier_generational: %s is an old object.", obj_info(b));
+ if (is_incremental_marking(objspace)) rb_bug("rb_gc_writebarrier_generational: called while incremental marking: %s -> %s", obj_info(a), obj_info(b));
}
-#if 1
- /* mark `a' and remember (default behavior) */
if (!rgengc_remembered(objspace, a)) {
+ gc_report(1, objspace, "rb_gc_writebarrier_generational: %s -> %s\n", obj_info(a), obj_info(b));
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)
{
@@ -5961,60 +5351,49 @@ gc_mark_from(rb_objspace_t *objspace, VALUE obj, VALUE parent)
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)
+int
+rb_gc_writebarrier_incremental(VALUE a, VALUE b)
{
- gc_report(2, objspace, "gc_writebarrier_incremental: [LG] %p -> %s\n", (void *)a, obj_info(b));
+ rb_objspace_t *objspace = &rb_objspace;
- if (RVALUE_BLACK_P(a)) {
- if (RVALUE_WHITE_P(b)) {
- if (!RVALUE_WB_UNPROTECTED(a)) {
- gc_report(2, objspace, "gc_writebarrier_incremental: [IN] %p -> %s\n", (void *)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] %p -> %s\n", (void *)a, obj_info(b));
- RVALUE_AGE_SET_OLD(objspace, b);
+ if (RGENGC_CHECK_MODE) {
+ if (SPECIAL_CONST_P(a)) rb_bug("rb_gc_writebarrier: a is special const");
+ if (SPECIAL_CONST_P(b)) rb_bug("rb_gc_writebarrier: a is special const");
+ }
- if (RVALUE_BLACK_P(b)) {
- gc_grey(objspace, b);
+ if (LIKELY(!is_incremental_marking(objspace))) {
+ return FALSE;
+ }
+ else {
+ gc_report(2, objspace, "rb_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, "rb_gc_writebarrier_incremental: [IN] %s -> %s\n", obj_info(a), obj_info(b));
+ gc_mark_from(objspace, b, a);
}
}
- else {
- gc_report(1, objspace, "gc_writebarrier_incremental: [LL] %p -> %s\n", (void *)a, obj_info(b));
- gc_remember_unprotected(objspace, b);
+ else if (RVALUE_OLD_P(a) && !RVALUE_OLD_P(b)) {
+ if (!RVALUE_WB_UNPROTECTED(b)) {
+ gc_report(1, objspace, "rb_gc_writebarrier_incremental: [GN] %s -> %s\n", obj_info(a), obj_info(b));
+ RVALUE_AGE_SET_OLD(objspace, b);
+
+ if (RVALUE_BLACK_P(b)) {
+ gc_grey(objspace, b);
+ }
+ }
+ else {
+ gc_report(1, objspace, "rb_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(VALUE a, VALUE b)
-{
- rb_objspace_t *objspace = &rb_objspace;
- 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);
+ return TRUE;
}
}
+#endif
void
rb_gc_writebarrier_unprotect(VALUE obj)
@@ -6107,31 +5486,22 @@ rb_gc_unprotect_logging(void *objptr, const char *filename, int line)
cnt++;
}
else {
- ptr = (strdup)(buff);
- if (!ptr) rb_memerror();
+ ptr = (char *)malloc(strlen(buff) + 1);
+ strcpy(ptr, buff);
}
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);
- }
+ if (RVALUE_WB_UNPROTECTED(obj)) {
+ MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(dest), dest);
}
-
- check_rvalue_consistency(dest);
#endif
}
@@ -6159,7 +5529,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_marking, ID_uncollectible;
+ static ID ID_wb_protected, ID_old, ID_marking, ID_long_lived;
#endif
if (!ID_marked) {
@@ -6169,7 +5539,7 @@ rb_obj_gc_flags(VALUE obj, ID* flags, size_t max)
I(wb_protected);
I(old);
I(marking);
- I(uncollectible);
+ I(long_lived);
#endif
#undef I
}
@@ -6177,7 +5547,7 @@ rb_obj_gc_flags(VALUE obj, ID* flags, size_t max)
#if USE_RGENGC
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 (RVALUE_LONG_LIVED(obj) && n<max) flags[n++] = ID_long_lived;
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;
@@ -6201,7 +5571,7 @@ rb_gc_force_recycle(VALUE obj)
objspace->rgengc.old_objects--;
}
}
- CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS(obj), obj);
+ CLEAR_IN_BITMAP(GET_HEAP_LONG_LIVED_BITS(obj), obj);
CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
#if GC_ENABLE_INCREMENTAL_MARK
@@ -6241,7 +5611,7 @@ rb_gc_force_recycle(VALUE obj)
void
rb_gc_register_mark_object(VALUE obj)
{
- VALUE ary_ary = GET_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) {
@@ -6366,7 +5736,7 @@ gc_reset_malloc_info(rb_objspace_t *objspace)
#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.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);
@@ -6419,15 +5789,17 @@ gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark,
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 (!heap_allocated_pages) return FALSE; /* heap is not ready */
+ if (!ready_to_gc(objspace)) return TRUE; /* GC is not allowed */
- GC_ASSERT(gc_mode(objspace) == gc_mode_none);
- GC_ASSERT(!is_lazy_sweeping(heap_eden));
- GC_ASSERT(!is_incremental_marking(objspace));
+ 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);
+ gc_verify_internal_consistency(Qnil);
#endif
+ }
gc_enter(objspace, "gc_start");
@@ -6446,12 +5818,9 @@ gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark,
reason |= objspace->rgengc.need_major_gc;
do_full_mark = TRUE;
}
- else if (RGENGC_FORCE_MAJOR_GC) {
- reason = GPR_FLAG_MAJOR_BY_FORCE;
- do_full_mark = TRUE;
- }
objspace->rgengc.need_major_gc = GPR_FLAG_NONE;
+ if (RGENGC_FORCE_MAJOR_GC) objspace->rgengc.need_major_gc = GPR_FLAG_MAJOR_BY_NOFREE;
#endif
}
@@ -6486,7 +5855,7 @@ gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark,
gc_reset_malloc_info(objspace);
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_START, 0 /* TODO: pass minor/immediate flag? */);
- GC_ASSERT(during_gc);
+ if (RGENGC_CHECK_MODE) assert(during_gc);
gc_prof_timer_start(objspace);
{
@@ -6581,21 +5950,19 @@ gc_record(rb_objspace_t *objspace, int direction, const char *event)
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",
+ fprintf(stderr, "%"PRItick"\t%"PRItick"\t%s\t[%s->%s]\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_gc_status, current_gc_status);
last_exit_tick = exit_tick;
#else
/* [enter_tick] [gc time] [event] */
- fprintf(stderr, "%"PRItick"\t%"PRItick"\t%s\t[%s->%s|%c]\n",
+ fprintf(stderr, "%"PRItick"\t%"PRItick"\t%s\t[%s->%s]\n",
enter_tick,
exit_tick - enter_tick,
event,
- last_gc_status, current_gc_status,
- (objspace->profile.latest_gc_info & GPR_FLAG_MAJOR_MASK) ? '+' : '-');
+ last_gc_status, current_gc_status);
#endif
}
}
@@ -6610,7 +5977,7 @@ gc_record(rb_objspace_t *objspace, int direction, const char *event)
static inline void
gc_enter(rb_objspace_t *objspace, const char *event)
{
- GC_ASSERT(during_gc == 0);
+ if (RGENGC_CHECK_MODE) assert(during_gc == 0);
if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(Qnil);
during_gc = TRUE;
@@ -6622,7 +5989,7 @@ gc_enter(rb_objspace_t *objspace, const char *event)
static inline void
gc_exit(rb_objspace_t *objspace, const char *event)
{
- GC_ASSERT(during_gc != 0);
+ 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);
@@ -6662,6 +6029,12 @@ garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_m
}
}
+int
+rb_garbage_collect(void)
+{
+ return garbage_collect(&rb_objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
+}
+
#undef Init_stack
void
@@ -6673,11 +6046,9 @@ Init_stack(volatile VALUE *addr)
/*
* call-seq:
* GC.start -> nil
- * ObjectSpace.garbage_collect -> nil
- * include GC; garbage_collect -> nil
+ * GC.garbage_collect -> nil
* GC.start(full_mark: true, immediate_sweep: true) -> nil
- * ObjectSpace.garbage_collect(full_mark: true, immediate_sweep: true) -> nil
- * include GC; garbage_collect(full_mark: true, immediate_sweep: true) -> nil
+ * GC.garbage_collect(full_mark: true, immediate_sweep: true) -> nil
*
* Initiates garbage collection, unless manually disabled.
*
@@ -6720,7 +6091,7 @@ gc_start_internal(int argc, VALUE *argv, VALUE self)
}
garbage_collect(objspace, full_mark, immediate_mark, immediate_sweep, GPR_FLAG_METHOD);
- gc_finalize_deferred(objspace);
+ if (!finalizing) finalize_deferred(objspace);
return Qnil;
}
@@ -6737,7 +6108,7 @@ rb_gc(void)
{
rb_objspace_t *objspace = &rb_objspace;
garbage_collect(objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
- gc_finalize_deferred(objspace);
+ if (!finalizing) finalize_deferred(objspace);
}
int
@@ -6754,7 +6125,7 @@ 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)
{
- VALUE result = rb_hash_new_with_size(T_MASK);
+ VALUE result = rb_hash_new();
int i;
for (i=0; i<T_MASK; i++) {
const char *type = type_name(i, 0);
@@ -6787,28 +6158,23 @@ gc_count(VALUE self)
}
static VALUE
-gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_flags)
+gc_info_decode(int flags, VALUE hash_or_key)
{
- static VALUE sym_major_by = Qnil, sym_gc_by, sym_immediate_sweep, sym_have_finalizer, sym_state;
+ static VALUE sym_major_by = Qnil, sym_gc_by, sym_immediate_sweep, sym_have_finalizer;
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))
@@ -6816,8 +6182,6 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_
S(gc_by);
S(immediate_sweep);
S(have_finalizer);
- S(state);
-
S(stress);
S(nofree);
S(oldgen);
@@ -6830,10 +6194,6 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_
S(malloc);
S(method);
S(capi);
-
- S(none);
- S(marking);
- S(sweeping);
#undef S
}
@@ -6865,11 +6225,6 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_
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, gc_mode(objspace) == gc_mode_none ? sym_none :
- gc_mode(objspace) == gc_mode_marking ? sym_marking : sym_sweeping);
- }
#undef SET
if (!NIL_P(key)) {/* matched key should return above */
@@ -6883,7 +6238,7 @@ VALUE
rb_gc_latest_gc_info(VALUE key)
{
rb_objspace_t *objspace = &rb_objspace;
- return gc_info_decode(objspace, key, 0);
+ return gc_info_decode(objspace->profile.latest_gc_info, key);
}
/*
@@ -6911,86 +6266,49 @@ gc_latest_gc_info(int argc, VALUE *argv, VALUE self)
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_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,
+ return gc_info_decode(objspace->profile.latest_gc_info, arg);
+}
+
+size_t
+gc_stat_internal(VALUE hash_or_sym)
+{
+ static VALUE sym_count;
+ static VALUE sym_heap_allocated_pages, sym_heap_sorted_length, sym_heap_allocatable_pages;
+ static VALUE sym_heap_available_slots, sym_heap_live_slots, sym_heap_free_slots, sym_heap_final_slots;
+ static VALUE sym_heap_marked_slots, sym_heap_swept_slots;
+ static VALUE sym_heap_eden_pages, sym_heap_tomb_pages;
+ static VALUE sym_total_allocated_pages, sym_total_freed_pages;
+ static VALUE sym_total_allocated_objects, sym_total_freed_objects;
+ static VALUE sym_malloc_increase_bytes, sym_malloc_increase_bytes_limit;
#if USE_RGENGC
- 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,
+ static VALUE sym_minor_gc_count, sym_major_gc_count;
+ static VALUE sym_remembered_wb_unprotected_objects, sym_remembered_wb_unprotected_objects_limit;
+ static VALUE sym_old_objects, sym_old_objects_limit;
#if RGENGC_ESTIMATE_OLDMALLOC
- gc_stat_sym_oldmalloc_increase_bytes,
- gc_stat_sym_oldmalloc_increase_bytes_limit,
+ static VALUE sym_oldmalloc_increase_bytes, sym_oldmalloc_increase_bytes_limit;
#endif
#if RGENGC_PROFILE
- 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
-};
+ static VALUE sym_total_generated_normal_object_count, sym_total_generated_shady_object_count;
+ static VALUE sym_total_shade_operation_count, sym_total_promoted_count;
+ static VALUE sym_total_remembered_normal_object_count, sym_total_remembered_shady_object_count;
+#endif /* RGENGC_PROFILE */
+#endif /* USE_RGENGC */
-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
-};
+ rb_objspace_t *objspace = &rb_objspace;
+ VALUE hash = Qnil, key = Qnil;
-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 (RB_TYPE_P(hash_or_sym, T_HASH)) {
+ hash = hash_or_sym;
+ }
+ else if (SYMBOL_P(hash_or_sym)) {
+ key = hash_or_sym;
+ }
+ else {
+ rb_raise(rb_eTypeError, "non-hash or symbol argument");
+ }
-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))
+ if (sym_count == 0) {
+#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
S(count);
S(heap_allocated_pages);
S(heap_sorted_length);
@@ -7000,6 +6318,7 @@ setup_gc_stat_symbols(void)
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);
@@ -7029,138 +6348,14 @@ setup_gc_stat_symbols(void)
#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);
-#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
-#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));
-#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 == gc_stat_symbols[gc_stat_sym_##name]) \
+ if (key == sym_##name) \
return attr; \
else if (hash != Qnil) \
- rb_hash_aset(hash, gc_stat_symbols[gc_stat_sym_##name], SIZET2NUM(attr));
+ rb_hash_aset(hash, sym_##name, SIZET2NUM(attr));
- again:
SET(count, objspace->profile.count);
/* implementation dependent counters */
@@ -7172,8 +6367,9 @@ gc_stat_internal(VALUE hash_or_sym)
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_eden_pages, heap_eden->total_pages);
- SET(heap_tomb_pages, heap_tomb->total_pages);
+ 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);
@@ -7183,8 +6379,8 @@ gc_stat_internal(VALUE hash_or_sym)
#if USE_RGENGC
SET(minor_gc_count, objspace->profile.minor_gc_count);
SET(major_gc_count, objspace->profile.major_gc_count);
- 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(remembered_wb_unprotected_objects, objspace->rgengc.remembered_wb_unprotected_objects);
+ SET(remembered_wb_unprotected_objects_limit, objspace->rgengc.remembered_wb_unprotected_objects_limit);
SET(old_objects, objspace->rgengc.old_objects);
SET(old_objects_limit, objspace->rgengc.old_objects_limit);
#if RGENGC_ESTIMATE_OLDMALLOC
@@ -7204,11 +6400,6 @@ gc_stat_internal(VALUE hash_or_sym)
#undef SET
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));
}
@@ -7246,6 +6437,7 @@ gc_stat_internal(VALUE hash_or_sym)
* :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,
@@ -7308,7 +6500,7 @@ rb_gc_stat(VALUE key)
/*
* call-seq:
- * GC.stress -> integer, true or false
+ * GC.stress -> fixnum, true or false
*
* Returns current status of GC stress mode.
*/
@@ -7338,7 +6530,7 @@ gc_stress_set(rb_objspace_t *objspace, VALUE flag)
*
* Enabling stress mode will degrade performance, it is only for debugging.
*
- * flag can be true, false, or an integer bit-ORed following flags.
+ * 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
@@ -7348,6 +6540,7 @@ static VALUE
gc_stress_set_m(VALUE self, VALUE flag)
{
rb_objspace_t *objspace = &rb_objspace;
+ rb_secure(2);
gc_stress_set(objspace, flag);
return flag;
}
@@ -7441,14 +6634,14 @@ get_envparam_size(const char *name, size_t *default_value, size_t lower_bound)
}
if (val > 0 && (size_t)val > lower_bound) {
if (RTEST(ruby_verbose)) {
- fprintf(stderr, "%s=%"PRIdSIZE" (default value: %"PRIuSIZE")\n", name, val, *default_value);
+ 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=%"PRIdSIZE" (default value: %"PRIuSIZE") is ignored because it must be greater than %"PRIuSIZE".\n",
+ 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;
@@ -7458,7 +6651,7 @@ get_envparam_size(const char *name, size_t *default_value, size_t lower_bound)
}
static int
-get_envparam_double(const char *name, double *default_value, double lower_bound, double upper_bound, int accept_zero)
+get_envparam_double(const char *name, double *default_value, double lower_bound)
{
char *ptr = getenv(name);
double val;
@@ -7470,29 +6663,14 @@ get_envparam_double(const char *name, double *default_value, double lower_bound,
if (RTEST(ruby_verbose)) fprintf(stderr, "invalid string for %s: %s\n", name, ptr);
return 0;
}
-
- if (accept_zero && val == 0.0) {
- goto accept;
- }
- else if (val <= 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);
- }
- }
- else if (upper_bound != 0.0 && /* ignore upper_bound if it is 0.0 */
- val > upper_bound) {
- if (RTEST(ruby_verbose)) {
- fprintf(stderr, "%s=%f (default value: %f) is ignored because it must be lower than %f.\n",
- name, val, *default_value, upper_bound);
- }
- }
- else {
- accept:
+ if (val > lower_bound) {
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 (default value: %f) is ignored because it must be greater than %f.\n", name, val, *default_value, lower_bound);
+ }
}
return 0;
}
@@ -7503,9 +6681,9 @@ gc_set_initial_pages(void)
size_t min_pages;
rb_objspace_t *objspace = &rb_objspace;
- min_pages = gc_params.heap_init_slots / HEAP_PAGE_OBJ_LIMIT;
- if (min_pages > heap_eden->total_pages) {
- heap_add_pages(objspace, heap_eden, min_pages - heap_eden->total_pages);
+ min_pages = gc_params.heap_init_slots / HEAP_OBJ_LIMIT;
+ if (min_pages > heap_eden->page_length) {
+ heap_add_pages(objspace, heap_eden, min_pages - heap_eden->page_length);
}
}
@@ -7521,18 +6699,7 @@ gc_set_initial_pages(void)
* - 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 number of slots.
- * * RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO (new from 2.4)
- * - Allocate additional pages when the number of free slots is
- * lower than the value (total_slots * (this ratio)).
- * * RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO (new from 2.4)
- * - Allocate slots to satisfy this formula:
- * free_slots = total_slots * goal_ratio
- * - In other words, prepare (total_slots * goal_ratio) free slots.
- * - if this value is 0.0, then use RUBY_GC_HEAP_GROWTH_FACTOR directly.
- * * RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO (new from 2.4)
- * - Allow to free pages when the number of free slots is
- * greater than the value (total_slots * (this ratio)).
+ * - Allocation rate is limited to this factor.
* * 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
@@ -7573,19 +6740,13 @@ ruby_gc_set_params(int safe_level)
gc_set_initial_pages();
}
- get_envparam_double("RUBY_GC_HEAP_GROWTH_FACTOR", &gc_params.growth_factor, 1.0, 0.0, FALSE);
+ get_envparam_double("RUBY_GC_HEAP_GROWTH_FACTOR", &gc_params.growth_factor, 1.0);
get_envparam_size ("RUBY_GC_HEAP_GROWTH_MAX_SLOTS", &gc_params.growth_max_slots, 0);
- get_envparam_double("RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO", &gc_params.heap_free_slots_min_ratio,
- 0.0, 1.0, FALSE);
- get_envparam_double("RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO", &gc_params.heap_free_slots_max_ratio,
- gc_params.heap_free_slots_min_ratio, 1.0, FALSE);
- get_envparam_double("RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO", &gc_params.heap_free_slots_goal_ratio,
- gc_params.heap_free_slots_min_ratio, gc_params.heap_free_slots_max_ratio, TRUE);
- get_envparam_double("RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR", &gc_params.oldobject_limit_factor, 0.0, 0.0, TRUE);
+ get_envparam_double("RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR", &gc_params.oldobject_limit_factor, 0.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, 0.0, FALSE);
+ get_envparam_double("RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR", &gc_params.malloc_limit_growth_factor, 1.0);
#if RGENGC_ESTIMATE_OLDMALLOC
if (get_envparam_size("RUBY_GC_OLDMALLOC_LIMIT", &gc_params.oldmalloc_limit_min, 0)) {
@@ -7593,7 +6754,7 @@ ruby_gc_set_params(int safe_level)
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, 0.0, FALSE);
+ get_envparam_double("RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR", &gc_params.oldmalloc_limit_growth_factor, 1.0);
#endif
}
@@ -7701,27 +6862,23 @@ ruby_memerror(void)
void
rb_memerror(void)
{
- rb_execution_context_t *ec = GET_EC();
- rb_objspace_t *objspace = rb_objspace_of(rb_ec_vm_ptr(ec));
- VALUE exc;
+ rb_thread_t *th = GET_THREAD();
+ rb_objspace_t *objspace = &rb_objspace;
if (during_gc) gc_exit(objspace, "rb_memerror");
- exc = nomem_error;
- if (!exc ||
- rb_ec_raised_p(ec, RAISED_NOMEMORY)) {
+ if (!nomem_error ||
+ rb_thread_raised_p(th, RAISED_NOMEMORY)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
exit(EXIT_FAILURE);
}
- if (rb_ec_raised_p(ec, RAISED_NOMEMORY)) {
- rb_ec_raised_clear(ec);
- }
- else {
- rb_ec_raised_set(ec, RAISED_NOMEMORY);
- exc = ruby_vm_special_exception_copy(exc);
+ if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
+ rb_thread_raised_clear(th);
+ GET_THREAD()->errinfo = nomem_error;
+ JUMP_TAG(TAG_RAISE);
}
- ec->errinfo = exc;
- EC_JUMP_TAG(ec, TAG_RAISE);
+ rb_thread_raised_set(th, RAISED_NOMEMORY);
+ rb_exc_raise(nomem_error);
}
static void *
@@ -7731,7 +6888,7 @@ aligned_malloc(size_t alignment, size_t size)
#if defined __MINGW32__
res = __mingw_aligned_malloc(size, alignment);
-#elif defined _WIN32
+#elif defined _WIN32 && !defined __CYGWIN__
void *_aligned_malloc(size_t, size_t);
res = _aligned_malloc(size, alignment);
#elif defined(HAVE_POSIX_MEMALIGN)
@@ -7752,9 +6909,11 @@ aligned_malloc(size_t alignment, size_t size)
res = (void*)aligned;
#endif
+#if defined(_DEBUG) || GC_DEBUG
/* alignment must be a power of 2 */
- GC_ASSERT(((alignment - 1) & alignment) == 0);
- GC_ASSERT(alignment % sizeof(void*) == 0);
+ assert(((alignment - 1) & alignment) == 0);
+ assert(alignment % sizeof(void*) == 0);
+#endif
return res;
}
@@ -7763,7 +6922,7 @@ aligned_free(void *ptr)
{
#if defined __MINGW32__
__mingw_aligned_free(ptr);
-#elif defined _WIN32
+#elif defined _WIN32 && !defined __CYGWIN__
_aligned_free(ptr);
#elif defined(HAVE_MEMALIGN) || defined(HAVE_POSIX_MEMALIGN)
free(ptr);
@@ -7831,7 +6990,7 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
gc_rest(objspace); /* gc_rest can reduce malloc_increase */
goto retry;
}
- garbage_collect_with_gvl(objspace, FALSE, FALSE, FALSE, GPR_FLAG_MALLOC);
+ garbage_collect_with_gvl(objspace, FALSE, TRUE, TRUE, GPR_FLAG_MALLOC);
}
}
@@ -7870,7 +7029,7 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
}
#if MALLOC_ALLOCATED_SIZE_CHECK
else {
- GC_ASSERT(objspace->malloc_params.allocations > 0);
+ if (RGENGC_CHECK_MODE) assert(objspace->malloc_params.allocations > 0);
}
#endif
}
@@ -7883,6 +7042,9 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
static inline size_t
objspace_malloc_prepare(rb_objspace_t *objspace, size_t size)
{
+ if ((ssize_t)size < 0) {
+ negative_size_allocation_error("negative allocation size (or too big)");
+ }
if (size == 0) size = 1;
#if CALC_EXACT_MALLOC_SIZE
@@ -7895,9 +7057,6 @@ objspace_malloc_prepare(rb_objspace_t *objspace, size_t size)
static inline void *
objspace_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
{
- size = objspace_malloc_size(objspace, mem, size);
- objspace_malloc_increase(objspace, mem, size, 0, MEMOP_TYPE_MALLOC);
-
#if CALC_EXACT_MALLOC_SIZE
((size_t *)mem)[0] = size;
mem = (size_t *)mem + 1;
@@ -7915,35 +7074,28 @@ objspace_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
} \
} while (0)
-/* these shouldn't be called directly.
- * objspace_* functinos do not check allocation size.
- */
static void *
-objspace_xmalloc0(rb_objspace_t *objspace, size_t size)
+objspace_xmalloc(rb_objspace_t *objspace, size_t size)
{
void *mem;
size = objspace_malloc_prepare(objspace, size);
TRY_WITH_GC(mem = malloc(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);
}
-static inline size_t
-xmalloc2_size(const size_t count, const size_t elsize)
-{
- size_t ret;
- if (rb_mul_size_overflow(count, elsize, SSIZE_MAX, &ret)) {
- ruby_malloc_size_overflow(count, elsize);
- }
- return ret;
-}
-
static void *
objspace_xrealloc(rb_objspace_t *objspace, void *ptr, size_t new_size, size_t old_size)
{
void *mem;
- if (!ptr) return objspace_xmalloc0(objspace, new_size);
+ if ((ssize_t)new_size < 0) {
+ negative_size_allocation_error("negative re-allocation size");
+ }
+
+ if (!ptr) return objspace_xmalloc(objspace, new_size);
/*
* The behavior of realloc(ptr, 0) is implementation defined.
@@ -7989,49 +7141,47 @@ objspace_xfree(rb_objspace_t *objspace, void *ptr, size_t old_size)
objspace_malloc_increase(objspace, ptr, 0, old_size, MEMOP_TYPE_FREE);
}
-static void *
-ruby_xmalloc0(size_t size)
-{
- return objspace_xmalloc0(&rb_objspace, size);
-}
-
void *
ruby_xmalloc(size_t size)
{
- if ((ssize_t)size < 0) {
- negative_size_allocation_error("too large allocation size");
- }
- return ruby_xmalloc0(size);
+ return objspace_xmalloc(&rb_objspace, size);
}
-void
-ruby_malloc_size_overflow(size_t count, size_t elsize)
+static inline size_t
+xmalloc2_size(size_t n, size_t size)
{
- rb_raise(rb_eArgError,
- "malloc: possible integer overflow (%"PRIuSIZE"*%"PRIuSIZE")",
- count, elsize);
+ size_t len = size * n;
+ if (n != 0 && size != len / n) {
+ rb_raise(rb_eArgError, "malloc: possible integer overflow");
+ }
+ return len;
}
void *
ruby_xmalloc2(size_t n, size_t size)
{
- return objspace_xmalloc0(&rb_objspace, xmalloc2_size(n, size));
+ return objspace_xmalloc(&rb_objspace, xmalloc2_size(n, size));
}
static void *
-objspace_xcalloc(rb_objspace_t *objspace, size_t size)
+objspace_xcalloc(rb_objspace_t *objspace, size_t count, size_t elsize)
{
void *mem;
+ size_t size;
+ size = xmalloc2_size(count, 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);
}
void *
ruby_xcalloc(size_t n, size_t size)
{
- return objspace_xcalloc(&rb_objspace, xmalloc2_size(n, size));
+ return objspace_xcalloc(&rb_objspace, n, size);
}
#ifdef ruby_sized_xrealloc
@@ -8040,10 +7190,6 @@ ruby_xcalloc(size_t n, size_t size)
void *
ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size)
{
- if ((ssize_t)new_size < 0) {
- negative_size_allocation_error("too large allocation size");
- }
-
return objspace_xrealloc(&rb_objspace, ptr, new_size, old_size);
}
@@ -8118,43 +7264,6 @@ ruby_mimfree(void *ptr)
free(mem);
}
-void *
-rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt)
-{
- rb_imemo_alloc_t *s;
- void *ptr;
-
- s = rb_imemo_alloc_new(0, 0, 0, 0);
- ptr = ruby_xmalloc0(size);
- s->ptr = (VALUE*)ptr;
- s->cnt = cnt;
- *store = (VALUE)s;
- return ptr;
-}
-
-void *
-rb_alloc_tmp_buffer(volatile VALUE *store, long len)
-{
- long cnt;
-
- if (len < 0 || (cnt = (long)roomof(len, sizeof(VALUE))) < 0) {
- rb_raise(rb_eArgError, "negative buffer size (or size too big)");
- }
-
- return rb_alloc_tmp_buffer_with_count(store, len, cnt);
-}
-
-void
-rb_free_tmp_buffer(volatile VALUE *store)
-{
- rb_imemo_alloc_t *s = (rb_imemo_alloc_t*)ATOMIC_VALUE_EXCHANGE(*store, 0);
- if (s) {
- void *ptr = ATOMIC_PTR_EXCHANGE(s->ptr, 0);
- s->cnt = 0;
- ruby_xfree(ptr);
- }
-}
-
#if MALLOC_ALLOCATED_SIZE
/*
* call-seq:
@@ -8187,18 +7296,6 @@ gc_malloc_allocations(VALUE self)
}
#endif
-void
-rb_gc_adjust_memory_usage(ssize_t diff)
-{
- rb_objspace_t *objspace = &rb_objspace;
- if (diff > 0) {
- objspace_malloc_increase(objspace, 0, diff, 0, MEMOP_TYPE_REALLOC);
- }
- else if (diff < 0) {
- objspace_malloc_increase(objspace, 0, 0, -diff, MEMOP_TYPE_REALLOC);
- }
-}
-
/*
------------------------------ WeakMap ------------------------------
*/
@@ -8262,6 +7359,7 @@ 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);
@@ -8276,7 +7374,7 @@ static const rb_data_type_t weakmap_type = {
wmap_free,
wmap_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -8306,7 +7404,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 + 1, sizeof(VALUE), i);
+ ptr = ruby_sized_xrealloc2(ptr, j, sizeof(VALUE), i);
ptr[0] = j;
*value = (st_data_t)ptr;
}
@@ -8525,7 +7623,7 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
else {
optr = 0;
size = 1;
- ptr = ruby_xmalloc0(2 * sizeof(VALUE));
+ ptr = ruby_xmalloc2(2, sizeof(VALUE));
}
ptr[0] = size;
ptr[size] = (VALUE)arg;
@@ -8665,11 +7763,8 @@ gc_prof_setup_new_record(rb_objspace_t *objspace, int reason)
objspace->profile.records = malloc(sizeof(gc_profile_record) * objspace->profile.size);
}
if (index >= objspace->profile.size) {
- void *ptr;
objspace->profile.size += 1000;
- ptr = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size);
- if (!ptr) rb_memerror();
- objspace->profile.records = ptr;
+ objspace->profile.records = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size);
}
if (!objspace->profile.records) {
rb_bug("gc_profile malloc or realloc miss");
@@ -8682,7 +7777,7 @@ gc_prof_setup_new_record(rb_objspace_t *objspace, int reason)
#if MALLOC_ALLOCATED_SIZE
record->allocated_size = malloc_allocated_size;
#endif
-#if GC_PROFILE_MORE_DETAIL && GC_PROFILE_DETAIL_MEMORY
+#if GC_PROFILE_DETAIL_MEMORY
#ifdef RUSAGE_SELF
{
struct rusage usage;
@@ -8732,12 +7827,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)
{
- RUBY_DTRACE_GC_HOOK(MARK_BEGIN);
+ if (RUBY_DTRACE_GC_MARK_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_BEGIN();
+ }
#if GC_PROFILE_MORE_DETAIL
if (gc_prof_enabled(objspace)) {
gc_prof_record(objspace)->gc_mark_time = getrusage_time();
@@ -8748,7 +7843,9 @@ gc_prof_mark_timer_start(rb_objspace_t *objspace)
static inline void
gc_prof_mark_timer_stop(rb_objspace_t *objspace)
{
- RUBY_DTRACE_GC_HOOK(MARK_END);
+ if (RUBY_DTRACE_GC_MARK_END_ENABLED()) {
+ RUBY_DTRACE_GC_MARK_END();
+ }
#if GC_PROFILE_MORE_DETAIL
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
@@ -8760,7 +7857,9 @@ gc_prof_mark_timer_stop(rb_objspace_t *objspace)
static inline void
gc_prof_sweep_timer_start(rb_objspace_t *objspace)
{
- RUBY_DTRACE_GC_HOOK(SWEEP_BEGIN);
+ if (RUBY_DTRACE_GC_SWEEP_BEGIN_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_BEGIN();
+ }
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
@@ -8773,7 +7872,9 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
static inline void
gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
{
- RUBY_DTRACE_GC_HOOK(SWEEP_END);
+ if (RUBY_DTRACE_GC_SWEEP_END_ENABLED()) {
+ RUBY_DTRACE_GC_SWEEP_END();
+ }
if (gc_prof_enabled(objspace)) {
double sweep_time;
@@ -8814,7 +7915,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_objects_at_gc_start - objspace->profile.total_freed_objects;
- size_t total = objspace->profile.heap_used_at_gc_start * HEAP_PAGE_OBJ_LIMIT;
+ size_t total = objspace->profile.heap_used_at_gc_start * HEAP_OBJ_LIMIT;
#if GC_PROFILE_MORE_DETAIL
record->heap_use_pages = objspace->profile.heap_used_at_gc_start;
@@ -8919,7 +8020,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(0, rb_hash_new(), record->flags));
+ 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_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));
@@ -8943,8 +8044,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("REMEMBERED_NORMAL_OBJECTS")), SIZET2NUM(record->remembered_normal_objects));
- rb_hash_aset(prof, ID2SYM(rb_intern("REMEMBERED_SHADY_OBJECTS")), SIZET2NUM(record->remembered_shady_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));
#endif
rb_ary_push(gc_profile, prof);
}
@@ -8975,6 +8076,8 @@ gc_profile_dump_major_reason(int flags, char *buff)
C(NOFREE, N);
C(OLDGEN, O);
C(SHADY, S);
+ C(RESCAN, R);
+ C(STRESS, T);
#if RGENGC_ESTIMATE_OLDMALLOC
C(OLDMALLOC, M);
#endif
@@ -9002,7 +8105,7 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
for (i = 0; i < count; i++) {
record = &objspace->profile.records[i];
- append(out, rb_sprintf("%5"PRIuSIZE" %19.3f %20"PRIuSIZE" %20"PRIuSIZE" %20"PRIuSIZE" %30.20f\n",
+ append(out, rb_sprintf("%5"PRIdSIZE" %19.3f %20"PRIuSIZE" %20"PRIuSIZE" %20"PRIuSIZE" %30.20f\n",
i+1, record->gc_invoke_time, record->heap_use_size,
record->heap_total_size, record->heap_total_objects, record->gc_time*1000));
}
@@ -9026,7 +8129,7 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
for (i = 0; i < count; i++) {
record = &objspace->profile.records[i];
- append(out, rb_sprintf("%5"PRIuSIZE" %4s/%c/%6s%c %13"PRIuSIZE" %15"PRIuSIZE
+ append(out, rb_sprintf("%5"PRIdSIZE" %4s/%c/%6s%c %13"PRIuSIZE" %15"PRIuSIZE
#if CALC_EXACT_MALLOC_SIZE
" %15"PRIuSIZE
#endif
@@ -9093,9 +8196,9 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
static VALUE
gc_profile_result(void)
{
- VALUE str = rb_str_buf_new(0);
- gc_profile_dump_on(str, rb_str_buf_append);
- return str;
+ VALUE str = rb_str_buf_new(0);
+ gc_profile_dump_on(str, rb_str_buf_append);
+ return str;
}
/*
@@ -9226,7 +8329,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);
case T_DATA:
@@ -9245,199 +8348,78 @@ 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);
-}
+#if RGENGC_DEBUG || RGENGC_CHECK_MODE
+#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];
/* from array.c */
# define ARY_SHARED_P(ary) \
- (GC_ASSERT(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
FL_TEST((ary),ELTS_SHARED)!=0)
# define ARY_EMBED_P(ary) \
- (GC_ASSERT(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
-static void
-rb_raw_iseq_info(char *buff, const int buff_size, const rb_iseq_t *iseq)
+static const char *
+obj_info(VALUE obj)
{
- if (iseq->body && iseq->body->location.label) {
- VALUE path = rb_iseq_path(iseq);
- VALUE n = iseq->body->location.first_lineno;
- snprintf(buff, buff_size, "%s %s@%s:%d", buff,
- RSTRING_PTR(iseq->body->location.label),
- RSTRING_PTR(path),
- n ? FIX2INT(n) : 0 );
- }
-}
+ int index = obj_info_buffers_index++;
+ char *buff = &obj_info_buffers[index][0];
+ int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
-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));
+ if (obj_info_buffers_index >= OBJ_INFO_BUFFERS_NUM) {
+ obj_info_buffers_index = 0;
}
- 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
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%p [%d%s%s%s%s] %s",
+ (void *)obj, age,
+ C(RVALUE_LONG_LIVED_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));
- 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:
- UNEXPECTED_NODE(rb_raw_obj_info);
- 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 struct rb_block *block;
- const rb_iseq_t *iseq;
- if (rb_obj_is_proc(obj) &&
- (block = vm_proc_block(obj)) != NULL &&
- (vm_block_type(block) == block_type_iseq) &&
- (iseq = vm_block_iseq(block)) != NULL) {
- rb_raw_iseq_info(buff, buff_size, iseq);
- }
- else {
- const char * const type_name = rb_objspace_data_type_name(obj);
- if (type_name) {
- snprintf(buff, buff_size, "%s %s", buff, type_name);
- }
- }
- break;
+#ifdef HAVE_VA_ARGS_MACRO
+ switch (BUILTIN_TYPE(obj)) {
+ case T_ARRAY:
+ snprintf(buff, OBJ_INFO_BUFFERS_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_CLASS: {
+ VALUE class_path = rb_class_path_cached(obj);
+ if (!NIL_P(class_path)) {
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(class_path));
}
- case T_IMEMO: {
- const char *imemo_name = "\0";
- switch (imemo_type(obj)) {
-#define IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break;
- IMEMO_NAME(env);
- IMEMO_NAME(cref);
- IMEMO_NAME(svar);
- IMEMO_NAME(throw_data);
- IMEMO_NAME(ifunc);
- IMEMO_NAME(memo);
- IMEMO_NAME(ment);
- IMEMO_NAME(iseq);
- IMEMO_NAME(alloc);
-#undef IMEMO_NAME
- default: UNREACHABLE;
- }
- 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;
- if (me->def) {
- 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));
- }
- else {
- snprintf(buff, buff_size, "%s", rb_id2name(me->called_id));
- }
- break;
+ break;
+ }
+ case T_DATA: {
+ const char *type_name = rb_objspace_data_type_name(obj);
+ if (type_name && strcmp(type_name, "iseq") == 0) {
+ rb_iseq_t *iseq;
+ GetISeqPtr(obj, iseq);
+ if (iseq->location.label) {
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s@%s:%d", buff,
+ RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path), (int)iseq->location.first_lineno);
}
- case imemo_iseq: {
- const rb_iseq_t *iseq = (const rb_iseq_t *)obj;
- rb_raw_iseq_info(buff, buff_size, iseq);
- break;
- }
- default:
- break;
- }
}
- default:
- break;
- }
+ break;
+ }
+ default:
+ break;
+ }
+#endif
#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)
@@ -9446,24 +8428,6 @@ obj_info(VALUE 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
@@ -9486,7 +8450,7 @@ rb_gcdebug_print_obj_condition(VALUE obj)
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_UNPROTECTED(obj) ? "false" : "true");
- fprintf(stderr, "remembered? : %s\n", RVALUE_REMEMBERED(obj) ? "true" : "false");
+ fprintf(stderr, "remembered? : %s\n", MARKED_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(obj), obj) ? "true" : "false");
#endif
if (is_lazy_sweeping(heap_eden)) {
@@ -9513,37 +8477,6 @@ rb_gcdebug_sentinel(VALUE obj, const char *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
*
@@ -9555,8 +8488,6 @@ rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self)
* called when a specific object is about to be destroyed by garbage
* collection.
*
- * require 'objspace'
- *
* a = "A"
* b = "B"
*
@@ -9629,9 +8560,9 @@ Init_GC(void)
gc_constants = rb_hash_new();
rb_hash_aset(gc_constants, ID2SYM(rb_intern("RVALUE_SIZE")), SIZET2NUM(sizeof(RVALUE)));
- rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_PAGE_OBJ_LIMIT")), SIZET2NUM(HEAP_PAGE_OBJ_LIMIT));
- rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_PAGE_BITMAP_SIZE")), SIZET2NUM(HEAP_PAGE_BITMAP_SIZE));
- rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_PAGE_BITMAP_PLANES")), SIZET2NUM(HEAP_PAGE_BITMAP_PLANES));
+ rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_OBJ_LIMIT")), SIZET2NUM(HEAP_OBJ_LIMIT));
+ rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_BITMAP_SIZE")), SIZET2NUM(HEAP_BITMAP_SIZE));
+ rb_hash_aset(gc_constants, ID2SYM(rb_intern("HEAP_BITMAP_PLANES")), SIZET2NUM(HEAP_BITMAP_PLANES));
OBJ_FREEZE(gc_constants);
rb_define_const(rb_mGC, "INTERNAL_CONSTANTS", gc_constants);
@@ -9689,16 +8620,11 @@ 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_fstring_lit(#o))
+#define OPT(o) if (o) rb_ary_push(opts, rb_fstring_new(#o, strlen(#o)))
OPT(GC_DEBUG);
OPT(USE_RGENGC);
OPT(RGENGC_DEBUG);
diff --git a/gc.h b/gc.h
index 2c91e06620..2ba46c9250 100644
--- a/gc.h
+++ b/gc.h
@@ -2,9 +2,9 @@
#ifndef RUBY_GC_H
#define RUBY_GC_H 1
-#if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__)
+#if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__) && !defined(__native_client__)
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
-#elif defined(__i386) && defined(__GNUC__)
+#elif defined(__i386) && defined(__GNUC__) && !defined(__native_client__)
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
#else
NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
@@ -57,10 +57,7 @@ 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) do { \
- VALUE markobj = (ptr); \
- if (RTEST(markobj)) {rb_gc_mark(markobj);} \
-} while (0)
+#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
#if STACK_GROW_DIRECTION > 0
@@ -86,12 +83,6 @@ 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);
-
-struct rb_thread_struct;
-
RUBY_SYMBOL_EXPORT_BEGIN
/* exports for objspace module */
diff --git a/gem_prelude.rb b/gem_prelude.rb
index be9c41933c..3d4516f341 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1,8 +1 @@
-if defined?(Gem)
- require 'rubygems.rb'
- begin
- gem 'did_you_mean'
- require 'did_you_mean'
- rescue Gem::LoadError, LoadError
- end if defined?(DidYouMean)
-end
+require 'rubygems.rb' if defined?(Gem)
diff --git a/gems/bundled_gems b/gems/bundled_gems
index c3c88f54ea..54d84c87ba 100644
--- a/gems/bundled_gems
+++ b/gems/bundled_gems
@@ -1,7 +1,3 @@
-did_you_mean 1.2.0 https://github.com/yuki24/did_you_mean
-minitest 5.10.3 https://github.com/seattlerb/minitest
-net-telnet 0.1.1 https://github.com/ruby/net-telnet
-power_assert 1.1.1 https://github.com/k-tsj/power_assert
-rake 12.3.0 https://github.com/ruby/rake
-test-unit 3.2.7 https://github.com/test-unit/test-unit
-xmlrpc 0.3.0 https://github.com/ruby/xmlrpc
+power_assert 0.1.3
+test-unit 3.0.1
+minitest 5.4.1
diff --git a/golf_prelude.rb b/golf_prelude.rb
index e45f4cafd9..8034601287 100644
--- a/golf_prelude.rb
+++ b/golf_prelude.rb
@@ -85,7 +85,7 @@ class String
split('')
end
- (Array.instance_methods - instance_methods - %i[to_ary transpose flatten flatten! compact compact! assoc rassoc]).each{|meth|
+ (Array.instance_methods - instance_methods - [:to_ary, :transpose, :flatten, :flatten!, :compact, :compact!, :assoc, :rassoc]).each{|meth|
eval "
def #{meth}(*args, &block)
a = to_a
diff --git a/goruby.c b/goruby.c
index ddb62562d4..99042f8440 100644
--- a/goruby.c
+++ b/goruby.c
@@ -20,8 +20,7 @@ RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
static VALUE
init_golf(VALUE arg)
{
- Init_golf();
- rb_provide("golf.so");
+ ruby_init_ext("golf.so", Init_golf);
return arg;
}
@@ -35,11 +34,7 @@ goruby_options(int argc, char **argv)
if ((isatty(0) && isatty(1) && isatty(2)) && (pipe(rw) == 0)) {
ssize_t n;
infd = dup(0);
- if (infd < 0) {
- close(rw[0]);
- close(rw[1]);
- goto no_irb;
- }
+ if (infd < 0) return NULL;
dup2(rw[0], 0);
close(rw[0]);
n = write(rw[1], cmd, sizeof(cmd) - 1);
@@ -50,7 +45,6 @@ goruby_options(int argc, char **argv)
return ret;
}
else {
- no_irb:
return ruby_options(argc, argv);
}
}
diff --git a/hash.c b/hash.c
index 0a9a5ee261..9bfc39611e 100644
--- a/hash.c
+++ b/hash.c
@@ -11,14 +11,14 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.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"
-#include "gc.h"
#ifdef __APPLE__
# ifdef HAVE_CRT_EXTERNS_H
@@ -33,29 +33,14 @@
FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
!NIL_P(RHASH_IFNONE(hash)))
-#define SET_DEFAULT(hash, ifnone) ( \
- FL_UNSET_RAW(hash, HASH_PROC_DEFAULT), \
- RHASH_SET_IFNONE(hash, ifnone))
-
-#define SET_PROC_DEFAULT(hash, proc) set_proc_default(hash, proc)
-
-#define COPY_DEFAULT(hash, hash2) copy_default(RHASH(hash), RHASH(hash2))
-
-static inline void
-copy_default(struct RHash *hash, const struct RHash *hash2)
-{
- hash->basic.flags &= ~HASH_PROC_DEFAULT;
- hash->basic.flags |= hash2->basic.flags & HASH_PROC_DEFAULT;
- RHASH_SET_IFNONE(hash, RHASH_IFNONE(hash2));
-}
-
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;
+ st_table *mtbl = RCLASS_M_TBL(c);
+ if (mtbl && mtbl->num_entries) return klass;
c = RCLASS_SUPER(c);
}
return 0;
@@ -85,6 +70,12 @@ static VALUE envtbl;
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)
{
RB_OBJ_WRITE(hash, (&RHASH(hash)->ifnone), ifnone);
@@ -140,133 +131,41 @@ rb_hash(VALUE obj)
long rb_objid_hash(st_index_t index);
-long
-rb_dbl_long_hash(double d)
-{
- /* normalize -0.0 to 0.0 */
- if (d == 0.0) d = 0.0;
-#if SIZEOF_INT == SIZEOF_VOIDP
- return rb_memhash(&d, sizeof(d));
-#else
- {
- union {double d; uint64_t i;} u;
-
- u.d = d;
- return rb_objid_hash(rb_hash_start(u.i));
- }
-#endif
-}
-
-static inline long
-any_hash(VALUE a, st_index_t (*other_func)(VALUE))
+static st_index_t
+rb_any_hash(VALUE a)
{
VALUE hval;
st_index_t hnum;
if (SPECIAL_CONST_P(a)) {
- 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;
- }
+ if (a == Qundef) return 0;
+ if (SYMBOL_P(a)) a >>= (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
hnum = rb_objid_hash((st_index_t)a);
}
else if (BUILTIN_TYPE(a) == T_STRING) {
hnum = rb_str_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:
- hnum = rb_dbl_long_hash(rb_float_value(a));
- }
else {
- hnum = other_func(a);
+ hval = rb_hash(a);
+ hnum = FIX2LONG(hval);
}
- out:
-#if SIZEOF_LONG < SIZEOF_ST_INDEX_T
- if (hnum > 0)
- hnum &= (unsigned long)-1 >> 2;
- else
- hnum |= ~((unsigned long)-1 >> 2);
-#else
hnum <<= 1;
- hnum = RSHIFT(hnum, 1);
-#endif
- return (long)hnum;
-}
-
-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);
-}
-
-/* Here is a hash function for 64-bit key. It is about 5 times faster
- (2 times faster when uint128 type is absent) on Haswell than
- tailored Spooky or City hash function can be. */
-
-/* Here we two primes with random bit generation. */
-static const uint64_t prime1 = ((uint64_t)0x2e0bb864 << 32) | 0xe9ea7df5;
-static const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1;
-
-
-static inline uint64_t
-mult_and_mix(uint64_t m1, uint64_t m2)
-{
-#if defined HAVE_UINT128_T
- uint128_t r = (uint128_t) m1 * (uint128_t) m2;
- return (uint64_t) (r >> 64) ^ (uint64_t) r;
-#else
- uint64_t hm1 = m1 >> 32, hm2 = m2 >> 32;
- uint64_t lm1 = m1, lm2 = m2;
- uint64_t v64_128 = hm1 * hm2;
- uint64_t v32_96 = hm1 * lm2 + lm1 * hm2;
- uint64_t v1_32 = lm1 * lm2;
-
- return (v64_128 + (v32_96 >> 32)) ^ ((v32_96 << 32) + v1_32);
-#endif
-}
-
-static inline uint64_t
-key64_hash(uint64_t key, uint32_t seed)
-{
- return mult_and_mix(key + seed, prime1);
+ return (st_index_t)RSHIFT(hnum, 1);
}
long
rb_objid_hash(st_index_t index)
{
- return (long)key64_hash(rb_hash_start(index), (uint32_t)prime2);
+ st_index_t hnum = rb_hash_start(index);
+ 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)
+int
+rb_hash_iter_lev(VALUE h)
{
- long hnum = any_hash(obj, objid_hash);
- return ST2FIX(hnum);
+ return RHASH_ITER_LEV(h);
}
static const struct st_hash_type objhash = {
@@ -274,29 +173,8 @@ static const struct st_hash_type objhash = {
rb_any_hash,
};
-#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)key64_hash(rb_hash_start((st_index_t)n), (uint32_t)prime2);
-}
-
-static const struct st_hash_type identhash = {
- rb_ident_cmp,
- rb_ident_hash,
-};
+extern const struct st_hash_type st_hashtype_num;
+#define identhash st_hashtype_num
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
@@ -356,6 +234,7 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
}
switch (status) {
case ST_DELETE:
+ FL_SET(arg->hash, HASH_DELETED);
return ST_DELETE;
case ST_CONTINUE:
break;
@@ -375,7 +254,12 @@ hash_foreach_ensure_rollback(VALUE hash)
static VALUE
hash_foreach_ensure(VALUE hash)
{
- RHASH_ITER_LEV(hash)--;
+ if (--RHASH_ITER_LEV(hash) == 0) {
+ if (FL_TEST(hash, HASH_DELETED)) {
+ st_cleanup_safe(RHASH(hash)->ntbl, (st_data_t)Qundef);
+ FL_UNSET(hash, HASH_DELETED);
+ }
+ }
return 0;
}
@@ -404,26 +288,21 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
}
static VALUE
-hash_alloc_flags(VALUE klass, VALUE flags, VALUE ifnone)
+hash_alloc(VALUE klass)
{
- const VALUE wb = (RGENGC_WB_PROTECTED_HASH ? FL_WB_PROTECTED : 0);
- NEWOBJ_OF(hash, struct RHash, klass, T_HASH | wb | flags);
+ NEWOBJ_OF(hash, struct RHash, klass, T_HASH | (RGENGC_WB_PROTECTED_HASH ? FL_WB_PROTECTED : 0));
- RHASH_SET_IFNONE((VALUE)hash, ifnone);
+ RHASH_SET_IFNONE((VALUE)hash, Qnil);
return (VALUE)hash;
}
static VALUE
-hash_alloc(VALUE klass)
-{
- return hash_alloc_flags(klass, 0, Qnil);
-}
-
-static VALUE
empty_hash_alloc(VALUE klass)
{
- RUBY_DTRACE_CREATE_HOOK(HASH, 0);
+ if (RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+ RUBY_DTRACE_HASH_CREATE(0, rb_sourcefile(), rb_sourceline());
+ }
return hash_alloc(klass);
}
@@ -434,41 +313,28 @@ rb_hash_new(void)
return hash_alloc(rb_cHash);
}
-VALUE
-rb_hash_new_compare_by_id(void)
-{
- VALUE hash = rb_hash_new();
- RHASH(hash)->ntbl = rb_init_identtable();
- return hash;
-}
-
-VALUE
-rb_hash_new_with_size(st_index_t size)
+static inline VALUE
+rb_hash_dup_empty(VALUE hash)
{
- VALUE ret = rb_hash_new();
- if (size)
- RHASH(ret)->ntbl = st_init_table_with_size(&objhash, size);
- return ret;
-}
+ NEWOBJ_OF(ret, struct RHash,
+ rb_obj_class(hash),
+ (RBASIC(hash)->flags)&(T_MASK|FL_EXIVAR|FL_TAINT));
+ if (FL_TEST((hash), FL_EXIVAR))
+ rb_copy_generic_ivar((VALUE)(ret),(VALUE)(hash));
-static VALUE
-hash_dup(VALUE hash, VALUE klass, VALUE flags)
-{
- VALUE ret = hash_alloc_flags(klass, flags,
- RHASH_IFNONE(hash));
- if (!RHASH_EMPTY_P(hash))
- RHASH(ret)->ntbl = st_copy(RHASH(hash)->ntbl);
- return ret;
+ if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
+ FL_SET(ret, HASH_PROC_DEFAULT);
+ }
+ RHASH_SET_IFNONE(ret, RHASH_IFNONE(hash));
+ return (VALUE)ret;
}
VALUE
rb_hash_dup(VALUE hash)
{
- const VALUE flags = RBASIC(hash)->flags;
- VALUE ret = hash_dup(hash, rb_obj_class(hash),
- flags & (FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT));
- if (flags & FL_EXIVAR)
- rb_copy_generic_ivar(ret, hash);
+ VALUE ret = rb_hash_dup_empty(hash);
+ if (!RHASH_EMPTY_P(hash))
+ RHASH(ret)->ntbl = st_copy(RHASH(hash)->ntbl);
return ret;
}
@@ -542,10 +408,8 @@ struct update_arg {
VALUE old_value;
};
-typedef int (*tbl_update_func)(st_data_t *, st_data_t *, st_data_t, int);
-
static int
-tbl_update(VALUE hash, VALUE key, tbl_update_func func, st_data_t optional_arg)
+tbl_update(VALUE hash, VALUE key, int (*func)(st_data_t *key, st_data_t *val, st_data_t arg, int existing), st_data_t optional_arg)
{
struct update_arg arg;
int result;
@@ -576,19 +440,14 @@ tbl_update(VALUE hash, VALUE key, tbl_update_func func, st_data_t optional_arg)
RHASH_UPDATE_ITER(hash, RHASH_ITER_LEV(hash), key, func, arg)
static void
-set_proc_default(VALUE hash, VALUE proc)
+default_proc_arity_check(VALUE proc)
{
- if (rb_proc_lambda_p(proc)) {
- int n = rb_proc_arity(proc);
+ int n = rb_proc_arity(proc);
- if (n != 2 && (n >= 0 || n < -3)) {
- if (n < 0) n = -n-1;
- rb_raise(rb_eTypeError, "default_proc takes two arguments (2 for %d)", n);
- }
+ if (rb_proc_lambda_p(proc) && n != 2 && (n >= 0 || n < -3)) {
+ if (n < 0) n = -n-1;
+ rb_raise(rb_eTypeError, "default_proc takes two arguments (2 for %d)", n);
}
-
- FL_SET_RAW(hash, HASH_PROC_DEFAULT);
- RHASH_SET_IFNONE(hash, proc);
}
/*
@@ -635,7 +494,9 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
if (rb_block_given_p()) {
rb_check_arity(argc, 0, 0);
ifnone = rb_block_proc();
- SET_PROC_DEFAULT(hash, ifnone);
+ default_proc_arity_check(ifnone);
+ RHASH_SET_IFNONE(hash, ifnone);
+ FL_SET(hash, HASH_PROC_DEFAULT);
}
else {
rb_check_arity(argc, 0, 1);
@@ -670,6 +531,7 @@ static VALUE
rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
{
VALUE hash, tmp;
+ int i;
if (argc == 1) {
tmp = rb_hash_s_try_convert(Qnil, argv[0]);
@@ -723,22 +585,23 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
}
hash = hash_alloc(klass);
- rb_hash_bulk_insert(argc, argv, hash);
+ for (i=0; i<argc; i+=2) {
+ rb_hash_aset(hash, argv[i], argv[i + 1]);
+ }
return hash;
}
-VALUE
-rb_to_hash_type(VALUE hash)
+static VALUE
+to_hash(VALUE hash)
{
- return rb_convert_type_with_id(hash, T_HASH, "Hash", idTo_hash);
+ return rb_convert_type(hash, T_HASH, "Hash", "to_hash");
}
-#define to_hash rb_to_hash_type
VALUE
rb_check_hash_type(VALUE hash)
{
- return rb_check_convert_type_with_id(hash, T_HASH, "Hash", idTo_hash);
+ return rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");
}
/*
@@ -779,7 +642,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, a
+ * called while an iterator is traversing the hash, an
* <code>RuntimeError</code> will be raised in the iterator.
*
* a = [ "a", "b" ]
@@ -792,7 +655,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
* h[a] #=> 100
*/
-VALUE
+static VALUE
rb_hash_rehash(VALUE hash)
{
VALUE tmp;
@@ -816,8 +679,8 @@ rb_hash_rehash(VALUE hash)
return hash;
}
-VALUE
-rb_hash_default_value(VALUE hash, VALUE key)
+static VALUE
+hash_default_value(VALUE hash, VALUE key)
{
if (rb_method_basic_definition_p(CLASS_OF(hash), id_default)) {
VALUE ifnone = RHASH_IFNONE(hash);
@@ -850,7 +713,7 @@ rb_hash_aref(VALUE hash, VALUE key)
st_data_t val;
if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
- return rb_hash_default_value(hash, key);
+ return hash_default_value(hash, key);
}
return (VALUE)val;
}
@@ -879,9 +742,9 @@ rb_hash_lookup(VALUE hash, VALUE key)
*
* Returns a value from the hash for the given key. If the key can't be
* found, there are several options: With no other arguments, it will
- * raise a <code>KeyError</code> exception; if <i>default</i> is given,
- * then that will be returned; if the optional code block is specified,
- * then that will be run and its result returned.
+ * raise an <code>KeyError</code> exception; if <i>default</i> is
+ * given, then that will be returned; if the optional code block is
+ * specified, then that will be run and its result returned.
*
* h = { "a" => 100, "b" => 200 }
* h.fetch("a") #=> 100
@@ -918,12 +781,12 @@ 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) {
- VALUE desc = rb_protect(rb_inspect, key, 0);
+ volatile 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_key_err_raise(rb_sprintf("key not found: %"PRIsVALUE, desc), hash, key);
+ rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, desc);
}
return argv[1];
}
@@ -960,15 +823,14 @@ rb_hash_fetch(VALUE hash, VALUE key)
static VALUE
rb_hash_default(int argc, VALUE *argv, VALUE hash)
{
- VALUE args[2], ifnone;
+ VALUE key, ifnone;
rb_check_arity(argc, 0, 1);
+ key = argv[0];
ifnone = RHASH_IFNONE(hash);
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
if (argc == 0) return Qnil;
- args[0] = hash;
- args[1] = argv[0];
- return rb_funcallv(ifnone, id_yield, 2, args);
+ return rb_funcall(ifnone, id_yield, 2, hash, key);
}
return ifnone;
}
@@ -997,7 +859,8 @@ static VALUE
rb_hash_set_default(VALUE hash, VALUE ifnone)
{
rb_hash_modify_check(hash);
- SET_DEFAULT(hash, ifnone);
+ RHASH_SET_IFNONE(hash, ifnone);
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
return ifnone;
}
@@ -1038,24 +901,27 @@ rb_hash_default_proc(VALUE hash)
* h["cat"] #=> "catcat"
*/
-VALUE
+static VALUE
rb_hash_set_default_proc(VALUE hash, VALUE proc)
{
VALUE b;
rb_hash_modify_check(hash);
if (NIL_P(proc)) {
- SET_DEFAULT(hash, proc);
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
+ RHASH_SET_IFNONE(hash, proc);
return proc;
}
- b = rb_check_convert_type_with_id(proc, T_DATA, "Proc", idTo_proc);
+ b = rb_check_convert_type(proc, T_DATA, "Proc", "to_proc");
if (NIL_P(b) || !rb_obj_is_proc(b)) {
rb_raise(rb_eTypeError,
"wrong default_proc type %s (expected Proc)",
rb_obj_classname(proc));
}
proc = b;
- SET_PROC_DEFAULT(hash, proc);
+ default_proc_arity_check(proc);
+ RHASH_SET_IFNONE(hash, proc);
+ FL_SET(hash, HASH_PROC_DEFAULT);
return proc;
}
@@ -1106,43 +972,22 @@ rb_hash_index(VALUE hash, VALUE value)
return rb_hash_key(hash, value);
}
-/*
- * 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)
+static VALUE
+rb_hash_delete_key(VALUE hash, VALUE key)
{
st_data_t ktmp = (st_data_t)key, val;
- if (!RHASH(hash)->ntbl) {
- return Qundef;
+ 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;
+ }
}
- else if (st_delete(RHASH(hash)->ntbl, &ktmp, &val)) {
+ 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;
- }
+ return Qundef;
}
/*
@@ -1151,8 +996,8 @@ rb_hash_delete(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, it returns
- * <em>nil</em>. If the optional code block is given and the
+ * key is equal to <i>key</i>. If the key is not found, returns the
+ * <em>default value</em>. If the optional code block is given and the
* key is not found, pass in the key and return the result of
* <i>block</i>.
*
@@ -1163,25 +1008,18 @@ rb_hash_delete(VALUE hash, VALUE key)
*
*/
-static VALUE
-rb_hash_delete_m(VALUE hash, VALUE key)
+VALUE
+rb_hash_delete(VALUE hash, VALUE key)
{
VALUE val;
rb_hash_modify_check(hash);
- 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;
- }
+ val = rb_hash_delete_key(hash, key);
+ if (val != Qundef) return val;
+ if (rb_block_given_p()) {
+ return rb_yield(key);
}
+ return Qnil;
}
struct shift_var {
@@ -1228,12 +1066,12 @@ rb_hash_shift(VALUE hash)
else {
rb_hash_foreach(hash, shift_i_safe, (VALUE)&var);
if (var.key != Qundef) {
- rb_hash_delete_entry(hash, var.key);
+ rb_hash_delete_key(hash, var.key);
return rb_assoc_new(var.key, var.val);
}
}
}
- return rb_hash_default_value(hash, Qnil);
+ return hash_default_value(hash, Qnil);
}
static int
@@ -1342,38 +1180,6 @@ rb_hash_reject(VALUE hash)
}
/*
- * call-seq:
- * hsh.slice(*keys) -> a_hash
- *
- * Returns a hash containing only the given keys and their values.
- *
- * h = { a: 100, b: 200, c: 300 }
- * h.slice(:a) #=> {:a=>100}
- * h.slice(:b, :c, :d) #=> {:b=>200, :c=>300}
- */
-
-static VALUE
-rb_hash_slice(int argc, VALUE *argv, VALUE hash)
-{
- int i;
- VALUE key, value, result;
-
- if (argc == 0 || RHASH_EMPTY_P(hash)) {
- return rb_hash_new();
- }
- result = rb_hash_new_with_size(argc);
-
- for (i = 0; i < argc; i++) {
- key = argv[i];
- value = rb_hash_lookup2(hash, key, Qundef);
- if (value != Qundef)
- rb_hash_aset(result, key, value);
- }
-
- return result;
-}
-
-/*
* call-seq:
* hsh.values_at(key, ...) -> array
*
@@ -1396,34 +1202,6 @@ 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)
{
@@ -1563,44 +1341,17 @@ hash_aset(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
return ST_CONTINUE;
}
-static VALUE
-fstring_existing_str(VALUE str)
-{
- st_data_t fstr;
- st_table *tbl = rb_vm_fstring_table();
-
- if (st_lookup(tbl, str, &fstr)) {
- if (rb_objspace_garbage_object_p(fstr)) {
- return rb_fstring(str);
- }
- else {
- return (VALUE)fstr;
- }
- }
- else {
- return Qnil;
- }
-}
-
static int
hash_aset_str(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
{
- if (!existing && !RB_OBJ_FROZEN(*key)) {
- VALUE k;
-
- if (!RB_OBJ_TAINTED(*key) &&
- (k = fstring_existing_str(*key)) != Qnil) {
- *key = k;
- }
- else {
- *key = rb_str_new_frozen(*key);
- }
+ if (!existing) {
+ *key = rb_str_new_frozen(*key);
}
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:
@@ -1681,7 +1432,13 @@ rb_hash_initialize_copy(VALUE hash, VALUE hash2)
st_clear(ntbl);
}
- COPY_DEFAULT(hash, hash2);
+ if (FL_TEST(hash2, HASH_PROC_DEFAULT)) {
+ FL_SET(hash, HASH_PROC_DEFAULT);
+ }
+ else {
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
+ }
+ RHASH_SET_IFNONE(hash, RHASH_IFNONE(hash2));
return hash;
}
@@ -1707,7 +1464,11 @@ rb_hash_replace(VALUE hash, VALUE hash2)
if (hash == hash2) return hash;
hash2 = to_hash(hash2);
- COPY_DEFAULT(hash, hash2);
+ RHASH_SET_IFNONE(hash, RHASH_IFNONE(hash2));
+ if (FL_TEST(hash2, HASH_PROC_DEFAULT))
+ FL_SET(hash, HASH_PROC_DEFAULT);
+ else
+ FL_UNSET(hash, HASH_PROC_DEFAULT);
table2 = RHASH(hash2)->ntbl;
@@ -1720,8 +1481,8 @@ rb_hash_replace(VALUE hash, VALUE hash2)
/*
* call-seq:
- * hsh.length -> integer
- * hsh.size -> integer
+ * hsh.length -> fixnum
+ * hsh.size -> fixnum
*
* Returns the number of key-value pairs in the hash.
*
@@ -1831,10 +1592,7 @@ each_pair_i(VALUE key, VALUE value)
static int
each_pair_i_fast(VALUE key, VALUE value)
{
- VALUE argv[2];
- argv[0] = key;
- argv[1] = value;
- rb_yield_values2(2, argv);
+ rb_yield_values(2, key, value);
return ST_CONTINUE;
}
@@ -1872,148 +1630,6 @@ rb_hash_each_pair(VALUE hash)
}
static int
-transform_keys_i(VALUE key, VALUE value, VALUE result)
-{
- VALUE new_key = rb_yield(key);
- rb_hash_aset(result, new_key, value);
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * hsh.transform_keys {|key| block } -> new_hash
- * hsh.transform_keys -> an_enumerator
- *
- * Returns a new hash with the results of running the block once for
- * every key.
- * This method does not change the values.
- *
- * h = { a: 1, b: 2, c: 3 }
- * h.transform_keys {|k| k.to_s } #=> { "a" => 1, "b" => 2, "c" => 3 }
- * h.transform_keys(&:to_s) #=> { "a" => 1, "b" => 2, "c" => 3 }
- * h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
- * #=> { "a.0" => 1, "b.1" => 2, "c.2" => 3 }
- *
- * If no block is given, an enumerator is returned instead.
- */
-static VALUE
-rb_hash_transform_keys(VALUE hash)
-{
- VALUE result;
-
- RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
- result = rb_hash_new();
- if (!RHASH_EMPTY_P(hash)) {
- rb_hash_foreach(hash, transform_keys_i, result);
- }
-
- return result;
-}
-
-static VALUE rb_hash_flatten(int argc, VALUE *argv, VALUE hash);
-
-/*
- * call-seq:
- * hsh.transform_keys! {|key| block } -> hsh
- * hsh.transform_keys! -> an_enumerator
- *
- * Invokes the given block once for each key in <i>hsh</i>, replacing it
- * with the new key returned by the block, and then returns <i>hsh</i>.
- * This method does not change the values.
- *
- * h = { a: 1, b: 2, c: 3 }
- * h.transform_keys! {|k| k.to_s } #=> { "a" => 1, "b" => 2, "c" => 3 }
- * h.transform_keys!(&:to_sym) #=> { a: 1, b: 2, c: 3 }
- * h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
- * #=> { "a.0" => 1, "b.1" => 2, "c.2" => 3 }
- *
- * If no block is given, an enumerator is returned instead.
- */
-static VALUE
-rb_hash_transform_keys_bang(VALUE hash)
-{
- RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
- rb_hash_modify_check(hash);
- if (RHASH(hash)->ntbl) {
- long i;
- VALUE pairs = rb_hash_flatten(0, NULL, hash);
- rb_hash_clear(hash);
- for (i = 0; i < RARRAY_LEN(pairs); i += 2) {
- VALUE key = RARRAY_AREF(pairs, i), new_key = rb_yield(key),
- val = RARRAY_AREF(pairs, i+1);
- rb_hash_aset(hash, new_key, val);
- }
- }
- return hash;
-}
-
-static int
-transform_values_i(VALUE key, VALUE value, VALUE result)
-{
- VALUE new_value = rb_yield(value);
- rb_hash_aset(result, key, new_value);
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * hsh.transform_values {|value| block } -> new_hash
- * hsh.transform_values -> an_enumerator
- *
- * Returns a new hash with the results of running the block once for
- * every value.
- * This method does not change the keys.
- *
- * h = { a: 1, b: 2, c: 3 }
- * h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
- * h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
- * h.transform_values.with_index {|v, i| "#{v}.#{i}" }
- * #=> { a: "1.0", b: "2.1", c: "3.2" }
- *
- * If no block is given, an enumerator is returned instead.
- */
-static VALUE
-rb_hash_transform_values(VALUE hash)
-{
- VALUE result;
-
- RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
- result = rb_hash_new_with_size(RHASH_SIZE(hash));
- if (!RHASH_EMPTY_P(hash)) {
- rb_hash_foreach(hash, transform_values_i, result);
- }
-
- return result;
-}
-
-/*
- * call-seq:
- * hsh.transform_values! {|value| block } -> hsh
- * hsh.transform_values! -> an_enumerator
- *
- * Invokes the given block once for each value in <i>hsh</i>, replacing it
- * with the new value returned by the block, and then returns <i>hsh</i>.
- * This method does not change the keys.
- *
- * h = { a: 1, b: 2, c: 3 }
- * h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
- * h.transform_values!(&:to_s) #=> { a: "2", b: "5", c: "10" }
- * h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
- * #=> { a: "2.0", b: "5.1", c: "10.2" }
- *
- * If no block is given, an enumerator is returned instead.
- */
-static VALUE
-rb_hash_transform_values_bang(VALUE hash)
-{
- RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
- rb_hash_modify_check(hash);
- if (RHASH(hash)->ntbl)
- rb_hash_foreach(hash, transform_values_i, hash);
- return hash;
-}
-
-static int
to_a_i(VALUE key, VALUE value, VALUE ary)
{
rb_ary_push(ary, rb_assoc_new(key, value));
@@ -2123,8 +1739,14 @@ static VALUE
rb_hash_to_h(VALUE hash)
{
if (rb_obj_class(hash) != rb_cHash) {
- const VALUE flags = RBASIC(hash)->flags;
- hash = hash_dup(hash, rb_cHash, flags & HASH_PROC_DEFAULT);
+ VALUE ret = rb_hash_new();
+ if (!RHASH_EMPTY_P(hash))
+ RHASH(ret)->ntbl = st_copy(RHASH(hash)->ntbl);
+ if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
+ FL_SET(ret, HASH_PROC_DEFAULT);
+ }
+ RHASH_SET_IFNONE(ret, RHASH_IFNONE(hash));
+ return ret;
}
return hash;
}
@@ -2162,7 +1784,7 @@ rb_hash_keys(VALUE hash)
rb_gc_writebarrier_remember(keys);
RARRAY_PTR_USE(keys, ptr, {
- size = st_keys(table, ptr, size);
+ size = st_keys_check(table, ptr, size, Qundef);
});
rb_ary_set_len(keys, size);
}
@@ -2206,7 +1828,7 @@ rb_hash_values(VALUE hash)
rb_gc_writebarrier_remember(values);
RARRAY_PTR_USE(values, ptr, {
- size = st_values(table, ptr, size);
+ size = st_values_check(table, ptr, size, Qundef);
});
rb_ary_set_len(values, size);
}
@@ -2230,13 +1852,9 @@ 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?
*/
-VALUE
+static VALUE
rb_hash_has_key(VALUE hash, VALUE key)
{
if (!RHASH(hash)->ntbl)
@@ -2268,8 +1886,8 @@ rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
* in <i>hsh</i>.
*
* h = { "a" => 100, "b" => 200 }
- * h.value?(100) #=> true
- * h.value?(999) #=> false
+ * h.has_value?(100) #=> true
+ * h.has_value?(999) #=> false
*/
static VALUE
@@ -2329,17 +1947,10 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
if (!rb_respond_to(hash2, idTo_hash)) {
return Qfalse;
}
- if (eql) {
- if (rb_eql(hash2, hash1)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
- }
- else {
+ if (eql)
+ return rb_eql(hash2, hash1);
+ else
return rb_equal(hash2, hash1);
- }
}
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
return Qfalse;
@@ -2375,12 +1986,6 @@ 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
@@ -2395,7 +2000,6 @@ 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
@@ -2418,7 +2022,7 @@ hash_i(VALUE key, VALUE val, VALUE arg)
/*
* call-seq:
- * hsh.hash -> integer
+ * hsh.hash -> fixnum
*
* 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>).
@@ -2436,7 +2040,7 @@ rb_hash_hash(VALUE hash)
rb_hash_foreach(hash, hash_i, (VALUE)&hval);
}
hval = rb_hash_end(hval);
- return ST2FIX(hval);
+ return INT2FIX(hval);
}
static int
@@ -2452,34 +2056,16 @@ 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"}
*
- * If there is no key with the same value, Hash#invert is involutive.
- *
- * h = { a: 1, b: 3, c: 4 }
- * h.invert.invert == h #=> true
- *
- * The condition, no key with the same value, can be tested by comparing
- * the size of inverted hash.
- *
- * # no key with the same value
- * h = { a: 1, b: 3, c: 4 }
- * h.size == h.invert.size #=> true
- *
- * # two (or more) keys has the same value
- * h = { a: 1, b: 3, c: 1 }
- * h.size == h.invert.size #=> false
- *
*/
static VALUE
rb_hash_invert(VALUE hash)
{
- VALUE h = rb_hash_new_with_size(RHASH_SIZE(hash));
+ VALUE h = rb_hash_new();
rb_hash_foreach(hash, rb_hash_invert_i, h);
return h;
@@ -2500,7 +2086,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)
@@ -2517,16 +2103,17 @@ rb_hash_update_block_callback(st_data_t *key, st_data_t *value, struct update_ar
if (existing) {
newvalue = rb_yield_values(3, (VALUE)*key, (VALUE)*value, newvalue);
arg->old_value = *value;
+ arg->new_value = newvalue;
}
else {
arg->new_key = *key;
+ arg->new_value = newvalue;
}
- arg->new_value = newvalue;
*value = newvalue;
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)
@@ -2551,13 +2138,11 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
* h1 = { "a" => 100, "b" => 200 }
* h2 = { "b" => 254, "c" => 300 }
* h1.merge!(h2) #=> {"a"=>100, "b"=>254, "c"=>300}
- * h1 #=> {"a"=>100, "b"=>254, "c"=>300}
*
* h1 = { "a" => 100, "b" => 200 }
* h2 = { "b" => 254, "c" => 300 }
* h1.merge!(h2) { |key, v1, v2| v1 }
* #=> {"a"=>100, "b"=>200, "c"=>300}
- * h1 #=> {"a"=>100, "b"=>200, "c"=>300}
*/
static VALUE
@@ -2589,16 +2174,17 @@ rb_hash_update_func_callback(st_data_t *key, st_data_t *value, struct update_arg
if (existing) {
newvalue = (*uf_arg->func)((VALUE)*key, (VALUE)*value, newvalue);
arg->old_value = *value;
+ arg->new_value = newvalue;
}
else {
arg->new_key = *key;
+ arg->new_value = newvalue;
}
- arg->new_value = newvalue;
*value = newvalue;
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)
@@ -2651,7 +2237,7 @@ rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func)
static VALUE
rb_hash_merge(VALUE hash1, VALUE hash2)
{
- return rb_hash_update(rb_hash_dup(hash1), hash2);
+ return rb_hash_update(rb_obj_dup(hash1), hash2);
}
static int
@@ -2808,24 +2394,18 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
{
VALUE ary;
- rb_check_arity(argc, 0, 1);
-
if (argc) {
- int level = NUM2INT(argv[0]);
-
+ 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);
- level--;
-
- if (level > 0) {
- VALUE ary_flatten_level = INT2FIX(level);
- rb_funcallv(ary, id_flatten_bang, 1, &ary_flatten_level);
+ if (level - 1 > 0) {
+ *argv = INT2FIX(level - 1);
+ rb_funcall2(ary, id_flatten_bang, argc, argv);
}
else if (level < 0) {
- /* flatten recursively */
- rb_funcallv(ary, id_flatten_bang, 0, 0);
+ rb_funcall2(ary, id_flatten_bang, 0, 0);
}
}
else {
@@ -2836,70 +2416,7 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
return ary;
}
-static int
-delete_if_nil(VALUE key, VALUE value, VALUE hash)
-{
- if (NIL_P(value)) {
- return ST_DELETE;
- }
- return ST_CONTINUE;
-}
-
-static int
-set_if_not_nil(VALUE key, VALUE value, VALUE hash)
-{
- if (!NIL_P(value)) {
- rb_hash_aset(hash, key, value);
- }
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * hsh.compact -> new_hash
- *
- * Returns a new hash with the nil values/key pairs removed
- *
- * h = { a: 1, b: false, c: nil }
- * h.compact #=> { a: 1, b: false }
- * h #=> { a: 1, b: false, c: nil }
- *
- */
-
-static VALUE
-rb_hash_compact(VALUE hash)
-{
- VALUE result = rb_hash_new();
- if (!RHASH_EMPTY_P(hash)) {
- rb_hash_foreach(hash, set_if_not_nil, result);
- }
- return result;
-}
-
-/*
- * call-seq:
- * hsh.compact! -> hsh or nil
- *
- * Removes all nil values from the hash.
- * Returns nil if no changes were made, otherwise returns the hash.
- *
- * h = { a: 1, b: false, c: nil }
- * h.compact! #=> { a: 1, b: false }
- *
- */
-
-static VALUE
-rb_hash_compact_bang(VALUE hash)
-{
- rb_hash_modify_check(hash);
- if (RHASH(hash)->ntbl) {
- st_index_t n = RHASH(hash)->ntbl->num_entries;
- rb_hash_foreach(hash, delete_if_nil, hash);
- if (n != RHASH(hash)->ntbl->num_entries)
- return hash;
- }
- return Qnil;
-}
+static VALUE rb_hash_compare_by_id_p(VALUE hash);
/*
* call-seq:
@@ -2920,16 +2437,10 @@ rb_hash_compact_bang(VALUE hash)
static VALUE
rb_hash_compare_by_id(VALUE hash)
{
- st_table *identtable;
if (rb_hash_compare_by_id_p(hash)) return hash;
- rb_hash_modify_check(hash);
-
- identtable = rb_init_identtable_with_size(RHASH_SIZE(hash));
- rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)identtable);
- if (RHASH(hash)->ntbl)
- st_free_table(RHASH(hash)->ntbl);
- RHASH(hash)->ntbl = identtable;
-
+ rb_hash_modify(hash);
+ RHASH(hash)->ntbl->type = &identhash;
+ rb_hash_rehash(hash);
return hash;
}
@@ -2942,7 +2453,7 @@ rb_hash_compare_by_id(VALUE hash)
*
*/
-VALUE
+static VALUE
rb_hash_compare_by_id_p(VALUE hash)
{
if (!RHASH(hash)->ntbl)
@@ -2953,26 +2464,6 @@ 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)
{
@@ -2995,17 +2486,6 @@ any_p_i_fast(VALUE key, VALUE value, VALUE arg)
return ST_CONTINUE;
}
-static int
-any_p_i_pattern(VALUE key, VALUE value, VALUE arg)
-{
- VALUE ret = rb_funcall(((VALUE *)arg)[1], idEqq, 1, rb_assoc_new(key, value));
- if (RTEST(ret)) {
- *(VALUE *)arg = Qtrue;
- return ST_STOP;
- }
- return ST_CONTINUE;
-}
-
/*
* call-seq:
* hsh.any? [{ |(key, value)| block }] -> true or false
@@ -3014,199 +2494,20 @@ any_p_i_pattern(VALUE key, VALUE value, VALUE arg)
*/
static VALUE
-rb_hash_any_p(int argc, VALUE *argv, VALUE hash)
+rb_hash_any_p(VALUE hash)
{
- VALUE args[2];
- args[0] = Qfalse;
+ VALUE ret = Qfalse;
- rb_check_arity(argc, 0, 1);
if (RHASH_EMPTY_P(hash)) return Qfalse;
- if (argc) {
- args[1] = argv[0];
-
- rb_hash_foreach(hash, any_p_i_pattern, (VALUE)args);
- }
- else {
- 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)args);
- else
- rb_hash_foreach(hash, any_p_i, (VALUE)args);
+ if (!rb_block_given_p()) {
+ /* yields pairs, never false */
+ return Qtrue;
}
- return args[0];
-}
-
-/*
- * 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: Integer 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
-add_new_i(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
-{
- VALUE *args = (VALUE *)arg;
- if (existing) return ST_STOP;
- RB_OBJ_WRITTEN(args[0], Qundef, (VALUE)*key);
- RB_OBJ_WRITE(args[0], (VALUE *)val, args[1]);
- return ST_CONTINUE;
-}
-
-/*
- * add +key+ to +val+ pair if +hash+ does not contain +key+.
- * returns non-zero if +key+ was contained.
- */
-int
-rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val)
-{
- st_table *tbl = rb_hash_tbl_raw(hash);
- VALUE args[2];
- args[0] = hash;
- args[1] = val;
- return st_update(tbl, (st_data_t)key, add_new_i, (st_data_t)args);
+ 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;
}
static int path_tainted = -1;
@@ -3219,21 +2520,17 @@ static char **my_environ;
#undef environ
#define environ my_environ
#undef getenv
-static char *(*w32_getenv)(const char*);
-static char *
-w32_getenv_unknown(const char *name)
+static inline char *
+w32_getenv(const char *name)
{
- char *(*func)(const char*);
- if (rb_locale_encindex() == rb_ascii8bit_encindex()) {
- func = rb_w32_getenv;
- }
- else {
- func = rb_w32_ugetenv;
+ static int binary = -1;
+ static int locale = -1;
+ if (binary < 0) {
+ binary = rb_ascii8bit_encindex();
+ locale = rb_locale_encindex();
}
- /* atomic assignment in flat memory model */
- return (w32_getenv = func)(name);
+ return locale == binary ? rb_w32_getenv(name) : rb_w32_ugetenv(name);
}
-static char *(*w32_getenv)(const char*) = w32_getenv_unknown;
#define getenv(n) w32_getenv(n)
#elif defined(__APPLE__)
#undef environ
@@ -3253,36 +2550,39 @@ extern char **environ;
#define ENVNMATCH(s1, s2, n) (memcmp((s1), (s2), (n)) == 0)
#endif
+#ifdef _WIN32
static VALUE
-env_enc_str_new(const char *ptr, long len, rb_encoding *enc)
+env_str_transcode(VALUE str, rb_encoding *enc)
+{
+ return rb_str_conv_enc_opts(str, rb_utf8_encoding(), enc,
+ ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE, Qnil);
+}
+#endif
+
+static VALUE
+env_str_new(const char *ptr, long len)
{
#ifdef _WIN32
- rb_encoding *internal = rb_default_internal_encoding();
- const int ecflags = ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE;
- rb_encoding *utf8 = rb_utf8_encoding();
- VALUE str = rb_enc_str_new(NULL, 0, (internal ? internal : enc));
- if (NIL_P(rb_str_cat_conv_enc_opts(str, 0, ptr, len, utf8, ecflags, Qnil))) {
- rb_str_initialize(str, ptr, len, NULL);
- }
+ VALUE str = env_str_transcode(rb_str_new(ptr, len), rb_locale_encoding());
#else
- VALUE str = rb_external_str_new_with_enc(ptr, len, enc);
+ VALUE str = rb_locale_str_new(ptr, len);
#endif
- OBJ_TAINT(str);
rb_obj_freeze(str);
return str;
}
static VALUE
-env_enc_str_new_cstr(const char *ptr, rb_encoding *enc)
+env_path_str_new(const char *ptr)
{
- return env_enc_str_new(ptr, strlen(ptr), enc);
-}
+#ifdef _WIN32
+ VALUE str = env_str_transcode(rb_str_new_cstr(ptr), rb_filesystem_encoding());
+#else
+ VALUE str = rb_filesystem_str_new_cstr(ptr);
+#endif
-static VALUE
-env_str_new(const char *ptr, long len)
-{
- return env_enc_str_new(ptr, len, rb_locale_encoding());
+ rb_obj_freeze(str);
+ return str;
}
static VALUE
@@ -3292,65 +2592,9 @@ env_str_new2(const char *ptr)
return env_str_new(ptr, strlen(ptr));
}
-static int env_path_tainted(const char *);
-
-static const char TZ_ENV[] = "TZ";
-extern int ruby_tz_update;
-
-static rb_encoding *
-env_encoding_for(const char *name, const char *ptr)
-{
- if (ENVMATCH(name, PATH_ENV) && !env_path_tainted(ptr)) {
- return rb_filesystem_encoding();
- }
- else {
- return rb_locale_encoding();
- }
-}
-
-static VALUE
-env_name_new(const char *name, const char *ptr)
-{
- return env_enc_str_new_cstr(ptr, env_encoding_for(name, 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 rb_str_fill_terminator(str, 1); /* ASCII compatible */
-}
-
-#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
+ (memchr((var = RSTRING_PTR(val)), '\0', RSTRING_LEN(val)) ? \
+ rb_raise(rb_eArgError, "bad environment variable " #var) : (void)0)
static inline const char *
env_name(volatile VALUE *s)
@@ -3375,12 +2619,8 @@ env_delete(VALUE obj, VALUE name)
ruby_setenv(nam, 0);
if (ENVMATCH(nam, PATH_ENV)) {
- RB_GC_GUARD(name);
path_tainted = 0;
}
- else if (ENVMATCH(nam, TZ_ENV)) {
- ruby_tz_update = 0;
- }
return value;
}
return Qnil;
@@ -3405,6 +2645,8 @@ env_delete_m(VALUE obj, VALUE name)
return val;
}
+static int env_path_tainted(const char *);
+
/*
* call-seq:
* ENV[name] -> value
@@ -3420,7 +2662,10 @@ rb_f_getenv(VALUE obj, VALUE name)
nam = env_name(name);
env = getenv(nam);
if (env) {
- return env_name_new(nam, env);
+ if (ENVMATCH(nam, PATH_ENV) && !env_path_tainted(env)) {
+ return env_path_str_new(env);
+ }
+ return env_str_new2(env);
}
return Qnil;
}
@@ -3435,7 +2680,7 @@ rb_f_getenv(VALUE obj, VALUE name)
* Retrieves the environment variable +name+.
*
* If the given name does not exist and neither +default+ nor a block a
- * provided an KeyError is raised. If a block is given it is called with
+ * provided an IndexError is raised. If a block is given it is called with
* the missing name to provide a value. If a default value is given it will
* be returned when no block is given.
*/
@@ -3457,11 +2702,13 @@ env_fetch(int argc, VALUE *argv)
if (!env) {
if (block_given) return rb_yield(key);
if (argc == 1) {
- rb_key_err_raise(rb_sprintf("key not found: \"%"PRIsVALUE"\"", key), envtbl, key);
+ rb_raise(rb_eKeyError, "key not found: \"%"PRIsVALUE"\"", key);
}
return argv[1];
}
- return env_name_new(nam, env);
+ if (ENVMATCH(nam, PATH_ENV) && !env_path_tainted(env))
+ return env_path_str_new(env);
+ return env_str_new2(env);
}
static void
@@ -3518,16 +2765,16 @@ envix(const char *nam)
#if defined(_WIN32)
static size_t
-getenvsize(const WCHAR* p)
+getenvsize(const char* p)
{
- const WCHAR* porg = p;
- while (*p++) p += lstrlenW(p) + 1;
+ const char* porg = p;
+ while (*p++) p += strlen(p) + 1;
return p - porg + 1;
}
static size_t
-getenvblocksize(void)
+getenvblocksize()
{
- return 32767;
+ return (rb_w32_osver() >= 5) ? 32767 : 5120;
}
#endif
@@ -3556,52 +2803,27 @@ 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) {
- WCHAR* p = GetEnvironmentStringsW();
+ char* p = GetEnvironmentStringsA();
size_t n;
- int len2;
if (!p) goto fail; /* never happen */
- n = lstrlen(name) + 2 + strlen(value) + getenvsize(p);
- FreeEnvironmentStringsW(p);
+ n = strlen(name) + 2 + strlen(value) + getenvsize(p);
+ FreeEnvironmentStringsA(p);
if (n >= getenvblocksize()) {
goto fail; /* 2 for '=' & '\0' */
}
- 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
+ buf = rb_sprintf("%s=%s", name, value);
}
else {
- 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
+ buf = rb_sprintf("%s=", name);
}
-#ifndef HAVE__WPUTENV_S
- failed = _wputenv(wname);
-#else
- failed = _wputenv_s(wname, wvalue);
-#endif
- ALLOCV_END(buf);
+ failed = putenv(RSTRING_PTR(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) &&
@@ -3612,6 +2834,8 @@ ruby_setenv(const char *name, const char *value)
invalid_envname(name);
}
#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV)
+#undef setenv
+#undef unsetenv
if (value) {
if (setenv(name, value, 1))
rb_sys_fail_str(rb_sprintf("setenv(%s)", name));
@@ -3709,7 +2933,6 @@ 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
@@ -3730,7 +2953,6 @@ env_aset(VALUE obj, VALUE nm, 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;
@@ -3740,9 +2962,6 @@ env_aset(VALUE obj, VALUE nm, VALUE val)
path_tainted_p(value);
}
}
- else if (ENVMATCH(name, TZ_ENV)) {
- ruby_tz_update = 0;
- }
return val;
}
@@ -3915,7 +3134,7 @@ env_each_pair(VALUE ehash)
static VALUE
env_reject_bang(VALUE ehash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
int del = 0;
@@ -3932,7 +3151,6 @@ env_reject_bang(VALUE ehash)
}
}
}
- RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
@@ -4002,7 +3220,6 @@ env_select(VALUE ehash)
}
}
}
- RB_GC_GUARD(keys);
return result;
}
@@ -4017,7 +3234,7 @@ env_select(VALUE ehash)
static VALUE
env_select_bang(VALUE ehash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
int del = 0;
@@ -4034,7 +3251,6 @@ env_select_bang(VALUE ehash)
}
}
}
- RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
@@ -4065,7 +3281,7 @@ env_keep_if(VALUE ehash)
VALUE
rb_env_clear(void)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
keys = env_keys();
@@ -4075,7 +3291,6 @@ rb_env_clear(void)
env_delete(Qnil, RARRAY_AREF(keys, i));
}
}
- RB_GC_GUARD(keys);
return envtbl;
}
@@ -4242,7 +3457,7 @@ env_assoc(VALUE env, VALUE key)
s = env_name(key);
e = getenv(s);
- if (e) return rb_assoc_new(key, env_str_new2(e));
+ if (e) return rb_assoc_new(key, rb_tainted_str_new2(e));
return Qnil;
}
@@ -4455,7 +3670,7 @@ env_replace_i(VALUE key, VALUE val, VALUE keys)
static VALUE
env_replace(VALUE env, VALUE hash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
keys = env_keys();
@@ -4466,7 +3681,6 @@ 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;
}
@@ -4512,7 +3726,7 @@ env_update(VALUE env, VALUE hash)
*
* grades = { "Jane Doe" => 10, "Jim Doe" => 6 }
*
- * Hashes allow an alternate syntax for keys that are symbols.
+ * Hashes allow an alternate syntax form when your keys are always symbols.
* Instead of
*
* options = { :font_size => 10, :font_family => "Arial" }
@@ -4550,7 +3764,7 @@ env_update(VALUE env, VALUE hash)
* Hashes are an easy way to represent data structures, such as
*
* books = {}
- * books[:matz] = "The Ruby Programming Language"
+ * books[:matz] = "The Ruby Language"
* books[:black] = "The Well-Grounded Rubyist"
*
* Hashes are also commonly used as a way to have named parameters in
@@ -4630,87 +3844,71 @@ Init_Hash(void)
rb_define_alloc_func(rb_cHash, empty_hash_alloc);
rb_define_singleton_method(rb_cHash, "[]", rb_hash_s_create, -1);
rb_define_singleton_method(rb_cHash, "try_convert", rb_hash_s_try_convert, 1);
- rb_define_method(rb_cHash, "initialize", rb_hash_initialize, -1);
- rb_define_method(rb_cHash, "initialize_copy", rb_hash_initialize_copy, 1);
- rb_define_method(rb_cHash, "rehash", rb_hash_rehash, 0);
-
- rb_define_method(rb_cHash, "to_hash", rb_hash_to_hash, 0);
- rb_define_method(rb_cHash, "to_h", rb_hash_to_h, 0);
- rb_define_method(rb_cHash, "to_a", rb_hash_to_a, 0);
- rb_define_method(rb_cHash, "inspect", rb_hash_inspect, 0);
+ rb_define_method(rb_cHash,"initialize", rb_hash_initialize, -1);
+ rb_define_method(rb_cHash,"initialize_copy", rb_hash_initialize_copy, 1);
+ rb_define_method(rb_cHash,"rehash", rb_hash_rehash, 0);
+
+ rb_define_method(rb_cHash,"to_hash", rb_hash_to_hash, 0);
+ rb_define_method(rb_cHash,"to_h", rb_hash_to_h, 0);
+ rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
+ rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
rb_define_alias(rb_cHash, "to_s", "inspect");
- 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);
- rb_define_method(rb_cHash, "hash", rb_hash_hash, 0);
- rb_define_method(rb_cHash, "eql?", rb_hash_eql, 1);
- rb_define_method(rb_cHash, "fetch", rb_hash_fetch_m, -1);
- rb_define_method(rb_cHash, "[]=", rb_hash_aset, 2);
- rb_define_method(rb_cHash, "store", rb_hash_aset, 2);
- rb_define_method(rb_cHash, "default", rb_hash_default, -1);
- rb_define_method(rb_cHash, "default=", rb_hash_set_default, 1);
- rb_define_method(rb_cHash, "default_proc", rb_hash_default_proc, 0);
- rb_define_method(rb_cHash, "default_proc=", rb_hash_set_default_proc, 1);
- rb_define_method(rb_cHash, "key", rb_hash_key, 1);
- rb_define_method(rb_cHash, "index", rb_hash_index, 1);
- rb_define_method(rb_cHash, "size", rb_hash_size, 0);
- rb_define_method(rb_cHash, "length", rb_hash_size, 0);
- rb_define_method(rb_cHash, "empty?", rb_hash_empty_p, 0);
-
- rb_define_method(rb_cHash, "each_value", rb_hash_each_value, 0);
- rb_define_method(rb_cHash, "each_key", rb_hash_each_key, 0);
- rb_define_method(rb_cHash, "each_pair", rb_hash_each_pair, 0);
- rb_define_method(rb_cHash, "each", rb_hash_each_pair, 0);
-
- rb_define_method(rb_cHash, "transform_keys", rb_hash_transform_keys, 0);
- rb_define_method(rb_cHash, "transform_keys!", rb_hash_transform_keys_bang, 0);
- rb_define_method(rb_cHash, "transform_values", rb_hash_transform_values, 0);
- rb_define_method(rb_cHash, "transform_values!", rb_hash_transform_values_bang, 0);
-
- 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_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);
- rb_define_method(rb_cHash, "select!", rb_hash_select_bang, 0);
- rb_define_method(rb_cHash, "reject", rb_hash_reject, 0);
- rb_define_method(rb_cHash, "reject!", rb_hash_reject_bang, 0);
- rb_define_method(rb_cHash, "slice", rb_hash_slice, -1);
- rb_define_method(rb_cHash, "clear", rb_hash_clear, 0);
- rb_define_method(rb_cHash, "invert", rb_hash_invert, 0);
- rb_define_method(rb_cHash, "update", rb_hash_update, 1);
- rb_define_method(rb_cHash, "replace", rb_hash_replace, 1);
- rb_define_method(rb_cHash, "merge!", rb_hash_update, 1);
- rb_define_method(rb_cHash, "merge", rb_hash_merge, 1);
+
+ rb_define_method(rb_cHash,"==", rb_hash_equal, 1);
+ rb_define_method(rb_cHash,"[]", rb_hash_aref, 1);
+ rb_define_method(rb_cHash,"hash", rb_hash_hash, 0);
+ rb_define_method(rb_cHash,"eql?", rb_hash_eql, 1);
+ rb_define_method(rb_cHash,"fetch", rb_hash_fetch_m, -1);
+ rb_define_method(rb_cHash,"[]=", rb_hash_aset, 2);
+ rb_define_method(rb_cHash,"store", rb_hash_aset, 2);
+ rb_define_method(rb_cHash,"default", rb_hash_default, -1);
+ rb_define_method(rb_cHash,"default=", rb_hash_set_default, 1);
+ rb_define_method(rb_cHash,"default_proc", rb_hash_default_proc, 0);
+ rb_define_method(rb_cHash,"default_proc=", rb_hash_set_default_proc, 1);
+ rb_define_method(rb_cHash,"key", rb_hash_key, 1);
+ rb_define_method(rb_cHash,"index", rb_hash_index, 1);
+ rb_define_method(rb_cHash,"size", rb_hash_size, 0);
+ rb_define_method(rb_cHash,"length", rb_hash_size, 0);
+ rb_define_method(rb_cHash,"empty?", rb_hash_empty_p, 0);
+
+ rb_define_method(rb_cHash,"each_value", rb_hash_each_value, 0);
+ rb_define_method(rb_cHash,"each_key", rb_hash_each_key, 0);
+ rb_define_method(rb_cHash,"each_pair", rb_hash_each_pair, 0);
+ rb_define_method(rb_cHash,"each", rb_hash_each_pair, 0);
+
+ 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,"shift", rb_hash_shift, 0);
+ rb_define_method(rb_cHash,"delete", rb_hash_delete, 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);
+ rb_define_method(rb_cHash,"select!", rb_hash_select_bang, 0);
+ rb_define_method(rb_cHash,"reject", rb_hash_reject, 0);
+ rb_define_method(rb_cHash,"reject!", rb_hash_reject_bang, 0);
+ rb_define_method(rb_cHash,"clear", rb_hash_clear, 0);
+ rb_define_method(rb_cHash,"invert", rb_hash_invert, 0);
+ rb_define_method(rb_cHash,"update", rb_hash_update, 1);
+ rb_define_method(rb_cHash,"replace", rb_hash_replace, 1);
+ rb_define_method(rb_cHash,"merge!", rb_hash_update, 1);
+ rb_define_method(rb_cHash,"merge", rb_hash_merge, 1);
rb_define_method(rb_cHash, "assoc", rb_hash_assoc, 1);
rb_define_method(rb_cHash, "rassoc", rb_hash_rassoc, 1);
rb_define_method(rb_cHash, "flatten", rb_hash_flatten, -1);
- rb_define_method(rb_cHash, "compact", rb_hash_compact, 0);
- rb_define_method(rb_cHash, "compact!", rb_hash_compact_bang, 0);
-
- rb_define_method(rb_cHash, "include?", rb_hash_has_key, 1);
- rb_define_method(rb_cHash, "member?", rb_hash_has_key, 1);
- rb_define_method(rb_cHash, "has_key?", rb_hash_has_key, 1);
- rb_define_method(rb_cHash, "has_value?", rb_hash_has_value, 1);
- rb_define_method(rb_cHash, "key?", rb_hash_has_key, 1);
- rb_define_method(rb_cHash, "value?", rb_hash_has_value, 1);
- 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,"include?", rb_hash_has_key, 1);
+ rb_define_method(rb_cHash,"member?", rb_hash_has_key, 1);
+ rb_define_method(rb_cHash,"has_key?", rb_hash_has_key, 1);
+ rb_define_method(rb_cHash,"has_value?", rb_hash_has_value, 1);
+ rb_define_method(rb_cHash,"key?", rb_hash_has_key, 1);
+ rb_define_method(rb_cHash,"value?", rb_hash_has_value, 1);
- rb_define_method(rb_cHash, "any?", rb_hash_any_p, -1);
- rb_define_method(rb_cHash, "dig", rb_hash_dig, -1);
+ 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, "<=", 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);
+ rb_define_method(rb_cHash, "any?", rb_hash_any_p, 0);
/* Document-class: ENV
*
@@ -4725,48 +3923,48 @@ Init_Hash(void)
envtbl = rb_obj_alloc(rb_cObject);
rb_extend_object(envtbl, rb_mEnumerable);
- rb_define_singleton_method(envtbl, "[]", rb_f_getenv, 1);
- rb_define_singleton_method(envtbl, "fetch", env_fetch, -1);
- rb_define_singleton_method(envtbl, "[]=", env_aset, 2);
- rb_define_singleton_method(envtbl, "store", env_aset, 2);
- rb_define_singleton_method(envtbl, "each", env_each_pair, 0);
- rb_define_singleton_method(envtbl, "each_pair", env_each_pair, 0);
- rb_define_singleton_method(envtbl, "each_key", env_each_key, 0);
- rb_define_singleton_method(envtbl, "each_value", env_each_value, 0);
- rb_define_singleton_method(envtbl, "delete", env_delete_m, 1);
- rb_define_singleton_method(envtbl, "delete_if", env_delete_if, 0);
- rb_define_singleton_method(envtbl, "keep_if", env_keep_if, 0);
- rb_define_singleton_method(envtbl, "clear", rb_env_clear, 0);
- rb_define_singleton_method(envtbl, "reject", env_reject, 0);
- rb_define_singleton_method(envtbl, "reject!", env_reject_bang, 0);
- rb_define_singleton_method(envtbl, "select", env_select, 0);
- rb_define_singleton_method(envtbl, "select!", env_select_bang, 0);
- rb_define_singleton_method(envtbl, "shift", env_shift, 0);
- rb_define_singleton_method(envtbl, "invert", env_invert, 0);
- rb_define_singleton_method(envtbl, "replace", env_replace, 1);
- rb_define_singleton_method(envtbl, "update", env_update, 1);
- rb_define_singleton_method(envtbl, "inspect", env_inspect, 0);
- rb_define_singleton_method(envtbl, "rehash", env_none, 0);
- rb_define_singleton_method(envtbl, "to_a", env_to_a, 0);
- rb_define_singleton_method(envtbl, "to_s", env_to_s, 0);
- rb_define_singleton_method(envtbl, "key", env_key, 1);
- rb_define_singleton_method(envtbl, "index", env_index, 1);
- rb_define_singleton_method(envtbl, "size", env_size, 0);
- rb_define_singleton_method(envtbl, "length", env_size, 0);
- rb_define_singleton_method(envtbl, "empty?", env_empty_p, 0);
- rb_define_singleton_method(envtbl, "keys", env_keys, 0);
- rb_define_singleton_method(envtbl, "values", env_values, 0);
- rb_define_singleton_method(envtbl, "values_at", env_values_at, -1);
- rb_define_singleton_method(envtbl, "include?", env_has_key, 1);
- rb_define_singleton_method(envtbl, "member?", env_has_key, 1);
- rb_define_singleton_method(envtbl, "has_key?", env_has_key, 1);
- rb_define_singleton_method(envtbl, "has_value?", env_has_value, 1);
- rb_define_singleton_method(envtbl, "key?", env_has_key, 1);
- rb_define_singleton_method(envtbl, "value?", env_has_value, 1);
- rb_define_singleton_method(envtbl, "to_hash", env_to_hash, 0);
- rb_define_singleton_method(envtbl, "to_h", env_to_hash, 0);
- rb_define_singleton_method(envtbl, "assoc", env_assoc, 1);
- rb_define_singleton_method(envtbl, "rassoc", env_rassoc, 1);
+ rb_define_singleton_method(envtbl,"[]", rb_f_getenv, 1);
+ rb_define_singleton_method(envtbl,"fetch", env_fetch, -1);
+ rb_define_singleton_method(envtbl,"[]=", env_aset, 2);
+ rb_define_singleton_method(envtbl,"store", env_aset, 2);
+ rb_define_singleton_method(envtbl,"each", env_each_pair, 0);
+ rb_define_singleton_method(envtbl,"each_pair", env_each_pair, 0);
+ rb_define_singleton_method(envtbl,"each_key", env_each_key, 0);
+ rb_define_singleton_method(envtbl,"each_value", env_each_value, 0);
+ rb_define_singleton_method(envtbl,"delete", env_delete_m, 1);
+ rb_define_singleton_method(envtbl,"delete_if", env_delete_if, 0);
+ rb_define_singleton_method(envtbl,"keep_if", env_keep_if, 0);
+ rb_define_singleton_method(envtbl,"clear", rb_env_clear, 0);
+ rb_define_singleton_method(envtbl,"reject", env_reject, 0);
+ rb_define_singleton_method(envtbl,"reject!", env_reject_bang, 0);
+ rb_define_singleton_method(envtbl,"select", env_select, 0);
+ rb_define_singleton_method(envtbl,"select!", env_select_bang, 0);
+ rb_define_singleton_method(envtbl,"shift", env_shift, 0);
+ rb_define_singleton_method(envtbl,"invert", env_invert, 0);
+ rb_define_singleton_method(envtbl,"replace", env_replace, 1);
+ rb_define_singleton_method(envtbl,"update", env_update, 1);
+ rb_define_singleton_method(envtbl,"inspect", env_inspect, 0);
+ rb_define_singleton_method(envtbl,"rehash", env_none, 0);
+ rb_define_singleton_method(envtbl,"to_a", env_to_a, 0);
+ rb_define_singleton_method(envtbl,"to_s", env_to_s, 0);
+ rb_define_singleton_method(envtbl,"key", env_key, 1);
+ rb_define_singleton_method(envtbl,"index", env_index, 1);
+ rb_define_singleton_method(envtbl,"size", env_size, 0);
+ rb_define_singleton_method(envtbl,"length", env_size, 0);
+ rb_define_singleton_method(envtbl,"empty?", env_empty_p, 0);
+ rb_define_singleton_method(envtbl,"keys", env_keys, 0);
+ rb_define_singleton_method(envtbl,"values", env_values, 0);
+ rb_define_singleton_method(envtbl,"values_at", env_values_at, -1);
+ rb_define_singleton_method(envtbl,"include?", env_has_key, 1);
+ rb_define_singleton_method(envtbl,"member?", env_has_key, 1);
+ rb_define_singleton_method(envtbl,"has_key?", env_has_key, 1);
+ rb_define_singleton_method(envtbl,"has_value?", env_has_value, 1);
+ rb_define_singleton_method(envtbl,"key?", env_has_key, 1);
+ rb_define_singleton_method(envtbl,"value?", env_has_value, 1);
+ rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0);
+ rb_define_singleton_method(envtbl,"to_h", env_to_hash, 0);
+ rb_define_singleton_method(envtbl,"assoc", env_assoc, 1);
+ rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1);
/*
* ENV is a Hash-like accessor for environment variables.
diff --git a/id_table.c b/id_table.c
deleted file mode 100644
index 74c9e756a0..0000000000
--- a/id_table.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* 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 "ruby_assert.h"
-
-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);
-}
-
-/* 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 rb_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 rb_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 rb_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 rb_id_table *
-rb_id_table_init(struct rb_id_table *tbl, int capa)
-{
- MEMZERO(tbl, struct rb_id_table, 1);
- if (capa > 0) {
- capa = round_capa(capa);
- tbl->capa = (int)capa;
- tbl->items = ZALLOC_N(item_t, capa);
- }
- return tbl;
-}
-
-struct rb_id_table *
-rb_id_table_create(size_t capa)
-{
- struct rb_id_table *tbl = ALLOC(struct rb_id_table);
- return rb_id_table_init(tbl, (int)capa);
-}
-
-void
-rb_id_table_free(struct rb_id_table *tbl)
-{
- xfree(tbl->items);
- xfree(tbl);
-}
-
-void
-rb_id_table_clear(struct rb_id_table *tbl)
-{
- tbl->num = 0;
- tbl->used = 0;
- MEMZERO(tbl->items, item_t, tbl->capa);
-}
-
-size_t
-rb_id_table_size(const struct rb_id_table *tbl)
-{
- return (size_t)tbl->num;
-}
-
-size_t
-rb_id_table_memsize(const struct rb_id_table *tbl)
-{
- return sizeof(item_t) * tbl->capa + sizeof(struct rb_id_table);
-}
-
-static int
-hash_table_index(struct rb_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 rb_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 rb_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 rb_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 rb_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 rb_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
-
-int
-rb_id_table_lookup(struct rb_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
-rb_id_table_insert_key(struct rb_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;
-}
-
-int
-rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val)
-{
- return rb_id_table_insert_key(tbl, id2key(id), val);
-}
-
-int
-rb_id_table_delete(struct rb_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);
-}
-
-void
-rb_id_table_foreach(struct rb_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;
- }
- }
-}
-
-void
-rb_id_table_foreach_values(struct rb_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;
- }
- }
-}
diff --git a/id_table.h b/id_table.h
deleted file mode 100644
index b10b4ac164..0000000000
--- a/id_table.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#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,
- ID_TABLE_ITERATOR_RESULT_END
-};
-
-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.h b/include/ruby/backward.h
deleted file mode 100644
index 76bd162cb2..0000000000
--- a/include/ruby/backward.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef RUBY_RUBY_BACKWARD_H
-#define RUBY_RUBY_BACKWARD_H 1
-
-#define RClass RClassDeprecated
-#ifndef __cplusplus
-DEPRECATED_TYPE(("RClass is internal use only"),
-struct RClass {
- struct RBasic basic;
-});
-#endif
-
-#define DECLARE_DEPRECATED_FEATURE(ver, func) \
- NORETURN(ERRORFUNC(("deprecated since "#ver), DEPRECATED(void func(void))))
-
-/* complex.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_complex_set_real);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_complex_set_imag);
-
-/* eval.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_disable_super);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_enable_super);
-
-/* hash.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_iter_lev);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_ifnone);
-
-/* string.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associate);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associated);
-
-/* variable.c */
-DEPRECATED(void rb_autoload(VALUE, ID, const char*));
-
-/* vm.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_clear_cache);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_frame_pop);
-
-#define DECLARE_DEPRECATED_INTERNAL_FEATURE(func) \
- NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
-
-/* error.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error);
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_with_enc);
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_append);
-
-/* struct.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
-
-/* variable.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
-
-/* vm.c */
-DEPRECATED(int rb_frame_method_id_and_class(ID *idp, VALUE *klassp));
-
-/* from version.c */
-#ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
-# define RUBY_SHOW_COPYRIGHT_TO_DIE 1
-#endif
-#if RUBY_SHOW_COPYRIGHT_TO_DIE
-/* for source code backward compatibility */
-DEPRECATED(static inline int ruby_show_copyright_to_die(int));
-static inline int
-ruby_show_copyright_to_die(int exitcode)
-{
- ruby_show_copyright();
- return exitcode;
-}
-#define ruby_show_copyright() /* defer EXIT_SUCCESS */ \
- (exit(ruby_show_copyright_to_die(EXIT_SUCCESS)))
-#endif
-
-#endif /* RUBY_RUBY_BACKWARD_H */
diff --git a/include/ruby/backward/classext.h b/include/ruby/backward/classext.h
index 9d5747316a..33f3b014b8 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
+#elif defined _MSC_VER || defined __BORLANDC__
#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 a6e3a7c78b..d5246db546 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
+#elif defined _MSC_VER || defined __BORLANDC__
#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 58b13cab1c..ade4fe27bd 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
+#elif defined _MSC_VER || defined __BORLANDC__
#pragma message("warning: rubysig.h is obsolete")
#endif
diff --git a/include/ruby/backward/st.h b/include/ruby/backward/st.h
index 3e36d44cf8..514128e616 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
+#elif defined _MSC_VER || defined __BORLANDC__
#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 11d32a2da8..6b47940ddc 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
+#elif defined _MSC_VER || defined __BORLANDC__
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
#endif
#include "ruby/util.h"
diff --git a/include/ruby/debug.h b/include/ruby/debug.h
index 0456c73b9c..9bfc9b9a83 100644
--- a/include/ruby/debug.h
+++ b/include/ruby/debug.h
@@ -75,7 +75,6 @@ VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
-VALUE rb_tracearg_callee_id(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 2c72a7cb8a..f83ced006c 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -22,92 +22,6 @@ extern "C" {
#include RUBY_EXTCONF_H
#endif
-/* function attributes */
-#ifndef CONSTFUNC
-# define CONSTFUNC(x) x
-#endif
-#ifndef PUREFUNC
-# define PUREFUNC(x) x
-#endif
-#define NORETURN_STYLE_NEW 1
-#ifndef NORETURN
-# define NORETURN(x) x
-#endif
-#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 ALWAYS_INLINE
-# define ALWAYS_INLINE(x) x
-#endif
-#ifndef ERRORFUNC
-# define HAVE_ATTRIBUTE_ERRORFUNC 0
-# define ERRORFUNC(mesg, x) x
-#else
-# define HAVE_ATTRIBUTE_ERRORFUNC 1
-#endif
-#ifndef WARNINGFUNC
-# define HAVE_ATTRIBUTE_WARNINGFUNC 0
-# define WARNINGFUNC(mesg, x) x
-#else
-# define HAVE_ATTRIBUTE_WARNINGFUNC 1
-#endif
-
-#ifndef GCC_VERSION_SINCE
-# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
-# define GCC_VERSION_SINCE(major, minor, patchlevel) \
- ((__GNUC__ > (major)) || \
- ((__GNUC__ == (major) && \
- ((__GNUC_MINOR__ > (minor)) || \
- (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))))
-# else
-# define GCC_VERSION_SINCE(major, minor, patchlevel) 0
-# endif
-#endif
-#ifndef GCC_VERSION_BEFORE
-# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
-# define GCC_VERSION_BEFORE(major, minor, patchlevel) \
- ((__GNUC__ < (major)) || \
- ((__GNUC__ == (major) && \
- ((__GNUC_MINOR__ < (minor)) || \
- (__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ <= (patchlevel))))))
-# else
-# define GCC_VERSION_BEFORE(major, minor, patchlevel) 0
-# endif
-#endif
-
-/* likely */
-#if __GNUC__ >= 3
-#define RB_LIKELY(x) (__builtin_expect(!!(x), 1))
-#define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))
-#else /* __GNUC__ >= 3 */
-#define RB_LIKELY(x) (x)
-#define RB_UNLIKELY(x) (x)
-#endif /* __GNUC__ >= 3 */
-
-#ifdef __GNUC__
-#define PRINTF_ARGS(decl, string_index, first_to_check) \
- decl __attribute__((format(printf, string_index, first_to_check)))
-#else
-#define PRINTF_ARGS(decl, string_index, first_to_check) decl
-#endif
-
-#ifdef __GNUC__
-#define RB_GNUC_EXTENSION __extension__
-#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
-#else
-#define RB_GNUC_EXTENSION
-#define RB_GNUC_EXTENSION_BLOCK(x) (x)
-#endif
-
/* AC_INCLUDES_DEFAULT */
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
@@ -147,7 +61,7 @@ extern "C" {
# include <sys/select.h>
#endif
-#ifdef RUBY_USE_SETJMPEX
+#if defined HAVE_SETJMPEX_H && defined HAVE__SETJMPEX
#include <setjmpex.h>
#endif
@@ -198,8 +112,8 @@ RUBY_SYMBOL_EXPORT_BEGIN
#define xrealloc2 ruby_xrealloc2
#define xfree ruby_xfree
-#if GCC_VERSION_SINCE(4,3,0)
-# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((alloc_size params))
+#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
+# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((__alloc_size__ params))
#else
# define RUBY_ATTR_ALLOC_SIZE(params)
#endif
@@ -233,12 +147,7 @@ void xfree(void*);
#undef _WIN32
#endif
-#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.
- */
+#if defined(_WIN32) || defined(__EMX__)
#define DOSISH 1
# define DOSISH_DRIVE_LETTER
#endif
@@ -254,6 +163,10 @@ 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 RUBY_EXPORT
#undef RUBY_EXTERN
@@ -279,16 +192,7 @@ void xfree(void*);
#endif
#ifndef EXTERN
-# if defined __GNUC__
-# define EXTERN _Pragma("message \"EXTERN is deprecated, use RUBY_EXTERN instead\""); \
- RUBY_EXTERN
-# elif defined _MSC_VER
-# define EXTERN __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: "\
- "EXTERN is deprecated, use RUBY_EXTERN instead")); \
- RUBY_EXTERN
-# else
-# define EXTERN <-<-"EXTERN is deprecated, use RUBY_EXTERN instead"->->
-# endif
+#define EXTERN RUBY_EXTERN /* deprecated */
#endif
#ifndef RUBY_MBCHAR_MAXSIZE
@@ -316,7 +220,7 @@ void rb_ia64_flushrs(void);
#define PATH_ENV "PATH"
-#if defined(DOSISH)
+#if defined(DOSISH) && !defined(__EMX__)
#define ENV_IGNORECASE
#endif
@@ -339,16 +243,13 @@ void rb_ia64_flushrs(void);
#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) \
- FUNC_MINIMIZED(type prot) {return (type)name args;}
+ FUNC_MINIMIZED(type prot) {return name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION_VOID
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \
- FUNC_MINIMIZED(void prot) {name args;}
+ void prot {name args;}
#endif
#ifndef RUBY_ALIAS_FUNCTION
#define RUBY_ALIAS_FUNCTION(prot, name, args) \
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index e6ceb19cdf..4a5324d62e 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -20,102 +20,62 @@ extern "C" {
#endif
#include <stdarg.h>
-#include "ruby/ruby.h"
#include "ruby/oniguruma.h"
RUBY_SYMBOL_EXPORT_BEGIN
-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;\
+#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;\
} while (0)
-#define RB_ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
+#define ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
-#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) : \
+#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) : \
rb_enc_get_index(obj))
-#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)
-};
-
-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)
+#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0)
+
+#define ENCODING_MAXNAMELEN 42
+
+#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)
/* assumed ASCII compatibility */
-#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 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_ENCODING_CODERANGE_SET(obj, encindex, cr) \
+#define ENCODING_CODERANGE_SET(obj, encindex, cr) \
do { \
VALUE rb_encoding_coderange_obj = (obj); \
- RB_ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
- RB_ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
+ ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
+ ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
} while (0)
-#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 *);
-PUREFUNC(int rb_enc_dummy_p(rb_encoding *enc));
-PUREFUNC(int rb_enc_to_index(rb_encoding *enc));
+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);
@@ -131,7 +91,6 @@ 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);
@@ -146,17 +105,13 @@ VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
-#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-#define rb_enc_str_new(str, len, enc) RB_GNUC_EXTENSION_BLOCK( \
- (__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) RB_GNUC_EXTENSION_BLOCK( \
+#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_enc_str_new_cstr(str, enc) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
- rb_enc_str_new_static((str), (long)strlen(str), (enc)) : \
- rb_enc_str_new_cstr((str), (enc)) \
-)
+ rb_enc_str_new((str), (long)strlen(str), (enc)) : \
+ rb_enc_str_new_cstr((str), (enc)); \
+})
#endif
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
@@ -231,16 +186,11 @@ int rb_enc_code_to_mbclen(int code, rb_encoding *enc);
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
-static inline int
-rb_enc_asciicompat_inline(rb_encoding *enc)
-{
- return rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc);
-}
-#define rb_enc_asciicompat(enc) rb_enc_asciicompat_inline(enc)
+#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
-CONSTFUNC(int rb_enc_toupper(int c, rb_encoding *enc));
-CONSTFUNC(int rb_enc_tolower(int c, rb_encoding *enc));
+int rb_enc_toupper(int c, rb_encoding *enc);
+int rb_enc_tolower(int c, rb_encoding *enc);
ID rb_intern3(const char*, long, rb_encoding*);
ID rb_interned_id_p(const char *, long, rb_encoding *);
int rb_enc_symname_p(const char*, rb_encoding*);
@@ -250,7 +200,7 @@ long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, i
int rb_enc_str_asciionly_p(VALUE);
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
VALUE rb_enc_from_encoding(rb_encoding *enc);
-PUREFUNC(int rb_enc_unicode_p(rb_encoding *enc));
+int rb_enc_unicode_p(rb_encoding *enc);
rb_encoding *rb_ascii8bit_encoding(void);
rb_encoding *rb_utf8_encoding(void);
rb_encoding *rb_usascii_encoding(void);
@@ -259,13 +209,13 @@ rb_encoding *rb_filesystem_encoding(void);
rb_encoding *rb_default_external_encoding(void);
rb_encoding *rb_default_internal_encoding(void);
#ifndef rb_ascii8bit_encindex
-CONSTFUNC(int rb_ascii8bit_encindex(void));
+int rb_ascii8bit_encindex(void);
#endif
#ifndef rb_utf8_encindex
-CONSTFUNC(int rb_utf8_encindex(void));
+int rb_utf8_encindex(void);
#endif
#ifndef rb_usascii_encindex
-CONSTFUNC(int rb_usascii_encindex(void));
+int rb_usascii_encindex(void);
#endif
int rb_locale_encindex(void);
int rb_filesystem_encindex(void);
@@ -352,64 +302,43 @@ 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,
- RUBY_ECONV_INVALID_MASK = 0x0000000f,
- RUBY_ECONV_INVALID_REPLACE = 0x00000002,
+#define ECONV_ERROR_HANDLER_MASK 0x000000ff
+
+#define ECONV_INVALID_MASK 0x0000000f
+#define ECONV_INVALID_REPLACE 0x00000002
- RUBY_ECONV_UNDEF_MASK = 0x000000f0,
- RUBY_ECONV_UNDEF_REPLACE = 0x00000020,
- RUBY_ECONV_UNDEF_HEX_CHARREF = 0x00000030,
+#define ECONV_UNDEF_MASK 0x000000f0
+#define ECONV_UNDEF_REPLACE 0x00000020
+#define ECONV_UNDEF_HEX_CHARREF 0x00000030
- 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_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_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_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_STATEFUL_DECORATOR_MASK = 0x00f00000,
- RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR = 0x00100000,
+#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000
+#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000
- RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR =
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
- RUBY_ECONV_CRLF_NEWLINE_DECORATOR,
+#define ECONV_DEFAULT_NEWLINE_DECORATOR ECONV_CRLF_NEWLINE_DECORATOR
#else
- 0,
+#define ECONV_DEFAULT_NEWLINE_DECORATOR 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 */
- 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
+#define ECONV_PARTIAL_INPUT 0x00010000
+#define ECONV_AFTER_OUTPUT 0x00020000
/* 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 a711b86115..f9858537e1 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -183,17 +183,23 @@ 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);
VALUE rb_mod_init_copy(VALUE, VALUE);
VALUE rb_singleton_class_clone(VALUE);
void rb_singleton_class_attached(VALUE,VALUE);
+VALUE rb_make_metaclass(VALUE, VALUE);
void rb_check_inheritable(VALUE);
+VALUE rb_class_inherited(VALUE, VALUE);
VALUE rb_define_class_id(ID, VALUE);
VALUE rb_define_class_id_under(VALUE, ID, VALUE);
VALUE rb_module_new(void);
VALUE rb_define_module_id(ID);
VALUE rb_define_module_id_under(VALUE, ID);
+VALUE rb_include_class_new(VALUE, VALUE);
VALUE rb_mod_included_modules(VALUE);
VALUE rb_mod_include_p(VALUE, VALUE);
VALUE rb_mod_ancestors(VALUE);
@@ -228,12 +234,10 @@ VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, const VALUE *, rb_enumerator
#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 SIZED_ENUMERATOR(obj, argc, argv, size_fn); \
+ return rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()),\
+ (argc), (argv), (size_fn)); \
} while (0)
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
/* error.c */
@@ -247,15 +251,17 @@ 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);
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_object(frozen_obj); \
+ rb_error_frozen(rb_obj_classname(frozen_obj)); \
} \
} while (0)
#define rb_check_trusted_internal(obj) ((void) 0)
@@ -278,9 +284,8 @@ rb_check_trusted_inline(VALUE obj)
#endif
void rb_check_copyable(VALUE obj, VALUE orig);
-#define RB_OBJ_INIT_COPY(obj, orig) \
+#define 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);
@@ -288,14 +293,13 @@ const char *rb_sourcefile(void);
VALUE rb_check_funcall(VALUE, ID, int, const VALUE*);
NORETURN(void rb_error_arity(int, int, int));
-static inline int
+#define rb_check_arity rb_check_arity /* for ifdef */
+static inline void
rb_check_arity(int argc, int min, int max)
{
if ((argc < min) || (max != UNLIMITED_ARGUMENTS && argc > max))
rb_error_arity(argc, min, max);
- return argc;
}
-#define rb_check_arity rb_check_arity /* for ifdef */
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
typedef struct {
@@ -311,8 +315,6 @@ 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)
@@ -362,15 +364,18 @@ typedef fd_set rb_fdset_t;
NORETURN(void rb_exc_raise(VALUE));
NORETURN(void rb_exc_fatal(VALUE));
-NORETURN(VALUE rb_f_exit(int, const VALUE*));
-NORETURN(VALUE rb_f_abort(int, const 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)
#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);
void rb_clear_constant_cache(void);
void rb_clear_method_cache_by_class(VALUE);
void rb_alias(VALUE, ID, ID);
@@ -380,12 +385,8 @@ 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);
-NORETURN(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
-NORETURN(void rb_interrupt(void));
+VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj);
+void rb_interrupt(void);
VALUE rb_apply(VALUE, ID, VALUE);
void rb_backtrace(void);
ID rb_frame_this_func(void);
@@ -464,7 +465,7 @@ VALUE rb_str_encode_ospath(VALUE);
int rb_is_absolute_path(const char *);
/* gc.c */
NORETURN(void rb_memerror(void));
-PUREFUNC(int rb_during_gc(void));
+int rb_during_gc(void);
void rb_gc_mark_locations(const VALUE*, const VALUE*);
void rb_mark_tbl(struct st_table*);
void rb_mark_set(struct st_table*);
@@ -484,7 +485,6 @@ VALUE rb_undefine_finalizer(VALUE);
size_t rb_gc_count(void);
size_t rb_gc_stat(VALUE);
VALUE rb_gc_latest_gc_info(VALUE);
-void rb_gc_adjust_memory_usage(ssize_t);
/* hash.c */
void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
VALUE rb_check_hash_type(VALUE);
@@ -509,6 +509,8 @@ 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;
@@ -561,7 +563,7 @@ VALUE rb_num_coerce_relop(VALUE, VALUE, ID);
VALUE rb_num_coerce_bit(VALUE, VALUE, ID);
VALUE rb_num2fix(VALUE);
VALUE rb_fix2str(VALUE, int);
-CONSTFUNC(VALUE rb_dbl_cmp(double, double));
+VALUE rb_dbl_cmp(double, double);
/* object.c */
int rb_eql(VALUE, VALUE);
VALUE rb_any_to_s(VALUE);
@@ -573,17 +575,17 @@ VALUE rb_obj_clone(VALUE);
VALUE rb_obj_dup(VALUE);
VALUE rb_obj_init_copy(VALUE,VALUE);
VALUE rb_obj_taint(VALUE);
-PUREFUNC(VALUE rb_obj_tainted(VALUE));
+VALUE rb_obj_tainted(VALUE);
VALUE rb_obj_untaint(VALUE);
VALUE rb_obj_untrust(VALUE);
-PUREFUNC(VALUE rb_obj_untrusted(VALUE));
+VALUE rb_obj_untrusted(VALUE);
VALUE rb_obj_trust(VALUE);
VALUE rb_obj_freeze(VALUE);
-PUREFUNC(VALUE rb_obj_frozen_p(VALUE));
+VALUE rb_obj_frozen_p(VALUE);
VALUE rb_obj_id(VALUE);
VALUE rb_obj_class(VALUE);
-PUREFUNC(VALUE rb_class_real(VALUE));
-PUREFUNC(VALUE rb_class_inherited_p(VALUE, VALUE));
+VALUE rb_class_real(VALUE);
+VALUE rb_class_inherited_p(VALUE, VALUE);
VALUE rb_class_superclass(VALUE);
VALUE rb_class_get_superclass(VALUE);
VALUE rb_convert_type(VALUE,int,const char*,const char*);
@@ -601,25 +603,28 @@ 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);
-CONSTFUNC(int rb_is_const_id(ID));
-CONSTFUNC(int rb_is_global_id(ID));
-CONSTFUNC(int rb_is_instance_id(ID));
-CONSTFUNC(int rb_is_attrset_id(ID));
-CONSTFUNC(int rb_is_class_id(ID));
-CONSTFUNC(int rb_is_local_id(ID));
-CONSTFUNC(int rb_is_junk_id(ID));
+int rb_is_const_id(ID);
+int rb_is_global_id(ID);
+int rb_is_instance_id(ID);
+int rb_is_attrset_id(ID);
+int rb_is_class_id(ID);
+int rb_is_local_id(ID);
+int rb_is_junk_id(ID);
int rb_symname_p(const char*);
int rb_sym_interned_p(VALUE);
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);
int rb_proc_exec(const char*);
-NORETURN(VALUE rb_f_exec(int, const 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, const VALUE*);
@@ -702,11 +707,6 @@ 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);
@@ -757,80 +757,67 @@ VALUE rb_str_replace(VALUE, VALUE);
VALUE rb_str_inspect(VALUE);
VALUE rb_str_dump(VALUE);
VALUE rb_str_split(VALUE, const char*);
+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);
long rb_str_strlen(VALUE);
VALUE rb_str_length(VALUE);
long rb_str_offset(VALUE, long);
-PUREFUNC(size_t rb_str_capacity(VALUE));
+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);
-
-#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-#define rb_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
- (__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) RB_GNUC_EXTENSION_BLOCK( \
+#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
- rb_str_new_static((str), (long)strlen(str)) : \
- rb_str_new_cstr(str) \
-)
-#define rb_usascii_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
- (__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) RB_GNUC_EXTENSION_BLOCK( \
- (__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) RB_GNUC_EXTENSION_BLOCK( \
+ rb_str_new((str), (long)strlen(str)) : \
+ rb_str_new_cstr(str); \
+})
+#define rb_tainted_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
rb_tainted_str_new((str), (long)strlen(str)) : \
- rb_tainted_str_new_cstr(str) \
-)
-#define rb_usascii_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_tainted_str_new_cstr(str); \
+})
+#define rb_usascii_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
- rb_usascii_str_new_static((str), (long)strlen(str)) : \
- rb_usascii_str_new_cstr(str) \
-)
-#define rb_utf8_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
- (__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) RB_GNUC_EXTENSION_BLOCK( \
+ rb_usascii_str_new((str), (long)strlen(str)) : \
+ rb_usascii_str_new_cstr(str); \
+})
+#define rb_external_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
rb_external_str_new((str), (long)strlen(str)) : \
- rb_external_str_new_cstr(str) \
-)
-#define rb_locale_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_external_str_new_cstr(str); \
+})
+#define rb_locale_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
rb_locale_str_new((str), (long)strlen(str)) : \
- rb_locale_str_new_cstr(str) \
-)
-#define rb_str_buf_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_locale_str_new_cstr(str); \
+})
+#define rb_str_buf_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
(str), (long)strlen(str)) : \
- rb_str_buf_new_cstr(str) \
-)
-#define rb_str_cat_cstr(str, ptr) RB_GNUC_EXTENSION_BLOCK( \
+ rb_str_buf_new_cstr(str); \
+})
+#define rb_str_cat_cstr(str, ptr) __extension__ ( \
+{ \
(__builtin_constant_p(ptr)) ? \
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
- rb_str_cat_cstr((str), (ptr)) \
-)
-#define rb_exc_new_cstr(klass, ptr) RB_GNUC_EXTENSION_BLOCK( \
+ rb_str_cat_cstr((str), (ptr)); \
+})
+#define rb_exc_new_cstr(klass, ptr) __extension__ ( \
+{ \
(__builtin_constant_p(ptr)) ? \
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
- rb_exc_new_cstr((klass), (ptr)) \
-)
+ rb_exc_new_cstr((klass), (ptr)); \
+})
#endif
#define rb_str_new2 rb_str_new_cstr
#define rb_str_new3 rb_str_new_shared
@@ -842,16 +829,6 @@ VALUE rb_sym_all_symbols(void);
#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*, ...);
@@ -863,7 +840,6 @@ VALUE rb_struct_aset(VALUE, VALUE, VALUE);
VALUE rb_struct_getmember(VALUE, ID);
VALUE rb_struct_s_members(VALUE);
VALUE rb_struct_members(VALUE);
-VALUE rb_struct_size(VALUE s);
VALUE rb_struct_alloc_noinit(VALUE);
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc, ...);
@@ -884,15 +860,12 @@ 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);
struct timespec rb_time_timespec(VALUE time);
-VALUE rb_time_utc_offset(VALUE time);
/* variable.c */
VALUE rb_mod_name(VALUE);
VALUE rb_class_path(VALUE);
@@ -903,12 +876,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*);
VALUE rb_autoload_load(VALUE, ID);
VALUE rb_autoload_p(VALUE, ID);
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);
void rb_copy_generic_ivar(VALUE,VALUE);
void rb_free_generic_ivar(VALUE);
VALUE rb_ivar_get(VALUE, ID);
@@ -932,7 +907,7 @@ VALUE rb_const_get_at(VALUE, ID);
VALUE rb_const_get_from(VALUE, ID);
void rb_const_set(VALUE, ID, VALUE);
VALUE rb_const_remove(VALUE, ID);
-NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
+VALUE rb_mod_const_missing(VALUE,VALUE);
VALUE rb_cvar_defined(VALUE, ID);
void rb_cvar_set(VALUE, ID, VALUE);
VALUE rb_cvar_get(VALUE, ID);
@@ -945,9 +920,14 @@ VALUE rb_mod_remove_cvar(VALUE, VALUE);
ID rb_frame_callee(void);
VALUE rb_str_succ(VALUE);
VALUE rb_time_succ(VALUE);
+int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
VALUE rb_make_backtrace(void);
VALUE rb_make_exception(int, const VALUE*);
+/* deprecated */
+DEPRECATED(void rb_frame_pop(void));
+
+
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/io.h b/include/ruby/io.h
index 60d6f6d32e..cc3f5e60b1 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -109,28 +109,65 @@ 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;\
+} while (0)
+
#define MakeOpenFile(obj, fp) do {\
- (fp) = rb_io_make_open_file(obj);\
+ 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);\
} while (0)
-rb_io_t *rb_io_make_open_file(VALUE obj);
+#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;\
+} while (0)
FILE *rb_io_stdio_file(rb_io_t *fptr);
FILE *rb_fdopen(int, const char*);
int rb_io_modestr_fmode(const char *modestr);
int rb_io_modestr_oflags(const char *modestr);
-CONSTFUNC(int rb_io_oflags_fmode(int oflags));
+int rb_io_oflags_fmode(int oflags);
void rb_io_check_writable(rb_io_t*);
void rb_io_check_readable(rb_io_t*);
void rb_io_check_char_readable(rb_io_t *fptr);
@@ -151,8 +188,8 @@ 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_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()">]
+#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
+#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
VALUE rb_io_taint_check(VALUE);
NORETURN(void rb_eof_error(void));
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 4b88c9ea07..161d95430a 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -37,13 +37,6 @@ 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 */
@@ -136,20 +129,24 @@ RUBY_EXTERN double lgamma_r(double, int *);
RUBY_EXTERN double cbrt(double);
#endif
-#if !defined(HAVE_INFINITY) || !defined(HAVE_NAN)
+#if !defined(INFINITY) || !defined(NAN)
union bytesequence4_or_float {
unsigned char bytesequence[4];
float float_value;
};
#endif
-#ifndef INFINITY
+#ifdef INFINITY
+# define HAVE_INFINITY
+#else
/** @internal */
RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
# define INFINITY (rb_infinity.float_value)
#endif
-#ifndef NAN
+#ifdef NAN
+# define HAVE_NAN
+#else
/** @internal */
RUBY_EXTERN const union bytesequence4_or_float rb_nan;
# define NAN (rb_nan.float_value)
@@ -162,8 +159,6 @@ RUBY_EXTERN const union bytesequence4_or_float rb_nan;
# include <ieeefp.h>
# endif
# define isinf(x) (!finite(x) && !isnan(x))
-# elif defined(__cplusplus) && __cplusplus >= 201103L
-# include <cmath> // it must include constexpr bool isinf(double);
# else
RUBY_EXTERN int isinf(double);
# endif
@@ -172,18 +167,7 @@ RUBY_EXTERN int isinf(double);
#ifndef isnan
# ifndef HAVE_ISNAN
-# if defined(__cplusplus) && __cplusplus >= 201103L
-# include <cmath> // it must include constexpr bool isnan(double);
-# else
RUBY_EXTERN int isnan(double);
-# endif
-# endif
-#endif
-
-#ifndef isfinite
-# ifndef HAVE_ISFINITE
-# define HAVE_ISFINITE 1
-# define isfinite(x) finite(x)
# endif
#endif
@@ -220,6 +204,12 @@ RUBY_EXTERN char *strerror(int);
RUBY_EXTERN char *strstr(const char *, const char *);
#endif
+/*
+#ifndef HAVE_STRTOL
+RUBY_EXTERN long strtol(const char *, char **, int);
+#endif
+*/
+
#ifndef HAVE_STRLCPY
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
#endif
@@ -249,13 +239,6 @@ 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/onigmo.h b/include/ruby/onigmo.h
deleted file mode 100644
index 385f2d6a8b..0000000000
--- a/include/ruby/onigmo.h
+++ /dev/null
@@ -1,935 +0,0 @@
-#ifndef ONIGMO_H
-#define ONIGMO_H
-/**********************************************************************
- onigmo.h - Onigmo (Oniguruma-mod) (regular expression library)
-**********************************************************************/
-/*-
- * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2017 K.Takata <kentkt AT csc DOT jp>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-# if 0
-} /* satisfy cc-mode */
-# endif
-#endif
-
-#define ONIGMO_VERSION_MAJOR 6
-#define ONIGMO_VERSION_MINOR 1
-#define ONIGMO_VERSION_TEENY 3
-
-#ifndef ONIG_EXTERN
-# ifdef RUBY_EXTERN
-# define ONIG_EXTERN RUBY_EXTERN
-# else
-# if defined(_WIN32) && !defined(__GNUC__)
-# if defined(EXPORT) || defined(RUBY_EXPORT)
-# define ONIG_EXTERN extern __declspec(dllexport)
-# else
-# define ONIG_EXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif
-#endif
-
-#ifndef ONIG_EXTERN
-# define ONIG_EXTERN extern
-#endif
-
-#ifndef RUBY
-# ifndef RUBY_SYMBOL_EXPORT_BEGIN
-# define RUBY_SYMBOL_EXPORT_BEGIN
-# define RUBY_SYMBOL_EXPORT_END
-# endif
-#endif
-
-RUBY_SYMBOL_EXPORT_BEGIN
-
-#include <stddef.h> /* for size_t */
-
-/* PART: character encoding */
-
-#ifndef ONIG_ESCAPE_UCHAR_COLLISION
-# define UChar OnigUChar
-#endif
-
-typedef unsigned char OnigUChar;
-typedef unsigned int OnigCodePoint;
-typedef unsigned int OnigCtype;
-typedef size_t OnigDistance;
-typedef ptrdiff_t OnigPosition;
-
-#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
-
-/*
- * Onig casefold/case mapping flags and related definitions
- *
- * Subfields (starting with 0 at LSB):
- * 0-2: Code point count in casefold.h
- * 3-12: Index into SpecialCaseMapping array in casefold.h
- * 13-22: Case folding/mapping flags
- */
-typedef unsigned int OnigCaseFoldType; /* case fold flag */
-
-ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
-
-/* bits for actual code point count; 3 bits is more than enough, currently only 2 used */
-#define OnigCodePointMaskWidth 3
-#define OnigCodePointMask ((1<<OnigCodePointMaskWidth)-1)
-#define OnigCodePointCount(n) ((n)&OnigCodePointMask)
-#define OnigCaseFoldFlags(n) ((n)&~OnigCodePointMask)
-
-/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */ /* no longer usable with these values! */
-/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */ /* no longer usable with these values! */
-
-/* bits for index into table with separate titlecase mappings */
-/* 10 bits provide 1024 values */
-#define OnigSpecialIndexShift 3
-#define OnigSpecialIndexWidth 10
-
-#define ONIGENC_CASE_UPCASE (1<<13) /* has/needs uppercase mapping */
-#define ONIGENC_CASE_DOWNCASE (1<<14) /* has/needs lowercase mapping */
-#define ONIGENC_CASE_TITLECASE (1<<15) /* has/needs (special) titlecase mapping */
-#define ONIGENC_CASE_SPECIAL_OFFSET 3 /* offset in bits from ONIGENC_CASE to ONIGENC_CASE_SPECIAL */
-#define ONIGENC_CASE_UP_SPECIAL (1<<16) /* has special upcase mapping */
-#define ONIGENC_CASE_DOWN_SPECIAL (1<<17) /* has special downcase mapping */
-#define ONIGENC_CASE_MODIFIED (1<<18) /* data has been modified */
-#define ONIGENC_CASE_FOLD (1<<19) /* has/needs case folding */
-
-#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20) /* needs mapping specific to Turkic languages; better not change original value! */
-
-#define ONIGENC_CASE_FOLD_LITHUANIAN (1<<21) /* needs Lithuanian-specific mapping */
-#define ONIGENC_CASE_ASCII_ONLY (1<<22) /* only modify ASCII range */
-#define ONIGENC_CASE_IS_TITLECASE (1<<23) /* character itself is already titlecase */
-
-#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30) /* better not change original value! */
-
-#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
-#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
-
-
-#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
-#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
-/* 13 => Unicode:0x1ffc */
-
-/* code range */
-#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
-#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
-#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
-
-typedef struct {
- int byte_len; /* argument(original) character(s) byte length */
- int code_len; /* number of code */
- OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
-} OnigCaseFoldCodeItem;
-
-typedef struct {
- OnigCodePoint esc;
- OnigCodePoint anychar;
- OnigCodePoint anytime;
- OnigCodePoint zero_or_one_time;
- OnigCodePoint one_or_more_time;
- OnigCodePoint anychar_anytime;
-} OnigMetaCharTableType;
-
-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, 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, 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 (*case_map)(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
- int ruby_encoding_index;
- unsigned int flags;
-} OnigEncodingType;
-
-typedef const OnigEncodingType* OnigEncoding;
-
-ONIG_EXTERN const OnigEncodingType OnigEncodingASCII;
-#ifndef RUBY
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_1;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_2;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_3;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_4;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_5;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_6;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_7;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_8;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_9;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_10;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_11;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_13;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_14;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_15;
-ONIG_EXTERN const OnigEncodingType OnigEncodingISO_8859_16;
-ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_8;
-ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16BE;
-ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_16LE;
-ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32BE;
-ONIG_EXTERN const OnigEncodingType OnigEncodingUTF_32LE;
-ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_JP;
-ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_TW;
-ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_KR;
-ONIG_EXTERN const OnigEncodingType OnigEncodingEUC_CN;
-ONIG_EXTERN const OnigEncodingType OnigEncodingShift_JIS;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_31J;
-/* ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8; */
-ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_R;
-ONIG_EXTERN const OnigEncodingType OnigEncodingKOI8_U;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1250;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1251;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1252;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1253;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1254;
-ONIG_EXTERN const OnigEncodingType OnigEncodingWindows_1257;
-ONIG_EXTERN const OnigEncodingType OnigEncodingBIG5;
-ONIG_EXTERN const OnigEncodingType OnigEncodingGB18030;
-#endif /* RUBY */
-
-#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
-#ifndef RUBY
-# define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)
-# define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2)
-# define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3)
-# define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4)
-# define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5)
-# define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6)
-# define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7)
-# define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8)
-# define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9)
-# define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10)
-# define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11)
-# define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13)
-# define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14)
-# define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15)
-# define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16)
-# define ONIG_ENCODING_UTF_8 (&OnigEncodingUTF_8)
-# define ONIG_ENCODING_UTF_16BE (&OnigEncodingUTF_16BE)
-# define ONIG_ENCODING_UTF_16LE (&OnigEncodingUTF_16LE)
-# define ONIG_ENCODING_UTF_32BE (&OnigEncodingUTF_32BE)
-# define ONIG_ENCODING_UTF_32LE (&OnigEncodingUTF_32LE)
-# define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP)
-# define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW)
-# define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR)
-# define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN)
-# define ONIG_ENCODING_SHIFT_JIS (&OnigEncodingShift_JIS)
-# define ONIG_ENCODING_WINDOWS_31J (&OnigEncodingWindows_31J)
-/* # define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8) */
-# define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)
-# define ONIG_ENCODING_KOI8_U (&OnigEncodingKOI8_U)
-# define ONIG_ENCODING_WINDOWS_1250 (&OnigEncodingWindows_1250)
-# define ONIG_ENCODING_WINDOWS_1251 (&OnigEncodingWindows_1251)
-# define ONIG_ENCODING_WINDOWS_1252 (&OnigEncodingWindows_1252)
-# define ONIG_ENCODING_WINDOWS_1253 (&OnigEncodingWindows_1253)
-# define ONIG_ENCODING_WINDOWS_1254 (&OnigEncodingWindows_1254)
-# define ONIG_ENCODING_WINDOWS_1257 (&OnigEncodingWindows_1257)
-# define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)
-# define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)
-
-/* old names */
-# define ONIG_ENCODING_SJIS ONIG_ENCODING_SHIFT_JIS
-# define ONIG_ENCODING_CP932 ONIG_ENCODING_WINDOWS_31J
-# define ONIG_ENCODING_CP1250 ONIG_ENCODING_WINDOWS_1250
-# define ONIG_ENCODING_CP1251 ONIG_ENCODING_WINDOWS_1251
-# define ONIG_ENCODING_CP1252 ONIG_ENCODING_WINDOWS_1252
-# define ONIG_ENCODING_CP1253 ONIG_ENCODING_WINDOWS_1253
-# define ONIG_ENCODING_CP1254 ONIG_ENCODING_WINDOWS_1254
-# define ONIG_ENCODING_CP1257 ONIG_ENCODING_WINDOWS_1257
-# define ONIG_ENCODING_UTF8 ONIG_ENCODING_UTF_8
-# define ONIG_ENCODING_UTF16_BE ONIG_ENCODING_UTF_16BE
-# define ONIG_ENCODING_UTF16_LE ONIG_ENCODING_UTF_16LE
-# define ONIG_ENCODING_UTF32_BE ONIG_ENCODING_UTF_32BE
-# define ONIG_ENCODING_UTF32_LE ONIG_ENCODING_UTF_32LE
-#endif /* RUBY */
-
-#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
-
-/* this declaration needs to be here because it is used in string.c in Ruby */
-ONIG_EXTERN
-int onigenc_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
-
-
-/* work size */
-#define ONIGENC_CODE_TO_MBC_MAXLEN 7
-#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
-/* 18: 6(max-byte) * 3(case-fold chars) */
-
-/* character types */
-#define ONIGENC_CTYPE_NEWLINE 0
-#define ONIGENC_CTYPE_ALPHA 1
-#define ONIGENC_CTYPE_BLANK 2
-#define ONIGENC_CTYPE_CNTRL 3
-#define ONIGENC_CTYPE_DIGIT 4
-#define ONIGENC_CTYPE_GRAPH 5
-#define ONIGENC_CTYPE_LOWER 6
-#define ONIGENC_CTYPE_PRINT 7
-#define ONIGENC_CTYPE_PUNCT 8
-#define ONIGENC_CTYPE_SPACE 9
-#define ONIGENC_CTYPE_UPPER 10
-#define ONIGENC_CTYPE_XDIGIT 11
-#define ONIGENC_CTYPE_WORD 12
-#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
-#define ONIGENC_CTYPE_ASCII 14
-#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
-
-/* flags */
-#define ONIGENC_FLAG_NONE 0U
-#define ONIGENC_FLAG_UNICODE 1U
-
-#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
-
-#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
-#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
-#define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1)
-#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
-#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
-#define ONIGENC_IS_MBC_WORD(enc,s,end) \
- ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
-#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
- onigenc_ascii_is_code_ctype( \
- ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
-#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
-
-
-#define ONIGENC_NAME(enc) ((enc)->name)
-
-#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
- (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
-#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
- (enc)->is_allowed_reverse_match(s,end,enc)
-#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \
- (enc)->left_adjust_char_head(start, s, end, enc)
-#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
- (enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
-#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
- (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
-#define ONIGENC_STEP_BACK(enc,start,s,end,n) \
- onigenc_step_back((enc),(start),(s),(end),(n))
-
-#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n)
-#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r))
-#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r)
-
-#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1)
-#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1)
-
-#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n))
-#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1)
-#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r))
-
-#define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc)
-
-ONIG_EXTERN
-int onigenc_mbclen_approximate(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)
-#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
-#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
-#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
-#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
-#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
-#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
-#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
- (enc)->property_name_to_ctype(enc,p,end)
-
-#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
-
-#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
-#define ONIGENC_IS_CODE_GRAPH(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
-#define ONIGENC_IS_CODE_PRINT(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
-#define ONIGENC_IS_CODE_ALNUM(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
-#define ONIGENC_IS_CODE_ALPHA(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
-#define ONIGENC_IS_CODE_LOWER(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
-#define ONIGENC_IS_CODE_UPPER(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
-#define ONIGENC_IS_CODE_CNTRL(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
-#define ONIGENC_IS_CODE_PUNCT(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
-#define ONIGENC_IS_CODE_SPACE(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
-#define ONIGENC_IS_CODE_BLANK(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
-#define ONIGENC_IS_CODE_DIGIT(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
-#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
-#define ONIGENC_IS_CODE_WORD(enc,code) \
- ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
-
-#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
- (enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
-
-ONIG_EXTERN
-OnigUChar* onigenc_step_back(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n);
-
-
-/* encoding API */
-ONIG_EXTERN
-int onigenc_init(void);
-ONIG_EXTERN
-int onigenc_set_default_encoding(OnigEncoding enc);
-ONIG_EXTERN
-OnigEncoding onigenc_get_default_encoding(void);
-ONIG_EXTERN
-OnigUChar* onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev);
-ONIG_EXTERN
-OnigUChar* onigenc_get_prev_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end);
-ONIG_EXTERN
-OnigUChar* onigenc_get_left_adjust_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end);
-ONIG_EXTERN
-OnigUChar* onigenc_get_right_adjust_char_head(OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end);
-ONIG_EXTERN
-int onigenc_strlen(OnigEncoding enc, const OnigUChar* p, const OnigUChar* end);
-ONIG_EXTERN
-int onigenc_strlen_null(OnigEncoding enc, const OnigUChar* p);
-ONIG_EXTERN
-int onigenc_str_bytelen_null(OnigEncoding enc, const OnigUChar* p);
-
-
-
-/* PART: regular expression */
-
-/* config parameters */
-#define ONIG_NREGION 10
-#define ONIG_MAX_CAPTURE_GROUP_NUM 32767
-#define ONIG_MAX_BACKREF_NUM 1000
-#define ONIG_MAX_REPEAT_NUM 100000
-#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
-/* constants */
-#define ONIG_MAX_ERROR_MESSAGE_LEN 90
-
-typedef unsigned int OnigOptionType;
-
-#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
-
-/* options */
-#define ONIG_OPTION_NONE 0U
-#define ONIG_OPTION_IGNORECASE 1U
-#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
-#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
-#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
-#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
-#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
-#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
-#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
-#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
-#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
-/* options (search time) */
-#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
-#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
-#define ONIG_OPTION_NOTBOS (ONIG_OPTION_NOTEOL << 1)
-#define ONIG_OPTION_NOTEOS (ONIG_OPTION_NOTBOS << 1)
-/* options (ctype range) */
-#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_NOTEOS << 1)
-#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
-#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
-/* options (newline) */
-#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
-#define ONIG_OPTION_MAXBIT ONIG_OPTION_NEWLINE_CRLF /* limit */
-
-#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
-#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
-#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
-
-/* syntax */
-typedef struct {
- unsigned int op;
- unsigned int op2;
- unsigned int behavior;
- OnigOptionType options; /* default option */
- OnigMetaCharTableType meta_char_table;
-} OnigSyntaxType;
-
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
-ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
-
-/* predefined syntaxes (see regsyntax.c) */
-#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
-#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
-#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
-#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
-#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
-#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
-#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
-#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
-#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
-#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
-#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
-#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
-
-/* default syntax */
-ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
-#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
-
-/* syntax (operators) */
-#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
-#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
-#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
-#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
-#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
-#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
-#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
-#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
-#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
-#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
-#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
-#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
-#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
-#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
-#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
-#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
-#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
-#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
-#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
-#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
-#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
-#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
-#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
-#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
-#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
-#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
-#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
-#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
-#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
-#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
-#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
-#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */
-
-#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
-#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
-#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
-#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
-#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
-#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
-#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
-#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
-#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
-#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
-#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
-#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
-#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
-#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
-#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
-#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
-#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
-#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
-/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
-#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
-#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
-#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
-#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X */
-#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
-#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
-#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
-#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
-#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
-#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
-#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
-#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
-#define ONIG_SYN_OP2_QMARK_TILDE_ABSENT (1U<<31) /* (?~...) */
-/* #define ONIG_SYN_OP2_OPTION_JAVA (1U<<xx) */ /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
-
-/* syntax (behavior) */
-#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
-#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
-#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
-#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
-#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
-#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
-#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
-#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
-#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
-#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
-#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
-#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
-#define ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP (1U<<11) /* (?<x>)(?<x>)\k<x> */
-
-/* syntax (behavior) in char class [...] */
-#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
-#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
-#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
-#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
-/* syntax (behavior) warning */
-#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
-#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
-#define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */
-
-/* meta character specifiers (onig_set_meta_char()) */
-#define ONIG_META_CHAR_ESCAPE 0
-#define ONIG_META_CHAR_ANYCHAR 1
-#define ONIG_META_CHAR_ANYTIME 2
-#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
-#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
-#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
-
-#define ONIG_INEFFECTIVE_META_CHAR 0
-
-/* error codes */
-#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
-/* normal return */
-#define ONIG_NORMAL 0
-#define ONIG_MISMATCH -1
-#define ONIG_NO_SUPPORT_CONFIG -2
-
-/* internal error */
-#define ONIGERR_MEMORY -5
-#define ONIGERR_TYPE_BUG -6
-#define ONIGERR_PARSER_BUG -11
-#define ONIGERR_STACK_BUG -12
-#define ONIGERR_UNDEFINED_BYTECODE -13
-#define ONIGERR_UNEXPECTED_BYTECODE -14
-#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
-#define ONIGERR_PARSE_DEPTH_LIMIT_OVER -16
-#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
-#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
-/* general error */
-#define ONIGERR_INVALID_ARGUMENT -30
-/* syntax error */
-#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
-#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
-#define ONIGERR_EMPTY_CHAR_CLASS -102
-#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
-#define ONIGERR_END_PATTERN_AT_ESCAPE -104
-#define ONIGERR_END_PATTERN_AT_META -105
-#define ONIGERR_END_PATTERN_AT_CONTROL -106
-#define ONIGERR_META_CODE_SYNTAX -108
-#define ONIGERR_CONTROL_CODE_SYNTAX -109
-#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
-#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
-#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
-#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
-#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
-#define ONIGERR_NESTED_REPEAT_OPERATOR -115
-#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
-#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
-#define ONIGERR_END_PATTERN_IN_GROUP -118
-#define ONIGERR_UNDEFINED_GROUP_OPTION -119
-#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
-#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
-#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
-#define ONIGERR_INVALID_CONDITION_PATTERN -124
-/* values error (syntax error) */
-#define ONIGERR_TOO_BIG_NUMBER -200
-#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
-#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
-#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
-#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
-#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
-#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
-#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
-#define ONIGERR_INVALID_BACKREF -208
-#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
-#define ONIGERR_TOO_MANY_CAPTURE_GROUPS -210
-#define ONIGERR_TOO_SHORT_DIGITS -211
-#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
-#define ONIGERR_EMPTY_GROUP_NAME -214
-#define ONIGERR_INVALID_GROUP_NAME -215
-#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
-#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
-#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
-#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
-#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
-#define ONIGERR_NEVER_ENDING_RECURSION -221
-#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222
-#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223
-#define ONIGERR_INVALID_CODE_POINT_VALUE -400
-#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
-#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
-#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
-#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
-
-/* errors related to thread */
-/* #define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001 */
-
-
-/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
-#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
-#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
- ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
-
-typedef struct OnigCaptureTreeNodeStruct {
- int group; /* group number */
- OnigPosition beg;
- OnigPosition end;
- int allocated;
- int num_childs;
- struct OnigCaptureTreeNodeStruct** childs;
-} OnigCaptureTreeNode;
-
-/* match result region type */
-struct re_registers {
- int allocated;
- int num_regs;
- OnigPosition* beg;
- OnigPosition* end;
- /* extended */
- OnigCaptureTreeNode* history_root; /* capture history tree root */
-};
-
-/* capture tree traverse */
-#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
-#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
-#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
- ( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
-
-
-#define ONIG_REGION_NOTPOS -1
-
-typedef struct re_registers OnigRegion;
-
-typedef struct {
- OnigEncoding enc;
- OnigUChar* par;
- OnigUChar* par_end;
-} OnigErrorInfo;
-
-typedef struct {
- int lower;
- int upper;
-} OnigRepeatRange;
-
-typedef void (*OnigWarnFunc)(const char* s);
-extern void onig_null_warn(const char* s);
-#define ONIG_NULL_WARN onig_null_warn
-
-#define ONIG_CHAR_TABLE_SIZE 256
-
-typedef struct re_pattern_buffer {
- /* common members of BBuf(bytes-buffer) */
- unsigned char* p; /* compiled pattern */
- unsigned int used; /* used space for p */
- unsigned int alloc; /* allocated space for p */
-
- int num_mem; /* used memory(...) num counted from 1 */
- int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
- int num_null_check; /* OP_NULL_CHECK_START/END id counter */
- int num_comb_exp_check; /* combination explosion check */
- int num_call; /* number of subexp call */
- unsigned int capture_history; /* (?@...) flag (1-31) */
- unsigned int bt_mem_start; /* need backtrack flag */
- unsigned int bt_mem_end; /* need backtrack flag */
- int stack_pop_level;
- int repeat_range_alloc;
-
- OnigOptionType options;
-
- OnigRepeatRange* repeat_range;
-
- OnigEncoding enc;
- const OnigSyntaxType* syntax;
- void* name_table;
- OnigCaseFoldType case_fold_flag;
-
- /* optimization info (string search, char-map and anchors) */
- int optimize; /* optimize flag */
- int threshold_len; /* search str-length for apply optimize */
- int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
- OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
- OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
- int sub_anchor; /* start-anchor for exact or map */
- unsigned char *exact;
- unsigned char *exact_end;
- unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
- int *int_map; /* BM skip for exact_len > 255 */
- int *int_map_backward; /* BM skip for backward search */
- OnigDistance dmin; /* min-distance of exact or map */
- OnigDistance dmax; /* max-distance of exact or map */
-
- /* regex_t link chain */
- struct re_pattern_buffer* chain; /* escape compile-conflict */
-} OnigRegexType;
-
-typedef OnigRegexType* OnigRegex;
-
-#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
-typedef OnigRegexType regex_t;
-#endif
-
-
-typedef struct {
- int num_of_elements;
- OnigEncoding pattern_enc;
- OnigEncoding target_enc;
- const OnigSyntaxType* syntax;
- OnigOptionType option;
- OnigCaseFoldType case_fold_flag;
-} OnigCompileInfo;
-
-/* Oniguruma Native API */
-ONIG_EXTERN
-int onig_initialize(OnigEncoding encodings[], int n);
-ONIG_EXTERN
-int onig_init(void);
-ONIG_EXTERN
-int onig_error_code_to_str(OnigUChar* s, OnigPosition err_code, ...);
-ONIG_EXTERN
-void onig_set_warn_func(OnigWarnFunc f);
-ONIG_EXTERN
-void onig_set_verb_warn_func(OnigWarnFunc f);
-ONIG_EXTERN
-int onig_new(OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo);
-ONIG_EXTERN
-int onig_reg_init(OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax);
-ONIG_EXTERN
-int onig_new_without_alloc(OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo);
-ONIG_EXTERN
-int onig_new_deluxe(OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo);
-ONIG_EXTERN
-void onig_free(OnigRegex);
-ONIG_EXTERN
-void onig_free_body(OnigRegex);
-ONIG_EXTERN
-OnigPosition onig_scan(OnigRegex reg, const OnigUChar* str, const OnigUChar* end, OnigRegion* region, OnigOptionType option, int (*scan_callback)(OnigPosition, OnigPosition, OnigRegion*, void*), void* callback_arg);
-ONIG_EXTERN
-OnigPosition onig_search(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option);
-ONIG_EXTERN
-OnigPosition onig_search_gpos(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option);
-ONIG_EXTERN
-OnigPosition onig_match(OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option);
-ONIG_EXTERN
-OnigRegion* onig_region_new(void);
-ONIG_EXTERN
-void onig_region_init(OnigRegion* region);
-ONIG_EXTERN
-void onig_region_free(OnigRegion* region, int free_self);
-ONIG_EXTERN
-void onig_region_copy(OnigRegion* to, const OnigRegion* from);
-ONIG_EXTERN
-void onig_region_clear(OnigRegion* region);
-ONIG_EXTERN
-int onig_region_resize(OnigRegion* region, int n);
-ONIG_EXTERN
-int onig_region_set(OnigRegion* region, int at, int beg, int end);
-ONIG_EXTERN
-int onig_name_to_group_numbers(OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums);
-ONIG_EXTERN
-int onig_name_to_backref_number(OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, const OnigRegion *region);
-ONIG_EXTERN
-int onig_foreach_name(OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg);
-ONIG_EXTERN
-int onig_number_of_names(const OnigRegexType *reg);
-ONIG_EXTERN
-int onig_number_of_captures(const OnigRegexType *reg);
-ONIG_EXTERN
-int onig_number_of_capture_histories(const OnigRegexType *reg);
-ONIG_EXTERN
-OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region);
-ONIG_EXTERN
-int onig_capture_tree_traverse(OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg);
-ONIG_EXTERN
-int onig_noname_group_capture_is_active(const OnigRegexType *reg);
-ONIG_EXTERN
-OnigEncoding onig_get_encoding(const OnigRegexType *reg);
-ONIG_EXTERN
-OnigOptionType onig_get_options(const OnigRegexType *reg);
-ONIG_EXTERN
-OnigCaseFoldType onig_get_case_fold_flag(const OnigRegexType *reg);
-ONIG_EXTERN
-const OnigSyntaxType* onig_get_syntax(const OnigRegexType *reg);
-ONIG_EXTERN
-int onig_set_default_syntax(const OnigSyntaxType* syntax);
-ONIG_EXTERN
-void onig_copy_syntax(OnigSyntaxType* to, const OnigSyntaxType* from);
-ONIG_EXTERN
-unsigned int onig_get_syntax_op(const OnigSyntaxType* syntax);
-ONIG_EXTERN
-unsigned int onig_get_syntax_op2(const OnigSyntaxType* syntax);
-ONIG_EXTERN
-unsigned int onig_get_syntax_behavior(const OnigSyntaxType* syntax);
-ONIG_EXTERN
-OnigOptionType onig_get_syntax_options(const OnigSyntaxType* syntax);
-ONIG_EXTERN
-void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op);
-ONIG_EXTERN
-void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2);
-ONIG_EXTERN
-void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior);
-ONIG_EXTERN
-void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options);
-ONIG_EXTERN
-int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code);
-ONIG_EXTERN
-void onig_copy_encoding(OnigEncodingType *to, OnigEncoding from);
-ONIG_EXTERN
-OnigCaseFoldType onig_get_default_case_fold_flag(void);
-ONIG_EXTERN
-int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag);
-ONIG_EXTERN
-unsigned int onig_get_match_stack_limit_size(void);
-ONIG_EXTERN
-int onig_set_match_stack_limit_size(unsigned int size);
-ONIG_EXTERN
-unsigned int onig_get_parse_depth_limit(void);
-ONIG_EXTERN
-int onig_set_parse_depth_limit(unsigned int depth);
-ONIG_EXTERN
-int onig_end(void);
-ONIG_EXTERN
-const char* onig_version(void);
-ONIG_EXTERN
-const char* onig_copyright(void);
-
-RUBY_SYMBOL_EXPORT_END
-
-#ifdef __cplusplus
-# if 0
-{ /* satisfy cc-mode */
-# endif
-}
-#endif
-
-#endif /* ONIGMO_H */
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
index dc83754aca..2530f61427 100644
--- a/include/ruby/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -1,8 +1,841 @@
#ifndef ONIGURUMA_H
#define ONIGURUMA_H
-#include "onigmo.h"
+/**********************************************************************
+ oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
+**********************************************************************/
+/*-
+ * Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne 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
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* satisfy cc-mode */
+#endif
+#endif
+
#define ONIGURUMA
-#define ONIGURUMA_VERSION_MAJOR ONIGMO_VERSION_MAJOR
-#define ONIGURUMA_VERSION_MINOR ONIGMO_VERSION_MINOR
-#define ONIGURUMA_VERSION_TEENY ONIGMO_VERSION_TEENY
+#define ONIGURUMA_VERSION_MAJOR 5
+#define ONIGURUMA_VERSION_MINOR 15
+#define ONIGURUMA_VERSION_TEENY 0
+
+#ifdef __cplusplus
+# ifndef HAVE_PROTOTYPES
+# define HAVE_PROTOTYPES 1
+# endif
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+
+/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
+#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+
+#ifdef HAVE_STDARG_H
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+
+#ifndef P_
+#if defined(__STDC__) || defined(_WIN32)
+# define P_(args) args
+#else
+# define P_(args) ()
+#endif
+#endif
+
+#ifndef PV_
+#ifdef HAVE_STDARG_PROTOTYPES
+# define PV_(args) args
+#else
+# define PV_(args) ()
+#endif
+#endif
+
+#ifndef ONIG_EXTERN
+#ifdef RUBY_EXTERN
+#define ONIG_EXTERN RUBY_EXTERN
+#else
+#if defined(_WIN32) && !defined(__GNUC__)
+#if defined(EXPORT) || defined(RUBY_EXPORT)
+#define ONIG_EXTERN extern __declspec(dllexport)
+#else
+#define ONIG_EXTERN extern __declspec(dllimport)
+#endif
+#endif
+#endif
+#endif
+
+#ifndef ONIG_EXTERN
+#define ONIG_EXTERN extern
+#endif
+
+RUBY_SYMBOL_EXPORT_BEGIN
+
+#include <stddef.h> /* for size_t */
+
+/* PART: character encoding */
+
+#ifndef ONIG_ESCAPE_UCHAR_COLLISION
+#define UChar OnigUChar
+#endif
+
+typedef unsigned char OnigUChar;
+typedef unsigned int OnigCodePoint;
+typedef unsigned int OnigCtype;
+typedef size_t OnigDistance;
+typedef ptrdiff_t OnigPosition;
+
+#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)
+
+typedef unsigned int OnigCaseFoldType; /* case fold flag */
+
+ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
+
+/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) */
+/* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */
+#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)
+#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)
+
+#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
+#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag
+
+
+#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3
+#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13
+/* 13 => Unicode:0x1ffc */
+
+/* code range */
+#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])
+#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]
+#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]
+
+typedef struct {
+ int byte_len; /* argument(original) character(s) byte length */
+ int code_len; /* number of code */
+ OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];
+} OnigCaseFoldCodeItem;
+
+typedef struct {
+ OnigCodePoint esc;
+ OnigCodePoint anychar;
+ OnigCodePoint anytime;
+ OnigCodePoint zero_or_one_time;
+ OnigCodePoint one_or_more_time;
+ OnigCodePoint anychar_anytime;
+} OnigMetaCharTableType;
+
+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, 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, 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, OnigUChar* p, 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 const OnigEncodingType* OnigEncoding;
+
+ONIG_EXTERN const OnigEncodingType OnigEncodingASCII;
+
+#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
+
+#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)
+
+
+/* work size */
+#define ONIGENC_CODE_TO_MBC_MAXLEN 7
+#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18
+/* 18: 6(max-byte) * 3(case-fold chars) */
+
+/* character types */
+#define ONIGENC_CTYPE_NEWLINE 0
+#define ONIGENC_CTYPE_ALPHA 1
+#define ONIGENC_CTYPE_BLANK 2
+#define ONIGENC_CTYPE_CNTRL 3
+#define ONIGENC_CTYPE_DIGIT 4
+#define ONIGENC_CTYPE_GRAPH 5
+#define ONIGENC_CTYPE_LOWER 6
+#define ONIGENC_CTYPE_PRINT 7
+#define ONIGENC_CTYPE_PUNCT 8
+#define ONIGENC_CTYPE_SPACE 9
+#define ONIGENC_CTYPE_UPPER 10
+#define ONIGENC_CTYPE_XDIGIT 11
+#define ONIGENC_CTYPE_WORD 12
+#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */
+#define ONIGENC_CTYPE_ASCII 14
+#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII
+
+/* flags */
+#define ONIGENC_FLAG_NONE 0U
+#define ONIGENC_FLAG_UNICODE 1U
+
+#define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e)
+
+#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)
+#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)
+#define ONIGENC_IS_MBC_HEAD(enc,p,e) (ONIGENC_MBC_ENC_LEN(enc,p,e) != 1)
+#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)
+#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)
+#define ONIGENC_IS_MBC_WORD(enc,s,end) \
+ ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))
+#define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
+ onigenc_ascii_is_code_ctype( \
+ ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc)
+#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
+
+
+#define ONIGENC_NAME(enc) ((enc)->name)
+
+#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \
+ (enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf,enc)
+#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \
+ (enc)->is_allowed_reverse_match(s,end,enc)
+#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s,end) \
+ (enc)->left_adjust_char_head(start, s, end, enc)
+#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \
+ (enc)->apply_all_case_fold(case_fold_flag,f,arg,enc)
+#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \
+ (enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs,enc)
+#define ONIGENC_STEP_BACK(enc,start,s,end,n) \
+ onigenc_step_back((enc),(start),(s),(end),(n))
+
+#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n) (n)
+#define ONIGENC_MBCLEN_CHARFOUND_P(r) (0 < (r))
+#define ONIGENC_MBCLEN_CHARFOUND_LEN(r) (r)
+
+#define ONIGENC_CONSTRUCT_MBCLEN_INVALID() (-1)
+#define ONIGENC_MBCLEN_INVALID_P(r) ((r) == -1)
+
+#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n) (-1-(n))
+#define ONIGENC_MBCLEN_NEEDMORE_P(r) ((r) < -1)
+#define ONIGENC_MBCLEN_NEEDMORE_LEN(r) (-1-(r))
+
+#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, 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)
+#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)
+#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)
+#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end),enc)
+#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end),enc)
+#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code,enc)
+#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf,enc)
+#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \
+ (enc)->property_name_to_ctype(enc,p,end)
+
+#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype,enc)
+
+#define ONIGENC_IS_CODE_NEWLINE(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)
+#define ONIGENC_IS_CODE_GRAPH(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)
+#define ONIGENC_IS_CODE_PRINT(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)
+#define ONIGENC_IS_CODE_ALNUM(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)
+#define ONIGENC_IS_CODE_ALPHA(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)
+#define ONIGENC_IS_CODE_LOWER(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)
+#define ONIGENC_IS_CODE_UPPER(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)
+#define ONIGENC_IS_CODE_CNTRL(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)
+#define ONIGENC_IS_CODE_PUNCT(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)
+#define ONIGENC_IS_CODE_SPACE(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)
+#define ONIGENC_IS_CODE_BLANK(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)
+#define ONIGENC_IS_CODE_DIGIT(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)
+#define ONIGENC_IS_CODE_XDIGIT(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)
+#define ONIGENC_IS_CODE_WORD(enc,code) \
+ ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)
+
+#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \
+ (enc)->get_ctype_code_range(ctype,sbout,ranges,enc)
+
+ONIG_EXTERN
+OnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, int n));
+
+
+/* encoding API */
+ONIG_EXTERN
+int onigenc_init P_((void));
+ONIG_EXTERN
+int onigenc_set_default_encoding P_((OnigEncoding enc));
+ONIG_EXTERN
+OnigEncoding onigenc_get_default_encoding P_((void));
+ONIG_EXTERN
+void onigenc_set_default_caseconv_table P_((const OnigUChar* table));
+ONIG_EXTERN
+OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end, const OnigUChar** prev));
+ONIG_EXTERN
+OnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
+ONIG_EXTERN
+OnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
+ONIG_EXTERN
+OnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar* end));
+ONIG_EXTERN
+int onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));
+ONIG_EXTERN
+int onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));
+ONIG_EXTERN
+int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
+
+
+
+/* PART: regular expression */
+
+/* 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 */
+#define ONIG_MAX_ERROR_MESSAGE_LEN 90
+
+typedef unsigned int OnigOptionType;
+
+#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE
+
+/* options */
+#define ONIG_OPTION_NONE 0U
+#define ONIG_OPTION_IGNORECASE 1U
+#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
+#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
+#define ONIG_OPTION_DOTALL ONIG_OPTION_MULTILINE
+#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
+#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)
+#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)
+#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)
+#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)
+#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)
+/* options (search time) */
+#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)
+#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)
+#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)
+/* options (ctype range) */
+#define ONIG_OPTION_ASCII_RANGE (ONIG_OPTION_POSIX_REGION << 1)
+#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE (ONIG_OPTION_ASCII_RANGE << 1)
+#define ONIG_OPTION_WORD_BOUND_ALL_RANGE (ONIG_OPTION_POSIX_BRACKET_ALL_RANGE << 1)
+/* options (newline) */
+#define ONIG_OPTION_NEWLINE_CRLF (ONIG_OPTION_WORD_BOUND_ALL_RANGE << 1)
+#define ONIG_OPTION_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))
+#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))
+
+/* syntax */
+typedef struct {
+ unsigned int op;
+ unsigned int op2;
+ unsigned int behavior;
+ OnigOptionType options; /* default option */
+ OnigMetaCharTableType meta_char_table;
+} OnigSyntaxType;
+
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxASIS;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixBasic;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPosixExtended;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxEmacs;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxGrep;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxGnuRegex;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxJava;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl58_NG;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPerl;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxRuby;
+ONIG_EXTERN const OnigSyntaxType OnigSyntaxPython;
+
+/* predefined syntaxes (see regsyntax.c) */
+#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
+#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
+#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
+#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
+#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
+#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
+#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
+#define ONIG_SYNTAX_PERL58 (&OnigSyntaxPerl58)
+#define ONIG_SYNTAX_PERL58_NG (&OnigSyntaxPerl58_NG)
+#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
+#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
+#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
+
+/* default syntax */
+ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax;
+#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax
+
+/* syntax (operators) */
+#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
+#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
+#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
+#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
+#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
+#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
+#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
+#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
+#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
+#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
+#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
+#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
+#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
+#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
+#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
+#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
+#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
+#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
+#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
+#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
+#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
+#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
+#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
+#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
+#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
+#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
+#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
+#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
+#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
+#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
+#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
+#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL (1U<<31) /* \o{OOO} */ /* NOTIMPL */
+
+#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
+#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
+#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsxadlu), (?-imsx), (?^imsxalu) */
+#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imxadu), (?-imx) */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
+#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
+#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
+#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
+#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
+#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
+#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
+#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
+#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
+#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
+#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
+/* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */
+#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
+#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
+#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK (1U<<21) /* \R as (?>\x0D\x0A|[\x0A-\x0D\x{85}\x{2028}\x{2029}]) */
+#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER (1U<<22) /* \X as (?>\P{M}\p{M}*) */
+#define ONIG_SYN_OP2_ESC_V_VERTICAL_WHITESPACE (1U<<23) /* \v, \V -- Perl */ /* NOTIMPL */
+#define ONIG_SYN_OP2_ESC_H_HORIZONTAL_WHITESPACE (1U<<24) /* \h, \H -- Perl */ /* NOTIMPL */
+#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP (1U<<25) /* \K */
+#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF (1U<<26) /* \g{name}, \g{n} */
+#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL (1U<<27) /* (?&name), (?n), (?R), (?0) */
+#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET (1U<<28) /* (?|...) */ /* NOTIMPL */
+#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION (1U<<29) /* (?(cond)yes...|no...) */
+#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP (1U<<30) /* (?P<name>...), (?P=name), (?P>name) -- Python/PCRE */
+#define ONIG_SYN_OP2_OPTION_JAVA (1U<<31) /* (?idmsux), (?-idmsux) */ /* NOTIMPL */
+
+/* syntax (behavior) */
+#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
+#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
+#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
+#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
+#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
+#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
+#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
+#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
+#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
+#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
+#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? */
+#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL (1U<<10) /* (?<x>)(?<x>)(?&x) */
+
+/* syntax (behavior) in char class [...] */
+#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
+#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
+#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
+#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] */
+/* syntax (behavior) warning */
+#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
+#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
+#define ONIG_SYN_WARN_CC_DUP (1U<<26) /* [aa] */
+
+/* meta character specifiers (onig_set_meta_char()) */
+#define ONIG_META_CHAR_ESCAPE 0
+#define ONIG_META_CHAR_ANYCHAR 1
+#define ONIG_META_CHAR_ANYTIME 2
+#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3
+#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4
+#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5
+
+#define ONIG_INEFFECTIVE_META_CHAR 0
+
+/* error codes */
+#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)
+/* normal return */
+#define ONIG_NORMAL 0
+#define ONIG_MISMATCH -1
+#define ONIG_NO_SUPPORT_CONFIG -2
+
+/* internal error */
+#define ONIGERR_MEMORY -5
+#define ONIGERR_TYPE_BUG -6
+#define ONIGERR_PARSER_BUG -11
+#define ONIGERR_STACK_BUG -12
+#define ONIGERR_UNDEFINED_BYTECODE -13
+#define ONIGERR_UNEXPECTED_BYTECODE -14
+#define ONIGERR_MATCH_STACK_LIMIT_OVER -15
+#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SET -21
+#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
+/* general error */
+#define ONIGERR_INVALID_ARGUMENT -30
+/* syntax error */
+#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
+#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
+#define ONIGERR_EMPTY_CHAR_CLASS -102
+#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103
+#define ONIGERR_END_PATTERN_AT_ESCAPE -104
+#define ONIGERR_END_PATTERN_AT_META -105
+#define ONIGERR_END_PATTERN_AT_CONTROL -106
+#define ONIGERR_META_CODE_SYNTAX -108
+#define ONIGERR_CONTROL_CODE_SYNTAX -109
+#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110
+#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111
+#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112
+#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113
+#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114
+#define ONIGERR_NESTED_REPEAT_OPERATOR -115
+#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116
+#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117
+#define ONIGERR_END_PATTERN_IN_GROUP -118
+#define ONIGERR_UNDEFINED_GROUP_OPTION -119
+#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121
+#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122
+#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123
+#define ONIGERR_INVALID_CONDITION_PATTERN -124
+/* values error (syntax error) */
+#define ONIGERR_TOO_BIG_NUMBER -200
+#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201
+#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202
+#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203
+#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204
+#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205
+#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206
+#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207
+#define ONIGERR_INVALID_BACKREF -208
+#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209
+#define ONIGERR_TOO_SHORT_DIGITS -210
+#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212
+#define ONIGERR_EMPTY_GROUP_NAME -214
+#define ONIGERR_INVALID_GROUP_NAME -215
+#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216
+#define ONIGERR_UNDEFINED_NAME_REFERENCE -217
+#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218
+#define ONIGERR_MULTIPLEX_DEFINED_NAME -219
+#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220
+#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
+#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
+#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
+
+/* errors related to thread */
+#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
+
+
+/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */
+#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31
+#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \
+ ((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])
+
+typedef struct OnigCaptureTreeNodeStruct {
+ int group; /* group number */
+ OnigPosition beg;
+ OnigPosition end;
+ int allocated;
+ int num_childs;
+ struct OnigCaptureTreeNodeStruct** childs;
+} OnigCaptureTreeNode;
+
+/* match result region type */
+struct re_registers {
+ int allocated;
+ int num_regs;
+ OnigPosition* beg;
+ OnigPosition* end;
+ /* extended */
+ OnigCaptureTreeNode* history_root; /* capture history tree root */
+};
+
+/* capture tree traverse */
+#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1
+#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2
+#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \
+ ( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )
+
+
+#define ONIG_REGION_NOTPOS -1
+
+typedef struct re_registers OnigRegion;
+
+typedef struct {
+ OnigEncoding enc;
+ OnigUChar* par;
+ OnigUChar* par_end;
+} OnigErrorInfo;
+
+typedef struct {
+ int lower;
+ int upper;
+} OnigRepeatRange;
+
+typedef void (*OnigWarnFunc) P_((const char* s));
+extern void onig_null_warn P_((const char* s));
+#define ONIG_NULL_WARN onig_null_warn
+
+#define ONIG_CHAR_TABLE_SIZE 256
+
+/* regex_t state */
+#define ONIG_STATE_NORMAL 0
+#define ONIG_STATE_SEARCHING 1
+#define ONIG_STATE_COMPILING -1
+#define ONIG_STATE_MODIFY -2
+
+#define ONIG_STATE(reg) \
+ ((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)
+
+typedef struct re_pattern_buffer {
+ /* common members of BBuf(bytes-buffer) */
+ unsigned char* p; /* compiled pattern */
+ unsigned int used; /* used space for p */
+ unsigned int alloc; /* allocated space for p */
+
+ int state; /* normal, searching, compiling */
+ int num_mem; /* used memory(...) num counted from 1 */
+ int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */
+ int num_null_check; /* OP_NULL_CHECK_START/END id counter */
+ int num_comb_exp_check; /* combination explosion check */
+ int num_call; /* number of subexp call */
+ unsigned int capture_history; /* (?@...) flag (1-31) */
+ unsigned int bt_mem_start; /* need backtrack flag */
+ unsigned int bt_mem_end; /* need backtrack flag */
+ int stack_pop_level;
+ int repeat_range_alloc;
+
+ OnigOptionType options;
+
+ OnigRepeatRange* repeat_range;
+
+ OnigEncoding enc;
+ const OnigSyntaxType* syntax;
+ void* name_table;
+ OnigCaseFoldType case_fold_flag;
+
+ /* optimization info (string search, char-map and anchors) */
+ int optimize; /* optimize flag */
+ int threshold_len; /* search str-length for apply optimize */
+ int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */
+ OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */
+ OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */
+ int sub_anchor; /* start-anchor for exact or map */
+ unsigned char *exact;
+ unsigned char *exact_end;
+ unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */
+ int *int_map; /* BM skip for exact_len > 255 */
+ int *int_map_backward; /* BM skip for backward search */
+ OnigDistance dmin; /* min-distance of exact or map */
+ OnigDistance dmax; /* max-distance of exact or map */
+
+ /* regex_t link chain */
+ struct re_pattern_buffer* chain; /* escape compile-conflict */
+} OnigRegexType;
+
+typedef OnigRegexType* OnigRegex;
+
+#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
+ typedef OnigRegexType regex_t;
+#endif
+
+
+typedef struct {
+ int num_of_elements;
+ OnigEncoding pattern_enc;
+ OnigEncoding target_enc;
+ const OnigSyntaxType* syntax;
+ OnigOptionType option;
+ OnigCaseFoldType case_fold_flag;
+} OnigCompileInfo;
+
+/* Oniguruma Native API */
+ONIG_EXTERN
+int onig_init P_((void));
+ONIG_EXTERN
+int onig_error_code_to_str PV_((OnigUChar* s, OnigPosition err_code, ...));
+ONIG_EXTERN
+void onig_set_warn_func P_((OnigWarnFunc f));
+ONIG_EXTERN
+void onig_set_verb_warn_func P_((OnigWarnFunc f));
+ONIG_EXTERN
+int onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+ONIG_EXTERN
+int onig_reg_init P_((OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType* syntax));
+ONIG_EXTERN
+int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+ONIG_EXTERN
+int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
+ONIG_EXTERN
+void onig_free P_((OnigRegex));
+ONIG_EXTERN
+void onig_free_body P_((OnigRegex));
+ONIG_EXTERN
+int onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+ONIG_EXTERN
+int onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
+ONIG_EXTERN
+OnigPosition onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
+ONIG_EXTERN
+OnigPosition onig_search_gpos P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* global_pos, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));
+ONIG_EXTERN
+OnigPosition onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
+ONIG_EXTERN
+OnigRegion* onig_region_new P_((void));
+ONIG_EXTERN
+void onig_region_init P_((OnigRegion* region));
+ONIG_EXTERN
+void onig_region_free P_((OnigRegion* region, int free_self));
+ONIG_EXTERN
+void onig_region_copy P_((OnigRegion* to, OnigRegion* from));
+ONIG_EXTERN
+void onig_region_clear P_((OnigRegion* region));
+ONIG_EXTERN
+int onig_region_resize P_((OnigRegion* region, int n));
+ONIG_EXTERN
+int onig_region_set P_((OnigRegion* region, int at, int beg, int end));
+ONIG_EXTERN
+int onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));
+ONIG_EXTERN
+int onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));
+ONIG_EXTERN
+int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
+ONIG_EXTERN
+int onig_number_of_names P_((OnigRegex reg));
+ONIG_EXTERN
+int onig_number_of_captures P_((OnigRegex reg));
+ONIG_EXTERN
+int onig_number_of_capture_histories P_((OnigRegex reg));
+ONIG_EXTERN
+OnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));
+ONIG_EXTERN
+int onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,OnigPosition,OnigPosition,int,int,void*), void* arg));
+ONIG_EXTERN
+int onig_noname_group_capture_is_active P_((OnigRegex reg));
+ONIG_EXTERN
+OnigEncoding onig_get_encoding P_((OnigRegex reg));
+ONIG_EXTERN
+OnigOptionType onig_get_options P_((OnigRegex reg));
+ONIG_EXTERN
+OnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));
+ONIG_EXTERN
+const OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
+ONIG_EXTERN
+int onig_set_default_syntax P_((const OnigSyntaxType* syntax));
+ONIG_EXTERN
+void onig_copy_syntax P_((OnigSyntaxType* to, const OnigSyntaxType* from));
+ONIG_EXTERN
+unsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));
+ONIG_EXTERN
+unsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));
+ONIG_EXTERN
+unsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));
+ONIG_EXTERN
+OnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));
+ONIG_EXTERN
+void onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));
+ONIG_EXTERN
+void onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));
+ONIG_EXTERN
+void onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));
+ONIG_EXTERN
+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_((OnigEncodingType *to, OnigEncoding from));
+ONIG_EXTERN
+OnigCaseFoldType onig_get_default_case_fold_flag P_((void));
+ONIG_EXTERN
+int onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));
+ONIG_EXTERN
+unsigned int onig_get_match_stack_limit_size P_((void));
+ONIG_EXTERN
+int onig_set_match_stack_limit_size P_((unsigned int size));
+ONIG_EXTERN
+int onig_end P_((void));
+ONIG_EXTERN
+const char* onig_version P_((void));
+ONIG_EXTERN
+const char* onig_copyright P_((void));
+
+RUBY_SYMBOL_EXPORT_END
+
+#ifdef __cplusplus
+#if 0
+{ /* satisfy cc-mode */
+#endif
+}
+#endif
+
#endif /* ONIGURUMA_H */
diff --git a/include/ruby/re.h b/include/ruby/re.h
index 166f254aa5..41b3e492f8 100644
--- a/include/ruby/re.h
+++ b/include/ruby/re.h
@@ -58,7 +58,6 @@ 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 56b773b380..4b57e7848b 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -28,27 +28,26 @@ extern "C" {
#include "defines.h"
-#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
-#elif GCC_VERSION_BEFORE(4,8,6) /* Bug #14221 */
-# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
+#define NORETURN_STYLE_NEW 1
+#ifndef NORETURN
+# define NORETURN(x) x
#endif
-
-#ifndef ASSUME
-# ifdef UNREACHABLE
-# define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
-# else
-# define ASSUME(x) ((void)(x))
-# endif
+#ifndef DEPRECATED
+# define DEPRECATED(x) x
+#endif
+#ifndef NOINLINE
+# define NOINLINE(x) x
#endif
#ifndef UNREACHABLE
-# define UNREACHABLE ((void)0) /* unreachable */
+# define UNREACHABLE /* unreachable */
#endif
-#define RUBY_MACRO_SELECT(base, n) TOKEN_PASTE(base, n)
+#ifdef __GNUC__
+#define PRINTF_ARGS(decl, string_index, first_to_check) \
+ decl __attribute__((format(printf, string_index, first_to_check)))
+#else
+#define PRINTF_ARGS(decl, string_index, first_to_check) decl
+#endif
#ifdef HAVE_INTRINSICS_H
# include <intrinsics.h>
@@ -60,9 +59,11 @@ RUBY_SYMBOL_EXPORT_BEGIN
/* Make alloca work the best possible way. */
#ifdef __GNUC__
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
+# ifndef atarist
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif /* atarist */
#else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
@@ -120,21 +121,20 @@ 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"" RUBY_PRI_VALUE_MARK
+#define PRIsVALUE PRIiPTR
#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" RUBY_PRI_VALUE_MARK
+#define PRIsVALUE PRI_VALUE_PREFIX"i"
#endif
#ifndef PRI_VALUE_PREFIX
# define PRI_VALUE_PREFIX ""
@@ -225,16 +225,12 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
# endif
#endif
-#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 FIXNUM_MAX (LONG_MAX>>1)
+#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
-#define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
-#define INT2FIX(i) RB_INT2FIX(i)
-#define RB_LONG2FIX(i) RB_INT2FIX(i)
-#define LONG2FIX(i) RB_INT2FIX(i)
-#define rb_fix_new(v) RB_INT2FIX(v)
+#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
+#define LONG2FIX(i) INT2FIX(i)
+#define rb_fix_new(v) INT2FIX(v)
VALUE rb_int2inum(SIGNED_VALUE);
#define rb_int_new(v) rb_int2inum(v)
@@ -346,44 +342,22 @@ rb_long2int_inline(long n)
#define MODET2NUM(v) INT2NUM(v)
#endif
-#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)
+#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)
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)
+#define STATIC_SYM_P(x) (((VALUE)(x)&~((~(VALUE)0)<<RUBY_SPECIAL_SHIFT))==SYMBOL_FLAG)
+#define DYNAMIC_SYM_P(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) == (T_SYMBOL))
+#define SYMBOL_P(x) (STATIC_SYM_P(x)||DYNAMIC_SYM_P(x))
+#define ID2SYM(x) (rb_id2sym(x))
+#define SYM2ID(x) (rb_sym2id(x))
#ifndef USE_FLONUM
#if SIZEOF_VALUE >= SIZEOF_DOUBLE
@@ -394,11 +368,10 @@ VALUE rb_id2sym(ID);
#endif
#if USE_FLONUM
-#define RB_FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG)
+#define FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&FLONUM_MASK) == FLONUM_FLAG)
#else
-#define RB_FLONUM_P(x) 0
+#define 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
@@ -431,14 +404,10 @@ enum ruby_special_consts {
RUBY_SPECIAL_SHIFT = 8
};
-#define RUBY_Qfalse ((VALUE)RUBY_Qfalse)
-#define RUBY_Qtrue ((VALUE)RUBY_Qtrue)
-#define RUBY_Qnil ((VALUE)RUBY_Qnil)
-#define RUBY_Qundef ((VALUE)RUBY_Qundef) /* undefined value for placeholder */
-#define Qfalse RUBY_Qfalse
-#define Qtrue RUBY_Qtrue
-#define Qnil RUBY_Qnil
-#define Qundef RUBY_Qundef
+#define Qfalse ((VALUE)RUBY_Qfalse)
+#define Qtrue ((VALUE)RUBY_Qtrue)
+#define Qnil ((VALUE)RUBY_Qnil)
+#define Qundef ((VALUE)RUBY_Qundef) /* undefined value for placeholder */
#define IMMEDIATE_MASK RUBY_IMMEDIATE_MASK
#define FIXNUM_FLAG RUBY_FIXNUM_FLAG
#if USE_FLONUM
@@ -447,10 +416,8 @@ enum ruby_special_consts {
#endif
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
-#define RB_TEST(v) !(((VALUE)(v) & (VALUE)~RUBY_Qnil) == 0)
-#define RB_NIL_P(v) !((VALUE)(v) != RUBY_Qnil)
-#define RTEST(v) RB_TEST(v)
-#define NIL_P(v) RB_NIL_P(v)
+#define RTEST(v) !(((VALUE)(v) & ~Qnil) == 0)
+#define NIL_P(v) !((VALUE)(v) != Qnil)
#define CLASS_OF(v) rb_class_of((VALUE)(v))
@@ -478,12 +445,11 @@ enum ruby_value_type {
RUBY_T_FALSE = 0x13,
RUBY_T_SYMBOL = 0x14,
RUBY_T_FIXNUM = 0x15,
- RUBY_T_UNDEF = 0x16,
- RUBY_T_IMEMO = 0x1a, /*!< @see imemo_type */
- RUBY_T_NODE = 0x1b,
- RUBY_T_ICLASS = 0x1c,
- RUBY_T_ZOMBIE = 0x1d,
+ RUBY_T_UNDEF = 0x1b,
+ RUBY_T_NODE = 0x1c,
+ RUBY_T_ICLASS = 0x1d,
+ RUBY_T_ZOMBIE = 0x1e,
RUBY_T_MASK = 0x1f
};
@@ -510,49 +476,37 @@ 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 RB_BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & RUBY_T_MASK)
-#define BUILTIN_TYPE(x) RB_BUILTIN_TYPE(x)
+#define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
static inline int rb_type(VALUE obj);
#define TYPE(x) rb_type((VALUE)(x))
-#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)))
-
+/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by
+ * itself. don't use it directly */
#ifdef __GNUC__
-#define RB_GC_GUARD(v) \
- (*__extension__ ({ \
- volatile VALUE *rb_gc_guarded_ptr = &(v); \
- __asm__("" : : "m"(rb_gc_guarded_ptr)); \
- rb_gc_guarded_ptr; \
- }))
-#elif defined _MSC_VER
+#define RB_GC_GUARD_PTR(ptr) \
+ __extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
+#else
+#ifdef _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_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_PTR(ptr) rb_gc_guarded_ptr(ptr)
+#endif
+
+#ifndef RB_GC_GUARD
+#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
+#endif
#ifdef __GNUC__
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
@@ -577,13 +531,6 @@ void rb_check_safe_obj(VALUE);
StringValue(v);\
rb_check_safe_obj(v);\
} while (0)
-#if GCC_VERSION_SINCE(4,4,0)
-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 {\
@@ -598,36 +545,23 @@ 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 1
+#define RUBY_SAFE_LEVEL_MAX 3
void rb_secure(int);
int rb_safe_level(void);
void rb_set_safe_level(int);
-#if GCC_VERSION_SINCE(4,4,0)
-int ruby_safe_level_2_error(void) __attribute__((error("$SAFE=2 to 4 are obsolete")));
-int ruby_safe_level_2_warning(void) __attribute__((const,warning("$SAFE=2 to 4 are obsolete")));
+#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")));
# ifdef RUBY_EXPORT
-# define ruby_safe_level_2_warning() ruby_safe_level_2_error()
+# define ruby_safe_level_4_warning() ruby_safe_level_4_error()
# endif
-# 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) \
+#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_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))
+#define RUBY_SAFE_LEVEL_CHECK(level, type) \
+ (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4_##type() : (level))
+#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
void rb_set_safe_level_force(int);
void rb_secure_update(VALUE);
@@ -641,72 +575,63 @@ unsigned long rb_num2ulong(VALUE);
static inline long
rb_num2long_inline(VALUE x)
{
- if (RB_FIXNUM_P(x))
- return RB_FIX2LONG(x);
+ if (FIXNUM_P(x))
+ return FIX2LONG(x);
else
return rb_num2long(x);
}
-#define RB_NUM2LONG(x) rb_num2long_inline(x)
-#define NUM2LONG(x) RB_NUM2LONG(x)
+#define NUM2LONG(x) rb_num2long_inline(x)
static inline unsigned long
rb_num2ulong_inline(VALUE x)
{
- if (RB_FIXNUM_P(x))
- return RB_FIX2ULONG(x);
+ if (FIXNUM_P(x))
+ return (unsigned long)FIX2LONG(x);
else
return rb_num2ulong(x);
}
-#define RB_NUM2ULONG(x) rb_num2ulong_inline(x)
-#define NUM2ULONG(x) RB_NUM2ULONG(x)
+#define NUM2ULONG(x) rb_num2ulong_inline(x)
#if SIZEOF_INT < SIZEOF_LONG
long rb_num2int(VALUE);
long rb_fix2int(VALUE);
-#define RB_FIX2INT(x) ((int)rb_fix2int((VALUE)(x)))
+#define FIX2INT(x) ((int)rb_fix2int((VALUE)(x)))
static inline int
rb_num2int_inline(VALUE x)
{
- if (RB_FIXNUM_P(x))
- return (int)rb_fix2int(x);
+ if (FIXNUM_P(x))
+ return FIX2INT(x);
else
return (int)rb_num2int(x);
}
-#define RB_NUM2INT(x) rb_num2int_inline(x)
+#define NUM2INT(x) rb_num2int_inline(x)
unsigned long rb_num2uint(VALUE);
-#define RB_NUM2UINT(x) ((unsigned int)rb_num2uint(x))
+#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
unsigned long rb_fix2uint(VALUE);
-#define RB_FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
+#define FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
#else /* SIZEOF_INT < SIZEOF_LONG */
-#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))
+#define NUM2INT(x) ((int)NUM2LONG(x))
+#define NUM2UINT(x) ((unsigned int)NUM2ULONG(x))
+#define FIX2INT(x) ((int)FIX2LONG(x))
+#define FIX2UINT(x) ((unsigned int)FIX2ULONG(x))
#endif /* 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 RB_FIX2SHORT(x) (rb_fix2short((VALUE)(x)))
-#define FIX2SHORT(x) RB_FIX2SHORT(x)
+#define FIX2SHORT(x) (rb_fix2short((VALUE)(x)))
static inline short
rb_num2short_inline(VALUE x)
{
- if (RB_FIXNUM_P(x))
- return rb_fix2short(x);
+ if (FIXNUM_P(x))
+ return FIX2SHORT(x);
else
return rb_num2short(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)
+#define NUM2SHORT(x) rb_num2short_inline(x)
+#define NUM2USHORT(x) rb_num2ushort(x)
#ifdef HAVE_LONG_LONG
LONG_LONG rb_num2ll(VALUE);
@@ -714,15 +639,13 @@ unsigned LONG_LONG rb_num2ull(VALUE);
static inline LONG_LONG
rb_num2ll_inline(VALUE x)
{
- if (RB_FIXNUM_P(x))
- return RB_FIX2LONG(x);
+ if (FIXNUM_P(x))
+ return FIX2LONG(x);
else
return rb_num2ll(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)
+# define NUM2LL(x) rb_num2ll_inline(x)
+# define NUM2ULL(x) rb_num2ull(x)
#endif
#if !defined(NUM2OFFT)
@@ -750,13 +673,18 @@ 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 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 NEWOBJ(obj,type) type *(obj) = (type*)rb_newobj()
+#define NEWOBJ_OF(obj,type,klass,flags) type *(obj) = (type*)rb_newobj_of(klass, flags)
#define OBJSETUP(obj,c,t) rb_obj_setup(obj, c, t) /* use NEWOBJ_OF instead of NEWOBJ()+OBJSETUP() */
-#define CLONESETUP(clone,obj) rb_clone_setup(clone,obj)
-#define DUPSETUP(dup,obj) rb_dup_setup(dup,obj)
+#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)
#ifndef USE_RGENGC
#define USE_RGENGC 1
@@ -806,53 +734,6 @@ VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
#define RGENGC_WB_PROTECTED_NODE_CREF 1
#endif
-#ifdef __GNUC__
-__extension__
-#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;
@@ -865,40 +746,21 @@ 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 ROBJECT_EMBED_LEN_MAX
-#define ROBJECT_EMBED ROBJECT_EMBED
-enum ruby_robject_flags {
- ROBJECT_EMBED_LEN_MAX = 3,
- ROBJECT_EMBED = RUBY_FL_USER1,
-
- ROBJECT_ENUM_END
-};
-
+#define ROBJECT_EMBED_LEN_MAX 3
struct RObject {
struct RBasic basic;
union {
struct {
- uint32_t numiv;
+ long numiv; /* only uses 32-bits */
VALUE *ivptr;
- void *iv_index_tbl; /* shortcut for RCLASS_IV_INDEX_TBL(rb_obj_class(obj)) */
+ struct st_table *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 : \
@@ -912,47 +774,34 @@ 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;
+
+struct RClass {
+ struct RBasic basic;
+ VALUE super;
+ rb_classext_t *ptr;
+ struct method_table_wrapper *m_tbl_wrapper;
+};
#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 RMODULE_IS_OVERLAID
-#define RMODULE_IS_REFINEMENT RMODULE_IS_REFINEMENT
-#define RMODULE_INCLUDED_INTO_REFINEMENT RMODULE_INCLUDED_INTO_REFINEMENT
-enum ruby_rmodule_flags {
- RMODULE_IS_OVERLAID = RUBY_FL_USER2,
- RMODULE_IS_REFINEMENT = RUBY_FL_USER3,
- RMODULE_INCLUDED_INTO_REFINEMENT = RUBY_FL_USER4,
-
- RMODULE_ENUM_END
-};
+#define RMODULE_IS_OVERLAID FL_USER2
+#define RMODULE_IS_REFINEMENT FL_USER3
+#define RMODULE_INCLUDED_INTO_REFINEMENT FL_USER4
-PUREFUNC(double rb_float_value(VALUE));
+double rb_float_value(VALUE);
VALUE rb_float_new(double);
VALUE rb_float_new_in_heap(double);
#define RFLOAT_VALUE(v) rb_float_value(v)
#define DBL2NUM(dbl) rb_float_new(dbl)
-#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 ruby_rstring_flags {
- 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
-};
+#define ELTS_SHARED FL_USER2
+
+#define RSTRING_EMBED_LEN_MAX ((int)((sizeof(VALUE)*3)/sizeof(char)-1))
struct RString {
struct RBasic basic;
union {
@@ -967,6 +816,10 @@ 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))
@@ -988,19 +841,7 @@ struct RString {
((ptrvar) = RSTRING(str)->as.ary, (lenvar) = RSTRING_EMBED_LEN(str)) : \
((ptrvar) = RSTRING(str)->as.heap.ptr, (lenvar) = RSTRING(str)->as.heap.len))
-enum ruby_rarray_flags {
- 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
-};
-#define RARRAY_EMBED_FLAG (VALUE)RARRAY_EMBED_FLAG
-#define RARRAY_EMBED_LEN_MASK (VALUE)RARRAY_EMBED_LEN_MASK
-#define RARRAY_EMBED_LEN_MAX RARRAY_EMBED_LEN_MAX
-#define RARRAY_EMBED_LEN_SHIFT RARRAY_EMBED_LEN_SHIFT
+#define RARRAY_EMBED_LEN_MAX 3
struct RArray {
struct RBasic basic;
union {
@@ -1015,12 +856,22 @@ struct RArray {
const VALUE ary[RARRAY_EMBED_LEN_MAX];
} as;
};
-#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_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_LENINT(ary) rb_long2int(RARRAY_LEN(ary))
-#define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
+
+#define RARRAY_CONST_PTR(a) \
+ ((const VALUE *)((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? \
+ RARRAY(a)->as.ary : \
+ RARRAY(a)->as.heap.ptr))
#define RARRAY_PTR_USE_START(a) ((VALUE *)RARRAY_CONST_PTR(a))
#define RARRAY_PTR_USE_END(a) /* */
@@ -1040,7 +891,7 @@ struct RArray {
RARRAY_PTR_USE_END(_ary); \
} while (0)
-#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(ARRAY, a)))
+#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_UNPROTECT((VALUE)a) : ((VALUE)a)))
struct RRegexp {
struct RBasic basic;
@@ -1048,8 +899,7 @@ struct RRegexp {
const VALUE src;
unsigned long usecnt;
};
-#define RREGEXP_PTR(r) (RREGEXP(r)->ptr)
-#define RREGEXP_SRC(r) (RREGEXP(r)->src)
+#define RREGEXP_SRC(r) RREGEXP(r)->src
#define RREGEXP_SRC_PTR(r) RSTRING_PTR(RREGEXP(r)->src)
#define RREGEXP_SRC_LEN(r) RSTRING_LEN(RREGEXP(r)->src)
#define RREGEXP_SRC_END(r) RSTRING_END(RREGEXP(r)->src)
@@ -1091,7 +941,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; /* RUBY_FL_WB_PROTECTED */
+ VALUE flags; /* FL_WB_PROTECTED */
};
#define HAVE_TYPE_RB_DATA_TYPE_T 1
@@ -1116,17 +966,8 @@ struct RTypedData {
*/
typedef void (*RUBY_DATA_FUNC)(void*);
-#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);
+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 *);
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 *);
@@ -1138,62 +979,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 RUBY_FL_WB_PROTECTED /* THIS FLAG DEPENDS ON Ruby version */
-#define RUBY_TYPED_PROMOTED1 RUBY_FL_PROMOTED1 /* THIS FLAG DEPENDS ON Ruby version */
+#define RUBY_TYPED_WB_PROTECTED FL_WB_PROTECTED
#define Data_Wrap_Struct(klass,mark,free,sval)\
- rb_data_object_wrap((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
+ rb_data_object_alloc((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) (\
- rb_data_object_make((klass),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free),(void **)&(sval),sizeof(type)) \
+ (sval) = ZALLOC(type),\
+ Data_Wrap_Struct((klass),(mark),(free),(sval))\
)
-#endif
#define TypedData_Wrap_Struct(klass,data_type,sval)\
- rb_data_typed_object_wrap((klass),(sval),(data_type))
+ rb_data_typed_object_alloc((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) (\
- rb_data_typed_object_make((klass),(data_type),(void **)&(sval),sizeof(type)) \
+ (sval) = ZALLOC(type),\
+ TypedData_Wrap_Struct((klass),(data_type),(sval))\
)
-#endif
-#define Data_Get_Struct(obj,type,sval) \
- ((sval) = (type*)rb_data_object_get(obj))
-
-#define TypedData_Get_Struct(obj,type,data_type,sval) \
- ((sval) = (type*)rb_check_typeddata((obj), (data_type)))
+#define Data_Get_Struct(obj,type,sval) do {\
+ Check_Type((obj), T_DATA); \
+ (sval) = (type*)DATA_PTR(obj);\
+} while (0)
-#define RSTRUCT_LEN(st) NUM2LONG(rb_struct_size(st))
-#define RSTRUCT_PTR(st) rb_struct_ptr(st)
-#define RSTRUCT_SET(st, idx, v) rb_struct_aset(st, INT2NUM(idx), (v))
-#define RSTRUCT_GET(st, idx) rb_struct_aref(st, INT2NUM(idx))
+#define TypedData_Get_Struct(obj,type,data_type,sval) do {\
+ (sval) = (type*)rb_check_typeddata((obj), (data_type)); \
+} while (0)
-int rb_big_sign(VALUE);
-#define RBIGNUM_SIGN(b) (rb_big_sign(b))
-#define RBIGNUM_POSITIVE_P(b) (RBIGNUM_SIGN(b)!=0)
-#define RBIGNUM_NEGATIVE_P(b) (RBIGNUM_SIGN(b)==0)
+#define RSTRUCT_EMBED_LEN_MAX 3
+struct RStruct {
+ struct RBasic basic;
+ union {
+ struct {
+ long len;
+ const VALUE *ptr;
+ } heap;
+ 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_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_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_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))
@@ -1205,225 +1048,95 @@ int rb_big_sign(VALUE);
#define RARRAY(obj) (R_CAST(RArray)(obj))
#define RDATA(obj) (R_CAST(RData)(obj))
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
+#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
#define RFILE(obj) (R_CAST(RFile)(obj))
-#define FL_SINGLETON ((VALUE)RUBY_FL_SINGLETON)
-#define FL_WB_PROTECTED ((VALUE)RUBY_FL_WB_PROTECTED)
-#define FL_PROMOTED0 ((VALUE)RUBY_FL_PROMOTED0)
-#define FL_PROMOTED1 ((VALUE)RUBY_FL_PROMOTED1)
-#define FL_FINALIZE ((VALUE)RUBY_FL_FINALIZE)
-#define FL_TAINT ((VALUE)RUBY_FL_TAINT)
-#define FL_UNTRUSTED ((VALUE)RUBY_FL_UNTRUSTED)
-#define FL_EXIVAR ((VALUE)RUBY_FL_EXIVAR)
-#define FL_FREEZE ((VALUE)RUBY_FL_FREEZE)
-
-#define FL_USHIFT ((VALUE)RUBY_FL_USHIFT)
-
-#define FL_USER0 ((VALUE)RUBY_FL_USER0)
-#define FL_USER1 ((VALUE)RUBY_FL_USER1)
-#define FL_USER2 ((VALUE)RUBY_FL_USER2)
-#define FL_USER3 ((VALUE)RUBY_FL_USER3)
-#define FL_USER4 ((VALUE)RUBY_FL_USER4)
-#define FL_USER5 ((VALUE)RUBY_FL_USER5)
-#define FL_USER6 ((VALUE)RUBY_FL_USER6)
-#define FL_USER7 ((VALUE)RUBY_FL_USER7)
-#define FL_USER8 ((VALUE)RUBY_FL_USER8)
-#define FL_USER9 ((VALUE)RUBY_FL_USER9)
-#define FL_USER10 ((VALUE)RUBY_FL_USER10)
-#define FL_USER11 ((VALUE)RUBY_FL_USER11)
-#define FL_USER12 ((VALUE)RUBY_FL_USER12)
-#define FL_USER13 ((VALUE)RUBY_FL_USER13)
-#define FL_USER14 ((VALUE)RUBY_FL_USER14)
-#define FL_USER15 ((VALUE)RUBY_FL_USER15)
-#define FL_USER16 ((VALUE)RUBY_FL_USER16)
-#define FL_USER17 ((VALUE)RUBY_FL_USER17)
-#define FL_USER18 ((VALUE)RUBY_FL_USER18)
-#define FL_USER19 ((VALUE)RUBY_FL_USER19)
-
-#define RB_SPECIAL_CONST_P(x) (RB_IMMEDIATE_P(x) || !RB_TEST(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 &= ~(VALUE)(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)
-
-/*!
- * \defgroup deprecated_macros deprecated macro APIs
- * \{
- * \par These macros are deprecated. Prefer their `RB_`-prefixed versions.
- */
-#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);
+#define FL_SINGLETON FL_USER0
+#define FL_WB_PROTECTED (((VALUE)1)<<5)
+#define FL_PROMOTED0 (((VALUE)1)<<5)
+#define FL_PROMOTED1 (((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_TAINTABLE(x) (FL_ABLE(x) && BUILTIN_TYPE(x) != T_BIGNUM && BUILTIN_TYPE(x) != T_FLOAT)
+#define OBJ_TAINTED(x) (!!FL_TEST((x), FL_TAINT))
+#define OBJ_TAINT(x) (OBJ_TAINTABLE(x) ? (RBASIC(x)->flags |= FL_TAINT) : 0)
+#define OBJ_UNTRUSTED(x) OBJ_TAINTED(x)
+#define OBJ_UNTRUST(x) OBJ_TAINT(x)
+#define OBJ_INFECT(x,s) ( \
+ (OBJ_TAINTABLE(x) && FL_ABLE(s)) ? \
+ RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT : 0)
+
+#define OBJ_FROZEN(x) (FL_ABLE(x) ? !!(RBASIC(x)->flags&FL_FREEZE) : 1)
+#define OBJ_FREEZE_RAW(x) (RBASIC(x)->flags |= FL_FREEZE)
+#define OBJ_FREEZE(x) rb_obj_freeze_inline((VALUE)x)
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 (FL_ABLE(x)) {
+ VALUE klass = RBASIC_CLASS(x);
+ OBJ_FREEZE_RAW(x);
+ if (FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
+ OBJ_FREEZE_RAW(klass);
}
}
}
-#if GCC_VERSION_SINCE(4,4,0)
-# 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 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__)
+#define OBJ_PROMOTED_RAW(x) ((RBASIC(x)->flags & (FL_PROMOTED0|FL_PROMOTED1)) == (FL_PROMOTED0|FL_PROMOTED1))
+#define OBJ_PROMOTED(x) (SPECIAL_CONST_P(x) ? 0 : OBJ_PROMOTED_RAW(x))
+#define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
-void rb_gc_writebarrier(VALUE a, VALUE b);
+#if USE_RINCGC
+int rb_gc_writebarrier_incremental(VALUE a, VALUE b);
+#else
+#define rb_gc_writebarrier_incremental(a, b) 0
+#endif
+void rb_gc_writebarrier_generational(VALUE a, VALUE b);
void rb_gc_writebarrier_unprotect(VALUE obj);
#else /* USE_RGENGC */
-#define RB_OBJ_PROMOTED(x) 0
-#define RB_OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
+#define OBJ_PROMOTED(x) 0
+#define 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'.
@@ -1468,8 +1181,12 @@ rb_obj_written(VALUE a, RB_UNUSED_VAR(VALUE oldv), VALUE b, RB_UNUSED_VAR(const
#endif
#if USE_RGENGC
- if (!RB_SPECIAL_CONST_P(b)) {
- rb_gc_writebarrier(a, b);
+ if (!SPECIAL_CONST_P(b)) {
+ if (rb_gc_writebarrier_incremental(a, b) == 0) {
+ if (OBJ_PROMOTED_RAW(a) && !OBJ_PROMOTED_RAW(b)) {
+ rb_gc_writebarrier_generational(a, b);
+ }
+ }
}
#endif
@@ -1486,189 +1203,94 @@ rb_obj_write(VALUE a, VALUE *slot, VALUE b, RB_UNUSED_VAR(const char *filename),
*slot = b;
#if USE_RGENGC
- rb_obj_written(a, RUBY_Qundef /* ignore `oldv' now */, b, filename, line);
+ rb_obj_written(a, Qundef /* ignore `oldv' now */, b, filename, line);
#endif
return a;
}
-#define RUBY_INTEGER_UNIFICATION 1
-#define RB_INTEGER_TYPE_P(obj) rb_integer_type_p(obj)
-#if defined __GNUC__ && !GCC_VERSION_SINCE(4, 3, 0)
-/* clang 3.x (4.2 compatible) can't eliminate CSE of RB_BUILTIN_TYPE
- * in inline function and caller function */
-#define rb_integer_type_p(obj) \
- __extension__ ({ \
- const VALUE integer_type_obj = (obj); \
- (RB_FIXNUM_P(integer_type_obj) || \
- (!RB_SPECIAL_CONST_P(integer_type_obj) && \
- RB_BUILTIN_TYPE(integer_type_obj) == RUBY_T_BIGNUM)); \
- })
-#else
-static inline int
-rb_integer_type_p(VALUE obj)
-{
- return (RB_FIXNUM_P(obj) ||
- (!RB_SPECIAL_CONST_P(obj) &&
- RB_BUILTIN_TYPE(obj) == RUBY_T_BIGNUM));
-}
-#endif
-
#if SIZEOF_INT < SIZEOF_LONG
-# define RB_INT2NUM(v) RB_INT2FIX((int)(v))
-# define RB_UINT2NUM(v) RB_LONG2FIX((unsigned int)(v))
+# define INT2NUM(v) INT2FIX((int)(v))
+# define UINT2NUM(v) LONG2FIX((unsigned int)(v))
#else
static inline VALUE
rb_int2num_inline(int v)
{
- if (RB_FIXABLE(v))
- return RB_INT2FIX(v);
+ if (FIXABLE(v))
+ return INT2FIX(v);
else
return rb_int2big(v);
}
-#define RB_INT2NUM(x) rb_int2num_inline(x)
+#define INT2NUM(x) rb_int2num_inline(x)
static inline VALUE
rb_uint2num_inline(unsigned int v)
{
- if (RB_POSFIXABLE(v))
- return RB_LONG2FIX(v);
+ if (POSFIXABLE(v))
+ return LONG2FIX(v);
else
return rb_uint2big(v);
}
-#define RB_UINT2NUM(x) rb_uint2num_inline(x)
+#define 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 (RB_FIXABLE(v))
- return RB_LONG2FIX(v);
+ if (FIXABLE(v))
+ return LONG2FIX(v);
else
return rb_int2big(v);
}
-#define RB_LONG2NUM(x) rb_long2num_inline(x)
+#define LONG2NUM(x) rb_long2num_inline(x)
static inline VALUE
rb_ulong2num_inline(unsigned long v)
{
- if (RB_POSFIXABLE(v))
- return RB_LONG2FIX(v);
+ if (POSFIXABLE(v))
+ return LONG2FIX(v);
else
return rb_uint2big(v);
}
-#define RB_ULONG2NUM(x) rb_ulong2num_inline(x)
+#define ULONG2NUM(x) rb_ulong2num_inline(x)
static inline char
rb_num2char_inline(VALUE x)
{
- if (RB_TYPE_P(x, RUBY_T_STRING) && (RSTRING_LEN(x)>=1))
+ if ((TYPE(x) == T_STRING) && (RSTRING_LEN(x)>=1))
return RSTRING_PTR(x)[0];
else
return (char)(NUM2INT(x) & 0xff);
}
-#define RB_NUM2CHR(x) rb_num2char_inline(x)
-
-#define RB_CHR2FIX(x) RB_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)
-
-#if SIZEOF_LONG < SIZEOF_VALUE
-#define RB_ST2FIX(h) RB_LONG2FIX((long)((h) > 0 ? (h) & (unsigned long)-1 >> 2 : (h) | ~((unsigned long)-1 >> 2)))
-#else
-#define RB_ST2FIX(h) RB_LONG2FIX((long)(h))
-#endif
-#define ST2FIX(h) RB_ST2FIX(h)
+#define NUM2CHR(x) rb_num2char_inline(x)
-#define RB_ALLOC_N(type,n) ((type*)ruby_xmalloc2((size_t)(n),sizeof(type)))
-#define RB_ALLOC(type) ((type*)ruby_xmalloc(sizeof(type)))
-#define RB_ZALLOC_N(type,n) ((type*)ruby_xcalloc((size_t)(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),(size_t)(n),sizeof(type)))
+#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
-#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 ALLOC_N(type,n) ((type*)xmalloc2((n),sizeof(type)))
+#define ALLOC(type) ((type*)xmalloc(sizeof(type)))
+#define ZALLOC_N(type,n) ((type*)xcalloc((n),sizeof(type)))
+#define ZALLOC(type) (ZALLOC_N(type,1))
+#define REALLOC_N(var,type,n) ((var)=(type*)xrealloc2((char*)(var),(n),sizeof(type)))
#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_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t len,size_t count) RUBY_ATTR_ALLOC_SIZE((2,3));
void rb_free_tmp_buffer(volatile VALUE *store);
-NORETURN(void ruby_malloc_size_overflow(size_t, size_t));
-#if HAVE_LONG_LONG && SIZEOF_SIZE_T * 2 <= SIZEOF_LONG_LONG
-# define DSIZE_T unsigned LONG_LONG
-#elif defined(HAVE_INT128_T)
-# define DSIZE_T uint128_t
-#endif
-static inline int
-rb_mul_size_overflow(size_t a, size_t b, size_t max, size_t *c)
-{
-#ifdef DSIZE_T
-# ifdef __GNUC__
- __extension__
-# endif
- DSIZE_T c2 = (DSIZE_T)a * (DSIZE_T)b;
- if (c2 > max) return 1;
- *c = (size_t)c2;
-#else
- if (b != 0 && a > max / b) return 1;
- *c = a * b;
-#endif
- return 0;
-}
-static inline void *
-rb_alloc_tmp_buffer2(volatile VALUE *store, long count, size_t elsize)
-{
- size_t cnt = (size_t)count;
- if (elsize == sizeof(VALUE)) {
- if (RB_UNLIKELY(cnt > LONG_MAX / sizeof(VALUE))) {
- ruby_malloc_size_overflow(cnt, elsize);
- }
- }
- else {
- size_t size, max = LONG_MAX - sizeof(VALUE) + 1;
- if (RB_UNLIKELY(rb_mul_size_overflow(cnt, elsize, max, &size))) {
- ruby_malloc_size_overflow(cnt, elsize);
- }
- cnt = (size + sizeof(VALUE) - 1) / sizeof(VALUE);
- }
- return rb_alloc_tmp_buffer_with_count(store, cnt * sizeof(VALUE), cnt);
-}
/* allocates _n_ bytes temporary buffer and stores VALUE including it
* in _v_. _n_ may be evaluated twice. */
#ifdef C_ALLOCA
-# define RB_ALLOCV(v, n) rb_alloc_tmp_buffer(&(v), (n))
-# define RB_ALLOCV_N(type, v, n) \
- rb_alloc_tmp_buffer2(&(v), (n), sizeof(type))
+# define ALLOCV(v, n) rb_alloc_tmp_buffer(&(v), (n))
#else
-# 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*)(((size_t)(n) < RUBY_ALLOCV_LIMIT / sizeof(type)) ? \
- (RB_GC_GUARD(v) = 0, alloca((size_t)(n) * sizeof(type))) : \
- rb_alloc_tmp_buffer2(&(v), (long)(n), sizeof(type))))
+# define ALLOCV(v, n) ((n) < 1024 ? (RB_GC_GUARD(v) = 0, alloca(n)) : rb_alloc_tmp_buffer(&(v), (n)))
#endif
-#define RB_ALLOCV_END(v) rb_free_tmp_buffer(&(v))
+#define ALLOCV_N(type, v, n) ((type*)ALLOCV((v), sizeof(type)*(n)))
+#define 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))
+#define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))
+#define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n))
-#define MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(size_t)(n))
-#define MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(size_t)(n))
-#define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(size_t)(n))
-#define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(size_t)(n))
-
-void rb_obj_infect(VALUE victim, VALUE carrier);
+void rb_obj_infect(VALUE,VALUE);
typedef int ruby_glob_func(const char*,VALUE, void*);
void rb_glob(const char*,void(*)(const char*,VALUE,void*),VALUE);
@@ -1702,7 +1324,7 @@ VALUE rb_gvar_var_getter(ID id, void *data, struct rb_global_variable *gvar);
void rb_gvar_var_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
void rb_gvar_var_marker(VALUE *var);
-NORETURN(void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar));
+void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
void rb_define_variable(const char*,VALUE*);
void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
@@ -1736,53 +1358,26 @@ VALUE rb_sym2str(VALUE);
VALUE rb_to_symbol(VALUE name);
VALUE rb_check_symbol(volatile VALUE *namep);
-#define RUBY_CONST_ID_CACHE(result, str) \
+#define 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 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)
+#define CONST_ID(var, str) \
+ do CONST_ID_CACHE((var) =, (str)) while (0)
#ifdef __GNUC__
/* __builtin_constant_p and statement expression is available
* since gcc-2.7.2.3 at least. */
#define rb_intern(str) \
(__builtin_constant_p(str) ? \
- __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
+ __extension__ (CONST_ID_CACHE((ID), (str))) : \
rb_intern(str))
#define rb_intern_const(str) \
(__builtin_constant_p(str) ? \
__extension__ (rb_intern2((str), (long)strlen(str))) : \
(rb_intern)(str))
-
-# define rb_varargs_argc_check_runtime(argc, vargc) \
- (((argc) <= (vargc)) ? (argc) : \
- (rb_fatal("argc(%d) exceeds actual arguments(%d)", \
- argc, vargc), 0))
-# define rb_varargs_argc_valid_p(argc, vargc) \
- ((argc) == 0 ? (vargc) <= 1 : /* [ruby-core:85266] [Bug #14425] */ \
- (argc) == (vargc))
-# if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
-# if HAVE_ATTRIBUTE_ERRORFUNC
-ERRORFUNC((" argument length doesn't match"), int rb_varargs_bad_length(int,int));
-# else
-# define rb_varargs_bad_length(argc, vargc) \
- ((argc)/rb_varargs_argc_valid_p(argc, vargc))
-# endif
-# define rb_varargs_argc_check(argc, vargc) \
- __builtin_choose_expr(__builtin_constant_p(argc), \
- (rb_varargs_argc_valid_p(argc, vargc) ? (argc) : \
- rb_varargs_bad_length(argc, vargc)), \
- rb_varargs_argc_check_runtime(argc, vargc))
-# else
-# define rb_varargs_argc_check(argc, vargc) \
- rb_varargs_argc_check_runtime(argc, vargc)
-# endif
-
#else
#define rb_intern_const(str) rb_intern2((str), (long)strlen(str))
#endif
@@ -1804,9 +1399,6 @@ 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
@@ -1823,11 +1415,6 @@ 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);
@@ -1836,7 +1423,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(enum rb_io_wait_readwrite, const char*));
+NORETURN(void rb_readwrite_sys_fail(int, const char*));
NORETURN(void rb_iter_break(void));
NORETURN(void rb_iter_break_value(VALUE));
NORETURN(void rb_exit(int));
@@ -1847,7 +1434,6 @@ 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);
@@ -1857,6 +1443,10 @@ 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
@@ -1902,9 +1492,7 @@ RUBY_EXTERN VALUE rb_mWaitWritable;
RUBY_EXTERN VALUE rb_cBasicObject;
RUBY_EXTERN VALUE rb_cObject;
RUBY_EXTERN VALUE rb_cArray;
-#ifndef RUBY_INTEGER_UNIFICATION
RUBY_EXTERN VALUE rb_cBignum;
-#endif
RUBY_EXTERN VALUE rb_cBinding;
RUBY_EXTERN VALUE rb_cClass;
RUBY_EXTERN VALUE rb_cCont;
@@ -1914,9 +1502,7 @@ RUBY_EXTERN VALUE rb_cFalseClass;
RUBY_EXTERN VALUE rb_cEncoding;
RUBY_EXTERN VALUE rb_cEnumerator;
RUBY_EXTERN VALUE rb_cFile;
-#ifndef RUBY_INTEGER_UNIFICATION
RUBY_EXTERN VALUE rb_cFixnum;
-#endif
RUBY_EXTERN VALUE rb_cFloat;
RUBY_EXTERN VALUE rb_cHash;
RUBY_EXTERN VALUE rb_cInteger;
@@ -1956,7 +1542,6 @@ RUBY_EXTERN VALUE rb_eKeyError;
RUBY_EXTERN VALUE rb_eRangeError;
RUBY_EXTERN VALUE rb_eIOError;
RUBY_EXTERN VALUE rb_eRuntimeError;
-RUBY_EXTERN VALUE rb_eFrozenError;
RUBY_EXTERN VALUE rb_eSecurityError;
RUBY_EXTERN VALUE rb_eSystemCallError;
RUBY_EXTERN VALUE rb_eThreadError;
@@ -1984,15 +1569,15 @@ RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
static inline VALUE
rb_class_of(VALUE obj)
{
- if (RB_IMMEDIATE_P(obj)) {
- if (RB_FIXNUM_P(obj)) return rb_cInteger;
- if (RB_FLONUM_P(obj)) return rb_cFloat;
- if (obj == RUBY_Qtrue) return rb_cTrueClass;
- if (RB_STATIC_SYM_P(obj)) return rb_cSymbol;
+ 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 (STATIC_SYM_P(obj)) return rb_cSymbol;
}
- else if (!RB_TEST(obj)) {
- if (obj == RUBY_Qnil) return rb_cNilClass;
- if (obj == RUBY_Qfalse) return rb_cFalseClass;
+ else if (!RTEST(obj)) {
+ if (obj == Qnil) return rb_cNilClass;
+ if (obj == Qfalse) return rb_cFalseClass;
}
return RBASIC(obj)->klass;
}
@@ -2000,20 +1585,32 @@ rb_class_of(VALUE obj)
static inline int
rb_type(VALUE obj)
{
- 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;
+ 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 (STATIC_SYM_P(obj)) return T_SYMBOL;
+ if (obj == Qundef) return T_UNDEF;
}
- else if (!RB_TEST(obj)) {
- if (obj == RUBY_Qnil) return RUBY_T_NIL;
- if (obj == RUBY_Qfalse) return RUBY_T_FALSE;
+ else if (!RTEST(obj)) {
+ if (obj == Qnil) return T_NIL;
+ if (obj == Qfalse) return T_FALSE;
}
- return RB_BUILTIN_TYPE(obj);
+ return BUILTIN_TYPE(obj);
}
+#define RB_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == T_FLOAT))
+
+#define RB_TYPE_P(obj, type) ( \
+ ((type) == T_FIXNUM) ? FIXNUM_P(obj) : \
+ ((type) == T_TRUE) ? ((obj) == Qtrue) : \
+ ((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)) : \
@@ -2024,59 +1621,18 @@ rb_type(VALUE obj)
#ifdef __GNUC__
#define rb_special_const_p(obj) \
- __extension__ ({ \
- VALUE special_const_obj = (obj); \
- (int)(RB_SPECIAL_CONST_P(special_const_obj) ? RUBY_Qtrue : RUBY_Qfalse); \
- })
+ __extension__ ({VALUE special_const_obj = (obj); (int)(SPECIAL_CONST_P(special_const_obj) ? Qtrue : Qfalse);})
#else
static inline int
rb_special_const_p(VALUE obj)
{
- if (RB_SPECIAL_CONST_P(obj)) return (int)RUBY_Qtrue;
- return (int)RUBY_Qfalse;
+ if (SPECIAL_CONST_P(obj)) return (int)Qtrue;
+ return (int)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 & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE));
- 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);
-}
-
#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
/* hook for external modules */
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
@@ -2103,11 +1659,11 @@ 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 */
-#define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000
+#define RUBY_EVENT_SPECIFIED_LINE 0x010000
+#define RUBY_EVENT_COVERAGE 0x020000
/* internal events */
#define RUBY_INTERNAL_EVENT_SWITCH 0x040000
@@ -2121,9 +1677,9 @@ int ruby_native_thread_p(void);
#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 0xffff0000
+#define RUBY_INTERNAL_EVENT_MASK 0xfffe0000
-typedef uint32_t rb_event_flag_t;
+typedef unsigned long rb_event_flag_t;
typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass);
#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1
@@ -2132,36 +1688,37 @@ int rb_remove_event_hook(rb_event_hook_func_t func);
/* locale insensitive functions */
-static inline int rb_isascii(int c){ return '\0' <= c && c <= '\x7f'; }
-static inline int rb_isupper(int c){ return 'A' <= c && c <= 'Z'; }
-static inline int rb_islower(int c){ return 'a' <= c && c <= 'z'; }
-static inline int rb_isalpha(int c){ return rb_isupper(c) || rb_islower(c); }
-static inline int rb_isdigit(int c){ return '0' <= c && c <= '9'; }
-static inline int rb_isalnum(int c){ return rb_isalpha(c) || rb_isdigit(c); }
-static inline int rb_isxdigit(int c){ return rb_isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); }
-static inline int rb_isblank(int c){ return c == ' ' || c == '\t'; }
-static inline int rb_isspace(int c){ return c == ' ' || ('\t' <= c && c <= '\r'); }
-static inline int rb_iscntrl(int c){ return ('\0' <= c && c < ' ') || c == '\x7f'; }
-static inline int rb_isprint(int c){ return ' ' <= c && c <= '\x7e'; }
-static inline int rb_ispunct(int c){ return !rb_isalnum(c); }
-static inline int rb_isgraph(int c){ return '!' <= c && c <= '\x7e'; }
-static inline int rb_tolower(int c) { return rb_isupper(c) ? (c|0x20) : c; }
-static inline int rb_toupper(int c) { return rb_islower(c) ? (c&0x5f) : c; }
+#define rb_isascii(c) ((unsigned long)(c) < 128)
+int rb_isalnum(int c);
+int rb_isalpha(int c);
+int rb_isblank(int c);
+int rb_iscntrl(int c);
+int rb_isdigit(int c);
+int rb_isgraph(int c);
+int rb_islower(int c);
+int rb_isprint(int c);
+int rb_ispunct(int c);
+int rb_isspace(int c);
+int rb_isupper(int c);
+int rb_isxdigit(int c);
+int rb_tolower(int c);
+int rb_toupper(int c);
#ifndef ISPRINT
-#define ISASCII(c) rb_isascii(c)
-#define ISPRINT(c) rb_isprint(c)
-#define ISGRAPH(c) rb_isgraph(c)
-#define ISSPACE(c) rb_isspace(c)
-#define ISUPPER(c) rb_isupper(c)
-#define ISLOWER(c) rb_islower(c)
-#define ISALNUM(c) rb_isalnum(c)
-#define ISALPHA(c) rb_isalpha(c)
-#define ISDIGIT(c) rb_isdigit(c)
-#define ISXDIGIT(c) rb_isxdigit(c)
-#endif
-#define TOUPPER(c) rb_toupper(c)
-#define TOLOWER(c) rb_tolower(c)
+#define ISASCII(c) rb_isascii((unsigned char)(c))
+#undef ISPRINT
+#define ISPRINT(c) rb_isprint((unsigned char)(c))
+#define ISGRAPH(c) rb_isgraph((unsigned char)(c))
+#define ISSPACE(c) rb_isspace((unsigned char)(c))
+#define ISUPPER(c) rb_isupper((unsigned char)(c))
+#define ISLOWER(c) rb_islower((unsigned char)(c))
+#define ISALNUM(c) rb_isalnum((unsigned char)(c))
+#define ISALPHA(c) rb_isalpha((unsigned char)(c))
+#define ISDIGIT(c) rb_isdigit((unsigned char)(c))
+#define ISXDIGIT(c) rb_isxdigit((unsigned char)(c))
+#endif
+#define TOUPPER(c) rb_toupper((unsigned char)(c))
+#define TOLOWER(c) rb_tolower((unsigned char)(c))
int st_locale_insensitive_strcasecmp(const char *s1, const char *s2);
int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n);
@@ -2176,306 +1733,6 @@ unsigned long ruby_strtoul(const char *str, char **endptr, int base);
PRINTF_ARGS(int ruby_snprintf(char *str, size_t n, char const *fmt, ...), 3, 4);
int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
-#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) && defined(__OPTIMIZE__)
-# define rb_scan_args(argc,argvp,fmt,...) \
- __builtin_choose_expr(__builtin_constant_p(fmt), \
- rb_scan_args0(argc,argvp,fmt,\
- (sizeof((VALUE*[]){__VA_ARGS__})/sizeof(VALUE*)), \
- ((VALUE*[]){__VA_ARGS__})), \
- rb_scan_args(argc,argvp,fmt,__VA_ARGS__))
-# if HAVE_ATTRIBUTE_ERRORFUNC
-ERRORFUNC(("bad scan arg format"), int rb_scan_args_bad_format(const char*));
-ERRORFUNC(("variable argument length doesn't match"), int rb_scan_args_length_mismatch(const char*,int));
-# else
-# define rb_scan_args_bad_format(fmt) 0
-# define rb_scan_args_length_mismatch(fmt, varc) 0
-# endif
-
-# define rb_scan_args_isdigit(c) ((unsigned char)((c)-'0')<10)
-
-# define rb_scan_args_count_end(fmt, ofs, varc, vari) \
- ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
-
-# define rb_scan_args_count_block(fmt, ofs, varc, vari) \
- (fmt[ofs]!='&' ? \
- rb_scan_args_count_end(fmt, ofs, varc, vari) : \
- rb_scan_args_count_end(fmt, ofs+1, varc, vari+1))
-
-# define rb_scan_args_count_hash(fmt, ofs, varc, vari) \
- (fmt[ofs]!=':' ? \
- rb_scan_args_count_block(fmt, ofs, varc, vari) : \
- rb_scan_args_count_block(fmt, ofs+1, varc, vari+1))
-
-# define rb_scan_args_count_trail(fmt, ofs, varc, vari) \
- (!rb_scan_args_isdigit(fmt[ofs]) ? \
- rb_scan_args_count_hash(fmt, ofs, varc, vari) : \
- rb_scan_args_count_hash(fmt, ofs+1, varc, vari+(fmt[ofs]-'0')))
-
-# define rb_scan_args_count_var(fmt, ofs, varc, vari) \
- (fmt[ofs]!='*' ? \
- rb_scan_args_count_trail(fmt, ofs, varc, vari) : \
- rb_scan_args_count_trail(fmt, ofs+1, varc, vari+1))
-
-# define rb_scan_args_count_opt(fmt, ofs, varc, vari) \
- (!rb_scan_args_isdigit(fmt[1]) ? \
- rb_scan_args_count_var(fmt, ofs, varc, vari) : \
- rb_scan_args_count_var(fmt, ofs+1, varc, vari+fmt[ofs]-'0'))
-
-# define rb_scan_args_count(fmt, varc) \
- ((!rb_scan_args_isdigit(fmt[0]) ? \
- rb_scan_args_count_var(fmt, 0, varc, 0) : \
- rb_scan_args_count_opt(fmt, 1, varc, fmt[0]-'0')) \
- == (varc) || \
- rb_scan_args_length_mismatch(fmt, varc))
-
-# define rb_scan_args_verify_count(fmt, varc) \
- ((varc)/(rb_scan_args_count(fmt, varc)))
-
-# ifdef __GNUC__
-# define rb_scan_args_verify(fmt, varc) \
- ({ \
- int verify; \
- _Pragma("GCC diagnostic push"); \
- _Pragma("GCC diagnostic ignored \"-Warray-bounds\""); \
- verify = rb_scan_args_verify_count(fmt, varc); \
- _Pragma("GCC diagnostic pop"); \
- verify; \
- })
-# else
-# define rb_scan_args_verify(fmt, varc) \
- rb_scan_args_verify_count(fmt, varc)
-# endif
-
-ALWAYS_INLINE(static int rb_scan_args_lead_p(const char *fmt));
-static inline int
-rb_scan_args_lead_p(const char *fmt)
-{
- return rb_scan_args_isdigit(fmt[0]);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_n_lead(const char *fmt));
-static inline int
-rb_scan_args_n_lead(const char *fmt)
-{
- return (rb_scan_args_lead_p(fmt) ? fmt[0]-'0' : 0);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_opt_p(const char *fmt));
-static inline int
-rb_scan_args_opt_p(const char *fmt)
-{
- return (rb_scan_args_lead_p(fmt) && rb_scan_args_isdigit(fmt[1]));
-}
-
-ALWAYS_INLINE(static int rb_scan_args_n_opt(const char *fmt));
-static inline int
-rb_scan_args_n_opt(const char *fmt)
-{
- return (rb_scan_args_opt_p(fmt) ? fmt[1]-'0' : 0);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_var_idx(const char *fmt));
-static inline int
-rb_scan_args_var_idx(const char *fmt)
-{
- return (!rb_scan_args_lead_p(fmt) ? 0 : !rb_scan_args_isdigit(fmt[1]) ? 1 : 2);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_f_var(const char *fmt));
-static inline int
-rb_scan_args_f_var(const char *fmt)
-{
- return (fmt[rb_scan_args_var_idx(fmt)]=='*');
-}
-
-ALWAYS_INLINE(static int rb_scan_args_trail_idx(const char *fmt));
-static inline int
-rb_scan_args_trail_idx(const char *fmt)
-{
- const int idx = rb_scan_args_var_idx(fmt);
- return idx+(fmt[idx]=='*');
-}
-
-ALWAYS_INLINE(static int rb_scan_args_n_trail(const char *fmt));
-static inline int
-rb_scan_args_n_trail(const char *fmt)
-{
- const int idx = rb_scan_args_trail_idx(fmt);
- return (rb_scan_args_isdigit(fmt[idx]) ? fmt[idx]-'0' : 0);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_hash_idx(const char *fmt));
-static inline int
-rb_scan_args_hash_idx(const char *fmt)
-{
- const int idx = rb_scan_args_trail_idx(fmt);
- return idx+rb_scan_args_isdigit(fmt[idx]);
-}
-
-ALWAYS_INLINE(static int rb_scan_args_f_hash(const char *fmt));
-static inline int
-rb_scan_args_f_hash(const char *fmt)
-{
- return (fmt[rb_scan_args_hash_idx(fmt)]==':');
-}
-
-ALWAYS_INLINE(static int rb_scan_args_block_idx(const char *fmt));
-static inline int
-rb_scan_args_block_idx(const char *fmt)
-{
- const int idx = rb_scan_args_hash_idx(fmt);
- return idx+(fmt[idx]==':');
-}
-
-ALWAYS_INLINE(static int rb_scan_args_f_block(const char *fmt));
-static inline int
-rb_scan_args_f_block(const char *fmt)
-{
- return (fmt[rb_scan_args_block_idx(fmt)]=='&');
-}
-
-# if 0
-ALWAYS_INLINE(static int rb_scan_args_end_idx(const char *fmt));
-static inline int
-rb_scan_args_end_idx(const char *fmt)
-{
- const int idx = rb_scan_args_block_idx(fmt);
- return idx+(fmt[idx]=='&');
-}
-# endif
-
-# define rb_scan_args0(argc, argv, fmt, varc, vars) \
- rb_scan_args_set(argc, argv, \
- rb_scan_args_n_lead(fmt), \
- rb_scan_args_n_opt(fmt), \
- rb_scan_args_n_trail(fmt), \
- rb_scan_args_f_var(fmt), \
- rb_scan_args_f_hash(fmt), \
- rb_scan_args_f_block(fmt), \
- (rb_scan_args_verify(fmt, varc), vars))
-ALWAYS_INLINE(static int
-rb_scan_args_set(int argc, const VALUE *argv,
- int n_lead, int n_opt, int n_trail,
- int f_var, int f_hash, int f_block,
- VALUE *vars[]));
-inline int
-rb_scan_args_set(int argc, const VALUE *argv,
- int n_lead, int n_opt, int n_trail,
- int f_var, int f_hash, int f_block,
- VALUE *vars[])
-{
- int i, argi = 0, vari = 0, last_idx = -1;
- VALUE *var, hash = Qnil, last_hash = 0;
- const int n_mand = n_lead + n_trail;
-
- /* capture an option hash - phase 1: pop */
- if (f_hash && n_mand < argc) {
- VALUE last = argv[argc - 1];
-
- if (RB_NIL_P(last)) {
- /* nil is taken as an empty option hash only if it is not
- ambiguous; i.e. '*' is not specified and arguments are
- given more than sufficient */
- if (!f_var && n_mand + n_opt < argc)
- argc--;
- }
- else {
- hash = rb_check_hash_type(last);
- if (!RB_NIL_P(hash)) {
- VALUE opts = rb_extract_keywords(&hash);
- if (!(last_hash = hash)) argc--;
- else last_idx = argc - 1;
- hash = opts ? opts : Qnil;
- }
- }
- }
-
- rb_check_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
-
- /* capture leading mandatory arguments */
- for (i = n_lead; i-- > 0; ) {
- var = vars[vari++];
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
- argi++;
- }
- /* capture optional arguments */
- for (i = n_opt; i-- > 0; ) {
- var = vars[vari++];
- if (argi < argc - n_trail) {
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
- argi++;
- }
- else {
- if (var) *var = Qnil;
- }
- }
- /* capture variable length arguments */
- if (f_var) {
- int n_var = argc - argi - n_trail;
-
- var = vars[vari++];
- if (0 < n_var) {
- if (var) {
- int f_last = (last_idx + 1 == argc - n_trail);
- *var = rb_ary_new4(n_var-f_last, &argv[argi]);
- if (f_last) rb_ary_push(*var, last_hash);
- }
- argi += n_var;
- }
- else {
- if (var) *var = rb_ary_new();
- }
- }
- /* capture trailing mandatory arguments */
- for (i = n_trail; i-- > 0; ) {
- var = vars[vari++];
- if (var) *var = (argi == last_idx) ? last_hash : argv[argi];
- argi++;
- }
- /* capture an option hash - phase 2: assignment */
- if (f_hash) {
- var = vars[vari++];
- if (var) *var = hash;
- }
- /* capture iterator block */
- if (f_block) {
- var = vars[vari++];
- if (rb_block_given_p()) {
- *var = rb_block_proc();
- }
- else {
- *var = Qnil;
- }
- }
-
- return argc;
-}
-#endif
-
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
-# define rb_yield_values(argc, ...) \
-__extension__({ \
- const int rb_yield_values_argc = (argc); \
- const VALUE rb_yield_values_args[] = {__VA_ARGS__}; \
- const int rb_yield_values_nargs = \
- (int)(sizeof(rb_yield_values_args) / sizeof(VALUE)); \
- rb_yield_values2( \
- rb_varargs_argc_check(rb_yield_values_argc, rb_yield_values_nargs), \
- rb_yield_values_nargs ? rb_yield_values_args : NULL); \
- })
-
-# define rb_funcall(recv, mid, argc, ...) \
-__extension__({ \
- const int rb_funcall_argc = (argc); \
- const VALUE rb_funcall_args[] = {__VA_ARGS__}; \
- const int rb_funcall_nargs = \
- (int)(sizeof(rb_funcall_args) / sizeof(VALUE)); \
- rb_funcallv(recv, mid, \
- rb_varargs_argc_check(rb_funcall_argc, rb_funcall_nargs), \
- rb_funcall_nargs ? rb_funcall_args : NULL); \
- })
-#endif
-
#ifndef RUBY_DONT_SUBST
#include "ruby/subst.h"
#endif
@@ -2546,10 +1803,6 @@ void ruby_sig_finalize(void);
/*! @} */
-#if !defined RUBY_EXPORT && !defined RUBY_NO_OLD_COMPATIBILITY
-# include "ruby/backward.h"
-#endif
-
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 47e14a3e2c..0ef499944a 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -1,8 +1,6 @@
-/* This is a public domain general purpose hash table package
- originally written by Peter Moore @ UCB.
+/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. */
- The hash table data strutures were redesigned and the package was
- rewritten by Vladimir Makarov <vmakarov@redhat.com>. */
+/* @(#) st.h 5.1 89/12/14 */
#ifndef RUBY_ST_H
#define RUBY_ST_H 1
@@ -48,10 +46,6 @@ typedef unsigned LONG_LONG st_data_t;
typedef struct st_table st_table;
typedef st_data_t st_index_t;
-
-/* Maximal value of unsigned integer type st_index_t. */
-#define MAX_ST_INDEX_VAL (~(st_index_t) 0)
-
typedef int st_compare_func(st_data_t, st_data_t);
typedef st_index_t st_hash_func(st_data_t);
@@ -63,7 +57,7 @@ struct st_hash_type {
st_index_t (*hash)(ANYARGS /*st_data_t*/); /* st_hash_func* */
};
-#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT)
+#define ST_INDEX_BITS (sizeof(st_index_t) * CHAR_BIT)
#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
# define ST_DATA_COMPATIBLE_P(type) \
@@ -72,26 +66,33 @@ struct st_hash_type {
# define ST_DATA_COMPATIBLE_P(type) 0
#endif
-typedef struct st_table_entry st_table_entry;
-
-struct st_table_entry; /* defined in st.c */
-
struct st_table {
- /* Cached features of the table -- see st.c for more details. */
- unsigned char entry_power, bin_power, size_ind;
- /* How many times the table was rebuilt. */
- unsigned int rebuilds_num;
const struct st_hash_type *type;
- /* Number of entries currently in the table. */
- st_index_t num_entries;
- /* Array of bins used for access by keys. */
- st_index_t *bins;
- /* Start and bound index of entries in array entries.
- entries_starts and entries_bound are in interval
- [0,allocated_entries]. */
- st_index_t entries_start, entries_bound;
- /* Array of size 2^entry_power. */
- st_table_entry *entries;
+ st_index_t num_bins;
+ unsigned int entries_packed : 1;
+#ifdef __GNUC__
+ /*
+ * C spec says,
+ * A bit-field shall have a type that is a qualified or unqualified
+ * version of _Bool, signed int, unsigned int, or some other
+ * 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.
+ */
+ __extension__
+#endif
+ st_index_t num_entries : ST_INDEX_BITS - 1;
+ union {
+ struct {
+ struct st_table_entry **bins;
+ struct st_table_entry *head, *tail;
+ } big;
+ struct {
+ struct st_packed_entry *entries;
+ st_index_t real_entries;
+ } packed;
+ } as;
};
#define st_is_member(table,key) st_lookup((table),(key),(st_data_t *)0)
@@ -120,6 +121,7 @@ typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t
int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
int st_foreach(st_table *, int (*)(ANYARGS), st_data_t);
int st_foreach_check(st_table *, int (*)(ANYARGS), st_data_t, st_data_t);
+int st_reverse_foreach(st_table *, int (*)(ANYARGS), st_data_t);
st_index_t st_keys(st_table *table, st_data_t *keys, st_index_t size);
st_index_t st_keys_check(st_table *table, st_data_t *keys, st_index_t size, st_data_t never);
st_index_t st_values(st_table *table, st_data_t *values, st_index_t size);
@@ -129,18 +131,18 @@ void st_free_table(st_table *);
void st_cleanup_safe(st_table *, st_data_t);
void st_clear(st_table *);
st_table *st_copy(st_table *);
-CONSTFUNC(int st_numcmp(st_data_t, st_data_t));
-CONSTFUNC(st_index_t st_numhash(st_data_t));
-PUREFUNC(int st_locale_insensitive_strcasecmp(const char *s1, const char *s2));
-PUREFUNC(int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n));
+int st_numcmp(st_data_t, st_data_t);
+st_index_t st_numhash(st_data_t);
+int st_locale_insensitive_strcasecmp(const char *s1, const char *s2);
+int st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n);
#define st_strcasecmp st_locale_insensitive_strcasecmp
#define st_strncasecmp st_locale_insensitive_strncasecmp
-PUREFUNC(size_t st_memsize(const st_table *));
-PUREFUNC(st_index_t st_hash(const void *ptr, size_t len, st_index_t h));
-CONSTFUNC(st_index_t st_hash_uint32(st_index_t h, uint32_t i));
-CONSTFUNC(st_index_t st_hash_uint(st_index_t h, st_index_t i));
-CONSTFUNC(st_index_t st_hash_end(st_index_t h));
-CONSTFUNC(st_index_t st_hash_start(st_index_t h));
+size_t st_memsize(const st_table *);
+st_index_t st_hash(const void *ptr, size_t len, st_index_t h);
+st_index_t st_hash_uint32(st_index_t h, uint32_t i);
+st_index_t st_hash_uint(st_index_t h, st_index_t i);
+st_index_t st_hash_end(st_index_t h);
+st_index_t st_hash_start(st_index_t h);
#define st_hash_start(h) ((st_index_t)(h))
RUBY_SYMBOL_EXPORT_END
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 3fecba8ebc..74cdd0ffd1 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -48,7 +48,7 @@ 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 */
+/* an approximation of ceil(n * log10(2)), upto 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 *);
@@ -64,17 +64,30 @@ void ruby_qsort(void *, const size_t, const size_t,
void ruby_setenv(const char *, const char *);
void ruby_unsetenv(const char *);
+#undef setenv
+#undef unsetenv
+#define setenv(name,val) ruby_setenv((name),(val))
+#define unsetenv(name,val) ruby_unsetenv(name)
char *ruby_strdup(const char *);
#undef strdup
#define strdup(s) ruby_strdup(s)
char *ruby_getcwd(void);
+#define my_getcwd() ruby_getcwd()
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 10b1b05436..1e3ff2e6a3 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -13,7 +13,7 @@
/*
* This file contains only
- * - never-changeable information, and
+ * - never-changable 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 5
+#define RUBY_API_VERSION_MINOR 2
#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 fe1978fdde..a6996bc95a 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -35,9 +35,6 @@ 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
@@ -80,7 +77,7 @@ extern "C++" { /* template without extern "C++" */
#endif
#include <io.h>
#include <malloc.h>
-#if defined __MINGW32__
+#if defined __MINGW32__ || __BORLANDC__ >= 0x0580
# include <stdint.h>
#else
# if !defined(_INTPTR_T_DEFINED)
@@ -127,25 +124,32 @@ 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)
-#undef HAVE_UTIMES
-#define HAVE_UTIMES 1
-#define utimes(_p, _t) rb_w32_utimes(_p, _t)
-#undef HAVE_UTIMENSAT
-#define HAVE_UTIMENSAT 1
-#define AT_FDCWD -100
-#define utimensat(_d, _p, _t, _f) rb_w32_utimensat(_d, _p, _t, _f)
#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
#define pipe(p) rb_w32_pipe(p)
@@ -158,11 +162,29 @@ typedef int clockid_t;
#define getppid() rb_w32_getppid()
#define sleep(x) rb_w32_Sleep((x)*1000)
#define Sleep(msec) (void)rb_w32_Sleep(msec)
+#define fstati64(fd,st) rb_w32_fstati64(fd,st)
+#ifdef __BORLANDC__
+#define creat(p, m) _creat(p, m)
+#define eof() _eof()
+#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)
@@ -172,43 +194,27 @@ typedef int clockid_t;
#define unlink(p) rb_w32_unlink(p)
#endif /* RUBY_EXPORT */
-/* same with stati64 except the size of st_ino and nanosecond timestamps */
-struct stati128 {
- _dev_t st_dev;
- unsigned __int64 st_ino;
- __int64 st_inohigh;
- unsigned short st_mode;
- short st_nlink;
- short st_uid;
- short st_gid;
- _dev_t st_rdev;
- __int64 st_size;
- __time64_t st_atime;
- long st_atimensec;
- __time64_t st_mtime;
- long st_mtimensec;
- __time64_t st_ctime;
- long st_ctimensec;
-};
-
#if SIZEOF_OFF_T == 8
#define off_t __int64
-#define stat stati128
-#undef SIZEOF_STRUCT_STAT_ST_INO
-#define SIZEOF_STRUCT_STAT_ST_INO sizeof(unsigned __int64)
-#define HAVE_STRUCT_STAT_ST_INOHIGH
-#define HAVE_STRUCT_STAT_ST_ATIMENSEC
-#define HAVE_STRUCT_STAT_ST_MTIMENSEC
-#define HAVE_STRUCT_STAT_ST_CTIMENSEC
-#define fstat(fd,st) rb_w32_fstati128(fd,st)
-#define stati128(path, st) rb_w32_stati128(path,st)
+#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
+#define stati64 _stati64
+#ifndef _stati64
+#define _stati64(path, st) rb_w32_stati64(path, st)
+#endif
+#else
+#define stati64 _stat64
+#define _stat64(path, st) rb_w32_stati64(path, st)
+#endif
#else
#define stat(path,st) rb_w32_stat(path,st)
#define fstat(fd,st) rb_w32_fstat(fd,st)
extern int rb_w32_stat(const char *, struct stat *);
extern int rb_w32_fstat(int, struct stat *);
#endif
-#define lstat(path,st) rb_w32_lstati128(path,st)
#define access(path,mode) rb_w32_access(path,mode)
#define strcasecmp _stricmp
@@ -256,7 +262,6 @@ struct ifaddrs {
#define IFF_POINTOPOINT IFF_POINTTOPOINT
#endif
-extern void rb_w32_sysinit(int *, char ***);
extern DWORD rb_w32_osid(void);
extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *);
extern int flock(int fd, int oper);
@@ -310,11 +315,6 @@ 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,10 +327,11 @@ 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);
@@ -339,16 +340,21 @@ extern int rb_w32_urmdir(const char *);
extern int rb_w32_unlink(const char *);
extern int rb_w32_uunlink(const char *);
extern int rb_w32_uchmod(const char *, int);
-extern int rb_w32_stati128(const char *, struct stati128 *);
-extern int rb_w32_ustati128(const char *, struct stati128 *);
-extern int rb_w32_lstati128(const char *, struct stati128 *);
-extern int rb_w32_ulstati128(const char *, struct stati128 *);
+extern int rb_w32_stati64(const char *, struct stati64 *);
+extern int rb_w32_ustati64(const char *, struct stati64 *);
extern int rb_w32_access(const char *, int);
extern int rb_w32_uaccess(const char *, int);
extern char rb_w32_fd_is_text(int);
-extern int rb_w32_fstati128(int, struct stati128 *);
+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
@@ -389,6 +395,19 @@ __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
@@ -419,17 +438,14 @@ __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_utruncate(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);
#undef HAVE_FTRUNCATE
#define HAVE_FTRUNCATE 1
@@ -463,6 +479,8 @@ extern rb_gid_t getegid (void);
extern int setuid (rb_uid_t);
extern int setgid (rb_gid_t);
+extern int fstati64(int, struct stati64 *);
+
extern char *rb_w32_strerror(int);
#ifdef RUBY_EXPORT
@@ -600,14 +618,15 @@ 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
-#define F_DUPFD_CLOEXEC 67
+#if 0
#define FD_CLOEXEC 1 /* F_GETFD, F_SETFD */
+#endif
#define O_NONBLOCK 1
#undef FD_SET
@@ -743,6 +762,8 @@ 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, ...);
@@ -753,10 +774,6 @@ ssize_t rb_w32_read(int, void *, size_t);
ssize_t rb_w32_write(int, const void *, size_t);
int rb_w32_utime(const char *, const struct utimbuf *);
int rb_w32_uutime(const char *, const struct utimbuf *);
-int rb_w32_utimes(const char *, const struct timeval *);
-int rb_w32_uutimes(const char *, const struct timeval *);
-int rb_w32_utimensat(int /* must be AT_FDCWD */, const char *, const struct timespec *, int /* must be 0 */);
-int rb_w32_uutimensat(int /* must be AT_FDCWD */, const char *, const struct timespec *, int /* must be 0 */);
long rb_w32_write_console(uintptr_t, int); /* use uintptr_t instead of VALUE because it's not defined yet here */
int WINAPI rb_w32_Sleep(unsigned long msec);
int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout);
@@ -778,8 +795,7 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
RUBY_SYMBOL_EXPORT_END
-#if (defined(__MINGW64_VERSION_MAJOR) || defined(__MINGW64__)) && !defined(__cplusplus)
-#ifdef RUBY_MINGW64_BROKEN_FREXP_MODF
+#ifdef __MINGW_ATTRIB_PURE
/* License: Ruby's */
/* get rid of bugs in math.h of mingw */
#define frexp(_X, _Y) __extension__ ({\
@@ -797,6 +813,13 @@ 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.
@@ -806,19 +829,13 @@ RUBY_SYMBOL_EXPORT_END
static inline double
rb_w32_pow(double x, double y)
{
- return (double)powl(x, y);
+ return powl(x, 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 d6cc0cbc78..da8cfb1ed9 100644
--- a/inits.c
+++ b/inits.c
@@ -9,6 +9,7 @@
**********************************************************************/
+#include "ruby/ruby.h"
#include "internal.h"
#define CALL(n) {void Init_##n(void); Init_##n();}
@@ -16,8 +17,7 @@
void
rb_call_inits(void)
{
- CALL(Method);
- CALL(RandomSeedCore);
+ CALL(RandomSeed);
CALL(sym);
CALL(var_tables);
CALL(Object);
@@ -61,6 +61,5 @@ rb_call_inits(void)
CALL(Complex);
CALL(version);
CALL(vm_trace);
- CALL(gc_stress);
}
#undef CALL
diff --git a/insns.def b/insns.def
index d23fef0649..bfa11a9b8d 100644
--- a/insns.def
+++ b/insns.def
@@ -57,9 +57,13 @@ getlocal
()
(VALUE val)
{
- val = *(vm_get_ep(GET_EP(), level) - idx);
- RB_DEBUG_COUNTER_INC(lvar_get);
- (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0);
+ int i, lev = (int)level;
+ VALUE *ep = GET_EP();
+
+ for (i = 0; i < lev; i++) {
+ ep = GET_PREV_EP(ep);
+ }
+ val = *(ep - idx);
}
/**
@@ -75,56 +79,13 @@ setlocal
(VALUE val)
()
{
- vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val);
- RB_DEBUG_COUNTER_INC(lvar_set);
- (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0);
-}
+ int i, lev = (int)level;
+ VALUE *ep = GET_EP();
-/**
- @c variable
- @e Get a block parameter.
- @j ブロックパラメータを取得する。
- */
-DEFINE_INSN
-getblockparam
-(lindex_t idx, rb_num_t level)
-()
-(VALUE val)
-{
- const VALUE *ep = vm_get_ep(GET_EP(), level);
- VM_ASSERT(VM_ENV_LOCAL_P(ep));
-
- if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) {
- val = rb_vm_bh_to_procval(ec, VM_ENV_BLOCK_HANDLER(ep));
- vm_env_write(ep, -(int)idx, val);
- VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM);
- }
- else {
- val = *(ep - idx);
- RB_DEBUG_COUNTER_INC(lvar_get);
- (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0);
+ for (i = 0; i < lev; i++) {
+ ep = GET_PREV_EP(ep);
}
-}
-
-/**
- @c variable
- @e Set block parameter.
- @j ブロックパラメータを設定する。
- */
-DEFINE_INSN
-setblockparam
-(lindex_t idx, rb_num_t level)
-(VALUE val)
-()
-{
- const VALUE *ep = vm_get_ep(GET_EP(), level);
- VM_ASSERT(VM_ENV_LOCAL_P(ep));
-
- vm_env_write(ep, -(int)idx, val);
- RB_DEBUG_COUNTER_INC(lvar_set);
- (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0);
-
- VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM);
+ *(ep - idx) = val;
}
/**
@@ -138,7 +99,7 @@ getspecial
()
(VALUE val)
{
- val = vm_getspecial(ec, GET_LEP(), key, type);
+ val = vm_getspecial(th, GET_LEP(), key, type);
}
/**
@@ -152,12 +113,13 @@ setspecial
(VALUE obj)
()
{
- lep_svar_set(ec, GET_LEP(), key, obj);
+ lep_svar_set(th, GET_LEP(), key, obj);
}
/**
@c variable
@e Get value of instance variable id of self.
+ If is_local is not 0, get value of class local variable.
@j self のインスタンス変数 id の値を得る。
*/
DEFINE_INSN
@@ -172,6 +134,7 @@ getinstancevariable
/**
@c variable
@e Set value of instance variable id of self to val.
+ If is_local is not 0, set value of class local variable.
@j self のインスタンス変数 id を val にする。
*/
DEFINE_INSN
@@ -194,7 +157,8 @@ getclassvariable
()
(VALUE val)
{
- val = rb_cvar_get(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id);
+ NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
+ val = rb_cvar_get(vm_get_cvar_base(cref, GET_CFP()), id);
}
/**
@@ -208,8 +172,8 @@ setclassvariable
(VALUE val)
()
{
- vm_ensure_not_refinement_module(GET_SELF());
- rb_cvar_set(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id, val);
+ NODE *cref = rb_vm_get_cref(GET_ISEQ(), GET_EP());
+ rb_cvar_set(vm_get_cvar_base(cref, GET_CFP()), id, val);
}
/**
@@ -230,7 +194,7 @@ getconstant
(VALUE klass)
(VALUE val)
{
- val = vm_get_ev_const(ec, klass, id, 0);
+ val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
}
/**
@@ -253,7 +217,6 @@ setconstant
()
{
vm_check_if_namespace(cbase);
- vm_ensure_not_refinement_module(GET_SELF());
rb_const_set(cbase, id, val);
}
@@ -346,16 +309,27 @@ putspecialobject
()
(VALUE val)
{
- enum vm_special_object_type type;
-
- type = (enum vm_special_object_type)value_type;
- val = vm_get_special_object(GET_EP(), type);
+ enum vm_special_object_type type = (enum vm_special_object_type)value_type;
+
+ switch (type) {
+ case VM_SPECIAL_OBJECT_VMCORE:
+ val = rb_mRubyVMFrozenCore;
+ break;
+ case VM_SPECIAL_OBJECT_CBASE:
+ val = vm_get_cbase(GET_ISEQ(), GET_EP());
+ break;
+ case VM_SPECIAL_OBJECT_CONST_BASE:
+ val = vm_get_const_base(GET_ISEQ(), GET_EP());
+ break;
+ default:
+ rb_bug("putspecialobject insn: unknown value_type");
+ }
}
/**
@c put
@e put iseq value.
- @j iseq をスタックにプッシュする。
+ @j put iseq value.
*/
DEFINE_INSN
putiseq
@@ -363,7 +337,7 @@ putiseq
()
(VALUE ret)
{
- ret = (VALUE)iseq;
+ ret = iseq->self;
}
/**
@@ -391,43 +365,33 @@ concatstrings
(...)
(VALUE val) // inc += 1 - num;
{
- val = rb_str_concat_literals(num, STACK_ADDR_FROM_TOP(num));
+ rb_num_t i = num - 1;
+
+ val = rb_str_resurrect(TOPN(i));
+ while (i-- > 0) {
+ const VALUE v = TOPN(i);
+ rb_str_append(val, v);
+ }
POPN(num);
}
/**
@c put
- @e push the result of to_s.
- @j to_s の結果をスタックにプッシュする。
+ @e to_str
+ @j to_str の結果をスタックにプッシュする。
*/
DEFINE_INSN
tostring
()
-(VALUE val, VALUE str)
+(VALUE val)
(VALUE val)
{
- VALUE rb_obj_as_string_result(VALUE str, VALUE obj);
- val = rb_obj_as_string_result(str, val);
-}
-
-/**
- @c put
- @e Freeze (dynamically) created strings. if debug_info is given, set it.
- @j (埋め込み)文字列を freeze する。もし、debug_info が与えられていれば、それを設定する。
- */
-DEFINE_INSN
-freezestring
-(VALUE debug_info)
-(VALUE str)
-(VALUE str)
-{
- vm_freezestring(str, debug_info);
+ val = rb_obj_as_string(val);
}
/**
@c put
- @e compile str to Regexp and push it.
- opt is the option for the Regexp.
+ @e to Regexp
@j 文字列 str を正規表現にコンパイルしてスタックにプッシュする。
コンパイル時,opt を正規表現のオプションとする。
*/
@@ -438,8 +402,11 @@ toregexp
(VALUE val) // inc += 1 - cnt;
{
VALUE rb_reg_new_ary(VALUE ary, int options);
- VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
- const VALUE ary = rb_ary_tmp_new_from_values(0, cnt, STACK_ADDR_FROM_TOP(cnt));
+ rb_num_t i;
+ const VALUE ary = rb_ary_tmp_new(cnt);
+ for (i = 0; i < cnt; i++) {
+ rb_ary_store(ary, cnt-i-1, TOPN(i));
+ }
POPN(cnt);
val = rb_reg_new_ary(ary, (int)opt);
rb_ary_clear(ary);
@@ -447,21 +414,7 @@ toregexp
/**
@c put
- @e intern str to Symbol and push it.
- @j 文字列 str をシンボルに変換してスタックにプッシュする。
- */
-DEFINE_INSN
-intern
-()
-(VALUE str)
-(VALUE sym)
-{
- sym = rb_str_intern(str);
-}
-
-/**
- @c put
- @e put new array initialized with num values on the stack.
+ @e put new array.
@j 新しい配列をスタック上の num 個の値で初期化して生成しプッシュする。
*/
DEFINE_INSN
@@ -470,7 +423,7 @@ newarray
(...)
(VALUE val) // inc += 1 - num;
{
- val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num));
+ val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
POPN(num);
}
@@ -490,14 +443,7 @@ duparray
/**
@c put
- @e if TOS is an array expand, expand it to num objects.
- if the number of the array is less than num, push nils to fill.
- if it is greater than num, exceeding elements are dropped.
- unless TOS is an array, push num - 1 nils.
- if flags is non-zero, push the array of the rest elements.
- flag: 0x01 - rest args array
- flag: 0x02 - for postarg
- flag: 0x04 - reverse?
+ @e expand array to num objects.
@j スタックトップのオブジェクトが配列であれば、それを展開する。
配列オブジェクトの要素数が num以下ならば、代わりに nil を積む。num以上なら、
num以上の要素は切り捨てる。
@@ -524,16 +470,31 @@ expandarray
DEFINE_INSN
concatarray
()
-(VALUE ary1, VALUE ary2)
+(VALUE ary1, VALUE ary2st)
(VALUE ary)
{
- ary = vm_concat_array(ary1, ary2);
+ const VALUE ary2 = ary2st;
+ VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a");
+ VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a");
+
+ if (NIL_P(tmp1)) {
+ tmp1 = rb_ary_new3(1, ary1);
+ }
+
+ if (NIL_P(tmp2)) {
+ tmp2 = rb_ary_new3(1, ary2);
+ }
+
+ if (tmp1 == ary1) {
+ tmp1 = rb_ary_dup(ary1);
+ }
+ ary = rb_ary_concat(tmp1, tmp2);
}
/**
@c put
- @e call to_a on array ary to splat
- @j splat のために配列 ary に対して to_a を呼び出す。
+ @e splat array
+ @j 配列 ary に対して to_a を呼び出す。
*/
DEFINE_INSN
splatarray
@@ -541,12 +502,19 @@ splatarray
(VALUE ary)
(VALUE obj)
{
- obj = vm_splat_array(flag, ary);
+ VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a");
+ if (NIL_P(tmp)) {
+ tmp = rb_ary_new3(1, ary);
+ }
+ else if (RTEST(flag)) {
+ tmp = rb_ary_dup(tmp);
+ }
+ obj = tmp;
}
/**
@c put
- @e put new Hash from n elements. n must be an even number.
+ @e put new Hash.
@j 新しいハッシュをスタックトップの n 個を初期値として生成する。
n はキーと値のペアなので 2 の倍数でなければならない。
*/
@@ -556,12 +524,18 @@ newhash
(...)
(VALUE val) // inc += 1 - num;
{
- RUBY_DTRACE_CREATE_HOOK(HASH, num);
+ rb_num_t i;
- val = rb_hash_new_with_size(num / 2);
+ if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+ RUBY_DTRACE_HASH_CREATE(num, rb_sourcefile(), rb_sourceline());
+ }
+
+ val = rb_hash_new();
- if (num) {
- rb_hash_bulk_insert(num, STACK_ADDR_FROM_TOP(num), val);
+ for (i = num; i > 0; i -= 2) {
+ const VALUE v = TOPN(i - 2);
+ const VALUE k = TOPN(i - 1);
+ rb_hash_aset(val, k, v);
}
POPN(num);
}
@@ -624,11 +598,12 @@ dupn
(...)
(...) // inc += n;
{
- void *dst = GET_SP();
- void *src = STACK_ADDR_FROM_TOP(n);
-
- INC_SP(n); /* alloca */
- MEMCPY(dst, src, VALUE, n);
+ rb_num_t i;
+ VALUE *sp = STACK_ADDR_FROM_TOP(n);
+ for (i = 0; i < n; i++) {
+ GET_SP()[i] = sp[i];
+ }
+ INC_SP(n);
}
@@ -648,28 +623,6 @@ 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 スタックキャッシングの状態を調整するために必要な命令。
*/
@@ -712,7 +665,7 @@ setn
/**
@c stack
- @e empty current stack
+ @e empt current stack
@j current stack を空にする。
*/
DEFINE_INSN
@@ -740,7 +693,105 @@ defined
(VALUE v)
(VALUE val)
{
- val = vm_defined(ec, GET_CFP(), op_type, obj, needstr, v);
+ 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;
+ }
+ }
}
/**
@@ -759,38 +810,62 @@ checkmatch
(VALUE target, VALUE pattern)
(VALUE result)
{
- result = vm_check_match(ec, target, pattern, flag);
-}
-
-/**
- @c setting
- @e check keywords are specified or not.
- @j キーワードが指定されているかどうかチェックする
- */
-DEFINE_INSN
-checkkeyword
-(lindex_t kw_bits_index, lindex_t keyword_index)
-()
-(VALUE ret)
-{
- ret = vm_check_keyword(kw_bits_index, keyword_index, GET_EP());
+ enum vm_check_match_type checkmatch_type =
+ (enum vm_check_match_type)(flag & VM_CHECKMATCH_TYPE_MASK);
+ result = Qfalse;
+
+ if (flag & VM_CHECKMATCH_ARRAY) {
+ int i;
+ for (i = 0; i < RARRAY_LEN(pattern); i++) {
+ if (RTEST(check_match(RARRAY_AREF(pattern, i), target, checkmatch_type))) {
+ result = Qtrue;
+ break;
+ }
+ }
+ }
+ else {
+ if (RTEST(check_match(pattern, target, checkmatch_type))) {
+ result = Qtrue;
+ }
+ }
}
/**
@c setting
- @e fire a coverage event (currently, this is used for line coverage and branch coverage)
- @j カバレッジイベントを trace する
+ @e trace
+ @j trace 用の命令。
*/
DEFINE_INSN
-tracecoverage
-(rb_num_t nf, VALUE data)
+trace
+(rb_num_t nf)
()
()
{
rb_event_flag_t flag = (rb_event_flag_t)nf;
- vm_dtrace(flag, ec);
- EXEC_EVENT_HOOK(ec, flag, GET_SELF(), 0, 0, 0 /* id and klass are resolved at callee */, data);
+ if (RUBY_DTRACE_METHOD_ENTRY_ENABLED() ||
+ RUBY_DTRACE_METHOD_RETURN_ENABLED() ||
+ RUBY_DTRACE_CMETHOD_ENTRY_ENABLED() ||
+ RUBY_DTRACE_CMETHOD_RETURN_ENABLED()) {
+
+ switch(flag) {
+ case RUBY_EVENT_CALL:
+ RUBY_DTRACE_METHOD_ENTRY_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_C_CALL:
+ RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_RETURN:
+ RUBY_DTRACE_METHOD_RETURN_HOOK(th, 0, 0);
+ break;
+ case RUBY_EVENT_C_RETURN:
+ RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, 0, 0);
+ break;
+ }
+ }
+
+ EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* id and klass are resolved at callee */,
+ (flag & (RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN)) ? TOPN(0) : Qundef);
}
/**********************************************************/
@@ -812,17 +887,91 @@ defineclass
(VALUE cbase, VALUE super)
(VALUE val)
{
- VALUE klass = vm_find_or_create_class_by_id(id, flags, cbase, super);
+ VALUE klass;
+ rb_vm_defineclass_type_t type = VM_DEFINECLASS_TYPE(flags);
+
+ switch (type) {
+ case VM_DEFINECLASS_TYPE_CLASS:
+ /* val is dummy. classdef returns class scope value */
+
+ 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));
+ }
- rb_iseq_check(class_iseq);
+ if (super == Qnil) {
+ super = rb_cObject;
+ }
+
+ vm_check_if_namespace(cbase);
+
+ /* find klass */
+ rb_autoload_load(cbase, id);
+ if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
+ /* already exist */
+ 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));
+ }
+
+ if (super != rb_cObject) {
+ VALUE tmp;
+ tmp = rb_class_real(RCLASS_SUPER(klass));
+
+ if (tmp != super) {
+ rb_raise(rb_eTypeError, "superclass mismatch for class %s",
+ rb_id2name(id));
+ }
+ }
+ }
+ else {
+ /* new class declaration */
+ klass = rb_define_class_id(id, super);
+ rb_set_class_path_string(klass, cbase, rb_id2str(id));
+ rb_const_set(cbase, id, klass);
+ rb_class_inherited(super, klass);
+ }
+ break;
+ case VM_DEFINECLASS_TYPE_SINGLETON_CLASS:
+ /* val is dummy. classdef returns class scope value */
+ /* super is dummy */
+ klass = rb_singleton_class(cbase);
+ break;
+ case VM_DEFINECLASS_TYPE_MODULE:
+ /* val is dummy. classdef returns class scope value */
+ /* super is dummy */
+
+ vm_check_if_namespace(cbase);
+
+ /* find klass */
+ if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
+ klass = VM_DEFINECLASS_SCOPED_P(flags) ?
+ 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));
+ }
+ }
+ else {
+ /* new module declaration */
+ klass = rb_define_module_id(id);
+ rb_set_class_path_string(klass, cbase, rb_id2str(id));
+ rb_const_set(cbase, id, klass);
+ }
+ break;
+ default:
+ rb_bug("unknown defineclass type: %d", (int)type);
+ }
+
+ COPY_CREF(class_iseq->cref_stack, vm_cref_push(th, klass, NOEX_PUBLIC, NULL));
/* enter scope */
- vm_push_frame(ec, class_iseq, VM_FRAME_MAGIC_CLASS | VM_ENV_FLAG_LOCAL, klass,
- GET_BLOCK_HANDLER(),
- (VALUE)vm_cref_push(ec, klass, NULL, FALSE),
- class_iseq->body->iseq_encoded, GET_SP(),
- class_iseq->body->local_table_size,
- class_iseq->body->stack_max);
+ 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);
RESTORE_REGS();
NEXT_INSN();
}
@@ -839,15 +988,15 @@ defineclass
*/
DEFINE_INSN
send
-(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
+(CALL_INFO ci)
(...)
(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- struct rb_calling_info calling;
-
- vm_caller_setup_arg_block(ec, reg_cfp, &calling, ci, blockiseq, FALSE);
- vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
- CALL_METHOD(&calling, ci, cc);
+ 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);
}
DEFINE_INSN
@@ -864,55 +1013,19 @@ opt_str_freeze
}
}
-DEFINE_INSN
-opt_str_uminus
-(VALUE str)
-()
-(VALUE val)
-{
- if (BASIC_OP_UNREDEFINED_P(BOP_UMINUS, STRING_REDEFINED_OP_FLAG)) {
- val = str;
- }
- else {
- val = rb_funcall(rb_str_resurrect(str), idUMinus, 0);
- }
-}
-
-DEFINE_INSN
-opt_newarray_max
-(rb_num_t num)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- val = vm_opt_newarray_max(num, STACK_ADDR_FROM_TOP(num));
- POPN(num);
-}
-
-DEFINE_INSN
-opt_newarray_min
-(rb_num_t num)
-(...)
-(VALUE val) // inc += 1 - num;
-{
- val = vm_opt_newarray_min(num, STACK_ADDR_FROM_TOP(num));
- POPN(num);
-}
-
/**
@c optimize
- @e Invoke method without block
- @j ブロックなしでメソッド呼び出しを行う。
+ @e Invoke method without block, splat
+ @j Invoke method without block, splat
*/
DEFINE_INSN
-opt_send_without_block
-(CALL_INFO ci, CALL_CACHE cc)
+opt_send_simple
+(CALL_INFO ci)
(...)
(VALUE val) // inc += -ci->orig_argc;
{
- struct rb_calling_info calling;
- calling.block_handler = VM_BLOCK_HANDLER_NONE;
- vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
- CALL_METHOD(&calling, ci, cc);
+ vm_search_method(ci, ci->recv = TOPN(ci->argc));
+ CALL_METHOD(ci);
}
/**
@@ -922,17 +1035,19 @@ opt_send_without_block
*/
DEFINE_INSN
invokesuper
-(CALL_INFO ci, CALL_CACHE cc, ISEQ blockiseq)
+(CALL_INFO ci)
(...)
(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- struct rb_calling_info calling;
- calling.argc = ci->orig_argc;
+ ci->argc = ci->orig_argc;
+ ci->blockptr = !(ci->flag & VM_CALL_ARGS_BLOCKARG) ? GET_BLOCK_PTR() : 0;
- vm_caller_setup_arg_block(ec, reg_cfp, &calling, ci, blockiseq, TRUE);
- calling.recv = GET_SELF();
- vm_search_super_method(ec, GET_CFP(), &calling, ci, cc);
- CALL_METHOD(&calling, ci, cc);
+ 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);
}
/**
@@ -946,12 +1061,10 @@ invokeblock
(...)
(VALUE val) // inc += 1 - ci->orig_argc;
{
- struct rb_calling_info calling;
- calling.argc = ci->orig_argc;
- calling.block_handler = VM_BLOCK_HANDLER_NONE;
- calling.recv = GET_SELF();
-
- val = vm_invoke_block(ec, GET_CFP(), &calling, ci);
+ ci->argc = ci->orig_argc;
+ ci->blockptr = 0;
+ ci->recv = GET_SELF();
+ val = vm_invoke_block(th, GET_CFP(), ci);
if (val == Qundef) {
RESTORE_REGS();
NEXT_INSN();
@@ -970,23 +1083,26 @@ leave
(VALUE val)
{
if (OPT_CHECKED_RUN) {
- const VALUE *const bp = vm_base_ptr(reg_cfp);
- if (reg_cfp->sp != bp) {
- vm_stack_consistency_error(ec, reg_cfp, bp);
+ if (reg_cfp->sp != vm_base_ptr(reg_cfp)) {
+ rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
+ VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, vm_base_ptr(reg_cfp)));
}
}
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
+
+ if (UNLIKELY(VM_FRAME_TYPE_FINISH_P(GET_CFP()))) {
+ vm_pop_frame(th);
- if (vm_pop_frame(ec, GET_CFP(), GET_EP())) {
#if OPT_CALL_THREADED_CODE
- rb_ec_thread_ptr(ec)->retval = val;
+ th->retval = val;
return 0;
#else
return val;
#endif
}
else {
+ vm_pop_frame(th);
RESTORE_REGS();
}
}
@@ -1006,8 +1122,8 @@ throw
(VALUE throwobj)
(VALUE val)
{
- RUBY_VM_CHECK_INTS(ec);
- val = vm_throw(ec, GET_CFP(), throw_state, throwobj);
+ RUBY_VM_CHECK_INTS(th);
+ val = vm_throw(th, GET_CFP(), throw_state, throwobj);
THROW_EXCEPTION(val);
/* unreachable */
}
@@ -1027,7 +1143,7 @@ jump
()
()
{
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
@@ -1043,7 +1159,7 @@ branchif
()
{
if (RTEST(val)) {
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
@@ -1060,41 +1176,7 @@ branchunless
()
{
if (!RTEST(val)) {
- RUBY_VM_CHECK_INTS(ec);
- JUMP(dst);
- }
-}
-
-/**
- @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(ec);
- JUMP(dst);
- }
-}
-
-/**
- @c jump
- @e if val is type, set PC to (PC + dst).
- @j もし val が type ならば、PC を (PC + dst) にする。
- */
-DEFINE_INSN
-branchiftype
-(rb_num_t type, OFFSET dst)
-(VALUE val)
-()
-{
- if (TYPE(val) == (int)type) {
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
@@ -1115,10 +1197,14 @@ getinlinecache
()
(VALUE val)
{
- val = vm_ic_hit_p(ic, GET_EP());
- if (val != Qnil) {
+ if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE()) {
+ val = ic->ic_value.value;
JUMP(dst);
}
+ else {
+ /* none */
+ val = Qnil;
+ }
}
/**
@@ -1132,7 +1218,12 @@ setinlinecache
(VALUE val)
(VALUE val)
{
- vm_ic_update(ic, val, GET_EP());
+ if (ic->ic_value.value == Qundef) {
+ rb_iseq_add_mark_object(GET_ISEQ(), val);
+ }
+ ic->ic_value.value = val;
+ ic->ic_serial = GET_GLOBAL_CONSTANT_STATE() - ruby_vm_const_missing_count;
+ ruby_vm_const_missing_count = 0;
}
/**
@@ -1146,7 +1237,30 @@ once
()
(VALUE val)
{
- val = vm_once_dispatch(ec, iseq, ic);
+ 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.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 {
+ /* waiting for finish */
+ RUBY_VM_CHECK_INTS(th);
+ rb_thread_schedule();
+ goto retry;
+ }
}
/**
@@ -1160,10 +1274,33 @@ opt_case_dispatch
(..., VALUE key)
() // inc += -1;
{
- OFFSET dst = vm_case_dispatch(hash, else_offset, key);
-
- if (dst) {
- JUMP(dst);
+ switch(TYPE(key)) {
+ case T_FLOAT: {
+ double ival;
+ if (modf(RFLOAT_VALUE(key), &ival) == 0.0) {
+ key = FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
+ }
+ }
+ case T_SYMBOL: /* fall through */
+ case T_FIXNUM:
+ case T_BIGNUM:
+ case T_STRING:
+ if (BASIC_OP_UNREDEFINED_P(BOP_EQQ,
+ SYMBOL_REDEFINED_OP_FLAG |
+ FIXNUM_REDEFINED_OP_FLAG |
+ BIGNUM_REDEFINED_OP_FLAG |
+ STRING_REDEFINED_OP_FLAG)) {
+ st_data_t val;
+ if (st_lookup(RHASH_TBL_RAW(hash), key, &val)) {
+ JUMP(FIX2INT((VALUE)val));
+ }
+ else {
+ JUMP(else_offset);
+ }
+ break;
+ }
+ default:
+ break;
}
}
@@ -1176,14 +1313,56 @@ opt_case_dispatch
*/
DEFINE_INSN
opt_plus
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_plus(recv, obj);
-
- if (val == Qundef) {
- /* other */
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS,FIXNUM_REDEFINED_OP_FLAG)) {
+ /* fixnum + fixnum */
+#ifndef LONG_LONG_VALUE
+ val = (recv + (obj & (~1)));
+ if ((~(recv ^ obj) & (recv ^ val)) &
+ ((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
+ val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
+ rb_int2big(FIX2LONG(obj)));
+ }
+#else
+ long a, b, c;
+ a = FIX2LONG(recv);
+ b = FIX2LONG(obj);
+ c = a + b;
+ if (FIXABLE(c)) {
+ val = LONG2FIX(c);
+ }
+ else {
+ val = rb_big_plus(rb_int2big(a), rb_int2big(b));
+ }
+#endif
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
+ }
+ else if (RBASIC_CLASS(recv) == rb_cString && RBASIC_CLASS(obj) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, STRING_REDEFINED_OP_FLAG)) {
+ val = rb_str_plus(recv, obj);
+ }
+ else if (RBASIC_CLASS(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_PLUS, ARRAY_REDEFINED_OP_FLAG)) {
+ val = rb_ary_plus(recv, obj);
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1197,14 +1376,41 @@ opt_plus
*/
DEFINE_INSN
opt_minus
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_minus(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FIXNUM_REDEFINED_OP_FLAG)) {
+ long a, b, c;
- if (val == Qundef) {
+ a = FIX2LONG(recv);
+ b = FIX2LONG(obj);
+ c = a - b;
+
+ if (FIXABLE(c)) {
+ val = LONG2FIX(c);
+ }
+ else {
+ val = rb_big_minus(rb_int2big(a), rb_int2big(b));
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
/* other */
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1218,14 +1424,43 @@ opt_minus
*/
DEFINE_INSN
opt_mult
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_mult(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FIXNUM_REDEFINED_OP_FLAG)) {
+ long a, b;
- if (val == Qundef) {
- /* other */
+ a = FIX2LONG(recv);
+ if (a == 0) {
+ val = recv;
+ }
+ else {
+ b = FIX2LONG(obj);
+ if (MUL_OVERFLOW_FIXNUM_P(a, b)) {
+ val = rb_big_mul(rb_int2big(a), rb_int2big(b));
+ }
+ else {
+ val = LONG2FIX(a * b);
+ }
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1239,14 +1474,56 @@ opt_mult
*/
DEFINE_INSN
opt_div
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_div(recv, obj);
-
- if (val == Qundef) {
- /* other */
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_DIV, FIXNUM_REDEFINED_OP_FLAG)) {
+ long x, y, div;
+
+ x = FIX2LONG(recv);
+ y = FIX2LONG(obj);
+ {
+ /* copied from numeric.c#fixdivmod */
+ long mod;
+ if (y == 0)
+ goto INSN_LABEL(normal_dispatch);
+ if (y < 0) {
+ if (x < 0)
+ div = -x / -y;
+ else
+ div = -(x / -y);
+ }
+ else {
+ if (x < 0)
+ div = -(-x / y);
+ else
+ div = x / y;
+ }
+ mod = x - div * y;
+ if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
+ mod += y;
+ div -= 1;
+ }
+ }
+ val = LONG2NUM(div);
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1260,14 +1537,60 @@ opt_div
*/
DEFINE_INSN
opt_mod
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_mod(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FIXNUM_REDEFINED_OP_FLAG )) {
+ long x, y;
- if (val == Qundef) {
- /* other */
+ x = FIX2LONG(recv);
+ y = FIX2LONG(obj);
+ if (x > 0 && y > 0) {
+ val = LONG2FIX(x % y);
+ }
+ else {
+ /* copied from numeric.c#fixdivmod */
+ long div, mod;
+
+ if (y == 0)
+ rb_num_zerodiv();
+ if (y < 0) {
+ if (x < 0)
+ div = -x / -y;
+ else
+ div = -(x / -y);
+ }
+ else {
+ if (x < 0)
+ div = -(-x / y);
+ else
+ div = x / y;
+ }
+ mod = x - div * y;
+ if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
+ mod += y;
+ div -= 1;
+ }
+ val = LONG2FIX(mod);
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
+ val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1281,11 +1604,11 @@ opt_mod
*/
DEFINE_INSN
opt_eq
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = opt_eq_func(recv, obj, ci, cc);
+ val = opt_eq_func(recv, obj, ci);
if (val == Qundef) {
/* other */
@@ -1302,11 +1625,21 @@ opt_eq
*/
DEFINE_INSN
opt_neq
-(CALL_INFO ci, CALL_CACHE cc, CALL_INFO ci_eq, CALL_CACHE cc_eq)
+(CALL_INFO ci, CALL_INFO ci_eq)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_neq(ci, cc, ci_eq, cc_eq, recv, obj);
+ extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
+ vm_search_method(ci, recv);
+ val = Qundef;
+
+ if (check_cfunc(ci->me, rb_obj_not_equal)) {
+ val = opt_eq_func(recv, obj, ci_eq);
+
+ if (val != Qundef) {
+ val = RTEST(val) ? Qfalse : Qtrue;
+ }
+ }
if (val == Qundef) {
/* other */
@@ -1323,14 +1656,37 @@ opt_neq
*/
DEFINE_INSN
opt_lt
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_lt(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FIXNUM_REDEFINED_OP_FLAG)) {
+ SIGNED_VALUE a = recv, b = obj;
- if (val == Qundef) {
- /* other */
+ if (a < b) {
+ val = Qtrue;
+ }
+ else {
+ val = Qfalse;
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) < RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = double_cmp_lt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1344,13 +1700,27 @@ opt_lt
*/
DEFINE_INSN
opt_le
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_le(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LE, FIXNUM_REDEFINED_OP_FLAG)) {
+ SIGNED_VALUE a = recv, b = obj;
- if (val == Qundef) {
+ if (a <= b) {
+ val = Qtrue;
+ }
+ else {
+ val = Qfalse;
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_LE, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) <= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
+ else {
/* other */
PUSH(recv);
PUSH(obj);
@@ -1365,14 +1735,37 @@ opt_le
*/
DEFINE_INSN
opt_gt
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_gt(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FIXNUM_REDEFINED_OP_FLAG)) {
+ SIGNED_VALUE a = recv, b = obj;
- if (val == Qundef) {
- /* other */
+ if (a > b) {
+ val = Qtrue;
+ }
+ else {
+ val = Qfalse;
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) > RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
+ else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
+ if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
+ BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
+ val = double_cmp_gt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1386,14 +1779,27 @@ opt_gt
*/
DEFINE_INSN
opt_ge
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_ge(recv, obj);
+ if (FIXNUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GE, FIXNUM_REDEFINED_OP_FLAG)) {
+ SIGNED_VALUE a = recv, b = obj;
- if (val == Qundef) {
- /* other */
+ if (a >= b) {
+ val = Qtrue;
+ }
+ else {
+ val = Qfalse;
+ }
+ }
+ else if (FLONUM_2_P(recv, obj) &&
+ BASIC_OP_UNREDEFINED_P(BOP_GE, FLOAT_REDEFINED_OP_FLAG)) {
+ /* flonum is not NaN */
+ val = RFLOAT_VALUE(recv) >= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
+ }
+ else {
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1407,14 +1813,25 @@ opt_ge
*/
DEFINE_INSN
opt_ltlt
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_ltlt(recv, obj);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
+ val = rb_str_concat(recv, obj);
+ }
+ else if (RBASIC_CLASS(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_LTLT, ARRAY_REDEFINED_OP_FLAG)) {
+ val = rb_ary_push(recv, obj);
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1428,14 +1845,23 @@ opt_ltlt
*/
DEFINE_INSN
opt_aref
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_aref(recv, obj);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_AREF, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
+ val = rb_ary_entry(recv, FIX2LONG(obj));
+ }
+ else if (RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
+ val = rb_hash_aref(recv, obj);
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
CALL_SIMPLE_METHOD(recv);
@@ -1449,14 +1875,25 @@ opt_aref
*/
DEFINE_INSN
opt_aset
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv, VALUE obj, VALUE set)
(VALUE val)
{
- val = vm_opt_aset(recv, obj, set);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_ASET, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
+ rb_ary_store(recv, FIX2LONG(obj), set);
+ val = set;
+ }
+ else if (RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
+ rb_hash_aset(recv, obj, set);
+ val = set;
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
PUSH(obj);
PUSH(set);
@@ -1471,17 +1908,14 @@ opt_aset
*/
DEFINE_INSN
opt_aset_with
-(CALL_INFO ci, CALL_CACHE cc, VALUE key)
+(CALL_INFO ci, VALUE key)
(VALUE recv, VALUE val)
(VALUE val)
{
- VALUE tmp = vm_opt_aset_with(recv, key, val);
-
- if (tmp != Qundef) {
- val = tmp;
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
+ rb_hash_aset(recv, key, val);
}
else {
- /* other */
PUSH(recv);
PUSH(rb_str_resurrect(key));
PUSH(val);
@@ -1496,14 +1930,14 @@ opt_aset_with
*/
DEFINE_INSN
opt_aref_with
-(CALL_INFO ci, CALL_CACHE cc, VALUE key)
+(CALL_INFO ci, VALUE key)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_aref_with(recv, key);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
+ val = rb_hash_aref(recv, key);
+ }
+ else {
PUSH(recv);
PUSH(rb_str_resurrect(key));
CALL_SIMPLE_METHOD(recv);
@@ -1517,14 +1951,29 @@ opt_aref_with
*/
DEFINE_INSN
opt_length
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_length(recv, BOP_LENGTH);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, STRING_REDEFINED_OP_FLAG)) {
+ val = rb_str_length(recv);
+ }
+ else if (RBASIC_CLASS(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, ARRAY_REDEFINED_OP_FLAG)) {
+ val = LONG2NUM(RARRAY_LEN(recv));
+ }
+ else if (RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_LENGTH, HASH_REDEFINED_OP_FLAG)) {
+ val = INT2FIX(RHASH_SIZE(recv));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
CALL_SIMPLE_METHOD(recv);
}
@@ -1537,14 +1986,29 @@ opt_length
*/
DEFINE_INSN
opt_size
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_length(recv, BOP_SIZE);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, STRING_REDEFINED_OP_FLAG)) {
+ val = rb_str_length(recv);
+ }
+ else if (RBASIC_CLASS(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, ARRAY_REDEFINED_OP_FLAG)) {
+ val = LONG2NUM(RARRAY_LEN(recv));
+ }
+ else if (RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_SIZE, HASH_REDEFINED_OP_FLAG)) {
+ val = INT2FIX(RHASH_SIZE(recv));
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
CALL_SIMPLE_METHOD(recv);
}
@@ -1557,14 +2021,32 @@ opt_size
*/
DEFINE_INSN
opt_empty_p
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_empty_p(recv);
-
- if (val == Qundef) {
- /* other */
+ if (!SPECIAL_CONST_P(recv)) {
+ if (RBASIC_CLASS(recv) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, STRING_REDEFINED_OP_FLAG)) {
+ if (RSTRING_LEN(recv) == 0) val = Qtrue;
+ else val = Qfalse;
+ }
+ else if (RBASIC_CLASS(recv) == rb_cArray &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, ARRAY_REDEFINED_OP_FLAG)) {
+ if (RARRAY_LEN(recv) == 0) val = Qtrue;
+ else val = Qfalse;
+ }
+ else if (RBASIC_CLASS(recv) == rb_cHash &&
+ BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, HASH_REDEFINED_OP_FLAG)) {
+ if (RHASH_EMPTY_P(recv)) val = Qtrue;
+ else val = Qfalse;
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
CALL_SIMPLE_METHOD(recv);
}
@@ -1577,14 +2059,41 @@ opt_empty_p
*/
DEFINE_INSN
opt_succ
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_succ(recv);
-
- if (val == Qundef) {
- /* other */
+ if (SPECIAL_CONST_P(recv)) {
+ if (FIXNUM_P(recv) &&
+ BASIC_OP_UNREDEFINED_P(BOP_SUCC, FIXNUM_REDEFINED_OP_FLAG)) {
+ const VALUE obj = INT2FIX(1);
+ /* fixnum + INT2FIX(1) */
+ val = (recv + (obj & (~1)));
+ if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) {
+ val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
+ rb_int2big(FIX2LONG(obj)));
+ }
+ }
+ else {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ else {
+ if (RBASIC_CLASS(recv) == rb_cString &&
+ 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
+ {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ if (0) {
+ INSN_LABEL(normal_dispatch):
PUSH(recv);
CALL_SIMPLE_METHOD(recv);
}
@@ -1597,14 +2106,17 @@ opt_succ
*/
DEFINE_INSN
opt_not
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_not(ci, cc, recv);
+ extern VALUE rb_obj_not(VALUE obj);
+ vm_search_method(ci, recv);
- if (val == Qundef) {
- /* other */
+ if (check_cfunc(ci->me, rb_obj_not)) {
+ val = RTEST(recv) ? Qfalse : Qtrue;
+ }
+ else {
PUSH(recv);
CALL_SIMPLE_METHOD(recv);
}
@@ -1618,11 +2130,16 @@ opt_not
*/
DEFINE_INSN
opt_regexpmatch1
-(VALUE recv)
+(VALUE r)
(VALUE obj)
(VALUE val)
{
- val = vm_opt_regexpmatch1(recv, obj);
+ if (BASIC_OP_UNREDEFINED_P(BOP_MATCH, REGEXP_REDEFINED_OP_FLAG)) {
+ val = rb_reg_match(r, obj);
+ }
+ else {
+ val = rb_funcall(r, idEqTilde, 1, obj);
+ }
}
/**
@@ -1632,14 +2149,15 @@ opt_regexpmatch1
*/
DEFINE_INSN
opt_regexpmatch2
-(CALL_INFO ci, CALL_CACHE cc)
+(CALL_INFO ci)
(VALUE obj2, VALUE obj1)
(VALUE val)
{
- val = vm_opt_regexpmatch2(obj2, obj1);
-
- if (val == Qundef) {
- /* other */
+ if (CLASS_OF(obj2) == rb_cString &&
+ BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
+ val = rb_reg_match(obj1, obj2);
+ }
+ else {
PUSH(obj2);
PUSH(obj1);
CALL_SIMPLE_METHOD(obj2);
@@ -1657,11 +2175,11 @@ opt_call_c_function
()
()
{
- reg_cfp = (funcptr)(ec, reg_cfp);
+ reg_cfp = (funcptr)(th, reg_cfp);
if (reg_cfp == 0) {
- VALUE err = ec->errinfo;
- ec->errinfo = Qnil;
+ VALUE err = th->errinfo;
+ th->errinfo = Qnil;
THROW_EXCEPTION(err);
}
diff --git a/internal.h b/internal.h
index 2e2fa7ba75..1a9be71c31 100644
--- a/internal.h
+++ b/internal.h
@@ -12,10 +12,6 @@
#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
@@ -23,37 +19,33 @@ extern "C" {
#endif
#endif
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#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 __bool_true_false_are_defined
-# ifndef __cplusplus
-# undef bool
-# undef false
-# undef true
-# define bool signed char
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
-# endif
+#ifndef __has_attribute
+# define __has_attribute(x) 0
#endif
-/* The most significant bit of the lower part of half-long integer.
- * If sizeof(long) == 4, this is 0x8000.
- * If sizeof(long) == 8, this is 0x80000000.
- */
-#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2))
-
-#define LIKELY(x) RB_LIKELY(x)
-#define UNLIKELY(x) RB_UNLIKELY(x)
-
-#ifndef MAYBE_UNUSED
-# define MAYBE_UNUSED(x) x
+#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
-#ifndef WARN_UNUSED_RESULT
-# define WARN_UNUSED_RESULT(x) x
+#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
@@ -71,19 +63,13 @@ extern "C" {
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
-#ifndef __has_feature
-# define __has_feature(x) 0
-#endif
-
-#ifndef __has_extension
-# define __has_extension __has_feature
-#endif
+#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
-#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 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))))
#define SIGNED_INTEGER_TYPE_P(int_type) (0 > ((int_type)0)-1)
#define SIGNED_INTEGER_MAX(sint_type) \
@@ -102,41 +88,15 @@ extern "C" {
#endif
#define TIMET_MAX_PLUS_ONE (2*(double)(TIMET_MAX/2+1))
-#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
-#define MUL_OVERFLOW_P(a, b) \
- __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
-#elif defined HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
-#define MUL_OVERFLOW_P(a, b) \
- ({__typeof__(a) c; __builtin_mul_overflow((a), (b), &c);})
-#endif
-
#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
(a) == 0 ? 0 : \
(a) == -1 ? (b) < -(max) : \
(a) > 0 ? \
((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \
((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b)))
-
-#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
-/* __builtin_mul_overflow_p can take bitfield */
-/* and GCC permits bitfields for integers other than int */
-#define MUL_OVERFLOW_FIXNUM_P(a, b) ({ \
- struct { long fixnum : SIZEOF_LONG * CHAR_BIT - 1; } c; \
- __builtin_mul_overflow_p((a), (b), c.fixnum); \
-})
-#else
#define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
-#endif
-
-#ifdef MUL_OVERFLOW_P
-#define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
-#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
-#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b)
-#else
-#define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
-#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
-#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
-#endif
+#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
+#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
#ifndef swap16
# ifdef HAVE_BUILTIN___BUILTIN_BSWAP16
@@ -181,20 +141,20 @@ extern "C" {
# endif
#endif
-static inline unsigned int
+static inline int
nlz_int(unsigned int x)
{
#if defined(HAVE_BUILTIN___BUILTIN_CLZ)
if (x == 0) return SIZEOF_INT * CHAR_BIT;
- return (unsigned int)__builtin_clz(x);
+ return __builtin_clz(x);
#else
unsigned int y;
# if 64 < SIZEOF_INT * CHAR_BIT
- unsigned int n = 128;
+ int n = 128;
# elif 32 < SIZEOF_INT * CHAR_BIT
- unsigned int n = 64;
+ int n = 64;
# else
- unsigned int n = 32;
+ int n = 32;
# endif
# if 64 < SIZEOF_INT * CHAR_BIT
y = x >> 64; if (y) {n -= 64; x = y;}
@@ -207,24 +167,24 @@ nlz_int(unsigned int x)
y = x >> 4; if (y) {n -= 4; x = y;}
y = x >> 2; if (y) {n -= 2; x = y;}
y = x >> 1; if (y) {return n - 2;}
- return (unsigned int)(n - x);
+ return (int)(n - x);
#endif
}
-static inline unsigned int
+static inline int
nlz_long(unsigned long x)
{
#if defined(HAVE_BUILTIN___BUILTIN_CLZL)
if (x == 0) return SIZEOF_LONG * CHAR_BIT;
- return (unsigned int)__builtin_clzl(x);
+ return __builtin_clzl(x);
#else
unsigned long y;
# if 64 < SIZEOF_LONG * CHAR_BIT
- unsigned int n = 128;
+ int n = 128;
# elif 32 < SIZEOF_LONG * CHAR_BIT
- unsigned int n = 64;
+ int n = 64;
# else
- unsigned int n = 32;
+ int n = 32;
# endif
# if 64 < SIZEOF_LONG * CHAR_BIT
y = x >> 64; if (y) {n -= 64; x = y;}
@@ -237,25 +197,25 @@ nlz_long(unsigned long x)
y = x >> 4; if (y) {n -= 4; x = y;}
y = x >> 2; if (y) {n -= 2; x = y;}
y = x >> 1; if (y) {return n - 2;}
- return (unsigned int)(n - x);
+ return (int)(n - x);
#endif
}
#ifdef HAVE_LONG_LONG
-static inline unsigned int
+static inline int
nlz_long_long(unsigned LONG_LONG x)
{
#if defined(HAVE_BUILTIN___BUILTIN_CLZLL)
if (x == 0) return SIZEOF_LONG_LONG * CHAR_BIT;
- return (unsigned int)__builtin_clzll(x);
+ return __builtin_clzll(x);
#else
unsigned LONG_LONG y;
# if 64 < SIZEOF_LONG_LONG * CHAR_BIT
- unsigned int n = 128;
+ int n = 128;
# elif 32 < SIZEOF_LONG_LONG * CHAR_BIT
- unsigned int n = 64;
+ int n = 64;
# else
- unsigned int n = 32;
+ int n = 32;
# endif
# if 64 < SIZEOF_LONG_LONG * CHAR_BIT
y = x >> 64; if (y) {n -= 64; x = y;}
@@ -268,17 +228,17 @@ nlz_long_long(unsigned LONG_LONG x)
y = x >> 4; if (y) {n -= 4; x = y;}
y = x >> 2; if (y) {n -= 2; x = y;}
y = x >> 1; if (y) {return n - 2;}
- return (unsigned int)(n - x);
+ return (int)(n - x);
#endif
}
#endif
#ifdef HAVE_UINT128_T
-static inline unsigned int
+static inline int
nlz_int128(uint128_t x)
{
uint128_t y;
- unsigned int n = 128;
+ int n = 128;
y = x >> 64; if (y) {n -= 64; x = y;}
y = x >> 32; if (y) {n -= 32; x = y;}
y = x >> 16; if (y) {n -= 16; x = y;}
@@ -286,247 +246,73 @@ nlz_int128(uint128_t x)
y = x >> 4; if (y) {n -= 4; x = y;}
y = x >> 2; if (y) {n -= 2; x = y;}
y = x >> 1; if (y) {return n - 2;}
- return (unsigned int)(n - x);
-}
-#endif
-
-static inline unsigned int
-nlz_intptr(uintptr_t x)
-{
-#if SIZEOF_VOIDP == 8
- return nlz_long_long(x);
-#elif SIZEOF_VOIDP == 4
- return nlz_int(x);
-#endif
-}
-
-static inline unsigned int
-rb_popcount32(uint32_t x)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_POPCOUNT
- return (unsigned int)__builtin_popcount(x);
-#else
- x = (x & 0x55555555) + (x >> 1 & 0x55555555);
- x = (x & 0x33333333) + (x >> 2 & 0x33333333);
- x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f);
- x = (x & 0x001f001f) + (x >> 8 & 0x001f001f);
- return (x & 0x0000003f) + (x >>16 & 0x0000003f);
-#endif
-}
-
-static inline int
-rb_popcount64(uint64_t x)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_POPCOUNT
- return __builtin_popcountll(x);
-#else
- x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555);
- x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333);
- x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707);
- x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f);
- x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f);
- return (x & 0x7f) + (x >>32 & 0x7f);
-#endif
-}
-
-static inline int
-rb_popcount_intptr(uintptr_t x)
-{
-#if SIZEOF_VOIDP == 8
- return rb_popcount64(x);
-#elif SIZEOF_VOIDP == 4
- return rb_popcount32(x);
-#endif
-}
-
-static inline int
-ntz_int32(uint32_t x)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_CTZ
- return __builtin_ctz(x);
-#else
- return rb_popcount32((~x) & (x-1));
-#endif
-}
-
-static inline int
-ntz_int64(uint64_t x)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_CTZLL
- return __builtin_ctzll(x);
-#else
- return rb_popcount64((~x) & (x-1));
-#endif
-}
-
-static inline int
-ntz_intptr(uintptr_t x)
-{
-#if SIZEOF_VOIDP == 8
- return ntz_int64(x);
-#elif SIZEOF_VOIDP == 4
- return ntz_int32(x);
-#endif
-}
-
-#if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
-# define DLONG LONG_LONG
-# define DL2NUM(x) LL2NUM(x)
-#elif defined(HAVE_INT128_T)
-# define DLONG int128_t
-# define DL2NUM(x) (RB_FIXABLE(x) ? LONG2FIX(x) : rb_int128t2big(x))
-VALUE rb_int128t2big(int128_t n);
-#endif
-
-static inline long
-rb_overflowed_fix_to_int(long x)
-{
- return (long)((unsigned long)(x >> 1) ^ (1LU << (SIZEOF_LONG * CHAR_BIT - 1)));
-}
-
-static inline VALUE
-rb_fix_plus_fix(VALUE x, VALUE y)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
- long lz;
- /* NOTE
- * (1) `LONG2FIX(FIX2LONG(x)+FIX2LONG(y))`
- + = `((lx*2+1)/2 + (ly*2+1)/2)*2+1`
- + = `lx*2 + ly*2 + 1`
- + = `(lx*2+1) + (ly*2+1) - 1`
- + = `x + y - 1`
- * (2) Fixnum's LSB is always 1.
- * It means you can always run `x - 1` without overflow.
- * (3) Of course `z = x + (y-1)` may overflow.
- * At that time true value is
- * * positive: 0b0 1xxx...1, and z = 0b1xxx...1
- * * nevative: 0b1 0xxx...1, and z = 0b0xxx...1
- * To convert this true value to long,
- * (a) Use arithmetic shift
- * * positive: 0b11xxx...
- * * negative: 0b00xxx...
- * (b) invert MSB
- * * positive: 0b01xxx...
- * * negative: 0b10xxx...
- */
- if (__builtin_add_overflow((long)x, (long)y-1, &lz)) {
- return rb_int2big(rb_overflowed_fix_to_int(lz));
- }
- else {
- return (VALUE)lz;
- }
-#else
- long lz = FIX2LONG(x) + FIX2LONG(y);
- return LONG2NUM(lz);
-#endif
-}
-
-static inline VALUE
-rb_fix_minus_fix(VALUE x, VALUE y)
-{
-#ifdef HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
- long lz;
- if (__builtin_sub_overflow((long)x, (long)y-1, &lz)) {
- return rb_int2big(rb_overflowed_fix_to_int(lz));
- }
- else {
- return (VALUE)lz;
- }
-#else
- long lz = FIX2LONG(x) - FIX2LONG(y);
- return LONG2NUM(lz);
-#endif
+ return (int)(n - x);
}
-
-/* arguments must be Fixnum */
-static inline VALUE
-rb_fix_mul_fix(VALUE x, VALUE y)
-{
- long lx = FIX2LONG(x);
- long ly = FIX2LONG(y);
-#ifdef DLONG
- return DL2NUM((DLONG)lx * (DLONG)ly);
-#else
- if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) {
- return rb_big_mul(rb_int2big(lx), rb_int2big(ly));
- }
- else {
- return LONG2FIX(lx * ly);
- }
#endif
-}
-
-/*
- * This behaves different from C99 for negative arguments.
- * Note that div may overflow fixnum.
- */
-static inline void
-rb_fix_divmod_fix(VALUE a, VALUE b, VALUE *divp, VALUE *modp)
-{
- /* assume / and % comply C99.
- * ldiv(3) won't be inlined by GCC and clang.
- * I expect / and % are compiled as single idiv.
- */
- long x = FIX2LONG(a);
- long y = FIX2LONG(b);
- long div, mod;
- if (x == FIXNUM_MIN && y == -1) {
- if (divp) *divp = LONG2NUM(-FIXNUM_MIN);
- if (modp) *modp = LONG2FIX(0);
- return;
- }
- div = x / y;
- mod = x % y;
- if (y > 0 ? mod < 0 : mod > 0) {
- mod += y;
- div -= 1;
- }
- if (divp) *divp = LONG2FIX(div);
- if (modp) *modp = LONG2FIX(mod);
-}
-
-/* div() for Ruby
- * This behaves different from C99 for negative arguments.
- */
-static inline VALUE
-rb_fix_div_fix(VALUE x, VALUE y)
-{
- VALUE div;
- rb_fix_divmod_fix(x, y, &div, NULL);
- return div;
-}
-
-/* mod() for Ruby
- * This behaves different from C99 for negative arguments.
- */
-static inline VALUE
-rb_fix_mod_fix(VALUE x, VALUE y)
-{
- VALUE mod;
- rb_fix_divmod_fix(x, y, NULL, &mod);
- return mod;
-}
#if defined(HAVE_UINT128_T)
# define bit_length(x) \
- (unsigned int) \
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)) : \
SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
#elif defined(HAVE_LONG_LONG)
# define bit_length(x) \
- (unsigned int) \
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)))
#else
# define bit_length(x) \
- (unsigned int) \
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)))
#endif
+struct rb_deprecated_classext_struct {
+ char conflict[sizeof(VALUE) * 3];
+};
+
+struct rb_subclass_entry;
+typedef struct rb_subclass_entry rb_subclass_entry_t;
+
+struct rb_subclass_entry {
+ VALUE klass;
+ rb_subclass_entry_t *next;
+};
+
+#if defined(HAVE_LONG_LONG)
+typedef unsigned LONG_LONG rb_serial_t;
+#define SERIALT2NUM ULL2NUM
+#elif defined(HAVE_UINT64_T)
+typedef uint64_t rb_serial_t;
+#define SERIALT2NUM SIZET2NUM
+#else
+typedef unsigned long rb_serial_t;
+#define SERIALT2NUM ULONG2NUM
+#endif
+
+struct rb_classext_struct {
+ struct st_table *iv_index_tbl;
+ struct st_table *iv_tbl;
+ struct st_table *const_tbl;
+ rb_subclass_entry_t *subclasses;
+ rb_subclass_entry_t **parent_subclasses;
+ /**
+ * In the case that this is an `ICLASS`, `module_subclasses` points to the link
+ * in the module's `subclasses` list that indicates that the klass has been
+ * included. Hopefully that makes sense.
+ */
+ rb_subclass_entry_t **module_subclasses;
+ rb_serial_t class_serial;
+ VALUE origin;
+ VALUE refined_class;
+ rb_alloc_func_t allocator;
+};
+
+struct method_table_wrapper {
+ st_table *tbl;
+ size_t serial;
+};
+
#ifndef BDIGIT
# if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
# define BDIGIT unsigned int
@@ -600,7 +386,7 @@ struct RBignum {
BDIGIT ary[BIGNUM_EMBED_LEN_MAX];
} as;
};
-#define BIGNUM_SIGN_BIT ((VALUE)FL_USER1)
+#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) \
@@ -608,15 +394,14 @@ struct RBignum {
: (RBASIC(b)->flags &= ~BIGNUM_SIGN_BIT))
#define BIGNUM_POSITIVE_P(b) BIGNUM_SIGN(b)
#define BIGNUM_NEGATIVE_P(b) (!BIGNUM_SIGN(b))
-#define BIGNUM_NEGATE(b) (RBASIC(b)->flags ^= BIGNUM_SIGN_BIT)
-#define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
-#define BIGNUM_EMBED_LEN_MASK ((VALUE)(FL_USER5|FL_USER4|FL_USER3))
+#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) ? \
- (size_t)((RBASIC(b)->flags >> BIGNUM_EMBED_LEN_SHIFT) & \
- (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT)) : \
+ (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) \
@@ -634,8 +419,12 @@ struct RRational {
};
#define RRATIONAL(obj) (R_CAST(RRational)(obj))
-#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 RSymbol {
+ struct RBasic basic;
+ VALUE fstr;
+ ID type;
+};
struct RFloat {
struct RBasic basic;
@@ -654,7 +443,7 @@ struct RComplex {
#ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
#undef RCOMPLEX_SET_REAL
-#undef RCOMPLEX_SET_IMAG
+#undef RCOMPLEX_SET_REAL
#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
@@ -674,140 +463,31 @@ struct RHash {
#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 ? RHASH(h)->ntbl->num_entries : (st_index_t)0)
-#endif
-
-/* missing/setproctitle.c */
-#ifndef HAVE_SETPROCTITLE
-extern void ruby_init_setproctitle(int argc, char *argv[]);
+#define RHASH_SIZE(h) (RHASH(h)->ntbl ? (st_index_t)RHASH(h)->ntbl->num_entries : 0)
#endif
-#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
-};
-
-struct RStruct {
- struct RBasic basic;
- union {
- struct {
- long len;
- const VALUE *ptr;
- } heap;
- const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
- } as;
-};
-
-#undef RSTRUCT_LEN
-#undef RSTRUCT_PTR
-#undef RSTRUCT_SET
-#undef RSTRUCT_GET
-#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) 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 RSTRUCT(obj) (R_CAST(RStruct)(obj))
-
-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);
-}
-
/* class.c */
-
-struct rb_deprecated_classext_struct {
- char conflict[sizeof(VALUE) * 3];
-};
-
-struct rb_subclass_entry;
-typedef struct rb_subclass_entry rb_subclass_entry_t;
-
-struct rb_subclass_entry {
- VALUE klass;
- rb_subclass_entry_t *next;
-};
-
-#if defined(HAVE_LONG_LONG)
-typedef unsigned LONG_LONG rb_serial_t;
-#define SERIALT2NUM ULL2NUM
-#elif defined(HAVE_UINT64_T)
-typedef uint64_t rb_serial_t;
-#define SERIALT2NUM SIZET2NUM
-#else
-typedef unsigned long rb_serial_t;
-#define SERIALT2NUM ULONG2NUM
-#endif
-
-struct rb_classext_struct {
- struct st_table *iv_index_tbl;
- struct st_table *iv_tbl;
- struct rb_id_table *const_tbl;
- struct rb_id_table *callable_m_tbl;
- rb_subclass_entry_t *subclasses;
- rb_subclass_entry_t **parent_subclasses;
- /**
- * In the case that this is an `ICLASS`, `module_subclasses` points to the link
- * in the module's `subclasses` list that indicates that the klass has been
- * included. Hopefully that makes sense.
- */
- rb_subclass_entry_t **module_subclasses;
- rb_serial_t class_serial;
- const VALUE origin_;
- VALUE refined_class;
- rb_alloc_func_t allocator;
-};
-
-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;
-};
-
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(c) (RCLASS(c)->m_tbl)
-#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_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_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_SET_ORIGIN(VALUE klass, VALUE origin)
+RCLASS_M_TBL_INIT(VALUE c)
{
- RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
- if (klass != origin) FL_SET(origin, RICLASS_IS_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;
}
#undef RCLASS_SUPER
@@ -827,214 +507,6 @@ 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_env = 0,
- imemo_cref = 1, /*!< class reference */
- imemo_svar = 2, /*!< special variable */
- imemo_throw_data = 3,
- imemo_ifunc = 4, /*!< iterator function */
- imemo_memo = 5,
- imemo_ment = 6,
- imemo_iseq = 7,
- imemo_alloc = 8,
- imemo_ast = 9,
- imemo_parser_strterm = 10
-};
-#define IMEMO_MASK 0x0f
-
-static inline enum imemo_type
-imemo_type(VALUE imemo)
-{
- return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
-}
-
-static inline int
-imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
-{
- if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
- /* fixed at compile time if imemo_type is given. */
- const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
- const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
- /* fixed at runtime. */
- return expected_type == (RBASIC(imemo)->flags & mask);
- }
- else {
- return 0;
- }
-}
-
-/* FL_USER0 to FL_USER3 is for type */
-#define IMEMO_FL_USHIFT (FL_USHIFT + 4)
-#define IMEMO_FL_USER0 FL_USER4
-#define IMEMO_FL_USER1 FL_USER5
-#define IMEMO_FL_USER2 FL_USER6
-#define IMEMO_FL_USER3 FL_USER7
-#define IMEMO_FL_USER4 FL_USER8
-
-/* CREF (Class REFerence) is defined in method.h */
-
-/*! SVAR (Special VARiable) */
-struct vm_svar {
- VALUE flags;
- const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */
- const VALUE lastline;
- const VALUE backref;
- const VALUE others;
-};
-
-
-#define THROW_DATA_CONSUMED IMEMO_FL_USER0
-
-/*! THROW_DATA */
-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 (Internal FUNCtion) */
-
-struct vm_ifunc_argc {
-#if SIZEOF_INT * 2 > SIZEOF_VALUE
- signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
- signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
-#else
- int min, max;
-#endif
-};
-
-/*! IFUNC (Internal FUNCtion) */
-struct vm_ifunc {
- VALUE flags;
- VALUE reserved;
- VALUE (*func)(ANYARGS);
- const void *data;
- struct vm_ifunc_argc argc;
-};
-
-#define IFUNC_NEW(a, b, c) ((struct vm_ifunc *)rb_imemo_new(imemo_ifunc, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
-struct vm_ifunc *rb_vm_ifunc_new(VALUE (*func)(ANYARGS), const void *data, int min_argc, int max_argc);
-static inline struct vm_ifunc *
-rb_vm_ifunc_proc_new(VALUE (*func)(ANYARGS), const void *data)
-{
- return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
-}
-
-typedef struct rb_imemo_alloc_struct {
- VALUE flags;
- VALUE reserved;
- VALUE *ptr; /* malloc'ed buffer */
- struct rb_imemo_alloc_struct *next; /* next imemo */
- size_t cnt; /* buffer size in VALUE */
-} rb_imemo_alloc_t;
-
-rb_imemo_alloc_t *rb_imemo_alloc_new(VALUE, VALUE, VALUE, VALUE);
-
-void rb_strterm_mark(VALUE obj);
-
-/*! MEMO
- *
- * @see imemo_type
- * */
-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((m), &(m)->v1, (v))
-#define MEMO_V2_SET(m, v) RB_OBJ_WRITE((m), &(m)->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))
-#define NEW_PARTIAL_MEMO_FOR(type, value, member) \
- ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), \
- rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
- MEMO_FOR(type, value))
-
-#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
-
-#ifdef RUBY_INTEGER_UNIFICATION
-# define rb_cFixnum rb_cInteger
-# define rb_cBignum rb_cInteger
-#endif
-
-enum {
- cmp_opt_Fixnum,
- cmp_opt_String,
- cmp_opt_Float,
- cmp_optimizable_count
-};
-
-struct cmp_opt_data {
- unsigned int opt_methods;
- unsigned int opt_inited;
-};
-
-#define NEW_CMP_OPT_MEMO(type, value) \
- NEW_PARTIAL_MEMO_FOR(type, value, cmp_opt)
-#define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type))
-#define CMP_OPTIMIZABLE(data, type) \
- (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
- ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
- (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
- rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
- ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
-
-#define OPTIMIZED_CMP(a, b, data) \
- ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Fixnum)) ? \
- (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
- (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
- rb_str_cmp(a, b) : \
- (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(data, Float)) ? \
- rb_float_cmp(a, b) : \
- rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b))
-
-/* 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 */
@@ -1043,51 +515,15 @@ 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);
-VALUE rb_ary_aref1(VALUE ary, VALUE i);
-VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e);
-size_t rb_ary_memsize(VALUE);
-VALUE rb_to_array_type(VALUE obj);
-#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[];
-double rb_big_fdiv_double(VALUE x, VALUE y);
+VALUE rb_big_fdiv(VALUE x, VALUE y);
VALUE rb_big_uminus(VALUE x);
-VALUE rb_big_hash(VALUE);
-VALUE rb_big_odd_p(VALUE);
-VALUE rb_big_even_p(VALUE);
-size_t rb_big_size(VALUE);
VALUE rb_integer_float_cmp(VALUE x, VALUE y);
VALUE rb_integer_float_eq(VALUE x, VALUE y);
-VALUE rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base);
-VALUE rb_big_comp(VALUE x);
-VALUE rb_big_aref(VALUE x, VALUE y);
-VALUE rb_big_abs(VALUE x);
-VALUE rb_big_size_m(VALUE big);
-VALUE rb_big_bit_length(VALUE big);
-VALUE rb_big_remainder(VALUE x, VALUE y);
-VALUE rb_big_gt(VALUE x, VALUE y);
-VALUE rb_big_ge(VALUE x, VALUE y);
-VALUE rb_big_lt(VALUE x, VALUE y);
-VALUE rb_big_le(VALUE x, VALUE y);
-VALUE rb_int_powm(int const argc, VALUE * const argv, VALUE const num);
/* class.c */
-VALUE rb_class_boot(VALUE);
-VALUE rb_class_inherited(VALUE, VALUE);
-VALUE rb_make_metaclass(VALUE, VALUE);
-VALUE rb_include_class_new(VALUE, VALUE);
-void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
+void rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE));
void rb_class_detach_subclasses(VALUE);
void rb_class_detach_module_subclasses(VALUE);
void rb_class_remove_from_module_subclasses(VALUE);
@@ -1095,30 +531,23 @@ 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);
-void rb_undef_methods_from(VALUE klass, VALUE super);
-
/* compar.c */
VALUE rb_invcmp(VALUE, VALUE);
/* compile.c */
-struct rb_block;
-int rb_dvar_defined(ID, const struct rb_block *);
-int rb_local_defined(ID, const struct rb_block *);
+int rb_dvar_defined(ID);
+int rb_local_defined(ID);
+int rb_parse_in_eval(void);
+int rb_parse_in_main(void);
const char * rb_insns_name(int i);
VALUE rb_insns_name_array(void);
-/* complex.c */
-VALUE rb_complex_plus(VALUE, VALUE);
-VALUE rb_complex_mul(VALUE, VALUE);
-VALUE rb_complex_abs(VALUE x);
-VALUE rb_complex_sqrt(VALUE x);
-
/* cont.c */
VALUE rb_obj_is_fiber(VALUE);
void rb_fiber_reset_root_local_storage(VALUE);
@@ -1127,75 +556,50 @@ void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE
/* debug.c */
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
-/* dir.c */
-VALUE rb_dir_getwd_ospath(void);
-
/* 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);
-PUREFUNC(int rb_data_is_encoding(VALUE obj));
-
-/* enum.c */
-VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
-VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary);
/* error.c */
-extern VALUE rb_eEAGAIN;
-extern VALUE rb_eEWOULDBLOCK;
-extern VALUE rb_eEINPROGRESS;
-void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args);
-VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
+NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
VALUE rb_check_backtrace(VALUE);
NORETURN(void rb_async_bug_errno(const char *,int));
const char *rb_builtin_type_name(int t);
const char *rb_builtin_class_name(VALUE x);
-PRINTF_ARGS(void rb_sys_warn(const char *fmt, ...), 1, 2);
-PRINTF_ARGS(void rb_syserr_warn(int err, const char *fmt, ...), 2, 3);
-PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
-PRINTF_ARGS(void rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
-PRINTF_ARGS(void rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
-PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2);
-PRINTF_ARGS(void rb_syserr_warning(int err, 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);
-PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
-
-#define rb_raise_cstr(etype, mesg) \
- rb_exc_raise(rb_exc_new_str(etype, rb_str_new_cstr(mesg)))
-#define rb_raise_static(etype, mesg) \
- rb_exc_raise(rb_exc_new_str(etype, rb_str_new_static(mesg, rb_strlen_lit(mesg))))
-
-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))
-VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name);
-#define rb_key_err_raise(mesg, recv, name) \
- rb_exc_raise(rb_key_err_new(mesg, recv, name))
-NORETURN(void ruby_deprecated_internal_feature(const char *));
-#define DEPRECATED_INTERNAL_FEATURE(func) \
- (ruby_deprecated_internal_feature(func), UNREACHABLE)
-VALUE rb_warning_warn(VALUE mod, VALUE str);
-VALUE rb_warning_string(const char *fmt, ...);
/* eval.c */
VALUE rb_refinement_module_get_refined_class(VALUE module);
/* eval_error.c */
+void ruby_error_print(void);
VALUE rb_get_backtrace(VALUE info);
/* eval_jump.c */
@@ -1206,16 +610,13 @@ void rb_mark_end_proc(void);
VALUE rb_home_dir_of(VALUE user, VALUE result);
VALUE rb_default_home_dir(VALUE result);
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
-VALUE rb_check_realpath(VALUE basedir, VALUE path);
void rb_file_const(const char*, VALUE);
int rb_file_load_ok(const char *);
VALUE rb_file_expand_path_fast(VALUE, VALUE);
VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
VALUE rb_get_path_check_to_string(VALUE, int);
VALUE rb_get_path_check_convert(VALUE, VALUE, int);
-VALUE rb_get_path_check(VALUE, int);
void Init_File(void);
-int ruby_is_fd_loadable(int fd);
#ifdef RUBY_FUNCTION_NAME_STRING
# if defined __GNUC__ && __GNUC__ >= 4
@@ -1234,8 +635,6 @@ 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);
@@ -1246,7 +645,6 @@ void rb_gc_writebarrier_remember(VALUE obj);
#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)
@@ -1260,36 +658,14 @@ void ruby_sized_xfree(void *x, size_t size);
#define SIZED_REALLOC_N(var,type,n,old_n) ((var)=(type*)ruby_sized_xrealloc((char*)(var), (n) * sizeof(type), (old_n) * sizeof(type)))
#endif
-/* 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)
+void rb_gc_resurrect(VALUE ptr);
/* hash.c */
struct st_table *rb_hash_tbl_raw(VALUE hash);
-VALUE rb_hash_new_with_size(st_index_t size);
-RUBY_SYMBOL_EXPORT_BEGIN
-VALUE rb_hash_new_compare_by_id(void);
-RUBY_SYMBOL_EXPORT_END
-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);
-long rb_dbl_long_hash(double d);
-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);
-VALUE rb_to_hash_type(VALUE obj);
-
#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);
-int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
+#define HASH_DELETED FL_USER1
#define HASH_PROC_DEFAULT FL_USER2
/* inits.c */
@@ -1300,23 +676,24 @@ const char *ruby_get_inplace_mode(void);
void ruby_set_inplace_mode(const char *);
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);
-size_t rb_io_memsize(const rb_io_t *);
-int rb_stderr_tty_p(void);
+
+/* 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);
/* 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);
@@ -1326,37 +703,14 @@ VALUE rb_math_hypot(VALUE, VALUE);
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);
/* numeric.c */
-
-#define FIXNUM_POSITIVE_P(num) ((SIGNED_VALUE)(num) > (SIGNED_VALUE)INT2FIX(0))
-#define FIXNUM_NEGATIVE_P(num) ((SIGNED_VALUE)(num) < 0)
-#define FIXNUM_ZERO_P(num) ((num) == INT2FIX(0))
-
-#define INT_NEGATIVE_P(x) (FIXNUM_P(x) ? FIXNUM_NEGATIVE_P(x) : BIGNUM_NEGATIVE_P(x))
-
-#ifndef ROUND_DEFAULT
-# define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
-#endif
-enum ruby_num_rounding_mode {
- RUBY_NUM_ROUND_HALF_UP,
- RUBY_NUM_ROUND_HALF_EVEN,
- RUBY_NUM_ROUND_HALF_DOWN,
- RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT
-};
-#define ROUND_TO(mode, even, up, down) \
- ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \
- (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down)
-#define ROUND_FUNC(mode, name) \
- ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down)
-#define ROUND_CALL(mode, name, args) \
- ROUND_TO(mode, name##_half_even args, \
- name##_half_up args, name##_half_down args)
-
int rb_num_to_uint(VALUE val, unsigned int *ret);
VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
@@ -1364,82 +718,6 @@ 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_int_uminus(VALUE num);
-VALUE rb_float_uminus(VALUE num);
-VALUE rb_int_plus(VALUE x, VALUE y);
-VALUE rb_int_minus(VALUE x, VALUE y);
-VALUE rb_int_mul(VALUE x, VALUE y);
-VALUE rb_int_idiv(VALUE x, VALUE y);
-VALUE rb_int_modulo(VALUE x, VALUE y);
-VALUE rb_int_round(VALUE num, int ndigits, enum ruby_num_rounding_mode mode);
-VALUE rb_int2str(VALUE num, int base);
-VALUE rb_dbl_hash(double d);
-VALUE rb_fix_plus(VALUE x, VALUE y);
-VALUE rb_int_gt(VALUE x, VALUE y);
-int rb_float_cmp(VALUE x, VALUE y);
-VALUE rb_float_gt(VALUE x, VALUE y);
-VALUE rb_int_ge(VALUE x, VALUE y);
-enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts);
-double rb_int_fdiv_double(VALUE x, VALUE y);
-VALUE rb_int_pow(VALUE x, VALUE y);
-VALUE rb_float_pow(VALUE x, VALUE y);
-VALUE rb_int_cmp(VALUE x, VALUE y);
-VALUE rb_int_equal(VALUE x, VALUE y);
-VALUE rb_int_divmod(VALUE x, VALUE y);
-VALUE rb_int_and(VALUE x, VALUE y);
-VALUE rb_int_lshift(VALUE x, VALUE y);
-VALUE rb_int_div(VALUE x, VALUE y);
-VALUE rb_int_abs(VALUE num);
-VALUE rb_int_odd_p(VALUE num);
-
-static inline VALUE
-rb_num_compare_with_zero(VALUE num, ID mid)
-{
- VALUE zero = INT2FIX(0);
- VALUE r = rb_check_funcall(num, mid, 1, &zero);
- if (r == Qundef) {
- rb_cmperr(num, zero);
- }
- return r;
-}
-
-static inline int
-rb_num_positive_int_p(VALUE num)
-{
- const ID mid = '>';
-
- if (FIXNUM_P(num)) {
- if (rb_method_basic_definition_p(rb_cInteger, mid))
- return FIXNUM_POSITIVE_P(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- if (rb_method_basic_definition_p(rb_cInteger, mid))
- return BIGNUM_POSITIVE_P(num);
- }
- return RTEST(rb_num_compare_with_zero(num, mid));
-}
-
-
-static inline int
-rb_num_negative_int_p(VALUE num)
-{
- const ID mid = '<';
-
- if (FIXNUM_P(num)) {
- if (rb_method_basic_definition_p(rb_cInteger, mid))
- return FIXNUM_NEGATIVE_P(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- if (rb_method_basic_definition_p(rb_cInteger, mid))
- return BIGNUM_NEGATIVE_P(num);
- }
- return RTEST(rb_num_compare_with_zero(num, mid));
-}
-
-
-VALUE rb_float_abs(VALUE flt);
-VALUE rb_float_equal(VALUE x, VALUE y);
-VALUE rb_float_eql(VALUE x, VALUE y);
#if USE_FLONUM
#define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
@@ -1447,41 +725,31 @@ VALUE rb_float_eql(VALUE x, VALUE y);
#endif
static inline double
-rb_float_flonum_value(VALUE v)
+rb_float_value_inline(VALUE v)
{
#if USE_FLONUM
- 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 & ~(VALUE)0x03), 3);
- return t.d;
+ 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;
+ }
}
#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)
{
@@ -1517,24 +785,16 @@ rb_float_new_inline(double d)
/* object.c */
void rb_obj_copy_ivar(VALUE dest, VALUE obj);
-CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2));
-CONSTFUNC(VALUE rb_obj_not(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);
-VALUE rb_immutable_obj_clone(int, VALUE *, VALUE);
-VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
-VALUE rb_convert_type_with_id(VALUE,int,const char*,ID);
-VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID);
struct RBasicRaw {
VALUE flags;
VALUE klass;
};
-#define RBASIC_CLEAR_CLASS(obj) memset(&(((struct RBasicRaw *)((VALUE)(obj)))->klass), 0, sizeof(VALUE))
-#define RBASIC_SET_CLASS_RAW(obj, cls) memcpy(&((struct RBasicRaw *)((VALUE)(obj)))->klass, &(cls), sizeof(VALUE))
+#define RBASIC_CLEAR_CLASS(obj) (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
+#define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))
#define RBASIC_SET_CLASS(obj, cls) do { \
VALUE _obj_ = (obj); \
RB_OBJ_WRITE(_obj_, &((struct RBasicRaw *)(_obj_))->klass, cls); \
@@ -1546,8 +806,6 @@ struct RBasicRaw {
#endif
VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
-VALUE rb_parser_set_context(VALUE, const struct rb_block *, int);
-void *rb_parser_load_file(VALUE parser, VALUE name);
int rb_is_const_name(VALUE name);
int rb_is_class_name(VALUE name);
int rb_is_global_name(VALUE name);
@@ -1556,31 +814,22 @@ 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);
-PUREFUNC(int rb_is_const_sym(VALUE sym));
-PUREFUNC(int rb_is_class_sym(VALUE sym));
-PUREFUNC(int rb_is_global_sym(VALUE sym));
-PUREFUNC(int rb_is_instance_sym(VALUE sym));
-PUREFUNC(int rb_is_attrset_sym(VALUE sym));
-PUREFUNC(int rb_is_local_sym(VALUE sym));
-PUREFUNC(int rb_is_method_sym(VALUE sym));
-PUREFUNC(int rb_is_junk_sym(VALUE sym));
ID rb_make_internal_id(void);
void rb_gc_free_dsymbol(VALUE);
+VALUE rb_str_dynamic_intern(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);
-int rb_block_min_max_arity(int *max);
-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, int min_argc, int max_argc);
-VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info);
+VALUE rb_block_clear_env_self(VALUE proc);
/* process.c */
#define RB_MAX_GROUPS (65536)
struct rb_execarg {
+ int use_shell;
union {
struct {
VALUE shell_script;
@@ -1596,7 +845,6 @@ 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;
@@ -1613,13 +861,12 @@ 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 path_env;
VALUE chdir_dir;
};
@@ -1634,181 +881,72 @@ rb_pid_t rb_fork_ruby(int *status);
void rb_last_status_clear(void);
/* rational.c */
-VALUE rb_rational_uminus(VALUE self);
-VALUE rb_rational_plus(VALUE self, VALUE other);
VALUE rb_lcm(VALUE x, VALUE y);
VALUE rb_rational_reciprocal(VALUE x);
-VALUE rb_cstr_to_rat(const char *, int);
-VALUE rb_rational_abs(VALUE self);
-VALUE rb_rational_cmp(VALUE self, VALUE other);
-VALUE rb_numeric_quo(VALUE x, VALUE y);
/* 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);
-VALUE rb_reg_match_p(VALUE re, VALUE str, long pos);
-bool rb_reg_start_with_p(VALUE re, VALUE str);
void rb_backref_set_string(VALUE string, long pos, long len);
-int rb_match_count(VALUE match);
-int rb_match_nth_defined(int nth, VALUE match);
/* signal.c */
-extern int ruby_enable_coredump;
int rb_get_next_signal(void);
int rb_sigaltstack_size(void);
-/* st.c */
-extern void rb_hash_bulk_insert(long, const VALUE *, VALUE);
-
/* strftime.c */
#ifdef RUBY_ENCODING_H
-VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
- const struct vtm *vtm, struct timespec *ts, int gmt);
-VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
- const struct vtm *vtm, VALUE timev, int gmt);
+size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, struct timespec *ts, int gmt);
+size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, VALUE timev, int gmt);
#endif
/* string.c */
+void Init_frozen_strings(void);
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);
-#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-# define rb_fstring_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
- (__builtin_constant_p(str)) ? \
- rb_fstring_new((str), (long)strlen(str)) : \
- rb_fstring_cstr(str) \
-)
-#endif
-#ifdef RUBY_ENCODING_H
-VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc);
-#define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc))
-#define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc)
-VALUE rb_fstring_enc_cstr(const char *ptr, rb_encoding *enc);
-# ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-# define rb_fstring_enc_cstr(str, enc) RB_GNUC_EXTENSION_BLOCK( \
- (__builtin_constant_p(str)) ? \
- rb_fstring_enc_new((str), (long)strlen(str), (enc)) : \
- rb_fstring_enc_cstr(str, enc) \
-)
-# endif
-#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);
VALUE rb_id_quote_unprintable(ID);
#define QUOTE(str) rb_str_quote_unprintable(str)
#define QUOTE_ID(id) rb_id_quote_unprintable(id)
-char *rb_str_fill_terminator(VALUE str, const int termlen);
-void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen);
+void rb_str_fill_terminator(VALUE str, const int termlen);
VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
-VALUE rb_str_tmp_frozen_acquire(VALUE str);
-void rb_str_tmp_frozen_release(VALUE str, VALUE tmp);
-VALUE rb_str_chomp_string(VALUE str, VALUE chomp);
#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);
-VALUE rb_str_initialize(VALUE str, const char *ptr, long len, rb_encoding *enc);
#endif
#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 STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED))
+#define STR_SHARED_P(s) FL_ALL((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(ID mid, int argc, const VALUE *argv, VALUE passed_proc);
-VALUE rb_sym_to_proc(VALUE sym);
-char *rb_str_to_cstr(VALUE str);
-VALUE rb_str_eql(VALUE str1, VALUE str2);
-
-/* 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
-VALUE rb_to_symbol_type(VALUE obj);
/* struct.c */
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
-VALUE rb_struct_lookup(VALUE s, VALUE idx);
-VALUE rb_struct_s_keyword_init(VALUE klass);
/* time.c */
struct timeval rb_time_timeval(VALUE);
/* thread.c */
-#define COVERAGE_INDEX_LINES 0
-#define COVERAGE_INDEX_BRANCHES 1
-#define COVERAGE_TARGET_LINES 1
-#define COVERAGE_TARGET_BRANCHES 2
-#define COVERAGE_TARGET_METHODS 4
-
VALUE rb_obj_is_mutex(VALUE obj);
VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
void rb_thread_execute_interrupts(VALUE th);
void rb_clear_trace_func(void);
VALUE rb_get_coverages(void);
-VALUE rb_default_coverage(int);
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);
+void ruby_kill(rb_pid_t pid, int sig);
/* thread_pthread.c, thread_win32.c */
-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 */
-void rb_gc_mark_global_tbl(void);
-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);
-void rb_deprecate_constant(VALUE mod, const char *name);
-
-/* version.c */
-extern const char ruby_engine[];
+void Init_native_thread(void);
/* vm_insnhelper.h */
rb_serial_t rb_next_class_serial(void);
@@ -1818,20 +956,14 @@ VALUE rb_obj_is_thread(VALUE obj);
void rb_vm_mark(void *ptr);
void Init_BareVM(void);
void Init_vm_objects(void);
-PUREFUNC(VALUE rb_vm_top_self(void));
+VALUE rb_vm_top_self(void);
void rb_thread_recycle_stack_release(VALUE *);
void rb_vm_change_state(void);
void rb_vm_inc_const_missing_count(void);
+void rb_thread_mark(void *th);
const void **rb_vm_get_insns_address_table(void);
-VALUE rb_source_location(int *pline);
-const char *rb_source_location_cstr(int *pline);
+VALUE rb_sourcefilename(void);
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);
-PUREFUNC(st_table *rb_vm_fstring_table(void));
-
/* vm_dump.c */
void rb_print_backtrace(void);
@@ -1843,17 +975,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);
-const char *rb_type_str(enum ruby_value_type type);
-VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
-VALUE rb_yield_1(VALUE val);
-VALUE rb_yield_force_blockarg(VALUE values);
-VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
- rb_block_call_func_t bl_proc, int min_argc, int max_argc,
- VALUE data2);
+VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, int *stateptr);
/* vm_insnhelper.c */
VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
-VALUE rb_eql_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);
@@ -1872,7 +999,8 @@ void rb_backtrace_print_as_bugreport(void);
int rb_backtrace_p(VALUE obj);
VALUE rb_backtrace_to_str_ary(VALUE obj);
VALUE rb_backtrace_to_location_ary(VALUE obj);
-void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
+void rb_backtrace_print_to(VALUE output);
+VALUE rb_vm_backtrace_object(void);
RUBY_SYMBOL_EXPORT_BEGIN
const char *rb_objspace_data_type_name(VALUE obj);
@@ -1880,7 +1008,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 (export) */
+/* bignum.c */
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);
@@ -1898,134 +1026,64 @@ VALUE rb_big_divrem_gmp(VALUE x, VALUE y);
VALUE rb_big2str_gmp(VALUE x, int base);
VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
#endif
-enum rb_int_parse_flags {
- RB_INT_PARSE_SIGN = 0x01,
- RB_INT_PARSE_UNDERSCORE = 0x02,
- RB_INT_PARSE_PREFIX = 0x04,
- RB_INT_PARSE_ALL = 0x07,
- RB_INT_PARSE_DEFAULT = 0x07
-};
-VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags);
-/* error.c (export) */
+/* error.c */
int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data);
-NORETURN(void rb_unexpected_type(VALUE,int));
-#undef Check_Type
-#define Check_Type(v, t) \
- (!RB_TYPE_P((VALUE)(v), (t)) || \
- ((t) == RUBY_T_DATA && RTYPEDDATA_P(v)) ? \
- rb_unexpected_type((VALUE)(v), (t)) : (void)0)
-
-/* file.c (export) */
-#ifdef HAVE_READLINK
-VALUE rb_readlink(VALUE path, rb_encoding *enc);
-#endif
+
+/* file.c */
#ifdef __APPLE__
VALUE rb_str_normalize_ospath(const char *ptr, long len);
#endif
-/* hash.c (export) */
-VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
-VALUE rb_ident_hash_new(void);
-
-/* io.c (export) */
+/* io.c */
void rb_maygvl_fd_fix_cloexec(int fd);
-int rb_gc_for_fd(int err);
-void rb_write_error_str(VALUE mesg);
-/* numeric.c (export) */
+/* numeric.c */
VALUE rb_int_positive_pow(long x, unsigned long y);
-/* process.c (export) */
+/* process.c */
int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
VALUE rb_execarg_new(int argc, 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, const VALUE *argv, int accept_shell, VALUE execarg_obj);
int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
-void rb_execarg_parent_start(VALUE execarg_obj);
-void rb_execarg_parent_end(VALUE execarg_obj);
+void rb_execarg_fixup(VALUE execarg_obj);
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
-/* rational.c (export) */
-VALUE rb_gcd(VALUE x, VALUE y);
+/* rational.c */
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
-/* string.c (export) */
+/* string.c */
#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) */
+/* util.c */
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 (export) */
+/* variable.c */
+void rb_gc_mark_global_tbl(void);
void rb_mark_generic_ivar(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);
+void rb_mark_generic_ivar_tbl(void);
-/* gc.c (export) */
-VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
-VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
+int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
+st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
+/* gc.c */
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_location_cstr(&dtrace_line); \
- if (!dtrace_file) dtrace_file = ""; \
- RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
- } \
-} while (0)
-
-#define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
-#define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
-#ifdef __GNUC__
-#define rb_obj_builtin_type(obj) \
-__extension__({ \
- VALUE arg_obj = (obj); \
- RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
- RB_BUILTIN_TYPE(arg_obj); \
- })
-#else
-static inline int
-rb_obj_builtin_type(VALUE obj)
-{
- return RB_SPECIAL_CONST_P(obj) ? -1 :
- RB_BUILTIN_TYPE(obj);
-}
-#endif
-
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/io.c b/io.c
index 178ec14b58..5909a0be50 100644
--- a/io.c
+++ b/io.c
@@ -11,11 +11,11 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "dln.h"
-#include "encindex.h"
+#include "internal.h"
#include "id.h"
#include <ctype.h>
#include <errno.h>
@@ -32,10 +32,12 @@
#if defined HAVE_NET_SOCKET_H
# include <net/socket.h>
#elif defined HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
+# ifndef __native_client__
+# include <sys/socket.h>
+# endif
#endif
-#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32)
+#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) || defined(__HAIKU__)
# define NO_SAFE_RENAME
#endif
@@ -51,6 +53,9 @@
#if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
#include <sys/ioctl.h>
#endif
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/ioctl.h"
+#endif
#if defined(HAVE_FCNTL_H) || defined(_WIN32)
#include <fcntl.h>
#elif defined(HAVE_SYS_FCNTL_H)
@@ -60,14 +65,18 @@
#if !HAVE_OFF_T && !defined(off_t)
# define off_t long
#endif
-
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
+#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
#include <sys/stat.h>
-#if defined(HAVE_SYS_PARAM_H) || defined(__HIUX_MPP__)
+/* EMX has sys/param.h, but.. */
+#if defined(HAVE_SYS_PARAM_H) && !(defined(__EMX__) || defined(__HIUX_MPP__))
# include <sys/param.h>
#endif
@@ -89,8 +98,10 @@
#include <sys/uio.h>
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h> /* for WNOHANG on BSD */
+#if defined(__BEOS__) || defined(__HAIKU__)
+# ifndef NOFILE
+# define NOFILE (OPEN_MAX)
+# endif
#endif
#include "ruby/util.h"
@@ -129,8 +140,6 @@ off_t __syscall(quad_t number, ...);
#ifdef _WIN32
#undef open
#define open rb_w32_uopen
-#undef rename
-#define rename(f, t) rb_w32_urename((f), (t))
#endif
VALUE rb_cIO;
@@ -138,6 +147,9 @@ 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;
@@ -147,6 +159,7 @@ static VALUE rb_eEINPROGRESSWaitWritable;
static VALUE rb_eEINPROGRESSWaitReadable;
VALUE rb_stdin, rb_stdout, rb_stderr;
+VALUE rb_deferr; /* rescue VIM plugin */
static VALUE orig_stdout, orig_stderr;
VALUE rb_output_fs;
@@ -156,12 +169,10 @@ 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_flags, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
-static VALUE sym_textmode, sym_binmode, sym_autoclose;
+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_SET, sym_CUR, sym_END;
-static VALUE sym_wait_readable, sym_wait_writable;
#ifdef SEEK_DATA
static VALUE sym_DATA;
#endif
@@ -174,7 +185,7 @@ struct argf {
long last_lineno; /* $. */
long lineno;
VALUE argv;
- VALUE inplace;
+ char *inplace;
struct rb_io_enc_t encs;
int8_t init_p, next_p, binmode;
};
@@ -185,17 +196,16 @@ rb_update_max_fd(int fd)
{
struct stat buf;
rb_atomic_t afd = (rb_atomic_t)fd;
- rb_atomic_t max_fd = max_file_descriptor;
- if (afd <= max_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);
}
- while (max_fd < afd) {
- max_fd = ATOMIC_CAS(max_file_descriptor, max_fd, afd);
+ while (max_file_descriptor < afd) {
+ ATOMIC_CAS(max_file_descriptor, max_file_descriptor, afd);
}
}
@@ -233,7 +243,7 @@ rb_fd_fix_cloexec(int fd)
static int
rb_fix_detect_o_cloexec(int fd)
{
-#if defined(O_CLOEXEC) && defined(F_GETFD)
+#ifdef O_CLOEXEC
int flags = fcntl(fd, F_GETFD);
if (flags == -1)
@@ -419,7 +429,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
@@ -539,9 +549,8 @@ 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_syserr_fail_path(e, fptr->pathv);
+ rb_sys_fail_path(fptr->pathv);
}
if (read_size == fptr->rbuf.len) {
lseek(fptr->fd, r, SEEK_SET);
@@ -639,31 +648,25 @@ rb_io_check_closed(rb_io_t *fptr)
}
}
-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)
{
- return rb_convert_type_with_id(io, T_FILE, "IO", idTo_io);
+ return rb_convert_type(io, T_FILE, "IO", "to_io");
}
VALUE
rb_io_check_io(VALUE io)
{
- return rb_check_convert_type_with_id(io, T_FILE, "IO", idTo_io);
+ return rb_check_convert_type(io, T_FILE, "IO", "to_io");
}
VALUE
rb_io_get_write_io(VALUE io)
{
VALUE write_io;
- write_io = rb_io_get_fptr(io)->tied_io_for_writing;
+ rb_io_check_initialized(RFILE(io)->fptr);
+ write_io = RFILE(io)->fptr->tied_io_for_writing;
if (write_io) {
return write_io;
}
@@ -674,24 +677,24 @@ VALUE
rb_io_set_write_io(VALUE io, VALUE w)
{
VALUE write_io;
- rb_io_t *fptr = rb_io_get_fptr(io);
+ rb_io_check_initialized(RFILE(io)->fptr);
if (!RTEST(w)) {
w = 0;
}
else {
GetWriteIO(w);
}
- write_io = fptr->tied_io_for_writing;
- fptr->tied_io_for_writing = w;
+ write_io = RFILE(io)->fptr->tied_io_for_writing;
+ RFILE(io)->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
@@ -867,16 +870,6 @@ 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)
{
@@ -884,12 +877,12 @@ ruby_dup(int orig)
fd = rb_cloexec_dup(orig);
if (fd < 0) {
- int e = errno;
- if (rb_gc_for_fd(e)) {
+ if (errno == EMFILE || errno == ENFILE || errno == ENOMEM) {
+ rb_gc();
fd = rb_cloexec_dup(orig);
}
if (fd < 0) {
- rb_syserr_fail(e, 0);
+ rb_sys_fail(0);
}
}
rb_update_max_fd(fd);
@@ -910,6 +903,29 @@ 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;
@@ -937,18 +953,11 @@ internal_read_func(void *ptr)
return read(iis->fd, iis->buf, iis->capa);
}
-#if defined __APPLE__
-# define do_write_retry(code) do {ret = code;} while (ret == -1 && errno == EPROTOTYPE)
-#else
-# define do_write_retry(code) ret = code
-#endif
static VALUE
internal_write_func(void *ptr)
{
struct io_internal_write_struct *iis = ptr;
- ssize_t ret;
- do_write_retry(write(iis->fd, iis->buf, iis->capa));
- return (VALUE)ret;
+ return write(iis->fd, iis->buf, iis->capa);
}
static void*
@@ -963,9 +972,7 @@ static VALUE
internal_writev_func(void *ptr)
{
struct io_internal_writev_struct *iis = ptr;
- ssize_t ret;
- do_write_retry(writev(iis->fd, iis->iov, iis->iovcnt));
- return (VALUE)ret;
+ return writev(iis->fd, iis->iov, iis->iovcnt);
}
#endif
@@ -1016,11 +1023,22 @@ rb_writev_internal(int fd, const struct iovec *iov, int iovcnt)
}
#endif
+static long
+io_writable_length(rb_io_t *fptr, long l)
+{
+ if (PIPE_BUF < l &&
+ !rb_thread_alone() &&
+ wsplit_p(fptr)) {
+ l = PIPE_BUF;
+ }
+ return l;
+}
+
static VALUE
io_flush_buffer_sync(void *arg)
{
rb_io_t *fptr = arg;
- long l = fptr->wbuf.len;
+ long l = io_writable_length(fptr, fptr->wbuf.len);
ssize_t r = write(fptr->fd, fptr->wbuf.ptr+fptr->wbuf.off, (size_t)l);
if (fptr->wbuf.len <= r) {
@@ -1252,9 +1270,6 @@ io_binwrite_string(VALUE arg)
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;
@@ -1267,7 +1282,8 @@ io_binwrite_string(VALUE arg)
}
}
else {
- r = rb_write_internal(fptr->fd, p->ptr, p->length);
+ long l = io_writable_length(fptr, p->length);
+ r = rb_write_internal(fptr->fd, p->ptr, l);
}
return r;
@@ -1301,7 +1317,8 @@ io_binwrite_string(VALUE arg)
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);
+ l = io_writable_length(p->fptr, p->length);
+ return rb_write_internal(p->fptr->fd, p->ptr, l);
}
#endif
@@ -1427,9 +1444,6 @@ static long
io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
{
int converted = 0;
- VALUE tmp;
- long n, len;
- const char *ptr;
#ifdef _WIN32
if (fptr->mode & FMODE_TTY) {
long len = rb_w32_write_console(str, fptr->fd);
@@ -1439,13 +1453,11 @@ io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
str = do_writeconv(str, fptr, &converted);
if (converted)
OBJ_FREEZE(str);
+ else
+ str = rb_str_new_frozen(str);
- tmp = rb_str_tmp_frozen_acquire(str);
- RSTRING_GETMEM(tmp, ptr, len);
- n = io_binwrite(tmp, ptr, len, fptr, nosync);
- rb_str_tmp_frozen_release(str, tmp);
-
- return n;
+ return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
+ fptr, nosync);
}
ssize_t
@@ -1484,195 +1496,16 @@ io_write(VALUE io, VALUE str, int nosync)
return LONG2FIX(n);
}
-#ifdef HAVE_WRITEV
-struct binwritev_arg {
- rb_io_t *fptr;
- const struct iovec *iov;
- int iovcnt;
-};
-
-static VALUE
-call_writev_internal(VALUE arg)
-{
- struct binwritev_arg *p = (struct binwritev_arg *)arg;
- return rb_writev_internal(p->fptr->fd, p->iov, p->iovcnt);
-}
-
-static long
-io_binwritev(struct iovec *iov, int iovcnt, rb_io_t *fptr)
-{
- int i;
- long r, total = 0, written_len = 0;
-
- /* don't write anything if current thread has a pending interrupt. */
- rb_thread_check_ints();
-
- if (iovcnt == 0) return 0;
- for (i = 1; i < iovcnt; i++) total += iov[i].iov_len;
-
- if (fptr->wbuf.ptr == NULL && !(fptr->mode & FMODE_SYNC)) {
- fptr->wbuf.off = 0;
- fptr->wbuf.len = 0;
- fptr->wbuf.capa = IO_WBUF_CAPA_MIN;
- fptr->wbuf.ptr = ALLOC_N(char, fptr->wbuf.capa);
- fptr->write_lock = rb_mutex_new();
- rb_mutex_allow_trap(fptr->write_lock, 1);
- }
-
- if (fptr->wbuf.ptr && fptr->wbuf.len) {
- long offset = fptr->wbuf.off + fptr->wbuf.len;
- if (offset + total <= fptr->wbuf.capa) {
- for (i = 1; i < iovcnt; i++) {
- memcpy(fptr->wbuf.ptr+offset, iov[i].iov_base, iov[i].iov_len);
- offset += iov[i].iov_len;
- }
- fptr->wbuf.len += total;
- return total;
- }
- else {
- iov[0].iov_base = fptr->wbuf.ptr + fptr->wbuf.off;
- iov[0].iov_len = fptr->wbuf.len;
- }
- }
- else {
- iov++;
- if (!--iovcnt) return 0;
- }
-
- retry:
- if (fptr->write_lock) {
- struct binwritev_arg arg;
- arg.fptr = fptr;
- arg.iov = iov;
- arg.iovcnt = iovcnt;
- r = rb_mutex_synchronize(fptr->write_lock, call_writev_internal, (VALUE)&arg);
- }
- else {
- r = rb_writev_internal(fptr->fd, iov, iovcnt);
- }
-
- if (r >= 0) {
- written_len += r;
- if (fptr->wbuf.ptr && fptr->wbuf.len) {
- if (written_len < fptr->wbuf.len) {
- fptr->wbuf.off += r;
- fptr->wbuf.len -= r;
- }
- else {
- written_len -= fptr->wbuf.len;
- fptr->wbuf.off = 0;
- fptr->wbuf.len = 0;
- }
- }
- if (written_len == total) return total;
-
- while (r >= (ssize_t)iov->iov_len) {
- /* iovcnt > 0 */
- r -= iov->iov_len;
- iov->iov_len = 0;
- iov++;
- if (!--iovcnt) return total;
- /* defensive check: written_len should == total */
- }
- iov->iov_base = (char *)iov->iov_base + r;
- iov->iov_len -= r;
-
- errno = EAGAIN;
- }
- if (rb_io_wait_writable(fptr->fd)) {
- rb_io_check_closed(fptr);
- goto retry;
- }
-
- return -1L;
-}
-
-static long
-io_fwritev(int argc, VALUE *argv, rb_io_t *fptr)
-{
- int i, converted, iovcnt = argc + 1;
- long n;
- VALUE v1, v2, str, tmp, *tmp_array;
- struct iovec *iov;
-
- iov = ALLOCV_N(struct iovec, v1, iovcnt);
- tmp_array = ALLOCV_N(VALUE, v2, argc);
-
- for (i = 0; i < argc; i++) {
- str = rb_obj_as_string(argv[i]);
- converted = 0;
- str = do_writeconv(str, fptr, &converted);
- if (converted)
- OBJ_FREEZE(str);
-
- tmp = rb_str_tmp_frozen_acquire(str);
- tmp_array[i] = tmp;
- /* iov[0] is reserved for buffer of fptr */
- iov[i+1].iov_base = RSTRING_PTR(tmp);
- iov[i+1].iov_len = RSTRING_LEN(tmp);
- }
-
- n = io_binwritev(iov, iovcnt, fptr);
- if (v1) ALLOCV_END(v1);
-
- for (i = 0; i < argc; i++) {
- rb_str_tmp_frozen_release(argv[i], tmp_array[i]);
- }
-
- if (v2) ALLOCV_END(v2);
-
- return n;
-}
-#endif /* HAVE_WRITEV */
-
-static VALUE
-io_writev(int argc, VALUE *argv, VALUE io)
-{
- rb_io_t *fptr;
- long n;
- VALUE tmp, total = INT2FIX(0);
- int i, cnt = 1;
-
- io = GetWriteIO(io);
- tmp = rb_io_check_io(io);
- if (NIL_P(tmp)) {
- /* port is not IO, call write method for it. */
- return rb_funcallv(io, id_write, argc, argv);
- }
- io = tmp;
-
- GetOpenFile(io, fptr);
- rb_io_check_writable(fptr);
-
- for (i = 0; i < argc; i += cnt) {
-#ifdef HAVE_WRITEV
- if ((fptr->mode & (FMODE_SYNC|FMODE_TTY)) && ((cnt = argc - i) < IOV_MAX)) {
- n = io_fwritev(cnt, &argv[i], fptr);
- }
- else
-#endif
- {
- cnt = 1;
- /* sync at last item */
- n = io_fwrite(rb_obj_as_string(argv[i]), fptr, (i < argc-1));
- }
- if (n == -1L) rb_sys_fail_path(fptr->pathv);
- total = rb_fix_plus(LONG2FIX(n), total);
- }
-
- return total;
-}
-
/*
* call-seq:
- * ios.write(string, ...) -> integer
+ * ios.write(string) -> integer
*
- * Writes the given strings to <em>ios</em>. The stream must be opened
- * for writing. Arguments that are not a string will be converted
+ * Writes the given string to <em>ios</em>. The stream must be opened
+ * for writing. If the argument is not a string, it will be converted
* to a string using <code>to_s</code>. Returns the number of bytes
- * written in total.
+ * written.
*
- * count = $stdout.write("This is", " a test\n")
+ * count = $stdout.write("This is a test\n")
* puts "That was #{count} bytes of data"
*
* <em>produces:</em>
@@ -1682,15 +1515,9 @@ io_writev(int argc, VALUE *argv, VALUE io)
*/
static VALUE
-io_write_m(int argc, VALUE *argv, VALUE io)
+io_write_m(VALUE io, VALUE str)
{
- if (argc > 1) {
- return io_writev(argc, argv, io);
- }
- else {
- VALUE str = argv[0];
- return io_write(io, str, 0);
- }
+ return io_write(io, str, 0);
}
VALUE
@@ -1699,23 +1526,6 @@ rb_io_write(VALUE io, VALUE str)
return rb_funcallv(io, id_write, 1, &str);
}
-static VALUE
-rb_io_writev(VALUE io, int argc, VALUE *argv)
-{
- if (argc > 1 && rb_obj_method_arity(io, id_write) == 1) {
- if (io != rb_stderr && RTEST(ruby_verbose)) {
- VALUE klass = CLASS_OF(io);
- char sep = FL_TEST(klass, FL_SINGLETON) ? (klass = io, '.') : '#';
- rb_warning("%+"PRIsVALUE"%c""write is outdated interface"
- " which accepts just one argument",
- klass, sep);
- }
- do rb_io_write(io, *argv++); while (--argc);
- return argv[0]; /* unused right now */
- }
- return rb_funcallv(io, id_write, argc, argv);
-}
-
/*
* call-seq:
* ios << obj -> ios
@@ -1745,10 +1555,6 @@ 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
@@ -1860,7 +1666,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>:
@@ -1978,15 +1784,13 @@ 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_syserr_fail_path(e, path);
+ rb_sys_fail_path(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)
@@ -2087,6 +1891,8 @@ rb_io_sync(VALUE io)
*
* f = File.new("testfile")
* f.sync = true
+ *
+ * <em>(produces no output)</em>
*/
static VALUE
@@ -2150,10 +1956,6 @@ 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);
}
@@ -2191,8 +1993,8 @@ rb_io_fdatasync(VALUE io)
/*
* call-seq:
- * ios.fileno -> integer
- * ios.to_i -> integer
+ * ios.fileno -> fixnum
+ * ios.to_i -> fixnum
*
* Returns an integer representing the numeric file descriptor for
* <em>ios</em>.
@@ -2215,7 +2017,7 @@ rb_io_fileno(VALUE io)
/*
* call-seq:
- * ios.pid -> integer
+ * ios.pid -> fixnum
*
* Returns the process ID of a child process associated with
* <em>ios</em>. This will be set by <code>IO.popen</code>.
@@ -2283,7 +2085,7 @@ rb_io_inspect(VALUE obj)
/*
* call-seq:
- * ios.to_io -> ios
+ * ios.to_io -> ios
*
* Returns <em>ios</em>.
*/
@@ -2346,7 +2148,7 @@ io_bufread(char *ptr, long len, rb_io_t *fptr)
return len - n;
}
-static int io_setstrbuf(VALUE *str, long len);
+static void io_setstrbuf(VALUE *str, long len);
struct bufread_arg {
char *str_ptr;
@@ -2396,7 +2198,7 @@ remain_size(rb_io_t *fptr)
off_t pos;
if (fstat(fptr->fd, &st) == 0 && S_ISREG(st.st_mode)
-#if defined(__HAIKU__)
+#if defined(__BEOS__) || defined(__HAIKU__)
&& (st.st_dev > 3)
#endif
)
@@ -2565,45 +2367,33 @@ io_shift_cbuf(rb_io_t *fptr, int len, VALUE *strp)
return str;
}
-static int
+static void
io_setstrbuf(VALUE *str, long len)
{
#ifdef _WIN32
len = (len + 1) & ~1L; /* round up for wide char */
#endif
if (NIL_P(*str)) {
- *str = rb_str_new(0, len);
- return TRUE;
+ *str = rb_str_new(0, 0);
}
else {
VALUE s = StringValue(*str);
long clen = RSTRING_LEN(s);
if (clen >= len) {
rb_str_modify(s);
- return FALSE;
+ return;
}
len -= clen;
}
rb_str_modify_expand(*str, len);
- return FALSE;
}
-#define MAX_REALLOC_GAP 4096
static void
-io_shrink_read_string(VALUE str, long n)
-{
- if (rb_str_capacity(str) - n > MAX_REALLOC_GAP) {
- rb_str_resize(str, n);
- }
-}
-
-static void
-io_set_read_length(VALUE str, long n, int shrinkable)
+io_set_read_length(VALUE str, long n)
{
if (RSTRING_LEN(str) != n) {
rb_str_modify(str);
rb_str_set_len(str, n);
- if (shrinkable) io_shrink_read_string(str, n);
}
}
@@ -2615,12 +2405,11 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
long pos;
rb_encoding *enc;
int cr;
- int shrinkable;
if (NEED_READCONV(fptr)) {
int first = !NIL_P(str);
SET_BINARY_MODE(fptr);
- shrinkable = io_setstrbuf(&str,0);
+ io_setstrbuf(&str,0);
make_readconv(fptr, 0);
while (1) {
VALUE v;
@@ -2639,7 +2428,6 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
if (v == MORE_CHAR_FINISHED) {
clear_readconv(fptr);
if (first) rb_str_set_len(str, first = 0);
- if (shrinkable) io_shrink_read_string(str, RSTRING_LEN(str));
return io_enc_str(str, fptr);
}
}
@@ -2653,7 +2441,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
cr = 0;
if (siz == 0) siz = BUFSIZ;
- shrinkable = io_setstrbuf(&str, siz);
+ io_setstrbuf(&str,siz);
for (;;) {
READ_CHECK(fptr);
n = io_fread(str, bytes, siz - bytes, fptr);
@@ -2669,7 +2457,6 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
siz += BUFSIZ;
rb_str_modify_expand(str, BUFSIZ);
}
- if (shrinkable) io_shrink_read_string(str, RSTRING_LEN(str));
str = io_enc_str(str, fptr);
ENC_CODERANGE_SET(str, cr);
return str;
@@ -2678,11 +2465,6 @@ 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);
@@ -2698,9 +2480,11 @@ 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;
@@ -2715,32 +2499,21 @@ 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, VALUE opts, int nonblock)
+io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock, int no_exception)
{
rb_io_t *fptr;
VALUE length, str;
long n, len;
struct read_internal_arg arg;
- int shrinkable;
- rb_scan_args(argc, argv, "11", &length, &str);
+ rb_scan_args(argc, argv, "11:", &length, &str, NULL);
if ((len = NUM2LONG(length)) < 0) {
rb_raise(rb_eArgError, "negative length %ld given", len);
}
- shrinkable = io_setstrbuf(&str, len);
+ io_setstrbuf(&str,len);
OBJ_TAINT(str);
GetOpenFile(io, fptr);
@@ -2764,20 +2537,18 @@ io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock)
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 && (e == EWOULDBLOCK || e == EAGAIN)) {
- if (no_exception_p(opts))
- return sym_wait_readable;
+ if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN)) {
+ if (no_exception)
+ return ID2SYM(rb_intern("wait_readable"));
else
- rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
- e, "read would block");
+ rb_readwrite_sys_fail(RB_IO_WAIT_READABLE, "read would block");
}
- rb_syserr_fail_path(e, fptr->pathv);
+ rb_sys_fail_path(fptr->pathv);
}
}
- io_set_read_length(str, n, shrinkable);
+ io_set_read_length(str, n);
if (n == 0)
return Qnil;
@@ -2793,12 +2564,10 @@ io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock)
* 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 _outbuf_ argument is present,
+ * If the optional <i>outbuf</i> 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
+ * The <i>outbuf</i> will contain only the received data after the method call
* even if it is not empty at the beginning.
- *
* It raises <code>EOFError</code> on end of file.
*
* readpartial is designed for streams such as pipe, socket, tty, etc.
@@ -2841,7 +2610,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, VALUE opts, int nonblock)
* * 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 latter means that readpartial is nonblocking-flag insensitive.
+ * The later means that readpartial is nonblocking-flag insensitive.
* It blocks on the situation IO#sysread causes Errno::EWOULDBLOCK as if the fd is blocking mode.
*
*/
@@ -2851,74 +2620,101 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
{
VALUE ret;
- ret = io_getpartial(argc, argv, io, Qnil, 0);
+ ret = io_getpartial(argc, argv, io, 0, 0);
if (NIL_P(ret))
rb_eof_error();
return ret;
}
static VALUE
-io_nonblock_eof(VALUE opts)
+get_kwargs_exception(VALUE opts)
{
- if (!no_exception_p(opts)) {
- rb_eof_error();
- }
- return Qnil;
+ static ID ids[1];
+ VALUE except;
+
+ if (!ids[0])
+ ids[0] = sym_exception;
+
+ rb_get_kwargs(opts, ids, 0, 1, &except);
+ return except;
}
-/* :nodoc: */
+/*
+ * 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_read_nonblock(VALUE io, VALUE length, VALUE str, VALUE ex)
+io_read_nonblock(int argc, VALUE *argv, VALUE io)
{
- rb_io_t *fptr;
- long n, len;
- struct read_internal_arg arg;
- int shrinkable;
-
- if ((len = NUM2LONG(length)) < 0) {
- rb_raise(rb_eArgError, "negative length %ld given", len);
- }
+ VALUE ret;
+ VALUE opts = Qnil;
+ int no_exception = 0;
- shrinkable = io_setstrbuf(&str, len);
- OBJ_TAINT(str);
- GetOpenFile(io, fptr);
- rb_io_check_byte_readable(fptr);
+ rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
- if (len == 0)
- return str;
+ if (!NIL_P(opts) && Qfalse == get_kwargs_exception(opts))
+ no_exception = 1;
- n = read_buffered_data(RSTRING_PTR(str), len, fptr);
- if (n <= 0) {
- rb_io_set_nonblock(fptr);
- shrinkable |= 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);
- }
- }
- io_set_read_length(str, n, shrinkable);
+ ret = io_getpartial(argc, argv, io, 1, no_exception);
- if (n == 0) {
- if (ex == Qfalse) return Qnil;
- rb_eof_error();
+ if (NIL_P(ret)) {
+ if (no_exception)
+ return Qnil;
+ else
+ rb_eof_error();
}
-
- return str;
+ return ret;
}
-/* :nodoc: */
static VALUE
-io_write_nonblock(VALUE io, VALUE str, VALUE ex)
+io_write_nonblock(VALUE io, VALUE str, int no_exception)
{
rb_io_t *fptr;
long n;
@@ -2935,19 +2731,17 @@ io_write_nonblock(VALUE io, VALUE str, VALUE ex)
rb_io_set_nonblock(fptr);
n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str));
- RB_GC_GUARD(str);
if (n == -1) {
- int e = errno;
- if (e == EWOULDBLOCK || e == EAGAIN) {
- if (ex == Qfalse) {
- return sym_wait_writable;
+ if (errno == EWOULDBLOCK || errno == EAGAIN) {
+ if (no_exception) {
+ return ID2SYM(rb_intern("wait_writable"));
}
else {
- rb_readwrite_syserr_fail(RB_IO_WAIT_WRITABLE, e, "write would block");
+ rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "write would block");
}
}
- rb_syserr_fail_path(e, fptr->pathv);
+ rb_sys_fail_path(fptr->pathv);
}
return LONG2FIX(n);
@@ -2955,69 +2749,141 @@ io_write_nonblock(VALUE io, VALUE str, VALUE ex)
/*
* 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 == get_kwargs_exception(opts))
+ no_exceptions = 1;
+
+ return io_write_nonblock(io, str, no_exceptions);
+}
+
+/*
+ * call-seq:
* ios.read([length [, outbuf]]) -> string, outbuf, or nil
*
- * Reads _length_ bytes from the I/O stream.
+ * Reads <i>length</i> bytes from the I/O stream.
*
- * _length_ must be a non-negative integer or +nil+.
+ * <i>length</i> must be a non-negative integer or <code>nil</code>.
*
- * 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 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 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 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 zero, it returns an empty string (<code>""</code>).
+ * If <i>length</i> is zero, it returns <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
+ * 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.
*
- * 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+.
+ * 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>.
*
* f = File.new("testfile")
* f.read(16) #=> "This is line one"
*
- * # read whole file
- * open("file") do |f|
- * data = f.read # This returns a string even if the file is empty.
- * # ...
- * end
+ * # reads whole file
+ * open("file") {|f|
+ * data = f.read # This returns a string even if the file is empty.
+ * ...
+ * }
*
- * # iterate over fixed length records
- * open("fixed-record-file") do |f|
+ * # iterate over fixed length records.
+ * open("fixed-record-file") {|f|
* while record = f.read(256)
- * # ...
+ * ...
* end
- * end
+ * }
*
- * # iterate over variable length records,
- * # each record is prefixed by its 32-bit length
- * open("variable-record-file") do |f|
+ * # iterate over variable length records.
+ * # record is prefixed by 32-bit length.
+ * open("variable-record-file") {|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 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.
+ * 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.
* (This method is non-blocking flag insensitive as other methods.)
- * If you need the behavior like a single read(2) system call,
- * consider #readpartial, #read_nonblock, and #sysread.
+ * If you need the behavior like single read(2) system call,
+ * consider readpartial, read_nonblock and sysread.
*/
static VALUE
@@ -3026,7 +2892,6 @@ io_read(int argc, VALUE *argv, VALUE io)
rb_io_t *fptr;
long n, len;
VALUE length, str;
- int shrinkable;
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
int previous_mode;
#endif
@@ -3043,12 +2908,12 @@ io_read(int argc, VALUE *argv, VALUE io)
rb_raise(rb_eArgError, "negative length %ld given", len);
}
- shrinkable = io_setstrbuf(&str,len);
+ io_setstrbuf(&str,len);
GetOpenFile(io, fptr);
rb_io_check_byte_readable(fptr);
if (len == 0) {
- io_set_read_length(str, 0, shrinkable);
+ io_set_read_length(str, 0);
return str;
}
@@ -3057,7 +2922,7 @@ io_read(int argc, VALUE *argv, VALUE io)
previous_mode = set_binary_mode_with_seek_cur(fptr);
#endif
n = io_fread(str, 0, len, fptr);
- io_set_read_length(str, n, shrinkable);
+ io_set_read_length(str, n);
#if defined(RUBY_TEST_CRLF_ENVIRONMENT) || defined(_WIN32)
if (previous_mode == O_TEXT) {
setmode(fptr->fd, O_TEXT);
@@ -3209,7 +3074,7 @@ swallow(rb_io_t *fptr, int term)
}
static VALUE
-rb_io_getline_fast(rb_io_t *fptr, rb_encoding *enc, int chomp)
+rb_io_getline_fast(rb_io_t *fptr, rb_encoding *enc, VALUE io)
{
VALUE str = Qnil;
int len = 0;
@@ -3222,33 +3087,21 @@ rb_io_getline_fast(rb_io_t *fptr, rb_encoding *enc, int chomp)
if (pending > 0) {
const char *p = READ_DATA_PENDING_PTR(fptr);
const char *e;
- int chomplen = 0;
e = memchr(p, '\n', pending);
if (e) {
pending = (int)(e - p + 1);
- if (chomp) {
- chomplen = (pending > 1 && *(e-1) == '\r') + 1;
- }
}
if (NIL_P(str)) {
- str = rb_str_new(p, pending - chomplen);
+ str = rb_str_new(p, pending);
fptr->rbuf.off += pending;
fptr->rbuf.len -= pending;
}
else {
- rb_str_resize(str, len + pending - chomplen);
- read_buffered_data(RSTRING_PTR(str)+len, pending - chomplen, fptr);
- fptr->rbuf.off += chomplen;
- fptr->rbuf.len -= chomplen;
- if (pending == 1 && chomplen == 1 && len > 0) {
- if (RSTRING_PTR(str)[len-1] == '\r') {
- rb_str_resize(str, --len);
- break;
- }
- }
+ rb_str_resize(str, len + pending);
+ read_buffered_data(RSTRING_PTR(str)+len, pending, fptr);
}
- len += pending - chomplen;
+ len += pending;
if (cr != ENC_CODERANGE_BROKEN)
pos += rb_str_coderange_scan_restartable(RSTRING_PTR(str) + pos, RSTRING_PTR(str) + len, enc, &cr);
if (e) break;
@@ -3260,37 +3113,22 @@ rb_io_getline_fast(rb_io_t *fptr, rb_encoding *enc, int chomp)
str = io_enc_str(str, fptr);
ENC_CODERANGE_SET(str, cr);
fptr->lineno++;
+ if (io == ARGF.current_file) {
+ ARGF.lineno++;
+ ARGF.last_lineno = ARGF.lineno;
+ }
+ else {
+ ARGF.last_lineno = fptr->lineno;
+ }
return str;
}
-struct getline_arg {
- VALUE io;
- VALUE rs;
- long limit;
- unsigned int chomp: 1;
-};
-
-static void
-extract_getline_opts(VALUE opts, struct getline_arg *args)
-{
- int chomp = FALSE;
- if (!NIL_P(opts)) {
- static ID kwds[1];
- VALUE vchomp;
- if (!kwds[0]) {
- kwds[0] = rb_intern_const("chomp");
- }
- rb_get_kwargs(opts, kwds, 0, -2, &vchomp);
- chomp = (vchomp != Qundef) && RTEST(vchomp);
- }
- args->chomp = chomp;
-}
-
static void
-extract_getline_args(int argc, VALUE *argv, struct getline_arg *args)
+prepare_getline_args(int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
{
VALUE rs = rb_rs, lim = Qnil;
+ rb_io_t *fptr;
if (argc == 1) {
VALUE tmp = Qnil;
@@ -3303,20 +3141,10 @@ extract_getline_args(int argc, VALUE *argv, struct getline_arg *args)
}
}
else if (2 <= argc) {
- rs = argv[0], lim = argv[1];
+ rb_scan_args(argc, argv, "2", &rs, &lim);
if (!NIL_P(rs))
StringValue(rs);
}
- args->rs = rs;
- args->limit = NIL_P(lim) ? -1L : NUM2LONG(lim);
-}
-
-static void
-check_getline_args(VALUE *rsp, long *limit, VALUE io)
-{
- rb_io_t *fptr;
- VALUE rs = *rsp;
-
if (!NIL_P(rs)) {
rb_encoding *enc_rs, *enc_io;
@@ -3329,7 +3157,6 @@ check_getline_args(VALUE *rsp, long *limit, VALUE io)
if (rs == rb_default_rs) {
rs = rb_enc_str_new(0, 0, enc_io);
rb_str_buf_cat_ascii(rs, "\n");
- *rsp = rs;
}
else {
rb_raise(rb_eArgError, "encoding mismatch: %s IO with %s RS",
@@ -3338,30 +3165,23 @@ check_getline_args(VALUE *rsp, long *limit, VALUE io)
}
}
}
-}
-
-static void
-prepare_getline_args(int argc, VALUE *argv, struct getline_arg *args, VALUE io)
-{
- VALUE opts;
- argc = rb_scan_args(argc, argv, "02:", NULL, NULL, &opts);
- extract_getline_args(argc, argv, args);
- extract_getline_opts(opts, args);
- check_getline_args(&args->rs, &args->limit, io);
+ *rsp = rs;
+ *limit = NIL_P(lim) ? -1L : NUM2LONG(lim);
}
static VALUE
-rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
+rb_io_getline_1(VALUE rs, long limit, VALUE io)
{
VALUE str = Qnil;
+ rb_io_t *fptr;
int nolimit = 0;
rb_encoding *enc;
+ GetOpenFile(io, fptr);
rb_io_check_char_readable(fptr);
if (NIL_P(rs) && limit < 0) {
str = read_all(fptr, 0, Qnil);
if (RSTRING_LEN(str) == 0) return Qnil;
- if (chomp) rb_str_chomp_string(str, rb_default_rs);
}
else if (limit == 0) {
return rb_enc_str_new(0, 0, io_read_encoding(fptr));
@@ -3369,7 +3189,7 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
else if (rs == rb_default_rs && limit < 0 && !NEED_READCONV(fptr) &&
rb_enc_asciicompat(enc = io_read_encoding(fptr))) {
NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr);
- return rb_io_getline_fast(fptr, enc, chomp);
+ return rb_io_getline_fast(fptr, enc, io);
}
else {
int c, newline = -1;
@@ -3377,7 +3197,6 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
long rslen = 0;
int rspara = 0;
int extra_limit = 16;
- int chomp_cr = chomp;
SET_BINARY_MODE(fptr);
enc = io_read_encoding(fptr);
@@ -3402,10 +3221,9 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
rsptr = RSTRING_PTR(rs);
}
newline = (unsigned char)rsptr[rslen - 1];
- chomp_cr = chomp && rslen == 1 && newline == '\n';
}
- /* MS - Optimization */
+ /* MS - Optimisation */
while ((c = appendline(fptr, newline, &str, &limit)) != EOF) {
const char *s, *p, *pp, *e;
@@ -3417,13 +3235,7 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
pp = rb_enc_left_char_head(s, p, e, enc);
if (pp != p) continue;
if (!rspara) rscheck(rsptr, rslen, rs);
- if (memcmp(p, rsptr, rslen) == 0) {
- if (chomp) {
- if (chomp_cr && p > s && *(p-1) == '\r') --p;
- rb_str_set_len(str, p - s);
- }
- break;
- }
+ if (memcmp(p, rsptr, rslen) == 0) break;
}
if (limit == 0) {
s = RSTRING_PTR(str);
@@ -3451,28 +3263,12 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr)
if (!NIL_P(str) && !nolimit) {
fptr->lineno++;
- }
-
- return str;
-}
-
-static VALUE
-rb_io_getline_1(VALUE rs, long limit, int chomp, VALUE io)
-{
- rb_io_t *fptr;
- int old_lineno, new_lineno;
- VALUE str;
-
- GetOpenFile(io, fptr);
- old_lineno = fptr->lineno;
- str = rb_io_getline_0(rs, limit, chomp, fptr);
- if (!NIL_P(str) && (new_lineno = fptr->lineno) != old_lineno) {
if (io == ARGF.current_file) {
- ARGF.lineno += new_lineno - old_lineno;
+ ARGF.lineno++;
ARGF.last_lineno = ARGF.lineno;
}
else {
- ARGF.last_lineno = new_lineno;
+ ARGF.last_lineno = fptr->lineno;
}
}
@@ -3482,57 +3278,38 @@ rb_io_getline_1(VALUE rs, long limit, int chomp, VALUE io)
static VALUE
rb_io_getline(int argc, VALUE *argv, VALUE io)
{
- struct getline_arg args;
+ VALUE rs;
+ long limit;
- prepare_getline_args(argc, argv, &args, io);
- return rb_io_getline_1(args.rs, args.limit, args.chomp, io);
+ prepare_getline_args(argc, argv, &rs, &limit, io);
+ return rb_io_getline_1(rs, limit, io);
}
VALUE
rb_io_gets(VALUE io)
{
- return rb_io_getline_1(rb_default_rs, -1, FALSE, io);
-}
-
-VALUE
-rb_io_gets_internal(VALUE io)
-{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- return rb_io_getline_0(rb_default_rs, -1, FALSE, fptr);
+ return rb_io_getline_1(rb_default_rs, -1, io);
}
/*
* call-seq:
- * ios.gets(sep=$/ [, getline_args]) -> string or nil
- * ios.gets(limit [, getline_args]) -> string or nil
- * ios.gets(sep, limit [, getline_args]) -> string or nil
+ * ios.gets(sep=$/) -> string or nil
+ * ios.gets(limit) -> string or nil
+ * 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 +nil+ reads the entire
+ * <i>sep</i>. A separator of <code>nil</code> 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 +nil+ if called at end of
+ * to <code>$_</code>. Returns <code>nil</code> 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
@@ -3608,9 +3385,9 @@ rb_io_set_lineno(VALUE io, VALUE lineno)
/*
* call-seq:
- * ios.readline(sep=$/ [, getline_args]) -> string
- * ios.readline(limit [, getline_args]) -> string
- * ios.readline(sep, limit [, getline_args]) -> string
+ * ios.readline(sep=$/) -> string
+ * ios.readline(limit) -> string
+ * ios.readline(sep, limit) -> string
*
* Reads a line as with <code>IO#gets</code>, but raises an
* <code>EOFError</code> on end of file.
@@ -3627,50 +3404,35 @@ rb_io_readline(int argc, VALUE *argv, VALUE io)
return line;
}
-static VALUE io_readlines(const struct getline_arg *arg, VALUE io);
-
/*
* call-seq:
- * ios.readlines(sep=$/ [, getline_args]) -> array
- * ios.readlines(limit [, getline_args]) -> array
- * ios.readlines(sep, limit [, getline_args]) -> array
+ * ios.readlines(sep=$/) -> array
+ * ios.readlines(limit) -> array
+ * ios.readlines(sep, limit) -> array
*
* Reads all of the lines in <em>ios</em>, and returns them in
- * an array. Lines are separated by the optional <i>sep</i>. If
- * <i>sep</i> is +nil+, the rest of the stream is returned
- * as a single record.
- * If the first argument is an integer, or an
+ * <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
+ * 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
* reading or an <code>IOError</code> will be raised.
*
* f = File.new("testfile")
* f.readlines[0] #=> "This is line one\n"
- *
- * f = File.new("testfile", chomp: true)
- * f.readlines[0] #=> "This is line one"
- *
- * See IO.readlines for details about getline_args.
*/
static VALUE
rb_io_readlines(int argc, VALUE *argv, VALUE io)
{
- struct getline_arg args;
-
- prepare_getline_args(argc, argv, &args, io);
- return io_readlines(&args, io);
-}
-
-static VALUE
-io_readlines(const struct getline_arg *arg, VALUE io)
-{
- VALUE line, ary;
+ VALUE line, ary, rs;
+ long limit;
- if (arg->limit == 0)
+ prepare_getline_args(argc, argv, &rs, &limit, io);
+ if (limit == 0)
rb_raise(rb_eArgError, "invalid limit: 0 for readlines");
ary = rb_ary_new();
- while (!NIL_P(line = rb_io_getline_1(arg->rs, arg->limit, arg->chomp, io))) {
+ while (!NIL_P(line = rb_io_getline_1(rs, limit, io))) {
rb_ary_push(ary, line);
}
return ary;
@@ -3678,15 +3440,15 @@ io_readlines(const struct getline_arg *arg, VALUE io)
/*
* call-seq:
- * ios.each(sep=$/ [, getline_args]) {|line| block } -> ios
- * ios.each(limit [, getline_args]) {|line| block } -> ios
- * ios.each(sep, limit [, getline_args]) {|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=$/ [, getline_args]) {|line| block } -> ios
- * ios.each_line(limit [, getline_args]) {|line| block } -> ios
- * ios.each_line(sep, limit [, getline_args]) {|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
@@ -3703,21 +3465,19 @@ io_readlines(const struct getline_arg *arg, VALUE io)
* 2: This is line two
* 3: This is line three
* 4: And so on...
- *
- * See IO.readlines for details about getline_args.
*/
static VALUE
rb_io_each_line(int argc, VALUE *argv, VALUE io)
{
- VALUE str;
- struct getline_arg args;
+ VALUE str, rs;
+ long limit;
RETURN_ENUMERATOR(io, argc, argv);
- prepare_getline_args(argc, argv, &args, io);
- if (args.limit == 0)
+ prepare_getline_args(argc, argv, &rs, &limit, io);
+ if (limit == 0)
rb_raise(rb_eArgError, "invalid limit: 0 for each_line");
- while (!NIL_P(str = rb_io_getline_1(args.rs, args.limit, args.chomp, io))) {
+ while (!NIL_P(str = rb_io_getline_1(rs, limit, io))) {
rb_yield(str);
}
return io;
@@ -3794,9 +3554,9 @@ io_getc(rb_io_t *fptr, rb_encoding *enc)
VALUE str;
if (NEED_READCONV(fptr)) {
+ VALUE str = Qnil;
rb_encoding *read_enc = io_read_encoding(fptr);
- str = Qnil;
SET_BINARY_MODE(fptr);
make_readconv(fptr, 0);
@@ -3972,7 +3732,6 @@ 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 (;;) {
@@ -3991,16 +3750,13 @@ rb_io_each_codepoint(VALUE io)
}
if (more_char(fptr) == MORE_CHAR_FINISHED) {
clear_readconv(fptr);
- if (!MBCLEN_CHARFOUND_P(r)) {
- enc = fptr->encs.enc;
- goto invalid;
- }
+ /* ignore an incomplete character before EOF */
return io;
}
}
if (MBCLEN_INVALID_P(r)) {
- enc = fptr->encs.enc;
- goto invalid;
+ rb_raise(rb_eArgError, "invalid byte sequence in %s",
+ rb_enc_name(fptr->encs.enc));
}
n = MBCLEN_CHARFOUND_LEN(r);
if (fptr->encs.enc) {
@@ -4030,25 +3786,8 @@ 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;
}
@@ -4075,7 +3814,7 @@ rb_io_codepoints(VALUE io)
* ios.getc -> string or nil
*
* Reads a one-character string from <em>ios</em>. Returns
- * +nil+ if called at end of file.
+ * <code>nil</code> if called at end of file.
*
* f = File.new("testfile")
* f.getc #=> "h"
@@ -4121,10 +3860,10 @@ rb_io_readchar(VALUE io)
/*
* call-seq:
- * ios.getbyte -> integer or nil
+ * ios.getbyte -> fixnum or nil
*
* Gets the next 8-bit byte (0..255) from <em>ios</em>. Returns
- * +nil+ if called at end of file.
+ * <code>nil</code> if called at end of file.
*
* f = File.new("testfile")
* f.getbyte #=> 84
@@ -4158,7 +3897,7 @@ rb_io_getbyte(VALUE io)
/*
* call-seq:
- * ios.readbyte -> integer
+ * ios.readbyte -> fixnum
*
* Reads a byte as with <code>IO#getbyte</code>, but raises an
* <code>EOFError</code> on end of file.
@@ -4178,7 +3917,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
@@ -4512,16 +4251,12 @@ 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_flush(rb_io_t *fptr, int noraise, int keepgvl)
+fptr_finalize(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) {
@@ -4562,29 +4297,21 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl)
/* fptr->fd may be closed even if close fails.
* POSIX doesn't specify it.
* We assumes it is closed. */
-
- /**/
- keepgvl |= !(mode & FMODE_WRITABLE);
- keepgvl |= noraise;
- if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err))
+ if ((maygvl_close(fd, noraise) < 0) && NIL_P(err))
err = noraise ? Qtrue : INT2NUM(errno);
}
if (!NIL_P(err) && !noraise) {
- if (RB_INTEGER_TYPE_P(err))
- rb_syserr_fail_path(NUM2INT(err), fptr->pathv);
- else
- rb_exc_raise(err);
- }
-}
+ switch (TYPE(err)) {
+ case T_FIXNUM:
+ case T_BIGNUM:
+ errno = NUM2INT(err);
+ rb_sys_fail_path(fptr->pathv);
-static void
-fptr_finalize(rb_io_t *fptr, int noraise)
-{
- fptr_finalize_flush(fptr, noraise, FALSE);
- free_io_buffer(&fptr->rbuf);
- free_io_buffer(&fptr->wbuf);
- clear_codeconv(fptr);
+ default:
+ rb_exc_raise(err);
+ }
+ }
}
static void
@@ -4599,22 +4326,16 @@ 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;
}
- free_io_buffer(&fptr->cbuf);
+ if (fptr->cbuf.ptr) {
+ free(fptr->cbuf.ptr);
+ fptr->cbuf.ptr = NULL;
+ }
}
static void
@@ -4642,13 +4363,21 @@ rb_io_fptr_finalize(rb_io_t *fptr)
if (0 <= fptr->fd)
rb_io_fptr_cleanup(fptr, TRUE);
fptr->write_lock = 0;
- free_io_buffer(&fptr->rbuf);
- free_io_buffer(&fptr->wbuf);
+ if (fptr->rbuf.ptr) {
+ free(fptr->rbuf.ptr);
+ fptr->rbuf.ptr = 0;
+ }
+ if (fptr->wbuf.ptr) {
+ free(fptr->wbuf.ptr);
+ fptr->wbuf.ptr = 0;
+ }
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)
{
@@ -4661,22 +4390,13 @@ rb_io_memsize(const rb_io_t *fptr)
return size;
}
-#ifdef _WIN32
-/* keep GVL while closing to prevent crash on Windows */
-# define KEEPGVL TRUE
-#else
-# define KEEPGVL FALSE
-#endif
-
-int rb_notify_fd_close(int fd);
-static rb_io_t *
-io_close_fptr(VALUE io)
+VALUE
+rb_io_close(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) {
@@ -4687,35 +4407,19 @@ io_close_fptr(VALUE io)
}
fptr = RFILE(io)->fptr;
- if (!fptr) return 0;
- if (fptr->fd < 0) return 0;
+ if (!fptr) return Qnil;
+ if (fptr->fd < 0) return Qnil;
fd = fptr->fd;
- busy = rb_notify_fd_close(fd);
- if (busy) {
- fptr_finalize_flush(fptr, FALSE, KEEPGVL);
- do rb_thread_schedule(); while (rb_notify_fd_close(fd));
- }
+ rb_thread_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_waitpid(fptr->pid, &status, nohang ? WNOHANG : 0);
+ rb_last_status_clear();
+ rb_syswait(fptr->pid);
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;
}
@@ -4731,17 +4435,12 @@ 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_t *fptr = rb_io_get_fptr(io);
- if (fptr->fd < 0) {
- return Qnil;
- }
+ rb_io_check_closed(RFILE(io)->fptr);
rb_io_close(io);
return Qnil;
}
@@ -4810,7 +4509,8 @@ rb_io_closed(VALUE io)
}
}
- fptr = rb_io_get_fptr(io);
+ fptr = RFILE(io)->fptr;
+ rb_io_check_initialized(fptr);
return 0 <= fptr->fd ? Qfalse : Qtrue;
}
@@ -4830,8 +4530,6 @@ rb_io_closed(VALUE io)
*
* prog.rb:3:in `readlines': not opened for reading (IOError)
* from prog.rb:3
- *
- * Calling this method on closed IO object is just ignored since Ruby 2.3.
*/
static VALUE
@@ -4840,8 +4538,7 @@ rb_io_close_read(VALUE io)
rb_io_t *fptr;
VALUE write_io;
- fptr = rb_io_get_fptr(rb_io_taint_check(io));
- if (fptr->fd < 0) return Qnil;
+ GetOpenFile(io, fptr);
if (is_socket(fptr->fd, fptr->pathv)) {
#ifndef SHUT_RD
# define SHUT_RD 0
@@ -4857,19 +4554,20 @@ rb_io_close_read(VALUE io)
write_io = GetWriteIO(io);
if (io != write_io) {
rb_io_t *wfptr;
- wfptr = rb_io_get_fptr(rb_io_taint_check(write_io));
+ GetOpenFile(write_io, wfptr);
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_DUPLEX|FMODE_WRITABLE)) == FMODE_WRITABLE) {
+ if (fptr->mode & FMODE_WRITABLE) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
return rb_io_close(io);
@@ -4892,8 +4590,6 @@ rb_io_close_read(VALUE io)
* prog.rb:3:in `write': not opened for writing (IOError)
* from prog.rb:3:in `print'
* from prog.rb:3
- *
- * Calling this method on closed IO object is just ignored since Ruby 2.3.
*/
static VALUE
@@ -4903,8 +4599,7 @@ rb_io_close_write(VALUE io)
VALUE write_io;
write_io = GetWriteIO(io);
- fptr = rb_io_get_fptr(rb_io_taint_check(write_io));
- if (fptr->fd < 0) return Qnil;
+ GetOpenFile(write_io, fptr);
if (is_socket(fptr->fd, fptr->pathv)) {
#ifndef SHUT_WR
# define SHUT_WR 1
@@ -4917,13 +4612,14 @@ rb_io_close_write(VALUE io)
return Qnil;
}
- if ((fptr->mode & (FMODE_DUPLEX|FMODE_READABLE)) == FMODE_READABLE) {
+ if (fptr->mode & FMODE_READABLE) {
rb_raise(rb_eIOError, "closing non-duplex IO for writing");
}
if (io != write_io) {
- fptr = rb_io_get_fptr(rb_io_taint_check(io));
+ GetOpenFile(io, fptr);
fptr->tied_io_for_writing = 0;
+ fptr->mode &= ~FMODE_DUPLEX;
}
rb_io_close(write_io);
return Qnil;
@@ -4985,10 +4681,8 @@ rb_io_sysseek(int argc, VALUE *argv, VALUE io)
static VALUE
rb_io_syswrite(VALUE io, VALUE str)
{
- VALUE tmp;
rb_io_t *fptr;
- long n, len;
- const char *ptr;
+ long n;
if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
@@ -4997,15 +4691,16 @@ rb_io_syswrite(VALUE io, VALUE str)
GetOpenFile(io, fptr);
rb_io_check_writable(fptr);
+ str = rb_str_new_frozen(str);
+
if (fptr->wbuf.len) {
rb_warn("syswrite for buffered IO");
}
- tmp = rb_str_tmp_frozen_acquire(str);
- RSTRING_GETMEM(tmp, ptr, len);
- n = rb_write_internal(fptr->fd, ptr, len);
+ 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);
- rb_str_tmp_frozen_release(str, tmp);
return LONG2FIX(n);
}
@@ -5017,12 +4712,10 @@ 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 _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
+ * If the optional <i>outbuf</i> argument is present, it must reference
+ * a String, which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
* even if it is not empty at the beginning.
- *
* Raises <code>SystemCallError</code> on error and
* <code>EOFError</code> at end of file.
*
@@ -5037,12 +4730,11 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
rb_io_t *fptr;
long n, ilen;
struct read_internal_arg arg;
- int shrinkable;
rb_scan_args(argc, argv, "11", &len, &str);
ilen = NUM2LONG(len);
- shrinkable = io_setstrbuf(&str, ilen);
+ io_setstrbuf(&str,ilen);
if (ilen == 0) return str;
GetOpenFile(io, fptr);
@@ -5052,6 +4744,8 @@ 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
@@ -5074,7 +4768,7 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
if (n == -1) {
rb_sys_fail_path(fptr->pathv);
}
- io_set_read_length(str, n, shrinkable);
+ io_set_read_length(str, n);
if (n == 0 && ilen > 0) {
rb_eof_error();
}
@@ -5083,154 +4777,6 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
return str;
}
-#if defined(HAVE_PREAD) || defined(HAVE_PWRITE)
-struct prdwr_internal_arg {
- int fd;
- void *buf;
- size_t count;
- off_t offset;
-};
-#endif /* HAVE_PREAD || HAVE_PWRITE */
-
-#if defined(HAVE_PREAD)
-static VALUE
-internal_pread_func(void *arg)
-{
- struct prdwr_internal_arg *p = arg;
- return (VALUE)pread(p->fd, p->buf, p->count, p->offset);
-}
-
-static VALUE
-pread_internal_call(VALUE arg)
-{
- struct prdwr_internal_arg *p = (struct prdwr_internal_arg *)arg;
- return rb_thread_io_blocking_region(internal_pread_func, p, p->fd);
-}
-
-/*
- * call-seq:
- * ios.pread(maxlen, offset[, outbuf]) -> string
- *
- * Reads <i>maxlen</i> bytes from <em>ios</em> using the pread system call
- * and returns them as a string without modifying the underlying
- * descriptor offset. This is advantageous compared to combining IO#seek
- * and IO#read in that it is atomic, allowing multiple threads/process to
- * share the same IO object for reading the file at various locations.
- * This bypasses any userspace buffering of the IO layer.
- * If the optional <i>outbuf</i> argument is present, it must
- * reference a String, which will receive the data.
- * Raises <code>SystemCallError</code> on error, <code>EOFError</code>
- * at end of file and <code>NotImplementedError</code> if platform does not
- * implement the system call.
- *
- * File.write("testfile", "This is line one\nThis is line two\n")
- * File.open("testfile") do |f|
- * p f.read # => "This is line one\nThis is line two\n"
- * p f.pread(12, 0) # => "This is line"
- * p f.pread(9, 8) # => "line one\n"
- * end
- */
-static VALUE
-rb_io_pread(int argc, VALUE *argv, VALUE io)
-{
- VALUE len, offset, str;
- rb_io_t *fptr;
- ssize_t n;
- struct prdwr_internal_arg arg;
- int shrinkable;
-
- rb_scan_args(argc, argv, "21", &len, &offset, &str);
- arg.count = NUM2SIZET(len);
- arg.offset = NUM2OFFT(offset);
-
- shrinkable = io_setstrbuf(&str, (long)arg.count);
- if (arg.count == 0) return str;
- arg.buf = RSTRING_PTR(str);
-
- GetOpenFile(io, fptr);
- rb_io_check_byte_readable(fptr);
-
- arg.fd = fptr->fd;
- rb_io_check_closed(fptr);
-
- rb_str_locktmp(str);
- n = (ssize_t)rb_ensure(pread_internal_call, (VALUE)&arg, rb_str_unlocktmp, str);
-
- if (n == -1) {
- rb_sys_fail_path(fptr->pathv);
- }
- io_set_read_length(str, n, shrinkable);
- if (n == 0 && arg.count > 0) {
- rb_eof_error();
- }
- OBJ_TAINT(str);
-
- return str;
-}
-#else
-# define rb_io_pread rb_f_notimplement
-#endif /* HAVE_PREAD */
-
-#if defined(HAVE_PWRITE)
-static VALUE
-internal_pwrite_func(void *ptr)
-{
- struct prdwr_internal_arg *arg = ptr;
-
- return (VALUE)pwrite(arg->fd, arg->buf, arg->count, arg->offset);
-}
-
-/*
- * call-seq:
- * ios.pwrite(string, offset) -> integer
- *
- * Writes the given string to <em>ios</em> at <i>offset</i> using pwrite()
- * system call. This is advantageous to combining IO#seek and IO#write
- * in that it is atomic, allowing multiple threads/process to share the
- * same IO object for reading the file at various locations.
- * This bypasses any userspace buffering of the IO layer.
- * Returns the number of bytes written.
- * Raises <code>SystemCallError</code> on error and <code>NotImplementedError</code>
- * if platform does not implement the system call.
- *
- * File.open("out", "w") do |f|
- * f.pwrite("ABCDEF", 3) #=> 6
- * end
- *
- * File.read("out") #=> "\u0000\u0000\u0000ABCDEF"
- */
-static VALUE
-rb_io_pwrite(VALUE io, VALUE str, VALUE offset)
-{
- rb_io_t *fptr;
- ssize_t n;
- struct prdwr_internal_arg arg;
- VALUE tmp;
-
- if (!RB_TYPE_P(str, T_STRING))
- str = rb_obj_as_string(str);
-
- arg.offset = NUM2OFFT(offset);
-
- io = GetWriteIO(io);
- GetOpenFile(io, fptr);
- rb_io_check_writable(fptr);
- arg.fd = fptr->fd;
-
- tmp = rb_str_tmp_frozen_acquire(str);
- arg.buf = RSTRING_PTR(tmp);
- arg.count = (size_t)RSTRING_LEN(tmp);
-
- n = (ssize_t)rb_thread_io_blocking_region(internal_pwrite_func, &arg, fptr->fd);
- if (n == -1) rb_sys_fail_path(fptr->pathv);
- rb_str_tmp_frozen_release(str, tmp);
-
- return SSIZET2NUM(n);
-}
-#else
-# define rb_io_pwrite rb_f_notimplement
-#endif /* HAVE_PWRITE */
-
VALUE
rb_io_binmode(VALUE io)
{
@@ -5298,6 +4844,7 @@ rb_io_ascii8bit_binmode(VALUE io)
* - newline conversion disabled
* - encoding conversion disabled
* - content is treated as ASCII-8BIT
+ *
*/
static VALUE
@@ -5351,14 +4898,15 @@ 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;
}
@@ -5397,9 +4945,7 @@ rb_io_modestr_fmode(const char *modestr)
default:
goto error;
case ':':
- p = strchr(m, ':');
- if (io_encname_bom_p(m, p ? (long)(p - m) : (long)strlen(m)))
- fmode |= FMODE_SETENC_BY_BOM;
+ p = m;
goto finished;
}
}
@@ -5407,6 +4953,8 @@ 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;
}
@@ -5416,7 +4964,7 @@ rb_io_oflags_fmode(int oflags)
{
int fmode = 0;
- switch (oflags & O_ACCMODE) {
+ switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
case O_RDONLY:
fmode = FMODE_READABLE;
break;
@@ -5512,9 +5060,6 @@ 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+");
}
}
@@ -5553,42 +5098,45 @@ rb_io_ext_int_to_encs(rb_encoding *ext, rb_encoding *intern, rb_encoding **enc,
}
static void
-unsupported_encoding(const char *name, rb_encoding *enc)
+unsupported_encoding(const char *name)
{
- rb_enc_warn(enc, "Unsupported encoding %s ignored", name);
+ rb_warn("Unsupported encoding %s ignored", name);
}
static void
-parse_mode_enc(const char *estr, rb_encoding *estr_enc,
- rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
+parse_mode_enc(const char *estr, 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, ':');
- 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;
- }
+ if (p) {
+ long len = (p++) - estr;
+ if (len == 0 || len > ENCODING_MAXNAMELEN)
+ idx = -1;
else {
- rb_enc_warn(estr_enc, "BOM with non-UTF encoding %s is nonsense", estr);
- fmode &= ~FMODE_SETENC_BY_BOM;
+ 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);
}
}
- if (len == 0 || len > ENCODING_MAXNAMELEN) {
- idx = -1;
- }
else {
- if (p) {
+ long len = strlen(estr);
+ 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;
@@ -5601,7 +5149,7 @@ parse_mode_enc(const char *estr, rb_encoding *estr_enc,
ext_enc = rb_enc_from_index(idx);
else {
if (idx != -2)
- unsupported_encoding(estr, estr_enc);
+ unsupported_encoding(estr);
ext_enc = NULL;
}
@@ -5614,7 +5162,7 @@ parse_mode_enc(const char *estr, rb_encoding *estr_enc,
else {
idx2 = rb_enc_find_index(p);
if (idx2 < 0)
- unsupported_encoding(p, estr_enc);
+ unsupported_encoding(p);
else if (!(fmode & FMODE_SETENC_BY_BOM) && (idx2 == idx)) {
int_enc = (rb_encoding *)Qnil;
}
@@ -5681,8 +5229,7 @@ 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), rb_enc_get(tmp),
- enc_p, enc2_p, fmode_p);
+ parse_mode_enc(StringValueCStr(tmp), enc_p, enc2_p, fmode_p);
}
else {
rb_io_ext_int_to_encs(rb_to_encoding(encoding), NULL, enc_p, enc2_p, 0);
@@ -5708,12 +5255,9 @@ validate_enc_binmode(int *fmode_p, int ecflags, rb_encoding *enc, rb_encoding *e
!rb_enc_asciicompat(enc ? enc : rb_default_external_encoding()))
rb_raise(rb_eArgError, "ASCII incompatible encoding needs binmode");
- if ((fmode & FMODE_BINMODE) && (ecflags & ECONV_NEWLINE_DECORATOR_MASK)) {
- rb_raise(rb_eArgError, "newline decorator with binary mode");
- }
if (!(fmode & FMODE_BINMODE) &&
(DEFAULT_TEXTMODE || (ecflags & ECONV_NEWLINE_DECORATOR_MASK))) {
- fmode |= FMODE_TEXTMODE;
+ fmode |= DEFAULT_TEXTMODE;
*fmode_p = fmode;
}
#if !DEFAULT_TEXTMODE
@@ -5790,7 +5334,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, rb_enc_get(vmode), &enc, &enc2, &fmode);
+ parse_mode_enc(p+1, &enc, &enc2, &fmode);
}
else {
rb_encoding *e;
@@ -5814,24 +5358,6 @@ 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
@@ -5845,6 +5371,17 @@ 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) {
@@ -5918,18 +5455,17 @@ 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) {
- int e = errno;
- if (rb_gc_for_fd(e)) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
fd = rb_sysopen_internal(&data);
}
if (fd < 0) {
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
}
return fd;
@@ -5945,25 +5481,24 @@ rb_fdopen(int fd, const char *modestr)
#endif
file = fdopen(fd, modestr);
if (!file) {
- int e = errno;
+ if (
#if defined(__sun)
- if (e == 0) {
+ errno == 0 ||
+#endif
+ errno == EMFILE || errno == ENFILE) {
rb_gc();
+#if defined(__sun)
errno = 0;
- file = fdopen(fd, modestr);
- }
- else
#endif
- if (rb_gc_for_fd(e)) {
file = fdopen(fd, modestr);
}
if (!file) {
#ifdef _WIN32
- if (e == 0) e = EINVAL;
+ if (errno == 0) errno = EINVAL;
#elif defined(__sun)
- if (e == 0) e = EMFILE;
+ if (errno == 0) errno = EMFILE;
#endif
- rb_syserr_fail(e, 0);
+ rb_sys_fail(0);
}
}
@@ -5975,13 +5510,11 @@ rb_fdopen(int fd, const char *modestr)
return file;
}
-static int
+static void
io_check_tty(rb_io_t *fptr)
{
- int t = isatty(fptr->fd);
- if (t)
+ if (isatty(fptr->fd))
fptr->mode |= FMODE_TTY|FMODE_DUPLEX;
- return t;
}
static VALUE rb_io_internal_encoding(VALUE);
@@ -5991,10 +5524,7 @@ static int
io_strip_bom(VALUE io)
{
VALUE b1, b2, b3, b4;
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
- if (!(fptr->mode & FMODE_READABLE)) return 0;
if (NIL_P(b1 = rb_io_getbyte(io))) return 0;
switch (b1) {
case INT2FIX(0xEF):
@@ -6025,9 +5555,12 @@ io_strip_bom(VALUE io)
return ENCINDEX_UTF_32LE;
}
rb_io_ungetbyte(io, b4);
+ rb_io_ungetbyte(io, b3);
+ }
+ else {
+ rb_io_ungetbyte(io, b3);
+ return ENCINDEX_UTF_16LE;
}
- rb_io_ungetbyte(io, b3);
- return ENCINDEX_UTF_16LE;
}
rb_io_ungetbyte(io, b2);
break;
@@ -6067,10 +5600,8 @@ io_set_encoding_by_bom(VALUE io)
}
static VALUE
-rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode,
- const convconfig_t *convconfig, mode_t perm)
+rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode, convconfig_t *convconfig, mode_t perm)
{
- VALUE pathv;
rb_io_t *fptr;
convconfig_t cc;
if (!convconfig) {
@@ -6086,15 +5617,8 @@ rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode,
MakeOpenFile(io, fptr);
fptr->mode = fmode;
fptr->encs = *convconfig;
- pathv = rb_str_new_frozen(filename);
-#ifdef O_TMPFILE
- if (!(oflags & O_TMPFILE)) {
- fptr->pathv = pathv;
- }
-#else
- fptr->pathv = pathv;
-#endif
- fptr->fd = rb_sysopen(pathv, oflags, perm);
+ fptr->pathv = rb_str_new_frozen(filename);
+ fptr->fd = rb_sysopen(fptr->pathv, oflags, perm);
io_check_tty(fptr);
if (fmode & FMODE_SETENC_BY_BOM) io_set_encoding_by_bom(io);
@@ -6109,8 +5633,7 @@ rb_file_open_internal(VALUE io, VALUE filename, const char *modestr)
convconfig_t convconfig;
if (p) {
- parse_mode_enc(p+1, rb_usascii_encoding(),
- &convconfig.enc, &convconfig.enc2, &fmode);
+ parse_mode_enc(p+1, &convconfig.enc, &convconfig.enc2, &fmode);
}
else {
rb_encoding *e;
@@ -6182,7 +5705,6 @@ pipe_del_fptr(rb_io_t *fptr)
}
}
-#if defined (_WIN32) || defined(__CYGWIN__)
static void
pipe_atexit(void)
{
@@ -6195,7 +5717,6 @@ pipe_atexit(void)
list = tmp;
}
}
-#endif
static void
pipe_finalize(rb_io_t *fptr, int noraise)
@@ -6234,7 +5755,8 @@ rb_pipe(int *pipes)
int ret;
ret = rb_cloexec_pipe(pipes);
if (ret == -1) {
- if (rb_gc_for_fd(errno)) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
ret = rb_cloexec_pipe(pipes);
}
}
@@ -6339,20 +5861,19 @@ 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++) {
@@ -6363,13 +5884,12 @@ 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
@@ -6381,20 +5901,15 @@ 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);
+ rb_execarg_fixup(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,
- const convconfig_t *convconfig)
+pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convconfig)
{
struct rb_execarg *eargp = NIL_P(execarg_obj) ? NULL : rb_execarg_get(execarg_obj);
VALUE prog = eargp ? (eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name) : Qfalse ;
@@ -6410,8 +5925,8 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
#if defined(HAVE_WORKING_FORK) || defined(HAVE_SPAWNV)
int state;
struct popen_arg arg;
-#endif
int e = 0;
+#endif
#if defined(HAVE_SPAWNV)
# if defined(HAVE_SPAWNVE)
# define DO_SPAWN(cmd, args, envp) ((args) ? \
@@ -6437,6 +5952,10 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
int write_fd = -1;
#if !defined(HAVE_WORKING_FORK)
const char *cmd = 0;
+#if !defined(HAVE_SPAWNV)
+ int argc;
+ VALUE *argv;
+#endif
if (prog)
cmd = StringValueCStr(prog);
@@ -6458,10 +5977,11 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
if (rb_pipe(arg.write_pair) < 0)
rb_sys_fail_str(prog);
if (rb_pipe(arg.pair) < 0) {
- e = errno;
+ int e = errno;
close(arg.write_pair[0]);
close(arg.write_pair[1]);
- rb_syserr_fail_str(e, prog);
+ errno = e;
+ rb_sys_fail_str(prog);
}
if (eargp) {
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.write_pair[0]));
@@ -6490,7 +6010,6 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
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);
}
@@ -6516,7 +6035,6 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
if (eargp)
rb_execarg_run_options(sargp, NULL, NULL, 0);
# endif
- rb_execarg_parent_end(execarg_obj);
}
else {
# if defined(HAVE_WORKING_FORK)
@@ -6544,11 +6062,12 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
close(arg.write_pair[0]);
close(arg.write_pair[1]);
}
+ errno = e;
# if defined(HAVE_WORKING_FORK)
if (errmsg[0])
- rb_syserr_fail(e, errmsg);
+ rb_sys_fail(errmsg);
# endif
- rb_syserr_fail_str(e, prog);
+ rb_sys_fail_str(prog);
}
if ((fmode & FMODE_READABLE) && (fmode & FMODE_WRITABLE)) {
close(arg.pair[1]);
@@ -6565,18 +6084,18 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
fd = arg.pair[1];
}
#else
- cmd = rb_execarg_commandline(eargp, &prog);
+ if (argc) {
+ prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
+ cmd = StringValueCStr(prog);
+ }
if (!NIL_P(execarg_obj)) {
- rb_execarg_parent_start(execarg_obj);
+ rb_execarg_fixup(execarg_obj);
rb_execarg_run_options(eargp, sargp, NULL, 0);
}
fp = popen(cmd, modestr);
- e = errno;
- if (eargp) {
- rb_execarg_parent_end(execarg_obj);
+ if (eargp)
rb_execarg_run_options(sargp, NULL, NULL, 0);
- }
- if (!fp) rb_syserr_fail_path(e, prog);
+ if (!fp) rb_sys_fail_path(prog);
fd = fileno(fp);
#endif
@@ -6637,8 +6156,7 @@ is_popen_fork(VALUE prog)
}
static VALUE
-pipe_open_s(VALUE prog, const char *modestr, int fmode,
- const convconfig_t *convconfig)
+pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
{
int argc = 1;
VALUE *argv = &prog;
@@ -6649,16 +6167,6 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode,
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
@@ -6684,7 +6192,7 @@ pipe_close(VALUE io)
*
* If <i>cmd</i> is an +Array+ of +String+,
* then it will be used as the subprocess's +argv+ bypassing a shell.
- * The array can contain a hash at first for environments and
+ * The array can contains a hash at first for environments and
* a hash at last for options similar to <code>spawn</code>.
*
* The default mode for the new file object is ``r'',
@@ -6713,7 +6221,7 @@ pipe_close(VALUE io)
* 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 closes the pipe and sets <code>$?</code>.
+ * At the end of block, Ruby close the pipe and sets <code>$?</code>.
* In this case <code>IO.popen</code> returns
* the value of the block.
*
@@ -6721,7 +6229,7 @@ pipe_close(VALUE io)
* 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 +nil+, and the child's standard in and
+ * will be passed <code>nil</code>, and the child's standard in and
* standard out will be connected to the parent through the pipe. Not
* available on all platforms.
*
@@ -6729,7 +6237,7 @@ pipe_close(VALUE io)
* 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|
@@ -6809,7 +6317,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, pipe_close, port);
+ return rb_ensure(rb_yield, port, io_close, port);
}
return port;
}
@@ -6877,7 +6385,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,
@@ -6901,10 +6409,10 @@ rb_io_s_open(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * IO.sysopen(path, [mode, [perm]]) -> integer
+ * IO.sysopen(path, [mode, [perm]]) -> fixnum
*
* Opens the given path, returning the underlying file descriptor as a
- * <code>Integer</code>.
+ * <code>Fixnum</code>.
*
* IO.sysopen("testfile") #=> 3
*/
@@ -6989,7 +6497,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.
*
@@ -7022,7 +6530,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
@@ -7077,7 +6585,7 @@ rb_f_open(int argc, VALUE *argv)
}
}
if (redirect) {
- VALUE io = rb_funcallv(argv[0], to_open, argc-1, argv+1);
+ VALUE io = rb_funcall2(argv[0], to_open, argc-1, argv+1);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, io, io_close, io);
@@ -7087,40 +6595,37 @@ rb_f_open(int argc, VALUE *argv)
return rb_io_s_open(argc, argv, rb_cFile);
}
-static VALUE rb_io_open_generic(VALUE, VALUE, int, int, const convconfig_t *, mode_t);
-
static VALUE
-rb_io_open(VALUE io, VALUE filename, VALUE vmode, VALUE vperm, VALUE opt)
+rb_io_open(VALUE filename, VALUE vmode, VALUE vperm, VALUE opt)
{
+ VALUE cmd;
int oflags, fmode;
convconfig_t convconfig;
mode_t perm;
rb_io_extract_modeenc(&vmode, &vperm, opt, &oflags, &fmode, &convconfig);
perm = NIL_P(vperm) ? 0666 : NUM2MODET(vperm);
- return rb_io_open_generic(io, filename, oflags, fmode, &convconfig, perm);
-}
-static VALUE
-rb_io_open_generic(VALUE klass, VALUE filename, int oflags, int fmode,
- const convconfig_t *convconfig, mode_t perm)
-{
- VALUE cmd;
- const int warn = klass == rb_cFile;
- if ((warn || klass == rb_cIO) && !NIL_P(cmd = check_pipe_command(filename))) {
- if (warn) {
- rb_warn("IO.%"PRIsVALUE" called on File to invoke external command",
- rb_id2str(rb_frame_this_func()));
- }
- return pipe_open_s(cmd, rb_io_oflags_modestr(oflags), fmode, convconfig);
+ if (!NIL_P(cmd = check_pipe_command(filename))) {
+ return pipe_open_s(cmd, rb_io_oflags_modestr(oflags), fmode, &convconfig);
}
else {
- return rb_file_open_generic(io_alloc(klass), filename,
- oflags, fmode, convconfig, perm);
+ return rb_file_open_generic(io_alloc(rb_cFile), filename,
+ oflags, fmode, &convconfig, perm);
}
}
static VALUE
+rb_io_open_with_args(int argc, const VALUE *argv)
+{
+ VALUE io;
+
+ io = io_alloc(rb_cFile);
+ rb_open_file(argc, argv, io);
+ return io;
+}
+
+static VALUE
io_reopen(VALUE io, VALUE nfile)
{
rb_io_t *fptr, *orig;
@@ -7187,7 +6692,7 @@ io_reopen(VALUE io, VALUE nfile)
rb_update_max_fd(fd);
fptr->fd = fd;
}
- rb_notify_fd_close(fd);
+ rb_thread_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);
@@ -7206,20 +6711,6 @@ 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
@@ -7277,7 +6768,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
oflags = rb_io_fmode_oflags(fptr->mode);
}
- fptr->pathv = fname;
+ fptr->pathv = rb_str_new_frozen(fname);
if (fptr->fd < 0) {
fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666);
fptr->stdio_file = 0;
@@ -7291,10 +6782,9 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
fptr->rbuf.off = fptr->rbuf.len = 0;
if (fptr->stdio_file) {
- 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);
+ if (freopen(RSTRING_PTR(fptr->pathv), rb_io_oflags_modestr(oflags), fptr->stdio_file) == 0) {
+ rb_sys_fail_path(fptr->pathv);
+ }
fptr->fd = fileno(fptr->stdio_file);
rb_fd_fix_cloexec(fptr->fd);
#ifdef USE_SETVBUF
@@ -7419,20 +6909,18 @@ 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>. 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.
+ * 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>.
*
* $stdout.print("This is ", 100, " percent.\n")
*
@@ -7501,10 +6989,10 @@ rb_f_print(int argc, const VALUE *argv)
* ios.putc(obj) -> obj
*
* If <i>obj</i> is <code>Numeric</code>, write the character whose code is
- * the least-significant byte of <i>obj</i>.
- * If <i>obj</i> is <code>String</code>, write the first character
- * of <i>obj</i> to <em>ios</em>.
- * Otherwise, raise <code>TypeError</code>.
+ * the least-significant byte of <i>obj</i>, otherwise write the first byte
+ * of the string representation of <i>obj</i> to <em>ios</em>. Note: This
+ * method is not safe for use with multi-byte characters as it will truncate
+ * them.
*
* $stdout.putc "A"
* $stdout.putc 65
@@ -7537,8 +7025,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
@@ -7547,12 +7035,12 @@ rb_f_putc(VALUE recv, VALUE ch)
if (recv == rb_stdout) {
return rb_io_putc(recv, ch);
}
- return rb_funcallv(rb_stdout, rb_intern("putc"), 1, &ch);
+ return rb_funcall2(rb_stdout, rb_intern("putc"), 1, &ch);
}
-int
-rb_str_end_with_asciichar(VALUE str, int c)
+static int
+str_end_with_asciichar(VALUE str, int c)
{
long len = RSTRING_LEN(str);
const char *ptr = RSTRING_PTR(str);
@@ -7590,17 +7078,13 @@ io_puts_ary(VALUE ary, VALUE out, int recur)
* call-seq:
* ios.puts(obj, ...) -> nil
*
- * 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.
+ * 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.
* If called with an array argument, writes each element on a new line.
- * 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.
+ * If called without arguments, outputs a single record separator.
*
- * $stdout.puts("this", "is", ["a", "test"])
+ * $stdout.puts("this", "is", "a", "test")
*
* <em>produces:</em>
*
@@ -7608,16 +7092,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, const VALUE *argv, VALUE out)
{
- int i, n;
- VALUE line, args[2];
+ int i;
+ VALUE line;
/* if no argument given, print newline. */
if (argc == 0) {
@@ -7634,13 +7115,11 @@ rb_io_puts(int argc, const VALUE *argv, VALUE out)
}
line = rb_obj_as_string(argv[i]);
string:
- n = 0;
- args[n++] = line;
+ rb_io_write(out, line);
if (RSTRING_LEN(line) == 0 ||
- !rb_str_end_with_asciichar(line, '\n')) {
- args[n++] = rb_default_rs;
+ !str_end_with_asciichar(line, '\n')) {
+ rb_io_write(out, rb_default_rs);
}
- rb_io_writev(out, n, args);
}
return Qnil;
@@ -7661,21 +7140,21 @@ rb_f_puts(int argc, VALUE *argv, VALUE recv)
if (recv == rb_stdout) {
return rb_io_puts(argc, argv, recv);
}
- return rb_funcallv(rb_stdout, rb_intern("puts"), argc, argv);
+ return rb_funcall2(rb_stdout, rb_intern("puts"), argc, argv);
}
void
rb_p(VALUE obj) /* for debug print within C code */
{
- VALUE args[2];
- args[0] = rb_obj_as_string(rb_inspect(obj));
- args[1] = rb_default_rs;
+ VALUE str = rb_obj_as_string(rb_inspect(obj));
if (RB_TYPE_P(rb_stdout, T_FILE) &&
rb_method_basic_definition_p(CLASS_OF(rb_stdout), id_write)) {
- io_writev(2, args, rb_stdout);
+ io_write(rb_stdout, str, 1);
+ io_write(rb_stdout, rb_default_rs, 0);
}
else {
- rb_io_writev(rb_stdout, 2, args);
+ rb_io_write(rb_stdout, str);
+ rb_io_write(rb_stdout, rb_default_rs);
}
}
@@ -7745,7 +7224,6 @@ rb_f_p(int argc, VALUE *argv, VALUE self)
*
* def display(port=$>)
* port.write self
- * nil
* end
*
* For example:
@@ -7757,7 +7235,7 @@ rb_f_p(int argc, VALUE *argv, VALUE self)
*
* <em>produces:</em>
*
- * 1cat[4, 5, 6]
+ * 1cat456
*/
static VALUE
@@ -7780,11 +7258,6 @@ void
rb_write_error2(const char *mesg, long len)
{
if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
-#ifdef _WIN32
- if (isatty(fileno(stderr))) {
- if (rb_w32_write_console(rb_str_new(mesg, len), fileno(stderr)) > 0) return;
- }
-#endif
if (fwrite(mesg, sizeof(char), (size_t)len, stderr) < (size_t)len) {
/* failed to write to stderr, what can we do? */
return;
@@ -7807,11 +7280,6 @@ 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;
@@ -7823,21 +7291,13 @@ rb_write_error_str(VALUE mesg)
}
}
-int
-rb_stderr_tty_p(void)
-{
- if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0)
- return isatty(fileno(stderr));
- return 0;
-}
-
static void
must_respond_to(ID mid, VALUE val, ID id)
{
if (!rb_respond_to(val, mid)) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE" must have %"PRIsVALUE" method, %"PRIsVALUE" given",
- rb_id2str(id), rb_id2str(mid),
- rb_obj_class(val));
+ rb_raise(rb_eTypeError, "%s must have %s method, %s given",
+ rb_id2name(id), rb_id2name(mid),
+ rb_obj_classname(val));
}
}
@@ -7856,13 +7316,14 @@ prep_io(int fd, int fmode, VALUE klass, const char *path)
MakeOpenFile(io, fp);
fp->fd = fd;
- fp->mode = fmode;
- if (!io_check_tty(fp)) {
#ifdef __CYGWIN__
- fp->mode |= FMODE_BINMODE;
+ if (!isatty(fd)) {
+ fmode |= FMODE_BINMODE;
setmode(fd, O_BINARY);
-#endif
}
+#endif
+ fp->mode = fmode;
+ io_check_tty(fp);
if (path) fp->pathv = rb_obj_freeze(rb_str_new_cstr(path));
rb_update_max_fd(fd);
@@ -7907,60 +7368,6 @@ 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
@@ -7975,8 +7382,8 @@ rb_io_make_open_file(VALUE obj)
* === Open Mode
*
* When +mode+ is an integer it must be combination of the modes defined in
- * File::Constants (+File::RDONLY+, <code>File::WRONLY|File::CREAT</code>).
- * See the open(2) man page for more information.
+ * File::Constants (+File::RDONLY+, +File::WRONLY | File::CREAT+). See the
+ * open(2) man page for more information.
*
* When +mode+ is a string it must be in one of the following forms:
*
@@ -8037,7 +7444,7 @@ rb_io_make_open_file(VALUE obj)
* 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
@@ -8052,18 +7459,15 @@ rb_io_make_open_file(VALUE obj)
* :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.
+ * External encoding for the IO. "-" is a synonym for the default external
+ * encoding.
*
* :\internal_encoding ::
* 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".
@@ -8183,11 +7587,6 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
* mode and permission bits are platform dependent; on Unix systems, see
* open(2) and chmod(2) man pages for details.
*
- * The new File object is buffered mode (or non-sync mode), unless
- * +filename+ is a tty.
- * See IO#flush, IO#fsync, IO#fdatasync, and <code>IO#sync=</code>
- * about sync mode.
- *
* === Examples
*
* f = File.new("testfile", "r")
@@ -8202,7 +7601,7 @@ rb_file_initialize(int argc, VALUE *argv, VALUE io)
rb_raise(rb_eRuntimeError, "reinitializing File");
}
if (0 < argc && argc < 3) {
- VALUE fd = rb_check_to_int(argv[0]);
+ VALUE fd = rb_check_convert_type(argv[0], T_FIXNUM, "Fixnum", "to_int");
if (!NIL_P(fd)) {
argv[0] = fd;
@@ -8296,22 +7695,31 @@ argf_mark(void *ptr)
rb_gc_mark(p->filename);
rb_gc_mark(p->current_file);
rb_gc_mark(p->argv);
- rb_gc_mark(p->inplace);
rb_gc_mark(p->encs.ecopts);
}
+static void
+argf_free(void *ptr)
+{
+ struct argf *p = ptr;
+ xfree(p->inplace);
+ xfree(p);
+}
+
static size_t
argf_memsize(const void *ptr)
{
const struct argf *p = ptr;
size_t size = sizeof(*p);
+ if (!ptr) return 0;
+ if (p->inplace) size += strlen(p->inplace) + 1;
return size;
}
static const rb_data_type_t argf_type = {
"ARGF",
- {argf_mark, RUBY_TYPED_DEFAULT_FREE, argf_memsize},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ {argf_mark, argf_free, argf_memsize},
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static inline void
@@ -8352,6 +7760,11 @@ argf_initialize_copy(VALUE argf, VALUE orig)
if (!OBJ_INIT_COPY(argf, orig)) return argf;
ARGF = argf_of(orig);
ARGF.argv = rb_obj_dup(ARGF.argv);
+ if (ARGF.inplace) {
+ const char *inplace = ARGF.inplace;
+ ARGF.inplace = 0;
+ ARGF.inplace = ruby_strdup(inplace);
+ }
return argf;
}
@@ -8383,7 +7796,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=+.
@@ -8426,7 +7839,7 @@ argf_close(VALUE argf)
if (RB_TYPE_P(file, T_FILE)) {
rb_io_set_write_io(file, Qnil);
}
- io_close(file);
+ rb_funcall3(file, rb_intern("close"), 0, 0);
ARGF.init_p = -1;
}
@@ -8463,14 +7876,11 @@ argf_next_argv(VALUE argf)
}
if (ARGF.next_p == 1) {
- if (ARGF.init_p == 1) argf_close(argf);
retry:
if (RARRAY_LEN(ARGF.argv) > 0) {
- VALUE filename = rb_ary_shift(ARGF.argv);
- FilePathValue(filename);
- ARGF.filename = filename;
- fn = StringValueCStr(filename);
- if (RSTRING_LEN(filename) == 1 && fn[0] == '-') {
+ ARGF.filename = rb_str_encode_ospath(rb_ary_shift(ARGF.argv));
+ fn = StringValueCStr(ARGF.filename);
+ if (strlen(fn) == 1 && fn[0] == '-') {
ARGF.current_file = rb_stdin;
if (ARGF.inplace) {
rb_warn("Can't do inplace edit for stdio; skipping");
@@ -8479,7 +7889,7 @@ argf_next_argv(VALUE argf)
}
else {
VALUE write_io = Qnil;
- int fr = rb_sysopen(filename, O_RDONLY, 0);
+ int fr = rb_sysopen(ARGF.filename, O_RDONLY, 0);
if (ARGF.inplace) {
struct stat st;
@@ -8493,28 +7903,24 @@ argf_next_argv(VALUE argf)
rb_io_close(rb_stdout);
}
fstat(fr, &st);
- str = filename;
- if (!NIL_P(ARGF.inplace)) {
- VALUE suffix = ARGF.inplace;
+ str = ARGF.filename;
+ if (*ARGF.inplace) {
str = rb_str_dup(str);
- if (NIL_P(rb_str_cat_conv_enc_opts(str, RSTRING_LEN(str),
- RSTRING_PTR(suffix), RSTRING_LEN(suffix),
- rb_enc_get(suffix), 0, Qnil))) {
- rb_str_append(str, suffix);
- }
+ 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 %"PRIsVALUE" to %"PRIsVALUE": %s, skipping file",
- filename, str, strerror(errno));
+ ARGF.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 %"PRIsVALUE" to %"PRIsVALUE": %s, skipping file",
- filename, str, strerror(errno));
+ ARGF.filename, str, strerror(errno));
close(fr);
goto retry;
}
@@ -8526,13 +7932,13 @@ argf_next_argv(VALUE argf)
#else
if (unlink(fn) < 0) {
rb_warn("Can't remove %"PRIsVALUE": %s, skipping file",
- filename, strerror(errno));
+ ARGF.filename, strerror(errno));
close(fr);
goto retry;
}
#endif
}
- fw = rb_sysopen(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ fw = rb_sysopen(ARGF.filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
#ifndef NO_SAFE_RENAME
fstat(fw, &st2);
#ifdef HAVE_FCHMOD
@@ -8548,9 +7954,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(filename);
+ const char *wkfn = RSTRING_PTR(ARGF.filename);
rb_warn("Can't set owner/group of %"PRIsVALUE" to same as %"PRIsVALUE": %s, skipping file",
- filename, str, strerror(errno));
+ ARGF.filename, str, strerror(errno));
(void)close(fr);
(void)close(fw);
(void)unlink(wkfn);
@@ -8655,9 +8061,9 @@ static VALUE argf_gets(int, VALUE *, VALUE);
/*
* call-seq:
- * gets(sep=$/ [, getline_args]) -> string or nil
- * gets(limit [, getline_args]) -> string or nil
- * gets(sep, limit [, getline_args]) -> 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
@@ -8669,8 +8075,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+, <code>gets(nil)</code> will read
- * the contents one file at a time.
+ * filenames are present in +ARGV+, +gets(nil)+ will read the contents
+ * one file at a time.
*
* ARGV << "testfile"
* print while gets
@@ -8692,26 +8098,23 @@ rb_f_gets(int argc, VALUE *argv, VALUE recv)
if (recv == argf) {
return argf_gets(argc, argv, argf);
}
- return rb_funcallv(argf, idGets, argc, argv);
+ return rb_funcall2(argf, idGets, argc, argv);
}
/*
* call-seq:
- * ARGF.gets(sep=$/ [, getline_args]) -> string or nil
- * ARGF.gets(limit [, getline_args]) -> string or nil
- * ARGF.gets(sep, limit [, getline_args]) -> string or nil
+ * ARGF.gets(sep=$/) -> string or nil
+ * ARGF.gets(limit) -> string or nil
+ * ARGF.gets(sep, limit) -> string or nil
*
* Returns the next line from the current file in +ARGF+.
*
- * 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.
+ * 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.
*
* The optional _limit_ argument specifies how many characters of each line
* to return. By default all characters are returned.
*
- * See IO.readlines for details about getline_args.
- *
*/
static VALUE
argf_gets(int argc, VALUE *argv, VALUE argf)
@@ -8768,7 +8171,7 @@ rb_f_readline(int argc, VALUE *argv, VALUE recv)
if (recv == argf) {
return argf_readline(argc, argv, argf);
}
- return rb_funcallv(argf, rb_intern("readline"), argc, argv);
+ return rb_funcall2(argf, rb_intern("readline"), argc, argv);
}
@@ -8780,11 +8183,10 @@ 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 <code>$/</code>;
- * 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 +$/+; 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.
@@ -8808,9 +8210,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.
@@ -8822,7 +8224,7 @@ rb_f_readlines(int argc, VALUE *argv, VALUE recv)
if (recv == argf) {
return argf_readlines(argc, argv, argf);
}
- return rb_funcallv(argf, rb_intern("readlines"), argc, argv);
+ return rb_funcall2(argf, rb_intern("readlines"), argc, argv);
}
/*
@@ -8894,7 +8296,6 @@ rb_f_backquote(VALUE obj, VALUE str)
GetOpenFile(port, fptr);
result = read_all(fptr, remain_size(fptr), Qnil);
rb_io_close(port);
- RFILE(port)->fptr = NULL;
rb_io_fptr_finalize(fptr);
rb_gc_force_recycle(port); /* also guards from premature GC */
@@ -9131,12 +8532,12 @@ 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 && rv != ENOSYS) {
+ if (rv) {
/* posix_fadvise(2) doesn't set errno. On success it returns 0; otherwise
it returns the error code. */
VALUE message = rb_sprintf("%"PRIsVALUE" "
- "(%"PRI_OFFT_PREFIX"d, "
- "%"PRI_OFFT_PREFIX"d, "
+ "(%"PRI_OFF_T_PREFIX"d, "
+ "%"PRI_OFF_T_PREFIX"d, "
"%"PRIsVALUE")",
fptr->pathv, offset, len, advice);
rb_syserr_fail_str(rv, message);
@@ -9231,25 +8632,28 @@ 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 until one or more
- * of <code>IO</code> objects are ready for reading, are ready for writing,
+ * 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,
* and have pending exceptions respectively, and returns an array that
- * contains arrays of those IO objects. It will return +nil+
+ * contains arrays of those IO objects. It will return <code>nil</code>
* 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 notifies readability.
- * This "peek" only happens for <code>IO</code> objects.
- * It does not happen for IO-like objects such as OpenSSL::SSL::SSLSocket.
+ * <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.
*
* 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 raise an exception which is extended by
+ * The methods raises 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.
@@ -9277,37 +8681,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.
*
- * The most likely situation is that <code>OpenSSL::SSL::SSLSocket</code> buffers some data.
+ * Most possible situation is <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 situations exist.
+ * However several more complicated situation exists.
*
* SSL is a protocol which is sequence of records.
- * The record consists of multiple bytes.
+ * The record consists 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 to write some data.
+ * the local SSL engine writes some data.
* This means <code>OpenSSL::SSL::SSLSocket#readpartial</code> may
* invoke <code>write</code> system call and it can block.
- * In such a situation, <code>OpenSSL::SSL::SSLSocket#read_nonblock</code>
+ * In such 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 processes read from a stream.
+ * multiple process read form a stream.
*
- * Finally, Linux kernel developers don't guarantee that
+ * Finally, Linux kernel developers doesn't guarantee that
* readability of select(2) means readability of following read(2) even
- * for a single process.
+ * for single process.
* See select(2) manual on GNU/Linux system.
*
- * Invoking <code>IO.select</code> before <code>IO#readpartial</code> works well as usual.
+ * Invoking <code>IO.select</code> before <code>IO#readpartial</code> works well in usual.
* However it is not the best way to use <code>IO.select</code>.
*
* The writability notified by select(2) doesn't show
@@ -9401,7 +8805,6 @@ 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;
@@ -9430,7 +8833,6 @@ do_ioctl(int fd, ioctl_req_t cmd, long narg)
return retval;
}
-#endif
#define DEFULT_IOCTL_NARG_LEN (256)
@@ -9634,8 +9036,7 @@ setup_narg(ioctl_req_t cmd, VALUE *argp, int io_p)
narg = NUM2LONG(arg);
}
else {
- char *ptr;
- long len, slen;
+ long len;
*argp = arg = tmp;
if (io_p)
@@ -9644,24 +9045,19 @@ 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 (slen < len+1) {
+ if (RSTRING_LEN(arg) < len+1) {
rb_str_resize(arg, len+1);
- MEMZERO(RSTRING_PTR(arg)+slen, char, len-slen);
- slen = len+1;
}
/* a little sanity check here */
- ptr = RSTRING_PTR(arg);
- ptr[slen - 1] = 17;
- narg = (long)(SIGNED_VALUE)ptr;
+ RSTRING_PTR(arg)[RSTRING_LEN(arg) - 1] = 17;
+ narg = (long)(SIGNED_VALUE)RSTRING_PTR(arg);
}
}
return narg;
}
-#ifdef HAVE_IOCTL
static VALUE
rb_ioctl(VALUE io, VALUE req, VALUE arg)
{
@@ -9670,17 +9066,16 @@ 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)) {
- char *ptr;
- long slen;
- RSTRING_GETMEM(arg, ptr, slen);
- if (ptr[slen-1] != 17)
+ if (RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] != 17)
rb_raise(rb_eArgError, "return value overflowed string");
- ptr[slen-1] = '\0';
+ RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] = '\0';
}
return INT2NUM(retval);
@@ -9706,9 +9101,6 @@ 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 {
@@ -9740,17 +9132,11 @@ do_fcntl(int fd, int cmd, long narg)
arg.narg = narg;
retval = (int)rb_thread_io_blocking_region(nogvl_fcntl, &arg, fd);
- if (retval != -1) {
- switch (cmd) {
#if defined(F_DUPFD)
- case F_DUPFD:
-#endif
-#if defined(F_DUPFD_CLOEXEC)
- case F_DUPFD_CLOEXEC:
-#endif
- rb_update_max_fd(retval);
- }
+ if (retval != -1 && cmd == F_DUPFD) {
+ rb_update_max_fd(retval);
}
+#endif
return retval;
}
@@ -9763,17 +9149,26 @@ 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)) {
- char *ptr;
- long slen;
- RSTRING_GETMEM(arg, ptr, slen);
- if (ptr[slen-1] != 17)
+ if (RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] != 17)
rb_raise(rb_eArgError, "return value overflowed string");
- ptr[slen-1] = '\0';
+ RSTRING_PTR(arg)[RSTRING_LEN(arg)-1] = '\0';
+ }
+
+ if (cmd == F_SETFL) {
+ if (narg & O_NONBLOCK) {
+ fptr->mode |= FMODE_WSPLIT_INITIALIZED;
+ fptr->mode &= ~FMODE_WSPLIT;
+ }
+ else {
+ fptr->mode &= ~(FMODE_WSPLIT_INITIALIZED|FMODE_WSPLIT);
+ }
}
return INT2NUM(retval);
@@ -9817,7 +9212,7 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io)
* +String+ objects or +Integer+ objects. A +String+ object is passed
* as a pointer to the byte sequence. An +Integer+ object is passed
* as an integer whose bit size is same as a pointer.
- * Up to nine parameters may be passed.
+ * Up to nine parameters may be passed (14 on the Atari-ST).
*
* The function identified by _num_ is system
* dependent. On some Unix systems, the numbers may be obtained from a
@@ -9829,20 +9224,23 @@ 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.
- * The 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.
+ * DL (Fiddle) library is preferred for safer and a bit more portable programming.
*/
static VALUE
rb_f_syscall(int argc, VALUE *argv)
{
+#ifdef atarist
+ VALUE arg[13]; /* yes, we really need that many ! */
+#else
VALUE arg[8];
+#endif
#if SIZEOF_VOIDP == 8 && defined(HAVE___SYSCALL) && SIZEOF_INT != 8 /* mainly *BSD */
# define SYSCALL __syscall
# define NUM2SYSCALLID(x) NUM2LONG(x)
@@ -9878,6 +9276,7 @@ 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))
@@ -9921,6 +9320,32 @@ rb_f_syscall(int argc, VALUE *argv)
case 8:
retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
break;
+#ifdef atarist
+ case 9:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7]);
+ break;
+ case 10:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7], arg[8]);
+ break;
+ case 11:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7], arg[8], arg[9]);
+ break;
+ case 12:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7], arg[8], arg[9], arg[10]);
+ break;
+ case 13:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7], arg[8], arg[9], arg[10], arg[11]);
+ break;
+ case 14:
+ retval = SYSCALL(num, arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
+ arg[7], arg[8], arg[9], arg[10], arg[11], arg[12]);
+ break;
+#endif
}
if (retval == -1)
@@ -9944,7 +9369,7 @@ static rb_encoding *
find_encoding(VALUE v)
{
rb_encoding *enc = rb_find_encoding(v);
- if (!enc) rb_warn("Unsupported encoding %"PRIsVALUE" ignored", v);
+ if (!enc) unsupported_encoding(StringValueCStr(v));
return enc;
}
@@ -9990,8 +9415,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(enc = rb_enc_get(tmp))) {
- parse_mode_enc(RSTRING_PTR(tmp), enc, &enc, &enc2, NULL);
+ if (!NIL_P(tmp) && rb_enc_asciicompat(rb_enc_get(tmp))) {
+ parse_mode_enc(RSTRING_PTR(tmp), &enc, &enc2, NULL);
SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags);
ecflags = rb_econv_prepare_options(opt, &ecopts, ecflags);
}
@@ -10179,10 +9604,9 @@ struct foreach_arg {
};
static void
-open_key_args(VALUE klass, int argc, VALUE *argv, VALUE opt, struct foreach_arg *arg)
+open_key_args(int argc, VALUE *argv, VALUE opt, struct foreach_arg *arg)
{
VALUE path, v;
- VALUE vmode = Qnil, vperm = Qnil;
path = *argv++;
argc--;
@@ -10191,38 +9615,47 @@ open_key_args(VALUE klass, int argc, VALUE *argv, VALUE opt, struct foreach_arg
arg->argc = argc;
arg->argv = argv;
if (NIL_P(opt)) {
- vmode = INT2NUM(O_RDONLY);
- vperm = INT2FIX(0666);
+ arg->io = rb_io_open(path, INT2NUM(O_RDONLY), INT2FIX(0666), Qnil);
+ return;
}
- else if (!NIL_P(v = rb_hash_aref(opt, sym_open_args))) {
- int n;
+ v = rb_hash_aref(opt, sym_open_args);
+ if (!NIL_P(v)) {
+ VALUE args;
+ long n;
- v = rb_to_array_type(v);
- n = RARRAY_LENINT(v);
- rb_check_arity(n, 0, 3); /* rb_io_open */
- rb_scan_args(n, RARRAY_CONST_PTR(v), "02:", &vmode, &vperm, &opt);
+ v = rb_convert_type(v, T_ARRAY, "Array", "to_ary");
+ n = RARRAY_LEN(v) + 1;
+#if SIZEOF_LONG > SIZEOF_INT
+ if (n > INT_MAX) {
+ rb_raise(rb_eArgError, "too many arguments");
+ }
+#endif
+ args = rb_ary_tmp_new(n);
+ rb_ary_push(args, path);
+ rb_ary_concat(args, v);
+ arg->io = rb_io_open_with_args((int)n, RARRAY_CONST_PTR(args));
+ rb_ary_clear(args); /* prevent from GC */
+ return;
}
- arg->io = rb_io_open(klass, path, vmode, vperm, opt);
+ arg->io = rb_io_open(path, Qnil, Qnil, opt);
}
static VALUE
-io_s_foreach(struct getline_arg *arg)
+io_s_foreach(struct foreach_arg *arg)
{
VALUE str;
- while (!NIL_P(str = rb_io_getline_1(arg->rs, arg->limit, arg->chomp, arg->io))) {
- rb_lastline_set(str);
+ while (!NIL_P(str = rb_io_gets_m(arg->argc, arg->argv, arg->io))) {
rb_yield(str);
}
- rb_lastline_set(Qnil);
return Qnil;
}
/*
* call-seq:
- * IO.foreach(name, sep=$/ [, getline_args, open_args]) {|line| block } -> nil
- * IO.foreach(name, limit [, getline_args, open_args]) {|line| block } -> nil
- * IO.foreach(name, sep, limit [, getline_args, open_args]) {|line| block } -> nil
+ * IO.foreach(name, sep=$/ [, open_args]) {|line| block } -> nil
+ * IO.foreach(name, limit [, open_args]) {|line| block } -> nil
+ * IO.foreach(name, sep, limit [, open_args]) {|line| block } -> nil
* IO.foreach(...) -> an_enumerator
*
* Executes the block for every line in the named I/O port, where lines
@@ -10240,8 +9673,7 @@ io_s_foreach(struct getline_arg *arg)
* GOT And so on...
*
* If the last argument is a hash, it's the keyword argument to open.
- * See IO.readlines for details about getline_args.
- * And see also IO.read for details about open_args.
+ * See <code>IO.read</code> for detail.
*
*/
@@ -10251,29 +9683,25 @@ rb_io_s_foreach(int argc, VALUE *argv, VALUE self)
VALUE opt;
int orig_argc = argc;
struct foreach_arg arg;
- struct getline_arg garg;
argc = rb_scan_args(argc, argv, "13:", NULL, NULL, NULL, NULL, &opt);
RETURN_ENUMERATOR(self, orig_argc, argv);
- extract_getline_args(argc-1, argv+1, &garg);
- open_key_args(self, argc, argv, opt, &arg);
+ open_key_args(argc, argv, opt, &arg);
if (NIL_P(arg.io)) return Qnil;
- extract_getline_opts(opt, &garg);
- check_getline_args(&garg.rs, &garg.limit, garg.io = arg.io);
- return rb_ensure(io_s_foreach, (VALUE)&garg, rb_io_close, arg.io);
+ return rb_ensure(io_s_foreach, (VALUE)&arg, rb_io_close, arg.io);
}
static VALUE
-io_s_readlines(struct getline_arg *arg)
+io_s_readlines(struct foreach_arg *arg)
{
- return io_readlines(arg, arg->io);
+ return rb_io_readlines(arg->argc, arg->argv, arg->io);
}
/*
* call-seq:
- * IO.readlines(name, sep=$/ [, getline_args, open_args]) -> array
- * IO.readlines(name, limit [, getline_args, open_args]) -> array
- * IO.readlines(name, sep, limit [, getline_args, open_args]) -> array
+ * IO.readlines(name, sep=$/ [, open_args]) -> array
+ * IO.readlines(name, limit [, open_args]) -> array
+ * IO.readlines(name, sep, limit [, open_args]) -> array
*
* Reads the entire file specified by <i>name</i> as individual
* lines, and returns those lines in an array. Lines are separated by
@@ -10282,21 +9710,9 @@ io_s_readlines(struct getline_arg *arg)
* a = IO.readlines("testfile")
* a[0] #=> "This is line one\n"
*
- * b = IO.readlines("testfile", chomp: true)
- * b[0] #=> "This is line one"
- *
* If the last argument is a hash, it's the keyword argument to open.
+ * See <code>IO.read</code> for detail.
*
- * === Options for getline
- *
- * The options hash accepts the following keys:
- *
- * :chomp::
- * When the optional +chomp+ keyword argument has a true value,
- * <code>\n</code>, <code>\r</code>, and <code>\r\n</code>
- * will be removed from the end of each line.
- *
- * See also IO.read for details about open_args.
*/
static VALUE
@@ -10304,15 +9720,11 @@ rb_io_s_readlines(int argc, VALUE *argv, VALUE io)
{
VALUE opt;
struct foreach_arg arg;
- struct getline_arg garg;
argc = rb_scan_args(argc, argv, "13:", NULL, NULL, NULL, NULL, &opt);
- extract_getline_args(argc-1, argv+1, &garg);
- open_key_args(io, argc, argv, opt, &arg);
+ open_key_args(argc, argv, opt, &arg);
if (NIL_P(arg.io)) return Qnil;
- extract_getline_opts(opt, &garg);
- check_getline_args(&garg.rs, &garg.limit, garg.io = arg.io);
- return rb_ensure(io_s_readlines, (VALUE)&garg, rb_io_close, arg.io);
+ return rb_ensure(io_s_readlines, (VALUE)&arg, rb_io_close, arg.io);
}
static VALUE
@@ -10343,31 +9755,28 @@ seek_before_access(VALUE argp)
* +length+ bytes (defaulting to the rest of the file). <code>read</code>
* ensures the file is closed before returning.
*
- * If +name+ starts with a pipe character (<code>"|"</code>), a subprocess is
- * created in the same way as Kernel#open, and its output is returned.
- *
* === Options
*
* The options hash accepts the following keys:
*
- * :encoding::
+ * encoding::
* string or encoding
*
- * Specifies the encoding of the read string. +:encoding+ will be ignored
+ * Specifies the encoding of the read string. +encoding:+ will be ignored
* if +length+ is specified. See Encoding.aliases for possible encodings.
*
- * :mode::
- * string or integer
+ * mode::
+ * string
*
- * Specifies the <i>mode</i> argument for open(). It must start
- * with an "r", otherwise it will cause an error.
- * See IO.new for the list of possible modes.
+ * 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
+ * open_args::
+ * array of strings
*
* Specifies arguments for open() as an array. This key can not be used
- * in combination with either +:encoding+ or +:mode+.
+ * in combination with either +encoding:+ or +mode:+.
*
* Examples:
*
@@ -10384,7 +9793,7 @@ rb_io_s_read(int argc, VALUE *argv, VALUE io)
struct foreach_arg arg;
argc = rb_scan_args(argc, argv, "13:", NULL, NULL, &offset, NULL, &opt);
- open_key_args(io, argc, argv, opt, &arg);
+ open_key_args(argc, argv, opt, &arg);
if (NIL_P(arg.io)) return Qnil;
if (!NIL_P(offset)) {
struct seek_arg sarg;
@@ -10421,33 +9830,15 @@ rb_io_s_binread(int argc, VALUE *argv, VALUE io)
{
VALUE offset;
struct foreach_arg arg;
- enum {
- fmode = FMODE_READABLE|FMODE_BINMODE,
- oflags = O_RDONLY
-#ifdef O_BINARY
- |O_BINARY
-#endif
- };
- convconfig_t convconfig = {NULL, NULL, 0, Qnil};
rb_scan_args(argc, argv, "12", NULL, NULL, &offset);
FilePathValue(argv[0]);
- convconfig.enc = rb_ascii8bit_encoding();
- arg.io = rb_io_open_generic(io, argv[0], oflags, fmode, &convconfig, 0);
+ arg.io = rb_io_open(argv[0], rb_str_new_cstr("rb:ASCII-8BIT"), Qnil, Qnil);
if (NIL_P(arg.io)) return Qnil;
arg.argv = argv+1;
arg.argc = (argc > 1) ? 1 : 0;
if (!NIL_P(offset)) {
- 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);
- }
+ rb_io_seek(arg.io, offset, SEEK_SET);
}
return rb_ensure(io_s_read, (VALUE)&arg, rb_io_close, arg.io);
}
@@ -10459,7 +9850,7 @@ io_s_write0(struct write_arg *arg)
}
static VALUE
-io_s_write(int argc, VALUE *argv, VALUE klass, int binary)
+io_s_write(int argc, VALUE *argv, int binary)
{
VALUE string, offset, opt;
struct foreach_arg arg;
@@ -10479,7 +9870,7 @@ io_s_write(int argc, VALUE *argv, VALUE klass, int binary)
if (NIL_P(offset)) mode |= O_TRUNC;
rb_hash_aset(opt,sym_mode,INT2NUM(mode));
}
- open_key_args(klass, argc, argv, opt, &arg);
+ open_key_args(argc,argv,opt,&arg);
#ifndef O_BINARY
if (binary) rb_io_binmode_m(arg.io);
@@ -10508,67 +9899,63 @@ io_s_write(int argc, VALUE *argv, VALUE klass, int binary)
/*
* call-seq:
- * IO.write(name, string [, offset]) -> integer
- * IO.write(name, string [, offset] [, opt]) -> integer
+ * IO.write(name, string, [offset] ) => fixnum
+ * IO.write(name, string, [offset], open_args ) => fixnum
*
* Opens the file, optionally seeks to the given <i>offset</i>, writes
* <i>string</i>, then returns the length written.
* <code>write</code> ensures the file is closed before returning.
- * If <i>offset</i> is not given in write mode, the file is truncated.
- * Otherwise, it is not truncated.
+ * If <i>offset</i> is not given, the file is truncated. Otherwise,
+ * it is not truncated.
*
- * IO.write("testfile", "0123456789", 20) #=> 10
- * # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
- * IO.write("testfile", "0123456789") #=> 10
- * # File would now read: "0123456789"
+ * 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.
*
- * If the last argument is a hash, it specifies options for the internal
- * open(). It accepts the following keys:
+ * encoding: string or encoding
*
- * :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.
- * See Encoding.aliases for possible encodings.
+ * mode: string
*
- * :mode::
- * string or integer
+ * specifies mode argument for open(). it should start with "w" or "a" or "r+"
+ * otherwise it would cause error.
*
- * Specifies the <i>mode</i> argument for open(). It must start
- * with "w", "a", or "r+", otherwise it will cause an error.
- * See IO.new for the list of possible modes.
+ * perm: fixnum
*
- * :perm::
- * integer
+ * specifies perm argument for open().
*
- * Specifies the <i>perm</i> argument for open().
+ * open_args: array
*
- * :open_args::
- * array
+ * specifies arguments for open() as an array.
*
- * Specifies arguments for open() as an array.
- * This key can not be used in combination with other keys.
+ * IO.write("testfile", "0123456789", 20) # => 10
+ * # File could contain: "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ * IO.write("testfile", "0123456789") #=> 10
+ * # File would now read: "0123456789"
*/
static VALUE
rb_io_s_write(int argc, VALUE *argv, VALUE io)
{
- return io_s_write(argc, argv, io, 0);
+ return io_s_write(argc, argv, 0);
}
/*
* call-seq:
- * IO.binwrite(name, string, [offset] ) -> integer
- * IO.binwrite(name, string, [offset], open_args ) -> integer
+ * IO.binwrite(name, string, [offset] ) => fixnum
+ * IO.binwrite(name, string, [offset], open_args ) => fixnum
*
* Same as <code>IO.write</code> except opening the file in binary mode
* and ASCII-8BIT encoding ("wb:ASCII-8BIT").
+ *
*/
static VALUE
rb_io_s_binwrite(int argc, VALUE *argv, VALUE io)
{
- return io_s_write(argc, argv, io, 1);
+ return io_s_write(argc, argv, 1);
}
struct copy_stream_struct {
@@ -10621,49 +10008,6 @@ 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)
{
@@ -10691,7 +10035,6 @@ 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)
@@ -10699,142 +10042,19 @@ 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 = IOWAIT_SYSCALL;
+ stp->syserr = "select";
stp->error_no = errno;
return -1;
}
return 0;
}
-#if defined __linux__ && defined __NR_copy_file_range
-# define USE_COPY_FILE_RANGE
-#endif
-
-#ifdef USE_COPY_FILE_RANGE
-
-static ssize_t
-simple_copy_file_range(int in_fd, off_t *in_offset, int out_fd, off_t *out_offset, size_t count, unsigned int flags)
-{
- return syscall(__NR_copy_file_range, in_fd, in_offset, out_fd, out_offset, count, flags);
-}
-
-static int
-nogvl_copy_file_range(struct copy_stream_struct *stp)
-{
- struct stat src_stat, dst_stat;
- ssize_t ss;
- int ret;
-
- off_t copy_length, src_offset, *src_offset_ptr;
-
- ret = fstat(stp->src_fd, &src_stat);
- if (ret == -1) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return -1;
- }
- if (!S_ISREG(src_stat.st_mode))
- return 0;
-
- ret = fstat(stp->dst_fd, &dst_stat);
- if (ret == -1) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return -1;
- }
-
- src_offset = stp->src_offset;
- if (src_offset != (off_t)-1) {
- src_offset_ptr = &src_offset;
- }
- else {
- src_offset_ptr = NULL; /* if src_offset_ptr is NULL, then bytes are read from in_fd starting from the file offset */
- }
-
- copy_length = stp->copy_length;
- if (copy_length == (off_t)-1) {
- if (src_offset == (off_t)-1) {
- off_t current_offset;
- errno = 0;
- current_offset = lseek(stp->src_fd, 0, SEEK_CUR);
- if (current_offset == (off_t)-1 && errno) {
- stp->syserr = "lseek";
- stp->error_no = errno;
- return -1;
- }
- copy_length = src_stat.st_size - current_offset;
- }
- else {
- copy_length = src_stat.st_size - src_offset;
- }
- }
-
- retry_copy_file_range:
-# if SIZEOF_OFF_T > SIZEOF_SIZE_T
- /* we are limited by the 32-bit ssize_t return value on 32-bit */
- ss = (copy_length > (off_t)SSIZE_MAX) ? SSIZE_MAX : (ssize_t)copy_length;
-# else
- ss = (ssize_t)copy_length;
-# endif
- ss = simple_copy_file_range(stp->src_fd, src_offset_ptr, stp->dst_fd, NULL, ss, 0);
- if (0 < ss) {
- stp->total += ss;
- copy_length -= ss;
- if (0 < copy_length) {
- goto retry_copy_file_range;
- }
- }
- if (ss == -1) {
- if (maygvl_copy_stream_continue_p(0, stp)) {
- goto retry_copy_file_range;
- }
- switch (errno) {
- case EINVAL:
- case EPERM: /* copy_file_range(2) doesn't exist (may happen in
- docker container) */
-#ifdef ENOSYS
- case ENOSYS:
-#endif
-#ifdef EXDEV
- case EXDEV: /* in_fd and out_fd are not on the same filesystem */
-#endif
- return 0;
- case EAGAIN:
-#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK:
-#endif
- if (nogvl_copy_stream_wait_write(stp) == -1)
- return -1;
- goto retry_copy_file_range;
- case EBADF:
- {
- int e = errno;
- int flags = fcntl(stp->dst_fd, F_GETFL);
-
- if (flags != -1 && flags & O_APPEND) {
- return 0;
- }
- errno = e;
- }
- }
- stp->syserr = "copy_file_range";
- stp->error_no = errno;
- return -1;
- }
- return 1;
-}
-#endif
-
#ifdef HAVE_SENDFILE
# ifdef __linux__
@@ -11031,9 +10251,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;
@@ -11133,12 +10353,6 @@ nogvl_copy_stream_func(void *arg)
int ret;
#endif
-#ifdef USE_COPY_FILE_RANGE
- ret = nogvl_copy_file_range(stp);
- if (ret != 0)
- goto finish; /* error or success */
-#endif
-
#ifdef USE_SENDFILE
ret = nogvl_copy_stream_sendfile(stp);
if (ret != 0)
@@ -11191,11 +10405,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;
}
@@ -11241,59 +10455,51 @@ 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 {
- 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];
+ 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 {
- 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];
+ 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;
@@ -11354,7 +10560,8 @@ copy_stream_finalize(VALUE arg)
}
rb_fd_term(&stp->fds);
if (stp->syserr) {
- rb_syserr_fail(stp->error_no, stp->syserr);
+ errno = stp->error_no;
+ rb_sys_fail(stp->syserr);
}
if (stp->notimp) {
rb_raise(rb_eNotImpError, "%s() not implemented", stp->notimp);
@@ -11369,12 +10576,7 @@ copy_stream_finalize(VALUE arg)
* IO.copy_stream(src, dst, copy_length, src_offset)
*
* IO.copy_stream copies <i>src</i> to <i>dst</i>.
- * <i>src</i> and <i>dst</i> is either a filename or an IO-like object.
- * IO-like object for <i>src</i> should have <code>readpartial</code> or
- * <code>read</code> method.
- * IO-like object for <i>dst</i> should have <code>write</code> method.
- * (Specialized mechanisms, such as sendfile system call, may be used
- * on appropriate situation.)
+ * <i>src</i> and <i>dst</i> is either a filename or an IO.
*
* This method returns the number of bytes copied.
*
@@ -11429,7 +10631,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 in write mode and no encoding is specified, returns +nil+.
+ * If io is write mode and no encoding is specified, returns <code>nil</code>.
*/
static VALUE
@@ -11454,7 +10656,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
@@ -11493,7 +10695,7 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
VALUE v1, v2, opt;
if (!RB_TYPE_P(io, T_FILE)) {
- return rb_funcallv(io, id_set_encoding, argc, argv);
+ return rb_funcall2(io, id_set_encoding, argc, argv);
}
argc = rb_scan_args(argc, argv, "11:", &v1, &v2, &opt);
@@ -11505,6 +10707,7 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
void
rb_stdio_set_default_encoding(void)
{
+ extern VALUE rb_stdin, rb_stdout, rb_stderr;
VALUE val = Qnil;
rb_io_set_encoding(1, &val, rb_stdin);
@@ -11512,12 +10715,6 @@ rb_stdio_set_default_encoding(void)
rb_io_set_encoding(1, &val, rb_stderr);
}
-static inline int
-global_argf_p(VALUE arg)
-{
- return arg == argf;
-}
-
/*
* call-seq:
* ARGF.external_encoding -> encoding
@@ -11529,7 +10726,7 @@ global_argf_p(VALUE arg)
*
* To set the external encoding use +ARGF.set_encoding+.
*
- * For example:
+ * For example:
*
* ARGF.external_encoding #=> #<Encoding:UTF-8>
*
@@ -11554,7 +10751,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)
@@ -11587,7 +10784,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:
*
@@ -11634,10 +10831,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)
@@ -11685,25 +10882,17 @@ argf_set_pos(VALUE argf, VALUE offset)
static VALUE
argf_rewind(VALUE argf)
{
- VALUE ret;
- int old_lineno;
-
if (!next_argv()) {
rb_raise(rb_eArgError, "no stream to rewind");
}
ARGF_FORWARD(0, 0);
- old_lineno = RFILE(ARGF.current_file)->fptr->lineno;
- ret = rb_io_rewind(ARGF.current_file);
- if (!global_argf_p(argf)) {
- ARGF.last_lineno = ARGF.lineno -= old_lineno;
- }
- return ret;
+ return rb_io_rewind(ARGF.current_file);
}
/*
* call-seq:
- * ARGF.fileno -> integer
- * ARGF.to_i -> integer
+ * ARGF.fileno -> fixnum
+ * ARGF.to_i -> fixnum
*
* Returns an integer representing the numeric file descriptor for
* the current file. Raises an +ArgumentError+ if there isn't a current file.
@@ -11782,28 +10971,22 @@ 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+.
+ * _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.
*
- * 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 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 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 _length_ is zero, it returns _""_.
*
- * 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
+ * If the optional _outbuf_ argument is present, it must reference a String,
+ * which will receive the data.
+ * The <i>outbuf</i> will contain only the received data after the method call
* even if it is not empty at the beginning.
*
- * For example:
+ * For example:
*
* $ echo "small" > small.txt
* $ echo "large" > large.txt
@@ -11814,11 +10997,8 @@ argf_eof(VALUE argf)
* ARGF.read(2) #=> "sm"
* ARGF.read(0) #=> ""
*
- * 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.
+ * Note that this method behaves like fread() function in C. If you need the
+ * behavior like read(2) system call, consider +ARGF.readpartial+.
*/
static VALUE
@@ -11857,9 +11037,8 @@ argf_read(int argc, VALUE *argv, VALUE argf)
}
}
else if (argc >= 1) {
- long slen = RSTRING_LEN(str);
- if (slen < len) {
- len -= slen;
+ if (RSTRING_LEN(str) < len) {
+ len -= RSTRING_LEN(str);
argv[0] = INT2NUM(len);
goto retry;
}
@@ -11881,8 +11060,7 @@ argf_forward_call(VALUE arg)
return Qnil;
}
-static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts,
- int nonblock);
+static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock);
/*
* call-seq:
@@ -11893,7 +11071,7 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts,
*
* 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
+ * The <i>outbuf</i> will contain only the received data after the method call
* even if it is not empty at the beginning.
*
* It raises <code>EOFError</code> on end of ARGF stream.
@@ -11907,13 +11085,13 @@ static VALUE argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts,
static VALUE
argf_readpartial(int argc, VALUE *argv, VALUE argf)
{
- return argf_getpartial(argc, argv, argf, Qnil, 0);
+ return argf_getpartial(argc, argv, argf, 0);
}
/*
* call-seq:
- * ARGF.read_nonblock(maxlen[, options]) -> string
- * ARGF.read_nonblock(maxlen, outbuf[, options]) -> outbuf
+ * ARGF.read_nonblock(maxlen) -> string
+ * ARGF.read_nonblock(maxlen, outbuf) -> outbuf
*
* Reads at most _maxlen_ bytes from the ARGF stream in non-blocking mode.
*/
@@ -11921,18 +11099,11 @@ argf_readpartial(int argc, VALUE *argv, VALUE argf)
static VALUE
argf_read_nonblock(int argc, VALUE *argv, VALUE argf)
{
- VALUE opts;
-
- rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
-
- if (!NIL_P(opts))
- argc--;
-
- return argf_getpartial(argc, argv, argf, opts, 1);
+ return argf_getpartial(argc, argv, argf, 1);
}
static VALUE
-argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, int nonblock)
+argf_getpartial(int argc, VALUE *argv, VALUE argf, int nonblock)
{
VALUE tmp, str, length;
@@ -11943,9 +11114,7 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, int nonblock)
}
if (!next_argv()) {
- if (!NIL_P(str)) {
- rb_str_resize(str, 0);
- }
+ rb_str_resize(str, 0);
rb_eof_error();
}
if (ARGF_GENERIC_INPUT_P()) {
@@ -11957,17 +11126,16 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, int nonblock)
RUBY_METHOD_FUNC(0), Qnil, rb_eEOFError, (VALUE)0);
}
else {
- tmp = io_getpartial(argc, argv, ARGF.current_file, opts, nonblock);
+ tmp = io_getpartial(argc, argv, ARGF.current_file, nonblock, 0);
}
if (NIL_P(tmp)) {
if (ARGF.next_p == -1) {
- return io_nonblock_eof(opts);
+ rb_eof_error();
}
argf_close(argf);
ARGF.next_p = 1;
- if (RARRAY_LEN(ARGF.argv) == 0) {
- return io_nonblock_eof(opts);
- }
+ if (RARRAY_LEN(ARGF.argv) == 0)
+ rb_eof_error();
if (NIL_P(str))
str = rb_str_new(NULL, 0);
return str;
@@ -12022,7 +11190,7 @@ argf_getc(VALUE argf)
/*
* call-seq:
- * ARGF.getbyte -> Integer or nil
+ * ARGF.getbyte -> Fixnum or nil
*
* Gets the next 8-bit byte (0..255) from +ARGF+. Returns +nil+ if called at
* the end of the stream.
@@ -12102,9 +11270,9 @@ argf_readchar(VALUE argf)
/*
* call-seq:
- * ARGF.readbyte -> Integer
+ * ARGF.readbyte -> Fixnum
*
- * Reads the next 8-bit byte from ARGF and returns it as an +Integer+. Raises
+ * Reads the next 8-bit byte from ARGF and returns it as a +Fixnum+. Raises
* an +EOFError+ after the last byte of the last file has been read.
*
* For example:
@@ -12151,58 +11319,34 @@ argf_block_call(ID mid, int argc, VALUE *argv, VALUE argf)
if (ret != Qundef) ARGF.next_p = 1;
}
-static VALUE
-argf_block_call_line_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, argf))
-{
- if (!global_argf_p(argf)) {
- ARGF.last_lineno = ++ARGF.lineno;
- }
- return argf_block_call_i(i, argf, argc, argv, blockarg);
-}
-
-static void
-argf_block_call_line(ID mid, int argc, VALUE *argv, VALUE argf)
-{
- VALUE ret = rb_block_call(ARGF.current_file, mid, argc, argv, argf_block_call_line_i, argf);
- if (ret != Qundef) ARGF.next_p = 1;
-}
-
/*
* 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
* +ARGV+. If a block is supplied, each line in turn will be yielded to the
* block, otherwise an enumerator is returned.
- * The optional _limit_ argument is an +Integer+ specifying the maximum
+ * The optional _limit_ argument is a +Fixnum+ specifying the maximum
* length of each line; longer lines will be split according to this limit.
*
* This method allows you to treat the files supplied on the command line as
* a single file consisting of the concatenation of each named file. After
* the last line of the first file has been returned, the first line of the
* second file is returned. The +ARGF.filename+ and +ARGF.lineno+ methods can
- * be used to determine the filename of the current line and line number of
- * the whole input, respectively.
+ * be used to determine the filename and line number, respectively, of the
+ * current line.
*
* 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.each_line do |line|
- * puts ARGF.filename if ARGF.file.lineno == 1
- * puts "#{ARGF.file.lineno}: #{line}"
- * end
- *
- * While the following code prints only the first file's name at first, and
- * the contents with line number counted through all named files.
- *
- * ARGF.each_line do |line|
* puts ARGF.filename if ARGF.lineno == 1
* puts "#{ARGF.lineno}: #{line}"
* end
@@ -12212,7 +11356,7 @@ argf_each_line(int argc, VALUE *argv, VALUE argf)
{
RETURN_ENUMERATOR(argf, argc, argv);
FOREACH_ARGF() {
- argf_block_call_line(rb_intern("each_line"), argc, argv, argf);
+ argf_block_call(rb_intern("each_line"), argc, argv, argf);
}
return argf;
}
@@ -12239,7 +11383,7 @@ argf_lines(int argc, VALUE *argv, VALUE argf)
* ARGF.each_byte -> an_enumerator
*
* Iterates over each byte of each file in +ARGV+.
- * A byte is returned as an +Integer+ in the range 0..255.
+ * A byte is returned as a +Fixnum+ in the range 0..255.
*
* This method allows you to treat the files supplied on the command line as
* a single file consisting of the concatenation of each named file. After
@@ -12249,7 +11393,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]
*
@@ -12279,8 +11423,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+.
*
@@ -12318,8 +11462,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+.
*
@@ -12394,8 +11538,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.
- * <code>$stdin</code> is returned when the current file is STDIN.
+ * Returns the current file as an +IO+ or +File+ object. #<IO:<STDIN>> is
+ * returned when the current file is STDIN.
*
* For example:
*
@@ -12440,10 +11584,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
@@ -12462,7 +11606,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"
@@ -12483,11 +11627,11 @@ argf_skip(VALUE argf)
* call-seq:
* ARGF.close -> ARGF
*
- * Closes the current file and skips to the next file in ARGV. If there are
- * no more files to open, just closes the current file. +STDIN+ will not be
- * closed.
+ * Closes the current file and skips to the next in the stream. Trying to
+ * close a file that has already been closed causes an +IOError+ to be
+ * raised.
*
- * For example:
+ * For example:
*
* $ ruby argf.rb foo bar
*
@@ -12495,6 +11639,7 @@ argf_skip(VALUE argf)
* ARGF.close
* ARGF.filename #=> "bar"
* ARGF.close
+ * ARGF.close #=> closed stream (IOError)
*/
static VALUE
argf_close_m(VALUE argf)
@@ -12540,15 +11685,14 @@ argf_to_s(VALUE argf)
* ARGF.inplace_mode -> String
*
* Returns the file extension appended to the names of modified files under
- * in-place edit mode. This value can be set using +ARGF.inplace_mode=+ or
+ * inplace-edit mode. This value can be set using +ARGF.inplace_mode=+ or
* passing the +-i+ switch to the Ruby binary.
*/
static VALUE
argf_inplace_mode_get(VALUE argf)
{
if (!ARGF.inplace) return Qnil;
- if (NIL_P(ARGF.inplace)) return rb_str_new(0, 0);
- return rb_str_dup(ARGF.inplace);
+ return rb_str_new2(ARGF.inplace);
}
static VALUE
@@ -12561,7 +11705,7 @@ opt_i_get(ID id, VALUE *var)
* call-seq:
* ARGF.inplace_mode = ext -> ARGF
*
- * Sets the filename extension for in-place editing mode to the given String.
+ * Sets the filename extension for inplace 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.
*
@@ -12574,8 +11718,8 @@ opt_i_get(ID id, VALUE *var)
* 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)
@@ -12584,13 +11728,14 @@ argf_inplace_mode_set(VALUE argf, VALUE val)
rb_insecure_operation();
if (!RTEST(val)) {
- ARGF.inplace = Qfalse;
- }
- else if (StringValueCStr(val), !RSTRING_LEN(val)) {
- ARGF.inplace = Qnil;
+ if (ARGF.inplace) free(ARGF.inplace);
+ ARGF.inplace = 0;
}
else {
- ARGF.inplace = rb_str_new_frozen(val);
+ StringValue(val);
+ if (ARGF.inplace) free(ARGF.inplace);
+ ARGF.inplace = 0;
+ ARGF.inplace = strdup(RSTRING_PTR(val));
}
return argf;
}
@@ -12604,13 +11749,15 @@ opt_i_set(VALUE val, ID id, VALUE *var)
const char *
ruby_get_inplace_mode(void)
{
- return RSTRING_PTR(ARGF.inplace);
+ return ARGF.inplace;
}
void
ruby_set_inplace_mode(const char *suffix)
{
- ARGF.inplace = !suffix ? Qfalse : !*suffix ? Qnil : rb_fstring_cstr(suffix);
+ if (ARGF.inplace) free(ARGF.inplace);
+ ARGF.inplace = 0;
+ if (suffix) ARGF.inplace = strdup(suffix);
}
/*
@@ -12674,15 +11821,10 @@ argf_write(VALUE argf, VALUE str)
}
void
-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)
+rb_readwrite_sys_fail(int writable, const char *mesg)
{
VALUE arg;
+ int n = errno;
arg = mesg ? rb_str_new2(mesg) : Qnil;
if (writable == RB_IO_WAIT_WRITABLE) {
switch (n) {
@@ -12734,8 +11876,8 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
* File.open("/etc/hosts") {|f| f.close; f.read }
* #=> IOError: closed stream
*
- * Note that some IO failures raise <code>SystemCallError</code>s
- * and these are not subclasses of IOError:
+ * Note that some IO failures raise +SystemCallError+s and these are not
+ * subclasses of IOError:
*
* File.open("does/not/exist")
* #=> Errno::ENOENT: No such file or directory - does/not/exist
@@ -12748,7 +11890,7 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
* methods exist in two forms,
*
* one that returns +nil+ when the end of file is reached, the other
- * raises +EOFError+.
+ * raises EOFError +EOFError+.
*
* +EOFError+ is a subclass of +IOError+.
*
@@ -12836,13 +11978,13 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
* <code>"\gumby\ruby\test.rb"</code>. When specifying a Windows-style
* filename in a Ruby string, remember to escape the backslashes:
*
- * "C:\\gumby\\ruby\\test.rb"
+ * "c:\\gumby\\ruby\\test.rb"
*
* Our examples here will use the Unix-style forward slashes;
* File::ALT_SEPARATOR can be used to get the platform-specific separator
* character.
*
- * The global constant ARGF (also accessible as <code>$<</code>) provides an
+ * The global constant ARGF (also accessible as $<) provides an
* IO-like stream which allows access to all files mentioned on the
* command line (or STDIN if no files are mentioned). ARGF#path and its alias
* ARGF#filename are provided to access the name of the file currently being
@@ -12874,7 +12016,7 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
* Example:
*
* require 'io/console'
- * rows, columns = $stdout.winsize
+ * rows, columns = $stdin.winsize
* puts "Your screen is #{columns} wide and #{rows} tall"
*/
@@ -12980,10 +12122,10 @@ Init_IO(void)
rb_output_fs = Qnil;
rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_str_setter);
- rb_default_rs = rb_fstring_cstr("\n"); /* avoid modifying RS_default */
+ rb_rs = rb_default_rs = rb_usascii_str_new2("\n");
rb_gc_register_mark_object(rb_default_rs);
- rb_rs = rb_default_rs;
rb_output_rs = Qnil;
+ OBJ_FREEZE(rb_default_rs); /* avoid modifying RS_default */
rb_define_hooked_variable("$/", &rb_rs, 0, rb_str_setter);
rb_define_hooked_variable("$-0", &rb_rs, 0, rb_str_setter);
rb_define_hooked_variable("$\\", &rb_output_rs, 0, rb_str_setter);
@@ -13011,9 +12153,6 @@ Init_IO(void)
rb_define_method(rb_cIO, "syswrite", rb_io_syswrite, 1);
rb_define_method(rb_cIO, "sysread", rb_io_sysread, -1);
- rb_define_method(rb_cIO, "pread", rb_io_pread, -1);
- rb_define_method(rb_cIO, "pwrite", rb_io_pwrite, 2);
-
rb_define_method(rb_cIO, "fileno", rb_io_fileno, 0);
rb_define_alias(rb_cIO, "to_i", "fileno");
rb_define_method(rb_cIO, "to_io", rb_io_to_io, 0);
@@ -13028,13 +12167,11 @@ Init_IO(void)
rb_define_method(rb_cIO, "readlines", rb_io_readlines, -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, "read_nonblock", io_read_nonblock, -1);
+ rb_define_method(rb_cIO, "write_nonblock", rb_io_write_nonblock, -1);
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);
+ rb_define_method(rb_cIO, "write", io_write_m, 1);
rb_define_method(rb_cIO, "gets", rb_io_gets_m, -1);
rb_define_method(rb_cIO, "readline", rb_io_readline, -1);
rb_define_method(rb_cIO, "getc", rb_io_getc, 0);
@@ -13102,7 +12239,7 @@ Init_IO(void)
rb_stderr = prep_stdio(stderr, FMODE_WRITABLE|FMODE_SYNC, rb_cIO, "<STDERR>");
rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
orig_stdout = rb_stdout;
- orig_stderr = rb_stderr;
+ rb_deferr = orig_stderr = rb_stderr;
/* Holds the original stdin */
rb_define_global_const("STDIN", rb_stdin);
@@ -13214,10 +12351,9 @@ 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_id_encoding());
+ sym_encoding = ID2SYM(rb_intern("encoding"));
sym_open_args = ID2SYM(rb_intern("open_args"));
sym_textmode = ID2SYM(rb_intern("textmode"));
sym_binmode = ID2SYM(rb_intern("binmode"));
@@ -13237,6 +12373,5 @@ Init_IO(void)
#ifdef SEEK_HOLE
sym_HOLE = ID2SYM(rb_intern("HOLE"));
#endif
- sym_wait_readable = ID2SYM(rb_intern("wait_readable"));
- sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
+ sym_exception = ID2SYM(rb_intern("exception"));
}
diff --git a/iseq.c b/iseq.c
index 868c4ee4f8..b6bdc261b4 100644
--- a/iseq.c
+++ b/iseq.c
@@ -9,26 +9,23 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/util.h"
+#include "internal.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"
#include "iseq.h"
-#include "id_table.h"
#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,325 +56,273 @@ compile_data_free(struct iseq_compile_data *compile_data)
ruby_xfree(cur);
cur = next;
}
- if (compile_data->ivar_cache_table) {
- rb_id_table_free(compile_data->ivar_cache_table);
- }
ruby_xfree(compile_data);
}
}
-void
-rb_iseq_free(const rb_iseq_t *iseq)
+static void
+iseq_free(void *ptr)
{
+ rb_iseq_t *iseq;
RUBY_FREE_ENTER("iseq");
- if (iseq) {
- if (iseq->body) {
- ruby_xfree((void *)iseq->body->iseq_encoded);
- ruby_xfree((void *)iseq->body->insns_info);
- 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);
+ 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));
}
- ruby_xfree((void *)iseq->body->catch_table);
- ruby_xfree((void *)iseq->body->param.opt_table);
- if (iseq->body->param.keyword != NULL) {
- ruby_xfree((void *)iseq->body->param.keyword->default_values);
- ruby_xfree((void *)iseq->body->param.keyword);
- }
- compile_data_free(ISEQ_COMPILE_DATA(iseq));
- ruby_xfree(iseq->body);
+ RUBY_FREE_UNLESS_NULL(iseq->iseq_encoded);
+ 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);
+ RUBY_FREE_UNLESS_NULL(iseq->iseq);
}
+ ruby_xfree(ptr);
}
RUBY_FREE_LEAVE("iseq");
}
-void
-rb_iseq_mark(const rb_iseq_t *iseq)
+static void
+iseq_mark(void *ptr)
{
RUBY_MARK_ENTER("iseq");
- if (iseq->body) {
- const struct rb_iseq_constant_body *body = iseq->body;
-
- 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.pathobj);
- RUBY_MARK_UNLESS_NULL((VALUE)body->parent_iseq);
- }
-
- if (FL_TEST(iseq, ISEQ_NOT_LOADED_YET)) {
- rb_gc_mark(iseq->aux.loader.obj);
- }
- else if (ISEQ_COMPILE_DATA(iseq) != NULL) {
- 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");
-}
+ if (ptr) {
+ rb_iseq_t *iseq = ptr;
-static size_t
-param_keyword_size(const struct rb_iseq_param_keyword *pkw)
-{
- size_t size = 0;
+ RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
+ RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
- if (!pkw) return size;
+ 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);
- size += sizeof(struct rb_iseq_param_keyword);
- size += sizeof(VALUE) * (pkw->num - pkw->required_num);
+ 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);
- return size;
+ 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);
+ }
+ }
+ RUBY_MARK_LEAVE("iseq");
}
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->insns_info_size * sizeof(struct iseq_insn_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);
-
- /* 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;
+iseq_memsize(const void *ptr)
+{
+ size_t size = sizeof(rb_iseq_t);
+ const rb_iseq_t *iseq;
+
+ if (ptr) {
+ iseq = ptr;
+ if (!iseq->orig) {
+ size += iseq->iseq_size * sizeof(VALUE);
+ size += iseq->line_info_size * sizeof(struct iseq_line_info_entry);
+ size += iseq->local_table_size * sizeof(ID);
+ if (iseq->catch_table) {
+ size += iseq_catch_table_bytes(iseq->catch_table->size);
+ }
+ 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);
- 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 (iseq->compile_data) {
+ struct iseq_compile_data_storage *cur;
- if (kw_arg) {
- size += rb_call_info_kw_arg_bytes(kw_arg->keyword_len);
+ cur = iseq->compile_data->storage_head;
+ while (cur) {
+ size += cur->size + SIZEOF_ISEQ_COMPILE_DATA_STORAGE;
+ cur = cur->next;
}
+ size += sizeof(struct iseq_compile_data);
+ }
+ if (iseq->iseq) {
+ size += iseq->iseq_size * sizeof(VALUE);
}
- }
- }
-
- 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 rb_iseq_t *
-iseq_alloc(void)
-{
- rb_iseq_t *iseq = iseq_imemo_alloc();
- iseq->body = ZALLOC(struct rb_iseq_constant_body);
- return iseq;
-}
-
-VALUE
-rb_iseq_pathobj_new(VALUE path, VALUE realpath)
-{
- VALUE pathobj;
- VM_ASSERT(RB_TYPE_P(path, T_STRING));
- VM_ASSERT(realpath == Qnil || RB_TYPE_P(realpath, T_STRING));
-
- if (path == realpath ||
- (!NIL_P(realpath) && rb_str_cmp(path, realpath) == 0)) {
- pathobj = rb_fstring(path);
- }
- else {
- if (!NIL_P(realpath)) realpath = rb_fstring(realpath);
- pathobj = rb_ary_new_from_args(2, rb_fstring(path), realpath);
- rb_obj_freeze(pathobj);
- }
- return pathobj;
-}
+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
+};
-void
-rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath)
+static VALUE
+iseq_alloc(VALUE klass)
{
- RB_OBJ_WRITE(iseq, &iseq->body->location.pathobj,
- rb_iseq_pathobj_new(path, realpath));
+ rb_iseq_t *iseq;
+ return TypedData_Make_Struct(klass, rb_iseq_t, &iseq_data_type, iseq);
}
static rb_iseq_location_t *
-iseq_location_setup(rb_iseq_t *iseq, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_code_range_t *code_range)
+iseq_location_setup(rb_iseq_t *iseq, VALUE path, VALUE absolute_path, VALUE name, VALUE first_lineno)
{
- rb_iseq_location_t *loc = &iseq->body->location;
-
- rb_iseq_pathobj_set(iseq, path, realpath);
- RB_OBJ_WRITE(iseq, &loc->label, name);
- RB_OBJ_WRITE(iseq, &loc->base_label, name);
- loc->first_lineno = first_lineno;
- if (code_range) {
- loc->code_range = *code_range;
+ rb_iseq_location_t *loc = &iseq->location;
+ RB_OBJ_WRITE(iseq->self, &loc->path, path);
+ if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) {
+ RB_OBJ_WRITE(iseq->self, &loc->absolute_path, path);
}
else {
- loc->code_range.first_loc.lineno = 0;
- loc->code_range.first_loc.column = 0;
- loc->code_range.last_loc.lineno = -1;
- loc->code_range.last_loc.column = -1;
+ RB_OBJ_WRITE(iseq->self, &loc->absolute_path, absolute_path);
}
-
+ RB_OBJ_WRITE(iseq->self, &loc->label, name);
+ RB_OBJ_WRITE(iseq->self, &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 rb_iseq_t *piseq)
+set_relation(rb_iseq_t *iseq, const VALUE parent)
{
- const VALUE type = iseq->body->type;
+ const VALUE type = iseq->type;
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *piseq;
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
- iseq->body->local_iseq = iseq;
+ /* 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;
}
else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
- iseq->body->local_iseq = iseq;
+ ISEQ_SET_CREF(iseq, NEW_CREF(0)); /* place holder */
+ iseq->cref_stack->nd_refinements = Qnil;
+ iseq->local_iseq = iseq;
}
- else if (piseq) {
- iseq->body->local_iseq = piseq->body->local_iseq;
+ else if (RTEST(parent)) {
+ GetISeqPtr(parent, piseq);
+ ISEQ_SET_CREF(iseq, piseq->cref_stack);
+ iseq->local_iseq = piseq->local_iseq;
}
- if (piseq) {
- iseq->body->parent_iseq = piseq;
+ if (RTEST(parent)) {
+ GetISeqPtr(parent, piseq);
+ iseq->parent_iseq = piseq;
}
if (type == ISEQ_TYPE_MAIN) {
- iseq->body->local_iseq = iseq;
+ iseq->local_iseq = iseq;
}
}
void
-rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj)
+rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
{
- /* TODO: check dedup */
- rb_ary_push(ISEQ_MARK_ARY(iseq), 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);
}
static VALUE
prepare_iseq_build(rb_iseq_t *iseq,
- VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_code_range_t *code_range,
- const rb_iseq_t *parent, enum iseq_type type,
+ VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
+ VALUE parent, enum iseq_type type, VALUE block_opt,
const rb_compile_option_t *option)
{
- VALUE coverage = Qfalse;
- VALUE err_info = Qnil;
-
- if (parent && (type == ISEQ_TYPE_MAIN || type == ISEQ_TYPE_TOP))
- err_info = Qfalse;
-
- iseq->body->type = type;
+ iseq->type = type;
+ iseq->arg_rest = -1;
+ iseq->arg_block = -1;
+ iseq->arg_keyword = -1;
+ RB_OBJ_WRITE(iseq->self, &iseq->klass, 0);
set_relation(iseq, parent);
name = rb_fstring(name);
- iseq_location_setup(iseq, name, path, realpath, first_lineno, code_range);
- if (iseq != iseq->body->local_iseq) {
- RB_OBJ_WRITE(iseq, &iseq->body->location.base_label, iseq->body->local_iseq->body->location.label);
+ path = rb_fstring(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);
}
- RB_OBJ_WRITE(iseq, &iseq->body->mark_ary, iseq_mark_ary_create(0));
- ISEQ_COMPILE_DATA_ALLOC(iseq);
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err_info);
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->mark_ary, rb_ary_tmp_new(3));
+ iseq->defined_method_id = 0;
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
- ISEQ_COMPILE_DATA(iseq)->storage_head = ISEQ_COMPILE_DATA(iseq)->storage_current =
+ /*
+ * iseq->special_block_builder = GC_GUARDED_PTR_REF(block_opt);
+ * iseq->cached_special_block_builder = 0;
+ * iseq->cached_special_block = 0;
+ */
+
+ iseq->compile_data = ZALLOC(struct iseq_compile_data);
+ 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 =
(struct iseq_compile_data_storage *)
ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
- 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 =
+ 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 =
INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
- ISEQ_COMPILE_DATA(iseq)->option = option;
+ iseq->compile_data->option = option;
+ iseq->compile_data->last_coverable_line = -1;
- ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = NULL;
-
- if (option->coverage_enabled) {
+ RB_OBJ_WRITE(iseq->self, &iseq->coverage, Qfalse);
+ if (!GET_THREAD()->parse_in_eval) {
VALUE coverages = rb_get_coverages();
if (RTEST(coverages)) {
- coverage = rb_hash_lookup(coverages, rb_iseq_path(iseq));
- if (NIL_P(coverage)) coverage = Qfalse;
+ 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, coverage);
return Qtrue;
}
-#if VM_CHECK_MODE > 0
-static void validate_get_insn_info(rb_iseq_t *iseq);
-#endif
-
-void
-rb_iseq_init_trace(rb_iseq_t *iseq)
-{
- iseq->aux.trace_events = 0;
- if (ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS) {
- rb_iseq_trace_set(iseq, ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS);
- }
-}
-
static VALUE
-finish_iseq_build(rb_iseq_t *iseq)
+cleanup_iseq_build(rb_iseq_t *iseq)
{
- struct iseq_compile_data *data = ISEQ_COMPILE_DATA(iseq);
+ struct iseq_compile_data *data = iseq->compile_data;
VALUE err = data->err_info;
- ISEQ_COMPILE_DATA_CLEAR(iseq);
+ iseq->compile_data = 0;
compile_data_free(data);
-#if VM_CHECK_MODE > 0
- validate_get_insn_info(iseq);
-#endif
-
if (RTEST(err)) {
- VALUE path = pathobj_path(iseq->body->location.pathobj);
- if (err == Qtrue) err = rb_exc_new_cstr(rb_eSyntaxError, "compile error");
- rb_funcallv(err, rb_intern("set_backtrace"), 1, &path);
+ rb_funcall2(err, rb_intern("set_backtrace"), 1, &iseq->location.path);
rb_exc_raise(err);
}
-
- rb_iseq_init_trace(iseq);
return Qtrue;
}
@@ -389,48 +334,11 @@ static rb_compile_option_t COMPILE_OPTION_DEFAULT = {
OPT_OPERANDS_UNIFICATION, /* int operands_unification; */
OPT_INSTRUCTIONS_UNIFICATION, /* int instructions_unification; */
OPT_STACK_CACHING, /* int stack_caching; */
- OPT_FROZEN_STRING_LITERAL,
- OPT_DEBUG_FROZEN_STRING_LITERAL,
- TRUE, /* coverage_enabled */
+ OPT_TRACE_INSTRUCTION, /* int trace_instruction */
};
-
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, frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, coverage_enabled);
- 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) {
@@ -444,9 +352,29 @@ make_compile_option(rb_compile_option_t *option, VALUE opt)
for (i = 0; i < (int)(sizeof(rb_compile_option_t) / sizeof(int)); ++i)
((int *)option)[i] = 1;
}
- else if (RB_TYPE_P(opt, T_HASH)) {
+ else if (CLASS_OF(opt) == rb_cHash) {
*option = COMPILE_OPTION_DEFAULT;
- set_compile_option_from_hash(option, 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_NUM(option, opt, debug_level);
+#undef SET_COMPILE_OPTION
+#undef SET_COMPILE_OPTION_NUM
}
else {
rb_raise(rb_eTypeError, "Compile option must be Hash/true/false/nil");
@@ -469,9 +397,7 @@ make_compile_option_value(rb_compile_option_t *option)
SET_COMPILE_OPTION(option, opt, operands_unification);
SET_COMPILE_OPTION(option, opt, instructions_unification);
SET_COMPILE_OPTION(option, opt, stack_caching);
- SET_COMPILE_OPTION(option, opt, frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, coverage_enabled);
+ SET_COMPILE_OPTION(option, opt, trace_instruction);
SET_COMPILE_OPTION_NUM(option, opt, debug_level);
}
#undef SET_COMPILE_OPTION
@@ -479,78 +405,69 @@ make_compile_option_value(rb_compile_option_t *option)
return opt;
}
-rb_iseq_t *
-rb_iseq_new(const NODE *node, VALUE name, VALUE path, VALUE realpath,
- const rb_iseq_t *parent, enum iseq_type type)
+VALUE
+rb_iseq_new(NODE *node, VALUE name, VALUE path, VALUE absolute_path,
+ VALUE parent, enum iseq_type type)
{
- return rb_iseq_new_with_opt(node, name, path, realpath, INT2FIX(0), parent, type,
+ return rb_iseq_new_with_opt(node, name, path, absolute_path, INT2FIX(0), parent, type,
&COMPILE_OPTION_DEFAULT);
}
-rb_iseq_t *
-rb_iseq_new_top(const NODE *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent)
+VALUE
+rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent)
{
- return rb_iseq_new_with_opt(node, name, path, realpath, INT2FIX(0), parent, ISEQ_TYPE_TOP,
+ return rb_iseq_new_with_opt(node, name, path, absolute_path, INT2FIX(0), parent, ISEQ_TYPE_TOP,
&COMPILE_OPTION_DEFAULT);
}
-rb_iseq_t *
-rb_iseq_new_main(const NODE *node, VALUE path, VALUE realpath, const rb_iseq_t *parent)
+VALUE
+rb_iseq_new_main(NODE *node, VALUE path, VALUE absolute_path)
{
- return rb_iseq_new_with_opt(node, rb_fstring_cstr("<main>"),
- path, realpath, INT2FIX(0),
+ rb_thread_t *th = GET_THREAD();
+ VALUE parent = th->base_block->iseq->self;
+ return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), path, absolute_path, INT2FIX(0),
parent, ISEQ_TYPE_MAIN, &COMPILE_OPTION_DEFAULT);
}
-static inline rb_iseq_t *
-iseq_translate(rb_iseq_t *iseq)
+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)
{
- 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);
- }
- }
+ rb_iseq_t *iseq;
+ VALUE self = iseq_alloc(rb_cISeq);
- return iseq;
+ GetISeqPtr(self, iseq);
+ iseq->self = self;
+
+ 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;
}
-rb_iseq_t *
-rb_iseq_new_with_opt(const NODE *node, VALUE name, VALUE path, VALUE realpath,
- VALUE first_lineno, const rb_iseq_t *parent,
- enum iseq_type type, const rb_compile_option_t *option)
+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)
{
/* TODO: argument check */
- rb_iseq_t *iseq = iseq_alloc();
- const rb_code_range_t *code_range = NULL;
-
- if (!option) option = &COMPILE_OPTION_DEFAULT;
- if (node && !imemo_type_p((VALUE)node, imemo_ifunc)) code_range = &node->nd_loc;
- prepare_iseq_build(iseq, name, path, realpath, first_lineno, code_range, parent, type, option);
-
- rb_iseq_compile_node(iseq, node);
- finish_iseq_build(iseq);
-
- return iseq_translate(iseq);
+ return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
+ Qfalse, option);
}
-const rb_iseq_t *
-rb_iseq_load_iseq(VALUE fname)
+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)
{
- 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;
+ /* TODO: argument check */
+ return rb_iseq_new_with_bopt_and_opt(node, name, path, absolute_path, first_lineno, parent, type,
+ bopt, &COMPILE_OPTION_DEFAULT);
}
-#define CHECK_ARRAY(v) rb_to_array_type(v)
-#define CHECK_HASH(v) rb_to_hash_type(v)
-#define CHECK_STRING(v) rb_str_to_str(v)
-#define CHECK_SYMBOL(v) rb_to_symbol_type(v)
+#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;}
static enum iseq_type
@@ -581,18 +498,18 @@ iseq_type_from_sym(VALUE type)
}
static VALUE
-iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt)
+iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
{
- rb_iseq_t *iseq = iseq_alloc();
+ VALUE iseqval = iseq_alloc(self);
VALUE magic, version1, version2, format_type, misc;
- VALUE name, path, realpath, first_lineno, code_range;
- VALUE type, body, locals, params, exception;
+ VALUE name, path, absolute_path, first_lineno;
+ VALUE type, body, locals, args, exception;
st_data_t iseq_type;
+ rb_iseq_t *iseq;
rb_compile_option_t option;
int i = 0;
- rb_code_range_t tmp_loc = { {0, 0}, {-1, -1} };
/* [magic, major_version, minor_version, format_type, misc,
* label, path, first_lineno,
@@ -605,46 +522,47 @@ iseq_load(VALUE data, const rb_iseq_t *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 = CHECK_HASH(rb_ary_entry(data, i++));
- ((void)magic, (void)version1, (void)version2, (void)format_type);
+ misc = rb_ary_entry(data, i++); /* TODO */
+ ((void)magic, (void)version1, (void)version2, (void)format_type, (void)misc);
name = CHECK_STRING(rb_ary_entry(data, i++));
path = CHECK_STRING(rb_ary_entry(data, i++));
- realpath = rb_ary_entry(data, i++);
- realpath = NIL_P(realpath) ? Qnil : CHECK_STRING(realpath);
+ absolute_path = rb_ary_entry(data, i++);
+ absolute_path = NIL_P(absolute_path) ? Qnil : CHECK_STRING(absolute_path);
first_lineno = CHECK_INTEGER(rb_ary_entry(data, i++));
type = CHECK_SYMBOL(rb_ary_entry(data, i++));
locals = CHECK_ARRAY(rb_ary_entry(data, i++));
- params = CHECK_HASH(rb_ary_entry(data, i++));
+
+ args = rb_ary_entry(data, i++);
+ if (FIXNUM_P(args) || (args = CHECK_ARRAY(args))) {
+ /* */
+ }
+
exception = CHECK_ARRAY(rb_ary_entry(data, i++));
body = CHECK_ARRAY(rb_ary_entry(data, i++));
- iseq->body->local_iseq = iseq;
+ GetISeqPtr(iseqval, iseq);
+ iseq->self = iseqval;
+ iseq->local_iseq = iseq;
iseq_type = iseq_type_from_sym(type);
if (iseq_type == (enum iseq_type)-1) {
rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, rb_sym2str(type));
}
- code_range = rb_hash_aref(misc, ID2SYM(rb_intern("code_range")));
- if (RB_TYPE_P(code_range, T_ARRAY) && RARRAY_LEN(code_range) == 4) {
- tmp_loc.first_loc.lineno = NUM2INT(rb_ary_entry(code_range, 0));
- tmp_loc.first_loc.column = NUM2INT(rb_ary_entry(code_range, 1));
- tmp_loc.last_loc.lineno = NUM2INT(rb_ary_entry(code_range, 2));
- tmp_loc.last_loc.column = NUM2INT(rb_ary_entry(code_range, 3));
+ if (parent == Qnil) {
+ parent = 0;
}
make_compile_option(&option, opt);
- option.peephole_optimization = FALSE; /* because peephole optimization can modify original iseq */
- prepare_iseq_build(iseq, name, path, realpath, first_lineno, &tmp_loc,
- parent, (enum iseq_type)iseq_type, &option);
-
- rb_iseq_build_from_ary(iseq, misc, locals, params, exception, body);
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno,
+ parent, (enum iseq_type)iseq_type, 0, &option);
- finish_iseq_build(iseq);
+ rb_iseq_build_from_ary(iseq, locals, args, exception, body);
- return iseqw_new(iseq);
+ cleanup_iseq_build(iseq);
+ return iseqval;
}
/*
@@ -655,179 +573,79 @@ iseq_s_load(int argc, VALUE *argv, VALUE self)
{
VALUE data, opt=Qnil;
rb_scan_args(argc, argv, "11", &data, &opt);
- return iseq_load(data, NULL, opt);
-}
-
-VALUE
-rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
-{
- return iseq_load(data, RTEST(parent) ? (rb_iseq_t *)parent : NULL, opt);
-}
-
-rb_iseq_t *
-rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, const struct rb_block *base_block, VALUE opt)
-{
- rb_iseq_t *iseq = NULL;
- const rb_iseq_t *const parent = base_block ? vm_block_iseq(base_block) : NULL;
- rb_compile_option_t option;
- const enum iseq_type type = parent ? ISEQ_TYPE_EVAL : ISEQ_TYPE_TOP;
-#if !defined(__GNUC__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 8)
-# define INITIALIZED volatile /* suppress warnings by gcc 4.8 */
-#else
-# define INITIALIZED /* volatile */
-#endif
- rb_ast_t *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start);
- int ln;
- rb_ast_t *INITIALIZED ast;
-
- /* safe results first */
- make_compile_option(&option, opt);
- ln = NUM2INT(line);
- StringValueCStr(file);
- if (RB_TYPE_P(src, T_FILE)) {
- parse = rb_parser_compile_file_path;
- }
- else {
- parse = rb_parser_compile_string_path;
- StringValue(src);
- }
- {
- const VALUE parser = rb_parser_new();
- rb_parser_set_context(parser, base_block, FALSE);
- ast = (*parse)(parser, file, src, ln);
- }
-
- if (!ast->root) {
- rb_ast_dispose(ast);
- rb_exc_raise(GET_EC()->errinfo);
- }
- else {
- INITIALIZED VALUE label = parent ?
- parent->body->location.label :
- rb_fstring_cstr("<compiled>");
- iseq = rb_iseq_new_with_opt(ast->root, label, file, realpath, line,
- parent, type, &option);
- rb_ast_dispose(ast);
- }
- return iseq;
-}
-
-rb_iseq_t *
-rb_iseq_compile(VALUE src, VALUE file, VALUE line)
-{
- return rb_iseq_compile_with_option(src, file, Qnil, line, 0, Qnil);
-}
-
-rb_iseq_t *
-rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, const struct rb_block *base_block)
-{
- return rb_iseq_compile_with_option(src, file, Qnil, line, base_block, Qnil);
+ return iseq_load(self, data, 0, opt);
}
VALUE
-rb_iseq_path(const rb_iseq_t *iseq)
+rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
{
- return pathobj_path(iseq->body->location.pathobj);
+ return iseq_load(rb_cISeq, data, parent, opt);
}
VALUE
-rb_iseq_realpath(const rb_iseq_t *iseq)
+rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt)
{
- return pathobj_realpath(iseq->body->location.pathobj);
-}
+ int state;
+ rb_thread_t *th = GET_THREAD();
+ rb_block_t *prev_base_block = th->base_block;
+ VALUE iseqval = Qundef;
-VALUE
-rb_iseq_absolute_path(const rb_iseq_t *iseq)
-{
- return rb_iseq_realpath(iseq);
-}
+ th->base_block = base_block;
-VALUE
-rb_iseq_label(const rb_iseq_t *iseq)
-{
- return iseq->body->location.label;
-}
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ VALUE parser;
+ int ln = NUM2INT(line);
+ NODE *node;
+ rb_compile_option_t option;
-VALUE
-rb_iseq_base_label(const rb_iseq_t *iseq)
-{
- return iseq->body->location.base_label;
-}
+ StringValueCStr(file);
+ make_compile_option(&option, opt);
-VALUE
-rb_iseq_first_lineno(const rb_iseq_t *iseq)
-{
- return iseq->body->location.first_lineno;
-}
+ parser = rb_parser_new();
-VALUE
-rb_iseq_method_name(const rb_iseq_t *iseq)
-{
- const rb_iseq_t *local_iseq;
+ 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);
- local_iseq = iseq->body->local_iseq;
+ if (!node) {
+ rb_exc_raise(GET_THREAD()->errinfo); /* TODO: check err */
+ }
+ }
- if (local_iseq->body->type == ISEQ_TYPE_METHOD) {
- return local_iseq->body->location.base_label;
- }
- else {
- return Qnil;
+ 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);
+ }
}
-}
-
-void
-rb_iseq_code_range(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column)
-{
- if (first_lineno) *first_lineno = iseq->body->location.code_range.first_loc.lineno;
- if (first_column) *first_column = iseq->body->location.code_range.first_loc.column;
- if (last_lineno) *last_lineno = iseq->body->location.code_range.last_loc.lineno;
- if (last_column) *last_column = iseq->body->location.code_range.last_loc.column;
-}
-
-VALUE
-rb_iseq_coverage(const rb_iseq_t *iseq)
-{
- return ISEQ_COVERAGE(iseq);
-}
+ TH_POP_TAG();
-/* define wrapper class methods (RubyVM::InstructionSequence) */
+ th->base_block = prev_base_block;
-static void
-iseqw_mark(void *ptr)
-{
- rb_gc_mark((VALUE)ptr);
-}
+ if (state) {
+ JUMP_TAG(state);
+ }
-static size_t
-iseqw_memsize(const void *ptr)
-{
- return iseq_memsize((const rb_iseq_t *)ptr);
+ return iseqval;
}
-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)
+VALUE
+rb_iseq_compile(VALUE src, VALUE file, VALUE line)
{
- 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;
+ return rb_iseq_compile_with_option(src, file, Qnil, line, 0, Qnil);
}
VALUE
-rb_iseqw_new(const rb_iseq_t *iseq)
+rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, rb_block_t *base_block)
{
- return iseqw_new(iseq);
+ return rb_iseq_compile_with_option(src, file, Qnil, line, base_block, Qnil);
}
/*
@@ -852,30 +670,17 @@ rb_iseqw_new(const rb_iseq_t *iseq)
*
*/
static VALUE
-iseqw_s_compile(int argc, VALUE *argv, VALUE self)
+iseq_s_compile(int argc, VALUE *argv, VALUE self)
{
VALUE src, file = Qnil, path = Qnil, line = INT2FIX(1), opt = Qnil;
- int i;
rb_secure(1);
- i = rb_scan_args(argc, argv, "1*:", &src, NULL, &opt);
- if (i > 4+NIL_P(opt)) rb_error_arity(argc, 1, 5);
- switch (i) {
- case 5: opt = argv[--i];
- case 4: line = argv[--i];
- case 3: path = argv[--i];
- case 2: file = argv[--i];
- }
-
- if (NIL_P(file)) file = rb_fstring_cstr("<compiled>");
- if (NIL_P(path)) path = file;
+ 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);
- Check_Type(path, T_STRING);
- Check_Type(file, T_STRING);
-
- return iseqw_new(rb_iseq_compile_with_option(src, file, path, line, 0, opt));
+ return rb_iseq_compile_with_option(src, file, path, line, 0, opt);
}
/*
@@ -899,44 +704,28 @@ iseqw_s_compile(int argc, VALUE *argv, VALUE self)
* #=> <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
*/
static VALUE
-iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
+iseq_s_compile_file(int argc, VALUE *argv, VALUE self)
{
VALUE file, line = INT2FIX(1), opt = Qnil;
- VALUE parser, f, exc = Qnil, ret;
- rb_ast_t *ast;
+ VALUE parser;
+ VALUE f;
+ NODE *node;
+ const char *fname;
rb_compile_option_t option;
- int i;
rb_secure(1);
- i = rb_scan_args(argc, argv, "1*:", &file, NULL, &opt);
- if (i > 1+NIL_P(opt)) rb_error_arity(argc, 1, 2);
- switch (i) {
- case 2: opt = argv[--i];
- }
+ rb_scan_args(argc, argv, "11", &file, &opt);
FilePathValue(file);
- file = rb_fstring(file); /* rb_io_t->pathv gets frozen anyways */
+ fname = StringValueCStr(file);
f = rb_file_open_str(file, "r");
parser = rb_parser_new();
- rb_parser_set_context(parser, NULL, FALSE);
- ast = rb_parser_compile_file_path(parser, file, f, NUM2INT(line));
- if (!ast->root) exc = GET_EC()->errinfo;
-
- rb_io_close(f);
- if (!ast->root) {
- rb_ast_dispose(ast);
- rb_exc_raise(exc);
- }
-
+ node = rb_parser_compile_file(parser, fname, f, NUM2INT(line));
make_compile_option(&option, opt);
-
- ret = iseqw_new(rb_iseq_new_with_opt(ast->root, rb_fstring_cstr("<main>"),
- file,
- rb_realpath_internal(Qnil, file, 1),
- line, NULL, ISEQ_TYPE_TOP, &option));
- rb_ast_dispose(ast);
- return ret;
+ return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), file,
+ rb_realpath_internal(Qnil, file, 1), line, Qfalse,
+ ISEQ_TYPE_TOP, &option);
}
/*
@@ -963,6 +752,7 @@ iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
* * +:specialized_instruction+
* * +:stack_caching+
* * +:tailcall_optimization+
+ * * +:trace_instruction+
*
* Additionally, +:debug_level+ can be set to an integer.
*
@@ -971,7 +761,7 @@ iseqw_s_compile_file(int argc, VALUE *argv, VALUE self)
* ::new, ::compile and ::compile_file.
*/
static VALUE
-iseqw_s_compile_option_set(VALUE self, VALUE opt)
+iseq_s_compile_option_set(VALUE self, VALUE opt)
{
rb_compile_option_t option;
rb_secure(1);
@@ -989,32 +779,22 @@ iseqw_s_compile_option_set(VALUE self, VALUE opt)
* For details, see InstructionSequence.compile_option=.
*/
static VALUE
-iseqw_s_compile_option_get(VALUE self)
+iseq_s_compile_option_get(VALUE self)
{
return make_compile_option_value(&COMPILE_OPTION_DEFAULT);
}
-static const rb_iseq_t *
-iseqw_check(VALUE iseqw)
+static rb_iseq_t *
+iseq_check(VALUE val)
{
- rb_iseq_t *iseq = DATA_PTR(iseqw);
-
- if (!iseq->body) {
- rb_ibf_load_iseq_complete(iseq);
- }
-
- if (!iseq->body->location.label) {
+ rb_iseq_t *iseq;
+ GetISeqPtr(val, iseq);
+ if (!iseq->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
@@ -1024,10 +804,10 @@ rb_iseqw_to_iseq(VALUE iseqw)
* RubyVM::InstructionSequence.compile("1 + 2").eval #=> 3
*/
static VALUE
-iseqw_eval(VALUE self)
+iseq_eval(VALUE self)
{
rb_secure(1);
- return rb_iseq_eval(iseqw_check(self));
+ return rb_iseq_eval(self);
}
/*
@@ -1035,20 +815,17 @@ iseqw_eval(VALUE self)
* sequence, including the #label and #path.
*/
static VALUE
-iseqw_inspect(VALUE self)
+iseq_inspect(VALUE self)
{
- const rb_iseq_t *iseq = iseqw_check(self);
- VALUE klass = rb_class_name(rb_obj_class(self));
-
- if (!iseq->body->location.label) {
- return rb_sprintf("#<%"PRIsVALUE": uninitialized>", klass);
- }
- else {
- return rb_sprintf("<%"PRIsVALUE":%"PRIsVALUE"@%"PRIsVALUE":%d>",
- klass,
- iseq->body->location.label, rb_iseq_path(iseq),
- FIX2INT(rb_iseq_first_lineno(iseq)));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ if (!iseq->location.label) {
+ return rb_sprintf("#<%s: uninitialized>", rb_obj_classname(self));
}
+
+ return rb_sprintf("<%s:%s@%s>",
+ rb_obj_classname(self),
+ RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
}
/*
@@ -1074,10 +851,12 @@ iseqw_inspect(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.path #=> /tmp/method.rb
*/
-static VALUE
-iseqw_path(VALUE self)
+VALUE
+rb_iseq_path(VALUE self)
{
- return rb_iseq_path(iseqw_check(self));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.path;
}
/*
@@ -1096,10 +875,12 @@ iseqw_path(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.absolute_path #=> /tmp/method.rb
*/
-static VALUE
-iseqw_absolute_path(VALUE self)
+VALUE
+rb_iseq_absolute_path(VALUE self)
{
- return rb_iseq_realpath(iseqw_check(self));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.absolute_path;
}
/* Returns the label of this instruction sequence.
@@ -1125,10 +906,12 @@ iseqw_absolute_path(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.label #=> <main>
*/
-static VALUE
-iseqw_label(VALUE self)
+VALUE
+rb_iseq_label(VALUE self)
{
- return rb_iseq_label(iseqw_check(self));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.label;
}
/* Returns the base label of this instruction sequence.
@@ -1151,10 +934,12 @@ iseqw_label(VALUE self)
* > iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
* > iseq.base_label #=> <main>
*/
-static VALUE
-iseqw_base_label(VALUE self)
+VALUE
+rb_iseq_base_label(VALUE self)
{
- return rb_iseq_base_label(iseqw_check(self));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.base_label;
}
/* Returns the number of the first source line where the instruction sequence
@@ -1167,13 +952,38 @@ iseqw_base_label(VALUE self)
* iseq.first_lineno
* #=> 1
*/
-static VALUE
-iseqw_first_lineno(VALUE self)
+VALUE
+rb_iseq_first_lineno(VALUE self)
{
- return rb_iseq_first_lineno(iseqw_check(self));
+ rb_iseq_t *iseq;
+ GetISeqPtr(self, iseq);
+ return iseq->location.first_lineno;
}
-static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
+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);
/*
* call-seq:
@@ -1240,8 +1050,14 @@ static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
* An array containing the names of all arguments and local variables as
* symbols.
*
- * [params]
- * An Hash object containing parameter information.
+ * [args]
+ * The arity if the method or block only has required arguments.
+ *
+ * Otherwise an array of:
+ *
+ * [required_argc, [optional_arg_labels, ...],
+ * splat_index, post_splat_argc, post_splat_index,
+ * block_index, simple]
*
* More info about these values can be found in +vm_core.h+.
*
@@ -1253,113 +1069,57 @@ static VALUE iseq_data_to_ary(const 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
-iseqw_to_a(VALUE self)
+iseq_to_a(VALUE self)
{
- const rb_iseq_t *iseq = iseqw_check(self);
+ rb_iseq_t *iseq = iseq_check(self);
rb_secure(1);
return iseq_data_to_ary(iseq);
}
-static const struct iseq_insn_info_entry *
-get_insn_info_binary_search(const rb_iseq_t *iseq, size_t pos)
-{
- size_t size = iseq->body->insns_info_size;
- const struct iseq_insn_info_entry *insns_info = iseq->body->insns_info;
- const int debug = 0;
-
- if (debug) {
- printf("size: %"PRIuSIZE"\n", size);
- printf("insns_info[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
- (size_t)0, insns_info[0].position, insns_info[0].line_no, pos);
- }
+/* TODO: search algorithm is brute force.
+ this should be binary search or so. */
- if (size == 0) {
- return NULL;
- }
- else if (size == 1) {
- return &insns_info[0];
- }
- else {
- size_t l = 1, r = size - 1;
- while (l <= r) {
- size_t m = l + (r - l) / 2;
- if (insns_info[m].position == pos) {
- return &insns_info[m];
- }
- if (insns_info[m].position < pos) {
- l = m + 1;
- }
- else {
- r = m - 1;
- }
- }
- if (l >= size) {
- return &insns_info[size-1];
- }
- if (insns_info[l].position > pos) {
- return &insns_info[l-1];
- }
- return &insns_info[l];
- }
-}
-
-#if VM_CHECK_MODE > 0
-static const struct iseq_insn_info_entry *
-get_insn_info_linear_search(const rb_iseq_t *iseq, size_t pos)
+static struct iseq_line_info_entry *
+get_line_info(const rb_iseq_t *iseq, size_t pos)
{
- size_t i = 0, size = iseq->body->insns_info_size;
- const struct iseq_insn_info_entry *insns_info = iseq->body->insns_info.body;
+ size_t i = 0, size = iseq->line_info_size;
+ struct iseq_line_info_entry *table = iseq->line_info_table;
const int debug = 0;
if (debug) {
- printf("size: %"PRIuSIZE"\n", size);
- printf("insns_info[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
- i, insns_info[i].position, insns_info[i].line_no, pos);
+ printf("size: %"PRIdSIZE"\n", size);
+ printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ i, table[i].position, table[i].line_no, pos);
}
if (size == 0) {
- return NULL;
+ return 0;
}
else if (size == 1) {
- return &insns_info[0];
+ return &table[0];
}
else {
for (i=1; i<size; i++) {
- if (debug) printf("insns_info[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
- i, insns_info[i].position, insns_info[i].line_no, pos);
+ if (debug) printf("table[%"PRIdSIZE"]: position: %d, line: %d, pos: %"PRIdSIZE"\n",
+ i, table[i].position, table[i].line_no, pos);
- if (insns_info[i].position == pos) {
- return &insns_info[i];
+ if (table[i].position == pos) {
+ return &table[i];
}
- if (insns_info[i].position > pos) {
- return &insns_info[i-1];
+ if (table[i].position > pos) {
+ return &table[i-1];
}
}
}
- return &insns_info[i-1];
-}
-
-static void
-validate_get_insn_info(rb_iseq_t *iseq)
-{
- size_t i;
- for (i = 0; i < iseq->body->iseq_size; i++) {
- if (get_insn_info_linear_search(iseq, i) != get_insn_info_binary_search(iseq, i)) {
- rb_bug("validate_get_insn_info: get_insn_info_linear_search(iseq, %"PRIuSIZE") != get_insn_info_binary_search(iseq, %"PRIuSIZE")", i, i);
- }
- }
+ return &table[i-1];
}
-#endif
-unsigned int
-rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
+static unsigned int
+find_line_no(const rb_iseq_t *iseq, size_t pos)
{
- const struct iseq_insn_info_entry *entry = get_insn_info_binary_search(iseq, pos);
-
+ struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
if (entry) {
return entry->line_no;
}
@@ -1368,15 +1128,14 @@ rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
}
}
-rb_event_flag_t
-rb_iseq_event_flags(const rb_iseq_t *iseq, size_t pos)
+unsigned int
+rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
{
- const struct iseq_insn_info_entry *entry = get_insn_info_binary_search(iseq, pos);
- if (entry) {
- return entry->events;
+ if (pos == 0) {
+ return find_line_no(iseq, pos);
}
else {
- return 0;
+ return find_line_no(iseq, pos - 1);
}
}
@@ -1393,22 +1152,6 @@ id_to_name(ID id, VALUE default_value)
return str;
}
-static VALUE
-local_var_name(const rb_iseq_t *diseq, VALUE level, VALUE op)
-{
- VALUE i;
- ID lid;
-
- for (i = 0; i < level; i++) {
- diseq = diseq->body->parent_iseq;
- }
- lid = diseq->body->local_table[diseq->body->local_table_size +
- VM_ENV_DATA_SIZE - 1 - op];
- return id_to_name(lid, INT2FIX('*'));
-}
-
-int rb_insn_unified_local_var_level(VALUE);
-
VALUE
rb_insn_operand_intern(const rb_iseq_t *iseq,
VALUE insn, int op_no, VALUE op,
@@ -1416,7 +1159,7 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
{
const char *types = insn_op_types(insn);
char type = types[op_no];
- VALUE ret = Qundef;
+ VALUE ret;
switch (type) {
case TS_OFFSET: /* LONG */
@@ -1424,55 +1167,34 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
break;
case TS_NUM: /* ULONG */
- {
- const char *type_str;
- if (insn == BIN(branchiftype) && (type_str = rb_type_str((enum ruby_value_type)op)) != NULL) {
- ret = rb_str_new_cstr(type_str);
- }
- else if (insn == BIN(defined) && op_no == 0 &&
- ((enum defined_type)op == DEFINED_FUNC ? (ret = rb_fstring_cstr("func"), 1) :
- (enum defined_type)op == DEFINED_REF ? (ret = rb_fstring_cstr("ref"), 1) :
- (ret = rb_iseq_defined_string((enum defined_type)op)) != 0)) {
- /* ok */
+ ret = rb_sprintf("%"PRIuVALUE, op);
+ break;
+
+ case TS_LINDEX:{
+ if (insn == BIN(getlocal) || insn == BIN(setlocal)) {
+ if (pnop) {
+ const rb_iseq_t *diseq = iseq;
+ VALUE level = *pnop, i;
+
+ for (i = 0; i < level; i++) {
+ diseq = diseq->parent_iseq;
+ }
+ ret = id_to_name(diseq->local_table[diseq->local_size - op], INT2FIX('*'));
}
else {
ret = rb_sprintf("%"PRIuVALUE, op);
}
}
- break;
-
- case TS_LINDEX:{
- int level;
- if (types[op_no+1] == TS_NUM && pnop) {
- ret = local_var_name(iseq, *pnop, op);
- }
- else if ((level = rb_insn_unified_local_var_level(insn)) >= 0) {
- ret = local_var_name(iseq, (VALUE)level, op);
- }
else {
ret = rb_inspect(INT2FIX(op));
}
break;
}
case TS_ID: /* ID (symbol) */
- ret = rb_inspect(ID2SYM(op));
- break;
+ op = ID2SYM(op);
case TS_VALUE: /* VALUE */
op = obj_resurrect(op);
- if (insn == BIN(defined) && op_no == 1 && FIXNUM_P(op)) {
- /* should be DEFINED_REF */
- int type = NUM2INT(op);
- if (type) {
- if (type & 1) {
- ret = rb_sprintf(":$%c", (type >> 1));
- }
- else {
- ret = rb_sprintf(":$%d", (type >> 1));
- }
- break;
- }
- }
ret = rb_inspect(op);
if (CLASS_OF(op) == rb_cISeq) {
if (child) {
@@ -1483,11 +1205,11 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
case TS_ISEQ: /* iseq */
{
- if (op) {
- const rb_iseq_t *iseq = rb_iseq_check((rb_iseq_t *)op);
- ret = iseq->body->location.label;
+ rb_iseq_t *iseq = (rb_iseq_t *)op;
+ if (iseq) {
+ ret = iseq->location.label;
if (child) {
- rb_ary_push(child, (VALUE)iseq);
+ rb_ary_push(child, iseq->self);
}
}
else {
@@ -1503,66 +1225,49 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
break;
case TS_IC:
- ret = rb_sprintf("<is:%"PRIdPTRDIFF">", (union iseq_inline_storage_entry *)op - iseq->body->is_entries);
+ ret = rb_sprintf("<is:%"PRIdPTRDIFF">", (union iseq_inline_storage_entry *)op - iseq->is_entries);
break;
case TS_CALLINFO:
{
- struct rb_call_info *ci = (struct rb_call_info *)op;
+ rb_call_info_t *ci = (rb_call_info_t *)op;
VALUE ary = rb_ary_new();
if (ci->mid) {
- rb_ary_push(ary, rb_sprintf("mid:%"PRIsVALUE, rb_id2str(ci->mid)));
+ rb_ary_push(ary, rb_sprintf("mid:%s", rb_id2name(ci->mid)));
}
rb_ary_push(ary, rb_sprintf("argc:%d", ci->orig_argc));
- if (ci->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->blockiseq) {
+ if (child) {
+ rb_ary_push(child, ci->blockiseq->self);
+ }
+ rb_ary_push(ary, rb_sprintf("block:%"PRIsVALUE, ci->blockiseq->location.label));
}
if (ci->flag) {
VALUE flags = rb_ary_new();
-# define CALL_FLAG(n) if (ci->flag & VM_CALL_##n) rb_ary_push(flags, rb_str_new2(#n))
- CALL_FLAG(ARGS_SPLAT);
- CALL_FLAG(ARGS_BLOCKARG);
- CALL_FLAG(ARGS_BLOCKARG_BLOCKPARAM);
- CALL_FLAG(FCALL);
- CALL_FLAG(VCALL);
- CALL_FLAG(ARGS_SIMPLE);
- CALL_FLAG(BLOCKISEQ);
- CALL_FLAG(TAILCALL);
- CALL_FLAG(SUPER);
- CALL_FLAG(KWARG);
- CALL_FLAG(KW_SPLAT);
- CALL_FLAG(OPT_SEND); /* maybe not reachable */
+ if (ci->flag & VM_CALL_ARGS_SPLAT) rb_ary_push(flags, rb_str_new2("ARGS_SPLAT"));
+ if (ci->flag & VM_CALL_ARGS_BLOCKARG) rb_ary_push(flags, rb_str_new2("ARGS_BLOCKARG"));
+ if (ci->flag & VM_CALL_FCALL) rb_ary_push(flags, rb_str_new2("FCALL"));
+ if (ci->flag & VM_CALL_VCALL) rb_ary_push(flags, rb_str_new2("VCALL"));
+ if (ci->flag & VM_CALL_TAILCALL) rb_ary_push(flags, rb_str_new2("TAILCALL"));
+ if (ci->flag & VM_CALL_SUPER) rb_ary_push(flags, rb_str_new2("SUPER"));
+ if (ci->flag & VM_CALL_OPT_SEND) rb_ary_push(flags, rb_str_new2("SNED")); /* maybe not reachable */
+ if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) rb_ary_push(flags, rb_str_new2("ARGS_SKIP")); /* maybe not reachable */
rb_ary_push(ary, rb_ary_join(flags, rb_str_new2("|")));
}
ret = rb_sprintf("<callinfo!%"PRIsVALUE">", rb_ary_join(ary, rb_str_new2(", ")));
}
break;
- case TS_CALLCACHE:
- ret = rb_str_new2("<callcache>");
- break;
-
case TS_CDHASH:
ret = rb_str_new2("<cdhash>");
break;
case TS_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>");
- }
+ ret = rb_str_new2("<funcptr>");
break;
default:
@@ -1576,10 +1281,10 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
* Iseq -> Iseq inspect object
*/
int
-rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
- const rb_iseq_t *iseq, VALUE child)
+rb_iseq_disasm_insn(VALUE ret, const VALUE *iseq, size_t pos,
+ const rb_iseq_t *iseqdat, VALUE child)
{
- VALUE insn = code[pos];
+ VALUE insn = iseq[pos];
int len = insn_len(insn);
int j;
const char *types = insn_op_types(insn);
@@ -1588,16 +1293,17 @@ rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
insn_name_buff = insn_name(insn);
if (1) {
- rb_str_catf(str, "%04"PRIuSIZE" %-16s ", pos, insn_name_buff);
+ rb_str_catf(str, "%04"PRIdSIZE" %-16s ", pos, insn_name_buff);
}
else {
- rb_str_catf(str, "%04"PRIuSIZE" %-16.*s ", pos,
+ rb_str_catf(str, "%04"PRIdSIZE" %-16.*s ", pos,
(int)strcspn(insn_name_buff, "_"), insn_name_buff);
}
for (j = 0; types[j]; j++) {
- VALUE opstr = rb_insn_operand_intern(iseq, insn, j, code[pos + j + 1],
- len, pos, &code[pos + j + 2],
+ 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],
child);
rb_str_concat(str, opstr);
@@ -1607,8 +1313,8 @@ rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
}
{
- unsigned int line_no = rb_iseq_line_no(iseq, pos);
- unsigned int prev = pos == 0 ? 0 : rb_iseq_line_no(iseq, pos - 1);
+ unsigned int line_no = find_line_no(iseqdat, pos);
+ unsigned int prev = pos == 0 ? 0 : find_line_no(iseqdat, pos - 1);
if (line_no && line_no != prev) {
long slen = RSTRING_LEN(str);
slen = (slen > 70) ? 0 : (70 - slen);
@@ -1616,22 +1322,6 @@ rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
}
}
- {
- rb_event_flag_t events = rb_iseq_event_flags(iseq, pos);
- if (events) {
- str = rb_str_catf(str, "[%s%s%s%s%s%s%s%s%s]",
- events & RUBY_EVENT_LINE ? "Li" : "",
- events & RUBY_EVENT_CLASS ? "Cl" : "",
- events & RUBY_EVENT_END ? "En" : "",
- events & RUBY_EVENT_CALL ? "Ca" : "",
- events & RUBY_EVENT_RETURN ? "Re" : "",
- events & RUBY_EVENT_C_CALL ? "Cc" : "",
- events & RUBY_EVENT_C_RETURN ? "Cr" : "",
- events & RUBY_EVENT_B_CALL ? "Bc" : "",
- events & RUBY_EVENT_B_RETURN ? "Br" : "");
- }
- }
-
if (ret) {
rb_str_cat2(str, "\n");
rb_str_concat(ret, str);
@@ -1664,44 +1354,45 @@ catch_type(int type)
}
}
-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:%d (%d,%d)-(%d,%d)>",
- RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(rb_iseq_path(iseq)),
- iseq->body->location.code_range.first_loc.lineno,
- iseq->body->location.code_range.first_loc.lineno,
- iseq->body->location.code_range.first_loc.column,
- iseq->body->location.code_range.last_loc.lineno,
- iseq->body->location.code_range.last_loc.column);
- }
-}
-
+/*
+ * call-seq:
+ * iseq.disasm -> str
+ * iseq.disassemble -> str
+ *
+ * Returns the instruction sequence as a +String+ in human readable form.
+ *
+ * puts RubyVM::InstructionSequence.compile('1 + 2').disasm
+ *
+ * Produces:
+ *
+ * == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
+ * 0000 trace 1 ( 1)
+ * 0002 putobject 1
+ * 0004 putobject 2
+ * 0006 opt_plus <ic:1>
+ * 0008 leave
+ */
VALUE
-rb_iseq_disasm(const rb_iseq_t *iseq)
+rb_iseq_disasm(VALUE self)
{
- VALUE *code;
+ rb_iseq_t *iseqdat = iseq_check(self);
+ VALUE *iseq;
VALUE str = rb_str_new(0, 0);
- VALUE child = rb_ary_tmp_new(3);
+ VALUE child = rb_ary_new();
unsigned int size;
- unsigned int i;
+ int i;
long l;
- const ID *tbl;
+ ID *tbl;
size_t n;
enum {header_minlen = 72};
- st_table *done_iseq = 0;
rb_secure(1);
- size = iseq->body->iseq_size;
+ size = iseqdat->iseq_size;
rb_str_cat2(str, "== disasm: ");
- rb_str_concat(str, iseq_inspect(iseq));
+ rb_str_concat(str, iseq_inspect(iseqdat->self));
if ((l = RSTRING_LEN(str)) < header_minlen) {
rb_str_resize(str, header_minlen);
memset(RSTRING_PTR(str) + l, '=', header_minlen - l);
@@ -1709,69 +1400,61 @@ rb_iseq_disasm(const rb_iseq_t *iseq)
rb_str_cat2(str, "\n");
/* show catch table information */
- if (iseq->body->catch_table) {
+ if (iseqdat->catch_table) {
rb_str_cat2(str, "== catch table\n");
}
- 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 && !(done_iseq && st_is_member(done_iseq, (st_data_t)entry->iseq))) {
- rb_str_concat(str, rb_iseq_disasm(rb_iseq_check(entry->iseq)));
- if (!done_iseq) done_iseq = st_init_numtable();
- st_insert(done_iseq, (st_data_t)entry->iseq, (st_data_t)0);
- }
+ if (iseqdat->catch_table) for (i = 0; i < iseqdat->catch_table->size; i++) {
+ struct iseq_catch_table_entry *entry = &iseqdat->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(entry->iseq));
}
}
- if (iseq->body->catch_table) {
+ if (iseqdat->catch_table) {
rb_str_cat2(str, "|-------------------------------------"
"-----------------------------------\n");
}
/* show local table information */
- tbl = iseq->body->local_table;
+ tbl = iseqdat->local_table;
if (tbl) {
rb_str_catf(str,
"local table (size: %d, argc: %d "
- "[opts: %d, rest: %d, post: %d, block: %d, kw: %d@%d, kwrest: %d])\n",
- iseq->body->local_table_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;
+ "[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++) {
long width;
VALUE name = id_to_name(tbl[i], 0);
char argi[0x100] = "";
char opti[0x100] = "";
- 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) {
+ if (iseqdat->arg_opts) {
+ int argc = iseqdat->argc;
+ int opts = iseqdat->arg_opts;
+ if (i >= argc && i < argc + opts - 1) {
snprintf(opti, sizeof(opti), "Opt=%"PRIdVALUE,
- iseq->body->param.opt_table[li - argc]);
+ iseqdat->arg_opt_table[i - argc]);
}
}
snprintf(argi, sizeof(argi), "%s%s%s%s%s", /* arg, opts, rest, post block */
- iseq->body->param.lead_num > li ? "Arg" : "",
+ iseqdat->argc > i ? "Arg" : "",
opti,
- (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" : "");
+ 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" : "");
- rb_str_catf(str, "[%2d] ", iseq->body->local_table_size - i);
+ rb_str_catf(str, "[%2d] ", iseqdat->local_size - i);
width = RSTRING_LEN(str) + 11;
if (name)
rb_str_append(str, name);
@@ -1784,146 +1467,19 @@ rb_iseq_disasm(const rb_iseq_t *iseq)
}
/* show each line */
- code = rb_iseq_original_iseq(iseq);
+ iseq = rb_iseq_original_iseq(iseqdat);
for (n = 0; n < size;) {
- n += rb_iseq_disasm_insn(str, code, n, iseq, child);
+ n += rb_iseq_disasm_insn(str, iseq, n, iseqdat, child);
}
- for (l = 0; l < RARRAY_LEN(child); l++) {
- VALUE isv = rb_ary_entry(child, l);
- if (done_iseq && st_is_member(done_iseq, (st_data_t)isv)) continue;
- rb_str_concat(str, rb_iseq_disasm(rb_iseq_check((rb_iseq_t *)isv)));
+ for (i = 0; i < RARRAY_LEN(child); i++) {
+ VALUE isv = rb_ary_entry(child, i);
+ rb_str_concat(str, rb_iseq_disasm(isv));
}
- if (done_iseq) st_free_table(done_iseq);
return str;
}
-static VALUE
-rb_iseq_all_children(const rb_iseq_t *iseq)
-{
- unsigned int i;
- VALUE *code = rb_iseq_original_iseq(iseq);
- VALUE all_children = rb_obj_hide(rb_ident_hash_new());
- VALUE child;
-
- 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];
- child = (VALUE)entry->iseq;
- if (child) {
- rb_hash_aset(all_children, child, Qtrue);
- }
- }
- }
- for (i=0; i<iseq->body->iseq_size;) {
- VALUE insn = code[i];
- int len = insn_len(insn);
- const char *types = insn_op_types(insn);
- int j;
-
- for (j=0; types[j]; j++) {
- switch (types[j]) {
- case TS_ISEQ:
- child = code[i+j+1];
- if (child) {
- rb_hash_aset(all_children, child, Qtrue);
- }
- break;
- default:
- break;
- }
- }
- i += len;
- }
- return all_children;
-}
-
-/*
- * 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));
-}
-
-static int
-iseqw_each_child_i(VALUE key, VALUE value, VALUE dummy)
-{
- rb_yield(iseqw_new((const rb_iseq_t *)key));
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * iseq.each_child{|child_iseq| ...} -> iseq
- *
- * Iterate all direct child instruction sequences.
- * Iteration order is implementation/version defined
- * so that people should not rely on the order.
- */
-static VALUE
-iseqw_each_child(VALUE self)
-{
- const rb_iseq_t *iseq = iseqw_check(self);
- VALUE all_children = rb_iseq_all_children(iseq);
- rb_hash_foreach(all_children, iseqw_each_child_i, Qnil);
- return self;
-}
-
-static void
-push_event_info(const rb_iseq_t *iseq, rb_event_flag_t events, int line, VALUE ary)
-{
-#define C(ev, cstr, l) if (events & ev) rb_ary_push(ary, rb_ary_new_from_args(2, l, ID2SYM(rb_intern(cstr))));
- C(RUBY_EVENT_CLASS, "class", rb_iseq_first_lineno(iseq));
- C(RUBY_EVENT_CALL, "call", rb_iseq_first_lineno(iseq));
- C(RUBY_EVENT_B_CALL, "b_call", rb_iseq_first_lineno(iseq));
- C(RUBY_EVENT_LINE, "line", INT2FIX(line));
- C(RUBY_EVENT_END, "end", INT2FIX(line));
- C(RUBY_EVENT_RETURN, "return", INT2FIX(line));
- C(RUBY_EVENT_B_RETURN, "b_return", INT2FIX(line));
-#undef C
-}
-
-/*
- * call-seq:
- * iseq.trace_points -> ary
- *
- * Return trace points in the instruction sequence.
- * Return an array of [line, event_symbol] pair.
- */
-static VALUE
-iseqw_trace_points(VALUE self)
-{
- const rb_iseq_t *iseq = iseqw_check(self);
- unsigned int i;
- VALUE ary = rb_ary_new();
-
- for (i=0; i<iseq->body->insns_info_size; i++) {
- const struct iseq_insn_info_entry *entry = &iseq->body->insns_info[i];
- if (entry->events) {
- push_event_info(iseq, entry->events, entry->line_no, ary);
- }
- }
- return ary;
-}
-
/*
* Returns the instruction sequence containing the given proc or method.
*
@@ -1960,24 +1516,25 @@ iseqw_trace_points(VALUE self)
* > #=> #<RubyVM::InstructionSequence:0x007fb73d7caf78>
*/
static VALUE
-iseqw_s_of(VALUE klass, VALUE body)
+iseq_s_of(VALUE klass, VALUE body)
{
- const rb_iseq_t *iseq = NULL;
+ VALUE ret = Qnil;
+ rb_iseq_t *iseq;
rb_secure(1);
if (rb_obj_is_proc(body)) {
- iseq = vm_proc_iseq(body);
-
- if (!rb_obj_is_iseq((VALUE)iseq)) {
- iseq = NULL;
+ rb_proc_t *proc;
+ GetProcPtr(body, proc);
+ iseq = proc->block.iseq;
+ if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ ret = iseq->self;
}
}
- else {
- iseq = rb_method_iseq(body);
+ else if ((iseq = rb_method_get_iseq(body)) != 0) {
+ ret = iseq->self;
}
-
- return iseq ? iseqw_new(iseq) : Qnil;
+ return ret;
}
/*
@@ -2032,11 +1589,12 @@ iseqw_s_of(VALUE klass, VALUE body)
* 0012 leave
*
*/
+
static VALUE
-iseqw_s_disasm(VALUE klass, VALUE body)
+iseq_s_disasm(VALUE klass, VALUE body)
{
- VALUE iseqw = iseqw_s_of(klass, body);
- return NIL_P(iseqw) ? Qnil : rb_iseq_disasm(iseqw_check(iseqw));
+ VALUE iseqval = iseq_s_of(klass, body);
+ return NIL_P(iseqval) ? Qnil : rb_iseq_disasm(iseqval);
}
const char *
@@ -2059,7 +1617,7 @@ ruby_node_name(int node)
static VALUE
register_label(struct st_table *table, unsigned long idx)
{
- VALUE sym = rb_str_intern(rb_sprintf("label_%lu", idx));
+ VALUE sym = rb_str_dynamic_intern(rb_sprintf("label_%lu", idx));
st_insert(table, idx, sym);
return sym;
}
@@ -2076,7 +1634,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("exception_type2symbol: unknown type %d", (int)type);
+ rb_bug("...");
}
return ID2SYM(id);
}
@@ -2090,19 +1648,18 @@ cdhash_each(VALUE key, VALUE value, VALUE ary)
}
static VALUE
-iseq_data_to_ary(const rb_iseq_t *iseq)
+iseq_data_to_ary(rb_iseq_t *iseq)
{
- unsigned int i;
- long l;
+ long i;
size_t ti;
unsigned int pos;
- int last_line = 0;
+ unsigned int line = 0;
VALUE *seq, *iseq_original;
VALUE val = rb_ary_new();
VALUE type; /* Symbol */
VALUE locals = rb_ary_new();
- VALUE params = rb_hash_new();
+ VALUE args = rb_ary_new();
VALUE body = rb_ary_new(); /* [[:insn1, ...], ...] */
VALUE nbody;
VALUE exception = rb_ary_new(); /* [[....]] */
@@ -2138,7 +1695,7 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
}
/* type */
- switch (iseq->body->type) {
+ switch (iseq->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;
@@ -2152,68 +1709,55 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
};
/* locals */
- for (i=0; i<iseq->body->local_table_size; i++) {
- ID lid = iseq->body->local_table[i];
+ for (i=0; i<iseq->local_table_size; i++) {
+ ID lid = iseq->local_table[i];
if (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));
- }
+ if (rb_id2str(lid)) rb_ary_push(locals, ID2SYM(lid));
}
else {
rb_ary_push(locals, ID2SYM(rb_intern("#arg_rest")));
}
}
- /* params */
+ /* args */
{
+ /*
+ * [argc, # argc
+ * [label1, label2, ...] # opts
+ * rest index,
+ * post_len
+ * post_start
+ * block index,
+ * simple,
+ * ]
+ */
+ VALUE arg_opt_labels = rb_ary_new();
int 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);
- }
+ for (j=0; j<iseq->arg_opts; j++) {
+ rb_ary_push(arg_opt_labels,
+ register_label(labels_table, iseq->arg_opt_table[j]));
+ }
/* commit */
- 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->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_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 */
- iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq);
+ iseq_original = rb_iseq_original_iseq(iseq);
- for (seq = iseq_original; seq < iseq_original + iseq->body->iseq_size; ) {
+ for (seq = iseq_original; seq < iseq_original + iseq->iseq_size; ) {
VALUE insn = *seq++;
int j, len = insn_len(insn);
VALUE *nseq = seq + len - 1;
@@ -2236,9 +1780,9 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
break;
case TS_ISEQ:
{
- const rb_iseq_t *iseq = (rb_iseq_t *)*seq;
+ rb_iseq_t *iseq = (rb_iseq_t *)*seq;
if (iseq) {
- VALUE val = iseq_data_to_ary(rb_iseq_check(iseq));
+ VALUE val = iseq_data_to_ary(iseq);
rb_ary_push(ary, val);
}
else {
@@ -2255,38 +1799,20 @@ iseq_data_to_ary(const 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->body->is_entries));
+ rb_ary_push(ary, INT2FIX(is - iseq->is_entries));
}
break;
case TS_CALLINFO:
{
- struct rb_call_info *ci = (struct rb_call_info *)*seq;
+ rb_call_info_t *ci = (rb_call_info_t *)*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")), 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_hash_aset(e, ID2SYM(rb_intern("flag")), ULONG2NUM(ci->flag));
+ rb_hash_aset(e, ID2SYM(rb_intern("orig_argc")), INT2FIX(ci->orig_argc));
+ rb_hash_aset(e, ID2SYM(rb_intern("blockptr")), ci->blockiseq ? iseq_data_to_ary(ci->blockiseq) : Qnil);
rb_ary_push(ary, e);
}
break;
- case TS_CALLCACHE:
- rb_ary_push(ary, Qfalse);
- break;
case TS_ID:
rb_ary_push(ary, ID2SYM(*seq));
break;
@@ -2308,16 +1834,6 @@ iseq_data_to_ary(const 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));
}
@@ -2328,12 +1844,14 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
nbody = body;
/* exception */
- if (iseq->body->catch_table) for (i=0; i<iseq->body->catch_table->size; i++) {
+ if (iseq->catch_table) for (i=0; i<iseq->catch_table->size; i++) {
VALUE ary = rb_ary_new();
- const struct iseq_catch_table_entry *entry = &iseq->body->catch_table->entries[i];
+ struct iseq_catch_table_entry *entry = &iseq->catch_table->entries[i];
rb_ary_push(ary, exception_type2symbol(entry->type));
if (entry->iseq) {
- rb_ary_push(ary, iseq_data_to_ary(rb_iseq_check(entry->iseq)));
+ rb_iseq_t *eiseq;
+ GetISeqPtr(entry->iseq, eiseq);
+ rb_ary_push(ary, iseq_data_to_ary(eiseq));
}
else {
rb_ary_push(ary, Qnil);
@@ -2341,7 +1859,7 @@ iseq_data_to_ary(const 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, UINT2NUM(entry->sp));
+ rb_ary_push(ary, INT2FIX(entry->sp));
rb_ary_push(exception, ary);
}
@@ -2349,54 +1867,31 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
body = rb_ary_new();
ti = 0;
- for (l=0, pos=0; l<RARRAY_LEN(nbody); l++) {
- VALUE ary = RARRAY_AREF(nbody, l);
+ for (i=0, pos=0; i<RARRAY_LEN(nbody); i++) {
+ VALUE ary = RARRAY_AREF(nbody, i);
st_data_t label;
if (st_lookup(labels_table, pos, &label)) {
rb_ary_push(body, (VALUE)label);
}
- if (ti < iseq->body->insns_info_size) {
- const struct iseq_insn_info_entry *info = &iseq->body->insns_info[ti];
- if (info->position == pos) {
- int line = info->line_no;
- rb_event_flag_t events = info->events;
-
- if (line > 0 && last_line != line) {
- rb_ary_push(body, INT2FIX(line));
- last_line = line;
- }
-#define CHECK_EVENT(ev) if (events & ev) rb_ary_push(body, ID2SYM(rb_intern(#ev)));
- CHECK_EVENT(RUBY_EVENT_LINE);
- CHECK_EVENT(RUBY_EVENT_CLASS);
- CHECK_EVENT(RUBY_EVENT_END);
- CHECK_EVENT(RUBY_EVENT_CALL);
- CHECK_EVENT(RUBY_EVENT_RETURN);
- CHECK_EVENT(RUBY_EVENT_B_CALL);
- CHECK_EVENT(RUBY_EVENT_B_RETURN);
-#undef CHECK_EVENT
- ti++;
- }
+ if (ti < iseq->line_info_size && iseq->line_info_table[ti].position == pos) {
+ line = iseq->line_info_table[ti].line_no;
+ rb_ary_push(body, INT2FIX(line));
+ ti++;
}
rb_ary_push(body, ary);
pos += RARRAY_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->body->param.size));
- rb_hash_aset(misc, ID2SYM(rb_intern("local_size")), INT2FIX(iseq->body->local_table_size));
- rb_hash_aset(misc, ID2SYM(rb_intern("stack_max")), INT2FIX(iseq->body->stack_max));
- rb_hash_aset(misc, ID2SYM(rb_intern("code_range")),
- rb_ary_new_from_args(4,
- INT2FIX(iseq->body->location.code_range.first_loc.lineno),
- INT2FIX(iseq->body->location.code_range.first_loc.column),
- INT2FIX(iseq->body->location.code_range.last_loc.lineno),
- INT2FIX(iseq->body->location.code_range.last_loc.column)));
+ 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));
+ /* TODO: compatibility issue */
/*
* [:magic, :major_version, :minor_version, :format_type, :misc,
* :name, :path, :absolute_path, :start_lineno, :type, :locals, :args,
@@ -2407,26 +1902,57 @@ iseq_data_to_ary(const 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->body->location.label);
- rb_ary_push(val, rb_iseq_path(iseq));
- rb_ary_push(val, rb_iseq_realpath(iseq));
- rb_ary_push(val, iseq->body->location.first_lineno);
+ rb_ary_push(val, iseq->location.label);
+ rb_ary_push(val, iseq->location.path);
+ rb_ary_push(val, iseq->location.absolute_path);
+ rb_ary_push(val, iseq->location.first_lineno);
rb_ary_push(val, type);
rb_ary_push(val, locals);
- rb_ary_push(val, params);
+ rb_ary_push(val, args);
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->self, &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->body->param.size);
+ VALUE a, args = rb_ary_new2(iseq->arg_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->body->local_table[(i)]
+#define PARAM_ID(i) iseq->local_table[(i)]
#define PARAM(i, type) ( \
PARAM_TYPE(type), \
rb_id2str(PARAM_ID(i)) ? \
@@ -2436,18 +1962,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->body->param.lead_num; i++) {
+ for (i = 0; i < iseq->argc; 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->body->param.lead_num; i++) {
+ for (i = 0; i < iseq->argc; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- r = iseq->body->param.lead_num + iseq->body->param.opt_num;
+ r = iseq->argc + iseq->arg_opts - 1;
for (; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2str(PARAM_ID(i))) {
@@ -2455,52 +1981,52 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
}
rb_ary_push(args, a);
}
- if (iseq->body->param.flags.has_rest) {
+ if (iseq->arg_rest != -1) {
CONST_ID(rest, "rest");
- rb_ary_push(args, PARAM(iseq->body->param.rest_start, rest));
+ rb_ary_push(args, PARAM(iseq->arg_rest, rest));
}
- r = iseq->body->param.post_start + iseq->body->param.post_num;
+ r = iseq->arg_post_start + iseq->arg_post_len;
if (is_proc) {
- for (i = iseq->body->param.post_start; i < r; i++) {
+ for (i = iseq->arg_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->body->param.post_start; i < r; i++) {
+ for (i = iseq->arg_post_start; i < r; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- if (iseq->body->param.flags.has_kw) {
+ if (iseq->arg_keyword != -1) {
i = 0;
- if (iseq->body->param.keyword->required_num > 0) {
+ if (iseq->arg_keyword_required) {
ID keyreq;
CONST_ID(keyreq, "keyreq");
- for (; i < iseq->body->param.keyword->required_num; i++) {
+ for (; i < iseq->arg_keyword_required; i++) {
PARAM_TYPE(keyreq);
- if (rb_id2str(iseq->body->param.keyword->table[i])) {
- rb_ary_push(a, ID2SYM(iseq->body->param.keyword->table[i]));
+ if (rb_id2str(iseq->arg_keyword_table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->arg_keyword_table[i]));
}
rb_ary_push(args, a);
}
}
CONST_ID(key, "key");
- for (; i < iseq->body->param.keyword->num; i++) {
+ for (; i < iseq->arg_keywords; i++) {
PARAM_TYPE(key);
- if (rb_id2str(iseq->body->param.keyword->table[i])) {
- rb_ary_push(a, ID2SYM(iseq->body->param.keyword->table[i]));
+ if (rb_id2str(iseq->arg_keyword_table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->arg_keyword_table[i]));
}
rb_ary_push(args, a);
}
+ if (!iseq->arg_keyword_check) {
+ CONST_ID(keyrest, "keyrest");
+ rb_ary_push(args, PARAM(iseq->arg_keyword, keyrest));
+ }
}
- 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) {
+ if (iseq->arg_block != -1) {
CONST_ID(block, "block");
- rb_ary_push(args, PARAM(iseq->body->param.block_start, block));
+ rb_ary_push(args, PARAM(iseq->arg_block, block));
}
return args;
}
@@ -2537,7 +2063,7 @@ 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);
@@ -2545,145 +2071,192 @@ rb_iseq_defined_string(enum defined_type type)
return str;
}
+/* ruby2cext */
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
-#define INSN_CODE(insn) ((VALUE)table[insn])
-#define TRACE_INSN_P(insn, insn_encoded) ((VALUE)table[insn] != insn_encoded)
-#else
-#define INSN_CODE(insn) (insn)
-#define TRACE_INSN_P(insn, insn_encoded) ((insn_encoded) >= VM_INSTRUCTION_SIZE/2)
-#endif
-
-void
-rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events)
-{
- VM_ASSERT((turnon_events & ~ISEQ_TRACE_EVENTS) == 0);
+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 = UINT2NUM(first_lineno);
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 0);
+ iseq->self = iseqval;
+
+ iseq->iseq_encoded = ALLOC_N(VALUE, iseq->iseq_size);
+
+ for (i=0; i<iseq->iseq_size; i+=2) {
+ iseq->iseq_encoded[i] = BIN(opt_call_c_function);
+ iseq->iseq_encoded[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);
- if (iseq->aux.trace_events == turnon_events) {
- return;
- }
- if (iseq->flags & ISEQ_USE_COMPILE_DATA) {
- /* this is building ISeq */
- return;
+ /*
+ * FIXME: probably broken, but this function is probably unused
+ * and should be removed
+ */
+ if (iseq->catch_table) {
+ MEMCPY(&iseq->catch_table->entries, catch_table,
+ struct iseq_catch_table_entry, iseq->catch_table->size);
}
- else {
- unsigned int i;
- VALUE *iseq_encoded = (VALUE *)iseq->body->iseq_encoded;
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- VALUE *code = rb_iseq_original_iseq(iseq);
- const void * const *table = rb_vm_get_insns_address_table();
-#else
- const VALUE *code = iseq->body->iseq_encoded;
-#endif
- ((rb_iseq_t *)iseq)->aux.trace_events = turnon_events;
- for (i=0; i<iseq->body->iseq_size;) {
- int insn = (int)code[i];
- rb_event_flag_t events = rb_iseq_event_flags(iseq, i);
+ ALLOC_AND_COPY(iseq->arg_opt_table, arg_opt_table,
+ VALUE, iseq->arg_opts);
- /* code represents before transformation */
- VM_ASSERT(insn < VM_INSTRUCTION_SIZE/2);
+ set_relation(iseq, 0);
- if (events & turnon_events) {
- if (!TRACE_INSN_P(insn, iseq_encoded[i])) {
- iseq_encoded[i] = INSN_CODE(insn + VM_INSTRUCTION_SIZE/2);
+ return iseqval;
+}
+
+/* Experimental tracing support: trace(line) -> trace(specified_line)
+ * MRI Specific.
+ */
+
+int
+rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
+{
+ int trace_num = 0;
+ unsigned int pos;
+ size_t insn;
+ rb_iseq_t *iseq;
+ int cont = 1;
+ VALUE *iseq_original;
+ GetISeqPtr(iseqval, iseq);
+
+ iseq_original = rb_iseq_original_iseq(iseq);
+ for (pos = 0; cont && pos < iseq->iseq_size; pos += insn_len(insn)) {
+ insn = iseq_original[pos];
+
+ if (insn == BIN(trace)) {
+ rb_event_flag_t current_events = (VALUE)iseq_original[pos+1];
+
+ if (current_events & RUBY_EVENT_LINE) {
+ rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
+ trace_num++;
+
+ if (func) {
+ int line = find_line_no(iseq, pos);
+ /* printf("line: %d\n", line); */
+ cont = (*func)(line, &events, data);
+ if (current_events != events) {
+ iseq_original[pos+1] = iseq->iseq_encoded[pos+1] =
+ (VALUE)(current_events | (events & RUBY_EVENT_SPECIFIED_LINE));
+ }
}
}
- else if (TRACE_INSN_P(insn, iseq_encoded[i])) {
- iseq_encoded[i] = INSN_CODE(insn);
- }
- i += insn_len(insn);
}
- /* clear for debugging: ISEQ_ORIGINAL_ISEQ_CLEAR(iseq); */
}
+ return trace_num;
}
static int
-trace_set_i(void *vstart, void *vend, size_t stride, void *data)
+collect_trace(int line, rb_event_flag_t *events_ptr, void *ptr)
{
- rb_event_flag_t turnon_events = *(rb_event_flag_t *)data;
-
- VALUE v = (VALUE)vstart;
- for (; v != (VALUE)vend; v += stride) {
- if (rb_obj_is_iseq(v)) {
- rb_iseq_trace_set(rb_iseq_check((rb_iseq_t *)v), turnon_events);
- }
- }
- return 0;
+ VALUE result = (VALUE)ptr;
+ rb_ary_push(result, INT2NUM(line));
+ return 1;
}
-void
-rb_iseq_trace_set_all(rb_event_flag_t turnon_events)
+/*
+ * <b>Experimental MRI specific feature, only available as C level api.</b>
+ *
+ * Returns all +specified_line+ events.
+ */
+VALUE
+rb_iseq_line_trace_all(VALUE iseqval)
{
- rb_objspace_each_objects(trace_set_i, &turnon_events);
+ VALUE result = rb_ary_new();
+ rb_iseq_line_trace_each(iseqval, collect_trace, (void *)result);
+ return result;
}
-void
-rb_iseq_trace_on_all(void)
-{
- rb_iseq_trace_set_all(RUBY_EVENT_TRACEPOINT_ALL);
-}
+struct set_specifc_data {
+ int pos;
+ int set;
+ int prev; /* 1: set, 2: unset, 0: not found */
+};
-VALUE
-rb_iseqw_local_variables(VALUE iseqval)
+static int
+line_trace_specify(int line, rb_event_flag_t *events_ptr, void *ptr)
{
- return rb_iseq_local_variables(iseqw_check(iseqval));
-}
+ struct set_specifc_data *data = (struct set_specifc_data *)ptr;
-/*
- * 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 rb_iseq_ibf_dump(iseqw_check(self), opt);
+ if (data->pos == 0) {
+ data->prev = *events_ptr & RUBY_EVENT_SPECIFIED_LINE ? 1 : 2;
+ if (data->set) {
+ *events_ptr = *events_ptr | RUBY_EVENT_SPECIFIED_LINE;
+ }
+ else {
+ *events_ptr = *events_ptr & ~RUBY_EVENT_SPECIFIED_LINE;
+ }
+ return 0; /* found */
+ }
+ else {
+ data->pos--;
+ return 1;
+ }
}
/*
- * call-seq:
- * RubyVM::InstructionSequence.load_from_binary(binary) -> iseq
+ * <b>Experimental MRI specific feature, only available as C level api.</b>
*
- * Load an iseq object from binary format String object
- * created by RubyVM::InstructionSequence.to_binary.
+ * Set a +specified_line+ event at the given line position, if the +set+
+ * parameter is +true+.
*
- * This loader does not have a verifier, so that loading broken/modified
- * binary causes critical problem.
+ * This method is useful for building a debugger breakpoint at a specific line.
*
- * 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(rb_iseq_ibf_load(str));
-}
-
-/*
- * call-seq:
- * RubyVM::InstructionSequence.load_from_binary_extra_data(binary) -> str
+ * A TypeError is raised if +set+ is not boolean.
*
- * Load extra data embed into binary format String object.
+ * If +pos+ is a negative integer a TypeError exception is raised.
*/
-static VALUE
-iseqw_s_load_from_binary_extra_data(VALUE self, VALUE str)
+VALUE
+rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set)
{
- return rb_iseq_ibf_load_extra_data(str);
+ struct set_specifc_data data;
+
+ data.prev = 0;
+ data.pos = NUM2INT(pos);
+ if (data.pos < 0) rb_raise(rb_eTypeError, "`pos' is negative");
+
+ switch (set) {
+ case Qtrue: data.set = 1; break;
+ case Qfalse: data.set = 0; break;
+ default:
+ rb_raise(rb_eTypeError, "`set' should be true/false");
+ }
+
+ rb_iseq_line_trace_each(iseqval, line_trace_specify, (void *)&data);
+
+ if (data.prev == 0) {
+ rb_raise(rb_eTypeError, "`pos' is out of range.");
+ }
+ return data.prev == 1 ? Qtrue : Qfalse;
}
/*
@@ -2711,44 +2284,45 @@ Init_ISeq(void)
{
/* declare ::RubyVM::InstructionSequence */
rb_cISeq = rb_define_class_under(rb_cRubyVM, "InstructionSequence", rb_cObject);
- rb_undef_alloc_func(rb_cISeq);
- 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);
-
+ 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);
/* location APIs */
- 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);
- rb_define_method(rb_cISeq, "trace_points", iseqw_trace_points, 0);
- rb_define_method(rb_cISeq, "each_child", iseqw_each_child, 0);
+ 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);
+
+#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);
+#else
+ (void)rb_iseq_line_trace_all;
+ (void)rb_iseq_line_trace_specify;
+#endif
#if 0 /* TBD */
- 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_private_method(rb_cISeq, "marshal_dump", iseq_marshal_dump, 0);
+ rb_define_private_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
#endif
+
+ /* disable this feature because there is no verifier. */
+ /* rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1); */
(void)iseq_s_load;
- 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);
-
- rb_undef_method(CLASS_OF(rb_cISeq), "translate");
- rb_undef_method(CLASS_OF(rb_cISeq), "load_iseq");
+ 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);
}
diff --git a/iseq.h b/iseq.h
index 65cf653e52..bf3a714e9d 100644
--- a/iseq.h
+++ b/iseq.h
@@ -9,211 +9,48 @@
**********************************************************************/
-#ifndef RUBY_ISEQ_H
-#define RUBY_ISEQ_H 1
-
-#include "ruby/version.h"
-
-#define ISEQ_MAJOR_VERSION RUBY_API_VERSION_MAJOR
-#define ISEQ_MINOR_VERSION RUBY_API_VERSION_MINOR
-
-#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,
- ISEQ_MARK_ARY_FLIP_CNT,
- ISEQ_MARK_ARY_ORIGINAL_ISEQ,
- ISEQ_MARK_ARY_INITIAL_SIZE
-};
-
-static inline VALUE
-iseq_mark_ary_create(int flip_cnt)
-{
- VALUE ary = rb_ary_tmp_new(ISEQ_MARK_ARY_INITIAL_SIZE);
- 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_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
-#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
-
-#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 void
-ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq)
-{
- RARRAY_ASET(ISEQ_MARK_ARY(iseq), ISEQ_MARK_ARY_ORIGINAL_ISEQ, Qnil);
-}
-
-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_TRACE_EVENTS (RUBY_EVENT_LINE | \
- RUBY_EVENT_CLASS | \
- RUBY_EVENT_END | \
- RUBY_EVENT_CALL | \
- RUBY_EVENT_RETURN| \
- RUBY_EVENT_B_CALL| \
- RUBY_EVENT_B_RETURN)
-
-#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
-#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
-
-struct iseq_compile_data {
- /* GC is needed */
- const VALUE err_info;
- VALUE mark_ary;
- const VALUE catch_table_ary; /* Array */
-
- /* GC is not needed */
- struct iseq_label_data *start_label;
- struct iseq_label_data *end_label;
- struct iseq_label_data *redo_label;
- const rb_iseq_t *current_block;
- VALUE ensure_node;
- VALUE for_iseq;
- struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
- int loopval_popped; /* used by NODE_BREAK */
- int cached_const;
- struct iseq_compile_data_storage *storage_head;
- struct iseq_compile_data_storage *storage_current;
- int last_line;
- int label_no;
- int node_level;
- unsigned int ci_index;
- unsigned int ci_kw_index;
- const rb_compile_option_t *option;
- struct rb_id_table *ivar_cache_table;
-#if SUPPORT_JOKE
- st_table *labels_table;
-#endif
-};
-
-static inline struct iseq_compile_data *
-ISEQ_COMPILE_DATA(const rb_iseq_t *iseq)
-{
- if (iseq->flags & ISEQ_USE_COMPILE_DATA) {
- return iseq->aux.compile_data;
- }
- else {
- return NULL;
- }
-}
-
-static inline void
-ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq)
-{
- iseq->flags |= ISEQ_USE_COMPILE_DATA;
- iseq->aux.compile_data = ZALLOC(struct iseq_compile_data);
-}
-
-static inline void
-ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq)
-{
- iseq->flags &= ~ISEQ_USE_COMPILE_DATA;
- iseq->aux.compile_data = NULL;
-}
-
-static inline rb_iseq_t *
-iseq_imemo_alloc(void)
-{
- return (rb_iseq_t *)rb_imemo_new(imemo_iseq, 0, 0, 0, 0);
-}
-
-VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
-void rb_ibf_load_iseq_complete(rb_iseq_t *iseq);
-const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
-VALUE rb_iseq_ibf_load_extra_data(VALUE str);
-void rb_iseq_init_trace(rb_iseq_t *iseq);
+#ifndef RUBY_COMPILE_H
+#define RUBY_COMPILE_H
RUBY_SYMBOL_EXPORT_BEGIN
/* compile.c */
-VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node);
+VALUE rb_iseq_compile_node(VALUE self, NODE *node);
int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
-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);
+VALUE *rb_iseq_original_iseq(rb_iseq_t *iseq);
+VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
+ VALUE exception, VALUE body);
/* iseq.c */
-void rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj);
+void rb_iseq_add_mark_object(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);
-void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events);
-void rb_iseq_trace_set_all(rb_event_flag_t turnon_events);
-void rb_iseq_trace_on_all(void);
-VALUE rb_iseqw_new(const rb_iseq_t *iseq);
-const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
-
-VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */
-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);
-void rb_iseq_code_range(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
+int rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data);
+VALUE rb_iseq_line_trace_all(VALUE iseqval);
+VALUE rb_iseq_line_trace_specify(VALUE iseqval, VALUE pos, VALUE set);
/* proc.c */
-const rb_iseq_t *rb_method_iseq(VALUE body);
-const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
+rb_iseq_t *rb_method_get_iseq(VALUE body);
+rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
struct rb_compile_option_struct {
- unsigned int inline_const_cache: 1;
- unsigned int peephole_optimization: 1;
- unsigned int tailcall_optimization: 1;
- unsigned int specialized_instruction: 1;
- unsigned int operands_unification: 1;
- unsigned int instructions_unification: 1;
- unsigned int stack_caching: 1;
- unsigned int frozen_string_literal: 1;
- unsigned int debug_frozen_string_literal: 1;
- unsigned int coverage_enabled: 1;
+ int inline_const_cache;
+ int peephole_optimization;
+ int tailcall_optimization;
+ int specialized_instruction;
+ int operands_unification;
+ int instructions_unification;
+ int stack_caching;
+ int trace_instruction;
int debug_level;
};
-struct iseq_insn_info_entry {
+struct iseq_line_info_entry {
unsigned int position;
- int line_no;
- rb_event_flag_t events;
+ unsigned int line_no;
};
struct iseq_catch_table_entry {
@@ -225,21 +62,7 @@ struct iseq_catch_table_entry {
CATCH_TYPE_REDO = INT2FIX(5),
CATCH_TYPE_NEXT = INT2FIX(6)
} type;
-
- /*
- * iseq type:
- * CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE:
- * use iseq as continuation.
- *
- * CATCH_TYPE_BREAK (iter):
- * use iseq as key.
- *
- * CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY,
- * CATCH_TYPE_REDO, CATCH_TYPE_NEXT:
- * NULL.
- */
- const rb_iseq_t *iseq;
-
+ VALUE iseq;
unsigned int start;
unsigned int end;
unsigned int cont;
@@ -247,7 +70,7 @@ struct iseq_catch_table_entry {
};
PACKED_STRUCT_UNALIGNED(struct iseq_catch_table {
- unsigned int size;
+ int size;
struct iseq_catch_table_entry entries[1]; /* flexible array */
});
@@ -275,6 +98,34 @@ struct iseq_compile_data_storage {
#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE \
(sizeof(struct iseq_compile_data_storage) - 1)
+struct iseq_compile_data {
+ /* GC is needed */
+ const VALUE err_info;
+ VALUE mark_ary;
+ const VALUE catch_table_ary; /* Array */
+
+ /* GC is not needed */
+ struct iseq_label_data *start_label;
+ struct iseq_label_data *end_label;
+ struct iseq_label_data *redo_label;
+ VALUE current_block;
+ VALUE ensure_node;
+ VALUE for_iseq;
+ struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
+ int loopval_popped; /* used by NODE_BREAK */
+ int cached_const;
+ struct iseq_compile_data_storage *storage_head;
+ struct iseq_compile_data_storage *storage_current;
+ int last_line;
+ int last_coverable_line;
+ int label_no;
+ int node_level;
+ const rb_compile_option_t *option;
+#if SUPPORT_JOKE
+ st_table *labels_table;
+#endif
+};
+
/* defined? */
enum defined_type {
@@ -298,11 +149,9 @@ 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);
-/* vm.c */
-VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
+#define DEFAULT_SPECIAL_VAR_COUNT 2
RUBY_SYMBOL_EXPORT_END
-#endif /* RUBY_ISEQ_H */
+#endif /* RUBY_COMPILE_H */
diff --git a/lex.c.blt b/lex.c.blt
index d93a0b84b5..1ae80990b9 100644
--- a/lex.c.blt
+++ b/lex.c.blt
@@ -1,5 +1,5 @@
-/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' defs/keywords */
+/* 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 */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -25,16 +25,15 @@
&& ('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-gperf@gnu.org>."
+error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#define gperf_offsetof(s, n) (short)offsetof(struct s##_t, s##_str##n)
#line 1 "defs/keywords"
-struct kwtable {int name, id[2], state;};
+struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER
-static const struct kwtable *reserved_word(/*const char *, unsigned int*/);
+static const struct kwtable *reserved_word(const char *, unsigned int);
#define rb_reserved_word(str, len) reserved_word(str, len)
#line 9 "defs/keywords"
struct kwtable;
@@ -54,7 +53,9 @@ inline
#endif
#endif
static unsigned int
-hash (register const char *str, register size_t len)
+hash (str, len)
+ register const char *str;
+ register unsigned int len;
{
static const unsigned char asso_values[] =
{
@@ -85,7 +86,7 @@ hash (register const char *str, register size_t len)
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51
};
- register unsigned int hval = (unsigned int)len;
+ register int hval = len;
switch (hval)
{
@@ -97,203 +98,118 @@ hash (register const char *str, register size_t len)
hval += asso_values[(unsigned char)str[0]];
break;
}
- return (unsigned int)hval + asso_values[(unsigned char)str[len - 1]];
+ 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__
+__attribute__ ((__gnu_inline__))
+#endif
+#endif
const struct kwtable *
-rb_reserved_word (register const char *str, register size_t len)
+rb_reserved_word (str, len)
+ register const char *str;
+ register unsigned int len;
{
static const struct kwtable wordlist[] =
{
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 19 "defs/keywords"
- {gperf_offsetof(stringpool, 8), {keyword_break, keyword_break}, EXPR_MID},
+ {"break", {keyword_break, keyword_break}, EXPR_MID},
#line 25 "defs/keywords"
- {gperf_offsetof(stringpool, 9), {keyword_else, keyword_else}, EXPR_BEG},
+ {"else", {keyword_else, keyword_else}, EXPR_BEG},
#line 35 "defs/keywords"
- {gperf_offsetof(stringpool, 10), {keyword_nil, keyword_nil}, EXPR_END},
+ {"nil", {keyword_nil, keyword_nil}, EXPR_END},
#line 28 "defs/keywords"
- {gperf_offsetof(stringpool, 11), {keyword_ensure, keyword_ensure}, EXPR_BEG},
+ {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
#line 27 "defs/keywords"
- {gperf_offsetof(stringpool, 12), {keyword_end, keyword_end}, EXPR_END},
+ {"end", {keyword_end, keyword_end}, EXPR_END},
#line 44 "defs/keywords"
- {gperf_offsetof(stringpool, 13), {keyword_then, keyword_then}, EXPR_BEG},
+ {"then", {keyword_then, keyword_then}, EXPR_BEG},
#line 36 "defs/keywords"
- {gperf_offsetof(stringpool, 14), {keyword_not, keyword_not}, EXPR_ARG},
+ {"not", {keyword_not, keyword_not}, EXPR_ARG},
#line 29 "defs/keywords"
- {gperf_offsetof(stringpool, 15), {keyword_false, keyword_false}, EXPR_END},
+ {"false", {keyword_false, keyword_false}, EXPR_END},
#line 42 "defs/keywords"
- {gperf_offsetof(stringpool, 16), {keyword_self, keyword_self}, EXPR_END},
+ {"self", {keyword_self, keyword_self}, EXPR_END},
#line 26 "defs/keywords"
- {gperf_offsetof(stringpool, 17), {keyword_elsif, keyword_elsif}, EXPR_VALUE},
+ {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
#line 39 "defs/keywords"
- {gperf_offsetof(stringpool, 18), {keyword_rescue, modifier_rescue}, EXPR_MID},
+ {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
#line 45 "defs/keywords"
- {gperf_offsetof(stringpool, 19), {keyword_true, keyword_true}, EXPR_END},
+ {"true", {keyword_true, keyword_true}, EXPR_END},
#line 48 "defs/keywords"
- {gperf_offsetof(stringpool, 20), {keyword_until, modifier_until}, EXPR_VALUE},
+ {"until", {keyword_until, modifier_until}, EXPR_VALUE},
#line 47 "defs/keywords"
- {gperf_offsetof(stringpool, 21), {keyword_unless, modifier_unless}, EXPR_VALUE},
+ {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
#line 41 "defs/keywords"
- {gperf_offsetof(stringpool, 22), {keyword_return, keyword_return}, EXPR_MID},
+ {"return", {keyword_return, keyword_return}, EXPR_MID},
#line 22 "defs/keywords"
- {gperf_offsetof(stringpool, 23), {keyword_def, keyword_def}, EXPR_FNAME},
+ {"def", {keyword_def, keyword_def}, EXPR_FNAME},
#line 17 "defs/keywords"
- {gperf_offsetof(stringpool, 24), {keyword_and, keyword_and}, EXPR_VALUE},
+ {"and", {keyword_and, keyword_and}, EXPR_VALUE},
#line 24 "defs/keywords"
- {gperf_offsetof(stringpool, 25), {keyword_do, keyword_do}, EXPR_BEG},
+ {"do", {keyword_do, keyword_do}, EXPR_BEG},
#line 51 "defs/keywords"
- {gperf_offsetof(stringpool, 26), {keyword_yield, keyword_yield}, EXPR_ARG},
+ {"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
#line 30 "defs/keywords"
- {gperf_offsetof(stringpool, 27), {keyword_for, keyword_for}, EXPR_VALUE},
+ {"for", {keyword_for, keyword_for}, EXPR_VALUE},
#line 46 "defs/keywords"
- {gperf_offsetof(stringpool, 28), {keyword_undef, keyword_undef}, EXPR_FNAME|EXPR_FITEM},
+ {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
#line 37 "defs/keywords"
- {gperf_offsetof(stringpool, 29), {keyword_or, keyword_or}, EXPR_VALUE},
+ {"or", {keyword_or, keyword_or}, EXPR_VALUE},
#line 32 "defs/keywords"
- {gperf_offsetof(stringpool, 30), {keyword_in, keyword_in}, EXPR_VALUE},
+ {"in", {keyword_in, keyword_in}, EXPR_VALUE},
#line 49 "defs/keywords"
- {gperf_offsetof(stringpool, 31), {keyword_when, keyword_when}, EXPR_VALUE},
+ {"when", {keyword_when, keyword_when}, EXPR_VALUE},
#line 40 "defs/keywords"
- {gperf_offsetof(stringpool, 32), {keyword_retry, keyword_retry}, EXPR_END},
+ {"retry", {keyword_retry, keyword_retry}, EXPR_END},
#line 31 "defs/keywords"
- {gperf_offsetof(stringpool, 33), {keyword_if, modifier_if}, EXPR_VALUE},
+ {"if", {keyword_if, modifier_if}, EXPR_VALUE},
#line 20 "defs/keywords"
- {gperf_offsetof(stringpool, 34), {keyword_case, keyword_case}, EXPR_VALUE},
+ {"case", {keyword_case, keyword_case}, EXPR_VALUE},
#line 38 "defs/keywords"
- {gperf_offsetof(stringpool, 35), {keyword_redo, keyword_redo}, EXPR_END},
+ {"redo", {keyword_redo, keyword_redo}, EXPR_END},
#line 34 "defs/keywords"
- {gperf_offsetof(stringpool, 36), {keyword_next, keyword_next}, EXPR_MID},
+ {"next", {keyword_next, keyword_next}, EXPR_MID},
#line 43 "defs/keywords"
- {gperf_offsetof(stringpool, 37), {keyword_super, keyword_super}, EXPR_ARG},
+ {"super", {keyword_super, keyword_super}, EXPR_ARG},
#line 33 "defs/keywords"
- {gperf_offsetof(stringpool, 38), {keyword_module, keyword_module}, EXPR_VALUE},
+ {"module", {keyword_module, keyword_module}, EXPR_VALUE},
#line 18 "defs/keywords"
- {gperf_offsetof(stringpool, 39), {keyword_begin, keyword_begin}, EXPR_BEG},
+ {"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
#line 12 "defs/keywords"
- {gperf_offsetof(stringpool, 40), {keyword__LINE__, keyword__LINE__}, EXPR_END},
+ {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
#line 13 "defs/keywords"
- {gperf_offsetof(stringpool, 41), {keyword__FILE__, keyword__FILE__}, EXPR_END},
+ {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
#line 11 "defs/keywords"
- {gperf_offsetof(stringpool, 42), {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
+ {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
#line 15 "defs/keywords"
- {gperf_offsetof(stringpool, 43), {keyword_END, keyword_END}, EXPR_END},
+ {"END", {keyword_END, keyword_END}, EXPR_END},
#line 16 "defs/keywords"
- {gperf_offsetof(stringpool, 44), {keyword_alias, keyword_alias}, EXPR_FNAME|EXPR_FITEM},
+ {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
#line 14 "defs/keywords"
- {gperf_offsetof(stringpool, 45), {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
+ {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
#line 23 "defs/keywords"
- {gperf_offsetof(stringpool, 46), {keyword_defined, keyword_defined}, EXPR_ARG},
+ {"defined?", {keyword_defined, keyword_defined}, EXPR_ARG},
#line 21 "defs/keywords"
- {gperf_offsetof(stringpool, 47), {keyword_class, keyword_class}, EXPR_CLASS},
- {-1}, {-1},
+ {"class", {keyword_class, keyword_class}, EXPR_CLASS},
+ {""}, {""},
#line 50 "defs/keywords"
- {gperf_offsetof(stringpool, 50), {keyword_while, modifier_while}, EXPR_VALUE}
+ {"while", {keyword_while, modifier_while}, EXPR_VALUE}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register unsigned int key = hash (str, len);
+ register int key = hash (str, len);
- if (key <= MAX_HASH_VALUE)
+ if (key <= MAX_HASH_VALUE && key >= 0)
{
- register int o = wordlist[key].name;
- if (o >= 0)
- {
- register const char *s = o + stringpool;
+ register const char *s = wordlist[key].name;
- 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/.document b/lib/.document
deleted file mode 100644
index 225feca10c..0000000000
--- a/lib/.document
+++ /dev/null
@@ -1,24 +0,0 @@
-# Add files to this as they become documented
-
-*.rb
-
-bundler
-cgi
-drb
-forwardable
-irb
-matrix
-net
-optparse
-racc
-rdoc
-rexml
-rinda
-rss
-rubygems
-scanf.rb
-shell
-unicode_normalize
-uri
-webrick
-yaml
diff --git a/lib/English.rb b/lib/English.rb
index a4f5bb6620..838e5afc74 100644
--- a/lib/English.rb
+++ b/lib/English.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# 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}.
@@ -153,7 +152,9 @@ alias $CHILD_STATUS $?
# scope.
alias $LAST_MATCH_INFO $~
-# This variable is no longer effective. Deprecated.
+# If set to any value apart from +nil+ or +false+, all pattern matches
+# will be case insensitive, string comparisons will ignore case, and
+# string hash values will be case insensitive. Deprecated
alias $IGNORECASE $=
# An array of strings containing the command-line
diff --git a/lib/abbrev.rb b/lib/abbrev.rb
index 2af01d2eae..2c07fb5cf9 100644
--- a/lib/abbrev.rb
+++ b/lib/abbrev.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright (c) 2001,2003 Akinori MUSHA <knu@iDaemons.org>
#
diff --git a/lib/base64.rb b/lib/base64.rb
index 24f0b02966..98829f0d96 100644
--- a/lib/base64.rb
+++ b/lib/base64.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = base64.rb: methods for base64-encoding and -decoding strings
#
@@ -56,7 +55,7 @@ module Base64
# This is line three
# And so on...
def decode64(str)
- str.unpack1("m")
+ str.unpack("m").first
end
# Returns the Base64-encoded version of +bin+.
@@ -71,37 +70,22 @@ module Base64
# ArgumentError is raised if +str+ is incorrectly padded or contains
# non-alphabet characters. Note that CR or LF are also rejected.
def strict_decode64(str)
- str.unpack1("m0")
+ str.unpack("m0").first
end
# Returns the Base64-encoded version of +bin+.
# This method complies with ``Base 64 Encoding with URL and Filename Safe
# Alphabet'' in RFC 4648.
# The alphabet uses '-' instead of '+' and '_' instead of '/'.
- # 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
+ def urlsafe_encode64(bin)
+ strict_encode64(bin).tr("+/", "-_")
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)
- # 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)
+ strict_decode64(str.tr("-_", "+/"))
end
end
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 8d768b631e..690dff1c28 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# benchmark.rb - a performance benchmarking library
#
@@ -26,7 +25,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)
#
@@ -132,7 +131,7 @@ module Benchmark
#
# If the block returns an array of
# Benchmark::Tms objects, these will be used to format
- # additional lines of output. If +labels+ parameter are
+ # additional lines of output. If +label+ parameters are
# given, these are used to label these extra lines.
#
# _Note_: Other methods provide a simpler interface to this one, and are
@@ -181,8 +180,8 @@ module Benchmark
# A simple interface to the #benchmark method, #bm generates sequential
- # reports with labels. +label_width+ and +labels+ parameters have the same
- # meaning as for #benchmark.
+ # reports with labels. The parameters have the same meaning as for
+ # #benchmark.
#
# require 'benchmark'
#
@@ -271,27 +270,23 @@ module Benchmark
STDOUT.sync = sync unless sync.nil?
end
+ # :stopdoc:
+ case
+ when defined?(Process::CLOCK_MONOTONIC)
+ BENCHMARK_CLOCK = Process::CLOCK_MONOTONIC
+ else
+ BENCHMARK_CLOCK = Process::CLOCK_REALTIME
+ end
+ # :startdoc:
+
#
# Returns the time used to execute the given block as a
- # 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)
+ # Benchmark::Tms object.
#
def measure(label = "") # :yield:
- t0, r0 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ t0, r0 = Process.times, Process.clock_gettime(BENCHMARK_CLOCK)
yield
- t1, r1 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ t1, r1 = Process.times, Process.clock_gettime(BENCHMARK_CLOCK)
Benchmark::Tms.new(t1.utime - t0.utime,
t1.stime - t0.stime,
t1.cutime - t0.cutime,
@@ -304,9 +299,9 @@ module Benchmark
# Returns the elapsed real time used to execute the given block.
#
def realtime # :yield:
- r0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ r0 = Process.clock_gettime(BENCHMARK_CLOCK)
yield
- Process.clock_gettime(Process::CLOCK_MONOTONIC) - r0
+ Process.clock_gettime(BENCHMARK_CLOCK) - r0
end
module_function :benchmark, :measure, :realtime, :bm, :bmbm
@@ -480,7 +475,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:
#
@@ -492,7 +487,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)
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 0f44a929e4..ae73fe37f6 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# cgi.rb - cgi support library
#
@@ -81,7 +80,7 @@
#
# For instance, suppose the request contains the parameter
# "favourite_colours" with the multiple values "blue" and "green". The
-# following behavior would occur:
+# following behaviour 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 a2155edb77..3ec884dffb 100644
--- a/lib/cgi/cookie.rb
+++ b/lib/cgi/cookie.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'cgi/util'
class CGI
# Class representing an HTTP cookie.
@@ -11,32 +10,29 @@ 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
- # 'httponly' => true # optional
+ # cookie1 = CGI::Cookie.new('name' => 'name',
+ # 'value' => ['value1', 'value2', ...],
+ # 'path' => 'path', # optional
+ # 'domain' => 'domain', # optional
+ # 'expires' => Time.now, # optional
+ # 'secure' => 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
- # httponly = cookie1.httponly
+ # name = cookie1.name
+ # values = cookie1.value
+ # path = cookie1.path
+ # domain = cookie1.domain
+ # expires = cookie1.expires
+ # secure = cookie1.secure
#
- # cookie1.name = 'name'
- # cookie1.value = ['value1', 'value2', ...]
- # cookie1.path = 'path'
- # cookie1.domain = 'domain'
- # cookie1.expires = Time.now + 30
- # cookie1.secure = true
- # cookie1.httponly = true
+ # cookie1.name = 'name'
+ # cookie1.value = ['value1', 'value2', ...]
+ # cookie1.path = 'path'
+ # cookie1.domain = 'domain'
+ # cookie1.expires = Time.now + 30
+ # cookie1.secure = true
class Cookie < Array
@@accept_charset="UTF-8" unless defined?(@@accept_charset)
@@ -64,8 +60,6 @@ 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)
@@ -76,7 +70,6 @@ class CGI
%r|^(.*/)|.match(ENV["SCRIPT_NAME"])
@path = ($1 or "")
@secure = false
- @httponly = false
return super(value)
end
@@ -96,8 +89,7 @@ class CGI
end
@domain = options["domain"]
@expires = options["expires"]
- @secure = options["secure"] == true
- @httponly = options["httponly"] == true
+ @secure = options["secure"] == true ? true : false
super(value)
end
@@ -111,9 +103,7 @@ 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
- # True if this cookie is httponly; false otherwise
- attr_reader :httponly
+ attr_reader("secure")
# Returns the value or list of values for this cookie.
def value
@@ -133,22 +123,14 @@ 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("&")
- buf = "#{@name}=#{val}".dup
+ buf = "#{@name}=#{val}"
buf << "; domain=#{@domain}" if @domain
buf << "; path=#{@path}" if @path
buf << "; expires=#{CGI::rfc1123_date(@expires)}" if @expires
- buf << "; secure" if @secure
- buf << "; HttpOnly" if @httponly
+ buf << "; secure" if @secure == true
buf
end
@@ -162,7 +144,7 @@ class CGI
cookies = Hash.new([])
return cookies unless raw_cookie
- raw_cookie.split(/;\s?/).each do |pairs|
+ raw_cookie.split(/[;,]\s?/).each do |pairs|
name, values = pairs.split('=',2)
next unless name and values
name = CGI.unescape(name)
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb
index 73daae3e17..b81f915379 100644
--- a/lib/cgi/core.rb
+++ b/lib/cgi/core.rb
@@ -1,16 +1,8 @@
-# frozen_string_literal: true
#--
# Methods for generating HTML, parsing CGI-related parameters, and
# generating HTTP responses.
#++
class CGI
- unless const_defined?(:Util)
- module Util
- @@accept_charset = "UTF-8" # :nodoc:
- end
- include Util
- extend Util
- end
$CGI_ENV = ENV # for FCGI support
@@ -153,7 +145,7 @@ class CGI
# "language" => "ja",
# "expires" => Time.now + 30,
# "cookie" => [cookie1, cookie2],
- # "my_header1" => "my_value",
+ # "my_header1" => "my_value"
# "my_header2" => "my_value")
#
# This method does not perform charset conversion.
@@ -189,7 +181,7 @@ class CGI
alias :header :http_header
def _header_for_string(content_type) #:nodoc:
- buf = ''.dup
+ buf = ''
if nph?()
buf << "#{$CGI_ENV['SERVER_PROTOCOL'] || 'HTTP/1.0'} 200 OK#{EOL}"
buf << "Date: #{CGI.rfc1123_date(Time.now)}#{EOL}"
@@ -205,7 +197,7 @@ class CGI
private :_header_for_string
def _header_for_hash(options) #:nodoc:
- buf = ''.dup
+ buf = ''
## add charset to option['type']
options['type'] ||= 'text/html'
charset = options.delete('charset')
@@ -267,7 +259,7 @@ class CGI
def _header_for_modruby(buf) #:nodoc:
request = Apache::request
buf.scan(/([^:]+): (.+)#{EOL}/o) do |name, value|
- $stderr.printf("name:%s value:%s\n", name, value) if $DEBUG
+ warn sprintf("name:%s value:%s\n", name, value) if $DEBUG
case name
when 'Set-Cookie'
request.headers_out.add(name, value)
@@ -487,7 +479,7 @@ class CGI
@files = {}
boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/
boundary_size = "#{EOL}--#{boundary}#{EOL}".bytesize
- buf = ''.dup
+ buf = ''
bufsize = 10 * 1024
max_count = MAX_MULTIPART_COUNT
n = 0
@@ -542,12 +534,12 @@ class CGI
body.rewind
## original filename
/Content-Disposition:.* filename=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
- filename = $1 || $2 || ''.dup
+ filename = $1 || $2 || ''
filename = CGI.unescape(filename) if unescape_filename?()
body.instance_variable_set(:@original_filename, filename.taint)
## content type
/Content-Type: (.*)/i.match(head)
- (content_type = $1 || ''.dup).chomp!
+ (content_type = $1 || '').chomp!
body.instance_variable_set(:@content_type, content_type.taint)
## query parameter name
/Content-Disposition:.* name=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
@@ -596,7 +588,7 @@ class CGI
else
begin
require 'stringio'
- body = StringIO.new("".b)
+ body = StringIO.new("".force_encoding(Encoding::ASCII_8BIT))
rescue LoadError
require 'tempfile'
body = Tempfile.new('CGI', encoding: Encoding::ASCII_8BIT)
@@ -707,7 +699,7 @@ class CGI
if value
return value
elsif defined? StringIO
- StringIO.new("".b)
+ StringIO.new("".force_encoding(Encoding::ASCII_8BIT))
else
Tempfile.new("CGI",encoding: Encoding::ASCII_8BIT)
end
@@ -741,7 +733,7 @@ class CGI
#
# CGI.accept_charset = "EUC-JP"
#
- @@accept_charset="UTF-8" if false # needed for rdoc?
+ @@accept_charset="UTF-8"
# Return the accept character set for all new CGI instances.
def self.accept_charset
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index 02d847ebd3..db47bb8266 100644
--- a/lib/cgi/html.rb
+++ b/lib/cgi/html.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class CGI
# Base module for HTML-generation mixins.
#
@@ -26,7 +25,7 @@ class CGI
# - O EMPTY
def nOE_element(element, attributes = {})
attributes={attributes=>nil} if attributes.kind_of?(String)
- s = "<#{element.upcase}".dup
+ s = "<#{element.upcase}"
attributes.each do|name, value|
next unless value
s << " "
@@ -408,7 +407,7 @@ class CGI
end
pretty = attributes.delete("PRETTY")
pretty = " " if true == pretty
- buf = "".dup
+ buf = ""
if attributes.has_key?("DOCTYPE")
if attributes["DOCTYPE"]
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index fbb42986a4..63c5003526 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# cgi/session.rb - session support for cgi scripts
#
@@ -164,26 +163,24 @@ class CGI
# Create a new session id.
#
- # 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.
+ # 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.
def create_new_id
require 'securerandom'
begin
- # by OpenSSL, or system provided entropy pool
session_id = SecureRandom.hex(16)
rescue NotImplementedError
- # never happens on modern systems
- require 'digest'
- d = Digest('SHA512').new
+ require 'digest/md5'
+ md5 = Digest::MD5::new
now = Time::now
- 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]
+ 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
end
session_id
end
@@ -426,7 +423,7 @@ class CGI
f.close
File.rename @path+".new", @path
ensure
- f.close if f
+ f.close if f and !f.closed?
lockf.close if lockf
end
end
diff --git a/lib/cgi/session/pstore.rb b/lib/cgi/session/pstore.rb
index cb0370b619..75343149e1 100644
--- a/lib/cgi/session/pstore.rb
+++ b/lib/cgi/session/pstore.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# cgi/session/pstore.rb - persistent storage of marshalled session data
#
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index 464115262f..3d7db8f2c8 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -1,9 +1,4 @@
-# frozen_string_literal: true
-class CGI
- module Util; end
- include Util
- extend Util
-end
+class CGI; module Util; end; extend Util; end
module CGI::Util
@@accept_charset="UTF-8" unless defined?(@@accept_charset)
# URL-encode a string.
@@ -11,7 +6,7 @@ module CGI::Util
# # => "%27Stop%21%27+said+Fred"
def escape(string)
encoding = string.encoding
- string.b.gsub(/([^ a-zA-Z0-9_.\-~]+)/) do |m|
+ string.b.gsub(/([^ a-zA-Z0-9_.-]+)/) do |m|
'%' + m.unpack('H2' * m.bytesize).join('%').upcase
end.tr(' ', '+').force_encoding(encoding)
end
@@ -35,42 +30,21 @@ module CGI::Util
'>' => '&gt;',
}
- # Escape special characters in HTML, namely '&\"<>
+ # Escape special characters in HTML, namely &\"<>
# CGI::escapeHTML('Usage: foo "bar" <baz>')
# # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
def escapeHTML(string)
- enc = string.encoding
- unless enc.ascii_compatible?
- if enc.dummy?
- origenc = enc
- enc = Encoding::Converter.asciicompat_encoding(enc)
- string = enc ? string.encode(enc) : string.b
- end
- table = Hash[TABLE_FOR_ESCAPE_HTML__.map {|pair|pair.map {|s|s.encode(enc)}}]
- string = string.gsub(/#{"['&\"<>]".encode(enc)}/, table)
- string.encode!(origenc) if origenc
- return string
- end
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>"
def unescapeHTML(string)
+ return string unless string.include? '&'
enc = string.encoding
- unless enc.ascii_compatible?
- if enc.dummy?
- origenc = enc
- enc = Encoding::Converter.asciicompat_encoding(enc)
- string = enc ? string.encode(enc) : string.b
- end
- string = string.gsub(Regexp.new('&(apos|amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
+ if enc != Encoding::UTF_8 && [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE].include?(enc)
+ return string.gsub(Regexp.new('&(apos|amp|quot|gt|lt|#[0-9]+|#x[0-9A-Fa-f]+);'.encode(enc))) do
case $1.encode(Encoding::US_ASCII)
when 'apos' then "'".encode(enc)
when 'amp' then '&'.encode(enc)
@@ -81,15 +55,8 @@ module CGI::Util
when /\A#x([0-9a-f]+)\z/i then $1.hex.chr(enc)
end
end
- string.encode!(origenc) if origenc
- return string
end
- return string unless string.include? '&'
- charlimit = case enc
- when Encoding::UTF_8; 0x10ffff
- when Encoding::ISO_8859_1; 256
- else 128
- end
+ asciicompat = Encoding.compatible?(string, "a")
string.gsub(/&(apos|amp|quot|gt|lt|\#[0-9]+|\#[xX][0-9A-Fa-f]+);/) do
match = $1.dup
case match
@@ -100,14 +67,18 @@ module CGI::Util
when 'lt' then '<'
when /\A#0*(\d+)\z/
n = $1.to_i
- if n < charlimit
+ if enc == Encoding::UTF_8 or
+ enc == Encoding::ISO_8859_1 && n < 256 or
+ asciicompat && n < 128
n.chr(enc)
else
"&##{$1};"
end
when /\A#x([0-9a-f]+)\z/i
n = $1.hex
- if n < charlimit
+ if enc == Encoding::UTF_8 or
+ enc == Encoding::ISO_8859_1 && n < 256 or
+ asciicompat && n < 128
n.chr(enc)
else
"&#x#{$1};"
diff --git a/lib/cmath.gemspec b/lib/cmath.gemspec
deleted file mode 100644
index 90a87a8ce4..0000000000
--- a/lib/cmath.gemspec
+++ /dev/null
@@ -1,24 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "cmath"
- spec.version = "1.0.0"
- spec.date = '2017-12-11'
- spec.authors = ["Tadayoshi Funaba"]
- spec.email = [nil]
-
- spec.summary = "Provides Trigonometric and Transcendental functions for complex numbers"
- spec.description = "CMath is a library that provides trigonometric and transcendental functions for complex numbers. The functions in this module accept integers, floating-point numbers or complex numbers as arguments."
- spec.homepage = "https://github.com/ruby/cmath"
- spec.license = "BSD-2-Clause"
-
- spec.files = "lib/cmath.rb"
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
-end
diff --git a/lib/cmath.rb b/lib/cmath.rb
index 7dbd65e799..aee577c97c 100644
--- a/lib/cmath.rb
+++ b/lib/cmath.rb
@@ -1,72 +1,60 @@
-# frozen_string_literal: true
##
-# = Trigonometric and transcendental functions for complex numbers.
-#
# CMath is a library that provides trigonometric and transcendental
-# functions for complex numbers. The functions in this module accept
-# integers, floating-point numbers or complex numbers as arguments.
-#
-# 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.
-#
-# For more information you can see Complex class.
+# functions for complex numbers.
#
# == Usage
#
-# To start using this library, simply require cmath library:
+# To start using this library, simply:
#
# require "cmath"
+#
+# Square root of a negative number is a complex number.
+#
+# CMath.sqrt(-9) #=> 0+3.0i
+#
module CMath
include Math
- # 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}", uplevel: 1) if $VERBOSE
- RealMath.send(meth, *args, &block)
- end
- end
+ 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
##
# Math::E raised to the +z+ power
#
- # CMath.exp(1.i * Math::PI) #=> (-1.0+1.2246467991473532e-16i)
+ # 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
def exp(z)
begin
if z.real?
- RealMath.exp(z)
+ exp!(z)
else
- ere = RealMath.exp(z.real)
- Complex(ere * RealMath.cos(z.imag),
- ere * RealMath.sin(z.imag))
+ ere = exp!(z.real)
+ Complex(ere * cos!(z.imag),
+ ere * sin!(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -74,17 +62,24 @@ 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.
#
- # CMath.log(1 + 4i) #=> (1.416606672028108+1.3258176636680326i)
- # CMath.log(1 + 4i, 10) #=> (0.6152244606891369+0.5757952953408879i)
- def log(z, b=::Math::E)
+ # log(Complex(0,0)) #=> -Infinity+0.0i
+ def log(*args)
begin
- if z.real? && z >= 0 && b >= 0
- RealMath.log(z, b)
+ 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)
else
- Complex(RealMath.log(z.abs), z.arg) / log(b)
+ a = Complex(log!(z.abs), z.arg)
+ if b
+ a /= log(b)
+ end
+ a
end
rescue NoMethodError
handle_no_method_error
@@ -92,15 +87,13 @@ module CMath
end
##
- # Returns the base 2 logarithm of +z+
- #
- # CMath.log2(-1) => (0.0+4.532360141827194i)
+ # returns the base 2 logarithm of +z+
def log2(z)
begin
if z.real? and z >= 0
- RealMath.log2(z)
+ log2!(z)
else
- log(z) / RealMath.log(2)
+ log(z) / log!(2)
end
rescue NoMethodError
handle_no_method_error
@@ -108,15 +101,13 @@ module CMath
end
##
- # Returns the base 10 logarithm of +z+
- #
- # CMath.log10(-1) #=> (0.0+1.3643763538418412i)
+ # returns the base 10 logarithm of +z+
def log10(z)
begin
if z.real? and z >= 0
- RealMath.log10(z)
+ log10!(z)
else
- log(z) / RealMath.log(10)
+ log(z) / log!(10)
end
rescue NoMethodError
handle_no_method_error
@@ -125,15 +116,16 @@ module CMath
##
# Returns the non-negative square root of Complex.
- #
- # CMath.sqrt(-1 + 0i) #=> 0.0+1.0i
+ # sqrt(-1) #=> 0+1.0i
+ # sqrt(Complex(-1,0)) #=> 0.0+1.0i
+ # sqrt(Complex(0,8)) #=> 2.0+2.0i
def sqrt(z)
begin
if z.real?
if z < 0
- Complex(0, RealMath.sqrt(-z))
+ Complex(0, sqrt!(-z))
else
- RealMath.sqrt(z)
+ sqrt!(z)
end
else
if z.imag < 0 ||
@@ -142,7 +134,7 @@ module CMath
else
r = z.abs
x = z.real
- Complex(RealMath.sqrt((r + x) / 2.0), RealMath.sqrt((r - x) / 2.0))
+ Complex(sqrt!((r + x) / 2.0), sqrt!((r - x) / 2.0))
end
end
rescue NoMethodError
@@ -151,24 +143,20 @@ module CMath
end
##
- # Returns the principal value of the cube root of +z+
- #
- # CMath.cbrt(1 + 4i) #=> (1.449461632813119+0.6858152562177092i)
+ # returns the principal value of the cube root of +z+
def cbrt(z)
z ** (1.0/3)
end
##
- # Returns the sine of +z+, where +z+ is given in radians
- #
- # CMath.sin(1 + 1i) #=> (1.2984575814159773+0.6349639147847361i)
+ # returns the sine of +z+, where +z+ is given in radians
def sin(z)
begin
if z.real?
- RealMath.sin(z)
+ sin!(z)
else
- Complex(RealMath.sin(z.real) * RealMath.cosh(z.imag),
- RealMath.cos(z.real) * RealMath.sinh(z.imag))
+ Complex(sin!(z.real) * cosh!(z.imag),
+ cos!(z.real) * sinh!(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -176,16 +164,14 @@ module CMath
end
##
- # Returns the cosine of +z+, where +z+ is given in radians
- #
- # CMath.cos(1 + 1i) #=> (0.8337300251311491-0.9888977057628651i)
+ # returns the cosine of +z+, where +z+ is given in radians
def cos(z)
begin
if z.real?
- RealMath.cos(z)
+ cos!(z)
else
- Complex(RealMath.cos(z.real) * RealMath.cosh(z.imag),
- -RealMath.sin(z.real) * RealMath.sinh(z.imag))
+ Complex(cos!(z.real) * cosh!(z.imag),
+ -sin!(z.real) * sinh!(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -193,13 +179,11 @@ module CMath
end
##
- # Returns the tangent of +z+, where +z+ is given in radians
- #
- # CMath.tan(1 + 1i) #=> (0.27175258531951174+1.0839233273386943i)
+ # returns the tangent of +z+, where +z+ is given in radians
def tan(z)
begin
if z.real?
- RealMath.tan(z)
+ tan!(z)
else
sin(z) / cos(z)
end
@@ -209,16 +193,14 @@ module CMath
end
##
- # Returns the hyperbolic sine of +z+, where +z+ is given in radians
- #
- # CMath.sinh(1 + 1i) #=> (0.6349639147847361+1.2984575814159773i)
+ # returns the hyperbolic sine of +z+, where +z+ is given in radians
def sinh(z)
begin
if z.real?
- RealMath.sinh(z)
+ sinh!(z)
else
- Complex(RealMath.sinh(z.real) * RealMath.cos(z.imag),
- RealMath.cosh(z.real) * RealMath.sin(z.imag))
+ Complex(sinh!(z.real) * cos!(z.imag),
+ cosh!(z.real) * sin!(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -226,16 +208,14 @@ module CMath
end
##
- # Returns the hyperbolic cosine of +z+, where +z+ is given in radians
- #
- # CMath.cosh(1 + 1i) #=> (0.8337300251311491+0.9888977057628651i)
+ # returns the hyperbolic cosine of +z+, where +z+ is given in radians
def cosh(z)
begin
if z.real?
- RealMath.cosh(z)
+ cosh!(z)
else
- Complex(RealMath.cosh(z.real) * RealMath.cos(z.imag),
- RealMath.sinh(z.real) * RealMath.sin(z.imag))
+ Complex(cosh!(z.real) * cos!(z.imag),
+ sinh!(z.real) * sin!(z.imag))
end
rescue NoMethodError
handle_no_method_error
@@ -243,13 +223,11 @@ module CMath
end
##
- # Returns the hyperbolic tangent of +z+, where +z+ is given in radians
- #
- # CMath.tanh(1 + 1i) #=> (1.0839233273386943+0.27175258531951174i)
+ # returns the hyperbolic tangent of +z+, where +z+ is given in radians
def tanh(z)
begin
if z.real?
- RealMath.tanh(z)
+ tanh!(z)
else
sinh(z) / cosh(z)
end
@@ -259,13 +237,11 @@ module CMath
end
##
- # Returns the arc sine of +z+
- #
- # CMath.asin(1 + 1i) #=> (0.6662394324925153+1.0612750619050355i)
+ # returns the arc sine of +z+
def asin(z)
begin
if z.real? and z >= -1 and z <= 1
- RealMath.asin(z)
+ asin!(z)
else
(-1.0).i * log(1.0.i * z + sqrt(1.0 - z * z))
end
@@ -275,13 +251,11 @@ module CMath
end
##
- # Returns the arc cosine of +z+
- #
- # CMath.acos(1 + 1i) #=> (0.9045568943023813-1.0612750619050357i)
+ # returns the arc cosine of +z+
def acos(z)
begin
if z.real? and z >= -1 and z <= 1
- RealMath.acos(z)
+ acos!(z)
else
(-1.0).i * log(z + 1.0.i * sqrt(1.0 - z * z))
end
@@ -291,13 +265,11 @@ module CMath
end
##
- # Returns the arc tangent of +z+
- #
- # CMath.atan(1 + 1i) #=> (1.0172219678978514+0.4023594781085251i)
+ # returns the arc tangent of +z+
def atan(z)
begin
if z.real?
- RealMath.atan(z)
+ atan!(z)
else
1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0
end
@@ -309,12 +281,10 @@ 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?
- RealMath.atan2(y,x)
+ atan2!(y,x)
else
(-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y))
end
@@ -325,12 +295,10 @@ module CMath
##
# returns the inverse hyperbolic sine of +z+
- #
- # CMath.asinh(1 + 1i) #=> (1.0612750619050357+0.6662394324925153i)
def asinh(z)
begin
if z.real?
- RealMath.asinh(z)
+ asinh!(z)
else
log(z + sqrt(1.0 + z * z))
end
@@ -341,12 +309,10 @@ 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
- RealMath.acosh(z)
+ acosh!(z)
else
log(z + sqrt(z * z - 1.0))
end
@@ -357,12 +323,10 @@ 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
- RealMath.atanh(z)
+ atanh!(z)
else
log((1.0 + z) / (1.0 - z)) / 2.0
end
@@ -433,3 +397,4 @@ module CMath
module_function :handle_no_method_error
end
+
diff --git a/lib/csv.gemspec b/lib/csv.gemspec
deleted file mode 100644
index 2862c1fbc2..0000000000
--- a/lib/csv.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "csv"
- spec.version = "1.0.0"
- spec.date = "2017-12-13"
- spec.authors = ["James Edward Gray II"]
- spec.email = [nil]
-
- spec.summary = "CSV Reading and Writing"
- spec.description = "the CSV library began its life as FasterCSV."
- spec.homepage = "https://github.com/ruby/csv"
- spec.license = "BSD-2-Clause"
-
- spec.files = ["lib/csv.rb"]
- spec.require_paths = ["lib"]
- spec.required_ruby_version = ">= 2.4.0"
-
- spec.add_development_dependency "bundler", "~> 1.14"
- spec.add_development_dependency "rake", "~> 12"
-end
diff --git a/lib/csv.rb b/lib/csv.rb
index 1f616803aa..60b22e76ba 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1,5 +1,4 @@
# encoding: US-ASCII
-# frozen_string_literal: true
# = csv.rb -- CSV Reading and Writing
#
# Created by James Edward Gray II on 2005-10-31.
@@ -177,7 +176,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 your data. However, you can set these values manually in
+# magically work for you 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
@@ -208,7 +207,7 @@ require "stringio"
#
class CSV
# The version of the installed library.
- VERSION = "2.4.8"
+ VERSION = "2.4.8".freeze
#
# A CSV::Row is part Array and part Hash. It retains an order for the fields
@@ -239,10 +238,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).each(&:reverse!)
+ fields.zip(headers).map { |pair| pair.reverse }
end
end
@@ -267,7 +266,7 @@ class CSV
# Returns the headers of this row.
def headers
- @row.map(&:first)
+ @row.map { |pair| pair.first }
end
#
@@ -285,15 +284,11 @@ class CSV
#
def field(header_or_index, minimum_index = 0)
# locate the pair
- finder = (header_or_index.is_a?(Integer) || header_or_index.is_a?(Range)) ? :[] : :assoc
+ finder = header_or_index.is_a?(Integer) ? :[] : :assoc
pair = @row[minimum_index..-1].send(finder, header_or_index)
# return the field if we have a pair
- if pair.nil?
- nil
- else
- header_or_index.is_a?(Range) ? pair.map(&:last) : pair.last
- end
+ pair.nil? ? nil : pair.last
end
alias_method :[], :field
@@ -431,11 +426,7 @@ class CSV
#
# This method returns the row for chaining.
#
- # If no block is given, an Enumerator is returned.
- #
def delete_if(&block)
- block or return enum_for(__method__) { size }
-
@row.delete_if(&block)
self # for chaining
@@ -451,23 +442,21 @@ class CSV
#
def fields(*headers_and_or_indices)
if headers_and_or_indices.empty? # return all fields--no arguments
- @row.map(&:last)
+ @row.map { |pair| pair.last }
else # or work like values_at()
- all = []
- headers_and_or_indices.each do |h_or_i|
- if h_or_i.is_a? Range
+ headers_and_or_indices.inject(Array.new) do |all, h_or_i|
+ all + if h_or_i.is_a? Range
index_begin = h_or_i.begin.is_a?(Integer) ? h_or_i.begin :
index(h_or_i.begin)
index_end = h_or_i.end.is_a?(Integer) ? h_or_i.end :
index(h_or_i.end)
new_range = h_or_i.exclude_end? ? (index_begin...index_end) :
(index_begin..index_end)
- all.concat(fields.values_at(new_range))
+ fields.values_at(new_range)
else
- all << field(*Array(h_or_i))
+ [field(*Array(h_or_i))]
end
end
- return all
end
end
alias_method :values_at, :fields
@@ -506,15 +495,13 @@ class CSV
#
# Yields each pair of the row as header and field tuples (much like
- # iterating over a Hash). This method returns the row for chaining.
- #
- # If no block is given, an Enumerator is returned.
+ # iterating over a Hash).
#
# Support for Enumerable.
#
+ # This method returns the row for chaining.
+ #
def each(&block)
- block or return enum_for(__method__) { size }
-
@row.each(&block)
self # for chaining
@@ -530,11 +517,12 @@ class CSV
end
#
- # Collapses the row into a simple Hash. Be warned that this discards field
+ # Collapses the row into a simple Hash. Be warning that this discards field
# order and clobbers duplicate fields.
#
def to_hash
- @row.to_h
+ # flatten just one level of the internal Array
+ Hash[*@row.inject(Array.new) { |ary, pair| ary.push(*pair) }]
end
#
@@ -542,7 +530,7 @@ class CSV
#
# csv_row.fields.to_csv( options )
#
- def to_csv(**options)
+ def to_csv(options = Hash.new)
fields.to_csv(options)
end
alias_method :to_s, :to_csv
@@ -702,7 +690,7 @@ class CSV
#
def [](index_or_header)
if @mode == :row or # by index
- (@mode == :col_or_row and (index_or_header.is_a?(Integer) or index_or_header.is_a?(Range)))
+ (@mode == :col_or_row and index_or_header.is_a? Integer)
@table[index_or_header]
else # by header
@table.map { |row| row[index_or_header] }
@@ -829,18 +817,15 @@ class CSV
#
# This method returns the table for chaining.
#
- # If no block is given, an Enumerator is returned.
- #
def delete_if(&block)
- block or return enum_for(__method__) { @mode == :row or @mode == :col_or_row ? size : headers.size }
-
if @mode == :row or @mode == :col_or_row # by index
@table.delete_if(&block)
else # by header
- deleted = []
- headers.each do |header|
- deleted << delete(header) if block[[header, self[header]]]
+ to_delete = Array.new
+ headers.each_with_index do |header, i|
+ to_delete << header if block[[header, self[header]]]
end
+ to_delete.map { |header| delete(header) }
end
self # for chaining
@@ -855,11 +840,7 @@ class CSV
#
# This method returns the table for chaining.
#
- # If no block is given, an Enumerator is returned.
- #
def each(&block)
- block or return enum_for(__method__) { @mode == :col ? headers.size : size }
-
if @mode == :col
headers.each { |header| block[[header, self[header]]] }
else
@@ -871,8 +852,7 @@ class CSV
# Returns +true+ if all rows of this table ==() +other+'s rows.
def ==(other)
- return @table == other.table if other.is_a? CSV::Table
- @table == other
+ @table == other.table
end
#
@@ -880,11 +860,13 @@ class CSV
# then all of the field rows will follow.
#
def to_a
- array = [headers]
- @table.each do |row|
- array.push(row.fields) unless row.header_row?
+ @table.inject([headers]) do |array, row|
+ if row.header_row?
+ array
+ else
+ array + [row.fields]
+ end
end
- return array
end
#
@@ -894,12 +876,15 @@ class CSV
# This method assumes you want the Table.headers(), unless you explicitly
# pass <tt>:write_headers => false</tt>.
#
- def to_csv(write_headers: true, **options)
- array = write_headers ? [headers.to_csv(options)] : []
- @table.each do |row|
- array.push(row.fields.to_csv(options)) unless row.header_row?
- end
- return array.join('')
+ def to_csv(options = Hash.new)
+ wh = options.fetch(:write_headers, true)
+ @table.inject(wh ? [headers.to_csv(options)] : [ ]) do |rows, row|
+ if row.header_row?
+ rows
+ else
+ rows + [row.fields.to_csv(options)]
+ end
+ end.join('')
end
alias_method :to_s, :to_csv
@@ -959,32 +944,30 @@ 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,10 +975,9 @@ class CSV
# through the +options+ Hash passed to CSV::new().
#
# <b><tt>:downcase</tt></b>:: Calls downcase() on the header String.
- # <b><tt>:symbol</tt></b>:: Leading/trailing spaces are dropped, string is
- # downcased, remaining spaces are replaced with
- # underscores, non-word characters are dropped,
- # and finally to_sym() is called.
+ # <b><tt>:symbol</tt></b>:: The header String is downcased, spaces are
+ # replaced with underscores, non-word characters
+ # are dropped, and finally to_sym() is called.
#
# All built-in header converters transcode header data to UTF-8 before
# attempting a conversion. If your data cannot be transcoded to UTF-8 the
@@ -1010,8 +992,8 @@ class CSV
HeaderConverters = {
downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
symbol: lambda { |h|
- h.encode(ConverterEncoding).downcase.gsub(/[^\s\w]+/, "").strip.
- gsub(/\s+/, "_").to_sym
+ h.encode(ConverterEncoding).downcase.strip.gsub(/\s+/, "_").
+ gsub(/\W+/, "").to_sym
}
}
@@ -1030,23 +1012,19 @@ class CSV
# <b><tt>:skip_blanks</tt></b>:: +false+
# <b><tt>:force_quotes</tt></b>:: +false+
# <b><tt>:skip_lines</tt></b>:: +nil+
- # <b><tt>:liberal_parsing</tt></b>:: +false+
- #
- 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,
- liberal_parsing: false,
- }.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
@@ -1057,14 +1035,14 @@ class CSV
# If a block is given, the instance is passed to the block and the return
# value becomes the return value of the block.
#
- def self.instance(data = $stdout, **options)
+ def self.instance(data = $stdout, options = Hash.new)
# create a _signature_ for this method call, data object and options
sig = [data.object_id] +
options.values_at(*DEFAULT_OPTIONS.keys.sort_by { |sym| sym.to_s })
# fetch or create the instance for this signature
@@instances ||= Hash.new
- instance = (@@instances[sig] ||= new(data, options))
+ instance = (@@instances[sig] ||= new(data, options))
if block_given?
yield instance # run block, if given, returning result
@@ -1075,9 +1053,9 @@ class CSV
#
# :call-seq:
- # filter( **options ) { |row| ... }
- # filter( input, **options ) { |row| ... }
- # filter( input, output, **options ) { |row| ... }
+ # filter( options = Hash.new ) { |row| ... }
+ # filter( input, options = Hash.new ) { |row| ... }
+ # filter( input, output, options = Hash.new ) { |row| ... }
#
# This method is a convenience for building Unix-like filters for CSV data.
# Each row is yielded to the provided block which can alter it as needed.
@@ -1097,23 +1075,25 @@ class CSV
# The <tt>:output_row_sep</tt> +option+ defaults to
# <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
#
- def self.filter(input=nil, output=nil, **options)
+ def self.filter(*args)
# parse options for input, output, or both
in_options, out_options = Hash.new, {row_sep: $INPUT_RECORD_SEPARATOR}
- options.each do |key, value|
- case key.to_s
- when /\Ain(?:put)?_(.+)\Z/
- in_options[$1.to_sym] = value
- when /\Aout(?:put)?_(.+)\Z/
- out_options[$1.to_sym] = value
- else
- in_options[key] = value
- out_options[key] = value
+ if args.last.is_a? Hash
+ args.pop.each do |key, value|
+ case key.to_s
+ when /\Ain(?:put)?_(.+)\Z/
+ in_options[$1.to_sym] = value
+ when /\Aout(?:put)?_(.+)\Z/
+ out_options[$1.to_sym] = value
+ else
+ in_options[key] = value
+ out_options[key] = value
+ end
end
end
# build input and output wrappers
- input = new(input || ARGF, in_options)
- output = new(output || $stdout, out_options)
+ input = new(args.shift || ARGF, in_options)
+ output = new(args.shift || $stdout, out_options)
# read, yield, write
input.each do |row|
@@ -1136,7 +1116,7 @@ class CSV
# <tt>encoding: "UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file
# but transcode it to UTF-8 before CSV parses it.
#
- def self.foreach(path, **options, &block)
+ def self.foreach(path, options = Hash.new, &block)
return to_enum(__method__, path, options) unless block
open(path, options) do |csv|
csv.each(&block)
@@ -1145,8 +1125,8 @@ class CSV
#
# :call-seq:
- # generate( str, **options ) { |csv| ... }
- # generate( **options ) { |csv| ... }
+ # generate( str, options = Hash.new ) { |csv| ... }
+ # generate( options = Hash.new ) { |csv| ... }
#
# This method wraps a String you provide, or an empty default String, in a
# CSV object which is passed to the provided block. You can use the block to
@@ -1161,17 +1141,19 @@ class CSV
# String to set the base Encoding for the output. CSV needs this hint if you
# plan to output non-ASCII compatible data.
#
- def self.generate(str=nil, **options)
+ def self.generate(*args)
# add a default empty String, if none was given
- if str
- io = StringIO.new(str)
+ if args.first.is_a? String
+ io = StringIO.new(args.shift)
io.seek(0, IO::SEEK_END)
+ args.unshift(io)
else
- encoding = options[:encoding]
- str = String.new
+ encoding = args[-1][:encoding] if args.last.is_a?(Hash)
+ str = ""
str.force_encoding(encoding) if encoding
+ args.unshift(str)
end
- csv = new(str, options) # wrap
+ csv = new(*args) # wrap
yield csv # yield for appending
csv.string # return final String
end
@@ -1189,11 +1171,12 @@ class CSV
# The <tt>:row_sep</tt> +option+ defaults to <tt>$INPUT_RECORD_SEPARATOR</tt>
# (<tt>$/</tt>) when calling this method.
#
- def self.generate_line(row, **options)
- options = {row_sep: $INPUT_RECORD_SEPARATOR}.merge(options)
- str = String.new
- if options[:encoding]
- str.force_encoding(options[:encoding])
+ def self.generate_line(row, options = Hash.new)
+ options = {row_sep: $INPUT_RECORD_SEPARATOR}.merge(options)
+ encoding = options.delete(:encoding)
+ str = ""
+ if encoding
+ str.force_encoding(encoding)
elsif field = row.find { |f| not f.nil? }
str.force_encoding(String(field).encoding)
end
@@ -1202,10 +1185,10 @@ class CSV
#
# :call-seq:
- # open( filename, mode = "rb", **options ) { |faster_csv| ... }
- # open( filename, **options ) { |faster_csv| ... }
- # open( filename, mode = "rb", **options )
- # open( filename, **options )
+ # open( filename, mode = "rb", options = Hash.new ) { |faster_csv| ... }
+ # open( filename, options = Hash.new ) { |faster_csv| ... }
+ # open( filename, mode = "rb", options = Hash.new )
+ # open( filename, options = Hash.new )
#
# This method opens an IO object, and wraps that with CSV. This is intended
# as the primary interface for writing a CSV file.
@@ -1263,16 +1246,17 @@ class CSV
# * truncate()
# * tty?()
#
- def self.open(filename, mode="r", **options)
+ def self.open(*args)
+ # find the +options+ Hash
+ options = if args.last.is_a? Hash then args.pop else Hash.new end
# wrap a File opened with the remaining +args+ with no newline
# decorator
file_opts = {universal_newline: false}.merge(options)
-
begin
- f = File.open(filename, mode, file_opts)
+ f = File.open(*args, file_opts)
rescue ArgumentError => e
- raise unless /needs binmode/ =~ e.message and mode == "r"
- mode = "rb"
+ raise unless /needs binmode/ =~ e.message and args.size == 1
+ args << "rb"
file_opts = {encoding: Encoding.default_external}.merge(file_opts)
retry
end
@@ -1297,14 +1281,14 @@ class CSV
#
# :call-seq:
- # parse( str, **options ) { |row| ... }
- # parse( str, **options )
+ # parse( str, options = Hash.new ) { |row| ... }
+ # parse( str, options = Hash.new )
#
# This method can be used to easily parse CSV out of a String. You may either
# provide a +block+ which will be called with each row of the String in turn,
# or just use the returned Array of Arrays (when no +block+ is given).
#
- # You pass your +str+ to read from, and an optional +options+ containing
+ # You pass your +str+ to read from, and an optional +options+ Hash containing
# anything CSV::new() understands.
#
def self.parse(*args, &block)
@@ -1327,7 +1311,7 @@ class CSV
#
# The +options+ parameter can be anything CSV::new() understands.
#
- def self.parse_line(line, **options)
+ def self.parse_line(line, options = Hash.new)
new(line, options).shift
end
@@ -1358,7 +1342,7 @@ class CSV
# converters: :numeric,
# header_converters: :symbol }.merge(options) )
#
- def self.table(path, **options)
+ def self.table(path, options = Hash.new)
read( path, { headers: true,
converters: :numeric,
header_converters: :symbol }.merge(options) )
@@ -1371,7 +1355,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 the beginning (for
+ # Note that a wrapped String will be positioned at 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.
#
@@ -1486,15 +1470,7 @@ 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 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.
+ # skip over any rows with no content.
# <b><tt>:force_quotes</tt></b>:: When set to a +true+ value, CSV will
# quote all CSV fields it creates.
# <b><tt>:skip_lines</tt></b>:: When set to an object responding to
@@ -1506,65 +1482,57 @@ class CSV
# a comment. If the passed object does
# not respond to <tt>match</tt>,
# <tt>ArgumentError</tt> is thrown.
- # <b><tt>:liberal_parsing</tt></b>:: When set to a +true+ value, CSV will
- # attempt to parse input not conformant
- # with RFC 4180, such as double quotes
- # in unquoted fields.
#
# See CSV::DEFAULT_OPTIONS for the default settings.
#
# Options cannot be overridden in the instance methods for performance reasons,
# so be sure to set what you want here.
#
- def initialize(data, col_sep: ",", row_sep: :auto, quote_char: '"', field_size_limit: nil,
- converters: nil, unconverted_fields: nil, headers: false, return_headers: false,
- write_headers: nil, header_converters: nil, skip_blanks: false, force_quotes: false,
- skip_lines: nil, liberal_parsing: false, internal_encoding: nil, external_encoding: nil, encoding: nil)
- raise ArgumentError.new("Cannot parse nil as CSV") if data.nil?
+ 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)
# create the IO object we will read from
- @io = data.is_a?(String) ? StringIO.new(data) : data
+ @io = data.is_a?(String) ? StringIO.new(data) : data
# honor the IO encoding if we can, otherwise default to ASCII-8BIT
- internal_encoding = Encoding.find(internal_encoding) if internal_encoding
- external_encoding = Encoding.find(external_encoding) if external_encoding
- if encoding
- encoding, = encoding.split(":", 2) if encoding.is_a?(String)
- encoding = Encoding.find(encoding)
- end
- @encoding = raw_encoding(nil) || internal_encoding || encoding ||
+ @encoding = raw_encoding(nil) ||
+ ( if encoding = options.delete(:internal_encoding)
+ case encoding
+ when Encoding; encoding
+ else Encoding.find(encoding)
+ end
+ end ) ||
+ ( case encoding = options.delete(:encoding)
+ when Encoding; encoding
+ when /\A[^:]+/; Encoding.find($&)
+ end ) ||
Encoding.default_internal || Encoding.default_external
#
# prepare for building safe regular expressions in the target encoding,
# if we can transcode the needed characters
#
- @re_esc = "\\".encode(@encoding).freeze rescue ""
- @re_chars = /#{%"[-\\]\\[\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
- @unconverted_fields = unconverted_fields
-
- # Stores header row settings and loads header converters, if needed.
- @use_headers = headers
- @return_headers = return_headers
- @write_headers = write_headers
-
- # headers must be delayed until shift(), in case they need a row of content
- @headers = nil
+ @re_esc = "\\".encode(@encoding) rescue ""
+ @re_chars = /#{%"[-\\]\\[\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
- init_separators(col_sep, row_sep, quote_char, force_quotes)
- init_parsers(skip_blanks, field_size_limit, liberal_parsing)
- init_converters(converters, :@converters, :convert)
- init_converters(header_converters, :@header_converters, :header_convert)
- init_comments(skip_lines)
+ init_separators(options)
+ init_parsers(options)
+ init_converters(options)
+ init_headers(options)
+ init_comments(options)
- @force_encoding = !!encoding
+ @force_encoding = !!(encoding || options.delete(:encoding))
+ options.delete(:internal_encoding)
+ options.delete(:external_encoding)
+ unless options.empty?
+ raise ArgumentError, "Unknown options: #{options.keys.join(', ')}."
+ end
# track our own lineno since IO gets confused about line-ends is CSV fields
@lineno = 0
-
- # make sure headers have been assigned
- if header_row? and [Array, String].include? @use_headers.class and @write_headers
- parse_headers # won't read data for Array or String
- self << @headers
- end
end
#
@@ -1637,8 +1605,6 @@ class CSV
def skip_blanks?() @skip_blanks end
# Returns +true+ if all output fields are quoted. See CSV::new for details.
def force_quotes?() @force_quotes end
- # Returns +true+ if illegal input is handled. See CSV::new for details.
- def liberal_parsing?() @liberal_parsing end
#
# The Encoding CSV is parsing or writing in. This will be the Encoding you
@@ -1650,7 +1616,7 @@ class CSV
# The line number of the last row read from this file. Fields with nested
# line-end characters will not affect this count.
#
- attr_reader :lineno, :line
+ attr_reader :lineno
### IO and StringIO Delegation ###
@@ -1681,8 +1647,9 @@ class CSV
#
def <<(row)
# make sure headers have been assigned
- if header_row? and [Array, String].include? @use_headers.class and !@write_headers
+ if header_row? and [Array, String].include? @use_headers.class
parse_headers # won't read data for Array or String
+ self << @headers if @write_headers
end
# handle CSV::Row objects and Hashes
@@ -1728,7 +1695,7 @@ class CSV
# converted field or the field itself.
#
def convert(name = nil, &converter)
- add_converter(:@converters, self.class::Converters, name, &converter)
+ add_converter(:converters, self.class::Converters, name, &converter)
end
#
@@ -1743,7 +1710,7 @@ class CSV
# effect.
#
def header_convert(name = nil, &converter)
- add_converter( :@header_converters,
+ add_converter( :header_converters,
self.class::HeaderConverters,
name,
&converter )
@@ -1824,12 +1791,6 @@ class CSV
return nil
end
- if in_extended_col
- @line.concat(parse)
- else
- @line = parse.clone
- end
-
parse.sub!(@parsers[:line_end], "")
if csv.empty?
@@ -1867,37 +1828,34 @@ class CSV
parts.each do |part|
if in_extended_col
# If we are continuing a previous column
- if part.end_with?(@quote_char) && part.count(@quote_char) % 2 != 0
+ if part[-1] == @quote_char && part.count(@quote_char) % 2 != 0
# extended column ends
csv.last << part[0..-2]
if csv.last =~ @parsers[:stray_quote]
raise MalformedCSVError,
"Missing or stray quote in line #{lineno + 1}"
end
- csv.last.gsub!(@double_quote_char, @quote_char)
+ csv.last.gsub!(@quote_char * 2, @quote_char)
in_extended_col = false
else
- csv.last << part << @col_sep
+ csv.last << part
+ csv.last << @col_sep
end
- elsif part.start_with?(@quote_char)
- # If we are starting a new quoted column
- if part.count(@quote_char) % 2 != 0
+ elsif part[0] == @quote_char
+ # If we are staring a new quoted column
+ if part[-1] != @quote_char || part.count(@quote_char) % 2 != 0
# start an extended column
- csv << (part[1..-1] << @col_sep)
+ csv << part[1..-1]
+ csv.last << @col_sep
in_extended_col = true
- elsif part.end_with?(@quote_char)
+ else
# regular quoted column
csv << part[1..-2]
if csv.last =~ @parsers[:stray_quote]
raise MalformedCSVError,
"Missing or stray quote in line #{lineno + 1}"
end
- csv.last.gsub!(@double_quote_char, @quote_char)
- elsif @liberal_parsing
- csv << part
- else
- raise MalformedCSVError,
- "Missing or stray quote in line #{lineno + 1}"
+ csv.last.gsub!(@quote_char * 2, @quote_char)
end
elsif part =~ @parsers[:quote_or_nl]
# Unquoted field with bad characters.
@@ -1905,11 +1863,7 @@ class CSV
raise MalformedCSVError, "Unquoted fields do not allow " +
"\\r or \\n (line #{lineno + 1})."
else
- if @liberal_parsing
- csv << part
- else
- raise MalformedCSVError, "Illegal quoting in line #{lineno + 1}."
- end
+ raise MalformedCSVError, "Illegal quoting in line #{lineno + 1}."
end
else
# Regular ole unquoted field.
@@ -1974,7 +1928,7 @@ class CSV
str << " encoding:" << @encoding.name
# show other attributes
%w[ lineno col_sep row_sep
- quote_char skip_blanks liberal_parsing ].each do |attr_name|
+ quote_char skip_blanks ].each do |attr_name|
if a = instance_variable_get("@#{attr_name}")
str << " " << attr_name << ":" << a.inspect
end
@@ -2005,12 +1959,11 @@ class CSV
#
# This method also establishes the quoting rules used for CSV output.
#
- def init_separators(col_sep, row_sep, quote_char, force_quotes)
+ def init_separators(options)
# store the selected separators
- @col_sep = col_sep.to_s.encode(@encoding)
- @row_sep = row_sep # encode after resolving :auto
- @quote_char = quote_char.to_s.encode(@encoding)
- @double_quote_char = @quote_char * 2
+ @col_sep = options.delete(:col_sep).to_s.encode(@encoding)
+ @row_sep = options.delete(:row_sep) # encode after resolving :auto
+ @quote_char = options.delete(:quote_char).to_s.encode(@encoding)
if @quote_char.length != 1
raise ArgumentError, ":quote_char has to be a single character String"
@@ -2075,11 +2028,13 @@ class CSV
@row_sep = @row_sep.to_s.encode(@encoding)
# establish quoting rules
- @force_quotes = force_quotes
- do_quote = lambda do |field|
- field = String(field)
+ @force_quotes = options.delete(:force_quotes)
+ do_quote = lambda do |field|
+ field = String(field)
encoded_quote = @quote_char.encode(field.encoding)
- encoded_quote + field.gsub(encoded_quote, encoded_quote * 2) + encoded_quote
+ encoded_quote +
+ field.gsub(encoded_quote, encoded_quote * 2) +
+ encoded_quote
end
quotable_chars = encode_str("\r\n", @col_sep, @quote_char)
@quote = if @force_quotes
@@ -2103,11 +2058,10 @@ class CSV
end
# Pre-compiles parsers and stores them by name for access during reads.
- def init_parsers(skip_blanks, field_size_limit, liberal_parsing)
+ def init_parsers(options)
# store the parser behaviors
- @skip_blanks = skip_blanks
- @field_size_limit = field_size_limit
- @liberal_parsing = liberal_parsing
+ @skip_blanks = options.delete(:skip_blanks)
+ @field_size_limit = options.delete(:field_size_limit)
# prebuild Regexps for faster parsing
esc_row_sep = escape_re(@row_sep)
@@ -2132,26 +2086,48 @@ 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 activated for
+ # The <tt>:unconverted_fields</tt> option is also actived for
# <tt>:converters</tt> calls, if requested.
#
- def init_converters(converters, ivar_name, convert_method)
- converters = case converters
- when nil then []
- when Array then converters
- else [converters]
- end
- instance_variable_set(ivar_name, [])
- convert = method(convert_method)
+ def init_converters(options, field_name = :converters)
+ if field_name == :converters
+ @unconverted_fields = options.delete(:unconverted_fields)
+ end
+
+ instance_variable_set("@#{field_name}", Array.new)
+
+ # find the correct method to add the converters
+ convert = method(field_name.to_s.sub(/ers\Z/, ""))
# load converters
- converters.each do |converter|
- if converter.is_a? Proc # custom code block
- convert.call(&converter)
- else # by name
- convert.call(converter)
+ unless options[field_name].nil?
+ # allow a single converter not wrapped in an Array
+ unless options[field_name].is_a? Array
+ options[field_name] = [options[field_name]]
+ end
+ # load each converter...
+ options[field_name].each do |converter|
+ if converter.is_a? Proc # custom code block
+ convert.call(&converter)
+ else # by name
+ convert.call(converter)
+ end
end
end
+
+ options.delete(field_name)
+ end
+
+ # Stores header row settings and loads header converters, if needed.
+ def init_headers(options)
+ @use_headers = options.delete(:headers)
+ @return_headers = options.delete(:return_headers)
+ @write_headers = options.delete(:write_headers)
+
+ # headers must be delayed until shift(), in case they need a row of content
+ @headers = nil
+
+ init_converters(options, :header_converters)
end
# Stores the pattern of comments to skip from the provided options.
@@ -2160,9 +2136,9 @@ class CSV
# Strings are converted to a Regexp.
#
# See also CSV.new
- def init_comments(skip_lines)
- @skip_lines = skip_lines
- @skip_lines = Regexp.new(Regexp.escape(@skip_lines)) if @skip_lines.is_a? String
+ def init_comments(options)
+ @skip_lines = options.delete(:skip_lines)
+ @skip_lines = Regexp.new(@skip_lines) if @skip_lines.is_a? String
if @skip_lines and not @skip_lines.respond_to?(:match)
raise ArgumentError, ":skip_lines has to respond to matches"
end
@@ -2177,7 +2153,7 @@ class CSV
#
def add_converter(var_name, const, name = nil, &converter)
if name.nil? # custom converter
- instance_variable_get(var_name) << converter
+ instance_variable_get("@#{var_name}") << converter
else # named converter
combo = const[name]
case combo
@@ -2186,7 +2162,7 @@ class CSV
add_converter(var_name, const, converter_name)
end
else # individual named converter
- instance_variable_get(var_name) << combo
+ instance_variable_get("@#{var_name}") << combo
end
end
end
@@ -2204,7 +2180,7 @@ class CSV
fields.map.with_index do |field, index|
converters.each do |converter|
- break if headers && field.nil?
+ break if field.nil?
field = if converter.arity == 1 # straight field converter
converter[field]
else # FieldInfo converter
@@ -2266,7 +2242,7 @@ class CSV
class << row
attr_reader :unconverted_fields
end
- row.instance_variable_set(:@unconverted_fields, fields)
+ row.instance_eval { @unconverted_fields = fields }
row
end
@@ -2297,6 +2273,8 @@ class CSV
chunks.map { |chunk| chunk.encode(@encoding.name) }.join('')
end
+ private
+
#
# Returns the encoding of the internal IO object or the +default+ if the
# encoding cannot be determined.
@@ -2339,7 +2317,7 @@ class Array # :nodoc:
#
# ["CSV", "data"].to_csv
# #=> "CSV,data\n"
- def to_csv(**options)
+ def to_csv(options = Hash.new)
CSV.generate_line(self, options)
end
end
@@ -2349,7 +2327,7 @@ class String # :nodoc:
#
# "CSV,data".parse_csv
# #=> ["CSV", "data"]
- def parse_csv(**options)
+ def parse_csv(options = Hash.new)
CSV.parse_line(self, options)
end
end
diff --git a/lib/debug.rb b/lib/debug.rb
index 34d7d27406..fcbf849f0d 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# 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>
@@ -182,7 +181,7 @@ SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ # :nodoc:
# Debug is not available in safe mode.
class DEBUGGER__
- MUTEX = Thread::Mutex.new # :nodoc:
+ MUTEX = Mutex.new # :nodoc:
class Context # :nodoc:
DEBUG_LAST_CMD = []
@@ -1009,29 +1008,6 @@ 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 37819a28f4..f2b1388107 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# = delegate -- Support for the Delegation Pattern
#
# Documentation by James Edward Gray II and Gavin Sinclair
@@ -18,10 +17,15 @@
# 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 of the use of
+# SimpleDelegator's implementation serves as a nice example if 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
@@ -40,7 +44,7 @@ class Delegator < BasicObject
kernel = ::Kernel.dup
kernel.class_eval do
alias __raise__ raise
- [:to_s, :inspect, :=~, :!~, :===, :<=>, :hash].each do |m|
+ [:to_s,:inspect,:=~,:!~,:===,:<=>,:eql?,:hash].each do |m|
undef_method m
end
private_instance_methods.each do |m|
@@ -78,13 +82,16 @@ class Delegator < BasicObject
def method_missing(m, *args, &block)
r = true
target = self.__getobj__ {r = false}
-
- 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)
+ 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 $@
end
end
@@ -97,7 +104,7 @@ class Delegator < BasicObject
target = self.__getobj__ {r = false}
r &&= target.respond_to?(m, include_private)
if r && include_private && !target.respond_to?(m, false)
- warn "delegator does not forward private method \##{m}", uplevel: 3
+ warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
return false
end
r
@@ -146,14 +153,6 @@ class Delegator < BasicObject
end
#
- # Returns true if two objects are considered of equal value.
- #
- def eql?(obj)
- return true if obj.equal?(self)
- obj.eql?(__getobj__)
- end
-
- #
# Delegates ! to the \_\_getobj\_\_
#
def !
@@ -183,7 +182,7 @@ class Delegator < BasicObject
ivars = instance_variables.reject {|var| /\A@delegate_/ =~ var}
[
:__v2__,
- ivars, ivars.map {|var| instance_variable_get(var)},
+ ivars, ivars.map{|var| instance_variable_get(var)},
__getobj__
]
end
@@ -194,7 +193,7 @@ class Delegator < BasicObject
def marshal_load(data)
version, vars, values, obj = data
if version == :__v2__
- vars.each_with_index {|var, i| instance_variable_set(var, values[i])}
+ vars.each_with_index{|var, i| instance_variable_set(var, values[i])}
__setobj__(obj)
else
__setobj__(data)
@@ -242,7 +241,7 @@ class Delegator < BasicObject
end
@delegator_api = self.public_instance_methods
- def self.public_api # :nodoc:
+ def self.public_api # :nodoc:
@delegator_api
end
end
@@ -313,7 +312,7 @@ end
# Non-Nil: 7
# Unique: 6
#
-class SimpleDelegator < Delegator
+class SimpleDelegator<Delegator
# Returns the current object method calls are being delegated to.
def __getobj__
unless defined?(@delegate_sd_obj)
@@ -346,7 +345,11 @@ end
def Delegator.delegating_block(mid) # :nodoc:
lambda do |*args, &block|
target = self.__getobj__
- target.__send__(mid, *args, &block)
+ begin
+ target.__send__(mid, *args, &block)
+ ensure
+ $@.delete_if {|t| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}:/o =~ t} if $@
+ end
end
end
@@ -387,9 +390,9 @@ def DelegateClass(superclass)
klass = Class.new(Delegator)
methods = superclass.instance_methods
methods -= ::Delegator.public_api
- methods -= [:to_s, :inspect, :=~, :!~, :===]
+ methods -= [:to_s,:inspect,:=~,:!~,:===]
klass.module_eval do
- def __getobj__ # :nodoc:
+ def __getobj__ # :nodoc:
unless defined?(@delegate_dc_obj)
return yield if block_given?
__raise__ ::ArgumentError, "not delegated"
diff --git a/lib/drb.rb b/lib/drb.rb
index 2bb4716fa2..93cc811e14 100644
--- a/lib/drb.rb
+++ b/lib/drb.rb
@@ -1,3 +1,2 @@
-# frozen_string_literal: false
require 'drb/drb'
diff --git a/lib/drb/acl.rb b/lib/drb/acl.rb
index b004656f09..72e034e960 100644
--- a/lib/drb/acl.rb
+++ b/lib/drb/acl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# Copyright (c) 2000,2002,2003 Masatoshi SEKI
#
# acl.rb is copyrighted free software by Masatoshi SEKI.
@@ -49,9 +48,6 @@ class ACL
# +str+ may be "*" or "all" to match any address, an IP address string
# to match a specific address, an IP address mask per IPAddr, or one
# containing "*" to match part of an IPv4 address.
- #
- # IPAddr::InvalidPrefixError may be raised when an IP network
- # address with an invalid netmask/prefix is given.
def initialize(str)
if str == '*' or str == 'all'
@@ -61,10 +57,6 @@ class ACL
else
begin
@pat = [:ip, IPAddr.new(str)]
- rescue IPAddr::InvalidPrefixError
- # In this case, `str` shouldn't be a host name pattern
- # because it contains a slash.
- raise
rescue ArgumentError
@pat = [:name, dot_pat(str)]
end
@@ -89,7 +81,8 @@ class ACL
# Creates a Regexp to match an address.
def dot_pat(str)
- /\A#{dot_pat_str(str)}\z/
+ exp = "^" + dot_pat_str(str) + "$"
+ Regexp.new(exp)
end
public
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index e47b303aa4..26f39b789f 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = drb/drb.rb
#
@@ -47,7 +46,8 @@
# Translation of presentation on Ruby by Masatoshi Seki.
require 'socket'
-require 'io/wait'
+require 'thread'
+require 'fcntl'
require 'drb/eq'
#
@@ -745,7 +745,7 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri)
+ auto_load(uri, config)
return open(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
@@ -769,7 +769,7 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri)
+ auto_load(uri, config)
return open_server(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
@@ -792,14 +792,14 @@ module DRb
end
end
if first && (config[:auto_load] != false)
- auto_load(uri)
+ auto_load(uri, config)
return uri_option(uri, config, false)
end
raise DRbBadURI, 'can\'t parse uri:' + uri
end
module_function :uri_option
- def auto_load(uri) # :nodoc:
+ def auto_load(uri, config) # :nodoc:
if uri =~ /^drb([a-z0-9]+):/
require("drb/#{$1}") rescue nil
end
@@ -905,7 +905,6 @@ 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.
@@ -953,28 +952,14 @@ 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 = accept_or_shutdown
- return nil unless s
+ s = @socket.accept
break if (@acl ? @acl.allow_socket?(s) : true)
s.close
end
@@ -986,24 +971,10 @@ 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 @socket.to_io.wait_readable(0)
+ if IO.select([@socket], nil, nil, 0)
close
return false
end
@@ -1012,6 +983,7 @@ 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
@@ -1204,7 +1176,7 @@ module DRb
# not normally need to deal with it directly.
class DRbConn
POOL_SIZE = 16 # :nodoc:
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
@pool = []
def self.open(remote_uri) # :nodoc:
@@ -1466,7 +1438,7 @@ module DRb
if Thread.current['DRb'] && Thread.current['DRb']['server'] == self
Thread.current['DRb']['stop_service'] = true
else
- shutdown
+ @thread.kill.join
end
end
@@ -1485,25 +1457,14 @@ module DRb
private
- def shutdown
- current = Thread.current
- if @protocol.respond_to? :shutdown
- @protocol.shutdown
- else
- [@thread, *@grp.list].each { |thread|
- thread.kill unless thread == current # xxx: Thread#kill
- }
- end
- @thread.join unless @thread == current
- end
-
##
# Starts the DRb main loop in a new thread.
def run
Thread.start do
begin
- while main_loop
+ while true
+ main_loop
end
ensure
@protocol.close if @protocol
@@ -1638,17 +1599,6 @@ module DRb
include InvokeMethod18Mixin
end
- def error_print(exception)
- exception.backtrace.inject(true) do |first, x|
- if first
- $stderr.puts "#{x}: #{exception} (#{exception.class})"
- else
- $stderr.puts "\tfrom #{x}"
- end
- false
- end
- end
-
# The main loop performed by a DRbServer's internal thread.
#
# Accepts a connection from a client, and starts up its own
@@ -1657,9 +1607,7 @@ module DRb
# returning responses, until the client closes the connection
# or a local method call fails.
def main_loop
- client0 = @protocol.accept
- return nil if !client0
- Thread.start(client0) do |client|
+ Thread.start(@protocol.accept) do |client|
@grp.add Thread.current
Thread.current['DRb'] = { 'client' => client ,
'server' => self }
@@ -1672,15 +1620,17 @@ module DRb
succ = false
invoke_method = InvokeMethod.new(self, client)
succ, result = invoke_method.perform
- error_print(result) if !succ && verbose
- client.send_reply(succ, result)
- rescue Exception => e
- error_print(e) if verbose
+ if !succ && verbose
+ p result
+ result.backtrace.each do |x|
+ puts x
+ end
+ end
+ client.send_reply(succ, result) rescue nil
ensure
client.close unless succ
if Thread.current['DRb']['stop_service']
- shutdown
- break
+ Thread.new { stop_service }
end
break unless succ
end
@@ -1831,7 +1781,7 @@ module DRb
end
module_function :install_acl
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
def mutex # :nodoc:
@mutex
end
diff --git a/lib/drb/eq.rb b/lib/drb/eq.rb
index 15ca5cae42..553f30c598 100644
--- a/lib/drb/eq.rb
+++ b/lib/drb/eq.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module DRb
class DRbObject # :nodoc:
def ==(other)
diff --git a/lib/drb/extserv.rb b/lib/drb/extserv.rb
index 1cb1be4709..327b553a25 100644
--- a/lib/drb/extserv.rb
+++ b/lib/drb/extserv.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
=begin
external service
Copyright (c) 2000,2002 Masatoshi SEKI
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 2d3c369bbf..8a7fc316af 100644
--- a/lib/drb/extservm.rb
+++ b/lib/drb/extservm.rb
@@ -1,10 +1,10 @@
-# frozen_string_literal: false
=begin
external service manager
Copyright (c) 2000 Masatoshi SEKI
=end
require 'drb/drb'
+require 'thread'
require 'monitor'
module DRb
@@ -27,7 +27,7 @@ module DRb
@cond = new_cond
@servers = {}
@waiting = []
- @queue = Thread::Queue.new
+ @queue = Queue.new
@thread = invoke_thread
@uri = nil
end
@@ -37,7 +37,7 @@ module DRb
synchronize do
while true
server = @servers[name]
- return server if server && server.alive? # server may be `false'
+ return server if server && server.alive?
invoke_service(name)
@cond.wait
end
diff --git a/lib/drb/gw.rb b/lib/drb/gw.rb
index d000507644..b3568ab08d 100644
--- a/lib/drb/gw.rb
+++ b/lib/drb/gw.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'drb/drb'
require 'monitor'
diff --git a/lib/drb/invokemethod.rb b/lib/drb/invokemethod.rb
index 0fae6d52b6..71ebec11f6 100644
--- a/lib/drb/invokemethod.rb
+++ b/lib/drb/invokemethod.rb
@@ -1,4 +1,3 @@
-# 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 3ee15331a1..cab9ebc60b 100644
--- a/lib/drb/observer.rb
+++ b/lib/drb/observer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'observer'
module DRb
diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb
index 45fe4f1f74..dd4df4e129 100644
--- a/lib/drb/ssl.rb
+++ b/lib/drb/ssl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'socket'
require 'openssl'
require 'drb/drb'
@@ -323,8 +322,7 @@ module DRb
def accept # :nodoc:
begin
while true
- soc = accept_or_shutdown
- return nil unless soc
+ soc = @socket.accept
break if (@acl ? @acl.allow_socket?(soc) : true)
soc.close
end
@@ -336,7 +334,7 @@ module DRb
end
self.class.new(uri, ssl, @config, true)
rescue OpenSSL::SSL::SSLError
- warn("#{$!.message} (#{$!.class})", uplevel: 0) if @config[:verbose]
+ warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose]
retry
end
end
diff --git a/lib/drb/timeridconv.rb b/lib/drb/timeridconv.rb
index 9ac7e1e69c..4ea3035f39 100644
--- a/lib/drb/timeridconv.rb
+++ b/lib/drb/timeridconv.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'drb/drb'
require 'monitor'
@@ -18,67 +17,72 @@ module DRb
class InvalidIndexError < RuntimeError; end
- def initialize(keeping=600)
+ def initialize(timeout=600)
super()
@sentinel = Object.new
@gc = {}
+ @curr = {}
@renew = {}
- @keeping = keeping
- @expires = nil
+ @timeout = timeout
+ @keeper = keeper
end
def add(obj)
synchronize do
- rotate
key = obj.__id__
- @renew[key] = obj
- invoke_keeper
+ @curr[key] = obj
return key
end
end
- def fetch(key)
+ def fetch(key, dv=@sentinel)
synchronize do
- rotate
obj = peek(key)
- raise InvalidIndexError if obj == @sentinel
+ if obj == @sentinel
+ return dv unless dv == @sentinel
+ raise InvalidIndexError
+ end
@renew[key] = obj # KeepIt
return obj
end
end
- private
- def peek(key)
- return @renew.fetch(key) { @gc.fetch(key, @sentinel) }
+ def include?(key)
+ synchronize do
+ obj = peek(key)
+ return false if obj == @sentinel
+ true
+ end
end
- def invoke_keeper
- return if @expires
- @expires = Time.now + @keeping
- on_gc
+ def peek(key)
+ synchronize do
+ return @curr.fetch(key, @renew.fetch(key, @gc.fetch(key, @sentinel)))
+ end
end
- def on_gc
- return unless Thread.main.alive?
- return if @expires.nil?
- Thread.new { rotate } if @expires < Time.now
- ObjectSpace.define_finalizer(Object.new) {on_gc}
+ private
+ def alternate
+ synchronize do
+ @gc = @curr # GCed
+ @curr = @renew
+ @renew = {}
+ end
end
- def rotate
- synchronize do
- if @expires &.< Time.now
- @gc = @renew # GCed
- @renew = {}
- @expires = @gc.empty? ? nil : Time.now + @keeping
+ def keeper
+ Thread.new do
+ loop do
+ alternate
+ sleep(@timeout)
end
end
end
end
- # Creates a new TimerIdConv which will hold objects for +keeping+ seconds.
- def initialize(keeping=600)
- @holder = TimerHolder2.new(keeping)
+ # Creates a new TimerIdConv which will hold objects for +timeout+ seconds.
+ def initialize(timeout=600)
+ @holder = TimerHolder2.new(timeout)
end
def to_obj(ref) # :nodoc:
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index adacf6df5b..4d245780a5 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'socket'
require 'drb/drb'
require 'tmpdir'
@@ -99,17 +98,15 @@ module DRb
@socket.close
File.unlink(path) if @server_mode
@socket = nil
- close_shutdown_pipe
end
def accept
- s = accept_or_shutdown
- return nil unless s
+ s = @socket.accept
self.class.new(nil, s, @config)
end
def set_sockopt(soc)
- # no-op for now
+ soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
end
end
diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb
index 1c1d7148ff..1eb5b51678 100644
--- a/lib/e2mmap.rb
+++ b/lib/e2mmap.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
#--
# e2mmap.rb - for Ruby 1.1
@@ -62,20 +61,16 @@ module Exception2MessageMapper
end
def bind(cl)
- self.module_eval "#{<<-"begin;"}\n#{<<-"end;"}", __FILE__, __LINE__+1
- begin;
+ self.module_eval %[
def Raise(err = nil, *rest)
Exception2MessageMapper.Raise(self.class, err, *rest)
end
alias Fail Raise
- class << self
- undef included
- end
def self.included(mod)
mod.extend Exception2MessageMapper
end
- end;
+ ]
end
# Fail(err, *rest)
@@ -132,9 +127,9 @@ module Exception2MessageMapper
# define exception named ``c'' with message m.
#
def E2MM.def_exception(k, n, m, s = StandardError)
+ n = n.id2name if n.kind_of?(Fixnum)
e = Class.new(s)
E2MM.instance_eval{@MessageMap[[k, e]] = m}
- k.module_eval {remove_const(n)} if k.const_defined?(n, false)
k.const_set(n, e)
end
diff --git a/lib/erb.rb b/lib/erb.rb
index 062fd496b9..c372f56da8 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -1,5 +1,4 @@
# -*- coding: us-ascii -*-
-# frozen_string_literal: true
# = ERB -- Ruby Templating
#
# Author:: Masatoshi SEKI
@@ -280,9 +279,9 @@ class ERB
# ERB#src:
#
# compiler = ERB::Compiler.new('<>')
- # compiler.pre_cmd = ["_erbout=+''"]
- # compiler.put_cmd = "_erbout.<<"
- # compiler.insert_cmd = "_erbout.<<"
+ # compiler.pre_cmd = ["_erbout=''"]
+ # compiler.put_cmd = "_erbout.concat"
+ # compiler.insert_cmd = "_erbout.concat"
# compiler.post_cmd = ["_erbout"]
#
# code, enc = compiler.compile("Got <%= obj %>!\n")
@@ -291,7 +290,7 @@ class ERB
# <i>Generates</i>:
#
# #coding:UTF-8
- # _erbout=+''; _erbout.<< "Got ".freeze; _erbout.<<(( obj ).to_s); _erbout.<< "!\n".freeze; _erbout
+ # _erbout=''; _erbout.concat "Got "; _erbout.concat(( obj ).to_s); _erbout.concat "!\n"; _erbout
#
# By default the output is sent to the print method. For example:
#
@@ -302,7 +301,7 @@ class ERB
# <i>Generates</i>:
#
# #coding:UTF-8
- # print "Got ".freeze; print(( obj ).to_s); print "!\n".freeze
+ # print "Got "; print(( obj ).to_s); print "!\n"
#
# == Evaluation
#
@@ -347,15 +346,16 @@ class ERB
end
attr_reader :value
alias :to_s :value
+
+ def empty?
+ @value.empty?
+ end
end
class Scanner # :nodoc:
@scanner_map = {}
- class << self
- def register_scanner(klass, trim_mode, percent)
- @scanner_map[[trim_mode, percent]] = klass
- end
- alias :regist_scanner :register_scanner
+ def self.regist_scanner(klass, trim_mode, percent)
+ @scanner_map[[trim_mode, percent]] = klass
end
def self.default_scanner=(klass)
@@ -367,16 +367,11 @@ class ERB
klass.new(src, trim_mode, percent)
end
- DEFAULT_STAGS = %w(<%% <%= <%# <%).freeze
- DEFAULT_ETAGS = %w(%%> %>).freeze
def initialize(src, trim_mode, percent)
@src = src
@stag = nil
- @stags = DEFAULT_STAGS
- @etags = DEFAULT_ETAGS
end
attr_accessor :stag
- attr_reader :stags, :etags
def scan; end
end
@@ -387,19 +382,16 @@ class ERB
@trim_mode = trim_mode
@percent = percent
if @trim_mode == '>'
- @scan_reg = /(.*?)(%>\r?\n|#{(stags + etags).join('|')}|\n|\z)/m
@scan_line = self.method(:trim_line1)
elsif @trim_mode == '<>'
- @scan_reg = /(.*?)(%>\r?\n|#{(stags + etags).join('|')}|\n|\z)/m
@scan_line = self.method(:trim_line2)
elsif @trim_mode == '-'
- @scan_reg = /(.*?)(^[ \t]*<%\-|<%\-|-%>\r?\n|-%>|#{(stags + etags).join('|')}|\z)/m
@scan_line = self.method(:explicit_trim_line)
else
- @scan_reg = /(.*?)(#{(stags + etags).join('|')}|\n|\z)/m
@scan_line = self.method(:scan_line)
end
end
+ attr_accessor :stag
def scan(&block)
@stag = nil
@@ -427,7 +419,7 @@ class ERB
end
def scan_line(line)
- line.scan(@scan_reg) do |tokens|
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
yield(token)
@@ -436,10 +428,10 @@ class ERB
end
def trim_line1(line)
- line.scan(@scan_reg) do |tokens|
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
- if token == "%>\n" || token == "%>\r\n"
+ if token == "%>\n"
yield('%>')
yield(:cr)
else
@@ -451,11 +443,11 @@ class ERB
def trim_line2(line)
head = nil
- line.scan(@scan_reg) do |tokens|
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
head = token unless head
- if token == "%>\n" || token == "%>\r\n"
+ if token == "%>\n"
yield('%>')
if is_erb_stag?(head)
yield(:cr)
@@ -472,12 +464,12 @@ class ERB
end
def explicit_trim_line(line)
- line.scan(@scan_reg) do |tokens|
+ line.scan(/(.*?)(^[ \t]*<%\-|<%\-|<%%|%%>|<%=|<%#|<%|-%>\n|-%>|%>|\z)/m) do |tokens|
tokens.each do |token|
next if token.empty?
if @stag.nil? && /[ \t]*<%-/ =~ token
yield('<%')
- elsif @stag && (token == "-%>\n" || token == "-%>\r\n")
+ elsif @stag && token == "-%>\n"
yield('%>')
yield(:cr)
elsif @stag && token == '-%>'
@@ -497,14 +489,25 @@ class ERB
Scanner.default_scanner = TrimScanner
+ class SimpleScanner < Scanner # :nodoc:
+ def scan
+ @src.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |tokens|
+ tokens.each do |token|
+ next if token.empty?
+ yield(token)
+ end
+ end
+ end
+ end
+
+ Scanner.regist_scanner(SimpleScanner, nil, false)
+
begin
require 'strscan'
- rescue LoadError
- else
- class SimpleScanner < Scanner # :nodoc:
+ class SimpleScanner2 < Scanner # :nodoc:
def scan
- stag_reg = (stags == DEFAULT_STAGS) ? /(.*?)(<%[%=#]?|\z)/m : /(.*?)(#{stags.join('|')}|\z)/m
- etag_reg = (etags == DEFAULT_ETAGS) ? /(.*?)(%%?>|\z)/m : /(.*?)(#{etags.join('|')}|\z)/m
+ stag_reg = /(.*?)(<%%|<%=|<%#|<%|\z)/m
+ etag_reg = /(.*?)(%%>|%>|\z)/m
scanner = StringScanner.new(@src)
while ! scanner.eos?
scanner.scan(@stag ? etag_reg : stag_reg)
@@ -513,16 +516,12 @@ class ERB
end
end
end
- Scanner.register_scanner(SimpleScanner, nil, false)
-
- # Deprecated. Kept for backward compatibility.
- SimpleScanner2 = SimpleScanner # :nodoc:
- deprecate_constant :SimpleScanner2
+ Scanner.regist_scanner(SimpleScanner2, nil, false)
class ExplicitScanner < Scanner # :nodoc:
def scan
- stag_reg = /(.*?)(^[ \t]*<%-|<%-|#{stags.join('|')}|\z)/m
- etag_reg = /(.*?)(-%>|#{etags.join('|')}|\z)/m
+ stag_reg = /(.*?)(^[ \t]*<%-|<%%|<%=|<%#|<%-|<%|\z)/m
+ etag_reg = /(.*?)(%%>|-%>|%>|\z)/m
scanner = StringScanner.new(@src)
while ! scanner.eos?
scanner.scan(@stag ? etag_reg : stag_reg)
@@ -533,23 +532,23 @@ class ERB
yield('<%')
elsif elem == '-%>'
yield('%>')
- yield(:cr) if scanner.scan(/(\r?\n|\z)/)
+ yield(:cr) if scanner.scan(/(\n|\z)/)
else
yield(elem)
end
end
end
end
- Scanner.register_scanner(ExplicitScanner, '-', false)
+ Scanner.regist_scanner(ExplicitScanner, '-', false)
+
+ rescue LoadError
end
class Buffer # :nodoc:
- def initialize(compiler, enc=nil, frozen=nil)
+ def initialize(compiler, enc=nil)
@compiler = compiler
@line = []
- @script = +''
- @script << "#coding:#{enc}\n" if enc
- @script << "#frozen-string-literal:#{frozen}\n" unless frozen.nil?
+ @script = enc ? "#coding:#{enc}\n" : ""
@compiler.pre_cmd.each do |x|
push(x)
end
@@ -576,8 +575,17 @@ class ERB
end
end
+ def content_dump(s) # :nodoc:
+ n = s.count("\n")
+ if n > 0
+ s.dump + "\n" * n
+ else
+ s.dump
+ end
+ end
+
def add_put_cmd(out, content)
- out.push("#{@put_cmd} #{content.dump}.freeze#{"\n" * content.count("\n")}")
+ out.push("#{@put_cmd} #{content_dump(content)}")
end
def add_insert_cmd(out, content)
@@ -590,77 +598,65 @@ class ERB
enc = s.encoding
raise ArgumentError, "#{enc} is not ASCII compatible" if enc.dummy?
s = s.b # see String#b
- magic_comment = detect_magic_comment(s, enc)
- out = Buffer.new(self, *magic_comment)
+ enc = detect_magic_comment(s) || enc
+ out = Buffer.new(self, enc)
- self.content = +''
+ content = ''
scanner = make_scanner(s)
scanner.scan do |token|
next if token.nil?
next if token == ''
if scanner.stag.nil?
- compile_stag(token, out, scanner)
+ case token
+ when PercentLine
+ add_put_cmd(out, content) if content.size > 0
+ content = ''
+ out.push(token.to_s)
+ out.cr
+ when :cr
+ out.cr
+ when '<%', '<%=', '<%#'
+ scanner.stag = token
+ add_put_cmd(out, content) if content.size > 0
+ content = ''
+ when "\n"
+ content << "\n"
+ add_put_cmd(out, content)
+ content = ''
+ when '<%%'
+ content << '<%'
+ else
+ content << token
+ end
else
- compile_etag(token, out, scanner)
+ case token
+ when '%>'
+ case scanner.stag
+ when '<%'
+ if content[-1] == ?\n
+ content.chop!
+ out.push(content)
+ out.cr
+ else
+ out.push(content)
+ end
+ when '<%='
+ add_insert_cmd(out, content)
+ when '<%#'
+ # out.push("# #{content_dump(content)}")
+ end
+ scanner.stag = nil
+ content = ''
+ when '%%>'
+ content << '%>'
+ else
+ content << token
+ end
end
end
add_put_cmd(out, content) if content.size > 0
out.close
- return out.script, *magic_comment
- end
-
- def compile_stag(stag, out, scanner)
- case stag
- when PercentLine
- add_put_cmd(out, content) if content.size > 0
- self.content = +''
- out.push(stag.to_s)
- out.cr
- when :cr
- out.cr
- when '<%', '<%=', '<%#'
- scanner.stag = stag
- add_put_cmd(out, content) if content.size > 0
- self.content = +''
- when "\n"
- content << "\n"
- add_put_cmd(out, content)
- self.content = +''
- when '<%%'
- content << '<%'
- else
- content << stag
- end
- end
-
- def compile_etag(etag, out, scanner)
- case etag
- when '%>'
- compile_content(scanner.stag, out)
- scanner.stag = nil
- self.content = +''
- when '%%>'
- content << '%>'
- else
- content << etag
- end
- end
-
- def compile_content(stag, out)
- case stag
- when '<%'
- if content[-1] == ?\n
- content.chop!
- out.push(content)
- out.cr
- else
- out.push(content)
- end
- when '<%='
- add_insert_cmd(out, content)
- when '<%#'
- # commented out
- end
+ return out.script, enc
end
def prepare_trim_mode(mode) # :nodoc:
@@ -715,24 +711,15 @@ class ERB
attr_accessor :post_cmd
private
-
- # A buffered text in #compile
- attr_accessor :content
-
- def detect_magic_comment(s, enc = nil)
- re = @percent ? /\G(?:<%#(.*)%>|%#(.*)\n)/ : /\G<%#(.*)%>/
- frozen = nil
- s.scan(re) do
- comment = $+
+ def detect_magic_comment(s)
+ if /\A<%#(.*)%>/ =~ s or (@percent and /\A%#(.*)/ =~ s)
+ comment = $1
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
- case comment
- when %r"coding\s*[=:]\s*([[:alnum:]\-_]+)"
- enc = Encoding.find($1.sub(/-(?:mac|dos|unix)/i, ''))
- when %r"frozen[-_]string[-_]literal\s*:\s*([[:alnum:]]+)"
- frozen = $1
+ if %r"coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
+ enc = $1.sub(/-(?:mac|dos|unix)/i, '')
+ Encoding.find(enc)
end
end
- return enc, frozen
end
end
end
@@ -810,9 +797,8 @@ class ERB
@safe_level = safe_level
compiler = make_compiler(trim_mode)
set_eoutvar(compiler, eoutvar)
- @src, @encoding, @frozen_string = *compiler.compile(str)
+ @src, @enc = *compiler.compile(str)
@filename = nil
- @lineno = 0
end
##
@@ -825,32 +811,20 @@ 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
# requires the setup of an ERB _compiler_ object.
#
def set_eoutvar(compiler, eoutvar = '_erbout')
- compiler.put_cmd = "#{eoutvar}.<<"
- compiler.insert_cmd = "#{eoutvar}.<<"
- compiler.pre_cmd = ["#{eoutvar} = +''"]
- compiler.post_cmd = [eoutvar]
+ compiler.put_cmd = "#{eoutvar}.concat"
+ compiler.insert_cmd = "#{eoutvar}.concat"
+ compiler.pre_cmd = ["#{eoutvar} = ''"]
+ compiler.post_cmd = ["#{eoutvar}.force_encoding(__ENCODING__)"]
end
# Generate results and print them. (see ERB#result)
@@ -870,36 +844,19 @@ class ERB
if @safe_level
proc {
$SAFE = @safe_level
- eval(@src, b, (@filename || '(erb)'), @lineno)
+ eval(@src, b, (@filename || '(erb)'), 0)
}.call
else
- eval(@src, b, (@filename || '(erb)'), @lineno)
- end
- end
-
- # Render a template on a new toplevel binding with local variables specified
- # by a Hash object.
- def result_with_hash(hash)
- b = new_toplevel(hash.keys)
- hash.each_pair do |key, value|
- b.local_variable_set(key, value)
+ eval(@src, b, (@filename || '(erb)'), 0)
end
- result(b)
end
##
# Returns a new binding each time *near* TOPLEVEL_BINDING for runs that do
# not specify a binding.
- def new_toplevel(vars = nil)
- b = TOPLEVEL_BINDING
- if vars
- vars = vars.select {|v| b.local_variable_defined?(v)}
- unless vars.empty?
- return b.eval("tap {|;#{vars.join(',')}| break binding}")
- end
- end
- b.dup
+ def new_toplevel
+ TOPLEVEL_BINDING.dup
end
private :new_toplevel
@@ -911,9 +868,10 @@ class ERB
# erb.def_method(MyClass, 'render(arg1, arg2)', filename)
# print MyClass.new.render('foo', 123)
def def_method(mod, methodname, fname='(ERB)')
- src = self.src.sub(/^(?!#|$)/) {"def #{methodname}\n"} << "\nend\n"
+ src = self.src
+ magic_comment = "#coding:#{@enc}\n"
mod.module_eval do
- eval(src, binding, fname, -1)
+ eval(magic_comment + "def #{methodname}\n" + src + "\nend\n", binding, fname, -2)
end
end
@@ -991,8 +949,8 @@ class ERB
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
#
def url_encode(s)
- s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m|
- sprintf("%%%02X", m.unpack1("C"))
+ s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) { |m|
+ sprintf("%%%02X", m.unpack("C")[0])
}
end
alias u url_encode
diff --git a/lib/fileutils.gemspec b/lib/fileutils.gemspec
deleted file mode 100644
index 5e11587aab..0000000000
--- a/lib/fileutils.gemspec
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "fileutils"
- s.version = '1.0.2'
- s.date = '2017-12-22'
- s.summary = "Several file utility methods for copying, moving, removing, etc."
- s.description = "Several file utility methods for copying, moving, removing, etc."
-
- s.require_path = %w{lib}
- s.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "fileutils.gemspec", "lib/fileutils.rb"]
- s.required_ruby_version = ">= 2.4.0"
-
- s.authors = ["Minero Aoki"]
- s.email = [nil]
- s.homepage = "https://github.com/ruby/fileutils"
- s.license = "BSD-2-Clause"
-
- if s.respond_to?(:metadata=)
- s.metadata = {
- "source_code_uri" => "https://github.com/ruby/fileutils"
- }
- end
-
- s.add_development_dependency 'rake'
-end
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index f56d7f9cb9..23fd19310a 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = fileutils.rb
#
@@ -16,7 +15,7 @@
# require 'fileutils'
#
# FileUtils.cd(dir, options)
-# FileUtils.cd(dir, options) {|dir| block }
+# FileUtils.cd(dir, options) {|dir| .... }
# FileUtils.pwd()
# FileUtils.mkdir(dir, options)
# FileUtils.mkdir(list, options)
@@ -24,11 +23,11 @@
# FileUtils.mkdir_p(list, options)
# FileUtils.rmdir(dir, options)
# FileUtils.rmdir(list, options)
-# FileUtils.ln(target, link, options)
-# FileUtils.ln(targets, dir, options)
-# FileUtils.ln_s(target, link, options)
-# FileUtils.ln_s(targets, dir, options)
-# FileUtils.ln_sf(target, link, 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)
@@ -38,7 +37,7 @@
# FileUtils.rm(list, options)
# FileUtils.rm_r(list, options)
# FileUtils.rm_rf(list, options)
-# FileUtils.install(src, dest, 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)
@@ -47,7 +46,7 @@
#
# 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>.
-# <tt>:noop</tt> means that no changes are made. The other three are obvious.
+# <tt>:noop</tt> means that no changes are made. The other two are obvious.
# Each method documents the options that it honours.
#
# All methods that have the concept of a "source" file or directory can take
@@ -87,13 +86,16 @@
module FileUtils
- VERSION = "1.0.2"
-
def self.private_module_function(name) #:nodoc:
module_function name
private_class_method name
end
+ # This hash table holds command options.
+ OPT_TABLE = {} #:nodoc: internal use only
+
+ #
+ # Options: (none)
#
# Returns the name of the current directory.
#
@@ -106,6 +108,8 @@ module FileUtils
module_function :getwd
#
+ # Options: verbose
+ #
# Changes the current directory to the directory +dir+.
#
# If this method is called with block, resumes to the old
@@ -114,19 +118,25 @@ module FileUtils
# FileUtils.cd('/', :verbose => true) # chdir and report it
#
# FileUtils.cd('/') do # chdir
- # # ... # do something
+ # [...] # do something
# end # return to original directory
#
- def cd(dir, verbose: nil, &block) # :yield: dir
- fu_output_message "cd #{dir}" if verbose
+ def cd(dir, options = {}, &block) # :yield: dir
+ fu_check_options options, OPT_TABLE['cd']
+ fu_output_message "cd #{dir}" if options[:verbose]
Dir.chdir(dir, &block)
- fu_output_message 'cd -' if verbose and block
+ fu_output_message 'cd -' if options[:verbose] and block
end
module_function :cd
alias chdir cd
module_function :chdir
+ OPT_TABLE['cd'] =
+ OPT_TABLE['chdir'] = [:verbose]
+
+ #
+ # Options: (none)
#
# Returns true if +new+ is newer than all +old_list+.
# Non-existent files are older than any file.
@@ -146,12 +156,14 @@ module FileUtils
end
module_function :uptodate?
- def remove_trailing_slash(dir) #:nodoc:
+ def remove_tailing_slash(dir)
dir == '/' ? dir : dir.chomp(?/)
end
- private_module_function :remove_trailing_slash
+ private_module_function :remove_tailing_slash
#
+ # Options: mode noop verbose
+ #
# Creates one or more directories.
#
# FileUtils.mkdir 'test'
@@ -159,17 +171,22 @@ module FileUtils
# FileUtils.mkdir 'notexist', :noop => true # Does not really create.
# FileUtils.mkdir 'tmp', :mode => 0700
#
- def mkdir(list, mode: nil, noop: nil, verbose: nil)
+ def mkdir(list, options = {})
+ fu_check_options options, OPT_TABLE['mkdir']
list = fu_list(list)
- fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
- return if noop
+ fu_output_message "mkdir #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" if options[:verbose]
+ return if options[:noop]
list.each do |dir|
- fu_mkdir dir, mode
+ fu_mkdir dir, options[:mode]
end
end
module_function :mkdir
+ OPT_TABLE['mkdir'] = [:mode, :noop, :verbose]
+
+ #
+ # Options: mode noop verbose
#
# Creates a directory and all its parent directories.
# For example,
@@ -177,23 +194,23 @@ module FileUtils
# FileUtils.mkdir_p '/usr/local/lib/ruby'
#
# causes to make following directories, if it does not exist.
- #
- # * /usr
- # * /usr/local
- # * /usr/local/lib
- # * /usr/local/lib/ruby
+ # * /usr
+ # * /usr/local
+ # * /usr/local/lib
+ # * /usr/local/lib/ruby
#
# You can pass several directories at a time in a list.
#
- def mkdir_p(list, mode: nil, noop: nil, verbose: nil)
+ def mkdir_p(list, options = {})
+ fu_check_options options, OPT_TABLE['mkdir_p']
list = fu_list(list)
- fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
- return *list if noop
+ 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_trailing_slash(path)}.each do |path|
+ list.map {|path| remove_tailing_slash(path)}.each do |path|
# optimize for the most common case
begin
- fu_mkdir path, mode
+ fu_mkdir path, options[:mode]
next
rescue SystemCallError
next if File.directory?(path)
@@ -204,10 +221,9 @@ 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, mode
+ fu_mkdir dir, options[:mode]
rescue SystemCallError
raise unless File.directory?(dir)
end
@@ -223,8 +239,12 @@ module FileUtils
module_function :mkpath
module_function :makedirs
+ OPT_TABLE['mkdir_p'] =
+ OPT_TABLE['mkpath'] =
+ OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]
+
def fu_mkdir(path, mode) #:nodoc:
- path = remove_trailing_slash(path)
+ path = remove_tailing_slash(path)
if mode
Dir.mkdir path, mode
File.chmod mode, path
@@ -235,6 +255,8 @@ module FileUtils
private_module_function :fu_mkdir
#
+ # Options: parents, noop, verbose
+ #
# Removes one or more directories.
#
# FileUtils.rmdir 'somedir'
@@ -242,51 +264,57 @@ module FileUtils
# # Does not really remove directory; outputs message.
# FileUtils.rmdir 'somedir', :verbose => true, :noop => true
#
- def rmdir(list, parents: nil, noop: nil, verbose: nil)
+ def rmdir(list, options = {})
+ fu_check_options options, OPT_TABLE['rmdir']
list = fu_list(list)
- fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose
- return if noop
+ parents = options[:parents]
+ fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if options[:verbose]
+ return if options[:noop]
list.each do |dir|
- Dir.rmdir(dir = remove_trailing_slash(dir))
- if parents
- begin
+ begin
+ Dir.rmdir(dir = remove_tailing_slash(dir))
+ if parents
until (parent = File.dirname(dir)) == '.' or parent == dir
dir = parent
Dir.rmdir(dir)
end
- rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
end
+ rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
end
end
end
module_function :rmdir
+ OPT_TABLE['rmdir'] = [:parents, :noop, :verbose]
+
+ #
+ # Options: force noop verbose
#
- # :call-seq:
- # FileUtils.ln(target, link, force: nil, noop: nil, verbose: nil)
- # FileUtils.ln(target, dir, force: nil, noop: nil, verbose: nil)
- # FileUtils.ln(targets, dir, force: nil, noop: nil, verbose: nil)
+ # <b><tt>ln(old, new, options = {})</tt></b>
#
- # In the first form, creates a hard link +link+ which points to +target+.
- # If +link+ already exists, raises Errno::EEXIST.
- # But if the :force option is set, overwrites +link+.
+ # Creates a hard link +new+ which points to +old+.
+ # If +new+ already exists and it is a directory, creates a link +new/old+.
+ # If +new+ already exists and it is not a directory, raises Errno::EEXIST.
+ # But if :force option is set, overwrite +new+.
#
- # FileUtils.ln 'gcc', 'cc', verbose: true
+ # FileUtils.ln 'gcc', 'cc', :verbose => true
# FileUtils.ln '/usr/bin/emacs21', '/usr/bin/emacs'
#
- # In the second form, creates a link +dir/target+ pointing to +target+.
- # In the third form, creates several hard links in the directory +dir+,
- # pointing to each item in +targets+.
- # If +dir+ is not a directory, raises Errno::ENOTDIR.
+ # <b><tt>ln(list, destdir, options = {})</tt></b>
+ #
+ # Creates several hard links in a directory, with each one pointing to the
+ # item in +list+. If +destdir+ is not a directory, raises Errno::ENOTDIR.
#
- # FileUtils.cd '/sbin'
+ # include FileUtils
+ # cd '/sbin'
# FileUtils.ln %w(cp mv mkdir), '/bin' # Now /sbin/cp and /bin/cp are linked.
#
- def ln(src, dest, force: nil, noop: nil, verbose: nil)
- fu_output_message "ln#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
+ def ln(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['ln']
+ fu_output_message "ln#{options[:force] ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+ return if options[:noop]
fu_each_src_dest0(src, dest) do |s,d|
- remove_file d, true if force
+ remove_file d, true if options[:force]
File.link s, d
end
end
@@ -295,31 +323,37 @@ module FileUtils
alias link ln
module_function :link
+ OPT_TABLE['ln'] =
+ OPT_TABLE['link'] = [:force, :noop, :verbose]
+
+ #
+ # Options: force noop verbose
#
- # :call-seq:
- # FileUtils.ln_s(target, link, force: nil, noop: nil, verbose: nil)
- # FileUtils.ln_s(target, dir, force: nil, noop: nil, verbose: nil)
- # FileUtils.ln_s(targets, dir, force: nil, noop: nil, verbose: nil)
+ # <b><tt>ln_s(old, new, options = {})</tt></b>
#
- # In the first form, creates a symbolic link +link+ which points to +target+.
- # If +link+ already exists, raises Errno::EEXIST.
- # But if the :force option is set, overwrites +link+.
+ # Creates a symbolic link +new+ which points to +old+. If +new+ already
+ # exists and it is a directory, creates a symbolic link +new/old+. If +new+
+ # already exists and it is not a directory, raises Errno::EEXIST. But if
+ # :force option is set, overwrite +new+.
#
# FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
- # FileUtils.ln_s 'verylongsourcefilename.c', 'c', force: true
+ # FileUtils.ln_s 'verylongsourcefilename.c', 'c', :force => true
#
- # In the second form, creates a link +dir/target+ pointing to +target+.
- # In the third form, creates several symbolic links in the directory +dir+,
- # pointing to each item in +targets+.
- # If +dir+ is not a directory, raises Errno::ENOTDIR.
+ # <b><tt>ln_s(list, destdir, options = {})</tt></b>
#
- # FileUtils.ln_s Dir.glob('/bin/*.rb'), '/home/foo/bin'
+ # Creates several symbolic links in a directory, with each one pointing to the
+ # item in +list+. If +destdir+ is not a directory, raises Errno::ENOTDIR.
#
- def ln_s(src, dest, force: nil, noop: nil, verbose: nil)
- fu_output_message "ln -s#{force ? 'f' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
+ # If +destdir+ is not a directory, raises Errno::ENOTDIR.
+ #
+ # FileUtils.ln_s Dir.glob('bin/*.rb'), '/home/aamine/bin'
+ #
+ def ln_s(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['ln_s']
+ fu_output_message "ln -s#{options[:force] ? 'f' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+ return if options[:noop]
fu_each_src_dest0(src, dest) do |s,d|
- remove_file d, true if force
+ remove_file d, true if options[:force]
File.symlink s, d
end
end
@@ -328,19 +362,27 @@ module FileUtils
alias symlink ln_s
module_function :symlink
+ OPT_TABLE['ln_s'] =
+ OPT_TABLE['symlink'] = [:force, :noop, :verbose]
+
#
- # :call-seq:
- # FileUtils.ln_sf(*args)
+ # Options: noop verbose
#
# Same as
+ # #ln_s(src, dest, :force => true)
#
- # FileUtils.ln_s(*args, force: true)
- #
- def ln_sf(src, dest, noop: nil, verbose: nil)
- ln_s src, dest, force: true, noop: noop, verbose: verbose
+ def ln_sf(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['ln_sf']
+ options = options.dup
+ options[:force] = true
+ ln_s src, dest, options
end
module_function :ln_sf
+ OPT_TABLE['ln_sf'] = [:noop, :verbose]
+
+ #
+ # Options: preserve noop verbose
#
# Copies a file content +src+ to +dest+. If +dest+ is a directory,
# copies +src+ to +dest/src+.
@@ -352,11 +394,12 @@ module FileUtils
# FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', :verbose => true
# FileUtils.cp 'symlink', 'dest' # copy content, "dest" is not a symlink
#
- def cp(src, dest, preserve: nil, noop: nil, verbose: nil)
- fu_output_message "cp#{preserve ? ' -p' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
+ def cp(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['cp']
+ fu_output_message "cp#{options[:preserve] ? ' -p' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+ return if options[:noop]
fu_each_src_dest(src, dest) do |s, d|
- copy_file s, d, preserve
+ copy_file s, d, options[:preserve]
end
end
module_function :cp
@@ -364,6 +407,11 @@ module FileUtils
alias copy cp
module_function :copy
+ OPT_TABLE['cp'] =
+ OPT_TABLE['copy'] = [:preserve, :noop, :verbose]
+
+ #
+ # Options: preserve noop verbose dereference_root remove_destination
#
# Copies +src+ to +dest+. If +src+ is a directory, this method copies
# all its contents recursively. If +dest+ is a directory, copies
@@ -377,7 +425,7 @@ module FileUtils
#
# # Examples of copying several files to target directory.
# FileUtils.cp_r %w(mail.rb field.rb debug/), site_ruby + '/tmail'
- # FileUtils.cp_r Dir.glob('*.rb'), '/home/foo/lib/ruby', :noop => true, :verbose => true
+ # FileUtils.cp_r Dir.glob('*.rb'), '/home/aamine/lib/ruby', :noop => true, :verbose => true
#
# # If you want to copy all contents of a directory instead of the
# # directory itself, c.f. src/x -> dest/x, src/y -> dest/y,
@@ -385,16 +433,21 @@ module FileUtils
# FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes dest/src,
# # but this doesn't.
#
- def cp_r(src, dest, preserve: nil, noop: nil, verbose: nil,
- dereference_root: true, remove_destination: nil)
- fu_output_message "cp -r#{preserve ? 'p' : ''}#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
+ def cp_r(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['cp_r']
+ fu_output_message "cp -r#{options[:preserve] ? 'p' : ''}#{options[:remove_destination] ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+ return if options[:noop]
+ options = options.dup
+ options[:dereference_root] = true unless options.key?(:dereference_root)
fu_each_src_dest(src, dest) do |s, d|
- copy_entry s, d, preserve, dereference_root, remove_destination
+ copy_entry s, d, options[:preserve], options[:dereference_root], options[:remove_destination]
end
end
module_function :cp_r
+ OPT_TABLE['cp_r'] = [:preserve, :noop, :verbose,
+ :dereference_root, :remove_destination]
+
#
# Copies a file system entry +src+ to +dest+.
# If +src+ is a directory, this method copies its contents recursively.
@@ -414,7 +467,7 @@ module FileUtils
def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
Entry_.new(src, nil, dereference_root).wrap_traverse(proc do |ent|
destent = Entry_.new(dest, ent.rel, false)
- File.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path))
+ File.unlink destent.path if remove_destination && File.file?(destent.path)
ent.copy destent.path
end, proc do |ent|
destent = Entry_.new(dest, ent.rel, false)
@@ -445,24 +498,27 @@ module FileUtils
module_function :copy_stream
#
+ # Options: force noop verbose
+ #
# Moves file(s) +src+ to +dest+. If +file+ and +dest+ exist on the different
# disk partition, the file is copied then the original file is removed.
#
# FileUtils.mv 'badname.rb', 'goodname.rb'
# FileUtils.mv 'stuff.rb', '/notexist/lib/ruby', :force => true # no error
#
- # FileUtils.mv %w(junk.txt dust.txt), '/home/foo/.trash/'
+ # FileUtils.mv %w(junk.txt dust.txt), '/home/aamine/.trash/'
# FileUtils.mv Dir.glob('test*.rb'), 'test', :noop => true, :verbose => true
#
- def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
- fu_output_message "mv#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
+ def mv(src, dest, options = {})
+ fu_check_options options, OPT_TABLE['mv']
+ fu_output_message "mv#{options[:force] ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
+ return if options[:noop]
fu_each_src_dest(src, dest) do |s, d|
destent = Entry_.new(d, nil, true)
begin
if destent.exist?
if destent.directory?
- raise Errno::EEXIST, d
+ raise Errno::EEXIST, dest
else
destent.remove_file if rename_cannot_overwrite_file?
end
@@ -471,14 +527,14 @@ module FileUtils
File.rename s, d
rescue Errno::EXDEV
copy_entry s, d, true
- if secure
- remove_entry_secure s, force
+ if options[:secure]
+ remove_entry_secure s, options[:force]
else
- remove_entry s, force
+ remove_entry s, options[:force]
end
end
rescue SystemCallError
- raise unless force
+ raise unless options[:force]
end
end
end
@@ -487,12 +543,17 @@ module FileUtils
alias move mv
module_function :move
+ OPT_TABLE['mv'] =
+ OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
+
def rename_cannot_overwrite_file? #:nodoc:
- /emx/ =~ RUBY_PLATFORM
+ /cygwin|mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
end
private_module_function :rename_cannot_overwrite_file?
#
+ # Options: force noop verbose
+ #
# Remove file(s) specified in +list+. This method cannot remove directories.
# All StandardErrors are ignored when the :force option is set.
#
@@ -500,13 +561,14 @@ module FileUtils
# FileUtils.rm Dir.glob('*.so')
# FileUtils.rm 'NotExistFile', :force => true # never raises exception
#
- def rm(list, force: nil, noop: nil, verbose: nil)
+ def rm(list, options = {})
+ fu_check_options options, OPT_TABLE['rm']
list = fu_list(list)
- fu_output_message "rm#{force ? ' -f' : ''} #{list.join ' '}" if verbose
- return if noop
+ fu_output_message "rm#{options[:force] ? ' -f' : ''} #{list.join ' '}" if options[:verbose]
+ return if options[:noop]
list.each do |path|
- remove_file path, force
+ remove_file path, options[:force]
end
end
module_function :rm
@@ -514,26 +576,39 @@ module FileUtils
alias remove rm
module_function :remove
+ OPT_TABLE['rm'] =
+ OPT_TABLE['remove'] = [:force, :noop, :verbose]
+
+ #
+ # Options: noop verbose
#
# Equivalent to
#
- # FileUtils.rm(list, :force => true)
+ # #rm(list, :force => true)
#
- def rm_f(list, noop: nil, verbose: nil)
- rm list, force: true, noop: noop, verbose: verbose
+ def rm_f(list, options = {})
+ fu_check_options options, OPT_TABLE['rm_f']
+ options = options.dup
+ options[:force] = true
+ rm list, options
end
module_function :rm_f
alias safe_unlink rm_f
module_function :safe_unlink
+ OPT_TABLE['rm_f'] =
+ OPT_TABLE['safe_unlink'] = [:noop, :verbose]
+
+ #
+ # Options: force noop verbose secure
#
# remove files +list+[0] +list+[1]... If +list+[n] is a directory,
# removes its all contents recursively. This method ignores
# StandardError when :force option is set.
#
# FileUtils.rm_r Dir.glob('/tmp/*')
- # FileUtils.rm_r 'some_dir', :force => true
+ # FileUtils.rm_r '/', :force => true # :-)
#
# WARNING: This method causes local vulnerability
# if one of parent directories or removing directory tree are world
@@ -546,36 +621,48 @@ module FileUtils
# NOTE: This method calls #remove_entry_secure if :secure option is set.
# See also #remove_entry_secure.
#
- def rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
+ def rm_r(list, options = {})
+ fu_check_options options, OPT_TABLE['rm_r']
+ # options[:secure] = true unless options.key?(:secure)
list = fu_list(list)
- fu_output_message "rm -r#{force ? 'f' : ''} #{list.join ' '}" if verbose
- return if noop
+ fu_output_message "rm -r#{options[:force] ? 'f' : ''} #{list.join ' '}" if options[:verbose]
+ return if options[:noop]
list.each do |path|
- if secure
- remove_entry_secure path, force
+ if options[:secure]
+ remove_entry_secure path, options[:force]
else
- remove_entry path, force
+ remove_entry path, options[:force]
end
end
end
module_function :rm_r
+ OPT_TABLE['rm_r'] = [:force, :noop, :verbose, :secure]
+
+ #
+ # Options: noop verbose secure
#
# Equivalent to
#
- # FileUtils.rm_r(list, :force => true)
+ # #rm_r(list, :force => true)
#
# WARNING: This method causes local vulnerability.
# Read the documentation of #rm_r first.
#
- def rm_rf(list, noop: nil, verbose: nil, secure: nil)
- rm_r list, force: true, noop: noop, verbose: verbose, secure: secure
+ def rm_rf(list, options = {})
+ fu_check_options options, OPT_TABLE['rm_rf']
+ options = options.dup
+ options[:force] = true
+ rm_r list, options
end
module_function :rm_rf
alias rmtree rm_rf
module_function :rmtree
+ OPT_TABLE['rm_rf'] =
+ OPT_TABLE['rmtree'] = [:noop, :verbose, :secure]
+
#
# This method removes a file system entry +path+. +path+ shall be a
# regular file, a directory, or something. If +path+ is a directory,
@@ -583,9 +670,9 @@ module FileUtils
# (time-of-check-to-time-of-use) local security vulnerability of #rm_r.
# #rm_r causes security hole when:
#
- # * Parent directory is world writable (including /tmp).
- # * Removing directory tree includes world writable directory.
- # * The system has symbolic link.
+ # * Parent directory is world writable (including /tmp).
+ # * Removing directory tree includes world writable directory.
+ # * The system has symbolic link.
#
# To avoid this security hole, this method applies special preprocess.
# If +path+ is a directory, this method chown(2) and chmod(2) all
@@ -603,8 +690,8 @@ module FileUtils
#
# For details of this security vulnerability, see Perl's case:
#
- # * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
- # * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452
+ # http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
+ # http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452
#
# For fileutils.rb, this vulnerability is reported in [ruby-dev:26100].
#
@@ -719,10 +806,10 @@ module FileUtils
module_function :remove_dir
#
- # Returns true if the contents of a file +a+ and a file +b+ are identical.
+ # Returns true if the contents of a file A and a file B are identical.
#
- # FileUtils.compare_file('somefile', 'somefile') #=> true
- # FileUtils.compare_file('/dev/null', '/dev/urandom') #=> false
+ # FileUtils.compare_file('somefile', 'somefile') #=> true
+ # FileUtils.compare_file('/bin/cp', '/bin/mv') #=> maybe false
#
def compare_file(a, b)
return false unless File.size(a) == File.size(b)
@@ -744,8 +831,8 @@ module FileUtils
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
- sa = String.new(capacity: bsize)
- sb = String.new(capacity: bsize)
+ sa = ""
+ sb = ""
begin
a.read(bsize, sa)
b.read(bsize, sb)
@@ -756,6 +843,8 @@ module FileUtils
module_function :compare_stream
#
+ # Options: mode preserve noop verbose
+ #
# If +src+ is not same as +dest+, copies it and changes the permission
# mode to +mode+. If +dest+ is a directory, destination is +dest+/+src+.
# This method removes destination before copy.
@@ -763,33 +852,24 @@ module FileUtils
# FileUtils.install 'ruby', '/usr/local/bin/ruby', :mode => 0755, :verbose => true
# FileUtils.install 'lib.rb', '/usr/local/lib/ruby/site_ruby', :verbose => true
#
- def install(src, dest, mode: nil, owner: nil, group: nil, preserve: nil,
- noop: nil, verbose: nil)
- if verbose
- msg = +"install -c"
- msg << ' -p' if preserve
- msg << ' -m ' << mode_to_s(mode) if mode
- msg << " -o #{owner}" if owner
- msg << " -g #{group}" if group
- msg << ' ' << [src,dest].flatten.join(' ')
- fu_output_message msg
- end
- return if noop
- uid = fu_get_uid(owner)
- gid = fu_get_gid(group)
+ def install(src, dest, options = {})
+ 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 = File.stat(s)
unless File.exist?(d) and compare_file(s, d)
remove_file d, true
copy_file s, d
- File.utime st.atime, st.mtime, d if preserve
- File.chmod fu_mode(mode, st), d if mode
- File.chown uid, gid, d if uid or gid
+ File.utime st.atime, st.mtime, d if options[:preserve]
+ File.chmod options[:mode], d if options[:mode]
end
end
end
module_function :install
+ OPT_TABLE['install'] = [:mode, :preserve, :noop, :verbose]
+
def user_mask(target) #:nodoc:
target.each_char.inject(0) do |mask, chr|
case chr
@@ -808,7 +888,7 @@ module FileUtils
end
private_module_function :user_mask
- def apply_mask(mode, user_mask, op, mode_mask) #:nodoc:
+ def apply_mask(mode, user_mask, op, mode_mask)
case op
when '='
(mode & ~user_mask) | (user_mask & mode_mask)
@@ -821,12 +901,7 @@ module FileUtils
private_module_function :apply_mask
def symbolic_modes_to_i(mode_sym, path) #:nodoc:
- mode = if File::Stat === path
- path.mode
- else
- File.stat(path).mode
- end
- mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
+ mode_sym.split(/,/).inject(File.stat(path).mode & 07777) do |current_mode, clause|
target, *actions = clause.split(/([=+-])/)
raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
target = 'a' if target.empty?
@@ -883,6 +958,8 @@ module FileUtils
private_module_function :mode_to_s
#
+ # Options: noop verbose
+ #
# Changes permission bits on the named files (in +list+) to the bit pattern
# represented by +mode+.
#
@@ -913,16 +990,21 @@ module FileUtils
# "-" :: Is removed from a given class given mode.
# "=" :: Is the exact nature of the class will be given a specified mode.
- def chmod(mode, list, noop: nil, verbose: nil)
+ def chmod(mode, list, options = {})
+ fu_check_options options, OPT_TABLE['chmod']
list = fu_list(list)
- fu_output_message sprintf('chmod %s %s', mode_to_s(mode), list.join(' ')) if verbose
- return if noop
+ fu_output_message sprintf('chmod %s %s', mode_to_s(mode), list.join(' ')) if options[:verbose]
+ return if options[:noop]
list.each do |path|
Entry_.new(path).chmod(fu_mode(mode, path))
end
end
module_function :chmod
+ OPT_TABLE['chmod'] = [:noop, :verbose]
+
+ #
+ # Options: noop verbose force
#
# Changes permission bits on the named files (in +list+)
# to the bit pattern represented by +mode+.
@@ -930,24 +1012,29 @@ module FileUtils
# FileUtils.chmod_R 0700, "/tmp/app.#{$$}"
# FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"
#
- def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
+ def chmod_R(mode, list, options = {})
+ fu_check_options options, OPT_TABLE['chmod_R']
list = fu_list(list)
fu_output_message sprintf('chmod -R%s %s %s',
- (force ? 'f' : ''),
- mode_to_s(mode), list.join(' ')) if verbose
- return if noop
+ (options[:force] ? 'f' : ''),
+ mode_to_s(mode), list.join(' ')) if options[:verbose]
+ return if options[:noop]
list.each do |root|
Entry_.new(root).traverse do |ent|
begin
ent.chmod(fu_mode(mode, ent.path))
rescue
- raise unless force
+ raise unless options[:force]
end
end
end
end
module_function :chmod_R
+ OPT_TABLE['chmod_R'] = [:noop, :verbose, :force]
+
+ #
+ # Options: noop verbose
#
# Changes owner and group on the named files (in +list+)
# to the user +user+ and the group +group+. +user+ and +group+
@@ -958,12 +1045,13 @@ module FileUtils
# FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
# FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), :verbose => true
#
- def chown(user, group, list, noop: nil, verbose: nil)
+ def chown(user, group, list, options = {})
+ fu_check_options options, OPT_TABLE['chown']
list = fu_list(list)
fu_output_message sprintf('chown %s %s',
(group ? "#{user}:#{group}" : user || ':'),
- list.join(' ')) if verbose
- return if noop
+ list.join(' ')) if options[:verbose]
+ return if options[:noop]
uid = fu_get_uid(user)
gid = fu_get_gid(group)
list.each do |path|
@@ -972,6 +1060,10 @@ module FileUtils
end
module_function :chown
+ OPT_TABLE['chown'] = [:noop, :verbose]
+
+ #
+ # Options: noop verbose force
#
# Changes owner and group on the named files (in +list+)
# to the user +user+ and the group +group+ recursively.
@@ -982,13 +1074,14 @@ module FileUtils
# FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
# FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', :verbose => true
#
- def chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
+ def chown_R(user, group, list, options = {})
+ fu_check_options options, OPT_TABLE['chown_R']
list = fu_list(list)
fu_output_message sprintf('chown -R%s %s %s',
- (force ? 'f' : ''),
+ (options[:force] ? 'f' : ''),
(group ? "#{user}:#{group}" : user || ':'),
- list.join(' ')) if verbose
- return if noop
+ list.join(' ')) if options[:verbose]
+ return if options[:noop]
uid = fu_get_uid(user)
gid = fu_get_gid(group)
list.each do |root|
@@ -996,13 +1089,15 @@ module FileUtils
begin
ent.chown uid, gid
rescue
- raise unless force
+ raise unless options[:force]
end
end
end
end
module_function :chown_R
+ OPT_TABLE['chown_R'] = [:noop, :verbose, :force]
+
begin
require 'etc'
rescue LoadError # rescue LoadError for miniruby
@@ -1035,19 +1130,23 @@ module FileUtils
private_module_function :fu_get_gid
#
+ # 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.
#
# FileUtils.touch 'timestamp'
# FileUtils.touch Dir.glob('*.c'); system 'make'
#
- def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
+ def touch(list, options = {})
+ fu_check_options options, OPT_TABLE['touch']
list = fu_list(list)
- t = mtime
- if verbose
+ nocreate = options[:nocreate]
+ t = options[:mtime]
+ if options[:verbose]
fu_output_message "touch #{nocreate ? '-c ' : ''}#{t ? t.strftime('-t %Y%m%d%H%M.%S ') : ''}#{list.join ' '}"
end
- return if noop
+ return if options[:noop]
list.each do |path|
created = nocreate
begin
@@ -1064,6 +1163,8 @@ module FileUtils
end
module_function :touch
+ OPT_TABLE['touch'] = [:noop, :verbose, :mtime, :nocreate]
+
private
module StreamUtils_
@@ -1253,7 +1354,6 @@ module FileUtils
end
def copy(dest)
- lstat
case
when file?
copy_file dest
@@ -1300,7 +1400,6 @@ module FileUtils
if !st.symlink?
File.utime st.atime, st.mtime, path
end
- mode = st.mode
begin
if st.symlink?
begin
@@ -1310,17 +1409,25 @@ module FileUtils
else
File.chown st.uid, st.gid, path
end
- rescue Errno::EPERM, Errno::EACCES
+ rescue Errno::EPERM
# clear setuid/setgid
- mode &= 01777
- end
- if st.symlink?
- begin
- File.lchmod mode, path
- rescue NotImplementedError
+ if st.symlink?
+ begin
+ File.lchmod st.mode & 01777, path
+ rescue NotImplementedError
+ end
+ else
+ File.chmod st.mode & 01777, path
end
else
- File.chmod mode, path
+ if st.symlink?
+ begin
+ File.lchmod st.mode, path
+ rescue NotImplementedError
+ end
+ else
+ File.chmod st.mode, path
+ end
end
end
@@ -1441,9 +1548,9 @@ module FileUtils
end
if File::ALT_SEPARATOR
- DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)"
+ DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)".freeze
else
- DIRECTORY_TERM = "(?=/|\\z)"
+ DIRECTORY_TERM = "(?=/|\\z)".freeze
end
SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
@@ -1487,6 +1594,25 @@ module FileUtils
end
private_module_function :fu_same?
+ def fu_check_options(options, optdecl) #:nodoc:
+ h = options.dup
+ optdecl.each do |opt|
+ h.delete opt
+ end
+ raise ArgumentError, "no such option: #{h.keys.join(' ')}" unless h.empty?
+ end
+ private_module_function :fu_check_options
+
+ def fu_update_option(args, new) #:nodoc:
+ if tmp = Hash.try_convert(args.last)
+ args[-1] = tmp.dup.update(new)
+ else
+ args.push new
+ end
+ args
+ end
+ private_module_function :fu_update_option
+
@fileutils_output = $stderr
@fileutils_label = ''
@@ -1497,19 +1623,12 @@ module FileUtils
end
private_module_function :fu_output_message
- # This hash table holds command options.
- OPT_TABLE = {} #:nodoc: internal use only
- (private_instance_methods & methods(false)).inject(OPT_TABLE) {|tbl, name|
- (tbl[name.to_s] = instance_method(name).parameters).map! {|t, n| n if t == :key}.compact!
- tbl
- }
-
#
# Returns an Array of method names which have any options.
#
# p FileUtils.commands #=> ["chmod", "cp", "cp_r", "install", ...]
#
- def self.commands
+ def FileUtils.commands
OPT_TABLE.keys
end
@@ -1518,7 +1637,7 @@ module FileUtils
#
# p FileUtils.options #=> ["noop", "force", "verbose", "preserve", "mode"]
#
- def self.options
+ def FileUtils.options
OPT_TABLE.values.flatten.uniq.map {|sym| sym.to_s }
end
@@ -1529,7 +1648,7 @@ module FileUtils
# p FileUtils.have_option?(:rm, :force) #=> true
# p FileUtils.have_option?(:rm, :preserve) #=> false
#
- def self.have_option?(mid, opt)
+ def FileUtils.have_option?(mid, opt)
li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}"
li.include?(opt)
end
@@ -1539,7 +1658,7 @@ module FileUtils
#
# p FileUtils.options_of(:rm) #=> ["noop", "verbose", "force"]
#
- def self.options_of(mid)
+ def FileUtils.options_of(mid)
OPT_TABLE[mid.to_s].map {|sym| sym.to_s }
end
@@ -1548,15 +1667,14 @@ module FileUtils
#
# p FileUtils.collect_method(:preserve) #=> ["cp", "cp_r", "copy", "install"]
#
- def self.collect_method(opt)
+ def FileUtils.collect_method(opt)
OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
end
LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern)
module LowMethods
- private
- def _do_nothing(*)end
- ::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
+ module_eval("private\n" + ::FileUtils::LOW_METHODS.map {|name| "def #{name}(*)end"}.join("\n"),
+ __FILE__, __LINE__)
end
METHODS = singleton_methods() - [:private_module_function,
@@ -1571,18 +1689,19 @@ module FileUtils
include FileUtils
@fileutils_output = $stderr
@fileutils_label = ''
- names = ::FileUtils.collect_method(:verbose)
- names.each do |name|
+ ::FileUtils.collect_method(:verbose).each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, verbose: true)
+ def #{name}(*args)
+ super(*fu_update_option(args, :verbose => true))
end
+ private :#{name}
EOS
end
- private(*names)
extend self
class << self
- public(*::FileUtils::METHODS)
+ ::FileUtils::METHODS.each do |m|
+ public m
+ end
end
end
@@ -1596,18 +1715,19 @@ module FileUtils
include LowMethods
@fileutils_output = $stderr
@fileutils_label = ''
- names = ::FileUtils.collect_method(:noop)
- names.each do |name|
+ ::FileUtils.collect_method(:noop).each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, noop: true)
+ def #{name}(*args)
+ super(*fu_update_option(args, :noop => true))
end
+ private :#{name}
EOS
end
- private(*names)
extend self
class << self
- public(*::FileUtils::METHODS)
+ ::FileUtils::METHODS.each do |m|
+ public m
+ end
end
end
@@ -1622,18 +1742,19 @@ module FileUtils
include LowMethods
@fileutils_output = $stderr
@fileutils_label = ''
- names = ::FileUtils.collect_method(:noop)
- names.each do |name|
+ ::FileUtils.collect_method(:noop).each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, noop: true, verbose: true)
+ def #{name}(*args)
+ super(*fu_update_option(args, :noop => true, :verbose => true))
end
+ private :#{name}
EOS
end
- private(*names)
extend self
class << self
- public(*::FileUtils::METHODS)
+ ::FileUtils::METHODS.each do |m|
+ public m
+ end
end
end
diff --git a/lib/find.rb b/lib/find.rb
index f97cc1b836..46e2512b9e 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# find.rb: the Find module for processing all files under a given directory.
#
@@ -40,8 +39,7 @@ module Find
fs_encoding = Encoding.find("filesystem")
- paths.collect!{|d| raise Errno::ENOENT, d unless File.exist?(d); d.dup}.each do |path|
- path = path.to_path if path.respond_to? :to_path
+ paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}.each do |path|
enc = path.encoding == Encoding::US_ASCII ? fs_encoding : path.encoding
ps = [path]
while file = ps.shift
@@ -55,13 +53,14 @@ module Find
end
if s.directory? then
begin
- fs = Dir.children(file, encoding: enc)
+ 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!
fs.reverse_each {|f|
+ next if f == "." or f == ".."
f = File.join(file, f)
ps.unshift f.untaint
}
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index a8e5aa1d5a..ecc5f03843 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# forwardable.rb -
# $Release Version: 1.1$
@@ -110,14 +109,15 @@
# +delegate.rb+.
#
module Forwardable
- require 'forwardable/impl'
-
# Version of +forwardable.rb+
- FORWARDABLE_VERSION = "1.2.0"
+ FORWARDABLE_VERSION = "1.1.0"
+
+ FILE_REGEXP = %r"#{Regexp.quote(__FILE__)}"
@debug = nil
class << self
- # ignored
+ # If true, <tt>__FILE__</tt> will remain in the backtrace in the event an
+ # Exception is raised.
attr_accessor :debug
end
@@ -130,13 +130,12 @@ module Forwardable
# delegate [method, method, ...] => accessor
#
def instance_delegate(hash)
- hash.each do |methods, accessor|
- unless defined?(methods.each)
- def_instance_delegator(accessor, methods)
- else
- methods.each {|method| def_instance_delegator(accessor, method)}
- end
- end
+ hash.each{ |methods, accessor|
+ methods = [methods] unless methods.respond_to?(:each)
+ methods.each{ |method|
+ def_instance_delegator(accessor, method)
+ }
+ }
end
#
@@ -178,54 +177,28 @@ module Forwardable
# q.push 23 #=> NoMethodError
#
def def_instance_delegator(accessor, method, ali = method)
- gen = Forwardable._delegator_method(self, accessor, method, ali)
-
+ 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
- (Module === self ? self : singleton_class).module_eval(&gen)
+ begin
+ module_eval(str, __FILE__, line_no)
+ rescue
+ instance_eval(str, __FILE__, line_no)
+ end
+
end
alias delegate instance_delegate
alias def_delegators def_instance_delegators
alias def_delegator def_instance_delegator
-
- # :nodoc:
- 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
-
- method_call = ".__send__(:#{method}, *args, &block)"
- if _valid_method?(method)
- loc, = caller_locations(2,1)
- pre = "_ ="
- mesg = "#{Module === obj ? obj : obj.class}\##{ali} at #{loc.path}:#{loc.lineno} forwarding to private method "
- method_call = "#{<<-"begin;"}\n#{<<-"end;".chomp}"
- begin;
- unless defined? _.#{method}
- ::Kernel.warn #{mesg.dump}"\#{_.class}"'##{method}', uplevel: 1
- _#{method_call}
- else
- _.#{method}(*args, &block)
- end
- end;
- end
-
- _compile_method("#{<<-"begin;"}\n#{<<-"end;"}", __FILE__, __LINE__+1)
- begin;
- proc do
- def #{ali}(*args, &block)
- #{pre}
- begin
- #{accessor}
- end#{method_call}#{FILTER_EXCEPTION}
- end
- end
- end;
- end
end
# SingleForwardable can be used to setup delegation at the object level as well.
@@ -262,13 +235,12 @@ module SingleForwardable
# delegate [method, method, ...] => accessor
#
def single_delegate(hash)
- hash.each do |methods, accessor|
- unless defined?(methods.each)
- def_single_delegator(accessor, methods)
- else
- methods.each {|method| def_single_delegator(accessor, method)}
- end
- end
+ hash.each{ |methods, accessor|
+ methods = [methods] unless methods.respond_to?(:each)
+ methods.each{ |method|
+ def_single_delegator(accessor, method)
+ }
+ }
end
#
@@ -297,9 +269,18 @@ 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)
- gen = Forwardable._delegator_method(self, accessor, method, ali)
+ 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
+ }
- instance_eval(&gen)
+ instance_eval(str, __FILE__, __LINE__)
end
alias delegate single_delegate
diff --git a/lib/forwardable/impl.rb b/lib/forwardable/impl.rb
deleted file mode 100644
index 220d25aa95..0000000000
--- a/lib/forwardable/impl.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# :stopdoc:
-module Forwardable
- FILE_REGEXP = %r"#{Regexp.quote(File.dirname(__FILE__))}"
- FILTER_EXCEPTION = <<-'END'
-
- rescue ::Exception
- $@.delete_if {|s| ::Forwardable::FILE_REGEXP =~ s} unless ::Forwardable::debug
- ::Kernel::raise
- END
-
- def self._valid_method?(method)
- catch {|tag|
- eval("BEGIN{throw tag}; ().#{method}", binding, __FILE__, __LINE__)
- }
- rescue SyntaxError
- false
- else
- true
- end
-
- def self._compile_method(src, file, line)
- eval(src, nil, file, line)
- end
-end
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index ff7674f1cb..cf635f0438 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# GetoptLong for Ruby
#
@@ -153,7 +152,7 @@ class GetoptLong
#
# Whether error messages are output to $stderr.
#
- @quiet = false
+ @quiet = FALSE
#
# Status code.
@@ -310,7 +309,7 @@ class GetoptLong
#
next if i == argument_flag
begin
- if !i.is_a?(String) || i !~ /\A-([^-]|-.+)\z/
+ if !i.is_a?(String) || i !~ /^-([^-]|-.+)$/
raise ArgumentError, "an invalid option `#{i}'"
end
if (@canonical_names.include?(i))
@@ -447,7 +446,7 @@ class GetoptLong
terminate
return nil
elsif @ordering == PERMUTE
- while 0 < ARGV.length && ARGV[0] !~ /\A-./
+ while 0 < ARGV.length && ARGV[0] !~ /^-./
@non_option_arguments.push(ARGV.shift)
end
if ARGV.length == 0
@@ -456,7 +455,7 @@ class GetoptLong
end
argument = ARGV.shift
elsif @ordering == REQUIRE_ORDER
- if (ARGV[0] !~ /\A-./)
+ if (ARGV[0] !~ /^-./)
terminate
return nil
end
@@ -477,7 +476,7 @@ class GetoptLong
#
# Check for long and short options.
#
- if argument =~ /\A(--[^=]+)/ && @rest_singles.length == 0
+ if argument =~ /^(--[^=]+)/ && @rest_singles.length == 0
#
# This is a long style option, which start with `--'.
#
@@ -507,7 +506,7 @@ class GetoptLong
# Check an argument to the option.
#
if @argument_flags[option_name] == REQUIRED_ARGUMENT
- if argument =~ /=(.*)/m
+ if argument =~ /=(.*)$/
option_argument = $1
elsif 0 < ARGV.length
option_argument = ARGV.shift
@@ -516,19 +515,19 @@ class GetoptLong
"option `#{argument}' requires an argument")
end
elsif @argument_flags[option_name] == OPTIONAL_ARGUMENT
- if argument =~ /=(.*)/m
+ if argument =~ /=(.*)$/
option_argument = $1
- elsif 0 < ARGV.length && ARGV[0] !~ /\A-./
+ elsif 0 < ARGV.length && ARGV[0] !~ /^-./
option_argument = ARGV.shift
else
option_argument = ''
end
- elsif argument =~ /=(.*)/m
+ elsif argument =~ /=(.*)$/
set_error(NeedlessArgument,
"option `#{option_name}' doesn't allow an argument")
end
- elsif argument =~ /\A(-(.))(.*)/m
+ elsif argument =~ /^(-(.))(.*)/
#
# This is a short style option, which start with `-' (not `--').
# Short options may be catenated (e.g. `-l -g' is equivalent to
@@ -555,7 +554,7 @@ class GetoptLong
if 0 < @rest_singles.length
option_argument = @rest_singles
@rest_singles = ''
- elsif 0 < ARGV.length && ARGV[0] !~ /\A-./
+ elsif 0 < ARGV.length && ARGV[0] !~ /^-./
option_argument = ARGV.shift
else
option_argument = ''
@@ -575,7 +574,7 @@ class GetoptLong
else
#
# This is a non-option argument.
- # Only RETURN_IN_ORDER fell into here.
+ # Only RETURN_IN_ORDER falled into here.
#
return '', argument
end
diff --git a/lib/ipaddr.gemspec b/lib/ipaddr.gemspec
deleted file mode 100644
index 16df1708b0..0000000000
--- a/lib/ipaddr.gemspec
+++ /dev/null
@@ -1,26 +0,0 @@
-# coding: utf-8
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-
-Gem::Specification.new do |spec|
- spec.name = "ipaddr"
- spec.version = "1.2.0"
- spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
- spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
-
- spec.summary = %q{A class to manipulate an IP address in ruby}
- spec.description = <<-'DESCRIPTION'
-IPAddr provides a set of methods to manipulate an IP address.
-Both IPv4 and IPv6 are supported.
- DESCRIPTION
- spec.homepage = "https://github.com/ruby/ipaddr"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ipaddr.gemspec", "lib/ipaddr.rb"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler", "~> 1.15"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "test-unit"
-end
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index 60f102d4e6..4b5f784ae0 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# ipaddr.rb - A class to manipulate an IP address
#
@@ -43,7 +42,7 @@ class IPAddr
# 32 bit mask for IPv4
IN4MASK = 0xffffffff
- # 128 bit mask for IPv6
+ # 128 bit mask for IPv4
IN6MASK = 0xffffffffffffffffffffffffffffffff
# Format string for IPv6
IN6FORMAT = (["%.4x"] * 8).join(':')
@@ -149,10 +148,7 @@ class IPAddr
# Returns true if two ipaddrs are equal.
def ==(other)
other = coerce_other(other)
- rescue
- false
- else
- @family == other.family && @addr == other.to_i
+ return @family == other.family && @addr == other.to_i
end
# Returns a new ipaddr built by masking IP address with the given
@@ -259,50 +255,6 @@ class IPAddr
return @family == Socket::AF_INET6
end
- # Returns true if the ipaddr is a loopback address.
- def loopback?
- case @family
- when Socket::AF_INET
- @addr & 0xff000000 == 0x7f000000
- when Socket::AF_INET6
- @addr == 1
- else
- raise AddressFamilyError, "unsupported address family"
- end
- end
-
- # Returns true if the ipaddr is a private address. IPv4 addresses
- # in 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 as defined in RFC
- # 1918 and IPv6 Unique Local Addresses in fc00::/7 as defined in RFC
- # 4193 are considered private.
- def private?
- case @family
- when Socket::AF_INET
- @addr & 0xff000000 == 0x0a000000 || # 10.0.0.0/8
- @addr & 0xfff00000 == 0xac100000 || # 172.16.0.0/12
- @addr & 0xffff0000 == 0xc0a80000 # 192.168.0.0/16
- when Socket::AF_INET6
- @addr & 0xfe00_0000_0000_0000_0000_0000_0000_0000 == 0xfc00_0000_0000_0000_0000_0000_0000_0000
- else
- raise AddressFamilyError, "unsupported address family"
- end
- end
-
- # Returns true if the ipaddr is a link-local address. IPv4
- # addresses in 169.254.0.0/16 reserved by RFC 3927 and Link-Local
- # IPv6 Unicast Addresses in fe80::/10 reserved by RFC 4291 are
- # considered link-local.
- def link_local?
- case @family
- when Socket::AF_INET
- @addr & 0xffff0000 == 0xa9fe0000 # 169.254.0.0/16
- when Socket::AF_INET6
- @addr & 0xffc0_0000_0000_0000_0000_0000_0000_0000 == 0xfe80_0000_0000_0000_0000_0000_0000_0000
- else
- raise AddressFamilyError, "unsupported address family"
- end
- end
-
# Returns true if the ipaddr is an IPv4-mapped IPv6 address.
def ipv4_mapped?
return ipv6? && (@addr >> 32) == 0xffff
@@ -310,11 +262,6 @@ class IPAddr
# Returns true if the ipaddr is an IPv4-compatible IPv6 address.
def ipv4_compat?
- warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
- _ipv4_compat?
- end
-
- def _ipv4_compat?
if !ipv6? || (@addr >> 32) != 0
return false
end
@@ -322,8 +269,6 @@ class IPAddr
return a != 0 && a != 1
end
- private :_ipv4_compat?
-
# Returns a new ipaddr built by converting the native IPv4 address
# into an IPv4-mapped IPv6 address.
def ipv4_mapped
@@ -336,7 +281,6 @@ class IPAddr
# Returns a new ipaddr built by converting the native IPv4 address
# into an IPv4-compatible IPv6 address.
def ipv4_compat
- warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
if !ipv4?
raise InvalidAddressError, "not an IPv4 address"
end
@@ -347,7 +291,7 @@ class IPAddr
# native IPv4 address. If the IP address is not an IPv4-mapped or
# IPv4-compatible IPv6 address, returns self.
def native
- if !ipv4_mapped? && !_ipv4_compat?
+ if !ipv4_mapped? && !ipv4_compat?
return self
end
return self.clone.set(@addr & IN4MASK, Socket::AF_INET)
@@ -390,10 +334,10 @@ class IPAddr
# Compares the ipaddr with another.
def <=>(other)
other = coerce_other(other)
- rescue
- nil
- else
- @addr <=> other.to_i if other.family == @family
+
+ return nil if other.family != @family
+
+ return @addr <=> other.to_i
end
include Comparable
@@ -423,35 +367,6 @@ class IPAddr
return clone.set(begin_addr, @family)..clone.set(end_addr, @family)
end
- # Returns the prefix length in bits for the ipaddr.
- def prefix
- case @family
- when Socket::AF_INET
- n = IN4MASK ^ @mask_addr
- i = 32
- when Socket::AF_INET6
- n = IN6MASK ^ @mask_addr
- i = 128
- else
- raise AddressFamilyError, "unsupported address family"
- end
- while n.positive?
- n >>= 1
- i -= 1
- end
- i
- end
-
- # Sets the prefix length in bits
- def prefix=(prefix)
- case prefix
- when Integer
- mask!(prefix)
- else
- raise InvalidPrefixError, "prefix must be an integer"
- end
- end
-
# Returns a string containing a human-readable representation of the
# ipaddr. ("#<IPAddr: family:address/mask>")
def inspect
@@ -494,9 +409,8 @@ class IPAddr
# Set current netmask to given mask.
def mask!(mask)
- case mask
- when String
- if mask =~ /\A\d+\z/
+ if mask.kind_of?(String)
+ if mask =~ /^\d+$/
prefixlen = mask.to_i
else
m = IPAddr.new(mask)
@@ -504,10 +418,6 @@ class IPAddr
raise InvalidPrefixError, "address family is not same"
end
@mask_addr = m.to_i
- n = @mask_addr ^ m.instance_variable_get(:@mask_addr)
- unless ((n + 1) & n).zero?
- raise InvalidPrefixError, "invalid mask #{mask}"
- end
@addr &= @mask_addr
return self
end
@@ -568,7 +478,7 @@ class IPAddr
end
end
prefix, prefixlen = addr.split('/')
- if prefix =~ /\A\[(.*)\]\z/i
+ if prefix =~ /^\[(.*)\]$/i
prefix = $1
family = Socket::AF_INET6
end
diff --git a/lib/irb.rb b/lib/irb.rb
index d650e9c497..09556c8bc5 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb.rb - irb main module
# $Release Version: 0.9.6 $
@@ -19,6 +18,8 @@ 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.
#
@@ -48,6 +49,7 @@ require "irb/locale"
#
# Usage: irb.rb [options] [programfile] [arguments]
# -f Suppress read of ~/.irbrc
+# -m Bc mode (load mathn, fraction or matrix are available)
# -d Set $DEBUG to true (same as `ruby -d')
# -r load-module Same as `ruby -r'
# -I path Specify $LOAD_PATH directory
@@ -89,6 +91,7 @@ require "irb/locale"
# as follows in an +irb+ session:
#
# IRB.conf[:IRB_NAME]="irb"
+# IRB.conf[:MATH_MODE]=false
# IRB.conf[:INSPECT_MODE]=nil
# IRB.conf[:IRB_RC] = nil
# IRB.conf[:BACK_TRACE_LIMIT]=16
@@ -155,7 +158,7 @@ require "irb/locale"
# %M # inspect of main object (self)
# %l # type of string(", ', /, ]), `]' is inner %w[...]
# %NNi # indent level. NN is digits and means as same as printf("%NNd").
-# # It can be omitted
+# # It can be ommited
# %NNn # line number.
# %% # %
#
@@ -327,7 +330,7 @@ require "irb/locale"
# 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 sessions, should only include main session
+# # list open sesssions, should only include main session
# irb(main):009:0> jobs
# #0->irb on main (#<Thread:0x400fb7e4> : running)
# # quit irb
@@ -342,7 +345,7 @@ module IRB
# Displays current configuration.
#
- # Modifying the configuration is achieved by sending a message to IRB.conf.
+ # Modifing the configuration is achieved by sending a message to IRB.conf.
#
# See IRB@Configuration for more information.
def IRB.conf
@@ -370,7 +373,6 @@ 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)
@@ -380,7 +382,21 @@ module IRB
else
irb = Irb.new
end
- irb.run(@CONF)
+
+ @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
+ @CONF[:MAIN_CONTEXT] = irb.context
+
+ trap("SIGINT") do
+ irb.signal_handle
+ end
+
+ begin
+ catch(:IRB_EXIT) do
+ irb.eval_input
+ end
+ ensure
+ irb_at_exit
+ end
end
# Calls each event hook of IRB.conf[:AT_EXIT] when the current session quits.
@@ -414,24 +430,6 @@ module IRB
@scanner = RubyLex.new
@scanner.exception_on_syntax_error = false
end
-
- def run(conf = IRB.conf)
- conf[:IRB_RC].call(context) if conf[:IRB_RC]
- conf[:MAIN_CONTEXT] = context
-
- trap("SIGINT") do
- signal_handle
- end
-
- begin
- catch(:IRB_EXIT) do
- eval_input
- end
- ensure
- conf[:AT_EXIT].each{|hook| hook.call}
- end
- end
-
# Returns the current context of this irb session
attr_reader :context
# The lexer used by this irb session
@@ -497,6 +495,7 @@ module IRB
rescue Exception => exc
end
if exc
+ print exc.class, ": ", exc, "\n"
if exc.backtrace && exc.backtrace[0] =~ /irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
!(SyntaxError === exc)
irb_bug = true
@@ -508,30 +507,31 @@ module IRB
lasts = []
levels = 0
if exc.backtrace
- count = 0
- exc.backtrace.each do |m|
- m = @context.workspace.filter_backtrace(m) or next unless irb_bug
- m = sprintf("%9d: from %s", (count += 1), m)
- if messages.size < @context.back_trace_limit
- messages.push(m)
- elsif lasts.size < @context.back_trace_limit
- lasts.push(m).shift
- levels += 1
+ 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
end
- attr = STDOUT.tty? ? ATTR_TTY : ATTR_PLAIN
- print "#{attr[1]}Traceback#{attr[]} (most recent call last):\n"
+ print messages.join("\n"), "\n"
unless lasts.empty?
- puts lasts.reverse
printf "... %d levels...\n", levels if levels > 0
+ print lasts.join("\n")
end
- puts messages.reverse
- messages = exc.to_s.split(/\n/)
- print "#{attr[1]}#{exc.class} (#{attr[4]}#{messages.shift}#{attr[0, 1]})#{attr[]}\n"
- puts messages.map {|s| "#{attr[1]}#{s}#{attr[]}\n"}
print "Maybe IRB bug!\n" if irb_bug
end
+ if $SAFE > 2
+ abort "Error: irb does not work for $SAFE level higher than 2"
+ end
end
end
end
@@ -677,11 +677,6 @@ module IRB
end
format("#<%s: %s>", self.class, ary.join(", "))
end
-
- ATTR_TTY = "\e[%sm"
- def ATTR_TTY.[](*a) self % a.join(";"); end
- ATTR_PLAIN = ""
- def ATTR_PLAIN.[](*) self; end
end
def @CONF.inspect
@@ -706,13 +701,3 @@ module IRB
array.join("\n")
end
end
-
-class Binding
- # :nodoc:
- def irb
- IRB.setup(eval("__FILE__"), argv: [])
- workspace = IRB::WorkSpace.new(self)
- STDOUT.print(workspace.code_around_binding)
- IRB::Irb.new(workspace).run(IRB.conf)
- end
-end
diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb
index e93c976f82..8c0260627e 100644
--- a/lib/irb/cmd/chws.rb
+++ b/lib/irb/cmd/chws.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# change-ws.rb -
# $Release Version: 0.9.6$
@@ -17,13 +16,13 @@ require "irb/ext/change-ws.rb"
module IRB
module ExtendCommand
- class CurrentWorkingWorkspace < Nop
+ class CurrentWorkingWorkspace<Nop
def execute(*obj)
irb_context.main
end
end
- class ChangeWorkspace < Nop
+ class ChangeWorkspace<Nop
def execute(*obj)
irb_context.change_workspace(*obj)
irb_context.main
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index ae4d51b5d1..1e02edac63 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# fork.rb -
# $Release Version: 0.9.6 $
@@ -14,7 +13,7 @@
# :stopdoc:
module IRB
module ExtendCommand
- class Fork < Nop
+ class Fork<Nop
def execute
pid = send ExtendCommand.irb_original_method_name("fork")
unless pid
diff --git a/lib/irb/cmd/help.rb b/lib/irb/cmd/help.rb
index db2bd567e5..76e299fc20 100644
--- a/lib/irb/cmd/help.rb
+++ b/lib/irb/cmd/help.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# help.rb - helper using ri
# $Release Version: 0.9.6$
@@ -16,7 +15,7 @@ require "irb/cmd/nop.rb"
# :stopdoc:
module IRB
module ExtendCommand
- class Help < Nop
+ class Help<Nop
begin
Ri = RDoc::RI::Driver.new
rescue SystemExit
diff --git a/lib/irb/cmd/load.rb b/lib/irb/cmd/load.rb
index f800b741eb..acda9d0c8c 100644
--- a/lib/irb/cmd/load.rb
+++ b/lib/irb/cmd/load.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# load.rb -
# $Release Version: 0.9.6$
@@ -16,7 +15,7 @@ require "irb/ext/loader"
# :stopdoc:
module IRB
module ExtendCommand
- class Load < Nop
+ class Load<Nop
include IrbLoader
def execute(file_name, priv = nil)
@@ -24,7 +23,7 @@ module IRB
end
end
- class Require < Nop
+ class Require<Nop
include IrbLoader
def execute(file_name)
@@ -55,7 +54,7 @@ module IRB
end
end
- class Source < Nop
+ class Source<Nop
include IrbLoader
def execute(file_name)
source_file(file_name)
diff --git a/lib/irb/cmd/nop.rb b/lib/irb/cmd/nop.rb
index 9cf4337c28..60379f016a 100644
--- a/lib/irb/cmd/nop.rb
+++ b/lib/irb/cmd/nop.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# nop.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/cmd/pushws.rb b/lib/irb/cmd/pushws.rb
index ffe55abed6..0726a4377e 100644
--- a/lib/irb/cmd/pushws.rb
+++ b/lib/irb/cmd/pushws.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# change-ws.rb -
# $Release Version: 0.9.6$
@@ -16,20 +15,20 @@ require "irb/ext/workspaces.rb"
# :stopdoc:
module IRB
module ExtendCommand
- class Workspaces < Nop
+ class Workspaces<Nop
def execute(*obj)
irb_context.workspaces.collect{|ws| ws.main}
end
end
- class PushWorkspace < Workspaces
+ class PushWorkspace<Workspaces
def execute(*obj)
irb_context.push_workspace(*obj)
super
end
end
- class PopWorkspace < Workspaces
+ class PopWorkspace<Workspaces
def execute(*obj)
irb_context.pop_workspace(*obj)
super
diff --git a/lib/irb/cmd/subirb.rb b/lib/irb/cmd/subirb.rb
index c1602f6e45..ccf4fc4bcd 100644
--- a/lib/irb/cmd/subirb.rb
+++ b/lib/irb/cmd/subirb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# multi.rb -
# $Release Version: 0.9.6$
# $Revision$
@@ -15,25 +14,25 @@ require "irb/ext/multi-irb"
# :stopdoc:
module IRB
module ExtendCommand
- class IrbCommand < Nop
+ class IrbCommand<Nop
def execute(*obj)
IRB.irb(nil, *obj)
end
end
- class Jobs < Nop
+ class Jobs<Nop
def execute
IRB.JobManager
end
end
- class Foreground < Nop
+ class Foreground<Nop
def execute(key)
IRB.JobManager.switch(key)
end
end
- class Kill < Nop
+ class Kill<Nop
def execute(*keys)
IRB.JobManager.kill(*keys)
end
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index e7499a8e2b..2d47f33d66 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/completor.rb -
# $Release Version: 0.9$
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 9ccdf744fb..9cf9600f02 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/context.rb - irb context
# $Release Version: 0.9.6$
@@ -11,7 +10,6 @@
#
require "irb/workspace"
require "irb/inspector"
-require "irb/output-method"
module IRB
# A class that wraps the current state of the irb session, including the
@@ -43,6 +41,7 @@ module IRB
@io = nil
self.inspect_mode = IRB.conf[:INSPECT_MODE]
+ self.math_mode = IRB.conf[:MATH_MODE] if IRB.conf[:MATH_MODE]
self.use_tracer = IRB.conf[:USE_TRACER] if IRB.conf[:USE_TRACER]
self.use_loader = IRB.conf[:USE_LOADER] if IRB.conf[:USE_LOADER]
self.eval_history = IRB.conf[:EVAL_HISTORY] if IRB.conf[:EVAL_HISTORY]
diff --git a/lib/irb/ext/change-ws.rb b/lib/irb/ext/change-ws.rb
index 94bfe62bc0..0ae9097285 100644
--- a/lib/irb/ext/change-ws.rb
+++ b/lib/irb/ext/change-ws.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/ext/cb.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/ext/history.rb b/lib/irb/ext/history.rb
index 62363b13f4..d8378753f2 100644
--- a/lib/irb/ext/history.rb
+++ b/lib/irb/ext/history.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# history.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/ext/loader.rb b/lib/irb/ext/loader.rb
index 840226db30..821538cd44 100644
--- a/lib/irb/ext/loader.rb
+++ b/lib/irb/ext/loader.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# loader.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb
new file mode 100644
index 0000000000..01bd24a157
--- /dev/null
+++ b/lib/irb/ext/math-mode.rb
@@ -0,0 +1,47 @@
+#
+# math-mode.rb -
+# $Release Version: 0.9.6$
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#
+# --
+#
+#
+#
+require "mathn"
+
+module IRB
+ class Context
+ # Returns whether bc mode is enabled.
+ #
+ # See #math_mode=
+ attr_reader :math_mode
+ # Alias for #math_mode
+ alias math? math_mode
+
+ # Sets bc mode, which loads +lib/mathn.rb+ so fractions or matrix are
+ # available.
+ #
+ # Also available as the +-m+ command line option.
+ #
+ # See IRB@Command+line+options and the unix manpage <code>bc(1)</code> for
+ # more information.
+ def math_mode=(opt)
+ if @math_mode == true && !opt
+ IRB.fail CantReturnToNormalMode
+ return
+ end
+
+ @math_mode = opt
+ if math_mode
+ main.extend Math
+ print "start math mode\n" if verbose?
+ end
+ end
+
+ def inspect?
+ @inspect_mode.nil? && !@math_mode or @inspect_mode
+ end
+ end
+end
+
diff --git a/lib/irb/ext/multi-irb.rb b/lib/irb/ext/multi-irb.rb
index 28d6fba832..52f6fda733 100644
--- a/lib/irb/ext/multi-irb.rb
+++ b/lib/irb/ext/multi-irb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/multi-irb.rb - multiple irb module
# $Release Version: 0.9.6$
@@ -10,6 +9,7 @@
#
#
IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
+require "thread"
module IRB
class JobManager
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index ab64cf543d..4477d18e1a 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# save-history.rb -
# $Release Version: 0.9.6$
# $Revision$
@@ -27,7 +26,6 @@ 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.
#
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index 200f77e341..c145cf5b4f 100644
--- a/lib/irb/ext/tracer.rb
+++ b/lib/irb/ext/tracer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/lib/tracer.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb
index 571dd25d17..99e76b722f 100644
--- a/lib/irb/ext/use-loader.rb
+++ b/lib/irb/ext/use-loader.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# use-loader.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/ext/workspaces.rb b/lib/irb/ext/workspaces.rb
index 5bd72c194f..4237037271 100644
--- a/lib/irb/ext/workspaces.rb
+++ b/lib/irb/ext/workspaces.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# push-ws.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index 064f21ba52..a9326272ff 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/extend-command.rb - irb extend command
# $Release Version: 0.9.6$
@@ -214,6 +213,7 @@ module IRB # :nodoc:
@EXTEND_COMMANDS = [
[:eval_history=, "irb/ext/history.rb"],
[:use_tracer=, "irb/ext/tracer.rb"],
+ [:math_mode=, "irb/ext/math-mode.rb"],
[:use_loader=, "irb/ext/use-loader.rb"],
[:save_history=, "irb/ext/save-history.rb"],
]
@@ -222,6 +222,7 @@ module IRB # :nodoc:
#
# Context#eval_history=:: +irb/ext/history.rb+
# Context#use_tracer=:: +irb/ext/tracer.rb+
+ # Context#math_mode=:: +irb/ext/math-mode.rb+
# Context#use_loader=:: +irb/ext/use-loader.rb+
# Context#save_history=:: +irb/ext/save-history.rb+
def self.install_extend_commands
@@ -304,3 +305,4 @@ module IRB # :nodoc:
end
end
end
+
diff --git a/lib/irb/frame.rb b/lib/irb/frame.rb
index 6073809249..64dd63dddf 100644
--- a/lib/irb/frame.rb
+++ b/lib/irb/frame.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# frame.rb -
# $Release Version: 0.9$
diff --git a/lib/irb/help.rb b/lib/irb/help.rb
index a4264ab4ab..b9ebfb1ae5 100644
--- a/lib/irb/help.rb
+++ b/lib/irb/help.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/help.rb - print usage module
# $Release Version: 0.9.6$
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index a971b75ac3..af9c363a97 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/init.rb - irb initialize module
# $Release Version: 0.9.6$
@@ -13,10 +12,10 @@
module IRB # :nodoc:
# initialize config
- def IRB.setup(ap_path, argv: ::ARGV)
+ def IRB.setup(ap_path)
IRB.init_config(ap_path)
IRB.init_error
- IRB.parse_opts(argv: argv)
+ IRB.parse_opts
IRB.run_config
IRB.load_modules
@@ -43,6 +42,7 @@ module IRB # :nodoc:
@CONF[:LOAD_MODULES] = []
@CONF[:IRB_RC] = nil
+ @CONF[:MATH_MODE] = false
@CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
@CONF[:INSPECT_MODE] = true
@CONF[:USE_TRACER] = false
@@ -121,19 +121,21 @@ module IRB # :nodoc:
end
# option analyzing
- def IRB.parse_opts(argv: ::ARGV)
+ def IRB.parse_opts
load_path = []
- while opt = argv.shift
+ while opt = ARGV.shift
case opt
when "-f"
@CONF[:RC] = false
+ when "-m"
+ @CONF[:MATH_MODE] = true
when "-d"
$DEBUG = true
$VERBOSE = true
when "-w"
$VERBOSE = true
when /^-W(.+)?/
- opt = $1 || argv.shift
+ opt = $1 || ARGV.shift
case opt
when "0"
$VERBOSE = nil
@@ -143,19 +145,19 @@ module IRB # :nodoc:
$VERBOSE = true
end
when /^-r(.+)?/
- opt = $1 || argv.shift
+ opt = $1 || ARGV.shift
@CONF[:LOAD_MODULES].push opt if opt
when /^-I(.+)?/
- opt = $1 || argv.shift
+ opt = $1 || ARGV.shift
load_path.concat(opt.split(File::PATH_SEPARATOR)) if opt
when '-U'
set_encoding("UTF-8", "UTF-8")
when /^-E(.+)?/, /^--encoding(?:=(.+))?/
- opt = $1 || argv.shift
+ opt = $1 || ARGV.shift
set_encoding(*opt.split(':', 2))
when "--inspect"
- if /^-/ !~ argv.first
- @CONF[:INSPECT_MODE] = argv.shift
+ if /^-/ !~ ARGV.first
+ @CONF[:INSPECT_MODE] = ARGV.shift
else
@CONF[:INSPECT_MODE] = true
end
@@ -174,7 +176,7 @@ module IRB # :nodoc:
when "--noverbose"
@CONF[:VERBOSE] = false
when /^--prompt-mode(?:=(.+))?/, /^--prompt(?:=(.+))?/
- opt = $1 || argv.shift
+ opt = $1 || ARGV.shift
prompt_mode = opt.upcase.tr("-", "_").intern
@CONF[:PROMPT_MODE] = prompt_mode
when "--noprompt"
@@ -186,13 +188,13 @@ module IRB # :nodoc:
when "--tracer"
@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
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
@@ -201,7 +203,7 @@ module IRB # :nodoc:
IRB.print_usage
exit 0
when "--"
- if opt = argv.shift
+ if opt = ARGV.shift
@CONF[:SCRIPT] = opt
$0 = opt
end
@@ -277,7 +279,7 @@ module IRB # :nodoc:
begin
require m
rescue LoadError => err
- warn "#{err.class}: #{err}", uplevel: 0
+ warn err.backtrace[0] << ":#{err.class}: #{err}"
end
end
end
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
index f7b1aac3bf..4ea3f585f8 100644
--- a/lib/irb/input-method.rb
+++ b/lib/irb/input-method.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/input-method.rb - input methods used irb
# $Release Version: 0.9.6$
diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb
index f6f76712b8..f09b12927a 100644
--- a/lib/irb/inspector.rb
+++ b/lib/irb/inspector.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/inspector.rb - inspect methods
# $Release Version: 0.9.6$
diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb
index 6623f82d84..c0c6c30d79 100644
--- a/lib/irb/lc/error.rb
+++ b/lib/irb/lc/error.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/lc/error.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message
index d43c6a1695..5853693eb0 100644
--- a/lib/irb/lc/help-message
+++ b/lib/irb/lc/help-message
@@ -11,6 +11,7 @@
#
Usage: irb.rb [options] [programfile] [arguments]
-f Suppress read of ~/.irbrc
+ -m Bc mode (load mathn, fraction or matrix are available)
-d Set $DEBUG to true (same as `ruby -d')
-r load-module Same as `ruby -r'
-I path Specify $LOAD_PATH directory
diff --git a/lib/irb/lc/ja/encoding_aliases.rb b/lib/irb/lc/ja/encoding_aliases.rb
index c534bf0fef..5bef32e20e 100644
--- a/lib/irb/lc/ja/encoding_aliases.rb
+++ b/lib/irb/lc/ja/encoding_aliases.rb
@@ -1,4 +1,3 @@
-# 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 919363154c..4f09d781cb 100644
--- a/lib/irb/lc/ja/error.rb
+++ b/lib/irb/lc/ja/error.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: false
# irb/lc/ja/error.rb -
# $Release Version: 0.9.6$
# $Revision$
diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message
index 1b24d14d28..288eb5245c 100644
--- a/lib/irb/lc/ja/help-message
+++ b/lib/irb/lc/ja/help-message
@@ -10,6 +10,7 @@
#
Usage: irb.rb [options] [programfile] [arguments]
-f ~/.irbrc を読み込まない.
+ -m bcモード(分数, 行列の計算ができる)
-d $DEBUG をtrueにする(ruby -d と同じ)
-r load-module ruby -r と同じ.
-I path $LOAD_PATH に path を追加する.
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index b713f50e76..9f40188171 100644
--- a/lib/irb/locale.rb
+++ b/lib/irb/locale.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/locale.rb - internationalization module
# $Release Version: 0.9.6$
@@ -31,7 +30,7 @@ module IRB # :nodoc:
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}"]), uplevel: 1)
+ warn "%s is obsolete. use %s" % ["#{@lang}_#{@territory}.#{@encoding_name}", "#{@lang}_#{@territory}.#{@encoding.name}"]
end
@encoding = Encoding.find(@encoding_name) rescue nil
end
diff --git a/lib/irb/magic-file.rb b/lib/irb/magic-file.rb
index 34e06d64b3..339ed60b6b 100644
--- a/lib/irb/magic-file.rb
+++ b/lib/irb/magic-file.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module IRB
class << (MagicFile = Object.new)
# see parser_magic_comment in parse.y
@@ -10,7 +9,7 @@ module IRB
line = io.gets if line[0,2] == "#!"
encoding = detect_encoding(line)
internal_encoding = encoding
- encoding ||= IRB.default_src_encoding
+ encoding ||= default_src_encoding
io.rewind
io.set_encoding(encoding, internal_encoding)
diff --git a/lib/irb/notifier.rb b/lib/irb/notifier.rb
index a21e865f2e..d5981df2bf 100644
--- a/lib/irb/notifier.rb
+++ b/lib/irb/notifier.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# notifier.rb - output methods used by irb
# $Release Version: 0.9.6$
@@ -113,7 +112,7 @@ module IRB
# create a new composite notifier. Using the first composite notifier
# object you create, sibling notifiers can be initialized with
# #def_notifier.
- class CompositeNotifier < AbstractNotifier
+ class CompositeNotifier<AbstractNotifier
# Create a new composite notifier object with the given +prefix+, and
# +base_notifier+ to use for output.
def initialize(prefix, base_notifier)
@@ -174,7 +173,7 @@ module IRB
# A leveled notifier is comparable to the composite group from
# CompositeNotifier#notifiers.
- class LeveledNotifier < AbstractNotifier
+ class LeveledNotifier<AbstractNotifier
include Comparable
# Create a new leveled notifier with the given +base+, and +prefix+ to
@@ -212,7 +211,7 @@ module IRB
#
# This notifier is used as the +zero+ index, or level +0+, for
# CompositeNotifier#notifiers, and will not output messages of any sort.
- class NoMsgNotifier < LeveledNotifier
+ class NoMsgNotifier<LeveledNotifier
# Creates a new notifier that should not be used to output messages.
def initialize
@base_notifier = nil
diff --git a/lib/irb/output-method.rb b/lib/irb/output-method.rb
index 935a127d0a..e0ba25f3e4 100644
--- a/lib/irb/output-method.rb
+++ b/lib/irb/output-method.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# output-method.rb - output methods used by irb
# $Release Version: 0.9.6$
@@ -82,7 +81,7 @@ module IRB
end
# A standard output printer
- class StdioOutputMethod < OutputMethod
+ class StdioOutputMethod<OutputMethod
# Prints the given +opts+ to standard output, see IO#print for more
# information.
def print(*opts)
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index fb7e08099f..7189307e0a 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/ruby-lex.rb - ruby lexcal analyzer
# $Release Version: 0.9.6$
@@ -262,18 +261,9 @@ class RubyLex
end
def lex
- continue = @continue
- while tk = token
- case tk
- when TkNL, TkEND_OF_SCRIPT
- @continue = continue unless continue.nil?
- break unless @continue
- when TkSPACE, TkCOMMENT
- when TkSEMICOLON, TkBEGIN, TkELSE
- @continue = continue = false
- else
- continue = nil
- end
+ until (((tk = token).kind_of?(TkNL) || tk.kind_of?(TkEND_OF_SCRIPT)) &&
+ !@continue or
+ tk.nil?)
end
line = get_readed
if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
@@ -415,7 +405,7 @@ class RubyLex
if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
(@lex_state != EXPR_ARG || @space_seen)
c = peek(0)
- if /[-~"'`\w]/ =~ c
+ if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-")
tk = identify_here_document
end
end
@@ -801,7 +791,7 @@ class RubyLex
token_c = TkSymbol2Token[trans[1]]
@lex_state = trans[0]
else
- if @lex_state != EXPR_FNAME and peek(0) != ':'
+ if @lex_state != EXPR_FNAME
if ENINDENT_CLAUSE.include?(token)
# check for ``class = val'' etc.
valid = true
@@ -864,7 +854,7 @@ class RubyLex
def identify_here_document
ch = getc
- if ch == "-" || ch == "~"
+ if ch == "-"
ch = getc
indent = true
end
diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb
index af53d3c93b..a80d81c9a5 100644
--- a/lib/irb/ruby-token.rb
+++ b/lib/irb/ruby-token.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/ruby-token.rb - ruby tokens
# $Release Version: 0.9.6$
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index 039b214a8d..f6c2bd92f5 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/slex.rb - simple lex analyzer
# $Release Version: 0.9.6$
@@ -53,7 +52,7 @@ module IRB
node.preproc=proc
end
- # need a check?
+ #$BMW%A%'%C%/(B?
def postproc(token)
node = search(token, proc)
node.postproc=proc
diff --git a/lib/irb/src_encoding.rb b/lib/irb/src_encoding.rb
index 99aea2b43e..958cef104c 100644
--- a/lib/irb/src_encoding.rb
+++ b/lib/irb/src_encoding.rb
@@ -1,7 +1,4 @@
-# frozen_string_literal: false
# DO NOT WRITE ANY MAGIC COMMENT HERE.
-module IRB
- def self.default_src_encoding
- return __ENCODING__
- end
+def default_src_encoding
+ return __ENCODING__
end
diff --git a/lib/irb/version.rb b/lib/irb/version.rb
index 094cb33c05..bb998db3dd 100644
--- a/lib/irb/version.rb
+++ b/lib/irb/version.rb
@@ -1,4 +1,3 @@
-# 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 9ce84b60fa..e05c3bbc96 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/workspace-binding.rb -
# $Release Version: 0.9.6$
@@ -39,7 +38,9 @@ EOF
when 2 # binding in loaded file(thread use)
unless defined? BINDING_QUEUE
- IRB.const_set(:BINDING_QUEUE, Thread::SizedQueue.new(1))
+ require "thread"
+
+ IRB.const_set(:BINDING_QUEUE, SizedQueue.new(1))
Thread.abort_on_exception = true
Thread.start do
eval "require \"irb/ws-for-case-2\"", TOPLEVEL_BINDING, __FILE__, __LINE__
@@ -107,28 +108,6 @@ EOF
bt
end
- def code_around_binding
- file, pos = @binding.eval('[__FILE__, __LINE__]')
-
- unless defined?(::SCRIPT_LINES__[file]) && lines = ::SCRIPT_LINES__[file]
- begin
- lines = File.readlines(file)
- rescue SystemCallError
- return
- end
- end
- pos -= 1
-
- start_pos = [pos - 5, 0].max
- end_pos = [pos + 5, lines.size - 1].min
-
- fmt = " %2s %#{end_pos.to_s.length}d: %s"
- body = (start_pos..end_pos).map do |current_pos|
- sprintf(fmt, pos == current_pos ? '=>' : '', current_pos + 1, lines[current_pos])
- end.join("")
- "\nFrom: #{file} @ line #{pos + 1} :\n\n#{body}\n"
- end
-
def IRB.delete_caller
end
end
diff --git a/lib/irb/ws-for-case-2.rb b/lib/irb/ws-for-case-2.rb
index eb173fddca..9f3af49f30 100644
--- a/lib/irb/ws-for-case-2.rb
+++ b/lib/irb/ws-for-case-2.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# irb/ws-for-case-2.rb -
# $Release Version: 0.9.6$
diff --git a/lib/irb/xmp.rb b/lib/irb/xmp.rb
index 3234cff7f3..449f04328b 100644
--- a/lib/irb/xmp.rb
+++ b/lib/irb/xmp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# xmp.rb - irb version of gotoken xmp
# $Release Version: 0.9$
diff --git a/lib/logger.rb b/lib/logger.rb
index 4ccc03b614..530b718cde 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# logger.rb - simple logging utility
# Copyright (C) 2000-2003, 2005, 2008, 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
#
@@ -177,19 +176,6 @@ require 'monitor'
#
# # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
#
-# 3. Symbol or String (case insensitive)
-#
-# logger.level = :info
-# logger.level = 'INFO'
-#
-# # :debug < :info < :warn < :error < :fatal < :unknown
-#
-# 4. Constructor
-#
-# Logger.new(logdev, level: Logger::INFO)
-# Logger.new(logdev, level: :info)
-# Logger.new(logdev, level: 'INFO')
-#
# == Format
#
# Log messages are rendered in the output stream in a certain format by
@@ -206,10 +192,6 @@ require 'monitor'
# logger.datetime_format = '%Y-%m-%d %H:%M:%S'
# # e.g. "2004-01-03 00:54:26"
#
-# or via the constructor.
-#
-# Logger.new(logdev, datetime_format: '%Y-%m-%d %H:%M:%S')
-#
# Or, you may change the overall format via the #formatter= method.
#
# logger.formatter = proc do |severity, datetime, progname, msg|
@@ -217,12 +199,6 @@ require 'monitor'
# end
# # e.g. "2005-09-22 08:51:08 +0900: hello world"
#
-# or via the constructor.
-#
-# Logger.new(logdev, formatter: proc {|severity, datetime, progname, msg|
-# "#{datetime}: #{msg}\n"
-# })
-#
class Logger
VERSION = "1.2.7"
_, name, rev = %w$Id$
@@ -232,7 +208,7 @@ class Logger
name = File.basename(__FILE__)
end
rev ||= "v#{VERSION}"
- ProgName = "#{name}/#{rev}".freeze
+ ProgName = "#{name}/#{rev}"
class Error < RuntimeError # :nodoc:
end
@@ -258,33 +234,7 @@ class Logger
include Severity
# Logging severity threshold (e.g. <tt>Logger::INFO</tt>).
- attr_reader :level
-
- # Set logging severity threshold.
- #
- # +severity+:: The Severity of the log message.
- def level=(severity)
- if severity.is_a?(Integer)
- @level = severity
- else
- case severity.to_s.downcase
- when 'debug'
- @level = DEBUG
- when 'info'
- @level = INFO
- when 'warn'
- @level = WARN
- when 'error'
- @level = ERROR
- when 'fatal'
- @level = FATAL
- when 'unknown'
- @level = UNKNOWN
- else
- raise ArgumentError, "invalid log level: #{severity}"
- end
- end
- end
+ attr_accessor :level
# Program name to include in log messages.
attr_accessor :progname
@@ -340,12 +290,8 @@ class Logger
#
# :call-seq:
- # Logger.new(logdev, shift_age = 0, shift_size = 1048576)
+ # Logger.new(logdev, shift_age = 7, shift_size = 1048576)
# Logger.new(logdev, shift_age = 'weekly')
- # Logger.new(logdev, level: :info)
- # Logger.new(logdev, progname: 'progname')
- # Logger.new(logdev, formatter: formatter)
- # Logger.new(logdev, datetime_format: '%Y-%m-%d %H:%M:%S')
#
# === Args
#
@@ -354,65 +300,28 @@ class Logger
# +STDOUT+, +STDERR+, or an open file).
# +shift_age+::
# Number of old log files to keep, *or* frequency of rotation (+daily+,
- # +weekly+ or +monthly+). Default value is 0.
+ # +weekly+ or +monthly+).
# +shift_size+::
- # Maximum logfile size in bytes (only applies when +shift_age+ is a number).
- # Defaults to +1048576+ (1MB).
- # +level+::
- # Logging severity threshold. Default values is Logger::DEBUG.
- # +progname+::
- # Program name to include in log messages. Default value is nil.
- # +formatter+::
- # Logging formatter. Default values is an instance of Logger::Formatter.
- # +datetime_format+::
- # Date and time format. Default value is '%Y-%m-%d %H:%M:%S'.
- # +shift_period_suffix+::
- # The log file suffix format for +daily+, +weekly+ or +monthly+ rotation.
- # Default is '%Y%m%d'.
+ # Maximum logfile size (only applies when +shift_age+ is a number).
#
# === Description
#
# Create an instance.
#
- def initialize(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG,
- progname: nil, formatter: nil, datetime_format: nil,
- shift_period_suffix: '%Y%m%d')
- self.level = level
- self.progname = progname
+ def initialize(logdev, shift_age = 0, shift_size = 1048576)
+ @progname = nil
+ @level = DEBUG
@default_formatter = Formatter.new
- self.datetime_format = datetime_format
- self.formatter = formatter
+ @formatter = nil
@logdev = nil
if logdev
@logdev = LogDevice.new(logdev, :shift_age => shift_age,
- :shift_size => shift_size,
- :shift_period_suffix => shift_period_suffix)
+ :shift_size => shift_size)
end
end
#
# :call-seq:
- # Logger#reopen
- # Logger#reopen(logdev)
- #
- # === Args
- #
- # +logdev+::
- # The log device. This is a filename (String) or IO object (typically
- # +STDOUT+, +STDERR+, or an open file). reopen the same filename if
- # it is +nil+, do nothing for IO. Default is +nil+.
- #
- # === Description
- #
- # Reopen a log device.
- #
- def reopen(logdev = nil)
- @logdev.reopen(logdev)
- self
- end
-
- #
- # :call-seq:
# Logger#add(severity, message = nil, progname = nil) { ... }
#
# === Args
@@ -452,14 +361,12 @@ class Logger
# * Append open does not need to lock file.
# * If the OS supports multi I/O, records possibly may be mixed.
#
- def add(severity, message = nil, progname = nil)
+ def add(severity, message = nil, progname = nil, &block)
severity ||= UNKNOWN
if @logdev.nil? or severity < @level
return true
end
- if progname.nil?
- progname = @progname
- end
+ progname ||= @progname
if message.nil?
if block_given?
message = yield
@@ -574,7 +481,7 @@ class Logger
private
# Severity label for logging (max 5 chars).
- SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY).each(&:freeze).freeze
+ SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY)
def format_severity(severity)
SEV_LABEL[severity] || 'ANY'
@@ -587,7 +494,7 @@ private
# Default formatter for log messages.
class Formatter
- Format = "%s, [%s#%d] %5s -- %s: %s\n".freeze
+ Format = "%s, [%s#%d] %5s -- %s: %s\n"
attr_accessor :datetime_format
@@ -626,31 +533,29 @@ private
def next_rotate_time(now, shift_age)
case shift_age
- when 'daily'
+ when /^daily$/
t = Time.mktime(now.year, now.month, now.mday) + SiD
- when 'weekly'
+ when /^weekly$/
t = Time.mktime(now.year, now.month, now.mday) + SiD * (7 - now.wday)
- when 'monthly'
- t = Time.mktime(now.year, now.month, 1) + SiD * 32
- return Time.mktime(t.year, t.month, 1)
+ when /^monthly$/
+ t = Time.mktime(now.year, now.month, 1) + SiD * 31
+ mday = (1 if t.mday > 1)
else
return now
end
- if t.hour.nonzero? or t.min.nonzero? or t.sec.nonzero?
- hour = t.hour
- t = Time.mktime(t.year, t.month, t.mday)
- t += SiD if hour > 12
+ if mday or t.hour.nonzero? or t.min.nonzero? or t.sec.nonzero?
+ t = Time.mktime(t.year, t.month, mday || (t.mday + (t.hour > 12 ? 1 : 0)))
end
t
end
def previous_period_end(now, shift_age)
case shift_age
- when 'daily'
+ when /^daily$/
t = Time.mktime(now.year, now.month, now.mday) - SiD / 2
- when 'weekly'
- t = Time.mktime(now.year, now.month, now.mday) - (SiD * now.wday + SiD / 2)
- when 'monthly'
+ when /^weekly$/
+ t = Time.mktime(now.year, now.month, now.mday) - (SiD * (now.wday + 1) + SiD / 2)
+ when /^monthly$/
t = Time.mktime(now.year, now.month, 1) - SiD / 2
else
return now
@@ -665,27 +570,29 @@ private
attr_reader :dev
attr_reader :filename
- include MonitorMixin
-
- def initialize(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil)
- @dev = @filename = @shift_age = @shift_size = @shift_period_suffix = nil
- mon_initialize
- set_dev(log)
- if @filename
- @shift_age = shift_age || 7
- @shift_size = shift_size || 1048576
- @shift_period_suffix = shift_period_suffix || '%Y%m%d'
-
- unless @shift_age.is_a?(Integer)
- base_time = @dev.respond_to?(:stat) ? @dev.stat.mtime : Time.now
- @next_rotate_time = next_rotate_time(base_time, @shift_age)
- end
+
+ class LogDeviceMutex
+ include MonitorMixin
+ end
+
+ def initialize(log = nil, opt = {})
+ @dev = @filename = @shift_age = @shift_size = nil
+ @mutex = LogDeviceMutex.new
+ if log.respond_to?(:write) and log.respond_to?(:close)
+ @dev = log
+ else
+ @dev = open_logfile(log)
+ @dev.sync = true
+ @filename = log
+ @shift_age = opt[:shift_age] || 7
+ @shift_size = opt[:shift_size] || 1048576
+ @next_rotate_time = next_rotate_time(Time.now, @shift_age) unless @shift_age.is_a?(Integer)
end
end
def write(message)
begin
- synchronize do
+ @mutex.synchronize do
if @shift_age and @dev.respond_to?(:stat)
begin
check_shift_log
@@ -706,7 +613,7 @@ private
def close
begin
- synchronize do
+ @mutex.synchronize do
@dev.close rescue nil
end
rescue Exception
@@ -714,36 +621,11 @@ private
end
end
- def reopen(log = nil)
- # reopen the same filename if no argument, do nothing for IO
- log ||= @filename if @filename
- if log
- synchronize do
- if @filename and @dev
- @dev.close rescue nil # close only file opened by Logger
- @filename = nil
- end
- set_dev(log)
- end
- end
- self
- end
-
private
- def set_dev(log)
- if log.respond_to?(:write) and log.respond_to?(:close)
- @dev = log
- else
- @dev = open_logfile(log)
- @dev.sync = true
- @filename = log
- end
- end
-
def open_logfile(filename)
begin
- File.open(filename, (File::WRONLY | File::APPEND))
+ open(filename, (File::WRONLY | File::APPEND))
rescue Errno::ENOENT
create_logfile(filename)
end
@@ -751,7 +633,7 @@ private
def create_logfile(filename)
begin
- logdev = File.open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
+ logdev = open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
logdev.flock(File::LOCK_EX)
logdev.sync = true
add_log_header(logdev)
@@ -834,15 +716,15 @@ private
end
def shift_log_period(period_end)
- suffix = period_end.strftime(@shift_period_suffix)
- age_file = "#{@filename}.#{suffix}"
+ postfix = period_end.strftime("%Y%m%d") # YYYYMMDD
+ age_file = "#{@filename}.#{postfix}"
if FileTest.exist?(age_file)
# try to avoid filename crash caused by Timestamp change.
idx = 0
# .99 can be overridden; avoid too much file search with 'loop do'
while idx < 100
idx += 1
- age_file = "#{@filename}.#{suffix}.#{idx}"
+ age_file = "#{@filename}.#{postfix}.#{idx}"
break unless FileTest.exist?(age_file)
end
end
diff --git a/lib/mathn.rb b/lib/mathn.rb
new file mode 100644
index 0000000000..315e5438d7
--- /dev/null
+++ b/lib/mathn.rb
@@ -0,0 +1,191 @@
+#--
+# $Release Version: 0.5 $
+# $Revision: 1.1.1.1.4.1 $
+
+##
+# = mathn
+#
+# mathn serves to make mathematical operations more precise in Ruby
+# and to integrate other mathematical standard libraries.
+#
+# Without mathn:
+#
+# 3 / 2 => 1 # Integer
+#
+# With mathn:
+#
+# 3 / 2 => 3/2 # Rational
+#
+# mathn keeps value in exact terms.
+#
+# Without mathn:
+#
+# 20 / 9 * 3 * 14 / 7 * 3 / 2 # => 18
+#
+# With mathn:
+#
+# 20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
+#
+#
+# When you require 'mathn', the libraries for Prime, CMath, Matrix and Vector
+# are also loaded.
+#
+# == Copyright
+#
+# Author: Keiju ISHITSUKA (SHL Japan Inc.)
+#--
+# class Numeric follows to make this documentation findable in a reasonable
+# location
+
+warn('lib/mathn.rb is deprecated') if $VERBOSE
+
+class Numeric; end
+
+require "cmath.rb"
+require "matrix.rb"
+require "prime.rb"
+
+require "mathn/rational"
+require "mathn/complex"
+
+unless defined?(Math.exp!)
+ Object.instance_eval{remove_const :Math}
+ Math = CMath # :nodoc:
+end
+
+##
+# When mathn is required, Fixnum's division is enhanced to
+# return more precise values from mathematical expressions.
+#
+# 2/3*3 # => 0
+# require 'mathn'
+# 2/3*3 # => 2
+
+class Fixnum
+ remove_method :/
+
+ ##
+ # +/+ defines the Rational division for Fixnum.
+ #
+ # 1/3 # => (1/3)
+
+ alias / quo
+end
+
+##
+# When mathn is required Bignum's division is enhanced to
+# return more precise values from mathematical expressions.
+#
+# (2**72) / ((2**70) * 3) # => 4/3
+
+class Bignum
+ remove_method :/
+
+ ##
+ # +/+ defines the Rational division for Bignum.
+ #
+ # (2**72) / ((2**70) * 3) # => 4/3
+
+ alias / quo
+end
+
+##
+# When mathn is required, the Math module changes as follows:
+#
+# Standard Math module behaviour:
+# Math.sqrt(4/9) # => 0.0
+# Math.sqrt(4.0/9.0) # => 0.666666666666667
+# Math.sqrt(- 4/9) # => Errno::EDOM: Numerical argument out of domain - sqrt
+#
+# After require 'mathn', this is changed to:
+#
+# require 'mathn'
+# Math.sqrt(4/9) # => 2/3
+# Math.sqrt(4.0/9.0) # => 0.666666666666667
+# Math.sqrt(- 4/9) # => Complex(0, 2/3)
+
+module Math
+ remove_method(:sqrt)
+
+ ##
+ # Computes the square root of +a+. It makes use of Complex and
+ # Rational to have no rounding errors if possible.
+ #
+ # Math.sqrt(4/9) # => 2/3
+ # Math.sqrt(- 4/9) # => Complex(0, 2/3)
+ # Math.sqrt(4.0/9.0) # => 0.666666666666667
+
+ def sqrt(a)
+ if a.kind_of?(Complex)
+ abs = sqrt(a.real*a.real + a.imag*a.imag)
+ x = sqrt((a.real + abs)/Rational(2))
+ y = sqrt((-a.real + abs)/Rational(2))
+ if a.imag >= 0
+ Complex(x, y)
+ else
+ Complex(x, -y)
+ end
+ elsif a.respond_to?(:nan?) and a.nan?
+ a
+ elsif a >= 0
+ rsqrt(a)
+ else
+ Complex(0,rsqrt(-a))
+ end
+ end
+
+ ##
+ # Compute square root of a non negative number. This method is
+ # internally used by +Math.sqrt+.
+
+ def rsqrt(a)
+ if a.kind_of?(Float)
+ sqrt!(a)
+ elsif a.kind_of?(Rational)
+ rsqrt(a.numerator)/rsqrt(a.denominator)
+ else
+ src = a
+ max = 2 ** 32
+ byte_a = [src & 0xffffffff]
+ # ruby's bug
+ while (src >= max) and (src >>= 32)
+ byte_a.unshift src & 0xffffffff
+ end
+
+ answer = 0
+ main = 0
+ side = 0
+ for elm in byte_a
+ main = (main << 32) + elm
+ side <<= 16
+ if answer != 0
+ if main * 4 < side * side
+ applo = main.div(side)
+ else
+ applo = ((sqrt!(side * side + 4 * main) - side)/2.0).to_i + 1
+ end
+ else
+ applo = sqrt!(main).to_i + 1
+ end
+
+ while (x = (side + applo) * applo) > main
+ applo -= 1
+ end
+ main -= x
+ answer = (answer << 16) + applo
+ side += applo * 2
+ end
+ if main == 0
+ answer
+ else
+ sqrt!(a)
+ end
+ end
+ end
+
+ class << self
+ remove_method(:sqrt)
+ end
+ module_function :sqrt
+ module_function :rsqrt
+end
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 923e716b35..76bec9228b 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1,5 +1,4 @@
# encoding: utf-8
-# frozen_string_literal: false
#
# = matrix.rb
#
@@ -28,8 +27,100 @@ end
#
# The +Matrix+ class represents a mathematical matrix. It provides methods for creating
# matrices, operating on them arithmetically and algebraically,
-# and determining their mathematical properties such as trace, rank, inverse, determinant,
-# or eigensystem.
+# and determining their mathematical properties (trace, rank, inverse, determinant).
+#
+# == Method Catalogue
+#
+# To create a matrix:
+# * Matrix[*rows]
+# * Matrix.[](*rows)
+# * Matrix.rows(rows, copy = true)
+# * Matrix.columns(columns)
+# * Matrix.build(row_count, column_count, &block)
+# * Matrix.diagonal(*values)
+# * Matrix.scalar(n, value)
+# * Matrix.identity(n)
+# * Matrix.unit(n)
+# * Matrix.I(n)
+# * Matrix.zero(n)
+# * Matrix.row_vector(row)
+# * Matrix.column_vector(column)
+#
+# To access Matrix elements/columns/rows/submatrices/properties:
+# * #[](i, j)
+# * #row_count (row_size)
+# * #column_count (column_size)
+# * #row(i)
+# * #column(j)
+# * #collect
+# * #map
+# * #each
+# * #each_with_index
+# * #find_index
+# * #minor(*param)
+# * #first_minor(row, column)
+# * #cofactor(row, column)
+#
+# Properties of a matrix:
+# * #diagonal?
+# * #empty?
+# * #hermitian?
+# * #lower_triangular?
+# * #normal?
+# * #orthogonal?
+# * #permutation?
+# * #real?
+# * #regular?
+# * #singular?
+# * #square?
+# * #symmetric?
+# * #unitary?
+# * #upper_triangular?
+# * #zero?
+#
+# Matrix arithmetic:
+# * #*(m)
+# * #+(m)
+# * #-(m)
+# * #/(m)
+# * #inverse
+# * #inv
+# * #**
+#
+# Matrix functions:
+# * #determinant
+# * #det
+# * #rank
+# * #round
+# * #trace
+# * #tr
+# * #transpose
+# * #t
+#
+# Matrix decompositions:
+# * #eigen
+# * #eigensystem
+# * #lup
+# * #lup_decomposition
+#
+# Complex arithmetic:
+# * conj
+# * conjugate
+# * imag
+# * imaginary
+# * real
+# * rect
+# * rectangular
+#
+# Conversion to other data types:
+# * #coerce(other)
+# * #row_vectors
+# * #column_vectors
+# * #to_a
+#
+# String representations:
+# * #to_s
+# * #inspect
#
class Matrix
include Enumerable
@@ -61,7 +152,7 @@ class Matrix
# -1 66
#
def Matrix.rows(rows, copy = true)
- rows = convert_to_array(rows, copy)
+ rows = convert_to_array(rows)
rows.map! do |row|
convert_to_array(row, copy)
end
@@ -205,80 +296,6 @@ class Matrix
end
#
- # Create a matrix by stacking matrices vertically
- #
- # x = Matrix[[1, 2], [3, 4]]
- # y = Matrix[[5, 6], [7, 8]]
- # Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
- #
- def Matrix.vstack(x, *matrices)
- x = CoercionHelper.coerce_to_matrix(x)
- result = x.send(:rows).map(&:dup)
- matrices.each do |m|
- m = CoercionHelper.coerce_to_matrix(m)
- if m.column_count != x.column_count
- raise ErrDimensionMismatch, "The given matrices must have #{x.column_count} columns, but one has #{m.column_count}"
- end
- result.concat(m.send(:rows))
- end
- new result, x.column_count
- end
-
-
- #
- # Create a matrix by stacking matrices horizontally
- #
- # x = Matrix[[1, 2], [3, 4]]
- # y = Matrix[[5, 6], [7, 8]]
- # Matrix.hstack(x, y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
- #
- def Matrix.hstack(x, *matrices)
- x = CoercionHelper.coerce_to_matrix(x)
- result = x.send(:rows).map(&:dup)
- total_column_count = x.column_count
- matrices.each do |m|
- m = CoercionHelper.coerce_to_matrix(m)
- if m.row_count != x.row_count
- raise ErrDimensionMismatch, "The given matrices must have #{x.row_count} rows, but one has #{m.row_count}"
- end
- result.each_with_index do |row, i|
- row.concat m.send(:rows)[i]
- end
- total_column_count += m.column_count
- end
- new result, total_column_count
- end
-
- #
- # Create a matrix by combining matrices entrywise, using the given block
- #
- # x = Matrix[[6, 6], [4, 4]]
- # y = Matrix[[1, 2], [3, 4]]
- # Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
- #
- def Matrix.combine(*matrices)
- return to_enum(__method__, *matrices) unless block_given?
-
- return Matrix.empty if matrices.empty?
- matrices.map!(&CoercionHelper.method(:coerce_to_matrix))
- x = matrices.first
- matrices.each do |m|
- Matrix.Raise ErrDimensionMismatch unless x.row_count == m.row_count && x.column_count == m.column_count
- end
-
- rows = Array.new(x.row_count) do |i|
- Array.new(x.column_count) do |j|
- yield matrices.map{|m| m[i,j]}
- end
- end
- new rows, x.column_count
- end
-
- def combine(*matrices, &block)
- Matrix.combine(self, *matrices, &block)
- end
-
- #
# Matrix.new is private; use Matrix.rows, columns, [], etc... to create.
#
def initialize(rows, column_count = rows[0].size)
@@ -374,7 +391,7 @@ class Matrix
#
# Yields all elements of the matrix, starting with those of the first row,
- # or returns an Enumerator if no block given.
+ # or returns an Enumerator is no block given.
# Elements can be restricted by passing an argument:
# * :all (default): yields all elements
# * :diagonal: yields only elements on the diagonal
@@ -619,57 +636,12 @@ class Matrix
det_of_minor * (-1) ** (row + column)
end
- #
- # Returns the adjugate of the matrix.
- #
- # Matrix[ [7,6],[3,9] ].adjugate
- # => 9 -6
- # -3 7
- #
- def adjugate
- Matrix.Raise ErrDimensionMismatch unless square?
- Matrix.build(row_count, column_count) do |row, column|
- cofactor(column, row)
- end
- end
-
- #
- # Returns the Laplace expansion along given row or column.
- #
- # Matrix[[7,6], [3,9]].laplace_expansion(column: 1)
- # => 45
- #
- # Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0)
- # => Vector[3, -2]
- #
- #
- def laplace_expansion(row: nil, column: nil)
- num = row || column
-
- if !num || (row && column)
- raise ArgumentError, "exactly one the row or column arguments must be specified"
- end
-
- Matrix.Raise ErrDimensionMismatch unless square?
- raise RuntimeError, "laplace_expansion of empty matrix is not defined" if empty?
-
- unless 0 <= num && num < row_count
- raise ArgumentError, "invalid num (#{num.inspect} for 0..#{row_count - 1})"
- end
-
- send(row ? :row : :column, num).map.with_index { |e, k|
- e * cofactor(*(row ? [num, k] : [k,num]))
- }.inject(:+)
- end
- alias_method :cofactor_expansion, :laplace_expansion
-
-
#--
# TESTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
#
- # Returns +true+ if this is a diagonal matrix.
+ # Returns +true+ is this is a diagonal matrix.
# Raises an error if matrix is not square.
#
def diagonal?
@@ -686,7 +658,7 @@ class Matrix
end
#
- # Returns +true+ if this is an hermitian matrix.
+ # Returns +true+ is this is an hermitian matrix.
# Raises an error if matrix is not square.
#
def hermitian?
@@ -697,14 +669,14 @@ class Matrix
end
#
- # Returns +true+ if this is a lower triangular matrix.
+ # Returns +true+ is this is a lower triangular matrix.
#
def lower_triangular?
each(:strict_upper).all?(&:zero?)
end
#
- # Returns +true+ if this is a normal matrix.
+ # Returns +true+ is this is a normal matrix.
# Raises an error if matrix is not square.
#
def normal?
@@ -722,7 +694,7 @@ class Matrix
end
#
- # Returns +true+ if this is an orthogonal matrix
+ # Returns +true+ is this is an orthogonal matrix
# Raises an error if matrix is not square.
#
def orthogonal?
@@ -740,7 +712,7 @@ class Matrix
end
#
- # Returns +true+ if this is a permutation matrix
+ # Returns +true+ is this is a permutation matrix
# Raises an error if matrix is not square.
#
def permutation?
@@ -776,21 +748,21 @@ class Matrix
end
#
- # Returns +true+ if this is a singular matrix.
+ # Returns +true+ is this is a singular matrix.
#
def singular?
determinant == 0
end
#
- # Returns +true+ if this is a square matrix.
+ # Returns +true+ is this is a square matrix.
#
def square?
column_count == row_count
end
#
- # Returns +true+ if this is a symmetric matrix.
+ # Returns +true+ is this is a symmetric matrix.
# Raises an error if matrix is not square.
#
def symmetric?
@@ -802,7 +774,7 @@ class Matrix
end
#
- # Returns +true+ if this is a unitary matrix
+ # Returns +true+ is this is a unitary matrix
# Raises an error if matrix is not square.
#
def unitary?
@@ -820,14 +792,14 @@ class Matrix
end
#
- # Returns +true+ if this is an upper triangular matrix.
+ # Returns +true+ is this is an upper triangular matrix.
#
def upper_triangular?
each(:strict_lower).all?(&:zero?)
end
#
- # Returns +true+ if this is a matrix with only zero elements
+ # Returns +true+ is this is a matrix with only zero elements
#
def zero?
all?(&:zero?)
@@ -980,17 +952,6 @@ class Matrix
end
#
- # Hadamard product
- # Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]])
- # => 1 4
- # 9 8
- #
- def hadamard_product(m)
- combine(m){|a, b| a * b}
- end
- alias_method :entrywise_product, :hadamard_product
-
- #
# Returns the inverse of the matrix.
# Matrix[[-1, -1], [0, -1]].inverse
# => -1 1
@@ -1056,7 +1017,7 @@ class Matrix
# => 67 96
# 48 99
#
- def **(other)
+ def ** (other)
case other
when Integer
x = self
@@ -1079,14 +1040,6 @@ class Matrix
end
end
- def +@
- self
- end
-
- def -@
- collect {|e| -e }
- end
-
#--
# MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -1184,24 +1137,12 @@ class Matrix
# deprecated; use Matrix#determinant
#
def determinant_e
- warn "Matrix#determinant_e is deprecated; use #determinant", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Matrix#determinant_e is deprecated; use #determinant"
determinant
end
alias det_e determinant_e
#
- # Returns a new matrix resulting by stacking horizontally
- # the receiver with the given matrices
- #
- # x = Matrix[[1, 2], [3, 4]]
- # y = Matrix[[5, 6], [7, 8]]
- # x.hstack(y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
- #
- def hstack(*matrices)
- self.class.hstack(self, *matrices)
- end
-
- #
# Returns the rank of the matrix.
# Beware that using Float values can yield erroneous results
# because of their lack of precision.
@@ -1242,7 +1183,7 @@ class Matrix
# deprecated; use Matrix#rank
#
def rank_e
- warn "Matrix#rank_e is deprecated; use #rank", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Matrix#rank_e is deprecated; use #rank"
rank
end
@@ -1282,18 +1223,6 @@ class Matrix
end
alias t transpose
- #
- # Returns a new matrix resulting by stacking vertically
- # the receiver with the given matrices
- #
- # x = Matrix[[1, 2], [3, 4]]
- # y = Matrix[[5, 6], [7, 8]]
- # x.vstack(y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
- #
- def vstack(*matrices)
- self.class.vstack(self, *matrices)
- end
-
#--
# DECOMPOSITIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#++
@@ -1421,13 +1350,6 @@ class Matrix
end
#
- # Explicit conversion to a Matrix. Returns self
- #
- def to_matrix
- self
- end
-
- #
# Returns an array of arrays that describe the rows of the matrix.
#
def to_a
@@ -1435,17 +1357,17 @@ class Matrix
end
def elements_to_f
- warn "Matrix#elements_to_f is deprecated, use map(&:to_f)", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Matrix#elements_to_f is deprecated, use map(&:to_f)"
map(&:to_f)
end
def elements_to_i
- warn "Matrix#elements_to_i is deprecated, use map(&:to_i)", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Matrix#elements_to_i is deprecated, use map(&:to_i)"
map(&:to_i)
end
def elements_to_r
- warn "Matrix#elements_to_r is deprecated, use map(&:to_r)", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Matrix#elements_to_r is deprecated, use map(&:to_r)"
map(&:to_r)
end
@@ -1527,7 +1449,7 @@ class Matrix
#
def self.coerce_to(obj, cls, meth) # :nodoc:
return obj if obj.kind_of?(cls)
- raise TypeError, "Expected a #{cls} but got a #{obj.class}" unless obj.respond_to? meth
+
begin
ret = obj.__send__(meth)
rescue Exception => e
@@ -1541,10 +1463,6 @@ class Matrix
def self.coerce_to_int(obj)
coerce_to(obj, Integer, :to_int)
end
-
- def self.coerce_to_matrix(obj)
- coerce_to(obj, Matrix, :to_matrix)
- end
end
include CoercionHelper
@@ -1593,7 +1511,7 @@ class Matrix
end
end
- def /(other)
+ def / (other)
case other
when Numeric
Scalar.new(@value / other)
@@ -1606,7 +1524,7 @@ class Matrix
end
end
- def **(other)
+ def ** (other)
case other
when Numeric
Scalar.new(@value ** other)
@@ -1633,8 +1551,6 @@ end
# To create a Vector:
# * Vector.[](*array)
# * Vector.elements(array, copy = true)
-# * Vector.basis(size: n, index: k)
-# * Vector.zero(n)
#
# To access elements:
# * #[](i)
@@ -1643,23 +1559,14 @@ end
# * #each2(v)
# * #collect2(v)
#
-# Properties of vectors:
-# * #angle_with(v)
-# * Vector.independent?(*vs)
-# * #independent?(*vs)
-# * #zero?
-#
# Vector arithmetic:
# * #*(x) "is matrix or number"
# * #+(v)
# * #-(v)
-# * #/(v)
-# * #+@
-# * #-@
#
# Vector functions:
-# * #inner_product(v), dot(v)
-# * #cross_product(v), cross(v)
+# * #inner_product(v)
+# * #cross_product(v)
# * #collect
# * #magnitude
# * #map
@@ -1667,7 +1574,6 @@ end
# * #norm
# * #normalize
# * #r
-# * #round
# * #size
#
# Conversion to other data types:
@@ -1707,30 +1613,6 @@ class Vector
end
#
- # Returns a standard basis +n+-vector, where k is the index.
- #
- # Vector.basis(size:, index:) # => Vector[0, 1, 0]
- #
- def Vector.basis(size:, index:)
- raise ArgumentError, "invalid size (#{size} for 1..)" if size < 1
- raise ArgumentError, "invalid index (#{index} for 0...#{size})" unless 0 <= index && index < size
- array = Array.new(size, 0)
- array[index] = 1
- new convert_to_array(array, false)
- end
-
- #
- # Return a zero vector.
- #
- # Vector.zero(3) => Vector[0, 0, 0]
- #
- def Vector.zero(size)
- raise ArgumentError, "invalid size (#{size} for 0..)" if size < 0
- array = Array.new(size, 0)
- new convert_to_array(array, false)
- end
-
- #
# Vector.new is private; use Vector[] or Vector.elements to create.
#
def initialize(array)
@@ -1756,13 +1638,6 @@ class Vector
alias set_component []=
private :[]=, :set_element, :set_component
- # Returns a vector with entries rounded to the given precision
- # (see Float#round)
- #
- def round(ndigits=0)
- map{|e| e.round(ndigits)}
- end
-
#
# Returns the number of elements in the vector.
#
@@ -1810,48 +1685,6 @@ class Vector
end
#--
- # PROPERTIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- #++
-
- #
- # Returns +true+ iff all of vectors are linearly independent.
- #
- # Vector.independent?(Vector[1,0], Vector[0,1])
- # => true
- #
- # Vector.independent?(Vector[1,2], Vector[2,4])
- # => false
- #
- def Vector.independent?(*vs)
- vs.each do |v|
- raise TypeError, "expected Vector, got #{v.class}" unless v.is_a?(Vector)
- Vector.Raise ErrDimensionMismatch unless v.size == vs.first.size
- end
- return false if vs.count > vs.first.size
- Matrix[*vs].rank.eql?(vs.count)
- end
-
- #
- # Returns +true+ iff all of vectors are linearly independent.
- #
- # Vector[1,0].independent?(Vector[0,1])
- # => true
- #
- # Vector[1,2].independent?(Vector[2,4])
- # => false
- #
- def independent?(*vs)
- self.class.independent?(self, *vs)
- end
-
- #
- # Returns +true+ iff all elements are zero.
- #
- def zero?
- all?(&:zero?)
- end
-
- #--
# COMPARING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -1869,14 +1702,14 @@ class Vector
end
#
- # Returns a copy of the vector.
+ # Return a copy of the vector.
#
def clone
self.class.elements(@elements)
end
#
- # Returns a hash-code for the vector.
+ # Return a hash-code for the vector.
#
def hash
@elements.hash
@@ -1887,7 +1720,7 @@ class Vector
#++
#
- # Multiplies the vector by +x+, where +x+ is a number or a matrix.
+ # Multiplies the vector by +x+, where +x+ is a number or another vector.
#
def *(x)
case x
@@ -1954,14 +1787,6 @@ class Vector
end
end
- def +@
- self
- end
-
- def -@
- collect {|e| -e }
- end
-
#--
# VECTOR FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -1979,41 +1804,17 @@ class Vector
}
p
end
- alias_method :dot, :inner_product
#
- # Returns the cross product of this vector with the others.
+ # Returns the cross product of this vector with the other.
# Vector[1, 0, 0].cross_product Vector[0, 1, 0] => Vector[0, 0, 1]
#
- # It is generalized to other dimensions to return a vector perpendicular
- # to the arguments.
- # Vector[1, 2].cross_product # => Vector[-2, 1]
- # Vector[1, 0, 0, 0].cross_product(
- # Vector[0, 1, 0, 0],
- # Vector[0, 0, 1, 0]
- # ) #=> Vector[0, 0, 0, 1]
- #
- def cross_product(*vs)
- raise ErrOperationNotDefined, "cross product is not defined on vectors of dimension #{size}" unless size >= 2
- raise ArgumentError, "wrong number of arguments (#{vs.size} for #{size - 2})" unless vs.size == size - 2
- vs.each do |v|
- raise TypeError, "expected Vector, got #{v.class}" unless v.is_a? Vector
- Vector.Raise ErrDimensionMismatch unless v.size == size
- end
- case size
- when 2
- Vector[-@elements[1], @elements[0]]
- when 3
- v = vs[0]
- Vector[ v[2]*@elements[1] - v[1]*@elements[2],
- v[0]*@elements[2] - v[2]*@elements[0],
- v[1]*@elements[0] - v[0]*@elements[1] ]
- else
- rows = self, *vs, Array.new(size) {|i| Vector.basis(size: size, index: i) }
- Matrix.rows(rows).laplace_expansion(row: size - 1)
- end
+ def cross_product(v)
+ Vector.Raise ErrDimensionMismatch unless size == v.size && v.size == 3
+ Vector[ v[2]*@elements[1] - v[1]*@elements[2],
+ v[0]*@elements[2] - v[2]*@elements[0],
+ v[1]*@elements[0] - v[0]*@elements[1] ]
end
- alias_method :cross, :cross_product
#
# Like Array#collect.
@@ -2058,20 +1859,6 @@ class Vector
self / n
end
- #
- # Returns an angle with another vector. Result is within the [0...Math::PI].
- # Vector[1,0].angle_with(Vector[0,1])
- # # => Math::PI / 2
- #
- def angle_with(v)
- raise TypeError, "Expected a Vector, got a #{v.class}" unless v.is_a?(Vector)
- Vector.Raise ErrDimensionMismatch if size != v.size
- prod = magnitude * v.magnitude
- raise ZeroVectorError, "Can't get angle of zero vector" if prod == 0
-
- Math.acos( inner_product(v) / prod )
- end
-
#--
# CONVERTING
#++
@@ -2090,25 +1877,18 @@ class Vector
@elements.dup
end
- #
- # Return a single-column matrix from this vector
- #
- def to_matrix
- Matrix.column_vector(self)
- end
-
def elements_to_f
- warn "Vector#elements_to_f is deprecated", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Vector#elements_to_f is deprecated"
map(&:to_f)
end
def elements_to_i
- warn "Vector#elements_to_i is deprecated", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Vector#elements_to_i is deprecated"
map(&:to_i)
end
def elements_to_r
- warn "Vector#elements_to_r is deprecated", uplevel: 1
+ warn "#{caller(1)[0]}: warning: Vector#elements_to_r is deprecated"
map(&:to_r)
end
diff --git a/lib/matrix/eigenvalue_decomposition.rb b/lib/matrix/eigenvalue_decomposition.rb
index 919db9e83d..ab353ecf61 100644
--- a/lib/matrix/eigenvalue_decomposition.rb
+++ b/lib/matrix/eigenvalue_decomposition.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
class Matrix
# Adapted from JAMA: http://math.nist.gov/javanumerics/jama/
@@ -120,113 +119,113 @@ class Matrix
# Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
# Fortran subroutine in EISPACK.
- @size.times do |j|
- @d[j] = @v[@size-1][j]
- end
+ @size.times do |j|
+ @d[j] = @v[@size-1][j]
+ end
- # Householder reduction to tridiagonal form.
+ # Householder reduction to tridiagonal form.
- (@size-1).downto(0+1) do |i|
+ (@size-1).downto(0+1) do |i|
- # Scale to avoid under/overflow.
+ # Scale to avoid under/overflow.
- scale = 0.0
- h = 0.0
- i.times do |k|
- scale = scale + @d[k].abs
- end
- if (scale == 0.0)
- @e[i] = @d[i-1]
- i.times do |j|
- @d[j] = @v[i-1][j]
- @v[i][j] = 0.0
- @v[j][i] = 0.0
- end
- else
+ scale = 0.0
+ h = 0.0
+ i.times do |k|
+ scale = scale + @d[k].abs
+ end
+ if (scale == 0.0)
+ @e[i] = @d[i-1]
+ i.times do |j|
+ @d[j] = @v[i-1][j]
+ @v[i][j] = 0.0
+ @v[j][i] = 0.0
+ end
+ else
- # Generate Householder vector.
+ # Generate Householder vector.
- i.times do |k|
- @d[k] /= scale
- h += @d[k] * @d[k]
- end
- f = @d[i-1]
- g = Math.sqrt(h)
- if (f > 0)
- g = -g
- end
- @e[i] = scale * g
- h -= f * g
- @d[i-1] = f - g
- i.times do |j|
- @e[j] = 0.0
- end
+ i.times do |k|
+ @d[k] /= scale
+ h += @d[k] * @d[k]
+ end
+ f = @d[i-1]
+ g = Math.sqrt(h)
+ if (f > 0)
+ g = -g
+ end
+ @e[i] = scale * g
+ h -= f * g
+ @d[i-1] = f - g
+ i.times do |j|
+ @e[j] = 0.0
+ end
- # Apply similarity transformation to remaining columns.
+ # Apply similarity transformation to remaining columns.
- i.times do |j|
- f = @d[j]
- @v[j][i] = f
- g = @e[j] + @v[j][j] * f
- (j+1).upto(i-1) do |k|
- g += @v[k][j] * @d[k]
- @e[k] += @v[k][j] * f
+ i.times do |j|
+ f = @d[j]
+ @v[j][i] = f
+ g = @e[j] + @v[j][j] * f
+ (j+1).upto(i-1) do |k|
+ g += @v[k][j] * @d[k]
+ @e[k] += @v[k][j] * f
+ end
+ @e[j] = g
+ end
+ f = 0.0
+ i.times do |j|
+ @e[j] /= h
+ f += @e[j] * @d[j]
+ end
+ hh = f / (h + h)
+ i.times do |j|
+ @e[j] -= hh * @d[j]
+ end
+ i.times do |j|
+ f = @d[j]
+ g = @e[j]
+ j.upto(i-1) do |k|
+ @v[k][j] -= (f * @e[k] + g * @d[k])
+ end
+ @d[j] = @v[i-1][j]
+ @v[i][j] = 0.0
end
- @e[j] = g
- end
- f = 0.0
- i.times do |j|
- @e[j] /= h
- f += @e[j] * @d[j]
- end
- hh = f / (h + h)
- i.times do |j|
- @e[j] -= hh * @d[j]
- end
- i.times do |j|
- f = @d[j]
- g = @e[j]
- j.upto(i-1) do |k|
- @v[k][j] -= (f * @e[k] + g * @d[k])
- end
- @d[j] = @v[i-1][j]
- @v[i][j] = 0.0
end
+ @d[i] = h
end
- @d[i] = h
- end
- # Accumulate transformations.
+ # Accumulate transformations.
- 0.upto(@size-1-1) do |i|
- @v[@size-1][i] = @v[i][i]
- @v[i][i] = 1.0
- h = @d[i+1]
- if (h != 0.0)
- 0.upto(i) do |k|
- @d[k] = @v[k][i+1] / h
- end
- 0.upto(i) do |j|
- g = 0.0
+ 0.upto(@size-1-1) do |i|
+ @v[@size-1][i] = @v[i][i]
+ @v[i][i] = 1.0
+ h = @d[i+1]
+ if (h != 0.0)
0.upto(i) do |k|
- g += @v[k][i+1] * @v[k][j]
+ @d[k] = @v[k][i+1] / h
end
- 0.upto(i) do |k|
- @v[k][j] -= g * @d[k]
+ 0.upto(i) do |j|
+ g = 0.0
+ 0.upto(i) do |k|
+ g += @v[k][i+1] * @v[k][j]
+ end
+ 0.upto(i) do |k|
+ @v[k][j] -= g * @d[k]
+ end
end
end
+ 0.upto(i) do |k|
+ @v[k][i+1] = 0.0
+ end
end
- 0.upto(i) do |k|
- @v[k][i+1] = 0.0
+ @size.times do |j|
+ @d[j] = @v[@size-1][j]
+ @v[@size-1][j] = 0.0
end
+ @v[@size-1][@size-1] = 1.0
+ @e[0] = 0.0
end
- @size.times do |j|
- @d[j] = @v[@size-1][j]
- @v[@size-1][j] = 0.0
- end
- @v[@size-1][@size-1] = 1.0
- @e[0] = 0.0
- end
# Symmetric tridiagonal QL algorithm.
@@ -459,7 +458,7 @@ class Matrix
high = nn-1
eps = Float::EPSILON
exshift = 0.0
- p = q = r = s = z = 0
+ p=q=r=s=z=0
# Store roots isolated by balanc and compute matrix norm
@@ -728,20 +727,20 @@ class Matrix
return
end
- (nn-1).downto(0) do |k|
- p = @d[k]
- q = @e[k]
+ (nn-1).downto(0) do |n|
+ p = @d[n]
+ q = @e[n]
# Real vector
if (q == 0)
- l = k
- @h[k][k] = 1.0
- (k-1).downto(0) do |i|
+ l = n
+ @h[n][n] = 1.0
+ (n-1).downto(0) do |i|
w = @h[i][i] - p
r = 0.0
- l.upto(k) do |j|
- r += @h[i][j] * @h[j][k]
+ l.upto(n) do |j|
+ r += @h[i][j] * @h[j][n]
end
if (@e[i] < 0.0)
z = w
@@ -750,9 +749,9 @@ class Matrix
l = i
if (@e[i] == 0.0)
if (w != 0.0)
- @h[i][k] = -r / w
+ @h[i][n] = -r / w
else
- @h[i][k] = -r / (eps * norm)
+ @h[i][n] = -r / (eps * norm)
end
# Solve real equations
@@ -762,20 +761,20 @@ class Matrix
y = @h[i+1][i]
q = (@d[i] - p) * (@d[i] - p) + @e[i] * @e[i]
t = (x * s - z * r) / q
- @h[i][k] = t
+ @h[i][n] = t
if (x.abs > z.abs)
- @h[i+1][k] = (-r - w * t) / x
+ @h[i+1][n] = (-r - w * t) / x
else
- @h[i+1][k] = (-s - y * t) / z
+ @h[i+1][n] = (-s - y * t) / z
end
end
# Overflow control
- t = @h[i][k].abs
+ t = @h[i][n].abs
if ((eps * t) * t > 1)
- i.upto(k) do |j|
- @h[j][k] = @h[j][k] / t
+ i.upto(n) do |j|
+ @h[j][n] = @h[j][n] / t
end
end
end
diff --git a/lib/matrix/lup_decomposition.rb b/lib/matrix/lup_decomposition.rb
index c001770a12..30f3276253 100644
--- a/lib/matrix/lup_decomposition.rb
+++ b/lib/matrix/lup_decomposition.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
class Matrix
# Adapted from JAMA: http://math.nist.gov/javanumerics/jama/
@@ -64,7 +63,7 @@ class Matrix
# Returns +true+ if +U+, and hence +A+, is singular.
- def singular?
+ def singular? ()
@column_count.times do |j|
if (@lu[j][j] == 0)
return true
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 74b42289b1..2a83189e30 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1,5 +1,4 @@
# -*- coding: us-ascii -*-
-# frozen-string-literal: false
# module to create Makefile for extension modules
# invoke like: ruby -r mkmf extconf.rb
@@ -129,9 +128,12 @@ module MakeMakefile
$vendorarchdir = CONFIG["vendorarchdir"]
$mswin = /mswin/ =~ RUBY_PLATFORM
+ $bccwin = /bccwin/ =~ RUBY_PLATFORM
$mingw = /mingw/ =~ RUBY_PLATFORM
$cygwin = /cygwin/ =~ RUBY_PLATFORM
$netbsd = /netbsd/ =~ RUBY_PLATFORM
+ $os2 = /os2/ =~ RUBY_PLATFORM
+ $beos = /beos/ =~ RUBY_PLATFORM
$haiku = /haiku/ =~ RUBY_PLATFORM
$solaris = /solaris/ =~ RUBY_PLATFORM
$universal = /universal/ =~ RUBY_PLATFORM
@@ -175,7 +177,7 @@ module MakeMakefile
]
def install_dirs(target_prefix = nil)
- if $extout and $extmk
+ if $extout
dirs = [
['BINDIR', '$(extout)/bin'],
['RUBYCOMMONDIR', '$(extout)/common'],
@@ -249,7 +251,6 @@ module MakeMakefile
OUTFLAG = CONFIG['OUTFLAG']
COUTFLAG = CONFIG['COUTFLAG']
- CSRCFLAG = CONFIG['CSRCFLAG']
CPPOUTFILE = config_string('CPPOUTFILE') {|str| str.sub(/\bconftest\b/, CONFTEST)}
def rm_f(*files)
@@ -386,9 +387,8 @@ module MakeMakefile
if opts and opts[:werror]
result = nil
Logging.postpone do |log|
- output = IO.popen(libpath_env, command, &:read)
- result = ($?.success? and File.zero?(log.path))
- output
+ result = (system(libpath_env, command) and File.zero?(log.path))
+ ""
end
result
else
@@ -463,10 +463,11 @@ MSG
xsystem(command, *opts)
ensure
log_src(src)
+ MakeMakefile.rm_rf "#{CONFTEST}.dSYM"
end
end
- def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
+ def link_command(ldflags, opt="", libpath=$LIBPATH|$DEFLIBPATH)
librubyarg = $extmk ? $LIBRUBYARG_STATIC : "$(LIBRUBYARG)"
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote,
'src' => "#{CONFTEST_C}",
@@ -502,7 +503,7 @@ MSG
conf)
end
- def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
+ def libpathflag(libpath=$LIBPATH|$DEFLIBPATH)
libpath.map{|x|
case x
when "$(topdir)", /\A\./
@@ -525,7 +526,6 @@ MSG
end
def try_link0(src, opt="", *opts, &b) # :nodoc:
- exe = CONFTEST+$EXEEXT
cmd = link_command("", opt)
if $universal
require 'tmpdir'
@@ -539,10 +539,7 @@ MSG
end
else
try_do(src, cmd, *opts, &b)
- end and File.executable?(exe) or return nil
- exe
- ensure
- MakeMakefile.rm_rf(*Dir["#{CONFTEST}*"]-[exe])
+ end and File.executable?(CONFTEST+$EXEEXT)
end
# Returns whether or not the +src+ can be compiled as a C source and linked
@@ -556,9 +553,9 @@ MSG
# [+src+] a String which contains a C source
# [+opt+] a String which contains linker options
def try_link(src, opt="", *opts, &b)
- exe = try_link0(src, opt, *opts, &b) or return false
- MakeMakefile.rm_f exe
- true
+ try_link0(src, opt, *opts, &b)
+ ensure
+ MakeMakefile.rm_f "#{CONFTEST}*", "c0x32*"
end
# Returns whether or not the +src+ can be compiled as a C source. +opt+ is
@@ -571,7 +568,7 @@ MSG
# [+src+] a String which contains a C source
# [+opt+] a String which contains compiler options
def try_compile(src, opt="", *opts, &b)
- with_werror(opt, *opts) {|_opt, *| try_do(src, cc_command(_opt), *opts, &b)} and
+ with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)} and
File.file?("#{CONFTEST}.#{$OBJEXT}")
ensure
MakeMakefile.rm_f "#{CONFTEST}*"
@@ -606,68 +603,43 @@ MSG
def with_cppflags(flags)
cppflags = $CPPFLAGS
- $CPPFLAGS = flags.dup
+ $CPPFLAGS = flags
ret = yield
ensure
$CPPFLAGS = cppflags unless ret
end
- def try_cppflags(flags, opts = {})
- try_header(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts))
- end
-
- def append_cppflags(flags, *opts)
- Array(flags).each do |flag|
- if checking_for("whether #{flag} is accepted as CPPFLAGS") {
- try_cppflags(flag, *opts)
- }
- $CPPFLAGS << " " << flag
- end
+ def try_cppflags(flags)
+ with_cppflags(flags) do
+ try_header("int main() {return 0;}")
end
end
def with_cflags(flags)
cflags = $CFLAGS
- $CFLAGS = flags.dup
+ $CFLAGS = flags
ret = yield
ensure
$CFLAGS = cflags unless ret
end
- def try_cflags(flags, opts = {})
- try_compile(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts))
- end
-
- def append_cflags(flags, *opts)
- Array(flags).each do |flag|
- if checking_for("whether #{flag} is accepted as CFLAGS") {
- try_cflags(flag, *opts)
- }
- $CFLAGS << " " << flag
- end
+ def try_cflags(flags)
+ with_cflags(flags) do
+ try_compile("int main() {return 0;}")
end
end
def with_ldflags(flags)
ldflags = $LDFLAGS
- $LDFLAGS = flags.dup
+ $LDFLAGS = flags
ret = yield
ensure
$LDFLAGS = ldflags unless ret
end
- def try_ldflags(flags, opts = {})
- opts = {:werror => true}.update(opts) if $mswin
- try_link(MAIN_DOES_NOTHING, flags, opts)
- end
-
- def append_ldflags(flags, *opts)
- Array(flags).each do |flag|
- if checking_for("whether #{flag} is accepted as LDFLAGS") {
- try_ldflags(flag, *opts)
- }
- $LDFLAGS << " " << flag
- end
+ def try_ldflags(flags)
+ with_ldflags(flags) do
+ try_link("int main() {return 0;}")
end
end
@@ -733,7 +705,7 @@ int main() {printf("%"PRI_CONFTEST_PREFIX"#{neg ? 'd' : 'u'}\\n", conftest_const
end
end
ensure
- MakeMakefile.rm_f "#{CONFTEST}#{$EXEEXT}"
+ MakeMakefile.rm_f "#{CONFTEST}*"
end
end
nil
@@ -752,8 +724,6 @@ int main() {printf("%"PRI_CONFTEST_PREFIX"#{neg ? 'd' : 'u'}\\n", conftest_const
decltype = proc {|x|"const volatile void *#{x}"}
when /\)$/
call = func
- when nil
- call = ""
else
call = "#{func}()"
decltype = proc {|x| "void ((*#{x})())"}
@@ -773,14 +743,13 @@ int main() {printf("%"PRI_CONFTEST_PREFIX"#{neg ? 'd' : 'u'}\\n", conftest_const
/*top*/
extern int t(void);
#{MAIN_DOES_NOTHING 't'}
-int t(void) { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return !p; }
+int t(void) { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; }
SRC
call && try_link(<<"SRC", opt, &b)
#{headers}
/*top*/
extern int t(void);
#{MAIN_DOES_NOTHING 't'}
-#{"extern void #{call};" if decltype}
int t(void) { #{call}; return 0; }
SRC
end
@@ -793,7 +762,7 @@ SRC
/*top*/
extern int t(void);
#{MAIN_DOES_NOTHING 't'}
-int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return !p; }
+int t(void) { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
SRC
end
@@ -946,10 +915,10 @@ SRC
a = r = nil
Logging::postpone do
r = yield
- a = (fmt ? "#{fmt % r}" : r ? "yes" : "no")
- "#{f}#{m}-------------------- #{a}\n\n"
+ a = (fmt ? "#{fmt % r}" : r ? "yes" : "no") << "\n"
+ "#{f}#{m}-------------------- #{a}\n"
end
- message "%s\n", a
+ message(a)
Logging::message "--------------------\n\n"
r
end
@@ -962,10 +931,7 @@ SRC
break noun = noun.send(meth, *args)
end
end
- unless noun.empty?
- msg << " #{pre} " unless msg.empty?
- msg << noun
- end
+ msg << " #{pre} #{noun}" unless noun.empty?
end
msg
end
@@ -996,8 +962,9 @@ SRC
# <code>--with-FOOlib</code> configuration option.
#
def have_library(lib, func = nil, headers = nil, opt = "", &b)
+ func = "main" if !func or func.empty?
lib = with_config(lib+'lib', lib)
- checking_for checking_message(func && func.funcall_style, LIBARG%lib, opt) do
+ checking_for checking_message(func.funcall_style, LIBARG%lib, opt) do
if COMMON_LIBS.include?(lib)
true
else
@@ -1021,9 +988,10 @@ SRC
# library paths searched and linked against.
#
def find_library(lib, func, *paths, &b)
+ func = "main" if !func or func.empty?
lib = with_config(lib+'lib', lib)
paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
- checking_for checking_message(func && func.funcall_style, LIBARG%lib) do
+ checking_for checking_message(func.funcall_style, LIBARG%lib) do
libpath = $LIBPATH
libs = append_library($libs, lib)
begin
@@ -1332,7 +1300,7 @@ SRC
#
def check_sizeof(type, headers = nil, opts = "", &b)
typedef, member, prelude = typedef_expr(type, headers)
- prelude << "#{typedef} *rbcv_ptr_;\n"
+ prelude << "static #{typedef} *rbcv_ptr_;\n"
prelude = [prelude]
expr = "sizeof((*rbcv_ptr_)#{"." << member if member})"
fmt = STRING_OR_FAILED_FORMAT
@@ -1375,7 +1343,7 @@ SRC
# _convertible_ means actually the same type, or typedef'd from the same
# type.
#
- # If the +type+ is an integer type and the _convertible_ type is found,
+ # If the +type+ is a integer type and the _convertible_ type is found,
# the following macros are passed as preprocessor constants to the compiler
# using the +type+ name, in uppercase.
#
@@ -1485,7 +1453,7 @@ SRC
prelude = [cpp_include(headers).split(/^/)]
prelude << ["typedef #{type} rbcv_typedef_;\n",
"extern rbcv_typedef_ *#{func};\n",
- "rbcv_typedef_ #{var};\n",
+ "static rbcv_typedef_ #{var};\n",
]
type = "rbcv_typedef_"
fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s"
@@ -1496,7 +1464,7 @@ SRC
type = "rbcv_mem_typedef_"
prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n"
prelude[-1] << "extern #{type} *#{func};\n"
- prelude[-1] << "#{type} #{var};\n"
+ prelude[-1] << "static #{type} #{var};\n"
val = var
end
def fmt.%(x)
@@ -1519,7 +1487,7 @@ SRC
type = UNIVERSAL_INTS.find do |t|
pre = prelude
unless member
- pre += [["#{unsigned} #{t} #{ptr}#{var};\n",
+ pre += [["static #{unsigned} #{t} #{ptr}#{var};\n",
"extern #{unsigned} #{t} #{ptr}*#{func};\n"]]
end
try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre)
@@ -1558,7 +1526,6 @@ SRC
end
file = nil
path.each do |dir|
- dir.sub!(/\A"(.*)"\z/m, '\1') if $mswin or $mingw
return file if executable_file.call(file = File.join(dir, bin))
if exts
exts.each {|ext| executable_file.call(ext = file + ext) and return ext}
@@ -1795,12 +1762,11 @@ SRC
elsif ($PKGCONFIG ||=
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
find_executable0(pkgconfig) && pkgconfig) and
- xsystem("#{$PKGCONFIG} --exists #{pkg}")
+ system("#{$PKGCONFIG} --exists #{pkg}")
# default to pkg-config command
pkgconfig = $PKGCONFIG
get = proc {|opt|
- opt = xpopen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read)
- Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+ opt = IO.popen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read)
opt.strip if $?.success?
}
elsif find_executable0(pkgconfig = "#{pkg}-config")
@@ -1810,8 +1776,7 @@ SRC
end
if pkgconfig
get ||= proc {|opt|
- opt = xpopen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read)
- Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+ opt = IO.popen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read)
opt.strip if $?.success?
}
end
@@ -1826,18 +1791,11 @@ SRC
cflags = get['cflags']
end
libs = get['libs-only-l']
- if cflags
- $CFLAGS += " " << cflags
- $CXXFLAGS += " " << cflags
- end
- if libs
- ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
- else
- libs, ldflags = Shellwords.shellwords(ldflags).partition {|s| s =~ /-l([^ ]+)/ }.map {|l|l.quote.join(" ")}
- end
- $libs += " " << libs
-
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+ $CFLAGS += " " << cflags
+ $CXXFLAGS += " " << cflags
$LDFLAGS = [orig_ldflags, ldflags].join(' ')
+ $libs += " " << libs
Logging::message "package configuration for %s\n", pkg
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
cflags, ldflags, libs
@@ -1903,8 +1861,8 @@ SHELL = /bin/sh
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
-ECHO1 = $(V:1=@ #{CONFIG['NULLCMD']})
-ECHO = $(ECHO1:0=@ echo)
+ECHO1 = $(V:1=@#{CONFIG['NULLCMD']})
+ECHO = $(ECHO1:0=@echo)
NULLCMD = #{CONFIG['NULLCMD']}
#### Start of system configuration section. ####
@@ -1930,7 +1888,7 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
CONFIG.each do |key, var|
next if /^abs_/ =~ key
- next if /^(?:src|top(?:_src)?|build|hdr)dir$/ =~ key
+ next if /^(?:src|top|hdr)dir$/ =~ key
next unless /dir$/ =~ key
mk << "#{key} = #{with_destdir(var)}\n"
end
@@ -1944,7 +1902,6 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
headers = %w[
$(hdrdir)/ruby.h
- $(hdrdir)/ruby/backward.h
$(hdrdir)/ruby/ruby.h
$(hdrdir)/ruby/defines.h
$(hdrdir)/ruby/missing.h
@@ -1952,7 +1909,6 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
$(hdrdir)/ruby/st.h
$(hdrdir)/ruby/subst.h
]
- headers += $headers
if RULE_SUBST
headers.each {|h| h.sub!(/.*/, &RULE_SUBST.method(:%))}
end
@@ -1969,11 +1925,9 @@ LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
empty =
OUTFLAG = #{OUTFLAG}$(empty)
COUTFLAG = #{COUTFLAG}$(empty)
-CSRCFLAG = #{CSRCFLAG}$(empty)
RUBY_EXTCONF_H = #{$extconf_h}
cflags = #{CONFIG['cflags']}
-cxxflags = #{CONFIG['cxxflags']}
optflags = #{CONFIG['optflags']}
debugflags = #{CONFIG['debugflags']}
warnflags = #{$warnflags}
@@ -2018,21 +1972,28 @@ TOUCH = exit >
preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
}
+ if $nmake == ?b
+ mk.each do |x|
+ x.gsub!(/^(MAKEDIRS|INSTALL_(?:PROG|DATA))+\s*=.*\n/) do
+ "!ifndef " + $1 + "\n" +
+ $& +
+ "!endif\n"
+ end
+ end
+ end
mk
end
def timestamp_file(name, target_prefix = nil)
- pat = {}
- name = '$(RUBYARCHDIR)' if name == '$(TARGET_SO_DIR)'
- install_dirs.each do |n, d|
- pat[n] = $` if /\$\(target_prefix\)\z/ =~ d
- end
- name = name.gsub(/\$\((#{pat.keys.join("|")})\)/) {pat[$1]+target_prefix}
- name.sub!(/(\$\((?:site)?arch\))\/*/, '')
- arch = $1 || ''
- name.chomp!('/')
+ if target_prefix
+ pat = []
+ install_dirs.each do |n, d|
+ pat << n if /\$\(target_prefix\)\z/ =~ d
+ end
+ name = name.gsub(/\$\((#{pat.join("|")})\)/) {$&+target_prefix}
+ end
name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"}
- File.join("$(TIMESTAMP_DIR)", arch, "#{name.sub(/\A(?=.)/, '.')}.time")
+ "$(TIMESTAMP_DIR)/.#{name}.time"
end
# :startdoc:
@@ -2044,7 +2005,6 @@ CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
all install static install-so install-rb: Makefile
- @$(NULLCMD)
.PHONY: all install static install-so install-rb
.PHONY: clean clean-so clean-static clean-rb
@@ -2091,10 +2051,7 @@ RULES
implicit = [[m[1], m[2]], [m.post_match]]
next
elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
- line.sub!(/\s*\#.*$/, '')
- comment = $&
- line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
- line = line.chomp + comment + "\n" if comment
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
end
depout << line
end
@@ -2124,10 +2081,7 @@ RULES
unless suffixes.empty?
depout.unshift(".SUFFIXES: ." + suffixes.uniq.join(" .") + "\n\n")
end
- if $extconf_h
- depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n")
- depout.unshift("$(OBJS): $(hdrdir)/ruby/win32.h\n\n") if $mswin or $mingw
- end
+ depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n") if $extconf_h
depout.flatten!
depout
end
@@ -2187,7 +2141,7 @@ RULES
#
def create_makefile(target, srcprefix = nil)
$target = target
- libpath = $DEFLIBPATH|$LIBPATH
+ libpath = $LIBPATH|$DEFLIBPATH
message "creating Makefile\n"
MakeMakefile.rm_f "#{CONFTEST}*"
if CONFIG["DLEXT"] == $OBJEXT
@@ -2208,15 +2162,11 @@ RULES
RbConfig.expand(srcdir = srcprefix.dup)
ext = ".#{$OBJEXT}"
- orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")].sort
+ orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
if not $objs
srcs = $srcs || orig_srcs
- $objs = []
- objs = srcs.inject(Hash.new {[]}) {|h, f|
- h.key?(o = File.basename(f, ".*") << ext) or $objs << o
- h[o] <<= f
- h
- }
+ objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
+ $objs = objs.keys
unless objs.delete_if {|b, f| f.size == 1}.empty?
dups = objs.sort.map {|b, f|
"#{b[/.*\./]}{#{f.collect {|n| n[/([^.]+)\z/]}.join(',')}}"
@@ -2237,10 +2187,10 @@ RULES
if File.exist?(File.join(srcdir, target + '.def'))
deffile = "$(srcdir)/$(TARGET).def"
unless EXPORT_PREFIX.empty?
- makedef = %{$(RUBY) -pe "$$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i" #{deffile}}
+ makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
end
else
- makedef = %{(echo EXPORTS && echo $(TARGET_ENTRY))}
+ makedef = %{-e "puts 'EXPORTS', '$(TARGET_ENTRY)'"}
end
if makedef
$cleanfiles << '$(DEFFILE)'
@@ -2267,9 +2217,12 @@ RULES
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
+ mfile = open("Makefile", "wb")
conf = configuration(srcprefix)
- conf << "\
-libpath = #{($DEFLIBPATH|$LIBPATH).join(" ")}
+ conf = yield(conf) if block_given?
+ mfile.puts(conf)
+ mfile.print "
+libpath = #{($LIBPATH|$DEFLIBPATH).join(" ")}
LIBPATH = #{libpath}
DEFFILE = #{deffile}
@@ -2286,7 +2239,6 @@ ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
OBJS = #{$objs.join(" ")}
HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')}
-LOCAL_HDRS = #{$headers.join(' ')}
TARGET = #{target}
TARGET_NAME = #{target && target[/\A\w+/]}
TARGET_ENTRY = #{EXPORT_PREFIX || ''}Init_$(TARGET_NAME)
@@ -2294,28 +2246,21 @@ DLLIB = #{dllib}
EXTSTATIC = #{$static || ""}
STATIC_LIB = #{staticlib unless $static.nil?}
#{!$extout && defined?($installed_list) ? "INSTALLED_LIST = #{$installed_list}\n" : ""}
-TIMESTAMP_DIR = #{$extout && $extmk ? '$(extout)/.timestamp' : '.'}
+TIMESTAMP_DIR = #{$extout ? '$(extout)/.timestamp' : '.'}
" #"
# TODO: fixme
- install_dirs.each {|d| conf << ("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
- sodir = $extout ? '$(TARGET_SO_DIR)' : '$(RUBYARCHDIR)'
- n = '$(TARGET_SO_DIR)$(TARGET)'
- conf << "\
-TARGET_SO_DIR =#{$extout ? " $(RUBYARCHDIR)/" : ''}
-TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
-CLEANLIBS = #{'$(TARGET_SO) ' if target}#{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}}
+ install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
+ n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)'
+ mfile.print "
+TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
+CLEANLIBS = #{n}.#{CONFIG['DLEXT']} #{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}}
CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")} if target} *.bak
-" #"
- conf = yield(conf) if block_given?
- mfile = open("Makefile", "wb")
- mfile.puts(conf)
- mfile.print "
all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
-static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{$extout ? " install-rb" : ""}"}
+static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
.PHONY: all install static install-so install-rb
.PHONY: clean clean-so clean-static clean-rb
-" #"
+"
mfile.print CLEANINGS
fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
if fsep
@@ -2333,19 +2278,18 @@ static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{$extout ? " install-rb" :
end
dirs = []
mfile.print "install: install-so install-rb\n\n"
- dir = sodir.dup
+ sodir = (dir = "$(RUBYARCHDIR)").dup
mfile.print("install-so: ")
if target
f = "$(DLLIB)"
- dest = "$(TARGET_SO)"
- stamp = timestamp_file(dir, target_prefix)
+ dest = "#{dir}/#{f}"
if $extout
mfile.puts dest
mfile.print "clean-so::\n"
- mfile.print "\t-$(Q)$(RM) #{fseprepl[dest]} #{fseprepl[stamp]}\n"
+ mfile.print "\t-$(Q)$(RM) #{fseprepl[dest]}\n"
mfile.print "\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
else
- mfile.print "#{f} #{stamp}\n"
+ mfile.print "#{f} #{timestamp_file(dir, target_prefix)}\n"
mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} #{dir}\n"
if defined?($installed_list)
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
@@ -2356,12 +2300,10 @@ static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{$extout ? " install-rb" :
else
mfile.puts "Makefile"
end
- mfile.print("install-rb: pre-install-rb do-install-rb install-rb-default\n")
- mfile.print("install-rb-default: pre-install-rb-default do-install-rb-default\n")
+ mfile.print("install-rb: pre-install-rb install-rb-default\n")
+ mfile.print("install-rb-default: pre-install-rb-default\n")
mfile.print("pre-install-rb: Makefile\n")
mfile.print("pre-install-rb-default: Makefile\n")
- mfile.print("do-install-rb:\n")
- mfile.print("do-install-rb-default:\n")
for sfx, i in [["-default", [["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]]], ["", $INSTALLFILES]]
files = install_files(mfile, i, nil, srcprefix) or next
for dir, *files in files
@@ -2371,9 +2313,9 @@ static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{$extout ? " install-rb" :
end
for f in files
dest = "#{dir}/#{File.basename(f)}"
- mfile.print("do-install-rb#{sfx}: #{dest}\n")
+ mfile.print("install-rb#{sfx}: #{dest}\n")
mfile.print("#{dest}: #{f} #{timestamp_file(dir, target_prefix)}\n")
- mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D)\n")
+ mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
if defined?($installed_list) and !$extout
mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
end
@@ -2387,21 +2329,13 @@ static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{$extout ? " install-rb" :
if files.empty?
mfile.print("\t@$(NULLCMD)\n")
else
- q = "$(MAKE) -q do-install-rb#{sfx}"
- if $nmake
- mfile.print "!if \"$(Q)\" == \"@\"\n\t@#{q} || \\\n!endif\n\t"
- else
- mfile.print "\t$(Q1:0=@#{q} || )"
- end
- mfile.print "$(ECHO1:0=echo) installing#{sfx.sub(/^-/, " ")} #{target} libraries\n"
+ mfile.print("\t$(ECHO) installing#{sfx.sub(/^-/, " ")} #{target} libraries\n")
end
if $extout
dirs.uniq!
unless dirs.empty?
mfile.print("clean-rb#{sfx}::\n")
for dir in dirs.sort_by {|d| -d.count('/')}
- stamp = timestamp_file(dir, target_prefix)
- mfile.print("\t-$(Q)$(RM) #{fseprepl[stamp]}\n")
mfile.print("\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n")
end
end
@@ -2423,35 +2357,29 @@ site-install-rb: install-rb
return unless target
- mfile.print ".SUFFIXES: .#{(SRC_EXT + [$OBJEXT, $ASMEXT]).compact.join(' .')}\n"
+ mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
+ mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
mfile.print "\n"
compile_command = "\n\t$(ECHO) compiling $(<#{rsep})\n\t$(Q) %s\n\n"
- command = compile_command % COMPILE_CXX
- asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_CXX
CXX_EXT.each do |e|
each_compile_rules do |rule|
mfile.printf(rule, e, $OBJEXT)
- mfile.print(command)
- mfile.printf(rule, e, $ASMEXT)
- mfile.print(asm_command)
+ mfile.printf(compile_command, COMPILE_CXX)
end
end
- command = compile_command % COMPILE_C
- asm_command = compile_command.sub(/compiling/, 'translating') % ASSEMBLE_C
C_EXT.each do |e|
each_compile_rules do |rule|
mfile.printf(rule, e, $OBJEXT)
- mfile.print(command)
- mfile.printf(rule, e, $ASMEXT)
- mfile.print(asm_command)
+ mfile.printf(compile_command, COMPILE_C)
end
end
- mfile.print "$(TARGET_SO): "
+ mfile.print "$(RUBYARCHDIR)/" if $extout
+ mfile.print "$(DLLIB): "
mfile.print "$(DEFFILE) " if makedef
mfile.print "$(OBJS) Makefile"
- mfile.print " #{timestamp_file(sodir, target_prefix)}" if $extout
+ mfile.print " #{timestamp_file('$(RUBYARCHDIR)', target_prefix)}" if $extout
mfile.print "\n"
mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n"
mfile.print "\t-$(Q)$(RM) $(@#{sep})\n"
@@ -2472,7 +2400,7 @@ site-install-rb: install-rb
if makedef
mfile.print "$(DEFFILE): #{origdef}\n"
mfile.print "\t$(ECHO) generating $(@#{rsep})\n"
- mfile.print "\t$(Q) #{makedef} > $@\n\n"
+ mfile.print "\t$(Q) $(RUBY) #{makedef} #{origdef} > $@\n\n"
end
depend = File.join(srcdir, "depend")
@@ -2498,9 +2426,6 @@ site-install-rb: install-rb
if $warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes'
# turn warnings into errors only for bundled extensions.
config['warnflags'] = $warnflags.gsub(/(\A|\s)-Werror[-=]/, '\1-W')
- if /icc\z/ =~ config['CC']
- config['warnflags'].gsub!(/(\A|\s)-W(?:division-by-zero|deprecated-declarations)/, '\1')
- end
RbConfig.expand(rbconfig['warnflags'] = config['warnflags'].dup)
config.each do |key, val|
RbConfig.expand(rbconfig[key] = val.dup) if /warnflags/ =~ val
@@ -2519,7 +2444,6 @@ site-install-rb: install-rb
$LIBEXT = config['LIBEXT'].dup
$OBJEXT = config["OBJEXT"].dup
$EXEEXT = config["EXEEXT"].dup
- $ASMEXT = config_string('ASMEXT', &:dup) || 'S'
$LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
$LIBRUBYARG = ""
$LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
@@ -2533,7 +2457,6 @@ site-install-rb: install-rb
$objs = nil
$srcs = nil
- $headers = []
$libs = ""
if $enable_shared or RbConfig.expand(config["LIBRUBY"].dup) != RbConfig.expand(config["LIBRUBY_A"].dup)
$LIBRUBYARG = config['LIBRUBYARG']
@@ -2601,6 +2524,8 @@ MESSAGE
case
when $mswin
$nmake = ?m if /nmake/i =~ make
+ when $bccwin
+ $nmake = ?b if /Borland/i =~ `#{make} -h`
end
$ignore_error = $nmake ? '' : ' 2> /dev/null || true'
@@ -2659,22 +2584,12 @@ MESSAGE
##
# Command which will compile C files in the generated Makefile
- COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<'
+ COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
##
# Command which will compile C++ files in the generated Makefile
- COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<'
-
- ##
- # Command which will translate C files to assembler sources in the generated Makefile
-
- ASSEMBLE_C = config_string('ASSEMBLE_C') || COMPILE_C.sub(/(?<=\s)-c(?=\s)/, '-S')
-
- ##
- # Command which will translate C++ files to assembler sources in the generated Makefile
-
- ASSEMBLE_CXX = config_string('ASSEMBLE_CXX') || COMPILE_CXX.sub(/(?<=\s)-c(?=\s)/, '-S')
+ COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
##
# Command which will compile a program in order to test linking a library
diff --git a/lib/monitor.rb b/lib/monitor.rb
index e99cbd4baa..07394b5900 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = monitor.rb
#
# Copyright (C) 2001 Shugo Maeda <shugo@ruby-lang.org>
@@ -7,6 +6,8 @@
# You can freely distribute/modify this library.
#
+require 'thread'
+
#
# In concurrent programming, a monitor is an object or module intended to be
# used safely by more than one thread. The defining characteristic of a
@@ -87,9 +88,6 @@
# MonitorMixin module.
#
module MonitorMixin
- EXCEPTION_NEVER = {Exception => :never}.freeze
- EXCEPTION_IMMEDIATE = {Exception => :immediate}.freeze
-
#
# FIXME: This isn't documented in Nutshell.
#
@@ -106,17 +104,13 @@ module MonitorMixin
# even if no other thread doesn't signal.
#
def wait(timeout = nil)
- Thread.handle_interrupt(EXCEPTION_NEVER) do
- @monitor.__send__(:mon_check_owner)
- count = @monitor.__send__(:mon_exit_for_cond)
- begin
- Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
- @cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
- end
- return true
- ensure
- @monitor.__send__(:mon_enter_for_cond, count)
- end
+ @monitor.__send__(:mon_check_owner)
+ count = @monitor.__send__(:mon_exit_for_cond)
+ begin
+ @cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
+ return true
+ ensure
+ @monitor.__send__(:mon_enter_for_cond, count)
end
end
@@ -158,7 +152,7 @@ module MonitorMixin
def initialize(monitor)
@monitor = monitor
- @cond = Thread::ConditionVariable.new
+ @cond = ::ConditionVariable.new
end
end
@@ -176,7 +170,6 @@ module MonitorMixin
return false
end
@mon_owner = Thread.current
- @mon_count = 0
end
@mon_count += 1
return true
@@ -191,7 +184,6 @@ module MonitorMixin
if @mon_owner != Thread.current
@mon_mutex.lock
@mon_owner = Thread.current
- @mon_count = 0
end
@mon_count += 1
end
@@ -209,32 +201,16 @@ module MonitorMixin
end
#
- # Returns true if this monitor is locked by any thread
- #
- def mon_locked?
- @mon_mutex.locked?
- end
-
- #
- # Returns true if this monitor is locked by current thread.
- #
- def mon_owned?
- @mon_mutex.locked? && @mon_owner == Thread.current
- end
-
- #
# Enters exclusive section and executes the block. Leaves the exclusive
# section automatically when the block exits. See example under
# +MonitorMixin+.
#
def mon_synchronize
- # Prevent interrupt on handling interrupts; for example timeout errors
- # it may break locking state.
- Thread.handle_interrupt(Exception => :never){ mon_enter }
+ mon_enter
begin
yield
ensure
- Thread.handle_interrupt(EXCEPTION_NEVER){ mon_exit }
+ mon_exit
end
end
alias synchronize mon_synchronize
@@ -262,7 +238,7 @@ module MonitorMixin
def mon_initialize
@mon_owner = nil
@mon_count = 0
- @mon_mutex = Thread::Mutex.new
+ @mon_mutex = Mutex.new
end
def mon_check_owner
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb
index 592e3842c8..6698cb5ac6 100644
--- a/lib/mutex_m.rb
+++ b/lib/mutex_m.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# mutex_m.rb -
# $Release Version: 3.0$
@@ -10,6 +9,9 @@
#
# --
+
+require 'thread'
+
# = mutex_m.rb
#
# When 'mutex_m' is required, any object that extends or includes Mutex_m will
@@ -99,7 +101,7 @@ module Mutex_m
private
def mu_initialize # :nodoc:
- @_mutex = Thread::Mutex.new
+ @_mutex = Mutex.new
end
def initialize(*args) # :nodoc:
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 9902f9dc65..6b452b8a75 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = net/ftp.rb - FTP Client Library
#
@@ -18,11 +17,6 @@
require "socket"
require "monitor"
require "net/protocol"
-require "time"
-begin
- require "openssl"
-rescue LoadError
-end
module Net
@@ -77,24 +71,19 @@ module Net
# - #rename
# - #delete
#
- class FTP < Protocol
+ class FTP
include MonitorMixin
- if defined?(OpenSSL::SSL)
- include OpenSSL
- include SSL
- end
# :stopdoc:
FTP_PORT = 21
CRLF = "\r\n"
DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
- @@default_passive = true
# :startdoc:
# When +true+, transfers are performed in binary mode. Default: +true+.
attr_reader :binary
- # When +true+, the connection is in passive mode. Default: +true+.
+ # When +true+, the connection is in passive mode. Default: +false+.
attr_accessor :passive
# When +true+, all traffic to and from the server is written
@@ -111,17 +100,10 @@ module Net
# Net::OpenTimeout exception. The default value is +nil+.
attr_accessor :open_timeout
- # Number of seconds to wait for the TLS handshake. Any number
- # may be used, including Floats for fractional seconds. If the FTP
- # object cannot complete the TLS handshake in this many seconds, it
- # raises a Net::OpenTimeout exception. The default value is +nil+.
- # If +ssl_handshake_timeout+ is +nil+, +open_timeout+ is used instead.
- attr_accessor :ssl_handshake_timeout
-
# Number of seconds to wait for one block to be read (via one read(2)
# call). Any number may be used, including Floats for fractional
# seconds. If the FTP object cannot read data in this many seconds,
- # it raises a Timeout::Error exception. The default value is 60 seconds.
+ # it raises a TimeoutError exception. The default value is 60 seconds.
attr_reader :read_timeout
# Setter for the read_timeout attribute.
@@ -140,135 +122,44 @@ module Net
# The server's last response.
attr_reader :last_response
- # When +true+, connections are in passive mode per default.
- # Default: +true+.
- def self.default_passive=(value)
- @@default_passive = value
- end
-
- # When +true+, connections are in passive mode per default.
- # Default: +true+.
- def self.default_passive
- @@default_passive
- end
-
#
# A synonym for <tt>FTP.new</tt>, but with a mandatory host parameter.
#
# If a block is given, it is passed the +FTP+ object, which will be closed
# when the block finishes, or when an exception is raised.
#
- def FTP.open(host, *args)
+ def FTP.open(host, user = nil, passwd = nil, acct = nil)
if block_given?
- ftp = new(host, *args)
+ ftp = new(host, user, passwd, acct)
begin
yield ftp
ensure
ftp.close
end
else
- new(host, *args)
+ new(host, user, passwd, acct)
end
end
- # :call-seq:
- # Net::FTP.new(host = nil, options = {})
#
# Creates and returns a new +FTP+ object. If a +host+ is given, a connection
- # is made.
- #
- # +options+ is an option hash, each key of which is a symbol.
- #
- # The available options are:
- #
- # port:: Port number (default value is 21)
- # ssl:: If options[:ssl] is true, then an attempt will be made
- # to use SSL (now TLS) to connect to the server. For this
- # to work OpenSSL [OSSL] and the Ruby OpenSSL [RSSL]
- # extensions need to be installed. If options[:ssl] is a
- # hash, it's passed to OpenSSL::SSL::SSLContext#set_params
- # as parameters.
- # private_data_connection:: If true, TLS is used for data connections.
- # Default: +true+ when options[:ssl] is true.
- # username:: Username for login. If options[:username] is the string
- # "anonymous" and the options[:password] is +nil+,
- # "anonymous@" is used as a password.
- # password:: Password for login.
- # account:: Account information for ACCT.
- # passive:: When +true+, the connection is in passive mode. Default:
- # +true+.
- # open_timeout:: Number of seconds to wait for the connection to open.
- # See Net::FTP#open_timeout for details. Default: +nil+.
- # read_timeout:: Number of seconds to wait for one block to be read.
- # See Net::FTP#read_timeout for details. Default: +60+.
- # ssl_handshake_timeout:: Number of seconds to wait for the TLS
- # handshake.
- # See Net::FTP#ssl_handshake_timeout for
- # details. Default: +nil+.
- # debug_mode:: When +true+, all traffic to and from the server is
- # written to +$stdout+. Default: +false+.
- #
- def initialize(host = nil, user_or_options = {}, passwd = nil, acct = nil)
+ # is made. Additionally, if the +user+ is given, the given user name,
+ # password, and (optionally) account are used to log in. See #login.
+ #
+ def initialize(host = nil, user = nil, passwd = nil, acct = nil)
super()
- begin
- options = user_or_options.to_hash
- rescue NoMethodError
- # for backward compatibility
- options = {}
- options[:username] = user_or_options
- options[:password] = passwd
- options[:account] = acct
- end
- @host = nil
- if options[:ssl]
- unless defined?(OpenSSL::SSL)
- raise "SSL extension not installed"
- end
- ssl_params = options[:ssl] == true ? {} : options[:ssl]
- @ssl_context = SSLContext.new
- @ssl_context.set_params(ssl_params)
- if defined?(VerifyCallbackProc)
- @ssl_context.verify_callback = VerifyCallbackProc
- end
- @ssl_context.session_cache_mode =
- OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
- OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
- @ssl_context.session_new_cb = proc {|sock, sess| @ssl_session = sess }
- @ssl_session = nil
- if options[:private_data_connection].nil?
- @private_data_connection = true
- else
- @private_data_connection = options[:private_data_connection]
- end
- else
- @ssl_context = nil
- if options[:private_data_connection]
- raise ArgumentError,
- "private_data_connection can be set to true only when ssl is enabled"
- end
- @private_data_connection = false
- end
@binary = true
- if options[:passive].nil?
- @passive = @@default_passive
- else
- @passive = options[:passive]
- end
- if options[:debug_mode].nil?
- @debug_mode = false
- else
- @debug_mode = options[:debug_mode]
- end
+ @passive = false
+ @debug_mode = false
@resume = false
- @bare_sock = @sock = NullSocket.new
+ @sock = NullSocket.new
@logged_in = false
- @open_timeout = options[:open_timeout]
- @ssl_handshake_timeout = options[:ssl_handshake_timeout]
- @read_timeout = options[:read_timeout] || 60
+ @open_timeout = nil
+ @read_timeout = 60
if host
- connect(host, options[:port] || FTP_PORT)
- if options[:username]
- login(options[:username], options[:password], options[:account])
+ connect(host)
+ if user
+ login(user, passwd, acct)
end
end
end
@@ -314,49 +205,35 @@ module Net
# Obsolete
def return_code # :nodoc:
- warn("Net::FTP#return_code is obsolete and do nothing", uplevel: 1)
+ $stderr.puts("warning: Net::FTP#return_code is obsolete and do nothing")
return "\n"
end
# Obsolete
def return_code=(s) # :nodoc:
- warn("Net::FTP#return_code= is obsolete and do nothing", uplevel: 1)
+ $stderr.puts("warning: Net::FTP#return_code= is obsolete and do nothing")
end
# Constructs a socket with +host+ and +port+.
#
# If SOCKSSocket is defined and the environment (ENV) defines
- # SOCKS_SERVER, then a SOCKSSocket is returned, else a Socket is
+ # SOCKS_SERVER, then a SOCKSSocket is returned, else a TCPSocket is
# returned.
def open_socket(host, port) # :nodoc:
- return Timeout.timeout(@open_timeout, OpenTimeout) {
+ return Timeout.timeout(@open_timeout, Net::OpenTimeout) {
if defined? SOCKSSocket and ENV["SOCKS_SERVER"]
@passive = true
- SOCKSSocket.open(host, port)
+ sock = SOCKSSocket.open(host, port)
else
- Socket.tcp(host, port)
+ sock = TCPSocket.open(host, port)
end
+ io = BufferedSocket.new(sock)
+ io.read_timeout = @read_timeout
+ io
}
end
private :open_socket
- def start_tls_session(sock)
- ssl_sock = SSLSocket.new(sock, @ssl_context)
- ssl_sock.sync_close = true
- ssl_sock.hostname = @host if ssl_sock.respond_to? :hostname=
- if @ssl_session &&
- Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout
- # ProFTPD returns 425 for data connections if session is not reused.
- ssl_sock.session = @ssl_session
- end
- ssl_socket_connect(ssl_sock, @ssl_handshake_timeout || @open_timeout)
- if @ssl_context.verify_mode != VERIFY_NONE
- ssl_sock.post_connection_check(@host)
- end
- return ssl_sock
- end
- private :start_tls_session
-
#
# Establishes an FTP connection to host, optionally overriding the default
# port. If the environment variable +SOCKS_SERVER+ is set, sets up the
@@ -368,24 +245,8 @@ module Net
print "connect: ", host, ", ", port, "\n"
end
synchronize do
- @host = host
- @bare_sock = open_socket(host, port)
- @sock = BufferedSocket.new(@bare_sock, read_timeout: @read_timeout)
+ @sock = open_socket(host, port)
voidresp
- if @ssl_context
- begin
- voidcmd("AUTH TLS")
- ssl_sock = start_tls_session(@bare_sock)
- @sock = BufferedSSLSocket.new(ssl_sock, read_timeout: @read_timeout)
- if @private_data_connection
- voidcmd("PBSZ 0")
- voidcmd("PROT P")
- end
- rescue OpenSSL::SSL::SSLError, OpenTimeout
- @sock.close
- raise
- end
- end
end
end
@@ -419,9 +280,6 @@ module Net
if @debug_mode
print "put: ", sanitize(line), "\n"
end
- if /[\r\n]/ =~ line
- raise ArgumentError, "A line must not contain CR or LF"
- end
line = line + CRLF
@sock.write(line)
end
@@ -440,16 +298,16 @@ module Net
# Receive a section of lines until the response code's match.
def getmultiline # :nodoc:
- lines = []
- lines << getline
- code = lines.last.slice(/\A([0-9a-zA-Z]{3})-/, 1)
- if code
- delimiter = code + " "
+ line = getline
+ buff = line
+ if line[3] == ?-
+ code = line[0, 3]
begin
- lines << getline
- end until lines.last.start_with?(delimiter)
+ line = getline
+ buff << "\n" << line
+ end until line[0, 3] == code and line[3] != ?-
end
- return lines.join("\n") + "\n"
+ return buff << "\n"
end
private :getmultiline
@@ -479,7 +337,7 @@ module Net
# equal 2.
def voidresp # :nodoc:
resp = getresp
- if !resp.start_with?("2")
+ if resp[0] != ?2
raise FTPReplyError, resp
end
end
@@ -507,10 +365,10 @@ module Net
# Constructs and send the appropriate PORT (or EPRT) command
def sendport(host, port) # :nodoc:
- remote_address = @bare_sock.remote_address
- if remote_address.ipv4?
+ af = (@sock.peeraddr)[0]
+ if af == "AF_INET"
cmd = "PORT " + (host.split(".") + port.divmod(256)).join(",")
- elsif remote_address.ipv6?
+ elsif af == "AF_INET6"
cmd = sprintf("EPRT |2|%s|%d|", host, port)
else
raise FTPProtoError, host
@@ -519,15 +377,21 @@ module Net
end
private :sendport
- # Constructs a TCPServer socket
+ # Constructs a TCPServer socket, and sends it the PORT command
+ #
+ # Returns the constructed TCPServer socket
def makeport # :nodoc:
- Addrinfo.tcp(@bare_sock.local_address.ip_address, 0).listen
+ sock = TCPServer.open(@sock.addr[3], 0)
+ port = sock.addr[1]
+ host = sock.addr[3]
+ sendport(host, port)
+ return sock
end
private :makeport
# sends the appropriate command to enable a passive connection
def makepasv # :nodoc:
- if @bare_sock.remote_address.ipv4?
+ if @sock.peeraddr[0] == "AF_INET"
host, port = parse227(sendcmd("PASV"))
else
host, port = parse229(sendcmd("EPSV"))
@@ -544,46 +408,40 @@ module Net
conn = open_socket(host, port)
if @resume and rest_offset
resp = sendcmd("REST " + rest_offset.to_s)
- if !resp.start_with?("3")
+ if resp[0] != ?3
raise FTPReplyError, resp
end
end
resp = sendcmd(cmd)
# skip 2XX for some ftp servers
- resp = getresp if resp.start_with?("2")
- if !resp.start_with?("1")
+ resp = getresp if resp[0] == ?2
+ if resp[0] != ?1
raise FTPReplyError, resp
end
else
sock = makeport
begin
- addr = sock.local_address
- sendport(addr.ip_address, addr.ip_port)
if @resume and rest_offset
resp = sendcmd("REST " + rest_offset.to_s)
- if !resp.start_with?("3")
+ if resp[0] != ?3
raise FTPReplyError, resp
end
end
resp = sendcmd(cmd)
# skip 2XX for some ftp servers
- resp = getresp if resp.start_with?("2")
- if !resp.start_with?("1")
+ resp = getresp if resp[0] == ?2
+ if resp[0] != ?1
raise FTPReplyError, resp
end
- conn, = sock.accept
+ conn = BufferedSocket.new(sock.accept)
+ conn.read_timeout = @read_timeout
sock.shutdown(Socket::SHUT_WR) rescue nil
sock.read rescue nil
ensure
sock.close
end
end
- if @private_data_connection
- return BufferedSSLSocket.new(start_tls_session(conn),
- read_timeout: @read_timeout)
- else
- return BufferedSocket.new(conn, read_timeout: @read_timeout)
- end
+ return conn
end
private :transfercmd
@@ -603,16 +461,16 @@ module Net
resp = ""
synchronize do
resp = sendcmd('USER ' + user)
- if resp.start_with?("3")
+ if resp[0] == ?3
raise FTPReplyError, resp if passwd.nil?
resp = sendcmd('PASS ' + passwd)
end
- if resp.start_with?("3")
+ if resp[0] == ?3
raise FTPReplyError, resp if acct.nil?
resp = sendcmd('ACCT ' + acct)
end
end
- if !resp.start_with?("2")
+ if resp[0] != ?2
raise FTPReplyError, resp
end
@welcome = resp
@@ -745,30 +603,29 @@ module Net
# chunks.
#
def getbinaryfile(remotefile, localfile = File.basename(remotefile),
- blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: data
- f = nil
+ blocksize = DEFAULT_BLOCKSIZE) # :yield: data
result = nil
if localfile
if @resume
rest_offset = File.size?(localfile)
- f = File.open(localfile, "a")
+ f = open(localfile, "a")
else
rest_offset = nil
- f = File.open(localfile, "w")
+ f = open(localfile, "w")
end
elsif !block_given?
- result = String.new
+ result = ""
end
begin
- f&.binmode
- retrbinary("RETR #{remotefile}", blocksize, rest_offset) do |data|
- f&.write(data)
- block&.(data)
- result&.concat(data)
+ f.binmode if localfile
+ retrbinary("RETR " + remotefile.to_s, blocksize, rest_offset) do |data|
+ f.write(data) if localfile
+ yield(data) if block_given?
+ result.concat(data) if result
end
return result
ensure
- f&.close
+ f.close if localfile
end
end
@@ -779,25 +636,23 @@ module Net
# If a block is supplied, it is passed the retrieved data one
# line at a time.
#
- def gettextfile(remotefile, localfile = File.basename(remotefile),
- &block) # :yield: line
- f = nil
+ def gettextfile(remotefile, localfile = File.basename(remotefile)) # :yield: line
result = nil
if localfile
- f = File.open(localfile, "w")
+ f = open(localfile, "w")
elsif !block_given?
- result = String.new
+ result = ""
end
begin
- retrlines("RETR #{remotefile}") do |line, newline|
+ retrlines("RETR " + remotefile) do |line, newline|
l = newline ? line + "\n" : line
- f&.print(l)
- block&.(line, newline)
- result&.concat(l)
+ f.print(l) if localfile
+ yield(line, newline) if block_given?
+ result.concat(l) if result
end
return result
ensure
- f&.close
+ f.close if localfile
end
end
@@ -830,13 +685,13 @@ module Net
else
rest_offset = nil
end
- f = File.open(localfile)
+ f = open(localfile)
begin
f.binmode
if rest_offset
- storbinary("APPE #{remotefile}", f, blocksize, rest_offset, &block)
+ storbinary("APPE " + remotefile, f, blocksize, rest_offset, &block)
else
- storbinary("STOR #{remotefile}", f, blocksize, rest_offset, &block)
+ storbinary("STOR " + remotefile, f, blocksize, rest_offset, &block)
end
ensure
f.close
@@ -849,9 +704,9 @@ module Net
# passing in the transmitted data one line at a time.
#
def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line
- f = File.open(localfile)
+ f = open(localfile)
begin
- storlines("STOR #{remotefile}", f, &block)
+ storlines("STOR " + remotefile, f, &block)
ensure
f.close
end
@@ -887,7 +742,7 @@ module Net
def nlst(dir = nil)
cmd = "NLST"
if dir
- cmd = "#{cmd} #{dir}"
+ cmd = cmd + " " + dir
end
files = []
retrlines(cmd) do |line|
@@ -903,238 +758,40 @@ module Net
def list(*args, &block) # :yield: line
cmd = "LIST"
args.each do |arg|
- cmd = "#{cmd} #{arg}"
- end
- lines = []
- retrlines(cmd) do |line|
- lines << line
+ cmd = cmd + " " + arg.to_s
end
if block
- lines.each(&block)
+ retrlines(cmd, &block)
+ else
+ lines = []
+ retrlines(cmd) do |line|
+ lines << line
+ end
+ return lines
end
- return lines
end
alias ls list
alias dir list
#
- # MLSxEntry represents an entry in responses of MLST/MLSD.
- # Each entry has the facts (e.g., size, last modification time, etc.)
- # and the pathname.
- #
- class MLSxEntry
- attr_reader :facts, :pathname
-
- def initialize(facts, pathname)
- @facts = facts
- @pathname = pathname
- end
-
- standard_facts = %w(size modify create type unique perm
- lang media-type charset)
- standard_facts.each do |factname|
- define_method factname.gsub(/-/, "_") do
- facts[factname]
- end
- end
-
- #
- # Returns +true+ if the entry is a file (i.e., the value of the type
- # fact is file).
- #
- def file?
- return facts["type"] == "file"
- end
-
- #
- # Returns +true+ if the entry is a directory (i.e., the value of the
- # type fact is dir, cdir, or pdir).
- #
- def directory?
- if /\A[cp]?dir\z/.match(facts["type"])
- return true
- else
- return false
- end
- end
-
- #
- # Returns +true+ if the APPE command may be applied to the file.
- #
- def appendable?
- return facts["perm"].include?(?a)
- end
-
- #
- # Returns +true+ if files may be created in the directory by STOU,
- # STOR, APPE, and RNTO.
- #
- def creatable?
- return facts["perm"].include?(?c)
- end
-
- #
- # Returns +true+ if the file or directory may be deleted by DELE/RMD.
- #
- def deletable?
- return facts["perm"].include?(?d)
- end
-
- #
- # Returns +true+ if the directory may be entered by CWD/CDUP.
- #
- def enterable?
- return facts["perm"].include?(?e)
- end
-
- #
- # Returns +true+ if the file or directory may be renamed by RNFR.
- #
- def renamable?
- return facts["perm"].include?(?f)
- end
-
- #
- # Returns +true+ if the listing commands, LIST, NLST, and MLSD are
- # applied to the directory.
- #
- def listable?
- return facts["perm"].include?(?l)
- end
-
- #
- # Returns +true+ if the MKD command may be used to create a new
- # directory within the directory.
- #
- def directory_makable?
- return facts["perm"].include?(?m)
- end
-
- #
- # Returns +true+ if the objects in the directory may be deleted, or
- # the directory may be purged.
- #
- def purgeable?
- return facts["perm"].include?(?p)
- end
-
- #
- # Returns +true+ if the RETR command may be applied to the file.
- #
- def readable?
- return facts["perm"].include?(?r)
- end
-
- #
- # Returns +true+ if the STOR command may be applied to the file.
- #
- def writable?
- return facts["perm"].include?(?w)
- end
- end
-
- CASE_DEPENDENT_PARSER = ->(value) { value }
- CASE_INDEPENDENT_PARSER = ->(value) { value.downcase }
- DECIMAL_PARSER = ->(value) { value.to_i }
- OCTAL_PARSER = ->(value) { value.to_i(8) }
- TIME_PARSER = ->(value, local = false) {
- unless /\A(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})
- (?<hour>\d{2})(?<min>\d{2})(?<sec>\d{2})
- (\.(?<fractions>\d+))?/x =~ value
- raise FTPProtoError, "invalid time-val: #{value}"
- end
- usec = fractions.to_i * 10 ** (6 - fractions.to_s.size)
- Time.send(local ? :local : :utc, year, month, day, hour, min, sec, usec)
- }
- FACT_PARSERS = Hash.new(CASE_DEPENDENT_PARSER)
- FACT_PARSERS["size"] = DECIMAL_PARSER
- FACT_PARSERS["modify"] = TIME_PARSER
- FACT_PARSERS["create"] = TIME_PARSER
- FACT_PARSERS["type"] = CASE_INDEPENDENT_PARSER
- FACT_PARSERS["unique"] = CASE_DEPENDENT_PARSER
- FACT_PARSERS["perm"] = CASE_INDEPENDENT_PARSER
- FACT_PARSERS["lang"] = CASE_INDEPENDENT_PARSER
- FACT_PARSERS["media-type"] = CASE_INDEPENDENT_PARSER
- FACT_PARSERS["charset"] = CASE_INDEPENDENT_PARSER
- FACT_PARSERS["unix.mode"] = OCTAL_PARSER
- FACT_PARSERS["unix.owner"] = DECIMAL_PARSER
- FACT_PARSERS["unix.group"] = DECIMAL_PARSER
- FACT_PARSERS["unix.ctime"] = TIME_PARSER
- FACT_PARSERS["unix.atime"] = TIME_PARSER
-
- def parse_mlsx_entry(entry)
- facts, pathname = entry.chomp.split(/ /, 2)
- unless pathname
- raise FTPProtoError, entry
- end
- return MLSxEntry.new(
- facts.scan(/(.*?)=(.*?);/).each_with_object({}) {
- |(factname, value), h|
- name = factname.downcase
- h[name] = FACT_PARSERS[name].(value)
- },
- pathname)
- end
- private :parse_mlsx_entry
-
- #
- # Returns data (e.g., size, last modification time, entry type, etc.)
- # about the file or directory specified by +pathname+.
- # If +pathname+ is omitted, the current directory is assumed.
- #
- def mlst(pathname = nil)
- cmd = pathname ? "MLST #{pathname}" : "MLST"
- resp = sendcmd(cmd)
- if !resp.start_with?("250")
- raise FTPReplyError, resp
- end
- line = resp.lines[1]
- unless line
- raise FTPProtoError, resp
- end
- entry = line.sub(/\A(250-| *)/, "")
- return parse_mlsx_entry(entry)
- end
-
- #
- # Returns an array of the entries of the directory specified by
- # +pathname+.
- # Each entry has the facts (e.g., size, last modification time, etc.)
- # and the pathname.
- # If a block is given, it iterates through the listing.
- # If +pathname+ is omitted, the current directory is assumed.
- #
- def mlsd(pathname = nil, &block) # :yield: entry
- cmd = pathname ? "MLSD #{pathname}" : "MLSD"
- entries = []
- retrlines(cmd) do |line|
- entries << parse_mlsx_entry(line)
- end
- if block
- entries.each(&block)
- end
- return entries
- end
-
- #
# Renames a file on the server.
#
def rename(fromname, toname)
- resp = sendcmd("RNFR #{fromname}")
- if !resp.start_with?("3")
+ resp = sendcmd("RNFR " + fromname)
+ if resp[0] != ?3
raise FTPReplyError, resp
end
- voidcmd("RNTO #{toname}")
+ voidcmd("RNTO " + toname)
end
#
# Deletes a file on the server.
#
def delete(filename)
- resp = sendcmd("DELE #{filename}")
- if resp.start_with?("250")
+ resp = sendcmd("DELE " + filename)
+ if resp[0, 3] == "250"
return
- elsif resp.start_with?("5")
+ elsif resp[0] == ?5
raise FTPPermError, resp
else
raise FTPReplyError, resp
@@ -1155,41 +812,40 @@ module Net
end
end
end
- cmd = "CWD #{dirname}"
+ cmd = "CWD " + dirname
voidcmd(cmd)
end
- def get_body(resp) # :nodoc:
- resp.slice(/\A[0-9a-zA-Z]{3} (.*)$/, 1)
- end
- private :get_body
-
#
# Returns the size of the given (remote) filename.
#
def size(filename)
with_binary(true) do
- resp = sendcmd("SIZE #{filename}")
- if !resp.start_with?("213")
+ resp = sendcmd("SIZE " + filename)
+ if resp[0, 3] != "213"
raise FTPReplyError, resp
end
- return get_body(resp).to_i
+ return resp[3..-1].strip.to_i
end
end
+ MDTM_REGEXP = /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/ # :nodoc:
+
#
# Returns the last modification time of the (remote) file. If +local+ is
# +true+, it is returned as a local time, otherwise it's a UTC time.
#
def mtime(filename, local = false)
- return TIME_PARSER.(mdtm(filename), local)
+ str = mdtm(filename)
+ ary = str.scan(MDTM_REGEXP)[0].collect {|i| i.to_i}
+ return local ? Time.local(*ary) : Time.gm(*ary)
end
#
# Creates a remote directory.
#
def mkdir(dirname)
- resp = sendcmd("MKD #{dirname}")
+ resp = sendcmd("MKD " + dirname)
return parse257(resp)
end
@@ -1197,7 +853,7 @@ module Net
# Removes a remote directory.
#
def rmdir(dirname)
- voidcmd("RMD #{dirname}")
+ voidcmd("RMD " + dirname)
end
#
@@ -1214,10 +870,10 @@ module Net
#
def system
resp = sendcmd("SYST")
- if !resp.start_with?("215")
+ if resp[0, 3] != "215"
raise FTPReplyError, resp
end
- return get_body(resp)
+ return resp[4 .. -1]
end
#
@@ -1236,16 +892,11 @@ module Net
#
# Returns the status (STAT command).
- # pathname - when stat is invoked with pathname as a parameter it acts like
- # list but alot faster and over the same tcp session.
#
- def status(pathname = nil)
- line = pathname ? "STAT #{pathname}" : "STAT"
- if /[\r\n]/ =~ line
- raise ArgumentError, "A line must not contain CR or LF"
- end
- print "put: #{line}\n" if @debug_mode
- @sock.send(line + CRLF, Socket::MSG_OOB)
+ def status
+ line = "STAT" + CRLF
+ print "put: STAT\n" if @debug_mode
+ @sock.send(line, Socket::MSG_OOB)
return getresp
end
@@ -1256,9 +907,9 @@ module Net
# Use +mtime+ if you want a parsed Time instance.
#
def mdtm(filename)
- resp = sendcmd("MDTM #{filename}")
- if resp.start_with?("213")
- return get_body(resp)
+ resp = sendcmd("MDTM " + filename)
+ if resp[0, 3] == "213"
+ return resp[3 .. -1].strip
end
end
@@ -1326,7 +977,7 @@ module Net
#
# Returns host and port.
def parse227(resp) # :nodoc:
- if !resp.start_with?("227")
+ if resp[0, 3] != "227"
raise FTPReplyError, resp
end
if m = /\((?<host>\d+(,\d+){3}),(?<port>\d+,\d+)\)/.match(resp)
@@ -1342,7 +993,7 @@ module Net
#
# Returns host and port.
def parse228(resp) # :nodoc:
- if !resp.start_with?("228")
+ if resp[0, 3] != "228"
raise FTPReplyError, resp
end
if m = /\(4,4,(?<host>\d+(,\d+){3}),2,(?<port>\d+,\d+)\)/.match(resp)
@@ -1379,11 +1030,11 @@ module Net
#
# Returns host and port.
def parse229(resp) # :nodoc:
- if !resp.start_with?("229")
+ if resp[0, 3] != "229"
raise FTPReplyError, resp
end
if m = /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/.match(resp)
- return @bare_sock.remote_address.ip_address, m["port"].to_i
+ return @sock.peeraddr[3], m["port"].to_i
else
raise FTPProtoError, resp
end
@@ -1395,10 +1046,27 @@ module Net
#
# Returns host and port.
def parse257(resp) # :nodoc:
- if !resp.start_with?("257")
+ if resp[0, 3] != "257"
raise FTPReplyError, resp
end
- return resp.slice(/"(([^"]|"")*)"/, 1).to_s.gsub(/""/, '"')
+ if resp[3, 2] != ' "'
+ return ""
+ end
+ dirname = ""
+ i = 5
+ n = resp.length
+ while i < n
+ c = resp[i, 1]
+ i = i + 1
+ if c == '"'
+ if i > n or resp[i, 1] != '"'
+ break
+ end
+ i = i + 1
+ end
+ dirname = dirname + c
+ end
+ return dirname
end
private :parse257
@@ -1407,10 +1075,6 @@ module Net
def read_timeout=(sec)
end
- def closed?
- true
- end
-
def close
end
@@ -1420,7 +1084,7 @@ module Net
end
class BufferedSocket < BufferedIO
- [:local_address, :remote_address, :addr, :peeraddr, :send, :shutdown].each do |method|
+ [:addr, :peeraddr, :send, :shutdown].each do |method|
define_method(method) { |*args|
@io.__send__(method, *args)
}
@@ -1428,11 +1092,11 @@ module Net
def read(len = nil)
if len
- s = super(len, String.new, true)
+ s = super(len, "", true)
return s.empty? ? nil : s
else
- result = String.new
- while s = super(DEFAULT_BLOCKSIZE, String.new, true)
+ result = ""
+ while s = super(DEFAULT_BLOCKSIZE, "", true)
break if s.empty?
result << s
end
@@ -1453,37 +1117,6 @@ module Net
return line
end
end
-
- if defined?(OpenSSL::SSL::SSLSocket)
- class BufferedSSLSocket < BufferedSocket
- def initialize(*args)
- super
- @is_shutdown = false
- end
-
- def shutdown(*args)
- # SSL_shutdown() will be called from SSLSocket#close, and
- # SSL_shutdown() will send the "close notify" alert to the peer,
- # so shutdown(2) should not be called.
- @is_shutdown = true
- end
-
- def send(mesg, flags, dest = nil)
- # Ignore flags and dest.
- @io.write(mesg)
- end
-
- private
-
- def rbuf_fill
- if @is_shutdown
- raise EOFError, "shutdown has been called"
- else
- super
- end
- end
- end
- end
# :startdoc:
end
end
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 961ef398c3..aceb530442 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = net/http.rb
#
@@ -20,11 +19,11 @@
# See Net::HTTP for an overview and examples.
#
-require_relative 'protocol'
+require 'net/protocol'
require 'uri'
-autoload :OpenSSL, 'openssl'
module Net #:nodoc:
+ autoload :OpenSSL, 'openssl'
# :stopdoc:
class HTTPBadResponse < StandardError; end
@@ -260,20 +259,15 @@ module Net #:nodoc:
#
# uri = URI('https://secure.example.com/some_path?query=string')
#
- # Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
+ # Net::HTTP.start(uri.host, uri.port,
+ # :use_ssl => uri.scheme == 'https') do |http|
# request = Net::HTTP::Get.new uri
+ #
# response = http.request request # Net::HTTPResponse object
# end
#
- # Or if you simply want to make a GET request, you may pass in an URI
- # object that has a HTTPS URL. Net::HTTP automatically turn on TLS
- # verification if the URI object has a 'https' URI scheme.
- #
- # uri = URI('https://example.com/')
- # Net::HTTP.get(uri) # => String
- #
# In previous versions of Ruby you would need to require 'net/https' to use
- # HTTPS. This is no longer true.
+ # HTTPS. This is no longer true.
#
# === Proxies
#
@@ -375,7 +369,6 @@ module Net #:nodoc:
# HTTPPreconditionRequired:: 428
# HTTPTooManyRequests:: 429
# HTTPRequestHeaderFieldsTooLarge:: 431
- # HTTPUnavailableForLegalReasons:: 451
# HTTPServerError:: 5xx
# HTTPInternalServerError:: 500
# HTTPNotImplemented:: 501
@@ -489,24 +482,6 @@ module Net #:nodoc:
end
end
- # Posts data to the specified URI object.
- #
- # Example:
- #
- # require 'net/http'
- # require 'uri'
- #
- # Net::HTTP.post URI('http://www.example.com/api/search'),
- # { "q" => "ruby", "max" => "50" }.to_json,
- # "Content-Type" => "application/json"
- #
- def HTTP.post(url, data, header = nil)
- start(url.hostname, url.port,
- :use_ssl => url.scheme == 'https' ) {|http|
- http.post(url, data, header)
- }
- end
-
# Posts HTML form data to the specified URI object.
# The form data must be provided as a Hash mapping from String to String.
# Example:
@@ -560,7 +535,7 @@ module Net #:nodoc:
# :call-seq:
# HTTP.start(address, port, p_addr, p_port, p_user, p_pass, &block)
- # HTTP.start(address, port=nil, p_addr=:ENV, p_port=nil, p_user=nil, p_pass=nil, opt, &block)
+ # HTTP.start(address, port=nil, p_addr=nil, p_port=nil, p_user=nil, p_pass=nil, opt, &block)
#
# Creates a new Net::HTTP object, then additionally opens the TCP
# connection and HTTP session.
@@ -591,7 +566,6 @@ module Net #:nodoc:
def HTTP.start(address, *arg, &block) # :yield: +http+
arg.pop if opt = Hash.try_convert(arg[-1])
port, p_addr, p_port, p_user, p_pass = *arg
- p_addr = :ENV if arg.size < 2
port = https_default_port if !port && opt && opt[:use_ssl]
http = new(address, port, p_addr, p_port, p_user, p_pass)
@@ -627,13 +601,12 @@ module Net #:nodoc:
# detection from the environment. To disable proxy detection set +p_addr+
# to nil.
#
- # If you are connecting to a custom proxy, +p_addr+ specifies the DNS name
- # or IP address of the proxy host, +p_port+ the port to use to access the
- # proxy, +p_user+ and +p_pass+ the username and password if authorization
- # is required to use the proxy, and p_no_proxy hosts which do not
- # use the proxy.
+ # If you are connecting to a custom proxy, +p_addr+ the DNS name or IP
+ # address of the proxy host, +p_port+ the port to use to access the proxy,
+ # and +p_user+ and +p_pass+ the username and password if authorization is
+ # required to use the proxy.
#
- def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, p_no_proxy = nil)
+ def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil)
http = super address, port
if proxy_class? then # from Net::HTTP::Proxy()
@@ -645,10 +618,6 @@ module Net #:nodoc:
elsif p_addr == :ENV then
http.proxy_from_env = true
else
- if p_addr && p_no_proxy && !URI::Generic.use_proxy?(p_addr, p_addr, p_port, p_no_proxy)
- p_addr = nil
- p_port = nil
- end
http.proxy_address = p_addr
http.proxy_port = p_port || default_port
http.proxy_user = p_user
@@ -672,10 +641,9 @@ module Net #:nodoc:
@close_on_empty_response = false
@socket = nil
@started = false
- @open_timeout = 60
+ @open_timeout = nil
@read_timeout = 60
@continue_timeout = nil
- @max_retries = 1
@debug_output = nil
@proxy_from_env = false
@@ -688,6 +656,7 @@ module Net #:nodoc:
@use_ssl = false
@ssl_context = nil
@ssl_session = nil
+ @enable_post_connection_check = true
@sspi_enabled = false
SSL_IVNAMES.each do |ivname|
instance_variable_set ivname, nil
@@ -708,7 +677,7 @@ module Net #:nodoc:
# http.start { .... }
#
def set_debug_output(output)
- warn 'Net::HTTP#set_debug_output called after HTTP started', uplevel: 1 if started?
+ warn 'Net::HTTP#set_debug_output called after HTTP started' if started?
@debug_output = output
end
@@ -733,7 +702,7 @@ module Net #:nodoc:
# Number of seconds to wait for the connection to open. Any number
# may be used, including Floats for fractional seconds. If the HTTP
# object cannot open a connection in this many seconds, it raises a
- # Net::OpenTimeout exception. The default value is 60 seconds.
+ # Net::OpenTimeout exception. The default value is +nil+.
attr_accessor :open_timeout
# Number of seconds to wait for one block to be read (via one read(2)
@@ -742,22 +711,6 @@ module Net #:nodoc:
# it raises a Net::ReadTimeout exception. The default value is 60 seconds.
attr_reader :read_timeout
- # Maximum number of times to retry an idempotent request in case of
- # Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET,
- # Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError,
- # Timeout::Error.
- # Should be a non-negative integer number. Zero means no retries.
- # The default value is 1.
- def max_retries=(retries)
- retries = retries.to_int
- if retries < 0
- raise ArgumentError, 'max_retries should be non-negative integer number'
- end
- @max_retries = retries
- end
-
- attr_reader :max_retries
-
# Setter for the read_timeout attribute.
def read_timeout=(sec)
@socket.read_timeout = sec if @socket
@@ -816,8 +769,6 @@ module Net #:nodoc:
:@key,
:@ssl_timeout,
:@ssl_version,
- :@min_version,
- :@max_version,
:@verify_callback,
:@verify_depth,
:@verify_mode,
@@ -831,8 +782,6 @@ module Net #:nodoc:
:key,
:ssl_timeout,
:ssl_version,
- :min_version,
- :max_version,
:verify_callback,
:verify_depth,
:verify_mode,
@@ -867,12 +816,6 @@ module Net #:nodoc:
# Sets the SSL version. See OpenSSL::SSL::SSLContext#ssl_version=
attr_accessor :ssl_version
- # Sets the minimum SSL version. See OpenSSL::SSL::SSLContext#min_version=
- attr_accessor :min_version
-
- # Sets the maximum SSL version. See OpenSSL::SSL::SSLContext#max_version=
- attr_accessor :max_version
-
# Sets the verify callback for the server certification verification.
attr_accessor :verify_callback
@@ -933,32 +876,11 @@ module Net #:nodoc:
D "opening connection to #{conn_address}:#{conn_port}..."
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
- begin
- TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
- rescue => e
- raise e, "Failed to open TCP connection to " +
- "#{conn_address}:#{conn_port} (#{e.message})"
- end
+ TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
}
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
D "opened"
if use_ssl?
- if proxy?
- plain_sock = BufferedIO.new(s, read_timeout: @read_timeout,
- continue_timeout: @continue_timeout,
- debug_output: @debug_output)
- buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
- buf << "Host: #{@address}:#{@port}\r\n"
- if proxy_user
- credential = ["#{proxy_user}:#{proxy_pass}"].pack('m0')
- buf << "Proxy-Authorization: Basic #{credential}\r\n"
- end
- buf << "\r\n"
- plain_sock.write(buf)
- HTTPResponse.read_new(plain_sock).value
- # assuming nothing left in buffers after successful CONNECT response
- end
-
ssl_parameters = Hash.new
iv_list = instance_variables
SSL_IVNAMES.each_with_index do |ivname, i|
@@ -969,35 +891,44 @@ module Net #:nodoc:
end
@ssl_context = OpenSSL::SSL::SSLContext.new
@ssl_context.set_params(ssl_parameters)
- @ssl_context.session_cache_mode =
- OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT |
- OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
- @ssl_context.session_new_cb = proc {|sock, sess| @ssl_session = sess }
D "starting SSL for #{conn_address}:#{conn_port}..."
s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
s.sync_close = true
- # Server Name Indication (SNI) RFC 3546
- s.hostname = @address if s.respond_to? :hostname=
- if @ssl_session and
- Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout
- s.session = @ssl_session
- end
- ssl_socket_connect(s, @open_timeout)
- if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
- s.post_connection_check(@address)
- end
D "SSL established"
end
- @socket = BufferedIO.new(s, read_timeout: @read_timeout,
- continue_timeout: @continue_timeout,
- debug_output: @debug_output)
- on_connect
- rescue => exception
- if s
- D "Conn close because of connect error #{exception}"
- s.close
+ @socket = BufferedIO.new(s)
+ @socket.read_timeout = @read_timeout
+ @socket.continue_timeout = @continue_timeout
+ @socket.debug_output = @debug_output
+ if use_ssl?
+ begin
+ if proxy?
+ buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
+ buf << "Host: #{@address}:#{@port}\r\n"
+ if proxy_user
+ credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
+ credential.delete!("\r\n")
+ buf << "Proxy-Authorization: Basic #{credential}\r\n"
+ end
+ buf << "\r\n"
+ @socket.write(buf)
+ HTTPResponse.read_new(@socket).value
+ end
+ s.session = @ssl_session if @ssl_session
+ # Server Name Indication (SNI) RFC 3546
+ s.hostname = @address if s.respond_to? :hostname=
+ Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect }
+ if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
+ s.post_connection_check(@address)
+ end
+ @ssl_session = s.session
+ rescue => exception
+ D "Conn close because of connect error #{exception}"
+ @socket.close if @socket and not @socket.closed?
+ raise exception
+ end
end
- raise
+ on_connect
end
private :connect
@@ -1014,7 +945,7 @@ module Net #:nodoc:
def do_finish
@started = false
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
@socket = nil
end
private :do_finish
@@ -1081,7 +1012,11 @@ module Net #:nodoc:
# True if requests for this connection will be proxied
def proxy?
- !!(@proxy_from_env ? proxy_uri : @proxy_address)
+ !!if @proxy_from_env then
+ proxy_uri
+ else
+ @proxy_address
+ end
end
# True if the proxy for this connection is determined from the environment
@@ -1091,17 +1026,15 @@ module Net #:nodoc:
# The proxy URI determined from the environment for this connection.
def proxy_uri # :nodoc:
- return if @proxy_uri == false
@proxy_uri ||= URI::HTTP.new(
"http".freeze, nil, address, port, nil, nil, nil, nil, nil
- ).find_proxy || false
- @proxy_uri || nil
+ ).find_proxy
end
# The address of the proxy server, if one is configured.
def proxy_address
if @proxy_from_env then
- proxy_uri&.hostname
+ proxy_uri && proxy_uri.hostname
else
@proxy_address
end
@@ -1110,35 +1043,20 @@ module Net #:nodoc:
# The port of the proxy server, if one is configured.
def proxy_port
if @proxy_from_env then
- proxy_uri&.port
+ proxy_uri && proxy_uri.port
else
@proxy_port
end
end
- # [Bug #12921]
- if /linux|freebsd|darwin/ =~ RUBY_PLATFORM
- ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE = true
- else
- ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE = false
- end
-
- # The username of the proxy server, if one is configured.
+ # The proxy username, if one is configured
def proxy_user
- if ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE && @proxy_from_env
- proxy_uri&.user
- else
- @proxy_user
- end
+ @proxy_user
end
- # The password of the proxy server, if one is configured.
+ # The proxy password, if one is configured
def proxy_pass
- if ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE && @proxy_from_env
- proxy_uri&.password
- else
- @proxy_pass
- end
+ @proxy_pass
end
alias proxyaddr proxy_address #:nodoc: obsolete
@@ -1157,12 +1075,8 @@ module Net #:nodoc:
end
def edit_path(path)
- if proxy?
- if path.start_with?("ftp://") || use_ssl?
- path
- else
- "http://#{addr_port}#{path}"
- end
+ if proxy? and not use_ssl? then
+ "http://#{addr_port}#{path}"
else
path
end
@@ -1433,8 +1347,7 @@ module Net #:nodoc:
# puts response.body
#
def send_request(name, path, data = nil, header = nil)
- has_response_body = name != 'HEAD'
- r = HTTPGenericRequest.new(name,(data ? true : false),has_response_body,path,header)
+ r = HTTPGenericRequest.new(name,(data ? true : false),true,path,header)
request r, data
end
@@ -1496,15 +1409,15 @@ module Net #:nodoc:
begin
res = HTTPResponse.read_new(@socket)
res.decode_content = req.decode_content
- end while res.kind_of?(HTTPInformation)
+ end while res.kind_of?(HTTPContinue)
res.uri = req.uri
+ res.reading_body(@socket, req.response_body_permitted?) {
+ yield res if block_given?
+ }
res
}
- res.reading_body(@socket, req.response_body_permitted?) {
- yield res if block_given?
- }
rescue Net::OpenTimeout
raise
rescue Net::ReadTimeout, IOError, EOFError,
@@ -1512,14 +1425,14 @@ module Net #:nodoc:
# avoid a dependency on OpenSSL
defined?(OpenSSL::SSL) ? OpenSSL::SSL::SSLError : IOError,
Timeout::Error => exception
- if count < max_retries && IDEMPOTENT_METHODS_.include?(req.method)
+ if count == 0 && IDEMPOTENT_METHODS_.include?(req.method)
count += 1
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
D "Conn close because of error #{exception}, and retry"
retry
end
D "Conn close because of error #{exception}"
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
raise
end
@@ -1527,23 +1440,17 @@ module Net #:nodoc:
res
rescue => exception
D "Conn close because of error #{exception}"
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
raise exception
end
def begin_transport(req)
if @socket.closed?
connect
- elsif @last_communicated
- if @last_communicated + @keep_alive_timeout < Process.clock_gettime(Process::CLOCK_MONOTONIC)
- D 'Conn close because of keep_alive_timeout'
- @socket.close
- connect
- elsif @socket.io.to_io.wait_readable(0) && @socket.eof?
- D "Conn close because of EOF"
- @socket.close
- connect
- end
+ elsif @last_communicated && @last_communicated + @keep_alive_timeout < Time.now
+ D 'Conn close because of keep_alive_timeout'
+ @socket.close
+ connect
end
if not req.response_body_permitted? and @close_on_empty_response
@@ -1564,7 +1471,7 @@ module Net #:nodoc:
@socket.close
elsif keep_alive?(req, res)
D 'Conn keep-alive'
- @last_communicated = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ @last_communicated = Time.now
else
D 'Conn close'
@socket.close
@@ -1615,10 +1522,11 @@ module Net #:nodoc:
private
def addr_port
- addr = address
- addr = "[#{addr}]" if addr.include?(":")
- default_port = use_ssl? ? HTTP.https_default_port : HTTP.http_default_port
- default_port == port ? addr : "#{addr}:#{port}"
+ if use_ssl?
+ address() + (port == HTTP.https_default_port ? '' : ":#{port()}")
+ else
+ address() + (port == HTTP.http_default_port ? '' : ":#{port()}")
+ end
end
def D(msg)
@@ -1630,17 +1538,18 @@ module Net #:nodoc:
end
-require_relative 'http/exceptions'
+require 'net/http/exceptions'
+
+require 'net/http/header'
-require_relative 'http/header'
+require 'net/http/generic_request'
+require 'net/http/request'
+require 'net/http/requests'
-require_relative 'http/generic_request'
-require_relative 'http/request'
-require_relative 'http/requests'
+require 'net/http/response'
+require 'net/http/responses'
-require_relative 'http/response'
-require_relative 'http/responses'
+require 'net/http/proxy_delta'
-require_relative 'http/proxy_delta'
+require 'net/http/backward'
-require_relative 'http/backward'
diff --git a/lib/net/http/backward.rb b/lib/net/http/backward.rb
index 9e24eae32c..faf47b8489 100644
--- a/lib/net/http/backward.rb
+++ b/lib/net/http/backward.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# for backward compatibility
# :enddoc:
diff --git a/lib/net/http/exceptions.rb b/lib/net/http/exceptions.rb
index 0d34526616..6c5d81cb04 100644
--- a/lib/net/http/exceptions.rb
+++ b/lib/net/http/exceptions.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# Net::HTTP exception class.
# You cannot use Net::HTTPExceptions directly; instead, you must use
# its subclasses.
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
index 526cc333fc..00ff434ccf 100644
--- a/lib/net/http/generic_request.rb
+++ b/lib/net/http/generic_request.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# HTTPGenericRequest is the parent of the HTTPRequest class.
# Do not use this directly; use a subclass of HTTPRequest.
#
@@ -82,7 +81,7 @@ class Net::HTTPGenericRequest
end
def body_exist?
- warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?", uplevel: 1 if $VERBOSE
+ warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
response_body_permitted?
end
@@ -299,7 +298,7 @@ class Net::HTTPGenericRequest
def supply_default_content_type
return if content_type()
- warn 'net/http: Content-Type did not set; using application/x-www-form-urlencoded', uplevel: 1 if $VERBOSE
+ warn 'net/http: warning: Content-Type did not set; using application/x-www-form-urlencoded' if $VERBOSE
set_content_type 'application/x-www-form-urlencoded'
end
@@ -310,7 +309,7 @@ class Net::HTTPGenericRequest
def wait_for_continue(sock, ver)
if ver >= '1.1' and @header['expect'] and
@header['expect'].include?('100-continue')
- if sock.io.to_io.wait_readable(sock.continue_timeout)
+ if IO.select([sock.io], nil, nil, sock.continue_timeout)
res = Net::HTTPResponse.read_new(sock)
unless res.kind_of?(Net::HTTPContinue)
res.decode_content = @decode_content
@@ -321,12 +320,7 @@ class Net::HTTPGenericRequest
end
def write_header(sock, ver, path)
- reqline = "#{@method} #{path} HTTP/#{ver}"
- if /[\r\n]/ =~ reqline
- raise ArgumentError, "A Request-Line must not contain CR or LF"
- end
- buf = ""
- buf << reqline << "\r\n"
+ buf = "#{@method} #{path} HTTP/#{ver}\r\n"
each_capitalized do |k,v|
buf << "#{k}: #{v}\r\n"
end
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
index 96d898c89f..912419df55 100644
--- a/lib/net/http/header.rb
+++ b/lib/net/http/header.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# The HTTPHeader module defines methods for reading and writing
# HTTP headers.
#
@@ -14,16 +13,8 @@ module Net::HTTPHeader
@header = {}
return unless initheader
initheader.each do |key, value|
- warn "net/http: duplicated HTTP header: #{key}", uplevel: 1 if key?(key) and $VERBOSE
- if value.nil?
- warn "net/http: nil HTTP header: #{key}", uplevel: 1 if $VERBOSE
- else
- value = value.strip # raise error for invalid byte sequences
- if value.count("\r\n") > 0
- raise ArgumentError, 'header field value cannot include CR/LF'
- end
- @header[key.downcase] = [value]
- end
+ warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
+ @header[key.downcase] = [value.strip]
end
end
@@ -46,7 +37,7 @@ module Net::HTTPHeader
@header.delete key.downcase
return val
end
- set_field(key, val)
+ @header[key.downcase] = [val]
end
# [Ruby 1.8.3]
@@ -66,40 +57,12 @@ module Net::HTTPHeader
#
def add_field(key, val)
if @header.key?(key.downcase)
- append_field_value(@header[key.downcase], val)
+ @header[key.downcase].push val
else
- set_field(key, val)
- end
- end
-
- private def set_field(key, val)
- case val
- when Enumerable
- ary = []
- append_field_value(ary, val)
- @header[key.downcase] = ary
- else
- val = val.to_s # for compatibility use to_s instead of to_str
- if val.b.count("\r\n") > 0
- raise ArgumentError, 'header field value cannot include CR/LF'
- end
@header[key.downcase] = [val]
end
end
- private def append_field_value(ary, val)
- case val
- when Enumerable
- val.each{|x| append_field_value(ary, x)}
- else
- val = val.to_s
- if /[\r\n]/n.match?(val.b)
- raise ArgumentError, 'header field value cannot include CR/LF'
- end
- ary.push val
- end
- end
-
# [Ruby 1.8.3]
# Returns an array of header field strings corresponding to the
# case-insensitive +key+. This method allows you to get duplicated
@@ -128,14 +91,12 @@ module Net::HTTPHeader
# Iterates through the header names and values, passing in the name
# and value to the code block supplied.
#
- # Returns an enumerator if no block is given.
- #
# Example:
#
# response.header.each_header {|key,value| puts "#{key} = #{value}" }
#
def each_header #:yield: +key+, +value+
- block_given? or return enum_for(__method__) { @header.size }
+ block_given? or return enum_for(__method__)
@header.each do |k,va|
yield k, va.join(', ')
end
@@ -145,10 +106,8 @@ module Net::HTTPHeader
# Iterates through the header names in the header, passing
# each header name to the code block.
- #
- # Returns an enumerator if no block is given.
def each_name(&block) #:yield: +key+
- block_given? or return enum_for(__method__) { @header.size }
+ block_given? or return enum_for(__method__)
@header.each_key(&block)
end
@@ -160,10 +119,8 @@ module Net::HTTPHeader
# Note that header names are capitalized systematically;
# capitalization may not match that used by the remote HTTP
# server in its response.
- #
- # Returns an enumerator if no block is given.
def each_capitalized_name #:yield: +key+
- block_given? or return enum_for(__method__) { @header.size }
+ block_given? or return enum_for(__method__)
@header.each_key do |k|
yield capitalize(k)
end
@@ -171,10 +128,8 @@ module Net::HTTPHeader
# Iterates through header values, passing each value to the
# code block.
- #
- # Returns an enumerator if no block is given.
def each_value #:yield: +value+
- block_given? or return enum_for(__method__) { @header.size }
+ block_given? or return enum_for(__method__)
@header.each_value do |va|
yield va.join(', ')
end
@@ -204,10 +159,8 @@ module Net::HTTPHeader
# Note that header names are capitalized systematically;
# capitalization may not match that used by the remote HTTP
# server in its response.
- #
- # Returns an enumerator if no block is given.
def each_capitalized
- block_given? or return enum_for(__method__) { @header.size }
+ block_given? or return enum_for(__method__)
@header.each do |k,v|
yield capitalize(k), v.join(', ')
end
@@ -216,7 +169,7 @@ module Net::HTTPHeader
alias canonical_each each_capitalized
def capitalize(name)
- name.to_s.split(/-/).map {|s| s.capitalize }.join('-')
+ name.split(/-/).map {|s| s.capitalize }.join('-')
end
private :capitalize
@@ -420,11 +373,11 @@ module Net::HTTPHeader
alias form_data= set_form_data
- # Set an HTML form data set.
+ # Set a HTML form data set.
# +params+ is the form data set; it is an Array of Arrays or a Hash
# +enctype is the type to encode the form data set.
# It is application/x-www-form-urlencoded or multipart/form-data.
- # +formopt+ is an optional hash to specify the detail.
+ # +formpot+ is an optional hash to specify the detail.
#
# boundary:: the boundary of the multipart message
# charset:: the charset of the message. All names and the values of
@@ -473,22 +426,27 @@ module Net::HTTPHeader
end
def basic_encode(account, password)
- 'Basic ' + ["#{account}:#{password}"].pack('m0')
+ 'Basic ' + ["#{account}:#{password}"].pack('m').delete("\r\n")
end
private :basic_encode
def connection_close?
- token = /(?:\A|,)\s*close\s*(?:\z|,)/i
- @header['connection']&.grep(token) {return true}
- @header['proxy-connection']&.grep(token) {return true}
- false
+ tokens(@header['connection']).include?('close') or
+ tokens(@header['proxy-connection']).include?('close')
end
def connection_keep_alive?
- token = /(?:\A|,)\s*keep-alive\s*(?:\z|,)/i
- @header['connection']&.grep(token) {return true}
- @header['proxy-connection']&.grep(token) {return true}
- false
+ tokens(@header['connection']).include?('keep-alive') or
+ tokens(@header['proxy-connection']).include?('keep-alive')
end
+ def tokens(vals)
+ return [] unless vals
+ vals.map {|v| v.split(',') }.flatten\
+ .reject {|str| str.strip.empty? }\
+ .map {|tok| tok.strip.downcase }
+ end
+ private :tokens
+
end
+
diff --git a/lib/net/http/proxy_delta.rb b/lib/net/http/proxy_delta.rb
index a2f770ebdb..b16c9f1ed8 100644
--- a/lib/net/http/proxy_delta.rb
+++ b/lib/net/http/proxy_delta.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module Net::HTTP::ProxyDelta #:nodoc: internal use only
private
diff --git a/lib/net/http/request.rb b/lib/net/http/request.rb
index 1e86f3e4b4..e8b0f48fcc 100644
--- a/lib/net/http/request.rb
+++ b/lib/net/http/request.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# HTTP request class.
# This class wraps together the request header and the request path.
# You cannot use this class directly. Instead, you should use one of its
diff --git a/lib/net/http/requests.rb b/lib/net/http/requests.rb
index d4c80a3812..c1f8360479 100644
--- a/lib/net/http/requests.rb
+++ b/lib/net/http/requests.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# HTTP/1.1 methods --- RFC2616
#
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
index 6a78272ac8..777aca9e45 100644
--- a/lib/net/http/response.rb
+++ b/lib/net/http/response.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# HTTP response class.
#
# This class wraps together the response header and the response body (the
@@ -38,7 +37,7 @@ class Net::HTTPResponse
def read_status_line(sock)
str = sock.readline
- m = /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)(?:\s+(.*))?\z/in.match(str) or
+ m = /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in.match(str) or
raise Net::HTTPBadResponse, "wrong status line: #{str.dump}"
m.captures
end
@@ -117,9 +116,7 @@ class Net::HTTPResponse
end
def error! #:nodoc:
- message = @code
- message += ' ' + @message.dump if @message
- raise error_type().new(message, self)
+ raise error_type().new(@code + ' ' + @message.dump, self)
end
def error_type #:nodoc:
@@ -140,17 +137,17 @@ class Net::HTTPResponse
#
def response #:nodoc:
- warn "Net::HTTPResponse#response is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#response is obsolete" if $VERBOSE
self
end
def header #:nodoc:
- warn "Net::HTTPResponse#header is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#header is obsolete" if $VERBOSE
self
end
def read_header #:nodoc:
- warn "Net::HTTPResponse#read_header is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: Net::HTTPResponse#read_header is obsolete" if $VERBOSE
self
end
@@ -242,10 +239,10 @@ class Net::HTTPResponse
##
# Checks for a supported Content-Encoding header and yields an Inflate
# wrapper for this response's socket when zlib is present. If the
- # Content-Encoding is not supported or zlib is missing, the plain socket is
+ # Content-Encoding is unsupported or zlib is missing the plain socket is
# yielded.
#
- # If a Content-Range header is present, a plain socket is yielded as the
+ # If a Content-Range header is present a plain socket is yielded as the
# bytes in the range may not be a complete deflate block.
def inflater # :nodoc:
@@ -253,8 +250,7 @@ class Net::HTTPResponse
return yield @socket unless @decode_content
return yield @socket if self['content-range']
- v = self['content-encoding']
- case v&.downcase
+ case self['content-encoding']
when 'deflate', 'gzip', 'x-gzip' then
self.delete 'content-encoding'
@@ -263,11 +259,11 @@ class Net::HTTPResponse
begin
yield inflate_body_io
ensure
- orig_err = $!
+ e = $!
begin
inflate_body_io.finish
- rescue => err
- raise orig_err || err
+ rescue
+ raise e
end
end
when 'none', 'identity' then
@@ -362,7 +358,6 @@ class Net::HTTPResponse
# Finishes the inflate stream.
def finish
- return if @inflate.total_in == 0
@inflate.finish
end
diff --git a/lib/net/http/responses.rb b/lib/net/http/responses.rb
index c4259e1a02..1454a27a3e 100644
--- a/lib/net/http/responses.rb
+++ b/lib/net/http/responses.rb
@@ -1,6 +1,4 @@
-# frozen_string_literal: false
# :stopdoc:
-# https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
class Net::HTTPUnknownResponse < Net::HTTPResponse
HAS_BODY = true
EXCEPTION_TYPE = Net::HTTPError
@@ -32,9 +30,7 @@ end
class Net::HTTPSwitchProtocol < Net::HTTPInformation # 101
HAS_BODY = false
end
-class Net::HTTPProcessing < Net::HTTPInformation # 102
- HAS_BODY = false
-end
+# 102 - RFC 2518; removed in RFC 4918
class Net::HTTPOK < Net::HTTPSuccess # 200
HAS_BODY = true
@@ -60,9 +56,7 @@ end
class Net::HTTPMultiStatus < Net::HTTPSuccess # 207 - RFC 4918
HAS_BODY = true
end
-class Net::HTTPAlreadyReported < Net::HTTPSuccess # 208 - RFC 5842
- HAS_BODY = true
-end
+# 208 Already Reported - RFC 5842; experimental
class Net::HTTPIMUsed < Net::HTTPSuccess # 226 - RFC 3229
HAS_BODY = true
end
@@ -152,9 +146,6 @@ class Net::HTTPExpectationFailed < Net::HTTPClientError # 417
end
# 418 I'm a teapot - RFC 2324; a joke RFC
# 420 Enhance Your Calm - Twitter
-class Net::HTTPMisdirectedRequest < Net::HTTPClientError # 421 - RFC 7540
- HAS_BODY = true
-end
class Net::HTTPUnprocessableEntity < Net::HTTPClientError # 422 - RFC 4918
HAS_BODY = true
end
@@ -177,9 +168,6 @@ end
class Net::HTTPRequestHeaderFieldsTooLarge < Net::HTTPClientError # 431 - RFC 6585
HAS_BODY = true
end
-class Net::HTTPUnavailableForLegalReasons < Net::HTTPClientError # 451 - RFC 7725
- HAS_BODY = true
-end
# 444 No Response - Nginx
# 449 Retry With - Microsoft
# 450 Blocked by Windows Parental Controls - Microsoft
@@ -203,19 +191,13 @@ end
class Net::HTTPVersionNotSupported < Net::HTTPServerError # 505
HAS_BODY = true
end
-class Net::HTTPVariantAlsoNegotiates < Net::HTTPServerError # 506
- HAS_BODY = true
-end
+# 506 Variant Also Negotiates - RFC 2295; experimental
class Net::HTTPInsufficientStorage < Net::HTTPServerError # 507 - RFC 4918
HAS_BODY = true
end
-class Net::HTTPLoopDetected < Net::HTTPServerError # 508 - RFC 5842
- HAS_BODY = true
-end
+# 508 Loop Detected - RFC 5842; experimental
# 509 Bandwidth Limit Exceeded - Apache bw/limited extension
-class Net::HTTPNotExtended < Net::HTTPServerError # 510 - RFC 2774
- HAS_BODY = true
-end
+# 510 Not Extended - RFC 2774; experimental
class Net::HTTPNetworkAuthenticationRequired < Net::HTTPServerError # 511 - RFC 6585
HAS_BODY = true
end
@@ -231,7 +213,6 @@ class Net::HTTPResponse
CODE_TO_OBJ = {
'100' => Net::HTTPContinue,
'101' => Net::HTTPSwitchProtocol,
- '102' => Net::HTTPProcessing,
'200' => Net::HTTPOK,
'201' => Net::HTTPCreated,
@@ -241,7 +222,6 @@ class Net::HTTPResponse
'205' => Net::HTTPResetContent,
'206' => Net::HTTPPartialContent,
'207' => Net::HTTPMultiStatus,
- '208' => Net::HTTPAlreadyReported,
'226' => Net::HTTPIMUsed,
'300' => Net::HTTPMultipleChoices,
@@ -251,7 +231,6 @@ class Net::HTTPResponse
'304' => Net::HTTPNotModified,
'305' => Net::HTTPUseProxy,
'307' => Net::HTTPTemporaryRedirect,
- '308' => Net::HTTPPermanentRedirect,
'400' => Net::HTTPBadRequest,
'401' => Net::HTTPUnauthorized,
@@ -271,7 +250,6 @@ class Net::HTTPResponse
'415' => Net::HTTPUnsupportedMediaType,
'416' => Net::HTTPRequestedRangeNotSatisfiable,
'417' => Net::HTTPExpectationFailed,
- '421' => Net::HTTPMisdirectedRequest,
'422' => Net::HTTPUnprocessableEntity,
'423' => Net::HTTPLocked,
'424' => Net::HTTPFailedDependency,
@@ -279,7 +257,6 @@ class Net::HTTPResponse
'428' => Net::HTTPPreconditionRequired,
'429' => Net::HTTPTooManyRequests,
'431' => Net::HTTPRequestHeaderFieldsTooLarge,
- '451' => Net::HTTPUnavailableForLegalReasons,
'500' => Net::HTTPInternalServerError,
'501' => Net::HTTPNotImplemented,
@@ -287,10 +264,7 @@ class Net::HTTPResponse
'503' => Net::HTTPServiceUnavailable,
'504' => Net::HTTPGatewayTimeOut,
'505' => Net::HTTPVersionNotSupported,
- '506' => Net::HTTPVariantAlsoNegotiates,
'507' => Net::HTTPInsufficientStorage,
- '508' => Net::HTTPLoopDetected,
- '510' => Net::HTTPNotExtended,
'511' => Net::HTTPNetworkAuthenticationRequired,
}
end
diff --git a/lib/net/http/status.rb b/lib/net/http/status.rb
deleted file mode 100644
index c7a4c0cee3..0000000000
--- a/lib/net/http/status.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-require 'net/http'
-
-if $0 == __FILE__
- require 'open-uri'
- IO.foreach(__FILE__) do |line|
- puts line
- break if line.start_with?('end')
- end
- puts
- puts "Net::HTTP::STATUS_CODES = {"
- url = "https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv"
- URI(url).read.each_line do |line|
- code, mes, = line.split(',')
- next if ['(Unused)', 'Unassigned', 'Description'].include?(mes)
- puts " #{code} => '#{mes}',"
- end
- puts "}"
-end
-
-Net::HTTP::STATUS_CODES = {
- 100 => 'Continue',
- 101 => 'Switching Protocols',
- 102 => 'Processing',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authoritative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 207 => 'Multi-Status',
- 208 => 'Already Reported',
- 226 => 'IM Used',
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 307 => 'Temporary Redirect',
- 308 => 'Permanent Redirect',
- 400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Payload Too Large',
- 414 => 'URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 421 => 'Misdirected Request',
- 422 => 'Unprocessable Entity',
- 423 => 'Locked',
- 424 => 'Failed Dependency',
- 426 => 'Upgrade Required',
- 428 => 'Precondition Required',
- 429 => 'Too Many Requests',
- 431 => 'Request Header Fields Too Large',
- 451 => 'Unavailable For Legal Reasons',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported',
- 506 => 'Variant Also Negotiates',
- 507 => 'Insufficient Storage',
- 508 => 'Loop Detected',
- 510 => 'Not Extended',
- 511 => 'Network Authentication Required',
-}
diff --git a/lib/net/https.rb b/lib/net/https.rb
index 58cb6ddf19..d36f82002d 100644
--- a/lib/net/https.rb
+++ b/lib/net/https.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
=begin
= net/https -- SSL/TLS enhancement for Net::HTTP.
@@ -14,7 +13,7 @@
All rights reserved.
== Licence
- This program is licensed under the same licence as Ruby.
+ This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
=end
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index da7d0d555c..85644f388c 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = net/imap.rb
#
@@ -18,7 +17,6 @@ require "socket"
require "monitor"
require "digest/md5"
require "strscan"
-require 'net/protocol'
begin
require "openssl"
rescue LoadError
@@ -200,7 +198,7 @@ module Net
# Goldsmith, D. and Davis, M., "UTF-7: A Mail-Safe Transformation Format of
# Unicode", RFC 2152, May 1997.
#
- class IMAP < Protocol
+ class IMAP
include MonitorMixin
if defined?(OpenSSL::SSL)
include OpenSSL
@@ -222,11 +220,6 @@ module Net
# Returns all response handlers.
attr_reader :response_handlers
- # Seconds to wait until a connection is opened.
- # If the IMAP object cannot open a connection within this time,
- # it raises a Net::OpenTimeout exception. The default value is 30 seconds.
- attr_reader :open_timeout
-
# The thread to receive exceptions.
attr_accessor :client_thread
@@ -320,7 +313,6 @@ module Net
# Disconnects from the server.
def disconnect
- return if disconnected?
begin
begin
# try to call SSL::SSLSocket#io.
@@ -336,7 +328,9 @@ module Net
end
@receiver_thread.join
synchronize do
- @sock.close
+ unless @sock.closed?
+ @sock.close
+ end
end
raise e if e
end
@@ -424,7 +418,7 @@ module Net
send_command("AUTHENTICATE", auth_type) do |resp|
if resp.instance_of?(ContinuationRequest)
data = authenticator.process(resp.data.text.unpack("m")[0])
- s = [data].pack("m0")
+ s = [data].pack("m").gsub(/\n/, "")
send_string_data(s)
put_string(CRLF)
end
@@ -784,7 +778,7 @@ module Net
#
# The +set+ parameter is a number or a range between two numbers,
# or an array of those. The number is a message sequence number,
- # where -1 represents a '*' for use in range notation like 100..-1
+ # where -1 repesents a '*' for use in range notation like 100..-1
# being interpreted as '100:*'. Beware that the +exclude_end?+
# property of a Range object is ignored, and the contents of a
# range are independent of the order of the range endpoints as per
@@ -794,10 +788,8 @@ module Net
# +attr+ is a list of attributes to fetch; see the documentation
# for Net::IMAP::FetchData for a list of valid attributes.
#
- # The return value is an array of Net::IMAP::FetchData or nil
- # (instead of an empty array) if there is no matching message.
- #
- # For example:
+ # The return value is an array of Net::IMAP::FetchData. For
+ # example:
#
# p imap.fetch(6..8, "UID")
# #=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\
@@ -814,13 +806,13 @@ module Net
# #=> "12-Oct-2000 22:40:59 +0900"
# p data.attr["UID"]
# #=> 98
- def fetch(set, attr, mod = nil)
- return fetch_internal("FETCH", set, attr, mod)
+ def fetch(set, attr)
+ return fetch_internal("FETCH", set, attr)
end
# Similar to #fetch(), but +set+ contains unique identifiers.
- def uid_fetch(set, attr, mod = nil)
- return fetch_internal("UID FETCH", set, attr, mod)
+ def uid_fetch(set, attr)
+ return fetch_internal("UID FETCH", set, attr)
end
# Sends a STORE command to alter data associated with messages
@@ -859,20 +851,6 @@ module Net
copy_internal("UID COPY", set, mailbox)
end
- # Sends a MOVE command to move the specified message(s) to the end
- # of the specified destination +mailbox+. The +set+ parameter is
- # a number, an array of numbers, or a Range object. The number is
- # a message sequence number.
- # The IMAP MOVE extension is described in [RFC-6851].
- def move(set, mailbox)
- copy_internal("MOVE", set, mailbox)
- end
-
- # Similar to #move(), but +set+ contains unique identifiers.
- def uid_move(set, mailbox)
- copy_internal("UID MOVE", set, mailbox)
- end
-
# Sends a SORT command to sort messages in the mailbox.
# Returns an array of message sequence numbers. For example:
#
@@ -939,17 +917,7 @@ module Net
# messages. Yields responses from the server during the IDLE.
#
# Use #idle_done() to leave IDLE.
- #
- # If +timeout+ is given, this method returns after +timeout+ seconds passed.
- # +timeout+ can be used for keep-alive. For example, the following code
- # checks the connection for each 60 seconds.
- #
- # loop do
- # imap.idle(60) do |res|
- # ...
- # end
- # end
- def idle(timeout = nil, &response_handler)
+ def idle(&response_handler)
raise LocalJumpError, "no block given" unless response_handler
response = nil
@@ -961,10 +929,10 @@ module Net
begin
add_response_handler(response_handler)
@idle_done_cond = new_cond
- @idle_done_cond.wait(timeout)
+ @idle_done_cond.wait
@idle_done_cond = nil
if @receiver_thread_terminating
- raise @exception || Net::IMAP::Error.new("connection closed")
+ raise Net::IMAP::Error, "connection closed"
end
ensure
unless @receiver_thread_terminating
@@ -1012,8 +980,8 @@ module Net
if $1
"&-"
else
- base64 = [$&.encode(Encoding::UTF_16BE)].pack("m0")
- "&" + base64.delete("=").tr("/", ",") + "-"
+ base64 = [$&.encode(Encoding::UTF_16BE)].pack("m")
+ "&" + base64.delete("=\n").tr("/", ",") + "-"
end
}.force_encoding("ASCII-8BIT")
end
@@ -1055,7 +1023,6 @@ module Net
# be installed.
# If options[:ssl] is a hash, it's passed to
# OpenSSL::SSL::SSLContext#set_params as parameters.
- # open_timeout:: Seconds to wait until a connection is opened
#
# The most common errors are:
#
@@ -1084,9 +1051,8 @@ module Net
@port = options[:port] || (options[:ssl] ? SSL_PORT : PORT)
@tag_prefix = "RUBY"
@tagno = 0
- @open_timeout = options[:open_timeout] || 30
@parser = ResponseParser.new
- @sock = tcp_socket(@host, @port)
+ @sock = TCPSocket.open(@host, @port)
begin
if options[:ssl]
start_tls_session(options[:ssl])
@@ -1098,9 +1064,7 @@ module Net
@tagged_responses = {}
@response_handlers = []
@tagged_response_arrival = new_cond
- @continued_command_tag = nil
@continuation_request_arrival = new_cond
- @continuation_request_exception = nil
@idle_done_cond = nil
@logout_command_tag = nil
@debug_output_bol = true
@@ -1128,13 +1092,6 @@ module Net
end
end
- def tcp_socket(host, port)
- Socket.tcp(host, port, :connect_timeout => @open_timeout)
- rescue Errno::ETIMEDOUT
- raise Net::OpenTimeout, "Timeout to open TCP connection to " +
- "#{host}:#{port} (exceeds #{@open_timeout} seconds)"
- end
-
def receive_responses
connection_closed = false
until connection_closed
@@ -1162,13 +1119,8 @@ module Net
when TaggedResponse
@tagged_responses[resp.tag] = resp
@tagged_response_arrival.broadcast
- case resp.tag
- when @logout_command_tag
+ if resp.tag == @logout_command_tag
return
- when @continued_command_tag
- @continuation_request_exception =
- RESPONSE_ERRORS[resp.name].new(resp)
- @continuation_request_arrival.signal
end
when UntaggedResponse
record_response(resp.name, resp.data)
@@ -1223,7 +1175,7 @@ module Net
end
def get_response
- buff = String.new
+ buff = ""
while true
s = @sock.gets(CRLF)
break unless s
@@ -1258,7 +1210,7 @@ module Net
put_string(tag + " " + cmd)
args.each do |i|
put_string(" ")
- send_data(i, tag)
+ send_data(i)
end
put_string(CRLF)
if cmd == "LOGOUT"
@@ -1302,14 +1254,12 @@ module Net
when nil
when String
when Integer
- NumValidator.ensure_number(data)
+ if data < 0 || data >= 4294967296
+ raise DataFormatError, num.to_s
+ end
when Array
- if data[0] == 'CHANGEDSINCE'
- NumValidator.ensure_mod_sequence_value(data[1])
- else
- data.each do |i|
- validate_data(i)
- end
+ data.each do |i|
+ validate_data(i)
end
when Time
when Symbol
@@ -1318,32 +1268,32 @@ module Net
end
end
- def send_data(data, tag = nil)
+ def send_data(data)
case data
when nil
put_string("NIL")
when String
- send_string_data(data, tag)
+ send_string_data(data)
when Integer
send_number_data(data)
when Array
- send_list_data(data, tag)
+ send_list_data(data)
when Time
send_time_data(data)
when Symbol
send_symbol_data(data)
else
- data.send_data(self, tag)
+ data.send_data(self)
end
end
- def send_string_data(str, tag = nil)
+ def send_string_data(str)
case str
when ""
put_string('""')
when /[\x80-\xff\r\n]/n
# literal
- send_literal(str, tag)
+ send_literal(str)
when /[(){ \x00-\x1f\x7f%*"\\]/n
# quoted string
send_quoted_string(str)
@@ -1356,28 +1306,18 @@ module Net
put_string('"' + str.gsub(/["\\]/n, "\\\\\\&") + '"')
end
- def send_literal(str, tag = nil)
- synchronize do
- put_string("{" + str.bytesize.to_s + "}" + CRLF)
- @continued_command_tag = tag
- @continuation_request_exception = nil
- begin
- @continuation_request_arrival.wait
- e = @continuation_request_exception || @exception
- raise e if e
- put_string(str)
- ensure
- @continued_command_tag = nil
- @continuation_request_exception = nil
- end
- end
+ def send_literal(str)
+ put_string("{" + str.bytesize.to_s + "}" + CRLF)
+ @continuation_request_arrival.wait
+ raise @exception if @exception
+ put_string(str)
end
def send_number_data(num)
put_string(num.to_s)
end
- def send_list_data(list, tag = nil)
+ def send_list_data(list)
put_string("(")
first = true
list.each do |i|
@@ -1386,7 +1326,7 @@ module Net
else
put_string(" ")
end
- send_data(i, tag)
+ send_data(i)
end
put_string(")")
end
@@ -1421,7 +1361,7 @@ module Net
end
end
- def fetch_internal(cmd, set, attr, mod = nil)
+ def fetch_internal(cmd, set, attr)
case attr
when String then
attr = RawData.new(attr)
@@ -1433,11 +1373,7 @@ module Net
synchronize do
@responses.delete("FETCH")
- if mod
- send_command(cmd, MessageSet.new(set), attr, mod)
- else
- send_command(cmd, MessageSet.new(set), attr)
- end
+ send_command(cmd, MessageSet.new(set), attr)
return @responses.delete("FETCH")
end
end
@@ -1528,15 +1464,14 @@ module Net
end
@sock = SSLSocket.new(@sock, context)
@sock.sync_close = true
- @sock.hostname = @host if @sock.respond_to? :hostname=
- ssl_socket_connect(@sock, @open_timeout)
+ @sock.connect
if context.verify_mode != VERIFY_NONE
@sock.post_connection_check(@host)
end
end
class RawData # :nodoc:
- def send_data(imap, tag)
+ def send_data(imap)
imap.send(:put_string, @data)
end
@@ -1551,7 +1486,7 @@ module Net
end
class Atom # :nodoc:
- def send_data(imap, tag)
+ def send_data(imap)
imap.send(:put_string, @data)
end
@@ -1566,7 +1501,7 @@ module Net
end
class QuotedString # :nodoc:
- def send_data(imap, tag)
+ def send_data(imap)
imap.send(:send_quoted_string, @data)
end
@@ -1581,8 +1516,8 @@ module Net
end
class Literal # :nodoc:
- def send_data(imap, tag)
- imap.send(:send_literal, @data, tag)
+ def send_data(imap)
+ imap.send(:send_literal, @data)
end
def validate
@@ -1596,7 +1531,7 @@ module Net
end
class MessageSet # :nodoc:
- def send_data(imap, tag)
+ def send_data(imap)
imap.send(:put_string, format_internal(@data))
end
@@ -1635,7 +1570,7 @@ module Net
case data
when "*"
when Integer
- NumValidator.ensure_nz_number(data)
+ ensure_nz_number(data)
when Range
when Array
data.each do |i|
@@ -1649,59 +1584,11 @@ module Net
raise DataFormatError, data.inspect
end
end
- end
-
- # Common validators of number and nz_number types
- module NumValidator # :nodoc
- class << self
- # Check is passed argument valid 'number' in RFC 3501 terminology
- def valid_number?(num)
- # [RFC 3501]
- # number = 1*DIGIT
- # ; Unsigned 32-bit integer
- # ; (0 <= n < 4,294,967,296)
- num >= 0 && num < 4294967296
- end
-
- # Check is passed argument valid 'nz_number' in RFC 3501 terminology
- def valid_nz_number?(num)
- # [RFC 3501]
- # nz-number = digit-nz *DIGIT
- # ; Non-zero unsigned 32-bit integer
- # ; (0 < n < 4,294,967,296)
- num != 0 && valid_number?(num)
- end
-
- # Check is passed argument valid 'mod_sequence_value' in RFC 4551 terminology
- def valid_mod_sequence_value?(num)
- # mod-sequence-value = 1*DIGIT
- # ; Positive unsigned 64-bit integer
- # ; (mod-sequence)
- # ; (1 <= n < 18,446,744,073,709,551,615)
- num >= 1 && num < 18446744073709551615
- end
- # Ensure argument is 'number' or raise DataFormatError
- def ensure_number(num)
- return if valid_number?(num)
-
- msg = "number must be unsigned 32-bit integer: #{num}"
- raise DataFormatError, msg
- end
-
- # Ensure argument is 'nz_number' or raise DataFormatError
- def ensure_nz_number(num)
- return if valid_nz_number?(num)
-
- msg = "nz_number must be non-zero unsigned 32-bit integer: #{num}"
- raise DataFormatError, msg
- end
-
- # Ensure argument is 'mod_sequence_value' or raise DataFormatError
- def ensure_mod_sequence_value(num)
- return if valid_mod_sequence_value?(num)
-
- msg = "mod_sequence_value must be unsigned 64-bit integer: #{num}"
+ def ensure_nz_number(num)
+ if num < -1 || num == 0 || num >= 4294967296
+ msg = "nz_number must be non-zero unsigned 32-bit integer: " +
+ num.inspect
raise DataFormatError, msg
end
end
@@ -2033,7 +1920,8 @@ module Net
# generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
- warn("media_subtype is obsolete, use subtype instead.\n", uplevel: 1)
+ $stderr.printf("warning: media_subtype is obsolete.\n")
+ $stderr.printf(" use subtype instead.\n")
return subtype
end
end
@@ -2060,7 +1948,8 @@ module Net
# generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
- warn("media_subtype is obsolete, use subtype instead.\n", uplevel: 1)
+ $stderr.printf("warning: media_subtype is obsolete.\n")
+ $stderr.printf(" use subtype instead.\n")
return subtype
end
end
@@ -2089,7 +1978,8 @@ module Net
# generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
- warn("media_subtype is obsolete, use subtype instead.\n", uplevel: 1)
+ $stderr.printf("warning: media_subtype is obsolete.\n")
+ $stderr.printf(" use subtype instead.\n")
return subtype
end
end
@@ -2149,7 +2039,8 @@ module Net
# generate a warning message to +stderr+, then return
# the value of +subtype+.
def media_subtype
- warn("media_subtype is obsolete, use subtype instead.\n", uplevel: 1)
+ $stderr.printf("warning: media_subtype is obsolete.\n")
+ $stderr.printf(" use subtype instead.\n")
return subtype
end
end
@@ -2207,9 +2098,9 @@ module Net
BEG_REGEXP = /\G(?:\
(?# 1: SPACE )( +)|\
-(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
-(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\
-(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+]+)|\
+(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
+(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
+(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+]+)|\
(?# 5: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\
(?# 6: LPAR )(\()|\
(?# 7: RPAR )(\))|\
@@ -2254,10 +2145,6 @@ module Net
else
result = response_tagged
end
- while lookahead.symbol == T_SPACE
- # Ignore trailing space for Microsoft Exchange Server
- shift_token
- end
match(T_CRLF)
match(T_EOF)
return result
@@ -2265,13 +2152,8 @@ module Net
def continue_req
match(T_PLUS)
- token = lookahead
- if token.symbol == T_SPACE
- shift_token
- return ContinuationRequest.new(resp_text, @str)
- else
- return ContinuationRequest.new(ResponseText.new(nil, ""), @str)
- end
+ match(T_SPACE)
+ return ContinuationRequest.new(resp_text, @str)
end
def response_untagged
@@ -2370,8 +2252,6 @@ module Net
name, val = body_data
when /\A(?:UID)\z/ni
name, val = uid_data
- when /\A(?:MODSEQ)\z/ni
- name, val = modseq_data
else
parse_error("unknown attribute `%s' for {%d}", token.value, n)
end
@@ -2714,13 +2594,7 @@ module Net
return param
end
disposition = body_fld_dsp
-
- token = lookahead
- if token.symbol == T_SPACE
- shift_token
- else
- return param, disposition
- end
+ match(T_SPACE)
language = body_fld_lang
token = lookahead
@@ -2804,7 +2678,7 @@ module Net
end
def section
- str = String.new
+ str = ""
token = match(T_LBRA)
str.concat(token.value)
token = match(T_ATOM, T_NUMBER, T_RBRA)
@@ -2861,16 +2735,6 @@ module Net
return name, number
end
- def modseq_data
- token = match(T_ATOM)
- name = token.value.upcase
- match(T_SPACE)
- match(T_LPAR)
- modseq = number
- match(T_RPAR)
- return name, modseq
- end
-
def text_response
token = match(T_ATOM)
name = token.value.upcase
@@ -2999,15 +2863,8 @@ module Net
break
when T_SPACE
shift_token
- when T_NUMBER
+ else
data.push(number)
- when T_LPAR
- # TODO: include the MODSEQ value in a response
- shift_token
- match(T_ATOM)
- match(T_SPACE)
- match(T_NUMBER)
- match(T_RPAR)
end
end
else
@@ -3295,7 +3152,7 @@ module Net
end
def atom
- result = String.new
+ result = ""
while true
token = lookahead
if atom_token?(token)
@@ -3714,10 +3571,6 @@ module Net
class ByeResponseError < ResponseError
end
- RESPONSE_ERRORS = Hash.new(ResponseError)
- RESPONSE_ERRORS["NO"] = NoResponseError
- RESPONSE_ERRORS["BAD"] = BadResponseError
-
# Error raised when too many flags are interned to symbols.
class FlagCountError < Error
end
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 92a4fe7303..db7192c95a 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# = net/pop.rb
#
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
@@ -14,7 +13,7 @@
# Ruby Distribute License.
#
# NOTE: You can find Japanese version of this document at:
-# http://docs.ruby-lang.org/ja/latest/library/net=2fpop.html
+# http://www.ruby-lang.org/ja/man/html/net_pop.html
#
# $Id$
#
@@ -168,8 +167,8 @@ module Net
# require 'net/pop'
#
# # Use APOP authentication if $isapop == true
- # pop = Net::POP3.APOP($isapop).new('apop.example.com', 110)
- # pop.start('YourAccount', 'YourPassword') do |pop|
+ # pop = Net::POP3.APOP($is_apop).new('apop.example.com', 110)
+ # pop.start(YourAccount', 'YourPassword') do |pop|
# # Rest of the code is the same.
# end
#
@@ -467,7 +466,7 @@ module Net
# Provide human-readable stringification of class state.
def inspect
- +"#<#{self.class} #{@address}:#{@port} open=#{@started}>"
+ "#<#{self.class} #{@address}:#{@port} open=#{@started}>"
end
# *WARNING*: This method causes a serious security hole.
@@ -550,15 +549,15 @@ module Net
context.set_params(@ssl_params)
s = OpenSSL::SSL::SSLSocket.new(s, context)
s.sync_close = true
- ssl_socket_connect(s, @open_timeout)
+ s.connect
if context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
end
- @socket = InternetMessageIO.new(s,
- read_timeout: @read_timeout,
- debug_output: @debug_output)
+ @socket = InternetMessageIO.new(s)
logging "POP session started: #{@address}:#{@port} (#{@apop ? 'APOP' : 'POP'})"
+ @socket.read_timeout = @read_timeout
+ @socket.debug_output = @debug_output
on_connect
@command = POP3Command.new(@socket)
if apop?
@@ -570,7 +569,7 @@ module Net
ensure
# Authentication failed, clean up connection.
unless @started
- s.close if s
+ s.close if s and not s.closed?
@socket = nil
@command = nil
end
@@ -601,7 +600,7 @@ module Net
ensure
@started = false
@command = nil
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
@socket = nil
end
private :do_finish
@@ -758,7 +757,7 @@ module Net
# Provide human-readable stringification of class state.
def inspect
- +"#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>"
+ "#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>"
end
#
@@ -771,7 +770,7 @@ module Net
# === Example without block
#
# POP3.start('pop.example.com', 110,
- # 'YourAccount', 'YourPassword') do |pop|
+ # 'YourAccount, 'YourPassword') do |pop|
# n = 1
# pop.mails.each do |popmail|
# File.open("inbox/#{n}", 'w') do |f|
@@ -785,7 +784,7 @@ module Net
# === Example with block
#
# POP3.start('pop.example.com', 110,
- # 'YourAccount', 'YourPassword') do |pop|
+ # 'YourAccount, 'YourPassword') do |pop|
# n = 1
# pop.mails.each do |popmail|
# File.open("inbox/#{n}", 'w') do |f|
@@ -799,7 +798,7 @@ module Net
#
# This method raises a POPError if an error occurs.
#
- def pop( dest = +'', &block ) # :yield: message_chunk
+ def pop( dest = '', &block ) # :yield: message_chunk
if block_given?
@command.retr(@number, &block)
nil
@@ -819,7 +818,7 @@ module Net
# The optional +dest+ argument is obsolete.
#
# This method raises a POPError if an error occurs.
- def top(lines, dest = +'')
+ def top(lines, dest = '')
@command.top(@number, lines) do |chunk|
dest << chunk
end
@@ -831,7 +830,7 @@ module Net
# The optional +dest+ argument is obsolete.
#
# This method raises a POPError if an error occurs.
- def header(dest = +'')
+ def header(dest = '')
top(0, dest)
end
@@ -844,7 +843,7 @@ module Net
# === Example
#
# POP3.start('pop.example.com', 110,
- # 'YourAccount', 'YourPassword') do |pop|
+ # 'YourAccount, 'YourPassword') do |pop|
# n = 1
# pop.mails.each do |popmail|
# File.open("inbox/#{n}", 'w') do |f|
@@ -898,7 +897,7 @@ module Net
attr_reader :socket
def inspect
- +"#<#{self.class} socket=#{@socket}>"
+ "#<#{self.class} socket=#{@socket}>"
end
def auth(account, password)
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 0e887d5aa9..25477014fb 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = net/protocol.rb
#
@@ -21,7 +20,6 @@
require 'socket'
require 'timeout'
-require 'io/wait'
module Net # :nodoc:
@@ -34,24 +32,6 @@ module Net # :nodoc:
end
End
end
-
- def ssl_socket_connect(s, timeout)
- if timeout
- while true
- raise Net::OpenTimeout if timeout <= 0
- start = Process.clock_gettime Process::CLOCK_MONOTONIC
- # to_io is required because SSLSocket doesn't have wait_readable yet
- case s.connect_nonblock(exception: false)
- when :wait_readable; s.to_io.wait_readable(timeout)
- when :wait_writable; s.to_io.wait_writable(timeout)
- else; break
- end
- timeout -= Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
- end
- else
- s.connect
- end
- end
end
@@ -79,12 +59,12 @@ module Net # :nodoc:
class BufferedIO #:nodoc: internal use only
- def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
+ def initialize(io)
@io = io
- @read_timeout = read_timeout
- @continue_timeout = continue_timeout
- @debug_output = debug_output
- @rbuf = ''.dup
+ @read_timeout = 60
+ @continue_timeout = nil
+ @debug_output = nil
+ @rbuf = ''
end
attr_reader :io
@@ -114,19 +94,17 @@ module Net # :nodoc:
public
- def read(len, dest = ''.dup, ignore_eof = false)
+ def read(len, dest = '', ignore_eof = false)
LOG "reading #{len} bytes..."
read_bytes = 0
begin
while read_bytes + @rbuf.size < len
- s = rbuf_consume(@rbuf.size)
+ dest << (s = rbuf_consume(@rbuf.size))
read_bytes += s.size
- dest << s
rbuf_fill
end
- s = rbuf_consume(len - read_bytes)
+ dest << (s = rbuf_consume(len - read_bytes))
read_bytes += s.size
- dest << s
rescue EOFError
raise unless ignore_eof
end
@@ -134,14 +112,13 @@ module Net # :nodoc:
dest
end
- def read_all(dest = ''.dup)
+ def read_all(dest = '')
LOG 'reading all...'
read_bytes = 0
begin
while true
- s = rbuf_consume(@rbuf.size)
+ dest << (s = rbuf_consume(@rbuf.size))
read_bytes += s.size
- dest << s
rbuf_fill
end
rescue EOFError
@@ -172,22 +149,23 @@ module Net # :nodoc:
BUFSIZE = 1024 * 16
def rbuf_fill
- case rv = @io.read_nonblock(BUFSIZE, exception: false)
- when String
- @rbuf << rv
- rv.clear
- return
- when :wait_readable
- @io.to_io.wait_readable(@read_timeout) or raise Net::ReadTimeout
- # continue looping
- when :wait_writable
+ begin
+ @rbuf << @io.read_nonblock(BUFSIZE)
+ rescue IO::WaitReadable
+ if IO.select([@io], nil, nil, @read_timeout)
+ retry
+ else
+ raise Net::ReadTimeout
+ end
+ rescue IO::WaitWritable
# OpenSSL::Buffering#read_nonblock may fail with IO::WaitWritable.
# http://www.openssl.org/support/faq.html#PROG10
- @io.to_io.wait_writable(@read_timeout) or raise Net::ReadTimeout
- # continue looping
- when nil
- raise EOFError, 'end of file reached'
- end while true
+ if IO.select(nil, [@io], nil, @read_timeout)
+ retry
+ else
+ raise Net::ReadTimeout
+ end
+ end
end
def rbuf_consume(len)
@@ -258,7 +236,7 @@ module Net # :nodoc:
class InternetMessageIO < BufferedIO #:nodoc: internal use only
- def initialize(*)
+ def initialize(io)
super
@wbuf = nil
end
@@ -335,7 +313,7 @@ module Net # :nodoc:
end
def using_each_crlf_line
- @wbuf = ''.dup
+ @wbuf = ''
yield
if not @wbuf.empty? # unterminated last line
write0 dot_stuff(@wbuf.chomp) + "\r\n"
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 1777a7fa7e..64e536a12a 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# = net/smtp.rb
#
# Copyright (c) 1999-2007 Yukihiro Matsumoto.
@@ -12,6 +11,9 @@
# This program is free software. You can re-distribute and/or
# modify this program under the same terms as Ruby itself.
#
+# NOTE: You can find Japanese version of this document at:
+# http://www.ruby-lang.org/ja/man/html/net_smtp.html
+#
# $Id$
#
# See Net::SMTP for documentation.
@@ -167,7 +169,7 @@ module Net
# Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain',
# 'Your Account', 'Your Password', :cram_md5)
#
- class SMTP < Protocol
+ class SMTP
Revision = %q$Revision$.split[1]
@@ -567,7 +569,7 @@ module Net
ensure
unless @started
# authentication failed, cancel connection.
- s.close if s
+ s.close if s and not s.closed?
@socket = nil
end
end
@@ -581,7 +583,7 @@ module Net
s = ssl_socket(s, @ssl_context)
logging "TLS connection started"
s.sync_close = true
- ssl_socket_connect(s, @open_timeout)
+ s.connect
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
@@ -592,8 +594,10 @@ module Net
end
def new_internet_message_io(s)
- InternetMessageIO.new(s, read_timeout: @read_timeout,
- debug_output: @debug_output)
+ io = InternetMessageIO.new(s)
+ io.read_timeout = @read_timeout
+ io.debug_output = @debug_output
+ io
end
def do_helo(helo_domain)
@@ -613,7 +617,7 @@ module Net
ensure
@started = false
@error_occurred = false
- @socket.close if @socket
+ @socket.close if @socket and not @socket.closed?
@socket = nil
end
@@ -783,7 +787,7 @@ module Net
def base64_encode(str)
# expects "str" may not become too long
- [str].pack('m0')
+ [str].pack('m').gsub(/\s+/, '')
end
IMASK = 0x36
@@ -921,15 +925,7 @@ module Net
private
- def validate_line(line)
- # A bare CR or LF is not allowed in RFC5321.
- if /[\r\n]/ =~ line
- raise ArgumentError, "A line must not contain CR or LF"
- end
- end
-
def getok(reqline)
- validate_line reqline
res = critical {
@socket.writeline reqline
recv_response()
@@ -939,13 +935,12 @@ module Net
end
def get_response(reqline)
- validate_line reqline
@socket.writeline reqline
recv_response()
end
def recv_response
- buf = ''.dup
+ buf = ''
while true
line = @socket.readline
buf << line << "\n"
@@ -1035,9 +1030,9 @@ module Net
end
# Creates a CRAM-MD5 challenge. You can view more information on CRAM-MD5
- # on Wikipedia: https://en.wikipedia.org/wiki/CRAM-MD5
+ # on Wikipedia: http://en.wikipedia.org/wiki/CRAM-MD5
def cram_md5_challenge
- @string.split(/ /)[1].unpack1('m')
+ @string.split(/ /)[1].unpack('m')[0]
end
# Returns a hash of the human readable reply text in the response if it
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
new file mode 100644
index 0000000000..2260e7fb10
--- /dev/null
+++ b/lib/net/telnet.rb
@@ -0,0 +1,763 @@
+# = net/telnet.rb - Simple Telnet Client Library
+#
+# Author:: Wakou Aoyama <wakou@ruby-lang.org>
+# Documentation:: William Webber and Wakou Aoyama
+#
+# This file holds the class Net::Telnet, which provides client-side
+# telnet functionality.
+#
+# For documentation, see Net::Telnet.
+#
+
+require "net/protocol"
+require "English"
+
+module Net
+
+ #
+ # == Net::Telnet
+ #
+ # Provides telnet client functionality.
+ #
+ # This class also has, through delegation, all the methods of a
+ # socket object (by default, a +TCPSocket+, but can be set by the
+ # +Proxy+ option to <tt>new()</tt>). This provides methods such as
+ # <tt>close()</tt> to end the session and <tt>sysread()</tt> to read
+ # data directly from the host, instead of via the <tt>waitfor()</tt>
+ # mechanism. Note that if you do use <tt>sysread()</tt> directly
+ # when in telnet mode, you should probably pass the output through
+ # <tt>preprocess()</tt> to extract telnet command sequences.
+ #
+ # == Overview
+ #
+ # The telnet protocol allows a client to login remotely to a user
+ # account on a server and execute commands via a shell. The equivalent
+ # is done by creating a Net::Telnet class with the +Host+ option
+ # set to your host, calling #login() with your user and password,
+ # issuing one or more #cmd() calls, and then calling #close()
+ # to end the session. The #waitfor(), #print(), #puts(), and
+ # #write() methods, which #cmd() is implemented on top of, are
+ # only needed if you are doing something more complicated.
+ #
+ # A Net::Telnet object can also be used to connect to non-telnet
+ # services, such as SMTP or HTTP. In this case, you normally
+ # want to provide the +Port+ option to specify the port to
+ # connect to, and set the +Telnetmode+ option to false to prevent
+ # the client from attempting to interpret telnet command sequences.
+ # Generally, #login() will not work with other protocols, and you
+ # have to handle authentication yourself.
+ #
+ # For some protocols, it will be possible to specify the +Prompt+
+ # option once when you create the Telnet object and use #cmd() calls;
+ # for others, you will have to specify the response sequence to
+ # look for as the Match option to every #cmd() call, or call
+ # #puts() and #waitfor() directly; for yet others, you will have
+ # to use #sysread() instead of #waitfor() and parse server
+ # responses yourself.
+ #
+ # It is worth noting that when you create a new Net::Telnet object,
+ # you can supply a proxy IO channel via the Proxy option. This
+ # can be used to attach the Telnet object to other Telnet objects,
+ # to already open sockets, or to any read-write IO object. This
+ # can be useful, for instance, for setting up a test fixture for
+ # unit testing.
+ #
+ # == Examples
+ #
+ # === Log in and send a command, echoing all output to stdout
+ #
+ # localhost = Net::Telnet::new("Host" => "localhost",
+ # "Timeout" => 10,
+ # "Prompt" => /[$%#>] \z/n)
+ # localhost.login("username", "password") { |c| print c }
+ # localhost.cmd("command") { |c| print c }
+ # localhost.close
+ #
+ #
+ # === Check a POP server to see if you have mail
+ #
+ # pop = Net::Telnet::new("Host" => "your_destination_host_here",
+ # "Port" => 110,
+ # "Telnetmode" => false,
+ # "Prompt" => /^\+OK/n)
+ # pop.cmd("user " + "your_username_here") { |c| print c }
+ # pop.cmd("pass " + "your_password_here") { |c| print c }
+ # pop.cmd("list") { |c| print c }
+ #
+ # == References
+ #
+ # There are a large number of RFCs relevant to the Telnet protocol.
+ # RFCs 854-861 define the base protocol. For a complete listing
+ # of relevant RFCs, see
+ # http://www.omnifarious.org/~hopper/technical/telnet-rfc.html
+ #
+ class Telnet
+
+ # :stopdoc:
+ IAC = 255.chr # "\377" # "\xff" # interpret as command
+ DONT = 254.chr # "\376" # "\xfe" # you are not to use option
+ DO = 253.chr # "\375" # "\xfd" # please, you use option
+ WONT = 252.chr # "\374" # "\xfc" # I won't use option
+ WILL = 251.chr # "\373" # "\xfb" # I will use option
+ SB = 250.chr # "\372" # "\xfa" # interpret as subnegotiation
+ GA = 249.chr # "\371" # "\xf9" # you may reverse the line
+ EL = 248.chr # "\370" # "\xf8" # erase the current line
+ EC = 247.chr # "\367" # "\xf7" # erase the current character
+ AYT = 246.chr # "\366" # "\xf6" # are you there
+ AO = 245.chr # "\365" # "\xf5" # abort output--but let prog finish
+ IP = 244.chr # "\364" # "\xf4" # interrupt process--permanently
+ BREAK = 243.chr # "\363" # "\xf3" # break
+ DM = 242.chr # "\362" # "\xf2" # data mark--for connect. cleaning
+ NOP = 241.chr # "\361" # "\xf1" # nop
+ SE = 240.chr # "\360" # "\xf0" # end sub negotiation
+ EOR = 239.chr # "\357" # "\xef" # end of record (transparent mode)
+ ABORT = 238.chr # "\356" # "\xee" # Abort process
+ SUSP = 237.chr # "\355" # "\xed" # Suspend process
+ EOF = 236.chr # "\354" # "\xec" # End of file
+ SYNCH = 242.chr # "\362" # "\xf2" # for telfunc calls
+
+ OPT_BINARY = 0.chr # "\000" # "\x00" # Binary Transmission
+ OPT_ECHO = 1.chr # "\001" # "\x01" # Echo
+ OPT_RCP = 2.chr # "\002" # "\x02" # Reconnection
+ OPT_SGA = 3.chr # "\003" # "\x03" # Suppress Go Ahead
+ OPT_NAMS = 4.chr # "\004" # "\x04" # Approx Message Size Negotiation
+ OPT_STATUS = 5.chr # "\005" # "\x05" # Status
+ OPT_TM = 6.chr # "\006" # "\x06" # Timing Mark
+ OPT_RCTE = 7.chr # "\a" # "\x07" # Remote Controlled Trans and Echo
+ OPT_NAOL = 8.chr # "\010" # "\x08" # Output Line Width
+ OPT_NAOP = 9.chr # "\t" # "\x09" # Output Page Size
+ OPT_NAOCRD = 10.chr # "\n" # "\x0a" # Output Carriage-Return Disposition
+ OPT_NAOHTS = 11.chr # "\v" # "\x0b" # Output Horizontal Tab Stops
+ OPT_NAOHTD = 12.chr # "\f" # "\x0c" # Output Horizontal Tab Disposition
+ OPT_NAOFFD = 13.chr # "\r" # "\x0d" # Output Formfeed Disposition
+ OPT_NAOVTS = 14.chr # "\016" # "\x0e" # Output Vertical Tabstops
+ OPT_NAOVTD = 15.chr # "\017" # "\x0f" # Output Vertical Tab Disposition
+ OPT_NAOLFD = 16.chr # "\020" # "\x10" # Output Linefeed Disposition
+ OPT_XASCII = 17.chr # "\021" # "\x11" # Extended ASCII
+ OPT_LOGOUT = 18.chr # "\022" # "\x12" # Logout
+ OPT_BM = 19.chr # "\023" # "\x13" # Byte Macro
+ OPT_DET = 20.chr # "\024" # "\x14" # Data Entry Terminal
+ OPT_SUPDUP = 21.chr # "\025" # "\x15" # SUPDUP
+ OPT_SUPDUPOUTPUT = 22.chr # "\026" # "\x16" # SUPDUP Output
+ OPT_SNDLOC = 23.chr # "\027" # "\x17" # Send Location
+ OPT_TTYPE = 24.chr # "\030" # "\x18" # Terminal Type
+ OPT_EOR = 25.chr # "\031" # "\x19" # End of Record
+ OPT_TUID = 26.chr # "\032" # "\x1a" # TACACS User Identification
+ OPT_OUTMRK = 27.chr # "\e" # "\x1b" # Output Marking
+ OPT_TTYLOC = 28.chr # "\034" # "\x1c" # Terminal Location Number
+ OPT_3270REGIME = 29.chr # "\035" # "\x1d" # Telnet 3270 Regime
+ OPT_X3PAD = 30.chr # "\036" # "\x1e" # X.3 PAD
+ OPT_NAWS = 31.chr # "\037" # "\x1f" # Negotiate About Window Size
+ OPT_TSPEED = 32.chr # " " # "\x20" # Terminal Speed
+ OPT_LFLOW = 33.chr # "!" # "\x21" # Remote Flow Control
+ OPT_LINEMODE = 34.chr # "\"" # "\x22" # Linemode
+ OPT_XDISPLOC = 35.chr # "#" # "\x23" # X Display Location
+ OPT_OLD_ENVIRON = 36.chr # "$" # "\x24" # Environment Option
+ OPT_AUTHENTICATION = 37.chr # "%" # "\x25" # Authentication Option
+ OPT_ENCRYPT = 38.chr # "&" # "\x26" # Encryption Option
+ OPT_NEW_ENVIRON = 39.chr # "'" # "\x27" # New Environment Option
+ OPT_EXOPL = 255.chr # "\377" # "\xff" # Extended-Options-List
+
+ NULL = "\000"
+ CR = "\015"
+ LF = "\012"
+ EOL = CR + LF
+ REVISION = '$Id$'
+ # :startdoc:
+
+ #
+ # Creates a new Net::Telnet object.
+ #
+ # Attempts to connect to the host (unless the Proxy option is
+ # provided: see below). If a block is provided, it is yielded
+ # status messages on the attempt to connect to the server, of
+ # the form:
+ #
+ # Trying localhost...
+ # Connected to localhost.
+ #
+ # +options+ is a hash of options. The following example lists
+ # all options and their default values.
+ #
+ # host = Net::Telnet::new(
+ # "Host" => "localhost", # default: "localhost"
+ # "Port" => 23, # default: 23
+ # "Binmode" => false, # default: false
+ # "Output_log" => "output_log", # default: nil (no output)
+ # "Dump_log" => "dump_log", # default: nil (no output)
+ # "Prompt" => /[$%#>] \z/n, # default: /[$%#>] \z/n
+ # "Telnetmode" => true, # default: true
+ # "Timeout" => 10, # default: 10
+ # # if ignore timeout then set "Timeout" to false.
+ # "Waittime" => 0, # default: 0
+ # "Proxy" => proxy # default: nil
+ # # proxy is Net::Telnet or IO object
+ # )
+ #
+ # The options have the following meanings:
+ #
+ # Host:: the hostname or IP address of the host to connect to, as a String.
+ # Defaults to "localhost".
+ #
+ # Port:: the port to connect to. Defaults to 23.
+ #
+ # Binmode:: if false (the default), newline substitution is performed.
+ # Outgoing LF is
+ # converted to CRLF, and incoming CRLF is converted to LF. If
+ # true, this substitution is not performed. This value can
+ # also be set with the #binmode() method. The
+ # outgoing conversion only applies to the #puts() and #print()
+ # methods, not the #write() method. The precise nature of
+ # the newline conversion is also affected by the telnet options
+ # SGA and BIN.
+ #
+ # Output_log:: the name of the file to write connection status messages
+ # and all received traffic to. In the case of a proper
+ # Telnet session, this will include the client input as
+ # echoed by the host; otherwise, it only includes server
+ # responses. Output is appended verbatim to this file.
+ # By default, no output log is kept.
+ #
+ # Dump_log:: as for Output_log, except that output is written in hexdump
+ # format (16 bytes per line as hex pairs, followed by their
+ # printable equivalent), with connection status messages
+ # preceded by '#', sent traffic preceded by '>', and
+ # received traffic preceded by '<'. By default, not dump log
+ # is kept.
+ #
+ # Prompt:: a regular expression matching the host's command-line prompt
+ # sequence. This is needed by the Telnet class to determine
+ # when the output from a command has finished and the host is
+ # ready to receive a new command. By default, this regular
+ # expression is /[$%#>] \z/n.
+ #
+ # Telnetmode:: a boolean value, true by default. In telnet mode,
+ # traffic received from the host is parsed for special
+ # command sequences, and these sequences are escaped
+ # in outgoing traffic sent using #puts() or #print()
+ # (but not #write()). If you are using the Net::Telnet
+ # object to connect to a non-telnet service (such as
+ # SMTP or POP), this should be set to "false" to prevent
+ # undesired data corruption. This value can also be set
+ # by the #telnetmode() method.
+ #
+ # Timeout:: the number of seconds to wait before timing out both the
+ # initial attempt to connect to host (in this constructor),
+ # which raises a Net::OpenTimeout, and all attempts to read data
+ # from the host, which raises a Net::ReadTimeout (in #waitfor(),
+ # #cmd(), and #login()). The default value is 10 seconds.
+ # You can disable the timeout by setting this value to false.
+ # In this case, the connect attempt will eventually timeout
+ # on the underlying connect(2) socket call with an
+ # Errno::ETIMEDOUT error (but generally only after a few
+ # minutes), but other attempts to read data from the host
+ # will hang indefinitely if no data is forthcoming.
+ #
+ # Waittime:: the amount of time to wait after seeing what looks like a
+ # prompt (that is, received data that matches the Prompt
+ # option regular expression) to see if more data arrives.
+ # If more data does arrive in this time, Net::Telnet assumes
+ # that what it saw was not really a prompt. This is to try to
+ # avoid false matches, but it can also lead to missing real
+ # prompts (if, for instance, a background process writes to
+ # the terminal soon after the prompt is displayed). By
+ # default, set to 0, meaning not to wait for more data.
+ #
+ # Proxy:: a proxy object to used instead of opening a direct connection
+ # to the host. Must be either another Net::Telnet object or
+ # an IO object. If it is another Net::Telnet object, this
+ # instance will use that one's socket for communication. If an
+ # IO object, it is used directly for communication. Any other
+ # kind of object will cause an error to be raised.
+ #
+ def initialize(options) # :yield: mesg
+ @options = options
+ @options["Host"] = "localhost" unless @options.has_key?("Host")
+ @options["Port"] = 23 unless @options.has_key?("Port")
+ @options["Prompt"] = /[$%#>] \z/n unless @options.has_key?("Prompt")
+ @options["Timeout"] = 10 unless @options.has_key?("Timeout")
+ @options["Waittime"] = 0 unless @options.has_key?("Waittime")
+ unless @options.has_key?("Binmode")
+ @options["Binmode"] = false
+ else
+ unless (true == @options["Binmode"] or false == @options["Binmode"])
+ raise ArgumentError, "Binmode option must be true or false"
+ end
+ end
+
+ unless @options.has_key?("Telnetmode")
+ @options["Telnetmode"] = true
+ else
+ unless (true == @options["Telnetmode"] or false == @options["Telnetmode"])
+ raise ArgumentError, "Telnetmode option must be true or false"
+ end
+ end
+
+ @telnet_option = { "SGA" => false, "BINARY" => false }
+
+ if @options.has_key?("Output_log")
+ @log = File.open(@options["Output_log"], 'a+')
+ @log.sync = true
+ @log.binmode
+ end
+
+ if @options.has_key?("Dump_log")
+ @dumplog = File.open(@options["Dump_log"], 'a+')
+ @dumplog.sync = true
+ @dumplog.binmode
+ def @dumplog.log_dump(dir, x) # :nodoc:
+ len = x.length
+ addr = 0
+ offset = 0
+ while 0 < len
+ if len < 16
+ line = x[offset, len]
+ else
+ line = x[offset, 16]
+ end
+ hexvals = line.unpack('H*')[0]
+ hexvals += ' ' * (32 - hexvals.length)
+ hexvals = format("%s %s %s %s " * 4, *hexvals.unpack('a2' * 16))
+ line = line.gsub(/[\000-\037\177-\377]/n, '.')
+ printf "%s 0x%5.5x: %s%s\n", dir, addr, hexvals, line
+ addr += 16
+ offset += 16
+ len -= 16
+ end
+ print "\n"
+ end
+ end
+
+ if @options.has_key?("Proxy")
+ if @options["Proxy"].kind_of?(Net::Telnet)
+ @sock = @options["Proxy"].sock
+ elsif @options["Proxy"].kind_of?(IO)
+ @sock = @options["Proxy"]
+ else
+ raise "Error: Proxy must be an instance of Net::Telnet or IO."
+ end
+ else
+ message = "Trying " + @options["Host"] + "...\n"
+ yield(message) if block_given?
+ @log.write(message) if @options.has_key?("Output_log")
+ @dumplog.log_dump('#', message) if @options.has_key?("Dump_log")
+
+ begin
+ if @options["Timeout"] == false
+ @sock = TCPSocket.open(@options["Host"], @options["Port"])
+ else
+ Timeout.timeout(@options["Timeout"], Net::OpenTimeout) do
+ @sock = TCPSocket.open(@options["Host"], @options["Port"])
+ end
+ end
+ rescue Net::OpenTimeout
+ raise Net::OpenTimeout, "timed out while opening a connection to the host"
+ rescue
+ @log.write($ERROR_INFO.to_s + "\n") if @options.has_key?("Output_log")
+ @dumplog.log_dump('#', $ERROR_INFO.to_s + "\n") if @options.has_key?("Dump_log")
+ raise
+ end
+ @sock.sync = true
+ @sock.binmode
+
+ message = "Connected to " + @options["Host"] + ".\n"
+ yield(message) if block_given?
+ @log.write(message) if @options.has_key?("Output_log")
+ @dumplog.log_dump('#', message) if @options.has_key?("Dump_log")
+ end
+
+ end # initialize
+
+ # The socket the Telnet object is using. Note that this object becomes
+ # a delegate of the Telnet object, so normally you invoke its methods
+ # directly on the Telnet object.
+ attr_reader :sock
+
+ # Set telnet command interpretation on (+mode+ == true) or off
+ # (+mode+ == false), or return the current value (+mode+ not
+ # provided). It should be on for true telnet sessions, off if
+ # using Net::Telnet to connect to a non-telnet service such
+ # as SMTP.
+ def telnetmode(mode = nil)
+ case mode
+ when nil
+ @options["Telnetmode"]
+ when true, false
+ @options["Telnetmode"] = mode
+ else
+ raise ArgumentError, "argument must be true or false, or missing"
+ end
+ end
+
+ # Turn telnet command interpretation on (true) or off (false). It
+ # should be on for true telnet sessions, off if using Net::Telnet
+ # to connect to a non-telnet service such as SMTP.
+ def telnetmode=(mode)
+ if (true == mode or false == mode)
+ @options["Telnetmode"] = mode
+ else
+ raise ArgumentError, "argument must be true or false"
+ end
+ end
+
+ # Turn newline conversion on (+mode+ == false) or off (+mode+ == true),
+ # or return the current value (+mode+ is not specified).
+ def binmode(mode = nil)
+ case mode
+ when nil
+ @options["Binmode"]
+ when true, false
+ @options["Binmode"] = mode
+ else
+ raise ArgumentError, "argument must be true or false"
+ end
+ end
+
+ # Turn newline conversion on (false) or off (true).
+ def binmode=(mode)
+ if (true == mode or false == mode)
+ @options["Binmode"] = mode
+ else
+ raise ArgumentError, "argument must be true or false"
+ end
+ end
+
+ # Preprocess received data from the host.
+ #
+ # Performs newline conversion and detects telnet command sequences.
+ # Called automatically by #waitfor(). You should only use this
+ # method yourself if you have read input directly using sysread()
+ # or similar, and even then only if in telnet mode.
+ def preprocess(string)
+ # combine CR+NULL into CR
+ string = string.gsub(/#{CR}#{NULL}/no, CR) if @options["Telnetmode"]
+
+ # combine EOL into "\n"
+ string = string.gsub(/#{EOL}/no, "\n") unless @options["Binmode"]
+
+ # remove NULL
+ string = string.gsub(/#{NULL}/no, '') unless @options["Binmode"]
+
+ string.gsub(/#{IAC}(
+ [#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]|
+ [#{DO}#{DONT}#{WILL}#{WONT}]
+ [#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]|
+ #{SB}[^#{IAC}]*#{IAC}#{SE}
+ )/xno) do
+ if IAC == $1 # handle escaped IAC characters
+ IAC
+ elsif AYT == $1 # respond to "IAC AYT" (are you there)
+ self.write("nobody here but us pigeons" + EOL)
+ ''
+ elsif DO[0] == $1[0] # respond to "IAC DO x"
+ if OPT_BINARY[0] == $1[1]
+ @telnet_option["BINARY"] = true
+ self.write(IAC + WILL + OPT_BINARY)
+ else
+ self.write(IAC + WONT + $1[1..1])
+ end
+ ''
+ elsif DONT[0] == $1[0] # respond to "IAC DON'T x" with "IAC WON'T x"
+ self.write(IAC + WONT + $1[1..1])
+ ''
+ elsif WILL[0] == $1[0] # respond to "IAC WILL x"
+ if OPT_BINARY[0] == $1[1]
+ self.write(IAC + DO + OPT_BINARY)
+ elsif OPT_ECHO[0] == $1[1]
+ self.write(IAC + DO + OPT_ECHO)
+ elsif OPT_SGA[0] == $1[1]
+ @telnet_option["SGA"] = true
+ self.write(IAC + DO + OPT_SGA)
+ else
+ self.write(IAC + DONT + $1[1..1])
+ end
+ ''
+ elsif WONT[0] == $1[0] # respond to "IAC WON'T x"
+ if OPT_ECHO[0] == $1[1]
+ self.write(IAC + DONT + OPT_ECHO)
+ elsif OPT_SGA[0] == $1[1]
+ @telnet_option["SGA"] = false
+ self.write(IAC + DONT + OPT_SGA)
+ else
+ self.write(IAC + DONT + $1[1..1])
+ end
+ ''
+ else
+ ''
+ end
+ end
+ end # preprocess
+
+ # Read data from the host until a certain sequence is matched.
+ #
+ # If a block is given, the received data will be yielded as it
+ # is read in (not necessarily all in one go), or nil if EOF
+ # occurs before any data is received. Whether a block is given
+ # or not, all data read will be returned in a single string, or again
+ # nil if EOF occurs before any data is received. Note that
+ # received data includes the matched sequence we were looking for.
+ #
+ # +options+ can be either a regular expression or a hash of options.
+ # If a regular expression, this specifies the data to wait for.
+ # If a hash, this can specify the following options:
+ #
+ # Match:: a regular expression, specifying the data to wait for.
+ # Prompt:: as for Match; used only if Match is not specified.
+ # String:: as for Match, except a string that will be converted
+ # into a regular expression. Used only if Match and
+ # Prompt are not specified.
+ # Timeout:: the number of seconds to wait for data from the host
+ # before raising a Timeout::Error. If set to false,
+ # no timeout will occur. If not specified, the
+ # Timeout option value specified when this instance
+ # was created will be used, or, failing that, the
+ # default value of 10 seconds.
+ # Waittime:: the number of seconds to wait after matching against
+ # the input data to see if more data arrives. If more
+ # data arrives within this time, we will judge ourselves
+ # not to have matched successfully, and will continue
+ # trying to match. If not specified, the Waittime option
+ # value specified when this instance was created will be
+ # used, or, failing that, the default value of 0 seconds,
+ # which means not to wait for more input.
+ # FailEOF:: if true, when the remote end closes the connection then an
+ # EOFError will be raised. Otherwise, defaults to the old
+ # behaviour that the function will return whatever data
+ # has been received already, or nil if nothing was received.
+ #
+ def waitfor(options) # :yield: recvdata
+ time_out = @options["Timeout"]
+ waittime = @options["Waittime"]
+ fail_eof = @options["FailEOF"]
+
+ if options.kind_of?(Hash)
+ prompt = if options.has_key?("Match")
+ options["Match"]
+ elsif options.has_key?("Prompt")
+ options["Prompt"]
+ elsif options.has_key?("String")
+ Regexp.new( Regexp.quote(options["String"]) )
+ end
+ time_out = options["Timeout"] if options.has_key?("Timeout")
+ waittime = options["Waittime"] if options.has_key?("Waittime")
+ fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
+ else
+ prompt = options
+ end
+
+ if time_out == false
+ time_out = nil
+ end
+
+ line = ''
+ buf = ''
+ rest = ''
+ until(prompt === line and not IO::select([@sock], nil, nil, waittime))
+ unless IO::select([@sock], nil, nil, time_out)
+ raise Net::ReadTimeout, "timed out while waiting for more data"
+ end
+ begin
+ c = @sock.readpartial(1024 * 1024)
+ @dumplog.log_dump('<', c) if @options.has_key?("Dump_log")
+ if @options["Telnetmode"]
+ c = rest + c
+ if Integer(c.rindex(/#{IAC}#{SE}/no) || 0) <
+ Integer(c.rindex(/#{IAC}#{SB}/no) || 0)
+ buf = preprocess(c[0 ... c.rindex(/#{IAC}#{SB}/no)])
+ rest = c[c.rindex(/#{IAC}#{SB}/no) .. -1]
+ elsif pt = c.rindex(/#{IAC}[^#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]?\z/no) ||
+ c.rindex(/\r\z/no)
+ buf = preprocess(c[0 ... pt])
+ rest = c[pt .. -1]
+ else
+ buf = preprocess(c)
+ rest = ''
+ end
+ else
+ # Not Telnetmode.
+ #
+ # We cannot use preprocess() on this data, because that
+ # method makes some Telnetmode-specific assumptions.
+ buf = rest + c
+ rest = ''
+ unless @options["Binmode"]
+ if pt = buf.rindex(/\r\z/no)
+ buf = buf[0 ... pt]
+ rest = buf[pt .. -1]
+ end
+ buf.gsub!(/#{EOL}/no, "\n")
+ end
+ end
+ @log.print(buf) if @options.has_key?("Output_log")
+ line += buf
+ yield buf if block_given?
+ rescue EOFError # End of file reached
+ raise if fail_eof
+ if line == ''
+ line = nil
+ yield nil if block_given?
+ end
+ break
+ end
+ end
+ line
+ end
+
+ # Write +string+ to the host.
+ #
+ # Does not perform any conversions on +string+. Will log +string+ to the
+ # dumplog, if the Dump_log option is set.
+ def write(string)
+ length = string.length
+ while 0 < length
+ IO::select(nil, [@sock])
+ @dumplog.log_dump('>', string[-length..-1]) if @options.has_key?("Dump_log")
+ length -= @sock.syswrite(string[-length..-1])
+ end
+ end
+
+ # Sends a string to the host.
+ #
+ # This does _not_ automatically append a newline to the string. Embedded
+ # newlines may be converted and telnet command sequences escaped
+ # depending upon the values of telnetmode, binmode, and telnet options
+ # set by the host.
+ def print(string)
+ string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]
+
+ if @options["Binmode"]
+ self.write(string)
+ else
+ if @telnet_option["BINARY"] and @telnet_option["SGA"]
+ # IAC WILL SGA IAC DO BIN send EOL --> CR
+ self.write(string.gsub(/\n/n, CR))
+ elsif @telnet_option["SGA"]
+ # IAC WILL SGA send EOL --> CR+NULL
+ self.write(string.gsub(/\n/n, CR + NULL))
+ else
+ # NONE send EOL --> CR+LF
+ self.write(string.gsub(/\n/n, EOL))
+ end
+ end
+ end
+
+ # Sends a string to the host.
+ #
+ # Same as #print(), but appends a newline to the string.
+ def puts(string)
+ self.print(string + "\n")
+ end
+
+ # Send a command to the host.
+ #
+ # More exactly, sends a string to the host, and reads in all received
+ # data until is sees the prompt or other matched sequence.
+ #
+ # If a block is given, the received data will be yielded to it as
+ # it is read in. Whether a block is given or not, the received data
+ # will be return as a string. Note that the received data includes
+ # the prompt and in most cases the host's echo of our command.
+ #
+ # +options+ is either a String, specified the string or command to
+ # send to the host; or it is a hash of options. If a hash, the
+ # following options can be specified:
+ #
+ # String:: the command or other string to send to the host.
+ # Match:: a regular expression, the sequence to look for in
+ # the received data before returning. If not specified,
+ # the Prompt option value specified when this instance
+ # was created will be used, or, failing that, the default
+ # prompt of /[$%#>] \z/n.
+ # Timeout:: the seconds to wait for data from the host before raising
+ # a Timeout error. If not specified, the Timeout option
+ # value specified when this instance was created will be
+ # used, or, failing that, the default value of 10 seconds.
+ #
+ # The command or other string will have the newline sequence appended
+ # to it.
+ def cmd(options) # :yield: recvdata
+ match = @options["Prompt"]
+ time_out = @options["Timeout"]
+ fail_eof = @options["FailEOF"]
+
+ if options.kind_of?(Hash)
+ string = options["String"]
+ match = options["Match"] if options.has_key?("Match")
+ time_out = options["Timeout"] if options.has_key?("Timeout")
+ fail_eof = options["FailEOF"] if options.has_key?("FailEOF")
+ else
+ string = options
+ end
+
+ self.puts(string)
+ if block_given?
+ waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof}){|c| yield c }
+ else
+ waitfor({"Prompt" => match, "Timeout" => time_out, "FailEOF" => fail_eof})
+ end
+ end
+
+ # Login to the host with a given username and password.
+ #
+ # The username and password can either be provided as two string
+ # arguments in that order, or as a hash with keys "Name" and
+ # "Password".
+ #
+ # This method looks for the strings "login" and "Password" from the
+ # host to determine when to send the username and password. If the
+ # login sequence does not follow this pattern (for instance, you
+ # are connecting to a service other than telnet), you will need
+ # to handle login yourself.
+ #
+ # The password can be omitted, either by only
+ # provided one String argument, which will be used as the username,
+ # or by providing a has that has no "Password" key. In this case,
+ # the method will not look for the "Password:" prompt; if it is
+ # sent, it will have to be dealt with by later calls.
+ #
+ # The method returns all data received during the login process from
+ # the host, including the echoed username but not the password (which
+ # the host should not echo). If a block is passed in, this received
+ # data is also yielded to the block as it is received.
+ def login(options, password = nil) # :yield: recvdata
+ login_prompt = /[Ll]ogin[: ]*\z/n
+ password_prompt = /[Pp]ass(?:word|phrase)[: ]*\z/n
+ if options.kind_of?(Hash)
+ username = options["Name"]
+ password = options["Password"]
+ login_prompt = options["LoginPrompt"] if options["LoginPrompt"]
+ password_prompt = options["PasswordPrompt"] if options["PasswordPrompt"]
+ else
+ username = options
+ end
+
+ if block_given?
+ line = waitfor(login_prompt){|c| yield c }
+ if password
+ line += cmd({"String" => username,
+ "Match" => password_prompt}){|c| yield c }
+ line += cmd(password){|c| yield c }
+ else
+ line += cmd(username){|c| yield c }
+ end
+ else
+ line = waitfor(login_prompt)
+ if password
+ line += cmd({"String" => username,
+ "Match" => password_prompt})
+ line += cmd(password)
+ else
+ line += cmd(username)
+ end
+ end
+ line
+ end
+
+ # Closes the connection
+ def close
+ @sock.close
+ end
+
+ end # class Telnet
+end # module Net
+
diff --git a/lib/observer.rb b/lib/observer.rb
index acfe654301..10f2eb0db5 100644
--- a/lib/observer.rb
+++ b/lib/observer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# Implementation of the _Observer_ object-oriented design pattern. The
# following documentation is copied, with modifications, from "Programming
@@ -114,7 +113,7 @@
module Observable
#
- # Add +observer+ as an observer on this object. So that it will receive
+ # Add +observer+ as an observer on this object. so that it will receive
# notifications.
#
# +observer+:: the object that will be notified of changes.
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index c0ef89c2ec..b793828063 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'uri'
require 'stringio'
require 'time'
@@ -40,13 +39,6 @@ module Kernel
module_function :open
end
-module URI #:nodoc:
- # alias for Kernel.open defined in open-uri.
- def self.open(name, *rest, &block)
- Kernel.open(name, *rest, &block)
- end
-end
-
# OpenURI is an easy-to-use wrapper for Net::HTTP, Net::HTTPS and Net::FTP.
#
# == Example
@@ -110,12 +102,10 @@ module OpenURI
:content_length_proc => true,
:http_basic_authentication => true,
:read_timeout => true,
- :open_timeout => true,
:ssl_ca_cert => nil,
:ssl_verify_mode => nil,
:ftp_active_mode => false,
:redirect => true,
- :encoding => nil,
}
def OpenURI.check_options(options) # :nodoc:
@@ -149,12 +139,6 @@ module OpenURI
encoding, = $1,Encoding.find($1) if $1
mode = nil
end
- if options.has_key? :encoding
- if !encoding.nil?
- raise ArgumentError, "encoding specified twice"
- end
- encoding = Encoding.find(options[:encoding])
- end
unless mode == nil ||
mode == 'r' || mode == 'rb' ||
@@ -263,7 +247,7 @@ module OpenURI
# (RFC 2109 4.3.1, RFC 2965 3.3, RFC 2616 15.1.3)
# However this is ad hoc. It should be extensible/configurable.
uri1.scheme.downcase == uri2.scheme.downcase ||
- (/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
+ (/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:http|ftp)\z/i =~ uri2.scheme)
end
def OpenURI.open_http(buf, target, proxy, options) # :nodoc:
@@ -284,9 +268,6 @@ module OpenURI
if URI::HTTP === target
# HTTP or HTTPS
if proxy
- unless proxy_user && proxy_pass
- proxy_user, proxy_pass = proxy_uri.userinfo.split(':') if proxy_uri.userinfo
- end
if proxy_user && proxy_pass
klass = Net::HTTP::Proxy(proxy_uri.hostname, proxy_uri.port, proxy_user, proxy_pass)
else
@@ -302,8 +283,7 @@ module OpenURI
target_port = proxy_uri.port
request_uri = target.to_s
if proxy_user && proxy_pass
- header["Proxy-Authorization"] =
- 'Basic ' + ["#{proxy_user}:#{proxy_pass}"].pack('m0')
+ header["Proxy-Authorization"] = 'Basic ' + ["#{proxy_user}:#{proxy_pass}"].pack('m').delete("\r\n")
end
end
@@ -314,12 +294,10 @@ module OpenURI
http.verify_mode = options[:ssl_verify_mode] || OpenSSL::SSL::VERIFY_PEER
store = OpenSSL::X509::Store.new
if options[:ssl_ca_cert]
- Array(options[:ssl_ca_cert]).each do |cert|
- if File.directory? cert
- store.add_path cert
- else
- store.add_file cert
- end
+ if File.directory? options[:ssl_ca_cert]
+ store.add_path options[:ssl_ca_cert]
+ else
+ store.add_file options[:ssl_ca_cert]
end
else
store.set_default_paths
@@ -329,9 +307,6 @@ module OpenURI
if options.include? :read_timeout
http.read_timeout = options[:read_timeout]
end
- if options.include? :open_timeout
- http.open_timeout = options[:open_timeout]
- end
resp = nil
http.start {
@@ -652,8 +627,8 @@ module OpenURI
# is called before actual transfer is started.
# It takes one argument, which is expected content length in bytes.
#
- # If two or more transfers are performed by HTTP redirection, the
- # procedure is called only once for the last transfer.
+ # If two or more transfer is done by HTTP redirection, the procedure
+ # is called only one for a last transfer.
#
# When expected content length is unknown, the procedure is called with
# nil. This happens when the HTTP response has no Content-Length header.
@@ -692,16 +667,9 @@ module OpenURI
#
# :read_timeout option specifies a timeout of read for http connections.
#
- # [:open_timeout]
- # Synopsis:
- # :open_timeout=>nil (no timeout)
- # :open_timeout=>10 (10 second)
- #
- # :open_timeout option specifies a timeout of open for http connections.
- #
# [:ssl_ca_cert]
# Synopsis:
- # :ssl_ca_cert=>filename or an Array of filenames
+ # :ssl_ca_cert=>filename
#
# :ssl_ca_cert is used to specify CA certificate for SSL.
# If it is given, default certificates are not used.
@@ -791,7 +759,7 @@ module URI
# The access sequence is defined by RFC 1738
ftp = Net::FTP.new
ftp.connect(self.hostname, self.port)
- ftp.passive = !options[:ftp_active_mode]
+ ftp.passive = true if !options[:ftp_active_mode]
# todo: extract user/passwd from .netrc.
user = 'anonymous'
passwd = nil
diff --git a/lib/open3.rb b/lib/open3.rb
index 2bbead2951..e80b1cd385 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
#
# = open3.rb: Popen, but with stderr, too
#
@@ -192,19 +190,15 @@ module Open3
module_function :popen2e
def popen_run(cmd, opts, child_io, parent_io) # :nodoc:
- if last = Hash.try_convert(cmd.last)
- opts = opts.merge(last)
- cmd.pop
- end
pid = spawn(*cmd, opts)
wait_thr = Process.detach(pid)
- child_io.each(&:close)
+ child_io.each {|io| io.close }
result = [*parent_io, wait_thr]
if defined? yield
begin
return yield(*result)
ensure
- parent_io.each(&:close)
+ parent_io.each{|io| io.close unless io.closed?}
wait_thr.join
end
end
@@ -220,11 +214,11 @@ module Open3
# stdout_str, stderr_str, status = Open3.capture3([env,] cmd... [, opts])
#
# The arguments env, cmd and opts are passed to Open3.popen3 except
- # <code>opts[:stdin_data]</code> and <code>opts[:binmode]</code>. See Process.spawn.
+ # opts[:stdin_data] and opts[:binmode]. See Process.spawn.
#
- # If <code>opts[:stdin_data]</code> is specified, it is sent to the command's standard input.
+ # If opts[:stdin_data] is specified, it is sent to the command's standard input.
#
- # If <code>opts[:binmode]</code> is true, internal pipes are set to binary mode.
+ # If opts[:binmode] is true, internal pipes are set to binary mode.
#
# Examples:
#
@@ -264,11 +258,7 @@ module Open3
out_reader = Thread.new { o.read }
err_reader = Thread.new { e.read }
begin
- if stdin_data.respond_to? :readpartial
- IO.copy_stream(stdin_data, i)
- else
- i.write stdin_data
- end
+ i.write stdin_data
rescue Errno::EPIPE
end
i.close
@@ -282,11 +272,11 @@ module Open3
# stdout_str, status = Open3.capture2([env,] cmd... [, opts])
#
# The arguments env, cmd and opts are passed to Open3.popen3 except
- # <code>opts[:stdin_data]</code> and <code>opts[:binmode]</code>. See Process.spawn.
+ # opts[:stdin_data] and opts[:binmode]. See Process.spawn.
#
- # If <code>opts[:stdin_data]</code> is specified, it is sent to the command's standard input.
+ # If opts[:stdin_data] is specified, it is sent to the command's standard input.
#
- # If <code>opts[:binmode]</code> is true, internal pipes are set to binary mode.
+ # If opts[:binmode] is true, internal pipes are set to binary mode.
#
# Example:
#
@@ -315,11 +305,7 @@ module Open3
out_reader = Thread.new { o.read }
if stdin_data
begin
- if stdin_data.respond_to? :readpartial
- IO.copy_stream(stdin_data, i)
- else
- i.write stdin_data
- end
+ i.write stdin_data
rescue Errno::EPIPE
end
end
@@ -334,11 +320,11 @@ module Open3
# stdout_and_stderr_str, status = Open3.capture2e([env,] cmd... [, opts])
#
# The arguments env, cmd and opts are passed to Open3.popen3 except
- # <code>opts[:stdin_data]</code> and <code>opts[:binmode]</code>. See Process.spawn.
+ # opts[:stdin_data] and opts[:binmode]. See Process.spawn.
#
- # If <code>opts[:stdin_data]</code> is specified, it is sent to the command's standard input.
+ # If opts[:stdin_data] is specified, it is sent to the command's standard input.
#
- # If <code>opts[:binmode]</code> is true, internal pipes are set to binary mode.
+ # If opts[:binmode] is true, internal pipes are set to binary mode.
#
# Example:
#
@@ -354,11 +340,7 @@ module Open3
outerr_reader = Thread.new { oe.read }
if stdin_data
begin
- if stdin_data.respond_to? :readpartial
- IO.copy_stream(stdin_data, i)
- else
- i.write stdin_data
- end
+ i.write stdin_data
rescue Errno::EPIPE
end
end
@@ -613,7 +595,7 @@ module Open3
#
def pipeline(*cmds, **opts)
pipeline_run(cmds, opts, [], []) {|ts|
- ts.map(&:value)
+ ts.map {|t| t.value }
}
end
module_function :pipeline
@@ -662,13 +644,13 @@ module Open3
r = r2
}
result = parent_io + [wait_thrs]
- child_io.each(&:close)
+ child_io.each {|io| io.close }
if defined? yield
begin
return yield(*result)
ensure
- parent_io.each(&:close)
- wait_thrs.each(&:join)
+ parent_io.each{|io| io.close unless io.closed?}
+ wait_thrs.each {|t| t.join }
end
end
result
diff --git a/lib/optionparser.rb b/lib/optionparser.rb
index 4b9b40d82a..d89a4d22fb 100644
--- a/lib/optionparser.rb
+++ b/lib/optionparser.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
require_relative 'optparse'
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 05415901a3..4ec891e3ae 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# optparse.rb - command-line option analysis with the OptionParser class.
#
@@ -118,120 +117,8 @@
# #=>
# # Usage: example.rb [options]
# # -n, --name=NAME Name to say hello to
-# # -h, --help Prints this help
+# # -h, --help Prints this help#
#
-# === Required Arguments
-#
-# For options that require an argument, option specification strings may include an
-# option name in all caps. If an option is used without the required argument,
-# an exception will be raised.
-# require 'optparse'
-#
-# options = {}
-# OptionParser.new do |parser|
-# parser.on("-r", "--require LIBRARY",
-# "Require the LIBRARY before executing your script") do |lib|
-# puts "You required #{lib}!"
-# end
-# end.parse!
-#
-# Used:
-#
-# bash-3.2$ ruby optparse-test.rb -r
-# optparse-test.rb:9:in `<main>': missing argument: -r (OptionParser::MissingArgument)
-# bash-3.2$ ruby optparse-test.rb -r my-library
-# You required my-library!
-#
-# === Type Coercion
-#
-# OptionParser supports the ability to coerce command line arguments
-# into objects for us.
-#
-# OptionParser comes with a few ready-to-use kinds of type
-# coercion. They are:
-#
-# - Date -- Anything accepted by +Date.parse+
-# - DateTime -- Anything accepted by +DateTime.parse+
-# - Time -- Anything accepted by +Time.httpdate+ or +Time.parse+
-# - URI -- Anything accepted by +URI.parse+
-# - Shellwords -- Anything accepted by +Shellwords.shellwords+
-# - String -- Any non-empty string
-# - Integer -- Any integer. Will convert octal. (e.g. 124, -3, 040)
-# - Float -- Any float. (e.g. 10, 3.14, -100E+13)
-# - Numeric -- Any integer, float, or rational (1, 3.4, 1/3)
-# - DecimalInteger -- Like +Integer+, but no octal format.
-# - OctalInteger -- Like +Integer+, but no decimal format.
-# - DecimalNumeric -- Decimal integer or float.
-# - TrueClass -- Accepts '+, yes, true, -, no, false' and
-# defaults as +true+
-# - FalseClass -- Same as +TrueClass+, but defaults to +false+
-# - Array -- Strings separated by ',' (e.g. 1,2,3)
-# - Regexp -- Regular expressions. Also includes options.
-#
-# We can also add our own coercions, which we will cover soon.
-#
-# ==== Using Built-in Conversions
-#
-# As an example, the built-in +Time+ conversion is used. The other built-in
-# conversions behave in the same way.
-# OptionParser will attempt to parse the argument
-# as a +Time+. If it succeeds, that time will be passed to the
-# handler block. Otherwise, an exception will be raised.
-#
-# require 'optparse'
-# require 'optparse/time'
-# OptionParser.new do |parser|
-# parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
-# p time
-# end
-# end.parse!
-#
-# Used:
-# bash-3.2$ ruby optparse-test.rb -t nonsense
-# ... invalid argument: -t nonsense (OptionParser::InvalidArgument)
-# from ... time.rb:5:in `block in <top (required)>'
-# from optparse-test.rb:31:in `<main>'
-# bash-3.2$ ruby optparse-test.rb -t 10-11-12
-# 2010-11-12 00:00:00 -0500
-# bash-3.2$ ruby optparse-test.rb -t 9:30
-# 2014-08-13 09:30:00 -0400
-#
-# ==== Creating Custom Conversions
-#
-# The +accept+ method on OptionParser may be used to create converters.
-# It specifies which conversion block to call whenever a class is specified.
-# The example below uses it to fetch a +User+ object before the +on+ handler receives it.
-#
-# require 'optparse'
-#
-# User = Struct.new(:id, :name)
-#
-# def find_user id
-# not_found = ->{ raise "No User Found for id #{id}" }
-# [ User.new(1, "Sam"),
-# User.new(2, "Gandalf") ].find(not_found) do |u|
-# u.id == id
-# end
-# end
-#
-# op = OptionParser.new
-# op.accept(User) do |user_id|
-# find_user user_id.to_i
-# end
-#
-# op.on("--user ID", User) do |user|
-# puts user
-# end
-#
-# op.parse!
-#
-# output:
-# bash-3.2$ ruby optparse-test.rb --user 1
-# #<struct User id=1, name="Sam">
-# bash-3.2$ ruby optparse-test.rb --user 2
-# #<struct User id=2, name="Gandalf">
-# bash-3.2$ ruby optparse-test.rb --user 3
-# optparse-test.rb:15:in `block in find_user': No User Found for id 3 (RuntimeError)
# === Complete example
#
# The following example is a complete Ruby program. You can run it and see the
@@ -244,142 +131,110 @@
# require 'pp'
#
# class OptparseExample
-# Version = '1.0.0'
#
# CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary]
# CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
#
-# class ScriptOptions
-# attr_accessor :library, :inplace, :encoding, :transfer_type,
-# :verbose, :extension, :delay, :time, :record_separator,
-# :list
-#
-# def initialize
-# self.library = []
-# self.inplace = false
-# self.encoding = "utf8"
-# self.transfer_type = :auto
-# self.verbose = false
-# end
+# #
+# # Return a structure describing the options.
+# #
+# def self.parse(args)
+# # The options specified on the command line will be collected in *options*.
+# # We set default values here.
+# options = OpenStruct.new
+# options.library = []
+# options.inplace = false
+# options.encoding = "utf8"
+# options.transfer_type = :auto
+# options.verbose = false
#
-# def define_options(parser)
-# parser.banner = "Usage: example.rb [options]"
-# parser.separator ""
-# parser.separator "Specific options:"
+# opt_parser = OptionParser.new do |opts|
+# opts.banner = "Usage: example.rb [options]"
#
-# # add additional options
-# perform_inplace_option(parser)
-# delay_execution_option(parser)
-# execute_at_time_option(parser)
-# specify_record_separator_option(parser)
-# list_example_option(parser)
-# specify_encoding_option(parser)
-# optional_option_argument_with_keyword_completion_option(parser)
-# boolean_verbose_option(parser)
+# opts.separator ""
+# opts.separator "Specific options:"
#
-# parser.separator ""
-# parser.separator "Common options:"
-# # No argument, shows at tail. This will print an options summary.
-# # Try it and see!
-# parser.on_tail("-h", "--help", "Show this message") do
-# puts parser
-# exit
-# end
-# # Another typical switch to print the version.
-# parser.on_tail("--version", "Show version") do
-# puts Version
-# exit
+# # Mandatory argument.
+# opts.on("-r", "--require LIBRARY",
+# "Require the LIBRARY before executing your script") do |lib|
+# options.library << lib
# end
-# end
#
-# def perform_inplace_option(parser)
-# # Specifies an optional option argument
-# parser.on("-i", "--inplace [EXTENSION]",
-# "Edit ARGV files in place",
-# "(make backup if EXTENSION supplied)") do |ext|
-# self.inplace = true
-# self.extension = ext || ''
-# self.extension.sub!(/\A\.?(?=.)/, ".") # Ensure extension begins with dot.
+# # Optional argument; multi-line description.
+# opts.on("-i", "--inplace [EXTENSION]",
+# "Edit ARGV files in place",
+# " (make backup if EXTENSION supplied)") do |ext|
+# options.inplace = true
+# options.extension = ext || ''
+# options.extension.sub!(/\A\.?(?=.)/, ".") # Ensure extension begins with dot.
# end
-# end
#
-# def delay_execution_option(parser)
# # Cast 'delay' argument to a Float.
-# parser.on("--delay N", Float, "Delay N seconds before executing") do |n|
-# self.delay = n
+# opts.on("--delay N", Float, "Delay N seconds before executing") do |n|
+# options.delay = n
# end
-# end
#
-# def execute_at_time_option(parser)
# # Cast 'time' argument to a Time object.
-# parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
-# self.time = time
+# opts.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
+# options.time = time
# end
-# end
#
-# def specify_record_separator_option(parser)
# # Cast to octal integer.
-# parser.on("-F", "--irs [OCTAL]", OptionParser::OctalInteger,
-# "Specify record separator (default \\0)") do |rs|
-# self.record_separator = rs
+# opts.on("-F", "--irs [OCTAL]", OptionParser::OctalInteger,
+# "Specify record separator (default \\0)") do |rs|
+# options.record_separator = rs
# end
-# end
#
-# def list_example_option(parser)
# # List of arguments.
-# parser.on("--list x,y,z", Array, "Example 'list' of arguments") do |list|
-# self.list = list
+# opts.on("--list x,y,z", Array, "Example 'list' of arguments") do |list|
+# options.list = list
# end
-# end
#
-# def specify_encoding_option(parser)
# # Keyword completion. We are specifying a specific set of arguments (CODES
# # and CODE_ALIASES - notice the latter is a Hash), and the user may provide
# # the shortest unambiguous text.
-# code_list = (CODE_ALIASES.keys + CODES).join(', ')
-# parser.on("--code CODE", CODES, CODE_ALIASES, "Select encoding",
-# "(#{code_list})") do |encoding|
-# self.encoding = encoding
+# code_list = (CODE_ALIASES.keys + CODES).join(',')
+# opts.on("--code CODE", CODES, CODE_ALIASES, "Select encoding",
+# " (#{code_list})") do |encoding|
+# options.encoding = encoding
# end
-# end
#
-# def optional_option_argument_with_keyword_completion_option(parser)
-# # Optional '--type' option argument with keyword completion.
-# parser.on("--type [TYPE]", [:text, :binary, :auto],
-# "Select transfer type (text, binary, auto)") do |t|
-# self.transfer_type = t
+# # Optional argument with keyword completion.
+# opts.on("--type [TYPE]", [:text, :binary, :auto],
+# "Select transfer type (text, binary, auto)") do |t|
+# options.transfer_type = t
# end
-# end
#
-# def boolean_verbose_option(parser)
# # Boolean switch.
-# parser.on("-v", "--[no-]verbose", "Run verbosely") do |v|
-# self.verbose = v
+# opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
+# options.verbose = v
# end
-# end
-# end
#
-# #
-# # Return a structure describing the options.
-# #
-# def parse(args)
-# # The options specified on the command line will be collected in
-# # *options*.
+# opts.separator ""
+# opts.separator "Common options:"
+#
+# # No argument, shows at tail. This will print an options summary.
+# # Try it and see!
+# opts.on_tail("-h", "--help", "Show this message") do
+# puts opts
+# exit
+# end
#
-# @options = ScriptOptions.new
-# @args = OptionParser.new do |parser|
-# @options.define_options(parser)
-# parser.parse!(args)
+# # Another typical switch to print the version.
+# opts.on_tail("--version", "Show version") do
+# puts ::Version.join('.')
+# exit
+# end
# end
-# @options
-# end
#
-# attr_reader :parser, :options
+# opt_parser.parse!(args)
+# options
+# end # parse()
+#
# end # class OptparseExample
#
-# example = OptparseExample.new
-# options = example.parse(ARGV)
-# pp options # example.options
+# options = OptparseExample.parse(ARGV)
+# pp options
# pp ARGV
#
# === Shell Completion
@@ -413,7 +268,7 @@ class OptionParser
candidates = []
block.call do |k, *v|
(if Regexp === k
- kn = "".freeze
+ kn = nil
k === key
else
kn = defined?(k.id2name) ? k.id2name : k
@@ -578,7 +433,7 @@ class OptionParser
l = left[-1].length + s.length
l += arg.length if left.size == 1 && arg
l < max or sopts.empty? or left << ''
- left[-1] << (left[-1].empty? ? ' ' * 4 : ', ') << s
+ left[-1] << if left[-1].empty? then ' ' * 4 else ', ' end << s
end
if arg
@@ -1336,7 +1191,6 @@ XXX
default_pattern = nil
klass = nil
q, a = nil
- has_arg = false
opts.each do |o|
# argument class
@@ -1386,8 +1240,7 @@ XXX
default_style = Switch::NoArgument
default_pattern, conv = search(:atype, FalseClass) unless default_pattern
ldesc << "--no-#{q}"
- (q = q.downcase).tr!('_', '-')
- long << "no-#{q}"
+ long << 'no-' + (q = q.downcase)
nolong << q
when /^--\[no-\]([^\[\]=\s]*)(.+)?/
q, a = $1, $2
@@ -1397,11 +1250,10 @@ XXX
default_pattern, conv = search(:atype, o) unless default_pattern
end
ldesc << "--[no-]#{q}"
- (o = q.downcase).tr!('_', '-')
- long << o
+ long << (o = q.downcase)
not_pattern, not_conv = search(:atype, FalseClass) unless not_style
not_style = Switch::NoArgument
- nolong << "no-#{o}"
+ nolong << 'no-' + o
when /^--([^\[\]=\s]*)(.+)?/
q, a = $1, $2
if a
@@ -1410,16 +1262,13 @@ XXX
default_pattern, conv = search(:atype, o) unless default_pattern
end
ldesc << "--#{q}"
- (o = q.downcase).tr!('_', '-')
- long << o
+ long << (o = q.downcase)
when /^-(\[\^?\]?(?:[^\\\]]|\\.)*\])(.+)?/
q, a = $1, $2
o = notwice(Object, klass, 'type')
if a
default_style = default_style.guess(arg = a)
default_pattern, conv = search(:atype, o) unless default_pattern
- else
- has_arg = true
end
sdesc << "-#{q}"
short << Regexp.new(q)
@@ -1442,9 +1291,6 @@ XXX
default_pattern, conv = search(:atype, default_style.pattern) unless default_pattern
if !(short.empty? and long.empty?)
- if has_arg and default_style == Switch::NoArgument
- default_style = Switch::RequiredArgument
- end
s = (style || default_style).new(pattern || default_pattern,
conv, sdesc, ldesc, arg, desc, block)
elsif !block
@@ -1518,18 +1364,17 @@ XXX
#
# Returns the rest of +argv+ left unparsed.
#
- def order(*argv, into: nil, &nonopt)
+ def order(*argv, &block)
argv = argv[0].dup if argv.size == 1 and Array === argv[0]
- order!(argv, into: into, &nonopt)
+ order!(argv, &block)
end
#
# Same as #order, but removes switches destructively.
# Non-option arguments remain in +argv+.
#
- def order!(argv = default_argv, into: nil, &nonopt)
- setter = ->(name, val) {into[name.to_sym] = val} if into
- parse_in_order(argv, setter, &nonopt)
+ def order!(argv = default_argv, &nonopt)
+ parse_in_order(argv, &nonopt)
end
def parse_in_order(argv = default_argv, setter = nil, &nonopt) # :nodoc:
@@ -1541,7 +1386,6 @@ XXX
# long option
when /\A--([^=]*)(?:=(.*))?/m
opt, rest = $1, $2
- opt.tr!('_', '-')
begin
sw, = complete(:long, opt, true)
rescue ParseError
@@ -1557,8 +1401,7 @@ XXX
# short option
when /\A-(.)((=).*|.+)?/m
- eq, rest, opt = $3, $2, $1
- has_arg, val = eq, rest
+ opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
begin
sw, = search(:short, opt)
unless sw
@@ -1612,18 +1455,18 @@ XXX
# Parses command line arguments +argv+ in permutation mode and returns
# list of non-option arguments.
#
- def permute(*argv, into: nil)
+ def permute(*argv)
argv = argv[0].dup if argv.size == 1 and Array === argv[0]
- permute!(argv, into: into)
+ permute!(argv)
end
#
# Same as #permute, but removes switches destructively.
# Non-option arguments remain in +argv+.
#
- def permute!(argv = default_argv, into: nil)
+ def permute!(argv = default_argv)
nonopts = []
- order!(argv, into: into, &nonopts.method(:<<))
+ order!(argv, &nonopts.method(:<<))
argv[0, 0] = nonopts
argv
end
@@ -1632,32 +1475,32 @@ XXX
# Parses command line arguments +argv+ in order when environment variable
# POSIXLY_CORRECT is set, and in permutation mode otherwise.
#
- def parse(*argv, into: nil)
+ def parse(*argv)
argv = argv[0].dup if argv.size == 1 and Array === argv[0]
- parse!(argv, into: into)
+ parse!(argv)
end
#
# Same as #parse, but removes switches destructively.
# Non-option arguments remain in +argv+.
#
- def parse!(argv = default_argv, into: nil)
+ def parse!(argv = default_argv)
if ENV.include?('POSIXLY_CORRECT')
- order!(argv, into: into)
+ order!(argv)
else
- permute!(argv, into: into)
+ permute!(argv)
end
end
#
# Wrapper method for getopts.rb.
#
- # params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option")
- # # params["a"] = true # -a
- # # params["b"] = "1" # -b1
- # # params["foo"] = "1" # --foo
- # # params["bar"] = "x" # --bar x
- # # params["zot"] = "z" # --zot Z
+ # params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option)
+ # # params[:a] = true # -a
+ # # params[:b] = "1" # -b1
+ # # params[:foo] = "1" # --foo
+ # # params[:bar] = "x" # --bar x
+ # # params[:zot] = "z" # --zot Z
#
def getopts(*args)
argv = Array === args.first ? args.shift : default_argv
@@ -1725,7 +1568,7 @@ XXX
# Completes shortened long style option switch and returns pair of
# canonical switch and switch descriptor OptionParser::Switch.
#
- # +typ+:: Searching table.
+ # +id+:: Searching table.
# +opt+:: Searching key.
# +icase+:: Search case insensitive if true.
# +pat+:: Optional pattern for completion.
@@ -1744,16 +1587,16 @@ XXX
def candidate(word)
list = []
case word
- when '-'
- long = short = true
when /\A--/
word, arg = word.split(/=/, 2)
argpat = Completion.regexp(arg, false) if arg and !arg.empty?
long = true
- when /\A-/
+ when /\A-(!-)/
short = true
+ when /\A-/
+ long = short = true
end
- pat = Completion.regexp(word, long)
+ pat = Completion.regexp(word, true)
visit(:each_option) do |opt|
next unless Switch === opt
opts = (long ? opt.long : []) + (short ? opt.short : [])
@@ -1842,7 +1685,7 @@ XXX
#
# Float number format, and converts to Float.
#
- float = "(?:#{decimal}(?=(.)?)(?:\\.(?:#{decimal})?)?|\\.#{decimal})(?:E[-+]?#{decimal})?"
+ float = "(?:#{decimal}(?:\\.(?:#{decimal})?)?|\\.#{decimal})(?:E[-+]?#{decimal})?"
floatpat = %r"\A[-+]?#{float}\z"io
accept(Float, floatpat) {|s,| s.to_f if s}
@@ -1851,13 +1694,11 @@ XXX
# for float format, and Rational for rational format.
#
real = "[-+]?(?:#{octal}|#{float})"
- accept(Numeric, /\A(#{real})(?:\/(#{real}))?\z/io) {|s, d, f, n,|
+ accept(Numeric, /\A(#{real})(?:\/(#{real}))?\z/io) {|s, d, n|
if n
Rational(d, n)
- elsif f
- Float(s)
- else
- Integer(s)
+ elsif s
+ eval(s)
end
}
@@ -1867,7 +1708,7 @@ XXX
DecimalInteger = /\A[-+]?#{decimal}\z/io
accept(DecimalInteger, DecimalInteger) {|s,|
begin
- Integer(s, 10)
+ Integer(s)
rescue ArgumentError
raise OptionParser::InvalidArgument, s
end if s
@@ -1891,14 +1732,10 @@ XXX
# integer format, Float for float format.
#
DecimalNumeric = floatpat # decimal integer is allowed as float also.
- accept(DecimalNumeric, floatpat) {|s, f|
+ accept(DecimalNumeric, floatpat) {|s,|
begin
- if f
- Float(s)
- else
- Integer(s)
- end
- rescue ArgumentError
+ eval(s)
+ rescue SyntaxError
raise OptionParser::InvalidArgument, s
end if s
}
@@ -1921,7 +1758,7 @@ XXX
#
# List of strings separated by ",".
#
- accept(Array) do |s, |
+ accept(Array) do |s,|
if s
s = s.split(',').collect {|ss| ss unless ss.empty?}
end
@@ -2157,5 +1994,4 @@ end
# ARGV is arguable by OptionParser
ARGV.extend(OptionParser::Arguable)
-# An alias for OptionParser.
-OptParse = OptionParser # :nodoc:
+OptParse = OptionParser
diff --git a/lib/optparse/ac.rb b/lib/optparse/ac.rb
index fb0883f97a..6a8626094d 100644
--- a/lib/optparse/ac.rb
+++ b/lib/optparse/ac.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'optparse'
class OptionParser::AC < OptionParser
diff --git a/lib/optparse/date.rb b/lib/optparse/date.rb
index d6649c83f1..d680559f37 100644
--- a/lib/optparse/date.rb
+++ b/lib/optparse/date.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'optparse'
require 'date'
diff --git a/lib/optparse/kwargs.rb b/lib/optparse/kwargs.rb
deleted file mode 100644
index ed58cc142b..0000000000
--- a/lib/optparse/kwargs.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-require 'optparse'
-
-class OptionParser
- def define_by_keywords(options, meth, **opts)
- meth.parameters.each do |type, name|
- case type
- when :key, :keyreq
- op, cl = *(type == :key ? %w"[ ]" : ["", ""])
- define("--#{name}=#{op}#{name.upcase}#{cl}", *opts[name]) do |o|
- options[name] = o
- end
- end
- end
- options
- end
-end
diff --git a/lib/optparse/shellwords.rb b/lib/optparse/shellwords.rb
index bf31701b96..0422d7c887 100644
--- a/lib/optparse/shellwords.rb
+++ b/lib/optparse/shellwords.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# -*- ruby -*-
require 'shellwords'
diff --git a/lib/optparse/time.rb b/lib/optparse/time.rb
index ffc6ff000d..402cadcf16 100644
--- a/lib/optparse/time.rb
+++ b/lib/optparse/time.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'optparse'
require 'time'
diff --git a/lib/optparse/uri.rb b/lib/optparse/uri.rb
index 51550cf91b..024dc69eac 100644
--- a/lib/optparse/uri.rb
+++ b/lib/optparse/uri.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# -*- ruby -*-
require 'optparse'
diff --git a/lib/optparse/version.rb b/lib/optparse/version.rb
index b869d8fe51..8525677418 100644
--- a/lib/optparse/version.rb
+++ b/lib/optparse/version.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# OptionParser internal utility
class << OptionParser
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 28890304e4..f51eb7b5db 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = ostruct.rb: OpenStruct implementation
#
@@ -15,65 +14,62 @@
# accomplished by using Ruby's metaprogramming to define methods on the class
# itself.
#
-# == Examples
+# == Examples:
#
-# require "ostruct"
+# require 'ostruct'
#
# person = OpenStruct.new
-# person.name = "John Smith"
-# person.age = 70
+# person.name = "John Smith"
+# person.age = 70
+# person.pension = 300
#
-# person.name # => "John Smith"
-# person.age # => 70
-# person.address # => nil
+# puts person.name # -> "John Smith"
+# puts person.age # -> 70
+# puts person.address # -> nil
#
-# An OpenStruct employs a Hash internally to store the attributes and values
-# and can even be initialized with one:
+# An OpenStruct employs a Hash internally to store the methods and values and
+# can even be initialized with one:
#
-# australia = OpenStruct.new(:country => "Australia", :capital => "Canberra")
-# # => #<OpenStruct country="Australia", capital="Canberra">
+# australia = OpenStruct.new(:country => "Australia", :population => 20_000_000)
+# p australia # -> <OpenStruct country="Australia" population=20000000>
#
-# Hash keys with spaces or characters that could normally not be used for
-# method calls (e.g. <code>()[]*</code>) will not be immediately available
-# on the OpenStruct object as a method for retrieval or assignment, but can
-# still be reached through the Object#send method.
+# Hash keys with spaces or characters that would normally not be able to use for
+# method calls (e.g. ()[]*) will not be immediately available on the
+# OpenStruct object as a method for retrieval or assignment, but can be still be
+# reached through the Object#send method.
#
# measurements = OpenStruct.new("length (in inches)" => 24)
-# measurements.send("length (in inches)") # => 24
+# measurements.send("length (in inches)") # -> 24
#
-# message = OpenStruct.new(:queued? => true)
-# message.queued? # => true
-# message.send("queued?=", false)
-# message.queued? # => false
+# data_point = OpenStruct.new(:queued? => true)
+# data_point.queued? # -> true
+# data_point.send("queued?=",false)
+# data_point.queued? # -> false
#
-# Removing the presence of an attribute requires the execution of the
-# delete_field method as setting the property value to +nil+ will not
-# remove the attribute.
-#
-# first_pet = OpenStruct.new(:name => "Rowdy", :owner => "John Smith")
-# second_pet = OpenStruct.new(:name => "Rowdy")
+# Removing the presence of a method requires the execution the delete_field
+# method as setting the property value to +nil+ will not remove the method.
#
+# first_pet = OpenStruct.new(:name => 'Rowdy', :owner => 'John Smith')
# first_pet.owner = nil
-# first_pet # => #<OpenStruct name="Rowdy", owner=nil>
-# first_pet == second_pet # => false
+# second_pet = OpenStruct.new(:name => 'Rowdy')
+#
+# first_pet == second_pet # -> false
#
# first_pet.delete_field(:owner)
-# first_pet # => #<OpenStruct name="Rowdy">
-# first_pet == second_pet # => true
+# first_pet == second_pet # -> true
#
#
-# == Implementation
+# == Implementation:
#
# An OpenStruct utilizes Ruby's method lookup structure to find and define the
-# necessary methods for properties. This is accomplished through the methods
-# method_missing and define_singleton_method.
+# necessary methods for properties. This is accomplished through the method
+# method_missing and define_method.
#
# This should be a consideration if there is a concern about the performance of
# the objects that are created, as there is much more overhead in the setting
# of these properties compared to using a Hash or a Struct.
#
class OpenStruct
-
#
# Creates a new OpenStruct object. By default, the resulting OpenStruct
# object will have no attributes.
@@ -82,11 +78,11 @@ class OpenStruct
# (can be a Hash, an OpenStruct or a Struct).
# For example:
#
- # require "ostruct"
- # hash = { "country" => "Australia", :capital => "Canberra" }
+ # require 'ostruct'
+ # hash = { "country" => "Australia", :population => 20_000_000 }
# data = OpenStruct.new(hash)
#
- # data # => #<OpenStruct country="Australia", capital="Canberra">
+ # p data # -> <OpenStruct country="Australia" population=20000000>
#
def initialize(hash=nil)
@table = {}
@@ -94,44 +90,43 @@ class OpenStruct
hash.each_pair do |k, v|
k = k.to_sym
@table[k] = v
+ new_ostruct_member(k)
end
end
end
- # Duplicates an OpenStruct object's Hash table.
- def initialize_copy(orig) # :nodoc:
+ # Duplicate an OpenStruct object members.
+ def initialize_copy(orig)
super
@table = @table.dup
+ @table.each_key{|key| new_ostruct_member(key)}
end
#
# Converts the OpenStruct to a hash with keys representing
- # each attribute (as symbols) and their corresponding values.
+ # each attribute (as symbols) and their corresponding values
+ # Example:
#
- # require "ostruct"
- # data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
- # data.to_h # => {:country => "Australia", :capital => "Canberra" }
+ # require 'ostruct'
+ # data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
+ # data.to_h # => {:country => "Australia", :population => 20000000 }
#
def to_h
@table.dup
end
#
- # :call-seq:
- # ostruct.each_pair {|name, value| block } -> ostruct
- # ostruct.each_pair -> Enumerator
+ # Yields all attributes (as a symbol) along with the corresponding values
+ # or returns an enumerator if not block is given.
+ # Example:
#
- # Yields all attributes (as symbols) along with the corresponding values
- # or returns an enumerator if no block is given.
- #
- # require "ostruct"
- # data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
- # data.each_pair.to_a # => [[:country, "Australia"], [:capital, "Canberra"]]
+ # require 'ostruct'
+ # data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
+ # data.each_pair.to_a # => [[:country, "Australia"], [:population, 20000000]]
#
def each_pair
return to_enum(__method__) { @table.size } unless block_given?
@table.each_pair{|p| yield p}
- self
end
#
@@ -146,13 +141,14 @@ class OpenStruct
#
def marshal_load(x)
@table = x
+ @table.each_key{|key| new_ostruct_member(key)}
end
#
# Used internally to check if the OpenStruct is able to be
# modified before granting access to the internal Hash table to be modified.
#
- def modifiable? # :nodoc:
+ def modifiable
begin
@modifiable = true
rescue
@@ -160,10 +156,6 @@ class OpenStruct
end
@table
end
- private :modifiable?
-
- # ::Kernel.warn("do not use OpenStruct#modifiable", uplevel: 1)
- alias modifiable modifiable? # :nodoc:
protected :modifiable
#
@@ -171,135 +163,67 @@ class OpenStruct
# OpenStruct. It does this by using the metaprogramming function
# define_singleton_method for both the getter method and the setter method.
#
- def new_ostruct_member!(name) # :nodoc:
+ def new_ostruct_member(name)
name = name.to_sym
- unless singleton_class.method_defined?(name)
+ unless respond_to?(name)
define_singleton_method(name) { @table[name] }
- define_singleton_method("#{name}=") {|x| modifiable?[name] = x}
+ define_singleton_method("#{name}=") { |x| modifiable[name] = x }
end
name
end
- private :new_ostruct_member!
-
- # ::Kernel.warn("do not use OpenStruct#new_ostruct_member", uplevel: 1)
- alias new_ostruct_member new_ostruct_member! # :nodoc:
protected :new_ostruct_member
- def freeze
- @table.each_key {|key| new_ostruct_member!(key)}
- super
- end
-
- def respond_to_missing?(mid, include_private = false) # :nodoc:
- mname = mid.to_s.chomp("=").to_sym
- @table&.key?(mname) || super
- end
-
def method_missing(mid, *args) # :nodoc:
+ mname = mid.id2name
len = args.length
- if mname = mid[/.*(?==\z)/m]
+ if mname.chomp!('=')
if len != 1
raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
end
- modifiable?[new_ostruct_member!(mname)] = args[0]
- elsif len == 0 # and /\A[a-z_]\w*\z/ =~ mid #
- if @table.key?(mid)
- new_ostruct_member!(mid) unless frozen?
- @table[mid]
- end
+ modifiable[new_ostruct_member(mname)] = args[0]
+ elsif len == 0
+ @table[mid]
else
- begin
- super
- rescue NoMethodError => err
- err.backtrace.shift
- raise
- end
+ err = NoMethodError.new "undefined method `#{mid}' for #{self}", mid, args
+ err.set_backtrace caller(1)
+ raise err
end
end
+ # Returns the value of a member.
#
- # :call-seq:
- # ostruct[name] -> object
- #
- # Returns the value of an attribute.
- #
- # require "ostruct"
- # person = OpenStruct.new("name" => "John Smith", "age" => 70)
- # person[:age] # => 70, same as person.age
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
+ # person[:age] # => 70, same as ostruct.age
#
def [](name)
@table[name.to_sym]
end
#
- # :call-seq:
- # ostruct[name] = obj -> obj
+ # Sets the value of a member.
#
- # Sets the value of an attribute.
- #
- # require "ostruct"
- # person = OpenStruct.new("name" => "John Smith", "age" => 70)
- # person[:age] = 42 # equivalent to person.age = 42
- # person.age # => 42
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
+ # person[:age] = 42 # => equivalent to ostruct.age = 42
+ # person.age # => 42
#
def []=(name, value)
- modifiable?[new_ostruct_member!(name)] = value
- end
-
- #
- # :call-seq:
- # ostruct.dig(name, ...) -> object
- #
- # Extracts the nested value specified by the sequence of +name+
- # objects by calling +dig+ at each step, returning +nil+ if any
- # intermediate step is +nil+.
- #
- # require "ostruct"
- # address = OpenStruct.new("city" => "Anytown NC", "zip" => 12345)
- # person = OpenStruct.new("name" => "John Smith", "address" => address)
- #
- # person.dig(:address, "zip") # => 12345
- # person.dig(:business_address, "zip") # => nil
- #
- # data = OpenStruct.new(:array => [1, [2, 3]])
- #
- # data.dig(:array, 1, 0) # => 2
- # data.dig(:array, 0, 0) # TypeError: Integer does not have #dig method
- #
- def dig(name, *names)
- begin
- name = name.to_sym
- rescue NoMethodError
- raise TypeError, "#{name} is not a symbol nor a string"
- end
- @table.dig(name, *names)
+ modifiable[new_ostruct_member(name)] = value
end
#
- # Removes the named field from the object. Returns the value that the field
+ # Remove the named field from the object. Returns the value that the field
# contained if it was defined.
#
- # require "ostruct"
- #
- # person = OpenStruct.new(name: "John", age: 70, pension: 300)
+ # require 'ostruct'
#
- # person.delete_field("age") # => 70
- # person # => #<OpenStruct name="John", pension=300>
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
#
- # Setting the value to +nil+ will not remove the attribute:
- #
- # person.pension = nil
- # person # => #<OpenStruct name="John", pension=nil>
+ # person.delete_field('name') # => 'John Smith'
#
def delete_field(name)
sym = name.to_sym
- begin
- singleton_class.__send__(:remove_method, sym, "#{sym}=")
- rescue NameError
- end
- @table.delete(sym) do
- raise NameError.new("no field `#{sym}' in #{self}", sym)
- end
+ singleton_class.__send__(:remove_method, sym, "#{sym}=")
+ @table.delete sym
end
InspectKey = :__inspect_key__ # :nodoc:
@@ -308,43 +232,39 @@ class OpenStruct
# Returns a string containing a detailed summary of the keys and values.
#
def inspect
+ str = "#<#{self.class}"
+
ids = (Thread.current[InspectKey] ||= [])
if ids.include?(object_id)
- detail = ' ...'
- else
- ids << object_id
- begin
- detail = @table.map do |key, value|
- " #{key}=#{value.inspect}"
- end.join(',')
- ensure
- ids.pop
+ return str << ' ...>'
+ end
+
+ ids << object_id
+ begin
+ first = true
+ for k,v in @table
+ str << "," unless first
+ first = false
+ str << " #{k}=#{v.inspect}"
end
+ return str << '>'
+ ensure
+ ids.pop
end
- ['#<', self.class, detail, '>'].join
end
alias :to_s :inspect
attr_reader :table # :nodoc:
protected :table
- alias table! table
#
# Compares this object and +other+ for equality. An OpenStruct is equal to
# +other+ when +other+ is an OpenStruct and the two objects' Hash tables are
# equal.
#
- # require "ostruct"
- # first_pet = OpenStruct.new("name" => "Rowdy")
- # second_pet = OpenStruct.new(:name => "Rowdy")
- # third_pet = OpenStruct.new("name" => "Rowdy", :age => nil)
- #
- # first_pet == second_pet # => true
- # first_pet == third_pet # => false
- #
def ==(other)
return false unless other.kind_of?(OpenStruct)
- @table == other.table!
+ @table == other.table
end
#
@@ -354,14 +274,12 @@ class OpenStruct
#
def eql?(other)
return false unless other.kind_of?(OpenStruct)
- @table.eql?(other.table!)
+ @table.eql?(other.table)
end
- # Computes a hash code for this OpenStruct.
- # Two OpenStruct objects with the same content will have the same hash code
- # (and will compare using #eql?).
- #
- # See also Object#hash.
+ # Compute a hash-code for this OpenStruct.
+ # Two hashes with the same content will have the same hash code
+ # (and will be eql?).
def hash
@table.hash
end
diff --git a/lib/pp.rb b/lib/pp.rb
index 85401c8aa6..0091ddf74c 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -1,10 +1,36 @@
-# frozen_string_literal: true
-
require 'prettyprint'
+module Kernel
+ # Returns a pretty printed object as a string.
+ #
+ # In order to use this method you must first require the PP module:
+ #
+ # require 'pp'
+ #
+ # See the PP module for more information.
+ def pretty_inspect
+ PP.pp(self, '')
+ end
+
+ private
+ # prints arguments in pretty form.
+ #
+ # pp returns argument(s).
+ def pp(*objs) # :nodoc:
+ objs.each {|obj|
+ PP.pp(obj)
+ }
+ objs.size <= 1 ? objs.first : objs
+ end
+ module_function :pp # :nodoc:
+end
+
##
# A pretty-printer for Ruby objects.
#
+# All examples assume you have loaded the PP class with:
+# require 'pp'
+#
##
# == What PP Does
#
@@ -284,7 +310,7 @@ class PP < PrettyPrint
inspect_method = method_method.call(:inspect)
rescue NameError
end
- if inspect_method && inspect_method.owner != Kernel
+ if inspect_method && /\(Kernel\)#/ !~ inspect_method.inspect
q.text self.inspect
elsif !inspect_method && self.respond_to?(:inspect)
q.text self.inspect
@@ -318,10 +344,10 @@ class PP < PrettyPrint
# However, doing this requires that every class that #inspect is called on
# implement #pretty_print, or a RuntimeError will be raised.
def pretty_print_inspect
- if Object.instance_method(:method).bind(self).call(:pretty_print).owner == PP::ObjectMixin
+ if /\(PP::ObjectMixin\)#/ =~ Object.instance_method(:method).bind(self).call(:pretty_print).inspect
raise "pretty_print is not overridden for #{self.class}"
end
- PP.singleline_pp(self, ''.dup)
+ PP.singleline_pp(self, '')
end
end
end
@@ -390,21 +416,6 @@ class Range # :nodoc:
end
end
-class String # :nodoc:
- def pretty_print(q) # :nodoc:
- lines = self.lines
- if lines.size > 1
- q.group(0, '', '') do
- q.seplist(lines, lambda { q.text ' +'; q.breakable }) do |v|
- q.pp v
- end
- end
- else
- q.text inspect
- end
- end
-end
-
class File < IO # :nodoc:
class Stat # :nodoc:
def pretty_print(q) # :nodoc:
@@ -458,10 +469,8 @@ class File < IO # :nodoc:
q.comma_breakable
q.group {
q.text sprintf("rdev=0x%x", self.rdev)
- if self.rdev_major && self.rdev_minor
- q.breakable
- q.text sprintf('(%d, %d)', self.rdev_major, self.rdev_minor)
- end
+ q.breakable
+ q.text sprintf('(%d, %d)', self.rdev_major, self.rdev_minor)
}
q.comma_breakable
q.text "size="; q.pp self.size; q.comma_breakable
@@ -533,27 +542,3 @@ end
end
}
}
-
-module Kernel
- # Returns a pretty printed object as a string.
- #
- # In order to use this method you must first require the PP module:
- #
- # require 'pp'
- #
- # See the PP module for more information.
- def pretty_inspect
- PP.pp(self, ''.dup)
- end
-
- # prints arguments in pretty form.
- #
- # pp returns argument(s).
- def pp(*objs)
- objs.each {|obj|
- PP.pp(obj)
- }
- objs.size <= 1 ? objs.first : objs
- end
- module_function :pp
-end
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb
index 2a3ca90dc1..7e989374b7 100644
--- a/lib/prettyprint.rb
+++ b/lib/prettyprint.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-#
# This class implements a pretty printing algorithm. It finds line breaks and
# nice indentations for grouped structure.
#
@@ -42,7 +40,7 @@ class PrettyPrint
# output
# end
#
- def PrettyPrint.format(output=''.dup, maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
+ def PrettyPrint.format(output='', maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n})
q = PrettyPrint.new(output, maxwidth, newline, &genspace)
yield q
q.flush
@@ -56,7 +54,7 @@ class PrettyPrint
# The invocation of +breakable+ in the block doesn't break a line and is
# treated as just an invocation of +text+.
#
- def PrettyPrint.singleline_format(output=''.dup, maxwidth=nil, newline=nil, genspace=nil)
+ def PrettyPrint.singleline_format(output='', maxwidth=nil, newline=nil, genspace=nil)
q = SingleLine.new(output)
yield q
output
@@ -79,7 +77,7 @@ class PrettyPrint
# The block is used to generate spaces. {|width| ' ' * width} is used if it
# is not given.
#
- def initialize(output=''.dup, maxwidth=79, newline="\n", &genspace)
+ def initialize(output='', maxwidth=79, newline="\n", &genspace)
@output = output
@maxwidth = maxwidth
@newline = newline
diff --git a/lib/prime.rb b/lib/prime.rb
index 2cd22da3a8..ebe012b613 100644
--- a/lib/prime.rb
+++ b/lib/prime.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = prime.rb
#
@@ -32,15 +31,7 @@ class Integer
# Returns true if +self+ is a prime number, else returns false.
def prime?
- return self >= 2 if self <= 3
- return true if self == 5
- return false unless 30.gcd(self) == 1
- (7..Integer.sqrt(self)).step(30) do |p|
- return false if
- self%(p) == 0 || self%(p+4) == 0 || self%(p+6) == 0 || self%(p+10) == 0 ||
- self%(p+12) == 0 || self%(p+16) == 0 || self%(p+22) == 0 || self%(p+24) == 0
- end
- true
+ Prime.prime?(self)
end
# Iterates the given block over all prime numbers.
@@ -66,6 +57,9 @@ end
#
# == Retrieving the instance
#
+# +Prime+.new is obsolete. Now +Prime+ has the default instance and you can
+# access it as +Prime+.instance.
+#
# For convenience, each instance method of +Prime+.instance can be accessed
# as a class method of +Prime+.
#
@@ -96,11 +90,20 @@ end
class Prime
include Enumerable
- include Singleton
+ @the_instance = Prime.new
+
+ # obsolete. Use +Prime+::+instance+ or class methods of +Prime+.
+ def initialize
+ @generator = EratosthenesGenerator.new
+ extend OldCompatibility
+ warn "Prime::new is obsolete. use Prime::instance or class methods of Prime."
+ end
class << self
extend Forwardable
include Enumerable
+ # Returns the default instance of Prime.
+ def instance; @the_instance end
def method_added(method) # :nodoc:
(class<< self;self;end).def_delegator :instance, method
@@ -133,6 +136,14 @@ class Prime
# Upper bound of prime numbers. The iterator stops after it
# yields all prime numbers p <= +ubound+.
#
+ # == Note
+ #
+ # +Prime+.+new+ returns an object extended by +Prime+::+OldCompatibility+
+ # in order to be compatible with Ruby 1.8, and +Prime+#each is overwritten
+ # by +Prime+::+OldCompatibility+#+each+.
+ #
+ # +Prime+.+new+ is now obsolete. Use +Prime+.+instance+.+each+ or simply
+ # +Prime+.+each+.
def each(ubound = nil, generator = EratosthenesGenerator.new, &block)
generator.upper_bound = ubound
generator.each(&block)
@@ -146,10 +157,8 @@ class Prime
# +value+:: an arbitrary integer to be checked.
# +generator+:: optional. A pseudo-prime generator.
def prime?(value, generator = Prime::Generator23.new)
- raise ArgumentError, "Expected a prime generator, got #{generator}" unless generator.respond_to? :each
- raise ArgumentError, "Expected an integer, got #{value}" unless value.respond_to?(:integer?) && value.integer?
return false if value < 2
- generator.each do |num|
+ for num in generator
q,r = value.divmod num
return true if q < num
return false if r == 0
@@ -207,7 +216,7 @@ class Prime
else
pv = []
end
- generator.each do |prime|
+ for prime in generator
count = 0
while (value1, mod = value.divmod(prime)
mod) == 0
@@ -222,7 +231,7 @@ class Prime
if value > 1
pv.push [value, 1]
end
- pv
+ return pv
end
# An abstract class for enumerating pseudo-prime numbers.
@@ -263,44 +272,32 @@ class Prime
end
# Iterates the given block for each prime number.
- def each
- return self.dup unless block_given?
+ def each(&block)
+ return self.dup unless block
if @ubound
last_value = nil
loop do
prime = succ
break last_value if prime > @ubound
- last_value = yield prime
+ last_value = block.call(prime)
end
else
loop do
- yield succ
+ block.call(succ)
end
end
end
# see +Enumerator+#with_index.
- def with_index(offset = 0)
- return enum_for(:with_index, offset) { Float::INFINITY } unless block_given?
- return each_with_index(&proc) if offset == 0
-
- each do |prime|
- yield prime, offset
- offset += 1
- end
- end
+ alias with_index each_with_index
# see +Enumerator+#with_object.
def with_object(obj)
- return enum_for(:with_object, obj) { Float::INFINITY } unless block_given?
+ return enum_for(:with_object) unless block_given?
each do |prime|
yield prime, obj
end
end
-
- def size
- Float::INFINITY
- end
end
# An implementation of +PseudoPrimeGenerator+.
@@ -324,7 +321,7 @@ class Prime
# An implementation of +PseudoPrimeGenerator+ which uses
# a prime table generated by trial division.
- class TrialDivisionGenerator < PseudoPrimeGenerator
+ class TrialDivisionGenerator<PseudoPrimeGenerator
def initialize
@index = -1
super
@@ -345,7 +342,7 @@ class Prime
# This is a pseudo-prime generator, suitable on
# checking primality of an integer by brute force
# method.
- class Generator23 < PseudoPrimeGenerator
+ class Generator23<PseudoPrimeGenerator
def initialize
@prime = 1
@step = nil
@@ -353,17 +350,19 @@ class Prime
end
def succ
- if (@step)
- @prime += @step
- @step = 6 - @step
- else
- case @prime
- when 1; @prime = 2
- when 2; @prime = 3
- when 3; @prime = 5; @step = 2
+ loop do
+ if (@step)
+ @prime += @step
+ @step = 6 - @step
+ else
+ case @prime
+ when 1; @prime = 2
+ when 2; @prime = 3
+ when 3; @prime = 5; @step = 2
+ end
end
+ return @prime
end
- @prime
end
alias next succ
def rewind
@@ -390,7 +389,7 @@ class Prime
# Returns the cached prime numbers.
def cache
- @primes
+ return @primes
end
alias primes cache
alias primes_so_far cache
@@ -415,11 +414,11 @@ class Prime
@primes.push @next_to_check if @primes[2..@ulticheck_index].find {|prime| @next_to_check % prime == 0 }.nil?
@next_to_check += 2
end
- @primes[index]
+ return @primes[index]
end
end
- # Internal use. An implementation of Eratosthenes' sieve
+ # Internal use. An implementation of eratosthenes' sieve
class EratosthenesSieve
include Singleton
@@ -445,23 +444,46 @@ class Prime
segment_min = @max_checked
segment_max = [segment_min + max_segment_size, max_cached_prime * 2].min
- root = Integer.sqrt(segment_max)
+ root = Integer(Math.sqrt(segment_max).floor)
- segment = ((segment_min + 1) .. segment_max).step(2).to_a
+ sieving_primes = @primes[1 .. -1].take_while { |prime| prime <= root }
+ offsets = Array.new(sieving_primes.size) do |i|
+ (-(segment_min + 1 + sieving_primes[i]) / 2) % sieving_primes[i]
+ end
- (1..Float::INFINITY).each do |sieving|
- prime = @primes[sieving]
- break if prime > root
- composite_index = (-(segment_min + 1 + prime) / 2) % prime
+ segment = ((segment_min + 1) .. segment_max).step(2).to_a
+ sieving_primes.each_with_index do |prime, index|
+ composite_index = offsets[index]
while composite_index < segment.size do
segment[composite_index] = nil
composite_index += prime
end
end
- @primes.concat(segment.compact!)
-
+ segment.each do |prime|
+ @primes.push prime unless prime.nil?
+ end
@max_checked = segment_max
end
end
+
+ # Provides a +Prime+ object with compatibility to Ruby 1.8 when instantiated via +Prime+.+new+.
+ module OldCompatibility
+ # Returns the next prime number and forwards internal pointer.
+ def succ
+ @generator.succ
+ end
+ alias next succ
+
+ # Overwrites Prime#each.
+ #
+ # Iterates the given block over all prime numbers. Note that enumeration
+ # starts from the current position of internal pointer, not rewound.
+ def each(&block)
+ return @generator.dup unless block_given?
+ loop do
+ yield succ
+ end
+ end
+ end
end
diff --git a/lib/profile.rb b/lib/profile.rb
index e58c92125b..2aeecce908 100644
--- a/lib/profile.rb
+++ b/lib/profile.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'profiler'
RubyVM::InstructionSequence.compile_option = {
diff --git a/lib/profiler.rb b/lib/profiler.rb
index b3c9f7f46a..e53951cbe6 100644
--- a/lib/profiler.rb
+++ b/lib/profiler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# Profile provides a way to Profile your Ruby application.
#
# Profiling your program is a way of determining which methods are called and
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 4daa2e003f..02c20c91c7 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# = PStore -- Transactional File Storage for Ruby Objects
#
# pstore.rb -
@@ -8,7 +7,7 @@
#
# See PStore for documentation.
-require "digest"
+require "digest/md5"
#
# PStore implements a file based persistence mechanism based on a Hash. User
@@ -128,7 +127,7 @@ class PStore
@abort = false
@ultra_safe = false
@thread_safe = thread_safe
- @lock = Thread::Mutex.new
+ @lock = Mutex.new
end
# Raises PStore::Error if the calling code is not in a PStore#transaction.
@@ -190,7 +189,7 @@ class PStore
# store.transaction do # begin transaction
# # load some data into the store...
# store[:single_object] = "My data..."
- # store[:obj_hierarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],
+ # store[:obj_heirarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"],
# "James Gray" => ["erb.rb", "pstore.rb"] }
# end # commit changes to data store file
#
@@ -335,7 +334,7 @@ class PStore
save_data(checksum, original_data_size, file)
end
ensure
- file.close
+ file.close if !file.closed?
end
else
# This can only occur if read_only == true.
@@ -352,15 +351,9 @@ class PStore
private
# Constant for relieving Ruby's garbage collector.
- CHECKSUM_ALGO = %w[SHA512 SHA384 SHA256 SHA1 RMD160 MD5].each do |algo|
- begin
- break Digest(algo)
- rescue LoadError
- end
- end
EMPTY_STRING = ""
EMPTY_MARSHAL_DATA = Marshal.dump({})
- EMPTY_MARSHAL_CHECKSUM = CHECKSUM_ALGO.digest(EMPTY_MARSHAL_DATA)
+ EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
#
# Open the specified filename (either in read-only mode or in
@@ -395,7 +388,7 @@ class PStore
# Load the given PStore file.
# If +read_only+ is true, the unmarshalled Hash will be returned.
# If +read_only+ is false, a 3-tuple will be returned: the unmarshalled
- # Hash, a checksum of the data, and the size of the data.
+ # Hash, an MD5 checksum of the data, and the size of the data.
def load_data(file, read_only)
if read_only
begin
@@ -415,7 +408,7 @@ class PStore
size = empty_marshal_data.bytesize
else
table = load(data)
- checksum = CHECKSUM_ALGO.digest(data)
+ checksum = Digest::MD5.digest(data)
size = data.bytesize
raise Error, "PStore file seems to be corrupted." unless table.is_a?(Hash)
end
@@ -435,7 +428,7 @@ class PStore
def save_data(original_checksum, original_file_size, file)
new_data = dump(@table)
- if new_data.bytesize != original_file_size || CHECKSUM_ALGO.digest(new_data) != original_checksum
+ if new_data.bytesize != original_file_size || Digest::MD5.digest(new_data) != original_checksum
if @ultra_safe && !on_windows?
# Windows doesn't support atomic file renames.
save_data_with_atomic_file_rename_strategy(new_data, file)
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index 0cdb42e49d..f811ab6e78 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# $originalId: parser.rb,v 1.8 2006/07/06 11:42:07 aamine Exp $
#
diff --git a/lib/racc/rdoc/grammar.en.rdoc b/lib/racc/rdoc/grammar.en.rdoc
index af10803f3a..a154246ee5 100644
--- a/lib/racc/rdoc/grammar.en.rdoc
+++ b/lib/racc/rdoc/grammar.en.rdoc
@@ -4,32 +4,32 @@
== Class Block and User Code Block
-There are two blocks on the toplevel. One is the 'class' block, the other is the 'user code'
-block. The 'user code' block MUST be placed after the 'class' block.
+There are two blocks on toplevel. One is 'class' block, another is 'user code'
+block. 'user code' block MUST be placed after 'class' block.
== Comments
-You can insert comments about all places. Two styles of comments can be used, Ruby style '#.....' and C style '/\*......*\/'.
+You can insert comments about all places. Two style comments can be used, Ruby style '#.....' and C style '/\*......*\/'.
== Class Block
The class block is formed like this:
class CLASS_NAME
- [precedence table]
+ [precedance table]
[token declarations]
[expected number of S/R conflicts]
[options]
- [semantic value conversion]
+ [semantic value convertion]
[start rule]
rule
GRAMMARS
-CLASS_NAME is a name of the parser class. This is the name of the generating parser
+CLASS_NAME is a name of parser class. This is the name of generating parser
class.
-If CLASS_NAME includes '::', Racc outputs the module clause. For example, writing
-"class M::C" causes the code below to be created:
+If CLASS_NAME includes '::', Racc outputs module clause. For example, writing
+"class M::C" causes creating the code bellow:
module M
class C
@@ -40,7 +40,7 @@ If CLASS_NAME includes '::', Racc outputs the module clause. For example, writin
== Grammar Block
-The grammar block describes grammar which is able to be understood by the parser.
+The grammar block describes grammar which is able to be understood by parser.
Syntax is:
(token): (token) (token) (token).... (action)
@@ -59,10 +59,10 @@ Note that you cannot use '%' string, here document, '%r' regexp in action.
Actions can be omitted. When it is omitted, '' (empty string) is used.
-A return value of action is a value of the left side value ($$). It is the value of the
-result, or the returned value by `return` statement.
+A return value of action is a value of left side value ($$). It is value of
+result, or returned value by `return` statement.
-Here is an example of the whole grammar block.
+Here is an example of whole grammar block.
rule
goal: definition rules source { result = val }
@@ -81,11 +81,11 @@ You can use the following special local variables in action:
* result ($$)
-The value of the left-hand side (lhs). A default value is val[0].
+The value of left-hand side (lhs). A default value is val[0].
* val ($1,$2,$3...)
-An array of value of the right-hand side (rhs).
+An array of value of right-hand side (rhs).
* _values (...$-2,$-1,$0)
@@ -215,5 +215,5 @@ Format of user code is like this:
:
:
-If four '-' exist on the line head, Racc treats it as the beginning of the
-user code block. The name of the user code block must be one word.
+If four '-' exist on line head, Racc treat it as beginning of user code block.
+The name of user code block must be one word.
diff --git a/lib/rake.rb b/lib/rake.rb
new file mode 100644
index 0000000000..47cce17064
--- /dev/null
+++ b/lib/rake.rb
@@ -0,0 +1,78 @@
+#--
+# Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com)
+#
+# 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.
+#++
+
+module Rake
+ VERSION = '10.3.2'
+end
+
+require 'rake/version'
+
+# :stopdoc:
+# TODO: Remove in Rake 11
+RAKEVERSION = Rake::VERSION
+# :startdoc:
+
+require 'rbconfig'
+require 'fileutils'
+require 'singleton'
+require 'monitor'
+require 'optparse'
+require 'ostruct'
+
+require 'rake/ext/module'
+require 'rake/ext/string'
+require 'rake/ext/time'
+
+require 'rake/win32'
+
+require 'rake/linked_list'
+require 'rake/cpu_counter'
+require 'rake/scope'
+require 'rake/task_argument_error'
+require 'rake/rule_recursion_overflow_error'
+require 'rake/rake_module'
+require 'rake/trace_output'
+require 'rake/pseudo_status'
+require 'rake/task_arguments'
+require 'rake/invocation_chain'
+require 'rake/task'
+require 'rake/file_task'
+require 'rake/file_creation_task'
+require 'rake/multi_task'
+require 'rake/dsl_definition'
+require 'rake/file_utils_ext'
+require 'rake/file_list'
+require 'rake/default_loader'
+require 'rake/early_time'
+require 'rake/name_space'
+require 'rake/task_manager'
+require 'rake/application'
+require 'rake/backtrace'
+
+$trace = false
+
+# :stopdoc:
+#
+# Some top level Constants.
+
+FileList = Rake::FileList
+RakeFileUtils = Rake::FileUtilsExt
diff --git a/lib/rake/alt_system.rb b/lib/rake/alt_system.rb
new file mode 100644
index 0000000000..aa7b7791b6
--- /dev/null
+++ b/lib/rake/alt_system.rb
@@ -0,0 +1,110 @@
+#
+# Copyright (c) 2008 James M. Lawrence
+#
+# 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.
+#
+
+require 'rbconfig'
+
+##
+# Alternate implementations of system() and backticks `` on Windows
+# for ruby-1.8 and earlier.
+#--
+# TODO: Remove in Rake 11
+
+module Rake::AltSystem # :nodoc: all
+ WINDOWS = RbConfig::CONFIG["host_os"] =~
+ %r!(msdos|mswin|djgpp|mingw|[Ww]indows)!
+
+ class << self
+ def define_module_function(name, &block)
+ define_method(name, &block)
+ module_function(name)
+ end
+ end
+
+ if WINDOWS && RUBY_VERSION < "1.9.0"
+ RUNNABLE_EXTS = %w[com exe bat cmd]
+ RUNNABLE_PATTERN = %r!\.(#{RUNNABLE_EXTS.join('|')})\Z!i
+
+ define_module_function :kernel_system, &Kernel.method(:system)
+ define_module_function :kernel_backticks, &Kernel.method(:'`')
+
+ module_function
+
+ def repair_command(cmd)
+ "call " + (
+ if cmd =~ %r!\A\s*\".*?\"!
+ # already quoted
+ cmd
+ elsif match = cmd.match(%r!\A\s*(\S+)!)
+ if match[1] =~ %r!/!
+ # avoid x/y.bat interpretation as x with option /y
+ %Q!"#{match[1]}"! + match.post_match
+ else
+ # a shell command will fail if quoted
+ cmd
+ end
+ else
+ # empty or whitespace
+ cmd
+ end
+ )
+ end
+
+ def find_runnable(file)
+ if file =~ RUNNABLE_PATTERN
+ file
+ else
+ RUNNABLE_EXTS.each { |ext|
+ test = "#{file}.#{ext}"
+ return test if File.exist?(test)
+ }
+ nil
+ end
+ end
+
+ def system(cmd, *args)
+ repaired = (
+ if args.empty?
+ [repair_command(cmd)]
+ elsif runnable = find_runnable(cmd)
+ [File.expand_path(runnable), *args]
+ else
+ # non-existent file
+ [cmd, *args]
+ end
+ )
+ kernel_system(*repaired)
+ end
+
+ def backticks(cmd)
+ kernel_backticks(repair_command(cmd))
+ end
+
+ define_module_function :'`', &method(:backticks)
+ else
+ # Non-Windows or ruby-1.9+: same as Kernel versions
+ define_module_function :system, &Kernel.method(:system)
+ define_module_function :backticks, &Kernel.method(:'`')
+ define_module_function :'`', &Kernel.method(:'`')
+ end
+end
diff --git a/lib/rake/application.rb b/lib/rake/application.rb
new file mode 100644
index 0000000000..795b4685d4
--- /dev/null
+++ b/lib/rake/application.rb
@@ -0,0 +1,783 @@
+require 'shellwords'
+require 'optparse'
+
+require 'rake/task_manager'
+require 'rake/file_list'
+require 'rake/thread_pool'
+require 'rake/thread_history_display'
+require 'rake/trace_output'
+require 'rake/win32'
+
+module Rake
+
+ CommandLineOptionError = Class.new(StandardError)
+
+ ##
+ # Rake main application object. When invoking +rake+ from the
+ # command line, a Rake::Application object is created and run.
+
+ class Application
+ include TaskManager
+ include TraceOutput
+
+ # The name of the application (typically 'rake')
+ attr_reader :name
+
+ # The original directory where rake was invoked.
+ attr_reader :original_dir
+
+ # Name of the actual rakefile used.
+ attr_reader :rakefile
+
+ # Number of columns on the terminal
+ attr_accessor :terminal_columns
+
+ # List of the top level task names (task names from the command line).
+ attr_reader :top_level_tasks
+
+ DEFAULT_RAKEFILES = [
+ 'rakefile',
+ 'Rakefile',
+ 'rakefile.rb',
+ 'Rakefile.rb'
+ ].freeze
+
+ # Initialize a Rake::Application object.
+ def initialize
+ super
+ @name = 'rake'
+ @rakefiles = DEFAULT_RAKEFILES.dup
+ @rakefile = nil
+ @pending_imports = []
+ @imported = []
+ @loaders = {}
+ @default_loader = Rake::DefaultLoader.new
+ @original_dir = Dir.pwd
+ @top_level_tasks = []
+ add_loader('rb', DefaultLoader.new)
+ add_loader('rf', DefaultLoader.new)
+ add_loader('rake', DefaultLoader.new)
+ @tty_output = STDOUT.tty?
+ @terminal_columns = ENV['RAKE_COLUMNS'].to_i
+ end
+
+ # Run the Rake application. The run method performs the following
+ # three steps:
+ #
+ # * Initialize the command line options (+init+).
+ # * Define the tasks (+load_rakefile+).
+ # * Run the top level tasks (+top_level+).
+ #
+ # If you wish to build a custom rake command, you should call
+ # +init+ on your application. Then define any tasks. Finally,
+ # call +top_level+ to run your top level tasks.
+ def run
+ standard_exception_handling do
+ init
+ load_rakefile
+ top_level
+ end
+ end
+
+ # Initialize the command line parameters and app name.
+ def init(app_name='rake')
+ standard_exception_handling do
+ @name = app_name
+ handle_options
+ collect_command_line_tasks
+ end
+ end
+
+ # Find the rakefile and then load it and any pending imports.
+ def load_rakefile
+ standard_exception_handling do
+ raw_load_rakefile
+ end
+ end
+
+ # Run the top level tasks of a Rake application.
+ def top_level
+ run_with_threads do
+ if options.show_tasks
+ display_tasks_and_comments
+ elsif options.show_prereqs
+ display_prerequisites
+ else
+ top_level_tasks.each { |task_name| invoke_task(task_name) }
+ end
+ end
+ end
+
+ # Run the given block with the thread startup and shutdown.
+ def run_with_threads
+ thread_pool.gather_history if options.job_stats == :history
+
+ yield
+
+ thread_pool.join
+ if options.job_stats
+ stats = thread_pool.statistics
+ puts "Maximum active threads: #{stats[:max_active_threads]} + main"
+ puts "Total threads in play: #{stats[:total_threads_in_play]} + main"
+ end
+ ThreadHistoryDisplay.new(thread_pool.history).show if
+ options.job_stats == :history
+ end
+
+ # Add a loader to handle imported files ending in the extension
+ # +ext+.
+ def add_loader(ext, loader)
+ ext = ".#{ext}" unless ext =~ /^\./
+ @loaders[ext] = loader
+ end
+
+ # Application options from the command line
+ def options
+ @options ||= OpenStruct.new
+ end
+
+ # Return the thread pool used for multithreaded processing.
+ def thread_pool # :nodoc:
+ @thread_pool ||= ThreadPool.new(options.thread_pool_size || Rake.suggested_thread_count-1)
+ end
+
+ # internal ----------------------------------------------------------------
+
+ # Invokes a task with arguments that are extracted from +task_string+
+ def invoke_task(task_string) # :nodoc:
+ name, args = parse_task_string(task_string)
+ t = self[name]
+ t.invoke(*args)
+ end
+
+ def parse_task_string(string) # :nodoc:
+ /^([^\[]+)(?:\[(.*)\])$/ =~ string.to_s
+
+ name = $1
+ remaining_args = $2
+
+ return string, [] unless name
+ return name, [] if remaining_args.empty?
+
+ args = []
+
+ begin
+ /((?:[^\\,]|\\.)*?)\s*(?:,\s*(.*))?$/ =~ remaining_args
+
+ remaining_args = $2
+ args << $1.gsub(/\\(.)/, '\1')
+ end while remaining_args
+
+ return name, args
+ end
+
+ # Provide standard exception handling for the given block.
+ def standard_exception_handling # :nodoc:
+ yield
+ rescue SystemExit
+ # Exit silently with current status
+ raise
+ rescue OptionParser::InvalidOption => ex
+ $stderr.puts ex.message
+ exit(false)
+ rescue Exception => ex
+ # Exit with error message
+ display_error_message(ex)
+ exit_because_of_exception(ex)
+ end
+
+ # Exit the program because of an unhandle exception.
+ # (may be overridden by subclasses)
+ def exit_because_of_exception(ex) # :nodoc:
+ exit(false)
+ end
+
+ # Display the error message that caused the exception.
+ def display_error_message(ex) # :nodoc:
+ trace "#{name} aborted!"
+ display_exception_details(ex)
+ trace "Tasks: #{ex.chain}" if has_chain?(ex)
+ trace "(See full trace by running task with --trace)" unless
+ options.backtrace
+ end
+
+ def display_exception_details(ex) # :nodoc:
+ seen = Thread.current[:rake_display_exception_details_seen] ||= []
+ return if seen.include? ex
+ seen << ex
+
+ display_exception_message_details(ex)
+ display_exception_backtrace(ex)
+ display_exception_details(ex.cause) if has_cause?(ex)
+ end
+
+ def has_cause?(ex) # :nodoc:
+ ex.respond_to?(:cause) && ex.cause
+ end
+
+ def display_exception_message_details(ex) # :nodoc:
+ if ex.instance_of?(RuntimeError)
+ trace ex.message
+ else
+ trace "#{ex.class.name}: #{ex.message}"
+ end
+ end
+
+ def display_exception_backtrace(ex) # :nodoc:
+ if options.backtrace
+ trace ex.backtrace.join("\n")
+ else
+ trace Backtrace.collapse(ex.backtrace).join("\n")
+ end
+ end
+
+ # Warn about deprecated usage.
+ #
+ # Example:
+ # Rake.application.deprecate("import", "Rake.import", caller.first)
+ #
+ def deprecate(old_usage, new_usage, call_site) # :nodoc:
+ unless options.ignore_deprecate
+ $stderr.puts "WARNING: '#{old_usage}' is deprecated. " +
+ "Please use '#{new_usage}' instead.\n" +
+ " at #{call_site}"
+ end
+ end
+
+ # Does the exception have a task invocation chain?
+ def has_chain?(exception) # :nodoc:
+ exception.respond_to?(:chain) && exception.chain
+ end
+ private :has_chain?
+
+ # True if one of the files in RAKEFILES is in the current directory.
+ # If a match is found, it is copied into @rakefile.
+ def have_rakefile # :nodoc:
+ @rakefiles.each do |fn|
+ if File.exist?(fn)
+ others = FileList.glob(fn, File::FNM_CASEFOLD)
+ return others.size == 1 ? others.first : fn
+ elsif fn == ''
+ return fn
+ end
+ end
+ return nil
+ end
+
+ # True if we are outputting to TTY, false otherwise
+ def tty_output? # :nodoc:
+ @tty_output
+ end
+
+ # Override the detected TTY output state (mostly for testing)
+ def tty_output=(tty_output_state) # :nodoc:
+ @tty_output = tty_output_state
+ end
+
+ # We will truncate output if we are outputting to a TTY or if we've been
+ # given an explicit column width to honor
+ def truncate_output? # :nodoc:
+ tty_output? || @terminal_columns.nonzero?
+ end
+
+ # Display the tasks and comments.
+ def display_tasks_and_comments # :nodoc:
+ displayable_tasks = tasks.select { |t|
+ (options.show_all_tasks || t.comment) &&
+ t.name =~ options.show_task_pattern
+ }
+ case options.show_tasks
+ when :tasks
+ width = displayable_tasks.map { |t| t.name_with_args.length }.max || 10
+ if truncate_output?
+ max_column = terminal_width - name.size - width - 7
+ else
+ max_column = nil
+ end
+
+ displayable_tasks.each do |t|
+ printf("#{name} %-#{width}s # %s\n",
+ t.name_with_args,
+ max_column ? truncate(t.comment, max_column) : t.comment)
+ end
+ when :describe
+ displayable_tasks.each do |t|
+ puts "#{name} #{t.name_with_args}"
+ comment = t.full_comment || ""
+ comment.split("\n").each do |line|
+ puts " #{line}"
+ end
+ puts
+ end
+ when :lines
+ displayable_tasks.each do |t|
+ t.locations.each do |loc|
+ printf "#{name} %-30s %s\n", t.name_with_args, loc
+ end
+ end
+ else
+ fail "Unknown show task mode: '#{options.show_tasks}'"
+ end
+ end
+
+ def terminal_width # :nodoc:
+ if @terminal_columns.nonzero?
+ result = @terminal_columns
+ else
+ result = unix? ? dynamic_width : 80
+ end
+ (result < 10) ? 80 : result
+ rescue
+ 80
+ end
+
+ # Calculate the dynamic width of the
+ def dynamic_width # :nodoc:
+ @dynamic_width ||= (dynamic_width_stty.nonzero? || dynamic_width_tput)
+ end
+
+ def dynamic_width_stty # :nodoc:
+ %x{stty size 2>/dev/null}.split[1].to_i
+ end
+
+ def dynamic_width_tput # :nodoc:
+ %x{tput cols 2>/dev/null}.to_i
+ end
+
+ def unix? # :nodoc:
+ RbConfig::CONFIG['host_os'] =~
+ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
+ end
+
+ def windows? # :nodoc:
+ Win32.windows?
+ end
+
+ def truncate(string, width) # :nodoc:
+ if string.nil?
+ ""
+ elsif string.length <= width
+ string
+ else
+ (string[0, width - 3] || "") + "..."
+ end
+ end
+
+ # Display the tasks and prerequisites
+ def display_prerequisites # :nodoc:
+ tasks.each do |t|
+ puts "#{name} #{t.name}"
+ t.prerequisites.each { |pre| puts " #{pre}" }
+ end
+ end
+
+ def trace(*strings) # :nodoc:
+ options.trace_output ||= $stderr
+ trace_on(options.trace_output, *strings)
+ end
+
+ def sort_options(options) # :nodoc:
+ options.sort_by { |opt|
+ opt.select { |o| o =~ /^-/ }.map { |o| o.downcase }.sort.reverse
+ }
+ end
+ private :sort_options
+
+ # A list of all the standard options used in rake, suitable for
+ # passing to OptionParser.
+ def standard_rake_options # :nodoc:
+ sort_options(
+ [
+ ['--all', '-A',
+ "Show all tasks, even uncommented ones (in combination with -T or -D)",
+ lambda { |value|
+ options.show_all_tasks = value
+ }
+ ],
+ ['--backtrace=[OUT]',
+ "Enable full backtrace. OUT can be stderr (default) or stdout.",
+ lambda { |value|
+ options.backtrace = true
+ select_trace_output(options, 'backtrace', value)
+ }
+ ],
+ ['--build-all', '-B',
+ "Build all prerequisites, including those which are up-to-date.",
+ lambda { |value|
+ options.build_all = true
+ }
+ ],
+ ['--comments',
+ "Show commented tasks only",
+ lambda { |value|
+ options.show_all_tasks = !value
+ }
+ ],
+ ['--describe', '-D [PATTERN]',
+ "Describe the tasks (matching optional PATTERN), then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :describe, value)
+ }
+ ],
+ ['--dry-run', '-n',
+ "Do a dry run without executing actions.",
+ lambda { |value|
+ Rake.verbose(true)
+ Rake.nowrite(true)
+ options.dryrun = true
+ options.trace = true
+ }
+ ],
+ ['--execute', '-e CODE',
+ "Execute some Ruby code and exit.",
+ lambda { |value|
+ eval(value)
+ exit
+ }
+ ],
+ ['--execute-print', '-p CODE',
+ "Execute some Ruby code, print the result, then exit.",
+ lambda { |value|
+ puts eval(value)
+ exit
+ }
+ ],
+ ['--execute-continue', '-E CODE',
+ "Execute some Ruby code, " +
+ "then continue with normal task processing.",
+ lambda { |value| eval(value) }
+ ],
+ ['--jobs', '-j [NUMBER]',
+ "Specifies the maximum number of tasks to execute in parallel. " +
+ "(default is number of CPU cores + 4)",
+ lambda { |value|
+ if value.nil? || value == ''
+ value = FIXNUM_MAX
+ elsif value =~ /^\d+$/
+ value = value.to_i
+ else
+ value = Rake.suggested_thread_count
+ end
+ value = 1 if value < 1
+ options.thread_pool_size = value - 1
+ }
+ ],
+ ['--job-stats [LEVEL]',
+ "Display job statistics. " +
+ "LEVEL=history displays a complete job list",
+ lambda { |value|
+ if value =~ /^history/i
+ options.job_stats = :history
+ else
+ options.job_stats = true
+ end
+ }
+ ],
+ ['--libdir', '-I LIBDIR',
+ "Include LIBDIR in the search path for required modules.",
+ lambda { |value| $:.push(value) }
+ ],
+ ['--multitask', '-m',
+ "Treat all tasks as multitasks.",
+ lambda { |value| options.always_multitask = true }
+ ],
+ ['--no-search', '--nosearch',
+ '-N', "Do not search parent directories for the Rakefile.",
+ lambda { |value| options.nosearch = true }
+ ],
+ ['--prereqs', '-P',
+ "Display the tasks and dependencies, then exit.",
+ lambda { |value| options.show_prereqs = true }
+ ],
+ ['--quiet', '-q',
+ "Do not log messages to standard output.",
+ lambda { |value| Rake.verbose(false) }
+ ],
+ ['--rakefile', '-f [FILENAME]',
+ "Use FILENAME as the rakefile to search for.",
+ lambda { |value|
+ value ||= ''
+ @rakefiles.clear
+ @rakefiles << value
+ }
+ ],
+ ['--rakelibdir', '--rakelib', '-R RAKELIBDIR',
+ "Auto-import any .rake files in RAKELIBDIR. " +
+ "(default is 'rakelib')",
+ lambda { |value|
+ options.rakelib = value.split(File::PATH_SEPARATOR)
+ }
+ ],
+ ['--require', '-r MODULE',
+ "Require MODULE before executing rakefile.",
+ lambda { |value|
+ begin
+ require value
+ rescue LoadError => ex
+ begin
+ rake_require value
+ rescue LoadError
+ raise ex
+ end
+ end
+ }
+ ],
+ ['--rules',
+ "Trace the rules resolution.",
+ lambda { |value| options.trace_rules = true }
+ ],
+ ['--silent', '-s',
+ "Like --quiet, but also suppresses the " +
+ "'in directory' announcement.",
+ lambda { |value|
+ Rake.verbose(false)
+ options.silent = true
+ }
+ ],
+ ['--suppress-backtrace PATTERN',
+ "Suppress backtrace lines matching regexp PATTERN. " +
+ "Ignored if --trace is on.",
+ lambda { |value|
+ options.suppress_backtrace_pattern = Regexp.new(value)
+ }
+ ],
+ ['--system', '-g',
+ "Using system wide (global) rakefiles " +
+ "(usually '~/.rake/*.rake').",
+ lambda { |value| options.load_system = true }
+ ],
+ ['--no-system', '--nosystem', '-G',
+ "Use standard project Rakefile search paths, " +
+ "ignore system wide rakefiles.",
+ lambda { |value| options.ignore_system = true }
+ ],
+ ['--tasks', '-T [PATTERN]',
+ "Display the tasks (matching optional PATTERN) " +
+ "with descriptions, then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :tasks, value)
+ }
+ ],
+ ['--trace=[OUT]', '-t',
+ "Turn on invoke/execute tracing, enable full backtrace. " +
+ "OUT can be stderr (default) or stdout.",
+ lambda { |value|
+ options.trace = true
+ options.backtrace = true
+ select_trace_output(options, 'trace', value)
+ Rake.verbose(true)
+ }
+ ],
+ ['--verbose', '-v',
+ "Log message to standard output.",
+ lambda { |value| Rake.verbose(true) }
+ ],
+ ['--version', '-V',
+ "Display the program version.",
+ lambda { |value|
+ puts "rake, version #{RAKEVERSION}"
+ exit
+ }
+ ],
+ ['--where', '-W [PATTERN]',
+ "Describe the tasks (matching optional PATTERN), then exit.",
+ lambda { |value|
+ select_tasks_to_show(options, :lines, value)
+ options.show_all_tasks = true
+ }
+ ],
+ ['--no-deprecation-warnings', '-X',
+ "Disable the deprecation warnings.",
+ lambda { |value|
+ options.ignore_deprecate = true
+ }
+ ],
+ ])
+ end
+
+ def select_tasks_to_show(options, show_tasks, value) # :nodoc:
+ options.show_tasks = show_tasks
+ options.show_task_pattern = Regexp.new(value || '')
+ Rake::TaskManager.record_task_metadata = true
+ end
+ private :select_tasks_to_show
+
+ def select_trace_output(options, trace_option, value) # :nodoc:
+ value = value.strip unless value.nil?
+ case value
+ when 'stdout'
+ options.trace_output = $stdout
+ when 'stderr', nil
+ options.trace_output = $stderr
+ else
+ fail CommandLineOptionError,
+ "Unrecognized --#{trace_option} option '#{value}'"
+ end
+ end
+ private :select_trace_output
+
+ # Read and handle the command line options.
+ def handle_options # :nodoc:
+ options.rakelib = ['rakelib']
+ options.trace_output = $stderr
+
+ OptionParser.new do |opts|
+ opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..."
+ opts.separator ""
+ opts.separator "Options are ..."
+
+ opts.on_tail("-h", "--help", "-H", "Display this help message.") do
+ puts opts
+ exit
+ end
+
+ standard_rake_options.each { |args| opts.on(*args) }
+ opts.environment('RAKEOPT')
+ end.parse!
+ end
+
+ # Similar to the regular Ruby +require+ command, but will check
+ # for *.rake files in addition to *.rb files.
+ def rake_require(file_name, paths=$LOAD_PATH, loaded=$") # :nodoc:
+ fn = file_name + ".rake"
+ return false if loaded.include?(fn)
+ paths.each do |path|
+ full_path = File.join(path, fn)
+ if File.exist?(full_path)
+ Rake.load_rakefile(full_path)
+ loaded << fn
+ return true
+ end
+ end
+ fail LoadError, "Can't find #{file_name}"
+ end
+
+ def find_rakefile_location # :nodoc:
+ here = Dir.pwd
+ until (fn = have_rakefile)
+ Dir.chdir("..")
+ return nil if Dir.pwd == here || options.nosearch
+ here = Dir.pwd
+ end
+ [fn, here]
+ ensure
+ Dir.chdir(Rake.original_dir)
+ end
+
+ def print_rakefile_directory(location) # :nodoc:
+ $stderr.puts "(in #{Dir.pwd})" unless
+ options.silent or original_dir == location
+ end
+
+ def raw_load_rakefile # :nodoc:
+ rakefile, location = find_rakefile_location
+ if (! options.ignore_system) &&
+ (options.load_system || rakefile.nil?) &&
+ system_dir && File.directory?(system_dir)
+ print_rakefile_directory(location)
+ glob("#{system_dir}/*.rake") do |name|
+ add_import name
+ end
+ else
+ fail "No Rakefile found (looking for: #{@rakefiles.join(', ')})" if
+ rakefile.nil?
+ @rakefile = rakefile
+ Dir.chdir(location)
+ print_rakefile_directory(location)
+ Rake.load_rakefile(File.expand_path(@rakefile)) if
+ @rakefile && @rakefile != ''
+ options.rakelib.each do |rlib|
+ glob("#{rlib}/*.rake") do |name|
+ add_import name
+ end
+ end
+ end
+ load_imports
+ end
+
+ def glob(path, &block) # :nodoc:
+ FileList.glob(path.gsub("\\", '/')).each(&block)
+ end
+ private :glob
+
+ # The directory path containing the system wide rakefiles.
+ def system_dir # :nodoc:
+ @system_dir ||=
+ begin
+ if ENV['RAKE_SYSTEM']
+ ENV['RAKE_SYSTEM']
+ else
+ standard_system_dir
+ end
+ end
+ end
+
+ # The standard directory containing system wide rake files.
+ if Win32.windows?
+ def standard_system_dir #:nodoc:
+ Win32.win32_system_dir
+ end
+ else
+ def standard_system_dir #:nodoc:
+ File.join(File.expand_path('~'), '.rake')
+ end
+ end
+ private :standard_system_dir
+
+ # Collect the list of tasks on the command line. If no tasks are
+ # given, return a list containing only the default task.
+ # Environmental assignments are processed at this time as well.
+ def collect_command_line_tasks # :nodoc:
+ @top_level_tasks = []
+ ARGV.each do |arg|
+ if arg =~ /^(\w+)=(.*)$/m
+ ENV[$1] = $2
+ else
+ @top_level_tasks << arg unless arg =~ /^-/
+ end
+ end
+ @top_level_tasks.push(default_task_name) if @top_level_tasks.empty?
+ end
+
+ # Default task name ("default").
+ # (May be overridden by subclasses)
+ def default_task_name # :nodoc:
+ "default"
+ end
+
+ # Add a file to the list of files to be imported.
+ def add_import(fn) # :nodoc:
+ @pending_imports << fn
+ end
+
+ # Load the pending list of imported files.
+ def load_imports # :nodoc:
+ while fn = @pending_imports.shift
+ next if @imported.member?(fn)
+ fn_task = lookup(fn) and fn_task.invoke
+ ext = File.extname(fn)
+ loader = @loaders[ext] || @default_loader
+ loader.load(fn)
+ if fn_task = lookup(fn) and fn_task.needed?
+ fn_task.reenable
+ fn_task.invoke
+ loader.load(fn)
+ end
+ @imported << fn
+ end
+ end
+
+ def rakefile_location(backtrace=caller) # :nodoc:
+ backtrace.map { |t| t[/([^:]+):/, 1] }
+
+ re = /^#{@rakefile}$/
+ re = /#{re.source}/i if windows?
+
+ backtrace.find { |str| str =~ re } || ''
+ end
+
+ private
+ FIXNUM_MAX = (2**(0.size * 8 - 2) - 1) # :nodoc:
+
+ end
+end
diff --git a/lib/rake/backtrace.rb b/lib/rake/backtrace.rb
new file mode 100644
index 0000000000..dc18773436
--- /dev/null
+++ b/lib/rake/backtrace.rb
@@ -0,0 +1,23 @@
+module Rake
+ module Backtrace # :nodoc: all
+ SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/)
+ SYS_PATHS = RbConfig::CONFIG.values_at(*SYS_KEYS).uniq +
+ [ File.join(File.dirname(__FILE__), "..") ]
+
+ SUPPRESSED_PATHS = SYS_PATHS.
+ map { |s| s.gsub("\\", "/") }.
+ map { |f| File.expand_path(f) }.
+ reject { |s| s.nil? || s =~ /^ *$/ }
+ SUPPRESSED_PATHS_RE = SUPPRESSED_PATHS.map { |f| Regexp.quote(f) }.join("|")
+ SUPPRESSED_PATHS_RE << "|^org\\/jruby\\/\\w+\\.java" if
+ Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
+
+ SUPPRESS_PATTERN = %r!(\A(#{SUPPRESSED_PATHS_RE})|bin/rake:\d+)!i
+
+ def self.collapse(backtrace)
+ pattern = Rake.application.options.suppress_backtrace_pattern ||
+ SUPPRESS_PATTERN
+ backtrace.reject { |elem| elem =~ pattern }
+ end
+ end
+end
diff --git a/lib/rake/clean.rb b/lib/rake/clean.rb
new file mode 100644
index 0000000000..a49cd44167
--- /dev/null
+++ b/lib/rake/clean.rb
@@ -0,0 +1,76 @@
+# The 'rake/clean' file defines two file lists (CLEAN and CLOBBER) and
+# two rake tasks (:clean and :clobber).
+#
+# [:clean] Clean up the project by deleting scratch files and backup
+# files. Add files to the CLEAN file list to have the :clean
+# target handle them.
+#
+# [:clobber] Clobber all generated and non-source files in a project.
+# The task depends on :clean, so all the clean files will
+# be deleted as well as files in the CLOBBER file list.
+# The intent of this task is to return a project to its
+# pristine, just unpacked state.
+
+require 'rake'
+
+# :stopdoc:
+
+module Rake
+ module Cleaner
+ extend FileUtils
+
+ module_function
+
+ def cleanup_files(file_names)
+ file_names.each do |file_name|
+ cleanup(file_name)
+ end
+ end
+
+ def cleanup(file_name, opts={})
+ begin
+ rm_r file_name, opts
+ rescue StandardError => ex
+ puts "Failed to remove #{file_name}: #{ex}" unless file_already_gone?(file_name)
+ end
+ end
+
+ def file_already_gone?(file_name)
+ return false if File.exist?(file_name)
+
+ path = file_name
+ prev = nil
+
+ while path = File.dirname(path)
+ return false if cant_be_deleted?(path)
+ break if [prev, "."].include?(path)
+ prev = path
+ end
+ true
+ end
+ private_class_method :file_already_gone?
+
+ def cant_be_deleted?(path_name)
+ File.exist?(path_name) &&
+ (!File.readable?(path_name) || !File.executable?(path_name))
+ end
+ private_class_method :cant_be_deleted?
+ end
+end
+
+CLEAN = ::Rake::FileList["**/*~", "**/*.bak", "**/core"]
+CLEAN.clear_exclude.exclude { |fn|
+ fn.pathmap("%f").downcase == 'core' && File.directory?(fn)
+}
+
+desc "Remove any temporary products."
+task :clean do
+ Rake::Cleaner.cleanup_files(CLEAN)
+end
+
+CLOBBER = ::Rake::FileList.new
+
+desc "Remove any generated file."
+task :clobber => [:clean] do
+ Rake::Cleaner.cleanup_files(CLOBBER)
+end
diff --git a/lib/rake/cloneable.rb b/lib/rake/cloneable.rb
new file mode 100644
index 0000000000..d53645f2f3
--- /dev/null
+++ b/lib/rake/cloneable.rb
@@ -0,0 +1,16 @@
+module Rake
+ ##
+ # Mixin for creating easily cloned objects.
+
+ module Cloneable # :nodoc:
+ # The hook that is invoked by 'clone' and 'dup' methods.
+ def initialize_copy(source)
+ super
+ source.instance_variables.each do |var|
+ src_value = source.instance_variable_get(var)
+ value = src_value.clone rescue src_value
+ instance_variable_set(var, value)
+ end
+ end
+ end
+end
diff --git a/spec/mspec/spec/commands/fixtures/level2/three_spec.rb b/lib/rake/contrib/.document
index 8b13789179..8b13789179 100644
--- a/spec/mspec/spec/commands/fixtures/level2/three_spec.rb
+++ b/lib/rake/contrib/.document
diff --git a/lib/rake/contrib/compositepublisher.rb b/lib/rake/contrib/compositepublisher.rb
new file mode 100644
index 0000000000..69952a0808
--- /dev/null
+++ b/lib/rake/contrib/compositepublisher.rb
@@ -0,0 +1,21 @@
+module Rake
+
+ # Manage several publishers as a single entity.
+ class CompositePublisher
+ def initialize
+ @publishers = []
+ end
+
+ # Add a publisher to the composite.
+ def add(pub)
+ @publishers << pub
+ end
+
+ # Upload all the individual publishers.
+ def upload
+ @publishers.each { |p| p.upload }
+ end
+ end
+
+end
+
diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb
new file mode 100644
index 0000000000..b178523bc6
--- /dev/null
+++ b/lib/rake/contrib/ftptools.rb
@@ -0,0 +1,137 @@
+# = Tools for FTP uploading.
+#
+# This file is still under development and is not released for general
+# use.
+
+require 'date'
+require 'net/ftp'
+require 'rake/file_list'
+
+module Rake # :nodoc:
+
+ class FtpFile # :nodoc: all
+ attr_reader :name, :size, :owner, :group, :time
+
+ def self.date
+ @date_class ||= Date
+ end
+
+ def self.time
+ @time_class ||= Time
+ end
+
+ def initialize(path, entry)
+ @path = path
+ @mode, _, @owner, @group, size, d1, d2, d3, @name = entry.split(' ')
+ @size = size.to_i
+ @time = determine_time(d1, d2, d3)
+ end
+
+ def path
+ File.join(@path, @name)
+ end
+
+ def directory?
+ @mode[0] == ?d
+ end
+
+ def mode
+ parse_mode(@mode)
+ end
+
+ def symlink?
+ @mode[0] == ?l
+ end
+
+ private # --------------------------------------------------------
+
+ def parse_mode(m)
+ result = 0
+ (1..9).each do |i|
+ result = 2 * result + ((m[i] == ?-) ? 0 : 1)
+ end
+ result
+ end
+
+ def determine_time(d1, d2, d3)
+ now = self.class.time.now
+ if /:/ !~ d3
+ result = Time.parse("#{d1} #{d2} #{d3}")
+ else
+ result = Time.parse("#{d1} #{d2} #{now.year} #{d3}")
+ result = Time.parse("#{d1} #{d2} #{now.year - 1} #{d3}") if
+ result > now
+ end
+ result
+ end
+ end
+
+ ##
+ # Manage the uploading of files to an FTP account.
+ class FtpUploader # :nodoc:
+
+ # Log uploads to standard output when true.
+ attr_accessor :verbose
+
+ class << FtpUploader
+ # Create an uploader and pass it to the given block as +up+.
+ # When the block is complete, close the uploader.
+ def connect(path, host, account, password)
+ up = self.new(path, host, account, password)
+ begin
+ yield(up)
+ ensure
+ up.close
+ end
+ end
+ end
+
+ # Create an FTP uploader targeting the directory +path+ on +host+
+ # using the given account and password. +path+ will be the root
+ # path of the uploader.
+ def initialize(path, host, account, password)
+ @created = Hash.new
+ @path = path
+ @ftp = Net::FTP.new(host, account, password)
+ makedirs(@path)
+ @ftp.chdir(@path)
+ end
+
+ # Create the directory +path+ in the uploader root path.
+ def makedirs(path)
+ route = []
+ File.split(path).each do |dir|
+ route << dir
+ current_dir = File.join(route)
+ if @created[current_dir].nil?
+ @created[current_dir] = true
+ $stderr.puts "Creating Directory #{current_dir}" if @verbose
+ @ftp.mkdir(current_dir) rescue nil
+ end
+ end
+ end
+
+ # Upload all files matching +wildcard+ to the uploader's root
+ # path.
+ def upload_files(wildcard)
+ FileList.glob(wildcard).each do |fn|
+ upload(fn)
+ end
+ end
+
+ # Close the uploader.
+ def close
+ @ftp.close
+ end
+
+ private # --------------------------------------------------------
+
+ # Upload a single file to the uploader's root path.
+ def upload(file)
+ $stderr.puts "Uploading #{file}" if @verbose
+ dir = File.dirname(file)
+ makedirs(dir)
+ @ftp.putbinaryfile(file, file) unless File.directory?(file)
+ end
+ end
+end
diff --git a/lib/rake/contrib/publisher.rb b/lib/rake/contrib/publisher.rb
new file mode 100644
index 0000000000..f4ee1abf86
--- /dev/null
+++ b/lib/rake/contrib/publisher.rb
@@ -0,0 +1,81 @@
+# Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com)
+# All rights reserved.
+
+# :stopdoc:
+
+# Configuration information about an upload host system.
+# name :: Name of host system.
+# webdir :: Base directory for the web information for the
+# application. The application name (APP) is appended to
+# this directory before using.
+# pkgdir :: Directory on the host system where packages can be
+# placed.
+HostInfo = Struct.new(:name, :webdir, :pkgdir)
+
+# :startdoc:
+
+# TODO: Move to contrib/sshpublisher
+#--
+# Manage several publishers as a single entity.
+class CompositePublisher # :nodoc:
+ def initialize
+ @publishers = []
+ end
+
+ # Add a publisher to the composite.
+ def add(pub)
+ @publishers << pub
+ end
+
+ # Upload all the individual publishers.
+ def upload
+ @publishers.each { |p| p.upload }
+ end
+end
+
+# TODO: Remove in Rake 11, duplicated
+#--
+# Publish an entire directory to an existing remote directory using
+# SSH.
+class SshDirPublisher # :nodoc: all
+ def initialize(host, remote_dir, local_dir)
+ @host = host
+ @remote_dir = remote_dir
+ @local_dir = local_dir
+ end
+
+ def upload
+ run %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
+ end
+end
+
+# TODO: Remove in Rake 11, duplicated
+#--
+# Publish an entire directory to a fresh remote directory using SSH.
+class SshFreshDirPublisher < SshDirPublisher # :nodoc: all
+ def upload
+ run %{ssh #{@host} rm -rf #{@remote_dir}} rescue nil
+ run %{ssh #{@host} mkdir #{@remote_dir}}
+ super
+ end
+end
+
+# TODO: Remove in Rake 11, duplicated
+#--
+# Publish a list of files to an existing remote directory.
+class SshFilePublisher # :nodoc: all
+ # Create a publisher using the give host information.
+ def initialize(host, remote_dir, local_dir, *files)
+ @host = host
+ @remote_dir = remote_dir
+ @local_dir = local_dir
+ @files = files
+ end
+
+ # Upload the local directory to the remote directory.
+ def upload
+ @files.each do |fn|
+ run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
+ end
+ end
+end
diff --git a/lib/rake/contrib/rubyforgepublisher.rb b/lib/rake/contrib/rubyforgepublisher.rb
new file mode 100644
index 0000000000..00889ad7b9
--- /dev/null
+++ b/lib/rake/contrib/rubyforgepublisher.rb
@@ -0,0 +1,18 @@
+# TODO: Remove in Rake 11
+
+require 'rake/contrib/sshpublisher'
+
+module Rake
+
+ class RubyForgePublisher < SshDirPublisher # :nodoc: all
+ attr_reader :project, :proj_id, :user
+
+ def initialize(projname, user)
+ super(
+ "#{user}@rubyforge.org",
+ "/var/www/gforge-projects/#{projname}",
+ "html")
+ end
+ end
+
+end
diff --git a/lib/rake/contrib/sshpublisher.rb b/lib/rake/contrib/sshpublisher.rb
new file mode 100644
index 0000000000..64f577017c
--- /dev/null
+++ b/lib/rake/contrib/sshpublisher.rb
@@ -0,0 +1,61 @@
+require 'rake/dsl_definition'
+require 'rake/contrib/compositepublisher'
+
+module Rake
+
+ # Publish an entire directory to an existing remote directory using
+ # SSH.
+ class SshDirPublisher
+ include Rake::DSL
+
+ # Creates an SSH publisher which will scp all files in +local_dir+ to
+ # +remote_dir+ on +host+
+
+ def initialize(host, remote_dir, local_dir)
+ @host = host
+ @remote_dir = remote_dir
+ @local_dir = local_dir
+ end
+
+ # Uploads the files
+
+ def upload
+ sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}"
+ end
+ end
+
+ # Publish an entire directory to a fresh remote directory using SSH.
+ class SshFreshDirPublisher < SshDirPublisher
+
+ # Uploads the files after removing the existing remote directory.
+
+ def upload
+ sh "ssh", @host, "rm", "-rf", @remote_dir rescue nil
+ sh "ssh", @host, "mkdir", @remote_dir
+ super
+ end
+ end
+
+ # Publish a list of files to an existing remote directory.
+ class SshFilePublisher
+ include Rake::DSL
+
+ # Creates an SSH publisher which will scp all +files+ in +local_dir+ to
+ # +remote_dir+ on +host+.
+
+ def initialize(host, remote_dir, local_dir, *files)
+ @host = host
+ @remote_dir = remote_dir
+ @local_dir = local_dir
+ @files = files
+ end
+
+ # Uploads the files
+
+ def upload
+ @files.each do |fn|
+ sh "scp", "-q", "#{@local_dir}/#{fn}", "#{@host}:#{@remote_dir}"
+ end
+ end
+ end
+end
diff --git a/lib/rake/contrib/sys.rb b/lib/rake/contrib/sys.rb
new file mode 100644
index 0000000000..8d4c735434
--- /dev/null
+++ b/lib/rake/contrib/sys.rb
@@ -0,0 +1,4 @@
+# TODO: Remove in Rake 11
+
+fail "ERROR: 'rake/contrib/sys' is obsolete and no longer supported. " +
+ "Use 'FileUtils' instead."
diff --git a/lib/rake/cpu_counter.rb b/lib/rake/cpu_counter.rb
new file mode 100644
index 0000000000..d7c92a6cbe
--- /dev/null
+++ b/lib/rake/cpu_counter.rb
@@ -0,0 +1,110 @@
+require 'rbconfig'
+
+# TODO: replace with IO.popen using array-style arguments in Rake 11
+require 'open3'
+
+module Rake
+
+ # Based on a script at:
+ # http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed
+ class CpuCounter # :nodoc: all
+ def self.count
+ new.count_with_default
+ end
+
+ def count_with_default(default=4)
+ count || default
+ rescue StandardError
+ default
+ end
+
+ def count
+ if defined?(Java::Java)
+ count_via_java_runtime
+ else
+ case RbConfig::CONFIG['host_os']
+ when /darwin9/
+ count_via_hwprefs_cpu_count
+ when /darwin/
+ count_via_hwprefs_thread_count || count_via_sysctl
+ when /linux/
+ count_via_cpuinfo
+ when /bsd/
+ count_via_sysctl
+ when /mswin|mingw/
+ count_via_win32
+ else
+ # Try everything
+ count_via_win32 ||
+ count_via_sysctl ||
+ count_via_hwprefs_thread_count ||
+ count_via_hwprefs_cpu_count ||
+ count_via_cpuinfo
+ end
+ end
+ end
+
+ def count_via_java_runtime
+ Java::Java.lang.Runtime.getRuntime.availableProcessors
+ rescue StandardError
+ nil
+ end
+
+ def count_via_win32
+ require 'win32ole'
+ wmi = WIN32OLE.connect("winmgmts://")
+ cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this
+ cpu.to_enum.first.NumberOfCores
+ rescue StandardError, LoadError
+ nil
+ end
+
+ def count_via_cpuinfo
+ open('/proc/cpuinfo') { |f| f.readlines }.grep(/processor/).size
+ rescue StandardError
+ nil
+ end
+
+ def count_via_hwprefs_thread_count
+ run 'hwprefs', 'thread_count'
+ end
+
+ def count_via_hwprefs_cpu_count
+ run 'hwprefs', 'cpu_count'
+ end
+
+ def count_via_sysctl
+ run 'sysctl', '-n', 'hw.ncpu'
+ end
+
+ def run(command, *args)
+ cmd = resolve_command(command)
+ if cmd
+ Open3.popen3 cmd, *args do |inn, out, err,|
+ inn.close
+ err.read
+ out.read.to_i
+ end
+ else
+ nil
+ end
+ end
+
+ def resolve_command(command)
+ look_for_command("/usr/sbin", command) ||
+ look_for_command("/sbin", command) ||
+ in_path_command(command)
+ end
+
+ def look_for_command(dir, command)
+ path = File.join(dir, command)
+ File.exist?(path) ? path : nil
+ end
+
+ def in_path_command(command)
+ Open3.popen3 'which', command do |_, out,|
+ out.eof? ? nil : command
+ end
+ end
+ end
+end
diff --git a/lib/rake/default_loader.rb b/lib/rake/default_loader.rb
new file mode 100644
index 0000000000..6154408f44
--- /dev/null
+++ b/lib/rake/default_loader.rb
@@ -0,0 +1,14 @@
+module Rake
+
+ # Default Rakefile loader used by +import+.
+ class DefaultLoader
+
+ ##
+ # Loads a rakefile into the current application from +fn+
+
+ def load(fn)
+ Rake.load_rakefile(File.expand_path(fn))
+ end
+ end
+
+end
diff --git a/lib/rake/dsl_definition.rb b/lib/rake/dsl_definition.rb
new file mode 100644
index 0000000000..b521b7dc5c
--- /dev/null
+++ b/lib/rake/dsl_definition.rb
@@ -0,0 +1,199 @@
+# Rake DSL functions.
+require 'rake/file_utils_ext'
+
+module Rake
+
+ ##
+ # DSL is a module that provides #task, #desc, #namespace, etc. Use this
+ # when you'd like to use rake outside the top level scope.
+ #
+ # For a Rakefile you run from the comamnd line this module is automatically
+ # included.
+
+ module DSL
+
+ #--
+ # Include the FileUtils file manipulation functions in the top
+ # level module, but mark them private so that they don't
+ # unintentionally define methods on other objects.
+ #++
+
+ include FileUtilsExt
+ private(*FileUtils.instance_methods(false))
+ private(*FileUtilsExt.instance_methods(false))
+
+ private
+
+ # :call-seq:
+ # task task_name
+ # task task_name: dependencies
+ # task task_name, arguments => dependencies
+ # task task_name, argument[, argument ...], :needs: dependencies
+ #
+ # Declare a basic task. The +task_name+ is always the first argument. If
+ # the task name contains a ":" it is defined in that namespace.
+ #
+ # The +dependencies+ may be a single task name or an Array of task names.
+ # The +argument+ (a single name) or +arguments+ (an Array of names) define
+ # the arguments provided to the task.
+ #
+ # The task, argument and dependency names may be either symbols or
+ # strings.
+ #
+ # A task with a single dependency:
+ #
+ # task clobber: %w[clean] do
+ # rm_rf "html"
+ # end
+ #
+ # A task with an argument and a dependency:
+ #
+ # task :package, [:version] => :test do |t, args|
+ # # ...
+ # end
+ #
+ # To invoke this task from the command line:
+ #
+ # $ rake package[1.2.3]
+ #
+ # Alternate definition:
+ #
+ # task :package, :version, needs: :test do |t, args|
+ # # ...
+ # end
+ #
+ def task(*args, &block) # :doc:
+ Rake::Task.define_task(*args, &block)
+ end
+
+ # Declare a file task.
+ #
+ # Example:
+ # file "config.cfg" => ["config.template"] do
+ # open("config.cfg", "w") do |outfile|
+ # open("config.template") do |infile|
+ # while line = infile.gets
+ # outfile.puts line
+ # end
+ # end
+ # end
+ # end
+ #
+ def file(*args, &block) # :doc:
+ Rake::FileTask.define_task(*args, &block)
+ end
+
+ # Declare a file creation task.
+ # (Mainly used for the directory command).
+ def file_create(*args, &block)
+ Rake::FileCreationTask.define_task(*args, &block)
+ end
+
+ # Declare a set of files tasks to create the given directories on
+ # demand.
+ #
+ # Example:
+ # directory "testdata/doc"
+ #
+ def directory(*args, &block) # :doc:
+ result = file_create(*args, &block)
+ dir, _ = *Rake.application.resolve_args(args)
+ dir = Rake.from_pathname(dir)
+ Rake.each_dir_parent(dir) do |d|
+ file_create d do |t|
+ mkdir_p t.name unless File.exist?(t.name)
+ end
+ end
+ result
+ end
+
+ # Declare a task that performs its prerequisites in
+ # parallel. Multitasks does *not* guarantee that its prerequisites
+ # will execute in any given order (which is obvious when you think
+ # about it)
+ #
+ # Example:
+ # multitask deploy: %w[deploy_gem deploy_rdoc]
+ #
+ def multitask(*args, &block) # :doc:
+ Rake::MultiTask.define_task(*args, &block)
+ end
+
+ # Create a new rake namespace and use it for evaluating the given
+ # block. Returns a NameSpace object that can be used to lookup
+ # tasks defined in the namespace.
+ #
+ # Example:
+ #
+ # ns = namespace "nested" do
+ # # the "nested:run" task
+ # task :run
+ # end
+ # task_run = ns[:run] # find :run in the given namespace.
+ #
+ # Tasks can also be defined in a namespace by using a ":" in the task
+ # name:
+ #
+ # task "nested:test" do
+ # # ...
+ # end
+ #
+ def namespace(name=nil, &block) # :doc:
+ name = name.to_s if name.kind_of?(Symbol)
+ name = name.to_str if name.respond_to?(:to_str)
+ unless name.kind_of?(String) || name.nil?
+ raise ArgumentError, "Expected a String or Symbol for a namespace name"
+ end
+ Rake.application.in_namespace(name, &block)
+ end
+
+ # Declare a rule for auto-tasks.
+ #
+ # Example:
+ # rule '.o' => '.c' do |t|
+ # sh 'cc', '-o', t.name, t.source
+ # end
+ #
+ def rule(*args, &block) # :doc:
+ Rake::Task.create_rule(*args, &block)
+ end
+
+ # Describes the next rake task. Duplicate descriptions are discarded.
+ #
+ # Example:
+ # desc "Run the Unit Tests"
+ # task test: [:build]
+ # # ... run tests
+ # end
+ #
+ def desc(description) # :doc:
+ Rake.application.last_description = description
+ end
+
+ # Import the partial Rakefiles +fn+. Imported files are loaded
+ # _after_ the current file is completely loaded. This allows the
+ # import statement to appear anywhere in the importing file, and yet
+ # allowing the imported files to depend on objects defined in the
+ # importing file.
+ #
+ # A common use of the import statement is to include files
+ # containing dependency declarations.
+ #
+ # See also the --rakelibdir command line option.
+ #
+ # Example:
+ # import ".depend", "my_rules"
+ #
+ def import(*fns) # :doc:
+ fns.each do |fn|
+ Rake.application.add_import(fn)
+ end
+ end
+ end
+ extend FileUtilsExt
+end
+
+# Extend the main object with the DSL commands. This allows top-level
+# calls to task, etc. to work from a Rakefile without polluting the
+# object inheritance tree.
+self.extend Rake::DSL
diff --git a/lib/rake/early_time.rb b/lib/rake/early_time.rb
new file mode 100644
index 0000000000..abcb1872b5
--- /dev/null
+++ b/lib/rake/early_time.rb
@@ -0,0 +1,21 @@
+module Rake
+
+ # EarlyTime is a fake timestamp that occurs _before_ any other time value.
+ class EarlyTime
+ include Comparable
+ include Singleton
+
+ ##
+ # The EarlyTime always comes before +other+!
+
+ def <=>(other)
+ -1
+ end
+
+ def to_s # :nodoc:
+ "<EARLY TIME>"
+ end
+ end
+
+ EARLY = EarlyTime.instance
+end
diff --git a/lib/rake/ext/core.rb b/lib/rake/ext/core.rb
new file mode 100644
index 0000000000..7575df15a9
--- /dev/null
+++ b/lib/rake/ext/core.rb
@@ -0,0 +1,25 @@
+class Module
+ # Check for an existing method in the current class before extending. If
+ # the method already exists, then a warning is printed and the extension is
+ # not added. Otherwise the block is yielded and any definitions in the
+ # block will take effect.
+ #
+ # Usage:
+ #
+ # class String
+ # rake_extension("xyz") do
+ # def xyz
+ # ...
+ # end
+ # end
+ # end
+ #
+ def rake_extension(method) # :nodoc:
+ if method_defined?(method)
+ $stderr.puts "WARNING: Possible conflict with Rake extension: " +
+ "#{self}##{method} already exists"
+ else
+ yield
+ end
+ end
+end
diff --git a/lib/rake/ext/module.rb b/lib/rake/ext/module.rb
new file mode 100644
index 0000000000..3ee155ff6c
--- /dev/null
+++ b/lib/rake/ext/module.rb
@@ -0,0 +1,2 @@
+
+# TODO: remove in Rake 11
diff --git a/lib/rake/ext/pathname.rb b/lib/rake/ext/pathname.rb
new file mode 100644
index 0000000000..49e2cd47ac
--- /dev/null
+++ b/lib/rake/ext/pathname.rb
@@ -0,0 +1,25 @@
+require 'rake/ext/core'
+require 'pathname'
+
+class Pathname
+
+ rake_extension("ext") do
+ # Return a new Pathname with <tt>String#ext</tt> applied to it.
+ #
+ # This Pathname extension comes from Rake
+ def ext(newext='')
+ Pathname.new(Rake.from_pathname(self).ext(newext))
+ end
+ end
+
+ rake_extension("pathmap") do
+ # Apply the pathmap spec to the Pathname, returning a
+ # new Pathname with the modified paths. (See String#pathmap for
+ # details.)
+ #
+ # This Pathname extension comes from Rake
+ def pathmap(spec=nil, &block)
+ Pathname.new(Rake.from_pathname(self).pathmap(spec, &block))
+ end
+ end
+end
diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb
new file mode 100644
index 0000000000..b47b055a74
--- /dev/null
+++ b/lib/rake/ext/string.rb
@@ -0,0 +1,173 @@
+require 'rake/ext/core'
+
+class String
+
+ rake_extension("ext") do
+ # Replace the file extension with +newext+. If there is no extension on
+ # the string, append the new extension to the end. If the new extension
+ # is not given, or is the empty string, remove any existing extension.
+ #
+ # +ext+ is a user added method for the String class.
+ #
+ # This String extension comes from Rake
+ def ext(newext='')
+ return self.dup if ['.', '..'].include? self
+ newext = (newext =~ /^\./) ? newext : ("." + newext) if newext != ''
+ self.chomp(File.extname(self)) << newext
+ end
+ end
+
+ rake_extension("pathmap") do
+ # Explode a path into individual components. Used by +pathmap+.
+ #
+ # This String extension comes from Rake
+ def pathmap_explode
+ head, tail = File.split(self)
+ return [self] if head == self
+ return [tail] if head == '.' || tail == '/'
+ return [head, tail] if head == '/'
+ return head.pathmap_explode + [tail]
+ end
+ protected :pathmap_explode
+
+ # Extract a partial path from the path. Include +n+ directories from the
+ # front end (left hand side) if +n+ is positive. Include |+n+|
+ # directories from the back end (right hand side) if +n+ is negative.
+ #
+ # This String extension comes from Rake
+ def pathmap_partial(n)
+ dirs = File.dirname(self).pathmap_explode
+ partial_dirs =
+ if n > 0
+ dirs[0...n]
+ elsif n < 0
+ dirs.reverse[0...-n].reverse
+ else
+ "."
+ end
+ File.join(partial_dirs)
+ end
+ protected :pathmap_partial
+
+ # Perform the pathmap replacement operations on the given path. The
+ # patterns take the form 'pat1,rep1;pat2,rep2...'.
+ #
+ # This String extension comes from Rake
+ def pathmap_replace(patterns, &block)
+ result = self
+ patterns.split(';').each do |pair|
+ pattern, replacement = pair.split(',')
+ pattern = Regexp.new(pattern)
+ if replacement == '*' && block_given?
+ result = result.sub(pattern, &block)
+ elsif replacement
+ result = result.sub(pattern, replacement)
+ else
+ result = result.sub(pattern, '')
+ end
+ end
+ result
+ end
+ protected :pathmap_replace
+
+ # Map the path according to the given specification. The specification
+ # controls the details of the mapping. The following special patterns are
+ # recognized:
+ #
+ # <tt>%p</tt> :: The complete path.
+ # <tt>%f</tt> :: The base file name of the path, with its file extension,
+ # but without any directories.
+ # <tt>%n</tt> :: The file name of the path without its file extension.
+ # <tt>%d</tt> :: The directory list of the path.
+ # <tt>%x</tt> :: The file extension of the path. An empty string if there
+ # is no extension.
+ # <tt>%X</tt> :: Everything *but* the file extension.
+ # <tt>%s</tt> :: The alternate file separator if defined, otherwise use #
+ # the standard file separator.
+ # <tt>%%</tt> :: A percent sign.
+ #
+ # The <tt>%d</tt> specifier can also have a numeric prefix (e.g. '%2d').
+ # If the number is positive, only return (up to) +n+ directories in the
+ # path, starting from the left hand side. If +n+ is negative, return (up
+ # to) +n+ directories from the right hand side of the path.
+ #
+ # Examples:
+ #
+ # 'a/b/c/d/file.txt'.pathmap("%2d") => 'a/b'
+ # 'a/b/c/d/file.txt'.pathmap("%-2d") => 'c/d'
+ #
+ # Also the <tt>%d</tt>, <tt>%p</tt>, <tt>%f</tt>, <tt>%n</tt>,
+ # <tt>%x</tt>, and <tt>%X</tt> operators can take a pattern/replacement
+ # argument to perform simple string substitutions on a particular part of
+ # the path. The pattern and replacement are separated by a comma and are
+ # enclosed by curly braces. The replacement spec comes after the %
+ # character but before the operator letter. (e.g. "%{old,new}d").
+ # Multiple replacement specs should be separated by semi-colons (e.g.
+ # "%{old,new;src,bin}d").
+ #
+ # Regular expressions may be used for the pattern, and back refs may be
+ # used in the replacement text. Curly braces, commas and semi-colons are
+ # excluded from both the pattern and replacement text (let's keep parsing
+ # reasonable).
+ #
+ # For example:
+ #
+ # "src/org/onestepback/proj/A.java".pathmap("%{^src,class}X.class")
+ #
+ # returns:
+ #
+ # "class/org/onestepback/proj/A.class"
+ #
+ # If the replacement text is '*', then a block may be provided to perform
+ # some arbitrary calculation for the replacement.
+ #
+ # For example:
+ #
+ # "/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext|
+ # ext.downcase
+ # }
+ #
+ # Returns:
+ #
+ # "/path/to/file.txt"
+ #
+ # This String extension comes from Rake
+ def pathmap(spec=nil, &block)
+ return self if spec.nil?
+ result = ''
+ spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag|
+ case frag
+ when '%f'
+ result << File.basename(self)
+ when '%n'
+ result << File.basename(self).ext
+ when '%d'
+ result << File.dirname(self)
+ when '%x'
+ result << File.extname(self)
+ when '%X'
+ result << self.ext
+ when '%p'
+ result << self
+ when '%s'
+ result << (File::ALT_SEPARATOR || File::SEPARATOR)
+ when '%-'
+ # do nothing
+ when '%%'
+ result << "%"
+ when /%(-?\d+)d/
+ result << pathmap_partial($1.to_i)
+ when /^%\{([^}]*)\}(\d*[dpfnxX])/
+ patterns, operator = $1, $2
+ result << pathmap('%' + operator).pathmap_replace(patterns, &block)
+ when /^%/
+ fail ArgumentError, "Unknown pathmap specifier #{frag} in '#{spec}'"
+ else
+ result << frag
+ end
+ end
+ result
+ end
+ end
+
+end
diff --git a/lib/rake/ext/time.rb b/lib/rake/ext/time.rb
new file mode 100644
index 0000000000..c058649b7e
--- /dev/null
+++ b/lib/rake/ext/time.rb
@@ -0,0 +1,15 @@
+#--
+# Extensions to time to allow comparisons with an early time class.
+
+require 'rake/early_time'
+
+class Time # :nodoc: all
+ alias rake_original_time_compare :<=>
+ def <=>(other)
+ if Rake::EarlyTime === other
+ - other.<=>(self)
+ else
+ rake_original_time_compare(other)
+ end
+ end
+end
diff --git a/lib/rake/file_creation_task.rb b/lib/rake/file_creation_task.rb
new file mode 100644
index 0000000000..c87e2192bb
--- /dev/null
+++ b/lib/rake/file_creation_task.rb
@@ -0,0 +1,24 @@
+require 'rake/file_task'
+require 'rake/early_time'
+
+module Rake
+
+ # A FileCreationTask is a file task that when used as a dependency will be
+ # needed if and only if the file has not been created. Once created, it is
+ # not re-triggered if any of its dependencies are newer, nor does trigger
+ # any rebuilds of tasks that depend on it whenever it is updated.
+ #
+ class FileCreationTask < FileTask
+ # Is this file task needed? Yes if it doesn't exist.
+ def needed?
+ ! File.exist?(name)
+ end
+
+ # Time stamp for file creation task. This time stamp is earlier
+ # than any other time stamp.
+ def timestamp
+ Rake::EARLY
+ end
+ end
+
+end
diff --git a/lib/rake/file_list.rb b/lib/rake/file_list.rb
new file mode 100644
index 0000000000..006ec7703e
--- /dev/null
+++ b/lib/rake/file_list.rb
@@ -0,0 +1,428 @@
+require 'rake/cloneable'
+require 'rake/file_utils_ext'
+require 'rake/pathmap'
+
+
+module Rake
+
+ ##
+ # A FileList is essentially an array with a few helper methods defined to
+ # make file manipulation a bit easier.
+ #
+ # FileLists are lazy. When given a list of glob patterns for possible files
+ # to be included in the file list, instead of searching the file structures
+ # to find the files, a FileList holds the pattern for latter use.
+ #
+ # This allows us to define a number of FileList to match any number of
+ # files, but only search out the actual files when then FileList itself is
+ # actually used. The key is that the first time an element of the
+ # FileList/Array is requested, the pending patterns are resolved into a real
+ # list of file names.
+ #
+ class FileList
+
+ include Cloneable
+
+ # == Method Delegation
+ #
+ # The lazy evaluation magic of FileLists happens by implementing all the
+ # array specific methods to call +resolve+ before delegating the heavy
+ # lifting to an embedded array object (@items).
+ #
+ # In addition, there are two kinds of delegation calls. The regular kind
+ # delegates to the @items array and returns the result directly. Well,
+ # almost directly. It checks if the returned value is the @items object
+ # itself, and if so will return the FileList object instead.
+ #
+ # The second kind of delegation call is used in methods that normally
+ # return a new Array object. We want to capture the return value of these
+ # methods and wrap them in a new FileList object. We enumerate these
+ # methods in the +SPECIAL_RETURN+ list below.
+
+ # List of array methods (that are not in +Object+) that need to be
+ # delegated.
+ ARRAY_METHODS = (Array.instance_methods - Object.instance_methods).
+ map { |n| n.to_s }
+
+ # List of additional methods that must be delegated.
+ MUST_DEFINE = %w[inspect <=>]
+
+ # List of methods that should not be delegated here (we define special
+ # versions of them explicitly below).
+ MUST_NOT_DEFINE = %w[to_a to_ary partition * <<]
+
+ # List of delegated methods that return new array values which need
+ # wrapping.
+ SPECIAL_RETURN = %w[
+ map collect sort sort_by select find_all reject grep
+ compact flatten uniq values_at
+ + - & |
+ ]
+
+ DELEGATING_METHODS = (ARRAY_METHODS + MUST_DEFINE - MUST_NOT_DEFINE).
+ map { |s| s.to_s }.sort.uniq
+
+ # Now do the delegation.
+ DELEGATING_METHODS.each do |sym|
+ if SPECIAL_RETURN.include?(sym)
+ ln = __LINE__ + 1
+ class_eval %{
+ def #{sym}(*args, &block)
+ resolve
+ result = @items.send(:#{sym}, *args, &block)
+ FileList.new.import(result)
+ end
+ }, __FILE__, ln
+ else
+ ln = __LINE__ + 1
+ class_eval %{
+ def #{sym}(*args, &block)
+ resolve
+ result = @items.send(:#{sym}, *args, &block)
+ result.object_id == @items.object_id ? self : result
+ end
+ }, __FILE__, ln
+ end
+ end
+
+ # Create a file list from the globbable patterns given. If you wish to
+ # perform multiple includes or excludes at object build time, use the
+ # "yield self" pattern.
+ #
+ # Example:
+ # file_list = FileList.new('lib/**/*.rb', 'test/test*.rb')
+ #
+ # pkg_files = FileList.new('lib/**/*') do |fl|
+ # fl.exclude(/\bCVS\b/)
+ # end
+ #
+ def initialize(*patterns)
+ @pending_add = []
+ @pending = false
+ @exclude_patterns = DEFAULT_IGNORE_PATTERNS.dup
+ @exclude_procs = DEFAULT_IGNORE_PROCS.dup
+ @items = []
+ patterns.each { |pattern| include(pattern) }
+ yield self if block_given?
+ end
+
+ # Add file names defined by glob patterns to the file list. If an array
+ # is given, add each element of the array.
+ #
+ # Example:
+ # file_list.include("*.java", "*.cfg")
+ # file_list.include %w( math.c lib.h *.o )
+ #
+ def include(*filenames)
+ # TODO: check for pending
+ filenames.each do |fn|
+ if fn.respond_to? :to_ary
+ include(*fn.to_ary)
+ else
+ @pending_add << Rake.from_pathname(fn)
+ end
+ end
+ @pending = true
+ self
+ end
+ alias :add :include
+
+ # Register a list of file name patterns that should be excluded from the
+ # list. Patterns may be regular expressions, glob patterns or regular
+ # strings. In addition, a block given to exclude will remove entries that
+ # return true when given to the block.
+ #
+ # Note that glob patterns are expanded against the file system. If a file
+ # is explicitly added to a file list, but does not exist in the file
+ # system, then an glob pattern in the exclude list will not exclude the
+ # file.
+ #
+ # Examples:
+ # FileList['a.c', 'b.c'].exclude("a.c") => ['b.c']
+ # FileList['a.c', 'b.c'].exclude(/^a/) => ['b.c']
+ #
+ # If "a.c" is a file, then ...
+ # FileList['a.c', 'b.c'].exclude("a.*") => ['b.c']
+ #
+ # If "a.c" is not a file, then ...
+ # FileList['a.c', 'b.c'].exclude("a.*") => ['a.c', 'b.c']
+ #
+ def exclude(*patterns, &block)
+ patterns.each do |pat|
+ @exclude_patterns << Rake.from_pathname(pat)
+ end
+ @exclude_procs << block if block_given?
+ resolve_exclude unless @pending
+ self
+ end
+
+ # Clear all the exclude patterns so that we exclude nothing.
+ def clear_exclude
+ @exclude_patterns = []
+ @exclude_procs = []
+ self
+ end
+
+ # A FileList is equal through array equality.
+ def ==(array)
+ to_ary == array
+ end
+
+ # Return the internal array object.
+ def to_a
+ resolve
+ @items
+ end
+
+ # Return the internal array object.
+ def to_ary
+ to_a
+ end
+
+ # Lie about our class.
+ def is_a?(klass)
+ klass == Array || super(klass)
+ end
+ alias kind_of? is_a?
+
+ # Redefine * to return either a string or a new file list.
+ def *(other)
+ result = @items * other
+ case result
+ when Array
+ FileList.new.import(result)
+ else
+ result
+ end
+ end
+
+ def <<(obj)
+ resolve
+ @items << Rake.from_pathname(obj)
+ self
+ end
+
+ # Resolve all the pending adds now.
+ def resolve
+ if @pending
+ @pending = false
+ @pending_add.each do |fn| resolve_add(fn) end
+ @pending_add = []
+ resolve_exclude
+ end
+ self
+ end
+
+ def resolve_add(fn) # :nodoc:
+ case fn
+ when %r{[*?\[\{]}
+ add_matching(fn)
+ else
+ self << fn
+ end
+ end
+ private :resolve_add
+
+ def resolve_exclude # :nodoc:
+ reject! { |fn| excluded_from_list?(fn) }
+ self
+ end
+ private :resolve_exclude
+
+ # Return a new FileList with the results of running +sub+ against each
+ # element of the original list.
+ #
+ # Example:
+ # FileList['a.c', 'b.c'].sub(/\.c$/, '.o') => ['a.o', 'b.o']
+ #
+ def sub(pat, rep)
+ inject(FileList.new) { |res, fn| res << fn.sub(pat, rep) }
+ end
+
+ # Return a new FileList with the results of running +gsub+ against each
+ # element of the original list.
+ #
+ # Example:
+ # FileList['lib/test/file', 'x/y'].gsub(/\//, "\\")
+ # => ['lib\\test\\file', 'x\\y']
+ #
+ def gsub(pat, rep)
+ inject(FileList.new) { |res, fn| res << fn.gsub(pat, rep) }
+ end
+
+ # Same as +sub+ except that the original file list is modified.
+ def sub!(pat, rep)
+ each_with_index { |fn, i| self[i] = fn.sub(pat, rep) }
+ self
+ end
+
+ # Same as +gsub+ except that the original file list is modified.
+ def gsub!(pat, rep)
+ each_with_index { |fn, i| self[i] = fn.gsub(pat, rep) }
+ self
+ end
+
+ # Apply the pathmap spec to each of the included file names, returning a
+ # new file list with the modified paths. (See String#pathmap for
+ # details.)
+ def pathmap(spec=nil)
+ collect { |fn| fn.pathmap(spec) }
+ end
+
+ # Return a new FileList with <tt>String#ext</tt> method applied to
+ # each member of the array.
+ #
+ # This method is a shortcut for:
+ #
+ # array.collect { |item| item.ext(newext) }
+ #
+ # +ext+ is a user added method for the Array class.
+ def ext(newext='')
+ collect { |fn| fn.ext(newext) }
+ end
+
+ # Grep each of the files in the filelist using the given pattern. If a
+ # block is given, call the block on each matching line, passing the file
+ # name, line number, and the matching line of text. If no block is given,
+ # a standard emacs style file:linenumber:line message will be printed to
+ # standard out. Returns the number of matched items.
+ def egrep(pattern, *options)
+ matched = 0
+ each do |fn|
+ begin
+ open(fn, "r", *options) do |inf|
+ count = 0
+ inf.each do |line|
+ count += 1
+ if pattern.match(line)
+ matched += 1
+ if block_given?
+ yield fn, count, line
+ else
+ puts "#{fn}:#{count}:#{line}"
+ end
+ end
+ end
+ end
+ rescue StandardError => ex
+ $stderr.puts "Error while processing '#{fn}': #{ex}"
+ end
+ end
+ matched
+ end
+
+ # Return a new file list that only contains file names from the current
+ # file list that exist on the file system.
+ def existing
+ select { |fn| File.exist?(fn) }
+ end
+
+ # Modify the current file list so that it contains only file name that
+ # exist on the file system.
+ def existing!
+ resolve
+ @items = @items.select { |fn| File.exist?(fn) }
+ self
+ end
+
+ # FileList version of partition. Needed because the nested arrays should
+ # be FileLists in this version.
+ def partition(&block) # :nodoc:
+ resolve
+ result = @items.partition(&block)
+ [
+ FileList.new.import(result[0]),
+ FileList.new.import(result[1]),
+ ]
+ end
+
+ # Convert a FileList to a string by joining all elements with a space.
+ def to_s
+ resolve
+ self.join(' ')
+ end
+
+ # Add matching glob patterns.
+ def add_matching(pattern)
+ FileList.glob(pattern).each do |fn|
+ self << fn unless excluded_from_list?(fn)
+ end
+ end
+ private :add_matching
+
+ # Should the given file name be excluded from the list?
+ #
+ # NOTE: This method was formerly named "exclude?", but Rails
+ # introduced an exclude? method as an array method and setup a
+ # conflict with file list. We renamed the method to avoid
+ # confusion. If you were using "FileList#exclude?" in your user
+ # code, you will need to update.
+ def excluded_from_list?(fn)
+ return true if @exclude_patterns.any? do |pat|
+ case pat
+ when Regexp
+ fn =~ pat
+ when /[*?]/
+ File.fnmatch?(pat, fn, File::FNM_PATHNAME)
+ else
+ fn == pat
+ end
+ end
+ @exclude_procs.any? { |p| p.call(fn) }
+ end
+
+ DEFAULT_IGNORE_PATTERNS = [
+ /(^|[\/\\])CVS([\/\\]|$)/,
+ /(^|[\/\\])\.svn([\/\\]|$)/,
+ /\.bak$/,
+ /~$/
+ ]
+ DEFAULT_IGNORE_PROCS = [
+ proc { |fn| fn =~ /(^|[\/\\])core$/ && ! File.directory?(fn) }
+ ]
+
+ def import(array) # :nodoc:
+ @items = array
+ self
+ end
+
+ class << self
+ # Create a new file list including the files listed. Similar to:
+ #
+ # FileList.new(*args)
+ def [](*args)
+ new(*args)
+ end
+
+ # Get a sorted list of files matching the pattern. This method
+ # should be preferred to Dir[pattern] and Dir.glob(pattern) because
+ # the files returned are guaranteed to be sorted.
+ def glob(pattern, *args)
+ Dir.glob(pattern, *args).sort
+ end
+ end
+ end
+end
+
+module Rake
+ class << self
+
+ # Yield each file or directory component.
+ def each_dir_parent(dir) # :nodoc:
+ old_length = nil
+ while dir != '.' && dir.length != old_length
+ yield(dir)
+ old_length = dir.length
+ dir = File.dirname(dir)
+ end
+ end
+
+ # Convert Pathname and Pathname-like objects to strings;
+ # leave everything else alone
+ def from_pathname(path) # :nodoc:
+ path = path.to_path if path.respond_to?(:to_path)
+ path = path.to_str if path.respond_to?(:to_str)
+ path
+ end
+ end
+end # module Rake
diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb
new file mode 100644
index 0000000000..11823bbe46
--- /dev/null
+++ b/lib/rake/file_task.rb
@@ -0,0 +1,46 @@
+require 'rake/task.rb'
+require 'rake/early_time'
+
+module Rake
+
+ # A FileTask is a task that includes time based dependencies. If any of a
+ # FileTask's prerequisites have a timestamp that is later than the file
+ # represented by this task, then the file must be rebuilt (using the
+ # supplied actions).
+ #
+ class FileTask < Task
+
+ # Is this file task needed? Yes if it doesn't exist, or if its time stamp
+ # is out of date.
+ def needed?
+ ! File.exist?(name) || out_of_date?(timestamp) || @application.options.build_all
+ end
+
+ # Time stamp for file task.
+ def timestamp
+ if File.exist?(name)
+ File.mtime(name.to_s)
+ else
+ Rake::EARLY
+ end
+ end
+
+ private
+
+ # Are there any prerequisites with a later time than the given time stamp?
+ def out_of_date?(stamp)
+ @prerequisites.any? { |n| application[n, @scope].timestamp > stamp }
+ end
+
+ # ----------------------------------------------------------------
+ # Task class methods.
+ #
+ class << self
+ # Apply the scope to the task name according to the rules for this kind
+ # of task. File based tasks ignore the scope when creating the name.
+ def scope_name(scope, task_name)
+ Rake.from_pathname(task_name)
+ end
+ end
+ end
+end
diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb
new file mode 100644
index 0000000000..27f4e2e1d1
--- /dev/null
+++ b/lib/rake/file_utils.rb
@@ -0,0 +1,128 @@
+require 'rbconfig'
+require 'fileutils'
+
+#--
+# This a FileUtils extension that defines several additional commands to be
+# added to the FileUtils utility functions.
+module FileUtils
+ # Path to the currently running Ruby program
+ RUBY = ENV['RUBY'] || File.join(
+ RbConfig::CONFIG['bindir'],
+ RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']).
+ sub(/.*\s.*/m, '"\&"')
+
+ OPT_TABLE['sh'] = %w(noop verbose)
+ OPT_TABLE['ruby'] = %w(noop verbose)
+
+ # Run the system command +cmd+. If multiple arguments are given the command
+ # is run directly (without the shell, same semantics as Kernel::exec and
+ # Kernel::system).
+ #
+ # It is recommended you use the multiple argument form over interpolating
+ # user input for both usability and security reasons. With the multiple
+ # argument form you can easily process files with spaces or other shell
+ # reserved characters in them. With the multiple argument form your rake
+ # tasks are not vulnerable to users providing an argument like
+ # <code>; rm # -rf /</code>.
+ #
+ # If a block is given, upon command completion the block is called with an
+ # OK flag (true on a zero exit status) and a Process::Status object.
+ # Without a block a RuntimeError is raised when the command exits non-zero.
+ #
+ # Examples:
+ #
+ # sh 'ls -ltr'
+ #
+ # sh 'ls', 'file with spaces'
+ #
+ # # check exit status after command runs
+ # sh %{grep pattern file} do |ok, res|
+ # if ! ok
+ # puts "pattern not found (status = #{res.exitstatus})"
+ # end
+ # end
+ #
+ def sh(*cmd, &block)
+ options = (Hash === cmd.last) ? cmd.pop : {}
+ shell_runner = block_given? ? block : create_shell_runner(cmd)
+ set_verbose_option(options)
+ options[:noop] ||= Rake::FileUtilsExt.nowrite_flag
+ Rake.rake_check_options options, :noop, :verbose
+ Rake.rake_output_message cmd.join(" ") if options[:verbose]
+
+ unless options[:noop]
+ res = rake_system(*cmd)
+ status = $?
+ status = Rake::PseudoStatus.new(1) if !res && status.nil?
+ shell_runner.call(res, status)
+ end
+ end
+
+ def create_shell_runner(cmd) # :nodoc:
+ show_command = cmd.join(" ")
+ show_command = show_command[0, 42] + "..." unless $trace
+ lambda do |ok, status|
+ ok or
+ fail "Command failed with status (#{status.exitstatus}): " +
+ "[#{show_command}]"
+ end
+ end
+ private :create_shell_runner
+
+ def set_verbose_option(options) # :nodoc:
+ unless options.key? :verbose
+ options[:verbose] =
+ (Rake::FileUtilsExt.verbose_flag == Rake::FileUtilsExt::DEFAULT) ||
+ Rake::FileUtilsExt.verbose_flag
+ end
+ end
+ private :set_verbose_option
+
+ def rake_system(*cmd) # :nodoc:
+ Rake::AltSystem.system(*cmd)
+ end
+ private :rake_system
+
+ # Run a Ruby interpreter with the given arguments.
+ #
+ # Example:
+ # ruby %{-pe '$_.upcase!' <README}
+ #
+ def ruby(*args, &block)
+ options = (Hash === args.last) ? args.pop : {}
+ if args.length > 1
+ sh(*([RUBY] + args + [options]), &block)
+ else
+ sh("#{RUBY} #{args.first}", options, &block)
+ end
+ end
+
+ LN_SUPPORTED = [true]
+
+ # Attempt to do a normal file link, but fall back to a copy if the link
+ # fails.
+ def safe_ln(*args)
+ if ! LN_SUPPORTED[0]
+ cp(*args)
+ else
+ begin
+ ln(*args)
+ rescue StandardError, NotImplementedError
+ LN_SUPPORTED[0] = false
+ cp(*args)
+ end
+ end
+ end
+
+ # Split a file path into individual directory names.
+ #
+ # Example:
+ # split_all("a/b/c") => ['a', 'b', 'c']
+ #
+ def split_all(path)
+ head, tail = File.split(path)
+ return [tail] if head == '.' || tail == '/'
+ return [head, tail] if head == '/'
+ return split_all(head) + [tail]
+ end
+end
diff --git a/lib/rake/file_utils_ext.rb b/lib/rake/file_utils_ext.rb
new file mode 100644
index 0000000000..309159aec1
--- /dev/null
+++ b/lib/rake/file_utils_ext.rb
@@ -0,0 +1,144 @@
+require 'rake/file_utils'
+
+module Rake
+ #
+ # FileUtilsExt provides a custom version of the FileUtils methods
+ # that respond to the <tt>verbose</tt> and <tt>nowrite</tt>
+ # commands.
+ #
+ module FileUtilsExt
+ include FileUtils
+
+ class << self
+ attr_accessor :verbose_flag, :nowrite_flag
+ end
+
+ DEFAULT = Object.new
+
+ FileUtilsExt.verbose_flag = DEFAULT
+ FileUtilsExt.nowrite_flag = false
+
+ FileUtils.commands.each do |name|
+ opts = FileUtils.options_of name
+ default_options = []
+ if opts.include?("verbose")
+ default_options << ':verbose => FileUtilsExt.verbose_flag'
+ end
+ if opts.include?("noop")
+ default_options << ':noop => FileUtilsExt.nowrite_flag'
+ end
+
+ next if default_options.empty?
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}( *args, &block )
+ super(
+ *rake_merge_option(args,
+ #{default_options.join(', ')}
+ ), &block)
+ end
+ EOS
+ end
+
+ # Get/set the verbose flag controlling output from the FileUtils
+ # utilities. If verbose is true, then the utility method is
+ # echoed to standard output.
+ #
+ # Examples:
+ # verbose # return the current value of the
+ # # verbose flag
+ # verbose(v) # set the verbose flag to _v_.
+ # verbose(v) { code } # Execute code with the verbose flag set
+ # # temporarily to _v_. Return to the
+ # # original value when code is done.
+ def verbose(value=nil)
+ oldvalue = FileUtilsExt.verbose_flag
+ FileUtilsExt.verbose_flag = value unless value.nil?
+ if block_given?
+ begin
+ yield
+ ensure
+ FileUtilsExt.verbose_flag = oldvalue
+ end
+ end
+ FileUtilsExt.verbose_flag
+ end
+
+ # Get/set the nowrite flag controlling output from the FileUtils
+ # utilities. If verbose is true, then the utility method is
+ # echoed to standard output.
+ #
+ # Examples:
+ # nowrite # return the current value of the
+ # # nowrite flag
+ # nowrite(v) # set the nowrite flag to _v_.
+ # nowrite(v) { code } # Execute code with the nowrite flag set
+ # # temporarily to _v_. Return to the
+ # # original value when code is done.
+ def nowrite(value=nil)
+ oldvalue = FileUtilsExt.nowrite_flag
+ FileUtilsExt.nowrite_flag = value unless value.nil?
+ if block_given?
+ begin
+ yield
+ ensure
+ FileUtilsExt.nowrite_flag = oldvalue
+ end
+ end
+ oldvalue
+ end
+
+ # Use this function to prevent potentially destructive ruby code
+ # from running when the :nowrite flag is set.
+ #
+ # Example:
+ #
+ # when_writing("Building Project") do
+ # project.build
+ # end
+ #
+ # The following code will build the project under normal
+ # conditions. If the nowrite(true) flag is set, then the example
+ # will print:
+ #
+ # DRYRUN: Building Project
+ #
+ # instead of actually building the project.
+ #
+ def when_writing(msg=nil)
+ if FileUtilsExt.nowrite_flag
+ $stderr.puts "DRYRUN: #{msg}" if msg
+ else
+ yield
+ end
+ end
+
+ # Merge the given options with the default values.
+ def rake_merge_option(args, defaults)
+ if Hash === args.last
+ defaults.update(args.last)
+ args.pop
+ end
+ args.push defaults
+ args
+ end
+
+ # Send the message to the default rake output (which is $stderr).
+ def rake_output_message(message)
+ $stderr.puts(message)
+ end
+
+ # Check that the options do not contain options not listed in
+ # +optdecl+. An ArgumentError exception is thrown if non-declared
+ # options are found.
+ def rake_check_options(options, *optdecl)
+ h = options.dup
+ optdecl.each do |name|
+ h.delete name
+ end
+ raise ArgumentError, "no such option: #{h.keys.join(' ')}" unless
+ h.empty?
+ end
+
+ extend self
+ end
+end
diff --git a/lib/rake/gempackagetask.rb b/lib/rake/gempackagetask.rb
new file mode 100644
index 0000000000..16e7ce042b
--- /dev/null
+++ b/lib/rake/gempackagetask.rb
@@ -0,0 +1,4 @@
+# TODO: Remove in Rake 11
+
+fail "ERROR: 'rake/gempackagetask' is obsolete and no longer supported. " +
+ "Use 'rubygems/package_task' instead."
diff --git a/lib/rake/invocation_chain.rb b/lib/rake/invocation_chain.rb
new file mode 100644
index 0000000000..540628957c
--- /dev/null
+++ b/lib/rake/invocation_chain.rb
@@ -0,0 +1,56 @@
+module Rake
+
+ # InvocationChain tracks the chain of task invocations to detect
+ # circular dependencies.
+ class InvocationChain < LinkedList
+
+ # Is the invocation already in the chain?
+ def member?(invocation)
+ head == invocation || tail.member?(invocation)
+ end
+
+ # Append an invocation to the chain of invocations. It is an error
+ # if the invocation already listed.
+ def append(invocation)
+ if member?(invocation)
+ fail RuntimeError, "Circular dependency detected: #{to_s} => #{invocation}"
+ end
+ conj(invocation)
+ end
+
+ # Convert to string, ie: TOP => invocation => invocation
+ def to_s
+ "#{prefix}#{head}"
+ end
+
+ # Class level append.
+ def self.append(invocation, chain)
+ chain.append(invocation)
+ end
+
+ private
+
+ def prefix
+ "#{tail} => "
+ end
+
+ # Null object for an empty chain.
+ class EmptyInvocationChain < LinkedList::EmptyLinkedList
+ @parent = InvocationChain
+
+ def member?(obj)
+ false
+ end
+
+ def append(invocation)
+ conj(invocation)
+ end
+
+ def to_s
+ "TOP"
+ end
+ end
+
+ EMPTY = EmptyInvocationChain.new
+ end
+end
diff --git a/lib/rake/invocation_exception_mixin.rb b/lib/rake/invocation_exception_mixin.rb
new file mode 100644
index 0000000000..84ff3353ba
--- /dev/null
+++ b/lib/rake/invocation_exception_mixin.rb
@@ -0,0 +1,16 @@
+module Rake
+ module InvocationExceptionMixin
+ # Return the invocation chain (list of Rake tasks) that were in
+ # effect when this exception was detected by rake. May be null if
+ # no tasks were active.
+ def chain
+ @rake_invocation_chain ||= nil
+ end
+
+ # Set the invocation chain in effect when this exception was
+ # detected.
+ def chain=(value)
+ @rake_invocation_chain = value
+ end
+ end
+end
diff --git a/lib/rake/linked_list.rb b/lib/rake/linked_list.rb
new file mode 100644
index 0000000000..b5ab797808
--- /dev/null
+++ b/lib/rake/linked_list.rb
@@ -0,0 +1,103 @@
+module Rake
+
+ # Polylithic linked list structure used to implement several data
+ # structures in Rake.
+ class LinkedList
+ include Enumerable
+
+ attr_reader :head, :tail
+
+ def initialize(head, tail=EMPTY)
+ @head = head
+ @tail = tail
+ end
+
+ # Polymorphically add a new element to the head of a list. The
+ # type of head node will be the same list type as the tail.
+ def conj(item)
+ self.class.cons(item, self)
+ end
+
+ # Is the list empty?
+ def empty?
+ false
+ end
+
+ # Lists are structurally equivalent.
+ def ==(other)
+ current = self
+ while ! current.empty? && ! other.empty?
+ return false if current.head != other.head
+ current = current.tail
+ other = other.tail
+ end
+ current.empty? && other.empty?
+ end
+
+ # Convert to string: LL(item, item...)
+ def to_s
+ items = map { |item| item.to_s }.join(", ")
+ "LL(#{items})"
+ end
+
+ # Same as +to_s+, but with inspected items.
+ def inspect
+ items = map { |item| item.inspect }.join(", ")
+ "LL(#{items})"
+ end
+
+ # For each item in the list.
+ def each
+ current = self
+ while ! current.empty?
+ yield(current.head)
+ current = current.tail
+ end
+ self
+ end
+
+ # Make a list out of the given arguments. This method is
+ # polymorphic
+ def self.make(*args)
+ result = empty
+ args.reverse_each do |item|
+ result = cons(item, result)
+ end
+ result
+ end
+
+ # Cons a new head onto the tail list.
+ def self.cons(head, tail)
+ new(head, tail)
+ end
+
+ # The standard empty list class for the given LinkedList class.
+ def self.empty
+ self::EMPTY
+ end
+
+ # Represent an empty list, using the Null Object Pattern.
+ #
+ # When inheriting from the LinkedList class, you should implement
+ # a type specific Empty class as well. Make sure you set the class
+ # instance variable @parent to the associated list class (this
+ # allows conj, cons and make to work polymorphically).
+ class EmptyLinkedList < LinkedList
+ @parent = LinkedList
+
+ def initialize
+ end
+
+ def empty?
+ true
+ end
+
+ def self.cons(head, tail)
+ @parent.cons(head, tail)
+ end
+ end
+
+ EMPTY = EmptyLinkedList.new
+ end
+
+end
diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb
new file mode 100644
index 0000000000..4ece4323af
--- /dev/null
+++ b/lib/rake/loaders/makefile.rb
@@ -0,0 +1,40 @@
+module Rake
+
+ # Makefile loader to be used with the import file loader.
+ class MakefileLoader
+ include Rake::DSL
+
+ SPACE_MARK = "\0"
+
+ # Load the makefile dependencies in +fn+.
+ def load(fn)
+ lines = File.read fn
+ lines.gsub!(/\\ /, SPACE_MARK)
+ lines.gsub!(/#[^\n]*\n/m, "")
+ lines.gsub!(/\\\n/, ' ')
+ lines.each_line do |line|
+ process_line(line)
+ end
+ end
+
+ private
+
+ # Process one logical line of makefile data.
+ def process_line(line)
+ file_tasks, args = line.split(':', 2)
+ return if args.nil?
+ dependents = args.split.map { |d| respace(d) }
+ file_tasks.scan(/\S+/) do |file_task|
+ file_task = respace(file_task)
+ file file_task => dependents
+ end
+ end
+
+ def respace(str)
+ str.tr SPACE_MARK, ' '
+ end
+ end
+
+ # Install the handler
+ Rake.application.add_loader('mf', MakefileLoader.new)
+end
diff --git a/lib/rake/multi_task.rb b/lib/rake/multi_task.rb
new file mode 100644
index 0000000000..5418a7a7b0
--- /dev/null
+++ b/lib/rake/multi_task.rb
@@ -0,0 +1,13 @@
+module Rake
+
+ # Same as a regular task, but the immediate prerequisites are done in
+ # parallel using Ruby threads.
+ #
+ class MultiTask < Task
+ private
+ def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
+ invoke_prerequisites_concurrently(task_args, invocation_chain)
+ end
+ end
+
+end
diff --git a/lib/rake/name_space.rb b/lib/rake/name_space.rb
new file mode 100644
index 0000000000..58f911e434
--- /dev/null
+++ b/lib/rake/name_space.rb
@@ -0,0 +1,38 @@
+##
+# The NameSpace class will lookup task names in the scope defined by a
+# +namespace+ command.
+
+class Rake::NameSpace
+
+ ##
+ # Create a namespace lookup object using the given task manager
+ # and the list of scopes.
+
+ def initialize(task_manager, scope_list)
+ @task_manager = task_manager
+ @scope = scope_list.dup
+ end
+
+ ##
+ # Lookup a task named +name+ in the namespace.
+
+ def [](name)
+ @task_manager.lookup(name, @scope)
+ end
+
+ ##
+ # The scope of the namespace (a LinkedList)
+
+ def scope
+ @scope.dup
+ end
+
+ ##
+ # Return the list of tasks defined in this and nested namespaces.
+
+ def tasks
+ @task_manager.tasks_in_scope(@scope)
+ end
+
+end
+
diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb
new file mode 100644
index 0000000000..e862952c05
--- /dev/null
+++ b/lib/rake/packagetask.rb
@@ -0,0 +1,202 @@
+# Define a package task library to aid in the definition of
+# redistributable package files.
+
+require 'rake'
+require 'rake/tasklib'
+
+module Rake
+
+ # Create a packaging task that will package the project into
+ # distributable files (e.g zip archive or tar files).
+ #
+ # The PackageTask will create the following targets:
+ #
+ # +:package+ ::
+ # Create all the requested package files.
+ #
+ # +:clobber_package+ ::
+ # Delete all the package files. This target is automatically
+ # added to the main clobber target.
+ #
+ # +:repackage+ ::
+ # Rebuild the package files from scratch, even if they are not out
+ # of date.
+ #
+ # <tt>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tgz"</tt> ::
+ # Create a gzipped tar package (if <em>need_tar</em> is true).
+ #
+ # <tt>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.gz"</tt> ::
+ # Create a gzipped tar package (if <em>need_tar_gz</em> is true).
+ #
+ # <tt>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.bz2"</tt> ::
+ # Create a bzip2'd tar package (if <em>need_tar_bz2</em> is true).
+ #
+ # <tt>"<em>package_dir</em>/<em>name</em>-<em>version</em>.zip"</tt> ::
+ # Create a zip package archive (if <em>need_zip</em> is true).
+ #
+ # Example:
+ #
+ # Rake::PackageTask.new("rake", "1.2.3") do |p|
+ # p.need_tar = true
+ # p.package_files.include("lib/**/*.rb")
+ # end
+ #
+ class PackageTask < TaskLib
+ # Name of the package (from the GEM Spec).
+ attr_accessor :name
+
+ # Version of the package (e.g. '1.3.2').
+ attr_accessor :version
+
+ # Directory used to store the package files (default is 'pkg').
+ attr_accessor :package_dir
+
+ # True if a gzipped tar file (tgz) should be produced (default is
+ # false).
+ attr_accessor :need_tar
+
+ # True if a gzipped tar file (tar.gz) should be produced (default
+ # is false).
+ attr_accessor :need_tar_gz
+
+ # True if a bzip2'd tar file (tar.bz2) should be produced (default
+ # is false).
+ attr_accessor :need_tar_bz2
+
+ # True if a zip file should be produced (default is false)
+ attr_accessor :need_zip
+
+ # List of files to be included in the package.
+ attr_accessor :package_files
+
+ # Tar command for gzipped or bzip2ed archives. The default is 'tar'.
+ attr_accessor :tar_command
+
+ # Zip command for zipped archives. The default is 'zip'.
+ attr_accessor :zip_command
+
+ # Create a Package Task with the given name and version. Use +:noversion+
+ # as the version to build a package without a version or to provide a
+ # fully-versioned package name.
+
+ def initialize(name=nil, version=nil)
+ init(name, version)
+ yield self if block_given?
+ define unless name.nil?
+ end
+
+ # Initialization that bypasses the "yield self" and "define" step.
+ def init(name, version)
+ @name = name
+ @version = version
+ @package_files = Rake::FileList.new
+ @package_dir = 'pkg'
+ @need_tar = false
+ @need_tar_gz = false
+ @need_tar_bz2 = false
+ @need_zip = false
+ @tar_command = 'tar'
+ @zip_command = 'zip'
+ end
+
+ # Create the tasks defined by this task library.
+ def define
+ fail "Version required (or :noversion)" if @version.nil?
+ @version = nil if :noversion == @version
+
+ desc "Build all the packages"
+ task :package
+
+ desc "Force a rebuild of the package files"
+ task :repackage => [:clobber_package, :package]
+
+ desc "Remove package products"
+ task :clobber_package do
+ rm_r package_dir rescue nil
+ end
+
+ task :clobber => [:clobber_package]
+
+ [
+ [need_tar, tgz_file, "z"],
+ [need_tar_gz, tar_gz_file, "z"],
+ [need_tar_bz2, tar_bz2_file, "j"]
+ ].each do |(need, file, flag)|
+ if need
+ task :package => ["#{package_dir}/#{file}"]
+ file "#{package_dir}/#{file}" =>
+ [package_dir_path] + package_files do
+ chdir(package_dir) do
+ sh @tar_command, "#{flag}cvf", file, package_name
+ end
+ end
+ end
+ end
+
+ if need_zip
+ task :package => ["#{package_dir}/#{zip_file}"]
+ file "#{package_dir}/#{zip_file}" =>
+ [package_dir_path] + package_files do
+ chdir(package_dir) do
+ sh @zip_command, "-r", zip_file, package_name
+ end
+ end
+ end
+
+ directory package_dir
+
+ file package_dir_path => @package_files do
+ mkdir_p package_dir rescue nil
+ @package_files.each do |fn|
+ f = File.join(package_dir_path, fn)
+ fdir = File.dirname(f)
+ mkdir_p(fdir) unless File.exist?(fdir)
+ if File.directory?(fn)
+ mkdir_p(f)
+ else
+ rm_f f
+ safe_ln(fn, f)
+ end
+ end
+ end
+ self
+ end
+
+ # The name of this package
+
+ def package_name
+ @version ? "#{@name}-#{@version}" : @name
+ end
+
+ # The directory this package will be built in
+
+ def package_dir_path
+ "#{package_dir}/#{package_name}"
+ end
+
+ # The package name with .tgz added
+
+ def tgz_file
+ "#{package_name}.tgz"
+ end
+
+ # The package name with .tar.gz added
+
+ def tar_gz_file
+ "#{package_name}.tar.gz"
+ end
+
+ # The package name with .tar.bz2 added
+
+ def tar_bz2_file
+ "#{package_name}.tar.bz2"
+ end
+
+ # The package name with .zip added
+
+ def zip_file
+ "#{package_name}.zip"
+ end
+ end
+
+end
diff --git a/lib/rake/pathmap.rb b/lib/rake/pathmap.rb
new file mode 100644
index 0000000000..9a840cda29
--- /dev/null
+++ b/lib/rake/pathmap.rb
@@ -0,0 +1,3 @@
+# TODO: Remove in Rake 11
+
+require 'rake/ext/string'
diff --git a/lib/rake/phony.rb b/lib/rake/phony.rb
new file mode 100644
index 0000000000..29633ae066
--- /dev/null
+++ b/lib/rake/phony.rb
@@ -0,0 +1,15 @@
+# Defines a :phony task that you can use as a dependency. This allows
+# file-based tasks to use non-file-based tasks as prerequisites
+# without forcing them to rebuild.
+#
+# See FileTask#out_of_date? and Task#timestamp for more info.
+
+require 'rake'
+
+task :phony
+
+Rake::Task[:phony].tap do |task|
+ def task.timestamp # :nodoc:
+ Time.at 0
+ end
+end
diff --git a/lib/rake/private_reader.rb b/lib/rake/private_reader.rb
new file mode 100644
index 0000000000..1620978576
--- /dev/null
+++ b/lib/rake/private_reader.rb
@@ -0,0 +1,20 @@
+module Rake
+
+ # Include PrivateReader to use +private_reader+.
+ module PrivateReader # :nodoc: all
+
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+
+ module ClassMethods
+
+ # Declare a list of private accessors
+ def private_reader(*names)
+ attr_reader(*names)
+ private(*names)
+ end
+ end
+
+ end
+end
diff --git a/lib/rake/promise.rb b/lib/rake/promise.rb
new file mode 100644
index 0000000000..31c4563476
--- /dev/null
+++ b/lib/rake/promise.rb
@@ -0,0 +1,99 @@
+module Rake
+
+ # A Promise object represents a promise to do work (a chore) in the
+ # future. The promise is created with a block and a list of
+ # arguments for the block. Calling value will return the value of
+ # the promised chore.
+ #
+ # Used by ThreadPool.
+ #
+ class Promise # :nodoc: all
+ NOT_SET = Object.new.freeze # :nodoc:
+
+ attr_accessor :recorder
+
+ # Create a promise to do the chore specified by the block.
+ def initialize(args, &block)
+ @mutex = Mutex.new
+ @result = NOT_SET
+ @error = NOT_SET
+ @args = args
+ @block = block
+ end
+
+ # Return the value of this promise.
+ #
+ # If the promised chore is not yet complete, then do the work
+ # synchronously. We will wait.
+ def value
+ unless complete?
+ stat :sleeping_on, :item_id => object_id
+ @mutex.synchronize do
+ stat :has_lock_on, :item_id => object_id
+ chore
+ stat :releasing_lock_on, :item_id => object_id
+ end
+ end
+ error? ? raise(@error) : @result
+ end
+
+ # If no one else is working this promise, go ahead and do the chore.
+ def work
+ stat :attempting_lock_on, :item_id => object_id
+ if @mutex.try_lock
+ stat :has_lock_on, :item_id => object_id
+ chore
+ stat :releasing_lock_on, :item_id => object_id
+ @mutex.unlock
+ else
+ stat :bailed_on, :item_id => object_id
+ end
+ end
+
+ private
+
+ # Perform the chore promised
+ def chore
+ if complete?
+ stat :found_completed, :item_id => object_id
+ return
+ end
+ stat :will_execute, :item_id => object_id
+ begin
+ @result = @block.call(*@args)
+ rescue Exception => e
+ @error = e
+ end
+ stat :did_execute, :item_id => object_id
+ discard
+ end
+
+ # Do we have a result for the promise
+ def result?
+ ! @result.equal?(NOT_SET)
+ end
+
+ # Did the promise throw an error
+ def error?
+ ! @error.equal?(NOT_SET)
+ end
+
+ # Are we done with the promise
+ def complete?
+ result? || error?
+ end
+
+ # free up these items for the GC
+ def discard
+ @args = nil
+ @block = nil
+ end
+
+ # Record execution statistics if there is a recorder
+ def stat(*args)
+ @recorder.call(*args) if @recorder
+ end
+
+ end
+
+end
diff --git a/lib/rake/pseudo_status.rb b/lib/rake/pseudo_status.rb
new file mode 100644
index 0000000000..16e1903bd6
--- /dev/null
+++ b/lib/rake/pseudo_status.rb
@@ -0,0 +1,29 @@
+module Rake
+
+ ##
+ # Exit status class for times the system just gives us a nil.
+ class PseudoStatus # :nodoc: all
+ attr_reader :exitstatus
+
+ def initialize(code=0)
+ @exitstatus = code
+ end
+
+ def to_i
+ @exitstatus << 8
+ end
+
+ def >>(n)
+ to_i >> n
+ end
+
+ def stopped?
+ false
+ end
+
+ def exited?
+ true
+ end
+ end
+
+end
diff --git a/lib/rake/rake_module.rb b/lib/rake/rake_module.rb
new file mode 100644
index 0000000000..3692753434
--- /dev/null
+++ b/lib/rake/rake_module.rb
@@ -0,0 +1,38 @@
+require 'rake/application'
+
+module Rake
+
+ class << self
+ # Current Rake Application
+ def application
+ @application ||= Rake::Application.new
+ end
+
+ # Set the current Rake application object.
+ def application=(app)
+ @application = app
+ end
+
+ def suggested_thread_count # :nodoc:
+ @cpu_count ||= Rake::CpuCounter.count
+ @cpu_count + 4
+ end
+
+ # Return the original directory where the Rake application was started.
+ def original_dir
+ application.original_dir
+ end
+
+ # Load a rakefile.
+ def load_rakefile(path)
+ load(path)
+ end
+
+ # Add files to the rakelib list
+ def add_rakelib(*files)
+ application.options.rakelib ||= []
+ application.options.rakelib.concat(files)
+ end
+ end
+
+end
diff --git a/lib/rake/rake_test_loader.rb b/lib/rake/rake_test_loader.rb
new file mode 100644
index 0000000000..7e3a6b3f35
--- /dev/null
+++ b/lib/rake/rake_test_loader.rb
@@ -0,0 +1,22 @@
+require 'rake'
+
+# Load the test files from the command line.
+argv = ARGV.select do |argument|
+ case argument
+ when /^-/ then
+ argument
+ when /\*/ then
+ FileList[argument].to_a.each do |file|
+ require File.expand_path file
+ end
+
+ false
+ else
+ require File.expand_path argument
+
+ false
+ end
+end
+
+ARGV.replace argv
+
diff --git a/lib/rake/rdoctask.rb b/lib/rake/rdoctask.rb
new file mode 100644
index 0000000000..8d7df4f12b
--- /dev/null
+++ b/lib/rake/rdoctask.rb
@@ -0,0 +1,4 @@
+# TODO: Remove in Rake 11
+
+fail "ERROR: 'rake/rdoctask' is obsolete and no longer supported. " +
+ "Use 'rdoc/task' (available in RDoc 2.4.2+) instead."
diff --git a/lib/rake/ruby182_test_unit_fix.rb b/lib/rake/ruby182_test_unit_fix.rb
new file mode 100644
index 0000000000..40b30a6fde
--- /dev/null
+++ b/lib/rake/ruby182_test_unit_fix.rb
@@ -0,0 +1,29 @@
+# TODO: Remove in rake 11
+
+# Local Rake override to fix bug in Ruby 0.8.2
+module Test # :nodoc:
+ # Local Rake override to fix bug in Ruby 0.8.2
+ module Unit # :nodoc:
+ # Local Rake override to fix bug in Ruby 0.8.2
+ module Collector # :nodoc:
+ # Local Rake override to fix bug in Ruby 0.8.2
+ class Dir # :nodoc:
+ undef collect_file
+ def collect_file(name, suites, already_gathered) # :nodoc:
+ dir = File.dirname(File.expand_path(name))
+ $:.unshift(dir) unless $:.first == dir
+ if @req
+ @req.require(name)
+ else
+ require(name)
+ end
+ find_test_cases(already_gathered).each do |t|
+ add_suite(suites, t.suite)
+ end
+ ensure
+ $:.delete_at $:.rindex(dir)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/rake/rule_recursion_overflow_error.rb b/lib/rake/rule_recursion_overflow_error.rb
new file mode 100644
index 0000000000..da4318da9d
--- /dev/null
+++ b/lib/rake/rule_recursion_overflow_error.rb
@@ -0,0 +1,20 @@
+
+module Rake
+
+ # Error indicating a recursion overflow error in task selection.
+ class RuleRecursionOverflowError < StandardError
+ def initialize(*args)
+ super
+ @targets = []
+ end
+
+ def add_target(target)
+ @targets << target
+ end
+
+ def message
+ super + ": [" + @targets.reverse.join(' => ') + "]"
+ end
+ end
+
+end
diff --git a/lib/rake/runtest.rb b/lib/rake/runtest.rb
new file mode 100644
index 0000000000..4774b0e262
--- /dev/null
+++ b/lib/rake/runtest.rb
@@ -0,0 +1,27 @@
+require 'test/unit'
+require 'test/unit/assertions'
+require 'rake/file_list'
+
+module Rake
+ include Test::Unit::Assertions
+
+ ##
+ # Deprecated way of running tests in process, but only for Test::Unit.
+ #--
+ # TODO: Remove in rake 11
+
+ def run_tests(pattern='test/test*.rb', log_enabled=false) # :nodoc:
+ FileList.glob(pattern).each do |fn|
+ $stderr.puts fn if log_enabled
+ begin
+ require fn
+ rescue Exception => ex
+ $stderr.puts "Error in #{fn}: #{ex.message}"
+ $stderr.puts ex.backtrace
+ assert false
+ end
+ end
+ end
+
+ extend self
+end
diff --git a/lib/rake/scope.rb b/lib/rake/scope.rb
new file mode 100644
index 0000000000..dbefcea465
--- /dev/null
+++ b/lib/rake/scope.rb
@@ -0,0 +1,42 @@
+module Rake
+ class Scope < LinkedList # :nodoc: all
+
+ # Path for the scope.
+ def path
+ map { |item| item.to_s }.reverse.join(":")
+ end
+
+ # Path for the scope + the named path.
+ def path_with_task_name(task_name)
+ "#{path}:#{task_name}"
+ end
+
+ # Trim +n+ innermost scope levels from the scope. In no case will
+ # this trim beyond the toplevel scope.
+ def trim(n)
+ result = self
+ while n > 0 && ! result.empty?
+ result = result.tail
+ n -= 1
+ end
+ result
+ end
+
+ # Scope lists always end with an EmptyScope object. See Null
+ # Object Pattern)
+ class EmptyScope < EmptyLinkedList
+ @parent = Scope
+
+ def path
+ ""
+ end
+
+ def path_with_task_name(task_name)
+ task_name
+ end
+ end
+
+ # Singleton null object for an empty scope.
+ EMPTY = EmptyScope.new
+ end
+end
diff --git a/lib/rake/task.rb b/lib/rake/task.rb
new file mode 100644
index 0000000000..9bcf725523
--- /dev/null
+++ b/lib/rake/task.rb
@@ -0,0 +1,383 @@
+require 'rake/invocation_exception_mixin'
+
+module Rake
+
+ ##
+ # A Task is the basic unit of work in a Rakefile. Tasks have associated
+ # actions (possibly more than one) and a list of prerequisites. When
+ # invoked, a task will first ensure that all of its prerequisites have an
+ # opportunity to run and then it will execute its own actions.
+ #
+ # Tasks are not usually created directly using the new method, but rather
+ # use the +file+ and +task+ convenience methods.
+ #
+ class Task
+ # List of prerequisites for a task.
+ attr_reader :prerequisites
+
+ # List of actions attached to a task.
+ attr_reader :actions
+
+ # Application owning this task.
+ attr_accessor :application
+
+ # Array of nested namespaces names used for task lookup by this task.
+ attr_reader :scope
+
+ # File/Line locations of each of the task definitions for this
+ # task (only valid if the task was defined with the detect
+ # location option set).
+ attr_reader :locations
+
+ # Return task name
+ def to_s
+ name
+ end
+
+ def inspect # :nodoc:
+ "<#{self.class} #{name} => [#{prerequisites.join(', ')}]>"
+ end
+
+ # List of sources for task.
+ attr_writer :sources
+ def sources
+ if defined?(@sources)
+ @sources
+ else
+ prerequisites
+ end
+ end
+
+ # List of prerequisite tasks
+ def prerequisite_tasks
+ prerequisites.map { |pre| lookup_prerequisite(pre) }
+ end
+
+ def lookup_prerequisite(prerequisite_name) # :nodoc:
+ application[prerequisite_name, @scope]
+ end
+ private :lookup_prerequisite
+
+ # List of all unique prerequisite tasks including prerequisite tasks'
+ # prerequisites.
+ # Includes self when cyclic dependencies are found.
+ def all_prerequisite_tasks
+ seen = {}
+ collect_prerequisites(seen)
+ seen.values
+ end
+
+ def collect_prerequisites(seen) # :nodoc:
+ prerequisite_tasks.each do |pre|
+ next if seen[pre.name]
+ seen[pre.name] = pre
+ pre.collect_prerequisites(seen)
+ end
+ end
+ protected :collect_prerequisites
+
+ # First source from a rule (nil if no sources)
+ def source
+ sources.first
+ end
+
+ # Create a task named +task_name+ with no actions or prerequisites. Use
+ # +enhance+ to add actions and prerequisites.
+ def initialize(task_name, app)
+ @name = task_name.to_s
+ @prerequisites = []
+ @actions = []
+ @already_invoked = false
+ @comments = []
+ @lock = Monitor.new
+ @application = app
+ @scope = app.current_scope
+ @arg_names = nil
+ @locations = []
+ end
+
+ # Enhance a task with prerequisites or actions. Returns self.
+ def enhance(deps=nil, &block)
+ @prerequisites |= deps if deps
+ @actions << block if block_given?
+ self
+ end
+
+ # Name of the task, including any namespace qualifiers.
+ def name
+ @name.to_s
+ end
+
+ # Name of task with argument list description.
+ def name_with_args # :nodoc:
+ if arg_description
+ "#{name}#{arg_description}"
+ else
+ name
+ end
+ end
+
+ # Argument description (nil if none).
+ def arg_description # :nodoc:
+ @arg_names ? "[#{arg_names.join(',')}]" : nil
+ end
+
+ # Name of arguments for this task.
+ def arg_names
+ @arg_names || []
+ end
+
+ # Reenable the task, allowing its tasks to be executed if the task
+ # is invoked again.
+ def reenable
+ @already_invoked = false
+ end
+
+ # Clear the existing prerequisites and actions of a rake task.
+ def clear
+ clear_prerequisites
+ clear_actions
+ clear_comments
+ self
+ end
+
+ # Clear the existing prerequisites of a rake task.
+ def clear_prerequisites
+ prerequisites.clear
+ self
+ end
+
+ # Clear the existing actions on a rake task.
+ def clear_actions
+ actions.clear
+ self
+ end
+
+ # Clear the existing comments on a rake task.
+ def clear_comments
+ @comments = []
+ self
+ end
+
+ # Invoke the task if it is needed. Prerequisites are invoked first.
+ def invoke(*args)
+ task_args = TaskArguments.new(arg_names, args)
+ invoke_with_call_chain(task_args, InvocationChain::EMPTY)
+ end
+
+ # Same as invoke, but explicitly pass a call chain to detect
+ # circular dependencies.
+ def invoke_with_call_chain(task_args, invocation_chain) # :nodoc:
+ new_chain = InvocationChain.append(self, invocation_chain)
+ @lock.synchronize do
+ if application.options.trace
+ application.trace "** Invoke #{name} #{format_trace_flags}"
+ end
+ return if @already_invoked
+ @already_invoked = true
+ invoke_prerequisites(task_args, new_chain)
+ execute(task_args) if needed?
+ end
+ rescue Exception => ex
+ add_chain_to(ex, new_chain)
+ raise ex
+ end
+ protected :invoke_with_call_chain
+
+ def add_chain_to(exception, new_chain) # :nodoc:
+ exception.extend(InvocationExceptionMixin) unless
+ exception.respond_to?(:chain)
+ exception.chain = new_chain if exception.chain.nil?
+ end
+ private :add_chain_to
+
+ # Invoke all the prerequisites of a task.
+ def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
+ if application.options.always_multitask
+ invoke_prerequisites_concurrently(task_args, invocation_chain)
+ else
+ prerequisite_tasks.each { |p|
+ prereq_args = task_args.new_scope(p.arg_names)
+ p.invoke_with_call_chain(prereq_args, invocation_chain)
+ }
+ end
+ end
+
+ # Invoke all the prerequisites of a task in parallel.
+ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc:
+ futures = prerequisite_tasks.map do |p|
+ prereq_args = task_args.new_scope(p.arg_names)
+ application.thread_pool.future(p) do |r|
+ r.invoke_with_call_chain(prereq_args, invocation_chain)
+ end
+ end
+ futures.each { |f| f.value }
+ end
+
+ # Format the trace flags for display.
+ def format_trace_flags
+ flags = []
+ flags << "first_time" unless @already_invoked
+ flags << "not_needed" unless needed?
+ flags.empty? ? "" : "(" + flags.join(", ") + ")"
+ end
+ private :format_trace_flags
+
+ # Execute the actions associated with this task.
+ def execute(args=nil)
+ args ||= EMPTY_TASK_ARGS
+ if application.options.dryrun
+ application.trace "** Execute (dry run) #{name}"
+ return
+ end
+ application.trace "** Execute #{name}" if application.options.trace
+ application.enhance_with_matching_rule(name) if @actions.empty?
+ @actions.each do |act|
+ case act.arity
+ when 1
+ act.call(self)
+ else
+ act.call(self, args)
+ end
+ end
+ end
+
+ # Is this task needed?
+ def needed?
+ true
+ end
+
+ # Timestamp for this task. Basic tasks return the current time for their
+ # time stamp. Other tasks can be more sophisticated.
+ def timestamp
+ Time.now
+ end
+
+ # Add a description to the task. The description can consist of an option
+ # argument list (enclosed brackets) and an optional comment.
+ def add_description(description)
+ return unless description
+ comment = description.strip
+ add_comment(comment) if comment && ! comment.empty?
+ end
+
+ def comment=(comment) # :nodoc:
+ add_comment(comment)
+ end
+
+ def add_comment(comment) # :nodoc:
+ return if comment.nil?
+ @comments << comment unless @comments.include?(comment)
+ end
+ private :add_comment
+
+ # Full collection of comments. Multiple comments are separated by
+ # newlines.
+ def full_comment
+ transform_comments("\n")
+ end
+
+ # First line (or sentence) of all comments. Multiple comments are
+ # separated by a "/".
+ def comment
+ transform_comments(" / ") { |c| first_sentence(c) }
+ end
+
+ # Transform the list of comments as specified by the block and
+ # join with the separator.
+ def transform_comments(separator, &block)
+ if @comments.empty?
+ nil
+ else
+ block ||= lambda { |c| c }
+ @comments.map(&block).join(separator)
+ end
+ end
+ private :transform_comments
+
+ # Get the first sentence in a string. The sentence is terminated
+ # by the first period or the end of the line. Decimal points do
+ # not count as periods.
+ def first_sentence(string)
+ string.split(/\.[ \t]|\.$|\n/).first
+ end
+ private :first_sentence
+
+ # Set the names of the arguments for this task. +args+ should be
+ # an array of symbols, one for each argument name.
+ def set_arg_names(args)
+ @arg_names = args.map { |a| a.to_sym }
+ end
+
+ # Return a string describing the internal state of a task. Useful for
+ # debugging.
+ def investigation
+ result = "------------------------------\n"
+ result << "Investigating #{name}\n"
+ result << "class: #{self.class}\n"
+ result << "task needed: #{needed?}\n"
+ result << "timestamp: #{timestamp}\n"
+ result << "pre-requisites: \n"
+ prereqs = prerequisite_tasks
+ prereqs.sort! { |a, b| a.timestamp <=> b.timestamp }
+ prereqs.each do |p|
+ result << "--#{p.name} (#{p.timestamp})\n"
+ end
+ latest_prereq = prerequisite_tasks.map { |pre| pre.timestamp }.max
+ result << "latest-prerequisite time: #{latest_prereq}\n"
+ result << "................................\n\n"
+ return result
+ end
+
+ # ----------------------------------------------------------------
+ # Rake Module Methods
+ #
+ class << self
+
+ # Clear the task list. This cause rake to immediately forget all the
+ # tasks that have been assigned. (Normally used in the unit tests.)
+ def clear
+ Rake.application.clear
+ end
+
+ # List of all defined tasks.
+ def tasks
+ Rake.application.tasks
+ end
+
+ # Return a task with the given name. If the task is not currently
+ # known, try to synthesize one from the defined rules. If no rules are
+ # found, but an existing file matches the task name, assume it is a file
+ # task with no dependencies or actions.
+ def [](task_name)
+ Rake.application[task_name]
+ end
+
+ # TRUE if the task name is already defined.
+ def task_defined?(task_name)
+ Rake.application.lookup(task_name) != nil
+ end
+
+ # Define a task given +args+ and an option block. If a rule with the
+ # given name already exists, the prerequisites and actions are added to
+ # the existing task. Returns the defined task.
+ def define_task(*args, &block)
+ Rake.application.define_task(self, *args, &block)
+ end
+
+ # Define a rule for synthesizing tasks.
+ def create_rule(*args, &block)
+ Rake.application.create_rule(*args, &block)
+ end
+
+ # Apply the scope to the task name according to the rules for
+ # this kind of task. Generic tasks will accept the scope as
+ # part of the name.
+ def scope_name(scope, task_name)
+# (scope + [task_name]).join(':')
+ scope.path_with_task_name(task_name)
+ end
+
+ end # class << Rake::Task
+ end # class Rake::Task
+end
diff --git a/lib/rake/task_argument_error.rb b/lib/rake/task_argument_error.rb
new file mode 100644
index 0000000000..3e1dda64db
--- /dev/null
+++ b/lib/rake/task_argument_error.rb
@@ -0,0 +1,7 @@
+module Rake
+
+ # Error indicating an ill-formed task declaration.
+ class TaskArgumentError < ArgumentError
+ end
+
+end
diff --git a/lib/rake/task_arguments.rb b/lib/rake/task_arguments.rb
new file mode 100644
index 0000000000..fc0d657274
--- /dev/null
+++ b/lib/rake/task_arguments.rb
@@ -0,0 +1,98 @@
+module Rake
+
+ ##
+ # TaskArguments manage the arguments passed to a task.
+ #
+ class TaskArguments
+ include Enumerable
+
+ # Argument names
+ attr_reader :names
+
+ # Create a TaskArgument object with a list of argument +names+ and a set
+ # of associated +values+. +parent+ is the parent argument object.
+ def initialize(names, values, parent=nil)
+ @names = names
+ @parent = parent
+ @hash = {}
+ @values = values
+ names.each_with_index { |name, i|
+ @hash[name.to_sym] = values[i] unless values[i].nil?
+ }
+ end
+
+ # Retrieve the complete array of sequential values
+ def to_a
+ @values.dup
+ end
+
+ # Retrieve the list of values not associated with named arguments
+ def extras
+ @values[@names.length..-1] || []
+ end
+
+ # Create a new argument scope using the prerequisite argument
+ # names.
+ def new_scope(names)
+ values = names.map { |n| self[n] }
+ self.class.new(names, values + extras, self)
+ end
+
+ # Find an argument value by name or index.
+ def [](index)
+ lookup(index.to_sym)
+ end
+
+ # Specify a hash of default values for task arguments. Use the
+ # defaults only if there is no specific value for the given
+ # argument.
+ def with_defaults(defaults)
+ @hash = defaults.merge(@hash)
+ end
+
+ # Enumerates the arguments and their values
+ def each(&block)
+ @hash.each(&block)
+ end
+
+ # Extracts the argument values at +keys+
+ def values_at(*keys)
+ keys.map { |k| lookup(k) }
+ end
+
+ # Returns the value of the given argument via method_missing
+ def method_missing(sym, *args)
+ lookup(sym.to_sym)
+ end
+
+ # Returns a Hash of arguments and their values
+ def to_hash
+ @hash
+ end
+
+ def to_s # :nodoc:
+ @hash.inspect
+ end
+
+ def inspect # :nodoc:
+ to_s
+ end
+
+ # Returns true if +key+ is one of the arguments
+ def has_key?(key)
+ @hash.has_key?(key)
+ end
+
+ protected
+
+ def lookup(name) # :nodoc:
+ if @hash.has_key?(name)
+ @hash[name]
+ elsif @parent
+ @parent.lookup(name)
+ end
+ end
+ end
+
+ EMPTY_TASK_ARGS = TaskArguments.new([], []) # :nodoc:
+end
diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb
new file mode 100644
index 0000000000..221c68cec4
--- /dev/null
+++ b/lib/rake/task_manager.rb
@@ -0,0 +1,310 @@
+module Rake
+
+ # The TaskManager module is a mixin for managing tasks.
+ module TaskManager
+ # Track the last comment made in the Rakefile.
+ attr_accessor :last_description
+
+ # TODO: Remove in Rake 11
+
+ alias :last_comment :last_description # :nodoc: Backwards compatibility
+
+ def initialize # :nodoc:
+ super
+ @tasks = Hash.new
+ @rules = Array.new
+ @scope = Scope.make
+ @last_description = nil
+ end
+
+ def create_rule(*args, &block) # :nodoc:
+ pattern, args, deps = resolve_args(args)
+ pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern
+ @rules << [pattern, args, deps, block]
+ end
+
+ def define_task(task_class, *args, &block) # :nodoc:
+ task_name, arg_names, deps = resolve_args(args)
+
+ original_scope = @scope
+ if String === task_name and
+ not task_class.ancestors.include? Rake::FileTask then
+ task_name, *definition_scope = *(task_name.split(":").reverse)
+ @scope = Scope.make(*(definition_scope + @scope.to_a))
+ end
+
+ task_name = task_class.scope_name(@scope, task_name)
+ deps = [deps] unless deps.respond_to?(:to_ary)
+ deps = deps.map { |d| Rake.from_pathname(d).to_s }
+ task = intern(task_class, task_name)
+ task.set_arg_names(arg_names) unless arg_names.empty?
+ if Rake::TaskManager.record_task_metadata
+ add_location(task)
+ task.add_description(get_description(task))
+ end
+ task.enhance(deps, &block)
+ ensure
+ @scope = original_scope
+ end
+
+ # Lookup a task. Return an existing task if found, otherwise
+ # create a task of the current type.
+ def intern(task_class, task_name)
+ @tasks[task_name.to_s] ||= task_class.new(task_name, self)
+ end
+
+ # Find a matching task for +task_name+.
+ def [](task_name, scopes=nil)
+ task_name = task_name.to_s
+ self.lookup(task_name, scopes) or
+ enhance_with_matching_rule(task_name) or
+ synthesize_file_task(task_name) or
+ fail "Don't know how to build task '#{task_name}'"
+ end
+
+ def synthesize_file_task(task_name) # :nodoc:
+ return nil unless File.exist?(task_name)
+ define_task(Rake::FileTask, task_name)
+ end
+
+ # Resolve the arguments for a task/rule. Returns a triplet of
+ # [task_name, arg_name_list, prerequisites].
+ def resolve_args(args)
+ if args.last.is_a?(Hash)
+ deps = args.pop
+ resolve_args_with_dependencies(args, deps)
+ else
+ resolve_args_without_dependencies(args)
+ end
+ end
+
+ # Resolve task arguments for a task or rule when there are no
+ # dependencies declared.
+ #
+ # The patterns recognized by this argument resolving function are:
+ #
+ # task :t
+ # task :t, [:a]
+ #
+ def resolve_args_without_dependencies(args)
+ task_name = args.shift
+ if args.size == 1 && args.first.respond_to?(:to_ary)
+ arg_names = args.first.to_ary
+ else
+ arg_names = args
+ end
+ [task_name, arg_names, []]
+ end
+ private :resolve_args_without_dependencies
+
+ # Resolve task arguments for a task or rule when there are
+ # dependencies declared.
+ #
+ # The patterns recognized by this argument resolving function are:
+ #
+ # task :t => [:d]
+ # task :t, [a] => [:d]
+ #
+ def resolve_args_with_dependencies(args, hash) # :nodoc:
+ fail "Task Argument Error" if hash.size != 1
+ key, value = hash.map { |k, v| [k, v] }.first
+ if args.empty?
+ task_name = key
+ arg_names = []
+ deps = value
+ else
+ task_name = args.shift
+ arg_names = key
+ deps = value
+ end
+ deps = [deps] unless deps.respond_to?(:to_ary)
+ [task_name, arg_names, deps]
+ end
+ private :resolve_args_with_dependencies
+
+ # If a rule can be found that matches the task name, enhance the
+ # task with the prerequisites and actions from the rule. Set the
+ # source attribute of the task appropriately for the rule. Return
+ # the enhanced task or nil of no rule was found.
+ def enhance_with_matching_rule(task_name, level=0)
+ fail Rake::RuleRecursionOverflowError,
+ "Rule Recursion Too Deep" if level >= 16
+ @rules.each do |pattern, args, extensions, block|
+ if pattern.match(task_name)
+ task = attempt_rule(task_name, args, extensions, block, level)
+ return task if task
+ end
+ end
+ nil
+ rescue Rake::RuleRecursionOverflowError => ex
+ ex.add_target(task_name)
+ fail ex
+ end
+
+ # List of all defined tasks in this application.
+ def tasks
+ @tasks.values.sort_by { |t| t.name }
+ end
+
+ # List of all the tasks defined in the given scope (and its
+ # sub-scopes).
+ def tasks_in_scope(scope)
+ prefix = scope.path
+ tasks.select { |t|
+ /^#{prefix}:/ =~ t.name
+ }
+ end
+
+ # Clear all tasks in this application.
+ def clear
+ @tasks.clear
+ @rules.clear
+ end
+
+ # Lookup a task, using scope and the scope hints in the task name.
+ # This method performs straight lookups without trying to
+ # synthesize file tasks or rules. Special scope names (e.g. '^')
+ # are recognized. If no scope argument is supplied, use the
+ # current scope. Return nil if the task cannot be found.
+ def lookup(task_name, initial_scope=nil)
+ initial_scope ||= @scope
+ task_name = task_name.to_s
+ if task_name =~ /^rake:/
+ scopes = Scope.make
+ task_name = task_name.sub(/^rake:/, '')
+ elsif task_name =~ /^(\^+)/
+ scopes = initial_scope.trim($1.size)
+ task_name = task_name.sub(/^(\^+)/, '')
+ else
+ scopes = initial_scope
+ end
+ lookup_in_scope(task_name, scopes)
+ end
+
+ # Lookup the task name
+ def lookup_in_scope(name, scope)
+ loop do
+ tn = scope.path_with_task_name(name)
+ task = @tasks[tn]
+ return task if task
+ break if scope.empty?
+ scope = scope.tail
+ end
+ nil
+ end
+ private :lookup_in_scope
+
+ # Return the list of scope names currently active in the task
+ # manager.
+ def current_scope
+ @scope
+ end
+
+ # Evaluate the block in a nested namespace named +name+. Create
+ # an anonymous namespace if +name+ is nil.
+ def in_namespace(name)
+ name ||= generate_name
+ @scope = Scope.new(name, @scope)
+ ns = NameSpace.new(self, @scope)
+ yield(ns)
+ ns
+ ensure
+ @scope = @scope.tail
+ end
+
+ private
+
+ # Add a location to the locations field of the given task.
+ def add_location(task)
+ loc = find_location
+ task.locations << loc if loc
+ task
+ end
+
+ # Find the location that called into the dsl layer.
+ def find_location
+ locations = caller
+ i = 0
+ while locations[i]
+ return locations[i + 1] if locations[i] =~ /rake\/dsl_definition.rb/
+ i += 1
+ end
+ nil
+ end
+
+ # Generate an anonymous namespace name.
+ def generate_name
+ @seed ||= 0
+ @seed += 1
+ "_anon_#{@seed}"
+ end
+
+ def trace_rule(level, message) # :nodoc:
+ options.trace_output.puts "#{" " * level}#{message}" if
+ Rake.application.options.trace_rules
+ end
+
+ # Attempt to create a rule given the list of prerequisites.
+ def attempt_rule(task_name, args, extensions, block, level)
+ sources = make_sources(task_name, extensions)
+ prereqs = sources.map { |source|
+ trace_rule level, "Attempting Rule #{task_name} => #{source}"
+ if File.exist?(source) || Rake::Task.task_defined?(source)
+ trace_rule level, "(#{task_name} => #{source} ... EXIST)"
+ source
+ elsif parent = enhance_with_matching_rule(source, level + 1)
+ trace_rule level, "(#{task_name} => #{source} ... ENHANCE)"
+ parent.name
+ else
+ trace_rule level, "(#{task_name} => #{source} ... FAIL)"
+ return nil
+ end
+ }
+ task = FileTask.define_task(task_name, {args => prereqs}, &block)
+ task.sources = prereqs
+ task
+ end
+
+ # Make a list of sources from the list of file name extensions /
+ # translation procs.
+ def make_sources(task_name, extensions)
+ result = extensions.map { |ext|
+ case ext
+ when /%/
+ task_name.pathmap(ext)
+ when %r{/}
+ ext
+ when /^\./
+ task_name.ext(ext)
+ when String
+ ext
+ when Proc, Method
+ if ext.arity == 1
+ ext.call(task_name)
+ else
+ ext.call
+ end
+ else
+ fail "Don't know how to handle rule dependent: #{ext.inspect}"
+ end
+ }
+ result.flatten
+ end
+
+
+ private
+
+ # Return the current description, clearing it in the process.
+ def get_description(task)
+ desc = @last_description
+ @last_description = nil
+ desc
+ end
+
+ class << self
+ attr_accessor :record_task_metadata # :nodoc:
+ TaskManager.record_task_metadata = false
+ end
+ end
+
+end
diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb
new file mode 100644
index 0000000000..6203d9402b
--- /dev/null
+++ b/lib/rake/tasklib.rb
@@ -0,0 +1,24 @@
+require 'rake'
+
+module Rake
+
+ # Base class for Task Libraries.
+ class TaskLib
+ include Cloneable
+ include Rake::DSL
+
+ # Make a symbol by pasting two strings together.
+ #
+ # NOTE: DEPRECATED! This method is kinda stupid. I don't know why
+ # I didn't just use string interpolation. But now other task
+ # libraries depend on this so I can't remove it without breaking
+ # other people's code. So for now it stays for backwards
+ # compatibility. BUT DON'T USE IT.
+ #--
+ # TODO: Remove in Rake 11
+ def paste(a, b) # :nodoc:
+ (a.to_s + b.to_s).intern
+ end
+ end
+
+end
diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb
new file mode 100644
index 0000000000..2daa589634
--- /dev/null
+++ b/lib/rake/testtask.rb
@@ -0,0 +1,212 @@
+require 'rake'
+require 'rake/tasklib'
+
+module Rake
+
+ # Create a task that runs a set of tests.
+ #
+ # Example:
+ #
+ # Rake::TestTask.new do |t|
+ # t.libs << "test"
+ # t.test_files = FileList['test/test*.rb']
+ # t.verbose = true
+ # end
+ #
+ # If rake is invoked with a "TEST=filename" command line option,
+ # then the list of test files will be overridden to include only the
+ # filename specified on the command line. This provides an easy way
+ # to run just one test.
+ #
+ # If rake is invoked with a "TESTOPTS=options" command line option,
+ # then the given options are passed to the test process after a
+ # '--'. This allows Test::Unit options to be passed to the test
+ # suite.
+ #
+ # Examples:
+ #
+ # rake test # run tests normally
+ # rake test TEST=just_one_file.rb # run just one test file.
+ # rake test TESTOPTS="-v" # run in verbose mode
+ # rake test TESTOPTS="--runner=fox" # use the fox test runner
+ #
+ class TestTask < TaskLib
+
+ # Name of test task. (default is :test)
+ attr_accessor :name
+
+ # List of directories to added to $LOAD_PATH before running the
+ # tests. (default is 'lib')
+ attr_accessor :libs
+
+ # True if verbose test output desired. (default is false)
+ attr_accessor :verbose
+
+ # Test options passed to the test suite. An explicit
+ # TESTOPTS=opts on the command line will override this. (default
+ # is NONE)
+ attr_accessor :options
+
+ # Request that the tests be run with the warning flag set.
+ # E.g. warning=true implies "ruby -w" used to run the tests.
+ attr_accessor :warning
+
+ # Glob pattern to match test files. (default is 'test/test*.rb')
+ attr_accessor :pattern
+
+ # Style of test loader to use. Options are:
+ #
+ # * :rake -- Rake provided test loading script (default).
+ # * :testrb -- Ruby provided test loading script.
+ # * :direct -- Load tests using command line loader.
+ #
+ attr_accessor :loader
+
+ # Array of commandline options to pass to ruby when running test loader.
+ attr_accessor :ruby_opts
+
+ # Description of the test task. (default is 'Run tests')
+ attr_accessor :description
+
+ # Explicitly define the list of test files to be included in a
+ # test. +list+ is expected to be an array of file names (a
+ # FileList is acceptable). If both +pattern+ and +test_files+ are
+ # used, then the list of test files is the union of the two.
+ def test_files=(list)
+ @test_files = list
+ end
+
+ # Create a testing task.
+ def initialize(name=:test)
+ @name = name
+ @libs = ["lib"]
+ @pattern = nil
+ @options = nil
+ @test_files = nil
+ @verbose = false
+ @warning = false
+ @loader = :rake
+ @ruby_opts = []
+ @description = "Run tests" + (@name == :test ? "" : " for #{@name}")
+ yield self if block_given?
+ @pattern = 'test/test*.rb' if @pattern.nil? && @test_files.nil?
+ define
+ end
+
+ # Create the tasks defined by this task lib.
+ def define
+ desc @description
+ task @name do
+ FileUtilsExt.verbose(@verbose) do
+ args =
+ "#{ruby_opts_string} #{run_code} " +
+ "#{file_list_string} #{option_list}"
+ ruby args do |ok, status|
+ if !ok && status.respond_to?(:signaled?) && status.signaled?
+ raise SignalException.new(status.termsig)
+ elsif !ok
+ fail "Command failed with status (#{status.exitstatus}): " +
+ "[ruby #{args}]"
+ end
+ end
+ end
+ end
+ self
+ end
+
+ def option_list # :nodoc:
+ (ENV['TESTOPTS'] ||
+ ENV['TESTOPT'] ||
+ ENV['TEST_OPTS'] ||
+ ENV['TEST_OPT'] ||
+ @options ||
+ "")
+ end
+
+ def ruby_opts_string # :nodoc:
+ opts = @ruby_opts.dup
+ opts.unshift("-I\"#{lib_path}\"") unless @libs.empty?
+ opts.unshift("-w") if @warning
+ opts.join(" ")
+ end
+
+ def lib_path # :nodoc:
+ @libs.join(File::PATH_SEPARATOR)
+ end
+
+ def file_list_string # :nodoc:
+ file_list.map { |fn| "\"#{fn}\"" }.join(' ')
+ end
+
+ def file_list # :nodoc:
+ if ENV['TEST']
+ FileList[ENV['TEST']]
+ else
+ result = []
+ result += @test_files.to_a if @test_files
+ result << @pattern if @pattern
+ result
+ end
+ end
+
+ def fix # :nodoc:
+ case ruby_version
+ when '1.8.2'
+ "\"#{find_file 'rake/ruby182_test_unit_fix'}\""
+ else
+ nil
+ end || ''
+ end
+
+ def ruby_version # :nodoc:
+ RUBY_VERSION
+ end
+
+ def run_code # :nodoc:
+ case @loader
+ when :direct
+ "-e \"ARGV.each{|f| require f}\""
+ when :testrb
+ "-S testrb #{fix}"
+ when :rake
+ "#{rake_include_arg} \"#{rake_loader}\""
+ end
+ end
+
+ def rake_loader # :nodoc:
+ find_file('rake/rake_test_loader') or
+ fail "unable to find rake test loader"
+ end
+
+ def find_file(fn) # :nodoc:
+ $LOAD_PATH.each do |path|
+ file_path = File.join(path, "#{fn}.rb")
+ return file_path if File.exist? file_path
+ end
+ nil
+ end
+
+ def rake_include_arg # :nodoc:
+ spec = Gem.loaded_specs['rake']
+ if spec.respond_to?(:default_gem?) && spec.default_gem?
+ ""
+ else
+ "-I\"#{rake_lib_dir}\""
+ end
+ end
+
+ def rake_lib_dir # :nodoc:
+ find_dir('rake') or
+ fail "unable to find rake lib"
+ end
+
+ def find_dir(fn) # :nodoc:
+ $LOAD_PATH.each do |path|
+ file_path = File.join(path, "#{fn}.rb")
+ return path if File.exist? file_path
+ end
+ nil
+ end
+
+ end
+end
diff --git a/lib/rake/thread_history_display.rb b/lib/rake/thread_history_display.rb
new file mode 100644
index 0000000000..c2af9ecef5
--- /dev/null
+++ b/lib/rake/thread_history_display.rb
@@ -0,0 +1,48 @@
+require 'rake/private_reader'
+
+module Rake
+
+ class ThreadHistoryDisplay # :nodoc: all
+ include Rake::PrivateReader
+
+ private_reader :stats, :items, :threads
+
+ def initialize(stats)
+ @stats = stats
+ @items = { :_seq_ => 1 }
+ @threads = { :_seq_ => "A" }
+ end
+
+ def show
+ puts "Job History:"
+ stats.each do |stat|
+ stat[:data] ||= {}
+ rename(stat, :thread, threads)
+ rename(stat[:data], :item_id, items)
+ rename(stat[:data], :new_thread, threads)
+ rename(stat[:data], :deleted_thread, threads)
+ printf("%8d %2s %-20s %s\n",
+ (stat[:time] * 1_000_000).round,
+ stat[:thread],
+ stat[:event],
+ stat[:data].map do |k, v| "#{k}:#{v}" end.join(" "))
+ end
+ end
+
+ private
+
+ def rename(hash, key, renames)
+ if hash && hash[key]
+ original = hash[key]
+ value = renames[original]
+ unless value
+ value = renames[:_seq_]
+ renames[:_seq_] = renames[:_seq_].succ
+ renames[original] = value
+ end
+ hash[key] = value
+ end
+ end
+ end
+
+end
diff --git a/lib/rake/thread_pool.rb b/lib/rake/thread_pool.rb
new file mode 100644
index 0000000000..d2ac6e7ac2
--- /dev/null
+++ b/lib/rake/thread_pool.rb
@@ -0,0 +1,164 @@
+require 'thread'
+require 'set'
+
+require 'rake/promise'
+
+module Rake
+
+ class ThreadPool # :nodoc: all
+
+ # Creates a ThreadPool object. The +thread_count+ parameter is the size
+ # of the pool.
+ def initialize(thread_count)
+ @max_active_threads = [thread_count, 0].max
+ @threads = Set.new
+ @threads_mon = Monitor.new
+ @queue = Queue.new
+ @join_cond = @threads_mon.new_cond
+
+ @history_start_time = nil
+ @history = []
+ @history_mon = Monitor.new
+ @total_threads_in_play = 0
+ end
+
+ # Creates a future executed by the +ThreadPool+.
+ #
+ # The args are passed to the block when executing (similarly to
+ # Thread#new) The return value is an object representing
+ # a future which has been created and added to the queue in the
+ # pool. Sending #value to the object will sleep the
+ # current thread until the future is finished and will return the
+ # result (or raise an exception thrown from the future)
+ def future(*args, &block)
+ promise = Promise.new(args, &block)
+ promise.recorder = lambda { |*stats| stat(*stats) }
+
+ @queue.enq promise
+ stat :queued, :item_id => promise.object_id
+ start_thread
+ promise
+ end
+
+ # Waits until the queue of futures is empty and all threads have exited.
+ def join
+ @threads_mon.synchronize do
+ begin
+ stat :joining
+ @join_cond.wait unless @threads.empty?
+ stat :joined
+ rescue Exception => e
+ stat :joined
+ $stderr.puts e
+ $stderr.print "Queue contains #{@queue.size} items. " +
+ "Thread pool contains #{@threads.count} threads\n"
+ $stderr.print "Current Thread #{Thread.current} status = " +
+ "#{Thread.current.status}\n"
+ $stderr.puts e.backtrace.join("\n")
+ @threads.each do |t|
+ $stderr.print "Thread #{t} status = #{t.status}\n"
+ # 1.8 doesn't support Thread#backtrace
+ $stderr.puts t.backtrace.join("\n") if t.respond_to? :backtrace
+ end
+ raise e
+ end
+ end
+ end
+
+ # Enable the gathering of history events.
+ def gather_history #:nodoc:
+ @history_start_time = Time.now if @history_start_time.nil?
+ end
+
+ # Return a array of history events for the thread pool.
+ #
+ # History gathering must be enabled to be able to see the events
+ # (see #gather_history). Best to call this when the job is
+ # complete (i.e. after ThreadPool#join is called).
+ def history # :nodoc:
+ @history_mon.synchronize { @history.dup }.
+ sort_by { |i| i[:time] }.
+ each { |i| i[:time] -= @history_start_time }
+ end
+
+ # Return a hash of always collected statistics for the thread pool.
+ def statistics # :nodoc:
+ {
+ :total_threads_in_play => @total_threads_in_play,
+ :max_active_threads => @max_active_threads,
+ }
+ end
+
+ private
+
+ # processes one item on the queue. Returns true if there was an
+ # item to process, false if there was no item
+ def process_queue_item #:nodoc:
+ return false if @queue.empty?
+
+ # Even though we just asked if the queue was empty, it
+ # still could have had an item which by this statement
+ # is now gone. For this reason we pass true to Queue#deq
+ # because we will sleep indefinitely if it is empty.
+ promise = @queue.deq(true)
+ stat :dequeued, :item_id => promise.object_id
+ promise.work
+ return true
+
+ rescue ThreadError # this means the queue is empty
+ false
+ end
+
+ def safe_thread_count
+ @threads_mon.synchronize do
+ @threads.count
+ end
+ end
+
+ def start_thread # :nodoc:
+ @threads_mon.synchronize do
+ next unless @threads.count < @max_active_threads
+
+ t = Thread.new do
+ begin
+ while safe_thread_count <= @max_active_threads
+ break unless process_queue_item
+ end
+ ensure
+ @threads_mon.synchronize do
+ @threads.delete Thread.current
+ stat :ended, :thread_count => @threads.count
+ @join_cond.broadcast if @threads.empty?
+ end
+ end
+ end
+
+ @threads << t
+ stat(
+ :spawned,
+ :new_thread => t.object_id,
+ :thread_count => @threads.count)
+ @total_threads_in_play = @threads.count if
+ @threads.count > @total_threads_in_play
+ end
+ end
+
+ def stat(event, data=nil) # :nodoc:
+ return if @history_start_time.nil?
+ info = {
+ :event => event,
+ :data => data,
+ :time => Time.now,
+ :thread => Thread.current.object_id,
+ }
+ @history_mon.synchronize { @history << info }
+ end
+
+ # for testing only
+
+ def __queue__ # :nodoc:
+ @queue
+ end
+ end
+
+end
diff --git a/lib/rake/trace_output.rb b/lib/rake/trace_output.rb
new file mode 100644
index 0000000000..396096d4df
--- /dev/null
+++ b/lib/rake/trace_output.rb
@@ -0,0 +1,22 @@
+module Rake
+ module TraceOutput # :nodoc: all
+
+ # Write trace output to output stream +out+.
+ #
+ # The write is done as a single IO call (to print) to lessen the
+ # chance that the trace output is interrupted by other tasks also
+ # producing output.
+ def trace_on(out, *strings)
+ sep = $\ || "\n"
+ if strings.empty?
+ output = sep
+ else
+ output = strings.map { |s|
+ next if s.nil?
+ s =~ /#{sep}$/ ? s : s + sep
+ }.join
+ end
+ out.print(output)
+ end
+ end
+end
diff --git a/lib/rake/version.rb b/lib/rake/version.rb
new file mode 100644
index 0000000000..b9b1b2d485
--- /dev/null
+++ b/lib/rake/version.rb
@@ -0,0 +1,7 @@
+module Rake
+ module Version # :nodoc: all
+ MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split '.'
+
+ NUMBERS = [MAJOR, MINOR, BUILD, *OTHER]
+ end
+end
diff --git a/lib/rake/win32.rb b/lib/rake/win32.rb
new file mode 100644
index 0000000000..6b4873da2c
--- /dev/null
+++ b/lib/rake/win32.rb
@@ -0,0 +1,56 @@
+
+module Rake
+ require 'rake/alt_system'
+
+ # Win 32 interface methods for Rake. Windows specific functionality
+ # will be placed here to collect that knowledge in one spot.
+ module Win32 # :nodoc: all
+
+ # Error indicating a problem in locating the home directory on a
+ # Win32 system.
+ class Win32HomeError < RuntimeError
+ end
+
+ class << self
+ # True if running on a windows system.
+ def windows?
+ AltSystem::WINDOWS
+ end
+
+ # Run a command line on windows.
+ def rake_system(*cmd)
+ AltSystem.system(*cmd)
+ end
+
+ # The standard directory containing system wide rake files on
+ # Win 32 systems. Try the following environment variables (in
+ # order):
+ #
+ # * HOME
+ # * HOMEDRIVE + HOMEPATH
+ # * APPDATA
+ # * USERPROFILE
+ #
+ # If the above are not defined, the return nil.
+ def win32_system_dir #:nodoc:
+ win32_shared_path = ENV['HOME']
+ if win32_shared_path.nil? && ENV['HOMEDRIVE'] && ENV['HOMEPATH']
+ win32_shared_path = ENV['HOMEDRIVE'] + ENV['HOMEPATH']
+ end
+
+ win32_shared_path ||= ENV['APPDATA']
+ win32_shared_path ||= ENV['USERPROFILE']
+ raise Win32HomeError,
+ "Unable to determine home path environment variable." if
+ win32_shared_path.nil? or win32_shared_path.empty?
+ normalize(File.join(win32_shared_path, 'Rake'))
+ end
+
+ # Normalize a win32 path so that the slashes are all forward slashes.
+ def normalize(path)
+ path.gsub(/\\/, '/')
+ end
+
+ end
+ end
+end
diff --git a/lib/rbconfig/.document b/lib/rbconfig/.document
new file mode 100644
index 0000000000..4cea83cd0e
--- /dev/null
+++ b/lib/rbconfig/.document
@@ -0,0 +1 @@
+# these files are obsolete
diff --git a/lib/rbconfig/datadir.rb b/lib/rbconfig/datadir.rb
new file mode 100644
index 0000000000..9b7eabb473
--- /dev/null
+++ b/lib/rbconfig/datadir.rb
@@ -0,0 +1,13 @@
+#--
+# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+# All rights reserved.
+# See LICENSE.txt for permissions.
+#++
+
+# N.B. This file is used by Config.datadir in rubygems.rb, and must not be
+# removed before that require is removed. I require to avoid warning more than
+# once.
+
+warn 'rbconfig/datadir.rb and {Rb}Config.datadir is being deprecated from '\
+ 'RubyGems. It will be removed completely on or after June 2011. If you '\
+ 'wish to rely on a datadir, please use Gem.datadir.'
diff --git a/lib/rdoc.rb b/lib/rdoc.rb
index 32c7e72f25..87ed2df9b6 100644
--- a/lib/rdoc.rb
+++ b/lib/rdoc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
$DEBUG_RDOC = nil
# :main: README.rdoc
@@ -65,7 +64,7 @@ module RDoc
##
# RDoc version you are using
- VERSION = '6.0.1.1'
+ VERSION = '4.2.0.alpha'
##
# Method visibilities
@@ -110,8 +109,6 @@ module RDoc
def self.load_yaml
begin
gem 'psych'
- rescue NameError => e # --disable-gems
- raise unless e.name == :gem
rescue Gem::LoadError
end
@@ -148,7 +145,8 @@ module RDoc
autoload :KNOWN_CLASSES, 'rdoc/known_classes'
- autoload :RipperStateLex, 'rdoc/parser/ripper_state_lex'
+ autoload :RubyLex, 'rdoc/ruby_lex'
+ autoload :RubyToken, 'rdoc/ruby_token'
autoload :TokenStream, 'rdoc/token_stream'
autoload :Comment, 'rdoc/comment'
@@ -184,3 +182,4 @@ module RDoc
autoload :Require, 'rdoc/require'
end
+
diff --git a/lib/rdoc/.document b/lib/rdoc/.document
deleted file mode 100644
index 41333c6411..0000000000
--- a/lib/rdoc/.document
+++ /dev/null
@@ -1 +0,0 @@
-*.rb
diff --git a/lib/rdoc/alias.rb b/lib/rdoc/alias.rb
index 858e053049..39d2694817 100644
--- a/lib/rdoc/alias.rb
+++ b/lib/rdoc/alias.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Represent an alias, which is an old_name/new_name pair associated with a
# particular context
diff --git a/lib/rdoc/anon_class.rb b/lib/rdoc/anon_class.rb
index d02a38c2cf..c23d8e5d96 100644
--- a/lib/rdoc/anon_class.rb
+++ b/lib/rdoc/anon_class.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An anonymous class like:
#
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb
index 9b0d309653..ae022d72f8 100644
--- a/lib/rdoc/any_method.rb
+++ b/lib/rdoc/any_method.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# AnyMethod is the base class for objects representing methods
@@ -244,9 +243,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
if @block_params then
# If this method has explicit block parameters, remove any explicit
# &block
- params = params.sub(/,?\s*&\w+/, '')
+ params.sub!(/,?\s*&\w+/, '')
else
- params = params.sub(/\&(\w+)/, '\1')
+ params.sub!(/\&(\w+)/, '\1')
end
params = params.gsub(/\s+/, '').split(',').reject(&:empty?)
@@ -265,7 +264,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
elsif @params then
params = @params.gsub(/\s*\#.*/, '')
- params = params.tr_s("\n ", " ")
+ params = params.tr("\n", " ").squeeze(" ")
params = "(#{params})" unless params[0] == ?(
else
params = ''
@@ -274,11 +273,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr
if @block_params then
# If this method has explicit block parameters, remove any explicit
# &block
- params = params.sub(/,?\s*&\w+/, '')
+ params.sub!(/,?\s*&\w+/, '')
- block = @block_params.tr_s("\n ", " ")
+ block = @block_params.gsub(/\s*\#.*/, '')
+ block = block.tr("\n", " ").squeeze(" ")
if block[0] == ?(
- block = block.sub(/^\(/, '').sub(/\)/, '')
+ block.sub!(/^\(/, '').sub!(/\)/, '')
end
params << " { |#{block}| ... }"
end
diff --git a/lib/rdoc/attr.rb b/lib/rdoc/attr.rb
index f780b3b976..960e1d1107 100644
--- a/lib/rdoc/attr.rb
+++ b/lib/rdoc/attr.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An attribute created by \#attr, \#attr_reader, \#attr_writer or
# \#attr_accessor
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb
index fdd56e236b..71566f050a 100644
--- a/lib/rdoc/class_module.rb
+++ b/lib/rdoc/class_module.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# ClassModule is the base class for objects representing either a class or a
# module.
@@ -136,9 +135,7 @@ class RDoc::ClassModule < RDoc::Context
normalize_comment comment
end
- if location.parser == RDoc::Parser::C
- @comment_location.delete_if { |(_, l)| l == location }
- end
+ @comment_location.delete_if { |(_, l)| l == location }
@comment_location << [comment, location]
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb
index aeb4b4762e..4620fa586d 100644
--- a/lib/rdoc/code_object.rb
+++ b/lib/rdoc/code_object.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Base class for the RDoc code tree.
#
@@ -70,6 +69,13 @@ class RDoc::CodeObject
attr_reader :metadata
##
+ # Offset in #file where this CodeObject was defined
+ #--
+ # TODO character or byte?
+
+ attr_accessor :offset
+
+ ##
# Sets the parent CodeObject
attr_writer :parent
@@ -143,8 +149,9 @@ class RDoc::CodeObject
else
# HACK correct fix is to have #initialize create @comment
# with the correct encoding
- if String === @comment and @comment.empty? then
- @comment = RDoc::Encoding.change_encoding @comment, comment.encoding
+ if String === @comment and
+ Object.const_defined? :Encoding and @comment.empty? then
+ @comment.force_encoding comment.encoding
end
@comment
end
@@ -419,3 +426,4 @@ class RDoc::CodeObject
end
end
+
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index 434a25ac7f..f1a626cd2e 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# This file was used to load all the RDoc::CodeObject subclasses at once. Now
# autoload handles this.
diff --git a/lib/rdoc/comment.rb b/lib/rdoc/comment.rb
index 134f6440a0..33ced18b5a 100644
--- a/lib/rdoc/comment.rb
+++ b/lib/rdoc/comment.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A comment holds the text comment for a RDoc::CodeObject and provides a
# unified way of cleaning it up and parsing it into an RDoc::Markup::Document.
@@ -45,7 +44,7 @@ class RDoc::Comment
def initialize text = nil, location = nil
@location = location
- @text = text.nil? ? nil : text.dup
+ @text = text
@document = nil
@format = 'rdoc'
@@ -114,14 +113,10 @@ class RDoc::Comment
method.call_seq = seq.chomp
- else
- regexp = /^\s*:?call-seq:(.*?)(^\s*$|\z)/m
- if regexp =~ @text then
- @text = @text.sub(regexp, '')
- seq = $1
- seq.gsub!(/^\s*/, '')
- method.call_seq = seq
- end
+ elsif @text.sub!(/^\s*:?call-seq:(.*?)(^\s*$|\z)/m, '') then
+ seq = $1
+ seq.gsub!(/^\s*/, '')
+ method.call_seq = seq
end
method
@@ -137,14 +132,8 @@ class RDoc::Comment
##
# HACK dubious
- def encode! encoding
- # TODO: Remove this condition after Ruby 2.2 EOL
- if RUBY_VERSION < '2.3.0'
- @text = @text.force_encoding encoding
- else
- @text = String.new @text, encoding: encoding
- end
- self
+ def force_encoding encoding
+ @text.force_encoding encoding
end
##
@@ -210,7 +199,7 @@ class RDoc::Comment
def remove_private
# Workaround for gsub encoding for Ruby 1.9.2 and earlier
empty = ''
- empty = RDoc::Encoding.change_encoding empty, @text.encoding
+ empty.force_encoding @text.encoding if Object.const_defined? :Encoding
@text = @text.gsub(%r%^\s*([#*]?)--.*?^\s*(\1)\+\+\n?%m, empty)
@text = @text.sub(%r%^\s*[#*]?--.*%m, '')
@@ -226,7 +215,7 @@ class RDoc::Comment
@text.nil? and @document
@document = nil
- @text = text.nil? ? nil : text.dup
+ @text = text
end
##
@@ -237,3 +226,4 @@ class RDoc::Comment
end
end
+
diff --git a/lib/rdoc/constant.rb b/lib/rdoc/constant.rb
index 0c3d7505a1..97985cbf99 100644
--- a/lib/rdoc/constant.rb
+++ b/lib/rdoc/constant.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A constant
@@ -36,7 +35,7 @@ class RDoc::Constant < RDoc::CodeObject
@value = value
@is_alias_for = nil
- @visibility = :public
+ @visibility = nil
self.comment = comment
end
@@ -136,7 +135,7 @@ class RDoc::Constant < RDoc::CodeObject
initialize array[1], nil, array[5]
@full_name = array[2]
- @visibility = array[3] || :public
+ @visibility = array[3]
@is_alias_for = array[4]
# 5 handled above
# 6 handled below
diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb
index 58b1c54269..5eb86ddc92 100644
--- a/lib/rdoc/context.rb
+++ b/lib/rdoc/context.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'cgi'
##
@@ -99,11 +98,6 @@ class RDoc::Context < RDoc::CodeObject
attr_accessor :visibility
##
- # Current visibility of this line
-
- attr_writer :current_line_visibility
-
- ##
# Hash of registered methods. Attributes are also registered here,
# twice if they are RW.
@@ -153,7 +147,6 @@ class RDoc::Context < RDoc::CodeObject
@extends = []
@constants = []
@external_aliases = []
- @current_line_visibility = nil
# This Hash maps a method name to a list of unmatched aliases (aliases of
# a method not yet encountered).
@@ -239,7 +232,7 @@ class RDoc::Context < RDoc::CodeObject
if known then
known.comment = attribute.comment if known.comment.empty?
- elsif registered = @methods_hash[attribute.pretty_name + '='] and
+ elsif registered = @methods_hash[attribute.pretty_name << '='] and
RDoc::Attr === registered then
registered.rw = 'RW'
else
@@ -249,7 +242,7 @@ class RDoc::Context < RDoc::CodeObject
end
if attribute.rw.index 'W' then
- key = attribute.pretty_name + '='
+ key = attribute.pretty_name << '='
known = @methods_hash[key]
if known then
@@ -333,7 +326,7 @@ class RDoc::Context < RDoc::CodeObject
if full_name == 'BasicObject' then
superclass = nil
elsif full_name == 'Object' then
- superclass = '::BasicObject'
+ superclass = defined?(::BasicObject) ? '::BasicObject' : nil
end
# find the superclass full name
@@ -484,11 +477,7 @@ class RDoc::Context < RDoc::CodeObject
end
else
@methods_hash[key] = method
- if @current_line_visibility
- method.visibility, @current_line_visibility = @current_line_visibility, nil
- else
- method.visibility = @visibility
- end
+ method.visibility = @visibility
add_to @method_list, method
resolve_aliases method
end
@@ -762,7 +751,7 @@ class RDoc::Context < RDoc::CodeObject
attributes.default = []
sort_sections.each do |section|
- yield section, constants[section].select(&:display?).sort, attributes[section].select(&:display?).sort
+ yield section, constants[section].sort, attributes[section].sort
end
end
@@ -799,9 +788,7 @@ class RDoc::Context < RDoc::CodeObject
# Finds a constant with +name+ in this context
def find_constant_named(name)
- @constants.find do |m|
- m.name == name || m.full_name == name
- end
+ @constants.find {|m| m.name == name}
end
##
@@ -1079,7 +1066,6 @@ class RDoc::Context < RDoc::CodeObject
return if [:private, :nodoc].include? min_visibility
remove_invisible_in @method_list, min_visibility
remove_invisible_in @attributes, min_visibility
- remove_invisible_in @constants, min_visibility
end
##
@@ -1167,17 +1153,6 @@ class RDoc::Context < RDoc::CodeObject
end
##
- # Given an array +names+ of constants, set the visibility of each constant to
- # +visibility+
-
- def set_constant_visibility_for(names, visibility)
- names.each do |name|
- constant = @constants_hash[name] or next
- constant.visibility = visibility
- end
- end
-
- ##
# Sorts sections alphabetically (default) or in TomDoc fashion (none,
# Public, Internal, Deprecated)
@@ -1233,3 +1208,4 @@ class RDoc::Context < RDoc::CodeObject
autoload :Section, 'rdoc/context/section'
end
+
diff --git a/lib/rdoc/context/section.rb b/lib/rdoc/context/section.rb
index 11f9ceaf87..580f07deff 100644
--- a/lib/rdoc/context/section.rb
+++ b/lib/rdoc/context/section.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A section of documentation like:
#
@@ -43,7 +42,7 @@ class RDoc::Context::Section
@parent = parent
@title = title ? title.strip : title
- @@sequence = @@sequence.succ
+ @@sequence.succ!
@sequence = @@sequence.dup
@comments = []
@@ -58,8 +57,6 @@ class RDoc::Context::Section
self.class === other and @title == other.title
end
- alias eql? ==
-
##
# Adds +comment+ to this section
@@ -130,10 +127,6 @@ class RDoc::Context::Section
"#<%s:0x%x %p>" % [self.class, object_id, title]
end
- def hash # :nodoc:
- @title.hash
- end
-
##
# The files comments in this section come from
diff --git a/lib/rdoc/cross_reference.rb b/lib/rdoc/cross_reference.rb
index d76ebaf2d0..5b08d5202d 100644
--- a/lib/rdoc/cross_reference.rb
+++ b/lib/rdoc/cross_reference.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# RDoc::CrossReference is a reusable way to create cross references for names.
diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb
index 54ecd89816..b3515a435f 100644
--- a/lib/rdoc/encoding.rb
+++ b/lib/rdoc/encoding.rb
@@ -1,5 +1,4 @@
# coding: US-ASCII
-# frozen_string_literal: true
##
# This class is a wrapper around File IO and Encoding that helps RDoc load
@@ -23,44 +22,45 @@ module RDoc::Encoding
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
- content = RDoc::Encoding.set_encoding content
-
- begin
- encoding ||= Encoding.default_external
- orig_encoding = content.encoding
-
- if not orig_encoding.ascii_compatible? then
- content = content.encode encoding
- elsif utf8 then
- content = RDoc::Encoding.change_encoding content, Encoding::UTF_8
- content = content.encode encoding
- else
- # assume the content is in our output encoding
- content = RDoc::Encoding.change_encoding content, encoding
- end
-
- unless content.valid_encoding? then
- # revert and try to transcode
- content = RDoc::Encoding.change_encoding content, orig_encoding
- content = content.encode encoding
- end
-
- unless content.valid_encoding? then
- warn "unable to convert #{filename} to #{encoding}, skipping"
- content = nil
- end
- rescue Encoding::InvalidByteSequenceError,
- Encoding::UndefinedConversionError => e
- if force_transcode then
- content = RDoc::Encoding.change_encoding content, orig_encoding
- content = content.encode(encoding,
- :invalid => :replace,
- :undef => :replace,
- :replace => '?')
- return content
- else
- warn "unable to convert #{e.message} for #{filename}, skipping"
- return nil
+ RDoc::Encoding.set_encoding content
+
+ if Object.const_defined? :Encoding then
+ begin
+ encoding ||= Encoding.default_external
+ orig_encoding = content.encoding
+
+ if not orig_encoding.ascii_compatible? then
+ content.encode! encoding
+ elsif utf8 then
+ content.force_encoding Encoding::UTF_8
+ content.encode! encoding
+ else
+ # assume the content is in our output encoding
+ content.force_encoding encoding
+ end
+
+ unless content.valid_encoding? then
+ # revert and try to transcode
+ content.force_encoding orig_encoding
+ content.encode! encoding
+ end
+
+ unless content.valid_encoding? then
+ warn "unable to convert #{filename} to #{encoding}, skipping"
+ content = nil
+ end
+ rescue Encoding::InvalidByteSequenceError,
+ Encoding::UndefinedConversionError => e
+ if force_transcode then
+ content.force_encoding orig_encoding
+ content.encode!(encoding,
+ :invalid => :replace, :undef => :replace,
+ :replace => '?')
+ return content
+ else
+ warn "unable to convert #{e.message} for #{filename}, skipping"
+ return nil
+ end
end
end
@@ -73,23 +73,10 @@ module RDoc::Encoding
nil
end
- def self.remove_frozen_string_literal string
- string =~ /\A(?:#!.*\n)?(.*\n)/
- first_line = $1
-
- if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i
- string = string.sub first_line, ''
- end
-
- string
- end
-
##
# Sets the encoding of +string+ based on the magic comment
def self.set_encoding string
- string = remove_frozen_string_literal string
-
string =~ /\A(?:#!.*\n)?(.*\n)/
first_line = $1
@@ -97,34 +84,16 @@ module RDoc::Encoding
name = case first_line
when /^<\?xml[^?]*encoding=(["'])(.*?)\1/ then $2
when /\b(?:en)?coding[=:]\s*([^\s;]+)/i then $1
- else return string
+ else return
end
- string = string.sub first_line, ''
+ string.sub! first_line, ''
- string = remove_frozen_string_literal string
+ return unless Object.const_defined? :Encoding
enc = Encoding.find name
- string = RDoc::Encoding.change_encoding string, enc if enc
-
- string
- end
-
- ##
- # Changes encoding based on +encoding+ without converting and returns new
- # string
-
- def self.change_encoding text, encoding
- if text.kind_of? RDoc::Comment
- text.encode! encoding
- else
- # TODO: Remove this condition after Ruby 2.2 EOL
- if RUBY_VERSION < '2.3.0'
- text.force_encoding encoding
- else
- String.new text, encoding: encoding
- end
- end
+ string.force_encoding enc if enc
end
end
+
diff --git a/lib/rdoc/erb_partial.rb b/lib/rdoc/erb_partial.rb
index 8dc2c46013..910d1e0351 100644
--- a/lib/rdoc/erb_partial.rb
+++ b/lib/rdoc/erb_partial.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Allows an ERB template to be rendered in the context (binding) of an
# existing ERB template evaluation.
diff --git a/lib/rdoc/erbio.rb b/lib/rdoc/erbio.rb
index 42ce895fb3..04a89fbd34 100644
--- a/lib/rdoc/erbio.rb
+++ b/lib/rdoc/erbio.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'erb'
##
diff --git a/lib/rdoc/extend.rb b/lib/rdoc/extend.rb
index e1b182902e..efa2c69bee 100644
--- a/lib/rdoc/extend.rb
+++ b/lib/rdoc/extend.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Module extension to a class with \#extend
#
diff --git a/lib/rdoc/generator.rb b/lib/rdoc/generator.rb
index 340dcbf7ae..7d3989d42f 100644
--- a/lib/rdoc/generator.rb
+++ b/lib/rdoc/generator.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# RDoc uses generators to turn parsed source code in the form of an
# RDoc::CodeObject tree into some form of output. RDoc comes with the HTML
@@ -49,3 +48,4 @@ module RDoc::Generator
autoload :POT, 'rdoc/generator/pot'
end
+
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb
index bf4eb1f530..bd37b60668 100644
--- a/lib/rdoc/generator/darkfish.rb
+++ b/lib/rdoc/generator/darkfish.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# -*- mode: ruby; ruby-indent-level: 2; tab-width: 2 -*-
require 'erb'
@@ -63,14 +62,14 @@ class RDoc::Generator::Darkfish
BUILTIN_STYLE_ITEMS = # :nodoc:
%w[
- css/fonts.css
+ fonts.css
fonts/Lato-Light.ttf
fonts/Lato-LightItalic.ttf
fonts/Lato-Regular.ttf
fonts/Lato-RegularItalic.ttf
fonts/SourceCodePro-Bold.ttf
fonts/SourceCodePro-Regular.ttf
- css/rdoc.css
+ rdoc.css
]
##
@@ -247,7 +246,6 @@ class RDoc::Generator::Darkfish
generate_file_files
generate_table_of_contents
@json_index.generate
- @json_index.generate_gzipped
copy_static
@@ -313,16 +311,12 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- asset_rel_prefix = rel_prefix + @asset_rel_path
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
@title = @options.title
- render_template template_file, out_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here
- end
+ render_template template_file, out_file do |io| binding end
rescue => e
error = RDoc::Error.new \
"error generating index.html: #{e.message} (#{e.class})"
@@ -347,19 +341,14 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- asset_rel_prefix = rel_prefix + @asset_rel_path
- svninfo = get_svninfo(current)
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
+ svninfo = svninfo = get_svninfo(current)
@title = "#{klass.type} #{klass.full_name} - #{@options.title}"
debug_msg " rendering #{out_file}"
- render_template template_file, out_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here.local_variable_set(:svninfo, svninfo)
- here
- end
+ render_template template_file, out_file do |io| binding end
end
##
@@ -425,7 +414,8 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- asset_rel_prefix = rel_prefix + @asset_rel_path
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
unless filepage_file then
if file.text? then
@@ -442,13 +432,7 @@ class RDoc::Generator::Darkfish
@title += " - #{@options.title}"
template_file ||= filepage_file
- render_template template_file, out_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here.local_variable_set(:current, current)
- here
- end
+ render_template template_file, out_file do |io| binding end
end
rescue => e
error =
@@ -472,19 +456,14 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- current = file
- asset_rel_prefix = rel_prefix + @asset_rel_path
+ # suppress 1.9.3 warning
+ current = current = file
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
@title = "#{file.page_name} - #{@options.title}"
debug_msg " rendering #{out_file}"
- render_template template_file, out_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:current, current)
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here
- end
+ render_template template_file, out_file do |io| binding end
end
##
@@ -502,16 +481,12 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- asset_rel_prefix = ''
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = ''
@title = 'Not Found'
- render_template template_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here
- end
+ render_template template_file do |io| binding end
rescue => e
error = RDoc::Error.new \
"error generating servlet_not_found: #{e.message} (#{e.class})"
@@ -563,16 +538,12 @@ class RDoc::Generator::Darkfish
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- asset_rel_prefix = rel_prefix + @asset_rel_path
+ # suppress 1.9.3 warning
+ asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
@title = "Table of Contents - #{@options.title}"
- render_template template_file, out_file do |io|
- here = binding
- # suppress 1.9.3 warning
- here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
- here
- end
+ render_template template_file, out_file do |io| binding end
rescue => e
error = RDoc::Error.new \
"error generating table_of_contents.html: #{e.message} (#{e.class})"
@@ -725,7 +696,7 @@ class RDoc::Generator::Darkfish
out_file.dirname.mkpath
out_file.open 'w', 0644 do |io|
- io.set_encoding @options.encoding
+ io.set_encoding @options.encoding if Object.const_defined? :Encoding
@context = yield io
@@ -771,7 +742,8 @@ class RDoc::Generator::Darkfish
erbout = 'io'
else
template = file.read
- template = template.encode @options.encoding
+ template = template.encode @options.encoding if
+ Object.const_defined? :Encoding
file_var = File.basename(file).sub(/\..*/, '')
@@ -784,3 +756,4 @@ class RDoc::Generator::Darkfish
end
end
+
diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb
index e4cfe967c6..c303b2effb 100644
--- a/lib/rdoc/generator/json_index.rb
+++ b/lib/rdoc/generator/json_index.rb
@@ -1,9 +1,4 @@
-# frozen_string_literal: true
require 'json'
-begin
- require 'zlib'
-rescue LoadError
-end
##
# The JsonIndex generator is designed to complement an HTML generator and
@@ -142,7 +137,7 @@ class RDoc::Generator::JsonIndex
FileUtils.mkdir_p index_file.dirname, :verbose => $DEBUG_RDOC
index_file.open 'w', 0644 do |io|
- io.set_encoding Encoding::UTF_8
+ io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding
io.write 'var search_data = '
JSON.dump data, io, 0
@@ -158,51 +153,6 @@ class RDoc::Generator::JsonIndex
end
##
- # Compress the search_index.js file using gzip
-
- def generate_gzipped
- return if @options.dry_run or not defined?(Zlib)
-
- debug_msg "Compressing generated JSON index"
- out_dir = @base_dir + @options.op_dir
-
- search_index_file = out_dir + SEARCH_INDEX_FILE
- outfile = out_dir + "#{search_index_file}.gz"
-
- debug_msg "Reading the JSON index file from %s" % search_index_file
- search_index = search_index_file.read(mode: 'r:utf-8')
-
- debug_msg "Writing gzipped search index to %s" % outfile
-
- Zlib::GzipWriter.open(outfile) do |gz|
- gz.mtime = File.mtime(search_index_file)
- gz.orig_name = search_index_file.basename.to_s
- gz.write search_index
- gz.close
- end
-
- # GZip the rest of the js files
- Dir.chdir @template_dir do
- Dir['**/*.js'].each do |source|
- dest = out_dir + source
- outfile = out_dir + "#{dest}.gz"
-
- debug_msg "Reading the original js file from %s" % dest
- data = dest.read
-
- debug_msg "Writing gzipped file to %s" % outfile
-
- Zlib::GzipWriter.open(outfile) do |gz|
- gz.mtime = File.mtime(dest)
- gz.orig_name = dest.basename.to_s
- gz.write data
- gz.close
- end
- end
- end
- end
-
- ##
# Adds classes and modules to the index
def index_classes
@@ -295,3 +245,4 @@ class RDoc::Generator::JsonIndex
end
end
+
diff --git a/lib/rdoc/generator/markup.rb b/lib/rdoc/generator/markup.rb
index fef982d378..788e5a485d 100644
--- a/lib/rdoc/generator/markup.rb
+++ b/lib/rdoc/generator/markup.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Handle common RDoc::Markup tasks for various CodeObjects
#
diff --git a/lib/rdoc/generator/pot.rb b/lib/rdoc/generator/pot.rb
index 8a1e0b4bd0..db6f3a0354 100644
--- a/lib/rdoc/generator/pot.rb
+++ b/lib/rdoc/generator/pot.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Generates a POT file.
#
diff --git a/lib/rdoc/generator/pot/message_extractor.rb b/lib/rdoc/generator/pot/message_extractor.rb
index 313dfd2dc7..ceabc5262a 100644
--- a/lib/rdoc/generator/pot/message_extractor.rb
+++ b/lib/rdoc/generator/pot/message_extractor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Extracts message from RDoc::Store
diff --git a/lib/rdoc/generator/pot/po.rb b/lib/rdoc/generator/pot/po.rb
index 37d45e5258..6a6b5821f3 100644
--- a/lib/rdoc/generator/pot/po.rb
+++ b/lib/rdoc/generator/pot/po.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Generates a PO format text
@@ -29,8 +28,8 @@ class RDoc::Generator::POT::PO
def to_s
po = ''
sort_entries.each do |entry|
- po += "\n" unless po.empty?
- po += entry.to_s
+ po << "\n" unless po.empty?
+ po << entry.to_s
end
po
end
diff --git a/lib/rdoc/generator/pot/po_entry.rb b/lib/rdoc/generator/pot/po_entry.rb
index 3c278826f4..d4cef59ee9 100644
--- a/lib/rdoc/generator/pot/po_entry.rb
+++ b/lib/rdoc/generator/pot/po_entry.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A PO entry in PO
@@ -40,11 +39,11 @@ class RDoc::Generator::POT::POEntry
def to_s
entry = ''
- entry += format_translator_comment
- entry += format_extracted_comment
- entry += format_references
- entry += format_flags
- entry += <<-ENTRY
+ entry << format_translator_comment
+ entry << format_extracted_comment
+ entry << format_references
+ entry << format_flags
+ entry << <<-ENTRY
msgid #{format_message(@msgid)}
msgstr #{format_message(@msgstr)}
ENTRY
@@ -75,9 +74,9 @@ msgstr #{format_message(@msgstr)}
formatted_comment = ''
comment.each_line do |line|
- formatted_comment += "#{mark} #{line}"
+ formatted_comment << "#{mark} #{line}"
end
- formatted_comment += "\n" unless formatted_comment.end_with?("\n")
+ formatted_comment << "\n" unless formatted_comment.end_with?("\n")
formatted_comment
end
@@ -94,7 +93,7 @@ msgstr #{format_message(@msgstr)}
formatted_references = ''
@references.sort.each do |file, line|
- formatted_references += "\#: #{file}:#{line}\n"
+ formatted_references << "\#: #{file}:#{line}\n"
end
formatted_references
end
@@ -111,8 +110,8 @@ msgstr #{format_message(@msgstr)}
formatted_message = '""'
message.each_line do |line|
- formatted_message += "\n"
- formatted_message += "\"#{escape(line)}\""
+ formatted_message << "\n"
+ formatted_message << "\"#{escape(line)}\""
end
formatted_message
end
diff --git a/lib/rdoc/generator/ri.rb b/lib/rdoc/generator/ri.rb
index 0eef1d03f5..b9c4141a5e 100644
--- a/lib/rdoc/generator/ri.rb
+++ b/lib/rdoc/generator/ri.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Generates ri data files
diff --git a/lib/rdoc/generator/template/darkfish/_footer.rhtml b/lib/rdoc/generator/template/darkfish/_footer.rhtml
index 9791b42901..3d9526f02a 100644
--- a/lib/rdoc/generator/template/darkfish/_footer.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_footer.rhtml
@@ -1,5 +1,5 @@
<footer id="validator-badges" role="contentinfo">
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> <%= RDoc::VERSION %>.
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> <%= RDoc::VERSION %>.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>
diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml
index 8304310d4b..c87ba95096 100644
--- a/lib/rdoc/generator/template/darkfish/_head.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_head.rhtml
@@ -3,18 +3,14 @@
<title><%= h @title %></title>
<script type="text/javascript">
- var rdoc_rel_prefix = "<%= asset_rel_prefix %>/";
- var index_rel_prefix = "<%= rel_prefix %>/";
+ var rdoc_rel_prefix = "<%= rel_prefix %>/";
</script>
-<script src="<%= asset_rel_prefix %>/js/navigation.js" defer></script>
-<script src="<%= asset_rel_prefix %>/js/search.js" defer></script>
-<script src="<%= asset_rel_prefix %>/js/search_index.js" defer></script>
-<script src="<%= asset_rel_prefix %>/js/searcher.js" defer></script>
-<script src="<%= asset_rel_prefix %>/js/darkfish.js" defer></script>
+<script src="<%= asset_rel_prefix %>/js/jquery.js"></script>
+<script src="<%= asset_rel_prefix %>/js/darkfish.js"></script>
-<link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet">
-<link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet">
+<link href="<%= asset_rel_prefix %>/fonts.css" rel="stylesheet">
+<link href="<%= asset_rel_prefix %>/rdoc.css" rel="stylesheet">
<% if @options.template_stylesheets.flatten.any? then %>
<% @options.template_stylesheets.flatten.each do |stylesheet| %>
<link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet">
diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml
index 7733095086..b497000112 100644
--- a/lib/rdoc/generator/template/darkfish/class.rhtml
+++ b/lib/rdoc/generator/template/darkfish/class.rhtml
@@ -26,6 +26,8 @@
</section>
<% klass.each_section do |section, constants, attributes| %>
+ <% constants = constants.select { |const| const.display? } %>
+ <% attributes = attributes.select { |attr| attr.display? } %>
<section id="<%= section.aref %>" class="documentation-section">
<% if section.title then %>
<header class="documentation-section-title">
@@ -114,7 +116,7 @@
<% else %>
<div class="method-heading">
<span class="method-name"><%= h method.name %></span><span
- class="method-args"><%= h method.param_seq %></span>
+ class="method-args"><%= method.param_seq %></span>
<% if method.token_stream then %>
<span class="method-click-advice">click to toggle source</span>
<% end %>
diff --git a/lib/rdoc/generator/template/darkfish/css/fonts.css b/lib/rdoc/generator/template/darkfish/css/fonts.css
deleted file mode 100644
index 57302b5183..0000000000
--- a/lib/rdoc/generator/template/darkfish/css/fonts.css
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
- * with Reserved Font Name "Source". All Rights Reserved. Source is a
- * trademark of Adobe Systems Incorporated in the United States and/or other
- * countries.
- *
- * This Font Software is licensed under the SIL Open Font License, Version
- * 1.1.
- *
- * This license is copied below, and is also available with a FAQ at:
- * http://scripts.sil.org/OFL
- */
-
-@font-face {
- font-family: "Source Code Pro";
- font-style: normal;
- font-weight: 400;
- src: local("Source Code Pro"),
- local("SourceCodePro-Regular"),
- url("../fonts/SourceCodePro-Regular.ttf") format("truetype");
-}
-
-@font-face {
- font-family: "Source Code Pro";
- font-style: normal;
- font-weight: 700;
- src: local("Source Code Pro Bold"),
- local("SourceCodePro-Bold"),
- url("../fonts/SourceCodePro-Bold.ttf") format("truetype");
-}
-
-/*
- * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com),
- * with Reserved Font Name Lato.
- *
- * This Font Software is licensed under the SIL Open Font License, Version
- * 1.1.
- *
- * This license is copied below, and is also available with a FAQ at:
- * http://scripts.sil.org/OFL
- */
-
-@font-face {
- font-family: "Lato";
- font-style: normal;
- font-weight: 300;
- src: local("Lato Light"),
- local("Lato-Light"),
- url("../fonts/Lato-Light.ttf") format("truetype");
-}
-
-@font-face {
- font-family: "Lato";
- font-style: italic;
- font-weight: 300;
- src: local("Lato Light Italic"),
- local("Lato-LightItalic"),
- url("../fonts/Lato-LightItalic.ttf") format("truetype");
-}
-
-@font-face {
- font-family: "Lato";
- font-style: normal;
- font-weight: 700;
- src: local("Lato Regular"),
- local("Lato-Regular"),
- url("../fonts/Lato-Regular.ttf") format("truetype");
-}
-
-@font-face {
- font-family: "Lato";
- font-style: italic;
- font-weight: 700;
- src: local("Lato Italic"),
- local("Lato-Italic"),
- url("../fonts/Lato-RegularItalic.ttf") format("truetype");
-}
-
-/*
- * -----------------------------------------------------------
- * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
- * -----------------------------------------------------------
- *
- * PREAMBLE
- * The goals of the Open Font License (OFL) are to stimulate worldwide
- * development of collaborative font projects, to support the font creation
- * efforts of academic and linguistic communities, and to provide a free and
- * open framework in which fonts may be shared and improved in partnership
- * with others.
- *
- * The OFL allows the licensed fonts to be used, studied, modified and
- * redistributed freely as long as they are not sold by themselves. The
- * fonts, including any derivative works, can be bundled, embedded,
- * redistributed and/or sold with any software provided that any reserved
- * names are not used by derivative works. The fonts and derivatives,
- * however, cannot be released under any other type of license. The
- * requirement for fonts to remain under this license does not apply
- * to any document created using the fonts or their derivatives.
- *
- * DEFINITIONS
- * "Font Software" refers to the set of files released by the Copyright
- * Holder(s) under this license and clearly marked as such. This may
- * include source files, build scripts and documentation.
- *
- * "Reserved Font Name" refers to any names specified as such after the
- * copyright statement(s).
- *
- * "Original Version" refers to the collection of Font Software components as
- * distributed by the Copyright Holder(s).
- *
- * "Modified Version" refers to any derivative made by adding to, deleting,
- * or substituting -- in part or in whole -- any of the components of the
- * Original Version, by changing formats or by porting the Font Software to a
- * new environment.
- *
- * "Author" refers to any designer, engineer, programmer, technical
- * writer or other person who contributed to the Font Software.
- *
- * PERMISSION & CONDITIONS
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of the Font Software, to use, study, copy, merge, embed, modify,
- * redistribute, and sell modified and unmodified copies of the Font
- * Software, subject to the following conditions:
- *
- * 1) Neither the Font Software nor any of its individual components,
- * in Original or Modified Versions, may be sold by itself.
- *
- * 2) Original or Modified Versions of the Font Software may be bundled,
- * redistributed and/or sold with any software, provided that each copy
- * contains the above copyright notice and this license. These can be
- * included either as stand-alone text files, human-readable headers or
- * in the appropriate machine-readable metadata fields within text or
- * binary files as long as those fields can be easily viewed by the user.
- *
- * 3) No Modified Version of the Font Software may use the Reserved Font
- * Name(s) unless explicit written permission is granted by the corresponding
- * Copyright Holder. This restriction only applies to the primary font name as
- * presented to the users.
- *
- * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
- * Software shall not be used to promote, endorse or advertise any
- * Modified Version, except to acknowledge the contribution(s) of the
- * Copyright Holder(s) and the Author(s) or with their explicit written
- * permission.
- *
- * 5) The Font Software, modified or unmodified, in part or in whole,
- * must be distributed entirely under this license, and must not be
- * distributed under any other license. The requirement for fonts to
- * remain under this license does not apply to any document created
- * using the Font Software.
- *
- * TERMINATION
- * This license becomes null and void if any of the above conditions are
- * not met.
- *
- * DISCLAIMER
- * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
- * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
- * OTHER DEALINGS IN THE FONT SOFTWARE.
- */
-
diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css
deleted file mode 100644
index 1bdb6e6223..0000000000
--- a/lib/rdoc/generator/template/darkfish/css/rdoc.css
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- * "Darkfish" Rdoc CSS
- * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
- *
- * Author: Michael Granger <ged@FaerieMUD.org>
- *
- */
-
-/* vim: ft=css et sw=2 ts=2 sts=2 */
-/* Base Green is: #6C8C22 */
-
-.hide { display: none !important; }
-
-* { padding: 0; margin: 0; }
-
-body {
- background: #fafafa;
- font-family: Lato, sans-serif;
- font-weight: 300;
-}
-
-h1 span,
-h2 span,
-h3 span,
-h4 span,
-h5 span,
-h6 span {
- position: relative;
-
- display: none;
- padding-left: 1em;
- line-height: 0;
- vertical-align: baseline;
- font-size: 10px;
-}
-
-h1 span { top: -1.3em; }
-h2 span { top: -1.2em; }
-h3 span { top: -1.0em; }
-h4 span { top: -0.8em; }
-h5 span { top: -0.5em; }
-h6 span { top: -0.5em; }
-
-h1:hover span,
-h2:hover span,
-h3:hover span,
-h4:hover span,
-h5:hover span,
-h6:hover span {
- display: inline;
-}
-
-h1:target,
-h2:target,
-h3:target,
-h4:target,
-h5:target,
-h6:target {
- margin-left: -10px;
- border-left: 10px solid #f1edba;
-}
-
-:link,
-:visited {
- color: #6C8C22;
- text-decoration: none;
-}
-
-:link:hover,
-:visited:hover {
- border-bottom: 1px dotted #6C8C22;
-}
-
-code,
-pre {
- font-family: "Source Code Pro", Monaco, monospace;
-}
-
-/* @group Generic Classes */
-
-.initially-hidden {
- display: none;
-}
-
-#search-field {
- width: 98%;
- background: white;
- border: none;
- height: 1.5em;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- text-align: left;
-}
-#search-field:focus {
- background: #f1edba;
-}
-#search-field:-moz-placeholder,
-#search-field::-webkit-input-placeholder {
- font-weight: bold;
- color: #666;
-}
-
-.missing-docs {
- font-size: 120%;
- background: white url(images/wrench_orange.png) no-repeat 4px center;
- color: #ccc;
- line-height: 2em;
- border: 1px solid #d00;
- opacity: 1;
- padding-left: 20px;
- text-indent: 24px;
- letter-spacing: 3px;
- font-weight: bold;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
-}
-
-.target-section {
- border: 2px solid #dcce90;
- border-left-width: 8px;
- padding: 0 1em;
- background: #fff3c2;
-}
-
-/* @end */
-
-/* @group Index Page, Standalone file pages */
-.table-of-contents ul {
- margin: 1em;
- list-style: none;
-}
-
-.table-of-contents ul ul {
- margin-top: 0.25em;
-}
-
-.table-of-contents ul :link,
-.table-of-contents ul :visited {
- font-size: 16px;
-}
-
-.table-of-contents li {
- margin-bottom: 0.25em;
-}
-
-.table-of-contents li .toc-toggle {
- width: 16px;
- height: 16px;
- background: url(images/add.png) no-repeat;
-}
-
-.table-of-contents li .toc-toggle.open {
- background: url(images/delete.png) no-repeat;
-}
-
-/* @end */
-
-/* @group Top-Level Structure */
-
-nav {
- float: left;
- width: 260px;
- font-family: Helvetica, sans-serif;
- font-size: 14px;
-}
-
-main {
- display: block;
- margin: 0 2em 5em 260px;
- padding-left: 20px;
- min-width: 340px;
- font-size: 16px;
-}
-
-main h1,
-main h2,
-main h3,
-main h4,
-main h5,
-main h6 {
- font-family: Helvetica, sans-serif;
-}
-
-.table-of-contents main {
- margin-left: 2em;
-}
-
-#validator-badges {
- clear: both;
- margin: 1em 1em 2em;
- font-size: smaller;
-}
-
-/* @end */
-
-/* @group navigation */
-nav {
- margin-bottom: 1em;
-}
-
-nav .nav-section {
- margin-top: 2em;
- border-top: 2px solid #aaa;
- font-size: 90%;
- overflow: hidden;
-}
-
-nav h2 {
- margin: 0;
- padding: 2px 8px 2px 8px;
- background-color: #e8e8e8;
- color: #555;
- font-size: 125%;
- text-align: center;
-}
-
-nav h3,
-#table-of-contents-navigation {
- margin: 0;
- padding: 2px 8px 2px 8px;
- text-align: right;
- background-color: #e8e8e8;
- color: #555;
-}
-
-nav ul,
-nav dl,
-nav p {
- padding: 4px 8px 0;
- list-style: none;
-}
-
-#project-navigation .nav-section {
- margin: 0;
- border-top: 0;
-}
-
-#home-section h2 {
- text-align: center;
-}
-
-#table-of-contents-navigation {
- font-size: 1.2em;
- font-weight: bold;
- text-align: center;
-}
-
-#search-section {
- margin-top: 0;
- border-top: 0;
-}
-
-#search-field-wrapper {
- border-top: 1px solid #aaa;
- border-bottom: 1px solid #aaa;
- padding: 3px 8px;
- background-color: #e8e8e8;
- color: #555;
-}
-
-ul.link-list li {
- white-space: nowrap;
- line-height: 1.4em;
-}
-
-ul.link-list .type {
- font-size: 8px;
- text-transform: uppercase;
- color: white;
- background: #969696;
- padding: 2px 4px;
- -webkit-border-radius: 5px;
-}
-
-.calls-super {
- background: url(images/arrow_up.png) no-repeat right center;
-}
-
-/* @end */
-
-/* @group Documentation Section */
-main {
- color: #333;
-}
-
-main > h1:first-child,
-main > h2:first-child,
-main > h3:first-child,
-main > h4:first-child,
-main > h5:first-child,
-main > h6:first-child {
- margin-top: 0px;
-}
-
-main sup {
- vertical-align: super;
- font-size: 0.8em;
-}
-
-/* The heading with the class name */
-main h1[class] {
- margin-top: 0;
- margin-bottom: 1em;
- font-size: 2em;
- color: #6C8C22;
-}
-
-main h1 {
- margin: 2em 0 0.5em;
- font-size: 1.7em;
-}
-
-main h2 {
- margin: 2em 0 0.5em;
- font-size: 1.5em;
-}
-
-main h3 {
- margin: 2em 0 0.5em;
- font-size: 1.2em;
-}
-
-main h4 {
- margin: 2em 0 0.5em;
- font-size: 1.1em;
-}
-
-main h5 {
- margin: 2em 0 0.5em;
- font-size: 1em;
-}
-
-main h6 {
- margin: 2em 0 0.5em;
- font-size: 1em;
-}
-
-main p {
- margin: 0 0 0.5em;
- line-height: 1.4em;
-}
-
-main pre {
- margin: 1.2em 0.5em;
- padding: 1em;
- font-size: 0.8em;
-}
-
-main hr {
- margin: 1.5em 1em;
- border: 2px solid #ddd;
-}
-
-main blockquote {
- margin: 0 2em 1.2em 1.2em;
- padding-left: 0.5em;
- border-left: 2px solid #ddd;
-}
-
-main ol,
-main ul {
- margin: 1em 2em;
-}
-
-main li > p {
- margin-bottom: 0.5em;
-}
-
-main dl {
- margin: 1em 0.5em;
-}
-
-main dt {
- margin-bottom: 0.5em;
- font-weight: bold;
-}
-
-main dd {
- margin: 0 1em 1em 0.5em;
-}
-
-main header h2 {
- margin-top: 2em;
- border-width: 0;
- border-top: 4px solid #bbb;
- font-size: 130%;
-}
-
-main header h3 {
- margin: 2em 0 1.5em;
- border-width: 0;
- border-top: 3px solid #bbb;
- font-size: 120%;
-}
-
-.documentation-section-title {
- position: relative;
-}
-.documentation-section-title .section-click-top {
- position: absolute;
- top: 6px;
- left: 12px;
- font-size: 10px;
- color: #9b9877;
- visibility: hidden;
- padding-left: 0.5px;
-}
-
-.documentation-section-title:hover .section-click-top {
- visibility: visible;
-}
-
-.constants-list > dl {
- margin: 1em 0 2em;
- border: 0;
-}
-
-.constants-list > dl dt {
- margin-bottom: 0.75em;
- padding-left: 0;
- font-family: "Source Code Pro", Monaco, monospace;
- font-size: 110%;
-}
-
-.constants-list > dl dt a {
- color: inherit;
-}
-
-.constants-list > dl dd {
- margin: 0 0 2em 0;
- padding: 0;
- color: #666;
-}
-
-.documentation-section h2 {
- position: relative;
-}
-
-.documentation-section h2 a {
- position: absolute;
- top: 8px;
- right: 10px;
- font-size: 12px;
- color: #9b9877;
- visibility: hidden;
-}
-
-.documentation-section h2:hover a {
- visibility: visible;
-}
-
-/* @group Method Details */
-
-main .method-source-code {
- max-height: 0;
- overflow: hidden;
- transition-duration: 200ms;
- transition-delay: 0ms;
- transition-property: all;
- transition-timing-function: ease-in-out;
-}
-
-main .method-source-code.active-menu {
- max-height: 100vh;
-}
-
-main .method-description .method-calls-super {
- color: #333;
- font-weight: bold;
-}
-
-main .method-detail {
- margin-bottom: 2.5em;
- cursor: pointer;
-}
-
-main .method-detail:target {
- margin-left: -10px;
- border-left: 10px solid #f1edba;
-}
-
-main .method-heading {
- position: relative;
- font-family: "Source Code Pro", Monaco, monospace;
- font-size: 110%;
- font-weight: bold;
- color: #333;
-}
-main .method-heading :link,
-main .method-heading :visited {
- color: inherit;
-}
-main .method-click-advice {
- position: absolute;
- top: 2px;
- right: 5px;
- font-size: 12px;
- color: #9b9877;
- visibility: hidden;
- padding-right: 20px;
- line-height: 20px;
- background: url(images/zoom.png) no-repeat right top;
-}
-main .method-heading:hover .method-click-advice {
- visibility: visible;
-}
-
-main .method-alias .method-heading {
- color: #666;
-}
-
-main .method-description,
-main .aliases {
- margin-top: 0.75em;
- color: #333;
-}
-
-main .aliases {
- padding-top: 4px;
- font-style: italic;
- cursor: default;
-}
-main .method-description ul {
- margin-left: 1.5em;
-}
-
-main #attribute-method-details .method-detail:hover {
- background-color: transparent;
- cursor: default;
-}
-main .attribute-access-type {
- text-transform: uppercase;
- padding: 0 1em;
-}
-/* @end */
-
-/* @end */
-
-/* @group Source Code */
-
-pre {
- margin: 0.5em 0;
- border: 1px dashed #999;
- padding: 0.5em;
- background: #262626;
- color: white;
- overflow: auto;
-}
-
-.ruby-constant { color: #7fffd4; background: transparent; }
-.ruby-keyword { color: #00ffff; background: transparent; }
-.ruby-ivar { color: #eedd82; background: transparent; }
-.ruby-operator { color: #00ffee; background: transparent; }
-.ruby-identifier { color: #ffdead; background: transparent; }
-.ruby-node { color: #ffa07a; background: transparent; }
-.ruby-comment { color: #dc0000; background: transparent; }
-.ruby-regexp { color: #ffa07a; background: transparent; }
-.ruby-value { color: #7fffd4; background: transparent; }
-
-/* @end */
-
-
-/* @group search results */
-#search-results {
- font-family: Lato, sans-serif;
- font-weight: 300;
-}
-
-#search-results .search-match {
- font-family: Helvetica, sans-serif;
- font-weight: normal;
-}
-
-#search-results .search-selected {
- background: #e8e8e8;
- border-bottom: 1px solid transparent;
-}
-
-#search-results li {
- list-style: none;
- border-bottom: 1px solid #aaa;
- margin-bottom: 0.5em;
-}
-
-#search-results li:last-child {
- border-bottom: none;
- margin-bottom: 0;
-}
-
-#search-results li p {
- padding: 0;
- margin: 0.5em;
-}
-
-#search-results .search-namespace {
- font-weight: bold;
-}
-
-#search-results li em {
- background: yellow;
- font-style: normal;
-}
-
-#search-results pre {
- margin: 0.5em;
- font-family: "Source Code Pro", Monaco, monospace;
-}
-
-/* @end */
-
diff --git a/lib/rdoc/generator/template/darkfish/fonts.css b/lib/rdoc/generator/template/darkfish/fonts.css
new file mode 100644
index 0000000000..e9e721183b
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/fonts.css
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
+ * with Reserved Font Name "Source". All Rights Reserved. Source is a
+ * trademark of Adobe Systems Incorporated in the United States and/or other
+ * countries.
+ *
+ * This Font Software is licensed under the SIL Open Font License, Version
+ * 1.1.
+ *
+ * This license is copied below, and is also available with a FAQ at:
+ * http://scripts.sil.org/OFL
+ */
+
+@font-face {
+ font-family: "Source Code Pro";
+ font-style: normal;
+ font-weight: 400;
+ src: local("Source Code Pro"),
+ local("SourceCodePro-Regular"),
+ url("fonts/SourceCodePro-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Source Code Pro";
+ font-style: normal;
+ font-weight: 700;
+ src: local("Source Code Pro Bold"),
+ local("SourceCodePro-Bold"),
+ url("fonts/SourceCodePro-Bold.ttf") format("truetype");
+}
+
+/*
+ * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com),
+ * with Reserved Font Name Lato.
+ *
+ * This Font Software is licensed under the SIL Open Font License, Version
+ * 1.1.
+ *
+ * This license is copied below, and is also available with a FAQ at:
+ * http://scripts.sil.org/OFL
+ */
+
+@font-face {
+ font-family: "Lato";
+ font-style: normal;
+ font-weight: 300;
+ src: local("Lato Light"),
+ local("Lato-Light"),
+ url("fonts/Lato-Light.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: italic;
+ font-weight: 300;
+ src: local("Lato Light Italic"),
+ local("Lato-LightItalic"),
+ url("fonts/Lato-LightItalic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: normal;
+ font-weight: 700;
+ src: local("Lato Regular"),
+ local("Lato-Regular"),
+ url("fonts/Lato-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: italic;
+ font-weight: 700;
+ src: local("Lato Italic"),
+ local("Lato-Italic"),
+ url("fonts/Lato-RegularItalic.ttf") format("truetype");
+}
+
+/*
+ * -----------------------------------------------------------
+ * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+ * -----------------------------------------------------------
+ *
+ * PREAMBLE
+ * The goals of the Open Font License (OFL) are to stimulate worldwide
+ * development of collaborative font projects, to support the font creation
+ * efforts of academic and linguistic communities, and to provide a free and
+ * open framework in which fonts may be shared and improved in partnership
+ * with others.
+ *
+ * The OFL allows the licensed fonts to be used, studied, modified and
+ * redistributed freely as long as they are not sold by themselves. The
+ * fonts, including any derivative works, can be bundled, embedded,
+ * redistributed and/or sold with any software provided that any reserved
+ * names are not used by derivative works. The fonts and derivatives,
+ * however, cannot be released under any other type of license. The
+ * requirement for fonts to remain under this license does not apply
+ * to any document created using the fonts or their derivatives.
+ *
+ * DEFINITIONS
+ * "Font Software" refers to the set of files released by the Copyright
+ * Holder(s) under this license and clearly marked as such. This may
+ * include source files, build scripts and documentation.
+ *
+ * "Reserved Font Name" refers to any names specified as such after the
+ * copyright statement(s).
+ *
+ * "Original Version" refers to the collection of Font Software components as
+ * distributed by the Copyright Holder(s).
+ *
+ * "Modified Version" refers to any derivative made by adding to, deleting,
+ * or substituting -- in part or in whole -- any of the components of the
+ * Original Version, by changing formats or by porting the Font Software to a
+ * new environment.
+ *
+ * "Author" refers to any designer, engineer, programmer, technical
+ * writer or other person who contributed to the Font Software.
+ *
+ * PERMISSION & CONDITIONS
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Font Software, to use, study, copy, merge, embed, modify,
+ * redistribute, and sell modified and unmodified copies of the Font
+ * Software, subject to the following conditions:
+ *
+ * 1) Neither the Font Software nor any of its individual components,
+ * in Original or Modified Versions, may be sold by itself.
+ *
+ * 2) Original or Modified Versions of the Font Software may be bundled,
+ * redistributed and/or sold with any software, provided that each copy
+ * contains the above copyright notice and this license. These can be
+ * included either as stand-alone text files, human-readable headers or
+ * in the appropriate machine-readable metadata fields within text or
+ * binary files as long as those fields can be easily viewed by the user.
+ *
+ * 3) No Modified Version of the Font Software may use the Reserved Font
+ * Name(s) unless explicit written permission is granted by the corresponding
+ * Copyright Holder. This restriction only applies to the primary font name as
+ * presented to the users.
+ *
+ * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+ * Software shall not be used to promote, endorse or advertise any
+ * Modified Version, except to acknowledge the contribution(s) of the
+ * Copyright Holder(s) and the Author(s) or with their explicit written
+ * permission.
+ *
+ * 5) The Font Software, modified or unmodified, in part or in whole,
+ * must be distributed entirely under this license, and must not be
+ * distributed under any other license. The requirement for fonts to
+ * remain under this license does not apply to any document created
+ * using the Font Software.
+ *
+ * TERMINATION
+ * This license becomes null and void if any of the above conditions are
+ * not met.
+ *
+ * DISCLAIMER
+ * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+ * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+ * OTHER DEALINGS IN THE FONT SOFTWARE.
+ */
+
diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js
index 111bbf8eb9..b789a65631 100644
--- a/lib/rdoc/generator/template/darkfish/js/darkfish.js
+++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js
@@ -8,7 +8,6 @@
*/
/* Provide console simulation for firebug-less environments */
-/*
if (!("console" in window) || !("firebug" in console)) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
@@ -17,35 +16,41 @@ if (!("console" in window) || !("firebug" in console)) {
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
};
-*/
+
+
+/**
+ * Unwrap the first element that matches the given @expr@ from the targets and return them.
+ */
+$.fn.unwrap = function( expr ) {
+ return this.each( function() {
+ $(this).parents( expr ).eq( 0 ).after( this ).remove();
+ });
+};
function showSource( e ) {
var target = e.target;
- while (!target.classList.contains('method-detail')) {
- target = target.parentNode;
- }
- if (typeof target !== "undefined" && target !== null) {
- target = target.querySelector('.method-source-code');
- }
- if (typeof target !== "undefined" && target !== null) {
- target.classList.toggle('active-menu')
- }
+ var codeSections = $(target).
+ parents('.method-detail').
+ find('.method-source-code');
+
+ $(target).
+ parents('.method-detail').
+ find('.method-source-code').
+ slideToggle();
};
function hookSourceViews() {
- document.querySelectorAll('.method-heading').forEach(function (codeObject) {
- codeObject.addEventListener('click', showSource);
- });
+ $('.method-heading').click( showSource );
};
function hookSearch() {
- var input = document.querySelector('#search-field');
- var result = document.querySelector('#search-results');
- result.classList.remove("initially-hidden");
+ var input = $('#search-field').eq(0);
+ var result = $('#search-results').eq(0);
+ $(result).show();
- var search_section = document.querySelector('#search-section');
- search_section.classList.remove("initially-hidden");
+ var search_section = $('#search-section').get(0);
+ $(search_section).show();
var search = new Search(search_data, input, result);
@@ -54,7 +59,7 @@ function hookSearch() {
var html = '';
// TODO add relative path to <script> per-page
- html += '<p class="search-match"><a href="' + index_rel_prefix + result.path + '">' + this.hlt(result.title);
+ html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
if (result.params)
html += '<span class="params">' + result.params + '</span>';
html += '</a>';
@@ -72,13 +77,85 @@ function hookSearch() {
}
search.select = function(result) {
- window.location.href = result.firstChild.firstChild.href;
+ var result_element = result.get(0);
+ window.location.href = result_element.firstChild.firstChild.href;
}
search.scrollIntoView = search.scrollInWindow;
};
-document.addEventListener('DOMContentLoaded', function() {
+function highlightTarget( anchor ) {
+ console.debug( "Highlighting target '%s'.", anchor );
+
+ $("a[name]").each( function() {
+ if ( $(this).attr("name") == anchor ) {
+ if ( !$(this).parent().parent().hasClass('target-section') ) {
+ console.debug( "Wrapping the target-section" );
+ $('div.method-detail').unwrap( 'div.target-section' );
+ $(this).parent().wrap( '<div class="target-section"></div>' );
+ } else {
+ console.debug( "Already wrapped." );
+ }
+ }
+ });
+};
+
+function highlightLocationTarget() {
+ console.debug( "Location hash: %s", window.location.hash );
+ if ( ! window.location.hash || window.location.hash.length == 0 ) return;
+
+ var anchor = window.location.hash.substring(1);
+ console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
+
+ highlightTarget( anchor );
+};
+
+function highlightClickTarget( event ) {
+ console.debug( "Highlighting click target for event %o", event.target );
+ try {
+ var anchor = $(event.target).attr( 'href' ).substring(1);
+ console.debug( "Found target anchor: %s", anchor );
+ highlightTarget( anchor );
+ } catch ( err ) {
+ console.error( "Exception while highlighting: %o", err );
+ };
+};
+
+function loadAsync(path, success) {
+ $.ajax({
+ url: rdoc_rel_prefix + path,
+ dataType: 'script',
+ success: success,
+ cache: true
+ });
+};
+
+$(document).ready( function() {
hookSourceViews();
- hookSearch();
+ highlightLocationTarget();
+ $('ul.link-list a').bind( "click", highlightClickTarget );
+
+ var search_scripts_loaded = {
+ navigation_loaded: false,
+ search_loaded: false,
+ search_index_loaded: false,
+ searcher_loaded: false,
+ }
+
+ var search_success_function = function(variable) {
+ return (function (data, status, xhr) {
+ search_scripts_loaded[variable] = true;
+
+ if (search_scripts_loaded['navigation_loaded'] == true &&
+ search_scripts_loaded['search_loaded'] == true &&
+ search_scripts_loaded['search_index_loaded'] == true &&
+ search_scripts_loaded['searcher_loaded'] == true)
+ hookSearch();
+ });
+ }
+
+ loadAsync('js/navigation.js', search_success_function('navigation_loaded'));
+ loadAsync('js/search.js', search_success_function('search_loaded'));
+ loadAsync('js/search_index.js', search_success_function('search_index_loaded'));
+ loadAsync('js/searcher.js', search_success_function('searcher_loaded'));
});
diff --git a/lib/rdoc/generator/template/darkfish/js/jquery.js b/lib/rdoc/generator/template/darkfish/js/jquery.js
new file mode 100644
index 0000000000..628ed9b316
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/js/jquery.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */
+(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bA.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bW(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bP,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bW(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bW(a,c,d,e,"*",g));return l}function bV(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bL),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function by(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bt:bu;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bf(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function V(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(Q.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(w,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:H?function(a){return a==null?"":H.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(!b)return-1;if(I)return I.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u,v;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete
+t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=D;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=D;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||C,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+M(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(V(this,a,!1),"not",a)},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bb.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bl)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean
+(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bk(k[i]);else bk(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bc.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=br.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bv)return bv(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return by(a,b,d);f.swap(a,bs,function(){e=by(a,b,d)});return e}},set:function(a,b){if(!bp.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cr(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cq("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cq("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file
diff --git a/lib/rdoc/generator/template/darkfish/js/search.js b/lib/rdoc/generator/template/darkfish/js/search.js
index b558ca5b4f..60ac295e6c 100644
--- a/lib/rdoc/generator/template/darkfish/js/search.js
+++ b/lib/rdoc/generator/template/darkfish/js/search.js
@@ -1,29 +1,29 @@
Search = function(data, input, result) {
this.data = data;
- this.input = input;
- this.result = result;
+ this.$input = $(input);
+ this.$result = $(result);
- this.current = null;
- this.view = this.result.parentNode;
+ this.$current = null;
+ this.$view = this.$result.parent();
this.searcher = new Searcher(data.index);
this.init();
}
-Search.prototype = Object.assign({}, Navigation, new function() {
+Search.prototype = $.extend({}, Navigation, new function() {
var suid = 1;
this.init = function() {
var _this = this;
var observer = function(e) {
- switch(e.keyCode) {
+ switch(e.originalEvent.keyCode) {
case 38: // Event.KEY_UP
case 40: // Event.KEY_DOWN
return;
}
- _this.search(_this.input.value);
+ _this.search(_this.$input[0].value);
};
- this.input.addEventListener('keyup', observer);
- this.input.addEventListener('click', observer); // mac's clear field
+ this.$input.keyup(observer);
+ this.$input.click(observer); // mac's clear field
this.searcher.ready(function(results, isLast) {
_this.addResults(results, isLast);
@@ -34,7 +34,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
}
this.search = function(value, selectFirstMatch) {
- value = value.trim().toLowerCase();
+ value = jQuery.trim(value).toLowerCase();
if (value) {
this.setNavigationActive(true);
} else {
@@ -43,23 +43,23 @@ Search.prototype = Object.assign({}, Navigation, new function() {
if (value == '') {
this.lastQuery = value;
- this.result.innerHTML = '';
- this.result.setAttribute('aria-expanded', 'false');
+ this.$result.empty();
+ this.$result.attr('aria-expanded', 'false');
this.setNavigationActive(false);
} else if (value != this.lastQuery) {
this.lastQuery = value;
- this.result.setAttribute('aria-busy', 'true');
- this.result.setAttribute('aria-expanded', 'true');
+ this.$result.attr('aria-busy', 'true');
+ this.$result.attr('aria-expanded', 'true');
this.firstRun = true;
this.searcher.find(value);
}
}
this.addResults = function(results, isLast) {
- var target = this.result;
+ var target = this.$result.get(0);
if (this.firstRun && (results.length > 0 || isLast)) {
- this.current = null;
- this.result.innerHTML = '';
+ this.$current = null;
+ this.$result.empty();
}
for (var i=0, l = results.length; i < l; i++) {
@@ -70,26 +70,25 @@ Search.prototype = Object.assign({}, Navigation, new function() {
if (this.firstRun && results.length > 0) {
this.firstRun = false;
- this.current = target.firstChild;
- this.current.classList.add('search-selected');
+ this.$current = $(target.firstChild);
+ this.$current.addClass('search-selected');
}
- //TODO: ECMAScript
- //if (jQuery.browser.msie) this.$element[0].className += '';
+ if (jQuery.browser.msie) this.$element[0].className += '';
- if (isLast) this.result.setAttribute('aria-busy', 'false');
+ if (isLast) this.$result.attr('aria-busy', 'false');
}
this.move = function(isDown) {
- if (!this.current) return;
- var next = isDown ? this.current.nextElementSibling : this.current.previousElementSibling;
- if (next) {
- this.current.classList.remove('search-selected');
- next.classList.add('search-selected');
- this.input.setAttribute('aria-activedescendant', next.getAttribute('id'));
- this.scrollIntoView(next, this.view);
- this.current = next;
- this.input.value = next.firstChild.firstChild.text;
- this.input.select();
+ if (!this.$current) return;
+ var $next = this.$current[isDown ? 'next' : 'prev']();
+ if ($next.length) {
+ this.$current.removeClass('search-selected');
+ $next.addClass('search-selected');
+ this.$input.attr('aria-activedescendant', $next.attr('id'));
+ this.scrollIntoView($next[0], this.$view[0]);
+ this.$current = $next;
+ this.$input.val($next[0].firstChild.firstChild.text);
+ this.$input.select();
}
return true;
}
diff --git a/lib/rdoc/generator/template/darkfish/rdoc.css b/lib/rdoc/generator/template/darkfish/rdoc.css
new file mode 100644
index 0000000000..2f4dca7e08
--- /dev/null
+++ b/lib/rdoc/generator/template/darkfish/rdoc.css
@@ -0,0 +1,590 @@
+/*
+ * "Darkfish" Rdoc CSS
+ * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
+ *
+ * Author: Michael Granger <ged@FaerieMUD.org>
+ *
+ */
+
+/* vim: ft=css et sw=2 ts=2 sts=2 */
+/* Base Green is: #6C8C22 */
+
+* { padding: 0; margin: 0; }
+
+body {
+ background: #fafafa;
+ font-family: Lato, sans-serif;
+ font-weight: 300;
+}
+
+h1 span,
+h2 span,
+h3 span,
+h4 span,
+h5 span,
+h6 span {
+ position: relative;
+
+ display: none;
+ padding-left: 1em;
+ line-height: 0;
+ vertical-align: baseline;
+ font-size: 10px;
+}
+
+h1 span { top: -1.3em; }
+h2 span { top: -1.2em; }
+h3 span { top: -1.0em; }
+h4 span { top: -0.8em; }
+h5 span { top: -0.5em; }
+h6 span { top: -0.5em; }
+
+h1:hover span,
+h2:hover span,
+h3:hover span,
+h4:hover span,
+h5:hover span,
+h6:hover span {
+ display: inline;
+}
+
+:link,
+:visited {
+ color: #6C8C22;
+ text-decoration: none;
+}
+
+:link:hover,
+:visited:hover {
+ border-bottom: 1px dotted #6C8C22;
+}
+
+code,
+pre {
+ font-family: "Source Code Pro", Monaco, monospace;
+}
+
+/* @group Generic Classes */
+
+.initially-hidden {
+ display: none;
+}
+
+#search-field {
+ width: 98%;
+ background: white;
+ border: none;
+ height: 1.5em;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ text-align: left;
+}
+#search-field:focus {
+ background: #f1edba;
+}
+#search-field:-moz-placeholder,
+#search-field::-webkit-input-placeholder {
+ font-weight: bold;
+ color: #666;
+}
+
+.missing-docs {
+ font-size: 120%;
+ background: white url(images/wrench_orange.png) no-repeat 4px center;
+ color: #ccc;
+ line-height: 2em;
+ border: 1px solid #d00;
+ opacity: 1;
+ padding-left: 20px;
+ text-indent: 24px;
+ letter-spacing: 3px;
+ font-weight: bold;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+.target-section {
+ border: 2px solid #dcce90;
+ border-left-width: 8px;
+ padding: 0 1em;
+ background: #fff3c2;
+}
+
+/* @end */
+
+/* @group Index Page, Standalone file pages */
+.table-of-contents ul {
+ margin: 1em;
+ list-style: none;
+}
+
+.table-of-contents ul ul {
+ margin-top: 0.25em;
+}
+
+.table-of-contents ul :link,
+.table-of-contents ul :visited {
+ font-size: 16px;
+}
+
+.table-of-contents li {
+ margin-bottom: 0.25em;
+}
+
+.table-of-contents li .toc-toggle {
+ width: 16px;
+ height: 16px;
+ background: url(images/add.png) no-repeat;
+}
+
+.table-of-contents li .toc-toggle.open {
+ background: url(images/delete.png) no-repeat;
+}
+
+/* @end */
+
+/* @group Top-Level Structure */
+
+nav {
+ float: left;
+ width: 260px;
+ font-family: Helvetica, sans-serif;
+ font-size: 14px;
+}
+
+main {
+ display: block;
+ margin: 0 2em 5em 260px;
+ padding-left: 20px;
+ min-width: 340px;
+ font-size: 16px;
+}
+
+main h1,
+main h2,
+main h3,
+main h4,
+main h5,
+main h6 {
+ font-family: Helvetica, sans-serif;
+}
+
+.table-of-contents main {
+ margin-left: 2em;
+}
+
+#validator-badges {
+ clear: both;
+ margin: 1em 1em 2em;
+ font-size: smaller;
+}
+
+/* @end */
+
+/* @group navigation */
+nav {
+ margin-bottom: 1em;
+}
+
+nav .nav-section {
+ margin-top: 2em;
+ border-top: 2px solid #aaa;
+ font-size: 90%;
+ overflow: hidden;
+}
+
+nav h2 {
+ margin: 0;
+ padding: 2px 8px 2px 8px;
+ background-color: #e8e8e8;
+ color: #555;
+ font-size: 125%;
+ text-align: center;
+}
+
+nav h3,
+#table-of-contents-navigation {
+ margin: 0;
+ padding: 2px 8px 2px 8px;
+ text-align: right;
+ background-color: #e8e8e8;
+ color: #555;
+}
+
+nav ul,
+nav dl,
+nav p {
+ padding: 4px 8px 0;
+ list-style: none;
+}
+
+#project-navigation .nav-section {
+ margin: 0;
+ border-top: 0;
+}
+
+#home-section h2 {
+ text-align: center;
+}
+
+#table-of-contents-navigation {
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
+}
+
+#search-section {
+ margin-top: 0;
+ border-top: 0;
+}
+
+#search-field-wrapper {
+ border-top: 1px solid #aaa;
+ border-bottom: 1px solid #aaa;
+ padding: 3px 8px;
+ background-color: #e8e8e8;
+ color: #555;
+}
+
+ul.link-list li {
+ white-space: nowrap;
+ line-height: 1.4em;
+}
+
+ul.link-list .type {
+ font-size: 8px;
+ text-transform: uppercase;
+ color: white;
+ background: #969696;
+ padding: 2px 4px;
+ -webkit-border-radius: 5px;
+}
+
+.calls-super {
+ background: url(images/arrow_up.png) no-repeat right center;
+}
+
+/* @end */
+
+/* @group Documentation Section */
+main {
+ color: #333;
+}
+
+main > h1:first-child,
+main > h2:first-child,
+main > h3:first-child,
+main > h4:first-child,
+main > h5:first-child,
+main > h6:first-child {
+ margin-top: 0px;
+}
+
+main sup {
+ vertical-align: super;
+ font-size: 0.8em;
+}
+
+/* The heading with the class name */
+main h1[class] {
+ margin-top: 0;
+ margin-bottom: 1em;
+ font-size: 2em;
+ color: #6C8C22;
+}
+
+main h1 {
+ margin: 2em 0 0.5em;
+ font-size: 1.7em;
+}
+
+main h2 {
+ margin: 2em 0 0.5em;
+ font-size: 1.5em;
+}
+
+main h3 {
+ margin: 2em 0 0.5em;
+ font-size: 1.2em;
+}
+
+main h4 {
+ margin: 2em 0 0.5em;
+ font-size: 1.1em;
+}
+
+main h5 {
+ margin: 2em 0 0.5em;
+ font-size: 1em;
+}
+
+main h6 {
+ margin: 2em 0 0.5em;
+ font-size: 1em;
+}
+
+main p {
+ margin: 0 0 0.5em;
+ line-height: 1.4em;
+}
+
+main pre {
+ margin: 1.2em 0.5em;
+ padding: 1em;
+ font-size: 0.8em;
+}
+
+main hr {
+ margin: 1.5em 1em;
+ border: 2px solid #ddd;
+}
+
+main blockquote {
+ margin: 0 2em 1.2em 1.2em;
+ padding-left: 0.5em;
+ border-left: 2px solid #ddd;
+}
+
+main ol,
+main ul {
+ margin: 1em 2em;
+}
+
+main li > p {
+ margin-bottom: 0.5em;
+}
+
+main dl {
+ margin: 1em 0.5em;
+}
+
+main dt {
+ margin-bottom: 0.5em;
+ font-weight: bold;
+}
+
+main dd {
+ margin: 0 1em 1em 0.5em;
+}
+
+main header h2 {
+ margin-top: 2em;
+ border-width: 0;
+ border-top: 4px solid #bbb;
+ font-size: 130%;
+}
+
+main header h3 {
+ margin: 2em 0 1.5em;
+ border-width: 0;
+ border-top: 3px solid #bbb;
+ font-size: 120%;
+}
+
+.documentation-section-title {
+ position: relative;
+}
+.documentation-section-title .section-click-top {
+ position: absolute;
+ top: 6px;
+ left: 12px;
+ font-size: 10px;
+ color: #9b9877;
+ visibility: hidden;
+ padding-left: 0.5px;
+}
+
+.documentation-section-title:hover .section-click-top {
+ visibility: visible;
+}
+
+.constants-list > dl {
+ margin: 1em 0 2em;
+ border: 0;
+}
+
+.constants-list > dl dt {
+ margin-bottom: 0.75em;
+ padding-left: 0;
+ font-family: "Source Code Pro", Monaco, monospace;
+ font-size: 110%;
+}
+
+.constants-list > dl dt a {
+ color: inherit;
+}
+
+.constants-list > dl dd {
+ margin: 0 0 2em 0;
+ padding: 0;
+ color: #666;
+}
+
+.documentation-section h2 {
+ position: relative;
+}
+
+.documentation-section h2 a {
+ position: absolute;
+ top: 8px;
+ right: 10px;
+ font-size: 12px;
+ color: #9b9877;
+ visibility: hidden;
+}
+
+.documentation-section h2:hover a {
+ visibility: visible;
+}
+
+/* @group Method Details */
+
+main .method-source-code {
+ display: none;
+}
+
+main .method-description .method-calls-super {
+ color: #333;
+ font-weight: bold;
+}
+
+main .method-detail {
+ margin-bottom: 2.5em;
+ cursor: pointer;
+}
+
+main .method-detail:target {
+ margin-left: -10px;
+ border-left: 10px solid #f1edba;
+}
+
+main .method-heading {
+ position: relative;
+ font-family: "Source Code Pro", Monaco, monospace;
+ font-size: 110%;
+ font-weight: bold;
+ color: #333;
+}
+main .method-heading :link,
+main .method-heading :visited {
+ color: inherit;
+}
+main .method-click-advice {
+ position: absolute;
+ top: 2px;
+ right: 5px;
+ font-size: 12px;
+ color: #9b9877;
+ visibility: hidden;
+ padding-right: 20px;
+ line-height: 20px;
+ background: url(images/zoom.png) no-repeat right top;
+}
+main .method-heading:hover .method-click-advice {
+ visibility: visible;
+}
+
+main .method-alias .method-heading {
+ color: #666;
+}
+
+main .method-description,
+main .aliases {
+ margin-top: 0.75em;
+ color: #333;
+}
+
+main .aliases {
+ padding-top: 4px;
+ font-style: italic;
+ cursor: default;
+}
+main .method-description ul {
+ margin-left: 1.5em;
+}
+
+main #attribute-method-details .method-detail:hover {
+ background-color: transparent;
+ cursor: default;
+}
+main .attribute-access-type {
+ text-transform: uppercase;
+ padding: 0 1em;
+}
+/* @end */
+
+/* @end */
+
+/* @group Source Code */
+
+pre {
+ margin: 0.5em 0;
+ border: 1px dashed #999;
+ padding: 0.5em;
+ background: #262626;
+ color: white;
+ overflow: auto;
+}
+
+.ruby-constant { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar { color: #eedd82; background: transparent; }
+.ruby-operator { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #dc0000; background: transparent; }
+.ruby-regexp { color: #ffa07a; background: transparent; }
+.ruby-value { color: #7fffd4; background: transparent; }
+
+/* @end */
+
+
+/* @group search results */
+#search-results {
+ font-family: Lato, sans-serif;
+ font-weight: 300;
+}
+
+#search-results .search-match {
+ font-family: Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+#search-results .search-selected {
+ background: #e8e8e8;
+ border-bottom: 1px solid transparent;
+}
+
+#search-results li {
+ list-style: none;
+ border-bottom: 1px solid #aaa;
+ margin-bottom: 0.5em;
+}
+
+#search-results li:last-child {
+ border-bottom: none;
+ margin-bottom: 0;
+}
+
+#search-results li p {
+ padding: 0;
+ margin: 0.5em;
+}
+
+#search-results .search-namespace {
+ font-weight: bold;
+}
+
+#search-results li em {
+ background: yellow;
+ font-style: normal;
+}
+
+#search-results pre {
+ margin: 0.5em;
+ font-family: "Source Code Pro", Monaco, monospace;
+}
+
+/* @end */
+
diff --git a/lib/rdoc/generator/template/json_index/js/navigation.js b/lib/rdoc/generator/template/json_index/js/navigation.js
index 4866fff819..e41268123e 100644
--- a/lib/rdoc/generator/template/json_index/js/navigation.js
+++ b/lib/rdoc/generator/template/json_index/js/navigation.js
@@ -10,8 +10,10 @@ Navigation = new function() {
this.initNavigation = function() {
var _this = this;
- document.addEventListener('keydown', function(e) {
+ $(document).keydown(function(e) {
_this.onkeydown(e);
+ }).keyup(function(e) {
+ _this.onkeyup(e);
});
this.navigationActive = true;
@@ -19,6 +21,20 @@ Navigation = new function() {
this.setNavigationActive = function(state) {
this.navigationActive = state;
+ this.clearMoveTimeout();
+ }
+
+ this.onkeyup = function(e) {
+ if (!this.navigationActive) return;
+
+ switch(e.keyCode) {
+ case 37: //Event.KEY_LEFT:
+ case 38: //Event.KEY_UP:
+ case 39: //Event.KEY_RIGHT:
+ case 40: //Event.KEY_DOWN:
+ this.clearMoveTimeout();
+ break;
+ }
}
this.onkeydown = function(e) {
@@ -30,6 +46,7 @@ Navigation = new function() {
case 38: //Event.KEY_UP:
if (e.keyCode == 38 || e.ctrlKey) {
if (this.moveUp()) e.preventDefault();
+ this.startMoveTimeout(false);
}
break;
case 39: //Event.KEY_RIGHT:
@@ -38,15 +55,34 @@ Navigation = new function() {
case 40: //Event.KEY_DOWN:
if (e.keyCode == 40 || e.ctrlKey) {
if (this.moveDown()) e.preventDefault();
+ this.startMoveTimeout(true);
}
break;
case 13: //Event.KEY_RETURN:
- if (this.current)
+ if (this.$current)
e.preventDefault();
- this.select(this.current);
+ this.select(this.$current);
break;
}
- if (e.ctrlKey && e.shiftKey) this.select(this.current);
+ if (e.ctrlKey && e.shiftKey) this.select(this.$current);
+ }
+
+ this.clearMoveTimeout = function() {
+ clearTimeout(this.moveTimeout);
+ this.moveTimeout = null;
+ }
+
+ this.startMoveTimeout = function(isDown) {
+ if (!$.browser.mozilla && !$.browser.opera) return;
+ if (this.moveTimeout) this.clearMoveTimeout();
+ var _this = this;
+
+ var go = function() {
+ if (!_this.moveTimeout) return;
+ _this[isDown ? 'moveDown' : 'moveUp']();
+ _this.moveTimout = setTimeout(go, 100);
+ }
+ this.moveTimeout = setTimeout(go, 200);
}
this.moveRight = function() {
diff --git a/lib/rdoc/generator/template/json_index/js/searcher.js b/lib/rdoc/generator/template/json_index/js/searcher.js
index e200a168b0..f854b541d0 100644
--- a/lib/rdoc/generator/template/json_index/js/searcher.js
+++ b/lib/rdoc/generator/template/json_index/js/searcher.js
@@ -51,20 +51,20 @@ Searcher.prototype = new function() {
/* ----- Utilities ------ */
function splitQuery(query) {
- return query.split(/(\s+|::?|\(\)?)/).filter(function(string) {
- return string.match(/\S/);
+ return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
+ return string.match(/\S/)
});
}
function buildRegexps(queries) {
- return queries.map(function(query) {
- return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i');
+ return jQuery.map(queries, function(query) {
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
});
}
function buildHilighters(queries) {
- return queries.map(function(query) {
- return query.split('').map(function(l, i) {
+ return jQuery.map(queries, function(query) {
+ return jQuery.map(query.split(''), function(l, i) {
return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
}).join('');
});
@@ -172,7 +172,6 @@ Searcher.prototype = new function() {
result.path = info[2];
result.params = info[3];
result.snippet = info[4];
- result.badge = info[6];
return result;
}
@@ -221,9 +220,9 @@ Searcher.prototype = new function() {
}
function triggerResults(results, isLast) {
- this.handlers.forEach(function(fn) {
+ jQuery.each(this.handlers, function(i, fn) {
fn.call(this, results, isLast)
- });
+ })
}
}
diff --git a/lib/rdoc/ghost_method.rb b/lib/rdoc/ghost_method.rb
index 2488feb9d7..7eb2d93167 100644
--- a/lib/rdoc/ghost_method.rb
+++ b/lib/rdoc/ghost_method.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# GhostMethod represents a method referenced only by a comment
diff --git a/lib/rdoc/i18n.rb b/lib/rdoc/i18n.rb
index 4cb5986155..4cccbc66d3 100644
--- a/lib/rdoc/i18n.rb
+++ b/lib/rdoc/i18n.rb
@@ -1,6 +1,5 @@
-# frozen_string_literal: true
##
-# This module provides i18n related features.
+# This module provides i18n realated features.
module RDoc::I18n
diff --git a/lib/rdoc/i18n/locale.rb b/lib/rdoc/i18n/locale.rb
index 6a70d6c986..e98732e086 100644
--- a/lib/rdoc/i18n/locale.rb
+++ b/lib/rdoc/i18n/locale.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A message container for a locale.
#
@@ -92,7 +91,7 @@ class RDoc::I18n::Locale
end
##
- # Translates the +message+ into locale. If there is no translation
+ # Translates the +message+ into locale. If there is no tranlsation
# messages for +message+ in locale, +message+ itself is returned.
def translate(message)
diff --git a/lib/rdoc/i18n/text.rb b/lib/rdoc/i18n/text.rb
index 7ea6664442..ee5c66a1ff 100644
--- a/lib/rdoc/i18n/text.rb
+++ b/lib/rdoc/i18n/text.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An i18n supported text.
#
@@ -46,9 +45,9 @@ class RDoc::I18n::Text
parse do |part|
case part[:type]
when :paragraph
- translated_text += locale.translate(part[:paragraph])
+ translated_text << locale.translate(part[:paragraph])
when :empty_line
- translated_text += part[:line]
+ translated_text << part[:line]
else
raise "should not reach here: unexpected type: #{type}"
end
@@ -69,14 +68,14 @@ class RDoc::I18n::Text
if paragraph.empty?
emit_empty_line_event(line, line_no, &block)
else
- paragraph += line
+ paragraph << line
emit_paragraph_event(paragraph, paragraph_start_line, line_no,
&block)
paragraph = ''
end
else
paragraph_start_line = line_no if paragraph.empty?
- paragraph += line
+ paragraph << line
end
end
diff --git a/lib/rdoc/include.rb b/lib/rdoc/include.rb
index b3ad610649..75ed9c7bff 100644
--- a/lib/rdoc/include.rb
+++ b/lib/rdoc/include.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Module included in a class with \#include
#
diff --git a/lib/rdoc/known_classes.rb b/lib/rdoc/known_classes.rb
index 4d7f4aa995..ddc932c7c0 100644
--- a/lib/rdoc/known_classes.rb
+++ b/lib/rdoc/known_classes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module RDoc
##
@@ -60,6 +59,7 @@ module RDoc
"rb_eZeroDivError" => "ZeroDivError",
"rb_mComparable" => "Comparable",
+ "rb_mDL" => "DL",
"rb_mEnumerable" => "Enumerable",
"rb_mErrno" => "Errno",
"rb_mFConst" => "File::Constants",
diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb
index 44dd50b0f7..63c9a9076f 100644
--- a/lib/rdoc/markdown.rb
+++ b/lib/rdoc/markdown.rb
@@ -14,7 +14,7 @@
#
# data = File.read("README.md")
# formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new, nil)
-# html = RDoc::Markdown.parse(data).accept(formatter)
+# html = RDoc::Markdown.parse(data).accept(@formatter)
#
# # do something with html
#
@@ -81,18 +81,6 @@
# : A little insect that is known
# to enjoy picnics
#
-# ### Strike
-#
-# Example:
-#
-# ```
-# This is ~~striked~~.
-# ```
-#
-# Produces:
-#
-# This is ~~striked~~.
-#
# ### Github
#
# The #github extension enables a partial set of [Github Flavored Markdown]
@@ -458,6 +446,8 @@ class RDoc::Markdown
else
return ans
end
+
+ return ans
end
end
@@ -490,6 +480,8 @@ class RDoc::Markdown
else
return ans
end
+
+ return ans
end
end
@@ -533,11 +525,16 @@ class RDoc::Markdown
+ require 'rubygems'
require 'rdoc'
require 'rdoc/markup/to_joined_paragraph'
require 'rdoc/markdown/entities'
- require 'rdoc/markdown/literals'
+ if RUBY_VERSION > '1.9' then
+ require 'rdoc/markdown/literals_1_9'
+ else
+ require 'rdoc/markdown/literals_1_8'
+ end
##
# Supported extensions
@@ -552,7 +549,6 @@ class RDoc::Markdown
:github,
:html,
:notes,
- :strike,
]
# :section: Extensions
@@ -603,11 +599,6 @@ class RDoc::Markdown
extension :notes
- ##
- # Enables the strike extension
-
- extension :strike
-
# :section:
##
@@ -696,7 +687,7 @@ class RDoc::Markdown
# with the linking `text` (usually whitespace).
def link_to content, label = content, text = nil
- raise ParseError, 'enable notes extension' if
+ raise 'enable notes extension' if
content.start_with? '^' and label.equal? content
if ref = @references[label] then
@@ -832,17 +823,6 @@ class RDoc::Markdown
end
end
- ##
- # Wraps `text` in strike markup for rdoc inline formatting
-
- def strike text
- if text =~ /\A[a-z\d.\/-]+\z/i then
- "~#{text}~"
- else
- "<s>#{text}</s>"
- end
- end
-
# :stopdoc:
def setup_foreign_grammar
@@ -1034,7 +1014,7 @@ class RDoc::Markdown
return _tmp
end
- # AtxInline = !@Newline !(@Sp /#*/ @Sp @Newline) Inline
+ # AtxInline = !@Newline !(@Sp? /#*/ @Sp @Newline) Inline
def _AtxInline
_save = self.pos
@@ -1051,8 +1031,13 @@ class RDoc::Markdown
_save3 = self.pos
while true # sequence
+ _save4 = self.pos
_tmp = _Sp()
unless _tmp
+ _tmp = true
+ self.pos = _save4
+ end
+ unless _tmp
self.pos = _save3
break
end
@@ -1116,7 +1101,7 @@ class RDoc::Markdown
return _tmp
end
- # AtxHeading = AtxStart:s @Sp AtxInline+:a (@Sp /#*/ @Sp)? @Newline { RDoc::Markup::Heading.new(s, a.join) }
+ # AtxHeading = AtxStart:s @Sp? AtxInline+:a (@Sp? /#*/ @Sp)? @Newline { RDoc::Markup::Heading.new(s, a.join) }
def _AtxHeading
_save = self.pos
@@ -1127,12 +1112,17 @@ class RDoc::Markdown
self.pos = _save
break
end
+ _save1 = self.pos
_tmp = _Sp()
unless _tmp
+ _tmp = true
+ self.pos = _save1
+ end
+ unless _tmp
self.pos = _save
break
end
- _save1 = self.pos
+ _save2 = self.pos
_ary = []
_tmp = apply(:_AtxInline)
if _tmp
@@ -1145,37 +1135,42 @@ class RDoc::Markdown
_tmp = true
@result = _ary
else
- self.pos = _save1
+ self.pos = _save2
end
a = @result
unless _tmp
self.pos = _save
break
end
- _save2 = self.pos
-
_save3 = self.pos
+
+ _save4 = self.pos
while true # sequence
+ _save5 = self.pos
_tmp = _Sp()
unless _tmp
- self.pos = _save3
+ _tmp = true
+ self.pos = _save5
+ end
+ unless _tmp
+ self.pos = _save4
break
end
_tmp = scan(/\A(?-mix:#*)/)
unless _tmp
- self.pos = _save3
+ self.pos = _save4
break
end
_tmp = _Sp()
unless _tmp
- self.pos = _save3
+ self.pos = _save4
end
break
end # end sequence
unless _tmp
_tmp = true
- self.pos = _save2
+ self.pos = _save3
end
unless _tmp
self.pos = _save
@@ -1216,12 +1211,12 @@ class RDoc::Markdown
return _tmp
end
- # SetextBottom1 = /={1,}/ @Newline
+ # SetextBottom1 = /={3,}/ @Newline
def _SetextBottom1
_save = self.pos
while true # sequence
- _tmp = scan(/\A(?-mix:={1,})/)
+ _tmp = scan(/\A(?-mix:={3,})/)
unless _tmp
self.pos = _save
break
@@ -1237,12 +1232,12 @@ class RDoc::Markdown
return _tmp
end
- # SetextBottom2 = /-{1,}/ @Newline
+ # SetextBottom2 = /-{3,}/ @Newline
def _SetextBottom2
_save = self.pos
while true # sequence
- _tmp = scan(/\A(?-mix:-{1,})/)
+ _tmp = scan(/\A(?-mix:-{3,})/)
unless _tmp
self.pos = _save
break
@@ -1258,7 +1253,7 @@ class RDoc::Markdown
return _tmp
end
- # SetextHeading1 = &(@RawLine SetextBottom1) @StartList:a (!@Endline Inline:b { a << b })+ @Sp @Newline SetextBottom1 { RDoc::Markup::Heading.new(1, a.join) }
+ # SetextHeading1 = &(@RawLine SetextBottom1) @StartList:a (!@Endline Inline:b { a << b })+ @Sp? @Newline SetextBottom1 { RDoc::Markup::Heading.new(1, a.join) }
def _SetextHeading1
_save = self.pos
@@ -1353,8 +1348,13 @@ class RDoc::Markdown
self.pos = _save
break
end
+ _save8 = self.pos
_tmp = _Sp()
unless _tmp
+ _tmp = true
+ self.pos = _save8
+ end
+ unless _tmp
self.pos = _save
break
end
@@ -1380,7 +1380,7 @@ class RDoc::Markdown
return _tmp
end
- # SetextHeading2 = &(@RawLine SetextBottom2) @StartList:a (!@Endline Inline:b { a << b })+ @Sp @Newline SetextBottom2 { RDoc::Markup::Heading.new(2, a.join) }
+ # SetextHeading2 = &(@RawLine SetextBottom2) @StartList:a (!@Endline Inline:b { a << b })+ @Sp? @Newline SetextBottom2 { RDoc::Markup::Heading.new(2, a.join) }
def _SetextHeading2
_save = self.pos
@@ -1475,8 +1475,13 @@ class RDoc::Markdown
self.pos = _save
break
end
+ _save8 = self.pos
_tmp = _Sp()
unless _tmp
+ _tmp = true
+ self.pos = _save8
+ end
+ unless _tmp
self.pos = _save
break
end
@@ -2817,172 +2822,6 @@ class RDoc::Markdown
return _tmp
end
- # HtmlOpenAnchor = "<" Spnl ("a" | "A") Spnl HtmlAttribute* ">"
- def _HtmlOpenAnchor
-
- _save = self.pos
- while true # sequence
- _tmp = match_string("<")
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
-
- _save1 = self.pos
- while true # choice
- _tmp = match_string("a")
- break if _tmp
- self.pos = _save1
- _tmp = match_string("A")
- break if _tmp
- self.pos = _save1
- break
- end # end choice
-
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- while true
- _tmp = apply(:_HtmlAttribute)
- break unless _tmp
- end
- _tmp = true
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string(">")
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlOpenAnchor unless _tmp
- return _tmp
- end
-
- # HtmlCloseAnchor = "<" Spnl "/" ("a" | "A") Spnl ">"
- def _HtmlCloseAnchor
-
- _save = self.pos
- while true # sequence
- _tmp = match_string("<")
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string("/")
- unless _tmp
- self.pos = _save
- break
- end
-
- _save1 = self.pos
- while true # choice
- _tmp = match_string("a")
- break if _tmp
- self.pos = _save1
- _tmp = match_string("A")
- break if _tmp
- self.pos = _save1
- break
- end # end choice
-
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string(">")
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlCloseAnchor unless _tmp
- return _tmp
- end
-
- # HtmlAnchor = HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor
- def _HtmlAnchor
-
- _save = self.pos
- while true # sequence
- _tmp = apply(:_HtmlOpenAnchor)
- unless _tmp
- self.pos = _save
- break
- end
- while true
-
- _save2 = self.pos
- while true # choice
- _tmp = apply(:_HtmlAnchor)
- break if _tmp
- self.pos = _save2
-
- _save3 = self.pos
- while true # sequence
- _save4 = self.pos
- _tmp = apply(:_HtmlCloseAnchor)
- _tmp = _tmp ? nil : true
- self.pos = _save4
- unless _tmp
- self.pos = _save3
- break
- end
- _tmp = get_byte
- unless _tmp
- self.pos = _save3
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save2
- break
- end # end choice
-
- break unless _tmp
- end
- _tmp = true
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_HtmlCloseAnchor)
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlAnchor unless _tmp
- return _tmp
- end
-
# HtmlBlockOpenAddress = "<" Spnl ("address" | "ADDRESS") Spnl HtmlAttribute* ">"
def _HtmlBlockOpenAddress
@@ -8450,169 +8289,11 @@ class RDoc::Markdown
return _tmp
end
- # HtmlBlockOpenHead = "<" Spnl ("head" | "HEAD") Spnl HtmlAttribute* ">"
- def _HtmlBlockOpenHead
-
- _save = self.pos
- while true # sequence
- _tmp = match_string("<")
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
-
- _save1 = self.pos
- while true # choice
- _tmp = match_string("head")
- break if _tmp
- self.pos = _save1
- _tmp = match_string("HEAD")
- break if _tmp
- self.pos = _save1
- break
- end # end choice
-
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- while true
- _tmp = apply(:_HtmlAttribute)
- break unless _tmp
- end
- _tmp = true
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string(">")
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlBlockOpenHead unless _tmp
- return _tmp
- end
-
- # HtmlBlockCloseHead = "<" Spnl "/" ("head" | "HEAD") Spnl ">"
- def _HtmlBlockCloseHead
-
- _save = self.pos
- while true # sequence
- _tmp = match_string("<")
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string("/")
- unless _tmp
- self.pos = _save
- break
- end
-
- _save1 = self.pos
- while true # choice
- _tmp = match_string("head")
- break if _tmp
- self.pos = _save1
- _tmp = match_string("HEAD")
- break if _tmp
- self.pos = _save1
- break
- end # end choice
-
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_Spnl)
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = match_string(">")
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlBlockCloseHead unless _tmp
- return _tmp
- end
-
- # HtmlBlockHead = HtmlBlockOpenHead (!HtmlBlockCloseHead .)* HtmlBlockCloseHead
- def _HtmlBlockHead
-
- _save = self.pos
- while true # sequence
- _tmp = apply(:_HtmlBlockOpenHead)
- unless _tmp
- self.pos = _save
- break
- end
- while true
-
- _save2 = self.pos
- while true # sequence
- _save3 = self.pos
- _tmp = apply(:_HtmlBlockCloseHead)
- _tmp = _tmp ? nil : true
- self.pos = _save3
- unless _tmp
- self.pos = _save2
- break
- end
- _tmp = get_byte
- unless _tmp
- self.pos = _save2
- end
- break
- end # end sequence
-
- break unless _tmp
- end
- _tmp = true
- unless _tmp
- self.pos = _save
- break
- end
- _tmp = apply(:_HtmlBlockCloseHead)
- unless _tmp
- self.pos = _save
- end
- break
- end # end sequence
-
- set_failed_rule :_HtmlBlockHead unless _tmp
- return _tmp
- end
-
- # HtmlBlockInTags = (HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript | HtmlBlockHead)
+ # HtmlBlockInTags = (HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)
def _HtmlBlockInTags
_save = self.pos
while true # choice
- _tmp = apply(:_HtmlAnchor)
- break if _tmp
- self.pos = _save
_tmp = apply(:_HtmlBlockAddress)
break if _tmp
self.pos = _save
@@ -8712,9 +8393,6 @@ class RDoc::Markdown
_tmp = apply(:_HtmlBlockScript)
break if _tmp
self.pos = _save
- _tmp = apply(:_HtmlBlockHead)
- break if _tmp
- self.pos = _save
break
end # end choice
@@ -9482,7 +9160,7 @@ class RDoc::Markdown
return _tmp
end
- # Inline = (Str | @Endline | UlOrStarLine | @Space | Strong | Emph | Strike | Image | Link | NoteReference | InlineNote | Code | RawHtml | Entity | EscapedChar | Symbol)
+ # Inline = (Str | @Endline | UlOrStarLine | @Space | Strong | Emph | Image | Link | NoteReference | InlineNote | Code | RawHtml | Entity | EscapedChar | Symbol)
def _Inline
_save = self.pos
@@ -9505,9 +9183,6 @@ class RDoc::Markdown
_tmp = apply(:_Emph)
break if _tmp
self.pos = _save
- _tmp = apply(:_Strike)
- break if _tmp
- self.pos = _save
_tmp = apply(:_Image)
break if _tmp
self.pos = _save
@@ -9834,7 +9509,7 @@ class RDoc::Markdown
return _tmp
end
- # NormalEndline = @Sp @Newline !@BlankLine !">" !AtxStart !(Line /={1,}|-{1,}/ @Newline) { "\n" }
+ # NormalEndline = @Sp @Newline !@BlankLine !">" !AtxStart !(Line /={3,}|-{3,}=/ @Newline) { "\n" }
def _NormalEndline
_save = self.pos
@@ -9882,7 +9557,7 @@ class RDoc::Markdown
self.pos = _save5
break
end
- _tmp = scan(/\A(?-mix:={1,}|-{1,})/)
+ _tmp = scan(/\A(?-mix:={3,}|-{3,}=)/)
unless _tmp
self.pos = _save5
break
@@ -10197,166 +9872,147 @@ class RDoc::Markdown
return _tmp
end
- # Whitespace = (@Spacechar | @Newline)
- def _Whitespace
+ # OneStarOpen = !StarLine "*" !@Spacechar !@Newline
+ def _OneStarOpen
_save = self.pos
- while true # choice
+ while true # sequence
+ _save1 = self.pos
+ _tmp = apply(:_StarLine)
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = match_string("*")
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _save2 = self.pos
_tmp = _Spacechar()
- break if _tmp
- self.pos = _save
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _save3 = self.pos
_tmp = _Newline()
- break if _tmp
- self.pos = _save
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
+ unless _tmp
+ self.pos = _save
+ end
break
- end # end choice
+ end # end sequence
- set_failed_rule :_Whitespace unless _tmp
+ set_failed_rule :_OneStarOpen unless _tmp
return _tmp
end
- # EmphStar = "*" !@Whitespace @StartList:a (!"*" Inline:b { a << b } | StrongStar:b { a << b })+ "*" { emphasis a.join }
- def _EmphStar
+ # OneStarClose = !@Spacechar !@Newline Inline:a "*" { a }
+ def _OneStarClose
_save = self.pos
while true # sequence
- _tmp = match_string("*")
+ _save1 = self.pos
+ _tmp = _Spacechar()
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
unless _tmp
self.pos = _save
break
end
- _save1 = self.pos
- _tmp = _Whitespace()
+ _save2 = self.pos
+ _tmp = _Newline()
_tmp = _tmp ? nil : true
- self.pos = _save1
+ self.pos = _save2
unless _tmp
self.pos = _save
break
end
- _tmp = _StartList()
+ _tmp = apply(:_Inline)
a = @result
unless _tmp
self.pos = _save
break
end
- _save2 = self.pos
+ _tmp = match_string("*")
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ @result = begin; a ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
- _save3 = self.pos
- while true # choice
+ set_failed_rule :_OneStarClose unless _tmp
+ return _tmp
+ end
- _save4 = self.pos
+ # EmphStar = OneStarOpen @StartList:a (!OneStarClose Inline:l { a << l })* OneStarClose:l { a << l } { emphasis a.join }
+ def _EmphStar
+
+ _save = self.pos
+ while true # sequence
+ _tmp = apply(:_OneStarOpen)
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = _StartList()
+ a = @result
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ while true
+
+ _save2 = self.pos
while true # sequence
- _save5 = self.pos
- _tmp = match_string("*")
+ _save3 = self.pos
+ _tmp = apply(:_OneStarClose)
_tmp = _tmp ? nil : true
- self.pos = _save5
+ self.pos = _save3
unless _tmp
- self.pos = _save4
+ self.pos = _save2
break
end
_tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save4
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save4
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save3
-
- _save6 = self.pos
- while true # sequence
- _tmp = apply(:_StrongStar)
- b = @result
+ l = @result
unless _tmp
- self.pos = _save6
+ self.pos = _save2
break
end
- @result = begin; a << b ; end
+ @result = begin; a << l ; end
_tmp = true
unless _tmp
- self.pos = _save6
+ self.pos = _save2
end
break
end # end sequence
- break if _tmp
- self.pos = _save3
+ break unless _tmp
+ end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
break
- end # end choice
-
- if _tmp
- while true
-
- _save7 = self.pos
- while true # choice
-
- _save8 = self.pos
- while true # sequence
- _save9 = self.pos
- _tmp = match_string("*")
- _tmp = _tmp ? nil : true
- self.pos = _save9
- unless _tmp
- self.pos = _save8
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save8
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save8
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save7
-
- _save10 = self.pos
- while true # sequence
- _tmp = apply(:_StrongStar)
- b = @result
- unless _tmp
- self.pos = _save10
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save10
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save7
- break
- end # end choice
-
- break unless _tmp
- end
- _tmp = true
- else
- self.pos = _save2
end
+ _tmp = apply(:_OneStarClose)
+ l = @result
unless _tmp
self.pos = _save
break
end
- _tmp = match_string("*")
+ @result = begin; a << l ; end
+ _tmp = true
unless _tmp
self.pos = _save
break
@@ -10373,148 +10029,147 @@ class RDoc::Markdown
return _tmp
end
- # EmphUl = "_" !@Whitespace @StartList:a (!"_" Inline:b { a << b } | StrongUl:b { a << b })+ "_" { emphasis a.join }
- def _EmphUl
+ # OneUlOpen = !UlLine "_" !@Spacechar !@Newline
+ def _OneUlOpen
_save = self.pos
while true # sequence
+ _save1 = self.pos
+ _tmp = apply(:_UlLine)
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
+ unless _tmp
+ self.pos = _save
+ break
+ end
_tmp = match_string("_")
unless _tmp
self.pos = _save
break
end
+ _save2 = self.pos
+ _tmp = _Spacechar()
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _save3 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
+
+ set_failed_rule :_OneUlOpen unless _tmp
+ return _tmp
+ end
+
+ # OneUlClose = !@Spacechar !@Newline Inline:a "_" { a }
+ def _OneUlClose
+
+ _save = self.pos
+ while true # sequence
_save1 = self.pos
- _tmp = _Whitespace()
+ _tmp = _Spacechar()
_tmp = _tmp ? nil : true
self.pos = _save1
unless _tmp
self.pos = _save
break
end
- _tmp = _StartList()
+ _save2 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = apply(:_Inline)
a = @result
unless _tmp
self.pos = _save
break
end
- _save2 = self.pos
+ _tmp = match_string("_")
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ @result = begin; a ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
- _save3 = self.pos
- while true # choice
+ set_failed_rule :_OneUlClose unless _tmp
+ return _tmp
+ end
- _save4 = self.pos
+ # EmphUl = OneUlOpen @StartList:a (!OneUlClose Inline:l { a << l })* OneUlClose:l { a << l } { emphasis a.join }
+ def _EmphUl
+
+ _save = self.pos
+ while true # sequence
+ _tmp = apply(:_OneUlOpen)
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = _StartList()
+ a = @result
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ while true
+
+ _save2 = self.pos
while true # sequence
- _save5 = self.pos
- _tmp = match_string("_")
+ _save3 = self.pos
+ _tmp = apply(:_OneUlClose)
_tmp = _tmp ? nil : true
- self.pos = _save5
+ self.pos = _save3
unless _tmp
- self.pos = _save4
+ self.pos = _save2
break
end
_tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save4
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save4
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save3
-
- _save6 = self.pos
- while true # sequence
- _tmp = apply(:_StrongUl)
- b = @result
+ l = @result
unless _tmp
- self.pos = _save6
+ self.pos = _save2
break
end
- @result = begin; a << b ; end
+ @result = begin; a << l ; end
_tmp = true
unless _tmp
- self.pos = _save6
+ self.pos = _save2
end
break
end # end sequence
- break if _tmp
- self.pos = _save3
+ break unless _tmp
+ end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
break
- end # end choice
-
- if _tmp
- while true
-
- _save7 = self.pos
- while true # choice
-
- _save8 = self.pos
- while true # sequence
- _save9 = self.pos
- _tmp = match_string("_")
- _tmp = _tmp ? nil : true
- self.pos = _save9
- unless _tmp
- self.pos = _save8
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save8
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save8
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save7
-
- _save10 = self.pos
- while true # sequence
- _tmp = apply(:_StrongUl)
- b = @result
- unless _tmp
- self.pos = _save10
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save10
- end
- break
- end # end sequence
-
- break if _tmp
- self.pos = _save7
- break
- end # end choice
-
- break unless _tmp
- end
- _tmp = true
- else
- self.pos = _save2
end
+ _tmp = apply(:_OneUlClose)
+ l = @result
unless _tmp
self.pos = _save
break
end
- _tmp = match_string("_")
+ @result = begin; a << l ; end
+ _tmp = true
unless _tmp
self.pos = _save
break
@@ -10549,89 +10204,69 @@ class RDoc::Markdown
return _tmp
end
- # StrongStar = "**" !@Whitespace @StartList:a (!"**" Inline:b { a << b })+ "**" { strong a.join }
- def _StrongStar
+ # TwoStarOpen = !StarLine "**" !@Spacechar !@Newline
+ def _TwoStarOpen
_save = self.pos
while true # sequence
+ _save1 = self.pos
+ _tmp = apply(:_StarLine)
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
+ unless _tmp
+ self.pos = _save
+ break
+ end
_tmp = match_string("**")
unless _tmp
self.pos = _save
break
end
- _save1 = self.pos
- _tmp = _Whitespace()
+ _save2 = self.pos
+ _tmp = _Spacechar()
_tmp = _tmp ? nil : true
- self.pos = _save1
+ self.pos = _save2
unless _tmp
self.pos = _save
break
end
- _tmp = _StartList()
- a = @result
+ _save3 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
unless _tmp
self.pos = _save
- break
end
- _save2 = self.pos
+ break
+ end # end sequence
- _save3 = self.pos
- while true # sequence
- _save4 = self.pos
- _tmp = match_string("**")
- _tmp = _tmp ? nil : true
- self.pos = _save4
- unless _tmp
- self.pos = _save3
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save3
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save3
- end
- break
- end # end sequence
+ set_failed_rule :_TwoStarOpen unless _tmp
+ return _tmp
+ end
- if _tmp
- while true
+ # TwoStarClose = !@Spacechar !@Newline Inline:a "**" { a }
+ def _TwoStarClose
- _save5 = self.pos
- while true # sequence
- _save6 = self.pos
- _tmp = match_string("**")
- _tmp = _tmp ? nil : true
- self.pos = _save6
- unless _tmp
- self.pos = _save5
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save5
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save5
- end
- break
- end # end sequence
-
- break unless _tmp
- end
- _tmp = true
- else
- self.pos = _save2
+ _save = self.pos
+ while true # sequence
+ _save1 = self.pos
+ _tmp = _Spacechar()
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
+ unless _tmp
+ self.pos = _save
+ break
end
+ _save2 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = apply(:_Inline)
+ a = @result
unless _tmp
self.pos = _save
break
@@ -10641,7 +10276,7 @@ class RDoc::Markdown
self.pos = _save
break
end
- @result = begin; strong a.join ; end
+ @result = begin; a ; end
_tmp = true
unless _tmp
self.pos = _save
@@ -10649,24 +10284,16 @@ class RDoc::Markdown
break
end # end sequence
- set_failed_rule :_StrongStar unless _tmp
+ set_failed_rule :_TwoStarClose unless _tmp
return _tmp
end
- # StrongUl = "__" !@Whitespace @StartList:a (!"__" Inline:b { a << b })+ "__" { strong a.join }
- def _StrongUl
+ # StrongStar = TwoStarOpen @StartList:a (!TwoStarClose Inline:l { a << l })* TwoStarClose:l { a << l } { strong a.join }
+ def _StrongStar
_save = self.pos
while true # sequence
- _tmp = match_string("__")
- unless _tmp
- self.pos = _save
- break
- end
- _save1 = self.pos
- _tmp = _Whitespace()
- _tmp = _tmp ? nil : true
- self.pos = _save1
+ _tmp = apply(:_TwoStarOpen)
unless _tmp
self.pos = _save
break
@@ -10677,70 +10304,47 @@ class RDoc::Markdown
self.pos = _save
break
end
- _save2 = self.pos
+ while true
- _save3 = self.pos
- while true # sequence
- _save4 = self.pos
- _tmp = match_string("__")
- _tmp = _tmp ? nil : true
- self.pos = _save4
- unless _tmp
- self.pos = _save3
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save3
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
+ _save2 = self.pos
+ while true # sequence
+ _save3 = self.pos
+ _tmp = apply(:_TwoStarClose)
+ _tmp = _tmp ? nil : true
self.pos = _save3
- end
- break
- end # end sequence
-
- if _tmp
- while true
-
- _save5 = self.pos
- while true # sequence
- _save6 = self.pos
- _tmp = match_string("__")
- _tmp = _tmp ? nil : true
- self.pos = _save6
- unless _tmp
- self.pos = _save5
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save5
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save5
- end
+ unless _tmp
+ self.pos = _save2
break
- end # end sequence
+ end
+ _tmp = apply(:_Inline)
+ l = @result
+ unless _tmp
+ self.pos = _save2
+ break
+ end
+ @result = begin; a << l ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save2
+ end
+ break
+ end # end sequence
- break unless _tmp
- end
- _tmp = true
- else
- self.pos = _save2
+ break unless _tmp
end
+ _tmp = true
unless _tmp
self.pos = _save
break
end
- _tmp = match_string("__")
+ _tmp = apply(:_TwoStarClose)
+ l = @result
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ @result = begin; a << l ; end
+ _tmp = true
unless _tmp
self.pos = _save
break
@@ -10753,110 +10357,156 @@ class RDoc::Markdown
break
end # end sequence
- set_failed_rule :_StrongUl unless _tmp
+ set_failed_rule :_StrongStar unless _tmp
return _tmp
end
- # Strike = &{ strike? } "~~" !@Whitespace @StartList:a (!"~~" Inline:b { a << b })+ "~~" { strike a.join }
- def _Strike
+ # TwoUlOpen = !UlLine "__" !@Spacechar !@Newline
+ def _TwoUlOpen
_save = self.pos
while true # sequence
_save1 = self.pos
- _tmp = begin; strike? ; end
+ _tmp = apply(:_UlLine)
+ _tmp = _tmp ? nil : true
self.pos = _save1
unless _tmp
self.pos = _save
break
end
- _tmp = match_string("~~")
+ _tmp = match_string("__")
unless _tmp
self.pos = _save
break
end
_save2 = self.pos
- _tmp = _Whitespace()
+ _tmp = _Spacechar()
_tmp = _tmp ? nil : true
self.pos = _save2
unless _tmp
self.pos = _save
break
end
- _tmp = _StartList()
+ _save3 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
+
+ set_failed_rule :_TwoUlOpen unless _tmp
+ return _tmp
+ end
+
+ # TwoUlClose = !@Spacechar !@Newline Inline:a "__" { a }
+ def _TwoUlClose
+
+ _save = self.pos
+ while true # sequence
+ _save1 = self.pos
+ _tmp = _Spacechar()
+ _tmp = _tmp ? nil : true
+ self.pos = _save1
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _save2 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = apply(:_Inline)
a = @result
unless _tmp
self.pos = _save
break
end
- _save3 = self.pos
-
- _save4 = self.pos
- while true # sequence
- _save5 = self.pos
- _tmp = match_string("~~")
- _tmp = _tmp ? nil : true
- self.pos = _save5
- unless _tmp
- self.pos = _save4
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save4
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save4
- end
+ _tmp = match_string("__")
+ unless _tmp
+ self.pos = _save
break
- end # end sequence
+ end
+ @result = begin; a ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
- if _tmp
- while true
+ set_failed_rule :_TwoUlClose unless _tmp
+ return _tmp
+ end
- _save6 = self.pos
- while true # sequence
- _save7 = self.pos
- _tmp = match_string("~~")
- _tmp = _tmp ? nil : true
- self.pos = _save7
- unless _tmp
- self.pos = _save6
- break
- end
- _tmp = apply(:_Inline)
- b = @result
- unless _tmp
- self.pos = _save6
- break
- end
- @result = begin; a << b ; end
- _tmp = true
- unless _tmp
- self.pos = _save6
- end
+ # StrongUl = TwoUlOpen @StartList:a (!TwoUlClose Inline:i { a << i })* TwoUlClose:l { a << l } { strong a.join }
+ def _StrongUl
+
+ _save = self.pos
+ while true # sequence
+ _tmp = apply(:_TwoUlOpen)
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ _tmp = _StartList()
+ a = @result
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ while true
+
+ _save2 = self.pos
+ while true # sequence
+ _save3 = self.pos
+ _tmp = apply(:_TwoUlClose)
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
+ unless _tmp
+ self.pos = _save2
break
- end # end sequence
+ end
+ _tmp = apply(:_Inline)
+ i = @result
+ unless _tmp
+ self.pos = _save2
+ break
+ end
+ @result = begin; a << i ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save2
+ end
+ break
+ end # end sequence
- break unless _tmp
- end
- _tmp = true
- else
- self.pos = _save3
+ break unless _tmp
end
+ _tmp = true
unless _tmp
self.pos = _save
break
end
- _tmp = match_string("~~")
+ _tmp = apply(:_TwoUlClose)
+ l = @result
unless _tmp
self.pos = _save
break
end
- @result = begin; strike a.join ; end
+ @result = begin; a << l ; end
+ _tmp = true
+ unless _tmp
+ self.pos = _save
+ break
+ end
+ @result = begin; strong a.join ; end
_tmp = true
unless _tmp
self.pos = _save
@@ -10864,7 +10514,7 @@ class RDoc::Markdown
break
end # end sequence
- set_failed_rule :_Strike unless _tmp
+ set_failed_rule :_StrongUl unless _tmp
return _tmp
end
@@ -11043,7 +10693,7 @@ class RDoc::Markdown
return _tmp
end
- # ExplicitLink = Label:l "(" @Sp Source:s Spnl Title @Sp ")" { "{#{l}}[#{s}]" }
+ # ExplicitLink = Label:l Spnl "(" @Sp Source:s Spnl Title @Sp ")" { "{#{l}}[#{s}]" }
def _ExplicitLink
_save = self.pos
@@ -11054,6 +10704,11 @@ class RDoc::Markdown
self.pos = _save
break
end
+ _tmp = apply(:_Spnl)
+ unless _tmp
+ self.pos = _save
+ break
+ end
_tmp = match_string("(")
unless _tmp
self.pos = _save
@@ -11162,119 +10817,130 @@ class RDoc::Markdown
return _tmp
end
- # SourceContents = ((!"(" !")" !">" Nonspacechar)+ | "(" SourceContents ")")*
+ # SourceContents = (((!"(" !")" !">" Nonspacechar)+ | "(" SourceContents ")")* | "")
def _SourceContents
- while true
- _save1 = self.pos
- while true # choice
+ _save = self.pos
+ while true # choice
+ while true
+
_save2 = self.pos
+ while true # choice
+ _save3 = self.pos
- _save3 = self.pos
- while true # sequence
_save4 = self.pos
- _tmp = match_string("(")
- _tmp = _tmp ? nil : true
- self.pos = _save4
- unless _tmp
- self.pos = _save3
- break
- end
- _save5 = self.pos
- _tmp = match_string(")")
- _tmp = _tmp ? nil : true
- self.pos = _save5
- unless _tmp
- self.pos = _save3
- break
- end
- _save6 = self.pos
- _tmp = match_string(">")
- _tmp = _tmp ? nil : true
- self.pos = _save6
- unless _tmp
- self.pos = _save3
+ while true # sequence
+ _save5 = self.pos
+ _tmp = match_string("(")
+ _tmp = _tmp ? nil : true
+ self.pos = _save5
+ unless _tmp
+ self.pos = _save4
+ break
+ end
+ _save6 = self.pos
+ _tmp = match_string(")")
+ _tmp = _tmp ? nil : true
+ self.pos = _save6
+ unless _tmp
+ self.pos = _save4
+ break
+ end
+ _save7 = self.pos
+ _tmp = match_string(">")
+ _tmp = _tmp ? nil : true
+ self.pos = _save7
+ unless _tmp
+ self.pos = _save4
+ break
+ end
+ _tmp = apply(:_Nonspacechar)
+ unless _tmp
+ self.pos = _save4
+ end
break
- end
- _tmp = apply(:_Nonspacechar)
- unless _tmp
- self.pos = _save3
- end
- break
- end # end sequence
+ end # end sequence
- if _tmp
- while true
+ if _tmp
+ while true
- _save7 = self.pos
- while true # sequence
_save8 = self.pos
- _tmp = match_string("(")
- _tmp = _tmp ? nil : true
- self.pos = _save8
- unless _tmp
- self.pos = _save7
- break
- end
- _save9 = self.pos
- _tmp = match_string(")")
- _tmp = _tmp ? nil : true
- self.pos = _save9
- unless _tmp
- self.pos = _save7
- break
- end
- _save10 = self.pos
- _tmp = match_string(">")
- _tmp = _tmp ? nil : true
- self.pos = _save10
- unless _tmp
- self.pos = _save7
+ while true # sequence
+ _save9 = self.pos
+ _tmp = match_string("(")
+ _tmp = _tmp ? nil : true
+ self.pos = _save9
+ unless _tmp
+ self.pos = _save8
+ break
+ end
+ _save10 = self.pos
+ _tmp = match_string(")")
+ _tmp = _tmp ? nil : true
+ self.pos = _save10
+ unless _tmp
+ self.pos = _save8
+ break
+ end
+ _save11 = self.pos
+ _tmp = match_string(">")
+ _tmp = _tmp ? nil : true
+ self.pos = _save11
+ unless _tmp
+ self.pos = _save8
+ break
+ end
+ _tmp = apply(:_Nonspacechar)
+ unless _tmp
+ self.pos = _save8
+ end
break
- end
- _tmp = apply(:_Nonspacechar)
- unless _tmp
- self.pos = _save7
- end
- break
- end # end sequence
+ end # end sequence
- break unless _tmp
+ break unless _tmp
+ end
+ _tmp = true
+ else
+ self.pos = _save3
end
- _tmp = true
- else
+ break if _tmp
self.pos = _save2
- end
- break if _tmp
- self.pos = _save1
- _save11 = self.pos
- while true # sequence
- _tmp = match_string("(")
- unless _tmp
- self.pos = _save11
- break
- end
- _tmp = apply(:_SourceContents)
- unless _tmp
- self.pos = _save11
+ _save12 = self.pos
+ while true # sequence
+ _tmp = match_string("(")
+ unless _tmp
+ self.pos = _save12
+ break
+ end
+ _tmp = apply(:_SourceContents)
+ unless _tmp
+ self.pos = _save12
+ break
+ end
+ _tmp = match_string(")")
+ unless _tmp
+ self.pos = _save12
+ end
break
- end
- _tmp = match_string(")")
- unless _tmp
- self.pos = _save11
- end
+ end # end sequence
+
+ break if _tmp
+ self.pos = _save2
break
- end # end sequence
+ end # end choice
- break if _tmp
- self.pos = _save1
- break
- end # end choice
+ break unless _tmp
+ end
+ _tmp = true
+ break if _tmp
+ self.pos = _save
+ _tmp = match_string("")
+ break if _tmp
+ self.pos = _save
+ break
+ end # end choice
- break unless _tmp
- end
- _tmp = true
set_failed_rule :_SourceContents unless _tmp
return _tmp
end
@@ -14531,12 +14197,12 @@ class RDoc::Markdown
return _tmp
end
- # SpecialChar = (/[~*_`&\[\]()<!#\\'"]/ | @ExtendedSpecialChar)
+ # SpecialChar = (/[*_`&\[\]()<!#\\'"]/ | @ExtendedSpecialChar)
def _SpecialChar
_save = self.pos
while true # choice
- _tmp = scan(/\A(?-mix:[~*_`&\[\]()<!#\\'"])/)
+ _tmp = scan(/\A(?-mix:[*_`&\[\]()<!#\\'"])/)
break if _tmp
self.pos = _save
_tmp = _ExtendedSpecialChar()
@@ -14629,6 +14295,13 @@ class RDoc::Markdown
return _tmp
end
+ # NonAlphanumeric = %literals.NonAlphanumeric
+ def _NonAlphanumeric
+ _tmp = @_grammar_literals.external_invoke(self, :_NonAlphanumeric)
+ set_failed_rule :_NonAlphanumeric unless _tmp
+ return _tmp
+ end
+
# Spacechar = %literals.Spacechar
def _Spacechar
_tmp = @_grammar_literals.external_invoke(self, :_Spacechar)
@@ -15356,7 +15029,7 @@ class RDoc::Markdown
return _tmp
end
- # InlineNote = &{ notes? } "^[" @StartList:a (!"]" Inline:l { a << l })+ "]" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }
+ # InlineNote = &{ notes? } "^[" @StartList:a (!"]" Inline:l { a << l })+ "]" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }
def _InlineNote
_save = self.pos
@@ -15447,7 +15120,8 @@ class RDoc::Markdown
self.pos = _save
break
end
- @result = begin; ref = [:inline, @note_order.length]
+ @result = begin;
+ ref = [:inline, @note_order.length]
@footnotes[ref] = paragraph a
note_for ref
@@ -15590,7 +15264,7 @@ class RDoc::Markdown
return _tmp
end
- # CodeFence = &{ github? } Ticks3 (@Sp StrChunk:format)? Spnl < ((!"`" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format.instance_of?(String) verbatim }
+ # CodeFence = &{ github? } Ticks3 (@Sp StrChunk:format)? Spnl < ((!"`" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format verbatim }
def _CodeFence
_save = self.pos
@@ -15832,7 +15506,7 @@ class RDoc::Markdown
break
end
@result = begin; verbatim = RDoc::Markup::Verbatim.new text
- verbatim.format = format.intern if format.instance_of?(String)
+ verbatim.format = format.intern if format
verbatim
; end
_tmp = true
@@ -16048,14 +15722,14 @@ class RDoc::Markdown
Rules[:_Block] = rule_info("Block", "@BlankLine* (BlockQuote | Verbatim | CodeFence | Note | Reference | HorizontalRule | Heading | OrderedList | BulletList | DefinitionList | HtmlBlock | StyleBlock | Para | Plain)")
Rules[:_Para] = rule_info("Para", "@NonindentSpace Inlines:a @BlankLine+ { paragraph a }")
Rules[:_Plain] = rule_info("Plain", "Inlines:a { paragraph a }")
- Rules[:_AtxInline] = rule_info("AtxInline", "!@Newline !(@Sp /\#*/ @Sp @Newline) Inline")
+ Rules[:_AtxInline] = rule_info("AtxInline", "!@Newline !(@Sp? /\#*/ @Sp @Newline) Inline")
Rules[:_AtxStart] = rule_info("AtxStart", "< /\\\#{1,6}/ > { text.length }")
- Rules[:_AtxHeading] = rule_info("AtxHeading", "AtxStart:s @Sp AtxInline+:a (@Sp /\#*/ @Sp)? @Newline { RDoc::Markup::Heading.new(s, a.join) }")
+ Rules[:_AtxHeading] = rule_info("AtxHeading", "AtxStart:s @Sp? AtxInline+:a (@Sp? /\#*/ @Sp)? @Newline { RDoc::Markup::Heading.new(s, a.join) }")
Rules[:_SetextHeading] = rule_info("SetextHeading", "(SetextHeading1 | SetextHeading2)")
- Rules[:_SetextBottom1] = rule_info("SetextBottom1", "/={1,}/ @Newline")
- Rules[:_SetextBottom2] = rule_info("SetextBottom2", "/-{1,}/ @Newline")
- Rules[:_SetextHeading1] = rule_info("SetextHeading1", "&(@RawLine SetextBottom1) @StartList:a (!@Endline Inline:b { a << b })+ @Sp @Newline SetextBottom1 { RDoc::Markup::Heading.new(1, a.join) }")
- Rules[:_SetextHeading2] = rule_info("SetextHeading2", "&(@RawLine SetextBottom2) @StartList:a (!@Endline Inline:b { a << b })+ @Sp @Newline SetextBottom2 { RDoc::Markup::Heading.new(2, a.join) }")
+ Rules[:_SetextBottom1] = rule_info("SetextBottom1", "/={3,}/ @Newline")
+ Rules[:_SetextBottom2] = rule_info("SetextBottom2", "/-{3,}/ @Newline")
+ Rules[:_SetextHeading1] = rule_info("SetextHeading1", "&(@RawLine SetextBottom1) @StartList:a (!@Endline Inline:b { a << b })+ @Sp? @Newline SetextBottom1 { RDoc::Markup::Heading.new(1, a.join) }")
+ Rules[:_SetextHeading2] = rule_info("SetextHeading2", "&(@RawLine SetextBottom2) @StartList:a (!@Endline Inline:b { a << b })+ @Sp? @Newline SetextBottom2 { RDoc::Markup::Heading.new(2, a.join) }")
Rules[:_Heading] = rule_info("Heading", "(SetextHeading | AtxHeading)")
Rules[:_BlockQuote] = rule_info("BlockQuote", "BlockQuoteRaw:a { RDoc::Markup::BlockQuote.new(*a) }")
Rules[:_BlockQuoteRaw] = rule_info("BlockQuoteRaw", "@StartList:a (\">\" \" \"? Line:l { a << l } (!\">\" !@BlankLine Line:c { a << c })* (@BlankLine:n { a << n })*)+ { inner_parse a.join }")
@@ -16074,9 +15748,6 @@ class RDoc::Markdown
Rules[:_Enumerator] = rule_info("Enumerator", "@NonindentSpace [0-9]+ \".\" @Spacechar+")
Rules[:_OrderedList] = rule_info("OrderedList", "&Enumerator (ListTight | ListLoose):a { RDoc::Markup::List.new(:NUMBER, *a) }")
Rules[:_ListBlockLine] = rule_info("ListBlockLine", "!@BlankLine !(Indent? (Bullet | Enumerator)) !HorizontalRule OptionallyIndentedLine")
- Rules[:_HtmlOpenAnchor] = rule_info("HtmlOpenAnchor", "\"<\" Spnl (\"a\" | \"A\") Spnl HtmlAttribute* \">\"")
- Rules[:_HtmlCloseAnchor] = rule_info("HtmlCloseAnchor", "\"<\" Spnl \"/\" (\"a\" | \"A\") Spnl \">\"")
- Rules[:_HtmlAnchor] = rule_info("HtmlAnchor", "HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor")
Rules[:_HtmlBlockOpenAddress] = rule_info("HtmlBlockOpenAddress", "\"<\" Spnl (\"address\" | \"ADDRESS\") Spnl HtmlAttribute* \">\"")
Rules[:_HtmlBlockCloseAddress] = rule_info("HtmlBlockCloseAddress", "\"<\" Spnl \"/\" (\"address\" | \"ADDRESS\") Spnl \">\"")
Rules[:_HtmlBlockAddress] = rule_info("HtmlBlockAddress", "HtmlBlockOpenAddress (HtmlBlockAddress | !HtmlBlockCloseAddress .)* HtmlBlockCloseAddress")
@@ -16176,10 +15847,7 @@ class RDoc::Markdown
Rules[:_HtmlBlockOpenScript] = rule_info("HtmlBlockOpenScript", "\"<\" Spnl (\"script\" | \"SCRIPT\") Spnl HtmlAttribute* \">\"")
Rules[:_HtmlBlockCloseScript] = rule_info("HtmlBlockCloseScript", "\"<\" Spnl \"/\" (\"script\" | \"SCRIPT\") Spnl \">\"")
Rules[:_HtmlBlockScript] = rule_info("HtmlBlockScript", "HtmlBlockOpenScript (!HtmlBlockCloseScript .)* HtmlBlockCloseScript")
- Rules[:_HtmlBlockOpenHead] = rule_info("HtmlBlockOpenHead", "\"<\" Spnl (\"head\" | \"HEAD\") Spnl HtmlAttribute* \">\"")
- Rules[:_HtmlBlockCloseHead] = rule_info("HtmlBlockCloseHead", "\"<\" Spnl \"/\" (\"head\" | \"HEAD\") Spnl \">\"")
- Rules[:_HtmlBlockHead] = rule_info("HtmlBlockHead", "HtmlBlockOpenHead (!HtmlBlockCloseHead .)* HtmlBlockCloseHead")
- Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript | HtmlBlockHead)")
+ Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)")
Rules[:_HtmlBlock] = rule_info("HtmlBlock", "< (HtmlBlockInTags | HtmlComment | HtmlBlockSelfClosing | HtmlUnclosed) > @BlankLine+ { if html? then RDoc::Markup::Raw.new text end }")
Rules[:_HtmlUnclosed] = rule_info("HtmlUnclosed", "\"<\" Spnl HtmlUnclosedType Spnl HtmlAttribute* Spnl \">\"")
Rules[:_HtmlUnclosedType] = rule_info("HtmlUnclosedType", "(\"HR\" | \"hr\")")
@@ -16190,14 +15858,14 @@ class RDoc::Markdown
Rules[:_InStyleTags] = rule_info("InStyleTags", "StyleOpen (!StyleClose .)* StyleClose")
Rules[:_StyleBlock] = rule_info("StyleBlock", "< InStyleTags > @BlankLine* { if css? then RDoc::Markup::Raw.new text end }")
Rules[:_Inlines] = rule_info("Inlines", "(!@Endline Inline:i { i } | @Endline:c &Inline { c })+:chunks @Endline? { chunks }")
- Rules[:_Inline] = rule_info("Inline", "(Str | @Endline | UlOrStarLine | @Space | Strong | Emph | Strike | Image | Link | NoteReference | InlineNote | Code | RawHtml | Entity | EscapedChar | Symbol)")
+ Rules[:_Inline] = rule_info("Inline", "(Str | @Endline | UlOrStarLine | @Space | Strong | Emph | Image | Link | NoteReference | InlineNote | Code | RawHtml | Entity | EscapedChar | Symbol)")
Rules[:_Space] = rule_info("Space", "@Spacechar+ { \" \" }")
Rules[:_Str] = rule_info("Str", "@StartList:a < @NormalChar+ > { a = text } (StrChunk:c { a << c })* { a }")
Rules[:_StrChunk] = rule_info("StrChunk", "< (@NormalChar | /_+/ &Alphanumeric)+ > { text }")
Rules[:_EscapedChar] = rule_info("EscapedChar", "\"\\\\\" !@Newline < /[:\\\\`|*_{}\\[\\]()\#+.!><-]/ > { text }")
Rules[:_Entity] = rule_info("Entity", "(HexEntity | DecEntity | CharEntity):a { a }")
Rules[:_Endline] = rule_info("Endline", "(@LineBreak | @TerminalEndline | @NormalEndline)")
- Rules[:_NormalEndline] = rule_info("NormalEndline", "@Sp @Newline !@BlankLine !\">\" !AtxStart !(Line /={1,}|-{1,}/ @Newline) { \"\\n\" }")
+ Rules[:_NormalEndline] = rule_info("NormalEndline", "@Sp @Newline !@BlankLine !\">\" !AtxStart !(Line /={3,}|-{3,}=/ @Newline) { \"\\n\" }")
Rules[:_TerminalEndline] = rule_info("TerminalEndline", "@Sp @Newline @Eof")
Rules[:_LineBreak] = rule_info("LineBreak", "\" \" @NormalEndline { RDoc::Markup::HardBreak.new }")
Rules[:_Symbol] = rule_info("Symbol", "< @SpecialChar > { text }")
@@ -16205,21 +15873,27 @@ class RDoc::Markdown
Rules[:_StarLine] = rule_info("StarLine", "(< /\\*{4,}/ > { text } | < @Spacechar /\\*+/ &@Spacechar > { text })")
Rules[:_UlLine] = rule_info("UlLine", "(< /_{4,}/ > { text } | < @Spacechar /_+/ &@Spacechar > { text })")
Rules[:_Emph] = rule_info("Emph", "(EmphStar | EmphUl)")
- Rules[:_Whitespace] = rule_info("Whitespace", "(@Spacechar | @Newline)")
- Rules[:_EmphStar] = rule_info("EmphStar", "\"*\" !@Whitespace @StartList:a (!\"*\" Inline:b { a << b } | StrongStar:b { a << b })+ \"*\" { emphasis a.join }")
- Rules[:_EmphUl] = rule_info("EmphUl", "\"_\" !@Whitespace @StartList:a (!\"_\" Inline:b { a << b } | StrongUl:b { a << b })+ \"_\" { emphasis a.join }")
+ Rules[:_OneStarOpen] = rule_info("OneStarOpen", "!StarLine \"*\" !@Spacechar !@Newline")
+ Rules[:_OneStarClose] = rule_info("OneStarClose", "!@Spacechar !@Newline Inline:a \"*\" { a }")
+ Rules[:_EmphStar] = rule_info("EmphStar", "OneStarOpen @StartList:a (!OneStarClose Inline:l { a << l })* OneStarClose:l { a << l } { emphasis a.join }")
+ Rules[:_OneUlOpen] = rule_info("OneUlOpen", "!UlLine \"_\" !@Spacechar !@Newline")
+ Rules[:_OneUlClose] = rule_info("OneUlClose", "!@Spacechar !@Newline Inline:a \"_\" { a }")
+ Rules[:_EmphUl] = rule_info("EmphUl", "OneUlOpen @StartList:a (!OneUlClose Inline:l { a << l })* OneUlClose:l { a << l } { emphasis a.join }")
Rules[:_Strong] = rule_info("Strong", "(StrongStar | StrongUl)")
- Rules[:_StrongStar] = rule_info("StrongStar", "\"**\" !@Whitespace @StartList:a (!\"**\" Inline:b { a << b })+ \"**\" { strong a.join }")
- Rules[:_StrongUl] = rule_info("StrongUl", "\"__\" !@Whitespace @StartList:a (!\"__\" Inline:b { a << b })+ \"__\" { strong a.join }")
- Rules[:_Strike] = rule_info("Strike", "&{ strike? } \"~~\" !@Whitespace @StartList:a (!\"~~\" Inline:b { a << b })+ \"~~\" { strike a.join }")
+ Rules[:_TwoStarOpen] = rule_info("TwoStarOpen", "!StarLine \"**\" !@Spacechar !@Newline")
+ Rules[:_TwoStarClose] = rule_info("TwoStarClose", "!@Spacechar !@Newline Inline:a \"**\" { a }")
+ Rules[:_StrongStar] = rule_info("StrongStar", "TwoStarOpen @StartList:a (!TwoStarClose Inline:l { a << l })* TwoStarClose:l { a << l } { strong a.join }")
+ Rules[:_TwoUlOpen] = rule_info("TwoUlOpen", "!UlLine \"__\" !@Spacechar !@Newline")
+ Rules[:_TwoUlClose] = rule_info("TwoUlClose", "!@Spacechar !@Newline Inline:a \"__\" { a }")
+ Rules[:_StrongUl] = rule_info("StrongUl", "TwoUlOpen @StartList:a (!TwoUlClose Inline:i { a << i })* TwoUlClose:l { a << l } { strong a.join }")
Rules[:_Image] = rule_info("Image", "\"!\" (ExplicitLink | ReferenceLink):a { \"rdoc-image:\#{a[/\\[(.*)\\]/, 1]}\" }")
Rules[:_Link] = rule_info("Link", "(ExplicitLink | ReferenceLink | AutoLink)")
Rules[:_ReferenceLink] = rule_info("ReferenceLink", "(ReferenceLinkDouble | ReferenceLinkSingle)")
Rules[:_ReferenceLinkDouble] = rule_info("ReferenceLinkDouble", "Label:content < Spnl > !\"[]\" Label:label { link_to content, label, text }")
Rules[:_ReferenceLinkSingle] = rule_info("ReferenceLinkSingle", "Label:content < (Spnl \"[]\")? > { link_to content, content, text }")
- Rules[:_ExplicitLink] = rule_info("ExplicitLink", "Label:l \"(\" @Sp Source:s Spnl Title @Sp \")\" { \"{\#{l}}[\#{s}]\" }")
+ Rules[:_ExplicitLink] = rule_info("ExplicitLink", "Label:l Spnl \"(\" @Sp Source:s Spnl Title @Sp \")\" { \"{\#{l}}[\#{s}]\" }")
Rules[:_Source] = rule_info("Source", "(\"<\" < SourceContents > \">\" | < SourceContents >) { text }")
- Rules[:_SourceContents] = rule_info("SourceContents", "((!\"(\" !\")\" !\">\" Nonspacechar)+ | \"(\" SourceContents \")\")*")
+ Rules[:_SourceContents] = rule_info("SourceContents", "(((!\"(\" !\")\" !\">\" Nonspacechar)+ | \"(\" SourceContents \")\")* | \"\")")
Rules[:_Title] = rule_info("Title", "(TitleSingle | TitleDouble | \"\"):a { a }")
Rules[:_TitleSingle] = rule_info("TitleSingle", "\"'\" (!(\"'\" @Sp (\")\" | @Newline)) .)* \"'\"")
Rules[:_TitleDouble] = rule_info("TitleDouble", "\"\\\"\" (!(\"\\\"\" @Sp (\")\" | @Newline)) .)* \"\\\"\"")
@@ -16251,13 +15925,14 @@ class RDoc::Markdown
Rules[:_Nonspacechar] = rule_info("Nonspacechar", "!@Spacechar !@Newline .")
Rules[:_Sp] = rule_info("Sp", "@Spacechar*")
Rules[:_Spnl] = rule_info("Spnl", "@Sp (@Newline @Sp)?")
- Rules[:_SpecialChar] = rule_info("SpecialChar", "(/[~*_`&\\[\\]()<!\#\\\\'\"]/ | @ExtendedSpecialChar)")
+ Rules[:_SpecialChar] = rule_info("SpecialChar", "(/[*_`&\\[\\]()<!\#\\\\'\"]/ | @ExtendedSpecialChar)")
Rules[:_NormalChar] = rule_info("NormalChar", "!(@SpecialChar | @Spacechar | @Newline) .")
Rules[:_Digit] = rule_info("Digit", "[0-9]")
Rules[:_Alphanumeric] = rule_info("Alphanumeric", "%literals.Alphanumeric")
Rules[:_AlphanumericAscii] = rule_info("AlphanumericAscii", "%literals.AlphanumericAscii")
Rules[:_BOM] = rule_info("BOM", "%literals.BOM")
Rules[:_Newline] = rule_info("Newline", "%literals.Newline")
+ Rules[:_NonAlphanumeric] = rule_info("NonAlphanumeric", "%literals.NonAlphanumeric")
Rules[:_Spacechar] = rule_info("Spacechar", "%literals.Spacechar")
Rules[:_HexEntity] = rule_info("HexEntity", "/&\#x/i < /[0-9a-fA-F]+/ > \";\" { [text.to_i(16)].pack 'U' }")
Rules[:_DecEntity] = rule_info("DecEntity", "\"&\#\" < /[0-9]+/ > \";\" { [text.to_i].pack 'U' }")
@@ -16274,10 +15949,10 @@ class RDoc::Markdown
Rules[:_NoteReference] = rule_info("NoteReference", "&{ notes? } RawNoteReference:ref { note_for ref }")
Rules[:_RawNoteReference] = rule_info("RawNoteReference", "\"[^\" < (!@Newline !\"]\" .)+ > \"]\" { text }")
Rules[:_Note] = rule_info("Note", "&{ notes? } @NonindentSpace RawNoteReference:ref \":\" @Sp @StartList:a RawNoteBlock:i { a.concat i } (&Indent RawNoteBlock:i { a.concat i })* { @footnotes[ref] = paragraph a nil }")
- Rules[:_InlineNote] = rule_info("InlineNote", "&{ notes? } \"^[\" @StartList:a (!\"]\" Inline:l { a << l })+ \"]\" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }")
+ Rules[:_InlineNote] = rule_info("InlineNote", "&{ notes? } \"^[\" @StartList:a (!\"]\" Inline:l { a << l })+ \"]\" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }")
Rules[:_Notes] = rule_info("Notes", "(Note | SkipBlock)*")
Rules[:_RawNoteBlock] = rule_info("RawNoteBlock", "@StartList:a (!@BlankLine OptionallyIndentedLine:l { a << l })+ < @BlankLine* > { a << text } { a }")
- Rules[:_CodeFence] = rule_info("CodeFence", "&{ github? } Ticks3 (@Sp StrChunk:format)? Spnl < ((!\"`\" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format.instance_of?(String) verbatim }")
+ Rules[:_CodeFence] = rule_info("CodeFence", "&{ github? } Ticks3 (@Sp StrChunk:format)? Spnl < ((!\"`\" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format verbatim }")
Rules[:_DefinitionList] = rule_info("DefinitionList", "&{ definition_lists? } DefinitionListItem+:list { RDoc::Markup::List.new :NOTE, *list.flatten }")
Rules[:_DefinitionListItem] = rule_info("DefinitionListItem", "DefinitionListLabel+:label DefinitionListDefinition+:defns { list_items = [] list_items << RDoc::Markup::ListItem.new(label, defns.shift) list_items.concat defns.map { |defn| RDoc::Markup::ListItem.new nil, defn } unless list_items.empty? list_items }")
Rules[:_DefinitionListLabel] = rule_info("DefinitionListLabel", "StrChunk:label @Sp @Newline { label }")
diff --git a/lib/rdoc/markdown/entities.rb b/lib/rdoc/markdown/entities.rb
index d2cf610293..0661abab78 100644
--- a/lib/rdoc/markdown/entities.rb
+++ b/lib/rdoc/markdown/entities.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# HTML entity name map for RDoc::Markdown
diff --git a/lib/rdoc/markdown/literals.rb b/lib/rdoc/markdown/literals.rb
deleted file mode 100644
index cd4cb52335..0000000000
--- a/lib/rdoc/markdown/literals.rb
+++ /dev/null
@@ -1,416 +0,0 @@
-# coding: UTF-8
-# :markup: markdown
-
-##
-#--
-# This set of literals is for Ruby 1.9 regular expressions and gives full
-# unicode support.
-#
-# Unlike peg-markdown, this set of literals recognizes Unicode alphanumeric
-# characters, newlines and spaces.
-class RDoc::Markdown::Literals
- # :stopdoc:
-
- # This is distinct from setup_parser so that a standalone parser
- # can redefine #initialize and still have access to the proper
- # parser setup code.
- def initialize(str, debug=false)
- setup_parser(str, debug)
- end
-
-
-
- # Prepares for parsing +str+. If you define a custom initialize you must
- # call this method before #parse
- def setup_parser(str, debug=false)
- set_string str, 0
- @memoizations = Hash.new { |h,k| h[k] = {} }
- @result = nil
- @failed_rule = nil
- @failing_rule_offset = -1
-
- setup_foreign_grammar
- end
-
- attr_reader :string
- attr_reader :failing_rule_offset
- attr_accessor :result, :pos
-
- def current_column(target=pos)
- if c = string.rindex("\n", target-1)
- return target - c - 1
- end
-
- target + 1
- end
-
- def current_line(target=pos)
- cur_offset = 0
- cur_line = 0
-
- string.each_line do |line|
- cur_line += 1
- cur_offset += line.size
- return cur_line if cur_offset >= target
- end
-
- -1
- end
-
- def lines
- lines = []
- string.each_line { |l| lines << l }
- lines
- end
-
-
-
- def get_text(start)
- @string[start..@pos-1]
- end
-
- # Sets the string and current parsing position for the parser.
- def set_string string, pos
- @string = string
- @string_size = string ? string.size : 0
- @pos = pos
- end
-
- def show_pos
- width = 10
- if @pos < width
- "#{@pos} (\"#{@string[0,@pos]}\" @ \"#{@string[@pos,width]}\")"
- else
- "#{@pos} (\"... #{@string[@pos - width, width]}\" @ \"#{@string[@pos,width]}\")"
- end
- end
-
- def failure_info
- l = current_line @failing_rule_offset
- c = current_column @failing_rule_offset
-
- if @failed_rule.kind_of? Symbol
- info = self.class::Rules[@failed_rule]
- "line #{l}, column #{c}: failed rule '#{info.name}' = '#{info.rendered}'"
- else
- "line #{l}, column #{c}: failed rule '#{@failed_rule}'"
- end
- end
-
- def failure_caret
- l = current_line @failing_rule_offset
- c = current_column @failing_rule_offset
-
- line = lines[l-1]
- "#{line}\n#{' ' * (c - 1)}^"
- end
-
- def failure_character
- l = current_line @failing_rule_offset
- c = current_column @failing_rule_offset
- lines[l-1][c-1, 1]
- end
-
- def failure_oneline
- l = current_line @failing_rule_offset
- c = current_column @failing_rule_offset
-
- char = lines[l-1][c-1, 1]
-
- if @failed_rule.kind_of? Symbol
- info = self.class::Rules[@failed_rule]
- "@#{l}:#{c} failed rule '#{info.name}', got '#{char}'"
- else
- "@#{l}:#{c} failed rule '#{@failed_rule}', got '#{char}'"
- end
- end
-
- class ParseError < RuntimeError
- end
-
- def raise_error
- raise ParseError, failure_oneline
- end
-
- def show_error(io=STDOUT)
- error_pos = @failing_rule_offset
- line_no = current_line(error_pos)
- col_no = current_column(error_pos)
-
- io.puts "On line #{line_no}, column #{col_no}:"
-
- if @failed_rule.kind_of? Symbol
- info = self.class::Rules[@failed_rule]
- io.puts "Failed to match '#{info.rendered}' (rule '#{info.name}')"
- else
- io.puts "Failed to match rule '#{@failed_rule}'"
- end
-
- io.puts "Got: #{string[error_pos,1].inspect}"
- line = lines[line_no-1]
- io.puts "=> #{line}"
- io.print(" " * (col_no + 3))
- io.puts "^"
- end
-
- def set_failed_rule(name)
- if @pos > @failing_rule_offset
- @failed_rule = name
- @failing_rule_offset = @pos
- end
- end
-
- attr_reader :failed_rule
-
- def match_string(str)
- len = str.size
- if @string[pos,len] == str
- @pos += len
- return str
- end
-
- return nil
- end
-
- def scan(reg)
- if m = reg.match(@string[@pos..-1])
- width = m.end(0)
- @pos += width
- return true
- end
-
- return nil
- end
-
- if "".respond_to? :ord
- def get_byte
- if @pos >= @string_size
- return nil
- end
-
- s = @string[@pos].ord
- @pos += 1
- s
- end
- else
- def get_byte
- if @pos >= @string_size
- return nil
- end
-
- s = @string[@pos]
- @pos += 1
- s
- end
- end
-
- def parse(rule=nil)
- # We invoke the rules indirectly via apply
- # instead of by just calling them as methods because
- # if the rules use left recursion, apply needs to
- # manage that.
-
- if !rule
- apply(:_root)
- else
- method = rule.gsub("-","_hyphen_")
- apply :"_#{method}"
- end
- end
-
- class MemoEntry
- def initialize(ans, pos)
- @ans = ans
- @pos = pos
- @result = nil
- @set = false
- @left_rec = false
- end
-
- attr_reader :ans, :pos, :result, :set
- attr_accessor :left_rec
-
- def move!(ans, pos, result)
- @ans = ans
- @pos = pos
- @result = result
- @set = true
- @left_rec = false
- end
- end
-
- def external_invoke(other, rule, *args)
- old_pos = @pos
- old_string = @string
-
- set_string other.string, other.pos
-
- begin
- if val = __send__(rule, *args)
- other.pos = @pos
- other.result = @result
- else
- other.set_failed_rule "#{self.class}##{rule}"
- end
- val
- ensure
- set_string old_string, old_pos
- end
- end
-
- def apply_with_args(rule, *args)
- memo_key = [rule, args]
- if m = @memoizations[memo_key][@pos]
- @pos = m.pos
- if !m.set
- m.left_rec = true
- return nil
- end
-
- @result = m.result
-
- return m.ans
- else
- m = MemoEntry.new(nil, @pos)
- @memoizations[memo_key][@pos] = m
- start_pos = @pos
-
- ans = __send__ rule, *args
-
- lr = m.left_rec
-
- m.move! ans, @pos, @result
-
- # Don't bother trying to grow the left recursion
- # if it's failing straight away (thus there is no seed)
- if ans and lr
- return grow_lr(rule, args, start_pos, m)
- else
- return ans
- end
- end
- end
-
- def apply(rule)
- if m = @memoizations[rule][@pos]
- @pos = m.pos
- if !m.set
- m.left_rec = true
- return nil
- end
-
- @result = m.result
-
- return m.ans
- else
- m = MemoEntry.new(nil, @pos)
- @memoizations[rule][@pos] = m
- start_pos = @pos
-
- ans = __send__ rule
-
- lr = m.left_rec
-
- m.move! ans, @pos, @result
-
- # Don't bother trying to grow the left recursion
- # if it's failing straight away (thus there is no seed)
- if ans and lr
- return grow_lr(rule, nil, start_pos, m)
- else
- return ans
- end
- end
- end
-
- def grow_lr(rule, args, start_pos, m)
- while true
- @pos = start_pos
- @result = m.result
-
- if args
- ans = __send__ rule, *args
- else
- ans = __send__ rule
- end
- return nil unless ans
-
- break if @pos <= m.pos
-
- m.move! ans, @pos, @result
- end
-
- @result = m.result
- @pos = m.pos
- return m.ans
- end
-
- class RuleInfo
- def initialize(name, rendered)
- @name = name
- @rendered = rendered
- end
-
- attr_reader :name, :rendered
- end
-
- def self.rule_info(name, rendered)
- RuleInfo.new(name, rendered)
- end
-
-
- # :startdoc:
- # :stopdoc:
- def setup_foreign_grammar; end
-
- # Alphanumeric = /\p{Word}/
- def _Alphanumeric
- _tmp = scan(/\A(?-mix:\p{Word})/)
- set_failed_rule :_Alphanumeric unless _tmp
- return _tmp
- end
-
- # AlphanumericAscii = /[A-Za-z0-9]/
- def _AlphanumericAscii
- _tmp = scan(/\A(?-mix:[A-Za-z0-9])/)
- set_failed_rule :_AlphanumericAscii unless _tmp
- return _tmp
- end
-
- # BOM = "uFEFF"
- def _BOM
- _tmp = match_string("uFEFF")
- set_failed_rule :_BOM unless _tmp
- return _tmp
- end
-
- # Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
- def _Newline
- _tmp = scan(/\A(?-mix:\n|\r\n?|\p{Zl}|\p{Zp})/)
- set_failed_rule :_Newline unless _tmp
- return _tmp
- end
-
- # NonAlphanumeric = /\p{^Word}/
- def _NonAlphanumeric
- _tmp = scan(/\A(?-mix:\p{^Word})/)
- set_failed_rule :_NonAlphanumeric unless _tmp
- return _tmp
- end
-
- # Spacechar = /\t|\p{Zs}/
- def _Spacechar
- _tmp = scan(/\A(?-mix:\t|\p{Zs})/)
- set_failed_rule :_Spacechar unless _tmp
- return _tmp
- end
-
- Rules = {}
- Rules[:_Alphanumeric] = rule_info("Alphanumeric", "/\\p{Word}/")
- Rules[:_AlphanumericAscii] = rule_info("AlphanumericAscii", "/[A-Za-z0-9]/")
- Rules[:_BOM] = rule_info("BOM", "\"uFEFF\"")
- Rules[:_Newline] = rule_info("Newline", "/\\n|\\r\\n?|\\p{Zl}|\\p{Zp}/")
- Rules[:_NonAlphanumeric] = rule_info("NonAlphanumeric", "/\\p{^Word}/")
- Rules[:_Spacechar] = rule_info("Spacechar", "/\\t|\\p{Zs}/")
- # :startdoc:
-end
diff --git a/lib/rdoc/markdown/literals_1_9.rb b/lib/rdoc/markdown/literals_1_9.rb
new file mode 100644
index 0000000000..f7bfbe27a1
--- /dev/null
+++ b/lib/rdoc/markdown/literals_1_9.rb
@@ -0,0 +1,420 @@
+# coding: UTF-8
+# :markup: markdown
+
+##
+#--
+# This set of literals is for Ruby 1.9 regular expressions and gives full
+# unicode support.
+#
+# Unlike peg-markdown, this set of literals recognizes Unicode alphanumeric
+# characters, newlines and spaces.
+class RDoc::Markdown::Literals
+ # :stopdoc:
+
+ # This is distinct from setup_parser so that a standalone parser
+ # can redefine #initialize and still have access to the proper
+ # parser setup code.
+ def initialize(str, debug=false)
+ setup_parser(str, debug)
+ end
+
+
+
+ # Prepares for parsing +str+. If you define a custom initialize you must
+ # call this method before #parse
+ def setup_parser(str, debug=false)
+ set_string str, 0
+ @memoizations = Hash.new { |h,k| h[k] = {} }
+ @result = nil
+ @failed_rule = nil
+ @failing_rule_offset = -1
+
+ setup_foreign_grammar
+ end
+
+ attr_reader :string
+ attr_reader :failing_rule_offset
+ attr_accessor :result, :pos
+
+ def current_column(target=pos)
+ if c = string.rindex("\n", target-1)
+ return target - c - 1
+ end
+
+ target + 1
+ end
+
+ def current_line(target=pos)
+ cur_offset = 0
+ cur_line = 0
+
+ string.each_line do |line|
+ cur_line += 1
+ cur_offset += line.size
+ return cur_line if cur_offset >= target
+ end
+
+ -1
+ end
+
+ def lines
+ lines = []
+ string.each_line { |l| lines << l }
+ lines
+ end
+
+
+
+ def get_text(start)
+ @string[start..@pos-1]
+ end
+
+ # Sets the string and current parsing position for the parser.
+ def set_string string, pos
+ @string = string
+ @string_size = string ? string.size : 0
+ @pos = pos
+ end
+
+ def show_pos
+ width = 10
+ if @pos < width
+ "#{@pos} (\"#{@string[0,@pos]}\" @ \"#{@string[@pos,width]}\")"
+ else
+ "#{@pos} (\"... #{@string[@pos - width, width]}\" @ \"#{@string[@pos,width]}\")"
+ end
+ end
+
+ def failure_info
+ l = current_line @failing_rule_offset
+ c = current_column @failing_rule_offset
+
+ if @failed_rule.kind_of? Symbol
+ info = self.class::Rules[@failed_rule]
+ "line #{l}, column #{c}: failed rule '#{info.name}' = '#{info.rendered}'"
+ else
+ "line #{l}, column #{c}: failed rule '#{@failed_rule}'"
+ end
+ end
+
+ def failure_caret
+ l = current_line @failing_rule_offset
+ c = current_column @failing_rule_offset
+
+ line = lines[l-1]
+ "#{line}\n#{' ' * (c - 1)}^"
+ end
+
+ def failure_character
+ l = current_line @failing_rule_offset
+ c = current_column @failing_rule_offset
+ lines[l-1][c-1, 1]
+ end
+
+ def failure_oneline
+ l = current_line @failing_rule_offset
+ c = current_column @failing_rule_offset
+
+ char = lines[l-1][c-1, 1]
+
+ if @failed_rule.kind_of? Symbol
+ info = self.class::Rules[@failed_rule]
+ "@#{l}:#{c} failed rule '#{info.name}', got '#{char}'"
+ else
+ "@#{l}:#{c} failed rule '#{@failed_rule}', got '#{char}'"
+ end
+ end
+
+ class ParseError < RuntimeError
+ end
+
+ def raise_error
+ raise ParseError, failure_oneline
+ end
+
+ def show_error(io=STDOUT)
+ error_pos = @failing_rule_offset
+ line_no = current_line(error_pos)
+ col_no = current_column(error_pos)
+
+ io.puts "On line #{line_no}, column #{col_no}:"
+
+ if @failed_rule.kind_of? Symbol
+ info = self.class::Rules[@failed_rule]
+ io.puts "Failed to match '#{info.rendered}' (rule '#{info.name}')"
+ else
+ io.puts "Failed to match rule '#{@failed_rule}'"
+ end
+
+ io.puts "Got: #{string[error_pos,1].inspect}"
+ line = lines[line_no-1]
+ io.puts "=> #{line}"
+ io.print(" " * (col_no + 3))
+ io.puts "^"
+ end
+
+ def set_failed_rule(name)
+ if @pos > @failing_rule_offset
+ @failed_rule = name
+ @failing_rule_offset = @pos
+ end
+ end
+
+ attr_reader :failed_rule
+
+ def match_string(str)
+ len = str.size
+ if @string[pos,len] == str
+ @pos += len
+ return str
+ end
+
+ return nil
+ end
+
+ def scan(reg)
+ if m = reg.match(@string[@pos..-1])
+ width = m.end(0)
+ @pos += width
+ return true
+ end
+
+ return nil
+ end
+
+ if "".respond_to? :ord
+ def get_byte
+ if @pos >= @string_size
+ return nil
+ end
+
+ s = @string[@pos].ord
+ @pos += 1
+ s
+ end
+ else
+ def get_byte
+ if @pos >= @string_size
+ return nil
+ end
+
+ s = @string[@pos]
+ @pos += 1
+ s
+ end
+ end
+
+ def parse(rule=nil)
+ # We invoke the rules indirectly via apply
+ # instead of by just calling them as methods because
+ # if the rules use left recursion, apply needs to
+ # manage that.
+
+ if !rule
+ apply(:_root)
+ else
+ method = rule.gsub("-","_hyphen_")
+ apply :"_#{method}"
+ end
+ end
+
+ class MemoEntry
+ def initialize(ans, pos)
+ @ans = ans
+ @pos = pos
+ @result = nil
+ @set = false
+ @left_rec = false
+ end
+
+ attr_reader :ans, :pos, :result, :set
+ attr_accessor :left_rec
+
+ def move!(ans, pos, result)
+ @ans = ans
+ @pos = pos
+ @result = result
+ @set = true
+ @left_rec = false
+ end
+ end
+
+ def external_invoke(other, rule, *args)
+ old_pos = @pos
+ old_string = @string
+
+ set_string other.string, other.pos
+
+ begin
+ if val = __send__(rule, *args)
+ other.pos = @pos
+ other.result = @result
+ else
+ other.set_failed_rule "#{self.class}##{rule}"
+ end
+ val
+ ensure
+ set_string old_string, old_pos
+ end
+ end
+
+ def apply_with_args(rule, *args)
+ memo_key = [rule, args]
+ if m = @memoizations[memo_key][@pos]
+ @pos = m.pos
+ if !m.set
+ m.left_rec = true
+ return nil
+ end
+
+ @result = m.result
+
+ return m.ans
+ else
+ m = MemoEntry.new(nil, @pos)
+ @memoizations[memo_key][@pos] = m
+ start_pos = @pos
+
+ ans = __send__ rule, *args
+
+ lr = m.left_rec
+
+ m.move! ans, @pos, @result
+
+ # Don't bother trying to grow the left recursion
+ # if it's failing straight away (thus there is no seed)
+ if ans and lr
+ return grow_lr(rule, args, start_pos, m)
+ else
+ return ans
+ end
+
+ return ans
+ end
+ end
+
+ def apply(rule)
+ if m = @memoizations[rule][@pos]
+ @pos = m.pos
+ if !m.set
+ m.left_rec = true
+ return nil
+ end
+
+ @result = m.result
+
+ return m.ans
+ else
+ m = MemoEntry.new(nil, @pos)
+ @memoizations[rule][@pos] = m
+ start_pos = @pos
+
+ ans = __send__ rule
+
+ lr = m.left_rec
+
+ m.move! ans, @pos, @result
+
+ # Don't bother trying to grow the left recursion
+ # if it's failing straight away (thus there is no seed)
+ if ans and lr
+ return grow_lr(rule, nil, start_pos, m)
+ else
+ return ans
+ end
+
+ return ans
+ end
+ end
+
+ def grow_lr(rule, args, start_pos, m)
+ while true
+ @pos = start_pos
+ @result = m.result
+
+ if args
+ ans = __send__ rule, *args
+ else
+ ans = __send__ rule
+ end
+ return nil unless ans
+
+ break if @pos <= m.pos
+
+ m.move! ans, @pos, @result
+ end
+
+ @result = m.result
+ @pos = m.pos
+ return m.ans
+ end
+
+ class RuleInfo
+ def initialize(name, rendered)
+ @name = name
+ @rendered = rendered
+ end
+
+ attr_reader :name, :rendered
+ end
+
+ def self.rule_info(name, rendered)
+ RuleInfo.new(name, rendered)
+ end
+
+
+ # :startdoc:
+ # :stopdoc:
+ def setup_foreign_grammar; end
+
+ # Alphanumeric = /\p{Word}/
+ def _Alphanumeric
+ _tmp = scan(/\A(?-mix:\p{Word})/)
+ set_failed_rule :_Alphanumeric unless _tmp
+ return _tmp
+ end
+
+ # AlphanumericAscii = /[A-Za-z0-9]/
+ def _AlphanumericAscii
+ _tmp = scan(/\A(?-mix:[A-Za-z0-9])/)
+ set_failed_rule :_AlphanumericAscii unless _tmp
+ return _tmp
+ end
+
+ # BOM = "uFEFF"
+ def _BOM
+ _tmp = match_string("uFEFF")
+ set_failed_rule :_BOM unless _tmp
+ return _tmp
+ end
+
+ # Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
+ def _Newline
+ _tmp = scan(/\A(?-mix:\n|\r\n?|\p{Zl}|\p{Zp})/)
+ set_failed_rule :_Newline unless _tmp
+ return _tmp
+ end
+
+ # NonAlphanumeric = /\p{^Word}/
+ def _NonAlphanumeric
+ _tmp = scan(/\A(?-mix:\p{^Word})/)
+ set_failed_rule :_NonAlphanumeric unless _tmp
+ return _tmp
+ end
+
+ # Spacechar = /\t|\p{Zs}/
+ def _Spacechar
+ _tmp = scan(/\A(?-mix:\t|\p{Zs})/)
+ set_failed_rule :_Spacechar unless _tmp
+ return _tmp
+ end
+
+ Rules = {}
+ Rules[:_Alphanumeric] = rule_info("Alphanumeric", "/\\p{Word}/")
+ Rules[:_AlphanumericAscii] = rule_info("AlphanumericAscii", "/[A-Za-z0-9]/")
+ Rules[:_BOM] = rule_info("BOM", "\"uFEFF\"")
+ Rules[:_Newline] = rule_info("Newline", "/\\n|\\r\\n?|\\p{Zl}|\\p{Zp}/")
+ Rules[:_NonAlphanumeric] = rule_info("NonAlphanumeric", "/\\p{^Word}/")
+ Rules[:_Spacechar] = rule_info("Spacechar", "/\\t|\\p{Zs}/")
+ # :startdoc:
+end
diff --git a/lib/rdoc/markup.rb b/lib/rdoc/markup.rb
index 08ecc6f7df..0e754ff33d 100644
--- a/lib/rdoc/markup.rb
+++ b/lib/rdoc/markup.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# RDoc::Markup parses plain text documents and attempts to decompose them into
# their constituent parts. Some of these parts are high-level: paragraphs,
@@ -377,7 +376,7 @@
#
# Example links:
#
-# https://github.com/ruby/rdoc
+# https://github.com/rdoc/rdoc
# mailto:user@example.com
# {RDoc Documentation}[http://rdoc.rubyforge.org]
# {RDoc Markup}[rdoc-ref:RDoc::Markup]
@@ -764,7 +763,7 @@ Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} #{RUBY_RELEASE_DATE}
Please file a bug report with the above information at:
-https://github.com/ruby/rdoc/issues
+https://github.com/rdoc/rdoc/issues
EOF
raise
diff --git a/lib/rdoc/markup/attr_changer.rb b/lib/rdoc/markup/attr_changer.rb
index 4c4bc6479e..1772f18b2b 100644
--- a/lib/rdoc/markup/attr_changer.rb
+++ b/lib/rdoc/markup/attr_changer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class RDoc::Markup
AttrChanger = Struct.new :turn_on, :turn_off # :nodoc:
diff --git a/lib/rdoc/markup/attr_span.rb b/lib/rdoc/markup/attr_span.rb
index 63aace60d2..b5c1b3b7b7 100644
--- a/lib/rdoc/markup/attr_span.rb
+++ b/lib/rdoc/markup/attr_span.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An array of attributes which parallels the characters in a string.
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb
index a10f731615..ce4ac76d5b 100644
--- a/lib/rdoc/markup/attribute_manager.rb
+++ b/lib/rdoc/markup/attribute_manager.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Manages changes of attributes in a block of text
@@ -246,7 +245,7 @@ class RDoc::Markup::AttributeManager
# Processes +str+ converting attributes, HTML and specials
def flow str
- @str = str.dup
+ @str = str
mask_protected_sequences
diff --git a/lib/rdoc/markup/attributes.rb b/lib/rdoc/markup/attributes.rb
index ec30160d3d..3423f10ca7 100644
--- a/lib/rdoc/markup/attributes.rb
+++ b/lib/rdoc/markup/attributes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# We manage a set of attributes. Each attribute has a symbol name and a bit
# value.
diff --git a/lib/rdoc/markup/blank_line.rb b/lib/rdoc/markup/blank_line.rb
index 3129ab5e7f..5da0ac8d81 100644
--- a/lib/rdoc/markup/blank_line.rb
+++ b/lib/rdoc/markup/blank_line.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An empty line. This class is a singleton.
diff --git a/lib/rdoc/markup/block_quote.rb b/lib/rdoc/markup/block_quote.rb
index 7a4b3e36b0..552f0c4baa 100644
--- a/lib/rdoc/markup/block_quote.rb
+++ b/lib/rdoc/markup/block_quote.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A quoted section which contains markup items.
diff --git a/lib/rdoc/markup/document.rb b/lib/rdoc/markup/document.rb
index f3a5de1fc3..be93d80eec 100644
--- a/lib/rdoc/markup/document.rb
+++ b/lib/rdoc/markup/document.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Document containing lists, headings, paragraphs, etc.
diff --git a/lib/rdoc/markup/formatter.rb b/lib/rdoc/markup/formatter.rb
index 5dc71d2242..7661c95239 100644
--- a/lib/rdoc/markup/formatter.rb
+++ b/lib/rdoc/markup/formatter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Base class for RDoc markup formatters
#
diff --git a/lib/rdoc/markup/formatter_test_case.rb b/lib/rdoc/markup/formatter_test_case.rb
index 076b7c81bb..6616a75898 100644
--- a/lib/rdoc/markup/formatter_test_case.rb
+++ b/lib/rdoc/markup/formatter_test_case.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'minitest/unit'
##
@@ -177,6 +176,9 @@ class RDoc::Markup::FormatterTestCase < RDoc::TestCase
# Calls accept_heading_3 with a level 3 RDoc::Markup::Heading
def test_accept_heading_3
+ # HACK this doesn't belong here
+ skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
+
@to.start_accepting
@to.accept_heading @RM::Heading.new(3, 'Hello')
@@ -762,3 +764,4 @@ class RDoc::Markup::FormatterTestCase < RDoc::TestCase
end
end
+
diff --git a/lib/rdoc/markup/hard_break.rb b/lib/rdoc/markup/hard_break.rb
index 046068d5c2..8445ad26e7 100644
--- a/lib/rdoc/markup/hard_break.rb
+++ b/lib/rdoc/markup/hard_break.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A hard-break in the middle of a paragraph.
diff --git a/lib/rdoc/markup/heading.rb b/lib/rdoc/markup/heading.rb
index 233774c5c4..535e310e54 100644
--- a/lib/rdoc/markup/heading.rb
+++ b/lib/rdoc/markup/heading.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A heading with a level (1-6) and text
diff --git a/lib/rdoc/markup/include.rb b/lib/rdoc/markup/include.rb
index ad7c4a9640..a2e8903279 100644
--- a/lib/rdoc/markup/include.rb
+++ b/lib/rdoc/markup/include.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A file included at generation time. Objects of this class are created by
# RDoc::RD for an extension-less include.
diff --git a/lib/rdoc/markup/indented_paragraph.rb b/lib/rdoc/markup/indented_paragraph.rb
index d42b2e52b8..1b8a8c725d 100644
--- a/lib/rdoc/markup/indented_paragraph.rb
+++ b/lib/rdoc/markup/indented_paragraph.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An Indented Paragraph of text
diff --git a/lib/rdoc/markup/inline.rb b/lib/rdoc/markup/inline.rb
index aba7ec21ce..fb3ab5c74d 100644
--- a/lib/rdoc/markup/inline.rb
+++ b/lib/rdoc/markup/inline.rb
@@ -1,2 +1 @@
-# frozen_string_literal: true
warn "requiring rdoc/markup/inline is deprecated and will be removed in RDoc 4." if $-w
diff --git a/lib/rdoc/markup/list.rb b/lib/rdoc/markup/list.rb
index 05c3609202..89b7fc20fa 100644
--- a/lib/rdoc/markup/list.rb
+++ b/lib/rdoc/markup/list.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A List is a homogeneous set of ListItems.
#
diff --git a/lib/rdoc/markup/list_item.rb b/lib/rdoc/markup/list_item.rb
index d22554ee73..c5e59fe167 100644
--- a/lib/rdoc/markup/list_item.rb
+++ b/lib/rdoc/markup/list_item.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An item within a List that contains paragraphs, headings, etc.
#
diff --git a/lib/rdoc/markup/paragraph.rb b/lib/rdoc/markup/paragraph.rb
index a2e45ef009..7180729f75 100644
--- a/lib/rdoc/markup/paragraph.rb
+++ b/lib/rdoc/markup/paragraph.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Paragraph of text
diff --git a/lib/rdoc/markup/parser.rb b/lib/rdoc/markup/parser.rb
index f08587e676..cc828a4513 100644
--- a/lib/rdoc/markup/parser.rb
+++ b/lib/rdoc/markup/parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'strscan'
##
@@ -79,6 +78,8 @@ class RDoc::Markup::Parser
@binary_input = nil
@current_token = nil
@debug = false
+ @have_encoding = Object.const_defined? :Encoding
+ @have_byteslice = ''.respond_to? :byteslice
@input = nil
@input_encoding = nil
@line = 0
@@ -249,7 +250,7 @@ class RDoc::Markup::Parser
min_indent = nil
generate_leading_spaces = true
- line = ''.dup
+ line = ''
until @tokens.empty? do
type, data, column, = get
@@ -257,7 +258,7 @@ class RDoc::Markup::Parser
if type == :NEWLINE then
line << data
verbatim << line
- line = ''.dup
+ line = ''
generate_leading_spaces = true
next
end
@@ -322,7 +323,15 @@ class RDoc::Markup::Parser
# The character offset for the input string at the given +byte_offset+
def char_pos byte_offset
- @input.byteslice(0, byte_offset).length
+ if @have_byteslice then
+ @input.byteslice(0, byte_offset).length
+ elsif @have_encoding then
+ matched = @binary_input[0, byte_offset]
+ matched.force_encoding @input_encoding
+ matched.length
+ else
+ byte_offset
+ end
end
##
@@ -420,6 +429,11 @@ class RDoc::Markup::Parser
@line_pos = 0
@input = input.dup
+ if @have_encoding and not @have_byteslice then
+ @input_encoding = @input.encoding
+ @binary_input = @input.force_encoding Encoding::BINARY
+ end
+
@s = StringScanner.new input
end
@@ -541,3 +555,4 @@ class RDoc::Markup::Parser
end
end
+
diff --git a/lib/rdoc/markup/pre_process.rb b/lib/rdoc/markup/pre_process.rb
index 0ac7a41934..01fb293462 100644
--- a/lib/rdoc/markup/pre_process.rb
+++ b/lib/rdoc/markup/pre_process.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Handle common directives that can occur in a block of text:
#
@@ -102,10 +101,12 @@ class RDoc::Markup::PreProcess
text = text.text
end
+ encoding = text.encoding if defined?(Encoding)
+
# regexp helper (square brackets for optional)
# $1 $2 $3 $4 $5
# [prefix][\]:directive:[spaces][param]newline
- text = text.gsub(/^([ \t]*(?:#|\/?\*)?[ \t]*)(\\?):(\w+):([ \t]*)(.+)?(\r?\n|$)/) do
+ text.gsub!(/^([ \t]*(?:#|\/?\*)?[ \t]*)(\\?):(\w+):([ \t]*)(.+)?(\r?\n|$)/) do
# skip something like ':toto::'
next $& if $4.empty? and $5 and $5[0, 1] == ':'
@@ -120,14 +121,10 @@ class RDoc::Markup::PreProcess
next "#{$1.strip}\n"
end
- handle_directive $1, $3, $5, code_object, text.encoding, &block
+ handle_directive $1, $3, $5, code_object, encoding, &block
end
- if comment then
- comment.text = text
- else
- comment = text
- end
+ comment = text unless comment
self.class.post_processors.each do |handler|
handler.call comment, code_object
@@ -154,7 +151,7 @@ class RDoc::Markup::PreProcess
case directive
when 'arg', 'args' then
- return "#{prefix}:#{directive}: #{param}\n" unless code_object && code_object.kind_of?(RDoc::AnyMethod)
+ return "#{prefix}:#{directive}: #{param}\n" unless code_object
code_object.params = param
@@ -216,7 +213,7 @@ class RDoc::Markup::PreProcess
when 'yield', 'yields' then
return blankline unless code_object
# remove parameter &block
- code_object.params = code_object.params.sub(/,?\s*&\w+/, '') if code_object.params
+ code_object.params.sub!(/,?\s*&\w+/, '') if code_object.params
code_object.block_params = param
@@ -293,3 +290,4 @@ class RDoc::Markup::PreProcess
end
end
+
diff --git a/lib/rdoc/markup/raw.rb b/lib/rdoc/markup/raw.rb
index 85e2c8b825..e11e8efff4 100644
--- a/lib/rdoc/markup/raw.rb
+++ b/lib/rdoc/markup/raw.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A section of text that is added to the output document as-is
diff --git a/lib/rdoc/markup/rule.rb b/lib/rdoc/markup/rule.rb
index 38c1dc7f56..b778f2bc09 100644
--- a/lib/rdoc/markup/rule.rb
+++ b/lib/rdoc/markup/rule.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A horizontal rule with a weight
diff --git a/lib/rdoc/markup/special.rb b/lib/rdoc/markup/special.rb
index 57261b44a7..1c0fc03eea 100644
--- a/lib/rdoc/markup/special.rb
+++ b/lib/rdoc/markup/special.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Hold details of a special sequence
diff --git a/lib/rdoc/markup/text_formatter_test_case.rb b/lib/rdoc/markup/text_formatter_test_case.rb
index 22a762b5f0..4abf42563b 100644
--- a/lib/rdoc/markup/text_formatter_test_case.rb
+++ b/lib/rdoc/markup/text_formatter_test_case.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Test case for creating new plain-text RDoc::Markup formatters. See also
# RDoc::Markup::FormatterTestCase
diff --git a/lib/rdoc/markup/to_ansi.rb b/lib/rdoc/markup/to_ansi.rb
index 6cc3b70e93..4d439ce88d 100644
--- a/lib/rdoc/markup/to_ansi.rb
+++ b/lib/rdoc/markup/to_ansi.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Outputs RDoc markup with vibrant ANSI color!
diff --git a/lib/rdoc/markup/to_bs.rb b/lib/rdoc/markup/to_bs.rb
index fea017e89d..10c31854d2 100644
--- a/lib/rdoc/markup/to_bs.rb
+++ b/lib/rdoc/markup/to_bs.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Outputs RDoc markup with hot backspace action! You will probably need a
# pager to use this output format.
@@ -64,6 +63,7 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
# Adds bold or underline mixed with backspaces
def convert_string string
+ return string unless string.respond_to? :chars # your ruby is lame
return string unless @in_b or @in_em
chars = if @in_b then
string.chars.map do |char| "#{char}\b#{char}" end
@@ -75,3 +75,4 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
end
end
+
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb
index c5e1f073f8..823b023e72 100644
--- a/lib/rdoc/markup/to_html.rb
+++ b/lib/rdoc/markup/to_html.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'cgi'
##
@@ -200,13 +199,11 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
content = if verbatim.ruby? or parseable? text then
begin
- tokens = RDoc::RipperStateLex.parse text
+ tokens = RDoc::RubyLex.tokenize text, @options
klass = ' class="ruby"'
- result = RDoc::TokenStream.to_html tokens
- result = result + "\n" unless "\n" == result[-1]
- result
- rescue
+ RDoc::TokenStream.to_html tokens
+ rescue RDoc::RubyLex::Error
CGI.escapeHTML text
end
else
@@ -214,7 +211,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
end
if @options.pipe then
- @res << "\n<pre><code>#{CGI.escapeHTML text}\n</code></pre>\n"
+ @res << "\n<pre><code>#{CGI.escapeHTML text}</code></pre>\n"
else
@res << "\n<pre#{klass}>#{content}</pre>\n"
end
@@ -289,7 +286,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
@res << to_html(heading.text)
unless @options.pipe then
@res << "<span><a href=\"##{label}\">&para;</a>"
- @res << " <a href=\"#top\">&uarr;</a></span>"
+ @res << " <a href=\"#documentation\">&uarr;</a></span>"
end
@res << "</h#{level}>\n"
end
@@ -382,15 +379,11 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
end
##
- # Returns true if text is valid ruby syntax
+ # Returns true if Ripper is available it can create a sexp from +text+
def parseable? text
- verbose, $VERBOSE = $VERBOSE, nil
- eval("BEGIN {return true}\n#{text}")
- rescue SyntaxError
- false
- ensure
- $VERBOSE = verbose
+ text =~ /\b(def|class|module|require) |=>|\{\s?\||do \|/ and
+ text !~ /<%|%>/
end
##
diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb
index 2911aee954..d27e0ab627 100644
--- a/lib/rdoc/markup/to_html_crossref.rb
+++ b/lib/rdoc/markup/to_html_crossref.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Subclass of the RDoc::Markup::ToHtml class that supports looking up method
# names, classes, etc to create links. RDoc::CrossReference is used to
diff --git a/lib/rdoc/markup/to_html_snippet.rb b/lib/rdoc/markup/to_html_snippet.rb
index 24aa1d32d9..4ad0a9a4b9 100644
--- a/lib/rdoc/markup/to_html_snippet.rb
+++ b/lib/rdoc/markup/to_html_snippet.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Outputs RDoc markup as paragraphs with inline markup only.
diff --git a/lib/rdoc/markup/to_joined_paragraph.rb b/lib/rdoc/markup/to_joined_paragraph.rb
index 795f3f62ee..835841071d 100644
--- a/lib/rdoc/markup/to_joined_paragraph.rb
+++ b/lib/rdoc/markup/to_joined_paragraph.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Joins the parts of an RDoc::Markup::Paragraph into a single String.
#
@@ -23,11 +22,37 @@ class RDoc::Markup::ToJoinedParagraph < RDoc::Markup::Formatter
# Converts the parts of +paragraph+ to a single entry.
def accept_paragraph paragraph
- parts = paragraph.parts.chunk do |part|
- String === part
- end.map do |string, chunk|
- string ? chunk.join.rstrip : chunk
- end.flatten
+ parts = []
+ string = false
+
+ paragraph.parts.each do |part|
+ if String === part then
+ if string then
+ string << part
+ else
+ parts << part
+ string = part
+ end
+ else
+ parts << part
+ string = false
+ end
+ end
+
+ parts = parts.map do |part|
+ if String === part then
+ part.rstrip
+ else
+ part
+ end
+ end
+
+ # TODO use Enumerable#chunk when Ruby 1.8 support is dropped
+ #parts = paragraph.parts.chunk do |part|
+ # String === part
+ #end.map do |string, chunk|
+ # string ? chunk.join.rstrip : chunk
+ #end.flatten
paragraph.parts.replace parts
end
diff --git a/lib/rdoc/markup/to_label.rb b/lib/rdoc/markup/to_label.rb
index 9f179013f2..ace89c324a 100644
--- a/lib/rdoc/markup/to_label.rb
+++ b/lib/rdoc/markup/to_label.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'cgi'
##
@@ -32,7 +31,7 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter
def convert text
label = convert_flow @am.flow text
- CGI.escape(label).gsub('%', '-').sub(/^-/, '')
+ CGI.escape label
end
##
diff --git a/lib/rdoc/markup/to_markdown.rb b/lib/rdoc/markup/to_markdown.rb
index d471032f9f..d4b15bf41b 100644
--- a/lib/rdoc/markup/to_markdown.rb
+++ b/lib/rdoc/markup/to_markdown.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# :markup: markdown
##
diff --git a/lib/rdoc/markup/to_rdoc.rb b/lib/rdoc/markup/to_rdoc.rb
index 1cb4d6bab2..f16b4ed5a3 100644
--- a/lib/rdoc/markup/to_rdoc.rb
+++ b/lib/rdoc/markup/to_rdoc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Outputs RDoc markup as RDoc markup! (mostly)
diff --git a/lib/rdoc/markup/to_table_of_contents.rb b/lib/rdoc/markup/to_table_of_contents.rb
index f68b90bcf6..2e0f98cfeb 100644
--- a/lib/rdoc/markup/to_table_of_contents.rb
+++ b/lib/rdoc/markup/to_table_of_contents.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Extracts just the RDoc::Markup::Heading elements from a
# RDoc::Markup::Document to help build a table of contents
diff --git a/lib/rdoc/markup/to_test.rb b/lib/rdoc/markup/to_test.rb
index 61d3cffaf0..c51f64b917 100644
--- a/lib/rdoc/markup/to_test.rb
+++ b/lib/rdoc/markup/to_test.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# This Markup outputter is used for testing purposes.
diff --git a/lib/rdoc/markup/to_tt_only.rb b/lib/rdoc/markup/to_tt_only.rb
index 4f43546e3d..e2da20c6f3 100644
--- a/lib/rdoc/markup/to_tt_only.rb
+++ b/lib/rdoc/markup/to_tt_only.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Extracts sections of text enclosed in plus, tt or code. Used to discover
# undocumented parameters.
diff --git a/lib/rdoc/markup/verbatim.rb b/lib/rdoc/markup/verbatim.rb
index 7f1bc29a09..0ddde675e3 100644
--- a/lib/rdoc/markup/verbatim.rb
+++ b/lib/rdoc/markup/verbatim.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A section of verbatim text
diff --git a/lib/rdoc/meta_method.rb b/lib/rdoc/meta_method.rb
index 7927a9ce9c..68ba8109e0 100644
--- a/lib/rdoc/meta_method.rb
+++ b/lib/rdoc/meta_method.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# MetaMethod represents a meta-programmed method
diff --git a/lib/rdoc/method_attr.rb b/lib/rdoc/method_attr.rb
index 3cef78c4a5..a0ea851dc5 100644
--- a/lib/rdoc/method_attr.rb
+++ b/lib/rdoc/method_attr.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Abstract class representing either a method or an attribute.
@@ -188,7 +187,7 @@ class RDoc::MethodAttr < RDoc::CodeObject
next if String === ancestor
next if parent == ancestor
- other = ancestor.find_method_named('#' + name) ||
+ other = ancestor.find_method_named('#' << name) ||
ancestor.find_attribute_named(name)
return other if other
diff --git a/lib/rdoc/mixin.rb b/lib/rdoc/mixin.rb
index 379d7cc526..547744f870 100644
--- a/lib/rdoc/mixin.rb
+++ b/lib/rdoc/mixin.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Mixin adds features from a module into another context. RDoc::Include and
# RDoc::Extend are both mixins.
diff --git a/lib/rdoc/normal_class.rb b/lib/rdoc/normal_class.rb
index 6729b18448..7589e2686c 100644
--- a/lib/rdoc/normal_class.rb
+++ b/lib/rdoc/normal_class.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A normal class, neither singleton nor anonymous
@@ -47,9 +46,9 @@ class RDoc::NormalClass < RDoc::ClassModule
def to_s # :nodoc:
display = "#{self.class.name} #{self.full_name}"
if superclass
- display += ' < ' + (superclass.is_a?(String) ? superclass : superclass.full_name)
+ display << ' < ' << (superclass.is_a?(String) ? superclass : superclass.full_name)
end
- display += ' -> ' + is_alias_for.to_s if is_alias_for
+ display << ' -> ' << is_alias_for.to_s if is_alias_for
display
end
diff --git a/lib/rdoc/normal_module.rb b/lib/rdoc/normal_module.rb
index 8f364be41c..961c431ed6 100644
--- a/lib/rdoc/normal_module.rb
+++ b/lib/rdoc/normal_module.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A normal module, like NormalClass
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 17bbca81fe..5779d35c44 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'optparse'
require 'pathname'
@@ -379,15 +378,23 @@ class RDoc::Options
@visibility = :protected
@webcvs = nil
@write_options = false
- @encoding = Encoding::UTF_8
- @charset = @encoding.name
+
+ if Object.const_defined? :Encoding then
+ @encoding = Encoding::UTF_8
+ @charset = @encoding.name
+ else
+ @encoding = nil
+ @charset = 'UTF-8'
+ end
end
def init_with map # :nodoc:
init_ivars
encoding = map['encoding']
- @encoding = encoding ? Encoding.find(encoding) : encoding
+ @encoding = if Object.const_defined? :Encoding then
+ encoding ? Encoding.find(encoding) : encoding
+ end
@charset = map['charset']
@exclude = map['exclude']
@@ -624,16 +631,16 @@ Usage: #{opt.program_name} [options] [names...]
end
parsers.sort.each do |parser, regexp|
- opt.banner += " - #{parser}: #{regexp.join ', '}\n"
+ opt.banner << " - #{parser}: #{regexp.join ', '}\n"
end
- opt.banner += " - TomDoc: Only in ruby files\n"
+ opt.banner << " - TomDoc: Only in ruby files\n"
- opt.banner += "\n The following options are deprecated:\n\n"
+ opt.banner << "\n The following options are deprecated:\n\n"
name_length = DEPRECATED.keys.sort_by { |k| k.length }.last.length
DEPRECATED.sort_by { |k,| k }.each do |name, reason|
- opt.banner += " %*1$2$s %3$s\n" % [-name_length, name, reason]
+ opt.banner << " %*1$2$s %3$s\n" % [-name_length, name, reason]
end
opt.accept Template do |template|
@@ -681,16 +688,19 @@ Usage: #{opt.program_name} [options] [names...]
opt.separator "Parsing options:"
opt.separator nil
- opt.on("--encoding=ENCODING", "-e", Encoding.list.map { |e| e.name },
- "Specifies the output encoding. All files",
- "read will be converted to this encoding.",
- "The default encoding is UTF-8.",
- "--encoding is preferred over --charset") do |value|
- @encoding = Encoding.find value
- @charset = @encoding.name # may not be valid value
- end
+ if Object.const_defined? :Encoding then
+ opt.on("--encoding=ENCODING", "-e", Encoding.list.map { |e| e.name },
+ "Specifies the output encoding. All files",
+ "read will be converted to this encoding.",
+ "The default encoding is UTF-8.",
+ "--encoding is preferred over --charset") do |value|
+ @encoding = Encoding.find value
+ @charset = @encoding.name # may not be valid value
+ end
+
+ opt.separator nil
+ end
- opt.separator nil
opt.on("--locale=NAME",
"Specifies the output locale.") do |value|
@@ -1087,7 +1097,7 @@ Usage: #{opt.program_name} [options] [names...]
unless quiet then
deprecated.each do |opt|
- $stderr.puts 'option ' + opt + ' is deprecated: ' + DEPRECATED[opt]
+ $stderr.puts 'option ' << opt << ' is deprecated: ' << DEPRECATED[opt]
end
end
@@ -1187,6 +1197,19 @@ Usage: #{opt.program_name} [options] [names...]
end
end
+ ##
+ # This is compatibility code for syck
+
+ def to_yaml opts = {} # :nodoc:
+ return super if YAML.const_defined?(:ENGINE) and not YAML::ENGINE.syck?
+
+ YAML.quick_emit self, opts do |out|
+ out.map taguri, to_yaml_style do |map|
+ encode_with map
+ end
+ end
+ end
+
# Sets the minimum visibility of a documented method.
#
# Accepts +:public+, +:protected+, +:private+, +:nodoc+, or +:all+.
@@ -1218,10 +1241,11 @@ Usage: #{opt.program_name} [options] [names...]
RDoc.load_yaml
open '.rdoc_options', 'w' do |io|
- io.set_encoding Encoding::UTF_8
+ io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding
YAML.dump self, io
end
end
end
+
diff --git a/lib/rdoc/parser.rb b/lib/rdoc/parser.rb
index 2b826d9284..4da7f00d3c 100644
--- a/lib/rdoc/parser.rb
+++ b/lib/rdoc/parser.rb
@@ -1,5 +1,4 @@
# -*- coding: us-ascii -*-
-# frozen_string_literal: true
##
# A parser is simple a class that subclasses RDoc::Parser and implements #scan
@@ -76,15 +75,50 @@ class RDoc::Parser
s = File.read(file, 1024) or return false
+ have_encoding = s.respond_to? :encoding
+
return true if s[0, 2] == Marshal.dump('')[0, 2] or s.index("\x00")
- mode = 'r:utf-8' # default source encoding has been chagened to utf-8
- s.sub!(/\A#!.*\n/, '') # assume shebang line isn't longer than 1024.
- encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*([^\s;]+?)(?:-\*-|[\s;])/, 1]
- mode = "rb:#{encoding}" if encoding
- s = File.open(file, mode) {|f| f.gets(nil, 1024)}
+ if have_encoding then
+ mode = "r"
+ s.sub!(/\A#!.*\n/, '') # assume shebang line isn't longer than 1024.
+ encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*([^\s;]+?)(?:-\*-|[\s;])/, 1]
+ mode = "rb:#{encoding}" if encoding
+ s = File.open(file, mode) {|f| f.gets(nil, 1024)}
+
+ not s.valid_encoding?
+ else
+ if 0.respond_to? :fdiv then
+ s.count("\x00-\x7F", "^ -~\t\r\n").fdiv(s.size) > 0.3
+ else # HACK 1.8.6
+ (s.count("\x00-\x7F", "^ -~\t\r\n").to_f / s.size) > 0.3
+ end
+ end
+ end
- not s.valid_encoding?
+ ##
+ # Processes common directives for CodeObjects for the C and Ruby parsers.
+ #
+ # Applies +directive+'s +value+ to +code_object+, if appropriate
+
+ def self.process_directive code_object, directive, value
+ warn "RDoc::Parser::process_directive is deprecated and wil be removed in RDoc 4. Use RDoc::Markup::PreProcess#handle_directive instead" if $-w
+
+ case directive
+ when 'nodoc' then
+ code_object.document_self = nil # notify nodoc
+ code_object.document_children = value.downcase != 'all'
+ when 'doc' then
+ code_object.document_self = true
+ code_object.force_documentation = true
+ when 'yield', 'yields' then
+ # remove parameter &block
+ code_object.params.sub!(/,?\s*&\w+/, '') if code_object.params
+
+ code_object.block_params = value
+ when 'arg', 'args' then
+ code_object.params = value
+ end
end
##
@@ -155,9 +189,7 @@ class RDoc::Parser
return nil if /coding:/i =~ type
type.downcase
- rescue ArgumentError
- rescue Encoding::InvalidByteSequenceError # invalid byte sequence
-
+ rescue ArgumentError # invalid byte sequence, etc.
end
##
@@ -275,3 +307,4 @@ require 'rdoc/parser/changelog'
require 'rdoc/parser/markdown'
require 'rdoc/parser/rd'
require 'rdoc/parser/ruby'
+
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
index 183538d54b..dd3ba5efdb 100644
--- a/lib/rdoc/parser/c.rb
+++ b/lib/rdoc/parser/c.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'tsort'
##
@@ -607,45 +606,17 @@ class RDoc::Parser::C < RDoc::Parser
end
##
- # Generate a Ruby-method table
-
- def gen_body_table file_content
- table = {}
- file_content.scan(%r{
- ((?>/\*.*?\*/\s*)?)
- ((?:(?:\w+)\s+)?
- (?:intern\s+)?VALUE\s+(\w+)
- \s*(?:\([^)]*\))(?:[^;]|$))
- | ((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+(\w+)\s+(\w+))
- | ^\s*\#\s*define\s+(\w+)\s+(\w+)
- }xm) do
- case
- when $1
- table[$3] = [:func_def, $1, $2, $~.offset(2)] if !table[$3] || table[$3][0] != :func_def
- when $4
- table[$6] = [:macro_def, $4, $5, $~.offset(5), $7] if !table[$6] || table[$6][0] == :macro_alias
- when $8
- table[$8] ||= [:macro_alias, $9]
- end
- end
- table
- end
-
- ##
# Find the C code corresponding to a Ruby method
def find_body class_name, meth_name, meth_obj, file_content, quiet = false
- if file_content
- @body_table ||= {}
- @body_table[file_content] ||= gen_body_table file_content
- type, *args = @body_table[file_content][meth_name]
- end
-
- case type
- when :func_def
- comment = RDoc::Comment.new args[0], @top_level
- body = args[1]
- offset, = args[2]
+ case file_content
+ when %r%((?>/\*.*?\*/\s*)?)
+ ((?:(?:\w+)\s+)?
+ (?:intern\s+)?VALUE\s+#{meth_name}
+ \s*(\([^)]*\))([^;]|$))%xm then
+ comment = RDoc::Comment.new $1, @top_level
+ body = $2
+ offset, = $~.offset(2)
comment.remove_private if comment
@@ -666,34 +637,38 @@ class RDoc::Parser::C < RDoc::Parser
#meth_obj.params = params
meth_obj.start_collecting_tokens
- tk = { :line_no => 1, :char_no => 1, :text => body }
+ tk = RDoc::RubyToken::Token.new nil, 1, 1
+ tk.set_text body
meth_obj.add_token tk
meth_obj.comment = comment
+ meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
- when :macro_def
- comment = RDoc::Comment.new args[0], @top_level
- body = args[1]
- offset, = args[2]
+ when %r%((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+#{meth_name}\s+(\w+))%m then
+ comment = RDoc::Comment.new $1, @top_level
+ body = $2
+ offset = $~.offset(2).first
- find_body class_name, args[3], meth_obj, file_content, true
+ find_body class_name, $3, meth_obj, file_content, true
comment.normalize
find_modifiers comment, meth_obj
meth_obj.start_collecting_tokens
- tk = { :line_no => 1, :char_no => 1, :text => body }
+ tk = RDoc::RubyToken::Token.new nil, 1, 1
+ tk.set_text body
meth_obj.add_token tk
meth_obj.comment = comment
+ meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
- when :macro_alias
+ when %r%^\s*\#\s*define\s+#{meth_name}\s+(\w+)%m then
# with no comment we hope the aliased definition has it and use it's
# definition
- body = find_body(class_name, args[0], meth_obj, file_content, true)
+ body = find_body(class_name, $1, meth_obj, file_content, true)
return body if body
@@ -770,11 +745,11 @@ class RDoc::Parser::C < RDoc::Parser
elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
(?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
comment = "/*\n#{$1}"
- elsif @content =~ %r%((?>/\*.*?\*/\s+))
- ([\w\.\s]+\s* = \s+)?rb_define_(class|module)[\t (]*?"(#{class_name})"%xm then
+ elsif @content =~ %r%.*((?>/\*.*?\*/\s+))
+ ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"%xm then
comment = $1
- elsif @content =~ %r%((?>/\*.*?\*/\s+))
- ([\w\. \t]+ = \s+)?rb_define_(class|module)_under[\t\w, (]*?"(#{class_name.split('::').last})"%xm then
+ elsif @content =~ %r%.*((?>/\*.*?\*/\s+))
+ ([\w\.\s]+\s* = \s+)?rb_define_(class|module)_under.*?"(#{class_name.split('::').last})"%xm then
comment = $1
else
comment = ''
@@ -789,41 +764,27 @@ class RDoc::Parser::C < RDoc::Parser
end
##
- # Generate a const table
-
- def gen_const_table file_content
- table = {}
- @content.scan(%r{
- ((?>^\s*/\*.*?\*/\s+))
- rb_define_(\w+)\((?:\s*(?:\w+),)?\s*
- "(\w+)"\s*,
- .*?\)\s*;
- | Document-(?:const|global|variable):\s
- ((?:\w+::)*\w+)
- \s*?\n((?>.*?\*/))
- }mxi) do
- case
- when $1 then table[[$2, $3]] = $1
- when $4 then table[$4] = "/*\n" + $5
- end
- end
- table
- end
-
- ##
# Finds a comment matching +type+ and +const_name+ either above the
# comment or in the matching Document- section.
def find_const_comment(type, const_name, class_name = nil)
- @const_table ||= {}
- @const_table[@content] ||= gen_const_table @content
- table = @const_table[@content]
-
- comment =
- table[[type, const_name]] ||
- (class_name && table[class_name + "::" + const_name]) ||
- table[const_name] ||
- ''
+ comment = if @content =~ %r%((?>^\s*/\*.*?\*/\s+))
+ rb_define_#{type}\((?:\s*(\w+),)?\s*
+ "#{const_name}"\s*,
+ .*?\)\s*;%xmi then
+ $1
+ elsif class_name and
+ @content =~ %r%Document-(?:const|global|variable):\s
+ #{class_name}::#{const_name}
+ \s*?\n((?>.*?\*/))%xm then
+ "/*\n#{$1}"
+ elsif @content =~ %r%Document-(?:const|global|variable):
+ \s#{const_name}
+ \s*?\n((?>.*?\*/))%xm then
+ "/*\n#{$1}"
+ else
+ ''
+ end
RDoc::Comment.new comment, @top_level
end
@@ -865,8 +826,8 @@ class RDoc::Parser::C < RDoc::Parser
def handle_attr(var_name, attr_name, read, write)
rw = ''
- rw += 'R' if '1' == read
- rw += 'W' if '1' == write
+ rw << 'R' if '1' == read
+ rw << 'W' if '1' == write
class_name = @known_classes[var_name]
@@ -879,7 +840,7 @@ class RDoc::Parser::C < RDoc::Parser
comment = find_attr_comment var_name, attr_name
comment.normalize
- name = attr_name.gsub(/rb_intern(?:_const)?\("([^"]+)"\)/, '\1')
+ name = attr_name.gsub(/rb_intern\("([^"]+)"\)/, '\1')
attr = RDoc::Attr.new '', name, rw, comment
@@ -982,8 +943,8 @@ class RDoc::Parser::C < RDoc::Parser
if new_definition.empty? then # Default to literal C definition
new_definition = definition
else
- new_definition = new_definition.gsub("\:", ":")
- new_definition = new_definition.gsub("\\", '\\')
+ new_definition.gsub!("\:", ":")
+ new_definition.gsub!("\\", '\\')
end
new_definition.sub!(/\A(\s+)/, '')
@@ -1237,7 +1198,7 @@ class RDoc::Parser::C < RDoc::Parser
# when scanning for classes and methods
def remove_commented_out_lines
- @content = @content.gsub(%r%//.*rb_define_%, '//')
+ @content.gsub!(%r%//.*rb_define_%, '//')
end
##
diff --git a/lib/rdoc/parser/changelog.rb b/lib/rdoc/parser/changelog.rb
index 167892f543..a3567c1f81 100644
--- a/lib/rdoc/parser/changelog.rb
+++ b/lib/rdoc/parser/changelog.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'time'
##
@@ -29,13 +28,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
if last =~ /\)\s*\z/ and continuation =~ /\A\(/ then
last.sub!(/\)\s*\z/, ',')
- continuation = continuation.sub(/\A\(/, '')
+ continuation.sub!(/\A\(/, '')
end
if last =~ /\s\z/ then
last << continuation
else
- last << ' ' + continuation
+ last << ' ' << continuation
end
end
@@ -102,11 +101,9 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
# Groups +entries+ by date.
def group_entries entries
- @time_cache ||= {}
entries.group_by do |title, _|
begin
- time = @time_cache[title]
- (time || Time.parse(title)).strftime '%Y-%m-%d'
+ Time.parse(title).strftime '%Y-%m-%d'
rescue NoMethodError, ArgumentError
time, = title.split ' ', 2
Time.parse(time).strftime '%Y-%m-%d'
@@ -130,7 +127,6 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
# 'README.EXT.ja: ditto']]
def parse_entries
- @time_cache ||= {}
entries = []
entry_name = nil
entry_body = []
@@ -146,7 +142,6 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
begin
time = Time.parse entry_name
- @time_cache[entry_name] = time
# HACK Ruby 1.8 does not raise ArgumentError for Time.parse "Other"
entry_name = nil unless entry_name =~ /#{time.year}/
rescue NoMethodError
@@ -162,12 +157,12 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
entry_body = []
when /^(\t| {8})?\*\s*(.*)/ then # "\t* file.c (func): ..."
- entry_body << $2.dup
+ entry_body << $2
when /^(\t| {8})?\s*(\(.*)/ then # "\t(func): ..."
entry = $2
if entry_body.last =~ /:/ then
- entry_body << entry.dup
+ entry_body << entry
else
continue_entry_body entry_body, entry
end
@@ -189,7 +184,6 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
# Converts the ChangeLog into an RDoc::Markup::Document
def scan
- @time_cache = {}
entries = parse_entries
grouped_entries = group_entries entries
diff --git a/lib/rdoc/parser/markdown.rb b/lib/rdoc/parser/markdown.rb
index 9ff478f872..6fd88cf614 100644
--- a/lib/rdoc/parser/markdown.rb
+++ b/lib/rdoc/parser/markdown.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Parse a Markdown format file. The parsed RDoc::Markup::Document is attached
# as a file comment.
diff --git a/lib/rdoc/parser/rd.rb b/lib/rdoc/parser/rd.rb
index 25f5711731..09069ae297 100644
--- a/lib/rdoc/parser/rd.rb
+++ b/lib/rdoc/parser/rd.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Parse a RD format file. The parsed RDoc::Markup::Document is attached as a
# file comment.
diff --git a/lib/rdoc/parser/ripper_state_lex.rb b/lib/rdoc/parser/ripper_state_lex.rb
deleted file mode 100644
index b7cec84bfc..0000000000
--- a/lib/rdoc/parser/ripper_state_lex.rb
+++ /dev/null
@@ -1,605 +0,0 @@
-require 'ripper'
-
-class RDoc::RipperStateLex
- # TODO: Remove this constants after Ruby 2.4 EOL
- RIPPER_HAS_LEX_STATE = Ripper::Filter.method_defined?(:state)
-
- EXPR_NONE = 0
- EXPR_BEG = 1
- EXPR_END = 2
- EXPR_ENDARG = 4
- EXPR_ENDFN = 8
- EXPR_ARG = 16
- EXPR_CMDARG = 32
- EXPR_MID = 64
- EXPR_FNAME = 128
- EXPR_DOT = 256
- EXPR_CLASS = 512
- EXPR_LABEL = 1024
- EXPR_LABELED = 2048
- EXPR_FITEM = 4096
- EXPR_VALUE = EXPR_BEG
- EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS)
- EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG)
- EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN)
-
- class InnerStateLex < Ripper::Filter
- attr_accessor :lex_state
-
- def initialize(code)
- @lex_state = EXPR_BEG
- @in_fname = false
- @continue = false
- reset
- super(code)
- end
-
- def reset
- @command_start = false
- @cmd_state = @command_start
- end
-
- def on_nl(tok, data)
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @continue = true
- else
- @continue = false
- @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_ignored_nl(tok, data)
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @continue = true
- else
- @continue = false
- @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_op(tok, data)
- case tok
- when '&', '|', '!', '!=', '!~'
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_BEG
- end
- when '<<'
- # TODO next token?
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_BEG
- end
- when '?'
- @lex_state = EXPR_BEG
- when '&&', '||', '+=', '-=', '*=', '**=',
- '&=', '|=', '^=', '<<=', '>>=', '||=', '&&='
- @lex_state = EXPR_BEG
- else
- case @lex_state
- when EXPR_FNAME, EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_BEG
- end
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_kw(tok, data)
- case tok
- when 'class'
- @lex_state = EXPR_CLASS
- @in_fname = true
- when 'def'
- @lex_state = EXPR_FNAME
- @continue = true
- @in_fname = true
- when 'if', 'unless', 'while', 'until'
- if ((EXPR_END | EXPR_ENDARG | EXPR_ENDFN | EXPR_ARG | EXPR_CMDARG) & @lex_state) != 0 # postfix if
- @lex_state = EXPR_BEG | EXPR_LABEL
- else
- @lex_state = EXPR_BEG
- end
- when 'begin'
- @lex_state = EXPR_BEG
- else
- if @lex_state == EXPR_FNAME
- @lex_state = EXPR_END
- else
- @lex_state = EXPR_END
- end
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_tstring_beg(tok, data)
- @lex_state = EXPR_BEG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_tstring_end(tok, data)
- @lex_state = EXPR_END | EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_CHAR(tok, data)
- @lex_state = EXPR_END
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_period(tok, data)
- @lex_state = EXPR_DOT
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_int(tok, data)
- @lex_state = EXPR_END | EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_float(tok, data)
- @lex_state = EXPR_END | EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_rational(tok, data)
- @lex_state = EXPR_END | EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_imaginary(tok, data)
- @lex_state = EXPR_END | EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_symbeg(tok, data)
- @lex_state = EXPR_FNAME
- @continue = true
- @in_fname = true
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- private def on_variables(event, tok, data)
- if @in_fname
- @lex_state = EXPR_ENDFN
- @in_fname = false
- @continue = false
- elsif @continue
- case @lex_state
- when EXPR_DOT
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_ENDFN
- @continue = false
- end
- else
- @lex_state = EXPR_CMDARG
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => event, :text => tok, :state => @lex_state})
- end
-
- def on_ident(tok, data)
- on_variables(__method__, tok, data)
- end
-
- def on_ivar(tok, data)
- @lex_state = EXPR_END
- on_variables(__method__, tok, data)
- end
-
- def on_cvar(tok, data)
- @lex_state = EXPR_END
- on_variables(__method__, tok, data)
- end
-
- def on_gvar(tok, data)
- @lex_state = EXPR_END
- on_variables(__method__, tok, data)
- end
-
- def on_backref(tok, data)
- @lex_state = EXPR_END
- on_variables(__method__, tok, data)
- end
-
- def on_lparen(tok, data)
- @lex_state = EXPR_LABEL | EXPR_BEG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_rparen(tok, data)
- @lex_state = EXPR_ENDFN
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_lbrace(tok, data)
- @lex_state = EXPR_LABEL | EXPR_BEG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_rbrace(tok, data)
- @lex_state = EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_lbracket(tok, data)
- @lex_state = EXPR_LABEL | EXPR_BEG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_rbracket(tok, data)
- @lex_state = EXPR_ENDARG
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_const(tok, data)
- case @lex_state
- when EXPR_FNAME
- @lex_state = EXPR_ENDFN
- when EXPR_CLASS
- @lex_state = EXPR_ARG
- else
- @lex_state = EXPR_CMDARG
- end
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_sp(tok, data)
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_comma(tok, data)
- @lex_state = EXPR_BEG | EXPR_LABEL if (EXPR_ARG_ANY & @lex_state) != 0
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_comment(tok, data)
- @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_ignored_sp(tok, data)
- @lex_state = EXPR_BEG unless (EXPR_LABEL & @lex_state) != 0
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- end
-
- def on_heredoc_end(tok, data)
- @callback.call({ :line_no => lineno, :char_no => column, :kind => __method__, :text => tok, :state => @lex_state})
- @lex_state = EXPR_BEG
- end
-
- def on_default(event, tok, data)
- reset
- @callback.call({ :line_no => lineno, :char_no => column, :kind => event, :text => tok, :state => @lex_state})
- end
-
- def each(&block)
- @callback = block
- parse
- end
- end unless RIPPER_HAS_LEX_STATE
-
- class InnerStateLex < Ripper::Filter
- def initialize(code)
- super(code)
- end
-
- def on_default(event, tok, data)
- @callback.call({ :line_no => lineno, :char_no => column, :kind => event, :text => tok, :state => state})
- end
-
- def each(&block)
- @callback = block
- parse
- end
- end if RIPPER_HAS_LEX_STATE
-
- def get_squashed_tk
- if @buf.empty?
- tk = @inner_lex_enumerator.next
- else
- tk = @buf.shift
- end
- case tk[:kind]
- when :on_symbeg then
- tk = get_symbol_tk(tk)
- when :on_tstring_beg then
- tk = get_string_tk(tk)
- when :on_backtick then
- if (tk[:state] & (EXPR_FNAME | EXPR_ENDFN)) != 0
- @inner_lex.lex_state = EXPR_ARG unless RIPPER_HAS_LEX_STATE
- tk[:kind] = :on_ident
- tk[:state] = Ripper::Lexer.const_defined?(:State) ? Ripper::Lexer::State.new(EXPR_ARG) : EXPR_ARG
- else
- tk = get_string_tk(tk)
- end
- when :on_regexp_beg then
- tk = get_regexp_tk(tk)
- when :on_embdoc_beg then
- tk = get_embdoc_tk(tk)
- when :on_heredoc_beg then
- @heredoc_queue << retrieve_heredoc_info(tk)
- @inner_lex.lex_state = EXPR_END unless RIPPER_HAS_LEX_STATE
- when :on_nl, :on_ignored_nl, :on_comment, :on_heredoc_end then
- unless @heredoc_queue.empty?
- get_heredoc_tk(*@heredoc_queue.shift)
- end
- when :on_words_beg then
- tk = get_words_tk(tk)
- when :on_qwords_beg then
- tk = get_words_tk(tk)
- when :on_symbols_beg then
- tk = get_words_tk(tk)
- when :on_qsymbols_beg then
- tk = get_words_tk(tk)
- when :on_op then
- if '&.' == tk[:text]
- tk[:kind] = :on_period
- else
- tk = get_op_tk(tk)
- end
- end
- tk
- end
-
- private def get_symbol_tk(tk)
- is_symbol = true
- symbol_tk = { :line_no => tk[:line_no], :char_no => tk[:char_no], :kind => :on_symbol }
- if ":'" == tk[:text] or ':"' == tk[:text]
- tk1 = get_string_tk(tk)
- symbol_tk[:text] = tk1[:text]
- symbol_tk[:state] = tk1[:state]
- else
- case (tk1 = get_squashed_tk)[:kind]
- when :on_ident
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_tstring_content
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = get_squashed_tk[:state] # skip :on_tstring_end
- when :on_tstring_end
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_op
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_ivar
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_cvar
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_gvar
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_const
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- when :on_kw
- symbol_tk[:text] = ":#{tk1[:text]}"
- symbol_tk[:state] = tk1[:state]
- else
- is_symbol = false
- tk = tk1
- end
- end
- if is_symbol
- tk = symbol_tk
- end
- tk
- end
-
- private def get_string_tk(tk)
- string = tk[:text]
- state = nil
- kind = :on_tstring
- loop do
- inner_str_tk = get_squashed_tk
- if inner_str_tk.nil?
- break
- elsif :on_tstring_end == inner_str_tk[:kind]
- string = string + inner_str_tk[:text]
- state = inner_str_tk[:state]
- break
- elsif :on_label_end == inner_str_tk[:kind]
- string = string + inner_str_tk[:text]
- state = inner_str_tk[:state]
- kind = :on_symbol
- break
- else
- string = string + inner_str_tk[:text]
- if :on_embexpr_beg == inner_str_tk[:kind] then
- kind = :on_dstring if :on_tstring == kind
- end
- end
- end
- {
- :line_no => tk[:line_no],
- :char_no => tk[:char_no],
- :kind => kind,
- :text => string,
- :state => state
- }
- end
-
- private def get_regexp_tk(tk)
- string = tk[:text]
- state = nil
- loop do
- inner_str_tk = get_squashed_tk
- if inner_str_tk.nil?
- break
- elsif :on_regexp_end == inner_str_tk[:kind]
- string = string + inner_str_tk[:text]
- state = inner_str_tk[:state]
- break
- else
- string = string + inner_str_tk[:text]
- end
- end
- {
- :line_no => tk[:line_no],
- :char_no => tk[:char_no],
- :kind => :on_regexp,
- :text => string,
- :state => state
- }
- end
-
- private def get_embdoc_tk(tk)
- string = tk[:text]
- until :on_embdoc_end == (embdoc_tk = get_squashed_tk)[:kind] do
- string = string + embdoc_tk[:text]
- end
- string = string + embdoc_tk[:text]
- {
- :line_no => tk[:line_no],
- :char_no => tk[:char_no],
- :kind => :on_embdoc,
- :text => string,
- :state => embdoc_tk[:state]
- }
- end
-
- private def get_heredoc_tk(heredoc_name, indent)
- string = ''
- start_tk = nil
- prev_tk = nil
- until heredoc_end?(heredoc_name, indent, tk = @inner_lex_enumerator.next) do
- start_tk = tk unless start_tk
- if (prev_tk.nil? or "\n" == prev_tk[:text][-1]) and 0 != tk[:char_no]
- string = string + (' ' * tk[:char_no])
- end
- string = string + tk[:text]
- prev_tk = tk
- end
- start_tk = tk unless start_tk
- prev_tk = tk unless prev_tk
- @buf.unshift tk # closing heredoc
- heredoc_tk = {
- :line_no => start_tk[:line_no],
- :char_no => start_tk[:char_no],
- :kind => :on_heredoc,
- :text => string,
- :state => prev_tk[:state]
- }
- @buf.unshift heredoc_tk
- end
-
- private def retrieve_heredoc_info(tk)
- name = tk[:text].gsub(/\A<<[-~]?(['"`]?)(.+)\1\z/, '\2')
- indent = tk[:text] =~ /\A<<[-~]/
- [name, indent]
- end
-
- private def heredoc_end?(name, indent, tk)
- result = false
- if :on_heredoc_end == tk[:kind] then
- tk_name = (indent ? tk[:text].gsub(/^ *(.+)\n?$/, '\1') : tk[:text].gsub(/\n\z/, ''))
- if name == tk_name
- result = true
- end
- end
- result
- end
-
- private def get_words_tk(tk)
- string = ''
- start_token = tk[:text]
- start_quote = tk[:text].rstrip[-1]
- line_no = tk[:line_no]
- char_no = tk[:char_no]
- state = tk[:state]
- end_quote =
- case start_quote
- when ?( then ?)
- when ?[ then ?]
- when ?{ then ?}
- when ?< then ?>
- else start_quote
- end
- end_token = nil
- loop do
- tk = get_squashed_tk
- if tk.nil?
- end_token = end_quote
- break
- elsif :on_tstring_content == tk[:kind] then
- string += tk[:text]
- elsif :on_words_sep == tk[:kind] or :on_tstring_end == tk[:kind] then
- if end_quote == tk[:text].strip then
- end_token = tk[:text]
- break
- else
- string += tk[:text]
- end
- else
- string += tk[:text]
- end
- end
- text = "#{start_token}#{string}#{end_token}"
- {
- :line_no => line_no,
- :char_no => char_no,
- :kind => :on_dstring,
- :text => text,
- :state => state
- }
- end
-
- private def get_op_tk(tk)
- redefinable_operators = %w[! != !~ % & * ** + +@ - -@ / < << <= <=> == === =~ > >= >> [] []= ^ ` | ~]
- if redefinable_operators.include?(tk[:text]) and tk[:state] == EXPR_ARG then
- @inner_lex.lex_state = EXPR_ARG unless RIPPER_HAS_LEX_STATE
- tk[:state] = Ripper::Lexer.const_defined?(:State) ? Ripper::Lexer::State.new(EXPR_ARG) : EXPR_ARG
- tk[:kind] = :on_ident
- elsif tk[:text] =~ /^[-+]$/ then
- tk_ahead = get_squashed_tk
- case tk_ahead[:kind]
- when :on_int, :on_float, :on_rational, :on_imaginary then
- tk[:text] += tk_ahead[:text]
- tk[:kind] = tk_ahead[:kind]
- tk[:state] = tk_ahead[:state]
- else
- @buf.unshift tk_ahead
- end
- end
- tk
- end
-
- def initialize(code)
- @buf = []
- @heredoc_queue = []
- @inner_lex = InnerStateLex.new(code)
- @inner_lex_enumerator = Enumerator.new do |y|
- @inner_lex.each do |tk|
- y << tk
- end
- end
- end
-
- def self.parse(code)
- lex = self.new(code)
- tokens = []
- begin
- while tk = lex.get_squashed_tk
- tokens.push tk
- end
- rescue StopIteration
- end
- tokens
- end
-
- def self.end?(token)
- (token[:state] & EXPR_END)
- end
-end
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
index 8599f655ad..ce1083edc7 100644
--- a/lib/rdoc/parser/ruby.rb
+++ b/lib/rdoc/parser/ruby.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# This file contains stuff stolen outright from:
#
@@ -24,7 +23,6 @@ $TOKEN_DEBUG ||= nil
# * aliases
# * private, public, protected
# * private_class_function, public_class_function
-# * private_constant, public_constant
# * module_function
# * attr, attr_reader, attr_writer, attr_accessor
# * extra accessors given on the command line
@@ -140,12 +138,11 @@ $TOKEN_DEBUG ||= nil
# Note that by default, the :method: directive will be ignored if there is a
# standard rdocable item following it.
-require 'ripper'
-
class RDoc::Parser::Ruby < RDoc::Parser
parse_files_matching(/\.rbw?$/)
+ include RDoc::RubyToken
include RDoc::TokenStream
include RDoc::Parser::RubyTools
@@ -165,31 +162,18 @@ class RDoc::Parser::Ruby < RDoc::Parser
def initialize(top_level, file_name, content, options, stats)
super
- if /\t/ =~ content then
- tab_width = @options.tab_width
- content = content.split(/\n/).map do |line|
- 1 while line.gsub!(/\t+/) {
- ' ' * (tab_width*$&.length - $`.length % tab_width)
- } && $~
- line
- end.join("\n")
- end
-
@size = 0
@token_listeners = nil
- @scanner = RDoc::RipperStateLex.parse(content)
- @content = content
- @scanner_point = 0
+ @scanner = RDoc::RubyLex.new content, @options
+ @scanner.exception_on_syntax_error = false
@prev_seek = nil
@markup = @options.markup
@track_visibility = :nodoc != @options.visibility
- @encoding = @options.encoding
- reset
- end
+ @encoding = nil
+ @encoding = @options.encoding if Object.const_defined? :Encoding
- def tk_nl?(tk)
- :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
+ reset
end
##
@@ -211,7 +195,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
# methods.
def get_visibility_information tk, single # :nodoc:
- vis_type = tk[:text]
+ vis_type = tk.name
singleton = single == SINGLE
vis =
@@ -240,30 +224,30 @@ class RDoc::Parser::Ruby < RDoc::Parser
def collect_first_comment
skip_tkspace
- comment = ''.dup
- comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
+ comment = ''
+ comment.force_encoding @encoding if @encoding
first_line = true
- first_comment_tk_kind = nil
+ first_comment_tk_class = nil
tk = get_tk
- while tk && (:on_comment == tk[:kind] or :on_embdoc == tk[:kind])
- if first_line and tk[:text] =~ /\A#!/ then
+ while TkCOMMENT === tk
+ if first_line and tk.text =~ /\A#!/ then
skip_tkspace
tk = get_tk
- elsif first_line and tk[:text] =~ /\A#\s*-\*-/ then
+ elsif first_line and tk.text =~ /\A#\s*-\*-/ then
first_line = false
skip_tkspace
tk = get_tk
else
- break if first_comment_tk_kind and not first_comment_tk_kind === tk[:kind]
- first_comment_tk_kind = tk[:kind]
+ break if first_comment_tk_class and not first_comment_tk_class === tk
+ first_comment_tk_class = tk.class
first_line = false
- comment << tk[:text]
+ comment << tk.text << "\n"
tk = get_tk
- if :on_nl === tk then
+ if TkNL === tk then
skip_tkspace false
tk = get_tk
end
@@ -279,6 +263,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Consumes trailing whitespace from the token stream
def consume_trailing_spaces # :nodoc:
+ get_tkread
skip_tkspace false
end
@@ -319,14 +304,16 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
##
- # Looks for a true or false token.
+ # Looks for a true or false token. Returns false if TkFALSE or TkNIL are
+ # found.
def get_bool
skip_tkspace
tk = get_tk
- if :on_kw == tk[:kind] && 'true' == tk[:text]
+ case tk
+ when TkTRUE
true
- elsif :on_kw == tk[:kind] && ('false' == tk[:text] || 'nil' == tk[:text])
+ when TkFALSE, TkNIL
false
else
unget_tk tk
@@ -342,27 +329,27 @@ class RDoc::Parser::Ruby < RDoc::Parser
def get_class_or_module container, ignore_constants = false
skip_tkspace
name_t = get_tk
- given_name = ''.dup
+ given_name = ''
# class ::A -> A is in the top level
- if :on_op == name_t[:kind] and '::' == name_t[:text] then # bug
+ case name_t
+ when TkCOLON2, TkCOLON3 then # bug
name_t = get_tk
container = @top_level
given_name << '::'
end
skip_tkspace false
- given_name << name_t[:text]
+ given_name << name_t.name
- is_self = name_t[:kind] == :on_op && name_t[:text] == '<<'
- while !is_self && (tk = peek_tk) and :on_op == tk[:kind] and '::' == tk[:text] do
+ while TkCOLON2 === peek_tk do
prev_container = container
- container = container.find_module_named name_t[:text]
+ container = container.find_module_named name_t.name
container ||=
if ignore_constants then
RDoc::Context.new
else
- c = prev_container.add_module RDoc::NormalModule, name_t[:text]
+ c = prev_container.add_module RDoc::NormalModule, name_t.name
c.ignore unless prev_container.document_children
@top_level.add_to_classes_or_modules c
c
@@ -373,14 +360,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
get_tk
skip_tkspace false
name_t = get_tk
- unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
- raise RDoc::Error, "Invalid class or module definition: #{given_name}"
- end
- if prev_container == container and !ignore_constants
- given_name = name_t[:text]
- else
- given_name << '::' + name_t[:text]
- end
+ given_name << '::' << name_t.name
end
skip_tkspace false
@@ -392,13 +372,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Return a superclass, which can be either a constant of an expression
def get_class_specification
- tk = peek_tk
- if tk.nil?
- return ''
- elsif :on_kw == tk[:kind] && 'self' == tk[:text]
- return 'self'
- elsif :on_gvar == tk[:kind]
- return ''
+ case peek_tk
+ when TkSELF then return 'self'
+ when TkGVAR then return ''
end
res = get_constant
@@ -408,10 +384,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
get_tkread # empty out read buffer
tk = get_tk
- return res unless tk
- case tk[:kind]
- when :on_nl, :on_comment, :on_embdoc, :on_semicolon then
+ case tk
+ when TkNL, TkCOMMENT, TkSEMICOLON then
unget_tk(tk)
return res
end
@@ -429,8 +404,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
tk = get_tk
- while tk && ((:on_op == tk[:kind] && '::' == tk[:text]) || :on_const == tk[:kind]) do
- res += tk[:text]
+ while TkCOLON2 === tk or TkCOLON3 === tk or TkCONSTANT === tk do
+ res += tk.name
tk = get_tk
end
@@ -446,7 +421,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
nest = 0
- while :on_lparen == (tk = peek_tk)[:kind] do
+ while TkLPAREN === (tk = peek_tk) or TkfLPAREN === tk do
get_tk
skip_tkspace
nest += 1
@@ -457,7 +432,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
while nest > 0
skip_tkspace
tk = get_tk
- nest -= 1 if :on_rparen == tk[:kind]
+ nest -= 1 if TkRPAREN === tk
end
name
@@ -472,19 +447,13 @@ class RDoc::Parser::Ruby < RDoc::Parser
# won't catch all cases (such as "a = yield + 1"
def get_end_token tk # :nodoc:
- case tk[:kind]
- when :on_lparen
- {
- :kind => :on_rparen,
- :text => ')'
- }
- when :on_rparen
+ case tk
+ when TkLPAREN, TkfLPAREN
+ TkRPAREN
+ when TkRPAREN
nil
else
- {
- :kind => :on_nl,
- :text => "\n"
- }
+ TkNL
end
end
@@ -493,11 +462,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
def get_method_container container, name_t # :nodoc:
prev_container = container
- container = container.find_module_named(name_t[:text])
+ container = container.find_module_named(name_t.name)
unless container then
constant = prev_container.constants.find do |const|
- const.name == name_t[:text]
+ const.name == name_t.name
end
if constant then
@@ -508,21 +477,21 @@ class RDoc::Parser::Ruby < RDoc::Parser
unless container then
# TODO seems broken, should starting at Object in @store
- obj = name_t[:text].split("::").inject(Object) do |state, item|
+ obj = name_t.name.split("::").inject(Object) do |state, item|
state.const_get(item)
end rescue nil
type = obj.class == Class ? RDoc::NormalClass : RDoc::NormalModule
unless [Class, Module].include?(obj.class) then
- warn("Couldn't find #{name_t[:text]}. Assuming it's a module")
+ warn("Couldn't find #{name_t.name}. Assuming it's a module")
end
if type == RDoc::NormalClass then
sclass = obj.superclass ? obj.superclass.name : nil
- container = prev_container.add_class type, name_t[:text], sclass
+ container = prev_container.add_class type, name_t.name, sclass
else
- container = prev_container.add_module type, name_t[:text]
+ container = prev_container.add_module type, name_t.name
end
record_location container
@@ -536,26 +505,32 @@ class RDoc::Parser::Ruby < RDoc::Parser
def get_symbol_or_name
tk = get_tk
- case tk[:kind]
- when :on_symbol then
- text = tk[:text].sub(/^:/, '')
+ case tk
+ when TkSYMBOL then
+ text = tk.text.sub(/^:/, '')
- next_tk = peek_tk
- if next_tk && :on_op == next_tk[:kind] && '=' == next_tk[:text] then
+ if TkASSIGN === peek_tk then
get_tk
text << '='
end
text
- when :on_ident, :on_const, :on_gvar, :on_cvar, :on_ivar, :on_op, :on_kw then
- tk[:text]
- when :on_tstring, :on_dstring then
- tk[:text][1..-2]
+ when TkId, TkOp then
+ tk.name
+ when TkAMPER,
+ TkDSTRING,
+ TkSTAR,
+ TkSTRING then
+ tk.text
else
raise RDoc::Error, "Name or symbol expected (got #{tk})"
end
end
+ def stop_at_EXPR_END # :nodoc:
+ @scanner.lex_state == :EXPR_END || !@scanner.continue
+ end
+
##
# Marks containers between +container+ and +ancestor+ as ignored
@@ -574,31 +549,29 @@ class RDoc::Parser::Ruby < RDoc::Parser
#
# This routine modifies its +comment+ parameter.
- def look_for_directives_in container, comment
- @preprocess.handle comment, container do |directive, param|
+ def look_for_directives_in context, comment
+ @preprocess.handle comment, context do |directive, param|
case directive
when 'method', 'singleton-method',
'attr', 'attr_accessor', 'attr_reader', 'attr_writer' then
false # handled elsewhere
when 'section' then
- break unless container.kind_of?(RDoc::Context)
- container.set_current_section param, comment.dup
+ context.set_current_section param, comment.dup
comment.text = ''
break
end
end
- comment.remove_private
+ remove_private_comments comment
end
##
# Adds useful info about the parser to +message+
def make_message message
- prefix = "#{@file_name}:".dup
+ prefix = "#{@file_name}:"
- tk = peek_tk
- prefix << "#{tk[:line_no]}:#{tk[:char_no]}:" if tk
+ prefix << "#{@scanner.line_no}:#{@scanner.char_no}:" if @scanner
"#{prefix} #{message}"
end
@@ -617,7 +590,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
# +comment+.
def parse_attr(context, single, tk, comment)
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
args = parse_symbol_arg 1
if args.size > 0 then
@@ -626,13 +600,14 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
tk = get_tk
- if :on_comma == tk[:kind] then
+ if TkCOMMA === tk then
rw = "RW" if get_bool
else
unget_tk tk
end
att = create_attr context, single, name, rw, comment
+ att.offset = offset
att.line = line_no
read_documentation_modifiers att, RDoc::ATTR_MODIFIERS
@@ -646,7 +621,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
# comment for each to +comment+.
def parse_attr_accessor(context, single, tk, comment)
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
args = parse_symbol_arg
rw = "?"
@@ -657,7 +633,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
# and add found items appropriately but here we do not. I'm not sure why.
return if @track_visibility and not tmp.document_self
- case tk[:text]
+ case tk.name
when "attr_reader" then rw = "R"
when "attr_writer" then rw = "W"
when "attr_accessor" then rw = "RW"
@@ -667,6 +643,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
for name in args
att = create_attr context, single, name, rw, comment
+ att.offset = offset
att.line = line_no
end
end
@@ -675,19 +652,22 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Parses an +alias+ in +context+ with +comment+
def parse_alias(context, single, tk, comment)
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
skip_tkspace
- if :on_lparen === peek_tk[:kind] then
+ if TkLPAREN === peek_tk then
get_tk
skip_tkspace
end
new_name = get_symbol_or_name
+ @scanner.lex_state = :EXPR_FNAME
+
skip_tkspace
- if :on_comma === peek_tk[:kind] then
+ if TkCOMMA === peek_tk then
get_tk
skip_tkspace
end
@@ -701,6 +681,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,
single == SINGLE)
record_location al
+ al.offset = offset
al.line = line_no
read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
@@ -714,38 +695,34 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Extracts call parameters from the token stream.
def parse_call_parameters(tk)
- end_token = case tk[:kind]
- when :on_lparen
- :on_rparen
- when :on_rparen
+ end_token = case tk
+ when TkLPAREN, TkfLPAREN
+ TkRPAREN
+ when TkRPAREN
return ""
else
- :on_nl
+ TkNL
end
nest = 0
loop do
- break if tk.nil?
- case tk[:kind]
- when :on_semicolon
+ case tk
+ when TkSEMICOLON
break
- when :on_lparen
+ when TkLPAREN, TkfLPAREN
nest += 1
when end_token
- if end_token == :on_rparen
+ if end_token == TkRPAREN
nest -= 1
- break if RDoc::RipperStateLex.end?(tk) and nest <= 0
+ break if @scanner.lex_state == :EXPR_END and nest <= 0
else
- break if RDoc::RipperStateLex.end?(tk)
+ break unless @scanner.continue
end
- when :on_comment, :on_embdoc
+ when TkCOMMENT, TkASSIGN, TkOPASGN
unget_tk(tk)
break
- when :on_op
- if tk[:text] =~ /^(.{1,2})?=$/
- unget_tk(tk)
- break
- end
+ when nil then
+ break
end
tk = get_tk
end
@@ -757,33 +734,33 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Parses a class in +context+ with +comment+
def parse_class container, single, tk, comment
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
declaration_context = container
container, name_t, given_name = get_class_or_module container
- if name_t[:kind] == :on_const
- cls = parse_class_regular container, declaration_context, single,
- name_t, given_name, comment
- elsif name_t[:kind] == :on_op && name_t[:text] == '<<'
- case name = get_class_specification
- when 'self', container.name
- read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
- parse_statements container, SINGLE
- return # don't update line
+ cls =
+ case name_t
+ when TkCONSTANT
+ parse_class_regular container, declaration_context, single,
+ name_t, given_name, comment
+ when TkLSHFT
+ case name = get_class_specification
+ when 'self', container.name
+ parse_statements container, SINGLE
+ return # don't update offset or line
+ else
+ parse_class_singleton container, name, comment
+ end
else
- cls = parse_class_singleton container, name, comment
+ warn "Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}"
+ return
end
- else
- warn "Expected class name or '<<'. Got #{name_t[:kind]}: #{name_t[:text].inspect}"
- return
- end
+ cls.offset = offset
cls.line = line_no
- # after end modifiers
- read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
-
cls
end
@@ -799,8 +776,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
given_name = $'
end
- tk = peek_tk
- if tk[:kind] == :on_op && tk[:text] == '<' then
+ if TkLT === peek_tk then
get_tk
skip_tkspace
superclass = get_class_specification
@@ -870,116 +846,102 @@ class RDoc::Parser::Ruby < RDoc::Parser
# true, no found constants will be added to RDoc.
def parse_constant container, tk, comment, ignore_constants = false
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
- name = tk[:text]
+ name = tk.name
skip_tkspace false
return unless name =~ /^\w+$/
- if :on_op == peek_tk[:kind] && '::' == peek_tk[:text] then
+ eq_tk = get_tk
+
+ if TkCOLON2 === eq_tk then
+ unget_tk eq_tk
unget_tk tk
container, name_t, = get_class_or_module container, ignore_constants
- name = name_t[:text]
- end
+ name = name_t.name
- is_array_or_hash = false
- if peek_tk && :on_lbracket == peek_tk[:kind]
- get_tk
- nest = 1
- while bracket_tk = get_tk
- case bracket_tk[:kind]
- when :on_lbracket
- nest += 1
- when :on_rbracket
- nest -= 1
- break if nest == 0
- end
- end
- skip_tkspace false
- is_array_or_hash = true
+ eq_tk = get_tk
end
- unless peek_tk && :on_op == peek_tk[:kind] && '=' == peek_tk[:text] then
+ unless TkASSIGN === eq_tk then
+ unget_tk eq_tk
return false
end
- get_tk
+
+ if TkGT === peek_tk then
+ unget_tk eq_tk
+ return
+ end
value = ''
con = RDoc::Constant.new name, value, comment
- body = parse_constant_body container, con, is_array_or_hash
+ body = parse_constant_body container, con
return unless body
- con.value = body
+ value.replace body
record_location con
+ con.offset = offset
con.line = line_no
read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
- return if is_array_or_hash
-
@stats.add_constant con
container.add_constant con
true
end
- def parse_constant_body container, constant, is_array_or_hash # :nodoc:
+ def parse_constant_body container, constant # :nodoc:
nest = 0
- rhs_name = ''.dup
+ rhs_name = ''
get_tkread
tk = get_tk
- body = nil
loop do
- break if tk.nil?
- if :on_semicolon == tk[:kind] then
+ case tk
+ when TkSEMICOLON then
break if nest <= 0
- elsif [:on_tlambeg, :on_lparen, :on_lbrace, :on_lbracket].include?(tk[:kind]) then
+ when TkLPAREN, TkfLPAREN, TkLBRACE, TkfLBRACE, TkLBRACK, TkfLBRACK,
+ TkDO, TkIF, TkUNLESS, TkCASE, TkDEF, TkBEGIN then
nest += 1
- elsif (:on_kw == tk[:kind] && 'def' == tk[:text]) then
- nest += 1
- elsif (:on_kw == tk[:kind] && %w{do if unless case begin}.include?(tk[:text])) then
- if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
- nest += 1
- end
- elsif [:on_rparen, :on_rbrace, :on_rbracket].include?(tk[:kind]) ||
- (:on_kw == tk[:kind] && 'end' == tk[:text]) then
+ when TkRPAREN, TkRBRACE, TkRBRACK, TkEND then
nest -= 1
- elsif (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) then
- unget_tk tk
- if nest <= 0 and RDoc::RipperStateLex.end?(tk) then
- body = get_tkread_clean(/^[ \t]+/, '')
- read_documentation_modifiers constant, RDoc::CONSTANT_MODIFIERS
+ when TkCOMMENT then
+ if nest <= 0 and stop_at_EXPR_END then
+ unget_tk tk
break
else
+ unget_tk tk
read_documentation_modifiers constant, RDoc::CONSTANT_MODIFIERS
end
- elsif :on_const == tk[:kind] then
- rhs_name << tk[:text]
+ when TkCONSTANT then
+ rhs_name << tk.name
- next_tk = peek_tk
- if nest <= 0 and (next_tk.nil? || :on_nl == next_tk[:kind]) then
- create_module_alias container, constant, rhs_name unless is_array_or_hash
+ if nest <= 0 and TkNL === peek_tk then
+ create_module_alias container, constant, rhs_name
break
end
- elsif :on_nl == tk[:kind] then
- if nest <= 0 and RDoc::RipperStateLex.end?(tk) then
+ when TkNL then
+ if nest <= 0 and stop_at_EXPR_END then
unget_tk tk
break
end
- elsif :on_op == tk[:kind] && '::' == tk[:text]
+ when TkCOLON2, TkCOLON3 then
rhs_name << '::'
+ when nil then
+ break
end
tk = get_tk
end
- body ? body : get_tkread_clean(/^[ \t]+/, '')
+ get_tkread_clean(/^[ \t]+/, '')
end
##
@@ -988,21 +950,24 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_comment container, tk, comment
return parse_comment_tomdoc container, tk, comment if @markup == 'tomdoc'
- column = tk[:char_no]
- line_no = tk[:line_no]
+ column = tk.char_no
+ offset = tk.seek
+ line_no = tk.line_no
+
+ text = comment.text
- comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
- singleton = !!$~
+ singleton = !!text.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
co =
- if (comment.text = comment.text.sub(/^# +:?method: *(\S*).*?\n/i, '')) && !!$~ then
- parse_comment_ghost container, comment.text, $1, column, line_no, comment
- elsif (comment.text = comment.text.sub(/# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '')) && !!$~ then
+ if text.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
+ parse_comment_ghost container, text, $1, column, line_no, comment
+ elsif text.sub!(/# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '') then
parse_comment_attr container, $1, $3, comment
end
if co then
co.singleton = singleton
+ co.offset = offset
co.line = line_no
end
@@ -1033,11 +998,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
record_location meth
meth.start_collecting_tokens
- indent = { :line_no => 1, :char_no => 1, :kind => :on_sp, :text => ' ' * column }
- position_comment = { :line_no => line_no, :char_no => 1, :kind => :on_comment }
- position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
- newline = { :line_no => 0, :char_no => 0, :kind => :on_nl, :text => "\n" }
- meth.add_tokens [position_comment, newline, indent]
+ indent = TkSPACE.new 0, 1, 1
+ indent.set_text " " * column
+
+ position_comment = TkCOMMENT.new 0, line_no, 1
+ position_comment.set_text "# File #{@top_level.relative_name}, line #{line_no}"
+ meth.add_tokens [position_comment, NEWLINE_TOKEN, indent]
meth.params =
if text.sub!(/^#\s+:?args?:\s*(.*?)\s*$/i, '') then
@@ -1066,21 +1032,23 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_comment_tomdoc container, tk, comment
return unless signature = RDoc::TomDoc.signature(comment)
- column = tk[:char_no]
- line_no = tk[:line_no]
+ offset = tk.seek
+ line_no = tk.line_no
name, = signature.split %r%[ \(]%, 2
meth = RDoc::GhostMethod.new get_tkread, name
record_location meth
+ meth.offset = offset
meth.line = line_no
meth.start_collecting_tokens
- indent = { :line_no => 1, :char_no => 1, :kind => :on_sp, :text => ' ' * column }
- position_comment = { :line_no => line_no, :char_no => 1, :kind => :on_comment }
- position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
- newline = { :line_no => 0, :char_no => 0, :kind => :on_nl, :text => "\n" }
- meth.add_tokens [position_comment, newline, indent]
+ indent = TkSPACE.new 0, 1, 1
+ indent.set_text " " * offset
+
+ position_comment = TkCOMMENT.new 0, line_no, 1
+ position_comment.set_text "# File #{@top_level.relative_name}, line #{line_no}"
+ meth.add_tokens [position_comment, NEWLINE_TOKEN, indent]
meth.call_seq = signature
@@ -1110,7 +1078,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
record_location obj
end
- return if peek_tk.nil? || :on_comma != peek_tk[:kind]
+ return unless TkCOMMA === peek_tk
get_tk
end
@@ -1122,14 +1090,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Returns true if the comment was not consumed.
def parse_identifier container, single, tk, comment # :nodoc:
- case tk[:text]
+ case tk.name
when 'private', 'protected', 'public', 'private_class_method',
'public_class_method', 'module_function' then
parse_visibility container, single, tk
return true
- when 'private_constant', 'public_constant'
- parse_constant_visibility container, single, tk
- return true
when 'attr' then
parse_attr container, single, tk, comment
when /^attr_(reader|writer|accessor)$/ then
@@ -1194,9 +1159,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
tmp = RDoc::CodeObject.new
read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
- regexp = /^# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i
- if regexp =~ comment.text then
- comment.text = comment.text.sub(regexp, '')
+ if comment.text.sub!(/^# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '') then
rw = case $1
when 'attr_reader' then 'R'
when 'attr_writer' then 'W'
@@ -1220,8 +1183,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Parses a meta-programmed method
def parse_meta_method(container, single, tk, comment)
- column = tk[:char_no]
- line_no = tk[:line_no]
+ column = tk.char_no
+ offset = tk.seek
+ line_no = tk.line_no
start_collecting_tokens
add_token tk
@@ -1229,8 +1193,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
- comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
- singleton = !!$~
+ singleton = !!comment.text.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3')
name = parse_meta_method_name comment, tk
@@ -1238,17 +1201,19 @@ class RDoc::Parser::Ruby < RDoc::Parser
meth = RDoc::MetaMethod.new get_tkread, name
record_location meth
+ meth.offset = offset
meth.line = line_no
meth.singleton = singleton
remove_token_listener self
meth.start_collecting_tokens
- indent = { :line_no => 1, :char_no => 1, :kind => :on_sp, :text => ' ' * column }
- position_comment = { :line_no => line_no, :char_no => 1, :kind => :on_comment }
- position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
- newline = { :line_no => 0, :char_no => 0, :kind => :on_nl, :text => "\n" }
- meth.add_tokens [position_comment, newline, indent]
+ indent = TkSPACE.new 0, 1, 1
+ indent.set_text " " * column
+
+ position_comment = TkCOMMENT.new 0, line_no, 1
+ position_comment.value = "# File #{@top_level.relative_name}, line #{line_no}"
+ meth.add_tokens [position_comment, NEWLINE_TOKEN, indent]
meth.add_tokens @token_stream
parse_meta_method_params container, single, meth, tk, comment
@@ -1272,16 +1237,17 @@ class RDoc::Parser::Ruby < RDoc::Parser
name_t = get_tk
- if :on_symbol == name_t[:kind] then
- name_t[:text][1..-1]
- elsif :on_tstring == name_t[:kind] then
- name_t[:text][1..-2]
- elsif :on_op == name_t[:kind] && '=' == name_t[:text] then # ignore
+ case name_t
+ when TkSYMBOL then
+ name_t.text[1..-1]
+ when TkSTRING then
+ name_t.value[1..-2]
+ when TkASSIGN then # ignore
remove_token_listener self
nil
else
- warn "unknown name token #{name_t.inspect} for meta-method '#{tk[:text]}'"
+ warn "unknown name token #{name_t.inspect} for meta-method '#{tk.name}'"
'unknown'
end
end
@@ -1293,7 +1259,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
token_listener meth do
meth.params = ''
- look_for_directives_in meth, comment
comment.normalize
comment.extract_call_seq meth
@@ -1302,13 +1267,14 @@ class RDoc::Parser::Ruby < RDoc::Parser
last_tk = tk
while tk = get_tk do
- if :on_semicolon == tk[:kind] then
+ case tk
+ when TkSEMICOLON then
break
- elsif :on_nl == tk[:kind] then
- break unless last_tk and :on_comma == last_tk[:kind]
- elsif :on_sp == tk[:kind] then
+ when TkNL then
+ break unless last_tk and TkCOMMA === last_tk
+ when TkSPACE then
# expression continues
- elsif :on_kw == tk[:kind] && 'do' == tk[:text] then
+ when TkDO then
parse_statements container, single, meth
break
else
@@ -1325,8 +1291,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
singleton = nil
added_container = false
name = nil
- column = tk[:char_no]
- line_no = tk[:line_no]
+ column = tk.char_no
+ offset = tk.seek
+ line_no = tk.line_no
start_collecting_tokens
add_token tk
@@ -1340,18 +1307,19 @@ class RDoc::Parser::Ruby < RDoc::Parser
return unless name
meth = RDoc::AnyMethod.new get_tkread, name
- look_for_directives_in meth, comment
meth.singleton = single == SINGLE ? true : singleton
record_location meth
+ meth.offset = offset
meth.line = line_no
meth.start_collecting_tokens
- indent = { :line_no => 1, :char_no => 1, :kind => :on_sp, :text => ' ' * column }
- token = { :line_no => line_no, :char_no => 1, :kind => :on_comment }
- token[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
- newline = { :line_no => 0, :char_no => 0, :kind => :on_nl, :text => "\n" }
- meth.add_tokens [token, newline, indent]
+ indent = TkSPACE.new 0, 1, 1
+ indent.set_text " " * column
+
+ token = TkCOMMENT.new 0, line_no, 1
+ token.set_text "# File #{@top_level.relative_name}, line #{line_no}"
+ meth.add_tokens [token, NEWLINE_TOKEN, indent]
meth.add_tokens @token_stream
parse_method_params_and_body container, single, meth, added_container
@@ -1361,9 +1329,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
meth.comment = comment
- # after end modifiers
- read_documentation_modifiers meth, RDoc::METHOD_MODIFIERS
-
@stats.add_method meth
end
@@ -1372,6 +1337,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_method_params_and_body container, single, meth, added_container
token_listener meth do
+ @scanner.continue = false
parse_method_parameters meth
if meth.document_self or not @track_visibility then
@@ -1414,13 +1380,15 @@ class RDoc::Parser::Ruby < RDoc::Parser
# it is a singleton or regular method.
def parse_method_name container # :nodoc:
+ @scanner.lex_state = :EXPR_FNAME
+
skip_tkspace
name_t = get_tk
- back_tk = skip_tkspace(false)
+ back_tk = skip_tkspace
singleton = false
- dot = get_tk
- if dot[:kind] == :on_period || (dot[:kind] == :on_op && dot[:text] == '::') then
+ case dot = get_tk
+ when TkDOT, TkCOLON2 then
singleton = true
name, container = parse_method_name_singleton container, name_t
@@ -1441,15 +1409,16 @@ class RDoc::Parser::Ruby < RDoc::Parser
# is parsed from the token stream for a regular method.
def parse_method_name_regular container, name_t # :nodoc:
- if :on_op == name_t[:kind] && (%w{* & [] []= <<}.include?(name_t[:text])) then
- name_t[:text]
+ case name_t
+ when TkSTAR, TkAMPER then
+ name_t.text
else
- unless [:on_kw, :on_const, :on_ident].include?(name_t[:kind]) then
+ unless name_t.respond_to? :name then
warn "expected method name token, . or ::, got #{name_t.inspect}"
skip_method container
return
end
- name_t[:text]
+ name_t.name
end
end
@@ -1459,42 +1428,47 @@ class RDoc::Parser::Ruby < RDoc::Parser
# for a singleton method.
def parse_method_name_singleton container, name_t # :nodoc:
+ @scanner.lex_state = :EXPR_FNAME
skip_tkspace
name_t2 = get_tk
- if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then
- # NOTE: work around '[' being consumed early
- if :on_lbracket == name_t2[:kind]
- get_tk
- name = '[]'
- else
- name = name_t2[:text]
- end
- elsif :on_const == name_t[:kind] then
- name = name_t2[:text]
+ name =
+ case name_t
+ when TkSELF, TkMOD then
+ case name_t2
+ # NOTE: work around '[' being consumed early and not being re-tokenized
+ # as a TkAREF
+ when TkfLBRACK then
+ get_tk
+ '[]'
+ else
+ name_t2.name
+ end
+ when TkCONSTANT then
+ name = name_t2.name
- container = get_method_container container, name_t
+ container = get_method_container container, name_t
- return unless container
+ return unless container
- name
- elsif :on_ident == name_t[:kind] || :on_ivar == name_t[:kind] || :on_gvar == name_t[:kind] then
- parse_method_dummy container
+ name
+ when TkIDENTIFIER, TkIVAR, TkGVAR then
+ parse_method_dummy container
- name = nil
- elsif (:on_kw == name_t[:kind]) && ('true' == name_t[:text] || 'false' == name_t[:text] || 'nil' == name_t[:text]) then
- klass_name = "#{name_t[:text].capitalize}Class"
- container = @store.find_class_named klass_name
- container ||= @top_level.add_class RDoc::NormalClass, klass_name
+ nil
+ when TkTRUE, TkFALSE, TkNIL then
+ klass_name = "#{name_t.name.capitalize}Class"
+ container = @store.find_class_named klass_name
+ container ||= @top_level.add_class RDoc::NormalClass, klass_name
- name = name_t2[:text]
- else
- warn "unexpected method name token #{name_t.inspect}"
- # break
- skip_method container
+ name_t2.name
+ else
+ warn "unexpected method name token #{name_t.inspect}"
+ # break
+ skip_method container
- name = nil
- end
+ nil
+ end
return name, container
end
@@ -1510,46 +1484,39 @@ class RDoc::Parser::Ruby < RDoc::Parser
return '' unless end_token
nest = 0
- continue = false
- while tk != nil do
- case tk[:kind]
- when :on_semicolon then
+ loop do
+ case tk
+ when TkSEMICOLON then
break if nest == 0
- when :on_lbrace then
+ when TkLBRACE, TkfLBRACE then
nest += 1
- when :on_rbrace then
+ when TkRBRACE then
nest -= 1
if nest <= 0
# we might have a.each { |i| yield i }
unget_tk(tk) if nest < 0
break
end
- when :on_lparen then
+ when TkLPAREN, TkfLPAREN then
nest += 1
- when end_token[:kind] then
- if end_token[:kind] == :on_rparen
+ when end_token then
+ if end_token == TkRPAREN
nest -= 1
break if nest <= 0
else
- break
+ break unless @scanner.continue
end
- when :on_rparen then
+ when TkRPAREN then
nest -= 1
- when :on_comment, :on_embdoc then
+ when method && method.block_params.nil? && TkCOMMENT then
+ unget_tk tk
+ read_documentation_modifiers method, modifiers
@read.pop
- if :on_nl == end_token[:kind] and "\n" == tk[:text][-1] and
- (!continue or (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) != 0) then
- if method && method.block_params.nil? then
- unget_tk tk
- read_documentation_modifiers method, modifiers
- end
- break if !continue and nest <= 0
- end
- when :on_comma then
- continue = true
- when :on_ident then
- continue = false if continue
+ when TkCOMMENT then
+ @read.pop
+ when nil then
+ break
end
tk = get_tk
end
@@ -1583,7 +1550,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_module container, single, tk, comment
container, name_t, = get_class_or_module container
- name = name_t[:text]
+ name = name_t.name
mod = container.add_module RDoc::NormalModule, name
mod.ignore unless container.document_children
@@ -1593,9 +1560,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
mod.add_comment comment, @top_level
parse_statements mod
- # after end modifiers
- read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
-
@stats.add_module mod
end
@@ -1606,12 +1570,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace_comment
tk = get_tk
- if :on_lparen == tk[:kind] then
+ if TkLPAREN === tk then
skip_tkspace_comment
tk = get_tk
end
- name = tk[:text][1..-2] if :on_tstring == tk[:kind]
+ name = tk.text if TkSTRING === tk
if name then
@top_level.add_require RDoc::Require.new(name, comment)
@@ -1627,13 +1591,13 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
while tk = get_tk
- case tk[:kind]
- when :on_nl, :on_semicolon, :on_comment then
+ case tk
+ when TkNL, TkSEMICOLON then
break
- when :on_comma then
+ when TkCOMMA then
skip_tkspace false
- get_tk if :on_nl == peek_tk[:kind]
+ get_tk if TkNL === peek_tk
end
skip_tkspace false
@@ -1646,7 +1610,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_statements(container, single = NORMAL, current_method = nil,
comment = new_comment(''))
raise 'no' unless RDoc::Comment === comment
- comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
+ comment.force_encoding @encoding if @encoding
nest = 1
save_visibility = container.visibility
@@ -1657,49 +1621,32 @@ class RDoc::Parser::Ruby < RDoc::Parser
keep_comment = false
try_parse_comment = false
- non_comment_seen = true unless (:on_comment == tk[:kind] or :on_embdoc == tk[:kind])
+ non_comment_seen = true unless TkCOMMENT === tk
- case tk[:kind]
- when :on_nl, :on_ignored_nl, :on_comment, :on_embdoc then
- if :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
- skip_tkspace
- tk = get_tk
- else
- past_tokens = @read.size > 1 ? @read[0..-2] : []
- nl_position = 0
- past_tokens.reverse.each_with_index do |read_tk, i|
- if read_tk =~ /^\n$/ then
- nl_position = (past_tokens.size - 1) - i
- break
- elsif read_tk =~ /^#.*\n$/ then
- nl_position = ((past_tokens.size - 1) - i) + 1
- break
- end
- end
- comment_only_line = past_tokens[nl_position..-1].all?{ |c| c =~ /^\s+$/ }
- unless comment_only_line then
- tk = get_tk
- end
- end
+ case tk
+ when TkNL then
+ skip_tkspace
+ tk = get_tk
- if tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) then
+ if TkCOMMENT === tk then
if non_comment_seen then
# Look for RDoc in a comment about to be thrown away
non_comment_seen = parse_comment container, tk, comment unless
comment.empty?
comment = ''
- comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
+ comment.force_encoding @encoding if @encoding
end
- while tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) do
- comment += tk[:text]
- comment += "\n" unless "\n" == tk[:text].chars.to_a.last
+ while TkCOMMENT === tk do
+ comment << tk.text << "\n"
- if tk[:text].size > 1 && "\n" == tk[:text].chars.to_a.last then
+ tk = get_tk
+
+ if TkNL === tk then
skip_tkspace false # leading spaces
+ tk = get_tk
end
- tk = get_tk
end
comment = new_comment comment
@@ -1720,78 +1667,60 @@ class RDoc::Parser::Ruby < RDoc::Parser
unget_tk tk
keep_comment = true
- container.current_line_visibility = nil
-
- when :on_kw then
- case tk[:text]
- when 'class' then
- parse_class container, single, tk, comment
- when 'module' then
- parse_module container, single, tk, comment
+ when TkCLASS then
+ parse_class container, single, tk, comment
- when 'def' then
- parse_method container, single, tk, comment
+ when TkMODULE then
+ parse_module container, single, tk, comment
- when 'alias' then
- parse_alias container, single, tk, comment unless current_method
+ when TkDEF then
+ parse_method container, single, tk, comment
- when 'yield' then
- if current_method.nil? then
- warn "Warning: yield outside of method" if container.document_self
- else
- parse_yield container, single, tk, current_method
- end
+ when TkCONSTANT then
+ unless parse_constant container, tk, comment, current_method then
+ try_parse_comment = true
+ end
- when 'until', 'while' then
- if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
- nest += 1
- skip_optional_do_after_expression
- end
+ when TkALIAS then
+ parse_alias container, single, tk, comment unless current_method
- # Until and While can have a 'do', which shouldn't increase the nesting.
- # We can't solve the general case, but we can handle most occurrences by
- # ignoring a do at the end of a line.
+ when TkYIELD then
+ if current_method.nil? then
+ warn "Warning: yield outside of method" if container.document_self
+ else
+ parse_yield container, single, tk, current_method
+ end
- # 'for' is trickier
- when 'for' then
- nest += 1
- skip_for_variable
- skip_optional_do_after_expression
+ # Until and While can have a 'do', which shouldn't increase the nesting.
+ # We can't solve the general case, but we can handle most occurrences by
+ # ignoring a do at the end of a line.
- when 'case', 'do', 'if', 'unless', 'begin' then
- if (tk[:state] & RDoc::RipperStateLex::EXPR_LABEL) == 0
- nest += 1
- end
-
- when 'super' then
- current_method.calls_super = true if current_method
+ when TkUNTIL, TkWHILE then
+ nest += 1
+ skip_optional_do_after_expression
- when 'rescue' then
- parse_rescue
+ # 'for' is trickier
+ when TkFOR then
+ nest += 1
+ skip_for_variable
+ skip_optional_do_after_expression
- when 'end' then
- nest -= 1
- if nest == 0 then
- container.ongoing_visibility = save_visibility
+ when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN then
+ nest += 1
- parse_comment container, tk, comment unless comment.empty?
+ when TkSUPER then
+ current_method.calls_super = true if current_method
- return
- end
- end
+ when TkRESCUE then
+ parse_rescue
- when :on_const then
- unless parse_constant container, tk, comment, current_method then
- try_parse_comment = true
- end
-
- when :on_ident then
+ when TkIDENTIFIER then
if nest == 1 and current_method.nil? then
keep_comment = parse_identifier container, single, tk, comment
end
- case tk[:text]
+ case tk.name
when "require" then
parse_require container, comment
when "include" then
@@ -1800,6 +1729,16 @@ class RDoc::Parser::Ruby < RDoc::Parser
parse_extend_or_include RDoc::Extend, container, comment
end
+ when TkEND then
+ nest -= 1
+ if nest == 0 then
+ read_documentation_modifiers container, RDoc::CLASS_MODIFIERS
+ container.ongoing_visibility = save_visibility
+
+ parse_comment container, tk, comment unless comment.empty?
+
+ return
+ end
else
try_parse_comment = nest == 1
end
@@ -1813,7 +1752,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
unless keep_comment then
comment = new_comment ''
- comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
+ comment.force_encoding @encoding if @encoding
container.params = nil
container.block_params = nil
end
@@ -1831,8 +1770,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
def parse_symbol_arg(no = nil)
skip_tkspace_comment
- tk = get_tk
- if tk[:kind] == :on_lparen
+ case tk = get_tk
+ when TkLPAREN
parse_symbol_arg_paren no
else
parse_symbol_arg_space no, tk
@@ -1854,10 +1793,10 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
skip_tkspace_comment
- case (tk2 = get_tk)[:kind]
- when :on_rparen
+ case tk2 = get_tk
+ when TkRPAREN
break
- when :on_comma
+ when TkCOMMA
else
warn("unexpected token: '#{tk2.inspect}'") if $DEBUG_RDOC
break
@@ -1884,7 +1823,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace false
tk1 = get_tk
- if tk1.nil? || :on_comma != tk1[:kind] then
+ unless TkCOMMA === tk1 then
unget_tk tk1
break
end
@@ -1903,12 +1842,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
# Returns symbol text from the next token
def parse_symbol_in_arg
- tk = get_tk
- if :on_symbol == tk[:kind] then
- tk[:text].sub(/^:/, '')
- elsif :on_tstring == tk[:kind] then
- tk[:text][1..-2]
- elsif :on_dstring == tk[:kind] or :on_ident == tk[:kind] then
+ case tk = get_tk
+ when TkSYMBOL
+ tk.text.sub(/^:/, '')
+ when TkSTRING
+ eval @read[-1]
+ when TkDSTRING, TkIDENTIFIER then
nil # ignore
else
warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG_RDOC
@@ -1942,44 +1881,27 @@ class RDoc::Parser::Ruby < RDoc::Parser
skip_tkspace_comment false
- ptk = peek_tk
- # Ryan Davis suggested the extension to ignore modifiers, because he
- # often writes
- #
- # protected unless $TESTING
- #
- if [:on_nl, :on_semicolon].include?(ptk[:kind]) || (:on_kw == ptk[:kind] && (['if', 'unless'].include?(ptk[:text]))) then
+ case peek_tk
+ # Ryan Davis suggested the extension to ignore modifiers, because he
+ # often writes
+ #
+ # protected unless $TESTING
+ #
+ when TkNL, TkUNLESS_MOD, TkIF_MOD, TkSEMICOLON then
container.ongoing_visibility = vis
- elsif :on_kw == ptk[:kind] && 'def' == ptk[:text]
- container.current_line_visibility = vis
else
update_visibility container, vis_type, vis, singleton
end
end
##
- # Parses a Module#private_constant or Module#public_constant call from +tk+.
-
- def parse_constant_visibility(container, single, tk)
- args = parse_symbol_arg
- case tk[:text]
- when 'private_constant'
- vis = :private
- when 'public_constant'
- vis = :public
- else
- raise RDoc::Error, 'Unreachable'
- end
- container.set_constant_visibility_for args, vis
- end
-
- ##
# Determines the block parameter for +context+
def parse_yield(context, single, tk, method)
return if method.block_params
get_tkread
+ @scanner.continue = false
method.block_params = parse_method_or_yield_parameters
end
@@ -2003,10 +1925,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
while tk = get_tk do
tokens << tk
- if :on_nl == tk[:kind] or (:on_kw == tk[:kind] && 'def' == tk[:text]) then
+ case tk
+ when TkNL, TkDEF then
return
- elsif :on_comment == tk[:kind] or :on_embdoc == tk[:kind] then
- return unless tk[:text] =~ /\s*:?([\w-]+):\s*(.*)/
+ when TkCOMMENT then
+ return unless tk.text =~ /\s*:?([\w-]+):\s*(.*)/
directive = $1.downcase
@@ -2016,7 +1939,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
end
ensure
- unless tokens.length == 1 and (:on_comment == tokens.first[:kind] or :on_embdoc == tokens.first[:kind]) then
+ unless tokens.length == 1 and TkCOMMENT === tokens.first then
tokens.reverse_each do |token|
unget_tk token
end
@@ -2030,7 +1953,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
# See also RDoc::Markup::PreProcess#handle_directive
def read_documentation_modifiers context, allowed
- skip_tkspace(false)
directive, value = read_directive allowed
return unless directive
@@ -2058,6 +1980,15 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
##
+ # Removes private comments from +comment+
+ #--
+ # TODO remove
+
+ def remove_private_comments comment
+ comment.remove_private
+ end
+
+ ##
# Scans this Ruby file for Ruby constructs
def scan
@@ -2068,33 +1999,29 @@ class RDoc::Parser::Ruby < RDoc::Parser
parse_top_level_statements @top_level
rescue StandardError => e
- if @content.include?('<%') and @content.include?('%>') then
- # Maybe, this is ERB.
- $stderr.puts "\033[2KRDoc detects ERB file. Skips it for compatibility:"
- $stderr.puts @file_name
- return
- end
bytes = ''
- if @scanner_point >= @scanner.size
- now_line_no = @scanner[@scanner.size - 1][:line_no]
- else
- now_line_no = peek_tk[:line_no]
+ 20.times do @scanner.ungetc end
+ count = 0
+ 60.times do |i|
+ count = i
+ byte = @scanner.getc
+ break unless byte
+ bytes << byte
end
+ count -= 20
+ count.times do @scanner.ungetc end
$stderr.puts <<-EOF
-#{self.class} failure around line #{now_line_no} of
+#{self.class} failure around line #{@scanner.line_no} of
#{@file_name}
EOF
unless bytes.empty? then
$stderr.puts
- now_line_no = peek_tk[:line_no]
- start_index = @scanner.find_index { |tk| tk[:line_no] == now_line_no }
- end_index = @scanner.find_index { |tk| tk[:line_no] == now_line_no + 1 } - 1
- $stderr.puts @scanner[start_index..end_index].join
+ $stderr.puts bytes.inspect
end
raise e
@@ -2110,39 +2037,40 @@ class RDoc::Parser::Ruby < RDoc::Parser
def skip_optional_do_after_expression
skip_tkspace false
tk = get_tk
+ end_token = get_end_token tk
b_nest = 0
nest = 0
+ @scanner.continue = false
loop do
- break unless tk
- case tk[:kind]
- when :on_semicolon, :on_nl, :on_ignored_nl then
+ case tk
+ when TkSEMICOLON then
break if b_nest.zero?
- when :on_lparen then
+ when TkLPAREN, TkfLPAREN then
nest += 1
- when :on_rparen then
- nest -= 1
- when :on_kw then
- case tk[:text]
- when 'begin'
- b_nest += 1
- when 'end'
- b_nest -= 1
- when 'do'
- break if nest.zero?
- end
- when :on_comment, :on_embdoc then
- if b_nest.zero? and "\n" == tk[:text][-1] then
- break
+ when TkBEGIN then
+ b_nest += 1
+ when TkEND then
+ b_nest -= 1
+ when TkDO
+ break if nest.zero?
+ when end_token then
+ if end_token == TkRPAREN
+ nest -= 1
+ break if @scanner.lex_state == :EXPR_END and nest.zero?
+ else
+ break unless @scanner.continue
end
+ when nil then
+ break
end
tk = get_tk
end
skip_tkspace false
- get_tk if peek_tk && :on_kw == peek_tk[:kind] && 'do' == peek_tk[:text]
+ get_tk if TkDO === peek_tk
end
##
@@ -2153,7 +2081,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
get_tk
skip_tkspace false
tk = get_tk
- unget_tk(tk) unless :on_kw == tk[:kind] and 'in' == tk[:text]
+ unget_tk(tk) unless TkIN === tk
end
##
@@ -2171,8 +2099,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def skip_tkspace_comment(skip_nl = true)
loop do
skip_tkspace skip_nl
- next_tk = peek_tk
- return if next_tk.nil? || (:on_comment != next_tk[:kind] and :on_embdoc != next_tk[:kind])
+ return unless TkCOMMENT === peek_tk
get_tk
end
end
@@ -2230,3 +2157,4 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
end
+
diff --git a/lib/rdoc/parser/ruby_tools.rb b/lib/rdoc/parser/ruby_tools.rb
index 1f621cd32e..654431ea30 100644
--- a/lib/rdoc/parser/ruby_tools.rb
+++ b/lib/rdoc/parser/ruby_tools.rb
@@ -1,9 +1,11 @@
-# frozen_string_literal: true
##
-# Collection of methods for writing parsers
+# Collection of methods for writing parsers against RDoc::RubyLex and
+# RDoc::RubyToken
module RDoc::Parser::RubyTools
+ include RDoc::RubyToken
+
##
# Adds a token listener +obj+, but you should probably use token_listener
@@ -19,25 +21,36 @@ module RDoc::Parser::RubyTools
tk = nil
if @tokens.empty? then
- if @scanner_point >= @scanner.size
- return nil
- else
- tk = @scanner[@scanner_point]
- @scanner_point += 1
- @read.push tk[:text]
- puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
- end
+ tk = @scanner.token
+ @read.push @scanner.get_readed
+ puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
else
@read.push @unget_read.shift
tk = @tokens.shift
puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
end
- if tk == nil || :on___end__ == tk[:kind]
- tk = nil
- end
+ tk = nil if TkEND_OF_SCRIPT === tk
+
+ if TkSYMBEG === tk then
+ set_token_position tk.line_no, tk.char_no
- return nil unless tk
+ case tk1 = get_tk
+ when TkId, TkOp, TkSTRING, TkDSTRING, TkSTAR, TkAMPER then
+ if tk1.respond_to?(:name) then
+ tk = Token(TkSYMBOL).set_text(":" + tk1.name)
+ else
+ tk = Token(TkSYMBOL).set_text(":" + tk1.text)
+ end
+
+ # remove the identifier we just read to replace it with a symbol
+ @token_listeners.each do |obj|
+ obj.pop_token
+ end if @token_listeners
+ else
+ tk = tk1
+ end
+ end
# inform any listeners of our shiny new token
@token_listeners.each do |obj|
@@ -108,24 +121,19 @@ module RDoc::Parser::RubyTools
@tokens = []
@unget_read = []
@nest = 0
- @scanner_point = 0
- end
-
- def tk_nl?(tk)
- :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
end
##
# Skips whitespace tokens including newlines if +skip_nl+ is true
- def skip_tkspace(skip_nl = true)
+ def skip_tkspace(skip_nl = true) # HACK dup
tokens = []
- while (tk = get_tk) and (:on_sp == tk[:kind] or (skip_nl and tk_nl?(tk))) do
- tokens.push(tk)
+ while TkSPACE === (tk = get_tk) or (skip_nl and TkNL === tk) do
+ tokens.push tk
end
- unget_tk(tk)
+ unget_tk tk
tokens
end
diff --git a/lib/rdoc/parser/simple.rb b/lib/rdoc/parser/simple.rb
index b1dabad0f8..65cfc1b2e7 100644
--- a/lib/rdoc/parser/simple.rb
+++ b/lib/rdoc/parser/simple.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Parse a non-source file. We basically take the whole thing as one big
# comment.
@@ -19,7 +18,7 @@ class RDoc::Parser::Simple < RDoc::Parser
preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
- @content = preprocess.handle @content, @top_level
+ preprocess.handle @content, @top_level
end
##
@@ -52,10 +51,11 @@ class RDoc::Parser::Simple < RDoc::Parser
def remove_private_comment comment
# Workaround for gsub encoding for Ruby 1.9.2 and earlier
empty = ''
- empty = RDoc::Encoding.change_encoding empty, comment.encoding
+ empty.force_encoding comment.encoding if Object.const_defined? :Encoding
comment = comment.gsub(%r%^--\n.*?^\+\+\n?%m, empty)
comment.sub(%r%^--\n.*%m, empty)
end
end
+
diff --git a/lib/rdoc/parser/text.rb b/lib/rdoc/parser/text.rb
index 01de0cc595..f973313551 100644
--- a/lib/rdoc/parser/text.rb
+++ b/lib/rdoc/parser/text.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Indicates this parser is text and doesn't contain code constructs.
#
diff --git a/lib/rdoc/rd.rb b/lib/rdoc/rd.rb
index 0d3d3cea85..28c5d286e0 100644
--- a/lib/rdoc/rd.rb
+++ b/lib/rdoc/rd.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# RDoc::RD implements the RD format from the rdtool gem.
#
diff --git a/lib/rdoc/rd/block_parser.rb b/lib/rdoc/rd/block_parser.rb
index 3f4941168f..a495ca4e1e 100644
--- a/lib/rdoc/rd/block_parser.rb
+++ b/lib/rdoc/rd/block_parser.rb
@@ -1,6 +1,6 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.14
+# This file is automatically generated by Racc 1.4.11
# from Racc grammer file "".
#
@@ -253,7 +253,7 @@ def next_token # :nodoc:
[:STRINGLINE, line]
end
else
- raise "[BUG] parsing error may occurred."
+ raise "[BUG] parsing error may occured."
end
end
@@ -418,53 +418,53 @@ end
##### State transition tables begin ###
racc_action_table = [
- 34, 35, 30, 33, 40, 34, 35, 30, 33, 40,
- 65, 34, 35, 30, 33, 14, 73, 14, 54, 76,
- 15, 88, 34, 35, 30, 33, 14, 73, 77, 33,
- 54, 15, 34, 35, 30, 33, 14, 73, 81, 38,
- 38, 15, 34, 35, 30, 33, 14, 73, 40, 36,
- 83, 15, 34, 35, 30, 33, 54, 47, 30, 35,
- 34, 15, 34, 35, 30, 33, 14, 73, 38, 67,
- 59, 15, 34, 35, 30, 33, 14, 9, 10, 11,
- 12, 15, 34, 35, 30, 33, 14, 73, 14, nil,
- nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
+ 34, 35, 30, 33, 14, 73, 38, 33, 76, 15,
+ 88, 34, 35, 30, 33, 40, 34, 35, 30, 33,
+ 40, 65, 34, 35, 30, 33, 14, 73, 77, 14,
+ 54, 15, 34, 35, 30, 33, 14, 9, 10, 11,
+ 12, 15, 34, 35, 30, 33, 14, 73, 81, 54,
+ 38, 15, 34, 35, 30, 33, 14, 73, 40, 67,
+ 83, 15, 34, 35, 30, 33, 14, 73, 54, 30,
+ 35, 15, 34, 35, 30, 33, 34, 47, 36, 14,
+ 59, 15, 34, 35, 30, 33, 14, 73, 38, nil,
nil, 15, 34, 35, 30, 33, nil, 47, nil, nil,
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
nil, 15, 34, 35, 30, 33, 14, 73, nil, nil,
nil, 15, 34, 35, 30, 33, 14, 9, 10, 11,
- 12, 15, 34, 35, 30, 33, 14, 73, 61, 63,
- nil, 15, 14, 62, 60, 61, 63, 79, 61, 63,
- 62, 87, nil, 62, 34, 35, 30, 33 ]
+ 12, 15, 34, 35, 30, 33, 14, 73, nil, nil,
+ nil, 15, 34, 35, 30, 33, 14, 73, 61, 63,
+ nil, 15, nil, 62, 60, 61, 63, 61, 63, 14,
+ 62, 87, 62, nil, 79, 34, 35, 30, 33 ]
racc_action_check = [
- 41, 41, 41, 41, 41, 15, 15, 15, 15, 15,
- 41, 86, 86, 86, 86, 86, 86, 34, 33, 49,
- 86, 86, 85, 85, 85, 85, 85, 85, 51, 31,
- 54, 85, 79, 79, 79, 79, 79, 79, 56, 57,
- 58, 79, 78, 78, 78, 78, 78, 78, 62, 1,
- 66, 78, 24, 24, 24, 24, 30, 24, 28, 25,
- 22, 24, 75, 75, 75, 75, 75, 75, 13, 44,
- 36, 75, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 46, 46, 46, 46, 46, 46, 35, nil,
- nil, 46, 45, 45, 45, 45, 45, 45, nil, nil,
- nil, 45, 27, 27, 27, 27, nil, 27, nil, nil,
+ 86, 86, 86, 86, 86, 86, 57, 31, 49, 86,
+ 86, 41, 41, 41, 41, 41, 15, 15, 15, 15,
+ 15, 41, 45, 45, 45, 45, 45, 45, 51, 34,
+ 54, 45, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 85, 85, 85, 85, 85, 85, 56, 33,
+ 58, 85, 79, 79, 79, 79, 79, 79, 62, 44,
+ 66, 79, 78, 78, 78, 78, 78, 78, 30, 28,
+ 25, 78, 24, 24, 24, 24, 22, 24, 1, 35,
+ 36, 24, 75, 75, 75, 75, 75, 75, 13, nil,
+ nil, 75, 27, 27, 27, 27, nil, 27, nil, nil,
nil, 27, 74, 74, 74, 74, 74, 74, nil, nil,
nil, 74, 68, 68, 68, 68, 68, 68, nil, nil,
- nil, 68, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 47, 47, 47, 47, 47, 47, 39, 39,
- nil, 47, 52, 39, 39, 82, 82, 52, 64, 64,
- 82, 82, nil, 64, 20, 20, 20, 20 ]
+ nil, 68, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 46, 46, 46, 46, 46, 46, nil, nil,
+ nil, 46, 47, 47, 47, 47, 47, 47, 39, 39,
+ nil, 47, nil, 39, 39, 82, 82, 64, 64, 52,
+ 82, 82, 64, nil, 52, 20, 20, 20, 20 ]
racc_action_pointer = [
- 129, 49, 69, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 61, nil, 2, nil, nil, nil, nil,
- 161, nil, 57, nil, 49, 55, nil, 99, 53, nil,
- 48, 23, nil, 10, 10, 81, 70, nil, nil, 141,
- nil, -3, nil, nil, 56, 89, 79, 139, nil, 6,
- nil, 15, 145, nil, 22, nil, 25, 32, 33, nil,
- nil, nil, 41, nil, 151, nil, 37, nil, 119, nil,
- nil, nil, nil, nil, 109, 59, nil, nil, 39, 29,
- nil, nil, 148, nil, nil, 19, 8, nil, nil ]
+ 29, 78, 119, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, 81, nil, 13, nil, nil, nil, nil,
+ 162, nil, 73, nil, 69, 66, nil, 89, 64, nil,
+ 60, 1, nil, 41, 22, 72, 80, nil, nil, 141,
+ nil, 8, nil, nil, 46, 19, 129, 139, nil, -5,
+ nil, 15, 152, nil, 22, nil, 35, -1, 43, nil,
+ nil, nil, 51, nil, 150, nil, 47, nil, 109, nil,
+ nil, nil, nil, nil, 99, 79, nil, nil, 59, 49,
+ nil, nil, 148, nil, nil, 39, -3, nil, nil ]
racc_action_default = [
-2, -73, -1, -4, -5, -6, -7, -8, -9, -10,
@@ -478,26 +478,26 @@ racc_action_default = [
-60, -47, -73, -29, -52, -48, -73, -20, -50 ]
racc_goto_table = [
- 4, 39, 4, 68, 74, 75, 6, 5, 6, 5,
- 44, 42, 51, 49, 3, 56, 37, 57, 58, 80,
- 2, 66, 84, 41, 43, 48, 50, 64, 84, 84,
- 46, 45, 42, 46, 45, 55, 85, 86, 1, 84,
+ 4, 39, 4, 68, 74, 75, 5, 6, 5, 6,
+ 51, 42, 44, 56, 3, 49, 37, 57, 58, 41,
+ 43, 48, 84, 50, 66, 55, 1, 64, 84, 84,
+ 45, 46, 42, 45, 46, 2, 85, 86, 80, 84,
84, nil, nil, nil, nil, nil, nil, nil, 82, nil,
nil, nil, 78 ]
racc_goto_check = [
- 4, 10, 4, 31, 31, 31, 6, 5, 6, 5,
- 21, 12, 27, 21, 3, 27, 3, 9, 9, 33,
- 2, 11, 32, 17, 19, 23, 26, 10, 32, 32,
- 6, 5, 12, 6, 5, 29, 31, 31, 1, 32,
+ 4, 10, 4, 31, 31, 31, 5, 6, 5, 6,
+ 27, 12, 21, 27, 3, 21, 3, 9, 9, 17,
+ 19, 23, 32, 26, 11, 29, 1, 10, 32, 32,
+ 5, 6, 12, 5, 6, 2, 31, 31, 33, 32,
32, nil, nil, nil, nil, nil, nil, nil, 10, nil,
nil, nil, 4 ]
racc_goto_pointer = [
- nil, 38, 20, 14, 0, 7, 6, nil, nil, -17,
- -14, -20, -9, nil, nil, nil, nil, 8, nil, 2,
- nil, -14, nil, 0, nil, nil, -2, -18, nil, 4,
- nil, -42, -46, -35 ]
+ nil, 26, 35, 14, 0, 6, 7, nil, nil, -17,
+ -14, -17, -9, nil, nil, nil, nil, 4, nil, -2,
+ nil, -12, nil, -4, nil, nil, -5, -20, nil, -6,
+ nil, -42, -46, -16 ]
racc_goto_default = [
nil, nil, nil, nil, 70, 71, 72, 7, 8, 13,
diff --git a/lib/rdoc/rd/inline.rb b/lib/rdoc/rd/inline.rb
index e5cb545728..ee724fb80f 100644
--- a/lib/rdoc/rd/inline.rb
+++ b/lib/rdoc/rd/inline.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Inline keeps track of markup and labels to create proper links.
@@ -50,11 +49,11 @@ class RDoc::RD::Inline
def append more
case more
when String then
- @reference += more
- @rdoc += more
+ @reference << more
+ @rdoc << more
when RDoc::RD::Inline then
- @reference += more.reference
- @rdoc += more.rdoc
+ @reference << more.reference
+ @rdoc << more.rdoc
else
raise "unknown thingy #{more}"
end
diff --git a/lib/rdoc/rd/inline_parser.rb b/lib/rdoc/rd/inline_parser.rb
index 783a5a7c7e..80d029cc21 100644
--- a/lib/rdoc/rd/inline_parser.rb
+++ b/lib/rdoc/rd/inline_parser.rb
@@ -1,6 +1,6 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.14
+# This file is automatically generated by Racc 1.4.11
# from Racc grammer file "".
#
@@ -243,152 +243,152 @@ end
##### State transition tables begin ###
racc_action_table = [
- 104, 103, 102, 100, 101, 99, 115, 116, 117, 86,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 164, 118, 119, 104, 103, 102, 100, 101, 99, 115,
- 116, 117, 175, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 85, 118, 119, 63, 64, 65, 61,
- 81, 62, 76, 78, 79, 84, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 77, 80, 149, 104,
- 103, 102, 100, 101, 99, 115, 116, 117, 29, 105,
- 106, 107, 108, 109, 110, 111, 112, 113, 114, 173,
+ 63, 64, 65, 153, 81, 62, 76, 78, 79, 87,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 77, 80, 152, 63, 64, 65, 61, 81, 62, 76,
+ 78, 79, 124, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 77, 80, 149, 104, 103, 102, 100,
+ 101, 99, 115, 116, 117, 164, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 96, 118, 119, 104,
+ 103, 102, 100, 101, 99, 115, 116, 117, 89, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113, 114, 88,
118, 119, 104, 103, 102, 100, 101, 99, 115, 116,
- 117, 137, 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 177, 118, 119, 63, 64, 65, 153, 81,
- 62, 76, 78, 79, 148, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 77, 80, 152, 22, 23,
- 24, 25, 26, 21, 18, 19, 176, 177, 13, 124,
- 14, 96, 15, 89, 16, 154, 17, 88, 137, 20,
- 22, 23, 24, 25, 26, 21, 18, 19, 87, 161,
- 13, nil, 14, nil, 15, nil, 16, nil, 17, 42,
- nil, 20, 54, 38, 53, 55, 56, 57, nil, 13,
- nil, 14, nil, 15, nil, 16, nil, 17, nil, nil,
+ 117, 161, 105, 106, 107, 108, 109, 110, 111, 112,
+ 113, 114, 86, 118, 119, 104, 103, 102, 100, 101,
+ 99, 115, 116, 117, 85, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 137, 118, 119, 63, 64,
+ 65, 61, 81, 62, 76, 78, 79, 84, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 77, 80,
+ 22, 23, 24, 25, 26, 21, 18, 19, 176, 177,
+ 13, 173, 14, 154, 15, 175, 16, 137, 17, 42,
+ 148, 20, 54, 38, 53, 55, 56, 57, 29, 13,
+ 177, 14, nil, 15, nil, 16, nil, 17, nil, nil,
20, 22, 23, 24, 25, 26, 21, 18, 19, nil,
nil, 13, nil, 14, nil, 15, nil, 16, nil, 17,
- nil, nil, 20, 63, 64, 65, 61, 81, 62, 76,
- 78, 79, nil, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 77, 80, 145, nil, nil, 54, 133,
- 53, 55, 56, 57, nil, 13, nil, 14, nil, 15,
+ nil, nil, 20, 22, 23, 24, 25, 26, 21, 18,
+ 19, nil, nil, 13, nil, 14, nil, 15, nil, 16,
+ nil, 17, nil, nil, 20, 22, 23, 24, 25, 26,
+ 21, 18, 19, nil, nil, 13, nil, 14, nil, 15,
nil, 16, nil, 17, 145, nil, 20, 54, 133, 53,
55, 56, 57, nil, 13, nil, 14, nil, 15, nil,
16, nil, 17, nil, nil, 20, 22, 23, 24, 25,
26, 21, 18, 19, nil, nil, 13, nil, 14, nil,
15, nil, 16, nil, 17, 145, nil, 20, 54, 133,
53, 55, 56, 57, nil, 13, nil, 14, nil, 15,
- nil, 16, nil, 17, 145, nil, 20, 54, 133, 53,
+ nil, 16, nil, 17, nil, nil, 20, 22, 23, 24,
+ 25, 26, 21, 18, 19, nil, nil, 13, nil, 14,
+ nil, 15, nil, 16, nil, 17, 145, nil, 20, 54,
+ 133, 53, 55, 56, 57, nil, 13, nil, 14, nil,
+ 15, nil, 16, nil, 17, 145, nil, 20, 54, 133,
+ 53, 55, 56, 57, nil, 13, nil, 14, nil, 15,
+ nil, 16, nil, 17, nil, nil, 20, 22, 23, 24,
+ 25, 26, 21, 18, 19, nil, nil, 13, nil, 14,
+ nil, 15, nil, 16, 122, 17, nil, 54, 20, 53,
55, 56, 57, nil, 13, nil, 14, nil, 15, nil,
16, nil, 17, nil, nil, 20, 22, 23, 24, 25,
26, 21, 18, 19, nil, nil, 13, nil, 14, nil,
- 15, nil, 16, nil, 17, nil, nil, 20, 22, 23,
- 24, 25, 26, 21, 18, 19, nil, nil, 13, nil,
+ 15, nil, 16, nil, 17, nil, nil, 20, 135, 136,
+ 54, 133, 53, 55, 56, 57, nil, 13, nil, 14,
+ nil, 15, nil, 16, nil, 17, nil, nil, 20, 135,
+ 136, 54, 133, 53, 55, 56, 57, nil, 13, nil,
14, nil, 15, nil, 16, nil, 17, nil, nil, 20,
- 22, 23, 24, 25, 26, 21, 18, 19, nil, nil,
- 13, nil, 14, nil, 15, nil, 16, nil, 17, nil,
- nil, 20, 22, 23, 24, 25, 26, 21, 18, 19,
- nil, nil, 13, nil, 14, nil, 15, nil, 16, 122,
- 17, nil, 54, 20, 53, 55, 56, 57, nil, 13,
+ 135, 136, 54, 133, 53, 55, 56, 57, nil, 13,
nil, 14, nil, 15, nil, 16, nil, 17, nil, nil,
- 20, 135, 136, 54, 133, 53, 55, 56, 57, nil,
- 13, nil, 14, nil, 15, nil, 16, nil, 17, nil,
- nil, 20, 135, 136, 54, 133, 53, 55, 56, 57,
- nil, 13, nil, 14, nil, 15, nil, 16, nil, 17,
- nil, nil, 20, 135, 136, 54, 133, 53, 55, 56,
- 57, nil, 13, nil, 14, nil, 15, nil, 16, 158,
- 17, nil, 54, 20, 53, 55, 56, 57, 95, nil,
- nil, 54, 91, 53, 55, 56, 57, 145, nil, nil,
- 54, 133, 53, 55, 56, 57, 165, 135, 136, 54,
+ 20, 172, 135, 136, 54, 133, 53, 55, 56, 57,
+ 165, 135, 136, 54, 133, 53, 55, 56, 57, 95,
+ nil, nil, 54, 91, 53, 55, 56, 57, 174, 135,
+ 136, 54, 133, 53, 55, 56, 57, 158, nil, nil,
+ 54, nil, 53, 55, 56, 57, 178, 135, 136, 54,
133, 53, 55, 56, 57, 145, nil, nil, 54, 133,
- 53, 55, 56, 57, 172, 135, 136, 54, 133, 53,
- 55, 56, 57, 174, 135, 136, 54, 133, 53, 55,
- 56, 57, 178, 135, 136, 54, 133, 53, 55, 56,
+ 53, 55, 56, 57, 145, nil, nil, 54, 133, 53,
+ 55, 56, 57, 135, 136, 54, 133, 53, 55, 56,
57, 135, 136, 54, 133, 53, 55, 56, 57, 135,
- 136, 54, 133, 53, 55, 56, 57, 135, 136, 54,
- 133, 53, 55, 56, 57, 22, 23, 24, 25, 26,
- 21 ]
+ 136, 54, 133, 53, 55, 56, 57, 22, 23, 24,
+ 25, 26, 21 ]
racc_action_check = [
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 32,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 125, 38, 38, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 164, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 31, 97, 97, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 29, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 1, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 162,
- 91, 91, 155, 155, 155, 155, 155, 155, 155, 155,
- 155, 43, 155, 155, 155, 155, 155, 155, 155, 155,
- 155, 155, 172, 155, 155, 61, 61, 61, 61, 61,
- 61, 61, 61, 61, 58, 61, 61, 61, 61, 61,
- 61, 61, 61, 61, 61, 61, 61, 61, 16, 16,
- 16, 16, 16, 16, 16, 16, 165, 165, 16, 41,
- 16, 37, 16, 35, 16, 90, 16, 34, 94, 16,
- 17, 17, 17, 17, 17, 17, 17, 17, 33, 100,
- 17, nil, 17, nil, 17, nil, 17, nil, 17, 18,
- nil, 17, 18, 18, 18, 18, 18, 18, nil, 18,
- nil, 18, nil, 18, nil, 18, nil, 18, nil, nil,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 33,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 59, 59, 59, 59, 59, 59, 59,
+ 59, 59, 41, 59, 59, 59, 59, 59, 59, 59,
+ 59, 59, 59, 59, 59, 59, 97, 97, 97, 97,
+ 97, 97, 97, 97, 97, 125, 97, 97, 97, 97,
+ 97, 97, 97, 97, 97, 97, 37, 97, 97, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 35, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 34,
+ 38, 38, 155, 155, 155, 155, 155, 155, 155, 155,
+ 155, 100, 155, 155, 155, 155, 155, 155, 155, 155,
+ 155, 155, 32, 155, 155, 91, 91, 91, 91, 91,
+ 91, 91, 91, 91, 31, 91, 91, 91, 91, 91,
+ 91, 91, 91, 91, 91, 43, 91, 91, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 29, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 17, 17, 17, 17, 17, 17, 17, 17, 165, 165,
+ 17, 162, 17, 90, 17, 164, 17, 94, 17, 18,
+ 58, 17, 18, 18, 18, 18, 18, 18, 1, 18,
+ 172, 18, nil, 18, nil, 18, nil, 18, nil, nil,
18, 19, 19, 19, 19, 19, 19, 19, 19, nil,
nil, 19, nil, 19, nil, 19, nil, 19, nil, 19,
- nil, nil, 19, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, nil, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 146, nil, nil, 146, 146,
+ nil, nil, 19, 16, 16, 16, 16, 16, 16, 16,
+ 16, nil, nil, 16, nil, 16, nil, 16, nil, 16,
+ nil, 16, nil, nil, 16, 15, 15, 15, 15, 15,
+ 15, 15, 15, nil, nil, 15, nil, 15, nil, 15,
+ nil, 15, nil, 15, 45, nil, 15, 45, 45, 45,
+ 45, 45, 45, nil, 45, nil, 45, nil, 45, nil,
+ 45, nil, 45, nil, nil, 45, 14, 14, 14, 14,
+ 14, 14, 14, 14, nil, nil, 14, nil, 14, nil,
+ 14, nil, 14, nil, 14, 146, nil, 14, 146, 146,
146, 146, 146, 146, nil, 146, nil, 146, nil, 146,
- nil, 146, nil, 146, 138, nil, 146, 138, 138, 138,
- 138, 138, 138, nil, 138, nil, 138, nil, 138, nil,
- 138, nil, 138, nil, nil, 138, 0, 0, 0, 0,
+ nil, 146, nil, 146, nil, nil, 146, 13, 13, 13,
+ 13, 13, 13, 13, 13, nil, nil, 13, nil, 13,
+ nil, 13, nil, 13, nil, 13, 138, nil, 13, 138,
+ 138, 138, 138, 138, 138, nil, 138, nil, 138, nil,
+ 138, nil, 138, nil, 138, 44, nil, 138, 44, 44,
+ 44, 44, 44, 44, nil, 44, nil, 44, nil, 44,
+ nil, 44, nil, 44, nil, nil, 44, 2, 2, 2,
+ 2, 2, 2, 2, 2, nil, nil, 2, nil, 2,
+ nil, 2, nil, 2, 39, 2, nil, 39, 2, 39,
+ 39, 39, 39, nil, 39, nil, 39, nil, 39, nil,
+ 39, nil, 39, nil, nil, 39, 0, 0, 0, 0,
0, 0, 0, 0, nil, nil, 0, nil, 0, nil,
- 0, nil, 0, nil, 0, 45, nil, 0, 45, 45,
- 45, 45, 45, 45, nil, 45, nil, 45, nil, 45,
- nil, 45, nil, 45, 44, nil, 45, 44, 44, 44,
- 44, 44, 44, nil, 44, nil, 44, nil, 44, nil,
- 44, nil, 44, nil, nil, 44, 2, 2, 2, 2,
- 2, 2, 2, 2, nil, nil, 2, nil, 2, nil,
- 2, nil, 2, nil, 2, nil, nil, 2, 13, 13,
- 13, 13, 13, 13, 13, 13, nil, nil, 13, nil,
- 13, nil, 13, nil, 13, nil, 13, nil, nil, 13,
- 14, 14, 14, 14, 14, 14, 14, 14, nil, nil,
- 14, nil, 14, nil, 14, nil, 14, nil, 14, nil,
- nil, 14, 15, 15, 15, 15, 15, 15, 15, 15,
- nil, nil, 15, nil, 15, nil, 15, nil, 15, 39,
- 15, nil, 39, 15, 39, 39, 39, 39, nil, 39,
- nil, 39, nil, 39, nil, 39, nil, 39, nil, nil,
- 39, 42, 42, 42, 42, 42, 42, 42, 42, nil,
- 42, nil, 42, nil, 42, nil, 42, nil, 42, nil,
- nil, 42, 127, 127, 127, 127, 127, 127, 127, 127,
- nil, 127, nil, 127, nil, 127, nil, 127, nil, 127,
- nil, nil, 127, 122, 122, 122, 122, 122, 122, 122,
- 122, nil, 122, nil, 122, nil, 122, nil, 122, 92,
- 122, nil, 92, 122, 92, 92, 92, 92, 36, nil,
- nil, 36, 36, 36, 36, 36, 36, 52, nil, nil,
- 52, 52, 52, 52, 52, 52, 126, 126, 126, 126,
- 126, 126, 126, 126, 126, 142, nil, nil, 142, 142,
- 142, 142, 142, 142, 159, 159, 159, 159, 159, 159,
- 159, 159, 159, 163, 163, 163, 163, 163, 163, 163,
- 163, 163, 171, 171, 171, 171, 171, 171, 171, 171,
- 171, 95, 95, 95, 95, 95, 95, 95, 95, 158,
- 158, 158, 158, 158, 158, 158, 158, 168, 168, 168,
- 168, 168, 168, 168, 168, 27, 27, 27, 27, 27,
- 27 ]
+ 0, nil, 0, nil, 0, nil, nil, 0, 122, 122,
+ 122, 122, 122, 122, 122, 122, nil, 122, nil, 122,
+ nil, 122, nil, 122, nil, 122, nil, nil, 122, 127,
+ 127, 127, 127, 127, 127, 127, 127, nil, 127, nil,
+ 127, nil, 127, nil, 127, nil, 127, nil, nil, 127,
+ 42, 42, 42, 42, 42, 42, 42, 42, nil, 42,
+ nil, 42, nil, 42, nil, 42, nil, 42, nil, nil,
+ 42, 159, 159, 159, 159, 159, 159, 159, 159, 159,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 36,
+ nil, nil, 36, 36, 36, 36, 36, 36, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 92, nil, nil,
+ 92, nil, 92, 92, 92, 92, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 142, nil, nil, 142, 142,
+ 142, 142, 142, 142, 52, nil, nil, 52, 52, 52,
+ 52, 52, 52, 95, 95, 95, 95, 95, 95, 95,
+ 95, 168, 168, 168, 168, 168, 168, 168, 168, 158,
+ 158, 158, 158, 158, 158, 158, 158, 27, 27, 27,
+ 27, 27, 27 ]
racc_action_pointer = [
- 283, 78, 343, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 365, 387, 409, 135, 157, 176, 198,
- 220, nil, nil, nil, nil, nil, nil, 602, nil, 55,
- nil, 29, -7, 150, 137, 131, 515, 128, -3, 426,
- nil, 145, 447, 96, 321, 302, nil, nil, nil, nil,
- nil, nil, 524, nil, nil, nil, nil, nil, 113, 43,
- nil, 112, nil, nil, nil, nil, nil, nil, nil, nil,
+ 423, 188, 384, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, 324, 283, 242, 220, 157, 176, 198,
+ 135, nil, nil, nil, nil, nil, nil, 604, nil, 147,
+ nil, 110, 96, -9, 69, 56, 526, 43, 66, 401,
+ nil, 28, 486, 130, 362, 261, nil, nil, nil, nil,
+ nil, nil, 571, nil, nil, nil, nil, nil, 169, 20,
+ nil, -3, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 132, 66, 506, nil, 153, 577, nil, 20, nil, nil,
- 163, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ 150, 112, 544, nil, 172, 579, nil, 43, nil, nil,
+ 95, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, 489, nil, nil, 17, 533, 468, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, 261, nil,
- nil, nil, 542, nil, nil, nil, 242, nil, nil, nil,
- nil, nil, nil, nil, nil, 89, nil, nil, 585, 551,
- nil, nil, 86, 560, 28, 142, nil, nil, 593, nil,
- nil, 569, 107, nil, nil, nil, nil, nil, nil ]
+ nil, nil, 444, nil, nil, 52, 517, 465, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 343, nil,
+ nil, nil, 562, nil, nil, nil, 302, nil, nil, nil,
+ nil, nil, nil, nil, nil, 89, nil, nil, 595, 508,
+ nil, nil, 168, 535, 171, 164, nil, nil, 587, nil,
+ nil, 553, 185, nil, nil, nil, nil, nil, nil ]
racc_action_default = [
-138, -138, -1, -3, -4, -5, -6, -7, -8, -9,
@@ -411,47 +411,47 @@ racc_action_default = [
-60, -138, -34, -36, -37, -29, -30, -32, -34 ]
racc_goto_table = [
- 126, 44, 125, 52, 144, 144, 160, 93, 97, 43,
- 166, 82, 144, 41, 40, 39, 138, 146, 169, 90,
- 36, 52, 44, 1, 52, 129, 169, 94, 59, 83,
- 123, 30, 151, 92, 121, 120, 31, 32, 33, 34,
- 35, 170, 58, 166, 167, 147, 170, 166, 37, nil,
- 150, nil, 166, 159, 4, 166, 4, nil, nil, nil,
- nil, 155, nil, 156, 160, nil, nil, 4, 4, 4,
- 4, 4, nil, 4, 5, nil, 5, 52, nil, nil,
- 163, nil, 162, 157, nil, 168, nil, 5, 5, 5,
- 5, 5, nil, 5, nil, nil, nil, nil, 144, nil,
- nil, nil, 144, nil, nil, 129, 144, 144, nil, 6,
- 129, 6, nil, nil, nil, nil, 171, 7, nil, 7,
- nil, nil, 6, 6, 6, 6, 6, 8, 6, 8,
- 7, 7, 7, 7, 7, 11, 7, 11, nil, nil,
- 8, 8, 8, 8, 8, nil, 8, nil, 11, 11,
- 11, 11, 11, nil, 11 ]
+ 126, 44, 125, 43, 144, 144, 160, 93, 97, 52,
+ 166, 82, 144, 41, 40, 39, 138, 146, 169, 147,
+ 167, 94, 44, 1, 123, 129, 169, 52, 36, 37,
+ 52, 90, 59, 92, 121, 120, 31, 32, 33, 34,
+ 35, 170, 58, 166, 83, 30, 170, 166, 151, nil,
+ 150, nil, 166, 159, 8, 166, 8, nil, nil, nil,
+ nil, 155, nil, 156, 160, nil, nil, 8, 8, 8,
+ 8, 8, nil, 8, 4, nil, 4, 157, nil, nil,
+ 163, nil, 162, 52, nil, 168, nil, 4, 4, 4,
+ 4, 4, nil, 4, nil, nil, nil, nil, 144, nil,
+ nil, nil, 144, nil, nil, 129, 144, 144, nil, 5,
+ 129, 5, nil, nil, nil, nil, 171, 6, nil, 6,
+ nil, nil, 5, 5, 5, 5, 5, 11, 5, 11,
+ 6, 6, 6, 6, 6, 7, 6, 7, nil, nil,
+ 11, 11, 11, 11, 11, nil, 11, nil, 7, 7,
+ 7, 7, 7, nil, 7 ]
racc_goto_check = [
- 22, 24, 21, 34, 36, 36, 37, 18, 16, 23,
- 35, 41, 36, 20, 19, 17, 25, 25, 28, 14,
- 13, 34, 24, 1, 34, 24, 28, 23, 38, 39,
- 23, 3, 42, 17, 20, 19, 1, 1, 1, 1,
- 1, 33, 1, 35, 29, 32, 33, 35, 15, nil,
- 41, nil, 35, 22, 4, 35, 4, nil, nil, nil,
- nil, 16, nil, 18, 37, nil, nil, 4, 4, 4,
- 4, 4, nil, 4, 5, nil, 5, 34, nil, nil,
- 22, nil, 21, 23, nil, 22, nil, 5, 5, 5,
- 5, 5, nil, 5, nil, nil, nil, nil, 36, nil,
- nil, nil, 36, nil, nil, 24, 36, 36, nil, 6,
- 24, 6, nil, nil, nil, nil, 22, 7, nil, 7,
- nil, nil, 6, 6, 6, 6, 6, 8, 6, 8,
- 7, 7, 7, 7, 7, 11, 7, 11, nil, nil,
- 8, 8, 8, 8, 8, nil, 8, nil, 11, 11,
- 11, 11, 11, nil, 11 ]
+ 22, 24, 21, 23, 36, 36, 37, 18, 16, 34,
+ 35, 41, 36, 20, 19, 17, 25, 25, 28, 32,
+ 29, 23, 24, 1, 23, 24, 28, 34, 13, 15,
+ 34, 14, 38, 17, 20, 19, 1, 1, 1, 1,
+ 1, 33, 1, 35, 39, 3, 33, 35, 42, nil,
+ 41, nil, 35, 22, 8, 35, 8, nil, nil, nil,
+ nil, 16, nil, 18, 37, nil, nil, 8, 8, 8,
+ 8, 8, nil, 8, 4, nil, 4, 23, nil, nil,
+ 22, nil, 21, 34, nil, 22, nil, 4, 4, 4,
+ 4, 4, nil, 4, nil, nil, nil, nil, 36, nil,
+ nil, nil, 36, nil, nil, 24, 36, 36, nil, 5,
+ 24, 5, nil, nil, nil, nil, 22, 6, nil, 6,
+ nil, nil, 5, 5, 5, 5, 5, 11, 5, 11,
+ 6, 6, 6, 6, 6, 7, 6, 7, nil, nil,
+ 11, 11, 11, 11, 11, nil, 11, nil, 7, 7,
+ 7, 7, 7, nil, 7 ]
racc_goto_pointer = [
- nil, 23, nil, 29, 54, 74, 109, 117, 127, nil,
- nil, 135, nil, 2, -17, 30, -30, -3, -29, -4,
- -5, -40, -42, -9, -17, -28, nil, nil, -120, -83,
- nil, nil, -7, -101, -15, -116, -40, -91, 8, 2,
- nil, -9, -29 ]
+ nil, 23, nil, 43, 74, 109, 117, 135, 54, nil,
+ nil, 127, nil, 10, -5, 11, -30, -3, -29, -4,
+ -5, -40, -42, -15, -17, -28, nil, nil, -120, -107,
+ nil, nil, -33, -101, -9, -116, -40, -91, 12, 17,
+ nil, -9, -13 ]
racc_goto_default = [
nil, nil, 2, 3, 46, 47, 48, 49, 50, 9,
diff --git a/lib/rdoc/rdoc.gemspec b/lib/rdoc/rdoc.gemspec
deleted file mode 100644
index 8c92908a66..0000000000
--- a/lib/rdoc/rdoc.gemspec
+++ /dev/null
@@ -1,63 +0,0 @@
-begin
- require_relative "lib/rdoc"
-rescue LoadError
- # for Ruby repository
- require_relative "../rdoc"
-end
-
-Gem::Specification.new do |s|
- s.name = "rdoc"
- s.version = RDoc::VERSION
- s.date = "2017-12-24"
-
- s.authors = [
- "Eric Hodel",
- "Dave Thomas",
- "Phil Hagelberg",
- "Tony Strauss",
- "Zachary Scott",
- "Hiroshi SHIBATA",
- "ITOYANAGI Sakura"
- ]
- s.email = ["drbrain@segment7.net", "", "", "", "mail@zzak.io", "hsbt@ruby-lang.org", "aycabta@gmail.com"]
-
- s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"
- s.description = <<-DESCRIPTION
-RDoc produces HTML and command-line documentation for Ruby projects.
-RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
- DESCRIPTION
- s.homepage = "https://ruby.github.io/rdoc"
- s.licenses = ["Ruby"]
-
- s.bindir = "exe"
- s.executables = ["rdoc", "ri"]
- s.require_paths = ["lib"]
- # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- s.files = [".document", ".gitignore", ".travis.yml", "CONTRIBUTING.rdoc", "CVE-2013-0256.rdoc", "ExampleMarkdown.md", "ExampleRDoc.rdoc", "Gemfile", "History.rdoc", "LEGAL.rdoc", "LICENSE.rdoc", "README.rdoc", "RI.rdoc", "Rakefile", "TODO.rdoc", "appveyor.yml", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "lib/rdoc.rb", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/code_object.rb", "lib/rdoc/code_objects.rb", "lib/rdoc/comment.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/cross_reference.rb", "lib/rdoc/encoding.rb", "lib/rdoc/erb_partial.rb", "lib/rdoc/erbio.rb", "lib/rdoc/extend.rb", "lib/rdoc/generator.rb", "lib/rdoc/generator/darkfish.rb", "lib/rdoc/generator/json_index.rb", "lib/rdoc/generator/markup.rb", "lib/rdoc/generator/pot.rb", "lib/rdoc/generator/pot/message_extractor.rb", "lib/rdoc/generator/pot/po.rb", "lib/rdoc/generator/pot/po_entry.rb", "lib/rdoc/generator/ri.rb", "lib/rdoc/generator/template/darkfish/.document", "lib/rdoc/generator/template/darkfish/_footer.rhtml", "lib/rdoc/generator/template/darkfish/_head.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml", "lib/rdoc/generator/template/darkfish/class.rhtml", "lib/rdoc/generator/template/darkfish/css/fonts.css", "lib/rdoc/generator/template/darkfish/css/rdoc.css", "lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf", "lib/rdoc/generator/template/darkfish/images/add.png", "lib/rdoc/generator/template/darkfish/images/arrow_up.png", "lib/rdoc/generator/template/darkfish/images/brick.png", "lib/rdoc/generator/template/darkfish/images/brick_link.png", "lib/rdoc/generator/template/darkfish/images/bug.png", "lib/rdoc/generator/template/darkfish/images/bullet_black.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png", "lib/rdoc/generator/template/darkfish/images/date.png", "lib/rdoc/generator/template/darkfish/images/delete.png", "lib/rdoc/generator/template/darkfish/images/find.png", "lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif", "lib/rdoc/generator/template/darkfish/images/macFFBgHack.png", "lib/rdoc/generator/template/darkfish/images/package.png", "lib/rdoc/generator/template/darkfish/images/page_green.png", "lib/rdoc/generator/template/darkfish/images/page_white_text.png", "lib/rdoc/generator/template/darkfish/images/page_white_width.png", "lib/rdoc/generator/template/darkfish/images/plugin.png", "lib/rdoc/generator/template/darkfish/images/ruby.png", "lib/rdoc/generator/template/darkfish/images/tag_blue.png", "lib/rdoc/generator/template/darkfish/images/tag_green.png", "lib/rdoc/generator/template/darkfish/images/transparent.png", "lib/rdoc/generator/template/darkfish/images/wrench.png", "lib/rdoc/generator/template/darkfish/images/wrench_orange.png", "lib/rdoc/generator/template/darkfish/images/zoom.png", "lib/rdoc/generator/template/darkfish/index.rhtml", "lib/rdoc/generator/template/darkfish/js/darkfish.js", "lib/rdoc/generator/template/darkfish/js/jquery.js", "lib/rdoc/generator/template/darkfish/js/search.js", "lib/rdoc/generator/template/darkfish/page.rhtml", "lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml", "lib/rdoc/generator/template/darkfish/servlet_root.rhtml", "lib/rdoc/generator/template/darkfish/table_of_contents.rhtml", "lib/rdoc/generator/template/json_index/.document", "lib/rdoc/generator/template/json_index/js/navigation.js", "lib/rdoc/generator/template/json_index/js/searcher.js", "lib/rdoc/ghost_method.rb", "lib/rdoc/i18n.rb", "lib/rdoc/i18n/locale.rb", "lib/rdoc/i18n/text.rb", "lib/rdoc/include.rb", "lib/rdoc/known_classes.rb", "lib/rdoc/markdown.kpeg", "lib/rdoc/markdown/entities.rb", "lib/rdoc/markdown/literals.kpeg", "lib/rdoc/markup.rb", "lib/rdoc/markup/attr_changer.rb", "lib/rdoc/markup/attr_span.rb", "lib/rdoc/markup/attribute_manager.rb", "lib/rdoc/markup/attributes.rb", "lib/rdoc/markup/blank_line.rb", "lib/rdoc/markup/block_quote.rb", "lib/rdoc/markup/document.rb", "lib/rdoc/markup/formatter.rb", "lib/rdoc/markup/formatter_test_case.rb", "lib/rdoc/markup/hard_break.rb", "lib/rdoc/markup/heading.rb", "lib/rdoc/markup/include.rb", "lib/rdoc/markup/indented_paragraph.rb", "lib/rdoc/markup/inline.rb", "lib/rdoc/markup/list.rb", "lib/rdoc/markup/list_item.rb", "lib/rdoc/markup/paragraph.rb", "lib/rdoc/markup/parser.rb", "lib/rdoc/markup/pre_process.rb", "lib/rdoc/markup/raw.rb", "lib/rdoc/markup/rule.rb", "lib/rdoc/markup/special.rb", "lib/rdoc/markup/text_formatter_test_case.rb", "lib/rdoc/markup/to_ansi.rb", "lib/rdoc/markup/to_bs.rb", "lib/rdoc/markup/to_html.rb", "lib/rdoc/markup/to_html_crossref.rb", "lib/rdoc/markup/to_html_snippet.rb", "lib/rdoc/markup/to_joined_paragraph.rb", "lib/rdoc/markup/to_label.rb", "lib/rdoc/markup/to_markdown.rb", "lib/rdoc/markup/to_rdoc.rb", "lib/rdoc/markup/to_table_of_contents.rb", "lib/rdoc/markup/to_test.rb", "lib/rdoc/markup/to_tt_only.rb", "lib/rdoc/markup/verbatim.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/options.rb", "lib/rdoc/parser.rb", "lib/rdoc/parser/c.rb", "lib/rdoc/parser/changelog.rb", "lib/rdoc/parser/markdown.rb", "lib/rdoc/parser/rd.rb", "lib/rdoc/parser/ripper_state_lex.rb", "lib/rdoc/parser/ruby.rb", "lib/rdoc/parser/ruby_tools.rb", "lib/rdoc/parser/simple.rb", "lib/rdoc/parser/text.rb", "lib/rdoc/rd.rb", "lib/rdoc/rd/block_parser.ry", "lib/rdoc/rd/inline.rb", "lib/rdoc/rd/inline_parser.ry", "lib/rdoc/rdoc.rb", "lib/rdoc/require.rb", "lib/rdoc/ri.rb", "lib/rdoc/ri/driver.rb", "lib/rdoc/ri/formatter.rb", "lib/rdoc/ri/paths.rb", "lib/rdoc/ri/store.rb", "lib/rdoc/ri/task.rb", "lib/rdoc/rubygems_hook.rb", "lib/rdoc/servlet.rb", "lib/rdoc/single_class.rb", "lib/rdoc/stats.rb", "lib/rdoc/stats/normal.rb", "lib/rdoc/stats/quiet.rb", "lib/rdoc/stats/verbose.rb", "lib/rdoc/store.rb", "lib/rdoc/task.rb", "lib/rdoc/test_case.rb", "lib/rdoc/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
- # files from .gitignore
- s.files << "lib/rdoc/rd/block_parser.rb" << "lib/rdoc/rd/inline_parser.rb" << "lib/rdoc/markdown.rb" << "lib/rdoc/markdown/literals.rb"
-
- s.rdoc_options = ["--main", "README.rdoc"]
- s.extra_rdoc_files += %w[
- CVE-2013-0256.rdoc
- CONTRIBUTING.rdoc
- ExampleMarkdown.md
- ExampleRDoc.rdoc
- History.rdoc
- LEGAL.rdoc
- LICENSE.rdoc
- README.rdoc
- RI.rdoc
- TODO.rdoc
- ]
-
- s.required_ruby_version = Gem::Requirement.new(">= 2.2.2")
- s.rubygems_version = "2.5.2"
- s.required_rubygems_version = Gem::Requirement.new(">= 2.2")
-
- s.add_development_dependency("rake")
- s.add_development_dependency("racc", "> 1.4.10")
- s.add_development_dependency("kpeg")
- s.add_development_dependency("minitest", "~> 4")
- s.add_development_dependency("json")
-end
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index 68775c8be1..4d45d47978 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rdoc'
require 'find'
@@ -161,9 +160,15 @@ class RDoc::RDoc
RDoc.load_yaml
+ parse_error = if Object.const_defined? :Psych then
+ Psych::SyntaxError
+ else
+ ArgumentError
+ end
+
begin
options = YAML.load_file '.rdoc_options'
- rescue Psych::SyntaxError
+ rescue *parse_error
end
raise RDoc::Error, "#{options_file} is not a valid rdoc options file" unless
@@ -334,8 +339,10 @@ option)
# Parses +filename+ and returns an RDoc::TopLevel
def parse_file filename
- encoding = @options.encoding
- filename = filename.encode encoding
+ if Object.const_defined? :Encoding then
+ encoding = @options.encoding
+ filename = filename.encode encoding
+ end
@stats.add_file filename
@@ -346,11 +353,7 @@ option)
return unless content
filename_path = Pathname(filename).expand_path
- begin
- relative_path = filename_path.relative_path_from @options.root
- rescue ArgumentError
- relative_path = filename_path
- end
+ relative_path = filename_path.relative_path_from @options.root
if @options.page_dir and
relative_path.to_s.start_with? @options.page_dir.to_s then
@@ -411,7 +414,6 @@ The internal error was:
return [] if file_list.empty?
- original_options = @options.dup
@stats.begin_adding
file_info = file_list.map do |filename|
@@ -420,7 +422,6 @@ The internal error was:
end.compact
@stats.done_adding
- @options = original_options
file_info
end
@@ -431,7 +432,7 @@ The internal error was:
def remove_unparseable files
files.reject do |file|
- file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
+ file =~ /\.(?:class|eps|erb|scpt\.txt|ttf|yml)$/i or
(file =~ /tags$/i and
open(file, 'rb') { |io|
io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/
@@ -475,7 +476,7 @@ The internal error was:
@last_modified = setup_output_dir @options.op_dir, @options.force_update
end
- @store.encoding = @options.encoding
+ @store.encoding = @options.encoding if @options.respond_to? :encoding
@store.dry_run = @options.dry_run
@store.main = @options.main_page
@store.title = @options.title
@@ -521,18 +522,13 @@ The internal error was:
# by the RDoc options
def generate
- if @options.dry_run then
- # do nothing
- @generator.generate
- else
- Dir.chdir @options.op_dir do
- unless @options.quiet then
- $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
- end
-
- @generator.generate
- update_output_dir '.', @start_time, @last_modified
+ Dir.chdir @options.op_dir do
+ unless @options.quiet then
+ $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
end
+
+ @generator.generate
+ update_output_dir '.', @start_time, @last_modified
end
end
@@ -552,14 +548,16 @@ end
begin
require 'rubygems'
- rdoc_extensions = Gem.find_files 'rdoc/discover'
+ if Gem.respond_to? :find_files then
+ rdoc_extensions = Gem.find_files 'rdoc/discover'
- rdoc_extensions.each do |extension|
- begin
- load extension
- rescue => e
- warn "error loading #{extension.inspect}: #{e.message} (#{e.class})"
- warn "\t#{e.backtrace.join "\n\t"}" if $DEBUG
+ rdoc_extensions.each do |extension|
+ begin
+ load extension
+ rescue => e
+ warn "error loading #{extension.inspect}: #{e.message} (#{e.class})"
+ warn "\t#{e.backtrace.join "\n\t"}" if $DEBUG
+ end
end
end
rescue LoadError
@@ -569,3 +567,4 @@ end
require 'rdoc/generator/darkfish'
require 'rdoc/generator/ri'
require 'rdoc/generator/pot'
+
diff --git a/lib/rdoc/require.rb b/lib/rdoc/require.rb
index 91f9c24e5d..a3d4bd18c0 100644
--- a/lib/rdoc/require.rb
+++ b/lib/rdoc/require.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A file loaded by \#require
diff --git a/lib/rdoc/ri.rb b/lib/rdoc/ri.rb
index c798c1fc49..8b35e0fa2f 100644
--- a/lib/rdoc/ri.rb
+++ b/lib/rdoc/ri.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rdoc'
##
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index fa0e040a42..39064c1384 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'abbrev'
require 'optparse'
@@ -47,24 +46,13 @@ class RDoc::RI::Driver
class NotFoundError < Error
- def initialize(klass, suggestions = nil) # :nodoc:
- @klass = klass
- @suggestions = suggestions
- end
-
##
# Name that wasn't found
- def name
- @klass
- end
+ alias name message
def message # :nodoc:
- str = "Nothing known about #{@klass}"
- if @suggestions and !@suggestions.empty?
- str += "\nDid you mean? #{@suggestions.join("\n ")}"
- end
- str
+ "Nothing known about #{super}"
end
end
@@ -91,6 +79,7 @@ class RDoc::RI::Driver
options[:interactive] = false
options[:profile] = false
options[:show_all] = false
+ options[:use_cache] = true
options[:use_stdout] = !$stdout.tty?
options[:width] = 72
@@ -132,7 +121,7 @@ class RDoc::RI::Driver
opt.summary_indent = ' ' * 4
opt.banner = <<-EOT
-Usage: #{opt.program_name} [options] [name ...]
+Usage: #{opt.program_name} [options] [names...]
Where name can be:
@@ -142,8 +131,8 @@ Where name can be:
gem_name: | gem_name:README | gem_name:History
-All class names may be abbreviated to their minimum unambiguous form.
-If a name is ambiguous, all valid options will be listed.
+All class names may be abbreviated to their minimum unambiguous form. If a name
+is ambiguous, all valid options will be listed.
A '.' matches either class or instance methods, while #method
matches only instance and ::method matches only class methods.
@@ -161,23 +150,23 @@ For example:
#{opt.program_name} zip
#{opt.program_name} rdoc:README
-Note that shell quoting or escaping may be required for method names
-containing punctuation:
+Note that shell quoting or escaping may be required for method names containing
+punctuation:
#{opt.program_name} 'Array.[]'
#{opt.program_name} compact\\!
-To see the default directories #{opt.program_name} will search, run:
+To see the default directories ri will search, run:
#{opt.program_name} --list-doc-dirs
-Specifying the --system, --site, --home, --gems, or --doc-dir options
-will limit ri to searching only the specified directories.
+Specifying the --system, --site, --home, --gems or --doc-dir options will
+limit ri to searching only the specified directories.
-ri options may be set in the RI environment variable.
+ri options may be set in the 'RI' environment variable.
-The ri pager can be set with the RI_PAGER environment variable
-or the PAGER environment variable.
+The ri pager can be set with the 'RI_PAGER' environment variable or the
+'PAGER' environment variable.
EOT
opt.separator nil
@@ -209,15 +198,15 @@ or the PAGER environment variable.
opt.separator nil
opt.on("--[no-]pager",
- "Send output to a pager,",
- "rather than directly to stdout.") do |use_pager|
+ "Send output directly to stdout,",
+ "rather than to a pager.") do |use_pager|
options[:use_stdout] = !use_pager
end
opt.separator nil
opt.on("-T",
- "Synonym for --no-pager.") do
+ "Synonym for --no-pager") do
options[:use_stdout] = true
end
@@ -230,7 +219,7 @@ or the PAGER environment variable.
opt.separator nil
- opt.on("--server[=PORT]", Integer,
+ opt.on("--server [PORT]", Integer,
"Run RDoc server on the given port.",
"The default port is 8214.") do |port|
options[:server] = port || 8214
@@ -245,30 +234,14 @@ or the PAGER environment variable.
formatters -= %w[html label test] # remove useless output formats
opt.on("--format=NAME", "-f",
- "Use the selected formatter. The default",
+ "Uses the selected formatter. The default",
"formatter is bs for paged output and ansi",
- "otherwise. Valid formatters are:",
- "#{formatters.join(', ')}.", formatters) do |value|
+ "otherwise. Valid formatters are:",
+ formatters.join(' '), formatters) do |value|
options[:formatter] = RDoc::Markup.const_get "To#{value.capitalize}"
end
opt.separator nil
-
- opt.on("--help", "-h",
- "Show help and exit.") do
- puts opts
- exit
- end
-
- opt.separator nil
-
- opt.on("--version", "-v",
- "Output version information and exit.") do
- puts "#{opts.program_name} #{opts.version}"
- exit
- end
-
- opt.separator nil
opt.separator "Data source options:"
opt.separator nil
@@ -299,7 +272,7 @@ or the PAGER environment variable.
"Do not include documentation from",
"the Ruby standard library, site_lib,",
"installed gems, or ~/.rdoc.",
- "Use with --doc-dir.") do
+ "Use with --doc-dir") do
options[:use_system] = false
options[:use_site] = false
options[:use_gems] = false
@@ -309,8 +282,8 @@ or the PAGER environment variable.
opt.separator nil
opt.on("--[no-]system",
- "Include documentation from Ruby's",
- "standard library. Defaults to true.") do |value|
+ "Include documentation from Ruby's standard",
+ "library. Defaults to true.") do |value|
options[:use_system] = value
end
@@ -344,14 +317,14 @@ or the PAGER environment variable.
opt.separator nil
opt.on("--[no-]profile",
- "Run with the ruby profiler.") do |value|
+ "Run with the ruby profiler") do |value|
options[:profile] = value
end
opt.separator nil
opt.on("--dump=CACHE", File,
- "Dump data from an ri cache or data file.") do |value|
+ "Dumps data from an ri cache or data file") do |value|
options[:dump_path] = value
end
end
@@ -928,39 +901,27 @@ or the PAGER environment variable.
display out
end
- def check_did_you_mean # :nodoc:
- if defined? DidYouMean::SpellChecker
- true
- else
- begin
- require 'did_you_mean'
- if defined? DidYouMean::SpellChecker
- true
- else
- false
- end
- rescue LoadError
- false
- end
- end
- end
-
##
# Expands abbreviated klass +klass+ into a fully-qualified class. "Zl::Da"
# will be expanded to Zlib::DataError.
def expand_class klass
- class_names = classes.keys
- ary = class_names.grep(Regexp.new("\\A#{klass.gsub(/(?=::|\z)/, '[^:]*')}\\z"))
- if ary.length != 1 && ary.first != klass
- if check_did_you_mean
- suggestions = DidYouMean::SpellChecker.new(dictionary: class_names).correct(klass)
- raise NotFoundError.new(klass, suggestions)
- else
- raise NotFoundError, klass
+ klass.split('::').inject '' do |expanded, klass_part|
+ expanded << '::' unless expanded.empty?
+ short = expanded << klass_part
+
+ subset = classes.keys.select do |klass_name|
+ klass_name =~ /^#{expanded}[^:]*$/
end
+
+ abbrevs = Abbrev.abbrev subset
+
+ expanded = abbrevs[short]
+
+ raise NotFoundError, short unless expanded
+
+ expanded.dup
end
- ary.first
end
##
@@ -1127,8 +1088,10 @@ or the PAGER environment variable.
return if name.nil? or name.empty?
+ name = expand_name name.strip
+
begin
- display_name expand_name(name.strip)
+ display_name name
rescue NotFoundError => e
puts e.message
end
@@ -1271,21 +1234,7 @@ or the PAGER environment variable.
def lookup_method name
found = load_methods_matching name
- if found.empty?
- if check_did_you_mean
- methods = []
- _, _, method_name = parse_name name
- find_methods name do |store, klass, ancestor, types, method|
- methods.push(*store.class_methods[klass]) if [:class, :both].include? types
- methods.push(*store.instance_methods[klass]) if [:instance, :both].include? types
- end
- methods = methods.uniq
- suggestions = DidYouMean::SpellChecker.new(dictionary: methods).correct(method_name)
- raise NotFoundError.new(name, suggestions)
- else
- raise NotFoundError, name
- end
- end
+ raise NotFoundError, name if found.empty?
filter_methods found, name
end
@@ -1493,7 +1442,7 @@ or the PAGER environment variable.
def setup_pager
return if @use_stdout
- jruby = RUBY_ENGINE == 'jruby'
+ jruby = Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']
@@ -1545,3 +1494,4 @@ or the PAGER environment variable.
end
end
+
diff --git a/lib/rdoc/ri/formatter.rb b/lib/rdoc/ri/formatter.rb
index 832a101e6c..84d37a9d31 100644
--- a/lib/rdoc/ri/formatter.rb
+++ b/lib/rdoc/ri/formatter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# For RubyGems backwards compatibility
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
index d41e610591..970cb91461 100644
--- a/lib/rdoc/ri/paths.rb
+++ b/lib/rdoc/ri/paths.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rdoc/ri'
##
@@ -82,6 +81,8 @@ module RDoc::RI::Paths
# ri documentation.
def self.gemdirs filter = :latest
+ require 'rubygems' unless defined?(Gem)
+
ri_paths = {}
all = Gem::Specification.map do |spec|
@@ -183,3 +184,4 @@ module RDoc::RI::Paths
end
end
+
diff --git a/lib/rdoc/ri/store.rb b/lib/rdoc/ri/store.rb
index 9f4b03734a..9fa9bbb03c 100644
--- a/lib/rdoc/ri/store.rb
+++ b/lib/rdoc/ri/store.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module RDoc::RI
Store = RDoc::Store # :nodoc:
diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb
deleted file mode 100644
index 6a6ea572bf..0000000000
--- a/lib/rdoc/ri/task.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-begin
- gem 'rdoc'
-rescue Gem::LoadError
-end unless defined?(RDoc)
-
-require 'rdoc/task'
-
-##
-# RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
-#
-# It contains the following tasks:
-#
-# [ri]
-# Build ri data
-#
-# [clobber_ri]
-# Delete ri data files. This target is automatically added to the main
-# clobber target.
-#
-# [reri]
-# Rebuild the ri data from scratch even if they are not out of date.
-#
-# Simple example:
-#
-# require 'rdoc/ri/task'
-#
-# RDoc::RI::Task.new do |ri|
-# ri.main = 'README.rdoc'
-# ri.rdoc_files.include 'README.rdoc', 'lib/**/*.rb'
-# end
-#
-# For further configuration details see RDoc::Task.
-
-class RDoc::RI::Task < RDoc::Task
-
- DEFAULT_NAMES = { # :nodoc:
- :clobber_rdoc => :clobber_ri,
- :rdoc => :ri,
- :rerdoc => :reri,
- }
-
- ##
- # Create an ri task with the given name. See RDoc::Task for documentation on
- # setting names.
-
- def initialize name = DEFAULT_NAMES # :yield: self
- super
- end
-
- def clobber_task_description # :nodoc:
- "Remove RI data files"
- end
-
- ##
- # Sets default task values
-
- def defaults
- super
-
- @rdoc_dir = '.rdoc'
- end
-
- def rdoc_task_description # :nodoc:
- 'Build RI data files'
- end
-
- def rerdoc_task_description # :nodoc:
- 'Rebuild RI data files'
- end
-end
diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb
new file mode 100644
index 0000000000..91b90ab2cf
--- /dev/null
+++ b/lib/rdoc/ruby_lex.rb
@@ -0,0 +1,1377 @@
+# coding: US-ASCII
+
+#--
+# irb/ruby-lex.rb - ruby lexcal analyzer
+# $Release Version: 0.9.5$
+# $Revision: 17979 $
+# $Date: 2008-07-09 10:17:05 -0700 (Wed, 09 Jul 2008) $
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#
+#++
+
+require "e2mmap"
+require "irb/slex"
+require "stringio"
+
+##
+# Ruby lexer adapted from irb.
+#
+# The internals are not documented because they are scary.
+
+class RDoc::RubyLex
+
+ ##
+ # Raised upon invalid input
+
+ class Error < RDoc::Error
+ end
+
+ # :stopdoc:
+
+ 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')")
+ def_exception(:SyntaxError, "%s")
+
+ def_exception(:TerminateLineInput, "Terminate Line Input")
+
+ include RDoc::RubyToken
+ include IRB
+
+ attr_accessor :continue
+ attr_accessor :lex_state
+ attr_reader :reader
+
+ class << self
+ attr_accessor :debug_level
+ end
+
+ def self.debug?
+ @debug_level > 0
+ end
+
+ self.debug_level = 0
+
+ # :startdoc:
+
+ ##
+ # Returns an Array of +ruby+ tokens. See ::new for a description of
+ # +options+.
+
+ def self.tokenize ruby, options
+ tokens = []
+
+ scanner = RDoc::RubyLex.new ruby, options
+ scanner.exception_on_syntax_error = true
+
+ while token = scanner.token do
+ tokens << token
+ end
+
+ tokens
+ end
+
+ ##
+ # Creates a new lexer for +content+. +options+ is an RDoc::Options, only
+ # +tab_width is used.
+
+ def initialize(content, options)
+ lex_init
+
+ if /\t/ =~ content then
+ tab_width = options.tab_width
+ content = content.split(/\n/).map do |line|
+ 1 while line.gsub!(/\t+/) {
+ ' ' * (tab_width*$&.length - $`.length % tab_width)
+ } && $~
+ line
+ end.join("\n")
+ end
+
+ content << "\n" unless content[-1, 1] == "\n"
+
+ set_input StringIO.new content
+
+ @base_char_no = 0
+ @char_no = 0
+ @exp_line_no = @line_no = 1
+ @here_readed = []
+ @readed = []
+ @rests = []
+ @seek = 0
+
+ @here_header = false
+ @indent = 0
+ @indent_stack = []
+ @lex_state = :EXPR_BEG
+ @space_seen = false
+
+ @continue = false
+ @line = ""
+
+ @skip_space = false
+ @readed_auto_clean_up = false
+ @exception_on_syntax_error = true
+
+ @prompt = nil
+ @prev_seek = nil
+ @ltype = nil
+ end
+
+ # :stopdoc:
+
+ def inspect # :nodoc:
+ "#<%s:0x%x pos %d lex_state %p space_seen %p>" % [
+ self.class, object_id,
+ @io.pos, @lex_state, @space_seen,
+ ]
+ end
+
+ attr_accessor :skip_space
+ attr_accessor :readed_auto_clean_up
+ attr_accessor :exception_on_syntax_error
+
+ attr_reader :seek
+ attr_reader :char_no
+ attr_reader :line_no
+ attr_reader :indent
+
+ # io functions
+ def set_input(io, p = nil, &block)
+ @io = io
+ if p.respond_to?(:call)
+ @input = p
+ elsif block_given?
+ @input = block
+ else
+ @input = Proc.new{@io.gets}
+ end
+ end
+
+ def get_readed
+ if idx = @readed.rindex("\n")
+ @base_char_no = @readed.size - (idx + 1)
+ else
+ @base_char_no += @readed.size
+ end
+
+ readed = @readed.join("")
+ @readed = []
+ readed
+ end
+
+ def getc
+ while @rests.empty?
+ # return nil unless buf_input
+ @rests.push nil unless buf_input
+ end
+ c = @rests.shift
+ if @here_header
+ @here_readed.push c
+ else
+ @readed.push c
+ end
+ @seek += 1
+ if c == "\n"
+ @line_no += 1
+ @char_no = 0
+ else
+ @char_no += 1
+ end
+
+ c
+ end
+
+ def gets
+ l = ""
+ while c = getc
+ l.concat(c)
+ break if c == "\n"
+ end
+ return nil if l == "" and c.nil?
+ l
+ end
+
+ def eof?
+ @io.eof?
+ end
+
+ def getc_of_rests
+ if @rests.empty?
+ nil
+ else
+ getc
+ end
+ end
+
+ def ungetc(c = nil)
+ if @here_readed.empty?
+ c2 = @readed.pop
+ else
+ c2 = @here_readed.pop
+ end
+ c = c2 unless c
+ @rests.unshift c #c =
+ @seek -= 1
+ if c == "\n"
+ @line_no -= 1
+ if idx = @readed.rindex("\n")
+ @char_no = idx + 1
+ else
+ @char_no = @base_char_no + @readed.size
+ end
+ else
+ @char_no -= 1
+ end
+ end
+
+ def peek_equal?(str)
+ chrs = str.split(//)
+ until @rests.size >= chrs.size
+ return false unless buf_input
+ end
+ @rests[0, chrs.size] == chrs
+ end
+
+ def peek_match?(regexp)
+ while @rests.empty?
+ return false unless buf_input
+ end
+ regexp =~ @rests.join("")
+ end
+
+ def peek(i = 0)
+ while @rests.size <= i
+ return nil unless buf_input
+ end
+ @rests[i]
+ end
+
+ def buf_input
+ prompt
+ line = @input.call
+ return nil unless line
+ @rests.concat line.split(//)
+ true
+ end
+ private :buf_input
+
+ def set_prompt(p = nil, &block)
+ p = block if block_given?
+ if p.respond_to?(:call)
+ @prompt = p
+ else
+ @prompt = Proc.new{print p}
+ end
+ end
+
+ def prompt
+ if @prompt
+ @prompt.call(@ltype, @indent, @continue, @line_no)
+ end
+ end
+
+ def initialize_input
+ @ltype = nil
+ @quoted = nil
+ @indent = 0
+ @indent_stack = []
+ @lex_state = :EXPR_BEG
+ @space_seen = false
+ @here_header = false
+
+ @continue = false
+ prompt
+
+ @line = ""
+ @exp_line_no = @line_no
+ end
+
+ def each_top_level_statement
+ initialize_input
+ catch(:TERM_INPUT) do
+ loop do
+ begin
+ @continue = false
+ prompt
+ unless l = lex
+ throw :TERM_INPUT if @line == ''
+ else
+ #p l
+ @line.concat l
+ if @ltype or @continue or @indent > 0
+ next
+ end
+ end
+ if @line != "\n"
+ 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
+ end
+ line = get_readed
+ # print self.inspect
+ if line == "" and tk.kind_of?(TkEND_OF_SCRIPT) || tk.nil?
+ nil
+ else
+ line
+ end
+ 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)
+ rescue SyntaxError => e
+ raise Error, "syntax error: #{e.message}" 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"
+ ]
+
+ DEINDENT_CLAUSE = ["end" #, "when"
+ ]
+
+ PERCENT_LTYPE = {
+ "q" => "\'",
+ "Q" => "\"",
+ "x" => "\`",
+ "r" => "/",
+ "w" => "]",
+ "W" => "]",
+ "s" => ":"
+ }
+
+ PERCENT_PAREN = {
+ "{" => "}",
+ "[" => "]",
+ "<" => ">",
+ "(" => ")"
+ }
+
+ PERCENT_PAREN_REV = PERCENT_PAREN.invert
+
+ Ltype2Token = {
+ "\'" => TkSTRING,
+ "\"" => TkSTRING,
+ "\`" => TkXSTRING,
+ "/" => TkREGEXP,
+ "]" => TkDSTRING,
+ ":" => TkSYMBOL
+ }
+ DLtype2Token = {
+ "\"" => TkDSTRING,
+ "\`" => TkDXSTRING,
+ "/" => TkDREGEXP,
+ }
+
+ def lex_init()
+ @OP = IRB::SLex.new
+ @OP.def_rules("\0", "\004", "\032") do |op, io|
+ Token(TkEND_OF_SCRIPT, '')
+ end
+
+ @OP.def_rules(" ", "\t", "\f", "\r", "\13") do |op, io|
+ @space_seen = true
+ str = op
+ while (ch = getc) =~ /[ \t\f\r\13]/ do
+ str << ch
+ end
+ ungetc
+ Token TkSPACE, str
+ end
+
+ @OP.def_rule("#") do |op, io|
+ identify_comment
+ end
+
+ @OP.def_rule("=begin",
+ proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
+ |op, io|
+ @ltype = "="
+ res = ''
+ nil until getc == "\n"
+
+ until ( peek_equal?("=end") && peek(4) =~ /\s/ ) do
+ (ch = getc)
+ res << ch
+ end
+
+ gets # consume =end
+
+ @ltype = nil
+ Token(TkRD_COMMENT, res)
+ end
+
+ @OP.def_rule("\n") do |op, io|
+ print "\\n\n" if RDoc::RubyLex.debug?
+ case @lex_state
+ when :EXPR_BEG, :EXPR_FNAME, :EXPR_DOT
+ @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
+ end
+ @here_header = false
+ @here_readed = []
+ Token(TkNL)
+ end
+
+ @OP.def_rules("*", "**",
+ "=", "==", "===",
+ "=~", "<=>",
+ "<", "<=",
+ ">", ">=", ">>") do
+ |op, io|
+ case @lex_state
+ when :EXPR_FNAME, :EXPR_DOT
+ @lex_state = :EXPR_ARG
+ else
+ @lex_state = :EXPR_BEG
+ end
+ Token(op)
+ end
+
+ @OP.def_rules("!", "!=", "!~") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token(op)
+ end
+
+ @OP.def_rules("<<") do
+ |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
+ end
+ unless tk
+ tk = Token(op)
+ case @lex_state
+ when :EXPR_FNAME, :EXPR_DOT
+ @lex_state = :EXPR_ARG
+ else
+ @lex_state = :EXPR_BEG
+ end
+ end
+ tk
+ end
+
+ @OP.def_rules("'", '"') do
+ |op, io|
+ identify_string(op)
+ end
+
+ @OP.def_rules("`") do
+ |op, io|
+ if @lex_state == :EXPR_FNAME
+ @lex_state = :EXPR_END
+ Token(op)
+ else
+ identify_string(op)
+ end
+ end
+
+ @OP.def_rules('?') do
+ |op, io|
+ if @lex_state == :EXPR_END
+ @lex_state = :EXPR_BEG
+ Token(TkQUESTION)
+ else
+ ch = getc
+ if @lex_state == :EXPR_ARG && ch =~ /\s/
+ ungetc
+ @lex_state = :EXPR_BEG;
+ Token(TkQUESTION)
+ else
+ @lex_state = :EXPR_END
+ Token(TkCHAR, "?#{ch}")
+ end
+ end
+ end
+
+ @OP.def_rules("&", "&&", "|", "||") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token(op)
+ end
+
+ @OP.def_rules("+=", "-=", "*=", "**=",
+ "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ op =~ /^(.*)=$/
+ Token(TkOPASGN, $1)
+ end
+
+ @OP.def_rule("+@", proc{|op, io| @lex_state == :EXPR_FNAME}) do
+ |op, io|
+ @lex_state = :EXPR_ARG
+ Token(op)
+ end
+
+ @OP.def_rule("-@", proc{|op, io| @lex_state == :EXPR_FNAME}) do
+ |op, io|
+ @lex_state = :EXPR_ARG
+ Token(op)
+ end
+
+ @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(op)
+ else
+ @lex_state = :EXPR_BEG
+ end
+ elsif @lex_state != :EXPR_END and peek(0) =~ /[0-9]/
+ throw :RET, identify_number(op)
+ else
+ @lex_state = :EXPR_BEG
+ end
+ Token(op)
+ end
+ end
+
+ @OP.def_rule(".") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ if peek(0) =~ /[0-9]/
+ ungetc
+ identify_number
+ else
+ # for "obj.if" etc.
+ @lex_state = :EXPR_DOT
+ Token(TkDOT)
+ end
+ end
+
+ @OP.def_rules("..", "...") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token(op)
+ end
+
+ lex_int2
+ end
+
+ def lex_int2
+ @OP.def_rules("]", "}", ")") do
+ |op, io|
+ @lex_state = :EXPR_END
+ @indent -= 1
+ @indent_stack.pop
+ Token(op)
+ end
+
+ @OP.def_rule(":") do
+ |op, io|
+ if @lex_state == :EXPR_END || peek(0) =~ /\s/
+ @lex_state = :EXPR_BEG
+ Token(TkCOLON)
+ else
+ @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)
+ else
+ @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)
+ elsif peek(0) == '='
+ getc
+ @lex_state = :EXPR_BEG
+ Token(TkOPASGN, "/") #/)
+ elsif @lex_state == :EXPR_ARG and @space_seen and peek(0) !~ /\s/
+ identify_string(op)
+ else
+ @lex_state = :EXPR_BEG
+ Token("/") #/)
+ end
+ end
+
+ @OP.def_rules("^") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token("^")
+ end
+
+ # @OP.def_rules("^=") do
+ # @lex_state = :EXPR_BEG
+ # Token(OP_ASGN, :^)
+ # end
+
+ @OP.def_rules(",") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token(op)
+ end
+
+ @OP.def_rules(";") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ until (@indent_stack.empty? ||
+ [TkLPAREN, TkLBRACK, TkLBRACE,
+ TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
+ @indent_stack.pop
+ end
+ Token(op)
+ end
+
+ @OP.def_rule("~") do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token("~")
+ end
+
+ @OP.def_rule("~@", proc{|op, io| @lex_state == :EXPR_FNAME}) do
+ |op, io|
+ @lex_state = :EXPR_BEG
+ Token("~")
+ end
+
+ @OP.def_rule("(") do
+ |op, io|
+ @indent += 1
+ if @lex_state == :EXPR_BEG || @lex_state == :EXPR_MID
+ @lex_state = :EXPR_BEG
+ tk_c = TkfLPAREN
+ else
+ @lex_state = :EXPR_BEG
+ tk_c = TkLPAREN
+ end
+ @indent_stack.push tk_c
+ Token tk_c
+ end
+
+ @OP.def_rule("[]", proc{|op, io| @lex_state == :EXPR_FNAME}) do
+ |op, io|
+ @lex_state = :EXPR_ARG
+ Token("[]")
+ end
+
+ @OP.def_rule("[]=", proc{|op, io| @lex_state == :EXPR_FNAME}) do
+ |op, io|
+ @lex_state = :EXPR_ARG
+ Token("[]=")
+ end
+
+ @OP.def_rule("[") do
+ |op, io|
+ @indent += 1
+ if @lex_state == :EXPR_FNAME
+ 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
+ end
+ @indent_stack.push tk_c
+ Token(tk_c)
+ end
+
+ @OP.def_rule("{") do
+ |op, io|
+ @indent += 1
+ if @lex_state != :EXPR_END && @lex_state != :EXPR_ARG
+ tk_c = TkLBRACE
+ else
+ tk_c = TkfLBRACE
+ end
+ @lex_state = :EXPR_BEG
+ @indent_stack.push tk_c
+ Token(tk_c)
+ end
+
+ @OP.def_rule('\\') do
+ |op, io|
+ if getc == "\n"
+ @space_seen = true
+ @continue = true
+ Token(TkSPACE)
+ else
+ ungetc
+ Token("\\")
+ end
+ end
+
+ @OP.def_rule('%') do
+ |op, io|
+ if @lex_state == :EXPR_BEG || @lex_state == :EXPR_MID
+ identify_quotation
+ elsif peek(0) == '='
+ getc
+ Token(TkOPASGN, :%)
+ elsif @lex_state == :EXPR_ARG and @space_seen and peek(0) !~ /\s/
+ identify_quotation
+ else
+ @lex_state = :EXPR_BEG
+ Token("%") #))
+ end
+ end
+
+ @OP.def_rule('$') do
+ |op, io|
+ identify_gvar
+ end
+
+ @OP.def_rule('@') do
+ |op, io|
+ if peek(0) =~ /[\w@]/
+ ungetc
+ identify_identifier
+ else
+ 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
+ if peek_match?(/_END__/) and @lex_state == :EXPR_BEG then
+ 6.times { getc }
+ Token(TkEND_OF_SCRIPT, '__END__')
+ else
+ ungetc
+ identify_identifier
+ end
+ end
+
+ @OP.def_rule("") do
+ |op, io|
+ printf "MATCH: start %s: %s\n", op, io.inspect if RDoc::RubyLex.debug?
+ if peek(0) =~ /[0-9]/
+ t = identify_number
+ else
+ t = identify_identifier
+ end
+ printf "MATCH: end %s: %s\n", op, io.inspect if RDoc::RubyLex.debug?
+ t
+ end
+
+ p @OP if RDoc::RubyLex.debug?
+ end
+
+ def identify_gvar
+ @lex_state = :EXPR_END
+
+ case ch = getc
+ when /[~_*$?!@\/\\;,=:<>".]/ #"
+ Token(TkGVAR, "$" + ch)
+ when "-"
+ Token(TkGVAR, "$-" + getc)
+ when "&", "`", "'", "+"
+ Token(TkBACK_REF, "$"+ch)
+ when /[1-9]/
+ ref = ch
+ while (ch = getc) =~ /[0-9]/ do ref << ch end
+ ungetc
+ Token(TkNTH_REF, "$#{ref}")
+ when /\w/
+ ungetc
+ ungetc
+ identify_identifier
+ else
+ ungetc
+ Token("$")
+ end
+ end
+
+ IDENT_RE = if defined? Encoding then
+ eval '/[\w\u{0080}-\u{FFFFF}]/u' # 1.8 can't parse \u{}
+ else
+ /[\w\x80-\xFF]/
+ end
+
+ def identify_identifier
+ token = ""
+ if peek(0) =~ /[$@]/
+ token.concat(c = getc)
+ if c == "@" and peek(0) == "@"
+ token.concat getc
+ end
+ end
+
+ while (ch = getc) =~ IDENT_RE do
+ print " :#{ch}: " if RDoc::RubyLex.debug?
+ token.concat ch
+ end
+
+ ungetc
+
+ if (ch == "!" || ch == "?") && token[0,1] =~ /\w/ && peek(0) != "="
+ token.concat getc
+ end
+
+ # almost fix token
+
+ case token
+ when /^\$/
+ return Token(TkGVAR, token)
+ when /^\@\@/
+ @lex_state = :EXPR_END
+ # p Token(TkCVAR, token)
+ return Token(TkCVAR, token)
+ when /^\@/
+ @lex_state = :EXPR_END
+ return Token(TkIVAR, token)
+ end
+
+ if @lex_state != :EXPR_DOT
+ print token, "\n" if RDoc::RubyLex.debug?
+
+ 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)
+ valid = peek(0) != ':'
+
+ # check for ``class = val'' etc.
+ 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 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
+ else
+ token_c = TkIDENTIFIER
+ 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
+ end
+ elsif @lex_state == :EXPR_BEG || @lex_state == :EXPR_DOT ||
+ @lex_state == :EXPR_ARG
+ @lex_state = :EXPR_ARG
+ else
+ @lex_state = :EXPR_END
+ end
+
+ if token[0, 1] =~ /[A-Z]/
+ return Token(TkCONSTANT, token)
+ elsif token[token.size - 1, 1] =~ /[!?]/
+ return Token(TkFID, token)
+ else
+ return Token(TkIDENTIFIER, token)
+ end
+ end
+
+ def identify_here_document
+ ch = getc
+ # if lt = PERCENT_LTYPE[ch]
+ if ch == "-"
+ ch = getc
+ indent = true
+ end
+ if /['"`]/ =~ ch
+ user_quote = lt = ch
+ quoted = ""
+ while (c = getc) && c != lt
+ quoted.concat c
+ end
+ else
+ user_quote = nil
+ lt = '"'
+ quoted = ch.dup
+ while (c = getc) && c =~ /\w/
+ quoted.concat c
+ end
+ ungetc
+ end
+
+ ltback, @ltype = @ltype, lt
+ reserve = []
+ while ch = getc
+ reserve.push ch
+ if ch == "\\"
+ reserve.push ch = getc
+ elsif ch == "\n"
+ break
+ end
+ end
+
+ output_heredoc = reserve.join =~ /\A\r?\n\z/
+
+ if output_heredoc then
+ doc = '<<'
+ doc << '-' if indent
+ doc << "#{user_quote}#{quoted}#{user_quote}\n"
+ else
+ doc = '"'
+ end
+
+ @here_header = false
+ while l = gets
+ l = l.sub(/(:?\r)?\n\z/, "\n")
+ if (indent ? l.strip : l.chomp) == quoted
+ break
+ end
+ doc << l
+ end
+
+ if output_heredoc then
+ raise Error, "Missing terminating #{quoted} for string" unless l
+
+ doc << l.chomp
+ else
+ doc << '"'
+ end
+
+ @here_header = true
+ @here_readed.concat reserve
+ while ch = reserve.pop
+ ungetc ch
+ end
+
+ token_class = output_heredoc ? RDoc::RubyLex::TkHEREDOC : Ltype2Token[lt]
+ @ltype = ltback
+ @lex_state = :EXPR_END
+ Token(token_class, doc)
+ end
+
+ def identify_quotation
+ type = ch = getc
+ if lt = PERCENT_LTYPE[type]
+ ch = getc
+ elsif type =~ /\W/
+ type = nil
+ lt = "\""
+ else
+ return Token(TkMOD, '%')
+ end
+ # if ch !~ /\W/
+ # ungetc
+ # next
+ # end
+ #@ltype = lt
+ @quoted = ch unless @quoted = PERCENT_PAREN[ch]
+ identify_string(lt, @quoted, type)
+ end
+
+ def identify_number(op = "")
+ @lex_state = :EXPR_END
+
+ num = op
+
+ if peek(0) == "0" && peek(1) !~ /[.eE]/
+ num << getc
+
+ case peek(0)
+ when /[xX]/
+ ch = getc
+ match = /[0-9a-fA-F_]/
+ when /[bB]/
+ ch = getc
+ match = /[01_]/
+ when /[oO]/
+ ch = getc
+ match = /[0-7_]/
+ when /[dD]/
+ ch = getc
+ match = /[0-9_]/
+ when /[0-7]/
+ match = /[0-7_]/
+ when /[89]/
+ raise Error, "Illegal octal digit"
+ else
+ return Token(TkINTEGER, num)
+ end
+
+ num << ch if ch
+
+ len0 = true
+ non_digit = false
+ while ch = getc
+ num << ch
+ if match =~ ch
+ if ch == "_"
+ if non_digit
+ raise Error, "trailing `#{ch}' in number"
+ else
+ non_digit = ch
+ end
+ else
+ non_digit = false
+ len0 = false
+ end
+ else
+ ungetc
+ num[-1, 1] = ''
+ if len0
+ raise Error, "numeric literal without digits"
+ end
+ if non_digit
+ raise Error, "trailing `#{non_digit}' in number"
+ end
+ break
+ end
+ end
+ return Token(TkINTEGER, num)
+ end
+
+ type = TkINTEGER
+ allow_point = true
+ allow_e = true
+ non_digit = false
+ while ch = getc
+ num << ch
+ case ch
+ when /[0-9]/
+ non_digit = false
+ when "_"
+ non_digit = ch
+ when allow_point && "."
+ if non_digit
+ raise Error, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) !~ /[0-9]/
+ type = TkINTEGER
+ ungetc
+ num[-1, 1] = ''
+ break
+ end
+ allow_point = false
+ when allow_e && "e", allow_e && "E"
+ if non_digit
+ raise Error, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) =~ /[+-]/
+ num << getc
+ end
+ allow_e = false
+ allow_point = false
+ non_digit = ch
+ else
+ if non_digit
+ raise Error, "trailing `#{non_digit}' in number"
+ end
+ ungetc
+ num[-1, 1] = ''
+ break
+ end
+ end
+
+ Token(type, num)
+ end
+
+ def identify_string(ltype, quoted = ltype, type = nil)
+ close = PERCENT_PAREN.values.include?(quoted)
+ @ltype = ltype
+ @quoted = quoted
+
+ str = if ltype == quoted and %w[" ' /].include? ltype then
+ ltype.dup
+ elsif RUBY_VERSION > '1.9' then
+ "%#{type or PERCENT_LTYPE.key ltype}#{PERCENT_PAREN_REV[quoted]||quoted}"
+ else
+ "%#{type or PERCENT_LTYPE.index ltype}#{PERCENT_PAREN_REV[quoted]||quoted}"
+ end
+
+ subtype = nil
+ begin
+ nest = 0
+
+ while ch = getc
+ str << ch
+
+ if @quoted == ch and nest <= 0
+ break
+ elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
+ ch = getc
+ subtype = true
+ if ch == "{" then
+ str << ch << skip_inner_expression
+ next
+ else
+ ungetc
+ end
+ elsif ch == '\\'
+ if %w[' /].include? @ltype then
+ case ch = getc
+ when "\\", "\n", "'"
+ when @ltype
+ str << ch
+ else
+ ungetc
+ end
+ else
+ str << read_escape
+ end
+ end
+
+ if close then
+ if PERCENT_PAREN[ch] == @quoted
+ nest += 1
+ elsif ch == @quoted
+ nest -= 1
+ end
+ end
+ end
+
+ if @ltype == "/"
+ while peek(0) =~ /i|m|x|o|e|s|u|n/
+ str << getc
+ end
+ end
+
+ if subtype
+ Token(DLtype2Token[ltype], str)
+ else
+ Token(Ltype2Token[ltype], str)
+ end
+ ensure
+ @ltype = nil
+ @quoted = nil
+ @lex_state = :EXPR_END
+ end
+ end
+
+ def skip_inner_expression
+ res = ""
+ nest = 0
+ while ch = getc
+ res << ch
+ if ch == '}'
+ break if nest.zero?
+ nest -= 1
+ elsif ch == '{'
+ nest += 1
+ end
+ end
+ res
+ end
+
+ def identify_comment
+ @ltype = "#"
+
+ comment = '#'
+
+ while ch = getc
+ # if ch == "\\" #"
+ # read_escape
+ # end
+ if ch == "\n"
+ @ltype = nil
+ ungetc
+ break
+ end
+
+ comment << ch
+ end
+
+ return Token(TkCOMMENT, comment)
+ end
+
+ def read_escape
+ escape = ''
+ ch = getc
+
+ case ch
+ when "\n", "\r", "\f"
+ escape << ch
+ when "\\", "n", "t", "r", "f", "v", "a", "e", "b", "s" #"
+ escape << ch
+ when /[0-7]/
+ ungetc ch
+ 3.times do
+ ch = getc
+ case ch
+ when /[0-7]/
+ escape << ch
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ end
+
+ when "x"
+ escape << ch
+
+ 2.times do
+ ch = getc
+ case ch
+ when /[0-9a-fA-F]/
+ escape << ch
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ end
+
+ when "M"
+ escape << ch
+
+ ch = getc
+ if ch != '-'
+ ungetc
+ else
+ escape << ch
+
+ ch = getc
+ if ch == "\\" #"
+ ungetc
+ escape << read_escape
+ else
+ escape << ch
+ end
+ end
+
+ when "C", "c" #, "^"
+ escape << ch
+
+ if ch == "C"
+ ch = getc
+
+ if ch == "-"
+ escape << ch
+ ch = getc
+ escape << ch
+
+ escape << read_escape if ch == "\\"
+ else
+ ungetc
+ end
+ elsif (ch = getc) == "\\" #"
+ escape << ch << read_escape
+ end
+ else
+ escape << ch
+
+ # other characters
+ end
+
+ escape
+ end
+
+ # :startdoc:
+
+end
+
+#RDoc::RubyLex.debug_level = 1
+
diff --git a/lib/rdoc/ruby_token.rb b/lib/rdoc/ruby_token.rb
new file mode 100644
index 0000000000..f091e1a676
--- /dev/null
+++ b/lib/rdoc/ruby_token.rb
@@ -0,0 +1,460 @@
+#--
+# irb/ruby-token.rb - ruby tokens
+# $Release Version: 0.9.5$
+# $Revision: 11708 $
+# $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#++
+# Definitions of all tokens involved in the lexical analysis.
+#
+# This class is not documented because it is so deep in the internals.
+
+module RDoc::RubyToken
+ # :stopdoc:
+
+ EXPR_BEG = :EXPR_BEG
+ EXPR_MID = :EXPR_MID
+ EXPR_END = :EXPR_END
+ EXPR_ARG = :EXPR_ARG
+ EXPR_FNAME = :EXPR_FNAME
+ EXPR_DOT = :EXPR_DOT
+ EXPR_CLASS = :EXPR_CLASS
+
+ # for ruby 1.4X
+ if !defined?(Symbol)
+ Symbol = Integer
+ end
+
+ def set_token_position(line, char)
+ @prev_line_no = line
+ @prev_char_no = char
+ end
+
+ class Token
+ def initialize(seek, line_no, char_no, text = nil)
+ @seek = seek
+ @line_no = line_no
+ @char_no = char_no
+ @text = text
+ end
+
+ attr_reader :seek
+ attr_reader :line_no
+ attr_reader :char_no
+
+ attr_accessor :text
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.text == @text
+ end
+
+ ##
+ # Because we're used in contexts that expect to return a token, we set the
+ # text string and then return ourselves
+
+ def set_text(text)
+ @text = text
+ self
+ end
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @text]
+ end
+
+ end
+
+ class TkNode < Token
+ def initialize(seek, line_no, char_no, node = nil)
+ super seek, line_no, char_no
+ @node = node
+ end
+
+ attr_reader:node
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.node == @node
+ end
+
+ def set_text text
+ @node = text
+ self
+ end
+
+ alias text node
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @node]
+ end
+
+ end
+
+ class TkId < Token
+ def initialize(seek, line_no, char_no, name)
+ super(seek, line_no, char_no)
+ @name = name
+ end
+ attr_reader:name
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.name == @name
+ end
+
+ def set_text text
+ @name = text
+ self
+ end
+
+ alias text name
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
+ end
+
+ end
+
+ class TkKW < TkId
+ end
+
+ class TkVal < Token
+ def initialize(seek, line_no, char_no, value = nil)
+ super(seek, line_no, char_no)
+ @value = value
+ end
+ attr_accessor :value
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.value == @value
+ end
+
+ def set_text text
+ @value = text
+ self
+ end
+
+ alias text value
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %s, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @value]
+ end
+
+ end
+
+ class TkOp < Token
+ def initialize(seek, line_no, char_no, name = nil)
+ super seek, line_no, char_no
+ @name = name
+ end
+
+ attr_accessor :name
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.name == @name
+ end
+
+ def set_text text
+ @name = text
+ self
+ end
+
+ alias text name
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
+ end
+
+ end
+
+ class TkOPASGN < TkOp
+ def initialize(seek, line_no, char_no, op)
+ super(seek, line_no, char_no)
+ op = TkReading2Token[op][0] unless op.kind_of?(Symbol)
+ @op = op
+ @text = nil
+ end
+
+ attr_reader:op
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.op == @op
+ end
+
+ def text
+ @text ||= "#{TkToken2Reading[op]}="
+ end
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @op]
+ end
+
+ end
+
+ class TkUnknownChar < Token
+ def initialize(seek, line_no, char_no, name)
+ super(seek, line_no, char_no)
+ @name = name
+ end
+ attr_reader:name
+
+ def ==(other)
+ self.class == other.class and
+ other.line_no == @line_no and
+ other.char_no == @char_no and
+ other.name == @name
+ end
+
+ def set_text text
+ @name = text
+ self
+ end
+
+ alias text name
+
+ def inspect # :nodoc:
+ klass = self.class.name.split('::').last
+ "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
+ end
+
+ end
+
+ class TkError < Token
+ end
+
+ def Token(token, value = nil)
+ value ||= TkToken2Reading[token]
+
+ case token
+ when String
+ if (tk = TkReading2Token[token]).nil?
+ IRB.fail TkReading2TokenNoKey, token
+ end
+
+ tk = Token(tk[0], value)
+
+ if tk.kind_of?(TkOp) then
+ tk.name = token
+ end
+ when Symbol
+ if (tk = TkSymbol2Token[token]).nil?
+ IRB.fail TkSymbol2TokenNoKey, token
+ end
+
+ tk = Token(tk[0], value)
+ else
+ if token.instance_method(:initialize).arity == 3 then
+ tk = token.new(@prev_seek, @prev_line_no, @prev_char_no)
+ tk.set_text value
+ else
+ tk = token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
+ end
+ end
+
+ tk
+ end
+
+ TokenDefinitions = [
+ [:TkCLASS, TkKW, "class", :EXPR_CLASS],
+ [:TkMODULE, TkKW, "module", :EXPR_BEG],
+ [:TkDEF, TkKW, "def", :EXPR_FNAME],
+ [:TkUNDEF, TkKW, "undef", :EXPR_FNAME],
+ [:TkBEGIN, TkKW, "begin", :EXPR_BEG],
+ [:TkRESCUE, TkKW, "rescue", :EXPR_MID],
+ [:TkENSURE, TkKW, "ensure", :EXPR_BEG],
+ [:TkEND, TkKW, "end", :EXPR_END],
+ [:TkIF, TkKW, "if", :EXPR_BEG, :TkIF_MOD],
+ [:TkUNLESS, TkKW, "unless", :EXPR_BEG, :TkUNLESS_MOD],
+ [:TkTHEN, TkKW, "then", :EXPR_BEG],
+ [:TkELSIF, TkKW, "elsif", :EXPR_BEG],
+ [:TkELSE, TkKW, "else", :EXPR_BEG],
+ [:TkCASE, TkKW, "case", :EXPR_BEG],
+ [:TkWHEN, TkKW, "when", :EXPR_BEG],
+ [:TkWHILE, TkKW, "while", :EXPR_BEG, :TkWHILE_MOD],
+ [:TkUNTIL, TkKW, "until", :EXPR_BEG, :TkUNTIL_MOD],
+ [:TkFOR, TkKW, "for", :EXPR_BEG],
+ [:TkBREAK, TkKW, "break", :EXPR_MID],
+ [:TkNEXT, TkKW, "next", :EXPR_END],
+ [:TkREDO, TkKW, "redo", :EXPR_END],
+ [:TkRETRY, TkKW, "retry", :EXPR_END],
+ [:TkIN, TkKW, "in", :EXPR_BEG],
+ [:TkDO, TkKW, "do", :EXPR_BEG],
+ [:TkRETURN, TkKW, "return", :EXPR_MID],
+ [:TkYIELD, TkKW, "yield", :EXPR_END],
+ [:TkSUPER, TkKW, "super", :EXPR_END],
+ [:TkSELF, TkKW, "self", :EXPR_END],
+ [:TkNIL, TkKW, "nil", :EXPR_END],
+ [:TkTRUE, TkKW, "true", :EXPR_END],
+ [:TkFALSE, TkKW, "false", :EXPR_END],
+ [:TkAND, TkKW, "and", :EXPR_BEG],
+ [:TkOR, TkKW, "or", :EXPR_BEG],
+ [:TkNOT, TkKW, "not", :EXPR_BEG],
+ [:TkIF_MOD, TkKW],
+ [:TkUNLESS_MOD, TkKW],
+ [:TkWHILE_MOD, TkKW],
+ [:TkUNTIL_MOD, TkKW],
+ [:TkALIAS, TkKW, "alias", :EXPR_FNAME],
+ [:TkDEFINED, TkKW, "defined?", :EXPR_END],
+ [:TklBEGIN, TkKW, "BEGIN", :EXPR_END],
+ [:TklEND, TkKW, "END", :EXPR_END],
+ [:Tk__LINE__, TkKW, "__LINE__", :EXPR_END],
+ [:Tk__FILE__, TkKW, "__FILE__", :EXPR_END],
+
+ [:TkIDENTIFIER, TkId],
+ [:TkFID, TkId],
+ [:TkGVAR, TkId],
+ [:TkCVAR, TkId],
+ [:TkIVAR, TkId],
+ [:TkCONSTANT, TkId],
+
+ [:TkINTEGER, TkVal],
+ [:TkFLOAT, TkVal],
+ [:TkSTRING, TkVal],
+ [:TkHEREDOC, TkVal],
+ [:TkXSTRING, TkVal],
+ [:TkREGEXP, TkVal],
+ [:TkSYMBOL, TkVal],
+ [:TkCHAR, TkVal],
+
+ [:TkDSTRING, TkNode],
+ [:TkDXSTRING, TkNode],
+ [:TkDREGEXP, TkNode],
+ [:TkNTH_REF, TkNode],
+ [:TkBACK_REF, TkNode],
+
+ [:TkUPLUS, TkOp, "+@"],
+ [:TkUMINUS, TkOp, "-@"],
+ [:TkPOW, TkOp, "**"],
+ [:TkCMP, TkOp, "<=>"],
+ [:TkEQ, TkOp, "=="],
+ [:TkEQQ, TkOp, "==="],
+ [:TkNEQ, TkOp, "!="],
+ [:TkGEQ, TkOp, ">="],
+ [:TkLEQ, TkOp, "<="],
+ [:TkANDOP, TkOp, "&&"],
+ [:TkOROP, TkOp, "||"],
+ [:TkMATCH, TkOp, "=~"],
+ [:TkNMATCH, TkOp, "!~"],
+ [:TkDOT2, TkOp, ".."],
+ [:TkDOT3, TkOp, "..."],
+ [:TkAREF, TkOp, "[]"],
+ [:TkASET, TkOp, "[]="],
+ [:TkLSHFT, TkOp, "<<"],
+ [:TkRSHFT, TkOp, ">>"],
+ [:TkCOLON2, TkOp, '::'],
+ [:TkCOLON3, TkOp, '::'],
+ #[:OPASGN, TkOp], # +=, -= etc. #
+ [:TkASSOC, TkOp, "=>"],
+ [:TkQUESTION, TkOp, "?"], #?
+ [:TkCOLON, TkOp, ":"], #:
+
+ [:TkfLPAREN, Token, "("], # func( #
+ [:TkfLBRACK, Token, "["], # func[ #
+ [:TkfLBRACE, Token, "{"], # func{ #
+ [:TkSYMBEG, Token, ":"], # :SYMBOL
+
+ [:TkAMPER, TkOp, "&"],
+ [:TkGT, TkOp, ">"],
+ [:TkLT, TkOp, "<"],
+ [:TkPLUS, TkOp, "+"],
+ [:TkSTAR, TkOp, "*"],
+ [:TkMINUS, TkOp, "-"],
+ [:TkMULT, TkOp, "*"],
+ [:TkDIV, TkOp, "/"],
+ [:TkMOD, TkOp, "%"],
+ [:TkBITOR, TkOp, "|"],
+ [:TkBITXOR, TkOp, "^"],
+ [:TkBITAND, TkOp, "&"],
+ [:TkBITNOT, TkOp, "~"],
+ [:TkNOTOP, TkOp, "!"],
+
+ [:TkBACKQUOTE, TkOp, "`"],
+
+ [:TkASSIGN, Token, "="],
+ [:TkDOT, Token, "."],
+ [:TkLPAREN, Token, "("], #(exp)
+ [:TkLBRACK, Token, "["], #[arry]
+ [:TkLBRACE, Token, "{"], #{hash}
+ [:TkRPAREN, Token, ")"],
+ [:TkRBRACK, Token, "]"],
+ [:TkRBRACE, Token, "}"],
+ [:TkCOMMA, Token, ","],
+ [:TkSEMICOLON, Token, ";"],
+
+ [:TkCOMMENT, TkVal],
+ [:TkSPACE, Token, " "],
+ [:TkNL, Token, "\n"],
+ [:TkEND_OF_SCRIPT],
+
+ [:TkBACKSLASH, TkUnknownChar, "\\"],
+ [:TkAT, TkUnknownChar, "@"],
+ [:TkDOLLAR, TkUnknownChar, "$"],
+ ]
+
+ # {reading => token_class}
+ # {reading => [token_class, *opt]}
+ TkReading2Token = {}
+ TkToken2Reading = {}
+ TkSymbol2Token = {}
+
+ def self.def_token(token_n, super_token = Token, reading = nil, *opts)
+ token_n = token_n.id2name if token_n.kind_of?(Symbol)
+ if const_defined?(token_n)
+ IRB.fail AlreadyDefinedToken, token_n
+ end
+ token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}")
+
+ if reading
+ TkToken2Reading[token_c] = reading
+
+ return if TkReading2Token[reading]
+
+ if opts.empty?
+ TkReading2Token[reading] = [token_c]
+ else
+ TkReading2Token[reading] = [token_c].concat(opts)
+ end
+ end
+ TkSymbol2Token[token_n.intern] = token_c
+ end
+
+ for defs in TokenDefinitions
+ def_token(*defs)
+ end
+
+ def_token :TkRD_COMMENT, TkCOMMENT
+
+ NEWLINE_TOKEN = TkNL.new 0, 0, 0, "\n"
+
+ class TkSYMBOL
+
+ def to_sym
+ @sym ||= text[1..-1].intern
+ end
+
+ end
+
+ # :startdoc:
+end
+
diff --git a/lib/rdoc/rubygems_hook.rb b/lib/rdoc/rubygems_hook.rb
index 90b0541fcf..c4eaddbd97 100644
--- a/lib/rdoc/rubygems_hook.rb
+++ b/lib/rdoc/rubygems_hook.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: true
+require 'rubygems'
require 'rubygems/user_interaction'
require 'fileutils'
require 'rdoc'
@@ -153,7 +153,13 @@ class RDoc::RubygemsHook
options = nil
args = @spec.rdoc_options
- args.concat @spec.source_paths
+
+ if @spec.respond_to? :source_paths then
+ args.concat @spec.source_paths
+ else
+ args.concat @spec.require_paths
+ end
+
args.concat @spec.extra_rdoc_files
case config_args = Gem.configuration[:rdoc]
@@ -177,7 +183,7 @@ class RDoc::RubygemsHook
@rdoc.options = options
store = RDoc::Store.new
- store.encoding = options.encoding
+ store.encoding = options.encoding if options.respond_to? :encoding
store.dry_run = options.dry_run
store.main = options.main_page
store.title = options.title
@@ -244,3 +250,4 @@ class RDoc::RubygemsHook
end
end
+
diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb
index f2d6dd5adc..ec8fd739f1 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -1,7 +1,5 @@
-# frozen_string_literal: true
require 'rdoc'
require 'time'
-require 'json'
require 'webrick'
##
@@ -111,13 +109,13 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
def do_GET req, res
- req.path = req.path.sub(/^#{Regexp.escape @mount_path}/o, '') if @mount_path
+ req.path.sub!(/^#{Regexp.escape @mount_path}/o, '') if @mount_path
case req.path
when '/' then
root req, res
- when '/js/darkfish.js', '/js/jquery.js', '/js/search.js',
- %r%^/css/%, %r%^/images/%, %r%^/fonts/% then
+ when '/rdoc.css', '/js/darkfish.js', '/js/jquery.js', '/js/search.js',
+ %r%^/images/% then
asset :darkfish, req, res
when '/js/navigation.js', '/js/searcher.js' then
asset :json_index, req, res
@@ -204,7 +202,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
<title>Error - #{ERB::Util.html_escape exception.class}</title>
-<link type="text/css" media="screen" href="#{@mount_path}/css/rdoc.css" rel="stylesheet">
+<link type="text/css" media="screen" href="#{@mount_path}/rdoc.css" rel="stylesheet">
</head>
<body>
<h1>Error</h1>
@@ -217,7 +215,7 @@ exception:
<pre>#{ERB::Util.html_escape exception.message}</pre>
<p>Please report this to the
-<a href="https://github.com/ruby/rdoc/issues">RDoc issues tracker</a>. Please
+<a href="https://github.com/rdoc/rdoc/issues">RDoc issues tracker</a>. Please
include the RDoc version, the URI above and exception class, message and
backtrace. If you're viewing a gem's documentation, include the gem name and
version. If you're viewing Ruby's documentation, include the version of ruby.
@@ -440,3 +438,4 @@ version. If you're viewing Ruby's documentation, include the version of ruby.
end
end
+
diff --git a/lib/rdoc/single_class.rb b/lib/rdoc/single_class.rb
index 6a7b67deb3..9e77a65c73 100644
--- a/lib/rdoc/single_class.rb
+++ b/lib/rdoc/single_class.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A singleton class
@@ -11,10 +10,6 @@ class RDoc::SingleClass < RDoc::ClassModule
superclass ? super + [superclass] : super
end
- def aref_prefix # :nodoc:
- 'sclass'
- end
-
##
# The definition of this singleton class, <tt>class << MyClassName</tt>
diff --git a/lib/rdoc/stats.rb b/lib/rdoc/stats.rb
index bd6c0ef23a..b5a21915b4 100644
--- a/lib/rdoc/stats.rb
+++ b/lib/rdoc/stats.rb
@@ -1,12 +1,9 @@
-# frozen_string_literal: true
##
# RDoc statistics collector which prints a summary and report of a project's
# documentation totals.
class RDoc::Stats
- include RDoc::Text
-
##
# Output level for the coverage report
@@ -441,8 +438,6 @@ class RDoc::Stats
params = method.param_list
- params = params.map { |param| param.gsub(/^\*\*?/, '') }
-
return 0, [] if params.empty?
document = parse method.comment
diff --git a/lib/rdoc/stats/normal.rb b/lib/rdoc/stats/normal.rb
index a3a6ff377e..ef366a500e 100644
--- a/lib/rdoc/stats/normal.rb
+++ b/lib/rdoc/stats/normal.rb
@@ -1,9 +1,6 @@
-# frozen_string_literal: true
begin
require 'io/console/size'
rescue LoadError
- # for JRuby
- require 'io/console'
end
##
@@ -28,8 +25,11 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
# Print a progress bar, but make sure it fits on a single line. Filename
# will be truncated if necessary.
- size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
- terminal_width = size[1].to_i.nonzero? || 80
+ terminal_width = if defined?(IO) && IO.respond_to?(:console_size)
+ IO.console_size[1].to_i.nonzero? || 80
+ else
+ 80
+ end
max_filename_size = terminal_width - progress_bar.size
if filename.size > max_filename_size then
@@ -42,7 +42,7 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
if $stdout.tty?
# Clean the line with whitespaces so that leftover output from the
# previous line doesn't show up.
- $stdout.print("\r" + (" " * @last_width) + ("\b" * @last_width) + "\r") if @last_width && @last_width > 0
+ $stdout.print("\r" << (" " * @last_width) << ("\b" * @last_width) << "\r") if @last_width && @last_width > 0
@last_width = line.size
$stdout.print("#{line}\r")
else
@@ -56,3 +56,4 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
end
end
+
diff --git a/lib/rdoc/stats/quiet.rb b/lib/rdoc/stats/quiet.rb
index bc4161b2d4..eed27b2a88 100644
--- a/lib/rdoc/stats/quiet.rb
+++ b/lib/rdoc/stats/quiet.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Stats printer that prints nothing
diff --git a/lib/rdoc/stats/verbose.rb b/lib/rdoc/stats/verbose.rb
index 6ace8937a2..430809ae07 100644
--- a/lib/rdoc/stats/verbose.rb
+++ b/lib/rdoc/stats/verbose.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Stats printer that prints everything documented, including the documented
# status
diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb
index 999aa76f92..fde6f0695b 100644
--- a/lib/rdoc/store.rb
+++ b/lib/rdoc/store.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'fileutils'
##
@@ -450,12 +449,18 @@ class RDoc::Store
# inherit from Object, we have the above wrong inheritance.
#
# We fix BasicObject right away if we are running in a Ruby
- # version >= 1.9.
+ # version >= 1.9. If not, we may be documenting 1.9 source
+ # while running under 1.8: we search the files of BasicObject
+ # for "object.c", and fix the inheritance if we find it.
def fix_basic_object_inheritance
basic = classes_hash['BasicObject']
return unless basic
- basic.superclass = nil
+ if RUBY_VERSION >= '1.9'
+ basic.superclass = nil
+ elsif basic.in_files.any? { |f| File.basename(f.full_name) == 'object.c' }
+ basic.superclass = nil
+ end
end
##
@@ -679,7 +684,12 @@ class RDoc::Store
method_name =~ /#(.*)/
method_type = $1 ? 'i' : 'c'
method_name = $1 if $1
- method_name = method_name.gsub(/\W/) { "%%%02x" % $&[0].ord }
+
+ method_name = if ''.respond_to? :ord then
+ method_name.gsub(/\W/) { "%%%02x" % $&[0].ord }
+ else
+ method_name.gsub(/\W/) { "%%%02x" % $&[0] }
+ end
File.join class_path(klass_name), "#{method_name}-#{method_type}.ri"
end
@@ -966,3 +976,4 @@ class RDoc::Store
end
end
+
diff --git a/lib/rdoc/task.rb b/lib/rdoc/task.rb
index 323d00eabc..a83939090d 100644
--- a/lib/rdoc/task.rb
+++ b/lib/rdoc/task.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
#
@@ -22,6 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
+require 'rubygems'
begin
gem 'rdoc'
rescue Gem::LoadError
@@ -327,3 +327,4 @@ module Rake
end
# :startdoc:
+
diff --git a/lib/rdoc/test_case.rb b/lib/rdoc/test_case.rb
index 22d3f14219..245e4ef1c5 100644
--- a/lib/rdoc/test_case.rb
+++ b/lib/rdoc/test_case.rb
@@ -1,12 +1,13 @@
-# frozen_string_literal: true
+require 'rubygems'
+
begin
gem 'minitest', '~> 4.0' unless defined?(Test::Unit)
-rescue NoMethodError, Gem::LoadError
+rescue NoMethodError
# for ruby tests
end
require 'minitest/autorun'
-require 'minitest/benchmark' unless ENV['NOBENCHMARK']
+require 'minitest/benchmark' if ENV['BENCHMARK']
require 'fileutils'
require 'pp'
@@ -39,6 +40,8 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
@top_level = nil
+ @have_encoding = Object.const_defined? :Encoding
+
@RM = RDoc::Markup
RDoc::Markup::PreProcess.reset
@@ -139,8 +142,9 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
# Enables pretty-print output
def mu_pp obj # :nodoc:
- s = obj.pretty_inspect
- s = RDoc::Encoding.change_encoding s, Encoding.default_external
+ s = ''
+ s = PP.pp obj, s
+ s = s.force_encoding Encoding.default_external if defined? Encoding
s.chomp
end
@@ -172,6 +176,8 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
# Depends upon Dir.mktmpdir
def temp_dir
+ skip "No Dir::mktmpdir, upgrade your ruby" unless Dir.respond_to? :mktmpdir
+
Dir.mktmpdir do |temp_dir|
Dir.chdir temp_dir do
yield temp_dir
@@ -201,3 +207,11 @@ class RDoc::TestCase < MiniTest::Unit::TestCase
end
end
end
+
+# This hack allows autoload to work when Dir.pwd is changed for Ruby 1.8 since
+# -I paths are not expanded.
+$LOAD_PATH.each do |load_path|
+ break if load_path[0] == ?/
+ load_path.replace File.expand_path load_path
+end if RUBY_VERSION < '1.9'
+
diff --git a/lib/rdoc/text.rb b/lib/rdoc/text.rb
index 7e714be0ad..3a58641ec1 100644
--- a/lib/rdoc/text.rb
+++ b/lib/rdoc/text.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: true
+# coding: utf-8
##
# For RDoc::Text#to_html
@@ -6,6 +6,16 @@
require 'strscan'
##
+# For RDoc::Text#snippet
+
+begin
+ gem 'json'
+rescue Gem::LoadError
+end
+
+require 'json'
+
+##
# Methods for manipulating comment text
module RDoc::Text
@@ -41,7 +51,7 @@ module RDoc::Text
:open_squote => encode_fallback('‘', encoding, '\''),
:trademark => encode_fallback('®', encoding, '(r)'),
}
- end
+ end if Object.const_defined? :Encoding
##
# Transcodes +character+ to +encoding+ with a +fallback+ character.
@@ -58,11 +68,11 @@ module RDoc::Text
expanded = []
text.each_line do |line|
- nil while line.gsub!(/(?:\G|\r)((?:.{8})*?)([^\t\r\n]{0,7})\t/) do
+ line.gsub!(/^((?:.{8})*?)([^\t\r\n]{0,7})\t/) do
r = "#{$1}#{$2}#{' ' * (8 - $2.size)}"
- r = RDoc::Encoding.change_encoding r, text.encoding
+ r.force_encoding text.encoding if Object.const_defined? :Encoding
r
- end
+ end until line !~ /\t/
expanded << line
end
@@ -82,7 +92,7 @@ module RDoc::Text
end
empty = ''
- empty = RDoc::Encoding.change_encoding empty, text.encoding
+ empty.force_encoding text.encoding if Object.const_defined? :Encoding
text.gsub(/^ {0,#{indent}}/, empty)
end
@@ -149,7 +159,7 @@ module RDoc::Text
return text if text =~ /^(?>\s*)[^\#]/
empty = ''
- empty = RDoc::Encoding.change_encoding empty, text.encoding
+ empty.force_encoding text.encoding if Object.const_defined? :Encoding
text.gsub(/^\s*(#+)/) { $1.tr '#', ' ' }.gsub(/^\s+$/, empty)
end
@@ -167,19 +177,19 @@ module RDoc::Text
def strip_stars text
return text unless text =~ %r%/\*.*\*/%m
- encoding = text.encoding
+ encoding = text.encoding if Object.const_defined? :Encoding
text = text.gsub %r%Document-method:\s+[\w:.#=!?]+%, ''
space = ' '
- space = RDoc::Encoding.change_encoding space, encoding if encoding
+ space.force_encoding encoding if encoding
text.sub! %r%/\*+% do space * $&.length end
text.sub! %r%\*+/% do space * $&.length end
text.gsub! %r%^[ \t]*\*%m do space * $&.length end
empty = ''
- empty = RDoc::Encoding.change_encoding empty, encoding if encoding
+ empty.force_encoding encoding if encoding
text.gsub(/^\s+$/, empty)
end
@@ -188,9 +198,24 @@ module RDoc::Text
# trademark symbols in +text+ to properly encoded characters.
def to_html text
- html = (''.encode text.encoding).dup
+ if Object.const_defined? :Encoding then
+ html = ''.encode text.encoding
- encoded = RDoc::Text::TO_HTML_CHARACTERS[text.encoding]
+ encoded = RDoc::Text::TO_HTML_CHARACTERS[text.encoding]
+ else
+ html = ''
+ encoded = {
+ :close_dquote => '”',
+ :close_squote => '’',
+ :copyright => '©',
+ :ellipsis => '…',
+ :em_dash => '—',
+ :en_dash => '–',
+ :open_dquote => '“',
+ :open_squote => '‘',
+ :trademark => '®',
+ }
+ end
s = StringScanner.new text
insquotes = false
@@ -296,3 +321,4 @@ module RDoc::Text
end
end
+
diff --git a/lib/rdoc/token_stream.rb b/lib/rdoc/token_stream.rb
index 05fb46e89a..b46b7da2f7 100644
--- a/lib/rdoc/token_stream.rb
+++ b/lib/rdoc/token_stream.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A TokenStream is a list of tokens, gathered during the parse of some entity
# (say a method). Entities populate these streams by being registered with the
@@ -10,61 +9,43 @@ module RDoc::TokenStream
##
# Converts +token_stream+ to HTML wrapping various tokens with
- # <tt><span></tt> elements. Some tokens types are wrapped in spans
- # with the given class names. Other token types are not wrapped in spans.
+ # <tt><span></tt> elements. The following tokens types are wrapped in spans
+ # with the given class names:
+ #
+ # TkCONSTANT :: 'ruby-constant'
+ # TkKW :: 'ruby-keyword'
+ # TkIVAR :: 'ruby-ivar'
+ # TkOp :: 'ruby-operator'
+ # TkId :: 'ruby-identifier'
+ # TkNode :: 'ruby-node'
+ # TkCOMMENT :: 'ruby-comment'
+ # TkREGEXP :: 'ruby-regexp'
+ # TkSTRING :: 'ruby-string'
+ # TkVal :: 'ruby-value'
+ #
+ # Other token types are not wrapped in spans.
def self.to_html token_stream
- starting_title = false
-
token_stream.map do |t|
next unless t
- style = case t[:kind]
- when :on_const then 'ruby-constant'
- when :on_kw then 'ruby-keyword'
- when :on_ivar then 'ruby-ivar'
- when :on_cvar then 'ruby-identifier'
- when :on_gvar then 'ruby-identifier'
- when '=' != t[:text] && :on_op
- then 'ruby-operator'
- when :on_tlambda then 'ruby-operator'
- when :on_ident then 'ruby-identifier'
- when :on_label then 'ruby-value'
- when :on_backref, :on_dstring
- then 'ruby-node'
- when :on_comment then 'ruby-comment'
- when :on_embdoc then 'ruby-comment'
- when :on_regexp then 'ruby-regexp'
- when :on_tstring then 'ruby-string'
- when :on_int, :on_float,
- :on_rational, :on_imaginary,
- :on_heredoc,
- :on_symbol, :on_CHAR then 'ruby-value'
- when :on_heredoc_beg, :on_heredoc_end
- then 'ruby-identifier'
+ style = case t
+ when RDoc::RubyToken::TkCONSTANT then 'ruby-constant'
+ when RDoc::RubyToken::TkKW then 'ruby-keyword'
+ when RDoc::RubyToken::TkIVAR then 'ruby-ivar'
+ when RDoc::RubyToken::TkOp then 'ruby-operator'
+ when RDoc::RubyToken::TkId then 'ruby-identifier'
+ when RDoc::RubyToken::TkNode then 'ruby-node'
+ when RDoc::RubyToken::TkCOMMENT then 'ruby-comment'
+ when RDoc::RubyToken::TkREGEXP then 'ruby-regexp'
+ when RDoc::RubyToken::TkSTRING then 'ruby-string'
+ when RDoc::RubyToken::TkVal then 'ruby-value'
end
- comment_with_nl = false
- if :on_comment == t[:kind] or :on_embdoc == t[:kind] or :on_heredoc_end == t[:kind]
- comment_with_nl = true if "\n" == t[:text][-1]
- text = t[:text].rstrip
- else
- text = t[:text]
- end
-
- if :on_ident == t[:kind] && starting_title
- starting_title = false
- style = 'ruby-identifier ruby-title'
- end
-
- if :on_kw == t[:kind] and 'def' == t[:text]
- starting_title = true
- end
-
- text = CGI.escapeHTML text
+ text = CGI.escapeHTML t.text
if style then
- "<span class=\"#{style}\">#{text}</span>#{"\n" if comment_with_nl}"
+ "<span class=\"#{style}\">#{text}</span>"
else
text
end
diff --git a/lib/rdoc/tom_doc.rb b/lib/rdoc/tom_doc.rb
index 2b594b7d84..2b62243525 100644
--- a/lib/rdoc/tom_doc.rb
+++ b/lib/rdoc/tom_doc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# :markup: tomdoc
# A parser for TomDoc based on TomDoc 1.0.0-rc1 (02adef9b5a)
@@ -222,7 +221,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
# Returns self.
def tokenize text
- text = text.sub(/\A(Public|Internal|Deprecated):\s+/, '')
+ text.sub!(/\A(Public|Internal|Deprecated):\s+/, '')
setup_scanner text
diff --git a/lib/rdoc/top_level.rb b/lib/rdoc/top_level.rb
index 6186722772..64d81d20c1 100644
--- a/lib/rdoc/top_level.rb
+++ b/lib/rdoc/top_level.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A TopLevel context is a representation of the contents of a single file
diff --git a/lib/resolv-replace.rb b/lib/resolv-replace.rb
index a83e79d996..3e28a843fd 100644
--- a/lib/resolv-replace.rb
+++ b/lib/resolv-replace.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
require 'socket'
require 'resolv'
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 45e1af47f4..9c7dd1b9b3 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -1,8 +1,6 @@
-# frozen_string_literal: true
-
require 'socket'
require 'timeout'
-require 'io/wait'
+require 'thread'
begin
require 'securerandom'
@@ -24,7 +22,7 @@ end
#
# Resolv::DNS.open do |dns|
# ress = dns.getresources "www.ruby-lang.org", Resolv::DNS::Resource::IN::A
-# p ress.map(&:address)
+# p ress.map { |r| r.address }
# ress = dns.getresources "ruby-lang.org", Resolv::DNS::Resource::IN::MX
# p ress.map { |r| [r.exchange.to_s, r.preference] }
# end
@@ -160,7 +158,7 @@ class Resolv
##
# Indicates a timeout resolving a name or address.
- class ResolvTimeout < Timeout::Error; end
+ class ResolvTimeout < TimeoutError; end
##
# Resolv::Hosts is a hostname resolver that uses the system hosts file.
@@ -179,7 +177,7 @@ class Resolv
def initialize(filename = DefaultFileName)
@filename = filename
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
@initialized = nil
end
@@ -188,7 +186,7 @@ class Resolv
unless @initialized
@name2addr = {}
@addr2name = {}
- File.open(@filename, 'rb') {|f|
+ open(@filename, 'rb') {|f|
f.each {|line|
line.sub!(/#.*/, '')
addr, hostname, *aliases = line.split(/\s+/)
@@ -263,7 +261,9 @@ class Resolv
def each_name(address, &proc)
lazy_initialize
- @addr2name[address]&.each(&proc)
+ if @addr2name.include?(address)
+ @addr2name[address].each(&proc)
+ end
end
end
@@ -331,7 +331,7 @@ class Resolv
# :ndots => 1)
def initialize(config_info=nil)
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
@config = Config.new(config_info)
@initialized = nil
end
@@ -569,13 +569,13 @@ class Resolv
def extract_resources(msg, name, typeclass) # :nodoc:
if typeclass < Resource::ANY
n0 = Name.create(name)
- msg.each_resource {|n, ttl, data|
+ msg.each_answer {|n, ttl, data|
yield data if n0 == n
}
end
yielded = false
n0 = Name.create(name)
- msg.each_resource {|n, ttl, data|
+ msg.each_answer {|n, ttl, data|
if n0 == n
case data
when typeclass
@@ -587,7 +587,7 @@ class Resolv
end
}
return if yielded
- msg.each_resource {|n, ttl, data|
+ msg.each_answer {|n, ttl, data|
if n0 == n
case data
when typeclass
@@ -622,7 +622,7 @@ class Resolv
end
RequestID = {} # :nodoc:
- RequestIDMutex = Thread::Mutex.new # :nodoc:
+ RequestIDMutex = Mutex.new # :nodoc:
def self.allocate_request_id(host, port) # :nodoc:
id = nil
@@ -666,27 +666,23 @@ class Resolv
end
def request(sender, tout)
- start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ start = Time.now
timelimit = start + tout
begin
sender.send
- rescue Errno::EHOSTUNREACH, # multi-homed IPv6 may generate this
- Errno::ENETUNREACH
+ rescue Errno::EHOSTUNREACH
+ # multi-homed IPv6 may generate this
raise ResolvTimeout
end
while true
- before_select = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ before_select = Time.now
timeout = timelimit - before_select
if timeout <= 0
raise ResolvTimeout
end
- if @socks.size == 1
- select_result = @socks[0].wait_readable(timeout) ? [ @socks ] : nil
- else
- select_result = IO.select(@socks, nil, nil, timeout)
- end
+ select_result = IO.select(@socks, nil, nil, timeout)
if !select_result
- after_select = Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ after_select = Time.now
next if after_select < timelimit
raise ResolvTimeout
end
@@ -719,7 +715,9 @@ class Resolv
def close
socks = @socks
@socks = nil
- socks&.each(&:close)
+ if socks
+ socks.each {|sock| sock.close }
+ end
end
class Sender # :nodoc:
@@ -734,47 +732,35 @@ class Resolv
def initialize(*nameserver_port)
super()
@nameserver_port = nameserver_port
- @initialized = false
- @mutex = Thread::Mutex.new
- end
-
- def lazy_initialize
- @mutex.synchronize {
- next if @initialized
- @initialized = true
- @socks_hash = {}
- @socks = []
- @nameserver_port.each {|host, port|
- if host.index(':')
- bind_host = "::"
- af = Socket::AF_INET6
- else
- bind_host = "0.0.0.0"
- af = Socket::AF_INET
- end
- next if @socks_hash[bind_host]
- begin
- sock = UDPSocket.new(af)
- rescue Errno::EAFNOSUPPORT
- next # The kernel doesn't support the address family.
- end
- @socks << sock
- @socks_hash[bind_host] = sock
- sock.do_not_reverse_lookup = true
- DNS.bind_random_port(sock, bind_host)
- }
+ @socks_hash = {}
+ @socks = []
+ nameserver_port.each {|host, port|
+ if host.index(':')
+ bind_host = "::"
+ af = Socket::AF_INET6
+ else
+ bind_host = "0.0.0.0"
+ af = Socket::AF_INET
+ end
+ next if @socks_hash[bind_host]
+ begin
+ sock = UDPSocket.new(af)
+ rescue Errno::EAFNOSUPPORT
+ next # The kernel doesn't support the address family.
+ end
+ sock.do_not_reverse_lookup = true
+ DNS.bind_random_port(sock, bind_host)
+ @socks << sock
+ @socks_hash[bind_host] = sock
}
- self
end
def recv_reply(readable_socks)
- lazy_initialize
reply, from = readable_socks[0].recvfrom(UDPSize)
return reply, [from[3],from[1]]
end
def sender(msg, data, host, port=Port)
- lazy_initialize
sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
return nil if !sock
service = [host, port]
@@ -786,14 +772,9 @@ class Resolv
end
def close
- @mutex.synchronize {
- if @initialized
- super
- @senders.each_key {|service, id|
- DNS.free_request_id(service[0], service[1], id)
- }
- @initialized = false
- end
+ super
+ @senders.each_key {|service, id|
+ DNS.free_request_id(service[0], service[1], id)
}
end
@@ -817,32 +798,20 @@ class Resolv
super()
@host = host
@port = port
- @mutex = Thread::Mutex.new
- @initialized = false
- end
-
- def lazy_initialize
- @mutex.synchronize {
- next if @initialized
- @initialized = true
- is_ipv6 = @host.index(':')
- sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
- @socks = [sock]
- sock.do_not_reverse_lookup = true
- DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0")
- sock.connect(@host, @port)
- }
- self
+ is_ipv6 = host.index(':')
+ sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
+ @socks = [sock]
+ sock.do_not_reverse_lookup = true
+ DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0")
+ sock.connect(host, port)
end
def recv_reply(readable_socks)
- lazy_initialize
reply = readable_socks[0].recv(UDPSize)
return reply, nil
end
def sender(msg, data, host=@host, port=@port)
- lazy_initialize
unless host == @host && port == @port
raise RequestError.new("host/port don't match: #{host}:#{port}")
end
@@ -853,15 +822,10 @@ class Resolv
end
def close
- @mutex.synchronize do
- if @initialized
- super
- @senders.each_key {|from, id|
- DNS.free_request_id(@host, @port, id)
- }
- @initialized = false
- end
- end
+ super
+ @senders.each_key {|from, id|
+ DNS.free_request_id(@host, @port, id)
+ }
end
class Sender < Requester::Sender # :nodoc:
@@ -875,7 +839,6 @@ class Resolv
class MDNSOneShot < UnconnectedUDP # :nodoc:
def sender(msg, data, host, port=Port)
- lazy_initialize
id = DNS.allocate_request_id(host, port)
request = msg.encode
request[0,2] = [id].pack('n')
@@ -885,7 +848,6 @@ class Resolv
end
def sender_for(addr, msg)
- lazy_initialize
@senders[msg.id]
end
end
@@ -941,7 +903,7 @@ class Resolv
class Config # :nodoc:
def initialize(config_info=nil)
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
@config_info = config_info
@initialized = nil
@timeouts = nil
@@ -964,11 +926,13 @@ class Resolv
nameserver = []
search = nil
ndots = 1
- File.open(filename, 'rb') {|f|
+ open(filename, 'rb') {|f|
f.each {|line|
line.sub!(/[#;].*/, '')
keyword, *args = line.split(/\s+/)
- args.each(&:untaint)
+ args.each { |arg|
+ arg.untaint
+ }
next unless keyword
case keyword
when 'nameserver'
@@ -1102,10 +1066,6 @@ class Resolv
candidates = []
end
candidates.concat(@search.map {|domain| Name.new(name.to_a + domain)})
- fname = Name.create("#{name}.")
- if !candidates.include?(fname)
- candidates << fname
- end
end
return candidates
end
@@ -1206,9 +1166,7 @@ class Resolv
class Str # :nodoc:
def initialize(string)
@string = string
- # case insensivity of DNS labels doesn't apply non-ASCII characters. [RFC 4343]
- # This assumes @string is given in ASCII compatible encoding.
- @downcase = string.b.downcase
+ @downcase = string.downcase
end
attr_reader :string, :downcase
@@ -1221,7 +1179,7 @@ class Resolv
end
def ==(other)
- return self.class == other.class && @downcase == other.downcase
+ return @downcase == other.downcase
end
def eql?(other)
@@ -1257,14 +1215,6 @@ class Resolv
end
def initialize(labels, absolute=true) # :nodoc:
- labels = labels.map {|label|
- case label
- when String then Label::Str.new(label)
- when Label::Str then label
- else
- raise ArgumentError, "unexpected label: #{label.inspect}"
- end
- }
@labels = labels
@absolute = absolute
end
@@ -1282,8 +1232,7 @@ class Resolv
def ==(other) # :nodoc:
return false unless Name === other
- return false unless @absolute == other.absolute?
- return @labels == other.to_a
+ return @labels.join == other.to_a.join && @absolute == other.absolute?
end
alias eql? == # :nodoc:
@@ -1457,7 +1406,7 @@ class Resolv
class MessageEncoder # :nodoc:
def initialize
- @data = ''.dup
+ @data = ''
@names = {}
yield self
end
@@ -1505,9 +1454,7 @@ class Resolv
self.put_pack("n", 0xc000 | idx)
return
else
- if @data.length < 0x4000
- @names[domain] = @data.length
- end
+ @names[domain] = @data.length
self.put_label(d[i])
end
}
@@ -1556,12 +1503,12 @@ class Resolv
def initialize(data)
@data = data
@index = 0
- @limit = data.bytesize
+ @limit = data.length
yield self
end
def inspect
- "\#<#{self.class}: #{@data.byteslice(0, @index).inspect} #{@data.byteslice(@index..-1).inspect}>"
+ "\#<#{self.class}: #{@data[0, @index].inspect} #{@data[@index..-1].inspect}>"
end
def get_length16
@@ -1580,7 +1527,7 @@ class Resolv
def get_bytes(len = @limit - @index)
raise DecodeError.new("limit exceeded") if @limit < @index + len
- d = @data.byteslice(@index, len)
+ d = @data[@index, len]
@index += len
return d
end
@@ -1608,9 +1555,9 @@ class Resolv
def get_string
raise DecodeError.new("limit exceeded") if @limit <= @index
- len = @data.getbyte(@index)
+ len = @data[@index].ord
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
- d = @data.byteslice(@index + 1, len)
+ d = @data[@index + 1, len]
@index += 1 + len
return d
end
@@ -1633,7 +1580,7 @@ class Resolv
d = []
while true
raise DecodeError.new("limit exceeded") if @limit <= @index
- case @data.getbyte(@index)
+ case @data[@index].ord
when 0
@index += 1
if save_index
@@ -1670,13 +1617,7 @@ class Resolv
name = self.get_name
type, klass, ttl = self.get_unpack('nnN')
typeclass = Resource.get_class(type, klass)
- res = self.get_length16 do
- begin
- typeclass.decode_rdata self
- rescue => e
- raise DecodeError, e.message, e.backtrace
- end
- end
+ res = self.get_length16 { typeclass.decode_rdata self }
res.instance_variable_set :@ttl, ttl
return name, ttl, res
end
@@ -1720,10 +1661,10 @@ class Resolv
return false unless self.class == other.class
s_ivars = self.instance_variables
s_ivars.sort!
- s_ivars.delete :@ttl
+ s_ivars.delete "@ttl"
o_ivars = other.instance_variables
o_ivars.sort!
- o_ivars.delete :@ttl
+ o_ivars.delete "@ttl"
return s_ivars == o_ivars &&
s_ivars.collect {|name| self.instance_variable_get name} ==
o_ivars.collect {|name| other.instance_variable_get name}
@@ -1736,7 +1677,7 @@ class Resolv
def hash # :nodoc:
h = 0
vars = self.instance_variables
- vars.delete :@ttl
+ vars.delete "@ttl"
vars.each {|name|
h ^= self.instance_variable_get(name).hash
}
@@ -2486,14 +2427,14 @@ class Resolv
when IPv6
return arg
when String
- address = ''.b
+ address = ''
if Regex_8Hex =~ arg
arg.scan(/[0-9A-Fa-f]+/) {|hex| address << [hex.hex].pack('n')}
elsif Regex_CompressedHex =~ arg
prefix = $1
suffix = $2
- a1 = ''.b
- a2 = ''.b
+ a1 = ''
+ a2 = ''
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
omitlen = 16 - a1.length - a2.length
@@ -2509,8 +2450,8 @@ class Resolv
elsif Regex_CompressedHex4Dec =~ arg
prefix, suffix, a, b, c, d = $1, $2, $3.to_i, $4.to_i, $5.to_i, $6.to_i
if (0..255) === a && (0..255) === b && (0..255) === c && (0..255) === d
- a1 = ''.b
- a2 = ''.b
+ a1 = ''
+ a2 = ''
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
omitlen = 12 - a1.length - a2.length
@@ -2639,7 +2580,7 @@ class Resolv
def each_address(name)
name = Resolv::DNS::Name.create(name)
- return unless name.to_a.last.to_s == 'local'
+ return unless name.to_a.last == 'local'
super(name)
end
@@ -2734,12 +2675,10 @@ class Resolv
return arg
when String
coordinates = ''
- if Regex =~ arg && $1.to_f < 180
- m = $~
- hemi = (m[4][/[NE]/]) || (m[4][/[SW]/]) ? 1 : -1
- coordinates = [ ((m[1].to_i*(36e5)) + (m[2].to_i*(6e4)) +
- (m[3].to_f*(1e3))) * hemi+(2**31) ].pack("N")
- orientation = m[4][/[NS]/] ? 'lat' : 'lon'
+ if Regex =~ arg && $1<180
+ hemi = ($4[/([NE])/,1]) || ($4[/([SW])/,1]) ? 1 : -1
+ coordinates = [(($1.to_i*(36e5))+($2.to_i*(6e4))+($3.to_f*(1e3)))*hemi+(2**31)].pack("N")
+ (orientation ||= '') << $4[[/NS/],1] ? 'lat' : 'lon'
else
raise ArgumentError.new("not a properly formed Coord string: " + arg)
end
diff --git a/lib/rexml/attlistdecl.rb b/lib/rexml/attlistdecl.rb
index dc1d2add0b..ec4e6c3b8d 100644
--- a/lib/rexml/attlistdecl.rb
+++ b/lib/rexml/attlistdecl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#vim:ts=2 sw=2 noexpandtab:
require 'rexml/child'
require 'rexml/source'
@@ -24,7 +23,7 @@ module REXML
# Create an AttlistDecl, pulling the information from a Source. Notice
# that this isn't very convenient; to create an AttlistDecl, you basically
# have to format it yourself, and then have the initializer parse it.
- # Sorry, but for the foreseeable future, DTD support in REXML is pretty
+ # Sorry, but for the forseeable future, DTD support in REXML is pretty
# weak on convenience. Have I mentioned how much I hate DTDs?
def initialize(source)
super()
diff --git a/lib/rexml/attribute.rb b/lib/rexml/attribute.rb
index ca5984e178..ef9e544294 100644
--- a/lib/rexml/attribute.rb
+++ b/lib/rexml/attribute.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/namespace"
require 'rexml/text'
@@ -110,7 +109,7 @@ module REXML
# b.to_string # -> "ns:x='y'"
def to_string
if @element and @element.context and @element.context[:attribute_quote] == :quote
- %Q^#@expanded_name="#{to_s().gsub(/"/, '&quot;')}"^
+ %Q^#@expanded_name="#{to_s().gsub(/"/, '&quote;')}"^
else
"#@expanded_name='#{to_s().gsub(/'/, '&apos;')}'"
end
diff --git a/lib/rexml/cdata.rb b/lib/rexml/cdata.rb
index 2238446dc4..73358edc28 100644
--- a/lib/rexml/cdata.rb
+++ b/lib/rexml/cdata.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/text"
module REXML
@@ -58,7 +57,7 @@ module REXML
# c = CData.new( " Some text " )
# c.write( $stdout ) #-> <![CDATA[ Some text ]]>
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
- Kernel.warn( "#{self.class.name}.write is deprecated", uplevel: 1)
+ Kernel.warn( "#{self.class.name}.write is deprecated" )
indent( output, indent )
output << START
output << @string
diff --git a/lib/rexml/child.rb b/lib/rexml/child.rb
index d23451e71e..bf97d5f903 100644
--- a/lib/rexml/child.rb
+++ b/lib/rexml/child.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/node"
module REXML
diff --git a/lib/rexml/comment.rb b/lib/rexml/comment.rb
index 822fe0d586..42a040c456 100644
--- a/lib/rexml/comment.rb
+++ b/lib/rexml/comment.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
@@ -22,6 +21,7 @@ module REXML
# should be nil, not supplied, or a Parent to be set as the parent
# of this object
def initialize( first, second = nil )
+ #puts "IN COMMENT CONSTRUCTOR; SECOND IS #{second.type}"
super(second)
if first.kind_of? String
@string = first
@@ -48,7 +48,7 @@ module REXML
# ie_hack::
# Needed for conformity to the child API, but not used by this class.
def write( output, indent=-1, transitive=false, ie_hack=false )
- Kernel.warn("Comment.write is deprecated. See REXML::Formatters", uplevel: 1)
+ Kernel.warn("Comment.write is deprecated. See REXML::Formatters")
indent( output, indent )
output << START
output << @string
diff --git a/lib/rexml/doctype.rb b/lib/rexml/doctype.rb
index 1eb1f5b4e1..0b3c533bb4 100644
--- a/lib/rexml/doctype.rb
+++ b/lib/rexml/doctype.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/parent"
require "rexml/parseexception"
require "rexml/namespace"
diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb
index 806bc499cd..8342b96e6a 100644
--- a/lib/rexml/document.rb
+++ b/lib/rexml/document.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/security"
require "rexml/element"
require "rexml/xmldecl"
@@ -279,10 +278,6 @@ module REXML
end
end
- def document
- self
- end
-
private
def build( source )
Parsers::TreeParser.new( source, self ).parse
diff --git a/lib/rexml/dtd/attlistdecl.rb b/lib/rexml/dtd/attlistdecl.rb
index 32847daadb..25955ee274 100644
--- a/lib/rexml/dtd/attlistdecl.rb
+++ b/lib/rexml/dtd/attlistdecl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
module DTD
diff --git a/lib/rexml/dtd/dtd.rb b/lib/rexml/dtd/dtd.rb
index 927d5d847b..62317bac9e 100644
--- a/lib/rexml/dtd/dtd.rb
+++ b/lib/rexml/dtd/dtd.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/dtd/elementdecl"
require "rexml/dtd/entitydecl"
require "rexml/comment"
diff --git a/lib/rexml/dtd/elementdecl.rb b/lib/rexml/dtd/elementdecl.rb
index 119fd41a8f..a0bf641300 100644
--- a/lib/rexml/dtd/elementdecl.rb
+++ b/lib/rexml/dtd/elementdecl.rb
@@ -1,12 +1,11 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
module DTD
class ElementDecl < Child
START = "<!ELEMENT"
START_RE = /^\s*#{START}/um
- # PATTERN_RE = /^\s*(#{START}.*?)>/um
- PATTERN_RE = /^\s*#{START}\s+((?:[:\w][-\.\w]*:)?[-!\*\.\w]*)(.*?)>/
+ PATTERN_RE = /^\s*(#{START}.*?)>/um
+ PATTERN_RE = /^\s*#{START}\s+((?:[:\w_][-\.\w_]*:)?[-!\*\.\w_]*)(.*?)>/
#\s*((((["']).*?\5)|[^\/'">]*)*?)(\/)?>/um, true)
def initialize match
diff --git a/lib/rexml/dtd/entitydecl.rb b/lib/rexml/dtd/entitydecl.rb
index 45707e2f42..a9286b2b90 100644
--- a/lib/rexml/dtd/entitydecl.rb
+++ b/lib/rexml/dtd/entitydecl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
module DTD
diff --git a/lib/rexml/dtd/notationdecl.rb b/lib/rexml/dtd/notationdecl.rb
index cfdf0b9b74..17d1b9ef29 100644
--- a/lib/rexml/dtd/notationdecl.rb
+++ b/lib/rexml/dtd/notationdecl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
module DTD
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb
index ac9b10872c..e459704d3c 100644
--- a/lib/rexml/element.rb
+++ b/lib/rexml/element.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/parent"
require "rexml/namespace"
require "rexml/attribute"
@@ -551,30 +550,6 @@ module REXML
# Attributes #
#################################################
- # Fetches an attribute value or a child.
- #
- # If String or Symbol is specified, it's treated as attribute
- # name. Attribute value as String or +nil+ is returned. This case
- # is shortcut of +attributes[name]+.
- #
- # If Integer is specified, it's treated as the index of
- # child. It returns Nth child.
- #
- # doc = REXML::Document.new("<a attr='1'><b/><c/></a>")
- # doc.root["attr"] # => "1"
- # doc.root.attributes["attr"] # => "1"
- # doc.root[1] # => <c/>
- def [](name_or_index)
- case name_or_index
- when String
- attributes[name_or_index]
- when Symbol
- attributes[name_or_index.to_s]
- else
- super
- end
- end
-
def attribute( name, namespace=nil )
prefix = nil
if namespaces.respond_to? :key
@@ -710,7 +685,7 @@ module REXML
# doc.write( out ) #-> doc is written to the string 'out'
# doc.write( $stdout ) #-> doc written to the console
def write(output=$stdout, indent=-1, transitive=false, ie_hack=false)
- Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters", uplevel: 1)
+ Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters")
formatter = if indent > -1
if transitive
require "rexml/formatters/transitive"
diff --git a/lib/rexml/encoding.rb b/lib/rexml/encoding.rb
index da2d70d6c9..1c7e79a124 100644
--- a/lib/rexml/encoding.rb
+++ b/lib/rexml/encoding.rb
@@ -1,5 +1,4 @@
# coding: US-ASCII
-# frozen_string_literal: false
module REXML
module Encoding
# ID ---> Encoding name
diff --git a/lib/rexml/entity.rb b/lib/rexml/entity.rb
index 97c7b6b42f..39f3900075 100644
--- a/lib/rexml/entity.rb
+++ b/lib/rexml/entity.rb
@@ -1,9 +1,10 @@
-# frozen_string_literal: false
require 'rexml/child'
require 'rexml/source'
require 'rexml/xmltokens'
module REXML
+ # God, I hate DTDs. I really do. Why this idiot standard still
+ # plagues us is beyond me.
class Entity < Child
include XMLTokens
PUBIDCHAR = "\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
@@ -27,7 +28,8 @@ module REXML
# the constructor with the entity definition, or use the accessor methods.
# +WARNING+: There is no validation of entity state except when the entity
# is read from a stream. If you start poking around with the accessors,
- # you can easily create a non-conformant Entity.
+ # you can easily create a non-conformant Entity. The best thing to do is
+ # dump the stupid DTDs and use XMLSchema instead.
#
# e = Entity.new( 'amp', '&' )
def initialize stream, value=nil, parent=nil, reference=false
@@ -136,14 +138,8 @@ module REXML
matches = @value.scan(PEREFERENCE_RE)
rv = @value.clone
if @parent
- sum = 0
matches.each do |entity_reference|
entity_value = @parent.entity( entity_reference[0] )
- if sum + entity_value.bytesize > Security.entity_expansion_text_limit
- raise "entity expansion has grown too large"
- else
- sum += entity_value.bytesize
- end
rv.gsub!( /%#{entity_reference.join};/um, entity_value )
end
end
@@ -155,7 +151,6 @@ module REXML
# This is a set of entity constants -- the ones defined in the XML
# specification. These are +gt+, +lt+, +amp+, +quot+ and +apos+.
- # CAUTION: these entities does not have parent and document
module EntityConst
# +>+
GT = Entity.new( 'gt', '>' )
diff --git a/lib/rexml/formatters/default.rb b/lib/rexml/formatters/default.rb
index c375f1468b..574c821f96 100644
--- a/lib/rexml/formatters/default.rb
+++ b/lib/rexml/formatters/default.rb
@@ -1,8 +1,7 @@
-# frozen_string_literal: false
module REXML
module Formatters
class Default
- # Prints out the XML document with no formatting -- except if ie_hack is
+ # Prints out the XML document with no formatting -- except if id_hack is
# set.
#
# ie_hack::
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb
index a80274bdad..e5ba561a58 100644
--- a/lib/rexml/formatters/pretty.rb
+++ b/lib/rexml/formatters/pretty.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/formatters/default'
module REXML
diff --git a/lib/rexml/formatters/transitive.rb b/lib/rexml/formatters/transitive.rb
index 81e67f3274..6cc690d922 100644
--- a/lib/rexml/formatters/transitive.rb
+++ b/lib/rexml/formatters/transitive.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/formatters/pretty'
module REXML
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index cd879fdd28..2010be14e0 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
# If you add a method, keep in mind two things:
# (1) the first argument will always be a list of nodes from which to
@@ -8,28 +7,10 @@ module REXML
# Therefore, in XML, "local-name()" is identical (and actually becomes)
# "local_name()"
module Functions
- @@available_functions = {}
@@context = nil
@@namespace_context = {}
@@variables = {}
- INTERNAL_METHODS = [
- :namespace_context,
- :namespace_context=,
- :variables,
- :variables=,
- :context=,
- :get_namespace,
- :send,
- ]
- class << self
- def singleton_method_added(name)
- unless INTERNAL_METHODS.include?(name)
- @@available_functions[name] = true
- end
- end
- end
-
def Functions::namespace_context=(x) ; @@namespace_context=x ; end
def Functions::variables=(x) ; @@variables=x ; end
def Functions::namespace_context ; @@namespace_context ; end
@@ -223,8 +204,8 @@ module REXML
# Now, get the bounds. The XPath bounds are 1..length; the ruby bounds
# are 0..length. Therefore, we have to offset the bounds by one.
- ruby_start = round(ruby_start) - 1
- ruby_length = round(ruby_length)
+ ruby_start = ruby_start.round - 1
+ ruby_length = ruby_length.round
if ruby_start < 0
ruby_length += ruby_start unless infinite_length
@@ -394,13 +375,10 @@ module REXML
end
def Functions::round( number )
- number = number(number)
begin
- neg = number.negative?
- number = number.abs.round(half: :up)
- neg ? -number : number
+ number(number).round
rescue FloatDomainError
- number
+ number(number)
end
end
@@ -408,14 +386,9 @@ module REXML
node.node_type == :processing_instruction
end
- def Functions::send(name, *args)
- if @@available_functions[name.to_sym]
- super
- else
- # TODO: Maybe, this is not XPath spec behavior.
- # This behavior must be reconsidered.
- XPath.match(@@context[:node], name.to_s)
- end
+ def Functions::method_missing( id )
+ puts "METHOD MISSING #{id.id2name}"
+ XPath.match( @@context[:node], id.id2name )
end
end
end
diff --git a/lib/rexml/instruction.rb b/lib/rexml/instruction.rb
index c4f65eefc1..f8b734a5b5 100644
--- a/lib/rexml/instruction.rb
+++ b/lib/rexml/instruction.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
require "rexml/source"
@@ -43,7 +42,7 @@ module REXML
# See the rexml/formatters package
#
def write writer, indent=-1, transitive=false, ie_hack=false
- Kernel.warn( "#{self.class.name}.write is deprecated", uplevel: 1)
+ Kernel.warn( "#{self.class.name}.write is deprecated" )
indent(writer, indent)
writer << START.sub(/\\/u, '')
writer << @target
diff --git a/lib/rexml/light/node.rb b/lib/rexml/light/node.rb
index d58119a3a4..b33f78f7ce 100644
--- a/lib/rexml/light/node.rb
+++ b/lib/rexml/light/node.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/xmltokens'
# [ :element, parent, name, attributes, children* ]
diff --git a/lib/rexml/namespace.rb b/lib/rexml/namespace.rb
index 90ba7cc635..aeb339ee83 100644
--- a/lib/rexml/namespace.rb
+++ b/lib/rexml/namespace.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/xmltokens'
module REXML
diff --git a/lib/rexml/node.rb b/lib/rexml/node.rb
index 52337ade44..cab6e9fddb 100644
--- a/lib/rexml/node.rb
+++ b/lib/rexml/node.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/parseexception"
require "rexml/formatters/pretty"
require "rexml/formatters/default"
@@ -26,7 +25,7 @@ module REXML
# REXML::Formatters package for changing the output style.
def to_s indent=nil
unless indent.nil?
- Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated", uplevel: 1)
+ Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" )
f = REXML::Formatters::Pretty.new( indent )
f.write( self, rv = "" )
else
diff --git a/lib/rexml/output.rb b/lib/rexml/output.rb
index 96dfea570e..0c6cc7a7f8 100644
--- a/lib/rexml/output.rb
+++ b/lib/rexml/output.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/encoding'
module REXML
diff --git a/lib/rexml/parent.rb b/lib/rexml/parent.rb
index 3bd0a96255..0a9f805109 100644
--- a/lib/rexml/parent.rb
+++ b/lib/rexml/parent.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/child"
module REXML
@@ -16,8 +15,10 @@ module REXML
end
def add( object )
+ #puts "PARENT GOTS #{size} CHILDREN"
object.parent = self
@children << object
+ #puts "PARENT NOW GOTS #{size} CHILDREN"
object
end
diff --git a/lib/rexml/parseexception.rb b/lib/rexml/parseexception.rb
index 7b16cd1a41..0c4d55abda 100644
--- a/lib/rexml/parseexception.rb
+++ b/lib/rexml/parseexception.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
class ParseException < RuntimeError
attr_accessor :source, :parser, :continued_exception
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb
index 80eeb0fa79..6a08b8661d 100644
--- a/lib/rexml/parsers/baseparser.rb
+++ b/lib/rexml/parsers/baseparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/parseexception'
require 'rexml/undefinednamespaceexception'
require 'rexml/source'
diff --git a/lib/rexml/parsers/lightparser.rb b/lib/rexml/parsers/lightparser.rb
index f0601ae51b..81041681c2 100644
--- a/lib/rexml/parsers/lightparser.rb
+++ b/lib/rexml/parsers/lightparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/parsers/streamparser'
require 'rexml/parsers/baseparser'
require 'rexml/light/node'
diff --git a/lib/rexml/parsers/pullparser.rb b/lib/rexml/parsers/pullparser.rb
index 8c49217553..68a4ff7eae 100644
--- a/lib/rexml/parsers/pullparser.rb
+++ b/lib/rexml/parsers/pullparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'forwardable'
require 'rexml/parseexception'
diff --git a/lib/rexml/parsers/sax2parser.rb b/lib/rexml/parsers/sax2parser.rb
index 1386f69c83..46ea8faa4d 100644
--- a/lib/rexml/parsers/sax2parser.rb
+++ b/lib/rexml/parsers/sax2parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/parsers/baseparser'
require 'rexml/parseexception'
require 'rexml/namespace'
@@ -230,6 +229,7 @@ module REXML
def get_procs( symbol, name )
return nil if @procs.size == 0
@procs.find_all do |sym, match, block|
+ #puts sym.inspect+"=="+symbol.inspect+ "\t"+match.inspect+"=="+name.inspect+ "\t"+( (sym.nil? or symbol == sym) and ((name.nil? and match.nil?) or match.nil? or ( (name == match) or (match.kind_of? Regexp and name =~ match)))).to_s
(
(sym.nil? or symbol == sym) and
((name.nil? and match.nil?) or match.nil? or (
diff --git a/lib/rexml/parsers/streamparser.rb b/lib/rexml/parsers/streamparser.rb
index f6a8bfa802..9ea65ed3d1 100644
--- a/lib/rexml/parsers/streamparser.rb
+++ b/lib/rexml/parsers/streamparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/parsers/baseparser"
module REXML
@@ -7,7 +6,6 @@ module REXML
def initialize source, listener
@listener = listener
@parser = BaseParser.new( source )
- @tag_stack = []
end
def add_listener( listener )
@@ -20,21 +18,14 @@ module REXML
event = @parser.pull
case event[0]
when :end_document
- unless @tag_stack.empty?
- tag_path = "/" + @tag_stack.join("/")
- raise ParseException.new("Missing end tag for '#{tag_path}'",
- @parser.source)
- end
return
when :start_element
- @tag_stack << event[1]
attrs = event[2].each do |n, v|
event[2][n] = @parser.unnormalize( v )
end
@listener.tag_start( event[1], attrs )
when :end_element
@listener.tag_end( event[1] )
- @tag_stack.pop
when :text
normalized = @parser.unnormalize( event[1] )
@listener.text( normalized )
diff --git a/lib/rexml/parsers/treeparser.rb b/lib/rexml/parsers/treeparser.rb
index fc0993c72a..68edb77759 100644
--- a/lib/rexml/parsers/treeparser.rb
+++ b/lib/rexml/parsers/treeparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/validation/validationexception'
require 'rexml/undefinednamespaceexception'
diff --git a/lib/rexml/parsers/ultralightparser.rb b/lib/rexml/parsers/ultralightparser.rb
index 6571d119bd..4e2d7a81cf 100644
--- a/lib/rexml/parsers/ultralightparser.rb
+++ b/lib/rexml/parsers/ultralightparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/parsers/streamparser'
require 'rexml/parsers/baseparser'
diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb
index 32b70bb798..d30aa34f6e 100644
--- a/lib/rexml/parsers/xpathparser.rb
+++ b/lib/rexml/parsers/xpathparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/namespace'
require 'rexml/xmltokens'
@@ -185,6 +184,7 @@ module REXML
# | '/' RelativeLocationPath?
# | '//' RelativeLocationPath
def LocationPath path, parsed
+ #puts "LocationPath '#{path}'"
path = path.strip
if path[0] == ?/
parsed << :document
@@ -196,6 +196,7 @@ module REXML
path = path[1..-1]
end
end
+ #puts parsed.inspect
return RelativeLocationPath( path, parsed ) if path.size > 0
end
@@ -209,6 +210,7 @@ module REXML
# | RelativeLocationPath '//' Step
AXIS = /^(ancestor|ancestor-or-self|attribute|child|descendant|descendant-or-self|following|following-sibling|namespace|parent|preceding|preceding-sibling|self)::/
def RelativeLocationPath path, parsed
+ #puts "RelativeLocationPath #{path}"
while path.size > 0
# (axis or @ or <child::>) nodetest predicate >
# OR > / Step
@@ -225,6 +227,7 @@ module REXML
end
else
if path[0] == ?@
+ #puts "ATTRIBUTE"
parsed << :attribute
path = path[1..-1]
# Goto Nodetest
@@ -236,8 +239,10 @@ module REXML
parsed << :child
end
+ #puts "NODETESTING '#{path}'"
n = []
path = NodeTest( path, n)
+ #puts "NODETEST RETURNED '#{path}'"
if path[0] == ?[
path = Predicate( path, n )
@@ -277,6 +282,7 @@ module REXML
NODE_TYPE = /^(comment|text|node)\(\s*\)/m
PI = /^processing-instruction\(/
def NodeTest path, parsed
+ #puts "NodeTest with #{path}"
case path
when /^\*/
path = $'
@@ -298,11 +304,13 @@ module REXML
parsed << :processing_instruction
parsed << (literal || '')
when NCNAMETEST
+ #puts "NCNAMETEST"
prefix = $1
path = $'
parsed << :namespace
parsed << prefix
when QNAME
+ #puts "QNAME"
prefix = $1
name = $2
path = $'
@@ -316,18 +324,22 @@ module REXML
# Filters the supplied nodeset on the predicate(s)
def Predicate path, parsed
+ #puts "PREDICATE with #{path}"
return nil unless path[0] == ?[
predicates = []
while path[0] == ?[
path, expr = get_group(path)
predicates << expr[1..-2] if expr
end
+ #puts "PREDICATES = #{predicates.inspect}"
predicates.each{ |pred|
+ #puts "ORING #{pred}"
preds = []
parsed << :predicate
parsed << preds
OrExpr(pred, preds)
}
+ #puts "PREDICATES = #{predicates.inspect}"
path
end
@@ -338,8 +350,10 @@ module REXML
#| OrExpr S 'or' S AndExpr
#| AndExpr
def OrExpr path, parsed
+ #puts "OR >>> #{path}"
n = []
rest = AndExpr( path, n )
+ #puts "OR <<< #{rest}"
if rest != path
while rest =~ /^\s*( or )/
n = [ :or, n, [] ]
@@ -357,12 +371,16 @@ module REXML
#| AndExpr S 'and' S EqualityExpr
#| EqualityExpr
def AndExpr path, parsed
+ #puts "AND >>> #{path}"
n = []
rest = EqualityExpr( path, n )
+ #puts "AND <<< #{rest}"
if rest != path
while rest =~ /^\s*( and )/
n = [ :and, n, [] ]
+ #puts "AND >>> #{rest}"
rest = EqualityExpr( $', n[-1] )
+ #puts "AND <<< #{rest}"
end
end
if parsed.size == 0 and n.size != 0
@@ -376,8 +394,10 @@ module REXML
#| EqualityExpr ('=' | '!=') RelationalExpr
#| RelationalExpr
def EqualityExpr path, parsed
+ #puts "EQUALITY >>> #{path}"
n = []
rest = RelationalExpr( path, n )
+ #puts "EQUALITY <<< #{rest}"
if rest != path
while rest =~ /^\s*(!?=)\s*/
if $1[0] == ?!
@@ -399,8 +419,10 @@ module REXML
#| RelationalExpr ('<' | '>' | '<=' | '>=') AdditiveExpr
#| AdditiveExpr
def RelationalExpr path, parsed
+ #puts "RELATION >>> #{path}"
n = []
rest = AdditiveExpr( path, n )
+ #puts "RELATION <<< #{rest}"
if rest != path
while rest =~ /^\s*([<>]=?)\s*/
if $1[0] == ?<
@@ -424,8 +446,10 @@ module REXML
#| AdditiveExpr ('+' | S '-') MultiplicativeExpr
#| MultiplicativeExpr
def AdditiveExpr path, parsed
+ #puts "ADDITIVE >>> #{path}"
n = []
rest = MultiplicativeExpr( path, n )
+ #puts "ADDITIVE <<< #{rest}"
if rest != path
while rest =~ /^\s*(\+| -)\s*/
if $1[0] == ?+
@@ -447,8 +471,10 @@ module REXML
#| MultiplicativeExpr ('*' | S ('div' | 'mod') S) UnaryExpr
#| UnaryExpr
def MultiplicativeExpr path, parsed
+ #puts "MULT >>> #{path}"
n = []
rest = UnaryExpr( path, n )
+ #puts "MULT <<< #{rest}"
if rest != path
while rest =~ /^\s*(\*| div | mod )\s*/
if $1[0] == ?*
@@ -481,8 +507,10 @@ module REXML
end
parsed << :neg if mult < 0
+ #puts "UNARY >>> #{path}"
n = []
path = UnionExpr( path, n )
+ #puts "UNARY <<< #{path}"
parsed.concat( n )
path
end
@@ -490,8 +518,10 @@ module REXML
#| UnionExpr '|' PathExpr
#| PathExpr
def UnionExpr path, parsed
+ #puts "UNION >>> #{path}"
n = []
rest = PathExpr( path, n )
+ #puts "UNION <<< #{rest}"
if rest != path
while rest =~ /^\s*(\|)\s*/
n = [ :union, n, [] ]
@@ -511,13 +541,16 @@ module REXML
def PathExpr path, parsed
path =~ /^\s*/
path = $'
+ #puts "PATH >>> #{path}"
n = []
rest = FilterExpr( path, n )
+ #puts "PATH <<< '#{rest}'"
if rest != path
if rest and rest[0] == ?/
return RelativeLocationPath(rest, n)
end
end
+ #puts "BEFORE WITH '#{rest}'"
rest = LocationPath(rest, n) if rest =~ /\A[\/\.\@\[\w*]/
parsed.concat(n)
return rest
@@ -526,9 +559,12 @@ module REXML
#| FilterExpr Predicate
#| PrimaryExpr
def FilterExpr path, parsed
+ #puts "FILTER >>> #{path}"
n = []
path = PrimaryExpr( path, n )
+ #puts "FILTER <<< #{path}"
path = Predicate(path, n) if path and path[0] == ?[
+ #puts "FILTER <<< #{path}"
parsed.concat(n)
path
end
@@ -550,19 +586,23 @@ module REXML
parsed << varname
#arry << @variables[ varname ]
when /^(\w[-\w]*)(?:\()/
+ #puts "PrimaryExpr :: Function >>> #$1 -- '#$''"
fname = $1
tmp = $'
+ #puts "#{fname} =~ #{NT.inspect}"
return path if fname =~ NT
path = tmp
parsed << :function
parsed << fname
path = FunctionCall(path, parsed)
when NUMBER
+ #puts "LITERAL or NUMBER: #$1"
varname = $1.nil? ? $2 : $1
path = $'
parsed << :literal
parsed << (varname.include?('.') ? varname.to_f : varname.to_i)
when LITERAL
+ #puts "LITERAL or NUMBER: #$1"
varname = $1.nil? ? $2 : $1
path = $'
parsed << :literal
diff --git a/lib/rexml/quickpath.rb b/lib/rexml/quickpath.rb
index 5d6c77ca38..9bec2158dd 100644
--- a/lib/rexml/quickpath.rb
+++ b/lib/rexml/quickpath.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/functions'
require 'rexml/xmltokens'
@@ -194,7 +193,7 @@ module REXML
case res
when true
results << element
- when Integer
+ when Fixnum
results << element if Functions.pair[0] == res
when String
results << element
@@ -230,7 +229,7 @@ module REXML
case res
when true
results << element
- when Integer
+ when Fixnum
results << element if Functions.pair[0] == res
end
end
diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb
index fbc0d339d8..f89951171a 100644
--- a/lib/rexml/rexml.rb
+++ b/lib/rexml/rexml.rb
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
-# frozen_string_literal: false
# REXML is an XML toolkit for Ruby[http://www.ruby-lang.org], in Ruby.
#
# REXML is a _pure_ Ruby, XML 1.0 conforming,
diff --git a/lib/rexml/sax2listener.rb b/lib/rexml/sax2listener.rb
index 5afdc80890..9f276eb4ed 100644
--- a/lib/rexml/sax2listener.rb
+++ b/lib/rexml/sax2listener.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
# A template for stream parser listeners.
# Note that the declarations (attlistdecl, elementdecl, etc) are trivially
diff --git a/lib/rexml/security.rb b/lib/rexml/security.rb
index 99b7460772..593b652dc6 100644
--- a/lib/rexml/security.rb
+++ b/lib/rexml/security.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
module Security
@@entity_expansion_limit = 10_000
diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb
index af65cf4751..a0bbe25de7 100644
--- a/lib/rexml/source.rb
+++ b/lib/rexml/source.rb
@@ -1,5 +1,4 @@
# coding: US-ASCII
-# frozen_string_literal: false
require 'rexml/encoding'
module REXML
@@ -186,7 +185,7 @@ module REXML
# You'll notice that this next section is very similar to the same
# section in match(), but just a liiittle different. This is
# because it is a touch faster to do it this way with scan()
- # than the way match() does it; enough faster to warrant duplicating
+ # than the way match() does it; enough faster to warrent duplicating
# some code
if rv.size == 0
until @buffer =~ pattern or @source.nil?
@@ -286,7 +285,7 @@ module REXML
case @encoding
when "UTF-16BE", "UTF-16LE"
@source.binmode
- @source.set_encoding(@encoding, @encoding)
+ @source.set_encoding(@encoding)
end
@line_break = encode(">")
@pending_buffer, @buffer = @buffer, ""
diff --git a/lib/rexml/streamlistener.rb b/lib/rexml/streamlistener.rb
index 30c8945179..3a0528c102 100644
--- a/lib/rexml/streamlistener.rb
+++ b/lib/rexml/streamlistener.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
# A template for stream parser listeners.
# Note that the declarations (attlistdecl, elementdecl, etc) are trivially
diff --git a/lib/rexml/syncenumerator.rb b/lib/rexml/syncenumerator.rb
index a9d2ad7f9c..11609bdf3d 100644
--- a/lib/rexml/syncenumerator.rb
+++ b/lib/rexml/syncenumerator.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
class SyncEnumerator
include Enumerable
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 86269dea1e..d3242ee46d 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/security'
require 'rexml/entity'
require 'rexml/doctype'
@@ -33,7 +32,7 @@ module REXML
VALID_XML_CHARS = Regexp.new('^['+
VALID_CHAR.map { |item|
case item
- when Integer
+ when Fixnum
[item].pack('U').force_encoding('utf-8')
when Range
[item.first, '-'.ord, item.last].pack('UUU').force_encoding('utf-8')
@@ -293,7 +292,7 @@ module REXML
# See REXML::Formatters
#
def write( writer, indent=-1, transitive=false, ie_hack=false )
- Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters", uplevel: 1)
+ Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters")
formatter = if indent > -1
REXML::Formatters::Pretty.new( indent )
else
diff --git a/lib/rexml/undefinednamespaceexception.rb b/lib/rexml/undefinednamespaceexception.rb
index e522ed57ea..8ebfdfd0a9 100644
--- a/lib/rexml/undefinednamespaceexception.rb
+++ b/lib/rexml/undefinednamespaceexception.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/parseexception'
module REXML
class UndefinedNamespaceException < ParseException
diff --git a/lib/rexml/validation/relaxng.rb b/lib/rexml/validation/relaxng.rb
index fb52438290..2441901d7b 100644
--- a/lib/rexml/validation/relaxng.rb
+++ b/lib/rexml/validation/relaxng.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/validation/validation"
require "rexml/parsers/baseparser"
@@ -146,6 +145,7 @@ module REXML
def next( event )
#print "In next with #{event.inspect}. "
+ #puts "Next (#@current) is #{@events[@current]}"
#p @previous
return @previous.pop.next( event ) if @events[@current].nil?
expand_ref_in( @events, @current ) if @events[@current].class == Ref
@@ -154,15 +154,19 @@ module REXML
@events[@current-1].previous = self
return @events[@current-1].next( event )
end
+ #puts "Current isn't a state"
if ( @events[@current].matches?(event) )
@current += 1
if @events[@current].nil?
+ #puts "#{inspect[0,5]} 1RETURNING #{@previous.inspect[0,5]}"
return @previous.pop
elsif @events[@current].kind_of? State
@current += 1
+ #puts "#{inspect[0,5]} 2RETURNING (#{@current-1}) #{@events[@current-1].inspect[0,5]}; on return, next is #{@events[@current]}"
@events[@current-1].previous = self
return @events[@current-1]
else
+ #puts "#{inspect[0,5]} RETURNING self w/ next(#@current) = #{@events[@current]}"
return self
end
else
@@ -389,10 +393,13 @@ module REXML
# Remove the references
# Find the events
end
+ #puts "In next with #{event.inspect}."
+ #puts "events is #{@events.inspect}"
unless @events
@events = []
return nil
end
+ #puts "current = #@current"
super
end
@@ -402,6 +409,8 @@ module REXML
end
def expected
+ #puts "IN CHOICE EXPECTED"
+ #puts "EVENTS = #{@events.inspect}"
return [@events[@current]] if @events.size > 0
return @choices.collect do |x|
if x[0].kind_of? State
@@ -470,6 +479,8 @@ module REXML
@choice += 1
end
+ #puts "In next with #{event.inspect}."
+ #puts "events is #{@events.inspect}"
@events = [] unless @events
end
@@ -480,22 +491,29 @@ module REXML
return nil unless @events[@current]
expand_ref_in( @events, @current ) if @events[@current].class == Ref
+ #puts "In next with #{event.inspect}."
+ #puts "Next (#@current) is #{@events[@current]}"
if ( @events[@current].kind_of? State )
@current += 1
@events[@current-1].previous = self
return @events[@current-1].next( event )
end
+ #puts "Current isn't a state"
return @previous.pop.next( event ) if @events[@current].nil?
if ( @events[@current].matches?(event) )
@current += 1
if @events[@current].nil?
+ #puts "#{inspect[0,5]} 1RETURNING self" unless @choices[@choice].nil?
return self unless @choices[@choice].nil?
+ #puts "#{inspect[0,5]} 1RETURNING #{@previous[-1].inspect[0,5]}"
return @previous.pop
elsif @events[@current].kind_of? State
@current += 1
+ #puts "#{inspect[0,5]} 2RETURNING (#{@current-1}) #{@events[@current-1].inspect[0,5]}; on return, next is #{@events[@current]}"
@events[@current-1].previous = self
return @events[@current-1]
else
+ #puts "#{inspect[0,5]} RETURNING self w/ next(#@current) = #{@events[@current]}"
return self
end
else
@@ -509,6 +527,8 @@ module REXML
end
def expected
+ #puts "IN CHOICE EXPECTED"
+ #puts "EVENTS = #{@events.inspect}"
return [@events[@current]] if @events[@current]
return @choices[@choice..-1].collect do |x|
if x[0].kind_of? State
diff --git a/lib/rexml/validation/validation.rb b/lib/rexml/validation/validation.rb
index f0c76f976c..8042e5d062 100644
--- a/lib/rexml/validation/validation.rb
+++ b/lib/rexml/validation/validation.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/validation/validationexception'
module REXML
@@ -16,6 +15,8 @@ module REXML
puts @root.inspect
end
def validate( event )
+ #puts "Current: #@current"
+ #puts "Event: #{event.inspect}"
@attr_stack = [] unless defined? @attr_stack
match = @current.next(event)
raise ValidationException.new( "Validation error. Expected: "+
@@ -26,6 +27,7 @@ module REXML
# Check for attributes
case event[0]
when :start_element
+ #puts "Checking attributes"
@attr_stack << event[2]
begin
sattr = [:start_attribute, nil]
@@ -33,14 +35,22 @@ module REXML
text = [:text, nil]
k, = event[2].find { |key,value|
sattr[1] = key
+ #puts "Looking for #{sattr.inspect}"
m = @current.next( sattr )
+ #puts "Got #{m.inspect}"
if m
# If the state has text children...
+ #puts "Looking for #{eattr.inspect}"
+ #puts "Expect #{m.expected}"
if m.matches?( eattr )
+ #puts "Got end"
@current = m
else
+ #puts "Didn't get end"
text[1] = value
+ #puts "Looking for #{text.inspect}"
m = m.next( text )
+ #puts "Got #{m.inspect}"
text[1] = nil
return false unless m
@current = m if m
@@ -84,6 +94,7 @@ module REXML
end
def matches?( event )
+ #puts "#@event_type =? #{event[0]} && #@event_arg =? #{event[1]} "
return false unless event[0] == @event_type
case event[0]
when nil
diff --git a/lib/rexml/validation/validationexception.rb b/lib/rexml/validation/validationexception.rb
index 78cd63fd04..4723d9e4d3 100644
--- a/lib/rexml/validation/validationexception.rb
+++ b/lib/rexml/validation/validationexception.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
module Validation
class ValidationException < RuntimeError
diff --git a/lib/rexml/xmldecl.rb b/lib/rexml/xmldecl.rb
index a37e9f3ddc..465e6abeb7 100644
--- a/lib/rexml/xmldecl.rb
+++ b/lib/rexml/xmldecl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/encoding'
require 'rexml/source'
diff --git a/lib/rexml/xmltokens.rb b/lib/rexml/xmltokens.rb
index 392b47b1d3..4d4dd27f2d 100644
--- a/lib/rexml/xmltokens.rb
+++ b/lib/rexml/xmltokens.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module REXML
# Defines a number of tokens used for parsing XML. Not for general
# consumption.
diff --git a/lib/rexml/xpath.rb b/lib/rexml/xpath.rb
index f1cb99baea..0f99808def 100644
--- a/lib/rexml/xpath.rb
+++ b/lib/rexml/xpath.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/functions'
require 'rexml/xpath_parser'
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 181b2b6e85..367cbee1e8 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rexml/namespace'
require 'rexml/xmltokens'
require 'rexml/attribute'
@@ -17,7 +16,7 @@ class Symbol
# to use across multiple Object types
def dclone ; self ; end
end
-class Integer
+class Fixnum
# provides a unified +clone+ operation, for REXML::XPathParser
# to use across multiple Object types
def dclone ; self ; end
@@ -64,12 +63,18 @@ module REXML
end
def parse path, nodeset
+ #puts "#"*40
path_stack = @parser.parse( path )
+ #puts "PARSE: #{path} => #{path_stack.inspect}"
+ #puts "PARSE: nodeset = #{nodeset.inspect}"
match( path_stack, nodeset )
end
def get_first path, nodeset
+ #puts "#"*40
path_stack = @parser.parse( path )
+ #puts "PARSE: #{path} => #{path_stack.inspect}"
+ #puts "PARSE: nodeset = #{nodeset.inspect}"
first( path_stack, nodeset )
end
@@ -88,6 +93,7 @@ module REXML
#
# FIXME: This method is incomplete!
def first( path_stack, node )
+ #puts "#{depth}) Entering match( #{path.inspect}, #{tree.inspect} )"
return nil if path.size == 0
case path[0]
@@ -96,12 +102,16 @@ module REXML
return first( path[1..-1], node )
when :child
for c in node.children
+ #puts "#{depth}) CHILD checking #{name(c)}"
r = first( path[1..-1], c )
+ #puts "#{depth}) RETURNING #{r.inspect}" if r
return r if r
end
when :qname
name = path[2]
+ #puts "#{depth}) QNAME #{name(tree)} == #{name} (path => #{path.size})"
if node.name == name
+ #puts "#{depth}) RETURNING #{tree.inspect}" if path.size == 3
return node if path.size == 3
return first( path[3..-1], node )
else
@@ -124,7 +134,10 @@ module REXML
def match( path_stack, nodeset )
+ #puts "MATCH: path_stack = #{path_stack.inspect}"
+ #puts "MATCH: nodeset = #{nodeset.inspect}"
r = expr( path_stack, nodeset )
+ #puts "MAIN EXPR => #{r.inspect}"
r
end
@@ -151,9 +164,15 @@ module REXML
ALL = [ :attribute, :element, :text, :processing_instruction, :comment ]
ELEMENTS = [ :element ]
def expr( path_stack, nodeset, context=nil )
+ #puts "#"*15
+ #puts "In expr with #{path_stack.inspect}"
+ #puts "Returning" if path_stack.length == 0 || nodeset.length == 0
node_types = ELEMENTS
return nodeset if path_stack.length == 0 || nodeset.length == 0
while path_stack.length > 0
+ #puts "#"*5
+ #puts "Path stack = #{path_stack.inspect}"
+ #puts "Nodeset is #{nodeset.inspect}"
if nodeset.length == 0
path_stack.clear
return []
@@ -161,15 +180,21 @@ module REXML
case (op = path_stack.shift)
when :document
nodeset = [ nodeset[0].root_node ]
+ #puts ":document, nodeset = #{nodeset.inspect}"
when :qname
+ #puts "IN QNAME"
prefix = path_stack.shift
name = path_stack.shift
nodeset.delete_if do |node|
# FIXME: This DOUBLES the time XPath searches take
ns = get_namespace( node, prefix )
+ #puts "NS = #{ns.inspect}"
+ #puts "node.node_type == :element => #{node.node_type == :element}"
if node.node_type == :element
+ #puts "node.name == #{name} => #{node.name == name}"
if node.name == name
+ #puts "node.namespace == #{ns.inspect} => #{node.namespace == ns}"
end
end
!(node.node_type == :element and
@@ -179,7 +204,10 @@ module REXML
node_types = ELEMENTS
when :any
+ #puts "ANY 1: nodeset = #{nodeset.inspect}"
+ #puts "ANY 1: node_types = #{node_types.inspect}"
nodeset.delete_if { |node| !node_types.include?(node.node_type) }
+ #puts "ANY 2: nodeset = #{nodeset.inspect}"
when :self
# This space left intentionally blank
@@ -222,11 +250,15 @@ module REXML
name = path_stack.shift
for element in nodeset
if element.node_type == :element
+ #puts "Element name = #{element.name}"
+ #puts "get_namespace( #{element.inspect}, #{prefix} ) = #{get_namespace(element, prefix)}"
attrib = element.attribute( name, get_namespace(element, prefix) )
+ #puts "attrib = #{attrib.inspect}"
new_nodeset << attrib if attrib
end
end
when :any
+ #puts "ANY"
for element in nodeset
if element.node_type == :element
new_nodeset += element.attributes.to_a
@@ -236,8 +268,10 @@ module REXML
nodeset = new_nodeset
when :parent
+ #puts "PARENT 1: nodeset = #{nodeset}"
nodeset = nodeset.collect{|n| n.parent}.compact
#nodeset = expr(path_stack.dclone, nodeset.collect{|n| n.parent}.compact)
+ #puts "PARENT 2: nodeset = #{nodeset.inspect}"
node_types = ELEMENTS
when :ancestor
@@ -271,30 +305,41 @@ module REXML
pred = path_stack.shift
nodeset.each_with_index { |node, index|
subcontext[ :node ] = node
+ #puts "PREDICATE SETTING CONTEXT INDEX TO #{index+1}"
subcontext[ :index ] = index+1
pc = pred.dclone
+ #puts "#{node.hash}) Recursing with #{pred.inspect} and [#{node.inspect}]"
result = expr( pc, [node], subcontext )
result = result[0] if result.kind_of? Array and result.length == 1
+ #puts "#{node.hash}) Result = #{result.inspect} (#{result.class.name})"
if result.kind_of? Numeric
+ #puts "Adding node #{node.inspect}" if result == (index+1)
new_nodeset << node if result == (index+1)
elsif result.instance_of? Array
if result.size > 0 and result.inject(false) {|k,s| s or k}
+ #puts "Adding node #{node.inspect}" if result.size > 0
new_nodeset << node if result.size > 0
end
else
+ #puts "Adding node #{node.inspect}" if result
new_nodeset << node if result
end
}
+ #puts "New nodeset = #{new_nodeset.inspect}"
+ #puts "Path_stack = #{path_stack.inspect}"
nodeset = new_nodeset
=begin
predicate = path_stack.shift
ns = nodeset.clone
result = expr( predicate, ns )
+ #puts "Result = #{result.inspect} (#{result.class.name})"
+ #puts "nodeset = #{nodeset.inspect}"
if result.kind_of? Array
nodeset = result.zip(ns).collect{|m,n| n if m}.compact
else
nodeset = result ? nodeset : []
end
+ #puts "Outgoing NS = #{nodeset.inspect}"
=end
when :descendant_or_self
@@ -315,6 +360,7 @@ module REXML
node_types = ELEMENTS
when :following_sibling
+ #puts "FOLLOWING_SIBLING 1: nodeset = #{nodeset}"
results = []
nodeset.each do |node|
next if node.parent.nil?
@@ -323,6 +369,7 @@ module REXML
following_siblings = all_siblings[ current_index+1 .. -1 ]
results += expr( path_stack.dclone, following_siblings )
end
+ #puts "FOLLOWING_SIBLING 2: nodeset = #{nodeset}"
nodeset = results
when :preceding_sibling
@@ -342,6 +389,7 @@ module REXML
nodeset.each do |node|
new_nodeset += preceding( node )
end
+ #puts "NEW NODESET => #{new_nodeset.inspect}"
nodeset = new_nodeset
node_types = ELEMENTS
@@ -354,6 +402,7 @@ module REXML
node_types = ELEMENTS
when :namespace
+ #puts "In :namespace"
new_nodeset = []
prefix = path_stack.shift
nodeset.each do |node|
@@ -365,6 +414,9 @@ module REXML
else
namespaces = node.element.namesapces
end
+ #puts "Namespaces = #{namespaces.inspect}"
+ #puts "Prefix = #{prefix.inspect}"
+ #puts "Node.namespace = #{node.namespace}"
if (node.namespace == namespaces[prefix])
new_nodeset << node
end
@@ -382,18 +434,24 @@ module REXML
# :or and false for :and).
when :eq, :neq, :lt, :lteq, :gt, :gteq, :or
left = expr( path_stack.shift, nodeset.dup, context )
+ #puts "LEFT => #{left.inspect} (#{left.class.name})"
right = expr( path_stack.shift, nodeset.dup, context )
+ #puts "RIGHT => #{right.inspect} (#{right.class.name})"
res = equality_relational_compare( left, op, right )
+ #puts "RES => #{res.inspect}"
return res
when :and
left = expr( path_stack.shift, nodeset.dup, context )
+ #puts "LEFT => #{left.inspect} (#{left.class.name})"
return [] unless left
if left.respond_to?(:inject) and !left.inject(false) {|a,b| a | b}
return []
end
right = expr( path_stack.shift, nodeset.dup, context )
+ #puts "RIGHT => #{right.inspect} (#{right.class.name})"
res = equality_relational_compare( left, op, right )
+ #puts "RES => #{res.inspect}"
return res
when :div
@@ -434,6 +492,7 @@ module REXML
when :function
func_name = path_stack.shift.tr('-','_')
arguments = path_stack.shift
+ #puts "FUNCTION 0: #{func_name}(#{arguments.collect{|a|a.inspect}.join(', ')})"
subcontext = context ? nil : { :size => nodeset.size }
res = []
@@ -446,15 +505,19 @@ module REXML
end
arg_clone = arguments.dclone
args = arg_clone.collect { |arg|
+ #puts "FUNCTION 1: Calling expr( #{arg.inspect}, [#{n.inspect}] )"
expr( arg, [n], cont )
}
+ #puts "FUNCTION 2: #{func_name}(#{args.collect{|a|a.inspect}.join(', ')})"
Functions.context = cont
res << Functions.send( func_name, *args )
+ #puts "FUNCTION 3: #{res[-1].inspect}"
}
return res
end
end # while
+ #puts "EXPR returning #{nodeset.inspect}"
return nodeset
end
@@ -469,15 +532,21 @@ module REXML
def descendant_or_self( path_stack, nodeset )
rs = []
+ #puts "#"*80
+ #puts "PATH_STACK = #{path_stack.inspect}"
+ #puts "NODESET = #{nodeset.collect{|n|n.inspect}.inspect}"
d_o_s( path_stack, nodeset, rs )
+ #puts "RS = #{rs.collect{|n|n.inspect}.inspect}"
document_order(rs.flatten.compact)
#rs.flatten.compact
end
def d_o_s( p, ns, r )
+ #puts "IN DOS with #{ns.inspect}; ALREADY HAVE #{r.inspect}"
nt = nil
ns.each_index do |i|
n = ns[i]
+ #puts "P => #{p.inspect}"
x = expr( p.dclone, [ n ] )
nt = n.node_type
d_o_s( p, n.children, x ) if nt == :element or nt == :document and n.children.size > 0
@@ -505,6 +574,7 @@ module REXML
end
new_arry << [ node_idx.reverse, node ]
}
+ #puts "new_arry = #{new_arry.inspect}"
new_arry.sort{ |s1, s2| s1[0] <=> s2[0] }.collect{ |s| s[1] }
end
@@ -523,6 +593,7 @@ module REXML
# preceding:: includes every element in the document that precedes this node,
# except for ancestors
def preceding( node )
+ #puts "IN PRECEDING"
ancestors = []
p = node.parent
while p
@@ -532,6 +603,7 @@ module REXML
acc = []
p = preceding_node_of( node )
+ #puts "P = #{p.inspect}"
while p
if ancestors.include? p
ancestors.delete(p)
@@ -539,11 +611,15 @@ module REXML
acc << p
end
p = preceding_node_of( p )
+ #puts "P = #{p.inspect}"
end
acc
end
def preceding_node_of( node )
+ #puts "NODE: #{node.inspect}"
+ #puts "PREVIOUS NODE: #{node.previous_sibling_node.inspect}"
+ #puts "PARENT NODE: #{node.parent}"
psn = node.previous_sibling_node
if psn.nil?
if node.parent.nil? or node.parent.class == Document
@@ -559,16 +635,22 @@ module REXML
end
def following( node )
+ #puts "IN PRECEDING"
acc = []
p = next_sibling_node( node )
+ #puts "P = #{p.inspect}"
while p
acc << p
p = following_node_of( p )
+ #puts "P = #{p.inspect}"
end
acc
end
def following_node_of( node )
+ #puts "NODE: #{node.inspect}"
+ #puts "PREVIOUS NODE: #{node.previous_sibling_node.inspect}"
+ #puts "PARENT NODE: #{node.parent}"
if node.kind_of? Element and node.children.size > 0
return node.children[0]
end
@@ -583,6 +665,7 @@ module REXML
end
node = node.parent
psn = node.next_sibling_node
+ #puts "psn = #{psn.inspect}"
end
return psn
end
@@ -601,17 +684,22 @@ module REXML
end
def equality_relational_compare( set1, op, set2 )
+ #puts "EQ_REL_COMP(#{set1.inspect} #{op.inspect} #{set2.inspect})"
if set1.kind_of? Array and set2.kind_of? Array
+ #puts "#{set1.size} & #{set2.size}"
if set1.size == 1 and set2.size == 1
set1 = set1[0]
set2 = set2[0]
elsif set1.size == 0 or set2.size == 0
nd = set1.size==0 ? set2 : set1
rv = nd.collect { |il| compare( il, op, nil ) }
+ #puts "RV = #{rv.inspect}"
return rv
else
res = []
SyncEnumerator.new( set1, set2 ).each { |i1, i2|
+ #puts "i1 = #{i1.inspect} (#{i1.class.name})"
+ #puts "i2 = #{i2.inspect} (#{i2.class.name})"
i1 = norm( i1 )
i2 = norm( i2 )
res << compare( i1, op, i2 )
@@ -619,6 +707,8 @@ module REXML
return res
end
end
+ #puts "EQ_REL_COMP: #{set1.inspect} (#{set1.class.name}), #{op}, #{set2.inspect} (#{set2.class.name})"
+ #puts "COMPARING VALUES"
# If one is nodeset and other is number, compare number to each item
# in nodeset s.t. number op number(string(item))
# If one is nodeset and other is string, compare string to each item
@@ -626,6 +716,7 @@ module REXML
# If one is nodeset and other is boolean, compare boolean to each item
# in nodeset s.t. boolean op boolean(item)
if set1.kind_of? Array or set2.kind_of? Array
+ #puts "ISA ARRAY"
if set1.kind_of? Array
a = set1
b = set2
@@ -641,8 +732,10 @@ module REXML
return a.collect {|v| compare( Functions::number(v), op, b )}
when /^\d+(\.\d+)?$/
b = Functions::number( b )
+ #puts "B = #{b.inspect}"
return a.collect {|v| compare( Functions::number(v), op, b )}
else
+ #puts "Functions::string( #{b}(#{b.class.name}) ) = #{Functions::string(b)}"
b = Functions::string( b )
return a.collect { |v| compare( Functions::string(v), op, b ) }
end
@@ -656,7 +749,10 @@ module REXML
# Convert both to numbers and compare
s1 = set1.to_s
s2 = set2.to_s
+ #puts "EQ_REL_COMP: #{set1}=>#{s1}, #{set2}=>#{s2}"
if s1 == 'true' or s1 == 'false' or s2 == 'true' or s2 == 'false'
+ #puts "Functions::boolean(#{set1})=>#{Functions::boolean(set1)}"
+ #puts "Functions::boolean(#{set2})=>#{Functions::boolean(set2)}"
set1 = Functions::boolean( set1 )
set2 = Functions::boolean( set2 )
else
@@ -673,12 +769,15 @@ module REXML
set2 = Functions::number( set2 )
end
end
+ #puts "EQ_REL_COMP: #{set1} #{op} #{set2}"
+ #puts ">>> #{compare( set1, op, set2 )}"
return compare( set1, op, set2 )
end
return false
end
def compare a, op, b
+ #puts "COMPARE #{a.inspect}(#{a.class.name}) #{op} #{b.inspect}(#{b.class.name})"
case op
when :eq
a == b
diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb
index e762286d3b..d9cd3782a0 100644
--- a/lib/rinda/rinda.rb
+++ b/lib/rinda/rinda.rb
@@ -1,5 +1,5 @@
-# frozen_string_literal: false
require 'drb/drb'
+require 'thread'
##
# A module to implement the Linda distributed computing paradigm in Ruby.
diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb
index 34dc245122..fe33420494 100644
--- a/lib/rinda/ring.rb
+++ b/lib/rinda/ring.rb
@@ -1,9 +1,9 @@
-# frozen_string_literal: false
#
# Note: Rinda::Ring API is unstable.
#
require 'drb/drb'
require 'rinda/rinda'
+require 'thread'
require 'ipaddr'
module Rinda
@@ -134,6 +134,7 @@ module Rinda
socket = Socket.new(addrinfo.pfamily, addrinfo.socktype,
addrinfo.protocol)
+ @sockets << socket
if addrinfo.ipv4_multicast? or addrinfo.ipv6_multicast? then
if Socket.const_defined?(:SO_REUSEPORT) then
@@ -164,11 +165,6 @@ module Rinda
end
socket
- rescue
- socket = socket.close if socket
- raise
- ensure
- @sockets << socket if socket
end
##
@@ -388,7 +384,7 @@ module Rinda
# TupleSpaces can be found by calling +to_a+.
def lookup_ring_any(timeout=5)
- queue = Thread::Queue.new
+ queue = Queue.new
Thread.new do
self.lookup_ring(timeout) do |ts|
diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb
index 47860bc8ae..11532fd161 100644
--- a/lib/rinda/tuplespace.rb
+++ b/lib/rinda/tuplespace.rb
@@ -1,7 +1,8 @@
-# frozen_string_literal: false
require 'monitor'
+require 'thread'
require 'drb/drb'
require 'rinda/rinda'
+require 'enumerator'
require 'forwardable'
module Rinda
@@ -245,7 +246,7 @@ module Rinda
def initialize(place, event, tuple, expires=nil)
ary = [event, Rinda::Template.new(tuple)]
super(ary, expires)
- @queue = Thread::Queue.new
+ @queue = Queue.new
@done = false
end
diff --git a/lib/rss.rb b/lib/rss.rb
index 1c7d72b9f7..fd7364645b 100644
--- a/lib/rss.rb
+++ b/lib/rss.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
##
# = RSS reading and writing
#
diff --git a/lib/rss/0.9.rb b/lib/rss/0.9.rb
index d852a6a85e..77b2de131c 100644
--- a/lib/rss/0.9.rb
+++ b/lib/rss/0.9.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/parser"
module RSS
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb
index fb63937c5e..a2d88d459e 100644
--- a/lib/rss/1.0.rb
+++ b/lib/rss/1.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/parser"
module RSS
diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb
index 13f9ade918..5c0caecd73 100644
--- a/lib/rss/2.0.rb
+++ b/lib/rss/2.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/0.9"
module RSS
diff --git a/lib/rss/atom.rb b/lib/rss/atom.rb
index 38e927478c..d3524231ff 100644
--- a/lib/rss/atom.rb
+++ b/lib/rss/atom.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/parser'
module RSS
@@ -37,12 +36,10 @@ module RSS
end
klass.class_eval do
class << self
- # Returns the Atom URI W3C Namespace
def required_uri
URI
end
- # Returns true
def need_parent?
true
end
@@ -94,11 +91,9 @@ module RSS
end
# The TextConstruct module is used to define a Text construct Atom element,
- # which is used to store small quantities of human-readable text.
+ # which is used to store small quantities of human-readable text
#
# The TextConstruct has a type attribute, e.g. text, html, xhtml
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#text.constructs
module TextConstruct
def self.append_features(klass)
super
@@ -126,7 +121,6 @@ module RSS
attr_writer :xhtml
- # Returns or builds the XHTML content.
def xhtml
return @xhtml if @xhtml.nil?
if @xhtml.is_a?(XML::Element) and
@@ -140,13 +134,11 @@ module RSS
{"xmlns" => XHTML_URI}, children)
end
- # Returns true if type is "xhtml".
+ # Returns true if type is "xhtml"
def have_xml_content?
@type == "xhtml"
end
- # Raises a MissingTagError or NotExpectedTagError
- # if the element is not properly formatted.
def atom_validate(ignore_unknown_element, tags, uri)
if have_xml_content?
if @xhtml.nil?
@@ -170,12 +162,10 @@ module RSS
end
end
- # The PersonConstruct module is used to define a person Atom element that can be
- # used to describe a person, corporation or similar entity.
- #
- # The PersonConstruct has a Name, Uri and Email child elements.
+ # The PersonConstruct module is used to define a Person Atom element that can be
+ # used to describe a person, corporation, or similar entity
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#atomPersonConstruct
+ # The PersonConstruct has a Name, Uri, and Email child elements
module PersonConstruct
# Adds attributes for name, uri, and email to the +klass+
@@ -196,25 +186,19 @@ module RSS
target.__send__("new_#{self.class.name.split(/::/).last.downcase}")
end
- # The name of the person or entity.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.name
+ # The name of the person or entity
class Name < RSS::Element
include CommonModel
include ContentModel
end
- # The URI of the person or entity.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.uri
+ # The URI of the person or entity
class Uri < RSS::Element
include CommonModel
include URIContentModel
end
- # The email of the person or entity.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.email
+ # The email of the person or entity
class Email < RSS::Element
include CommonModel
include ContentModel
@@ -260,28 +244,9 @@ module RSS
end
end
- # Defines the top-level element of an Atom Feed Document.
- # It consists of a number of children Entry elements,
- # and has the following attributes:
+ # Atom feed element
#
- # * author
- # * categories
- # * category
- # * content
- # * contributor
- # * entries (aliased as items)
- # * entry
- # * generator
- # * icon
- # * id
- # * link
- # * logo
- # * rights
- # * subtitle
- # * title
- # * updated
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.feed
+ # A Feed has several metadata attributes in addition to a number of Entry child elements
class Feed < RSS::Element
include RootElementMixin
include CommonModel
@@ -356,23 +321,11 @@ module RSS
end
end
- # PersonConstruct that contains information regarding the author
- # of a Feed or Entry.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.author
class Author < RSS::Element
include CommonModel
include PersonConstruct
end
- # Contains information about a category associated with a Feed or Entry.
- # It has the following attributes:
- #
- # * term
- # * scheme
- # * label
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.category
class Category < RSS::Element
include CommonModel
@@ -390,18 +343,11 @@ module RSS
end
end
- # PersonConstruct that contains information regarding the
- # contributors of a Feed or Entry.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.contributor
class Contributor < RSS::Element
include CommonModel
include PersonConstruct
end
- # Contains information on the agent used to generate the feed.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.generator
class Generator < RSS::Element
include CommonModel
include ContentModel
@@ -422,34 +368,32 @@ module RSS
end
end
- # Defines an image that provides a visual identification for a eed.
- # The image should have an aspect ratio of 1:1.
+ # Atom Icon element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.icon
+ # Image that provides a visual identification for the Feed. Image should have an aspect
+ # ratio of 1:1
class Icon < RSS::Element
include CommonModel
include URIContentModel
end
- # Defines the Universally Unique Identifier (UUID) for a Feed or Entry.
+ # Atom ID element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.id
+ # Universally Unique Identifier (UUID) for the Feed
class Id < RSS::Element
include CommonModel
include URIContentModel
end
- # Defines a reference to a Web resource. It has the following
- # attributes:
+ # Defines an Atom Link element
#
+ # A Link has the following attributes:
# * href
# * rel
# * type
# * hreflang
# * title
# * length
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.link
class Link < RSS::Element
include CommonModel
@@ -470,10 +414,10 @@ module RSS
end
end
- # Defines an image that provides a visual identification for the Feed.
- # The image should have an aspect ratio of 2:1 (horizontal:vertical).
+ # Atom Logo element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.logo
+ # Image that provides a visual identification for the Feed. Image should have an aspect
+ # ratio of 2:1 (horizontal:vertical)
class Logo < RSS::Element
include CommonModel
include URIContentModel
@@ -488,60 +432,40 @@ module RSS
end
end
- # TextConstruct that contains copyright information regarding
- # the content in an Entry or Feed. It should not be used to
- # convey machine readable licensing information.
+ # Atom Rights element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.rights
+ # TextConstruct that contains copyright information regarding the content in an Entry or Feed
class Rights < RSS::Element
include CommonModel
include TextConstruct
end
- # TextConstruct that conveys a description or subtitle for a Feed.
+ # Atom Subtitle element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.subtitle
+ # TextConstruct that conveys a description or subtitle for a Feed
class Subtitle < RSS::Element
include CommonModel
include TextConstruct
end
- # TextConstruct that conveys a description or title for a Feed or Entry.
+ # Atom Title element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.title
+ # TextConstruct that conveys a description or title for a feed or Entry
class Title < RSS::Element
include CommonModel
include TextConstruct
end
- # DateConstruct indicating the most recent time when a Feed or
- # Entry was modified in a way the publisher considers
- # significant.
+ # Atom Updated element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.updated
+ # DateConstruct indicating the most recent time when an Entry or Feed was modified
+ # in a way the publisher considers significant
class Updated < RSS::Element
include CommonModel
include DateConstruct
end
- # Defines a child Atom Entry element of an Atom Feed element.
- # It has the following attributes:
- #
- # * author
- # * category
- # * categories
- # * content
- # * contributor
- # * id
- # * link
- # * published
- # * rights
- # * source
- # * summary
- # * title
- # * updated
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.entry
+ # Defines a child Atom Entry element for an Atom Feed
class Entry < RSS::Element
include CommonModel
include DuplicateLinkChecker
@@ -565,11 +489,9 @@ module RSS
tag, URI, occurs, tag, *args)
end
- # Returns whether any of the following are true:
- #
+ # Returns whether any of the following are true
# * There are any authors in the feed
- # * If the parent element has an author and the +check_parent+
- # parameter was given.
+ # * If the parent element has an author and the +check_parent+ parameter was given.
# * There is a source element that has an author
def have_author?(check_parent=true)
authors.any? {|author| !author.to_s.empty?} or
@@ -597,18 +519,9 @@ module RSS
items.new_item
end
- # Feed::Author
Author = Feed::Author
- # Feed::Category
Category = Feed::Category
- # Contains or links to the content of the Entry.
- # It has the following attributes:
- #
- # * type
- # * src
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.content
class Content < RSS::Element
include CommonModel
@@ -632,15 +545,11 @@ module RSS
content_setup
add_need_initialize_variable("xml")
- # Returns the element content in XML.
attr_writer :xml
-
- # Returns true if the element has inline XML content.
def have_xml_content?
inline_xhtml? or inline_other_xml?
end
- # Returns or builds the element content in XML.
def xml
return @xml unless inline_xhtml?
return @xml if @xml.nil?
@@ -655,7 +564,6 @@ module RSS
{"xmlns" => XHTML_URI}, children)
end
- # Returns the element content in XHTML.
def xhtml
if inline_xhtml?
xml
@@ -664,9 +572,6 @@ module RSS
end
end
- # Raises a MissingAttributeError, NotAvailableValueError,
- # MissingTagError or NotExpectedTagError if the element is
- # not properly formatted.
def atom_validate(ignore_unknown_element, tags, uri)
if out_of_line?
raise MissingAttributeError.new(tag_name, "type") if @type.nil?
@@ -683,27 +588,19 @@ module RSS
end
end
- # Returns true if the element contains inline content
- # that has a text or HTML media type, or no media type at all.
def inline_text?
!out_of_line? and [nil, "text", "html"].include?(@type)
end
- # Returns true if the element contains inline content that
- # has a HTML media type.
def inline_html?
return false if out_of_line?
@type == "html" or mime_split == ["text", "html"]
end
- # Returns true if the element contains inline content that
- # has a XHTML media type.
def inline_xhtml?
!out_of_line? and @type == "xhtml"
end
- # Returns true if the element contains inline content that
- # has a MIME media type.
def inline_other?
return false if out_of_line?
media_type, subtype = mime_split
@@ -711,8 +608,6 @@ module RSS
true
end
- # Returns true if the element contains inline content that
- # has a text media type.
def inline_other_text?
return false unless inline_other?
return false if inline_other_xml?
@@ -722,8 +617,6 @@ module RSS
false
end
- # Returns true if the element contains inline content that
- # has a XML media type.
def inline_other_xml?
return false unless inline_other?
@@ -738,18 +631,14 @@ module RSS
false
end
- # Returns true if the element contains inline content
- # encoded in base64.
def inline_other_base64?
inline_other? and !inline_other_text? and !inline_other_xml?
end
- # Returns true if the element contains linked content.
def out_of_line?
not @src.nil?
end
- # Splits the type attribute into an array, e.g. ["text", "xml"]
def mime_split
media_type = subtype = nil
if /\A\s*([a-z]+)\/([a-z\+]+)\s*(?:;.*)?\z/i =~ @type.to_s
@@ -759,7 +648,6 @@ module RSS
[media_type, subtype]
end
- # Returns true if the content needs to be encoded in base64.
def need_base64_encode?
inline_other_base64?
end
@@ -770,43 +658,17 @@ module RSS
end
end
- # Feed::Contributor
Contributor = Feed::Contributor
- # Feed::Id
Id = Feed::Id
- # Feed::Link
Link = Feed::Link
- # DateConstruct that usually indicates the time of the initial
- # creation of an Entry.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.published
class Published < RSS::Element
include CommonModel
include DateConstruct
end
- # Feed::Rights
Rights = Feed::Rights
- # Defines a Atom Source element. It has the following attributes:
- #
- # * author
- # * category
- # * categories
- # * content
- # * contributor
- # * generator
- # * icon
- # * id
- # * link
- # * logo
- # * rights
- # * subtitle
- # * title
- # * updated
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.source
class Source < RSS::Element
include CommonModel
@@ -829,71 +691,36 @@ module RSS
tag, URI, occurs, tag, *args)
end
- # Returns true if the Source element has an author.
def have_author?
!author.to_s.empty?
end
- # Feed::Author
Author = Feed::Author
- # Feed::Category
Category = Feed::Category
- # Feed::Contributor
Contributor = Feed::Contributor
- # Feed::Generator
Generator = Feed::Generator
- # Feed::Icon
Icon = Feed::Icon
- # Feed::Id
Id = Feed::Id
- # Feed::Link
Link = Feed::Link
- # Feed::Logo
Logo = Feed::Logo
- # Feed::Rights
Rights = Feed::Rights
- # Feed::Subtitle
Subtitle = Feed::Subtitle
- # Feed::Title
Title = Feed::Title
- # Feed::Updated
Updated = Feed::Updated
end
- # TextConstruct that describes a summary of the Entry.
- #
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.summary
class Summary < RSS::Element
include CommonModel
include TextConstruct
end
- # Feed::Title
Title = Feed::Title
- # Feed::Updated
Updated = Feed::Updated
end
end
- # Defines a top-level Atom Entry element,
- # used as the document element of a stand-alone Atom Entry Document.
- # It has the following attributes:
- #
- # * author
- # * category
- # * categories
- # * content
- # * contributor
- # * id
- # * link
- # * published
- # * rights
- # * source
- # * summary
- # * title
- # * updated
+ # Defines a top-level Atom Entry element
#
- # Reference: https://validator.w3.org/feed/docs/rfc4287.html#element.entry]
class Entry < RSS::Element
include RootElementMixin
include CommonModel
@@ -918,26 +745,25 @@ module RSS
tag, URI, occurs, tag, *args)
end
- # Creates a new Atom Entry element.
+ # Creates a new Atom Entry element
def initialize(version=nil, encoding=nil, standalone=nil)
super("1.0", version, encoding, standalone)
@feed_type = "atom"
@feed_subtype = "entry"
end
- # Returns the Entry in an array.
+ # Returns the Entry in an array
def items
[self]
end
- # Sets up the +maker+ for constructing Entry elements.
+ # sets up the +maker+ for constructing Entry elements
def setup_maker(maker)
maker = maker.maker if maker.respond_to?("maker")
super(maker)
end
- # Returns where there are any authors present or there is a
- # source with an author.
+ # Returns where there are any authors present or there is a source with an author
def have_author?
authors.any? {|author| !author.to_s.empty?} or
(source and source.have_author?)
@@ -959,29 +785,17 @@ module RSS
maker.items.new_item
end
- # Feed::Entry::Author
Author = Feed::Entry::Author
- # Feed::Entry::Category
Category = Feed::Entry::Category
- # Feed::Entry::Content
Content = Feed::Entry::Content
- # Feed::Entry::Contributor
Contributor = Feed::Entry::Contributor
- # Feed::Entry::Id
Id = Feed::Entry::Id
- # Feed::Entry::Link
Link = Feed::Entry::Link
- # Feed::Entry::Published
Published = Feed::Entry::Published
- # Feed::Entry::Rights
Rights = Feed::Entry::Rights
- # Feed::Entry::Source
Source = Feed::Entry::Source
- # Feed::Entry::Summary
Summary = Feed::Entry::Summary
- # Feed::Entry::Title
Title = Feed::Entry::Title
- # Feed::Entry::Updated
Updated = Feed::Entry::Updated
end
end
diff --git a/lib/rss/content.rb b/lib/rss/content.rb
index d35311075a..5a2120c067 100644
--- a/lib/rss/content.rb
+++ b/lib/rss/content.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/rss"
module RSS
diff --git a/lib/rss/content/1.0.rb b/lib/rss/content/1.0.rb
index 1367dfe092..e5dc857930 100644
--- a/lib/rss/content/1.0.rb
+++ b/lib/rss/content/1.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/1.0'
module RSS
diff --git a/lib/rss/content/2.0.rb b/lib/rss/content/2.0.rb
index 3b468248ac..8491a99937 100644
--- a/lib/rss/content/2.0.rb
+++ b/lib/rss/content/2.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/2.0"
module RSS
diff --git a/lib/rss/converter.rb b/lib/rss/converter.rb
index b92e35a051..3e79eba4fb 100644
--- a/lib/rss/converter.rb
+++ b/lib/rss/converter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/utils"
module RSS
diff --git a/lib/rss/dublincore.rb b/lib/rss/dublincore.rb
index 8d1a551947..58424141cd 100644
--- a/lib/rss/dublincore.rb
+++ b/lib/rss/dublincore.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/rss"
module RSS
diff --git a/lib/rss/dublincore/1.0.rb b/lib/rss/dublincore/1.0.rb
index 1d96fab9b9..efe2f5dad4 100644
--- a/lib/rss/dublincore/1.0.rb
+++ b/lib/rss/dublincore/1.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/1.0"
module RSS
diff --git a/lib/rss/dublincore/2.0.rb b/lib/rss/dublincore/2.0.rb
index e3011fef6a..a79c1e84a4 100644
--- a/lib/rss/dublincore/2.0.rb
+++ b/lib/rss/dublincore/2.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/2.0"
module RSS
diff --git a/lib/rss/dublincore/atom.rb b/lib/rss/dublincore/atom.rb
index 0b8b11e440..8db9066bb8 100644
--- a/lib/rss/dublincore/atom.rb
+++ b/lib/rss/dublincore/atom.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/atom"
module RSS
diff --git a/lib/rss/image.rb b/lib/rss/image.rb
index 6b86ec0e5b..b0619141bb 100644
--- a/lib/rss/image.rb
+++ b/lib/rss/image.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/1.0'
require 'rss/dublincore'
diff --git a/lib/rss/itunes.rb b/lib/rss/itunes.rb
index 987b090f21..e6de5c1ca2 100644
--- a/lib/rss/itunes.rb
+++ b/lib/rss/itunes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/2.0'
module RSS
@@ -51,7 +50,7 @@ module RSS
ELEMENT_INFOS = [["author"],
["block", :yes_other],
- ["explicit", :explicit_clean_other],
+ ["explicit", :yes_clean_other],
["keywords", :csv],
["subtitle"],
["summary"]]
diff --git a/lib/rss/maker.rb b/lib/rss/maker.rb
index 33d285f6af..824b2b2dcd 100644
--- a/lib/rss/maker.rb
+++ b/lib/rss/maker.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/rss"
module RSS
diff --git a/lib/rss/maker/0.9.rb b/lib/rss/maker/0.9.rb
index 622a4c30b4..c398343ec4 100644
--- a/lib/rss/maker/0.9.rb
+++ b/lib/rss/maker/0.9.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/0.9"
require "rss/maker/base"
diff --git a/lib/rss/maker/1.0.rb b/lib/rss/maker/1.0.rb
index 3aee77e913..1b9f7c3b79 100644
--- a/lib/rss/maker/1.0.rb
+++ b/lib/rss/maker/1.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/1.0"
require "rss/maker/base"
diff --git a/lib/rss/maker/2.0.rb b/lib/rss/maker/2.0.rb
index 1f77a014d1..15b1349c2a 100644
--- a/lib/rss/maker/2.0.rb
+++ b/lib/rss/maker/2.0.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/2.0"
require "rss/maker/0.9"
diff --git a/lib/rss/maker/atom.rb b/lib/rss/maker/atom.rb
index e0cd7623c8..fd3198cd9e 100644
--- a/lib/rss/maker/atom.rb
+++ b/lib/rss/maker/atom.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/atom"
require "rss/maker/base"
diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb
index bc4ca84141..0f2fc11103 100644
--- a/lib/rss/maker/base.rb
+++ b/lib/rss/maker/base.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'forwardable'
require 'rss/rss'
diff --git a/lib/rss/maker/content.rb b/lib/rss/maker/content.rb
index 3559a45ad0..46c4911f73 100644
--- a/lib/rss/maker/content.rb
+++ b/lib/rss/maker/content.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/content'
require 'rss/maker/1.0'
require 'rss/maker/2.0'
diff --git a/lib/rss/maker/dublincore.rb b/lib/rss/maker/dublincore.rb
index 988209c045..717b074fae 100644
--- a/lib/rss/maker/dublincore.rb
+++ b/lib/rss/maker/dublincore.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/dublincore'
require 'rss/maker/1.0'
diff --git a/lib/rss/maker/entry.rb b/lib/rss/maker/entry.rb
index f806cbcaae..f8f5469f2c 100644
--- a/lib/rss/maker/entry.rb
+++ b/lib/rss/maker/entry.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/maker/atom"
require "rss/maker/feed"
diff --git a/lib/rss/maker/feed.rb b/lib/rss/maker/feed.rb
index fdef7ad643..0129218b0c 100644
--- a/lib/rss/maker/feed.rb
+++ b/lib/rss/maker/feed.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/maker/atom"
module RSS
diff --git a/lib/rss/maker/image.rb b/lib/rss/maker/image.rb
index 1957ba8689..06084b4af4 100644
--- a/lib/rss/maker/image.rb
+++ b/lib/rss/maker/image.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/image'
require 'rss/maker/1.0'
require 'rss/maker/dublincore'
diff --git a/lib/rss/maker/itunes.rb b/lib/rss/maker/itunes.rb
index d964a4d942..8b7420da3c 100644
--- a/lib/rss/maker/itunes.rb
+++ b/lib/rss/maker/itunes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/itunes'
require 'rss/maker/2.0'
@@ -13,8 +12,8 @@ module RSS
klass.def_other_element(full_name)
when :yes_other
def_yes_other_accessor(klass, full_name)
- when :explicit_clean_other
- def_explicit_clean_other_accessor(klass, full_name)
+ when :yes_clean_other
+ def_yes_clean_other_accessor(klass, full_name)
when :csv
def_csv_accessor(klass, full_name)
when :element, :attribute
@@ -43,11 +42,11 @@ module RSS
EOC
end
- def def_explicit_clean_other_accessor(klass, full_name)
+ def def_yes_clean_other_accessor(klass, full_name)
klass.def_other_element(full_name)
klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
def #{full_name}?
- Utils::ExplicitCleanOther.parse(#{full_name})
+ Utils::YesCleanOther.parse(#{full_name})
end
EOC
end
diff --git a/lib/rss/maker/slash.rb b/lib/rss/maker/slash.rb
index 3bd82d3057..27adef3832 100644
--- a/lib/rss/maker/slash.rb
+++ b/lib/rss/maker/slash.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/slash'
require 'rss/maker/1.0'
diff --git a/lib/rss/maker/syndication.rb b/lib/rss/maker/syndication.rb
index 840b70229a..b81230457c 100644
--- a/lib/rss/maker/syndication.rb
+++ b/lib/rss/maker/syndication.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/syndication'
require 'rss/maker/1.0'
diff --git a/lib/rss/maker/taxonomy.rb b/lib/rss/maker/taxonomy.rb
index 76a2d1600d..13ae9aa805 100644
--- a/lib/rss/maker/taxonomy.rb
+++ b/lib/rss/maker/taxonomy.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/taxonomy'
require 'rss/maker/1.0'
require 'rss/maker/dublincore'
diff --git a/lib/rss/maker/trackback.rb b/lib/rss/maker/trackback.rb
index f97691c608..00f001cb85 100644
--- a/lib/rss/maker/trackback.rb
+++ b/lib/rss/maker/trackback.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/trackback'
require 'rss/maker/1.0'
require 'rss/maker/2.0'
diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb
index a9842e6d40..1b6e4e9596 100644
--- a/lib/rss/parser.rb
+++ b/lib/rss/parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "forwardable"
require "open-uri"
diff --git a/lib/rss/rexmlparser.rb b/lib/rss/rexmlparser.rb
index ef0595e447..a5a2a2edbe 100644
--- a/lib/rss/rexmlparser.rb
+++ b/lib/rss/rexmlparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rexml/document"
require "rexml/streamlistener"
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index db87e11ad5..4f6732b4d2 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "time"
class Time
@@ -54,7 +53,7 @@ class Time
if usec.zero?
fraction_digits = 0
else
- fraction_digits = strftime('%6N').index(/0*\z/)
+ fraction_digits = Math.log10(usec.to_s.sub(/0*$/, '').to_i).floor + 1
end
xmlschema(fraction_digits)
end
@@ -326,6 +325,7 @@ EOC
def inherit_convert_attr_reader(*attrs)
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, *get_file_and_line_from_caller(2))
def #{attr}_without_inherit
convert(@#{attr})
@@ -346,6 +346,7 @@ EOC
def uri_convert_attr_reader(*attrs)
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, *get_file_and_line_from_caller(2))
def #{attr}_without_base
convert(@#{attr})
@@ -366,6 +367,7 @@ EOC
def convert_attr_reader(*attrs)
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, *get_file_and_line_from_caller(2))
def #{attr}
convert(@#{attr})
@@ -374,12 +376,13 @@ EOC
end
end
- def explicit_clean_other_attr_reader(*attrs)
+ def yes_clean_other_attr_reader(*attrs)
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
attr_reader(:#{attr})
def #{attr}?
- ExplicitCleanOther.parse(@#{attr})
+ YesCleanOther.parse(@#{attr})
end
EOC
end
@@ -387,6 +390,7 @@ EOC
def yes_other_attr_reader(*attrs)
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
attr_reader(:#{attr})
def #{attr}?
@@ -404,6 +408,7 @@ EOC
end
separator ||= ", "
attrs.each do |attr|
+ attr = attr.id2name if attr.kind_of?(Integer)
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
attr_reader(:#{attr})
def #{attr}_content
@@ -544,7 +549,7 @@ EOC
EOC
end
- def explicit_clean_other_writer(name, disp_name=name)
+ def yes_clean_other_writer(name, disp_name=name)
module_eval(<<-EOC, __FILE__, __LINE__ + 1)
def #{name}=(value)
value = (value ? "yes" : "no") if [true, false].include?(value)
@@ -596,10 +601,11 @@ EOC
def #{accessor_name}=(*args)
receiver = self.class.name
- warn("Don't use `\#{receiver}\##{accessor_name} = XXX'/" \
+ warn("Warning:\#{caller.first.sub(/:in `.*'\z/, '')}: " \
+ "Don't use `\#{receiver}\##{accessor_name} = XXX'/" \
"`\#{receiver}\#set_#{accessor_name}(XXX)'. " \
"Those APIs are not sense of Ruby. " \
- "Use `\#{receiver}\##{plural_name} << XXX' instead of them.", uplevel: 1)
+ "Use `\#{receiver}\##{plural_name} << XXX' instead of them.")
if args.size == 1
@#{accessor_name}.push(args[0])
else
@@ -762,8 +768,8 @@ EOC
text_type_writer name, disp_name
when :content
content_writer name, disp_name
- when :explicit_clean_other
- explicit_clean_other_writer name, disp_name
+ when :yes_clean_other
+ yes_clean_other_writer name, disp_name
when :yes_other
yes_other_writer name, disp_name
when :csv
@@ -781,8 +787,8 @@ EOC
inherit_convert_attr_reader name
when :uri
uri_convert_attr_reader name
- when :explicit_clean_other
- explicit_clean_other_attr_reader name
+ when :yes_clean_other
+ yes_clean_other_attr_reader name
when :yes_other
yes_other_attr_reader name
when :csv
@@ -956,7 +962,7 @@ EOC
children = child
children.any? {|c| c.have_required_elements?}
else
- not child.nil?
+ !child.to_s.empty?
end
else
true
@@ -1234,7 +1240,7 @@ EOC
__send__(self.class.xml_getter).to_s
else
_content = content
- _content = [_content].pack("m0") if need_base64_encode?
+ _content = [_content].pack("m").delete("\n") if need_base64_encode?
h(_content)
end
end
diff --git a/lib/rss/slash.rb b/lib/rss/slash.rb
index 0055fc9f88..65c61142e1 100644
--- a/lib/rss/slash.rb
+++ b/lib/rss/slash.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'rss/1.0'
module RSS
diff --git a/lib/rss/syndication.rb b/lib/rss/syndication.rb
index 8f9620f9f3..77a84b9a2a 100644
--- a/lib/rss/syndication.rb
+++ b/lib/rss/syndication.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/1.0"
module RSS
@@ -48,7 +47,7 @@ module RSS
private
SY_UPDATEPERIOD_AVAILABLE_VALUES = %w(hourly daily weekly monthly yearly)
- def validate_sy_updatePeriod(value) # :nodoc:
+ def validate_sy_updatePeriod(value)
unless SY_UPDATEPERIOD_AVAILABLE_VALUES.include?(value)
raise NotAvailableValueError.new("updatePeriod", value)
end
diff --git a/lib/rss/taxonomy.rb b/lib/rss/taxonomy.rb
index b7ea219e8c..b7fbe6b0de 100644
--- a/lib/rss/taxonomy.rb
+++ b/lib/rss/taxonomy.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/1.0"
require "rss/dublincore"
diff --git a/lib/rss/trackback.rb b/lib/rss/trackback.rb
index 1a3c3849b5..577bf0cef7 100644
--- a/lib/rss/trackback.rb
+++ b/lib/rss/trackback.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# This file contains the implementation of trackbacks. It is entirely internal
# and not useful to outside developers.
require 'rss/1.0'
diff --git a/lib/rss/utils.rb b/lib/rss/utils.rb
index 9203df9a9b..b420e6b24c 100644
--- a/lib/rss/utils.rb
+++ b/lib/rss/utils.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
module RSS
##
@@ -125,16 +124,16 @@ module RSS
[true, false].include?(args[0]) and args[1].is_a?(Hash)
end
- module ExplicitCleanOther
+ module YesCleanOther
module_function
def parse(value)
if [true, false, nil].include?(value)
value
else
case value.to_s
- when /\Aexplicit|yes|true\z/i
+ when /\Ayes\z/i
true
- when /\Aclean|no|false\z/i
+ when /\Aclean\z/i
false
else
nil
diff --git a/lib/rss/xml-stylesheet.rb b/lib/rss/xml-stylesheet.rb
index be9cfaaf64..96ee95050e 100644
--- a/lib/rss/xml-stylesheet.rb
+++ b/lib/rss/xml-stylesheet.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/utils"
module RSS
diff --git a/lib/rss/xml.rb b/lib/rss/xml.rb
index cda8668044..1ae878b772 100644
--- a/lib/rss/xml.rb
+++ b/lib/rss/xml.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require "rss/utils"
module RSS
diff --git a/lib/rss/xmlparser.rb b/lib/rss/xmlparser.rb
index cb2dd2afdd..46df94a320 100644
--- a/lib/rss/xmlparser.rb
+++ b/lib/rss/xmlparser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
begin
require "xml/parser"
rescue LoadError
diff --git a/lib/rss/xmlscanner.rb b/lib/rss/xmlscanner.rb
index 6e3b13d2f5..1cdf81c0c3 100644
--- a/lib/rss/xmlscanner.rb
+++ b/lib/rss/xmlscanner.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'xmlscan/scanner'
require 'stringio'
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index f3671d9f2a..453520665a 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# -*- ruby -*-
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
@@ -10,7 +9,7 @@ require 'rbconfig'
require 'thread'
module Gem
- VERSION = "2.7.6.2"
+ VERSION = '2.4.1'
end
# Must be first since it unloads the prelude from 1.9.2
@@ -27,19 +26,19 @@ require 'rubygems/errors'
# For user documentation, see:
#
# * <tt>gem help</tt> and <tt>gem help [command]</tt>
-# * {RubyGems User Guide}[http://guides.rubygems.org/]
-# * {Frequently Asked Questions}[http://guides.rubygems.org/faqs]
+# * {RubyGems User Guide}[http://docs.rubygems.org/read/book/1]
+# * {Frequently Asked Questions}[http://docs.rubygems.org/read/book/3]
#
# For gem developer documentation see:
#
-# * {Creating Gems}[http://guides.rubygems.org/make-your-own-gem]
+# * {Creating Gems}[http://docs.rubygems.org/read/chapter/5]
# * Gem::Specification
# * Gem::Version for version dependency notes
#
# Further RubyGems documentation can be found at:
#
# * {RubyGems Guides}[http://guides.rubygems.org]
-# * {RubyGems API}[http://www.rubydoc.info/github/rubygems/rubygems] (also available from
+# * {RubyGems API}[http://rubygems.rubyforge.org/rdoc] (also available from
# <tt>gem server</tt>)
#
# == RubyGems Plugins
@@ -47,14 +46,15 @@ require 'rubygems/errors'
# As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or
# $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and
# placed at the root of your gem's #require_path. Plugins are discovered via
-# Gem::find_files and then loaded.
+# Gem::find_files then loaded. Take care when implementing a plugin as your
+# plugin file may be loaded multiple times if multiple versions of your gem
+# are installed.
#
-# For an example plugin, see the {Graph gem}[https://github.com/seattlerb/graph]
-# which adds a `gem graph` command.
+# For an example plugin, see the graph gem which adds a `gem graph` command.
#
# == RubyGems Defaults, Packaging
#
-# RubyGems defaults are stored in lib/rubygems/defaults.rb. If you're packaging
+# RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging
# RubyGems or implementing Ruby you can change RubyGems' defaults.
#
# For RubyGems packagers, provide lib/rubygems/defaults/operating_system.rb
@@ -64,7 +64,7 @@ require 'rubygems/errors'
# override any defaults from lib/rubygems/defaults.rb.
#
# If you need RubyGems to perform extra work on install or uninstall, your
-# defaults override file can set pre/post install and uninstall hooks.
+# defaults override file can set pre and post install and uninstall hooks.
# See Gem::pre_install, Gem::pre_uninstall, Gem::post_install,
# Gem::post_uninstall.
#
@@ -105,8 +105,6 @@ require 'rubygems/errors'
#
# (If your name is missing, PLEASE let us know!)
#
-# == License
-#
# See {LICENSE.txt}[rdoc-ref:lib/rubygems/LICENSE.txt] for permissions.
#
# Thanks!
@@ -131,7 +129,6 @@ module Gem
GEM_DEP_FILES = %w[
gem.deps.rb
- gems.rb
Gemfile
Isolate
]
@@ -156,32 +153,9 @@ module Gem
specifications/default
]
- ##
- # Exception classes used in a Gem.read_binary +rescue+ statement. Not all of
- # these are defined in Ruby 1.8.7, hence the need for this convoluted setup.
-
- READ_BINARY_ERRORS = begin
- read_binary_errors = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS]
- read_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
- read_binary_errors
- end.freeze
-
- ##
- # Exception classes used in Gem.write_binary +rescue+ statement. Not all of
- # these are defined in Ruby 1.8.7.
-
- WRITE_BINARY_ERRORS = begin
- write_binary_errors = [Errno::ENOSYS]
- write_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
- write_binary_errors
- end.freeze
-
- USE_BUNDLER_FOR_GEMDEPS = false # :nodoc:
-
@@win_platform = nil
@configuration = nil
- @gemdeps = nil
@loaded_specs = {}
LOADED_SPECS_MUTEX = Mutex.new
@path_to_default_spec_map = {}
@@ -210,19 +184,18 @@ module Gem
# or if it was ambiguous (and thus unresolved) the code in our custom
# require will try to activate the more specific version.
- spec = Gem::Specification.find_by_path path
- return false unless spec
- return true if spec.activated?
+ spec = Gem::Specification.find_inactive_by_path path
+
+ unless spec
+ spec = Gem::Specification.find_by_path path
+ return true if spec && spec.activated?
+ return false
+ end
begin
spec.activate
- rescue Gem::LoadError => e # this could fail due to gem dep collisions, go lax
- spec_by_name = Gem::Specification.find_by_name(spec.name)
- if spec_by_name.nil?
- raise e
- else
- spec_by_name.activate
- end
+ rescue Gem::LoadError # this could fail due to gem dep collisions, go lax
+ Gem::Specification.find_by_name(spec.name).activate
end
return true
@@ -238,7 +211,6 @@ module Gem
def self.finish_resolve(request_set=Gem::RequestSet.new)
request_set.import Gem::Specification.unresolved_deps.values
- request_set.import Gem.loaded_specs.values.map {|s| Gem::Dependency.new(s.name, s.version) }
request_set.resolve_current.each do |s|
s.full_spec.activate
@@ -260,51 +232,20 @@ module Gem
requirements = Gem::Requirement.default if
requirements.empty?
- find_spec_for_exe(name, exec_name, requirements).bin_file exec_name
- end
-
- def self.find_spec_for_exe name, exec_name, requirements
- dep = Gem::Dependency.new name, requirements
-
- loaded = Gem.loaded_specs[name]
+ specs = Gem::Dependency.new(name, requirements).matching_specs(true)
- return loaded if loaded && dep.matches_spec?(loaded)
-
- specs = dep.matching_specs(true)
+ raise Gem::GemNotFoundException,
+ "can't find gem #{name} (#{requirements})" if specs.empty?
specs = specs.find_all { |spec|
spec.executables.include? exec_name
} if exec_name
- unless spec = specs.first
- msg = "can't find gem #{dep} with executable #{exec_name}"
- if name == "bundler" && bundler_message = Gem::BundlerVersionFinder.missing_version_message
- msg = bundler_message
- end
+ unless spec = specs.last
+ msg = "can't find gem #{name} (#{requirements}) with executable #{exec_name}"
raise Gem::GemNotFoundException, msg
end
- spec
- end
- private_class_method :find_spec_for_exe
-
- ##
- # Find the full path to the executable for gem +name+. If the +exec_name+
- # is not given, the gem's default_executable is chosen, otherwise the
- # specified executable's path is returned. +requirements+ allows
- # you to specify specific gem versions.
- #
- # A side effect of this method is that it will activate the gem that
- # contains the executable.
- #
- # This method should *only* be used in bin stub files.
-
- def self.activate_bin_path name, exec_name, requirement # :nodoc:
- spec = find_spec_for_exe name, exec_name, [requirement]
- Gem::LOADED_SPECS_MUTEX.synchronize do
- spec.activate
- finish_resolve
- end
spec.bin_file exec_name
end
@@ -363,14 +304,11 @@ module Gem
# package is not available as a gem, return nil.
def self.datadir(gem_name)
+# TODO: deprecate and move to Gem::Specification
+# and drop the extra ", gem_name" which is uselessly redundant
spec = @loaded_specs[gem_name]
return nil if spec.nil?
- spec.datadir
- end
-
- class << self
- extend Gem::Deprecate
- deprecate :datadir, "spec.datadir", 2016, 10
+ File.join spec.full_gem_path, "data", gem_name
end
##
@@ -385,39 +323,16 @@ module Gem
# lookup files.
def self.paths
- @paths ||= Gem::PathSupport.new(ENV)
+ @paths ||= Gem::PathSupport.new
end
# Initialize the filesystem paths to use from +env+.
# +env+ is a hash-like object (typically ENV) that
# is queried for 'GEM_HOME', 'GEM_PATH', and 'GEM_SPEC_CACHE'
- # Keys for the +env+ hash should be Strings, and values of the hash should
- # be Strings or +nil+.
def self.paths=(env)
clear_paths
- target = {}
- env.each_pair do |k,v|
- case k
- when 'GEM_HOME', 'GEM_PATH', 'GEM_SPEC_CACHE'
- case v
- when nil, String
- target[k] = v
- when Array
- unless Gem::Deprecate.skip
- warn <<-eowarn
-Array values in the parameter to `Gem.paths=` are deprecated.
-Please use a String or nil.
-An Array (#{env.inspect}) was passed in from #{caller[3]}
- eowarn
- end
- target[k] = v.join File::PATH_SEPARATOR
- end
- else
- target[k] = v
- end
- end
- @paths = Gem::PathSupport.new ENV.to_hash.merge(target)
+ @paths = Gem::PathSupport.new env
Gem::Specification.dirs = @paths.path
end
@@ -512,9 +427,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
files = find_files_from_load_path glob if check_load_path
- gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs
-
- files.concat gem_specifications.map { |spec|
+ files.concat Gem::Specification.map { |spec|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
}.flatten
@@ -605,6 +518,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Zlib::GzipReader wrapper that unzips +data+.
def self.gunzip(data)
+ require 'rubygems/util'
Gem::Util.gunzip data
end
@@ -612,6 +526,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Zlib::GzipWriter wrapper that zips +data+.
def self.gzip(data)
+ require 'rubygems/util'
Gem::Util.gzip data
end
@@ -619,6 +534,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# A Zlib::Inflate#inflate wrapper
def self.inflate(data)
+ require 'rubygems/util'
Gem::Util.inflate data
end
@@ -658,10 +574,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# gem's paths are inserted before site lib directory by default.
def self.load_path_insert_index
- $LOAD_PATH.each_with_index do |path, i|
- return i if path.instance_variable_defined?(:@gem_prelude_index)
- end
-
index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir']
index
@@ -678,12 +590,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
test_syck = ENV['TEST_SYCK']
- # Only Ruby 1.8 and 1.9 have syck
- test_syck = false unless /^1\./ =~ RUBY_VERSION
-
unless test_syck
begin
- gem 'psych', '>= 2.0.0'
+ gem 'psych', '~> 1.2', '>= 1.2.1'
rescue Gem::LoadError
# It's OK if the user does not have the psych gem installed. We will
# attempt to require the stdlib version
@@ -707,7 +616,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end
require 'yaml'
- require 'rubygems/safe_yaml'
# If we're supposed to be using syck, then we may have to force
# activate it via the YAML::ENGINE API.
@@ -724,20 +632,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
##
# The file name and line number of the caller of the caller of this method.
- #
- # +depth+ is how many layers up the call stack it should go.
- #
- # e.g.,
- #
- # def a; Gem.location_of_caller; end
- # a #=> ["x.rb", 2] # (it'll vary depending on file name and line number)
- #
- # def b; c; end
- # def c; Gem.location_of_caller(2); end
- # b #=> ["x.rb", 6] # (it'll vary depending on file name and line number)
- def self.location_of_caller(depth = 1)
- caller[depth] =~ /(.*?):(\d+).*?$/i
+ def self.location_of_caller
+ caller[1] =~ /(.*?):(\d+).*?$/i
file = $1
lineno = $2.to_i
@@ -866,42 +763,14 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Safely read a file in binary mode on all platforms.
def self.read_binary(path)
- File.open path, 'rb+' do |f|
+ open path, 'rb+' do |f|
f.flock(File::LOCK_EX)
f.read
end
- rescue *READ_BINARY_ERRORS
- File.open path, 'rb' do |f|
+ rescue Errno::EACCES
+ open path, 'rb' do |f|
f.read
end
- rescue Errno::ENOLCK # NFS
- if Thread.main != Thread.current
- raise
- else
- File.open path, 'rb' do |f|
- f.read
- end
- end
- end
-
- ##
- # Safely write a file in binary mode on all platforms.
- def self.write_binary(path, data)
- open(path, 'wb') do |io|
- begin
- io.flock(File::LOCK_EX)
- rescue *WRITE_BINARY_ERRORS
- end
- io.write data
- end
- rescue Errno::ENOLCK # NFS
- if Thread.main != Thread.current
- raise
- else
- open(path, 'wb') do |io|
- io.write data
- end
- end
end
##
@@ -925,15 +794,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
@ruby_api_version ||= RbConfig::CONFIG['ruby_version'].dup
end
- def self.env_requirement(gem_name)
- @env_requirements_by_name ||= {}
- @env_requirements_by_name[gem_name] ||= begin
- req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || '>= 0'.freeze
- Gem::Requirement.create(req)
- end
- end
- post_reset { @env_requirements_by_name = {} }
-
##
# Returns the latest release-version specification for the gem +name+.
@@ -992,8 +852,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# default_sources if the sources list is empty.
def self.sources
- source_list = configuration.sources || default_sources
- @sources ||= Gem::SourceList.from(source_list)
+ @sources ||= Gem::SourceList.from(default_sources)
end
##
@@ -1062,11 +921,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# by the unit tests to provide environment isolation.
def self.use_paths(home, *paths)
- paths.flatten!
- paths.compact!
- hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) }
- hash.delete_if { |_, v| v.nil? }
- self.paths = hash
+ paths = nil if paths == [nil]
+ paths = paths.first if Array === Array(paths).first
+ self.paths = { "GEM_HOME" => home, "GEM_PATH" => paths }
end
##
@@ -1168,6 +1025,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
path = path.dup
if path == "-" then
+ require 'rubygems/util'
+
Gem::Util.traverse_parents Dir.pwd do |directory|
dep_file = GEM_DEP_FILES.find { |f| File.file?(f) }
@@ -1186,36 +1045,18 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
raise ArgumentError, "Unable to find gem dependencies file at #{path}"
end
- if USE_BUNDLER_FOR_GEMDEPS
-
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
- require 'rubygems/user_interaction'
- Gem::DefaultUserInteraction.use_ui(ui) do
- require "bundler"
- @gemdeps = Bundler.setup
- Bundler.ui = nil
- @gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
- end
-
- else
-
- rs = Gem::RequestSet.new
- @gemdeps = rs.load_gemdeps path
-
- rs.resolve_current.map do |s|
- s.full_spec.tap(&:activate)
- end
+ rs = Gem::RequestSet.new
+ rs.load_gemdeps path
+ rs.resolve_current.map do |s|
+ sp = s.full_spec
+ sp.activate
+ sp
end
- rescue => e
- case e
- when Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError)
- warn e.message
- warn "You may need to `gem install -g` to install missing gems"
- warn ""
- else
- raise
- end
+ rescue Gem::LoadError, Gem::UnsatisfiableDependencyError => e
+ warn e.message
+ warn "You may need to `gem install -g` to install missing gems"
+ warn ""
end
class << self
@@ -1236,12 +1077,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
attr_reader :loaded_specs
##
- # GemDependencyAPI object, which is set when .use_gemdeps is called.
- # This contains all the information from the Gemfile.
-
- attr_reader :gemdeps
-
- ##
# Register a Gem::Specification for default gem.
#
# Two formats for the specification are supported:
@@ -1261,8 +1096,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
prefix_pattern = /^(#{prefix_group})/
end
- suffix_pattern = /#{Regexp.union(Gem.suffixes)}\z/
-
spec.files.each do |file|
if new_format
file = file.sub(prefix_pattern, "")
@@ -1270,7 +1103,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end
@path_to_default_spec_map[file] = spec
- @path_to_default_spec_map[file.sub(suffix_pattern, "")] = spec
end
end
@@ -1278,7 +1110,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Find a Gem::Specification of default gem from +path+
def find_unresolved_default_spec(path)
- @path_to_default_spec_map[path]
+ Gem.suffixes.each do |suffix|
+ spec = @path_to_default_spec_map["#{path}#{suffix}"]
+ return spec if spec
+ end
+ nil
end
##
@@ -1349,13 +1185,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
- autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder'
autoload :ConfigFile, 'rubygems/config_file'
autoload :Dependency, 'rubygems/dependency'
autoload :DependencyList, 'rubygems/dependency_list'
autoload :DependencyResolver, 'rubygems/resolver'
autoload :Installer, 'rubygems/installer'
- autoload :Licenses, 'rubygems/util/licenses'
autoload :PathSupport, 'rubygems/path_support'
autoload :Platform, 'rubygems/platform'
autoload :RequestSet, 'rubygems/request_set'
@@ -1365,7 +1199,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
autoload :SourceList, 'rubygems/source_list'
autoload :SpecFetcher, 'rubygems/spec_fetcher'
autoload :Specification, 'rubygems/specification'
- autoload :Util, 'rubygems/util'
autoload :Version, 'rubygems/version'
require "rubygems/specification"
@@ -1403,3 +1236,4 @@ require 'rubygems/core_ext/kernel_gem'
require 'rubygems/core_ext/kernel_require'
Gem.use_gemdeps
+
diff --git a/lib/rubygems/LICENSE.txt b/lib/rubygems/LICENSE.txt
new file mode 100644
index 0000000000..8a0a51dec1
--- /dev/null
+++ b/lib/rubygems/LICENSE.txt
@@ -0,0 +1,54 @@
+RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim
+Weirich and others. You can redistribute it and/or modify it under
+either the terms of the MIT license (see the file MIT.txt), 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. 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.
+
+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. The scripts and library files supplied as input to or produced as
+ output from the software do not automatically fall under the
+ copyright of the software, but belong to whomever generated them,
+ and may be sold commercially, and may be aggregated with this
+ software.
+
+6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE.
+
diff --git a/lib/rubygems/available_set.rb b/lib/rubygems/available_set.rb
index 49b5d5fd06..dae254b385 100644
--- a/lib/rubygems/available_set.rb
+++ b/lib/rubygems/available_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class Gem::AvailableSet
include Enumerable
diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb
index 72954a7863..f9eb193fb4 100644
--- a/lib/rubygems/basic_specification.rb
+++ b/lib/rubygems/basic_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# BasicSpecification is an abstract class which implements some common code
# used by both Specification and StubSpecification.
@@ -23,30 +22,18 @@ class Gem::BasicSpecification
##
# The path this gemspec was loaded from. This attribute is not persisted.
- attr_accessor :loaded_from
+ attr_reader :loaded_from
##
# Allows correct activation of git: and path: gems.
attr_writer :full_gem_path # :nodoc:
- def initialize
- internal_init
- end
-
def self.default_specifications_dir
File.join(Gem.default_dir, "specifications", "default")
end
##
- # The path to the gem.build_complete file within the extension install
- # directory.
-
- def gem_build_complete_path # :nodoc:
- File.join extension_dir, 'gem.build_complete'
- end
-
- ##
# True when the gem has been activated
def activated?
@@ -59,24 +46,35 @@ class Gem::BasicSpecification
# eg: /usr/local/lib/ruby/gems/1.8
def base_dir
- raise NotImplementedError
+ return Gem.dir unless loaded_from
+ @base_dir ||= if default_gem? then
+ File.dirname File.dirname File.dirname loaded_from
+ else
+ File.dirname File.dirname loaded_from
+ end
end
##
# Return true if this spec can require +file+.
def contains_requirable_file? file
- if @ignored then
+ if instance_variable_defined?(:@ignored) or
+ instance_variable_defined?('@ignored') then
return false
elsif missing_extensions? then
@ignored = true
- warn "Ignoring #{full_name} because its extensions are not built. " +
- "Try: gem pristine #{name} --version #{version}"
+ warn "Ignoring #{full_name} because its extensions are not built. " +
+ "Try: gem pristine #{full_name}"
return false
end
- have_file? file, Gem.suffixes
+ suffixes = Gem.suffixes
+
+ full_require_paths.any? do |dir|
+ base = "#{dir}/#{file}"
+ suffixes.any? { |suf| File.file? "#{base}#{suf}" }
+ end
end
def default_gem?
@@ -88,14 +86,14 @@ class Gem::BasicSpecification
# Returns full path to the directory where gem's extensions are installed.
def extension_dir
- @extension_dir ||= File.expand_path(File.join(extensions_dir, full_name)).untaint
+ @extension_dir ||= File.expand_path File.join(extensions_dir, full_name)
end
##
# Returns path to the extensions directory.
def extensions_dir
- Gem.default_ext_dir_for(base_dir) ||
+ @extensions_dir ||= Gem.default_ext_dir_for(base_dir) ||
File.join(base_dir, 'extensions', Gem::Platform.local.to_s,
Gem.extension_api_version)
end
@@ -104,7 +102,7 @@ class Gem::BasicSpecification
# TODO: also, shouldn't it default to full_name if it hasn't been written?
path = File.expand_path File.join(gems_dir, full_name)
path.untaint
- path
+ path if File.directory? path
end
private :find_full_gem_path
@@ -125,9 +123,9 @@ class Gem::BasicSpecification
def full_name
if platform == Gem::Platform::RUBY or platform.nil? then
- "#{name}-#{version}".dup.untaint
+ "#{name}-#{version}".untaint
else
- "#{name}-#{version}-#{platform}".dup.untaint
+ "#{name}-#{version}-#{platform}".untaint
end
end
@@ -136,46 +134,13 @@ class Gem::BasicSpecification
# activated.
def full_require_paths
- @full_require_paths ||=
- begin
- full_paths = raw_require_paths.map do |path|
- File.join full_gem_path, path.untaint
- end
-
- full_paths << extension_dir if have_extensions?
-
- full_paths
+ full_paths = raw_require_paths.map do |path|
+ File.join full_gem_path, path
end
- end
- ##
- # The path to the data directory for this gem.
-
- def datadir
-# TODO: drop the extra ", gem_name" which is uselessly redundant
- File.expand_path(File.join(gems_dir, full_name, "data", name)).untaint
- end
+ full_paths.unshift extension_dir unless @extensions.nil? || @extensions.empty?
- ##
- # Full path of the target library file.
- # If the file is not in this gem, return nil.
-
- def to_fullpath path
- if activated? then
- @paths_map ||= {}
- @paths_map[path] ||=
- begin
- fullpath = nil
- suffixes = Gem.suffixes
- suffixes.find do |suf|
- full_require_paths.find do |dir|
- File.file?(fullpath = "#{dir}/#{path}#{suf}")
- end
- end ? fullpath : nil
- end
- else
- nil
- end
+ full_paths
end
##
@@ -191,14 +156,23 @@ class Gem::BasicSpecification
# gem directory. eg: /usr/local/lib/ruby/1.8/gems
def gems_dir
- raise NotImplementedError
+ # TODO: this logic seems terribly broken, but tests fail if just base_dir
+ @gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
end
- def internal_init # :nodoc:
+ ##
+ # Set the path the Specification was loaded from. +path+ is converted to a
+ # String.
+
+ def loaded_from= path
+ @loaded_from = path && path.to_s
+
@extension_dir = nil
+ @extensions_dir = nil
@full_gem_path = nil
@gem_dir = nil
- @ignored = nil
+ @gems_dir = nil
+ @base_dir = nil
end
##
@@ -216,7 +190,7 @@ class Gem::BasicSpecification
end
def raw_require_paths # :nodoc:
- raise NotImplementedError
+ Array(@require_paths)
end
##
@@ -237,7 +211,7 @@ class Gem::BasicSpecification
# spec.require_path = '.'
def require_paths
- return raw_require_paths unless have_extensions?
+ return raw_require_paths if @extensions.nil? || @extensions.empty?
[extension_dir].concat raw_require_paths
end
@@ -249,8 +223,8 @@ class Gem::BasicSpecification
def source_paths
paths = raw_require_paths.dup
- if have_extensions? then
- ext_dirs = extensions.map do |extension|
+ if @extensions then
+ ext_dirs = @extensions.map do |extension|
extension.split(File::SEPARATOR, 2).first
end.uniq
@@ -261,34 +235,6 @@ class Gem::BasicSpecification
end
##
- # Return all files in this gem that match for +glob+.
-
- def matches_for_glob glob # TODO: rename?
- # TODO: do we need these?? Kill it
- glob = File.join(self.lib_dirs_glob, glob)
-
- Dir[glob].map { |f| f.untaint } # FIX our tests are broken, run w/ SAFE=1
- end
-
- ##
- # Returns a string usable in Dir.glob to match all requirable paths
- # for this spec.
-
- def lib_dirs_glob
- dirs = if self.raw_require_paths
- if self.raw_require_paths.size > 1 then
- "{#{self.raw_require_paths.join(',')}}"
- else
- self.raw_require_paths.first
- end
- else
- "lib" # default value for require_paths for bundler/inline
- end
-
- "#{self.full_gem_path}/#{dirs}".dup.untaint
- end
-
- ##
# Return a Gem::Specification from this gem
def to_spec
@@ -310,23 +256,5 @@ class Gem::BasicSpecification
raise NotImplementedError
end
- def this; self; end
-
- private
-
- def have_extensions?; !extensions.empty?; end
-
- def have_file? file, suffixes
- return true if raw_require_paths.any? do |path|
- base = File.join(gems_dir, full_name, path.untaint, file).untaint
- suffixes.any? { |suf| File.file? base + suf }
- end
-
- if have_extensions?
- base = File.join extension_dir, file
- suffixes.any? { |suf| File.file? base + suf }
- else
- false
- end
- end
end
+
diff --git a/lib/rubygems/bundler_version_finder.rb b/lib/rubygems/bundler_version_finder.rb
deleted file mode 100644
index ba25399d1e..0000000000
--- a/lib/rubygems/bundler_version_finder.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-module Gem::BundlerVersionFinder
-
- def self.bundler_version
- version, _ = bundler_version_with_reason
-
- return unless version
-
- Gem::Version.new(version)
- end
-
- def self.bundler_version_with_reason
- if v = ENV["BUNDLER_VERSION"]
- return [v, "`$BUNDLER_VERSION`"]
- end
- if v = bundle_update_bundler_version
- return if v == true
- return [v, "`bundle update --bundler`"]
- end
- v, lockfile = lockfile_version
- if v
- return [v, "your #{lockfile}"]
- end
- end
-
- def self.missing_version_message
- return unless vr = bundler_version_with_reason
- <<-EOS
-Could not find 'bundler' (#{vr.first}) required by #{vr.last}.
-To update to the latest version installed on your system, run `bundle update --bundler`.
-To install the missing version, run `gem install bundler:#{vr.first}`
- EOS
- end
-
- def self.compatible?(spec)
- return true unless spec.name == "bundler".freeze
- return true unless bundler_version = self.bundler_version
-
- spec.version.segments.first == bundler_version.segments.first
- end
-
- def self.filter!(specs)
- return unless bundler_version = self.bundler_version
-
- specs.reject! { |spec| spec.version.segments.first != bundler_version.segments.first }
- end
-
- def self.bundle_update_bundler_version
- return unless File.basename($0) == "bundle".freeze
- return unless "update".start_with?(ARGV.first || " ")
- bundler_version = nil
- update_index = nil
- ARGV.each_with_index do |a, i|
- if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
- bundler_version = a
- end
- next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
- bundler_version = $1 || true
- update_index = i
- end
- bundler_version
- end
- private_class_method :bundle_update_bundler_version
-
- def self.lockfile_version
- return unless lockfile = lockfile_contents
- lockfile, contents = lockfile
- lockfile ||= "lockfile"
- regexp = /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
- return unless contents =~ regexp
- [$1, lockfile]
- end
- private_class_method :lockfile_version
-
- def self.lockfile_contents
- gemfile = ENV["BUNDLE_GEMFILE"]
- gemfile = nil if gemfile && gemfile.empty?
- Gem::Util.traverse_parents Dir.pwd do |directory|
- next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.untaint) }
-
- gemfile = File.join directory, gemfile
- break
- end unless gemfile
-
- return unless gemfile
-
- lockfile = case gemfile
- when "gems.rb" then "gems.locked"
- else "#{gemfile}.lock"
- end.untaint
-
- return unless File.file?(lockfile)
-
- [lockfile, File.read(lockfile)]
- end
- private_class_method :lockfile_contents
-end
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb
index a7ec212e51..0c6abec56c 100644
--- a/lib/rubygems/command.rb
+++ b/lib/rubygems/command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -154,7 +153,7 @@ class Gem::Command
def show_lookup_failure(gem_name, version, errors, domain)
if errors and !errors.empty?
- msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n".dup
+ msg = "Could not find a valid gem '#{gem_name}' (#{version}), here is why:\n"
errors.each { |x| msg << " #{x.wordy}\n" }
alert_error msg
else
@@ -300,11 +299,6 @@ class Gem::Command
options[:build_args] = build_args
- if options[:silent]
- old_ui = self.ui
- self.ui = ui = Gem::SilentUI.new
- end
-
if options[:help] then
show_help
elsif @when_invoked then
@@ -312,11 +306,6 @@ class Gem::Command
else
execute
end
- ensure
- if ui
- self.ui = old_ui
- ui.close
- end
end
##
@@ -530,15 +519,10 @@ class Gem::Command
end
end
- add_common_option('-q', '--quiet', 'Silence command progress meter') do |value, options|
+ add_common_option('-q', '--quiet', 'Silence commands') do |value, options|
Gem.configuration.verbose = false
end
- add_common_option("--silent",
- "Silence RubyGems output") do |value, options|
- options[:silent] = true
- end
-
# Backtrace and config-file are added so they show up in the help
# commands. Both options are actually handled before the other
# options get parsed.
@@ -555,11 +539,6 @@ class Gem::Command
'Turn on Ruby debugging') do
end
- add_common_option('--norc',
- 'Avoid loading any .gemrc file') do
- end
-
-
# :stopdoc:
HELP = <<-HELP
@@ -600,3 +579,4 @@ end
module Gem::Commands
end
+
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
index 3bee1c30a4..53d18c29cc 100644
--- a/lib/rubygems/command_manager.rb
+++ b/lib/rubygems/command_manager.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -7,7 +6,6 @@
require 'rubygems/command'
require 'rubygems/user_interaction'
-require 'rubygems/text'
##
# The command manager registers and installs all the individual sub-commands
@@ -33,7 +31,6 @@ require 'rubygems/text'
class Gem::CommandManager
- include Gem::Text
include Gem::UserInteraction
BUILTIN_COMMANDS = [ # :nodoc:
@@ -60,8 +57,6 @@ class Gem::CommandManager
:rdoc,
:search,
:server,
- :signin,
- :signout,
:sources,
:specification,
:stale,
@@ -142,12 +137,12 @@ class Gem::CommandManager
def run(args, build_args=nil)
process_args(args, build_args)
rescue StandardError, Timeout::Error => ex
- alert_error clean_text("While executing gem ... (#{ex.class})\n #{ex}")
+ alert_error "While executing gem ... (#{ex.class})\n #{ex}"
ui.backtrace ex
terminate_interaction(1)
rescue Interrupt
- alert_error clean_text("Interrupted")
+ alert_error "Interrupted"
terminate_interaction(1)
end
@@ -165,7 +160,7 @@ class Gem::CommandManager
say Gem::VERSION
terminate_interaction 0
when /^-/ then
- alert_error clean_text("Invalid option: #{args.first}. See 'gem --help'.")
+ alert_error "Invalid option: #{args.first}. See 'gem --help'."
terminate_interaction 1
else
cmd_name = args.shift.downcase
@@ -214,7 +209,7 @@ class Gem::CommandManager
rescue Exception => e
e = load_error if load_error
- alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
+ alert_error "Loading command: #{command_name} (#{e.class})\n\t#{e}"
ui.backtrace e
end
end
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb
index 38c45e46f0..d975429fe8 100644
--- a/lib/rubygems/commands/build_command.rb
+++ b/lib/rubygems/commands/build_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/package'
@@ -42,10 +41,6 @@ with gem spec:
def execute
gemspec = get_one_gem_name
- unless File.exist? gemspec
- gemspec += '.gemspec' if File.exist? gemspec + '.gemspec'
- end
-
if File.exist? gemspec then
spec = Gem::Specification.load gemspec
diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb
index 5542262a50..a920e7fcc3 100644
--- a/lib/rubygems/commands/cert_command.rb
+++ b/lib/rubygems/commands/cert_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/security'
begin
@@ -84,11 +83,6 @@ class Gem::Commands::CertCommand < Gem::Command
options[:sign] << cert_file
end
-
- add_option('-d', '--days NUMBER_OF_DAYS',
- 'Days before the certificate expires') do |days, options|
- options[:expiration_length_days] = days.to_i
- end
end
def add_certificate certificate # :nodoc:
@@ -110,20 +104,16 @@ class Gem::Commands::CertCommand < Gem::Command
list_certificates_matching filter
end
- options[:build].each do |email|
- build email
+ options[:build].each do |name|
+ build name
end
sign_certificates unless options[:sign].empty?
end
- def build email
- if !valid_email?(email)
- raise Gem::CommandLineError, "Invalid email address #{email}"
- end
-
+ def build name
key, key_path = build_key
- cert_path = build_cert email, key
+ cert_path = build_cert name, key
say "Certificate: #{cert_path}"
@@ -133,16 +123,8 @@ class Gem::Commands::CertCommand < Gem::Command
end
end
- def build_cert email, key # :nodoc:
- expiration_length_days = options[:expiration_length_days]
- age =
- if expiration_length_days.nil? || expiration_length_days == 0
- Gem::Security::ONE_YEAR
- else
- Gem::Security::ONE_DAY * expiration_length_days
- end
-
- cert = Gem::Security.create_cert_email email, key, age
+ def build_cert name, key # :nodoc:
+ cert = Gem::Security.create_cert_email name, key
Gem::Security.write cert, "gem-public_cert.pem"
end
@@ -290,13 +272,5 @@ For further reading on signing gems see `ri Gem::Security`.
end
end
- private
-
- def valid_email? email
- # It's simple, but is all we need
- email =~ /\A.+@.+\z/
- end
-
-
end if defined?(OpenSSL::SSL)
diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb
index 818cb05f55..8893b9c3b2 100644
--- a/lib/rubygems/commands/check_command.rb
+++ b/lib/rubygems/commands/check_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/version_option'
require 'rubygems/validator'
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb
index 79c23c840d..69975640fe 100644
--- a/lib/rubygems/commands/cleanup_command.rb
+++ b/lib/rubygems/commands/cleanup_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/dependency_list'
require 'rubygems/uninstaller'
@@ -8,20 +7,13 @@ class Gem::Commands::CleanupCommand < Gem::Command
def initialize
super 'cleanup',
'Clean up old versions of installed gems',
- :force => false, :install_dir => Gem.dir,
- :check_dev => true
+ :force => false, :install_dir => Gem.dir
add_option('-n', '-d', '--dryrun',
'Do not uninstall gems') do |value, options|
options[:dryrun] = true
end
- add_option('-D', '--[no-]check-development',
- 'Check development dependencies while uninstalling',
- '(default: true)') do |value, options|
- options[:check_dev] = value
- end
-
@candidate_gems = nil
@default_gems = []
@full = nil
@@ -73,7 +65,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
clean_gems
end
- say "Clean up complete"
+ say "Clean Up Complete"
verbose do
skipped = @default_gems.map { |spec| spec.full_name }
@@ -83,9 +75,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
end
def clean_gems
- @original_home = Gem.dir
- @original_path = Gem.path
-
get_primary_gems
get_candidate_gems
get_gems_to_cleanup
@@ -97,6 +86,9 @@ If no gems are named all gems in GEM_HOME are cleaned.
deps = deplist.strongly_connected_components.flatten
+ @original_home = Gem.dir
+ @original_path = Gem.path
+
deps.reverse_each do |spec|
uninstall_dep spec
end
@@ -115,7 +107,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
end
def get_gems_to_cleanup
-
gems_to_cleanup = @candidate_gems.select { |spec|
@primary_gems[spec.name].version != spec.version
}
@@ -124,10 +115,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
spec.default_gem?
}
- gems_to_cleanup = gems_to_cleanup.select { |spec|
- spec.base_dir == @original_home
- }
-
@default_gems += default_gems
@default_gems.uniq!
@gems_to_cleanup = gems_to_cleanup.uniq
@@ -145,7 +132,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
end
def uninstall_dep spec
- return unless @full.ok_to_remove?(spec.full_name, options[:check_dev])
+ return unless @full.ok_to_remove?(spec.full_name)
if options[:dryrun] then
say "Dry Run Mode: Would uninstall #{spec.full_name}"
diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb
index e0f2eedb5d..15657f31a2 100644
--- a/lib/rubygems/commands/contents_command.rb
+++ b/lib/rubygems/commands/contents_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'English'
require 'rubygems/command'
require 'rubygems/version_option'
@@ -103,7 +102,7 @@ prefix or only the files that are requireable.
end
def files_in_default_gem spec
- spec.files.map do |file|
+ spec.files.sort.map do |file|
case file
when /\A#{spec.bindir}\//
[RbConfig::CONFIG['bindir'], $POSTMATCH]
@@ -147,6 +146,7 @@ prefix or only the files that are requireable.
def path_description spec_dirs # :nodoc:
if spec_dirs.empty? then
+ spec_dirs = Gem::Specification.dirs
"default gem paths"
else
"specified path"
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb
index 97fd812ffa..4a54a3e385 100644
--- a/lib/rubygems/commands/dependency_command.rb
+++ b/lib/rubygems/commands/dependency_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
@@ -62,16 +61,10 @@ use with other commands.
ss.map { |spec, _| spec }
end
- def fetch_specs name_pattern, dependency # :nodoc:
+ def fetch_specs dependency # :nodoc:
specs = []
- if local?
- specs.concat Gem::Specification.stubs.find_all { |spec|
- name_pattern =~ spec.name and
- dependency.requirement.satisfied_by? spec.version
- }.map(&:to_spec)
- end
-
+ specs.concat dependency.matching_specs if local?
specs.concat fetch_remote_specs dependency if remote?
ensure_specs specs
@@ -79,7 +72,16 @@ use with other commands.
specs.uniq.sort
end
- def gem_dependency pattern, version, prerelease # :nodoc:
+ def gem_dependency args, version, prerelease # :nodoc:
+ args << '' if args.empty?
+
+ pattern = if args.length == 1 and args.first =~ /\A\/(.*)\/(i)?\z/m then
+ flags = $2 ? Regexp::IGNORECASE : nil
+ Regexp.new $1, flags
+ else
+ /\A#{Regexp.union(*args)}/
+ end
+
dependency = Gem::Deprecate.skip_during {
Gem::Dependency.new pattern, version
}
@@ -100,7 +102,7 @@ use with other commands.
end
def display_readable specs, reverse # :nodoc:
- response = String.new
+ response = ''
specs.each do |spec|
response << print_dependencies(spec)
@@ -119,12 +121,10 @@ use with other commands.
def execute
ensure_local_only_reverse_dependencies
- pattern = name_pattern options[:args]
-
dependency =
- gem_dependency pattern, options[:version], options[:prerelease]
+ gem_dependency options[:args], options[:version], options[:prerelease]
- specs = fetch_specs pattern, dependency
+ specs = fetch_specs dependency
reverse = reverse_dependencies specs
@@ -153,7 +153,7 @@ use with other commands.
end
def print_dependencies(spec, level = 0) # :nodoc:
- response = String.new
+ response = ''
response << ' ' * level + "Gem #{spec.full_name}\n"
unless spec.dependencies.empty? then
spec.dependencies.sort_by { |dep| dep.name }.each do |dep|
@@ -203,16 +203,5 @@ use with other commands.
result
end
- private
-
- def name_pattern args
- args << '' if args.empty?
-
- if args.length == 1 and args.first =~ /\A\/(.*)\/(i)?\z/m then
- flags = $2 ? Regexp::IGNORECASE : nil
- Regexp.new $1, flags
- else
- /\A#{Regexp.union(*args)}/
- end
- end
end
+
diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb
index e825c761ad..067d0b1607 100644
--- a/lib/rubygems/commands/environment_command.rb
+++ b/lib/rubygems/commands/environment_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Commands::EnvironmentCommand < Gem::Command
@@ -72,7 +71,7 @@ lib/rubygems/defaults/operating_system.rb
end
def execute
- out = String.new
+ out = ''
arg = options[:args][0]
out <<
case arg
@@ -104,7 +103,7 @@ lib/rubygems/defaults/operating_system.rb
end
def show_environment # :nodoc:
- out = "RubyGems Environment:\n".dup
+ out = "RubyGems Environment:\n"
out << " - RUBYGEMS VERSION: #{Gem::VERSION}\n"
@@ -114,8 +113,6 @@ lib/rubygems/defaults/operating_system.rb
out << " - INSTALLATION DIRECTORY: #{Gem.dir}\n"
- out << " - USER INSTALLATION DIRECTORY: #{Gem.user_dir}\n"
-
out << " - RUBYGEMS PREFIX: #{Gem.prefix}\n" unless Gem.prefix.nil?
out << " - RUBY EXECUTABLE: #{Gem.ruby}\n"
@@ -158,3 +155,4 @@ lib/rubygems/defaults/operating_system.rb
end
end
+
diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb
index 19559a7774..c57ab0089a 100644
--- a/lib/rubygems/commands/fetch_command.rb
+++ b/lib/rubygems/commands/fetch_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
diff --git a/lib/rubygems/commands/generate_index_command.rb b/lib/rubygems/commands/generate_index_command.rb
index 0b677b73a9..ca6f694bc5 100644
--- a/lib/rubygems/commands/generate_index_command.rb
+++ b/lib/rubygems/commands/generate_index_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/indexer'
@@ -68,7 +67,7 @@ Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
if not File.exist?(options[:directory]) or
not File.directory?(options[:directory]) then
- alert_error "unknown directory name #{options[:directory]}."
+ alert_error "unknown directory name #{directory}."
terminate_interaction 1
else
indexer = Gem::Indexer.new options.delete(:directory), options
diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb
index 7d02022369..ed81ad6e25 100644
--- a/lib/rubygems/commands/help_command.rb
+++ b/lib/rubygems/commands/help_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Commands::HelpCommand < Gem::Command
@@ -177,7 +176,7 @@ dependencies file.:
Ruby Version and Engine Dependency
==================================
-You can specify the version, engine and engine version of ruby to use with
+You can specifiy the version, engine and engine version of ruby to use with
your gem dependencies file. If you are not running the specified version
RubyGems will raise an exception.
@@ -224,7 +223,7 @@ The #group method can also be used to place gems in groups:
The #group method allows multiple groups.
The #gemspec development dependencies are placed in the :development group by
-default. This may be overridden with the :development_group option:
+default. This may be overriden with the :development_group option:
gemspec development_group: :other
@@ -367,7 +366,17 @@ platform.
elsif possibilities.size > 1 then
alert_warning "Ambiguous command #{command_name} (#{possibilities.join(', ')})"
else
- alert_warning "Unknown command #{command_name}. Try: gem help commands"
+ alert_warning "Unknown command #{command_name}. Try: gem help commands"
+ end
+ end
+
+ def show_help # :nodoc:
+ command = @command_manager[options[:help]]
+ if command then
+ # help with provided command
+ command.invoke("--help")
+ else
+ alert_error "Unknown command #{options[:help]}. Try 'gem help commands'"
end
end
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 3a7d50517f..1bf5928ebb 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/install_update_options'
require 'rubygems/dependency_installer'
@@ -36,6 +35,52 @@ class Gem::Commands::InstallCommand < Gem::Command
add_version_option
add_prerelease_option "to be installed. (Only for listed gems)"
+ add_option(:"Install/Update", '-g', '--file [FILE]',
+ 'Read from a gem dependencies API file and',
+ 'install the listed gems') do |v,o|
+ v = Gem::GEM_DEP_FILES.find do |file|
+ File.exist? file
+ end unless v
+
+ unless v then
+ message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"
+
+ raise OptionParser::InvalidArgument,
+ "cannot find gem dependencies file #{message}"
+ end
+
+ o[:gemdeps] = v
+ end
+
+ add_option(:"Install/Update", '--without GROUPS', Array,
+ 'Omit the named groups (comma separated)',
+ 'when installing from a gem dependencies',
+ 'file') do |v,o|
+ o[:without_groups].concat v.map { |without| without.intern }
+ end
+
+ add_option(:"Install/Update", '--default',
+ 'Add the gem\'s full specification to',
+ 'specifications/default and extract only its bin') do |v,o|
+ o[:install_as_default] = v
+ end
+
+ add_option(:"Install/Update", '--explain',
+ 'Rather than install the gems, indicate which would',
+ 'be installed') do |v,o|
+ o[:explain] = v
+ end
+
+ add_option(:"Install/Update", '--[no-]lock',
+ 'Create a lock file (when used with -g/--file)') do |v,o|
+ o[:lock] = v
+ end
+
+ add_option(:"Install/Update", '--[no-]suggestions',
+ 'Suggest alternates when gems are not found') do |v,o|
+ o[:suggest_alternate] = v
+ end
+
@installed_specs = []
end
@@ -140,7 +185,6 @@ to write the specification by hand. For example:
end
def execute
-
if options.include? :gemdeps then
install_from_gemdeps
return # not reached
@@ -231,7 +275,7 @@ to write the specification by hand. For example:
gem = fetcher.download_to_cache dependency
end
- inst = Gem::Installer.at gem, options
+ inst = Gem::Installer.new gem, options
inst.install
require 'rubygems/dependency_installer'
diff --git a/lib/rubygems/commands/list_command.rb b/lib/rubygems/commands/list_command.rb
index 1acb49e5fb..c6ff237311 100644
--- a/lib/rubygems/commands/list_command.rb
+++ b/lib/rubygems/commands/list_command.rb
@@ -1,10 +1,9 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/commands/query_command'
##
# An alternate to Gem::Commands::QueryCommand that searches for gems starting
-# with the supplied argument.
+# with the the supplied argument.
class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
@@ -34,7 +33,7 @@ To search for remote gems use the search command.
end
def usage # :nodoc:
- "#{program_name} [REGEXP ...]"
+ "#{program_name} [STRING ...]"
end
end
diff --git a/lib/rubygems/commands/lock_command.rb b/lib/rubygems/commands/lock_command.rb
index 3eebfadc05..6b4b25a281 100644
--- a/lib/rubygems/commands/lock_command.rb
+++ b/lib/rubygems/commands/lock_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Commands::LockCommand < Gem::Command
diff --git a/lib/rubygems/commands/mirror_command.rb b/lib/rubygems/commands/mirror_command.rb
index 801c9c8927..75419c857a 100644
--- a/lib/rubygems/commands/mirror_command.rb
+++ b/lib/rubygems/commands/mirror_command.rb
@@ -1,26 +1,23 @@
-# frozen_string_literal: true
require 'rubygems/command'
-unless defined? Gem::Commands::MirrorCommand
- class Gem::Commands::MirrorCommand < Gem::Command
- def initialize
- super('mirror', 'Mirror all gem files (requires rubygems-mirror)')
- begin
- Gem::Specification.find_by_name('rubygems-mirror').activate
- rescue Gem::LoadError
- # no-op
- end
+class Gem::Commands::MirrorCommand < Gem::Command
+ def initialize
+ super('mirror', 'Mirror all gem files (requires rubygems-mirror)')
+ begin
+ Gem::Specification.find_by_name('rubygems-mirror').activate
+ rescue Gem::LoadError
+ # no-op
end
+ end
- def description # :nodoc:
- <<-EOF
+ def description # :nodoc:
+ <<-EOF
The mirror command has been moved to the rubygems-mirror gem.
- EOF
- end
-
- def execute
- alert_error "Install the rubygems-mirror gem for the mirror command"
- end
+ EOF
+ end
+ def execute
+ alert_error "Install the rubygems-mirror gem for the mirror command"
end
+
end
diff --git a/lib/rubygems/commands/open_command.rb b/lib/rubygems/commands/open_command.rb
index 059635e835..91963bba73 100644
--- a/lib/rubygems/commands/open_command.rb
+++ b/lib/rubygems/commands/open_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'English'
require 'rubygems/command'
require 'rubygems/version_option'
@@ -15,10 +14,6 @@ class Gem::Commands::OpenCommand < Gem::Command
"Opens gem sources in EDITOR") do |editor, options|
options[:editor] = editor || get_env_editor
end
- add_option('-v', '--version VERSION', String,
- "Opens specific gem version") do |version|
- options[:version] = version
- end
end
def arguments # :nodoc:
@@ -66,13 +61,11 @@ class Gem::Commands::OpenCommand < Gem::Command
end
def open_editor path
- Dir.chdir(path) do
- system(*@editor.split(/\s+/) + [path])
- end
+ system(*@editor.split(/\s+/) + [path])
end
def spec_for name
- spec = Gem::Specification.find_all_by_name(name, @version).first
+ spec = Gem::Specification.find_all_by_name(name, @version).last
return spec if spec
diff --git a/lib/rubygems/commands/outdated_command.rb b/lib/rubygems/commands/outdated_command.rb
index 70f6c02801..7159dbb984 100644
--- a/lib/rubygems/commands/outdated_command.rb
+++ b/lib/rubygems/commands/outdated_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/spec_fetcher'
diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb
index cac6c5a17d..322bf6590a 100644
--- a/lib/rubygems/commands/owner_command.rb
+++ b/lib/rubygems/commands/owner_command.rb
@@ -1,12 +1,8 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/gemcutter_utilities'
-require 'rubygems/text'
class Gem::Commands::OwnerCommand < Gem::Command
-
- include Gem::Text
include Gem::LocalRemoteOptions
include Gem::GemcutterUtilities
@@ -43,9 +39,7 @@ permission to.
options[:remove] << value
end
- add_option '-h', '--host HOST',
- 'Use another gemcutter-compatible host',
- ' (e.g. https://rubygems.org)' do |value, options|
+ add_option '-h', '--host HOST', 'Use another gemcutter-compatible host' do |value, options|
options[:host] = value
end
end
@@ -67,11 +61,11 @@ permission to.
end
with_response response do |resp|
- owners = Gem::SafeYAML.load clean_text(resp.body)
+ owners = YAML.load resp.body
say "Owners for gem: #{name}"
owners.each do |owner|
- say "- #{owner['email'] || owner['handle'] || owner['id']}"
+ say "- #{owner['email']}"
end
end
end
@@ -102,3 +96,4 @@ permission to.
end
end
+
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb
index fafe35bec1..b54e7eac93 100644
--- a/lib/rubygems/commands/pristine_command.rb
+++ b/lib/rubygems/commands/pristine_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/package'
require 'rubygems/installer'
@@ -22,11 +21,6 @@ class Gem::Commands::PristineCommand < Gem::Command
options[:all] = value
end
- add_option('--skip=gem_name',
- 'used on --all, skip if name == gem_name') do |value, options|
- options[:skip] = value
- end
-
add_option('--[no-]extensions',
'Restore gems with extensions',
'in addition to regular gems') do |value, options|
@@ -92,8 +86,8 @@ extensions will be restored.
spec.extensions and not spec.extensions.empty?
end
else
- get_all_gem_names.sort.map do |gem_name|
- Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
+ get_all_gem_names.map do |gem_name|
+ Gem::Specification.find_all_by_name gem_name, options[:version]
end.flatten
end
@@ -115,38 +109,19 @@ extensions will be restored.
next
end
- if spec.name == options[:skip]
- say "Skipped #{spec.full_name}, it was given through options"
- next
- end
-
- if spec.bundled_gem_in_old_ruby?
- say "Skipped #{spec.full_name}, it is bundled with old Ruby"
- next
- end
-
- unless spec.extensions.empty? or options[:extensions] or options[:only_executables] then
+ unless spec.extensions.empty? or options[:extensions] then
say "Skipped #{spec.full_name}, it needs to compile an extension"
next
end
gem = spec.cache_file
- unless File.exist? gem or options[:only_executables] then
+ unless File.exist? gem then
require 'rubygems/remote_fetcher'
say "Cached gem for #{spec.full_name} not found, attempting to fetch..."
-
dep = Gem::Dependency.new spec.name, spec.version
- found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep
-
- if found.empty?
- say "Skipped #{spec.full_name}, it was not found from cache and remote sources"
- next
- end
-
- spec_candidate, source = found.first
- Gem::RemoteFetcher.fetcher.download spec_candidate, source.uri.to_s, spec.base_dir
+ Gem::RemoteFetcher.fetcher.download_to_cache dep
end
env_shebang =
@@ -157,19 +132,16 @@ extensions will be restored.
install_defaults.to_s['--env-shebang']
end
- installer_options = {
- :wrappers => true,
- :force => true,
- :install_dir => spec.base_dir,
- :env_shebang => env_shebang,
- :build_args => spec.build_args,
- }
+ installer = Gem::Installer.new(gem,
+ :wrappers => true,
+ :force => true,
+ :install_dir => spec.base_dir,
+ :env_shebang => env_shebang,
+ :build_args => spec.build_args)
if options[:only_executables] then
- installer = Gem::Installer.for_spec(spec, installer_options)
installer.generate_bin
else
- installer = Gem::Installer.at(gem, installer_options)
installer.install
end
diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb
index d294cbc8df..6899b489ad 100644
--- a/lib/rubygems/commands/push_command.rb
+++ b/lib/rubygems/commands/push_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/gemcutter_utilities'
@@ -33,8 +32,7 @@ command. For further discussion see the help for the yank command.
add_key_option
add_option('--host HOST',
- 'Push to another gemcutter-compatible host',
- ' (e.g. https://rubygems.org)') do |value, options|
+ 'Push to another gemcutter-compatible host') do |value, options|
options[:host] = value
end
@@ -77,17 +75,13 @@ You can upgrade or downgrade to the latest release version with:
@host = gem_data.spec.metadata['default_gem_server']
end
- push_host = nil
+ # Always include this, even if it's nil
+ args << @host
if gem_data.spec.metadata.has_key?('allowed_push_host')
- push_host = gem_data.spec.metadata['allowed_push_host']
+ args << gem_data.spec.metadata['allowed_push_host']
end
- @host ||= push_host
-
- # Always include @host, even if it's nil
- args += [ @host, push_host ]
-
say "Pushing gem to #{@host || Gem.host}..."
response = rubygems_api_request(*args) do |request|
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index 4624e5a1e9..432250e033 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/spec_fetcher'
@@ -50,12 +49,6 @@ class Gem::Commands::QueryCommand < Gem::Command
options[:all] = value
end
- add_option('-e', '--exact',
- 'Name of gem(s) to query on matches the',
- 'provided STRING') do |value, options|
- options[:exact] = value
- end
-
add_option( '--[no-]prerelease',
'Display prerelease versions') do |value, options|
options[:prerelease] = value
@@ -85,8 +78,7 @@ is too hard to use.
elsif !options[:name].source.empty?
name = Array(options[:name])
else
- args = options[:args].to_a
- name = options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i }
+ name = options[:args].to_a.map{|arg| /#{arg}/i }
end
prerelease = options[:prerelease]
@@ -169,7 +161,7 @@ is too hard to use.
:latest
end
- if name.respond_to?(:source) && name.source.empty?
+ if name.source.empty?
spec_tuples = fetcher.detect(type) { true }
else
spec_tuples = fetcher.detect(type) do |name_tuple|
@@ -226,7 +218,7 @@ is too hard to use.
end
end
- output << clean_text(make_entry(matching_tuples, platforms))
+ output << make_entry(matching_tuples, platforms)
end
end
@@ -235,7 +227,7 @@ is too hard to use.
name_tuple, spec = detail_tuple
- spec = spec.fetch_spec name_tuple if spec.respond_to? :fetch_spec
+ spec = spec.fetch_spec name_tuple unless Gem::Specification === spec
entry << "\n"
@@ -247,7 +239,7 @@ is too hard to use.
spec_summary entry, spec
end
- def entry_versions entry, name_tuples, platforms, specs
+ def entry_versions entry, name_tuples, platforms
return unless options[:versions]
list =
@@ -255,21 +247,13 @@ is too hard to use.
name_tuples.map { |n| n.version }.uniq
else
platforms.sort.reverse.map do |version, pls|
- out = version.to_s
-
- if options[:domain] == :local
- default = specs.any? do |s|
- !s.is_a?(Gem::Source) && s.version == version && s.default_gem?
- end
- out = "default: #{out}" if default
+ if pls == [Gem::Platform::RUBY] then
+ version
+ else
+ ruby = pls.delete Gem::Platform::RUBY
+ platform_list = [ruby, *pls.sort].compact
+ "#{version} #{platform_list.join ' '}"
end
-
- if pls != [Gem::Platform::RUBY] then
- platform_list = [pls.delete(Gem::Platform::RUBY), *pls.sort].compact
- out = platform_list.unshift(out).join(' ')
- end
-
- out
end
end
@@ -285,14 +269,14 @@ is too hard to use.
entry = [name_tuples.first.name]
- entry_versions entry, name_tuples, platforms, specs
+ entry_versions entry, name_tuples, platforms
entry_details entry, detail_tuple, specs, platforms
entry.join
end
def spec_authors entry, spec
- authors = "Author#{spec.authors.length > 1 ? 's' : ''}: ".dup
+ authors = "Author#{spec.authors.length > 1 ? 's' : ''}: "
authors << spec.authors.join(', ')
entry << format_text(authors, 68, 4)
end
@@ -306,7 +290,7 @@ is too hard to use.
def spec_license entry, spec
return if spec.license.nil? or spec.license.empty?
- licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup
+ licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: "
licenses << spec.licenses.join(', ')
entry << "\n" << format_text(licenses, 68, 4)
end
@@ -352,8 +336,8 @@ is too hard to use.
end
def spec_summary entry, spec
- summary = truncate_text(spec.summary, "the summary for #{spec.full_name}")
- entry << "\n\n" << format_text(summary, 68, 4)
+ entry << "\n\n" << format_text(spec.summary, 68, 4)
end
end
+
diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb
index 6992040dca..86597f99a6 100644
--- a/lib/rubygems/commands/rdoc_command.rb
+++ b/lib/rubygems/commands/rdoc_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/version_option'
require 'rubygems/rdoc'
diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb
index 933436d84d..a1e2c1a00e 100644
--- a/lib/rubygems/commands/search_command.rb
+++ b/lib/rubygems/commands/search_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/commands/query_command'
diff --git a/lib/rubygems/commands/server_command.rb b/lib/rubygems/commands/server_command.rb
index 245156d50d..4796ce2ad6 100644
--- a/lib/rubygems/commands/server_command.rb
+++ b/lib/rubygems/commands/server_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/server'
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index ee6ce88eae..6617396780 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
##
@@ -15,11 +14,10 @@ class Gem::Commands::SetupCommand < Gem::Command
super 'setup', 'Install RubyGems',
:format_executable => true, :document => %w[ri],
:site_or_vendor => 'sitelibdir',
- :destdir => '', :prefix => '', :previous_version => '',
- :regenerate_binstubs => true
+ :destdir => '', :prefix => '', :previous_version => ''
add_option '--previous-version=VERSION',
- 'Previous version of RubyGems',
+ 'Previous version of rubygems',
'Used for changelog processing' do |version, options|
options[:previous_version] = version
end
@@ -43,12 +41,12 @@ class Gem::Commands::SetupCommand < Gem::Command
add_option '--[no-]format-executable',
'Makes `gem` match ruby',
- 'If Ruby is ruby18, gem will be gem18' do |value, options|
+ 'If ruby is ruby18, gem will be gem18' do |value, options|
options[:format_executable] = value
end
add_option '--[no-]document [TYPES]', Array,
- 'Generate documentation for RubyGems',
+ 'Generate documentation for RubyGems.',
'List the documentation types you wish to',
'generate. For example: rdoc,ri' do |value, options|
options[:document] = case value
@@ -80,11 +78,6 @@ class Gem::Commands::SetupCommand < Gem::Command
options[:document].uniq!
end
- add_option '--[no-]regenerate-binstubs',
- 'Regenerate gem binstubs' do |value, options|
- options[:regenerate_binstubs] = value
- end
-
@verbose = nil
end
@@ -98,7 +91,7 @@ class Gem::Commands::SetupCommand < Gem::Command
end
def defaults_str # :nodoc:
- "--format-executable --document ri --regenerate-binstubs"
+ "--format-executable --document ri"
end
def description # :nodoc:
@@ -148,12 +141,8 @@ By default, this RubyGems will install gem as:
remove_old_lib_files lib_dir
- install_default_bundler_gem
-
say "RubyGems #{Gem::VERSION} installed"
- regenerate_binstubs if options[:regenerate_binstubs]
-
uninstall_old_gemcutter
documentation_success = install_rdoc
@@ -200,7 +189,7 @@ By default, this RubyGems will install gem as:
if options[:document].include? 'ri' then
say "Ruby Interactive (ri) documentation was installed. ri is kind of like man "
- say "pages for Ruby libraries. You may access it like this:"
+ say "pages for ruby libraries. You may access it like this:"
say " ri Classname"
say " ri Classname.class_method"
say " ri Classname#instance_method"
@@ -212,64 +201,59 @@ By default, this RubyGems will install gem as:
end
end
-
def install_executables(bin_dir)
+ say "Installing gem executable" if @verbose
+
@bin_file_names = []
- executables = { 'gem' => 'bin' }
- executables['bundler'] = 'bundler/exe' if Gem::USE_BUNDLER_FOR_GEMDEPS
- executables.each do |tool, path|
- say "Installing #{tool} executable" if @verbose
+ Dir.chdir 'bin' do
+ bin_files = Dir['*']
+
+ bin_files.delete 'update_rubygems'
- Dir.chdir path do
- bin_files = Dir['*']
+ bin_files.each do |bin_file|
+ bin_file_formatted = if options[:format_executable] then
+ Gem.default_exec_format % bin_file
+ else
+ bin_file
+ end
- bin_files -= %w[update_rubygems bundler bundle_ruby]
+ dest_file = File.join bin_dir, bin_file_formatted
+ bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
- bin_files.each do |bin_file|
- bin_file_formatted = if options[:format_executable] then
- Gem.default_exec_format % bin_file
- else
- bin_file
- end
+ begin
+ bin = File.readlines bin_file
+ bin[0] = "#!#{Gem.ruby}\n"
- dest_file = File.join bin_dir, bin_file_formatted
- bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
+ File.open bin_tmp_file, 'w' do |fp|
+ fp.puts bin.join
+ end
- begin
- bin = File.readlines bin_file
- bin[0] = "#!#{Gem.ruby}\n"
+ install bin_tmp_file, dest_file, :mode => 0755
+ @bin_file_names << dest_file
+ ensure
+ rm bin_tmp_file
+ end
- File.open bin_tmp_file, 'w' do |fp|
- fp.puts bin.join
- end
+ next unless Gem.win_platform?
- install bin_tmp_file, dest_file, :mode => 0755
- @bin_file_names << dest_file
- ensure
- rm bin_tmp_file
- end
+ begin
+ bin_cmd_file = File.join Dir.tmpdir, "#{bin_file}.bat"
- next unless Gem.win_platform?
-
- begin
- bin_cmd_file = File.join Dir.tmpdir, "#{bin_file}.bat"
-
- File.open bin_cmd_file, 'w' do |file|
- file.puts <<-TEXT
- @ECHO OFF
- IF NOT "%~f0" == "~f0" GOTO :WinNT
- @"#{File.basename(Gem.ruby).chomp('"')}" "#{dest_file}" %1 %2 %3 %4 %5 %6 %7 %8 %9
- GOTO :EOF
- :WinNT
- @"#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
- TEXT
- end
-
- install bin_cmd_file, "#{dest_file}.bat", :mode => 0755
- ensure
- rm bin_cmd_file
+ File.open bin_cmd_file, 'w' do |file|
+ file.puts <<-TEXT
+@ECHO OFF
+IF NOT "%~f0" == "~f0" GOTO :WinNT
+@"#{File.basename(Gem.ruby).chomp('"')}" "#{dest_file}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+GOTO :EOF
+:WinNT
+@"#{File.basename(Gem.ruby).chomp('"')}" "%~dpn0" %*
+TEXT
end
+
+ install bin_cmd_file, "#{dest_file}.bat", :mode => 0755
+ ensure
+ rm bin_cmd_file
end
end
end
@@ -284,24 +268,18 @@ By default, this RubyGems will install gem as:
end
def install_lib(lib_dir)
- libs = { 'RubyGems' => 'lib' }
- libs['Bundler'] = 'bundler/lib' if Gem::USE_BUNDLER_FOR_GEMDEPS
- libs.each do |tool, path|
- say "Installing #{tool}" if @verbose
-
- lib_files = rb_files_in path
- lib_files.concat(template_files) if tool == 'Bundler'
+ say "Installing RubyGems" if @verbose
- pem_files = pem_files_in path
+ lib_files = rb_files_in 'lib'
+ pem_files = pem_files_in 'lib'
- Dir.chdir path do
- lib_files.each do |lib_file|
- install_file lib_file, lib_dir
- end
+ Dir.chdir 'lib' do
+ lib_files.each do |lib_file|
+ install_file lib_file, lib_dir
+ end
- pem_files.each do |pem_file|
- install_file pem_file, lib_dir
- end
+ pem_files.each do |pem_file|
+ install_file pem_file, lib_dir
end
end
end
@@ -347,63 +325,6 @@ By default, this RubyGems will install gem as:
return false
end
- def install_default_bundler_gem
- return unless Gem::USE_BUNDLER_FOR_GEMDEPS
-
- specs_dir = Gem::Specification.default_specifications_dir
- specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform?
- mkdir_p specs_dir
-
- # Workaround for non-git environment.
- gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
- File.open('bundler/bundler.gemspec', 'w'){|f| f.write gemspec }
-
- bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
- bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] }
- bundler_spec.executables -= %w[bundler bundle_ruby]
-
- # Remove bundler-*.gemspec in default specification directory.
- Dir.entries(specs_dir).
- select {|gs| gs.start_with?("bundler-") }.
- each {|gs| File.delete(File.join(specs_dir, gs)) }
-
- default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec")
- Gem.write_binary(default_spec_path, bundler_spec.to_ruby)
-
- bundler_spec = Gem::Specification.load(default_spec_path)
-
- # Remove gemspec that was same version of vendored bundler.
- normal_gemspec = File.join(Gem.default_dir, "specifications", "bundler-#{bundler_spec.version}.gemspec")
- if File.file? normal_gemspec
- File.delete normal_gemspec
- end
-
- # Remove gem files that were same version of vendored bundler.
- if File.directory? bundler_spec.gems_dir
- Dir.entries(bundler_spec.gems_dir).
- select {|default_gem| File.basename(default_gem) == "bundler-#{bundler_spec.version}" }.
- each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
- end
-
- bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir)
- bundler_bin_dir = File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform?
- mkdir_p bundler_bin_dir
- bundler_spec.executables.each do |e|
- cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
- end
-
- if Gem.win_platform?
- require 'rubygems/installer'
-
- installer = Gem::Installer.for_spec bundler_spec
- bundler_spec.executables.each do |e|
- installer.generate_windows_script e, bundler_spec.bin_dir
- end
- end
-
- say "Bundler #{bundler_spec.version} installed"
- end
-
def make_destination_dirs(install_destdir)
lib_dir, bin_dir = Gem.default_rubygems_dirs
@@ -461,22 +382,6 @@ By default, this RubyGems will install gem as:
end
end
- # for installation of bundler as default gems
- def template_files
- Dir.chdir "bundler/lib" do
- (Dir[File.join('bundler', 'templates', '**', '{*,.*}')]).
- select{|f| !File.directory?(f)}
- end
- end
-
- # for cleanup old bundler files
- def template_files_in dir
- Dir.chdir dir do
- (Dir[File.join('templates', '**', '{*,.*}')]).
- select{|f| !File.directory?(f)}
- end
- end
-
def remove_old_bin_files(bin_dir)
old_bin_files = {
'gem_mirror' => 'gem mirror',
@@ -491,7 +396,7 @@ By default, this RubyGems will install gem as:
old_bin_path = File.join bin_dir, old_bin_file
next unless File.exist? old_bin_path
- deprecation_message = "`#{old_bin_file}` has been deprecated. Use `#{new_name}` instead."
+ deprecation_message = "`#{old_bin_file}` has been deprecated. Use `#{new_name}` instead."
File.open old_bin_path, 'w' do |fp|
fp.write <<-EOF
@@ -510,28 +415,23 @@ abort "#{deprecation_message}"
end
def remove_old_lib_files lib_dir
- lib_dirs = { File.join(lib_dir, 'rubygems') => 'lib/rubygems' }
- lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' if Gem::USE_BUNDLER_FOR_GEMDEPS
- lib_dirs.each do |old_lib_dir, new_lib_dir|
- lib_files = rb_files_in(new_lib_dir)
- lib_files.concat(template_files_in(new_lib_dir)) if new_lib_dir =~ /bundler/
+ rubygems_dir = File.join lib_dir, 'rubygems'
+ lib_files = rb_files_in 'lib/rubygems'
- old_lib_files = rb_files_in(old_lib_dir)
- old_lib_files.concat(template_files_in(old_lib_dir)) if old_lib_dir =~ /bundler/
+ old_lib_files = rb_files_in rubygems_dir
- to_remove = old_lib_files - lib_files
+ to_remove = old_lib_files - lib_files
- to_remove.delete_if do |file|
- file.start_with? 'defaults'
- end
+ to_remove.delete_if do |file|
+ file.start_with? 'defaults'
+ end
- Dir.chdir old_lib_dir do
- to_remove.each do |file|
- FileUtils.rm_f file
+ Dir.chdir rubygems_dir do
+ to_remove.each do |file|
+ FileUtils.rm_f file
- warn "unable to remove old file #{file} please remove it by hand" if
- File.exist? file
- end
+ warn "unable to remove old file #{file} please remove it by hand" if
+ File.exist? file
end
end
end
@@ -579,11 +479,5 @@ abort "#{deprecation_message}"
rescue Gem::InstallError
end
- def regenerate_binstubs
- require "rubygems/commands/pristine_command"
- say "Regenerating binstubs"
- command = Gem::Commands::PristineCommand.new
- command.invoke(*%w[--all --only-executables --silent])
- end
-
end
+
diff --git a/lib/rubygems/commands/signin_command.rb b/lib/rubygems/commands/signin_command.rb
deleted file mode 100644
index 6556db5a89..0000000000
--- a/lib/rubygems/commands/signin_command.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/command'
-require 'rubygems/gemcutter_utilities'
-
-class Gem::Commands::SigninCommand < Gem::Command
- include Gem::GemcutterUtilities
-
- def initialize
- super 'signin', 'Sign in to any gemcutter-compatible host. '\
- 'It defaults to https://rubygems.org'
-
- add_option('--host HOST', 'Push to another gemcutter-compatible host') do |value, options|
- options[:host] = value
- end
-
- end
-
- def description # :nodoc:
- 'The signin command executes host sign in for a push server (the default is'\
- ' https://rubygems.org). The host can be provided with the host flag or can'\
- ' be inferred from the provided gem. Host resolution matches the resolution'\
- ' strategy for the push command.'
- end
-
- def usage # :nodoc:
- program_name
- end
-
- def execute
- sign_in options[:host]
- end
-
-end
diff --git a/lib/rubygems/commands/signout_command.rb b/lib/rubygems/commands/signout_command.rb
deleted file mode 100644
index 2452e8cae1..0000000000
--- a/lib/rubygems/commands/signout_command.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/command'
-
-class Gem::Commands::SignoutCommand < Gem::Command
-
- def initialize
- super 'signout', 'Sign out from all the current sessions.'
- end
-
- def description # :nodoc:
- 'The `signout` command is used to sign out from all current sessions,'\
- ' allowing you to sign in using a different set of credentials.'
- end
-
- def usage # :nodoc:
- program_name
- end
-
- def execute
- credentials_path = Gem.configuration.credentials_path
-
- if !File.exist?(credentials_path) then
- alert_error 'You are not currently signed in.'
- elsif !File.writable?(credentials_path) then
- alert_error "File '#{Gem.configuration.credentials_path}' is read-only."\
- ' Please make sure it is writable.'
- else
- Gem.configuration.unset_api_key!
- say 'You have successfully signed out from all sessions.'
- end
- end
-
-end
diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb
index 7e46963a4c..81ff07babc 100644
--- a/lib/rubygems/commands/sources_command.rb
+++ b/lib/rubygems/commands/sources_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/remote_fetcher'
require 'rubygems/spec_fetcher'
@@ -44,7 +43,7 @@ class Gem::Commands::SourcesCommand < Gem::Command
source = Gem::Source.new source_uri
begin
- if Gem.sources.include? source then
+ if Gem.sources.include? source_uri then
say "source #{source_uri} already present in the cache"
else
source.load_specs :released
@@ -103,7 +102,7 @@ Do you want to add this insecure source?
RubyGems fetches gems from the sources you have configured (stored in your
~/.gemrc).
-The default source is https://rubygems.org, but you may have other sources
+The default source is https://rubygems.org, but you may have older sources
configured. This guide will help you update your sources or configure
yourself to use your own gem server.
diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb
index ad8840adc2..3bc02a9c14 100644
--- a/lib/rubygems/commands/specification_command.rb
+++ b/lib/rubygems/commands/specification_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
diff --git a/lib/rubygems/commands/stale_command.rb b/lib/rubygems/commands/stale_command.rb
index 0524ee1e2b..0ef0755960 100644
--- a/lib/rubygems/commands/stale_command.rb
+++ b/lib/rubygems/commands/stale_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Commands::StaleCommand < Gem::Command
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 20b3a7a1e4..71ffdc89fc 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/version_option'
require 'rubygems/uninstaller'
@@ -30,7 +29,7 @@ class Gem::Commands::UninstallCommand < Gem::Command
options[:ignore] = value
end
- add_option('-D', '--[no-]check-development',
+ add_option('-D', '--[no-]-check-development',
'Check development dependencies while uninstalling',
'(default: false)') do |value, options|
options[:check_dev] = value
@@ -125,7 +124,7 @@ that is a dependency of an existing gem. You can use the
end
def uninstall_all
- specs = Gem::Specification.reject { |spec| spec.default_gem? }
+ _, specs = Gem::Specification.partition { |spec| spec.default_gem? }
specs.each do |spec|
options[:version] = spec.version
@@ -143,9 +142,7 @@ that is a dependency of an existing gem. You can use the
deplist = Gem::DependencyList.new
get_all_gem_names.uniq.each do |name|
- gem_specs = Gem::Specification.find_all_by_name(name)
- say("Gem '#{name}' is not installed") if gem_specs.empty?
- gem_specs.each do |spec|
+ Gem::Specification.find_all_by_name(name).each do |spec|
deplist.add spec
end
end
@@ -164,3 +161,4 @@ that is a dependency of an existing gem. You can use the
end
end
+
diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb
index b873f20d28..5a05ad0a81 100644
--- a/lib/rubygems/commands/unpack_command.rb
+++ b/lib/rubygems/commands/unpack_command.rb
@@ -1,21 +1,11 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/installer'
require 'rubygems/version_option'
-require 'rubygems/security_option'
require 'rubygems/remote_fetcher'
-# forward-declare
-
-module Gem::Security # :nodoc:
- class Policy # :nodoc:
- end
-end
-
class Gem::Commands::UnpackCommand < Gem::Command
include Gem::VersionOption
- include Gem::SecurityOption
def initialize
require 'fileutils'
@@ -33,7 +23,6 @@ class Gem::Commands::UnpackCommand < Gem::Command
options[:spec] = true
end
- add_security_option
add_version_option
end
@@ -73,8 +62,6 @@ command help for an example.
# at the same time.)
def execute
- security_policy = options[:security_policy]
-
get_all_gem_names.each do |name|
dependency = Gem::Dependency.new name, options[:version]
path = get_path dependency
@@ -85,7 +72,7 @@ command help for an example.
end
if @options[:spec] then
- spec, metadata = get_metadata path, security_policy
+ spec, metadata = get_metadata path
if metadata.nil? then
alert_error "--spec is unsupported on '#{name}' (old format gem)"
@@ -94,14 +81,14 @@ command help for an example.
spec_file = File.basename spec.spec_file
- File.open spec_file, 'w' do |io|
+ open spec_file, 'w' do |io|
io.write metadata
end
else
basename = File.basename path, '.gem'
target_dir = File.expand_path basename, options[:target]
- package = Gem::Package.new path, security_policy
+ package = Gem::Package.new path
package.extract_files target_dir
say "Unpacked gem: '#{target_dir}'"
@@ -170,13 +157,13 @@ command help for an example.
#--
# TODO move to Gem::Package as #raw_spec or something
- def get_metadata path, security_policy = nil
- format = Gem::Package.new path, security_policy
+ def get_metadata path
+ format = Gem::Package.new path
spec = format.spec
metadata = nil
- File.open path, Gem.binary_mode do |io|
+ open path, Gem.binary_mode do |io|
tar = Gem::Package::TarReader.new io
tar.each_entry do |entry|
case entry.full_name
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 93ee60e1ab..9e9bd088f2 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/command_manager'
require 'rubygems/dependency_installer'
@@ -48,7 +47,7 @@ class Gem::Commands::UpdateCommand < Gem::Command
end
def arguments # :nodoc:
- "GEMNAME name of gem to update"
+ "REGEXP regexp to search for in gem name"
end
def defaults_str # :nodoc:
@@ -65,12 +64,12 @@ command to remove old versions.
end
def usage # :nodoc:
- "#{program_name} GEMNAME [GEMNAME ...]"
+ "#{program_name} REGEXP [REGEXP ...]"
end
def check_latest_rubygems version # :nodoc:
if Gem.rubygems_version == version then
- say "Latest version already installed. Done."
+ say "Latest version currently installed. Aborting."
terminate_interaction
end
@@ -85,6 +84,7 @@ command to remove old versions.
end
def execute
+ hig = {}
if options[:system] then
update_rubygems
@@ -203,10 +203,7 @@ command to remove old versions.
def update_gem name, version = Gem::Requirement.default
return if @updated.any? { |spec| spec.name == name }
- update_options = options.dup
- update_options[:prerelease] = version.prerelease?
-
- @installer = Gem::DependencyInstaller.new update_options
+ @installer ||= Gem::DependencyInstaller.new options
say "Updating #{name}"
begin
@@ -241,7 +238,7 @@ command to remove old versions.
update_gem 'rubygems-update', version
installed_gems = Gem::Specification.find_all_by_name 'rubygems-update', requirement
- version = installed_gems.first.version
+ version = installed_gems.last.version
install_rubygems version
end
diff --git a/lib/rubygems/commands/which_command.rb b/lib/rubygems/commands/which_command.rb
index 704d79fc60..96eeb86288 100644
--- a/lib/rubygems/commands/which_command.rb
+++ b/lib/rubygems/commands/which_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Commands::WhichCommand < Gem::Command
@@ -56,7 +55,7 @@ requiring to see why it does not behave as you expect.
paths = find_paths arg, dirs
if paths.empty? then
- alert_error "Can't find Ruby library file or shared library #{arg}"
+ alert_error "Can't find ruby library file or shared library #{arg}"
found &&= false
else
diff --git a/lib/rubygems/commands/yank_command.rb b/lib/rubygems/commands/yank_command.rb
index ebf24e5c77..3c7859e763 100644
--- a/lib/rubygems/commands/yank_command.rb
+++ b/lib/rubygems/commands/yank_command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
@@ -11,11 +10,19 @@ class Gem::Commands::YankCommand < Gem::Command
def description # :nodoc:
<<-EOF
-The yank command permanently removes a gem you pushed to a server.
+The yank command removes a gem you pushed to a server from the server's
+index.
+
+Note that if you push a gem to rubygems.org the yank command does not
+prevent other people from downloading the gem via the download link.
Once you have pushed a gem several downloads will happen automatically
-via the webhooks. If you accidentally pushed passwords or other sensitive
+via the webhooks. If you accidentally pushed passwords or other sensitive
data you will need to change them immediately and yank your gem.
+
+If you are yanking a gem due to intellectual property reasons contact
+http://help.rubygems.org for permanant removal. Be sure to mention this
+as the reason for the removal request.
EOF
end
@@ -24,7 +31,7 @@ data you will need to change them immediately and yank your gem.
end
def usage # :nodoc:
- "#{program_name} GEM -v VERSION [-p PLATFORM] [--key KEY_NAME] [--host HOST]"
+ "#{program_name} GEM -v VERSION [-p PLATFORM] [--undo] [--key KEY_NAME]"
end
def initialize
@@ -33,26 +40,25 @@ data you will need to change them immediately and yank your gem.
add_version_option("remove")
add_platform_option("remove")
- add_option('--host HOST',
- 'Yank from another gemcutter-compatible host',
- ' (e.g. https://rubygems.org)') do |value, options|
- options[:host] = value
+ add_option('--undo') do |value, options|
+ options[:undo] = true
end
add_key_option
- @host = nil
end
def execute
- @host = options[:host]
-
- sign_in @host
+ sign_in
version = get_version_from_requirements(options[:version])
platform = get_platform_from_requirements(options)
if version then
- yank_gem(version, platform)
+ if options[:undo] then
+ unyank_gem(version, platform)
+ else
+ yank_gem(version, platform)
+ end
else
say "A version argument is required: #{usage}"
terminate_interaction
@@ -64,11 +70,16 @@ data you will need to change them immediately and yank your gem.
yank_api_request(:delete, version, platform, "api/v1/gems/yank")
end
+ def unyank_gem(version, platform)
+ say "Unyanking gem from #{host}..."
+ yank_api_request(:put, version, platform, "api/v1/gems/unyank")
+ end
+
private
def yank_api_request(method, version, platform, api)
name = get_one_gem_name
- response = rubygems_api_request(method, api, host) do |request|
+ response = rubygems_api_request(method, api) do |request|
request.add_field("Authorization", api_key)
data = {
diff --git a/lib/rubygems/compatibility.rb b/lib/rubygems/compatibility.rb
index 2056b5b53a..d06ade1fa6 100644
--- a/lib/rubygems/compatibility.rb
+++ b/lib/rubygems/compatibility.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# :stopdoc:
#--
@@ -21,7 +20,8 @@ if Gem::GEM_PRELUDE_SUCKAGE and defined?(Gem::QuickLoader) then
$LOADED_FEATURES.delete Gem::QuickLoader.path_to_full_rubygems_library
- if path = $LOADED_FEATURES.find {|n| n.end_with? '/rubygems.rb'} then
+ if $LOADED_FEATURES.any? do |path| path.end_with? '/rubygems.rb' end then
+ # TODO path does not exist here
raise LoadError, "another rubygems is already loaded from #{path}"
end
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index c0d19dbfc2..1bdc79ae06 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -54,7 +53,7 @@ class Gem::ConfigFile
# For Ruby implementers to set configuration defaults. Set in
# rubygems/defaults/#{RUBY_ENGINE}.rb
- PLATFORM_DEFAULTS = Gem.platform_defaults
+ PLATFORM_DEFAULTS = {}
# :stopdoc:
@@ -144,10 +143,6 @@ class Gem::ConfigFile
attr_accessor :ssl_ca_cert
##
- # sources to look for gems
- attr_accessor :sources
-
- ##
# Path name of directory or file of openssl client certificate, used for remote https connection with client authentication
attr_reader :ssl_client_cert
@@ -205,12 +200,11 @@ class Gem::ConfigFile
result.merge load_file file
end
+
@hash = operating_system_config.merge platform_config
- unless arg_list.index '--norc'
- @hash = @hash.merge system_config
- @hash = @hash.merge user_config
- @hash = @hash.merge environment_config
- end
+ @hash = @hash.merge system_config
+ @hash = @hash.merge user_config
+ @hash = @hash.merge environment_config
# HACK these override command-line args, which is bad
@backtrace = @hash[:backtrace] if @hash.key? :backtrace
@@ -220,7 +214,6 @@ class Gem::ConfigFile
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
@verbose = @hash[:verbose] if @hash.key? :verbose
@disable_default_gem_server = @hash[:disable_default_gem_server] if @hash.key? :disable_default_gem_server
- @sources = @hash[:sources] if @hash.key? :sources
@ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
@ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
@@ -229,6 +222,7 @@ class Gem::ConfigFile
@api_keys = nil
@rubygems_api_key = nil
+ Gem.sources = @hash[:sources] if @hash.key? :sources
handle_arguments arg_list
end
@@ -310,18 +304,9 @@ if you believe they were disclosed to a third party.
# Sets the RubyGems.org API key to +api_key+
def rubygems_api_key= api_key
- set_api_key :rubygems_api_key, api_key
-
- @rubygems_api_key = api_key
- end
-
- ##
- # Set a specific host's API key to +api_key+
-
- def set_api_key host, api_key
check_credentials_permissions
- config = load_file(credentials_path).merge(host => api_key)
+ config = load_file(credentials_path).merge(:rubygems_api_key => api_key)
dirname = File.dirname credentials_path
Dir.mkdir(dirname) unless File.exist? dirname
@@ -333,34 +318,25 @@ if you believe they were disclosed to a third party.
f.write config.to_yaml
end
- load_api_keys # reload
+ @rubygems_api_key = api_key
end
- ##
- # Remove the +~/.gem/credentials+ file to clear all the current sessions.
-
- def unset_api_key!
- return false unless File.exist?(credentials_path)
-
- File.delete(credentials_path)
- end
+ YAMLErrors = [ArgumentError]
+ YAMLErrors << Psych::SyntaxError if defined?(Psych::SyntaxError)
def load_file(filename)
Gem.load_yaml
- yaml_errors = [ArgumentError]
- yaml_errors << Psych::SyntaxError if defined?(Psych::SyntaxError)
-
return {} unless filename and File.exist? filename
begin
- content = Gem::SafeYAML.load(File.read(filename))
+ content = YAML.load(File.read(filename))
unless content.kind_of? Hash
warn "Failed to load #{filename} because it doesn't contain valid YAML hash"
return {}
end
return content
- rescue *yaml_errors => e
+ rescue *YAMLErrors => e
warn "Failed to load #{filename}, #{e}"
rescue Errno::EACCES
warn "Failed to load #{filename} due to permissions problem."
@@ -428,11 +404,31 @@ if you believe they were disclosed to a third party.
# to_yaml only overwrites things you can't override on the command line.
def to_yaml # :nodoc:
yaml_hash = {}
- yaml_hash[:backtrace] = @hash.fetch(:backtrace, DEFAULT_BACKTRACE)
- yaml_hash[:bulk_threshold] = @hash.fetch(:bulk_threshold, DEFAULT_BULK_THRESHOLD)
+ yaml_hash[:backtrace] = if @hash.key?(:backtrace)
+ @hash[:backtrace]
+ else
+ DEFAULT_BACKTRACE
+ end
+
+ yaml_hash[:bulk_threshold] = if @hash.key?(:bulk_threshold)
+ @hash[:bulk_threshold]
+ else
+ DEFAULT_BULK_THRESHOLD
+ end
+
yaml_hash[:sources] = Gem.sources.to_a
- yaml_hash[:update_sources] = @hash.fetch(:update_sources, DEFAULT_UPDATE_SOURCES)
- yaml_hash[:verbose] = @hash.fetch(:verbose, DEFAULT_VERBOSITY)
+
+ yaml_hash[:update_sources] = if @hash.key?(:update_sources)
+ @hash[:update_sources]
+ else
+ DEFAULT_UPDATE_SOURCES
+ end
+
+ yaml_hash[:verbose] = if @hash.key?(:verbose)
+ @hash[:verbose]
+ else
+ DEFAULT_VERBOSITY
+ end
yaml_hash[:ssl_verify_mode] =
@hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
@@ -458,7 +454,7 @@ if you believe they were disclosed to a third party.
# Writes out this config file, replacing its source.
def write
- File.open config_file_name, 'w' do |io|
+ open config_file_name, 'w' do |io|
io.write to_yaml
end
end
diff --git a/lib/rubygems/core_ext/kernel_gem.rb b/lib/rubygems/core_ext/kernel_gem.rb
index b0dd69bfcc..edce4ee10b 100644
--- a/lib/rubygems/core_ext/kernel_gem.rb
+++ b/lib/rubygems/core_ext/kernel_gem.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# RubyGems adds the #gem method to allow activation of specific gem versions
# and overrides the #require method on Kernel to make gems appear as if they
@@ -56,14 +55,7 @@ module Kernel
gem_name = gem_name.name
end
- dep = Gem::Dependency.new(gem_name, *requirements)
-
- loaded = Gem.loaded_specs[gem_name]
-
- return false if loaded && dep.matches_spec?(loaded)
-
- spec = dep.to_spec
-
+ spec = Gem::Dependency.new(gem_name, *requirements).to_spec
Gem::LOADED_SPECS_MUTEX.synchronize {
spec.activate
} if spec
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index d3df9d85f9..bf9618d3bf 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -41,14 +40,10 @@ module Kernel
path = path.to_path if path.respond_to? :to_path
- if spec = Gem.find_unresolved_default_spec(path)
+ spec = Gem.find_unresolved_default_spec(path)
+ if spec
Gem.remove_unresolved_default_spec(spec)
- begin
- Kernel.send(:gem, spec.name)
- rescue Exception
- RUBYGEMS_ACTIVATION_MONITOR.exit
- raise
- end
+ gem(spec.name)
end
# If there are no unresolved deps, then we can use just try
@@ -65,10 +60,14 @@ module Kernel
#--
# TODO request access to the C implementation of this to speed up RubyGems
- if Gem::Specification.find_active_stub_by_path(path)
+ spec = Gem::Specification.stubs.find { |s|
+ s.activated? and s.contains_requirable_file? path
+ }
+
+ begin
RUBYGEMS_ACTIVATION_MONITOR.exit
return gem_original_require(path)
- end
+ end if spec
# Attempt to find +path+ in any unresolved gems...
@@ -106,7 +105,7 @@ module Kernel
# Ok, now find a gem that has no conflicts, starting
# at the highest version.
- valid = found_specs.find { |s| !s.has_conflicts? }
+ valid = found_specs.select { |s| s.conflicts.empty? }.last
unless valid then
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
@@ -123,20 +122,18 @@ module Kernel
rescue LoadError => load_error
RUBYGEMS_ACTIVATION_MONITOR.enter
- begin
- if load_error.message.start_with?("Could not find") or
- (load_error.message.end_with?(path) and Gem.try_activate(path)) then
- require_again = true
- end
- ensure
+ if load_error.message.start_with?("Could not find") or
+ (load_error.message.end_with?(path) and Gem.try_activate(path)) then
+ RUBYGEMS_ACTIVATION_MONITOR.exit
+ return gem_original_require(path)
+ else
RUBYGEMS_ACTIVATION_MONITOR.exit
end
- return gem_original_require(path) if require_again
-
raise load_error
end
private :require
end
+
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index 43d57fc808..55ca080c96 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Gem
DEFAULT_HOST = "https://rubygems.org"
@@ -175,22 +174,4 @@ module Gem
RbConfig::CONFIG['ruby_version']
end
- ##
- # Default options for gem commands.
- #
- # The options here should be structured as an array of string "gem"
- # command names as keys and a string of the default options as values.
- #
- # Example:
- #
- # def self.platform_defaults
- # {
- # 'install' => '--no-rdoc --no-ri --env-shebang',
- # 'update' => '--no-rdoc --no-ri --env-shebang'
- # }
- # end
-
- def self.platform_defaults
- {}
- end
end
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb
index 55873c71e8..b72a540dc8 100644
--- a/lib/rubygems/dependency.rb
+++ b/lib/rubygems/dependency.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The Dependency class holds a Gem name and a Gem::Requirement.
@@ -165,10 +164,6 @@ class Gem::Dependency
@type ||= :runtime
end
- def runtime?
- @type == :runtime || !@type
- end
-
def == other # :nodoc:
Gem::Dependency === other &&
self.name == other.name &&
@@ -275,20 +270,18 @@ class Gem::Dependency
end
def matching_specs platform_only = false
- env_req = Gem.env_requirement(name)
- matches = Gem::Specification.stubs_for(name).find_all { |spec|
- requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
+ matches = Gem::Specification.stubs.find_all { |spec|
+ self.name === spec.name and # TODO: == instead of ===
+ requirement.satisfied_by? spec.version
}.map(&:to_spec)
- Gem::BundlerVersionFinder.filter!(matches) if name == "bundler".freeze
-
if platform_only
matches.reject! { |spec|
- spec.nil? || !Gem::Platform.match(spec.platform)
+ not Gem::Platform.match spec.platform
}
end
- matches
+ matches = matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed
end
##
@@ -304,13 +297,22 @@ class Gem::Dependency
# TODO: check Gem.activated_spec[self.name] in case matches falls outside
if matches.empty? then
- specs = Gem::Specification.stubs_for name
+ specs = Gem::Specification.find_all { |s|
+ s.name == name
+ }.map { |x| x.full_name }
if specs.empty?
- raise Gem::MissingSpecError.new name, requirement
+ total = Gem::Specification.to_a.size
+ msg = "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
else
- raise Gem::MissingSpecVersionError.new name, requirement, specs
+ msg = "Could not find '#{name}' (#{requirement}) - did find: [#{specs.join ','}]\n"
end
+ msg << "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
+
+ error = Gem::LoadError.new(msg)
+ error.name = self.name
+ error.requirement = self.requirement
+ raise error
end
# TODO: any other resolver validations should go here
@@ -319,17 +321,14 @@ class Gem::Dependency
end
def to_spec
- matches = self.to_specs.compact
+ matches = self.to_specs
active = matches.find { |spec| spec.activated? }
- return active if active
- return matches.first if prerelease?
+ return active if active
- # Move prereleases to the end of the list for >= 0 requirements
- pre, matches = matches.partition { |spec| spec.version.prerelease? }
- matches += pre if requirement == Gem::Requirement.default
+ matches.delete_if { |spec| spec.version.prerelease? } unless prerelease?
- matches.first
+ matches.last
end
end
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index 5a87f50956..039d046da2 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/dependency_list'
require 'rubygems/package'
@@ -7,7 +6,6 @@ require 'rubygems/spec_fetcher'
require 'rubygems/user_interaction'
require 'rubygems/source'
require 'rubygems/available_set'
-require 'rubygems/deprecate'
##
# Installs a gem along with all its dependencies from local and remote gems.
@@ -47,9 +45,6 @@ class Gem::DependencyInstaller
attr_reader :gems_to_install # :nodoc:
- extend Gem::Deprecate
- deprecate :gems_to_install, :none, 2016, 10
-
##
# List of gems installed by #install in alphabetic order
@@ -223,17 +218,7 @@ class Gem::DependencyInstaller
tuples, errors = Gem::SpecFetcher.fetcher.search_for_dependency dep
if best_only && !tuples.empty?
- tuples.sort! do |a,b|
- if b[0].version == a[0].version
- if b[0].platform != Gem::Platform::RUBY
- 1
- else
- -1
- end
- else
- b[0].version <=> a[0].version
- end
- end
+ tuples.sort! { |a,b| b[0].version <=> a[0].version }
tuples = [tuples.first]
end
diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb
index d8314eaf60..3e40325527 100644
--- a/lib/rubygems/dependency_list.rb
+++ b/lib/rubygems/dependency_list.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -104,7 +103,7 @@ class Gem::DependencyList
end
def inspect # :nodoc:
- "%s %p>" % [super[0..-2], map { |s| s.full_name }]
+ "#<%s:0x%x %p>" % [self.class, object_id, map { |s| s.full_name }]
end
##
@@ -142,9 +141,6 @@ class Gem::DependencyList
def ok_to_remove?(full_name, check_dev=true)
gem_to_remove = find_name full_name
- # If the state is inconsistent, at least don't crash
- return true unless gem_to_remove
-
siblings = @specs.find_all { |s|
s.name == gem_to_remove.name &&
s.full_name != gem_to_remove.full_name
@@ -223,7 +219,11 @@ class Gem::DependencyList
dependencies.each do |dep|
specs.each do |spec|
if spec.satisfies_requirement? dep then
- yield spec
+ begin
+ yield spec
+ rescue TSort::Cyclic
+ # do nothing
+ end
break
end
end
diff --git a/lib/rubygems/deprecate.rb b/lib/rubygems/deprecate.rb
index 375194c1e8..e19360da13 100644
--- a/lib/rubygems/deprecate.rb
+++ b/lib/rubygems/deprecate.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Provides a single method +deprecate+ to be used to declare when
# something is going away.
diff --git a/lib/rubygems/doctor.rb b/lib/rubygems/doctor.rb
index ec4a16c3f8..3c71fd5aa4 100644
--- a/lib/rubygems/doctor.rb
+++ b/lib/rubygems/doctor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/user_interaction'
diff --git a/lib/rubygems/errors.rb b/lib/rubygems/errors.rb
index 6f2847d548..9defb9ee9b 100644
--- a/lib/rubygems/errors.rb
+++ b/lib/rubygems/errors.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# This file contains all the various exceptions and other errors that are used
# inside of RubyGems.
@@ -20,52 +19,6 @@ module Gem
attr_accessor :requirement
end
- ##
- # Raised when trying to activate a gem, and that gem does not exist on the
- # system. Instead of rescuing from this class, make sure to rescue from the
- # superclass Gem::LoadError to catch all types of load errors.
- class MissingSpecError < Gem::LoadError
- def initialize name, requirement
- @name = name
- @requirement = requirement
- end
-
- def message # :nodoc:
- build_message +
- "Checked in 'GEM_PATH=#{Gem.path.join(File::PATH_SEPARATOR)}', execute `gem env` for more information"
- end
-
- private
-
- def build_message
- total = Gem::Specification.stubs.size
- "Could not find '#{name}' (#{requirement}) among #{total} total gem(s)\n"
- end
- end
-
- ##
- # Raised when trying to activate a gem, and the gem exists on the system, but
- # not the requested version. Instead of rescuing from this class, make sure to
- # rescue from the superclass Gem::LoadError to catch all types of load errors.
- class MissingSpecVersionError < MissingSpecError
- attr_reader :specs
-
- def initialize name, requirement, specs
- super(name, requirement)
- @specs = specs
- end
-
- private
-
- def build_message
- if name == "bundler" && message = Gem::BundlerVersionFinder.missing_version_message
- return message
- end
- names = specs.map(&:full_name)
- "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n"
- end
- end
-
# Raised when there are conflicting gem specs loaded
class ConflictError < LoadError
@@ -173,7 +126,6 @@ module Gem
# An English description of the error.
def wordy
- @source.uri.password = 'REDACTED' unless @source.uri.password.nil?
"Unable to download data from #{@source.uri} - #{@error.message}"
end
diff --git a/lib/rubygems/exceptions.rb b/lib/rubygems/exceptions.rb
index b7528761fc..2a9875cd24 100644
--- a/lib/rubygems/exceptions.rb
+++ b/lib/rubygems/exceptions.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# TODO: the documentation in here is terrible.
#
# Each exception needs a brief description and the scenarios where it is
@@ -138,7 +137,7 @@ class Gem::ImpossibleDependenciesError < Gem::Exception
requester = requester ? requester.spec.full_name : 'The user'
dependency = @request.dependency
- message = "#{requester} requires #{dependency} but it conflicted:\n".dup
+ message = "#{requester} requires #{dependency} but it conflicted:\n"
@conflicts.each do |_, conflict|
message << conflict.explanation
@@ -154,12 +153,6 @@ class Gem::ImpossibleDependenciesError < Gem::Exception
end
class Gem::InstallError < Gem::Exception; end
-class Gem::RuntimeRequirementNotMetError < Gem::InstallError
- attr_accessor :suggestion
- def message
- [suggestion, super].compact.join("\n\t")
- end
-end
##
# Potentially raised when a specification is validated.
@@ -274,3 +267,4 @@ end
# Backwards compatible typo'd exception class for early RubyGems 2.0.x
Gem::UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:
+
diff --git a/lib/rubygems/ext.rb b/lib/rubygems/ext.rb
index 18d2bc233a..5af6bbf39e 100644
--- a/lib/rubygems/ext.rb
+++ b/lib/rubygems/ext.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
diff --git a/lib/rubygems/ext/build_error.rb b/lib/rubygems/ext/build_error.rb
index 0b3c17a9a0..bfe85ffc11 100644
--- a/lib/rubygems/ext/build_error.rb
+++ b/lib/rubygems/ext/build_error.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Raised when there is an error while building extensions.
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index eb9db199d5..548f1262a8 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -67,11 +66,9 @@ class Gem::Ext::Builder
# TODO use Process.spawn when ruby 1.8 support is dropped.
rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], nil
if verbose
- puts("current directory: #{Dir.pwd}")
puts(command)
system(command)
else
- results << "current directory: #{Dir.pwd}"
results << command
results << `#{command} #{redirector}`
end
@@ -183,7 +180,7 @@ EOF
return if @spec.extensions.empty?
if @build_args.empty?
- say "Building native extensions. This could take a while..."
+ say "Building native extensions. This could take a while..."
else
say "Building native extensions with: '#{@build_args.join ' '}'"
say "This could take a while..."
@@ -212,7 +209,7 @@ EOF
FileUtils.mkdir_p @spec.extension_dir
- File.open destination, 'wb' do |io| io.puts output end
+ open destination, 'wb' do |io| io.puts output end
destination
end
diff --git a/lib/rubygems/ext/cmake_builder.rb b/lib/rubygems/ext/cmake_builder.rb
index efa3bd1d88..24531bc75c 100644
--- a/lib/rubygems/ext/cmake_builder.rb
+++ b/lib/rubygems/ext/cmake_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/command'
class Gem::Ext::CmakeBuilder < Gem::Ext::Builder
diff --git a/lib/rubygems/ext/configure_builder.rb b/lib/rubygems/ext/configure_builder.rb
index 8b42bf7ee9..f66e39387a 100644
--- a/lib/rubygems/ext/configure_builder.rb
+++ b/lib/rubygems/ext/configure_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index 965b728278..213bdcb002 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -12,22 +11,13 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
FileEntry = FileUtils::Entry_ # :nodoc:
def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
- tmp_dest = Dir.mktmpdir(".gem.", ".")
-
- # Some versions of `mktmpdir` return absolute paths, which will break make
- # if the paths contain spaces. However, on Ruby 1.9.x on Windows, relative
- # paths cause all C extension builds to fail.
- #
- # As such, we convert to a relative path unless we are using Ruby 1.9.x on
- # Windows. This means that when using Ruby 1.9.x on Windows, paths with
- # spaces do not work.
- #
- # Details: https://github.com/rubygems/rubygems/issues/977#issuecomment-171544940
- #
- # TODO: Make this unconditional when rubygems no longer supports Ruby 1.9.x.
- tmp_dest = get_relative_path(tmp_dest) unless Gem.win_platform? && RUBY_VERSION <= '2.0'
+ # relative path required as some versions of mktmpdir return an absolute
+ # path which breaks make if it includes a space in the name
+ tmp_dest = get_relative_path(Dir.mktmpdir(".gem.", "."))
+ t = nil
Tempfile.open %w"siteconf .rb", "." do |siteconf|
+ t = siteconf
siteconf.puts "require 'rbconfig'"
siteconf.puts "dest_path = #{tmp_dest.dump}"
%w[sitearchdir sitelibdir].each do |dir|
@@ -35,7 +25,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
end
- siteconf.close
+ siteconf.flush
destdir = ENV["DESTDIR"]
@@ -45,14 +35,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
begin
run cmd, results
ensure
- if File.exist? 'mkmf.log'
- unless $?.success? then
- results << "To see why this extension failed to compile, please check" \
- " the mkmf.log which can be found here:\n"
- results << " " + File.join(dest_path, 'mkmf.log') + "\n"
- end
- FileUtils.mv 'mkmf.log', dest_path
- end
+ FileUtils.mv 'mkmf.log', dest_path if File.exist? 'mkmf.log'
siteconf.unlink
end
@@ -66,7 +49,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
FileUtils.mkdir_p lib_dir
entries = Dir.entries(tmp_dest) - %w[. ..]
entries = entries.map { |entry| File.join tmp_dest, entry }
- FileUtils.cp_r entries, lib_dir, :remove_destination => true
+ FileUtils.cp_r entries, lib_dir
end
FileEntry.new(tmp_dest).traverse do |ent|
@@ -76,9 +59,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
end
ensure
ENV["DESTDIR"] = destdir
- siteconf.close!
end
end
+ t.unlink if t and t.path
results
ensure
@@ -92,3 +75,4 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
end
end
+
diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb
index 4b3534bf35..d5ebf597ae 100644
--- a/lib/rubygems/ext/rake_builder.rb
+++ b/lib/rubygems/ext/rake_builder.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -9,7 +8,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
if File.basename(extension) =~ /mkrf_conf/i then
- cmd = "#{Gem.ruby} #{File.basename extension}".dup
+ cmd = "#{Gem.ruby} #{File.basename extension}"
cmd << " #{args.join " "}" unless args.empty?
run cmd, results
end
@@ -20,7 +19,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
rake = ENV['rake']
rake ||= begin
- "#{Gem.ruby} -rrubygems #{Gem.bin_path('rake', 'rake')}"
+ "#{Gem.ruby} -rubygems #{Gem.bin_path('rake', 'rake')}"
rescue Gem::Exception
end
diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb
index 349d49d66e..7a3fd6b116 100644
--- a/lib/rubygems/gem_runner.rb
+++ b/lib/rubygems/gem_runner.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -8,7 +7,6 @@
require 'rubygems'
require 'rubygems/command_manager'
require 'rubygems/config_file'
-require 'rubygems/deprecate'
##
# Load additional plugins from $LOAD_PATH
@@ -27,10 +25,7 @@ Gem.load_env_plugins rescue nil
class Gem::GemRunner
def initialize(options={})
- if !options.empty? && !Gem::Deprecate.skip
- Kernel.warn "NOTE: passing options to Gem::GemRunner.new is deprecated with no replacement. It will be removed on or after 2016-10-01."
- end
-
+ # TODO: nuke these options
@command_manager_class = options[:command_manager] || Gem::CommandManager
@config_file_class = options[:config_file] || Gem::ConfigFile
end
diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb
index 623d9301b5..4ecf7376e0 100644
--- a/lib/rubygems/gemcutter_utilities.rb
+++ b/lib/rubygems/gemcutter_utilities.rb
@@ -1,14 +1,10 @@
-# frozen_string_literal: true
require 'rubygems/remote_fetcher'
-require 'rubygems/text'
##
# Utility methods for using the RubyGems API.
module Gem::GemcutterUtilities
- include Gem::Text
-
# TODO: move to Gem::Command
OptionParser.accept Symbol do |value|
value.to_sym
@@ -72,14 +68,9 @@ module Gem::GemcutterUtilities
terminate_interaction 1 # TODO: question this
end
- if allowed_push_host
- allowed_host_uri = URI.parse(allowed_push_host)
- host_uri = URI.parse(self.host)
-
- unless (host_uri.scheme == allowed_host_uri.scheme) && (host_uri.host == allowed_host_uri.host)
- alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
- terminate_interaction 1
- end
+ if allowed_push_host and self.host != allowed_push_host
+ alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
+ terminate_interaction 1
end
uri = URI.parse "#{self.host}/#{path}"
@@ -118,7 +109,7 @@ module Gem::GemcutterUtilities
with_response response do |resp|
say "Signed in."
- set_api_key host, resp.body
+ Gem.configuration.rubygems_api_key = resp.body
end
end
@@ -148,24 +139,16 @@ module Gem::GemcutterUtilities
if block_given? then
yield response
else
- say clean_text(response.body)
+ say response.body
end
else
message = response.body
message = "#{error_prefix}: #{message}" if error_prefix
- say clean_text(message)
+ say message
terminate_interaction 1 # TODO: question this
end
end
- def set_api_key host, key
- if host == Gem::DEFAULT_HOST
- Gem.configuration.rubygems_api_key = key
- else
- Gem.configuration.set_api_key host, key
- end
- end
-
end
diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb
index 3ea994414b..1c7f8e709f 100644
--- a/lib/rubygems/indexer.rb
+++ b/lib/rubygems/indexer.rb
@@ -1,8 +1,6 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/package'
require 'time'
-require 'tmpdir'
begin
gem 'builder'
@@ -65,7 +63,7 @@ class Gem::Indexer
@build_modern = options[:build_modern]
@dest_directory = directory
- @directory = Dir.mktmpdir 'gem_generate_index'
+ @directory = File.join(Dir.tmpdir, "gem_generate_index_#{$$}")
marshal_name = "Marshal.#{Gem.marshal_version}"
@@ -95,22 +93,40 @@ class Gem::Indexer
end
##
- # Build various indices
+ # Abbreviate the spec for downloading. Abbreviated specs are only used for
+ # searching, downloading and related activities and do not need deployment
+ # specific information (e.g. list of files). So we abbreviate the spec,
+ # making it much smaller for quicker downloads.
+ #--
+ # TODO move to Gem::Specification
+
+ def abbreviate(spec)
+ spec.files = []
+ spec.test_files = []
+ spec.rdoc_options = []
+ spec.extra_rdoc_files = []
+ spec.cert_chain = []
+ spec
+ end
+
+ ##
+ # Build various indicies
+
+ def build_indicies
+ Gem::Specification.dirs = []
+ Gem::Specification.add_specs(*map_gems_to_specs(gem_file_list))
- def build_indices
- specs = map_gems_to_specs gem_file_list
- Gem::Specification._resort! specs
- build_marshal_gemspecs specs
- build_modern_indices specs if @build_modern
+ build_marshal_gemspecs
+ build_modern_indicies if @build_modern
- compress_indices
+ compress_indicies
end
##
# Builds Marshal quick index gemspecs.
- def build_marshal_gemspecs specs
- count = specs.count
+ def build_marshal_gemspecs
+ count = Gem::Specification.count { |s| not s.default_gem? }
progress = ui.progress_reporter count,
"Generating Marshal quick index gemspecs for #{count} gems",
"Complete"
@@ -118,13 +134,13 @@ class Gem::Indexer
files = []
Gem.time 'Generated Marshal quick index gemspecs' do
- specs.each do |spec|
+ Gem::Specification.each do |spec|
next if spec.default_gem?
spec_file_name = "#{spec.original_name}.gemspec.rz"
marshal_name = File.join @quick_marshal_dir, spec_file_name
marshal_zipped = Gem.deflate Marshal.dump(spec)
- File.open marshal_name, 'wb' do |io| io.write marshal_zipped end
+ open marshal_name, 'wb' do |io| io.write marshal_zipped end
files << marshal_name
@@ -170,14 +186,16 @@ class Gem::Indexer
end
##
- # Builds indices for RubyGems 1.2 and newer. Handles full, latest, prerelease
+ # Builds indicies for RubyGems 1.2 and newer. Handles full, latest, prerelease
+
+ def build_modern_indicies
+ specs = Gem::Specification.reject { |s| s.default_gem? }
- def build_modern_indices specs
prerelease, released = specs.partition { |s|
s.version.prerelease?
}
latest_specs =
- Gem::Specification._latest_specs specs
+ Gem::Specification.latest_specs.reject { |s| s.default_gem? }
build_modern_index(released.sort, @specs_index, 'specs')
build_modern_index(latest_specs.sort, @latest_specs_index, 'latest specs')
@@ -203,11 +221,21 @@ class Gem::Indexer
spec = Gem::Package.new(gemfile).spec
spec.loaded_from = gemfile
- spec.abbreviate
- spec.sanitize
+ # HACK: fuck this shit - borks all tests that use pl1
+ # if File.basename(gemfile, ".gem") != spec.original_name then
+ # exp = spec.full_name
+ # exp << " (#{spec.original_name})" if
+ # spec.original_name != spec.full_name
+ # msg = "Skipping misnamed gem: #{gemfile} should be named #{exp}"
+ # alert_warning msg
+ # next
+ # end
+
+ abbreviate spec
+ sanitize spec
spec
- rescue SignalException
+ rescue SignalException => e
alert_error "Received signal, exiting"
raise
rescue Exception => e
@@ -220,14 +248,14 @@ class Gem::Indexer
end
##
- # Compresses indices on disk
+ # Compresses indicies on disk
#--
# All future files should be compressed using gzip, not deflate
- def compress_indices
- say "Compressing indices"
+ def compress_indicies
+ say "Compressing indicies"
- Gem.time 'Compressed indices' do
+ Gem.time 'Compressed indicies' do
if @build_modern then
gzip @specs_index
gzip @latest_specs_index
@@ -262,7 +290,7 @@ class Gem::Indexer
zipped = Gem.deflate data
- File.open "#{filename}.#{extension}", 'wb' do |io|
+ open "#{filename}.#{extension}", 'wb' do |io|
io.write zipped
end
end
@@ -275,12 +303,12 @@ class Gem::Indexer
end
##
- # Builds and installs indices.
+ # Builds and installs indicies.
def generate_index
make_temp_directories
- build_indices
- install_indices
+ build_indicies
+ install_indicies
rescue SignalException
ensure
FileUtils.rm_rf @directory
@@ -296,9 +324,9 @@ class Gem::Indexer
end
##
- # Install generated indices into the destination directory.
+ # Install generated indicies into the destination directory.
- def install_indices
+ def install_indicies
verbose = Gem.configuration.really_verbose
say "Moving index into production dir #{@dest_directory}" if verbose
@@ -353,6 +381,38 @@ class Gem::Indexer
end
##
+ # Sanitize the descriptive fields in the spec. Sometimes non-ASCII
+ # characters will garble the site index. Non-ASCII characters will
+ # be replaced by their XML entity equivalent.
+
+ def sanitize(spec)
+ spec.summary = sanitize_string(spec.summary)
+ spec.description = sanitize_string(spec.description)
+ spec.post_install_message = sanitize_string(spec.post_install_message)
+ spec.authors = spec.authors.collect { |a| sanitize_string(a) }
+
+ spec
+ end
+
+ ##
+ # Sanitize a single string.
+
+ def sanitize_string(string)
+ return string unless string
+
+ # HACK the #to_s is in here because RSpec has an Array of Arrays of
+ # Strings for authors. Need a way to disallow bad values on gemspec
+ # generation. (Probably won't happen.)
+ string = string.to_s
+
+ begin
+ Builder::XChar.encode string
+ rescue NameError, NoMethodError
+ string.to_xs
+ end
+ end
+
+ ##
# Perform an in-place update of the repository from newly added gems.
def update_index
@@ -375,7 +435,10 @@ class Gem::Indexer
specs = map_gems_to_specs updated_gems
prerelease, released = specs.partition { |s| s.version.prerelease? }
- files = build_marshal_gemspecs specs
+ Gem::Specification.dirs = []
+ Gem::Specification.add_specs(*specs)
+
+ files = build_marshal_gemspecs
Gem.time 'Updated indexes' do
update_specs_index released, @dest_specs_index, @specs_index
@@ -385,7 +448,7 @@ class Gem::Indexer
@prerelease_specs_index)
end
- compress_indices
+ compress_indicies
verbose = Gem.configuration.really_verbose
@@ -428,7 +491,7 @@ class Gem::Indexer
specs_index = compact_specs specs_index.uniq.sort
- File.open dest, 'wb' do |io|
+ open dest, 'wb' do |io|
Marshal.dump specs_index, io
end
end
diff --git a/lib/rubygems/install_default_message.rb b/lib/rubygems/install_default_message.rb
index dc73fd962b..458ba3da96 100644
--- a/lib/rubygems/install_default_message.rb
+++ b/lib/rubygems/install_default_message.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/user_interaction'
diff --git a/lib/rubygems/install_message.rb b/lib/rubygems/install_message.rb
index 6880db583e..c1979c1549 100644
--- a/lib/rubygems/install_message.rb
+++ b/lib/rubygems/install_message.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/user_interaction'
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb
index 190372739b..a503b7fca4 100644
--- a/lib/rubygems/install_update_options.rb
+++ b/lib/rubygems/install_update_options.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -6,18 +5,37 @@
#++
require 'rubygems'
-require 'rubygems/security_option'
+
+# forward-declare
+
+module Gem::Security # :nodoc:
+ class Policy # :nodoc:
+ end
+end
##
# Mixin methods for install and update options for Gem::Commands
module Gem::InstallUpdateOptions
- include Gem::SecurityOption
##
# Add the install/update options to the option parser.
def add_install_update_options
+ # TODO: use @parser.accept
+ OptionParser.accept Gem::Security::Policy do |value|
+ require 'rubygems/security'
+
+ raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless
+ defined?(Gem::Security::HighSecurity)
+
+ value = Gem::Security::Policies[value]
+ valid = Gem::Security::Policies.keys.sort
+ message = "#{value} (#{valid.join ', '} are valid)"
+ raise OptionParser::InvalidArgument, message if value.nil?
+ value
+ end
+
add_option(:"Install/Update", '-i', '--install-dir DIR',
'Gem repository directory to get installed',
'gems') do |value, options|
@@ -105,7 +123,11 @@ module Gem::InstallUpdateOptions
options[:wrappers] = value
end
- add_security_option
+ add_option(:"Install/Update", '-P', '--trust-policy POLICY',
+ Gem::Security::Policy,
+ 'Specify gem trust policy') do |value, options|
+ options[:security_policy] = value
+ end
add_option(:"Install/Update", '--ignore-dependencies',
'Do not install any required dependent gems') do |value, options|
@@ -113,8 +135,8 @@ module Gem::InstallUpdateOptions
end
add_option(:"Install/Update", '--[no-]format-executable',
- 'Make installed executable names match Ruby.',
- 'If Ruby is ruby18, foo_exec will be',
+ 'Make installed executable names match ruby.',
+ 'If ruby is ruby18, foo_exec will be',
'foo_exec18') do |value, options|
options[:format_executable] = value
end
@@ -151,58 +173,6 @@ module Gem::InstallUpdateOptions
"meet version requirements") do |value, options|
options[:minimal_deps] = true
end
-
- add_option(:"Install/Update", "--[no-]post-install-message",
- "Print post install message") do |value, options|
- options[:post_install_message] = value
- end
-
- add_option(:"Install/Update", '-g', '--file [FILE]',
- 'Read from a gem dependencies API file and',
- 'install the listed gems') do |v,o|
- v = Gem::GEM_DEP_FILES.find do |file|
- File.exist? file
- end unless v
-
- unless v then
- message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"
-
- raise OptionParser::InvalidArgument,
- "cannot find gem dependencies file #{message}"
- end
-
- options[:gemdeps] = v
- end
-
- add_option(:"Install/Update", '--without GROUPS', Array,
- 'Omit the named groups (comma separated)',
- 'when installing from a gem dependencies',
- 'file') do |v,o|
- options[:without_groups].concat v.map { |without| without.intern }
- end
-
- add_option(:"Install/Update", '--default',
- 'Add the gem\'s full specification to',
- 'specifications/default and extract only its bin') do |v,o|
- options[:install_as_default] = v
- end
-
- add_option(:"Install/Update", '--explain',
- 'Rather than install the gems, indicate which would',
- 'be installed') do |v,o|
- options[:explain] = v
- end
-
- add_option(:"Install/Update", '--[no-]lock',
- 'Create a lock file (when used with -g/--file)') do |v,o|
- options[:lock] = v
- end
-
- add_option(:"Install/Update", '--[no-]suggestions',
- 'Suggest alternates when gems are not found') do |v,o|
- options[:suggest_alternate] = v
- end
-
end
##
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 904d5a0c7c..e5cfc0f536 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -62,6 +61,11 @@ class Gem::Installer
attr_reader :options
+ ##
+ # Sets the specification for .gem-less installs.
+
+ attr_writer :spec
+
@path_warning = false
@install_lock = Mutex.new
@@ -96,49 +100,8 @@ class Gem::Installer
end
##
- # Construct an installer object for the gem file located at +path+
-
- def self.at path, options = {}
- security_policy = options[:security_policy]
- package = Gem::Package.new path, security_policy
- new package, options
- end
-
- class FakePackage
- attr_accessor :spec
-
- def initialize(spec)
- @spec = spec
- end
-
- def extract_files destination_dir, pattern = '*'
- FileUtils.mkdir_p destination_dir
-
- spec.files.each do |file|
- file = File.join destination_dir, file
- next if File.exist? file
- FileUtils.mkdir_p File.dirname(file)
- File.open file, 'w' do |fp| fp.puts "# #{file}" end
- end
- end
-
- def copy_to path
- end
- end
-
- ##
- # Construct an installer object for an ephemeral gem (one where we don't
- # actually have a .gem file, just a spec)
-
- def self.for_spec spec, options = {}
- # FIXME: we should have a real Package class for this
- new FakePackage.new(spec), options
- end
-
- ##
- # Constructs an Installer instance that will install the gem at +package+ which
- # can either be a path or an instance of Gem::Package. +options+ is a Hash
- # with the following keys:
+ # Constructs an Installer instance that will install the gem located at
+ # +gem+. +options+ is a Hash with the following keys:
#
# :bin_dir:: Where to put a bin wrapper if needed.
# :development:: Whether or not development dependencies should be installed.
@@ -158,24 +121,18 @@ class Gem::Installer
# :wrappers:: Install wrappers if true, symlinks if false.
# :build_args:: An Array of arguments to pass to the extension builder
# process. If not set, then Gem::Command.build_args is used
- # :post_install_message:: Print gem post install message if true
- def initialize(package, options={})
+ def initialize(gem, options={})
require 'fileutils'
+ @gem = gem
@options = options
- if package.is_a? String
- security_policy = options[:security_policy]
- @package = Gem::Package.new package, security_policy
- if $VERBOSE
- warn "constructing an Installer object with a string is deprecated. Please use Gem::Installer.at (called from: #{caller.first})"
- end
- else
- @package = package
- end
+ @package = Gem::Package.new @gem
process_options
+ @package.security_policy = @security_policy
+
if options[:user_install] and not options[:unpack] then
@gem_home = Gem.user_dir
@bin_dir = Gem.bindir gem_home unless options[:bin_dir]
@@ -206,7 +163,7 @@ class Gem::Installer
ruby_executable = false
existing = nil
- File.open generated_bin, 'rb' do |io|
+ open generated_bin, 'rb' do |io|
next unless io.gets =~ /^#!/ # shebang
io.gets # blankline
@@ -215,14 +172,7 @@ class Gem::Installer
next unless io.gets =~ /This file was generated by RubyGems/
ruby_executable = true
- existing = io.read.slice(%r{
- ^\s*(
- gem \s |
- load \s Gem\.bin_path\( |
- load \s Gem\.activate_bin_path\(
- )
- (['"])(.*?)(\2),
- }x, 3)
+ existing = io.read.slice(/^gem (['"])(.*?)(\1),/, 2)
end
return if spec.name == existing
@@ -230,10 +180,10 @@ class Gem::Installer
# somebody has written to RubyGems' directory, overwrite, too bad
return if Gem.default_bindir != @bin_dir and not ruby_executable
- question = "#{spec.name}'s executable \"#{filename}\" conflicts with ".dup
+ question = "#{spec.name}'s executable \"#{filename}\" conflicts with "
if ruby_executable then
- question << (existing || 'an unknown executable')
+ question << existing
return if ask_yes_no "#{question}\nOverwrite the executable?", false
@@ -261,7 +211,7 @@ class Gem::Installer
# Lazy accessor for the installer's spec.
def spec
- @package.spec
+ @spec ||= @package.spec
rescue Gem::Package::Error => e
raise Gem::InstallError, "invalid gem: #{e.message}"
end
@@ -280,24 +230,18 @@ class Gem::Installer
def install
pre_install_checks
- FileUtils.rm_f File.join gem_home, 'specifications', spec.spec_name
+ FileUtils.rm_f File.join gem_home, 'specifications', @spec.spec_name
run_pre_install_hooks
- # Set loaded_from to ensure extension_dir is correct
- if @options[:install_as_default] then
- spec.loaded_from = default_spec_file
- else
- spec.loaded_from = spec_file
- end
-
# Completely remove any previous gem files
FileUtils.rm_rf gem_dir
- FileUtils.rm_rf spec.extension_dir
FileUtils.mkdir_p gem_dir
- if @options[:install_as_default] then
+ spec.loaded_from = spec_file
+
+ if @options[:install_as_default]
extract_bin
write_default_spec
else
@@ -312,9 +256,9 @@ class Gem::Installer
write_cache_file
end
- say spec.post_install_message if options[:post_install_message] && !spec.post_install_message.nil?
+ say spec.post_install_message unless spec.post_install_message.nil?
- Gem::Installer.install_lock.synchronize { Gem::Specification.reset }
+ Gem::Installer.install_lock.synchronize { Gem::Specification.add_spec spec }
run_post_install_hooks
@@ -407,7 +351,7 @@ class Gem::Installer
end
##
- # The location of the spec file that is installed.
+ # The location of of the spec file that is installed.
#
def spec_file
@@ -415,11 +359,11 @@ class Gem::Installer
end
##
- # The location of the default spec file for default gems.
+ # The location of of the default spec file for default gems.
#
def default_spec_file
- File.join Gem::Specification.default_specifications_dir, "#{spec.full_name}.gemspec"
+ File.join gem_home, "specifications/default", "#{spec.full_name}.gemspec"
end
##
@@ -427,7 +371,7 @@ class Gem::Installer
# specifications directory.
def write_spec
- File.open spec_file, 'w' do |file|
+ open spec_file, 'w' do |file|
spec.installed_by_version = Gem.rubygems_version
file.puts spec.to_ruby_for_cache
@@ -464,12 +408,7 @@ class Gem::Installer
def generate_bin # :nodoc:
return if spec.executables.nil? or spec.executables.empty?
- begin
- Dir.mkdir @bin_dir
- rescue SystemCallError
- raise unless File.directory? @bin_dir
- end
-
+ Dir.mkdir @bin_dir unless File.exist? @bin_dir
raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir
spec.executables.each do |filename|
@@ -478,12 +417,12 @@ class Gem::Installer
unless File.exist? bin_path then
# TODO change this to a more useful warning
- warn "`#{bin_path}` does not exist, maybe `gem pristine #{spec.name}` will fix it?"
+ warn "#{bin_path} maybe `gem pristine #{spec.name}` will fix it?"
next
end
- mode = File.stat(bin_path).mode
- FileUtils.chmod mode | 0111, bin_path unless (mode | 0111) == mode
+ mode = File.stat(bin_path).mode | 0111
+ FileUtils.chmod mode, bin_path
check_executable_overwrite filename
@@ -522,6 +461,12 @@ class Gem::Installer
# the symlink if the gem being installed has a newer version.
def generate_bin_symlink(filename, bindir)
+ if Gem.win_platform? then
+ alert_warning "Unable to use symlinks on Windows, installing wrapper"
+ generate_bin_script filename, bindir
+ return
+ end
+
src = File.join gem_dir, spec.bindir, filename
dst = File.join bindir, formatted_program_filename(filename)
@@ -535,9 +480,6 @@ class Gem::Installer
end
FileUtils.symlink src, dst, :verbose => Gem.configuration.really_verbose
- rescue NotImplementedError, SystemCallError
- alert_warning "Unable to use symlinks, installing wrapper"
- generate_bin_script filename, bindir
end
##
@@ -615,9 +557,7 @@ class Gem::Installer
def ensure_required_ruby_version_met # :nodoc:
if rrv = spec.required_ruby_version then
unless rrv.satisfied_by? Gem.ruby_version then
- ruby_version = Gem.ruby_api_version
- raise Gem::RuntimeRequirementNotMetError,
- "#{spec.name} requires Ruby version #{rrv}. The current ruby version is #{ruby_version}."
+ raise Gem::InstallError, "#{spec.name} requires Ruby version #{rrv}."
end
end
end
@@ -625,9 +565,8 @@ class Gem::Installer
def ensure_required_rubygems_version_met # :nodoc:
if rrgv = spec.required_rubygems_version then
unless rrgv.satisfied_by? Gem.rubygems_version then
- rg_version = Gem::VERSION
- raise Gem::RuntimeRequirementNotMetError,
- "#{spec.name} requires RubyGems version #{rrgv}. The current RubyGems version is #{rg_version}. " +
+ raise Gem::InstallError,
+ "#{spec.name} requires RubyGems version #{rrgv}. " +
"Try 'gem update --system' to update RubyGems itself."
end
end
@@ -647,8 +586,7 @@ class Gem::Installer
:bin_dir => nil,
:env_shebang => false,
:force => false,
- :only_install_dir => false,
- :post_install_message => true
+ :only_install_dir => false
}.merge options
@env_shebang = options[:env_shebang]
@@ -657,6 +595,7 @@ class Gem::Installer
@gem_home = options[:install_dir] || Gem.dir
@ignore_dependencies = options[:ignore_dependencies]
@format_executable = options[:format_executable]
+ @security_policy = options[:security_policy]
@wrappers = options[:wrappers]
@only_install_dir = options[:only_install_dir]
@@ -707,34 +646,10 @@ class Gem::Installer
unpack or File.writable?(gem_home)
end
- def verify_spec
- unless spec.name =~ Gem::Specification::VALID_NAME_PATTERN
- raise Gem::InstallError, "#{spec} has an invalid name"
- end
-
- if spec.raw_require_paths.any?{|path| path =~ /\r\n|\r|\n/ }
- raise Gem::InstallError, "#{spec} has an invalid require_paths"
- end
-
- if spec.extensions.any?{|ext| ext =~ /\r\n|\r|\n/ }
- raise Gem::InstallError, "#{spec} has an invalid extensions"
- end
-
- unless spec.specification_version.to_s =~ /\A\d+\z/
- raise Gem::InstallError, "#{spec} has an invalid specification_version"
- end
-
- if spec.dependencies.any? {|dep| dep.type =~ /\r\n|\r|\n/ || dep.name =~ /\r\n|\r|\n/ }
- raise Gem::InstallError, "#{spec} has an invalid dependencies"
- end
- end
-
##
# Return the text for an application file.
def app_script_text(bin_file_name)
- # note that the `load` lines cannot be indented, as old RG versions match
- # against the beginning of the line
return <<-TEXT
#{shebang bin_file_name}
#
@@ -746,7 +661,7 @@ class Gem::Installer
require 'rubygems'
-version = "#{Gem::Requirement.default}.a"
+version = "#{Gem::Requirement.default}"
if ARGV.first
str = ARGV.first
@@ -757,12 +672,8 @@ if ARGV.first
end
end
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('#{spec.name}', '#{bin_file_name}', version)
-else
-gem #{spec.name.dump}, version
-load Gem.bin_path(#{spec.name.dump}, #{bin_file_name.dump}, version)
-end
+gem '#{spec.name}', version
+load Gem.bin_path('#{spec.name}', '#{bin_file_name}', version)
TEXT
end
@@ -770,14 +681,14 @@ TEXT
# return the stub script text used to launch the true Ruby script
def windows_stub_script(bindir, bin_file_name)
- ruby = Gem.ruby.gsub(/^\"|\"$/, "").tr(File::SEPARATOR, "\\")
+ ruby = File.basename(Gem.ruby).chomp('"')
return <<-TEXT
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
-@"#{ruby}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+@"#{bindir.tr(File::SEPARATOR, File::ALT_SEPARATOR)}\\#{ruby}" "#{File.join(bindir, bin_file_name)}" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
-@"#{ruby}" "%~dpn0" %*
+@"%~dp0#{ruby}" "%~dpn0" %*
TEXT
end
@@ -848,14 +759,15 @@ TEXT
#
# Version and dependency checks are skipped if this install is forced.
#
- # The dependent check will be skipped if the install is ignoring dependencies.
+ # The dependent check will be skipped this install is ignoring dependencies.
def pre_install_checks
verify_gem_home options[:unpack]
- # The name and require_paths must be verified first, since it could contain
- # ruby code that would be eval'ed in #ensure_loadable_spec
- verify_spec
+ # If we're forcing the install then disable security unless the security
+ # policy says that we only install signed gems.
+ @security_policy = nil if
+ @force and @security_policy and not @security_policy.only_signed
ensure_loadable_spec
@@ -887,7 +799,7 @@ TEXT
build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
- File.open build_info_file, 'w' do |io|
+ open build_info_file, 'w' do |io|
@build_args.each do |arg|
io.puts arg
end
@@ -899,7 +811,9 @@ TEXT
def write_cache_file
cache_file = File.join gem_home, 'cache', spec.file_name
- @package.copy_to cache_file
+
+ FileUtils.cp @gem, cache_file unless File.exist? cache_file
end
end
+
diff --git a/lib/rubygems/installer_test_case.rb b/lib/rubygems/installer_test_case.rb
index 4cec5da3f4..549de011e4 100644
--- a/lib/rubygems/installer_test_case.rb
+++ b/lib/rubygems/installer_test_case.rb
@@ -1,7 +1,5 @@
-# frozen_string_literal: true
require 'rubygems/test_case'
require 'rubygems/installer'
-require 'rubygems/deprecate'
class Gem::Installer
@@ -73,7 +71,7 @@ class Gem::InstallerTestCase < Gem::TestCase
# a spec named 'a', intended for regular installs
# @user_spec::
# a spec named 'b', intended for user installs
- #
+
# @gem::
# the path to a built gem from @spec
# @user_spec::
@@ -108,17 +106,15 @@ class Gem::InstallerTestCase < Gem::TestCase
end
def util_gem_bindir spec = @spec # :nodoc:
+ # TODO: deprecate
spec.bin_dir
end
def util_gem_dir spec = @spec # :nodoc:
+ # TODO: deprecate
spec.gem_dir
end
- extend Gem::Deprecate
- deprecate :util_gem_bindir, "@spec.bin_dir", 2016, 10
- deprecate :util_gem_dir, "@spec.gem_dir", 2016, 10
-
##
# The path where installed executables live
@@ -173,8 +169,6 @@ class Gem::InstallerTestCase < Gem::TestCase
EOF
end
- yield @spec if block_given?
-
use_ui ui do
FileUtils.rm_f @gem
@@ -182,7 +176,7 @@ class Gem::InstallerTestCase < Gem::TestCase
end
end
- @installer = Gem::Installer.at @gem
+ @installer = Gem::Installer.new @gem
end
##
@@ -190,7 +184,7 @@ class Gem::InstallerTestCase < Gem::TestCase
# +user+ is true a user-install will be performed.
def util_installer(spec, gem_home, user=false)
- Gem::Installer.at(spec.cache_file,
+ Gem::Installer.new(spec.cache_file,
:install_dir => gem_home,
:user_install => user)
end
diff --git a/lib/rubygems/local_remote_options.rb b/lib/rubygems/local_remote_options.rb
index 597b87ea03..db23d9f974 100644
--- a/lib/rubygems/local_remote_options.rb
+++ b/lib/rubygems/local_remote_options.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -24,7 +23,7 @@ module Gem::LocalRemoteOptions
raise OptionParser::InvalidArgument, value
end
- unless ['http', 'https', 'file', 's3'].include?(uri.scheme)
+ unless ['http', 'https', 'file'].include?(uri.scheme)
raise OptionParser::InvalidArgument, value
end
diff --git a/lib/rubygems/mock_gem_ui.rb b/lib/rubygems/mock_gem_ui.rb
index 0223f8c35d..76a9389676 100644
--- a/lib/rubygems/mock_gem_ui.rb
+++ b/lib/rubygems/mock_gem_ui.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'stringio'
require 'rubygems/user_interaction'
diff --git a/lib/rubygems/name_tuple.rb b/lib/rubygems/name_tuple.rb
index 316329a0bd..60323db408 100644
--- a/lib/rubygems/name_tuple.rb
+++ b/lib/rubygems/name_tuple.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
#
# Represents a gem of name +name+ at +version+ of +platform+. These
@@ -54,7 +53,7 @@ class Gem::NameTuple
"#{@name}-#{@version}"
else
"#{@name}-#{@version}-#{@platform}"
- end.dup.untaint
+ end.untaint
end
##
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
index b472b97a07..417b34b79f 100644
--- a/lib/rubygems/package.rb
+++ b/lib/rubygems/package.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#--
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
@@ -59,7 +58,7 @@ class Gem::Package
if source
@path = source.path
- message = message + " in #{path}" if path
+ message << " in #{path}" if path
end
super message
@@ -124,7 +123,7 @@ class Gem::Package
# If +gem+ is an existing file in the old format a Gem::Package::Old will be
# returned.
- def self.new gem, security_policy = nil
+ def self.new gem
gem = if gem.is_a?(Gem::Package::Source)
gem
elsif gem.respond_to? :read
@@ -133,7 +132,7 @@ class Gem::Package
Gem::Package::FileSource.new gem
end
- return super unless Gem::Package == self
+ return super(gem) unless Gem::Package == self
return super unless gem.present?
return super unless gem.start
@@ -145,7 +144,7 @@ class Gem::Package
##
# Creates a new package that will read or write to the file +gem+.
- def initialize gem, security_policy # :notnew:
+ def initialize gem # :notnew:
@gem = gem
@build_time = Time.now
@@ -153,20 +152,13 @@ class Gem::Package
@contents = nil
@digests = Hash.new { |h, algorithm| h[algorithm] = {} }
@files = nil
- @security_policy = security_policy
+ @security_policy = nil
@signatures = {}
@signer = nil
@spec = nil
end
##
- # Copies this package to +path+ (if possible)
-
- def copy_to path
- FileUtils.cp @gem.path, path unless File.exist? path
- end
-
- ##
# Adds a checksum for each entry in the gem to checksums.yaml.gz.
def add_checksums tar
@@ -208,18 +200,12 @@ class Gem::Package
def add_files tar # :nodoc:
@spec.files.each do |file|
- stat = File.lstat file
-
- if stat.symlink?
- relative_dir = File.dirname(file).sub("#{Dir.pwd}/", '')
- target_path = File.join(relative_dir, File.readlink(file))
- tar.add_symlink file, target_path, stat.mode
- end
+ stat = File.stat file
next unless stat.file?
tar.add_file_simple file, stat.mode, stat.size do |dst_io|
- File.open file, 'rb' do |src_io|
+ open file, 'rb' do |src_io|
dst_io.write src_io.read 16384 until src_io.eof?
end
end
@@ -378,15 +364,12 @@ EOM
File.dirname destination
end
- mkdir_p_safe mkdir, mkdir_options, destination_dir, entry.full_name
+ FileUtils.mkdir_p mkdir, mkdir_options
- File.open destination, 'wb' do |out|
+ open destination, 'wb', entry.header.mode do |out|
out.write entry.read
- FileUtils.chmod entry.header.mode, destination
end if entry.file?
- File.symlink(entry.header.linkname, destination) if entry.symlink?
-
verbose destination
end
end
@@ -416,45 +399,20 @@ EOM
raise Gem::Package::PathError.new(filename, destination_dir) if
filename.start_with? '/'
- destination_dir = realpath destination_dir
+ destination_dir = File.realpath destination_dir if
+ File.respond_to? :realpath
destination_dir = File.expand_path destination_dir
destination = File.join destination_dir, filename
destination = File.expand_path destination
raise Gem::Package::PathError.new(destination, destination_dir) unless
- destination.start_with? destination_dir + '/'
-
- begin
- real_destination = File.expand_path(File.realpath(destination))
- rescue
- # it's fine if the destination doesn't exist, because rm -rf'ing it can't cause any damage
- nil
- else
- raise Gem::Package::PathError.new(real_destination, destination_dir) unless
- real_destination.start_with? destination_dir + '/'
- end
+ destination.start_with? destination_dir
destination.untaint
destination
end
- def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name
- destination_dir = realpath File.expand_path(destination_dir)
- parts = mkdir.split(File::SEPARATOR)
- parts.reduce do |path, basename|
- path = realpath path unless path == ""
- path = File.expand_path(path + File::SEPARATOR + basename)
- lstat = File.lstat path rescue nil
- if !lstat || !lstat.directory?
- unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false)
- raise Gem::Package::PathError.new(file_name, destination_dir)
- end
- end
- path
- end
- end
-
##
# Loads a Gem::Specification from the TarEntry +entry+
@@ -493,7 +451,7 @@ EOM
@checksums = gem.seek 'checksums.yaml.gz' do |entry|
Zlib::GzipReader.wrap entry do |gz_io|
- Gem::SafeYAML.safe_load gz_io.read
+ YAML.load gz_io.read
end
end
end
@@ -628,10 +586,6 @@ EOM
raise Gem::Package::FormatError.new \
'package content (data.tar.gz) is missing', @gem
end
-
- if duplicates = @files.group_by {|f| f }.select {|k,v| v.size > 1 }.map(&:first) and duplicates.any?
- raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})"
- end
end
##
@@ -645,16 +599,6 @@ EOM
raise Gem::Package::FormatError.new(e.message, entry.full_name)
end
- if File.respond_to? :realpath
- def realpath file
- File.realpath file
- end
- else
- def realpath file
- file
- end
- end
-
end
require 'rubygems/package/digest_io'
@@ -666,3 +610,4 @@ require 'rubygems/package/tar_header'
require 'rubygems/package/tar_reader'
require 'rubygems/package/tar_reader/entry'
require 'rubygems/package/tar_writer'
+
diff --git a/lib/rubygems/package/digest_io.rb b/lib/rubygems/package/digest_io.rb
index 4930c9aa7d..f8bde0f557 100644
--- a/lib/rubygems/package/digest_io.rb
+++ b/lib/rubygems/package/digest_io.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# IO wrapper that creates digests of contents written to the IO it wraps.
diff --git a/lib/rubygems/package/file_source.rb b/lib/rubygems/package/file_source.rb
index ecc3a68677..85316f62e7 100644
--- a/lib/rubygems/package/file_source.rb
+++ b/lib/rubygems/package/file_source.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The primary source of gems is a file on disk, including all usages
# internal to rubygems.
@@ -23,11 +22,11 @@ class Gem::Package::FileSource < Gem::Package::Source # :nodoc: all
end
def with_write_io &block
- File.open path, 'wb', &block
+ open path, 'wb', &block
end
def with_read_io &block
- File.open path, 'rb', &block
+ open path, 'rb', &block
end
end
diff --git a/lib/rubygems/package/io_source.rb b/lib/rubygems/package/io_source.rb
index ee79a21083..f89593dd2d 100644
--- a/lib/rubygems/package/io_source.rb
+++ b/lib/rubygems/package/io_source.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Supports reading and writing gems from/to a generic IO object. This is
# useful for other applications built on top of rubygems, such as
diff --git a/lib/rubygems/package/old.rb b/lib/rubygems/package/old.rb
index 322d682ca8..65bcbb2283 100644
--- a/lib/rubygems/package/old.rb
+++ b/lib/rubygems/package/old.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -19,14 +18,14 @@ class Gem::Package::Old < Gem::Package
# Creates a new old-format package reader for +gem+. Old-format packages
# cannot be written.
- def initialize gem, security_policy
+ def initialize gem
require 'fileutils'
require 'zlib'
Gem.load_yaml
@contents = nil
@gem = gem
- @security_policy = security_policy
+ @security_policy = nil
@spec = nil
end
@@ -64,7 +63,7 @@ class Gem::Package::Old < Gem::Package
destination = install_location full_name, destination_dir
- file_data = String.new
+ file_data = ''
read_until_dashes io do |line|
file_data << line
@@ -80,7 +79,7 @@ class Gem::Package::Old < Gem::Package
FileUtils.mkdir_p File.dirname destination
- File.open destination, 'wb', entry['mode'] do |out|
+ open destination, 'wb', entry['mode'] do |out|
out.write file_data
end
@@ -95,13 +94,13 @@ class Gem::Package::Old < Gem::Package
# Reads the file list section from the old-format gem +io+
def file_list io # :nodoc:
- header = String.new
+ header = ''
read_until_dashes io do |line|
header << line
end
- Gem::SafeYAML.safe_load header
+ YAML.load header
end
##
@@ -124,7 +123,7 @@ class Gem::Package::Old < Gem::Package
break unless line
end
- raise Gem::Exception, "Failed to find end of Ruby script while reading gem"
+ raise Gem::Exception, "Failed to find end of ruby script while reading gem"
end
##
@@ -135,7 +134,7 @@ class Gem::Package::Old < Gem::Package
return @spec if @spec
- yaml = String.new
+ yaml = ''
@gem.with_read_io do |io|
skip_ruby io
@@ -154,10 +153,10 @@ class Gem::Package::Old < Gem::Package
begin
@spec = Gem::Specification.from_yaml yaml
- rescue yaml_error
+ rescue yaml_error => e
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end
- rescue ArgumentError
+ rescue ArgumentError => e
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end
@@ -176,3 +175,4 @@ class Gem::Package::Old < Gem::Package
end
end
+
diff --git a/lib/rubygems/package/source.rb b/lib/rubygems/package/source.rb
index fe19776c38..1f18d479da 100644
--- a/lib/rubygems/package/source.rb
+++ b/lib/rubygems/package/source.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class Gem::Package::Source # :nodoc:
end
diff --git a/lib/rubygems/package/tar_header.rb b/lib/rubygems/package/tar_header.rb
index d557357114..f9ab13aca7 100644
--- a/lib/rubygems/package/tar_header.rb
+++ b/lib/rubygems/package/tar_header.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#--
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
@@ -104,30 +103,25 @@ class Gem::Package::TarHeader
fields = header.unpack UNPACK_FORMAT
new :name => fields.shift,
- :mode => strict_oct(fields.shift),
- :uid => strict_oct(fields.shift),
- :gid => strict_oct(fields.shift),
- :size => strict_oct(fields.shift),
- :mtime => strict_oct(fields.shift),
- :checksum => strict_oct(fields.shift),
+ :mode => fields.shift.oct,
+ :uid => fields.shift.oct,
+ :gid => fields.shift.oct,
+ :size => fields.shift.oct,
+ :mtime => fields.shift.oct,
+ :checksum => fields.shift.oct,
:typeflag => fields.shift,
:linkname => fields.shift,
:magic => fields.shift,
- :version => strict_oct(fields.shift),
+ :version => fields.shift.oct,
:uname => fields.shift,
:gname => fields.shift,
- :devmajor => strict_oct(fields.shift),
- :devminor => strict_oct(fields.shift),
+ :devmajor => fields.shift.oct,
+ :devminor => fields.shift.oct,
:prefix => fields.shift,
:empty => empty
end
- def self.strict_oct(str)
- return str.oct if str =~ /\A[0-7]*\z/
- raise ArgumentError, "#{str.inspect} is not an octal string"
- end
-
##
# Creates a new TarHeader using +vals+
@@ -232,3 +226,4 @@ class Gem::Package::TarHeader
end
end
+
diff --git a/lib/rubygems/package/tar_reader.rb b/lib/rubygems/package/tar_reader.rb
index 1098336e36..e257fdd846 100644
--- a/lib/rubygems/package/tar_reader.rb
+++ b/lib/rubygems/package/tar_reader.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#--
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
@@ -121,3 +120,4 @@ class Gem::Package::TarReader
end
require 'rubygems/package/tar_reader/entry'
+
diff --git a/lib/rubygems/package/tar_reader/entry.rb b/lib/rubygems/package/tar_reader/entry.rb
index 5f958edc2f..737c7639c6 100644
--- a/lib/rubygems/package/tar_reader/entry.rb
+++ b/lib/rubygems/package/tar_reader/entry.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#++
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
@@ -104,13 +103,6 @@ class Gem::Package::TarReader::Entry
end
##
- # Is this tar entry a symlink?
-
- def symlink?
- @header.typeflag == "2"
- end
-
- ##
# The position in the tar entry
def pos
@@ -152,3 +144,4 @@ class Gem::Package::TarReader::Entry
end
end
+
diff --git a/lib/rubygems/package/tar_test_case.rb b/lib/rubygems/package/tar_test_case.rb
index 46ac949587..5253e32f36 100644
--- a/lib/rubygems/package/tar_test_case.rb
+++ b/lib/rubygems/package/tar_test_case.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/test_case'
require 'rubygems/package'
@@ -72,7 +71,7 @@ class Gem::Package::TarTestCase < Gem::TestCase
SP(Z(to_oct(sum, 6)))
end
- def header(type, fname, dname, length, mode, mtime, checksum = nil, linkname = "")
+ def header(type, fname, dname, length, mode, mtime, checksum = nil)
checksum ||= " " * 8
arr = [ # struct tarfile_entry_posix
@@ -84,7 +83,7 @@ class Gem::Package::TarTestCase < Gem::TestCase
Z(to_oct(mtime, 11)), # char mtime[12]; 0 padded, octal, null
checksum, # char checksum[8]; 0 padded, octal, null, space
type, # char typeflag[1]; file: "0" dir: "5"
- ASCIIZ(linkname, 100), # char linkname[100]; ASCII + (Z unless filled)
+ "\0" * 100, # char linkname[100]; ASCII + (Z unless filled)
"ustar\0", # char magic[6]; "ustar\0"
"00", # char version[2]; "00"
ASCIIZ("wheel", 32), # char uname[32]; ASCIIZ
@@ -118,12 +117,6 @@ class Gem::Package::TarTestCase < Gem::TestCase
header("0", fname, dname, length, mode, mtime, checksum)
end
- def tar_symlink_header(fname, prefix, mode, mtime, linkname)
- h = header("2", fname, prefix, 0, mode, mtime, nil, linkname)
- checksum = calc_checksum(h)
- header("2", fname, prefix, 0, mode, mtime, checksum, linkname)
- end
-
def to_oct(n, pad_size)
"%0#{pad_size}o" % n
end
@@ -140,8 +133,5 @@ class Gem::Package::TarTestCase < Gem::TestCase
util_entry tar_dir_header("foo", "bar", 0, Time.now)
end
- def util_symlink_entry
- util_entry tar_symlink_header("foo", "bar", 0, Time.now, "link")
- end
-
end
+
diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb
index 390f7851a3..e1b38ad6b5 100644
--- a/lib/rubygems/package/tar_writer.rb
+++ b/lib/rubygems/package/tar_writer.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#--
# Copyright (C) 2004 Mauricio Julio Fernández Pradier
# See LICENSE.txt for additional licensing information.
@@ -196,8 +195,6 @@ class Gem::Package::TarWriter
digest_name == signer.digest_name
end
- raise "no #{signer.digest_name} in #{digests.values.compact}" unless signature_digest
-
if signer.key then
signature = signer.sign signature_digest.digest
@@ -237,25 +234,6 @@ class Gem::Package::TarWriter
end
##
- # Adds symlink +name+ with permissions +mode+, linking to +target+.
-
- def add_symlink(name, target, mode)
- check_closed
-
- name, prefix = split_name name
-
- header = Gem::Package::TarHeader.new(:name => name, :mode => mode,
- :size => 0, :typeflag => "2",
- :linkname => target,
- :prefix => prefix,
- :mtime => Time.now).to_s
-
- @io.write header
-
- self
- end
-
- ##
# Raises IOError if the TarWriter is closed
def check_closed
@@ -312,26 +290,26 @@ class Gem::Package::TarWriter
# Splits +name+ into a name and prefix that can fit in the TarHeader
def split_name(name) # :nodoc:
- if name.bytesize > 256 then
- raise Gem::Package::TooLongFileName.new("File \"#{name}\" has a too long path (should be 256 or less)")
- end
-
- prefix = ''
- if name.bytesize > 100 then
- parts = name.split('/', -1) # parts are never empty here
- name = parts.pop # initially empty for names with a trailing slash ("foo/.../bar/")
- prefix = parts.join('/') # if empty, then it's impossible to split (parts is empty too)
- while !parts.empty? && (prefix.bytesize > 155 || name.empty?)
- name = parts.pop + '/' + name
- prefix = parts.join('/')
+ raise Gem::Package::TooLongFileName if name.bytesize > 256
+
+ if name.bytesize <= 100 then
+ prefix = ""
+ else
+ parts = name.split(/\//)
+ newname = parts.pop
+ nxt = ""
+
+ loop do
+ nxt = parts.pop
+ break if newname.bytesize + 1 + nxt.bytesize > 100
+ newname = nxt + "/" + newname
end
- if name.bytesize > 100 or prefix.empty? then
- raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long name (should be 100 or less)")
- end
+ prefix = (parts + [nxt]).join "/"
+ name = newname
- if prefix.bytesize > 155 then
- raise Gem::Package::TooLongFileName.new("File \"#{prefix}/#{name}\" has a too long base path (should be 155 or less)")
+ if name.bytesize > 100 or prefix.bytesize > 155 then
+ raise Gem::Package::TooLongFileName
end
end
@@ -339,3 +317,4 @@ class Gem::Package::TarWriter
end
end
+
diff --git a/lib/rubygems/package_task.rb b/lib/rubygems/package_task.rb
index d554e3697b..09384cc0e7 100644
--- a/lib/rubygems/package_task.rb
+++ b/lib/rubygems/package_task.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# Copyright (c) 2003, 2004 Jim Weirich, 2009 Eric Hodel
#
# Permission is hereby granted, free of charge, to any person obtaining
diff --git a/lib/rubygems/path_support.rb b/lib/rubygems/path_support.rb
index 618bc793c4..2af303eecf 100644
--- a/lib/rubygems/path_support.rb
+++ b/lib/rubygems/path_support.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
#
# Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings
@@ -22,16 +21,21 @@ class Gem::PathSupport
# Constructor. Takes a single argument which is to be treated like a
# hashtable, or defaults to ENV, the system environment.
#
- def initialize(env)
- @home = env["GEM_HOME"] || Gem.default_dir
+ def initialize(env=ENV)
+ @env = env
+
+ # note 'env' vs 'ENV'...
+ @home = env["GEM_HOME"] || ENV["GEM_HOME"] || Gem.default_dir
if File::ALT_SEPARATOR then
@home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
end
- @path = split_gem_path env["GEM_PATH"], @home
+ self.path = env["GEM_PATH"] || ENV["GEM_PATH"]
- @spec_cache_dir = env["GEM_SPEC_CACHE"] || Gem.default_spec_cache_dir
+ @spec_cache_dir =
+ env["GEM_SPEC_CACHE"] || ENV["GEM_SPEC_CACHE"] ||
+ Gem.default_spec_cache_dir
@spec_cache_dir = @spec_cache_dir.dup.untaint
end
@@ -39,19 +43,28 @@ class Gem::PathSupport
private
##
- # Split the Gem search path (as reported by Gem.path).
+ # Set the Gem home directory (as reported by Gem.dir).
+
+ def home=(home)
+ @home = home.to_s
+ end
+
+ ##
+ # Set the Gem search path (as reported by Gem.path).
- def split_gem_path gpaths, home
+ def path=(gpaths)
# FIX: it should be [home, *path], not [*path, home]
gem_path = []
+ # FIX: I can't tell wtf this is doing.
+ gpaths ||= (ENV['GEM_PATH'] || "").empty? ? nil : ENV["GEM_PATH"]
+
if gpaths
- gem_path = gpaths.split(Gem.path_separator)
- # Handle the path_separator being set to a regexp, which will cause
- # end_with? to error
- if gpaths =~ /#{Gem.path_separator}\z/
- gem_path += default_path
+ if gpaths.kind_of?(Array)
+ gem_path = gpaths.dup
+ else
+ gem_path = gpaths.split(Gem.path_separator)
end
if File::ALT_SEPARATOR then
@@ -60,21 +73,15 @@ class Gem::PathSupport
end
end
- gem_path << home
+ gem_path << @home
else
- gem_path = default_path
- end
-
- gem_path.uniq
- end
+ gem_path = Gem.default_path + [@home]
- # Return the default Gem path
- def default_path
- gem_path = Gem.default_path + [@home]
-
- if defined?(APPLE_GEM_HOME)
- gem_path << APPLE_GEM_HOME
+ if defined?(APPLE_GEM_HOME)
+ gem_path << APPLE_GEM_HOME
+ end
end
- gem_path
+
+ @path = gem_path.uniq
end
end
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 2dd9ed5782..fa56141631 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require "rubygems/deprecate"
##
@@ -96,7 +95,6 @@ class Gem::Platform
[os, version]
when /netbsdelf/ then [ 'netbsdelf', nil ]
when /openbsd(\d+\.\d+)?/ then [ 'openbsd', $1 ]
- when /bitrig(\d+\.\d+)?/ then [ 'bitrig', $1 ]
when /solaris(\d+\.\d+)?/ then [ 'solaris', $1 ]
# test
when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
@@ -112,7 +110,7 @@ class Gem::Platform
end
def inspect
- "%s @cpu=%p, @os=%p, @version=%p>" % [super[0..-2], *to_a]
+ "#<%s:0x%x @cpu=%p, @os=%p, @version=%p>" % [self.class, object_id, *to_a]
end
def to_a
@@ -149,8 +147,8 @@ class Gem::Platform
return nil unless Gem::Platform === other
# cpu
- ([nil,'universal'].include?(@cpu) or [nil, 'universal'].include?(other.cpu) or @cpu == other.cpu or
- (@cpu == 'arm' and other.cpu =~ /\Aarm/)) and
+ (@cpu == 'universal' or other.cpu == 'universal' or @cpu == other.cpu or
+ (@cpu == 'arm' and other.cpu =~ /\Aarm/)) and
# os
@os == other.os and
diff --git a/lib/rubygems/psych_additions.rb b/lib/rubygems/psych_additions.rb
index 1ddd74421c..0e4ebbd50c 100644
--- a/lib/rubygems/psych_additions.rb
+++ b/lib/rubygems/psych_additions.rb
@@ -1,5 +1,4 @@
-# frozen_string_literal: true
-# This exists just to satisfy bugs in marshal'd gemspecs that
+# This exists just to satify bugs in marshal'd gemspecs that
# contain a reference to YAML::PrivateType. We prune these out
# in Specification._load, but if we don't have the constant, Marshal
# blows up.
diff --git a/lib/rubygems/psych_tree.rb b/lib/rubygems/psych_tree.rb
index 41a7314b53..e3f1d1a08a 100644
--- a/lib/rubygems/psych_tree.rb
+++ b/lib/rubygems/psych_tree.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Gem
if defined? ::Psych::Visitors
class NoAliasYAMLTree < Psych::Visitors::YAMLTree
diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb
index 7043bd2a31..180b95fbf3 100644
--- a/lib/rubygems/rdoc.rb
+++ b/lib/rubygems/rdoc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/user_interaction'
require 'fileutils'
@@ -21,7 +20,7 @@ begin
require 'rdoc/rubygems_hook'
loaded_hook = true
module Gem
- RDoc = ::RDoc::RubygemsHook
+ RDoc = RDoc::RubygemsHook
end
rescue LoadError
end
@@ -333,3 +332,4 @@ class Gem::RDoc # :nodoc: all
end unless loaded_hook
Gem.done_installing(&Gem::RDoc.method(:generation_hook))
+
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb
index 8f0cf0b402..607827c47e 100644
--- a/lib/rubygems/remote_fetcher.rb
+++ b/lib/rubygems/remote_fetcher.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
require 'rubygems/request'
require 'rubygems/uri_formatter'
@@ -27,13 +26,7 @@ class Gem::RemoteFetcher
def initialize(message, uri)
super message
- begin
- uri = URI(uri)
- uri.password = 'REDACTED' if uri.password
- @uri = uri.to_s
- rescue URI::InvalidURIError, ArgumentError
- @uri = uri
- end
+ @uri = uri
end
def to_s # :nodoc:
@@ -58,8 +51,6 @@ class Gem::RemoteFetcher
@fetcher ||= self.new Gem.configuration[:http_proxy]
end
- attr_accessor :headers
-
##
# Initialize a remote fetcher using the source URI and possible proxy
# information.
@@ -73,11 +64,8 @@ class Gem::RemoteFetcher
#
# +dns+: An object to use for DNS resolution of the API endpoint.
# By default, use Resolv::DNS.
- #
- # +headers+: A set of additional HTTP headers to be sent to the server when
- # fetching the gem.
- def initialize(proxy=nil, dns=Resolv::DNS.new, headers={})
+ def initialize(proxy=nil, dns=Resolv::DNS.new)
require 'net/http'
require 'stringio'
require 'time'
@@ -91,7 +79,6 @@ class Gem::RemoteFetcher
@cert_files = Gem::Request.get_cert_files
@dns = dns
- @headers = headers
end
##
@@ -104,17 +91,10 @@ class Gem::RemoteFetcher
begin
res = @dns.getresource "_rubygems._tcp.#{host}",
Resolv::DNS::Resource::IN::SRV
- rescue Resolv::ResolvError => e
- verbose "Getting SRV record failed: #{e}"
+ rescue Resolv::ResolvError
uri
else
- target = res.target.to_s.strip
-
- if URI("http://" + target).host.end_with?(".#{host}")
- return URI.parse "#{uri.scheme}://#{target}#{uri.path}"
- end
-
- uri
+ URI.parse "#{uri.scheme}://#{res.target}#{uri.path}"
end
end
@@ -123,7 +103,7 @@ class Gem::RemoteFetcher
# filename. Returns nil if the gem cannot be located.
#--
# Should probably be integrated with #download below, but that will be a
- # larger, more encompassing effort. -erikh
+ # larger, more emcompassing effort. -erikh
def download_to_cache dependency
found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dependency
@@ -248,9 +228,7 @@ class Gem::RemoteFetcher
def fetch_http uri, last_modified = nil, head = false, depth = 0
fetch_type = head ? Net::HTTP::Head : Net::HTTP::Get
- response = request uri, fetch_type, last_modified do |req|
- headers.each { |k,v| req.add_field(k,v) }
- end
+ response = request uri, fetch_type, last_modified
case response
when Net::HTTPOK, Net::HTTPNotModified then
@@ -260,9 +238,6 @@ class Gem::RemoteFetcher
Net::HTTPTemporaryRedirect then
raise FetchError.new('too many redirects', uri) if depth > 10
- unless location = response['Location']
- raise FetchError.new("redirecting but no redirect location was given", uri)
- end
location = URI.parse response['Location']
if https?(uri) && !https?(location)
@@ -331,7 +306,10 @@ class Gem::RemoteFetcher
end
if update and path
- Gem.write_binary(path, data)
+ open(path, 'wb') do |io|
+ io.flock(File::LOCK_EX)
+ io.write data
+ end
end
data
@@ -348,7 +326,7 @@ class Gem::RemoteFetcher
def correct_for_windows_path(path)
if path[0].chr == '/' && path[1].chr =~ /[a-z]/i && path[2].chr == ':'
- path[1..-1]
+ path = path[1..-1]
else
path
end
@@ -374,10 +352,6 @@ class Gem::RemoteFetcher
uri.scheme.downcase == 'https'
end
- def close_all
- @pools.each_value {|pool| pool.close_all}
- end
-
protected
# we have our own signing code here to avoid a dependency on the aws-sdk gem
@@ -417,3 +391,4 @@ class Gem::RemoteFetcher
end
end
end
+
diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb
index 81699b98fe..702769c500 100644
--- a/lib/rubygems/request.rb
+++ b/lib/rubygems/request.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'net/http'
require 'thread'
require 'time'
@@ -6,7 +5,6 @@ require 'rubygems/user_interaction'
class Gem::Request
- extend Gem::UserInteraction
include Gem::UserInteraction
###
@@ -41,7 +39,7 @@ class Gem::Request
def cert_files; @connection_pool.cert_files; end
def self.get_cert_files
- pattern = File.expand_path("./ssl_certs/*/*.pem", File.dirname(__FILE__))
+ pattern = File.expand_path("./ssl_certs/*.pem", File.dirname(__FILE__))
Dir.glob(pattern)
end
@@ -70,58 +68,13 @@ class Gem::Request
end
end
connection.cert_store = store
-
- connection.verify_callback = proc do |preverify_ok, store_context|
- verify_certificate store_context unless preverify_ok
-
- preverify_ok
- end
-
connection
rescue LoadError => e
raise unless (e.respond_to?(:path) && e.path == 'openssl') ||
e.message =~ / -- openssl$/
raise Gem::Exception.new(
- 'Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources')
- end
-
- def self.verify_certificate store_context
- depth = store_context.error_depth
- error = store_context.error_string
- number = store_context.error
- cert = store_context.current_cert
-
- ui.alert_error "SSL verification error at depth #{depth}: #{error} (#{number})"
-
- extra_message = verify_certificate_message number, cert
-
- ui.alert_error extra_message if extra_message
- end
-
- def self.verify_certificate_message error_number, cert
- return unless cert
- case error_number
- when OpenSSL::X509::V_ERR_CERT_HAS_EXPIRED then
- "Certificate #{cert.subject} expired at #{cert.not_after.iso8601}"
- when OpenSSL::X509::V_ERR_CERT_NOT_YET_VALID then
- "Certificate #{cert.subject} not valid until #{cert.not_before.iso8601}"
- when OpenSSL::X509::V_ERR_CERT_REJECTED then
- "Certificate #{cert.subject} is rejected"
- when OpenSSL::X509::V_ERR_CERT_UNTRUSTED then
- "Certificate #{cert.subject} is not trusted"
- when OpenSSL::X509::V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT then
- "Certificate #{cert.issuer} is not trusted"
- when OpenSSL::X509::V_ERR_INVALID_CA then
- "Certificate #{cert.subject} is an invalid CA certificate"
- when OpenSSL::X509::V_ERR_INVALID_PURPOSE then
- "Certificate #{cert.subject} has an invalid purpose"
- when OpenSSL::X509::V_ERR_SELF_SIGNED_CERT_IN_CHAIN then
- "Root certificate is not trusted (#{cert.subject})"
- when OpenSSL::X509::V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
- OpenSSL::X509::V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE then
- "You must add #{cert.issuer} to your local trusted store"
- end
+ 'Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources')
end
##
@@ -202,7 +155,7 @@ class Gem::Request
if Net::HTTPOK === incomplete_response
reporter.fetch(file_name, incomplete_response.content_length)
downloaded = 0
- data = String.new
+ data = ''
incomplete_response.read_body do |segment|
data << segment
@@ -232,10 +185,6 @@ class Gem::Request
bad_response = true
retry
- rescue Net::HTTPFatalError
- verbose "fatal error"
-
- raise Gem::RemoteFetcher::FetchError.new('fatal error', @uri)
# HACK work around EOFError bug in Net::HTTP
# NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible
# to install gems.
@@ -269,7 +218,7 @@ class Gem::Request
end
def user_agent
- ua = "RubyGems/#{Gem::VERSION} #{Gem::Platform.local}".dup
+ ua = "RubyGems/#{Gem::VERSION} #{Gem::Platform.local}"
ruby_version = RUBY_VERSION
ruby_version += 'dev' if RUBY_PATCHLEVEL == -1
@@ -292,3 +241,4 @@ end
require 'rubygems/request/http_pool'
require 'rubygems/request/https_pool'
require 'rubygems/request/connection_pools'
+
diff --git a/lib/rubygems/request/connection_pools.rb b/lib/rubygems/request/connection_pools.rb
index 31fc609800..27ee99c20d 100644
--- a/lib/rubygems/request/connection_pools.rb
+++ b/lib/rubygems/request/connection_pools.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'thread'
class Gem::Request::ConnectionPools # :nodoc:
@@ -29,10 +28,6 @@ class Gem::Request::ConnectionPools # :nodoc:
end
end
- def close_all
- @pools.each_value {|pool| pool.close_all}
- end
-
private
##
@@ -62,23 +57,19 @@ class Gem::Request::ConnectionPools # :nodoc:
end
def net_http_args uri, proxy_uri
- # URI::Generic#hostname was added in ruby 1.9.3, use it if exists, otherwise
- # don't support IPv6 literals and use host.
- hostname = uri.respond_to?(:hostname) ? uri.hostname : uri.host
- net_http_args = [hostname, uri.port]
+ net_http_args = [uri.host, uri.port]
no_proxy = get_no_proxy_from_env
- if proxy_uri and not no_proxy?(hostname, no_proxy) then
- proxy_hostname = proxy_uri.respond_to?(:hostname) ? proxy_uri.hostname : proxy_uri.host
+ if proxy_uri and not no_proxy?(uri.host, no_proxy) then
net_http_args + [
- proxy_hostname,
+ proxy_uri.host,
proxy_uri.port,
Gem::UriFormatter.new(proxy_uri.user).unescape,
Gem::UriFormatter.new(proxy_uri.password).unescape,
]
- elsif no_proxy? hostname, no_proxy then
- net_http_args + [nil, nil]
+ elsif no_proxy? uri.host, no_proxy then
+ net_http_args += [nil, nil]
else
net_http_args
end
diff --git a/lib/rubygems/request/http_pool.rb b/lib/rubygems/request/http_pool.rb
index bfcd15399d..61c8884af7 100644
--- a/lib/rubygems/request/http_pool.rb
+++ b/lib/rubygems/request/http_pool.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A connection "pool" that only manages one connection for now. Provides
# thread safe `checkout` and `checkin` methods. The pool consists of one
@@ -24,15 +23,6 @@ class Gem::Request::HTTPPool # :nodoc:
@queue.push connection
end
- def close_all
- until @queue.empty?
- if connection = @queue.pop(true) and connection.started?
- connection.finish
- end
- end
- @queue.push(nil)
- end
-
private
def make_connection
diff --git a/lib/rubygems/request/https_pool.rb b/lib/rubygems/request/https_pool.rb
index e82c2440e1..2e3da0a44e 100644
--- a/lib/rubygems/request/https_pool.rb
+++ b/lib/rubygems/request/https_pool.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class Gem::Request::HTTPSPool < Gem::Request::HTTPPool # :nodoc:
private
diff --git a/lib/rubygems/request_set.rb b/lib/rubygems/request_set.rb
index 95a8eed1af..d12e06358d 100644
--- a/lib/rubygems/request_set.rb
+++ b/lib/rubygems/request_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'tsort'
##
@@ -78,11 +77,6 @@ class Gem::RequestSet
attr_reader :vendor_set # :nodoc:
##
- # The set of source gems imported via load_gemdeps.
-
- attr_reader :source_set
-
- ##
# Creates a RequestSet for a list of Gem::Dependency objects, +deps+. You
# can then #resolve and #install the resolved list of dependencies.
#
@@ -111,7 +105,6 @@ class Gem::RequestSet
@sorted = nil
@specs = nil
@vendor_set = nil
- @source_set = nil
yield self if block_given?
end
@@ -123,7 +116,7 @@ class Gem::RequestSet
if dep = @dependency_names[name] then
dep.requirement.concat reqs
else
- dep = Gem::Dependency.new name, *reqs
+ dep = Gem::Dependency.new name, reqs
@dependency_names[name] = dep
@dependencies << dep
end
@@ -149,6 +142,7 @@ class Gem::RequestSet
return requests
end
+ cache_dir = options[:cache_dir] || Gem.dir
@prerelease = options[:prerelease]
requests = []
@@ -163,30 +157,18 @@ class Gem::RequestSet
end
end
- spec =
- begin
- req.spec.install options do |installer|
- yield req, installer if block_given?
- end
- rescue Gem::RuntimeRequirementNotMetError => e
- recent_match = req.spec.set.find_all(req.request).sort_by(&:version).reverse_each.find do |s|
- s = s.spec
- s.required_ruby_version.satisfied_by?(Gem.ruby_version) && s.required_rubygems_version.satisfied_by?(Gem.rubygems_version)
- end
- if recent_match
- suggestion = "The last version of #{req.request} to support your Ruby & RubyGems was #{recent_match.version}. Try installing it with `gem install #{recent_match.name} -v #{recent_match.version}`"
- suggestion += " and then running the current command again" unless @always_install.include?(req.spec.spec)
- else
- suggestion = "There are no versions of #{req.request} compatible with your Ruby & RubyGems"
- suggestion += ". Maybe try installing an older version of the gem you're looking for?" unless @always_install.include?(req.spec.spec)
- end
- e.suggestion = suggestion
- raise
- end
+ path = req.download cache_dir
- requests << spec
+ inst = Gem::Installer.new path, options
+
+ yield req, inst if block_given?
+
+ requests << inst.install
end
+ requests
+ ensure
+ raise if $!
return requests if options[:gemdeps]
specs = requests.map do |request|
@@ -205,8 +187,6 @@ class Gem::RequestSet
Gem.done_installing_hooks.each do |hook|
hook.call inst, specs
end unless Gem.done_installing_hooks.empty?
-
- requests
end
##
@@ -243,7 +223,7 @@ class Gem::RequestSet
if options.fetch :lock, true then
lockfile =
- Gem::RequestSet::Lockfile.build self, gemdeps, gem_deps_api.dependencies
+ Gem::RequestSet::Lockfile.new self, gemdeps, gem_deps_api.dependencies
lockfile.write
end
@@ -292,17 +272,11 @@ class Gem::RequestSet
def load_gemdeps path, without_groups = [], installing = false
@git_set = Gem::Resolver::GitSet.new
@vendor_set = Gem::Resolver::VendorSet.new
- @source_set = Gem::Resolver::SourceSet.new
@git_set.root_dir = @install_dir
- lock_file = "#{File.expand_path(path)}.lock".dup.untaint
- begin
- tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
- parser = tokenizer.make_parser self, []
- parser.parse
- rescue Errno::ENOENT
- end
+ lockfile = Gem::RequestSet::Lockfile.new self, path
+ lockfile.parse
gf = Gem::RequestSet::GemDependencyAPI.new self, path
gf.installing = installing
@@ -310,48 +284,6 @@ class Gem::RequestSet
gf.load
end
- def pretty_print q # :nodoc:
- q.group 2, '[RequestSet:', ']' do
- q.breakable
-
- if @remote then
- q.text 'remote'
- q.breakable
- end
-
- if @prerelease then
- q.text 'prerelease'
- q.breakable
- end
-
- if @development_shallow then
- q.text 'shallow development'
- q.breakable
- elsif @development then
- q.text 'development'
- q.breakable
- end
-
- if @soft_missing then
- q.text 'soft missing'
- end
-
- q.group 2, '[dependencies:', ']' do
- q.breakable
- @dependencies.map do |dep|
- q.text dep.to_s
- q.breakable
- end
- end
-
- q.breakable
- q.text 'sets:'
-
- q.breakable
- q.pp @sets.map { |set| set.class }
- end
- end
-
##
# Resolve the requested dependencies and return an Array of Specification
# objects to be activated.
@@ -360,7 +292,6 @@ class Gem::RequestSet
@sets << set
@sets << @git_set
@sets << @vendor_set
- @sets << @source_set
set = Gem::Resolver.compose_sets(*@sets)
set.remote = @remote
@@ -430,7 +361,10 @@ class Gem::RequestSet
"Unresolved dependency found during sorting - #{dep} (requested by #{node.spec.full_name})"
end
- yield match
+ begin
+ yield match
+ rescue TSort::Cyclic
+ end
end
end
@@ -438,4 +372,3 @@ end
require 'rubygems/request_set/gem_dependency_api'
require 'rubygems/request_set/lockfile'
-require 'rubygems/request_set/lockfile/tokenizer'
diff --git a/lib/rubygems/request_set/gem_dependency_api.rb b/lib/rubygems/request_set/gem_dependency_api.rb
index 867086cc0e..24179dd1ed 100644
--- a/lib/rubygems/request_set/gem_dependency_api.rb
+++ b/lib/rubygems/request_set/gem_dependency_api.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
# files.
@@ -175,7 +174,7 @@ class Gem::RequestSet::GemDependencyAPI
##
# A Hash containing gem names and files to require from those gems.
- attr_reader :requires
+ attr_reader :requires # :nodoc:
##
# A set of gems that are loaded via the +:path+ option to #gem
@@ -205,7 +204,6 @@ class Gem::RequestSet::GemDependencyAPI
@installing = false
@requires = Hash.new { |h, name| h[name] = [] }
@vendor_set = @set.vendor_set
- @source_set = @set.source_set
@gem_sources = {}
@without_groups = []
@@ -364,17 +362,16 @@ class Gem::RequestSet::GemDependencyAPI
source_set ||= gem_path name, options
source_set ||= gem_git name, options
source_set ||= gem_git_source name, options
- source_set ||= gem_source name, options
duplicate = @dependencies.include? name
@dependencies[name] =
if requirements.empty? and not source_set then
- Gem::Requirement.default
+ nil
elsif source_set then
- Gem::Requirement.source_set
+ '!'
else
- Gem::Requirement.create requirements
+ requirements
end
return unless gem_platforms options
@@ -399,7 +396,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
##
# Handles the git: option from +options+ for gem +name+.
#
- # Returns +true+ if the gist or git option was handled.
+ # Returns +true+ if the path option was handled.
def gem_git name, options # :nodoc:
if gist = options.delete(:gist) then
@@ -410,7 +407,11 @@ Gem dependencies file #{@path} requires #{name} more than once.
pin_gem_source name, :git, repository
- reference = gem_git_reference options
+ reference = nil
+ reference ||= options.delete :ref
+ reference ||= options.delete :branch
+ reference ||= options.delete :tag
+ reference ||= 'master'
submodules = options.delete :submodules
@@ -419,36 +420,6 @@ Gem dependencies file #{@path} requires #{name} more than once.
true
end
- ##
- # Handles the git options from +options+ for git gem.
- #
- # Returns reference for the git gem.
-
- def gem_git_reference options # :nodoc:
- ref = options.delete :ref
- branch = options.delete :branch
- tag = options.delete :tag
-
- reference = nil
- reference ||= ref
- reference ||= branch
- reference ||= tag
- reference ||= 'master'
-
- if ref && branch
- warn <<-WARNING
-Gem dependencies file #{@path} includes git reference for both ref and branch but only ref is used.
- WARNING
- end
- if (ref||branch) && tag
- warn <<-WARNING
-Gem dependencies file #{@path} includes git reference for both ref/branch and tag but only ref/branch is used.
- WARNING
- end
-
- reference
- end
-
private :gem_git
##
@@ -510,23 +481,6 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
private :gem_path
##
- # Handles the source: option from +options+ for gem +name+.
- #
- # Returns +true+ if the source option was handled.
-
- def gem_source name, options # :nodoc:
- return unless source = options.delete(:source)
-
- pin_gem_source name, :source, source
-
- @source_set.add_source_gem name, source
-
- true
- end
-
- private :gem_source
-
- ##
# Handles the platforms: option from +options+. Returns true if the
# platform matches the current platform.
@@ -572,7 +526,6 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
else
@requires[name] << name
end
- raise ArgumentError, "Unhandled gem options #{options.inspect}" unless options.empty?
end
private :gem_requires
@@ -643,22 +596,12 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
groups = gem_group spec.name, {}
- self_dep = Gem::Dependency.new spec.name, spec.version
-
- add_dependencies groups, [self_dep]
add_dependencies groups, spec.runtime_dependencies
- @dependencies[spec.name] = Gem::Requirement.source_set
-
- spec.dependencies.each do |dep|
- @dependencies[dep.name] = dep.requirement
- end
-
groups << development_group
add_dependencies groups, spec.development_dependencies
- @vendor_set.add_vendor_gem spec.name, path
gem_requires spec.name, options
end
@@ -698,7 +641,6 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
when :default then '(default)'
when :path then "path: #{source}"
when :git then "git: #{source}"
- when :source then "source: #{source}"
else '(unknown)'
end
@@ -786,7 +728,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
engine_version = options[:engine_version]
raise ArgumentError,
- 'You must specify engine_version along with the Ruby engine' if
+ 'you must specify engine_version along with the ruby engine' if
engine and not engine_version
return true if @installing
@@ -799,7 +741,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
end
if engine and engine != Gem.ruby_engine then
- message = "Your Ruby engine is #{Gem.ruby_engine}, " +
+ message = "Your ruby engine is #{Gem.ruby_engine}, " +
"but your #{gem_deps_file} requires #{engine}"
raise Gem::RubyVersionMismatch, message
@@ -810,7 +752,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
if engine_version != my_engine_version then
message =
- "Your Ruby engine version is #{Gem.ruby_engine} #{my_engine_version}, " +
+ "Your ruby engine version is #{Gem.ruby_engine} #{my_engine_version}, " +
"but your #{gem_deps_file} requires #{engine} #{engine_version}"
raise Gem::RubyVersionMismatch, message
@@ -847,3 +789,4 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
end
+
diff --git a/lib/rubygems/request_set/lockfile.rb b/lib/rubygems/request_set/lockfile.rb
index 76ad17d486..2901dba871 100644
--- a/lib/rubygems/request_set/lockfile.rb
+++ b/lib/rubygems/request_set/lockfile.rb
@@ -1,10 +1,12 @@
-# frozen_string_literal: true
+require 'strscan'
+
##
# Parses a gem.deps.rb.lock file and constructs a LockSet containing the
# dependencies found inside. If the lock file is missing no LockSet is
# constructed.
class Gem::RequestSet::Lockfile
+
##
# Raised when a lockfile cannot be parsed
@@ -35,35 +37,7 @@ class Gem::RequestSet::Lockfile
@path = path
super "#{message} (at line #{line} column #{column})"
end
- end
-
- ##
- # Creates a new Lockfile for the given +request_set+ and +gem_deps_file+
- # location.
-
- def self.build request_set, gem_deps_file, dependencies = nil
- request_set.resolve
- dependencies ||= requests_to_deps request_set.sorted_requests
- new request_set, gem_deps_file, dependencies
- end
-
- def self.requests_to_deps requests # :nodoc:
- deps = {}
-
- requests.each do |request|
- spec = request.spec
- name = request.name
- requirement = request.request.dependency.requirement
-
- deps[name] = if [Gem::Resolver::VendorSpecification,
- Gem::Resolver::GitSpecification].include? spec.class then
- Gem::Requirement.source_set
- else
- requirement
- end
- end
- deps
end
##
@@ -71,7 +45,11 @@ class Gem::RequestSet::Lockfile
attr_reader :platforms
- def initialize request_set, gem_deps_file, dependencies
+ ##
+ # Creates a new Lockfile for the given +request_set+ and +gem_deps_file+
+ # location.
+
+ def initialize request_set, gem_deps_file, dependencies = nil
@set = request_set
@dependencies = dependencies
@gem_deps_file = File.expand_path(gem_deps_file)
@@ -79,23 +57,59 @@ class Gem::RequestSet::Lockfile
@gem_deps_file.untaint unless gem_deps_file.tainted?
+ @current_token = nil
+ @line = 0
+ @line_pos = 0
@platforms = []
+ @tokens = []
end
def add_DEPENDENCIES out # :nodoc:
out << "DEPENDENCIES"
- out.concat @dependencies.sort_by { |name,| name }.map { |name, requirement|
- " #{name}#{requirement.for_lockfile}"
- }
+ dependencies =
+ if @dependencies then
+ @dependencies.sort_by { |name,| name }.map do |name, requirement|
+ requirement_string =
+ if '!' == requirement then
+ requirement
+ else
+ Gem::Requirement.new(requirement).for_lockfile
+ end
+
+ [name, requirement_string]
+ end
+ else
+ @requests.sort_by { |r| r.name }.map do |request|
+ spec = request.spec
+ name = request.name
+ requirement = request.request.dependency.requirement
+
+ requirement_string =
+ if [Gem::Resolver::VendorSpecification,
+ Gem::Resolver::GitSpecification].include? spec.class then
+ "!"
+ else
+ requirement.for_lockfile
+ end
+
+ [name, requirement_string]
+ end
+ end
+
+ dependencies = dependencies.map do |name, requirement_string|
+ " #{name}#{requirement_string}"
+ end
+
+ out.concat dependencies
out << nil
end
- def add_GEM out, spec_groups # :nodoc:
- return if spec_groups.empty?
+ def add_GEM out # :nodoc:
+ return if @spec_groups.empty?
- source_groups = spec_groups.values.flatten.group_by do |request|
+ source_groups = @spec_groups.values.flatten.group_by do |request|
request.spec.source.uri
end
@@ -122,16 +136,17 @@ class Gem::RequestSet::Lockfile
end
end
- def add_GIT out, git_requests
- return if git_requests.empty?
+ def add_GIT out
+ return unless git_requests =
+ @spec_groups.delete(Gem::Resolver::GitSpecification)
by_repository_revision = git_requests.group_by do |request|
source = request.spec.source
[source.repository, source.rev_parse]
end
+ out << "GIT"
by_repository_revision.each do |(repository, revision), requests|
- out << "GIT"
out << " remote: #{repository}"
out << " revision: #{revision}"
out << " specs:"
@@ -144,27 +159,25 @@ class Gem::RequestSet::Lockfile
out << " #{dep.name}#{dep.requirement.for_lockfile}"
end
end
- out << nil
end
+
+ out << nil
end
def relative_path_from dest, base # :nodoc:
dest = File.expand_path(dest)
base = File.expand_path(base)
- if dest.index(base) == 0 then
- offset = dest[base.size+1..-1]
-
- return '.' unless offset
-
- offset
+ if dest.index(base) == 0
+ return dest[base.size+1..-1]
else
dest
end
end
- def add_PATH out, path_requests # :nodoc:
- return if path_requests.empty?
+ def add_PATH out # :nodoc:
+ return unless path_requests =
+ @spec_groups.delete(Gem::Resolver::VendorSpecification)
out << "PATH"
path_requests.each do |request|
@@ -181,34 +194,338 @@ class Gem::RequestSet::Lockfile
def add_PLATFORMS out # :nodoc:
out << "PLATFORMS"
- platforms = requests.map { |request| request.spec.platform }.uniq
+ platforms = @requests.map { |request| request.spec.platform }.uniq
- platforms = platforms.sort_by { |platform| platform.to_s }
-
- platforms.each do |platform|
+ platforms.sort.each do |platform|
out << " #{platform}"
end
out << nil
end
- def spec_groups
- requests.group_by { |request| request.spec.class }
+ ##
+ # Gets the next token for a Lockfile
+
+ def get expected_types = nil, expected_value = nil # :nodoc:
+ @current_token = @tokens.shift
+
+ type, value, column, line = @current_token
+
+ if expected_types and not Array(expected_types).include? type then
+ unget
+
+ message = "unexpected token [#{type.inspect}, #{value.inspect}], " +
+ "expected #{expected_types.inspect}"
+
+ raise ParseError.new message, column, line, "#{@gem_deps_file}.lock"
+ end
+
+ if expected_value and expected_value != value then
+ unget
+
+ message = "unexpected token [#{type.inspect}, #{value.inspect}], " +
+ "expected [#{expected_types.inspect}, " +
+ "#{expected_value.inspect}]"
+
+ raise ParseError.new message, column, line, "#{@gem_deps_file}.lock"
+ end
+
+ @current_token
+ end
+
+ def parse # :nodoc:
+ tokenize
+
+ until @tokens.empty? do
+ type, data, column, line = get
+
+ case type
+ when :section then
+ skip :newline
+
+ case data
+ when 'DEPENDENCIES' then
+ parse_DEPENDENCIES
+ when 'GIT' then
+ parse_GIT
+ when 'GEM' then
+ parse_GEM
+ when 'PATH' then
+ parse_PATH
+ when 'PLATFORMS' then
+ parse_PLATFORMS
+ else
+ type, = get until @tokens.empty? or peek.first == :section
+ end
+ else
+ raise "BUG: unhandled token #{type} (#{data.inspect}) at line #{line} column #{column}"
+ end
+ end
+ end
+
+ def parse_DEPENDENCIES # :nodoc:
+ while not @tokens.empty? and :text == peek.first do
+ _, name, = get :text
+
+ requirements = []
+
+ case peek[0]
+ when :bang then
+ get :bang
+
+ spec = @set.sets.select { |set|
+ Gem::Resolver::GitSet === set or
+ Gem::Resolver::VendorSet === set
+ }.map { |set|
+ set.specs[name]
+ }.compact.first
+
+ requirements << spec.version
+ when :l_paren then
+ get :l_paren
+
+ loop do
+ _, op, = get :requirement
+ _, version, = get :text
+
+ requirements << "#{op} #{version}"
+
+ break unless peek[0] == :comma
+
+ get :comma
+ end
+
+ get :r_paren
+ end
+
+ @set.gem name, *requirements
+
+ skip :newline
+ end
+ end
+
+ def parse_GEM # :nodoc:
+ sources = []
+
+ while [:entry, 'remote'] == peek.first(2) do
+ get :entry, 'remote'
+ _, data, = get :text
+ skip :newline
+
+ sources << Gem::Source.new(data)
+ end
+
+ sources << Gem::Source.new(Gem::DEFAULT_HOST) if sources.empty?
+
+ get :entry, 'specs'
+
+ skip :newline
+
+ set = Gem::Resolver::LockSet.new sources
+ last_specs = nil
+
+ while not @tokens.empty? and :text == peek.first do
+ _, name, column, = get :text
+
+ case peek[0]
+ when :newline then
+ last_specs.each do |spec|
+ spec.add_dependency Gem::Dependency.new name if column == 6
+ end
+ when :l_paren then
+ get :l_paren
+
+ type, data, = get [:text, :requirement]
+
+ if type == :text and column == 4 then
+ version, platform = data.split '-', 2
+
+ platform =
+ platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
+
+ last_specs = set.add name, version, platform
+ else
+ dependency = parse_dependency name, data
+
+ last_specs.each do |spec|
+ spec.add_dependency dependency
+ end
+ end
+
+ get :r_paren
+ else
+ raise "BUG: unknown token #{peek}"
+ end
+
+ skip :newline
+ end
+
+ @set.sets << set
+ end
+
+ def parse_GIT # :nodoc:
+ get :entry, 'remote'
+ _, repository, = get :text
+
+ skip :newline
+
+ get :entry, 'revision'
+ _, revision, = get :text
+
+ skip :newline
+
+ type, value = peek.first 2
+ if type == :entry and %w[branch ref tag].include? value then
+ get
+ get :text
+
+ skip :newline
+ end
+
+ get :entry, 'specs'
+
+ skip :newline
+
+ set = Gem::Resolver::GitSet.new
+ set.root_dir = @set.install_dir
+
+ last_spec = nil
+
+ while not @tokens.empty? and :text == peek.first do
+ _, name, column, = get :text
+
+ case peek[0]
+ when :newline then
+ last_spec.add_dependency Gem::Dependency.new name if column == 6
+ when :l_paren then
+ get :l_paren
+
+ type, data, = get [:text, :requirement]
+
+ if type == :text and column == 4 then
+ last_spec = set.add_git_spec name, data, repository, revision, true
+ else
+ dependency = parse_dependency name, data
+
+ last_spec.add_dependency dependency
+ end
+
+ get :r_paren
+ else
+ raise "BUG: unknown token #{peek}"
+ end
+
+ skip :newline
+ end
+
+ @set.sets << set
+ end
+
+ def parse_PATH # :nodoc:
+ get :entry, 'remote'
+ _, directory, = get :text
+
+ skip :newline
+
+ get :entry, 'specs'
+
+ skip :newline
+
+ set = Gem::Resolver::VendorSet.new
+ last_spec = nil
+
+ while not @tokens.empty? and :text == peek.first do
+ _, name, column, = get :text
+
+ case peek[0]
+ when :newline then
+ last_spec.add_dependency Gem::Dependency.new name if column == 6
+ when :l_paren then
+ get :l_paren
+
+ type, data, = get [:text, :requirement]
+
+ if type == :text and column == 4 then
+ last_spec = set.add_vendor_gem name, directory
+ else
+ dependency = parse_dependency name, data
+
+ last_spec.dependencies << dependency
+ end
+
+ get :r_paren
+ else
+ raise "BUG: unknown token #{peek}"
+ end
+
+ skip :newline
+ end
+
+ @set.sets << set
+ end
+
+ def parse_PLATFORMS # :nodoc:
+ while not @tokens.empty? and :text == peek.first do
+ _, name, = get :text
+
+ @platforms << name
+
+ skip :newline
+ end
+ end
+
+ ##
+ # Parses the requirements following the dependency +name+ and the +op+ for
+ # the first token of the requirements and returns a Gem::Dependency object.
+
+ def parse_dependency name, op # :nodoc:
+ return Gem::Dependency.new name, op unless peek[0] == :text
+
+ _, version, = get :text
+
+ requirements = ["#{op} #{version}"]
+
+ while peek[0] == :comma do
+ get :comma
+ _, op, = get :requirement
+ _, version, = get :text
+
+ requirements << "#{op} #{version}"
+ end
+
+ Gem::Dependency.new name, requirements
+ end
+
+ ##
+ # Peeks at the next token for Lockfile
+
+ def peek # :nodoc:
+ @tokens.first || [:EOF]
+ end
+
+ def skip type # :nodoc:
+ get while not @tokens.empty? and peek.first == type
end
##
# The contents of the lock file.
def to_s
+ @set.resolve
+
out = []
- groups = spec_groups
+ @requests = @set.sorted_requests
+
+ @spec_groups = @requests.group_by do |request|
+ request.spec.class
+ end
- add_PATH out, groups.delete(Gem::Resolver::VendorSpecification) { [] }
+ add_PATH out
- add_GIT out, groups.delete(Gem::Resolver::GitSpecification) { [] }
+ add_GIT out
- add_GEM out, groups
+ add_GEM out
add_PLATFORMS out
@@ -218,21 +535,99 @@ class Gem::RequestSet::Lockfile
end
##
+ # Calculates the column (by byte) and the line of the current token based on
+ # +byte_offset+.
+
+ def token_pos byte_offset # :nodoc:
+ [byte_offset - @line_pos, @line]
+ end
+
+ ##
+ # Converts a lock file into an Array of tokens. If the lock file is missing
+ # an empty Array is returned.
+
+ def tokenize # :nodoc:
+ @line = 0
+ @line_pos = 0
+
+ @platforms = []
+ @tokens = []
+ @current_token = nil
+
+ lock_file = "#{@gem_deps_file}.lock"
+
+ @input = File.read lock_file
+ s = StringScanner.new @input
+
+ until s.eos? do
+ pos = s.pos
+
+ pos = s.pos if leading_whitespace = s.scan(/ +/)
+
+ if s.scan(/[<|=>]{7}/) then
+ message = "your #{lock_file} contains merge conflict markers"
+ column, line = token_pos pos
+
+ raise ParseError.new message, column, line, lock_file
+ end
+
+ @tokens <<
+ case
+ when s.scan(/\r?\n/) then
+ token = [:newline, nil, *token_pos(pos)]
+ @line_pos = s.pos
+ @line += 1
+ token
+ when s.scan(/[A-Z]+/) then
+ if leading_whitespace then
+ text = s.matched
+ text += s.scan(/[^\s)]*/).to_s # in case of no match
+ [:text, text, *token_pos(pos)]
+ else
+ [:section, s.matched, *token_pos(pos)]
+ end
+ when s.scan(/([a-z]+):\s/) then
+ s.pos -= 1 # rewind for possible newline
+ [:entry, s[1], *token_pos(pos)]
+ when s.scan(/\(/) then
+ [:l_paren, nil, *token_pos(pos)]
+ when s.scan(/\)/) then
+ [:r_paren, nil, *token_pos(pos)]
+ when s.scan(/<=|>=|=|~>|<|>|!=/) then
+ [:requirement, s.matched, *token_pos(pos)]
+ when s.scan(/,/) then
+ [:comma, nil, *token_pos(pos)]
+ when s.scan(/!/) then
+ [:bang, nil, *token_pos(pos)]
+ when s.scan(/[^\s),!]*/) then
+ [:text, s.matched, *token_pos(pos)]
+ else
+ raise "BUG: can't create token for: #{s.string[s.pos..-1].inspect}"
+ end
+ end
+
+ @tokens
+ rescue Errno::ENOENT
+ @tokens
+ end
+
+ ##
+ # Ungets the last token retrieved by #get
+
+ def unget # :nodoc:
+ @tokens.unshift @current_token
+ end
+
+ ##
# Writes the lock file alongside the gem dependencies file
def write
content = to_s
- File.open "#{@gem_deps_file}.lock", 'w' do |io|
+ open "#{@gem_deps_file}.lock", 'w' do |io|
io.write content
end
end
- private
-
- def requests
- @set.sorted_requests
- end
end
-require 'rubygems/request_set/lockfile/tokenizer'
diff --git a/lib/rubygems/request_set/lockfile/parser.rb b/lib/rubygems/request_set/lockfile/parser.rb
deleted file mode 100644
index ebea940188..0000000000
--- a/lib/rubygems/request_set/lockfile/parser.rb
+++ /dev/null
@@ -1,354 +0,0 @@
-# frozen_string_literal: true
-class Gem::RequestSet::Lockfile::Parser
- ###
- # Parses lockfiles
-
- def initialize tokenizer, set, platforms, filename = nil
- @tokens = tokenizer
- @filename = filename
- @set = set
- @platforms = platforms
- end
-
- def parse
- until @tokens.empty? do
- token = get
-
- case token.type
- when :section then
- @tokens.skip :newline
-
- case token.value
- when 'DEPENDENCIES' then
- parse_DEPENDENCIES
- when 'GIT' then
- parse_GIT
- when 'GEM' then
- parse_GEM
- when 'PATH' then
- parse_PATH
- when 'PLATFORMS' then
- parse_PLATFORMS
- else
- token = get until @tokens.empty? or peek.first == :section
- end
- else
- raise "BUG: unhandled token #{token.type} (#{token.value.inspect}) at line #{token.line} column #{token.column}"
- end
- end
- end
-
- ##
- # Gets the next token for a Lockfile
-
- def get expected_types = nil, expected_value = nil # :nodoc:
- token = @tokens.shift
-
- if expected_types and not Array(expected_types).include? token.type then
- unget token
-
- message = "unexpected token [#{token.type.inspect}, #{token.value.inspect}], " +
- "expected #{expected_types.inspect}"
-
- raise Gem::RequestSet::Lockfile::ParseError.new message, token.column, token.line, @filename
- end
-
- if expected_value and expected_value != token.value then
- unget token
-
- message = "unexpected token [#{token.type.inspect}, #{token.value.inspect}], " +
- "expected [#{expected_types.inspect}, " +
- "#{expected_value.inspect}]"
-
- raise Gem::RequestSet::Lockfile::ParseError.new message, token.column, token.line, @filename
- end
-
- token
- end
-
- def parse_DEPENDENCIES # :nodoc:
- while not @tokens.empty? and :text == peek.type do
- token = get :text
-
- requirements = []
-
- case peek[0]
- when :bang then
- get :bang
-
- requirements << pinned_requirement(token.value)
- when :l_paren then
- get :l_paren
-
- loop do
- op = get(:requirement).value
- version = get(:text).value
-
- requirements << "#{op} #{version}"
-
- break unless peek.type == :comma
-
- get :comma
- end
-
- get :r_paren
-
- if peek[0] == :bang then
- requirements.clear
- requirements << pinned_requirement(token.value)
-
- get :bang
- end
- end
-
- @set.gem token.value, *requirements
-
- skip :newline
- end
- end
-
- def parse_GEM # :nodoc:
- sources = []
-
- while [:entry, 'remote'] == peek.first(2) do
- get :entry, 'remote'
- data = get(:text).value
- skip :newline
-
- sources << Gem::Source.new(data)
- end
-
- sources << Gem::Source.new(Gem::DEFAULT_HOST) if sources.empty?
-
- get :entry, 'specs'
-
- skip :newline
-
- set = Gem::Resolver::LockSet.new sources
- last_specs = nil
-
- while not @tokens.empty? and :text == peek.type do
- token = get :text
- name = token.value
- column = token.column
-
- case peek[0]
- when :newline then
- last_specs.each do |spec|
- spec.add_dependency Gem::Dependency.new name if column == 6
- end
- when :l_paren then
- get :l_paren
-
- token = get [:text, :requirement]
- type = token.type
- data = token.value
-
- if type == :text and column == 4 then
- version, platform = data.split '-', 2
-
- platform =
- platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
-
- last_specs = set.add name, version, platform
- else
- dependency = parse_dependency name, data
-
- last_specs.each do |spec|
- spec.add_dependency dependency
- end
- end
-
- get :r_paren
- else
- raise "BUG: unknown token #{peek}"
- end
-
- skip :newline
- end
-
- @set.sets << set
- end
-
- def parse_GIT # :nodoc:
- get :entry, 'remote'
- repository = get(:text).value
-
- skip :newline
-
- get :entry, 'revision'
- revision = get(:text).value
-
- skip :newline
-
- type = peek.type
- value = peek.value
- if type == :entry and %w[branch ref tag].include? value then
- get
- get :text
-
- skip :newline
- end
-
- get :entry, 'specs'
-
- skip :newline
-
- set = Gem::Resolver::GitSet.new
- set.root_dir = @set.install_dir
-
- last_spec = nil
-
- while not @tokens.empty? and :text == peek.type do
- token = get :text
- name = token.value
- column = token.column
-
- case peek[0]
- when :newline then
- last_spec.add_dependency Gem::Dependency.new name if column == 6
- when :l_paren then
- get :l_paren
-
- token = get [:text, :requirement]
- type = token.type
- data = token.value
-
- if type == :text and column == 4 then
- last_spec = set.add_git_spec name, data, repository, revision, true
- else
- dependency = parse_dependency name, data
-
- last_spec.add_dependency dependency
- end
-
- get :r_paren
- else
- raise "BUG: unknown token #{peek}"
- end
-
- skip :newline
- end
-
- @set.sets << set
- end
-
- def parse_PATH # :nodoc:
- get :entry, 'remote'
- directory = get(:text).value
-
- skip :newline
-
- get :entry, 'specs'
-
- skip :newline
-
- set = Gem::Resolver::VendorSet.new
- last_spec = nil
-
- while not @tokens.empty? and :text == peek.first do
- token = get :text
- name = token.value
- column = token.column
-
- case peek[0]
- when :newline then
- last_spec.add_dependency Gem::Dependency.new name if column == 6
- when :l_paren then
- get :l_paren
-
- token = get [:text, :requirement]
- type = token.type
- data = token.value
-
- if type == :text and column == 4 then
- last_spec = set.add_vendor_gem name, directory
- else
- dependency = parse_dependency name, data
-
- last_spec.dependencies << dependency
- end
-
- get :r_paren
- else
- raise "BUG: unknown token #{peek}"
- end
-
- skip :newline
- end
-
- @set.sets << set
- end
-
- def parse_PLATFORMS # :nodoc:
- while not @tokens.empty? and :text == peek.first do
- name = get(:text).value
-
- @platforms << name
-
- skip :newline
- end
- end
-
- ##
- # Parses the requirements following the dependency +name+ and the +op+ for
- # the first token of the requirements and returns a Gem::Dependency object.
-
- def parse_dependency name, op # :nodoc:
- return Gem::Dependency.new name, op unless peek[0] == :text
-
- version = get(:text).value
-
- requirements = ["#{op} #{version}"]
-
- while peek.type == :comma do
- get :comma
- op = get(:requirement).value
- version = get(:text).value
-
- requirements << "#{op} #{version}"
- end
-
- Gem::Dependency.new name, requirements
- end
-
- private
-
- def skip type # :nodoc:
- @tokens.skip type
- end
-
- ##
- # Peeks at the next token for Lockfile
-
- def peek # :nodoc:
- @tokens.peek
- end
-
- if [].respond_to? :flat_map
- def pinned_requirement name # :nodoc:
- requirement = Gem::Dependency.new name
- specification = @set.sets.flat_map { |set|
- set.find_all(requirement)
- }.compact.first
-
- specification && specification.version
- end
- else # FIXME: remove when 1.8 is dropped
- def pinned_requirement name # :nodoc:
- requirement = Gem::Dependency.new name
- specification = @set.sets.map { |set|
- set.find_all(requirement)
- }.flatten(1).compact.first
-
- specification && specification.version
- end
- end
-
- ##
- # Ungets the last token retrieved by #get
-
- def unget token # :nodoc:
- @tokens.unshift token
- end
-end
diff --git a/lib/rubygems/request_set/lockfile/tokenizer.rb b/lib/rubygems/request_set/lockfile/tokenizer.rb
deleted file mode 100644
index a758743dda..0000000000
--- a/lib/rubygems/request_set/lockfile/tokenizer.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/request_set/lockfile/parser'
-
-class Gem::RequestSet::Lockfile::Tokenizer
- Token = Struct.new :type, :value, :column, :line
- EOF = Token.new :EOF
-
- def self.from_file file
- new File.read(file), file
- end
-
- def initialize input, filename = nil, line = 0, pos = 0
- @line = line
- @line_pos = pos
- @tokens = []
- @filename = filename
- tokenize input
- end
-
- def make_parser set, platforms
- Gem::RequestSet::Lockfile::Parser.new self, set, platforms, @filename
- end
-
- def to_a
- @tokens.map { |token| [token.type, token.value, token.column, token.line] }
- end
-
- def skip type
- @tokens.shift while not @tokens.empty? and peek.type == type
- end
-
- ##
- # Calculates the column (by byte) and the line of the current token based on
- # +byte_offset+.
-
- def token_pos byte_offset # :nodoc:
- [byte_offset - @line_pos, @line]
- end
-
- def empty?
- @tokens.empty?
- end
-
- def unshift token
- @tokens.unshift token
- end
-
- def next_token
- @tokens.shift
- end
- alias :shift :next_token
-
- def peek
- @tokens.first || EOF
- end
-
- private
-
- def tokenize input
- require 'strscan'
- s = StringScanner.new input
-
- until s.eos? do
- pos = s.pos
-
- pos = s.pos if leading_whitespace = s.scan(/ +/)
-
- if s.scan(/[<|=>]{7}/) then
- message = "your #{@filename} contains merge conflict markers"
- column, line = token_pos pos
-
- raise Gem::RequestSet::Lockfile::ParseError.new message, column, line, @filename
- end
-
- @tokens <<
- case
- when s.scan(/\r?\n/) then
- token = Token.new(:newline, nil, *token_pos(pos))
- @line_pos = s.pos
- @line += 1
- token
- when s.scan(/[A-Z]+/) then
- if leading_whitespace then
- text = s.matched
- text += s.scan(/[^\s)]*/).to_s # in case of no match
- Token.new(:text, text, *token_pos(pos))
- else
- Token.new(:section, s.matched, *token_pos(pos))
- end
- when s.scan(/([a-z]+):\s/) then
- s.pos -= 1 # rewind for possible newline
- Token.new(:entry, s[1], *token_pos(pos))
- when s.scan(/\(/) then
- Token.new(:l_paren, nil, *token_pos(pos))
- when s.scan(/\)/) then
- Token.new(:r_paren, nil, *token_pos(pos))
- when s.scan(/<=|>=|=|~>|<|>|!=/) then
- Token.new(:requirement, s.matched, *token_pos(pos))
- when s.scan(/,/) then
- Token.new(:comma, nil, *token_pos(pos))
- when s.scan(/!/) then
- Token.new(:bang, nil, *token_pos(pos))
- when s.scan(/[^\s),!]*/) then
- Token.new(:text, s.matched, *token_pos(pos))
- else
- raise "BUG: can't create token for: #{s.string[s.pos..-1].inspect}"
- end
- end
-
- @tokens
- end
-end
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb
index 2a60c86e69..8b6a81612c 100644
--- a/lib/rubygems/requirement.rb
+++ b/lib/rubygems/requirement.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require "rubygems/version"
require "rubygems/deprecate"
@@ -24,8 +23,6 @@ class Gem::Requirement
"~>" => lambda { |v, r| v >= r && v.release < r.bump }
}
- SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
-
quoted = OPS.keys.map { |k| Regexp.quote k }.join "|"
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc:
@@ -51,18 +48,12 @@ class Gem::Requirement
# If the input is "weird", the default version requirement is
# returned.
- def self.create *inputs
- return new inputs if inputs.length > 1
-
- input = inputs.shift
-
+ def self.create input
case input
when Gem::Requirement then
input
when Gem::Version, Array then
new input
- when '!' then
- source_set
else
if input.respond_to? :to_str then
new [input.to_str]
@@ -79,13 +70,6 @@ class Gem::Requirement
new '>= 0'
end
- ###
- # A source set requirement, used for Gemfiles and lockfiles
-
- def self.source_set # :nodoc:
- SOURCE_SET_REQUIREMENT
- end
-
##
# Parse +obj+, returning an <tt>[op, version]</tt> pair. +obj+ can
# be a String or a Gem::Version.
@@ -94,9 +78,9 @@ class Gem::Requirement
# specification, like <tt>">= 1.2"</tt>, or a simple version number,
# like <tt>"1.2"</tt>.
#
- # parse("> 1.0") # => [">", Gem::Version.new("1.0")]
- # parse("1.0") # => ["=", Gem::Version.new("1.0")]
- # parse(Gem::Version.new("1.0")) # => ["=, Gem::Version.new("1.0")]
+ # parse("> 1.0") # => [">", "1.0"]
+ # parse("1.0") # => ["=", "1.0"]
+ # parse(Gem::Version.new("1.0")) # => ["=, "1.0"]
def self.parse obj
return ["=", obj] if Gem::Version === obj
@@ -187,7 +171,7 @@ class Gem::Requirement
end
def hash # :nodoc:
- requirements.sort.hash
+ requirements.hash
end
def marshal_dump # :nodoc:
diff --git a/lib/rubygems/resolver.rb b/lib/rubygems/resolver.rb
index 13ee035e4c..ef17d682ac 100644
--- a/lib/rubygems/resolver.rb
+++ b/lib/rubygems/resolver.rb
@@ -1,9 +1,10 @@
-# frozen_string_literal: true
require 'rubygems/dependency'
require 'rubygems/exceptions'
-require 'rubygems/util'
require 'rubygems/util/list'
+require 'uri'
+require 'net/http'
+
##
# Given a set of Gem::Dependency objects as +needed+ and a way to query the
# set of available specs via +set+, calculates a set of ActivationRequest
@@ -11,7 +12,6 @@ require 'rubygems/util/list'
# all the requirements.
class Gem::Resolver
- require 'rubygems/resolver/molinillo'
##
# If the DEBUG_RESOLVER environment variable is set then debugging mode is
@@ -20,6 +20,13 @@ class Gem::Resolver
DEBUG_RESOLVER = !ENV['DEBUG_RESOLVER'].nil?
+ require 'pp' if DEBUG_RESOLVER
+
+ ##
+ # Contains all the conflicts encountered while doing resolution
+
+ attr_reader :conflicts
+
##
# Set to true if all development dependencies should be considered.
@@ -103,6 +110,7 @@ class Gem::Resolver
@set = set || Gem::Resolver::IndexSet.new
@needed = needed
+ @conflicts = []
@development = false
@development_shallow = false
@ignore_dependencies = false
@@ -145,7 +153,7 @@ class Gem::Resolver
return spec, activation_request
end
- def requests s, act, reqs=[] # :nodoc:
+ def requests s, act, reqs=nil # :nodoc:
return reqs if @ignore_dependencies
s.fetch_development_dependencies if @development
@@ -157,7 +165,7 @@ class Gem::Resolver
next if d.type == :development and @development_shallow and
act.parent
- reqs << Gem::Resolver::DependencyRequest.new(d, act)
+ reqs.add Gem::Resolver::DependencyRequest.new(d, act)
@stats.requirement!
end
@@ -168,29 +176,29 @@ class Gem::Resolver
reqs
end
- include Molinillo::UI
+ ##
+ # Proceed with resolution! Returns an array of ActivationRequest objects.
- def output
- @output ||= debug? ? $stdout : File.open(Gem::Util::NULL_DEVICE, 'w')
- end
+ def resolve
+ @conflicts = []
- def debug?
- DEBUG_RESOLVER
- end
+ needed = Gem::Resolver::RequirementList.new
- include Molinillo::SpecificationProvider
+ @needed.reverse_each do |n|
+ request = Gem::Resolver::DependencyRequest.new n, nil
- ##
- # Proceed with resolution! Returns an array of ActivationRequest objects.
+ needed.add request
+ @stats.requirement!
+ end
- def resolve
- locking_dg = Molinillo::DependencyGraph.new
- Molinillo::Resolver.new(self, self).resolve(@needed.map { |d| DependencyRequest.new d, nil }, locking_dg).tsort.map(&:payload).compact
- rescue Molinillo::VersionConflict => e
- conflict = e.conflicts.values.first
- raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
- ensure
- @output.close if defined?(@output) and !debug?
+ @stats.record_requirements needed
+
+ res = resolve_for needed, nil
+
+ raise Gem::DependencyResolutionError, res if
+ res.kind_of? Gem::Resolver::Conflict
+
+ res.to_a
end
##
@@ -213,104 +221,233 @@ class Gem::Resolver
return matching_platform, all
end
- ##
- # Returns the gems in +specs+ that match the local platform.
-
- def select_local_platforms specs # :nodoc:
- specs.select do |spec|
- Gem::Platform.installable? spec
+ def handle_conflict(dep, existing) # :nodoc:
+ # There is a conflict! We return the conflict object which will be seen by
+ # the caller and be handled at the right level.
+
+ # If the existing activation indicates that there are other possibles for
+ # it, then issue the conflict on the dependency for the activation itself.
+ # Otherwise, if there was a requester, issue it on the requester's
+ # request itself.
+ # Finally, if the existing request has no requester (toplevel) unwind to
+ # it anyway.
+
+ if existing.others_possible?
+ conflict =
+ Gem::Resolver::Conflict.new dep, existing
+ elsif dep.requester
+ depreq = dep.requester.request
+ conflict =
+ Gem::Resolver::Conflict.new depreq, existing, dep
+ elsif existing.request.requester.nil?
+ conflict =
+ Gem::Resolver::Conflict.new dep, existing
+ else
+ raise Gem::DependencyError, "Unable to figure out how to unwind conflict"
end
+
+ @conflicts << conflict unless @conflicts.include? conflict
+
+ return conflict
end
- def search_for(dependency)
- possibles, all = find_possible(dependency)
- if !@soft_missing && possibles.empty?
- @missing << dependency
- exc = Gem::UnsatisfiableDependencyError.new dependency, all
- exc.errors = @set.errors
- raise exc
+ # Contains the state for attempting activation of a set of possible specs.
+ # +needed+ is a Gem::List of DependencyRequest objects that, well, need
+ # to be satisfied.
+ # +specs+ is the List of ActivationRequest that are being tested.
+ # +dep+ is the DependencyRequest that was used to generate this state.
+ # +spec+ is the Specification for this state.
+ # +possible+ is List of DependencyRequest objects that can be tried to
+ # find a complete set.
+ # +conflicts+ is a [DependencyRequest, Conflict] hit tried to
+ # activate the state.
+ #
+ State = Struct.new(:needed, :specs, :dep, :spec, :possibles, :conflicts) do
+ def summary # :nodoc:
+ nd = needed.map { |s| s.to_s }.sort if nd
+
+ if specs then
+ ss = specs.map { |s| s.full_name }.sort
+ ss.unshift ss.length
+ end
+
+ d = dep.to_s
+ d << " from #{dep.requester.full_name}" if dep.requester
+
+ ps = possibles.map { |p| p.full_name }.sort
+ ps.unshift ps.length
+
+ cs = conflicts.map do |(s, c)|
+ [s.full_name, c.conflicting_dependencies.map { |cd| cd.to_s }]
+ end
+
+ { :needed => nd, :specs => ss, :dep => d, :spec => spec.full_name,
+ :possibles => ps, :conflicts => cs }
end
+ end
+
+ ##
+ # The meat of the algorithm. Given +needed+ DependencyRequest objects and
+ # +specs+ being a list to ActivationRequest, calculate a new list of
+ # ActivationRequest objects.
+
+ def resolve_for needed, specs # :nodoc:
+ # The State objects that are used to attempt the activation tree.
+ states = []
+
+ while !needed.empty?
+ @stats.iteration!
+
+ dep = needed.remove
+ explain :try, [dep, dep.requester ? dep.requester.request : :toplevel]
+ explain_list(:next5) { needed.next5 }
+ explain_list(:specs) { Array(specs).map { |x| x.full_name }.sort }
+
+ # If there is already a spec activated for the requested name...
+ if specs && existing = specs.find { |s| dep.name == s.name }
+ # then we're done since this new dep matches the existing spec.
+ next if dep.matches_spec? existing
+
+ conflict = handle_conflict dep, existing
- sources = []
+ return conflict unless dep.requester
- groups = Hash.new { |hash, key| hash[key] = [] }
+ explain :conflict, dep, :existing, existing.full_name
- # create groups & sources in the same loop
- sources = possibles.map { |spec|
- source = spec.source
- groups[source] << spec
- source
- }.uniq.reverse
+ depreq = dep.requester.request
- activation_requests = []
+ state = nil
+ until states.empty?
+ x = states.pop
- sources.each do |source|
- groups[source].
- sort_by { |spec| [spec.version, Gem::Platform.local =~ spec.platform ? 1 : 0] }.
- map { |spec| ActivationRequest.new spec, dependency, [] }.
- each { |activation_request| activation_requests << activation_request }
+ i = existing.request.requester
+ explain :consider, x.spec.full_name, [depreq.name, dep.name, i ? i.name : :top]
+
+ if x.spec.name == depreq.name or
+ x.spec.name == dep.name or
+ (i && (i.name == x.spec.name))
+ explain :found, x.spec.full_name
+ state = x
+ break
+ end
+ end
+
+ return conflict unless state
+
+ @stats.backtracking!
+
+ needed, specs = resolve_for_conflict needed, specs, state
+
+ states << state unless state.possibles.empty?
+
+ next
+ end
+
+ matching, all = find_possible dep
+
+ case matching.size
+ when 0
+ resolve_for_zero dep, all
+ when 1
+ needed, specs =
+ resolve_for_single needed, specs, dep, matching
+ else
+ needed, specs =
+ resolve_for_multiple needed, specs, states, dep, matching
+ end
end
- activation_requests
+ specs
end
- def dependencies_for(specification)
- return [] if @ignore_dependencies
- spec = specification.spec
- requests(spec, specification)
- end
+ ##
+ # Rewinds +needed+ and +specs+ to a previous state in +state+ for a conflict
+ # between +dep+ and +existing+.
+
+ def resolve_for_conflict needed, specs, state # :nodoc:
+ # We exhausted the possibles so it's definitely not going to work out,
+ # bail out.
+ raise Gem::ImpossibleDependenciesError.new state.dep, state.conflicts if
+ state.possibles.empty?
- def requirement_satisfied_by?(requirement, activated, spec)
- requirement.matches_spec? spec
+ # Retry resolution with this spec and add it's dependencies
+ spec, act = activation_request state.dep, state.possibles
+
+ needed = requests spec, act, state.needed.dup
+ specs = Gem::List.prepend state.specs, act
+
+ return needed, specs
end
- def name_for(dependency)
- dependency.name
+ ##
+ # There are multiple +possible+ specifications for this +dep+. Updates
+ # +needed+, +specs+ and +states+ for further resolution of the +possible+
+ # choices.
+
+ def resolve_for_multiple needed, specs, states, dep, possible # :nodoc:
+ # Sort them so that we try the highest versions first.
+ possible = possible.sort_by do |s|
+ [s.source, s.version, s.platform == Gem::Platform::RUBY ? -1 : 1]
+ end
+
+ spec, act = activation_request dep, possible
+
+ # We may need to try all of +possible+, so we setup state to unwind back
+ # to current +needed+ and +specs+ so we can try another. This is code is
+ # what makes conflict resolution possible.
+ states << State.new(needed.dup, specs, dep, spec, possible, [])
+
+ @stats.record_depth states
+
+ explain :states, states.map { |s| s.dep }
+
+ needed = requests spec, act, needed
+ specs = Gem::List.prepend specs, act
+
+ return needed, specs
end
- def allow_missing?(dependency)
- @missing << dependency
- @soft_missing
+ ##
+ # Add the spec from the +possible+ list to +specs+ and process the spec's
+ # dependencies by adding them to +needed+.
+
+ def resolve_for_single needed, specs, dep, possible # :nodoc:
+ spec, act = activation_request dep, possible
+
+ specs = Gem::List.prepend specs, act
+
+ # Put the deps for at the beginning of needed
+ # rather than the end to match the depth first
+ # searching done by the multiple case code below.
+ #
+ # This keeps the error messages consistent.
+ needed = requests spec, act, needed
+
+ return needed, specs
end
- def sort_dependencies(dependencies, activated, conflicts)
- dependencies.sort_by.with_index do |dependency, i|
- name = name_for(dependency)
- [
- activated.vertex_named(name).payload ? 0 : 1,
- amount_constrained(dependency),
- conflicts[name] ? 0 : 1,
- activated.vertex_named(name).payload ? 0 : search_for(dependency).count,
- i # for stable sort
- ]
+ ##
+ # When there are no possible specifications for +dep+ our work is done.
+
+ def resolve_for_zero dep, platform_mismatch # :nodoc:
+ @missing << dep
+
+ unless @soft_missing
+ exc = Gem::UnsatisfiableDependencyError.new dep, platform_mismatch
+ exc.errors = @set.errors
+
+ raise exc
end
end
- SINGLE_POSSIBILITY_CONSTRAINT_PENALTY = 1_000_000
- private_constant :SINGLE_POSSIBILITY_CONSTRAINT_PENALTY if defined?(private_constant)
+ ##
+ # Returns the gems in +specs+ that match the local platform.
- # returns an integer \in (-\infty, 0]
- # a number closer to 0 means the dependency is less constraining
- #
- # dependencies w/ 0 or 1 possibilities (ignoring version requirements)
- # are given very negative values, so they _always_ sort first,
- # before dependencies that are unconstrained
- def amount_constrained(dependency)
- @amount_constrained ||= {}
- @amount_constrained[dependency.name] ||= begin
- name_dependency = Gem::Dependency.new(dependency.name)
- dependency_request_for_name = Gem::Resolver::DependencyRequest.new(name_dependency, dependency.requester)
- all = @set.find_all(dependency_request_for_name).size
-
- if all <= 1
- all - SINGLE_POSSIBILITY_CONSTRAINT_PENALTY
- else
- search = search_for(dependency).size
- search - all
- end
+ def select_local_platforms specs # :nodoc:
+ specs.select do |spec|
+ Gem::Platform.installable? spec
end
end
- private :amount_constrained
end
@@ -335,7 +472,6 @@ require 'rubygems/resolver/index_set'
require 'rubygems/resolver/installer_set'
require 'rubygems/resolver/lock_set'
require 'rubygems/resolver/vendor_set'
-require 'rubygems/resolver/source_set'
require 'rubygems/resolver/specification'
require 'rubygems/resolver/spec_specification'
@@ -346,3 +482,4 @@ require 'rubygems/resolver/installed_specification'
require 'rubygems/resolver/local_specification'
require 'rubygems/resolver/lock_specification'
require 'rubygems/resolver/vendor_specification'
+
diff --git a/lib/rubygems/resolver/activation_request.rb b/lib/rubygems/resolver/activation_request.rb
index 135d75d6bc..56c6363e4f 100644
--- a/lib/rubygems/resolver/activation_request.rb
+++ b/lib/rubygems/resolver/activation_request.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Specifies a Specification object that should be activated. Also contains a
# dependency that was used to introduce this activation.
@@ -50,27 +49,15 @@ class Gem::Resolver::ActivationRequest
# Downloads a gem at +path+ and returns the file path.
def download path
- Gem.ensure_gem_subdirectories path
-
- if @spec.respond_to? :sources
- exception = nil
- path = @spec.sources.find{ |source|
- begin
- source.download full_spec, path
- rescue exception
- end
- }
- return path if path
- raise exception if exception
-
- elsif @spec.respond_to? :source
+ if @spec.respond_to? :source
source = @spec.source
- source.download full_spec, path
-
else
source = Gem.sources.first
- source.download full_spec, path
end
+
+ Gem.ensure_gem_subdirectories path
+
+ source.download full_spec, path
end
##
@@ -80,8 +67,6 @@ class Gem::Resolver::ActivationRequest
@spec.full_name
end
- alias_method :to_s, :full_name
-
##
# The Gem::Specification for this activation request.
@@ -184,3 +169,4 @@ class Gem::Resolver::ActivationRequest
end
end
+
diff --git a/lib/rubygems/resolver/api_set.rb b/lib/rubygems/resolver/api_set.rb
index ee3046af63..dda3579878 100644
--- a/lib/rubygems/resolver/api_set.rb
+++ b/lib/rubygems/resolver/api_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The global rubygems pool, available via the rubygems.org API.
# Returns instances of APISpecification.
@@ -73,7 +72,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
@to_fetch += needed
end
- def prefetch_now # :nodoc:
+ def prefetch_now
needed, @to_fetch = @to_fetch, []
uri = @dep_uri + "?gems=#{needed.sort.join ','}"
diff --git a/lib/rubygems/resolver/api_specification.rb b/lib/rubygems/resolver/api_specification.rb
index 1e22dd0b6f..bbd5a6427b 100644
--- a/lib/rubygems/resolver/api_specification.rb
+++ b/lib/rubygems/resolver/api_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Represents a specification retrieved via the rubygems.org API.
#
@@ -20,7 +19,7 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
@set = set
@name = api_data[:name]
@version = Gem::Version.new api_data[:number]
- @platform = Gem::Platform.new api_data[:platform]
+ @platform = api_data[:platform]
@dependencies = api_data[:dependencies].map do |name, ver|
Gem::Dependency.new name, ver.split(/\s*,\s*/)
end
diff --git a/lib/rubygems/resolver/best_set.rb b/lib/rubygems/resolver/best_set.rb
index 4479535abe..7e2d7e2647 100644
--- a/lib/rubygems/resolver/best_set.rb
+++ b/lib/rubygems/resolver/best_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The BestSet chooses the best available method to query a remote index.
#
diff --git a/lib/rubygems/resolver/composed_set.rb b/lib/rubygems/resolver/composed_set.rb
index 0b65942dca..5b08f128ed 100644
--- a/lib/rubygems/resolver/composed_set.rb
+++ b/lib/rubygems/resolver/composed_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A ComposedSet allows multiple sets to be queried like a single set.
#
diff --git a/lib/rubygems/resolver/conflict.rb b/lib/rubygems/resolver/conflict.rb
index 7997f92950..902c286b6b 100644
--- a/lib/rubygems/resolver/conflict.rb
+++ b/lib/rubygems/resolver/conflict.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Used internally to indicate that a dependency conflicted
# with a spec that would be activated.
@@ -158,3 +157,4 @@ end
# TODO: Remove in RubyGems 3
Gem::Resolver::DependencyConflict = Gem::Resolver::Conflict # :nodoc:
+
diff --git a/lib/rubygems/resolver/current_set.rb b/lib/rubygems/resolver/current_set.rb
index 265c639f15..4e8d34026b 100644
--- a/lib/rubygems/resolver/current_set.rb
+++ b/lib/rubygems/resolver/current_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A set which represents the installed gems. Respects
# all the normal settings that control where to look
diff --git a/lib/rubygems/resolver/dependency_request.rb b/lib/rubygems/resolver/dependency_request.rb
index c2918911cd..79690bec4c 100644
--- a/lib/rubygems/resolver/dependency_request.rb
+++ b/lib/rubygems/resolver/dependency_request.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Used Internally. Wraps a Dependency object to also track which spec
# contained the Dependency.
@@ -68,10 +67,6 @@ class Gem::Resolver::DependencyRequest
@dependency.name
end
- def type
- @dependency.type
- end
-
##
# Indicate that the request is for a gem explicitly requested by the user
@@ -118,3 +113,4 @@ class Gem::Resolver::DependencyRequest
end
end
+
diff --git a/lib/rubygems/resolver/git_set.rb b/lib/rubygems/resolver/git_set.rb
index 723a202d7a..5f1b368ac1 100644
--- a/lib/rubygems/resolver/git_set.rb
+++ b/lib/rubygems/resolver/git_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A GitSet represents gems that are sourced from git repositories.
#
diff --git a/lib/rubygems/resolver/git_specification.rb b/lib/rubygems/resolver/git_specification.rb
index 2448797d3f..55e180e525 100644
--- a/lib/rubygems/resolver/git_specification.rb
+++ b/lib/rubygems/resolver/git_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A GitSpecification represents a gem that is sourced from a git repository
# and is being loaded through a gem dependencies file through the +git:+
@@ -24,7 +23,8 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
def install options = {}
require 'rubygems/installer'
- installer = Gem::Installer.for_spec spec, options
+ installer = Gem::Installer.new '', options
+ installer.spec = spec
yield installer if block_given?
diff --git a/lib/rubygems/resolver/index_set.rb b/lib/rubygems/resolver/index_set.rb
index 2450f14b4f..7c56c2bf99 100644
--- a/lib/rubygems/resolver/index_set.rb
+++ b/lib/rubygems/resolver/index_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The global rubygems pool represented via the traditional
# source index.
diff --git a/lib/rubygems/resolver/index_specification.rb b/lib/rubygems/resolver/index_specification.rb
index 4340f46943..56fecb5753 100644
--- a/lib/rubygems/resolver/index_specification.rb
+++ b/lib/rubygems/resolver/index_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Represents a possible Specification object returned from IndexSet. Used to
# delay needed to download full Specification objects when only the +name+
diff --git a/lib/rubygems/resolver/installed_specification.rb b/lib/rubygems/resolver/installed_specification.rb
index d9c6a5e5cf..2a2b89a6c2 100644
--- a/lib/rubygems/resolver/installed_specification.rb
+++ b/lib/rubygems/resolver/installed_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# An InstalledSpecification represents a gem that is already installed
# locally.
diff --git a/lib/rubygems/resolver/installer_set.rb b/lib/rubygems/resolver/installer_set.rb
index f24293c0a0..f53b496dc7 100644
--- a/lib/rubygems/resolver/installer_set.rb
+++ b/lib/rubygems/resolver/installer_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A set of gems for installation sourced from remote sources and local .gem
# files
@@ -41,7 +40,6 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
@ignore_dependencies = false
@ignore_installed = false
@local = {}
- @local_source = Gem::Source::Local.new
@remote_set = Gem::Resolver::BestSet.new
@specs = {}
end
@@ -137,14 +135,12 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
res.concat matching_local
- begin
- if local_spec = @local_source.find_gem(name, dep.requirement) then
- res << Gem::Resolver::IndexSpecification.new(
- self, local_spec.name, local_spec.version,
- @local_source, local_spec.platform)
- end
- rescue Gem::Package::FormatError
- # ignore
+ local_source = Gem::Source::Local.new
+
+ if local_spec = local_source.find_gem(name, dep.requirement) then
+ res << Gem::Resolver::IndexSpecification.new(
+ self, local_spec.name, local_spec.version,
+ local_source, local_spec.platform)
end
end
@@ -158,7 +154,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
end
def prefetch(reqs)
- @remote_set.prefetch(reqs) if consider_remote?
+ @remote_set.prefetch(reqs)
end
def prerelease= allow_prerelease
@@ -193,7 +189,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
# Has a local gem for +dep_name+ been added to this set?
def local? dep_name # :nodoc:
- spec, _ = @local[dep_name]
+ spec, = @local[dep_name]
spec
end
@@ -225,3 +221,4 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
end
end
+
diff --git a/lib/rubygems/resolver/local_specification.rb b/lib/rubygems/resolver/local_specification.rb
index 1d9d22f0ac..20a283f0ba 100644
--- a/lib/rubygems/resolver/local_specification.rb
+++ b/lib/rubygems/resolver/local_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A LocalSpecification comes from a .gem file on the local filesystem.
diff --git a/lib/rubygems/resolver/lock_set.rb b/lib/rubygems/resolver/lock_set.rb
index 7fddc93e1c..4ede5971fb 100644
--- a/lib/rubygems/resolver/lock_set.rb
+++ b/lib/rubygems/resolver/lock_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A set of gems from a gem dependencies lockfile.
@@ -28,9 +27,11 @@ class Gem::Resolver::LockSet < Gem::Resolver::Set
def add name, version, platform # :nodoc:
version = Gem::Version.new version
- specs = [
- Gem::Resolver::LockSpecification.new(self, name, version, @sources, platform)
- ]
+
+ specs = @sources.map do |source|
+ Gem::Resolver::LockSpecification.new self, name, version, source,
+ platform
+ end
@specs.concat specs
diff --git a/lib/rubygems/resolver/lock_specification.rb b/lib/rubygems/resolver/lock_specification.rb
index f485675673..0013171469 100644
--- a/lib/rubygems/resolver/lock_specification.rb
+++ b/lib/rubygems/resolver/lock_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).
#
@@ -7,16 +6,13 @@
class Gem::Resolver::LockSpecification < Gem::Resolver::Specification
- attr_reader :sources
-
- def initialize set, name, version, sources, platform
+ def initialize set, name, version, source, platform
super()
@name = name
@platform = platform
@set = set
- @source = sources.first
- @sources = sources
+ @source = source
@version = version
@dependencies = []
diff --git a/lib/rubygems/resolver/molinillo.rb b/lib/rubygems/resolver/molinillo.rb
deleted file mode 100644
index 2357f41bee..0000000000
--- a/lib/rubygems/resolver/molinillo.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo'
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo.rb b/lib/rubygems/resolver/molinillo/lib/molinillo.rb
deleted file mode 100644
index 0ae4b6a912..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/gem_metadata'
-require 'rubygems/resolver/molinillo/lib/molinillo/errors'
-require 'rubygems/resolver/molinillo/lib/molinillo/resolver'
-require 'rubygems/resolver/molinillo/lib/molinillo/modules/ui'
-require 'rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider'
-
-# Gem::Resolver::Molinillo is a generic dependency resolution algorithm.
-module Gem::Resolver::Molinillo
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb
deleted file mode 100644
index 1bbc72c1f6..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # @!visibility private
- module Delegates
- # Delegates all {Gem::Resolver::Molinillo::ResolutionState} methods to a `#state` property.
- module ResolutionState
- # (see Gem::Resolver::Molinillo::ResolutionState#name)
- def name
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.name
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#requirements)
- def requirements
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.requirements
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#activated)
- def activated
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.activated
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#requirement)
- def requirement
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.requirement
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#possibilities)
- def possibilities
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.possibilities
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#depth)
- def depth
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.depth
- end
-
- # (see Gem::Resolver::Molinillo::ResolutionState#conflicts)
- def conflicts
- current_state = state || Gem::Resolver::Molinillo::ResolutionState.empty
- current_state.conflicts
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb
deleted file mode 100644
index 71903c7e86..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- module Delegates
- # Delegates all {Gem::Resolver::Molinillo::SpecificationProvider} methods to a
- # `#specification_provider` property.
- module SpecificationProvider
- # (see Gem::Resolver::Molinillo::SpecificationProvider#search_for)
- def search_for(dependency)
- with_no_such_dependency_error_handling do
- specification_provider.search_for(dependency)
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#dependencies_for)
- def dependencies_for(specification)
- with_no_such_dependency_error_handling do
- specification_provider.dependencies_for(specification)
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#requirement_satisfied_by?)
- def requirement_satisfied_by?(requirement, activated, spec)
- with_no_such_dependency_error_handling do
- specification_provider.requirement_satisfied_by?(requirement, activated, spec)
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#name_for)
- def name_for(dependency)
- with_no_such_dependency_error_handling do
- specification_provider.name_for(dependency)
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#name_for_explicit_dependency_source)
- def name_for_explicit_dependency_source
- with_no_such_dependency_error_handling do
- specification_provider.name_for_explicit_dependency_source
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#name_for_locking_dependency_source)
- def name_for_locking_dependency_source
- with_no_such_dependency_error_handling do
- specification_provider.name_for_locking_dependency_source
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#sort_dependencies)
- def sort_dependencies(dependencies, activated, conflicts)
- with_no_such_dependency_error_handling do
- specification_provider.sort_dependencies(dependencies, activated, conflicts)
- end
- end
-
- # (see Gem::Resolver::Molinillo::SpecificationProvider#allow_missing?)
- def allow_missing?(dependency)
- with_no_such_dependency_error_handling do
- specification_provider.allow_missing?(dependency)
- end
- end
-
- private
-
- # Ensures any raised {NoSuchDependencyError} has its
- # {NoSuchDependencyError#required_by} set.
- # @yield
- def with_no_such_dependency_error_handling
- yield
- rescue NoSuchDependencyError => error
- if state
- vertex = activated.vertex_named(name_for(error.dependency))
- error.required_by += vertex.incoming_edges.map { |e| e.origin.name }
- error.required_by << name_for_explicit_dependency_source unless vertex.explicit_requirements.empty?
- end
- raise
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb
deleted file mode 100644
index b413e3ab6a..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb
+++ /dev/null
@@ -1,222 +0,0 @@
-# frozen_string_literal: true
-require 'set'
-require 'tsort'
-
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex'
-
-module Gem::Resolver::Molinillo
- # A directed acyclic graph that is tuned to hold named dependencies
- class DependencyGraph
- include Enumerable
-
- # Enumerates through the vertices of the graph.
- # @return [Array<Vertex>] The graph's vertices.
- def each
- return vertices.values.each unless block_given?
- vertices.values.each { |v| yield v }
- end
-
- include TSort
-
- # @!visibility private
- alias tsort_each_node each
-
- # @!visibility private
- def tsort_each_child(vertex, &block)
- vertex.successors.each(&block)
- end
-
- # Topologically sorts the given vertices.
- # @param [Enumerable<Vertex>] vertices the vertices to be sorted, which must
- # all belong to the same graph.
- # @return [Array<Vertex>] The sorted vertices.
- def self.tsort(vertices)
- TSort.tsort(
- lambda { |b| vertices.each(&b) },
- lambda { |v, &b| (v.successors & vertices).each(&b) }
- )
- end
-
- # A directed edge of a {DependencyGraph}
- # @attr [Vertex] origin The origin of the directed edge
- # @attr [Vertex] destination The destination of the directed edge
- # @attr [Object] requirement The requirement the directed edge represents
- Edge = Struct.new(:origin, :destination, :requirement)
-
- # @return [{String => Vertex}] the vertices of the dependency graph, keyed
- # by {Vertex#name}
- attr_reader :vertices
-
- # @return [Log] the op log for this graph
- attr_reader :log
-
- # Initializes an empty dependency graph
- def initialize
- @vertices = {}
- @log = Log.new
- end
-
- # Tags the current state of the dependency as the given tag
- # @param [Object] tag an opaque tag for the current state of the graph
- # @return [Void]
- def tag(tag)
- log.tag(self, tag)
- end
-
- # Rewinds the graph to the state tagged as `tag`
- # @param [Object] tag the tag to rewind to
- # @return [Void]
- def rewind_to(tag)
- log.rewind_to(self, tag)
- end
-
- # Initializes a copy of a {DependencyGraph}, ensuring that all {#vertices}
- # are properly copied.
- # @param [DependencyGraph] other the graph to copy.
- def initialize_copy(other)
- super
- @vertices = {}
- @log = other.log.dup
- traverse = lambda do |new_v, old_v|
- return if new_v.outgoing_edges.size == old_v.outgoing_edges.size
- old_v.outgoing_edges.each do |edge|
- destination = add_vertex(edge.destination.name, edge.destination.payload)
- add_edge_no_circular(new_v, destination, edge.requirement)
- traverse.call(destination, edge.destination)
- end
- end
- other.vertices.each do |name, vertex|
- new_vertex = add_vertex(name, vertex.payload, vertex.root?)
- new_vertex.explicit_requirements.replace(vertex.explicit_requirements)
- traverse.call(new_vertex, vertex)
- end
- end
-
- # @return [String] a string suitable for debugging
- def inspect
- "#{self.class}:#{vertices.values.inspect}"
- end
-
- # @param [Hash] options options for dot output.
- # @return [String] Returns a dot format representation of the graph
- def to_dot(options = {})
- edge_label = options.delete(:edge_label)
- raise ArgumentError, "Unknown options: #{options.keys}" unless options.empty?
-
- dot_vertices = []
- dot_edges = []
- vertices.each do |n, v|
- dot_vertices << " #{n} [label=\"{#{n}|#{v.payload}}\"]"
- v.outgoing_edges.each do |e|
- label = edge_label ? edge_label.call(e) : e.requirement
- dot_edges << " #{e.origin.name} -> #{e.destination.name} [label=#{label.to_s.dump}]"
- end
- end
-
- dot_vertices.uniq!
- dot_vertices.sort!
- dot_edges.uniq!
- dot_edges.sort!
-
- dot = dot_vertices.unshift('digraph G {').push('') + dot_edges.push('}')
- dot.join("\n")
- end
-
- # @return [Boolean] whether the two dependency graphs are equal, determined
- # by a recursive traversal of each {#root_vertices} and its
- # {Vertex#successors}
- def ==(other)
- return false unless other
- return true if equal?(other)
- vertices.each do |name, vertex|
- other_vertex = other.vertex_named(name)
- return false unless other_vertex
- return false unless vertex.payload == other_vertex.payload
- return false unless other_vertex.successors.to_set == vertex.successors.to_set
- end
- end
-
- # @param [String] name
- # @param [Object] payload
- # @param [Array<String>] parent_names
- # @param [Object] requirement the requirement that is requiring the child
- # @return [void]
- def add_child_vertex(name, payload, parent_names, requirement)
- root = !parent_names.delete(nil) { true }
- vertex = add_vertex(name, payload, root)
- vertex.explicit_requirements << requirement if root
- parent_names.each do |parent_name|
- parent_node = vertex_named(parent_name)
- add_edge(parent_node, vertex, requirement)
- end
- vertex
- end
-
- # Adds a vertex with the given name, or updates the existing one.
- # @param [String] name
- # @param [Object] payload
- # @return [Vertex] the vertex that was added to `self`
- def add_vertex(name, payload, root = false)
- log.add_vertex(self, name, payload, root)
- end
-
- # Detaches the {#vertex_named} `name` {Vertex} from the graph, recursively
- # removing any non-root vertices that were orphaned in the process
- # @param [String] name
- # @return [Array<Vertex>] the vertices which have been detached
- def detach_vertex_named(name)
- log.detach_vertex_named(self, name)
- end
-
- # @param [String] name
- # @return [Vertex,nil] the vertex with the given name
- def vertex_named(name)
- vertices[name]
- end
-
- # @param [String] name
- # @return [Vertex,nil] the root vertex with the given name
- def root_vertex_named(name)
- vertex = vertex_named(name)
- vertex if vertex && vertex.root?
- end
-
- # Adds a new {Edge} to the dependency graph
- # @param [Vertex] origin
- # @param [Vertex] destination
- # @param [Object] requirement the requirement that this edge represents
- # @return [Edge] the added edge
- def add_edge(origin, destination, requirement)
- if destination.path_to?(origin)
- raise CircularDependencyError.new([origin, destination])
- end
- add_edge_no_circular(origin, destination, requirement)
- end
-
- # Deletes an {Edge} from the dependency graph
- # @param [Edge] edge
- # @return [Void]
- def delete_edge(edge)
- log.delete_edge(self, edge.origin.name, edge.destination.name, edge.requirement)
- end
-
- # Sets the payload of the vertex with the given name
- # @param [String] name the name of the vertex
- # @param [Object] payload the payload
- # @return [Void]
- def set_payload(name, payload)
- log.set_payload(self, name, payload)
- end
-
- private
-
- # Adds a new {Edge} to the dependency graph without checking for
- # circularity.
- # @param (see #add_edge)
- # @return (see #add_edge)
- def add_edge_no_circular(origin, destination, requirement)
- log.add_edge_no_circular(self, origin.name, destination.name, requirement)
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb
deleted file mode 100644
index eeedabb069..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # An action that modifies a {DependencyGraph} that is reversible.
- # @abstract
- class Action
- # rubocop:disable Lint/UnusedMethodArgument
-
- # @return [Symbol] The name of the action.
- def self.action_name
- raise 'Abstract'
- end
-
- # Performs the action on the given graph.
- # @param [DependencyGraph] graph the graph to perform the action on.
- # @return [Void]
- def up(graph)
- raise 'Abstract'
- end
-
- # Reverses the action on the given graph.
- # @param [DependencyGraph] graph the graph to reverse the action on.
- # @return [Void]
- def down(graph)
- raise 'Abstract'
- end
-
- # @return [Action,Nil] The previous action
- attr_accessor :previous
-
- # @return [Action,Nil] The next action
- attr_accessor :next
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
deleted file mode 100644
index e994e59d05..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # (see DependencyGraph#add_edge_no_circular)
- class AddEdgeNoCircular < Action
- # @!group Action
-
- # (see Action.action_name)
- def self.action_name
- :add_vertex
- end
-
- # (see Action#up)
- def up(graph)
- edge = make_edge(graph)
- edge.origin.outgoing_edges << edge
- edge.destination.incoming_edges << edge
- edge
- end
-
- # (see Action#down)
- def down(graph)
- edge = make_edge(graph)
- delete_first(edge.origin.outgoing_edges, edge)
- delete_first(edge.destination.incoming_edges, edge)
- end
-
- # @!group AddEdgeNoCircular
-
- # @return [String] the name of the origin of the edge
- attr_reader :origin
-
- # @return [String] the name of the destination of the edge
- attr_reader :destination
-
- # @return [Object] the requirement that the edge represents
- attr_reader :requirement
-
- # @param [DependencyGraph] graph the graph to find vertices from
- # @return [Edge] The edge this action adds
- def make_edge(graph)
- Edge.new(graph.vertex_named(origin), graph.vertex_named(destination), requirement)
- end
-
- # Initialize an action to add an edge to a dependency graph
- # @param [String] origin the name of the origin of the edge
- # @param [String] destination the name of the destination of the edge
- # @param [Object] requirement the requirement that the edge represents
- def initialize(origin, destination, requirement)
- @origin = origin
- @destination = destination
- @requirement = requirement
- end
-
- private
-
- def delete_first(array, item)
- return unless index = array.index(item)
- array.delete_at(index)
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
deleted file mode 100644
index 6cde933080..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # (see DependencyGraph#add_vertex)
- class AddVertex < Action # :nodoc:
- # @!group Action
-
- # (see Action.action_name)
- def self.action_name
- :add_vertex
- end
-
- # (see Action#up)
- def up(graph)
- if existing = graph.vertices[name]
- @existing_payload = existing.payload
- @existing_root = existing.root
- end
- vertex = existing || Vertex.new(name, payload)
- graph.vertices[vertex.name] = vertex
- vertex.payload ||= payload
- vertex.root ||= root
- vertex
- end
-
- # (see Action#down)
- def down(graph)
- if defined?(@existing_payload)
- vertex = graph.vertices[name]
- vertex.payload = @existing_payload
- vertex.root = @existing_root
- else
- graph.vertices.delete(name)
- end
- end
-
- # @!group AddVertex
-
- # @return [String] the name of the vertex
- attr_reader :name
-
- # @return [Object] the payload for the vertex
- attr_reader :payload
-
- # @return [Boolean] whether the vertex is root or not
- attr_reader :root
-
- # Initialize an action to add a vertex to a dependency graph
- # @param [String] name the name of the vertex
- # @param [Object] payload the payload for the vertex
- # @param [Boolean] root whether the vertex is root or not
- def initialize(name, payload, root)
- @name = name
- @payload = payload
- @root = root
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
deleted file mode 100644
index d44aaf1f06..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # (see DependencyGraph#delete_edge)
- class DeleteEdge < Action
- # @!group Action
-
- # (see Action.action_name)
- def self.action_name
- :delete_edge
- end
-
- # (see Action#up)
- def up(graph)
- edge = make_edge(graph)
- edge.origin.outgoing_edges.delete(edge)
- edge.destination.incoming_edges.delete(edge)
- end
-
- # (see Action#down)
- def down(graph)
- edge = make_edge(graph)
- edge.origin.outgoing_edges << edge
- edge.destination.incoming_edges << edge
- edge
- end
-
- # @!group DeleteEdge
-
- # @return [String] the name of the origin of the edge
- attr_reader :origin_name
-
- # @return [String] the name of the destination of the edge
- attr_reader :destination_name
-
- # @return [Object] the requirement that the edge represents
- attr_reader :requirement
-
- # @param [DependencyGraph] graph the graph to find vertices from
- # @return [Edge] The edge this action adds
- def make_edge(graph)
- Edge.new(
- graph.vertex_named(origin_name),
- graph.vertex_named(destination_name),
- requirement
- )
- end
-
- # Initialize an action to add an edge to a dependency graph
- # @param [String] origin_name the name of the origin of the edge
- # @param [String] destination_name the name of the destination of the edge
- # @param [Object] requirement the requirement that the edge represents
- def initialize(origin_name, destination_name, requirement)
- @origin_name = origin_name
- @destination_name = destination_name
- @requirement = requirement
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
deleted file mode 100644
index fa03e2d365..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # @see DependencyGraph#detach_vertex_named
- class DetachVertexNamed < Action
- # @!group Action
-
- # (see Action#name)
- def self.action_name
- :add_vertex
- end
-
- # (see Action#up)
- def up(graph)
- return [] unless @vertex = graph.vertices.delete(name)
-
- removed_vertices = [@vertex]
- @vertex.outgoing_edges.each do |e|
- v = e.destination
- v.incoming_edges.delete(e)
- if !v.root? && v.incoming_edges.empty?
- removed_vertices.concat graph.detach_vertex_named(v.name)
- end
- end
-
- @vertex.incoming_edges.each do |e|
- v = e.origin
- v.outgoing_edges.delete(e)
- end
-
- removed_vertices
- end
-
- # (see Action#down)
- def down(graph)
- return unless @vertex
- graph.vertices[@vertex.name] = @vertex
- @vertex.outgoing_edges.each do |e|
- e.destination.incoming_edges << e
- end
- @vertex.incoming_edges.each do |e|
- e.origin.outgoing_edges << e
- end
- end
-
- # @!group DetachVertexNamed
-
- # @return [String] the name of the vertex to detach
- attr_reader :name
-
- # Initialize an action to detach a vertex from a dependency graph
- # @param [String] name the name of the vertex to detach
- def initialize(name)
- @name = name
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb
deleted file mode 100644
index 5cdd84b5c1..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload'
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag'
-
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # A log for dependency graph actions
- class Log
- # Initializes an empty log
- def initialize
- @current_action = @first_action = nil
- end
-
- # @!macro [new] action
- # {include:DependencyGraph#$0}
- # @param [Graph] graph the graph to perform the action on
- # @param (see DependencyGraph#$0)
- # @return (see DependencyGraph#$0)
-
- # @macro action
- def tag(graph, tag)
- push_action(graph, Tag.new(tag))
- end
-
- # @macro action
- def add_vertex(graph, name, payload, root)
- push_action(graph, AddVertex.new(name, payload, root))
- end
-
- # @macro action
- def detach_vertex_named(graph, name)
- push_action(graph, DetachVertexNamed.new(name))
- end
-
- # @macro action
- def add_edge_no_circular(graph, origin, destination, requirement)
- push_action(graph, AddEdgeNoCircular.new(origin, destination, requirement))
- end
-
- # {include:DependencyGraph#delete_edge}
- # @param [Graph] graph the graph to perform the action on
- # @param [String] origin_name
- # @param [String] destination_name
- # @param [Object] requirement
- # @return (see DependencyGraph#delete_edge)
- def delete_edge(graph, origin_name, destination_name, requirement)
- push_action(graph, DeleteEdge.new(origin_name, destination_name, requirement))
- end
-
- # @macro action
- def set_payload(graph, name, payload)
- push_action(graph, SetPayload.new(name, payload))
- end
-
- # Pops the most recent action from the log and undoes the action
- # @param [DependencyGraph] graph
- # @return [Action] the action that was popped off the log
- def pop!(graph)
- return unless action = @current_action
- unless @current_action = action.previous
- @first_action = nil
- end
- action.down(graph)
- action
- end
-
- extend Enumerable
-
- # @!visibility private
- # Enumerates each action in the log
- # @yield [Action]
- def each
- return enum_for unless block_given?
- action = @first_action
- loop do
- break unless action
- yield action
- action = action.next
- end
- self
- end
-
- # @!visibility private
- # Enumerates each action in the log in reverse order
- # @yield [Action]
- def reverse_each
- return enum_for(:reverse_each) unless block_given?
- action = @current_action
- loop do
- break unless action
- yield action
- action = action.previous
- end
- self
- end
-
- # @macro action
- def rewind_to(graph, tag)
- loop do
- action = pop!(graph)
- raise "No tag #{tag.inspect} found" unless action
- break if action.class.action_name == :tag && action.tag == tag
- end
- end
-
- private
-
- # Adds the given action to the log, running the action
- # @param [DependencyGraph] graph
- # @param [Action] action
- # @return The value returned by `action.up`
- def push_action(graph, action)
- action.previous = @current_action
- @current_action.next = action if @current_action
- @current_action = action
- @first_action ||= action
- action.up(graph)
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb
deleted file mode 100644
index 02cfba64a7..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # @see DependencyGraph#set_payload
- class SetPayload < Action # :nodoc:
- # @!group Action
-
- # (see Action.action_name)
- def self.action_name
- :set_payload
- end
-
- # (see Action#up)
- def up(graph)
- vertex = graph.vertex_named(name)
- @old_payload = vertex.payload
- vertex.payload = payload
- end
-
- # (see Action#down)
- def down(graph)
- graph.vertex_named(name).payload = @old_payload
- end
-
- # @!group SetPayload
-
- # @return [String] the name of the vertex
- attr_reader :name
-
- # @return [Object] the payload for the vertex
- attr_reader :payload
-
- # Initialize an action to add set the payload for a vertex in a dependency
- # graph
- # @param [String] name the name of the vertex
- # @param [Object] payload the payload for the vertex
- def initialize(name, payload)
- @name = name
- @payload = payload
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb
deleted file mode 100644
index 0cb08075ca..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action'
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # @!visibility private
- # @see DependencyGraph#tag
- class Tag < Action
- # @!group Action
-
- # (see Action.action_name)
- def self.action_name
- :tag
- end
-
- # (see Action#up)
- def up(_graph)
- end
-
- # (see Action#down)
- def down(_graph)
- end
-
- # @!group Tag
-
- # @return [Object] An opaque tag
- attr_reader :tag
-
- # Initialize an action to tag a state of a dependency graph
- # @param [Object] tag an opaque tag
- def initialize(tag)
- @tag = tag
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb
deleted file mode 100644
index cebd9cafdd..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- class DependencyGraph
- # A vertex in a {DependencyGraph} that encapsulates a {#name} and a
- # {#payload}
- class Vertex
- # @return [String] the name of the vertex
- attr_accessor :name
-
- # @return [Object] the payload the vertex holds
- attr_accessor :payload
-
- # @return [Array<Object>] the explicit requirements that required
- # this vertex
- attr_reader :explicit_requirements
-
- # @return [Boolean] whether the vertex is considered a root vertex
- attr_accessor :root
- alias root? root
-
- # Initializes a vertex with the given name and payload.
- # @param [String] name see {#name}
- # @param [Object] payload see {#payload}
- def initialize(name, payload)
- @name = name.frozen? ? name : name.dup.freeze
- @payload = payload
- @explicit_requirements = []
- @outgoing_edges = []
- @incoming_edges = []
- end
-
- # @return [Array<Object>] all of the requirements that required
- # this vertex
- def requirements
- incoming_edges.map(&:requirement) + explicit_requirements
- end
-
- # @return [Array<Edge>] the edges of {#graph} that have `self` as their
- # {Edge#origin}
- attr_accessor :outgoing_edges
-
- # @return [Array<Edge>] the edges of {#graph} that have `self` as their
- # {Edge#destination}
- attr_accessor :incoming_edges
-
- # @return [Array<Vertex>] the vertices of {#graph} that have an edge with
- # `self` as their {Edge#destination}
- def predecessors
- incoming_edges.map(&:origin)
- end
-
- # @return [Array<Vertex>] the vertices of {#graph} where `self` is a
- # {#descendent?}
- def recursive_predecessors
- vertices = predecessors
- vertices += vertices.map(&:recursive_predecessors).flatten(1)
- vertices.uniq!
- vertices
- end
-
- # @return [Array<Vertex>] the vertices of {#graph} that have an edge with
- # `self` as their {Edge#origin}
- def successors
- outgoing_edges.map(&:destination)
- end
-
- # @return [Array<Vertex>] the vertices of {#graph} where `self` is an
- # {#ancestor?}
- def recursive_successors
- vertices = successors
- vertices += vertices.map(&:recursive_successors).flatten(1)
- vertices.uniq!
- vertices
- end
-
- # @return [String] a string suitable for debugging
- def inspect
- "#{self.class}:#{name}(#{payload.inspect})"
- end
-
- # @return [Boolean] whether the two vertices are equal, determined
- # by a recursive traversal of each {Vertex#successors}
- def ==(other)
- return true if equal?(other)
- shallow_eql?(other) &&
- successors.to_set == other.successors.to_set
- end
-
- # @param [Vertex] other the other vertex to compare to
- # @return [Boolean] whether the two vertices are equal, determined
- # solely by {#name} and {#payload} equality
- def shallow_eql?(other)
- return true if equal?(other)
- other &&
- name == other.name &&
- payload == other.payload
- end
-
- alias eql? ==
-
- # @return [Fixnum] a hash for the vertex based upon its {#name}
- def hash
- name.hash
- end
-
- # Is there a path from `self` to `other` following edges in the
- # dependency graph?
- # @return true iff there is a path following edges within this {#graph}
- def path_to?(other)
- equal?(other) || successors.any? { |v| v.path_to?(other) }
- end
-
- alias descendent? path_to?
-
- # Is there a path from `other` to `self` following edges in the
- # dependency graph?
- # @return true iff there is a path following edges within this {#graph}
- def ancestor?(other)
- other.path_to?(self)
- end
-
- alias is_reachable_from? ancestor?
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
deleted file mode 100644
index 129246bf4a..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # An error that occurred during the resolution process
- class ResolverError < StandardError; end
-
- # An error caused by searching for a dependency that is completely unknown,
- # i.e. has no versions available whatsoever.
- class NoSuchDependencyError < ResolverError
- # @return [Object] the dependency that could not be found
- attr_accessor :dependency
-
- # @return [Array<Object>] the specifications that depended upon {#dependency}
- attr_accessor :required_by
-
- # Initializes a new error with the given missing dependency.
- # @param [Object] dependency @see {#dependency}
- # @param [Array<Object>] required_by @see {#required_by}
- def initialize(dependency, required_by = [])
- @dependency = dependency
- @required_by = required_by
- super()
- end
-
- # The error message for the missing dependency, including the specifications
- # that had this dependency.
- def message
- sources = required_by.map { |r| "`#{r}`" }.join(' and ')
- message = "Unable to find a specification for `#{dependency}`"
- message += " depended upon by #{sources}" unless sources.empty?
- message
- end
- end
-
- # An error caused by attempting to fulfil a dependency that was circular
- #
- # @note This exception will be thrown iff a {Vertex} is added to a
- # {DependencyGraph} that has a {DependencyGraph::Vertex#path_to?} an
- # existing {DependencyGraph::Vertex}
- class CircularDependencyError < ResolverError
- # [Set<Object>] the dependencies responsible for causing the error
- attr_reader :dependencies
-
- # Initializes a new error with the given circular vertices.
- # @param [Array<DependencyGraph::Vertex>] nodes the nodes in the dependency
- # that caused the error
- def initialize(nodes)
- super "There is a circular dependency between #{nodes.map(&:name).join(' and ')}"
- @dependencies = nodes.map(&:payload).to_set
- end
- end
-
- # An error caused by conflicts in version
- class VersionConflict < ResolverError
- # @return [{String => Resolution::Conflict}] the conflicts that caused
- # resolution to fail
- attr_reader :conflicts
-
- # Initializes a new error with the given version conflicts.
- # @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
- def initialize(conflicts)
- pairs = []
- conflicts.values.flatten.map(&:requirements).flatten.each do |conflicting|
- conflicting.each do |source, conflict_requirements|
- conflict_requirements.each do |c|
- pairs << [c, source]
- end
- end
- end
-
- super "Unable to satisfy the following requirements:\n\n" \
- "#{pairs.map { |r, d| "- `#{r}` required by `#{d}`" }.join("\n")}"
- @conflicts = conflicts
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb
deleted file mode 100644
index c5b5bd729f..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # The version of Gem::Resolver::Molinillo.
- VERSION = '0.5.7'.freeze
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb
deleted file mode 100644
index 916345b12a..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # Provides information about specifcations and dependencies to the resolver,
- # allowing the {Resolver} class to remain generic while still providing power
- # and flexibility.
- #
- # This module contains the methods that users of Gem::Resolver::Molinillo must to implement,
- # using knowledge of their own model classes.
- module SpecificationProvider
- # Search for the specifications that match the given dependency.
- # The specifications in the returned array will be considered in reverse
- # order, so the latest version ought to be last.
- # @note This method should be 'pure', i.e. the return value should depend
- # only on the `dependency` parameter.
- #
- # @param [Object] dependency
- # @return [Array<Object>] the specifications that satisfy the given
- # `dependency`.
- def search_for(dependency)
- []
- end
-
- # Returns the dependencies of `specification`.
- # @note This method should be 'pure', i.e. the return value should depend
- # only on the `specification` parameter.
- #
- # @param [Object] specification
- # @return [Array<Object>] the dependencies that are required by the given
- # `specification`.
- def dependencies_for(specification)
- []
- end
-
- # Determines whether the given `requirement` is satisfied by the given
- # `spec`, in the context of the current `activated` dependency graph.
- #
- # @param [Object] requirement
- # @param [DependencyGraph] activated the current dependency graph in the
- # resolution process.
- # @param [Object] spec
- # @return [Boolean] whether `requirement` is satisfied by `spec` in the
- # context of the current `activated` dependency graph.
- def requirement_satisfied_by?(requirement, activated, spec)
- true
- end
-
- # Returns the name for the given `dependency`.
- # @note This method should be 'pure', i.e. the return value should depend
- # only on the `dependency` parameter.
- #
- # @param [Object] dependency
- # @return [String] the name for the given `dependency`.
- def name_for(dependency)
- dependency.to_s
- end
-
- # @return [String] the name of the source of explicit dependencies, i.e.
- # those passed to {Resolver#resolve} directly.
- def name_for_explicit_dependency_source
- 'user-specified dependency'
- end
-
- # @return [String] the name of the source of 'locked' dependencies, i.e.
- # those passed to {Resolver#resolve} directly as the `base`
- def name_for_locking_dependency_source
- 'Lockfile'
- end
-
- # Sort dependencies so that the ones that are easiest to resolve are first.
- # Easiest to resolve is (usually) defined by:
- # 1) Is this dependency already activated?
- # 2) How relaxed are the requirements?
- # 3) Are there any conflicts for this dependency?
- # 4) How many possibilities are there to satisfy this dependency?
- #
- # @param [Array<Object>] dependencies
- # @param [DependencyGraph] activated the current dependency graph in the
- # resolution process.
- # @param [{String => Array<Conflict>}] conflicts
- # @return [Array<Object>] a sorted copy of `dependencies`.
- def sort_dependencies(dependencies, activated, conflicts)
- dependencies.sort_by do |dependency|
- name = name_for(dependency)
- [
- activated.vertex_named(name).payload ? 0 : 1,
- conflicts[name] ? 0 : 1,
- ]
- end
- end
-
- # Returns whether this dependency, which has no possible matching
- # specifications, can safely be ignored.
- #
- # @param [Object] dependency
- # @return [Boolean] whether this dependency can safely be skipped.
- def allow_missing?(dependency)
- false
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb
deleted file mode 100644
index dbc4e000e4..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # Conveys information about the resolution process to a user.
- module UI
- # The {IO} object that should be used to print output. `STDOUT`, by default.
- #
- # @return [IO]
- def output
- STDOUT
- end
-
- # Called roughly every {#progress_rate}, this method should convey progress
- # to the user.
- #
- # @return [void]
- def indicate_progress
- output.print '.' unless debug?
- end
-
- # How often progress should be conveyed to the user via
- # {#indicate_progress}, in seconds. A third of a second, by default.
- #
- # @return [Float]
- def progress_rate
- 0.33
- end
-
- # Called before resolution begins.
- #
- # @return [void]
- def before_resolution
- output.print 'Resolving dependencies...'
- end
-
- # Called after resolution ends (either successfully or with an error).
- # By default, prints a newline.
- #
- # @return [void]
- def after_resolution
- output.puts
- end
-
- # Conveys debug information to the user.
- #
- # @param [Integer] depth the current depth of the resolution process.
- # @return [void]
- def debug(depth = 0)
- if debug?
- debug_info = yield
- debug_info = debug_info.inspect unless debug_info.is_a?(String)
- output.puts debug_info.split("\n").map { |s| ' ' * depth + s }
- end
- end
-
- # Whether or not debug messages should be printed.
- # By default, whether or not the `MOLINILLO_DEBUG` environment variable is
- # set.
- #
- # @return [Boolean]
- def debug?
- return @debug_mode if defined?(@debug_mode)
- @debug_mode = ENV['MOLINILLO_DEBUG']
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
deleted file mode 100644
index 73a4242157..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb
+++ /dev/null
@@ -1,494 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- class Resolver
- # A specific resolution from a given {Resolver}
- class Resolution
- # A conflict that the resolution process encountered
- # @attr [Object] requirement the requirement that immediately led to the conflict
- # @attr [{String,Nil=>[Object]}] requirements the requirements that caused the conflict
- # @attr [Object, nil] existing the existing spec that was in conflict with
- # the {#possibility}
- # @attr [Object] possibility the spec that was unable to be activated due
- # to a conflict
- # @attr [Object] locked_requirement the relevant locking requirement.
- # @attr [Array<Array<Object>>] requirement_trees the different requirement
- # trees that led to every requirement for the conflicting name.
- # @attr [{String=>Object}] activated_by_name the already-activated specs.
- Conflict = Struct.new(
- :requirement,
- :requirements,
- :existing,
- :possibility,
- :locked_requirement,
- :requirement_trees,
- :activated_by_name
- )
-
- # @return [SpecificationProvider] the provider that knows about
- # dependencies, requirements, specifications, versions, etc.
- attr_reader :specification_provider
-
- # @return [UI] the UI that knows how to communicate feedback about the
- # resolution process back to the user
- attr_reader :resolver_ui
-
- # @return [DependencyGraph] the base dependency graph to which
- # dependencies should be 'locked'
- attr_reader :base
-
- # @return [Array] the dependencies that were explicitly required
- attr_reader :original_requested
-
- # Initializes a new resolution.
- # @param [SpecificationProvider] specification_provider
- # see {#specification_provider}
- # @param [UI] resolver_ui see {#resolver_ui}
- # @param [Array] requested see {#original_requested}
- # @param [DependencyGraph] base see {#base}
- def initialize(specification_provider, resolver_ui, requested, base)
- @specification_provider = specification_provider
- @resolver_ui = resolver_ui
- @original_requested = requested
- @base = base
- @states = []
- @iteration_counter = 0
- @parents_of = Hash.new { |h, k| h[k] = [] }
- end
-
- # Resolves the {#original_requested} dependencies into a full dependency
- # graph
- # @raise [ResolverError] if successful resolution is impossible
- # @return [DependencyGraph] the dependency graph of successfully resolved
- # dependencies
- def resolve
- start_resolution
-
- while state
- break unless state.requirements.any? || state.requirement
- indicate_progress
- if state.respond_to?(:pop_possibility_state) # DependencyState
- debug(depth) { "Creating possibility state for #{requirement} (#{possibilities.count} remaining)" }
- state.pop_possibility_state.tap do |s|
- if s
- states.push(s)
- activated.tag(s)
- end
- end
- end
- process_topmost_state
- end
-
- activated.freeze
- ensure
- end_resolution
- end
-
- # @return [Integer] the number of resolver iterations in between calls to
- # {#resolver_ui}'s {UI#indicate_progress} method
- attr_accessor :iteration_rate
- private :iteration_rate
-
- # @return [Time] the time at which resolution began
- attr_accessor :started_at
- private :started_at
-
- # @return [Array<ResolutionState>] the stack of states for the resolution
- attr_accessor :states
- private :states
-
- private
-
- # Sets up the resolution process
- # @return [void]
- def start_resolution
- @started_at = Time.now
-
- handle_missing_or_push_dependency_state(initial_state)
-
- debug { "Starting resolution (#{@started_at})\nUser-requested dependencies: #{original_requested}" }
- resolver_ui.before_resolution
- end
-
- # Ends the resolution process
- # @return [void]
- def end_resolution
- resolver_ui.after_resolution
- debug do
- "Finished resolution (#{@iteration_counter} steps) " \
- "(Took #{(ended_at = Time.now) - @started_at} seconds) (#{ended_at})"
- end
- debug { 'Unactivated: ' + Hash[activated.vertices.reject { |_n, v| v.payload }].keys.join(', ') } if state
- debug { 'Activated: ' + Hash[activated.vertices.select { |_n, v| v.payload }].keys.join(', ') } if state
- end
-
- require 'rubygems/resolver/molinillo/lib/molinillo/state'
- require 'rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider'
-
- require 'rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state'
- require 'rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider'
-
- include Gem::Resolver::Molinillo::Delegates::ResolutionState
- include Gem::Resolver::Molinillo::Delegates::SpecificationProvider
-
- # Processes the topmost available {RequirementState} on the stack
- # @return [void]
- def process_topmost_state
- if possibility
- attempt_to_activate
- else
- create_conflict if state.is_a? PossibilityState
- unwind_for_conflict until possibility && state.is_a?(DependencyState)
- end
- end
-
- # @return [Object] the current possibility that the resolution is trying
- # to activate
- def possibility
- possibilities.last
- end
-
- # @return [RequirementState] the current state the resolution is
- # operating upon
- def state
- states.last
- end
-
- # Creates the initial state for the resolution, based upon the
- # {#requested} dependencies
- # @return [DependencyState] the initial state for the resolution
- def initial_state
- graph = DependencyGraph.new.tap do |dg|
- original_requested.each { |r| dg.add_vertex(name_for(r), nil, true).tap { |v| v.explicit_requirements << r } }
- dg.tag(:initial_state)
- end
-
- requirements = sort_dependencies(original_requested, graph, {})
- initial_requirement = requirements.shift
- DependencyState.new(
- initial_requirement && name_for(initial_requirement),
- requirements,
- graph,
- initial_requirement,
- initial_requirement && search_for(initial_requirement),
- 0,
- {}
- )
- end
-
- # Unwinds the states stack because a conflict has been encountered
- # @return [void]
- def unwind_for_conflict
- debug(depth) { "Unwinding for conflict: #{requirement} to #{state_index_for_unwind / 2}" }
- conflicts.tap do |c|
- sliced_states = states.slice!((state_index_for_unwind + 1)..-1)
- raise VersionConflict.new(c) unless state
- activated.rewind_to(sliced_states.first || :initial_state) if sliced_states
- state.conflicts = c
- index = states.size - 1
- @parents_of.each { |_, a| a.reject! { |i| i >= index } }
- end
- end
-
- # @return [Integer] The index to which the resolution should unwind in the
- # case of conflict.
- def state_index_for_unwind
- current_requirement = requirement
- existing_requirement = requirement_for_existing_name(name)
- index = -1
- [current_requirement, existing_requirement].each do |r|
- until r.nil?
- current_state = find_state_for(r)
- if state_any?(current_state)
- current_index = states.index(current_state)
- index = current_index if current_index > index
- break
- end
- r = parent_of(r)
- end
- end
-
- index
- end
-
- # @return [Object] the requirement that led to `requirement` being added
- # to the list of requirements.
- def parent_of(requirement)
- return unless requirement
- return unless index = @parents_of[requirement].last
- return unless parent_state = @states[index]
- parent_state.requirement
- end
-
- # @return [Object] the requirement that led to a version of a possibility
- # with the given name being activated.
- def requirement_for_existing_name(name)
- return nil unless activated.vertex_named(name).payload
- states.find { |s| s.name == name }.requirement
- end
-
- # @return [ResolutionState] the state whose `requirement` is the given
- # `requirement`.
- def find_state_for(requirement)
- return nil unless requirement
- states.reverse_each.find { |i| requirement == i.requirement && i.is_a?(DependencyState) }
- end
-
- # @return [Boolean] whether or not the given state has any possibilities
- # left.
- def state_any?(state)
- state && state.possibilities.any?
- end
-
- # @return [Conflict] a {Conflict} that reflects the failure to activate
- # the {#possibility} in conjunction with the current {#state}
- def create_conflict
- vertex = activated.vertex_named(name)
- locked_requirement = locked_requirement_named(name)
-
- requirements = {}
- unless vertex.explicit_requirements.empty?
- requirements[name_for_explicit_dependency_source] = vertex.explicit_requirements
- end
- requirements[name_for_locking_dependency_source] = [locked_requirement] if locked_requirement
- vertex.incoming_edges.each { |edge| (requirements[edge.origin.payload] ||= []).unshift(edge.requirement) }
-
- activated_by_name = {}
- activated.each { |v| activated_by_name[v.name] = v.payload if v.payload }
- conflicts[name] = Conflict.new(
- requirement,
- requirements,
- vertex.payload,
- possibility,
- locked_requirement,
- requirement_trees,
- activated_by_name
- )
- end
-
- # @return [Array<Array<Object>>] The different requirement
- # trees that led to every requirement for the current spec.
- def requirement_trees
- vertex = activated.vertex_named(name)
- vertex.requirements.map { |r| requirement_tree_for(r) }
- end
-
- # @return [Array<Object>] the list of requirements that led to
- # `requirement` being required.
- def requirement_tree_for(requirement)
- tree = []
- while requirement
- tree.unshift(requirement)
- requirement = parent_of(requirement)
- end
- tree
- end
-
- # Indicates progress roughly once every second
- # @return [void]
- def indicate_progress
- @iteration_counter += 1
- @progress_rate ||= resolver_ui.progress_rate
- if iteration_rate.nil?
- if Time.now - started_at >= @progress_rate
- self.iteration_rate = @iteration_counter
- end
- end
-
- if iteration_rate && (@iteration_counter % iteration_rate) == 0
- resolver_ui.indicate_progress
- end
- end
-
- # Calls the {#resolver_ui}'s {UI#debug} method
- # @param [Integer] depth the depth of the {#states} stack
- # @param [Proc] block a block that yields a {#to_s}
- # @return [void]
- def debug(depth = 0, &block)
- resolver_ui.debug(depth, &block)
- end
-
- # Attempts to activate the current {#possibility}
- # @return [void]
- def attempt_to_activate
- debug(depth) { 'Attempting to activate ' + possibility.to_s }
- existing_node = activated.vertex_named(name)
- if existing_node.payload
- debug(depth) { "Found existing spec (#{existing_node.payload})" }
- attempt_to_activate_existing_spec(existing_node)
- else
- attempt_to_activate_new_spec
- end
- end
-
- # Attempts to activate the current {#possibility} (given that it has
- # already been activated)
- # @return [void]
- def attempt_to_activate_existing_spec(existing_node)
- existing_spec = existing_node.payload
- if requirement_satisfied_by?(requirement, activated, existing_spec)
- new_requirements = requirements.dup
- push_state_for_requirements(new_requirements, false)
- else
- return if attempt_to_swap_possibility
- create_conflict
- debug(depth) { "Unsatisfied by existing spec (#{existing_node.payload})" }
- unwind_for_conflict
- end
- end
-
- # Attempts to swp the current {#possibility} with the already-activated
- # spec with the given name
- # @return [Boolean] Whether the possibility was swapped into {#activated}
- def attempt_to_swap_possibility
- activated.tag(:swap)
- vertex = activated.vertex_named(name)
- activated.set_payload(name, possibility)
- if !vertex.requirements.
- all? { |r| requirement_satisfied_by?(r, activated, possibility) } ||
- !new_spec_satisfied?
- activated.rewind_to(:swap)
- return
- end
- fixup_swapped_children(vertex)
- activate_spec
- end
-
- # Ensures there are no orphaned successors to the given {vertex}.
- # @param [DependencyGraph::Vertex] vertex the vertex to fix up.
- # @return [void]
- def fixup_swapped_children(vertex) # rubocop:disable Metrics/CyclomaticComplexity
- payload = vertex.payload
- deps = dependencies_for(payload).group_by(&method(:name_for))
- vertex.outgoing_edges.each do |outgoing_edge|
- requirement = outgoing_edge.requirement
- parent_index = @parents_of[requirement].last
- succ = outgoing_edge.destination
- matching_deps = Array(deps[succ.name])
- dep_matched = matching_deps.include?(requirement)
-
- # only push the current index when it was originally required by the
- # same named spec
- if parent_index && states[parent_index].name == name
- @parents_of[requirement].push(states.size - 1)
- end
-
- if matching_deps.empty? && !succ.root? && succ.predecessors.to_a == [vertex]
- debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" }
- succ.requirements.each { |r| @parents_of.delete(r) }
-
- removed_names = activated.detach_vertex_named(succ.name).map(&:name)
- requirements.delete_if do |r|
- # the only removed vertices are those with no other requirements,
- # so it's safe to delete only based upon name here
- removed_names.include?(name_for(r))
- end
- elsif !dep_matched
- debug(depth) { "Removing orphaned dependency #{requirement} after swapping #{name}" }
- # also reset if we're removing the edge, but only if its parent has
- # already been fixed up
- @parents_of[requirement].push(states.size - 1) if @parents_of[requirement].empty?
-
- activated.delete_edge(outgoing_edge)
- requirements.delete(requirement)
- end
- end
- end
-
- # Attempts to activate the current {#possibility} (given that it hasn't
- # already been activated)
- # @return [void]
- def attempt_to_activate_new_spec
- if new_spec_satisfied?
- activate_spec
- else
- create_conflict
- unwind_for_conflict
- end
- end
-
- # @return [Boolean] whether the current spec is satisfied as a new
- # possibility.
- def new_spec_satisfied?
- unless requirement_satisfied_by?(requirement, activated, possibility)
- debug(depth) { 'Unsatisfied by requested spec' }
- return false
- end
-
- locked_requirement = locked_requirement_named(name)
-
- locked_spec_satisfied = !locked_requirement ||
- requirement_satisfied_by?(locked_requirement, activated, possibility)
- debug(depth) { 'Unsatisfied by locked spec' } unless locked_spec_satisfied
-
- locked_spec_satisfied
- end
-
- # @param [String] requirement_name the spec name to search for
- # @return [Object] the locked spec named `requirement_name`, if one
- # is found on {#base}
- def locked_requirement_named(requirement_name)
- vertex = base.vertex_named(requirement_name)
- vertex && vertex.payload
- end
-
- # Add the current {#possibility} to the dependency graph of the current
- # {#state}
- # @return [void]
- def activate_spec
- conflicts.delete(name)
- debug(depth) { "Activated #{name} at #{possibility}" }
- activated.set_payload(name, possibility)
- require_nested_dependencies_for(possibility)
- end
-
- # Requires the dependencies that the recently activated spec has
- # @param [Object] activated_spec the specification that has just been
- # activated
- # @return [void]
- def require_nested_dependencies_for(activated_spec)
- nested_dependencies = dependencies_for(activated_spec)
- debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
- nested_dependencies.each do |d|
- activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d)
- parent_index = states.size - 1
- parents = @parents_of[d]
- parents << parent_index if parents.empty?
- end
-
- push_state_for_requirements(requirements + nested_dependencies, !nested_dependencies.empty?)
- end
-
- # Pushes a new {DependencyState} that encapsulates both existing and new
- # requirements
- # @param [Array] new_requirements
- # @return [void]
- def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
- new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
- new_requirement = new_requirements.shift
- new_name = new_requirement ? name_for(new_requirement) : ''.freeze
- possibilities = new_requirement ? search_for(new_requirement) : []
- handle_missing_or_push_dependency_state DependencyState.new(
- new_name, new_requirements, new_activated,
- new_requirement, possibilities, depth, conflicts.dup
- )
- end
-
- # Pushes a new {DependencyState}.
- # If the {#specification_provider} says to
- # {SpecificationProvider#allow_missing?} that particular requirement, and
- # there are no possibilities for that requirement, then `state` is not
- # pushed, and the node in {#activated} is removed, and we continue
- # resolving the remaining requirements.
- # @param [DependencyState] state
- # @return [void]
- def handle_missing_or_push_dependency_state(state)
- if state.requirement && state.possibilities.empty? && allow_missing?(state.requirement)
- state.activated.detach_vertex_named(state.name)
- push_state_for_requirements(state.requirements.dup, false, state.activated)
- else
- states.push(state).tap { activated.tag(state) }
- end
- end
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
deleted file mode 100644
index 5c59a45c3d..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph'
-
-module Gem::Resolver::Molinillo
- # This class encapsulates a dependency resolver.
- # The resolver is responsible for determining which set of dependencies to
- # activate, with feedback from the {#specification_provider}
- #
- #
- class Resolver
- require 'rubygems/resolver/molinillo/lib/molinillo/resolution'
-
- # @return [SpecificationProvider] the specification provider used
- # in the resolution process
- attr_reader :specification_provider
-
- # @return [UI] the UI module used to communicate back to the user
- # during the resolution process
- attr_reader :resolver_ui
-
- # Initializes a new resolver.
- # @param [SpecificationProvider] specification_provider
- # see {#specification_provider}
- # @param [UI] resolver_ui
- # see {#resolver_ui}
- def initialize(specification_provider, resolver_ui)
- @specification_provider = specification_provider
- @resolver_ui = resolver_ui
- end
-
- # Resolves the requested dependencies into a {DependencyGraph},
- # locking to the base dependency graph (if specified)
- # @param [Array] requested an array of 'requested' dependencies that the
- # {#specification_provider} can understand
- # @param [DependencyGraph,nil] base the base dependency graph to which
- # dependencies should be 'locked'
- def resolve(requested, base = DependencyGraph.new)
- Resolution.new(specification_provider,
- resolver_ui,
- requested,
- base).
- resolve
- end
- end
-end
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb
deleted file mode 100644
index c20de98854..0000000000
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-module Gem::Resolver::Molinillo
- # A state that a {Resolution} can be in
- # @attr [String] name the name of the current requirement
- # @attr [Array<Object>] requirements currently unsatisfied requirements
- # @attr [DependencyGraph] activated the graph of activated dependencies
- # @attr [Object] requirement the current requirement
- # @attr [Object] possibilities the possibilities to satisfy the current requirement
- # @attr [Integer] depth the depth of the resolution
- # @attr [Set<Object>] conflicts unresolved conflicts
- ResolutionState = Struct.new(
- :name,
- :requirements,
- :activated,
- :requirement,
- :possibilities,
- :depth,
- :conflicts
- )
-
- class ResolutionState
- # Returns an empty resolution state
- # @return [ResolutionState] an empty state
- def self.empty
- new(nil, [], DependencyGraph.new, nil, nil, 0, Set.new)
- end
- end
-
- # A state that encapsulates a set of {#requirements} with an {Array} of
- # possibilities
- class DependencyState < ResolutionState
- # Removes a possibility from `self`
- # @return [PossibilityState] a state with a single possibility,
- # the possibility that was removed from `self`
- def pop_possibility_state
- PossibilityState.new(
- name,
- requirements.dup,
- activated,
- requirement,
- [possibilities.pop],
- depth + 1,
- conflicts.dup
- ).tap do |state|
- state.activated.tag(state)
- end
- end
- end
-
- # A state that encapsulates a single possibility to fulfill the given
- # {#requirement}
- class PossibilityState < ResolutionState
- end
-end
diff --git a/lib/rubygems/resolver/requirement_list.rb b/lib/rubygems/resolver/requirement_list.rb
index 2768c80170..a6bfaab307 100644
--- a/lib/rubygems/resolver/requirement_list.rb
+++ b/lib/rubygems/resolver/requirement_list.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The RequirementList is used to hold the requirements being considered
# while resolving a set of gems.
diff --git a/lib/rubygems/resolver/set.rb b/lib/rubygems/resolver/set.rb
index 11704d5c4c..b26dc45c7b 100644
--- a/lib/rubygems/resolver/set.rb
+++ b/lib/rubygems/resolver/set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Resolver sets are used to look up specifications (and their
# dependencies) used in resolution. This set is abstract.
@@ -21,7 +20,6 @@ class Gem::Resolver::Set
attr_accessor :prerelease
def initialize # :nodoc:
- require 'uri'
@prerelease = false
@remote = true
@errors = []
@@ -55,3 +53,4 @@ class Gem::Resolver::Set
end
end
+
diff --git a/lib/rubygems/resolver/source_set.rb b/lib/rubygems/resolver/source_set.rb
deleted file mode 100644
index 66f5963e54..0000000000
--- a/lib/rubygems/resolver/source_set.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-##
-# The SourceSet chooses the best available method to query a remote index.
-#
-# Kind off like BestSet but filters the sources for gems
-
-class Gem::Resolver::SourceSet < Gem::Resolver::Set
-
- ##
- # Creates a SourceSet for the given +sources+ or Gem::sources if none are
- # specified. +sources+ must be a Gem::SourceList.
-
- def initialize
- super()
-
- @links = {}
- @sets = {}
- end
-
- def find_all req # :nodoc:
- if set = get_set(req.dependency.name)
- set.find_all req
- else
- []
- end
- end
-
- # potentially no-op
- def prefetch reqs # :nodoc:
- reqs.each do |req|
- if set = get_set(req.dependency.name)
- set.prefetch reqs
- end
- end
- end
-
- def add_source_gem name, source
- @links[name] = source
- end
-
-private
-
- def get_set(name)
- link = @links[name]
- @sets[link] ||= Gem::Source.new(link).dependency_resolver_set if link
- end
-
-end
-
diff --git a/lib/rubygems/resolver/spec_specification.rb b/lib/rubygems/resolver/spec_specification.rb
index 35ee8cc247..1350e8a7ab 100644
--- a/lib/rubygems/resolver/spec_specification.rb
+++ b/lib/rubygems/resolver/spec_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The Resolver::SpecSpecification contains common functionality for
# Resolver specifications that are backed by a Gem::Specification.
diff --git a/lib/rubygems/resolver/specification.rb b/lib/rubygems/resolver/specification.rb
index 44989d39ae..4d77293262 100644
--- a/lib/rubygems/resolver/specification.rb
+++ b/lib/rubygems/resolver/specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Resolver::Specification contains a subset of the information
# contained in a Gem::Specification. Only the information necessary for
@@ -90,7 +89,7 @@ class Gem::Resolver::Specification
gem = source.download spec, destination
- installer = Gem::Installer.at gem, options
+ installer = Gem::Installer.new gem, options
yield installer if block_given?
diff --git a/lib/rubygems/resolver/stats.rb b/lib/rubygems/resolver/stats.rb
index 3b95efebf7..c31e5be962 100644
--- a/lib/rubygems/resolver/stats.rb
+++ b/lib/rubygems/resolver/stats.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
class Gem::Resolver::Stats
def initialize
@max_depth = 0
diff --git a/lib/rubygems/resolver/vendor_set.rb b/lib/rubygems/resolver/vendor_set.rb
index f30ce534af..614bd05382 100644
--- a/lib/rubygems/resolver/vendor_set.rb
+++ b/lib/rubygems/resolver/vendor_set.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A VendorSet represents gems that have been unpacked into a specific
# directory that contains a gemspec.
diff --git a/lib/rubygems/resolver/vendor_specification.rb b/lib/rubygems/resolver/vendor_specification.rb
index c624f3e834..a99b5f3cc1 100644
--- a/lib/rubygems/resolver/vendor_specification.rb
+++ b/lib/rubygems/resolver/vendor_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A VendorSpecification represents a gem that has been unpacked into a project
# and is being loaded through a gem dependencies file through the +path:+
diff --git a/lib/rubygems/safe_yaml.rb b/lib/rubygems/safe_yaml.rb
deleted file mode 100644
index 789bb5e25a..0000000000
--- a/lib/rubygems/safe_yaml.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-module Gem
-
- ###
- # This module is used for safely loading YAML specs from a gem. The
- # `safe_load` method defined on this module is specifically designed for
- # loading Gem specifications. For loading other YAML safely, please see
- # Psych.safe_load
-
- module SafeYAML
- WHITELISTED_CLASSES = %w(
- Symbol
- Time
- Date
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Gem::Version
- Gem::Version::Requirement
- YAML::Syck::DefaultKey
- Syck::DefaultKey
- )
-
- WHITELISTED_SYMBOLS = %w(
- development
- runtime
- )
-
- if ::YAML.respond_to? :safe_load
- def self.safe_load input
- ::YAML.safe_load(input, WHITELISTED_CLASSES, WHITELISTED_SYMBOLS, true)
- end
-
- def self.load input
- ::YAML.safe_load(input, [::Symbol])
- end
- else
- unless Gem::Deprecate.skip
- warn "YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0)."
- end
-
- def self.safe_load input, *args
- ::YAML.load input
- end
-
- def self.load input
- ::YAML.load input
- end
- end
- end
-end
diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb
index 236577c5a3..8c5fb7d9f2 100644
--- a/lib/rubygems/security.rb
+++ b/lib/rubygems/security.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -340,9 +339,7 @@ module Gem::Security
# Digest algorithm used to sign gems
DIGEST_ALGORITHM =
- if defined?(OpenSSL::Digest::SHA256) then
- OpenSSL::Digest::SHA256
- elsif defined?(OpenSSL::Digest::SHA1) then
+ if defined?(OpenSSL::Digest) then
OpenSSL::Digest::SHA1
end
@@ -358,14 +355,14 @@ module Gem::Security
# Algorithm for creating the key pair used to sign gems
KEY_ALGORITHM =
- if defined?(OpenSSL::PKey::RSA) then
+ if defined?(OpenSSL::PKey) then
OpenSSL::PKey::RSA
end
##
# Length of keys created by KEY_ALGORITHM
- KEY_LENGTH = 3072
+ KEY_LENGTH = 2048
##
# Cipher used to encrypt the key pair used to sign gems.
@@ -374,14 +371,9 @@ module Gem::Security
KEY_CIPHER = OpenSSL::Cipher.new('AES-256-CBC') if defined?(OpenSSL::Cipher)
##
- # One day in seconds
-
- ONE_DAY = 86400
-
- ##
# One year in seconds
- ONE_YEAR = ONE_DAY * 365
+ ONE_YEAR = 86400 * 365
##
# The default set of extensions are:
@@ -462,7 +454,7 @@ module Gem::Security
##
# Creates a new key pair of the specified +length+ and +algorithm+. The
- # default is a 3072 bit RSA key.
+ # default is a 2048 bit RSA key.
def self.create_key length = KEY_LENGTH, algorithm = KEY_ALGORITHM
algorithm.new length
@@ -578,7 +570,7 @@ module Gem::Security
def self.write pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER
path = File.expand_path path
- File.open path, 'wb', permissions do |io|
+ open path, 'wb', permissions do |io|
if passphrase and cipher
io.write pemmable.to_pem cipher, passphrase
else
diff --git a/lib/rubygems/security/policies.rb b/lib/rubygems/security/policies.rb
index f16c46306a..a976ecaf59 100644
--- a/lib/rubygems/security/policies.rb
+++ b/lib/rubygems/security/policies.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module Gem::Security
##
diff --git a/lib/rubygems/security/policy.rb b/lib/rubygems/security/policy.rb
index f43e6c8c96..b9bcb17525 100644
--- a/lib/rubygems/security/policy.rb
+++ b/lib/rubygems/security/policy.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/user_interaction'
##
@@ -158,7 +157,7 @@ class Gem::Security::Policy
path = Gem::Security.trust_dir.cert_path root
unless File.exist? path then
- message = "root cert #{root.subject} is not trusted".dup
+ message = "root cert #{root.subject} is not trusted"
message << " (root of signing cert #{chain.last.subject})" if
chain.length > 1
@@ -293,3 +292,4 @@ class Gem::Security::Policy
alias to_s name # :nodoc:
end
+
diff --git a/lib/rubygems/security/signer.rb b/lib/rubygems/security/signer.rb
index 0c6ef60a9a..bb1eae7cf2 100644
--- a/lib/rubygems/security/signer.rb
+++ b/lib/rubygems/security/signer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Basic OpenSSL-based package signing class.
@@ -102,8 +101,6 @@ class Gem::Security::Signer
def sign data
return unless @key
- raise Gem::Security::Exception, 'no certs provided' if @cert_chain.empty?
-
if @cert_chain.length == 1 and @cert_chain.last.not_after < Time.now then
re_sign_key
end
@@ -125,7 +122,7 @@ class Gem::Security::Signer
# ~/.gem/gem-public_cert.pem.expired.%Y%m%d%H%M%S
#
# If the signing certificate can be re-signed the expired certificate will
- # be saved as ~/.gem/gem-public_cert.pem.expired.%Y%m%d%H%M%S where the
+ # be saved as ~/.gem/gem-pubilc_cert.pem.expired.%Y%m%d%H%M%S where the
# expiry time (not after) is used for the timestamp.
def re_sign_key # :nodoc:
diff --git a/lib/rubygems/security/trust_dir.rb b/lib/rubygems/security/trust_dir.rb
index 849cf3cd3e..76ef89af7f 100644
--- a/lib/rubygems/security/trust_dir.rb
+++ b/lib/rubygems/security/trust_dir.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The TrustDir manages the trusted certificates for gem signature
# verification.
@@ -93,7 +92,7 @@ class Gem::Security::TrustDir
destination = cert_path certificate
- File.open destination, 'wb', @permissions[:trusted_cert] do |io|
+ open destination, 'wb', @permissions[:trusted_cert] do |io|
io.write certificate.to_pem
end
end
diff --git a/lib/rubygems/security_option.rb b/lib/rubygems/security_option.rb
deleted file mode 100644
index 4e3473acb4..0000000000
--- a/lib/rubygems/security_option.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-#--
-# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
-# All rights reserved.
-# See LICENSE.txt for permissions.
-#++
-
-require 'rubygems'
-
-# forward-declare
-
-module Gem::Security # :nodoc:
- class Policy # :nodoc:
- end
-end
-
-##
-# Mixin methods for security option for Gem::Commands
-
-module Gem::SecurityOption
- def add_security_option
- # TODO: use @parser.accept
- OptionParser.accept Gem::Security::Policy do |value|
- require 'rubygems/security'
-
- raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless
- defined?(Gem::Security::HighSecurity)
-
- policy = Gem::Security::Policies[value]
- unless policy
- valid = Gem::Security::Policies.keys.sort
- raise OptionParser::InvalidArgument, "#{value} (#{valid.join ', '} are valid)"
- end
- policy
- end
-
- add_option(:"Install/Update", '-P', '--trust-policy POLICY',
- Gem::Security::Policy,
- 'Specify gem trust policy') do |value, options|
- options[:security_policy] = value
- end
- end
-end
diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb
index 62c3dfe9cf..7655be22ce 100644
--- a/lib/rubygems/server.rb
+++ b/lib/rubygems/server.rb
@@ -1,8 +1,6 @@
-# frozen_string_literal: true
require 'webrick'
require 'zlib'
require 'erb'
-require 'uri'
require 'rubygems'
require 'rubygems/rdoc'
@@ -35,7 +33,7 @@ class Gem::Server
include ERB::Util
include Gem::UserInteraction
- SEARCH = <<-ERB
+ SEARCH = <<-SEARCH
<form class="headerSearch" name="headerSearchForm" method="get" action="/rdoc">
<div id="search" style="float:right">
<label for="q">Filter/Search</label>
@@ -43,9 +41,9 @@ class Gem::Server
<button type="submit" style="display:none"></button>
</div>
</form>
- ERB
+ SEARCH
- DOC_TEMPLATE = <<-'ERB'
+ DOC_TEMPLATE = <<-'DOC_TEMPLATE'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -69,33 +67,35 @@ class Gem::Server
<h1>Summary</h1>
<p>There are <%=values["gem_count"]%> gems installed:</p>
<p>
- <%= values["specs"].map { |v| "<a href=\"##{u v["name"]}\">#{h v["name"]}</a>" }.join ', ' %>.
+ <%= values["specs"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
<h1>Gems</h1>
<dl>
<% values["specs"].each do |spec| %>
<dt>
<% if spec["first_name_entry"] then %>
- <a name="<%=h spec["name"]%>"></a>
+ <a name="<%=spec["name"]%>"></a>
<% end %>
- <b><%=h spec["name"]%> <%=h spec["version"]%></b>
+ <b><%=spec["name"]%> <%=spec["version"]%></b>
- <% if spec["ri_installed"] || spec["rdoc_installed"] then %>
+ <% if spec["ri_installed"] then %>
+ <a href="<%=spec["doc_path"]%>">[rdoc]</a>
+ <% elsif spec["rdoc_installed"] then %>
<a href="<%=spec["doc_path"]%>">[rdoc]</a>
<% else %>
<span title="rdoc not installed">[rdoc]</span>
<% end %>
<% if spec["homepage"] then %>
- <a href="<%=uri_encode spec["homepage"]%>" title="<%=h spec["homepage"]%>">[www]</a>
+ <a href="<%=spec["homepage"]%>" title="<%=spec["homepage"]%>">[www]</a>
<% else %>
<span title="no homepage available">[www]</span>
<% end %>
<% if spec["has_deps"] then %>
- depends on
- <%= spec["dependencies"].map { |v| "<a href=\"##{u v["name"]}\">#{h v["name"]}</a>" }.join ', ' %>.
+ <%= spec["dependencies"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
<% end %>
</dt>
<dd>
@@ -109,7 +109,7 @@ class Gem::Server
Executables are
<%end%>
- <%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{h v["executable"]}</span>"}.join ', ' %>.
+ <%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{v["executable"]}</span>"}.join ', ' %>.
<%end%>
<br/>
@@ -126,10 +126,10 @@ class Gem::Server
</div>
</body>
</html>
- ERB
+ DOC_TEMPLATE
# CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108
- RDOC_CSS = <<-CSS
+ RDOC_CSS = <<-RDOC_CSS
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 90%;
@@ -337,9 +337,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
.ruby-regexp { color: #ffa07a; background: transparent; }
.ruby-value { color: #7fffd4; background: transparent; }
- CSS
+ RDOC_CSS
- RDOC_NO_DOCUMENTATION = <<-'ERB'
+ RDOC_NO_DOCUMENTATION = <<-'NO_DOC'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -371,9 +371,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
</div>
</body>
</html>
- ERB
+ NO_DOC
- RDOC_SEARCH_TEMPLATE = <<-'ERB'
+ RDOC_SEARCH_TEMPLATE = <<-'RDOC_SEARCH'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -400,10 +400,10 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
<% doc_items.each do |doc_item| %>
<dt>
<b><%=doc_item[:name]%></b>
- <a href="<%=u doc_item[:url]%>">[rdoc]</a>
+ <a href="<%=doc_item[:url]%>">[rdoc]</a>
</dt>
<dd>
- <%=h doc_item[:summary]%>
+ <%=doc_item[:summary]%>
<br/>
<br/>
</dd>
@@ -422,7 +422,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
</div>
</body>
</html>
- ERB
+ RDOC_SEARCH
def self.run(options)
new(options[:gemdir], options[:port], options[:daemon],
@@ -456,17 +456,11 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end.max
end
- def uri_encode(str)
- str.gsub(URI::UNSAFE) do |match|
- match.each_byte.map { |c| sprintf('%%%02X', c.ord) }.join
- end
- end
-
def doc_root gem_name
if have_rdoc_4_plus? then
- "/doc_root/#{u gem_name}/"
+ "/doc_root/#{gem_name}/"
else
- "/doc_root/#{u gem_name}/rdoc/index.html"
+ "/doc_root/#{gem_name}/rdoc/index.html"
end
end
@@ -573,11 +567,19 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
add_date res
case req.request_uri.path
- when %r|^/quick/(Marshal.#{Regexp.escape Gem.marshal_version}/)?(.*?)\.gemspec\.rz$| then
- marshal_format, full_name = $1, $2
- specs = Gem::Specification.find_all_by_full_name(full_name)
+ when %r|^/quick/(Marshal.#{Regexp.escape Gem.marshal_version}/)?(.*?)-([0-9.]+[^-]*?)(-.*?)?\.gemspec\.rz$| then
+ marshal_format, name, version, platform = $1, $2, $3, $4
+ specs = Gem::Specification.find_all_by_name name, version
+
+ selector = [name, version, platform].map(&:inspect).join ' '
- selector = full_name.inspect
+ platform = if platform then
+ Gem::Platform.new platform.sub(/^-/, '')
+ else
+ Gem::Platform::RUBY
+ end
+
+ specs = specs.select { |s| s.platform == platform }
if specs.empty? then
res.status = 404
@@ -623,18 +625,6 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
executables = nil if executables.empty?
executables.last["is_last"] = true if executables
- # Pre-process spec homepage for safety reasons
- begin
- homepage_uri = URI.parse(spec.homepage)
- if [URI::HTTP, URI::HTTPS].member? homepage_uri.class
- homepage_uri = spec.homepage
- else
- homepage_uri = "."
- end
- rescue URI::InvalidURIError
- homepage_uri = "."
- end
-
specs << {
"authors" => spec.authors.sort.join(", "),
"date" => spec.date.to_s,
@@ -644,7 +634,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
"only_one_executable" => (executables && executables.size == 1),
"full_name" => spec.full_name,
"has_deps" => !deps.empty?,
- "homepage" => homepage_uri,
+ "homepage" => spec.homepage,
"name" => spec.name,
"rdoc_installed" => Gem::RDoc.new(spec).rdoc_installed?,
"ri_installed" => Gem::RDoc.new(spec).ri_installed?,
@@ -661,7 +651,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
"only_one_executable" => true,
"full_name" => "rubygems-#{Gem::VERSION}",
"has_deps" => false,
- "homepage" => "http://guides.rubygems.org/",
+ "homepage" => "http://docs.rubygems.org/",
"name" => 'rubygems',
"ri_installed" => true,
"summary" => "RubyGems itself",
diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb
index b28b850660..4858ffb5ba 100644
--- a/lib/rubygems/source.rb
+++ b/lib/rubygems/source.rb
@@ -1,6 +1,5 @@
-# frozen_string_literal: true
-autoload :FileUtils, 'fileutils'
-autoload :URI, 'uri'
+require 'uri'
+require 'fileutils'
##
# A Source knows how to list and fetch gems from a RubyGems marshal index.
@@ -27,12 +26,8 @@ class Gem::Source
# Creates a new Source which will use the index located at +uri+.
def initialize(uri)
- begin
- unless uri.kind_of? URI
- uri = URI.parse(uri.to_s)
- end
- rescue URI::InvalidURIError
- raise if Gem::Source == self.class
+ unless uri.kind_of? URI
+ uri = URI.parse(uri.to_s)
end
@uri = uri
@@ -67,11 +62,7 @@ class Gem::Source
return -1 if !other.uri
- # Returning 1 here ensures that when sorting a list of sources, the
- # original ordering of sources supplied by the user is preserved.
- return 1 unless @uri.to_s == other.uri.to_s
-
- 0
+ @uri.to_s <=> other.uri.to_s
else
nil
end
@@ -160,7 +151,7 @@ class Gem::Source
if update_cache? then
FileUtils.mkdir_p cache_dir
- File.open local_spec, 'wb' do |io|
+ open local_spec, 'wb' do |io|
io.write spec
end
end
@@ -236,3 +227,4 @@ require 'rubygems/source/specific_file'
require 'rubygems/source/local'
require 'rubygems/source/lock'
require 'rubygems/source/vendor'
+
diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb
index 23f8928a4e..fb9cbce2fb 100644
--- a/lib/rubygems/source/git.rb
+++ b/lib/rubygems/source/git.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: true
+require 'digest'
require 'rubygems/util'
##
@@ -178,17 +178,9 @@ class Gem::Source::Git < Gem::Source
# Converts the git reference for the repository into a commit hash.
def rev_parse # :nodoc:
- hash = nil
-
Dir.chdir repo_cache_dir do
- hash = Gem::Util.popen(@git, 'rev-parse', @reference).strip
+ Gem::Util.popen(@git, 'rev-parse', @reference).strip
end
-
- raise Gem::Exception,
- "unable to find reference #{@reference} in #{@repository}" unless
- $?.success?
-
- hash
end
##
@@ -225,8 +217,6 @@ class Gem::Source::Git < Gem::Source
# A hash for the git gem based on the git repository URI.
def uri_hash # :nodoc:
- require 'digest' # required here to avoid deadlocking in Gem.activate_bin_path (because digest is a gem on 2.5+)
-
normalized =
if @repository =~ %r%^\w+://(\w+@)?% then
uri = URI(@repository).normalize.to_s.sub %r%/$%,''
diff --git a/lib/rubygems/source/installed.rb b/lib/rubygems/source/installed.rb
index 300491e467..bd05c75af1 100644
--- a/lib/rubygems/source/installed.rb
+++ b/lib/rubygems/source/installed.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Represents an installed gem. This is used for dependency resolution.
diff --git a/lib/rubygems/source/local.rb b/lib/rubygems/source/local.rb
index 5ab7a467b5..8057921163 100644
--- a/lib/rubygems/source/local.rb
+++ b/lib/rubygems/source/local.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The local source finds gems in the current directory for fulfilling
# dependencies.
@@ -9,7 +8,6 @@ class Gem::Source::Local < Gem::Source
@specs = nil
@api_uri = nil
@uri = nil
- @load_specs_names = {}
end
##
@@ -35,47 +33,45 @@ class Gem::Source::Local < Gem::Source
end
def load_specs type # :nodoc:
- @load_specs_names[type] ||= begin
- names = []
-
- @specs = {}
-
- Dir["*.gem"].each do |file|
- begin
- pkg = Gem::Package.new(file)
- rescue SystemCallError, Gem::Package::FormatError
- # ignore
- else
- tup = pkg.spec.name_tuple
- @specs[tup] = [File.expand_path(file), pkg]
-
- case type
- when :released
- unless pkg.spec.version.prerelease?
- names << pkg.spec.name_tuple
- end
- when :prerelease
- if pkg.spec.version.prerelease?
- names << pkg.spec.name_tuple
- end
- when :latest
- tup = pkg.spec.name_tuple
-
- cur = names.find { |x| x.name == tup.name }
- if !cur
- names << tup
- elsif cur.version < tup.version
- names.delete cur
- names << tup
- end
- else
+ names = []
+
+ @specs = {}
+
+ Dir["*.gem"].each do |file|
+ begin
+ pkg = Gem::Package.new(file)
+ rescue SystemCallError, Gem::Package::FormatError
+ # ignore
+ else
+ tup = pkg.spec.name_tuple
+ @specs[tup] = [File.expand_path(file), pkg]
+
+ case type
+ when :released
+ unless pkg.spec.version.prerelease?
+ names << pkg.spec.name_tuple
+ end
+ when :prerelease
+ if pkg.spec.version.prerelease?
names << pkg.spec.name_tuple
end
+ when :latest
+ tup = pkg.spec.name_tuple
+
+ cur = names.find { |x| x.name == tup.name }
+ if !cur
+ names << tup
+ elsif cur.version < tup.version
+ names.delete cur
+ names << tup
+ end
+ else
+ names << pkg.spec.name_tuple
end
end
-
- names
end
+
+ names
end
def find_gem gem_name, version = Gem::Requirement.default, # :nodoc:
@@ -91,7 +87,7 @@ class Gem::Source::Local < Gem::Source
if version.satisfied_by?(s.version)
if prerelease
found << s
- elsif !s.version.prerelease? || version.prerelease?
+ elsif !s.version.prerelease?
found << s
end
end
diff --git a/lib/rubygems/source/lock.rb b/lib/rubygems/source/lock.rb
index 59717be2c0..2ba7702bda 100644
--- a/lib/rubygems/source/lock.rb
+++ b/lib/rubygems/source/lock.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A Lock source wraps an installed gem's source and sorts before other sources
# during dependency resolution. This allows RubyGems to prefer gems from
@@ -34,10 +33,6 @@ class Gem::Source::Lock < Gem::Source
0 == (self <=> other)
end
- def hash # :nodoc:
- @wrapped.hash ^ 3
- end
-
##
# Delegates to the wrapped source's fetch_spec method.
@@ -50,3 +45,4 @@ class Gem::Source::Lock < Gem::Source
end
end
+
diff --git a/lib/rubygems/source/specific_file.rb b/lib/rubygems/source/specific_file.rb
index 459c803e1a..250a839203 100644
--- a/lib/rubygems/source/specific_file.rb
+++ b/lib/rubygems/source/specific_file.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# A source representing a single .gem file. This is used for installation of
# local gems.
diff --git a/lib/rubygems/source/vendor.rb b/lib/rubygems/source/vendor.rb
index e1b3698607..2d936231c1 100644
--- a/lib/rubygems/source/vendor.rb
+++ b/lib/rubygems/source/vendor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# This represents a vendored source that is similar to an installed gem.
diff --git a/lib/rubygems/source_list.rb b/lib/rubygems/source_list.rb
index 66ce4d57ed..e01f11cc1e 100644
--- a/lib/rubygems/source_list.rb
+++ b/lib/rubygems/source_list.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/source'
##
@@ -10,7 +9,7 @@ require 'rubygems/source'
# Or by adding them:
#
# sources = Gem::SourceList.new
-# sources << 'https://rubygems.example'
+# sources.add 'https://rubygems.example'
#
# The most common way to get a SourceList is Gem.sources.
@@ -59,7 +58,7 @@ class Gem::SourceList
Gem::Source.new(URI.parse(obj))
end
- @sources << src unless @sources.include?(src)
+ @sources << src
src
end
diff --git a/lib/rubygems/source_local.rb b/lib/rubygems/source_local.rb
index 9869158e7d..0808f4694a 100644
--- a/lib/rubygems/source_local.rb
+++ b/lib/rubygems/source_local.rb
@@ -1,8 +1,5 @@
-# frozen_string_literal: true
require 'rubygems/source'
require 'rubygems/source_local'
-unless Gem::Deprecate.skip
- Kernel.warn "#{Gem.location_of_caller(3).join(':')}: Warning: Requiring rubygems/source_local is deprecated; please use rubygems/source/local instead."
-end
+# TODO warn upon require, this file is deprecated.
diff --git a/lib/rubygems/source_specific_file.rb b/lib/rubygems/source_specific_file.rb
index b676b1d3a2..f785c2667c 100644
--- a/lib/rubygems/source_specific_file.rb
+++ b/lib/rubygems/source_specific_file.rb
@@ -1,6 +1,4 @@
-# frozen_string_literal: true
require 'rubygems/source/specific_file'
-unless Gem::Deprecate.skip
- Kernel.warn "#{Gem.location_of_caller(3).join(':')}: Warning: Requiring rubygems/source_specific_file is deprecated; please use rubygems/source/specific_file instead."
-end
+# TODO warn upon require, this file is deprecated.
+
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
index 919276e113..4967c4a40b 100644
--- a/lib/rubygems/spec_fetcher.rb
+++ b/lib/rubygems/spec_fetcher.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems/remote_fetcher'
require 'rubygems/user_interaction'
require 'rubygems/errors'
@@ -184,10 +183,10 @@ class Gem::SpecFetcher
# Suggests gems based on the supplied +gem_name+. Returns an array of
# alternative gem names.
- def suggest_gems_from_name(gem_name, type = :latest)
+ def suggest_gems_from_name gem_name
gem_name = gem_name.downcase.tr('_-', '')
max = gem_name.size / 2
- names = available_specs(type).first.values.flatten(1)
+ names = available_specs(:latest).first.values.flatten(1)
matches = names.map { |n|
next unless n.match_platform?
@@ -201,11 +200,7 @@ class Gem::SpecFetcher
[n.name, distance]
}.compact
- matches = if matches.empty? && type != :prerelease
- suggest_gems_from_name gem_name, :prerelease
- else
- matches.uniq.sort_by { |name, dist| dist }
- end
+ matches = matches.uniq.sort_by { |name, dist| dist }
matches.first(5).map { |name, dist| name }
end
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 2560324b7a..975a2e3f9a 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -13,9 +12,7 @@ require 'rubygems/platform'
require 'rubygems/deprecate'
require 'rubygems/basic_specification'
require 'rubygems/stub_specification'
-require 'rubygems/util/list'
-require 'stringio'
-require 'uri'
+require 'rubygems/util/stringio'
##
# The Specification class contains the information for a Gem. Typically
@@ -31,7 +28,6 @@ require 'uri'
# s.email = 'rubycoder@example.com'
# s.files = ["lib/example.rb"]
# s.homepage = 'https://rubygems.org/gems/example'
-# s.metadata = { "source_code_uri" => "https://github.com/example/example" }
# end
#
# Starting in RubyGems 2.0, a Specification can hold arbitrary
@@ -110,8 +106,6 @@ class Gem::Specification < Gem::BasicSpecification
private_constant :LOAD_CACHE if defined? private_constant
- VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
-
# :startdoc:
##
@@ -159,20 +153,16 @@ class Gem::Specification < Gem::BasicSpecification
:summary => nil,
:test_files => [],
:version => nil,
- }.freeze
+ }
- INITIALIZE_CODE_FOR_DEFAULTS = { } # :nodoc:
+ Dupable = { } # :nodoc:
@@default_value.each do |k,v|
- INITIALIZE_CODE_FOR_DEFAULTS[k] = case v
- when [], {}, true, false, nil, Numeric, Symbol
- v.inspect
- when String
- v.dump
- when Numeric
- "default_value(:#{k})"
+ case v
+ when Time, Numeric, Symbol, true, false, nil
+ Dupable[k] = false
else
- "default_value(:#{k}).dup"
+ Dupable[k] = true
end
end
@@ -182,13 +172,6 @@ class Gem::Specification < Gem::BasicSpecification
@@default_value[k].nil?
}
- @@stubs_by_name = {}
-
- # Sentinel object to represent "not found" stubs
- NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:
- @@spec_with_requirable_file = {}
- @@active_stub_with_requirable_file = {}
-
######################################################################
# :section: Required gemspec attributes
@@ -215,51 +198,43 @@ class Gem::Specification < Gem::BasicSpecification
attr_reader :version
##
- # A short summary of this gem's description. Displayed in `gem list -d`.
+ # Paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
+ # activated.
#
- # The #description should be more detailed than the summary.
+ # See also #require_paths
+ #
+ # If you have an extension you do not need to add <code>"ext"</code> to the
+ # require path, the extension build process will copy the extension files
+ # into "lib" for you.
+ #
+ # The default value is <code>"lib"</code>
#
# Usage:
#
- # spec.summary = "This is a small summary of my gem"
+ # # If all library files are in the root directory...
+ # spec.require_paths = ['.']
- attr_reader :summary
+ def require_paths=(val)
+ @require_paths = Array(val)
+ end
##
- # Files included in this gem. You cannot append to this accessor, you must
- # assign to it.
+ # The version of RubyGems used to create this gem.
#
- # Only add files you can require to this list, not directories, etc.
+ # Do not set this, it is set automatically when the gem is packaged.
+
+ attr_accessor :rubygems_version
+
+ ##
+ # A short summary of this gem's description. Displayed in `gem list -d`.
#
- # Directories are automatically stripped from this list when building a gem,
- # other non-files cause an error.
+ # The #description should be more detailed than the summary.
#
# Usage:
#
- # require 'rake'
- # spec.files = FileList['lib/**/*.rb',
- # 'bin/*',
- # '[A-Z]*',
- # 'test/**/*'].to_a
- #
- # # or without Rake...
- # spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
- # spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
- # spec.files.reject! { |fn| fn.include? "CVS" }
-
- def files
- # DO NOT CHANGE TO ||= ! This is not a normal accessor. (yes, it sucks)
- # DOC: Why isn't it normal? Why does it suck? How can we fix this?
- @files = [@files,
- @test_files,
- add_bindir(@executables),
- @extra_rdoc_files,
- @extensions,
- ].flatten.compact.uniq.sort
- end
+ # spec.summary = "This is a small summary of my gem"
- ######################################################################
- # :section: Recommended gemspec attributes
+ attr_reader :summary
##
# Singular writer for #authors
@@ -284,119 +259,94 @@ class Gem::Specification < Gem::BasicSpecification
end
##
- # A long description of this gem
+ # The platform this gem runs on.
#
- # The description should be more detailed than the summary but not
- # excessively long. A few paragraphs is a recommended length with no
- # examples or formatting.
+ # This is usually Gem::Platform::RUBY or Gem::Platform::CURRENT.
#
- # Usage:
+ # Most gems contain pure Ruby code; they should simply leave the default
+ # value in place. Some gems contain C (or other) code to be compiled into a
+ # Ruby "extension". The should leave the default value in place unless
+ # their code will only compile on a certain type of system. Some gems
+ # consist of pre-compiled code ("binary gems"). It's especially important
+ # that they set the platform attribute appropriately. A shortcut is to set
+ # the platform to Gem::Platform::CURRENT, which will cause the gem builder
+ # to set the platform to the appropriate value for the system on which the
+ # build is being performed.
#
- # spec.description = <<-EOF
- # Rake is a Make-like program implemented in Ruby. Tasks and
- # dependencies are specified in standard Ruby syntax.
- # EOF
-
- attr_reader :description
-
- ##
- # A contact email address (or addresses) for this gem
+ # If this attribute is set to a non-default value, it will be included in
+ # the filename of the gem when it is built such as:
+ # nokogiri-1.6.0-x86-mingw32.gem
#
# Usage:
#
- # spec.email = 'john.jones@example.com'
- # spec.email = ['jack@example.com', 'jill@example.com']
+ # spec.platform = Gem::Platform.local
- attr_accessor :email
+ def platform= platform
+ if @original_platform.nil? or
+ @original_platform == Gem::Platform::RUBY then
+ @original_platform = platform
+ end
- ##
- # The URL of this gem's home page
- #
- # Usage:
- #
- # spec.homepage = 'https://github.com/ruby/rake'
+ case platform
+ when Gem::Platform::CURRENT then
+ @new_platform = Gem::Platform.local
+ @original_platform = @new_platform.to_s
- attr_accessor :homepage
+ when Gem::Platform then
+ @new_platform = platform
- ##
- # The license for this gem.
- #
- # The license must be no more than 64 characters.
- #
- # This should just be the name of your license. The full text of the license
- # should be inside of the gem (at the top level) when you build it.
- #
- # The simplest way, is to specify the standard SPDX ID
- # https://spdx.org/licenses/ for the license.
- # Ideally you should pick one that is OSI (Open Source Initiative)
- # http://opensource.org/licenses/alphabetical approved.
- #
- # The most commonly used OSI approved licenses are MIT and Apache-2.0.
- # GitHub also provides a license picker at http://choosealicense.com/.
- #
- # You should specify a license for your gem so that people know how they are
- # permitted to use it, and any restrictions you're placing on it. Not
- # specifying a license means all rights are reserved; others have no rights
- # to use the code for any purpose.
- #
- # You can set multiple licenses with #licenses=
- #
- # Usage:
- # spec.license = 'MIT'
+ # legacy constants
+ when nil, Gem::Platform::RUBY then
+ @new_platform = Gem::Platform::RUBY
+ when 'mswin32' then # was Gem::Platform::WIN32
+ @new_platform = Gem::Platform.new 'x86-mswin32'
+ when 'i586-linux' then # was Gem::Platform::LINUX_586
+ @new_platform = Gem::Platform.new 'x86-linux'
+ when 'powerpc-darwin' then # was Gem::Platform::DARWIN
+ @new_platform = Gem::Platform.new 'ppc-darwin'
+ else
+ @new_platform = Gem::Platform.new platform
+ end
- def license=o
- self.licenses = [o]
- end
+ @platform = @new_platform.to_s
- ##
- # The license(s) for the library.
- #
- # Each license must be a short name, no more than 64 characters.
- #
- # This should just be the name of your license. The full
- # text of the license should be inside of the gem when you build it.
- #
- # See #license= for more discussion
- #
- # Usage:
- # spec.licenses = ['MIT', 'GPL-2.0']
+ invalidate_memoized_attributes
- def licenses= licenses
- @licenses = Array licenses
+ @new_platform
end
##
- # The metadata holds extra data for this gem that may be useful to other
- # consumers and is settable by gem authors without requiring an update to
- # the rubygems software.
- #
- # Metadata items have the following restrictions:
+ # Files included in this gem. You cannot append to this accessor, you must
+ # assign to it.
#
- # * The metadata must be a Hash object
- # * All keys and values must be Strings
- # * Keys can be a maximum of 128 bytes and values can be a maximum of 1024
- # bytes
- # * All strings must be UTF-8, no binary data is allowed
+ # Only add files you can require to this list, not directories, etc.
#
- # You can use metadata to specify links to your gem's homepage, codebase,
- # documentation, wiki, mailing list, issue tracker and changelog.
+ # Directories are automatically stripped from this list when building a gem,
+ # other non-files cause an error.
#
- # s.metadata = {
- # "bug_tracker_uri" => "https://example.com/user/bestgemever/issues",
- # "changelog_uri" => "https://example.com/user/bestgemever/CHANGELOG.md",
- # "documentation_uri" => "https://www.example.info/gems/bestgemever/0.0.1",
- # "homepage_uri" => "https://bestgemever.example.io",
- # "mailing_list_uri" => "https://groups.example.com/bestgemever",
- # "source_code_uri" => "https://example.com/user/bestgemever",
- # "wiki_uri" => "https://example.com/user/bestgemever/wiki"
- # }
+ # Usage:
#
- # These links will be used on your gem's page on rubygems.org and must pass
- # validation against following regex.
+ # require 'rake'
+ # spec.files = FileList['lib/**/*.rb',
+ # 'bin/*',
+ # '[A-Z]*',
+ # 'test/**/*'].to_a
#
- # %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}
+ # # or without Rake...
+ # spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
+ # spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
+ # spec.files.reject! { |fn| fn.include? "CVS" }
- attr_accessor :metadata
+ def files
+ # DO NOT CHANGE TO ||= ! This is not a normal accessor. (yes, it sucks)
+ # DOC: Why isn't it normal? Why does it suck? How can we fix this?
+ @files = [@files,
+ @test_files,
+ add_bindir(@executables),
+ @extra_rdoc_files,
+ @extensions,
+ ].flatten.uniq.compact.sort
+ end
######################################################################
# :section: Optional gemspec attributes
@@ -417,91 +367,48 @@ class Gem::Specification < Gem::BasicSpecification
attr_accessor :cert_chain
##
- # A message that gets displayed after the gem is installed.
+ # A long description of this gem
+ #
+ # The description should be more detailed than the summary but not
+ # excessively long. A few paragraphs is a recommended length with no
+ # examples or formatting.
#
# Usage:
#
- # spec.post_install_message = "Thanks for installing!"
+ # spec.description = <<-EOF
+ # Rake is a Make-like program implemented in Ruby. Tasks and
+ # dependencies are specified in standard Ruby syntax.
+ # EOF
- attr_accessor :post_install_message
+ attr_reader :description
##
- # The platform this gem runs on.
- #
- # This is usually Gem::Platform::RUBY or Gem::Platform::CURRENT.
- #
- # Most gems contain pure Ruby code; they should simply leave the default
- # value in place. Some gems contain C (or other) code to be compiled into a
- # Ruby "extension". The gem should leave the default value in place unless
- # the code will only compile on a certain type of system. Some gems consist
- # of pre-compiled code ("binary gems"). It's especially important that they
- # set the platform attribute appropriately. A shortcut is to set the
- # platform to Gem::Platform::CURRENT, which will cause the gem builder to set
- # the platform to the appropriate value for the system on which the build is
- # being performed.
- #
- # If this attribute is set to a non-default value, it will be included in
- # the filename of the gem when it is built such as:
- # nokogiri-1.6.0-x86-mingw32.gem
+ # A contact email address (or addresses) for this gem
#
# Usage:
#
- # spec.platform = Gem::Platform.local
-
- def platform= platform
- if @original_platform.nil? or
- @original_platform == Gem::Platform::RUBY then
- @original_platform = platform
- end
-
- case platform
- when Gem::Platform::CURRENT then
- @new_platform = Gem::Platform.local
- @original_platform = @new_platform.to_s
-
- when Gem::Platform then
- @new_platform = platform
-
- # legacy constants
- when nil, Gem::Platform::RUBY then
- @new_platform = Gem::Platform::RUBY
- when 'mswin32' then # was Gem::Platform::WIN32
- @new_platform = Gem::Platform.new 'x86-mswin32'
- when 'i586-linux' then # was Gem::Platform::LINUX_586
- @new_platform = Gem::Platform.new 'x86-linux'
- when 'powerpc-darwin' then # was Gem::Platform::DARWIN
- @new_platform = Gem::Platform.new 'ppc-darwin'
- else
- @new_platform = Gem::Platform.new platform
- end
+ # spec.email = 'john.jones@example.com'
+ # spec.email = ['jack@example.com', 'jill@example.com']
- @platform = @new_platform.to_s
+ attr_accessor :email
- invalidate_memoized_attributes
+ ##
+ # The URL of this gem's home page
+ #
+ # Usage:
+ #
+ # spec.homepage = 'http://rake.rubyforge.org'
- @new_platform
- end
+ attr_accessor :homepage
##
- # Paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
- # activated.
- #--
- # See also #require_paths
- #++
- # If you have an extension you do not need to add <code>"ext"</code> to the
- # require path, the extension build process will copy the extension files
- # into "lib" for you.
- #
- # The default value is <code>"lib"</code>
+ # A message that gets displayed after the gem is installed.
#
# Usage:
#
- # # If all library files are in the root directory...
- # spec.require_paths = ['.']
+ # spec.post_install_message = "Thanks for installing!"
- def require_paths=(val)
- @require_paths = Array(val)
- end
+ attr_accessor :post_install_message
##
# The version of Ruby required by this gem
@@ -514,16 +421,30 @@ class Gem::Specification < Gem::BasicSpecification
attr_reader :required_rubygems_version
##
- # The version of RubyGems used to create this gem.
- #
- # Do not set this, it is set automatically when the gem is packaged.
+ # The key used to sign this gem. See Gem::Security for details.
- attr_accessor :rubygems_version
+ attr_accessor :signing_key
##
- # The key used to sign this gem. See Gem::Security for details.
+ # :attr_accessor: metadata
+ #
+ # The metadata holds extra data for this gem that may be useful to other
+ # consumers and is settable by gem authors without requiring an update to
+ # the rubygems software.
+ #
+ # Metadata items have the following restrictions:
+ #
+ # * The metadata must be a Hash object
+ # * All keys and values must be Strings
+ # * Keys can be a maximum of 128 bytes and values can be a maximum of 1024
+ # bytes
+ # * All strings must be UTF-8, no binary data is allowed
+ #
+ # To add metadata for the location of a issue tracker:
+ #
+ # s.metadata = { "issue_tracker" => "https://example/issues" }
- attr_accessor :signing_key
+ attr_accessor :metadata
##
# Adds a development dependency named +gem+ with +requirements+ to this
@@ -537,7 +458,7 @@ class Gem::Specification < Gem::BasicSpecification
# activated when a gem is required.
def add_development_dependency(gem, *requirements)
- add_dependency_with_type(gem, :development, requirements)
+ add_dependency_with_type(gem, :development, *requirements)
end
##
@@ -548,7 +469,7 @@ class Gem::Specification < Gem::BasicSpecification
# spec.add_runtime_dependency 'example', '~> 1.1', '>= 1.1.4'
def add_runtime_dependency(gem, *requirements)
- add_dependency_with_type(gem, :runtime, requirements)
+ add_dependency_with_type(gem, :runtime, *requirements)
end
##
@@ -621,6 +542,56 @@ class Gem::Specification < Gem::BasicSpecification
end
##
+ # :category: Recommended gemspec attributes
+ #
+ # The license for this gem.
+ #
+ # The license must be no more than 64 characters.
+ #
+ # This should just be the name of your license. The full text of the license
+ # should be inside of the gem (at the top level) when you build it.
+ #
+ # The simplest way, is to specify the standard SPDX ID
+ # https://spdx.org/licenses/ for the license.
+ # Ideally you should pick one that is OSI (Open Source Initiative)
+ # http://opensource.org/licenses/alphabetical approved.
+ #
+ # The most commonly used OSI approved licenses are BSD-3-Clause and MIT.
+ # GitHub also provides a license picker at http://choosealicense.com/.
+ #
+ # You should specify a license for your gem so that people know how they are
+ # permitted to use it, and any restrictions you're placing on it. Not
+ # specifying a license means all rights are reserved; others have no rights
+ # to use the code for any purpose.
+ #
+ # You can set multiple licenses with #licenses=
+ #
+ # Usage:
+ # spec.license = 'MIT'
+
+ def license=o
+ self.licenses = [o]
+ end
+
+ ##
+ # :category: Recommended gemspec attributes
+ # The license(s) for the library.
+ #
+ # Each license must be a short name, no more than 64 characters.
+ #
+ # This should just be the name of your license. The full
+ # text of the license should be inside of the gem when you build it.
+ #
+ # See #license= for more discussion
+ #
+ # Usage:
+ # spec.licenses = ['MIT', 'GPL-2']
+
+ def licenses= licenses
+ @licenses = Array licenses
+ end
+
+ ##
# Specifies the rdoc options to be used when generating API documentation.
#
# Usage:
@@ -641,10 +612,6 @@ class Gem::Specification < Gem::BasicSpecification
# ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
# #<Gem::Version "2.0.0.247">
#
- # Because patch-level is taken into account, be very careful specifying using
- # `<=`: `<= 2.2.2` will not match any patch-level of 2.2.2 after the `p0`
- # release. It is much safer to specify `< 2.2.3` instead
- #
# Usage:
#
# # This gem will work with 1.8.6 or greater...
@@ -652,9 +619,6 @@ class Gem::Specification < Gem::BasicSpecification
#
# # Only with ruby 2.0.x
# spec.required_ruby_version = '~> 2.0'
- #
- # # Only with ruby between 2.2.0 and 2.2.2
- # spec.required_ruby_version = ['>= 2.2.0', '< 2.2.3']
def required_ruby_version= req
@required_ruby_version = Gem::Requirement.create req
@@ -739,15 +703,14 @@ class Gem::Specification < Gem::BasicSpecification
def self._all # :nodoc:
unless defined?(@@all) && @@all then
@@all = stubs.map(&:to_spec)
- if @@all.any?(&:nil?) # TODO: remove once we're happy
- raise "pid: #{$$} nil spec! included in #{stubs.inspect}"
- end
# After a reset, make sure already loaded specs
# are still marked as activated.
specs = {}
Gem.loaded_specs.each_value{|s| specs[s] = true}
@@all.each{|s| s.activated = true if specs[s]}
+
+ _resort!(@@all)
end
@@all
end
@@ -764,75 +727,12 @@ class Gem::Specification < Gem::BasicSpecification
end
end
- def self.gemspec_stubs_in dir, pattern
- Dir[File.join(dir, pattern)].map { |path| yield path }.select(&:valid?)
- end
- private_class_method :gemspec_stubs_in
-
- def self.default_stubs pattern
- base_dir = Gem.default_dir
- gems_dir = File.join base_dir, "gems"
- gemspec_stubs_in(default_specifications_dir, pattern) do |path|
- Gem::StubSpecification.default_gemspec_stub(path, base_dir, gems_dir)
- end
- end
- private_class_method :default_stubs
-
- def self.installed_stubs dirs, pattern
- map_stubs(dirs, pattern) do |path, base_dir, gems_dir|
- Gem::StubSpecification.gemspec_stub(path, base_dir, gems_dir)
- end
- end
- private_class_method :installed_stubs
-
- if [].respond_to? :flat_map
- def self.map_stubs(dirs, pattern) # :nodoc:
- dirs.flat_map { |dir|
- base_dir = File.dirname dir
- gems_dir = File.join base_dir, "gems"
- gemspec_stubs_in(dir, pattern) { |path| yield path, base_dir, gems_dir }
- }
- end
- else # FIXME: remove when 1.8 is dropped
- def self.map_stubs(dirs, pattern) # :nodoc:
- dirs.map { |dir|
- base_dir = File.dirname dir
- gems_dir = File.join base_dir, "gems"
- gemspec_stubs_in(dir, pattern) { |path| yield path, base_dir, gems_dir }
- }.flatten 1
- end
- end
- private_class_method :map_stubs
-
- uniq_takes_a_block = false
- [1,2].uniq { uniq_takes_a_block = true }
-
- if uniq_takes_a_block
- def self.uniq_by(list, &block) # :nodoc:
- list.uniq(&block)
- end
- else # FIXME: remove when 1.8 is dropped
- def self.uniq_by(list) # :nodoc:
- values = {}
- list.each { |item|
- value = yield item
- values[value] ||= item
- }
- values.values
- end
- end
- private_class_method :uniq_by
-
- if [].respond_to? :sort_by!
- def self.sort_by! list, &block
- list.sort_by!(&block)
- end
- else # FIXME: remove when 1.8 is dropped
- def self.sort_by! list, &block
- list.replace list.sort_by(&block)
+ def self.each_stub(dirs) # :nodoc:
+ each_gemspec(dirs) do |path|
+ stub = Gem::StubSpecification.new(path)
+ yield stub if stub.valid?
end
end
- private_class_method :sort_by!
def self.each_spec(dirs) # :nodoc:
each_gemspec(dirs) do |path|
@@ -846,35 +746,17 @@ class Gem::Specification < Gem::BasicSpecification
def self.stubs
@@stubs ||= begin
- pattern = "*.gemspec"
- stubs = default_stubs(pattern).concat installed_stubs(dirs, pattern)
- stubs = uniq_by(stubs) { |stub| stub.full_name }
+ stubs = {}
+ each_stub([default_specifications_dir] + dirs) do |stub|
+ stubs[stub.full_name] ||= stub
+ end
+ stubs = stubs.values
_resort!(stubs)
- @@stubs_by_name = stubs.group_by(&:name)
stubs
end
end
- EMPTY = [].freeze # :nodoc:
-
- ##
- # Returns a Gem::StubSpecification for installed gem named +name+
-
- def self.stubs_for name
- if @@stubs
- @@stubs_by_name[name] || []
- else
- pattern = "#{name}-*.gemspec"
- stubs = default_stubs(pattern) + installed_stubs(dirs, pattern)
- stubs = uniq_by(stubs) { |stub| stub.full_name }.group_by(&:name)
- stubs.each_value { |v| _resort!(v) }
-
- @@stubs_by_name.merge! stubs
- @@stubs_by_name[name] ||= EMPTY
- end
- end
-
def self._resort!(specs) # :nodoc:
specs.sort! { |a, b|
names = a.name <=> b.name
@@ -899,7 +781,6 @@ class Gem::Specification < Gem::BasicSpecification
# properly sorted.
def self.add_spec spec
- warn "Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
# TODO: find all extraneous adds
# puts
# p :add_spec => [spec.full_name, caller.reject { |s| s =~ /minitest/ }]
@@ -914,8 +795,6 @@ class Gem::Specification < Gem::BasicSpecification
_all << spec
stubs << spec
- (@@stubs_by_name[spec.name] ||= []) << spec
- sort_by!(@@stubs_by_name[spec.name]) { |s| s.version }
_resort!(_all)
_resort!(stubs)
end
@@ -924,18 +803,14 @@ class Gem::Specification < Gem::BasicSpecification
# Adds multiple specs to the known specifications.
def self.add_specs *specs
- warn "Gem::Specification.add_specs is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
-
raise "nil spec!" if specs.any?(&:nil?) # TODO: remove once we're happy
# TODO: this is much more efficient, but we need the extra checks for now
# _all.concat specs
# _resort!
- Gem::Deprecate.skip_during do
- specs.each do |spec| # TODO: slow
- add_spec spec
- end
+ specs.each do |spec| # TODO: slow
+ add_spec spec
end
end
@@ -962,8 +837,6 @@ class Gem::Specification < Gem::BasicSpecification
# -- wilsonb
def self.all= specs
- raise "nil spec!" if specs.any?(&:nil?) # TODO: remove once we're happy
- @@stubs_by_name = specs.group_by(&:name)
@@all = @@stubs = specs
end
@@ -1037,13 +910,6 @@ class Gem::Specification < Gem::BasicSpecification
end
##
- # Returns every spec that has the given +full_name+
-
- def self.find_all_by_full_name(full_name)
- stubs.select {|s| s.full_name == full_name }.map(&:to_spec)
- end
-
- ##
# Find the best specification matching a +name+ and +requirements+. Raises
# if the dependency doesn't resolve to a valid specification.
@@ -1059,12 +925,9 @@ class Gem::Specification < Gem::BasicSpecification
# Return the best specification that contains the file matching +path+.
def self.find_by_path path
- path = path.dup.freeze
- spec = @@spec_with_requirable_file[path] ||= (stubs.find { |s|
- next unless Gem::BundlerVersionFinder.compatible?(s)
- s.contains_requirable_file? path
- } || NOT_FOUND)
- spec.to_spec
+ self.find { |spec|
+ spec.contains_requirable_file? path
+ }
end
##
@@ -1073,20 +936,11 @@ class Gem::Specification < Gem::BasicSpecification
def self.find_inactive_by_path path
stub = stubs.find { |s|
- next if s.activated?
- next unless Gem::BundlerVersionFinder.compatible?(s)
- s.contains_requirable_file? path
+ s.contains_requirable_file? path unless s.activated?
}
stub && stub.to_spec
end
- def self.find_active_stub_by_path path
- stub = @@active_stub_with_requirable_file[path] ||= (stubs.find { |s|
- s.activated? and s.contains_requirable_file? path
- } || NOT_FOUND)
- stub.this
- end
-
##
# Return currently unresolved specs that contain the file matching +path+.
@@ -1104,14 +958,16 @@ class Gem::Specification < Gem::BasicSpecification
def self.find_in_unresolved_tree path
specs = unresolved_deps.values.map { |dep| dep.to_specs }.flatten
- specs.each do |spec|
+ specs.reverse_each do |spec|
+ trails = []
spec.traverse do |from_spec, dep, to_spec, trail|
- if to_spec.has_conflicts? || to_spec.conficts_when_loaded_with?(trail)
- :next
- else
- return trail.reverse if to_spec.contains_requirable_file? path
- end
+ next unless to_spec.conflicts.empty?
+ trails << trail if to_spec.contains_requirable_file? path
end
+
+ next if trails.empty?
+
+ return trails.map(&:reverse).sort.first.reverse
end
[]
@@ -1129,7 +985,7 @@ class Gem::Specification < Gem::BasicSpecification
Gem.load_yaml
input = normalize_yaml_input input
- spec = Gem::SafeYAML.safe_load input
+ spec = YAML.load input
if spec && spec.class == FalseClass then
raise Gem::EndOfYAMLException
@@ -1150,14 +1006,10 @@ class Gem::Specification < Gem::BasicSpecification
# +prerelease+ is true.
def self.latest_specs prerelease = false
- _latest_specs Gem::Specification._all, prerelease
- end
-
- def self._latest_specs specs, prerelease = false # :nodoc:
result = Hash.new { |h,k| h[k] = {} }
native = {}
- specs.reverse_each do |spec|
+ Gem::Specification.reverse_each do |spec|
next if spec.version.prerelease? unless prerelease
native[spec.name] = spec.version if spec.platform == Gem::Platform::RUBY
@@ -1175,13 +1027,12 @@ class Gem::Specification < Gem::BasicSpecification
def self.load file
return unless file
-
- _spec = LOAD_CACHE[file]
- return _spec if _spec
-
file = file.dup.untaint
return unless File.file?(file)
+ spec = LOAD_CACHE[file]
+ return spec if spec
+
code = if defined? Encoding
File.read file, :mode => 'r:UTF-8:-'
else
@@ -1191,15 +1042,15 @@ class Gem::Specification < Gem::BasicSpecification
code.untaint
begin
- _spec = eval code, binding, file
+ spec = eval code, binding, file
- if Gem::Specification === _spec
- _spec.loaded_from = File.expand_path file.to_s
- LOAD_CACHE[file] = _spec
- return _spec
+ if Gem::Specification === spec
+ spec.loaded_from = File.expand_path file.to_s
+ LOAD_CACHE[file] = spec
+ return spec
end
- warn "[#{file}] isn't a Gem::Specification (#{_spec.class} instead)."
+ warn "[#{file}] isn't a Gem::Specification (#{spec.class} instead)."
rescue SignalException, SystemExit
raise
rescue SyntaxError, Exception => e
@@ -1222,7 +1073,6 @@ class Gem::Specification < Gem::BasicSpecification
def self.normalize_yaml_input(input)
result = input.respond_to?(:read) ? input.read : input
result = "--- " + result unless result =~ /\A--- /
- result = result.dup
result.gsub!(/ !!null \n/, " \n")
# date: 2011-04-26 00:00:00.000000000Z
# date: 2011-04-26 00:00:00.000000000 Z
@@ -1274,11 +1124,8 @@ class Gem::Specification < Gem::BasicSpecification
# Removes +spec+ from the known specs.
def self.remove_spec spec
- warn "Gem::Specification.remove_spec is deprecated and will be removed in RubyGems 3.0" unless Gem::Deprecate.skip
_all.delete spec
stubs.delete_if { |s| s.full_name == spec.full_name }
- (@@stubs_by_name[spec.name] || []).delete_if { |s| s.full_name == spec.full_name }
- reset
end
##
@@ -1304,9 +1151,6 @@ class Gem::Specification < Gem::BasicSpecification
Gem.pre_reset_hooks.each { |hook| hook.call }
@@all = nil
@@stubs = nil
- @@stubs_by_name = {}
- @@spec_with_requirable_file = {}
- @@active_stub_with_requirable_file = {}
_clear_load_cache
unresolved = unresolved_deps
unless unresolved.empty? then
@@ -1480,50 +1324,6 @@ class Gem::Specification < Gem::BasicSpecification
end
##
- # Abbreviate the spec for downloading. Abbreviated specs are only used for
- # searching, downloading and related activities and do not need deployment
- # specific information (e.g. list of files). So we abbreviate the spec,
- # making it much smaller for quicker downloads.
-
- def abbreviate
- self.files = []
- self.test_files = []
- self.rdoc_options = []
- self.extra_rdoc_files = []
- self.cert_chain = []
- end
-
- ##
- # Sanitize the descriptive fields in the spec. Sometimes non-ASCII
- # characters will garble the site index. Non-ASCII characters will
- # be replaced by their XML entity equivalent.
-
- def sanitize
- self.summary = sanitize_string(summary)
- self.description = sanitize_string(description)
- self.post_install_message = sanitize_string(post_install_message)
- self.authors = authors.collect { |a| sanitize_string(a) }
- end
-
- ##
- # Sanitize a single string.
-
- def sanitize_string(string)
- return string unless string
-
- # HACK the #to_s is in here because RSpec has an Array of Arrays of
- # Strings for authors. Need a way to disallow bad values on gemspec
- # generation. (Probably won't happen.)
- string = string.to_s
-
- begin
- Builder::XChar.encode string
- rescue NameError, NoMethodError
- string.to_xs
- end
- end
-
- ##
# Returns an array with bindir attached to each executable in the
# +executables+ list
@@ -1544,7 +1344,7 @@ class Gem::Specification < Gem::BasicSpecification
# +requirements+. Valid types are currently <tt>:runtime</tt> and
# <tt>:development</tt>.
- def add_dependency_with_type(dependency, type, requirements)
+ def add_dependency_with_type(dependency, type, *requirements)
requirements = if requirements.empty? then
Gem::Requirement.default
else
@@ -1552,7 +1352,7 @@ class Gem::Specification < Gem::BasicSpecification
end
unless dependency.respond_to?(:name) &&
- dependency.respond_to?(:requirement)
+ dependency.respond_to?(:version_requirements)
dependency = Gem::Dependency.new(dependency.to_s, requirements, type)
end
@@ -1679,16 +1479,6 @@ class Gem::Specification < Gem::BasicSpecification
end
##
- # Used to detect if the gem is bundled in older version of Ruby, but not
- # detectable as default gem (see BasicSpecification#default_gem?).
-
- def bundled_gem_in_old_ruby?
- !default_gem? &&
- RUBY_VERSION < "2.0.0" &&
- summary == "This #{name} is bundled with Ruby"
- end
-
- ##
# Returns the full path to the cache directory containing this
# spec's cached gem.
@@ -1714,37 +1504,10 @@ class Gem::Specification < Gem::BasicSpecification
(conflicts[spec] ||= []) << dep
end
}
- env_req = Gem.env_requirement(name)
- (conflicts[self] ||= []) << env_req unless env_req.satisfied_by? version
conflicts
end
##
- # return true if there will be conflict when spec if loaded together with the list of specs.
-
- def conficts_when_loaded_with?(list_of_specs) # :nodoc:
- result = list_of_specs.any? { |spec|
- spec.dependencies.any? { |dep| dep.runtime? && (dep.name == name) && !satisfies_requirement?(dep) }
- }
- result
- end
-
- ##
- # Return true if there are possible conflicts against the currently loaded specs.
-
- def has_conflicts?
- return true unless Gem.env_requirement(name).satisfied_by?(version)
- self.dependencies.any? { |dep|
- if dep.runtime? then
- spec = Gem.loaded_specs[dep.name]
- spec and not spec.satisfies_requirement? dep
- else
- false
- end
- }
- end
-
- ##
# The date this gem was created. Lazily defaults to the current UTC date.
#
# There is no need to set this in your gem specification.
@@ -1994,22 +1757,30 @@ class Gem::Specification < Gem::BasicSpecification
spec
end
+ def find_full_gem_path # :nodoc:
+ super || File.expand_path(File.join(gems_dir, original_name))
+ end
+ private :find_full_gem_path
+
def full_name
@full_name ||= super
end
##
+ # The path to the gem.build_complete file within the extension install
+ # directory.
+
+ def gem_build_complete_path # :nodoc:
+ File.join extension_dir, 'gem.build_complete'
+ end
+
+ ##
# Work around bundler removing my methods
def gem_dir # :nodoc:
super
end
- def gems_dir
- # TODO: this logic seems terribly broken, but tests fail if just base_dir
- @gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
- end
-
##
# Deprecated and ignored, defaults to true.
#
@@ -2050,37 +1821,27 @@ class Gem::Specification < Gem::BasicSpecification
yaml_initialize coder.tag, coder.map
end
-
-
- eval <<-RB, binding, __FILE__, __LINE__ + 1
- def set_nil_attributes_to_nil
- #{@@nil_attributes.map {|key| "@#{key} = nil" }.join "; "}
- end
- private :set_nil_attributes_to_nil
-
- def set_not_nil_attributes_to_default_values
- #{@@non_nil_attributes.map {|key| "@#{key} = #{INITIALIZE_CODE_FOR_DEFAULTS[key]}" }.join ";"}
- end
- private :set_not_nil_attributes_to_default_values
- RB
-
##
# Specification constructor. Assigns the default values to the attributes
# and yields itself for further initialization. Optionally takes +name+ and
# +version+.
def initialize name = nil, version = nil
- super()
- @gems_dir = nil
- @base_dir = nil
@loaded = false
@activated = false
- @loaded_from = nil
+ self.loaded_from = nil
@original_platform = nil
@installed_by_version = nil
- set_nil_attributes_to_nil
- set_not_nil_attributes_to_default_values
+ @@nil_attributes.each do |key|
+ instance_variable_set "@#{key}", nil
+ end
+
+ @@non_nil_attributes.each do |key|
+ default = default_value(key)
+ value = Dupable[key] ? default.dup : default
+ instance_variable_set "@#{key}", value
+ end
@new_platform = Gem::Platform::RUBY
@@ -2115,15 +1876,6 @@ class Gem::Specification < Gem::BasicSpecification
end
end
- def base_dir
- return Gem.dir unless loaded_from
- @base_dir ||= if default_gem? then
- File.dirname File.dirname File.dirname loaded_from
- else
- File.dirname File.dirname loaded_from
- end
- end
-
##
# Expire memoized instance variables that can incorrectly generate, replace
# or miss files due changes in certain attributes used to compute them.
@@ -2139,11 +1891,25 @@ class Gem::Specification < Gem::BasicSpecification
if $DEBUG
super
else
- "#{super[0..-2]} #{full_name}>"
+ "#<#{self.class}:0x#{__id__.to_s(16)} #{full_name}>"
end
end
##
+ # Returns a string usable in Dir.glob to match all requirable paths
+ # for this spec.
+
+ def lib_dirs_glob
+ dirs = if self.require_paths.size > 1 then
+ "{#{self.require_paths.join(',')}}"
+ else
+ self.require_paths.first
+ end
+
+ "#{self.full_gem_path}/#{dirs}"
+ end
+
+ ##
# Files in the Gem under one of the require_paths
def lib_files
@@ -2158,7 +1924,7 @@ class Gem::Specification < Gem::BasicSpecification
# Singular accessor for #licenses
def license
- licenses.first
+ val = licenses and val.first
end
##
@@ -2170,8 +1936,9 @@ class Gem::Specification < Gem::BasicSpecification
@licenses ||= []
end
- def internal_init # :nodoc:
+ def loaded_from= path # :nodoc:
super
+
@bin_dir = nil
@cache_dir = nil
@cache_file = nil
@@ -2189,6 +1956,16 @@ class Gem::Specification < Gem::BasicSpecification
end
##
+ # Return all files in this gem that match for +glob+.
+
+ def matches_for_glob glob # TODO: rename?
+ # TODO: do we need these?? Kill it
+ glob = File.join(self.lib_dirs_glob, glob)
+
+ Dir[glob].map { |f| f.untaint } # FIX our tests are broken, run w/ SAFE=1
+ end
+
+ ##
# Warn about unknown attributes while loading a spec.
def method_missing(sym, *a, &b) # :nodoc:
@@ -2321,8 +2098,10 @@ class Gem::Specification < Gem::BasicSpecification
# Check the spec for possible conflicts and freak out if there are any.
def raise_if_conflicts # :nodoc:
- if has_conflicts? then
- raise Gem::ConflictError.new self, conflicts
+ conf = self.conflicts
+
+ unless conf.empty? then
+ raise Gem::ConflictError.new self, conf
end
end
@@ -2375,7 +2154,7 @@ class Gem::Specification < Gem::BasicSpecification
def ruby_code(obj)
case obj
- when String then obj.dump + ".freeze"
+ when String then obj.dump
when Array then '[' + obj.map { |x| ruby_code x }.join(", ") + ']'
when Hash then
seg = obj.keys.sort.map { |k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" }
@@ -2399,7 +2178,7 @@ class Gem::Specification < Gem::BasicSpecification
# List of dependencies that will automatically be activated at runtime.
def runtime_dependencies
- dependencies.select(&:runtime?)
+ dependencies.select { |d| d.type == :runtime }
end
##
@@ -2565,14 +2344,14 @@ class Gem::Specification < Gem::BasicSpecification
dependencies.each do |dep|
req = dep.requirements_list.inspect
dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
- result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
+ result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>, #{req})"
end
result << " else"
dependencies.each do |dep|
version_reqs_param = dep.requirements_list.inspect
- result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
+ result << " s.add_dependency(%q<#{dep.name}>, #{version_reqs_param})"
end
result << ' end'
@@ -2580,7 +2359,7 @@ class Gem::Specification < Gem::BasicSpecification
result << " else"
dependencies.each do |dep|
version_reqs_param = dep.requirements_list.inspect
- result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
+ result << " s.add_dependency(%q<#{dep.name}>, #{version_reqs_param})"
end
result << " end"
end
@@ -2626,7 +2405,7 @@ class Gem::Specification < Gem::BasicSpecification
builder << self
ast = builder.tree
- io = StringIO.new
+ io = Gem::StringSink.new
io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding
Psych::Visitors::Emitter.new(io).accept(ast)
@@ -2645,29 +2424,14 @@ class Gem::Specification < Gem::BasicSpecification
# Recursively walk dependencies of this spec, executing the +block+ for each
# hop.
- def traverse trail = [], visited = {}, &block
- trail.push(self)
- begin
- dependencies.each do |dep|
- next unless dep.runtime?
- dep.to_specs.each do |dep_spec|
- next if visited.has_key?(dep_spec)
- visited[dep_spec] = true
- trail.push(dep_spec)
- begin
- result = block[self, dep, dep_spec, trail]
- ensure
- trail.pop
- end
- unless result == :next
- spec_name = dep_spec.name
- dep_spec.traverse(trail, visited, &block) unless
- trail.any? { |s| s.name == spec_name }
- end
- end
+ def traverse trail = [], &block
+ trail = trail + [self]
+ runtime_dependencies.each do |dep|
+ dep.to_specs.each do |dep_spec|
+ block[self, dep, dep_spec, trail + [dep_spec]]
+ dep_spec.traverse(trail, &block) unless
+ trail.map(&:name).include? dep_spec.name
end
- ensure
- trail.pop
end
end
@@ -2684,8 +2448,8 @@ class Gem::Specification < Gem::BasicSpecification
extend Gem::UserInteraction
normalize
- nil_attributes = self.class.non_nil_attributes.find_all do |attrname|
- instance_variable_get("@#{attrname}").nil?
+ nil_attributes = self.class.non_nil_attributes.find_all do |name|
+ instance_variable_get("@#{name}").nil?
end
unless nil_attributes.empty? then
@@ -2705,15 +2469,9 @@ class Gem::Specification < Gem::BasicSpecification
end
end
- if !name.is_a?(String) then
- raise Gem::InvalidSpecificationException,
- "invalid value for attribute name: \"#{name.inspect}\" must be a string"
- elsif name !~ /[a-zA-Z]/ then
- raise Gem::InvalidSpecificationException,
- "invalid value for attribute name: #{name.dump} must include at least one letter"
- elsif name !~ VALID_NAME_PATTERN then
+ unless String === name then
raise Gem::InvalidSpecificationException,
- "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
+ "invalid value for attribute name: \"#{name.inspect}\""
end
if raw_require_paths.empty? then
@@ -2721,13 +2479,13 @@ class Gem::Specification < Gem::BasicSpecification
'specification must have at least one require_path'
end
- @files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
- @test_files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
+ @files.delete_if { |x| File.directory?(x) }
+ @test_files.delete_if { |x| File.directory?(x) }
@executables.delete_if { |x| File.directory?(File.join(@bindir, x)) }
- @extra_rdoc_files.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
- @extensions.delete_if { |x| File.directory?(x) && !File.symlink?(x) }
+ @extra_rdoc_files.delete_if { |x| File.directory?(x) }
+ @extensions.delete_if { |x| File.directory?(x) }
- non_files = files.reject { |x| File.file?(x) || File.symlink?(x) }
+ non_files = files.reject { |x| File.file?(x) }
unless not packaging or non_files.empty? then
raise Gem::InvalidSpecificationException,
@@ -2739,9 +2497,9 @@ class Gem::Specification < Gem::BasicSpecification
"#{full_name} contains itself (#{file_name}), check your files list"
end
- unless specification_version.is_a?(Integer)
+ unless specification_version.is_a?(Fixnum)
raise Gem::InvalidSpecificationException,
- 'specification_version must be an Integer (did you mean version?)'
+ 'specification_version must be a Fixnum (did you mean version?)'
end
case platform
@@ -2777,28 +2535,40 @@ class Gem::Specification < Gem::BasicSpecification
'metadata must be a hash'
end
- validate_metadata
+ metadata.keys.each do |k|
+ if !k.kind_of?(String)
+ raise Gem::InvalidSpecificationException,
+ 'metadata keys must be a String'
+ end
+
+ if k.size > 128
+ raise Gem::InvalidSpecificationException,
+ "metadata key too large (#{k.size} > 128)"
+ end
+ end
+
+ metadata.values.each do |k|
+ if !k.kind_of?(String)
+ raise Gem::InvalidSpecificationException,
+ 'metadata values must be a String'
+ end
+
+ if k.size > 1024
+ raise Gem::InvalidSpecificationException,
+ "metadata value too large (#{k.size} > 1024)"
+ end
+ end
licenses.each { |license|
if license.length > 64
raise Gem::InvalidSpecificationException,
"each license must be 64 characters or less"
end
-
- if !Gem::Licenses.match?(license)
- suggestions = Gem::Licenses.suggestions(license)
- message = <<-warning
-license value '#{license}' is invalid. Use a license identifier from
-http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license.
- warning
- message += "Did you mean #{suggestions.map { |s| "'#{s}'"}.join(', ')}?\n" unless suggestions.nil?
- warning(message)
- end
}
warning <<-warning if licenses.empty?
-licenses is empty, but is recommended. Use a license identifier from
-http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license.
+licenses is empty, but is recommended. Use a license abbreviation from:
+http://opensource.org/licenses/alphabetical
warning
validate_permissions
@@ -2823,21 +2593,15 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
raise Gem::InvalidSpecificationException, "#{lazy} is not a summary"
end
- # Make sure a homepage is valid HTTP/HTTPS URI
- if homepage and not homepage.empty?
- begin
- homepage_uri = URI.parse(homepage)
- unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class
- raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI"
- end
- rescue URI::InvalidURIError
- raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI"
- end
+ if homepage and not homepage.empty? and
+ homepage !~ /\A[a-z][a-z\d+.-]*:/i then
+ raise Gem::InvalidSpecificationException,
+ "\"#{homepage}\" is not a URI"
end
# Warnings
- %w[author homepage summary files].each do |attribute|
+ %w[author description email homepage summary].each do |attribute|
value = self.send attribute
warning "no #{attribute} specified" if value.nil? or value.empty?
end
@@ -2856,11 +2620,6 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
warning "#{executable_path} is missing #! line" unless shebang
end
- files.each do |file|
- next unless File.symlink?(file)
- warning "#{file} is a symlink, which is not supported on all platforms"
- end
-
validate_dependencies
true
@@ -2870,75 +2629,30 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
end
end
- def validate_metadata
- url_validation_regex = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}
- link_keys = %w(
- bug_tracker_uri
- changelog_uri
- documentation_uri
- homepage_uri
- mailing_list_uri
- source_code_uri
- wiki_uri
- )
-
- metadata.each do|key, value|
- if !key.kind_of?(String)
- raise Gem::InvalidSpecificationException,
- "metadata keys must be a String"
- end
-
- if key.size > 128
- raise Gem::InvalidSpecificationException,
- "metadata key too large (#{key.size} > 128)"
- end
-
- if !value.kind_of?(String)
- raise Gem::InvalidSpecificationException,
- "metadata values must be a String"
- end
-
- if value.size > 1024
- raise Gem::InvalidSpecificationException,
- "metadata value too large (#{value.size} > 1024)"
- end
-
- if link_keys.include? key
- if value !~ url_validation_regex
- raise Gem::InvalidSpecificationException,
- "metadata['#{key}'] has invalid link: #{value.inspect}"
- end
- end
- end
- end
-
##
# Checks that dependencies use requirements as we recommend. Warnings are
# issued when dependencies are open-ended or overly strict for semantic
# versioning.
def validate_dependencies # :nodoc:
- # NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle
- seen = Gem::Dependency::TYPES.inject({}) { |types, type| types.merge({ type => {}}) }
+ seen = {}
- error_messages = []
- warning_messages = []
dependencies.each do |dep|
- if prev = seen[dep.type][dep.name] then
- error_messages << <<-MESSAGE
+ if prev = seen[dep.name] then
+ raise Gem::InvalidSpecificationException, <<-MESSAGE
duplicate dependency on #{dep}, (#{prev.requirement}) use:
- add_#{dep.type}_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}'
+ add_runtime_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}'
MESSAGE
end
- seen[dep.type][dep.name] = dep
+ seen[dep.name] = dep
prerelease_dep = dep.requirements_list.any? do |req|
Gem::Requirement.new(req).prerelease?
end
- warning_messages << "prerelease dependency on #{dep} is not recommended" if
- prerelease_dep && !version.prerelease?
+ warning "prerelease dependency on #{dep} is not recommended" if
+ prerelease_dep
overly_strict = dep.requirement.requirements.length == 1 &&
dep.requirement.requirements.any? do |op, version|
@@ -2953,7 +2667,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
base = dep_version.segments.first 2
- warning_messages << <<-WARNING
+ warning <<-WARNING
pessimistic dependency on #{dep} may be overly strict
if #{dep.name} is semantically versioned, use:
add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}', '>= #{dep_version}'
@@ -2975,19 +2689,13 @@ pessimistic dependency on #{dep} may be overly strict
", '>= #{dep_version}'"
end
- warning_messages << <<-WARNING
+ warning <<-WARNING
open-ended dependency on #{dep} is not recommended
if #{dep.name} is semantically versioned, use:
add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}
WARNING
end
end
- if error_messages.any?
- raise Gem::InvalidSpecificationException, error_messages.join
- end
- if warning_messages.any?
- warning_messages.each { |warning_message| warning warning_message }
- end
end
##
@@ -2997,14 +2705,12 @@ open-ended dependency on #{dep} is not recommended
return if Gem.win_platform?
files.each do |file|
- next unless File.file?(file)
next if File.stat(file).mode & 0444 == 0444
warning "#{file} is not world-readable"
end
executables.each do |name|
exec = File.join @bindir, name
- next unless File.file?(exec)
next if File.stat(exec).executable?
warning "#{exec} is not executable"
end
@@ -3070,10 +2776,6 @@ open-ended dependency on #{dep} is not recommended
alert_warning statement
end
- def raw_require_paths # :nodoc:
- @require_paths
- end
-
extend Gem::Deprecate
# TODO:
diff --git a/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem b/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem
new file mode 100644
index 0000000000..87676acf5f
--- /dev/null
+++ b/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
+A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
+cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
+MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
+BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
+YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
+BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
+I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
+CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
+lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
+AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
+-----END CERTIFICATE-----
diff --git a/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem b/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem
index 9e6810ab70..9e6810ab70 100644
--- a/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem
+++ b/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem
diff --git a/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem b/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem
new file mode 100644
index 0000000000..4b8939ccba
--- /dev/null
+++ b/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem
@@ -0,0 +1,28 @@
+-----BEGIN CERTIFICATE-----
+MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
+VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
+ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
+KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
+ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1
+MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE
+ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j
+b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF
+bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg
+U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA
+A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/
+I0dNxScZgSYMVHINiC3ZH5oSn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Cl6rYVSAlk6l5PdPcF
+PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
+hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
+5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
+-----END CERTIFICATE-----
diff --git a/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem b/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem
deleted file mode 100644
index f4ce4ca43d..0000000000
--- a/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem
+++ /dev/null
@@ -1,21 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
-A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
-b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
-MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
-YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
-aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
-jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
-xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
-1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
-snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
-U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
-9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
-BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
-AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
-yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
-38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
-AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
-DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
-HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
------END CERTIFICATE-----
diff --git a/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem b/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem
deleted file mode 100644
index 20585f1c01..0000000000
--- a/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem
+++ /dev/null
@@ -1,25 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
-IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
-MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
-FDASBgNVBAoTC0Fk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VR1EX1n6diIWgVIEM8med8vSTYqZEX
-c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
-mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb
index ae2effbc84..49a6df43a3 100644
--- a/lib/rubygems/stub_specification.rb
+++ b/lib/rubygems/stub_specification.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# Gem::StubSpecification reads the stub: line from the gemspec. This prevents
# us having to eval the entire gemspec in order to find out certain
@@ -16,86 +15,42 @@ class Gem::StubSpecification < Gem::BasicSpecification
end
class StubLine # :nodoc: all
- attr_reader :name, :version, :platform, :require_paths, :extensions,
- :full_name
+ attr_reader :parts
- NO_EXTENSIONS = [].freeze
-
- # These are common require paths.
- REQUIRE_PATHS = { # :nodoc:
- 'lib' => 'lib'.freeze,
- 'test' => 'test'.freeze,
- 'ext' => 'ext'.freeze,
- }
+ def initialize(data)
+ @parts = data[PREFIX.length..-1].split(" ")
+ end
- # These are common require path lists. This hash is used to optimize
- # and consolidate require_path objects. Most specs just specify "lib"
- # in their require paths, so lets take advantage of that by pre-allocating
- # a require path list for that case.
- REQUIRE_PATH_LIST = { # :nodoc:
- 'lib' => ['lib'].freeze
- }
+ def name
+ @parts[0]
+ end
- def initialize data, extensions
- parts = data[PREFIX.length..-1].split(" ".freeze, 4)
- @name = parts[0].freeze
- @version = if Gem::Version.correct?(parts[1])
- Gem::Version.new(parts[1])
- else
- Gem::Version.new(0)
- end
-
- @platform = Gem::Platform.new parts[2]
- @extensions = extensions
- @full_name = if platform == Gem::Platform::RUBY
- "#{name}-#{version}"
- else
- "#{name}-#{version}-#{platform}"
- end
-
- path_list = parts.last
- @require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0".freeze).map! { |x|
- REQUIRE_PATHS[x] || x
- }
+ def version
+ Gem::Version.new @parts[1]
end
- end
- def self.default_gemspec_stub filename, base_dir, gems_dir
- new filename, base_dir, gems_dir, true
- end
+ def platform
+ Gem::Platform.new @parts[2]
+ end
- def self.gemspec_stub filename, base_dir, gems_dir
- new filename, base_dir, gems_dir, false
+ def require_paths
+ @parts[3..-1].join(" ").split("\0")
+ end
end
- attr_reader :base_dir, :gems_dir
-
- def initialize filename, base_dir, gems_dir, default_gem
- super()
- filename.untaint
-
+ def initialize(filename)
self.loaded_from = filename
@data = nil
- @name = nil
+ @extensions = nil
@spec = nil
- @base_dir = base_dir
- @gems_dir = gems_dir
- @default_gem = default_gem
end
##
# True when this gem has been activated
def activated?
- @activated ||=
- begin
- loaded = Gem.loaded_specs[name]
- loaded && loaded.version == version
- end
- end
-
- def default_gem?
- @default_gem
+ loaded = Gem.loaded_specs[name]
+ loaded && loaded.version == version
end
def build_extensions # :nodoc:
@@ -111,28 +66,20 @@ class Gem::StubSpecification < Gem::BasicSpecification
def data
unless @data
- begin
- saved_lineno = $.
-
- # TODO It should be use `File.open`, but bundler-1.16.1 example expects Kernel#open.
- open loaded_from, OPEN_MODE do |file|
- begin
- file.readline # discard encoding line
- stubline = file.readline.chomp
- if stubline.start_with?(PREFIX) then
- extensions = if /\A#{PREFIX}/ =~ file.readline.chomp
- $'.split "\0"
- else
- StubLine::NO_EXTENSIONS
- end
-
- @data = StubLine.new stubline, extensions
- end
- rescue EOFError
+ @extensions = []
+
+ open loaded_from, OPEN_MODE do |file|
+ begin
+ file.readline # discard encoding line
+ stubline = file.readline.chomp
+ if stubline.start_with?(PREFIX) then
+ @data = StubLine.new stubline
+
+ @extensions = $'.split "\0" if
+ /\A#{PREFIX}/ =~ file.readline.chomp
end
+ rescue EOFError
end
- ensure
- $. = saved_lineno
end
end
@@ -141,14 +88,41 @@ class Gem::StubSpecification < Gem::BasicSpecification
private :data
- def raw_require_paths # :nodoc:
- data.require_paths
+ ##
+ # Extensions for this gem
+
+ def extensions
+ return @extensions if @extensions
+
+ data # load
+
+ @extensions
+ end
+
+ ##
+ # If a gem has a stub specification it doesn't need to bother with
+ # compatibility with original_name gems. It was installed with the
+ # normalized name.
+
+ def find_full_gem_path # :nodoc:
+ path = File.expand_path File.join gems_dir, full_name
+ path.untaint
+ path
+ end
+
+ ##
+ # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
+ # activated.
+
+ def full_require_paths
+ @require_paths ||= data.require_paths
+
+ super
end
def missing_extensions?
return false if default_gem?
return false if extensions.empty?
- return false if File.exist? gem_build_complete_path
to_spec.missing_extensions?
end
@@ -157,45 +131,35 @@ class Gem::StubSpecification < Gem::BasicSpecification
# Name of the gem
def name
- data.name
+ @name ||= data.name
end
##
# Platform of the gem
def platform
- data.platform
- end
-
- ##
- # Extensions for this gem
-
- def extensions
- data.extensions
+ @platform ||= data.platform
end
##
- # Version of the gem
+ # Require paths of the gem
- def version
- data.version
- end
+ def require_paths
+ @require_paths ||= data.require_paths
- def full_name
- data.full_name
+ super
end
##
# The full Gem::Specification for this gem, loaded from evalling its gemspec
def to_spec
- @spec ||= if @data then
- loaded = Gem.loaded_specs[name]
- loaded if loaded && loaded.version == version
- end
+ @spec ||= Gem.loaded_specs.values.find { |spec|
+ spec.name == @name and spec.version == @version
+ }
@spec ||= Gem::Specification.load(loaded_from)
- @spec.ignored = @ignored if @spec
+ @spec.ignored = @ignored if instance_variable_defined? :@ignored
@spec
end
@@ -209,6 +173,13 @@ class Gem::StubSpecification < Gem::BasicSpecification
end
##
+ # Version of the gem
+
+ def version
+ @version ||= data.version
+ end
+
+ ##
# Is there a stub line present for this StubSpecification?
def stubbed?
@@ -216,3 +187,4 @@ class Gem::StubSpecification < Gem::BasicSpecification
end
end
+
diff --git a/lib/rubygems/syck_hack.rb b/lib/rubygems/syck_hack.rb
index 051483eac8..92179abb53 100644
--- a/lib/rubygems/syck_hack.rb
+++ b/lib/rubygems/syck_hack.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# :stopdoc:
# Hack to handle syck's DefaultKey bug
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 39aa4fc9a7..e9916dad61 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# TODO: $SAFE = 1
begin
@@ -25,9 +24,6 @@ unless Gem::Dependency.new('rdoc', '>= 3.10').matching_specs.empty?
gem 'json'
end
-if Gem::USE_BUNDLER_FOR_GEMDEPS
- require 'bundler'
-end
require 'minitest/autorun'
require 'rubygems/deprecate'
@@ -40,7 +36,9 @@ require 'shellwords'
require 'tmpdir'
require 'uri'
require 'zlib'
-require 'benchmark' # stdlib
+
+Gem.load_yaml
+
require 'rubygems/mock_gem_ui'
module Gem
@@ -223,28 +221,12 @@ class Gem::TestCase < MiniTest::Unit::TestCase
@orig_gem_home = ENV['GEM_HOME']
@orig_gem_path = ENV['GEM_PATH']
@orig_gem_vendor = ENV['GEM_VENDOR']
- @orig_gem_spec_cache = ENV['GEM_SPEC_CACHE']
- @orig_rubygems_gemdeps = ENV['RUBYGEMS_GEMDEPS']
- @orig_bundle_gemfile = ENV['BUNDLE_GEMFILE']
- @orig_rubygems_host = ENV['RUBYGEMS_HOST']
- ENV.keys.find_all { |k| k.start_with?('GEM_REQUIREMENT_') }.each do |k|
- ENV.delete k
- end
- @orig_gem_env_requirements = ENV.to_hash
ENV['GEM_VENDOR'] = nil
@current_dir = Dir.pwd
@fetcher = nil
-
- if Gem::USE_BUNDLER_FOR_GEMDEPS
- Bundler.ui = Bundler::UI::Silent.new
- end
- @back_ui = Gem::DefaultUserInteraction.ui
- @ui = Gem::MockGemUi.new
- # This needs to be a new instance since we call use_ui(@ui) when we want to
- # capture output
- Gem::DefaultUserInteraction.ui = Gem::MockGemUi.new
+ @ui = Gem::MockGemUi.new
tmpdir = File.expand_path Dir.tmpdir
tmpdir.untaint
@@ -268,17 +250,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
@tempdir.untaint
end
- # This makes the tempdir consistent on Windows.
- # Dir.tmpdir may return short path name, but Dir[Dir.tmpdir] returns long
- # path name. https://bugs.ruby-lang.org/issues/10819
- # File.expand_path or File.realpath doesn't convert path name to long path
- # name. Only Dir[] (= Dir.glob) works.
- # Short and long path name is specific to Windows filesystem.
- if win_platform?
- @tempdir = Dir[@tempdir][0]
- @tempdir.untaint
- end
-
@gemhome = File.join @tempdir, 'gemhome'
@userhome = File.join @tempdir, 'userhome'
ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
@@ -294,17 +265,13 @@ class Gem::TestCase < MiniTest::Unit::TestCase
Gem.ensure_gem_subdirectories @gemhome
@orig_LOAD_PATH = $LOAD_PATH.dup
- $LOAD_PATH.map! { |s|
- (expand_path = File.expand_path(s)) == s ? s : expand_path.untaint
- }
+ $LOAD_PATH.map! { |s| File.expand_path(s).untaint }
Dir.chdir @tempdir
@orig_ENV_HOME = ENV['HOME']
ENV['HOME'] = @userhome
Gem.instance_variable_set :@user_home, nil
- Gem.instance_variable_set :@gemdeps, nil
- Gem.instance_variable_set :@env_requirements_by_name, nil
Gem.send :remove_instance_variable, :@ruby_version if
Gem.instance_variables.include? :@ruby_version
@@ -335,9 +302,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
Gem.loaded_specs.clear
Gem.clear_default_specs
Gem::Specification.unresolved_deps.clear
- if Gem::USE_BUNDLER_FOR_GEMDEPS
- Bundler.reset!
- end
Gem.configuration.verbose = true
Gem.configuration.update_sources = true
@@ -362,7 +326,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
end
@marshal_version = "#{Marshal::MAJOR_VERSION}.#{Marshal::MINOR_VERSION}"
- @orig_LOADED_FEATURES = $LOADED_FEATURES.dup
end
##
@@ -371,18 +334,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
def teardown
$LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH
- if @orig_LOADED_FEATURES
- if @orig_LOAD_PATH
- paths = @orig_LOAD_PATH.map {|path| File.join(File.expand_path(path), "/")}
- ($LOADED_FEATURES - @orig_LOADED_FEATURES).each do |feat|
- unless paths.any? {|path| feat.start_with?(path)}
- $LOADED_FEATURES.delete(feat)
- end
- end
- else
- $LOADED_FEATURES.replace @orig_LOADED_FEATURES
- end
- end
if @orig_BASERUBY
RbConfig::CONFIG['BASERUBY'] = @orig_BASERUBY
@@ -399,18 +350,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase
FileUtils.rm_rf @tempdir unless ENV['KEEP_FILES']
- ENV.clear
- @orig_gem_env_requirements.each do |k,v|
- ENV[k] = v
- end
-
ENV['GEM_HOME'] = @orig_gem_home
ENV['GEM_PATH'] = @orig_gem_path
ENV['GEM_VENDOR'] = @orig_gem_vendor
- ENV['GEM_SPEC_CACHE'] = @orig_gem_spec_cache
- ENV['RUBYGEMS_GEMDEPS'] = @orig_rubygems_gemdeps
- ENV['BUNDLE_GEMFILE'] = @orig_bundle_gemfile
- ENV['RUBYGEMS_HOST'] = @orig_rubygems_host
Gem.ruby = @orig_ruby if @orig_ruby
@@ -425,10 +367,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
ENV['GEM_PRIVATE_KEY_PASSPHRASE'] = @orig_gem_private_key_passphrase
Gem::Specification._clear_load_cache
- Gem::Specification.unresolved_deps.clear
- Gem::refresh
-
- @back_ui.close
end
def common_installer_setup
@@ -488,7 +426,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
gemspec = "#{name}.gemspec"
- File.open File.join(directory, gemspec), 'w' do |io|
+ open File.join(directory, gemspec), 'w' do |io|
io.write git_spec.to_ruby
end
@@ -503,7 +441,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
system @git, 'add', gemspec
system @git, 'commit', '-a', '-m', 'a non-empty commit message', '--quiet'
- head = Gem::Util.popen(@git, 'rev-parse', 'master').strip
+ head = Gem::Util.popen('git', 'rev-parse', 'master').strip
end
return name, git_spec.version, directory, head
@@ -544,7 +482,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint
end
- Gem::Installer.at(gem, options.merge({:wrappers => true})).install
+ Gem::Installer.new(gem, options.merge({:wrappers => true})).install
end
##
@@ -559,11 +497,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
def uninstall_gem spec
require 'rubygems/uninstaller'
- Class.new(Gem::Uninstaller) {
- def ask_if_ok spec
- true
- end
- }.new(spec.name, :executables => true, :user_install => true).uninstall
+ Gem::Uninstaller.new(spec.name,
+ :executables => true, :user_install => true).uninstall
end
##
@@ -582,7 +517,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
# Enables pretty-print for all tests
def mu_pp(obj)
- s = String.new
+ s = ''
s = PP.pp obj, s
s = s.force_encoding(Encoding.default_external) if defined? Encoding
s.chomp
@@ -592,7 +527,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
# Reads a Marshal file at +path+
def read_cache(path)
- File.open path.dup.untaint, 'rb' do |io|
+ open path.dup.untaint, 'rb' do |io|
Marshal.load io.read
end
end
@@ -610,9 +545,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase
def write_file(path)
path = File.join @gemhome, path unless Pathname.new(path).absolute?
dir = File.dirname path
- FileUtils.mkdir_p dir unless File.directory? dir
+ FileUtils.mkdir_p dir
- File.open path, 'wb' do |io|
+ open path, 'wb' do |io|
yield io if block_given?
end
@@ -657,7 +592,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
spec.loaded_from = spec.loaded_from = written_path
- Gem::Specification.reset
+ Gem::Specification.add_spec spec.for_cache
return spec
end
@@ -713,10 +648,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
# Install the provided specs
def install_specs(*specs)
- specs.each do |spec|
- Gem::Installer.for_spec(spec).install
- end
-
+ Gem::Specification.add_specs(*specs)
Gem.searcher = nil
end
@@ -727,7 +659,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
install_default_specs(*specs)
specs.each do |spec|
- File.open spec.loaded_from, 'w' do |io|
+ open spec.loaded_from, 'w' do |io|
io.write spec.to_ruby_for_cache
end
end
@@ -737,9 +669,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
# Install the provided default specs
def install_default_specs(*specs)
+ install_specs(*specs)
specs.each do |spec|
- installer = Gem::Installer.for_spec(spec, :install_as_default => true)
- installer.install
Gem.register_default_spec(spec)
end
end
@@ -851,7 +782,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase
end
end
- Gem::Specification.reset
+ spec.loaded_from = spec.spec_file
+
+ Gem::Specification.add_spec spec
return spec
end
@@ -1038,13 +971,14 @@ Also, a list:
# Best used with +@all_gems+ from #util_setup_fake_fetcher.
def util_setup_spec_fetcher(*specs)
- all_specs = Gem::Specification.to_a + specs
- Gem::Specification._resort! all_specs
+ specs -= Gem::Specification._all
+ Gem::Specification.add_specs(*specs)
spec_fetcher = Gem::SpecFetcher.fetcher
- prerelease, all = all_specs.partition { |spec| spec.version.prerelease? }
- latest = Gem::Specification._latest_specs all_specs
+ prerelease, all = Gem::Specification.partition { |spec|
+ spec.version.prerelease?
+ }
spec_fetcher.specs[@uri] = []
all.each do |spec|
@@ -1052,7 +986,7 @@ Also, a list:
end
spec_fetcher.latest_specs[@uri] = []
- latest.each do |spec|
+ Gem::Specification.latest_specs.each do |spec|
spec_fetcher.latest_specs[@uri] << spec.name_tuple
end
@@ -1068,7 +1002,7 @@ Also, a list:
specs = all.map { |spec| spec.name_tuple }
s_zip = util_gzip Marshal.dump Gem::NameTuple.to_basic specs
- latest_specs = latest.map do |spec|
+ latest_specs = Gem::Specification.latest_specs.map do |spec|
spec.name_tuple
end
@@ -1083,7 +1017,7 @@ Also, a list:
v = Gem.marshal_version
- all_specs.each do |spec|
+ Gem::Specification.each do |spec|
path = "#{@gem_repo}quick/Marshal.#{v}/#{spec.original_name}.gemspec.rz"
data = Marshal.dump spec
data_deflate = Zlib::Deflate.deflate data
@@ -1101,37 +1035,6 @@ Also, a list:
Zlib::Deflate.deflate data
end
- def util_set_RUBY_VERSION(version, patchlevel = nil, revision = nil)
- if Gem.instance_variables.include? :@ruby_version or
- Gem.instance_variables.include? '@ruby_version' then
- Gem.send :remove_instance_variable, :@ruby_version
- end
-
- @RUBY_VERSION = RUBY_VERSION
- @RUBY_PATCHLEVEL = RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- @RUBY_REVISION = RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.send :remove_const, :RUBY_VERSION
- Object.send :remove_const, :RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- Object.send :remove_const, :RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.const_set :RUBY_VERSION, version
- Object.const_set :RUBY_PATCHLEVEL, patchlevel if patchlevel
- Object.const_set :RUBY_REVISION, revision if revision
- end
-
- def util_restore_RUBY_VERSION
- Object.send :remove_const, :RUBY_VERSION
- Object.send :remove_const, :RUBY_PATCHLEVEL if defined?(RUBY_PATCHLEVEL)
- Object.send :remove_const, :RUBY_REVISION if defined?(RUBY_REVISION)
-
- Object.const_set :RUBY_VERSION, @RUBY_VERSION
- Object.const_set :RUBY_PATCHLEVEL, @RUBY_PATCHLEVEL if
- defined?(@RUBY_PATCHLEVEL)
- Object.const_set :RUBY_REVISION, @RUBY_REVISION if
- defined?(@RUBY_REVISION)
- end
-
##
# Is this test being run on a Windows platform?
@@ -1168,7 +1071,7 @@ Also, a list:
# other platforms, including Cygwin, it will return 'make'.
def self.make_command
- ENV["make"] || ENV["MAKE"] || (vc_windows? ? 'nmake' : 'make')
+ ENV["make"] || (vc_windows? ? 'nmake' : 'make')
end
##
@@ -1177,7 +1080,7 @@ Also, a list:
# other platforms, including Cygwin, it will return 'make'.
def make_command
- ENV["make"] || ENV["MAKE"] || (vc_windows? ? 'nmake' : 'make')
+ ENV["make"] || (vc_windows? ? 'nmake' : 'make')
end
##
@@ -1260,8 +1163,8 @@ Also, a list:
end
@@ruby = rubybin
- @@good_rake = "#{rubybin} \"#{File.expand_path('../../../test/rubygems/good_rake.rb', __FILE__)}\""
- @@bad_rake = "#{rubybin} \"#{File.expand_path('../../../test/rubygems/bad_rake.rb', __FILE__)}\""
+ @@good_rake = "#{rubybin} #{File.expand_path('../../../test/rubygems/good_rake.rb', __FILE__)}"
+ @@bad_rake = "#{rubybin} #{File.expand_path('../../../test/rubygems/bad_rake.rb', __FILE__)}"
##
# Construct a new Gem::Dependency.
@@ -1347,23 +1250,13 @@ Also, a list:
def vendor_gem name = 'a', version = 1
directory = File.join 'vendor', name
- FileUtils.mkdir_p directory
-
- save_gemspec name, version, directory
- end
-
- ##
- # create_gemspec creates gem specification in given +directory+ or '.'
- # for the given +name+ and +version+.
- #
- # Yields the +specification+ to the block, if given
-
- def save_gemspec name = 'a', version = 1, directory = '.'
vendor_spec = Gem::Specification.new name, version do |specification|
yield specification if block_given?
end
- File.open File.join(directory, "#{name}.gemspec"), 'w' do |io|
+ FileUtils.mkdir_p directory
+
+ open File.join(directory, "#{name}.gemspec"), 'w' do |io|
io.write vendor_spec.to_ruby
end
@@ -1502,37 +1395,5 @@ Also, a list:
end
-# require dependencies that are not discoverable once GEM_HOME and GEM_PATH
-# are wiped
-begin
- gem 'rake'
-rescue Gem::LoadError
-end
-
-begin
- require 'rake/packagetask'
-rescue LoadError
-end
-
-begin
- gem 'rdoc'
- require 'rdoc'
-
- require 'rubygems/rdoc'
-rescue LoadError, Gem::LoadError
-end
-
-begin
- gem 'builder'
- require 'builder/xchar'
-rescue LoadError, Gem::LoadError
-end
-
require 'rubygems/test_utilities'
-tmpdirs = []
-tmpdirs << (ENV['GEM_HOME'] = Dir.mktmpdir("home"))
-tmpdirs << (ENV['GEM_PATH'] = Dir.mktmpdir("path"))
-pid = $$
-END {tmpdirs.each {|dir| Dir.rmdir(dir)} if $$ == pid}
-Gem.clear_paths
-Gem.loaded_specs.clear
+
diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb
index 83c9d2d0fe..25786e6a21 100644
--- a/lib/rubygems/test_utilities.rb
+++ b/lib/rubygems/test_utilities.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'tempfile'
require 'rubygems'
require 'rubygems/remote_fetcher'
@@ -187,6 +186,7 @@ end
# f.gem 'a', 1
# f.spec 'a', 2
# f.gem 'b', 1' 'a' => '~> 1.0'
+# f.clear
# end
#
# The above declaration creates two gems, a-1 and b-1, with a dependency from
@@ -214,12 +214,19 @@ class Gem::TestCase::SpecFetcherSetup
@repository = repository
@gems = {}
- @downloaded = []
@installed = []
@operations = []
end
##
+ # Removes any created gems or specifications from Gem.dir (the default
+ # install location).
+
+ def clear
+ @operations << [:clear]
+ end
+
+ ##
# Returns a Hash of created Specification full names and the corresponding
# Specification.
@@ -247,6 +254,9 @@ class Gem::TestCase::SpecFetcherSetup
def execute_operations # :nodoc:
@operations.each do |operation, *arguments|
case operation
+ when :clear then
+ @test.util_clear_gems
+ @installed.clear
when :gem then
spec, gem = @test.util_gem(*arguments, &arguments.pop)
@@ -254,11 +264,6 @@ class Gem::TestCase::SpecFetcherSetup
@gems[spec] = gem
@installed << spec
- when :download then
- spec, gem = @test.util_gem(*arguments, &arguments.pop)
-
- @gems[spec] = gem
- @downloaded << spec
when :spec then
spec = @test.util_spec(*arguments, &arguments.pop)
@@ -282,17 +287,6 @@ class Gem::TestCase::SpecFetcherSetup
end
##
- # Creates a gem with +name+, +version+ and +deps+. The created gem is
- # downloaded in to the cache directory but is not installed
- #
- # The specification will be yielded before gem creation for customization,
- # but only the block or the dependencies may be set, not both.
-
- def download name, version, dependencies = nil, &block
- @operations << [:download, name, version, dependencies, block]
- end
-
- ##
# Creates a legacy platform spec with the name 'pl' and version 1
def legacy_platform
@@ -318,12 +312,17 @@ class Gem::TestCase::SpecFetcherSetup
gem_repo, @test.gem_repo = @test.gem_repo, @repository
@test.uri = URI @repository
- @test.util_setup_spec_fetcher(*@downloaded)
+ @test.util_setup_spec_fetcher(*@gems.keys)
ensure
@test.gem_repo = gem_repo
@test.uri = URI gem_repo
end
+ # This works around util_setup_spec_fetcher adding all created gems to the
+ # installed set.
+ Gem::Specification.reset
+ Gem::Specification.add_specs(*@installed)
+
@gems.each do |spec, gem|
next unless gem
@@ -346,7 +345,7 @@ class Gem::TestCase::SpecFetcherSetup
end
def write_spec spec # :nodoc:
- File.open spec.spec_file, 'w' do |io|
+ open spec.spec_file, 'w' do |io|
io.write spec.to_ruby_for_cache
end
end
diff --git a/lib/rubygems/text.rb b/lib/rubygems/text.rb
index b944b62c27..8b26bebec8 100644
--- a/lib/rubygems/text.rb
+++ b/lib/rubygems/text.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'rubygems'
##
@@ -7,25 +6,12 @@ require 'rubygems'
module Gem::Text
##
- # Remove any non-printable characters and make the text suitable for
- # printing.
- def clean_text(text)
- text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".".freeze)
- end
-
- def truncate_text(text, description, max_length = 100_000)
- raise ArgumentError, "max_length must be positive" unless max_length > 0
- return text if text.size <= max_length
- "Truncating #{description} to #{max_length.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse} characters:\n" + text[0, max_length]
- end
-
- ##
# Wraps +text+ to +wrap+ characters and optionally indents by +indent+
# characters
def format_text(text, wrap, indent=0)
result = []
- work = clean_text(text)
+ work = text.dup
while work.length > wrap do
if work =~ /^(.{0,#{wrap}})[ \n]/ then
@@ -41,9 +27,9 @@ module Gem::Text
end
def min3 a, b, c # :nodoc:
- if a < b && a < c then
+ if a < b && a < c
a
- elsif b < c then
+ elsif b < a && b < c
b
else
c
@@ -57,9 +43,11 @@ module Gem::Text
t = str2
n = s.length
m = t.length
+ max = n/2
return m if (0 == n)
return n if (0 == m)
+ return n if (n - m).abs > max
d = (0..m).to_a
x = nil
@@ -84,3 +72,4 @@ module Gem::Text
return x
end
end
+
diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
index 89f47a45fe..2a6edc6131 100644
--- a/lib/rubygems/uninstaller.rb
+++ b/lib/rubygems/uninstaller.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -272,7 +271,7 @@ class Gem::Uninstaller
say "Successfully uninstalled #{spec.full_name}"
- Gem::Specification.reset
+ Gem::Specification.remove_spec spec
end
##
diff --git a/lib/rubygems/uri_formatter.rb b/lib/rubygems/uri_formatter.rb
index bb128e4ef9..68aacc6369 100644
--- a/lib/rubygems/uri_formatter.rb
+++ b/lib/rubygems/uri_formatter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'cgi'
require 'uri'
diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb
index eff8f9533c..917b4ea5aa 100644
--- a/lib/rubygems/user_interaction.rb
+++ b/lib/rubygems/user_interaction.rb
@@ -1,12 +1,13 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
-require 'rubygems/util'
-require 'rubygems/text'
+begin
+ require 'io/console'
+rescue LoadError
+end
##
# Module that defines the default UserInteraction. Any class including this
@@ -14,8 +15,6 @@ require 'rubygems/text'
module Gem::DefaultUserInteraction
- include Gem::Text
-
##
# The default UI is a class variable of the singleton class for this
# module.
@@ -163,8 +162,8 @@ module Gem::UserInteraction
# Calls +say+ with +msg+ or the results of the block if really_verbose
# is true.
- def verbose(msg = nil)
- say(clean_text(msg || yield)) if Gem.configuration.really_verbose
+ def verbose msg = nil
+ say(msg || yield) if Gem.configuration.really_verbose
end
end
@@ -312,22 +311,14 @@ class Gem::StreamUI
password
end
- def require_io_console
- @require_io_console ||= begin
- begin
- require 'io/console'
- rescue LoadError
- end
- true
- end
- end
-
- def _gets_noecho
- require_io_console
- if IO.method_defined?(:noecho) then
+ if IO.method_defined?(:noecho) then
+ def _gets_noecho
@ins.noecho {@ins.gets}
- elsif Gem.win_platform?
+ end
+ elsif Gem.win_platform?
+ def _gets_noecho
require "Win32API"
+ char = nil
password = ''
while char = Win32API.new("crtdll", "_getch", [ ], "L").Call do
@@ -339,7 +330,9 @@ class Gem::StreamUI
end
end
password
- else
+ end
+ else
+ def _gets_noecho
system "stty -echo"
begin
@ins.gets
@@ -404,6 +397,10 @@ class Gem::StreamUI
# Return a progress reporter object chosen from the current verbosity.
def progress_reporter(*args)
+ if self.kind_of?(Gem::SilentUI)
+ return SilentProgressReporter.new(@outs, *args)
+ end
+
case Gem.configuration.verbose
when nil, false
SilentProgressReporter.new(@outs, *args)
@@ -537,6 +534,10 @@ class Gem::StreamUI
# Return a download reporter object chosen from the current verbosity
def download_reporter(*args)
+ if self.kind_of?(Gem::SilentUI)
+ return SilentDownloadReporter.new(@outs, *args)
+ end
+
case Gem.configuration.verbose
when nil, false
SilentDownloadReporter.new(@outs, *args)
@@ -683,8 +684,13 @@ class Gem::SilentUI < Gem::StreamUI
def initialize
reader, writer = nil, nil
- reader = File.open(Gem::Util::NULL_DEVICE, 'r')
- writer = File.open(Gem::Util::NULL_DEVICE, 'w')
+ begin
+ reader = File.open('/dev/null', 'r')
+ writer = File.open('/dev/null', 'w')
+ rescue Errno::ENOENT
+ reader = File.open('nul', 'r')
+ writer = File.open('nul', 'w')
+ end
super reader, writer, writer, false
end
@@ -703,3 +709,4 @@ class Gem::SilentUI < Gem::StreamUI
SilentProgressReporter.new(@outs, *args)
end
end
+
diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb
index 6c75910004..cd0af4d8fe 100644
--- a/lib/rubygems/util.rb
+++ b/lib/rubygems/util.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# This module contains various utility methods as module methods.
@@ -11,8 +10,8 @@ module Gem::Util
def self.gunzip(data)
require 'zlib'
- require 'stringio'
- data = StringIO.new(data, 'r')
+ require 'rubygems/util/stringio'
+ data = Gem::StringSource.new data
unzipped = Zlib::GzipReader.new(data).read
unzipped.force_encoding Encoding::BINARY if Object.const_defined? :Encoding
@@ -24,8 +23,8 @@ module Gem::Util
def self.gzip(data)
require 'zlib'
- require 'stringio'
- zipped = StringIO.new(String.new, 'w')
+ require 'rubygems/util/stringio'
+ zipped = Gem::StringSink.new
zipped.set_encoding Encoding::BINARY if Object.const_defined? :Encoding
Zlib::GzipWriter.wrap zipped do |io| io.write data end
@@ -109,16 +108,26 @@ module Gem::Util
##
# Enumerates the parents of +directory+.
- def self.traverse_parents directory, &block
+ def self.traverse_parents directory
return enum_for __method__, directory unless block_given?
here = File.expand_path directory
- loop do
- Dir.chdir here, &block rescue Errno::EACCES
+ start = here
- new_here = File.expand_path('..', here)
- return if new_here == here # toplevel
- here = new_here
+ Dir.chdir start
+
+ begin
+ loop do
+ yield here
+
+ Dir.chdir '..'
+
+ return if Dir.pwd == here # toplevel
+
+ here = Dir.pwd
+ end
+ ensure
+ Dir.chdir start
end
end
diff --git a/lib/rubygems/util/licenses.rb b/lib/rubygems/util/licenses.rb
deleted file mode 100644
index 96fed282f1..0000000000
--- a/lib/rubygems/util/licenses.rb
+++ /dev/null
@@ -1,380 +0,0 @@
-# frozen_string_literal: true
-require 'rubygems/text'
-
-class Gem::Licenses
- extend Gem::Text
-
- NONSTANDARD = 'Nonstandard'.freeze
-
- # Software Package Data Exchange (SPDX) standard open-source software
- # license identifiers
- IDENTIFIERS = %w(
- 0BSD
- AAL
- ADSL
- AFL-1.1
- AFL-1.2
- AFL-2.0
- AFL-2.1
- AFL-3.0
- AGPL-1.0
- AGPL-3.0
- AMDPLPA
- AML
- AMPAS
- ANTLR-PD
- APAFML
- APL-1.0
- APSL-1.0
- APSL-1.1
- APSL-1.2
- APSL-2.0
- Abstyles
- Adobe-2006
- Adobe-Glyph
- Afmparse
- Aladdin
- Apache-1.0
- Apache-1.1
- Apache-2.0
- Artistic-1.0
- Artistic-1.0-Perl
- Artistic-1.0-cl8
- Artistic-2.0
- BSD-2-Clause
- BSD-2-Clause-FreeBSD
- BSD-2-Clause-NetBSD
- BSD-3-Clause
- BSD-3-Clause-Attribution
- BSD-3-Clause-Clear
- BSD-3-Clause-LBNL
- BSD-3-Clause-No-Nuclear-License
- BSD-3-Clause-No-Nuclear-License-2014
- BSD-3-Clause-No-Nuclear-Warranty
- BSD-4-Clause
- BSD-4-Clause-UC
- BSD-Protection
- BSD-Source-Code
- BSL-1.0
- Bahyph
- Barr
- Beerware
- BitTorrent-1.0
- BitTorrent-1.1
- Borceux
- CATOSL-1.1
- CC-BY-1.0
- CC-BY-2.0
- CC-BY-2.5
- CC-BY-3.0
- CC-BY-4.0
- CC-BY-NC-1.0
- CC-BY-NC-2.0
- CC-BY-NC-2.5
- CC-BY-NC-3.0
- CC-BY-NC-4.0
- CC-BY-NC-ND-1.0
- CC-BY-NC-ND-2.0
- CC-BY-NC-ND-2.5
- CC-BY-NC-ND-3.0
- CC-BY-NC-ND-4.0
- CC-BY-NC-SA-1.0
- CC-BY-NC-SA-2.0
- CC-BY-NC-SA-2.5
- CC-BY-NC-SA-3.0
- CC-BY-NC-SA-4.0
- CC-BY-ND-1.0
- CC-BY-ND-2.0
- CC-BY-ND-2.5
- CC-BY-ND-3.0
- CC-BY-ND-4.0
- CC-BY-SA-1.0
- CC-BY-SA-2.0
- CC-BY-SA-2.5
- CC-BY-SA-3.0
- CC-BY-SA-4.0
- CC0-1.0
- CDDL-1.0
- CDDL-1.1
- CECILL-1.0
- CECILL-1.1
- CECILL-2.0
- CECILL-2.1
- CECILL-B
- CECILL-C
- CNRI-Jython
- CNRI-Python
- CNRI-Python-GPL-Compatible
- CPAL-1.0
- CPL-1.0
- CPOL-1.02
- CUA-OPL-1.0
- Caldera
- ClArtistic
- Condor-1.1
- Crossword
- CrystalStacker
- Cube
- D-FSL-1.0
- DOC
- DSDP
- Dotseqn
- ECL-1.0
- ECL-2.0
- EFL-1.0
- EFL-2.0
- EPL-1.0
- EUDatagrid
- EUPL-1.0
- EUPL-1.1
- Entessa
- ErlPL-1.1
- Eurosym
- FSFAP
- FSFUL
- FSFULLR
- FTL
- Fair
- Frameworx-1.0
- FreeImage
- GFDL-1.1
- GFDL-1.2
- GFDL-1.3
- GL2PS
- GPL-1.0
- GPL-1.0+
- GPL-2.0
- GPL-2.0+
- GPL-2.0-with-GCC-exception
- GPL-2.0-with-autoconf-exception
- GPL-2.0-with-bison-exception
- GPL-2.0-with-classpath-exception
- GPL-2.0-with-font-exception
- GPL-3.0
- GPL-3.0+
- GPL-3.0-with-GCC-exception
- GPL-3.0-with-autoconf-exception
- Giftware
- Glide
- Glulxe
- HPND
- HaskellReport
- IBM-pibs
- ICU
- IJG
- IPA
- IPL-1.0
- ISC
- ImageMagick
- Imlib2
- Info-ZIP
- Intel
- Intel-ACPI
- Interbase-1.0
- JSON
- JasPer-2.0
- LAL-1.2
- LAL-1.3
- LGPL-2.0
- LGPL-2.0+
- LGPL-2.1
- LGPL-2.1+
- LGPL-3.0
- LGPL-3.0+
- LGPLLR
- LPL-1.0
- LPL-1.02
- LPPL-1.0
- LPPL-1.1
- LPPL-1.2
- LPPL-1.3a
- LPPL-1.3c
- Latex2e
- Leptonica
- LiLiQ-P-1.1
- LiLiQ-R-1.1
- LiLiQ-Rplus-1.1
- Libpng
- MIT
- MIT-CMU
- MIT-advertising
- MIT-enna
- MIT-feh
- MITNFA
- MPL-1.0
- MPL-1.1
- MPL-2.0
- MPL-2.0-no-copyleft-exception
- MS-PL
- MS-RL
- MTLL
- MakeIndex
- MirOS
- Motosoto
- Multics
- Mup
- NASA-1.3
- NBPL-1.0
- NCSA
- NGPL
- NLOD-1.0
- NLPL
- NOSL
- NPL-1.0
- NPL-1.1
- NPOSL-3.0
- NRL
- NTP
- Naumen
- Net-SNMP
- NetCDF
- Newsletr
- Nokia
- Noweb
- Nunit
- OCCT-PL
- OCLC-2.0
- ODbL-1.0
- OFL-1.0
- OFL-1.1
- OGTSL
- OLDAP-1.1
- OLDAP-1.2
- OLDAP-1.3
- OLDAP-1.4
- OLDAP-2.0
- OLDAP-2.0.1
- OLDAP-2.1
- OLDAP-2.2
- OLDAP-2.2.1
- OLDAP-2.2.2
- OLDAP-2.3
- OLDAP-2.4
- OLDAP-2.5
- OLDAP-2.6
- OLDAP-2.7
- OLDAP-2.8
- OML
- OPL-1.0
- OSET-PL-2.1
- OSL-1.0
- OSL-1.1
- OSL-2.0
- OSL-2.1
- OSL-3.0
- OpenSSL
- PDDL-1.0
- PHP-3.0
- PHP-3.01
- Plexus
- PostgreSQL
- Python-2.0
- QPL-1.0
- Qhull
- RHeCos-1.1
- RPL-1.1
- RPL-1.5
- RPSL-1.0
- RSA-MD
- RSCPL
- Rdisc
- Ruby
- SAX-PD
- SCEA
- SGI-B-1.0
- SGI-B-1.1
- SGI-B-2.0
- SISSL
- SISSL-1.2
- SMLNJ
- SMPPL
- SNIA
- SPL-1.0
- SWL
- Saxpath
- Sendmail
- SimPL-2.0
- Sleepycat
- Spencer-86
- Spencer-94
- Spencer-99
- StandardML-NJ
- SugarCRM-1.1.3
- TCL
- TCP-wrappers
- TMate
- TORQUE-1.1
- TOSL
- UPL-1.0
- Unicode-DFS-2015
- Unicode-DFS-2016
- Unicode-TOU
- Unlicense
- VOSTROM
- VSL-1.0
- Vim
- W3C
- W3C-19980720
- W3C-20150513
- WTFPL
- WXwindows
- Watcom-1.0
- Wsuipa
- X11
- XFree86-1.1
- XSkat
- Xerox
- Xnet
- YPL-1.0
- YPL-1.1
- ZPL-1.1
- ZPL-2.0
- ZPL-2.1
- Zed
- Zend-2.0
- Zimbra-1.3
- Zimbra-1.4
- Zlib
- bzip2-1.0.5
- bzip2-1.0.6
- curl
- diffmark
- dvipdfm
- eCos-2.0
- eGenix
- gSOAP-1.3b
- gnuplot
- iMatix
- libtiff
- mpich2
- psfrag
- psutils
- xinetd
- xpp
- zlib-acknowledgement
- ).freeze
-
- REGEXP = %r{
- \A
- (
- #{Regexp.union(IDENTIFIERS)}
- \+?
- (\s WITH \s .+)?
- | #{NONSTANDARD}
- )
- \Z
- }ox.freeze
-
- def self.match?(license)
- !REGEXP.match(license).nil?
- end
-
- def self.suggestions(license)
- by_distance = IDENTIFIERS.group_by do |identifier|
- levenshtein_distance(identifier, license)
- end
- lowest = by_distance.keys.min
- return unless lowest < license.size
- by_distance[lowest]
- end
-end
diff --git a/lib/rubygems/util/list.rb b/lib/rubygems/util/list.rb
index 9c25f6b6dc..9bc11fe334 100644
--- a/lib/rubygems/util/list.rb
+++ b/lib/rubygems/util/list.rb
@@ -1,14 +1,7 @@
-# frozen_string_literal: true
module Gem
- class List
- include Enumerable
- attr_accessor :value, :tail
-
- def initialize(value = nil, tail = nil)
- @value = value
- @tail = tail
- end
+ List = Struct.new(:value, :tail)
+ class List
def each
n = self
while n
@@ -18,7 +11,25 @@ module Gem
end
def to_a
- super.reverse
+ ary = []
+ n = self
+ while n
+ ary.unshift n.value
+ n = n.tail
+ end
+
+ ary
+ end
+
+ def find
+ n = self
+ while n
+ v = n.value
+ return v if yield(v)
+ n = n.tail
+ end
+
+ nil
end
def prepend(value)
diff --git a/lib/rubygems/util/stringio.rb b/lib/rubygems/util/stringio.rb
new file mode 100644
index 0000000000..2ea69617bc
--- /dev/null
+++ b/lib/rubygems/util/stringio.rb
@@ -0,0 +1,34 @@
+class Gem::StringSink
+ def initialize
+ @string = ""
+ end
+
+ attr_reader :string
+
+ def write(s)
+ @string += s
+ s.size
+ end
+
+ def set_encoding(enc)
+ @string.force_encoding enc
+ end
+end
+
+class Gem::StringSource
+ def initialize(str)
+ @string = str.dup
+ end
+
+ def read(count=nil)
+ if count
+ @string.slice!(0,count)
+ else
+ s = @string
+ @string = ""
+ s
+ end
+ end
+
+ alias_method :readpartial, :read
+end
diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb
index 6842e4fa9c..6992af16ba 100644
--- a/lib/rubygems/validator.rb
+++ b/lib/rubygems/validator.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -34,7 +33,7 @@ class Gem::Validator
# gem_path:: [String] Path to gem file
def verify_gem_file(gem_path)
- File.open gem_path, Gem.binary_mode do |file|
+ open gem_path, Gem.binary_mode do |file|
gem_data = file.read
verify_gem gem_data
end
@@ -109,7 +108,7 @@ class Gem::Validator
good, gone, unreadable = nil, nil, nil, nil
- File.open gem_path, Gem.binary_mode do |file|
+ open gem_path, Gem.binary_mode do |file|
package = Gem::Package.new gem_path
good, gone = package.contents.partition { |file_name|
@@ -134,7 +133,7 @@ class Gem::Validator
source = File.join gem_directory, entry['path']
- File.open source, Gem.binary_mode do |f|
+ open source, Gem.binary_mode do |f|
unless f.read == data then
errors[gem_name][entry['path']] = "Modified from original"
end
diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
index ff5c1c1e72..8335ebe182 100644
--- a/lib/rubygems/version.rb
+++ b/lib/rubygems/version.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
##
# The Version class processes string versions into comparable
# values. A version string should normally be a series of numbers
@@ -108,7 +107,7 @@
# Client A needs a stack with basic push/pop capability. They write to the
# original interface (no <tt>top</tt>), so their version constraint looks like:
#
-# gem 'stack', '>= 0.0'
+# gem 'stack', '~> 0.0'
#
# Essentially, any version is OK with Client A. An incompatible change to
# the library will cause them grief, but they are willing to take the chance
@@ -170,7 +169,7 @@ class Gem::Version
# True if the +version+ string matches RubyGems' requirements.
def self.correct? version
- !!(version.to_s =~ ANCHORED_VERSION_PATTERN)
+ version.to_s =~ ANCHORED_VERSION_PATTERN
end
##
@@ -204,12 +203,8 @@ class Gem::Version
# series of digits or ASCII letters separated by dots.
def initialize version
- unless self.class.correct?(version)
- raise ArgumentError, "Malformed version number string #{version}"
- end
-
- # If version is an empty string convert it to 0
- version = 0 if version =~ /\A\s*\Z/
+ raise ArgumentError, "Malformed version number string #{version}" unless
+ self.class.correct?(version)
@version = version.to_s.strip.gsub("-",".pre.")
@segments = nil
@@ -222,14 +217,12 @@ class Gem::Version
# Pre-release (alpha) parts, e.g, 5.3.1.b.2 => 5.4, are ignored.
def bump
- @bump ||= begin
- segments = self.segments
- segments.pop while segments.any? { |s| String === s }
- segments.pop if segments.size > 1
-
- segments[-1] = segments[-1].succ
- self.class.new segments.join(".")
- end
+ segments = self.segments.dup
+ segments.pop while segments.any? { |s| String === s }
+ segments.pop if segments.size > 1
+
+ segments[-1] = segments[-1].succ
+ self.class.new segments.join(".")
end
##
@@ -237,11 +230,11 @@ class Gem::Version
# same precision. Version "1.0" is not the same as version "1".
def eql? other
- self.class === other and @version == other._version
+ self.class === other and @version == other.version
end
def hash # :nodoc:
- canonical_segments.hash
+ @hash ||= segments.hash
end
def init_with coder # :nodoc:
@@ -286,10 +279,7 @@ class Gem::Version
# A version is considered a prerelease if it contains a letter.
def prerelease?
- unless instance_variable_defined? :@prerelease
- @prerelease = !!(@version =~ /[a-zA-Z]/)
- end
- @prerelease
+ @prerelease ||= !!(@version =~ /[a-zA-Z]/)
end
def pretty_print q # :nodoc:
@@ -301,24 +291,28 @@ class Gem::Version
# Non-prerelease versions return themselves.
def release
- @release ||= if prerelease?
- segments = self.segments
- segments.pop while segments.any? { |s| String === s }
- self.class.new segments.join('.')
- else
- self
- end
+ return self unless prerelease?
+
+ segments = self.segments.dup
+ segments.pop while segments.any? { |s| String === s }
+ self.class.new segments.join('.')
end
def segments # :nodoc:
- _segments.dup
+
+ # segments is lazy so it can pick up version values that come from
+ # old marshaled versions, which don't go through marshal_load.
+
+ @segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
+ /^\d+$/ =~ s ? s.to_i : s
+ end
end
##
# A recommended version for use with a ~> Requirement.
def approximate_recommendation
- segments = self.segments
+ segments = self.segments.dup
segments.pop while segments.any? { |s| String === s }
segments.pop while segments.size > 2
@@ -335,10 +329,10 @@ class Gem::Version
def <=> other
return unless Gem::Version === other
- return 0 if @version == other._version || canonical_segments == other.canonical_segments
+ return 0 if @version == other.version
- lhsegments = _segments
- rhsegments = other._segments
+ lhsegments = segments
+ rhsegments = other.segments
lhsize = lhsegments.size
rhsize = rhsegments.size
@@ -359,34 +353,4 @@ class Gem::Version
return 0
end
-
- def canonical_segments
- @canonical_segments ||=
- _split_segments.map! do |segments|
- segments.reverse_each.drop_while {|s| s == 0 }.reverse
- end.reduce(&:concat)
- end
-
- protected
-
- def _version
- @version
- end
-
- def _segments
- # segments is lazy so it can pick up version values that come from
- # old marshaled versions, which don't go through marshal_load.
- # since this version object is cached in @@all, its @segments should be frozen
-
- @segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
- /^\d+$/ =~ s ? s.to_i : s
- end.freeze
- end
-
- def _split_segments
- string_start = _segments.index {|s| s.is_a?(String) }
- string_segments = segments
- numeric_segments = string_segments.slice!(0, string_start || string_segments.size)
- return numeric_segments, string_segments
- end
end
diff --git a/lib/rubygems/version_option.rb b/lib/rubygems/version_option.rb
index c4d3306652..a0755d5020 100644
--- a/lib/rubygems/version_option.rb
+++ b/lib/rubygems/version_option.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -58,12 +57,7 @@ module Gem::VersionOption
add_option('-v', '--version VERSION', Gem::Requirement,
"Specify version of gem to #{task}", *wrap) do
|value, options|
- # Allow handling for multiple --version operators
- if options[:version] && !options[:version].none?
- options[:version].concat([value])
- else
- options[:version] = value
- end
+ options[:version] = value
explicit_prerelease_set = !options[:explicit_prerelease].nil?
options[:explicit_prerelease] = false unless explicit_prerelease_set
diff --git a/lib/scanf.gemspec b/lib/scanf.gemspec
deleted file mode 100644
index 0e88535862..0000000000
--- a/lib/scanf.gemspec
+++ /dev/null
@@ -1,25 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "scanf"
- spec.version = "1.0.0"
- spec.date = '2017-12-11'
- spec.authors = ["David Alan Black"]
- spec.email = ['dblack@superlink.net']
-
- spec.summary = "scanf is an implementation of the C function scanf(3)."
- spec.description = "scanf is an implementation of the C function scanf(3)."
- spec.homepage = "https://github.com/ruby/scanf"
- spec.license = "BSD-2-Clause"
-
- spec.files = ["lib/scanf.rb"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
- spec.required_ruby_version = ">= 2.3.0"
-
- spec.add_development_dependency "bundler", "~> 1.14"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "test-unit"
-end
diff --git a/lib/scanf.rb b/lib/scanf.rb
index 27e815d494..b6c5287664 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# scanf for Ruby
#
#--
@@ -295,7 +294,7 @@ module Scanf
def extract_float(s)
return nil unless s &&! skip
- if /\A(?<sign>[-+]?)0[xX](?<frac>\.\h+|\h+(?:\.\h*)?)[pP](?<exp>[-+]?\d+)/ =~ s
+ if /\A(?<sign>[-+]?)0[xX](?<frac>\.\h+|\h+(?:\.\h*)?)[pP](?<exp>[-+]\d+)/ =~ s
f1, f2 = frac.split('.')
f = f1.hex
if f2
@@ -411,11 +410,11 @@ module Scanf
# %f
when /%\*?[aefgAEFG]/
- [ '([-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]?\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))', :extract_float ]
+ [ '([-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))', :extract_float ]
# %5f
when /%\*?(\d+)[aefgAEFG]/
- [ '(?=[-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]?\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))' +
+ [ '(?=[-+]?(?:0[xX](?:\.\h+|\h+(?:\.\h*)?)[pP][-+]\d+|\d+(?![\d.])|\d*\.\d*(?:[eE][-+]?\d+)?))' +
"(\\S{1,#{$1}})", :extract_float ]
# %5s
@@ -472,7 +471,8 @@ module Scanf
end
def width
- @spec_string[/%\*?(\d+)/, 1]&.to_i
+ w = @spec_string[/%\*?(\d+)/, 1]
+ w && w.to_i
end
def mid_match?
@@ -610,7 +610,7 @@ class IO
#
# See Scanf for details on creating a format string.
#
- # You will need to require 'scanf' to use IO#scanf.
+ # You will need to require 'scanf' to use use IO#scanf.
def scanf(str,&b) #:yield: current_match
return block_scanf(str,&b) if b
return [] unless str.size > 0
@@ -660,7 +660,7 @@ class IO
begin
seek(start_position + matched_so_far, IO::SEEK_SET)
- rescue Errno::ESPIPE, Errno::EINVAL
+ rescue Errno::ESPIPE
end
soak_up_spaces if fstr.last_spec && fstr.space
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index e2632457ff..29368ee431 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -1,16 +1,18 @@
-# -*- coding: us-ascii -*-
-# frozen_string_literal: true
+begin
+ require 'openssl'
+rescue LoadError
+end
# == Secure random number generator interface.
#
-# This library is an interface to secure random number generators which are
-# suitable for generating session keys in HTTP cookies, etc.
+# This library is an interface for secure random number generator which is
+# suitable for generating session key in HTTP cookies, etc.
#
# You can use this library in your application by requiring it:
#
# require 'securerandom'
#
-# It supports the following secure random number generators:
+# It supports following secure random number generators.
#
# * openssl
# * /dev/urandom
@@ -18,7 +20,7 @@
#
# === Examples
#
-# Generate random hexadecimal strings:
+# Hexadecimal string.
#
# require 'securerandom'
#
@@ -26,127 +28,116 @@
# p SecureRandom.hex(10) #=> "92b15d6c8dc4beb5f559"
# p SecureRandom.hex(13) #=> "39b290146bea6ce975c37cfc23"
#
-# Generate random base64 strings:
+# Base64 string.
#
# p SecureRandom.base64(10) #=> "EcmTPZwWRAozdA=="
# p SecureRandom.base64(10) #=> "KO1nIU+p9DKxGg=="
# p SecureRandom.base64(12) #=> "7kJSM/MzBJI+75j8"
#
-# Generate random binary strings:
+# Binary string.
#
# p SecureRandom.random_bytes(10) #=> "\016\t{\370g\310pbr\301"
# p SecureRandom.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337"
-#
-# Generate UUIDs:
-#
-# p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
-# p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
-#
-
module SecureRandom
- @rng_chooser = Mutex.new # :nodoc:
+ # SecureRandom.random_bytes generates a random binary string.
+ #
+ # The argument _n_ specifies the length of the result string.
+ #
+ # If _n_ is not specified or is nil, 16 is assumed.
+ # It may be larger in future.
+ #
+ # The result may contain any byte: "\x00" - "\xff".
+ #
+ # p SecureRandom.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
+ # p SecureRandom.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"
+ #
+ # If secure random number generator is not available,
+ # NotImplementedError is raised.
+ def self.random_bytes(n=nil)
+ n = n ? n.to_int : 16
- class << self
- def bytes(n)
- return gen_random(n)
+ if defined? OpenSSL::Random
+ @pid = 0 unless defined?(@pid)
+ pid = $$
+ unless @pid == pid
+ now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
+ ary = [now, @pid, pid]
+ OpenSSL::Random.random_add(ary.join("").to_s, 0.0)
+ @pid = pid
+ end
+ return OpenSSL::Random.random_bytes(n)
end
- def gen_random(n)
- ret = Random.urandom(1)
- if ret.nil?
- begin
- require 'openssl'
- rescue NoMethodError
- raise NotImplementedError, "No random device"
- else
- @rng_chooser.synchronize do
- class << self
- remove_method :gen_random
- alias gen_random gen_random_openssl
- public :gen_random
- end
+ if !defined?(@has_urandom) || @has_urandom
+ flags = File::RDONLY
+ flags |= File::NONBLOCK if defined? File::NONBLOCK
+ flags |= File::NOCTTY if defined? File::NOCTTY
+ begin
+ File.open("/dev/urandom", flags) {|f|
+ unless f.stat.chardev?
+ raise Errno::ENOENT
end
- return gen_random(n)
- end
- else
- @rng_chooser.synchronize do
- class << self
- remove_method :gen_random
- alias gen_random gen_random_urandom
- public :gen_random
+ @has_urandom = true
+ ret = f.read(n)
+ unless ret.length == n
+ raise NotImplementedError, "Unexpected partial read from random device: only #{ret.length} for #{n} bytes"
end
- end
- return gen_random(n)
+ return ret
+ }
+ rescue Errno::ENOENT
+ @has_urandom = false
end
end
- private
+ unless defined?(@has_win32)
+ begin
+ require 'Win32API'
- def gen_random_openssl(n)
- @pid = 0 unless defined?(@pid)
- pid = $$
- unless @pid == pid
- now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
- OpenSSL::Random.random_add([now, @pid, pid].join(""), 0.0)
- seed = Random.urandom(16)
- if (seed)
- OpenSSL::Random.random_add(seed, 16)
+ crypt_acquire_context = Win32API.new("advapi32", "CryptAcquireContext", 'PPPII', 'L')
+ @crypt_gen_random = Win32API.new("advapi32", "CryptGenRandom", 'VIP', 'L')
+
+ hProvStr = " " * DL::SIZEOF_VOIDP
+ prov_rsa_full = 1
+ crypt_verifycontext = 0xF0000000
+
+ if crypt_acquire_context.call(hProvStr, nil, nil, prov_rsa_full, crypt_verifycontext) == 0
+ raise SystemCallError, "CryptAcquireContext failed: #{lastWin32ErrorMessage}"
end
- @pid = pid
- end
- return OpenSSL::Random.random_bytes(n)
- end
+ type = DL::SIZEOF_VOIDP == DL::SIZEOF_LONG_LONG ? 'q' : 'l'
+ @hProv, = hProvStr.unpack(type)
- def gen_random_urandom(n)
- ret = Random.urandom(n)
- unless ret
- raise NotImplementedError, "No random device"
+ @has_win32 = true
+ rescue LoadError
+ @has_win32 = false
end
- unless ret.length == n
- raise NotImplementedError, "Unexpected partial read from random device: only #{ret.length} for #{n} bytes"
+ end
+ if @has_win32
+ bytes = " ".force_encoding("ASCII-8BIT") * n
+ if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
+ raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
end
- ret
+ return bytes
end
- end
-end
-
-module Random::Formatter
- # SecureRandom.random_bytes generates a random binary string.
- #
- # The argument _n_ specifies the length of the result string.
- #
- # If _n_ is not specified or is nil, 16 is assumed.
- # It may be larger in future.
- #
- # The result may contain any byte: "\x00" - "\xff".
- #
- # p SecureRandom.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
- # p SecureRandom.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"
- #
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
- def random_bytes(n=nil)
- n = n ? n.to_int : 16
- gen_random(n)
+ raise NotImplementedError, "No random device"
end
# SecureRandom.hex generates a random hexadecimal string.
#
# The argument _n_ specifies the length, in bytes, of the random number to be generated.
- # The length of the resulting hexadecimal string is twice of _n_.
+ # The length of the resulting hexadecimal string is twice _n_.
#
# If _n_ is not specified or is nil, 16 is assumed.
- # It may be larger in the future.
+ # It may be larger in future.
#
# The result may contain 0-9 and a-f.
#
# p SecureRandom.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
# p SecureRandom.hex #=> "91dc3bfb4de5b11d029d376634589b61"
#
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
- def hex(n=nil)
+ # If secure random number generator is not available,
+ # NotImplementedError is raised.
+ def self.hex(n=nil)
random_bytes(n).unpack("H*")[0]
end
@@ -156,19 +147,19 @@ module Random::Formatter
# to be generated. The length of the result string is about 4/3 of _n_.
#
# If _n_ is not specified or is nil, 16 is assumed.
- # It may be larger in the future.
+ # It may be larger in future.
#
# The result may contain A-Z, a-z, 0-9, "+", "/" and "=".
#
# p SecureRandom.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="
# p SecureRandom.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
#
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
+ # If secure random number generator is not available,
+ # NotImplementedError is raised.
#
# See RFC 3548 for the definition of base64.
- def base64(n=nil)
- [random_bytes(n)].pack("m0")
+ def self.base64(n=nil)
+ [random_bytes(n)].pack("m*").delete("\n")
end
# SecureRandom.urlsafe_base64 generates a random URL-safe base64 string.
@@ -177,7 +168,7 @@ module Random::Formatter
# to be generated. The length of the result string is about 4/3 of _n_.
#
# If _n_ is not specified or is nil, 16 is assumed.
- # It may be larger in the future.
+ # It may be larger in future.
#
# The boolean argument _padding_ specifies the padding.
# If it is false or nil, padding is not generated.
@@ -193,105 +184,91 @@ module Random::Formatter
# p SecureRandom.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
# p SecureRandom.urlsafe_base64(nil, true) #=> "-M8rLhr7JEpJlqFGUMmOxg=="
#
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
+ # If secure random number generator is not available,
+ # NotImplementedError is raised.
#
# See RFC 3548 for the definition of URL-safe base64.
- def urlsafe_base64(n=nil, padding=false)
- s = [random_bytes(n)].pack("m0")
+ def self.urlsafe_base64(n=nil, padding=false)
+ s = [random_bytes(n)].pack("m*")
+ s.delete!("\n")
s.tr!("+/", "-_")
s.delete!("=") unless padding
s
end
- # SecureRandom.uuid generates a random v4 UUID (Universally Unique IDentifier).
+ # SecureRandom.random_number generates a random number.
#
- # p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
- # p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
- # p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
+ # If a positive integer is given as _n_,
+ # SecureRandom.random_number returns an integer:
+ # 0 <= SecureRandom.random_number(n) < n.
#
- # The version 4 UUID is purely random (except the version).
- # It doesn't contain meaningful information such as MAC addresses, timestamps, etc.
+ # p SecureRandom.random_number(100) #=> 15
+ # p SecureRandom.random_number(100) #=> 88
#
- # The result contains 122 random bits (15.25 random bytes).
+ # If 0 is given or an argument is not given,
+ # SecureRandom.random_number returns a float:
+ # 0.0 <= SecureRandom.random_number() < 1.0.
#
- # See RFC 4122 for details of UUID.
+ # p SecureRandom.random_number #=> 0.596506046187744
+ # p SecureRandom.random_number #=> 0.350621695741409
#
- def uuid
- ary = random_bytes(16).unpack("NnnnnN")
- ary[2] = (ary[2] & 0x0fff) | 0x4000
- ary[3] = (ary[3] & 0x3fff) | 0x8000
- "%08x-%04x-%04x-%04x-%04x%08x" % ary
- end
-
- private def gen_random(n)
- self.bytes(n)
- end
-
- # SecureRandom.choose generates a string that randomly draws from a
- # source array of characters.
- #
- # The argument _source_ specifies the array of characters from which
- # to generate the string.
- # The argument _n_ specifies the length, in characters, of the string to be
- # generated.
- #
- # The result may contain whatever characters are in the source array.
- #
- # p SecureRandom.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron"
- # p SecureRandom.choose([*'0'..'9'], 5) #=> "27309"
- #
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
- private def choose(source, n)
- size = source.size
- m = 1
- limit = size
- while limit * size <= 0x100000000
- limit *= size
- m += 1
- end
- result = ''.dup
- while m <= n
- rs = random_number(limit)
- is = rs.digits(size)
- (m-is.length).times { is << 0 }
- result << source.values_at(*is).join('')
- n -= m
- end
+ def self.random_number(n=0)
if 0 < n
- rs = random_number(limit)
- is = rs.digits(size)
- if is.length < n
- (n-is.length).times { is << 0 }
+ if defined? OpenSSL::BN
+ OpenSSL::BN.rand_range(n).to_i
else
- is.pop while n < is.length
+ hex = n.to_s(16)
+ hex = '0' + hex if (hex.length & 1) == 1
+ bin = [hex].pack("H*")
+ mask = bin[0].ord
+ mask |= mask >> 1
+ mask |= mask >> 2
+ mask |= mask >> 4
+ begin
+ rnd = SecureRandom.random_bytes(bin.length)
+ rnd[0] = (rnd[0].ord & mask).chr
+ end until rnd < bin
+ rnd.unpack("H*")[0].hex
end
- result.concat source.values_at(*is).join('')
+ else
+ # assumption: Float::MANT_DIG <= 64
+ if defined? OpenSSL::BN
+ i64 = OpenSSL::BN.rand(64, -1).to_i
+ else
+ i64 = SecureRandom.random_bytes(8).unpack("Q")[0]
+ end
+ Math.ldexp(i64 >> (64-Float::MANT_DIG), -Float::MANT_DIG)
end
- result
end
- ALPHANUMERIC = [*'A'..'Z', *'a'..'z', *'0'..'9']
- # SecureRandom.alphanumeric generates a random alphanumeric string.
- #
- # The argument _n_ specifies the length, in characters, of the alphanumeric
- # string to be generated.
+ # SecureRandom.uuid generates a v4 random UUID (Universally Unique IDentifier).
#
- # If _n_ is not specified or is nil, 16 is assumed.
- # It may be larger in the future.
+ # p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
+ # p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
+ # p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
#
- # The result may contain A-Z, a-z and 0-9.
+ # The version 4 UUID is purely random (except the version).
+ # It doesn't contain meaningful information such as MAC address, time, etc.
#
- # p SecureRandom.alphanumeric #=> "2BuBuLf3WfSKyQbR"
- # p SecureRandom.alphanumeric(10) #=> "i6K93NdqiH"
+ # See RFC 4122 for details of UUID.
#
- # If a secure random number generator is not available,
- # +NotImplementedError+ is raised.
- def alphanumeric(n=nil)
- n = 16 if n.nil?
- choose(ALPHANUMERIC, n)
+ def self.uuid
+ ary = self.random_bytes(16).unpack("NnnnnN")
+ ary[2] = (ary[2] & 0x0fff) | 0x4000
+ ary[3] = (ary[3] & 0x3fff) | 0x8000
+ "%08x-%04x-%04x-%04x-%04x%08x" % ary
end
-end
-SecureRandom.extend(Random::Formatter)
+ # Following code is based on David Garamond's GUID library for Ruby.
+ def self.lastWin32ErrorMessage # :nodoc:
+ get_last_error = Win32API.new("kernel32", "GetLastError", '', 'L')
+ format_message = Win32API.new("kernel32", "FormatMessageA", 'LPLLPLPPPPPPPP', 'L')
+ format_message_ignore_inserts = 0x00000200
+ format_message_from_system = 0x00001000
+
+ code = get_last_error.call
+ msg = "\0" * 1024
+ len = format_message.call(format_message_ignore_inserts + format_message_from_system, 0, code, 0, msg, 1024, nil, nil, nil, nil, nil, nil, nil, nil)
+ msg[0, len].force_encoding("filesystem").tr("\r", '').chomp
+ end
+end
diff --git a/lib/set.rb b/lib/set.rb
index 9642e74af4..f00cfac0c5 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -1,9 +1,7 @@
#--
-# frozen_string_literal: true
-#
# set.rb - defines the Set class
#++
-# Copyright (c) 2002-2016 Akinori MUSHA <knu@iDaemons.org>
+# Copyright (c) 2002-2013 Akinori MUSHA <knu@iDaemons.org>
#
# Documentation by Akinori MUSHA and Gavin Sinclair.
#
@@ -37,8 +35,7 @@
# Set uses Hash as storage, so you must note the following points:
#
# * Equality of elements is determined according to Object#eql? and
-# Object#hash. Use Set#compare_by_identity to make a set compare
-# its elements by their identity.
+# Object#hash.
# * Set assumes that the identity of each element does not change
# while it is stored. Modifying an element of a set will render the
# set to an unreliable state.
@@ -47,21 +44,21 @@
#
# == Comparison
#
-# The comparison operators <, >, <=, and >= are implemented as
+# The comparison operators <, >, <= and >= are implemented as
# shorthand for the {proper_,}{subset?,superset?} methods. However,
# the <=> operator is intentionally left out because not every pair of
-# sets is comparable ({x, y} vs. {x, z} for example).
+# sets is comparable. ({x,y} vs. {x,z} for example)
#
# == Example
#
# require 'set'
-# s1 = Set[1, 2] #=> #<Set: {1, 2}>
-# s2 = [1, 2].to_set #=> #<Set: {1, 2}>
-# s1 == s2 #=> true
-# s1.add("foo") #=> #<Set: {1, 2, "foo"}>
-# s1.merge([2, 6]) #=> #<Set: {1, 2, "foo", 6}>
-# s1.subset?(s2) #=> false
-# s2.subset?(s1) #=> true
+# s1 = Set.new [1, 2] # -> #<Set: {1, 2}>
+# s2 = [1, 2].to_set # -> #<Set: {1, 2}>
+# s1 == s2 # -> true
+# s1.add("foo") # -> #<Set: {1, 2, "foo"}>
+# s1.merge([2, 6]) # -> #<Set: {1, 2, "foo", 6}>
+# s1.subset? s2 # -> false
+# s2.subset? s1 # -> true
#
# == Contact
#
@@ -71,10 +68,6 @@ class Set
include Enumerable
# Creates a new set containing the given objects.
- #
- # Set[1, 2] # => #<Set: {1, 2}>
- # Set[1, 2, 1] # => #<Set: {1, 2}>
- # Set[1, 'c', :s] # => #<Set: {1, "c", :s}>
def self.[](*ary)
new(ary)
end
@@ -84,14 +77,8 @@ class Set
#
# If a block is given, the elements of enum are preprocessed by the
# given block.
- #
- # Set.new([1, 2]) #=> #<Set: {1, 2}>
- # Set.new([1, 2, 1]) #=> #<Set: {1, 2}>
- # Set.new([1, 'c', :s]) #=> #<Set: {1, "c", :s}>
- # Set.new(1..5) #=> #<Set: {1, 2, 3, 4, 5}>
- # Set.new([1, 2, 3]) { |x| x * x } #=> #<Set: {1, 4, 9}>
def initialize(enum = nil, &block) # :yields: o
- @hash ||= Hash.new(false)
+ @hash ||= Hash.new
enum.nil? and return
@@ -102,23 +89,6 @@ class Set
end
end
- # Makes the set compare its elements by their identity and returns
- # self. This method may not be supported by all subclasses of Set.
- def compare_by_identity
- if @hash.respond_to?(:compare_by_identity)
- @hash.compare_by_identity
- self
- else
- raise NotImplementedError, "#{self.class.name}\##{__method__} is not implemented"
- end
- end
-
- # Returns true if the set will compare its elements by their
- # identity. Also see Set#compare_by_identity.
- def compare_by_identity?
- @hash.respond_to?(:compare_by_identity?) && @hash.compare_by_identity?
- end
-
def do_with_enum(enum, &block) # :nodoc:
if enum.respond_to?(:each_entry)
enum.each_entry(&block) if block
@@ -169,10 +139,6 @@ class Set
end
# Removes all elements and returns self.
- #
- # set = Set[1, 'c', :s] #=> #<Set: {1, "c", :s}>
- # set.clear #=> #<Set: {}>
- # set #=> #<Set: {}>
def clear
@hash.clear
self
@@ -180,25 +146,18 @@ class Set
# Replaces the contents of the set with the contents of the given
# enumerable object and returns self.
- #
- # set = Set[1, 'c', :s] #=> #<Set: {1, "c", :s}>
- # set.replace([1, 2]) #=> #<Set: {1, 2}>
- # set #=> #<Set: {1, 2}>
def replace(enum)
if enum.instance_of?(self.class)
@hash.replace(enum.instance_variable_get(:@hash))
self
else
- do_with_enum(enum) # make sure enum is enumerable before calling clear
+ do_with_enum(enum)
clear
merge(enum)
end
end
# Converts the set to an array. The order of elements is uncertain.
- #
- # Set[1, 2].to_a #=> [1, 2]
- # Set[1, 'c', :s].to_a #=> [1, "c", :s]
def to_a
@hash.keys
end
@@ -241,77 +200,59 @@ class Set
# Equivalent to Set#flatten, but replaces the receiver with the
# result in place. Returns nil if no modifications were made.
def flatten!
- replace(flatten()) if any? { |e| e.is_a?(Set) }
+ if detect { |e| e.is_a?(Set) }
+ replace(flatten())
+ else
+ nil
+ end
end
# Returns true if the set contains the given object.
- #
- # 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?
def include?(o)
- @hash[o]
+ @hash.include?(o)
end
alias member? include?
# Returns true if the set is a superset of the given set.
def superset?(set)
- case
- when set.instance_of?(self.class) && @hash.respond_to?(:>=)
- @hash >= set.instance_variable_get(:@hash)
- when set.is_a?(Set)
- size >= set.size && set.all? { |o| include?(o) }
- else
- raise ArgumentError, "value must be a set"
- end
+ set.is_a?(Set) or raise ArgumentError, "value must be a set"
+ return false if size < set.size
+ set.all? { |o| include?(o) }
end
alias >= superset?
# Returns true if the set is a proper superset of the given set.
def proper_superset?(set)
- case
- when set.instance_of?(self.class) && @hash.respond_to?(:>)
- @hash > set.instance_variable_get(:@hash)
- when set.is_a?(Set)
- size > set.size && set.all? { |o| include?(o) }
- else
- raise ArgumentError, "value must be a set"
- end
+ set.is_a?(Set) or raise ArgumentError, "value must be a set"
+ return false if size <= set.size
+ set.all? { |o| include?(o) }
end
alias > proper_superset?
# Returns true if the set is a subset of the given set.
def subset?(set)
- case
- when set.instance_of?(self.class) && @hash.respond_to?(:<=)
- @hash <= set.instance_variable_get(:@hash)
- when set.is_a?(Set)
- size <= set.size && all? { |o| set.include?(o) }
- else
- raise ArgumentError, "value must be a set"
- end
+ set.is_a?(Set) or raise ArgumentError, "value must be a set"
+ return false if set.size < size
+ all? { |o| set.include?(o) }
end
alias <= subset?
# Returns true if the set is a proper subset of the given set.
def proper_subset?(set)
- case
- when set.instance_of?(self.class) && @hash.respond_to?(:<)
- @hash < set.instance_variable_get(:@hash)
- when set.is_a?(Set)
- size < set.size && all? { |o| set.include?(o) }
- else
- raise ArgumentError, "value must be a set"
- end
+ set.is_a?(Set) or raise ArgumentError, "value must be a set"
+ return false if set.size <= size
+ all? { |o| set.include?(o) }
end
alias < proper_subset?
# Returns true if the set and the given set have at least one
# element in common.
#
- # Set[1, 2, 3].intersect? Set[4, 5] #=> false
- # Set[1, 2, 3].intersect? Set[3, 4] #=> true
+ # e.g.:
+ #
+ # require 'set'
+ # Set[1, 2, 3].intersect? Set[4, 5] # => false
+ # Set[1, 2, 3].intersect? Set[3, 4] # => true
def intersect?(set)
set.is_a?(Set) or raise ArgumentError, "value must be a set"
if size < set.size
@@ -324,8 +265,12 @@ class Set
# Returns true if the set and the given set have no element in
# common. This method is the opposite of +intersect?+.
#
- # Set[1, 2, 3].disjoint? Set[3, 4] #=> false
- # Set[1, 2, 3].disjoint? Set[4, 5] #=> true
+ # e.g.:
+ #
+ # require 'set'
+ # Set[1, 2, 3].disjoint? Set[3, 4] # => false
+ # Set[1, 2, 3].disjoint? Set[4, 5] # => true
+
def disjoint?(set)
!intersect?(set)
end
@@ -334,17 +279,13 @@ class Set
# the element as parameter. Returns an enumerator if no block is
# given.
def each(&block)
- block or return enum_for(__method__) { size }
+ block or return enum_for(__method__)
@hash.each_key(&block)
self
end
# Adds the given object to the set and returns self. Use +merge+ to
# add many elements at once.
- #
- # Set[1, 2].add(3) #=> #<Set: {1, 2, 3}>
- # Set[1, 2].add([3, 4]) #=> #<Set: {1, 2, [3, 4]}>
- # Set[1, 2].add(2) #=> #<Set: {1, 2}>
def add(o)
@hash[o] = true
self
@@ -353,12 +294,12 @@ class Set
# Adds the given object to the set and returns self. If the
# object is already in the set, returns nil.
- #
- # Set[1, 2].add?(3) #=> #<Set: {1, 2, 3}>
- # Set[1, 2].add?([3, 4]) #=> #<Set: {1, 2, [3, 4]}>
- # Set[1, 2].add?(2) #=> nil
def add?(o)
- add(o) unless include?(o)
+ if include?(o)
+ nil
+ else
+ add(o)
+ end
end
# Deletes the given object from the set and returns self. Use +subtract+ to
@@ -371,14 +312,17 @@ class Set
# Deletes the given object from the set and returns self. If the
# object is not in the set, returns nil.
def delete?(o)
- delete(o) if include?(o)
+ if include?(o)
+ delete(o)
+ else
+ nil
+ end
end
# Deletes every element of the set for which block evaluates to
- # true, and returns self. Returns an enumerator if no block is
- # given.
+ # true, and returns self.
def delete_if
- block_given? or return enum_for(__method__) { size }
+ block_given? or return enum_for(__method__)
# @hash.delete_if should be faster, but using it breaks the order
# of enumeration in subclasses.
select { |o| yield o }.each { |o| @hash.delete(o) }
@@ -386,10 +330,9 @@ class Set
end
# Deletes every element of the set for which block evaluates to
- # false, and returns self. Returns an enumerator if no block is
- # given.
+ # false, and returns self.
def keep_if
- block_given? or return enum_for(__method__) { size }
+ block_given? or return enum_for(__method__)
# @hash.keep_if should be faster, but using it breaks the order of
# enumeration in subclasses.
reject { |o| yield o }.each { |o| @hash.delete(o) }
@@ -397,9 +340,8 @@ class Set
end
# Replaces the elements with ones returned by collect().
- # Returns an enumerator if no block is given.
def collect!
- block_given? or return enum_for(__method__) { size }
+ block_given? or return enum_for(__method__)
set = self.class.new
each { |o| set << yield(o) }
replace(set)
@@ -407,21 +349,21 @@ class Set
alias map! collect!
# Equivalent to Set#delete_if, but returns nil if no changes were
- # made. Returns an enumerator if no block is given.
+ # made.
def reject!(&block)
- block or return enum_for(__method__) { size }
+ block or return enum_for(__method__)
n = size
delete_if(&block)
- self if size != n
+ size == n ? nil : self
end
# Equivalent to Set#keep_if, but returns nil if no changes were
- # made. Returns an enumerator if no block is given.
+ # made.
def select!(&block)
- block or return enum_for(__method__) { size }
+ block or return enum_for(__method__)
n = size
keep_if(&block)
- self if size != n
+ size == n ? nil : self
end
# Merges the elements of the given enumerable object to the set and
@@ -445,56 +387,39 @@ class Set
# Returns a new set built by merging the set and the elements of the
# given enumerable object.
- #
- # Set[1, 2, 3] | Set[2, 4, 5] #=> #<Set: {1, 2, 3, 4, 5}>
- # Set[1, 5, 'z'] | (1..6) #=> #<Set: {1, 5, "z", 2, 3, 4, 6}>
def |(enum)
dup.merge(enum)
end
- alias + |
- alias union |
+ alias + | ##
+ alias union | ##
# Returns a new set built by duplicating the set, removing every
# element that appears in the given enumerable object.
- #
- # Set[1, 3, 5] - Set[1, 5] #=> #<Set: {3}>
- # Set['a', 'b', 'z'] - ['a', 'c'] #=> #<Set: {"b", "z"}>
def -(enum)
dup.subtract(enum)
end
- alias difference -
+ alias difference - ##
# Returns a new set containing elements common to the set and the
# given enumerable object.
- #
- # Set[1, 3, 5] & Set[3, 2, 1] #=> #<Set: {3, 1}>
- # Set['a', 'b', 'z'] & ['a', 'b', 'c'] #=> #<Set: {"a", "b"}>
def &(enum)
n = self.class.new
do_with_enum(enum) { |o| n.add(o) if include?(o) }
n
end
- alias intersection &
+ alias intersection & ##
# Returns a new set containing elements exclusive between the set
# and the given enumerable object. (set ^ enum) is equivalent to
# ((set | enum) - (set & enum)).
- #
- # Set[1, 2] ^ Set[2, 3] #=> #<Set: {3, 1}>
- # Set[1, 'b', 'c'] ^ ['b', 'd'] #=> #<Set: {"d", 1, "c"}>
def ^(enum)
n = Set.new(enum)
- each { |o| n.add(o) unless n.delete?(o) }
+ each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }
n
end
# Returns true if two sets are equal. The equality of each couple
# of elements is defined according to Object#eql?.
- #
- # Set[1, 2] == Set[2, 1] #=> true
- # Set[1, 3, 5] == Set[1, 5] #=> false
- # Set['a', 'b', 'c'] == Set['a', 'c', 'b'] #=> true
- # Set['a', 'b', 'c'] == ['a', 'c', 'b'] #=> false
def ==(other)
if self.equal?(other)
true
@@ -516,61 +441,27 @@ class Set
@hash.eql?(o.instance_variable_get(:@hash))
end
- # Resets the internal state after modification to existing elements
- # and returns self.
- #
- # Elements will be reindexed and deduplicated.
- def reset
- if @hash.respond_to?(:rehash)
- @hash.rehash # This should perform frozenness check.
- else
- raise "can't modify frozen #{self.class.name}" if frozen?
- end
- self
- end
-
- # Returns true if the given object is a member of the set,
- # and false otherwise.
- #
- # Used in case statements:
- #
- # require 'set'
- #
- # case :apple
- # when Set[:potato, :carrot]
- # "vegetable"
- # when Set[:apple, :banana]
- # "fruit"
- # end
- # # => "fruit"
- #
- # Or by itself:
- #
- # Set[1, 2, 3] === 2 #=> true
- # Set[1, 2, 3] === 4 #=> false
- #
- alias === include?
-
# Classifies the set by the return value of the given block and
# returns a hash of {value => set of elements} pairs. The block is
# called once for each element of the set, passing the element as
# parameter.
#
+ # e.g.:
+ #
# require 'set'
# files = Set.new(Dir.glob("*.rb"))
# hash = files.classify { |f| File.mtime(f).year }
- # hash #=> {2000=>#<Set: {"a.rb", "b.rb"}>,
- # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
- # # 2002=>#<Set: {"f.rb"}>}
- #
- # Returns an enumerator if no block is given.
+ # p hash # => {2000=>#<Set: {"a.rb", "b.rb"}>,
+ # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
+ # # 2002=>#<Set: {"f.rb"}>}
def classify # :yields: o
- block_given? or return enum_for(__method__) { size }
+ block_given? or return enum_for(__method__)
h = {}
each { |i|
- (h[yield(i)] ||= self.class.new).add(i)
+ x = yield(i)
+ (h[x] ||= self.class.new).add(i)
}
h
@@ -583,17 +474,17 @@ class Set
# if block.call(o1, o2) is true. Otherwise, elements o1 and o2 are
# in common if block.call(o1) == block.call(o2).
#
+ # e.g.:
+ #
# require 'set'
# numbers = Set[1, 3, 4, 6, 9, 10, 11]
# set = numbers.divide { |i,j| (i - j).abs == 1 }
- # set #=> #<Set: {#<Set: {1}>,
- # # #<Set: {11, 9, 10}>,
- # # #<Set: {3, 4}>,
- # # #<Set: {6}>}>
- #
- # Returns an enumerator if no block is given.
+ # p set # => #<Set: {#<Set: {1}>,
+ # # #<Set: {11, 9, 10}>,
+ # # #<Set: {3, 4}>,
+ # # #<Set: {6}>}>
def divide(&func)
- func or return enum_for(__method__) { size }
+ func or return enum_for(__method__)
if func.arity == 2
require 'tsort'
@@ -625,7 +516,7 @@ class Set
InspectKey = :__inspect_key__ # :nodoc:
# Returns a string containing a human-readable representation of the
- # set ("#<Set: {element1, element2, ...}>").
+ # set. ("#<Set: {element1, element2, ...}>")
def inspect
ids = (Thread.current[InspectKey] ||= [])
@@ -633,16 +524,14 @@ class Set
return sprintf('#<%s: {...}>', self.class.name)
end
- ids << object_id
begin
+ ids << object_id
return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2])
ensure
ids.pop
end
end
- alias to_s inspect
-
def pretty_print(pp) # :nodoc:
pp.text sprintf('#<%s: {', self.class.name)
pp.nest(1) {
@@ -689,7 +578,6 @@ end
#
class SortedSet < Set
@@setup = false
- @@mutex = Mutex.new
class << self
def [](*ary) # :nodoc:
@@ -699,103 +587,94 @@ class SortedSet < Set
def setup # :nodoc:
@@setup and return
- @@mutex.synchronize do
+ module_eval {
# a hack to shut up warning
- alias_method :old_init, :initialize
-
- begin
- require 'rbtree'
-
- module_eval <<-END, __FILE__, __LINE__+1
- def initialize(*args)
- @hash = RBTree.new
- super
- end
-
- def add(o)
- o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
- super
- end
- alias << add
- END
- rescue LoadError
- module_eval <<-END, __FILE__, __LINE__+1
- def initialize(*args)
- @keys = nil
- super
- end
-
- def clear
- @keys = nil
- super
- end
-
- def replace(enum)
- @keys = nil
- super
- end
-
- def add(o)
- o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
- @keys = nil
- super
- end
- alias << add
-
- def delete(o)
- @keys = nil
- @hash.delete(o)
- self
- end
-
- def delete_if
- block_given? or return enum_for(__method__) { size }
- n = @hash.size
- super
- @keys = nil if @hash.size != n
- self
- end
-
- def keep_if
- block_given? or return enum_for(__method__) { size }
- n = @hash.size
- super
- @keys = nil if @hash.size != n
- self
- end
-
- def merge(enum)
- @keys = nil
- super
- end
-
- def each(&block)
- block or return enum_for(__method__) { size }
- to_a.each(&block)
- self
- end
-
- def to_a
- (@keys = @hash.keys).sort! unless @keys
- @keys
- end
-
- def freeze
- to_a
- super
- end
-
- def rehash
- @keys = nil
- super
- end
- END
- end
+ alias old_init initialize
+ }
+ begin
+ require 'rbtree'
+
+ module_eval <<-END, __FILE__, __LINE__+1
+ def initialize(*args)
+ @hash = RBTree.new
+ super
+ end
+
+ def add(o)
+ o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
+ super
+ end
+ alias << add
+ END
+ rescue LoadError
+ module_eval <<-END, __FILE__, __LINE__+1
+ def initialize(*args)
+ @keys = nil
+ super
+ end
+
+ def clear
+ @keys = nil
+ super
+ end
+
+ def replace(enum)
+ @keys = nil
+ super
+ end
+
+ def add(o)
+ o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
+ @keys = nil
+ super
+ end
+ alias << add
+
+ def delete(o)
+ @keys = nil
+ @hash.delete(o)
+ self
+ end
+
+ def delete_if
+ block_given? or return enum_for(__method__)
+ n = @hash.size
+ super
+ @keys = nil if @hash.size != n
+ self
+ end
+
+ def keep_if
+ block_given? or return enum_for(__method__)
+ n = @hash.size
+ super
+ @keys = nil if @hash.size != n
+ self
+ end
+
+ def merge(enum)
+ @keys = nil
+ super
+ end
+
+ def each(&block)
+ block or return enum_for(__method__)
+ to_a.each(&block)
+ self
+ end
+
+ def to_a
+ (@keys = @hash.keys).sort! unless @keys
+ @keys
+ end
+ END
+ end
+ module_eval {
# a hack to shut up warning
remove_method :old_init
+ }
- @@setup = true
- end
+ @@setup = true
end
end
diff --git a/lib/shell.rb b/lib/shell.rb
index fb63717391..db2d687908 100644
--- a/lib/shell.rb
+++ b/lib/shell.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell.rb -
# $Release Version: 0.7 $
@@ -12,6 +11,8 @@
require "e2mmap"
+require "thread" unless defined?(Mutex)
+
require "forwardable"
require "shell/error"
@@ -98,15 +99,12 @@ class Shell
@debug_display_process_id = false
@debug_display_thread_id = true
- @debug_output_mutex = Thread::Mutex.new
- @default_system_path = nil
- @default_record_separator = nil
+ @debug_output_mutex = Mutex.new
class << Shell
extend Forwardable
- attr_accessor :cascade, :verbose
- attr_reader :debug
+ attr_accessor :cascade, :debug, :verbose
alias debug? debug
alias verbose? verbose
@@ -169,7 +167,7 @@ class Shell
end
# os resource mutex
- mutex_methods = ["unlock", "lock", "locked?", "synchronize", "try_lock"]
+ mutex_methods = ["unlock", "lock", "locked?", "synchronize", "try_lock", "exclusive_unlock"]
for m in mutex_methods
def_delegator("@debug_output_mutex", m, "debug_output_"+m.to_s)
end
@@ -211,8 +209,7 @@ class Shell
# Returns the umask
attr_accessor :umask
attr_accessor :record_separator
- attr_accessor :verbose
- attr_reader :debug
+ attr_accessor :verbose, :debug
def debug=(val)
@debug = val
diff --git a/lib/shell/builtin-command.rb b/lib/shell/builtin-command.rb
index e419a68c33..80a0ce5534 100644
--- a/lib/shell/builtin-command.rb
+++ b/lib/shell/builtin-command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/builtin-command.rb -
# $Release Version: 0.7 $
@@ -13,7 +12,7 @@
require "shell/filter"
class Shell
- class BuiltInCommand < Filter
+ class BuiltInCommand<Filter
def wait?
false
end
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb
index b52cb0043f..13bc50c3fe 100644
--- a/lib/shell/command-processor.rb
+++ b/lib/shell/command-processor.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/command-controller.rb -
# $Release Version: 0.7 $
@@ -11,6 +10,7 @@
#
require "e2mmap"
+require "thread"
require "shell/error"
require "shell/filter"
@@ -53,9 +53,8 @@ class Shell
# include run file.
#
def self.run_config
- rc = "~/.rb_shell"
begin
- load File.expand_path(rc) if ENV.key?("HOME")
+ load File.expand_path("~/.rb_shell") if ENV.key?("HOME")
rescue LoadError, Errno::ENOENT
rescue
print "load error: #{rc}\n"
diff --git a/lib/shell/error.rb b/lib/shell/error.rb
index 677c424baf..2701338b5a 100644
--- a/lib/shell/error.rb
+++ b/lib/shell/error.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/error.rb -
# $Release Version: 0.7 $
diff --git a/lib/shell/filter.rb b/lib/shell/filter.rb
index caa976ae3e..9fae07d23e 100644
--- a/lib/shell/filter.rb
+++ b/lib/shell/filter.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/filter.rb -
# $Release Version: 0.7 $
@@ -47,7 +46,7 @@ class Shell #:nodoc:
#
# Inputs from +source+, which is either a string of a file name or an IO
# object.
- def <(src)
+ def < (src)
case src
when String
cat = Cat.new(@shell, src)
@@ -56,7 +55,7 @@ class Shell #:nodoc:
self.input = src
self
else
- Shell.Fail Error::CantApplyMethod, "<", src.class
+ Shell.Fail Error::CantApplyMethod, "<", to.class
end
end
@@ -65,7 +64,7 @@ class Shell #:nodoc:
#
# Outputs from +source+, which is either a string of a file name or an IO
# object.
- def >(to)
+ def > (to)
case to
when String
dst = @shell.open(to, "w")
@@ -87,7 +86,7 @@ class Shell #:nodoc:
#
# Appends the output to +source+, which is either a string of a file name
# or an IO object.
- def >>(to)
+ def >> (to)
begin
Shell.cd(@shell.pwd).append(to, self)
rescue CantApplyMethod
@@ -99,7 +98,7 @@ class Shell #:nodoc:
# | filter
#
# Processes a pipeline.
- def |(filter)
+ def | (filter)
filter.input = self
if active?
@shell.process_controller.start_job filter
@@ -111,7 +110,7 @@ class Shell #:nodoc:
# filter1 + filter2
#
# Outputs +filter1+, and then +filter2+ using Join.new
- def +(filter)
+ def + (filter)
Join.new(@shell, self, filter)
end
diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb
index d54da68cb0..d0cad0ec05 100644
--- a/lib/shell/process-controller.rb
+++ b/lib/shell/process-controller.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/process-controller.rb -
# $Release Version: 0.7 $
@@ -10,17 +9,19 @@
#
#
require "forwardable"
+
+require "thread"
require "sync"
class Shell
class ProcessController
@ProcessControllers = {}
- @ProcessControllersMonitor = Thread::Mutex.new
- @ProcessControllersCV = Thread::ConditionVariable.new
+ @ProcessControllersMonitor = Mutex.new
+ @ProcessControllersCV = ConditionVariable.new
- @BlockOutputMonitor = Thread::Mutex.new
- @BlockOutputCV = Thread::ConditionVariable.new
+ @BlockOutputMonitor = Mutex.new
+ @BlockOutputCV = ConditionVariable.new
class << self
extend Forwardable
@@ -95,8 +96,8 @@ class Shell
@active_jobs = []
@jobs_sync = Sync.new
- @job_monitor = Thread::Mutex.new
- @job_condition = Thread::ConditionVariable.new
+ @job_monitor = Mutex.new
+ @job_condition = ConditionVariable.new
end
attr_reader :shell
@@ -236,8 +237,8 @@ class Shell
pid = nil
- pid_mutex = Thread::Mutex.new
- pid_cv = Thread::ConditionVariable.new
+ pid_mutex = Mutex.new
+ pid_cv = ConditionVariable.new
Thread.start do
ProcessController.block_output_synchronize do
@@ -258,7 +259,7 @@ class Shell
ObjectSpace.each_object(IO) do |io|
if ![STDIN, STDOUT, STDERR].include?(io)
- io.close
+ io.close unless io.closed?
end
end
diff --git a/lib/shell/system-command.rb b/lib/shell/system-command.rb
index af22ed90d7..1fe37333d6 100644
--- a/lib/shell/system-command.rb
+++ b/lib/shell/system-command.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# shell/system-command.rb -
# $Release Version: 0.7 $
@@ -16,13 +15,13 @@ class Shell
class SystemCommand < Filter
def initialize(sh, command, *opts)
if t = opts.find{|opt| !opt.kind_of?(String) && opt.class}
- Shell.Fail TypeError, t.class, "String"
+ Shell.Fail Error::TypeError, t.class, "String"
end
super(sh)
@command = command
@opts = opts
- @input_queue = Thread::Queue.new
+ @input_queue = Queue.new
@pid = nil
sh.process_controller.add_schedule(self)
diff --git a/lib/shell/version.rb b/lib/shell/version.rb
index bb4e7dfb8e..2568627e2b 100644
--- a/lib/shell/version.rb
+++ b/lib/shell/version.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# version.rb - shell version definition file
# $Release Version: 0.7$
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index eb5fa2d226..2b72750a6b 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -1,4 +1,3 @@
-# frozen-string-literal: true
##
# == Manipulates strings like the UNIX Bourne shell
#
@@ -6,8 +5,7 @@
# of the UNIX Bourne shell.
#
# The shellwords() function was originally a port of shellwords.pl,
-# but modified to conform to the Shell & Utilities volume of the IEEE
-# Std 1003.1-2008, 2016 Edition [1].
+# but modified to conform to POSIX / SUSv3 (IEEE Std 1003.1-2001 [1]).
#
# === Usage
#
@@ -56,7 +54,7 @@
#
# === Resources
#
-# 1: {IEEE Std 1003.1-2008, 2016 Edition, the Shell & Utilities volume}[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html]
+# 1: {IEEE Std 1003.1-2004}[http://pubs.opengroup.org/onlinepubs/009695399/toc.htm]
module Shellwords
# Splits a string into an array of tokens in the same way the UNIX
@@ -65,34 +63,20 @@ module Shellwords
# argv = Shellwords.split('here are "two words"')
# argv #=> ["here", "are", "two words"]
#
- # Note, however, that this is not a command line parser. Shell
- # metacharacters except for the single and double quotes and
- # backslash are not treated as such.
- #
- # argv = Shellwords.split('ruby my_prog.rb | less')
- # argv #=> ["ruby", "my_prog.rb", "|", "less"]
- #
# String#shellsplit is a shortcut for this function.
#
# argv = 'here are "two words"'.shellsplit
# argv #=> ["here", "are", "two words"]
def shellsplit(line)
words = []
- field = String.new
+ field = ''
line.scan(/\G\s*(?>([^\s\\\'\"]+)|'([^\']*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|\z)?/m) do
|word, sq, dq, esc, garbage, sep|
raise ArgumentError, "Unmatched double quote: #{line.inspect}" if garbage
- # 2.2.3 Double-Quotes:
- #
- # The <backslash> shall retain its special meaning as an
- # escape character only when followed by one of the following
- # characters when considered special:
- #
- # $ ` " \ <newline>
- field << (word || sq || (dq && dq.gsub(/\\([$`"\\\n])/, '\\1')) || esc.gsub(/\\(.)/, '\\1'))
+ field << (word || sq || (dq || esc).gsub(/\\(.)/, '\\1'))
if sep
words << field
- field = String.new
+ field = ''
end
end
words
@@ -140,7 +124,7 @@ module Shellwords
str = str.to_s
# An empty argument will be skipped, so return empty quotes.
- return "''".dup if str.empty?
+ return "''" if str.empty?
str = str.dup
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 368febc74d..be1f7ff6ca 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+require 'thread'
# The Singleton module implements the Singleton pattern.
#
@@ -132,7 +132,7 @@ module Singleton
def __init__(klass) # :nodoc:
klass.instance_eval {
@singleton__instance__ = nil
- @singleton__mutex__ = Thread::Mutex.new
+ @singleton__mutex__ = Mutex.new
}
def klass.instance # :nodoc:
return @singleton__instance__ if @singleton__instance__
diff --git a/lib/sync.rb b/lib/sync.rb
index 40a48ac985..09542d59f9 100644
--- a/lib/sync.rb
+++ b/lib/sync.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# sync.rb - 2 phase lock with counter
# $Release Version: 1.0$
@@ -68,7 +67,7 @@ module Sync_m
Message = "Unknown lock mode(%s)"
def LockModeFailer.Fail(mode)
if mode.id2name
- mode = mode.id2name
+ mode = id2name
end
super(mode)
end
@@ -261,7 +260,7 @@ module Sync_m
@sync_ex_locker = nil
@sync_ex_count = 0
- @sync_mutex = Thread::Mutex.new
+ @sync_mutex = Mutex.new
end
def initialize(*args)
@@ -304,7 +303,7 @@ module Sync_m
ret = false
end
else
- Err::LockModeFailer.Fail m
+ Err::LockModeFailer.Fail mode
end
return ret
end
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 671ac7b83b..f0231bfc1b 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# tempfile - manipulates temporary files
#
@@ -79,8 +78,10 @@ require 'tmpdir'
# same Tempfile object from multiple threads then you should protect it with a
# mutex.
class Tempfile < DelegateClass(File)
+ include Dir::Tmpname
+
# call-seq:
- # new(basename = "", [tmpdir = Dir.tmpdir], [options])
+ # new(basename, [tmpdir = Dir.tmpdir], [options])
#
# Creates a temporary file with permissions 0600 (= only readable and
# writable by the owner) and opens it with mode "w+".
@@ -123,31 +124,49 @@ class Tempfile < DelegateClass(File)
#
# If Tempfile.new cannot find a unique filename within a limited
# number of tries, then it will raise an exception.
- def initialize(basename="", tmpdir=nil, mode: 0, **options)
- warn "Tempfile.new doesn't call the given block.", uplevel: 1 if block_given?
+ def initialize(basename, *rest)
+ if block_given?
+ warn "Tempfile.new doesn't call the given block."
+ end
+ @data = []
+ @clean_proc = Remover.new(@data)
+ ObjectSpace.define_finalizer(self, @clean_proc)
- @unlinked = false
- @mode = mode|File::RDWR|File::CREAT|File::EXCL
- ::Dir::Tmpname.create(basename, tmpdir, options) do |tmpname, n, opts|
- opts[:perm] = 0600
- @tmpfile = File.open(tmpname, @mode, opts)
- @opts = opts.freeze
+ ::Dir::Tmpname.create(basename, *rest) do |tmpname, n, opts|
+ mode = File::RDWR|File::CREAT|File::EXCL
+ perm = 0600
+ if opts
+ mode |= opts.delete(:mode) || 0
+ opts[:perm] = perm
+ perm = nil
+ else
+ opts = perm
+ end
+ @data[1] = @tmpfile = File.open(tmpname, mode, opts)
+ @data[0] = @tmpname = tmpname
+ @mode = mode & ~(File::CREAT|File::EXCL)
+ perm or opts.freeze
+ @opts = opts
end
- ObjectSpace.define_finalizer(self, Remover.new(@tmpfile))
super(@tmpfile)
end
# Opens or reopens the file with mode "r+".
def open
- _close
- mode = @mode & ~(File::CREAT|File::EXCL)
- @tmpfile = File.open(@tmpfile.path, mode, @opts)
+ @tmpfile.close if @tmpfile
+ @tmpfile = File.open(@tmpname, @mode, @opts)
+ @data[1] = @tmpfile
__setobj__(@tmpfile)
end
def _close # :nodoc:
- @tmpfile.close
+ begin
+ @tmpfile.close if @tmpfile
+ ensure
+ @tmpfile = nil
+ @data[1] = nil if @data
+ end
end
protected :_close
@@ -158,14 +177,18 @@ class Tempfile < DelegateClass(File)
# If you don't explicitly unlink the temporary file, the removal
# will be delayed until the object is finalized.
def close(unlink_now=false)
- _close
- unlink if unlink_now
+ if unlink_now
+ close!
+ else
+ _close
+ end
end
# Closes and unlinks (deletes) the file. Has the same effect as called
# <tt>close(true)</tt>.
def close!
- close(true)
+ _close
+ unlink
end
# Unlinks (deletes) the file from the filesystem. One should always unlink
@@ -202,32 +225,37 @@ class Tempfile < DelegateClass(File)
# # to do so again.
# end
def unlink
- return if @unlinked
+ return unless @tmpname
begin
- File.unlink(@tmpfile.path)
+ File.unlink(@tmpname)
rescue Errno::ENOENT
rescue Errno::EACCES
# may not be able to unlink on Windows; just ignore
return
end
+ # remove tmpname from remover
+ @data[0] = @data[1] = nil
+ @tmpname = nil
ObjectSpace.undefine_finalizer(self)
- @unlinked = true
end
alias delete unlink
# Returns the full path name of the temporary file.
# This will be nil if #unlink has been called.
def path
- @unlinked ? nil : @tmpfile.path
+ @tmpname
end
# Returns the size of the temporary file. As a side effect, the IO
# buffer is flushed before determining the size.
def size
- if !@tmpfile.closed?
- @tmpfile.size # File#size calls rb_io_flush_raw()
+ if @tmpfile
+ @tmpfile.flush
+ @tmpfile.stat.size
+ elsif @tmpname
+ File.size(@tmpname)
else
- File.size(@tmpfile.path)
+ 0
end
end
alias length size
@@ -242,23 +270,28 @@ class Tempfile < DelegateClass(File)
end
class Remover
- def initialize(tmpfile)
- @pid = Process.pid
- @tmpfile = tmpfile
+ def initialize(data)
+ @pid = $$
+ @data = data
end
def call(*args)
- return if @pid != Process.pid
+ return if @pid != $$
+
+ path, tmpfile = *@data
- $stderr.puts "removing #{@tmpfile.path}..." if $DEBUG
+ STDERR.print "removing ", path, "..." if $DEBUG
- @tmpfile.close
- begin
- File.unlink(@tmpfile.path)
- rescue Errno::ENOENT
+ tmpfile.close if tmpfile
+
+ if path
+ begin
+ File.unlink(path)
+ rescue Errno::ENOENT
+ end
end
- $stderr.puts "done" if $DEBUG
+ STDERR.print "done\n" if $DEBUG
end
end
@@ -274,7 +307,7 @@ class Tempfile < DelegateClass(File)
# object will be automatically closed after the block terminates.
# The call returns the value of the block.
#
- # In any case, all arguments (<code>*args</code>) will be passed to Tempfile.new.
+ # In any case, all arguments (+*args+) will be passed to Tempfile.new.
#
# Tempfile.open('foo', '/home/temp') do |f|
# ... do something with f ...
@@ -303,8 +336,8 @@ class Tempfile < DelegateClass(File)
end
end
-# Creates a temporary file as usual File object (not Tempfile).
-# It doesn't use finalizer and delegation.
+# Creates a temporally file as usual File object (not Tempfile).
+# It don't use finalizer and delegation.
#
# If no block is given, this is similar to Tempfile.new except
# creating File instead of Tempfile.
@@ -314,39 +347,35 @@ end
# If a block is given, then a File object will be constructed,
# and the block is invoked with the object as the argument.
# The File object will be automatically closed and
-# the temporary file is removed after the block terminates.
+# the temporally file is removed after the block terminates.
# The call returns the value of the block.
#
-# In any case, all arguments (+basename+, +tmpdir+, +mode+, and
-# <code>**options</code>) will be treated as Tempfile.new.
+# In any case, all arguments (+*args+) will be treated as Tempfile.new.
#
# Tempfile.create('foo', '/home/temp') do |f|
# ... do something with f ...
# end
#
-def Tempfile.create(basename="", tmpdir=nil, mode: 0, **options)
+def Tempfile.create(basename, *rest)
tmpfile = nil
- Dir::Tmpname.create(basename, tmpdir, options) do |tmpname, n, opts|
- mode |= File::RDWR|File::CREAT|File::EXCL
- opts[:perm] = 0600
+ Dir::Tmpname.create(basename, *rest) do |tmpname, n, opts|
+ mode = File::RDWR|File::CREAT|File::EXCL
+ perm = 0600
+ if opts
+ mode |= opts.delete(:mode) || 0
+ opts[:perm] = perm
+ perm = nil
+ else
+ opts = perm
+ end
tmpfile = File.open(tmpname, mode, opts)
end
if block_given?
begin
yield tmpfile
ensure
- unless tmpfile.closed?
- if File.identical?(tmpfile, tmpfile.path)
- unlinked = File.unlink tmpfile.path rescue nil
- end
- tmpfile.close
- end
- unless unlinked
- begin
- File.unlink tmpfile.path
- rescue Errno::ENOENT
- end
- end
+ tmpfile.close if !tmpfile.closed?
+ File.unlink tmpfile
end
else
tmpfile
diff --git a/lib/thwait.rb b/lib/thwait.rb
index 8f9e0c2a78..d9750a406b 100644
--- a/lib/thwait.rb
+++ b/lib/thwait.rb
@@ -1,10 +1,10 @@
-# frozen_string_literal: false
#
# thwait.rb - thread synchronization class
# $Release Version: 0.9 $
# $Revision: 1.3 $
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd.)
+require "thread.rb"
require "e2mmap.rb"
#
@@ -50,7 +50,7 @@ class ThreadsWait
#
def initialize(*threads)
@threads = []
- @wait_queue = Thread::Queue.new
+ @wait_queue = Queue.new
join_nowait(*threads) unless threads.empty?
end
diff --git a/lib/time.rb b/lib/time.rb
index eb46a03ad3..d39c4f6515 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
require 'date'
# = time.rb
@@ -39,7 +37,7 @@ require 'date'
# #parse takes a string representation of a Time and attempts to parse it
# using a heuristic.
#
-# Time.parse("2010-10-31") #=> 2010-10-31 00:00:00 -0500
+# Date.parse("2010-10-31") #=> 2010-10-31 00:00:00 -0500
#
# Any missing pieces of the date are inferred based on the current date.
#
@@ -134,8 +132,8 @@ class Time
def zone_offset(zone, year=self.now.year)
off = nil
zone = zone.upcase
- if /\A([+-])(\d\d)(:?)(\d\d)(?:\3(\d\d))?\z/ =~ zone
- off = ($1 == '-' ? -1 : 1) * (($2.to_i * 60 + $4.to_i) * 60 + $5.to_i)
+ if /\A([+-])(\d\d):?(\d\d)\z/ =~ zone
+ off = ($1 == '-' ? -1 : 1) * ($2.to_i * 60 + $3.to_i) * 60
elsif /\A[+-]\d\d\z/ =~ zone
off = zone.to_i * 3600
elsif ZoneOffset.include?(zone)
@@ -254,18 +252,14 @@ class Time
raise ArgumentError, "no time information in #{date.inspect}"
end
+ off_year = year || now.year
off = nil
- if year || now
- off_year = year || now.year
- off = zone_offset(zone, off_year) if zone
- end
+ off = zone_offset(zone, off_year) if zone
- if now
- if off
- now = now.getlocal(off) if now.utc_offset != off
- else
- now = now.getlocal
- end
+ if off
+ now = now.getlocal(off) if now.utc_offset != off
+ else
+ now = now.getlocal
end
usec = nil
@@ -432,13 +426,7 @@ class Time
d = Date._strptime(date, format)
raise ArgumentError, "invalid strptime format - `#{format}'" unless d
if seconds = d[:seconds]
- if sec_fraction = d[:sec_fraction]
- usec = sec_fraction * 1000000
- usec *= -1 if seconds < 0
- else
- usec = 0
- end
- t = Time.at(seconds, usec)
+ t = Time.at(seconds)
if zone = d[:zone]
force_zone!(t, zone)
end
@@ -575,7 +563,7 @@ class Time
T
(\d\d):(\d\d):(\d\d)
(\.\d+)?
- (Z|[+-]\d\d(?::?\d\d)?)?
+ (Z|[+-]\d\d:\d\d)?
\s*\z/ix =~ date
year = $1.to_i
mon = $2.to_i
@@ -620,7 +608,7 @@ class Time
sprintf('%s, %02d %s %0*d %02d:%02d:%02d ',
RFC2822_DAY_NAME[wday],
day, RFC2822_MONTH_NAME[mon-1], year < 0 ? 5 : 4, year,
- hour, min, sec) <<
+ hour, min, sec) +
if utc?
'-0000'
else
diff --git a/lib/timeout.rb b/lib/timeout.rb
index a33bb4ce65..d805dce2a3 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# Timeout long-running blocks
#
# == Synopsis
@@ -15,7 +14,7 @@
#
# Previous versions didn't use a module for namespacing, however
# #timeout is provided for backwards compatibility. You
-# should prefer Timeout.timeout instead.
+# should prefer Timeout#timeout instead.
#
# == Copyright
#
@@ -23,23 +22,27 @@
# Copyright:: (C) 2000 Information-technology Promotion Agency, Japan
module Timeout
- # Raised by Timeout.timeout when the block times out.
+ # Raised by Timeout#timeout when the block times out.
class Error < RuntimeError
+ end
+ class ExitException < ::Exception # :nodoc:
attr_reader :thread
def self.catch(*args)
exc = new(*args)
exc.instance_variable_set(:@thread, Thread.current)
+ exc.freeze
::Kernel.catch(exc) {yield exc}
end
def exception(*)
- # TODO: use Fiber.current to see if self can be thrown
if self.thread == Thread.current
bt = caller
begin
throw(self, bt)
- rescue UncaughtThrowError
+ rescue ArgumentError => e
+ raise unless e.message.start_with?("uncaught throw")
+ raise Error, message, backtrace
end
end
self
@@ -49,7 +52,6 @@ module Timeout
# :stopdoc:
THIS_FILE = /\A#{Regexp.quote(__FILE__)}:/o
CALLER_OFFSET = ((c = caller[0]) && THIS_FILE =~ c) ? 1 : 0
- private_constant :THIS_FILE, :CALLER_OFFSET
# :startdoc:
# Perform an operation in a block, raising an error if it takes longer than
@@ -60,8 +62,6 @@ module Timeout
# value of 0 or +nil+ will execute the block without any timeout.
# +klass+:: Exception Class to raise if the block fails to terminate
# in +sec+ seconds. Omitting will use the default, Timeout::Error
- # +message+:: Error message to raise with Exception Class.
- # Omitting will use the default, "execution expired"
#
# Returns the result of the block *if* the block completed before
# +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
@@ -72,16 +72,14 @@ module Timeout
# Note that this is both a method of module Timeout, so you can <tt>include
# Timeout</tt> into your classes so they have a #timeout method, as well as
# a module method, so you can call it directly as Timeout.timeout().
- def timeout(sec, klass = nil, message = nil) #:yield: +sec+
+ def timeout(sec, klass = nil) #:yield: +sec+
return yield(sec) if sec == nil or sec.zero?
- message ||= "execution expired".freeze
- from = "from #{caller_locations(1, 1)[0]}" if $DEBUG
+ message = "execution expired"
e = Error
bl = proc do |exception|
begin
x = Thread.current
y = Thread.start {
- Thread.current.name = from
begin
sleep sec
rescue => e
@@ -105,9 +103,11 @@ module Timeout
bt = e.backtrace
end
else
- bt = Error.catch(message, &bl)
+ bt = ExitException.catch(message, &bl)
end
- level = -caller(CALLER_OFFSET).size-2
+ rej = /\A#{Regexp.quote(__FILE__)}:#{__LINE__-4}\z/o
+ bt.reject! {|m| rej =~ m}
+ level = -caller(CALLER_OFFSET).size
while THIS_FILE =~ bt[level]
bt.delete_at(level)
end
@@ -117,14 +117,16 @@ module Timeout
module_function :timeout
end
-def timeout(*args, &block)
- warn "Object##{__method__} is deprecated, use Timeout.timeout instead.", uplevel: 1
- Timeout.timeout(*args, &block)
+# Identical to:
+#
+# Timeout::timeout(n, e, &block).
+#
+# This method is deprecated and provided only for backwards compatibility.
+# You should use Timeout#timeout instead.
+def timeout(n, e = nil, &block)
+ Timeout::timeout(n, e, &block)
end
# Another name for Timeout::Error, defined for backwards compatibility with
# earlier versions of timeout.rb.
TimeoutError = Timeout::Error
-class Object
- deprecate_constant :TimeoutError
-end
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index d14c446727..409d779b8a 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# tmpdir - retrieve temporary directory path
#
@@ -18,12 +17,12 @@ class Dir
##
# Returns the operating system's temporary file path.
- def self.tmpdir
+ def Dir::tmpdir
if $SAFE > 0
- @@systmpdir.dup
+ @@systmpdir
else
tmp = nil
- [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|
+ for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.']
next if !dir
dir = File.expand_path(dir)
if stat = File.stat(dir) and stat.directory? and stat.writable? and
@@ -32,7 +31,7 @@ class Dir
break
end rescue nil
end
- raise ArgumentError, "could not find a temporary directory" unless tmp
+ raise ArgumentError, "could not find a temporary directory" if !tmp
tmp
end
end
@@ -82,21 +81,15 @@ class Dir
# FileUtils.remove_entry dir
# end
#
- def self.mktmpdir(prefix_suffix=nil, *rest)
- base = nil
- path = Tmpname.create(prefix_suffix || "d", *rest) {|_path, _, _, d|
- base = d
- mkdir(_path, 0700)
- }
+ def Dir.mktmpdir(prefix_suffix=nil, *rest)
+ path = Tmpname.create(prefix_suffix || "d", *rest) {|n| mkdir(n, 0700)}
if block_given?
begin
yield path
ensure
- unless base
- stat = File.stat(File.dirname(path))
- if stat.world_writable? and !stat.sticky?
- raise ArgumentError, "parent directory is world writable but not sticky"
- end
+ stat = File.stat(File.dirname(path))
+ if stat.world_writable? and !stat.sticky?
+ raise ArgumentError, "parent directory is world writable but not sticky"
end
FileUtils.remove_entry path
end
@@ -112,27 +105,41 @@ class Dir
Dir.tmpdir
end
- def create(basename, tmpdir=nil, max_try: nil, **opts)
+ def make_tmpname(prefix_suffix, n)
+ case prefix_suffix
+ when String
+ prefix = prefix_suffix
+ suffix = ""
+ when Array
+ prefix = prefix_suffix[0]
+ suffix = prefix_suffix[1]
+ else
+ raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
+ end
+ t = Time.now.strftime("%Y%m%d")
+ path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
+ path << "-#{n}" if n
+ path << suffix
+ end
+
+ def create(basename, *rest)
+ if opts = Hash.try_convert(rest[-1])
+ opts = opts.dup if rest.pop.equal?(opts)
+ max_try = opts.delete(:max_try)
+ opts = [opts]
+ else
+ opts = []
+ end
+ tmpdir, = *rest
if $SAFE > 0 and tmpdir.tainted?
tmpdir = '/tmp'
else
- origdir = tmpdir
tmpdir ||= tmpdir()
end
n = nil
- prefix, suffix = basename
- prefix = (String.try_convert(prefix) or
- raise ArgumentError, "unexpected prefix: #{prefix.inspect}")
- prefix = prefix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}")
- suffix &&= (String.try_convert(suffix) or
- raise ArgumentError, "unexpected suffix: #{suffix.inspect}")
- suffix &&= suffix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}")
begin
- t = Time.now.strftime("%Y%m%d")
- path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"\
- "#{n ? %[-#{n}] : ''}#{suffix||''}"
- path = File.join(tmpdir, path)
- yield(path, n, opts, origdir)
+ path = File.join(tmpdir, make_tmpname(basename, n))
+ yield(path, n, *opts)
rescue Errno::EEXIST
n ||= 0
n += 1
diff --git a/lib/tracer.rb b/lib/tracer.rb
index faafd803f4..1d6b019bcf 100644
--- a/lib/tracer.rb
+++ b/lib/tracer.rb
@@ -1,7 +1,7 @@
-# frozen_string_literal: false
#--
# $Release Version: 0.3$
# $Revision: 1.12 $
+require "thread"
##
# Outputs a source level execution trace of a Ruby program.
@@ -90,7 +90,7 @@ class Tracer
Tracer::display_thread_id = true
Tracer::display_c_call = false
- @stdout_mutex = Thread::Mutex.new
+ @stdout_mutex = Mutex.new
# Symbol table used for displaying trace information
EVENT_SYMBOL = {
diff --git a/lib/tsort.rb b/lib/tsort.rb
index 2760b7d57f..cb8f67ef60 100644
--- a/lib/tsort.rb
+++ b/lib/tsort.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
#--
# tsort.rb - provides a module for topological sorting and strongly connected components.
#++
@@ -173,7 +171,9 @@ module TSort
# p TSort.tsort(each_node, each_child) # raises TSort::Cyclic
#
def TSort.tsort(each_node, each_child)
- TSort.tsort_each(each_node, each_child).to_a
+ result = []
+ TSort.tsort_each(each_node, each_child) {|element| result << element}
+ result
end
# The iterator version of the #tsort method.
@@ -221,8 +221,6 @@ module TSort
# # 1
#
def TSort.tsort_each(each_node, each_child) # :yields: node
- return to_enum(__method__, each_node, each_child) unless block_given?
-
TSort.each_strongly_connected_component(each_node, each_child) {|component|
if component.size == 1
yield component.first
@@ -278,7 +276,9 @@ module TSort
# #=> [[4], [2, 3], [1]]
#
def TSort.strongly_connected_components(each_node, each_child)
- TSort.each_strongly_connected_component(each_node, each_child).to_a
+ result = []
+ TSort.each_strongly_connected_component(each_node, each_child) {|component| result << component}
+ result
end
# The iterator version of the #strongly_connected_components method.
@@ -340,8 +340,6 @@ module TSort
# # [1]
#
def TSort.each_strongly_connected_component(each_node, each_child) # :yields: nodes
- return to_enum(__method__, each_node, each_child) unless block_given?
-
id_map = {}
stack = []
each_node.call {|node|
@@ -406,8 +404,6 @@ module TSort
# # [1]
#
def TSort.each_strongly_connected_component_from(node, each_child, id_map={}, stack=[]) # :yields: nodes
- return to_enum(__method__, node, each_child, id_map, stack) unless block_given?
-
minimum_id = node_id = id_map[node] = id_map.size
stack_length = stack.length
stack << node
diff --git a/lib/ubygems.rb b/lib/ubygems.rb
new file mode 100644
index 0000000000..fec880f73b
--- /dev/null
+++ b/lib/ubygems.rb
@@ -0,0 +1,10 @@
+# This file allows for the running of rubygems with a nice
+# command line look-and-feel: ruby -rubygems foo.rb
+#--
+# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+# All rights reserved.
+# See LICENSE.txt for permissions.
+#++
+
+
+require 'rubygems'
diff --git a/lib/un.rb b/lib/un.rb
index c445dba4ec..487ba9eb75 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = un.rb
#
@@ -189,17 +188,13 @@ end
# -p apply access/modification times of SOURCE files to
# corresponding destination files
# -m set permission mode (as in chmod), instead of 0755
-# -o set owner user id, instead of the current owner
-# -g set owner group id, instead of the current group
# -v verbose
#
def install
- setup("pm:o:g:") do |argv, options|
- (mode = options.delete :m) and options[:mode] = /\A\d/ =~ mode ? mode.oct : mode
+ setup("pm:") do |argv, options|
+ options[:mode] = (mode = options.delete :m) ? mode.oct : 0755
options[:preserve] = true if options.delete :p
- (owner = options.delete :o) and options[:owner] = owner
- (group = options.delete :g) and options[:group] = group
dest = argv.pop
argv = argv[0] if argv.size == 1
FileUtils.install argv, dest, options
@@ -216,8 +211,7 @@ end
def chmod
setup do |argv, options|
- mode = argv.shift
- mode = /\A\d/ =~ mode ? mode.oct : mode
+ mode = argv.shift.oct
FileUtils.chmod mode, argv, options
end
end
@@ -313,32 +307,22 @@ end
# --do-not-reverse-lookup disable reverse lookup
# --request-timeout=SECOND request timeout in seconds
# --http-version=VERSION HTTP version
-# --ssl-certificate=CERT The SSL certificate file for the server
-# --ssl-private-key=KEY The SSL private key file for the server certificate
# -v verbose
#
def httpd
setup("", "BindAddress=ADDR", "Port=PORT", "MaxClients=NUM", "TempDir=DIR",
- "DoNotReverseLookup", "RequestTimeout=SECOND", "HTTPVersion=VERSION",
- "SSLCertificate=CERT", "SSLPrivateKey=KEY") do
+ "DoNotReverseLookup", "RequestTimeout=SECOND", "HTTPVersion=VERSION") do
|argv, options|
require 'webrick'
opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
[:Port, :MaxClients].each do |name|
opt = options[name] and (options[name] = Integer(opt)) rescue nil
end
- if cert = options[:SSLCertificate]
- key = options[:SSLPrivateKey] or
- raise "--ssl-private-key option must also be given"
- require 'webrick/https'
- options[:SSLEnable] = true
- options[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(cert))
- options[:SSLPrivateKey] = OpenSSL::PKey.read(File.read(key))
- options[:Port] ||= 8443 # HTTPS Alternate
+ unless argv.size == 1
+ raise ArgumentError, "DocumentRoot is mandatory"
end
- options[:Port] ||= 8080 # HTTP Alternate
- options[:DocumentRoot] = argv.shift || '.'
+ options[:DocumentRoot] = argv.shift
s = WEBrick::HTTPServer.new(options)
shut = proc {s.shutdown}
siglist = %w"TERM QUIT"
@@ -385,7 +369,7 @@ module UN # :nodoc:
end
end
if messages
- argv.each {|arg| output << messages[arg]}
+ argv.each {|cmd| output << messages[cmd]}
end
end
end
diff --git a/lib/unicode_normalize/normalize.rb b/lib/unicode_normalize/normalize.rb
deleted file mode 100644
index a2f7a29c88..0000000000
--- a/lib/unicode_normalize/normalize.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: false
-
-# Copyright Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp)
-
-# This file, the companion file tables.rb (autogenerated), and the module,
-# constants, and method defined herein are part of the implementation of the
-# built-in String class, not part of the standard library. They should
-# therefore never be gemified. They implement the methods
-# String#unicode_normalize, String#unicode_normalize!, and String#unicode_normalized?.
-#
-# They are placed here because they are written in Ruby. They are loaded on
-# demand when any of the three methods mentioned above is executed for the
-# first time. This reduces the memory footprint and startup time for scripts
-# and applications that do not use those methods.
-#
-# The name and even the existence of the module UnicodeNormalize and all of its
-# content are purely an implementation detail, and should not be exposed in
-# any test or spec or otherwise.
-
-require 'unicode_normalize/tables.rb'
-
-
-module UnicodeNormalize # :nodoc:
- ## Constant for max hash capacity to avoid DoS attack
- MAX_HASH_LENGTH = 18000 # enough for all test cases, otherwise tests get slow
-
- ## Regular Expressions and Hash Constants
- REGEXP_D = Regexp.compile(REGEXP_D_STRING, Regexp::EXTENDED)
- REGEXP_C = Regexp.compile(REGEXP_C_STRING, Regexp::EXTENDED)
- REGEXP_K = Regexp.compile(REGEXP_K_STRING, Regexp::EXTENDED)
- NF_HASH_D = Hash.new do |hash, key|
- hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
- hash[key] = nfd_one(key)
- end
- NF_HASH_C = Hash.new do |hash, key|
- hash.shift if hash.length>MAX_HASH_LENGTH # prevent DoS attack
- hash[key] = nfc_one(key)
- end
-
- ## Constants For Hangul
- # for details such as the meaning of the identifiers below, please see
- # http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf, pp. 144/145
- SBASE = 0xAC00
- LBASE = 0x1100
- VBASE = 0x1161
- TBASE = 0x11A7
- LCOUNT = 19
- VCOUNT = 21
- TCOUNT = 28
- NCOUNT = VCOUNT * TCOUNT
- SCOUNT = LCOUNT * NCOUNT
-
- # Unicode-based encodings (except UTF-8)
- UNICODE_ENCODINGS = [Encoding::UTF_16BE, Encoding::UTF_16LE, Encoding::UTF_32BE, Encoding::UTF_32LE,
- Encoding::GB18030, Encoding::UCS_2BE, Encoding::UCS_4BE]
-
- ## Hangul Algorithm
- def self.hangul_decomp_one(target)
- syllable_index = target.ord - SBASE
- return target if syllable_index < 0 || syllable_index >= SCOUNT
- l = LBASE + syllable_index / NCOUNT
- v = VBASE + (syllable_index % NCOUNT) / TCOUNT
- t = TBASE + syllable_index % TCOUNT
- (t==TBASE ? [l, v] : [l, v, t]).pack('U*') + target[1..-1]
- end
-
- def self.hangul_comp_one(string)
- length = string.length
- if length>1 and 0 <= (lead =string[0].ord-LBASE) and lead < LCOUNT and
- 0 <= (vowel=string[1].ord-VBASE) and vowel < VCOUNT
- lead_vowel = SBASE + (lead * VCOUNT + vowel) * TCOUNT
- if length>2 and 0 <= (trail=string[2].ord-TBASE) and trail < TCOUNT
- (lead_vowel + trail).chr(Encoding::UTF_8) + string[3..-1]
- else
- lead_vowel.chr(Encoding::UTF_8) + string[2..-1]
- end
- else
- string
- end
- end
-
- ## Canonical Ordering
- def self.canonical_ordering_one(string)
- sorting = string.each_char.collect { |c| [c, CLASS_TABLE[c]] }
- (sorting.length-2).downto(0) do |i| # almost, but not exactly bubble sort
- (0..i).each do |j|
- later_class = sorting[j+1].last
- if 0<later_class and later_class<sorting[j].last
- sorting[j], sorting[j+1] = sorting[j+1], sorting[j]
- end
- end
- end
- return sorting.collect(&:first).join('')
- end
-
- ## Normalization Forms for Patterns (not whole Strings)
- def self.nfd_one(string)
- string = string.chars.map! {|c| DECOMPOSITION_TABLE[c] || c}.join('')
- canonical_ordering_one(hangul_decomp_one(string))
- end
-
- def self.nfc_one(string)
- nfd_string = nfd_one string
- start = nfd_string[0]
- last_class = CLASS_TABLE[start]-1
- accents = ''
- nfd_string[1..-1].each_char do |accent|
- accent_class = CLASS_TABLE[accent]
- if last_class<accent_class and composite = COMPOSITION_TABLE[start+accent]
- start = composite
- else
- accents << accent
- last_class = accent_class
- end
- end
- hangul_comp_one(start+accents)
- end
-
- def self.normalize(string, form = :nfc)
- encoding = string.encoding
- case encoding
- when Encoding::UTF_8
- case form
- when :nfc then
- string.gsub REGEXP_C, NF_HASH_C
- when :nfd then
- string.gsub REGEXP_D, NF_HASH_D
- when :nfkc then
- string.gsub(REGEXP_K, KOMPATIBLE_TABLE).gsub(REGEXP_C, NF_HASH_C)
- when :nfkd then
- string.gsub(REGEXP_K, KOMPATIBLE_TABLE).gsub(REGEXP_D, NF_HASH_D)
- else
- raise ArgumentError, "Invalid normalization form #{form}."
- end
- when Encoding::US_ASCII
- string
- when *UNICODE_ENCODINGS
- normalize(string.encode(Encoding::UTF_8), form).encode(encoding)
- else
- raise Encoding::CompatibilityError, "Unicode Normalization not appropriate for #{encoding}"
- end
- end
-
- def self.normalized?(string, form = :nfc)
- encoding = string.encoding
- case encoding
- when Encoding::UTF_8
- case form
- when :nfc then
- string.scan REGEXP_C do |match|
- return false if NF_HASH_C[match] != match
- end
- true
- when :nfd then
- string.scan REGEXP_D do |match|
- return false if NF_HASH_D[match] != match
- end
- true
- when :nfkc then
- normalized?(string, :nfc) and string !~ REGEXP_K
- when :nfkd then
- normalized?(string, :nfd) and string !~ REGEXP_K
- else
- raise ArgumentError, "Invalid normalization form #{form}."
- end
- when Encoding::US_ASCII
- true
- when *UNICODE_ENCODINGS
- normalized? string.encode(Encoding::UTF_8), form
- else
- raise Encoding::CompatibilityError, "Unicode Normalization not appropriate for #{encoding}"
- end
- end
-end # module
diff --git a/lib/unicode_normalize/tables.rb b/lib/unicode_normalize/tables.rb
deleted file mode 100644
index 4984e3d329..0000000000
--- a/lib/unicode_normalize/tables.rb
+++ /dev/null
@@ -1,1170 +0,0 @@
-# coding: us-ascii
-# frozen_string_literal: true
-
-# automatically generated by template/unicode_norm_gen.tmpl
-
-module UnicodeNormalize # :nodoc:
- accents = "" \
- "[\u0300-\u034E\u0350-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7" \
- "\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711" \
- "\u0730-\u074A\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1" \
- "\u08E3-\u08FF\u093C\u094D\u0951-\u0954\u09BC\u09BE\u09CD\u09D7" \
- "\u0A3C\u0A4D\u0ABC\u0ACD\u0B3C\u0B3E\u0B4D\u0B56\u0B57" \
- "\u0BBE\u0BCD\u0BD7\u0C4D\u0C55\u0C56\u0CBC\u0CC2\u0CCD" \
- "\u0CD5\u0CD6\u0D3B\u0D3C\u0D3E\u0D4D\u0D57\u0DCA\u0DCF\u0DDF" \
- "\u0E38-\u0E3A\u0E48-\u0E4B\u0EB8\u0EB9\u0EC8-\u0ECB\u0F18\u0F19\u0F35\u0F37\u0F39" \
- "\u0F71\u0F72\u0F74\u0F7A-\u0F7D\u0F80\u0F82-\u0F84\u0F86\u0F87\u0FC6\u102E" \
- "\u1037\u1039\u103A\u108D\u135D-\u135F\u1714\u1734\u17D2\u17DD" \
- "\u18A9\u1939-\u193B\u1A17\u1A18\u1A60\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B35" \
- "\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1BE6\u1BF2\u1BF3\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0" \
- "\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1" \
- "\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F\uA674-\uA67D" \
- "\uA69E\uA69F\uA6F0\uA6F1\uA806\uA8C4\uA8E0-\uA8F1\uA92B-\uA92D\uA953\uA9B3" \
- "\uA9C0\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAF6\uABED" \
- "\uFB1E\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A0D}\u{10A0F}\u{10A38}-\u{10A3A}" \
- "\u{10A3F}\u{10AE5}\u{10AE6}\u{11046}\u{1107F}\u{110B9}\u{110BA}\u{11100}-\u{11102}\u{11127}\u{11133}\u{11134}" \
- "\u{11173}\u{111C0}\u{111CA}\u{11235}\u{11236}\u{112E9}\u{112EA}\u{1133C}\u{1133E}\u{1134D}" \
- "\u{11357}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11442}\u{11446}\u{114B0}\u{114BA}\u{114BD}" \
- "\u{114C2}\u{114C3}\u{115AF}\u{115BF}\u{115C0}\u{1163F}\u{116B6}\u{116B7}\u{1172B}\u{11A34}\u{11A47}" \
- "\u{11A99}\u{11C3F}\u{11D42}\u{11D44}\u{11D45}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{1BC9E}\u{1D165}-\u{1D169}" \
- "\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}" \
- "\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}" \
- "]"
- ACCENTS = accents
- REGEXP_D_STRING = "#{'' # composition starters and composition exclusions
- }" \
- "[\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD" \
- "\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165" \
- "\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B" \
- "\u021E\u021F\u0226-\u0233\u0340\u0341\u0343\u0344\u0374\u037E\u0385-\u038A\u038C" \
- "\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E" \
- "\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2" \
- "\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0" \
- "\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD" \
- "\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D" \
- "\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA" \
- "\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73" \
- "\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC" \
- "\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12" \
- "\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15" \
- "\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D" \
- "\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4" \
- "\u1FF6-\u1FFD\u2000\u2001\u2126\u212A\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204" \
- "\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249" \
- "\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289" \
- "\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329\u232A\u2ADC\u304C\u304E\u3050" \
- "\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060" \
- "\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A" \
- "\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4" \
- "\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5" \
- "\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4" \
- "\u30F7-\u30FA\u30FE\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22" \
- "\uFA25\uFA26\uFA2A-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E" \
- "\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E\u{1109A}\u{1109C}\u{110AB}\u{1112E}\u{1112F}\u{1134B}\u{1134C}" \
- "\u{114BB}\u{114BC}\u{114BE}\u{115BA}\u{115BB}\u{1D15E}-\u{1D164}\u{1D1BB}-\u{1D1C0}\u{2F800}-\u{2FA1D}" \
- "]#{accents}*" \
- "|#{'' # characters that can be the result of a composition, except composition starters
- }" \
- "[<->A-PR-Za-pr-z\u00A8\u00C6\u00D8" \
- "\u00E6\u00F8\u017F\u01B7\u0292\u0391\u0395\u0397" \
- "\u0399\u039F\u03A1\u03A5\u03A9\u03B1\u03B5\u03B7" \
- "\u03B9\u03BF\u03C1\u03C5\u03C9\u03D2\u0406\u0410" \
- "\u0413\u0415-\u0418\u041A\u041E\u0423\u0427\u042B\u042D" \
- "\u0430\u0433\u0435-\u0438\u043A\u043E\u0443\u0447\u044B" \
- "\u044D\u0456\u0474\u0475\u04D8\u04D9\u04E8\u04E9\u0627\u0648\u064A" \
- "\u06C1\u06D2\u06D5\u0928\u0930\u0933\u09C7\u0B47" \
- "\u0B92\u0BC6\u0BC7\u0C46\u0CBF\u0CC6\u0D46\u0D47\u0DD9\u1025" \
- "\u1B05\u1B07\u1B09\u1B0B\u1B0D\u1B11\u1B3A\u1B3C" \
- "\u1B3E\u1B3F\u1B42\u1FBF\u1FFE\u2190\u2192\u2194\u21D0" \
- "\u21D2\u21D4\u2203\u2208\u220B\u2223\u2225\u223C" \
- "\u2243\u2245\u2248\u224D\u2261\u2264\u2265\u2272\u2273\u2276\u2277" \
- "\u227A-\u227D\u2282\u2283\u2286\u2287\u2291\u2292\u22A2\u22A8\u22A9\u22AB\u22B2-\u22B5" \
- "\u3046\u304B\u304D\u304F\u3051\u3053\u3055\u3057" \
- "\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068" \
- "\u306F\u3072\u3075\u3078\u307B\u309D\u30A6\u30AB" \
- "\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB" \
- "\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CF\u30D2" \
- "\u30D5\u30D8\u30DB\u30EF-\u30F2\u30FD\u{11099}\u{1109B}\u{110A5}" \
- "\u{11131}\u{11132}\u{11347}\u{114B9}\u{115B8}\u{115B9}" \
- "]?#{accents}+" \
- "|#{'' # precomposed Hangul syllables
- }" \
- "[\u{AC00}-\u{D7A4}]"
- REGEXP_C_STRING = "#{'' # composition exclusions
- }" \
- "[\u0340\u0341\u0343\u0344\u0374\u037E\u0387\u0958-\u095F\u09DC\u09DD\u09DF" \
- "\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C\u0B5D\u0F43\u0F4D\u0F52" \
- "\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93" \
- "\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1F71\u1F73\u1F75" \
- "\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBE\u1FC9\u1FCB" \
- "\u1FD3\u1FDB\u1FE3\u1FEB\u1FEE\u1FEF\u1FF9\u1FFB\u1FFD" \
- "\u2000\u2001\u2126\u212A\u212B\u2329\u232A\u2ADC\uF900-\uFA0D\uFA10\uFA12" \
- "\uFA15-\uFA1E\uFA20\uFA22\uFA25\uFA26\uFA2A-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F" \
- "\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E\u{1D15E}-\u{1D164}\u{1D1BB}-\u{1D1C0}" \
- "\u{2F800}-\u{2FA1D}" \
- "]#{accents}*" \
- "|#{'' # composition starters and characters that can be the result of a composition
- }" \
- "[<->A-PR-Za-pr-z\u00A8\u00C0-\u00CF\u00D1-\u00D6" \
- "\u00D8-\u00DD\u00E0-\u00EF\u00F1-\u00F6\u00F8-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137" \
- "\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017F\u01A0\u01A1\u01AF\u01B0\u01B7" \
- "\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0292" \
- "\u0385\u0386\u0388-\u038A\u038C\u038E-\u0391\u0395\u0397\u0399\u039F" \
- "\u03A1\u03A5\u03A9-\u03B1\u03B5\u03B7\u03B9\u03BF\u03C1" \
- "\u03C5\u03C9-\u03CE\u03D2-\u03D4\u0400\u0401\u0403\u0406\u0407\u040C-\u040E\u0410" \
- "\u0413\u0415-\u041A\u041E\u0423\u0427\u042B\u042D\u0430" \
- "\u0433\u0435-\u043A\u043E\u0443\u0447\u044B\u044D\u0450\u0451" \
- "\u0453\u0456\u0457\u045C-\u045E\u0474-\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6-\u04DF\u04E2-\u04F5" \
- "\u04F8\u04F9\u0622-\u0627\u0648\u064A\u06C0-\u06C2\u06D2\u06D3\u06D5\u0928\u0929" \
- "\u0930\u0931\u0933\u0934\u09C7\u09CB\u09CC\u0B47\u0B48\u0B4B\u0B4C\u0B92\u0B94" \
- "\u0BC6\u0BC7\u0BCA-\u0BCC\u0C46\u0C48\u0CBF\u0CC0\u0CC6-\u0CC8\u0CCA\u0CCB\u0D46\u0D47" \
- "\u0D4A-\u0D4C\u0DD9\u0DDA\u0DDC-\u0DDE\u1025\u1026\u1B05-\u1B0E\u1B11\u1B12\u1B3A-\u1B43\u1E00-\u1E99" \
- "\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59" \
- "\u1F5B\u1F5D\u1F5F-\u1F70\u1F72\u1F74\u1F76\u1F78\u1F7A" \
- "\u1F7C\u1F80-\u1FB4\u1FB6-\u1FBA\u1FBC\u1FBF\u1FC1-\u1FC4\u1FC6-\u1FC8\u1FCA" \
- "\u1FCC-\u1FD2\u1FD6-\u1FDA\u1FDD-\u1FE2\u1FE4-\u1FEA\u1FEC\u1FED\u1FF2-\u1FF4\u1FF6-\u1FF8\u1FFA" \
- "\u1FFC\u1FFE\u2190\u2192\u2194\u219A\u219B\u21AE\u21CD-\u21D0" \
- "\u21D2\u21D4\u2203\u2204\u2208\u2209\u220B\u220C\u2223-\u2226\u223C\u2241" \
- "\u2243-\u2245\u2247-\u2249\u224D\u2260-\u2262\u2264\u2265\u226D-\u227D\u2280-\u2289\u2291\u2292" \
- "\u22A2\u22A8\u22A9\u22AB-\u22AF\u22B2-\u22B5\u22E0-\u22E3\u22EA-\u22ED\u3046\u304B-\u3062" \
- "\u3064-\u3069\u306F-\u307D\u3094\u309D\u309E\u30A6\u30AB-\u30C2\u30C4-\u30C9\u30CF-\u30DD" \
- "\u30EF-\u30F2\u30F4\u30F7-\u30FA\u30FD\u30FE\u{11099}-\u{1109C}\u{110A5}\u{110AB}\u{1112E}\u{1112F}" \
- "\u{11131}\u{11132}\u{11347}\u{1134B}\u{1134C}\u{114B9}\u{114BB}\u{114BC}\u{114BE}\u{115B8}-\u{115BB}" \
- "]?#{accents}+" \
- "|#{'' # Hangul syllables with separate trailer
- }" \
- "[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4" \
- "\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4" \
- "\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84" \
- "\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64" \
- "\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044" \
- "\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124" \
- "\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204" \
- "\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4" \
- "\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4" \
- "\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4" \
- "\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584" \
- "\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664" \
- "\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744" \
- "\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824" \
- "\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904" \
- "\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4" \
- "\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4" \
- "\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4" \
- "\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84" \
- "\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64" \
- "\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44" \
- "\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24" \
- "\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004" \
- "\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4" \
- "\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4" \
- "\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4" \
- "\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384" \
- "\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464" \
- "\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544" \
- "\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624" \
- "\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704" \
- "\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4" \
- "\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4" \
- "\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4" \
- "\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84" \
- "\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64" \
- "\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44" \
- "\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24" \
- "\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04" \
- "\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4" \
- "\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4" \
- "\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4" \
- "\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184" \
- "\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264" \
- "\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344" \
- "\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424" \
- "\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504" \
- "\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4" \
- "\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4" \
- "\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788" \
- "][\u11A8-\u11C2]" \
- "|#{'' # decomposed Hangul syllables
- }" \
- "[\u1100-\u1112][\u1161-\u1175][\u11A8-\u11C2]?"
- REGEXP_K_STRING = "" \
- "[\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-\u00BE\u0132\u0133" \
- "\u013F\u0140\u0149\u017F\u01C4-\u01CC\u01F1-\u01F3\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4" \
- "\u037A\u0384\u0385\u03D0-\u03D6\u03F0-\u03F2\u03F4\u03F5\u03F9\u0587\u0675-\u0678" \
- "\u0E33\u0EB3\u0EDC\u0EDD\u0F0C\u0F77\u0F79\u10FC\u1D2C-\u1D2E" \
- "\u1D30-\u1D3A\u1D3C-\u1D4D\u1D4F-\u1D6A\u1D78\u1D9B-\u1DBF\u1E9A\u1E9B\u1FBD\u1FBF-\u1FC1" \
- "\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED\u1FEE\u1FFD\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026" \
- "\u202F\u2033\u2034\u2036\u2037\u203C\u203E\u2047-\u2049\u2057\u205F" \
- "\u2070\u2071\u2074-\u208E\u2090-\u209C\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115\u2116" \
- "\u2119-\u211D\u2120-\u2122\u2124\u2128\u212C\u212D\u212F-\u2131\u2133-\u2139\u213B-\u2140" \
- "\u2145-\u2149\u2150-\u217F\u2189\u222C\u222D\u222F\u2230\u2460-\u24EA\u2A0C\u2A74-\u2A76" \
- "\u2C7C\u2C7D\u2D6F\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A" \
- "\u309B\u309C\u309F\u30FF\u3131-\u318E\u3192-\u319F\u3200-\u321E\u3220-\u3247\u3250-\u327E" \
- "\u3280-\u32FE\u3300-\u33FF\uA69C\uA69D\uA770\uA7F8\uA7F9\uAB5C-\uAB5F\uFB00-\uFB06\uFB13-\uFB17" \
- "\uF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5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F14F}\u{1F16A}\u{1F16B}\u{1F190}" \
- "\u{1F200}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}" \
- "]"
-
- class_table = {
- "\u0300"=>230, "\u0301"=>230, "\u0302"=>230, "\u0303"=>230, "\u0304"=>230, "\u0305"=>230, "\u0306"=>230, "\u0307"=>230,
- "\u0308"=>230, "\u0309"=>230, "\u030A"=>230, "\u030B"=>230, "\u030C"=>230, "\u030D"=>230, "\u030E"=>230, "\u030F"=>230,
- "\u0310"=>230, "\u0311"=>230, "\u0312"=>230, "\u0313"=>230, "\u0314"=>230, "\u0315"=>232, "\u0316"=>220, "\u0317"=>220,
- "\u0318"=>220, "\u0319"=>220, "\u031A"=>232, "\u031B"=>216, "\u031C"=>220, "\u031D"=>220, "\u031E"=>220, "\u031F"=>220,
- "\u0320"=>220, "\u0321"=>202, "\u0322"=>202, "\u0323"=>220, "\u0324"=>220, "\u0325"=>220, "\u0326"=>220, "\u0327"=>202,
- "\u0328"=>202, "\u0329"=>220, "\u032A"=>220, "\u032B"=>220, "\u032C"=>220, "\u032D"=>220, "\u032E"=>220, "\u032F"=>220,
- "\u0330"=>220, "\u0331"=>220, "\u0332"=>220, "\u0333"=>220, "\u0334"=>1, "\u0335"=>1, "\u0336"=>1, "\u0337"=>1,
- "\u0338"=>1, "\u0339"=>220, "\u033A"=>220, "\u033B"=>220, "\u033C"=>220, "\u033D"=>230, "\u033E"=>230, "\u033F"=>230,
- "\u0340"=>230, "\u0341"=>230, "\u0342"=>230, "\u0343"=>230, "\u0344"=>230, "\u0345"=>240, "\u0346"=>230, "\u0347"=>220,
- "\u0348"=>220, "\u0349"=>220, "\u034A"=>230, "\u034B"=>230, "\u034C"=>230, "\u034D"=>220, "\u034E"=>220, "\u0350"=>230,
- "\u0351"=>230, "\u0352"=>230, "\u0353"=>220, "\u0354"=>220, "\u0355"=>220, "\u0356"=>220, "\u0357"=>230, "\u0358"=>232,
- "\u0359"=>220, "\u035A"=>220, "\u035B"=>230, "\u035C"=>233, "\u035D"=>234, "\u035E"=>234, "\u035F"=>233, "\u0360"=>234,
- "\u0361"=>234, "\u0362"=>233, "\u0363"=>230, "\u0364"=>230, "\u0365"=>230, "\u0366"=>230, "\u0367"=>230, "\u0368"=>230,
- "\u0369"=>230, "\u036A"=>230, "\u036B"=>230, "\u036C"=>230, "\u036D"=>230, "\u036E"=>230, "\u036F"=>230, "\u0483"=>230,
- "\u0484"=>230, "\u0485"=>230, "\u0486"=>230, "\u0487"=>230, "\u0591"=>220, "\u0592"=>230, "\u0593"=>230, "\u0594"=>230,
- "\u0595"=>230, "\u0596"=>220, "\u0597"=>230, "\u0598"=>230, "\u0599"=>230, "\u059A"=>222, "\u059B"=>220, "\u059C"=>230,
- "\u059D"=>230, "\u059E"=>230, "\u059F"=>230, "\u05A0"=>230, "\u05A1"=>230, "\u05A2"=>220, "\u05A3"=>220, "\u05A4"=>220,
- "\u05A5"=>220, "\u05A6"=>220, "\u05A7"=>220, "\u05A8"=>230, "\u05A9"=>230, "\u05AA"=>220, "\u05AB"=>230, "\u05AC"=>230,
- "\u05AD"=>222, "\u05AE"=>228, "\u05AF"=>230, "\u05B0"=>10, "\u05B1"=>11, "\u05B2"=>12, "\u05B3"=>13, "\u05B4"=>14,
- "\u05B5"=>15, "\u05B6"=>16, "\u05B7"=>17, "\u05B8"=>18, "\u05B9"=>19, "\u05BA"=>19, "\u05BB"=>20, "\u05BC"=>21,
- "\u05BD"=>22, "\u05BF"=>23, "\u05C1"=>24, "\u05C2"=>25, "\u05C4"=>230, "\u05C5"=>220, "\u05C7"=>18, "\u0610"=>230,
- "\u0611"=>230, "\u0612"=>230, "\u0613"=>230, "\u0614"=>230, "\u0615"=>230, "\u0616"=>230, "\u0617"=>230, "\u0618"=>30,
- "\u0619"=>31, "\u061A"=>32, "\u064B"=>27, "\u064C"=>28, "\u064D"=>29, "\u064E"=>30, "\u064F"=>31, "\u0650"=>32,
- "\u0651"=>33, "\u0652"=>34, "\u0653"=>230, "\u0654"=>230, "\u0655"=>220, "\u0656"=>220, "\u0657"=>230, "\u0658"=>230,
- "\u0659"=>230, "\u065A"=>230, "\u065B"=>230, "\u065C"=>220, "\u065D"=>230, "\u065E"=>230, "\u065F"=>220, "\u0670"=>35,
- "\u06D6"=>230, "\u06D7"=>230, "\u06D8"=>230, "\u06D9"=>230, "\u06DA"=>230, "\u06DB"=>230, "\u06DC"=>230, "\u06DF"=>230,
- "\u06E0"=>230, "\u06E1"=>230, "\u06E2"=>230, "\u06E3"=>220, "\u06E4"=>230, "\u06E7"=>230, "\u06E8"=>230, "\u06EA"=>220,
- "\u06EB"=>230, "\u06EC"=>230, "\u06ED"=>220, "\u0711"=>36, "\u0730"=>230, "\u0731"=>220, "\u0732"=>230, "\u0733"=>230,
- "\u0734"=>220, "\u0735"=>230, "\u0736"=>230, "\u0737"=>220, "\u0738"=>220, "\u0739"=>220, "\u073A"=>230, "\u073B"=>220,
- "\u073C"=>220, "\u073D"=>230, "\u073E"=>220, "\u073F"=>230, "\u0740"=>230, "\u0741"=>230, "\u0742"=>220, "\u0743"=>230,
- "\u0744"=>220, "\u0745"=>230, "\u0746"=>220, "\u0747"=>230, "\u0748"=>220, "\u0749"=>230, "\u074A"=>230, "\u07EB"=>230,
- "\u07EC"=>230, "\u07ED"=>230, "\u07EE"=>230, "\u07EF"=>230, "\u07F0"=>230, "\u07F1"=>230, "\u07F2"=>220, "\u07F3"=>230,
- "\u0816"=>230, "\u0817"=>230, "\u0818"=>230, "\u0819"=>230, "\u081B"=>230, "\u081C"=>230, "\u081D"=>230, "\u081E"=>230,
- "\u081F"=>230, "\u0820"=>230, "\u0821"=>230, "\u0822"=>230, "\u0823"=>230, "\u0825"=>230, "\u0826"=>230, "\u0827"=>230,
- "\u0829"=>230, "\u082A"=>230, "\u082B"=>230, "\u082C"=>230, "\u082D"=>230, "\u0859"=>220, "\u085A"=>220, "\u085B"=>220,
- "\u08D4"=>230, "\u08D5"=>230, "\u08D6"=>230, "\u08D7"=>230, "\u08D8"=>230, "\u08D9"=>230, "\u08DA"=>230, "\u08DB"=>230,
- "\u08DC"=>230, "\u08DD"=>230, "\u08DE"=>230, "\u08DF"=>230, "\u08E0"=>230, "\u08E1"=>230, "\u08E3"=>220, "\u08E4"=>230,
- "\u08E5"=>230, "\u08E6"=>220, "\u08E7"=>230, "\u08E8"=>230, "\u08E9"=>220, "\u08EA"=>230, "\u08EB"=>230, "\u08EC"=>230,
- "\u08ED"=>220, "\u08EE"=>220, "\u08EF"=>220, "\u08F0"=>27, "\u08F1"=>28, "\u08F2"=>29, "\u08F3"=>230, "\u08F4"=>230,
- "\u08F5"=>230, "\u08F6"=>220, "\u08F7"=>230, "\u08F8"=>230, "\u08F9"=>220, "\u08FA"=>220, "\u08FB"=>230, "\u08FC"=>230,
- "\u08FD"=>230, "\u08FE"=>230, "\u08FF"=>230, "\u093C"=>7, "\u094D"=>9, "\u0951"=>230, "\u0952"=>220, "\u0953"=>230,
- "\u0954"=>230, "\u09BC"=>7, "\u09CD"=>9, "\u0A3C"=>7, "\u0A4D"=>9, "\u0ABC"=>7, "\u0ACD"=>9, "\u0B3C"=>7,
- "\u0B4D"=>9, "\u0BCD"=>9, "\u0C4D"=>9, "\u0C55"=>84, "\u0C56"=>91, "\u0CBC"=>7, "\u0CCD"=>9, "\u0D3B"=>9,
- "\u0D3C"=>9, "\u0D4D"=>9, "\u0DCA"=>9, "\u0E38"=>103, "\u0E39"=>103, "\u0E3A"=>9, "\u0E48"=>107, "\u0E49"=>107,
- "\u0E4A"=>107, "\u0E4B"=>107, "\u0EB8"=>118, "\u0EB9"=>118, "\u0EC8"=>122, "\u0EC9"=>122, "\u0ECA"=>122, "\u0ECB"=>122,
- "\u0F18"=>220, "\u0F19"=>220, "\u0F35"=>220, "\u0F37"=>220, "\u0F39"=>216, "\u0F71"=>129, "\u0F72"=>130, "\u0F74"=>132,
- "\u0F7A"=>130, "\u0F7B"=>130, "\u0F7C"=>130, "\u0F7D"=>130, "\u0F80"=>130, "\u0F82"=>230, "\u0F83"=>230, "\u0F84"=>9,
- "\u0F86"=>230, "\u0F87"=>230, "\u0FC6"=>220, "\u1037"=>7, "\u1039"=>9, "\u103A"=>9, "\u108D"=>220, "\u135D"=>230,
- "\u135E"=>230, "\u135F"=>230, "\u1714"=>9, "\u1734"=>9, "\u17D2"=>9, "\u17DD"=>230, "\u18A9"=>228, "\u1939"=>222,
- "\u193A"=>230, "\u193B"=>220, "\u1A17"=>230, "\u1A18"=>220, "\u1A60"=>9, "\u1A75"=>230, "\u1A76"=>230, "\u1A77"=>230,
- "\u1A78"=>230, "\u1A79"=>230, "\u1A7A"=>230, "\u1A7B"=>230, "\u1A7C"=>230, "\u1A7F"=>220, "\u1AB0"=>230, "\u1AB1"=>230,
- "\u1AB2"=>230, "\u1AB3"=>230, "\u1AB4"=>230, "\u1AB5"=>220, "\u1AB6"=>220, "\u1AB7"=>220, "\u1AB8"=>220, "\u1AB9"=>220,
- "\u1ABA"=>220, "\u1ABB"=>230, "\u1ABC"=>230, "\u1ABD"=>220, "\u1B34"=>7, "\u1B44"=>9, "\u1B6B"=>230, "\u1B6C"=>220,
- "\u1B6D"=>230, "\u1B6E"=>230, "\u1B6F"=>230, "\u1B70"=>230, "\u1B71"=>230, "\u1B72"=>230, "\u1B73"=>230, "\u1BAA"=>9,
- "\u1BAB"=>9, "\u1BE6"=>7, "\u1BF2"=>9, "\u1BF3"=>9, "\u1C37"=>7, "\u1CD0"=>230, "\u1CD1"=>230, "\u1CD2"=>230,
- "\u1CD4"=>1, "\u1CD5"=>220, "\u1CD6"=>220, "\u1CD7"=>220, "\u1CD8"=>220, "\u1CD9"=>220, "\u1CDA"=>230, "\u1CDB"=>230,
- "\u1CDC"=>220, "\u1CDD"=>220, "\u1CDE"=>220, "\u1CDF"=>220, "\u1CE0"=>230, "\u1CE2"=>1, "\u1CE3"=>1, "\u1CE4"=>1,
- "\u1CE5"=>1, "\u1CE6"=>1, "\u1CE7"=>1, "\u1CE8"=>1, "\u1CED"=>220, "\u1CF4"=>230, "\u1CF8"=>230, "\u1CF9"=>230,
- "\u1DC0"=>230, "\u1DC1"=>230, "\u1DC2"=>220, "\u1DC3"=>230, "\u1DC4"=>230, "\u1DC5"=>230, "\u1DC6"=>230, "\u1DC7"=>230,
- "\u1DC8"=>230, "\u1DC9"=>230, "\u1DCA"=>220, "\u1DCB"=>230, "\u1DCC"=>230, "\u1DCD"=>234, "\u1DCE"=>214, "\u1DCF"=>220,
- "\u1DD0"=>202, "\u1DD1"=>230, "\u1DD2"=>230, "\u1DD3"=>230, "\u1DD4"=>230, "\u1DD5"=>230, "\u1DD6"=>230, "\u1DD7"=>230,
- "\u1DD8"=>230, "\u1DD9"=>230, "\u1DDA"=>230, "\u1DDB"=>230, "\u1DDC"=>230, "\u1DDD"=>230, "\u1DDE"=>230, "\u1DDF"=>230,
- "\u1DE0"=>230, "\u1DE1"=>230, "\u1DE2"=>230, "\u1DE3"=>230, "\u1DE4"=>230, "\u1DE5"=>230, "\u1DE6"=>230, "\u1DE7"=>230,
- "\u1DE8"=>230, "\u1DE9"=>230, "\u1DEA"=>230, "\u1DEB"=>230, "\u1DEC"=>230, "\u1DED"=>230, "\u1DEE"=>230, "\u1DEF"=>230,
- "\u1DF0"=>230, "\u1DF1"=>230, "\u1DF2"=>230, "\u1DF3"=>230, "\u1DF4"=>230, "\u1DF5"=>230, "\u1DF6"=>232, "\u1DF7"=>228,
- "\u1DF8"=>228, "\u1DF9"=>220, "\u1DFB"=>230, "\u1DFC"=>233, "\u1DFD"=>220, "\u1DFE"=>230, "\u1DFF"=>220, "\u20D0"=>230,
- "\u20D1"=>230, "\u20D2"=>1, "\u20D3"=>1, "\u20D4"=>230, "\u20D5"=>230, "\u20D6"=>230, "\u20D7"=>230, "\u20D8"=>1,
- "\u20D9"=>1, "\u20DA"=>1, "\u20DB"=>230, "\u20DC"=>230, "\u20E1"=>230, "\u20E5"=>1, "\u20E6"=>1, "\u20E7"=>230,
- "\u20E8"=>220, "\u20E9"=>230, "\u20EA"=>1, "\u20EB"=>1, "\u20EC"=>220, "\u20ED"=>220, "\u20EE"=>220, "\u20EF"=>220,
- "\u20F0"=>230, "\u2CEF"=>230, "\u2CF0"=>230, "\u2CF1"=>230, "\u2D7F"=>9, "\u2DE0"=>230, "\u2DE1"=>230, "\u2DE2"=>230,
- "\u2DE3"=>230, "\u2DE4"=>230, "\u2DE5"=>230, "\u2DE6"=>230, "\u2DE7"=>230, "\u2DE8"=>230, "\u2DE9"=>230, "\u2DEA"=>230,
- "\u2DEB"=>230, "\u2DEC"=>230, "\u2DED"=>230, "\u2DEE"=>230, "\u2DEF"=>230, "\u2DF0"=>230, "\u2DF1"=>230, "\u2DF2"=>230,
- "\u2DF3"=>230, "\u2DF4"=>230, "\u2DF5"=>230, "\u2DF6"=>230, "\u2DF7"=>230, "\u2DF8"=>230, "\u2DF9"=>230, "\u2DFA"=>230,
- "\u2DFB"=>230, "\u2DFC"=>230, "\u2DFD"=>230, "\u2DFE"=>230, "\u2DFF"=>230, "\u302A"=>218, "\u302B"=>228, "\u302C"=>232,
- "\u302D"=>222, "\u302E"=>224, "\u302F"=>224, "\u3099"=>8, "\u309A"=>8, "\uA66F"=>230, "\uA674"=>230, "\uA675"=>230,
- "\uA676"=>230, "\uA677"=>230, "\uA678"=>230, "\uA679"=>230, "\uA67A"=>230, "\uA67B"=>230, "\uA67C"=>230, "\uA67D"=>230,
- "\uA69E"=>230, "\uA69F"=>230, "\uA6F0"=>230, "\uA6F1"=>230, "\uA806"=>9, "\uA8C4"=>9, "\uA8E0"=>230, "\uA8E1"=>230,
- "\uA8E2"=>230, "\uA8E3"=>230, "\uA8E4"=>230, "\uA8E5"=>230, "\uA8E6"=>230, "\uA8E7"=>230, "\uA8E8"=>230, "\uA8E9"=>230,
- "\uA8EA"=>230, "\uA8EB"=>230, "\uA8EC"=>230, "\uA8ED"=>230, "\uA8EE"=>230, "\uA8EF"=>230, "\uA8F0"=>230, "\uA8F1"=>230,
- "\uA92B"=>220, "\uA92C"=>220, "\uA92D"=>220, "\uA953"=>9, "\uA9B3"=>7, "\uA9C0"=>9, "\uAAB0"=>230, "\uAAB2"=>230,
- "\uAAB3"=>230, "\uAAB4"=>220, "\uAAB7"=>230, "\uAAB8"=>230, "\uAABE"=>230, "\uAABF"=>230, "\uAAC1"=>230, "\uAAF6"=>9,
- "\uABED"=>9, "\uFB1E"=>26, "\uFE20"=>230, "\uFE21"=>230, "\uFE22"=>230, "\uFE23"=>230, "\uFE24"=>230, "\uFE25"=>230,
- "\uFE26"=>230, "\uFE27"=>220, "\uFE28"=>220, "\uFE29"=>220, "\uFE2A"=>220, "\uFE2B"=>220, "\uFE2C"=>220, "\uFE2D"=>220,
- "\uFE2E"=>230, "\uFE2F"=>230, "\u{101FD}"=>220, "\u{102E0}"=>220, "\u{10376}"=>230, "\u{10377}"=>230, "\u{10378}"=>230, "\u{10379}"=>230,
- "\u{1037A}"=>230, "\u{10A0D}"=>220, "\u{10A0F}"=>230, "\u{10A38}"=>230, "\u{10A39}"=>1, "\u{10A3A}"=>220, "\u{10A3F}"=>9, "\u{10AE5}"=>230,
- "\u{10AE6}"=>220, "\u{11046}"=>9, "\u{1107F}"=>9, "\u{110B9}"=>9, "\u{110BA}"=>7, "\u{11100}"=>230, "\u{11101}"=>230, "\u{11102}"=>230,
- "\u{11133}"=>9, "\u{11134}"=>9, "\u{11173}"=>7, "\u{111C0}"=>9, "\u{111CA}"=>7, "\u{11235}"=>9, "\u{11236}"=>7, "\u{112E9}"=>7,
- "\u{112EA}"=>9, "\u{1133C}"=>7, "\u{1134D}"=>9, "\u{11366}"=>230, "\u{11367}"=>230, "\u{11368}"=>230, "\u{11369}"=>230, "\u{1136A}"=>230,
- "\u{1136B}"=>230, "\u{1136C}"=>230, "\u{11370}"=>230, "\u{11371}"=>230, "\u{11372}"=>230, "\u{11373}"=>230, "\u{11374}"=>230, "\u{11442}"=>9,
- "\u{11446}"=>7, "\u{114C2}"=>9, "\u{114C3}"=>7, "\u{115BF}"=>9, "\u{115C0}"=>7, "\u{1163F}"=>9, "\u{116B6}"=>9, "\u{116B7}"=>7,
- "\u{1172B}"=>9, "\u{11A34}"=>9, "\u{11A47}"=>9, "\u{11A99}"=>9, "\u{11C3F}"=>9, "\u{11D42}"=>7, "\u{11D44}"=>9, "\u{11D45}"=>9,
- "\u{16AF0}"=>1, "\u{16AF1}"=>1, "\u{16AF2}"=>1, "\u{16AF3}"=>1, "\u{16AF4}"=>1, "\u{16B30}"=>230, "\u{16B31}"=>230, "\u{16B32}"=>230,
- "\u{16B33}"=>230, "\u{16B34}"=>230, "\u{16B35}"=>230, "\u{16B36}"=>230, "\u{1BC9E}"=>1, "\u{1D165}"=>216, "\u{1D166}"=>216, "\u{1D167}"=>1,
- "\u{1D168}"=>1, "\u{1D169}"=>1, "\u{1D16D}"=>226, "\u{1D16E}"=>216, "\u{1D16F}"=>216, "\u{1D170}"=>216, "\u{1D171}"=>216, "\u{1D172}"=>216,
- "\u{1D17B}"=>220, "\u{1D17C}"=>220, "\u{1D17D}"=>220, "\u{1D17E}"=>220, "\u{1D17F}"=>220, "\u{1D180}"=>220, "\u{1D181}"=>220, "\u{1D182}"=>220,
- "\u{1D185}"=>230, "\u{1D186}"=>230, "\u{1D187}"=>230, "\u{1D188}"=>230, "\u{1D189}"=>230, "\u{1D18A}"=>220, "\u{1D18B}"=>220, "\u{1D1AA}"=>230,
- "\u{1D1AB}"=>230, "\u{1D1AC}"=>230, "\u{1D1AD}"=>230, "\u{1D242}"=>230, "\u{1D243}"=>230, "\u{1D244}"=>230, "\u{1E000}"=>230, "\u{1E001}"=>230,
- "\u{1E002}"=>230, "\u{1E003}"=>230, "\u{1E004}"=>230, "\u{1E005}"=>230, "\u{1E006}"=>230, "\u{1E008}"=>230, "\u{1E009}"=>230, "\u{1E00A}"=>230,
- "\u{1E00B}"=>230, "\u{1E00C}"=>230, "\u{1E00D}"=>230, "\u{1E00E}"=>230, "\u{1E00F}"=>230, "\u{1E010}"=>230, "\u{1E011}"=>230, "\u{1E012}"=>230,
- "\u{1E013}"=>230, "\u{1E014}"=>230, "\u{1E015}"=>230, "\u{1E016}"=>230, "\u{1E017}"=>230, "\u{1E018}"=>230, "\u{1E01B}"=>230, "\u{1E01C}"=>230,
- "\u{1E01D}"=>230, "\u{1E01E}"=>230, "\u{1E01F}"=>230, "\u{1E020}"=>230, "\u{1E021}"=>230, "\u{1E023}"=>230, "\u{1E024}"=>230, "\u{1E026}"=>230,
- "\u{1E027}"=>230, "\u{1E028}"=>230, "\u{1E029}"=>230, "\u{1E02A}"=>230, "\u{1E8D0}"=>220, "\u{1E8D1}"=>220, "\u{1E8D2}"=>220, "\u{1E8D3}"=>220,
- "\u{1E8D4}"=>220, "\u{1E8D5}"=>220, "\u{1E8D6}"=>220, "\u{1E944}"=>230, "\u{1E945}"=>230, "\u{1E946}"=>230, "\u{1E947}"=>230, "\u{1E948}"=>230,
- "\u{1E949}"=>230, "\u{1E94A}"=>7,
- }
- class_table.default = 0
- CLASS_TABLE = class_table.freeze
-
- DECOMPOSITION_TABLE = {
- "\u00C0"=>"A\u0300", "\u00C1"=>"A\u0301", "\u00C2"=>"A\u0302", "\u00C3"=>"A\u0303", "\u00C4"=>"A\u0308", "\u00C5"=>"A\u030A", "\u00C7"=>"C\u0327", "\u00C8"=>"E\u0300",
- "\u00C9"=>"E\u0301", "\u00CA"=>"E\u0302", "\u00CB"=>"E\u0308", "\u00CC"=>"I\u0300", "\u00CD"=>"I\u0301", "\u00CE"=>"I\u0302", "\u00CF"=>"I\u0308", "\u00D1"=>"N\u0303",
- "\u00D2"=>"O\u0300", "\u00D3"=>"O\u0301", "\u00D4"=>"O\u0302", "\u00D5"=>"O\u0303", "\u00D6"=>"O\u0308", "\u00D9"=>"U\u0300", "\u00DA"=>"U\u0301", "\u00DB"=>"U\u0302",
- "\u00DC"=>"U\u0308", "\u00DD"=>"Y\u0301", "\u00E0"=>"a\u0300", "\u00E1"=>"a\u0301", "\u00E2"=>"a\u0302", "\u00E3"=>"a\u0303", "\u00E4"=>"a\u0308", "\u00E5"=>"a\u030A",
- "\u00E7"=>"c\u0327", "\u00E8"=>"e\u0300", "\u00E9"=>"e\u0301", "\u00EA"=>"e\u0302", "\u00EB"=>"e\u0308", "\u00EC"=>"i\u0300", "\u00ED"=>"i\u0301", "\u00EE"=>"i\u0302",
- "\u00EF"=>"i\u0308", "\u00F1"=>"n\u0303", "\u00F2"=>"o\u0300", "\u00F3"=>"o\u0301", "\u00F4"=>"o\u0302", "\u00F5"=>"o\u0303", "\u00F6"=>"o\u0308", "\u00F9"=>"u\u0300",
- "\u00FA"=>"u\u0301", "\u00FB"=>"u\u0302", "\u00FC"=>"u\u0308", "\u00FD"=>"y\u0301", "\u00FF"=>"y\u0308", "\u0100"=>"A\u0304", "\u0101"=>"a\u0304", "\u0102"=>"A\u0306",
- "\u0103"=>"a\u0306", "\u0104"=>"A\u0328", "\u0105"=>"a\u0328", "\u0106"=>"C\u0301", "\u0107"=>"c\u0301", "\u0108"=>"C\u0302", "\u0109"=>"c\u0302", "\u010A"=>"C\u0307",
- "\u010B"=>"c\u0307", "\u010C"=>"C\u030C", "\u010D"=>"c\u030C", "\u010E"=>"D\u030C", "\u010F"=>"d\u030C", "\u0112"=>"E\u0304", "\u0113"=>"e\u0304", "\u0114"=>"E\u0306",
- "\u0115"=>"e\u0306", "\u0116"=>"E\u0307", "\u0117"=>"e\u0307", "\u0118"=>"E\u0328", "\u0119"=>"e\u0328", "\u011A"=>"E\u030C", "\u011B"=>"e\u030C", "\u011C"=>"G\u0302",
- "\u011D"=>"g\u0302", "\u011E"=>"G\u0306", "\u011F"=>"g\u0306", "\u0120"=>"G\u0307", "\u0121"=>"g\u0307", "\u0122"=>"G\u0327", "\u0123"=>"g\u0327", "\u0124"=>"H\u0302",
- "\u0125"=>"h\u0302", "\u0128"=>"I\u0303", "\u0129"=>"i\u0303", "\u012A"=>"I\u0304", "\u012B"=>"i\u0304", "\u012C"=>"I\u0306", "\u012D"=>"i\u0306", "\u012E"=>"I\u0328",
- "\u012F"=>"i\u0328", "\u0130"=>"I\u0307", "\u0134"=>"J\u0302", "\u0135"=>"j\u0302", "\u0136"=>"K\u0327", "\u0137"=>"k\u0327", "\u0139"=>"L\u0301", "\u013A"=>"l\u0301",
- "\u013B"=>"L\u0327", "\u013C"=>"l\u0327", "\u013D"=>"L\u030C", "\u013E"=>"l\u030C", "\u0143"=>"N\u0301", "\u0144"=>"n\u0301", "\u0145"=>"N\u0327", "\u0146"=>"n\u0327",
- "\u0147"=>"N\u030C", "\u0148"=>"n\u030C", "\u014C"=>"O\u0304", "\u014D"=>"o\u0304", "\u014E"=>"O\u0306", "\u014F"=>"o\u0306", "\u0150"=>"O\u030B", "\u0151"=>"o\u030B",
- "\u0154"=>"R\u0301", "\u0155"=>"r\u0301", "\u0156"=>"R\u0327", "\u0157"=>"r\u0327", "\u0158"=>"R\u030C", "\u0159"=>"r\u030C", "\u015A"=>"S\u0301", "\u015B"=>"s\u0301",
- "\u015C"=>"S\u0302", "\u015D"=>"s\u0302", "\u015E"=>"S\u0327", "\u015F"=>"s\u0327", "\u0160"=>"S\u030C", "\u0161"=>"s\u030C", "\u0162"=>"T\u0327", "\u0163"=>"t\u0327",
- "\u0164"=>"T\u030C", "\u0165"=>"t\u030C", "\u0168"=>"U\u0303", "\u0169"=>"u\u0303", "\u016A"=>"U\u0304", "\u016B"=>"u\u0304", "\u016C"=>"U\u0306", "\u016D"=>"u\u0306",
- "\u016E"=>"U\u030A", "\u016F"=>"u\u030A", "\u0170"=>"U\u030B", "\u0171"=>"u\u030B", "\u0172"=>"U\u0328", "\u0173"=>"u\u0328", "\u0174"=>"W\u0302", "\u0175"=>"w\u0302",
- "\u0176"=>"Y\u0302", "\u0177"=>"y\u0302", "\u0178"=>"Y\u0308", "\u0179"=>"Z\u0301", "\u017A"=>"z\u0301", "\u017B"=>"Z\u0307", "\u017C"=>"z\u0307", "\u017D"=>"Z\u030C",
- "\u017E"=>"z\u030C", "\u01A0"=>"O\u031B", "\u01A1"=>"o\u031B", "\u01AF"=>"U\u031B", "\u01B0"=>"u\u031B", "\u01CD"=>"A\u030C", "\u01CE"=>"a\u030C", "\u01CF"=>"I\u030C",
- "\u01D0"=>"i\u030C", "\u01D1"=>"O\u030C", "\u01D2"=>"o\u030C", "\u01D3"=>"U\u030C", "\u01D4"=>"u\u030C", "\u01D5"=>"U\u0308\u0304", "\u01D6"=>"u\u0308\u0304", "\u01D7"=>"U\u0308\u0301",
- "\u01D8"=>"u\u0308\u0301", "\u01D9"=>"U\u0308\u030C", "\u01DA"=>"u\u0308\u030C", "\u01DB"=>"U\u0308\u0300", "\u01DC"=>"u\u0308\u0300", "\u01DE"=>"A\u0308\u0304", "\u01DF"=>"a\u0308\u0304", "\u01E0"=>"A\u0307\u0304",
- "\u01E1"=>"a\u0307\u0304", "\u01E2"=>"\u00C6\u0304", "\u01E3"=>"\u00E6\u0304", "\u01E6"=>"G\u030C", "\u01E7"=>"g\u030C", "\u01E8"=>"K\u030C", "\u01E9"=>"k\u030C", "\u01EA"=>"O\u0328",
- "\u01EB"=>"o\u0328", "\u01EC"=>"O\u0328\u0304", "\u01ED"=>"o\u0328\u0304", "\u01EE"=>"\u01B7\u030C", "\u01EF"=>"\u0292\u030C", "\u01F0"=>"j\u030C", "\u01F4"=>"G\u0301", "\u01F5"=>"g\u0301",
- "\u01F8"=>"N\u0300", "\u01F9"=>"n\u0300", "\u01FA"=>"A\u030A\u0301", "\u01FB"=>"a\u030A\u0301", "\u01FC"=>"\u00C6\u0301", "\u01FD"=>"\u00E6\u0301", "\u01FE"=>"\u00D8\u0301", "\u01FF"=>"\u00F8\u0301",
- "\u0200"=>"A\u030F", "\u0201"=>"a\u030F", "\u0202"=>"A\u0311", "\u0203"=>"a\u0311", "\u0204"=>"E\u030F", "\u0205"=>"e\u030F", "\u0206"=>"E\u0311", "\u0207"=>"e\u0311",
- "\u0208"=>"I\u030F", "\u0209"=>"i\u030F", "\u020A"=>"I\u0311", "\u020B"=>"i\u0311", "\u020C"=>"O\u030F", "\u020D"=>"o\u030F", "\u020E"=>"O\u0311", "\u020F"=>"o\u0311",
- "\u0210"=>"R\u030F", "\u0211"=>"r\u030F", "\u0212"=>"R\u0311", "\u0213"=>"r\u0311", "\u0214"=>"U\u030F", "\u0215"=>"u\u030F", "\u0216"=>"U\u0311", "\u0217"=>"u\u0311",
- "\u0218"=>"S\u0326", "\u0219"=>"s\u0326", "\u021A"=>"T\u0326", "\u021B"=>"t\u0326", "\u021E"=>"H\u030C", "\u021F"=>"h\u030C", "\u0226"=>"A\u0307", "\u0227"=>"a\u0307",
- "\u0228"=>"E\u0327", "\u0229"=>"e\u0327", "\u022A"=>"O\u0308\u0304", "\u022B"=>"o\u0308\u0304", "\u022C"=>"O\u0303\u0304", "\u022D"=>"o\u0303\u0304", "\u022E"=>"O\u0307", "\u022F"=>"o\u0307",
- "\u0230"=>"O\u0307\u0304", "\u0231"=>"o\u0307\u0304", "\u0232"=>"Y\u0304", "\u0233"=>"y\u0304", "\u0340"=>"\u0300", "\u0341"=>"\u0301", "\u0343"=>"\u0313", "\u0344"=>"\u0308\u0301",
- "\u0374"=>"\u02B9", "\u037E"=>";", "\u0385"=>"\u00A8\u0301", "\u0386"=>"\u0391\u0301", "\u0387"=>"\u00B7", "\u0388"=>"\u0395\u0301", "\u0389"=>"\u0397\u0301", "\u038A"=>"\u0399\u0301",
- "\u038C"=>"\u039F\u0301", "\u038E"=>"\u03A5\u0301", "\u038F"=>"\u03A9\u0301", "\u0390"=>"\u03B9\u0308\u0301", "\u03AA"=>"\u0399\u0308", "\u03AB"=>"\u03A5\u0308", "\u03AC"=>"\u03B1\u0301", "\u03AD"=>"\u03B5\u0301",
- "\u03AE"=>"\u03B7\u0301", "\u03AF"=>"\u03B9\u0301", "\u03B0"=>"\u03C5\u0308\u0301", "\u03CA"=>"\u03B9\u0308", "\u03CB"=>"\u03C5\u0308", "\u03CC"=>"\u03BF\u0301", "\u03CD"=>"\u03C5\u0301", "\u03CE"=>"\u03C9\u0301",
- "\u03D3"=>"\u03D2\u0301", "\u03D4"=>"\u03D2\u0308", "\u0400"=>"\u0415\u0300", "\u0401"=>"\u0415\u0308", "\u0403"=>"\u0413\u0301", "\u0407"=>"\u0406\u0308", "\u040C"=>"\u041A\u0301", "\u040D"=>"\u0418\u0300",
- "\u040E"=>"\u0423\u0306", "\u0419"=>"\u0418\u0306", "\u0439"=>"\u0438\u0306", "\u0450"=>"\u0435\u0300", "\u0451"=>"\u0435\u0308", "\u0453"=>"\u0433\u0301", "\u0457"=>"\u0456\u0308", "\u045C"=>"\u043A\u0301",
- "\u045D"=>"\u0438\u0300", "\u045E"=>"\u0443\u0306", "\u0476"=>"\u0474\u030F", "\u0477"=>"\u0475\u030F", "\u04C1"=>"\u0416\u0306", "\u04C2"=>"\u0436\u0306", "\u04D0"=>"\u0410\u0306", "\u04D1"=>"\u0430\u0306",
- "\u04D2"=>"\u0410\u0308", "\u04D3"=>"\u0430\u0308", "\u04D6"=>"\u0415\u0306", "\u04D7"=>"\u0435\u0306", "\u04DA"=>"\u04D8\u0308", "\u04DB"=>"\u04D9\u0308", "\u04DC"=>"\u0416\u0308", "\u04DD"=>"\u0436\u0308",
- "\u04DE"=>"\u0417\u0308", "\u04DF"=>"\u0437\u0308", "\u04E2"=>"\u0418\u0304", "\u04E3"=>"\u0438\u0304", "\u04E4"=>"\u0418\u0308", "\u04E5"=>"\u0438\u0308", "\u04E6"=>"\u041E\u0308", "\u04E7"=>"\u043E\u0308",
- "\u04EA"=>"\u04E8\u0308", "\u04EB"=>"\u04E9\u0308", "\u04EC"=>"\u042D\u0308", "\u04ED"=>"\u044D\u0308", "\u04EE"=>"\u0423\u0304", "\u04EF"=>"\u0443\u0304", "\u04F0"=>"\u0423\u0308", "\u04F1"=>"\u0443\u0308",
- "\u04F2"=>"\u0423\u030B", "\u04F3"=>"\u0443\u030B", "\u04F4"=>"\u0427\u0308", "\u04F5"=>"\u0447\u0308", "\u04F8"=>"\u042B\u0308", "\u04F9"=>"\u044B\u0308", "\u0622"=>"\u0627\u0653", "\u0623"=>"\u0627\u0654",
- "\u0624"=>"\u0648\u0654", "\u0625"=>"\u0627\u0655", "\u0626"=>"\u064A\u0654", "\u06C0"=>"\u06D5\u0654", "\u06C2"=>"\u06C1\u0654", "\u06D3"=>"\u06D2\u0654", "\u0929"=>"\u0928\u093C", "\u0931"=>"\u0930\u093C",
- "\u0934"=>"\u0933\u093C", "\u0958"=>"\u0915\u093C", "\u0959"=>"\u0916\u093C", "\u095A"=>"\u0917\u093C", "\u095B"=>"\u091C\u093C", "\u095C"=>"\u0921\u093C", "\u095D"=>"\u0922\u093C", "\u095E"=>"\u092B\u093C",
- "\u095F"=>"\u092F\u093C", "\u09CB"=>"\u09C7\u09BE", "\u09CC"=>"\u09C7\u09D7", "\u09DC"=>"\u09A1\u09BC", "\u09DD"=>"\u09A2\u09BC", "\u09DF"=>"\u09AF\u09BC", "\u0A33"=>"\u0A32\u0A3C", "\u0A36"=>"\u0A38\u0A3C",
- "\u0A59"=>"\u0A16\u0A3C", "\u0A5A"=>"\u0A17\u0A3C", "\u0A5B"=>"\u0A1C\u0A3C", "\u0A5E"=>"\u0A2B\u0A3C", "\u0B48"=>"\u0B47\u0B56", "\u0B4B"=>"\u0B47\u0B3E", "\u0B4C"=>"\u0B47\u0B57", "\u0B5C"=>"\u0B21\u0B3C",
- "\u0B5D"=>"\u0B22\u0B3C", "\u0B94"=>"\u0B92\u0BD7", "\u0BCA"=>"\u0BC6\u0BBE", "\u0BCB"=>"\u0BC7\u0BBE", "\u0BCC"=>"\u0BC6\u0BD7", "\u0C48"=>"\u0C46\u0C56", "\u0CC0"=>"\u0CBF\u0CD5", "\u0CC7"=>"\u0CC6\u0CD5",
- "\u0CC8"=>"\u0CC6\u0CD6", "\u0CCA"=>"\u0CC6\u0CC2", "\u0CCB"=>"\u0CC6\u0CC2\u0CD5", "\u0D4A"=>"\u0D46\u0D3E", "\u0D4B"=>"\u0D47\u0D3E", "\u0D4C"=>"\u0D46\u0D57", "\u0DDA"=>"\u0DD9\u0DCA", "\u0DDC"=>"\u0DD9\u0DCF",
- "\u0DDD"=>"\u0DD9\u0DCF\u0DCA", "\u0DDE"=>"\u0DD9\u0DDF", "\u0F43"=>"\u0F42\u0FB7", "\u0F4D"=>"\u0F4C\u0FB7", "\u0F52"=>"\u0F51\u0FB7", "\u0F57"=>"\u0F56\u0FB7", "\u0F5C"=>"\u0F5B\u0FB7", "\u0F69"=>"\u0F40\u0FB5",
- "\u0F73"=>"\u0F71\u0F72", "\u0F75"=>"\u0F71\u0F74", "\u0F76"=>"\u0FB2\u0F80", "\u0F78"=>"\u0FB3\u0F80", "\u0F81"=>"\u0F71\u0F80", "\u0F93"=>"\u0F92\u0FB7", "\u0F9D"=>"\u0F9C\u0FB7", "\u0FA2"=>"\u0FA1\u0FB7",
- "\u0FA7"=>"\u0FA6\u0FB7", "\u0FAC"=>"\u0FAB\u0FB7", "\u0FB9"=>"\u0F90\u0FB5", "\u1026"=>"\u1025\u102E", "\u1B06"=>"\u1B05\u1B35", "\u1B08"=>"\u1B07\u1B35", "\u1B0A"=>"\u1B09\u1B35", "\u1B0C"=>"\u1B0B\u1B35",
- "\u1B0E"=>"\u1B0D\u1B35", "\u1B12"=>"\u1B11\u1B35", "\u1B3B"=>"\u1B3A\u1B35", "\u1B3D"=>"\u1B3C\u1B35", "\u1B40"=>"\u1B3E\u1B35", "\u1B41"=>"\u1B3F\u1B35", "\u1B43"=>"\u1B42\u1B35", "\u1E00"=>"A\u0325",
- "\u1E01"=>"a\u0325", "\u1E02"=>"B\u0307", "\u1E03"=>"b\u0307", "\u1E04"=>"B\u0323", "\u1E05"=>"b\u0323", "\u1E06"=>"B\u0331", "\u1E07"=>"b\u0331", "\u1E08"=>"C\u0327\u0301",
- "\u1E09"=>"c\u0327\u0301", "\u1E0A"=>"D\u0307", "\u1E0B"=>"d\u0307", "\u1E0C"=>"D\u0323", "\u1E0D"=>"d\u0323", "\u1E0E"=>"D\u0331", "\u1E0F"=>"d\u0331", "\u1E10"=>"D\u0327",
- "\u1E11"=>"d\u0327", "\u1E12"=>"D\u032D", "\u1E13"=>"d\u032D", "\u1E14"=>"E\u0304\u0300", "\u1E15"=>"e\u0304\u0300", "\u1E16"=>"E\u0304\u0301", "\u1E17"=>"e\u0304\u0301", "\u1E18"=>"E\u032D",
- "\u1E19"=>"e\u032D", "\u1E1A"=>"E\u0330", "\u1E1B"=>"e\u0330", "\u1E1C"=>"E\u0327\u0306", "\u1E1D"=>"e\u0327\u0306", "\u1E1E"=>"F\u0307", "\u1E1F"=>"f\u0307", "\u1E20"=>"G\u0304",
- "\u1E21"=>"g\u0304", "\u1E22"=>"H\u0307", "\u1E23"=>"h\u0307", "\u1E24"=>"H\u0323", "\u1E25"=>"h\u0323", "\u1E26"=>"H\u0308", "\u1E27"=>"h\u0308", "\u1E28"=>"H\u0327",
- "\u1E29"=>"h\u0327", "\u1E2A"=>"H\u032E", "\u1E2B"=>"h\u032E", "\u1E2C"=>"I\u0330", "\u1E2D"=>"i\u0330", "\u1E2E"=>"I\u0308\u0301", "\u1E2F"=>"i\u0308\u0301", "\u1E30"=>"K\u0301",
- "\u1E31"=>"k\u0301", "\u1E32"=>"K\u0323", "\u1E33"=>"k\u0323", "\u1E34"=>"K\u0331", "\u1E35"=>"k\u0331", "\u1E36"=>"L\u0323", "\u1E37"=>"l\u0323", "\u1E38"=>"L\u0323\u0304",
- "\u1E39"=>"l\u0323\u0304", "\u1E3A"=>"L\u0331", "\u1E3B"=>"l\u0331", "\u1E3C"=>"L\u032D", "\u1E3D"=>"l\u032D", "\u1E3E"=>"M\u0301", "\u1E3F"=>"m\u0301", "\u1E40"=>"M\u0307",
- "\u1E41"=>"m\u0307", "\u1E42"=>"M\u0323", "\u1E43"=>"m\u0323", "\u1E44"=>"N\u0307", "\u1E45"=>"n\u0307", "\u1E46"=>"N\u0323", "\u1E47"=>"n\u0323", "\u1E48"=>"N\u0331",
- "\u1E49"=>"n\u0331", "\u1E4A"=>"N\u032D", "\u1E4B"=>"n\u032D", "\u1E4C"=>"O\u0303\u0301", "\u1E4D"=>"o\u0303\u0301", "\u1E4E"=>"O\u0303\u0308", "\u1E4F"=>"o\u0303\u0308", "\u1E50"=>"O\u0304\u0300",
- "\u1E51"=>"o\u0304\u0300", "\u1E52"=>"O\u0304\u0301", "\u1E53"=>"o\u0304\u0301", "\u1E54"=>"P\u0301", "\u1E55"=>"p\u0301", "\u1E56"=>"P\u0307", "\u1E57"=>"p\u0307", "\u1E58"=>"R\u0307",
- "\u1E59"=>"r\u0307", "\u1E5A"=>"R\u0323", "\u1E5B"=>"r\u0323", "\u1E5C"=>"R\u0323\u0304", "\u1E5D"=>"r\u0323\u0304", "\u1E5E"=>"R\u0331", "\u1E5F"=>"r\u0331", "\u1E60"=>"S\u0307",
- "\u1E61"=>"s\u0307", "\u1E62"=>"S\u0323", "\u1E63"=>"s\u0323", "\u1E64"=>"S\u0301\u0307", "\u1E65"=>"s\u0301\u0307", "\u1E66"=>"S\u030C\u0307", "\u1E67"=>"s\u030C\u0307", "\u1E68"=>"S\u0323\u0307",
- "\u1E69"=>"s\u0323\u0307", "\u1E6A"=>"T\u0307", "\u1E6B"=>"t\u0307", "\u1E6C"=>"T\u0323", "\u1E6D"=>"t\u0323", "\u1E6E"=>"T\u0331", "\u1E6F"=>"t\u0331", "\u1E70"=>"T\u032D",
- "\u1E71"=>"t\u032D", "\u1E72"=>"U\u0324", "\u1E73"=>"u\u0324", "\u1E74"=>"U\u0330", "\u1E75"=>"u\u0330", "\u1E76"=>"U\u032D", "\u1E77"=>"u\u032D", "\u1E78"=>"U\u0303\u0301",
- "\u1E79"=>"u\u0303\u0301", "\u1E7A"=>"U\u0304\u0308", "\u1E7B"=>"u\u0304\u0308", "\u1E7C"=>"V\u0303", "\u1E7D"=>"v\u0303", "\u1E7E"=>"V\u0323", "\u1E7F"=>"v\u0323", "\u1E80"=>"W\u0300",
- "\u1E81"=>"w\u0300", "\u1E82"=>"W\u0301", "\u1E83"=>"w\u0301", "\u1E84"=>"W\u0308", "\u1E85"=>"w\u0308", "\u1E86"=>"W\u0307", "\u1E87"=>"w\u0307", "\u1E88"=>"W\u0323",
- "\u1E89"=>"w\u0323", "\u1E8A"=>"X\u0307", "\u1E8B"=>"x\u0307", "\u1E8C"=>"X\u0308", "\u1E8D"=>"x\u0308", "\u1E8E"=>"Y\u0307", "\u1E8F"=>"y\u0307", "\u1E90"=>"Z\u0302",
- "\u1E91"=>"z\u0302", "\u1E92"=>"Z\u0323", "\u1E93"=>"z\u0323", "\u1E94"=>"Z\u0331", "\u1E95"=>"z\u0331", "\u1E96"=>"h\u0331", "\u1E97"=>"t\u0308", "\u1E98"=>"w\u030A",
- "\u1E99"=>"y\u030A", "\u1E9B"=>"\u017F\u0307", "\u1EA0"=>"A\u0323", "\u1EA1"=>"a\u0323", "\u1EA2"=>"A\u0309", "\u1EA3"=>"a\u0309", "\u1EA4"=>"A\u0302\u0301", "\u1EA5"=>"a\u0302\u0301",
- "\u1EA6"=>"A\u0302\u0300", "\u1EA7"=>"a\u0302\u0300", "\u1EA8"=>"A\u0302\u0309", "\u1EA9"=>"a\u0302\u0309", "\u1EAA"=>"A\u0302\u0303", "\u1EAB"=>"a\u0302\u0303", "\u1EAC"=>"A\u0323\u0302", "\u1EAD"=>"a\u0323\u0302",
- "\u1EAE"=>"A\u0306\u0301", "\u1EAF"=>"a\u0306\u0301", "\u1EB0"=>"A\u0306\u0300", "\u1EB1"=>"a\u0306\u0300", "\u1EB2"=>"A\u0306\u0309", "\u1EB3"=>"a\u0306\u0309", "\u1EB4"=>"A\u0306\u0303", "\u1EB5"=>"a\u0306\u0303",
- "\u1EB6"=>"A\u0323\u0306", "\u1EB7"=>"a\u0323\u0306", "\u1EB8"=>"E\u0323", "\u1EB9"=>"e\u0323", "\u1EBA"=>"E\u0309", "\u1EBB"=>"e\u0309", "\u1EBC"=>"E\u0303", "\u1EBD"=>"e\u0303",
- "\u1EBE"=>"E\u0302\u0301", "\u1EBF"=>"e\u0302\u0301", "\u1EC0"=>"E\u0302\u0300", "\u1EC1"=>"e\u0302\u0300", "\u1EC2"=>"E\u0302\u0309", "\u1EC3"=>"e\u0302\u0309", "\u1EC4"=>"E\u0302\u0303", "\u1EC5"=>"e\u0302\u0303",
- "\u1EC6"=>"E\u0323\u0302", "\u1EC7"=>"e\u0323\u0302", "\u1EC8"=>"I\u0309", "\u1EC9"=>"i\u0309", "\u1ECA"=>"I\u0323", "\u1ECB"=>"i\u0323", "\u1ECC"=>"O\u0323", "\u1ECD"=>"o\u0323",
- "\u1ECE"=>"O\u0309", "\u1ECF"=>"o\u0309", "\u1ED0"=>"O\u0302\u0301", "\u1ED1"=>"o\u0302\u0301", "\u1ED2"=>"O\u0302\u0300", "\u1ED3"=>"o\u0302\u0300", "\u1ED4"=>"O\u0302\u0309", "\u1ED5"=>"o\u0302\u0309",
- "\u1ED6"=>"O\u0302\u0303", "\u1ED7"=>"o\u0302\u0303", "\u1ED8"=>"O\u0323\u0302", "\u1ED9"=>"o\u0323\u0302", "\u1EDA"=>"O\u031B\u0301", "\u1EDB"=>"o\u031B\u0301", "\u1EDC"=>"O\u031B\u0300", "\u1EDD"=>"o\u031B\u0300",
- "\u1EDE"=>"O\u031B\u0309", "\u1EDF"=>"o\u031B\u0309", "\u1EE0"=>"O\u031B\u0303", "\u1EE1"=>"o\u031B\u0303", "\u1EE2"=>"O\u031B\u0323", "\u1EE3"=>"o\u031B\u0323", "\u1EE4"=>"U\u0323", "\u1EE5"=>"u\u0323",
- "\u1EE6"=>"U\u0309", "\u1EE7"=>"u\u0309", "\u1EE8"=>"U\u031B\u0301", "\u1EE9"=>"u\u031B\u0301", "\u1EEA"=>"U\u031B\u0300", "\u1EEB"=>"u\u031B\u0300", "\u1EEC"=>"U\u031B\u0309", "\u1EED"=>"u\u031B\u0309",
- "\u1EEE"=>"U\u031B\u0303", "\u1EEF"=>"u\u031B\u0303", "\u1EF0"=>"U\u031B\u0323", "\u1EF1"=>"u\u031B\u0323", "\u1EF2"=>"Y\u0300", "\u1EF3"=>"y\u0300", "\u1EF4"=>"Y\u0323", "\u1EF5"=>"y\u0323",
- "\u1EF6"=>"Y\u0309", "\u1EF7"=>"y\u0309", "\u1EF8"=>"Y\u0303", "\u1EF9"=>"y\u0303", "\u1F00"=>"\u03B1\u0313", "\u1F01"=>"\u03B1\u0314", "\u1F02"=>"\u03B1\u0313\u0300", "\u1F03"=>"\u03B1\u0314\u0300",
- "\u1F04"=>"\u03B1\u0313\u0301", "\u1F05"=>"\u03B1\u0314\u0301", "\u1F06"=>"\u03B1\u0313\u0342", "\u1F07"=>"\u03B1\u0314\u0342", "\u1F08"=>"\u0391\u0313", "\u1F09"=>"\u0391\u0314", "\u1F0A"=>"\u0391\u0313\u0300", "\u1F0B"=>"\u0391\u0314\u0300",
- "\u1F0C"=>"\u0391\u0313\u0301", "\u1F0D"=>"\u0391\u0314\u0301", "\u1F0E"=>"\u0391\u0313\u0342", "\u1F0F"=>"\u0391\u0314\u0342", "\u1F10"=>"\u03B5\u0313", "\u1F11"=>"\u03B5\u0314", "\u1F12"=>"\u03B5\u0313\u0300", "\u1F13"=>"\u03B5\u0314\u0300",
- "\u1F14"=>"\u03B5\u0313\u0301", "\u1F15"=>"\u03B5\u0314\u0301", "\u1F18"=>"\u0395\u0313", "\u1F19"=>"\u0395\u0314", "\u1F1A"=>"\u0395\u0313\u0300", "\u1F1B"=>"\u0395\u0314\u0300", "\u1F1C"=>"\u0395\u0313\u0301", "\u1F1D"=>"\u0395\u0314\u0301",
- "\u1F20"=>"\u03B7\u0313", "\u1F21"=>"\u03B7\u0314", "\u1F22"=>"\u03B7\u0313\u0300", "\u1F23"=>"\u03B7\u0314\u0300", "\u1F24"=>"\u03B7\u0313\u0301", "\u1F25"=>"\u03B7\u0314\u0301", "\u1F26"=>"\u03B7\u0313\u0342", "\u1F27"=>"\u03B7\u0314\u0342",
- "\u1F28"=>"\u0397\u0313", "\u1F29"=>"\u0397\u0314", "\u1F2A"=>"\u0397\u0313\u0300", "\u1F2B"=>"\u0397\u0314\u0300", "\u1F2C"=>"\u0397\u0313\u0301", "\u1F2D"=>"\u0397\u0314\u0301", "\u1F2E"=>"\u0397\u0313\u0342", "\u1F2F"=>"\u0397\u0314\u0342",
- "\u1F30"=>"\u03B9\u0313", "\u1F31"=>"\u03B9\u0314", "\u1F32"=>"\u03B9\u0313\u0300", "\u1F33"=>"\u03B9\u0314\u0300", "\u1F34"=>"\u03B9\u0313\u0301", "\u1F35"=>"\u03B9\u0314\u0301", "\u1F36"=>"\u03B9\u0313\u0342", "\u1F37"=>"\u03B9\u0314\u0342",
- "\u1F38"=>"\u0399\u0313", "\u1F39"=>"\u0399\u0314", "\u1F3A"=>"\u0399\u0313\u0300", "\u1F3B"=>"\u0399\u0314\u0300", "\u1F3C"=>"\u0399\u0313\u0301", "\u1F3D"=>"\u0399\u0314\u0301", "\u1F3E"=>"\u0399\u0313\u0342", "\u1F3F"=>"\u0399\u0314\u0342",
- "\u1F40"=>"\u03BF\u0313", "\u1F41"=>"\u03BF\u0314", "\u1F42"=>"\u03BF\u0313\u0300", "\u1F43"=>"\u03BF\u0314\u0300", "\u1F44"=>"\u03BF\u0313\u0301", "\u1F45"=>"\u03BF\u0314\u0301", "\u1F48"=>"\u039F\u0313", "\u1F49"=>"\u039F\u0314",
- "\u1F4A"=>"\u039F\u0313\u0300", "\u1F4B"=>"\u039F\u0314\u0300", "\u1F4C"=>"\u039F\u0313\u0301", "\u1F4D"=>"\u039F\u0314\u0301", "\u1F50"=>"\u03C5\u0313", "\u1F51"=>"\u03C5\u0314", "\u1F52"=>"\u03C5\u0313\u0300", "\u1F53"=>"\u03C5\u0314\u0300",
- "\u1F54"=>"\u03C5\u0313\u0301", "\u1F55"=>"\u03C5\u0314\u0301", "\u1F56"=>"\u03C5\u0313\u0342", "\u1F57"=>"\u03C5\u0314\u0342", "\u1F59"=>"\u03A5\u0314", "\u1F5B"=>"\u03A5\u0314\u0300", "\u1F5D"=>"\u03A5\u0314\u0301", "\u1F5F"=>"\u03A5\u0314\u0342",
- "\u1F60"=>"\u03C9\u0313", "\u1F61"=>"\u03C9\u0314", "\u1F62"=>"\u03C9\u0313\u0300", "\u1F63"=>"\u03C9\u0314\u0300", "\u1F64"=>"\u03C9\u0313\u0301", "\u1F65"=>"\u03C9\u0314\u0301", "\u1F66"=>"\u03C9\u0313\u0342", "\u1F67"=>"\u03C9\u0314\u0342",
- "\u1F68"=>"\u03A9\u0313", "\u1F69"=>"\u03A9\u0314", "\u1F6A"=>"\u03A9\u0313\u0300", "\u1F6B"=>"\u03A9\u0314\u0300", "\u1F6C"=>"\u03A9\u0313\u0301", "\u1F6D"=>"\u03A9\u0314\u0301", "\u1F6E"=>"\u03A9\u0313\u0342", "\u1F6F"=>"\u03A9\u0314\u0342",
- "\u1F70"=>"\u03B1\u0300", "\u1F71"=>"\u03B1\u0301", "\u1F72"=>"\u03B5\u0300", "\u1F73"=>"\u03B5\u0301", "\u1F74"=>"\u03B7\u0300", "\u1F75"=>"\u03B7\u0301", "\u1F76"=>"\u03B9\u0300", "\u1F77"=>"\u03B9\u0301",
- "\u1F78"=>"\u03BF\u0300", "\u1F79"=>"\u03BF\u0301", "\u1F7A"=>"\u03C5\u0300", "\u1F7B"=>"\u03C5\u0301", "\u1F7C"=>"\u03C9\u0300", "\u1F7D"=>"\u03C9\u0301", "\u1F80"=>"\u03B1\u0313\u0345", "\u1F81"=>"\u03B1\u0314\u0345",
- "\u1F82"=>"\u03B1\u0313\u0300\u0345", "\u1F83"=>"\u03B1\u0314\u0300\u0345", "\u1F84"=>"\u03B1\u0313\u0301\u0345", "\u1F85"=>"\u03B1\u0314\u0301\u0345", "\u1F86"=>"\u03B1\u0313\u0342\u0345", "\u1F87"=>"\u03B1\u0314\u0342\u0345", "\u1F88"=>"\u0391\u0313\u0345", "\u1F89"=>"\u0391\u0314\u0345",
- "\u1F8A"=>"\u0391\u0313\u0300\u0345", "\u1F8B"=>"\u0391\u0314\u0300\u0345", "\u1F8C"=>"\u0391\u0313\u0301\u0345", "\u1F8D"=>"\u0391\u0314\u0301\u0345", "\u1F8E"=>"\u0391\u0313\u0342\u0345", "\u1F8F"=>"\u0391\u0314\u0342\u0345", "\u1F90"=>"\u03B7\u0313\u0345", "\u1F91"=>"\u03B7\u0314\u0345",
- "\u1F92"=>"\u03B7\u0313\u0300\u0345", "\u1F93"=>"\u03B7\u0314\u0300\u0345", "\u1F94"=>"\u03B7\u0313\u0301\u0345", "\u1F95"=>"\u03B7\u0314\u0301\u0345", "\u1F96"=>"\u03B7\u0313\u0342\u0345", "\u1F97"=>"\u03B7\u0314\u0342\u0345", "\u1F98"=>"\u0397\u0313\u0345", "\u1F99"=>"\u0397\u0314\u0345",
- "\u1F9A"=>"\u0397\u0313\u0300\u0345", "\u1F9B"=>"\u0397\u0314\u0300\u0345", "\u1F9C"=>"\u0397\u0313\u0301\u0345", "\u1F9D"=>"\u0397\u0314\u0301\u0345", "\u1F9E"=>"\u0397\u0313\u0342\u0345", "\u1F9F"=>"\u0397\u0314\u0342\u0345", "\u1FA0"=>"\u03C9\u0313\u0345", "\u1FA1"=>"\u03C9\u0314\u0345",
- "\u1FA2"=>"\u03C9\u0313\u0300\u0345", "\u1FA3"=>"\u03C9\u0314\u0300\u0345", "\u1FA4"=>"\u03C9\u0313\u0301\u0345", "\u1FA5"=>"\u03C9\u0314\u0301\u0345", "\u1FA6"=>"\u03C9\u0313\u0342\u0345", "\u1FA7"=>"\u03C9\u0314\u0342\u0345", "\u1FA8"=>"\u03A9\u0313\u0345", "\u1FA9"=>"\u03A9\u0314\u0345",
- "\u1FAA"=>"\u03A9\u0313\u0300\u0345", "\u1FAB"=>"\u03A9\u0314\u0300\u0345", "\u1FAC"=>"\u03A9\u0313\u0301\u0345", "\u1FAD"=>"\u03A9\u0314\u0301\u0345", "\u1FAE"=>"\u03A9\u0313\u0342\u0345", "\u1FAF"=>"\u03A9\u0314\u0342\u0345", "\u1FB0"=>"\u03B1\u0306", "\u1FB1"=>"\u03B1\u0304",
- "\u1FB2"=>"\u03B1\u0300\u0345", "\u1FB3"=>"\u03B1\u0345", "\u1FB4"=>"\u03B1\u0301\u0345", "\u1FB6"=>"\u03B1\u0342", "\u1FB7"=>"\u03B1\u0342\u0345", "\u1FB8"=>"\u0391\u0306", "\u1FB9"=>"\u0391\u0304", "\u1FBA"=>"\u0391\u0300",
- "\u1FBB"=>"\u0391\u0301", "\u1FBC"=>"\u0391\u0345", "\u1FBE"=>"\u03B9", "\u1FC1"=>"\u00A8\u0342", "\u1FC2"=>"\u03B7\u0300\u0345", "\u1FC3"=>"\u03B7\u0345", "\u1FC4"=>"\u03B7\u0301\u0345", "\u1FC6"=>"\u03B7\u0342",
- "\u1FC7"=>"\u03B7\u0342\u0345", "\u1FC8"=>"\u0395\u0300", "\u1FC9"=>"\u0395\u0301", "\u1FCA"=>"\u0397\u0300", "\u1FCB"=>"\u0397\u0301", "\u1FCC"=>"\u0397\u0345", "\u1FCD"=>"\u1FBF\u0300", "\u1FCE"=>"\u1FBF\u0301",
- "\u1FCF"=>"\u1FBF\u0342", "\u1FD0"=>"\u03B9\u0306", "\u1FD1"=>"\u03B9\u0304", "\u1FD2"=>"\u03B9\u0308\u0300", "\u1FD3"=>"\u03B9\u0308\u0301", "\u1FD6"=>"\u03B9\u0342", "\u1FD7"=>"\u03B9\u0308\u0342", "\u1FD8"=>"\u0399\u0306",
- "\u1FD9"=>"\u0399\u0304", "\u1FDA"=>"\u0399\u0300", "\u1FDB"=>"\u0399\u0301", "\u1FDD"=>"\u1FFE\u0300", "\u1FDE"=>"\u1FFE\u0301", "\u1FDF"=>"\u1FFE\u0342", "\u1FE0"=>"\u03C5\u0306", "\u1FE1"=>"\u03C5\u0304",
- "\u1FE2"=>"\u03C5\u0308\u0300", "\u1FE3"=>"\u03C5\u0308\u0301", "\u1FE4"=>"\u03C1\u0313", "\u1FE5"=>"\u03C1\u0314", "\u1FE6"=>"\u03C5\u0342", "\u1FE7"=>"\u03C5\u0308\u0342", "\u1FE8"=>"\u03A5\u0306", "\u1FE9"=>"\u03A5\u0304",
- "\u1FEA"=>"\u03A5\u0300", "\u1FEB"=>"\u03A5\u0301", "\u1FEC"=>"\u03A1\u0314", "\u1FED"=>"\u00A8\u0300", "\u1FEE"=>"\u00A8\u0301", "\u1FEF"=>"`", "\u1FF2"=>"\u03C9\u0300\u0345", "\u1FF3"=>"\u03C9\u0345",
- "\u1FF4"=>"\u03C9\u0301\u0345", "\u1FF6"=>"\u03C9\u0342", "\u1FF7"=>"\u03C9\u0342\u0345", "\u1FF8"=>"\u039F\u0300", "\u1FF9"=>"\u039F\u0301", "\u1FFA"=>"\u03A9\u0300", "\u1FFB"=>"\u03A9\u0301", "\u1FFC"=>"\u03A9\u0345",
- "\u1FFD"=>"\u00B4", "\u2000"=>"\u2002", "\u2001"=>"\u2003", "\u2126"=>"\u03A9", "\u212A"=>"K", "\u212B"=>"A\u030A", "\u219A"=>"\u2190\u0338", "\u219B"=>"\u2192\u0338",
- "\u21AE"=>"\u2194\u0338", "\u21CD"=>"\u21D0\u0338", "\u21CE"=>"\u21D4\u0338", "\u21CF"=>"\u21D2\u0338", "\u2204"=>"\u2203\u0338", "\u2209"=>"\u2208\u0338", "\u220C"=>"\u220B\u0338", "\u2224"=>"\u2223\u0338",
- "\u2226"=>"\u2225\u0338", "\u2241"=>"\u223C\u0338", "\u2244"=>"\u2243\u0338", "\u2247"=>"\u2245\u0338", "\u2249"=>"\u2248\u0338", "\u2260"=>"=\u0338", "\u2262"=>"\u2261\u0338", "\u226D"=>"\u224D\u0338",
- "\u226E"=>"<\u0338", "\u226F"=>">\u0338", "\u2270"=>"\u2264\u0338", "\u2271"=>"\u2265\u0338", "\u2274"=>"\u2272\u0338", "\u2275"=>"\u2273\u0338", "\u2278"=>"\u2276\u0338", "\u2279"=>"\u2277\u0338",
- "\u2280"=>"\u227A\u0338", "\u2281"=>"\u227B\u0338", "\u2284"=>"\u2282\u0338", "\u2285"=>"\u2283\u0338", "\u2288"=>"\u2286\u0338", "\u2289"=>"\u2287\u0338", "\u22AC"=>"\u22A2\u0338", "\u22AD"=>"\u22A8\u0338",
- "\u22AE"=>"\u22A9\u0338", "\u22AF"=>"\u22AB\u0338", "\u22E0"=>"\u227C\u0338", "\u22E1"=>"\u227D\u0338", "\u22E2"=>"\u2291\u0338", "\u22E3"=>"\u2292\u0338", "\u22EA"=>"\u22B2\u0338", "\u22EB"=>"\u22B3\u0338",
- "\u22EC"=>"\u22B4\u0338", "\u22ED"=>"\u22B5\u0338", "\u2329"=>"\u3008", "\u232A"=>"\u3009", "\u2ADC"=>"\u2ADD\u0338", "\u304C"=>"\u304B\u3099", "\u304E"=>"\u304D\u3099", "\u3050"=>"\u304F\u3099",
- "\u3052"=>"\u3051\u3099", "\u3054"=>"\u3053\u3099", "\u3056"=>"\u3055\u3099", "\u3058"=>"\u3057\u3099", "\u305A"=>"\u3059\u3099", "\u305C"=>"\u305B\u3099", "\u305E"=>"\u305D\u3099", "\u3060"=>"\u305F\u3099",
- "\u3062"=>"\u3061\u3099", "\u3065"=>"\u3064\u3099", "\u3067"=>"\u3066\u3099", "\u3069"=>"\u3068\u3099", "\u3070"=>"\u306F\u3099", "\u3071"=>"\u306F\u309A", "\u3073"=>"\u3072\u3099", "\u3074"=>"\u3072\u309A",
- "\u3076"=>"\u3075\u3099", "\u3077"=>"\u3075\u309A", "\u3079"=>"\u3078\u3099", "\u307A"=>"\u3078\u309A", "\u307C"=>"\u307B\u3099", "\u307D"=>"\u307B\u309A", "\u3094"=>"\u3046\u3099", "\u309E"=>"\u309D\u3099",
- "\u30AC"=>"\u30AB\u3099", "\u30AE"=>"\u30AD\u3099", "\u30B0"=>"\u30AF\u3099", "\u30B2"=>"\u30B1\u3099", "\u30B4"=>"\u30B3\u3099", "\u30B6"=>"\u30B5\u3099", "\u30B8"=>"\u30B7\u3099", "\u30BA"=>"\u30B9\u3099",
- "\u30BC"=>"\u30BB\u3099", "\u30BE"=>"\u30BD\u3099", "\u30C0"=>"\u30BF\u3099", "\u30C2"=>"\u30C1\u3099", "\u30C5"=>"\u30C4\u3099", "\u30C7"=>"\u30C6\u3099", "\u30C9"=>"\u30C8\u3099", "\u30D0"=>"\u30CF\u3099",
- "\u30D1"=>"\u30CF\u309A", "\u30D3"=>"\u30D2\u3099", "\u30D4"=>"\u30D2\u309A", "\u30D6"=>"\u30D5\u3099", "\u30D7"=>"\u30D5\u309A", "\u30D9"=>"\u30D8\u3099", "\u30DA"=>"\u30D8\u309A", "\u30DC"=>"\u30DB\u3099",
- "\u30DD"=>"\u30DB\u309A", "\u30F4"=>"\u30A6\u3099", "\u30F7"=>"\u30EF\u3099", "\u30F8"=>"\u30F0\u3099", "\u30F9"=>"\u30F1\u3099", "\u30FA"=>"\u30F2\u3099", "\u30FE"=>"\u30FD\u3099", "\uF900"=>"\u8C48",
- "\uF901"=>"\u66F4", "\uF902"=>"\u8ECA", "\uF903"=>"\u8CC8", "\uF904"=>"\u6ED1", "\uF905"=>"\u4E32", "\uF906"=>"\u53E5", "\uF907"=>"\u9F9C", "\uF908"=>"\u9F9C",
- "\uF909"=>"\u5951", "\uF90A"=>"\u91D1", "\uF90B"=>"\u5587", "\uF90C"=>"\u5948", "\uF90D"=>"\u61F6", "\uF90E"=>"\u7669", "\uF90F"=>"\u7F85", "\uF910"=>"\u863F",
- "\uF911"=>"\u87BA", "\uF912"=>"\u88F8", "\uF913"=>"\u908F", "\uF914"=>"\u6A02", "\uF915"=>"\u6D1B", "\uF916"=>"\u70D9", "\uF917"=>"\u73DE", "\uF918"=>"\u843D",
- "\uF919"=>"\u916A", "\uF91A"=>"\u99F1", "\uF91B"=>"\u4E82", "\uF91C"=>"\u5375", "\uF91D"=>"\u6B04", "\uF91E"=>"\u721B", "\uF91F"=>"\u862D", "\uF920"=>"\u9E1E",
- "\uF921"=>"\u5D50", "\uF922"=>"\u6FEB", "\uF923"=>"\u85CD", "\uF924"=>"\u8964", "\uF925"=>"\u62C9", "\uF926"=>"\u81D8", "\uF927"=>"\u881F", "\uF928"=>"\u5ECA",
- "\uF929"=>"\u6717", "\uF92A"=>"\u6D6A", "\uF92B"=>"\u72FC", "\uF92C"=>"\u90CE", "\uF92D"=>"\u4F86", "\uF92E"=>"\u51B7", "\uF92F"=>"\u52DE", "\uF930"=>"\u64C4",
- "\uF931"=>"\u6AD3", "\uF932"=>"\u7210", "\uF933"=>"\u76E7", "\uF934"=>"\u8001", "\uF935"=>"\u8606", "\uF936"=>"\u865C", "\uF937"=>"\u8DEF", "\uF938"=>"\u9732",
- "\uF939"=>"\u9B6F", "\uF93A"=>"\u9DFA", "\uF93B"=>"\u788C", "\uF93C"=>"\u797F", "\uF93D"=>"\u7DA0", "\uF93E"=>"\u83C9", "\uF93F"=>"\u9304", "\uF940"=>"\u9E7F",
- "\uF941"=>"\u8AD6", "\uF942"=>"\u58DF", "\uF943"=>"\u5F04", "\uF944"=>"\u7C60", "\uF945"=>"\u807E", "\uF946"=>"\u7262", "\uF947"=>"\u78CA", "\uF948"=>"\u8CC2",
- "\uF949"=>"\u96F7", "\uF94A"=>"\u58D8", "\uF94B"=>"\u5C62", "\uF94C"=>"\u6A13", "\uF94D"=>"\u6DDA", "\uF94E"=>"\u6F0F", "\uF94F"=>"\u7D2F", "\uF950"=>"\u7E37",
- "\uF951"=>"\u964B", "\uF952"=>"\u52D2", "\uF953"=>"\u808B", "\uF954"=>"\u51DC", "\uF955"=>"\u51CC", "\uF956"=>"\u7A1C", "\uF957"=>"\u7DBE", "\uF958"=>"\u83F1",
- "\uF959"=>"\u9675", "\uF95A"=>"\u8B80", "\uF95B"=>"\u62CF", "\uF95C"=>"\u6A02", "\uF95D"=>"\u8AFE", "\uF95E"=>"\u4E39", "\uF95F"=>"\u5BE7", "\uF960"=>"\u6012",
- "\uF961"=>"\u7387", "\uF962"=>"\u7570", "\uF963"=>"\u5317", "\uF964"=>"\u78FB", "\uF965"=>"\u4FBF", "\uF966"=>"\u5FA9", "\uF967"=>"\u4E0D", "\uF968"=>"\u6CCC",
- "\uF969"=>"\u6578", "\uF96A"=>"\u7D22", "\uF96B"=>"\u53C3", "\uF96C"=>"\u585E", "\uF96D"=>"\u7701", "\uF96E"=>"\u8449", "\uF96F"=>"\u8AAA", "\uF970"=>"\u6BBA",
- "\uF971"=>"\u8FB0", "\uF972"=>"\u6C88", "\uF973"=>"\u62FE", "\uF974"=>"\u82E5", "\uF975"=>"\u63A0", "\uF976"=>"\u7565", "\uF977"=>"\u4EAE", "\uF978"=>"\u5169",
- "\uF979"=>"\u51C9", "\uF97A"=>"\u6881", "\uF97B"=>"\u7CE7", "\uF97C"=>"\u826F", "\uF97D"=>"\u8AD2", "\uF97E"=>"\u91CF", "\uF97F"=>"\u52F5", "\uF980"=>"\u5442",
- "\uF981"=>"\u5973", "\uF982"=>"\u5EEC", "\uF983"=>"\u65C5", "\uF984"=>"\u6FFE", "\uF985"=>"\u792A", "\uF986"=>"\u95AD", "\uF987"=>"\u9A6A", "\uF988"=>"\u9E97",
- "\uF989"=>"\u9ECE", "\uF98A"=>"\u529B", "\uF98B"=>"\u66C6", "\uF98C"=>"\u6B77", "\uF98D"=>"\u8F62", "\uF98E"=>"\u5E74", "\uF98F"=>"\u6190", "\uF990"=>"\u6200",
- "\uF991"=>"\u649A", "\uF992"=>"\u6F23", "\uF993"=>"\u7149", "\uF994"=>"\u7489", "\uF995"=>"\u79CA", "\uF996"=>"\u7DF4", "\uF997"=>"\u806F", "\uF998"=>"\u8F26",
- "\uF999"=>"\u84EE", "\uF99A"=>"\u9023", "\uF99B"=>"\u934A", "\uF99C"=>"\u5217", "\uF99D"=>"\u52A3", "\uF99E"=>"\u54BD", "\uF99F"=>"\u70C8", "\uF9A0"=>"\u88C2",
- "\uF9A1"=>"\u8AAA", "\uF9A2"=>"\u5EC9", "\uF9A3"=>"\u5FF5", "\uF9A4"=>"\u637B", "\uF9A5"=>"\u6BAE", "\uF9A6"=>"\u7C3E", "\uF9A7"=>"\u7375", "\uF9A8"=>"\u4EE4",
- "\uF9A9"=>"\u56F9", "\uF9AA"=>"\u5BE7", "\uF9AB"=>"\u5DBA", "\uF9AC"=>"\u601C", "\uF9AD"=>"\u73B2", "\uF9AE"=>"\u7469", "\uF9AF"=>"\u7F9A", "\uF9B0"=>"\u8046",
- "\uF9B1"=>"\u9234", "\uF9B2"=>"\u96F6", "\uF9B3"=>"\u9748", "\uF9B4"=>"\u9818", "\uF9B5"=>"\u4F8B", "\uF9B6"=>"\u79AE", "\uF9B7"=>"\u91B4", "\uF9B8"=>"\u96B8",
- "\uF9B9"=>"\u60E1", "\uF9BA"=>"\u4E86", "\uF9BB"=>"\u50DA", "\uF9BC"=>"\u5BEE", "\uF9BD"=>"\u5C3F", "\uF9BE"=>"\u6599", "\uF9BF"=>"\u6A02", "\uF9C0"=>"\u71CE",
- "\uF9C1"=>"\u7642", "\uF9C2"=>"\u84FC", "\uF9C3"=>"\u907C", "\uF9C4"=>"\u9F8D", "\uF9C5"=>"\u6688", "\uF9C6"=>"\u962E", "\uF9C7"=>"\u5289", "\uF9C8"=>"\u677B",
- "\uF9C9"=>"\u67F3", "\uF9CA"=>"\u6D41", "\uF9CB"=>"\u6E9C", "\uF9CC"=>"\u7409", "\uF9CD"=>"\u7559", "\uF9CE"=>"\u786B", "\uF9CF"=>"\u7D10", "\uF9D0"=>"\u985E",
- "\uF9D1"=>"\u516D", "\uF9D2"=>"\u622E", "\uF9D3"=>"\u9678", "\uF9D4"=>"\u502B", "\uF9D5"=>"\u5D19", "\uF9D6"=>"\u6DEA", "\uF9D7"=>"\u8F2A", "\uF9D8"=>"\u5F8B",
- "\uF9D9"=>"\u6144", "\uF9DA"=>"\u6817", "\uF9DB"=>"\u7387", "\uF9DC"=>"\u9686", "\uF9DD"=>"\u5229", "\uF9DE"=>"\u540F", "\uF9DF"=>"\u5C65", "\uF9E0"=>"\u6613",
- "\uF9E1"=>"\u674E", "\uF9E2"=>"\u68A8", "\uF9E3"=>"\u6CE5", "\uF9E4"=>"\u7406", "\uF9E5"=>"\u75E2", "\uF9E6"=>"\u7F79", "\uF9E7"=>"\u88CF", "\uF9E8"=>"\u88E1",
- "\uF9E9"=>"\u91CC", "\uF9EA"=>"\u96E2", "\uF9EB"=>"\u533F", "\uF9EC"=>"\u6EBA", "\uF9ED"=>"\u541D", "\uF9EE"=>"\u71D0", "\uF9EF"=>"\u7498", "\uF9F0"=>"\u85FA",
- "\uF9F1"=>"\u96A3", "\uF9F2"=>"\u9C57", "\uF9F3"=>"\u9E9F", "\uF9F4"=>"\u6797", "\uF9F5"=>"\u6DCB", "\uF9F6"=>"\u81E8", "\uF9F7"=>"\u7ACB", "\uF9F8"=>"\u7B20",
- "\uF9F9"=>"\u7C92", "\uF9FA"=>"\u72C0", "\uF9FB"=>"\u7099", "\uF9FC"=>"\u8B58", "\uF9FD"=>"\u4EC0", "\uF9FE"=>"\u8336", "\uF9FF"=>"\u523A", "\uFA00"=>"\u5207",
- "\uFA01"=>"\u5EA6", "\uFA02"=>"\u62D3", "\uFA03"=>"\u7CD6", "\uFA04"=>"\u5B85", "\uFA05"=>"\u6D1E", "\uFA06"=>"\u66B4", "\uFA07"=>"\u8F3B", "\uFA08"=>"\u884C",
- "\uFA09"=>"\u964D", "\uFA0A"=>"\u898B", "\uFA0B"=>"\u5ED3", "\uFA0C"=>"\u5140", "\uFA0D"=>"\u55C0", "\uFA10"=>"\u585A", "\uFA12"=>"\u6674", "\uFA15"=>"\u51DE",
- "\uFA16"=>"\u732A", "\uFA17"=>"\u76CA", "\uFA18"=>"\u793C", "\uFA19"=>"\u795E", "\uFA1A"=>"\u7965", "\uFA1B"=>"\u798F", "\uFA1C"=>"\u9756", "\uFA1D"=>"\u7CBE",
- "\uFA1E"=>"\u7FBD", "\uFA20"=>"\u8612", "\uFA22"=>"\u8AF8", "\uFA25"=>"\u9038", "\uFA26"=>"\u90FD", "\uFA2A"=>"\u98EF", "\uFA2B"=>"\u98FC", "\uFA2C"=>"\u9928",
- "\uFA2D"=>"\u9DB4", "\uFA2E"=>"\u90DE", "\uFA2F"=>"\u96B7", "\uFA30"=>"\u4FAE", "\uFA31"=>"\u50E7", "\uFA32"=>"\u514D", "\uFA33"=>"\u52C9", "\uFA34"=>"\u52E4",
- "\uFA35"=>"\u5351", "\uFA36"=>"\u559D", "\uFA37"=>"\u5606", "\uFA38"=>"\u5668", "\uFA39"=>"\u5840", "\uFA3A"=>"\u58A8", "\uFA3B"=>"\u5C64", "\uFA3C"=>"\u5C6E",
- "\uFA3D"=>"\u6094", "\uFA3E"=>"\u6168", "\uFA3F"=>"\u618E", "\uFA40"=>"\u61F2", "\uFA41"=>"\u654F", "\uFA42"=>"\u65E2", "\uFA43"=>"\u6691", "\uFA44"=>"\u6885",
- "\uFA45"=>"\u6D77", "\uFA46"=>"\u6E1A", "\uFA47"=>"\u6F22", "\uFA48"=>"\u716E", "\uFA49"=>"\u722B", "\uFA4A"=>"\u7422", "\uFA4B"=>"\u7891", "\uFA4C"=>"\u793E",
- "\uFA4D"=>"\u7949", "\uFA4E"=>"\u7948", "\uFA4F"=>"\u7950", "\uFA50"=>"\u7956", "\uFA51"=>"\u795D", "\uFA52"=>"\u798D", "\uFA53"=>"\u798E", "\uFA54"=>"\u7A40",
- "\uFA55"=>"\u7A81", "\uFA56"=>"\u7BC0", "\uFA57"=>"\u7DF4", "\uFA58"=>"\u7E09", "\uFA59"=>"\u7E41", "\uFA5A"=>"\u7F72", "\uFA5B"=>"\u8005", "\uFA5C"=>"\u81ED",
- "\uFA5D"=>"\u8279", "\uFA5E"=>"\u8279", "\uFA5F"=>"\u8457", "\uFA60"=>"\u8910", "\uFA61"=>"\u8996", "\uFA62"=>"\u8B01", "\uFA63"=>"\u8B39", "\uFA64"=>"\u8CD3",
- "\uFA65"=>"\u8D08", "\uFA66"=>"\u8FB6", "\uFA67"=>"\u9038", "\uFA68"=>"\u96E3", "\uFA69"=>"\u97FF", "\uFA6A"=>"\u983B", "\uFA6B"=>"\u6075", "\uFA6C"=>"\u{242EE}",
- "\uFA6D"=>"\u8218", "\uFA70"=>"\u4E26", "\uFA71"=>"\u51B5", "\uFA72"=>"\u5168", "\uFA73"=>"\u4F80", "\uFA74"=>"\u5145", "\uFA75"=>"\u5180", "\uFA76"=>"\u52C7",
- "\uFA77"=>"\u52FA", "\uFA78"=>"\u559D", "\uFA79"=>"\u5555", "\uFA7A"=>"\u5599", "\uFA7B"=>"\u55E2", "\uFA7C"=>"\u585A", "\uFA7D"=>"\u58B3", "\uFA7E"=>"\u5944",
- "\uFA7F"=>"\u5954", "\uFA80"=>"\u5A62", "\uFA81"=>"\u5B28", "\uFA82"=>"\u5ED2", "\uFA83"=>"\u5ED9", "\uFA84"=>"\u5F69", "\uFA85"=>"\u5FAD", "\uFA86"=>"\u60D8",
- "\uFA87"=>"\u614E", "\uFA88"=>"\u6108", "\uFA89"=>"\u618E", "\uFA8A"=>"\u6160", "\uFA8B"=>"\u61F2", "\uFA8C"=>"\u6234", "\uFA8D"=>"\u63C4", "\uFA8E"=>"\u641C",
- "\uFA8F"=>"\u6452", "\uFA90"=>"\u6556", "\uFA91"=>"\u6674", "\uFA92"=>"\u6717", "\uFA93"=>"\u671B", "\uFA94"=>"\u6756", "\uFA95"=>"\u6B79", "\uFA96"=>"\u6BBA",
- "\uFA97"=>"\u6D41", "\uFA98"=>"\u6EDB", "\uFA99"=>"\u6ECB", "\uFA9A"=>"\u6F22", "\uFA9B"=>"\u701E", "\uFA9C"=>"\u716E", "\uFA9D"=>"\u77A7", "\uFA9E"=>"\u7235",
- "\uFA9F"=>"\u72AF", "\uFAA0"=>"\u732A", "\uFAA1"=>"\u7471", "\uFAA2"=>"\u7506", "\uFAA3"=>"\u753B", "\uFAA4"=>"\u761D", "\uFAA5"=>"\u761F", "\uFAA6"=>"\u76CA",
- "\uFAA7"=>"\u76DB", "\uFAA8"=>"\u76F4", "\uFAA9"=>"\u774A", "\uFAAA"=>"\u7740", "\uFAAB"=>"\u78CC", "\uFAAC"=>"\u7AB1", "\uFAAD"=>"\u7BC0", "\uFAAE"=>"\u7C7B",
- "\uFAAF"=>"\u7D5B", "\uFAB0"=>"\u7DF4", "\uFAB1"=>"\u7F3E", "\uFAB2"=>"\u8005", "\uFAB3"=>"\u8352", "\uFAB4"=>"\u83EF", "\uFAB5"=>"\u8779", "\uFAB6"=>"\u8941",
- "\uFAB7"=>"\u8986", "\uFAB8"=>"\u8996", "\uFAB9"=>"\u8ABF", "\uFABA"=>"\u8AF8", "\uFABB"=>"\u8ACB", "\uFABC"=>"\u8B01", "\uFABD"=>"\u8AFE", "\uFABE"=>"\u8AED",
- "\uFABF"=>"\u8B39", "\uFAC0"=>"\u8B8A", "\uFAC1"=>"\u8D08", "\uFAC2"=>"\u8F38", "\uFAC3"=>"\u9072", "\uFAC4"=>"\u9199", "\uFAC5"=>"\u9276", "\uFAC6"=>"\u967C",
- "\uFAC7"=>"\u96E3", "\uFAC8"=>"\u9756", "\uFAC9"=>"\u97DB", "\uFACA"=>"\u97FF", "\uFACB"=>"\u980B", "\uFACC"=>"\u983B", "\uFACD"=>"\u9B12", "\uFACE"=>"\u9F9C",
- "\uFACF"=>"\u{2284A}", "\uFAD0"=>"\u{22844}", "\uFAD1"=>"\u{233D5}", "\uFAD2"=>"\u3B9D", "\uFAD3"=>"\u4018", "\uFAD4"=>"\u4039", "\uFAD5"=>"\u{25249}", "\uFAD6"=>"\u{25CD0}",
- "\uFAD7"=>"\u{27ED3}", "\uFAD8"=>"\u9F43", "\uFAD9"=>"\u9F8E", "\uFB1D"=>"\u05D9\u05B4", "\uFB1F"=>"\u05F2\u05B7", "\uFB2A"=>"\u05E9\u05C1", "\uFB2B"=>"\u05E9\u05C2", "\uFB2C"=>"\u05E9\u05BC\u05C1",
- "\uFB2D"=>"\u05E9\u05BC\u05C2", "\uFB2E"=>"\u05D0\u05B7", "\uFB2F"=>"\u05D0\u05B8", "\uFB30"=>"\u05D0\u05BC", "\uFB31"=>"\u05D1\u05BC", "\uFB32"=>"\u05D2\u05BC", "\uFB33"=>"\u05D3\u05BC", "\uFB34"=>"\u05D4\u05BC",
- "\uFB35"=>"\u05D5\u05BC", "\uFB36"=>"\u05D6\u05BC", "\uFB38"=>"\u05D8\u05BC", "\uFB39"=>"\u05D9\u05BC", "\uFB3A"=>"\u05DA\u05BC", "\uFB3B"=>"\u05DB\u05BC", "\uFB3C"=>"\u05DC\u05BC", "\uFB3E"=>"\u05DE\u05BC",
- "\uFB40"=>"\u05E0\u05BC", "\uFB41"=>"\u05E1\u05BC", "\uFB43"=>"\u05E3\u05BC", "\uFB44"=>"\u05E4\u05BC", "\uFB46"=>"\u05E6\u05BC", "\uFB47"=>"\u05E7\u05BC", "\uFB48"=>"\u05E8\u05BC", "\uFB49"=>"\u05E9\u05BC",
- "\uFB4A"=>"\u05EA\u05BC", "\uFB4B"=>"\u05D5\u05B9", "\uFB4C"=>"\u05D1\u05BF", "\uFB4D"=>"\u05DB\u05BF", "\uFB4E"=>"\u05E4\u05BF", "\u{1109A}"=>"\u{11099}\u{110BA}", "\u{1109C}"=>"\u{1109B}\u{110BA}", "\u{110AB}"=>"\u{110A5}\u{110BA}",
- "\u{1112E}"=>"\u{11131}\u{11127}", "\u{1112F}"=>"\u{11132}\u{11127}", "\u{1134B}"=>"\u{11347}\u{1133E}", "\u{1134C}"=>"\u{11347}\u{11357}", "\u{114BB}"=>"\u{114B9}\u{114BA}", "\u{114BC}"=>"\u{114B9}\u{114B0}", "\u{114BE}"=>"\u{114B9}\u{114BD}", "\u{115BA}"=>"\u{115B8}\u{115AF}",
- "\u{115BB}"=>"\u{115B9}\u{115AF}", "\u{1D15E}"=>"\u{1D157}\u{1D165}", "\u{1D15F}"=>"\u{1D158}\u{1D165}", "\u{1D160}"=>"\u{1D158}\u{1D165}\u{1D16E}", "\u{1D161}"=>"\u{1D158}\u{1D165}\u{1D16F}", "\u{1D162}"=>"\u{1D158}\u{1D165}\u{1D170}", "\u{1D163}"=>"\u{1D158}\u{1D165}\u{1D171}", "\u{1D164}"=>"\u{1D158}\u{1D165}\u{1D172}",
- "\u{1D1BB}"=>"\u{1D1B9}\u{1D165}", "\u{1D1BC}"=>"\u{1D1BA}\u{1D165}", "\u{1D1BD}"=>"\u{1D1B9}\u{1D165}\u{1D16E}", "\u{1D1BE}"=>"\u{1D1BA}\u{1D165}\u{1D16E}", "\u{1D1BF}"=>"\u{1D1B9}\u{1D165}\u{1D16F}", "\u{1D1C0}"=>"\u{1D1BA}\u{1D165}\u{1D16F}", "\u{2F800}"=>"\u4E3D", "\u{2F801}"=>"\u4E38",
- "\u{2F802}"=>"\u4E41", "\u{2F803}"=>"\u{20122}", "\u{2F804}"=>"\u4F60", "\u{2F805}"=>"\u4FAE", "\u{2F806}"=>"\u4FBB", "\u{2F807}"=>"\u5002", "\u{2F808}"=>"\u507A", "\u{2F809}"=>"\u5099",
- "\u{2F80A}"=>"\u50E7", "\u{2F80B}"=>"\u50CF", "\u{2F80C}"=>"\u349E", "\u{2F80D}"=>"\u{2063A}", "\u{2F80E}"=>"\u514D", "\u{2F80F}"=>"\u5154", "\u{2F810}"=>"\u5164", "\u{2F811}"=>"\u5177",
- "\u{2F812}"=>"\u{2051C}", "\u{2F813}"=>"\u34B9", "\u{2F814}"=>"\u5167", "\u{2F815}"=>"\u518D", "\u{2F816}"=>"\u{2054B}", "\u{2F817}"=>"\u5197", "\u{2F818}"=>"\u51A4", "\u{2F819}"=>"\u4ECC",
- "\u{2F81A}"=>"\u51AC", "\u{2F81B}"=>"\u51B5", "\u{2F81C}"=>"\u{291DF}", "\u{2F81D}"=>"\u51F5", "\u{2F81E}"=>"\u5203", "\u{2F81F}"=>"\u34DF", "\u{2F820}"=>"\u523B", "\u{2F821}"=>"\u5246",
- "\u{2F822}"=>"\u5272", "\u{2F823}"=>"\u5277", "\u{2F824}"=>"\u3515", "\u{2F825}"=>"\u52C7", "\u{2F826}"=>"\u52C9", "\u{2F827}"=>"\u52E4", "\u{2F828}"=>"\u52FA", "\u{2F829}"=>"\u5305",
- "\u{2F82A}"=>"\u5306", "\u{2F82B}"=>"\u5317", "\u{2F82C}"=>"\u5349", "\u{2F82D}"=>"\u5351", "\u{2F82E}"=>"\u535A", "\u{2F82F}"=>"\u5373", "\u{2F830}"=>"\u537D", "\u{2F831}"=>"\u537F",
- "\u{2F832}"=>"\u537F", "\u{2F833}"=>"\u537F", "\u{2F834}"=>"\u{20A2C}", "\u{2F835}"=>"\u7070", "\u{2F836}"=>"\u53CA", "\u{2F837}"=>"\u53DF", "\u{2F838}"=>"\u{20B63}", "\u{2F839}"=>"\u53EB",
- "\u{2F83A}"=>"\u53F1", "\u{2F83B}"=>"\u5406", "\u{2F83C}"=>"\u549E", "\u{2F83D}"=>"\u5438", "\u{2F83E}"=>"\u5448", "\u{2F83F}"=>"\u5468", "\u{2F840}"=>"\u54A2", "\u{2F841}"=>"\u54F6",
- "\u{2F842}"=>"\u5510", "\u{2F843}"=>"\u5553", "\u{2F844}"=>"\u5563", "\u{2F845}"=>"\u5584", "\u{2F846}"=>"\u5584", "\u{2F847}"=>"\u5599", "\u{2F848}"=>"\u55AB", "\u{2F849}"=>"\u55B3",
- "\u{2F84A}"=>"\u55C2", "\u{2F84B}"=>"\u5716", "\u{2F84C}"=>"\u5606", "\u{2F84D}"=>"\u5717", "\u{2F84E}"=>"\u5651", "\u{2F84F}"=>"\u5674", "\u{2F850}"=>"\u5207", "\u{2F851}"=>"\u58EE",
- "\u{2F852}"=>"\u57CE", "\u{2F853}"=>"\u57F4", "\u{2F854}"=>"\u580D", "\u{2F855}"=>"\u578B", "\u{2F856}"=>"\u5832", "\u{2F857}"=>"\u5831", "\u{2F858}"=>"\u58AC", "\u{2F859}"=>"\u{214E4}",
- "\u{2F85A}"=>"\u58F2", "\u{2F85B}"=>"\u58F7", "\u{2F85C}"=>"\u5906", "\u{2F85D}"=>"\u591A", "\u{2F85E}"=>"\u5922", "\u{2F85F}"=>"\u5962", "\u{2F860}"=>"\u{216A8}", "\u{2F861}"=>"\u{216EA}",
- "\u{2F862}"=>"\u59EC", "\u{2F863}"=>"\u5A1B", "\u{2F864}"=>"\u5A27", "\u{2F865}"=>"\u59D8", "\u{2F866}"=>"\u5A66", "\u{2F867}"=>"\u36EE", "\u{2F868}"=>"\u36FC", "\u{2F869}"=>"\u5B08",
- "\u{2F86A}"=>"\u5B3E", "\u{2F86B}"=>"\u5B3E", "\u{2F86C}"=>"\u{219C8}", "\u{2F86D}"=>"\u5BC3", "\u{2F86E}"=>"\u5BD8", "\u{2F86F}"=>"\u5BE7", "\u{2F870}"=>"\u5BF3", "\u{2F871}"=>"\u{21B18}",
- "\u{2F872}"=>"\u5BFF", "\u{2F873}"=>"\u5C06", "\u{2F874}"=>"\u5F53", "\u{2F875}"=>"\u5C22", "\u{2F876}"=>"\u3781", "\u{2F877}"=>"\u5C60", "\u{2F878}"=>"\u5C6E", "\u{2F879}"=>"\u5CC0",
- "\u{2F87A}"=>"\u5C8D", "\u{2F87B}"=>"\u{21DE4}", "\u{2F87C}"=>"\u5D43", "\u{2F87D}"=>"\u{21DE6}", "\u{2F87E}"=>"\u5D6E", "\u{2F87F}"=>"\u5D6B", "\u{2F880}"=>"\u5D7C", "\u{2F881}"=>"\u5DE1",
- "\u{2F882}"=>"\u5DE2", "\u{2F883}"=>"\u382F", "\u{2F884}"=>"\u5DFD", "\u{2F885}"=>"\u5E28", "\u{2F886}"=>"\u5E3D", "\u{2F887}"=>"\u5E69", "\u{2F888}"=>"\u3862", "\u{2F889}"=>"\u{22183}",
- "\u{2F88A}"=>"\u387C", "\u{2F88B}"=>"\u5EB0", "\u{2F88C}"=>"\u5EB3", "\u{2F88D}"=>"\u5EB6", "\u{2F88E}"=>"\u5ECA", "\u{2F88F}"=>"\u{2A392}", "\u{2F890}"=>"\u5EFE", "\u{2F891}"=>"\u{22331}",
- "\u{2F892}"=>"\u{22331}", "\u{2F893}"=>"\u8201", "\u{2F894}"=>"\u5F22", "\u{2F895}"=>"\u5F22", "\u{2F896}"=>"\u38C7", "\u{2F897}"=>"\u{232B8}", "\u{2F898}"=>"\u{261DA}", "\u{2F899}"=>"\u5F62",
- "\u{2F89A}"=>"\u5F6B", "\u{2F89B}"=>"\u38E3", "\u{2F89C}"=>"\u5F9A", "\u{2F89D}"=>"\u5FCD", "\u{2F89E}"=>"\u5FD7", "\u{2F89F}"=>"\u5FF9", "\u{2F8A0}"=>"\u6081", "\u{2F8A1}"=>"\u393A",
- "\u{2F8A2}"=>"\u391C", "\u{2F8A3}"=>"\u6094", "\u{2F8A4}"=>"\u{226D4}", "\u{2F8A5}"=>"\u60C7", "\u{2F8A6}"=>"\u6148", "\u{2F8A7}"=>"\u614C", "\u{2F8A8}"=>"\u614E", "\u{2F8A9}"=>"\u614C",
- "\u{2F8AA}"=>"\u617A", "\u{2F8AB}"=>"\u618E", "\u{2F8AC}"=>"\u61B2", "\u{2F8AD}"=>"\u61A4", "\u{2F8AE}"=>"\u61AF", "\u{2F8AF}"=>"\u61DE", "\u{2F8B0}"=>"\u61F2", "\u{2F8B1}"=>"\u61F6",
- "\u{2F8B2}"=>"\u6210", "\u{2F8B3}"=>"\u621B", "\u{2F8B4}"=>"\u625D", "\u{2F8B5}"=>"\u62B1", "\u{2F8B6}"=>"\u62D4", "\u{2F8B7}"=>"\u6350", "\u{2F8B8}"=>"\u{22B0C}", "\u{2F8B9}"=>"\u633D",
- "\u{2F8BA}"=>"\u62FC", "\u{2F8BB}"=>"\u6368", "\u{2F8BC}"=>"\u6383", "\u{2F8BD}"=>"\u63E4", "\u{2F8BE}"=>"\u{22BF1}", "\u{2F8BF}"=>"\u6422", "\u{2F8C0}"=>"\u63C5", "\u{2F8C1}"=>"\u63A9",
- "\u{2F8C2}"=>"\u3A2E", "\u{2F8C3}"=>"\u6469", "\u{2F8C4}"=>"\u647E", "\u{2F8C5}"=>"\u649D", "\u{2F8C6}"=>"\u6477", "\u{2F8C7}"=>"\u3A6C", "\u{2F8C8}"=>"\u654F", "\u{2F8C9}"=>"\u656C",
- "\u{2F8CA}"=>"\u{2300A}", "\u{2F8CB}"=>"\u65E3", "\u{2F8CC}"=>"\u66F8", "\u{2F8CD}"=>"\u6649", "\u{2F8CE}"=>"\u3B19", "\u{2F8CF}"=>"\u6691", "\u{2F8D0}"=>"\u3B08", "\u{2F8D1}"=>"\u3AE4",
- "\u{2F8D2}"=>"\u5192", "\u{2F8D3}"=>"\u5195", "\u{2F8D4}"=>"\u6700", "\u{2F8D5}"=>"\u669C", "\u{2F8D6}"=>"\u80AD", "\u{2F8D7}"=>"\u43D9", "\u{2F8D8}"=>"\u6717", "\u{2F8D9}"=>"\u671B",
- "\u{2F8DA}"=>"\u6721", "\u{2F8DB}"=>"\u675E", "\u{2F8DC}"=>"\u6753", "\u{2F8DD}"=>"\u{233C3}", "\u{2F8DE}"=>"\u3B49", "\u{2F8DF}"=>"\u67FA", "\u{2F8E0}"=>"\u6785", "\u{2F8E1}"=>"\u6852",
- "\u{2F8E2}"=>"\u6885", "\u{2F8E3}"=>"\u{2346D}", "\u{2F8E4}"=>"\u688E", "\u{2F8E5}"=>"\u681F", "\u{2F8E6}"=>"\u6914", "\u{2F8E7}"=>"\u3B9D", "\u{2F8E8}"=>"\u6942", "\u{2F8E9}"=>"\u69A3",
- "\u{2F8EA}"=>"\u69EA", "\u{2F8EB}"=>"\u6AA8", "\u{2F8EC}"=>"\u{236A3}", "\u{2F8ED}"=>"\u6ADB", "\u{2F8EE}"=>"\u3C18", "\u{2F8EF}"=>"\u6B21", "\u{2F8F0}"=>"\u{238A7}", "\u{2F8F1}"=>"\u6B54",
- "\u{2F8F2}"=>"\u3C4E", "\u{2F8F3}"=>"\u6B72", "\u{2F8F4}"=>"\u6B9F", "\u{2F8F5}"=>"\u6BBA", "\u{2F8F6}"=>"\u6BBB", "\u{2F8F7}"=>"\u{23A8D}", "\u{2F8F8}"=>"\u{21D0B}", "\u{2F8F9}"=>"\u{23AFA}",
- "\u{2F8FA}"=>"\u6C4E", "\u{2F8FB}"=>"\u{23CBC}", "\u{2F8FC}"=>"\u6CBF", "\u{2F8FD}"=>"\u6CCD", "\u{2F8FE}"=>"\u6C67", "\u{2F8FF}"=>"\u6D16", "\u{2F900}"=>"\u6D3E", "\u{2F901}"=>"\u6D77",
- "\u{2F902}"=>"\u6D41", "\u{2F903}"=>"\u6D69", "\u{2F904}"=>"\u6D78", "\u{2F905}"=>"\u6D85", "\u{2F906}"=>"\u{23D1E}", "\u{2F907}"=>"\u6D34", "\u{2F908}"=>"\u6E2F", "\u{2F909}"=>"\u6E6E",
- "\u{2F90A}"=>"\u3D33", "\u{2F90B}"=>"\u6ECB", "\u{2F90C}"=>"\u6EC7", "\u{2F90D}"=>"\u{23ED1}", "\u{2F90E}"=>"\u6DF9", "\u{2F90F}"=>"\u6F6E", "\u{2F910}"=>"\u{23F5E}", "\u{2F911}"=>"\u{23F8E}",
- "\u{2F912}"=>"\u6FC6", "\u{2F913}"=>"\u7039", "\u{2F914}"=>"\u701E", "\u{2F915}"=>"\u701B", "\u{2F916}"=>"\u3D96", "\u{2F917}"=>"\u704A", "\u{2F918}"=>"\u707D", "\u{2F919}"=>"\u7077",
- "\u{2F91A}"=>"\u70AD", "\u{2F91B}"=>"\u{20525}", "\u{2F91C}"=>"\u7145", "\u{2F91D}"=>"\u{24263}", "\u{2F91E}"=>"\u719C", "\u{2F91F}"=>"\u{243AB}", "\u{2F920}"=>"\u7228", "\u{2F921}"=>"\u7235",
- "\u{2F922}"=>"\u7250", "\u{2F923}"=>"\u{24608}", "\u{2F924}"=>"\u7280", "\u{2F925}"=>"\u7295", "\u{2F926}"=>"\u{24735}", "\u{2F927}"=>"\u{24814}", "\u{2F928}"=>"\u737A", "\u{2F929}"=>"\u738B",
- "\u{2F92A}"=>"\u3EAC", "\u{2F92B}"=>"\u73A5", "\u{2F92C}"=>"\u3EB8", "\u{2F92D}"=>"\u3EB8", "\u{2F92E}"=>"\u7447", "\u{2F92F}"=>"\u745C", "\u{2F930}"=>"\u7471", "\u{2F931}"=>"\u7485",
- "\u{2F932}"=>"\u74CA", "\u{2F933}"=>"\u3F1B", "\u{2F934}"=>"\u7524", "\u{2F935}"=>"\u{24C36}", "\u{2F936}"=>"\u753E", "\u{2F937}"=>"\u{24C92}", "\u{2F938}"=>"\u7570", "\u{2F939}"=>"\u{2219F}",
- "\u{2F93A}"=>"\u7610", "\u{2F93B}"=>"\u{24FA1}", "\u{2F93C}"=>"\u{24FB8}", "\u{2F93D}"=>"\u{25044}", "\u{2F93E}"=>"\u3FFC", "\u{2F93F}"=>"\u4008", "\u{2F940}"=>"\u76F4", "\u{2F941}"=>"\u{250F3}",
- "\u{2F942}"=>"\u{250F2}", "\u{2F943}"=>"\u{25119}", "\u{2F944}"=>"\u{25133}", "\u{2F945}"=>"\u771E", "\u{2F946}"=>"\u771F", "\u{2F947}"=>"\u771F", "\u{2F948}"=>"\u774A", "\u{2F949}"=>"\u4039",
- "\u{2F94A}"=>"\u778B", "\u{2F94B}"=>"\u4046", "\u{2F94C}"=>"\u4096", "\u{2F94D}"=>"\u{2541D}", "\u{2F94E}"=>"\u784E", "\u{2F94F}"=>"\u788C", "\u{2F950}"=>"\u78CC", "\u{2F951}"=>"\u40E3",
- "\u{2F952}"=>"\u{25626}", "\u{2F953}"=>"\u7956", "\u{2F954}"=>"\u{2569A}", "\u{2F955}"=>"\u{256C5}", "\u{2F956}"=>"\u798F", "\u{2F957}"=>"\u79EB", "\u{2F958}"=>"\u412F", "\u{2F959}"=>"\u7A40",
- "\u{2F95A}"=>"\u7A4A", "\u{2F95B}"=>"\u7A4F", "\u{2F95C}"=>"\u{2597C}", "\u{2F95D}"=>"\u{25AA7}", "\u{2F95E}"=>"\u{25AA7}", "\u{2F95F}"=>"\u7AEE", "\u{2F960}"=>"\u4202", "\u{2F961}"=>"\u{25BAB}",
- "\u{2F962}"=>"\u7BC6", "\u{2F963}"=>"\u7BC9", "\u{2F964}"=>"\u4227", "\u{2F965}"=>"\u{25C80}", "\u{2F966}"=>"\u7CD2", "\u{2F967}"=>"\u42A0", "\u{2F968}"=>"\u7CE8", "\u{2F969}"=>"\u7CE3",
- "\u{2F96A}"=>"\u7D00", "\u{2F96B}"=>"\u{25F86}", "\u{2F96C}"=>"\u7D63", "\u{2F96D}"=>"\u4301", "\u{2F96E}"=>"\u7DC7", "\u{2F96F}"=>"\u7E02", "\u{2F970}"=>"\u7E45", "\u{2F971}"=>"\u4334",
- "\u{2F972}"=>"\u{26228}", "\u{2F973}"=>"\u{26247}", "\u{2F974}"=>"\u4359", "\u{2F975}"=>"\u{262D9}", "\u{2F976}"=>"\u7F7A", "\u{2F977}"=>"\u{2633E}", "\u{2F978}"=>"\u7F95", "\u{2F979}"=>"\u7FFA",
- "\u{2F97A}"=>"\u8005", "\u{2F97B}"=>"\u{264DA}", "\u{2F97C}"=>"\u{26523}", "\u{2F97D}"=>"\u8060", "\u{2F97E}"=>"\u{265A8}", "\u{2F97F}"=>"\u8070", "\u{2F980}"=>"\u{2335F}", "\u{2F981}"=>"\u43D5",
- "\u{2F982}"=>"\u80B2", "\u{2F983}"=>"\u8103", "\u{2F984}"=>"\u440B", "\u{2F985}"=>"\u813E", "\u{2F986}"=>"\u5AB5", "\u{2F987}"=>"\u{267A7}", "\u{2F988}"=>"\u{267B5}", "\u{2F989}"=>"\u{23393}",
- "\u{2F98A}"=>"\u{2339C}", "\u{2F98B}"=>"\u8201", "\u{2F98C}"=>"\u8204", "\u{2F98D}"=>"\u8F9E", "\u{2F98E}"=>"\u446B", "\u{2F98F}"=>"\u8291", "\u{2F990}"=>"\u828B", "\u{2F991}"=>"\u829D",
- "\u{2F992}"=>"\u52B3", "\u{2F993}"=>"\u82B1", "\u{2F994}"=>"\u82B3", "\u{2F995}"=>"\u82BD", "\u{2F996}"=>"\u82E6", "\u{2F997}"=>"\u{26B3C}", "\u{2F998}"=>"\u82E5", "\u{2F999}"=>"\u831D",
- "\u{2F99A}"=>"\u8363", "\u{2F99B}"=>"\u83AD", "\u{2F99C}"=>"\u8323", "\u{2F99D}"=>"\u83BD", "\u{2F99E}"=>"\u83E7", "\u{2F99F}"=>"\u8457", "\u{2F9A0}"=>"\u8353", "\u{2F9A1}"=>"\u83CA",
- "\u{2F9A2}"=>"\u83CC", "\u{2F9A3}"=>"\u83DC", "\u{2F9A4}"=>"\u{26C36}", "\u{2F9A5}"=>"\u{26D6B}", "\u{2F9A6}"=>"\u{26CD5}", "\u{2F9A7}"=>"\u452B", "\u{2F9A8}"=>"\u84F1", "\u{2F9A9}"=>"\u84F3",
- "\u{2F9AA}"=>"\u8516", "\u{2F9AB}"=>"\u{273CA}", "\u{2F9AC}"=>"\u8564", "\u{2F9AD}"=>"\u{26F2C}", "\u{2F9AE}"=>"\u455D", "\u{2F9AF}"=>"\u4561", "\u{2F9B0}"=>"\u{26FB1}", "\u{2F9B1}"=>"\u{270D2}",
- "\u{2F9B2}"=>"\u456B", "\u{2F9B3}"=>"\u8650", "\u{2F9B4}"=>"\u865C", "\u{2F9B5}"=>"\u8667", "\u{2F9B6}"=>"\u8669", "\u{2F9B7}"=>"\u86A9", "\u{2F9B8}"=>"\u8688", "\u{2F9B9}"=>"\u870E",
- "\u{2F9BA}"=>"\u86E2", "\u{2F9BB}"=>"\u8779", "\u{2F9BC}"=>"\u8728", "\u{2F9BD}"=>"\u876B", "\u{2F9BE}"=>"\u8786", "\u{2F9BF}"=>"\u45D7", "\u{2F9C0}"=>"\u87E1", "\u{2F9C1}"=>"\u8801",
- "\u{2F9C2}"=>"\u45F9", "\u{2F9C3}"=>"\u8860", "\u{2F9C4}"=>"\u8863", "\u{2F9C5}"=>"\u{27667}", "\u{2F9C6}"=>"\u88D7", "\u{2F9C7}"=>"\u88DE", "\u{2F9C8}"=>"\u4635", "\u{2F9C9}"=>"\u88FA",
- "\u{2F9CA}"=>"\u34BB", "\u{2F9CB}"=>"\u{278AE}", "\u{2F9CC}"=>"\u{27966}", "\u{2F9CD}"=>"\u46BE", "\u{2F9CE}"=>"\u46C7", "\u{2F9CF}"=>"\u8AA0", "\u{2F9D0}"=>"\u8AED", "\u{2F9D1}"=>"\u8B8A",
- "\u{2F9D2}"=>"\u8C55", "\u{2F9D3}"=>"\u{27CA8}", "\u{2F9D4}"=>"\u8CAB", "\u{2F9D5}"=>"\u8CC1", "\u{2F9D6}"=>"\u8D1B", "\u{2F9D7}"=>"\u8D77", "\u{2F9D8}"=>"\u{27F2F}", "\u{2F9D9}"=>"\u{20804}",
- "\u{2F9DA}"=>"\u8DCB", "\u{2F9DB}"=>"\u8DBC", "\u{2F9DC}"=>"\u8DF0", "\u{2F9DD}"=>"\u{208DE}", "\u{2F9DE}"=>"\u8ED4", "\u{2F9DF}"=>"\u8F38", "\u{2F9E0}"=>"\u{285D2}", "\u{2F9E1}"=>"\u{285ED}",
- "\u{2F9E2}"=>"\u9094", "\u{2F9E3}"=>"\u90F1", "\u{2F9E4}"=>"\u9111", "\u{2F9E5}"=>"\u{2872E}", "\u{2F9E6}"=>"\u911B", "\u{2F9E7}"=>"\u9238", "\u{2F9E8}"=>"\u92D7", "\u{2F9E9}"=>"\u92D8",
- "\u{2F9EA}"=>"\u927C", "\u{2F9EB}"=>"\u93F9", "\u{2F9EC}"=>"\u9415", "\u{2F9ED}"=>"\u{28BFA}", "\u{2F9EE}"=>"\u958B", "\u{2F9EF}"=>"\u4995", "\u{2F9F0}"=>"\u95B7", "\u{2F9F1}"=>"\u{28D77}",
- "\u{2F9F2}"=>"\u49E6", "\u{2F9F3}"=>"\u96C3", "\u{2F9F4}"=>"\u5DB2", "\u{2F9F5}"=>"\u9723", "\u{2F9F6}"=>"\u{29145}", "\u{2F9F7}"=>"\u{2921A}", "\u{2F9F8}"=>"\u4A6E", "\u{2F9F9}"=>"\u4A76",
- "\u{2F9FA}"=>"\u97E0", "\u{2F9FB}"=>"\u{2940A}", "\u{2F9FC}"=>"\u4AB2", "\u{2F9FD}"=>"\u{29496}", "\u{2F9FE}"=>"\u980B", "\u{2F9FF}"=>"\u980B", "\u{2FA00}"=>"\u9829", "\u{2FA01}"=>"\u{295B6}",
- "\u{2FA02}"=>"\u98E2", "\u{2FA03}"=>"\u4B33", "\u{2FA04}"=>"\u9929", "\u{2FA05}"=>"\u99A7", "\u{2FA06}"=>"\u99C2", "\u{2FA07}"=>"\u99FE", "\u{2FA08}"=>"\u4BCE", "\u{2FA09}"=>"\u{29B30}",
- "\u{2FA0A}"=>"\u9B12", "\u{2FA0B}"=>"\u9C40", "\u{2FA0C}"=>"\u9CFD", "\u{2FA0D}"=>"\u4CCE", "\u{2FA0E}"=>"\u4CED", "\u{2FA0F}"=>"\u9D67", "\u{2FA10}"=>"\u{2A0CE}", "\u{2FA11}"=>"\u4CF8",
- "\u{2FA12}"=>"\u{2A105}", "\u{2FA13}"=>"\u{2A20E}", "\u{2FA14}"=>"\u{2A291}", "\u{2FA15}"=>"\u9EBB", "\u{2FA16}"=>"\u4D56", "\u{2FA17}"=>"\u9EF9", "\u{2FA18}"=>"\u9EFE", "\u{2FA19}"=>"\u9F05",
- "\u{2FA1A}"=>"\u9F0F", "\u{2FA1B}"=>"\u9F16", "\u{2FA1C}"=>"\u9F3B", "\u{2FA1D}"=>"\u{2A600}",
- }.freeze
-
- KOMPATIBLE_TABLE = {
- "\u00A0"=>" ", "\u00A8"=>" \u0308", "\u00AA"=>"a", "\u00AF"=>" \u0304", "\u00B2"=>"2", "\u00B3"=>"3", "\u00B4"=>" \u0301", "\u00B5"=>"\u03BC",
- "\u00B8"=>" \u0327", "\u00B9"=>"1", "\u00BA"=>"o", "\u00BC"=>"1\u20444", "\u00BD"=>"1\u20442", "\u00BE"=>"3\u20444", "\u0132"=>"IJ", "\u0133"=>"ij",
- "\u013F"=>"L\u00B7", "\u0140"=>"l\u00B7", "\u0149"=>"\u02BCn", "\u017F"=>"s", "\u01C4"=>"D\u017D", "\u01C5"=>"D\u017E", "\u01C6"=>"d\u017E", "\u01C7"=>"LJ",
- "\u01C8"=>"Lj", "\u01C9"=>"lj", "\u01CA"=>"NJ", "\u01CB"=>"Nj", "\u01CC"=>"nj", "\u01F1"=>"DZ", "\u01F2"=>"Dz", "\u01F3"=>"dz",
- "\u02B0"=>"h", "\u02B1"=>"\u0266", "\u02B2"=>"j", "\u02B3"=>"r", "\u02B4"=>"\u0279", "\u02B5"=>"\u027B", "\u02B6"=>"\u0281", "\u02B7"=>"w",
- "\u02B8"=>"y", "\u02D8"=>" \u0306", "\u02D9"=>" \u0307", "\u02DA"=>" \u030A", "\u02DB"=>" \u0328", "\u02DC"=>" \u0303", "\u02DD"=>" \u030B", "\u02E0"=>"\u0263",
- "\u02E1"=>"l", "\u02E2"=>"s", "\u02E3"=>"x", "\u02E4"=>"\u0295", "\u037A"=>" \u0345", "\u0384"=>" \u0301", "\u03D0"=>"\u03B2", "\u03D1"=>"\u03B8",
- "\u03D2"=>"\u03A5", "\u03D5"=>"\u03C6", "\u03D6"=>"\u03C0", "\u03F0"=>"\u03BA", "\u03F1"=>"\u03C1", "\u03F2"=>"\u03C2", "\u03F4"=>"\u0398", "\u03F5"=>"\u03B5",
- "\u03F9"=>"\u03A3", "\u0587"=>"\u0565\u0582", "\u0675"=>"\u0627\u0674", "\u0676"=>"\u0648\u0674", "\u0677"=>"\u06C7\u0674", "\u0678"=>"\u064A\u0674", "\u0E33"=>"\u0E4D\u0E32", "\u0EB3"=>"\u0ECD\u0EB2",
- "\u0EDC"=>"\u0EAB\u0E99", "\u0EDD"=>"\u0EAB\u0EA1", "\u0F0C"=>"\u0F0B", "\u0F77"=>"\u0FB2\u0F81", "\u0F79"=>"\u0FB3\u0F81", "\u10FC"=>"\u10DC", "\u1D2C"=>"A", "\u1D2D"=>"\u00C6",
- "\u1D2E"=>"B", "\u1D30"=>"D", "\u1D31"=>"E", "\u1D32"=>"\u018E", "\u1D33"=>"G", "\u1D34"=>"H", "\u1D35"=>"I", "\u1D36"=>"J",
- "\u1D37"=>"K", "\u1D38"=>"L", "\u1D39"=>"M", "\u1D3A"=>"N", "\u1D3C"=>"O", "\u1D3D"=>"\u0222", "\u1D3E"=>"P", "\u1D3F"=>"R",
- "\u1D40"=>"T", "\u1D41"=>"U", "\u1D42"=>"W", "\u1D43"=>"a", "\u1D44"=>"\u0250", "\u1D45"=>"\u0251", "\u1D46"=>"\u1D02", "\u1D47"=>"b",
- "\u1D48"=>"d", "\u1D49"=>"e", "\u1D4A"=>"\u0259", "\u1D4B"=>"\u025B", "\u1D4C"=>"\u025C", "\u1D4D"=>"g", "\u1D4F"=>"k", "\u1D50"=>"m",
- "\u1D51"=>"\u014B", "\u1D52"=>"o", "\u1D53"=>"\u0254", "\u1D54"=>"\u1D16", "\u1D55"=>"\u1D17", "\u1D56"=>"p", "\u1D57"=>"t", "\u1D58"=>"u",
- "\u1D59"=>"\u1D1D", "\u1D5A"=>"\u026F", "\u1D5B"=>"v", "\u1D5C"=>"\u1D25", "\u1D5D"=>"\u03B2", "\u1D5E"=>"\u03B3", "\u1D5F"=>"\u03B4", "\u1D60"=>"\u03C6",
- "\u1D61"=>"\u03C7", "\u1D62"=>"i", "\u1D63"=>"r", "\u1D64"=>"u", "\u1D65"=>"v", "\u1D66"=>"\u03B2", "\u1D67"=>"\u03B3", "\u1D68"=>"\u03C1",
- "\u1D69"=>"\u03C6", "\u1D6A"=>"\u03C7", "\u1D78"=>"\u043D", "\u1D9B"=>"\u0252", "\u1D9C"=>"c", "\u1D9D"=>"\u0255", "\u1D9E"=>"\u00F0", "\u1D9F"=>"\u025C",
- "\u1DA0"=>"f", "\u1DA1"=>"\u025F", "\u1DA2"=>"\u0261", "\u1DA3"=>"\u0265", "\u1DA4"=>"\u0268", "\u1DA5"=>"\u0269", "\u1DA6"=>"\u026A", "\u1DA7"=>"\u1D7B",
- "\u1DA8"=>"\u029D", "\u1DA9"=>"\u026D", "\u1DAA"=>"\u1D85", "\u1DAB"=>"\u029F", "\u1DAC"=>"\u0271", "\u1DAD"=>"\u0270", "\u1DAE"=>"\u0272", "\u1DAF"=>"\u0273",
- "\u1DB0"=>"\u0274", "\u1DB1"=>"\u0275", "\u1DB2"=>"\u0278", "\u1DB3"=>"\u0282", "\u1DB4"=>"\u0283", "\u1DB5"=>"\u01AB", "\u1DB6"=>"\u0289", "\u1DB7"=>"\u028A",
- "\u1DB8"=>"\u1D1C", "\u1DB9"=>"\u028B", "\u1DBA"=>"\u028C", "\u1DBB"=>"z", "\u1DBC"=>"\u0290", "\u1DBD"=>"\u0291", "\u1DBE"=>"\u0292", "\u1DBF"=>"\u03B8",
- "\u1E9A"=>"a\u02BE", "\u1FBD"=>" \u0313", "\u1FBF"=>" \u0313", "\u1FC0"=>" \u0342", "\u1FFE"=>" \u0314", "\u2002"=>" ", "\u2003"=>" ", "\u2004"=>" ",
- "\u2005"=>" ", "\u2006"=>" ", "\u2007"=>" ", "\u2008"=>" ", "\u2009"=>" ", "\u200A"=>" ", "\u2011"=>"\u2010", "\u2017"=>" \u0333",
- "\u2024"=>".", "\u2025"=>"..", "\u2026"=>"...", "\u202F"=>" ", "\u2033"=>"\u2032\u2032", "\u2034"=>"\u2032\u2032\u2032", "\u2036"=>"\u2035\u2035", "\u2037"=>"\u2035\u2035\u2035",
- "\u203C"=>"!!", "\u203E"=>" \u0305", "\u2047"=>"??", "\u2048"=>"?!", "\u2049"=>"!?", "\u2057"=>"\u2032\u2032\u2032\u2032", "\u205F"=>" ", "\u2070"=>"0",
- "\u2071"=>"i", "\u2074"=>"4", "\u2075"=>"5", "\u2076"=>"6", "\u2077"=>"7", "\u2078"=>"8", "\u2079"=>"9", "\u207A"=>"+",
- "\u207B"=>"\u2212", "\u207C"=>"=", "\u207D"=>"(", "\u207E"=>")", "\u207F"=>"n", "\u2080"=>"0", "\u2081"=>"1", "\u2082"=>"2",
- "\u2083"=>"3", "\u2084"=>"4", "\u2085"=>"5", "\u2086"=>"6", "\u2087"=>"7", "\u2088"=>"8", "\u2089"=>"9", "\u208A"=>"+",
- "\u208B"=>"\u2212", "\u208C"=>"=", "\u208D"=>"(", "\u208E"=>")", "\u2090"=>"a", "\u2091"=>"e", "\u2092"=>"o", "\u2093"=>"x",
- "\u2094"=>"\u0259", "\u2095"=>"h", "\u2096"=>"k", "\u2097"=>"l", "\u2098"=>"m", "\u2099"=>"n", "\u209A"=>"p", "\u209B"=>"s",
- "\u209C"=>"t", "\u20A8"=>"Rs", "\u2100"=>"a/c", "\u2101"=>"a/s", "\u2102"=>"C", "\u2103"=>"\u00B0C", "\u2105"=>"c/o", "\u2106"=>"c/u",
- "\u2107"=>"\u0190", "\u2109"=>"\u00B0F", "\u210A"=>"g", "\u210B"=>"H", "\u210C"=>"H", "\u210D"=>"H", "\u210E"=>"h", "\u210F"=>"\u0127",
- "\u2110"=>"I", "\u2111"=>"I", "\u2112"=>"L", "\u2113"=>"l", "\u2115"=>"N", "\u2116"=>"No", "\u2119"=>"P", "\u211A"=>"Q",
- "\u211B"=>"R", "\u211C"=>"R", "\u211D"=>"R", "\u2120"=>"SM", "\u2121"=>"TEL", "\u2122"=>"TM", "\u2124"=>"Z", "\u2128"=>"Z",
- "\u212C"=>"B", "\u212D"=>"C", "\u212F"=>"e", "\u2130"=>"E", "\u2131"=>"F", "\u2133"=>"M", "\u2134"=>"o", "\u2135"=>"\u05D0",
- "\u2136"=>"\u05D1", "\u2137"=>"\u05D2", "\u2138"=>"\u05D3", "\u2139"=>"i", "\u213B"=>"FAX", "\u213C"=>"\u03C0", "\u213D"=>"\u03B3", "\u213E"=>"\u0393",
- "\u213F"=>"\u03A0", "\u2140"=>"\u2211", "\u2145"=>"D", "\u2146"=>"d", "\u2147"=>"e", "\u2148"=>"i", "\u2149"=>"j", "\u2150"=>"1\u20447",
- "\u2151"=>"1\u20449", "\u2152"=>"1\u204410", "\u2153"=>"1\u20443", "\u2154"=>"2\u20443", "\u2155"=>"1\u20445", "\u2156"=>"2\u20445", "\u2157"=>"3\u20445", "\u2158"=>"4\u20445",
- "\u2159"=>"1\u20446", "\u215A"=>"5\u20446", "\u215B"=>"1\u20448", "\u215C"=>"3\u20448", "\u215D"=>"5\u20448", "\u215E"=>"7\u20448", "\u215F"=>"1\u2044", "\u2160"=>"I",
- "\u2161"=>"II", "\u2162"=>"III", "\u2163"=>"IV", "\u2164"=>"V", "\u2165"=>"VI", "\u2166"=>"VII", "\u2167"=>"VIII", "\u2168"=>"IX",
- "\u2169"=>"X", "\u216A"=>"XI", "\u216B"=>"XII", "\u216C"=>"L", "\u216D"=>"C", "\u216E"=>"D", "\u216F"=>"M", "\u2170"=>"i",
- "\u2171"=>"ii", "\u2172"=>"iii", "\u2173"=>"iv", "\u2174"=>"v", "\u2175"=>"vi", "\u2176"=>"vii", "\u2177"=>"viii", "\u2178"=>"ix",
- "\u2179"=>"x", "\u217A"=>"xi", "\u217B"=>"xii", "\u217C"=>"l", "\u217D"=>"c", "\u217E"=>"d", "\u217F"=>"m", "\u2189"=>"0\u20443",
- "\u222C"=>"\u222B\u222B", "\u222D"=>"\u222B\u222B\u222B", "\u222F"=>"\u222E\u222E", "\u2230"=>"\u222E\u222E\u222E", "\u2460"=>"1", "\u2461"=>"2", "\u2462"=>"3", "\u2463"=>"4",
- "\u2464"=>"5", "\u2465"=>"6", "\u2466"=>"7", "\u2467"=>"8", "\u2468"=>"9", "\u2469"=>"10", "\u246A"=>"11", "\u246B"=>"12",
- "\u246C"=>"13", "\u246D"=>"14", "\u246E"=>"15", "\u246F"=>"16", "\u2470"=>"17", "\u2471"=>"18", "\u2472"=>"19", "\u2473"=>"20",
- "\u2474"=>"(1)", "\u2475"=>"(2)", "\u2476"=>"(3)", "\u2477"=>"(4)", "\u2478"=>"(5)", "\u2479"=>"(6)", "\u247A"=>"(7)", "\u247B"=>"(8)",
- "\u247C"=>"(9)", "\u247D"=>"(10)", "\u247E"=>"(11)", "\u247F"=>"(12)", "\u2480"=>"(13)", "\u2481"=>"(14)", "\u2482"=>"(15)", "\u2483"=>"(16)",
- "\u2484"=>"(17)", "\u2485"=>"(18)", "\u2486"=>"(19)", "\u2487"=>"(20)", "\u2488"=>"1.", "\u2489"=>"2.", "\u248A"=>"3.", "\u248B"=>"4.",
- "\u248C"=>"5.", "\u248D"=>"6.", "\u248E"=>"7.", "\u248F"=>"8.", "\u2490"=>"9.", "\u2491"=>"10.", "\u2492"=>"11.", "\u2493"=>"12.",
- "\u2494"=>"13.", "\u2495"=>"14.", "\u2496"=>"15.", "\u2497"=>"16.", "\u2498"=>"17.", "\u2499"=>"18.", "\u249A"=>"19.", "\u249B"=>"20.",
- "\u249C"=>"(a)", "\u249D"=>"(b)", "\u249E"=>"(c)", "\u249F"=>"(d)", "\u24A0"=>"(e)", "\u24A1"=>"(f)", "\u24A2"=>"(g)", "\u24A3"=>"(h)",
- "\u24A4"=>"(i)", "\u24A5"=>"(j)", "\u24A6"=>"(k)", "\u24A7"=>"(l)", "\u24A8"=>"(m)", "\u24A9"=>"(n)", "\u24AA"=>"(o)", "\u24AB"=>"(p)",
- "\u24AC"=>"(q)", "\u24AD"=>"(r)", "\u24AE"=>"(s)", "\u24AF"=>"(t)", "\u24B0"=>"(u)", "\u24B1"=>"(v)", "\u24B2"=>"(w)", "\u24B3"=>"(x)",
- "\u24B4"=>"(y)", "\u24B5"=>"(z)", "\u24B6"=>"A", "\u24B7"=>"B", "\u24B8"=>"C", "\u24B9"=>"D", "\u24BA"=>"E", "\u24BB"=>"F",
- "\u24BC"=>"G", "\u24BD"=>"H", "\u24BE"=>"I", "\u24BF"=>"J", "\u24C0"=>"K", "\u24C1"=>"L", "\u24C2"=>"M", "\u24C3"=>"N",
- "\u24C4"=>"O", "\u24C5"=>"P", "\u24C6"=>"Q", "\u24C7"=>"R", "\u24C8"=>"S", "\u24C9"=>"T", "\u24CA"=>"U", "\u24CB"=>"V",
- "\u24CC"=>"W", "\u24CD"=>"X", "\u24CE"=>"Y", "\u24CF"=>"Z", "\u24D0"=>"a", "\u24D1"=>"b", "\u24D2"=>"c", "\u24D3"=>"d",
- "\u24D4"=>"e", "\u24D5"=>"f", "\u24D6"=>"g", "\u24D7"=>"h", "\u24D8"=>"i", "\u24D9"=>"j", "\u24DA"=>"k", "\u24DB"=>"l",
- "\u24DC"=>"m", "\u24DD"=>"n", "\u24DE"=>"o", "\u24DF"=>"p", "\u24E0"=>"q", "\u24E1"=>"r", "\u24E2"=>"s", "\u24E3"=>"t",
- "\u24E4"=>"u", "\u24E5"=>"v", "\u24E6"=>"w", "\u24E7"=>"x", "\u24E8"=>"y", "\u24E9"=>"z", "\u24EA"=>"0", "\u2A0C"=>"\u222B\u222B\u222B\u222B",
- "\u2A74"=>"::=", "\u2A75"=>"==", "\u2A76"=>"===", "\u2C7C"=>"j", "\u2C7D"=>"V", "\u2D6F"=>"\u2D61", "\u2E9F"=>"\u6BCD", "\u2EF3"=>"\u9F9F",
- "\u2F00"=>"\u4E00", "\u2F01"=>"\u4E28", "\u2F02"=>"\u4E36", "\u2F03"=>"\u4E3F", "\u2F04"=>"\u4E59", "\u2F05"=>"\u4E85", "\u2F06"=>"\u4E8C", "\u2F07"=>"\u4EA0",
- "\u2F08"=>"\u4EBA", "\u2F09"=>"\u513F", "\u2F0A"=>"\u5165", "\u2F0B"=>"\u516B", "\u2F0C"=>"\u5182", "\u2F0D"=>"\u5196", "\u2F0E"=>"\u51AB", "\u2F0F"=>"\u51E0",
- "\u2F10"=>"\u51F5", "\u2F11"=>"\u5200", "\u2F12"=>"\u529B", "\u2F13"=>"\u52F9", "\u2F14"=>"\u5315", "\u2F15"=>"\u531A", "\u2F16"=>"\u5338", "\u2F17"=>"\u5341",
- "\u2F18"=>"\u535C", "\u2F19"=>"\u5369", "\u2F1A"=>"\u5382", "\u2F1B"=>"\u53B6", "\u2F1C"=>"\u53C8", "\u2F1D"=>"\u53E3", "\u2F1E"=>"\u56D7", "\u2F1F"=>"\u571F",
- "\u2F20"=>"\u58EB", "\u2F21"=>"\u5902", "\u2F22"=>"\u590A", "\u2F23"=>"\u5915", "\u2F24"=>"\u5927", "\u2F25"=>"\u5973", "\u2F26"=>"\u5B50", "\u2F27"=>"\u5B80",
- "\u2F28"=>"\u5BF8", "\u2F29"=>"\u5C0F", "\u2F2A"=>"\u5C22", "\u2F2B"=>"\u5C38", "\u2F2C"=>"\u5C6E", "\u2F2D"=>"\u5C71", "\u2F2E"=>"\u5DDB", "\u2F2F"=>"\u5DE5",
- "\u2F30"=>"\u5DF1", "\u2F31"=>"\u5DFE", "\u2F32"=>"\u5E72", "\u2F33"=>"\u5E7A", "\u2F34"=>"\u5E7F", "\u2F35"=>"\u5EF4", "\u2F36"=>"\u5EFE", "\u2F37"=>"\u5F0B",
- "\u2F38"=>"\u5F13", "\u2F39"=>"\u5F50", "\u2F3A"=>"\u5F61", "\u2F3B"=>"\u5F73", "\u2F3C"=>"\u5FC3", "\u2F3D"=>"\u6208", "\u2F3E"=>"\u6236", "\u2F3F"=>"\u624B",
- "\u2F40"=>"\u652F", "\u2F41"=>"\u6534", "\u2F42"=>"\u6587", "\u2F43"=>"\u6597", "\u2F44"=>"\u65A4", "\u2F45"=>"\u65B9", "\u2F46"=>"\u65E0", "\u2F47"=>"\u65E5",
- "\u2F48"=>"\u66F0", "\u2F49"=>"\u6708", "\u2F4A"=>"\u6728", "\u2F4B"=>"\u6B20", "\u2F4C"=>"\u6B62", "\u2F4D"=>"\u6B79", "\u2F4E"=>"\u6BB3", "\u2F4F"=>"\u6BCB",
- "\u2F50"=>"\u6BD4", "\u2F51"=>"\u6BDB", "\u2F52"=>"\u6C0F", "\u2F53"=>"\u6C14", "\u2F54"=>"\u6C34", "\u2F55"=>"\u706B", "\u2F56"=>"\u722A", "\u2F57"=>"\u7236",
- "\u2F58"=>"\u723B", "\u2F59"=>"\u723F", "\u2F5A"=>"\u7247", "\u2F5B"=>"\u7259", "\u2F5C"=>"\u725B", "\u2F5D"=>"\u72AC", "\u2F5E"=>"\u7384", "\u2F5F"=>"\u7389",
- "\u2F60"=>"\u74DC", "\u2F61"=>"\u74E6", "\u2F62"=>"\u7518", "\u2F63"=>"\u751F", "\u2F64"=>"\u7528", "\u2F65"=>"\u7530", "\u2F66"=>"\u758B", "\u2F67"=>"\u7592",
- "\u2F68"=>"\u7676", "\u2F69"=>"\u767D", "\u2F6A"=>"\u76AE", "\u2F6B"=>"\u76BF", "\u2F6C"=>"\u76EE", "\u2F6D"=>"\u77DB", "\u2F6E"=>"\u77E2", "\u2F6F"=>"\u77F3",
- "\u2F70"=>"\u793A", "\u2F71"=>"\u79B8", "\u2F72"=>"\u79BE", "\u2F73"=>"\u7A74", "\u2F74"=>"\u7ACB", "\u2F75"=>"\u7AF9", "\u2F76"=>"\u7C73", "\u2F77"=>"\u7CF8",
- "\u2F78"=>"\u7F36", "\u2F79"=>"\u7F51", "\u2F7A"=>"\u7F8A", "\u2F7B"=>"\u7FBD", "\u2F7C"=>"\u8001", "\u2F7D"=>"\u800C", "\u2F7E"=>"\u8012", "\u2F7F"=>"\u8033",
- "\u2F80"=>"\u807F", "\u2F81"=>"\u8089", "\u2F82"=>"\u81E3", "\u2F83"=>"\u81EA", "\u2F84"=>"\u81F3", "\u2F85"=>"\u81FC", "\u2F86"=>"\u820C", "\u2F87"=>"\u821B",
- "\u2F88"=>"\u821F", "\u2F89"=>"\u826E", "\u2F8A"=>"\u8272", "\u2F8B"=>"\u8278", "\u2F8C"=>"\u864D", "\u2F8D"=>"\u866B", "\u2F8E"=>"\u8840", "\u2F8F"=>"\u884C",
- "\u2F90"=>"\u8863", "\u2F91"=>"\u897E", "\u2F92"=>"\u898B", "\u2F93"=>"\u89D2", "\u2F94"=>"\u8A00", "\u2F95"=>"\u8C37", "\u2F96"=>"\u8C46", "\u2F97"=>"\u8C55",
- "\u2F98"=>"\u8C78", "\u2F99"=>"\u8C9D", "\u2F9A"=>"\u8D64", "\u2F9B"=>"\u8D70", "\u2F9C"=>"\u8DB3", "\u2F9D"=>"\u8EAB", "\u2F9E"=>"\u8ECA", "\u2F9F"=>"\u8F9B",
- "\u2FA0"=>"\u8FB0", "\u2FA1"=>"\u8FB5", "\u2FA2"=>"\u9091", "\u2FA3"=>"\u9149", "\u2FA4"=>"\u91C6", "\u2FA5"=>"\u91CC", "\u2FA6"=>"\u91D1", "\u2FA7"=>"\u9577",
- "\u2FA8"=>"\u9580", "\u2FA9"=>"\u961C", "\u2FAA"=>"\u96B6", "\u2FAB"=>"\u96B9", "\u2FAC"=>"\u96E8", "\u2FAD"=>"\u9751", "\u2FAE"=>"\u975E", "\u2FAF"=>"\u9762",
- "\u2FB0"=>"\u9769", "\u2FB1"=>"\u97CB", "\u2FB2"=>"\u97ED", "\u2FB3"=>"\u97F3", "\u2FB4"=>"\u9801", "\u2FB5"=>"\u98A8", "\u2FB6"=>"\u98DB", "\u2FB7"=>"\u98DF",
- "\u2FB8"=>"\u9996", "\u2FB9"=>"\u9999", "\u2FBA"=>"\u99AC", "\u2FBB"=>"\u9AA8", "\u2FBC"=>"\u9AD8", "\u2FBD"=>"\u9ADF", "\u2FBE"=>"\u9B25", "\u2FBF"=>"\u9B2F",
- "\u2FC0"=>"\u9B32", "\u2FC1"=>"\u9B3C", "\u2FC2"=>"\u9B5A", "\u2FC3"=>"\u9CE5", "\u2FC4"=>"\u9E75", "\u2FC5"=>"\u9E7F", "\u2FC6"=>"\u9EA5", "\u2FC7"=>"\u9EBB",
- "\u2FC8"=>"\u9EC3", "\u2FC9"=>"\u9ECD", "\u2FCA"=>"\u9ED1", "\u2FCB"=>"\u9EF9", "\u2FCC"=>"\u9EFD", "\u2FCD"=>"\u9F0E", "\u2FCE"=>"\u9F13", "\u2FCF"=>"\u9F20",
- "\u2FD0"=>"\u9F3B", "\u2FD1"=>"\u9F4A", "\u2FD2"=>"\u9F52", "\u2FD3"=>"\u9F8D", "\u2FD4"=>"\u9F9C", "\u2FD5"=>"\u9FA0", "\u3000"=>" ", "\u3036"=>"\u3012",
- "\u3038"=>"\u5341", "\u3039"=>"\u5344", "\u303A"=>"\u5345", "\u309B"=>" \u3099", "\u309C"=>" \u309A", "\u309F"=>"\u3088\u308A", "\u30FF"=>"\u30B3\u30C8", "\u3131"=>"\u1100",
- "\u3132"=>"\u1101", "\u3133"=>"\u11AA", "\u3134"=>"\u1102", "\u3135"=>"\u11AC", "\u3136"=>"\u11AD", "\u3137"=>"\u1103", "\u3138"=>"\u1104", "\u3139"=>"\u1105",
- "\u313A"=>"\u11B0", "\u313B"=>"\u11B1", "\u313C"=>"\u11B2", "\u313D"=>"\u11B3", "\u313E"=>"\u11B4", "\u313F"=>"\u11B5", "\u3140"=>"\u111A", "\u3141"=>"\u1106",
- "\u3142"=>"\u1107", "\u3143"=>"\u1108", "\u3144"=>"\u1121", "\u3145"=>"\u1109", "\u3146"=>"\u110A", "\u3147"=>"\u110B", "\u3148"=>"\u110C", "\u3149"=>"\u110D",
- "\u314A"=>"\u110E", "\u314B"=>"\u110F", "\u314C"=>"\u1110", "\u314D"=>"\u1111", "\u314E"=>"\u1112", "\u314F"=>"\u1161", "\u3150"=>"\u1162", "\u3151"=>"\u1163",
- "\u3152"=>"\u1164", "\u3153"=>"\u1165", "\u3154"=>"\u1166", "\u3155"=>"\u1167", "\u3156"=>"\u1168", "\u3157"=>"\u1169", "\u3158"=>"\u116A", "\u3159"=>"\u116B",
- "\u315A"=>"\u116C", "\u315B"=>"\u116D", "\u315C"=>"\u116E", "\u315D"=>"\u116F", "\u315E"=>"\u1170", "\u315F"=>"\u1171", "\u3160"=>"\u1172", "\u3161"=>"\u1173",
- "\u3162"=>"\u1174", "\u3163"=>"\u1175", "\u3164"=>"\u1160", "\u3165"=>"\u1114", "\u3166"=>"\u1115", "\u3167"=>"\u11C7", "\u3168"=>"\u11C8", "\u3169"=>"\u11CC",
- "\u316A"=>"\u11CE", "\u316B"=>"\u11D3", "\u316C"=>"\u11D7", "\u316D"=>"\u11D9", "\u316E"=>"\u111C", "\u316F"=>"\u11DD", "\u3170"=>"\u11DF", "\u3171"=>"\u111D",
- "\u3172"=>"\u111E", "\u3173"=>"\u1120", "\u3174"=>"\u1122", "\u3175"=>"\u1123", "\u3176"=>"\u1127", "\u3177"=>"\u1129", "\u3178"=>"\u112B", "\u3179"=>"\u112C",
- "\u317A"=>"\u112D", "\u317B"=>"\u112E", "\u317C"=>"\u112F", "\u317D"=>"\u1132", "\u317E"=>"\u1136", "\u317F"=>"\u1140", "\u3180"=>"\u1147", "\u3181"=>"\u114C",
- "\u3182"=>"\u11F1", "\u3183"=>"\u11F2", "\u3184"=>"\u1157", "\u3185"=>"\u1158", "\u3186"=>"\u1159", "\u3187"=>"\u1184", "\u3188"=>"\u1185", "\u3189"=>"\u1188",
- "\u318A"=>"\u1191", "\u318B"=>"\u1192", "\u318C"=>"\u1194", "\u318D"=>"\u119E", "\u318E"=>"\u11A1", "\u3192"=>"\u4E00", "\u3193"=>"\u4E8C", "\u3194"=>"\u4E09",
- "\u3195"=>"\u56DB", "\u3196"=>"\u4E0A", "\u3197"=>"\u4E2D", "\u3198"=>"\u4E0B", "\u3199"=>"\u7532", "\u319A"=>"\u4E59", "\u319B"=>"\u4E19", "\u319C"=>"\u4E01",
- "\u319D"=>"\u5929", "\u319E"=>"\u5730", "\u319F"=>"\u4EBA", "\u3200"=>"(\u1100)", "\u3201"=>"(\u1102)", "\u3202"=>"(\u1103)", "\u3203"=>"(\u1105)", "\u3204"=>"(\u1106)",
- "\u3205"=>"(\u1107)", "\u3206"=>"(\u1109)", "\u3207"=>"(\u110B)", "\u3208"=>"(\u110C)", "\u3209"=>"(\u110E)", "\u320A"=>"(\u110F)", "\u320B"=>"(\u1110)", "\u320C"=>"(\u1111)",
- "\u320D"=>"(\u1112)", "\u320E"=>"(\u1100\u1161)", "\u320F"=>"(\u1102\u1161)", "\u3210"=>"(\u1103\u1161)", "\u3211"=>"(\u1105\u1161)", "\u3212"=>"(\u1106\u1161)", "\u3213"=>"(\u1107\u1161)", "\u3214"=>"(\u1109\u1161)",
- "\u3215"=>"(\u110B\u1161)", "\u3216"=>"(\u110C\u1161)", "\u3217"=>"(\u110E\u1161)", "\u3218"=>"(\u110F\u1161)", "\u3219"=>"(\u1110\u1161)", "\u321A"=>"(\u1111\u1161)", "\u321B"=>"(\u1112\u1161)", "\u321C"=>"(\u110C\u116E)",
- "\u321D"=>"(\u110B\u1169\u110C\u1165\u11AB)", "\u321E"=>"(\u110B\u1169\u1112\u116E)", "\u3220"=>"(\u4E00)", "\u3221"=>"(\u4E8C)", "\u3222"=>"(\u4E09)", "\u3223"=>"(\u56DB)", "\u3224"=>"(\u4E94)", "\u3225"=>"(\u516D)",
- "\u3226"=>"(\u4E03)", "\u3227"=>"(\u516B)", "\u3228"=>"(\u4E5D)", "\u3229"=>"(\u5341)", "\u322A"=>"(\u6708)", "\u322B"=>"(\u706B)", "\u322C"=>"(\u6C34)", "\u322D"=>"(\u6728)",
- "\u322E"=>"(\u91D1)", "\u322F"=>"(\u571F)", "\u3230"=>"(\u65E5)", "\u3231"=>"(\u682A)", "\u3232"=>"(\u6709)", "\u3233"=>"(\u793E)", "\u3234"=>"(\u540D)", "\u3235"=>"(\u7279)",
- "\u3236"=>"(\u8CA1)", "\u3237"=>"(\u795D)", "\u3238"=>"(\u52B4)", "\u3239"=>"(\u4EE3)", "\u323A"=>"(\u547C)", "\u323B"=>"(\u5B66)", "\u323C"=>"(\u76E3)", "\u323D"=>"(\u4F01)",
- "\u323E"=>"(\u8CC7)", "\u323F"=>"(\u5354)", "\u3240"=>"(\u796D)", "\u3241"=>"(\u4F11)", "\u3242"=>"(\u81EA)", "\u3243"=>"(\u81F3)", "\u3244"=>"\u554F", "\u3245"=>"\u5E7C",
- "\u3246"=>"\u6587", "\u3247"=>"\u7B8F", "\u3250"=>"PTE", "\u3251"=>"21", "\u3252"=>"22", "\u3253"=>"23", "\u3254"=>"24", "\u3255"=>"25",
- "\u3256"=>"26", "\u3257"=>"27", "\u3258"=>"28", "\u3259"=>"29", "\u325A"=>"30", "\u325B"=>"31", "\u325C"=>"32", "\u325D"=>"33",
- "\u325E"=>"34", "\u325F"=>"35", "\u3260"=>"\u1100", "\u3261"=>"\u1102", "\u3262"=>"\u1103", "\u3263"=>"\u1105", "\u3264"=>"\u1106", "\u3265"=>"\u1107",
- "\u3266"=>"\u1109", "\u3267"=>"\u110B", "\u3268"=>"\u110C", "\u3269"=>"\u110E", "\u326A"=>"\u110F", "\u326B"=>"\u1110", "\u326C"=>"\u1111", "\u326D"=>"\u1112",
- "\u326E"=>"\u1100\u1161", "\u326F"=>"\u1102\u1161", "\u3270"=>"\u1103\u1161", "\u3271"=>"\u1105\u1161", "\u3272"=>"\u1106\u1161", "\u3273"=>"\u1107\u1161", "\u3274"=>"\u1109\u1161", "\u3275"=>"\u110B\u1161",
- "\u3276"=>"\u110C\u1161", "\u3277"=>"\u110E\u1161", "\u3278"=>"\u110F\u1161", "\u3279"=>"\u1110\u1161", "\u327A"=>"\u1111\u1161", "\u327B"=>"\u1112\u1161", "\u327C"=>"\u110E\u1161\u11B7\u1100\u1169", "\u327D"=>"\u110C\u116E\u110B\u1174",
- "\u327E"=>"\u110B\u116E", "\u3280"=>"\u4E00", "\u3281"=>"\u4E8C", "\u3282"=>"\u4E09", "\u3283"=>"\u56DB", "\u3284"=>"\u4E94", "\u3285"=>"\u516D", "\u3286"=>"\u4E03",
- "\u3287"=>"\u516B", "\u3288"=>"\u4E5D", "\u3289"=>"\u5341", "\u328A"=>"\u6708", "\u328B"=>"\u706B", "\u328C"=>"\u6C34", "\u328D"=>"\u6728", "\u328E"=>"\u91D1",
- "\u328F"=>"\u571F", "\u3290"=>"\u65E5", "\u3291"=>"\u682A", "\u3292"=>"\u6709", "\u3293"=>"\u793E", "\u3294"=>"\u540D", "\u3295"=>"\u7279", "\u3296"=>"\u8CA1",
- "\u3297"=>"\u795D", "\u3298"=>"\u52B4", "\u3299"=>"\u79D8", "\u329A"=>"\u7537", "\u329B"=>"\u5973", "\u329C"=>"\u9069", "\u329D"=>"\u512A", "\u329E"=>"\u5370",
- "\u329F"=>"\u6CE8", "\u32A0"=>"\u9805", "\u32A1"=>"\u4F11", "\u32A2"=>"\u5199", "\u32A3"=>"\u6B63", "\u32A4"=>"\u4E0A", "\u32A5"=>"\u4E2D", "\u32A6"=>"\u4E0B",
- "\u32A7"=>"\u5DE6", "\u32A8"=>"\u53F3", "\u32A9"=>"\u533B", "\u32AA"=>"\u5B97", "\u32AB"=>"\u5B66", "\u32AC"=>"\u76E3", "\u32AD"=>"\u4F01", "\u32AE"=>"\u8CC7",
- "\u32AF"=>"\u5354", "\u32B0"=>"\u591C", "\u32B1"=>"36", "\u32B2"=>"37", "\u32B3"=>"38", "\u32B4"=>"39", "\u32B5"=>"40", "\u32B6"=>"41",
- "\u32B7"=>"42", "\u32B8"=>"43", "\u32B9"=>"44", "\u32BA"=>"45", "\u32BB"=>"46", "\u32BC"=>"47", "\u32BD"=>"48", "\u32BE"=>"49",
- "\u32BF"=>"50", "\u32C0"=>"1\u6708", "\u32C1"=>"2\u6708", "\u32C2"=>"3\u6708", "\u32C3"=>"4\u6708", "\u32C4"=>"5\u6708", "\u32C5"=>"6\u6708", "\u32C6"=>"7\u6708",
- "\u32C7"=>"8\u6708", "\u32C8"=>"9\u6708", "\u32C9"=>"10\u6708", "\u32CA"=>"11\u6708", "\u32CB"=>"12\u6708", "\u32CC"=>"Hg", "\u32CD"=>"erg", "\u32CE"=>"eV",
- "\u32CF"=>"LTD", "\u32D0"=>"\u30A2", "\u32D1"=>"\u30A4", "\u32D2"=>"\u30A6", "\u32D3"=>"\u30A8", "\u32D4"=>"\u30AA", "\u32D5"=>"\u30AB", "\u32D6"=>"\u30AD",
- "\u32D7"=>"\u30AF", "\u32D8"=>"\u30B1", "\u32D9"=>"\u30B3", "\u32DA"=>"\u30B5", "\u32DB"=>"\u30B7", "\u32DC"=>"\u30B9", "\u32DD"=>"\u30BB", "\u32DE"=>"\u30BD",
- "\u32DF"=>"\u30BF", "\u32E0"=>"\u30C1", "\u32E1"=>"\u30C4", "\u32E2"=>"\u30C6", "\u32E3"=>"\u30C8", "\u32E4"=>"\u30CA", "\u32E5"=>"\u30CB", "\u32E6"=>"\u30CC",
- "\u32E7"=>"\u30CD", "\u32E8"=>"\u30CE", "\u32E9"=>"\u30CF", "\u32EA"=>"\u30D2", "\u32EB"=>"\u30D5", "\u32EC"=>"\u30D8", "\u32ED"=>"\u30DB", "\u32EE"=>"\u30DE",
- "\u32EF"=>"\u30DF", "\u32F0"=>"\u30E0", "\u32F1"=>"\u30E1", "\u32F2"=>"\u30E2", "\u32F3"=>"\u30E4", "\u32F4"=>"\u30E6", "\u32F5"=>"\u30E8", "\u32F6"=>"\u30E9",
- "\u32F7"=>"\u30EA", "\u32F8"=>"\u30EB", "\u32F9"=>"\u30EC", "\u32FA"=>"\u30ED", "\u32FB"=>"\u30EF", "\u32FC"=>"\u30F0", "\u32FD"=>"\u30F1", "\u32FE"=>"\u30F2",
- "\u3300"=>"\u30A2\u30D1\u30FC\u30C8", "\u3301"=>"\u30A2\u30EB\u30D5\u30A1", "\u3302"=>"\u30A2\u30F3\u30DA\u30A2", "\u3303"=>"\u30A2\u30FC\u30EB", "\u3304"=>"\u30A4\u30CB\u30F3\u30B0", "\u3305"=>"\u30A4\u30F3\u30C1", "\u3306"=>"\u30A6\u30A9\u30F3", "\u3307"=>"\u30A8\u30B9\u30AF\u30FC\u30C9",
- "\u3308"=>"\u30A8\u30FC\u30AB\u30FC", "\u3309"=>"\u30AA\u30F3\u30B9", "\u330A"=>"\u30AA\u30FC\u30E0", "\u330B"=>"\u30AB\u30A4\u30EA", "\u330C"=>"\u30AB\u30E9\u30C3\u30C8", "\u330D"=>"\u30AB\u30ED\u30EA\u30FC", "\u330E"=>"\u30AC\u30ED\u30F3", "\u330F"=>"\u30AC\u30F3\u30DE",
- "\u3310"=>"\u30AE\u30AC", "\u3311"=>"\u30AE\u30CB\u30FC", "\u3312"=>"\u30AD\u30E5\u30EA\u30FC", "\u3313"=>"\u30AE\u30EB\u30C0\u30FC", "\u3314"=>"\u30AD\u30ED", "\u3315"=>"\u30AD\u30ED\u30B0\u30E9\u30E0", "\u3316"=>"\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB", "\u3317"=>"\u30AD\u30ED\u30EF\u30C3\u30C8",
- "\u3318"=>"\u30B0\u30E9\u30E0", "\u3319"=>"\u30B0\u30E9\u30E0\u30C8\u30F3", "\u331A"=>"\u30AF\u30EB\u30BC\u30A4\u30ED", "\u331B"=>"\u30AF\u30ED\u30FC\u30CD", "\u331C"=>"\u30B1\u30FC\u30B9", "\u331D"=>"\u30B3\u30EB\u30CA", "\u331E"=>"\u30B3\u30FC\u30DD", "\u331F"=>"\u30B5\u30A4\u30AF\u30EB",
- "\u3320"=>"\u30B5\u30F3\u30C1\u30FC\u30E0", "\u3321"=>"\u30B7\u30EA\u30F3\u30B0", "\u3322"=>"\u30BB\u30F3\u30C1", "\u3323"=>"\u30BB\u30F3\u30C8", "\u3324"=>"\u30C0\u30FC\u30B9", "\u3325"=>"\u30C7\u30B7", "\u3326"=>"\u30C9\u30EB", "\u3327"=>"\u30C8\u30F3",
- "\u3328"=>"\u30CA\u30CE", "\u3329"=>"\u30CE\u30C3\u30C8", "\u332A"=>"\u30CF\u30A4\u30C4", "\u332B"=>"\u30D1\u30FC\u30BB\u30F3\u30C8", "\u332C"=>"\u30D1\u30FC\u30C4", "\u332D"=>"\u30D0\u30FC\u30EC\u30EB", "\u332E"=>"\u30D4\u30A2\u30B9\u30C8\u30EB", "\u332F"=>"\u30D4\u30AF\u30EB",
- "\u3330"=>"\u30D4\u30B3", "\u3331"=>"\u30D3\u30EB", "\u3332"=>"\u30D5\u30A1\u30E9\u30C3\u30C9", "\u3333"=>"\u30D5\u30A3\u30FC\u30C8", "\u3334"=>"\u30D6\u30C3\u30B7\u30A7\u30EB", "\u3335"=>"\u30D5\u30E9\u30F3", "\u3336"=>"\u30D8\u30AF\u30BF\u30FC\u30EB", "\u3337"=>"\u30DA\u30BD",
- "\u3338"=>"\u30DA\u30CB\u30D2", "\u3339"=>"\u30D8\u30EB\u30C4", "\u333A"=>"\u30DA\u30F3\u30B9", "\u333B"=>"\u30DA\u30FC\u30B8", "\u333C"=>"\u30D9\u30FC\u30BF", "\u333D"=>"\u30DD\u30A4\u30F3\u30C8", "\u333E"=>"\u30DC\u30EB\u30C8", "\u333F"=>"\u30DB\u30F3",
- "\u3340"=>"\u30DD\u30F3\u30C9", "\u3341"=>"\u30DB\u30FC\u30EB", "\u3342"=>"\u30DB\u30FC\u30F3", "\u3343"=>"\u30DE\u30A4\u30AF\u30ED", "\u3344"=>"\u30DE\u30A4\u30EB", "\u3345"=>"\u30DE\u30C3\u30CF", "\u3346"=>"\u30DE\u30EB\u30AF", "\u3347"=>"\u30DE\u30F3\u30B7\u30E7\u30F3",
- "\u3348"=>"\u30DF\u30AF\u30ED\u30F3", "\u3349"=>"\u30DF\u30EA", "\u334A"=>"\u30DF\u30EA\u30D0\u30FC\u30EB", "\u334B"=>"\u30E1\u30AC", "\u334C"=>"\u30E1\u30AC\u30C8\u30F3", "\u334D"=>"\u30E1\u30FC\u30C8\u30EB", "\u334E"=>"\u30E4\u30FC\u30C9", "\u334F"=>"\u30E4\u30FC\u30EB",
- "\u3350"=>"\u30E6\u30A2\u30F3", "\u3351"=>"\u30EA\u30C3\u30C8\u30EB", "\u3352"=>"\u30EA\u30E9", "\u3353"=>"\u30EB\u30D4\u30FC", "\u3354"=>"\u30EB\u30FC\u30D6\u30EB", "\u3355"=>"\u30EC\u30E0", "\u3356"=>"\u30EC\u30F3\u30C8\u30B2\u30F3", "\u3357"=>"\u30EF\u30C3\u30C8",
- "\u3358"=>"0\u70B9", "\u3359"=>"1\u70B9", "\u335A"=>"2\u70B9", "\u335B"=>"3\u70B9", "\u335C"=>"4\u70B9", "\u335D"=>"5\u70B9", "\u335E"=>"6\u70B9", "\u335F"=>"7\u70B9",
- "\u3360"=>"8\u70B9", "\u3361"=>"9\u70B9", "\u3362"=>"10\u70B9", "\u3363"=>"11\u70B9", "\u3364"=>"12\u70B9", "\u3365"=>"13\u70B9", "\u3366"=>"14\u70B9", "\u3367"=>"15\u70B9",
- "\u3368"=>"16\u70B9", "\u3369"=>"17\u70B9", "\u336A"=>"18\u70B9", "\u336B"=>"19\u70B9", "\u336C"=>"20\u70B9", "\u336D"=>"21\u70B9", "\u336E"=>"22\u70B9", "\u336F"=>"23\u70B9",
- "\u3370"=>"24\u70B9", "\u3371"=>"hPa", "\u3372"=>"da", "\u3373"=>"AU", "\u3374"=>"bar", "\u3375"=>"oV", "\u3376"=>"pc", "\u3377"=>"dm",
- "\u3378"=>"dm2", "\u3379"=>"dm3", "\u337A"=>"IU", "\u337B"=>"\u5E73\u6210", "\u337C"=>"\u662D\u548C", "\u337D"=>"\u5927\u6B63", "\u337E"=>"\u660E\u6CBB", "\u337F"=>"\u682A\u5F0F\u4F1A\u793E",
- "\u3380"=>"pA", "\u3381"=>"nA", "\u3382"=>"\u03BCA", "\u3383"=>"mA", "\u3384"=>"kA", "\u3385"=>"KB", "\u3386"=>"MB", "\u3387"=>"GB",
- "\u3388"=>"cal", "\u3389"=>"kcal", "\u338A"=>"pF", "\u338B"=>"nF", "\u338C"=>"\u03BCF", "\u338D"=>"\u03BCg", "\u338E"=>"mg", "\u338F"=>"kg",
- "\u3390"=>"Hz", "\u3391"=>"kHz", "\u3392"=>"MHz", "\u3393"=>"GHz", "\u3394"=>"THz", "\u3395"=>"\u03BCl", "\u3396"=>"ml", "\u3397"=>"dl",
- "\u3398"=>"kl", "\u3399"=>"fm", "\u339A"=>"nm", "\u339B"=>"\u03BCm", "\u339C"=>"mm", "\u339D"=>"cm", "\u339E"=>"km", "\u339F"=>"mm2",
- "\u33A0"=>"cm2", "\u33A1"=>"m2", "\u33A2"=>"km2", "\u33A3"=>"mm3", "\u33A4"=>"cm3", "\u33A5"=>"m3", "\u33A6"=>"km3", "\u33A7"=>"m\u2215s",
- "\u33A8"=>"m\u2215s2", "\u33A9"=>"Pa", "\u33AA"=>"kPa", "\u33AB"=>"MPa", "\u33AC"=>"GPa", "\u33AD"=>"rad", "\u33AE"=>"rad\u2215s", "\u33AF"=>"rad\u2215s2",
- "\u33B0"=>"ps", "\u33B1"=>"ns", "\u33B2"=>"\u03BCs", "\u33B3"=>"ms", "\u33B4"=>"pV", "\u33B5"=>"nV", "\u33B6"=>"\u03BCV", "\u33B7"=>"mV",
- "\u33B8"=>"kV", "\u33B9"=>"MV", "\u33BA"=>"pW", "\u33BB"=>"nW", "\u33BC"=>"\u03BCW", "\u33BD"=>"mW", "\u33BE"=>"kW", "\u33BF"=>"MW",
- "\u33C0"=>"k\u03A9", "\u33C1"=>"M\u03A9", "\u33C2"=>"a.m.", "\u33C3"=>"Bq", "\u33C4"=>"cc", "\u33C5"=>"cd", "\u33C6"=>"C\u2215kg", "\u33C7"=>"Co.",
- "\u33C8"=>"dB", "\u33C9"=>"Gy", "\u33CA"=>"ha", "\u33CB"=>"HP", "\u33CC"=>"in", "\u33CD"=>"KK", "\u33CE"=>"KM", "\u33CF"=>"kt",
- "\u33D0"=>"lm", "\u33D1"=>"ln", "\u33D2"=>"log", "\u33D3"=>"lx", "\u33D4"=>"mb", "\u33D5"=>"mil", "\u33D6"=>"mol", "\u33D7"=>"PH",
- "\u33D8"=>"p.m.", "\u33D9"=>"PPM", "\u33DA"=>"PR", "\u33DB"=>"sr", "\u33DC"=>"Sv", "\u33DD"=>"Wb", "\u33DE"=>"V\u2215m", "\u33DF"=>"A\u2215m",
- "\u33E0"=>"1\u65E5", "\u33E1"=>"2\u65E5", "\u33E2"=>"3\u65E5", "\u33E3"=>"4\u65E5", "\u33E4"=>"5\u65E5", "\u33E5"=>"6\u65E5", "\u33E6"=>"7\u65E5", "\u33E7"=>"8\u65E5",
- "\u33E8"=>"9\u65E5", "\u33E9"=>"10\u65E5", "\u33EA"=>"11\u65E5", "\u33EB"=>"12\u65E5", "\u33EC"=>"13\u65E5", "\u33ED"=>"14\u65E5", "\u33EE"=>"15\u65E5", "\u33EF"=>"16\u65E5",
- "\u33F0"=>"17\u65E5", "\u33F1"=>"18\u65E5", "\u33F2"=>"19\u65E5", "\u33F3"=>"20\u65E5", "\u33F4"=>"21\u65E5", "\u33F5"=>"22\u65E5", "\u33F6"=>"23\u65E5", "\u33F7"=>"24\u65E5",
- "\u33F8"=>"25\u65E5", "\u33F9"=>"26\u65E5", "\u33FA"=>"27\u65E5", "\u33FB"=>"28\u65E5", "\u33FC"=>"29\u65E5", "\u33FD"=>"30\u65E5", "\u33FE"=>"31\u65E5", "\u33FF"=>"gal",
- "\uA69C"=>"\u044A", "\uA69D"=>"\u044C", "\uA770"=>"\uA76F", "\uA7F8"=>"\u0126", "\uA7F9"=>"\u0153", "\uAB5C"=>"\uA727", "\uAB5D"=>"\uAB37", "\uAB5E"=>"\u026B",
- "\uAB5F"=>"\uAB52", "\uFB00"=>"ff", "\uFB01"=>"fi", "\uFB02"=>"fl", "\uFB03"=>"ffi", "\uFB04"=>"ffl", "\uFB05"=>"st", "\uFB06"=>"st",
- "\uFB13"=>"\u0574\u0576", "\uFB14"=>"\u0574\u0565", "\uFB15"=>"\u0574\u056B", "\uFB16"=>"\u057E\u0576", "\uFB17"=>"\u0574\u056D", "\uFB20"=>"\u05E2", "\uFB21"=>"\u05D0", "\uFB22"=>"\u05D3",
- "\uFB23"=>"\u05D4", "\uFB24"=>"\u05DB", "\uFB25"=>"\u05DC", "\uFB26"=>"\u05DD", "\uFB27"=>"\u05E8", "\uFB28"=>"\u05EA", "\uFB29"=>"+", "\uFB4F"=>"\u05D0\u05DC",
- "\uFB50"=>"\u0671", "\uFB51"=>"\u0671", "\uFB52"=>"\u067B", "\uFB53"=>"\u067B", "\uFB54"=>"\u067B", "\uFB55"=>"\u067B", "\uFB56"=>"\u067E", "\uFB57"=>"\u067E",
- "\uFB58"=>"\u067E", "\uFB59"=>"\u067E", "\uFB5A"=>"\u0680", "\uFB5B"=>"\u0680", "\uFB5C"=>"\u0680", "\uFB5D"=>"\u0680", "\uFB5E"=>"\u067A", "\uFB5F"=>"\u067A",
- "\uFB60"=>"\u067A", "\uFB61"=>"\u067A", "\uFB62"=>"\u067F", "\uFB63"=>"\u067F", "\uFB64"=>"\u067F", "\uFB65"=>"\u067F", "\uFB66"=>"\u0679", "\uFB67"=>"\u0679",
- "\uFB68"=>"\u0679", "\uFB69"=>"\u0679", "\uFB6A"=>"\u06A4", "\uFB6B"=>"\u06A4", "\uFB6C"=>"\u06A4", "\uFB6D"=>"\u06A4", "\uFB6E"=>"\u06A6", "\uFB6F"=>"\u06A6",
- "\uFB70"=>"\u06A6", "\uFB71"=>"\u06A6", "\uFB72"=>"\u0684", "\uFB73"=>"\u0684", "\uFB74"=>"\u0684", "\uFB75"=>"\u0684", "\uFB76"=>"\u0683", "\uFB77"=>"\u0683",
- "\uFB78"=>"\u0683", "\uFB79"=>"\u0683", "\uFB7A"=>"\u0686", "\uFB7B"=>"\u0686", "\uFB7C"=>"\u0686", "\uFB7D"=>"\u0686", "\uFB7E"=>"\u0687", "\uFB7F"=>"\u0687",
- "\uFB80"=>"\u0687", "\uFB81"=>"\u0687", "\uFB82"=>"\u068D", "\uFB83"=>"\u068D", "\uFB84"=>"\u068C", "\uFB85"=>"\u068C", "\uFB86"=>"\u068E", "\uFB87"=>"\u068E",
- "\uFB88"=>"\u0688", "\uFB89"=>"\u0688", "\uFB8A"=>"\u0698", "\uFB8B"=>"\u0698", "\uFB8C"=>"\u0691", "\uFB8D"=>"\u0691", "\uFB8E"=>"\u06A9", "\uFB8F"=>"\u06A9",
- "\uFB90"=>"\u06A9", "\uFB91"=>"\u06A9", "\uFB92"=>"\u06AF", "\uFB93"=>"\u06AF", "\uFB94"=>"\u06AF", "\uFB95"=>"\u06AF", "\uFB96"=>"\u06B3", "\uFB97"=>"\u06B3",
- "\uFB98"=>"\u06B3", "\uFB99"=>"\u06B3", "\uFB9A"=>"\u06B1", "\uFB9B"=>"\u06B1", "\uFB9C"=>"\u06B1", "\uFB9D"=>"\u06B1", "\uFB9E"=>"\u06BA", "\uFB9F"=>"\u06BA",
- "\uFBA0"=>"\u06BB", "\uFBA1"=>"\u06BB", "\uFBA2"=>"\u06BB", "\uFBA3"=>"\u06BB", "\uFBA4"=>"\u06C0", "\uFBA5"=>"\u06C0", "\uFBA6"=>"\u06C1", "\uFBA7"=>"\u06C1",
- "\uFBA8"=>"\u06C1", "\uFBA9"=>"\u06C1", "\uFBAA"=>"\u06BE", "\uFBAB"=>"\u06BE", "\uFBAC"=>"\u06BE", "\uFBAD"=>"\u06BE", "\uFBAE"=>"\u06D2", "\uFBAF"=>"\u06D2",
- "\uFBB0"=>"\u06D3", "\uFBB1"=>"\u06D3", "\uFBD3"=>"\u06AD", "\uFBD4"=>"\u06AD", "\uFBD5"=>"\u06AD", "\uFBD6"=>"\u06AD", "\uFBD7"=>"\u06C7", "\uFBD8"=>"\u06C7",
- "\uFBD9"=>"\u06C6", "\uFBDA"=>"\u06C6", "\uFBDB"=>"\u06C8", "\uFBDC"=>"\u06C8", "\uFBDD"=>"\u06C7\u0674", "\uFBDE"=>"\u06CB", "\uFBDF"=>"\u06CB", "\uFBE0"=>"\u06C5",
- "\uFBE1"=>"\u06C5", "\uFBE2"=>"\u06C9", "\uFBE3"=>"\u06C9", "\uFBE4"=>"\u06D0", "\uFBE5"=>"\u06D0", "\uFBE6"=>"\u06D0", "\uFBE7"=>"\u06D0", "\uFBE8"=>"\u0649",
- "\uFBE9"=>"\u0649", "\uFBEA"=>"\u0626\u0627", "\uFBEB"=>"\u0626\u0627", "\uFBEC"=>"\u0626\u06D5", "\uFBED"=>"\u0626\u06D5", "\uFBEE"=>"\u0626\u0648", "\uFBEF"=>"\u0626\u0648", "\uFBF0"=>"\u0626\u06C7",
- "\uFBF1"=>"\u0626\u06C7", "\uFBF2"=>"\u0626\u06C6", "\uFBF3"=>"\u0626\u06C6", "\uFBF4"=>"\u0626\u06C8", "\uFBF5"=>"\u0626\u06C8", "\uFBF6"=>"\u0626\u06D0", "\uFBF7"=>"\u0626\u06D0", "\uFBF8"=>"\u0626\u06D0",
- "\uFBF9"=>"\u0626\u0649", "\uFBFA"=>"\u0626\u0649", "\uFBFB"=>"\u0626\u0649", "\uFBFC"=>"\u06CC", "\uFBFD"=>"\u06CC", "\uFBFE"=>"\u06CC", "\uFBFF"=>"\u06CC", "\uFC00"=>"\u0626\u062C",
- "\uFC01"=>"\u0626\u062D", "\uFC02"=>"\u0626\u0645", "\uFC03"=>"\u0626\u0649", "\uFC04"=>"\u0626\u064A", "\uFC05"=>"\u0628\u062C", "\uFC06"=>"\u0628\u062D", "\uFC07"=>"\u0628\u062E", "\uFC08"=>"\u0628\u0645",
- "\uFC09"=>"\u0628\u0649", "\uFC0A"=>"\u0628\u064A", "\uFC0B"=>"\u062A\u062C", "\uFC0C"=>"\u062A\u062D", "\uFC0D"=>"\u062A\u062E", "\uFC0E"=>"\u062A\u0645", "\uFC0F"=>"\u062A\u0649", "\uFC10"=>"\u062A\u064A",
- "\uFC11"=>"\u062B\u062C", "\uFC12"=>"\u062B\u0645", "\uFC13"=>"\u062B\u0649", "\uFC14"=>"\u062B\u064A", "\uFC15"=>"\u062C\u062D", "\uFC16"=>"\u062C\u0645", "\uFC17"=>"\u062D\u062C", "\uFC18"=>"\u062D\u0645",
- "\uFC19"=>"\u062E\u062C", "\uFC1A"=>"\u062E\u062D", "\uFC1B"=>"\u062E\u0645", "\uFC1C"=>"\u0633\u062C", "\uFC1D"=>"\u0633\u062D", "\uFC1E"=>"\u0633\u062E", "\uFC1F"=>"\u0633\u0645", "\uFC20"=>"\u0635\u062D",
- "\uFC21"=>"\u0635\u0645", "\uFC22"=>"\u0636\u062C", "\uFC23"=>"\u0636\u062D", "\uFC24"=>"\u0636\u062E", "\uFC25"=>"\u0636\u0645", "\uFC26"=>"\u0637\u062D", "\uFC27"=>"\u0637\u0645", "\uFC28"=>"\u0638\u0645",
- "\uFC29"=>"\u0639\u062C", "\uFC2A"=>"\u0639\u0645", "\uFC2B"=>"\u063A\u062C", "\uFC2C"=>"\u063A\u0645", "\uFC2D"=>"\u0641\u062C", "\uFC2E"=>"\u0641\u062D", "\uFC2F"=>"\u0641\u062E", "\uFC30"=>"\u0641\u0645",
- "\uFC31"=>"\u0641\u0649", "\uFC32"=>"\u0641\u064A", "\uFC33"=>"\u0642\u062D", "\uFC34"=>"\u0642\u0645", "\uFC35"=>"\u0642\u0649", "\uFC36"=>"\u0642\u064A", "\uFC37"=>"\u0643\u0627", "\uFC38"=>"\u0643\u062C",
- "\uFC39"=>"\u0643\u062D", "\uFC3A"=>"\u0643\u062E", "\uFC3B"=>"\u0643\u0644", "\uFC3C"=>"\u0643\u0645", "\uFC3D"=>"\u0643\u0649", "\uFC3E"=>"\u0643\u064A", "\uFC3F"=>"\u0644\u062C", "\uFC40"=>"\u0644\u062D",
- "\uFC41"=>"\u0644\u062E", "\uFC42"=>"\u0644\u0645", "\uFC43"=>"\u0644\u0649", "\uFC44"=>"\u0644\u064A", "\uFC45"=>"\u0645\u062C", "\uFC46"=>"\u0645\u062D", "\uFC47"=>"\u0645\u062E", "\uFC48"=>"\u0645\u0645",
- "\uFC49"=>"\u0645\u0649", "\uFC4A"=>"\u0645\u064A", "\uFC4B"=>"\u0646\u062C", "\uFC4C"=>"\u0646\u062D", "\uFC4D"=>"\u0646\u062E", "\uFC4E"=>"\u0646\u0645", "\uFC4F"=>"\u0646\u0649", "\uFC50"=>"\u0646\u064A",
- "\uFC51"=>"\u0647\u062C", "\uFC52"=>"\u0647\u0645", "\uFC53"=>"\u0647\u0649", "\uFC54"=>"\u0647\u064A", "\uFC55"=>"\u064A\u062C", "\uFC56"=>"\u064A\u062D", "\uFC57"=>"\u064A\u062E", "\uFC58"=>"\u064A\u0645",
- "\uFC59"=>"\u064A\u0649", "\uFC5A"=>"\u064A\u064A", "\uFC5B"=>"\u0630\u0670", "\uFC5C"=>"\u0631\u0670", "\uFC5D"=>"\u0649\u0670", "\uFC5E"=>" \u064C\u0651", "\uFC5F"=>" \u064D\u0651", "\uFC60"=>" \u064E\u0651",
- "\uFC61"=>" \u064F\u0651", "\uFC62"=>" \u0650\u0651", "\uFC63"=>" \u0651\u0670", "\uFC64"=>"\u0626\u0631", "\uFC65"=>"\u0626\u0632", "\uFC66"=>"\u0626\u0645", "\uFC67"=>"\u0626\u0646", "\uFC68"=>"\u0626\u0649",
- "\uFC69"=>"\u0626\u064A", "\uFC6A"=>"\u0628\u0631", "\uFC6B"=>"\u0628\u0632", "\uFC6C"=>"\u0628\u0645", "\uFC6D"=>"\u0628\u0646", "\uFC6E"=>"\u0628\u0649", "\uFC6F"=>"\u0628\u064A", "\uFC70"=>"\u062A\u0631",
- "\uFC71"=>"\u062A\u0632", "\uFC72"=>"\u062A\u0645", "\uFC73"=>"\u062A\u0646", "\uFC74"=>"\u062A\u0649", "\uFC75"=>"\u062A\u064A", "\uFC76"=>"\u062B\u0631", "\uFC77"=>"\u062B\u0632", "\uFC78"=>"\u062B\u0645",
- "\uFC79"=>"\u062B\u0646", "\uFC7A"=>"\u062B\u0649", "\uFC7B"=>"\u062B\u064A", "\uFC7C"=>"\u0641\u0649", "\uFC7D"=>"\u0641\u064A", "\uFC7E"=>"\u0642\u0649", "\uFC7F"=>"\u0642\u064A", "\uFC80"=>"\u0643\u0627",
- "\uFC81"=>"\u0643\u0644", "\uFC82"=>"\u0643\u0645", "\uFC83"=>"\u0643\u0649", "\uFC84"=>"\u0643\u064A", "\uFC85"=>"\u0644\u0645", "\uFC86"=>"\u0644\u0649", "\uFC87"=>"\u0644\u064A", "\uFC88"=>"\u0645\u0627",
- "\uFC89"=>"\u0645\u0645", "\uFC8A"=>"\u0646\u0631", "\uFC8B"=>"\u0646\u0632", "\uFC8C"=>"\u0646\u0645", "\uFC8D"=>"\u0646\u0646", "\uFC8E"=>"\u0646\u0649", "\uFC8F"=>"\u0646\u064A", "\uFC90"=>"\u0649\u0670",
- "\uFC91"=>"\u064A\u0631", "\uFC92"=>"\u064A\u0632", "\uFC93"=>"\u064A\u0645", "\uFC94"=>"\u064A\u0646", "\uFC95"=>"\u064A\u0649", "\uFC96"=>"\u064A\u064A", "\uFC97"=>"\u0626\u062C", "\uFC98"=>"\u0626\u062D",
- "\uFC99"=>"\u0626\u062E", "\uFC9A"=>"\u0626\u0645", "\uFC9B"=>"\u0626\u0647", "\uFC9C"=>"\u0628\u062C", "\uFC9D"=>"\u0628\u062D", "\uFC9E"=>"\u0628\u062E", "\uFC9F"=>"\u0628\u0645", "\uFCA0"=>"\u0628\u0647",
- "\uFCA1"=>"\u062A\u062C", "\uFCA2"=>"\u062A\u062D", "\uFCA3"=>"\u062A\u062E", "\uFCA4"=>"\u062A\u0645", "\uFCA5"=>"\u062A\u0647", "\uFCA6"=>"\u062B\u0645", "\uFCA7"=>"\u062C\u062D", "\uFCA8"=>"\u062C\u0645",
- "\uFCA9"=>"\u062D\u062C", "\uFCAA"=>"\u062D\u0645", "\uFCAB"=>"\u062E\u062C", "\uFCAC"=>"\u062E\u0645", "\uFCAD"=>"\u0633\u062C", "\uFCAE"=>"\u0633\u062D", "\uFCAF"=>"\u0633\u062E", "\uFCB0"=>"\u0633\u0645",
- "\uFCB1"=>"\u0635\u062D", "\uFCB2"=>"\u0635\u062E", "\uFCB3"=>"\u0635\u0645", "\uFCB4"=>"\u0636\u062C", "\uFCB5"=>"\u0636\u062D", "\uFCB6"=>"\u0636\u062E", "\uFCB7"=>"\u0636\u0645", "\uFCB8"=>"\u0637\u062D",
- "\uFCB9"=>"\u0638\u0645", "\uFCBA"=>"\u0639\u062C", "\uFCBB"=>"\u0639\u0645", "\uFCBC"=>"\u063A\u062C", "\uFCBD"=>"\u063A\u0645", "\uFCBE"=>"\u0641\u062C", "\uFCBF"=>"\u0641\u062D", "\uFCC0"=>"\u0641\u062E",
- "\uFCC1"=>"\u0641\u0645", "\uFCC2"=>"\u0642\u062D", "\uFCC3"=>"\u0642\u0645", "\uFCC4"=>"\u0643\u062C", "\uFCC5"=>"\u0643\u062D", "\uFCC6"=>"\u0643\u062E", "\uFCC7"=>"\u0643\u0644", "\uFCC8"=>"\u0643\u0645",
- "\uFCC9"=>"\u0644\u062C", "\uFCCA"=>"\u0644\u062D", "\uFCCB"=>"\u0644\u062E", "\uFCCC"=>"\u0644\u0645", "\uFCCD"=>"\u0644\u0647", "\uFCCE"=>"\u0645\u062C", "\uFCCF"=>"\u0645\u062D", "\uFCD0"=>"\u0645\u062E",
- "\uFCD1"=>"\u0645\u0645", "\uFCD2"=>"\u0646\u062C", "\uFCD3"=>"\u0646\u062D", "\uFCD4"=>"\u0646\u062E", "\uFCD5"=>"\u0646\u0645", "\uFCD6"=>"\u0646\u0647", "\uFCD7"=>"\u0647\u062C", "\uFCD8"=>"\u0647\u0645",
- "\uFCD9"=>"\u0647\u0670", "\uFCDA"=>"\u064A\u062C", "\uFCDB"=>"\u064A\u062D", "\uFCDC"=>"\u064A\u062E", "\uFCDD"=>"\u064A\u0645", "\uFCDE"=>"\u064A\u0647", "\uFCDF"=>"\u0626\u0645", "\uFCE0"=>"\u0626\u0647",
- "\uFCE1"=>"\u0628\u0645", "\uFCE2"=>"\u0628\u0647", "\uFCE3"=>"\u062A\u0645", "\uFCE4"=>"\u062A\u0647", "\uFCE5"=>"\u062B\u0645", "\uFCE6"=>"\u062B\u0647", "\uFCE7"=>"\u0633\u0645", "\uFCE8"=>"\u0633\u0647",
- "\uFCE9"=>"\u0634\u0645", "\uFCEA"=>"\u0634\u0647", "\uFCEB"=>"\u0643\u0644", "\uFCEC"=>"\u0643\u0645", "\uFCED"=>"\u0644\u0645", "\uFCEE"=>"\u0646\u0645", "\uFCEF"=>"\u0646\u0647", "\uFCF0"=>"\u064A\u0645",
- "\uFCF1"=>"\u064A\u0647", "\uFCF2"=>"\u0640\u064E\u0651", "\uFCF3"=>"\u0640\u064F\u0651", "\uFCF4"=>"\u0640\u0650\u0651", "\uFCF5"=>"\u0637\u0649", "\uFCF6"=>"\u0637\u064A", "\uFCF7"=>"\u0639\u0649", "\uFCF8"=>"\u0639\u064A",
- "\uFCF9"=>"\u063A\u0649", "\uFCFA"=>"\u063A\u064A", "\uFCFB"=>"\u0633\u0649", "\uFCFC"=>"\u0633\u064A", "\uFCFD"=>"\u0634\u0649", "\uFCFE"=>"\u0634\u064A", "\uFCFF"=>"\u062D\u0649", "\uFD00"=>"\u062D\u064A",
- "\uFD01"=>"\u062C\u0649", "\uFD02"=>"\u062C\u064A", "\uFD03"=>"\u062E\u0649", "\uFD04"=>"\u062E\u064A", "\uFD05"=>"\u0635\u0649", "\uFD06"=>"\u0635\u064A", "\uFD07"=>"\u0636\u0649", "\uFD08"=>"\u0636\u064A",
- "\uFD09"=>"\u0634\u062C", "\uFD0A"=>"\u0634\u062D", "\uFD0B"=>"\u0634\u062E", "\uFD0C"=>"\u0634\u0645", "\uFD0D"=>"\u0634\u0631", "\uFD0E"=>"\u0633\u0631", "\uFD0F"=>"\u0635\u0631", "\uFD10"=>"\u0636\u0631",
- "\uFD11"=>"\u0637\u0649", "\uFD12"=>"\u0637\u064A", "\uFD13"=>"\u0639\u0649", "\uFD14"=>"\u0639\u064A", "\uFD15"=>"\u063A\u0649", "\uFD16"=>"\u063A\u064A", "\uFD17"=>"\u0633\u0649", "\uFD18"=>"\u0633\u064A",
- "\uFD19"=>"\u0634\u0649", "\uFD1A"=>"\u0634\u064A", "\uFD1B"=>"\u062D\u0649", "\uFD1C"=>"\u062D\u064A", "\uFD1D"=>"\u062C\u0649", "\uFD1E"=>"\u062C\u064A", "\uFD1F"=>"\u062E\u0649", "\uFD20"=>"\u062E\u064A",
- "\uFD21"=>"\u0635\u0649", "\uFD22"=>"\u0635\u064A", "\uFD23"=>"\u0636\u0649", "\uFD24"=>"\u0636\u064A", "\uFD25"=>"\u0634\u062C", "\uFD26"=>"\u0634\u062D", "\uFD27"=>"\u0634\u062E", "\uFD28"=>"\u0634\u0645",
- "\uFD29"=>"\u0634\u0631", "\uFD2A"=>"\u0633\u0631", "\uFD2B"=>"\u0635\u0631", "\uFD2C"=>"\u0636\u0631", "\uFD2D"=>"\u0634\u062C", "\uFD2E"=>"\u0634\u062D", "\uFD2F"=>"\u0634\u062E", "\uFD30"=>"\u0634\u0645",
- "\uFD31"=>"\u0633\u0647", "\uFD32"=>"\u0634\u0647", "\uFD33"=>"\u0637\u0645", "\uFD34"=>"\u0633\u062C", "\uFD35"=>"\u0633\u062D", "\uFD36"=>"\u0633\u062E", "\uFD37"=>"\u0634\u062C", "\uFD38"=>"\u0634\u062D",
- "\uFD39"=>"\u0634\u062E", "\uFD3A"=>"\u0637\u0645", "\uFD3B"=>"\u0638\u0645", "\uFD3C"=>"\u0627\u064B", "\uFD3D"=>"\u0627\u064B", "\uFD50"=>"\u062A\u062C\u0645", "\uFD51"=>"\u062A\u062D\u062C", "\uFD52"=>"\u062A\u062D\u062C",
- "\uFD53"=>"\u062A\u062D\u0645", "\uFD54"=>"\u062A\u062E\u0645", "\uFD55"=>"\u062A\u0645\u062C", "\uFD56"=>"\u062A\u0645\u062D", "\uFD57"=>"\u062A\u0645\u062E", "\uFD58"=>"\u062C\u0645\u062D", "\uFD59"=>"\u062C\u0645\u062D", "\uFD5A"=>"\u062D\u0645\u064A",
- "\uFD5B"=>"\u062D\u0645\u0649", "\uFD5C"=>"\u0633\u062D\u062C", "\uFD5D"=>"\u0633\u062C\u062D", "\uFD5E"=>"\u0633\u062C\u0649", "\uFD5F"=>"\u0633\u0645\u062D", "\uFD60"=>"\u0633\u0645\u062D", "\uFD61"=>"\u0633\u0645\u062C", "\uFD62"=>"\u0633\u0645\u0645",
- "\uFD63"=>"\u0633\u0645\u0645", "\uFD64"=>"\u0635\u062D\u062D", "\uFD65"=>"\u0635\u062D\u062D", "\uFD66"=>"\u0635\u0645\u0645", "\uFD67"=>"\u0634\u062D\u0645", "\uFD68"=>"\u0634\u062D\u0645", "\uFD69"=>"\u0634\u062C\u064A", "\uFD6A"=>"\u0634\u0645\u062E",
- "\uFD6B"=>"\u0634\u0645\u062E", "\uFD6C"=>"\u0634\u0645\u0645", "\uFD6D"=>"\u0634\u0645\u0645", "\uFD6E"=>"\u0636\u062D\u0649", "\uFD6F"=>"\u0636\u062E\u0645", "\uFD70"=>"\u0636\u062E\u0645", "\uFD71"=>"\u0637\u0645\u062D", "\uFD72"=>"\u0637\u0645\u062D",
- "\uFD73"=>"\u0637\u0645\u0645", "\uFD74"=>"\u0637\u0645\u064A", "\uFD75"=>"\u0639\u062C\u0645", "\uFD76"=>"\u0639\u0645\u0645", "\uFD77"=>"\u0639\u0645\u0645", "\uFD78"=>"\u0639\u0645\u0649", "\uFD79"=>"\u063A\u0645\u0645", "\uFD7A"=>"\u063A\u0645\u064A",
- "\uFD7B"=>"\u063A\u0645\u0649", "\uFD7C"=>"\u0641\u062E\u0645", "\uFD7D"=>"\u0641\u062E\u0645", "\uFD7E"=>"\u0642\u0645\u062D", "\uFD7F"=>"\u0642\u0645\u0645", "\uFD80"=>"\u0644\u062D\u0645", "\uFD81"=>"\u0644\u062D\u064A", "\uFD82"=>"\u0644\u062D\u0649",
- "\uFD83"=>"\u0644\u062C\u062C", "\uFD84"=>"\u0644\u062C\u062C", "\uFD85"=>"\u0644\u062E\u0645", "\uFD86"=>"\u0644\u062E\u0645", "\uFD87"=>"\u0644\u0645\u062D", "\uFD88"=>"\u0644\u0645\u062D", "\uFD89"=>"\u0645\u062D\u062C", "\uFD8A"=>"\u0645\u062D\u0645",
- "\uFD8B"=>"\u0645\u062D\u064A", "\uFD8C"=>"\u0645\u062C\u062D", "\uFD8D"=>"\u0645\u062C\u0645", "\uFD8E"=>"\u0645\u062E\u062C", "\uFD8F"=>"\u0645\u062E\u0645", "\uFD92"=>"\u0645\u062C\u062E", "\uFD93"=>"\u0647\u0645\u062C", "\uFD94"=>"\u0647\u0645\u0645",
- "\uFD95"=>"\u0646\u062D\u0645", "\uFD96"=>"\u0646\u062D\u0649", "\uFD97"=>"\u0646\u062C\u0645", "\uFD98"=>"\u0646\u062C\u0645", "\uFD99"=>"\u0646\u062C\u0649", "\uFD9A"=>"\u0646\u0645\u064A", "\uFD9B"=>"\u0646\u0645\u0649", "\uFD9C"=>"\u064A\u0645\u0645",
- "\uFD9D"=>"\u064A\u0645\u0645", "\uFD9E"=>"\u0628\u062E\u064A", "\uFD9F"=>"\u062A\u062C\u064A", "\uFDA0"=>"\u062A\u062C\u0649", "\uFDA1"=>"\u062A\u062E\u064A", "\uFDA2"=>"\u062A\u062E\u0649", "\uFDA3"=>"\u062A\u0645\u064A", "\uFDA4"=>"\u062A\u0645\u0649",
- "\uFDA5"=>"\u062C\u0645\u064A", "\uFDA6"=>"\u062C\u062D\u0649", "\uFDA7"=>"\u062C\u0645\u0649", "\uFDA8"=>"\u0633\u062E\u0649", "\uFDA9"=>"\u0635\u062D\u064A", "\uFDAA"=>"\u0634\u062D\u064A", "\uFDAB"=>"\u0636\u062D\u064A", "\uFDAC"=>"\u0644\u062C\u064A",
- "\uFDAD"=>"\u0644\u0645\u064A", "\uFDAE"=>"\u064A\u062D\u064A", "\uFDAF"=>"\u064A\u062C\u064A", "\uFDB0"=>"\u064A\u0645\u064A", "\uFDB1"=>"\u0645\u0645\u064A", "\uFDB2"=>"\u0642\u0645\u064A", "\uFDB3"=>"\u0646\u062D\u064A", "\uFDB4"=>"\u0642\u0645\u062D",
- "\uFDB5"=>"\u0644\u062D\u0645", "\uFDB6"=>"\u0639\u0645\u064A", "\uFDB7"=>"\u0643\u0645\u064A", "\uFDB8"=>"\u0646\u062C\u062D", "\uFDB9"=>"\u0645\u062E\u064A", "\uFDBA"=>"\u0644\u062C\u0645", "\uFDBB"=>"\u0643\u0645\u0645", "\uFDBC"=>"\u0644\u062C\u0645",
- "\uFDBD"=>"\u0646\u062C\u062D", "\uFDBE"=>"\u062C\u062D\u064A", "\uFDBF"=>"\u062D\u062C\u064A", "\uFDC0"=>"\u0645\u062C\u064A", "\uFDC1"=>"\u0641\u0645\u064A", "\uFDC2"=>"\u0628\u062D\u064A", "\uFDC3"=>"\u0643\u0645\u0645", "\uFDC4"=>"\u0639\u062C\u0645",
- "\uFDC5"=>"\u0635\u0645\u0645", "\uFDC6"=>"\u0633\u062E\u064A", "\uFDC7"=>"\u0646\u062C\u064A", "\uFDF0"=>"\u0635\u0644\u06D2", "\uFDF1"=>"\u0642\u0644\u06D2", "\uFDF2"=>"\u0627\u0644\u0644\u0647", "\uFDF3"=>"\u0627\u0643\u0628\u0631", "\uFDF4"=>"\u0645\u062D\u0645\u062F",
- "\uFDF5"=>"\u0635\u0644\u0639\u0645", "\uFDF6"=>"\u0631\u0633\u0648\u0644", "\uFDF7"=>"\u0639\u0644\u064A\u0647", "\uFDF8"=>"\u0648\u0633\u0644\u0645", "\uFDF9"=>"\u0635\u0644\u0649", "\uFDFA"=>"\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644\u064A\u0647 \u0648\u0633\u0644\u0645", "\uFDFB"=>"\u062C\u0644 \u062C\u0644\u0627\u0644\u0647", "\uFDFC"=>"\u0631\u06CC\u0627\u0644",
- "\uFE10"=>",", "\uFE11"=>"\u3001", "\uFE12"=>"\u3002", "\uFE13"=>":", "\uFE14"=>";", "\uFE15"=>"!", "\uFE16"=>"?", "\uFE17"=>"\u3016",
- "\uFE18"=>"\u3017", "\uFE19"=>"...", "\uFE30"=>"..", "\uFE31"=>"\u2014", "\uFE32"=>"\u2013", "\uFE33"=>"_", "\uFE34"=>"_", "\uFE35"=>"(",
- "\uFE36"=>")", "\uFE37"=>"{", "\uFE38"=>"}", "\uFE39"=>"\u3014", "\uFE3A"=>"\u3015", "\uFE3B"=>"\u3010", "\uFE3C"=>"\u3011", "\uFE3D"=>"\u300A",
- "\uFE3E"=>"\u300B", "\uFE3F"=>"\u3008", "\uFE40"=>"\u3009", "\uFE41"=>"\u300C", "\uFE42"=>"\u300D", "\uFE43"=>"\u300E", "\uFE44"=>"\u300F", "\uFE47"=>"[",
- "\uFE48"=>"]", "\uFE49"=>" \u0305", "\uFE4A"=>" \u0305", "\uFE4B"=>" \u0305", "\uFE4C"=>" \u0305", "\uFE4D"=>"_", "\uFE4E"=>"_", "\uFE4F"=>"_",
- "\uFE50"=>",", "\uFE51"=>"\u3001", "\uFE52"=>".", "\uFE54"=>";", "\uFE55"=>":", "\uFE56"=>"?", "\uFE57"=>"!", "\uFE58"=>"\u2014",
- "\uFE59"=>"(", "\uFE5A"=>")", "\uFE5B"=>"{", "\uFE5C"=>"}", "\uFE5D"=>"\u3014", "\uFE5E"=>"\u3015", "\uFE5F"=>"#", "\uFE60"=>"&",
- "\uFE61"=>"*", "\uFE62"=>"+", "\uFE63"=>"-", "\uFE64"=>"<", "\uFE65"=>">", "\uFE66"=>"=", "\uFE68"=>"\\", "\uFE69"=>"$",
- "\uFE6A"=>"%", "\uFE6B"=>"@", "\uFE70"=>" \u064B", "\uFE71"=>"\u0640\u064B", "\uFE72"=>" \u064C", "\uFE74"=>" \u064D", "\uFE76"=>" \u064E", "\uFE77"=>"\u0640\u064E",
- "\uFE78"=>" \u064F", "\uFE79"=>"\u0640\u064F", "\uFE7A"=>" \u0650", "\uFE7B"=>"\u0640\u0650", "\uFE7C"=>" \u0651", "\uFE7D"=>"\u0640\u0651", "\uFE7E"=>" \u0652", "\uFE7F"=>"\u0640\u0652",
- "\uFE80"=>"\u0621", "\uFE81"=>"\u0622", "\uFE82"=>"\u0622", "\uFE83"=>"\u0623", "\uFE84"=>"\u0623", "\uFE85"=>"\u0624", "\uFE86"=>"\u0624", "\uFE87"=>"\u0625",
- "\uFE88"=>"\u0625", "\uFE89"=>"\u0626", "\uFE8A"=>"\u0626", "\uFE8B"=>"\u0626", "\uFE8C"=>"\u0626", "\uFE8D"=>"\u0627", "\uFE8E"=>"\u0627", "\uFE8F"=>"\u0628",
- "\uFE90"=>"\u0628", "\uFE91"=>"\u0628", "\uFE92"=>"\u0628", "\uFE93"=>"\u0629", "\uFE94"=>"\u0629", "\uFE95"=>"\u062A", "\uFE96"=>"\u062A", "\uFE97"=>"\u062A",
- "\uFE98"=>"\u062A", "\uFE99"=>"\u062B", "\uFE9A"=>"\u062B", "\uFE9B"=>"\u062B", "\uFE9C"=>"\u062B", "\uFE9D"=>"\u062C", "\uFE9E"=>"\u062C", "\uFE9F"=>"\u062C",
- "\uFEA0"=>"\u062C", "\uFEA1"=>"\u062D", "\uFEA2"=>"\u062D", "\uFEA3"=>"\u062D", "\uFEA4"=>"\u062D", "\uFEA5"=>"\u062E", "\uFEA6"=>"\u062E", "\uFEA7"=>"\u062E",
- "\uFEA8"=>"\u062E", "\uFEA9"=>"\u062F", "\uFEAA"=>"\u062F", "\uFEAB"=>"\u0630", "\uFEAC"=>"\u0630", "\uFEAD"=>"\u0631", "\uFEAE"=>"\u0631", "\uFEAF"=>"\u0632",
- "\uFEB0"=>"\u0632", "\uFEB1"=>"\u0633", "\uFEB2"=>"\u0633", "\uFEB3"=>"\u0633", "\uFEB4"=>"\u0633", "\uFEB5"=>"\u0634", "\uFEB6"=>"\u0634", "\uFEB7"=>"\u0634",
- "\uFEB8"=>"\u0634", "\uFEB9"=>"\u0635", "\uFEBA"=>"\u0635", "\uFEBB"=>"\u0635", "\uFEBC"=>"\u0635", "\uFEBD"=>"\u0636", "\uFEBE"=>"\u0636", "\uFEBF"=>"\u0636",
- "\uFEC0"=>"\u0636", "\uFEC1"=>"\u0637", "\uFEC2"=>"\u0637", "\uFEC3"=>"\u0637", "\uFEC4"=>"\u0637", "\uFEC5"=>"\u0638", "\uFEC6"=>"\u0638", "\uFEC7"=>"\u0638",
- "\uFEC8"=>"\u0638", "\uFEC9"=>"\u0639", "\uFECA"=>"\u0639", "\uFECB"=>"\u0639", "\uFECC"=>"\u0639", "\uFECD"=>"\u063A", "\uFECE"=>"\u063A", "\uFECF"=>"\u063A",
- "\uFED0"=>"\u063A", "\uFED1"=>"\u0641", "\uFED2"=>"\u0641", "\uFED3"=>"\u0641", "\uFED4"=>"\u0641", "\uFED5"=>"\u0642", "\uFED6"=>"\u0642", "\uFED7"=>"\u0642",
- "\uFED8"=>"\u0642", "\uFED9"=>"\u0643", "\uFEDA"=>"\u0643", "\uFEDB"=>"\u0643", "\uFEDC"=>"\u0643", "\uFEDD"=>"\u0644", "\uFEDE"=>"\u0644", "\uFEDF"=>"\u0644",
- "\uFEE0"=>"\u0644", "\uFEE1"=>"\u0645", "\uFEE2"=>"\u0645", "\uFEE3"=>"\u0645", "\uFEE4"=>"\u0645", "\uFEE5"=>"\u0646", "\uFEE6"=>"\u0646", "\uFEE7"=>"\u0646",
- "\uFEE8"=>"\u0646", "\uFEE9"=>"\u0647", "\uFEEA"=>"\u0647", "\uFEEB"=>"\u0647", "\uFEEC"=>"\u0647", "\uFEED"=>"\u0648", "\uFEEE"=>"\u0648", "\uFEEF"=>"\u0649",
- "\uFEF0"=>"\u0649", "\uFEF1"=>"\u064A", "\uFEF2"=>"\u064A", "\uFEF3"=>"\u064A", "\uFEF4"=>"\u064A", "\uFEF5"=>"\u0644\u0622", "\uFEF6"=>"\u0644\u0622", "\uFEF7"=>"\u0644\u0623",
- "\uFEF8"=>"\u0644\u0623", "\uFEF9"=>"\u0644\u0625", "\uFEFA"=>"\u0644\u0625", "\uFEFB"=>"\u0644\u0627", "\uFEFC"=>"\u0644\u0627", "\uFF01"=>"!", "\uFF02"=>"\"", "\uFF03"=>"#",
- "\uFF04"=>"$", "\uFF05"=>"%", "\uFF06"=>"&", "\uFF07"=>"'", "\uFF08"=>"(", "\uFF09"=>")", "\uFF0A"=>"*", "\uFF0B"=>"+",
- "\uFF0C"=>",", "\uFF0D"=>"-", "\uFF0E"=>".", "\uFF0F"=>"/", "\uFF10"=>"0", "\uFF11"=>"1", "\uFF12"=>"2", "\uFF13"=>"3",
- "\uFF14"=>"4", "\uFF15"=>"5", "\uFF16"=>"6", "\uFF17"=>"7", "\uFF18"=>"8", "\uFF19"=>"9", "\uFF1A"=>":", "\uFF1B"=>";",
- "\uFF1C"=>"<", "\uFF1D"=>"=", "\uFF1E"=>">", "\uFF1F"=>"?", "\uFF20"=>"@", "\uFF21"=>"A", "\uFF22"=>"B", "\uFF23"=>"C",
- "\uFF24"=>"D", "\uFF25"=>"E", "\uFF26"=>"F", "\uFF27"=>"G", "\uFF28"=>"H", "\uFF29"=>"I", "\uFF2A"=>"J", "\uFF2B"=>"K",
- "\uFF2C"=>"L", "\uFF2D"=>"M", "\uFF2E"=>"N", "\uFF2F"=>"O", "\uFF30"=>"P", "\uFF31"=>"Q", "\uFF32"=>"R", "\uFF33"=>"S",
- "\uFF34"=>"T", "\uFF35"=>"U", "\uFF36"=>"V", "\uFF37"=>"W", "\uFF38"=>"X", "\uFF39"=>"Y", "\uFF3A"=>"Z", "\uFF3B"=>"[",
- "\uFF3C"=>"\\", "\uFF3D"=>"]", "\uFF3E"=>"^", "\uFF3F"=>"_", "\uFF40"=>"`", "\uFF41"=>"a", "\uFF42"=>"b", "\uFF43"=>"c",
- "\uFF44"=>"d", "\uFF45"=>"e", "\uFF46"=>"f", "\uFF47"=>"g", "\uFF48"=>"h", "\uFF49"=>"i", "\uFF4A"=>"j", "\uFF4B"=>"k",
- "\uFF4C"=>"l", "\uFF4D"=>"m", "\uFF4E"=>"n", "\uFF4F"=>"o", "\uFF50"=>"p", "\uFF51"=>"q", "\uFF52"=>"r", "\uFF53"=>"s",
- "\uFF54"=>"t", "\uFF55"=>"u", "\uFF56"=>"v", "\uFF57"=>"w", "\uFF58"=>"x", "\uFF59"=>"y", "\uFF5A"=>"z", "\uFF5B"=>"{",
- "\uFF5C"=>"|", "\uFF5D"=>"}", "\uFF5E"=>"~", "\uFF5F"=>"\u2985", "\uFF60"=>"\u2986", "\uFF61"=>"\u3002", "\uFF62"=>"\u300C", "\uFF63"=>"\u300D",
- "\uFF64"=>"\u3001", "\uFF65"=>"\u30FB", "\uFF66"=>"\u30F2", "\uFF67"=>"\u30A1", "\uFF68"=>"\u30A3", "\uFF69"=>"\u30A5", "\uFF6A"=>"\u30A7", "\uFF6B"=>"\u30A9",
- "\uFF6C"=>"\u30E3", "\uFF6D"=>"\u30E5", "\uFF6E"=>"\u30E7", "\uFF6F"=>"\u30C3", "\uFF70"=>"\u30FC", "\uFF71"=>"\u30A2", "\uFF72"=>"\u30A4", "\uFF73"=>"\u30A6",
- "\uFF74"=>"\u30A8", "\uFF75"=>"\u30AA", "\uFF76"=>"\u30AB", "\uFF77"=>"\u30AD", "\uFF78"=>"\u30AF", "\uFF79"=>"\u30B1", "\uFF7A"=>"\u30B3", "\uFF7B"=>"\u30B5",
- "\uFF7C"=>"\u30B7", "\uFF7D"=>"\u30B9", "\uFF7E"=>"\u30BB", "\uFF7F"=>"\u30BD", "\uFF80"=>"\u30BF", "\uFF81"=>"\u30C1", "\uFF82"=>"\u30C4", "\uFF83"=>"\u30C6",
- "\uFF84"=>"\u30C8", "\uFF85"=>"\u30CA", "\uFF86"=>"\u30CB", "\uFF87"=>"\u30CC", "\uFF88"=>"\u30CD", "\uFF89"=>"\u30CE", "\uFF8A"=>"\u30CF", "\uFF8B"=>"\u30D2",
- "\uFF8C"=>"\u30D5", "\uFF8D"=>"\u30D8", "\uFF8E"=>"\u30DB", "\uFF8F"=>"\u30DE", "\uFF90"=>"\u30DF", "\uFF91"=>"\u30E0", "\uFF92"=>"\u30E1", "\uFF93"=>"\u30E2",
- "\uFF94"=>"\u30E4", "\uFF95"=>"\u30E6", "\uFF96"=>"\u30E8", "\uFF97"=>"\u30E9", "\uFF98"=>"\u30EA", "\uFF99"=>"\u30EB", "\uFF9A"=>"\u30EC", "\uFF9B"=>"\u30ED",
- "\uFF9C"=>"\u30EF", "\uFF9D"=>"\u30F3", "\uFF9E"=>"\u3099", "\uFF9F"=>"\u309A", "\uFFA0"=>"\u1160", "\uFFA1"=>"\u1100", "\uFFA2"=>"\u1101", "\uFFA3"=>"\u11AA",
- "\uFFA4"=>"\u1102", "\uFFA5"=>"\u11AC", "\uFFA6"=>"\u11AD", "\uFFA7"=>"\u1103", "\uFFA8"=>"\u1104", "\uFFA9"=>"\u1105", "\uFFAA"=>"\u11B0", "\uFFAB"=>"\u11B1",
- "\uFFAC"=>"\u11B2", "\uFFAD"=>"\u11B3", "\uFFAE"=>"\u11B4", "\uFFAF"=>"\u11B5", "\uFFB0"=>"\u111A", "\uFFB1"=>"\u1106", "\uFFB2"=>"\u1107", "\uFFB3"=>"\u1108",
- "\uFFB4"=>"\u1121", "\uFFB5"=>"\u1109", "\uFFB6"=>"\u110A", "\uFFB7"=>"\u110B", "\uFFB8"=>"\u110C", "\uFFB9"=>"\u110D", "\uFFBA"=>"\u110E", "\uFFBB"=>"\u110F",
- "\uFFBC"=>"\u1110", "\uFFBD"=>"\u1111", "\uFFBE"=>"\u1112", "\uFFC2"=>"\u1161", "\uFFC3"=>"\u1162", "\uFFC4"=>"\u1163", "\uFFC5"=>"\u1164", "\uFFC6"=>"\u1165",
- "\uFFC7"=>"\u1166", "\uFFCA"=>"\u1167", "\uFFCB"=>"\u1168", "\uFFCC"=>"\u1169", "\uFFCD"=>"\u116A", "\uFFCE"=>"\u116B", "\uFFCF"=>"\u116C", "\uFFD2"=>"\u116D",
- "\uFFD3"=>"\u116E", "\uFFD4"=>"\u116F", "\uFFD5"=>"\u1170", "\uFFD6"=>"\u1171", "\uFFD7"=>"\u1172", "\uFFDA"=>"\u1173", "\uFFDB"=>"\u1174", "\uFFDC"=>"\u1175",
- "\uFFE0"=>"\u00A2", "\uFFE1"=>"\u00A3", "\uFFE2"=>"\u00AC", "\uFFE3"=>" \u0304", "\uFFE4"=>"\u00A6", "\uFFE5"=>"\u00A5", "\uFFE6"=>"\u20A9", "\uFFE8"=>"\u2502",
- "\uFFE9"=>"\u2190", "\uFFEA"=>"\u2191", "\uFFEB"=>"\u2192", "\uFFEC"=>"\u2193", "\uFFED"=>"\u25A0", "\uFFEE"=>"\u25CB", "\u{1D400}"=>"A", "\u{1D401}"=>"B",
- "\u{1D402}"=>"C", "\u{1D403}"=>"D", "\u{1D404}"=>"E", "\u{1D405}"=>"F", "\u{1D406}"=>"G", "\u{1D407}"=>"H", "\u{1D408}"=>"I", "\u{1D409}"=>"J",
- "\u{1D40A}"=>"K", "\u{1D40B}"=>"L", "\u{1D40C}"=>"M", "\u{1D40D}"=>"N", "\u{1D40E}"=>"O", "\u{1D40F}"=>"P", "\u{1D410}"=>"Q", "\u{1D411}"=>"R",
- "\u{1D412}"=>"S", "\u{1D413}"=>"T", "\u{1D414}"=>"U", "\u{1D415}"=>"V", "\u{1D416}"=>"W", "\u{1D417}"=>"X", "\u{1D418}"=>"Y", "\u{1D419}"=>"Z",
- "\u{1D41A}"=>"a", "\u{1D41B}"=>"b", "\u{1D41C}"=>"c", "\u{1D41D}"=>"d", "\u{1D41E}"=>"e", "\u{1D41F}"=>"f", "\u{1D420}"=>"g", "\u{1D421}"=>"h",
- "\u{1D422}"=>"i", "\u{1D423}"=>"j", "\u{1D424}"=>"k", "\u{1D425}"=>"l", "\u{1D426}"=>"m", "\u{1D427}"=>"n", "\u{1D428}"=>"o", "\u{1D429}"=>"p",
- "\u{1D42A}"=>"q", "\u{1D42B}"=>"r", "\u{1D42C}"=>"s", "\u{1D42D}"=>"t", "\u{1D42E}"=>"u", "\u{1D42F}"=>"v", "\u{1D430}"=>"w", "\u{1D431}"=>"x",
- "\u{1D432}"=>"y", "\u{1D433}"=>"z", "\u{1D434}"=>"A", "\u{1D435}"=>"B", "\u{1D436}"=>"C", "\u{1D437}"=>"D", "\u{1D438}"=>"E", "\u{1D439}"=>"F",
- "\u{1D43A}"=>"G", "\u{1D43B}"=>"H", "\u{1D43C}"=>"I", "\u{1D43D}"=>"J", "\u{1D43E}"=>"K", "\u{1D43F}"=>"L", "\u{1D440}"=>"M", "\u{1D441}"=>"N",
- "\u{1D442}"=>"O", "\u{1D443}"=>"P", "\u{1D444}"=>"Q", "\u{1D445}"=>"R", "\u{1D446}"=>"S", "\u{1D447}"=>"T", "\u{1D448}"=>"U", "\u{1D449}"=>"V",
- "\u{1D44A}"=>"W", "\u{1D44B}"=>"X", "\u{1D44C}"=>"Y", "\u{1D44D}"=>"Z", "\u{1D44E}"=>"a", "\u{1D44F}"=>"b", "\u{1D450}"=>"c", "\u{1D451}"=>"d",
- "\u{1D452}"=>"e", "\u{1D453}"=>"f", "\u{1D454}"=>"g", "\u{1D456}"=>"i", "\u{1D457}"=>"j", "\u{1D458}"=>"k", "\u{1D459}"=>"l", "\u{1D45A}"=>"m",
- "\u{1D45B}"=>"n", "\u{1D45C}"=>"o", "\u{1D45D}"=>"p", "\u{1D45E}"=>"q", "\u{1D45F}"=>"r", "\u{1D460}"=>"s", "\u{1D461}"=>"t", "\u{1D462}"=>"u",
- "\u{1D463}"=>"v", "\u{1D464}"=>"w", "\u{1D465}"=>"x", "\u{1D466}"=>"y", "\u{1D467}"=>"z", "\u{1D468}"=>"A", "\u{1D469}"=>"B", "\u{1D46A}"=>"C",
- "\u{1D46B}"=>"D", "\u{1D46C}"=>"E", "\u{1D46D}"=>"F", "\u{1D46E}"=>"G", "\u{1D46F}"=>"H", "\u{1D470}"=>"I", "\u{1D471}"=>"J", "\u{1D472}"=>"K",
- "\u{1D473}"=>"L", "\u{1D474}"=>"M", "\u{1D475}"=>"N", "\u{1D476}"=>"O", "\u{1D477}"=>"P", "\u{1D478}"=>"Q", "\u{1D479}"=>"R", "\u{1D47A}"=>"S",
- "\u{1D47B}"=>"T", "\u{1D47C}"=>"U", "\u{1D47D}"=>"V", "\u{1D47E}"=>"W", "\u{1D47F}"=>"X", "\u{1D480}"=>"Y", "\u{1D481}"=>"Z", "\u{1D482}"=>"a",
- "\u{1D483}"=>"b", "\u{1D484}"=>"c", "\u{1D485}"=>"d", "\u{1D486}"=>"e", "\u{1D487}"=>"f", "\u{1D488}"=>"g", "\u{1D489}"=>"h", "\u{1D48A}"=>"i",
- "\u{1D48B}"=>"j", "\u{1D48C}"=>"k", "\u{1D48D}"=>"l", "\u{1D48E}"=>"m", "\u{1D48F}"=>"n", "\u{1D490}"=>"o", "\u{1D491}"=>"p", "\u{1D492}"=>"q",
- "\u{1D493}"=>"r", "\u{1D494}"=>"s", "\u{1D495}"=>"t", "\u{1D496}"=>"u", "\u{1D497}"=>"v", "\u{1D498}"=>"w", "\u{1D499}"=>"x", "\u{1D49A}"=>"y",
- "\u{1D49B}"=>"z", "\u{1D49C}"=>"A", "\u{1D49E}"=>"C", "\u{1D49F}"=>"D", "\u{1D4A2}"=>"G", "\u{1D4A5}"=>"J", "\u{1D4A6}"=>"K", "\u{1D4A9}"=>"N",
- "\u{1D4AA}"=>"O", "\u{1D4AB}"=>"P", "\u{1D4AC}"=>"Q", "\u{1D4AE}"=>"S", "\u{1D4AF}"=>"T", "\u{1D4B0}"=>"U", "\u{1D4B1}"=>"V", "\u{1D4B2}"=>"W",
- "\u{1D4B3}"=>"X", "\u{1D4B4}"=>"Y", "\u{1D4B5}"=>"Z", "\u{1D4B6}"=>"a", "\u{1D4B7}"=>"b", "\u{1D4B8}"=>"c", "\u{1D4B9}"=>"d", "\u{1D4BB}"=>"f",
- "\u{1D4BD}"=>"h", "\u{1D4BE}"=>"i", "\u{1D4BF}"=>"j", "\u{1D4C0}"=>"k", "\u{1D4C1}"=>"l", "\u{1D4C2}"=>"m", "\u{1D4C3}"=>"n", "\u{1D4C5}"=>"p",
- "\u{1D4C6}"=>"q", "\u{1D4C7}"=>"r", "\u{1D4C8}"=>"s", "\u{1D4C9}"=>"t", "\u{1D4CA}"=>"u", "\u{1D4CB}"=>"v", "\u{1D4CC}"=>"w", "\u{1D4CD}"=>"x",
- "\u{1D4CE}"=>"y", "\u{1D4CF}"=>"z", "\u{1D4D0}"=>"A", "\u{1D4D1}"=>"B", "\u{1D4D2}"=>"C", "\u{1D4D3}"=>"D", "\u{1D4D4}"=>"E", "\u{1D4D5}"=>"F",
- "\u{1D4D6}"=>"G", "\u{1D4D7}"=>"H", "\u{1D4D8}"=>"I", "\u{1D4D9}"=>"J", "\u{1D4DA}"=>"K", "\u{1D4DB}"=>"L", "\u{1D4DC}"=>"M", "\u{1D4DD}"=>"N",
- "\u{1D4DE}"=>"O", "\u{1D4DF}"=>"P", "\u{1D4E0}"=>"Q", "\u{1D4E1}"=>"R", "\u{1D4E2}"=>"S", "\u{1D4E3}"=>"T", "\u{1D4E4}"=>"U", "\u{1D4E5}"=>"V",
- "\u{1D4E6}"=>"W", "\u{1D4E7}"=>"X", "\u{1D4E8}"=>"Y", "\u{1D4E9}"=>"Z", "\u{1D4EA}"=>"a", "\u{1D4EB}"=>"b", "\u{1D4EC}"=>"c", "\u{1D4ED}"=>"d",
- "\u{1D4EE}"=>"e", "\u{1D4EF}"=>"f", "\u{1D4F0}"=>"g", "\u{1D4F1}"=>"h", "\u{1D4F2}"=>"i", "\u{1D4F3}"=>"j", "\u{1D4F4}"=>"k", "\u{1D4F5}"=>"l",
- "\u{1D4F6}"=>"m", "\u{1D4F7}"=>"n", "\u{1D4F8}"=>"o", "\u{1D4F9}"=>"p", "\u{1D4FA}"=>"q", "\u{1D4FB}"=>"r", "\u{1D4FC}"=>"s", "\u{1D4FD}"=>"t",
- "\u{1D4FE}"=>"u", "\u{1D4FF}"=>"v", "\u{1D500}"=>"w", "\u{1D501}"=>"x", "\u{1D502}"=>"y", "\u{1D503}"=>"z", "\u{1D504}"=>"A", "\u{1D505}"=>"B",
- "\u{1D507}"=>"D", "\u{1D508}"=>"E", "\u{1D509}"=>"F", "\u{1D50A}"=>"G", "\u{1D50D}"=>"J", "\u{1D50E}"=>"K", "\u{1D50F}"=>"L", "\u{1D510}"=>"M",
- "\u{1D511}"=>"N", "\u{1D512}"=>"O", "\u{1D513}"=>"P", "\u{1D514}"=>"Q", "\u{1D516}"=>"S", "\u{1D517}"=>"T", "\u{1D518}"=>"U", "\u{1D519}"=>"V",
- "\u{1D51A}"=>"W", "\u{1D51B}"=>"X", "\u{1D51C}"=>"Y", "\u{1D51E}"=>"a", "\u{1D51F}"=>"b", "\u{1D520}"=>"c", "\u{1D521}"=>"d", "\u{1D522}"=>"e",
- "\u{1D523}"=>"f", "\u{1D524}"=>"g", "\u{1D525}"=>"h", "\u{1D526}"=>"i", "\u{1D527}"=>"j", "\u{1D528}"=>"k", "\u{1D529}"=>"l", "\u{1D52A}"=>"m",
- "\u{1D52B}"=>"n", "\u{1D52C}"=>"o", "\u{1D52D}"=>"p", "\u{1D52E}"=>"q", "\u{1D52F}"=>"r", "\u{1D530}"=>"s", "\u{1D531}"=>"t", "\u{1D532}"=>"u",
- "\u{1D533}"=>"v", "\u{1D534}"=>"w", "\u{1D535}"=>"x", "\u{1D536}"=>"y", "\u{1D537}"=>"z", "\u{1D538}"=>"A", "\u{1D539}"=>"B", "\u{1D53B}"=>"D",
- "\u{1D53C}"=>"E", "\u{1D53D}"=>"F", "\u{1D53E}"=>"G", "\u{1D540}"=>"I", "\u{1D541}"=>"J", "\u{1D542}"=>"K", "\u{1D543}"=>"L", "\u{1D544}"=>"M",
- "\u{1D546}"=>"O", "\u{1D54A}"=>"S", "\u{1D54B}"=>"T", "\u{1D54C}"=>"U", "\u{1D54D}"=>"V", "\u{1D54E}"=>"W", "\u{1D54F}"=>"X", "\u{1D550}"=>"Y",
- "\u{1D552}"=>"a", "\u{1D553}"=>"b", "\u{1D554}"=>"c", "\u{1D555}"=>"d", "\u{1D556}"=>"e", "\u{1D557}"=>"f", "\u{1D558}"=>"g", "\u{1D559}"=>"h",
- "\u{1D55A}"=>"i", "\u{1D55B}"=>"j", "\u{1D55C}"=>"k", "\u{1D55D}"=>"l", "\u{1D55E}"=>"m", "\u{1D55F}"=>"n", "\u{1D560}"=>"o", "\u{1D561}"=>"p",
- "\u{1D562}"=>"q", "\u{1D563}"=>"r", "\u{1D564}"=>"s", "\u{1D565}"=>"t", "\u{1D566}"=>"u", "\u{1D567}"=>"v", "\u{1D568}"=>"w", "\u{1D569}"=>"x",
- "\u{1D56A}"=>"y", "\u{1D56B}"=>"z", "\u{1D56C}"=>"A", "\u{1D56D}"=>"B", "\u{1D56E}"=>"C", "\u{1D56F}"=>"D", "\u{1D570}"=>"E", "\u{1D571}"=>"F",
- "\u{1D572}"=>"G", "\u{1D573}"=>"H", "\u{1D574}"=>"I", "\u{1D575}"=>"J", "\u{1D576}"=>"K", "\u{1D577}"=>"L", "\u{1D578}"=>"M", "\u{1D579}"=>"N",
- "\u{1D57A}"=>"O", "\u{1D57B}"=>"P", "\u{1D57C}"=>"Q", "\u{1D57D}"=>"R", "\u{1D57E}"=>"S", "\u{1D57F}"=>"T", "\u{1D580}"=>"U", "\u{1D581}"=>"V",
- "\u{1D582}"=>"W", "\u{1D583}"=>"X", "\u{1D584}"=>"Y", "\u{1D585}"=>"Z", "\u{1D586}"=>"a", "\u{1D587}"=>"b", "\u{1D588}"=>"c", "\u{1D589}"=>"d",
- "\u{1D58A}"=>"e", "\u{1D58B}"=>"f", "\u{1D58C}"=>"g", "\u{1D58D}"=>"h", "\u{1D58E}"=>"i", "\u{1D58F}"=>"j", "\u{1D590}"=>"k", "\u{1D591}"=>"l",
- "\u{1D592}"=>"m", "\u{1D593}"=>"n", "\u{1D594}"=>"o", "\u{1D595}"=>"p", "\u{1D596}"=>"q", "\u{1D597}"=>"r", "\u{1D598}"=>"s", "\u{1D599}"=>"t",
- "\u{1D59A}"=>"u", "\u{1D59B}"=>"v", "\u{1D59C}"=>"w", "\u{1D59D}"=>"x", "\u{1D59E}"=>"y", "\u{1D59F}"=>"z", "\u{1D5A0}"=>"A", "\u{1D5A1}"=>"B",
- "\u{1D5A2}"=>"C", "\u{1D5A3}"=>"D", "\u{1D5A4}"=>"E", "\u{1D5A5}"=>"F", "\u{1D5A6}"=>"G", "\u{1D5A7}"=>"H", "\u{1D5A8}"=>"I", "\u{1D5A9}"=>"J",
- "\u{1D5AA}"=>"K", "\u{1D5AB}"=>"L", "\u{1D5AC}"=>"M", "\u{1D5AD}"=>"N", "\u{1D5AE}"=>"O", "\u{1D5AF}"=>"P", "\u{1D5B0}"=>"Q", "\u{1D5B1}"=>"R",
- "\u{1D5B2}"=>"S", "\u{1D5B3}"=>"T", "\u{1D5B4}"=>"U", "\u{1D5B5}"=>"V", "\u{1D5B6}"=>"W", "\u{1D5B7}"=>"X", "\u{1D5B8}"=>"Y", "\u{1D5B9}"=>"Z",
- "\u{1D5BA}"=>"a", "\u{1D5BB}"=>"b", "\u{1D5BC}"=>"c", "\u{1D5BD}"=>"d", "\u{1D5BE}"=>"e", "\u{1D5BF}"=>"f", "\u{1D5C0}"=>"g", "\u{1D5C1}"=>"h",
- "\u{1D5C2}"=>"i", "\u{1D5C3}"=>"j", "\u{1D5C4}"=>"k", "\u{1D5C5}"=>"l", "\u{1D5C6}"=>"m", "\u{1D5C7}"=>"n", "\u{1D5C8}"=>"o", "\u{1D5C9}"=>"p",
- "\u{1D5CA}"=>"q", "\u{1D5CB}"=>"r", "\u{1D5CC}"=>"s", "\u{1D5CD}"=>"t", "\u{1D5CE}"=>"u", "\u{1D5CF}"=>"v", "\u{1D5D0}"=>"w", "\u{1D5D1}"=>"x",
- "\u{1D5D2}"=>"y", "\u{1D5D3}"=>"z", "\u{1D5D4}"=>"A", "\u{1D5D5}"=>"B", "\u{1D5D6}"=>"C", "\u{1D5D7}"=>"D", "\u{1D5D8}"=>"E", "\u{1D5D9}"=>"F",
- "\u{1D5DA}"=>"G", "\u{1D5DB}"=>"H", "\u{1D5DC}"=>"I", "\u{1D5DD}"=>"J", "\u{1D5DE}"=>"K", "\u{1D5DF}"=>"L", "\u{1D5E0}"=>"M", "\u{1D5E1}"=>"N",
- "\u{1D5E2}"=>"O", "\u{1D5E3}"=>"P", "\u{1D5E4}"=>"Q", "\u{1D5E5}"=>"R", "\u{1D5E6}"=>"S", "\u{1D5E7}"=>"T", "\u{1D5E8}"=>"U", "\u{1D5E9}"=>"V",
- "\u{1D5EA}"=>"W", "\u{1D5EB}"=>"X", "\u{1D5EC}"=>"Y", "\u{1D5ED}"=>"Z", "\u{1D5EE}"=>"a", "\u{1D5EF}"=>"b", "\u{1D5F0}"=>"c", "\u{1D5F1}"=>"d",
- "\u{1D5F2}"=>"e", "\u{1D5F3}"=>"f", "\u{1D5F4}"=>"g", "\u{1D5F5}"=>"h", "\u{1D5F6}"=>"i", "\u{1D5F7}"=>"j", "\u{1D5F8}"=>"k", "\u{1D5F9}"=>"l",
- "\u{1D5FA}"=>"m", "\u{1D5FB}"=>"n", "\u{1D5FC}"=>"o", "\u{1D5FD}"=>"p", "\u{1D5FE}"=>"q", "\u{1D5FF}"=>"r", "\u{1D600}"=>"s", "\u{1D601}"=>"t",
- "\u{1D602}"=>"u", "\u{1D603}"=>"v", "\u{1D604}"=>"w", "\u{1D605}"=>"x", "\u{1D606}"=>"y", "\u{1D607}"=>"z", "\u{1D608}"=>"A", "\u{1D609}"=>"B",
- "\u{1D60A}"=>"C", "\u{1D60B}"=>"D", "\u{1D60C}"=>"E", "\u{1D60D}"=>"F", "\u{1D60E}"=>"G", "\u{1D60F}"=>"H", "\u{1D610}"=>"I", "\u{1D611}"=>"J",
- "\u{1D612}"=>"K", "\u{1D613}"=>"L", "\u{1D614}"=>"M", "\u{1D615}"=>"N", "\u{1D616}"=>"O", "\u{1D617}"=>"P", "\u{1D618}"=>"Q", "\u{1D619}"=>"R",
- "\u{1D61A}"=>"S", "\u{1D61B}"=>"T", "\u{1D61C}"=>"U", "\u{1D61D}"=>"V", "\u{1D61E}"=>"W", "\u{1D61F}"=>"X", "\u{1D620}"=>"Y", "\u{1D621}"=>"Z",
- "\u{1D622}"=>"a", "\u{1D623}"=>"b", "\u{1D624}"=>"c", "\u{1D625}"=>"d", "\u{1D626}"=>"e", "\u{1D627}"=>"f", "\u{1D628}"=>"g", "\u{1D629}"=>"h",
- "\u{1D62A}"=>"i", "\u{1D62B}"=>"j", "\u{1D62C}"=>"k", "\u{1D62D}"=>"l", "\u{1D62E}"=>"m", "\u{1D62F}"=>"n", "\u{1D630}"=>"o", "\u{1D631}"=>"p",
- "\u{1D632}"=>"q", "\u{1D633}"=>"r", "\u{1D634}"=>"s", "\u{1D635}"=>"t", "\u{1D636}"=>"u", "\u{1D637}"=>"v", "\u{1D638}"=>"w", "\u{1D639}"=>"x",
- "\u{1D63A}"=>"y", "\u{1D63B}"=>"z", "\u{1D63C}"=>"A", "\u{1D63D}"=>"B", "\u{1D63E}"=>"C", "\u{1D63F}"=>"D", "\u{1D640}"=>"E", "\u{1D641}"=>"F",
- "\u{1D642}"=>"G", "\u{1D643}"=>"H", "\u{1D644}"=>"I", "\u{1D645}"=>"J", "\u{1D646}"=>"K", "\u{1D647}"=>"L", "\u{1D648}"=>"M", "\u{1D649}"=>"N",
- "\u{1D64A}"=>"O", "\u{1D64B}"=>"P", "\u{1D64C}"=>"Q", "\u{1D64D}"=>"R", "\u{1D64E}"=>"S", "\u{1D64F}"=>"T", "\u{1D650}"=>"U", "\u{1D651}"=>"V",
- "\u{1D652}"=>"W", "\u{1D653}"=>"X", "\u{1D654}"=>"Y", "\u{1D655}"=>"Z", "\u{1D656}"=>"a", "\u{1D657}"=>"b", "\u{1D658}"=>"c", "\u{1D659}"=>"d",
- "\u{1D65A}"=>"e", "\u{1D65B}"=>"f", "\u{1D65C}"=>"g", "\u{1D65D}"=>"h", "\u{1D65E}"=>"i", "\u{1D65F}"=>"j", "\u{1D660}"=>"k", "\u{1D661}"=>"l",
- "\u{1D662}"=>"m", "\u{1D663}"=>"n", "\u{1D664}"=>"o", "\u{1D665}"=>"p", "\u{1D666}"=>"q", "\u{1D667}"=>"r", "\u{1D668}"=>"s", "\u{1D669}"=>"t",
- "\u{1D66A}"=>"u", "\u{1D66B}"=>"v", "\u{1D66C}"=>"w", "\u{1D66D}"=>"x", "\u{1D66E}"=>"y", "\u{1D66F}"=>"z", "\u{1D670}"=>"A", "\u{1D671}"=>"B",
- "\u{1D672}"=>"C", "\u{1D673}"=>"D", "\u{1D674}"=>"E", "\u{1D675}"=>"F", "\u{1D676}"=>"G", "\u{1D677}"=>"H", "\u{1D678}"=>"I", "\u{1D679}"=>"J",
- "\u{1D67A}"=>"K", "\u{1D67B}"=>"L", "\u{1D67C}"=>"M", "\u{1D67D}"=>"N", "\u{1D67E}"=>"O", "\u{1D67F}"=>"P", "\u{1D680}"=>"Q", "\u{1D681}"=>"R",
- "\u{1D682}"=>"S", "\u{1D683}"=>"T", "\u{1D684}"=>"U", "\u{1D685}"=>"V", "\u{1D686}"=>"W", "\u{1D687}"=>"X", "\u{1D688}"=>"Y", "\u{1D689}"=>"Z",
- "\u{1D68A}"=>"a", "\u{1D68B}"=>"b", "\u{1D68C}"=>"c", "\u{1D68D}"=>"d", "\u{1D68E}"=>"e", "\u{1D68F}"=>"f", "\u{1D690}"=>"g", "\u{1D691}"=>"h",
- "\u{1D692}"=>"i", "\u{1D693}"=>"j", "\u{1D694}"=>"k", "\u{1D695}"=>"l", "\u{1D696}"=>"m", "\u{1D697}"=>"n", "\u{1D698}"=>"o", "\u{1D699}"=>"p",
- "\u{1D69A}"=>"q", "\u{1D69B}"=>"r", "\u{1D69C}"=>"s", "\u{1D69D}"=>"t", "\u{1D69E}"=>"u", "\u{1D69F}"=>"v", "\u{1D6A0}"=>"w", "\u{1D6A1}"=>"x",
- "\u{1D6A2}"=>"y", "\u{1D6A3}"=>"z", "\u{1D6A4}"=>"\u0131", "\u{1D6A5}"=>"\u0237", "\u{1D6A8}"=>"\u0391", "\u{1D6A9}"=>"\u0392", "\u{1D6AA}"=>"\u0393", "\u{1D6AB}"=>"\u0394",
- "\u{1D6AC}"=>"\u0395", "\u{1D6AD}"=>"\u0396", "\u{1D6AE}"=>"\u0397", "\u{1D6AF}"=>"\u0398", "\u{1D6B0}"=>"\u0399", "\u{1D6B1}"=>"\u039A", "\u{1D6B2}"=>"\u039B", "\u{1D6B3}"=>"\u039C",
- "\u{1D6B4}"=>"\u039D", "\u{1D6B5}"=>"\u039E", "\u{1D6B6}"=>"\u039F", "\u{1D6B7}"=>"\u03A0", "\u{1D6B8}"=>"\u03A1", "\u{1D6B9}"=>"\u0398", "\u{1D6BA}"=>"\u03A3", "\u{1D6BB}"=>"\u03A4",
- "\u{1D6BC}"=>"\u03A5", "\u{1D6BD}"=>"\u03A6", "\u{1D6BE}"=>"\u03A7", "\u{1D6BF}"=>"\u03A8", "\u{1D6C0}"=>"\u03A9", "\u{1D6C1}"=>"\u2207", "\u{1D6C2}"=>"\u03B1", "\u{1D6C3}"=>"\u03B2",
- "\u{1D6C4}"=>"\u03B3", "\u{1D6C5}"=>"\u03B4", "\u{1D6C6}"=>"\u03B5", "\u{1D6C7}"=>"\u03B6", "\u{1D6C8}"=>"\u03B7", "\u{1D6C9}"=>"\u03B8", "\u{1D6CA}"=>"\u03B9", "\u{1D6CB}"=>"\u03BA",
- "\u{1D6CC}"=>"\u03BB", "\u{1D6CD}"=>"\u03BC", "\u{1D6CE}"=>"\u03BD", "\u{1D6CF}"=>"\u03BE", "\u{1D6D0}"=>"\u03BF", "\u{1D6D1}"=>"\u03C0", "\u{1D6D2}"=>"\u03C1", "\u{1D6D3}"=>"\u03C2",
- "\u{1D6D4}"=>"\u03C3", "\u{1D6D5}"=>"\u03C4", "\u{1D6D6}"=>"\u03C5", "\u{1D6D7}"=>"\u03C6", "\u{1D6D8}"=>"\u03C7", "\u{1D6D9}"=>"\u03C8", "\u{1D6DA}"=>"\u03C9", "\u{1D6DB}"=>"\u2202",
- "\u{1D6DC}"=>"\u03B5", "\u{1D6DD}"=>"\u03B8", "\u{1D6DE}"=>"\u03BA", "\u{1D6DF}"=>"\u03C6", "\u{1D6E0}"=>"\u03C1", "\u{1D6E1}"=>"\u03C0", "\u{1D6E2}"=>"\u0391", "\u{1D6E3}"=>"\u0392",
- "\u{1D6E4}"=>"\u0393", "\u{1D6E5}"=>"\u0394", "\u{1D6E6}"=>"\u0395", "\u{1D6E7}"=>"\u0396", "\u{1D6E8}"=>"\u0397", "\u{1D6E9}"=>"\u0398", "\u{1D6EA}"=>"\u0399", "\u{1D6EB}"=>"\u039A",
- "\u{1D6EC}"=>"\u039B", "\u{1D6ED}"=>"\u039C", "\u{1D6EE}"=>"\u039D", "\u{1D6EF}"=>"\u039E", "\u{1D6F0}"=>"\u039F", "\u{1D6F1}"=>"\u03A0", "\u{1D6F2}"=>"\u03A1", "\u{1D6F3}"=>"\u0398",
- "\u{1D6F4}"=>"\u03A3", "\u{1D6F5}"=>"\u03A4", "\u{1D6F6}"=>"\u03A5", "\u{1D6F7}"=>"\u03A6", "\u{1D6F8}"=>"\u03A7", "\u{1D6F9}"=>"\u03A8", "\u{1D6FA}"=>"\u03A9", "\u{1D6FB}"=>"\u2207",
- "\u{1D6FC}"=>"\u03B1", "\u{1D6FD}"=>"\u03B2", "\u{1D6FE}"=>"\u03B3", "\u{1D6FF}"=>"\u03B4", "\u{1D700}"=>"\u03B5", "\u{1D701}"=>"\u03B6", "\u{1D702}"=>"\u03B7", "\u{1D703}"=>"\u03B8",
- "\u{1D704}"=>"\u03B9", "\u{1D705}"=>"\u03BA", "\u{1D706}"=>"\u03BB", "\u{1D707}"=>"\u03BC", "\u{1D708}"=>"\u03BD", "\u{1D709}"=>"\u03BE", "\u{1D70A}"=>"\u03BF", "\u{1D70B}"=>"\u03C0",
- "\u{1D70C}"=>"\u03C1", "\u{1D70D}"=>"\u03C2", "\u{1D70E}"=>"\u03C3", "\u{1D70F}"=>"\u03C4", "\u{1D710}"=>"\u03C5", "\u{1D711}"=>"\u03C6", "\u{1D712}"=>"\u03C7", "\u{1D713}"=>"\u03C8",
- "\u{1D714}"=>"\u03C9", "\u{1D715}"=>"\u2202", "\u{1D716}"=>"\u03B5", "\u{1D717}"=>"\u03B8", "\u{1D718}"=>"\u03BA", "\u{1D719}"=>"\u03C6", "\u{1D71A}"=>"\u03C1", "\u{1D71B}"=>"\u03C0",
- "\u{1D71C}"=>"\u0391", "\u{1D71D}"=>"\u0392", "\u{1D71E}"=>"\u0393", "\u{1D71F}"=>"\u0394", "\u{1D720}"=>"\u0395", "\u{1D721}"=>"\u0396", "\u{1D722}"=>"\u0397", "\u{1D723}"=>"\u0398",
- "\u{1D724}"=>"\u0399", "\u{1D725}"=>"\u039A", "\u{1D726}"=>"\u039B", "\u{1D727}"=>"\u039C", "\u{1D728}"=>"\u039D", "\u{1D729}"=>"\u039E", "\u{1D72A}"=>"\u039F", "\u{1D72B}"=>"\u03A0",
- "\u{1D72C}"=>"\u03A1", "\u{1D72D}"=>"\u0398", "\u{1D72E}"=>"\u03A3", "\u{1D72F}"=>"\u03A4", "\u{1D730}"=>"\u03A5", "\u{1D731}"=>"\u03A6", "\u{1D732}"=>"\u03A7", "\u{1D733}"=>"\u03A8",
- "\u{1D734}"=>"\u03A9", "\u{1D735}"=>"\u2207", "\u{1D736}"=>"\u03B1", "\u{1D737}"=>"\u03B2", "\u{1D738}"=>"\u03B3", "\u{1D739}"=>"\u03B4", "\u{1D73A}"=>"\u03B5", "\u{1D73B}"=>"\u03B6",
- "\u{1D73C}"=>"\u03B7", "\u{1D73D}"=>"\u03B8", "\u{1D73E}"=>"\u03B9", "\u{1D73F}"=>"\u03BA", "\u{1D740}"=>"\u03BB", "\u{1D741}"=>"\u03BC", "\u{1D742}"=>"\u03BD", "\u{1D743}"=>"\u03BE",
- "\u{1D744}"=>"\u03BF", "\u{1D745}"=>"\u03C0", "\u{1D746}"=>"\u03C1", "\u{1D747}"=>"\u03C2", "\u{1D748}"=>"\u03C3", "\u{1D749}"=>"\u03C4", "\u{1D74A}"=>"\u03C5", "\u{1D74B}"=>"\u03C6",
- "\u{1D74C}"=>"\u03C7", "\u{1D74D}"=>"\u03C8", "\u{1D74E}"=>"\u03C9", "\u{1D74F}"=>"\u2202", "\u{1D750}"=>"\u03B5", "\u{1D751}"=>"\u03B8", "\u{1D752}"=>"\u03BA", "\u{1D753}"=>"\u03C6",
- "\u{1D754}"=>"\u03C1", "\u{1D755}"=>"\u03C0", "\u{1D756}"=>"\u0391", "\u{1D757}"=>"\u0392", "\u{1D758}"=>"\u0393", "\u{1D759}"=>"\u0394", "\u{1D75A}"=>"\u0395", "\u{1D75B}"=>"\u0396",
- "\u{1D75C}"=>"\u0397", "\u{1D75D}"=>"\u0398", "\u{1D75E}"=>"\u0399", "\u{1D75F}"=>"\u039A", "\u{1D760}"=>"\u039B", "\u{1D761}"=>"\u039C", "\u{1D762}"=>"\u039D", "\u{1D763}"=>"\u039E",
- "\u{1D764}"=>"\u039F", "\u{1D765}"=>"\u03A0", "\u{1D766}"=>"\u03A1", "\u{1D767}"=>"\u0398", "\u{1D768}"=>"\u03A3", "\u{1D769}"=>"\u03A4", "\u{1D76A}"=>"\u03A5", "\u{1D76B}"=>"\u03A6",
- "\u{1D76C}"=>"\u03A7", "\u{1D76D}"=>"\u03A8", "\u{1D76E}"=>"\u03A9", "\u{1D76F}"=>"\u2207", "\u{1D770}"=>"\u03B1", "\u{1D771}"=>"\u03B2", "\u{1D772}"=>"\u03B3", "\u{1D773}"=>"\u03B4",
- "\u{1D774}"=>"\u03B5", "\u{1D775}"=>"\u03B6", "\u{1D776}"=>"\u03B7", "\u{1D777}"=>"\u03B8", "\u{1D778}"=>"\u03B9", "\u{1D779}"=>"\u03BA", "\u{1D77A}"=>"\u03BB", "\u{1D77B}"=>"\u03BC",
- "\u{1D77C}"=>"\u03BD", "\u{1D77D}"=>"\u03BE", "\u{1D77E}"=>"\u03BF", "\u{1D77F}"=>"\u03C0", "\u{1D780}"=>"\u03C1", "\u{1D781}"=>"\u03C2", "\u{1D782}"=>"\u03C3", "\u{1D783}"=>"\u03C4",
- "\u{1D784}"=>"\u03C5", "\u{1D785}"=>"\u03C6", "\u{1D786}"=>"\u03C7", "\u{1D787}"=>"\u03C8", "\u{1D788}"=>"\u03C9", "\u{1D789}"=>"\u2202", "\u{1D78A}"=>"\u03B5", "\u{1D78B}"=>"\u03B8",
- "\u{1D78C}"=>"\u03BA", "\u{1D78D}"=>"\u03C6", "\u{1D78E}"=>"\u03C1", "\u{1D78F}"=>"\u03C0", "\u{1D790}"=>"\u0391", "\u{1D791}"=>"\u0392", "\u{1D792}"=>"\u0393", "\u{1D793}"=>"\u0394",
- "\u{1D794}"=>"\u0395", "\u{1D795}"=>"\u0396", "\u{1D796}"=>"\u0397", "\u{1D797}"=>"\u0398", "\u{1D798}"=>"\u0399", "\u{1D799}"=>"\u039A", "\u{1D79A}"=>"\u039B", "\u{1D79B}"=>"\u039C",
- "\u{1D79C}"=>"\u039D", "\u{1D79D}"=>"\u039E", "\u{1D79E}"=>"\u039F", "\u{1D79F}"=>"\u03A0", "\u{1D7A0}"=>"\u03A1", "\u{1D7A1}"=>"\u0398", "\u{1D7A2}"=>"\u03A3", "\u{1D7A3}"=>"\u03A4",
- "\u{1D7A4}"=>"\u03A5", "\u{1D7A5}"=>"\u03A6", "\u{1D7A6}"=>"\u03A7", "\u{1D7A7}"=>"\u03A8", "\u{1D7A8}"=>"\u03A9", "\u{1D7A9}"=>"\u2207", "\u{1D7AA}"=>"\u03B1", "\u{1D7AB}"=>"\u03B2",
- "\u{1D7AC}"=>"\u03B3", "\u{1D7AD}"=>"\u03B4", "\u{1D7AE}"=>"\u03B5", "\u{1D7AF}"=>"\u03B6", "\u{1D7B0}"=>"\u03B7", "\u{1D7B1}"=>"\u03B8", "\u{1D7B2}"=>"\u03B9", "\u{1D7B3}"=>"\u03BA",
- "\u{1D7B4}"=>"\u03BB", "\u{1D7B5}"=>"\u03BC", "\u{1D7B6}"=>"\u03BD", "\u{1D7B7}"=>"\u03BE", "\u{1D7B8}"=>"\u03BF", "\u{1D7B9}"=>"\u03C0", "\u{1D7BA}"=>"\u03C1", "\u{1D7BB}"=>"\u03C2",
- "\u{1D7BC}"=>"\u03C3", "\u{1D7BD}"=>"\u03C4", "\u{1D7BE}"=>"\u03C5", "\u{1D7BF}"=>"\u03C6", "\u{1D7C0}"=>"\u03C7", "\u{1D7C1}"=>"\u03C8", "\u{1D7C2}"=>"\u03C9", "\u{1D7C3}"=>"\u2202",
- "\u{1D7C4}"=>"\u03B5", "\u{1D7C5}"=>"\u03B8", "\u{1D7C6}"=>"\u03BA", "\u{1D7C7}"=>"\u03C6", "\u{1D7C8}"=>"\u03C1", "\u{1D7C9}"=>"\u03C0", "\u{1D7CA}"=>"\u03DC", "\u{1D7CB}"=>"\u03DD",
- "\u{1D7CE}"=>"0", "\u{1D7CF}"=>"1", "\u{1D7D0}"=>"2", "\u{1D7D1}"=>"3", "\u{1D7D2}"=>"4", "\u{1D7D3}"=>"5", "\u{1D7D4}"=>"6", "\u{1D7D5}"=>"7",
- "\u{1D7D6}"=>"8", "\u{1D7D7}"=>"9", "\u{1D7D8}"=>"0", "\u{1D7D9}"=>"1", "\u{1D7DA}"=>"2", "\u{1D7DB}"=>"3", "\u{1D7DC}"=>"4", "\u{1D7DD}"=>"5",
- "\u{1D7DE}"=>"6", "\u{1D7DF}"=>"7", "\u{1D7E0}"=>"8", "\u{1D7E1}"=>"9", "\u{1D7E2}"=>"0", "\u{1D7E3}"=>"1", "\u{1D7E4}"=>"2", "\u{1D7E5}"=>"3",
- "\u{1D7E6}"=>"4", "\u{1D7E7}"=>"5", "\u{1D7E8}"=>"6", "\u{1D7E9}"=>"7", "\u{1D7EA}"=>"8", "\u{1D7EB}"=>"9", "\u{1D7EC}"=>"0", "\u{1D7ED}"=>"1",
- "\u{1D7EE}"=>"2", "\u{1D7EF}"=>"3", "\u{1D7F0}"=>"4", "\u{1D7F1}"=>"5", "\u{1D7F2}"=>"6", "\u{1D7F3}"=>"7", "\u{1D7F4}"=>"8", "\u{1D7F5}"=>"9",
- "\u{1D7F6}"=>"0", "\u{1D7F7}"=>"1", "\u{1D7F8}"=>"2", "\u{1D7F9}"=>"3", "\u{1D7FA}"=>"4", "\u{1D7FB}"=>"5", "\u{1D7FC}"=>"6", "\u{1D7FD}"=>"7",
- "\u{1D7FE}"=>"8", "\u{1D7FF}"=>"9", "\u{1EE00}"=>"\u0627", "\u{1EE01}"=>"\u0628", "\u{1EE02}"=>"\u062C", "\u{1EE03}"=>"\u062F", "\u{1EE05}"=>"\u0648", "\u{1EE06}"=>"\u0632",
- "\u{1EE07}"=>"\u062D", "\u{1EE08}"=>"\u0637", "\u{1EE09}"=>"\u064A", "\u{1EE0A}"=>"\u0643", "\u{1EE0B}"=>"\u0644", "\u{1EE0C}"=>"\u0645", "\u{1EE0D}"=>"\u0646", "\u{1EE0E}"=>"\u0633",
- "\u{1EE0F}"=>"\u0639", "\u{1EE10}"=>"\u0641", "\u{1EE11}"=>"\u0635", "\u{1EE12}"=>"\u0642", "\u{1EE13}"=>"\u0631", "\u{1EE14}"=>"\u0634", "\u{1EE15}"=>"\u062A", "\u{1EE16}"=>"\u062B",
- "\u{1EE17}"=>"\u062E", "\u{1EE18}"=>"\u0630", "\u{1EE19}"=>"\u0636", "\u{1EE1A}"=>"\u0638", "\u{1EE1B}"=>"\u063A", "\u{1EE1C}"=>"\u066E", "\u{1EE1D}"=>"\u06BA", "\u{1EE1E}"=>"\u06A1",
- "\u{1EE1F}"=>"\u066F", "\u{1EE21}"=>"\u0628", "\u{1EE22}"=>"\u062C", "\u{1EE24}"=>"\u0647", "\u{1EE27}"=>"\u062D", "\u{1EE29}"=>"\u064A", "\u{1EE2A}"=>"\u0643", "\u{1EE2B}"=>"\u0644",
- "\u{1EE2C}"=>"\u0645", "\u{1EE2D}"=>"\u0646", "\u{1EE2E}"=>"\u0633", "\u{1EE2F}"=>"\u0639", "\u{1EE30}"=>"\u0641", "\u{1EE31}"=>"\u0635", "\u{1EE32}"=>"\u0642", "\u{1EE34}"=>"\u0634",
- "\u{1EE35}"=>"\u062A", "\u{1EE36}"=>"\u062B", "\u{1EE37}"=>"\u062E", "\u{1EE39}"=>"\u0636", "\u{1EE3B}"=>"\u063A", "\u{1EE42}"=>"\u062C", "\u{1EE47}"=>"\u062D", "\u{1EE49}"=>"\u064A",
- "\u{1EE4B}"=>"\u0644", "\u{1EE4D}"=>"\u0646", "\u{1EE4E}"=>"\u0633", "\u{1EE4F}"=>"\u0639", "\u{1EE51}"=>"\u0635", "\u{1EE52}"=>"\u0642", "\u{1EE54}"=>"\u0634", "\u{1EE57}"=>"\u062E",
- "\u{1EE59}"=>"\u0636", "\u{1EE5B}"=>"\u063A", "\u{1EE5D}"=>"\u06BA", "\u{1EE5F}"=>"\u066F", "\u{1EE61}"=>"\u0628", "\u{1EE62}"=>"\u062C", "\u{1EE64}"=>"\u0647", "\u{1EE67}"=>"\u062D",
- "\u{1EE68}"=>"\u0637", "\u{1EE69}"=>"\u064A", "\u{1EE6A}"=>"\u0643", "\u{1EE6C}"=>"\u0645", "\u{1EE6D}"=>"\u0646", "\u{1EE6E}"=>"\u0633", "\u{1EE6F}"=>"\u0639", "\u{1EE70}"=>"\u0641",
- "\u{1EE71}"=>"\u0635", "\u{1EE72}"=>"\u0642", "\u{1EE74}"=>"\u0634", "\u{1EE75}"=>"\u062A", "\u{1EE76}"=>"\u062B", "\u{1EE77}"=>"\u062E", "\u{1EE79}"=>"\u0636", "\u{1EE7A}"=>"\u0638",
- "\u{1EE7B}"=>"\u063A", "\u{1EE7C}"=>"\u066E", "\u{1EE7E}"=>"\u06A1", "\u{1EE80}"=>"\u0627", "\u{1EE81}"=>"\u0628", "\u{1EE82}"=>"\u062C", "\u{1EE83}"=>"\u062F", "\u{1EE84}"=>"\u0647",
- "\u{1EE85}"=>"\u0648", "\u{1EE86}"=>"\u0632", "\u{1EE87}"=>"\u062D", "\u{1EE88}"=>"\u0637", "\u{1EE89}"=>"\u064A", "\u{1EE8B}"=>"\u0644", "\u{1EE8C}"=>"\u0645", "\u{1EE8D}"=>"\u0646",
- "\u{1EE8E}"=>"\u0633", "\u{1EE8F}"=>"\u0639", "\u{1EE90}"=>"\u0641", "\u{1EE91}"=>"\u0635", "\u{1EE92}"=>"\u0642", "\u{1EE93}"=>"\u0631", "\u{1EE94}"=>"\u0634", "\u{1EE95}"=>"\u062A",
- "\u{1EE96}"=>"\u062B", "\u{1EE97}"=>"\u062E", "\u{1EE98}"=>"\u0630", "\u{1EE99}"=>"\u0636", "\u{1EE9A}"=>"\u0638", "\u{1EE9B}"=>"\u063A", "\u{1EEA1}"=>"\u0628", "\u{1EEA2}"=>"\u062C",
- "\u{1EEA3}"=>"\u062F", "\u{1EEA5}"=>"\u0648", "\u{1EEA6}"=>"\u0632", "\u{1EEA7}"=>"\u062D", "\u{1EEA8}"=>"\u0637", "\u{1EEA9}"=>"\u064A", "\u{1EEAB}"=>"\u0644", "\u{1EEAC}"=>"\u0645",
- "\u{1EEAD}"=>"\u0646", "\u{1EEAE}"=>"\u0633", "\u{1EEAF}"=>"\u0639", "\u{1EEB0}"=>"\u0641", "\u{1EEB1}"=>"\u0635", "\u{1EEB2}"=>"\u0642", "\u{1EEB3}"=>"\u0631", "\u{1EEB4}"=>"\u0634",
- "\u{1EEB5}"=>"\u062A", "\u{1EEB6}"=>"\u062B", "\u{1EEB7}"=>"\u062E", "\u{1EEB8}"=>"\u0630", "\u{1EEB9}"=>"\u0636", "\u{1EEBA}"=>"\u0638", "\u{1EEBB}"=>"\u063A", "\u{1F100}"=>"0.",
- "\u{1F101}"=>"0,", "\u{1F102}"=>"1,", "\u{1F103}"=>"2,", "\u{1F104}"=>"3,", "\u{1F105}"=>"4,", "\u{1F106}"=>"5,", "\u{1F107}"=>"6,", "\u{1F108}"=>"7,",
- "\u{1F109}"=>"8,", "\u{1F10A}"=>"9,", "\u{1F110}"=>"(A)", "\u{1F111}"=>"(B)", "\u{1F112}"=>"(C)", "\u{1F113}"=>"(D)", "\u{1F114}"=>"(E)", "\u{1F115}"=>"(F)",
- "\u{1F116}"=>"(G)", "\u{1F117}"=>"(H)", "\u{1F118}"=>"(I)", "\u{1F119}"=>"(J)", "\u{1F11A}"=>"(K)", "\u{1F11B}"=>"(L)", "\u{1F11C}"=>"(M)", "\u{1F11D}"=>"(N)",
- "\u{1F11E}"=>"(O)", "\u{1F11F}"=>"(P)", "\u{1F120}"=>"(Q)", "\u{1F121}"=>"(R)", "\u{1F122}"=>"(S)", "\u{1F123}"=>"(T)", "\u{1F124}"=>"(U)", "\u{1F125}"=>"(V)",
- "\u{1F126}"=>"(W)", "\u{1F127}"=>"(X)", "\u{1F128}"=>"(Y)", "\u{1F129}"=>"(Z)", "\u{1F12A}"=>"\u3014S\u3015", "\u{1F12B}"=>"C", "\u{1F12C}"=>"R", "\u{1F12D}"=>"CD",
- "\u{1F12E}"=>"WZ", "\u{1F130}"=>"A", "\u{1F131}"=>"B", "\u{1F132}"=>"C", "\u{1F133}"=>"D", "\u{1F134}"=>"E", "\u{1F135}"=>"F", "\u{1F136}"=>"G",
- "\u{1F137}"=>"H", "\u{1F138}"=>"I", "\u{1F139}"=>"J", "\u{1F13A}"=>"K", "\u{1F13B}"=>"L", "\u{1F13C}"=>"M", "\u{1F13D}"=>"N", "\u{1F13E}"=>"O",
- "\u{1F13F}"=>"P", "\u{1F140}"=>"Q", "\u{1F141}"=>"R", "\u{1F142}"=>"S", "\u{1F143}"=>"T", "\u{1F144}"=>"U", "\u{1F145}"=>"V", "\u{1F146}"=>"W",
- "\u{1F147}"=>"X", "\u{1F148}"=>"Y", "\u{1F149}"=>"Z", "\u{1F14A}"=>"HV", "\u{1F14B}"=>"MV", "\u{1F14C}"=>"SD", "\u{1F14D}"=>"SS", "\u{1F14E}"=>"PPV",
- "\u{1F14F}"=>"WC", "\u{1F16A}"=>"MC", "\u{1F16B}"=>"MD", "\u{1F190}"=>"DJ", "\u{1F200}"=>"\u307B\u304B", "\u{1F201}"=>"\u30B3\u30B3", "\u{1F202}"=>"\u30B5", "\u{1F210}"=>"\u624B",
- "\u{1F211}"=>"\u5B57", "\u{1F212}"=>"\u53CC", "\u{1F213}"=>"\u30C7", "\u{1F214}"=>"\u4E8C", "\u{1F215}"=>"\u591A", "\u{1F216}"=>"\u89E3", "\u{1F217}"=>"\u5929", "\u{1F218}"=>"\u4EA4",
- "\u{1F219}"=>"\u6620", "\u{1F21A}"=>"\u7121", "\u{1F21B}"=>"\u6599", "\u{1F21C}"=>"\u524D", "\u{1F21D}"=>"\u5F8C", "\u{1F21E}"=>"\u518D", "\u{1F21F}"=>"\u65B0", "\u{1F220}"=>"\u521D",
- "\u{1F221}"=>"\u7D42", "\u{1F222}"=>"\u751F", "\u{1F223}"=>"\u8CA9", "\u{1F224}"=>"\u58F0", "\u{1F225}"=>"\u5439", "\u{1F226}"=>"\u6F14", "\u{1F227}"=>"\u6295", "\u{1F228}"=>"\u6355",
- "\u{1F229}"=>"\u4E00", "\u{1F22A}"=>"\u4E09", "\u{1F22B}"=>"\u904A", "\u{1F22C}"=>"\u5DE6", "\u{1F22D}"=>"\u4E2D", "\u{1F22E}"=>"\u53F3", "\u{1F22F}"=>"\u6307", "\u{1F230}"=>"\u8D70",
- "\u{1F231}"=>"\u6253", "\u{1F232}"=>"\u7981", "\u{1F233}"=>"\u7A7A", "\u{1F234}"=>"\u5408", "\u{1F235}"=>"\u6E80", "\u{1F236}"=>"\u6709", "\u{1F237}"=>"\u6708", "\u{1F238}"=>"\u7533",
- "\u{1F239}"=>"\u5272", "\u{1F23A}"=>"\u55B6", "\u{1F23B}"=>"\u914D", "\u{1F240}"=>"\u3014\u672C\u3015", "\u{1F241}"=>"\u3014\u4E09\u3015", "\u{1F242}"=>"\u3014\u4E8C\u3015", "\u{1F243}"=>"\u3014\u5B89\u3015", "\u{1F244}"=>"\u3014\u70B9\u3015",
- "\u{1F245}"=>"\u3014\u6253\u3015", "\u{1F246}"=>"\u3014\u76D7\u3015", "\u{1F247}"=>"\u3014\u52DD\u3015", "\u{1F248}"=>"\u3014\u6557\u3015", "\u{1F250}"=>"\u5F97", "\u{1F251}"=>"\u53EF", "\u0385"=>" \u0308\u0301", "\u03D3"=>"\u03A5\u0301",
- "\u03D4"=>"\u03A5\u0308", "\u1E9B"=>"s\u0307", "\u1FC1"=>" \u0308\u0342", "\u1FCD"=>" \u0313\u0300", "\u1FCE"=>" \u0313\u0301", "\u1FCF"=>" \u0313\u0342", "\u1FDD"=>" \u0314\u0300", "\u1FDE"=>" \u0314\u0301",
- "\u1FDF"=>" \u0314\u0342", "\u1FED"=>" \u0308\u0300", "\u1FEE"=>" \u0308\u0301", "\u1FFD"=>" \u0301", "\u2000"=>" ", "\u2001"=>" ",
- }.freeze
-
- COMPOSITION_TABLE = {
- "A\u0300"=>"\u00C0", "A\u0301"=>"\u00C1", "A\u0302"=>"\u00C2", "A\u0303"=>"\u00C3", "A\u0308"=>"\u00C4", "A\u030A"=>"\u00C5", "C\u0327"=>"\u00C7", "E\u0300"=>"\u00C8",
- "E\u0301"=>"\u00C9", "E\u0302"=>"\u00CA", "E\u0308"=>"\u00CB", "I\u0300"=>"\u00CC", "I\u0301"=>"\u00CD", "I\u0302"=>"\u00CE", "I\u0308"=>"\u00CF", "N\u0303"=>"\u00D1",
- "O\u0300"=>"\u00D2", "O\u0301"=>"\u00D3", "O\u0302"=>"\u00D4", "O\u0303"=>"\u00D5", "O\u0308"=>"\u00D6", "U\u0300"=>"\u00D9", "U\u0301"=>"\u00DA", "U\u0302"=>"\u00DB",
- "U\u0308"=>"\u00DC", "Y\u0301"=>"\u00DD", "a\u0300"=>"\u00E0", "a\u0301"=>"\u00E1", "a\u0302"=>"\u00E2", "a\u0303"=>"\u00E3", "a\u0308"=>"\u00E4", "a\u030A"=>"\u00E5",
- "c\u0327"=>"\u00E7", "e\u0300"=>"\u00E8", "e\u0301"=>"\u00E9", "e\u0302"=>"\u00EA", "e\u0308"=>"\u00EB", "i\u0300"=>"\u00EC", "i\u0301"=>"\u00ED", "i\u0302"=>"\u00EE",
- "i\u0308"=>"\u00EF", "n\u0303"=>"\u00F1", "o\u0300"=>"\u00F2", "o\u0301"=>"\u00F3", "o\u0302"=>"\u00F4", "o\u0303"=>"\u00F5", "o\u0308"=>"\u00F6", "u\u0300"=>"\u00F9",
- "u\u0301"=>"\u00FA", "u\u0302"=>"\u00FB", "u\u0308"=>"\u00FC", "y\u0301"=>"\u00FD", "y\u0308"=>"\u00FF", "A\u0304"=>"\u0100", "a\u0304"=>"\u0101", "A\u0306"=>"\u0102",
- "a\u0306"=>"\u0103", "A\u0328"=>"\u0104", "a\u0328"=>"\u0105", "C\u0301"=>"\u0106", "c\u0301"=>"\u0107", "C\u0302"=>"\u0108", "c\u0302"=>"\u0109", "C\u0307"=>"\u010A",
- "c\u0307"=>"\u010B", "C\u030C"=>"\u010C", "c\u030C"=>"\u010D", "D\u030C"=>"\u010E", "d\u030C"=>"\u010F", "E\u0304"=>"\u0112", "e\u0304"=>"\u0113", "E\u0306"=>"\u0114",
- "e\u0306"=>"\u0115", "E\u0307"=>"\u0116", "e\u0307"=>"\u0117", "E\u0328"=>"\u0118", "e\u0328"=>"\u0119", "E\u030C"=>"\u011A", "e\u030C"=>"\u011B", "G\u0302"=>"\u011C",
- "g\u0302"=>"\u011D", "G\u0306"=>"\u011E", "g\u0306"=>"\u011F", "G\u0307"=>"\u0120", "g\u0307"=>"\u0121", "G\u0327"=>"\u0122", "g\u0327"=>"\u0123", "H\u0302"=>"\u0124",
- "h\u0302"=>"\u0125", "I\u0303"=>"\u0128", "i\u0303"=>"\u0129", "I\u0304"=>"\u012A", "i\u0304"=>"\u012B", "I\u0306"=>"\u012C", "i\u0306"=>"\u012D", "I\u0328"=>"\u012E",
- "i\u0328"=>"\u012F", "I\u0307"=>"\u0130", "J\u0302"=>"\u0134", "j\u0302"=>"\u0135", "K\u0327"=>"\u0136", "k\u0327"=>"\u0137", "L\u0301"=>"\u0139", "l\u0301"=>"\u013A",
- "L\u0327"=>"\u013B", "l\u0327"=>"\u013C", "L\u030C"=>"\u013D", "l\u030C"=>"\u013E", "N\u0301"=>"\u0143", "n\u0301"=>"\u0144", "N\u0327"=>"\u0145", "n\u0327"=>"\u0146",
- "N\u030C"=>"\u0147", "n\u030C"=>"\u0148", "O\u0304"=>"\u014C", "o\u0304"=>"\u014D", "O\u0306"=>"\u014E", "o\u0306"=>"\u014F", "O\u030B"=>"\u0150", "o\u030B"=>"\u0151",
- "R\u0301"=>"\u0154", "r\u0301"=>"\u0155", "R\u0327"=>"\u0156", "r\u0327"=>"\u0157", "R\u030C"=>"\u0158", "r\u030C"=>"\u0159", "S\u0301"=>"\u015A", "s\u0301"=>"\u015B",
- "S\u0302"=>"\u015C", "s\u0302"=>"\u015D", "S\u0327"=>"\u015E", "s\u0327"=>"\u015F", "S\u030C"=>"\u0160", "s\u030C"=>"\u0161", "T\u0327"=>"\u0162", "t\u0327"=>"\u0163",
- "T\u030C"=>"\u0164", "t\u030C"=>"\u0165", "U\u0303"=>"\u0168", "u\u0303"=>"\u0169", "U\u0304"=>"\u016A", "u\u0304"=>"\u016B", "U\u0306"=>"\u016C", "u\u0306"=>"\u016D",
- "U\u030A"=>"\u016E", "u\u030A"=>"\u016F", "U\u030B"=>"\u0170", "u\u030B"=>"\u0171", "U\u0328"=>"\u0172", "u\u0328"=>"\u0173", "W\u0302"=>"\u0174", "w\u0302"=>"\u0175",
- "Y\u0302"=>"\u0176", "y\u0302"=>"\u0177", "Y\u0308"=>"\u0178", "Z\u0301"=>"\u0179", "z\u0301"=>"\u017A", "Z\u0307"=>"\u017B", "z\u0307"=>"\u017C", "Z\u030C"=>"\u017D",
- "z\u030C"=>"\u017E", "O\u031B"=>"\u01A0", "o\u031B"=>"\u01A1", "U\u031B"=>"\u01AF", "u\u031B"=>"\u01B0", "A\u030C"=>"\u01CD", "a\u030C"=>"\u01CE", "I\u030C"=>"\u01CF",
- "i\u030C"=>"\u01D0", "O\u030C"=>"\u01D1", "o\u030C"=>"\u01D2", "U\u030C"=>"\u01D3", "u\u030C"=>"\u01D4", "\u00DC\u0304"=>"\u01D5", "\u00FC\u0304"=>"\u01D6", "\u00DC\u0301"=>"\u01D7",
- "\u00FC\u0301"=>"\u01D8", "\u00DC\u030C"=>"\u01D9", "\u00FC\u030C"=>"\u01DA", "\u00DC\u0300"=>"\u01DB", "\u00FC\u0300"=>"\u01DC", "\u00C4\u0304"=>"\u01DE", "\u00E4\u0304"=>"\u01DF", "\u0226\u0304"=>"\u01E0",
- "\u0227\u0304"=>"\u01E1", "\u00C6\u0304"=>"\u01E2", "\u00E6\u0304"=>"\u01E3", "G\u030C"=>"\u01E6", "g\u030C"=>"\u01E7", "K\u030C"=>"\u01E8", "k\u030C"=>"\u01E9", "O\u0328"=>"\u01EA",
- "o\u0328"=>"\u01EB", "\u01EA\u0304"=>"\u01EC", "\u01EB\u0304"=>"\u01ED", "\u01B7\u030C"=>"\u01EE", "\u0292\u030C"=>"\u01EF", "j\u030C"=>"\u01F0", "G\u0301"=>"\u01F4", "g\u0301"=>"\u01F5",
- "N\u0300"=>"\u01F8", "n\u0300"=>"\u01F9", "\u00C5\u0301"=>"\u01FA", "\u00E5\u0301"=>"\u01FB", "\u00C6\u0301"=>"\u01FC", "\u00E6\u0301"=>"\u01FD", "\u00D8\u0301"=>"\u01FE", "\u00F8\u0301"=>"\u01FF",
- "A\u030F"=>"\u0200", "a\u030F"=>"\u0201", "A\u0311"=>"\u0202", "a\u0311"=>"\u0203", "E\u030F"=>"\u0204", "e\u030F"=>"\u0205", "E\u0311"=>"\u0206", "e\u0311"=>"\u0207",
- "I\u030F"=>"\u0208", "i\u030F"=>"\u0209", "I\u0311"=>"\u020A", "i\u0311"=>"\u020B", "O\u030F"=>"\u020C", "o\u030F"=>"\u020D", "O\u0311"=>"\u020E", "o\u0311"=>"\u020F",
- "R\u030F"=>"\u0210", "r\u030F"=>"\u0211", "R\u0311"=>"\u0212", "r\u0311"=>"\u0213", "U\u030F"=>"\u0214", "u\u030F"=>"\u0215", "U\u0311"=>"\u0216", "u\u0311"=>"\u0217",
- "S\u0326"=>"\u0218", "s\u0326"=>"\u0219", "T\u0326"=>"\u021A", "t\u0326"=>"\u021B", "H\u030C"=>"\u021E", "h\u030C"=>"\u021F", "A\u0307"=>"\u0226", "a\u0307"=>"\u0227",
- "E\u0327"=>"\u0228", "e\u0327"=>"\u0229", "\u00D6\u0304"=>"\u022A", "\u00F6\u0304"=>"\u022B", "\u00D5\u0304"=>"\u022C", "\u00F5\u0304"=>"\u022D", "O\u0307"=>"\u022E", "o\u0307"=>"\u022F",
- "\u022E\u0304"=>"\u0230", "\u022F\u0304"=>"\u0231", "Y\u0304"=>"\u0232", "y\u0304"=>"\u0233", "\u00A8\u0301"=>"\u0385", "\u0391\u0301"=>"\u0386", "\u0395\u0301"=>"\u0388", "\u0397\u0301"=>"\u0389",
- "\u0399\u0301"=>"\u038A", "\u039F\u0301"=>"\u038C", "\u03A5\u0301"=>"\u038E", "\u03A9\u0301"=>"\u038F", "\u03CA\u0301"=>"\u0390", "\u0399\u0308"=>"\u03AA", "\u03A5\u0308"=>"\u03AB", "\u03B1\u0301"=>"\u03AC",
- "\u03B5\u0301"=>"\u03AD", "\u03B7\u0301"=>"\u03AE", "\u03B9\u0301"=>"\u03AF", "\u03CB\u0301"=>"\u03B0", "\u03B9\u0308"=>"\u03CA", "\u03C5\u0308"=>"\u03CB", "\u03BF\u0301"=>"\u03CC", "\u03C5\u0301"=>"\u03CD",
- "\u03C9\u0301"=>"\u03CE", "\u03D2\u0301"=>"\u03D3", "\u03D2\u0308"=>"\u03D4", "\u0415\u0300"=>"\u0400", "\u0415\u0308"=>"\u0401", "\u0413\u0301"=>"\u0403", "\u0406\u0308"=>"\u0407", "\u041A\u0301"=>"\u040C",
- "\u0418\u0300"=>"\u040D", "\u0423\u0306"=>"\u040E", "\u0418\u0306"=>"\u0419", "\u0438\u0306"=>"\u0439", "\u0435\u0300"=>"\u0450", "\u0435\u0308"=>"\u0451", "\u0433\u0301"=>"\u0453", "\u0456\u0308"=>"\u0457",
- "\u043A\u0301"=>"\u045C", "\u0438\u0300"=>"\u045D", "\u0443\u0306"=>"\u045E", "\u0474\u030F"=>"\u0476", "\u0475\u030F"=>"\u0477", "\u0416\u0306"=>"\u04C1", "\u0436\u0306"=>"\u04C2", "\u0410\u0306"=>"\u04D0",
- "\u0430\u0306"=>"\u04D1", "\u0410\u0308"=>"\u04D2", "\u0430\u0308"=>"\u04D3", "\u0415\u0306"=>"\u04D6", "\u0435\u0306"=>"\u04D7", "\u04D8\u0308"=>"\u04DA", "\u04D9\u0308"=>"\u04DB", "\u0416\u0308"=>"\u04DC",
- "\u0436\u0308"=>"\u04DD", "\u0417\u0308"=>"\u04DE", "\u0437\u0308"=>"\u04DF", "\u0418\u0304"=>"\u04E2", "\u0438\u0304"=>"\u04E3", "\u0418\u0308"=>"\u04E4", "\u0438\u0308"=>"\u04E5", "\u041E\u0308"=>"\u04E6",
- "\u043E\u0308"=>"\u04E7", "\u04E8\u0308"=>"\u04EA", "\u04E9\u0308"=>"\u04EB", "\u042D\u0308"=>"\u04EC", "\u044D\u0308"=>"\u04ED", "\u0423\u0304"=>"\u04EE", "\u0443\u0304"=>"\u04EF", "\u0423\u0308"=>"\u04F0",
- "\u0443\u0308"=>"\u04F1", "\u0423\u030B"=>"\u04F2", "\u0443\u030B"=>"\u04F3", "\u0427\u0308"=>"\u04F4", "\u0447\u0308"=>"\u04F5", "\u042B\u0308"=>"\u04F8", "\u044B\u0308"=>"\u04F9", "\u0627\u0653"=>"\u0622",
- "\u0627\u0654"=>"\u0623", "\u0648\u0654"=>"\u0624", "\u0627\u0655"=>"\u0625", "\u064A\u0654"=>"\u0626", "\u06D5\u0654"=>"\u06C0", "\u06C1\u0654"=>"\u06C2", "\u06D2\u0654"=>"\u06D3", "\u0928\u093C"=>"\u0929",
- "\u0930\u093C"=>"\u0931", "\u0933\u093C"=>"\u0934", "\u09C7\u09BE"=>"\u09CB", "\u09C7\u09D7"=>"\u09CC", "\u0B47\u0B56"=>"\u0B48", "\u0B47\u0B3E"=>"\u0B4B", "\u0B47\u0B57"=>"\u0B4C", "\u0B92\u0BD7"=>"\u0B94",
- "\u0BC6\u0BBE"=>"\u0BCA", "\u0BC7\u0BBE"=>"\u0BCB", "\u0BC6\u0BD7"=>"\u0BCC", "\u0C46\u0C56"=>"\u0C48", "\u0CBF\u0CD5"=>"\u0CC0", "\u0CC6\u0CD5"=>"\u0CC7", "\u0CC6\u0CD6"=>"\u0CC8", "\u0CC6\u0CC2"=>"\u0CCA",
- "\u0CCA\u0CD5"=>"\u0CCB", "\u0D46\u0D3E"=>"\u0D4A", "\u0D47\u0D3E"=>"\u0D4B", "\u0D46\u0D57"=>"\u0D4C", "\u0DD9\u0DCA"=>"\u0DDA", "\u0DD9\u0DCF"=>"\u0DDC", "\u0DDC\u0DCA"=>"\u0DDD", "\u0DD9\u0DDF"=>"\u0DDE",
- "\u1025\u102E"=>"\u1026", "\u1B05\u1B35"=>"\u1B06", "\u1B07\u1B35"=>"\u1B08", "\u1B09\u1B35"=>"\u1B0A", "\u1B0B\u1B35"=>"\u1B0C", "\u1B0D\u1B35"=>"\u1B0E", "\u1B11\u1B35"=>"\u1B12", "\u1B3A\u1B35"=>"\u1B3B",
- "\u1B3C\u1B35"=>"\u1B3D", "\u1B3E\u1B35"=>"\u1B40", "\u1B3F\u1B35"=>"\u1B41", "\u1B42\u1B35"=>"\u1B43", "A\u0325"=>"\u1E00", "a\u0325"=>"\u1E01", "B\u0307"=>"\u1E02", "b\u0307"=>"\u1E03",
- "B\u0323"=>"\u1E04", "b\u0323"=>"\u1E05", "B\u0331"=>"\u1E06", "b\u0331"=>"\u1E07", "\u00C7\u0301"=>"\u1E08", "\u00E7\u0301"=>"\u1E09", "D\u0307"=>"\u1E0A", "d\u0307"=>"\u1E0B",
- "D\u0323"=>"\u1E0C", "d\u0323"=>"\u1E0D", "D\u0331"=>"\u1E0E", "d\u0331"=>"\u1E0F", "D\u0327"=>"\u1E10", "d\u0327"=>"\u1E11", "D\u032D"=>"\u1E12", "d\u032D"=>"\u1E13",
- "\u0112\u0300"=>"\u1E14", "\u0113\u0300"=>"\u1E15", "\u0112\u0301"=>"\u1E16", "\u0113\u0301"=>"\u1E17", "E\u032D"=>"\u1E18", "e\u032D"=>"\u1E19", "E\u0330"=>"\u1E1A", "e\u0330"=>"\u1E1B",
- "\u0228\u0306"=>"\u1E1C", "\u0229\u0306"=>"\u1E1D", "F\u0307"=>"\u1E1E", "f\u0307"=>"\u1E1F", "G\u0304"=>"\u1E20", "g\u0304"=>"\u1E21", "H\u0307"=>"\u1E22", "h\u0307"=>"\u1E23",
- "H\u0323"=>"\u1E24", "h\u0323"=>"\u1E25", "H\u0308"=>"\u1E26", "h\u0308"=>"\u1E27", "H\u0327"=>"\u1E28", "h\u0327"=>"\u1E29", "H\u032E"=>"\u1E2A", "h\u032E"=>"\u1E2B",
- "I\u0330"=>"\u1E2C", "i\u0330"=>"\u1E2D", "\u00CF\u0301"=>"\u1E2E", "\u00EF\u0301"=>"\u1E2F", "K\u0301"=>"\u1E30", "k\u0301"=>"\u1E31", "K\u0323"=>"\u1E32", "k\u0323"=>"\u1E33",
- "K\u0331"=>"\u1E34", "k\u0331"=>"\u1E35", "L\u0323"=>"\u1E36", "l\u0323"=>"\u1E37", "\u1E36\u0304"=>"\u1E38", "\u1E37\u0304"=>"\u1E39", "L\u0331"=>"\u1E3A", "l\u0331"=>"\u1E3B",
- "L\u032D"=>"\u1E3C", "l\u032D"=>"\u1E3D", "M\u0301"=>"\u1E3E", "m\u0301"=>"\u1E3F", "M\u0307"=>"\u1E40", "m\u0307"=>"\u1E41", "M\u0323"=>"\u1E42", "m\u0323"=>"\u1E43",
- "N\u0307"=>"\u1E44", "n\u0307"=>"\u1E45", "N\u0323"=>"\u1E46", "n\u0323"=>"\u1E47", "N\u0331"=>"\u1E48", "n\u0331"=>"\u1E49", "N\u032D"=>"\u1E4A", "n\u032D"=>"\u1E4B",
- "\u00D5\u0301"=>"\u1E4C", "\u00F5\u0301"=>"\u1E4D", "\u00D5\u0308"=>"\u1E4E", "\u00F5\u0308"=>"\u1E4F", "\u014C\u0300"=>"\u1E50", "\u014D\u0300"=>"\u1E51", "\u014C\u0301"=>"\u1E52", "\u014D\u0301"=>"\u1E53",
- "P\u0301"=>"\u1E54", "p\u0301"=>"\u1E55", "P\u0307"=>"\u1E56", "p\u0307"=>"\u1E57", "R\u0307"=>"\u1E58", "r\u0307"=>"\u1E59", "R\u0323"=>"\u1E5A", "r\u0323"=>"\u1E5B",
- "\u1E5A\u0304"=>"\u1E5C", "\u1E5B\u0304"=>"\u1E5D", "R\u0331"=>"\u1E5E", "r\u0331"=>"\u1E5F", "S\u0307"=>"\u1E60", "s\u0307"=>"\u1E61", "S\u0323"=>"\u1E62", "s\u0323"=>"\u1E63",
- "\u015A\u0307"=>"\u1E64", "\u015B\u0307"=>"\u1E65", "\u0160\u0307"=>"\u1E66", "\u0161\u0307"=>"\u1E67", "\u1E62\u0307"=>"\u1E68", "\u1E63\u0307"=>"\u1E69", "T\u0307"=>"\u1E6A", "t\u0307"=>"\u1E6B",
- "T\u0323"=>"\u1E6C", "t\u0323"=>"\u1E6D", "T\u0331"=>"\u1E6E", "t\u0331"=>"\u1E6F", "T\u032D"=>"\u1E70", "t\u032D"=>"\u1E71", "U\u0324"=>"\u1E72", "u\u0324"=>"\u1E73",
- "U\u0330"=>"\u1E74", "u\u0330"=>"\u1E75", "U\u032D"=>"\u1E76", "u\u032D"=>"\u1E77", "\u0168\u0301"=>"\u1E78", "\u0169\u0301"=>"\u1E79", "\u016A\u0308"=>"\u1E7A", "\u016B\u0308"=>"\u1E7B",
- "V\u0303"=>"\u1E7C", "v\u0303"=>"\u1E7D", "V\u0323"=>"\u1E7E", "v\u0323"=>"\u1E7F", "W\u0300"=>"\u1E80", "w\u0300"=>"\u1E81", "W\u0301"=>"\u1E82", "w\u0301"=>"\u1E83",
- "W\u0308"=>"\u1E84", "w\u0308"=>"\u1E85", "W\u0307"=>"\u1E86", "w\u0307"=>"\u1E87", "W\u0323"=>"\u1E88", "w\u0323"=>"\u1E89", "X\u0307"=>"\u1E8A", "x\u0307"=>"\u1E8B",
- "X\u0308"=>"\u1E8C", "x\u0308"=>"\u1E8D", "Y\u0307"=>"\u1E8E", "y\u0307"=>"\u1E8F", "Z\u0302"=>"\u1E90", "z\u0302"=>"\u1E91", "Z\u0323"=>"\u1E92", "z\u0323"=>"\u1E93",
- "Z\u0331"=>"\u1E94", "z\u0331"=>"\u1E95", "h\u0331"=>"\u1E96", "t\u0308"=>"\u1E97", "w\u030A"=>"\u1E98", "y\u030A"=>"\u1E99", "\u017F\u0307"=>"\u1E9B", "A\u0323"=>"\u1EA0",
- "a\u0323"=>"\u1EA1", "A\u0309"=>"\u1EA2", "a\u0309"=>"\u1EA3", "\u00C2\u0301"=>"\u1EA4", "\u00E2\u0301"=>"\u1EA5", "\u00C2\u0300"=>"\u1EA6", "\u00E2\u0300"=>"\u1EA7", "\u00C2\u0309"=>"\u1EA8",
- "\u00E2\u0309"=>"\u1EA9", "\u00C2\u0303"=>"\u1EAA", "\u00E2\u0303"=>"\u1EAB", "\u1EA0\u0302"=>"\u1EAC", "\u1EA1\u0302"=>"\u1EAD", "\u0102\u0301"=>"\u1EAE", "\u0103\u0301"=>"\u1EAF", "\u0102\u0300"=>"\u1EB0",
- "\u0103\u0300"=>"\u1EB1", "\u0102\u0309"=>"\u1EB2", "\u0103\u0309"=>"\u1EB3", "\u0102\u0303"=>"\u1EB4", "\u0103\u0303"=>"\u1EB5", "\u1EA0\u0306"=>"\u1EB6", "\u1EA1\u0306"=>"\u1EB7", "E\u0323"=>"\u1EB8",
- "e\u0323"=>"\u1EB9", "E\u0309"=>"\u1EBA", "e\u0309"=>"\u1EBB", "E\u0303"=>"\u1EBC", "e\u0303"=>"\u1EBD", "\u00CA\u0301"=>"\u1EBE", "\u00EA\u0301"=>"\u1EBF", "\u00CA\u0300"=>"\u1EC0",
- "\u00EA\u0300"=>"\u1EC1", "\u00CA\u0309"=>"\u1EC2", "\u00EA\u0309"=>"\u1EC3", "\u00CA\u0303"=>"\u1EC4", "\u00EA\u0303"=>"\u1EC5", "\u1EB8\u0302"=>"\u1EC6", "\u1EB9\u0302"=>"\u1EC7", "I\u0309"=>"\u1EC8",
- "i\u0309"=>"\u1EC9", "I\u0323"=>"\u1ECA", "i\u0323"=>"\u1ECB", "O\u0323"=>"\u1ECC", "o\u0323"=>"\u1ECD", "O\u0309"=>"\u1ECE", "o\u0309"=>"\u1ECF", "\u00D4\u0301"=>"\u1ED0",
- "\u00F4\u0301"=>"\u1ED1", "\u00D4\u0300"=>"\u1ED2", "\u00F4\u0300"=>"\u1ED3", "\u00D4\u0309"=>"\u1ED4", "\u00F4\u0309"=>"\u1ED5", "\u00D4\u0303"=>"\u1ED6", "\u00F4\u0303"=>"\u1ED7", "\u1ECC\u0302"=>"\u1ED8",
- "\u1ECD\u0302"=>"\u1ED9", "\u01A0\u0301"=>"\u1EDA", "\u01A1\u0301"=>"\u1EDB", "\u01A0\u0300"=>"\u1EDC", "\u01A1\u0300"=>"\u1EDD", "\u01A0\u0309"=>"\u1EDE", "\u01A1\u0309"=>"\u1EDF", "\u01A0\u0303"=>"\u1EE0",
- "\u01A1\u0303"=>"\u1EE1", "\u01A0\u0323"=>"\u1EE2", "\u01A1\u0323"=>"\u1EE3", "U\u0323"=>"\u1EE4", "u\u0323"=>"\u1EE5", "U\u0309"=>"\u1EE6", "u\u0309"=>"\u1EE7", "\u01AF\u0301"=>"\u1EE8",
- "\u01B0\u0301"=>"\u1EE9", "\u01AF\u0300"=>"\u1EEA", "\u01B0\u0300"=>"\u1EEB", "\u01AF\u0309"=>"\u1EEC", "\u01B0\u0309"=>"\u1EED", "\u01AF\u0303"=>"\u1EEE", "\u01B0\u0303"=>"\u1EEF", "\u01AF\u0323"=>"\u1EF0",
- "\u01B0\u0323"=>"\u1EF1", "Y\u0300"=>"\u1EF2", "y\u0300"=>"\u1EF3", "Y\u0323"=>"\u1EF4", "y\u0323"=>"\u1EF5", "Y\u0309"=>"\u1EF6", "y\u0309"=>"\u1EF7", "Y\u0303"=>"\u1EF8",
- "y\u0303"=>"\u1EF9", "\u03B1\u0313"=>"\u1F00", "\u03B1\u0314"=>"\u1F01", "\u1F00\u0300"=>"\u1F02", "\u1F01\u0300"=>"\u1F03", "\u1F00\u0301"=>"\u1F04", "\u1F01\u0301"=>"\u1F05", "\u1F00\u0342"=>"\u1F06",
- "\u1F01\u0342"=>"\u1F07", "\u0391\u0313"=>"\u1F08", "\u0391\u0314"=>"\u1F09", "\u1F08\u0300"=>"\u1F0A", "\u1F09\u0300"=>"\u1F0B", "\u1F08\u0301"=>"\u1F0C", "\u1F09\u0301"=>"\u1F0D", "\u1F08\u0342"=>"\u1F0E",
- "\u1F09\u0342"=>"\u1F0F", "\u03B5\u0313"=>"\u1F10", "\u03B5\u0314"=>"\u1F11", "\u1F10\u0300"=>"\u1F12", "\u1F11\u0300"=>"\u1F13", "\u1F10\u0301"=>"\u1F14", "\u1F11\u0301"=>"\u1F15", "\u0395\u0313"=>"\u1F18",
- "\u0395\u0314"=>"\u1F19", "\u1F18\u0300"=>"\u1F1A", "\u1F19\u0300"=>"\u1F1B", "\u1F18\u0301"=>"\u1F1C", "\u1F19\u0301"=>"\u1F1D", "\u03B7\u0313"=>"\u1F20", "\u03B7\u0314"=>"\u1F21", "\u1F20\u0300"=>"\u1F22",
- "\u1F21\u0300"=>"\u1F23", "\u1F20\u0301"=>"\u1F24", "\u1F21\u0301"=>"\u1F25", "\u1F20\u0342"=>"\u1F26", "\u1F21\u0342"=>"\u1F27", "\u0397\u0313"=>"\u1F28", "\u0397\u0314"=>"\u1F29", "\u1F28\u0300"=>"\u1F2A",
- "\u1F29\u0300"=>"\u1F2B", "\u1F28\u0301"=>"\u1F2C", "\u1F29\u0301"=>"\u1F2D", "\u1F28\u0342"=>"\u1F2E", "\u1F29\u0342"=>"\u1F2F", "\u03B9\u0313"=>"\u1F30", "\u03B9\u0314"=>"\u1F31", "\u1F30\u0300"=>"\u1F32",
- "\u1F31\u0300"=>"\u1F33", "\u1F30\u0301"=>"\u1F34", "\u1F31\u0301"=>"\u1F35", "\u1F30\u0342"=>"\u1F36", "\u1F31\u0342"=>"\u1F37", "\u0399\u0313"=>"\u1F38", "\u0399\u0314"=>"\u1F39", "\u1F38\u0300"=>"\u1F3A",
- "\u1F39\u0300"=>"\u1F3B", "\u1F38\u0301"=>"\u1F3C", "\u1F39\u0301"=>"\u1F3D", "\u1F38\u0342"=>"\u1F3E", "\u1F39\u0342"=>"\u1F3F", "\u03BF\u0313"=>"\u1F40", "\u03BF\u0314"=>"\u1F41", "\u1F40\u0300"=>"\u1F42",
- "\u1F41\u0300"=>"\u1F43", "\u1F40\u0301"=>"\u1F44", "\u1F41\u0301"=>"\u1F45", "\u039F\u0313"=>"\u1F48", "\u039F\u0314"=>"\u1F49", "\u1F48\u0300"=>"\u1F4A", "\u1F49\u0300"=>"\u1F4B", "\u1F48\u0301"=>"\u1F4C",
- "\u1F49\u0301"=>"\u1F4D", "\u03C5\u0313"=>"\u1F50", "\u03C5\u0314"=>"\u1F51", "\u1F50\u0300"=>"\u1F52", "\u1F51\u0300"=>"\u1F53", "\u1F50\u0301"=>"\u1F54", "\u1F51\u0301"=>"\u1F55", "\u1F50\u0342"=>"\u1F56",
- "\u1F51\u0342"=>"\u1F57", "\u03A5\u0314"=>"\u1F59", "\u1F59\u0300"=>"\u1F5B", "\u1F59\u0301"=>"\u1F5D", "\u1F59\u0342"=>"\u1F5F", "\u03C9\u0313"=>"\u1F60", "\u03C9\u0314"=>"\u1F61", "\u1F60\u0300"=>"\u1F62",
- "\u1F61\u0300"=>"\u1F63", "\u1F60\u0301"=>"\u1F64", "\u1F61\u0301"=>"\u1F65", "\u1F60\u0342"=>"\u1F66", "\u1F61\u0342"=>"\u1F67", "\u03A9\u0313"=>"\u1F68", "\u03A9\u0314"=>"\u1F69", "\u1F68\u0300"=>"\u1F6A",
- "\u1F69\u0300"=>"\u1F6B", "\u1F68\u0301"=>"\u1F6C", "\u1F69\u0301"=>"\u1F6D", "\u1F68\u0342"=>"\u1F6E", "\u1F69\u0342"=>"\u1F6F", "\u03B1\u0300"=>"\u1F70", "\u03B5\u0300"=>"\u1F72", "\u03B7\u0300"=>"\u1F74",
- "\u03B9\u0300"=>"\u1F76", "\u03BF\u0300"=>"\u1F78", "\u03C5\u0300"=>"\u1F7A", "\u03C9\u0300"=>"\u1F7C", "\u1F00\u0345"=>"\u1F80", "\u1F01\u0345"=>"\u1F81", "\u1F02\u0345"=>"\u1F82", "\u1F03\u0345"=>"\u1F83",
- "\u1F04\u0345"=>"\u1F84", "\u1F05\u0345"=>"\u1F85", "\u1F06\u0345"=>"\u1F86", "\u1F07\u0345"=>"\u1F87", "\u1F08\u0345"=>"\u1F88", "\u1F09\u0345"=>"\u1F89", "\u1F0A\u0345"=>"\u1F8A", "\u1F0B\u0345"=>"\u1F8B",
- "\u1F0C\u0345"=>"\u1F8C", "\u1F0D\u0345"=>"\u1F8D", "\u1F0E\u0345"=>"\u1F8E", "\u1F0F\u0345"=>"\u1F8F", "\u1F20\u0345"=>"\u1F90", "\u1F21\u0345"=>"\u1F91", "\u1F22\u0345"=>"\u1F92", "\u1F23\u0345"=>"\u1F93",
- "\u1F24\u0345"=>"\u1F94", "\u1F25\u0345"=>"\u1F95", "\u1F26\u0345"=>"\u1F96", "\u1F27\u0345"=>"\u1F97", "\u1F28\u0345"=>"\u1F98", "\u1F29\u0345"=>"\u1F99", "\u1F2A\u0345"=>"\u1F9A", "\u1F2B\u0345"=>"\u1F9B",
- "\u1F2C\u0345"=>"\u1F9C", "\u1F2D\u0345"=>"\u1F9D", "\u1F2E\u0345"=>"\u1F9E", "\u1F2F\u0345"=>"\u1F9F", "\u1F60\u0345"=>"\u1FA0", "\u1F61\u0345"=>"\u1FA1", "\u1F62\u0345"=>"\u1FA2", "\u1F63\u0345"=>"\u1FA3",
- "\u1F64\u0345"=>"\u1FA4", "\u1F65\u0345"=>"\u1FA5", "\u1F66\u0345"=>"\u1FA6", "\u1F67\u0345"=>"\u1FA7", "\u1F68\u0345"=>"\u1FA8", "\u1F69\u0345"=>"\u1FA9", "\u1F6A\u0345"=>"\u1FAA", "\u1F6B\u0345"=>"\u1FAB",
- "\u1F6C\u0345"=>"\u1FAC", "\u1F6D\u0345"=>"\u1FAD", "\u1F6E\u0345"=>"\u1FAE", "\u1F6F\u0345"=>"\u1FAF", "\u03B1\u0306"=>"\u1FB0", "\u03B1\u0304"=>"\u1FB1", "\u1F70\u0345"=>"\u1FB2", "\u03B1\u0345"=>"\u1FB3",
- "\u03AC\u0345"=>"\u1FB4", "\u03B1\u0342"=>"\u1FB6", "\u1FB6\u0345"=>"\u1FB7", "\u0391\u0306"=>"\u1FB8", "\u0391\u0304"=>"\u1FB9", "\u0391\u0300"=>"\u1FBA", "\u0391\u0345"=>"\u1FBC", "\u00A8\u0342"=>"\u1FC1",
- "\u1F74\u0345"=>"\u1FC2", "\u03B7\u0345"=>"\u1FC3", "\u03AE\u0345"=>"\u1FC4", "\u03B7\u0342"=>"\u1FC6", "\u1FC6\u0345"=>"\u1FC7", "\u0395\u0300"=>"\u1FC8", "\u0397\u0300"=>"\u1FCA", "\u0397\u0345"=>"\u1FCC",
- "\u1FBF\u0300"=>"\u1FCD", "\u1FBF\u0301"=>"\u1FCE", "\u1FBF\u0342"=>"\u1FCF", "\u03B9\u0306"=>"\u1FD0", "\u03B9\u0304"=>"\u1FD1", "\u03CA\u0300"=>"\u1FD2", "\u03B9\u0342"=>"\u1FD6", "\u03CA\u0342"=>"\u1FD7",
- "\u0399\u0306"=>"\u1FD8", "\u0399\u0304"=>"\u1FD9", "\u0399\u0300"=>"\u1FDA", "\u1FFE\u0300"=>"\u1FDD", "\u1FFE\u0301"=>"\u1FDE", "\u1FFE\u0342"=>"\u1FDF", "\u03C5\u0306"=>"\u1FE0", "\u03C5\u0304"=>"\u1FE1",
- "\u03CB\u0300"=>"\u1FE2", "\u03C1\u0313"=>"\u1FE4", "\u03C1\u0314"=>"\u1FE5", "\u03C5\u0342"=>"\u1FE6", "\u03CB\u0342"=>"\u1FE7", "\u03A5\u0306"=>"\u1FE8", "\u03A5\u0304"=>"\u1FE9", "\u03A5\u0300"=>"\u1FEA",
- "\u03A1\u0314"=>"\u1FEC", "\u00A8\u0300"=>"\u1FED", "\u1F7C\u0345"=>"\u1FF2", "\u03C9\u0345"=>"\u1FF3", "\u03CE\u0345"=>"\u1FF4", "\u03C9\u0342"=>"\u1FF6", "\u1FF6\u0345"=>"\u1FF7", "\u039F\u0300"=>"\u1FF8",
- "\u03A9\u0300"=>"\u1FFA", "\u03A9\u0345"=>"\u1FFC", "\u2190\u0338"=>"\u219A", "\u2192\u0338"=>"\u219B", "\u2194\u0338"=>"\u21AE", "\u21D0\u0338"=>"\u21CD", "\u21D4\u0338"=>"\u21CE", "\u21D2\u0338"=>"\u21CF",
- "\u2203\u0338"=>"\u2204", "\u2208\u0338"=>"\u2209", "\u220B\u0338"=>"\u220C", "\u2223\u0338"=>"\u2224", "\u2225\u0338"=>"\u2226", "\u223C\u0338"=>"\u2241", "\u2243\u0338"=>"\u2244", "\u2245\u0338"=>"\u2247",
- "\u2248\u0338"=>"\u2249", "=\u0338"=>"\u2260", "\u2261\u0338"=>"\u2262", "\u224D\u0338"=>"\u226D", "<\u0338"=>"\u226E", ">\u0338"=>"\u226F", "\u2264\u0338"=>"\u2270", "\u2265\u0338"=>"\u2271",
- "\u2272\u0338"=>"\u2274", "\u2273\u0338"=>"\u2275", "\u2276\u0338"=>"\u2278", "\u2277\u0338"=>"\u2279", "\u227A\u0338"=>"\u2280", "\u227B\u0338"=>"\u2281", "\u2282\u0338"=>"\u2284", "\u2283\u0338"=>"\u2285",
- "\u2286\u0338"=>"\u2288", "\u2287\u0338"=>"\u2289", "\u22A2\u0338"=>"\u22AC", "\u22A8\u0338"=>"\u22AD", "\u22A9\u0338"=>"\u22AE", "\u22AB\u0338"=>"\u22AF", "\u227C\u0338"=>"\u22E0", "\u227D\u0338"=>"\u22E1",
- "\u2291\u0338"=>"\u22E2", "\u2292\u0338"=>"\u22E3", "\u22B2\u0338"=>"\u22EA", "\u22B3\u0338"=>"\u22EB", "\u22B4\u0338"=>"\u22EC", "\u22B5\u0338"=>"\u22ED", "\u304B\u3099"=>"\u304C", "\u304D\u3099"=>"\u304E",
- "\u304F\u3099"=>"\u3050", "\u3051\u3099"=>"\u3052", "\u3053\u3099"=>"\u3054", "\u3055\u3099"=>"\u3056", "\u3057\u3099"=>"\u3058", "\u3059\u3099"=>"\u305A", "\u305B\u3099"=>"\u305C", "\u305D\u3099"=>"\u305E",
- "\u305F\u3099"=>"\u3060", "\u3061\u3099"=>"\u3062", "\u3064\u3099"=>"\u3065", "\u3066\u3099"=>"\u3067", "\u3068\u3099"=>"\u3069", "\u306F\u3099"=>"\u3070", "\u306F\u309A"=>"\u3071", "\u3072\u3099"=>"\u3073",
- "\u3072\u309A"=>"\u3074", "\u3075\u3099"=>"\u3076", "\u3075\u309A"=>"\u3077", "\u3078\u3099"=>"\u3079", "\u3078\u309A"=>"\u307A", "\u307B\u3099"=>"\u307C", "\u307B\u309A"=>"\u307D", "\u3046\u3099"=>"\u3094",
- "\u309D\u3099"=>"\u309E", "\u30AB\u3099"=>"\u30AC", "\u30AD\u3099"=>"\u30AE", "\u30AF\u3099"=>"\u30B0", "\u30B1\u3099"=>"\u30B2", "\u30B3\u3099"=>"\u30B4", "\u30B5\u3099"=>"\u30B6", "\u30B7\u3099"=>"\u30B8",
- "\u30B9\u3099"=>"\u30BA", "\u30BB\u3099"=>"\u30BC", "\u30BD\u3099"=>"\u30BE", "\u30BF\u3099"=>"\u30C0", "\u30C1\u3099"=>"\u30C2", "\u30C4\u3099"=>"\u30C5", "\u30C6\u3099"=>"\u30C7", "\u30C8\u3099"=>"\u30C9",
- "\u30CF\u3099"=>"\u30D0", "\u30CF\u309A"=>"\u30D1", "\u30D2\u3099"=>"\u30D3", "\u30D2\u309A"=>"\u30D4", "\u30D5\u3099"=>"\u30D6", "\u30D5\u309A"=>"\u30D7", "\u30D8\u3099"=>"\u30D9", "\u30D8\u309A"=>"\u30DA",
- "\u30DB\u3099"=>"\u30DC", "\u30DB\u309A"=>"\u30DD", "\u30A6\u3099"=>"\u30F4", "\u30EF\u3099"=>"\u30F7", "\u30F0\u3099"=>"\u30F8", "\u30F1\u3099"=>"\u30F9", "\u30F2\u3099"=>"\u30FA", "\u30FD\u3099"=>"\u30FE",
- "\u{11099}\u{110BA}"=>"\u{1109A}", "\u{1109B}\u{110BA}"=>"\u{1109C}", "\u{110A5}\u{110BA}"=>"\u{110AB}", "\u{11131}\u{11127}"=>"\u{1112E}", "\u{11132}\u{11127}"=>"\u{1112F}", "\u{11347}\u{1133E}"=>"\u{1134B}", "\u{11347}\u{11357}"=>"\u{1134C}", "\u{114B9}\u{114BA}"=>"\u{114BB}",
- "\u{114B9}\u{114B0}"=>"\u{114BC}", "\u{114B9}\u{114BD}"=>"\u{114BE}", "\u{115B8}\u{115AF}"=>"\u{115BA}", "\u{115B9}\u{115AF}"=>"\u{115BB}",
- }.freeze
-end
diff --git a/lib/uri.rb b/lib/uri.rb
index 971a97038f..2e136eb682 100644
--- a/lib/uri.rb
+++ b/lib/uri.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# URI is a module providing classes to handle Uniform Resource Identifiers
# (RFC2396[http://tools.ietf.org/html/rfc2396])
#
@@ -96,7 +95,7 @@
module URI
# :stopdoc:
- VERSION_CODE = '001000'.freeze
+ VERSION_CODE = '000911'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
# :startdoc:
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 764f89d810..facca4b08b 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# = uri/common.rb
#
@@ -74,17 +73,13 @@ module URI
# String to replaces in.
# +unsafe+::
# Regexp that matches all symbols that must be replaced with codes.
- # By default uses <tt>UNSAFE</tt>.
+ # By default uses <tt>REGEXP::UNSAFE</tt>.
# When this argument is a String, it represents a character set.
#
# == Description
#
# Escapes the string, replacing all unsafe characters with codes.
#
- # This method is obsolete and should not be used. Instead, use
- # CGI.escape, URI.encode_www_form or URI.encode_www_form_component
- # depending on your specific use case.
- #
# == Usage
#
# require 'uri'
@@ -100,7 +95,7 @@ module URI
# # => "@%3F@%21"
#
def escape(*arg)
- warn "URI.escape is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: URI.escape is obsolete" if $VERBOSE
DEFAULT_PARSER.escape(*arg)
end
alias encode escape
@@ -114,12 +109,6 @@ module URI
# +str+::
# Unescapes the string.
#
- # == Description
- #
- # This method is obsolete and should not be used. Instead, use
- # CGI.unescape, URI.decode_www_form or URI.decode_www_form_component
- # depending on your specific use case.
- #
# == Usage
#
# require 'uri'
@@ -132,7 +121,7 @@ module URI
# # => "http://example.com/?a=\t\r"
#
def unescape(*arg)
- warn "URI.unescape is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE
DEFAULT_PARSER.unescape(*arg)
end
alias decode unescape
@@ -256,7 +245,7 @@ module URI
# require 'uri'
#
# p URI.join("http://example.com/","main.rbx")
- # # => #<URI::HTTP:0x2022ac02 URL:http://example.com/main.rbx>
+ # # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx>
#
# p URI.join('http://example.com', 'foo')
# # => #<URI::HTTP:0x01ab80a0 URL:http://example.com/foo>
@@ -300,7 +289,7 @@ module URI
# # => ["http://foo.example.com/bla", "mailto:test@example.com"]
#
def self.extract(str, schemes = nil, &block)
- warn "URI.extract is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: URI.extract is obsolete" if $VERBOSE
DEFAULT_PARSER.extract(str, schemes, &block)
end
@@ -336,7 +325,7 @@ module URI
# end
#
def self.regexp(schemes = nil)
- warn "URI.regexp is obsolete", uplevel: 1 if $VERBOSE
+ warn "#{caller(1)[0]}: warning: URI.regexp is obsolete" if $VERBOSE
DEFAULT_PARSER.make_regexp(schemes)
end
@@ -357,8 +346,8 @@ module URI
TBLDECWWWCOMP_['+'] = ' '
TBLDECWWWCOMP_.freeze
- HTML5ASCIIINCOMPAT = defined? Encoding::UTF_7 ? [Encoding::UTF_7, Encoding::UTF_16BE, Encoding::UTF_16LE,
- Encoding::UTF_32BE, Encoding::UTF_32LE] : [] # :nodoc:
+ HTML5ASCIIINCOMPAT = [Encoding::UTF_7, Encoding::UTF_16BE, Encoding::UTF_16LE,
+ Encoding::UTF_32BE, Encoding::UTF_32LE] # :nodoc:
# Encode given +str+ to URL-encoded form data.
#
@@ -449,12 +438,12 @@ module URI
# This refers http://url.spec.whatwg.org/#concept-urlencoded-parser ,
# so this supports only &-separator, don't support ;-separator.
#
- # ary = URI.decode_www_form("a=1&a=2&b=3")
- # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']]
- # p ary.assoc('a').last #=> '1'
- # p ary.assoc('b').last #=> '3'
- # p ary.rassoc('a').last #=> '2'
- # p Hash[ary] # => {"a"=>"2", "b"=>"3"}
+ # ary = URI.decode_www_form("a=1&a=2&b=3")
+ # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']]
+ # p ary.assoc('a').last #=> '1'
+ # p ary.assoc('b').last #=> '3'
+ # p ary.rassoc('a').last #=> '2'
+ # p Hash[ary] # => {"a"=>"2", "b"=>"3"}
#
# See URI.decode_www_form_component, URI.encode_www_form
def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false)
@@ -497,24 +486,7 @@ module URI
end
private
-=begin command for WEB_ENCODINGS_
- curl https://encoding.spec.whatwg.org/encodings.json|
- ruby -rjson -e 'H={}
- h={
- "shift_jis"=>"Windows-31J",
- "euc-jp"=>"cp51932",
- "iso-2022-jp"=>"cp50221",
- "x-mac-cyrillic"=>"macCyrillic",
- }
- JSON($<.read).map{|x|x["encodings"]}.flatten.each{|x|
- Encoding.find(n=h.fetch(n=x["name"].downcase,n))rescue next
- x["labels"].each{|y|H[y]=n}
- }
- puts "{"
- H.each{|k,v|puts %[ #{k.dump}=>#{v.dump},]}
- puts "}"
-'
-=end
+ # curl http://encoding.spec.whatwg.org/encodings.json|rb -rpp -rjson -e'H={};h={"shift_jis"=>"Windows-31J","euc-jp"=>"cp51932","iso-2022-jp"=>"cp50221","x-mac-cyrillic"=>"macCyrillic"};JSON($<.read).map{|x|x["encodings"]}.flatten.each{|x|Encoding.find(n=h.fetch(n=x["name"],n))rescue next;x["labels"].each{|y|H[y]=n}};pp H'
WEB_ENCODINGS_ = {
"unicode-1-1-utf-8"=>"utf-8",
"utf-8"=>"utf-8",
@@ -620,7 +592,6 @@ module URI
"koi8"=>"koi8-r",
"koi8-r"=>"koi8-r",
"koi8_r"=>"koi8-r",
- "koi8-ru"=>"koi8-u",
"koi8-u"=>"koi8-u",
"dos-874"=>"windows-874",
"iso-8859-11"=>"windows-874",
@@ -701,7 +672,6 @@ module URI
"csiso2022jp"=>"cp50221",
"iso-2022-jp"=>"cp50221",
"csshiftjis"=>"Windows-31J",
- "ms932"=>"Windows-31J",
"ms_kanji"=>"Windows-31J",
"shift-jis"=>"Windows-31J",
"shift_jis"=>"Windows-31J",
@@ -720,7 +690,7 @@ module URI
"windows-949"=>"euc-kr",
"utf-16be"=>"utf-16be",
"utf-16"=>"utf-16le",
- "utf-16le"=>"utf-16le",
+ "utf-16le"=>"utf-16le"
} # :nodoc:
# :nodoc:
diff --git a/lib/uri/ftp.rb b/lib/uri/ftp.rb
index 90c1403ce6..557e1fda33 100644
--- a/lib/uri/ftp.rb
+++ b/lib/uri/ftp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/ftp.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
@@ -86,8 +85,8 @@ module URI
# require 'uri'
#
# uri = URI::FTP.build(['user:password', 'ftp.example.com', nil,
- # '/path/file.zip', 'i'])
- # puts uri.to_s -> ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i
+ # '/path/file.> zip', 'i'])
+ # puts uri.to_s -> ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=a
#
# uri2 = URI::FTP.build({:host => 'ftp.example.com',
# :path => 'ruby/src'})
@@ -226,7 +225,7 @@ module URI
# RFC 1738 specifically states that the path for an FTP URI does not
# include the / which separates the URI path from the URI host. Example:
#
- # +ftp://ftp.example.com/pub/ruby+
+ # ftp://ftp.example.com/pub/ruby
#
# The above URI indicates that the client should connect to
# ftp.example.com then cd pub/ruby from the initial login directory.
@@ -234,7 +233,7 @@ module URI
# If you want to cd to an absolute directory, you must include an
# escaped / (%2F) in the path. Example:
#
- # +ftp://ftp.example.com/%2Fpub/ruby+
+ # ftp://ftp.example.com/%2Fpub/ruby
#
# This method will then return "/pub/ruby"
#
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 140fb055de..0169934d04 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
# = uri/generic.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
@@ -10,8 +8,6 @@
#
require 'uri/common'
-autoload :IPSocket, 'socket'
-autoload :IPAddr, 'ipaddr'
module URI
@@ -188,7 +184,7 @@ module URI
if arg_check
self.scheme = scheme
self.userinfo = userinfo
- self.hostname = host
+ self.host = host
self.port = port
self.path = path
self.query = query
@@ -209,7 +205,7 @@ module URI
"the scheme #{@scheme} does not accept registry part: #{registry} (or bad hostname?)"
end
- @scheme&.freeze
+ @scheme.freeze if @scheme
self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2)
self.set_port(self.default_port) if self.default_port && !@port
end
@@ -273,7 +269,7 @@ module URI
#
# Portion of the path that does make use of the slash '/'.
# The path typically refers to the absolute path and the opaque part.
- # (See RFC2396 Section 3 and 5.2.)
+ # (see RFC2396 Section 3 and 5.2)
#
attr_reader :opaque
@@ -332,7 +328,7 @@ module URI
# see also URI::Generic.scheme=
#
def set_scheme(v)
- @scheme = v&.downcase
+ @scheme = v ? v.downcase : v
end
protected :set_scheme
@@ -430,7 +426,7 @@ module URI
if parser.regexp[:USERINFO] !~ v
raise InvalidComponentError,
- "bad password component"
+ "bad component(expected user component): #{v}"
end
return true
@@ -547,7 +543,7 @@ module URI
# if properly formatted as 'user:password'
def split_userinfo(ui)
return nil, nil unless ui
- user, password = ui.split(':', 2)
+ user, password = ui.split(/:/, 2)
return user, password
end
@@ -645,9 +641,9 @@ module URI
# This method is same as URI::Generic#host except
# brackets for IPv6 (and future IP) addresses are removed.
#
- # u = URI("http://[::1]/bar")
- # p u.hostname #=> "::1"
- # p u.host #=> "[::1]"
+ # u = URI("http://[::1]/bar")
+ # p u.hostname #=> "::1"
+ # p u.host #=> "[::1]"
#
def hostname
v = self.host
@@ -659,10 +655,10 @@ module URI
# This method is same as URI::Generic#host= except
# the argument can be bare IPv6 address.
#
- # u = URI("http://foo/bar")
- # p u.to_s #=> "http://foo/bar"
- # u.hostname = "::1"
- # p u.to_s #=> "http://[::1]/bar"
+ # u = URI("http://foo/bar")
+ # p u.to_s #=> "http://foo/bar"
+ # u.hostname = "::1"
+ # p u.to_s #=> "http://[::1]/bar"
#
# If the argument seems IPv6 address,
# it is wrapped by brackets.
@@ -685,7 +681,7 @@ module URI
if @opaque
raise InvalidURIError,
"can not set port with registry or opaque"
- elsif !v.kind_of?(Integer) && parser.regexp[:PORT] !~ v
+ elsif !v.kind_of?(Fixnum) && parser.regexp[:PORT] !~ v
raise InvalidComponentError,
"bad component(expected port component): #{v.inspect}"
end
@@ -699,7 +695,13 @@ module URI
# see also URI::Generic.port=
#
def set_port(v)
- v = v.empty? ? nil : v.to_i unless !v || v.kind_of?(Integer)
+ unless !v || v.kind_of?(Fixnum)
+ if v.empty?
+ v = nil
+ else
+ v = v.to_i
+ end
+ end
@port = v
end
protected :set_port
@@ -772,8 +774,7 @@ module URI
"bad component(expected absolute path component): #{v}"
end
else
- if v && v != '' && parser.regexp[:ABS_PATH] !~ v &&
- parser.regexp[:REL_PATH] !~ v
+ if v && v != '' && parser.regexp[:ABS_PATH] !~ v && parser.regexp[:REL_PATH] !~ v
raise InvalidComponentError,
"bad component(expected relative path component): #{v}"
end
@@ -850,7 +851,7 @@ module URI
v.encode!(Encoding::UTF_8) rescue nil
v.delete!("\t\r\n")
v.force_encoding(Encoding::ASCII_8BIT)
- v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n.freeze){'%%%02X' % $&.ord}
+ v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n){'%%%02X' % $&.ord}
v.force_encoding(Encoding::US_ASCII)
@query = v
end
@@ -979,7 +980,7 @@ module URI
# returns an Array of the path split on '/'
#
def split_path(path)
- path.split("/", -1)
+ path.split(%r{/+}, -1)
end
private :split_path
@@ -1098,20 +1099,16 @@ module URI
# # => #<URI::HTTP:0x2021f3b0 URL:http://my.example.com/main.rbx?page=1>
#
def merge(oth)
- rel = parser.send(:convert_to_uri, oth)
-
- if rel.absolute?
- #raise BadURIError, "both URI are absolute" if absolute?
- # hmm... should return oth for usability?
- return rel
+ begin
+ base, rel = merge0(oth)
+ rescue
+ raise $!.class, $!.message
end
- unless self.absolute?
- raise BadURIError, "both URI are relative"
+ if base == rel
+ return base
end
- base = self.dup
-
authority = rel.userinfo || rel.host || rel.port
# RFC2396, Section 5.2, 2)
@@ -1142,6 +1139,31 @@ module URI
end # merge
alias + merge
+ # return base and rel.
+ # you can modify `base', but can not `rel'.
+ def merge0(oth)
+ oth = parser.send(:convert_to_uri, oth)
+
+ if self.relative? && oth.relative?
+ raise BadURIError,
+ "both URI are relative"
+ end
+
+ if self.absolute? && oth.absolute?
+ #raise BadURIError,
+ # "both URI are absolute"
+ # hmm... should return oth for usability?
+ return oth, oth
+ end
+
+ if self.absolute?
+ return self.dup, oth
+ else
+ return oth, oth
+ end
+ end
+ private :merge0
+
# :stopdoc:
def route_from_path(src, dst)
case dst
@@ -1154,8 +1176,8 @@ module URI
return dst.dup
end
- src_path = src.scan(%r{[^/]*/})
- dst_path = dst.scan(%r{[^/]*/?})
+ src_path = src.scan(%r{(?:\A|[^/]+)/})
+ dst_path = dst.scan(%r{(?:\A|[^/]+)/?})
# discard same parts
while !dst_path.empty? && dst_path.first == src_path.first
@@ -1295,17 +1317,7 @@ module URI
end
#
- # Returns normalized URI.
- #
- # require 'uri'
- #
- # URI("HTTP://my.EXAMPLE.com").normalize
- # #=> #<URI::HTTP http://my.example.com/>
- #
- # Normalization here means:
- #
- # * scheme and host are converted to lowercase,
- # * an empty path component is set to "/".
+ # Returns normalized URI
#
def normalize
uri = dup
@@ -1317,7 +1329,7 @@ module URI
# Destructive version of #normalize
#
def normalize!
- if path&.empty?
+ if path && path.empty?
set_path('/')
end
if scheme && scheme != scheme.downcase
@@ -1332,44 +1344,44 @@ module URI
# Constructs String from URI
#
def to_s
- str = ''.dup
+ str = ''
if @scheme
str << @scheme
- str << ':'
+ str << ':'.freeze
end
if @opaque
str << @opaque
else
- if @host || %w[file postgres].include?(@scheme)
- str << '//'
+ if @host
+ str << '//'.freeze
end
if self.userinfo
str << self.userinfo
- str << '@'
+ str << '@'.freeze
end
if @host
str << @host
end
if @port && @port != self.default_port
- str << ':'
+ str << ':'.freeze
str << @port.to_s
end
str << @path
if @query
- str << '?'
+ str << '?'.freeze
str << @query
end
end
if @fragment
- str << '#'
+ str << '#'.freeze
str << @fragment
end
str
end
#
- # Compares two URIs
+ # Compares to URI's
#
def ==(oth)
if self.class == oth.class
@@ -1438,8 +1450,9 @@ module URI
end
end
+ @@to_s = Kernel.instance_method(:to_s)
def inspect
- "#<#{self.class} #{self}>"
+ @@to_s.bind(self).call.sub!(/>\z/) {" URL:#{self}>"}
end
#
@@ -1450,8 +1463,8 @@ module URI
#
# == Description
#
- # attempts to parse other URI +oth+,
- # returns [parsed_oth, self]
+ # attempt to parse other URI +oth+
+ # return [parsed_oth, self]
#
# == Usage
#
@@ -1477,8 +1490,6 @@ module URI
# ftp_proxy, no_proxy, etc.
# If there is no proper proxy, nil is returned.
#
- # If the optional parameter, +env+, is specified, it is used instead of ENV.
- #
# Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.)
# are examined too.
#
@@ -1487,41 +1498,41 @@ module URI
# So HTTP_PROXY is not used.
# http_proxy is not used too if the variable is case insensitive.
# CGI_HTTP_PROXY can be used instead.
- def find_proxy(env=ENV)
+ def find_proxy
raise BadURIError, "relative URI: #{self}" if self.relative?
name = self.scheme.downcase + '_proxy'
proxy_uri = nil
- if name == 'http_proxy' && env.include?('REQUEST_METHOD') # CGI?
+ if name == 'http_proxy' && ENV.include?('REQUEST_METHOD') # CGI?
# HTTP_PROXY conflicts with *_proxy for proxy settings and
# HTTP_* for header information in CGI.
# So it should be careful to use it.
- pairs = env.reject {|k, v| /\Ahttp_proxy\z/i !~ k }
+ pairs = ENV.reject {|k, v| /\Ahttp_proxy\z/i !~ k }
case pairs.length
when 0 # no proxy setting anyway.
proxy_uri = nil
when 1
k, _ = pairs.shift
- if k == 'http_proxy' && env[k.upcase] == nil
+ if k == 'http_proxy' && ENV[k.upcase] == nil
# http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = env[name]
+ proxy_uri = ENV[name]
else
proxy_uri = nil
end
else # http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = env.to_hash[name]
+ proxy_uri = ENV.to_hash[name]
end
if !proxy_uri
# Use CGI_HTTP_PROXY. cf. libwww-perl.
- proxy_uri = env["CGI_#{name.upcase}"]
+ proxy_uri = ENV["CGI_#{name.upcase}"]
end
elsif name == 'http_proxy'
- unless proxy_uri = env[name]
- if proxy_uri = env[name.upcase]
- warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.', uplevel: 1
+ unless proxy_uri = ENV[name]
+ if proxy_uri = ENV[name.upcase]
+ warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.'
end
end
else
- proxy_uri = env[name] || env[name.upcase]
+ proxy_uri = ENV[name] || ENV[name.upcase]
end
if proxy_uri.nil? || proxy_uri.empty?
@@ -1529,6 +1540,7 @@ module URI
end
if self.hostname
+ require 'socket'
begin
addr = IPSocket.getaddress(self.hostname)
return nil if /\A127\.|\A::1\z/ =~ addr
@@ -1537,27 +1549,15 @@ module URI
end
name = 'no_proxy'
- if no_proxy = env[name] || env[name.upcase]
- return nil unless URI::Generic.use_proxy?(self.hostname, addr, self.port, no_proxy)
+ if no_proxy = ENV[name] || ENV[name.upcase]
+ no_proxy.scan(/([^:,]*)(?::(\d+))?/) {|host, port|
+ if /(\A|\.)#{Regexp.quote host}\z/i =~ self.host &&
+ (!port || self.port == port.to_i)
+ return nil
+ end
+ }
end
URI.parse(proxy_uri)
end
-
- def self.use_proxy?(hostname, addr, port, no_proxy) # :nodoc:
- no_proxy.scan(/(?!\.)([^:,\s]+)(?::(\d+))?/) {|p_host, p_port|
- if !p_port || port == p_port.to_i
- if /(\A|\.)#{Regexp.quote p_host}\z/i =~ hostname
- return false
- elsif addr
- begin
- return false if IPAddr.new(p_host).include?(addr)
- rescue IPAddr::InvalidAddressError
- next
- end
- end
- end
- }
- true
- end
end
end
diff --git a/lib/uri/http.rb b/lib/uri/http.rb
index 0af1858efe..dc47613cdf 100644
--- a/lib/uri/http.rb
+++ b/lib/uri/http.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/http.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
@@ -25,12 +24,12 @@ module URI
DEFAULT_PORT = 80
# An Array of the available components for URI::HTTP
- COMPONENT = %i[
- scheme
- userinfo host port
- path
- query
- fragment
+ COMPONENT = [
+ :scheme,
+ :userinfo, :host, :port,
+ :path,
+ :query,
+ :fragment
].freeze
#
@@ -49,7 +48,8 @@ module URI
#
# Example:
#
- # newuri = URI::HTTP.build(host: 'www.example.com', path: '/foo/bar')
+ # newuri = URI::HTTP.build({:host => 'www.example.com',
+ # :path => '/foo/bar'})
#
# newuri = URI::HTTP.build([nil, "www.example.com", nil, "/path",
# "query", 'fragment'])
@@ -58,31 +58,49 @@ module URI
# invalid HTTP URIs as per RFC 1738.
#
def self.build(args)
- tmp = Util.make_components_hash(self, args)
- super(tmp)
+ tmp = Util::make_components_hash(self, args)
+ return super(tmp)
end
#
# == Description
#
- # Returns the full path for an HTTP request, as required by Net::HTTP::Get.
+ # Create a new URI::HTTP object from generic URI components as per
+ # RFC 2396. No HTTP-specific syntax checking (as per RFC 1738) is
+ # performed.
#
- # If the URI contains a query, the full path is URI#path + '?' + URI#query.
- # Otherwise, the path is simply URI#path.
+ # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
+ # +opaque+, +query+ and +fragment+, in that order.
#
# Example:
#
- # newuri = URI::HTTP.build(path: '/foo/bar', query: 'test=true')
- # newuri.request_uri # => "/foo/bar?test=true"
+ # uri = URI::HTTP.new('http', nil, "www.example.com", nil, "/path",
+ # "query", 'fragment')
#
- def request_uri
- return unless @path
+ #
+ # See also URI::Generic.new
+ #
+ def initialize(*arg)
+ super(*arg)
+ end
- url = @query ? "#@path?#@query" : @path.dup
- url.start_with?(?/.freeze) ? url : ?/ + url
+ #
+ # == Description
+ #
+ # Returns the full path for an HTTP request, as required by Net::HTTP::Get.
+ #
+ # If the URI contains a query, the full path is URI#path + '?' + URI#query.
+ # Otherwise, the path is simply URI#path.
+ #
+ def request_uri
+ return nil unless @path
+ if @path.start_with?(?/.freeze)
+ @query ? "#@path?#@query" : @path.dup
+ else
+ @query ? "/#@path?#@query" : "/#@path"
+ end
end
end
@@schemes['HTTP'] = HTTP
-
end
diff --git a/lib/uri/https.rb b/lib/uri/https.rb
index 3c8c905cc3..7d242e7e79 100644
--- a/lib/uri/https.rb
+++ b/lib/uri/https.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/https.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
diff --git a/lib/uri/ldap.rb b/lib/uri/ldap.rb
index 4345875e28..56d748e59e 100644
--- a/lib/uri/ldap.rb
+++ b/lib/uri/ldap.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/ldap.rb
#
# Author::
diff --git a/lib/uri/ldaps.rb b/lib/uri/ldaps.rb
index d03f8efa2d..42bbfe86ba 100644
--- a/lib/uri/ldaps.rb
+++ b/lib/uri/ldaps.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/ldap.rb
#
# License:: You can redistribute it and/or modify it under the same term as Ruby.
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index 1494c3952b..3499910787 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
# = uri/mailto.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
@@ -53,7 +52,7 @@ module URI
HEADER_REGEXP = /\A(?<hfield>(?:%\h\h|[!$'-.0-;@-Z_a-z~])*=(?:%\h\h|[!$'-.0-;@-Z_a-z~])*)(?:&\g<hfield>)*\z/
# practical regexp for email address
# http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
- EMAIL_REGEXP = /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/
+ EMAIL_REGEXP = /\A[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/
# :startdoc:
#
@@ -84,7 +83,7 @@ module URI
# puts m3.to_s -> mailto:listman@example.com?subject=subscribe
#
def self.build(args)
- tmp = Util.make_components_hash(self, args)
+ tmp = Util::make_components_hash(self, args)
case tmp[:to]
when Array
@@ -118,7 +117,7 @@ module URI
end
end
- super(tmp)
+ return super(tmp)
end
#
@@ -136,13 +135,6 @@ module URI
@to = nil
@headers = []
- # The RFC3986 parser does not normally populate opaque
- @opaque = "?#{@query}" if @query && !@opaque
-
- unless @opaque
- raise InvalidComponentError,
- "missing opaque part for mailto URL"
- end
to, header = @opaque.split('?', 2)
# allow semicolon as a addr-spec separator
# http://support.microsoft.com/kb/820868
@@ -187,7 +179,7 @@ module URI
end
end
- true
+ return true
end
private :check_to
@@ -214,7 +206,7 @@ module URI
"bad component(expected opaque component): #{v}"
end
- true
+ return true
end
private :check_headers
@@ -267,22 +259,22 @@ module URI
# # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
#
def to_mailtext
- to = URI.decode_www_form_component(@to)
+ to = parser.unescape(@to)
head = ''
body = ''
@headers.each do |x|
case x[0]
when 'body'
- body = URI.decode_www_form_component(x[1])
+ body = parser.unescape(x[1])
when 'to'
- to << ', ' + URI.decode_www_form_component(x[1])
+ to << ', ' + parser.unescape(x[1])
else
- head << URI.decode_www_form_component(x[0]).capitalize + ': ' +
- URI.decode_www_form_component(x[1]) + "\n"
+ head << parser.unescape(x[0]).capitalize + ': ' +
+ parser.unescape(x[1]) + "\n"
end
end
- "To: #{to}
+ return "To: #{to}
#{head}
#{body}
"
diff --git a/lib/uri/rfc2396_parser.rb b/lib/uri/rfc2396_parser.rb
index b9e7b2b26e..50e3ae6973 100644
--- a/lib/uri/rfc2396_parser.rb
+++ b/lib/uri/rfc2396_parser.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# = uri/common.rb
#
@@ -99,11 +98,11 @@ module URI
#
def initialize(opts = {})
@pattern = initialize_pattern(opts)
- @pattern.each_value(&:freeze)
+ @pattern.each_value {|v| v.freeze}
@pattern.freeze
@regexp = initialize_regexp(@pattern)
- @regexp.each_value(&:freeze)
+ @regexp.each_value {|v| v.freeze}
@regexp.freeze
end
@@ -402,7 +401,7 @@ module URI
# host = hostname | IPv4address | IPv6reference (RFC 2732)
ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
# port = *digit
- ret[:PORT] = port = '\d*'
+ port = '\d*'
# hostport = host [ ":" port ]
ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
diff --git a/lib/uri/rfc3986_parser.rb b/lib/uri/rfc3986_parser.rb
index 871280044a..965601c7b3 100644
--- a/lib/uri/rfc3986_parser.rb
+++ b/lib/uri/rfc3986_parser.rb
@@ -1,68 +1,48 @@
-# frozen_string_literal: false
module URI
class RFC3986_Parser # :nodoc:
# URI defined in RFC3986
# this regexp is modified not to host is not empty string
- RFC3986_URI = /\A(?<URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
- RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+)\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
- attr_reader :regexp
-
- def initialize
- @regexp = default_regexp.each_value(&:freeze).freeze
- end
+ RFC3986_URI = /\A(?<URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
+ RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+)\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
def split(uri) #:nodoc:
- begin
- uri = uri.to_str
- rescue NoMethodError
- raise InvalidURIError, "bad URI(is not URI?): #{uri}"
- end
- uri.ascii_only? or
+ uri = uri.to_str
+ unless uri.ascii_only?
raise InvalidURIError, "URI must be ascii only #{uri.dump}"
+ end
if m = RFC3986_URI.match(uri)
- query = m["query".freeze]
- scheme = m["scheme".freeze]
- opaque = m["path-rootless".freeze]
- if opaque
- opaque << "?#{query}" if query
- [ scheme,
- nil, # userinfo
- nil, # host
- nil, # port
- nil, # registry
- nil, # path
- opaque,
- nil, # query
- m["fragment".freeze]
- ]
+ ary = []
+ ary << m["scheme"]
+ if m["path-rootless"] # opaque
+ ary << nil # userinfo
+ ary << nil # host
+ ary << nil # port
+ ary << nil # registry
+ ary << nil # path
+ ary << m["path-rootless"]
+ ary[-1] << '?' << m["query"] if m["query"]
+ ary << nil # query
+ ary << m["fragment"]
else # normal
- [ scheme,
- m["userinfo".freeze],
- m["host".freeze],
- m["port".freeze],
- nil, # registry
- (m["path-abempty".freeze] ||
- m["path-absolute".freeze] ||
- m["path-empty".freeze]),
- nil, # opaque
- query,
- m["fragment".freeze]
- ]
+ ary << m["userinfo"]
+ ary << m["host"]
+ ary << m["port"]
+ ary << nil # registry
+ ary << (m["path-abempty"] || m["path-absolute"] || m["path-empty"])
+ ary << nil # opaque
+ ary << m["query"]
+ ary << m["fragment"]
end
elsif m = RFC3986_relative_ref.match(uri)
- [ nil, # scheme
- m["userinfo".freeze],
- m["host".freeze],
- m["port".freeze],
- nil, # registry,
- (m["path-abempty".freeze] ||
- m["path-absolute".freeze] ||
- m["path-noscheme".freeze] ||
- m["path-empty".freeze]),
- nil, # opaque
- m["query".freeze],
- m["fragment".freeze]
- ]
+ ary = [nil]
+ ary << m["userinfo"]
+ ary << m["host"]
+ ary << m["port"]
+ ary << nil # registry
+ ary << (m["path-abempty"] || m["path-absolute"] || m["path-noscheme"] || m["path-empty"])
+ ary << nil # opaque
+ ary << m["query"]
+ ary << m["fragment"]
else
raise InvalidURIError, "bad URI(is not URI?): #{uri}"
end
@@ -71,11 +51,11 @@ module URI
def parse(uri) # :nodoc:
scheme, userinfo, host, port,
registry, path, opaque, query, fragment = self.split(uri)
- scheme_list = URI.scheme_list
- if scheme && scheme_list.include?(uc = scheme.upcase)
- scheme_list[uc].new(scheme, userinfo, host, port,
- registry, path, opaque, query,
- fragment, self)
+
+ if scheme && URI.scheme_list.include?(scheme.upcase)
+ URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
+ registry, path, opaque, query,
+ fragment, self)
else
Generic.new(scheme, userinfo, host, port,
registry, path, opaque, query,
@@ -94,9 +74,7 @@ module URI
@@to_s.bind(self).call
end
- private
-
- def default_regexp # :nodoc:
+ def regexp
{
SCHEME: /\A[A-Za-z][A-Za-z0-9+\-.]*\z/,
USERINFO: /\A(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*\z/,
@@ -110,6 +88,8 @@ module URI
}
end
+ private
+
def convert_to_uri(uri)
if uri.is_a?(URI::Generic)
uri
diff --git a/lib/weakref.rb b/lib/weakref.rb
index 824d4016e1..cdcbabf77c 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require "delegate"
# Weak Reference class that allows a referenced object to be
@@ -15,6 +14,53 @@ require "delegate"
# GC.start # start the garbage collector
# p foo.to_s # should raise exception (recycled)
#
+# == Example
+#
+# With help from WeakRef, we can implement our own rudimentary WeakHash class.
+#
+# We will call it WeakHash, since it's really just a Hash except all of it's
+# keys and values can be garbage collected.
+#
+# require 'weakref'
+#
+# class WeakHash < Hash
+# def []= key, obj
+# super WeakRef.new(key), WeakRef.new(obj)
+# end
+# end
+#
+# This is just a simple implementation, we've opened the Hash class and changed
+# Hash#store to create a new WeakRef object with +key+ and +obj+ parameters
+# before passing them as our key-value pair to the hash.
+#
+# With this you will have to limit your self to String keys, otherwise you
+# will get an ArgumentError because WeakRef cannot create a finalizer for a
+# Symbol. Symbols are immutable and cannot be garbage collected.
+#
+# Let's see it in action:
+#
+# omg = "lol"
+# c = WeakHash.new
+# c['foo'] = "bar"
+# c['baz'] = Object.new
+# c['qux'] = omg
+# puts c.inspect
+# #=> {"foo"=>"bar", "baz"=>#<Object:0x007f4ddfc6cb48>, "qux"=>"lol"}
+#
+# # Now run the garbage collector
+# GC.start
+# c['foo'] #=> nil
+# c['baz'] #=> nil
+# c['qux'] #=> nil
+# omg #=> "lol"
+#
+# puts c.inspect
+# #=> WeakRef::RefError: Invalid Reference - probably recycled
+#
+# You can see the local variable +omg+ stayed, although its reference in our
+# hash object was garbage collected, along with the rest of the keys and
+# values. Also, when we tried to inspect our hash, we got a WeakRef::RefError.
+# This is because these objects were also garbage collected.
class WeakRef < Delegator
@@ -31,7 +77,7 @@ class WeakRef < Delegator
# Creates a weak reference to +orig+
#
# Raises an ArgumentError if the given +orig+ is immutable, such as Symbol,
- # Integer, or Float.
+ # Fixnum, or Float.
def initialize(orig)
case orig
diff --git a/lib/webrick.rb b/lib/webrick.rb
index cbaf18a792..fd8522a6c5 100644
--- a/lib/webrick.rb
+++ b/lib/webrick.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
##
# = WEB server toolkit.
#
@@ -9,7 +8,7 @@
#
# A WEBrick server can be composed of multiple WEBrick servers or servlets to
# provide differing behavior on a per-host or per-path basis. WEBrick
-# includes servlets for handling CGI scripts, ERB pages, Ruby blocks and
+# includes servlets for handling CGI scripts, ERb pages, Ruby blocks and
# directory listings.
#
# WEBrick also includes tools for daemonizing a process and starting a process
diff --git a/lib/webrick/.document b/lib/webrick/.document
deleted file mode 100644
index c62f89083b..0000000000
--- a/lib/webrick/.document
+++ /dev/null
@@ -1,6 +0,0 @@
-# Add files to this as they become documented
-
-*.rb
-
-httpauth
-httpservlet
diff --git a/lib/webrick/accesslog.rb b/lib/webrick/accesslog.rb
index 17e5b38ac9..4df27efc29 100644
--- a/lib/webrick/accesslog.rb
+++ b/lib/webrick/accesslog.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# accesslog.rb -- Access log handling utilities
#
diff --git a/lib/webrick/cgi.rb b/lib/webrick/cgi.rb
index 33f1542731..80f636edc3 100644
--- a/lib/webrick/cgi.rb
+++ b/lib/webrick/cgi.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# cgi.rb -- Yet another CGI library
#
@@ -265,10 +264,6 @@ module WEBrick
@out_port << data
end
- def write(data)
- @out_port.write(data)
- end
-
def cert
return nil unless defined?(OpenSSL)
if pem = @env["SSL_SERVER_CERT"]
diff --git a/lib/webrick/compat.rb b/lib/webrick/compat.rb
index c497a1933c..d2bc3ef6b4 100644
--- a/lib/webrick/compat.rb
+++ b/lib/webrick/compat.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# compat.rb -- cross platform compatibility
#
diff --git a/lib/webrick/config.rb b/lib/webrick/config.rb
index af4b561534..c347da4be6 100644
--- a/lib/webrick/config.rb
+++ b/lib/webrick/config.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# config.rb -- Default configurations.
#
@@ -20,14 +19,8 @@ module WEBrick
LIBDIR = File::dirname(__FILE__) # :nodoc:
# for GenericServer
- General = Hash.new { |hash, key|
- case key
- when :ServerName
- hash[key] = Utils.getservername
- else
- nil
- end
- }.update(
+ General = {
+ :ServerName => Utils::getservername,
:BindAddress => nil, # "0.0.0.0" or "::" or nil
:Port => nil, # users MUST specify this!!
:MaxClients => 100, # maximum number of the concurrent connections
@@ -40,9 +33,9 @@ module WEBrick
:StartCallback => nil,
:StopCallback => nil,
:AcceptCallback => nil,
- :DoNotReverseLookup => true,
+ :DoNotReverseLookup => nil,
:ShutdownSocketWithoutClose => false,
- )
+ }
# for HTTPServer, HTTPRequest, HTTPResponse ...
HTTP = General.dup.update(
diff --git a/lib/webrick/cookie.rb b/lib/webrick/cookie.rb
index 24bf92ec00..d8df23133d 100644
--- a/lib/webrick/cookie.rb
+++ b/lib/webrick/cookie.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# cookie.rb -- Cookie class
#
@@ -113,7 +112,7 @@ module WEBrick
ret = []
cookie = nil
ver = 0
- str.split(/;\s+/).each{|x|
+ str.split(/[;,]\s+/).each{|x|
key, val = x.split(/=/,2)
val = val ? HTTPUtils::dequote(val) : ""
case key
diff --git a/lib/webrick/htmlutils.rb b/lib/webrick/htmlutils.rb
index ed9f4ac0d3..4cb3d0d7f6 100644
--- a/lib/webrick/htmlutils.rb
+++ b/lib/webrick/htmlutils.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# htmlutils.rb -- HTMLUtils Module
#
diff --git a/lib/webrick/httpauth.rb b/lib/webrick/httpauth.rb
index bbb6776528..96d479b2d7 100644
--- a/lib/webrick/httpauth.rb
+++ b/lib/webrick/httpauth.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth.rb -- HTTP access authentication
#
diff --git a/lib/webrick/httpauth/authenticator.rb b/lib/webrick/httpauth/authenticator.rb
index 8655118a04..f6d4ab844f 100644
--- a/lib/webrick/httpauth/authenticator.rb
+++ b/lib/webrick/httpauth/authenticator.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# httpauth/authenticator.rb -- Authenticator mix-in module.
#
diff --git a/lib/webrick/httpauth/basicauth.rb b/lib/webrick/httpauth/basicauth.rb
index e23420fdfa..3ff20b56d2 100644
--- a/lib/webrick/httpauth/basicauth.rb
+++ b/lib/webrick/httpauth/basicauth.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth/basicauth.rb -- HTTP basic access authentication
#
@@ -90,7 +89,8 @@ module WEBrick
end
##
- # Returns a challenge response which asks for authentication information
+ # Returns a challenge response which asks for for authentication
+ # information
def challenge(req, res)
res[@response_field] = "#{@auth_scheme} realm=\"#{@realm}\""
diff --git a/lib/webrick/httpauth/digestauth.rb b/lib/webrick/httpauth/digestauth.rb
index 94f849a02e..0eea94774f 100644
--- a/lib/webrick/httpauth/digestauth.rb
+++ b/lib/webrick/httpauth/digestauth.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth/digestauth.rb -- HTTP digest access authentication
#
@@ -111,7 +110,7 @@ module WEBrick
@instance_key = hexdigest(self.__id__, Time.now.to_i, Process.pid)
@opaques = {}
@last_nonce_expire = Time.now
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
end
##
@@ -129,7 +128,8 @@ module WEBrick
end
##
- # Returns a challenge response which asks for authentication information
+ # Returns a challenge response which asks for for authentication
+ # information
def challenge(req, res, stale=false)
nonce = generate_next_nonce(req)
@@ -235,11 +235,9 @@ module WEBrick
ha2 = hexdigest(req.request_method, auth_req['uri'])
ha2_res = hexdigest("", auth_req['uri'])
elsif auth_req['qop'] == "auth-int"
- body_digest = @h.new
- req.body { |chunk| body_digest.update(chunk) }
- body_digest = body_digest.hexdigest
- ha2 = hexdigest(req.request_method, auth_req['uri'], body_digest)
- ha2_res = hexdigest("", auth_req['uri'], body_digest)
+ ha2 = hexdigest(req.request_method, auth_req['uri'],
+ hexdigest(req.body))
+ ha2_res = hexdigest("", auth_req['uri'], hexdigest(res.body))
end
if auth_req['qop'] == "auth" || auth_req['qop'] == "auth-int"
@@ -314,7 +312,7 @@ module WEBrick
def generate_next_nonce(req)
now = "%012d" % req.request_time.to_i
pk = hexdigest(now, @instance_key)[0,32]
- nonce = [now + ":" + pk].pack("m0") # it has 60 length of chars.
+ nonce = [now + ":" + pk].pack("m*").chop # it has 60 length of chars.
nonce
end
diff --git a/lib/webrick/httpauth/htdigest.rb b/lib/webrick/httpauth/htdigest.rb
index c35b38433b..5fb0635e2a 100644
--- a/lib/webrick/httpauth/htdigest.rb
+++ b/lib/webrick/httpauth/htdigest.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth/htdigest.rb -- Apache compatible htdigest file
#
@@ -38,9 +37,9 @@ module WEBrick
@path = path
@mtime = Time.at(0)
@digest = Hash.new
- @mutex = Thread::Mutex::new
+ @mutex = Mutex::new
@auth_type = DigestAuth
- File.open(@path,"a").close unless File.exist?(@path)
+ open(@path,"a").close unless File::exist?(@path)
reload
end
@@ -51,7 +50,7 @@ module WEBrick
mtime = File::mtime(@path)
if mtime > @mtime
@digest.clear
- File.open(@path){|io|
+ open(@path){|io|
while line = io.gets
line.chomp!
user, realm, pass = line.split(/:/, 3)
@@ -79,7 +78,7 @@ module WEBrick
File::rename(tmp.path, output)
renamed = true
ensure
- tmp.close
+ tmp.close if !tmp.closed?
File.unlink(tmp.path) if !renamed
end
end
diff --git a/lib/webrick/httpauth/htgroup.rb b/lib/webrick/httpauth/htgroup.rb
index 399a62c37f..0ecabef820 100644
--- a/lib/webrick/httpauth/htgroup.rb
+++ b/lib/webrick/httpauth/htgroup.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth/htgroup.rb -- Apache compatible htgroup file
#
@@ -36,7 +35,7 @@ module WEBrick
@path = path
@mtime = Time.at(0)
@group = Hash.new
- File.open(@path,"a").close unless File.exist?(@path)
+ open(@path,"a").close unless File::exist?(@path)
reload
end
@@ -46,7 +45,7 @@ module WEBrick
def reload
if (mtime = File::mtime(@path)) > @mtime
@group.clear
- File.open(@path){|io|
+ open(@path){|io|
while line = io.gets
line.chomp!
group, members = line.split(/:\s*/)
diff --git a/lib/webrick/httpauth/htpasswd.rb b/lib/webrick/httpauth/htpasswd.rb
index 976eeeb13e..69b739fbfe 100644
--- a/lib/webrick/httpauth/htpasswd.rb
+++ b/lib/webrick/httpauth/htpasswd.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpauth/htpasswd -- Apache compatible htpasswd file
#
@@ -40,7 +39,7 @@ module WEBrick
@mtime = Time.at(0)
@passwd = Hash.new
@auth_type = BasicAuth
- File.open(@path,"a").close unless File.exist?(@path)
+ open(@path,"a").close unless File::exist?(@path)
reload
end
@@ -51,7 +50,7 @@ module WEBrick
mtime = File::mtime(@path)
if mtime > @mtime
@passwd.clear
- File.open(@path){|io|
+ open(@path){|io|
while line = io.gets
line.chomp!
case line
@@ -84,7 +83,7 @@ module WEBrick
File::rename(tmp.path, output)
renamed = true
ensure
- tmp.close
+ tmp.close if !tmp.closed?
File.unlink(tmp.path) if !renamed
end
end
diff --git a/lib/webrick/httpauth/userdb.rb b/lib/webrick/httpauth/userdb.rb
index 7a17715cdf..005c18dfd0 100644
--- a/lib/webrick/httpauth/userdb.rb
+++ b/lib/webrick/httpauth/userdb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# httpauth/userdb.rb -- UserDB mix-in module.
#
diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb
index be5531fec0..cbba2d80f7 100644
--- a/lib/webrick/httpproxy.rb
+++ b/lib/webrick/httpproxy.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpproxy.rb -- HTTPProxy Class
#
@@ -143,7 +142,7 @@ module WEBrick
if proxy = proxy_uri(req, res)
proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0"
if proxy.userinfo
- credentials = "Basic " + [proxy.userinfo].pack("m0")
+ credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
end
host, port = proxy.host, proxy.port
end
@@ -157,12 +156,12 @@ module WEBrick
os << proxy_request_line << CRLF
@logger.debug("CONNECT: > #{proxy_request_line}")
if credentials
- @logger.debug("CONNECT: sending credentials")
+ @logger.debug("CONNECT: sending a credentials")
os << "Proxy-Authorization: " << credentials << CRLF
end
os << CRLF
proxy_status_line = os.gets(LF)
- @logger.debug("CONNECT: read Status-Line from the upstream server")
+ @logger.debug("CONNECT: read a Status-Line form the upstream server")
@logger.debug("CONNECT: < #{proxy_status_line}")
if %r{^HTTP/\d+\.\d+\s+200\s*} =~ proxy_status_line
while line = os.gets(LF)
@@ -193,13 +192,13 @@ module WEBrick
begin
while fds = IO::select([ua, os])
if fds[0].member?(ua)
- buf = ua.readpartial(1024);
+ buf = ua.sysread(1024);
@logger.debug("CONNECT: #{buf.bytesize} byte from User-Agent")
- os.write(buf)
+ os.syswrite(buf)
elsif fds[0].member?(os)
- buf = os.readpartial(1024);
+ buf = os.sysread(1024);
@logger.debug("CONNECT: #{buf.bytesize} byte from #{host}:#{port}")
- ua.write(buf)
+ ua.syswrite(buf)
end
end
rescue
@@ -294,7 +293,7 @@ module WEBrick
if upstream = proxy_uri(req, res)
if upstream.userinfo
header['proxy-authorization'] =
- "Basic " + [upstream.userinfo].pack("m0")
+ "Basic " + [upstream.userinfo].pack("m").delete("\n")
end
return upstream
end
diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index b40bcb0d57..4dfaee99af 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httprequest.rb -- HTTPRequest Class
#
@@ -414,13 +413,9 @@ module WEBrick
MAX_URI_LENGTH = 2083 # :nodoc:
- # same as Mongrel, Thin and Puma
- MAX_HEADER_LENGTH = (112 * 1024) # :nodoc:
-
def read_request_line(socket)
@request_line = read_line(socket, MAX_URI_LENGTH) if socket
- @request_bytes = @request_line.bytesize
- if @request_bytes >= MAX_URI_LENGTH and @request_line[-1, 1] != LF
+ if @request_line.bytesize >= MAX_URI_LENGTH and @request_line[-1, 1] != LF
raise HTTPStatus::RequestURITooLarge
end
@request_time = Time.now
@@ -439,9 +434,6 @@ module WEBrick
if socket
while line = read_line(socket)
break if /\A(#{CRLF}|#{LF})\z/om =~ line
- if (@request_bytes += line.bytesize) > MAX_HEADER_LENGTH
- raise HTTPStatus::RequestEntityTooLarge, 'headers too large'
- end
@raw_header << line
end
end
@@ -509,16 +501,12 @@ module WEBrick
def read_chunked(socket, block)
chunk_size, = read_chunk_size(socket)
while chunk_size > 0
- begin
- sz = [ chunk_size, @buffer_size ].min
- data = read_data(socket, sz) # read chunk-data
- if data.nil? || data.bytesize != sz
- raise HTTPStatus::BadRequest, "bad chunk data size."
- end
- block.call(data)
- end while (chunk_size -= sz) > 0
-
+ data = read_data(socket, chunk_size) # read chunk-data
+ if data.nil? || data.bytesize != chunk_size
+ raise BadRequest, "bad chunk data size."
+ end
read_line(socket) # skip CRLF
+ block.call(data)
chunk_size, = read_chunk_size(socket)
end
read_header(socket) # trailer + CRLF
@@ -533,7 +521,7 @@ module WEBrick
}
rescue Errno::ECONNRESET
return nil
- rescue Timeout::Error
+ rescue TimeoutError
raise HTTPStatus::RequestTimeout
end
end
@@ -578,9 +566,7 @@ module WEBrick
if @forwarded_server = self["x-forwarded-server"]
@forwarded_server = @forwarded_server.split(",", 2).first
end
- if @forwarded_proto = self["x-forwarded-proto"]
- @forwarded_proto = @forwarded_proto.split(",", 2).first
- end
+ @forwarded_proto = self["x-forwarded-proto"]
if host_port = self["x-forwarded-host"]
host_port = host_port.split(",", 2).first
@forwarded_host, tmp = host_port.split(":", 2)
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb
index 6d77692140..e897e8c01b 100644
--- a/lib/webrick/httpresponse.rb
+++ b/lib/webrick/httpresponse.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpresponse.rb -- HTTPResponse Class
#
@@ -21,8 +20,6 @@ module WEBrick
# WEBrick HTTP Servlet.
class HTTPResponse
- class InvalidHeader < StandardError
- end
##
# HTTP Response version
@@ -289,19 +286,14 @@ module WEBrick
data = status_line()
@header.each{|key, value|
tmp = key.gsub(/\bwww|^te$|\b\w/){ $&.upcase }
- data << "#{tmp}: #{check_header(value)}" << CRLF
+ data << "#{tmp}: #{value}" << CRLF
}
@cookies.each{|cookie|
- data << "Set-Cookie: " << check_header(cookie.to_s) << CRLF
+ data << "Set-Cookie: " << cookie.to_s << CRLF
}
data << CRLF
- socket.write(data)
+ _write_data(socket, data)
end
- rescue InvalidHeader => e
- @header.clear
- @cookies.clear
- set_error e
- retry
end
##
@@ -310,8 +302,6 @@ module WEBrick
def send_body(socket) # :nodoc:
if @body.respond_to? :readpartial then
send_body_io(socket)
- elsif @body.respond_to?(:call) then
- send_body_proc(socket)
else
send_body_string(socket)
end
@@ -361,22 +351,6 @@ module WEBrick
host, port = @config[:ServerName], @config[:Port]
end
- error_body(backtrace, ex, host, port)
- end
-
- private
-
- def check_header(header_value)
- if header_value =~ /\r\n/
- raise InvalidHeader
- else
- header_value
- end
- end
-
- # :stopdoc:
-
- def error_body(backtrace, ex, host, port)
@body = ''
@body << <<-_end_of_html_
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
@@ -406,39 +380,33 @@ module WEBrick
_end_of_html_
end
+ private
+
+ # :stopdoc:
+
def send_body_io(socket)
begin
if @request_method == "HEAD"
# do nothing
elsif chunked?
- buf = ''
- begin
- @body.readpartial(@buffer_size, buf)
- size = buf.bytesize
- data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
- socket.write(data)
- data.clear
- @sent_size += size
- rescue EOFError
- break
- end while true
- buf.clear
- socket.write("0#{CRLF}#{CRLF}")
- else
- if %r{\Abytes (\d+)-(\d+)/\d+\z} =~ @header['content-range']
- offset = $1.to_i
- size = $2.to_i - offset + 1
- else
- offset = nil
- size = @header['content-length']
- size = size.to_i if size
- end
begin
- @sent_size = IO.copy_stream(@body, socket, size, offset)
- rescue NotImplementedError
- @body.seek(offset, IO::SEEK_SET)
- @sent_size = IO.copy_stream(@body, socket, size)
+ buf = ''
+ data = ''
+ while true
+ @body.readpartial( @buffer_size, buf ) # there is no need to clear buf?
+ data << format("%x", buf.bytesize) << CRLF
+ data << buf << CRLF
+ _write_data(socket, data)
+ data.clear
+ @sent_size += buf.bytesize
+ end
+ rescue EOFError # do nothing
end
+ _write_data(socket, "0#{CRLF}#{CRLF}")
+ else
+ size = @header['content-length'].to_i
+ _send_file(socket, @body, 0, size)
+ @sent_size = size
end
ensure
@body.close
@@ -452,60 +420,42 @@ module WEBrick
body ? @body.bytesize : 0
while buf = @body[@sent_size, @buffer_size]
break if buf.empty?
- size = buf.bytesize
- data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
- buf.clear
- socket.write(data)
- @sent_size += size
+ data = ""
+ data << format("%x", buf.bytesize) << CRLF
+ data << buf << CRLF
+ _write_data(socket, data)
+ @sent_size += buf.bytesize
end
- socket.write("0#{CRLF}#{CRLF}")
+ _write_data(socket, "0#{CRLF}#{CRLF}")
else
if @body && @body.bytesize > 0
- socket.write(@body)
+ _write_data(socket, @body)
@sent_size = @body.bytesize
end
end
end
- def send_body_proc(socket)
- if @request_method == "HEAD"
- # do nothing
- elsif chunked?
- @body.call(ChunkedWrapper.new(socket, self))
- socket.write("0#{CRLF}#{CRLF}")
- else
- size = @header['content-length'].to_i
- @body.call(socket)
- @sent_size = size
- end
- end
-
- class ChunkedWrapper
- def initialize(socket, resp)
- @socket = socket
- @resp = resp
- end
-
- def write(buf)
- return 0 if buf.empty?
- socket = @socket
- @resp.instance_eval {
- size = buf.bytesize
- data = "#{size.to_s(16)}#{CRLF}#{buf}#{CRLF}"
- socket.write(data)
- data.clear
- @sent_size += size
- size
- }
+ def _send_file(output, input, offset, size)
+ while offset > 0
+ sz = @buffer_size < size ? @buffer_size : size
+ buf = input.read(sz)
+ offset -= buf.bytesize
end
- def <<(*buf)
- write(buf)
- self
+ if size == 0
+ while buf = input.read(@buffer_size)
+ _write_data(output, buf)
+ end
+ else
+ while size > 0
+ sz = @buffer_size < size ? @buffer_size : size
+ buf = input.read(sz)
+ _write_data(output, buf)
+ size -= buf.bytesize
+ end
end
end
- # preserved for compatibility with some 3rd-party handlers
def _write_data(socket, data)
socket << data
end
diff --git a/lib/webrick/https.rb b/lib/webrick/https.rb
index 4826654d3a..9194f9411c 100644
--- a/lib/webrick/https.rb
+++ b/lib/webrick/https.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# https.rb -- SSL/TLS enhancement for HTTPServer
#
@@ -10,7 +9,6 @@
# $IPR: https.rb,v 1.15 2003/07/22 19:20:42 gotoyuzo Exp $
require 'webrick/ssl'
-require 'webrick/httpserver'
module WEBrick
module Config
@@ -85,68 +83,4 @@ module WEBrick
# :startdoc:
end
-
- ##
- #--
- # Fake WEBrick::HTTPRequest for lookup_server
-
- class SNIRequest
-
- ##
- # The SNI hostname
-
- attr_reader :host
-
- ##
- # The socket address of the server
-
- attr_reader :addr
-
- ##
- # The port this request is for
-
- attr_reader :port
-
- ##
- # Creates a new SNIRequest.
-
- def initialize(sslsocket, hostname)
- @host = hostname
- @addr = sslsocket.addr
- @port = @addr[1]
- end
- end
-
-
- ##
- #--
- # Adds SSL functionality to WEBrick::HTTPServer
-
- class HTTPServer < ::WEBrick::GenericServer
- ##
- # ServerNameIndication callback
-
- def ssl_servername_callback(sslsocket, hostname = nil)
- req = SNIRequest.new(sslsocket, hostname)
- server = lookup_server(req)
- server ? server.ssl_context : nil
- end
-
- # :stopdoc:
-
- ##
- # Check whether +server+ is also SSL server.
- # Also +server+'s SSL context will be created.
-
- alias orig_virtual_host virtual_host
-
- def virtual_host(server)
- if @config[:SSLEnable] && !server.ssl_context
- raise ArgumentError, "virtual host must set SSLEnable to true"
- end
- orig_virtual_host(server)
- end
-
- # :startdoc:
- end
end
diff --git a/lib/webrick/httpserver.rb b/lib/webrick/httpserver.rb
index e46b3bd1ad..0618489c53 100644
--- a/lib/webrick/httpserver.rb
+++ b/lib/webrick/httpserver.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpserver.rb -- HTTPServer Class
#
@@ -9,7 +8,6 @@
#
# $IPR: httpserver.rb,v 1.63 2002/10/01 17:16:32 gotoyuzo Exp $
-require 'io/wait'
require 'webrick/server'
require 'webrick/httputils'
require 'webrick/httpstatus'
@@ -74,7 +72,7 @@ module WEBrick
begin
timeout = @config[:RequestTimeout]
while timeout > 0
- break if sock.to_io.wait_readable(0.5)
+ break if IO.select([sock], nil, nil, 0.5)
break if @status != :Running
timeout -= 0.5
end
@@ -267,12 +265,12 @@ module WEBrick
k.sort!
k.reverse!
k.collect!{|path| Regexp.escape(path) }
- @scanner = Regexp.new("\\A(" + k.join("|") +")(?=/|\\z)")
+ @scanner = Regexp.new("^(" + k.join("|") +")(?=/|$)")
end
def normalize(dir)
ret = dir ? dir.dup : ""
- ret.sub!(%r|/+\z|, "")
+ ret.sub!(%r|/+$|, "")
ret
end
end
diff --git a/lib/webrick/httpservlet.rb b/lib/webrick/httpservlet.rb
index 1ee04ec86f..ac7c022bd7 100644
--- a/lib/webrick/httpservlet.rb
+++ b/lib/webrick/httpservlet.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpservlet.rb -- HTTPServlet Utility File
#
diff --git a/lib/webrick/httpservlet/abstract.rb b/lib/webrick/httpservlet/abstract.rb
index fc4cd2275a..d3b00ab4e1 100644
--- a/lib/webrick/httpservlet/abstract.rb
+++ b/lib/webrick/httpservlet/abstract.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httpservlet.rb -- HTTPServlet Module
#
@@ -9,6 +8,8 @@
#
# $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $
+require 'thread'
+
require 'webrick/htmlutils'
require 'webrick/httputils'
require 'webrick/httpstatus'
diff --git a/lib/webrick/httpservlet/cgi_runner.rb b/lib/webrick/httpservlet/cgi_runner.rb
index 0398c16749..32ecb6fe00 100644
--- a/lib/webrick/httpservlet/cgi_runner.rb
+++ b/lib/webrick/httpservlet/cgi_runner.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# cgi_runner.rb -- CGI launcher.
#
@@ -23,11 +22,11 @@ STDIN.binmode
len = sysread(STDIN, 8).to_i
out = sysread(STDIN, len)
-STDOUT.reopen(File.open(out, "w"))
+STDOUT.reopen(open(out, "w"))
len = sysread(STDIN, 8).to_i
err = sysread(STDIN, len)
-STDERR.reopen(File.open(err, "w"))
+STDERR.reopen(open(err, "w"))
len = sysread(STDIN, 8).to_i
dump = sysread(STDIN, len)
diff --git a/lib/webrick/httpservlet/cgihandler.rb b/lib/webrick/httpservlet/cgihandler.rb
index b1fb471c54..32100418e6 100644
--- a/lib/webrick/httpservlet/cgihandler.rb
+++ b/lib/webrick/httpservlet/cgihandler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# cgihandler.rb -- CGIHandler Class
#
@@ -52,7 +51,6 @@ module WEBrick
meta = req.meta_vars
meta["SCRIPT_FILENAME"] = @script_filename
meta["PATH"] = @config[:CGIPathEnv]
- meta.delete("HTTP_PROXY")
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
meta["SystemRoot"] = ENV["SystemRoot"]
end
@@ -65,7 +63,9 @@ module WEBrick
cgi_in.write("%8d" % dump.bytesize)
cgi_in.write(dump)
- req.body { |chunk| cgi_in.write(chunk) }
+ if req.body and req.body.bytesize > 0
+ cgi_in.write(req.body)
+ end
ensure
cgi_in.close
status = $?.exitstatus
diff --git a/lib/webrick/httpservlet/erbhandler.rb b/lib/webrick/httpservlet/erbhandler.rb
index aa02ce8a1d..1b8a82d67b 100644
--- a/lib/webrick/httpservlet/erbhandler.rb
+++ b/lib/webrick/httpservlet/erbhandler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# erbhandler.rb -- ERBHandler Class
#
@@ -53,7 +52,7 @@ module WEBrick
raise HTTPStatus::Forbidden, "ERBHandler cannot work."
end
begin
- data = File.open(@script_filename, &:read)
+ data = open(@script_filename){|io| io.read }
res.body = evaluate(ERB.new(data), req, res)
res['content-type'] ||=
HTTPUtils::mime_type(@script_filename, @config[:MimeTypes])
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 0072e81ac6..cc9db4a870 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# filehandler.rb -- FileHandler Module
#
@@ -9,6 +8,7 @@
#
# $IPR: filehandler.rb,v 1.44 2003/06/07 01:34:51 gotoyuzo Exp $
+require 'thread'
require 'time'
require 'webrick/htmlutils'
@@ -57,7 +57,7 @@ module WEBrick
res['content-type'] = mtype
res['content-length'] = st.size
res['last-modified'] = mtime.httpdate
- res.body = File.open(@local_path, "rb")
+ res.body = open(@local_path, "rb")
end
end
@@ -86,66 +86,47 @@ module WEBrick
return false
end
- # returns a lambda for webrick/httpresponse.rb send_body_proc
- def multipart_body(body, parts, boundary, mtype, filesize)
- lambda do |socket|
- begin
- begin
- first = parts.shift
- last = parts.shift
- socket.write(
- "--#{boundary}#{CRLF}" \
- "Content-Type: #{mtype}#{CRLF}" \
- "Content-Range: bytes #{first}-#{last}/#{filesize}#{CRLF}" \
- "#{CRLF}"
- )
-
- begin
- IO.copy_stream(body, socket, last - first + 1, first)
- rescue NotImplementedError
- body.seek(first, IO::SEEK_SET)
- IO.copy_stream(body, socket, last - first + 1)
- end
- socket.write(CRLF)
- end while parts[0]
- socket.write("--#{boundary}--#{CRLF}")
- ensure
- body.close
- end
- end
- end
-
def make_partial_content(req, res, filename, filesize)
mtype = HTTPUtils::mime_type(filename, @config[:MimeTypes])
unless ranges = HTTPUtils::parse_range_header(req['range'])
raise HTTPStatus::BadRequest,
"Unrecognized range-spec: \"#{req['range']}\""
end
- File.open(filename, "rb"){|io|
+ open(filename, "rb"){|io|
if ranges.size > 1
time = Time.now
boundary = "#{time.sec}_#{time.usec}_#{Process::pid}"
- parts = []
- ranges.each {|range|
- prange = prepare_range(range, filesize)
- next if prange[0] < 0
- parts.concat(prange)
+ body = ''
+ ranges.each{|range|
+ first, last = prepare_range(range, filesize)
+ next if first < 0
+ io.pos = first
+ content = io.read(last-first+1)
+ body << "--" << boundary << CRLF
+ body << "Content-Type: #{mtype}" << CRLF
+ body << "Content-Range: bytes #{first}-#{last}/#{filesize}" << CRLF
+ body << CRLF
+ body << content
+ body << CRLF
}
- raise HTTPStatus::RequestRangeNotSatisfiable if parts.empty?
+ raise HTTPStatus::RequestRangeNotSatisfiable if body.empty?
+ body << "--" << boundary << "--" << CRLF
res["content-type"] = "multipart/byteranges; boundary=#{boundary}"
- if req.http_version < '1.1'
- res['connection'] = 'close'
- else
- res.chunked = true
- end
- res.body = multipart_body(io.dup, parts, boundary, mtype, filesize)
+ res.body = body
elsif range = ranges[0]
first, last = prepare_range(range, filesize)
raise HTTPStatus::RequestRangeNotSatisfiable if first < 0
+ if last == filesize - 1
+ content = io.dup
+ content.pos = first
+ else
+ io.pos = first
+ content = io.read(last-first+1)
+ end
res['content-type'] = mtype
res['content-range'] = "bytes #{first}-#{last}/#{filesize}"
res['content-length'] = last - first + 1
- res.body = io.dup
+ res.body = content
else
raise HTTPStatus::BadRequest
end
@@ -169,8 +150,7 @@ module WEBrick
#
# Example:
#
- # server.mount('/assets', WEBrick::HTTPServlet::FileHandler,
- # '/path/to/assets')
+ # server.mount '/assets', WEBrick::FileHandler, '/path/to/assets'
class FileHandler < AbstractServlet
HandlerTable = Hash.new # :nodoc:
diff --git a/lib/webrick/httpservlet/prochandler.rb b/lib/webrick/httpservlet/prochandler.rb
index c1f454e2f6..2f5aa66f45 100644
--- a/lib/webrick/httpservlet/prochandler.rb
+++ b/lib/webrick/httpservlet/prochandler.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# prochandler.rb -- ProcHandler Class
#
diff --git a/lib/webrick/httpstatus.rb b/lib/webrick/httpstatus.rb
index 0630219ada..78abb1bf12 100644
--- a/lib/webrick/httpstatus.rb
+++ b/lib/webrick/httpstatus.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# httpstatus.rb -- HTTPStatus Class
#
@@ -9,8 +8,6 @@
#
# $IPR: httpstatus.rb,v 1.11 2003/03/24 20:18:55 gotoyuzo Exp $
-require 'webrick/accesslog'
-
module WEBrick
##
@@ -23,6 +20,10 @@ module WEBrick
##
# Root of the HTTP status class hierarchy
class Status < StandardError
+ def initialize(*args) # :nodoc:
+ args[0] = AccessLog.escape(args[0]) unless args.empty?
+ super(*args)
+ end
class << self
attr_reader :code, :reason_phrase # :nodoc:
end
@@ -95,7 +96,6 @@ module WEBrick
428 => 'Precondition Required',
429 => 'Too Many Requests',
431 => 'Request Header Fields Too Large',
- 451 => 'Unavailable For Legal Reasons',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
diff --git a/lib/webrick/httputils.rb b/lib/webrick/httputils.rb
index a4cd3b48ee..a5f0632b86 100644
--- a/lib/webrick/httputils.rb
+++ b/lib/webrick/httputils.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# httputils.rb -- HTTPUtils Module
#
@@ -69,7 +68,6 @@ module WEBrick
"jpeg" => "image/jpeg",
"jpg" => "image/jpeg",
"js" => "application/javascript",
- "json" => "application/json",
"lha" => "application/octet-stream",
"lzh" => "application/octet-stream",
"mov" => "video/quicktime",
@@ -108,8 +106,6 @@ module WEBrick
# Loads Apache-compatible mime.types in +file+.
def load_mime_types(file)
- # note: +file+ may be a "| command" for now; some people may
- # rely on this, but currently we do not use this method by default.
open(file){ |io|
hash = Hash.new
io.each{ |line|
diff --git a/lib/webrick/httpversion.rb b/lib/webrick/httpversion.rb
index 8a251944a2..cdfb957296 100644
--- a/lib/webrick/httpversion.rb
+++ b/lib/webrick/httpversion.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# HTTPVersion.rb -- presentation of HTTP version
#
diff --git a/lib/webrick/log.rb b/lib/webrick/log.rb
index 2c1fdfe602..41cde4a740 100644
--- a/lib/webrick/log.rb
+++ b/lib/webrick/log.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# log.rb -- Log Class
#
@@ -51,7 +50,7 @@ module WEBrick
@level = level || INFO
case log_file
when String
- @log = File.open(log_file, "a+")
+ @log = open(log_file, "a+")
@log.sync = true
@opened = true
when NilClass
@@ -118,10 +117,10 @@ module WEBrick
# * Otherwise it will return +arg+.inspect.
def format(arg)
if arg.is_a?(Exception)
- "#{arg.class}: #{AccessLog.escape(arg.message)}\n\t" <<
+ "#{arg.class}: #{arg.message}\n\t" <<
arg.backtrace.join("\n\t") << "\n"
elsif arg.respond_to?(:to_str)
- AccessLog.escape(arg.to_str)
+ arg.to_str
else
arg.inspect
end
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index 88e160d981..7a3632b0b5 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# server.rb -- GenericServer Class
#
@@ -9,6 +8,7 @@
#
# $IPR: server.rb,v 1.62 2003/07/22 19:20:43 gotoyuzo Exp $
+require 'thread'
require 'socket'
require 'webrick/config'
require 'webrick/log'
@@ -43,8 +43,14 @@ module WEBrick
# block, if given.
def Daemon.start
- Process.daemon
- File.umask(0)
+ exit!(0) if fork
+ Process::setsid
+ exit!(0) if fork
+ Dir::chdir("/")
+ File::umask(0)
+ STDIN.reopen("/dev/null")
+ STDOUT.reopen("/dev/null", "w")
+ STDERR.reopen("/dev/null", "w")
yield if block_given?
end
end
@@ -91,7 +97,7 @@ module WEBrick
@config[:Logger] ||= Log::new
@logger = @config[:Logger]
- @tokens = Thread::SizedQueue.new(@config[:MaxClients])
+ @tokens = SizedQueue.new(@config[:MaxClients])
@config[:MaxClients].times{ @tokens.push(nil) }
webrickv = WEBrick::VERSION
@@ -100,16 +106,16 @@ module WEBrick
@logger.info("ruby #{rubyv}")
@listeners = []
- @shutdown_pipe = nil
unless @config[:DoNotListen]
if @config[:Listen]
- warn(":Listen option is deprecated; use GenericServer#listen", uplevel: 1)
+ warn(":Listen option is deprecated; use GenericServer#listen")
end
listen(@config[:BindAddress], @config[:Port])
if @config[:Port] == 0
@config[:Port] = @listeners[0].addr[1]
end
end
+ @shutdown_pipe_w = nil
end
##
@@ -124,7 +130,7 @@ module WEBrick
# WEBrick::Utils::create_listeners for details.
def listen(address, port)
- @listeners += Utils::create_listeners(address, port)
+ @listeners += Utils::create_listeners(address, port, @logger)
end
##
@@ -152,35 +158,27 @@ module WEBrick
raise ServerError, "already started." if @status != :Stop
server_type = @config[:ServerType] || SimpleServer
- setup_shutdown_pipe
+ shutdown_pipe_r, shutdown_pipe_w = IO.pipe
+ @shutdown_pipe_w = shutdown_pipe_w
server_type.start{
@logger.info \
"#{self.class}#start: pid=#{$$} port=#{@config[:Port]}"
- @status = :Running
call_callback(:StartCallback)
- shutdown_pipe = @shutdown_pipe
-
thgroup = ThreadGroup.new
+ @status = :Running
begin
while @status == :Running
begin
- sp = shutdown_pipe[0]
- if svrs = IO.select([sp, *@listeners])
- if svrs[0].include? sp
- # swallow shutdown pipe
- buf = String.new
- nil while String ===
- sp.read_nonblock([sp.nread, 8].max, buf, exception: false)
- break
+ if svrs = IO.select([shutdown_pipe_r, *@listeners], nil, nil, 2.0)
+ if svrs[0].include? shutdown_pipe_r
+ return
end
svrs[0].each{|svr|
@tokens.pop # blocks while no token is there.
if sock = accept_client(svr)
- unless config[:DoNotReverseLookup].nil?
- sock.do_not_reverse_lookup = !!config[:DoNotReverseLookup]
- end
+ sock.do_not_reverse_lookup = config[:DoNotReverseLookup]
th = start_thread(sock, &block)
th[:WEBrickThread] = true
thgroup.add(th)
@@ -200,9 +198,16 @@ module WEBrick
raise
end
end
+
ensure
- cleanup_shutdown_pipe(shutdown_pipe)
- cleanup_listener
+ shutdown_pipe_r.close
+ if !shutdown_pipe_w.closed?
+ begin
+ shutdown_pipe_w.close
+ rescue IOError # Another thread closed shutdown_pipe_w.
+ end
+ end
+ @shutdown_pipe_w = nil
@status = :Shutdown
@logger.info "going to shutdown ..."
thgroup.list.each{|th| th.join if th[:WEBrickThread] }
@@ -220,8 +225,6 @@ module WEBrick
if @status == :Running
@status = :Shutdown
end
-
- alarm_shutdown_pipe {|f| f.write_nonblock("\0")}
end
##
@@ -231,7 +234,34 @@ module WEBrick
def shutdown
stop
- alarm_shutdown_pipe(&:close)
+ shutdown_pipe_w = @shutdown_pipe_w
+ @shutdown_pipe_w = nil
+ if shutdown_pipe_w && !shutdown_pipe_w.closed?
+ begin
+ shutdown_pipe_w.close
+ rescue IOError # Another thread closed shutdown_pipe_w.
+ end
+ end
+
+ @listeners.each{|s|
+ if @logger.debug?
+ addr = s.addr
+ @logger.debug("close TCPSocket(#{addr[2]}, #{addr[1]})")
+ end
+ begin
+ s.shutdown
+ rescue Errno::ENOTCONN
+ # when `Errno::ENOTCONN: Socket is not connected' on some platforms,
+ # call #close instead of #shutdown.
+ # (ignore @config[:ShutdownSocketWithoutClose])
+ s.close
+ else
+ unless @config[:ShutdownSocketWithoutClose]
+ s.close
+ end
+ end
+ }
+ @listeners.clear
end
##
@@ -251,26 +281,19 @@ module WEBrick
# the client socket.
def accept_client(svr)
- case sock = svr.to_io.accept_nonblock(exception: false)
- when :wait_readable
- nil
- else
- if svr.respond_to?(:start_immediately)
- sock = OpenSSL::SSL::SSLSocket.new(sock, ssl_context)
- sock.sync_close = true
- # we cannot do OpenSSL::SSL::SSLSocket#accept here because
- # a slow client can prevent us from accepting connections
- # from other clients
- end
- sock
+ sock = nil
+ begin
+ sock = svr.accept
+ sock.sync = true
+ Utils::set_non_blocking(sock)
+ Utils::set_close_on_exec(sock)
+ rescue Errno::ECONNRESET, Errno::ECONNABORTED,
+ Errno::EPROTO, Errno::EINVAL
+ rescue StandardError => ex
+ msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
+ @logger.error msg
end
- rescue Errno::ECONNRESET, Errno::ECONNABORTED,
- Errno::EPROTO, Errno::EINVAL
- nil
- rescue StandardError => ex
- msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
- @logger.error msg
- nil
+ return sock
end
##
@@ -293,16 +316,6 @@ module WEBrick
@logger.debug "accept: <address unknown>"
raise
end
- if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately]
- WEBrick::Utils.timeout(@config[:RequestTimeout]) do
- begin
- sock.accept # OpenSSL::SSL::SSLSocket#accept
- rescue Errno::ECONNRESET, Errno::ECONNABORTED,
- Errno::EPROTO, Errno::EINVAL
- Thread.exit
- end
- end
- end
call_callback(:AcceptCallback, sock)
block ? block.call(sock) : run(sock)
rescue Errno::ENOTCONN
@@ -320,7 +333,7 @@ module WEBrick
else
@logger.debug "close: <address unknown>"
end
- sock.close
+ sock.close unless sock.closed?
end
}
end
@@ -329,50 +342,9 @@ module WEBrick
# Calls the callback +callback_name+ from the configuration with +args+
def call_callback(callback_name, *args)
- @config[callback_name]&.call(*args)
- end
-
- def setup_shutdown_pipe
- return @shutdown_pipe ||= IO.pipe
- end
-
- def cleanup_shutdown_pipe(shutdown_pipe)
- @shutdown_pipe = nil
- shutdown_pipe&.each(&:close)
- end
-
- def alarm_shutdown_pipe
- _, pipe = @shutdown_pipe # another thread may modify @shutdown_pipe.
- if pipe
- if !pipe.closed?
- begin
- yield pipe
- rescue IOError # closed by another thread.
- end
- end
+ if cb = @config[callback_name]
+ cb.call(*args)
end
end
-
- def cleanup_listener
- @listeners.each{|s|
- if @logger.debug?
- addr = s.addr
- @logger.debug("close TCPSocket(#{addr[2]}, #{addr[1]})")
- end
- begin
- s.shutdown
- rescue Errno::ENOTCONN
- # when `Errno::ENOTCONN: Socket is not connected' on some platforms,
- # call #close instead of #shutdown.
- # (ignore @config[:ShutdownSocketWithoutClose])
- s.close
- else
- unless @config[:ShutdownSocketWithoutClose]
- s.close
- end
- end
- }
- @listeners.clear
- end
end # end of GenericServer
end
diff --git a/lib/webrick/ssl.rb b/lib/webrick/ssl.rb
index 8a334eaff1..5e296dbae2 100644
--- a/lib/webrick/ssl.rb
+++ b/lib/webrick/ssl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# ssl.rb -- SSL/TLS enhancement for GenericServer
#
@@ -48,14 +47,10 @@ module WEBrick
# Number of CA certificates to walk when verifying a certificate chain
# :SSLVerifyCallback ::
# Custom certificate verification callback
- # :SSLServerNameCallback::
- # Custom servername indication callback
# :SSLTimeout ::
# Maximum session lifetime
# :SSLOptions ::
# Various SSL options
- # :SSLCiphers ::
- # Ciphers to be used
# :SSLStartImmediately ::
# Immediately start SSL upon connection? Defaults to true
# :SSLCertName ::
@@ -80,7 +75,6 @@ module WEBrick
:SSLVerifyCallback => nil, # custom verification
:SSLTimeout => nil,
:SSLOptions => nil,
- :SSLCiphers => nil,
:SSLStartImmediately => true,
# Must specify if you use auto generated certificate.
:SSLCertName => nil,
@@ -110,8 +104,7 @@ module WEBrick
cert = OpenSSL::X509::Certificate.new
cert.version = 2
cert.serial = 1
- name = (cn.kind_of? String) ? OpenSSL::X509::Name.parse(cn)
- : OpenSSL::X509::Name.new(cn)
+ name = OpenSSL::X509::Name.new(cn)
cert.subject = name
cert.issuer = name
cert.not_before = Time.now
@@ -147,13 +140,7 @@ module WEBrick
# SSL context for the server when run in SSL mode
def ssl_context # :nodoc:
- @ssl_context ||= begin
- if @config[:SSLEnable]
- ssl_context = setup_ssl_context(@config)
- @logger.info("\n" + @config[:SSLCertificate].to_text)
- ssl_context
- end
- end
+ @ssl_context ||= nil
end
undef listen
@@ -162,8 +149,12 @@ module WEBrick
# Updates +listen+ to enable SSL when the SSL configuration is active.
def listen(address, port) # :nodoc:
- listeners = Utils::create_listeners(address, port)
+ listeners = Utils::create_listeners(address, port, @logger)
if @config[:SSLEnable]
+ unless ssl_context
+ @ssl_context = setup_ssl_context(@config)
+ @logger.info("\n" + @config[:SSLCertificate].to_text)
+ end
listeners.collect!{|svr|
ssvr = ::OpenSSL::SSL::SSLServer.new(svr, ssl_context)
ssvr.start_immediately = @config[:SSLStartImmediately]
@@ -171,7 +162,6 @@ module WEBrick
}
end
@listeners += listeners
- setup_shutdown_pipe
end
##
@@ -197,19 +187,9 @@ module WEBrick
ctx.verify_mode = config[:SSLVerifyClient]
ctx.verify_depth = config[:SSLVerifyDepth]
ctx.verify_callback = config[:SSLVerifyCallback]
- ctx.servername_cb = config[:SSLServerNameCallback] || proc { |args| ssl_servername_callback(*args) }
ctx.timeout = config[:SSLTimeout]
ctx.options = config[:SSLOptions]
- ctx.ciphers = config[:SSLCiphers]
ctx
end
-
- ##
- # ServerNameIndication callback
-
- def ssl_servername_callback(sslsocket, hostname = nil)
- # default
- end
-
end
end
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index 07044876b9..606ede5ac3 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# utils.rb -- Miscellaneous utilities
#
@@ -10,7 +9,7 @@
# $IPR: utils.rb,v 1.10 2003/02/16 22:22:54 gotoyuzo Exp $
require 'socket'
-require 'io/nonblock'
+require 'fcntl'
require 'etc'
module WEBrick
@@ -18,14 +17,20 @@ module WEBrick
##
# Sets IO operations on +io+ to be non-blocking
def set_non_blocking(io)
- io.nonblock = true if io.respond_to?(:nonblock=)
+ flag = File::NONBLOCK
+ if defined?(Fcntl::F_GETFL)
+ flag |= io.fcntl(Fcntl::F_GETFL)
+ end
+ io.fcntl(Fcntl::F_SETFL, flag)
end
module_function :set_non_blocking
##
# Sets the close on exec flag for +io+
def set_close_on_exec(io)
- io.close_on_exec = true if io.respond_to?(:close_on_exec=)
+ if defined?(Fcntl::FD_CLOEXEC)
+ io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
+ end
end
module_function :set_close_on_exec
@@ -37,7 +42,7 @@ module WEBrick
Process::Sys::setgid(pw.gid)
Process::Sys::setuid(pw.uid)
else
- warn("WEBrick::Utils::su doesn't work on this platform", uplevel: 1)
+ warn("WEBrick::Utils::su doesn't work on this platform")
end
end
module_function :su
@@ -58,7 +63,7 @@ module WEBrick
# Creates TCP server sockets bound to +address+:+port+ and returns them.
#
# It will create IPV4 and IPV6 sockets on all interfaces.
- def create_listeners(address, port)
+ def create_listeners(address, port, logger=nil)
unless port
raise ArgumentError, "must specify port"
end
@@ -91,6 +96,7 @@ module WEBrick
###########
+ require "thread"
require "timeout"
require "singleton"
@@ -123,9 +129,11 @@ module WEBrick
class TimeoutHandler
include Singleton
+ class Thread < ::Thread; end
+
##
# Mutex used to synchronize access across threads
- TimeoutMutex = Thread::Mutex.new # :nodoc:
+ TimeoutMutex = Mutex.new # :nodoc:
##
# Registers a new timeout handler
@@ -133,82 +141,48 @@ module WEBrick
# +time+:: Timeout in seconds
# +exception+:: Exception to raise when timeout elapsed
def TimeoutHandler.register(seconds, exception)
- at = Process.clock_gettime(Process::CLOCK_MONOTONIC) + seconds
- instance.register(Thread.current, at, exception)
+ TimeoutMutex.synchronize{
+ instance.register(Thread.current, Time.now + seconds, exception)
+ }
end
##
# Cancels the timeout handler +id+
def TimeoutHandler.cancel(id)
- instance.cancel(Thread.current, id)
- end
-
- def self.terminate
- instance.terminate
+ TimeoutMutex.synchronize{
+ instance.cancel(Thread.current, id)
+ }
end
##
# Creates a new TimeoutHandler. You should use ::register and ::cancel
# instead of creating the timeout handler directly.
def initialize
- TimeoutMutex.synchronize{
- @timeout_info = Hash.new
- }
- @queue = Thread::Queue.new
- @watcher = nil
- end
-
- # :nodoc:
- private \
- def watch
- to_interrupt = []
+ @timeout_info = Hash.new
+ Thread.start{
while true
- now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
- wakeup = nil
- to_interrupt.clear
- TimeoutMutex.synchronize{
- @timeout_info.each {|thread, ary|
- next unless ary
- ary.each{|info|
- time, exception = *info
- if time < now
- to_interrupt.push [thread, info.object_id, exception]
- elsif !wakeup || time < wakeup
- wakeup = time
- end
- }
+ now = Time.now
+ @timeout_info.keys.each{|thread|
+ ary = @timeout_info[thread]
+ next unless ary
+ ary.dup.each{|info|
+ time, exception = *info
+ interrupt(thread, info.object_id, exception) if time < now
}
}
- to_interrupt.each {|arg| interrupt(*arg)}
- if !wakeup
- @queue.pop
- elsif (wakeup -= now) > 0
- begin
- (th = Thread.start {@queue.pop}).join(wakeup)
- ensure
- th&.kill&.join
- end
- end
- @queue.clear
+ sleep 0.5
end
- end
-
- # :nodoc:
- private \
- def watcher
- (w = @watcher)&.alive? and return w # usual case
- TimeoutMutex.synchronize{
- (w = @watcher)&.alive? and next w # pathological check
- @watcher = Thread.start(&method(:watch))
- }
- end
+ }
+ end
##
# Interrupts the timeout handler +id+ and raises +exception+
def interrupt(thread, id, exception)
- if cancel(thread, id) && thread.alive?
- thread.raise(exception, "execution timeout")
- end
+ TimeoutMutex.synchronize{
+ if cancel(thread, id) && thread.alive?
+ thread.raise(exception, "execution timeout")
+ end
+ }
end
##
@@ -217,36 +191,22 @@ module WEBrick
# +time+:: Timeout in seconds
# +exception+:: Exception to raise when timeout elapsed
def register(thread, time, exception)
- info = nil
- TimeoutMutex.synchronize{
- (@timeout_info[thread] ||= []) << (info = [time, exception])
- }
- @queue.push nil
- watcher
- return info.object_id
+ @timeout_info[thread] ||= Array.new
+ @timeout_info[thread] << [time, exception]
+ return @timeout_info[thread].last.object_id
end
##
# Cancels the timeout handler +id+
def cancel(thread, id)
- TimeoutMutex.synchronize{
- if ary = @timeout_info[thread]
- ary.delete_if{|info| info.object_id == id }
- if ary.empty?
- @timeout_info.delete(thread)
- end
- return true
+ if ary = @timeout_info[thread]
+ ary.delete_if{|info| info.object_id == id }
+ if ary.empty?
+ @timeout_info.delete(thread)
end
- return false
- }
- end
-
- ##
- def terminate
- TimeoutMutex.synchronize{
- @timeout_info.clear
- @watcher&.kill&.join
- }
+ return true
+ end
+ return false
end
end
diff --git a/lib/webrick/version.rb b/lib/webrick/version.rb
index ee6b415eef..48bdc6d94d 100644
--- a/lib/webrick/version.rb
+++ b/lib/webrick/version.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#--
# version.rb -- version and release date
#
@@ -14,5 +13,5 @@ module WEBrick
##
# The WEBrick version
- VERSION = "1.4.2"
+ VERSION = "1.3.1"
end
diff --git a/lib/webrick/webrick.gemspec b/lib/webrick/webrick.gemspec
deleted file mode 100644
index 3f859c410b..0000000000
--- a/lib/webrick/webrick.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-require_relative 'version'
-
-Gem::Specification.new do |s|
- s.name = "webrick"
- s.version = WEBrick::VERSION
- s.date = '2017-12-24'
- s.summary = "HTTP server toolkit"
- s.description = "WEBrick is an HTTP server toolkit that can be configured as an HTTPS server, a proxy server, and a virtual-host server."
-
- s.require_path = %w{lib}
- s.files = ["lib/webrick.rb", "lib/webrick/accesslog.rb", "lib/webrick/cgi.rb", "lib/webrick/compat.rb", "lib/webrick/config.rb", "lib/webrick/cookie.rb", "lib/webrick/htmlutils.rb", "lib/webrick/httpauth.rb", "lib/webrick/httpauth/authenticator.rb", "lib/webrick/httpauth/basicauth.rb", "lib/webrick/httpauth/digestauth.rb", "lib/webrick/httpauth/htdigest.rb", "lib/webrick/httpauth/htgroup.rb", "lib/webrick/httpauth/htpasswd.rb", "lib/webrick/httpauth/userdb.rb", "lib/webrick/httpauth.rb", "lib/webrick/httpproxy.rb", "lib/webrick/httprequest.rb", "lib/webrick/httpresponse.rb", "lib/webrick/https.rb", "lib/webrick/httpserver.rb", "lib/webrick/httpservlet.rb", "lib/webrick/httpservlet/abstract.rb", "lib/webrick/httpservlet/cgi_runner.rb", "lib/webrick/httpservlet/cgihandler.rb", "lib/webrick/httpservlet/erbhandler.rb", "lib/webrick/httpservlet/filehandler.rb", "lib/webrick/httpservlet/prochandler.rb", "lib/webrick/httpservlet.rb", "lib/webrick/httpstatus.rb", "lib/webrick/httputils.rb", "lib/webrick/httpversion.rb", "lib/webrick/log.rb", "lib/webrick/server.rb", "lib/webrick/ssl.rb", "lib/webrick/utils.rb", "lib/webrick/version.rb"]
- s.required_ruby_version = ">= 2.3.0"
-
- s.authors = ["TAKAHASHI Masayoshi", "GOTOU YUUZOU", "Eric Wong"]
- s.email = [nil, nil, 'normal@ruby-lang.org']
- s.homepage = "https://www.ruby-lang.org"
- s.license = "BSD-2-Clause"
-
- if s.respond_to?(:metadata=)
- s.metadata = {
- "bug_tracker_uri" => "https://bugs.ruby-lang.org/projects/ruby-trunk/issues",
- "homepage_uri" => "https://www.ruby-lang.org",
- "source_code_uri" => "https://svn.ruby-lang.org/repos/ruby"
- }
- end
-
- s.add_development_dependency "rake"
-end
diff --git a/lib/xmlrpc.rb b/lib/xmlrpc.rb
new file mode 100644
index 0000000000..511c57d269
--- /dev/null
+++ b/lib/xmlrpc.rb
@@ -0,0 +1,301 @@
+# == Author and Copyright
+#
+# Copyright (C) 2001-2004 by Michael Neumann (mailto:mneumann@ntecs.de)
+#
+# Released under the same term of license as Ruby.
+#
+# == Overview
+#
+# XMLRPC is a lightweight protocol that enables remote procedure calls over
+# HTTP. It is defined at http://www.xmlrpc.com.
+#
+# XMLRPC allows you to create simple distributed computing solutions that span
+# computer languages. Its distinctive feature is its simplicity compared to
+# other approaches like SOAP and CORBA.
+#
+# The Ruby standard library package 'xmlrpc' enables you to create a server that
+# implements remote procedures and a client that calls them. Very little code
+# is required to achieve either of these.
+#
+# == Example
+#
+# Try the following code. It calls a standard demonstration remote procedure.
+#
+# require 'xmlrpc/client'
+# require 'pp'
+#
+# server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php")
+# result = server.call("sample.sumAndDifference", 5, 3)
+# pp result
+#
+# == Documentation
+#
+# See http://www.ntecs.de/ruby/xmlrpc4r/. There is plenty of detail there to
+# use the client and implement a server.
+#
+# == Features of XMLRPC for Ruby
+#
+# * Extensions
+# * Introspection
+# * multiCall
+# * optionally nil values and integers larger than 32 Bit
+#
+# * Server
+# * Standalone XML-RPC server
+# * CGI-based (works with FastCGI)
+# * Apache mod_ruby server
+# * WEBrick servlet
+#
+# * Client
+# * synchronous/asynchronous calls
+# * Basic HTTP-401 Authentication
+# * HTTPS protocol (SSL)
+#
+# * Parsers
+# * NQXML (XMLParser::NQXMLStreamParser, XMLParser::NQXMLTreeParser)
+# * Expat (XMLParser::XMLStreamParser, XMLParser::XMLTreeParser)
+# * REXML (XMLParser::REXMLStreamParser)
+# * xml-scan (XMLParser::XMLScanStreamParser)
+# * Fastest parser is Expat's XMLParser::XMLStreamParser!
+#
+# * General
+# * possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
+# * Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
+# * SandStorm component architecture XMLRPC::Client interface
+#
+# == Howto
+#
+# === Client
+#
+# require "xmlrpc/client"
+#
+# # Make an object to represent the XML-RPC server.
+# server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
+#
+# # Call the remote server and get our result
+# result = server.call("sample.sumAndDifference", 5, 3)
+#
+# sum = result["sum"]
+# difference = result["difference"]
+#
+# puts "Sum: #{sum}, Difference: #{difference}"
+#
+# === XMLRPC::Client with XML-RPC fault-structure handling
+#
+# There are two possible ways, of handling a fault-structure:
+#
+# ==== by catching a XMLRPC::FaultException exception
+#
+# require "xmlrpc/client"
+#
+# # Make an object to represent the XML-RPC server.
+# server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
+#
+# begin
+# # Call the remote server and get our result
+# result = server.call("sample.sumAndDifference", 5, 3)
+#
+# sum = result["sum"]
+# difference = result["difference"]
+#
+# puts "Sum: #{sum}, Difference: #{difference}"
+#
+# rescue XMLRPC::FaultException => e
+# puts "Error: "
+# puts e.faultCode
+# puts e.faultString
+# end
+#
+# ==== by calling "call2" which returns a boolean
+#
+# require "xmlrpc/client"
+#
+# # Make an object to represent the XML-RPC server.
+# server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
+#
+# # Call the remote server and get our result
+# ok, result = server.call2("sample.sumAndDifference", 5, 3)
+#
+# if ok
+# sum = result["sum"]
+# difference = result["difference"]
+#
+# puts "Sum: #{sum}, Difference: #{difference}"
+# else
+# puts "Error: "
+# puts result.faultCode
+# puts result.faultString
+# end
+#
+# === Using XMLRPC::Client::Proxy
+#
+# You can create a Proxy object onto which you can call methods. This way it
+# looks nicer. Both forms, _call_ and _call2_ are supported through _proxy_ and
+# _proxy2_. You can additionally give arguments to the Proxy, which will be
+# given to each XML-RPC call using that Proxy.
+#
+# require "xmlrpc/client"
+#
+# # Make an object to represent the XML-RPC server.
+# server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
+#
+# # Create a Proxy object
+# sample = server.proxy("sample")
+#
+# # Call the remote server and get our result
+# result = sample.sumAndDifference(5,3)
+#
+# sum = result["sum"]
+# difference = result["difference"]
+#
+# puts "Sum: #{sum}, Difference: #{difference}"
+#
+# === CGI-based server using XMLRPC::CGIServer
+#
+# There are also two ways to define handler, the first is
+# like C/PHP, the second like Java, of course both ways
+# can be mixed:
+#
+# ==== C/PHP-like (handler functions)
+#
+# require "xmlrpc/server"
+#
+# s = XMLRPC::CGIServer.new
+#
+# s.add_handler("sample.sumAndDifference") do |a,b|
+# { "sum" => a + b, "difference" => a - b }
+# end
+#
+# s.serve
+#
+# ==== Java-like (handler classes)
+#
+# require "xmlrpc/server"
+#
+# s = XMLRPC::CGIServer.new
+#
+# class MyHandler
+# def sumAndDifference(a, b)
+# { "sum" => a + b, "difference" => a - b }
+# end
+# end
+#
+# # NOTE: Security Hole (read below)!!!
+# s.add_handler("sample", MyHandler.new)
+# s.serve
+#
+#
+# To return a fault-structure you have to raise an XMLRPC::FaultException e.g.:
+#
+# raise XMLRPC::FaultException.new(3, "division by Zero")
+#
+# ===== Security Note
+#
+# From Brian Candler:
+#
+# Above code sample has an extremely nasty security hole, in that you can now call
+# any method of 'MyHandler' remotely, including methods inherited from Object
+# and Kernel! For example, in the client code, you can use
+#
+# puts server.call("sample.send","`","ls")
+#
+# (backtick being the method name for running system processes). Needless to
+# say, 'ls' can be replaced with something else.
+#
+# The version which binds proc objects (or the version presented below in the next section)
+# doesn't have this problem, but people may be tempted to use the second version because it's
+# so nice and 'Rubyesque'. I think it needs a big red disclaimer.
+#
+#
+# From Michael:
+#
+# A solution is to undef insecure methods or to use
+# XMLRPC::Service::PublicInstanceMethodsInterface as shown below:
+#
+# class MyHandler
+# def sumAndDifference(a, b)
+# { "sum" => a + b, "difference" => a - b }
+# end
+# end
+#
+# # ... server initialization ...
+#
+# s.add_handler(XMLRPC::iPIMethods("sample"), MyHandler.new)
+#
+# # ...
+#
+# This adds only public instance methods explicitly declared in class MyHandler
+# (and not those inherited from any other class).
+#
+# ==== With interface declarations
+#
+# Code sample from the book Ruby Developer's Guide:
+#
+# require "xmlrpc/server"
+#
+# class Num
+# INTERFACE = XMLRPC::interface("num") {
+# meth 'int add(int, int)', 'Add two numbers', 'add'
+# meth 'int div(int, int)', 'Divide two numbers'
+# }
+#
+# def add(a, b) a + b end
+# def div(a, b) a / b end
+# end
+#
+#
+# s = XMLRPC::CGIServer.new
+# s.add_handler(Num::INTERFACE, Num.new)
+# s.serve
+#
+# === Standalone XMLRPC::Server
+#
+# Same as CGI-based server, the only difference being
+#
+# server = XMLRPC::CGIServer.new
+#
+# must be changed to
+#
+# server = XMLRPC::Server.new(8080)
+#
+# if you want a server listening on port 8080.
+# The rest is the same.
+#
+# === Choosing a different XMLParser or XMLWriter
+#
+# The examples above all use the default parser (which is now since 1.8
+# XMLParser::REXMLStreamParser) and a default XMLRPC::XMLWriter.
+# If you want to use a different XMLParser, then you have to call the
+# ParserWriterChooseMixin#set_parser method of XMLRPC::Client instances
+# or instances of subclasses of XMLRPC::BasicServer or by editing
+# xmlrpc/config.rb.
+#
+# XMLRPC::Client Example:
+#
+# # ...
+# server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
+# server.set_parser(XMLRPC::XMLParser::XMLParser.new)
+# # ...
+#
+# XMLRPC::Server Example:
+#
+# # ...
+# s = XMLRPC::CGIServer.new
+# s.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
+# # ...
+#
+# or:
+#
+# # ...
+# server = XMLRPC::Server.new(8080)
+# server.set_parser(XMLRPC::XMLParser::NQXMLParser.new)
+# # ...
+#
+#
+# Note that XMLParser::XMLStreamParser is incredible faster (and uses less memory) than any
+# other parser and scales well for large documents. For example for a 0.5 MB XML
+# document with many tags, XMLParser::XMLStreamParser is ~350 (!) times faster than
+# XMLParser::NQXMLTreeParser and still ~18 times as fast as XMLParser::XMLTreeParser.
+#
+# You can change the XML-writer by calling method ParserWriterChooseMixin#set_writer.
+module XMLRPC; end
diff --git a/lib/xmlrpc/base64.rb b/lib/xmlrpc/base64.rb
new file mode 100644
index 0000000000..4aac3520c5
--- /dev/null
+++ b/lib/xmlrpc/base64.rb
@@ -0,0 +1,62 @@
+#
+# xmlrpc/base64.rb
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# Released under the same term of license as Ruby.
+
+module XMLRPC # :nodoc:
+
+# This class is necessary for 'xmlrpc4r' to determine that a string should
+# be transmitted base64-encoded and not as a raw-string.
+#
+# You can use XMLRPC::Base64 on the client and server-side as a
+# parameter and/or return-value.
+class Base64
+
+ # Creates a new XMLRPC::Base64 instance with string +str+ as the
+ # internal string. When +state+ is +:dec+ it assumes that the
+ # string +str+ is not in base64 format (perhaps already decoded),
+ # otherwise if +state+ is +:enc+ it decodes +str+
+ # and stores it as the internal string.
+ def initialize(str, state = :dec)
+ case state
+ when :enc
+ @str = Base64.decode(str)
+ when :dec
+ @str = str
+ else
+ raise ArgumentError, "wrong argument; either :enc or :dec"
+ end
+ end
+
+ # Returns the decoded internal string.
+ def decoded
+ @str
+ end
+
+ # Returns the base64 encoded internal string.
+ def encoded
+ Base64.encode(@str)
+ end
+
+
+ # Decodes string +str+ with base64 and returns that value.
+ def Base64.decode(str)
+ str.gsub(/\s+/, "").unpack("m")[0]
+ end
+
+ # Encodes string +str+ with base64 and returns that value.
+ def Base64.encode(str)
+ [str].pack("m")
+ end
+
+end
+
+
+end # module XMLRPC
+
+
+=begin
+= History
+ $Id$
+=end
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb
new file mode 100644
index 0000000000..aab07a7f95
--- /dev/null
+++ b/lib/xmlrpc/client.rb
@@ -0,0 +1,614 @@
+# xmlrpc/client.rb
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# Released under the same term of license as Ruby.
+#
+# History
+# $Id$
+#
+require "xmlrpc/parser"
+require "xmlrpc/create"
+require "xmlrpc/config"
+require "xmlrpc/utils" # ParserWriterChooseMixin
+require "net/http"
+require "uri"
+
+module XMLRPC # :nodoc:
+
+ # Provides remote procedure calls to a XML-RPC server.
+ #
+ # After setting the connection-parameters with XMLRPC::Client.new which
+ # creates a new XMLRPC::Client instance, you can execute a remote procedure
+ # by sending the XMLRPC::Client#call or XMLRPC::Client#call2
+ # message to this new instance.
+ #
+ # The given parameters indicate which method to call on the remote-side and
+ # of course the parameters for the remote procedure.
+ #
+ # require "xmlrpc/client"
+ #
+ # server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
+ # begin
+ # param = server.call("michael.add", 4, 5)
+ # puts "4 + 5 = #{param}"
+ # rescue XMLRPC::FaultException => e
+ # puts "Error:"
+ # puts e.faultCode
+ # puts e.faultString
+ # end
+ #
+ # or
+ #
+ # require "xmlrpc/client"
+ #
+ # server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
+ # ok, param = server.call2("michael.add", 4, 5)
+ # if ok then
+ # puts "4 + 5 = #{param}"
+ # else
+ # puts "Error:"
+ # puts param.faultCode
+ # puts param.faultString
+ # end
+ class Client
+
+ USER_AGENT = "XMLRPC::Client (Ruby #{RUBY_VERSION})"
+
+ include ParserWriterChooseMixin
+ include ParseContentType
+
+
+ # Creates an object which represents the remote XML-RPC server on the
+ # given +host+. If the server is CGI-based, +path+ is the
+ # path to the CGI-script, which will be called, otherwise (in the
+ # case of a standalone server) +path+ should be <tt>"/RPC2"</tt>.
+ # +port+ is the port on which the XML-RPC server listens.
+ #
+ # If +proxy_host+ is given, then a proxy server listening at
+ # +proxy_host+ is used. +proxy_port+ is the port of the
+ # proxy server.
+ #
+ # Default values for +host+, +path+ and +port+ are 'localhost', '/RPC2' and
+ # '80' respectively using SSL '443'.
+ #
+ # If +user+ and +password+ are given, each time a request is sent,
+ # an Authorization header is sent. Currently only Basic Authentication is
+ # implemented, no Digest.
+ #
+ # If +use_ssl+ is set to +true+, communication over SSL is enabled.
+ #
+ # Parameter +timeout+ is the time to wait for a XML-RPC response, defaults to 30.
+ def initialize(host=nil, path=nil, port=nil, proxy_host=nil, proxy_port=nil,
+ user=nil, password=nil, use_ssl=nil, timeout=nil)
+
+ @http_header_extra = nil
+ @http_last_response = nil
+ @cookie = nil
+
+ @host = host || "localhost"
+ @path = path || "/RPC2"
+ @proxy_host = proxy_host
+ @proxy_port = proxy_port
+ @proxy_host ||= 'localhost' if @proxy_port != nil
+ @proxy_port ||= 8080 if @proxy_host != nil
+ @use_ssl = use_ssl || false
+ @timeout = timeout || 30
+
+ if use_ssl
+ require "net/https"
+ @port = port || 443
+ else
+ @port = port || 80
+ end
+
+ @user, @password = user, password
+
+ set_auth
+
+ # convert ports to integers
+ @port = @port.to_i if @port != nil
+ @proxy_port = @proxy_port.to_i if @proxy_port != nil
+
+ # HTTP object for synchronous calls
+ @http = net_http(@host, @port, @proxy_host, @proxy_port)
+ @http.use_ssl = @use_ssl if @use_ssl
+ @http.read_timeout = @timeout
+ @http.open_timeout = @timeout
+
+ @parser = nil
+ @create = nil
+ end
+
+
+ class << self
+
+ # Creates an object which represents the remote XML-RPC server at the
+ # given +uri+. The URI should have a host, port, path, user and password.
+ # Example: https://user:password@host:port/path
+ #
+ # Raises an ArgumentError if the +uri+ is invalid,
+ # or if the protocol isn't http or https.
+ #
+ # If a +proxy+ is given it should be in the form of "host:port".
+ #
+ # The optional +timeout+ defaults to 30 seconds.
+ def new2(uri, proxy=nil, timeout=nil)
+ begin
+ url = URI(uri)
+ rescue URI::InvalidURIError => e
+ raise ArgumentError, e.message, e.backtrace
+ end
+
+ unless URI::HTTP === url
+ raise ArgumentError, "Wrong protocol specified. Only http or https allowed!"
+ end
+
+ proto = url.scheme
+ user = url.user
+ passwd = url.password
+ host = url.host
+ port = url.port
+ path = url.path.empty? ? nil : url.request_uri
+
+ proxy_host, proxy_port = (proxy || "").split(":")
+ proxy_port = proxy_port.to_i if proxy_port
+
+ self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout)
+ end
+
+ alias new_from_uri new2
+
+ # Receives a Hash and calls XMLRPC::Client.new
+ # with the corresponding values.
+ #
+ # The +hash+ parameter has following case-insensitive keys:
+ # * host
+ # * path
+ # * port
+ # * proxy_host
+ # * proxy_port
+ # * user
+ # * password
+ # * use_ssl
+ # * timeout
+ def new3(hash={})
+
+ # convert all keys into lowercase strings
+ h = {}
+ hash.each { |k,v| h[k.to_s.downcase] = v }
+
+ self.new(h['host'], h['path'], h['port'], h['proxy_host'], h['proxy_port'], h['user'], h['password'],
+ h['use_ssl'], h['timeout'])
+ end
+
+ alias new_from_hash new3
+
+ end
+
+
+ # Returns the Net::HTTP object for the client. If you want to
+ # change HTTP client options except header, cookie, timeout,
+ # user and password, use Net::HTTP directly.
+ #
+ # Since 2.1.0.
+ attr_reader :http
+
+ # Add additional HTTP headers to the request
+ attr_accessor :http_header_extra
+
+ # Returns the Net::HTTPResponse object of the last RPC.
+ attr_reader :http_last_response
+
+ # Get and set the HTTP Cookie header.
+ attr_accessor :cookie
+
+
+ # Return the corresponding attributes.
+ attr_reader :timeout, :user, :password
+
+ # Sets the Net::HTTP#read_timeout and Net::HTTP#open_timeout to
+ # +new_timeout+
+ def timeout=(new_timeout)
+ @timeout = new_timeout
+ @http.read_timeout = @timeout
+ @http.open_timeout = @timeout
+ end
+
+ # Changes the user for the Basic Authentication header to +new_user+
+ def user=(new_user)
+ @user = new_user
+ set_auth
+ end
+
+ # Changes the password for the Basic Authentication header to
+ # +new_password+
+ def password=(new_password)
+ @password = new_password
+ set_auth
+ end
+
+ # Invokes the method named +method+ with the parameters given by
+ # +args+ on the XML-RPC server.
+ #
+ # The +method+ parameter is converted into a String and should
+ # be a valid XML-RPC method-name.
+ #
+ # Each parameter of +args+ must be of one of the following types,
+ # where Hash, Struct and Array can contain any of these listed _types_:
+ #
+ # * Fixnum, Bignum
+ # * TrueClass, FalseClass, +true+, +false+
+ # * String, Symbol
+ # * Float
+ # * Hash, Struct
+ # * Array
+ # * Date, Time, XMLRPC::DateTime
+ # * XMLRPC::Base64
+ # * A Ruby object which class includes XMLRPC::Marshallable
+ # (only if Config::ENABLE_MARSHALLING is +true+).
+ # That object is converted into a hash, with one additional key/value
+ # pair <code>___class___</code> which contains the class name
+ # for restoring that object later.
+ #
+ # The method returns the return-value from the Remote Procedure Call.
+ #
+ # The type of the return-value is one of the types shown above.
+ #
+ # A Bignum is only allowed when it fits in 32-bit. A XML-RPC
+ # +dateTime.iso8601+ type is always returned as a XMLRPC::DateTime object.
+ # Struct is never returned, only a Hash, the same for a Symbol, where as a
+ # String is always returned. XMLRPC::Base64 is returned as a String from
+ # xmlrpc4r version 1.6.1 on.
+ #
+ # If the remote procedure returned a fault-structure, then a
+ # XMLRPC::FaultException exception is raised, which has two accessor-methods
+ # +faultCode+ an Integer, and +faultString+ a String.
+ def call(method, *args)
+ ok, param = call2(method, *args)
+ if ok
+ param
+ else
+ raise param
+ end
+ end
+
+ # The difference between this method and XMLRPC::Client#call is, that
+ # this method will <b>NOT</b> raise a XMLRPC::FaultException exception.
+ #
+ # The method returns an array of two values. The first value indicates if
+ # the second value is +true+ or an XMLRPC::FaultException.
+ #
+ # Both are explained in XMLRPC::Client#call.
+ #
+ # Simple to remember: The "2" in "call2" denotes the number of values it returns.
+ def call2(method, *args)
+ request = create().methodCall(method, *args)
+ data = do_rpc(request, false)
+ parser().parseMethodResponse(data)
+ end
+
+ # Similar to XMLRPC::Client#call, however can be called concurrently and
+ # use a new connection for each request. In contrast to the corresponding
+ # method without the +_async+ suffix, which use connect-alive (one
+ # connection for all requests).
+ #
+ # Note, that you have to use Thread to call these methods concurrently.
+ # The following example calls two methods concurrently:
+ #
+ # Thread.new {
+ # p client.call_async("michael.add", 4, 5)
+ # }
+ #
+ # Thread.new {
+ # p client.call_async("michael.div", 7, 9)
+ # }
+ #
+ def call_async(method, *args)
+ ok, param = call2_async(method, *args)
+ if ok
+ param
+ else
+ raise param
+ end
+ end
+
+ # Same as XMLRPC::Client#call2, but can be called concurrently.
+ #
+ # See also XMLRPC::Client#call_async
+ def call2_async(method, *args)
+ request = create().methodCall(method, *args)
+ data = do_rpc(request, true)
+ parser().parseMethodResponse(data)
+ end
+
+
+ # You can use this method to execute several methods on a XMLRPC server
+ # which support the multi-call extension.
+ #
+ # s.multicall(
+ # ['michael.add', 3, 4],
+ # ['michael.sub', 4, 5]
+ # )
+ # # => [7, -1]
+ def multicall(*methods)
+ ok, params = multicall2(*methods)
+ if ok
+ params
+ else
+ raise params
+ end
+ end
+
+ # Same as XMLRPC::Client#multicall, but returns two parameters instead of
+ # raising an XMLRPC::FaultException.
+ #
+ # See XMLRPC::Client#call2
+ def multicall2(*methods)
+ gen_multicall(methods, false)
+ end
+
+ # Similar to XMLRPC::Client#multicall, however can be called concurrently and
+ # use a new connection for each request. In contrast to the corresponding
+ # method without the +_async+ suffix, which use connect-alive (one
+ # connection for all requests).
+ #
+ # Note, that you have to use Thread to call these methods concurrently.
+ # The following example calls two methods concurrently:
+ #
+ # Thread.new {
+ # p client.multicall_async("michael.add", 4, 5)
+ # }
+ #
+ # Thread.new {
+ # p client.multicall_async("michael.div", 7, 9)
+ # }
+ #
+ def multicall_async(*methods)
+ ok, params = multicall2_async(*methods)
+ if ok
+ params
+ else
+ raise params
+ end
+ end
+
+ # Same as XMLRPC::Client#multicall2, but can be called concurrently.
+ #
+ # See also XMLRPC::Client#multicall_async
+ def multicall2_async(*methods)
+ gen_multicall(methods, true)
+ end
+
+
+ # Returns an object of class XMLRPC::Client::Proxy, initialized with
+ # +prefix+ and +args+.
+ #
+ # A proxy object returned by this method behaves like XMLRPC::Client#call,
+ # i.e. a call on that object will raise a XMLRPC::FaultException when a
+ # fault-structure is returned by that call.
+ def proxy(prefix=nil, *args)
+ Proxy.new(self, prefix, args, :call)
+ end
+
+ # Almost the same like XMLRPC::Client#proxy only that a call on the returned
+ # XMLRPC::Client::Proxy object will return two parameters.
+ #
+ # See XMLRPC::Client#call2
+ def proxy2(prefix=nil, *args)
+ Proxy.new(self, prefix, args, :call2)
+ end
+
+ # Similar to XMLRPC::Client#proxy, however can be called concurrently and
+ # use a new connection for each request. In contrast to the corresponding
+ # method without the +_async+ suffix, which use connect-alive (one
+ # connection for all requests).
+ #
+ # Note, that you have to use Thread to call these methods concurrently.
+ # The following example calls two methods concurrently:
+ #
+ # Thread.new {
+ # p client.proxy_async("michael.add", 4, 5)
+ # }
+ #
+ # Thread.new {
+ # p client.proxy_async("michael.div", 7, 9)
+ # }
+ #
+ def proxy_async(prefix=nil, *args)
+ Proxy.new(self, prefix, args, :call_async)
+ end
+
+ # Same as XMLRPC::Client#proxy2, but can be called concurrently.
+ #
+ # See also XMLRPC::Client#proxy_async
+ def proxy2_async(prefix=nil, *args)
+ Proxy.new(self, prefix, args, :call2_async)
+ end
+
+
+ private
+
+ def net_http(host, port, proxy_host, proxy_port)
+ Net::HTTP.new host, port, proxy_host, proxy_port
+ end
+
+ def set_auth
+ if @user.nil?
+ @auth = nil
+ else
+ a = "#@user"
+ a << ":#@password" if @password != nil
+ @auth = "Basic " + [a].pack("m0")
+ end
+ end
+
+ def do_rpc(request, async=false)
+ header = {
+ "User-Agent" => USER_AGENT,
+ "Content-Type" => "text/xml; charset=utf-8",
+ "Content-Length" => request.bytesize.to_s,
+ "Connection" => (async ? "close" : "keep-alive")
+ }
+
+ header["Cookie"] = @cookie if @cookie
+ header.update(@http_header_extra) if @http_header_extra
+
+ if @auth != nil
+ # add authorization header
+ header["Authorization"] = @auth
+ end
+
+ resp = nil
+ @http_last_response = nil
+
+ if async
+ # use a new HTTP object for each call
+ http = net_http(@host, @port, @proxy_host, @proxy_port)
+ http.use_ssl = @use_ssl if @use_ssl
+ http.read_timeout = @timeout
+ http.open_timeout = @timeout
+
+ # post request
+ http.start {
+ resp = http.request_post(@path, request, header)
+ }
+ else
+ # reuse the HTTP object for each call => connection alive is possible
+ # we must start connection explicitly first time so that http.request
+ # does not assume that we don't want keepalive
+ @http.start if not @http.started?
+
+ # post request
+ resp = @http.request_post(@path, request, header)
+ end
+
+ @http_last_response = resp
+
+ data = resp.body
+
+ if resp.code == "401"
+ # Authorization Required
+ raise "Authorization failed.\nHTTP-Error: #{resp.code} #{resp.message}"
+ elsif resp.code[0,1] != "2"
+ raise "HTTP-Error: #{resp.code} #{resp.message}"
+ end
+
+ # assume text/xml on instances where Content-Type header is not set
+ ct_expected = resp["Content-Type"] || 'text/xml'
+ ct = parse_content_type(ct_expected).first
+ if ct != "text/xml"
+ if ct == "text/html"
+ raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"
+ else
+ raise "Wrong content-type (received '#{ct}' but expected 'text/xml')"
+ end
+ end
+
+ expected = resp["Content-Length"] || "<unknown>"
+ if data.nil? or data.bytesize == 0
+ raise "Wrong size. Was #{data.bytesize}, should be #{expected}"
+ end
+
+ parse_set_cookies(resp.get_fields("Set-Cookie"))
+
+ return data
+ end
+
+ def parse_set_cookies(set_cookies)
+ return if set_cookies.nil?
+ return if set_cookies.empty?
+ require 'webrick/cookie'
+ pairs = {}
+ set_cookies.each do |set_cookie|
+ cookie = WEBrick::Cookie.parse_set_cookie(set_cookie)
+ pairs.delete(cookie.name)
+ pairs[cookie.name] = cookie.value
+ end
+ cookies = pairs.collect do |name, value|
+ WEBrick::Cookie.new(name, value).to_s
+ end
+ @cookie = cookies.join("; ")
+ end
+
+ def gen_multicall(methods=[], async=false)
+ meth = :call2
+ meth = :call2_async if async
+
+ ok, params = self.send(meth, "system.multicall",
+ methods.collect {|m| {'methodName' => m[0], 'params' => m[1..-1]} }
+ )
+
+ if ok
+ params = params.collect do |param|
+ if param.is_a? Array
+ param[0]
+ elsif param.is_a? Hash
+ XMLRPC::FaultException.new(param["faultCode"], param["faultString"])
+ else
+ raise "Wrong multicall return value"
+ end
+ end
+ end
+
+ return ok, params
+ end
+
+
+
+ # XML-RPC calls look nicer!
+ #
+ # You can call any method onto objects of that class - the object handles
+ # XMLRPC::Client::Proxy#method_missing and will forward the method call to
+ # a XML-RPC server.
+ #
+ # Don't use this class directly, instead use the public instance method
+ # XMLRPC::Client#proxy or XMLRPC::Client#proxy2.
+ #
+ # require "xmlrpc/client"
+ #
+ # server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
+ #
+ # michael = server.proxy("michael")
+ # michael2 = server.proxy("michael", 4)
+ #
+ # # both calls should return the same value '9'.
+ # p michael.add(4,5)
+ # p michael2.add(5)
+ class Proxy
+
+ # Creates an object which provides XMLRPC::Client::Proxy#method_missing.
+ #
+ # The given +server+ must be an instance of XMLRPC::Client, which is the
+ # XML-RPC server to be used for a XML-RPC call.
+ #
+ # +prefix+ and +delim+ will be prepended to the method name called onto this object.
+ #
+ # An optional parameter +meth+ is the method to use for a RPC.
+ # It can be either, call, call2, call_async, call2_async
+ #
+ # +args+ are arguments which are automatically given to every XML-RPC
+ # call before being provided through +method_missing+.
+ def initialize(server, prefix, args=[], meth=:call, delim=".")
+ @server = server
+ @prefix = prefix ? prefix + delim : ""
+ @args = args
+ @meth = meth
+ end
+
+ # Every method call is forwarded to the XML-RPC server defined in
+ # XMLRPC::Client::Proxy#new.
+ #
+ # Note: Inherited methods from class Object cannot be used as XML-RPC
+ # names, because they get around +method_missing+.
+ def method_missing(mid, *args)
+ pre = @prefix + mid.to_s
+ arg = @args + args
+ @server.send(@meth, pre, *arg)
+ end
+
+ end # class Proxy
+
+ end # class Client
+
+end # module XMLRPC
+
diff --git a/lib/xmlrpc/config.rb b/lib/xmlrpc/config.rb
new file mode 100644
index 0000000000..98081473b4
--- /dev/null
+++ b/lib/xmlrpc/config.rb
@@ -0,0 +1,42 @@
+#
+# $Id$
+# Configuration file for XML-RPC for Ruby
+#
+
+module XMLRPC # :nodoc:
+
+ module Config
+
+ # or XMLWriter::XMLParser
+ DEFAULT_WRITER = XMLWriter::Simple
+
+ # === Available parsers
+ #
+ # * XMLParser::NQXMLTreeParser
+ # * XMLParser::NQXMLStreamParser
+ # * XMLParser::XMLTreeParser
+ # * XMLParser::XMLStreamParser (fastest)
+ # * XMLParser::REXMLStreamParser
+ # * XMLParser::XMLScanStreamParser
+ DEFAULT_PARSER = XMLParser::REXMLStreamParser
+
+ # enable <code><nil/></code> tag
+ ENABLE_NIL_CREATE = false
+ ENABLE_NIL_PARSER = false
+
+ # allows integers greater than 32-bit if +true+
+ ENABLE_BIGINT = false
+
+ # enable marshalling Ruby objects which include XMLRPC::Marshallable
+ ENABLE_MARSHALLING = true
+
+ # enable multiCall extension by default
+ ENABLE_MULTICALL = false
+
+ # enable Introspection extension by default
+ ENABLE_INTROSPECTION = false
+
+ end
+
+end
+
diff --git a/lib/xmlrpc/create.rb b/lib/xmlrpc/create.rb
new file mode 100644
index 0000000000..13c9cd8faa
--- /dev/null
+++ b/lib/xmlrpc/create.rb
@@ -0,0 +1,286 @@
+#
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# $Id$
+#
+
+require "date"
+require "xmlrpc/base64"
+
+module XMLRPC # :nodoc:
+
+ module XMLWriter
+
+ class Abstract
+ def ele(name, *children)
+ element(name, nil, *children)
+ end
+
+ def tag(name, txt)
+ element(name, nil, text(txt))
+ end
+ end
+
+
+ class Simple < Abstract
+
+ def document_to_str(doc)
+ doc
+ end
+
+ def document(*params)
+ params.join("")
+ end
+
+ def pi(name, *params)
+ "<?#{name} " + params.join(" ") + " ?>"
+ end
+
+ def element(name, attrs, *children)
+ raise "attributes not yet implemented" unless attrs.nil?
+ if children.empty?
+ "<#{name}/>"
+ else
+ "<#{name}>" + children.join("") + "</#{name}>"
+ end
+ end
+
+ def text(txt)
+ cleaned = txt.dup
+ cleaned.gsub!(/&/, '&amp;')
+ cleaned.gsub!(/</, '&lt;')
+ cleaned.gsub!(/>/, '&gt;')
+ cleaned
+ end
+
+ end # class Simple
+
+
+ class XMLParser < Abstract
+
+ def initialize
+ require "xmltreebuilder"
+ end
+
+ def document_to_str(doc)
+ doc.to_s
+ end
+
+ def document(*params)
+ XML::SimpleTree::Document.new(*params)
+ end
+
+ def pi(name, *params)
+ XML::SimpleTree::ProcessingInstruction.new(name, *params)
+ end
+
+ def element(name, attrs, *children)
+ XML::SimpleTree::Element.new(name, attrs, *children)
+ end
+
+ def text(txt)
+ XML::SimpleTree::Text.new(txt)
+ end
+
+ end # class XMLParser
+
+ Classes = [Simple, XMLParser]
+
+ # yields an instance of each installed XML writer
+ def self.each_installed_writer
+ XMLRPC::XMLWriter::Classes.each do |klass|
+ begin
+ yield klass.new
+ rescue LoadError
+ end
+ end
+ end
+
+ end # module XMLWriter
+
+ # Creates XML-RPC call/response documents
+ #
+ class Create
+
+ def initialize(xml_writer = nil)
+ @writer = xml_writer || Config::DEFAULT_WRITER.new
+ end
+
+
+ def methodCall(name, *params)
+ name = name.to_s
+
+ if name !~ /[a-zA-Z0-9_.:\/]+/
+ raise ArgumentError, "Wrong XML-RPC method-name"
+ end
+
+ parameter = params.collect do |param|
+ @writer.ele("param", conv2value(param))
+ end
+
+ tree = @writer.document(
+ @writer.pi("xml", 'version="1.0"'),
+ @writer.ele("methodCall",
+ @writer.tag("methodName", name),
+ @writer.ele("params", *parameter)
+ )
+ )
+
+ @writer.document_to_str(tree) + "\n"
+ end
+
+
+
+ #
+ # Generates a XML-RPC methodResponse document
+ #
+ # When +is_ret+ is +false+ then the +params+ array must
+ # contain only one element, which is a structure
+ # of a fault return-value.
+ #
+ # When +is_ret+ is +true+ then a normal
+ # return-value of all the given +params+ is created.
+ #
+ def methodResponse(is_ret, *params)
+
+ if is_ret
+ resp = params.collect do |param|
+ @writer.ele("param", conv2value(param))
+ end
+
+ resp = [@writer.ele("params", *resp)]
+ else
+ if params.size != 1 or params[0] === XMLRPC::FaultException
+ raise ArgumentError, "no valid fault-structure given"
+ end
+ resp = @writer.ele("fault", conv2value(params[0].to_h))
+ end
+
+
+ tree = @writer.document(
+ @writer.pi("xml", 'version="1.0"'),
+ @writer.ele("methodResponse", resp)
+ )
+
+ @writer.document_to_str(tree) + "\n"
+ end
+
+
+
+ private
+
+ #
+ # Converts a Ruby object into a XML-RPC <code><value></code> tag
+ #
+ def conv2value(param) # :doc:
+
+ val = case param
+ when Fixnum, Bignum
+ # XML-RPC's int is 32bit int, and Fixnum also may be beyond 32bit
+ if Config::ENABLE_BIGINT
+ @writer.tag("i4", param.to_s)
+ else
+ if param >= -(2**31) and param <= (2**31-1)
+ @writer.tag("i4", param.to_s)
+ else
+ raise "Bignum is too big! Must be signed 32-bit integer!"
+ end
+ end
+ when TrueClass, FalseClass
+ @writer.tag("boolean", param ? "1" : "0")
+
+ when Symbol
+ @writer.tag("string", param.to_s)
+
+ when String
+ @writer.tag("string", param)
+
+ when NilClass
+ if Config::ENABLE_NIL_CREATE
+ @writer.ele("nil")
+ else
+ raise "Wrong type NilClass. Not allowed!"
+ end
+
+ when Float
+ raise "Wrong value #{param}. Not allowed!" unless param.finite?
+ @writer.tag("double", param.to_s)
+
+ when Struct
+ h = param.members.collect do |key|
+ value = param[key]
+ @writer.ele("member",
+ @writer.tag("name", key.to_s),
+ conv2value(value)
+ )
+ end
+
+ @writer.ele("struct", *h)
+
+ when Hash
+ # TODO: can a Hash be empty?
+
+ h = param.collect do |key, value|
+ @writer.ele("member",
+ @writer.tag("name", key.to_s),
+ conv2value(value)
+ )
+ end
+
+ @writer.ele("struct", *h)
+
+ when Array
+ # TODO: can an Array be empty?
+ a = param.collect {|v| conv2value(v) }
+
+ @writer.ele("array",
+ @writer.ele("data", *a)
+ )
+
+ when Time, Date, ::DateTime
+ @writer.tag("dateTime.iso8601", param.strftime("%Y%m%dT%H:%M:%S"))
+
+ when XMLRPC::DateTime
+ @writer.tag("dateTime.iso8601",
+ format("%.4d%02d%02dT%02d:%02d:%02d", *param.to_a))
+
+ when XMLRPC::Base64
+ @writer.tag("base64", param.encoded)
+
+ else
+ if Config::ENABLE_MARSHALLING and param.class.included_modules.include? XMLRPC::Marshallable
+ # convert Ruby object into Hash
+ ret = {"___class___" => param.class.name}
+ param.instance_variables.each {|v|
+ name = v[1..-1]
+ val = param.instance_variable_get(v)
+
+ if val.nil?
+ ret[name] = val if Config::ENABLE_NIL_CREATE
+ else
+ ret[name] = val
+ end
+ }
+ return conv2value(ret)
+ else
+ ok, pa = wrong_type(param)
+ if ok
+ return conv2value(pa)
+ else
+ raise "Wrong type!"
+ end
+ end
+ end
+
+ @writer.ele("value", val)
+ end
+
+ def wrong_type(value)
+ false
+ end
+
+
+ end # class Create
+
+end # module XMLRPC
+
diff --git a/lib/xmlrpc/datetime.rb b/lib/xmlrpc/datetime.rb
new file mode 100644
index 0000000000..444a29f176
--- /dev/null
+++ b/lib/xmlrpc/datetime.rb
@@ -0,0 +1,129 @@
+#
+# xmlrpc/datetime.rb
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# Released under the same term of license as Ruby.
+#
+require "date"
+
+module XMLRPC # :nodoc:
+
+# This class is important to handle XMLRPC +dateTime.iso8601+ values,
+# correctly, because normal UNIX-dates, ie: Date, only handle dates
+# from year 1970 on, and ruby's native Time class handles dates without the
+# time component.
+#
+# XMLRPC::DateTime is able to store a XMLRPC +dateTime.iso8601+ value correctly.
+class DateTime
+
+ # Return the value of the specified date/time component.
+ attr_reader :year, :month, :day, :hour, :min, :sec
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises ArgumentError if the given +value+ is out of range, or in the case
+ # of XMLRPC::DateTime#year= if +value+ is not of type Integer.
+ def year= (value)
+ raise ArgumentError, "date/time out of range" unless value.is_a? Integer
+ @year = value
+ end
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises an ArgumentError if the given +value+ isn't between 1 and 12.
+ def month= (value)
+ raise ArgumentError, "date/time out of range" unless (1..12).include? value
+ @month = value
+ end
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises an ArgumentError if the given +value+ isn't between 1 and 31.
+ def day= (value)
+ raise ArgumentError, "date/time out of range" unless (1..31).include? value
+ @day = value
+ end
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises an ArgumentError if the given +value+ isn't between 0 and 24.
+ def hour= (value)
+ raise ArgumentError, "date/time out of range" unless (0..24).include? value
+ @hour = value
+ end
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises an ArgumentError if the given +value+ isn't between 0 and 59.
+ def min= (value)
+ raise ArgumentError, "date/time out of range" unless (0..59).include? value
+ @min = value
+ end
+
+ # Set +value+ as the new date/time component.
+ #
+ # Raises an ArgumentError if the given +value+ isn't between 0 and 59.
+ def sec= (value)
+ raise ArgumentError, "date/time out of range" unless (0..59).include? value
+ @sec = value
+ end
+
+ # Alias for XMLRPC::DateTime#month.
+ alias mon month
+ # Alias for XMLRPC::DateTime#month=.
+ alias mon= month=
+
+
+ # Creates a new XMLRPC::DateTime instance with the
+ # parameters +year+, +month+, +day+ as date and
+ # +hour+, +min+, +sec+ as time.
+ #
+ # Raises an ArgumentError if a parameter is out of range,
+ # or if +year+ is not of the Integer type.
+ def initialize(year, month, day, hour, min, sec)
+ self.year, self.month, self.day = year, month, day
+ self.hour, self.min, self.sec = hour, min, sec
+ end
+
+ # Return a Time object of the date/time which represents +self+.
+ # If the <code>@year</code> is below 1970, this method returns +nil+,
+ # because Time cannot handle years below 1970.
+ #
+ # The timezone used is GMT.
+ def to_time
+ if @year >= 1970
+ Time.gm(*to_a)
+ else
+ nil
+ end
+ end
+
+ # Return a Date object of the date which represents +self+.
+ #
+ # The Date object do _not_ contain the time component (only date).
+ def to_date
+ Date.new(*to_a[0,3])
+ end
+
+ # Returns all date/time components in an array.
+ #
+ # Returns +[year, month, day, hour, min, sec]+.
+ def to_a
+ [@year, @month, @day, @hour, @min, @sec]
+ end
+
+ # Returns whether or not all date/time components are an array.
+ def ==(o)
+ self.to_a == Array(o) rescue false
+ end
+
+end
+
+
+end # module XMLRPC
+
+
+=begin
+= History
+ $Id$
+=end
diff --git a/lib/xmlrpc/marshal.rb b/lib/xmlrpc/marshal.rb
new file mode 100644
index 0000000000..ef1234f801
--- /dev/null
+++ b/lib/xmlrpc/marshal.rb
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# $Id$
+#
+
+require "xmlrpc/parser"
+require "xmlrpc/create"
+require "xmlrpc/config"
+require "xmlrpc/utils"
+
+module XMLRPC # :nodoc:
+
+ # Marshalling of XMLRPC::Create#methodCall and XMLRPC::Create#methodResponse
+ class Marshal
+ include ParserWriterChooseMixin
+
+ class << self
+
+ def dump_call( methodName, *params )
+ new.dump_call( methodName, *params )
+ end
+
+ def dump_response( param )
+ new.dump_response( param )
+ end
+
+ def load_call( stringOrReadable )
+ new.load_call( stringOrReadable )
+ end
+
+ def load_response( stringOrReadable )
+ new.load_response( stringOrReadable )
+ end
+
+ alias dump dump_response
+ alias load load_response
+
+ end # class self
+
+ def initialize( parser = nil, writer = nil )
+ set_parser( parser )
+ set_writer( writer )
+ end
+
+ def dump_call( methodName, *params )
+ create.methodCall( methodName, *params )
+ end
+
+ def dump_response( param )
+ create.methodResponse( ! param.kind_of?( XMLRPC::FaultException ) , param )
+ end
+
+ # Returns <code>[ methodname, params ]</code>
+ def load_call( stringOrReadable )
+ parser.parseMethodCall( stringOrReadable )
+ end
+
+ # Returns +paramOrFault+
+ def load_response( stringOrReadable )
+ parser.parseMethodResponse( stringOrReadable )[1]
+ end
+
+ end # class Marshal
+
+end
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
new file mode 100644
index 0000000000..0afbd07e6b
--- /dev/null
+++ b/lib/xmlrpc/parser.rb
@@ -0,0 +1,838 @@
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# $Id$
+#
+
+
+require "date"
+require "xmlrpc/base64"
+require "xmlrpc/datetime"
+
+
+module NQXML
+ class Node
+
+ def removeChild(node)
+ @children.delete(node)
+ end
+ def childNodes
+ @children
+ end
+ def hasChildNodes
+ not @children.empty?
+ end
+ def [] (index)
+ @children[index]
+ end
+
+ def nodeType
+ if @entity.instance_of? NQXML::Text then :TEXT
+ elsif @entity.instance_of? NQXML::Comment then :COMMENT
+ #elsif @entity.instance_of? NQXML::Element then :ELEMENT
+ elsif @entity.instance_of? NQXML::Tag then :ELEMENT
+ else :ELSE
+ end
+ end
+
+ def nodeValue
+ #TODO: error when wrong Entity-type
+ @entity.text
+ end
+ def nodeName
+ #TODO: error when wrong Entity-type
+ @entity.name
+ end
+ end # class Node
+end # module NQXML
+
+module XMLRPC # :nodoc:
+
+ # Raised when the remote procedure returns a fault-structure, which has two
+ # accessor-methods +faultCode+ an Integer, and +faultString+ a String.
+ class FaultException < StandardError
+ attr_reader :faultCode, :faultString
+
+ # Creates a new XMLRPC::FaultException instance.
+ #
+ # +faultString+ is passed to StandardError as the +msg+ of the Exception.
+ def initialize(faultCode, faultString)
+ @faultCode = faultCode
+ @faultString = faultString
+ super(@faultString)
+ end
+
+ # The +faultCode+ and +faultString+ of the exception in a Hash.
+ def to_h
+ {"faultCode" => @faultCode, "faultString" => @faultString}
+ end
+ end
+
+ # Helper class used to convert types.
+ module Convert
+
+ # Converts a String to an Integer
+ #
+ # See also String.to_i
+ def self.int(str)
+ str.to_i
+ end
+
+ # Converts a String to +true+ or +false+
+ #
+ # Raises an exception if +str+ is not +0+ or +1+
+ def self.boolean(str)
+ case str
+ when "0" then false
+ when "1" then true
+ else
+ raise "RPC-value of type boolean is wrong"
+ end
+ end
+
+ # Converts a String to a Float
+ #
+ # See also String.to_f
+ def self.double(str)
+ str.to_f
+ end
+
+ # Converts a the given +str+ to a +dateTime.iso8601+ formatted date.
+ #
+ # Raises an exception if the String isn't in +dateTime.iso8601+ format.
+ #
+ # See also, XMLRPC::DateTime
+ def self.dateTime(str)
+ case str
+ when /^(-?\d\d\d\d)-?(\d\d)-?(\d\d)T(\d\d):(\d\d):(\d\d)(?:Z|([+-])(\d\d):?(\d\d))?$/
+ a = [$1, $2, $3, $4, $5, $6].collect{|i| i.to_i}
+ if $7
+ ofs = $8.to_i*3600 + $9.to_i*60
+ ofs = -ofs if $7=='+'
+ utc = Time.utc(*a) + ofs
+ a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
+ end
+ XMLRPC::DateTime.new(*a)
+ when /^(-?\d\d)-?(\d\d)-?(\d\d)T(\d\d):(\d\d):(\d\d)(Z|([+-]\d\d):(\d\d))?$/
+ a = [$1, $2, $3, $4, $5, $6].collect{|i| i.to_i}
+ if a[0] < 70
+ a[0] += 2000
+ else
+ a[0] += 1900
+ end
+ if $7
+ ofs = $8.to_i*3600 + $9.to_i*60
+ ofs = -ofs if $7=='+'
+ utc = Time.utc(*a) + ofs
+ a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
+ end
+ XMLRPC::DateTime.new(*a)
+ else
+ raise "wrong dateTime.iso8601 format " + str
+ end
+ end
+
+ # Decodes the given +str+ using XMLRPC::Base64.decode
+ def self.base64(str)
+ XMLRPC::Base64.decode(str)
+ end
+
+ # Converts the given +hash+ to a marshalled object.
+ #
+ # Returns the given +hash+ if an exception occurs.
+ def self.struct(hash)
+ # convert to marshalled object
+ klass = hash["___class___"]
+ if klass.nil? or Config::ENABLE_MARSHALLING == false
+ hash
+ else
+ begin
+ mod = Module
+ klass.split("::").each {|const| mod = mod.const_get(const.strip)}
+
+ obj = mod.allocate
+
+ hash.delete "___class___"
+ hash.each {|key, value|
+ obj.instance_variable_set("@#{ key }", value) if key =~ /^([a-zA-Z_]\w*)$/
+ }
+ obj
+ rescue
+ hash
+ end
+ end
+ end
+
+ # Converts the given +hash+ to an XMLRPC::FaultException object by passing
+ # the +faultCode+ and +faultString+ attributes of the Hash to
+ # XMLRPC::FaultException.new
+ #
+ # Raises an Exception if the given +hash+ doesn't meet the requirements.
+ # Those requirements being:
+ # * 2 keys
+ # * <code>'faultCode'</code> key is an Integer
+ # * <code>'faultString'</code> key is a String
+ def self.fault(hash)
+ if hash.kind_of? Hash and hash.size == 2 and
+ hash.has_key? "faultCode" and hash.has_key? "faultString" and
+ hash["faultCode"].kind_of? Integer and hash["faultString"].kind_of? String
+
+ XMLRPC::FaultException.new(hash["faultCode"], hash["faultString"])
+ else
+ raise "wrong fault-structure: #{hash.inspect}"
+ end
+ end
+
+ end # module Convert
+
+ # Parser for XML-RPC call and response
+ module XMLParser
+
+ class AbstractTreeParser
+
+ def parseMethodResponse(str)
+ methodResponse_document(createCleanedTree(str))
+ end
+
+ def parseMethodCall(str)
+ methodCall_document(createCleanedTree(str))
+ end
+
+ private
+
+ # Removes all whitespaces but in the tags i4, i8, int, boolean....
+ # and all comments
+ def removeWhitespacesAndComments(node)
+ remove = []
+ childs = node.childNodes.to_a
+ childs.each do |nd|
+ case _nodeType(nd)
+ when :TEXT
+ # TODO: add nil?
+ unless %w(i4 i8 int boolean string double dateTime.iso8601 base64).include? node.nodeName
+
+ if node.nodeName == "value"
+ if not node.childNodes.to_a.detect {|n| _nodeType(n) == :ELEMENT}.nil?
+ remove << nd if nd.nodeValue.strip == ""
+ end
+ else
+ remove << nd if nd.nodeValue.strip == ""
+ end
+ end
+ when :COMMENT
+ remove << nd
+ else
+ removeWhitespacesAndComments(nd)
+ end
+ end
+
+ remove.each { |i| node.removeChild(i) }
+ end
+
+
+ def nodeMustBe(node, name)
+ cmp = case name
+ when Array
+ name.include?(node.nodeName)
+ when String
+ name == node.nodeName
+ else
+ raise "error"
+ end
+
+ if not cmp then
+ raise "wrong xml-rpc (name)"
+ end
+
+ node
+ end
+
+ # Returns, when successfully the only child-node
+ def hasOnlyOneChild(node, name=nil)
+ if node.childNodes.to_a.size != 1
+ raise "wrong xml-rpc (size)"
+ end
+ if name != nil then
+ nodeMustBe(node.firstChild, name)
+ end
+ end
+
+
+ def assert(b)
+ if not b then
+ raise "assert-fail"
+ end
+ end
+
+ # The node `node` has empty string or string
+ def text_zero_one(node)
+ nodes = node.childNodes.to_a.size
+
+ if nodes == 1
+ text(node.firstChild)
+ elsif nodes == 0
+ ""
+ else
+ raise "wrong xml-rpc (size)"
+ end
+ end
+
+
+ def integer(node)
+ #TODO: check string for float because to_i returnsa
+ # 0 when wrong string
+ nodeMustBe(node, %w(i4 i8 int))
+ hasOnlyOneChild(node)
+
+ Convert.int(text(node.firstChild))
+ end
+
+ def boolean(node)
+ nodeMustBe(node, "boolean")
+ hasOnlyOneChild(node)
+
+ Convert.boolean(text(node.firstChild))
+ end
+
+ def v_nil(node)
+ nodeMustBe(node, "nil")
+ assert( node.childNodes.to_a.size == 0 )
+ nil
+ end
+
+ def string(node)
+ nodeMustBe(node, "string")
+ text_zero_one(node)
+ end
+
+ def double(node)
+ #TODO: check string for float because to_f returnsa
+ # 0.0 when wrong string
+ nodeMustBe(node, "double")
+ hasOnlyOneChild(node)
+
+ Convert.double(text(node.firstChild))
+ end
+
+ def dateTime(node)
+ nodeMustBe(node, "dateTime.iso8601")
+ hasOnlyOneChild(node)
+
+ Convert.dateTime( text(node.firstChild) )
+ end
+
+ def base64(node)
+ nodeMustBe(node, "base64")
+ #hasOnlyOneChild(node)
+
+ Convert.base64(text_zero_one(node))
+ end
+
+ def member(node)
+ nodeMustBe(node, "member")
+ assert( node.childNodes.to_a.size == 2 )
+
+ [ name(node[0]), value(node[1]) ]
+ end
+
+ def name(node)
+ nodeMustBe(node, "name")
+ #hasOnlyOneChild(node)
+ text_zero_one(node)
+ end
+
+ def array(node)
+ nodeMustBe(node, "array")
+ hasOnlyOneChild(node, "data")
+ data(node.firstChild)
+ end
+
+ def data(node)
+ nodeMustBe(node, "data")
+
+ node.childNodes.to_a.collect do |val|
+ value(val)
+ end
+ end
+
+ def param(node)
+ nodeMustBe(node, "param")
+ hasOnlyOneChild(node, "value")
+ value(node.firstChild)
+ end
+
+ def methodResponse(node)
+ nodeMustBe(node, "methodResponse")
+ hasOnlyOneChild(node, %w(params fault))
+ child = node.firstChild
+
+ case child.nodeName
+ when "params"
+ [ true, params(child,false) ]
+ when "fault"
+ [ false, fault(child) ]
+ else
+ raise "unexpected error"
+ end
+
+ end
+
+ def methodName(node)
+ nodeMustBe(node, "methodName")
+ hasOnlyOneChild(node)
+ text(node.firstChild)
+ end
+
+ def params(node, call=true)
+ nodeMustBe(node, "params")
+
+ if call
+ node.childNodes.to_a.collect do |n|
+ param(n)
+ end
+ else # response (only one param)
+ hasOnlyOneChild(node)
+ param(node.firstChild)
+ end
+ end
+
+ def fault(node)
+ nodeMustBe(node, "fault")
+ hasOnlyOneChild(node, "value")
+ f = value(node.firstChild)
+ Convert.fault(f)
+ end
+
+
+
+ # _nodeType is defined in the subclass
+ def text(node)
+ assert( _nodeType(node) == :TEXT )
+ assert( node.hasChildNodes == false )
+ assert( node.nodeValue != nil )
+
+ node.nodeValue.to_s
+ end
+
+ def struct(node)
+ nodeMustBe(node, "struct")
+
+ hash = {}
+ node.childNodes.to_a.each do |me|
+ n, v = member(me)
+ hash[n] = v
+ end
+
+ Convert.struct(hash)
+ end
+
+
+ def value(node)
+ nodeMustBe(node, "value")
+ nodes = node.childNodes.to_a.size
+ if nodes == 0
+ return ""
+ elsif nodes > 1
+ raise "wrong xml-rpc (size)"
+ end
+
+ child = node.firstChild
+
+ case _nodeType(child)
+ when :TEXT
+ text_zero_one(node)
+ when :ELEMENT
+ case child.nodeName
+ when "i4", "i8", "int" then integer(child)
+ when "boolean" then boolean(child)
+ when "string" then string(child)
+ when "double" then double(child)
+ when "dateTime.iso8601" then dateTime(child)
+ when "base64" then base64(child)
+ when "struct" then struct(child)
+ when "array" then array(child)
+ when "nil"
+ if Config::ENABLE_NIL_PARSER
+ v_nil(child)
+ else
+ raise "wrong/unknown XML-RPC type 'nil'"
+ end
+ else
+ raise "wrong/unknown XML-RPC type"
+ end
+ else
+ raise "wrong type of node"
+ end
+
+ end
+
+ def methodCall(node)
+ nodeMustBe(node, "methodCall")
+ assert( (1..2).include?( node.childNodes.to_a.size ) )
+ name = methodName(node[0])
+
+ if node.childNodes.to_a.size == 2 then
+ pa = params(node[1])
+ else # no parameters given
+ pa = []
+ end
+ [name, pa]
+ end
+
+ end # module TreeParserMixin
+
+ class AbstractStreamParser
+ def parseMethodResponse(str)
+ parser = @parser_class.new
+ parser.parse(str)
+ raise "No valid method response!" if parser.method_name != nil
+ if parser.fault != nil
+ # is a fault structure
+ [false, parser.fault]
+ else
+ # is a normal return value
+ raise "Missing return value!" if parser.params.size == 0
+ raise "Too many return values. Only one allowed!" if parser.params.size > 1
+ [true, parser.params[0]]
+ end
+ end
+
+ def parseMethodCall(str)
+ parser = @parser_class.new
+ parser.parse(str)
+ raise "No valid method call - missing method name!" if parser.method_name.nil?
+ [parser.method_name, parser.params]
+ end
+ end
+
+ module StreamParserMixin
+ attr_reader :params
+ attr_reader :method_name
+ attr_reader :fault
+
+ def initialize(*a)
+ super(*a)
+ @params = []
+ @values = []
+ @val_stack = []
+
+ @names = []
+ @name = []
+
+ @structs = []
+ @struct = {}
+
+ @method_name = nil
+ @fault = nil
+
+ @data = nil
+ end
+
+ def startElement(name, attrs=[])
+ @data = nil
+ case name
+ when "value"
+ @value = nil
+ when "nil"
+ raise "wrong/unknown XML-RPC type 'nil'" unless Config::ENABLE_NIL_PARSER
+ @value = :nil
+ when "array"
+ @val_stack << @values
+ @values = []
+ when "struct"
+ @names << @name
+ @name = []
+
+ @structs << @struct
+ @struct = {}
+ end
+ end
+
+ def endElement(name)
+ @data ||= ""
+ case name
+ when "string"
+ @value = @data
+ when "i4", "i8", "int"
+ @value = Convert.int(@data)
+ when "boolean"
+ @value = Convert.boolean(@data)
+ when "double"
+ @value = Convert.double(@data)
+ when "dateTime.iso8601"
+ @value = Convert.dateTime(@data)
+ when "base64"
+ @value = Convert.base64(@data)
+ when "value"
+ @value = @data if @value.nil?
+ @values << (@value == :nil ? nil : @value)
+ when "array"
+ @value = @values
+ @values = @val_stack.pop
+ when "struct"
+ @value = Convert.struct(@struct)
+
+ @name = @names.pop
+ @struct = @structs.pop
+ when "name"
+ @name[0] = @data
+ when "member"
+ @struct[@name[0]] = @values.pop
+
+ when "param"
+ @params << @values[0]
+ @values = []
+
+ when "fault"
+ @fault = Convert.fault(@values[0])
+
+ when "methodName"
+ @method_name = @data
+ end
+
+ @data = nil
+ end
+
+ def character(data)
+ if @data
+ @data << data
+ else
+ @data = data
+ end
+ end
+
+ end # module StreamParserMixin
+
+ class XMLStreamParser < AbstractStreamParser
+ def initialize
+ require "xmlparser"
+ @parser_class = Class.new(::XMLParser) {
+ include StreamParserMixin
+ }
+ end
+ end # class XMLStreamParser
+
+ class NQXMLStreamParser < AbstractStreamParser
+ def initialize
+ require "nqxml/streamingparser"
+ @parser_class = XMLRPCParser
+ end
+
+ class XMLRPCParser
+ include StreamParserMixin
+
+ def parse(str)
+ parser = NQXML::StreamingParser.new(str)
+ parser.each do |ele|
+ case ele
+ when NQXML::Text
+ @data = ele.text
+ #character(ele.text)
+ when NQXML::Tag
+ if ele.isTagEnd
+ endElement(ele.name)
+ else
+ startElement(ele.name, ele.attrs)
+ end
+ end
+ end # do
+ end # method parse
+ end # class XMLRPCParser
+
+ end # class NQXMLStreamParser
+
+ class XMLTreeParser < AbstractTreeParser
+
+ def initialize
+ require "xmltreebuilder"
+
+ # The new XMLParser library (0.6.2+) uses a slightly different DOM implementation.
+ # The following code removes the differences between both versions.
+ if defined? XML::DOM::Builder
+ return if defined? XML::DOM::Node::DOCUMENT # code below has been already executed
+ klass = XML::DOM::Node
+ klass.const_set(:DOCUMENT, klass::DOCUMENT_NODE)
+ klass.const_set(:TEXT, klass::TEXT_NODE)
+ klass.const_set(:COMMENT, klass::COMMENT_NODE)
+ klass.const_set(:ELEMENT, klass::ELEMENT_NODE)
+ end
+ end
+
+ private
+
+ def _nodeType(node)
+ tp = node.nodeType
+ if tp == XML::SimpleTree::Node::TEXT then :TEXT
+ elsif tp == XML::SimpleTree::Node::COMMENT then :COMMENT
+ elsif tp == XML::SimpleTree::Node::ELEMENT then :ELEMENT
+ else :ELSE
+ end
+ end
+
+
+ def methodResponse_document(node)
+ assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
+ hasOnlyOneChild(node, "methodResponse")
+
+ methodResponse(node.firstChild)
+ end
+
+ def methodCall_document(node)
+ assert( node.nodeType == XML::SimpleTree::Node::DOCUMENT )
+ hasOnlyOneChild(node, "methodCall")
+
+ methodCall(node.firstChild)
+ end
+
+ def createCleanedTree(str)
+ doc = XML::SimpleTreeBuilder.new.parse(str)
+ doc.documentElement.normalize
+ removeWhitespacesAndComments(doc)
+ doc
+ end
+
+ end # class XMLParser
+
+ class NQXMLTreeParser < AbstractTreeParser
+
+ def initialize
+ require "nqxml/treeparser"
+ end
+
+ private
+
+ def _nodeType(node)
+ node.nodeType
+ end
+
+ def methodResponse_document(node)
+ methodResponse(node)
+ end
+
+ def methodCall_document(node)
+ methodCall(node)
+ end
+
+ def createCleanedTree(str)
+ doc = ::NQXML::TreeParser.new(str).document.rootNode
+ removeWhitespacesAndComments(doc)
+ doc
+ end
+
+ end # class NQXMLTreeParser
+
+ class REXMLStreamParser < AbstractStreamParser
+ def initialize
+ require "rexml/document"
+ @parser_class = StreamListener
+ end
+
+ class StreamListener
+ include StreamParserMixin
+
+ alias :tag_start :startElement
+ alias :tag_end :endElement
+ alias :text :character
+ alias :cdata :character
+
+ def method_missing(*a)
+ # ignore
+ end
+
+ def parse(str)
+ REXML::Document.parse_stream(str, self)
+ end
+ end
+
+ end
+
+ class XMLScanStreamParser < AbstractStreamParser
+ def initialize
+ require "xmlscan/parser"
+ @parser_class = XMLScanParser
+ end
+
+ class XMLScanParser
+ include StreamParserMixin
+
+ Entities = {
+ "lt" => "<",
+ "gt" => ">",
+ "amp" => "&",
+ "quot" => '"',
+ "apos" => "'"
+ }
+
+ def parse(str)
+ parser = XMLScan::XMLParser.new(self)
+ parser.parse(str)
+ end
+
+ alias :on_stag :startElement
+ alias :on_etag :endElement
+
+ def on_stag_end(name); end
+
+ def on_stag_end_empty(name)
+ startElement(name)
+ endElement(name)
+ end
+
+ def on_chardata(str)
+ character(str)
+ end
+
+ def on_cdata(str)
+ character(str)
+ end
+
+ def on_entityref(ent)
+ str = Entities[ent]
+ if str
+ character(str)
+ else
+ raise "unknown entity"
+ end
+ end
+
+ def on_charref(code)
+ character(code.chr)
+ end
+
+ def on_charref_hex(code)
+ character(code.chr)
+ end
+
+ def method_missing(*a)
+ end
+
+ # TODO: call/implement?
+ # valid_name?
+ # valid_chardata?
+ # valid_char?
+ # parse_error
+
+ end
+ end
+
+ XMLParser = XMLTreeParser
+ NQXMLParser = NQXMLTreeParser
+
+ Classes = [XMLStreamParser, XMLTreeParser,
+ NQXMLStreamParser, NQXMLTreeParser,
+ REXMLStreamParser, XMLScanStreamParser]
+
+ # yields an instance of each installed parser
+ def self.each_installed_parser
+ XMLRPC::XMLParser::Classes.each do |klass|
+ begin
+ yield klass.new
+ rescue LoadError
+ end
+ end
+ end
+
+ end # module XMLParser
+
+
+end # module XMLRPC
+
diff --git a/lib/xmlrpc/server.rb b/lib/xmlrpc/server.rb
new file mode 100644
index 0000000000..64856ea1fa
--- /dev/null
+++ b/lib/xmlrpc/server.rb
@@ -0,0 +1,707 @@
+# xmlrpc/server.rb
+# Copyright (C) 2001, 2002, 2003, 2005 by Michael Neumann (mneumann@ntecs.de)
+#
+# Released under the same term of license as Ruby.
+
+require "xmlrpc/parser"
+require "xmlrpc/create"
+require "xmlrpc/config"
+require "xmlrpc/utils" # ParserWriterChooseMixin
+
+
+
+module XMLRPC # :nodoc:
+
+
+# This is the base class for all XML-RPC server-types (CGI, standalone).
+# You can add handler and set a default handler.
+# Do not use this server, as this is/should be an abstract class.
+#
+# === How the method to call is found
+# The arity (number of accepted arguments) of a handler (method or Proc
+# object) is compared to the given arguments submitted by the client for a
+# RPC, or Remote Procedure Call.
+#
+# A handler is only called if it accepts the number of arguments, otherwise
+# the search for another handler will go on. When at the end no handler was
+# found, the default_handler, XMLRPC::BasicServer#set_default_handler will be
+# called.
+#
+# With this technique it is possible to do overloading by number of parameters, but
+# only for Proc handler, because you cannot define two methods of the same name in
+# the same class.
+class BasicServer
+
+ include ParserWriterChooseMixin
+ include ParseContentType
+
+ ERR_METHOD_MISSING = 1
+ ERR_UNCAUGHT_EXCEPTION = 2
+ ERR_MC_WRONG_PARAM = 3
+ ERR_MC_MISSING_PARAMS = 4
+ ERR_MC_MISSING_METHNAME = 5
+ ERR_MC_RECURSIVE_CALL = 6
+ ERR_MC_WRONG_PARAM_PARAMS = 7
+ ERR_MC_EXPECTED_STRUCT = 8
+
+
+ # Creates a new XMLRPC::BasicServer instance, which should not be
+ # done, because XMLRPC::BasicServer is an abstract class. This
+ # method should be called from a subclass indirectly by a +super+ call
+ # in the initialize method.
+ #
+ # The parameter +class_delim+ is used by add_handler, see
+ # XMLRPC::BasicServer#add_handler, when an object is added as a handler, to
+ # delimit the object-prefix and the method-name.
+ def initialize(class_delim=".")
+ @handler = []
+ @default_handler = nil
+ @service_hook = nil
+
+ @class_delim = class_delim
+ @create = nil
+ @parser = nil
+
+ add_multicall if Config::ENABLE_MULTICALL
+ add_introspection if Config::ENABLE_INTROSPECTION
+ end
+
+ # Adds +aBlock+ to the list of handlers, with +name+ as the name of
+ # the method.
+ #
+ # Parameters +signature+ and +help+ are used by the Introspection method if
+ # specified, where +signature+ is either an Array containing strings each
+ # representing a type of it's signature (the first is the return value) or
+ # an Array of Arrays if the method has multiple signatures.
+ #
+ # Value type-names are "int, boolean, double, string, dateTime.iso8601,
+ # base64, array, struct".
+ #
+ # Parameter +help+ is a String with information about how to call this method etc.
+ #
+ # When a method fails, it can tell the client by throwing an
+ # XMLRPC::FaultException like in this example:
+ #
+ # s.add_handler("michael.div") do |a,b|
+ # if b == 0
+ # raise XMLRPC::FaultException.new(1, "division by zero")
+ # else
+ # a / b
+ # end
+ # end
+ #
+ # In the case of <code>b==0</code> the client gets an object back of type
+ # XMLRPC::FaultException that has a +faultCode+ and +faultString+ field.
+ #
+ # This is the second form of ((<add_handler|XMLRPC::BasicServer#add_handler>)).
+ # To add an object write:
+ #
+ # server.add_handler("michael", MyHandlerClass.new)
+ #
+ # All public methods of MyHandlerClass are accessible to
+ # the XML-RPC clients by <code>michael."name of method"</code>. This is
+ # where the +class_delim+ in XMLRPC::BasicServer.new plays it's role, a
+ # XML-RPC method-name is defined by +prefix+ + +class_delim+ + <code>"name
+ # of method"</code>.
+ #
+ # The third form of +add_handler is to use XMLRPC::Service::Interface to
+ # generate an object, which represents an interface (with signature and
+ # help text) for a handler class.
+ #
+ # The +interface+ parameter must be an instance of XMLRPC::Service::Interface.
+ # Adds all methods of +obj+ which are defined in the +interface+ to the server.
+ #
+ # This is the recommended way of adding services to a server!
+ def add_handler(prefix, obj_or_signature=nil, help=nil, &block)
+ if block_given?
+ # proc-handler
+ @handler << [prefix, block, obj_or_signature, help]
+ else
+ if prefix.kind_of? String
+ # class-handler
+ raise ArgumentError, "Expected non-nil value" if obj_or_signature.nil?
+ @handler << [prefix + @class_delim, obj_or_signature]
+ elsif prefix.kind_of? XMLRPC::Service::BasicInterface
+ # class-handler with interface
+ # add all methods
+ @handler += prefix.get_methods(obj_or_signature, @class_delim)
+ else
+ raise ArgumentError, "Wrong type for parameter 'prefix'"
+ end
+ end
+ self
+ end
+
+ # Returns the service-hook, which is called on each service request (RPC)
+ # unless it's +nil+.
+ def get_service_hook
+ @service_hook
+ end
+
+ # A service-hook is called for each service request (RPC).
+ #
+ # You can use a service-hook for example to wrap existing methods and catch
+ # exceptions of them or convert values to values recognized by XMLRPC.
+ #
+ # You can disable it by passing +nil+ as the +handler+ parameter.
+ #
+ # The service-hook is called with a Proc object along with any parameters.
+ #
+ # An example:
+ #
+ # server.set_service_hook {|obj, *args|
+ # begin
+ # ret = obj.call(*args) # call the original service-method
+ # # could convert the return value
+ # rescue
+ # # rescue exceptions
+ # end
+ # }
+ #
+ def set_service_hook(&handler)
+ @service_hook = handler
+ self
+ end
+
+ # Returns the default-handler, which is called when no handler for
+ # a method-name is found.
+ #
+ # It is either a Proc object or +nil+.
+ def get_default_handler
+ @default_handler
+ end
+
+ # Sets +handler+ as the default-handler, which is called when
+ # no handler for a method-name is found.
+ #
+ # +handler+ is a code-block.
+ #
+ # The default-handler is called with the (XML-RPC) method-name as first
+ # argument, and the other arguments are the parameters given by the
+ # client-call.
+ #
+ # If no block is specified the default of XMLRPC::BasicServer is
+ # used, which raises a XMLRPC::FaultException saying "method missing".
+ def set_default_handler(&handler)
+ @default_handler = handler
+ self
+ end
+
+ # Adds the multi-call handler <code>"system.multicall"</code>.
+ def add_multicall
+ add_handler("system.multicall", %w(array array), "Multicall Extension") do |arrStructs|
+ unless arrStructs.is_a? Array
+ raise XMLRPC::FaultException.new(ERR_MC_WRONG_PARAM, "system.multicall expects an array")
+ end
+
+ arrStructs.collect {|call|
+ if call.is_a? Hash
+ methodName = call["methodName"]
+ params = call["params"]
+
+ if params.nil?
+ multicall_fault(ERR_MC_MISSING_PARAMS, "Missing params")
+ elsif methodName.nil?
+ multicall_fault(ERR_MC_MISSING_METHNAME, "Missing methodName")
+ else
+ if methodName == "system.multicall"
+ multicall_fault(ERR_MC_RECURSIVE_CALL, "Recursive system.multicall forbidden")
+ else
+ unless params.is_a? Array
+ multicall_fault(ERR_MC_WRONG_PARAM_PARAMS, "Parameter params have to be an Array")
+ else
+ ok, val = call_method(methodName, *params)
+ if ok
+ # correct return value
+ [val]
+ else
+ # exception
+ multicall_fault(val.faultCode, val.faultString)
+ end
+ end
+ end
+ end
+
+ else
+ multicall_fault(ERR_MC_EXPECTED_STRUCT, "system.multicall expected struct")
+ end
+ }
+ end # end add_handler
+ self
+ end
+
+ # Adds the introspection handlers <code>"system.listMethods"</code>,
+ # <code>"system.methodSignature"</code> and
+ # <code>"system.methodHelp"</code>, where only the first one works.
+ def add_introspection
+ add_handler("system.listMethods",%w(array), "List methods available on this XML-RPC server") do
+ methods = []
+ @handler.each do |name, obj|
+ if obj.kind_of? Proc
+ methods << name
+ else
+ obj.class.public_instance_methods(false).each do |meth|
+ methods << "#{name}#{meth}"
+ end
+ end
+ end
+ methods
+ end
+
+ add_handler("system.methodSignature", %w(array string), "Returns method signature") do |meth|
+ sigs = []
+ @handler.each do |name, obj, sig|
+ if obj.kind_of? Proc and sig != nil and name == meth
+ if sig[0].kind_of? Array
+ # sig contains multiple signatures, e.g. [["array"], ["array", "string"]]
+ sig.each {|s| sigs << s}
+ else
+ # sig is a single signature, e.g. ["array"]
+ sigs << sig
+ end
+ end
+ end
+ sigs.uniq! || sigs # remove eventually duplicated signatures
+ end
+
+ add_handler("system.methodHelp", %w(string string), "Returns help on using this method") do |meth|
+ help = nil
+ @handler.each do |name, obj, sig, hlp|
+ if obj.kind_of? Proc and name == meth
+ help = hlp
+ break
+ end
+ end
+ help || ""
+ end
+
+ self
+ end
+
+
+
+ def process(data)
+ method, params = parser().parseMethodCall(data)
+ handle(method, *params)
+ end
+
+ private
+
+ def multicall_fault(nr, str)
+ {"faultCode" => nr, "faultString" => str}
+ end
+
+ def dispatch(methodname, *args)
+ for name, obj in @handler
+ if obj.kind_of? Proc
+ next unless methodname == name
+ else
+ next unless methodname =~ /^#{name}(.+)$/
+ next unless obj.respond_to? $1
+ obj = obj.method($1)
+ end
+
+ if check_arity(obj, args.size)
+ if @service_hook.nil?
+ return obj.call(*args)
+ else
+ return @service_hook.call(obj, *args)
+ end
+ end
+ end
+
+ if @default_handler.nil?
+ raise XMLRPC::FaultException.new(ERR_METHOD_MISSING, "Method #{methodname} missing or wrong number of parameters!")
+ else
+ @default_handler.call(methodname, *args)
+ end
+ end
+
+
+ # Returns +true+, if the arity of +obj+ matches +n_args+
+ def check_arity(obj, n_args)
+ ary = obj.arity
+
+ if ary >= 0
+ n_args == ary
+ else
+ n_args >= (ary+1).abs
+ end
+ end
+
+
+
+ def call_method(methodname, *args)
+ begin
+ [true, dispatch(methodname, *args)]
+ rescue XMLRPC::FaultException => e
+ [false, e]
+ rescue Exception => e
+ [false, XMLRPC::FaultException.new(ERR_UNCAUGHT_EXCEPTION, "Uncaught exception #{e.message} in method #{methodname}")]
+ end
+ end
+
+ def handle(methodname, *args)
+ create().methodResponse(*call_method(methodname, *args))
+ end
+
+
+end
+
+
+# Implements a CGI-based XML-RPC server.
+#
+# require "xmlrpc/server"
+#
+# s = XMLRPC::CGIServer.new
+#
+# s.add_handler("michael.add") do |a,b|
+# a + b
+# end
+#
+# s.add_handler("michael.div") do |a,b|
+# if b == 0
+# raise XMLRPC::FaultException.new(1, "division by zero")
+# else
+# a / b
+# end
+# end
+#
+# s.set_default_handler do |name, *args|
+# raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
+# " or wrong number of parameters!")
+# end
+#
+# s.serve
+#
+#
+# <b>Note:</b> Make sure that you don't write to standard-output in a
+# handler, or in any other part of your program, this would cause a CGI-based
+# server to fail!
+class CGIServer < BasicServer
+ @@obj = nil
+
+ # Creates a new XMLRPC::CGIServer instance.
+ #
+ # All parameters given are by-passed to XMLRPC::BasicServer.new.
+ #
+ # You can only create <b>one</b> XMLRPC::CGIServer instance, because more
+ # than one makes no sense.
+ def CGIServer.new(*a)
+ @@obj = super(*a) if @@obj.nil?
+ @@obj
+ end
+
+ def initialize(*a)
+ super(*a)
+ end
+
+ # Call this after you have added all you handlers to the server.
+ #
+ # This method processes a XML-RPC method call and sends the answer
+ # back to the client.
+ def serve
+ catch(:exit_serve) {
+ length = ENV['CONTENT_LENGTH'].to_i
+
+ http_error(405, "Method Not Allowed") unless ENV['REQUEST_METHOD'] == "POST"
+ http_error(400, "Bad Request") unless parse_content_type(ENV['CONTENT_TYPE']).first == "text/xml"
+ http_error(411, "Length Required") unless length > 0
+
+ # TODO: do we need a call to binmode?
+ $stdin.binmode if $stdin.respond_to? :binmode
+ data = $stdin.read(length)
+
+ http_error(400, "Bad Request") if data.nil? or data.bytesize != length
+
+ http_write(process(data), "Content-type" => "text/xml; charset=utf-8")
+ }
+ end
+
+
+ private
+
+ def http_error(status, message)
+ err = "#{status} #{message}"
+ msg = <<-"MSGEND"
+ <html>
+ <head>
+ <title>#{err}</title>
+ </head>
+ <body>
+ <h1>#{err}</h1>
+ <p>Unexpected error occurred while processing XML-RPC request!</p>
+ </body>
+ </html>
+ MSGEND
+
+ http_write(msg, "Status" => err, "Content-type" => "text/html")
+ throw :exit_serve # exit from the #serve method
+ end
+
+ def http_write(body, header)
+ h = {}
+ header.each {|key, value| h[key.to_s.capitalize] = value}
+ h['Status'] ||= "200 OK"
+ h['Content-length'] ||= body.bytesize.to_s
+
+ str = ""
+ h.each {|key, value| str << "#{key}: #{value}\r\n"}
+ str << "\r\n#{body}"
+
+ print str
+ end
+
+end
+
+
+# Implements a XML-RPC server, which works with Apache mod_ruby.
+#
+# Use it in the same way as XMLRPC::CGIServer!
+class ModRubyServer < BasicServer
+
+ # Creates a new XMLRPC::ModRubyServer instance.
+ #
+ # All parameters given are by-passed to XMLRPC::BasicServer.new.
+ def initialize(*a)
+ @ap = Apache::request
+ super(*a)
+ end
+
+ # Call this after you have added all you handlers to the server.
+ #
+ # This method processes a XML-RPC method call and sends the answer
+ # back to the client.
+ def serve
+ catch(:exit_serve) {
+ header = {}
+ @ap.headers_in.each {|key, value| header[key.capitalize] = value}
+
+ length = header['Content-length'].to_i
+
+ http_error(405, "Method Not Allowed") unless @ap.request_method == "POST"
+ http_error(400, "Bad Request") unless parse_content_type(header['Content-type']).first == "text/xml"
+ http_error(411, "Length Required") unless length > 0
+
+ # TODO: do we need a call to binmode?
+ @ap.binmode
+ data = @ap.read(length)
+
+ http_error(400, "Bad Request") if data.nil? or data.bytesize != length
+
+ http_write(process(data), 200, "Content-type" => "text/xml; charset=utf-8")
+ }
+ end
+
+
+ private
+
+ def http_error(status, message)
+ err = "#{status} #{message}"
+ msg = <<-"MSGEND"
+ <html>
+ <head>
+ <title>#{err}</title>
+ </head>
+ <body>
+ <h1>#{err}</h1>
+ <p>Unexpected error occurred while processing XML-RPC request!</p>
+ </body>
+ </html>
+ MSGEND
+
+ http_write(msg, status, "Status" => err, "Content-type" => "text/html")
+ throw :exit_serve # exit from the #serve method
+ end
+
+ def http_write(body, status, header)
+ h = {}
+ header.each {|key, value| h[key.to_s.capitalize] = value}
+ h['Status'] ||= "200 OK"
+ h['Content-length'] ||= body.bytesize.to_s
+
+ h.each {|key, value| @ap.headers_out[key] = value }
+ @ap.content_type = h["Content-type"]
+ @ap.status = status.to_i
+ @ap.send_http_header
+
+ @ap.print body
+ end
+
+end
+
+
+class WEBrickServlet < BasicServer; end # forward declaration
+
+# Implements a standalone XML-RPC server. The method XMLRPC::Server#serve is
+# left if a SIGHUP is sent to the program.
+#
+# require "xmlrpc/server"
+#
+# s = XMLRPC::Server.new(8080)
+#
+# s.add_handler("michael.add") do |a,b|
+# a + b
+# end
+#
+# s.add_handler("michael.div") do |a,b|
+# if b == 0
+# raise XMLRPC::FaultException.new(1, "division by zero")
+# else
+# a / b
+# end
+# end
+#
+# s.set_default_handler do |name, *args|
+# raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
+# " or wrong number of parameters!")
+# end
+#
+# s.serve
+class Server < WEBrickServlet
+
+ # Creates a new XMLRPC::Server instance, which is a XML-RPC server
+ # listening on the given +port+ and accepts requests for the given +host+,
+ # which is +localhost+ by default.
+ #
+ # The server is not started, to start it you have to call
+ # XMLRPC::Server#serve.
+ #
+ # The optional +audit+ and +debug+ parameters are obsolete!
+ #
+ # All additionally provided parameters in <code>*a</code> are by-passed to
+ # XMLRPC::BasicServer.new.
+ def initialize(port=8080, host="127.0.0.1", maxConnections=4, stdlog=$stdout, audit=true, debug=true, *a)
+ super(*a)
+ require 'webrick'
+ @server = WEBrick::HTTPServer.new(:Port => port, :BindAddress => host, :MaxClients => maxConnections,
+ :Logger => WEBrick::Log.new(stdlog))
+ @server.mount("/", self)
+ end
+
+ # Call this after you have added all you handlers to the server.
+ # This method starts the server to listen for XML-RPC requests and answer them.
+ def serve
+ signals = %w[INT TERM HUP] & Signal.list.keys
+ signals.each { |signal| trap(signal) { @server.shutdown } }
+
+ @server.start
+ end
+
+ # Stops and shuts the server down.
+ def shutdown
+ @server.shutdown
+ end
+
+end
+
+
+# Implements a servlet for use with WEBrick, a pure Ruby (HTTP) server
+# framework.
+#
+# require "webrick"
+# require "xmlrpc/server"
+#
+# s = XMLRPC::WEBrickServlet.new
+# s.add_handler("michael.add") do |a,b|
+# a + b
+# end
+#
+# s.add_handler("michael.div") do |a,b|
+# if b == 0
+# raise XMLRPC::FaultException.new(1, "division by zero")
+# else
+# a / b
+# end
+# end
+#
+# s.set_default_handler do |name, *args|
+# raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
+# " or wrong number of parameters!")
+# end
+#
+# httpserver = WEBrick::HTTPServer.new(:Port => 8080)
+# httpserver.mount("/RPC2", s)
+# trap("HUP") { httpserver.shutdown } # use 1 instead of "HUP" on Windows
+# httpserver.start
+class WEBrickServlet < BasicServer
+ def initialize(*a)
+ super
+ require "webrick/httpstatus"
+ @valid_ip = nil
+ end
+
+ # Deprecated from WEBrick/1.2.2, but does not break anything.
+ def require_path_info?
+ false
+ end
+
+ def get_instance(config, *options)
+ # TODO: set config & options
+ self
+ end
+
+ # Specifies the valid IP addresses that are allowed to connect to the server.
+ #
+ # Each IP is either a String or a Regexp.
+ def set_valid_ip(*ip_addr)
+ if ip_addr.size == 1 and ip_addr[0].nil?
+ @valid_ip = nil
+ else
+ @valid_ip = ip_addr
+ end
+ end
+
+ # Return the valid IP addresses that are allowed to connect to the server.
+ #
+ # See also, XMLRPC::Server#set_valid_ip
+ def get_valid_ip
+ @valid_ip
+ end
+
+ def service(request, response)
+
+ if @valid_ip
+ raise WEBrick::HTTPStatus::Forbidden unless @valid_ip.any? { |ip| request.peeraddr[3] =~ ip }
+ end
+
+ if request.request_method != "POST"
+ raise WEBrick::HTTPStatus::MethodNotAllowed,
+ "unsupported method `#{request.request_method}'."
+ end
+
+ if parse_content_type(request['Content-type']).first != "text/xml"
+ raise WEBrick::HTTPStatus::BadRequest
+ end
+
+ length = (request['Content-length'] || 0).to_i
+
+ raise WEBrick::HTTPStatus::LengthRequired unless length > 0
+
+ data = request.body
+
+ if data.nil? or data.bytesize != length
+ raise WEBrick::HTTPStatus::BadRequest
+ end
+
+ resp = process(data)
+ if resp.nil? or resp.bytesize <= 0
+ raise WEBrick::HTTPStatus::InternalServerError
+ end
+
+ response.status = 200
+ response['Content-Length'] = resp.bytesize
+ response['Content-Type'] = "text/xml; charset=utf-8"
+ response.body = resp
+ end
+end
+
+
+end # module XMLRPC
+
+
+=begin
+= History
+ $Id$
+=end
+
diff --git a/lib/xmlrpc/utils.rb b/lib/xmlrpc/utils.rb
new file mode 100644
index 0000000000..186938a56e
--- /dev/null
+++ b/lib/xmlrpc/utils.rb
@@ -0,0 +1,171 @@
+#
+# Copyright (C) 2001, 2002, 2003 by Michael Neumann (mneumann@ntecs.de)
+#
+# $Id$
+#
+module XMLRPC # :nodoc:
+
+
+ # This module enables a user-class to be marshalled
+ # by XML-RPC for Ruby into a Hash, with one additional
+ # key/value pair <code>___class___ => ClassName</code>
+ #
+ module Marshallable
+ end
+
+
+ # Defines ParserWriterChooseMixin, which makes it possible to choose a
+ # different XMLWriter and/or XMLParser then the default one.
+ #
+ # The Mixin is used in client.rb (class XMLRPC::Client)
+ # and server.rb (class XMLRPC::BasicServer)
+ module ParserWriterChooseMixin
+
+ # Sets the XMLWriter to use for generating XML output.
+ #
+ # Should be an instance of a class from module XMLRPC::XMLWriter.
+ #
+ # If this method is not called, then XMLRPC::Config::DEFAULT_WRITER is used.
+ def set_writer(writer)
+ @create = Create.new(writer)
+ self
+ end
+
+ # Sets the XMLParser to use for parsing XML documents.
+ #
+ # Should be an instance of a class from module XMLRPC::XMLParser.
+ #
+ # If this method is not called, then XMLRPC::Config::DEFAULT_PARSER is used.
+ def set_parser(parser)
+ @parser = parser
+ self
+ end
+
+ private
+
+ def create
+ # if set_writer was not already called then call it now
+ if @create.nil? then
+ set_writer(Config::DEFAULT_WRITER.new)
+ end
+ @create
+ end
+
+ def parser
+ # if set_parser was not already called then call it now
+ if @parser.nil? then
+ set_parser(Config::DEFAULT_PARSER.new)
+ end
+ @parser
+ end
+
+ end # module ParserWriterChooseMixin
+
+
+ module Service
+
+ # Base class for XMLRPC::Service::Interface definitions, used
+ # by XMLRPC::BasicServer#add_handler
+ class BasicInterface
+ attr_reader :prefix, :methods
+
+ def initialize(prefix)
+ @prefix = prefix
+ @methods = []
+ end
+
+ def add_method(sig, help=nil, meth_name=nil)
+ mname = nil
+ sig = [sig] if sig.kind_of? String
+
+ sig = sig.collect do |s|
+ name, si = parse_sig(s)
+ raise "Wrong signatures!" if mname != nil and name != mname
+ mname = name
+ si
+ end
+
+ @methods << [mname, meth_name || mname, sig, help]
+ end
+
+ private
+
+ def parse_sig(sig)
+ # sig is a String
+ if sig =~ /^\s*(\w+)\s+([^(]+)(\(([^)]*)\))?\s*$/
+ params = [$1]
+ name = $2.strip
+ $4.split(",").each {|i| params << i.strip} if $4 != nil
+ return name, params
+ else
+ raise "Syntax error in signature"
+ end
+ end
+
+ end # class BasicInterface
+
+ #
+ # Class which wraps a XMLRPC::Service::Interface definition, used
+ # by XMLRPC::BasicServer#add_handler
+ #
+ class Interface < BasicInterface
+ def initialize(prefix, &p)
+ raise "No interface specified" if p.nil?
+ super(prefix)
+ instance_eval(&p)
+ end
+
+ def get_methods(obj, delim=".")
+ prefix = @prefix + delim
+ @methods.collect { |name, meth, sig, help|
+ [prefix + name.to_s, obj.method(meth).to_proc, sig, help]
+ }
+ end
+
+ private
+
+ def meth(*a)
+ add_method(*a)
+ end
+
+ end # class Interface
+
+ class PublicInstanceMethodsInterface < BasicInterface
+ def initialize(prefix)
+ super(prefix)
+ end
+
+ def get_methods(obj, delim=".")
+ prefix = @prefix + delim
+ obj.class.public_instance_methods(false).collect { |name|
+ [prefix + name.to_s, obj.method(name).to_proc, nil, nil]
+ }
+ end
+ end
+
+
+ end # module Service
+
+
+ #
+ # Short-form to create a XMLRPC::Service::Interface
+ #
+ def self.interface(prefix, &p)
+ Service::Interface.new(prefix, &p)
+ end
+
+ # Short-cut for creating a XMLRPC::Service::PublicInstanceMethodsInterface
+ def self.iPIMethods(prefix)
+ Service::PublicInstanceMethodsInterface.new(prefix)
+ end
+
+
+ module ParseContentType
+ def parse_content_type(str)
+ a, *b = str.split(";")
+ return a.strip.downcase, *b
+ end
+ end
+
+end # module XMLRPC
+
diff --git a/lib/yaml.rb b/lib/yaml.rb
index aa0a1eb470..c0ffcf877b 100644
--- a/lib/yaml.rb
+++ b/lib/yaml.rb
@@ -1,13 +1,12 @@
-# frozen_string_literal: false
##
# The YAML module is an alias of Psych, the YAML engine for Ruby.
begin
require 'psych'
rescue LoadError
- warn "It seems your ruby installation is missing psych (for YAML output).\n" \
- "To eliminate this warning, please install libyaml and reinstall your ruby.\n",
- uplevel: 1
+ warn "#{caller[0]}:"
+ warn "It seems your ruby installation is missing psych (for YAML output)."
+ warn "To eliminate this warning, please install libyaml and reinstall your ruby."
raise
end
@@ -53,7 +52,7 @@ YAML = Psych # :nodoc:
# For more advanced details on the implementation see Psych, and also check out
# http://yaml.org for spec details and other helpful information.
#
-# Psych is maintained by Aaron Patterson on github: https://github.com/tenderlove/psych
+# Pysch is maintained by Aaron Patterson on github: https://github.com/tenderlove/psych
#
# Syck can also be found on github: https://github.com/tenderlove/syck
module YAML
diff --git a/lib/yaml/dbm.rb b/lib/yaml/dbm.rb
index e2508cd74b..24a68bfa71 100644
--- a/lib/yaml/dbm.rb
+++ b/lib/yaml/dbm.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'yaml'
require 'dbm'
diff --git a/lib/yaml/store.rb b/lib/yaml/store.rb
index 3c9b8817e4..b0b580ba1a 100644
--- a/lib/yaml/store.rb
+++ b/lib/yaml/store.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# YAML::Store
#
@@ -40,28 +39,22 @@ class YAML::Store < PStore
# :call-seq:
# initialize( file_name, yaml_opts = {} )
- # initialize( file_name, thread_safe = false, yaml_opts = {} )
#
# Creates a new YAML::Store object, which will store data in +file_name+.
# If the file does not already exist, it will be created.
#
- # YAML::Store objects are always reentrant. But if _thread_safe_ is set to true,
- # then it will become thread-safe at the cost of a minor performance hit.
#
# Options passed in through +yaml_opts+ will be used when converting the
# store to YAML via Hash#to_yaml().
- def initialize( *o )
- @opt = {}
- if o.last.is_a? Hash
- @opt.update(o.pop)
- end
- super(*o)
+ def initialize file_name, yaml_opts = {}
+ @opt = yaml_opts
+ super
end
# :stopdoc:
def dump(table)
- table.to_yaml(@opt)
+ YAML.dump @table
end
def load(content)
@@ -77,10 +70,12 @@ class YAML::Store < PStore
false
end
+ EMPTY_MARSHAL_DATA = YAML.dump({})
+ EMPTY_MARSHAL_CHECKSUM = Digest::MD5.digest(EMPTY_MARSHAL_DATA)
def empty_marshal_data
- {}.to_yaml(@opt)
+ EMPTY_MARSHAL_DATA
end
def empty_marshal_checksum
- CHECKSUM_ALGO.digest(empty_marshal_data)
+ EMPTY_MARSHAL_CHECKSUM
end
end
diff --git a/load.c b/load.c
index cfc8b1f032..e88abfbb0c 100644
--- a/load.c
+++ b/load.c
@@ -2,13 +2,15 @@
* load methods from eval.c
*/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/util.h"
+#include "internal.h"
#include "dln.h"
#include "eval_intern.h"
#include "probes.h"
+#include "node.h"
-static VALUE ruby_dln_librefs;
+VALUE ruby_dln_librefs;
#define IS_RBEXT(e) (strcmp((e), ".rb") == 0)
#define IS_SOEXT(e) (strcmp((e), ".so") == 0 || strcmp((e), ".o") == 0)
@@ -46,7 +48,7 @@ enum expand_type {
string objects in $LOAD_PATH are frozen.
*/
static void
-rb_construct_expanded_load_path(enum expand_type type, int *has_relative, int *has_non_cache)
+rb_construct_expanded_load_path(int type, int *has_relative, int *has_non_cache)
{
rb_vm_t *vm = GET_VM();
VALUE load_path = vm->load_path;
@@ -85,15 +87,24 @@ rb_construct_expanded_load_path(enum expand_type type, int *has_relative, int *h
if (is_string)
rb_str_freeze(path);
as_str = rb_get_path_check_convert(path, as_str, level);
- expanded_path = rb_check_realpath(Qnil, as_str);
- if (NIL_P(expanded_path)) expanded_path = as_str;
- rb_ary_push(ary, rb_fstring(expanded_path));
+ expanded_path = rb_file_expand_path_fast(as_str, Qnil);
+ rb_str_freeze(expanded_path);
+ rb_ary_push(ary, expanded_path);
}
rb_obj_freeze(ary);
vm->expanded_load_path = ary;
rb_ary_replace(vm->load_path_snapshot, vm->load_path);
}
+static VALUE
+load_path_getcwd(void)
+{
+ char *cwd = my_getcwd();
+ VALUE cwd_str = rb_filesystem_str_new_cstr(cwd);
+ xfree(cwd);
+ return cwd_str;
+}
+
VALUE
rb_get_expanded_load_path(void)
{
@@ -105,7 +116,7 @@ rb_get_expanded_load_path(void)
int has_relative = 0, has_non_cache = 0;
rb_construct_expanded_load_path(EXPAND_ALL, &has_relative, &has_non_cache);
if (has_relative) {
- vm->load_path_check_cache = rb_dir_getwd_ospath();
+ vm->load_path_check_cache = load_path_getcwd();
}
else if (has_non_cache) {
/* Non string object. */
@@ -123,7 +134,7 @@ rb_get_expanded_load_path(void)
}
else if (vm->load_path_check_cache) {
int has_relative = 1, has_non_cache = 1;
- VALUE cwd = rb_dir_getwd_ospath();
+ VALUE cwd = load_path_getcwd();
if (!rb_str_equal(vm->load_path_check_cache, cwd)) {
/* Current working directory or filesystem encoding was changed.
Expand relative load path and non-cacheable objects again. */
@@ -206,8 +217,8 @@ features_index_add_single(VALUE short_feature, VALUE offset)
/* Add to the loaded-features index all the required entries for
`feature`, located at `offset` in $LOADED_FEATURES. We add an
index entry at each string `short_feature` for which
- feature == "#{prefix}#{short_feature}#{ext}"
- where `ext` is empty or matches %r{^\.[^./]*$}, and `prefix` is empty
+ feature == "#{prefix}#{short_feature}#{e}"
+ where `e` is empty or matches %r{^\.[^./]*$}, and `prefix` is empty
or ends in '/'. This maintains the invariant that `rb_feature_p()`
relies on for its fast lookup.
*/
@@ -221,28 +232,25 @@ features_index_add(VALUE feature, VALUE offset)
feature_end = feature_str + RSTRING_LEN(feature);
for (ext = feature_end; ext > feature_str; ext--)
- if (*ext == '.' || *ext == '/')
- break;
+ if (*ext == '.' || *ext == '/')
+ break;
if (*ext != '.')
- ext = NULL;
+ ext = NULL;
/* Now `ext` points to the only string matching %r{^\.[^./]*$} that is
at the end of `feature`, or is NULL if there is no such string. */
p = ext ? ext : feature_end;
while (1) {
- long beg;
-
p--;
while (p >= feature_str && *p != '/')
p--;
if (p < feature_str)
break;
/* Now *p == '/'. We reach this point for every '/' in `feature`. */
- beg = p + 1 - feature_str;
- short_feature = rb_str_subseq(feature, beg, feature_end - p - 1);
+ short_feature = rb_str_subseq(feature, p + 1 - feature_str, feature_end - p - 1);
features_index_add_single(short_feature, offset);
if (ext) {
- short_feature = rb_str_subseq(feature, beg, ext - p - 1);
+ short_feature = rb_str_subseq(feature, p + 1 - feature_str, ext - p - 1);
features_index_add_single(short_feature, offset);
}
}
@@ -281,9 +289,9 @@ get_loaded_features_index(void)
VALUE entry, as_str;
as_str = entry = rb_ary_entry(features, i);
StringValue(as_str);
- as_str = rb_fstring(rb_str_freeze(as_str));
if (as_str != entry)
rb_ary_store(features, i, as_str);
+ rb_str_freeze(as_str);
features_index_add(as_str, INT2FIX(i));
}
reset_loaded_features_snapshot();
@@ -311,7 +319,7 @@ loaded_feature_path(const char *name, long vlen, const char *feature, long len,
const char *e;
if (vlen < len+1) return 0;
- if (strchr(feature, '.') && !strncmp(name+(vlen-len), feature, len)) {
+ if (!strncmp(name+(vlen-len), feature, len)) {
plen = vlen - len;
}
else {
@@ -457,54 +465,56 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c
}
loading_tbl = get_loading_table();
- f = 0;
- if (!expanded) {
- struct loaded_feature_searching fs;
- fs.name = feature;
- fs.len = len;
- fs.type = type;
- fs.load_path = load_path ? load_path : rb_get_expanded_load_path();
- fs.result = 0;
- st_foreach(loading_tbl, loaded_feature_path_i, (st_data_t)&fs);
- if ((f = fs.result) != 0) {
- if (fn) *fn = f;
- goto loading;
- }
- }
- if (st_get_key(loading_tbl, (st_data_t)feature, &data)) {
- if (fn) *fn = (const char*)data;
- loading:
- if (!ext) return 'u';
- return !IS_RBEXT(ext) ? 's' : 'r';
- }
- else {
- VALUE bufstr;
- char *buf;
- static const char so_ext[][4] = {
- ".so", ".o",
- };
-
- if (ext && *ext) return 0;
- bufstr = rb_str_tmp_new(len + DLEXT_MAXLEN);
- buf = RSTRING_PTR(bufstr);
- MEMCPY(buf, feature, char, len);
- for (i = 0; (e = loadable_ext[i]) != 0; i++) {
- strlcpy(buf + len, e, DLEXT_MAXLEN + 1);
- if (st_get_key(loading_tbl, (st_data_t)buf, &data)) {
- rb_str_resize(bufstr, 0);
- if (fn) *fn = (const char*)data;
- return i ? 's' : 'r';
+ if (loading_tbl) {
+ f = 0;
+ if (!expanded) {
+ struct loaded_feature_searching fs;
+ fs.name = feature;
+ fs.len = len;
+ fs.type = type;
+ fs.load_path = load_path ? load_path : rb_get_expanded_load_path();
+ fs.result = 0;
+ st_foreach(loading_tbl, loaded_feature_path_i, (st_data_t)&fs);
+ if ((f = fs.result) != 0) {
+ if (fn) *fn = f;
+ goto loading;
}
}
- for (i = 0; i < numberof(so_ext); i++) {
- strlcpy(buf + len, so_ext[i], DLEXT_MAXLEN + 1);
- if (st_get_key(loading_tbl, (st_data_t)buf, &data)) {
- rb_str_resize(bufstr, 0);
- if (fn) *fn = (const char*)data;
- return 's';
+ if (st_get_key(loading_tbl, (st_data_t)feature, &data)) {
+ if (fn) *fn = (const char*)data;
+ loading:
+ if (!ext) return 'u';
+ return !IS_RBEXT(ext) ? 's' : 'r';
+ }
+ else {
+ VALUE bufstr;
+ char *buf;
+ static const char so_ext[][4] = {
+ ".so", ".o",
+ };
+
+ if (ext && *ext) return 0;
+ bufstr = rb_str_tmp_new(len + DLEXT_MAXLEN);
+ buf = RSTRING_PTR(bufstr);
+ MEMCPY(buf, feature, char, len);
+ for (i = 0; (e = loadable_ext[i]) != 0; i++) {
+ strlcpy(buf + len, e, DLEXT_MAXLEN + 1);
+ if (st_get_key(loading_tbl, (st_data_t)buf, &data)) {
+ rb_str_resize(bufstr, 0);
+ if (fn) *fn = (const char*)data;
+ return i ? 's' : 'r';
+ }
+ }
+ for (i = 0; i < numberof(so_ext); i++) {
+ strlcpy(buf + len, so_ext[i], DLEXT_MAXLEN + 1);
+ if (st_get_key(loading_tbl, (st_data_t)buf, &data)) {
+ rb_str_resize(bufstr, 0);
+ if (fn) *fn = (const char*)data;
+ return 's';
+ }
}
+ rb_str_resize(bufstr, 0);
}
- rb_str_resize(bufstr, 0);
}
return 0;
}
@@ -519,7 +529,7 @@ int
rb_feature_provided(const char *feature, const char **loading)
{
const char *ext = strrchr(feature, '.');
- VALUE fullpath = 0;
+ volatile VALUE fullpath = 0;
if (*feature == '.' &&
(feature[1] == '/' || strncmp(feature+1, "./", 2) == 0)) {
@@ -538,7 +548,6 @@ rb_feature_provided(const char *feature, const char **loading)
}
if (rb_feature_p(feature, 0, TRUE, FALSE, loading))
return TRUE;
- RB_GC_GUARD(fullpath);
return FALSE;
}
@@ -554,7 +563,7 @@ rb_provide_feature(VALUE feature)
}
rb_str_freeze(feature);
- rb_ary_push(features, rb_fstring(feature));
+ rb_ary_push(features, feature);
features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1));
reset_loaded_features_snapshot();
}
@@ -562,24 +571,24 @@ rb_provide_feature(VALUE feature)
void
rb_provide(const char *feature)
{
- rb_provide_feature(rb_fstring_cstr(feature));
+ rb_provide_feature(rb_usascii_str_new2(feature));
}
NORETURN(static void load_failed(VALUE));
-const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
-static int
-rb_load_internal0(rb_execution_context_t *ec, VALUE fname, int wrap)
+static inline void
+rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
{
- enum ruby_tag_type state;
- rb_thread_t *th = rb_ec_thread_ptr(ec);
+ int state;
volatile VALUE wrapper = th->top_wrapper;
volatile VALUE self = th->top_self;
+ volatile int loaded = FALSE;
+ volatile int mild_compile_error;
#if !defined __GNUC__
rb_thread_t *volatile th0 = th;
#endif
- th->ec->errinfo = Qnil; /* ensure */
+ th->errinfo = Qnil; /* ensure */
if (!wrap) {
th->top_wrapper = 0;
@@ -591,89 +600,70 @@ rb_load_internal0(rb_execution_context_t *ec, VALUE fname, int wrap)
rb_extend_object(th->top_self, th->top_wrapper);
}
- EC_PUSH_TAG(th->ec);
- state = EC_EXEC_TAG();
- if (state == TAG_NONE) {
- rb_ast_t *ast;
- const rb_iseq_t *iseq;
-
- if ((iseq = rb_iseq_load_iseq(fname)) != NULL) {
- /* OK */
- }
- else {
- VALUE parser = rb_parser_new();
- rb_parser_set_context(parser, NULL, FALSE);
- ast = (rb_ast_t *)rb_parser_load_file(parser, fname);
- iseq = rb_iseq_new_top(ast->root, rb_fstring_cstr("<top (required)>"),
- fname, rb_realpath_internal(Qnil, fname, 1), NULL);
- rb_ast_dispose(ast);
- }
+ mild_compile_error = th->mild_compile_error;
+ PUSH_TAG();
+ state = EXEC_TAG();
+ if (state == 0) {
+ NODE *node;
+ VALUE iseq;
+
+ th->mild_compile_error++;
+ node = (NODE *)rb_load_file_str(fname);
+ loaded = TRUE;
+ iseq = rb_iseq_new_top(node, rb_str_new2("<top (required)>"), fname, rb_realpath_internal(Qnil, fname, 1), Qfalse);
+ th->mild_compile_error--;
rb_iseq_eval(iseq);
}
- EC_POP_TAG();
+ POP_TAG();
#if !defined __GNUC__
th = th0;
fname = RB_GC_GUARD(fname);
#endif
+ th->mild_compile_error = mild_compile_error;
th->top_self = self;
th->top_wrapper = wrapper;
+ if (!loaded && !FIXNUM_P(th->errinfo)) {
+ /* an error on loading don't include INT2FIX(TAG_FATAL) see r35625 */
+ rb_exc_raise(th->errinfo);
+ }
if (state) {
- /* usually state == TAG_RAISE only, except for
- * rb_iseq_load_iseq case */
- VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
- if (NIL_P(exc)) return state;
- th->ec->errinfo = exc;
- return TAG_RAISE;
+ rb_vm_jump_tag_but_local_jump(state);
}
- if (!NIL_P(th->ec->errinfo)) {
+ if (!NIL_P(th->errinfo)) {
/* exception during load */
- return TAG_RAISE;
+ rb_exc_raise(th->errinfo);
}
- return state;
}
static void
rb_load_internal(VALUE fname, int wrap)
{
- rb_execution_context_t *ec = GET_EC();
- int state = rb_load_internal0(ec, fname, wrap);
- if (state) {
- if (state == TAG_RAISE) rb_exc_raise(ec->errinfo);
- EC_JUMP_TAG(ec, state);
- }
-}
-
-static VALUE
-file_to_load(VALUE fname)
-{
- VALUE tmp = rb_find_file(FilePathValue(fname));
- if (!tmp) load_failed(fname);
- return tmp;
+ rb_load_internal0(GET_THREAD(), fname, wrap);
}
void
rb_load(VALUE fname, int wrap)
{
- rb_load_internal(file_to_load(fname), wrap);
+ VALUE tmp = rb_find_file(FilePathValue(fname));
+ if (!tmp) load_failed(fname);
+ rb_load_internal(tmp, wrap);
}
void
-rb_load_protect(VALUE fname, int wrap, int *pstate)
+rb_load_protect(VALUE fname, int wrap, int *state)
{
- enum ruby_tag_type state;
- volatile VALUE path = 0;
+ int status;
- EC_PUSH_TAG(GET_EC());
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- path = file_to_load(fname);
+ PUSH_TAG();
+ if ((status = EXEC_TAG()) == 0) {
+ rb_load(fname, wrap);
}
- EC_POP_TAG();
-
- if (state == TAG_NONE) state = rb_load_internal0(GET_EC(), path, wrap);
- if (state != TAG_NONE) *pstate = state;
+ POP_TAG();
+ if (state)
+ *state = status;
}
/*
@@ -693,57 +683,67 @@ rb_load_protect(VALUE fname, int wrap, int *pstate)
static VALUE
rb_f_load(int argc, VALUE *argv)
{
- VALUE fname, wrap, path, orig_fname;
+ VALUE fname, wrap, path;
rb_scan_args(argc, argv, "11", &fname, &wrap);
- orig_fname = rb_get_path_check_to_string(fname, rb_safe_level());
- fname = rb_str_encode_ospath(orig_fname);
- RUBY_DTRACE_HOOK(LOAD_ENTRY, RSTRING_PTR(orig_fname));
+ if (RUBY_DTRACE_LOAD_ENTRY_ENABLED()) {
+ RUBY_DTRACE_LOAD_ENTRY(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
- path = rb_find_file(fname);
+ path = rb_find_file(FilePathValue(fname));
if (!path) {
if (!rb_file_load_ok(RSTRING_PTR(fname)))
- load_failed(orig_fname);
+ load_failed(fname);
path = fname;
}
rb_load_internal(path, RTEST(wrap));
- RUBY_DTRACE_HOOK(LOAD_RETURN, RSTRING_PTR(orig_fname));
+ if (RUBY_DTRACE_LOAD_RETURN_ENABLED()) {
+ RUBY_DTRACE_LOAD_RETURN(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
return Qtrue;
}
-extern VALUE rb_mWarning;
-
static char *
load_lock(const char *ftptr)
{
st_data_t data;
st_table *loading_tbl = get_loading_table();
- if (!st_lookup(loading_tbl, (st_data_t)ftptr, &data)) {
+ if (!loading_tbl || !st_lookup(loading_tbl, (st_data_t)ftptr, &data)) {
+ /* loading ruby library should be serialized. */
+ if (!loading_tbl) {
+ GET_VM()->loading_table = loading_tbl = st_init_strtable();
+ }
/* partial state */
ftptr = ruby_strdup(ftptr);
data = (st_data_t)rb_thread_shield_new();
st_insert(loading_tbl, (st_data_t)ftptr, data);
return (char *)ftptr;
}
- else if (imemo_type_p(data, imemo_memo)) {
- struct MEMO *memo = MEMO_CAST(data);
- void (*init)(void) = (void (*)(void))memo->u3.func;
+ else if (RB_TYPE_P((VALUE)data, T_NODE) && nd_type((VALUE)data) == NODE_MEMO) {
+ NODE *memo = RNODE(data);
+ void (*init)(void) = (void (*)(void))memo->nd_cfnc;
data = (st_data_t)rb_thread_shield_new();
st_insert(loading_tbl, (st_data_t)ftptr, data);
(*init)();
return (char *)"";
}
if (RTEST(ruby_verbose)) {
- VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr);
- rb_backtrace_each(rb_str_append, warning);
- rb_warning_warn(rb_mWarning, warning);
+ rb_warning("loading in progress, circular require considered harmful - %s", ftptr);
+ rb_backtrace_print_to(rb_stderr);
}
switch (rb_thread_shield_wait((VALUE)data)) {
case Qfalse:
+ data = (st_data_t)ftptr;
+ st_insert(loading_tbl, data, (st_data_t)rb_thread_shield_new());
+ return 0;
case Qnil:
return 0;
}
@@ -755,12 +755,7 @@ release_thread_shield(st_data_t *key, st_data_t *value, st_data_t done, int exis
{
VALUE thread_shield = (VALUE)*value;
if (!existing) return ST_STOP;
- if (done) {
- rb_thread_shield_destroy(thread_shield);
- /* Delete the entry even if there are waiting threads, because they
- * won't load the file and won't delete the entry. */
- }
- else if (rb_thread_shield_release(thread_shield)) {
+ if (done ? rb_thread_shield_destroy(thread_shield) : rb_thread_shield_release(thread_shield)) {
/* still in-use */
return ST_CONTINUE;
}
@@ -940,120 +935,106 @@ load_failed(VALUE fname)
static VALUE
load_ext(VALUE path)
{
- rb_scope_visibility_set(METHOD_VISI_PUBLIC);
+ SCOPE_SET(NOEX_PUBLIC);
return (VALUE)dln_load(RSTRING_PTR(path));
}
-/*
- * returns
- * 0: if already loaded (false)
- * 1: successfully loaded (true)
- * <0: not found (LoadError)
- * >1: exception
- */
-int
-rb_require_internal(VALUE fname, int safe)
+VALUE
+rb_require_safe(VALUE fname, int safe)
{
- volatile int result = -1;
- rb_execution_context_t *ec = GET_EC();
- volatile VALUE errinfo = ec->errinfo;
- enum ruby_tag_type state;
+ volatile VALUE result = Qnil;
+ rb_thread_t *th = GET_THREAD();
+ volatile VALUE errinfo = th->errinfo;
+ int state;
struct {
int safe;
} volatile saved;
char *volatile ftptr = 0;
- VALUE path;
- fname = rb_get_path_check(fname, safe);
- path = rb_str_encode_ospath(fname);
- RUBY_DTRACE_HOOK(REQUIRE_ENTRY, RSTRING_PTR(fname));
+ if (RUBY_DTRACE_REQUIRE_ENTRY_ENABLED()) {
+ RUBY_DTRACE_REQUIRE_ENTRY(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
- EC_PUSH_TAG(ec);
+ PUSH_TAG();
saved.safe = rb_safe_level();
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ if ((state = EXEC_TAG()) == 0) {
+ VALUE path;
long handle;
int found;
+ rb_set_safe_level_force(safe);
+ FilePathValue(fname);
rb_set_safe_level_force(0);
- RUBY_DTRACE_HOOK(FIND_REQUIRE_ENTRY, RSTRING_PTR(fname));
+ if (RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED()) {
+ RUBY_DTRACE_FIND_REQUIRE_ENTRY(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
+
+ path = rb_str_encode_ospath(fname);
found = search_required(path, &path, safe);
- RUBY_DTRACE_HOOK(FIND_REQUIRE_RETURN, RSTRING_PTR(fname));
+ if (RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED()) {
+ RUBY_DTRACE_FIND_REQUIRE_RETURN(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
+ }
if (found) {
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
- result = 0;
+ result = Qfalse;
}
else if (!*ftptr) {
rb_provide_feature(path);
- result = TAG_RETURN;
+ result = Qtrue;
}
else {
switch (found) {
case 'r':
- state = rb_load_internal0(ec, path, 0);
+ rb_load_internal(path, 0);
break;
case 's':
handle = (long)rb_vm_call_cfunc(rb_vm_top_self(), load_ext,
- path, VM_BLOCK_HANDLER_NONE, path);
+ path, 0, path);
rb_ary_push(ruby_dln_librefs, LONG2NUM(handle));
break;
}
- if (!state) {
- rb_provide_feature(path);
- result = TAG_RETURN;
- }
+ rb_provide_feature(path);
+ result = Qtrue;
}
}
}
- EC_POP_TAG();
+ POP_TAG();
load_unlock(ftptr, !state);
rb_set_safe_level_force(saved.safe);
if (state) {
- RB_GC_GUARD(fname);
- /* never TAG_RETURN */
- return state;
+ JUMP_TAG(state);
}
- ec->errinfo = errinfo;
-
- RUBY_DTRACE_HOOK(REQUIRE_RETURN, RSTRING_PTR(fname));
-
- return result;
-}
-
-int
-ruby_require_internal(const char *fname, unsigned int len)
-{
- struct RString fake;
- VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
- int result = rb_require_internal(str, 0);
- rb_set_errinfo(Qnil);
- return result == TAG_RETURN ? 1 : result ? -1 : 0;
-}
+ if (NIL_P(result)) {
+ load_failed(fname);
+ }
-VALUE
-rb_require_safe(VALUE fname, int safe)
-{
- int result = rb_require_internal(fname, safe);
+ th->errinfo = errinfo;
- if (result > TAG_RETURN) {
- if (result == TAG_RAISE) rb_exc_raise(rb_errinfo());
- EC_JUMP_TAG(GET_EC(), result);
- }
- if (result < 0) {
- load_failed(fname);
+ if (RUBY_DTRACE_REQUIRE_RETURN_ENABLED()) {
+ RUBY_DTRACE_REQUIRE_RETURN(StringValuePtr(fname),
+ rb_sourcefile(),
+ rb_sourceline());
}
- return result ? Qtrue : Qfalse;
+ return result;
}
VALUE
rb_require(const char *fname)
{
- VALUE fn = rb_str_new_cstr(fname);
+ VALUE fn = rb_str_new2(fname);
+ OBJ_FREEZE(fn);
return rb_require_safe(fn, rb_safe_level());
}
@@ -1066,8 +1047,9 @@ register_init_ext(st_data_t *key, st_data_t *value, st_data_t init, int existing
rb_warn("%s is already registered", name);
}
else {
- *value = (st_data_t)MEMO_NEW(0, 0, init);
+ *value = (st_data_t)NEW_MEMO(init, 0, 0);
*key = (st_data_t)ruby_strdup(name);
+ (*(void (*)(void))init)();
}
return ST_CONTINUE;
}
@@ -1079,7 +1061,11 @@ ruby_init_ext(const char *name, void (*init)(void))
if (rb_provided(name))
return;
+ if (!loading_tbl) {
+ GET_VM()->loading_table = loading_tbl = st_init_strtable();
+ }
st_update(loading_tbl, (st_data_t)name, register_init_ext, (st_data_t)init);
+ rb_provide(name);
}
/*
@@ -1102,7 +1088,7 @@ rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
ID id = rb_to_id(sym);
FilePathValue(file);
- rb_autoload_str(mod, id, file);
+ rb_autoload(mod, id, RSTRING_PTR(file));
return Qnil;
}
@@ -1173,7 +1159,7 @@ rb_f_autoload_p(VALUE obj, VALUE sym)
}
void
-Init_load(void)
+Init_load()
{
#undef rb_intern
#define rb_intern(str) rb_intern2((str), strlen(str))
diff --git a/localeinit.c b/localeinit.c
index dc48d42561..51a06c5b1c 100644
--- a/localeinit.c
+++ b/localeinit.c
@@ -9,8 +9,9 @@
**********************************************************************/
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "internal.h"
-#include "encindex.h"
#ifdef __CYGWIN__
#include <windows.h>
#endif
@@ -21,96 +22,33 @@
#if defined _WIN32 || defined __CYGWIN__
#define SIZEOF_CP_NAME ((sizeof(UINT) * 8 / 3) + 4)
#define CP_FORMAT(buf, codepage) snprintf(buf, sizeof(buf), "CP%u", (codepage))
-
-extern UINT ruby_w32_codepage[2];
-#endif
-
-#ifndef NO_LOCALE_CHARMAP
-# if defined _WIN32 || defined __CYGWIN__ || defined HAVE_LANGINFO_H
-# define NO_LOCALE_CHARMAP 0
-# else
-# define NO_LOCALE_CHARMAP 1
-# endif
#endif
-#if !NO_LOCALE_CHARMAP
-static VALUE
-locale_charmap(VALUE (*conv)(const char *))
+VALUE
+rb_locale_charmap(VALUE klass)
{
+#if defined NO_LOCALE_CHARMAP
+# error NO_LOCALE_CHARMAP defined
+#elif defined _WIN32 || defined __CYGWIN__
const char *codeset = 0;
-#if defined _WIN32 || defined __CYGWIN__
char cp[SIZEOF_CP_NAME];
# ifdef __CYGWIN__
const char *nl_langinfo_codeset(void);
codeset = nl_langinfo_codeset();
# endif
if (!codeset) {
- UINT codepage = ruby_w32_codepage[0];
- if (!codepage) codepage = GetConsoleCP();
+ UINT codepage = GetConsoleCP();
if (!codepage) codepage = GetACP();
CP_FORMAT(cp, codepage);
codeset = cp;
}
+ return rb_usascii_str_new2(codeset);
#elif defined HAVE_LANGINFO_H
+ char *codeset;
codeset = nl_langinfo(CODESET);
- ASSUME(codeset);
-#else
-# error locale_charmap() is not implemented
-#endif
- return (*conv)(codeset);
-}
-#endif
-
-/*
- * 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)
-{
-#if NO_LOCALE_CHARMAP
- return rb_usascii_str_new_cstr("US-ASCII");
-#else
- return locale_charmap(rb_usascii_str_new_cstr);
-#endif
-}
-
-#if !NO_LOCALE_CHARMAP
-static VALUE
-enc_find_index(const char *name)
-{
- return (VALUE)rb_enc_find_index(name);
-}
-#endif
-
-int
-rb_locale_charmap_index(void)
-{
-#if NO_LOCALE_CHARMAP
- return ENCINDEX_US_ASCII;
+ return rb_usascii_str_new2(codeset);
#else
- return (int)locale_charmap(enc_find_index);
+ return Qnil;
#endif
}
@@ -118,17 +56,13 @@ int
Init_enc_set_filesystem_encoding(void)
{
int idx;
-#if NO_LOCALE_CHARMAP
- idx = ENCINDEX_US_ASCII;
-#elif defined _WIN32
+#if defined NO_LOCALE_CHARMAP
+# error NO_LOCALE_CHARMAP defined
+#elif defined _WIN32 || defined __CYGWIN__
char cp[SIZEOF_CP_NAME];
- const UINT codepage = ruby_w32_codepage[1] ? ruby_w32_codepage[1] :
- AreFileApisANSI() ? GetACP() : GetOEMCP();
- CP_FORMAT(cp, codepage);
+ CP_FORMAT(cp, AreFileApisANSI() ? GetACP() : GetOEMCP());
idx = rb_enc_find_index(cp);
if (idx < 0) idx = ENCINDEX_ASCII;
-#elif defined __CYGWIN__
- idx = ENCINDEX_UTF_8;
#else
idx = rb_enc_to_index(rb_default_external_encoding());
#endif
diff --git a/main.c b/main.c
index 6e8ab7b9fe..16da117732 100644
--- a/main.c
+++ b/main.c
@@ -15,12 +15,6 @@
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
-#if RUBY_DEVEL && !defined RUBY_DEBUG_ENV
-# define RUBY_DEBUG_ENV 1
-#endif
-#if defined RUBY_DEBUG_ENV && !RUBY_DEBUG_ENV
-# undef RUBY_DEBUG_ENV
-#endif
#ifdef RUBY_DEBUG_ENV
#include <stdlib.h>
#endif
diff --git a/man/erb.1 b/man/erb.1
index 3b350e0064..8c47e581d3 100644
--- a/man/erb.1
+++ b/man/erb.1
@@ -1,6 +1,6 @@
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd November 15, 2012
-.Dt ERB \&1 "Ruby Programmer's Reference Guide"
+.Dd November 7, 2012
+.Dt ERB(1) "" "Ruby Programmers Reference Guide"
.Os UNIX
.Sh NAME
.Nm erb
@@ -77,8 +77,6 @@ And leading whitespaces are removed if the erb directive starts with
.Li "<%-" .
.Pp
.El
-.It Fl r
-Load a library
.Pp
.It Fl U
can be one of
@@ -145,17 +143,15 @@ class.
.Pp
.Sh REPORTING BUGS
.Bl -bullet
-.It
-Security vulnerabilities should be reported via an email to
-.Mt security@ruby-lang.org .
+.Li Security vulnerabilities should be reported via an email to
+.Aq security@ruby-lang.org Ns
+.Li .
Reported problems will be published after being fixed.
.Pp
-.It
-Other bugs and feature requests can be reported via the
-Ruby Issue Tracking System
-.Pq Lk https://bugs.ruby-lang.org/ .
+.Li And you can report other bugs and feature requests via the
+Ruby Issue Tracking System (http://bugs.ruby-lang.org).
Do not report security vulnerabilities
-via this system because it publishes the vulnerabilities immediately.
+via the system because it publishes the vulnerabilities immediately.
.El
.Sh AUTHORS
Written by Masatoshi SEKI.
diff --git a/man/goruby.1 b/man/goruby.1
index 47a015f34d..62a7bad23f 100644
--- a/man/goruby.1
+++ b/man/goruby.1
@@ -1,6 +1,6 @@
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd November 15, 2012
-.Dt GORUBY \&1 "Ruby Programmer's Reference Guide"
+.Dd November 7, 2012
+.Dt GORUBY(1) "" "Ruby Programmers Reference Guide"
.Os UNIX
.Sh NAME
.Nm goruby
diff --git a/man/irb.1 b/man/irb.1
index e980a2ebfd..543217e099 100644
--- a/man/irb.1
+++ b/man/irb.1
@@ -1,6 +1,6 @@
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd November 15, 2012
-.Dt IRB \&1 "Ruby Programmer's Reference Guide"
+.Dd November 7, 2012
+.Dt IRB(1) "" "Ruby Programmers Reference Guide"
.Os UNIX
.Sh NAME
.Nm irb
@@ -69,6 +69,9 @@ Suppresses read of
.It Fl -help
Prints a summary of the options.
.Pp
+.It Fl m
+Bc mode (load mathn, fraction or matrix are available)
+.Pp
.It Fl r Ar library
Same as `ruby -r'.
Causes irb to load the library using require.
@@ -116,7 +119,7 @@ Sets internal debug level to n (not for popular use)
.El
.Pp
.Sh ENVIRONMENT
-.Bl -tag -compact
+.Bl -tag -width "RUBYLIB_PREFIX" -compact
.It Ev IRBRC
.Pp
.El
@@ -127,7 +130,7 @@ depends on same variables as
.Xr ruby 1 .
.Pp
.Sh FILES
-.Bl -tag -compact
+.Bl -tag -width "RUBYLIB_PREFIX" -compact
.It Pa ~/.irbrc
Personal irb initialization.
.Pp
@@ -140,7 +143,7 @@ Personal irb initialization.
.Dl irb(main):002:0> Ic def t(x)
.Dl irb(main):003:1> Ic x+1
.Dl irb(main):004:1> Ic end
-.Dl => :t
+.Dl => nil
.Dl irb(main):005:0> Ic t(3)
.Dl => 4
.Dl irb(main):006:0> Ic if t(3) == 4
@@ -156,17 +159,15 @@ Personal irb initialization.
.Pp
.Sh REPORTING BUGS
.Bl -bullet
-.It
-Security vulnerabilities should be reported via an email to
-.Mt security@ruby-lang.org .
+.Li Security vulnerabilities should be reported via an email to
+.Aq security@ruby-lang.org Ns
+.Li .
Reported problems will be published after being fixed.
.Pp
-.It
-Other bugs and feature requests can be reported via the
-Ruby Issue Tracking System
-.Pq Lk https://bugs.ruby-lang.org/ .
+.Li And you can report other bugs and feature requests via the
+Ruby Issue Tracking System (http://bugs.ruby-lang.org).
Do not report security vulnerabilities
-via this system because it publishes the vulnerabilities immediately.
+via the system because it publishes the vulnerabilities immediately.
.El
.Sh AUTHORS
Written by Keiju ISHITSUKA.
diff --git a/man/rake.1 b/man/rake.1
new file mode 100644
index 0000000000..d8991546b5
--- /dev/null
+++ b/man/rake.1
@@ -0,0 +1,198 @@
+.Dd November 7, 2012
+.Dt RAKE(1) "" "Ruby Programmers Reference Guide"
+.Os UNIX
+.Sh NAME
+.Nm rake
+.Nd Ruby Make
+.Sh SYNOPSIS
+.Nm
+.Op Fl -f Ar Rakefile
+.Op Fl -version
+.Op Fl CGNPgnqstv
+.Op Fl D Op Ar PATTERN
+.Op Fl E Ar CODE
+.Op Fl I Ar LIBDIR
+.Op Fl R Ar RAKELIBDIR
+.Op Fl T Op Ar PATTERN
+.Op Fl e Ar CODE
+.Op Fl p Ar CODE
+.Op Fl r Ar MODULE
+.Op Fl -rules
+.Op Ar variable Ns = Ns Ar value
+.Ar target ...
+.Sh DESCRIPTION
+.Nm Rake
+is a simple
+.Xr ruby 1
+build program with capabilities similar to the regular
+.Xr make 1
+command.
+.Pp
+.Nm Rake
+has the following features:
+.Bl -bullet
+.It
+Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax.
+No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?).
+.It
+Users can specify tasks with prerequisites.
+.It
+Rake supports rule patterns to synthesize implicit tasks.
+.It
+Flexible FileLists that act like arrays but know about manipulating file names and paths.
+.It
+A library of prepackaged tasks to make building rakefiles easier.
+.El
+.Pp
+.Sh OPTIONS
+.Bl -tag -width "--execute-continue" -compact
+.Pp
+.It Fl -version
+Display the program version.
+.Pp
+.It Fl C
+.It Fl -classic-namespace
+Put Task and FileTask in the top level namespace
+.Pp
+.It Fl D Op Ar PATTERN
+.It Fl -describe Op Ar PATTERN
+Describe the tasks (matching optional
+.Ar PATTERN Ns
+), then exit.
+.Pp
+.It Fl E Ar CODE
+.It Fl -execute-continue Ar CODE
+Execute some Ruby code, then continue with normal task processing.
+.Pp
+.It Fl G
+.It Fl -no-system
+.It Fl -nosystem
+Use standard project Rakefile search paths, ignore system wide rakefiles.
+.Pp
+.It Fl I Ar LIBDIR
+.It Fl -libdir Ar LIBDIR
+Include
+.Ar LIBDIR
+in the search path for required modules.
+.Pp
+.It Fl N
+.It Fl -no-search
+.It Fl -nosearch
+Do not search parent directories for the Rakefile.
+.Pp
+.It Fl P
+.It Fl -prereqs
+Display the tasks and dependencies, then exit.
+.Pp
+.It Fl R Ar RAKELIBDIR
+.It Fl -rakelib Ar RAKELIBDIR
+.It Fl -rakelibdir Ar RAKELIBDIR
+Auto-import any .rake files in
+.Ar RAKELIBDIR .
+(default is
+.Pa rakelib
+)
+.Pp
+.It Fl T Op Ar PATTERN
+.It Fl -tasks Op Ar PATTERN
+Display the tasks (matching optional
+.Ar PATTERN Ns
+) with descriptions, then exit.
+.Pp
+.It Fl e Ar CODE
+.It Fl -execute Ar CODE
+Execute some Ruby code and exit.
+.Pp
+.It Fl f Ar FILE
+.It Fl -rakefile Ar FILE
+Use FILE as the rakefile.
+.Pp
+.It Fl h
+.It Fl -help
+Prints a summary of options.
+.Pp
+.It Fl g
+.It Fl -system
+Using system wide (global) rakefiles (usually
+.Pa ~/.rake/*.rake
+).
+.Pp
+.It Fl n
+.It Fl -dry-run
+Do a dry run without executing actions.
+.Pp
+.It Fl p Ar CODE
+.It Fl -execute-print Ar CODE
+Execute some Ruby code, print the result, then exit.
+.Pp
+.It Fl q
+.It Fl -quiet
+Do not log messages to standard output.
+.Pp
+.It Fl r Ar MODULE
+.It Fl -require Ar MODULE
+Require MODULE before executing rakefile.
+.Pp
+.It Fl s
+.It Fl -silent
+Like
+.Fl -quiet ,
+but also suppresses the 'in directory' announcement.
+.Pp
+.It Fl t
+.It Fl -trace
+Turn on invoke/execute tracing, enable full backtrace.
+.Pp
+.It Fl v
+.It Fl -verbose
+Log message to standard output (default).
+.Pp
+.It Fl -rules
+Trace the rules resolution.
+.Pp
+.El
+.Pp
+.Sh ENVIRONMENT
+.Bl -tag -width "RAKE_SYSTEM" -compact
+.It Ev RAKE_SYSTEM
+The directory path containing the system wide rakefiles.
+.Pp
+.It Ev RAKE_COLUMNS
+Override the number of columns used for output, such as
+.Fl Fl tasks
+.Pp
+.It Ev RAKEOPT
+Used to provide default command line arguments to Rake.
+.Pp
+.It Ev TAGS
+Generate an Emacs TAGS file
+.Pp
+.It Ev TEST
+The list of test files will be overridden to include only the filename specified on the command line.
+.Pp
+This provides an easy way to run just one test.
+.Pp
+.It Ev TESTOPTS
+.It Ev TESTOPT
+.It Ev TEST_OPTS
+.It Ev TEST_OPT
+The given options are passed to the test process after a
+.Fl Fl
+.Pp
+This allows Test::Unit options to be passed to the test suite.
+.Pp
+.It Ev USERPROFILE
+.It Ev HOME
+.It Ev HOMEDRIVE
+.It Ev HOMEPATH
+The standard directory containing system wide rake files on Win 32 systems.
+
+.Sh SEE ALSO
+.Xr ruby 1
+.Xr make 1
+.Pp
+.Pa https://github.com/ruby/rake
+.Sh AUTHOR
+.Nm Rake
+is written by
+.An Jim Weirich Aq jim@weirichhouse.org
diff --git a/man/ri.1 b/man/ri.1
index 85a6dfcd53..cadf4b8e16 100644
--- a/man/ri.1
+++ b/man/ri.1
@@ -1,56 +1,47 @@
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd April 20, 2017
-.Dt RI \&1 "Ruby Programmer's Reference Guide"
+.Dd November 7, 2012
+.Dt RI(1) "" "Ruby Programmers Reference Guide"
.Os UNIX
.Sh NAME
.Nm ri
.Nd Ruby API reference front end
.Sh SYNOPSIS
.Nm
-.Op Fl ahilTv
-.Op Fl d Ar DIRNAME
-.Op Fl f Ar FORMAT
-.Op Fl w Ar WIDTH
-.Op Fl - Ns Oo Cm no- Oc Ns Cm pager
-.Op Fl -server Ns Oo = Ns Ar PORT Oc
-.Op Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
+.Op Fl Ti
+.Op Fl d Ar directory
+.Op Fl f Ar format
+.Op Fl -list-doc-dirs
.Op Fl -no-standard-docs
.Op Fl - Ns Oo Cm no- Oc Ns Bro Cm system Ns | Ns Cm site Ns | Ns Cm gems Ns | Ns Cm home Brc
-.Op Fl - Ns Oo Cm no- Oc Ns Cm profile
-.Op Fl -dump Ns = Ns Ar CACHE
-.Op Ar name ...
+.Op Fl - Ns Oo Cm no- Oc Ns Cm use-cache
+.Op Fl -width Ns = Ns Ar width
+.Op Ar target ...
.Sh DESCRIPTION
.Nm
-is a command-line front end for the Ruby API reference.
-You can search and read the API reference for classes and methods with
+is a CLI front end for the Ruby API reference.
+You can search and read API reference for classes and methods with
.Nm .
.Pp
.Nm
is a part of Ruby.
.Pp
-.Ar name
-can be:
+.Ar target
+can be one of the following forms:
.Bl -diag -offset indent
-.It Class | Module | Module::Class
-.Pp
-.It Class::method | Class#method | Class.method | method
-.Pp
-.It gem_name: | gem_name:README | gem_name:History
+.It Class
+for classes
+.It Class::method
+for class methods
+.It Class#method
+for instance methods
+.It Class.method
+for both class and instance methods
+.It method
+for both class and instance methods
.El
.Pp
-All class names may be abbreviated to their minimum unambiguous form.
-If a name is ambiguous, all valid options will be listed.
-.Pp
-A
-.Ql \&.
-matches either class or instance methods, while #method
-matches only instance and ::method matches only class methods.
-.Pp
-README and other files may be displayed by prefixing them with the gem name
-they're contained in. If the gem name is followed by a
-.Ql \&:
-all files in the gem will be shown.
-The file name extension may be omitted where it is unambiguous.
+All class names may be abbreviated to their minimum unambiguous form. If a name
+is ambiguous, all valid options will be listed.
.Pp
For example:
.Bd -literal -offset indent
@@ -58,190 +49,133 @@ ri Fil
ri File
ri File.new
ri zip
-ri rdoc:README
.Ed
.Pp
-Note that shell quoting or escaping may be required for method names
-containing punctuation:
+Note that shell quoting may be required for method names containing
+punctuation:
.Bd -literal -offset indent
ri 'Array.[]'
-ri compact\e!
-.Ed
-.Pp
-To see the default directories
-.Nm
-will search, run:
-.Bd -literal -offset indent
-ri --list-doc-dirs
+ri compact\!
.Ed
-.Pp
-Specifying the
-.Fl -system , Fl -site , Fl -home , Fl -gems ,
-or
-.Fl -doc-dir
-options will limit
-.Nm
-to searching only the specified directories.
-.Pp
-.Nm
-options may be set in the
-.Ev RI
-environment variable.
-.Pp
-The
-.Nm
-pager can be set with the
-.Ev RI_PAGER
-environment variable or the
-.Ev PAGER
-environment variable.
-.Pp
.Sh OPTIONS
.Bl -tag -width "1234567890123" -compact
.Pp
-.It Fl i
-.It Fl - Ns Oo Cm no- Oc Ns Cm interactive
-In interactive mode you can repeatedly
-look up methods with autocomplete.
-.Pp
-.It Fl a
-.It Fl - Ns Oo Cm no- Oc Ns Cm all
-Show all documentation for a class or module.
-.Pp
-.It Fl l
-.It Fl - Ns Oo Cm no- Oc Ns Cm list
-List classes
-.Nm
-knows about.
-.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm pager
-Send output to a pager,
-rather than directly to stdout.
+.It Fl -version
+Prints the version of
+.Nm .
.Pp
.It Fl T
-Synonym for
-.Fl -no-pager .
+.It Fl -no-pager
+Send output directly to stdout, rather than to a pager.
.Pp
-.It Fl w Ar WIDTH
-.It Fl -width Ns = Ns Ar WIDTH
-Set the width of the output.
-.Pp
-.It Fl -server Ns Oo = Ns Ar PORT Oc
-Run RDoc server on the given port.
-The default port is\~8214.
+.It Fl d Ar directory
+.It Fl -doc-dir Ns = Ns Ar directory
+List of directories from which to source documentation in addition to the standard
+directories. May be repeated.
.Pp
.It Fl f Ar FORMAT
-.It Fl -format Ns = Ns Ar FORMAT
-Use the selected formatter.
-The default formatter is
-.Li bs
-for paged output and
-.Li ansi
-otherwise.
-Valid formatters are:
-.Li ansi , Li bs , Li markdown , Li rdoc .
-.Pp
-.It Fl h
-.It Fl -help
-Show help and exit.
-.Pp
-.It Fl v
-.It Fl -version
-Output version information and exit.
-.El
+.It Fl -fmt Ar FORMAT
+.It Fl -format Ns = Ns FORMAT
+Format to use when displaying output:
.Pp
-Data source options:
-.Bl -tag -width "1234567890123" -compact
+ansi, bs, html, plain, simple
.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
-List the directories from which
+Use 'bs' (backspace) with most pager programs. To use ANSI, either disable the
+pager or tell the pager to allow control characters.
+.Pp
+.It Fl i
+.It Fl -interactive
+This makes
.Nm
-will source documentation on stdout and exit.
+go into interactive mode.
.Pp
-.It Fl d Ar DIRNAME
-.It Fl -doc-dir Ns = Ns Ar DIRNAME
-List of directories from which to source
-documentation in addition to the standard
-directories. May be repeated.
+When
+.Nm
+is in interactive mode it will allow the user to disambiguate lists of
+methods in case multiple methods match against a method search string. It also
+will allow the user to enter in a method name (with auto-completion, if readline
+is supported) when viewing a class.
+.Pp
+.It Fl -list-doc-dirs
+List the directories from which ri will source documentation on stdout and exit.
.Pp
.It Fl -no-standard-docs
Do not include documentation from the Ruby standard library,
.Pa site_lib ,
installed gems, or
.Pa ~/.rdoc .
-Use with
-.Fl -doc-dir .
+.Pp
+Equivalent to specifying the options
+.Fl -no-system , Fl -no-site , Fl -no-gems ,
+and
+.Fl -no-home .
.Pp
.It Fl - Ns Oo Cm no- Oc Ns Cm system
Include documentation from Ruby's standard library. Defaults to true.
.Pp
.It Fl - Ns Oo Cm no- Oc Ns Cm site
-Include documentation from libraries installed in
-.Pa site_lib .
-Defaults to true.
+ Include documentation from libraries installed in site_lib. Defaults to true.
.Pp
.It Fl - Ns Oo Cm no- Oc Ns Cm gems
-Include documentation from RubyGems. Defaults to true.
+Include documentation from RubyGems. Defaults to true.
.Pp
.It Fl - Ns Oo Cm no- Oc Ns Cm home
-Include documentation stored in
-.Pa ~/.rdoc .
-Defaults to true.
-.El
+Include documentation stored in ~/.rdoc. Defaults to true.
.Pp
-Debug options:
-.Bl -tag -width "1234567890123" -compact
+.It Fl - Ns Oo Cm no- Oc Ns Cm use-cache
+Whether or not to use
+.Nm Ns
+.Ns 's cache. True by default.
.Pp
-.It Fl - Ns Oo Cm no- Oc Ns Cm profile
-Run with the Ruby profiler.
+.It Fl w Ar width
+.It Fl -width Ns = Ns Ar width
+Set the width of the output.
.Pp
-.It Fl -dump Ns = Ns Ar CACHE
-Dump data from an ri cache or data file.
.El
.Pp
.Sh ENVIRONMENT
.Bl -tag -width "USERPROFILE" -compact
.Pp
.It Ev RI
-Options to prepend to those specified on the command-line.
+Additional options.
.Pp
-.It Ev RI_PAGER
.It Ev PAGER
-Pager program to use for displaying.
+Used as the name of pager program for displaying.
.Pp
.It Ev HOME
.It Ev USERPROFILE
.It Ev HOMEPATH
-Path to the user's home directory.
+Path to user's home directory.
.El
.Pp
.Sh FILES
.Bl -tag -width "USERPROFILE" -compact
.Pp
+.It Pa ~/.ri
+Caches recently referenced documents here.
+.Pp
.It Pa ~/.rdoc
-Path for ri data in the user's home directory.
+Searches user-wide documents here.
.Pp
.El
.Pp
.Sh SEE ALSO
-.Xr ruby 1 ,
-.Xr rdoc 1 ,
+.Xr ruby 1
+.Xr rdoc 1
.Xr gem 1
.Pp
.Sh REPORTING BUGS
.Bl -bullet
-.It
-Security vulnerabilities should be reported via an email to
-.Mt security@ruby-lang.org .
+.Li Security vulnerabilities should be reported via an email to
+.Aq security@ruby-lang.org Ns
+.Li .
Reported problems will be published after being fixed.
.Pp
-.It
-Other bugs and feature requests can be reported via the
-Ruby Issue Tracking System
-.Pq Lk https://bugs.ruby-lang.org/ .
+.Li And you can report other bugs and feature requests via the
+Ruby Issue Tracking System (http://bugs.ruby-lang.org).
Do not report security vulnerabilities
-via this system because it publishes the vulnerabilities immediately.
+via the system because it publishes the vulnerabilities immediately.
.El
.Sh AUTHORS
-Written by
-.An Dave Thomas Aq dave@pragmaticprogrammer.com .
+Written by Dave Thomas
+.Aq dave@pragmaticprogrammer.com
diff --git a/man/ruby.1 b/man/ruby.1
index 88cef8d480..1c0a7dabc7 100644
--- a/man/ruby.1
+++ b/man/ruby.1
@@ -1,6 +1,7 @@
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
-.Dd October 31, 2015
-.Dt RUBY \&1 "Ruby Programmer's Reference Guide"
+.Dd November 7, 2012
+.Dt RUBY(1) "" "Ruby Programmers Reference Guide"
+.\".Dt RUBY 1
.Os UNIX
.Sh NAME
.Nm ruby
@@ -13,16 +14,16 @@
.Op Fl 0 Ns Op Ar octal
.Op Fl C Ar directory
.Op Fl E Ar external Ns Op : Ns Ar internal
-.Op Fl F Ns Op Ar pattern
+.Op Fl F Ar pattern
.Op Fl I Ar directory
-.Op Fl K Ns Op Ar c
+.Op Fl K Ar c
.Op Fl T Ns Op Ar level
.Op Fl W Ns Op Ar level
.Op Fl e Ar command
.Op Fl i Ns Op Ar extension
.Op Fl r Ar library
.Op Fl x Ns Op Ar directory
-.Op Fl - Ns Bro Cm enable Ns | Ns Cm disable Brc Ns - Ns Ar FEATURE
+.Op - Ns Bro Cm enable Ns | Ns Cm disable Brc Ns - Ns Ar FEATURE
.Op Fl -dump Ns = Ns Ar target
.Op Fl -verbose
.Op Fl -
@@ -119,21 +120,11 @@ On most
systems, you can load object files into the Ruby interpreter
on-the-fly.
.It Sy "Rich libraries"
-In addition to the
-.Dq builtin libraries
-and
-.Dq standard libraries
-that are bundled with Ruby, a vast amount of third-party libraries
-.Pq Dq gems
-are available via the package management system called
-.Sq RubyGems ,
-namely the
-.Xr gem 1
-command. Visit RubyGems.org
-.Pq Lk https://rubygems.org/
-to find the gems you need, and explore GitHub
-.Pq Lk https://github.com/
-to see how they are being developed and used.
+Libraries called "builtin libraries" and "standard libraries" are bundled with Ruby.
+And you can obtain more libraries via the package management system called `RubyGems'.
+.Pp
+Moreover there are thousands of Ruby projects on GitHub
+.Aq Pa https://github.com/languages/Ruby .
.El
.Pp
.Sh OPTIONS
@@ -217,18 +208,6 @@ on machines that don't support it, in the following manner:
exec /usr/local/bin/ruby -S $0 $*
.Ed
.Pp
-On some systems
-.Li "$0"
-does not always contain the full pathname, so you need the
-.Fl S
-switch to tell Ruby to search for the script if necessary (to handle embedded
-spaces and such). A better construct than
-.Li "$*"
-would be
-.Li ${1+"$@"} ,
-but it does not work if the script is being interpreted by
-.Xr csh 1 .
-.Pp
.It Fl T Ns Op Ar level=1
Turns on taint checks at the specified level (default 1).
.Pp
@@ -354,6 +333,18 @@ and set the corresponding variable in the script. For example:
print "true\en" if $xyz
.Ed
.Pp
+On some systems
+.Li "$0"
+does not always contain the full pathname, so you need the
+.Fl S
+switch to tell Ruby to search for the script if necessary (to handle embedded
+spaces and such). A better construct than
+.Li "$*"
+would be
+.Li ${1+"$@"} ,
+but it does not work if the script is being interpreted by
+.Xr csh 1 .
+.Pp
.It Fl v
Enables verbose mode. Ruby will print its version at the beginning
and set the variable
@@ -395,7 +386,8 @@ debug the Ruby interpreter.
.It Fl -disable- Ns Ar FEATURE
.It Fl -enable- Ns Ar FEATURE
Disables (or enables) the specified
-.Ar FEATURE .
+.Ar FEATURE Ns
+\&.
.Bl -tag -width "--disable-rubyopt" -compact
.It Fl -disable-gems
.It Fl -enable-gems
@@ -417,41 +409,19 @@ Disables (or enables) all features.
.El
.Pp
.It Fl -dump Ns = Ns Ar target
-Dump some informations.
+DO NOT USE.
.Pp
Prints the specified target.
.Ar target
can be one of;
.Bl -hang -offset indent
-.It Sy version
-version description same as
-.Fl -version
-.It Sy usage
-brief usage message same as
-.Fl h
-.It Sy help
-Show long help message same as
-.Fl -help
-.It Sy syntax
-check of syntax same as
-.Fl c
-.Fl -yydebug
-.It Sy yydebug
-compiler debug mode, same as
-.Fl -yydebug
-.Pp
-Only specify this switch if you are going to debug the Ruby interpreter.
-.It Sy parsetree
-.It Sy parsetree_with_comment
-AST nodes tree
-.Pp
-Only specify this switch if you are going to debug the Ruby interpreter.
.It Sy insns
disassembled instructions
.Pp
-Only specify this switch if you are going to debug the Ruby interpreter.
.El
.Pp
+Only specify this switch if you are going to debug the Ruby interpreter.
+.Pp
.It Fl -verbose
Enables verbose mode without printing version message at the
beginning. It sets the
@@ -512,150 +482,30 @@ as below.
% gem help
.Ed
.Pp
-.Sh GC ENVIRONMENT
-The Ruby garbage collector (GC) tracks objects in fixed-sized slots,
-but each object may have auxiliary memory allocations handled by the
-malloc family of C standard library calls (
-.Xr malloc 3 ,
-.Xr calloc 3 ,
-and
-.Xr realloc 3 ) .
-In this documentatation, the "heap" refers to the Ruby object heap
-of fixed-sized slots, while "malloc" refers to auxiliary
-allocations commonly referred to as the "process heap".
-Thus there are at least two possible ways to trigger GC:
-.Bl -hang -offset indent
-.It Sy 1
-Reaching the object limit.
-.It Sy 2
-Reaching the malloc limit.
-.Pp
-.El
-In Ruby 2.1, the generational GC was introduced and the limits are divided
-into young and old generations, providing two additional ways to trigger
-a GC:
-.Bl -hang -offset indent
-.It Sy 3
-Reaching the old object limit.
-.It Sy 4
-Reaching the old malloc limit.
-.El
-.Pp
-There are currently 4 possible areas where the GC may be tuned by
-the following 11 environment variables:
-.Bl -hang -compact -width "RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR"
-.It Ev RUBY_GC_HEAP_INIT_SLOTS
-Initial allocation slots. Introduced in Ruby 2.1, default: 10000.
-.Pp
-.It Ev RUBY_GC_HEAP_FREE_SLOTS
-Prepare at least this amount of slots after GC.
-Allocate this number slots if there are not enough slots.
-Introduced in Ruby 2.1, default: 4096
-.Pp
-.It Ev RUBY_GC_HEAP_GROWTH_FACTOR
-Increase allocation rate of heap slots by this factor.
-Introduced in Ruby 2.1, default: 1.8, minimum: 1.0 (no growth)
-.Pp
-.It Ev RUBY_GC_HEAP_GROWTH_MAX_SLOTS
-Allocation rate is limited to this number of slots,
-preventing excessive allocation due to RUBY_GC_HEAP_GROWTH_FACTOR.
-Introduced in Ruby 2.1, default: 0 (no limit)
-.Pp
-.It Ev RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR
-Perform a 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 after the
-last full GC.
-Introduced in Ruby 2.1.1, default: 2.0
-.Pp
-.It Ev RUBY_GC_MALLOC_LIMIT
-The initial limit of young generation allocation from the malloc-family.
-GC will start when this limit is reached.
-Default: 16MB
-.Pp
-.It Ev RUBY_GC_MALLOC_LIMIT_MAX
-The maximum limit of young generation allocation from malloc before GC starts.
-Prevents excessive malloc growth due to RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR.
-Introduced in Ruby 2.1, default: 32MB.
-.Pp
-.It Ev RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR
-Increases the limit of young generation malloc calls, reducing
-GC frequency but increasing malloc growth until RUBY_GC_MALLOC_LIMIT_MAX
-is reached.
-Introduced in Ruby 2.1, default: 1.4, minimum: 1.0 (no growth)
-.Pp
-.It Ev RUBY_GC_OLDMALLOC_LIMIT
-The initial limit of old generation allocation from malloc,
-a full GC will start when this limit is reached.
-Introduced in Ruby 2.1, default: 16MB
-.Pp
-.It Ev RUBY_GC_OLDMALLOC_LIMIT_MAX
-The maximum limit of old generation allocation from malloc before a
-full GC starts.
-Prevents excessive malloc growth due to RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR.
-Introduced in Ruby 2.1, default: 128MB
-.Pp
-.It Ev RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR
-Increases the limit of old generation malloc allocation, reducing full
-GC frequency but increasing malloc growth until RUBY_GC_OLDMALLOC_LIMIT_MAX
-is reached.
-Introduced in Ruby 2.1, default: 1.2, minimum: 1.0 (no growth)
-.Pp
-.El
-.Sh STACK SIZE ENVIRONMENT
-Stack size environment variables are implementation-dependent and
-subject to change with different versions of Ruby. The VM stack is used
-for pure-Ruby code and managed by the virtual machine. Machine stack is
-used by the operating system and its usage is dependent on C extensions
-as well as C compiler options. Using lower values for these may allow
-applications to keep more Fibers or Threads running; but increases the
-chance of SystemStackError exceptions and segmentation faults (SIGSEGV).
-These environment variables are available since Ruby 2.0.0.
-All values are specified in bytes.
-.Pp
-.Bl -hang -compact -width "RUBY_THREAD_MACHINE_STACK_SIZE"
-.It Ev RUBY_THREAD_VM_STACK_SIZE
-VM stack size used at thread creation.
-default: 131072 (32-bit CPU) or 262144 (64-bit)
-.Pp
-.It Ev RUBY_THREAD_MACHINE_STACK_SIZE
-Machine stack size used at thread creation.
-default: 524288 or 1048575
-.Pp
-.It Ev RUBY_FIBER_VM_STACK_SIZE
-VM stack size used at fiber creation.
-default: 65536 or 131072
-.Pp
-.It Ev RUBY_FIBER_MACHINE_STACK_SIZE
-Machine stack size used at fiber creation.
-default: 262144 or 524288
-.Pp
-.El
.Sh SEE ALSO
-.Bl -hang -compact -width "https://www.ruby-toolbox.com/"
-.It Lk https://www.ruby-lang.org/
+.Bl -hang -compact -width "http://www.ruby-lang.org/123"
+.It https://www.ruby-lang.org/
The official web site.
-.It Lk https://www.ruby-toolbox.com/
+.It https://www.ruby-toolbox.com/
Comprehensive catalog of Ruby libraries.
.El
.Pp
.Sh REPORTING BUGS
.Bl -bullet
-.It
-Security vulnerabilities should be reported via an email to
-.Mt security@ruby-lang.org .
-Reported problems will be published after being fixed.
-.Pp
-.It
-Other bugs and feature requests can be reported via the
-Ruby Issue Tracking System
-.Pq Lk https://bugs.ruby-lang.org/ .
+.Li Security vulnerabilities should be reported via an email to
+.Aq security@ruby-lang.org Ns
+.Li .
+Reported problems will be published after they've been fixed.
+.Pp
+.Li And you can report other bugs and feature requests via the
+Ruby Issue Tracking System (https://bugs.ruby-lang.org/).
Do not report security vulnerabilities
-via this system because it publishes the vulnerabilities immediately.
+via the system because it publishes the vulnerabilities immediately.
.El
.Sh AUTHORS
Ruby is designed and implemented by
.An Yukihiro Matsumoto Aq matz@netlab.jp .
.Pp
See
-.Aq Lk https://bugs.ruby-lang.org/projects/ruby/wiki/Contributors
+.Aq Pa https://bugs.ruby-lang.org/projects/ruby/wiki/Contributors
for contributors to Ruby.
diff --git a/marshal.c b/marshal.c
index 1593ca2930..598f90f187 100644
--- a/marshal.c
+++ b/marshal.c
@@ -13,12 +13,12 @@
# error too old GCC
#endif
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/st.h"
#include "ruby/util.h"
-#include "encindex.h"
-#include "id_table.h"
+#include "ruby/encoding.h"
+#include "internal.h"
#include <math.h>
#ifdef HAVE_FLOAT_H
@@ -87,19 +87,6 @@ static ID s_dump, s_load, s_mdump, s_mload;
static ID s_dump_data, s_load_data, s_alloc, s_call;
static ID s_getbyte, s_read, s_write, s_binmode;
-#define name_s_dump "_dump"
-#define name_s_load "_load"
-#define name_s_mdump "marshal_dump"
-#define name_s_mload "marshal_load"
-#define name_s_dump_data "_dump_data"
-#define name_s_load_data "_load_data"
-#define name_s_alloc "_alloc"
-#define name_s_call "call"
-#define name_s_getbyte "getbyte"
-#define name_s_read "read"
-#define name_s_write "write"
-#define name_s_binmode "binmode"
-
typedef struct {
VALUE newclass;
VALUE oldclass;
@@ -109,8 +96,6 @@ typedef struct {
static st_table *compat_allocator_tbl;
static VALUE compat_allocator_tbl_wrapper;
-static VALUE rb_marshal_dump_limited(VALUE obj, VALUE port, int limit);
-static VALUE rb_marshal_load_with_proc(VALUE port, VALUE proc);
static int
mark_marshal_compat_i(st_data_t key, st_data_t value)
@@ -128,8 +113,6 @@ mark_marshal_compat_t(void *tbl)
st_foreach(tbl, mark_marshal_compat_i, 0);
}
-static st_table *compat_allocator_table(void);
-
void
rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE))
{
@@ -148,11 +131,11 @@ rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE),
compat->dumper = dumper;
compat->loader = loader;
- st_insert(compat_allocator_table(), (st_data_t)allocator, (st_data_t)compat);
+ st_insert(compat_allocator_tbl, (st_data_t)allocator, (st_data_t)compat);
}
#define MARSHAL_INFECTION FL_TAINT
-STATIC_ASSERT(marshal_infection_is_int, MARSHAL_INFECTION == (int)MARSHAL_INFECTION);
+typedef char ruby_check_marshal_viral_flags[MARSHAL_INFECTION == (int)MARSHAL_INFECTION ? 1 : -1];
struct dump_arg {
VALUE str, dest;
@@ -169,34 +152,15 @@ struct dump_call_arg {
int limit;
};
-static VALUE
-check_dump_arg(VALUE ret, struct dump_arg *arg, const char *name)
+static void
+check_dump_arg(struct dump_arg *arg, ID sym)
{
if (!arg->symbols) {
rb_raise(rb_eRuntimeError, "Marshal.dump reentered at %s",
- name);
- }
- return ret;
-}
-
-static VALUE
-check_userdump_arg(VALUE obj, ID sym, int argc, const VALUE *argv,
- struct dump_arg *arg, const char *name)
-{
- VALUE ret = rb_funcallv(obj, sym, argc, argv);
- VALUE klass = CLASS_OF(obj);
- if (CLASS_OF(ret) == klass) {
- rb_raise(rb_eRuntimeError, "%"PRIsVALUE"#%s returned same class instance",
- klass, name);
+ rb_id2name(sym));
}
- return check_dump_arg(ret, arg, name);
}
-#define dump_funcall(arg, obj, sym, argc, argv) \
- check_userdump_arg(obj, sym, argc, argv, arg, name_##sym)
-#define dump_check_funcall(arg, obj, sym, argc, argv) \
- check_dump_arg(rb_check_funcall(obj, sym, argc, argv), arg, name_##sym)
-
static void clear_dump_arg(struct dump_arg *arg);
static void
@@ -221,13 +185,13 @@ free_dump_arg(void *ptr)
static size_t
memsize_dump_arg(const void *ptr)
{
- return sizeof(struct dump_arg);
+ return ptr ? sizeof(struct dump_arg) : 0;
}
static const rb_data_type_t dump_arg_data = {
"dump_arg",
{mark_dump_arg, free_dump_arg, memsize_dump_arg,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static VALUE
@@ -301,7 +265,7 @@ static void
w_long(long x, struct dump_arg *arg)
{
char buf[sizeof(long)+1];
- int i;
+ int i, len = 0;
#if SIZEOF_LONG > 4
if (!(RSHIFT(x, 31) == 0 || RSHIFT(x, 31) == -1)) {
@@ -334,7 +298,10 @@ w_long(long x, struct dump_arg *arg)
break;
}
}
- w_nbyte(buf, i+1, arg);
+ len = i;
+ for (i=0;i<=len;i++) {
+ w_byte(buf[i], arg);
+ }
}
#ifdef DBL_MANT_DIG
@@ -394,6 +361,7 @@ load_mantissa(double d, const char *buf, long len)
static void
w_float(double d, struct dump_arg *arg)
{
+ char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
char buf[FLOAT_DIG + (DECIMAL_MANT + 7) / 8 + 10];
if (isinf(d)) {
@@ -484,7 +452,7 @@ static void
w_unique(VALUE s, struct dump_arg *arg)
{
must_not_be_anonymous("class", s);
- w_symbol(rb_str_intern(s), arg);
+ w_symbol(rb_str_dynamic_intern(s), arg);
}
static void w_object(VALUE,struct dump_arg*,int);
@@ -498,7 +466,7 @@ hash_each(VALUE key, VALUE value, struct dump_call_arg *arg)
}
#define SINGLETON_DUMP_UNABLE_P(klass) \
- (rb_id_table_size(RCLASS_M_TBL(klass)) > 0 || \
+ (RCLASS_M_TBL(klass)->num_entries || \
(RCLASS_IV_TBL(klass) && RCLASS_IV_TBL(klass)->num_entries > 1))
static void
@@ -527,8 +495,7 @@ w_class(char type, VALUE obj, struct dump_arg *arg, int check)
st_data_t real_obj;
VALUE klass;
- if (arg->compat_tbl &&
- st_lookup(arg->compat_tbl, (st_data_t)obj, &real_obj)) {
+ if (st_lookup(arg->compat_tbl, (st_data_t)obj, &real_obj)) {
obj = (VALUE)real_obj;
}
klass = CLASS_OF(obj);
@@ -605,57 +572,53 @@ encoding_name(VALUE obj, struct dump_arg *arg)
static void
w_encoding(VALUE encname, struct dump_call_arg *arg)
{
- int limit = arg->limit;
- if (limit >= 0) ++limit;
switch (encname) {
case Qfalse:
case Qtrue:
w_symbol(ID2SYM(rb_intern("E")), arg->arg);
- w_object(encname, arg->arg, limit);
+ w_object(encname, arg->arg, arg->limit + 1);
case Qnil:
return;
}
w_symbol(ID2SYM(rb_id_encoding()), arg->arg);
- w_object(encname, arg->arg, limit);
+ w_object(encname, arg->arg, arg->limit + 1);
}
static st_index_t
-has_ivars(VALUE obj, VALUE encname, VALUE *ivobj)
+has_ivars(VALUE obj, VALUE encname, st_table **ivtbl)
{
- st_index_t enc = !NIL_P(encname);
- st_index_t num = 0;
+ st_index_t num = !NIL_P(encname);
- if (SPECIAL_CONST_P(obj)) goto generic;
- switch (BUILTIN_TYPE(obj)) {
- case T_OBJECT:
- case T_CLASS:
- case T_MODULE:
- break; /* counted elsewhere */
- default:
- generic:
- rb_ivar_foreach(obj, obj_count_ivars, (st_data_t)&num);
- if (num) *ivobj = obj;
+ *ivtbl = rb_generic_ivar_table(obj);
+ if (*ivtbl) {
+ st_foreach_safe(*ivtbl, obj_count_ivars, (st_data_t)&num);
}
-
- return num + enc;
+ return num;
}
static void
-w_ivar(st_index_t num, VALUE ivobj, VALUE encname, struct dump_call_arg *arg)
+w_ivar(st_index_t num, st_table *tbl, VALUE encname, struct dump_call_arg *arg)
{
w_long(num, arg->arg);
w_encoding(encname, arg);
- if (ivobj != Qundef) {
- rb_ivar_foreach(ivobj, w_obj_each, (st_data_t)arg);
+ if (tbl) {
+ st_foreach_safe(tbl, w_obj_each, (st_data_t)arg);
}
}
static void
w_objivar(VALUE obj, struct dump_call_arg *arg)
{
- st_data_t num = 0;
+ VALUE *ptr;
+ long i, len, num;
+
+ len = ROBJECT_NUMIV(obj);
+ ptr = ROBJECT_IVPTR(obj);
+ num = 0;
+ for (i = 0; i < len; i++)
+ if (ptr[i] != Qundef)
+ num += 1;
- rb_ivar_foreach(obj, obj_count_ivars, (st_data_t)&num);
w_long(num, arg->arg);
if (num != 0) {
rb_ivar_foreach(obj, w_obj_each, (st_data_t)arg);
@@ -666,7 +629,7 @@ static void
w_object(VALUE obj, struct dump_arg *arg, int limit)
{
struct dump_call_arg c_arg;
- VALUE ivobj = Qundef;
+ st_table *ivtbl = 0;
st_data_t num;
st_index_t hasiv = 0;
VALUE encname = Qnil;
@@ -675,7 +638,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
rb_raise(rb_eArgError, "exceed depth limit");
}
- if (limit > 0) limit--;
+ limit--;
c_arg.limit = limit;
c_arg.arg = arg;
@@ -729,33 +692,35 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
if (rb_obj_respond_to(obj, s_mdump, TRUE)) {
st_add_direct(arg->data, obj, arg->data->num_entries);
- v = dump_funcall(arg, obj, s_mdump, 0, 0);
+ v = rb_funcall2(obj, s_mdump, 0, 0);
+ check_dump_arg(arg, s_mdump);
w_class(TYPE_USRMARSHAL, obj, arg, FALSE);
w_object(v, arg, limit);
return;
}
if (rb_obj_respond_to(obj, s_dump, TRUE)) {
- VALUE ivobj2 = Qundef;
+ st_table *ivtbl2 = 0;
st_index_t hasiv2;
VALUE encname2;
v = INT2NUM(limit);
- v = dump_funcall(arg, obj, s_dump, 1, &v);
+ v = rb_funcall2(obj, s_dump, 1, &v);
+ check_dump_arg(arg, s_dump);
if (!RB_TYPE_P(v, T_STRING)) {
rb_raise(rb_eTypeError, "_dump() must return string");
}
- hasiv = has_ivars(obj, (encname = encoding_name(obj, arg)), &ivobj);
- hasiv2 = has_ivars(v, (encname2 = encoding_name(v, arg)), &ivobj2);
+ hasiv = has_ivars(obj, (encname = encoding_name(obj, arg)), &ivtbl);
+ hasiv2 = has_ivars(v, (encname2 = encoding_name(v, arg)), &ivtbl2);
if (hasiv2) {
hasiv = hasiv2;
- ivobj = ivobj2;
+ ivtbl = ivtbl2;
encname = encname2;
}
if (hasiv) w_byte(TYPE_IVAR, arg);
w_class(TYPE_USERDEF, obj, arg, FALSE);
w_bytes(RSTRING_PTR(v), RSTRING_LEN(v), arg);
if (hasiv) {
- w_ivar(hasiv, ivobj, encname, &c_arg);
+ w_ivar(hasiv, ivtbl, encname, &c_arg);
}
st_add_direct(arg->data, obj, arg->data->num_entries);
return;
@@ -763,7 +728,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
st_add_direct(arg->data, obj, arg->data->num_entries);
- hasiv = has_ivars(obj, (encname = encoding_name(obj, arg)), &ivobj);
+ hasiv = has_ivars(obj, (encname = encoding_name(obj, arg)), &ivtbl);
{
st_data_t compat_data;
rb_alloc_func_t allocator = rb_get_alloc_func(RBASIC(obj)->klass);
@@ -773,11 +738,8 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
marshal_compat_t *compat = (marshal_compat_t*)compat_data;
VALUE real_obj = obj;
obj = compat->dumper(real_obj);
- if (!arg->compat_tbl) {
- arg->compat_tbl = rb_init_identtable();
- }
st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
- if (obj != real_obj && ivobj == Qundef) hasiv = 0;
+ if (obj != real_obj && !ivtbl) hasiv = 0;
}
}
if (hasiv) w_byte(TYPE_IVAR, arg);
@@ -919,24 +881,25 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
if (!rb_obj_respond_to(obj, s_dump_data, TRUE)) {
rb_raise(rb_eTypeError,
- "no _dump_data is defined for class %"PRIsVALUE,
- rb_obj_class(obj));
+ "no _dump_data is defined for class %s",
+ rb_obj_classname(obj));
}
- v = dump_funcall(arg, obj, s_dump_data, 0, 0);
+ v = rb_funcall2(obj, s_dump_data, 0, 0);
+ check_dump_arg(arg, s_dump_data);
w_class(TYPE_DATA, obj, arg, TRUE);
w_object(v, arg, limit);
}
break;
default:
- rb_raise(rb_eTypeError, "can't dump %"PRIsVALUE,
- rb_obj_class(obj));
+ rb_raise(rb_eTypeError, "can't dump %s",
+ rb_obj_classname(obj));
break;
}
RB_GC_GUARD(obj);
}
if (hasiv) {
- w_ivar(hasiv, ivobj, encname, &c_arg);
+ w_ivar(hasiv, ivtbl, encname, &c_arg);
}
}
@@ -948,10 +911,8 @@ clear_dump_arg(struct dump_arg *arg)
arg->symbols = 0;
st_free_table(arg->data);
arg->data = 0;
- if (arg->compat_tbl) {
- st_free_table(arg->compat_tbl);
- arg->compat_tbl = 0;
- }
+ st_free_table(arg->compat_tbl);
+ arg->compat_tbl = 0;
if (arg->encodings) {
st_free_table(arg->encodings);
arg->encodings = 0;
@@ -1004,6 +965,8 @@ marshal_dump(int argc, VALUE *argv)
{
VALUE obj, port, a1, a2;
int limit = -1;
+ struct dump_arg *arg;
+ VALUE wrapper; /* used to avoid memory leak in case of exception */
port = Qnil;
rb_scan_args(argc, argv, "12", &obj, &a1, &a2);
@@ -1017,21 +980,12 @@ marshal_dump(int argc, VALUE *argv)
else if (NIL_P(a1)) io_needed();
else port = a1;
}
- return rb_marshal_dump_limited(obj, port, limit);
-}
-
-VALUE
-rb_marshal_dump_limited(VALUE obj, VALUE port, int limit)
-{
- struct dump_arg *arg;
- VALUE wrapper; /* used to avoid memory leak in case of exception */
-
- wrapper = TypedData_Make_Struct(0, struct dump_arg, &dump_arg_data, arg);
+ wrapper = TypedData_Make_Struct(rb_cData, struct dump_arg, &dump_arg_data, arg);
arg->dest = 0;
arg->symbols = st_init_numtable();
- arg->data = rb_init_identtable();
+ arg->data = st_init_numtable();
arg->infection = 0;
- arg->compat_tbl = 0;
+ arg->compat_tbl = st_init_numtable();
arg->encodings = 0;
arg->str = rb_str_buf_new(0);
if (!NIL_P(port)) {
@@ -1039,7 +993,9 @@ rb_marshal_dump_limited(VALUE obj, VALUE port, int limit)
io_needed();
}
arg->dest = port;
- dump_check_funcall(arg, port, s_binmode, 0, 0);
+ if (rb_check_funcall(port, s_binmode, 0, 0) != Qundef) {
+ check_dump_arg(arg, s_binmode);
+ }
}
else {
port = arg->str;
@@ -1072,17 +1028,14 @@ struct load_arg {
int infection;
};
-static VALUE
-check_load_arg(VALUE ret, struct load_arg *arg, const char *name)
+static void
+check_load_arg(struct load_arg *arg, ID sym)
{
if (!arg->symbols) {
rb_raise(rb_eRuntimeError, "Marshal.load reentered at %s",
- name);
+ rb_id2name(sym));
}
- return ret;
}
-#define load_funcall(arg, obj, sym, argc, argv) \
- check_load_arg(rb_funcallv(obj, sym, argc, argv), arg, name_##sym)
static void clear_load_arg(struct load_arg *arg);
@@ -1107,13 +1060,13 @@ free_load_arg(void *ptr)
static size_t
memsize_load_arg(const void *ptr)
{
- return sizeof(struct load_arg);
+ return ptr ? sizeof(struct load_arg) : 0;
}
static const rb_data_type_t load_arg_data = {
"load_arg",
{mark_load_arg, free_load_arg, memsize_load_arg,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
#define r_entry(v, arg) r_entry0((v), (arg)->data->num_entries, (arg))
@@ -1145,7 +1098,9 @@ r_byte1_buffered(struct load_arg *arg)
long readable = arg->readable < BUFSIZ ? arg->readable : BUFSIZ;
VALUE str, n = LONG2NUM(readable);
- str = load_funcall(arg, arg->src, s_read, 1, &n);
+ str = rb_funcall2(arg->src, s_read, 1, &n);
+
+ check_load_arg(arg, s_read);
if (NIL_P(str)) too_short();
StringValue(str);
arg->infection |= (int)FL_TEST(str, MARSHAL_INFECTION);
@@ -1175,7 +1130,8 @@ r_byte(struct load_arg *arg)
c = r_byte1_buffered(arg);
}
else {
- VALUE v = load_funcall(arg, arg->src, s_getbyte, 0, 0);
+ VALUE v = rb_funcall2(arg->src, s_getbyte, 0, 0);
+ check_load_arg(arg, s_getbyte);
if (NIL_P(v)) rb_eof_error();
c = (unsigned char)NUM2CHR(v);
}
@@ -1190,11 +1146,19 @@ long_toobig(int size)
STRINGIZE(SIZEOF_LONG)", given %d)", size);
}
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
+#endif
+
static long
r_long(struct load_arg *arg)
{
register long x;
- int c = (signed char)r_byte(arg);
+ int c = SIGN_EXTEND_CHAR(r_byte(arg));
long i;
if (c == 0) return 0;
@@ -1228,7 +1192,8 @@ r_bytes1(long len, struct load_arg *arg)
{
VALUE str, n = LONG2NUM(len);
- str = load_funcall(arg, arg->src, s_read, 1, &n);
+ str = rb_funcall2(arg->src, s_read, 1, &n);
+ check_load_arg(arg, s_read);
if (NIL_P(str)) too_short();
StringValue(str);
if (RSTRING_LEN(str) != len) too_short();
@@ -1256,7 +1221,9 @@ r_bytes1_buffered(long len, struct load_arg *arg)
readable = readable < BUFSIZ ? readable : BUFSIZ;
read_len = need_len > readable ? need_len : readable;
n = LONG2NUM(read_len);
- tmp = load_funcall(arg, arg->src, s_read, 1, &n);
+ tmp = rb_funcall2(arg->src, s_read, 1, &n);
+
+ check_load_arg(arg, s_read);
if (NIL_P(tmp)) too_short();
StringValue(tmp);
@@ -1313,18 +1280,11 @@ r_bytes0(long len, struct load_arg *arg)
static int
sym2encidx(VALUE sym, VALUE val)
{
- static const char name_encoding[8] = "encoding";
- const char *p;
- long l;
- if (rb_enc_get_index(sym) != ENCINDEX_US_ASCII) return -1;
- RSTRING_GETMEM(sym, p, l);
- if (l <= 0) return -1;
- if (l == sizeof(name_encoding) &&
- memcmp(p, name_encoding, sizeof(name_encoding)) == 0) {
+ if (sym == ID2SYM(rb_id_encoding())) {
int idx = rb_enc_find_index(StringValueCStr(val));
return idx;
}
- else if (l == 1 && *p == 'E') {
+ else if (sym == ID2SYM(rb_intern("E"))) {
if (val == Qfalse) return rb_usascii_encindex();
else if (val == Qtrue) return rb_utf8_encindex();
/* bogus ignore */
@@ -1352,8 +1312,7 @@ r_symreal(struct load_arg *arg, int ivar)
int idx = -1;
st_index_t n = arg->symbols->num_entries;
- if (rb_enc_str_asciionly_p(s)) rb_enc_associate_index(s, ENCINDEX_US_ASCII);
- st_insert(arg->symbols, (st_data_t)n, (st_data_t)s);
+ st_insert(arg->symbols, (st_data_t)n, (st_data_t)0);
if (ivar) {
long num = r_long(arg);
while (num-- > 0) {
@@ -1362,8 +1321,10 @@ r_symreal(struct load_arg *arg, int ivar)
}
}
if (idx > 0) rb_enc_associate_index(s, idx);
+ sym = rb_str_dynamic_intern(s);
+ st_insert(arg->symbols, (st_data_t)n, (st_data_t)sym);
- return s;
+ return sym;
}
static VALUE
@@ -1391,7 +1352,7 @@ r_symbol(struct load_arg *arg)
static VALUE
r_unique(struct load_arg *arg)
{
- return r_symbol(arg);
+ return rb_sym2str(r_symbol(arg));
}
static VALUE
@@ -1404,7 +1365,7 @@ static VALUE
r_entry0(VALUE v, st_index_t num, struct load_arg *arg)
{
st_data_t real_obj = (VALUE)Qundef;
- if (arg->compat_tbl && st_lookup(arg->compat_tbl, v, &real_obj)) {
+ if (st_lookup(arg->compat_tbl, v, &real_obj)) {
st_insert(arg->data, num, (st_data_t)real_obj);
}
else {
@@ -1423,14 +1384,15 @@ static VALUE
r_fixup_compat(VALUE v, struct load_arg *arg)
{
st_data_t data;
- st_data_t key = (st_data_t)v;
- if (arg->compat_tbl && st_delete(arg->compat_tbl, &key, &data)) {
+ if (st_lookup(arg->compat_tbl, v, &data)) {
VALUE real_obj = (VALUE)data;
rb_alloc_func_t allocator = rb_get_alloc_func(CLASS_OF(real_obj));
+ st_data_t key = v;
if (st_lookup(compat_allocator_tbl, (st_data_t)allocator, &data)) {
marshal_compat_t *compat = (marshal_compat_t*)data;
compat->loader(real_obj, v);
}
+ st_delete(arg->compat_tbl, &key, 0);
v = real_obj;
}
return v;
@@ -1440,7 +1402,8 @@ static VALUE
r_post_proc(VALUE v, struct load_arg *arg)
{
if (arg->proc) {
- v = load_funcall(arg, arg->proc, s_call, 1, &v);
+ v = rb_funcall(arg->proc, s_call, 1, v);
+ check_load_arg(arg, s_call);
}
return v;
}
@@ -1487,7 +1450,7 @@ r_ivar(VALUE obj, int *has_encoding, struct load_arg *arg)
if (has_encoding) *has_encoding = TRUE;
}
else {
- rb_ivar_set(obj, rb_intern_str(sym), val);
+ rb_ivar_set(obj, SYM2ID(sym), val);
}
} while (--len > 0);
}
@@ -1527,10 +1490,6 @@ obj_alloc_by_klass(VALUE klass, struct load_arg *arg, VALUE *oldclass)
VALUE real_obj = rb_obj_alloc(klass);
VALUE obj = rb_obj_alloc(compat->oldclass);
if (oldclass) *oldclass = compat->oldclass;
-
- if (!arg->compat_tbl) {
- arg->compat_tbl = rb_init_identtable();
- }
st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
return obj;
}
@@ -1577,7 +1536,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
rb_raise(rb_eArgError, "dump format error (unlinked)");
}
v = (VALUE)link;
- v = r_post_proc(v, arg);
+ r_post_proc(v, arg);
break;
case TYPE_IVAR:
@@ -1593,7 +1552,6 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
VALUE path = r_unique(arg);
VALUE m = rb_path_to_class(path);
- if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0);
if (RB_TYPE_P(m, T_CLASS)) { /* prepended */
VALUE c;
@@ -1613,6 +1571,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
else {
must_be_module(m, path);
+ if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0);
rb_ary_push(extmod, m);
v = r_object0(arg, 0, extmod);
@@ -1772,7 +1731,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
long len = r_long(arg);
- v = rb_hash_new_with_size(len);
+ v = rb_hash_new();
v = r_entry(v, arg);
arg->readable += (len - 1) * 2;
while (len--) {
@@ -1811,31 +1770,17 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
arg->readable += (len - 1) * 2;
v = r_entry0(v, idx, arg);
values = rb_ary_new2(len);
- {
- VALUE keywords;
- int keyword_init = RTEST(rb_struct_s_keyword_init(klass));
- if (keyword_init) {
- keywords = rb_hash_new();
- rb_ary_push(values, keywords);
- }
-
- for (i=0; i<len; i++) {
- VALUE n = rb_sym2str(RARRAY_AREF(mem, i));
- slot = r_symbol(arg);
-
- if (!rb_str_equal(n, slot)) {
- rb_raise(rb_eTypeError, "struct %"PRIsVALUE" not compatible (:%"PRIsVALUE" for :%"PRIsVALUE")",
- rb_class_name(klass),
- slot, n);
- }
- if (keyword_init) {
- rb_hash_aset(keywords, RARRAY_AREF(mem, i), r_object(arg));
- }
- else {
- rb_ary_push(values, r_object(arg));
- }
- arg->readable -= 2;
+ for (i=0; i<len; i++) {
+ slot = r_symbol(arg);
+
+ if (RARRAY_AREF(mem, i) != slot) {
+ rb_raise(rb_eTypeError, "struct %"PRIsVALUE" not compatible (:%"PRIsVALUE" for :%"PRIsVALUE")",
+ rb_class_name(klass),
+ rb_sym2str(slot),
+ rb_sym2str(RARRAY_AREF(mem, i)));
}
+ rb_ary_push(values, r_object(arg));
+ arg->readable -= 2;
}
rb_struct_initialize(v, values);
v = r_leave(v, arg);
@@ -1845,34 +1790,28 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_USERDEF:
{
- VALUE name = r_unique(arg);
- VALUE klass = path2class(name);
+ VALUE klass = path2class(r_unique(arg));
VALUE data;
- st_data_t d;
if (!rb_obj_respond_to(klass, s_load, TRUE)) {
- rb_raise(rb_eTypeError, "class %"PRIsVALUE" needs to have method `_load'",
- name);
+ rb_raise(rb_eTypeError, "class %s needs to have method `_load'",
+ rb_class2name(klass));
}
data = r_string(arg);
if (ivp) {
r_ivar(data, NULL, arg);
*ivp = FALSE;
}
- v = load_funcall(arg, klass, s_load, 1, &data);
+ v = rb_funcall2(klass, s_load, 1, &data);
+ check_load_arg(arg, s_load);
v = r_entry(v, arg);
- if (st_lookup(compat_allocator_tbl, (st_data_t)rb_get_alloc_func(klass), &d)) {
- marshal_compat_t *compat = (marshal_compat_t*)d;
- v = compat->loader(klass, v);
- }
- v = r_post_proc(v, arg);
+ v = r_leave(v, arg);
}
break;
case TYPE_USRMARSHAL:
{
- VALUE name = r_unique(arg);
- VALUE klass = path2class(name);
+ VALUE klass = path2class(r_unique(arg));
VALUE oldclass = 0;
VALUE data;
@@ -1882,12 +1821,13 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
append_extmod(v, extmod);
}
if (!rb_obj_respond_to(v, s_mload, TRUE)) {
- rb_raise(rb_eTypeError, "instance of %"PRIsVALUE" needs to have method `marshal_load'",
- name);
+ rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
+ rb_class2name(klass));
}
v = r_entry(v, arg);
data = r_object(arg);
- load_funcall(arg, v, s_mload, 1, &data);
+ rb_funcall2(v, s_mload, 1, &data);
+ check_load_arg(arg, s_mload);
v = r_fixup_compat(v, arg);
v = r_copy_ivar(v, data);
v = r_post_proc(v, arg);
@@ -1913,8 +1853,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_DATA:
{
- VALUE name = r_unique(arg);
- VALUE klass = path2class(name);
+ VALUE klass = path2class(r_unique(arg));
VALUE oldclass = 0;
VALUE r;
@@ -1925,11 +1864,12 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
v = r_entry(v, arg);
if (!rb_obj_respond_to(v, s_load_data, TRUE)) {
rb_raise(rb_eTypeError,
- "class %"PRIsVALUE" needs to have instance method `_load_data'",
- name);
+ "class %s needs to have instance method `_load_data'",
+ rb_class2name(klass));
}
r = r_object0(arg, 0, extmod);
- load_funcall(arg, v, s_load_data, 1, &r);
+ rb_funcall2(v, s_load_data, 1, &r);
+ check_load_arg(arg, s_load_data);
v = r_leave(v, arg);
}
break;
@@ -1975,23 +1915,17 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
else {
v = r_symreal(arg, 0);
}
- v = rb_str_intern(v);
v = r_leave(v, arg);
break;
case TYPE_SYMLINK:
- v = rb_str_intern(r_symlink(arg));
+ v = r_symlink(arg);
break;
default:
rb_raise(rb_eArgError, "dump format error(0x%x)", type);
break;
}
-
- if (v == Qundef) {
- rb_raise(rb_eArgError, "dump format error (bad link)");
- }
-
return v;
}
@@ -2016,10 +1950,8 @@ clear_load_arg(struct load_arg *arg)
arg->symbols = 0;
st_free_table(arg->data);
arg->data = 0;
- if (arg->compat_tbl) {
- st_free_table(arg->compat_tbl);
- arg->compat_tbl = 0;
- }
+ st_free_table(arg->compat_tbl);
+ arg->compat_tbl = 0;
}
/*
@@ -2040,21 +1972,12 @@ static VALUE
marshal_load(int argc, VALUE *argv)
{
VALUE port, proc;
-
- rb_check_arity(argc, 1, 2);
- port = argv[0];
- proc = argc > 1 ? argv[1] : Qnil;
- return rb_marshal_load_with_proc(port, proc);
-}
-
-VALUE
-rb_marshal_load_with_proc(VALUE port, VALUE proc)
-{
int major, minor, infection = 0;
VALUE v;
VALUE wrapper; /* used to avoid memory leak in case of exception */
struct load_arg *arg;
+ rb_scan_args(argc, argv, "11", &port, &proc);
v = rb_check_string_type(port);
if (!NIL_P(v)) {
infection = (int)FL_TEST(port, MARSHAL_INFECTION); /* original taintedness */
@@ -2067,13 +1990,13 @@ rb_marshal_load_with_proc(VALUE port, VALUE proc)
else {
io_needed();
}
- wrapper = TypedData_Make_Struct(0, struct load_arg, &load_arg_data, arg);
+ wrapper = TypedData_Make_Struct(rb_cData, struct load_arg, &load_arg_data, arg);
arg->infection = infection;
arg->src = port;
arg->offset = 0;
arg->symbols = st_init_numtable();
- arg->data = rb_init_identtable();
- arg->compat_tbl = 0;
+ arg->data = st_init_numtable();
+ arg->compat_tbl = st_init_numtable();
arg->proc = 0;
arg->readable = 0;
@@ -2222,19 +2145,19 @@ Init_marshal(void)
#define rb_intern(str) rb_intern_const(str)
VALUE rb_mMarshal = rb_define_module("Marshal");
-#define set_id(sym) sym = rb_intern_const(name_##sym)
- set_id(s_dump);
- set_id(s_load);
- set_id(s_mdump);
- set_id(s_mload);
- set_id(s_dump_data);
- set_id(s_load_data);
- set_id(s_alloc);
- set_id(s_call);
- set_id(s_getbyte);
- set_id(s_read);
- set_id(s_write);
- set_id(s_binmode);
+
+ s_dump = rb_intern("_dump");
+ s_load = rb_intern("_load");
+ s_mdump = rb_intern("marshal_dump");
+ s_mload = rb_intern("marshal_load");
+ s_dump_data = rb_intern("_dump_data");
+ s_load_data = rb_intern("_load_data");
+ s_alloc = rb_intern("_alloc");
+ s_call = rb_intern("call");
+ s_getbyte = rb_intern("getbyte");
+ s_read = rb_intern("read");
+ s_write = rb_intern("write");
+ s_binmode = rb_intern("binmode");
rb_define_module_function(rb_mMarshal, "dump", marshal_dump, -1);
rb_define_module_function(rb_mMarshal, "load", marshal_load, -1);
@@ -2244,29 +2167,27 @@ Init_marshal(void)
rb_define_const(rb_mMarshal, "MAJOR_VERSION", INT2FIX(MARSHAL_MAJOR));
/* minor version */
rb_define_const(rb_mMarshal, "MINOR_VERSION", INT2FIX(MARSHAL_MINOR));
-}
-static st_table *
-compat_allocator_table(void)
-{
- if (compat_allocator_tbl) return compat_allocator_tbl;
compat_allocator_tbl = st_init_numtable();
-#undef RUBY_UNTYPED_DATA_WARNING
-#define RUBY_UNTYPED_DATA_WARNING 0
compat_allocator_tbl_wrapper =
- Data_Wrap_Struct(0, mark_marshal_compat_t, 0, compat_allocator_tbl);
+ Data_Wrap_Struct(rb_cData, mark_marshal_compat_t, 0, compat_allocator_tbl);
rb_gc_register_mark_object(compat_allocator_tbl_wrapper);
- return compat_allocator_tbl;
}
VALUE
rb_marshal_dump(VALUE obj, VALUE port)
{
- return rb_marshal_dump_limited(obj, port, -1);
+ int argc = 1;
+ VALUE argv[2];
+
+ argv[0] = obj;
+ argv[1] = port;
+ if (!NIL_P(port)) argc = 2;
+ return marshal_dump(argc, argv);
}
VALUE
rb_marshal_load(VALUE port)
{
- return rb_marshal_load_with_proc(port, Qnil);
+ return marshal_load(1, &port);
}
diff --git a/math.c b/math.c
index ce49879305..a09d605911 100644
--- a/math.c
+++ b/math.c
@@ -9,9 +9,7 @@
**********************************************************************/
-#ifdef _MSC_VER
-# define _USE_MATH_DEFINES 1
-#endif
+#include "ruby/ruby.h"
#include "internal.h"
#include <float.h>
#include <math.h>
@@ -27,7 +25,11 @@
VALUE rb_mMath;
VALUE rb_eMathDomainError;
-#define Get_Double(x) rb_num_to_dbl(x)
+#define Need_Float(x) do {if (!RB_TYPE_P(x, T_FLOAT)) {(x) = rb_to_float(x);}} while(0)
+#define Need_Float2(x,y) do {\
+ Need_Float(x);\
+ Need_Float(y);\
+} while (0)
#define domain_error(msg) \
rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg)
@@ -37,9 +39,7 @@ VALUE rb_eMathDomainError;
* Math.atan2(y, x) -> Float
*
* Computes the arc tangent given +y+ and +x+.
- * Returns a Float in the range -PI..PI. Return value is a angle
- * in radians between the positive x-axis of cartesian plane
- * and the point given by the coordinates (+x+, +y+) on it.
+ * Returns a Float in the range -PI..PI.
*
* Domain: (-INFINITY, INFINITY)
*
@@ -63,11 +63,15 @@ VALUE rb_eMathDomainError;
*/
static VALUE
-math_atan2(VALUE unused_obj, VALUE y, VALUE x)
+math_atan2(VALUE obj, VALUE y, VALUE x)
{
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
double dx, dy;
- dx = Get_Double(x);
- dy = Get_Double(y);
+ Need_Float2(y, x);
+ dx = RFLOAT_VALUE(x);
+ dy = RFLOAT_VALUE(y);
if (dx == 0.0 && dy == 0.0) {
if (!signbit(dx))
return DBL2NUM(dy);
@@ -108,9 +112,10 @@ math_atan2(VALUE unused_obj, VALUE y, VALUE x)
*/
static VALUE
-math_cos(VALUE unused_obj, VALUE x)
+math_cos(VALUE obj, VALUE x)
{
- return DBL2NUM(cos(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(cos(RFLOAT_VALUE(x)));
}
/*
@@ -129,9 +134,10 @@ math_cos(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_sin(VALUE unused_obj, VALUE x)
+math_sin(VALUE obj, VALUE x)
{
- return DBL2NUM(sin(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(sin(RFLOAT_VALUE(x)));
}
@@ -150,9 +156,10 @@ math_sin(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_tan(VALUE unused_obj, VALUE x)
+math_tan(VALUE obj, VALUE x)
{
- return DBL2NUM(tan(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(tan(RFLOAT_VALUE(x)));
}
/*
@@ -170,14 +177,16 @@ math_tan(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_acos(VALUE unused_obj, VALUE x)
+math_acos(VALUE obj, VALUE x)
{
- double d;
+ double d0, d;
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < -1.0 || 1.0 < d) domain_error("acos");
- return DBL2NUM(acos(d));
+ if (d0 < -1.0 || 1.0 < d0) domain_error("acos");
+ d = acos(d0);
+ return DBL2NUM(d);
}
/*
@@ -194,14 +203,16 @@ math_acos(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_asin(VALUE unused_obj, VALUE x)
+math_asin(VALUE obj, VALUE x)
{
- double d;
+ double d0, d;
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < -1.0 || 1.0 < d) domain_error("asin");
- return DBL2NUM(asin(d));
+ if (d0 < -1.0 || 1.0 < d0) domain_error("asin");
+ d = asin(d0);
+ return DBL2NUM(d);
}
/*
@@ -218,9 +229,10 @@ math_asin(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_atan(VALUE unused_obj, VALUE x)
+math_atan(VALUE obj, VALUE x)
{
- return DBL2NUM(atan(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(atan(RFLOAT_VALUE(x)));
}
#ifndef HAVE_COSH
@@ -246,9 +258,10 @@ cosh(double x)
*/
static VALUE
-math_cosh(VALUE unused_obj, VALUE x)
+math_cosh(VALUE obj, VALUE x)
{
- return DBL2NUM(cosh(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(cosh(RFLOAT_VALUE(x)));
}
#ifndef HAVE_SINH
@@ -274,23 +287,17 @@ sinh(double x)
*/
static VALUE
-math_sinh(VALUE unused_obj, VALUE x)
+math_sinh(VALUE obj, VALUE x)
{
- return DBL2NUM(sinh(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(sinh(RFLOAT_VALUE(x)));
}
#ifndef HAVE_TANH
double
tanh(double x)
{
-# if defined(HAVE_SINH) && defined(HAVE_COSH)
- const double c = cosh(x);
- if (!isinf(c)) return sinh(x) / c;
-# else
- const double e = exp(x+x);
- if (!isinf(e)) return (e - 1) / (e + 1);
-# endif
- return x > 0 ? 1.0 : -1.0;
+ return sinh(x) / cosh(x);
}
#endif
@@ -309,9 +316,10 @@ tanh(double x)
*/
static VALUE
-math_tanh(VALUE unused_obj, VALUE x)
+math_tanh(VALUE obj, VALUE x)
{
- return DBL2NUM(tanh(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(tanh(RFLOAT_VALUE(x)));
}
/*
@@ -329,14 +337,16 @@ math_tanh(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_acosh(VALUE unused_obj, VALUE x)
+math_acosh(VALUE obj, VALUE x)
{
- double d;
+ double d0, d;
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < 1.0) domain_error("acosh");
- return DBL2NUM(acosh(d));
+ if (d0 < 1.0) domain_error("acosh");
+ d = acosh(d0);
+ return DBL2NUM(d);
}
/*
@@ -354,9 +364,10 @@ math_acosh(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_asinh(VALUE unused_obj, VALUE x)
+math_asinh(VALUE obj, VALUE x)
{
- return DBL2NUM(asinh(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(asinh(RFLOAT_VALUE(x)));
}
/*
@@ -374,17 +385,19 @@ math_asinh(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_atanh(VALUE unused_obj, VALUE x)
+math_atanh(VALUE obj, VALUE x)
{
- double d;
+ double d0, d;
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < -1.0 || +1.0 < d) domain_error("atanh");
+ if (d0 < -1.0 || +1.0 < d0) domain_error("atanh");
/* check for pole error */
- if (d == -1.0) return DBL2NUM(-INFINITY);
- if (d == +1.0) return DBL2NUM(+INFINITY);
- return DBL2NUM(atanh(d));
+ if (d0 == -1.0) return DBL2NUM(-INFINITY);
+ if (d0 == +1.0) return DBL2NUM(+INFINITY);
+ d = atanh(d0);
+ return DBL2NUM(d);
}
/*
@@ -404,9 +417,10 @@ math_atanh(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_exp(VALUE unused_obj, VALUE x)
+math_exp(VALUE obj, VALUE x)
{
- return DBL2NUM(exp(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(exp(RFLOAT_VALUE(x)));
}
#if defined __CYGWIN__
@@ -418,13 +432,6 @@ math_exp(VALUE unused_obj, VALUE x)
# define log10(x) ((x) < 0.0 ? nan("") : log10(x))
#endif
-#ifndef M_LN2
-# define M_LN2 0.693147180559945309417232121458176568
-#endif
-#ifndef M_LN10
-# define M_LN10 2.30258509299404568401799145468436421
-#endif
-
static double math_log1(VALUE x);
/*
@@ -449,7 +456,7 @@ static double math_log1(VALUE x);
*/
static VALUE
-math_log(int argc, const VALUE *argv, VALUE unused_obj)
+math_log(int argc, const VALUE *argv, VALUE obj)
{
VALUE x, base;
double d;
@@ -463,8 +470,9 @@ math_log(int argc, const VALUE *argv, VALUE unused_obj)
}
static double
-get_double_rshift(VALUE x, size_t *pnumbits)
+math_log1(VALUE x)
{
+ double d0, d;
size_t numbits;
if (RB_BIGNUM_TYPE_P(x) && BIGNUM_POSITIVE_P(x) &&
@@ -475,22 +483,17 @@ get_double_rshift(VALUE x, size_t *pnumbits)
else {
numbits = 0;
}
- *pnumbits = numbits;
- return Get_Double(x);
-}
-
-static double
-math_log1(VALUE x)
-{
- size_t numbits;
- double d = get_double_rshift(x, &numbits);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < 0.0) domain_error("log");
+ if (d0 < 0.0) domain_error("log");
/* check for pole error */
- if (d == 0.0) return -INFINITY;
-
- return log(d) + numbits * M_LN2; /* log(d * 2 ** numbits) */
+ if (d0 == 0.0) return -INFINITY;
+ d = log(d0);
+ if (numbits)
+ d += numbits * log(2); /* log(2**numbits) */
+ return d;
}
#ifndef log2
@@ -523,17 +526,29 @@ extern double log2(double);
*/
static VALUE
-math_log2(VALUE unused_obj, VALUE x)
+math_log2(VALUE obj, VALUE x)
{
+ double d0, d;
size_t numbits;
- double d = get_double_rshift(x, &numbits);
+ if (RB_BIGNUM_TYPE_P(x) && BIGNUM_POSITIVE_P(x) &&
+ DBL_MAX_EXP <= (numbits = rb_absint_numwords(x, 1, NULL))) {
+ numbits -= DBL_MANT_DIG;
+ x = rb_big_rshift(x, SIZET2NUM(numbits));
+ }
+ else {
+ numbits = 0;
+ }
+
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < 0.0) domain_error("log2");
+ if (d0 < 0.0) domain_error("log2");
/* check for pole error */
- if (d == 0.0) return DBL2NUM(-INFINITY);
-
- return DBL2NUM(log2(d) + numbits); /* log2(d * 2 ** numbits) */
+ if (d0 == 0.0) return DBL2NUM(-INFINITY);
+ d = log2(d0);
+ d += numbits;
+ return DBL2NUM(d);
}
/*
@@ -553,17 +568,30 @@ math_log2(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_log10(VALUE unused_obj, VALUE x)
+math_log10(VALUE obj, VALUE x)
{
+ double d0, d;
size_t numbits;
- double d = get_double_rshift(x, &numbits);
+ if (RB_BIGNUM_TYPE_P(x) && BIGNUM_POSITIVE_P(x) &&
+ DBL_MAX_EXP <= (numbits = rb_absint_numwords(x, 1, NULL))) {
+ numbits -= DBL_MANT_DIG;
+ x = rb_big_rshift(x, SIZET2NUM(numbits));
+ }
+ else {
+ numbits = 0;
+ }
+
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < 0.0) domain_error("log10");
+ if (d0 < 0.0) domain_error("log10");
/* check for pole error */
- if (d == 0.0) return DBL2NUM(-INFINITY);
-
- return DBL2NUM(log10(d) + numbits * log10(2)); /* log10(d * 2 ** numbits) */
+ if (d0 == 0.0) return DBL2NUM(-INFINITY);
+ d = log10(d0);
+ if (numbits)
+ d += numbits * log10(2); /* log10(2**numbits) */
+ return DBL2NUM(d);
}
/*
@@ -590,58 +618,20 @@ math_log10(VALUE unused_obj, VALUE x)
* # [8, 2.82842712474619, 8.0]
* # [9, 3.0, 9.0]
* # [10, 3.16227766016838, 10.0]
- *
- * Note that the limited precision of floating point arithmetic
- * might lead to surprising results:
- *
- * Math.sqrt(10**46).to_i #=> 99999999999999991611392 (!)
- *
- * See also BigDecimal#sqrt and Integer.sqrt.
*/
static VALUE
-math_sqrt(VALUE unused_obj, VALUE x)
-{
- return rb_math_sqrt(x);
-}
-
-#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
-inline static VALUE
-f_negative_p(VALUE x)
+math_sqrt(VALUE obj, VALUE x)
{
- if (FIXNUM_P(x))
- return f_boolcast(FIX2LONG(x) < 0);
- return rb_funcall(x, '<', 1, INT2FIX(0));
-}
-inline static VALUE
-f_signbit(VALUE x)
-{
- if (RB_TYPE_P(x, T_FLOAT)) {
- double f = RFLOAT_VALUE(x);
- return f_boolcast(!isnan(f) && signbit(f));
- }
- return f_negative_p(x);
-}
-
-VALUE
-rb_math_sqrt(VALUE x)
-{
- double d;
+ double d0, d;
- if (RB_TYPE_P(x, T_COMPLEX)) {
- VALUE neg = f_signbit(RCOMPLEX(x)->imag);
- double re = Get_Double(RCOMPLEX(x)->real), im;
- d = Get_Double(rb_complex_abs(x));
- im = sqrt((d - re) / 2.0);
- re = sqrt((d + re) / 2.0);
- if (neg) im = -im;
- return rb_complex_new(DBL2NUM(re), DBL2NUM(im));
- }
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (d < 0.0) domain_error("sqrt");
- if (d == 0.0) return DBL2NUM(0.0);
- return DBL2NUM(sqrt(d));
+ if (d0 < 0.0) domain_error("sqrt");
+ if (d0 == 0.0) return DBL2NUM(0.0);
+ d = sqrt(d0);
+ return DBL2NUM(d);
}
/*
@@ -650,9 +640,9 @@ rb_math_sqrt(VALUE x)
*
* Returns the cube root of +x+.
*
- * Domain: (-INFINITY, INFINITY)
+ * Domain: [0, INFINITY)
*
- * Codomain: (-INFINITY, INFINITY)
+ * Codomain:[0, INFINITY)
*
* -9.upto(9) {|x|
* p [x, Math.cbrt(x), Math.cbrt(x)**3]
@@ -680,9 +670,10 @@ rb_math_sqrt(VALUE x)
*/
static VALUE
-math_cbrt(VALUE unused_obj, VALUE x)
+math_cbrt(VALUE obj, VALUE x)
{
- return DBL2NUM(cbrt(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(cbrt(RFLOAT_VALUE(x)));
}
/*
@@ -690,19 +681,21 @@ math_cbrt(VALUE unused_obj, VALUE x)
* Math.frexp(x) -> [fraction, exponent]
*
* Returns a two-element array containing the normalized fraction (a Float)
- * and exponent (an Integer) of +x+.
+ * and exponent (a Fixnum) of +x+.
*
* fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11]
* fraction * 2**exponent #=> 1234.0
*/
static VALUE
-math_frexp(VALUE unused_obj, VALUE x)
+math_frexp(VALUE obj, VALUE x)
{
double d;
int exp;
- d = frexp(Get_Double(x), &exp);
+ Need_Float(x);
+
+ d = frexp(RFLOAT_VALUE(x), &exp);
return rb_assoc_new(DBL2NUM(d), INT2NUM(exp));
}
@@ -717,9 +710,10 @@ math_frexp(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_ldexp(VALUE unused_obj, VALUE x, VALUE n)
+math_ldexp(VALUE obj, VALUE x, VALUE n)
{
- return DBL2NUM(ldexp(Get_Double(x), NUM2INT(n)));
+ Need_Float(x);
+ return DBL2NUM(ldexp(RFLOAT_VALUE(x), NUM2INT(n)));
}
/*
@@ -733,9 +727,10 @@ math_ldexp(VALUE unused_obj, VALUE x, VALUE n)
*/
static VALUE
-math_hypot(VALUE unused_obj, VALUE x, VALUE y)
+math_hypot(VALUE obj, VALUE x, VALUE y)
{
- return DBL2NUM(hypot(Get_Double(x), Get_Double(y)));
+ Need_Float2(x, y);
+ return DBL2NUM(hypot(RFLOAT_VALUE(x), RFLOAT_VALUE(y)));
}
/*
@@ -753,9 +748,10 @@ math_hypot(VALUE unused_obj, VALUE x, VALUE y)
*/
static VALUE
-math_erf(VALUE unused_obj, VALUE x)
+math_erf(VALUE obj, VALUE x)
{
- return DBL2NUM(erf(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(erf(RFLOAT_VALUE(x)));
}
/*
@@ -773,9 +769,10 @@ math_erf(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_erfc(VALUE unused_obj, VALUE x)
+math_erfc(VALUE obj, VALUE x)
{
- return DBL2NUM(erfc(Get_Double(x)));
+ Need_Float(x);
+ return DBL2NUM(erfc(RFLOAT_VALUE(x)));
}
/*
@@ -819,7 +816,7 @@ math_erfc(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_gamma(VALUE unused_obj, VALUE x)
+math_gamma(VALUE obj, VALUE x)
{
static const double fact_table[] = {
/* fact(0) */ 1.0,
@@ -849,24 +846,22 @@ math_gamma(VALUE unused_obj, VALUE x)
* impossible to represent exactly in IEEE 754 double which have
* 53bit mantissa. */
};
- enum {NFACT_TABLE = numberof(fact_table)};
- double d;
- d = Get_Double(x);
+ double d0, d;
+ double intpart, fracpart;
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (isinf(d)) {
- if (signbit(d)) domain_error("gamma");
- return DBL2NUM(INFINITY);
- }
- if (d == 0.0) {
- return signbit(d) ? DBL2NUM(-INFINITY) : DBL2NUM(INFINITY);
- }
- if (d == floor(d)) {
- if (d < 0.0) domain_error("gamma");
- if (1.0 <= d && d <= (double)NFACT_TABLE) {
- return DBL2NUM(fact_table[(int)d - 1]);
+ if (isinf(d0) && signbit(d0)) domain_error("gamma");
+ fracpart = modf(d0, &intpart);
+ if (fracpart == 0.0) {
+ if (intpart < 0) domain_error("gamma");
+ if (0 < intpart &&
+ intpart - 1 < (double)numberof(fact_table)) {
+ return DBL2NUM(fact_table[(int)intpart - 1]);
}
}
- return DBL2NUM(tgamma(d));
+ d = tgamma(d0);
+ return DBL2NUM(d);
}
/*
@@ -884,22 +879,20 @@ math_gamma(VALUE unused_obj, VALUE x)
*/
static VALUE
-math_lgamma(VALUE unused_obj, VALUE x)
+math_lgamma(VALUE obj, VALUE x)
{
- double d;
+ double d0, d;
int sign=1;
VALUE v;
- d = Get_Double(x);
+ Need_Float(x);
+ d0 = RFLOAT_VALUE(x);
/* check for domain error */
- if (isinf(d)) {
- if (signbit(d)) domain_error("lgamma");
+ if (isinf(d0)) {
+ if (signbit(d0)) domain_error("lgamma");
return rb_assoc_new(DBL2NUM(INFINITY), INT2FIX(1));
}
- if (d == 0.0) {
- VALUE vsign = signbit(d) ? INT2FIX(-1) : INT2FIX(+1);
- return rb_assoc_new(DBL2NUM(INFINITY), vsign);
- }
- v = DBL2NUM(lgamma_r(d, &sign));
+ d = lgamma_r(d0, &sign);
+ v = DBL2NUM(d);
return rb_assoc_new(v, INT2FIX(sign));
}
@@ -908,14 +901,14 @@ math_lgamma(VALUE unused_obj, VALUE x)
VALUE \
rb_math_##n(VALUE x)\
{\
- return math_##n(0, x);\
+ return math_##n(rb_mMath, x);\
}
#define exp2(n) \
VALUE \
rb_math_##n(VALUE x, VALUE y)\
{\
- return math_##n(0, x, y);\
+ return math_##n(rb_mMath, x, y);\
}
exp2(atan2)
@@ -927,7 +920,7 @@ exp2(hypot)
VALUE
rb_math_log(int argc, const VALUE *argv)
{
- return math_log(argc, argv, 0);
+ return math_log(argc, argv, rb_mMath);
}
exp1(sin)
@@ -966,13 +959,17 @@ exp1(sqrt)
void
-InitVM_Math(void)
+Init_Math(void)
{
rb_mMath = rb_define_module("Math");
rb_eMathDomainError = rb_define_class_under(rb_mMath, "DomainError", rb_eStandardError);
+#ifdef M_PI
/* Definition of the mathematical constant PI as a Float number. */
rb_define_const(rb_mMath, "PI", DBL2NUM(M_PI));
+#else
+ rb_define_const(rb_mMath, "PI", DBL2NUM(atan(1.0)*4.0));
+#endif
#ifdef M_E
/* Definition of the mathematical constant E (e) as a Float number. */
@@ -1016,9 +1013,3 @@ InitVM_Math(void)
rb_define_module_function(rb_mMath, "gamma", math_gamma, 1);
rb_define_module_function(rb_mMath, "lgamma", math_lgamma, 1);
}
-
-void
-Init_Math(void)
-{
- InitVM(Math);
-}
diff --git a/method.h b/method.h
index dc430401a7..82678092c2 100644
--- a/method.h
+++ b/method.h
@@ -8,8 +8,8 @@
Copyright (C) 2009 Koichi Sasada
**********************************************************************/
-#ifndef RUBY_METHOD_H
-#define RUBY_METHOD_H 1
+#ifndef METHOD_H
+#define METHOD_H
#include "internal.h"
@@ -21,109 +21,46 @@
# endif
#endif
-/* cref */
-
typedef enum {
- METHOD_VISI_UNDEF = 0x00,
- METHOD_VISI_PUBLIC = 0x01,
- METHOD_VISI_PRIVATE = 0x02,
- METHOD_VISI_PROTECTED = 0x03,
-
- METHOD_VISI_MASK = 0x03
-} rb_method_visibility_t;
-
-typedef struct rb_scope_visi_struct {
- rb_method_visibility_t method_visi : 3;
- unsigned int module_func : 1;
-} rb_scope_visibility_t;
-
-/*! CREF (Class REFerence) */
-typedef struct rb_cref_struct {
- VALUE flags;
- const VALUE refinements;
- const VALUE klass;
- struct rb_cref_struct * const next;
- const rb_scope_visibility_t scope_visi;
-} rb_cref_t;
+ NOEX_PUBLIC = 0x00,
+ NOEX_NOSUPER = 0x01,
+ NOEX_PRIVATE = 0x02,
+ NOEX_PROTECTED = 0x04,
+ NOEX_MASK = 0x06,
+ NOEX_BASIC = 0x08,
+ NOEX_UNDEF = NOEX_NOSUPER,
+ NOEX_MODFUNC = 0x12,
+ NOEX_SUPER = 0x20,
+ NOEX_VCALL = 0x40,
+ NOEX_RESPONDS = 0x80,
+
+ NOEX_BIT_WIDTH = 8,
+ NOEX_SAFE_SHIFT_OFFSET = ((NOEX_BIT_WIDTH+3)/4)*4 /* round up to nibble */
+} rb_method_flag_t;
+
+#define NOEX_SAFE(n) ((int)((n) >> NOEX_SAFE_SHIFT_OFFSET) & 0x0F)
+#define NOEX_WITH(n, s) (((s) << NOEX_SAFE_SHIFT_OFFSET) | (n) | (ruby_running ? 0 : NOEX_BASIC))
+#define NOEX_WITH_SAFE(n) NOEX_WITH((n), rb_safe_level())
/* method data type */
-typedef struct rb_method_entry_struct {
- VALUE flags;
- const VALUE defined_class;
- struct rb_method_definition_struct * const def;
- ID called_id;
- const VALUE owner;
-} rb_method_entry_t;
-
-typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_entry_t */
- VALUE flags;
- const VALUE defined_class;
- struct rb_method_definition_struct * const def;
- ID called_id;
- const VALUE owner;
-} rb_callable_method_entry_t;
-
-#define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0))
-#define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2))
-#define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3)
-#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags = (me)->flags | IMEMO_FL_USER3)
-
-static inline void
-METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi)
-{
- VM_ASSERT((int)visi >= 0 && visi <= 3);
- me->flags = (me->flags & ~(IMEMO_FL_USER0 | IMEMO_FL_USER1)) | (visi << (IMEMO_FL_USHIFT+0));
-}
-static inline void
-METHOD_ENTRY_BASIC_SET(rb_method_entry_t *me, unsigned int basic)
-{
- VM_ASSERT(basic <= 1);
- me->flags = (me->flags & ~(IMEMO_FL_USER2 )) | (basic << (IMEMO_FL_USHIFT+2));
-}
-static inline void
-METHOD_ENTRY_FLAGS_SET(rb_method_entry_t *me, rb_method_visibility_t visi, unsigned int basic)
-{
- VM_ASSERT((int)visi >= 0 && visi <= 3);
- VM_ASSERT(basic <= 1);
- me->flags =
- (me->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) |
- ((visi << (IMEMO_FL_USHIFT+0)) | (basic << (IMEMO_FL_USHIFT+2)));
-}
-static inline void
-METHOD_ENTRY_FLAGS_COPY(rb_method_entry_t *dst, const rb_method_entry_t *src)
-{
- dst->flags =
- (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) |
- (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2));
-}
-
typedef enum {
- VM_METHOD_TYPE_ISEQ, /*!< Ruby method */
- VM_METHOD_TYPE_CFUNC, /*!< C method */
- VM_METHOD_TYPE_ATTRSET, /*!< attr_writer or attr_accessor */
- VM_METHOD_TYPE_IVAR, /*!< attr_reader or attr_accessor */
+ VM_METHOD_TYPE_ISEQ,
+ VM_METHOD_TYPE_CFUNC,
+ VM_METHOD_TYPE_ATTRSET,
+ VM_METHOD_TYPE_IVAR,
VM_METHOD_TYPE_BMETHOD,
VM_METHOD_TYPE_ZSUPER,
- VM_METHOD_TYPE_ALIAS,
VM_METHOD_TYPE_UNDEF,
VM_METHOD_TYPE_NOTIMPLEMENTED,
- VM_METHOD_TYPE_OPTIMIZED, /*!< Kernel#send, Proc#call, etc */
- VM_METHOD_TYPE_MISSING, /*!< wrapper for method_missing(id) */
- VM_METHOD_TYPE_REFINED, /*!< refinement */
+ VM_METHOD_TYPE_OPTIMIZED, /* Kernel#send, Proc#call, etc */
+ VM_METHOD_TYPE_MISSING, /* wrapper for method_missing(id) */
+ VM_METHOD_TYPE_REFINED,
END_OF_ENUMERATION(VM_METHOD_TYPE)
} rb_method_type_t;
-#ifndef rb_iseq_t
-typedef struct rb_iseq_struct rb_iseq_t;
-#define rb_iseq_t rb_iseq_t
-#endif
-
-typedef struct rb_method_iseq_struct {
- const rb_iseq_t * const iseqptr; /*!< iseq pointer, should be separated from iseqval */
- rb_cref_t * const cref; /*!< class reference, should be marked */
-} rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
+struct rb_call_info_struct;
typedef struct rb_method_cfunc_struct {
VALUE (*func)(ANYARGS);
@@ -133,86 +70,72 @@ typedef struct rb_method_cfunc_struct {
typedef struct rb_method_attr_struct {
ID id;
- const VALUE location; /* should be marked */
+ const VALUE location;
} rb_method_attr_t;
-typedef struct rb_method_alias_struct {
- const struct rb_method_entry_struct * const original_me; /* original_me->klass is original owner */
-} rb_method_alias_t;
-
-typedef struct rb_method_refined_struct {
- const struct rb_method_entry_struct * const orig_me;
- const VALUE owner;
-} rb_method_refined_t;
-
-enum method_optimized_type {
- OPTIMIZED_METHOD_TYPE_SEND,
- OPTIMIZED_METHOD_TYPE_CALL,
- OPTIMIZED_METHOD_TYPE__MAX
-};
-
-PACKED_STRUCT_UNALIGNED(struct rb_method_definition_struct {
- unsigned int type : 4; /* method type */
- int alias_count : 28;
- int complemented_count : 28;
+typedef struct rb_iseq_struct rb_iseq_t;
+typedef struct rb_method_definition_struct {
+ rb_method_type_t type; /* method type */
+ int alias_count;
+ ID original_id;
union {
- rb_method_iseq_t iseq;
+ rb_iseq_t * const iseq; /* should be mark */
rb_method_cfunc_t cfunc;
rb_method_attr_t attr;
- rb_method_alias_t alias;
- rb_method_refined_t refined;
-
- const VALUE proc; /* should be marked */
- enum method_optimized_type optimize_type;
+ const VALUE proc; /* should be mark */
+ enum method_optimized_type {
+ OPTIMIZED_METHOD_TYPE_SEND,
+ OPTIMIZED_METHOD_TYPE_CALL,
+
+ OPTIMIZED_METHOD_TYPE__MAX
+ } optimize_type;
+ struct rb_method_entry_struct *orig_me;
} body;
+} rb_method_definition_t;
- ID original_id;
-});
+typedef struct rb_method_entry_struct {
+ rb_method_flag_t flag;
+ char mark;
+ rb_method_definition_t *def;
+ ID called_id;
+ VALUE klass; /* should be mark */
+} rb_method_entry_t;
-typedef struct rb_method_definition_struct rb_method_definition_t;
+struct unlinked_method_entry_list_entry {
+ struct unlinked_method_entry_list_entry *next;
+ rb_method_entry_t *me;
+};
#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
-#define UNDEFINED_REFINED_METHOD_P(def) \
- ((def)->type == VM_METHOD_TYPE_REFINED && \
- UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me))
-void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi);
-void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi);
+void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
+rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
+rb_method_entry_t *rb_method_entry(VALUE klass, ID id, VALUE *define_class_ptr);
+rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
void rb_add_refined_method_entry(VALUE refined_class, ID mid);
+rb_method_entry_t *rb_resolve_refined_method(VALUE refinements,
+ const rb_method_entry_t *me,
+ VALUE *defined_class_ptr);
+rb_method_entry_t *rb_method_entry_with_refinements(VALUE klass, ID id,
+ VALUE *defined_class_ptr);
+rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id,
+ VALUE *defined_class_ptr);
-rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
-rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex);
-rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def);
-
-const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
-
-const rb_method_entry_t *rb_method_entry(VALUE klass, ID id);
-const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class);
-const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me);
-RUBY_SYMBOL_EXPORT_BEGIN
-const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[5]);
-RUBY_SYMBOL_EXPORT_END
-
-const rb_callable_method_entry_t *rb_callable_method_entry(VALUE klass, ID id);
-const rb_callable_method_entry_t *rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class);
-const rb_callable_method_entry_t *rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class);
+rb_method_entry_t *rb_method_entry_get_without_cache(VALUE klass, ID id, VALUE *define_class_ptr);
+rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex);
int rb_method_entry_arity(const rb_method_entry_t *me);
int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2);
st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me);
-VALUE rb_method_entry_location(const rb_method_entry_t *me);
+VALUE rb_method_entry_location(rb_method_entry_t *me);
VALUE rb_mod_method_location(VALUE mod, ID id);
VALUE rb_obj_method_location(VALUE obj, ID id);
-void rb_free_method_entry(const rb_method_entry_t *me);
+void rb_mark_method_entry(const rb_method_entry_t *me);
+void rb_free_method_entry(rb_method_entry_t *me);
void rb_sweep_method_entry(void *vm);
+void rb_free_m_tbl_wrapper(struct method_table_wrapper *wrapper);
-const rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me);
-const rb_callable_method_entry_t *rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class);
-void rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src);
-
-void rb_scope_visibility_set(rb_method_visibility_t);
-
-#endif /* RUBY_METHOD_H */
+#endif /* METHOD_H */
diff --git a/miniinit.c b/miniinit.c
index 7284e2e62d..bc6138a774 100644
--- a/miniinit.c
+++ b/miniinit.c
@@ -20,14 +20,7 @@ const char ruby_initial_load_paths[] = "";
VALUE
rb_locale_charmap(VALUE klass)
{
- /* never used */
- return Qnil;
-}
-
-int
-rb_locale_charmap_index(void)
-{
- return -1;
+ return rb_usascii_str_new2("ASCII-8BIT");
}
int
@@ -35,15 +28,3 @@ Init_enc_set_filesystem_encoding(void)
{
return rb_enc_to_index(rb_default_external_encoding());
}
-
-void rb_encdb_declare(const char *name);
-int rb_encdb_alias(const char *alias, const char *orig);
-void
-Init_enc(void)
-{
- rb_encdb_declare("ASCII-8BIT");
- rb_encdb_declare("US-ASCII");
- rb_encdb_declare("UTF-8");
- rb_encdb_alias("BINARY", "ASCII-8BIT");
- rb_encdb_alias("ASCII", "US-ASCII");
-}
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
deleted file mode 100755
index e954d1be00..0000000000
--- a/misc/lldb_cruby.py
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/env python
-#coding: utf-8
-#
-# Usage: run `command script import -r misc/lldb_cruby.py` on LLDB
-#
-# Test: misc/test_lldb_cruby.rb
-#
-
-import lldb
-import commands
-import os
-import shlex
-
-def lldb_init(debugger):
- target = debugger.GetSelectedTarget()
- global SIZEOF_VALUE
- SIZEOF_VALUE = target.FindFirstType("VALUE").GetByteSize()
-
- value_types = []
- g = globals()
- for enum in target.FindFirstGlobalVariable('ruby_dummy_gdb_enums'):
- enum = enum.GetType()
- members = enum.GetEnumMembers()
- for i in xrange(0, members.GetSize()):
- member = members.GetTypeEnumMemberAtIndex(i)
- name = member.GetName()
- value = member.GetValueAsUnsigned()
- g[name] = value
-
- if name.startswith('RUBY_T_'):
- value_types.append(name)
- g['value_types'] = value_types
-
-def string2cstr(rstring):
- """Returns the pointer to the C-string in the given String object"""
- flags = rstring.GetValueForExpressionPath(".basic->flags").unsigned
- if flags & RUBY_T_MASK != RUBY_T_STRING:
- raise TypeError("not a string")
- if flags & RUBY_FL_USER1:
- cptr = int(rstring.GetValueForExpressionPath(".as.heap.ptr").value, 0)
- clen = int(rstring.GetValueForExpressionPath(".as.heap.len").value, 0)
- else:
- cptr = int(rstring.GetValueForExpressionPath(".as.ary").value, 0)
- clen = (flags & RSTRING_EMBED_LEN_MASK) >> RSTRING_EMBED_LEN_SHIFT
- return cptr, clen
-
-def output_string(ctx, rstring):
- cptr, clen = string2cstr(rstring)
- expr = 'printf("%%.*s", (size_t)%d, (const char*)%d)' % (clen, cptr)
- ctx.frame.EvaluateExpression(expr)
-
-def fixnum_p(x):
- return x & RUBY_FIXNUM_FLAG != 0
-
-def flonum_p(x):
- return (x&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
-
-def lldb_rp(debugger, command, result, internal_dict):
- target = debugger.GetSelectedTarget()
- process = target.GetProcess()
- thread = process.GetSelectedThread()
- frame = thread.GetSelectedFrame()
- if frame.IsValid():
- val = frame.EvaluateExpression(command)
- else:
- val = target.EvaluateExpression(command)
- error = val.GetError()
- if error.Fail():
- print >> result, error
- return
- num = val.GetValueAsSigned()
- if num == RUBY_Qfalse:
- print >> result, 'false'
- elif num == RUBY_Qtrue:
- print >> result, 'true'
- elif num == RUBY_Qnil:
- print >> result, 'nil'
- elif num == RUBY_Qundef:
- print >> result, 'undef'
- elif fixnum_p(num):
- print >> result, num >> 1
- elif flonum_p(num):
- debugger.HandleCommand("print rb_float_value(%0#x)" % val.GetValueAsUnsigned())
- elif num & RUBY_IMMEDIATE_MASK:
- print >> result, 'immediate(%x)' % num
- else:
- tRBasic = target.FindFirstType("struct RBasic").GetPointerType()
- val = val.Cast(tRBasic)
- flags = val.GetValueForExpressionPath("->flags").GetValueAsUnsigned()
- if (flags & RUBY_FL_PROMOTED) == RUBY_FL_PROMOTED:
- print >> result, "[PROMOTED] "
- flType = flags & RUBY_T_MASK
- if flType == RUBY_T_NONE:
- print >> result, 'T_NONE: %s' % val.Dereference()
- elif flType == RUBY_T_NIL:
- print >> result, 'T_NIL: %s' % val.Dereference()
- elif flType == RUBY_T_OBJECT:
- tRObject = target.FindFirstType("struct RObject").GetPointerType()
- val = val.Cast(tRObject)
- print >> result, 'T_OBJECT: %s' % val.Dereference()
- elif flType == RUBY_T_STRING:
- tRString = target.FindFirstType("struct RString").GetPointerType()
- val = val.Cast(tRString)
- if flags & RSTRING_NOEMBED:
- print >> result, val.GetValueForExpressionPath("->as.heap")
- else:
- print >> result, val.GetValueForExpressionPath("->as.ary")
- elif flType == RUBY_T_ARRAY:
- tRArray = target.FindFirstType("struct RArray").GetPointerType()
- val = val.Cast(tRArray)
- if flags & RUBY_FL_USER1:
- len = ((flags & (RUBY_FL_USER3|RUBY_FL_USER4)) >> (RUBY_FL_USHIFT+3))
- print >> result, "T_ARRAY: len=%d (embed)" % len
- if len == 0:
- print >> result, "{(empty)}"
- else:
- print >> result, val.GetValueForExpressionPath("->as.ary")
- else:
- len = val.GetValueForExpressionPath("->as.heap.len").GetValueAsSigned()
- print >> result, "T_ARRAY: len=%d " % len
- #print >> result, val.GetValueForExpressionPath("->as.heap")
- if flags & RUBY_FL_USER2:
- shared = val.GetValueForExpressionPath("->as.heap.aux.shared").GetValueAsUnsigned()
- print >> result, "(shared) shared=%016x " % shared
- else:
- capa = val.GetValueForExpressionPath("->as.heap.aux.capa").GetValueAsSigned()
- print >> result, "(ownership) capa=%d " % capa
- if len == 0:
- print >> result, "{(empty)}"
- else:
- debugger.HandleCommand("expression -Z %d -fx -- (const VALUE*)((struct RArray*)%d)->as.heap.ptr" % (len, val.GetValueAsUnsigned()))
- debugger.HandleCommand("p (struct RArray *) %0#x" % val.GetValueAsUnsigned())
-
-def count_objects(debugger, command, ctx, result, internal_dict):
- objspace = ctx.frame.EvaluateExpression("ruby_current_vm->objspace")
- num_pages = objspace.GetValueForExpressionPath(".heap_pages.allocated_pages").unsigned
-
- counts = {}
- total = 0
- for t in range(0x00, RUBY_T_MASK+1):
- counts[t] = 0
-
- for i in range(0, num_pages):
- print "\rcounting... %d/%d" % (i, num_pages),
- page = objspace.GetValueForExpressionPath('.heap_pages.sorted[%d]' % i)
- p = page.GetChildMemberWithName('start')
- num_slots = page.GetChildMemberWithName('total_slots').unsigned
- for j in range(0, num_slots):
- obj = p.GetValueForExpressionPath('[%d]' % j)
- flags = obj.GetValueForExpressionPath('.as.basic.flags').unsigned
- obj_type = flags & RUBY_T_MASK
- counts[obj_type] += 1
- total += num_slots
-
- print "\rTOTAL: %d, FREE: %d" % (total, counts[0x00])
- for sym in value_types:
- print "%s: %d" % (sym, counts[globals()[sym]])
-
-def stack_dump_raw(debugger, command, ctx, result, internal_dict):
- ctx.frame.EvaluateExpression("rb_vmdebug_stack_dump_raw_current()")
-
-def dump_node(debugger, command, ctx, result, internal_dict):
- args = shlex.split(command)
- if not args:
- return
- node = args[0]
-
- dump = ctx.frame.EvaluateExpression("(struct RString*)rb_parser_dump_tree((NODE*)(%s), 0)" % node)
- output_string(ctx, dump)
-
-def __lldb_init_module(debugger, internal_dict):
- debugger.HandleCommand("command script add -f lldb_cruby.lldb_rp rp")
- debugger.HandleCommand("command script add -f lldb_cruby.count_objects rb_count_objects")
- debugger.HandleCommand("command script add -f lldb_cruby.stack_dump_raw SDR")
- debugger.HandleCommand("command script add -f lldb_cruby.dump_node dump_node")
- lldb_init(debugger)
- print "lldb scripts for ruby has been installed."
diff --git a/misc/ruby-additional.el b/misc/ruby-additional.el
index 432adfedb6..b77b5260d0 100644
--- a/misc/ruby-additional.el
+++ b/misc/ruby-additional.el
@@ -1,7 +1,7 @@
;;; ruby-additional.el --- ruby-mode extensions yet to be merged into Emacs
;; Authors: Yukihiro Matsumoto, Nobuyoshi Nakada, Akinori MUSHA
-;; URL: https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/
+;; URL: http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/
;; Created: 3 Sep 2012
;; Package-Requires: ((emacs "24.3") (ruby-mode "1.2"))
;; Keywords: ruby, languages
@@ -106,7 +106,7 @@ Emacs to Ruby."
(t (when ruby-insert-encoding-magic-comment
(insert "# -*- coding: " coding-system " -*-\n"))))))))
- (define-key ruby-mode-map "\C-cU" 'ruby-encode-decode-unicode)
+ (define-key ruby-mode-map "\C-cU" 'ruby-encode-unicode)
(defun ruby-encode-unicode (beg end)
"Convert non-ascii string in the given region to \\u{} form."
@@ -114,68 +114,13 @@ Emacs to Ruby."
(setq end (set-marker (make-marker) end))
(goto-char beg)
(while (and (< (point) end)
- (re-search-forward "\\([\C-@-\C-I\C-K\C-_\C-?]+\\)\\|[^\C-@-\C-?]+" end t))
- (let ((str (match-string-no-properties 0)) sep b e f)
- (if (match-beginning 1)
- (setq b "" e "" sep ""
- f (lambda (c)
- (cond ((= c ?\t) "\\t")
- ((= c ?\r) "\\r")
- ((= c ?\e) "\\e")
- ((= c ?\f) "\\f")
- ((= c ?\b) "\\b")
- ((= c ?\v) "\\v")
- ((= c ?\C-?) "\\c?")
- ((concat "\\c" (char-to-string (logior c #x40)))))))
- (setq b "\\u{" e "}" sep " " f (lambda (c) (format "%x" c))))
- (setq str (mapconcat f str sep))
+ (re-search-forward "\\Ca+" end t))
+ (let ((u (mapconcat (lambda (c) (format "%x" c)) (match-string-no-properties 0) " ")))
(delete-region (match-beginning 0) (match-end 0))
- (insert b str e))))
-
- (defun ruby-decode-unicode (beg end)
- "Convert escaped Unicode in the given region to raw string."
- (interactive "r")
- (setq end (set-marker (make-marker) end))
- (goto-char beg)
- (while (and (< (point) end)
- (re-search-forward "\\\\u\\([0-9a-fA-F]\\{4\\}\\)\\|\\\\u{\\([0-9a-fA-F \t]+\\)}" end t))
- (let ((b (match-beginning 0)) (e (match-end 0))
- (s (match-string-no-properties 1)))
- (if s
- (setq s (cons s nil))
- (goto-char (match-beginning 2))
- (while (looking-at "[ \t]*\\([0-9a-fA-F]+\\)")
- (setq s (cons (match-string-no-properties 1) s))
- (goto-char (match-end 0))))
- (setq s (mapconcat (lambda (c) (format "%c" (string-to-int c 16)))
- (nreverse s) ""))
- (delete-region b e)
- (insert s))
+ (insert "\\u{" u "}"))
))
-
- (defun ruby-encode-decode-unicode (dec beg end)
- "Convert Unicode <-> \\u{} in the given region."
- (interactive "P\nr")
- (if dec (ruby-decode-unicode beg end) (ruby-encode-unicode beg end)))
-
- (defun ruby-insert-heredoc-code-block (arg)
- "Insert indented here document code block"
- (interactive "P")
- (let ((c (if arg "~" "-")))
- (insert "\"#{<<" c "\"{#\"}\\n#{<<" c "'};'}\""))
- (end-of-line)
- (if (eobp) (insert "\n") (forward-char))
- (indent-region (point)
- (progn (insert "{#\n" "};\n") (point)))
- (beginning-of-line 0))
- (define-key ruby-mode-map "\C-cH" 'ruby-insert-heredoc-code-block)
))
-;; monkey-patching ruby-mode.el in Emacs 24, as r49872.
-(when (and (boundp 'ruby-syntax-before-regexp-re)
- (not (string-match ruby-syntax-before-regexp-re "foo {|" 1)))
- (replace-regexp-in-string "\\[\\[" "\\&{|" ruby-syntax-before-regexp-re))
-
(provide 'ruby-additional)
;;; ruby-additional.el ends here
diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el
index 61e84d2adb..b8897e7163 100644
--- a/misc/ruby-electric.el
+++ b/misc/ruby-electric.el
@@ -10,7 +10,7 @@
;; URL: https://github.com/knu/ruby-electric.el
;; Keywords: languages ruby
;; License: The same license terms as Ruby
-;; Version: 2.3.1
+;; Version: 2.1.1
;;; Commentary:
;;
@@ -33,9 +33,6 @@
(require 'ruby-mode)
-(eval-when-compile
- (require 'cl))
-
(defgroup ruby-electric nil
"Minor mode providing electric editing commands for ruby files"
:group 'ruby)
@@ -164,14 +161,17 @@ cons, ACTION can be set to one of the following values:
"$"))))
:group 'ruby-electric)
+(defcustom ruby-electric-simple-keywords-re nil
+ "Obsolete and ignored. Customize `ruby-electric-keywords-alist'
+instead."
+ :type 'regexp :group 'ruby-electric)
+
(defvar ruby-electric-mode-map
(let ((map (make-sparse-keymap)))
(define-key map " " 'ruby-electric-space/return)
(define-key map [remap delete-backward-char] 'ruby-electric-delete-backward-char)
(define-key map [remap newline] 'ruby-electric-space/return)
(define-key map [remap newline-and-indent] 'ruby-electric-space/return)
- (define-key map [remap electric-newline-and-maybe-indent] 'ruby-electric-space/return)
- (define-key map [remap reindent-then-newline-and-indent] 'ruby-electric-space/return)
(dolist (x ruby-electric-delimiters-alist)
(let* ((delim (car x))
(plist (cdr x))
@@ -247,11 +247,8 @@ enabled."
(interactive "*P")
(and (boundp 'sp-last-operation)
(setq sp-delayed-pair nil))
- (cond ((or arg
- (region-active-p))
- (or (= last-command-event ?\s)
- (setq last-command-event ?\n))
- (ruby-electric-replace-region-or-insert))
+ (cond (arg
+ (insert (make-string (prefix-numeric-value arg) last-command-event)))
((ruby-electric-space/return-can-be-expanded-p)
(let (action)
(save-excursion
@@ -273,7 +270,7 @@ enabled."
(ruby-indent-line)
(save-excursion
(newline)
- (ruby-electric-end)))
+ (ruby-insert-end)))
((eq action 'reindent)
(ruby-indent-line)))
(ruby-electric-space/return-fallback)))
@@ -283,53 +280,19 @@ enabled."
(t
(ruby-electric-space/return-fallback))))
-(defun ruby-electric--get-faces-at-point ()
- (let* ((point (point))
- (value (or
- (get-text-property point 'read-face-name)
- (get-text-property point 'face))))
- (if (listp value) value (list value))))
+(defun ruby-electric-code-at-point-p()
+ (and ruby-electric-mode
+ (let* ((properties (text-properties-at (point))))
+ (and (null (memq 'font-lock-string-face properties))
+ (null (memq 'font-lock-comment-face properties))))))
+
+(defun ruby-electric-string-at-point-p()
+ (and ruby-electric-mode
+ (consp (memq 'font-lock-string-face (text-properties-at (point))))))
-(defun ruby-electric--faces-include-p (pfaces &rest faces)
+(defun ruby-electric-comment-at-point-p()
(and ruby-electric-mode
- (loop for face in faces
- thereis (memq face pfaces))))
-
-(defun ruby-electric--faces-at-point-include-p (&rest faces)
- (apply 'ruby-electric--faces-include-p
- (ruby-electric--get-faces-at-point)
- faces))
-
-(defun ruby-electric-code-face-p (faces)
- (not (ruby-electric--faces-include-p
- faces
- 'font-lock-string-face
- 'font-lock-comment-face
- 'enh-ruby-string-delimiter-face
- 'enh-ruby-heredoc-delimiter-face
- 'enh-ruby-regexp-delimiter-face
- 'enh-ruby-regexp-face)))
-
-(defun ruby-electric-code-at-point-p ()
- (ruby-electric-code-face-p
- (ruby-electric--get-faces-at-point)))
-
-(defun ruby-electric-string-face-p (faces)
- (ruby-electric--faces-include-p
- faces
- 'font-lock-string-face
- 'enh-ruby-string-delimiter-face
- 'enh-ruby-heredoc-delimiter-face
- 'enh-ruby-regexp-delimiter-face
- 'enh-ruby-regexp-face))
-
-(defun ruby-electric-string-at-point-p ()
- (ruby-electric-string-face-p
- (ruby-electric--get-faces-at-point)))
-
-(defun ruby-electric-comment-at-point-p ()
- (ruby-electric--faces-at-point-include-p
- 'font-lock-comment-face))
+ (consp (memq 'font-lock-comment-face (text-properties-at (point))))))
(defun ruby-electric-escaped-p()
(let ((f nil))
@@ -347,189 +310,131 @@ enabled."
(and (ruby-electric-code-at-point-p)
(looking-back ruby-electric-expandable-keyword-re)))
-(defun ruby-electric-replace-region-or-insert ()
- (and (region-active-p)
- (bound-and-true-p delete-selection-mode)
- (fboundp 'delete-selection-helper)
- (delete-selection-helper (get 'self-insert-command 'delete-selection)))
- (insert (make-string (prefix-numeric-value current-prefix-arg)
- last-command-event))
- (setq this-command 'self-insert-command))
+(defun ruby-electric-cua-replace-region-maybe()
+ (let ((func (key-binding [remap self-insert-command])))
+ (when (memq func '(cua-replace-region
+ sp--cua-replace-region))
+ (setq this-original-command 'self-insert-command)
+ (funcall (setq this-command func))
+ t)))
(defmacro ruby-electric-insert (arg &rest body)
- `(cond ((and
+ `(cond ((ruby-electric-cua-replace-region-maybe))
+ ((and
(null ,arg)
(ruby-electric-command-char-expandable-punct-p last-command-event))
- (let ((region-beginning
- (cond ((region-active-p)
- (prog1
- (save-excursion
- (goto-char (region-beginning))
- (insert last-command-event)
- (point))
- (goto-char (region-end))))
- (t
- (insert last-command-event)
- nil)))
- (faces-at-point
- (ruby-electric--get-faces-at-point)))
- ,@body
- (and region-beginning
- ;; If no extra character is inserted, go back to the
- ;; region beginning.
- (eq this-command 'self-insert-command)
- (goto-char region-beginning))))
- ((ruby-electric-replace-region-or-insert))))
-
-(defun ruby-electric-curlies (arg)
+ (insert last-command-event)
+ ,@body)
+ (t
+ (setq this-command 'self-insert-command)
+ (insert (make-string (prefix-numeric-value ,arg) last-command-event)))))
+
+(defun ruby-electric-curlies(arg)
(interactive "*P")
(ruby-electric-insert
arg
(cond
- ((or (ruby-electric-code-at-point-p)
- (ruby-electric--faces-include-p
- faces-at-point
- 'enh-ruby-string-delimiter-face
- 'enh-ruby-regexp-delimiter-face))
- (save-excursion
- (insert "}")
- (font-lock-fontify-region (line-beginning-position) (point)))
+ ((ruby-electric-code-at-point-p)
+ (insert "}")
+ (backward-char 1)
+ (redisplay)
(cond
- ((or (ruby-electric-string-at-point-p) ;; %w{}, %r{}, etc.
- (looking-back "%[QqWwRrxIis]{"))
- (if region-beginning
- (forward-char 1)))
+ ((ruby-electric-string-at-point-p) ;; %w{}, %r{}, etc.
+ t)
(ruby-electric-newline-before-closing-bracket
- (cond (region-beginning
- (save-excursion
- (goto-char region-beginning)
- (newline))
- (newline)
- (forward-char 1)
- (indent-region region-beginning (line-end-position)))
- (t
- (insert " ")
- (save-excursion
- (newline)
- (ruby-indent-line t)))))
- (t
- (if region-beginning
- (save-excursion
- (goto-char region-beginning)
- (insert " "))
- (insert " "))
(insert " ")
- (backward-char 1)
- (and region-beginning
- (forward-char 1)))))
+ (save-excursion
+ (newline)
+ (ruby-indent-line t)))
+ (t
+ (insert " ")
+ (backward-char 1))))
((ruby-electric-string-at-point-p)
- (let ((start-position (1- (or region-beginning (point)))))
+ (save-excursion
+ (backward-char 1)
(cond
- ((char-equal ?\# (char-before start-position))
+ ((char-equal ?\# (preceding-char))
(unless (save-excursion
- (goto-char (1- start-position))
+ (backward-char 1)
(ruby-electric-escaped-p))
- (insert "}")
- (or region-beginning
- (backward-char 1))))
+ (forward-char 1)
+ (insert "}")))
((or
(ruby-electric-command-char-expandable-punct-p ?\#)
- (save-excursion
- (goto-char start-position)
- (ruby-electric-escaped-p)))
- (if region-beginning
- (goto-char region-beginning))
+ (ruby-electric-escaped-p))
(setq this-command 'self-insert-command))
(t
- (save-excursion
- (goto-char start-position)
- (insert "#"))
- (insert "}")
- (or region-beginning
- (backward-char 1))))))
+ (insert "#")
+ (forward-char 1)
+ (insert "}")))))
(t
- (delete-char -1)
- (ruby-electric-replace-region-or-insert)))))
+ (setq this-command 'self-insert-command)))))
-(defun ruby-electric-hash (arg)
+(defun ruby-electric-hash(arg)
(interactive "*P")
(ruby-electric-insert
arg
- (if (ruby-electric-string-at-point-p)
- (let ((start-position (1- (or region-beginning (point)))))
- (cond
- ((char-equal (following-char) ?')) ;; likely to be in ''
- ((save-excursion
- (goto-char start-position)
- (ruby-electric-escaped-p)))
- (region-beginning
- (save-excursion
- (goto-char (1+ start-position))
- (insert "{"))
- (insert "}"))
- (t
- (insert "{")
- (save-excursion
- (insert "}")))))
- (delete-char -1)
- (ruby-electric-replace-region-or-insert))))
-
-(defun ruby-electric-matching-char (arg)
+ (and (ruby-electric-string-at-point-p)
+ (or (char-equal (following-char) ?') ;; likely to be in ''
+ (save-excursion
+ (backward-char 1)
+ (ruby-electric-escaped-p))
+ (progn
+ (insert "{}")
+ (backward-char 1))))))
+
+(defmacro ruby-electric-avoid-eob(&rest body)
+ `(if (eobp)
+ (save-excursion
+ (insert "\n")
+ (backward-char)
+ ,@body
+ (prog1
+ (ruby-electric-string-at-point-p)
+ (delete-char 1)))
+ ,@body))
+
+(defun ruby-electric-matching-char(arg)
(interactive "*P")
(ruby-electric-insert
arg
(let ((closing (cdr (assoc last-command-event
ruby-electric-matching-delimeter-alist))))
(cond
- ;; quotes
((char-equal closing last-command-event)
- (cond ((not (ruby-electric-string-face-p faces-at-point))
- (if region-beginning
- ;; escape quotes of the same kind, backslash and hash
- (let ((re (format "[%c\\%s]"
- last-command-event
- (if (char-equal last-command-event ?\")
- "#" "")))
- (bound (point)))
- (save-excursion
- (goto-char region-beginning)
- (while (re-search-forward re bound t)
- (let ((end (point)))
- (replace-match "\\\\\\&")
- (setq bound (+ bound (- (point) end))))))))
- (insert closing)
- (or region-beginning
- (backward-char 1)))
- (t
- (and (eq last-command 'ruby-electric-matching-char)
- (char-equal (following-char) closing) ;; repeated quotes
- (delete-char 1))
- (setq this-command 'self-insert-command))))
+ (if (and (not (ruby-electric-string-at-point-p))
+ (ruby-electric-avoid-eob
+ (redisplay)
+ (ruby-electric-string-at-point-p)))
+ (save-excursion (insert closing))
+ (and (eq last-command 'ruby-electric-matching-char)
+ (char-equal (following-char) closing) ;; repeated quotes
+ (delete-forward-char 1))
+ (setq this-command 'self-insert-command)))
((ruby-electric-code-at-point-p)
- (insert closing)
- (or region-beginning
- (backward-char 1)))))))
+ (save-excursion (insert closing)))))))
(defun ruby-electric-closing-char(arg)
(interactive "*P")
(cond
+ ((ruby-electric-cua-replace-region-maybe))
(arg
- (ruby-electric-replace-region-or-insert))
+ (setq this-command 'self-insert-command)
+ (insert (make-string (prefix-numeric-value arg) last-command-event)))
((and
(eq last-command 'ruby-electric-curlies)
- (= last-command-event ?})
- (not (char-equal (preceding-char) last-command-event))) ;; {}
+ (= last-command-event ?})) ;; {}
(if (char-equal (following-char) ?\n) (delete-char 1))
(delete-horizontal-space)
(forward-char))
((and
(= last-command-event (following-char))
- (not (char-equal (preceding-char) last-command-event))
(memq last-command '(ruby-electric-matching-char
ruby-electric-closing-char))) ;; ()/[] and (())/[[]]
(forward-char))
(t
- (ruby-electric-replace-region-or-insert)
+ (setq this-command 'self-insert-command)
+ (self-insert-command 1)
(if ruby-electric-autoindent-on-closing-char
(ruby-indent-line)))))
@@ -541,8 +446,7 @@ enabled."
(looking-back ruby-electric-expandable-bar-re))
(save-excursion (insert "|")))
(t
- (delete-char -1)
- (ruby-electric-replace-region-or-insert)))))
+ (setq this-command 'self-insert-command)))))
(defun ruby-electric-delete-backward-char(arg)
(interactive "*p")
@@ -566,18 +470,6 @@ enabled."
(delete-char 1))))
(delete-char (- arg)))
-(put 'ruby-electric-delete-backward-char 'delete-selection 'supersede)
-
-(defun ruby-electric-end ()
- (interactive)
- (if (eq (char-syntax (preceding-char)) ?w)
- (insert " "))
- (insert "end")
- (save-excursion
- (if (eq (char-syntax (following-char)) ?w)
- (insert " "))
- (ruby-indent-line t)))
-
(provide 'ruby-electric)
;;; ruby-electric.el ends here
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index b1abd18a9e..553591f3c9 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -107,7 +107,7 @@
(defconst ruby-block-end-re "\\_<end\\_>")
(defconst ruby-here-doc-beg-re
- "\\(<\\)<\\([-~]\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
+ "\\(<\\)<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
(defconst ruby-here-doc-end-re
"^\\([ \t]+\\)?\\(.*\\)\\(.\\)$")
@@ -127,9 +127,9 @@
(concat "<<"
(let ((match (match-string 1)))
(if (and match (> (length match) 0))
- (concat "\\(?:[-~]\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
+ (concat "\\(?:-\\([\"']?\\)\\|\\([\"']\\)" (match-string 1) "\\)"
contents "\\(\\1\\|\\2\\)")
- (concat "[-~]?\\([\"']\\|\\)" contents "\\1"))))))
+ (concat "-?\\([\"']\\|\\)" contents "\\1"))))))
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\_<\\("
@@ -679,7 +679,7 @@ Emacs to Ruby."
((looking-at "<<")
(cond
((and (ruby-expr-beg 'heredoc)
- (looking-at "<<\\([-~]\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
+ (looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))
@@ -898,7 +898,7 @@ Emacs to Ruby."
(goto-char ruby-indent-point)
(beginning-of-line)
(skip-syntax-forward " ")
- (if (looking-at "\\.[^.]\\|&\\.")
+ (if (looking-at "\\.[^.]")
(+ indent ruby-indent-level)
indent))))
@@ -1304,7 +1304,7 @@ balanced expression is found."
;; ?' ?" ?` are ascii codes
("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil))
;; regexps
- ("\\(^\\|[[{|=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
+ ("\\(^\\|[[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
(4 (7 . ?/))
(6 (7 . ?/)))
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
diff --git a/misc/ruby-style.el b/misc/ruby-style.el
index b8593b202a..f81861afea 100644
--- a/misc/ruby-style.el
+++ b/misc/ruby-style.el
@@ -7,8 +7,6 @@
;;; $Author$
;;; created at: Thu Apr 26 13:54:01 JST 2007
;;;
-;;; Put this file under a directory contained in ``load-path'', and
-;;; then load it.
;;; To switch to the "ruby" style automatically if it looks like a
;;; source file of ruby, add ruby-style-c-mode to c-mode-hook:
;;;
diff --git a/misc/test_lldb_cruby.rb b/misc/test_lldb_cruby.rb
deleted file mode 100644
index 4d1cc499f5..0000000000
--- a/misc/test_lldb_cruby.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env ruby
-require 'open3'
-require 'tempfile'
-require 'test/unit'
-
-class TestLLDBInit < Test::Unit::TestCase
- def assert_rp(expr, pattern, message=nil)
- Tempfile.create('lldb') do |tf|
- tf.puts <<eom
-target create ./miniruby
-command script import -r misc/lldb_cruby.py
-b rb_p
-run -e'p #{expr}'
-rp obj
-eom
- tf.flush
- o, s = Open3.capture2('lldb', '-b', '-s', tf.path)
- assert_true s.success?, message
- assert_match /^\(lldb\) rp obj\n#{pattern}/, o, message
- end
- end
-
- def test_rp_object
- assert_rp 'Object.new', 'T_OBJECT'
- end
-
- def test_rp_symbol
- assert_rp ':abcde', /immediate\(\h+\)/
- end
-
- def test_rp_string
- assert_rp '"abc"', /\(char \[\d+\]\) ary = "abc"/
- assert_rp "\"\u3042\"", /\(char \[\d+\]\) ary = "\u3042"/
- assert_rp '"' + "\u3042"*10 + '"', /\(RString::\(anonymous struct\)\) heap = \{/
- end
-end
diff --git a/missing/crypt.c b/missing/crypt.c
index f523aa51e6..366fba0919 100644
--- a/missing/crypt.c
+++ b/missing/crypt.c
@@ -35,7 +35,6 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include "ruby/missing.h"
-#include "crypt.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -44,15 +43,10 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
#include <pwd.h>
#endif
#include <stdio.h>
-#include <string.h>
#ifndef _PASSWORD_EFMT1
#define _PASSWORD_EFMT1 '_'
#endif
-#ifndef numberof
-#define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
-#endif
-
/*
* UNIX password, and DES, encryption.
* By Tom Truscott, trt@rti.rti.org,
@@ -86,24 +80,179 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
#endif
#endif
-#ifndef INIT_DES
-# if defined DUMP || defined NO_DES_TABLES
-# define INIT_DES 1
-# else
-# define INIT_DES 0
-# endif
+/*
+ * define "LONG_IS_32_BITS" only if sizeof(long)==4.
+ * This avoids use of bit fields (your compiler may be sloppy with them).
+ */
+#if !defined(cray)
+#define LONG_IS_32_BITS
#endif
-#if !INIT_DES
-# include "des_tables.c"
-# ifdef HAVE_DES_TABLES
-# define init_des() ((void)0)
-# else
-# undef INIT_DES
-# define INIT_DES 1
-# endif
+
+/*
+ * define "B64" to be the declaration for a 64 bit integer.
+ * XXX this feature is currently unused, see "endian" comment below.
+ */
+#if defined(cray)
+#define B64 long
+#endif
+#if defined(convex)
+#define B64 long long
#endif
/*
+ * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes
+ * of lookup tables. This speeds up des_setkey() and des_cipher(), but has
+ * little effect on crypt().
+ */
+#if defined(notdef)
+#define LARGEDATA
+#endif
+
+int des_setkey(), des_cipher();
+
+/* compile with "-DSTATIC=int" when profiling */
+#ifndef STATIC
+#define STATIC static
+#endif
+STATIC void init_des(), init_perm(), permute();
+#ifdef DEBUG
+STATIC void prtab();
+#endif
+
+/* ==================================== */
+
+/*
+ * Cipher-block representation (Bob Baldwin):
+ *
+ * DES operates on groups of 64 bits, numbered 1..64 (sigh). One
+ * representation is to store one bit per byte in an array of bytes. Bit N of
+ * the NBS spec is stored as the LSB of the Nth byte (index N-1) in the array.
+ * Another representation stores the 64 bits in 8 bytes, with bits 1..8 in the
+ * first byte, 9..16 in the second, and so on. The DES spec apparently has
+ * bit 1 in the MSB of the first byte, but that is particularly noxious so we
+ * bit-reverse each byte so that bit 1 is the LSB of the first byte, bit 8 is
+ * the MSB of the first byte. Specifically, the 64-bit input data and key are
+ * converted to LSB format, and the output 64-bit block is converted back into
+ * MSB format.
+ *
+ * DES operates internally on groups of 32 bits which are expanded to 48 bits
+ * by permutation E and shrunk back to 32 bits by the S boxes. To speed up
+ * the computation, the expansion is applied only once, the expanded
+ * representation is maintained during the encryption, and a compression
+ * permutation is applied only at the end. To speed up the S-box lookups,
+ * the 48 bits are maintained as eight 6 bit groups, one per byte, which
+ * directly feed the eight S-boxes. Within each byte, the 6 bits are the
+ * most significant ones. The low two bits of each byte are zero. (Thus,
+ * bit 1 of the 48 bit E expansion is stored as the "4"-valued bit of the
+ * first byte in the eight byte representation, bit 2 of the 48 bit value is
+ * the "8"-valued bit, and so on.) In fact, a combined "SPE"-box lookup is
+ * used, in which the output is the 64 bit result of an S-box lookup which
+ * has been permuted by P and expanded by E, and is ready for use in the next
+ * iteration. Two 32-bit wide tables, SPE[0] and SPE[1], are used for this
+ * lookup. Since each byte in the 48 bit path is a multiple of four, indexed
+ * lookup of SPE[0] and SPE[1] is simple and fast. The key schedule and
+ * "salt" are also converted to this 8*(6+2) format. The SPE table size is
+ * 8*64*8 = 4K bytes.
+ *
+ * To speed up bit-parallel operations (such as XOR), the 8 byte
+ * representation is "union"ed with 32 bit values "i0" and "i1", and, on
+ * machines which support it, a 64 bit value "b64". This data structure,
+ * "C_block", has two problems. First, alignment restrictions must be
+ * honored. Second, the byte-order (e.g. little-endian or big-endian) of
+ * the architecture becomes visible.
+ *
+ * The byte-order problem is unfortunate, since on the one hand it is good
+ * to have a machine-independent C_block representation (bits 1..8 in the
+ * first byte, etc.), and on the other hand it is good for the LSB of the
+ * first byte to be the LSB of i0. We cannot have both these things, so we
+ * currently use the "little-endian" representation and avoid any multi-byte
+ * operations that depend on byte order. This largely precludes use of the
+ * 64-bit datatype since the relative order of i0 and i1 are unknown. It
+ * also inhibits grouping the SPE table to look up 12 bits at a time. (The
+ * 12 bits can be stored in a 16-bit field with 3 low-order zeroes and 1
+ * high-order zero, providing fast indexing into a 64-bit wide SPE.) On the
+ * other hand, 64-bit datatypes are currently rare, and a 12-bit SPE lookup
+ * requires a 128 kilobyte table, so perhaps this is not a big loss.
+ *
+ * Permutation representation (Jim Gillogly):
+ *
+ * A transformation is defined by its effect on each of the 8 bytes of the
+ * 64-bit input. For each byte we give a 64-bit output that has the bits in
+ * the input distributed appropriately. The transformation is then the OR
+ * of the 8 sets of 64-bits. This uses 8*256*8 = 16K bytes of storage for
+ * each transformation. Unless LARGEDATA is defined, however, a more compact
+ * table is used which looks up 16 4-bit "chunks" rather than 8 8-bit chunks.
+ * The smaller table uses 16*16*8 = 2K bytes for each transformation. This
+ * is slower but tolerable, particularly for password encryption in which
+ * the SPE transformation is iterated many times. The small tables total 9K
+ * bytes, the large tables total 72K bytes.
+ *
+ * The transformations used are:
+ * IE3264: MSB->LSB conversion, initial permutation, and expansion.
+ * This is done by collecting the 32 even-numbered bits and applying
+ * a 32->64 bit transformation, and then collecting the 32 odd-numbered
+ * bits and applying the same transformation. Since there are only
+ * 32 input bits, the IE3264 transformation table is half the size of
+ * the usual table.
+ * CF6464: Compression, final permutation, and LSB->MSB conversion.
+ * This is done by two trivial 48->32 bit compressions to obtain
+ * a 64-bit block (the bit numbering is given in the "CIFP" table)
+ * followed by a 64->64 bit "cleanup" transformation. (It would
+ * be possible to group the bits in the 64-bit block so that 2
+ * identical 32->32 bit transformations could be used instead,
+ * saving a factor of 4 in space and possibly 2 in time, but
+ * byte-ordering and other complications rear their ugly head.
+ * Similar opportunities/problems arise in the key schedule
+ * transforms.)
+ * PC1ROT: MSB->LSB, PC1 permutation, rotate, and PC2 permutation.
+ * This admittedly baroque 64->64 bit transformation is used to
+ * produce the first code (in 8*(6+2) format) of the key schedule.
+ * PC2ROT[0]: Inverse PC2 permutation, rotate, and PC2 permutation.
+ * It would be possible to define 15 more transformations, each
+ * with a different rotation, to generate the entire key schedule.
+ * To save space, however, we instead permute each code into the
+ * next by using a transformation that "undoes" the PC2 permutation,
+ * rotates the code, and then applies PC2. Unfortunately, PC2
+ * transforms 56 bits into 48 bits, dropping 8 bits, so PC2 is not
+ * invertible. We get around that problem by using a modified PC2
+ * which retains the 8 otherwise-lost bits in the unused low-order
+ * bits of each byte. The low-order bits are cleared when the
+ * codes are stored into the key schedule.
+ * PC2ROT[1]: Same as PC2ROT[0], but with two rotations.
+ * This is faster than applying PC2ROT[0] twice,
+ *
+ * The Bell Labs "salt" (Bob Baldwin):
+ *
+ * The salting is a simple permutation applied to the 48-bit result of E.
+ * Specifically, if bit i (1 <= i <= 24) of the salt is set then bits i and
+ * i+24 of the result are swapped. The salt is thus a 24 bit number, with
+ * 16777216 possible values. (The original salt was 12 bits and could not
+ * swap bits 13..24 with 36..48.)
+ *
+ * It is possible, but ugly, to warp the SPE table to account for the salt
+ * permutation. Fortunately, the conditional bit swapping requires only
+ * about four machine instructions and can be done on-the-fly with about an
+ * 8% performance penalty.
+ */
+
+typedef union {
+ unsigned char b[8];
+ struct {
+#if defined(LONG_IS_32_BITS)
+ /* long is often faster than a 32-bit bit field */
+ long i0;
+ long i1;
+#else
+ long i0: 32;
+ long i1: 32;
+#endif
+ } b32;
+#if defined(B64)
+ B64 b64;
+#endif
+} C_block;
+
+/*
* Convert twenty-four-bit long in host-order
* to six bits (and 2 low-order zeroes) per char little-endian format.
*/
@@ -128,6 +277,8 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
#if defined(LARGEDATA)
/* Waste memory like crazy. Also, do permutations in line */
+#define LGCHUNKBITS 3
+#define CHUNKBITS (1<<LGCHUNKBITS)
#define PERM6464(d,d0,d1,cpp,p) \
LOAD((d),(d0),(d1),(p)[(0<<CHUNKBITS)+(cpp)[0]]); \
OR ((d),(d0),(d1),(p)[(1<<CHUNKBITS)+(cpp)[1]]); \
@@ -144,16 +295,22 @@ static char sccsid[] = "@(#)crypt.c 8.1 (Berkeley) 6/4/93";
OR ((d),(d0),(d1),(p)[(3<<CHUNKBITS)+(cpp)[3]]);
#else
/* "small data" */
+#define LGCHUNKBITS 2
+#define CHUNKBITS (1<<LGCHUNKBITS)
#define PERM6464(d,d0,d1,cpp,p) \
{ C_block tblk; permute((cpp),&tblk,(p),8); LOAD ((d),(d0),(d1),tblk); }
#define PERM3264(d,d0,d1,cpp,p) \
{ C_block tblk; permute((cpp),&tblk,(p),4); LOAD ((d),(d0),(d1),tblk); }
STATIC void
-permute(const unsigned char *cp, C_block *out, register const C_block *p, int chars_in)
+permute(cp, out, p, chars_in)
+ unsigned char *cp;
+ C_block *out;
+ register C_block *p;
+ int chars_in;
{
register DCL_BLOCK(D,D0,D1);
- register const C_block *tp;
+ register C_block *tp;
register int t;
ZERO(D,D0,D1);
@@ -166,14 +323,10 @@ permute(const unsigned char *cp, C_block *out, register const C_block *p, int ch
}
#endif /* LARGEDATA */
-#ifdef DEBUG
-STATIC void prtab(const char *s, const unsigned char *t, int num_rows);
-#endif
-#if INIT_DES
/* ===== (mostly) Standard DES Tables ==================== */
-static const unsigned char IP[] = { /* initial permutation */
+static unsigned char IP[] = { /* initial permutation */
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
@@ -186,7 +339,7 @@ static const unsigned char IP[] = { /* initial permutation */
/* The final permutation is the inverse of IP - no table is necessary */
-static const unsigned char ExpandTr[] = { /* expansion operation */
+static unsigned char ExpandTr[] = { /* expansion operation */
32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
@@ -197,7 +350,7 @@ static const unsigned char ExpandTr[] = { /* expansion operation */
28, 29, 30, 31, 32, 1,
};
-static const unsigned char PC1[] = { /* permuted choice table 1 */
+static unsigned char PC1[] = { /* permuted choice table 1 */
57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
@@ -208,15 +361,13 @@ static const unsigned char PC1[] = { /* permuted choice table 1 */
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4,
};
-#endif
-static const unsigned char Rotates[] = { /* PC1 rotation schedule */
+static unsigned char Rotates[] = { /* PC1 rotation schedule */
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1,
};
-#if INIT_DES
/* note: each "row" of PC2 is left-padded with bits that make it invertible */
-static const unsigned char PC2[] = { /* permuted choice table 2 */
+static unsigned char PC2[] = { /* permuted choice table 2 */
9, 18, 14, 17, 11, 24, 1, 5,
22, 25, 3, 28, 15, 6, 21, 10,
35, 38, 23, 19, 12, 4, 26, 8,
@@ -228,7 +379,7 @@ static const unsigned char PC2[] = { /* permuted choice table 2 */
0, 0, 46, 42, 50, 36, 29, 32,
};
-static const unsigned char S[8][64] = { /* 48->32 bit substitution tables */
+static unsigned char S[8][64] = { /* 48->32 bit substitution tables */
{
/* S[1] */
14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
@@ -287,7 +438,7 @@ static const unsigned char S[8][64] = { /* 48->32 bit substitution tables */
},
};
-static const unsigned char P32Tr[] = { /* 32-bit permutation function */
+static unsigned char P32Tr[] = { /* 32-bit permutation function */
16, 7, 20, 21,
29, 12, 28, 17,
1, 15, 23, 26,
@@ -298,7 +449,7 @@ static const unsigned char P32Tr[] = { /* 32-bit permutation function */
22, 11, 4, 25,
};
-static const unsigned char CIFP[] = { /* compressed/interleaved permutation */
+static unsigned char CIFP[] = { /* compressed/interleaved permutation */
1, 2, 3, 4, 17, 18, 19, 20,
5, 6, 7, 8, 21, 22, 23, 24,
9, 10, 11, 12, 25, 26, 27, 28,
@@ -309,91 +460,46 @@ static const unsigned char CIFP[] = { /* compressed/interleaved permutation */
41, 42, 43, 44, 57, 58, 59, 60,
45, 46, 47, 48, 61, 62, 63, 64,
};
-#endif
-static const unsigned char itoa64[] = /* 0..63 => ascii-64 */
+static unsigned char itoa64[] = /* 0..63 => ascii-64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-/* table that converts chars "./0-9A-Za-z"to integers 0-63. */
-static const unsigned char a64toi[256] = {
-#define A64TOI1(c) \
- ((c) == '.' ? 0 : \
- (c) == '/' ? 1 : \
- ('0' <= (c) && (c) <= '9') ? (c) - '0' + 2 : \
- ('A' <= (c) && (c) <= 'Z') ? (c) - 'A' + 12 : \
- ('a' <= (c) && (c) <= 'z') ? (c) - 'a' + 38 : \
- 0)
-#define A64TOI4(base) A64TOI1(base+0), A64TOI1(base+1), A64TOI1(base+2), A64TOI1(base+3)
-#define A64TOI16(base) A64TOI4(base+0), A64TOI4(base+4), A64TOI4(base+8), A64TOI4(base+12)
-#define A64TOI64(base) A64TOI16(base+0x00), A64TOI16(base+0x10), A64TOI16(base+0x20), A64TOI16(base+0x30)
- A64TOI64(0x00), A64TOI64(0x40),
- A64TOI64(0x00), A64TOI64(0x40),
-};
-#if INIT_DES
/* ===== Tables that are initialized at run time ==================== */
-typedef struct {
- /* Initial key schedule permutation */
- C_block PC1ROT[64/CHUNKBITS][1<<CHUNKBITS];
- /* Subsequent key schedule rotation permutations */
- C_block PC2ROT[2][64/CHUNKBITS][1<<CHUNKBITS];
+static unsigned char a64toi[128]; /* ascii-64 => 0..63 */
- /* Initial permutation/expansion table */
- C_block IE3264[32/CHUNKBITS][1<<CHUNKBITS];
+/* Initial key schedule permutation */
+static C_block PC1ROT[64/CHUNKBITS][1<<CHUNKBITS];
- /* Table that combines the S, P, and E operations. */
- unsigned long SPE[2][8][64];
+/* Subsequent key schedule rotation permutations */
+static C_block PC2ROT[2][64/CHUNKBITS][1<<CHUNKBITS];
- /* compressed/interleaved => final permutation table */
- C_block CF6464[64/CHUNKBITS][1<<CHUNKBITS];
+/* Initial permutation/expansion table */
+static C_block IE3264[32/CHUNKBITS][1<<CHUNKBITS];
- int ready;
-} des_tables_t;
-static des_tables_t des_tables[1];
+/* Table that combines the S, P, and E operations. */
+static long SPE[2][8][64];
-#define des_tables ((const des_tables_t *)des_tables)
-#define PC1ROT (des_tables->PC1ROT)
-#define PC2ROT (des_tables->PC2ROT)
-#define IE3264 (des_tables->IE3264)
-#define SPE (des_tables->SPE)
-#define CF6464 (des_tables->CF6464)
+/* compressed/interleaved => final permutation table */
+static C_block CF6464[64/CHUNKBITS][1<<CHUNKBITS];
-STATIC void init_des(void);
-STATIC void init_perm(C_block perm[64/CHUNKBITS][1<<CHUNKBITS], unsigned char p[64], int chars_in, int chars_out);
-#endif
-
-static const C_block constdatablock = {{0}}; /* encryption constant */
-#define KS (data->KS)
-#define cryptresult (data->cryptresult)
+/* ==================================== */
-static void des_setkey_r(const unsigned char *key, struct crypt_data *data);
-static void des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_iter, struct crypt_data *data);
-#ifdef USE_NONREENTRANT_CRYPT
-static struct crypt_data default_crypt_data;
-#endif
+static C_block constdatablock; /* encryption constant */
+static char cryptresult[1+4+4+11+1]; /* encrypted result */
-#ifdef USE_NONREENTRANT_CRYPT
/*
* Return a pointer to static data consisting of the "setting"
* followed by an encryption produced by the "key" and "setting".
*/
char *
-crypt(const char *key, const char *setting)
-{
- return crypt_r(key, setting, &default_crypt_data);
-}
-#endif
-
-/*
- * Return a pointer to data consisting of the "setting" followed by an
- * encryption produced by the "key" and "setting".
- */
-char *
-crypt_r(const char *key, const char *setting, struct crypt_data *data)
+crypt(key, setting)
+ register const char *key;
+ register const char *setting;
{
register char *encp;
register long i;
@@ -407,7 +513,8 @@ crypt_r(const char *key, const char *setting, struct crypt_data *data)
key++;
keyblock.b[i] = t;
}
- des_setkey_r(keyblock.b, data); /* also initializes "a64toi" */
+ if (des_setkey((char *)keyblock.b)) /* also initializes "a64toi" */
+ return (NULL);
encp = &cryptresult[0];
switch (*setting) {
@@ -416,13 +523,16 @@ crypt_r(const char *key, const char *setting, struct crypt_data *data)
* Involve the rest of the password 8 characters at a time.
*/
while (*key) {
- des_cipher_r(keyblock.b, keyblock.b, 0L, 1, data);
+ if (des_cipher((char *)&keyblock,
+ (char *)&keyblock, 0L, 1))
+ return (NULL);
for (i = 0; i < 8; i++) {
if ((t = 2*(unsigned char)(*key)) != 0)
key++;
keyblock.b[i] ^= t;
}
- des_setkey_r(keyblock.b, data);
+ if (des_setkey((char *)keyblock.b))
+ return (NULL);
}
*encp++ = *setting++;
@@ -452,7 +562,9 @@ crypt_r(const char *key, const char *setting, struct crypt_data *data)
salt = (salt<<6) | a64toi[t];
}
encp += salt_size;
- des_cipher_r(constdatablock.b, rsltblock.b, salt, num_iter, data);
+ if (des_cipher((char *)&constdatablock, (char *)&rsltblock,
+ salt, num_iter))
+ return (NULL);
/*
* Encode the 64 cipher bits as 11 ascii characters.
@@ -477,29 +589,41 @@ crypt_r(const char *key, const char *setting, struct crypt_data *data)
return (cryptresult);
}
+
+/*
+ * The Key Schedule, filled in by des_setkey() or setkey().
+ */
+#define KS_SIZE 16
+static C_block KS[KS_SIZE];
+
/*
* Set up the key schedule from the key.
*/
-static void
-des_setkey_r(const unsigned char *key, struct crypt_data *data)
+int
+des_setkey(key)
+ register const char *key;
{
register DCL_BLOCK(K, K0, K1);
- register const C_block *ptabp;
+ register C_block *ptabp;
register int i;
- C_block *ksp;
-
- init_des();
-
- PERM6464(K,K0,K1,key,PC1ROT[0]);
- ksp = &KS[0];
- STORE(K&~0x03030303L, K0&~0x03030303L, K1, *ksp);
- for (i = 1; i < numberof(KS); i++) {
- ksp++;
- STORE(K,K0,K1,*ksp);
- ptabp = PC2ROT[Rotates[i]-1][0];
- PERM6464(K,K0,K1,ksp->b,ptabp);
- STORE(K&~0x03030303L, K0&~0x03030303L, K1, *ksp);
+ static int des_ready = 0;
+
+ if (!des_ready) {
+ init_des();
+ des_ready = 1;
+ }
+
+ PERM6464(K,K0,K1,(unsigned char *)key,(C_block *)PC1ROT);
+ key = (char *)&KS[0];
+ STORE(K&~0x03030303L, K0&~0x03030303L, K1, *(C_block *)key);
+ for (i = 1; i < 16; i++) {
+ key += sizeof(C_block);
+ STORE(K,K0,K1,*(C_block *)key);
+ ptabp = (C_block *)PC2ROT[Rotates[i]-1];
+ PERM6464(K,K0,K1,(unsigned char *)key,ptabp);
+ STORE(K&~0x03030303L, K0&~0x03030303L, K1, *(C_block *)key);
}
+ return (0);
}
/*
@@ -510,15 +634,19 @@ des_setkey_r(const unsigned char *key, struct crypt_data *data)
* NOTE: the performance of this routine is critically dependent on your
* compiler and machine architecture.
*/
-void
-des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_iter, struct crypt_data *data)
+int
+des_cipher(in, out, salt, num_iter)
+ const char *in;
+ char *out;
+ long salt;
+ int num_iter;
{
/* variables that we want in registers, most important first */
#if defined(pdp11)
register int j;
#endif
- register unsigned long L0, L1, R0, R1, k;
- register const C_block *kp;
+ register long L0, L1, R0, R1, k;
+ register C_block *kp;
register int ks_inc, loop_count;
C_block B;
@@ -547,26 +675,26 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
R1 = (R1 >> 1) & 0x55555555L;
L1 = R0 | R1; /* L1 is the odd-numbered input bits */
STORE(L,L0,L1,B);
- PERM3264(L,L0,L1,B.b, IE3264[0]); /* even bits */
- PERM3264(R,R0,R1,B.b+4,IE3264[0]); /* odd bits */
+ PERM3264(L,L0,L1,B.b, (C_block *)IE3264); /* even bits */
+ PERM3264(R,R0,R1,B.b+4,(C_block *)IE3264); /* odd bits */
if (num_iter >= 0)
{ /* encryption */
kp = &KS[0];
- ks_inc = +1;
+ ks_inc = (int)sizeof(*kp);
}
else
{ /* decryption */
num_iter = -num_iter;
kp = &KS[KS_SIZE-1];
- ks_inc = -1;
+ ks_inc = -(int)sizeof(*kp);
}
while (--num_iter >= 0) {
loop_count = 8;
do {
-#define SPTAB(t, i) (*(const unsigned long *)((const unsigned char *)(t) + (i)*(sizeof(long)/4)))
+#define SPTAB(t, i) (*(long *)((unsigned char *)(t) + (i)*(sizeof(long)/4)))
#if defined(gould)
/* use this if B.b[i] is evaluated just once ... */
#define DOXOR(x,y,i) (x)^=SPTAB(SPE[0][(i)],B.b[(i)]); (y)^=SPTAB(SPE[1][(i)],B.b[(i)]);
@@ -584,7 +712,7 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
k = ((q0) ^ (q1)) & SALT; \
B.b32.i0 = k ^ (q0) ^ kp->b32.i0; \
B.b32.i1 = k ^ (q1) ^ kp->b32.i1; \
- kp += ks_inc; \
+ kp = (C_block *)((char *)kp+ks_inc); \
\
DOXOR((p0), (p1), 0); \
DOXOR((p0), (p1), 1); \
@@ -598,7 +726,7 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
CRUNCH(L0, L1, R0, R1);
CRUNCH(R0, R1, L0, L1);
} while (--loop_count != 0);
- kp -= (ks_inc*KS_SIZE);
+ kp = (C_block *)((char *)kp-(ks_inc*KS_SIZE));
/* swap L and R */
@@ -611,7 +739,7 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
L0 = ((L0 >> 3) & 0x0f0f0f0fL) | ((L1 << 1) & 0xf0f0f0f0L);
L1 = ((R0 >> 3) & 0x0f0f0f0fL) | ((R1 << 1) & 0xf0f0f0f0L);
STORE(L,L0,L1,B);
- PERM6464(L,L0,L1,B.b, CF6464[0]);
+ PERM6464(L,L0,L1,B.b, (C_block *)CF6464);
#if defined(MUST_ALIGN)
STORE(L,L0,L1,B);
out[0] = B.b[0]; out[1] = B.b[1]; out[2] = B.b[2]; out[3] = B.b[3];
@@ -619,26 +747,27 @@ des_cipher_r(const unsigned char *in, unsigned char *out, long salt, int num_ite
#else
STORE(L,L0,L1,*(C_block *)out);
#endif
+ return (0);
}
-#undef des_tables
-#undef KS
-#undef cryptresult
-#if INIT_DES
/*
* Initialize various tables. This need only be done once. It could even be
* done at compile time, if the compiler were capable of that sort of thing.
*/
STATIC void
-init_des(void)
+init_des()
{
register int i, j;
register long k;
register int tableno;
- unsigned char perm[64], tmp32[32];
+ static unsigned char perm[64], tmp32[32]; /* "static" for speed */
- if (des_tables->ready) return;
+ /*
+ * table that converts chars "./0-9A-Za-z"to integers 0-63.
+ */
+ for (i = 0; i < 64; i++)
+ a64toi[itoa64[i]] = i;
/*
* PC1ROT - bit reverse, then PC1, then Rotate, then PC2.
@@ -760,8 +889,6 @@ init_des(void)
TO_SIX_BIT(SPE[1][tableno][j], k);
}
}
-
- des_tables->ready = 1;
}
/*
@@ -773,8 +900,10 @@ init_des(void)
* "perm" must be all-zeroes on entry to this routine.
*/
STATIC void
-init_perm(C_block perm[64/CHUNKBITS][1<<CHUNKBITS],
- unsigned char p[64], int chars_in, int chars_out)
+init_perm(perm, p, chars_in, chars_out)
+ C_block perm[64/CHUNKBITS][1<<CHUNKBITS];
+ unsigned char p[64];
+ int chars_in, chars_out;
{
register int i, j, k, l;
@@ -790,21 +919,13 @@ init_perm(C_block perm[64/CHUNKBITS][1<<CHUNKBITS],
}
}
}
-#endif
/*
* "setkey" routine (for backwards compatibility)
*/
-#ifdef USE_NONREENTRANT_CRYPT
-void
-setkey(const char *key)
-{
- setkey_r(key, &default_crypt_data);
-}
-#endif
-
-void
-setkey_r(const char *key, struct crypt_data *data)
+int
+setkey(key)
+ register const char *key;
{
register int i, j, k;
C_block keyblock;
@@ -817,22 +938,16 @@ setkey_r(const char *key, struct crypt_data *data)
}
keyblock.b[i] = k;
}
- des_setkey_r(keyblock.b, data);
+ return (des_setkey((char *)keyblock.b));
}
/*
* "encrypt" routine (for backwards compatibility)
*/
-#ifdef USE_NONREENTRANT_CRYPT
-void
-encrypt(char *block, int flag)
-{
- encrypt_r(block, flag, &default_crypt_data);
-}
-#endif
-
-void
-encrypt_r(char *block, int flag, struct crypt_data *data)
+int
+encrypt(block, flag)
+ register char *block;
+ int flag;
{
register int i, j, k;
C_block cblock;
@@ -845,7 +960,8 @@ encrypt_r(char *block, int flag, struct crypt_data *data)
}
cblock.b[i] = k;
}
- des_cipher_r(cblock.b, cblock.b, 0L, (flag ? -1: 1), data);
+ if (des_cipher((char *)&cblock, (char *)&cblock, 0L, (flag ? -1: 1)))
+ return (1);
for (i = 7; i >= 0; i--) {
k = cblock.b[i];
for (j = 7; j >= 0; j--) {
@@ -853,11 +969,15 @@ encrypt_r(char *block, int flag, struct crypt_data *data)
k >>= 1;
}
}
+ return (0);
}
#ifdef DEBUG
STATIC void
-prtab(const char *s, const unsigned char *t, int num_rows)
+prtab(s, t, num_rows)
+ char *s;
+ unsigned char *t;
+ int num_rows;
{
register int i, j;
@@ -871,97 +991,3 @@ prtab(const char *s, const unsigned char *t, int num_rows)
(void)printf("\n");
}
#endif
-
-#ifdef DUMP
-void
-dump_block(const C_block *block)
-{
- int i;
- printf("{{");
- for (i = 0; i < numberof(block->b); ++i) {
- printf("%3d,", block->b[i]);
- }
- printf("}},\n");
-}
-
-int
-main(void)
-{
- int i, j, k;
- init_des();
-
- printf("#ifndef HAVE_DES_TABLES\n\n");
- printf("/* Initial key schedule permutation */\n");
- printf("static const C_block PC1ROT[64/CHUNKBITS][1<<CHUNKBITS] = {\n");
- for (i = 0; i < numberof(PC1ROT); ++i) {
- printf("\t{\n");
- for (j = 0; j < numberof(PC1ROT[0]); ++j) {
- printf("\t\t");
- dump_block(&PC1ROT[i][j]);
- }
- printf("\t},\n");
- }
- printf("};\n\n");
-
- printf("/* Subsequent key schedule rotation permutations */\n");
- printf("static const C_block PC2ROT[2][64/CHUNKBITS][1<<CHUNKBITS] = {\n");
- for (i = 0; i < numberof(PC2ROT); ++i) {
- printf("\t{\n");
- for (j = 0; j < numberof(PC2ROT[0]); ++j) {
- printf("\t\t{\n");
- for (k = 0; k < numberof(PC2ROT[0][0]); ++k) {
- printf("\t\t\t");
- dump_block(&PC2ROT[i][j][k]);
- }
- printf("\t\t},\n");
- }
- printf("\t},\n");
- }
- printf("};\n\n");
-
- printf("/* Initial permutation/expansion table */\n");
- printf("static const C_block IE3264[32/CHUNKBITS][1<<CHUNKBITS] = {\n");
- for (i = 0; i < numberof(IE3264); ++i) {
- printf("\t{\n");
- for (j = 0; j < numberof(IE3264[0]); ++j) {
- printf("\t\t");
- dump_block(&IE3264[i][j]);
- }
- printf("\t},\n");
- }
- printf("};\n\n");
-
- printf("/* Table that combines the S, P, and E operations. */\n");
- printf("static const unsigned long SPE[2][8][64] = {\n");
- for (i = 0; i < numberof(SPE); ++i) {
- printf("\t{\n");
- for (j = 0; j < numberof(SPE[0]); ++j) {
- int r = 0;
- printf("\t\t{");
- for (k = 0; k < numberof(SPE[0][0]); ++k) {
- if (r == 0) printf("\n\t\t\t");
- printf("%#10lx,", SPE[i][j][k]);
- if (++r == 4) r = 0;
- }
- printf("\n\t\t},\n");
- }
- printf("\t},\n");
- }
- printf("};\n\n");
-
- printf("/* compressed/interleaved => final permutation table */\n");
- printf("static const C_block CF6464[64/CHUNKBITS][1<<CHUNKBITS] = {\n");
- for (i = 0; i < numberof(CF6464); ++i) {
- printf("\t{\n");
- for (j = 0; j < numberof(CF6464[0]); ++j) {
- printf("\t\t");
- dump_block(&CF6464[i][j]);
- }
- printf("\t},\n");
- }
- printf("};\n\n");
- printf("#define HAVE_DES_TABLES 1\n""#endif\n");
-
- return 0;
-}
-#endif
diff --git a/missing/crypt.h b/missing/crypt.h
deleted file mode 100644
index 7c2642f593..0000000000
--- a/missing/crypt.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Tom Truscott.
- *
- * 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. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- */
-
-#ifndef CRYPT_H
-#define CRYPT_H 1
-
-/* ===== Configuration ==================== */
-
-#ifdef CHAR_BITS
-#if CHAR_BITS != 8
- #error C_block structure assumes 8 bit characters
-#endif
-#endif
-
-#ifndef LONG_LONG
-# if SIZEOF_LONG_LONG > 0
-# define LONG_LONG long long
-# elif SIZEOF___INT64 > 0
-# define HAVE_LONG_LONG 1
-# define LONG_LONG __int64
-# undef SIZEOF_LONG_LONG
-# define SIZEOF_LONG_LONG SIZEOF___INT64
-# endif
-#endif
-
-/*
- * define "LONG_IS_32_BITS" only if sizeof(long)==4.
- * This avoids use of bit fields (your compiler may be sloppy with them).
- */
-#if SIZEOF_LONG == 4
-#define LONG_IS_32_BITS
-#endif
-
-/*
- * define "B64" to be the declaration for a 64 bit integer.
- * XXX this feature is currently unused, see "endian" comment below.
- */
-#if SIZEOF_LONG == 8
-#define B64 long
-#elif SIZEOF_LONG_LONG == 8
-#define B64 LONG_LONG
-#endif
-
-/*
- * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes
- * of lookup tables. This speeds up des_setkey() and des_cipher(), but has
- * little effect on crypt().
- */
-#if defined(notdef)
-#define LARGEDATA
-#endif
-
-/* compile with "-DSTATIC=int" when profiling */
-#ifndef STATIC
-#define STATIC static
-#endif
-
-/* ==================================== */
-
-/*
- * Cipher-block representation (Bob Baldwin):
- *
- * DES operates on groups of 64 bits, numbered 1..64 (sigh). One
- * representation is to store one bit per byte in an array of bytes. Bit N of
- * the NBS spec is stored as the LSB of the Nth byte (index N-1) in the array.
- * Another representation stores the 64 bits in 8 bytes, with bits 1..8 in the
- * first byte, 9..16 in the second, and so on. The DES spec apparently has
- * bit 1 in the MSB of the first byte, but that is particularly noxious so we
- * bit-reverse each byte so that bit 1 is the LSB of the first byte, bit 8 is
- * the MSB of the first byte. Specifically, the 64-bit input data and key are
- * converted to LSB format, and the output 64-bit block is converted back into
- * MSB format.
- *
- * DES operates internally on groups of 32 bits which are expanded to 48 bits
- * by permutation E and shrunk back to 32 bits by the S boxes. To speed up
- * the computation, the expansion is applied only once, the expanded
- * representation is maintained during the encryption, and a compression
- * permutation is applied only at the end. To speed up the S-box lookups,
- * the 48 bits are maintained as eight 6 bit groups, one per byte, which
- * directly feed the eight S-boxes. Within each byte, the 6 bits are the
- * most significant ones. The low two bits of each byte are zero. (Thus,
- * bit 1 of the 48 bit E expansion is stored as the "4"-valued bit of the
- * first byte in the eight byte representation, bit 2 of the 48 bit value is
- * the "8"-valued bit, and so on.) In fact, a combined "SPE"-box lookup is
- * used, in which the output is the 64 bit result of an S-box lookup which
- * has been permuted by P and expanded by E, and is ready for use in the next
- * iteration. Two 32-bit wide tables, SPE[0] and SPE[1], are used for this
- * lookup. Since each byte in the 48 bit path is a multiple of four, indexed
- * lookup of SPE[0] and SPE[1] is simple and fast. The key schedule and
- * "salt" are also converted to this 8*(6+2) format. The SPE table size is
- * 8*64*8 = 4K bytes.
- *
- * To speed up bit-parallel operations (such as XOR), the 8 byte
- * representation is "union"ed with 32 bit values "i0" and "i1", and, on
- * machines which support it, a 64 bit value "b64". This data structure,
- * "C_block", has two problems. First, alignment restrictions must be
- * honored. Second, the byte-order (e.g. little-endian or big-endian) of
- * the architecture becomes visible.
- *
- * The byte-order problem is unfortunate, since on the one hand it is good
- * to have a machine-independent C_block representation (bits 1..8 in the
- * first byte, etc.), and on the other hand it is good for the LSB of the
- * first byte to be the LSB of i0. We cannot have both these things, so we
- * currently use the "little-endian" representation and avoid any multi-byte
- * operations that depend on byte order. This largely precludes use of the
- * 64-bit datatype since the relative order of i0 and i1 are unknown. It
- * also inhibits grouping the SPE table to look up 12 bits at a time. (The
- * 12 bits can be stored in a 16-bit field with 3 low-order zeroes and 1
- * high-order zero, providing fast indexing into a 64-bit wide SPE.) On the
- * other hand, 64-bit datatypes are currently rare, and a 12-bit SPE lookup
- * requires a 128 kilobyte table, so perhaps this is not a big loss.
- *
- * Permutation representation (Jim Gillogly):
- *
- * A transformation is defined by its effect on each of the 8 bytes of the
- * 64-bit input. For each byte we give a 64-bit output that has the bits in
- * the input distributed appropriately. The transformation is then the OR
- * of the 8 sets of 64-bits. This uses 8*256*8 = 16K bytes of storage for
- * each transformation. Unless LARGEDATA is defined, however, a more compact
- * table is used which looks up 16 4-bit "chunks" rather than 8 8-bit chunks.
- * The smaller table uses 16*16*8 = 2K bytes for each transformation. This
- * is slower but tolerable, particularly for password encryption in which
- * the SPE transformation is iterated many times. The small tables total 9K
- * bytes, the large tables total 72K bytes.
- *
- * The transformations used are:
- * IE3264: MSB->LSB conversion, initial permutation, and expansion.
- * This is done by collecting the 32 even-numbered bits and applying
- * a 32->64 bit transformation, and then collecting the 32 odd-numbered
- * bits and applying the same transformation. Since there are only
- * 32 input bits, the IE3264 transformation table is half the size of
- * the usual table.
- * CF6464: Compression, final permutation, and LSB->MSB conversion.
- * This is done by two trivial 48->32 bit compressions to obtain
- * a 64-bit block (the bit numbering is given in the "CIFP" table)
- * followed by a 64->64 bit "cleanup" transformation. (It would
- * be possible to group the bits in the 64-bit block so that 2
- * identical 32->32 bit transformations could be used instead,
- * saving a factor of 4 in space and possibly 2 in time, but
- * byte-ordering and other complications rear their ugly head.
- * Similar opportunities/problems arise in the key schedule
- * transforms.)
- * PC1ROT: MSB->LSB, PC1 permutation, rotate, and PC2 permutation.
- * This admittedly baroque 64->64 bit transformation is used to
- * produce the first code (in 8*(6+2) format) of the key schedule.
- * PC2ROT[0]: Inverse PC2 permutation, rotate, and PC2 permutation.
- * It would be possible to define 15 more transformations, each
- * with a different rotation, to generate the entire key schedule.
- * To save space, however, we instead permute each code into the
- * next by using a transformation that "undoes" the PC2 permutation,
- * rotates the code, and then applies PC2. Unfortunately, PC2
- * transforms 56 bits into 48 bits, dropping 8 bits, so PC2 is not
- * invertible. We get around that problem by using a modified PC2
- * which retains the 8 otherwise-lost bits in the unused low-order
- * bits of each byte. The low-order bits are cleared when the
- * codes are stored into the key schedule.
- * PC2ROT[1]: Same as PC2ROT[0], but with two rotations.
- * This is faster than applying PC2ROT[0] twice,
- *
- * The Bell Labs "salt" (Bob Baldwin):
- *
- * The salting is a simple permutation applied to the 48-bit result of E.
- * Specifically, if bit i (1 <= i <= 24) of the salt is set then bits i and
- * i+24 of the result are swapped. The salt is thus a 24 bit number, with
- * 16777216 possible values. (The original salt was 12 bits and could not
- * swap bits 13..24 with 36..48.)
- *
- * It is possible, but ugly, to warp the SPE table to account for the salt
- * permutation. Fortunately, the conditional bit swapping requires only
- * about four machine instructions and can be done on-the-fly with about an
- * 8% performance penalty.
- */
-
-typedef union {
- unsigned char b[8];
- struct {
-#if defined(LONG_IS_32_BITS)
- /* long is often faster than a 32-bit bit field */
- long i0;
- long i1;
-#else
- long i0: 32;
- long i1: 32;
-#endif
- } b32;
-#if defined(B64)
- B64 b64;
-#endif
-} C_block;
-
-#if defined(LARGEDATA)
- /* Waste memory like crazy. Also, do permutations in line */
-#define LGCHUNKBITS 3
-#define CHUNKBITS (1<<LGCHUNKBITS)
-#else
- /* "small data" */
-#define LGCHUNKBITS 2
-#define CHUNKBITS (1<<LGCHUNKBITS)
-#endif
-
-struct crypt_data {
- /* The Key Schedule, filled in by des_setkey() or setkey(). */
-#define KS_SIZE 16
- C_block KS[KS_SIZE];
-
- /* ==================================== */
-
- char cryptresult[1+4+4+11+1]; /* encrypted result */
-};
-
-char *crypt(const char *key, const char *setting);
-void setkey(const char *key);
-void encrypt(char *block, int flag);
-
-char *crypt_r(const char *key, const char *setting, struct crypt_data *data);
-void setkey_r(const char *key, struct crypt_data *data);
-void encrypt_r(char *block, int flag, struct crypt_data *data);
-
-#endif /* CRYPT_H */
diff --git a/missing/des_tables.c b/missing/des_tables.c
deleted file mode 100644
index ab6b1d1883..0000000000
--- a/missing/des_tables.c
+++ /dev/null
@@ -1,1616 +0,0 @@
-#ifndef HAVE_DES_TABLES
-
-/* Initial key schedule permutation */
-static const C_block PC1ROT[64/CHUNKBITS][1<<CHUNKBITS] = {
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 1, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 1, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 1, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 1, 0, 0, 0, 0,}},
- {{ 0, 0, 1, 1, 0, 0, 0, 0,}},
- {{ 0, 0, 1, 1, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 16, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 16, 0, 0,}},
- {{ 0, 0, 1, 0, 0, 16, 0, 0,}},
- {{ 0, 0, 1, 0, 0, 16, 0, 0,}},
- {{ 0, 0, 0, 1, 0, 16, 0, 0,}},
- {{ 0, 0, 0, 1, 0, 16, 0, 0,}},
- {{ 0, 0, 1, 1, 0, 16, 0, 0,}},
- {{ 0, 0, 1, 1, 0, 16, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0,128, 0, 0, 0,}},
- {{ 0, 0, 4, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 4, 0,128, 0, 0, 0,}},
- {{ 0, 16, 0, 0, 0, 0, 0, 0,}},
- {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0, 0, 0,}},
- {{ 0, 64, 0, 64, 0, 0,128, 0,}},
- {{128, 0, 0, 0, 0, 0, 0, 0,}},
- {{128, 0, 0, 0, 0, 0,128, 0,}},
- {{128, 64, 0, 0, 0, 0, 0, 0,}},
- {{128, 64, 0, 0, 0, 0,128, 0,}},
- {{128, 0, 0, 64, 0, 0, 0, 0,}},
- {{128, 0, 0, 64, 0, 0,128, 0,}},
- {{128, 64, 0, 64, 0, 0, 0, 0,}},
- {{128, 64, 0, 64, 0, 0,128, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0,128,}},
- {{ 0, 0, 0, 0, 0, 0, 0,128,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0,128,}},
- {{ 0, 0, 0, 0, 0, 8, 0,128,}},
- {{ 0, 0, 0, 0, 0,128, 0, 0,}},
- {{ 0, 0, 0, 0, 0,128, 0, 0,}},
- {{ 0, 0, 0, 0, 0,128, 0,128,}},
- {{ 0, 0, 0, 0, 0,128, 0,128,}},
- {{ 0, 0, 0, 0, 0,136, 0, 0,}},
- {{ 0, 0, 0, 0, 0,136, 0, 0,}},
- {{ 0, 0, 0, 0, 0,136, 0,128,}},
- {{ 0, 0, 0, 0, 0,136, 0,128,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 8, 0, 0, 0,}},
- {{ 0, 0, 0, 32, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 32, 8, 0, 0, 0,}},
- {{ 0, 0, 16, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 16, 0, 8, 0, 0, 0,}},
- {{ 0, 0, 16, 32, 0, 0, 0, 0,}},
- {{ 0, 0, 16, 32, 8, 0, 0, 0,}},
- {{ 0, 0, 32, 0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 0, 0,}},
- {{ 0, 8,128, 0, 0, 0, 0, 0,}},
- {{ 32, 8,128, 0, 0, 0, 0, 0,}},
- {{ 0, 8,128, 4, 0, 0, 0, 0,}},
- {{ 32, 8,128, 4, 0, 0, 0, 0,}},
- },
-};
-
-/* Subsequent key schedule rotation permutations */
-static const C_block PC2ROT[2][64/CHUNKBITS][1<<CHUNKBITS] = {
- {
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0,128, 0, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 8, 0,128, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 64, 0, 0, 0, 0,}},
- {{ 0, 0,128, 64, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 64, 0, 0, 0, 0,}},
- {{ 8, 0,128, 64, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 4, 0, 0, 0, 0,}},
- {{ 0, 0,128, 4, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 4, 0, 0, 0, 0,}},
- {{ 8, 0,128, 4, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 68, 0, 0, 0, 0,}},
- {{ 0, 0,128, 68, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 68, 0, 0, 0, 0,}},
- {{ 8, 0,128, 68, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0,128, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 4, 0, 0, 0, 0, 0,}},
- {{ 0,128, 4, 0, 0, 0, 0, 0,}},
- {{ 0, 8, 0, 0, 0, 0, 0, 0,}},
- {{ 0,136, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 8, 4, 0, 0, 0, 0, 0,}},
- {{ 0,136, 4, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 32, 0, 0, 0, 0, 0,}},
- {{ 0,128, 32, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 36, 0, 0, 0, 0, 0,}},
- {{ 0,128, 36, 0, 0, 0, 0, 0,}},
- {{ 0, 8, 32, 0, 0, 0, 0, 0,}},
- {{ 0,136, 32, 0, 0, 0, 0, 0,}},
- {{ 0, 8, 36, 0, 0, 0, 0, 0,}},
- {{ 0,136, 36, 0, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 64, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 64, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0,128, 0, 0, 0, 0,}},
- {{ 0, 64, 0,128, 0, 0, 0, 0,}},
- {{ 32, 0, 0,128, 0, 0, 0, 0,}},
- {{ 32, 64, 0,128, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 16, 0, 0, 0, 0,}},
- {{ 0, 64, 0, 16, 0, 0, 0, 0,}},
- {{ 32, 0, 0, 16, 0, 0, 0, 0,}},
- {{ 32, 64, 0, 16, 0, 0, 0, 0,}},
- {{ 0, 0, 0,144, 0, 0, 0, 0,}},
- {{ 0, 64, 0,144, 0, 0, 0, 0,}},
- {{ 32, 0, 0,144, 0, 0, 0, 0,}},
- {{ 32, 64, 0,144, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 4, 0, 0, 0, 0, 0, 0, 0,}},
- {{128, 0, 0, 0, 0, 0, 0, 0,}},
- {{132, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 32, 0, 0, 0, 0,}},
- {{ 4, 0, 0, 32, 0, 0, 0, 0,}},
- {{128, 0, 0, 32, 0, 0, 0, 0,}},
- {{132, 0, 0, 32, 0, 0, 0, 0,}},
- {{ 1, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 5, 0, 0, 0, 0, 0, 0, 0,}},
- {{129, 0, 0, 0, 0, 0, 0, 0,}},
- {{133, 0, 0, 0, 0, 0, 0, 0,}},
- {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0, 0, 0, 0, 0, 0, 32,}},
- {{ 0, 0, 0, 0, 0, 64, 0, 32,}},
- {{ 0, 64, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 64, 0, 0, 0, 64, 0, 0,}},
- {{ 0, 64, 0, 0, 0, 0, 0, 32,}},
- {{ 0, 64, 0, 0, 0, 64, 0, 32,}},
- {{ 8, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 0, 0, 64, 0, 0,}},
- {{ 8, 0, 0, 0, 0, 0, 0, 32,}},
- {{ 8, 0, 0, 0, 0, 64, 0, 32,}},
- {{ 8, 64, 0, 0, 0, 0, 0, 0,}},
- {{ 8, 64, 0, 0, 0, 64, 0, 0,}},
- {{ 8, 64, 0, 0, 0, 0, 0, 32,}},
- {{ 8, 64, 0, 0, 0, 64, 0, 32,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0,128, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0,128, 0, 0, 0, 0,}},
- {{ 0,128, 0,128, 0, 0, 0, 0,}},
- {{ 32, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 32,128, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 0, 0,128, 0, 0, 0, 0,}},
- {{ 32,128, 0,128, 0, 0, 0, 0,}},
- {{ 0, 32, 0, 0, 0, 0, 0, 0,}},
- {{ 0,160, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 32, 0,128, 0, 0, 0, 0,}},
- {{ 0,160, 0,128, 0, 0, 0, 0,}},
- {{ 32, 32, 0, 0, 0, 0, 0, 0,}},
- {{ 32,160, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 32, 0,128, 0, 0, 0, 0,}},
- {{ 32,160, 0,128, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 4, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 8, 0, 0, 0,}},
- {{ 0, 0, 0,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{{ 0, 0, 0, 0, 0, 0, 4, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 4, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 4, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 4, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 4, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0,128, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 64, 0,}},
- {{ 0, 0, 0, 0, 0,128, 64, 0,}},
- {{ 0, 0, 0, 0,128, 0, 0, 0,}},
- {{ 0, 0, 0, 0,128,128, 0, 0,}},
- {{ 0, 0, 0, 0,128, 0, 64, 0,}},
- {{ 0, 0, 0, 0,128,128, 64, 0,}},
- {{ 0, 0, 0, 0, 0, 4, 0, 0,}},
- {{ 0, 0, 0, 0, 0,132, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 4, 64, 0,}},
- {{ 0, 0, 0, 0, 0,132, 64, 0,}},
- {{ 0, 0, 0, 0,128, 4, 0, 0,}},
- {{ 0, 0, 0, 0,128,132, 0, 0,}},
- {{ 0, 0, 0, 0,128, 4, 64, 0,}},
- {{ 0, 0, 0, 0,128,132, 64, 0,}},
- },
- },
-};
-
-/* Initial permutation/expansion table */
-static const C_block IE3264[32/CHUNKBITS][1<<CHUNKBITS] = {
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 64, 4,}},
- {{ 4, 0, 0, 0, 0, 0, 0, 64,}},
- {{ 4, 0, 0, 0, 0, 0, 64, 68,}},
- {{ 0, 0, 0, 0, 64, 4, 0, 0,}},
- {{ 0, 0, 0, 0, 64, 4, 64, 4,}},
- {{ 4, 0, 0, 0, 64, 4, 0, 64,}},
- {{ 4, 0, 0, 0, 64, 4, 64, 68,}},
- {{ 0, 0, 0, 0, 0, 64, 4, 0,}},
- {{ 0, 0, 0, 0, 0, 64, 68, 4,}},
- {{ 4, 0, 0, 0, 0, 64, 4, 64,}},
- {{ 4, 0, 0, 0, 0, 64, 68, 68,}},
- {{ 0, 0, 0, 0, 64, 68, 4, 0,}},
- {{ 0, 0, 0, 0, 64, 68, 68, 4,}},
- {{ 4, 0, 0, 0, 64, 68, 4, 64,}},
- {{ 4, 0, 0, 0, 64, 68, 68, 68,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 64, 4, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 64, 4, 0, 0, 0,}},
- {{ 0, 0, 64, 68, 4, 0, 0, 0,}},
- {{ 64, 4, 0, 0, 0, 0, 0, 0,}},
- {{ 64, 4, 64, 4, 0, 0, 0, 0,}},
- {{ 64, 4, 0, 64, 4, 0, 0, 0,}},
- {{ 64, 4, 64, 68, 4, 0, 0, 0,}},
- {{ 0, 64, 4, 0, 0, 0, 0, 0,}},
- {{ 0, 64, 68, 4, 0, 0, 0, 0,}},
- {{ 0, 64, 4, 64, 4, 0, 0, 0,}},
- {{ 0, 64, 68, 68, 4, 0, 0, 0,}},
- {{ 64, 68, 4, 0, 0, 0, 0, 0,}},
- {{ 64, 68, 68, 4, 0, 0, 0, 0,}},
- {{ 64, 68, 4, 64, 4, 0, 0, 0,}},
- {{ 64, 68, 68, 68, 4, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 32, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 32,}},
- {{ 0, 0, 0, 0, 0, 0, 32, 32,}},
- {{ 0, 0, 0, 0, 32, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 32, 0, 32, 0,}},
- {{ 0, 0, 0, 0, 32, 0, 0, 32,}},
- {{ 0, 0, 0, 0, 32, 0, 32, 32,}},
- {{ 0, 0, 0, 0, 0, 32, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 32, 32, 0,}},
- {{ 0, 0, 0, 0, 0, 32, 0, 32,}},
- {{ 0, 0, 0, 0, 0, 32, 32, 32,}},
- {{ 0, 0, 0, 0, 32, 32, 0, 0,}},
- {{ 0, 0, 0, 0, 32, 32, 32, 0,}},
- {{ 0, 0, 0, 0, 32, 32, 0, 32,}},
- {{ 0, 0, 0, 0, 32, 32, 32, 32,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 32, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 32, 0, 0, 0, 0,}},
- {{ 0, 0, 32, 32, 0, 0, 0, 0,}},
- {{ 32, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 0, 32, 0, 0, 0, 0, 0,}},
- {{ 32, 0, 0, 32, 0, 0, 0, 0,}},
- {{ 32, 0, 32, 32, 0, 0, 0, 0,}},
- {{ 0, 32, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 32, 32, 0, 0, 0, 0, 0,}},
- {{ 0, 32, 0, 32, 0, 0, 0, 0,}},
- {{ 0, 32, 32, 32, 0, 0, 0, 0,}},
- {{ 32, 32, 0, 0, 0, 0, 0, 0,}},
- {{ 32, 32, 32, 0, 0, 0, 0, 0,}},
- {{ 32, 32, 0, 32, 0, 0, 0, 0,}},
- {{ 32, 32, 32, 32, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 16, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 16,}},
- {{ 0, 0, 0, 0, 0, 0, 16, 16,}},
- {{ 0, 0, 0, 0, 16, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 16, 0, 16, 0,}},
- {{ 0, 0, 0, 0, 16, 0, 0, 16,}},
- {{ 0, 0, 0, 0, 16, 0, 16, 16,}},
- {{ 0, 0, 0, 0, 0, 16, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 16, 16, 0,}},
- {{ 0, 0, 0, 0, 0, 16, 0, 16,}},
- {{ 0, 0, 0, 0, 0, 16, 16, 16,}},
- {{ 0, 0, 0, 0, 16, 16, 0, 0,}},
- {{ 0, 0, 0, 0, 16, 16, 16, 0,}},
- {{ 0, 0, 0, 0, 16, 16, 0, 16,}},
- {{ 0, 0, 0, 0, 16, 16, 16, 16,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 16, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 16, 0, 0, 0, 0,}},
- {{ 0, 0, 16, 16, 0, 0, 0, 0,}},
- {{ 16, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 16, 0, 16, 0, 0, 0, 0, 0,}},
- {{ 16, 0, 0, 16, 0, 0, 0, 0,}},
- {{ 16, 0, 16, 16, 0, 0, 0, 0,}},
- {{ 0, 16, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 16, 16, 0, 0, 0, 0, 0,}},
- {{ 0, 16, 0, 16, 0, 0, 0, 0,}},
- {{ 0, 16, 16, 16, 0, 0, 0, 0,}},
- {{ 16, 16, 0, 0, 0, 0, 0, 0,}},
- {{ 16, 16, 16, 0, 0, 0, 0, 0,}},
- {{ 16, 16, 0, 16, 0, 0, 0, 0,}},
- {{ 16, 16, 16, 16, 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0,128, 8, 0,}},
- {{ 0, 0, 0, 0, 0, 0,128, 8,}},
- {{ 0, 0, 0, 0, 0,128,136, 8,}},
- {{ 0, 0, 0,128, 8, 0, 0, 0,}},
- {{ 0, 0, 0,128, 8,128, 8, 0,}},
- {{ 0, 0, 0,128, 8, 0,128, 8,}},
- {{ 0, 0, 0,128, 8,128,136, 8,}},
- {{ 0, 0, 0, 0,128, 8, 0, 0,}},
- {{ 0, 0, 0, 0,128,136, 8, 0,}},
- {{ 0, 0, 0, 0,128, 8,128, 8,}},
- {{ 0, 0, 0, 0,128,136,136, 8,}},
- {{ 0, 0, 0,128,136, 8, 0, 0,}},
- {{ 0, 0, 0,128,136,136, 8, 0,}},
- {{ 0, 0, 0,128,136, 8,128, 8,}},
- {{ 0, 0, 0,128,136,136,136, 8,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0,128, 8, 0, 0, 0, 0, 0,}},
- {{ 0, 0,128, 8, 0, 0, 0, 0,}},
- {{ 0,128,136, 8, 0, 0, 0, 0,}},
- {{ 8, 0, 0, 0, 0, 0, 0,128,}},
- {{ 8,128, 8, 0, 0, 0, 0,128,}},
- {{ 8, 0,128, 8, 0, 0, 0,128,}},
- {{ 8,128,136, 8, 0, 0, 0,128,}},
- {{128, 8, 0, 0, 0, 0, 0, 0,}},
- {{128,136, 8, 0, 0, 0, 0, 0,}},
- {{128, 8,128, 8, 0, 0, 0, 0,}},
- {{128,136,136, 8, 0, 0, 0, 0,}},
- {{136, 8, 0, 0, 0, 0, 0,128,}},
- {{136,136, 8, 0, 0, 0, 0,128,}},
- {{136, 8,128, 8, 0, 0, 0,128,}},
- {{136,136,136, 8, 0, 0, 0,128,}},
- },
-};
-
-/* Table that combines the S, P, and E operations. */
-static const unsigned long SPE[2][8][64] = {
- {
- {
- 0x80088000,0x80000000, 0,0x80088000,
- 0,0x80088000,0x80000000, 0,
- 0x80088000,0x80088000,0x80000000, 0x88000,
- 0x88000, 0, 0,0x80000000,
- 0x80000000, 0, 0x88000,0x80088000,
- 0x80088000,0x80000000, 0x88000, 0x88000,
- 0, 0x88000,0x80088000,0x80000000,
- 0x88000, 0x88000,0x80000000, 0,
- 0,0x80088000, 0x88000,0x80000000,
- 0x80088000,0x80000000, 0x88000, 0x88000,
- 0x80000000, 0x88000,0x80088000, 0,
- 0x80088000, 0, 0,0x80000000,
- 0x80088000,0x80088000,0x80000000, 0x88000,
- 0, 0x88000,0x80000000, 0,
- 0x80000000, 0, 0x88000,0x80088000,
- 0,0x80000000, 0x88000,0x80088000,
- },
- {
- 0x8800010, 0, 0x8800000, 0,
- 0x10, 0x8800010, 0x8800000, 0x8800000,
- 0x8800000, 0x10, 0x10, 0x8800000,
- 0x10, 0x8800000, 0, 0x10,
- 0, 0x8800010, 0x10, 0x8800000,
- 0x8800010, 0, 0, 0x10,
- 0x8800010, 0x8800010, 0x8800000, 0x10,
- 0, 0, 0x8800010, 0x8800010,
- 0x10, 0x8800000, 0x8800000, 0x8800010,
- 0x8800010, 0x10, 0x10, 0,
- 0, 0x8800010, 0, 0x10,
- 0x8800000, 0, 0x8800010, 0x8800010,
- 0x8800000, 0x8800000, 0, 0x10,
- 0x10, 0x8800010, 0x8800000, 0,
- 0x10, 0, 0x8800010, 0x8800000,
- 0x8800010, 0x10, 0, 0x8800000,
- },
- {
- 0,0x40001000, 0x1000, 0x1000,
- 0x40000000, 0, 0x1000,0x40001000,
- 0x1000,0x40000000,0x40000000, 0,
- 0x40001000, 0x1000, 0,0x40000000,
- 0,0x40000000,0x40001000, 0x1000,
- 0x1000,0x40001000,0x40000000, 0,
- 0x40000000, 0x1000,0x40001000,0x40000000,
- 0x40001000, 0, 0,0x40001000,
- 0x40001000, 0x1000, 0,0x40000000,
- 0x1000,0x40000000,0x40000000, 0x1000,
- 0,0x40001000,0x40001000,0x40000000,
- 0x40000000, 0,0x40001000, 0,
- 0x40001000, 0, 0,0x40001000,
- 0x40000000, 0x1000, 0x1000,0x40001000,
- 0x1000, 0,0x40000000, 0x1000,
- 0,0x40001000, 0x1000,0x40000000,
- },
- {
- 0x100008, 0x100000, 0x8, 0x100008,
- 0, 0, 0x100008, 0x8,
- 0x100000, 0x8, 0, 0x100008,
- 0x8, 0x100008, 0, 0,
- 0x8, 0x100000, 0x100000, 0x8,
- 0x100000, 0x100008, 0, 0x100000,
- 0x100008, 0, 0x8, 0x100000,
- 0x100000, 0x8, 0x100008, 0,
- 0x8, 0x100008, 0, 0x8,
- 0x100000, 0x100000, 0x8, 0,
- 0x100008, 0, 0x100000, 0x8,
- 0, 0x8, 0x100000, 0x100000,
- 0, 0x100008, 0x100008, 0,
- 0x100008, 0x8, 0x100000, 0x100008,
- 0x8, 0x100000, 0, 0x100008,
- 0x100008, 0, 0x8, 0x100000,
- },
- {
- 0,0x10000000, 0x44000,0x10044020,
- 0x10000020, 0x44000,0x10044020,0x10000000,
- 0x10000000, 0x20, 0x20,0x10044000,
- 0x44020,0x10000020,0x10044000, 0,
- 0x10044000, 0,0x10000020, 0x44020,
- 0x44000,0x10044020, 0, 0x20,
- 0x20, 0x44020,0x10044020,0x10000020,
- 0x10000000, 0x44000, 0x44020,0x10044000,
- 0x10044000, 0x44020,0x10000020,0x10000000,
- 0x10000000, 0x20, 0x20, 0x44000,
- 0,0x10044000,0x10044020, 0,
- 0x10044020, 0, 0x44000,0x10000020,
- 0x44020, 0x44000, 0,0x10044020,
- 0x10000020,0x10044000, 0x44020,0x10000000,
- 0x10044000,0x10000020, 0x44000, 0x44020,
- 0x20,0x10044020,0x10000000, 0x20,
- },
- {
- 0x440, 0x440, 0, 0x200000,
- 0x440, 0x200000, 0x200440, 0,
- 0x200440, 0x200440, 0x200000, 0,
- 0x200000, 0x440, 0, 0x200440,
- 0, 0x200440, 0x440, 0,
- 0x200000, 0x440, 0x200000, 0x440,
- 0x200440, 0, 0, 0x200440,
- 0x440, 0x200000, 0x200440, 0x200000,
- 0x200440, 0, 0x200000, 0x200440,
- 0x200000, 0x440, 0, 0x200000,
- 0, 0x200000, 0x440, 0,
- 0x440, 0x200440, 0x200000, 0x440,
- 0x200440, 0x200000, 0, 0x200440,
- 0x440, 0, 0x200440, 0,
- 0x200000, 0x440, 0x200440, 0x200000,
- 0, 0x200440, 0x440, 0x440,
- },
- {
- 0x4400000, 0x2000, 0x2000, 0x4,
- 0x4402004, 0x4400004, 0x4402000, 0,
- 0, 0x2004, 0x2004, 0x4400000,
- 0x4, 0x4402000, 0x4400000, 0x2004,
- 0x2004, 0x4400000, 0x4400004, 0x4402004,
- 0, 0x2000, 0x4, 0x4402000,
- 0x4400004, 0x4402004, 0x4402000, 0x4,
- 0x4402004, 0x4400004, 0x2000, 0,
- 0x4402004, 0x4400000, 0x4400004, 0x2004,
- 0x4400000, 0x2000, 0, 0x4400004,
- 0x2004, 0x4402004, 0x4402000, 0,
- 0x2000, 0x4, 0x4, 0x2000,
- 0, 0x2004, 0x2000, 0x4402000,
- 0x2004, 0x4400000, 0x4402004, 0,
- 0x4402000, 0x4, 0x4400004, 0x4402004,
- 0x4, 0x4402000, 0x4400000, 0x4400004,
- },
- {
- 0x880,0x20000000,0x20000880, 0,
- 0x20000000, 0x880, 0,0x20000880,
- 0x880, 0,0x20000000,0x20000880,
- 0x20000880,0x20000880, 0x880, 0,
- 0x20000000,0x20000880, 0x880,0x20000000,
- 0x20000880, 0x880, 0,0x20000000,
- 0, 0,0x20000880, 0x880,
- 0,0x20000000,0x20000000, 0x880,
- 0,0x20000000, 0x880,0x20000880,
- 0x20000880, 0, 0,0x20000000,
- 0x880,0x20000880,0x20000000, 0x880,
- 0x20000000, 0x880, 0x880,0x20000000,
- 0x20000880, 0, 0, 0x880,
- 0x20000000,0x20000880,0x20000880, 0,
- 0x880,0x20000000,0x20000880, 0,
- 0, 0x880,0x20000000,0x20000880,
- },
- },
- {
- {
- 0x2008, 0x8,0x20002000,0x20002008,
- 0x2000,0x20000008,0x20000008,0x20002000,
- 0x20000008, 0x2008, 0x2008,0x20000000,
- 0x20002000, 0x2000, 0,0x20000008,
- 0x8,0x20000000, 0x2000, 0x8,
- 0x20002008, 0x2008,0x20000000, 0x2000,
- 0x20000000, 0, 0x8,0x20002008,
- 0,0x20002000,0x20002008, 0,
- 0,0x20002008, 0x2000,0x20000008,
- 0x2008, 0x8,0x20000000, 0x2000,
- 0x20002008, 0, 0x8,0x20002000,
- 0x20000008,0x20000000,0x20002000, 0x2008,
- 0x20002008, 0x8, 0x2008,0x20002000,
- 0x2000,0x20000000,0x20000008, 0,
- 0x8, 0x2000,0x20002000, 0x2008,
- 0x20000000,0x20002008, 0,0x20000008,
- },
- {
- 0x4400010, 0, 0x10, 0x4400010,
- 0x4400000, 0, 0x4400000, 0x10,
- 0, 0x4400010, 0, 0x4400000,
- 0x10, 0x4400010, 0x4400010, 0,
- 0x10, 0x4400000, 0x4400010, 0,
- 0x10, 0x4400000, 0, 0x10,
- 0x4400000, 0x10, 0x4400010, 0x4400000,
- 0x4400000, 0x10, 0, 0x4400010,
- 0x10, 0x4400010, 0x4400000, 0x10,
- 0x4400010, 0x10, 0x4400000, 0,
- 0x4400000, 0, 0x10, 0x4400010,
- 0, 0x4400000, 0x10, 0x4400000,
- 0x4400010, 0, 0, 0x4400000,
- 0, 0x4400010, 0x10, 0x4400010,
- 0x4400010, 0x10, 0, 0x4400000,
- 0x4400000, 0, 0x4400010, 0x10,
- },
- {
- 0x10044000, 0x44004, 0,0x10044000,
- 0x10000004, 0x44000,0x10044000, 0x4,
- 0x44000, 0x4, 0x44004,0x10000000,
- 0x10044004,0x10000000,0x10000000,0x10044004,
- 0,0x10000004, 0x44004, 0,
- 0x10000000,0x10044004, 0x4,0x10044000,
- 0x10044004, 0x44000,0x10000004, 0x44004,
- 0x4, 0, 0x44000,0x10000004,
- 0x44004, 0,0x10000000, 0x4,
- 0x10000000,0x10000004, 0x44004,0x10044000,
- 0, 0x44004, 0x4,0x10044004,
- 0x10000004, 0x44000,0x10044004,0x10000000,
- 0x10000004,0x10044000, 0x44000,0x10044004,
- 0x4, 0x44000,0x10044000, 0x4,
- 0x44000, 0,0x10044004,0x10000000,
- 0x10044000,0x10000004, 0, 0x44004,
- },
- {
- 0x80000440, 0x100000,0x80000000,0x80100440,
- 0, 0x100440,0x80100000,0x80000440,
- 0x100440,0x80100000, 0x100000,0x80000000,
- 0x80100000,0x80000440, 0x440, 0x100000,
- 0x80100440, 0x440, 0,0x80000000,
- 0x440,0x80100000, 0x100440, 0,
- 0x80000000, 0,0x80000440, 0x100440,
- 0x100000,0x80100440,0x80100440, 0x440,
- 0x80100440,0x80000000, 0x440,0x80100000,
- 0x440, 0x100000,0x80000000, 0x100440,
- 0x80100000, 0, 0,0x80000440,
- 0,0x80100440, 0x100440, 0,
- 0x100000,0x80100440,0x80000440, 0x440,
- 0x80100440,0x80000000, 0x100000,0x80000440,
- 0x80000440, 0x440, 0x100440,0x80100000,
- 0x80000000, 0x100000,0x80100000, 0x100440,
- },
- {
- 0x88000, 0, 0, 0x88000,
- 0x88000, 0x88000, 0, 0x88000,
- 0, 0, 0x88000, 0,
- 0x88000, 0x88000, 0x88000, 0,
- 0, 0x88000, 0, 0,
- 0x88000, 0, 0, 0x88000,
- 0, 0x88000, 0x88000, 0,
- 0x88000, 0, 0, 0x88000,
- 0x88000, 0x88000, 0, 0x88000,
- 0, 0, 0x88000, 0x88000,
- 0x88000, 0, 0x88000, 0,
- 0, 0x88000, 0, 0,
- 0x88000, 0, 0, 0x88000,
- 0x88000, 0x88000, 0, 0,
- 0, 0x88000, 0x88000, 0,
- 0, 0, 0x88000, 0x88000,
- },
- {
- 0x8800000, 0x20, 0, 0x8800020,
- 0x20, 0, 0x8800000, 0x20,
- 0, 0x8800020, 0x20, 0x8800000,
- 0x8800000, 0x8800000, 0x8800020, 0x20,
- 0x20, 0x8800000, 0x8800020, 0,
- 0, 0, 0x8800020, 0x8800020,
- 0x8800020, 0x8800020, 0x8800000, 0,
- 0, 0x20, 0x20, 0x8800000,
- 0, 0x8800000, 0x8800000, 0x20,
- 0x8800020, 0x20, 0, 0x8800000,
- 0x8800000, 0, 0x8800020, 0x20,
- 0x20, 0x8800020, 0x20, 0,
- 0x8800020, 0x20, 0x20, 0x8800000,
- 0x8800000, 0x8800020, 0x20, 0,
- 0, 0x8800000, 0x8800000, 0x8800020,
- 0x8800020, 0, 0, 0x8800020,
- },
- {
- 0, 0, 0x1000,0x40001000,
- 0x40001000,0x40000000, 0, 0,
- 0x1000,0x40001000,0x40000000, 0x1000,
- 0x40000000, 0x1000, 0x1000,0x40000000,
- 0x40001000, 0,0x40000000,0x40001000,
- 0, 0x1000,0x40001000, 0,
- 0x40001000,0x40000000, 0x1000,0x40000000,
- 0x40000000,0x40001000, 0, 0x1000,
- 0x40000000, 0x1000,0x40001000,0x40000000,
- 0, 0, 0x1000,0x40001000,
- 0x40001000,0x40000000, 0, 0,
- 0,0x40001000,0x40000000, 0x1000,
- 0,0x40001000, 0x1000, 0,
- 0x40000000, 0,0x40001000, 0x1000,
- 0x1000,0x40000000,0x40000000,0x40001000,
- 0x40001000, 0x1000, 0x1000,0x40000000,
- },
- {
- 0x200880, 0x200880, 0, 0,
- 0x200000, 0x880, 0x200880, 0x200880,
- 0, 0x200000, 0x880, 0,
- 0x880, 0x200000, 0x200000, 0x200880,
- 0, 0x880, 0x880, 0x200000,
- 0x200880, 0x200000, 0, 0x880,
- 0x200000, 0x880, 0x200000, 0x200880,
- 0x880, 0, 0x200880, 0,
- 0x880, 0, 0x200000, 0x200880,
- 0, 0x200000, 0, 0x880,
- 0x200880, 0x200000, 0x200000, 0x880,
- 0x200880, 0, 0x880, 0x200000,
- 0x200880, 0x880, 0x200880, 0x200000,
- 0x880, 0, 0x200000, 0x200880,
- 0, 0x200880, 0x880, 0,
- 0x200000, 0x200880, 0, 0x880,
- },
- },
-};
-
-/* compressed/interleaved => final permutation table */
-static const C_block CF6464[64/CHUNKBITS][1<<CHUNKBITS] = {
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 64,}},
- {{ 0, 0, 0, 0, 0, 0, 64, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 64, 64,}},
- {{ 0, 0, 0, 0, 0, 64, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 64, 0, 64,}},
- {{ 0, 0, 0, 0, 0, 64, 64, 0,}},
- {{ 0, 0, 0, 0, 0, 64, 64, 64,}},
- {{ 0, 0, 0, 0, 64, 0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}},
- {{ 0, 0, 0, 0,128,128, 0, 0,}},
- {{ 0, 0, 0, 0,128,128, 0,128,}},
- {{ 0, 0, 0, 0,128,128,128, 0,}},
- {{ 0, 0, 0, 0,128,128,128,128,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 0, 8,}},
- {{ 0, 0, 0, 0, 0, 0, 8, 0,}},
- {{ 0, 0, 0, 0, 0, 0, 8, 8,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 0, 8,}},
- {{ 0, 0, 0, 0, 0, 8, 8, 0,}},
- {{ 0, 0, 0, 0, 0, 8, 8, 8,}},
- {{ 0, 0, 0, 0, 8, 0, 0, 0,}},
- {{ 0, 0, 0, 0, 8, 0, 0, 8,}},
- {{ 0, 0, 0, 0, 8, 0, 8, 0,}},
- {{ 0, 0, 0, 0, 8, 0, 8, 8,}},
- {{ 0, 0, 0, 0, 8, 8, 0, 0,}},
- {{ 0, 0, 0, 0, 8, 8, 0, 8,}},
- {{ 0, 0, 0, 0, 8, 8, 8, 0,}},
- {{ 0, 0, 0, 0, 8, 8, 8, 8,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0,128, 0, 0, 0, 0,}},
- {{ 0, 0,128, 0, 0, 0, 0, 0,}},
- {{ 0, 0,128,128, 0, 0, 0, 0,}},
- {{ 0,128, 0, 0, 0, 0, 0, 0,}},
- {{ 0,128, 0,128, 0, 0, 0, 0,}},
- {{ 0,128,128, 0, 0, 0, 0, 0,}},
- {{ 0,128,128,128, 0, 0, 0, 0,}},
- {{128, 0, 0, 0, 0, 0, 0, 0,}},
- {{128, 0, 0,128, 0, 0, 0, 0,}},
- {{128, 0,128, 0, 0, 0, 0, 0,}},
- {{128, 0,128,128, 0, 0, 0, 0,}},
- {{128,128, 0, 0, 0, 0, 0, 0,}},
- {{128,128, 0,128, 0, 0, 0, 0,}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 0, 0, 0, 0,}},
- },
- {
- {{ 0, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 0, 2, 0, 0, 0, 0,}},
- {{ 0, 0, 2, 0, 0, 0, 0, 0,}},
- {{ 0, 0, 2, 2, 0, 0, 0, 0,}},
- {{ 0, 2, 0, 0, 0, 0, 0, 0,}},
- {{ 0, 2, 0, 2, 0, 0, 0, 0,}},
- {{ 0, 2, 2, 0, 0, 0, 0, 0,}},
- {{ 0, 2, 2, 2, 0, 0, 0, 0,}},
- {{ 2, 0, 0, 0, 0, 0, 0, 0,}},
- {{ 2, 0, 0, 2, 0, 0, 0, 0,}},
- {{ 2, 0, 2, 0, 0, 0, 0, 0,}},
- {{ 2, 0, 2, 2, 0, 0, 0, 0,}},
- {{ 2, 2, 0, 0, 0, 0, 0, 0,}},
- {{ 2, 2, 0, 2, 0, 0, 0, 0,}},
- {{ 2, 2, 2, 0, 0, 0, 0, 0,}},
- {{ 2, 2, 2, 2, 0, 0, 0, 0,}},
- },
-};
-
-#define HAVE_DES_TABLES 1
-#endif
diff --git a/missing/explicit_bzero.c b/missing/explicit_bzero.c
deleted file mode 100644
index a7ff9cb517..0000000000
--- a/missing/explicit_bzero.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef __STDC_WANT_LIB_EXT1__
-#define __STDC_WANT_LIB_EXT1__ 1
-#endif
-
-#include "ruby/missing.h"
-#include <string.h>
-#ifdef HAVE_MEMSET_S
-# include <string.h>
-#endif
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-/* Similar to bzero(), but has a guarantee not to be eliminated from compiler
- optimization. */
-
-/* OS support note:
- * BSDs have explicit_bzero().
- * OS-X has memset_s().
- * Windows has SecureZeroMemory() since XP.
- * Linux has none. *Sigh*
- */
-
-/*
- * Following URL explains why memset_s is added to the standard.
- * http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1381.pdf
- */
-
-#ifndef FUNC_UNOPTIMIZED
-# define FUNC_UNOPTIMIZED(x) x
-#endif
-
-#undef explicit_bzero
-#ifndef HAVE_EXPLICIT_BZERO
- #ifdef HAVE_MEMSET_S
-void
-explicit_bzero(void *b, size_t len)
-{
- memset_s(b, len, 0, len);
-}
- #elif defined SecureZeroMemory
-void
-explicit_bzero(void *b, size_t len)
-{
- SecureZeroMemory(b, len);
-}
-
- #elif defined HAVE_FUNC_WEAK
-
-/* A weak function never be optimized away. Even if nobody uses it. */
-WEAK(void ruby_explicit_bzero_hook_unused(void *buf, size_t len));
-void
-ruby_explicit_bzero_hook_unused(void *buf, size_t len)
-{
-}
-
-void
-explicit_bzero(void *b, size_t len)
-{
- memset(b, 0, len);
- ruby_explicit_bzero_hook_unused(b, len);
-}
-
- #else /* Your OS have no capability. Sigh. */
-
-FUNC_UNOPTIMIZED(void explicit_bzero(void *b, size_t len));
-#undef explicit_bzero
-
-void
-explicit_bzero(void *b, size_t len)
-{
- /*
- * volatile is not enough if the compiler has an LTO (link time
- * optimization). At least, the standard provides no guarantee.
- * However, gcc and major other compilers never optimize a volatile
- * variable away. So, using volatile is practically ok.
- */
- volatile char* p = (volatile char*)b;
-
- while(len) {
- *p = 0;
- p++;
- len--;
- }
-}
- #endif
-#endif /* HAVE_EXPLICIT_BZERO */
diff --git a/missing/flock.c b/missing/flock.c
index 71c5e74210..829f431ddc 100644
--- a/missing/flock.c
+++ b/missing/flock.c
@@ -2,7 +2,7 @@
#include "ruby/ruby.h"
#if defined _WIN32
-#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
+#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H && !defined(__native_client__)
/* These are the flock() constants. Since this systems doesn't have
flock(), the values of the constants are probably not available.
diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c
index 01066d2930..6d2f38f40c 100644
--- a/missing/lgamma_r.c
+++ b/missing/lgamma_r.c
@@ -66,7 +66,7 @@ lgamma_r(double x, int *signp)
double i, f, s;
f = modf(-x, &i);
if (f == 0.0) { /* pole error */
- *signp = signbit(x) ? -1 : 1;
+ *signp = 1;
errno = ERANGE;
return HUGE_VAL;
}
diff --git a/missing/os2.c b/missing/os2.c
new file mode 100644
index 0000000000..27dc2f1964
--- /dev/null
+++ b/missing/os2.c
@@ -0,0 +1,138 @@
+/* os/2 compatibility functions -- follows Ruby's license */
+
+#include "ruby.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <process.h>
+#include <limits.h>
+#include <errno.h>
+
+#define INCL_DOS
+#include <os2.h>
+
+int
+chown(char *path, int owner, int group)
+{
+ return 0;
+}
+
+#if 0
+int
+link(char *from, char *to)
+{
+ return -1;
+}
+#endif
+
+#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD) \
+ || defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
+#include <unistd.h>
+
+#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD)
+/* to handle the drive letter and DBCS characters within a given path */
+char *
+getcwd(char *path, size_t len)
+{
+ return _getcwd2(path, (int)len);
+}
+#endif
+
+#if defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR)
+/* to handle the drive letter and DBCS characters within a given path */
+int
+chdir(__const__ char *path)
+{
+ return _chdir2(path);
+}
+#endif
+#endif
+
+typedef char* CHARP;
+
+int
+do_spawn(cmd)
+char *cmd;
+{
+ register char **a;
+ register char *s;
+ char **argv;
+ char *shell, *sw, *cmd2;
+ int status;
+
+ if ((shell = getenv("RUBYSHELL")) != NULL && *shell != '\0') {
+ s = shell;
+ do
+ *s = isupper(*s) ? tolower(*s) : *s;
+ while (*++s);
+ if (strstr(shell, "cmd") || strstr(shell, "4os2"))
+ sw = "/c";
+ else
+ sw = "-c";
+ } else if ((shell = getenv("SHELL")) != NULL && *shell != '\0') {
+ s = shell;
+ do
+ *s = isupper(*s) ? tolower(*s) : *s;
+ while (*++s);
+ if (strstr(shell, "cmd") || strstr(shell, "4os2"))
+ sw = "/c";
+ else
+ sw = "-c";
+ } else if ((shell = getenv("COMSPEC")) != NULL && *shell != '\0') {
+ s = shell;
+ do
+ *s = isupper(*s) ? tolower(*s) : *s;
+ while (*++s);
+ if (strstr(shell, "cmd") || strstr(shell, "4os2"))
+ sw = "/c";
+ else
+ sw = "-c";
+ }
+ /* see if there are shell metacharacters in it */
+ /*SUPPRESS 530*/
+ /* for (s = cmd; *s && isalpha(*s); s++) ;
+ if (*s == '=')
+ goto doshell; */
+ for (s = cmd; *s; s++) {
+ if (*sw == '-' && *s != ' ' &&
+ !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) {
+ if (*s == '\n' && !s[1]) {
+ *s = '\0';
+ break;
+ }
+ goto doshell;
+ } else if (*sw == '/' && *s != ' ' &&
+ !isalpha(*s) && index("^()<>|&\n",*s)) {
+ if (*s == '\n' && !s[1]) {
+ *s = '\0';
+ break;
+ }
+ doshell:
+ status = spawnlp(P_WAIT,shell,shell,sw,cmd,(char*)NULL);
+ return status;
+ }
+ }
+ argv = ALLOC_N(CHARP,(strlen(cmd) / 2 + 2));
+ cmd2 = ALLOC_N(char, (strlen(cmd) + 1));
+ strcpy(cmd2, cmd);
+ a = argv;
+ for (s = cmd2; *s;) {
+ while (*s && isspace(*s)) s++;
+ if (*s)
+ *(a++) = s;
+ while (*s && !isspace(*s)) s++;
+ if (*s)
+ *s++ = '\0';
+ }
+ *a = NULL;
+ if (argv[0]) {
+ if ((status = spawnvp(P_WAIT, argv[0], argv)) == -1) {
+ free(argv);
+ free(cmd2);
+ return -1;
+ }
+ }
+ free(cmd2);
+ free(argv);
+ return status;
+}
diff --git a/missing/setproctitle.c b/missing/setproctitle.c
index 9fceeee52b..9dcf37560b 100644
--- a/missing/setproctitle.c
+++ b/missing/setproctitle.c
@@ -35,7 +35,6 @@
#include "ruby.h"
#include "ruby/util.h"
#define compat_init_setproctitle ruby_init_setproctitle
-RUBY_FUNC_EXPORTED void ruby_init_setproctitle(int argc, char *argv[]);
#ifndef HAVE_SETPROCTITLE
@@ -75,7 +74,6 @@ RUBY_FUNC_EXPORTED void ruby_init_setproctitle(int argc, char *argv[]);
static char *argv_start = NULL;
static size_t argv_env_len = 0;
static size_t argv_len = 0;
-static char **argv1_addr = NULL;
#endif
#endif /* HAVE_SETPROCTITLE */
@@ -121,9 +119,7 @@ compat_init_setproctitle(int argc, char *argv[])
lastenvp = envp[i] + strlen(envp[i]);
}
- /* We keep argv[1], argv[2], etc. at this moment,
- because the ps command of AIX refers to them. */
- argv1_addr = &argv[1];
+ argv[1] = NULL;
argv_start = argv[0];
argv_len = lastargv - argv[0];
argv_env_len = lastenvp - argv[0];
@@ -166,8 +162,6 @@ setproctitle(const char *fmt, ...)
argvlen = len > argv_len ? argv_env_len : argv_len;
for(; len < argvlen; len++)
argv_start[len] = SPT_PADCHAR;
- /* argv[1], argv[2], etc. are no longer valid. */
- *argv1_addr = NULL;
#endif
#endif /* SPT_NONE */
diff --git a/missing/stdbool.h b/missing/stdbool.h
deleted file mode 100644
index 68c2f3d254..0000000000
--- a/missing/stdbool.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * missing/stdbool.h: Quick alternative of C99 stdbool.h
- */
-
-#ifndef _MISSING_STDBOOL_H_
-#define _MISSING_STDBOOL_H_
-
-#ifndef __cplusplus
-
-#define bool _Bool
-#define true 1
-#define false 0
-
-#ifndef HAVE__BOOL /* AC_HEADER_STDBOOL in configure.ac */
-typedef int _Bool;
-#endif /* HAVE__BOOL */
-
-#endif /* __cplusplus */
-
-#endif /* _MISSING_STDBOOL_H_ */
diff --git a/missing/strerror.c b/missing/strerror.c
index d3b61c3f12..907b5aee0d 100644
--- a/missing/strerror.c
+++ b/missing/strerror.c
@@ -13,6 +13,6 @@ strerror(int error)
if (error <= sys_nerr && error > 0) {
return sys_errlist[error];
}
- snprintf(msg, sizeof(msg), "Unknown error (%d)", error);
+ sprintf(msg, "Unknown error (%d)", error);
return msg;
}
diff --git a/missing/strlcat.c b/missing/strlcat.c
index 7749afa4fd..4e2d7cc85a 100644
--- a/missing/strlcat.c
+++ b/missing/strlcat.c
@@ -1,56 +1,74 @@
-/* $OpenBSD: strlcat.c,v 1.15 2015/03/02 21:41:08 millert Exp $ */
+/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */
/*
- * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * 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.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * 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.
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
#include "ruby/missing.h"
#include <sys/types.h>
#include <string.h>
/*
- * Appends src to string dst of size dsize (unlike strncat, dsize is the
- * full size of dst, not space left). At most dsize-1 characters
- * will be copied. Always NUL terminates (unless dsize <= strlen(dst)).
- * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
- * If retval >= dsize, truncation occurred.
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
*/
size_t
-strlcat(char *dst, const char *src, size_t dsize)
+strlcat(dst, src, siz)
+ char *dst;
+ const char *src;
+ size_t siz;
{
- const char *odst = dst;
- const char *osrc = src;
- size_t n = dsize;
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
size_t dlen;
- /* Find the end of dst and adjust bytes left but don't go past end. */
- while (n-- != 0 && *dst != '\0')
- dst++;
- dlen = dst - odst;
- n = dsize - dlen;
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
- if (n-- == 0)
- return(dlen + strlen(src));
- while (*src != '\0') {
- if (n != 0) {
- *dst++ = *src;
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
n--;
}
- src++;
+ s++;
}
- *dst = '\0';
+ *d = '\0';
- return(dlen + (src - osrc)); /* count does not include NUL */
+ return(dlen + (s - src)); /* count does not include NUL */
}
diff --git a/missing/strlcpy.c b/missing/strlcpy.c
index 6607574f80..2ebc38f98f 100644
--- a/missing/strlcpy.c
+++ b/missing/strlcpy.c
@@ -1,51 +1,70 @@
-/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
/*
- * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * 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.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * 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.
*/
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
#include "ruby/missing.h"
#include <sys/types.h>
#include <string.h>
/*
- * Copy string src to buffer dst of size dsize. At most dsize-1
- * chars will be copied. Always NUL terminates (unless dsize == 0).
- * Returns strlen(src); if retval >= dsize, truncation occurred.
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
-strlcpy(char *dst, const char *src, size_t dsize)
+strlcpy(dst, src, siz)
+ char *dst;
+ const char *src;
+ size_t siz;
{
- const char *osrc = src;
- size_t nleft = dsize;
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
- /* Copy as many bytes as will fit. */
- if (nleft != 0) {
- while (--nleft != 0) {
- if ((*dst++ = *src++) == '\0')
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ if ((*d++ = *s++) == 0)
break;
- }
+ } while (--n != 0);
}
- /* Not enough room in dst, add NUL and traverse rest of src. */
- if (nleft == 0) {
- if (dsize != 0)
- *dst = '\0'; /* NUL-terminate dst */
- while (*src++)
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
;
}
- return(src - osrc - 1); /* count does not include NUL */
+ return(s - src - 1); /* count does not include NUL */
}
diff --git a/missing/strtol.c b/missing/strtol.c
new file mode 100644
index 0000000000..87bd73124c
--- /dev/null
+++ b/missing/strtol.c
@@ -0,0 +1,27 @@
+/* public domain rewrite of strtol(3) */
+
+#include "ruby/missing.h"
+#include <ctype.h>
+
+long
+strtol(const char *nptr, char **endptr, int base)
+{
+ long result;
+ const char *p = nptr;
+
+ while (isspace(*p)) {
+ p++;
+ }
+ if (*p == '-') {
+ p++;
+ result = -strtoul(p, endptr, base);
+ }
+ else {
+ if (*p == '+') p++;
+ result = strtoul(p, endptr, base);
+ }
+ if (endptr != 0 && *endptr == p) {
+ *endptr = (char *)nptr;
+ }
+ return result;
+}
diff --git a/missing/tgamma.c b/missing/tgamma.c
index 6260e4f519..5e306fbb43 100644
--- a/missing/tgamma.c
+++ b/missing/tgamma.c
@@ -10,26 +10,33 @@ reference - Haruhiko Okumura: C-gengo niyoru saishin algorithm jiten
gamma.c -- Gamma function
***********************************************************/
#include "ruby/config.h"
-#include "ruby/missing.h"
#include <math.h>
#include <errno.h>
-#ifdef _WIN32
-# include <float.h>
-# if !defined __MINGW32__ || defined __NO_ISOCEXT
-# ifndef isnan
-# define isnan(x) _isnan(x)
-# endif
-# ifndef isinf
-# define isinf(x) (!_finite(x) && !_isnan(x))
-# endif
-# ifndef finite
-# define finite(x) _finite(x)
-# endif
-# endif
-#endif
+#ifdef HAVE_LGAMMA_R
+
+double tgamma(double x)
+{
+ int sign;
+ double d;
+ if (x == 0.0) { /* Pole Error */
+ errno = ERANGE;
+ return 1/x < 0 ? -HUGE_VAL : HUGE_VAL;
+ }
+ if (x < 0) {
+ static double zero = 0.0;
+ double i, f;
+ f = modf(-x, &i);
+ if (f == 0.0) { /* Domain Error */
+ errno = EDOM;
+ return zero/zero;
+ }
+ }
+ d = lgamma_r(x, &sign);
+ return sign * exp(d);
+}
-#ifndef HAVE_LGAMMA_R
+#else
#include <errno.h>
#define PI 3.14159265358979324 /* $\pi$ */
@@ -61,37 +68,25 @@ loggamma(double x) /* the natural logarithm of the Gamma function. */
+ (B4 / ( 4 * 3))) * w + (B2 / ( 2 * 1))) / x
+ 0.5 * LOG_2PI - log(v) - x + (x - 0.5) * log(x);
}
-#endif
double tgamma(double x) /* Gamma function */
{
- int sign;
if (x == 0.0) { /* Pole Error */
errno = ERANGE;
return 1/x < 0 ? -HUGE_VAL : HUGE_VAL;
}
- if (isinf(x)) {
- if (x < 0) goto domain_error;
- return x;
- }
if (x < 0) {
+ int sign;
static double zero = 0.0;
double i, f;
f = modf(-x, &i);
if (f == 0.0) { /* Domain Error */
- domain_error:
errno = EDOM;
return zero/zero;
}
-#ifndef HAVE_LGAMMA_R
sign = (fmod(i, 2.0) != 0.0) ? 1 : -1;
return sign * PI / (sin(PI * f) * exp(loggamma(1 - x)));
-#endif
}
-#ifndef HAVE_LGAMMA_R
return exp(loggamma(x));
-#else
- x = lgamma_r(x, &sign);
- return sign * exp(x);
-#endif
}
+#endif
diff --git a/nacl/GNUmakefile.in b/nacl/GNUmakefile.in
new file mode 100644
index 0000000000..c1aaa36c7c
--- /dev/null
+++ b/nacl/GNUmakefile.in
@@ -0,0 +1,87 @@
+# Copyright 2012 Google Inc. All Rights Reserved.
+# Author: yugui@google.com (Yugui Sonoda)
+
+include Makefile
+-include uncommon.mk
+
+NACL_SDK_ROOT=@NACL_SDK_ROOT@
+NACL_TOOLCHAIN=@NACL_TOOLCHAIN@
+NACL_TOOLCHAIN_DIR=$(NACL_SDK_ROOT)/toolchain/$(NACL_TOOLCHAIN)
+CC:=$(NACL_TOOLCHAIN_DIR)/bin/$(CC)
+LD:=$(NACL_TOOLCHAIN_DIR)/bin/$(LD)
+NM:=$(NACL_TOOLCHAIN_DIR)/bin/$(NM)
+AR:=$(NACL_TOOLCHAIN_DIR)/bin/$(AR)
+AS:=$(NACL_TOOLCHAIN_DIR)/bin/$(AS)
+RANLIB:=$(NACL_TOOLCHAIN_DIR)/bin/$(RANLIB)
+OBJDUMP:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJDUMP)
+OBJCOPY:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJCOPY)
+PYTHON=@PYTHON@
+
+PPROGRAM=pepper-$(PROGRAM)
+PEPPER_LIBS=-lppapi
+PROGRAM_NMF=$(PROGRAM:.nexe=.nmf)
+PPROGRAM_NMF=$(PPROGRAM:.nexe=.nmf)
+
+GNUmakefile: $(srcdir)/nacl/GNUmakefile.in
+$(PPROGRAM): $(PROGRAM) pepper_main.$(OBJEXT)
+ $(Q)$(MAKE) $(MFLAGS) PROGRAM=$(PPROGRAM) MAINOBJ="pepper_main.$(OBJEXT)" LIBS="$(LIBS) $(PEPPER_LIBS)" program
+$(PROGRAM_NMF) $(PPROGRAM_NMF): $(@:.nmf=.nexe) nacl/create_nmf.rb
+
+.PHONY: pprogram package show_naclflags
+.SUFFIXES: .nexe .nmf
+.nexe.nmf:
+ $(ECHO) generating manifest $@
+ $(Q)$(MINIRUBY) $(srcdir)/nacl/create_nmf.rb --verbose=$(V) $(@:.nmf=.nexe) $@
+
+pepper_main.$(OBJEXT): $(srcdir)/nacl/pepper_main.c
+ @$(ECHO) compiling nacl/pepper_main.c
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(srcdir)/nacl/pepper_main.c
+ruby.$(OBJEXT):
+ @$(ECHO) compiling $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
+ $(Q) $(OBJCOPY) --weaken-symbol=rb_load_file $@.tmp $@
+ @-$(RM) $@.tmp
+file.$(OBJEXT):
+ @$(ECHO) compiling $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
+ $(Q) $(OBJCOPY) --weaken-symbol=rb_file_load_ok $@.tmp $@
+ @-$(RM) $@.tmp
+
+.rbconfig.time:
+ @$(MAKE) .rbconfig.raw.time RBCONFIG=.rbconfig.raw.time
+ @sed \
+ -e 's!CONFIG\["CC"\] = .*!CONFIG\["CC"\] = "$(CC)"!' \
+ -e 's!CONFIG\["LD"\] = .*!CONFIG\["LD"\] = "$(LD)"!' \
+ -e 's!CONFIG\["NM"\] = .*!CONFIG\["NM"\] = "$(NM)"!' \
+ -e 's!CONFIG\["AR"\] = .*!CONFIG\["AR"\] = "$(AR)"!' \
+ -e 's!CONFIG\["AS"\] = .*!CONFIG\["AS"\] = "$(AS)"!' \
+ -e 's!CONFIG\["RANLIB"\] = .*!CONFIG\["RANLIB"\] = "$(RANLIB)"!' \
+ -e 's!CONFIG\["OBJDUMP"\] = .*!CONFIG\["OBJDUMP"\] = "$(OBJDUMP)"!' \
+ -e 's!CONFIG\["OBJCOPY"\] = .*!CONFIG\["OBJCOPY"\] = "$(OBJCOPY)"!' \
+ -i.bak rbconfig.rb
+ @touch .rbconfig.time
+
+all: pprogram
+main: $(PROGRAM_NMF)
+pprogram: showflags $(PPROGRAM) $(PPROGRAM_NMF)
+program: $(PROGRAM_NMF)
+prog: pprogram
+
+package: pprogram install-lib install-ext-comm install-ext-arch
+ $(INSTALL_DATA) $(srcdir)/nacl/example.html $(prefix)
+ $(ECHO) generating manifest $@
+ $(Q)$(MINIRUBY) $(srcdir)/nacl/package.rb $(prefix)
+
+showflags: show_naclflags
+
+show_naclflags:
+ @echo " NACL_SDK_ROOT = $(NACL_SDK_ROOT)"
+ @echo " NM = $(NM)"
+ @echo " AR = $(AR)"
+ @echo " AS = $(AS)"
+ @echo " RANLIB = $(RANLIB)"
+ @echo " OBJDUMP = $(OBJDUMP)"
+ @echo " OBJCOPY = $(OBJCOPY)"
+
+clean-local::
+ -$(RM) $(PPROGRAM) pepper_main.$(OBJEXT) $(PROGRAM_NMF) $(PPRGORAM_NMF)
diff --git a/nacl/README.nacl b/nacl/README.nacl
new file mode 100644
index 0000000000..471c3b5e5f
--- /dev/null
+++ b/nacl/README.nacl
@@ -0,0 +1,34 @@
+=begin
+= Native Client port of Ruby
+
+= How to build
+== Prerequisites
+You need to install the following things before building NaCl port of Ruby.
+* Ruby 1.9.3 or later
+* Python 2.6 or later
+* NativeClient SDK pepper 22 or later
+* GNU make
+
+== Steps
+(1) Extract all files from the tarball:
+ $ tar xzf ruby-X.Y.Z.tar.gz
+(2) Set NACL_SDK_ROOT environment variable to the path to the Native Client SDK you installed:
+ $ export NACL_SDK_ROOT=/home/yugui/src/nacl_sdk/pepper_16
+(3) Configure
+ $ ./configure --prefix=/tmp/nacl-ruby --host=x86_64-nacl --with-baseruby=/path/to/ruby-1.9.3
+(4) Make
+ $ make
+ $ make package
+
+Now you have ruby.nexe. You can run it by sel_ldr in NaCl SDK.
+
+"make package" installs "pepper-ruby.nexe", an example Pepper application that
+embeds Ruby", and libraries to $prefix. You can run it by the following steps:
+(5) Publish the $prefix directory on a web server
+(6) Visit the example.html on the web server by a browser that implements Pepper 18 or later.
+ -- e.g., Chrome 18 implements Pepper 18, Chrome 19 implements Pepper 19, ...
+
+= Copyright
+* Copyright 2012 Google Inc. All Rights Reserved.
+* Author: yugui@google.com (Yugui Sonoda)
+=end
diff --git a/nacl/create_nmf.rb b/nacl/create_nmf.rb
new file mode 100644
index 0000000000..cdfe7ad239
--- /dev/null
+++ b/nacl/create_nmf.rb
@@ -0,0 +1,70 @@
+#!/usr/bin/ruby
+# Copyright:: Copyright 2012 Google Inc.
+# License:: All Rights Reserved.
+# Original Author:: Yugui Sonoda (mailto:yugui@google.com)
+#
+# Wrapper for create_nmf.py / generate_nmf.py
+
+require File.join(File.dirname(__FILE__), 'nacl-config')
+
+include NaClConfig
+$verbosity = 0
+
+def usage_and_exit
+ $stderr.puts "Usage: #{$PROGRAM_NAME} [--verbose=N] path/to/input.nexe path/to/output.nmf"
+ exit false
+end
+
+def create_dynamically_linked(nmf, exe)
+ cmd = [
+ PYTHON, CREATE_NMF,
+ '-o', nmf,
+ '-D', OBJDUMP,
+ '-L', HOST_LIB,
+ exe
+ ]
+ puts cmd.join(' ') if $verbosity > 0
+ exec(*cmd)
+end
+
+def create_statically_linked(nmf, exe)
+ File.open(nmf, "w") {|f|
+ f.write <<-EOS.gsub(/^ {6}/, '')
+ {
+ "program": {
+ "#{ARCH}": {
+ "url": "#{exe}"
+ }
+ }
+ }
+ EOS
+ }
+end
+
+def main
+ while m = ARGV.first.match(/--([a-z-]+)(?:=(\S+))?/)
+ case m[1]
+ when 'verbose'
+ usage_and_exit unless m[2][/\A[0-9]+\z/]
+ $verbosity = m[2].to_i
+ when 'help'
+ usage_end_exit
+ end
+ ARGV.shift
+ end
+
+ usage_and_exit if ARGV.size < 2
+
+ exe, nmf = ARGV[0], ARGV[1]
+ if newlib?
+ create_statically_linked(nmf, exe)
+ else
+ create_dynamically_linked(nmf, exe)
+ end
+end
+
+if __FILE__ == $0
+ main()
+end
+
+
diff --git a/nacl/dirent.h b/nacl/dirent.h
new file mode 100644
index 0000000000..31bdad31b7
--- /dev/null
+++ b/nacl/dirent.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2011 Google Inc. All Rights Reserved.
+ * Author: yugui@google.com (Yugui Sonoda)
+ */
+#ifndef RUBY_NACL_DIRENT_H
+#define RUBY_NACL_DIRENT_H
+
+/* NaCl SDK 0.3 has implementations of dir functions but no declaration in
+ * dirent.h */
+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
+void rewinddir(DIR *dirp);
+long telldir(DIR *dirp);
+void seekdir(DIR *dirp, long offset);
+
+#endif
diff --git a/nacl/example.html b/nacl/example.html
new file mode 100644
index 0000000000..3cc33298dd
--- /dev/null
+++ b/nacl/example.html
@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Ruby Example</title>
+
+ <script type="text/javascript">
+ RubyModule = null; // Global application object.
+ statusText = 'NO-STATUS';
+ rubyReady = false;
+
+ // Indicate load success.
+ function moduleDidLoad() {
+ RubyModule = document.getElementById('ruby');
+ form = document.getElementById('source-form');
+ form.style.display = "block";
+ updateStatus('SUCCESS');
+ }
+
+ function evalSource() {
+ if (rubyReady) {
+ RubyModule.postMessage('eval:' + document.getElementById("source").value);
+ } else {
+ throw "Not yet ready";
+ }
+ return false;
+ }
+
+ function RubyError(message) {
+ this.message = message;
+ this.toString = function() {
+ return message;
+ }
+ }
+
+ function FatalError(message) {
+ this.message = message;
+ }
+
+ // The 'message' event handler. This handler is fired when the NaCl module
+ // posts a message to the browser by calling PPB_Messaging.PostMessage()
+ // (in C) or pp::Instance.PostMessage() (in C++). This implementation
+ // simply displays the content of the message in an alert panel.
+ function handleMessage(message_event) {
+ var raw = message_event.data;
+ var components;
+ if (raw.indexOf("error") == 0) {
+ components = raw.split(":", 2);
+ throw new RubyError(components[1]);
+ } else if (raw.indexOf("return") == 0) {
+ components = raw.split(":", 2);
+ document.getElementById("result").value = components[1];
+ } else if (raw == "rubyReady") {
+ rubyReady = true;
+ } else {
+ throw new FatalError(raw);
+ }
+ }
+
+ // If the page loads before the Native Client module loads, then set the
+ // status message indicating that the module is still loading. Otherwise,
+ // do not change the status message.
+ function pageDidLoad() {
+ if (RubyModule == null) {
+ updateStatus('LOADING...');
+ } else {
+ // It's possible that the Native Client module onload event fired
+ // before the page's onload event. In this case, the status message
+ // will reflect 'SUCCESS', but won't be displayed. This call will
+ // display the current message.
+ updateStatus();
+ }
+ }
+
+ // Set the global status message. If the element with id 'statusField'
+ // exists, then set its HTML to the status message as well.
+ // opt_message The message test. If this is null or undefined, then
+ // attempt to set the element with id 'statusField' to the value of
+ // |statusText|.
+ function updateStatus(opt_message) {
+ if (opt_message)
+ statusText = opt_message;
+ var statusField = document.getElementById('status_field');
+ if (statusField) {
+ statusField.innerHTML = statusText;
+ }
+ }
+ </script>
+</head>
+<body onload="pageDidLoad()">
+
+<h1>Native Client Module Ruby</h1>
+<p>
+ <!-- Load the published .nexe. This includes the 'nacl' attribute which
+ shows how to load multi-architecture modules. Each entry in the "nexes"
+ object in the .nmf manifest file is a key-value pair: the key is the
+ instruction set architecture ('x86-32', 'x86-64', etc.); the value is a URL
+ for the desired NaCl module.
+ To load the debug versions of your .nexes, set the 'nacl' attribute to the
+ _dbg.nmf version of the manifest file.
+
+ Note: Since this NaCl module does not use any real-estate in the browser,
+ it's width and height are set to 0.
+
+ Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
+ and a 'message' event listener attached. This wrapping method is used
+ instead of attaching the event listeners directly to the <EMBED> element to
+ ensure that the listeners are active before the NaCl module 'load' event
+ fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or
+ pp::Instance.PostMessage() (in C++) from within the initialization code in
+ your NaCl module.
+ -->
+ <div id="listener">
+ <script type="text/javascript">
+ var listener = document.getElementById('listener');
+ listener.addEventListener('load', moduleDidLoad, true);
+ listener.addEventListener('message', handleMessage, true);
+ </script>
+
+ <embed name="nacl_module"
+ id="ruby"
+ width="0" height="0"
+ src="ruby.nmf"
+ type="application/x-nacl" />
+ <form id="source-form" action="#" method="post" style="display:none"
+ onsubmit="evalSource(); return false">
+ <table>
+ <tbody>
+ <tr>
+ <th>Source</th>
+ <td>
+ <textarea rows="10" cols="80" id="source"></textarea>
+ <input type="submit" />
+ </td>
+ </tr>
+ <tr>
+ <th>Result</th>
+ <td>
+ <textarea rows="10" cols="80" id="result"></textarea>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+ </div>
+</p>
+
+<h2>Status</h2>
+<div id="status_field">NO-STATUS</div>
+</body>
+</html>
diff --git a/nacl/ioctl.h b/nacl/ioctl.h
new file mode 100644
index 0000000000..0a18eeb3f5
--- /dev/null
+++ b/nacl/ioctl.h
@@ -0,0 +1,7 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
+// Author: yugui@google.com (Yugui Sonoda)
+#ifndef RUBY_NACL_IOCTL_H
+#define RUBY_NACL_IOCTL_H
+int ioctl(int fd, int request, ...);
+struct flock{};
+#endif
diff --git a/nacl/nacl-config.rb b/nacl/nacl-config.rb
new file mode 100755
index 0000000000..2da05c0847
--- /dev/null
+++ b/nacl/nacl-config.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/ruby
+#
+# Copyright:: Copyright 2012 Google Inc.
+# License:: All Rights Reserved.
+# Original Author:: Yugui Sonoda (mailto:yugui@google.com)
+#
+# Convenient functions/constants for native client specific configurations.
+require 'rbconfig'
+
+module NaClConfig
+ config = RbConfig::CONFIG
+
+ cpu_nick = config['host_alias'].sub(/-gnu$|-newlib$/, '').sub(/-nacl$/, '').sub(/i.86/, 'x86_32')
+ ARCH = cpu_nick.sub('x86_64', 'x86-64').sub('x86_32', 'x86-32')
+ HOST = ARCH.sub(/x86-../, 'x86_64') + '-nacl'
+
+ lib_suffix = config['host_cpu'][/i.86/] ? '32' : ''
+ PYTHON = config['PYTHON']
+ OBJDUMP = config['OBJDUMP']
+ SDK_ROOT = config['NACL_SDK_ROOT']
+ CREATE_NMF = [
+ File.join(SDK_ROOT, 'build_tools', 'nacl_sdk_scons', 'site_tools', 'create_nmf.py'),
+ File.join(SDK_ROOT, 'tools', 'create_nmf.py')
+ ].find{|path| File.exist?(path) } or raise "No create_nmf found"
+ HOST_LIB = File.join(SDK_ROOT, 'toolchain', config['NACL_TOOLCHAIN'], HOST, "lib#{lib_suffix}")
+
+ INSTALL_PROGRAM = config['INSTALL_PROGRAM']
+ INSTALL_LIBRARY = config['INSTALL_DATA']
+
+ SEL_LDR = [
+ File.join(SDK_ROOT, 'toolchain', config['NACL_TOOLCHAIN'], 'bin', "sel_ldr_#{cpu_nick}"),
+ File.join(SDK_ROOT, 'tools', "sel_ldr_#{cpu_nick}")
+ ].find{|path| File.executable?(path)} or raise "No sel_ldr found"
+ IRT_CORE = [
+ File.join(SDK_ROOT, 'toolchain', config['NACL_TOOLCHAIN'], 'bin', "irt_core_#{cpu_nick}.nexe"),
+ File.join(SDK_ROOT, 'tools', "irt_core_#{cpu_nick}.nexe")
+ ].find{|path| File.exist?(path)} or raise "No irt_core found"
+ RUNNABLE_LD = File.join(HOST_LIB, 'runnable-ld.so')
+
+ module_function
+
+ def newlib?
+ RbConfig::CONFIG['NACL_SDK_VARIANT'] == 'newlib'
+ end
+
+ def self.config(name)
+ if NaClConfig::const_defined?(name.upcase)
+ NaClConfig::const_get(name.upcase)
+ elsif NaClConfig::respond_to?(name) and NaClConfig::method(name).arity == 0
+ NaClConfig::send(name)
+ else
+ raise ArgumentError, "No such config: #{name}"
+ end
+ end
+end
+
+if $0 == __FILE__
+ ARGV.each do |arg|
+ puts NaClConfig::config(arg)
+ end
+end
diff --git a/nacl/package.rb b/nacl/package.rb
new file mode 100644
index 0000000000..f4f50f24ed
--- /dev/null
+++ b/nacl/package.rb
@@ -0,0 +1,109 @@
+#!/usr/bin/ruby
+# Copyright:: Copyright 2012 Google Inc.
+# License:: All Rights Reserved.
+# Original Author:: Yugui Sonoda (mailto:yugui@google.com)
+#
+# Generates a runnable package of the pepper API example.
+
+require File.join(File.dirname(__FILE__), 'nacl-config')
+require 'json'
+require 'find'
+require 'fileutils'
+
+include NaClConfig
+
+class Installation
+ include NaClConfig
+
+ SRC_DIRS = [ Dir.pwd, HOST_LIB ]
+
+ def initialize(destdir)
+ @destdir = destdir
+ @manifest = {
+ "files" => {}
+ }
+ ruby_libs.each do |path|
+ raise "Collision of #{path}" if @manifest['files'].key? path
+ @manifest['files'][path] = {
+ ARCH => {
+ "url" => path
+ }
+ }
+ if path[/\.so$/]
+ alternate_path = path.gsub('/', "_")
+ raise "Collision of #{alternate_path}" if @manifest['files'].key? alternate_path
+ @manifest['files'][alternate_path] = {
+ ARCH => {
+ "url" => path
+ }
+ }
+ end
+ end
+ end
+
+ def manifest
+ @manifest.dup
+ end
+
+ def install_program(basename)
+ do_install_binary(basename, File.join(@destdir, "bin", ARCH))
+ @manifest["program"] = {
+ ARCH => {
+ "url" => File.join("bin", ARCH, basename)
+ }
+ }
+ end
+
+ def install_library(name, basename)
+ do_install_binary(basename, File.join(@destdir, "lib", ARCH))
+ @manifest["files"][name] = {
+ ARCH => {
+ "url" => File.join("lib", ARCH, basename)
+ }
+ }
+ end
+
+ private
+ def do_install_binary(basename, dest_dir)
+ full_path = nil
+ catch(:found) {
+ SRC_DIRS.each do |path|
+ full_path = File.join(path, basename)
+ if File.exist? full_path
+ throw :found
+ end
+ end
+ raise Errno::ENOENT, "No such file to install: %s" % basename
+ }
+ FileUtils.mkdir_p dest_dir
+ system("#{INSTALL_PROGRAM} #{full_path} #{dest_dir}")
+ end
+
+ def ruby_libs
+ Find.find(RbConfig::CONFIG['rubylibdir']).select{|path| File.file?(path) }.map{|path| path.sub("#{@destdir}/", "") }
+ end
+end
+
+def install(destdir)
+ inst = Installation.new(destdir)
+ manifest = JSON.parse(File.read("pepper-ruby.nmf"))
+
+ program = File.basename(manifest['program'][ARCH]['url'])
+ inst.install_program(program)
+
+ manifest['files'].each do |name, attr|
+ inst.install_library(name, File.basename(attr[ARCH]["url"]))
+ end
+
+ File.open(File.join(destdir, "ruby.nmf"), "w") {|f|
+ f.puts JSON.pretty_generate(inst.manifest)
+ }
+end
+
+def main
+ install(ARGV[0])
+end
+
+if __FILE__ == $0
+ main()
+end
diff --git a/nacl/pepper_main.c b/nacl/pepper_main.c
new file mode 100644
index 0000000000..c0e497b387
--- /dev/null
+++ b/nacl/pepper_main.c
@@ -0,0 +1,870 @@
+/******************************************************************************
+ Copyright 2012 Google Inc. All Rights Reserved.
+ Author: yugui@google.com (Yugui Sonoda)
+ ******************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/pp_module.h"
+#include "ppapi/c/pp_var.h"
+#include "ppapi/c/ppb.h"
+#include "ppapi/c/ppb_core.h"
+#include "ppapi/c/ppb_file_ref.h"
+#include "ppapi/c/ppb_instance.h"
+#include "ppapi/c/ppb_messaging.h"
+#include "ppapi/c/ppb_url_loader.h"
+#include "ppapi/c/ppb_url_request_info.h"
+#include "ppapi/c/ppb_url_response_info.h"
+#include "ppapi/c/ppb_var.h"
+#include "ppapi/c/ppp.h"
+#include "ppapi/c/ppp_instance.h"
+#include "ppapi/c/ppp_messaging.h"
+
+#include "verconf.h"
+#include "ruby/ruby.h"
+#include "version.h"
+#include "gc.h"
+
+#ifdef HAVE_STRUCT_PPB_CORE
+typedef struct PPB_Core PPB_Core;
+#endif
+#ifdef HAVE_STRUCT_PPB_MESSAGING
+typedef struct PPB_Messaging PPB_Messaging;
+#endif
+#ifdef HAVE_STRUCT_PPB_VAR
+typedef struct PPB_Var PPB_Var;
+#endif
+#ifdef HAVE_STRUCT_PPB_URLLOADER
+typedef struct PPB_URLLoader PPB_URLLoader;
+#endif
+#ifdef HAVE_STRUCT_PPB_URLREQUESTINFO
+typedef struct PPB_URLRequestInfo PPB_URLRequestInfo;
+#endif
+#ifdef HAVE_STRUCT_PPB_URLRESPONSEINFO
+typedef struct PPB_URLResponseInfo PPB_URLResponseInfo;
+#endif
+#ifdef HAVE_STRUCT_PPP_INSTANCE
+typedef struct PPP_Instance PPP_Instance;
+#endif
+
+static PP_Module module_id = 0;
+static PPB_Core* core_interface = NULL;
+static PPB_Messaging* messaging_interface = NULL;
+static PPB_Var* var_interface = NULL;
+static PPB_URLLoader* loader_interface = NULL;
+static PPB_URLRequestInfo* request_interface = NULL;
+static PPB_URLResponseInfo* response_interface = NULL;
+static PPB_FileRef* fileref_interface = NULL;
+static struct st_table* instance_data = NULL;
+
+static VALUE instance_table = Qundef;
+
+static PP_Instance current_instance = 0;
+
+/******************************************************************************
+ * State of instance
+ ******************************************************************************/
+
+static void inst_mark(void *const ptr);
+static void inst_free(void *const ptr);
+static size_t inst_memsize(void *const ptr);
+static const rb_data_type_t pepper_instance_data_type = {
+ "PepperInstance",
+ { inst_mark, inst_free, inst_memsize }
+};
+
+struct PepperInstance {
+ PP_Instance instance;
+ PP_Resource url_loader;
+ VALUE self;
+ void* async_call_args;
+ union {
+ int32_t as_int;
+ const char* as_str;
+ VALUE as_value;
+ } async_call_result;
+ char buf[1000];
+
+ pthread_t th;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+};
+
+struct PepperInstance*
+pruby_get_instance(PP_Instance instance)
+{
+ VALUE self = rb_hash_aref(instance_table, INT2FIX(instance));
+ if (RTEST(self)) {
+ struct PepperInstance *inst;
+ TypedData_Get_Struct(self, struct PepperInstance, &pepper_instance_data_type, inst);
+ return inst;
+ }
+ else {
+ return NULL;
+ }
+}
+
+#define GET_PEPPER_INSTANCE() (pruby_get_instance(current_instance))
+
+struct PepperInstance*
+pruby_register_instance(PP_Instance instance)
+{
+ VALUE obj;
+ struct PepperInstance *data;
+ obj = TypedData_Make_Struct(rb_cData, struct PepperInstance, &pepper_instance_data_type, data);
+ data->self = obj;
+ data->instance = instance;
+ data->url_loader = 0;
+
+ pthread_mutex_init(&data->mutex, NULL);
+ pthread_cond_init(&data->cond, NULL);
+
+ rb_hash_aset(instance_table, INT2FIX(instance), obj);
+ return data;
+}
+
+int
+pruby_unregister_instance(PP_Instance instance)
+{
+ VALUE inst = rb_hash_delete(instance_table, INT2FIX(instance));
+ return RTEST(inst);
+}
+
+static void
+inst_mark(void *const ptr)
+{
+ RUBY_MARK_ENTER("PepperInstance"0);
+ if (ptr) {
+ const struct PepperInstance* inst = (struct PepperInstance*)ptr;
+ RUBY_MARK_UNLESS_NULL(inst->async_call_result.as_value);
+ }
+ RUBY_MARK_LEAVE("PepperInstance"0);
+}
+
+static void
+inst_free(void *const ptr)
+{
+ ruby_xfree(ptr);
+}
+
+static size_t
+inst_memsize(void *const ptr)
+{
+ if (ptr) {
+ const struct PepperInstance* inst = (struct PepperInstance*)ptr;
+ return sizeof(*inst);
+ } else {
+ return 0;
+ }
+}
+
+void
+pruby_async_return_int(void* data, int32_t result)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ instance->async_call_result.as_int = result;
+ if (pthread_cond_signal(&instance->cond)) {
+ perror("pepper-ruby:pthread_cond_signal");
+ }
+}
+
+void
+pruby_async_return_str(void* data, const char *result)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ instance->async_call_result.as_str = result;
+ if (pthread_cond_signal(&instance->cond)) {
+ perror("pepper-ruby:pthread_cond_signal");
+ }
+}
+
+void
+pruby_async_return_value(void* data, VALUE value)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ instance->async_call_result.as_value = value;
+ if (pthread_cond_signal(&instance->cond)) {
+ perror("pepper-ruby:pthread_cond_signal");
+ }
+}
+/******************************************************************************
+ * Conversion between Ruby's VALUE, Pepper's Var and C string
+ ******************************************************************************/
+
+/**
+ * Creates a new string PP_Var from C string. The resulting object will be a
+ * refcounted string object. It will be AddRef()ed for the caller. When the
+ * caller is done with it, it should be Release()d.
+ * @param[in] str C string to be converted to PP_Var
+ * @return PP_Var containing string.
+ */
+static struct PP_Var
+pruby_cstr_to_var(const char* str)
+{
+#ifdef PPB_VAR_INTERFACE_1_0
+ if (var_interface != NULL)
+ return var_interface->VarFromUtf8(module_id, str, strlen(str));
+ return PP_MakeUndefined();
+#else
+ return var_interface->VarFromUtf8(str, strlen(str));
+#endif
+}
+
+/**
+ * Returns a mutable C string contained in the @a var or NULL if @a var is not
+ * string. This makes a copy of the string in the @a var and adds a NULL
+ * terminator. Note that VarToUtf8() does not guarantee the NULL terminator on
+ * the returned string. See the comments for VarToUtf8() in ppapi/c/ppb_var.h
+ * for more info. The caller is responsible for freeing the returned memory.
+ * @param[in] var PP_Var containing string.
+ * @return a mutable C string representation of @a var.
+ * @note The caller is responsible for freeing the returned string.
+ */
+static char*
+pruby_var_to_cstr(struct PP_Var var)
+{
+ uint32_t len = 0;
+ if (var_interface != NULL) {
+ const char* var_c_str = var_interface->VarToUtf8(var, &len);
+ if (len > 0) {
+ char* c_str = (char*)malloc(len + 1);
+ memcpy(c_str, var_c_str, len);
+ c_str[len] = '\0';
+ return c_str;
+ }
+ }
+ return NULL;
+}
+
+static struct PP_Var
+pruby_str_to_var(volatile VALUE str)
+{
+ if (!RB_TYPE_P(str, T_STRING)) {
+ fprintf(stderr, "[BUG] Unexpected object type: %x\n", TYPE(str));
+ exit(EXIT_FAILURE);
+ }
+#ifdef PPB_VAR_INTERFACE_1_0
+ if (var_interface != NULL) {
+ return var_interface->VarFromUtf8(module_id, RSTRING_PTR(str), RSTRING_LEN(str));
+ }
+#else
+ return var_interface->VarFromUtf8(RSTRING_PTR(str), RSTRING_LEN(str));
+#endif
+ return PP_MakeUndefined();
+}
+
+static struct PP_Var
+pruby_obj_to_var(volatile VALUE obj)
+{
+ static const char* const error =
+ "throw 'Failed to convert the result to a JavaScript object';";
+ int state;
+ obj = rb_protect(&rb_obj_as_string, obj, &state);
+ if (!state) {
+ return pruby_str_to_var(obj);
+ }
+ else {
+ return pruby_cstr_to_var(error);
+ }
+}
+
+int
+pruby_var_equal_to_cstr_p(struct PP_Var lhs, const char* rhs)
+{
+ uint32_t len = 0;
+ if (var_interface == NULL) {
+ return 0;
+ }
+ else {
+ const char* const cstr = var_interface->VarToUtf8(lhs, &len);
+ return strncmp(cstr, rhs, len) == 0;
+ }
+}
+
+int
+pruby_var_prefixed_p(struct PP_Var var, const char* prefix)
+{
+ uint32_t len = 0;
+ if (var_interface == NULL) {
+ return 0;
+ }
+ else {
+ const char* const cstr = var_interface->VarToUtf8(var, &len);
+ const size_t prefix_len = strlen(prefix);
+ return len >= prefix_len && memcmp(cstr, prefix, len) == 0;
+ }
+}
+
+
+/******************************************************************************
+ * Messaging
+ ******************************************************************************/
+
+/* Posts the given C string as a message.
+ * @param data pointer to a NULL-terminated string */
+void
+pruby_post_cstr(void* data)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ const char* const msg = (const char*)instance->async_call_args;
+ messaging_interface->PostMessage(instance->instance,
+ pruby_cstr_to_var(msg));
+}
+
+/* Posts the given Ruby VALUE as a message.
+ * @param data a VALUE casted to void* */
+void
+pruby_post_value(void* data)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ volatile VALUE value = (VALUE)instance->async_call_args;
+ messaging_interface->PostMessage(instance->instance, pruby_obj_to_var(value));
+}
+
+
+
+/******************************************************************************
+ * Ruby initialization
+ ******************************************************************************/
+
+static void
+init_loadpath(void)
+{
+ ruby_incpush("lib/ruby/"RUBY_LIB_VERSION);
+ ruby_incpush("lib/ruby/"RUBY_LIB_VERSION"/"RUBY_PLATFORM);
+ ruby_incpush(".");
+}
+
+static VALUE
+init_libraries_internal(VALUE unused)
+{
+ extern void Init_enc();
+ extern void Init_ext();
+
+ init_loadpath();
+ Init_enc();
+ Init_ext();
+ return Qnil;
+}
+
+static void*
+init_libraries(void* data)
+{
+ int state;
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ current_instance = instance->instance;
+
+ if (pthread_mutex_lock(&instance->mutex)) {
+ perror("pepper-ruby:pthread_mutex_lock");
+ return 0;
+ }
+ rb_protect(&init_libraries_internal, Qnil, &state);
+ pthread_mutex_unlock(&instance->mutex);
+
+ if (state) {
+ volatile VALUE err = rb_errinfo();
+ err = rb_obj_as_string(err);
+ } else {
+ instance->async_call_args = (void*)"rubyReady";
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(pruby_post_cstr, instance), 0);
+ }
+ return NULL;
+}
+
+static int
+init_libraries_if_necessary(void)
+{
+ static int initialized = 0;
+ if (!initialized) {
+ struct PepperInstance* const instance = GET_PEPPER_INSTANCE();
+ int err;
+ initialized = 1;
+ err = pthread_create(&instance->th, NULL, &init_libraries, instance);
+ if (err) {
+ fprintf(stderr, "pepper_ruby:pthread_create: %s\n", strerror(err));
+ exit(EXIT_FAILURE);
+ }
+ pthread_detach(instance->th);
+ }
+ return 0;
+}
+
+static int
+pruby_init(void)
+{
+ RUBY_INIT_STACK;
+ ruby_init();
+
+ instance_table = rb_hash_new();
+ rb_gc_register_mark_object(instance_table);
+
+ return 0;
+}
+
+
+/******************************************************************************
+ * Ruby evaluation
+ ******************************************************************************/
+
+static void*
+pruby_eval(void* data)
+{
+ extern VALUE ruby_eval_string_from_file_protect(const char* src, const char* path, int* state);
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ volatile VALUE src = (VALUE)instance->async_call_args;
+ volatile VALUE result = Qnil;
+ volatile int state;
+
+ RUBY_INIT_STACK;
+
+ if (pthread_mutex_lock(&instance->mutex)) {
+ perror("pepper-ruby:pthread_mutex_lock");
+ return 0;
+ }
+ result = ruby_eval_string_from_file_protect(
+ RSTRING_PTR(src), "(pepper-ruby)", &state);
+ pthread_mutex_unlock(&instance->mutex);
+
+ if (!state) {
+ instance->async_call_args =
+ rb_str_concat(rb_usascii_str_new_cstr("return:"),
+ rb_obj_as_string(result));
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(pruby_post_value, instance), 0);
+ return NULL;
+ }
+ else {
+ rb_set_errinfo(Qnil);
+ instance->async_call_args =
+ rb_str_concat(rb_usascii_str_new_cstr("error:"),
+ rb_obj_as_string(result));
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(pruby_post_value, instance), 0);
+ return NULL;
+ }
+}
+
+
+/******************************************************************************
+ * Pepper Module callbacks
+ ******************************************************************************/
+
+/**
+ * Called when the NaCl module is instantiated on the web page. The identifier
+ * of the new instance will be passed in as the first argument (this value is
+ * generated by the browser and is an opaque handle). This is called for each
+ * instantiation of the NaCl module, which is each time the <embed> tag for
+ * this module is encountered.
+ *
+ * If this function reports a failure (by returning @a PP_FALSE), the NaCl
+ * module will be deleted and DidDestroy will be called.
+ * @param[in] instance The identifier of the new instance representing this
+ * NaCl module.
+ * @param[in] argc The number of arguments contained in @a argn and @a argv.
+ * @param[in] argn An array of argument names. These argument names are
+ * supplied in the <embed> tag, for example:
+ * <embed id="nacl_module" dimensions="2">
+ * will produce two arguments, one named "id" and one named "dimensions".
+ * @param[in] argv An array of argument values. These are the values of the
+ * arguments listed in the <embed> tag. In the above example, there will
+ * be two elements in this array, "nacl_module" and "2". The indices of
+ * these values match the indices of the corresponding names in @a argn.
+ * @return @a PP_TRUE on success.
+ */
+static PP_Bool
+Instance_DidCreate(PP_Instance instance,
+ uint32_t argc, const char* argn[], const char* argv[])
+{
+ struct PepperInstance* data = pruby_register_instance(instance);
+ current_instance = instance;
+ return init_libraries_if_necessary() ? PP_FALSE : PP_TRUE;
+}
+
+/**
+ * Called when the NaCl module is destroyed. This will always be called,
+ * even if DidCreate returned failure. This routine should deallocate any data
+ * associated with the instance.
+ * @param[in] instance The identifier of the instance representing this NaCl
+ * module.
+ */
+static void Instance_DidDestroy(PP_Instance instance) {
+ struct PepperInstance* data = pruby_get_instance(instance);
+ core_interface->ReleaseResource(data->url_loader);
+ pruby_unregister_instance(instance);
+}
+
+/**
+ * Called when the position, the size, or the clip rect of the element in the
+ * browser that corresponds to this NaCl module has changed.
+ * @param[in] instance The identifier of the instance representing this NaCl
+ * module.
+ * @param[in] position The location on the page of this NaCl module. This is
+ * relative to the top left corner of the viewport, which changes as the
+ * page is scrolled.
+ * @param[in] clip The visible region of the NaCl module. This is relative to
+ * the top left of the plugin's coordinate system (not the page). If the
+ * plugin is invisible, @a clip will be (0, 0, 0, 0).
+ */
+#ifdef PPP_INSTANCE_INTERFACE_1_0
+static void
+Instance_DidChangeView(PP_Instance instance,
+ const struct PP_Rect* position,
+ const struct PP_Rect* clip)
+{
+}
+#else
+static void
+Instance_DidChangeView(PP_Instance instance, PP_Resource view_resource)
+{
+}
+#endif
+
+/**
+ * Notification that the given NaCl module has gained or lost focus.
+ * Having focus means that keyboard events will be sent to the NaCl module
+ * represented by @a instance. A NaCl module's default condition is that it
+ * will not have focus.
+ *
+ * Note: clicks on NaCl modules will give focus only if you handle the
+ * click event. You signal if you handled it by returning @a true from
+ * HandleInputEvent. Otherwise the browser will bubble the event and give
+ * focus to the element on the page that actually did end up consuming it.
+ * If you're not getting focus, check to make sure you're returning true from
+ * the mouse click in HandleInputEvent.
+ * @param[in] instance The identifier of the instance representing this NaCl
+ * module.
+ * @param[in] has_focus Indicates whether this NaCl module gained or lost
+ * event focus.
+ */
+static void
+Instance_DidChangeFocus(PP_Instance instance, PP_Bool has_focus)
+{
+}
+
+/**
+ * Handler that gets called after a full-frame module is instantiated based on
+ * registered MIME types. This function is not called on NaCl modules. This
+ * function is essentially a place-holder for the required function pointer in
+ * the PPP_Instance structure.
+ * @param[in] instance The identifier of the instance representing this NaCl
+ * module.
+ * @param[in] url_loader A PP_Resource an open PPB_URLLoader instance.
+ * @return PP_FALSE.
+ */
+static PP_Bool
+Instance_HandleDocumentLoad(PP_Instance instance, PP_Resource url_loader)
+{
+ /* NaCl modules do not need to handle the document load function. */
+ return PP_FALSE;
+}
+
+
+/**
+ * Handler for messages coming in from the browser via postMessage. The
+ * @a var_message can contain anything: a JSON string; a string that encodes
+ * method names and arguments; etc. For example, you could use JSON.stringify
+ * in the browser to create a message that contains a method name and some
+ * parameters, something like this:
+ * var json_message = JSON.stringify({ "myMethod" : "3.14159" });
+ * nacl_module.postMessage(json_message);
+ * On receipt of this message in @a var_message, you could parse the JSON to
+ * retrieve the method name, match it to a function call, and then call it with
+ * the parameter.
+ * @param[in] instance The instance ID.
+ * @param[in] message The contents, copied by value, of the message sent from
+ * browser via postMessage.
+ */
+void
+Messaging_HandleMessage(PP_Instance instance, struct PP_Var var_message)
+{
+ char* const message = pruby_var_to_cstr(var_message);
+ size_t message_len = strlen(message);
+ current_instance = instance;
+
+ if (strstr(message, "eval:") != NULL) {
+ volatile VALUE src;
+ struct PepperInstance* const instance_data = GET_PEPPER_INSTANCE();
+ int err;
+#define EVAL_PREFIX_LEN 5
+ src = rb_str_new(message + EVAL_PREFIX_LEN, message_len - EVAL_PREFIX_LEN);
+ instance_data->async_call_args = (void*)src;
+ err = pthread_create(&instance_data->th, NULL, &pruby_eval, instance_data);
+ if (err) {
+ fprintf(stderr, "pepper_ruby:pthread_create: %s\n", strerror(err));
+ exit(EXIT_FAILURE);
+ }
+ pthread_detach(instance_data->th);
+ }
+ free(message);
+}
+
+/**
+ * Entry points for the module.
+ * Initialize instance interface and scriptable object class.
+ * @param[in] a_module_id Module ID
+ * @param[in] get_browser_interface Pointer to PPB_GetInterface
+ * @return PP_OK on success, any other value on failure.
+ */
+PP_EXPORT int32_t
+PPP_InitializeModule(PP_Module a_module_id, PPB_GetInterface get_browser_interface)
+{
+ module_id = a_module_id;
+ core_interface = (PPB_Core*)(get_browser_interface(PPB_CORE_INTERFACE));
+ if (core_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ var_interface = (PPB_Var*)(get_browser_interface(PPB_VAR_INTERFACE));
+ if (var_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ messaging_interface = (PPB_Messaging*)(get_browser_interface(PPB_MESSAGING_INTERFACE));
+ if (messaging_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ loader_interface = (PPB_URLLoader*)(get_browser_interface(PPB_URLLOADER_INTERFACE));
+ if (loader_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ request_interface = (PPB_URLRequestInfo*)(get_browser_interface(PPB_URLREQUESTINFO_INTERFACE));
+ if (request_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ response_interface = (PPB_URLResponseInfo*)(get_browser_interface(PPB_URLRESPONSEINFO_INTERFACE));
+ if (response_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ fileref_interface = (PPB_FileRef*)(get_browser_interface(PPB_FILEREF_INTERFACE));
+ if (fileref_interface == NULL) return PP_ERROR_NOINTERFACE;
+
+ return pruby_init() ? PP_ERROR_FAILED : PP_OK;
+}
+
+/**
+ * Returns an interface pointer for the interface of the given name, or NULL
+ * if the interface is not supported.
+ * @param[in] interface_name name of the interface
+ * @return pointer to the interface
+ */
+PP_EXPORT const void*
+PPP_GetInterface(const char* interface_name)
+{
+ if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) {
+ static PPP_Instance instance_interface = {
+ &Instance_DidCreate,
+ &Instance_DidDestroy,
+ &Instance_DidChangeView,
+ &Instance_DidChangeFocus,
+ &Instance_HandleDocumentLoad
+ };
+ return &instance_interface;
+ } else if (strcmp(interface_name, PPP_MESSAGING_INTERFACE) == 0) {
+ static PPP_Messaging messaging_interface = {
+ &Messaging_HandleMessage
+ };
+ return &messaging_interface;
+ }
+ return NULL;
+}
+
+/**
+ * Called before the plugin module is unloaded.
+ */
+PP_EXPORT void
+PPP_ShutdownModule()
+{
+ ruby_cleanup(0);
+}
+
+/******************************************************************************
+ * Overwrites rb_file_load_ok
+ ******************************************************************************/
+
+static void
+load_ok_internal(void* data, int32_t unused)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ const char *const path = (const char*)instance->async_call_args;
+ PP_Resource req;
+ int result;
+
+ instance->url_loader = loader_interface->Create(instance->instance);
+ req = request_interface->Create(instance->instance);
+ request_interface->SetProperty(
+ req, PP_URLREQUESTPROPERTY_METHOD, pruby_cstr_to_var("HEAD"));
+ request_interface->SetProperty(
+ req, PP_URLREQUESTPROPERTY_URL, pruby_cstr_to_var(path));
+
+ result = loader_interface->Open(
+ instance->url_loader, req,
+ PP_MakeCompletionCallback(pruby_async_return_int, instance));
+ if (result != PP_OK_COMPLETIONPENDING) {
+ pruby_async_return_int(instance, result);
+ }
+}
+
+static void
+pruby_file_fetch_check_response(void* data, int32_t unused)
+{
+ /* PPAPI main thread */
+ PP_Resource res;
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+
+ res = loader_interface->GetResponseInfo(instance->url_loader);
+ if (res) {
+ struct PP_Var status =
+ response_interface->GetProperty(res, PP_URLRESPONSEPROPERTY_STATUSCODE);
+ if (status.type == PP_VARTYPE_INT32) {
+ pruby_async_return_int(instance, status.value.as_int / 100 == 2 ? PP_OK : PP_ERROR_FAILED);
+ return;
+ }
+ else {
+ messaging_interface->PostMessage(
+ instance->instance, pruby_cstr_to_var("Unexpected type: ResponseInfoInterface::GetProperty"));
+ }
+ }
+ else {
+ messaging_interface->PostMessage(
+ instance->instance, pruby_cstr_to_var("Failed to open URL: URLLoaderInterface::GetResponseInfo"));
+ }
+ pruby_async_return_int(instance, PP_ERROR_FAILED);
+}
+
+
+int
+rb_file_load_ok(const char *path)
+{
+ struct PepperInstance* const instance = GET_PEPPER_INSTANCE();
+ if (path[0] == '.' && path[1] == '/') path += 2;
+
+ instance->async_call_args = (void*)path;
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(load_ok_internal, instance), 0);
+ if (pthread_cond_wait(&instance->cond, &instance->mutex)) {
+ perror("pepper-ruby:pthread_cond_wait");
+ return 0;
+ }
+ if (instance->async_call_result.as_int != PP_OK) {
+ fprintf(stderr, "Failed to open URL: %d: %s\n",
+ instance->async_call_result.as_int, path);
+ return 0;
+ }
+
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(pruby_file_fetch_check_response, instance), 0);
+ if (pthread_cond_wait(&instance->cond, &instance->mutex)) {
+ perror("pepper-ruby:pthread_cond_wait");
+ return 0;
+ }
+ return instance->async_call_result.as_int == PP_OK;
+}
+
+/******************************************************************************
+ * Overwrites rb_load_file
+ ******************************************************************************/
+
+static void
+load_file_internal(void* data, int32_t unused)
+{
+ /* PPAPI main thread */
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ const char *const path = (const char*)instance->async_call_args;
+ PP_Resource req;
+ int result;
+
+ instance->url_loader = loader_interface->Create(instance->instance);
+ req = request_interface->Create(instance->instance);
+ request_interface->SetProperty(
+ req, PP_URLREQUESTPROPERTY_METHOD, pruby_cstr_to_var("GET"));
+ request_interface->SetProperty(
+ req, PP_URLREQUESTPROPERTY_URL, pruby_cstr_to_var(path));
+
+ result = loader_interface->Open(
+ instance->url_loader, req,
+ PP_MakeCompletionCallback(pruby_async_return_int, instance));
+ if (result != PP_OK_COMPLETIONPENDING) {
+ pruby_async_return_int(instance, result);
+ }
+}
+
+static void
+load_file_read_contents_callback(void *data, int result)
+{
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ if (result > 0) {
+ rb_str_buf_cat(instance->async_call_result.as_value,
+ instance->buf, result);
+ loader_interface->ReadResponseBody(
+ instance->url_loader, instance->buf, 1000, PP_MakeCompletionCallback(load_file_read_contents_callback, instance));
+ }
+ else if (result == 0) {
+ pruby_async_return_value(data, instance->async_call_result.as_value);
+ }
+ else {
+ pruby_async_return_value(data, INT2FIX(result));
+ }
+}
+
+static void
+load_file_read_contents(void *data, int result)
+{
+ struct PepperInstance* const instance = (struct PepperInstance*)data;
+ instance->async_call_result.as_value = rb_str_new(0, 0);
+ loader_interface->ReadResponseBody(
+ instance->url_loader, instance->buf, 1000, PP_MakeCompletionCallback(load_file_read_contents_callback, instance));
+}
+
+void*
+rb_load_file(const char *path)
+{
+ const char *real_path;
+ struct PepperInstance* instance;
+ if (path[0] != '.' || path[1] != '/') path += 2;
+
+ instance = GET_PEPPER_INSTANCE();
+
+ instance->async_call_args = (void*)path;
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(load_file_internal, instance), 0);
+ if (pthread_cond_wait(&instance->cond, &instance->mutex)) {
+ perror("pepper-ruby:pthread_cond_wait");
+ return 0;
+ }
+ if (instance->async_call_result.as_int != PP_OK) {
+ fprintf(stderr, "Failed to open URL: %d: %s\n",
+ instance->async_call_result.as_int, path);
+ return 0;
+ }
+
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(pruby_file_fetch_check_response, instance), 0);
+ if (pthread_cond_wait(&instance->cond, &instance->mutex)) {
+ perror("pepper-ruby:pthread_cond_wait");
+ return 0;
+ }
+ if (instance->async_call_result.as_int != PP_OK) return 0;
+
+ core_interface->CallOnMainThread(
+ 0, PP_MakeCompletionCallback(load_file_read_contents, instance), 0);
+ if (pthread_cond_wait(&instance->cond, &instance->mutex)) {
+ perror("pepper-ruby:pthread_cond_wait");
+ return 0;
+ }
+ if (FIXNUM_P(instance->async_call_result.as_value)) {
+ return 0;
+ }
+ else if (RB_TYPE_P(instance->async_call_result.as_value, T_STRING)) {
+ VALUE str = instance->async_call_result.as_value;
+ extern void* rb_compile_cstr(const char *f, const char *s, int len, int line);
+ return rb_compile_cstr(path, RSTRING_PTR(str), RSTRING_LEN(str), 0);
+ }
+ else {
+ return 0;
+ }
+}
diff --git a/nacl/resource.h b/nacl/resource.h
new file mode 100644
index 0000000000..57ca53b093
--- /dev/null
+++ b/nacl/resource.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2011 Google Inc. All Rights Reserved.
+ * Author: yugui@google.com (Yugui Sonoda)
+ * */
+#ifndef RUBY_NACL_RESOURCE_H
+#define RUBY_NACL_RESOURCE_H
+int getrusage(int who, struct rusage *usage);
+#endif
diff --git a/nacl/select.h b/nacl/select.h
new file mode 100644
index 0000000000..921721a2fd
--- /dev/null
+++ b/nacl/select.h
@@ -0,0 +1,7 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
+// Author: yugui@google.com (Yugui Sonoda)
+#ifndef RUBY_NACL_SELECT_H
+#define RUBY_NACL_SELECT_H
+int select(int num_fds, fd_set *in_fds, fd_set *out_fds,
+ fd_set *ex_fds, struct timeval *timeout);
+#endif
diff --git a/nacl/signal.h b/nacl/signal.h
new file mode 100644
index 0000000000..54832de1fe
--- /dev/null
+++ b/nacl/signal.h
@@ -0,0 +1,6 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
+// Author: yugui@google.com (Yugui Sonoda)
+#ifndef RUBY_NACL_SIGNAL_H
+#define RUBY_NACL_SIGNAL_H
+int kill(pid_t pid, int signal);
+#endif
diff --git a/nacl/stat.h b/nacl/stat.h
new file mode 100644
index 0000000000..7be40ada7c
--- /dev/null
+++ b/nacl/stat.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright 2011 Google Inc. All Rights Reserved.
+ * Author: yugui@google.com (Yugui Sonoda)
+ * */
+#ifndef RUBY_NACL_STAT_H
+#define RUBY_NACL_STAT_H
+mode_t umask(mode_t mask);
+struct stat;
+int lstat(const char* path, struct stat* result);
+#endif
diff --git a/nacl/unistd.h b/nacl/unistd.h
new file mode 100644
index 0000000000..1c97390c63
--- /dev/null
+++ b/nacl/unistd.h
@@ -0,0 +1,9 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
+// Author: yugui@google.com (Yugui Sonoda)
+#ifndef RUBY_NACL_UNISTD_H
+#define RUBY_NACL_UNISTD_H
+int seteuid(pid_t pid);
+int setegid(pid_t pid);
+int truncate(const char* path, off_t new_size);
+int ftruncate(int fd, off_t new_size);
+#endif
diff --git a/nacl/utime.h b/nacl/utime.h
new file mode 100644
index 0000000000..96910051e4
--- /dev/null
+++ b/nacl/utime.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright 2011 Google Inc. All Rights Reserved.
+ * Author: yugui@google.com (Yugui Sonoda)
+ */
+
+#ifndef RUBY_NACL_UTIME_H
+#define RUBY_NACL_UTIME_H
+#include <utime.h>
+int utime(const char *filename, const struct utimbuf *times);
+int utimes(const char *filename, const struct timeval times[2]);
+#endif
diff --git a/node.c b/node.c
index 23b15c2dbc..cf334e3db4 100644
--- a/node.c
+++ b/node.c
@@ -16,59 +16,48 @@
#define AR(str) rb_str_concat(buf, (str))
#define A_INDENT add_indent(buf, indent)
-#define D_INDENT rb_str_cat2(indent, next_indent)
-#define D_DEDENT rb_str_resize(indent, RSTRING_LEN(indent) - 4)
#define A_ID(id) add_id(buf, (id))
#define A_INT(val) rb_str_catf(buf, "%d", (val))
#define A_LONG(val) rb_str_catf(buf, "%ld", (val))
#define A_LIT(lit) AR(rb_inspect(lit))
-#define A_NODE_HEADER(node, term) \
- rb_str_catf(buf, "@ %s (line: %d, code_range: (%d,%d)-(%d,%d))"term, \
- ruby_node_name(nd_type(node)), nd_line(node), nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node))
-#define A_FIELD_HEADER(len, name, term) \
- rb_str_catf(buf, "+- %.*s:"term, (len), (name))
-#define D_FIELD_HEADER(len, name, term) (A_INDENT, A_FIELD_HEADER(len, name, term))
-
-#define D_NULL_NODE (A_INDENT, A("(null node)\n"))
-#define D_NODE_HEADER(node) (A_INDENT, A_NODE_HEADER(node, "\n"))
-
-#define COMPOUND_FIELD(len, name) \
- FIELD_BLOCK((D_FIELD_HEADER((len), (name), "\n"), D_INDENT), D_DEDENT)
-
-#define COMPOUND_FIELD1(name, ann) \
- COMPOUND_FIELD(FIELD_NAME_LEN(name, ann), \
- FIELD_NAME_DESC(name, ann))
-
-#define FIELD_NAME_DESC(name, ann) name " (" ann ")"
-#define FIELD_NAME_LEN(name, ann) (int)( \
- comment ? \
- rb_strlen_lit(FIELD_NAME_DESC(name, ann)) : \
- rb_strlen_lit(name))
-#define SIMPLE_FIELD(len, name) \
- FIELD_BLOCK(D_FIELD_HEADER((len), (name), " "), A("\n"))
-
-#define FIELD_BLOCK(init, reset) \
- for (init, field_flag = 1; \
- field_flag; /* should be optimized away */ \
- reset, field_flag = 0)
-
-#define SIMPLE_FIELD1(name, ann) SIMPLE_FIELD(FIELD_NAME_LEN(name, ann), FIELD_NAME_DESC(name, ann))
-#define F_CUSTOM1(name, ann) SIMPLE_FIELD1(#name, ann)
-#define F_ID(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name)
-#define F_GENTRY(name, ann) SIMPLE_FIELD1(#name, ann) A_ID((node->name)->id)
-#define F_INT(name, ann) SIMPLE_FIELD1(#name, ann) A_INT(node->name)
-#define F_LONG(name, ann) SIMPLE_FIELD1(#name, ann) A_LONG(node->name)
-#define F_LIT(name, ann) SIMPLE_FIELD1(#name, ann) A_LIT(node->name)
-#define F_MSG(name, ann, desc) SIMPLE_FIELD1(#name, ann) A(desc)
+#define A_NODE_HEADER(node) \
+ rb_str_catf(buf, "@ %s (line: %d)", ruby_node_name(nd_type(node)), nd_line(node))
+#define A_FIELD_HEADER(name) \
+ rb_str_catf(buf, "+- %s:", (name))
+
+#define D_NULL_NODE A_INDENT; A("(null node)"); A("\n");
+#define D_NODE_HEADER(node) A_INDENT; A_NODE_HEADER(node); A("\n");
+
+#define COMPOUND_FIELD(name, name2, block) \
+ do { \
+ A_INDENT; A_FIELD_HEADER(comment ? (name2) : (name)); A("\n"); \
+ rb_str_cat2(indent, next_indent); \
+ block; \
+ rb_str_resize(indent, RSTRING_LEN(indent) - 4); \
+ } while (0)
+
+#define SIMPLE_FIELD(name, name2, block) \
+ do { \
+ A_INDENT; A_FIELD_HEADER(comment ? (name2) : (name)); A(" "); block; A("\n"); \
+ } while (0)
+
+#define F_CUSTOM1(name, ann, block) SIMPLE_FIELD(#name, #name " (" ann ")", block)
+#define F_ID(name, ann) SIMPLE_FIELD(#name, #name " (" ann ")", A_ID(node->name))
+#define F_GENTRY(name, ann) SIMPLE_FIELD(#name, #name " (" ann ")", A_ID((node->name)->id))
+#define F_INT(name, ann) SIMPLE_FIELD(#name, #name " (" ann ")", A_INT(node->name))
+#define F_LONG(name, ann) SIMPLE_FIELD(#name, #name " (" ann ")", A_LONG(node->name))
+#define F_LIT(name, ann) SIMPLE_FIELD(#name, #name " (" ann ")", A_LIT(node->name))
+#define F_MSG(name, ann, desc) SIMPLE_FIELD(#name, #name " (" ann ")", A(desc))
+
+#define F_CUSTOM2(name, ann, block) \
+ COMPOUND_FIELD(#name, #name " (" ann ")", block)
#define F_NODE(name, ann) \
- COMPOUND_FIELD1(#name, ann) {dump_node(buf, indent, comment, node->name);}
-#define F_OPTION(name, ann) \
- COMPOUND_FIELD1(#name, ann) {dump_option(buf, indent, node->name);}
+ COMPOUND_FIELD(#name, #name " (" ann ")", dump_node(buf, indent, comment, node->name))
#define ANN(ann) \
if (comment) { \
- A_INDENT; A("| # " ann "\n"); \
+ A_INDENT; A("| # "); A(ann); A("\n"); \
}
#define LAST_NODE (next_indent = " ")
@@ -96,67 +85,10 @@ add_id(VALUE buf, ID id)
}
}
-struct add_option_arg {
- VALUE buf, indent;
- st_index_t count;
-};
-
-static int
-add_option_i(VALUE key, VALUE val, VALUE args)
-{
- struct add_option_arg *argp = (void *)args;
- VALUE buf = argp->buf;
- VALUE indent = argp->indent;
-
- A_INDENT;
- A("+- ");
- AR(rb_sym2str(key));
- A(": ");
- A_LIT(val);
- A("\n");
- return ST_CONTINUE;
-}
-
-static void
-dump_option(VALUE buf, VALUE indent, VALUE opt)
-{
- struct add_option_arg arg;
-
- if (!RB_TYPE_P(opt, T_HASH)) {
- A_LIT(opt);
- return;
- }
- arg.buf = buf;
- arg.indent = indent;
- arg.count = 0;
- rb_hash_foreach(opt, add_option_i, (VALUE)&arg);
-}
-
-static void dump_node(VALUE, VALUE, int, NODE *);
-static const char default_indent[] = "| ";
-
-static void
-dump_array(VALUE buf, VALUE indent, int comment, NODE *node)
-{
- int field_flag;
- const char *next_indent = default_indent;
- F_LONG(nd_alen, "length");
- F_NODE(nd_head, "element");
- while (node->nd_next && nd_type(node->nd_next) == NODE_ARRAY) {
- node = node->nd_next;
- F_NODE(nd_head, "element");
- }
- LAST_NODE;
- F_NODE(nd_next, "next element");
-}
-
static void
dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
{
- int field_flag;
- int i;
- const char *next_indent = default_indent;
- enum node_type type;
+ const char *next_indent = "| ";
if (!node) {
D_NULL_NODE;
@@ -165,29 +97,15 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
D_NODE_HEADER(node);
- type = nd_type(node);
- switch (type) {
+ switch (nd_type(node)) {
case NODE_BLOCK:
ANN("statement sequence");
- ANN("format: [nd_head]; ...; [nd_next]");
+ ANN("format: [nd_head]; [nd_next]");
ANN("example: foo; bar");
- i = 0;
- do {
- A_INDENT;
- rb_str_catf(buf, "+- nd_head (%s%d):\n",
- comment ? "statement #" : "", ++i);
- if (!node->nd_next) LAST_NODE;
- D_INDENT;
- dump_node(buf, indent, comment, node->nd_head);
- D_DEDENT;
- } while (node->nd_next &&
- nd_type(node->nd_next) == NODE_BLOCK &&
- (node = node->nd_next, 1));
- if (node->nd_next) {
- LAST_NODE;
- F_NODE(nd_next, "next block");
- }
- return;
+ F_NODE(nd_head, "current statement");
+ LAST_NODE;
+ F_NODE(nd_next, "next block");
+ break;
case NODE_IF:
ANN("if statement");
@@ -197,17 +115,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_body, "then clause");
LAST_NODE;
F_NODE(nd_else, "else clause");
- return;
-
- case NODE_UNLESS:
- ANN("unless statement");
- ANN("format: unless [nd_cond] then [nd_body] else [nd_else] end");
- ANN("example: unless x == 1 then foo else bar end");
- F_NODE(nd_cond, "condition expr");
- F_NODE(nd_body, "then clause");
- LAST_NODE;
- F_NODE(nd_else, "else clause");
- return;
+ break;
case NODE_CASE:
ANN("case statement");
@@ -216,26 +124,23 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "case expr");
LAST_NODE;
F_NODE(nd_body, "when clauses");
- return;
- case NODE_CASE2:
- ANN("case statement with no head");
- ANN("format: case; [nd_body]; end");
- ANN("example: case; when 1; foo; when 2; bar; else baz; end");
- F_NODE(nd_head, "case expr");
- LAST_NODE;
- F_NODE(nd_body, "when clauses");
- return;
+ break;
case NODE_WHEN:
- ANN("when clause");
+ ANN("if statement");
ANN("format: when [nd_head]; [nd_body]; (when or else) [nd_next]");
ANN("example: case x; when 1; foo; when 2; bar; else baz; end");
F_NODE(nd_head, "when value");
- F_NODE(nd_body, "when body");
+ F_NODE(nd_body, "when clause");
LAST_NODE;
F_NODE(nd_next, "next when clause");
- return;
+ break;
+ case NODE_OPT_N:
+ ANN("wrapper for -n option");
+ ANN("format: ruby -ne '[nd_body]' (nd_cond is `gets')");
+ ANN("example: ruby -ne 'p $_'");
+ goto loop;
case NODE_WHILE:
ANN("while statement");
ANN("format: while [nd_cond]; [nd_body]; end");
@@ -246,14 +151,14 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("format: until [nd_cond]; [nd_body]; end");
ANN("example: until x == 1; foo; end");
loop:
- F_CUSTOM1(nd_state, "begin-end-while?") {
- A_INT((int)node->nd_state);
- A((node->nd_state == 1) ? " (while-end)" : " (begin-end-while)");
- }
+ F_CUSTOM1(nd_state, "begin-end-while?", {
+ A_INT((int)node->nd_state);
+ A((node->nd_state == 1) ? " (while-end)" : " (begin-end-while)");
+ });
F_NODE(nd_cond, "condition");
LAST_NODE;
F_NODE(nd_body, "body");
- return;
+ break;
case NODE_ITER:
ANN("method call with block");
@@ -268,10 +173,10 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_iter, "iteration receiver");
LAST_NODE;
F_NODE(nd_body, "body");
- return;
+ break;
case NODE_BREAK:
- ANN("break statement");
+ ANN("for statement");
ANN("format: break [nd_stts]");
ANN("example: break 1");
goto jump;
@@ -287,19 +192,19 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
jump:
LAST_NODE;
F_NODE(nd_stts, "value");
- return;
+ break;
case NODE_REDO:
ANN("redo statement");
ANN("format: redo");
ANN("example: redo");
- return;
+ break;
case NODE_RETRY:
ANN("retry statement");
ANN("format: retry");
ANN("example: retry");
- return;
+ break;
case NODE_BEGIN:
ANN("begin statement");
@@ -307,7 +212,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: begin; 1; end");
LAST_NODE;
F_NODE(nd_body, "body");
- return;
+ break;
case NODE_RESCUE:
ANN("rescue clause");
@@ -317,7 +222,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_resq, "rescue clause list");
LAST_NODE;
F_NODE(nd_else, "rescue else clause");
- return;
+ break;
case NODE_RESBODY:
ANN("rescue clause (cont'd)");
@@ -327,7 +232,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_body, "rescue clause");
LAST_NODE;
F_NODE(nd_head, "next rescue clause");
- return;
+ break;
case NODE_ENSURE:
ANN("ensure clause");
@@ -336,7 +241,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "body");
LAST_NODE;
F_NODE(nd_ensr, "ensure clause");
- return;
+ break;
case NODE_AND:
ANN("&& operator");
@@ -346,17 +251,12 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
case NODE_OR:
ANN("|| operator");
ANN("format: [nd_1st] || [nd_2nd]");
- ANN("example: foo || bar");
+ ANN("example: foo && bar");
andor:
- while (1) {
- F_NODE(nd_1st, "left expr");
- if (!node->nd_2nd || nd_type(node->nd_2nd) != (int)type)
- break;
- node = node->nd_2nd;
- }
+ F_NODE(nd_1st, "left expr");
LAST_NODE;
F_NODE(nd_2nd, "right expr");
- return;
+ break;
case NODE_MASGN:
ANN("multiple assignment");
@@ -364,60 +264,50 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: a, b = foo");
F_NODE(nd_value, "rhsn");
F_NODE(nd_head, "lhsn");
- if (node->nd_args != NODE_SPECIAL_NO_NAME_REST) {
+ if ((VALUE)node->nd_args != (VALUE)-1) {
LAST_NODE;
F_NODE(nd_args, "splatn");
}
else {
- F_MSG(nd_args, "splatn", "NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
+ F_MSG(nd_args, "splatn", "-1 (rest argument without name)");
}
- return;
+ break;
case NODE_LASGN:
ANN("local variable assignment");
ANN("format: [nd_vid](lvar) = [nd_value]");
ANN("example: x = foo");
- F_ID(nd_vid, "local variable");
- if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
- F_MSG(nd_value, "rvalue", "NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
- }
- else {
- LAST_NODE;
- F_NODE(nd_value, "rvalue");
- }
- return;
+ goto asgn;
case NODE_DASGN:
ANN("dynamic variable assignment (out of current scope)");
ANN("format: [nd_vid](dvar) = [nd_value]");
ANN("example: x = nil; 1.times { x = foo }");
- F_ID(nd_vid, "local variable");
- LAST_NODE;
- F_NODE(nd_value, "rvalue");
- return;
+ goto asgn;
case NODE_DASGN_CURR:
ANN("dynamic variable assignment (in current scope)");
ANN("format: [nd_vid](current dvar) = [nd_value]");
ANN("example: 1.times { x = foo }");
- F_ID(nd_vid, "local variable");
- LAST_NODE;
- F_NODE(nd_value, "rvalue");
- return;
+ goto asgn;
case NODE_IASGN:
ANN("instance variable assignment");
ANN("format: [nd_vid](ivar) = [nd_value]");
ANN("example: @x = foo");
- F_ID(nd_vid, "instance variable");
- LAST_NODE;
- F_NODE(nd_value, "rvalue");
- return;
+ goto asgn;
case NODE_CVASGN:
ANN("class variable assignment");
ANN("format: [nd_vid](cvar) = [nd_value]");
ANN("example: @@x = foo");
- F_ID(nd_vid, "class variable");
+ asgn:
+ F_ID(nd_vid, "variable");
LAST_NODE;
- F_NODE(nd_value, "rvalue");
- return;
+ if (node->nd_value == (NODE *)-1) {
+ F_MSG(nd_value, "rvalue", "(required keyword argument)");
+ }
+ else {
+ F_NODE(nd_value, "rvalue");
+ }
+ break;
+
case NODE_GASGN:
ANN("global variable assignment");
ANN("format: [nd_entry](gvar) = [nd_value]");
@@ -425,61 +315,54 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_GENTRY(nd_entry, "global variable");
LAST_NODE;
F_NODE(nd_value, "rvalue");
- return;
+ break;
case NODE_CDECL:
ANN("constant declaration");
ANN("format: [nd_else]::[nd_vid](constant) = [nd_value]");
ANN("example: X = foo");
if (node->nd_vid) {
- F_ID(nd_vid, "constant");
- F_MSG(nd_else, "extension", "not used");
+ F_ID(nd_vid, "variable");
+ F_MSG(nd_else, "extension", "not used");
}
else {
- F_MSG(nd_vid, "constant", "0 (see extension field)");
- F_NODE(nd_else, "extension");
+ F_MSG(nd_vid, "variable", "0 (see extension field)");
+ F_NODE(nd_else, "extension");
}
LAST_NODE;
F_NODE(nd_value, "rvalue");
- return;
+ break;
case NODE_OP_ASGN1:
ANN("array assignment with operator");
ANN("format: [nd_value] [ [nd_args->nd_body] ] [nd_vid]= [nd_args->nd_head]");
ANN("example: ary[1] += foo");
F_NODE(nd_recv, "receiver");
- F_CUSTOM1(nd_mid, "operator") {
- switch (node->nd_mid) {
- case 0: A("0 (||)"); break;
- case 1: A("1 (&&)"); break;
- default: A_ID(node->nd_mid);
- }
- }
- F_NODE(nd_args->nd_head, "index");
+ F_ID(nd_vid, "operator");
+ F_NODE(nd_args->nd_body, "index");
LAST_NODE;
- F_NODE(nd_args->nd_body, "rvalue");
- return;
+ F_NODE(nd_args->nd_head, "rvalue");
+ break;
case NODE_OP_ASGN2:
ANN("attr assignment with operator");
ANN("format: [nd_value].[attr] [nd_next->nd_mid]= [nd_value]");
- ANN(" where [attr]: [nd_next->nd_vid]");
+ ANN(" where [attr] reader: [nd_next->nd_vid]");
+ ANN(" [attr] writer: [nd_next->nd_aid]");
ANN("example: struct.field += foo");
F_NODE(nd_recv, "receiver");
- F_CUSTOM1(nd_next->nd_vid, "attr") {
- if (node->nd_next->nd_aid) A("? ");
- A_ID(node->nd_next->nd_vid);
- }
- F_CUSTOM1(nd_next->nd_mid, "operator") {
- switch (node->nd_next->nd_mid) {
- case 0: A("0 (||)"); break;
- case 1: A("1 (&&)"); break;
- default: A_ID(node->nd_next->nd_mid);
- }
- }
+ F_ID(nd_next->nd_vid, "reader");
+ F_ID(nd_next->nd_aid, "writer");
+ F_CUSTOM1(nd_next->nd_mid, "operator", {
+ switch (node->nd_next->nd_mid) {
+ case 0: A("0 (||)"); break;
+ case 1: A("1 (&&)"); break;
+ default: A_ID(node->nd_next->nd_mid);
+ }
+ });
LAST_NODE;
F_NODE(nd_value, "rvalue");
- return;
+ break;
case NODE_OP_ASGN_AND:
ANN("assignment with && operator");
@@ -494,26 +377,9 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "variable");
LAST_NODE;
F_NODE(nd_value, "rvalue");
- return;
-
- case NODE_OP_CDECL:
- ANN("constant declaration with operator");
- ANN("format: [nd_head](constant) [nd_aid]= [nd_value]");
- ANN("example: A::B ||= 1");
- F_NODE(nd_head, "constant");
- F_CUSTOM1(nd_aid, "operator") {
- switch (node->nd_aid) {
- case 0: A("0 (||)"); break;
- case 1: A("1 (&&)"); break;
- default: A_ID(node->nd_mid);
- }
- }
- LAST_NODE;
- F_NODE(nd_value, "rvalue");
- return;
+ break;
case NODE_CALL:
- case NODE_OPCALL:
ANN("method invocation");
ANN("format: [nd_recv].[nd_mid]([nd_args])");
ANN("example: obj.foo(1)");
@@ -521,7 +387,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_recv, "receiver");
LAST_NODE;
F_NODE(nd_args, "arguments");
- return;
+ break;
case NODE_FCALL:
ANN("function call");
@@ -530,24 +396,14 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_mid, "method id");
LAST_NODE;
F_NODE(nd_args, "arguments");
- return;
+ break;
case NODE_VCALL:
ANN("function call with no argument");
ANN("format: [nd_mid]");
ANN("example: foo");
F_ID(nd_mid, "method id");
- return;
-
- case NODE_QCALL:
- ANN("safe method invocation");
- ANN("format: [nd_recv]&.[nd_mid]([nd_args])");
- ANN("example: obj&.foo(1)");
- F_ID(nd_mid, "method id");
- F_NODE(nd_recv, "receiver");
- LAST_NODE;
- F_NODE(nd_args, "arguments");
- return;
+ break;
case NODE_SUPER:
ANN("super invocation");
@@ -555,13 +411,13 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: super 1");
LAST_NODE;
F_NODE(nd_args, "arguments");
- return;
+ break;
case NODE_ZSUPER:
ANN("super invocation with no argument");
ANN("format: super");
ANN("example: super");
- return;
+ break;
case NODE_ARRAY:
ANN("array constructor");
@@ -573,35 +429,25 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("format: [ [nd_head], [nd_next].. ] (length: [nd_alen])");
ANN("example: return 1, 2, 3");
ary:
- dump_array(buf, indent, comment, node);
- return;
+ F_LONG(nd_alen, "length");
+ F_NODE(nd_head, "element");
+ LAST_NODE;
+ F_NODE(nd_next, "next element");
+ break;
case NODE_ZARRAY:
ANN("empty array constructor");
ANN("format: []");
ANN("example: []");
- return;
+ break;
case NODE_HASH:
- if (!node->nd_alen) {
- ANN("keyword arguments");
- ANN("format: nd_head");
- ANN("example: a: 1, b: 2");
- }
- else {
- ANN("hash constructor");
- ANN("format: { [nd_head] }");
- ANN("example: { 1 => 2, 3 => 4 }");
- }
- F_CUSTOM1(nd_alen, "keyword arguments or hash literal") {
- switch (node->nd_alen) {
- case 0: A("0 (keyword argument)"); break;
- case 1: A("1 (hash literal)"); break;
- }
- }
+ ANN("hash constructor");
+ ANN("format: { [nd_head] }");
+ ANN("example: { 1 => 2, 3 => 4 }");
LAST_NODE;
F_NODE(nd_head, "contents");
- return;
+ break;
case NODE_YIELD:
ANN("yield invocation");
@@ -609,85 +455,78 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: yield 1");
LAST_NODE;
F_NODE(nd_head, "arguments");
- return;
+ break;
case NODE_LVAR:
ANN("local variable reference");
ANN("format: [nd_vid](lvar)");
ANN("example: x");
- F_ID(nd_vid, "local variable");
- return;
+ goto var;
case NODE_DVAR:
ANN("dynamic variable reference");
ANN("format: [nd_vid](dvar)");
ANN("example: 1.times { x = 1; x }");
- F_ID(nd_vid, "local variable");
- return;
+ goto var;
case NODE_IVAR:
ANN("instance variable reference");
ANN("format: [nd_vid](ivar)");
ANN("example: @x");
- F_ID(nd_vid, "instance variable");
- return;
+ goto var;
case NODE_CONST:
ANN("constant reference");
ANN("format: [nd_vid](constant)");
ANN("example: X");
- F_ID(nd_vid, "constant");
- return;
+ goto var;
case NODE_CVAR:
ANN("class variable reference");
ANN("format: [nd_vid](cvar)");
ANN("example: @@x");
- F_ID(nd_vid, "class variable");
- return;
+ var:
+ F_ID(nd_vid, "local variable");
+ break;
case NODE_GVAR:
ANN("global variable reference");
ANN("format: [nd_entry](gvar)");
ANN("example: $x");
F_GENTRY(nd_entry, "global variable");
- return;
+ break;
case NODE_NTH_REF:
ANN("nth special variable reference");
ANN("format: $[nd_nth]");
ANN("example: $1, $2, ..");
- F_CUSTOM1(nd_nth, "variable") { A("$"); A_LONG(node->nd_nth); }
- return;
+ F_CUSTOM1(nd_nth, "variable", { A("$"); A_LONG(node->nd_nth); });
+ break;
case NODE_BACK_REF:
ANN("back special variable reference");
ANN("format: $[nd_nth]");
ANN("example: $&, $`, $', $+");
- F_CUSTOM1(nd_nth, "variable") {
- char name[3];
- name[0] = '$';
- name[1] = (char)node->nd_nth;
- name[2] = '\0';
- A(name);
- }
- return;
+ F_CUSTOM1(nd_nth, "variable", {
+ char name[3];
+ name[0] = '$';
+ name[1] = (char)node->nd_nth;
+ name[2] = '\0';
+ A(name);
+ });
+ break;
case NODE_MATCH:
ANN("match expression (against $_ implicitly)");
ANN("format: [nd_lit] (in condition)");
ANN("example: if /foo/; foo; end");
F_LIT(nd_lit, "regexp");
- return;
+ break;
case NODE_MATCH2:
ANN("match expression (regexp first)");
ANN("format: [nd_recv] =~ [nd_value]");
ANN("example: /foo/ =~ 'foo'");
F_NODE(nd_recv, "regexp (receiver)");
- if (!node->nd_args) LAST_NODE;
+ LAST_NODE;
F_NODE(nd_value, "string (argument)");
- if (node->nd_args) {
- LAST_NODE;
- F_NODE(nd_args, "named captures");
- }
- return;
+ break;
case NODE_MATCH3:
ANN("match expression (regexp second)");
@@ -696,7 +535,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_recv, "string (receiver)");
LAST_NODE;
F_NODE(nd_value, "regexp (argument)");
- return;
+ break;
case NODE_LIT:
ANN("literal");
@@ -714,7 +553,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: `foo`");
lit:
F_LIT(nd_lit, "literal");
- return;
+ break;
case NODE_DSTR:
ANN("string literal with interpolation");
@@ -731,16 +570,21 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("format: [nd_lit]");
ANN("example: /foo#{ bar }baz/");
goto dlit;
+ case NODE_DREGX_ONCE:
+ ANN("regexp literal with interpolation and once flag");
+ ANN("format: [nd_lit]");
+ ANN("example: /foo#{ bar }baz/o");
+ goto dlit;
case NODE_DSYM:
ANN("symbol literal with interpolation");
ANN("format: [nd_lit]");
ANN("example: :\"foo#{ bar }baz\"");
dlit:
- F_LIT(nd_lit, "preceding string");
- F_NODE(nd_next->nd_head, "interpolation");
+ F_LIT(nd_lit, "literal");
+ F_NODE(nd_next->nd_head, "preceding string");
LAST_NODE;
- F_NODE(nd_next->nd_next, "tailing strings");
- return;
+ F_NODE(nd_next->nd_next, "interpolation");
+ break;
case NODE_EVSTR:
ANN("interpolation expression");
@@ -748,7 +592,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: \"foo#{ bar }baz\"");
LAST_NODE;
F_NODE(nd_body, "body");
- return;
+ break;
case NODE_ARGSCAT:
ANN("splat argument following arguments");
@@ -757,7 +601,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "preceding array");
LAST_NODE;
F_NODE(nd_body, "following array");
- return;
+ break;
case NODE_ARGSPUSH:
ANN("splat argument following one argument");
@@ -766,7 +610,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "preceding array");
LAST_NODE;
F_NODE(nd_body, "following element");
- return;
+ break;
case NODE_SPLAT:
ANN("splat argument");
@@ -774,7 +618,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: foo(*ary)");
LAST_NODE;
F_NODE(nd_head, "splat'ed array");
- return;
+ break;
case NODE_BLOCK_PASS:
ANN("arguments with block argument");
@@ -783,7 +627,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_head, "other arguments");
LAST_NODE;
F_NODE(nd_body, "block argument");
- return;
+ break;
case NODE_DEFN:
ANN("method definition");
@@ -792,7 +636,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_mid, "method name");
LAST_NODE;
F_NODE(nd_defn, "method definition");
- return;
+ break;
case NODE_DEFS:
ANN("singleton method definition");
@@ -802,32 +646,32 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_mid, "method name");
LAST_NODE;
F_NODE(nd_defn, "method definition");
- return;
+ break;
case NODE_ALIAS:
ANN("method alias statement");
ANN("format: alias [u1.node] [u2.node]");
ANN("example: alias bar foo");
- F_NODE(nd_1st, "new name");
+ F_NODE(u1.node, "new name");
LAST_NODE;
- F_NODE(nd_2nd, "old name");
- return;
+ F_NODE(u2.node, "old name");
+ break;
case NODE_VALIAS:
ANN("global variable alias statement");
ANN("format: alias [u1.id](gvar) [u2.id](gvar)");
ANN("example: alias $y $x");
- F_ID(nd_alias, "new name");
- F_ID(nd_orig, "old name");
- return;
+ F_ID(u1.id, "new name");
+ F_ID(u2.id, "old name");
+ break;
case NODE_UNDEF:
ANN("method alias statement");
ANN("format: undef [u2.node]");
ANN("example: undef foo");
LAST_NODE;
- F_NODE(nd_undef, "old name");
- return;
+ F_NODE(u2.node, "old name");
+ break;
case NODE_CLASS:
ANN("class definition");
@@ -837,7 +681,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_super, "superclass");
LAST_NODE;
F_NODE(nd_body, "class definition");
- return;
+ break;
case NODE_MODULE:
ANN("module definition");
@@ -846,7 +690,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_cpath, "module path");
LAST_NODE;
F_NODE(nd_body, "module definition");
- return;
+ break;
case NODE_SCLASS:
ANN("singleton class definition");
@@ -855,7 +699,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_recv, "receiver");
LAST_NODE;
F_NODE(nd_body, "singleton class definition");
- return;
+ break;
case NODE_COLON2:
ANN("scoped constant reference");
@@ -864,14 +708,14 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_mid, "constant name");
LAST_NODE;
F_NODE(nd_head, "receiver");
- return;
+ break;
case NODE_COLON3:
ANN("top-level constant reference");
ANN("format: ::[nd_mid]");
ANN("example: ::Object");
F_ID(nd_mid, "constant name");
- return;
+ break;
case NODE_DOT2:
ANN("range constructor (incl.)");
@@ -896,44 +740,44 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_beg, "begin");
LAST_NODE;
F_NODE(nd_end, "end");
- return;
+ break;
case NODE_SELF:
ANN("self");
ANN("format: self");
ANN("example: self");
- return;
+ break;
case NODE_NIL:
ANN("nil");
ANN("format: nil");
ANN("example: nil");
- return;
+ break;
case NODE_TRUE:
ANN("true");
ANN("format: true");
ANN("example: true");
- return;
+ break;
case NODE_FALSE:
ANN("false");
ANN("format: false");
ANN("example: false");
- return;
+ break;
case NODE_ERRINFO:
ANN("virtual reference to $!");
ANN("format: rescue => id");
ANN("example: rescue => id");
- return;
+ break;
case NODE_DEFINED:
ANN("defined? expression");
ANN("format: defined?([nd_head])");
ANN("example: defined?(foo)");
F_NODE(nd_head, "expr");
- return;
+ break;
case NODE_POSTEXE:
ANN("post-execution");
@@ -941,30 +785,31 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: END { foo }");
LAST_NODE;
F_NODE(nd_body, "END clause");
- return;
+ break;
case NODE_ATTRASGN:
ANN("attr assignment");
ANN("format: [nd_recv].[nd_mid] = [nd_args]");
ANN("example: struct.field = foo");
- F_NODE(nd_recv, "receiver");
+ if (node->nd_recv == (NODE *) 1) {
+ F_MSG(nd_recv, "receiver", "1 (self)");
+ }
+ else {
+ F_NODE(nd_recv, "receiver");
+ }
F_ID(nd_mid, "method name");
LAST_NODE;
F_NODE(nd_args, "arguments");
- return;
+ break;
case NODE_PRELUDE:
ANN("pre-execution");
ANN("format: BEGIN { [nd_head] }; [nd_body]");
ANN("example: bar; BEGIN { foo }");
F_NODE(nd_head, "prelude");
- if (!node->nd_compile_option) LAST_NODE;
+ LAST_NODE;
F_NODE(nd_body, "body");
- if (node->nd_compile_option) {
- LAST_NODE;
- F_OPTION(nd_compile_option, "compile_option");
- }
- return;
+ break;
case NODE_LAMBDA:
ANN("lambda expression");
@@ -972,7 +817,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: -> { foo }");
LAST_NODE;
F_NODE(nd_body, "lambda clause");
- return;
+ break;
case NODE_OPT_ARG:
ANN("optional arguments");
@@ -981,7 +826,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_body, "body");
LAST_NODE;
F_NODE(nd_next, "next");
- return;
+ break;
case NODE_KW_ARG:
ANN("keyword arguments");
@@ -990,21 +835,21 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_body, "body");
LAST_NODE;
F_NODE(nd_next, "next");
- return;
+ break;
case NODE_POSTARG:
ANN("post arguments");
ANN("format: *[nd_1st], [nd_2nd..] = ..");
ANN("example: a, *rest, z = foo");
- if (node->nd_1st != NODE_SPECIAL_NO_NAME_REST) {
+ if ((VALUE)node->nd_1st != (VALUE)-1) {
F_NODE(nd_1st, "rest argument");
}
else {
- F_MSG(nd_1st, "rest argument", "NODE_SPECIAL_NO_NAME_REST (rest argument without name)");
+ F_MSG(nd_1st, "rest argument", "-1 (rest argument without name)");
}
LAST_NODE;
F_NODE(nd_2nd, "post arguments");
- return;
+ break;
case NODE_ARGS:
ANN("method parameters");
@@ -1018,34 +863,31 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_ainfo->rest_arg, "rest argument");
F_ID(nd_ainfo->block_arg, "block argument");
F_NODE(nd_ainfo->opt_args, "optional arguments");
- F_NODE(nd_ainfo->kw_args, "keyword arguments");
LAST_NODE;
+ F_NODE(nd_ainfo->kw_args, "keyword arguments");
F_NODE(nd_ainfo->kw_rest_arg, "keyword rest argument");
- return;
+ break;
case NODE_SCOPE:
ANN("new scope");
ANN("format: [nd_tbl]: local table, [nd_args]: arguments, [nd_body]: body");
- F_CUSTOM1(nd_tbl, "local table") {
- ID *tbl = node->nd_tbl;
- int i;
- int size = tbl ? (int)*tbl++ : 0;
- if (size == 0) A("(empty)");
- for (i = 0; i < size; i++) {
+ F_CUSTOM1(nd_tbl, "local table", {
+ ID *tbl = node->nd_tbl;
+ int i;
+ int size = tbl ? (int)*tbl++ : 0;
+ if (size == 0) A("(empty)");
+ for (i = 0; i < size; i++) {
A_ID(tbl[i]); if (i < size - 1) A(",");
- }
- }
+ }
+ });
F_NODE(nd_args, "arguments");
LAST_NODE;
F_NODE(nd_body, "body");
- return;
-
- case NODE_ARGS_AUX:
- case NODE_LAST:
break;
- }
- rb_bug("dump_node: unknown node: %s", ruby_node_name(nd_type(node)));
+ default:
+ rb_bug("dump_node: unknown node: %s", ruby_node_name(nd_type(node)));
+ }
}
VALUE
@@ -1061,126 +903,183 @@ rb_parser_dump_tree(NODE *node, int comment)
return buf;
}
-/* Setup NODE strucutre.
- * NODE is not an object managed by GC, but it imitates an object
- * so that it can work with `RB_TYPE_P(obj, T_NODE)`.
- * This dirty hack is needed because Ripper jumbles NODEs and other type
- * objects.
- */
void
-rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
+rb_gc_free_node(VALUE obj)
{
- n->flags = T_NODE;
- nd_set_type(n, type);
- n->u1.value = a0;
- n->u2.value = a1;
- n->u3.value = a2;
- n->nd_loc.first_loc.lineno = 0;
- n->nd_loc.first_loc.column = 0;
- n->nd_loc.last_loc.lineno = 0;
- n->nd_loc.last_loc.column = 0;
-}
-
-typedef struct node_buffer_elem_struct {
- struct node_buffer_elem_struct *next;
- NODE buf[1]; /* flexible array */
-} node_buffer_elem_t;
-
-struct node_buffer_struct {
- long idx, len;
- node_buffer_elem_t *head;
- node_buffer_elem_t body; /* this should be a last, because body has flexible array */
-};
-
-static node_buffer_t *
-rb_node_buffer_new(void)
-{
- node_buffer_t *nb = xmalloc(offsetof(node_buffer_t, body) + offsetof(node_buffer_elem_t, buf) + 16 * sizeof(NODE));
- nb->idx = 0;
- nb->len = 16;
- nb->head = &nb->body;
- nb->head->next = NULL;
- return nb;
-}
-
-static void
-rb_node_buffer_free(node_buffer_t *nb)
-{
- node_buffer_elem_t *nbe = nb->head;
-
- while (nbe != &nb->body) {
- void *buf = nbe;
- nbe = nbe->next;
- xfree(buf);
+ switch (nd_type(obj)) {
+ case NODE_SCOPE:
+ if (RNODE(obj)->nd_tbl) {
+ xfree(RNODE(obj)->nd_tbl);
+ }
+ break;
+ case NODE_ARGS:
+ if (RNODE(obj)->nd_ainfo) {
+ xfree(RNODE(obj)->nd_ainfo);
+ }
+ break;
+ case NODE_ALLOCA:
+ xfree(RNODE(obj)->u1.node);
+ break;
}
- xfree(nb);
}
-NODE *
-rb_ast_newnode(rb_ast_t *ast)
+size_t
+rb_node_memsize(VALUE obj)
{
- node_buffer_t *nb = ast->node_buffer;
- if (nb->idx >= nb->len) {
- long n = nb->len * 2;
- node_buffer_elem_t *nbe;
- nbe = xmalloc(offsetof(node_buffer_elem_t, buf) + n * sizeof(NODE));
- nb->idx = 0;
- nb->len = n;
- nbe->next = nb->head;
- nb->head = nbe;
+ size_t size = 0;
+ switch (nd_type(obj)) {
+ case NODE_SCOPE:
+ if (RNODE(obj)->nd_tbl) {
+ size += (RNODE(obj)->nd_tbl[0]+1) * sizeof(*RNODE(obj)->nd_tbl);
+ }
+ break;
+ case NODE_ARGS:
+ if (RNODE(obj)->nd_ainfo) {
+ size += sizeof(*RNODE(obj)->nd_ainfo);
+ }
+ break;
+ case NODE_ALLOCA:
+ size += RNODE(obj)->nd_cnt * sizeof(VALUE);
+ break;
}
- return &nb->head->buf[nb->idx++];
+ return size;
}
-void
-rb_ast_delete_node(rb_ast_t *ast, NODE *n)
+VALUE
+rb_gc_mark_node(NODE *obj)
{
- (void)ast;
- (void)n;
- /* should we implement freelist? */
-}
+ 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:
+ rb_gc_mark(RNODE(obj)->u2.value);
+ /* 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:
+ rb_gc_mark(RNODE(obj)->u1.value);
+ /* fall through */
+ case NODE_SUPER: /* 3 */
+ case NODE_FCALL:
+ case NODE_DEFN:
+ case NODE_ARGS_AUX:
+ return RNODE(obj)->u3.value;
-rb_ast_t *
-rb_ast_new(void)
-{
- return (rb_ast_t *)rb_imemo_new(imemo_ast, 0, (VALUE)rb_node_buffer_new(), rb_ary_tmp_new(0), 0);
-}
+ 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:
+ rb_gc_mark(RNODE(obj)->u1.value);
+ /* 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:
+ return RNODE(obj)->u2.value;
-void
-rb_ast_mark(rb_ast_t *ast)
-{
- if (ast->node_buffer) rb_gc_mark(ast->mark_ary);
-}
+ 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:
+ return RNODE(obj)->u1.value;
-void
-rb_ast_free(rb_ast_t *ast)
-{
- if (ast->node_buffer) {
- rb_node_buffer_free(ast->node_buffer);
- ast->node_buffer = 0;
- }
-}
+ case NODE_SCOPE: /* 2,3 */
+ case NODE_CDECL:
+ case NODE_OPT_ARG:
+ rb_gc_mark(RNODE(obj)->u3.value);
+ return RNODE(obj)->u2.value;
+
+ case NODE_ARGS: /* custom */
+ {
+ struct rb_args_info *args = obj->u3.args;
+ if (args) {
+ if (args->pre_init) rb_gc_mark((VALUE)args->pre_init);
+ if (args->post_init) rb_gc_mark((VALUE)args->post_init);
+ if (args->opt_args) rb_gc_mark((VALUE)args->opt_args);
+ if (args->kw_args) rb_gc_mark((VALUE)args->kw_args);
+ if (args->kw_rest_arg) rb_gc_mark((VALUE)args->kw_rest_arg);
+ }
+ }
+ return RNODE(obj)->u2.value;
-void
-rb_ast_dispose(rb_ast_t *ast)
-{
- rb_ast_free(ast);
- RB_OBJ_WRITE(ast, &ast->mark_ary, Qnil);
-}
+ 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:
+ rb_gc_mark_locations((VALUE*)RNODE(obj)->u1.value,
+ (VALUE*)RNODE(obj)->u1.value + RNODE(obj)->u3.cnt);
+ rb_gc_mark(RNODE(obj)->u2.value);
+ break;
-void
-rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj)
-{
- rb_ary_push(ast->mark_ary, obj);
-}
+ case NODE_CREF:
+ rb_gc_mark(obj->nd_refinements);
+ rb_gc_mark(RNODE(obj)->nd_clss);
+ return (VALUE)RNODE(obj)->nd_next;
-void
-rb_ast_delete_mark_object(rb_ast_t *ast, VALUE obj)
-{
- long i;
- for (i = 0; i < RARRAY_LEN(ast->mark_ary); i++) {
- if (obj == RARRAY_AREF(ast->mark_ary, i)) {
- RARRAY_ASET(ast->mark_ary, i, Qnil);
- }
+ default: /* unlisted NODE */
+ rb_gc_mark_maybe(RNODE(obj)->u1.value);
+ rb_gc_mark_maybe(RNODE(obj)->u2.value);
+ rb_gc_mark_maybe(RNODE(obj)->u3.value);
}
+ return 0;
}
diff --git a/node.h b/node.h
index 9730edeea2..5055af438f 100644
--- a/node.h
+++ b/node.h
@@ -26,14 +26,12 @@ enum node_type {
#define NODE_BLOCK NODE_BLOCK
NODE_IF,
#define NODE_IF NODE_IF
- NODE_UNLESS,
-#define NODE_UNLESS NODE_UNLESS
NODE_CASE,
#define NODE_CASE NODE_CASE
- NODE_CASE2,
-#define NODE_CASE2 NODE_CASE2
NODE_WHEN,
#define NODE_WHEN NODE_WHEN
+ NODE_OPT_N,
+#define NODE_OPT_N NODE_OPT_N
NODE_WHILE,
#define NODE_WHILE NODE_WHILE
NODE_UNTIL,
@@ -74,10 +72,14 @@ enum node_type {
#define NODE_GASGN NODE_GASGN
NODE_IASGN,
#define NODE_IASGN NODE_IASGN
+ NODE_IASGN2,
+#define NODE_IASGN2 NODE_IASGN2
NODE_CDECL,
#define NODE_CDECL NODE_CDECL
NODE_CVASGN,
#define NODE_CVASGN NODE_CVASGN
+ NODE_CVDECL,
+#define NODE_CVDECL NODE_CVDECL
NODE_OP_ASGN1,
#define NODE_OP_ASGN1 NODE_OP_ASGN1
NODE_OP_ASGN2,
@@ -90,14 +92,10 @@ enum node_type {
#define NODE_OP_CDECL NODE_OP_CDECL
NODE_CALL,
#define NODE_CALL NODE_CALL
- NODE_OPCALL,
-#define NODE_OPCALL NODE_OPCALL
NODE_FCALL,
#define NODE_FCALL NODE_FCALL
NODE_VCALL,
#define NODE_VCALL NODE_VCALL
- NODE_QCALL,
-#define NODE_QCALL NODE_QCALL
NODE_SUPER,
#define NODE_SUPER NODE_SUPER
NODE_ZSUPER,
@@ -150,6 +148,8 @@ enum node_type {
#define NODE_EVSTR NODE_EVSTR
NODE_DREGX,
#define NODE_DREGX NODE_DREGX
+ NODE_DREGX_ONCE,
+#define NODE_DREGX_ONCE NODE_DREGX_ONCE
NODE_ARGS,
#define NODE_ARGS NODE_ARGS
NODE_ARGS_AUX,
@@ -166,6 +166,10 @@ enum node_type {
#define NODE_ARGSPUSH NODE_ARGSPUSH
NODE_SPLAT,
#define NODE_SPLAT NODE_SPLAT
+ NODE_TO_ARY,
+#define NODE_TO_ARY NODE_TO_ARY
+ NODE_BLOCK_ARG,
+#define NODE_BLOCK_ARG NODE_BLOCK_ARG
NODE_BLOCK_PASS,
#define NODE_BLOCK_PASS NODE_BLOCK_PASS
NODE_DEFN,
@@ -188,6 +192,8 @@ enum node_type {
#define NODE_COLON2 NODE_COLON2
NODE_COLON3,
#define NODE_COLON3 NODE_COLON3
+ NODE_CREF,
+#define NODE_CREF NODE_CREF
NODE_DOT2,
#define NODE_DOT2 NODE_DOT2
NODE_DOT3,
@@ -210,6 +216,14 @@ enum node_type {
#define NODE_DEFINED NODE_DEFINED
NODE_POSTEXE,
#define NODE_POSTEXE NODE_POSTEXE
+ NODE_ALLOCA,
+#define NODE_ALLOCA NODE_ALLOCA
+ NODE_BMETHOD,
+#define NODE_BMETHOD NODE_BMETHOD
+ NODE_MEMO,
+#define NODE_MEMO NODE_MEMO
+ NODE_IFUNC,
+#define NODE_IFUNC NODE_IFUNC
NODE_DSYM,
#define NODE_DSYM NODE_DSYM
NODE_ATTRASGN,
@@ -222,18 +236,9 @@ enum node_type {
#define NODE_LAST NODE_LAST
};
-typedef struct rb_code_location_struct {
- int lineno;
- int column;
-} rb_code_location_t;
-
-typedef struct rb_code_range_struct {
- rb_code_location_t first_loc;
- rb_code_location_t last_loc;
-} rb_code_range_t;
-
typedef struct RNode {
VALUE flags;
+ VALUE nd_reserved; /* ex nd_file */
union {
struct RNode *node;
ID id;
@@ -256,42 +261,35 @@ typedef struct RNode {
long cnt;
VALUE value;
} u3;
- rb_code_range_t nd_loc;
} NODE;
#define RNODE(obj) (R_CAST(RNode)(obj))
-/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: TAINT, 9: UNTRUSTED, 10: EXIVAR, 11: FREEZE */
-/* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE,
+/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: TAINT, 9: UNTRUSTERD, 10: EXIVAR, 11: FREEZE */
+/* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE|NODE_FL_CREF_PUSHED_BY_EVAL,
* 8..14: nd_type,
- * 15..: nd_line
+ * 15..: nd_line or
+ * 15: NODE_FL_CREF_PUSHED_BY_EVAL
+ * 16: NODE_FL_CREF_OMOD_SHARED
*/
-#define NODE_FL_NEWLINE (((VALUE)1)<<7)
+#define NODE_FL_NEWLINE (((VALUE)1)<<7)
+#define NODE_FL_CREF_PUSHED_BY_EVAL (((VALUE)1)<<15)
+#define NODE_FL_CREF_OMOD_SHARED (((VALUE)1)<<16)
#define NODE_TYPESHIFT 8
#define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
-#define nd_type(n) ((int) (((n)->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
+#define nd_type(n) ((int) (((RNODE(n))->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
#define nd_set_type(n,t) \
- (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
+ RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
-#define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT)
+#define nd_line(n) (int)(RNODE(n)->flags>>NODE_LSHIFT)
#define nd_set_line(n,l) \
- (n)->flags=(((n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
-
-#define nd_first_column(n) ((int)((n)->nd_loc.first_loc.column))
-#define nd_set_first_column(n, v) ((n)->nd_loc.first_loc.column = (v))
-#define nd_first_lineno(n) ((int)((n)->nd_loc.first_loc.lineno))
-#define nd_set_first_lineno(n, v) ((n)->nd_loc.first_loc.lineno = (v))
+ RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
-#define nd_last_column(n) ((int)((n)->nd_loc.last_loc.column))
-#define nd_set_last_column(n, v) ((n)->nd_loc.last_loc.column = (v))
-#define nd_last_lineno(n) ((int)((n)->nd_loc.last_loc.lineno))
-#define nd_set_last_lineno(n, v) ((n)->nd_loc.last_loc.lineno = (v))
-#define nd_last_loc(n) ((n)->nd_loc.last_loc)
-#define nd_set_last_loc(n, v) (nd_last_loc(n) = (v))
+#define nd_refinements nd_reserved
#define nd_head u1.node
#define nd_alen u2.argc
@@ -301,6 +299,8 @@ typedef struct RNode {
#define nd_body u2.node
#define nd_else u3.node
+#define nd_orig u3.value
+
#define nd_resq u2.node
#define nd_ensr u3.node
@@ -346,6 +346,9 @@ typedef struct RNode {
#define nd_cpath u1.node
#define nd_super u3.node
+#define nd_modl u1.id
+#define nd_clss u1.value
+
#define nd_beg u1.node
#define nd_end u2.node
#define nd_state u3.state
@@ -354,24 +357,22 @@ typedef struct RNode {
#define nd_nth u2.argc
#define nd_tag u1.id
+#define nd_tval u2.value
-#define nd_alias u1.id
-#define nd_orig u2.id
-#define nd_undef u2.node
-
-#define nd_compile_option u3.value
+#define nd_visi u2.argc
#define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
#define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d))
#define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d))
+#define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
#define NEW_SCOPE(a,b) NEW_NODE(NODE_SCOPE,local_tbl(),b,a)
#define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
#define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
-#define NEW_UNLESS(c,t,e) NEW_NODE(NODE_UNLESS,c,t,e)
+#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
#define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0)
-#define NEW_CASE2(b) NEW_NODE(NODE_CASE2,0,b,0)
#define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e)
+#define NEW_OPT_N(b) NEW_NODE(NODE_OPT_N,0,b,0)
#define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
#define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
#define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i)
@@ -397,11 +398,13 @@ typedef struct RNode {
#define NEW_DASGN(v,val) NEW_NODE(NODE_DASGN,v,val,0)
#define NEW_DASGN_CURR(v,val) NEW_NODE(NODE_DASGN_CURR,v,val,0)
#define NEW_IASGN(v,val) NEW_NODE(NODE_IASGN,v,val,0)
+#define NEW_IASGN2(v,val) NEW_NODE(NODE_IASGN2,v,val,0)
#define NEW_CDECL(v,val,path) NEW_NODE(NODE_CDECL,v,val,path)
#define NEW_CVASGN(v,val) NEW_NODE(NODE_CVASGN,v,val,0)
+#define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
#define NEW_OP_ASGN1(p,id,a) NEW_NODE(NODE_OP_ASGN1,p,id,a)
-#define NEW_OP_ASGN2(r,t,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o,t))
-#define NEW_OP_ASGN22(i,o,t) NEW_NODE(NODE_OP_ASGN2,i,o,t)
+#define NEW_OP_ASGN2(r,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
+#define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
#define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
#define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
#define NEW_OP_CDECL(v,op,val) NEW_NODE(NODE_OP_CDECL,v,val,op)
@@ -424,7 +427,6 @@ typedef struct RNode {
#define NEW_DSYM(s) NEW_NODE(NODE_DSYM,s,0,0)
#define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
#define NEW_CALL(r,m,a) NEW_NODE(NODE_CALL,r,m,a)
-#define NEW_OPCALL(r,m,a) NEW_NODE(NODE_OPCALL,r,m,a)
#define NEW_FCALL(m,a) NEW_NODE(NODE_FCALL,0,m,a)
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
#define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
@@ -436,6 +438,8 @@ typedef struct RNode {
#define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
#define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
#define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
+#define NEW_TO_ARY(a) NEW_NODE(NODE_TO_ARY,a,0,0)
+#define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
#define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)
#define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,n,o,0)
#define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,n,o,0)
@@ -445,6 +449,7 @@ typedef struct RNode {
#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b),0)
#define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
#define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
+#define NEW_CREF(a) NEW_NODE(NODE_CREF,a,0,0)
#define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
#define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
#define NEW_SELF() NEW_NODE(NODE_SELF,0,0,0)
@@ -455,52 +460,52 @@ typedef struct RNode {
#define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0)
#define NEW_PREEXE(b) NEW_SCOPE(b)
#define NEW_POSTEXE(b) NEW_NODE(NODE_POSTEXE,0,b,0)
+#define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
#define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
-#define NEW_PRELUDE(p,b,o) NEW_NODE(NODE_PRELUDE,p,b,o)
+#define NEW_PRELUDE(p,b) NEW_NODE(NODE_PRELUDE,p,b,0)
+#define NEW_MEMO(a,b,c) NEW_NODE(NODE_MEMO,a,b,c)
-#define NODE_SPECIAL_REQUIRED_KEYWORD ((NODE *)-1)
-#define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1)
+#define roomof(x, y) ((sizeof(x) + sizeof(y) - 1) / sizeof(y))
+#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
+#define NEW_MEMO_FOR(type, value) \
+ ((value) = rb_ary_tmp_new_fill(roomof(type, VALUE)), MEMO_FOR(type, value))
RUBY_SYMBOL_EXPORT_BEGIN
-typedef struct node_buffer_struct node_buffer_t;
-/* T_IMEMO/ast */
-typedef struct rb_ast_struct {
- VALUE flags;
- VALUE reserved1;
- NODE *root;
- node_buffer_t *node_buffer;
- VALUE mark_ary;
-} rb_ast_t;
-rb_ast_t *rb_ast_new();
-void rb_ast_mark(rb_ast_t*);
-void rb_ast_dispose(rb_ast_t*);
-void rb_ast_free(rb_ast_t*);
-void rb_ast_add_mark_object(rb_ast_t*, VALUE);
-void rb_ast_delete_mark_object(rb_ast_t*, VALUE);
-NODE *rb_ast_newnode(rb_ast_t*);
-void rb_ast_delete_node(rb_ast_t*, NODE *n);
-
VALUE rb_parser_new(void);
VALUE rb_parser_end_seen_p(VALUE);
VALUE rb_parser_encoding(VALUE);
VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
VALUE rb_parser_dump_tree(NODE *node, int comment);
-void rb_parser_set_options(VALUE, int, int, int, int);
-
-rb_ast_t *rb_parser_compile_cstr(VALUE, const char*, const char*, int, int);
-rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int);
-rb_ast_t *rb_parser_compile_file(VALUE, const char*, VALUE, int);
-rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
-rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
-
-rb_ast_t *rb_compile_cstr(const char*, const char*, int, int);
-rb_ast_t *rb_compile_string(const char*, VALUE, int);
-rb_ast_t *rb_compile_file(const char*, VALUE, int);
-
-void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2);
+NODE *rb_parser_append_print(VALUE, NODE *);
+NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
+
+NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
+NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
+NODE *rb_parser_compile_file(volatile VALUE, const char*, VALUE, int);
+NODE *rb_parser_compile_string_path(volatile VALUE vparser, VALUE fname, VALUE src, int line);
+NODE *rb_parser_compile_file_path(volatile VALUE vparser, VALUE fname, VALUE input, int line);
+
+NODE *rb_compile_cstr(const char*, const char*, int, int);
+NODE *rb_compile_string(const char*, VALUE, int);
+NODE *rb_compile_file(const char*, VALUE, int);
+
+NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
+NODE *rb_node_newnode_longlife(enum node_type,VALUE,VALUE,VALUE);
+void rb_gc_free_node(VALUE obj);
+size_t rb_node_memsize(VALUE obj);
+VALUE rb_gc_mark_node(NODE *obj);
+
+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 *);
const struct kwtable *rb_reserved_word(const char *, unsigned int);
struct rb_args_info {
@@ -526,7 +531,6 @@ void *rb_parser_malloc(struct parser_params *, size_t);
void *rb_parser_realloc(struct parser_params *, void *, size_t);
void *rb_parser_calloc(struct parser_params *, size_t, size_t);
void rb_parser_free(struct parser_params *, void *);
-void rb_parser_printf(struct parser_params *parser, const char *fmt, ...);
RUBY_SYMBOL_EXPORT_END
diff --git a/numeric.c b/numeric.c
index d0531fa69c..2fdfaafda0 100644
--- a/numeric.c
+++ b/numeric.c
@@ -9,14 +9,19 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "ruby/util.h"
+#include "internal.h"
#include "id.h"
-#include <assert.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
+#if defined(__FreeBSD__) && __FreeBSD__ < 4
+#include <floatingpoint.h>
+#endif
+
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
@@ -25,6 +30,14 @@
#include <ieeefp.h>
#endif
+#if !defined HAVE_ISFINITE && !defined isfinite
+#if defined HAVE_FINITE && !defined finite && !defined _WIN32
+extern int finite(double);
+# define HAVE_ISFINITE 1
+# define isfinite(x) finite(x)
+#endif
+#endif
+
/* use IEEE 64bit values if not defined */
#ifndef FLT_RADIX
#define FLT_RADIX 2
@@ -92,85 +105,11 @@ round(double x)
}
#endif
-static double
-round_half_up(double x, double s)
-{
- double f, xs = x * s;
-
- f = round(xs);
- if (s == 1.0) return f;
- if (x > 0) {
- if ((double)((f + 0.5) / s) <= x) f += 1;
- x = f;
- }
- else {
- if ((double)((f - 0.5) / s) >= x) f -= 1;
- x = f;
- }
- return x;
-}
-
-static double
-round_half_down(double x, double s)
-{
- double f, xs = x * s;
-
- f = round(xs);
- if (x > 0) {
- if ((double)((f - 0.5) / s) >= x) f -= 1;
- x = f;
- }
- else {
- if ((double)((f + 0.5) / s) <= x) f += 1;
- x = f;
- }
- return x;
-}
-
-static double
-round_half_even(double x, double s)
-{
- double f, d, xs = x * s;
-
- if (x > 0.0) {
- f = floor(xs);
- d = xs - f;
- if (d > 0.5)
- d = 1.0;
- else if (d == 0.5 || ((double)((f + 0.5) / s) <= x))
- d = fmod(f, 2.0);
- else
- d = 0.0;
- x = f + d;
- }
- else if (x < 0.0) {
- f = ceil(xs);
- d = f - xs;
- if (d > 0.5)
- d = 1.0;
- else if (d == 0.5 || ((double)((f - 0.5) / s) >= x))
- d = fmod(-f, 2.0);
- else
- d = 0.0;
- x = f - d;
- }
- return x;
-}
-
static VALUE fix_uminus(VALUE num);
static VALUE fix_mul(VALUE x, VALUE y);
-static VALUE fix_lshift(long, unsigned long);
-static VALUE fix_rshift(long, unsigned long);
static VALUE int_pow(long x, unsigned long y);
-static VALUE int_even_p(VALUE x);
-static int int_round_zero_p(VALUE num, int ndigits);
-VALUE rb_int_floor(VALUE num, int ndigits);
-VALUE rb_int_ceil(VALUE num, int ndigits);
-static VALUE flo_to_i(VALUE num);
-static int float_round_overflow(int ndigits, int binexp);
-static int float_round_underflow(int ndigits, int binexp);
-
-static ID id_coerce, id_div, id_divmod;
+
+static ID id_coerce, id_div;
#define id_to_i idTo_i
#define id_eq idEq
#define id_cmp idCmp
@@ -178,9 +117,7 @@ static ID id_coerce, id_div, id_divmod;
VALUE rb_cNumeric;
VALUE rb_cFloat;
VALUE rb_cInteger;
-#ifndef RUBY_INTEGER_UNIFICATION
VALUE rb_cFixnum;
-#endif
VALUE rb_eZeroDivError;
VALUE rb_eFloatDomainError;
@@ -193,49 +130,6 @@ rb_num_zerodiv(void)
rb_raise(rb_eZeroDivError, "divided by 0");
}
-enum ruby_num_rounding_mode
-rb_num_get_rounding_option(VALUE opts)
-{
- static ID round_kwds[1];
- VALUE rounding;
- VALUE str;
- const char *s;
-
- if (!NIL_P(opts)) {
- if (!round_kwds[0]) {
- round_kwds[0] = rb_intern_const("half");
- }
- if (!rb_get_kwargs(opts, round_kwds, 0, 1, &rounding)) goto noopt;
- if (SYMBOL_P(rounding)) {
- str = rb_sym2str(rounding);
- }
- else if (NIL_P(rounding)) {
- goto noopt;
- }
- else if (!RB_TYPE_P(str = rounding, T_STRING)) {
- str = rb_check_string_type(rounding);
- if (NIL_P(str)) goto invalid;
- }
- s = RSTRING_PTR(str);
- switch (RSTRING_LEN(str)) {
- case 2:
- if (rb_memcicmp(s, "up", 2) == 0)
- return RUBY_NUM_ROUND_HALF_UP;
- break;
- case 4:
- if (rb_memcicmp(s, "even", 4) == 0)
- return RUBY_NUM_ROUND_HALF_EVEN;
- if (strncasecmp(s, "down", 4) == 0)
- return RUBY_NUM_ROUND_HALF_DOWN;
- break;
- }
- invalid:
- rb_raise(rb_eArgError, "invalid rounding mode: % "PRIsVALUE, rounding);
- }
- noopt:
- return RUBY_NUM_ROUND_DEFAULT;
-}
-
/* experimental API */
int
rb_num_to_uint(VALUE val, unsigned int *ret)
@@ -271,104 +165,50 @@ rb_num_to_uint(VALUE val, unsigned int *ret)
#define method_basic_p(klass) rb_method_basic_definition_p(klass, mid)
static inline int
-int_pos_p(VALUE num)
+positive_int_p(VALUE num)
{
+ const ID mid = '>';
+
if (FIXNUM_P(num)) {
- return FIXNUM_POSITIVE_P(num);
+ if (method_basic_p(rb_cFixnum))
+ return (SIGNED_VALUE)num > 0;
}
else if (RB_TYPE_P(num, T_BIGNUM)) {
- return BIGNUM_POSITIVE_P(num);
+ if (method_basic_p(rb_cBignum))
+ return BIGNUM_POSITIVE_P(num);
}
- rb_raise(rb_eTypeError, "not an Integer");
+ return RTEST(rb_funcall(num, mid, 1, INT2FIX(0)));
}
static inline int
-int_neg_p(VALUE num)
+negative_int_p(VALUE num)
{
+ const ID mid = '<';
+
if (FIXNUM_P(num)) {
- return FIXNUM_NEGATIVE_P(num);
+ if (method_basic_p(rb_cFixnum))
+ return (SIGNED_VALUE)num < 0;
}
else if (RB_TYPE_P(num, T_BIGNUM)) {
- return BIGNUM_NEGATIVE_P(num);
+ if (method_basic_p(rb_cBignum))
+ return BIGNUM_NEGATIVE_P(num);
}
- rb_raise(rb_eTypeError, "not an Integer");
+ return RTEST(rb_funcall(num, mid, 1, INT2FIX(0)));
}
int
rb_num_negative_p(VALUE num)
{
- return rb_num_negative_int_p(num);
-}
-
-static VALUE
-num_funcall_op_0(VALUE x, VALUE arg, int recursive)
-{
- ID func = (ID)arg;
- if (recursive) {
- const char *name = rb_id2name(func);
- if (ISALNUM(name[0])) {
- rb_name_error(func, "%"PRIsVALUE".%"PRIsVALUE,
- x, ID2SYM(func));
- }
- else if (name[0] && name[1] == '@' && !name[2]) {
- rb_name_error(func, "%c%"PRIsVALUE,
- name[0], x);
- }
- else {
- rb_name_error(func, "%"PRIsVALUE"%"PRIsVALUE,
- ID2SYM(func), x);
- }
- }
- return rb_funcallv(x, func, 0, 0);
-}
-
-static VALUE
-num_funcall0(VALUE x, ID func)
-{
- return rb_exec_recursive(num_funcall_op_0, x, (VALUE)func);
-}
-
-static void
-num_funcall_op_1_recursion(VALUE x, ID func, VALUE y)
-{
- const char *name = rb_id2name(func);
- if (ISALNUM(name[0])) {
- rb_name_error(func, "%"PRIsVALUE".%"PRIsVALUE"(%"PRIsVALUE")",
- x, ID2SYM(func), y);
- }
- else {
- rb_name_error(func, "%"PRIsVALUE"%"PRIsVALUE"%"PRIsVALUE,
- x, ID2SYM(func), y);
- }
-}
-
-static VALUE
-num_funcall_op_1(VALUE y, VALUE arg, int recursive)
-{
- ID func = (ID)((VALUE *)arg)[0];
- VALUE x = ((VALUE *)arg)[1];
- if (recursive) {
- num_funcall_op_1_recursion(x, func, y);
- }
- return rb_funcall(x, func, 1, y);
-}
-
-static VALUE
-num_funcall1(VALUE x, ID func, VALUE y)
-{
- VALUE args[2];
- args[0] = (VALUE)func;
- args[1] = x;
- return rb_exec_recursive_paired(num_funcall_op_1, y, x, (VALUE)args);
+ return negative_int_p(num);
}
/*
* call-seq:
* num.coerce(numeric) -> array
*
- * If +numeric+ is the same type as +num+, returns an array
- * <code>[numeric, num]</code>. Otherwise, returns an array with both
- * +numeric+ and +num+ represented as Float objects.
+ * If a +numeric is the same type as +num+, returns an array containing
+ * +numeric+ and +num+. Otherwise, returns an array with both a +numeric+ and
+ * +num+ represented as Float objects.
*
* This coercion mechanism is used by Ruby to handle mixed-type numeric
* operations: it is intended to find a compatible common type between the two
@@ -389,35 +229,63 @@ num_coerce(VALUE x, VALUE y)
return rb_assoc_new(y, x);
}
+static VALUE
+coerce_body(VALUE *x)
+{
+ return rb_funcall(x[1], id_coerce, 1, x[0]);
+}
+
NORETURN(static void coerce_failed(VALUE x, VALUE y));
static void
coerce_failed(VALUE x, VALUE y)
{
- if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
- y = rb_inspect(y);
- }
- else {
- y = rb_obj_class(y);
- }
rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
- y, rb_obj_class(x));
+ (rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)),
+ rb_obj_class(x));
+}
+
+static VALUE
+coerce_rescue(VALUE *x)
+{
+ coerce_failed(x[0], x[1]);
+ return Qnil; /* dummy */
+}
+
+static VALUE
+coerce_rescue_quiet(VALUE *x)
+{
+ return Qundef;
}
static int
do_coerce(VALUE *x, VALUE *y, int err)
{
- VALUE ary = rb_check_funcall(*y, id_coerce, 1, x);
- if (ary == Qundef) {
+ VALUE ary;
+ VALUE a[2];
+
+ a[0] = *x; a[1] = *y;
+
+ if (!rb_respond_to(*y, id_coerce)) {
if (err) {
- coerce_failed(*x, *y);
+ coerce_rescue(a);
}
return FALSE;
}
- if (!err && NIL_P(ary)) {
+
+ ary = rb_rescue(coerce_body, (VALUE)a, err ? coerce_rescue : coerce_rescue_quiet, (VALUE)a);
+ if (ary == Qundef) {
+ rb_warn("Numerical comparison operators will no more rescue exceptions of #coerce");
+ rb_warn("in the next release. Return nil in #coerce if the coercion is impossible.");
return FALSE;
}
if (!RB_TYPE_P(ary, T_ARRAY) || RARRAY_LEN(ary) != 2) {
- rb_raise(rb_eTypeError, "coerce must return [x, y]");
+ if (err) {
+ rb_raise(rb_eTypeError, "coerce must return [x, y]");
+ } else if (!NIL_P(ary)) {
+ rb_warn("Bad return value for #coerce, called by numerical comparison operators.");
+ rb_warn("#coerce must return [x, y]. The next release will raise an error for this.");
+ }
+ return FALSE;
}
*x = RARRAY_AREF(ary, 0);
@@ -454,8 +322,6 @@ rb_num_coerce_relop(VALUE x, VALUE y, ID func)
}
/*
- * :nodoc:
- *
* Trap attempts to add methods to Numeric objects. Always raises a TypeError.
*
* Numerics should be values; singleton_methods should not be added to them.
@@ -475,43 +341,24 @@ num_sadded(VALUE x, VALUE name)
UNREACHABLE;
}
-#if 0
/*
- * call-seq:
- * num.clone(freeze: true) -> num
+ * Numerics are immutable values, which should not be copied.
*
- * Returns the receiver. +freeze+ cannot be +false+.
+ * Any attempt to use this method on a Numeric will raise a TypeError.
*/
static VALUE
-num_clone(int argc, VALUE *argv, VALUE x)
+num_init_copy(VALUE x, VALUE y)
{
- return rb_immutable_obj_clone(argc, argv, x);
-}
-#else
-# define num_clone rb_immutable_obj_clone
-#endif
+ rb_raise(rb_eTypeError, "can't copy %"PRIsVALUE, rb_obj_class(x));
-#if 0
-/*
- * call-seq:
- * num.dup -> num
- *
- * Returns the receiver.
- */
-static VALUE
-num_dup(VALUE x)
-{
- return x;
+ UNREACHABLE;
}
-#else
-# define num_dup num_uplus
-#endif
/*
* call-seq:
* +num -> num
*
- * Unary Plus---Returns the receiver.
+ * Unary Plus---Returns the receiver's value.
*/
static VALUE
@@ -522,13 +369,10 @@ num_uplus(VALUE num)
/*
* call-seq:
- * num.i -> Complex(0, num)
+ * num.i -> Complex(0,num)
*
* Returns the corresponding imaginary number.
* Not available for complex numbers.
- *
- * -42.i #=> (0-42i)
- * 2.0.i #=> (0+2.0i)
*/
static VALUE
@@ -537,11 +381,12 @@ num_imaginary(VALUE num)
return rb_complex_new(INT2FIX(0), num);
}
+
/*
* call-seq:
* -num -> numeric
*
- * Unary Minus---Returns the receiver, negated.
+ * Unary Minus---Returns the receiver's value, negated.
*/
static VALUE
@@ -552,7 +397,7 @@ num_uminus(VALUE num)
zero = INT2FIX(0);
do_coerce(&zero, &num, TRUE);
- return num_funcall1(zero, '-', num);
+ return rb_funcall(zero, '-', 1, num);
}
/*
@@ -568,12 +413,13 @@ num_fdiv(VALUE x, VALUE y)
return rb_funcall(rb_Float(x), '/', 1, y);
}
+
/*
* call-seq:
* num.div(numeric) -> integer
*
* Uses +/+ to perform division, then converts the result to an integer.
- * Numeric does not define the +/+ operator; this is left to subclasses.
+ * +numeric+ does not define the +/+ operator; this is left to subclasses.
*
* Equivalent to <code>num.divmod(numeric)[0]</code>.
*
@@ -584,14 +430,15 @@ static VALUE
num_div(VALUE x, VALUE y)
{
if (rb_equal(INT2FIX(0), y)) rb_num_zerodiv();
- return rb_funcall(num_funcall1(x, '/', y), rb_intern("floor"), 0);
+ return rb_funcall(rb_funcall(x, '/', 1, y), rb_intern("floor"), 0);
}
+
/*
* call-seq:
* num.modulo(numeric) -> real
*
- * <code>x.modulo(y)</code> means <code>x-y*(x/y).floor</code>.
+ * x.modulo(y) means x-y*(x/y).floor
*
* Equivalent to <code>num.divmod(numeric)[1]</code>.
*
@@ -601,16 +448,16 @@ num_div(VALUE x, VALUE y)
static VALUE
num_modulo(VALUE x, VALUE y)
{
- VALUE q = num_funcall1(x, id_div, y);
return rb_funcall(x, '-', 1,
- rb_funcall(y, '*', 1, q));
+ rb_funcall(y, '*', 1,
+ rb_funcall(x, rb_intern("div"), 1, y)));
}
/*
* call-seq:
* num.remainder(numeric) -> real
*
- * <code>x.remainder(y)</code> means <code>x-y*(x/y).truncate</code>.
+ * x.remainder(y) means x-y*(x/y).truncate
*
* See Numeric#divmod.
*/
@@ -618,13 +465,13 @@ num_modulo(VALUE x, VALUE y)
static VALUE
num_remainder(VALUE x, VALUE y)
{
- VALUE z = num_funcall1(x, '%', y);
+ VALUE z = rb_funcall(x, '%', 1, y);
if ((!rb_equal(z, INT2FIX(0))) &&
- ((rb_num_negative_int_p(x) &&
- rb_num_positive_int_p(y)) ||
- (rb_num_positive_int_p(x) &&
- rb_num_negative_int_p(y)))) {
+ ((negative_int_p(x) &&
+ positive_int_p(y)) ||
+ (positive_int_p(x) &&
+ negative_int_p(y)))) {
return rb_funcall(z, '-', 1, y);
}
return z;
@@ -637,13 +484,12 @@ num_remainder(VALUE x, VALUE y)
* Returns an array containing the quotient and modulus obtained by dividing
* +num+ by +numeric+.
*
- * If <code>q, r = x.divmod(y)</code>, then
+ * If <code>q, r = * x.divmod(y)</code>, then
*
* q = floor(x/y)
- * x = q*y + r
+ * x = q*y+r
*
- * The quotient is rounded toward negative infinity, as shown in the
- * following table:
+ * The quotient is rounded toward -infinity, as shown in the following table:
*
* a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b)
* ------+-----+---------------+---------+-------------+---------------
@@ -666,11 +512,11 @@ num_remainder(VALUE x, VALUE y)
*
* Examples
*
- * 11.divmod(3) #=> [3, 2]
- * 11.divmod(-3) #=> [-4, -1]
- * 11.divmod(3.5) #=> [3, 0.5]
- * (-11).divmod(3.5) #=> [-4, 3.0]
- * 11.5.divmod(3.5) #=> [3, 1.0]
+ * 11.divmod(3) #=> [3, 2]
+ * 11.divmod(-3) #=> [-4, -1]
+ * 11.divmod(3.5) #=> [3, 0.5]
+ * (-11).divmod(3.5) #=> [-4, 3.0]
+ * (11.5).divmod(3.5) #=> [3, 1.0]
*/
static VALUE
@@ -683,7 +529,7 @@ num_divmod(VALUE x, VALUE y)
* call-seq:
* num.real? -> true or false
*
- * Returns +true+ if +num+ is a real number (i.e. not Complex).
+ * Returns +true+ if +num+ is a Real number. (i.e. not Complex).
*/
static VALUE
@@ -696,10 +542,10 @@ num_real_p(VALUE num)
* call-seq:
* num.integer? -> true or false
*
- * Returns +true+ if +num+ is an Integer.
+ * Returns +true+ if +num+ is an Integer (including Fixnum and Bignum).
*
- * 1.0.integer? #=> false
- * 1.integer? #=> true
+ * (1.0).integer? #=> false
+ * (1).integer? #=> true
*/
static VALUE
@@ -719,18 +565,19 @@ num_int_p(VALUE num)
* (-34.56).abs #=> 34.56
* -34.56.abs #=> 34.56
*
- * Numeric#magnitude is an alias for Numeric#abs.
+ * Numeric#magnitude is an alias of Numeric#abs.
*/
static VALUE
num_abs(VALUE num)
{
- if (rb_num_negative_int_p(num)) {
- return num_funcall0(num, idUMinus);
+ if (negative_int_p(num)) {
+ return rb_funcall(num, rb_intern("-@"), 0);
}
return num;
}
+
/*
* call-seq:
* num.zero? -> true or false
@@ -741,23 +588,13 @@ num_abs(VALUE num)
static VALUE
num_zero_p(VALUE num)
{
- if (FIXNUM_P(num)) {
- if (FIXNUM_ZERO_P(num)) {
- return Qtrue;
- }
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- if (rb_bigzero_p(num)) {
- /* this should not happen usually */
- return Qtrue;
- }
- }
- else if (rb_equal(num, INT2FIX(0))) {
+ if (rb_equal(num, INT2FIX(0))) {
return Qtrue;
}
return Qfalse;
}
+
/*
* call-seq:
* num.nonzero? -> self or nil
@@ -774,7 +611,7 @@ num_zero_p(VALUE num)
static VALUE
num_nonzero_p(VALUE num)
{
- if (RTEST(num_funcall0(num, rb_intern("zero?")))) {
+ if (RTEST(rb_funcall(num, rb_intern("zero?"), 0, 0))) {
return Qnil;
}
return num;
@@ -782,80 +619,19 @@ num_nonzero_p(VALUE num)
/*
* call-seq:
- * num.finite? -> true or false
- *
- * Returns +true+ if +num+ is a finite number, otherwise returns +false+.
- */
-static VALUE
-num_finite_p(VALUE num)
-{
- return Qtrue;
-}
-
-/*
- * call-seq:
- * num.infinite? -> -1, 1, or nil
- *
- * Returns +nil+, -1, or 1 depending on whether the value is
- * finite, <code>-Infinity</code>, or <code>+Infinity</code>.
- */
-static VALUE
-num_infinite_p(VALUE num)
-{
- return Qnil;
-}
-
-/*
- * call-seq:
* num.to_int -> integer
*
* Invokes the child class's +to_i+ method to convert +num+ to an integer.
*
- * 1.0.class #=> Float
- * 1.0.to_int.class #=> Integer
- * 1.0.to_i.class #=> Integer
+ * 1.0.class => Float
+ * 1.0.to_int.class => Fixnum
+ * 1.0.to_i.class => Fixnum
*/
static VALUE
num_to_int(VALUE num)
{
- return num_funcall0(num, id_to_i);
-}
-
-/*
- * call-seq:
- * num.positive? -> true or false
- *
- * Returns +true+ if +num+ is greater than 0.
- */
-
-static VALUE
-num_positive_p(VALUE num)
-{
- const ID mid = '>';
-
- if (FIXNUM_P(num)) {
- if (method_basic_p(rb_cInteger))
- return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0) ? Qtrue : Qfalse;
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- if (method_basic_p(rb_cInteger))
- return BIGNUM_POSITIVE_P(num) && !rb_bigzero_p(num) ? Qtrue : Qfalse;
- }
- return rb_num_compare_with_zero(num, mid);
-}
-
-/*
- * call-seq:
- * num.negative? -> true or false
- *
- * Returns +true+ if +num+ is less than 0.
- */
-
-static VALUE
-num_negative_p(VALUE num)
-{
- return rb_num_negative_int_p(num) ? Qtrue : Qfalse;
+ return rb_funcall(num, id_to_i, 0, 0);
}
@@ -867,10 +643,10 @@ num_negative_p(VALUE num)
* architecture's double-precision floating point representation.
*
* Floating point has a different arithmetic and is an inexact number.
- * So you should know its esoteric system. See following:
+ * So you should know its esoteric system. see following:
*
* - http://docs.sun.com/source/806-3568/ncg_goldberg.html
- * - https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#floats_imprecise
+ * - http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#wiki-floats_imprecise
* - http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
*/
@@ -888,14 +664,15 @@ rb_float_new_in_heap(double d)
* call-seq:
* float.to_s -> string
*
- * Returns a string containing a representation of +self+.
- * As well as a fixed or exponential form of the +float+,
- * the call may return +NaN+, +Infinity+, and +-Infinity+.
+ * Returns a string containing a representation of self. As well as a fixed or
+ * exponential form of the +float+, the call may return +NaN+, +Infinity+, and
+ * +-Infinity+.
*/
static VALUE
flo_to_s(VALUE flt)
{
+ char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
enum {decimal_mant = DBL_MANT_DIG-DBL_DIG};
enum {float_dig = DBL_DIG+1};
char buf[float_dig + (decimal_mant + CHAR_BIT - 1) / CHAR_BIT + 10];
@@ -904,11 +681,8 @@ flo_to_s(VALUE flt)
char *p, *e;
int sign, decpt, digs;
- if (isinf(value)) {
- static const char minf[] = "-Infinity";
- const int pos = (value > 0); /* skip "-" */
- return rb_usascii_str_new(minf+pos, strlen(minf)-pos);
- }
+ if (isinf(value))
+ return rb_usascii_str_new2(value < 0 ? "-Infinity" : "Infinity");
else if (isnan(value))
return rb_usascii_str_new2("NaN");
@@ -968,10 +742,10 @@ flo_to_s(VALUE flt)
* call-seq:
* float.coerce(numeric) -> array
*
- * Returns an array with both +numeric+ and +float+ represented as Float
+ * Returns an array with both a +numeric+ and a +float+ represented as Float
* objects.
*
- * This is achieved by converting +numeric+ to a Float.
+ * This is achieved by converting a +numeric+ to a Float.
*
* 1.2.coerce(3) #=> [3.0, 1.2]
* 2.5.coerce(1.1) #=> [1.1, 2.5]
@@ -987,11 +761,11 @@ flo_coerce(VALUE x, VALUE y)
* call-seq:
* -float -> float
*
- * Returns +float+, negated.
+ * Returns float, negated.
*/
-VALUE
-rb_float_uminus(VALUE flt)
+static VALUE
+flo_uminus(VALUE flt)
{
return DBL2NUM(-RFLOAT_VALUE(flt));
}
@@ -1000,7 +774,7 @@ rb_float_uminus(VALUE flt)
* call-seq:
* float + other -> float
*
- * Returns a new Float which is the sum of +float+ and +other+.
+ * Returns a new float which is the sum of +float+ and +other+.
*/
static VALUE
@@ -1024,7 +798,7 @@ flo_plus(VALUE x, VALUE y)
* call-seq:
* float - other -> float
*
- * Returns a new Float which is the difference of +float+ and +other+.
+ * Returns a new float which is the difference of +float+ and +other+.
*/
static VALUE
@@ -1048,7 +822,7 @@ flo_minus(VALUE x, VALUE y)
* call-seq:
* float * other -> float
*
- * Returns a new Float which is the product of +float+ and +other+.
+ * Returns a new float which is the product of +float+ and +other+.
*/
static VALUE
@@ -1072,7 +846,7 @@ flo_mul(VALUE x, VALUE y)
* call-seq:
* float / other -> float
*
- * Returns a new Float which is the result of dividing +float+ by +other+.
+ * Returns a new float which is the result of dividing +float+ by +other+.
*/
static VALUE
@@ -1100,7 +874,7 @@ flo_div(VALUE x, VALUE y)
/*
* call-seq:
* float.fdiv(numeric) -> float
- * float.quo(numeric) -> float
+ * float.quo(numeric) -> float
*
* Returns <code>float / numeric</code>, same as Float#/.
*/
@@ -1108,7 +882,7 @@ flo_div(VALUE x, VALUE y)
static VALUE
flo_quo(VALUE x, VALUE y)
{
- return num_funcall1(x, '/', y);
+ return rb_funcall(x, '/', 1, y);
}
static void
@@ -1137,10 +911,8 @@ flodivmod(double x, double y, double *divp, double *modp)
}
if (isinf(x) && !isinf(y))
div = x;
- else {
+ else
div = (x - mod) / y;
- if (modp && divp) div = round(div);
- }
if (y*mod < 0) {
mod += y;
div -= 1.0;
@@ -1162,15 +934,16 @@ ruby_float_mod(double x, double y)
return mod;
}
+
/*
* call-seq:
* float % other -> float
* float.modulo(other) -> float
*
- * Returns the modulo after division of +float+ by +other+.
+ * Return the modulo after division of +float+ by +other+.
*
- * 6543.21.modulo(137) #=> 104.21000000000004
- * 6543.21.modulo(137.24) #=> 92.92999999999961
+ * 6543.21.modulo(137) #=> 104.21
+ * 6543.21.modulo(137.24) #=> 92.9299999999996
*/
static VALUE
@@ -1196,6 +969,7 @@ flo_mod(VALUE x, VALUE y)
static VALUE
dbl2ival(double d)
{
+ d = round(d);
if (FIXABLE(d)) {
return LONG2FIX((long)d);
}
@@ -1208,8 +982,8 @@ dbl2ival(double d)
*
* See Numeric#divmod.
*
- * 42.0.divmod(6) #=> [7, 0.0]
- * 42.0.divmod(5) #=> [8, 2.0]
+ * 42.0.divmod 6 #=> [7, 0.0]
+ * 42.0.divmod 5 #=> [8, 2.0]
*/
static VALUE
@@ -1228,7 +1002,7 @@ flo_divmod(VALUE x, VALUE y)
fy = RFLOAT_VALUE(y);
}
else {
- return rb_num_coerce_bin(x, y, id_divmod);
+ return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
flodivmod(RFLOAT_VALUE(x), fy, &div, &mod);
a = dbl2ival(div);
@@ -1238,35 +1012,35 @@ flo_divmod(VALUE x, VALUE y)
/*
* call-seq:
- * float ** other -> float
+ *
+ * float ** other -> float
*
* Raises +float+ to the power of +other+.
*
- * 2.0**3 #=> 8.0
+ * 2.0**3 #=> 8.0
*/
-VALUE
-rb_float_pow(VALUE x, VALUE y)
+static VALUE
+flo_pow(VALUE x, VALUE y)
{
- double dx, dy;
if (RB_TYPE_P(y, T_FIXNUM)) {
- dx = RFLOAT_VALUE(x);
- dy = (double)FIX2LONG(y);
+ return DBL2NUM(pow(RFLOAT_VALUE(x), (double)FIX2LONG(y)));
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- dx = RFLOAT_VALUE(x);
- dy = rb_big2dbl(y);
+ return DBL2NUM(pow(RFLOAT_VALUE(x), rb_big2dbl(y)));
}
else if (RB_TYPE_P(y, T_FLOAT)) {
- dx = RFLOAT_VALUE(x);
- dy = RFLOAT_VALUE(y);
- if (dx < 0 && dy != round(dy))
- return num_funcall1(rb_complex_raw1(x), idPow, y);
+ {
+ double dx = RFLOAT_VALUE(x);
+ double dy = RFLOAT_VALUE(y);
+ if (dx < 0 && dy != round(dy))
+ return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
+ return DBL2NUM(pow(dx, dy));
+ }
}
else {
- return rb_num_coerce_bin(x, y, idPow);
+ return rb_num_coerce_bin(x, y, rb_intern("**"));
}
- return DBL2NUM(pow(dx, dy));
}
/*
@@ -1274,11 +1048,11 @@ rb_float_pow(VALUE x, VALUE y)
* num.eql?(numeric) -> true or false
*
* Returns +true+ if +num+ and +numeric+ are the same type and have equal
- * values. Contrast this with Numeric#==, which performs type conversions.
+ * values.
*
- * 1 == 1.0 #=> true
- * 1.eql?(1.0) #=> false
- * 1.0.eql?(1.0) #=> true
+ * 1 == 1.0 #=> true
+ * 1.eql?(1.0) #=> false
+ * (1.0).eql?(1.0) #=> true
*/
static VALUE
@@ -1286,10 +1060,6 @@ num_eql(VALUE x, VALUE y)
{
if (TYPE(x) != TYPE(y)) return Qfalse;
- if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_eql(x, y);
- }
-
return rb_equal(x, y);
}
@@ -1297,7 +1067,8 @@ num_eql(VALUE x, VALUE y)
* call-seq:
* number <=> other -> 0 or nil
*
- * Returns zero if +number+ equals +other+, otherwise returns +nil+.
+ * Returns zero if +number+ equals +other+, otherwise +nil+ is returned if the
+ * two values are incomparable.
*/
static VALUE
@@ -1310,28 +1081,26 @@ num_cmp(VALUE x, VALUE y)
static VALUE
num_equal(VALUE x, VALUE y)
{
- VALUE result;
if (x == y) return Qtrue;
- result = num_funcall1(y, id_eq, x);
- if (RTEST(result)) return Qtrue;
- return Qfalse;
+ return rb_funcall(y, id_eq, 1, x);
}
/*
* call-seq:
* float == obj -> true or false
*
- * Returns +true+ only if +obj+ has the same value as +float+.
- * Contrast this with Float#eql?, which requires +obj+ to be a Float.
+ * Returns +true+ only if +obj+ has the same value as +float+. Contrast this
+ * with Float#eql?, which requires obj to be a Float.
+ *
+ * The result of <code>NaN == NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*
* 1.0 == 1 #=> true
*
- * The result of <code>NaN == NaN</code> is undefined,
- * so an implementation-dependent value is returned.
*/
-VALUE
-rb_float_equal(VALUE x, VALUE y)
+static VALUE
+flo_eq(VALUE x, VALUE y)
{
volatile double a, b;
@@ -1354,11 +1123,9 @@ rb_float_equal(VALUE x, VALUE y)
return (a == b)?Qtrue:Qfalse;
}
-#define flo_eq rb_float_equal
-
/*
* call-seq:
- * float.hash -> integer
+ * float.hash -> integer
*
* Returns a hash code for this float.
*
@@ -1368,13 +1135,14 @@ rb_float_equal(VALUE x, VALUE y)
static VALUE
flo_hash(VALUE num)
{
- return rb_dbl_hash(RFLOAT_VALUE(num));
-}
+ double d;
+ st_index_t hash;
-VALUE
-rb_dbl_hash(double d)
-{
- return LONG2FIX(rb_dbl_long_hash(d));
+ d = RFLOAT_VALUE(num);
+ /* normalize -0.0 to 0.0 */
+ if (d == 0.0) d = 0.0;
+ hash = rb_memhash(&d, sizeof(d));
+ return LONG2FIX(hash);
}
VALUE
@@ -1389,14 +1157,13 @@ rb_dbl_cmp(double a, double b)
/*
* call-seq:
- * float <=> real -> -1, 0, +1, or nil
+ * float <=> real -> -1, 0, +1 or nil
*
- * Returns -1, 0, or +1 depending on whether +float+ is
- * less than, equal to, or greater than +real+.
- * This is the basis for the tests in the Comparable module.
+ * Returns -1, 0, +1 or nil depending on whether +float+ is less than, equal
+ * to, or greater than +real+. This is the basis for the tests in Comparable.
*
- * The result of <code>NaN <=> NaN</code> is undefined,
- * so an implementation-dependent value is returned.
+ * The result of <code>NaN <=> NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*
* +nil+ is returned if the two values are incomparable.
*/
@@ -1433,24 +1200,18 @@ flo_cmp(VALUE x, VALUE y)
return rb_dbl_cmp(a, b);
}
-int
-rb_float_cmp(VALUE x, VALUE y)
-{
- return NUM2INT(flo_cmp(x, y));
-}
-
/*
* call-seq:
* float > real -> true or false
*
* Returns +true+ if +float+ is greater than +real+.
*
- * The result of <code>NaN > NaN</code> is undefined,
- * so an implementation-dependent value is returned.
+ * The result of <code>NaN > NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
-VALUE
-rb_float_gt(VALUE x, VALUE y)
+static VALUE
+flo_gt(VALUE x, VALUE y)
{
double a, b;
@@ -1482,8 +1243,8 @@ rb_float_gt(VALUE x, VALUE y)
*
* Returns +true+ if +float+ is greater than or equal to +real+.
*
- * The result of <code>NaN >= NaN</code> is undefined,
- * so an implementation-dependent value is returned.
+ * The result of <code>NaN >= NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1505,7 +1266,7 @@ flo_ge(VALUE x, VALUE y)
#endif
}
else {
- return rb_num_coerce_relop(x, y, idGE);
+ return rb_num_coerce_relop(x, y, rb_intern(">="));
}
#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
@@ -1519,8 +1280,8 @@ flo_ge(VALUE x, VALUE y)
*
* Returns +true+ if +float+ is less than +real+.
*
- * The result of <code>NaN < NaN</code> is undefined,
- * so an implementation-dependent value is returned.
+ * The result of <code>NaN < NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1556,8 +1317,8 @@ flo_lt(VALUE x, VALUE y)
*
* Returns +true+ if +float+ is less than or equal to +real+.
*
- * The result of <code>NaN <= NaN</code> is undefined,
- * so an implementation-dependent value is returned.
+ * The result of <code>NaN <= NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1579,7 +1340,7 @@ flo_le(VALUE x, VALUE y)
#endif
}
else {
- return rb_num_coerce_relop(x, y, idLE);
+ return rb_num_coerce_relop(x, y, rb_intern("<="));
}
#if defined(_MSC_VER) && _MSC_VER < 1300
if (isnan(a)) return Qfalse;
@@ -1594,14 +1355,14 @@ flo_le(VALUE x, VALUE y)
* Returns +true+ only if +obj+ is a Float with the same value as +float+.
* Contrast this with Float#==, which performs type conversions.
*
- * 1.0.eql?(1) #=> false
+ * The result of <code>NaN.eql?(NaN)</code> is undefined, so the
+ * implementation-dependent value is returned.
*
- * The result of <code>NaN.eql?(NaN)</code> is undefined,
- * so an implementation-dependent value is returned.
+ * 1.0.eql?(1) #=> false
*/
-VALUE
-rb_float_eql(VALUE x, VALUE y)
+static VALUE
+flo_eql(VALUE x, VALUE y)
{
if (RB_TYPE_P(y, T_FLOAT)) {
double a = RFLOAT_VALUE(x);
@@ -1615,13 +1376,11 @@ rb_float_eql(VALUE x, VALUE y)
return Qfalse;
}
-#define flo_eql rb_float_eql
-
/*
* call-seq:
- * float.to_f -> self
+ * float.to_f -> self
*
- * Since +float+ is already a Float, returns +self+.
+ * Since +float+ is already a float, returns +self+.
*/
static VALUE
@@ -1639,13 +1398,11 @@ flo_to_f(VALUE num)
*
* (-34.56).abs #=> 34.56
* -34.56.abs #=> 34.56
- * 34.56.abs #=> 34.56
*
- * Float#magnitude is an alias for Float#abs.
*/
-VALUE
-rb_float_abs(VALUE flt)
+static VALUE
+flo_abs(VALUE flt)
{
double val = fabs(RFLOAT_VALUE(flt));
return DBL2NUM(val);
@@ -1656,6 +1413,7 @@ rb_float_abs(VALUE flt)
* float.zero? -> true or false
*
* Returns +true+ if +float+ is 0.0.
+ *
*/
static VALUE
@@ -1689,18 +1447,23 @@ flo_is_nan_p(VALUE num)
/*
* call-seq:
- * float.infinite? -> -1, 1, or nil
+ * float.infinite? -> nil, -1, +1
*
- * Returns +nil+, -1, or 1 depending on whether the value is
- * finite, <code>-Infinity</code>, or <code>+Infinity</code>.
+ * Return values corresponding to the value of +float+:
+ *
+ * +finite+:: +nil+
+ * +-Infinity+:: +-1+
+ * ++Infinity+:: +1+
+ *
+ * For example:
*
* (0.0).infinite? #=> nil
* (-1.0/0.0).infinite? #=> -1
* (+1.0/0.0).infinite? #=> 1
*/
-VALUE
-rb_flo_is_infinite_p(VALUE num)
+static VALUE
+flo_is_infinite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
@@ -1715,12 +1478,13 @@ rb_flo_is_infinite_p(VALUE num)
* call-seq:
* float.finite? -> true or false
*
- * Returns +true+ if +float+ is a valid IEEE floating point number,
- * i.e. it is not infinite and Float#nan? is +false+.
+ * Returns +true+ if +float+ is a valid IEEE floating point number (it is not
+ * infinite, and Float#nan? is +false+).
+ *
*/
-VALUE
-rb_flo_is_finite_p(VALUE num)
+static VALUE
+flo_is_finite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
@@ -1739,7 +1503,7 @@ rb_flo_is_finite_p(VALUE num)
* call-seq:
* float.next_float -> float
*
- * Returns the next representable floating point number.
+ * Returns the next representable floating-point number.
*
* Float::MAX.next_float and Float::INFINITY.next_float is Float::INFINITY.
*
@@ -1747,13 +1511,13 @@ rb_flo_is_finite_p(VALUE num)
*
* For example:
*
- * 0.01.next_float #=> 0.010000000000000002
- * 1.0.next_float #=> 1.0000000000000002
- * 100.0.next_float #=> 100.00000000000001
+ * p 0.01.next_float #=> 0.010000000000000002
+ * p 1.0.next_float #=> 1.0000000000000002
+ * p 100.0.next_float #=> 100.00000000000001
*
- * 0.01.next_float - 0.01 #=> 1.734723475976807e-18
- * 1.0.next_float - 1.0 #=> 2.220446049250313e-16
- * 100.0.next_float - 100.0 #=> 1.4210854715202004e-14
+ * p 0.01.next_float - 0.01 #=> 1.734723475976807e-18
+ * p 1.0.next_float - 1.0 #=> 2.220446049250313e-16
+ * p 100.0.next_float - 100.0 #=> 1.4210854715202004e-14
*
* f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.next_float }
* #=> 0x1.47ae147ae147bp-7 0.01
@@ -1779,13 +1543,13 @@ rb_flo_is_finite_p(VALUE num)
*
* f = 0.0
* 100.times { f += 0.1 }
- * f #=> 9.99999999999998 # should be 10.0 in the ideal world.
- * 10-f #=> 1.9539925233402755e-14 # the floating point error.
- * 10.0.next_float-10 #=> 1.7763568394002505e-15 # 1 ulp (unit in the last place).
- * (10-f)/(10.0.next_float-10) #=> 11.0 # the error is 11 ulp.
- * (10-f)/(10*Float::EPSILON) #=> 8.8 # approximation of the above.
- * "%a" % 10 #=> "0x1.4p+3"
- * "%a" % f #=> "0x1.3fffffffffff5p+3" # the last hex digit is 5. 16 - 5 = 11 ulp.
+ * p f #=> 9.99999999999998 # should be 10.0 in the ideal world.
+ * p 10-f #=> 1.9539925233402755e-14 # the floating-point error.
+ * p(10.0.next_float-10) #=> 1.7763568394002505e-15 # 1 ulp (units in the last place).
+ * p((10-f)/(10.0.next_float-10)) #=> 11.0 # the error is 11 ulp.
+ * p((10-f)/(10*Float::EPSILON)) #=> 8.8 # approximation of the above.
+ * p "%a" % f #=> "0x1.3fffffffffff5p+3" # the last hex digit is 5. 16 - 5 = 11 ulp.
+ *
*/
static VALUE
flo_next_float(VALUE vx)
@@ -1800,7 +1564,7 @@ flo_next_float(VALUE vx)
* call-seq:
* float.prev_float -> float
*
- * Returns the previous representable floating point number.
+ * Returns the previous representable floatint-point number.
*
* (-Float::MAX).prev_float and (-Float::INFINITY).prev_float is -Float::INFINITY.
*
@@ -1808,13 +1572,13 @@ flo_next_float(VALUE vx)
*
* For example:
*
- * 0.01.prev_float #=> 0.009999999999999998
- * 1.0.prev_float #=> 0.9999999999999999
- * 100.0.prev_float #=> 99.99999999999999
+ * p 0.01.prev_float #=> 0.009999999999999998
+ * p 1.0.prev_float #=> 0.9999999999999999
+ * p 100.0.prev_float #=> 99.99999999999999
*
- * 0.01 - 0.01.prev_float #=> 1.734723475976807e-18
- * 1.0 - 1.0.prev_float #=> 1.1102230246251565e-16
- * 100.0 - 100.0.prev_float #=> 1.4210854715202004e-14
+ * p 0.01 - 0.01.prev_float #=> 1.734723475976807e-18
+ * p 1.0 - 1.0.prev_float #=> 1.1102230246251565e-16
+ * p 100.0 - 100.0.prev_float #=> 1.4210854715202004e-14
*
* f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.prev_float }
* #=> 0x1.47ae147ae147bp-7 0.01
@@ -1837,6 +1601,7 @@ flo_next_float(VALUE vx)
* # 0x1.47ae147ae146ap-7 0.00999999999999997
* # 0x1.47ae147ae1469p-7 0.009999999999999969
* # 0x1.47ae147ae1468p-7 0.009999999999999967
+ *
*/
static VALUE
flo_prev_float(VALUE vx)
@@ -1849,209 +1614,67 @@ flo_prev_float(VALUE vx)
/*
* call-seq:
- * float.floor([ndigits]) -> integer or float
- *
- * Returns the largest number less than or equal to +float+ with
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * float.floor -> integer
*
- * Returns a floating point number when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the largest integer less than or equal to +float+.
*
* 1.2.floor #=> 1
* 2.0.floor #=> 2
* (-1.2).floor #=> -2
* (-2.0).floor #=> -2
- *
- * 1.234567.floor(2) #=> 1.23
- * 1.234567.floor(3) #=> 1.234
- * 1.234567.floor(4) #=> 1.2345
- * 1.234567.floor(5) #=> 1.23456
- *
- * 34567.89.floor(-5) #=> 0
- * 34567.89.floor(-4) #=> 30000
- * 34567.89.floor(-3) #=> 34000
- * 34567.89.floor(-2) #=> 34500
- * 34567.89.floor(-1) #=> 34560
- * 34567.89.floor(0) #=> 34567
- * 34567.89.floor(1) #=> 34567.8
- * 34567.89.floor(2) #=> 34567.89
- * 34567.89.floor(3) #=> 34567.89
- *
- * Note that the limited precision of floating point arithmetic
- * might lead to surprising results:
- *
- * (0.3 / 0.1).floor #=> 2 (!)
*/
static VALUE
-flo_floor(int argc, VALUE *argv, VALUE num)
+flo_floor(VALUE num)
{
- double number, f;
- int ndigits = 0;
+ double f = floor(RFLOAT_VALUE(num));
+ long val;
- if (rb_check_arity(argc, 0, 1)) {
- ndigits = NUM2INT(argv[0]);
- }
- number = RFLOAT_VALUE(num);
- if (number == 0.0) {
- return ndigits > 0 ? DBL2NUM(number) : INT2FIX(0);
- }
- if (ndigits > 0) {
- int binexp;
- frexp(number, &binexp);
- if (float_round_overflow(ndigits, binexp)) return num;
- if (number > 0.0 && float_round_underflow(ndigits, binexp))
- return DBL2NUM(0.0);
- f = pow(10, ndigits);
- f = floor(number * f) / f;
- return DBL2NUM(f);
- }
- else {
- num = dbl2ival(floor(number));
- if (ndigits < 0) num = rb_int_floor(num, ndigits);
- return num;
+ if (!FIXABLE(f)) {
+ return rb_dbl2big(f);
}
+ val = (long)f;
+ return LONG2FIX(val);
}
/*
* call-seq:
- * float.ceil([ndigits]) -> integer or float
- *
- * Returns the smallest number greater than or equal to +float+ with
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * float.ceil -> integer
*
- * Returns a floating point number when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the smallest Integer greater than or equal to +float+.
*
* 1.2.ceil #=> 2
* 2.0.ceil #=> 2
* (-1.2).ceil #=> -1
* (-2.0).ceil #=> -2
- *
- * 1.234567.ceil(2) #=> 1.24
- * 1.234567.ceil(3) #=> 1.235
- * 1.234567.ceil(4) #=> 1.2346
- * 1.234567.ceil(5) #=> 1.23457
- *
- * 34567.89.ceil(-5) #=> 100000
- * 34567.89.ceil(-4) #=> 40000
- * 34567.89.ceil(-3) #=> 35000
- * 34567.89.ceil(-2) #=> 34600
- * 34567.89.ceil(-1) #=> 34570
- * 34567.89.ceil(0) #=> 34568
- * 34567.89.ceil(1) #=> 34567.9
- * 34567.89.ceil(2) #=> 34567.89
- * 34567.89.ceil(3) #=> 34567.89
- *
- * Note that the limited precision of floating point arithmetic
- * might lead to surprising results:
- *
- * (2.1 / 0.7).ceil #=> 4 (!)
*/
static VALUE
-flo_ceil(int argc, VALUE *argv, VALUE num)
+flo_ceil(VALUE num)
{
- double number, f;
- int ndigits = 0;
+ double f = ceil(RFLOAT_VALUE(num));
+ long val;
- if (rb_check_arity(argc, 0, 1)) {
- ndigits = NUM2INT(argv[0]);
- }
- number = RFLOAT_VALUE(num);
- if (number == 0.0) {
- return ndigits > 0 ? DBL2NUM(number) : INT2FIX(0);
+ if (!FIXABLE(f)) {
+ return rb_dbl2big(f);
}
- if (ndigits > 0) {
- int binexp;
- frexp(number, &binexp);
- if (float_round_overflow(ndigits, binexp)) return num;
- if (number < 0.0 && float_round_underflow(ndigits, binexp))
- return DBL2NUM(0.0);
- f = pow(10, ndigits);
- f = ceil(number * f) / f;
- return DBL2NUM(f);
- }
- else {
- num = dbl2ival(ceil(number));
- if (ndigits < 0) num = rb_int_ceil(num, ndigits);
- return num;
- }
-}
-
-static int
-int_round_zero_p(VALUE num, int ndigits)
-{
- long bytes;
- /* If 10**N / 2 > num, then return 0 */
- /* We have log_256(10) > 0.415241 and log_256(1/2) = -0.125, so */
- if (FIXNUM_P(num)) {
- bytes = sizeof(long);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- bytes = rb_big_size(num);
- }
- else {
- bytes = NUM2LONG(rb_funcall(num, idSize, 0));
- }
- return (-0.415241 * ndigits - 0.125 > bytes);
-}
-
-static SIGNED_VALUE
-int_round_half_even(SIGNED_VALUE x, SIGNED_VALUE y)
-{
- SIGNED_VALUE z = +(x + y / 2) / y;
- if ((z * y - x) * 2 == y) {
- z &= ~1;
- }
- return z * y;
-}
-
-static SIGNED_VALUE
-int_round_half_up(SIGNED_VALUE x, SIGNED_VALUE y)
-{
- return (x + y / 2) / y * y;
-}
-
-static SIGNED_VALUE
-int_round_half_down(SIGNED_VALUE x, SIGNED_VALUE y)
-{
- return (x + y / 2 - 1) / y * y;
-}
-
-static int
-int_half_p_half_even(VALUE num, VALUE n, VALUE f)
-{
- return (int)rb_int_odd_p(rb_int_idiv(n, f));
-}
-
-static int
-int_half_p_half_up(VALUE num, VALUE n, VALUE f)
-{
- return int_pos_p(num);
-}
-
-static int
-int_half_p_half_down(VALUE num, VALUE n, VALUE f)
-{
- return int_neg_p(num);
+ val = (long)f;
+ return LONG2FIX(val);
}
/*
* Assumes num is an Integer, ndigits <= 0
*/
-VALUE
-rb_int_round(VALUE num, int ndigits, enum ruby_num_rounding_mode mode)
+static VALUE
+int_round_0(VALUE num, int ndigits)
{
VALUE n, f, h, r;
-
- if (int_round_zero_p(num, ndigits)) {
+ long bytes;
+ ID op;
+ /* If 10**N / 2 > num, then return 0 */
+ /* We have log_256(10) > 0.415241 and log_256(1/2) = -0.125, so */
+ bytes = FIXNUM_P(num) ? sizeof(long) : rb_funcall(num, idSize, 0);
+ if (-0.415241 * ndigits - 0.125 > bytes ) {
return INT2FIX(0);
}
@@ -2060,7 +1683,7 @@ rb_int_round(VALUE num, int ndigits, enum ruby_num_rounding_mode mode)
SIGNED_VALUE x = FIX2LONG(num), y = FIX2LONG(f);
int neg = x < 0;
if (neg) x = -x;
- x = ROUND_CALL(mode, int_round, (x, y));
+ x = (x + y / 2) / y * y;
if (neg) x = -x;
return LONG2NUM(x);
}
@@ -2068,185 +1691,70 @@ rb_int_round(VALUE num, int ndigits, enum ruby_num_rounding_mode mode)
/* then int_pow overflow */
return INT2FIX(0);
}
- h = rb_int_idiv(f, INT2FIX(2));
- r = rb_int_modulo(num, f);
- n = rb_int_minus(num, r);
- r = rb_int_cmp(r, h);
- if (FIXNUM_POSITIVE_P(r) ||
- (FIXNUM_ZERO_P(r) && ROUND_CALL(mode, int_half_p, (num, n, f)))) {
- n = rb_int_plus(n, f);
+ h = rb_funcall(f, '/', 1, INT2FIX(2));
+ r = rb_funcall(num, '%', 1, f);
+ n = rb_funcall(num, '-', 1, r);
+ op = negative_int_p(num) ? rb_intern("<=") : '<';
+ if (!RTEST(rb_funcall(r, op, 1, h))) {
+ n = rb_funcall(n, '+', 1, f);
}
return n;
}
-VALUE
-rb_int_floor(VALUE num, int ndigits)
-{
- VALUE f;
-
- if (int_round_zero_p(num, ndigits))
- return INT2FIX(0);
- f = int_pow(10, -ndigits);
- if (FIXNUM_P(num) && FIXNUM_P(f)) {
- SIGNED_VALUE x = FIX2LONG(num), y = FIX2LONG(f);
- int neg = x < 0;
- if (neg) x = -x + y - 1;
- x = x / y * y;
- if (neg) x = -x;
- return LONG2NUM(x);
- }
- if (RB_TYPE_P(f, T_FLOAT)) {
- /* then int_pow overflow */
- return INT2FIX(0);
- }
- return rb_int_minus(num, rb_int_modulo(num, f));
-}
-
-VALUE
-rb_int_ceil(VALUE num, int ndigits)
-{
- VALUE f;
-
- if (int_round_zero_p(num, ndigits))
- return INT2FIX(0);
- f = int_pow(10, -ndigits);
- if (FIXNUM_P(num) && FIXNUM_P(f)) {
- SIGNED_VALUE x = FIX2LONG(num), y = FIX2LONG(f);
- int neg = x < 0;
- if (neg) x = -x;
- else x += y - 1;
- x = (x / y) * y;
- if (neg) x = -x;
- return LONG2NUM(x);
- }
- if (RB_TYPE_P(f, T_FLOAT)) {
- /* then int_pow overflow */
- return INT2FIX(0);
- }
- return rb_int_plus(num, rb_int_minus(f, rb_int_modulo(num, f)));
-}
-
-VALUE
-rb_int_truncate(VALUE num, int ndigits)
-{
- VALUE f;
- VALUE m;
-
- if (int_round_zero_p(num, ndigits))
- return INT2FIX(0);
- f = int_pow(10, -ndigits);
- if (FIXNUM_P(num) && FIXNUM_P(f)) {
- SIGNED_VALUE x = FIX2LONG(num), y = FIX2LONG(f);
- int neg = x < 0;
- if (neg) x = -x;
- x = x / y * y;
- if (neg) x = -x;
- return LONG2NUM(x);
- }
- if (RB_TYPE_P(f, T_FLOAT)) {
- /* then int_pow overflow */
- return INT2FIX(0);
- }
- m = rb_int_modulo(num, f);
- if (int_neg_p(num)) {
- return rb_int_plus(num, rb_int_minus(f, m));
- }
- else {
- return rb_int_minus(num, m);
- }
-}
+static VALUE
+flo_truncate(VALUE num);
/*
* call-seq:
- * float.round([ndigits] [, half: mode]) -> integer or float
- *
- * Returns +float+ rounded to the nearest value with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * float.round([ndigits]) -> integer or float
*
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * Rounds +float+ to a given precision in decimal digits (default 0 digits).
*
- * Returns a floating point number when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Precision may be negative. Returns a floating point number when +ndigits+
+ * is more than zero.
*
* 1.4.round #=> 1
* 1.5.round #=> 2
* 1.6.round #=> 2
* (-1.5).round #=> -2
*
- * 1.234567.round(2) #=> 1.23
- * 1.234567.round(3) #=> 1.235
- * 1.234567.round(4) #=> 1.2346
- * 1.234567.round(5) #=> 1.23457
- *
- * 34567.89.round(-5) #=> 0
- * 34567.89.round(-4) #=> 30000
- * 34567.89.round(-3) #=> 35000
- * 34567.89.round(-2) #=> 34600
- * 34567.89.round(-1) #=> 34570
- * 34567.89.round(0) #=> 34568
- * 34567.89.round(1) #=> 34567.9
- * 34567.89.round(2) #=> 34567.89
- * 34567.89.round(3) #=> 34567.89
- *
- * If the optional +half+ keyword argument is given,
- * numbers that are half-way between two possible rounded values
- * will be rounded according to the specified tie-breaking +mode+:
- *
- * * <code>:up</code> or +nil+: round half away from zero (default)
- * * <code>:down</code>: round half toward zero
- * * <code>:even</code>: round half toward the nearest even number
- *
- * 2.5.round(half: :up) #=> 3
- * 2.5.round(half: :down) #=> 2
- * 2.5.round(half: :even) #=> 2
- * 3.5.round(half: :up) #=> 4
- * 3.5.round(half: :down) #=> 3
- * 3.5.round(half: :even) #=> 4
- * (-2.5).round(half: :up) #=> -3
- * (-2.5).round(half: :down) #=> -2
- * (-2.5).round(half: :even) #=> -2
+ * 1.234567.round(2) #=> 1.23
+ * 1.234567.round(3) #=> 1.235
+ * 1.234567.round(4) #=> 1.2346
+ * 1.234567.round(5) #=> 1.23457
+ *
+ * 34567.89.round(-5) #=> 0
+ * 34567.89.round(-4) #=> 30000
+ * 34567.89.round(-3) #=> 35000
+ * 34567.89.round(-2) #=> 34600
+ * 34567.89.round(-1) #=> 34570
+ * 34567.89.round(0) #=> 34568
+ * 34567.89.round(1) #=> 34567.9
+ * 34567.89.round(2) #=> 34567.89
+ * 34567.89.round(3) #=> 34567.89
+ *
*/
static VALUE
flo_round(int argc, VALUE *argv, VALUE num)
{
- double number, f, x;
- VALUE nd, opt;
+ VALUE nd;
+ double number, f;
int ndigits = 0;
- enum ruby_num_rounding_mode mode;
+ int binexp;
+ enum {float_dig = DBL_DIG+2};
- if (rb_scan_args(argc, argv, "01:", &nd, &opt)) {
+ if (argc > 0 && rb_scan_args(argc, argv, "01", &nd) == 1) {
ndigits = NUM2INT(nd);
}
- mode = rb_num_get_rounding_option(opt);
- number = RFLOAT_VALUE(num);
- if (number == 0.0) {
- return ndigits > 0 ? DBL2NUM(number) : INT2FIX(0);
- }
if (ndigits < 0) {
- return rb_int_round(flo_to_i(num), ndigits, mode);
+ return int_round_0(flo_truncate(num), ndigits);
}
+ number = RFLOAT_VALUE(num);
if (ndigits == 0) {
- x = ROUND_CALL(mode, round, (number, 1.0));
- return dbl2ival(x);
- }
- if (isfinite(number)) {
- int binexp;
- frexp(number, &binexp);
- if (float_round_overflow(ndigits, binexp)) return num;
- if (float_round_underflow(ndigits, binexp)) return DBL2NUM(0);
- f = pow(10, ndigits);
- x = ROUND_CALL(mode, round, (number, f));
- return DBL2NUM(x / f);
+ return dbl2ival(number);
}
- return num;
-}
-
-static int
-float_round_overflow(int ndigits, int binexp)
-{
- enum {float_dig = DBL_DIG+2};
+ frexp(number, &binexp);
/* Let `exp` be such that `number` is written as:"0.#{digits}e#{exp}",
i.e. such that 10 ** (exp - 1) <= |number| < 10 ** exp
@@ -2265,153 +1773,97 @@ float_round_overflow(int ndigits, int binexp)
So if ndigits + floor(binexp/(4 or 3)) >= float_dig, the result is number
If ndigits + ceil(binexp/(3 or 4)) < 0 the result is 0
*/
- if (ndigits >= float_dig - (binexp > 0 ? binexp / 4 : binexp / 3 - 1)) {
- return TRUE;
+ if (isinf(number) || isnan(number) ||
+ (ndigits >= float_dig - (binexp > 0 ? binexp / 4 : binexp / 3 - 1))) {
+ return num;
}
- return FALSE;
-}
-
-static int
-float_round_underflow(int ndigits, int binexp)
-{
if (ndigits < - (binexp > 0 ? binexp / 3 + 1 : binexp / 4)) {
- return TRUE;
+ return DBL2NUM(0);
}
- return FALSE;
+ f = pow(10, ndigits);
+ return DBL2NUM(round(number * f) / f);
}
/*
* call-seq:
- * float.to_i -> integer
- * float.to_int -> integer
+ * float.to_i -> integer
+ * float.to_int -> integer
+ * float.truncate -> integer
*
* Returns the +float+ truncated to an Integer.
*
- * 1.2.to_i #=> 1
- * (-1.2).to_i #=> -1
- *
- * Note that the limited precision of floating point arithmetic
- * might lead to surprising results:
- *
- * (0.3 / 0.1).to_i #=> 2 (!)
- *
- * #to_int is an alias for #to_i.
+ * Synonyms are #to_i, #to_int, and #truncate.
*/
static VALUE
-flo_to_i(VALUE num)
+flo_truncate(VALUE num)
{
double f = RFLOAT_VALUE(num);
+ long val;
if (f > 0.0) f = floor(f);
if (f < 0.0) f = ceil(f);
- return dbl2ival(f);
+ if (!FIXABLE(f)) {
+ return rb_dbl2big(f);
+ }
+ val = (long)f;
+ return LONG2FIX(val);
}
/*
* call-seq:
- * float.truncate([ndigits]) -> integer or float
- *
- * Returns +float+ truncated (toward zero) to
- * a precision of +ndigits+ decimal digits (default: 0).
+ * num.floor -> integer
*
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * Returns the largest integer less than or equal to +num+.
*
- * Returns a floating point number when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Numeric implements this by converting an Integer to a Float and invoking
+ * Float#floor.
*
- * 2.8.truncate #=> 2
- * (-2.8).truncate #=> -2
- * 1.234567.truncate(2) #=> 1.23
- * 34567.89.truncate(-2) #=> 34500
- *
- * Note that the limited precision of floating point arithmetic
- * might lead to surprising results:
- *
- * (0.3 / 0.1).truncate #=> 2 (!)
- */
-static VALUE
-flo_truncate(int argc, VALUE *argv, VALUE num)
-{
- if (signbit(RFLOAT_VALUE(num)))
- return flo_ceil(argc, argv, num);
- else
- return flo_floor(argc, argv, num);
-}
-
-/*
- * call-seq:
- * float.positive? -> true or false
- *
- * Returns +true+ if +float+ is greater than 0.
+ * 1.floor #=> 1
+ * (-1).floor #=> -1
*/
static VALUE
-flo_positive_p(VALUE num)
+num_floor(VALUE num)
{
- double f = RFLOAT_VALUE(num);
- return f > 0.0 ? Qtrue : Qfalse;
+ return flo_floor(rb_Float(num));
}
-/*
- * call-seq:
- * float.negative? -> true or false
- *
- * Returns +true+ if +float+ is less than 0.
- */
-
-static VALUE
-flo_negative_p(VALUE num)
-{
- double f = RFLOAT_VALUE(num);
- return f < 0.0 ? Qtrue : Qfalse;
-}
/*
* call-seq:
- * num.floor([ndigits]) -> integer or float
- *
- * Returns the largest number less than or equal to +num+ with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * num.ceil -> integer
*
- * Numeric implements this by converting its value to a Float and
- * invoking Float#floor.
- */
-
-static VALUE
-num_floor(int argc, VALUE *argv, VALUE num)
-{
- return flo_floor(argc, argv, rb_Float(num));
-}
-
-/*
- * call-seq:
- * num.ceil([ndigits]) -> integer or float
+ * Returns the smallest possible Integer that is greater than or equal to
+ * +num+.
*
- * Returns the smallest number greater than or equal to +num+ with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * Numeric achieves this by converting itself to a Float then invoking
+ * Float#ceil.
*
- * Numeric implements this by converting its value to a Float and
- * invoking Float#ceil.
+ * 1.ceil #=> 1
+ * 1.2.ceil #=> 2
+ * (-1.2).ceil #=> -1
+ * (-1.0).ceil #=> -1
*/
static VALUE
-num_ceil(int argc, VALUE *argv, VALUE num)
+num_ceil(VALUE num)
{
- return flo_ceil(argc, argv, rb_Float(num));
+ return flo_ceil(rb_Float(num));
}
/*
* call-seq:
* num.round([ndigits]) -> integer or float
*
- * Returns +num+ rounded to the nearest value with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * Rounds +num+ to a given precision in decimal digits (default 0 digits).
*
- * Numeric implements this by converting its value to a Float and
- * invoking Float#round.
+ * Precision may be negative. Returns a floating point number when +ndigits+
+ * is more than zero.
+ *
+ * Numeric implements this by converting itself to a Float and invoking
+ * Float#round.
*/
static VALUE
@@ -2422,19 +1874,18 @@ num_round(int argc, VALUE* argv, VALUE num)
/*
* call-seq:
- * num.truncate([ndigits]) -> integer or float
+ * num.truncate -> integer
*
- * Returns +num+ truncated (toward zero) to
- * a precision of +ndigits+ decimal digits (default: 0).
+ * Returns +num+ truncated to an Integer.
*
- * Numeric implements this by converting its value to a Float and
- * invoking Float#truncate.
+ * Numeric implements this by converting its value to a Float and invoking
+ * Float#truncate.
*/
static VALUE
-num_truncate(int argc, VALUE *argv, VALUE num)
+num_truncate(VALUE num)
{
- return flo_truncate(argc, argv, rb_Float(num));
+ return flo_truncate(rb_Float(num));
}
static double
@@ -2543,29 +1994,6 @@ ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl)
}
static int
-num_step_negative_p(VALUE num)
-{
- const ID mid = '<';
- VALUE zero = INT2FIX(0);
- VALUE r;
-
- if (FIXNUM_P(num)) {
- if (method_basic_p(rb_cInteger))
- return (SIGNED_VALUE)num < 0;
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- if (method_basic_p(rb_cInteger))
- return BIGNUM_NEGATIVE_P(num);
- }
-
- r = rb_check_funcall(num, '>', 1, &zero);
- if (r == Qundef) {
- coerce_failed(num, INT2FIX(0));
- }
- return !RTEST(r);
-}
-
-static int
num_step_scan_args(int argc, const VALUE *argv, VALUE *to, VALUE *step)
{
VALUE hash;
@@ -2599,7 +2027,7 @@ num_step_scan_args(int argc, const VALUE *argv, VALUE *to, VALUE *step)
if (NIL_P(*step)) {
*step = INT2FIX(1);
}
- desc = num_step_negative_p(*step);
+ desc = !positive_int_p(*step);
if (NIL_P(*to)) {
*to = desc ? DBL2NUM(-INFINITY) : DBL2NUM(INFINITY);
}
@@ -2617,7 +2045,6 @@ num_step_size(VALUE from, VALUE args, VALUE eobj)
return ruby_num_interval_step_size(from, to, step, FALSE);
}
-
/*
* call-seq:
* num.step(by: step, to: limit) {|i| block } -> self
@@ -2630,26 +2057,28 @@ num_step_size(VALUE from, VALUE args, VALUE eobj)
*
* The loop finishes when the value to be passed to the block is greater than
* +limit+ (if +step+ is positive) or less than +limit+ (if +step+ is
- * negative), where +limit+ is defaulted to infinity.
+ * negative), where <i>limit</i> is defaulted to infinity.
*
* In the recommended keyword argument style, either or both of
* +step+ and +limit+ (default infinity) can be omitted. In the
* fixed position argument style, zero as a step
- * (i.e. <code>num.step(limit, 0)</code>) is not allowed for historical
+ * (i.e. num.step(limit, 0)) is not allowed for historical
* compatibility reasons.
*
* If all the arguments are integers, the loop operates using an integer
* counter.
*
- * If any of the arguments are floating point numbers, all are converted
- * to floats, and the loop is executed
- * <i>floor(n + n*Float::EPSILON) + 1</i> times,
- * where <i>n = (limit - num)/step</i>.
+ * If any of the arguments are floating point numbers, all are converted to floats, and the loop is executed the following expression:
*
- * Otherwise, the loop starts at +num+, uses either the
- * less-than (<code><</code>) or greater-than (<code>></code>) operator
- * to compare the counter against +limit+,
- * and increments itself using the <code>+</code> operator.
+ * floor(n + n*epsilon)+ 1
+ *
+ * Where the +n+ is the following:
+ *
+ * n = (limit - num)/step
+ *
+ * Otherwise, the loop starts at +num+, uses either the less-than (<) or
+ * greater-than (>) operator to compare the counter against +limit+, and
+ * increments itself using the <code>+</code> operator.
*
* If no block is given, an Enumerator is returned instead.
*
@@ -2657,9 +2086,9 @@ num_step_size(VALUE from, VALUE args, VALUE eobj)
*
* p 1.step.take(4)
* p 10.step(by: -1).take(4)
- * 3.step(to: 5) {|i| print i, " " }
- * 1.step(10, 2) {|i| print i, " " }
- * Math::E.step(to: Math::PI, by: 0.2) {|f| print f, " " }
+ * 3.step(to: 5) { |i| print i, " " }
+ * 1.step(10, 2) { |i| print i, " " }
+ * Math::E.step(to: Math::PI, by: 0.2) { |f| print f, " " }
*
* Will produce:
*
@@ -2667,7 +2096,7 @@ num_step_size(VALUE from, VALUE args, VALUE eobj)
* [10, 9, 8, 7]
* 3 4 5
* 1 3 5 7 9
- * 2.718281828459045 2.9182818284590453 3.118281828459045
+ * 2.71828182845905 2.91828182845905 3.11828182845905
*/
static VALUE
@@ -2679,7 +2108,7 @@ num_step(int argc, VALUE *argv, VALUE from)
RETURN_SIZED_ENUMERATOR(from, argc, argv, num_step_size);
desc = num_step_scan_args(argc, argv, &to, &step);
- if (rb_equal(step, INT2FIX(0))) {
+ if (RTEST(rb_num_coerce_cmp(step, INT2FIX(0), id_eq))) {
inf = 1;
}
else if (RB_TYPE_P(to, T_FLOAT)) {
@@ -2788,23 +2217,24 @@ rb_num2ulong_internal(VALUE val, int *wrap_p)
}
if (FIXNUM_P(val)) {
- long l = FIX2LONG(val); /* this is FIX2LONG, intended */
+ long l = FIX2LONG(val); /* this is FIX2LONG, inteneded */
if (wrap_p)
*wrap_p = l < 0;
return (unsigned long)l;
}
else if (RB_TYPE_P(val, T_FLOAT)) {
- double d = RFLOAT_VALUE(val);
- if (d < ULONG_MAX_PLUS_ONE && LONG_MIN_MINUS_ONE_IS_LESS_THAN(d)) {
- if (wrap_p)
- *wrap_p = d <= -1.0; /* NUM2ULONG(v) uses v.to_int conceptually. */
- if (0 <= d)
- return (unsigned long)d;
- return (unsigned long)(long)d;
- }
- else {
- FLOAT_OUT_OF_RANGE(val, "integer");
- }
+ if (RFLOAT_VALUE(val) < ULONG_MAX_PLUS_ONE
+ && LONG_MIN_MINUS_ONE_IS_LESS_THAN(RFLOAT_VALUE(val))) {
+ double d = RFLOAT_VALUE(val);
+ if (wrap_p)
+ *wrap_p = d <= -1.0; /* NUM2ULONG(v) uses v.to_int conceptually. */
+ if (0 <= d)
+ return (unsigned long)d;
+ return (unsigned long)(long)d;
+ }
+ else {
+ FLOAT_OUT_OF_RANGE(val, "integer");
+ }
}
else if (RB_TYPE_P(val, T_BIGNUM)) {
{
@@ -2895,7 +2325,7 @@ rb_fix2uint(VALUE val)
}
num = FIX2ULONG(val);
- check_uint(num, rb_num_negative_int_p(val));
+ check_uint(num, negative_int_p(val));
return num;
}
#else
@@ -2912,8 +2342,7 @@ rb_fix2int(VALUE val)
}
#endif
-NORETURN(static void rb_out_of_short(SIGNED_VALUE num));
-static void
+void
rb_out_of_short(SIGNED_VALUE num)
{
rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too %s to convert to `short'",
@@ -2981,7 +2410,7 @@ rb_fix2ushort(VALUE val)
}
num = FIX2ULONG(val);
- check_ushort(num, rb_num_negative_int_p(val));
+ check_ushort(num, negative_int_p(val));
return num;
}
@@ -3021,9 +2450,9 @@ rb_num2ll(VALUE val)
if (FIXNUM_P(val)) return (LONG_LONG)FIX2LONG(val);
else if (RB_TYPE_P(val, T_FLOAT)) {
- double d = RFLOAT_VALUE(val);
- if (d < LLONG_MAX_PLUS_ONE && (LLONG_MIN_MINUS_ONE_IS_LESS_THAN(d))) {
- return (LONG_LONG)d;
+ if (RFLOAT_VALUE(val) < LLONG_MAX_PLUS_ONE
+ && (LLONG_MIN_MINUS_ONE_IS_LESS_THAN(RFLOAT_VALUE(val)))) {
+ return (LONG_LONG)(RFLOAT_VALUE(val));
}
else {
FLOAT_OUT_OF_RANGE(val, "long long");
@@ -3050,14 +2479,14 @@ rb_num2ull(VALUE val)
rb_raise(rb_eTypeError, "no implicit conversion from nil");
}
else if (RB_TYPE_P(val, T_FIXNUM)) {
- return (LONG_LONG)FIX2LONG(val); /* this is FIX2LONG, intended */
+ return (LONG_LONG)FIX2LONG(val); /* this is FIX2LONG, inteneded */
}
else if (RB_TYPE_P(val, T_FLOAT)) {
- double d = RFLOAT_VALUE(val);
- if (d < ULLONG_MAX_PLUS_ONE && LLONG_MIN_MINUS_ONE_IS_LESS_THAN(d)) {
- if (0 <= d)
- return (unsigned LONG_LONG)d;
- return (unsigned LONG_LONG)(LONG_LONG)d;
+ if (RFLOAT_VALUE(val) < ULLONG_MAX_PLUS_ONE
+ && LLONG_MIN_MINUS_ONE_IS_LESS_THAN(RFLOAT_VALUE(val))) {
+ if (0 <= RFLOAT_VALUE(val))
+ return (unsigned LONG_LONG)(RFLOAT_VALUE(val));
+ return (unsigned LONG_LONG)(LONG_LONG)(RFLOAT_VALUE(val));
}
else {
FLOAT_OUT_OF_RANGE(val, "unsigned long long");
@@ -3079,23 +2508,21 @@ rb_num2ull(VALUE val)
#endif /* HAVE_LONG_LONG */
-/********************************************************************
- *
+/*
* Document-class: Integer
*
- * Holds Integer values. You cannot add a singleton method to an
- * Integer object, any attempt to do so will raise a TypeError.
+ * This class is the basis for the two concrete classes that hold whole
+ * numbers, Bignum and Fixnum.
*
*/
/*
* call-seq:
- * int.to_i -> integer
- * int.to_int -> integer
+ * int.to_i -> integer
*
- * Since +int+ is already an Integer, returns +self+.
+ * As +int+ is already an Integer, all these methods simply return the receiver.
*
- * #to_int is an alias for #to_i.
+ * Synonyms are #to_int, #floor, #ceil, #truncate.
*/
static VALUE
@@ -3124,18 +2551,10 @@ int_int_p(VALUE num)
* Returns +true+ if +int+ is an odd number.
*/
-VALUE
-rb_int_odd_p(VALUE num)
+static VALUE
+int_odd_p(VALUE num)
{
- if (FIXNUM_P(num)) {
- if (num & 2) {
- return Qtrue;
- }
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_odd_p(num);
- }
- else if (rb_funcall(num, '%', 1, INT2FIX(2)) != INT2FIX(0)) {
+ if (rb_funcall(num, '%', 1, INT2FIX(2)) != INT2FIX(0)) {
return Qtrue;
}
return Qfalse;
@@ -3151,15 +2570,7 @@ rb_int_odd_p(VALUE num)
static VALUE
int_even_p(VALUE num)
{
- if (FIXNUM_P(num)) {
- if ((num & 2) == 0) {
- return Qtrue;
- }
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_even_p(num);
- }
- else if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) {
+ if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) {
return Qtrue;
}
return Qfalse;
@@ -3167,60 +2578,31 @@ int_even_p(VALUE num)
/*
* call-seq:
- * int.allbits?(mask) -> true or false
- *
- * Returns +true+ if all bits of <code>+int+ & +mask+</code> are 1.
- */
-
-static VALUE
-int_allbits_p(VALUE num, VALUE mask)
-{
- mask = rb_to_int(mask);
- return rb_int_equal(rb_int_and(num, mask), mask);
-}
-
-/*
- * call-seq:
- * int.anybits?(mask) -> true or false
+ * int.next -> integer
+ * int.succ -> integer
*
- * Returns +true+ if any bits of <code>+int+ & +mask+</code> are 1.
- */
-
-static VALUE
-int_anybits_p(VALUE num, VALUE mask)
-{
- mask = rb_to_int(mask);
- return num_zero_p(rb_int_and(num, mask)) ? Qfalse : Qtrue;
-}
-
-/*
- * call-seq:
- * int.nobits?(mask) -> true or false
+ * Returns the Integer equal to +int+ + 1.
*
- * Returns +true+ if no bits of <code>+int+ & +mask+</code> are 1.
+ * 1.next #=> 2
+ * (-1).next #=> 0
*/
static VALUE
-int_nobits_p(VALUE num, VALUE mask)
+fix_succ(VALUE num)
{
- mask = rb_to_int(mask);
- return num_zero_p(rb_int_and(num, mask));
+ long i = FIX2LONG(num) + 1;
+ return LONG2NUM(i);
}
/*
- * Document-method: Integer#succ
- * Document-method: Integer#next
* call-seq:
* int.next -> integer
* int.succ -> integer
*
- * Returns the successor of +int+,
- * i.e. the Integer equal to <code>int+1</code>.
+ * Returns the Integer equal to +int+ + 1, same as Fixnum#next.
*
* 1.next #=> 2
* (-1).next #=> 0
- * 1.succ #=> 2
- * (-1).succ #=> 0
*/
VALUE
@@ -3233,7 +2615,7 @@ rb_int_succ(VALUE num)
if (RB_TYPE_P(num, T_BIGNUM)) {
return rb_big_plus(num, INT2FIX(1));
}
- return num_funcall1(num, '+', INT2FIX(1));
+ return rb_funcall(num, '+', 1, INT2FIX(1));
}
#define int_succ rb_int_succ
@@ -3242,8 +2624,7 @@ rb_int_succ(VALUE num)
* call-seq:
* int.pred -> integer
*
- * Returns the predecessor of +int+,
- * i.e. the Integer equal to <code>int-1</code>.
+ * Returns the Integer equal to +int+ - 1.
*
* 1.pred #=> 0
* (-1).pred #=> -2
@@ -3259,24 +2640,11 @@ rb_int_pred(VALUE num)
if (RB_TYPE_P(num, T_BIGNUM)) {
return rb_big_minus(num, INT2FIX(1));
}
- return num_funcall1(num, '-', INT2FIX(1));
+ return rb_funcall(num, '-', 1, INT2FIX(1));
}
#define int_pred rb_int_pred
-/*
- * Document-method: Integer#chr
- * call-seq:
- * int.chr([encoding]) -> string
- *
- * Returns a string containing the character represented by the +int+'s value
- * according to +encoding+.
- *
- * 65.chr #=> "A"
- * 230.chr #=> "\xE6"
- * 255.chr(Encoding::UTF_8) #=> "\u00FF"
- */
-
VALUE
rb_enc_uint_chr(unsigned int code, rb_encoding *enc)
{
@@ -3299,6 +2667,18 @@ rb_enc_uint_chr(unsigned int code, rb_encoding *enc)
return str;
}
+/*
+ * call-seq:
+ * int.chr([encoding]) -> string
+ *
+ * Returns a string containing the character represented by the +int+'s value
+ * according to +encoding+.
+ *
+ * 65.chr #=> "A"
+ * 230.chr #=> "\346"
+ * 255.chr(Encoding::UTF_8) #=> "\303\277"
+ */
+
static VALUE
int_chr(int argc, VALUE *argv, VALUE num)
{
@@ -3349,12 +2729,12 @@ int_chr(int argc, VALUE *argv, VALUE num)
*
* Returns the +int+ itself.
*
- * 97.ord #=> 97
+ * ?a.ord #=> 97
*
- * This method is intended for compatibility to character literals
- * in Ruby 1.9.
+ * This method is intended for compatibility to character constant in Ruby
+ * 1.9.
*
- * For example, <code>?a.ord</code> returns 97 both in 1.8 and 1.9.
+ * For example, ?a.ord returns 97 both in 1.8 and 1.9.
*/
static VALUE
@@ -3363,17 +2743,30 @@ int_ord(VALUE num)
return num;
}
-/*
- * Fixnum
+/********************************************************************
+ *
+ * Document-class: Fixnum
+ *
+ * Holds Integer values that can be represented in a native machine word
+ * (minus 1 bit). If any operation on a Fixnum exceeds this range, the value
+ * is automatically converted to a Bignum.
+ *
+ * Fixnum objects have immediate value. This means that when they are assigned
+ * or passed as parameters, the actual object is passed, rather than a
+ * reference to that object.
+ *
+ * Assignment does not alias Fixnum objects. There is effectively only one
+ * Fixnum object instance for any given integer value, so, for example, you
+ * cannot add a singleton method to a Fixnum. Any attempt to add a singleton
+ * method to a Fixnum object will raise a TypeError.
*/
/*
- * Document-method: Integer#-@
* call-seq:
- * -int -> integer
+ * -fix -> integer
*
- * Returns +int+, negated.
+ * Negates +fix+, which may return a Bignum.
*/
static VALUE
@@ -3383,115 +2776,86 @@ fix_uminus(VALUE num)
}
VALUE
-rb_int_uminus(VALUE num)
-{
- if (FIXNUM_P(num)) {
- return fix_uminus(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_uminus(num);
- }
- return num_funcall0(num, idUMinus);
-}
-
-/*
- * Document-method: Integer#to_s
- * call-seq:
- * int.to_s(base=10) -> string
- *
- * Returns a string containing the place-value representation of +int+
- * with radix +base+ (between 2 and 36).
- *
- * 12345.to_s #=> "12345"
- * 12345.to_s(2) #=> "11000000111001"
- * 12345.to_s(8) #=> "30071"
- * 12345.to_s(10) #=> "12345"
- * 12345.to_s(16) #=> "3039"
- * 12345.to_s(36) #=> "9ix"
- * 78546939656932.to_s(36) #=> "rubyrules"
- */
-
-VALUE
rb_fix2str(VALUE x, int base)
{
- char buf[SIZEOF_VALUE*CHAR_BIT + 1], *const e = buf + sizeof buf, *b = e;
+ extern const char ruby_digitmap[];
+ char buf[SIZEOF_VALUE*CHAR_BIT + 2], *b = buf + sizeof buf;
long val = FIX2LONG(x);
- unsigned long u;
int neg = 0;
if (base < 2 || 36 < base) {
rb_raise(rb_eArgError, "invalid radix %d", base);
}
-#if SIZEOF_LONG < SIZEOF_VOIDP
-# if SIZEOF_VOIDP == SIZEOF_LONG_LONG
- if ((val >= 0 && (x & 0xFFFFFFFF00000000ull)) ||
- (val < 0 && (x & 0xFFFFFFFF00000000ull) != 0xFFFFFFFF00000000ull)) {
- rb_bug("Unnormalized Fixnum value %p", (void *)x);
- }
-# else
- /* should do something like above code, but currently ruby does not know */
- /* such platforms */
-# endif
-#endif
if (val == 0) {
return rb_usascii_str_new2("0");
}
if (val < 0) {
- u = 1 + (unsigned long)(-(val + 1)); /* u = -val avoiding overflow */
+ val = -val;
neg = 1;
}
- else {
- u = val;
- }
+ *--b = '\0';
do {
- *--b = ruby_digitmap[(int)(u % base)];
- } while (u /= base);
+ *--b = ruby_digitmap[(int)(val % base)];
+ } while (val /= base);
if (neg) {
*--b = '-';
}
- return rb_usascii_str_new(b, e - b);
+ return rb_usascii_str_new2(b);
}
+/*
+ * call-seq:
+ * fix.to_s(base=10) -> string
+ *
+ * Returns a string containing the representation of +fix+ radix +base+
+ * (between 2 and 36).
+ *
+ * 12345.to_s #=> "12345"
+ * 12345.to_s(2) #=> "11000000111001"
+ * 12345.to_s(8) #=> "30071"
+ * 12345.to_s(10) #=> "12345"
+ * 12345.to_s(16) #=> "3039"
+ * 12345.to_s(36) #=> "9ix"
+ *
+ */
static VALUE
-int_to_s(int argc, VALUE *argv, VALUE x)
+fix_to_s(int argc, VALUE *argv, VALUE x)
{
int base;
- if (rb_check_arity(argc, 0, 1))
- base = NUM2INT(argv[0]);
- else
- base = 10;
- return rb_int2str(x, base);
-}
+ if (argc == 0) base = 10;
+ else {
+ VALUE b;
-VALUE
-rb_int2str(VALUE x, int base)
-{
- if (FIXNUM_P(x)) {
- return rb_fix2str(x, base);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big2str(x, base);
+ rb_scan_args(argc, argv, "01", &b);
+ base = NUM2INT(b);
}
- return rb_any_to_s(x);
+ return rb_fix2str(x, base);
}
/*
- * Document-method: Integer#+
* call-seq:
- * int + numeric -> numeric_result
+ * fix + numeric -> numeric_result
*
- * Performs addition: the class of the resulting object depends on
- * the class of +numeric+.
+ * Performs addition: the class of the resulting object depends on the class of
+ * +numeric+ and on the magnitude of the result. It may return a Bignum.
*/
static VALUE
fix_plus(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_fix_plus_fix(x, y);
+ long a, b, c;
+ VALUE r;
+
+ a = FIX2LONG(x);
+ b = FIX2LONG(y);
+ c = a + b;
+ r = LONG2NUM(c);
+
+ return r;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
return rb_big_plus(y, x);
@@ -3499,46 +2863,32 @@ fix_plus(VALUE x, VALUE y)
else if (RB_TYPE_P(y, T_FLOAT)) {
return DBL2NUM((double)FIX2LONG(x) + RFLOAT_VALUE(y));
}
- else if (RB_TYPE_P(y, T_COMPLEX)) {
- return rb_complex_plus(y, x);
- }
else {
return rb_num_coerce_bin(x, y, '+');
}
}
-VALUE
-rb_fix_plus(VALUE x, VALUE y)
-{
- return fix_plus(x, y);
-}
-
-VALUE
-rb_int_plus(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_plus(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_plus(x, y);
- }
- return rb_num_coerce_bin(x, y, '+');
-}
-
/*
- * Document-method: Integer#-
* call-seq:
- * int - numeric -> numeric_result
+ * fix - numeric -> numeric_result
*
- * Performs subtraction: the class of the resulting object depends on
- * the class of +numeric+.
+ * Performs subtraction: the class of the resulting object depends on the class
+ * of +numeric+ and on the magnitude of the result. It may return a Bignum.
*/
static VALUE
fix_minus(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_fix_minus_fix(x, y);
+ long a, b, c;
+ VALUE r;
+
+ a = FIX2LONG(x);
+ b = FIX2LONG(y);
+ c = a - b;
+ r = LONG2NUM(c);
+
+ return r;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
x = rb_int2big(FIX2LONG(x));
@@ -3552,140 +2902,124 @@ fix_minus(VALUE x, VALUE y)
}
}
-VALUE
-rb_int_minus(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_minus(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_minus(x, y);
- }
- return rb_num_coerce_bin(x, y, '-');
-}
-
-
-#define SQRT_LONG_MAX HALF_LONG_MSB
+#define SQRT_LONG_MAX ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2))
/*tests if N*N would overflow*/
#define FIT_SQRT_LONG(n) (((n)<SQRT_LONG_MAX)&&((n)>=-SQRT_LONG_MAX))
/*
- * Document-method: Integer#*
* call-seq:
- * int * numeric -> numeric_result
+ * fix * numeric -> numeric_result
*
- * Performs multiplication: the class of the resulting object depends on
- * the class of +numeric+.
+ * Performs multiplication: the class of the resulting object depends on the
+ * class of +numeric+ and on the magnitude of the result. It may return a
+ * Bignum.
*/
static VALUE
fix_mul(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return rb_fix_mul_fix(x, y);
+#ifdef __HP_cc
+/* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */
+ volatile
+#endif
+ long a, b;
+#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
+ LONG_LONG d;
+#else
+ VALUE r;
+#endif
+
+ a = FIX2LONG(x);
+ b = FIX2LONG(y);
+
+#if SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
+ d = (LONG_LONG)a * b;
+ if (FIXABLE(d)) return LONG2FIX(d);
+ return rb_ll2inum(d);
+#else
+ if (a == 0) return x;
+ if (MUL_OVERFLOW_FIXNUM_P(a, b))
+ r = rb_big_mul(rb_int2big(a), rb_int2big(b));
+ else
+ r = LONG2FIX(a * b);
+ return r;
+#endif
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- switch (x) {
- case INT2FIX(0): return x;
- case INT2FIX(1): return y;
- }
return rb_big_mul(y, x);
}
else if (RB_TYPE_P(y, T_FLOAT)) {
return DBL2NUM((double)FIX2LONG(x) * RFLOAT_VALUE(y));
}
- else if (RB_TYPE_P(y, T_COMPLEX)) {
- return rb_complex_mul(y, x);
- }
else {
return rb_num_coerce_bin(x, y, '*');
}
}
-VALUE
-rb_int_mul(VALUE x, VALUE y)
+static void
+fixdivmod(long x, long y, long *divp, long *modp)
{
- if (FIXNUM_P(x)) {
- return fix_mul(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_mul(x, y);
- }
- return rb_num_coerce_bin(x, y, '*');
-}
+ long div, mod;
-static double
-fix_fdiv_double(VALUE x, VALUE y)
-{
- if (FIXNUM_P(y)) {
- return (double)FIX2LONG(x) / (double)FIX2LONG(y);
- }
- else if (RB_TYPE_P(y, T_BIGNUM)) {
- return rb_big_fdiv_double(rb_int2big(FIX2LONG(x)), y);
- }
- else if (RB_TYPE_P(y, T_FLOAT)) {
- return (double)FIX2LONG(x) / RFLOAT_VALUE(y);
+ if (y == 0) rb_num_zerodiv();
+ if (y < 0) {
+ if (x < 0)
+ div = -x / -y;
+ else
+ div = - (x / -y);
}
else {
- return NUM2DBL(rb_num_coerce_bin(x, y, rb_intern("fdiv")));
- }
-}
-
-double
-rb_int_fdiv_double(VALUE x, VALUE y)
-{
- if (RB_INTEGER_TYPE_P(y) && !FIXNUM_ZERO_P(y)) {
- VALUE gcd = rb_gcd(x, y);
- if (!FIXNUM_ZERO_P(gcd)) {
- x = rb_int_idiv(x, gcd);
- y = rb_int_idiv(y, gcd);
- }
- }
- if (FIXNUM_P(x)) {
- return fix_fdiv_double(x, y);
+ if (x < 0)
+ div = - (-x / y);
+ else
+ div = x / y;
}
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_fdiv_double(x, y);
+ mod = x - div*y;
+ if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
+ mod += y;
+ div -= 1;
}
- return NAN;
+ if (divp) *divp = div;
+ if (modp) *modp = mod;
}
/*
- * Document-method: Integer#fdiv
* call-seq:
- * int.fdiv(numeric) -> float
+ * fix.fdiv(numeric) -> float
*
- * Returns the floating point result of dividing +int+ by +numeric+.
+ * Returns the floating point result of dividing +fix+ by +numeric+.
+ *
+ * 654321.fdiv(13731) #=> 47.6528293642124
+ * 654321.fdiv(13731.24) #=> 47.6519964693647
*
- * 654321.fdiv(13731) #=> 47.652829364212366
- * 654321.fdiv(13731.24) #=> 47.65199646936475
- * -654321.fdiv(13731) #=> -47.652829364212366
*/
-VALUE
-rb_int_fdiv(VALUE x, VALUE y)
+static VALUE
+fix_fdiv(VALUE x, VALUE y)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return DBL2NUM(rb_int_fdiv_double(x, y));
+ if (FIXNUM_P(y)) {
+ return DBL2NUM((double)FIX2LONG(x) / (double)FIX2LONG(y));
+ }
+ else if (RB_TYPE_P(y, T_BIGNUM)) {
+ return rb_big_fdiv(rb_int2big(FIX2LONG(x)), y);
+ }
+ else if (RB_TYPE_P(y, T_FLOAT)) {
+ return DBL2NUM((double)FIX2LONG(x) / RFLOAT_VALUE(y));
+ }
+ else {
+ return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
- return Qnil;
}
-/*
- * Document-method: Integer#/
- * call-seq:
- * int / numeric -> numeric_result
- *
- * Performs division: the class of the resulting object depends on
- * the class of +numeric+.
- */
-
static VALUE
fix_divide(VALUE x, VALUE y, ID op)
{
if (FIXNUM_P(y)) {
- if (FIXNUM_ZERO_P(y)) rb_num_zerodiv();
- return rb_fix_div_fix(x, y);
+ long div;
+
+ fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, 0);
+ return LONG2NUM(div);
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
x = rb_int2big(FIX2LONG(x));
@@ -3714,59 +3048,40 @@ fix_divide(VALUE x, VALUE y, ID op)
}
}
+/*
+ * call-seq:
+ * fix / numeric -> numeric_result
+ *
+ * Performs division: the class of the resulting object depends on the class of
+ * +numeric+ and on the magnitude of the result. It may return a Bignum.
+ */
+
static VALUE
fix_div(VALUE x, VALUE y)
{
return fix_divide(x, y, '/');
}
-VALUE
-rb_int_div(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_div(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_div(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#div
* call-seq:
- * int.div(numeric) -> integer
+ * fix.div(numeric) -> integer
*
- * Performs integer division: returns the integer result of dividing +int+
- * by +numeric+.
+ * Performs integer division: returns integer result of dividing +fix+ by
+ * +numeric+.
*/
static VALUE
fix_idiv(VALUE x, VALUE y)
{
- return fix_divide(x, y, id_div);
-}
-
-VALUE
-rb_int_idiv(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_idiv(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_idiv(x, y);
- }
- return num_div(x, y);
+ return fix_divide(x, y, rb_intern("div"));
}
/*
- * Document-method: Integer#%
- * Document-method: Integer#modulo
* call-seq:
- * int % other -> real
- * int.modulo(other) -> real
+ * fix % other -> real
+ * fix.modulo(other) -> real
*
- * Returns +int+ modulo +other+.
+ * Returns +fix+ modulo +other+.
*
* See Numeric#divmod for more information.
*/
@@ -3775,8 +3090,10 @@ static VALUE
fix_mod(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- if (FIXNUM_ZERO_P(y)) rb_num_zerodiv();
- return rb_fix_mod_fix(x, y);
+ long mod;
+
+ fixdivmod(FIX2LONG(x), FIX2LONG(y), 0, &mod);
+ return LONG2NUM(mod);
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
x = rb_int2big(FIX2LONG(x));
@@ -3790,51 +3107,9 @@ fix_mod(VALUE x, VALUE y)
}
}
-VALUE
-rb_int_modulo(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_mod(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_modulo(x, y);
- }
- return num_modulo(x, y);
-}
-
-/*
- * call-seq:
- * int.remainder(numeric) -> real
- *
- * Returns the remainder after dividing +int+ by +numeric+.
- *
- * <code>x.remainder(y)</code> means <code>x-y*(x/y).truncate</code>.
- *
- * 5.remainder(3) #=> 2
- * -5.remainder(3) #=> -2
- * 5.remainder(-3) #=> 2
- * -5.remainder(-3) #=> -2
- * 5.remainder(1.5) #=> 0.5
- *
- * See Numeric#divmod.
- */
-
-VALUE
-int_remainder(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return num_remainder(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_remainder(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#divmod
* call-seq:
- * int.divmod(numeric) -> array
+ * fix.divmod(numeric) -> array
*
* See Numeric#divmod.
*/
@@ -3842,10 +3117,11 @@ static VALUE
fix_divmod(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- VALUE div, mod;
- if (FIXNUM_ZERO_P(y)) rb_num_zerodiv();
- rb_fix_divmod_fix(x, y, &div, &mod);
- return rb_assoc_new(div, mod);
+ long div, mod;
+
+ fixdivmod(FIX2LONG(x), FIX2LONG(y), &div, &mod);
+
+ return rb_assoc_new(LONG2NUM(div), LONG2NUM(mod));
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
x = rb_int2big(FIX2LONG(x));
@@ -3863,49 +3139,16 @@ fix_divmod(VALUE x, VALUE y)
}
}
else {
- return rb_num_coerce_bin(x, y, id_divmod);
+ return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
}
-VALUE
-rb_int_divmod(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_divmod(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_divmod(x, y);
- }
- return Qnil;
-}
-
-/*
- * Document-method: Integer#**
- * call-seq:
- * int ** numeric -> numeric_result
- *
- * Raises +int+ to the power of +numeric+, which may be negative or
- * fractional.
- * The result may be an Integer, a Float, a Rational, or a complex number.
- *
- * 2 ** 3 #=> 8
- * 2 ** -1 #=> (1/2)
- * 2 ** 0.5 #=> 1.4142135623730951
- * (-1) ** 0.5 #=> (0.0+1.0i)
- *
- * 123456789 ** 2 #=> 15241578750190521
- * 123456789 ** 1.2 #=> 5126464716.0993185
- * 123456789 ** -2 #=> (1/15241578750190521)
- */
-
static VALUE
int_pow(long x, unsigned long y)
{
int neg = x < 0;
long z = 1;
- if (y == 0) return INT2FIX(1);
- if (y == 1) return LONG2NUM(x);
if (neg) x = -x;
if (y & 1)
z = x;
@@ -3918,8 +3161,6 @@ int_pow(long x, unsigned long y)
VALUE v;
bignum:
v = rb_big_pow(rb_int2big(x), LONG2NUM(y));
- if (RB_FLOAT_TYPE_P(v)) /* infinity due to overflow */
- return v;
if (z != 1) v = rb_big_mul(rb_int2big(neg ? -z : z), v);
return v;
}
@@ -3943,6 +3184,18 @@ rb_int_positive_pow(long x, unsigned long y)
return int_pow(x, y);
}
+/*
+ * call-seq:
+ * fix ** numeric -> numeric_result
+ *
+ * Raises +fix+ to the power of +numeric+, which may be negative or
+ * fractional.
+ *
+ * 2 ** 3 #=> 8
+ * 2 ** -1 #=> (1/2)
+ * 2 ** 0.5 #=> 1.4142135623731
+ */
+
static VALUE
fix_pow(VALUE x, VALUE y)
{
@@ -3959,7 +3212,7 @@ fix_pow(VALUE x, VALUE y)
return INT2FIX(-1);
}
if (b < 0)
- return num_funcall1(rb_rational_raw1(x), idPow, y);
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
if (b == 0) return INT2FIX(1);
if (b == 1) return x;
@@ -3975,53 +3228,38 @@ fix_pow(VALUE x, VALUE y)
if (int_even_p(y)) return INT2FIX(1);
else return INT2FIX(-1);
}
- if (rb_num_negative_int_p(y))
- return num_funcall1(rb_rational_raw1(x), idPow, y);
+ if (negative_int_p(y))
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
if (a == 0) return INT2FIX(0);
x = rb_int2big(FIX2LONG(x));
return rb_big_pow(x, y);
}
else if (RB_TYPE_P(y, T_FLOAT)) {
- double dy = RFLOAT_VALUE(y);
- if (dy == 0.0) return DBL2NUM(1.0);
+ if (RFLOAT_VALUE(y) == 0.0) return DBL2NUM(1.0);
if (a == 0) {
- return DBL2NUM(dy < 0 ? INFINITY : 0.0);
+ return DBL2NUM(RFLOAT_VALUE(y) < 0 ? INFINITY : 0.0);
}
if (a == 1) return DBL2NUM(1.0);
{
+ double dy = RFLOAT_VALUE(y);
if (a < 0 && dy != round(dy))
- return num_funcall1(rb_complex_raw1(x), idPow, y);
+ return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
return DBL2NUM(pow((double)a, dy));
}
}
else {
- return rb_num_coerce_bin(x, y, idPow);
+ return rb_num_coerce_bin(x, y, rb_intern("**"));
}
}
-VALUE
-rb_int_pow(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_pow(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_pow(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#==
- * Document-method: Integer#===
* call-seq:
- * int == other -> true or false
+ * fix == other -> true or false
*
- * Returns +true+ if +int+ equals +other+ numerically.
- * Contrast this with Integer#eql?, which requires +other+ to be an Integer.
+ * Return +true+ if +fix+ equals +other+ numerically.
*
- * 1 == 2 #=> false
- * 1 == 1.0 #=> true
+ * 1 == 2 #=> false
+ * 1 == 1.0 #=> true
*/
static VALUE
@@ -4040,24 +3278,11 @@ fix_equal(VALUE x, VALUE y)
}
}
-VALUE
-rb_int_equal(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_equal(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_eq(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#<=>
* call-seq:
- * int <=> numeric -> -1, 0, +1, or nil
+ * fix <=> numeric -> -1, 0, +1 or nil
*
- * Comparison---Returns -1, 0, or +1 depending on whether +int+ is
+ * Comparison---Returns +-1+, +0+, ++1+ or +nil+ depending on whether +fix+ is
* less than, equal to, or greater than +numeric+.
*
* This is the basis for the tests in the Comparable module.
@@ -4074,42 +3299,21 @@ fix_cmp(VALUE x, VALUE y)
return INT2FIX(-1);
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- VALUE cmp = rb_big_cmp(y, x);
- switch (cmp) {
- case INT2FIX(+1): return INT2FIX(-1);
- case INT2FIX(-1): return INT2FIX(+1);
- }
- return cmp;
+ return rb_big_cmp(rb_int2big(FIX2LONG(x)), y);
}
else if (RB_TYPE_P(y, T_FLOAT)) {
- return rb_integer_float_cmp(x, y);
+ return rb_integer_float_cmp(x, y);
}
else {
return rb_num_coerce_cmp(x, y, id_cmp);
}
- return rb_num_coerce_cmp(x, y, id_cmp);
-}
-
-VALUE
-rb_int_cmp(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_cmp(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_cmp(x, y);
- }
- else {
- rb_raise(rb_eNotImpError, "need to define `<=>' in %s", rb_obj_classname(x));
- }
}
/*
- * Document-method: Integer#>
* call-seq:
- * int > real -> true or false
+ * fix > real -> true or false
*
- * Returns +true+ if the value of +int+ is greater than that of +real+.
+ * Returns +true+ if the value of +fix+ is greater than that of +real+.
*/
static VALUE
@@ -4120,7 +3324,7 @@ fix_gt(VALUE x, VALUE y)
return Qfalse;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- return rb_big_cmp(y, x) == INT2FIX(-1) ? Qtrue : Qfalse;
+ return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) > 0 ? Qtrue : Qfalse;
}
else if (RB_TYPE_P(y, T_FLOAT)) {
return rb_integer_float_cmp(x, y) == INT2FIX(1) ? Qtrue : Qfalse;
@@ -4130,24 +3334,11 @@ fix_gt(VALUE x, VALUE y)
}
}
-VALUE
-rb_int_gt(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_gt(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_gt(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#>=
* call-seq:
- * int >= real -> true or false
+ * fix >= real -> true or false
*
- * Returns +true+ if the value of +int+ is greater than or equal to that of
+ * Returns +true+ if the value of +fix+ is greater than or equal to that of
* +real+.
*/
@@ -4159,35 +3350,22 @@ fix_ge(VALUE x, VALUE y)
return Qfalse;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- return rb_big_cmp(y, x) != INT2FIX(+1) ? Qtrue : Qfalse;
+ return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) >= 0 ? Qtrue : Qfalse;
}
else if (RB_TYPE_P(y, T_FLOAT)) {
VALUE rel = rb_integer_float_cmp(x, y);
return rel == INT2FIX(1) || rel == INT2FIX(0) ? Qtrue : Qfalse;
}
else {
- return rb_num_coerce_relop(x, y, idGE);
- }
-}
-
-VALUE
-rb_int_ge(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_ge(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_ge(x, y);
+ return rb_num_coerce_relop(x, y, rb_intern(">="));
}
- return Qnil;
}
/*
- * Document-method: Integer#<
* call-seq:
- * int < real -> true or false
+ * fix < real -> true or false
*
- * Returns +true+ if the value of +int+ is less than that of +real+.
+ * Returns +true+ if the value of +fix+ is less than that of +real+.
*/
static VALUE
@@ -4198,7 +3376,7 @@ fix_lt(VALUE x, VALUE y)
return Qfalse;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- return rb_big_cmp(y, x) == INT2FIX(+1) ? Qtrue : Qfalse;
+ return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) < 0 ? Qtrue : Qfalse;
}
else if (RB_TYPE_P(y, T_FLOAT)) {
return rb_integer_float_cmp(x, y) == INT2FIX(-1) ? Qtrue : Qfalse;
@@ -4208,24 +3386,11 @@ fix_lt(VALUE x, VALUE y)
}
}
-static VALUE
-int_lt(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_lt(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_lt(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#<=
* call-seq:
- * int <= real -> true or false
+ * fix <= real -> true or false
*
- * Returns +true+ if the value of +int+ is less than or equal to that of
+ * Returns +true+ if the value of +fix+ is less than or equal to that of
* +real+.
*/
@@ -4237,95 +3402,53 @@ fix_le(VALUE x, VALUE y)
return Qfalse;
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
- return rb_big_cmp(y, x) != INT2FIX(-1) ? Qtrue : Qfalse;
+ return FIX2INT(rb_big_cmp(rb_int2big(FIX2LONG(x)), y)) <= 0 ? Qtrue : Qfalse;
}
else if (RB_TYPE_P(y, T_FLOAT)) {
VALUE rel = rb_integer_float_cmp(x, y);
return rel == INT2FIX(-1) || rel == INT2FIX(0) ? Qtrue : Qfalse;
}
else {
- return rb_num_coerce_relop(x, y, idLE);
- }
-}
-
-static VALUE
-int_le(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_le(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_le(x, y);
+ return rb_num_coerce_relop(x, y, rb_intern("<="));
}
- return Qnil;
}
/*
- * Document-method: Integer#~
* call-seq:
- * ~int -> integer
+ * ~fix -> integer
*
* One's complement: returns a number where each bit is flipped.
- *
- * Inverts the bits in an Integer. As integers are conceptually of
- * infinite length, the result acts as if it had an infinite number of
- * one bits to the left. In hex representations, this is displayed
- * as two periods to the left of the digits.
- *
- * sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA"
*/
static VALUE
-fix_comp(VALUE num)
+fix_rev(VALUE num)
{
return ~num | FIXNUM_FLAG;
}
-static VALUE
-int_comp(VALUE num)
-{
- if (FIXNUM_P(num)) {
- return fix_comp(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_comp(num);
- }
- return Qnil;
-}
-
-static VALUE
-num_funcall_bit_1(VALUE y, VALUE arg, int recursive)
+static int
+bit_coerce(VALUE *x, VALUE *y)
{
- ID func = (ID)((VALUE *)arg)[0];
- VALUE x = ((VALUE *)arg)[1];
- if (recursive) {
- num_funcall_op_1_recursion(x, func, y);
+ if (!FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
+ do_coerce(x, y, TRUE);
+ if (!FIXNUM_P(*x) && !RB_TYPE_P(*x, T_BIGNUM)
+ && !FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
+ coerce_failed(*x, *y);
+ }
}
- return rb_check_funcall(x, func, 1, &y);
+ return TRUE;
}
VALUE
rb_num_coerce_bit(VALUE x, VALUE y, ID func)
{
- VALUE ret, args[3];
-
- args[0] = (VALUE)func;
- args[1] = x;
- args[2] = y;
- do_coerce(&args[1], &args[2], TRUE);
- ret = rb_exec_recursive_paired(num_funcall_bit_1,
- args[2], args[1], (VALUE)args);
- if (ret == Qundef) {
- /* show the original object, not coerced object */
- coerce_failed(x, y);
- }
- return ret;
+ bit_coerce(&x, &y);
+ return rb_funcall(x, func, 1, y);
}
/*
- * Document-method: Integer#&
* call-seq:
- * int & other_int -> integer
+ * fix & integer -> integer_result
*
* Bitwise AND.
*/
@@ -4342,25 +3465,13 @@ fix_and(VALUE x, VALUE y)
return rb_big_and(y, x);
}
- return rb_num_coerce_bit(x, y, '&');
-}
-
-VALUE
-rb_int_and(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_and(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_and(x, y);
- }
- return Qnil;
+ bit_coerce(&x, &y);
+ return rb_funcall(x, rb_intern("&"), 1, y);
}
/*
- * Document-method: Integer#|
* call-seq:
- * int | other_int -> integer
+ * fix | integer -> integer_result
*
* Bitwise OR.
*/
@@ -4377,25 +3488,13 @@ fix_or(VALUE x, VALUE y)
return rb_big_or(y, x);
}
- return rb_num_coerce_bit(x, y, '|');
-}
-
-static VALUE
-int_or(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_or(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_or(x, y);
- }
- return Qnil;
+ bit_coerce(&x, &y);
+ return rb_funcall(x, rb_intern("|"), 1, y);
}
/*
- * Document-method: Integer#^
* call-seq:
- * int ^ other_int -> integer
+ * fix ^ integer -> integer_result
*
* Bitwise EXCLUSIVE OR.
*/
@@ -4412,28 +3511,18 @@ fix_xor(VALUE x, VALUE y)
return rb_big_xor(y, x);
}
- return rb_num_coerce_bit(x, y, '^');
+ bit_coerce(&x, &y);
+ return rb_funcall(x, rb_intern("^"), 1, y);
}
-static VALUE
-int_xor(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return fix_xor(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_xor(x, y);
- }
- return Qnil;
-}
+static VALUE fix_lshift(long, unsigned long);
+static VALUE fix_rshift(long, unsigned long);
/*
- * Document-method: Integer#<<
* call-seq:
- * int << count -> integer
+ * fix << count -> integer
*
- * Returns +int+ shifted left +count+ positions, or right if +count+
- * is negative.
+ * Shifts +fix+ left +count+ positions, or right if +count+ is negative.
*/
static VALUE
@@ -4461,25 +3550,11 @@ fix_lshift(long val, unsigned long width)
return LONG2NUM(val);
}
-VALUE
-rb_int_lshift(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return rb_fix_lshift(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_lshift(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#>>
* call-seq:
- * int >> count -> integer
+ * fix >> count -> integer
*
- * Returns +int+ shifted right +count+ positions, or left if +count+
- * is negative.
+ * Shifts +fix+ right +count+ positions, or left if +count+ is negative.
*/
static VALUE
@@ -4508,34 +3583,18 @@ fix_rshift(long val, unsigned long i)
return LONG2FIX(val);
}
-static VALUE
-rb_int_rshift(VALUE x, VALUE y)
-{
- if (FIXNUM_P(x)) {
- return rb_fix_rshift(x, y);
- }
- else if (RB_TYPE_P(x, T_BIGNUM)) {
- return rb_big_rshift(x, y);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#[]
* call-seq:
- * int[n] -> 0, 1
+ * fix[n] -> 0, 1
+ *
+ * Bit Reference---Returns the +n+th bit in the binary representation of
+ * +fix+, where <code>fix[0]</code> is the least significant bit.
*
- * Bit Reference---Returns the <code>n</code>th bit in the
- * binary representation of +int+, where <code>int[0]</code>
- * is the least significant bit.
+ * For example:
*
* a = 0b11001100101010
- * 30.downto(0) {|n| print a[n] }
+ * 30.downto(0) do |n| print a[n] end
* #=> 0000000000000000011001100101010
- *
- * a = 9**15
- * 50.downto(0) {|n| print a[n] }
- * #=> 000101110110100000111000011110010100111100010111001
*/
static VALUE
@@ -4565,59 +3624,34 @@ fix_aref(VALUE fix, VALUE idx)
return INT2FIX(0);
}
-static VALUE
-int_aref(VALUE num, VALUE idx)
-{
- if (FIXNUM_P(num)) {
- return fix_aref(num, idx);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_aref(num, idx);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#to_f
* call-seq:
- * int.to_f -> float
+ * fix.to_f -> float
+ *
+ * Converts +fix+ to a Float.
*
- * Converts +int+ to a Float. If +int+ doesn't fit in a Float,
- * the result is infinity.
*/
static VALUE
-int_to_f(VALUE num)
+fix_to_f(VALUE num)
{
double val;
- if (FIXNUM_P(num)) {
- val = (double)FIX2LONG(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- val = rb_big2dbl(num);
- }
- else {
- rb_raise(rb_eNotImpError, "Unknown subclass for to_f: %s", rb_obj_classname(num));
- }
+ val = (double)FIX2LONG(num);
return DBL2NUM(val);
}
/*
- * Document-method: Integer#abs
- * Document-method: Integer#magnitude
* call-seq:
- * int.abs -> integer
- * int.magnitude -> integer
+ * fix.abs -> integer
+ * fix.magnitude -> integer
*
- * Returns the absolute value of +int+.
+ * Returns the absolute value of +fix+.
*
- * (-12345).abs #=> 12345
- * -12345.abs #=> 12345
- * 12345.abs #=> 12345
+ * -12345.abs #=> 12345
+ * 12345.abs #=> 12345
*
- * Integer#magnitude is an alias for Integer#abs.
*/
static VALUE
@@ -4630,32 +3664,17 @@ fix_abs(VALUE fix)
return LONG2NUM(i);
}
-VALUE
-rb_int_abs(VALUE num)
-{
- if (FIXNUM_P(num)) {
- return fix_abs(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_abs(num);
- }
- return Qnil;
-}
+
/*
- * Document-method: Integer#size
* call-seq:
- * int.size -> int
+ * fix.size -> fixnum
*
- * Returns the number of bytes in the machine representation of +int+
- * (machine dependent).
+ * Returns the number of bytes in the machine representation of +fix+.
*
- * 1.size #=> 8
- * -1.size #=> 8
- * 2147483647.size #=> 8
- * (256**10 - 1).size #=> 10
- * (256**20 - 1).size #=> 20
- * (256**40 - 1).size #=> 40
+ * 1.size #=> 4
+ * -1.size #=> 4
+ * 2147483647.size #=> 4
*/
static VALUE
@@ -4664,35 +3683,19 @@ fix_size(VALUE fix)
return INT2FIX(sizeof(long));
}
-static VALUE
-int_size(VALUE num)
-{
- if (FIXNUM_P(num)) {
- return fix_size(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_size_m(num);
- }
- return Qnil;
-}
-
/*
- * Document-method: Integer#bit_length
* call-seq:
- * int.bit_length -> integer
+ * int.bit_length -> integer
*
- * Returns the number of bits of the value of +int+.
+ * Returns the number of bits of the value of <i>int</i>.
*
- * "Number of bits" means the bit position of the highest bit
- * which is different from the sign bit
- * (where the least significant bit has bit position 1).
+ * "the number of bits" means that
+ * the bit position of the highest bit which is different to the sign bit.
+ * (The bit position of the bit 2**n is n+1.)
* If there is no such bit (zero or minus one), zero is returned.
*
- * I.e. this method returns <i>ceil(log2(int < 0 ? -int : int+1))</i>.
+ * I.e. This method returns ceil(log2(int < 0 ? -int : int+1)).
*
- * (-2**1000-1).bit_length #=> 1001
- * (-2**1000).bit_length #=> 1000
- * (-2**1000+1).bit_length #=> 1000
* (-2**12-1).bit_length #=> 13
* (-2**12).bit_length #=> 12
* (-2**12+1).bit_length #=> 12
@@ -4708,11 +3711,8 @@ int_size(VALUE num)
* (2**12-1).bit_length #=> 12
* (2**12).bit_length #=> 13
* (2**12+1).bit_length #=> 13
- * (2**1000-1).bit_length #=> 1000
- * (2**1000).bit_length #=> 1001
- * (2**1000+1).bit_length #=> 1001
*
- * This method can be used to detect overflow in Array#pack as follows:
+ * This method can be used to detect overflow in Array#pack as follows.
*
* if n.bit_length < 32
* [n].pack("l") # no overflow
@@ -4731,128 +3731,12 @@ rb_fix_bit_length(VALUE fix)
}
static VALUE
-rb_int_bit_length(VALUE num)
-{
- if (FIXNUM_P(num)) {
- return rb_fix_bit_length(num);
- }
- else if (RB_TYPE_P(num, T_BIGNUM)) {
- return rb_big_bit_length(num);
- }
- return Qnil;
-}
-
-/*
- * Document-method: Integer#digits
- * call-seq:
- * int.digits -> array
- * int.digits(base) -> array
- *
- * Returns the digits of +int+'s place-value representation
- * with radix +base+ (default: 10).
- * The digits are returned as an array with the least significant digit
- * as the first array element.
- *
- * +base+ must be greater than or equal to 2.
- *
- * 12345.digits #=> [5, 4, 3, 2, 1]
- * 12345.digits(7) #=> [4, 6, 6, 0, 5]
- * 12345.digits(100) #=> [45, 23, 1]
- *
- * -12345.digits(7) #=> Math::DomainError
- */
-
-static VALUE
-rb_fix_digits(VALUE fix, long base)
-{
- VALUE digits;
- long x = FIX2LONG(fix);
-
- assert(x >= 0);
-
- if (base < 2)
- rb_raise(rb_eArgError, "invalid radix %ld", base);
-
- if (x == 0)
- return rb_ary_new_from_args(1, INT2FIX(0));
-
- digits = rb_ary_new();
- while (x > 0) {
- long q = x % base;
- rb_ary_push(digits, LONG2NUM(q));
- x /= base;
- }
-
- return digits;
-}
-
-static VALUE
-rb_int_digits_bigbase(VALUE num, VALUE base)
-{
- VALUE digits;
-
- assert(!rb_num_negative_p(num));
-
- if (RB_TYPE_P(base, T_BIGNUM))
- base = rb_big_norm(base);
-
- if (FIXNUM_P(base) && FIX2LONG(base) < 2)
- rb_raise(rb_eArgError, "invalid radix %ld", FIX2LONG(base));
- else if (RB_TYPE_P(base, T_BIGNUM) && BIGNUM_NEGATIVE_P(base))
- rb_raise(rb_eArgError, "negative radix");
-
- if (FIXNUM_P(base) && FIXNUM_P(num))
- return rb_fix_digits(num, FIX2LONG(base));
-
- if (FIXNUM_P(num))
- return rb_ary_new_from_args(1, num);
-
- digits = rb_ary_new();
- while (!FIXNUM_P(num) || FIX2LONG(num) > 0) {
- VALUE qr = rb_int_divmod(num, base);
- rb_ary_push(digits, RARRAY_AREF(qr, 1));
- num = RARRAY_AREF(qr, 0);
- }
-
- return digits;
-}
-
-static VALUE
-rb_int_digits(int argc, VALUE *argv, VALUE num)
+int_upto_size(VALUE from, VALUE args, VALUE eobj)
{
- VALUE base_value;
- long base;
-
- if (rb_num_negative_p(num))
- rb_raise(rb_eMathDomainError, "out of domain");
-
- if (rb_check_arity(argc, 0, 1)) {
- base_value = rb_to_int(argv[0]);
- if (!RB_INTEGER_TYPE_P(base_value))
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Integer)",
- rb_obj_classname(argv[0]));
- if (RB_TYPE_P(base_value, T_BIGNUM))
- return rb_int_digits_bigbase(num, base_value);
-
- base = FIX2LONG(base_value);
- if (base < 0)
- rb_raise(rb_eArgError, "negative radix");
- else if (base < 2)
- rb_raise(rb_eArgError, "invalid radix %ld", base);
- }
- else
- base = 10;
-
- if (FIXNUM_P(num))
- return rb_fix_digits(num, base);
- else if (RB_TYPE_P(num, T_BIGNUM))
- return rb_int_digits_bigbase(num, LONG2FIX(base));
-
- return Qnil;
+ return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(1), FALSE);
}
/*
- * Document-method: Integer#upto
* call-seq:
* int.upto(limit) {|i| block } -> self
* int.upto(limit) -> an_enumerator
@@ -4862,16 +3746,13 @@ rb_int_digits(int argc, VALUE *argv, VALUE num)
*
* If no block is given, an Enumerator is returned instead.
*
- * 5.upto(10) {|i| print i, " " } #=> 5 6 7 8 9 10
+ * For example:
+ *
+ * 5.upto(10) { |i| print i, " " }
+ * #=> 5 6 7 8 9 10
*/
static VALUE
-int_upto_size(VALUE from, VALUE args, VALUE eobj)
-{
- return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(1), FALSE);
-}
-
-static VALUE
int_upto(VALUE from, VALUE to)
{
RETURN_SIZED_ENUMERATOR(from, 1, &to, int_upto_size);
@@ -4895,29 +3776,28 @@ int_upto(VALUE from, VALUE to)
return from;
}
+static VALUE
+int_downto_size(VALUE from, VALUE args, VALUE eobj)
+{
+ return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(-1), FALSE);
+}
+
/*
- * Document-method: Integer#downto
* call-seq:
* int.downto(limit) {|i| block } -> self
* int.downto(limit) -> an_enumerator
*
- * Iterates the given block, passing in decreasing values from +int+ down to
- * and including +limit+.
+ * Iterates the given block, passing decreasing values from +int+ down to and
+ * including +limit+.
*
* If no block is given, an Enumerator is returned instead.
*
* 5.downto(1) { |n| print n, ".. " }
- * puts "Liftoff!"
- * #=> "5.. 4.. 3.. 2.. 1.. Liftoff!"
+ * print " Liftoff!\n"
+ * #=> "5.. 4.. 3.. 2.. 1.. Liftoff!"
*/
static VALUE
-int_downto_size(VALUE from, VALUE args, VALUE eobj)
-{
- return ruby_num_interval_step_size(from, RARRAY_AREF(args, 0), INT2FIX(-1), FALSE);
-}
-
-static VALUE
int_downto(VALUE from, VALUE to)
{
RETURN_SIZED_ENUMERATOR(from, 1, &to, int_downto_size);
@@ -4941,20 +3821,6 @@ int_downto(VALUE from, VALUE to)
return from;
}
-/*
- * Document-method: Integer#times
- * call-seq:
- * int.times {|i| block } -> self
- * int.times -> an_enumerator
- *
- * Iterates the given block +int+ times, passing in values from zero to
- * <code>int - 1</code>.
- *
- * If no block is given, an Enumerator is returned instead.
- *
- * 5.times {|i| print i, " " } #=> 0 1 2 3 4
- */
-
static VALUE
int_dotimes_size(VALUE num, VALUE args, VALUE eobj)
{
@@ -4967,6 +3833,22 @@ int_dotimes_size(VALUE num, VALUE args, VALUE eobj)
return num;
}
+/*
+ * call-seq:
+ * int.times {|i| block } -> self
+ * int.times -> an_enumerator
+ *
+ * Iterates the given block +int+ times, passing in values from zero to
+ * <code>int - 1</code>.
+ *
+ * If no block is given, an Enumerator is returned instead.
+ *
+ * 5.times do |i|
+ * print i, " "
+ * end
+ * #=> 0 1 2 3 4
+ */
+
static VALUE
int_dotimes(VALUE num)
{
@@ -4977,7 +3859,7 @@ int_dotimes(VALUE num)
end = FIX2LONG(num);
for (i=0; i<end; i++) {
- rb_yield_1(LONG2FIX(i));
+ rb_yield(LONG2FIX(i));
}
}
else {
@@ -4993,248 +3875,84 @@ int_dotimes(VALUE num)
}
/*
- * Document-method: Integer#round
* call-seq:
- * int.round([ndigits] [, half: mode]) -> integer or float
+ * int.round([ndigits]) -> integer or float
*
- * Returns +int+ rounded to the nearest value with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * Rounds +int+ to a given precision in decimal digits (default 0 digits).
*
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * Precision may be negative. Returns a floating point number when +ndigits+
+ * is positive, +self+ for zero, and round down for negative.
*
- * Returns +self+ when +ndigits+ is zero or positive.
- *
- * 1.round #=> 1
- * 1.round(2) #=> 1
- * 15.round(-1) #=> 20
- * (-15).round(-1) #=> -20
- *
- * The optional +half+ keyword argument is available
- * similar to Float#round.
- *
- * 25.round(-1, half: :up) #=> 30
- * 25.round(-1, half: :down) #=> 20
- * 25.round(-1, half: :even) #=> 20
- * 35.round(-1, half: :up) #=> 40
- * 35.round(-1, half: :down) #=> 30
- * 35.round(-1, half: :even) #=> 40
- * (-25).round(-1, half: :up) #=> -30
- * (-25).round(-1, half: :down) #=> -20
- * (-25).round(-1, half: :even) #=> -20
+ * 1.round #=> 1
+ * 1.round(2) #=> 1.0
+ * 15.round(-1) #=> 20
*/
static VALUE
int_round(int argc, VALUE* argv, VALUE num)
{
+ VALUE n;
int ndigits;
- int mode;
- VALUE nd, opt;
- if (!rb_scan_args(argc, argv, "01:", &nd, &opt)) return num;
- ndigits = NUM2INT(nd);
- mode = rb_num_get_rounding_option(opt);
- if (ndigits >= 0) {
- return num;
+ if (argc == 0) return num;
+ rb_scan_args(argc, argv, "1", &n);
+ ndigits = NUM2INT(n);
+ if (ndigits > 0) {
+ return rb_Float(num);
}
- return rb_int_round(num, ndigits, mode);
-}
-
-/*
- * Document-method: Integer#floor
- * call-seq:
- * int.floor([ndigits]) -> integer or float
- *
- * Returns the largest number less than or equal to +int+ with
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
- *
- * Returns +self+ when +ndigits+ is zero or positive.
- *
- * 1.floor #=> 1
- * 1.floor(2) #=> 1
- * 18.floor(-1) #=> 10
- * (-18).floor(-1) #=> -20
- */
-
-static VALUE
-int_floor(int argc, VALUE* argv, VALUE num)
-{
- int ndigits;
-
- if (!rb_check_arity(argc, 0, 1)) return num;
- ndigits = NUM2INT(argv[0]);
- if (ndigits >= 0) {
+ if (ndigits == 0) {
return num;
}
- return rb_int_floor(num, ndigits);
+ return int_round_0(num, ndigits);
}
/*
- * Document-method: Integer#ceil
* call-seq:
- * int.ceil([ndigits]) -> integer or float
+ * fix.zero? -> true or false
*
- * Returns the smallest number greater than or equal to +int+ with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * Returns +true+ if +fix+ is zero.
*
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
- *
- * Returns +self+ when +ndigits+ is zero or positive.
- *
- * 1.ceil #=> 1
- * 1.ceil(2) #=> 1
- * 18.ceil(-1) #=> 20
- * (-18).ceil(-1) #=> -10
*/
static VALUE
-int_ceil(int argc, VALUE* argv, VALUE num)
+fix_zero_p(VALUE num)
{
- int ndigits;
-
- if (!rb_check_arity(argc, 0, 1)) return num;
- ndigits = NUM2INT(argv[0]);
- if (ndigits >= 0) {
- return num;
+ if (FIX2LONG(num) == 0) {
+ return Qtrue;
}
- return rb_int_ceil(num, ndigits);
+ return Qfalse;
}
/*
- * Document-method: Integer#truncate
* call-seq:
- * int.truncate([ndigits]) -> integer or float
+ * fix.odd? -> true or false
*
- * Returns +int+ truncated (toward zero) to
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
- *
- * Returns +self+ when +ndigits+ is zero or positive.
- *
- * 1.truncate #=> 1
- * 1.truncate(2) #=> 1
- * 18.truncate(-1) #=> 10
- * (-18).truncate(-1) #=> -10
+ * Returns +true+ if +fix+ is an odd number.
*/
static VALUE
-int_truncate(int argc, VALUE* argv, VALUE num)
+fix_odd_p(VALUE num)
{
- int ndigits;
-
- if (!rb_check_arity(argc, 0, 1)) return num;
- ndigits = NUM2INT(argv[0]);
- if (ndigits >= 0) {
- return num;
+ if (num & 2) {
+ return Qtrue;
}
- return rb_int_truncate(num, ndigits);
-}
-
-#define DEFINE_INT_SQRT(rettype, prefix, argtype) \
-rettype \
-prefix##_isqrt(argtype n) \
-{ \
- if (!argtype##_IN_DOUBLE_P(n)) { \
- unsigned int b = bit_length(n); \
- argtype t; \
- rettype x = (rettype)(n >> (b/2+1)); \
- x |= ((rettype)1LU << (b-1)/2); \
- while ((t = n/x) < (argtype)x) x = (rettype)((x + t) >> 1); \
- return x; \
- } \
- return (rettype)sqrt(argtype##_TO_DOUBLE(n)); \
+ return Qfalse;
}
-#if SIZEOF_LONG*CHAR_BIT > DBL_MANT_DIG
-# define RB_ULONG_IN_DOUBLE_P(n) ((n) < (1UL << DBL_MANT_DIG))
-#else
-# define RB_ULONG_IN_DOUBLE_P(n) 1
-#endif
-#define RB_ULONG_TO_DOUBLE(n) (double)(n)
-#define RB_ULONG unsigned long
-DEFINE_INT_SQRT(unsigned long, rb_ulong, RB_ULONG)
-
-#if 2*SIZEOF_BDIGIT > SIZEOF_LONG
-# if 2*SIZEOF_BDIGIT*CHAR_BIT > DBL_MANT_DIG
-# define BDIGIT_DBL_IN_DOUBLE_P(n) ((n) < ((BDIGIT_DBL)1UL << DBL_MANT_DIG))
-# else
-# define BDIGIT_DBL_IN_DOUBLE_P(n) 1
-# endif
-# ifdef ULL_TO_DOUBLE
-# define BDIGIT_DBL_TO_DOUBLE(n) ULL_TO_DOUBLE(n)
-# else
-# define BDIGIT_DBL_TO_DOUBLE(n) (double)(n)
-# endif
-DEFINE_INT_SQRT(BDIGIT, rb_bdigit_dbl, BDIGIT_DBL)
-#endif
-
-#define domain_error(msg) \
- rb_raise(rb_eMathDomainError, "Numerical argument is out of domain - " #msg)
-
-VALUE rb_big_isqrt(VALUE);
-
/*
- * Document-method: Integer::sqrt
* call-seq:
- * Integer.sqrt(n) -> integer
- *
- * Returns the integer square root of the non-negative integer +n+,
- * i.e. the largest non-negative integer less than or equal to the
- * square root of +n+.
- *
- * Integer.sqrt(0) #=> 0
- * Integer.sqrt(1) #=> 1
- * Integer.sqrt(24) #=> 4
- * Integer.sqrt(25) #=> 5
- * Integer.sqrt(10**400) #=> 10**200
- *
- * Equivalent to <code>Math.sqrt(n).floor</code>, except that
- * the result of the latter code may differ from the true value
- * due to the limited precision of floating point arithmetic.
- *
- * Integer.sqrt(10**46) #=> 100000000000000000000000
- * Math.sqrt(10**46).floor #=> 99999999999999991611392 (!)
+ * fix.even? -> true or false
*
- * If +n+ is not an Integer, it is converted to an Integer first.
- * If +n+ is negative, a Math::DomainError is raised.
+ * Returns +true+ if +fix+ is an even number.
*/
static VALUE
-rb_int_s_isqrt(VALUE self, VALUE num)
+fix_even_p(VALUE num)
{
- unsigned long n, sq;
- num = rb_to_int(num);
- if (FIXNUM_P(num)) {
- if (FIXNUM_NEGATIVE_P(num)) {
- domain_error("isqrt");
- }
- n = FIX2ULONG(num);
- sq = rb_ulong_isqrt(n);
- return LONG2FIX(sq);
- }
- else {
- size_t biglen;
- if (RBIGNUM_NEGATIVE_P(num)) {
- domain_error("isqrt");
- }
- biglen = BIGNUM_LEN(num);
- if (biglen == 0) return INT2FIX(0);
-#if SIZEOF_BDIGIT <= SIZEOF_LONG
- /* short-circuit */
- if (biglen == 1) {
- n = BIGNUM_DIGITS(num)[0];
- sq = rb_ulong_isqrt(n);
- return ULONG2NUM(sq);
- }
-#endif
- return rb_big_isqrt(num);
+ if (num & 2) {
+ return Qfalse;
}
+ return Qtrue;
}
/*
@@ -5242,95 +3960,28 @@ rb_int_s_isqrt(VALUE self, VALUE num)
*
* Raised when attempting to divide an integer by 0.
*
- * 42 / 0 #=> ZeroDivisionError: divided by 0
+ * 42 / 0
+ * #=> ZeroDivisionError: divided by 0
*
* Note that only division by an exact 0 will raise the exception:
*
- * 42 / 0.0 #=> Float::INFINITY
- * 42 / -0.0 #=> -Float::INFINITY
- * 0 / 0.0 #=> NaN
+ * 42 / 0.0 #=> Float::INFINITY
+ * 42 / -0.0 #=> -Float::INFINITY
+ * 0 / 0.0 #=> NaN
*/
/*
* Document-class: FloatDomainError
*
* Raised when attempting to convert special float values (in particular
- * +Infinity+ or +NaN+) to numerical classes which don't support them.
+ * +infinite+ or +NaN+) to numerical classes which don't support them.
*
- * Float::INFINITY.to_r #=> FloatDomainError: Infinity
+ * Float::INFINITY.to_r
+ * #=> FloatDomainError: Infinity
*/
/*
- * Document-class: Numeric
- *
- * Numeric is the class from which all higher-level numeric classes should inherit.
- *
- * Numeric allows instantiation of heap-allocated objects. Other core numeric classes such as
- * Integer are implemented as immediates, which means that each Integer is a single immutable
- * object which is always passed by value.
- *
- * a = 1
- * 1.object_id == a.object_id #=> true
- *
- * There can only ever be one instance of the integer +1+, for example. Ruby ensures this
- * by preventing instantiation. If duplication is attempted, the same instance is returned.
- *
- * Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class
- * 1.dup #=> 1
- * 1.object_id == 1.dup.object_id #=> true
- *
- * For this reason, Numeric should be used when defining other numeric classes.
- *
- * Classes which inherit from Numeric must implement +coerce+, which returns a two-member
- * Array containing an object that has been coerced into an instance of the new class
- * and +self+ (see #coerce).
- *
- * Inheriting classes should also implement arithmetic operator methods (<code>+</code>,
- * <code>-</code>, <code>*</code> and <code>/</code>) and the <code><=></code> operator (see
- * Comparable). These methods may rely on +coerce+ to ensure interoperability with
- * instances of other numeric classes.
- *
- * class Tally < Numeric
- * def initialize(string)
- * @string = string
- * end
- *
- * def to_s
- * @string
- * end
- *
- * def to_i
- * @string.size
- * end
- *
- * def coerce(other)
- * [self.class.new('|' * other.to_i), self]
- * end
- *
- * def <=>(other)
- * to_i <=> other.to_i
- * end
- *
- * def +(other)
- * self.class.new('|' * (to_i + other.to_i))
- * end
- *
- * def -(other)
- * self.class.new('|' * (to_i - other.to_i))
- * end
- *
- * def *(other)
- * self.class.new('|' * (to_i * other.to_i))
- * end
- *
- * def /(other)
- * self.class.new('|' * (to_i / other.to_i))
- * end
- * end
- *
- * tally = Tally.new('||')
- * puts tally * 2 #=> "||||"
- * puts tally > 1 #=> true
+ * The top-level number class.
*/
void
Init_Numeric(void)
@@ -5338,13 +3989,19 @@ Init_Numeric(void)
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
-#ifdef _UNICOSMP
+#if defined(__FreeBSD__) && __FreeBSD__ < 4
+ /* allow divide by zero -- Inf */
+ fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL));
+#elif defined(_UNICOSMP)
/* Turn off floating point exceptions for divide by zero, etc. */
_set_Creg(0, 0);
+#elif defined(__BORLANDC__)
+ /* Turn off floating point exceptions for overflow, etc. */
+ _control87(MCW_EM, MCW_EM);
+ _control87(_control87(0,0),0x1FFF);
#endif
id_coerce = rb_intern("coerce");
id_div = rb_intern("div");
- id_divmod = rb_intern("divmod");
rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError);
rb_eFloatDomainError = rb_define_class("FloatDomainError", rb_eRangeError);
@@ -5352,9 +4009,8 @@ Init_Numeric(void)
rb_define_method(rb_cNumeric, "singleton_method_added", num_sadded, 1);
rb_include_module(rb_cNumeric, rb_mComparable);
+ rb_define_method(rb_cNumeric, "initialize_copy", num_init_copy, 1);
rb_define_method(rb_cNumeric, "coerce", num_coerce, 1);
- rb_define_method(rb_cNumeric, "clone", num_clone, -1);
- rb_define_method(rb_cNumeric, "dup", num_dup, 0);
rb_define_method(rb_cNumeric, "i", num_imaginary, 0);
rb_define_method(rb_cNumeric, "+@", num_uplus, 0);
@@ -5375,30 +4031,20 @@ Init_Numeric(void)
rb_define_method(rb_cNumeric, "integer?", num_int_p, 0);
rb_define_method(rb_cNumeric, "zero?", num_zero_p, 0);
rb_define_method(rb_cNumeric, "nonzero?", num_nonzero_p, 0);
- rb_define_method(rb_cNumeric, "finite?", num_finite_p, 0);
- rb_define_method(rb_cNumeric, "infinite?", num_infinite_p, 0);
- rb_define_method(rb_cNumeric, "floor", num_floor, -1);
- rb_define_method(rb_cNumeric, "ceil", num_ceil, -1);
+ rb_define_method(rb_cNumeric, "floor", num_floor, 0);
+ rb_define_method(rb_cNumeric, "ceil", num_ceil, 0);
rb_define_method(rb_cNumeric, "round", num_round, -1);
- rb_define_method(rb_cNumeric, "truncate", num_truncate, -1);
+ rb_define_method(rb_cNumeric, "truncate", num_truncate, 0);
rb_define_method(rb_cNumeric, "step", num_step, -1);
- rb_define_method(rb_cNumeric, "positive?", num_positive_p, 0);
- rb_define_method(rb_cNumeric, "negative?", num_negative_p, 0);
rb_cInteger = rb_define_class("Integer", rb_cNumeric);
rb_undef_alloc_func(rb_cInteger);
rb_undef_method(CLASS_OF(rb_cInteger), "new");
- rb_define_singleton_method(rb_cInteger, "sqrt", rb_int_s_isqrt, 1);
- rb_define_method(rb_cInteger, "to_s", int_to_s, -1);
- rb_define_alias(rb_cInteger, "inspect", "to_s");
rb_define_method(rb_cInteger, "integer?", int_int_p, 0);
- rb_define_method(rb_cInteger, "odd?", rb_int_odd_p, 0);
+ rb_define_method(rb_cInteger, "odd?", int_odd_p, 0);
rb_define_method(rb_cInteger, "even?", int_even_p, 0);
- rb_define_method(rb_cInteger, "allbits?", int_allbits_p, 1);
- rb_define_method(rb_cInteger, "anybits?", int_anybits_p, 1);
- rb_define_method(rb_cInteger, "nobits?", int_nobits_p, 1);
rb_define_method(rb_cInteger, "upto", int_upto, 1);
rb_define_method(rb_cInteger, "downto", int_downto, 1);
rb_define_method(rb_cInteger, "times", int_dotimes, 0);
@@ -5409,56 +4055,55 @@ Init_Numeric(void)
rb_define_method(rb_cInteger, "ord", int_ord, 0);
rb_define_method(rb_cInteger, "to_i", int_to_i, 0);
rb_define_method(rb_cInteger, "to_int", int_to_i, 0);
- rb_define_method(rb_cInteger, "to_f", int_to_f, 0);
- rb_define_method(rb_cInteger, "floor", int_floor, -1);
- rb_define_method(rb_cInteger, "ceil", int_ceil, -1);
- rb_define_method(rb_cInteger, "truncate", int_truncate, -1);
+ rb_define_method(rb_cInteger, "floor", int_to_i, 0);
+ rb_define_method(rb_cInteger, "ceil", int_to_i, 0);
+ rb_define_method(rb_cInteger, "truncate", int_to_i, 0);
rb_define_method(rb_cInteger, "round", int_round, -1);
- rb_define_method(rb_cInteger, "<=>", rb_int_cmp, 1);
-
- rb_define_method(rb_cInteger, "-@", rb_int_uminus, 0);
- rb_define_method(rb_cInteger, "+", rb_int_plus, 1);
- rb_define_method(rb_cInteger, "-", rb_int_minus, 1);
- rb_define_method(rb_cInteger, "*", rb_int_mul, 1);
- rb_define_method(rb_cInteger, "/", rb_int_div, 1);
- rb_define_method(rb_cInteger, "div", rb_int_idiv, 1);
- rb_define_method(rb_cInteger, "%", rb_int_modulo, 1);
- rb_define_method(rb_cInteger, "modulo", rb_int_modulo, 1);
- rb_define_method(rb_cInteger, "remainder", int_remainder, 1);
- rb_define_method(rb_cInteger, "divmod", rb_int_divmod, 1);
- rb_define_method(rb_cInteger, "fdiv", rb_int_fdiv, 1);
- rb_define_method(rb_cInteger, "**", rb_int_pow, 1);
-
- rb_define_method(rb_cInteger, "pow", rb_int_powm, -1); /* in bignum.c */
-
- rb_define_method(rb_cInteger, "abs", rb_int_abs, 0);
- rb_define_method(rb_cInteger, "magnitude", rb_int_abs, 0);
-
- rb_define_method(rb_cInteger, "===", rb_int_equal, 1);
- rb_define_method(rb_cInteger, "==", rb_int_equal, 1);
- rb_define_method(rb_cInteger, ">", rb_int_gt, 1);
- rb_define_method(rb_cInteger, ">=", rb_int_ge, 1);
- rb_define_method(rb_cInteger, "<", int_lt, 1);
- rb_define_method(rb_cInteger, "<=", int_le, 1);
-
- rb_define_method(rb_cInteger, "~", int_comp, 0);
- rb_define_method(rb_cInteger, "&", rb_int_and, 1);
- rb_define_method(rb_cInteger, "|", int_or, 1);
- rb_define_method(rb_cInteger, "^", int_xor, 1);
- rb_define_method(rb_cInteger, "[]", int_aref, 1);
-
- rb_define_method(rb_cInteger, "<<", rb_int_lshift, 1);
- rb_define_method(rb_cInteger, ">>", rb_int_rshift, 1);
-
- rb_define_method(rb_cInteger, "size", int_size, 0);
- rb_define_method(rb_cInteger, "bit_length", rb_int_bit_length, 0);
- rb_define_method(rb_cInteger, "digits", rb_int_digits, -1);
-
-#ifndef RUBY_INTEGER_UNIFICATION
- rb_cFixnum = rb_cInteger;
-#endif
- rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
- rb_deprecate_constant(rb_cObject, "Fixnum");
+
+ rb_cFixnum = rb_define_class("Fixnum", rb_cInteger);
+
+ rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1);
+ rb_define_alias(rb_cFixnum, "inspect", "to_s");
+
+ rb_define_method(rb_cFixnum, "-@", fix_uminus, 0);
+ rb_define_method(rb_cFixnum, "+", fix_plus, 1);
+ rb_define_method(rb_cFixnum, "-", fix_minus, 1);
+ rb_define_method(rb_cFixnum, "*", fix_mul, 1);
+ rb_define_method(rb_cFixnum, "/", fix_div, 1);
+ rb_define_method(rb_cFixnum, "div", fix_idiv, 1);
+ rb_define_method(rb_cFixnum, "%", fix_mod, 1);
+ rb_define_method(rb_cFixnum, "modulo", fix_mod, 1);
+ rb_define_method(rb_cFixnum, "divmod", fix_divmod, 1);
+ rb_define_method(rb_cFixnum, "fdiv", fix_fdiv, 1);
+ rb_define_method(rb_cFixnum, "**", fix_pow, 1);
+
+ rb_define_method(rb_cFixnum, "abs", fix_abs, 0);
+ rb_define_method(rb_cFixnum, "magnitude", fix_abs, 0);
+
+ rb_define_method(rb_cFixnum, "==", fix_equal, 1);
+ rb_define_method(rb_cFixnum, "===", fix_equal, 1);
+ rb_define_method(rb_cFixnum, "<=>", fix_cmp, 1);
+ rb_define_method(rb_cFixnum, ">", fix_gt, 1);
+ rb_define_method(rb_cFixnum, ">=", fix_ge, 1);
+ rb_define_method(rb_cFixnum, "<", fix_lt, 1);
+ rb_define_method(rb_cFixnum, "<=", fix_le, 1);
+
+ rb_define_method(rb_cFixnum, "~", fix_rev, 0);
+ rb_define_method(rb_cFixnum, "&", fix_and, 1);
+ rb_define_method(rb_cFixnum, "|", fix_or, 1);
+ rb_define_method(rb_cFixnum, "^", fix_xor, 1);
+ rb_define_method(rb_cFixnum, "[]", fix_aref, 1);
+
+ rb_define_method(rb_cFixnum, "<<", rb_fix_lshift, 1);
+ rb_define_method(rb_cFixnum, ">>", rb_fix_rshift, 1);
+
+ rb_define_method(rb_cFixnum, "to_f", fix_to_f, 0);
+ rb_define_method(rb_cFixnum, "size", fix_size, 0);
+ rb_define_method(rb_cFixnum, "bit_length", rb_fix_bit_length, 0);
+ rb_define_method(rb_cFixnum, "zero?", fix_zero_p, 0);
+ rb_define_method(rb_cFixnum, "odd?", fix_odd_p, 0);
+ rb_define_method(rb_cFixnum, "even?", fix_even_p, 0);
+ rb_define_method(rb_cFixnum, "succ", fix_succ, 0);
rb_cFloat = rb_define_class("Float", rb_cNumeric);
@@ -5500,7 +4145,7 @@ Init_Numeric(void)
*/
rb_define_const(rb_cFloat, "DIG", INT2FIX(DBL_DIG));
/*
- * The smallest possible exponent value in a double-precision floating
+ * The smallest posable exponent value in a double-precision floating
* point.
*
* Usually defaults to -1021.
@@ -5528,14 +4173,9 @@ Init_Numeric(void)
*/
rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP));
/*
- * The smallest positive normalized number in a double-precision floating point.
+ * The smallest positive integer in a double-precision floating point.
*
* Usually defaults to 2.2250738585072014e-308.
- *
- * If the platform supports denormalized numbers,
- * there are numbers between zero and Float::MIN.
- * 0.0.next_float returns the smallest positive floating point number
- * including denormalized numbers.
*/
rb_define_const(rb_cFloat, "MIN", DBL2NUM(DBL_MIN));
/*
@@ -5546,7 +4186,7 @@ Init_Numeric(void)
rb_define_const(rb_cFloat, "MAX", DBL2NUM(DBL_MAX));
/*
* The difference between 1 and the smallest double-precision floating
- * point number greater than 1.
+ * point number.
*
* Usually defaults to 2.2204460492503131e-16.
*/
@@ -5563,7 +4203,7 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "to_s", flo_to_s, 0);
rb_define_alias(rb_cFloat, "inspect", "to_s");
rb_define_method(rb_cFloat, "coerce", flo_coerce, 1);
- rb_define_method(rb_cFloat, "-@", rb_float_uminus, 0);
+ rb_define_method(rb_cFloat, "-@", flo_uminus, 0);
rb_define_method(rb_cFloat, "+", flo_plus, 1);
rb_define_method(rb_cFloat, "-", flo_minus, 1);
rb_define_method(rb_cFloat, "*", flo_mul, 1);
@@ -5573,35 +4213,33 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "%", flo_mod, 1);
rb_define_method(rb_cFloat, "modulo", flo_mod, 1);
rb_define_method(rb_cFloat, "divmod", flo_divmod, 1);
- rb_define_method(rb_cFloat, "**", rb_float_pow, 1);
+ rb_define_method(rb_cFloat, "**", flo_pow, 1);
rb_define_method(rb_cFloat, "==", flo_eq, 1);
rb_define_method(rb_cFloat, "===", flo_eq, 1);
rb_define_method(rb_cFloat, "<=>", flo_cmp, 1);
- rb_define_method(rb_cFloat, ">", rb_float_gt, 1);
+ rb_define_method(rb_cFloat, ">", flo_gt, 1);
rb_define_method(rb_cFloat, ">=", flo_ge, 1);
rb_define_method(rb_cFloat, "<", flo_lt, 1);
rb_define_method(rb_cFloat, "<=", flo_le, 1);
rb_define_method(rb_cFloat, "eql?", flo_eql, 1);
rb_define_method(rb_cFloat, "hash", flo_hash, 0);
rb_define_method(rb_cFloat, "to_f", flo_to_f, 0);
- rb_define_method(rb_cFloat, "abs", rb_float_abs, 0);
- rb_define_method(rb_cFloat, "magnitude", rb_float_abs, 0);
+ rb_define_method(rb_cFloat, "abs", flo_abs, 0);
+ rb_define_method(rb_cFloat, "magnitude", flo_abs, 0);
rb_define_method(rb_cFloat, "zero?", flo_zero_p, 0);
- rb_define_method(rb_cFloat, "to_i", flo_to_i, 0);
- rb_define_method(rb_cFloat, "to_int", flo_to_i, 0);
- rb_define_method(rb_cFloat, "floor", flo_floor, -1);
- rb_define_method(rb_cFloat, "ceil", flo_ceil, -1);
+ rb_define_method(rb_cFloat, "to_i", flo_truncate, 0);
+ rb_define_method(rb_cFloat, "to_int", flo_truncate, 0);
+ rb_define_method(rb_cFloat, "floor", flo_floor, 0);
+ rb_define_method(rb_cFloat, "ceil", flo_ceil, 0);
rb_define_method(rb_cFloat, "round", flo_round, -1);
- rb_define_method(rb_cFloat, "truncate", flo_truncate, -1);
+ rb_define_method(rb_cFloat, "truncate", flo_truncate, 0);
rb_define_method(rb_cFloat, "nan?", flo_is_nan_p, 0);
- rb_define_method(rb_cFloat, "infinite?", rb_flo_is_infinite_p, 0);
- rb_define_method(rb_cFloat, "finite?", rb_flo_is_finite_p, 0);
+ rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0);
+ rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0);
rb_define_method(rb_cFloat, "next_float", flo_next_float, 0);
rb_define_method(rb_cFloat, "prev_float", flo_prev_float, 0);
- rb_define_method(rb_cFloat, "positive?", flo_positive_p, 0);
- rb_define_method(rb_cFloat, "negative?", flo_negative_p, 0);
id_to = rb_intern("to");
id_by = rb_intern("by");
diff --git a/object.c b/object.c
index 463be7bfb1..5b0f7dfdd7 100644
--- a/object.c
+++ b/object.c
@@ -11,35 +11,30 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/util.h"
+#include "ruby/encoding.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include "constant.h"
+#include "internal.h"
#include "id.h"
#include "probes.h"
-/*!
- * \defgroup object Core objects and their operations
- * \{
- */
-
-VALUE rb_cBasicObject; /*!< BasicObject class */
-VALUE rb_mKernel; /*!< Kernel module */
-VALUE rb_cObject; /*!< Object class */
-VALUE rb_cModule; /*!< Module class */
-VALUE rb_cClass; /*!< Class class */
-VALUE rb_cData; /*!< Data class */
-
-VALUE rb_cNilClass; /*!< NilClass class */
-VALUE rb_cTrueClass; /*!< TrueClass class */
-VALUE rb_cFalseClass; /*!< FalseClass class */
+VALUE rb_cBasicObject;
+VALUE rb_mKernel;
+VALUE rb_cObject;
+VALUE rb_cModule;
+VALUE rb_cClass;
+VALUE rb_cData;
-/*! \cond INTERNAL_MACRO */
+VALUE rb_cNilClass;
+VALUE rb_cTrueClass;
+VALUE rb_cFalseClass;
#define id_eq idEq
#define id_eql idEqlP
@@ -54,20 +49,6 @@ VALUE rb_cFalseClass; /*!< FalseClass class */
(!SPECIAL_CONST_P(obj) && \
(BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE))
-/*! \endcond */
-
-/*!
- * Make the object invisible from Ruby code.
- *
- * It is useful to let Ruby's GC manage your internal data structure --
- * The object keeps being managed by GC, but \c ObjectSpace.each_object
- * never yields the object.
- *
- * Note that the object also lose a way to call a method on it.
- *
- * \param[in] obj a Ruby object
- * \sa rb_obj_reveal
- */
VALUE
rb_obj_hide(VALUE obj)
{
@@ -77,14 +58,6 @@ rb_obj_hide(VALUE obj)
return obj;
}
-/*!
- * Make a hidden object visible again.
- *
- * It is the caller's responsibility to pass the right \a klass
- * which \a obj originally used to belong to.
- *
- * \sa rb_obj_hide
- */
VALUE
rb_obj_reveal(VALUE obj, VALUE klass)
{
@@ -94,32 +67,22 @@ rb_obj_reveal(VALUE obj, VALUE klass)
return obj;
}
-/*!
- * Fills common (\c RBasic) fields in \a obj.
- *
- * \note Prefer rb_newobj_of() to this function.
- * \param[in,out] obj a Ruby object to be set up.
- * \param[in] klass \c obj will belong to this class.
- * \param[in] type one of \c ruby_value_type
- */
VALUE
rb_obj_setup(VALUE obj, VALUE klass, VALUE type)
{
RBASIC(obj)->flags = type;
RBASIC_SET_CLASS(obj, klass);
+ if (rb_safe_level() >= 3) FL_SET((obj), FL_TAINT);
return obj;
}
-/**
+/*
* call-seq:
* obj === other -> true or false
*
* Case Equality -- For class Object, effectively the same as calling
* <code>#==</code>, but typically overridden by descendants to provide
* meaningful semantics in +case+ statements.
- *--
- * Same as \c Object#===, case equality.
- *++
*/
VALUE
@@ -128,38 +91,18 @@ rb_equal(VALUE obj1, VALUE obj2)
VALUE result;
if (obj1 == obj2) return Qtrue;
- result = rb_equal_opt(obj1, obj2);
- if (result == Qundef) {
- result = rb_funcall(obj1, id_eq, 1, obj2);
- }
+ result = rb_funcall(obj1, id_eq, 1, obj2);
if (RTEST(result)) return Qtrue;
return Qfalse;
}
-/**
- * Determines if \a obj1 and \a obj2 are equal in terms of
- * \c Object#eql?.
- *
- * \note It actually calls \c #eql? when necessary.
- * So you cannot implement \c #eql? with this function.
- * \retval non-zero if they are eql?
- * \retval zero if they are not eql?.
- */
int
rb_eql(VALUE obj1, VALUE obj2)
{
- VALUE result;
-
- if (obj1 == obj2) return Qtrue;
- result = rb_eql_opt(obj1, obj2);
- if (result == Qundef) {
- result = rb_funcall(obj1, id_eql, 1, obj2);
- }
- if (RTEST(result)) return Qtrue;
- return Qfalse;
+ return RTEST(rb_funcall(obj1, id_eql, 1, obj2));
}
-/**
+/*
* call-seq:
* obj == other -> true or false
* obj.equal?(other) -> true or false
@@ -193,10 +136,8 @@ rb_eql(VALUE obj1, VALUE obj2)
*
* 1 == 1.0 #=> true
* 1.eql? 1.0 #=> false
- *--
- * \private
- *++
*/
+
VALUE
rb_obj_equal(VALUE obj1, VALUE obj2)
{
@@ -204,16 +145,42 @@ rb_obj_equal(VALUE obj1, VALUE obj2)
return Qfalse;
}
-VALUE rb_obj_hash(VALUE obj);
+/*
+ * call-seq:
+ * obj.hash -> fixnum
+ *
+ * Generates a Fixnum hash value for this object. This function must have the
+ * property that <code>a.eql?(b)</code> implies <code>a.hash == b.hash</code>.
+ *
+ * The hash value is used along with #eql? by the Hash class to determine if
+ * two objects reference the same hash key. Any hash value that exceeds the
+ * capacity of a Fixnum will be truncated before being used.
+ *
+ * The hash value for an object may not be identical across invocations or
+ * implementations of ruby. If you need a stable identifier across ruby
+ * invocations and implementations you will need to generate one with a custom
+ * method.
+ */
+VALUE
+rb_obj_hash(VALUE obj)
+{
+ long rb_objid_hash(st_index_t index);
+ VALUE oid = rb_obj_id(obj);
+#if SIZEOF_LONG == SIZEOF_VOIDP
+ st_index_t index = NUM2LONG(oid);
+#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
+ st_index_t index = NUM2LL(oid);
+#else
+# error not supported
+#endif
+ return LONG2FIX(rb_objid_hash(index));
+}
-/**
+/*
* call-seq:
* !obj -> true or false
*
* Boolean negate.
- *--
- * \private
- *++
*/
VALUE
@@ -222,14 +189,11 @@ rb_obj_not(VALUE obj)
return RTEST(obj) ? Qfalse : Qtrue;
}
-/**
+/*
* call-seq:
* obj != other -> true or false
*
* Returns true if two objects are not-equal, otherwise false.
- *--
- * \private
- *++
*/
VALUE
@@ -239,25 +203,18 @@ rb_obj_not_equal(VALUE obj1, VALUE obj2)
return RTEST(result) ? Qfalse : Qtrue;
}
-/*!
- * Looks up the nearest ancestor of \a cl, skipping singleton classes or
- * module inclusions.
- * It returns the \a cl itself if it is neither a singleton class or a module.
- *
- * \param[in] cl a Class object.
- * \return the ancestor class found, or a falsey value if nothing found.
- */
VALUE
rb_class_real(VALUE cl)
{
- while (cl &&
- ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS)) {
+ if (cl == 0)
+ return 0;
+ while ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS) {
cl = RCLASS_SUPER(cl);
}
return cl;
}
-/**
+/*
* call-seq:
* obj.class -> class
*
@@ -265,14 +222,10 @@ rb_class_real(VALUE cl)
* called with an explicit receiver, as <code>class</code> is also a
* reserved word in Ruby.
*
- * 1.class #=> Integer
+ * 1.class #=> Fixnum
* self.class #=> Object
- *--
- * Equivalent to \c Object\#class in Ruby.
- *
- * Returns the class of \c obj, skipping singleton classes or module inclusions.
- *++
*/
+
VALUE
rb_obj_class(VALUE obj)
{
@@ -284,12 +237,12 @@ rb_obj_class(VALUE obj)
* obj.singleton_class -> class
*
* Returns the singleton class of <i>obj</i>. This method creates
- * a new singleton class if <i>obj</i> does not have one.
+ * a new singleton class if <i>obj</i> does not have it.
*
* If <i>obj</i> is <code>nil</code>, <code>true</code>, or
* <code>false</code>, it returns NilClass, TrueClass, or FalseClass,
* respectively.
- * If <i>obj</i> is an Integer, a Float or a Symbol, it raises a TypeError.
+ * If <i>obj</i> is a Fixnum or a Symbol, it raises a TypeError.
*
* Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
* String.singleton_class #=> #<Class:String>
@@ -302,7 +255,6 @@ rb_obj_singleton_class(VALUE obj)
return rb_singleton_class(obj);
}
-/*! \private */
void
rb_obj_copy_ivar(VALUE dest, VALUE obj)
{
@@ -317,7 +269,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
RBASIC(dest)->flags |= ROBJECT_EMBED;
}
else {
- uint32_t len = ROBJECT(obj)->as.heap.numiv;
+ long len = ROBJECT(obj)->as.heap.numiv;
VALUE *ptr = 0;
if (len > 0) {
ptr = ALLOC_N(VALUE, len);
@@ -330,6 +282,8 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
}
}
+void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj);
+
static void
init_copy(VALUE dest, VALUE obj)
{
@@ -346,36 +300,14 @@ init_copy(VALUE dest, VALUE obj)
}
}
-static int freeze_opt(int argc, VALUE *argv);
-static VALUE immutable_obj_clone(VALUE obj, int kwfreeze);
-static VALUE mutable_obj_clone(VALUE obj, int kwfreeze);
-PUREFUNC(static inline int special_object_p(VALUE obj)); /*!< \private */
-static inline int
-special_object_p(VALUE obj)
-{
- if (SPECIAL_CONST_P(obj)) return TRUE;
- switch (BUILTIN_TYPE(obj)) {
- case T_BIGNUM:
- case T_FLOAT:
- case T_SYMBOL:
- case T_RATIONAL:
- case T_COMPLEX:
- /* not a comprehensive list */
- return TRUE;
- default:
- return FALSE;
- }
-}
-
/*
* call-seq:
- * obj.clone(freeze: true) -> an_object
+ * obj.clone -> an_object
*
* Produces a shallow copy of <i>obj</i>---the instance variables of
- * <i>obj</i> are copied, but not the objects they reference.
- * <code>clone</code> copies the frozen (unless :freeze keyword argument
- * is given with a false value) and tainted state of <i>obj</i>.
- * See also the discussion under <code>Object#dup</code>.
+ * <i>obj</i> are copied, but not the objects they reference. Copies
+ * the frozen and tainted state of <i>obj</i>. See also the discussion
+ * under <code>Object#dup</code>.
*
* class Klass
* attr_accessor :str
@@ -392,61 +324,17 @@ special_object_p(VALUE obj)
* the class.
*/
-static VALUE
-rb_obj_clone2(int argc, VALUE *argv, VALUE obj)
-{
- int kwfreeze = freeze_opt(argc, argv);
- if (!special_object_p(obj))
- return mutable_obj_clone(obj, kwfreeze);
- return immutable_obj_clone(obj, kwfreeze);
-}
-
-/*! \private */
VALUE
-rb_immutable_obj_clone(int argc, VALUE *argv, VALUE obj)
-{
- int kwfreeze = freeze_opt(argc, argv);
- return immutable_obj_clone(obj, kwfreeze);
-}
-
-static int
-freeze_opt(int argc, VALUE *argv)
+rb_obj_clone(VALUE obj)
{
- static ID keyword_ids[1];
- VALUE opt;
- VALUE kwfreeze;
+ VALUE clone;
+ VALUE singleton;
- if (!keyword_ids[0]) {
- CONST_ID(keyword_ids[0], "freeze");
+ if (rb_special_const_p(obj)) {
+ rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj));
}
- rb_scan_args(argc, argv, "0:", &opt);
- if (!NIL_P(opt)) {
- rb_get_kwargs(opt, keyword_ids, 0, 1, &kwfreeze);
- if (kwfreeze == Qfalse) return FALSE;
- if (kwfreeze != Qundef && kwfreeze != Qtrue) {
- rb_raise(rb_eArgError, "unexpected value for freeze: %"PRIsVALUE,
- rb_obj_class(kwfreeze));
- }
- }
- return TRUE;
-}
-
-static VALUE
-immutable_obj_clone(VALUE obj, int kwfreeze)
-{
- if (!kwfreeze)
- rb_raise(rb_eArgError, "can't unfreeze %"PRIsVALUE,
- rb_obj_class(obj));
- return obj;
-}
-
-static VALUE
-mutable_obj_clone(VALUE obj, int kwfreeze)
-{
- VALUE clone, singleton;
-
clone = rb_obj_alloc(rb_obj_class(obj));
- RBASIC(clone)->flags &= (FL_TAINT|FL_PROMOTED0|FL_PROMOTED1);
+ RBASIC(clone)->flags &= (FL_TAINT);
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FREEZE|FL_FINALIZE);
singleton = rb_singleton_class_clone_and_attach(obj, clone);
@@ -457,34 +345,18 @@ mutable_obj_clone(VALUE obj, int kwfreeze)
init_copy(clone, obj);
rb_funcall(clone, id_init_clone, 1, obj);
-
- if (kwfreeze) {
- RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
- }
+ RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
return clone;
}
-/**
- * :nodoc
- *--
- * Almost same as \c Object#clone
- *++
- */
-VALUE
-rb_obj_clone(VALUE obj)
-{
- if (special_object_p(obj)) return obj;
- return mutable_obj_clone(obj, Qtrue);
-}
-
-/**
+/*
* call-seq:
* obj.dup -> an_object
*
* Produces a shallow copy of <i>obj</i>---the instance variables of
- * <i>obj</i> are copied, but not the objects they reference.
- * <code>dup</code> copies the tainted state of <i>obj</i>.
+ * <i>obj</i> are copied, but not the objects they reference. <code>dup</code>
+ * copies the tainted state of <i>obj</i>.
*
* This method may have class-specific behavior. If so, that
* behavior will be documented under the #+initialize_copy+ method of
@@ -498,7 +370,7 @@ rb_obj_clone(VALUE obj)
* typically uses the class of the descendant object to create the new
* instance.
*
- * When using #dup, any modules that the object has been extended with will not
+ * When using #dup any modules that the object has been extended with will not
* be copied.
*
* class Klass
@@ -518,17 +390,16 @@ rb_obj_clone(VALUE obj)
*
* s3 = s1.dup #=> #<Klass:0x401b3a38>
* s3.foo #=> NoMethodError: undefined method `foo' for #<Klass:0x401b3a38>
- *--
- * Equivalent to \c Object\#dup in Ruby
- *++
+ *
*/
+
VALUE
rb_obj_dup(VALUE obj)
{
VALUE dup;
- if (special_object_p(obj)) {
- return obj;
+ if (rb_special_const_p(obj)) {
+ rb_raise(rb_eTypeError, "can't dup %s", rb_obj_classname(obj));
}
dup = rb_obj_alloc(rb_obj_class(obj));
init_copy(dup, obj);
@@ -539,12 +410,12 @@ rb_obj_dup(VALUE obj)
/*
* call-seq:
- * obj.itself -> obj
+ * obj.itself -> an_object
*
- * Returns the receiver.
+ * Returns <i>obj</i>.
*
- * string = "my string"
- * string.itself.object_id == string.object_id #=> true
+ * string = 'my string' #=> "my string"
+ * string.itself.object_id == string.object_id #=> true
*
*/
@@ -554,38 +425,7 @@ rb_obj_itself(VALUE obj)
return obj;
}
-static VALUE
-rb_obj_size(VALUE self, VALUE args, VALUE obj)
-{
- return LONG2FIX(1);
-}
-
-/*
- * call-seq:
- * obj.yield_self {|x| block } -> an_object
- *
- * Yields self to the block and returns the result of the block.
- *
- * "my string".yield_self {|s| s.upcase } #=> "MY STRING"
- * 3.next.yield_self {|x| x**x }.to_s #=> "256"
- *
- */
-
-static VALUE
-rb_obj_yield_self(VALUE obj)
-{
- RETURN_SIZED_ENUMERATOR(obj, 0, 0, rb_obj_size);
- return rb_yield_values2(1, &obj);
-}
-
-/**
- * :nodoc:
- *--
- * Default implementation of \c #initialize_copy
- * \param[in,out] obj the receiver being initialized
- * \param[in] orig the object to be copied from.
- *++
- */
+/* :nodoc: */
VALUE
rb_obj_init_copy(VALUE obj, VALUE orig)
{
@@ -598,15 +438,7 @@ rb_obj_init_copy(VALUE obj, VALUE orig)
return obj;
}
-/*!
- * :nodoc:
- *--
- * Default implementation of \c #initialize_dup and \c #initialize_clone
- *
- * \param[in,out] obj the receiver being initialized
- * \param[in] orig the object to be dup or cloned from.
- *++
- **/
+/* :nodoc: */
VALUE
rb_obj_init_dup_clone(VALUE obj, VALUE orig)
{
@@ -614,19 +446,16 @@ rb_obj_init_dup_clone(VALUE obj, VALUE orig)
return obj;
}
-/**
+/*
* call-seq:
* obj.to_s -> string
*
* Returns a string representing <i>obj</i>. The default
* <code>to_s</code> prints the object's class and an encoding of the
* object id. As a special case, the top-level object that is the
- * initial execution context of Ruby programs returns ``main''.
- *
- *--
- * Default implementation of \c #to_s.
- *++
+ * initial execution context of Ruby programs returns ``main.''
*/
+
VALUE
rb_any_to_s(VALUE obj)
{
@@ -639,33 +468,24 @@ rb_any_to_s(VALUE obj)
return str;
}
-VALUE rb_str_escape(VALUE str);
-/*!
- * Convenient wrapper of \c Object#inspect.
- * Returns a human-readable string representation of \a obj,
- * similarly to \c Object#inspect.
- *
- * Unlike Ruby-level \c #inspect, it escapes characters to keep the
- * result compatible to the default internal or external encoding.
- * If the default internal or external encoding is ASCII compatible,
- * the encoding of the inspected result must be compatible with it.
- * If the default internal or external encoding is ASCII incompatible,
+/*
+ * If the default external encoding is ASCII compatible, the encoding of
+ * inspected result must be compatible with it.
+ * If the default external encoding is ASCII incompatible,
* the result must be ASCII only.
*/
VALUE
rb_inspect(VALUE obj)
{
- VALUE str = rb_obj_as_string(rb_funcallv(obj, id_inspect, 0, 0));
-
- rb_encoding *enc = rb_default_internal_encoding();
- if (enc == NULL) enc = rb_default_external_encoding();
- if (!rb_enc_asciicompat(enc)) {
+ VALUE str = rb_obj_as_string(rb_funcall(obj, id_inspect, 0, 0));
+ rb_encoding *ext = rb_default_external_encoding();
+ if (!rb_enc_asciicompat(ext)) {
if (!rb_enc_str_asciionly_p(str))
- return rb_str_escape(str);
+ rb_raise(rb_eEncCompatError, "inspected result must be ASCII only if default external encoding is ASCII incompatible");
return str;
}
- if (rb_enc_get(str) != enc && !rb_enc_str_asciionly_p(str))
- return rb_str_escape(str);
+ if (rb_enc_get(str) != ext && !rb_enc_str_asciionly_p(str))
+ rb_raise(rb_eEncCompatError, "inspected result must be ASCII only or use the default external encoding");
return str;
}
@@ -675,6 +495,8 @@ inspect_i(st_data_t k, st_data_t v, st_data_t a)
ID id = (ID)k;
VALUE value = (VALUE)v;
VALUE str = (VALUE)a;
+ VALUE str2;
+ const char *ivname;
/* need not to show internal data */
if (CLASS_OF(value) == 0) return ST_CONTINUE;
@@ -686,8 +508,12 @@ inspect_i(st_data_t k, st_data_t v, st_data_t a)
else {
rb_str_cat2(str, ", ");
}
- rb_str_catf(str, "%"PRIsVALUE"=%+"PRIsVALUE,
- rb_id2str(id), value);
+ ivname = rb_id2name(id);
+ rb_str_cat2(str, ivname);
+ rb_str_cat2(str, "=");
+ str2 = rb_inspect(value);
+ rb_str_append(str, str2);
+ OBJ_INFECT(str, str2);
return ST_CONTINUE;
}
@@ -713,10 +539,9 @@ inspect_obj(VALUE obj, VALUE str, int recur)
* obj.inspect -> string
*
* Returns a string containing a human-readable representation of <i>obj</i>.
- * The default <code>inspect</code> shows the object's class name,
- * an encoding of the object id, and a list of the instance variables and
+ * By default, show the class name and the list of the instance variables and
* their values (by calling #inspect on each of them).
- * User defined classes should override this method to provide a better
+ * User defined classes should override this method to make better
* representation of <i>obj</i>. When overriding this method, it should
* return a string whose encoding is compatible with the default external
* encoding.
@@ -734,6 +559,13 @@ inspect_obj(VALUE obj, VALUE str, int recur)
* end
* end
* Bar.new.inspect #=> "#<Bar:0x0300c868 @bar=1>"
+ *
+ * class Baz
+ * def to_s
+ * "baz"
+ * end
+ * end
+ * Baz.new.inspect #=> "#<Baz:0x0300c868>"
*/
static VALUE
@@ -770,7 +602,7 @@ class_or_module_required(VALUE c)
static VALUE class_search_ancestor(VALUE cl, VALUE c);
-/**
+/*
* call-seq:
* obj.instance_of?(class) -> true or false
*
@@ -785,13 +617,6 @@ static VALUE class_search_ancestor(VALUE cl, VALUE c);
* b.instance_of? A #=> false
* b.instance_of? B #=> true
* b.instance_of? C #=> false
- *--
- * Determines if \a obj is an instance of \a c.
- *
- * Equivalent to \c Object\#is_instance_of in Ruby.
- * \param[in] obj the object to be determined.
- * \param[in] c a Class object
- *++
*/
VALUE
@@ -803,7 +628,7 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
}
-/**
+/*
* call-seq:
* obj.is_a?(class) -> true or false
* obj.kind_of?(class) -> true or false
@@ -829,13 +654,6 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
* b.kind_of? B #=> true
* b.kind_of? C #=> false
* b.kind_of? M #=> true
- *--
- * Determines if \a obj is a kind of \a c.
- *
- * Equivalent to \c Object\#kind_of? in Ruby.
- * \param[in] obj the object to be determined
- * \param[in] c a Module object.
- *++
*/
VALUE
@@ -851,14 +669,13 @@ static VALUE
class_search_ancestor(VALUE cl, VALUE c)
{
while (cl) {
- if (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))
+ if (cl == c || RCLASS_M_TBL_WRAPPER(cl) == RCLASS_M_TBL_WRAPPER(c))
return cl;
cl = RCLASS_SUPER(cl);
}
return 0;
}
-/*! \private */
VALUE
rb_class_search_ancestor(VALUE cl, VALUE c)
{
@@ -867,22 +684,19 @@ rb_class_search_ancestor(VALUE cl, VALUE c)
return class_search_ancestor(cl, RCLASS_ORIGIN(c));
}
-/**
+/*
* call-seq:
- * obj.tap {|x| block } -> obj
+ * obj.tap{|x|...} -> obj
*
- * Yields self to the block, and then returns self.
+ * Yields <code>x</code> to the block, and then returns <code>x</code>.
* The primary purpose of this method is to "tap into" a method chain,
* in order to perform operations on intermediate results within the chain.
*
- * (1..10) .tap {|x| puts "original: #{x}" }
- * .to_a .tap {|x| puts "array: #{x}" }
- * .select {|x| x.even? } .tap {|x| puts "evens: #{x}" }
- * .map {|x| x*x } .tap {|x| puts "squares: #{x}" }
+ * (1..10) .tap {|x| puts "original: #{x.inspect}"}
+ * .to_a .tap {|x| puts "array: #{x.inspect}"}
+ * .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"}
+ * .map { |x| x*x } .tap {|x| puts "squares: #{x.inspect}"}
*
- *--
- * \private
- *++
*/
VALUE
@@ -915,7 +729,7 @@ rb_obj_tap(VALUE obj)
* class Baz < Bar
* end
*
- * <em>produces:</em>
+ * produces:
*
* New subclass: Bar
* New subclass: Baz
@@ -937,7 +751,7 @@ rb_obj_tap(VALUE obj)
* def some_instance_method() end
* end
*
- * <em>produces:</em>
+ * produces:
*
* Adding :some_instance_method
*
@@ -963,7 +777,7 @@ rb_obj_tap(VALUE obj)
* remove_method :some_instance_method
* end
*
- * <em>produces:</em>
+ * produces:
*
* Removing :some_instance_method
*
@@ -1126,21 +940,13 @@ rb_obj_dummy(void)
return Qnil;
}
-/**
+/*
* call-seq:
* obj.tainted? -> true or false
*
* Returns true if the object is tainted.
*
* See #taint for more information.
- *--
- * Determines if \a obj is tainted. Equivalent to \c Object\#tainted? in Ruby.
- * \param[in] obj the object to be determined
- * \retval Qtrue if the object is tainted
- * \retval Qfalse if the object is not tainted
- * \sa rb_obj_taint
- * \sa rb_obj_untaint
- *++
*/
VALUE
@@ -1151,7 +957,7 @@ rb_obj_tainted(VALUE obj)
return Qfalse;
}
-/**
+/*
* call-seq:
* obj.taint -> obj
*
@@ -1159,20 +965,16 @@ rb_obj_tainted(VALUE obj)
*
* Objects that are marked as tainted will be restricted from various built-in
* methods. This is to prevent insecure data, such as command-line arguments
- * or strings read from Kernel#gets, from inadvertently compromising the user's
+ * or strings read from Kernel#gets, from inadvertently compromising the users
* system.
*
- * To check whether an object is tainted, use #tainted?.
+ * To check whether an object is tainted, use #tainted?
*
* You should only untaint a tainted object if your code has inspected it and
- * determined that it is safe. To do so use #untaint.
- *--
- * Marks the object as tainted. Equivalent to \c Object\#taint in Ruby
- * \param[in] obj the object to be tainted
- * \return the object itself
- * \sa rb_obj_untaint
- * \sa rb_obj_tainted
- *++
+ * determined that it is safe. To do so use #untaint
+ *
+ * In $SAFE level 3, all newly created objects are tainted and you can't untaint
+ * objects.
*/
VALUE
@@ -1186,27 +988,19 @@ rb_obj_taint(VALUE obj)
}
-/**
+/*
* call-seq:
* obj.untaint -> obj
*
* Removes the tainted mark from the object.
*
* See #taint for more information.
- *--
- * Removes the tainted mark from the object.
- * Equivalent to \c Object\#untaint in Ruby.
- *
- * \param[in] obj the object to be tainted
- * \return the object itself
- * \sa rb_obj_taint
- * \sa rb_obj_tainted
- *++
*/
VALUE
rb_obj_untaint(VALUE obj)
{
+ rb_secure(3);
if (OBJ_TAINTED(obj)) {
rb_check_frozen(obj);
FL_UNSET(obj, FL_TAINT);
@@ -1214,20 +1008,11 @@ rb_obj_untaint(VALUE obj)
return obj;
}
-/**
+/*
* call-seq:
* obj.untrusted? -> true or false
*
* Deprecated method that is equivalent to #tainted?.
- *--
- * \deprecated Use rb_obj_tainted.
- *
- * Trustiness used to have independent semantics from taintedness.
- * But now trustiness of objects is obsolete and this function behaves
- * the same as rb_obj_tainted.
- *
- * \sa rb_obj_tainted
- *++
*/
VALUE
@@ -1237,20 +1022,11 @@ rb_obj_untrusted(VALUE obj)
return rb_obj_tainted(obj);
}
-/**
+/*
* call-seq:
* obj.untrust -> obj
*
* Deprecated method that is equivalent to #taint.
- *--
- * \deprecated Use rb_obj_taint(obj)
- *
- * Trustiness used to have independent semantics from taintedness.
- * But now trustiness of objects is obsolete and this function behaves
- * the same as rb_obj_taint.
- *
- * \sa rb_obj_taint
- *++
*/
VALUE
@@ -1261,20 +1037,11 @@ rb_obj_untrust(VALUE obj)
}
-/**
+/*
* call-seq:
* obj.trust -> obj
*
* Deprecated method that is equivalent to #untaint.
- *--
- * \deprecated Use rb_obj_untaint(obj)
- *
- * Trustiness used to have independent semantics from taintedness.
- * But now trustiness of objects is obsolete and this function behaves
- * the same as rb_obj_untaint.
- *
- * \sa rb_obj_untaint
- *++
*/
VALUE
@@ -1284,21 +1051,13 @@ rb_obj_trust(VALUE obj)
return rb_obj_untaint(obj);
}
-/**
- * Convenient function to infect \a victim with the taintedness of \a carrier.
- *
- * It just keeps the taintedness of \a victim if \a carrier is not tainted.
- * \param[in,out] victim the object being infected with the taintness of \a carrier
- * \param[in] carrier a possibly tainted object
- */
-
void
-rb_obj_infect(VALUE victim, VALUE carrier)
+rb_obj_infect(VALUE obj1, VALUE obj2)
{
- OBJ_INFECT(victim, carrier);
+ OBJ_INFECT(obj1, obj2);
}
-/**
+/*
* call-seq:
* obj.freeze -> obj
*
@@ -1315,16 +1074,11 @@ rb_obj_infect(VALUE victim, VALUE carrier)
*
* <em>produces:</em>
*
- * prog.rb:3:in `<<': can't modify frozen Array (FrozenError)
+ * prog.rb:3:in `<<': can't modify frozen array (RuntimeError)
* from prog.rb:3
*
- * Objects of the following classes are always frozen: Integer,
- * Float, Symbol.
- *--
- * Make the object unmodifiable. Equivalent to \c Object\#freeze in Ruby.
- * \param[in,out] obj the object to be frozen
- * \return the frozen object
- *++
+ * Objects of the following classes are always frozen: Fixnum,
+ * Bignum, Float, Symbol.
*/
VALUE
@@ -1339,7 +1093,7 @@ rb_obj_freeze(VALUE obj)
return obj;
}
-/**
+/*
* call-seq:
* obj.frozen? -> true or false
*
@@ -1348,12 +1102,6 @@ rb_obj_freeze(VALUE obj)
* a = [ "a", "b", "c" ]
* a.freeze #=> ["a", "b", "c"]
* a.frozen? #=> true
- *--
- * Determines if the object is frozen. Equivalent to \c Object\#frozen? in Ruby.
- * \param[in] obj the object to be determines
- * \retval Qtrue if frozen
- * \retval Qfalse if not frozen
- *++
*/
VALUE
@@ -1502,7 +1250,7 @@ true_and(VALUE obj, VALUE obj2)
* call-seq:
* true | obj -> true
*
- * Or---Returns <code>true</code>. As <i>obj</i> is an argument to
+ * Or---Returns <code>true</code>. As <i>anObject</i> is an argument to
* a method call, it is always evaluated; there is no short-circuit
* evaluation in this case.
*
@@ -1551,7 +1299,7 @@ true_xor(VALUE obj, VALUE obj2)
* call-seq:
* false.to_s -> "false"
*
- * The string representation of <code>false</code> is "false".
+ * 'nuf said...
*/
static VALUE
@@ -1626,12 +1374,10 @@ rb_true(VALUE obj)
/*
* call-seq:
- * obj.nil? -> true or false
+ * nil.nil? -> true
+ * <anything_else>.nil? -> false
*
* Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>.
- *
- * Object.new.nil? #=> false
- * nil.nil? #=> true
*/
@@ -1708,7 +1454,7 @@ rb_obj_cmp(VALUE obj1, VALUE obj2)
* Instance methods appear as methods in a class when the module is
* included, module methods do not. Conversely, module methods may be
* called without creating an encapsulating object, while instance
- * methods may not. (See <code>Module#module_function</code>.)
+ * methods may not. (See <code>Module#module_function</code>)
*
* In the descriptions that follow, the parameter <i>sym</i> refers
* to a symbol, which is either a quoted string or a
@@ -1731,7 +1477,7 @@ rb_obj_cmp(VALUE obj1, VALUE obj2)
* call-seq:
* mod.to_s -> string
*
- * Returns a string representing this module or class. For basic
+ * Return a string representing this module or class. For basic
* classes and modules, this is the name. For singletons, we
* show information on the thing we're attached to as well.
*/
@@ -1791,10 +1537,10 @@ rb_mod_freeze(VALUE mod)
* call-seq:
* mod === obj -> true or false
*
- * Case Equality---Returns <code>true</code> if <i>obj</i> is an
- * instance of <i>mod</i> or an instance of one of <i>mod</i>'s descendants.
- * Of limited use for modules, but can be used in <code>case</code> statements
- * to classify objects by class.
+ * Case Equality---Returns <code>true</code> if <i>anObject</i> is an
+ * instance of <i>mod</i> or one of <i>mod</i>'s descendants. Of
+ * limited use for modules, but can be used in <code>case</code>
+ * statements to classify objects by class.
*/
static VALUE
@@ -1803,7 +1549,7 @@ rb_mod_eqq(VALUE mod, VALUE arg)
return rb_obj_is_kind_of(arg, mod);
}
-/**
+/*
* call-seq:
* mod <= other -> true, false, or nil
*
@@ -1811,30 +1557,25 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* is the same as <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
- * "class A < B" implies "A < B".)
- *--
- * Determines if \a mod inherits \a arg. Equivalent to \c Module\#<= in Ruby
- *
- * \param[in] mod a Module object
- * \param[in] arg another Module object or an iclass of a module
- * \retval Qtrue if \a mod inherits \a arg, or \a mod equals \a arg
- * \retval Qfalse if \a arg inherits \a mod
- * \retval Qnil if otherwise
- *++
+ * "class A<B" implies "A<B").
+ *
*/
VALUE
rb_class_inherited_p(VALUE mod, VALUE arg)
{
+ VALUE start = mod;
+
if (mod == arg) return Qtrue;
if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) {
rb_raise(rb_eTypeError, "compared with non class/module");
}
- if (class_search_ancestor(mod, RCLASS_ORIGIN(arg))) {
+ arg = RCLASS_ORIGIN(arg);
+ if (class_search_ancestor(mod, arg)) {
return Qtrue;
}
/* not mod < arg; check if mod > arg */
- if (class_search_ancestor(arg, mod)) {
+ if (class_search_ancestor(arg, start)) {
return Qfalse;
}
return Qnil;
@@ -1847,7 +1588,7 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
* Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
- * "class A < B" implies "A < B".)
+ * "class A<B" implies "A<B").
*
*/
@@ -1867,7 +1608,7 @@ rb_mod_lt(VALUE mod, VALUE arg)
* two modules are the same. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
- * "class A < B" implies "B > A".)
+ * "class A<B" implies "B>A").
*
*/
@@ -1888,7 +1629,7 @@ rb_mod_ge(VALUE mod, VALUE arg)
* Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
- * "class A < B" implies "B > A".)
+ * "class A<B" implies "B>A").
*
*/
@@ -1905,7 +1646,7 @@ rb_mod_gt(VALUE mod, VALUE arg)
*
* Comparison---Returns -1, 0, +1 or nil depending on whether +module+
* includes +other_module+, they are the same, or if +module+ is included by
- * +other_module+.
+ * +other_module+. This is the basis for the tests in Comparable.
*
* Returns +nil+ if +module+ has no relationship with +other_module+, if
* +other_module+ is not a module, or if the two values are incomparable.
@@ -1951,7 +1692,7 @@ rb_class_s_alloc(VALUE klass)
*
* Creates a new anonymous module. If a block is given, it is passed
* the module object, and the block is evaluated in the context of this
- * module like <code>module_eval</code>.
+ * module using <code>module_eval</code>.
*
* fred = Module.new do
* def meth1
@@ -2000,7 +1741,7 @@ rb_mod_initialize_clone(VALUE clone, VALUE orig)
* class a name by assigning the class object to a constant.
*
* If a block is given, it is passed the class object, and the block
- * is evaluated in the context of this class like
+ * is evaluated in the context of this class using
* <code>class_eval</code>.
*
* fred = Class.new do
@@ -2046,14 +1787,6 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass)
return klass;
}
-/*! \private */
-void
-rb_undefined_alloc(VALUE klass)
-{
- rb_raise(rb_eTypeError, "allocator undefined for %"PRIsVALUE,
- klass);
-}
-
/*
* call-seq:
* class.allocate() -> obj
@@ -2076,8 +1809,8 @@ rb_undefined_alloc(VALUE klass)
*
*/
-static VALUE
-rb_class_alloc(VALUE klass)
+VALUE
+rb_obj_alloc(VALUE klass)
{
VALUE obj;
rb_alloc_func_t allocator;
@@ -2090,10 +1823,18 @@ rb_class_alloc(VALUE klass)
}
allocator = rb_get_alloc_func(klass);
if (!allocator) {
- rb_undefined_alloc(klass);
+ rb_raise(rb_eTypeError, "allocator undefined for %"PRIsVALUE,
+ klass);
}
- RUBY_DTRACE_CREATE_HOOK(OBJECT, rb_class2name(klass));
+#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
+ if (RUBY_DTRACE_OBJECT_CREATE_ENABLED()) {
+ const char * file = rb_sourcefile();
+ RUBY_DTRACE_OBJECT_CREATE(rb_class2name(klass),
+ file ? file : "",
+ rb_sourceline());
+ }
+#endif
obj = (*allocator)(klass);
@@ -2103,27 +1844,6 @@ rb_class_alloc(VALUE klass)
return obj;
}
-/**
- * Allocates an instance of \a klass
- *
- * \note It calls the allocator defined by {rb_define_alloc_func}.
- * So you cannot use this function to define an allocator.
- * Use {rb_newobj_of}, {TypedData_Make_Struct} or others, instead.
- * \note Usually prefer rb_class_new_instance to rb_obj_alloc and rb_obj_call_init
- * \param[in] klass a Class object
- * \sa rb_class_new_instance
- * \sa rb_obj_call_init
- * \sa rb_define_alloc_func
- * \sa rb_newobj_of
- * \sa TypedData_Make_Struct
- */
-VALUE
-rb_obj_alloc(VALUE klass)
-{
- Check_Type(klass, T_CLASS);
- return rb_class_alloc(klass);
-}
-
static VALUE
rb_class_allocate_instance(VALUE klass)
{
@@ -2143,37 +1863,18 @@ rb_class_allocate_instance(VALUE klass)
*
*/
-static VALUE
-rb_class_s_new(int argc, const VALUE *argv, VALUE klass)
+VALUE
+rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
{
VALUE obj;
- obj = rb_class_alloc(klass);
+ obj = rb_obj_alloc(klass);
rb_obj_call_init(obj, argc, argv);
return obj;
}
-/**
- * Allocates and initializes an instance of \a klass.
- *
- * Equivalent to \c Class\#new in Ruby
- *
- * \param[in] argc the number of arguments to \c #initialize
- * \param[in] argv a pointer to an array of arguments to \c #initialize
- * \param[in] klass a Class object
- * \return the new instance of \a klass
- * \sa rb_obj_call_init
- * \sa rb_obj_alloc
- */
-VALUE
-rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
-{
- Check_Type(klass, T_CLASS);
- return rb_class_s_new(argc, argv, klass);
-}
-
-/**
+/*
* call-seq:
* class.superclass -> a_super_class or nil
*
@@ -2186,18 +1887,10 @@ rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
* class Bar < Foo; end
* Bar.superclass #=> Foo
*
- * Returns nil when the given class does not have a parent class:
+ * returns nil when the given class hasn't a parent class:
*
* BasicObject.superclass #=> nil
*
- *--
- * Returns the superclass of \a klass. Equivalent to \c Class\#superclass in Ruby.
- *
- * It skips modules.
- * \param[in] klass a Class object
- * \return the superclass, or \c Qnil if \a klass does not have a parent class.
- * \sa rb_class_get_superclass
- *++
*/
VALUE
@@ -2218,60 +1911,65 @@ rb_class_superclass(VALUE klass)
return super;
}
-/**
- * Returns the superclass of \a klass
- * The return value might be an iclass of a module, unlike rb_class_superclass.
- *
- * Also it returns Qfalse when \a klass does not have a parent class.
- * \sa rb_class_superclass
- */
VALUE
rb_class_get_superclass(VALUE klass)
{
return RCLASS(klass)->super;
}
-/*! \private */
-#define id_for_var(obj, name, part, type) \
- id_for_setter(obj, name, type, "`%1$s' is not allowed as "#part" "#type" variable name")
-/*! \private */
-#define id_for_setter(obj, name, type, message) \
- check_setter_id(obj, &(name), rb_is_##type##_id, rb_is_##type##_name, message, strlen(message))
+#define id_for_setter(name, type, message) \
+ check_setter_id(name, rb_is_##type##_id, rb_is_##type##_name, message)
static ID
-check_setter_id(VALUE obj, VALUE *pname,
- int (*valid_id_p)(ID), int (*valid_name_p)(VALUE),
- const char *message, size_t message_len)
+check_setter_id(VALUE name, int (*valid_id_p)(ID), int (*valid_name_p)(VALUE),
+ const char *message)
{
- ID id = rb_check_id(pname);
- VALUE name = *pname;
-
- if (id ? !valid_id_p(id) : !valid_name_p(name)) {
- rb_name_err_raise_str(rb_fstring_new(message, message_len),
- obj, name);
+ ID id;
+ if (SYMBOL_P(name)) {
+ id = SYM2ID(name);
+ if (!valid_id_p(id)) {
+ rb_name_error(id, message, QUOTE_ID(id));
+ }
+ }
+ else {
+ VALUE str = rb_check_string_type(name);
+ if (NIL_P(str)) {
+ rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol or string",
+ str);
+ }
+ if (!valid_name_p(str)) {
+ rb_name_error_str(str, message, QUOTE(str));
+ }
+ id = rb_to_id(str);
}
return id;
}
static int
-rb_is_attr_name(VALUE name)
+rb_is_attr_id(ID id)
{
- return rb_is_local_name(name) || rb_is_const_name(name);
+ return rb_is_local_id(id) || rb_is_const_id(id);
}
static int
-rb_is_attr_id(ID id)
+rb_is_attr_name(VALUE name)
{
- return rb_is_local_id(id) || rb_is_const_id(id);
+ return rb_is_local_name(name) || rb_is_const_name(name);
}
-static const char wrong_constant_name[] = "wrong constant name %1$s";
-static const char invalid_attribute_name[] = "invalid attribute name `%1$s'";
+static const char invalid_attribute_name[] = "invalid attribute name `%"PRIsVALUE"'";
static ID
-id_for_attr(VALUE obj, VALUE name)
+id_for_attr(VALUE name)
{
- ID id = id_for_setter(obj, name, attr, invalid_attribute_name);
- if (!id) id = rb_intern_str(name);
+ return id_for_setter(name, attr, invalid_attribute_name);
+}
+
+ID
+rb_check_attr_id(ID id)
+{
+ if (!rb_is_attr_id(id)) {
+ rb_name_error_str(id, invalid_attribute_name, QUOTE_ID(id));
+ }
return id;
}
@@ -2294,31 +1992,17 @@ rb_mod_attr_reader(int argc, VALUE *argv, VALUE klass)
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, id_for_attr(klass, argv[i]), TRUE, FALSE, TRUE);
+ rb_attr(klass, id_for_attr(argv[i]), TRUE, FALSE, TRUE);
}
return Qnil;
}
-/**
- * call-seq:
- * attr(name, ...) -> nil
- * attr(name, true) -> nil
- * attr(name, false) -> nil
- *
- * The first form is equivalent to <code>attr_reader</code>.
- * The second form is equivalent to <code>attr_accessor(name)</code> but deprecated.
- * The last form is equivalent to <code>attr_reader(name)</code> but deprecated.
- *--
- * \private
- * \todo can be static?
- *++
- */
VALUE
rb_mod_attr(int argc, VALUE *argv, VALUE klass)
{
if (argc == 2 && (argv[1] == Qtrue || argv[1] == Qfalse)) {
rb_warning("optional boolean argument is obsoleted");
- rb_attr(klass, id_for_attr(klass, argv[0]), 1, RTEST(argv[1]), TRUE);
+ rb_attr(klass, id_for_attr(argv[0]), 1, RTEST(argv[1]), TRUE);
return Qnil;
}
return rb_mod_attr_reader(argc, argv, klass);
@@ -2340,7 +2024,7 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, id_for_attr(klass, argv[i]), FALSE, TRUE, TRUE);
+ rb_attr(klass, id_for_attr(argv[i]), FALSE, TRUE, TRUE);
}
return Qnil;
}
@@ -2368,7 +2052,7 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
int i;
for (i=0; i<argc; i++) {
- rb_attr(klass, id_for_attr(klass, argv[i]), TRUE, TRUE, TRUE);
+ rb_attr(klass, id_for_attr(argv[i]), TRUE, TRUE, TRUE);
}
return Qnil;
}
@@ -2378,9 +2062,9 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
* mod.const_get(sym, inherit=true) -> obj
* mod.const_get(str, inherit=true) -> obj
*
- * Checks for a constant with the given name in <i>mod</i>.
+ * Checks for a constant with the given name in <i>mod</i>
* If +inherit+ is set, the lookup will also search
- * the ancestors (and +Object+ if <i>mod</i> is a +Module+).
+ * the ancestors (and +Object+ if <i>mod</i> is a +Module+.)
*
* The value of the constant is returned if a definition is found,
* otherwise a +NameError+ is raised.
@@ -2406,7 +2090,7 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
* Object.const_get 'Foo::Baz::VAL' # => 10
* Object.const_get 'Foo::Baz::VAL', false # => NameError
*
- * If the argument is not a valid constant name a +NameError+ will be
+ * If neither +sym+ nor +str+ is not a valid constant name a NameError will be
* raised with a warning "wrong constant name".
*
* Object.const_get 'foobar' #=> NameError: wrong constant name foobar
@@ -2421,14 +2105,17 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
const char *pbeg, *p, *path, *pend;
ID id;
- rb_check_arity(argc, 1, 2);
- name = argv[0];
- recur = (argc == 1) ? Qtrue : argv[1];
+ if (argc == 1) {
+ name = argv[0];
+ recur = Qtrue;
+ }
+ else {
+ rb_scan_args(argc, argv, "11", &name, &recur);
+ }
if (SYMBOL_P(name)) {
- if (!rb_is_const_sym(name)) goto wrong_name;
- id = rb_check_id(&name);
- if (!id) return rb_const_missing(mod, name);
+ id = SYM2ID(name);
+ if (!rb_is_const_id(id)) goto wrong_id;
return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
}
@@ -2444,7 +2131,8 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
if (p >= pend || !*p) {
wrong_name:
- rb_name_err_raise(wrong_constant_name, mod, name);
+ rb_raise(rb_eNameError, "wrong constant name %"PRIsVALUE,
+ QUOTE(name));
}
if (p + 2 < pend && p[0] == ':' && p[1] == ':') {
@@ -2479,21 +2167,22 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
part = rb_str_subseq(name, beglen, len);
OBJ_FREEZE(part);
if (!ISUPPER(*pbeg) || !rb_is_const_name(part)) {
- name = part;
- goto wrong_name;
+ rb_name_error_str(part, "wrong constant name %"PRIsVALUE,
+ QUOTE(part));
}
else if (!rb_method_basic_definition_p(CLASS_OF(mod), id_const_missing)) {
- part = rb_str_intern(part);
- mod = rb_const_missing(mod, part);
- continue;
+ id = rb_intern_str(part);
}
else {
- rb_mod_const_missing(mod, part);
+ rb_name_error_str(part, "uninitialized constant %"PRIsVALUE"%"PRIsVALUE,
+ rb_str_subseq(name, 0, beglen),
+ QUOTE(part));
}
}
if (!rb_is_const_id(id)) {
- name = ID2SYM(id);
- goto wrong_name;
+ wrong_id:
+ rb_name_error(id, "wrong constant name %"PRIsVALUE,
+ QUOTE_ID(id));
}
mod = RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
}
@@ -2513,7 +2202,7 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
* Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0) #=> 3.14285714285714
* Math::HIGH_SCHOOL_PI - Math::PI #=> 0.00126448926734968
*
- * If +sym+ or +str+ is not a valid constant name a +NameError+ will be
+ * If neither +sym+ nor +str+ is not a valid constant name a NameError will be
* raised with a warning "wrong constant name".
*
* Object.const_set('foobar', 42) #=> NameError: wrong constant name foobar
@@ -2523,10 +2212,8 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
static VALUE
rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
{
- ID id = id_for_setter(mod, name, const, wrong_constant_name);
- if (!id) id = rb_intern_str(name);
+ ID id = id_for_setter(name, const, "wrong constant name %"PRIsVALUE);
rb_const_set(mod, id, value);
-
return value;
}
@@ -2535,39 +2222,20 @@ rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
* mod.const_defined?(sym, inherit=true) -> true or false
* mod.const_defined?(str, inherit=true) -> true or false
*
- * Says whether _mod_ or its ancestors have a constant with the given name:
- *
- * Float.const_defined?(:EPSILON) #=> true, found in Float itself
- * Float.const_defined?("String") #=> true, found in Object (ancestor)
- * BasicObject.const_defined?(:Hash) #=> false
- *
- * If _mod_ is a +Module+, additionally +Object+ and its ancestors are checked:
- *
- * Math.const_defined?(:String) #=> true, found in Object
- *
- * In each of the checked classes or modules, if the constant is not present
- * but there is an autoload for it, +true+ is returned directly without
- * autoloading:
- *
- * module Admin
- * autoload :User, 'admin/user'
- * end
- * Admin.const_defined?(:User) #=> true
- *
- * If the constant is not found the callback +const_missing+ is *not* called
- * and the method returns +false+.
- *
- * If +inherit+ is false, the lookup only checks the constants in the receiver:
+ * Checks for a constant with the given name in <i>mod</i>
+ * If +inherit+ is set, the lookup will also search
+ * the ancestors (and +Object+ if <i>mod</i> is a +Module+.)
*
- * IO.const_defined?(:SYNC) #=> true, found in File::Constants (ancestor)
- * IO.const_defined?(:SYNC, false) #=> false, not found in IO itself
+ * Returns whether or not a definition is found:
*
- * In this case, the same logic for autoloading applies.
+ * Math.const_defined? "PI" #=> true
+ * IO.const_defined? :SYNC #=> true
+ * IO.const_defined? :SYNC, false #=> false
*
- * If the argument is not a valid constant name a +NameError+ is raised with the
- * message "wrong constant name _name_":
+ * If neither +sym+ nor +str+ is not a valid constant name a NameError will be
+ * raised with a warning "wrong constant name".
*
- * Hash.const_defined? 'foobar' #=> NameError: wrong constant name foobar
+ * Hash.const_defined? 'foobar' #=> NameError: wrong constant name foobar
*
*/
@@ -2579,14 +2247,17 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
const char *pbeg, *p, *path, *pend;
ID id;
- rb_check_arity(argc, 1, 2);
- name = argv[0];
- recur = (argc == 1) ? Qtrue : argv[1];
+ if (argc == 1) {
+ name = argv[0];
+ recur = Qtrue;
+ }
+ else {
+ rb_scan_args(argc, argv, "11", &name, &recur);
+ }
if (SYMBOL_P(name)) {
- if (!rb_is_const_sym(name)) goto wrong_name;
- id = rb_check_id(&name);
- if (!id) return Qfalse;
+ id = SYM2ID(name);
+ if (!rb_is_const_id(id)) goto wrong_id;
return RTEST(recur) ? rb_const_defined(mod, id) : rb_const_defined_at(mod, id);
}
@@ -2602,7 +2273,8 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
if (p >= pend || !*p) {
wrong_name:
- rb_name_err_raise(wrong_constant_name, mod, name);
+ rb_raise(rb_eNameError, "wrong constant name %"PRIsVALUE,
+ QUOTE(name));
}
if (p + 2 < pend && p[0] == ':' && p[1] == ':') {
@@ -2632,16 +2304,17 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
part = rb_str_subseq(name, beglen, len);
OBJ_FREEZE(part);
if (!ISUPPER(*pbeg) || !rb_is_const_name(part)) {
- name = part;
- goto wrong_name;
+ rb_name_error_str(part, "wrong constant name %"PRIsVALUE,
+ QUOTE(part));
}
else {
return Qfalse;
}
}
if (!rb_is_const_id(id)) {
- name = ID2SYM(id);
- goto wrong_name;
+ wrong_id:
+ rb_name_error(id, "wrong constant name %"PRIsVALUE,
+ QUOTE_ID(id));
}
if (RTEST(recur)) {
if (!rb_const_defined(mod, id))
@@ -2689,10 +2362,20 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
static VALUE
rb_obj_ivar_get(VALUE obj, VALUE iv)
{
- ID id = id_for_var(obj, iv, an, instance);
+ ID id = rb_check_id(&iv);
if (!id) {
- return Qnil;
+ if (rb_is_instance_name(iv)) {
+ return Qnil;
+ }
+ else {
+ rb_name_error_str(iv, "`%"PRIsVALUE"' is not allowed as an instance variable name",
+ QUOTE(iv));
+ }
+ }
+ if (!rb_is_instance_id(id)) {
+ rb_name_error(id, "`%"PRIsVALUE"' is not allowed as an instance variable name",
+ QUOTE_ID(id));
}
return rb_ivar_get(obj, id);
}
@@ -2702,10 +2385,10 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
* obj.instance_variable_set(symbol, obj) -> obj
* obj.instance_variable_set(string, obj) -> obj
*
- * Sets the instance variable named by <i>symbol</i> to the given
- * object, thereby frustrating the efforts of the class's
+ * Sets the instance variable names by <i>symbol</i> to
+ * <i>object</i>, thereby frustrating the efforts of the class's
* author to attempt to provide proper encapsulation. The variable
- * does not have to exist prior to this call.
+ * did not have to exist prior to this call.
* If the instance variable name is passed as a string, that string
* is converted to a symbol.
*
@@ -2723,8 +2406,7 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
static VALUE
rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
{
- ID id = id_for_var(obj, iv, an, instance);
- if (!id) id = rb_intern_str(iv);
+ ID id = id_for_setter(iv, instance, "`%"PRIsVALUE"' is not allowed as an instance variable name");
return rb_ivar_set(obj, id, val);
}
@@ -2751,10 +2433,20 @@ rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
static VALUE
rb_obj_ivar_defined(VALUE obj, VALUE iv)
{
- ID id = id_for_var(obj, iv, an, instance);
+ ID id = rb_check_id(&iv);
if (!id) {
- return Qfalse;
+ if (rb_is_instance_name(iv)) {
+ return Qfalse;
+ }
+ else {
+ rb_name_error_str(iv, "`%"PRIsVALUE"' is not allowed as an instance variable name",
+ QUOTE(iv));
+ }
+ }
+ if (!rb_is_instance_id(id)) {
+ rb_name_error(id, "`%"PRIsVALUE"' is not allowed as an instance variable name",
+ QUOTE_ID(id));
}
return rb_ivar_defined(obj, id);
}
@@ -2766,7 +2458,7 @@ rb_obj_ivar_defined(VALUE obj, VALUE iv)
*
* Returns the value of the given class variable (or throws a
* <code>NameError</code> exception). The <code>@@</code> part of the
- * variable name should be included for regular class variables.
+ * variable name should be included for regular class variables
* String arguments are converted to symbols.
*
* class Fred
@@ -2778,11 +2470,21 @@ rb_obj_ivar_defined(VALUE obj, VALUE iv)
static VALUE
rb_mod_cvar_get(VALUE obj, VALUE iv)
{
- ID id = id_for_var(obj, iv, a, class);
+ ID id = rb_check_id(&iv);
if (!id) {
- rb_name_err_raise("uninitialized class variable %1$s in %2$s",
- obj, iv);
+ if (rb_is_class_name(iv)) {
+ rb_name_error_str(iv, "uninitialized class variable %"PRIsVALUE" in %"PRIsVALUE"",
+ iv, rb_class_name(obj));
+ }
+ else {
+ rb_name_error_str(iv, "`%"PRIsVALUE"' is not allowed as a class variable name",
+ QUOTE(iv));
+ }
+ }
+ if (!rb_is_class_id(id)) {
+ rb_name_error(id, "`%"PRIsVALUE"' is not allowed as a class variable name",
+ QUOTE_ID(id));
}
return rb_cvar_get(obj, id);
}
@@ -2792,8 +2494,8 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
* obj.class_variable_set(symbol, obj) -> obj
* obj.class_variable_set(string, obj) -> obj
*
- * Sets the class variable named by <i>symbol</i> to the given
- * object.
+ * Sets the class variable names by <i>symbol</i> to
+ * <i>object</i>.
* If the class variable name is passed as a string, that string
* is converted to a symbol.
*
@@ -2810,8 +2512,7 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
static VALUE
rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
{
- ID id = id_for_var(obj, iv, a, class);
- if (!id) id = rb_intern_str(iv);
+ ID id = id_for_setter(iv, class, "`%"PRIsVALUE"' is not allowed as a class variable name");
rb_cvar_set(obj, id, val);
return val;
}
@@ -2835,10 +2536,20 @@ rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
static VALUE
rb_mod_cvar_defined(VALUE obj, VALUE iv)
{
- ID id = id_for_var(obj, iv, a, class);
+ ID id = rb_check_id(&iv);
if (!id) {
- return Qfalse;
+ if (rb_is_class_name(iv)) {
+ return Qfalse;
+ }
+ else {
+ rb_name_error_str(iv, "`%"PRIsVALUE"' is not allowed as a class variable name",
+ QUOTE(iv));
+ }
+ }
+ if (!rb_is_class_id(id)) {
+ rb_name_error(id, "`%"PRIsVALUE"' is not allowed as a class variable name",
+ QUOTE_ID(id));
}
return rb_cvar_defined(obj, id);
}
@@ -2864,12 +2575,11 @@ rb_mod_singleton_p(VALUE klass)
return Qfalse;
}
-/*! \private */
static const struct conv_method_tbl {
- const char method[6];
- unsigned short id;
+ const char method[8];
+ ID id;
} conv_method_names[] = {
-#define M(n) {#n, (unsigned short)idTo_##n}
+#define M(n) {"to_"#n, idTo_##n}
M(int),
M(ary),
M(str),
@@ -2880,38 +2590,29 @@ static const struct conv_method_tbl {
M(a),
M(s),
M(i),
- M(r),
#undef M
};
#define IMPLICIT_CONVERSIONS 7
-static int
-conv_method_index(const char *method)
+static VALUE
+convert_type(VALUE val, const char *tname, const char *method, int raise)
{
- static const char prefix[] = "to_";
-
- if (strncmp(prefix, method, sizeof(prefix)-1) == 0) {
- const char *const meth = &method[sizeof(prefix)-1];
- int i;
- for (i=0; i < numberof(conv_method_names); i++) {
- if (conv_method_names[i].method[0] == meth[0] &&
- strcmp(conv_method_names[i].method, meth) == 0) {
- return i;
- }
+ ID m = 0;
+ int i;
+ VALUE r;
+
+ for (i=0; i < numberof(conv_method_names); i++) {
+ if (conv_method_names[i].method[0] == method[0] &&
+ strcmp(conv_method_names[i].method, method) == 0) {
+ m = conv_method_names[i].id;
+ break;
}
}
- return numberof(conv_method_names);
-}
-
-static VALUE
-convert_type_with_id(VALUE val, const char *tname, ID method, int raise, int index)
-{
- VALUE r = rb_check_funcall(val, method, 0, 0);
+ if (!m) m = rb_intern(method);
+ r = rb_check_funcall(val, m, 0, 0);
if (r == Qundef) {
if (raise) {
- const char *msg =
- ((index < 0 ? conv_method_index(rb_id2name(method)) : index)
- < IMPLICIT_CONVERSIONS) ?
+ const char *msg = i < IMPLICIT_CONVERSIONS ?
"no implicit conversion of" : "can't convert";
const char *cname = NIL_P(val) ? "nil" :
val == Qtrue ? "true" :
@@ -2928,16 +2629,6 @@ convert_type_with_id(VALUE val, const char *tname, ID method, int raise, int ind
return r;
}
-static VALUE
-convert_type(VALUE val, const char *tname, const char *method, int raise)
-{
- int i = conv_method_index(method);
- ID m = i < numberof(conv_method_names) ?
- conv_method_names[i].id : rb_intern(method);
- return convert_type_with_id(val, tname, m, raise, i);
-}
-
-/*! \private */
NORETURN(static void conversion_mismatch(VALUE, const char *, const char *, VALUE));
static void
conversion_mismatch(VALUE val, const char *tname, const char *method, VALUE result)
@@ -2948,19 +2639,6 @@ conversion_mismatch(VALUE val, const char *tname, const char *method, VALUE resu
cname, tname, cname, method, rb_obj_class(result));
}
-/*!
- * Converts an object into another type.
- * Calls the specified conversion method if necessary.
- *
- * \param[in] val the object to be converted
- * \param[in] type a value of \c ruby_value_type
- * \param[in] tname name of the target type.
- * only used for error messages.
- * \param[in] method name of the method
- * \return an object of the specified type
- * \throw TypeError on failure
- * \sa rb_check_convert_type
- */
VALUE
rb_convert_type(VALUE val, int type, const char *tname, const char *method)
{
@@ -2974,34 +2652,6 @@ rb_convert_type(VALUE val, int type, const char *tname, const char *method)
return v;
}
-/*! \private */
-VALUE
-rb_convert_type_with_id(VALUE val, int type, const char *tname, ID method)
-{
- VALUE v;
-
- if (TYPE(val) == type) return val;
- v = convert_type_with_id(val, tname, method, TRUE, -1);
- if (TYPE(v) != type) {
- conversion_mismatch(val, tname, RSTRING_PTR(rb_id2str(method)), v);
- }
- return v;
-}
-
-/*!
- * Tries to convert an object into another type.
- * Calls the specified conversion method if necessary.
- *
- * \param[in] val the object to be converted
- * \param[in] type a value of \c ruby_value_type
- * \param[in] tname name of the target type.
- * only used for error messages.
- * \param[in] method name of the method
- * \return an object of the specified type, or Qnil if no such conversion method defined.
- * \throw TypeError if the conversion method returns an unexpected type of value.
- * \sa rb_convert_type
- * \sa rb_check_convert_type_with_id
- */
VALUE
rb_check_convert_type(VALUE val, int type, const char *tname, const char *method)
{
@@ -3017,22 +2667,6 @@ rb_check_convert_type(VALUE val, int type, const char *tname, const char *method
return v;
}
-/*! \private */
-VALUE
-rb_check_convert_type_with_id(VALUE val, int type, const char *tname, ID method)
-{
- VALUE v;
-
- /* always convert T_DATA */
- if (TYPE(val) == type && type != T_DATA) return val;
- v = convert_type_with_id(val, tname, method, FALSE, -1);
- if (NIL_P(v)) return Qnil;
- if (TYPE(v) != type) {
- conversion_mismatch(val, tname, RSTRING_PTR(rb_id2str(method)), v);
- }
- return v;
-}
-
static VALUE
rb_to_integer(VALUE val, const char *method)
@@ -3048,16 +2682,6 @@ rb_to_integer(VALUE val, const char *method)
return v;
}
-/**
- * Tries to convert \a val into \c Integer.
- * It calls the specified conversion method if necessary.
- *
- * \param[in] val a Ruby object
- * \param[in] method a name of a method
- * \return an \c Integer object on success,
- * or \c Qnil if no such conversion method defined.
- * \exception TypeError if the conversion method returns a non-Integer object.
- */
VALUE
rb_check_to_integer(VALUE val, const char *method)
{
@@ -3072,29 +2696,12 @@ rb_check_to_integer(VALUE val, const char *method)
return v;
}
-/**
- * Converts \a val into \c Integer.
- * It calls \a #to_int method if necessary.
- *
- * \param[in] val a Ruby object
- * \return an \c Integer object
- * \exception TypeError on failure
- */
VALUE
rb_to_int(VALUE val)
{
return rb_to_integer(val, "to_int");
}
-/**
- * Tries to convert \a val into Integer.
- * It calls \c #to_int method if necessary.
- *
- * \param[in] val a Ruby object
- * \return an Integer object on success,
- * or \c Qnil if \c #to_int is not defined.
- * \exception TypeError if \c #to_int returns a non-Integer object.
- */
VALUE
rb_check_to_int(VALUE val)
{
@@ -3106,27 +2713,35 @@ rb_convert_to_integer(VALUE val, int base)
{
VALUE tmp;
- if (RB_FLOAT_TYPE_P(val)) {
- double f;
+ switch (TYPE(val)) {
+ case T_FLOAT:
if (base != 0) goto arg_error;
- f = RFLOAT_VALUE(val);
- if (FIXABLE(f)) return LONG2FIX((long)f);
- return rb_dbl2big(f);
- }
- else if (RB_INTEGER_TYPE_P(val)) {
+ if (RFLOAT_VALUE(val) <= (double)FIXNUM_MAX
+ && RFLOAT_VALUE(val) >= (double)FIXNUM_MIN) {
+ break;
+ }
+ return rb_dbl2big(RFLOAT_VALUE(val));
+
+ case T_FIXNUM:
+ case T_BIGNUM:
if (base != 0) goto arg_error;
return val;
- }
- else if (RB_TYPE_P(val, T_STRING)) {
+
+ case T_STRING:
+ string_conv:
return rb_str_to_inum(val, base, TRUE);
- }
- else if (NIL_P(val)) {
+
+ case T_NIL:
if (base != 0) goto arg_error;
rb_raise(rb_eTypeError, "can't convert nil into Integer");
+ break;
+
+ default:
+ break;
}
if (base != 0) {
tmp = rb_check_string_type(val);
- if (!NIL_P(tmp)) return rb_str_to_inum(tmp, base, TRUE);
+ if (!NIL_P(tmp)) goto string_conv;
arg_error:
rb_raise(rb_eArgError, "base specified for non string value");
}
@@ -3138,12 +2753,6 @@ rb_convert_to_integer(VALUE val, int base)
}
-/**
- * Equivalent to \c Kernel\#Integer in Ruby.
- *
- * Converts \a val into \c Integer in a slightly more strict manner
- * than \c #to_i.
- */
VALUE
rb_Integer(VALUE val)
{
@@ -3152,18 +2761,18 @@ rb_Integer(VALUE val)
/*
* call-seq:
- * Integer(arg, base=0) -> integer
+ * Integer(arg,base=0) -> integer
*
- * Converts <i>arg</i> to an <code>Integer</code>.
+ * Converts <i>arg</i> to a <code>Fixnum</code> or <code>Bignum</code>.
* Numeric types are converted directly (with floating point numbers
- * being truncated). <i>base</i> (0, or between 2 and 36) is a base for
+ * being truncated). <i>base</i> (0, or between 2 and 36) is a base for
* integer string representation. If <i>arg</i> is a <code>String</code>,
- * when <i>base</i> is omitted or equals zero, radix indicators
+ * when <i>base</i> is omitted or equals to zero, radix indicators
* (<code>0</code>, <code>0b</code>, and <code>0x</code>) are honored.
* In any case, strings should be strictly conformed to numeric
* representation. This behavior is different from that of
- * <code>String#to_i</code>. Non string values will be converted by first
- * trying <code>to_int</code>, then <code>to_i</code>. Passing <code>nil</code>
+ * <code>String#to_i</code>. Non string values will be converted using
+ * <code>to_int</code>, and <code>to_i</code>. Passing <code>nil</code>
* raises a TypeError.
*
* Integer(123.999) #=> 123
@@ -3193,17 +2802,6 @@ rb_f_integer(int argc, VALUE *argv, VALUE obj)
return rb_convert_to_integer(arg, base);
}
-/*!
- * Parses a string representation of a floating point number.
- *
- * \param[in] p a string representation of a floating number
- * \param[in] badcheck raises an exception on parse error if \a badcheck is non-zero.
- * \return the floating point number in the string on success,
- * 0.0 on parse error and \a badcheck is zero.
- * \note it always fails to parse a hexadecimal representation like "0xAB.CDp+1" when
- * \a badcheck is zero, even though it would success if \a badcheck was non-zero.
- * This inconsistency is coming from a historical compatibility reason. [ruby-dev:40822]
- */
double
rb_cstr_to_dbl(const char *p, int badcheck)
{
@@ -3239,53 +2837,30 @@ rb_cstr_to_dbl(const char *p, int badcheck)
return d;
}
if (*end) {
- char buf[DBL_DIG * 4 + 10];
- char *n = buf;
- char *const init_e = buf + DBL_DIG * 4;
- char *e = init_e;
- char prev = 0;
- int dot_seen = FALSE;
-
- switch (*p) {case '+': case '-': prev = *n++ = *p++;}
- if (*p == '0') {
- prev = *n++ = '0';
- while (*++p == '0');
- }
- while (p < end && n < e) prev = *n++ = *p++;
- while (*p) {
- if (*p == '_') {
- /* remove an underscore between digits */
- if (n == buf || !ISDIGIT(prev) || (++p, !ISDIGIT(*p))) {
- if (badcheck) goto bad;
- break;
- }
- }
- prev = *p++;
- if (e == init_e && (prev == 'e' || prev == 'E' || prev == 'p' || prev == 'P')) {
- e = buf + sizeof(buf) - 1;
- *n++ = prev;
- switch (*p) {case '+': case '-': prev = *n++ = *p++;}
- if (*p == '0') {
- prev = *n++ = '0';
- while (*++p == '0');
- }
- continue;
- }
- else if (ISSPACE(prev)) {
- while (ISSPACE(*p)) ++p;
- if (*p) {
- if (badcheck) goto bad;
- break;
- }
- }
- else if (prev == '.' ? dot_seen++ : !ISDIGIT(prev)) {
- if (badcheck) goto bad;
- break;
- }
- if (n < e) *n++ = prev;
- }
- *n = '\0';
- p = buf;
+ char buf[DBL_DIG * 4 + 10];
+ char *n = buf;
+ char *e = buf + sizeof(buf) - 1;
+ char prev = 0;
+
+ while (p < end && n < e) prev = *n++ = *p++;
+ while (*p) {
+ if (*p == '_') {
+ /* remove underscores between digits */
+ if (badcheck) {
+ if (n == buf || !ISDIGIT(prev)) goto bad;
+ ++p;
+ if (!ISDIGIT(*p)) goto bad;
+ }
+ else {
+ while (*++p == '_');
+ continue;
+ }
+ }
+ prev = *p++;
+ if (n < e) *n++ = prev;
+ }
+ *n = '\0';
+ p = buf;
if (!badcheck && p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) {
return 0.0;
@@ -3311,17 +2886,6 @@ rb_cstr_to_dbl(const char *p, int badcheck)
return d;
}
-/*!
- * Parses a string representation of a floating point number.
- *
- * \param[in] str a \c String object representation of a floating number
- * \param[in] badcheck raises an exception on parse error if \a badcheck is non-zero.
- * \return the floating point number in the string on success,
- * 0.0 on parse error and \a badcheck is zero.
- * \note it always fails to parse a hexadecimal representation like "0xAB.CDp+1" when
- * \a badcheck is zero, even though it would success if \a badcheck was non-zero.
- * This inconsistency is coming from a historical compatibility reason. [ruby-dev:40822]
- */
double
rb_str_to_dbl(VALUE str, int badcheck)
{
@@ -3338,7 +2902,7 @@ rb_str_to_dbl(VALUE str, int badcheck)
rb_raise(rb_eArgError, "string for Float contains null byte");
}
if (s[len]) { /* no sentinel somehow */
- char *p = ALLOCV(v, (size_t)len + 1);
+ char *p = ALLOCV(v, len);
MEMCPY(p, s, char, len);
p[len] = '\0';
s = p;
@@ -3350,105 +2914,43 @@ rb_str_to_dbl(VALUE str, int badcheck)
return ret;
}
-/*! \cond INTERNAL_MACRO */
-#define fix2dbl_without_to_f(x) (double)FIX2LONG(x)
-#define big2dbl_without_to_f(x) rb_big2dbl(x)
-#define int2dbl_without_to_f(x) \
- (FIXNUM_P(x) ? fix2dbl_without_to_f(x) : big2dbl_without_to_f(x))
-#define rat2dbl_without_to_f(x) \
- (int2dbl_without_to_f(rb_rational_num(x)) / \
- int2dbl_without_to_f(rb_rational_den(x)))
-
-#define special_const_to_float(val, pre, post) \
- switch (val) { \
- case Qnil: \
- rb_raise_static(rb_eTypeError, pre "nil" post); \
- case Qtrue: \
- rb_raise_static(rb_eTypeError, pre "true" post); \
- case Qfalse: \
- rb_raise_static(rb_eTypeError, pre "false" post); \
- }
-/*! \endcond */
-
-static inline void
-conversion_to_float(VALUE val)
-{
- special_const_to_float(val, "can't convert ", " into Float");
-}
-
-static inline void
-implicit_conversion_to_float(VALUE val)
-{
- special_const_to_float(val, "no implicit conversion to float from ", "");
-}
-
-static int
-to_float(VALUE *valp)
-{
- VALUE val = *valp;
- if (SPECIAL_CONST_P(val)) {
- if (FIXNUM_P(val)) {
- *valp = DBL2NUM(fix2dbl_without_to_f(val));
- return T_FLOAT;
- }
- else if (FLONUM_P(val)) {
- return T_FLOAT;
- }
- else {
- conversion_to_float(val);
- }
- }
- else {
- int type = BUILTIN_TYPE(val);
- switch (type) {
- case T_FLOAT:
- return T_FLOAT;
- case T_BIGNUM:
- *valp = DBL2NUM(big2dbl_without_to_f(val));
- return T_FLOAT;
- case T_RATIONAL:
- *valp = DBL2NUM(rat2dbl_without_to_f(val));
- return T_FLOAT;
- case T_STRING:
- return T_STRING;
- }
- }
- return T_NONE;
-}
-
-/*!
- * Equivalent to \c Kernel\#Float in Ruby.
- *
- * Converts \a val into \c Float in a slightly more strict manner
- * than \c #to_f.
- */
VALUE
rb_Float(VALUE val)
{
- switch (to_float(&val)) {
+ switch (TYPE(val)) {
+ case T_FIXNUM:
+ return DBL2NUM((double)FIX2LONG(val));
+
case T_FLOAT:
return val;
+
+ case T_BIGNUM:
+ return DBL2NUM(rb_big2dbl(val));
+
case T_STRING:
return DBL2NUM(rb_str_to_dbl(val, TRUE));
+
+ case T_NIL:
+ rb_raise(rb_eTypeError, "can't convert nil into Float");
+ break;
+
+ default:
+ return rb_convert_type(val, T_FLOAT, "Float", "to_f");
}
- return rb_convert_type(val, T_FLOAT, "Float", "to_f");
-}
-FUNC_MINIMIZED(static VALUE rb_f_float(VALUE obj, VALUE arg)); /*!< \private */
+ UNREACHABLE;
+}
/*
* call-seq:
* Float(arg) -> float
*
* Returns <i>arg</i> converted to a float. Numeric types are converted
- * directly, and with exception to string and nil the rest are converted using <i>arg</i>.to_f.
- * Converting a <code>string</code> with invalid characters will result in a <code>ArgumentError</code>.
- * Converting <code>nil</code> generates a <code>TypeError</code>.
- *
- * Float(1) #=> 1.0
- * Float("123.456") #=> 123.456
- * Float("123.0_badstring") #=> ArgumentError: invalid value for Float(): "123.0_badstring"
- * Float(nil) #=> TypeError: can't convert nil into Float
+ * directly, the rest are converted using <i>arg</i>.to_f. As of Ruby
+ * 1.8, converting <code>nil</code> generates a <code>TypeError</code>.
+ *
+ * Float(1) #=> 1.0
+ * Float("123.456") #=> 123.456
*/
static VALUE
@@ -3457,38 +2959,20 @@ rb_f_float(VALUE obj, VALUE arg)
return rb_Float(arg);
}
-static VALUE
-numeric_to_float(VALUE val)
-{
- if (!rb_obj_is_kind_of(val, rb_cNumeric)) {
- rb_raise(rb_eTypeError, "can't convert %"PRIsVALUE" into Float",
- rb_obj_class(val));
- }
- return rb_convert_type(val, T_FLOAT, "Float", "to_f");
-}
-
-/*!
- * Converts a \c Numeric object into \c Float.
- * \param[in] val a \c Numeric object
- * \exception TypeError if \a val is not a \c Numeric or other conversion failures.
- */
VALUE
rb_to_float(VALUE val)
{
- switch (to_float(&val)) {
- case T_FLOAT:
- return val;
+ if (RB_TYPE_P(val, T_FLOAT)) return val;
+ if (!rb_obj_is_kind_of(val, rb_cNumeric)) {
+ rb_raise(rb_eTypeError, "can't convert %s into Float",
+ NIL_P(val) ? "nil" :
+ val == Qtrue ? "true" :
+ val == Qfalse ? "false" :
+ rb_obj_classname(val));
}
- return numeric_to_float(val);
+ return rb_convert_type(val, T_FLOAT, "Float", "to_f");
}
-/*!
- * Tries to convert an object into \c Float.
- * It calls \c #to_f if necessary.
- *
- * It returns \c Qnil if the object is not a \c Numeric
- * or \c #to_f is not defined on the object.
- */
VALUE
rb_check_to_float(VALUE val)
{
@@ -3499,97 +2983,34 @@ rb_check_to_float(VALUE val)
return rb_check_convert_type(val, T_FLOAT, "Float", "to_f");
}
-static ID id_to_f;
-
-static inline int
-basic_to_f_p(VALUE klass)
-{
- return rb_method_basic_definition_p(klass, id_to_f);
-}
-
-/*! \private */
-double
-rb_num_to_dbl(VALUE val)
-{
- if (SPECIAL_CONST_P(val)) {
- if (FIXNUM_P(val)) {
- if (basic_to_f_p(rb_cInteger))
- return fix2dbl_without_to_f(val);
- }
- else if (FLONUM_P(val)) {
- return rb_float_flonum_value(val);
- }
- else {
- conversion_to_float(val);
- }
- }
- else {
- switch (BUILTIN_TYPE(val)) {
- case T_FLOAT:
- return rb_float_noflonum_value(val);
- case T_BIGNUM:
- if (basic_to_f_p(rb_cInteger))
- return big2dbl_without_to_f(val);
- break;
- case T_RATIONAL:
- if (basic_to_f_p(rb_cRational))
- return rat2dbl_without_to_f(val);
- break;
- }
- }
- val = numeric_to_float(val);
- return RFLOAT_VALUE(val);
-}
-
-/*!
- * Converts a \c Numeric object to \c double.
- * \param[in] val a \c Numeric object
- * \return the converted value
- * \exception TypeError if \a val is not a \c Numeric or
- * it does not support conversion to a floating point number.
- */
double
rb_num2dbl(VALUE val)
{
- if (SPECIAL_CONST_P(val)) {
- if (FIXNUM_P(val)) {
- return fix2dbl_without_to_f(val);
- }
- else if (FLONUM_P(val)) {
- return rb_float_flonum_value(val);
- }
- else {
- implicit_conversion_to_float(val);
- }
- }
- else {
- switch (BUILTIN_TYPE(val)) {
- case T_FLOAT:
- return rb_float_noflonum_value(val);
- case T_BIGNUM:
- return big2dbl_without_to_f(val);
- case T_RATIONAL:
- return rat2dbl_without_to_f(val);
- case T_STRING:
- rb_raise(rb_eTypeError, "no implicit conversion to float from string");
- }
+ switch (TYPE(val)) {
+ case T_FLOAT:
+ return RFLOAT_VALUE(val);
+
+ case T_STRING:
+ rb_raise(rb_eTypeError, "no implicit conversion to float from string");
+ break;
+
+ case T_NIL:
+ rb_raise(rb_eTypeError, "no implicit conversion to float from nil");
+ break;
+
+ default:
+ break;
}
- val = rb_convert_type(val, T_FLOAT, "Float", "to_f");
- return RFLOAT_VALUE(val);
+
+ return RFLOAT_VALUE(rb_Float(val));
}
-/*!
- * Equivalent to \c Kernel\#String in Ruby.
- *
- * Converts \a val into \c String by trying \c #to_str at first and
- * then trying \c #to_s.
- */
VALUE
rb_String(VALUE val)
{
VALUE tmp = rb_check_string_type(val);
if (NIL_P(tmp))
- tmp = rb_convert_type_with_id(val, T_STRING, "String", idTo_s);
+ tmp = rb_convert_type(val, T_STRING, "String", "to_s");
return tmp;
}
@@ -3598,9 +3019,8 @@ rb_String(VALUE val)
* call-seq:
* String(arg) -> string
*
- * Returns <i>arg</i> as a <code>String</code>.
- *
- * First tries to call its <code>to_str</code> method, then its <code>to_s</code> method.
+ * Converts <i>arg</i> to a <code>String</code> by calling its
+ * <code>to_s</code> method.
*
* String(self) #=> "main"
* String(self.class) #=> "Object"
@@ -3613,16 +3033,13 @@ rb_f_string(VALUE obj, VALUE arg)
return rb_String(arg);
}
-/*!
- * Equivalent to \c Kernel\#Array in Ruby.
- */
VALUE
rb_Array(VALUE val)
{
VALUE tmp = rb_check_array_type(val);
if (NIL_P(tmp)) {
- tmp = rb_check_convert_type_with_id(val, T_ARRAY, "Array", idTo_a);
+ tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_a");
if (NIL_P(tmp)) {
return rb_ary_new3(1, val);
}
@@ -3636,18 +3053,9 @@ rb_Array(VALUE val)
*
* Returns +arg+ as an Array.
*
- * First tries to call <code>to_ary</code> on +arg+, then <code>to_a</code>.
- * If +arg+ does not respond to <code>to_ary</code> or <code>to_a</code>,
- * returns an Array of length 1 containing +arg+.
+ * First tries to call Array#to_ary on +arg+, then Array#to_a.
*
- * If <code>to_ary</code> or <code>to_a</code> returns something other than
- * an Array, raises a <code>TypeError</code>.
- *
- * Array(["a", "b"]) #=> ["a", "b"]
- * Array(1..5) #=> [1, 2, 3, 4, 5]
- * Array(key: :value) #=> [[:key, :value]]
- * Array(nil) #=> []
- * Array(1) #=> [1]
+ * Array(1..5) #=> [1, 2, 3, 4, 5]
*/
static VALUE
@@ -3656,9 +3064,6 @@ rb_f_array(VALUE obj, VALUE arg)
return rb_Array(arg);
}
-/**
- * Equivalent to \c Kernel\#Hash in Ruby
- */
VALUE
rb_Hash(VALUE val)
{
@@ -3694,70 +3099,6 @@ rb_f_hash(VALUE obj, VALUE arg)
return rb_Hash(arg);
}
-/*! \private */
-struct dig_method {
- VALUE klass;
- int basic;
-};
-
-static ID id_dig;
-
-static int
-dig_basic_p(VALUE obj, struct dig_method *cache)
-{
- VALUE klass = RBASIC_CLASS(obj);
- if (klass != cache->klass) {
- cache->klass = klass;
- cache->basic = rb_method_basic_definition_p(klass, id_dig);
- }
- return cache->basic;
-}
-
-static void
-no_dig_method(int found, VALUE recv, ID mid, int argc, const VALUE *argv, VALUE data)
-{
- if (!found) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE" does not have #dig method",
- CLASS_OF(data));
- }
-}
-
-/*! \private */
-VALUE
-rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
-{
- struct dig_method hash = {Qnil}, ary = {Qnil}, strt = {Qnil};
-
- for (; argc > 0; ++argv, --argc) {
- if (NIL_P(obj)) return notfound;
- if (!SPECIAL_CONST_P(obj)) {
- switch (BUILTIN_TYPE(obj)) {
- case T_HASH:
- if (dig_basic_p(obj, &hash)) {
- obj = rb_hash_aref(obj, *argv);
- continue;
- }
- break;
- case T_ARRAY:
- if (dig_basic_p(obj, &ary)) {
- obj = rb_ary_at(obj, *argv);
- continue;
- }
- break;
- case T_STRUCT:
- if (dig_basic_p(obj, &strt)) {
- obj = rb_struct_lookup(obj, *argv);
- continue;
- }
- break;
- }
- }
- return rb_check_funcall_with_hook(obj, id_dig, argc, argv,
- no_dig_method, obj);
- }
- return obj;
-}
-
/*
* Document-class: Class
*
@@ -3767,7 +3108,7 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
* Typically, you create a new class by using:
*
* class Name
- * # some code describing the class behavior
+ * # some class describing the class behavior
* end
*
* When a new class is created, an object of type Class is initialized and
@@ -3779,17 +3120,19 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
* <code>Class</code>:
*
* class Class
- * alias old_new new
- * def new(*args)
- * print "Creating a new ", self.name, "\n"
- * old_new(*args)
- * end
- * end
+ * alias oldNew new
+ * def new(*args)
+ * print "Creating a new ", self.name, "\n"
+ * oldNew(*args)
+ * end
+ * end
+ *
+ *
+ * class Name
+ * end
*
- * class Name
- * end
*
- * n = Name.new
+ * n = Name.new
*
* <em>produces:</em>
*
@@ -3797,7 +3140,7 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
*
* Classes, modules, and objects are interrelated. In the diagram
* that follows, the vertical arrows represent inheritance, and the
- * parentheses metaclasses. All metaclasses are instances
+ * parentheses meta-classes. All metaclasses are instances
* of the class `Class'.
* +---------+ +-...
* | | |
@@ -3821,6 +3164,24 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
*/
+/*!
+ * Initializes the world of objects and classes.
+ *
+ * At first, the function bootstraps the class hierarchy.
+ * It initializes the most fundamental classes and their metaclasses.
+ * - \c BasicObject
+ * - \c Object
+ * - \c Module
+ * - \c Class
+ * After the bootstrap step, the class hierarchy becomes as the following
+ * diagram.
+ *
+ * \image html boottime-classes.png
+ *
+ * Then, the function defines classes, modules and methods as usual.
+ * \ingroup class
+ */
+
/* Document-class: BasicObject
*
* BasicObject is the parent class of all classes in Ruby. It's an explicit
@@ -3840,7 +3201,7 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
*
* BasicObject does not include Kernel (for methods like +puts+) and
* BasicObject is outside of the namespace of the standard library so common
- * classes will not be found without using a full class path.
+ * classes will not be found without a using a full class path.
*
* A variety of strategies can be used to provide useful portions of the
* standard library to subclasses of BasicObject. A subclass could
@@ -3878,7 +3239,7 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
*
* Object is the default root of all Ruby objects. Object inherits from
* BasicObject which allows creating alternate object hierarchies. Methods
- * on Object are available to all classes unless explicitly overridden.
+ * on object are available to all classes unless explicitly overridden.
*
* Object mixes in the Kernel module, making the built-in kernel functions
* globally accessible. Although the instance methods of Object are defined
@@ -3893,29 +3254,8 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
* <code>:name</code>).
*/
-/*!
- *--
- * \private
- * Initializes the world of objects and classes.
- *
- * At first, the function bootstraps the class hierarchy.
- * It initializes the most fundamental classes and their metaclasses.
- * - \c BasicObject
- * - \c Object
- * - \c Module
- * - \c Class
- * After the bootstrap step, the class hierarchy becomes as the following
- * diagram.
- *
- * \image html boottime-classes.png
- *
- * Then, the function defines classes, modules and methods as usual.
- * \ingroup class
- *++
- */
-
void
-InitVM_Object(void)
+Init_Object(void)
{
Init_class_hierarchy();
@@ -3973,10 +3313,9 @@ InitVM_Object(void)
rb_define_method(rb_mKernel, "class", rb_obj_class, 0);
rb_define_method(rb_mKernel, "singleton_class", rb_obj_singleton_class, 0);
- rb_define_method(rb_mKernel, "clone", rb_obj_clone2, -1);
+ rb_define_method(rb_mKernel, "clone", rb_obj_clone, 0);
rb_define_method(rb_mKernel, "dup", rb_obj_dup, 0);
rb_define_method(rb_mKernel, "itself", rb_obj_itself, 0);
- rb_define_method(rb_mKernel, "yield_self", rb_obj_yield_self, 0);
rb_define_method(rb_mKernel, "initialize_copy", rb_obj_init_copy, 1);
rb_define_method(rb_mKernel, "initialize_dup", rb_obj_init_dup_clone, 1);
rb_define_method(rb_mKernel, "initialize_clone", rb_obj_init_dup_clone, 1);
@@ -4029,16 +3368,14 @@ InitVM_Object(void)
rb_define_method(rb_cNilClass, "&", false_and, 1);
rb_define_method(rb_cNilClass, "|", false_or, 1);
rb_define_method(rb_cNilClass, "^", false_xor, 1);
- rb_define_method(rb_cNilClass, "===", rb_equal, 1);
rb_define_method(rb_cNilClass, "nil?", rb_true, 0);
rb_undef_alloc_func(rb_cNilClass);
rb_undef_method(CLASS_OF(rb_cNilClass), "new");
/*
- * An obsolete alias of +nil+
+ * An alias of +nil+
*/
rb_define_global_const("NIL", Qnil);
- rb_deprecate_constant(rb_cObject, "NIL");
rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);
@@ -4056,10 +3393,10 @@ InitVM_Object(void)
rb_define_method(rb_cModule, "name", rb_mod_name, 0); /* in variable.c */
rb_define_method(rb_cModule, "ancestors", rb_mod_ancestors, 0); /* in class.c */
- rb_define_method(rb_cModule, "attr", rb_mod_attr, -1);
- rb_define_method(rb_cModule, "attr_reader", rb_mod_attr_reader, -1);
- rb_define_method(rb_cModule, "attr_writer", rb_mod_attr_writer, -1);
- rb_define_method(rb_cModule, "attr_accessor", rb_mod_attr_accessor, -1);
+ rb_define_private_method(rb_cModule, "attr", rb_mod_attr, -1);
+ rb_define_private_method(rb_cModule, "attr_reader", rb_mod_attr_reader, -1);
+ rb_define_private_method(rb_cModule, "attr_writer", rb_mod_attr_writer, -1);
+ rb_define_private_method(rb_cModule, "attr_accessor", rb_mod_attr_accessor, -1);
rb_define_alloc_func(rb_cModule, rb_module_s_alloc);
rb_define_method(rb_cModule, "initialize", rb_mod_initialize, 0);
@@ -4089,11 +3426,10 @@ InitVM_Object(void)
rb_define_method(rb_cModule, "class_variable_defined?", rb_mod_cvar_defined, 1);
rb_define_method(rb_cModule, "public_constant", rb_mod_public_constant, -1); /* in variable.c */
rb_define_method(rb_cModule, "private_constant", rb_mod_private_constant, -1); /* in variable.c */
- rb_define_method(rb_cModule, "deprecate_constant", rb_mod_deprecate_constant, -1); /* in variable.c */
rb_define_method(rb_cModule, "singleton_class?", rb_mod_singleton_p, 0);
- rb_define_method(rb_cClass, "allocate", rb_class_alloc, 0);
- rb_define_method(rb_cClass, "new", rb_class_s_new, -1);
+ rb_define_method(rb_cClass, "allocate", rb_obj_alloc, 0);
+ rb_define_method(rb_cClass, "new", rb_class_new_instance, -1);
rb_define_method(rb_cClass, "initialize", rb_class_initialize, -1);
rb_define_method(rb_cClass, "superclass", rb_class_superclass, 0);
rb_define_alloc_func(rb_cClass, rb_class_s_alloc);
@@ -4104,12 +3440,11 @@ InitVM_Object(void)
/*
* Document-class: Data
*
- * This is a deprecated class, base class for C extensions using
- * Data_Make_Struct or Data_Wrap_Struct.
+ * This is a recommended base class for C extensions using Data_Make_Struct
+ * or Data_Wrap_Struct, see README.EXT for details.
*/
rb_cData = rb_define_class("Data", rb_cObject);
rb_undef_alloc_func(rb_cData);
- rb_deprecate_constant(rb_cObject, "Data");
rb_cTrueClass = rb_define_class("TrueClass", rb_cObject);
rb_define_method(rb_cTrueClass, "to_s", true_to_s, 0);
@@ -4117,14 +3452,12 @@ InitVM_Object(void)
rb_define_method(rb_cTrueClass, "&", true_and, 1);
rb_define_method(rb_cTrueClass, "|", true_or, 1);
rb_define_method(rb_cTrueClass, "^", true_xor, 1);
- rb_define_method(rb_cTrueClass, "===", rb_equal, 1);
rb_undef_alloc_func(rb_cTrueClass);
rb_undef_method(CLASS_OF(rb_cTrueClass), "new");
/*
- * An obsolete alias of +true+
+ * An alias of +true+
*/
rb_define_global_const("TRUE", Qtrue);
- rb_deprecate_constant(rb_cObject, "TRUE");
rb_cFalseClass = rb_define_class("FalseClass", rb_cObject);
rb_define_method(rb_cFalseClass, "to_s", false_to_s, 0);
@@ -4132,24 +3465,10 @@ InitVM_Object(void)
rb_define_method(rb_cFalseClass, "&", false_and, 1);
rb_define_method(rb_cFalseClass, "|", false_or, 1);
rb_define_method(rb_cFalseClass, "^", false_xor, 1);
- rb_define_method(rb_cFalseClass, "===", rb_equal, 1);
rb_undef_alloc_func(rb_cFalseClass);
rb_undef_method(CLASS_OF(rb_cFalseClass), "new");
/*
- * An obsolete alias of +false+
+ * An alias of +false+
*/
rb_define_global_const("FALSE", Qfalse);
- rb_deprecate_constant(rb_cObject, "FALSE");
}
-
-void
-Init_Object(void)
-{
- id_to_f = rb_intern_const("to_f");
- id_dig = rb_intern_const("dig");
- InitVM(Object);
-}
-
-/*!
- * \}
- */
diff --git a/pack.c b/pack.c
index 6197c85233..fcf3a3a2a0 100644
--- a/pack.c
+++ b/pack.c
@@ -9,6 +9,8 @@
**********************************************************************/
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "internal.h"
#include <sys/types.h>
#include <ctype.h>
@@ -23,11 +25,11 @@
* This behavior is consistent with the document of pack/unpack.
*/
#ifdef HAVE_TRUE_LONG_LONG
-static const char natstr[] = "sSiIlLqQjJ";
+static const char natstr[] = "sSiIlLqQ";
#else
-static const char natstr[] = "sSiIlLjJ";
+static const char natstr[] = "sSiIlL";
#endif
-static const char endstr[] = "sSiIlLqQjJ";
+static const char endstr[] = "sSiIlLqQ";
#ifdef HAVE_TRUE_LONG_LONG
/* It is intentional to use long long instead of LONG_LONG. */
@@ -68,18 +70,59 @@ static const char endstr[] = "sSiIlLqQjJ";
# define NATINT_LEN(type,len) ((int)sizeof(type))
#endif
-typedef union {
- float f;
- uint32_t u;
- char buf[4];
-} FLOAT_SWAPPER;
-typedef union {
- double d;
- uint64_t u;
- char buf[8];
-} DOUBLE_SWAPPER;
-#define swapf(x) swap32(x)
-#define swapd(x) swap64(x)
+#define define_swapx(x, xtype) \
+static xtype \
+TOKEN_PASTE(swap,x)(xtype z) \
+{ \
+ xtype r; \
+ xtype *zp; \
+ unsigned char *s, *t; \
+ int i; \
+ \
+ zp = xmalloc(sizeof(xtype)); \
+ *zp = z; \
+ s = (unsigned char*)zp; \
+ t = xmalloc(sizeof(xtype)); \
+ for (i=0; i<sizeof(xtype); i++) { \
+ t[sizeof(xtype)-i-1] = s[i]; \
+ } \
+ r = *(xtype *)t; \
+ xfree(t); \
+ xfree(zp); \
+ return r; \
+}
+
+#if SIZEOF_FLOAT == 4 && defined(HAVE_INT32_T)
+# define swapf(x) swap32(x)
+# define FLOAT_SWAPPER uint32_t
+#else
+ define_swapx(f,float)
+#endif
+
+#if SIZEOF_DOUBLE == 8 && defined(HAVE_INT64_T)
+# define swapd(x) swap64(x)
+# define DOUBLE_SWAPPER uint64_t
+#elif SIZEOF_DOUBLE == 8 && defined(HAVE_INT32_T)
+ static double
+ swapd(const double d)
+ {
+ double dtmp = d;
+ uint32_t utmp[2];
+ uint32_t utmp0;
+
+ utmp[0] = 0; utmp[1] = 0;
+ memcpy(utmp,&dtmp,sizeof(double));
+ utmp0 = utmp[0];
+ utmp[0] = swap32(utmp[1]);
+ utmp[1] = swap32(utmp0);
+ memcpy(&dtmp,utmp,sizeof(double));
+ return dtmp;
+ }
+#else
+ define_swapx(d, double)
+#endif
+
+#undef define_swapx
#define rb_ntohf(x) (BIGENDIAN_P()?(x):swapf(x))
#define rb_ntohd(x) (BIGENDIAN_P()?(x):swapd(x))
@@ -90,17 +133,57 @@ typedef union {
#define rb_vtohf(x) (BIGENDIAN_P()?swapf(x):(x))
#define rb_vtohd(x) (BIGENDIAN_P()?swapd(x):(x))
-#define FLOAT_CONVWITH(x) FLOAT_SWAPPER x;
-#define HTONF(x) ((x).u = rb_htonf((x).u))
-#define HTOVF(x) ((x).u = rb_htovf((x).u))
-#define NTOHF(x) ((x).u = rb_ntohf((x).u))
-#define VTOHF(x) ((x).u = rb_vtohf((x).u))
+#ifdef FLOAT_SWAPPER
+# define FLOAT_CONVWITH(y) FLOAT_SWAPPER y;
+# define HTONF(x,y) (memcpy(&(y),&(x),sizeof(float)), \
+ (y) = rb_htonf((FLOAT_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(float)), \
+ (x))
+# define HTOVF(x,y) (memcpy(&(y),&(x),sizeof(float)), \
+ (y) = rb_htovf((FLOAT_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(float)), \
+ (x))
+# define NTOHF(x,y) (memcpy(&(y),&(x),sizeof(float)), \
+ (y) = rb_ntohf((FLOAT_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(float)), \
+ (x))
+# define VTOHF(x,y) (memcpy(&(y),&(x),sizeof(float)), \
+ (y) = rb_vtohf((FLOAT_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(float)), \
+ (x))
+#else
+# define FLOAT_CONVWITH(y)
+# define HTONF(x,y) rb_htonf(x)
+# define HTOVF(x,y) rb_htovf(x)
+# define NTOHF(x,y) rb_ntohf(x)
+# define VTOHF(x,y) rb_vtohf(x)
+#endif
-#define DOUBLE_CONVWITH(x) DOUBLE_SWAPPER x;
-#define HTOND(x) ((x).u = rb_htond((x).u))
-#define HTOVD(x) ((x).u = rb_htovd((x).u))
-#define NTOHD(x) ((x).u = rb_ntohd((x).u))
-#define VTOHD(x) ((x).u = rb_vtohd((x).u))
+#ifdef DOUBLE_SWAPPER
+# define DOUBLE_CONVWITH(y) DOUBLE_SWAPPER y;
+# define HTOND(x,y) (memcpy(&(y),&(x),sizeof(double)), \
+ (y) = rb_htond((DOUBLE_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(double)), \
+ (x))
+# define HTOVD(x,y) (memcpy(&(y),&(x),sizeof(double)), \
+ (y) = rb_htovd((DOUBLE_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(double)), \
+ (x))
+# define NTOHD(x,y) (memcpy(&(y),&(x),sizeof(double)), \
+ (y) = rb_ntohd((DOUBLE_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(double)), \
+ (x))
+# define VTOHD(x,y) (memcpy(&(y),&(x),sizeof(double)), \
+ (y) = rb_vtohd((DOUBLE_SWAPPER)(y)), \
+ memcpy(&(x),&(y),sizeof(double)), \
+ (x))
+#else
+# define DOUBLE_CONVWITH(y)
+# define HTOND(x,y) rb_htond(x)
+# define HTOVD(x,y) rb_htovd(x)
+# define NTOHD(x,y) rb_ntohd(x)
+# define VTOHD(x,y) rb_vtohd(x)
+#endif
#define MAX_INTEGER_PACK_SIZE 8
@@ -116,20 +199,43 @@ static ID id_associated;
static void
str_associate(VALUE str, VALUE add)
{
- /* assert(NIL_P(rb_attr_get(str, id_associated))); */
- rb_ivar_set(str, id_associated, add);
+ VALUE assoc;
+
+ assoc = rb_attr_get(str, id_associated);
+ if (RB_TYPE_P(assoc, T_ARRAY)) {
+ /* already associated */
+ rb_ary_concat(assoc, add);
+ }
+ else {
+ rb_ivar_set(str, id_associated, add);
+ }
}
static VALUE
str_associated(VALUE str)
{
- return rb_ivar_lookup(str, id_associated, Qfalse);
+ VALUE assoc = rb_attr_get(str, id_associated);
+ if (NIL_P(assoc)) assoc = Qfalse;
+ return assoc;
+}
+
+void
+rb_str_associate(VALUE str, VALUE add)
+{
+ rb_warn("rb_str_associate() is only for internal use and deprecated; do not use");
+ str_associate(str, add);
+}
+
+VALUE
+rb_str_associated(VALUE str)
+{
+ rb_warn("rb_str_associated() is only for internal use and deprecated; do not use");
+ return str_associated(str);
}
/*
* call-seq:
- * arr.pack( aTemplateString ) -> aBinaryString
- * arr.pack( aTemplateString, buffer: aBufferString ) -> aBufferString
+ * arr.pack ( aTemplateString ) -> aBinaryString
*
* Packs the contents of <i>arr</i> into a binary sequence according to
* the directives in <i>aTemplateString</i> (see the table below)
@@ -151,119 +257,101 @@ str_associated(VALUE str)
* a.pack("a3a3a3") #=> "a\000\000b\000\000c\000\000"
* n.pack("ccc") #=> "ABC"
*
- * If <i>aBufferString</i> is specified and its capacity is enough,
- * +pack+ uses it as the buffer and returns it.
- * When the offset is specified by the beginning of <i>aTemplateString</i>,
- * the result is filled after the offset.
- * If original contents of <i>aBufferString</i> exists and it's longer than
- * the offset, the rest of <i>offsetOfBuffer</i> are overwritten by the result.
- * If it's shorter, the gap is filled with ``<code>\0</code>''.
- *
- * Note that ``buffer:'' option does not guarantee not to allocate memory
- * in +pack+. If the capacity of <i>aBufferString</i> is not enough,
- * +pack+ allocates memory.
- *
* Directives for +pack+.
*
- * Integer | Array |
- * Directive | Element | Meaning
- * ----------------------------------------------------------------------------
- * C | Integer | 8-bit unsigned (unsigned char)
- * S | Integer | 16-bit unsigned, native endian (uint16_t)
- * L | Integer | 32-bit unsigned, native endian (uint32_t)
- * Q | Integer | 64-bit unsigned, native endian (uint64_t)
- * J | Integer | pointer width unsigned, native endian (uintptr_t)
- * | | (J is available since Ruby 2.3.)
- * | |
- * c | Integer | 8-bit signed (signed char)
- * s | Integer | 16-bit signed, native endian (int16_t)
- * l | Integer | 32-bit signed, native endian (int32_t)
- * q | Integer | 64-bit signed, native endian (int64_t)
- * j | Integer | pointer width signed, native endian (intptr_t)
- * | | (j is available since Ruby 2.3.)
- * | |
- * S_ S! | Integer | unsigned short, native endian
- * I I_ I! | Integer | unsigned int, native endian
- * L_ L! | Integer | unsigned long, native endian
- * Q_ Q! | Integer | unsigned long long, native endian (ArgumentError
- * | | if the platform has no long long type.)
- * | | (Q_ and Q! is available since Ruby 2.1.)
- * J! | Integer | uintptr_t, native endian (same with J)
- * | | (J! is available since Ruby 2.3.)
- * | |
- * s_ s! | Integer | signed short, native endian
- * i i_ i! | Integer | signed int, native endian
- * l_ l! | Integer | signed long, native endian
- * q_ q! | Integer | signed long long, native endian (ArgumentError
- * | | if the platform has no long long type.)
- * | | (q_ and q! is available since Ruby 2.1.)
- * j! | Integer | intptr_t, native endian (same with j)
- * | | (j! is available since Ruby 2.3.)
- * | |
- * S> s> S!> s!> | Integer | same as the directives without ">" except
- * L> l> L!> l!> | | big endian
- * I!> i!> | | (available since Ruby 1.9.3)
- * Q> q> Q!> q!> | | "S>" is same as "n"
- * J> j> J!> j!> | | "L>" is same as "N"
- * | |
- * S< s< S!< s!< | Integer | same as the directives without "<" except
- * L< l< L!< l!< | | little endian
- * I!< i!< | | (available since Ruby 1.9.3)
- * Q< q< Q!< q!< | | "S<" is same as "v"
- * J< j< J!< j!< | | "L<" is same as "V"
- * | |
- * n | Integer | 16-bit unsigned, network (big-endian) byte order
- * N | Integer | 32-bit unsigned, network (big-endian) byte order
- * v | Integer | 16-bit unsigned, VAX (little-endian) byte order
- * V | Integer | 32-bit unsigned, VAX (little-endian) byte order
- * | |
- * U | Integer | UTF-8 character
- * w | Integer | BER-compressed integer
- *
- * Float | Array |
+ * Integer | Array |
* Directive | Element | Meaning
* ---------------------------------------------------------------------------
- * D d | Float | double-precision, native format
- * F f | Float | single-precision, native format
- * E | Float | double-precision, little-endian byte order
- * e | Float | single-precision, little-endian byte order
- * G | Float | double-precision, network (big-endian) byte order
- * g | Float | single-precision, network (big-endian) byte order
+ * C | Integer | 8-bit unsigned (unsigned char)
+ * S | Integer | 16-bit unsigned, native endian (uint16_t)
+ * L | Integer | 32-bit unsigned, native endian (uint32_t)
+ * Q | Integer | 64-bit unsigned, native endian (uint64_t)
+ * | |
+ * c | Integer | 8-bit signed (signed char)
+ * s | Integer | 16-bit signed, native endian (int16_t)
+ * l | Integer | 32-bit signed, native endian (int32_t)
+ * q | Integer | 64-bit signed, native endian (int64_t)
+ * | |
+ * S_, S! | Integer | unsigned short, native endian
+ * I, I_, I! | Integer | unsigned int, native endian
+ * L_, L! | Integer | unsigned long, native endian
+ * Q_, Q! | Integer | unsigned long long, native endian (ArgumentError
+ * | | if the platform has no long long type.)
+ * | | (Q_ and Q! is available since Ruby 2.1.)
+ * | |
+ * s_, s! | Integer | signed short, native endian
+ * i, i_, i! | Integer | signed int, native endian
+ * l_, l! | Integer | signed long, native endian
+ * q_, q! | Integer | signed long long, native endian (ArgumentError
+ * | | if the platform has no long long type.)
+ * | | (q_ and q! is available since Ruby 2.1.)
+ * | |
+ * S> L> Q> | Integer | same as the directives without ">" except
+ * s> l> q> | | big endian
+ * S!> I!> | | (available since Ruby 1.9.3)
+ * L!> Q!> | | "S>" is same as "n"
+ * s!> i!> | | "L>" is same as "N"
+ * l!> q!> | |
+ * | |
+ * S< L< Q< | Integer | same as the directives without "<" except
+ * s< l< q< | | little endian
+ * S!< I!< | | (available since Ruby 1.9.3)
+ * L!< Q!< | | "S<" is same as "v"
+ * s!< i!< | | "L<" is same as "V"
+ * l!< q!< | |
+ * | |
+ * n | Integer | 16-bit unsigned, network (big-endian) byte order
+ * N | Integer | 32-bit unsigned, network (big-endian) byte order
+ * v | Integer | 16-bit unsigned, VAX (little-endian) byte order
+ * V | Integer | 32-bit unsigned, VAX (little-endian) byte order
+ * | |
+ * U | Integer | UTF-8 character
+ * w | Integer | BER-compressed integer
*
- * String | Array |
- * Directive | Element | Meaning
+ * Float | |
+ * Directive | | Meaning
+ * ---------------------------------------------------------------------------
+ * D, d | Float | double-precision, native format
+ * F, f | Float | single-precision, native format
+ * E | Float | double-precision, little-endian byte order
+ * e | Float | single-precision, little-endian byte order
+ * G | Float | double-precision, network (big-endian) byte order
+ * g | Float | single-precision, network (big-endian) byte order
+ *
+ * String | |
+ * Directive | | Meaning
* ---------------------------------------------------------------------------
- * A | String | arbitrary binary string (space padded, count is width)
- * a | String | arbitrary binary string (null padded, count is width)
- * Z | String | same as ``a'', except that null is added with *
- * B | String | bit string (MSB first)
- * b | String | bit string (LSB first)
- * H | String | hex string (high nibble first)
- * h | String | hex string (low nibble first)
- * u | String | UU-encoded string
- * M | String | quoted printable, MIME encoding (see RFC2045)
- * m | String | base64 encoded string (see RFC 2045, count is width)
+ * A | String | arbitrary binary string (space padded, count is width)
+ * a | String | arbitrary binary string (null padded, count is width)
+ * Z | String | same as ``a'', except that null is added with *
+ * B | String | bit string (MSB first)
+ * b | String | bit string (LSB first)
+ * H | String | hex string (high nibble first)
+ * h | String | hex string (low nibble first)
+ * u | String | UU-encoded string
+ * M | String | quoted printable, MIME encoding (see RFC2045)
+ * m | String | base64 encoded string (see RFC 2045, count is width)
* | | (if count is 0, no line feed are added, see RFC 4648)
- * P | String | pointer to a structure (fixed-length string)
- * p | String | pointer to a null-terminated string
+ * P | String | pointer to a structure (fixed-length string)
+ * p | String | pointer to a null-terminated string
*
- * Misc. | Array |
- * Directive | Element | Meaning
+ * Misc. | |
+ * Directive | | Meaning
* ---------------------------------------------------------------------------
- * @ | --- | moves to absolute position
- * X | --- | back up a byte
- * x | --- | null byte
+ * @ | --- | moves to absolute position
+ * X | --- | back up a byte
+ * x | --- | null byte
*/
static VALUE
-pack_pack(int argc, VALUE *argv, VALUE ary)
+pack_pack(VALUE ary, VALUE fmt)
{
static const char nul10[] = "\0\0\0\0\0\0\0\0\0\0";
static const char spc10[] = " ";
const char *p, *pend;
- VALUE fmt, opt = Qnil, res, from, associates = 0, buffer = 0;
+ VALUE res, from, associates = 0;
char type;
- long len, idx, plen;
+ long items, len, idx, plen;
const char *ptr;
int enc_info = 1; /* 0 - BINARY, 1 - US-ASCII, 2 - UTF-8 */
#ifdef NATINT_PACK
@@ -271,32 +359,17 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
#endif
int integer_size, bigendian_p;
- rb_scan_args(argc, argv, "10:", &fmt, &opt);
-
StringValue(fmt);
p = RSTRING_PTR(fmt);
pend = p + RSTRING_LEN(fmt);
- if (!NIL_P(opt)) {
- static ID keyword_ids[1];
- if (!keyword_ids[0])
- CONST_ID(keyword_ids[0], "buffer");
-
- rb_get_kwargs(opt, keyword_ids, 0, 1, &buffer);
-
- if (buffer != Qundef && !RB_TYPE_P(buffer, T_STRING))
- rb_raise(rb_eTypeError, "buffer must be String, not %s", rb_obj_classname(buffer));
- }
- if (buffer)
- res = buffer;
- else
- res = rb_str_buf_new(0);
+ res = rb_str_buf_new(0);
+ items = RARRAY_LEN(ary);
idx = 0;
#define TOO_FEW (rb_raise(rb_eArgError, toofew), 0)
-#define MORE_ITEM (idx < RARRAY_LEN(ary))
-#define THISFROM (MORE_ITEM ? RARRAY_AREF(ary, idx) : TOO_FEW)
-#define NEXTFROM (MORE_ITEM ? RARRAY_AREF(ary, idx++) : TOO_FEW)
+#define THISFROM (items > 0 ? RARRAY_AREF(ary, idx) : TOO_FEW)
+#define NEXTFROM (items-- > 0 ? RARRAY_AREF(ary, idx++) : TOO_FEW)
while (p < pend) {
int explicit_endian = 0;
@@ -348,7 +421,7 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
if (*p == '*') { /* set data length */
len = strchr("@Xxu", type) ? 0
: strchr("PMm", type) ? 1
- : RARRAY_LEN(ary) - idx;
+ : items;
p++;
}
else if (ISDIGIT(*p)) {
@@ -587,16 +660,6 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
bigendian_p = BIGENDIAN_P();
goto pack_integer;
- case 'j': /* j for intptr_t */
- integer_size = sizeof(intptr_t);
- bigendian_p = BIGENDIAN_P();
- goto pack_integer;
-
- case 'J': /* J for uintptr_t */
- integer_size = sizeof(uintptr_t);
- bigendian_p = BIGENDIAN_P();
- goto pack_integer;
-
case 'n': /* 16 bit (2 bytes) integer (network byte-order) */
integer_size = 2;
bigendian_p = 1;
@@ -647,22 +710,25 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
case 'e': /* single precision float in VAX byte-order */
while (len-- > 0) {
- FLOAT_CONVWITH(tmp);
+ float f;
+ FLOAT_CONVWITH(ftmp);
from = NEXTFROM;
- tmp.f = (float)RFLOAT_VALUE(rb_to_float(from));
- HTOVF(tmp);
- rb_str_buf_cat(res, tmp.buf, sizeof(float));
+ f = (float)RFLOAT_VALUE(rb_to_float(from));
+ f = HTOVF(f,ftmp);
+ rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
break;
case 'E': /* double precision float in VAX byte-order */
while (len-- > 0) {
- DOUBLE_CONVWITH(tmp);
+ double d;
+ DOUBLE_CONVWITH(dtmp);
+
from = NEXTFROM;
- tmp.d = RFLOAT_VALUE(rb_to_float(from));
- HTOVD(tmp);
- rb_str_buf_cat(res, tmp.buf, sizeof(double));
+ d = RFLOAT_VALUE(rb_to_float(from));
+ d = HTOVD(d,dtmp);
+ rb_str_buf_cat(res, (char*)&d, sizeof(double));
}
break;
@@ -679,22 +745,25 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
case 'g': /* single precision float in network byte-order */
while (len-- > 0) {
- FLOAT_CONVWITH(tmp);
+ float f;
+ FLOAT_CONVWITH(ftmp);
+
from = NEXTFROM;
- tmp.f = (float)RFLOAT_VALUE(rb_to_float(from));
- HTONF(tmp);
- rb_str_buf_cat(res, tmp.buf, sizeof(float));
+ f = (float)RFLOAT_VALUE(rb_to_float(from));
+ f = HTONF(f,ftmp);
+ rb_str_buf_cat(res, (char*)&f, sizeof(float));
}
break;
case 'G': /* double precision float in network byte-order */
while (len-- > 0) {
- DOUBLE_CONVWITH(tmp);
+ double d;
+ DOUBLE_CONVWITH(dtmp);
from = NEXTFROM;
- tmp.d = RFLOAT_VALUE(rb_to_float(from));
- HTOND(tmp);
- rb_str_buf_cat(res, tmp.buf, sizeof(double));
+ d = RFLOAT_VALUE(rb_to_float(from));
+ d = HTOND(d,dtmp);
+ rb_str_buf_cat(res, (char*)&d, sizeof(double));
}
break;
@@ -749,7 +818,6 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
StringValue(from);
ptr = RSTRING_PTR(from);
plen = RSTRING_LEN(from);
- OBJ_INFECT(res, from);
if (len == 0 && type == 'm') {
encodes(res, ptr, plen, type, 0);
@@ -777,7 +845,6 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
case 'M': /* quoted-printable encoded string */
from = rb_obj_as_string(NEXTFROM);
- OBJ_INFECT(res, from);
if (len <= 1)
len = 72;
qpencode(res, from, len);
@@ -803,7 +870,6 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
}
else {
t = StringValuePtr(from);
- OBJ_INFECT(res, from);
rb_obj_taint(from);
}
if (!associates) {
@@ -846,19 +912,10 @@ pack_pack(int argc, VALUE *argv, VALUE ary)
}
break;
- default: {
- char unknown[5];
- if (ISPRINT(type)) {
- unknown[0] = type;
- unknown[1] = '\0';
- }
- else {
- snprintf(unknown, sizeof(unknown), "\\x%.2x", type & 0xff);
- }
- rb_warning("unknown pack directive '%s' in '% "PRIsVALUE"'",
- unknown, fmt);
+ default:
+ rb_warning("unknown pack directive '%c' in '%s'",
+ type, RSTRING_PTR(fmt));
break;
- }
}
}
@@ -886,14 +943,13 @@ static const char b64_table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static void
-encodes(VALUE str, const char *s0, long len, int type, int tail_lf)
+encodes(VALUE str, const char *s, long len, int type, int tail_lf)
{
enum {buff_size = 4096, encoded_unit = 4, input_unit = 3};
char buff[buff_size + 1]; /* +1 for tail_lf */
long i = 0;
const char *const trans = type == 'u' ? uu_table : b64_table;
char padding;
- const unsigned char *s = (const unsigned char *)s0;
if (type == 'u') {
buff[i++] = (char)len + ' ';
@@ -1010,20 +1066,10 @@ hex2num(char c)
} while (0)
#define PACK_ITEM_ADJUST() do { \
- if (tmp_len > 0 && mode == UNPACK_ARRAY) \
+ if (tmp_len > 0 && !block_p) \
rb_ary_store(ary, RARRAY_LEN(ary)+tmp_len-1, Qnil); \
} while (0)
-/* Workaround for Oracle Developer Studio (Oracle Solaris Studio)
- * 12.4/12.5/12.6 C compiler optimization bug
- * with "-xO4" optimization option.
- */
-#if defined(__SUNPRO_C) && 0x5130 <= __SUNPRO_C && __SUNPRO_C <= 0x5150
-# define AVOID_CC_BUG volatile
-#else
-# define AVOID_CC_BUG
-#endif
-
static VALUE
infected_str_new(const char *ptr, long len, VALUE str)
{
@@ -1033,37 +1079,143 @@ infected_str_new(const char *ptr, long len, VALUE str)
return s;
}
-/* unpack mode */
-#define UNPACK_ARRAY 0
-#define UNPACK_BLOCK 1
-#define UNPACK_1 2
+/*
+ * call-seq:
+ * str.unpack(format) -> anArray
+ *
+ * Decodes <i>str</i> (which may contain binary data) according to the
+ * format string, returning an array of each value extracted. The
+ * format string consists of a sequence of single-character directives,
+ * summarized in the table at the end of this entry.
+ * Each directive may be followed
+ * by a number, indicating the number of times to repeat with this
+ * directive. An asterisk (``<code>*</code>'') will use up all
+ * remaining elements. The directives <code>sSiIlL</code> may each be
+ * followed by an underscore (``<code>_</code>'') or
+ * exclamation mark (``<code>!</code>'') to use the underlying
+ * platform's native size for the specified type; otherwise, it uses a
+ * platform-independent consistent size. Spaces are ignored in the
+ * format string. See also <code>Array#pack</code>.
+ *
+ * "abc \0\0abc \0\0".unpack('A6Z6') #=> ["abc", "abc "]
+ * "abc \0\0".unpack('a3a3') #=> ["abc", " \000\000"]
+ * "abc \0abc \0".unpack('Z*Z*') #=> ["abc ", "abc "]
+ * "aa".unpack('b8B8') #=> ["10000110", "01100001"]
+ * "aaa".unpack('h2H2c') #=> ["16", "61", 97]
+ * "\xfe\xff\xfe\xff".unpack('sS') #=> [-2, 65534]
+ * "now=20is".unpack('M*') #=> ["now is"]
+ * "whole".unpack('xax2aX2aX1aX2a') #=> ["h", "e", "l", "l", "o"]
+ *
+ * This table summarizes the various formats and the Ruby classes
+ * returned by each.
+ *
+ * Integer | |
+ * Directive | Returns | Meaning
+ * -----------------------------------------------------------------
+ * C | Integer | 8-bit unsigned (unsigned char)
+ * S | Integer | 16-bit unsigned, native endian (uint16_t)
+ * L | Integer | 32-bit unsigned, native endian (uint32_t)
+ * Q | Integer | 64-bit unsigned, native endian (uint64_t)
+ * | |
+ * c | Integer | 8-bit signed (signed char)
+ * s | Integer | 16-bit signed, native endian (int16_t)
+ * l | Integer | 32-bit signed, native endian (int32_t)
+ * q | Integer | 64-bit signed, native endian (int64_t)
+ * | |
+ * S_, S! | Integer | unsigned short, native endian
+ * I, I_, I! | Integer | unsigned int, native endian
+ * L_, L! | Integer | unsigned long, native endian
+ * Q_, Q! | Integer | unsigned long long, native endian (ArgumentError
+ * | | if the platform has no long long type.)
+ * | | (Q_ and Q! is available since Ruby 2.1.)
+ * | |
+ * s_, s! | Integer | signed short, native endian
+ * i, i_, i! | Integer | signed int, native endian
+ * l_, l! | Integer | signed long, native endian
+ * q_, q! | Integer | signed long long, native endian (ArgumentError
+ * | | if the platform has no long long type.)
+ * | | (q_ and q! is available since Ruby 2.1.)
+ * | |
+ * S> L> Q> | Integer | same as the directives without ">" except
+ * s> l> q> | | big endian
+ * S!> I!> | | (available since Ruby 1.9.3)
+ * L!> Q!> | | "S>" is same as "n"
+ * s!> i!> | | "L>" is same as "N"
+ * l!> q!> | |
+ * | |
+ * S< L< Q< | Integer | same as the directives without "<" except
+ * s< l< q< | | little endian
+ * S!< I!< | | (available since Ruby 1.9.3)
+ * L!< Q!< | | "S<" is same as "v"
+ * s!< i!< | | "L<" is same as "V"
+ * l!< q!< | |
+ * | |
+ * n | Integer | 16-bit unsigned, network (big-endian) byte order
+ * N | Integer | 32-bit unsigned, network (big-endian) byte order
+ * v | Integer | 16-bit unsigned, VAX (little-endian) byte order
+ * V | Integer | 32-bit unsigned, VAX (little-endian) byte order
+ * | |
+ * U | Integer | UTF-8 character
+ * w | Integer | BER-compressed integer (see Array.pack)
+ *
+ * Float | |
+ * Directive | Returns | Meaning
+ * -----------------------------------------------------------------
+ * D, d | Float | double-precision, native format
+ * F, f | Float | single-precision, native format
+ * E | Float | double-precision, little-endian byte order
+ * e | Float | single-precision, little-endian byte order
+ * G | Float | double-precision, network (big-endian) byte order
+ * g | Float | single-precision, network (big-endian) byte order
+ *
+ * String | |
+ * Directive | Returns | Meaning
+ * -----------------------------------------------------------------
+ * A | String | arbitrary binary string (remove trailing nulls and ASCII spaces)
+ * a | String | arbitrary binary string
+ * Z | String | null-terminated string
+ * B | String | bit string (MSB first)
+ * b | String | bit string (LSB first)
+ * H | String | hex string (high nibble first)
+ * h | String | hex string (low nibble first)
+ * u | String | UU-encoded string
+ * M | String | quoted-printable, MIME encoding (see RFC2045)
+ * m | String | base64 encoded string (RFC 2045) (default)
+ * | | base64 encoded string (RFC 4648) if followed by 0
+ * P | String | pointer to a structure (fixed-length string)
+ * p | String | pointer to a null-terminated string
+ *
+ * Misc. | |
+ * Directive | Returns | Meaning
+ * -----------------------------------------------------------------
+ * @ | --- | skip to the offset given by the length argument
+ * X | --- | skip backward one byte
+ * x | --- | skip forward one byte
+ */
static VALUE
-pack_unpack_internal(VALUE str, VALUE fmt, int mode)
+pack_unpack(VALUE str, VALUE fmt)
{
-#define hexdigits ruby_hexdigits
+ static const char hexdigits[] = "0123456789abcdef";
char *s, *send;
char *p, *pend;
VALUE ary;
char type;
- long len;
- AVOID_CC_BUG long tmp_len;
+ long len, tmp_len;
int star;
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
+ int block_p = rb_block_given_p();
int signed_p, integer_size, bigendian_p;
#define UNPACK_PUSH(item) do {\
VALUE item_val = (item);\
- if ((mode) == UNPACK_BLOCK) {\
+ if (block_p) {\
rb_yield(item_val);\
}\
- else if ((mode) == UNPACK_ARRAY) {\
+ else {\
rb_ary_push(ary, item_val);\
}\
- else /* if ((mode) == UNPACK_1) { */ {\
- return item_val; \
- }\
} while (0)
StringValue(str);
@@ -1073,7 +1225,7 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
p = RSTRING_PTR(fmt);
pend = p + RSTRING_LEN(fmt);
- ary = mode == UNPACK_ARRAY ? rb_ary_new() : Qnil;
+ ary = block_p ? Qnil : rb_ary_new();
while (p < pend) {
int explicit_endian = 0;
type = *p++;
@@ -1130,7 +1282,7 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
else if (ISDIGIT(*p)) {
errno = 0;
len = STRTOUL(p, (char**)&p, 10);
- if (len < 0 || errno) {
+ if (errno) {
rb_raise(rb_eRangeError, "pack length too big");
}
}
@@ -1186,15 +1338,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
if (p[-1] == '*' || len > (send - s) * 8)
len = (send - s) * 8;
bits = 0;
- bitstr = rb_usascii_str_new(0, len);
- OBJ_INFECT(bitstr, str);
+ UNPACK_PUSH(bitstr = rb_usascii_str_new(0, len));
t = RSTRING_PTR(bitstr);
for (i=0; i<len; i++) {
if (i & 7) bits >>= 1;
- else bits = (unsigned char)*s++;
+ else bits = *s++;
*t++ = (bits & 1) ? '1' : '0';
}
- UNPACK_PUSH(bitstr);
}
break;
@@ -1208,15 +1358,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
if (p[-1] == '*' || len > (send - s) * 8)
len = (send - s) * 8;
bits = 0;
- bitstr = rb_usascii_str_new(0, len);
- OBJ_INFECT(bitstr, str);
+ UNPACK_PUSH(bitstr = rb_usascii_str_new(0, len));
t = RSTRING_PTR(bitstr);
for (i=0; i<len; i++) {
if (i & 7) bits <<= 1;
- else bits = (unsigned char)*s++;
+ else bits = *s++;
*t++ = (bits & 128) ? '1' : '0';
}
- UNPACK_PUSH(bitstr);
}
break;
@@ -1230,17 +1378,15 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
if (p[-1] == '*' || len > (send - s) * 2)
len = (send - s) * 2;
bits = 0;
- bitstr = rb_usascii_str_new(0, len);
- OBJ_INFECT(bitstr, str);
+ UNPACK_PUSH(bitstr = rb_usascii_str_new(0, len));
t = RSTRING_PTR(bitstr);
for (i=0; i<len; i++) {
if (i & 1)
bits >>= 4;
else
- bits = (unsigned char)*s++;
+ bits = *s++;
*t++ = hexdigits[bits & 15];
}
- UNPACK_PUSH(bitstr);
}
break;
@@ -1254,17 +1400,15 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
if (p[-1] == '*' || len > (send - s) * 2)
len = (send - s) * 2;
bits = 0;
- bitstr = rb_usascii_str_new(0, len);
- OBJ_INFECT(bitstr, str);
+ UNPACK_PUSH(bitstr = rb_usascii_str_new(0, len));
t = RSTRING_PTR(bitstr);
for (i=0; i<len; i++) {
if (i & 1)
bits <<= 4;
else
- bits = (unsigned char)*s++;
+ bits = *s++;
*t++ = hexdigits[(bits >> 4) & 15];
}
- UNPACK_PUSH(bitstr);
}
break;
@@ -1328,18 +1472,6 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
bigendian_p = BIGENDIAN_P();
goto unpack_integer;
- case 'j':
- signed_p = 1;
- integer_size = sizeof(intptr_t);
- bigendian_p = BIGENDIAN_P();
- goto unpack_integer;
-
- case 'J':
- signed_p = 0;
- integer_size = sizeof(uintptr_t);
- bigendian_p = BIGENDIAN_P();
- goto unpack_integer;
-
case 'n':
signed_p = 0;
integer_size = 2;
@@ -1396,11 +1528,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
case 'e':
PACK_LENGTH_ADJUST_SIZE(sizeof(float));
while (len-- > 0) {
- FLOAT_CONVWITH(tmp);
- memcpy(tmp.buf, s, sizeof(float));
+ float tmp;
+ FLOAT_CONVWITH(ftmp);
+
+ memcpy(&tmp, s, sizeof(float));
s += sizeof(float);
- VTOHF(tmp);
- UNPACK_PUSH(DBL2NUM(tmp.f));
+ tmp = VTOHF(tmp,ftmp);
+ UNPACK_PUSH(DBL2NUM((double)tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1408,11 +1542,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
case 'E':
PACK_LENGTH_ADJUST_SIZE(sizeof(double));
while (len-- > 0) {
- DOUBLE_CONVWITH(tmp);
- memcpy(tmp.buf, s, sizeof(double));
+ double tmp;
+ DOUBLE_CONVWITH(dtmp);
+
+ memcpy(&tmp, s, sizeof(double));
s += sizeof(double);
- VTOHD(tmp);
- UNPACK_PUSH(DBL2NUM(tmp.d));
+ tmp = VTOHD(tmp,dtmp);
+ UNPACK_PUSH(DBL2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1432,11 +1568,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
case 'g':
PACK_LENGTH_ADJUST_SIZE(sizeof(float));
while (len-- > 0) {
- FLOAT_CONVWITH(tmp);
- memcpy(tmp.buf, s, sizeof(float));
+ float tmp;
+ FLOAT_CONVWITH(ftmp);
+
+ memcpy(&tmp, s, sizeof(float));
s += sizeof(float);
- NTOHF(tmp);
- UNPACK_PUSH(DBL2NUM(tmp.f));
+ tmp = NTOHF(tmp,ftmp);
+ UNPACK_PUSH(DBL2NUM((double)tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1444,11 +1582,13 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
case 'G':
PACK_LENGTH_ADJUST_SIZE(sizeof(double));
while (len-- > 0) {
- DOUBLE_CONVWITH(tmp);
- memcpy(tmp.buf, s, sizeof(double));
+ double tmp;
+ DOUBLE_CONVWITH(dtmp);
+
+ memcpy(&tmp, s, sizeof(double));
s += sizeof(double);
- NTOHD(tmp);
- UNPACK_PUSH(DBL2NUM(tmp.d));
+ tmp = NTOHD(tmp,dtmp);
+ UNPACK_PUSH(DBL2NUM(tmp));
}
PACK_ITEM_ADJUST();
break;
@@ -1471,12 +1611,12 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
char *ptr = RSTRING_PTR(buf);
long total = 0;
- while (s < send && (unsigned char)*s > ' ' && (unsigned char)*s < 'a') {
+ while (s < send && *s > ' ' && *s < 'a') {
long a,b,c,d;
- char hunk[3];
-
- len = ((unsigned char)*s++ - ' ') & 077;
+ char hunk[4];
+ hunk[3] = '\0';
+ len = (*s++ - ' ') & 077;
total += len;
if (total > RSTRING_LEN(buf)) {
len -= total - RSTRING_LEN(buf);
@@ -1486,20 +1626,20 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
while (len > 0) {
long mlen = len > 3 ? 3 : len;
- if (s < send && (unsigned char)*s >= ' ' && (unsigned char)*s < 'a')
- a = ((unsigned char)*s++ - ' ') & 077;
+ if (s < send && *s >= ' ')
+ a = (*s++ - ' ') & 077;
else
a = 0;
- if (s < send && (unsigned char)*s >= ' ' && (unsigned char)*s < 'a')
- b = ((unsigned char)*s++ - ' ') & 077;
+ if (s < send && *s >= ' ')
+ b = (*s++ - ' ') & 077;
else
b = 0;
- if (s < send && (unsigned char)*s >= ' ' && (unsigned char)*s < 'a')
- c = ((unsigned char)*s++ - ' ') & 077;
+ if (s < send && *s >= ' ')
+ c = (*s++ - ' ') & 077;
else
c = 0;
- if (s < send && (unsigned char)*s >= ' ' && (unsigned char)*s < 'a')
- d = ((unsigned char)*s++ - ' ') & 077;
+ if (s < send && *s >= ' ')
+ d = (*s++ - ' ') & 077;
else
d = 0;
hunk[0] = (char)(a << 2 | b >> 4);
@@ -1509,10 +1649,10 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
ptr += mlen;
len -= mlen;
}
- if (s < send && (unsigned char)*s != '\r' && *s != '\n')
- s++; /* possible checksum byte */
- if (s < send && *s == '\r') s++;
- if (s < send && *s == '\n') s++;
+ if (*s == '\r') s++;
+ if (*s == '\n') s++;
+ else if (s < send && (s+1 == send || s[1] == '\n'))
+ s += 2; /* possible checksum byte */
}
rb_str_set_len(buf, total);
@@ -1605,7 +1745,6 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
{
VALUE buf = infected_str_new(0, send - s, str);
char *ptr = RSTRING_PTR(buf), *ss = s;
- int csum = 0;
int c1, c2;
while (s < send) {
@@ -1617,19 +1756,18 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
if ((c1 = hex2num(*s)) == -1) break;
if (++s == send) break;
if ((c2 = hex2num(*s)) == -1) break;
- csum |= *ptr++ = castchar(c1 << 4 | c2);
+ *ptr++ = castchar(c1 << 4 | c2);
}
}
else {
- csum |= *ptr++ = *s;
+ *ptr++ = *s;
}
s++;
ss = s;
}
rb_str_set_len(buf, ptr - RSTRING_PTR(buf));
rb_str_buf_cat(buf, ss, send-ss);
- csum = ISASCII(csum) ? ENC_CODERANGE_7BIT : ENC_CODERANGE_VALID;
- ENCODING_CODERANGE_SET(buf, rb_ascii8bit_encindex(), csum);
+ ENCODING_CODERANGE_SET(buf, rb_ascii8bit_encindex(), ENC_CODERANGE_VALID);
UNPACK_PUSH(buf);
}
break;
@@ -1755,148 +1893,6 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode)
return ary;
}
-/*
- * call-seq:
- * str.unpack(format) -> anArray
- *
- * Decodes <i>str</i> (which may contain binary data) according to the
- * format string, returning an array of each value extracted. The
- * format string consists of a sequence of single-character directives,
- * summarized in the table at the end of this entry.
- * Each directive may be followed
- * by a number, indicating the number of times to repeat with this
- * directive. An asterisk (``<code>*</code>'') will use up all
- * remaining elements. The directives <code>sSiIlL</code> may each be
- * followed by an underscore (``<code>_</code>'') or
- * exclamation mark (``<code>!</code>'') to use the underlying
- * platform's native size for the specified type; otherwise, it uses a
- * platform-independent consistent size. Spaces are ignored in the
- * format string. See also <code>String#unpack1</code>, <code>Array#pack</code>.
- *
- * "abc \0\0abc \0\0".unpack('A6Z6') #=> ["abc", "abc "]
- * "abc \0\0".unpack('a3a3') #=> ["abc", " \000\000"]
- * "abc \0abc \0".unpack('Z*Z*') #=> ["abc ", "abc "]
- * "aa".unpack('b8B8') #=> ["10000110", "01100001"]
- * "aaa".unpack('h2H2c') #=> ["16", "61", 97]
- * "\xfe\xff\xfe\xff".unpack('sS') #=> [-2, 65534]
- * "now=20is".unpack('M*') #=> ["now is"]
- * "whole".unpack('xax2aX2aX1aX2a') #=> ["h", "e", "l", "l", "o"]
- *
- * This table summarizes the various formats and the Ruby classes
- * returned by each.
- *
- * Integer | |
- * Directive | Returns | Meaning
- * ------------------------------------------------------------------
- * C | Integer | 8-bit unsigned (unsigned char)
- * S | Integer | 16-bit unsigned, native endian (uint16_t)
- * L | Integer | 32-bit unsigned, native endian (uint32_t)
- * Q | Integer | 64-bit unsigned, native endian (uint64_t)
- * J | Integer | pointer width unsigned, native endian (uintptr_t)
- * | |
- * c | Integer | 8-bit signed (signed char)
- * s | Integer | 16-bit signed, native endian (int16_t)
- * l | Integer | 32-bit signed, native endian (int32_t)
- * q | Integer | 64-bit signed, native endian (int64_t)
- * j | Integer | pointer width signed, native endian (intptr_t)
- * | |
- * S_ S! | Integer | unsigned short, native endian
- * I I_ I! | Integer | unsigned int, native endian
- * L_ L! | Integer | unsigned long, native endian
- * Q_ Q! | Integer | unsigned long long, native endian (ArgumentError
- * | | if the platform has no long long type.)
- * J! | Integer | uintptr_t, native endian (same with J)
- * | |
- * s_ s! | Integer | signed short, native endian
- * i i_ i! | Integer | signed int, native endian
- * l_ l! | Integer | signed long, native endian
- * q_ q! | Integer | signed long long, native endian (ArgumentError
- * | | if the platform has no long long type.)
- * j! | Integer | intptr_t, native endian (same with j)
- * | |
- * S> s> S!> s!> | Integer | same as the directives without ">" except
- * L> l> L!> l!> | | big endian
- * I!> i!> | |
- * Q> q> Q!> q!> | | "S>" is same as "n"
- * J> j> J!> j!> | | "L>" is same as "N"
- * | |
- * S< s< S!< s!< | Integer | same as the directives without "<" except
- * L< l< L!< l!< | | little endian
- * I!< i!< | |
- * Q< q< Q!< q!< | | "S<" is same as "v"
- * J< j< J!< j!< | | "L<" is same as "V"
- * | |
- * n | Integer | 16-bit unsigned, network (big-endian) byte order
- * N | Integer | 32-bit unsigned, network (big-endian) byte order
- * v | Integer | 16-bit unsigned, VAX (little-endian) byte order
- * V | Integer | 32-bit unsigned, VAX (little-endian) byte order
- * | |
- * U | Integer | UTF-8 character
- * w | Integer | BER-compressed integer (see Array.pack)
- *
- * Float | |
- * Directive | Returns | Meaning
- * -----------------------------------------------------------------
- * D d | Float | double-precision, native format
- * F f | Float | single-precision, native format
- * E | Float | double-precision, little-endian byte order
- * e | Float | single-precision, little-endian byte order
- * G | Float | double-precision, network (big-endian) byte order
- * g | Float | single-precision, network (big-endian) byte order
- *
- * String | |
- * Directive | Returns | Meaning
- * -----------------------------------------------------------------
- * A | String | arbitrary binary string (remove trailing nulls and ASCII spaces)
- * a | String | arbitrary binary string
- * Z | String | null-terminated string
- * B | String | bit string (MSB first)
- * b | String | bit string (LSB first)
- * H | String | hex string (high nibble first)
- * h | String | hex string (low nibble first)
- * u | String | UU-encoded string
- * M | String | quoted-printable, MIME encoding (see RFC2045)
- * m | String | base64 encoded string (RFC 2045) (default)
- * | | base64 encoded string (RFC 4648) if followed by 0
- * P | String | pointer to a structure (fixed-length string)
- * p | String | pointer to a null-terminated string
- *
- * Misc. | |
- * Directive | Returns | Meaning
- * -----------------------------------------------------------------
- * @ | --- | skip to the offset given by the length argument
- * X | --- | skip backward one byte
- * x | --- | skip forward one byte
- *
- * HISTORY
- *
- * * J, J! j, and j! are available since Ruby 2.3.
- * * Q_, Q!, q_, and q! are available since Ruby 2.1.
- * * I!<, i!<, I!>, and i!> are available since Ruby 1.9.3.
- */
-
-static VALUE
-pack_unpack(VALUE str, VALUE fmt)
-{
- int mode = rb_block_given_p() ? UNPACK_BLOCK : UNPACK_ARRAY;
- return pack_unpack_internal(str, fmt, mode);
-}
-
-/*
- * call-seq:
- * str.unpack1(format) -> obj
- *
- * Decodes <i>str</i> (which may contain binary data) according to the
- * format string, returning the first value extracted.
- * See also <code>String#unpack</code>, <code>Array#pack</code>.
- */
-
-static VALUE
-pack_unpack1(VALUE str, VALUE fmt)
-{
- return pack_unpack_internal(str, fmt, UNPACK_1);
-}
-
int
rb_uv_to_utf8(char buf[6], unsigned long uv)
{
@@ -2007,9 +2003,8 @@ utf8_to_uv(const char *p, long *lenp)
void
Init_pack(void)
{
- rb_define_method(rb_cArray, "pack", pack_pack, -1);
+ rb_define_method(rb_cArray, "pack", pack_pack, 1);
rb_define_method(rb_cString, "unpack", pack_unpack, 1);
- rb_define_method(rb_cString, "unpack1", pack_unpack1, 1);
id_associated = rb_make_internal_id();
}
diff --git a/parse.y b/parse.y
index 8d83132e4a..68d6397c69 100644
--- a/parse.y
+++ b/parse.y
@@ -11,17 +11,12 @@
%{
-#if !YYPURE
-# error needs pure parser
-#endif
#ifndef PARSER_DEBUG
#define PARSER_DEBUG 0
#endif
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
#define YYSTACK_USE_ALLOCA 0
-#define YYLTYPE rb_code_range_t
-#define YYLTYPE_IS_DECLARED 1
#include "ruby/ruby.h"
#include "ruby/st.h"
@@ -36,39 +31,10 @@
#include <ctype.h>
#include "probes.h"
-#ifndef WARN_PAST_SCOPE
-# define WARN_PAST_SCOPE 0
-#endif
-
-#define TAB_WIDTH 8
-
#define YYMALLOC(size) rb_parser_malloc(parser, (size))
#define YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size))
#define YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size))
#define YYFREE(ptr) rb_parser_free(parser, (ptr))
-#define YYFPRINTF rb_parser_printf
-#define YY_LOCATION_PRINT(File, Loc) \
- rb_parser_printf(parser, "%d.%d-%d.%d", \
- (Loc).first_loc.lineno, (Loc).first_loc.column,\
- (Loc).last_loc.lineno, (Loc).last_loc.column)
-#define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (N) \
- { \
- (Current).first_loc = YYRHSLOC(Rhs, 1).first_loc; \
- (Current).last_loc = YYRHSLOC(Rhs, N).last_loc; \
- } \
- else \
- RUBY_SET_YYLLOC_OF_NONE(Current); \
- while (0)
-
-#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current) \
- rb_parser_set_location_from_strterm_heredoc(parser, &lex_strterm->u.heredoc, &(Current))
-#define RUBY_SET_YYLLOC_OF_NONE(Current) \
- rb_parser_set_location_of_none(parser, &(Current))
-#define RUBY_SET_YYLLOC(Current) \
- rb_parser_set_location(parser, &(Current))
-
#undef malloc
#undef realloc
#undef calloc
@@ -89,9 +55,8 @@ enum lex_state_bits {
EXPR_FNAME_bit, /* ignore newline, no reserved words. */
EXPR_DOT_bit, /* right after `.' or `::', no reserved words. */
EXPR_CLASS_bit, /* immediate after `class', no here document. */
- EXPR_LABEL_bit, /* flag bit, label is allowed. */
- EXPR_LABELED_bit, /* flag bit, just after a label. */
- EXPR_FITEM_bit, /* symbol literal as FNAME. */
+ EXPR_VALUE_bit, /* alike EXPR_BEG but label is disallowed. */
+ EXPR_LABELARG_bit, /* ignore significant, +/- is a sign. */
EXPR_MAX_STATE
};
/* examine combinations */
@@ -107,45 +72,35 @@ enum lex_state_e {
DEF_EXPR(FNAME),
DEF_EXPR(DOT),
DEF_EXPR(CLASS),
- DEF_EXPR(LABEL),
- DEF_EXPR(LABELED),
- DEF_EXPR(FITEM),
- EXPR_VALUE = EXPR_BEG,
- EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
+ DEF_EXPR(VALUE),
+ DEF_EXPR(LABELARG),
+ EXPR_BEG_ANY = (EXPR_BEG | EXPR_VALUE | EXPR_MID | EXPR_CLASS | EXPR_LABELARG),
EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN)
};
#define IS_lex_state_for(x, ls) ((x) & (ls))
-#define IS_lex_state_all_for(x, ls) (((x) & (ls)) == (ls))
#define IS_lex_state(ls) IS_lex_state_for(lex_state, (ls))
-#define IS_lex_state_all(ls) IS_lex_state_all_for(lex_state, (ls))
-# define SET_LEX_STATE(ls) \
- (lex_state = \
- (yydebug ? \
- rb_parser_trace_lex_state(parser, lex_state, (ls), __LINE__) : \
- (enum lex_state_e)(ls)))
+#if PARSER_DEBUG
+static const char *lex_state_name(enum lex_state_e state);
+#endif
typedef VALUE stack_type;
-# define SHOW_BITSTACK(stack, name) (yydebug ? rb_parser_show_bitstack(parser, stack, name, __LINE__) : (void)0)
-# define BITSTACK_PUSH(stack, n) (((stack) = ((stack)<<1)|((n)&1)), SHOW_BITSTACK(stack, #stack"(push)"))
-# define BITSTACK_POP(stack) (((stack) = (stack) >> 1), SHOW_BITSTACK(stack, #stack"(pop)"))
-# define BITSTACK_LEXPOP(stack) (((stack) = ((stack) >> 1) | ((stack) & 1)), SHOW_BITSTACK(stack, #stack"(lexpop)"))
-# define BITSTACK_SET_P(stack) (SHOW_BITSTACK(stack, #stack), (stack)&1)
-# define BITSTACK_SET(stack, n) ((stack)=(n), SHOW_BITSTACK(stack, #stack"(set)"))
+# define BITSTACK_PUSH(stack, n) ((stack) = ((stack)<<1)|((n)&1))
+# define BITSTACK_POP(stack) ((stack) = (stack) >> 1)
+# define BITSTACK_LEXPOP(stack) ((stack) = ((stack) >> 1) | ((stack) & 1))
+# define BITSTACK_SET_P(stack) ((stack)&1)
#define COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n))
#define COND_POP() BITSTACK_POP(cond_stack)
#define COND_LEXPOP() BITSTACK_LEXPOP(cond_stack)
#define COND_P() BITSTACK_SET_P(cond_stack)
-#define COND_SET(n) BITSTACK_SET(cond_stack, (n))
#define CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n))
#define CMDARG_POP() BITSTACK_POP(cmdarg_stack)
#define CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack)
#define CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
-#define CMDARG_SET(n) BITSTACK_SET(cmdarg_stack, (n))
struct vtable {
ID *tbl;
@@ -158,9 +113,6 @@ struct local_vars {
struct vtable *args;
struct vtable *vars;
struct vtable *used;
-# if WARN_PAST_SCOPE
- struct vtable *past;
-# endif
struct local_vars *prev;
stack_type cmdargs;
};
@@ -170,6 +122,75 @@ struct local_vars {
#define DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl))
#define POINTER_P(val) ((VALUE)(val) & ~(VALUE)3)
+static int
+vtable_size(const struct vtable *tbl)
+{
+ if (POINTER_P(tbl)) {
+ return tbl->pos;
+ }
+ else {
+ return 0;
+ }
+}
+
+#define VTBL_DEBUG 0
+
+static struct vtable *
+vtable_alloc(struct vtable *prev)
+{
+ struct vtable *tbl = ALLOC(struct vtable);
+ tbl->pos = 0;
+ tbl->capa = 8;
+ tbl->tbl = ALLOC_N(ID, tbl->capa);
+ tbl->prev = prev;
+ if (VTBL_DEBUG) printf("vtable_alloc: %p\n", (void *)tbl);
+ return tbl;
+}
+
+static void
+vtable_free(struct vtable *tbl)
+{
+ if (VTBL_DEBUG)printf("vtable_free: %p\n", (void *)tbl);
+ if (POINTER_P(tbl)) {
+ if (tbl->tbl) {
+ xfree(tbl->tbl);
+ }
+ xfree(tbl);
+ }
+}
+
+static void
+vtable_add(struct vtable *tbl, ID id)
+{
+ if (!POINTER_P(tbl)) {
+ rb_bug("vtable_add: vtable is not allocated (%p)", (void *)tbl);
+ }
+ if (VTBL_DEBUG) printf("vtable_add: %p, %"PRIsVALUE"\n", (void *)tbl, rb_id2str(id));
+
+ if (tbl->pos == tbl->capa) {
+ tbl->capa = tbl->capa * 2;
+ REALLOC_N(tbl->tbl, ID, tbl->capa);
+ }
+ tbl->tbl[tbl->pos++] = id;
+}
+
+static int
+vtable_included(const struct vtable * tbl, ID id)
+{
+ int i;
+
+ if (POINTER_P(tbl)) {
+ for (i = 0; i < tbl->pos; i++) {
+ if (tbl->tbl[i] == id) {
+ return i+1;
+ }
+ }
+ }
+ return 0;
+}
+
+
+#ifndef RIPPER
typedef struct token_info {
const char *token;
int linenum;
@@ -177,8 +198,7 @@ typedef struct token_info {
int nonspc;
struct token_info *next;
} token_info;
-
-typedef struct rb_strterm_struct rb_strterm_t;
+#endif
/*
Structure of Lexer Buffer:
@@ -190,87 +210,67 @@ typedef struct rb_strterm_struct rb_strterm_t;
token
*/
struct parser_params {
- rb_imemo_alloc_t *heap;
-
- YYSTYPE *lval;
-
- struct {
- rb_strterm_t *strterm;
- VALUE (*gets)(struct parser_params*,VALUE);
- VALUE input;
- VALUE prevline;
- VALUE lastline;
- VALUE nextline;
- const char *pbeg;
- const char *pcur;
- const char *pend;
- const char *ptok;
- long gets_ptr;
- enum lex_state_e state;
- int paren_nest;
- int lpar_beg;
- int brace_nest;
- } lex;
- stack_type cond_stack;
- stack_type cmdarg_stack;
- int tokidx;
- int toksiz;
- int tokline;
- int heredoc_end;
- int heredoc_indent;
- int heredoc_line_indent;
- char *tokenbuf;
- struct local_vars *lvtbl;
+ NODE *heap;
+
+ YYSTYPE *parser_yylval;
+ VALUE eofp;
+
+ NODE *parser_lex_strterm;
+ stack_type parser_cond_stack;
+ stack_type parser_cmdarg_stack;
+ enum lex_state_e parser_lex_state;
+ int parser_class_nest;
+ int parser_paren_nest;
+ int parser_lpar_beg;
+ int parser_in_single;
+ int parser_in_def;
+ int parser_brace_nest;
+ int parser_compile_for_eval;
+ VALUE parser_cur_mid;
+ int parser_in_kwarg;
+ int parser_in_defined;
+ char *parser_tokenbuf;
+ int parser_tokidx;
+ int parser_toksiz;
+ int parser_tokline;
+ int is_ripper; /* bool, seems unused */
+ VALUE parser_lex_input;
+ VALUE parser_lex_lastline;
+ VALUE parser_lex_nextline;
+ const char *parser_lex_pbeg;
+ const char *parser_lex_p;
+ const char *parser_lex_pend;
+ int parser_heredoc_end;
+ int parser_command_start;
+ NODE *parser_deferred_nodes;
+ long parser_lex_gets_ptr;
+ VALUE (*parser_lex_gets)(struct parser_params*,VALUE);
+ struct local_vars *parser_lvtbl;
+ int parser_ruby__end__seen;
int line_count;
- int ruby_sourceline; /* current line no. */
- char *ruby_sourcefile; /* current source file */
- VALUE ruby_sourcefile_string;
+ int has_shebang;
+ int parser_ruby_sourceline; /* current line no. */
+ char *parser_ruby_sourcefile; /* current source file */
+ VALUE parser_ruby_sourcefile_string;
rb_encoding *enc;
- token_info *token_info;
- VALUE compile_option;
-
- VALUE debug_buffer;
- VALUE debug_output;
-
- ID cur_arg;
-
- rb_ast_t *ast;
-
- unsigned int command_start:1;
- unsigned int eofp: 1;
- unsigned int ruby__end__seen: 1;
- unsigned int yydebug: 1;
- unsigned int has_shebang: 1;
- unsigned int in_defined: 1;
- unsigned int in_main: 1;
- unsigned int in_kwarg: 1;
- unsigned int in_def: 1;
- unsigned int in_class: 1;
- unsigned int token_seen: 1;
- unsigned int token_info_enabled: 1;
-# if WARN_PAST_SCOPE
- unsigned int past_scope_enabled: 1;
-# endif
- unsigned int error_p: 1;
- unsigned int cr_seen: 1;
-#ifndef RIPPER
- /* Ruby core only */
+ int parser_yydebug;
- unsigned int do_print: 1;
- unsigned int do_loop: 1;
- unsigned int do_chomp: 1;
- unsigned int do_split: 1;
+ int last_cr_line;
- NODE *eval_tree_begin;
- NODE *eval_tree;
- VALUE error_buffer;
+#ifndef RIPPER
+ /* Ruby core only */
+ NODE *parser_eval_tree_begin;
+ NODE *parser_eval_tree;
VALUE debug_lines;
VALUE coverage;
- const struct rb_block *base_block;
+ int nerr;
+
+ int parser_token_info_enabled;
+ token_info *parser_token_info;
#else
/* Ripper only */
-
+ const char *tokp;
VALUE delayed;
int delayed_line;
int delayed_col;
@@ -278,10 +278,15 @@ struct parser_params {
VALUE value;
VALUE result;
VALUE parsing_thread;
+ int toplevel_p;
#endif
};
+#ifdef RIPPER
+#define intern_cstr(n,l,en) rb_intern3(n,l,en)
+#else
#define intern_cstr(n,l,en) rb_intern3(n,l,en)
+#endif
#define STR_NEW(p,n) rb_enc_str_new((p),(n),current_enc)
#define STR_NEW0() rb_enc_str_new(0,0,current_enc)
@@ -290,119 +295,67 @@ struct parser_params {
#define TOK_INTERN() intern_cstr(tok(), toklen(), current_enc)
static int parser_yyerror(struct parser_params*, const char*);
-#define yyerror0(msg) parser_yyerror(parser, (msg))
-#define yyerror(yylloc, parser, msg) yyerror0(msg)
-#define token_flush(p) ((p)->lex.ptok = (p)->lex.pcur)
-
-#define lex_strterm (parser->lex.strterm)
-#define lex_state (parser->lex.state)
-#define cond_stack (parser->cond_stack)
-#define cmdarg_stack (parser->cmdarg_stack)
-#define paren_nest (parser->lex.paren_nest)
-#define lpar_beg (parser->lex.lpar_beg)
-#define brace_nest (parser->lex.brace_nest)
-#define in_def (parser->in_def)
-#define in_class (parser->in_class)
-#define in_main (parser->in_main)
-#define in_defined (parser->in_defined)
-#define tokenbuf (parser->tokenbuf)
-#define tokidx (parser->tokidx)
-#define toksiz (parser->toksiz)
-#define tokline (parser->tokline)
-#define lex_input (parser->lex.input)
-#define lex_prevline (parser->lex.prevline)
-#define lex_lastline (parser->lex.lastline)
-#define lex_nextline (parser->lex.nextline)
-#define lex_pbeg (parser->lex.pbeg)
-#define lex_p (parser->lex.pcur)
-#define lex_pend (parser->lex.pend)
-#define heredoc_end (parser->heredoc_end)
-#define heredoc_indent (parser->heredoc_indent)
-#define heredoc_line_indent (parser->heredoc_line_indent)
-#define command_start (parser->command_start)
-#define lex_gets_ptr (parser->lex.gets_ptr)
-#define lex_gets (parser->lex.gets)
-#define lvtbl (parser->lvtbl)
-#define ruby__end__seen (parser->ruby__end__seen)
-#define ruby_sourceline (parser->ruby_sourceline)
-#define ruby_sourcefile (parser->ruby_sourcefile)
-#define ruby_sourcefile_string (parser->ruby_sourcefile_string)
+#define yyerror(msg) parser_yyerror(parser, (msg))
+
+#define lex_strterm (parser->parser_lex_strterm)
+#define lex_state (parser->parser_lex_state)
+#define cond_stack (parser->parser_cond_stack)
+#define cmdarg_stack (parser->parser_cmdarg_stack)
+#define class_nest (parser->parser_class_nest)
+#define paren_nest (parser->parser_paren_nest)
+#define lpar_beg (parser->parser_lpar_beg)
+#define brace_nest (parser->parser_brace_nest)
+#define in_single (parser->parser_in_single)
+#define in_def (parser->parser_in_def)
+#define compile_for_eval (parser->parser_compile_for_eval)
+#define cur_mid (parser->parser_cur_mid)
+#define in_defined (parser->parser_in_defined)
+#define tokenbuf (parser->parser_tokenbuf)
+#define tokidx (parser->parser_tokidx)
+#define toksiz (parser->parser_toksiz)
+#define tokline (parser->parser_tokline)
+#define lex_input (parser->parser_lex_input)
+#define lex_lastline (parser->parser_lex_lastline)
+#define lex_nextline (parser->parser_lex_nextline)
+#define lex_pbeg (parser->parser_lex_pbeg)
+#define lex_p (parser->parser_lex_p)
+#define lex_pend (parser->parser_lex_pend)
+#define heredoc_end (parser->parser_heredoc_end)
+#define command_start (parser->parser_command_start)
+#define deferred_nodes (parser->parser_deferred_nodes)
+#define lex_gets_ptr (parser->parser_lex_gets_ptr)
+#define lex_gets (parser->parser_lex_gets)
+#define lvtbl (parser->parser_lvtbl)
+#define ruby__end__seen (parser->parser_ruby__end__seen)
+#define ruby_sourceline (parser->parser_ruby_sourceline)
+#define ruby_sourcefile (parser->parser_ruby_sourcefile)
+#define ruby_sourcefile_string (parser->parser_ruby_sourcefile_string)
#define current_enc (parser->enc)
-#define current_arg (parser->cur_arg)
-#define yydebug (parser->yydebug)
+#define yydebug (parser->parser_yydebug)
#ifdef RIPPER
-#define compile_for_eval (0)
#else
-#define compile_for_eval (parser->base_block != 0 && !in_main)
-#define ruby_eval_tree (parser->eval_tree)
-#define ruby_eval_tree_begin (parser->eval_tree_begin)
+#define ruby_eval_tree (parser->parser_eval_tree)
+#define ruby_eval_tree_begin (parser->parser_eval_tree_begin)
#define ruby_debug_lines (parser->debug_lines)
#define ruby_coverage (parser->coverage)
#endif
-#define tokp lex.ptok
-
-#define token_column ((int)(parser->tokp - lex_pbeg))
-
-#define CALL_Q_P(q) ((q) == TOKEN2VAL(tANDDOT))
-#define NODE_CALL_Q(q) (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
-#define NEW_QCALL(q,r,m,a) NEW_NODE(NODE_CALL_Q(q),r,m,a)
-#define lambda_beginning_p() (lpar_beg && lpar_beg == paren_nest)
-
-static enum yytokentype yylex(YYSTYPE*, YYLTYPE*, struct parser_params*);
-
-#ifndef RIPPER
-static inline void
-rb_discard_node_gen(struct parser_params *parser, NODE *n)
-{
- rb_ast_delete_node(parser->ast, n);
-}
-#define rb_discard_node(n) rb_discard_node_gen(parser, (n))
+#if YYPURE
+static int yylex(void*, void*);
+#else
+static int yylex(void*);
#endif
-static inline void
-add_mark_object_gen(struct parser_params *parser, VALUE obj)
-{
- if (!SPECIAL_CONST_P(obj)
-#ifdef RIPPER
- && !RB_TYPE_P(obj, T_NODE) /* Ripper jumbles NODE objects and other objects... */
-#endif
- ) {
- rb_ast_add_mark_object(parser->ast, obj);
- }
-}
-#define add_mark_object(obj) add_mark_object_gen(parser, (obj))
+#ifndef RIPPER
+#define yyparse ruby_yyparse
static NODE* node_newnode(struct parser_params *, enum node_type, VALUE, VALUE, VALUE);
#define rb_node_newnode(type, a1, a2, a3) node_newnode(parser, (type), (a1), (a2), (a3))
-#ifndef RIPPER
-static inline void
-set_line_body(NODE *body, int line)
-{
- if (!body) return;
- switch (nd_type(body)) {
- case NODE_RESCUE:
- case NODE_ENSURE:
- nd_set_line(body, line);
- }
-}
-
-#define yyparse ruby_yyparse
-
-static NODE *cond_gen(struct parser_params*,NODE*,int,const YYLTYPE*);
-#define cond(node,location) cond_gen(parser, (node), FALSE, location)
-#define method_cond(node,location) cond_gen(parser, (node), TRUE, location)
-static NODE *new_nil_gen(struct parser_params*,const YYLTYPE*);
-#define new_nil(location) new_nil_gen(parser,location)
-static NODE *new_if_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
-#define new_if(cc,left,right,location) new_if_gen(parser, (cc), (left), (right), (location))
-static NODE *new_unless_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
-#define new_unless(cc,left,right,location) new_unless_gen(parser, (cc), (left), (right), (location))
-static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
-#define logop(id,node1,node2,op_loc,location) \
- logop_gen(parser, ((id)==idAND||(id)==idANDOP)?NODE_AND:NODE_OR, \
- (node1), (node2), (op_loc), (location))
+static NODE *cond_gen(struct parser_params*,NODE*);
+#define cond(node) cond_gen(parser, (node))
+static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*);
+#define logop(type,node1,node2) logop_gen(parser, (type), (node1), (node2))
static NODE *newline_node(NODE*);
static void fixpos(NODE*,NODE*);
@@ -421,283 +374,109 @@ static void reduce_nodes_gen(struct parser_params*,NODE**);
static void block_dup_check_gen(struct parser_params*,NODE*,NODE*);
#define block_dup_check(n1,n2) block_dup_check_gen(parser,(n1),(n2))
-static NODE *block_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define block_append(h,t,location) block_append_gen(parser,(h),(t),(location))
+static NODE *block_append_gen(struct parser_params*,NODE*,NODE*);
+#define block_append(h,t) block_append_gen(parser,(h),(t))
static NODE *list_append_gen(struct parser_params*,NODE*,NODE*);
#define list_append(l,i) list_append_gen(parser,(l),(i))
-static NODE *list_concat(NODE*,NODE*);
-static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define arg_append(h,t,location) arg_append_gen(parser,(h),(t),(location))
-static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define arg_concat(h,t,location) arg_concat_gen(parser,(h),(t),(location))
-static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define literal_concat(h,t,location) literal_concat_gen(parser,(h),(t),(location))
+static NODE *list_concat_gen(struct parser_params*,NODE*,NODE*);
+#define list_concat(h,t) list_concat_gen(parser,(h),(t))
+static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*);
+#define arg_append(h,t) arg_append_gen(parser,(h),(t))
+static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*);
+#define arg_concat(h,t) arg_concat_gen(parser,(h),(t))
+static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*);
+#define literal_concat(h,t) literal_concat_gen(parser,(h),(t))
static int literal_concat0(struct parser_params *, VALUE, VALUE);
-static NODE *new_evstr_gen(struct parser_params*,NODE*,const YYLTYPE*);
-#define new_evstr(n, location) new_evstr_gen(parser,(n),(location))
+static NODE *new_evstr_gen(struct parser_params*,NODE*);
+#define new_evstr(n) new_evstr_gen(parser,(n))
static NODE *evstr2dstr_gen(struct parser_params*,NODE*);
#define evstr2dstr(n) evstr2dstr_gen(parser,(n))
static NODE *splat_array(NODE*);
-static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*,const YYLTYPE*);
-#define call_bin_op(recv,id,arg1,op_loc,location) call_bin_op_gen(parser, (recv),(id),(arg1),(op_loc),(location))
-static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID,const YYLTYPE*,const YYLTYPE*);
-#define call_uni_op(recv,id,op_loc,location) call_uni_op_gen(parser, (recv),(id),(op_loc),(location))
-static NODE *new_qcall_gen(struct parser_params* parser, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *location);
-#define new_qcall(q,r,m,a,location) new_qcall_gen(parser,q,r,m,a,location)
-#define new_command_qcall(q,r,m,a,location) new_qcall_gen(parser,q,r,m,a,location)
-static NODE *new_command_gen(struct parser_params*parser, NODE *m, NODE *a) {m->nd_args = a; return m;}
-#define new_command(m,a) new_command_gen(parser, m, a)
-static NODE *method_add_block_gen(struct parser_params*parser, NODE *m, NODE *b) {b->nd_iter = m; return b;}
-#define method_add_block(m,b) method_add_block_gen(parser, m, b)
-
-static NODE *new_args_gen(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*,const YYLTYPE*);
-#define new_args(f,o,r,p,t,location) new_args_gen(parser, (f),(o),(r),(p),(t),(location))
-static NODE *new_args_tail_gen(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
-#define new_args_tail(k,kr,b,location) new_args_tail_gen(parser, (k),(kr),(b),(location))
-static NODE *new_kw_arg_gen(struct parser_params *parser, NODE *k, const YYLTYPE *location);
-#define new_kw_arg(k,location) new_kw_arg_gen(parser, k, location)
-
-static VALUE negate_lit_gen(struct parser_params*, VALUE);
-#define negate_lit(lit) negate_lit_gen(parser, lit)
+static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*);
+#define call_bin_op(recv,id,arg1) call_bin_op_gen(parser, (recv),(id),(arg1))
+static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID);
+#define call_uni_op(recv,id) call_uni_op_gen(parser, (recv),(id))
+
+static NODE *new_args_gen(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*);
+#define new_args(f,o,r,p,t) new_args_gen(parser, (f),(o),(r),(p),(t))
+static NODE *new_args_tail_gen(struct parser_params*,NODE*,ID,ID);
+#define new_args_tail(k,kr,b) new_args_tail_gen(parser, (k),(kr),(b))
+
+static VALUE negate_lit(VALUE);
static NODE *ret_args_gen(struct parser_params*,NODE*);
#define ret_args(node) ret_args_gen(parser, (node))
static NODE *arg_blk_pass(NODE*,NODE*);
-static NODE *new_yield_gen(struct parser_params*,NODE*,const YYLTYPE*);
-#define new_yield(node,location) new_yield_gen(parser, (node), (location))
-static NODE *dsym_node_gen(struct parser_params*,NODE*,const YYLTYPE*);
-#define dsym_node(node,location) dsym_node_gen(parser, (node), (location))
+static NODE *new_yield_gen(struct parser_params*,NODE*);
+#define new_yield(node) new_yield_gen(parser, (node))
+static NODE *dsym_node_gen(struct parser_params*,NODE*);
+#define dsym_node(node) dsym_node_gen(parser, (node))
-static NODE *gettable_gen(struct parser_params*,ID,const YYLTYPE*);
-#define gettable(id,location) gettable_gen(parser,(id),(location))
-static NODE *assignable_gen(struct parser_params*,ID,NODE*,const YYLTYPE*);
-#define assignable(id,node,location) assignable_gen(parser, (id), (node), (location))
+static NODE *gettable_gen(struct parser_params*,ID);
+#define gettable(id) gettable_gen(parser,(id))
+static NODE *assignable_gen(struct parser_params*,ID,NODE*);
+#define assignable(id,node) assignable_gen(parser, (id), (node))
-static NODE *aryset_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define aryset(node1,node2,location) aryset_gen(parser, (node1), (node2), (location))
-static NODE *attrset_gen(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
-#define attrset(node,q,id,location) attrset_gen(parser, (node), (q), (id), (location))
+static NODE *aryset_gen(struct parser_params*,NODE*,NODE*);
+#define aryset(node1,node2) aryset_gen(parser, (node1), (node2))
+static NODE *attrset_gen(struct parser_params*,NODE*,ID);
+#define attrset(node,id) attrset_gen(parser, (node), (id))
static void rb_backref_error_gen(struct parser_params*,NODE*);
#define rb_backref_error(n) rb_backref_error_gen(parser,(n))
-static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define node_assign(node1, node2, location) node_assign_gen(parser, (node1), (node2), (location))
-
-static NODE *new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location);
-#define new_op_assign(lhs, op, rhs, location) new_op_assign_gen(parser, (lhs), (op), (rhs), (location))
-static NODE *new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *location);
-#define new_attr_op_assign(lhs, type, attr, op, rhs, location) new_attr_op_assign_gen(parser, (lhs), (type), (attr), (op), (rhs), (location))
-static NODE *new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location);
-#define new_const_op_assign(lhs, op, rhs, location) new_const_op_assign_gen(parser, (lhs), (op), (rhs), (location))
-
-static NODE *const_path_field_gen(struct parser_params *parser, NODE *head, ID mid, const YYLTYPE *location);
-#define const_path_field(w, n, location) const_path_field_gen(parser, w, n, location)
-#define top_const_field(n) NEW_COLON3(n)
-static NODE *const_decl_gen(struct parser_params *parser, NODE* path, const YYLTYPE *location);
-#define const_decl(path, location) const_decl_gen(parser, path, location)
-
-#define var_field(n) (n)
-#define backref_assign_error(n, a, location) (rb_backref_error(n), new_begin(0, location))
-
-static NODE *opt_arg_append(NODE*, NODE*);
-static NODE *kwd_append(NODE*, NODE*);
-
-static NODE *new_hash_gen(struct parser_params *parser, NODE *hash, const YYLTYPE *location);
-#define new_hash(hash, location) new_hash_gen(parser, (hash), location)
-
-static NODE *new_defined_gen(struct parser_params *parser, NODE *expr, const YYLTYPE *location);
-#define new_defined(expr, location) new_defined_gen(parser, expr, location)
-
-static NODE *new_regexp_gen(struct parser_params *, NODE *, int, const YYLTYPE *);
-#define new_regexp(node, opt, location) new_regexp_gen(parser, node, opt, location)
-
-static NODE *new_lit_gen(struct parser_params *parser, VALUE sym, const YYLTYPE *location);
-#define new_lit(sym, location) new_lit_gen(parser, sym, location)
-
-static NODE *new_list_gen(struct parser_params *parser, NODE *item, const YYLTYPE *location);
-#define new_list(item, location) new_list_gen(parser, item, location)
-
-static NODE *new_str_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
-#define new_str(s,location) new_str_gen(parser, s, location)
-
-static NODE *new_dvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_dvar(id, location) new_dvar_gen(parser, id, location)
-
-static NODE *new_resbody_gen(struct parser_params *parser, NODE *exc_list, NODE *stmt, NODE *rescue, const YYLTYPE *location);
-#define new_resbody(e,s,r,location) new_resbody_gen(parser, (e),(s),(r),(location))
-
-static NODE *new_errinfo_gen(struct parser_params *parser, const YYLTYPE *location);
-#define new_errinfo(location) new_errinfo_gen(parser, location)
-
-static NODE *new_call_gen(struct parser_params *parser, NODE *recv, ID mid, NODE *args, const YYLTYPE *location);
-#define new_call(recv,mid,args,location) new_call_gen(parser, recv,mid,args,location)
-
-static NODE *new_fcall_gen(struct parser_params *parser, ID mid, NODE *args, const YYLTYPE *location);
-#define new_fcall(mid,args,location) new_fcall_gen(parser, mid, args, location)
-
-static NODE *new_for_gen(struct parser_params *parser, NODE *var, NODE *iter, NODE *body, const YYLTYPE *location);
-#define new_for(var,iter,body,location) new_for_gen(parser, var, iter, body, location)
-
-static NODE *new_gvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_gvar(id, location) new_gvar_gen(parser, id, location)
-
-static NODE *new_lvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_lvar(id, location) new_lvar_gen(parser, id, location)
-
-static NODE *new_dstr_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
-#define new_dstr(s, location) new_dstr_gen(parser, s, location)
-
-static NODE *new_rescue_gen(struct parser_params *parser, NODE *b, NODE *res, NODE *e, const YYLTYPE *location);
-#define new_rescue(b,res,e,location) new_rescue_gen(parser,b,res,e,location)
+static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*);
+#define node_assign(node1, node2) node_assign_gen(parser, (node1), (node2))
-static NODE *new_undef_gen(struct parser_params *parser, NODE *i, const YYLTYPE *location);
-#define new_undef(i, location) new_undef_gen(parser, i, location)
+static NODE *new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs);
+static NODE *new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID attr, ID op, NODE *rhs);
+#define new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs))
+static NODE *new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs);
+#define new_const_op_assign(lhs, op, rhs) new_const_op_assign_gen(parser, (lhs), (op), (rhs))
-static NODE *nd_set_loc(NODE *nd, const YYLTYPE *location);
-static NODE *new_zarray_gen(struct parser_params *parser, const YYLTYPE *location);
-#define new_zarray(location) new_zarray_gen(parser, location)
-#define make_array(ary, location) ((ary) ? (nd_set_loc(ary, location), ary) : new_zarray(location))
+#define new_defined(expr) NEW_DEFINED(remove_begin_all(expr))
-static NODE *new_ivar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_ivar(id, location) new_ivar_gen(parser,id,location)
-
-static NODE *new_postarg_gen(struct parser_params *parser, NODE *i, NODE *v, const YYLTYPE *location);
-#define new_postarg(i,v,location) new_postarg_gen(parser,i,v,location)
-
-static NODE *new_cdecl_gen(struct parser_params *parser, ID v, NODE *val, NODE *path, const YYLTYPE *location);
-#define new_cdecl(v,val,path,location) new_cdecl_gen(parser,v,val,path,location)
-
-static NODE *new_scope_gen(struct parser_params *parser, NODE *a, NODE *b, const YYLTYPE *location);
-#define new_scope(a,b,location) new_scope_gen(parser,a,b,location)
-
-static NODE *new_begin_gen(struct parser_params *parser, NODE *b, const YYLTYPE *location);
-#define new_begin(b,location) new_begin_gen(parser,b,location)
-
-static NODE *new_masgn_gen(struct parser_params *parser, NODE *l, NODE *r, const YYLTYPE *location);
-#define new_masgn(l,r,location) new_masgn_gen(parser,l,r,location)
-
-static NODE *new_xstring_gen(struct parser_params *, NODE *, const YYLTYPE *location);
-#define new_xstring(node, location) new_xstring_gen(parser, node, location)
-#define new_string1(str) (str)
-
-static NODE *new_body_gen(struct parser_params *parser, NODE *param, NODE *stmt, const YYLTYPE *location);
-#define new_brace_body(param, stmt, location) new_body_gen(parser, param, stmt, location)
-#define new_do_body(param, stmt, location) new_body_gen(parser, param, stmt, location)
-
-static NODE *match_op_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*,const YYLTYPE*);
-#define match_op(node1,node2,op_loc,location) match_op_gen(parser, (node1), (node2), (op_loc), (location))
+static NODE *match_op_gen(struct parser_params*,NODE*,NODE*);
+#define match_op(node1,node2) match_op_gen(parser, (node1), (node2))
static ID *local_tbl_gen(struct parser_params*);
#define local_tbl() local_tbl_gen(parser)
+static void fixup_nodes(NODE **);
+
static VALUE reg_compile_gen(struct parser_params*, VALUE, int);
#define reg_compile(str,options) reg_compile_gen(parser, (str), (options))
static void reg_fragment_setenc_gen(struct parser_params*, VALUE, int);
#define reg_fragment_setenc(str,options) reg_fragment_setenc_gen(parser, (str), (options))
static int reg_fragment_check_gen(struct parser_params*, VALUE, int);
#define reg_fragment_check(str,options) reg_fragment_check_gen(parser, (str), (options))
-static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, const YYLTYPE *location);
-#define reg_named_capture_assign(regexp,location) reg_named_capture_assign_gen(parser,(regexp),location)
-
-static NODE *parser_heredoc_dedent(struct parser_params*,NODE*);
-# define heredoc_dedent(str) parser_heredoc_dedent(parser, (str))
+static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match);
+#define reg_named_capture_assign(regexp,match) reg_named_capture_assign_gen(parser,(regexp),(match))
#define get_id(id) (id)
#define get_value(val) (val)
-#else /* RIPPER */
-#define NODE_RIPPER NODE_CDECL
-
-static inline VALUE
-ripper_new_yylval_gen(struct parser_params *parser, ID a, VALUE b, VALUE c)
-{
- add_mark_object(b);
- add_mark_object(c);
- return (VALUE)NEW_CDECL(a, b, c);
-}
-#define ripper_new_yylval(a, b, c) ripper_new_yylval_gen(parser, a, b, c)
-
-static inline int
-ripper_is_node_yylval(VALUE n)
-{
- return RB_TYPE_P(n, T_NODE) && nd_type(RNODE(n)) == NODE_RIPPER;
-}
-
+#else
#define value_expr(node) ((void)(node))
#define remove_begin(node) (node)
-#define rb_dvar_defined(id, base) 0
-#define rb_local_defined(id, base) 0
+#define rb_dvar_defined(id) 0
+#define rb_local_defined(id) 0
static ID ripper_get_id(VALUE);
#define get_id(id) ripper_get_id(id)
static VALUE ripper_get_value(VALUE);
#define get_value(val) ripper_get_value(val)
static VALUE assignable_gen(struct parser_params*,VALUE);
-#define assignable(lhs,node,location) assignable_gen(parser, (lhs))
+#define assignable(lhs,node) assignable_gen(parser, (lhs))
static int id_is_var_gen(struct parser_params *parser, ID id);
#define id_is_var(id) id_is_var_gen(parser, (id))
-#define method_cond(node,location) (node)
-#define call_bin_op(recv,id,arg1,op_loc,location) dispatch3(binary, (recv), STATIC_ID2SYM(id), (arg1))
-#define match_op(node1,node2,op_loc,location) call_bin_op((node1), idEqTilde, (node2), op_loc, location)
-#define call_uni_op(recv,id,op_loc,location) dispatch2(unary, STATIC_ID2SYM(id), (recv))
-#define logop(id,node1,node2,op_loc,location) call_bin_op((node1), (id), (node2), op_loc, location)
-#define node_assign(node1, node2, location) dispatch2(assign, (node1), (node2))
-static VALUE new_qcall_gen(struct parser_params *parser, VALUE q, VALUE r, VALUE m, VALUE a);
-#define new_qcall(q,r,m,a,location) new_qcall_gen(parser, (r), (q), (m), (a))
-#define new_command_qcall(q,r,m,a,location) dispatch4(command_call, (r), (q), (m), (a))
-#define new_command_call(q,r,m,a) dispatch4(command_call, (r), (q), (m), (a))
-#define new_command(m,a) dispatch2(command, (m), (a));
-
-#define new_nil(location) Qnil
+#define node_assign(node1, node2) dispatch2(assign, (node1), (node2))
+
static VALUE new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs);
-#define new_op_assign(lhs, op, rhs, location) new_op_assign_gen(parser, (lhs), (op), (rhs))
static VALUE new_attr_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE type, VALUE attr, VALUE op, VALUE rhs);
-#define new_attr_op_assign(lhs, type, attr, op, rhs, location) new_attr_op_assign_gen(parser, (lhs), (type), (attr), (op), (rhs))
-#define new_const_op_assign(lhs, op, rhs, location) new_op_assign(lhs, op, rhs, location)
-
-static VALUE new_regexp_gen(struct parser_params *, VALUE, VALUE);
-#define new_regexp(node, opt, location) new_regexp_gen(parser, node, opt)
-
-static VALUE new_xstring_gen(struct parser_params *, VALUE);
-#define new_xstring(str, location) new_xstring_gen(parser, str)
-#define new_string1(str) dispatch1(string_literal, str)
-
-#define new_brace_body(param, stmt, location) dispatch2(brace_block, escape_Qundef(param), stmt)
-#define new_do_body(param, stmt, location) dispatch2(do_block, escape_Qundef(param), stmt)
-
-#define const_path_field(w, n, location) dispatch2(const_path_field, (w), (n))
-#define top_const_field(n) dispatch1(top_const_field, (n))
-static VALUE const_decl_gen(struct parser_params *parser, VALUE path);
-#define const_decl(path, location) const_decl_gen(parser, path)
-
-static VALUE var_field_gen(struct parser_params *parser, VALUE a);
-#define var_field(a) var_field_gen(parser, (a))
-static VALUE assign_error_gen(struct parser_params *parser, VALUE a);
-#define assign_error(a) assign_error_gen(parser, (a))
-#define backref_assign_error(n, a, location) assign_error(a)
-
-#define block_dup_check(n1,n2) ((void)(n1), (void)(n2))
-#define fixpos(n1,n2) ((void)(n1), (void)(n2))
-#undef nd_set_line
-#define nd_set_line(n,l) ((void)(n))
-
-static VALUE parser_reg_compile(struct parser_params*, VALUE, int, VALUE *);
+#define new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), (type), (attr), (op), (rhs))
#endif /* !RIPPER */
-/* forward declaration */
-typedef struct rb_strterm_heredoc_struct rb_strterm_heredoc_t;
-
-RUBY_SYMBOL_EXPORT_BEGIN
-VALUE rb_parser_reg_compile(struct parser_params* parser, VALUE str, int options);
-int rb_reg_fragment_setenc(struct parser_params*, VALUE, int);
-enum lex_state_e rb_parser_trace_lex_state(struct parser_params *, enum lex_state_e, enum lex_state_e, int);
-VALUE rb_parser_lex_state_name(enum lex_state_e state);
-void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int);
-PRINTF_ARGS(void rb_parser_fatal(struct parser_params *parser, const char *fmt, ...), 2, 3);
-void rb_parser_set_location_from_strterm_heredoc(struct parser_params *parser, rb_strterm_heredoc_t *here, YYLTYPE *yylloc);
-void rb_parser_set_location_of_none(struct parser_params *parser, YYLTYPE *yylloc);
-void rb_parser_set_location(struct parser_params *parser, YYLTYPE *yylloc);
-RUBY_SYMBOL_EXPORT_END
+#define new_op_assign(lhs, op, rhs) new_op_assign_gen(parser, (lhs), (op), (rhs))
static ID formal_argument_gen(struct parser_params*, ID);
#define formal_argument(id) formal_argument_gen(parser, (id))
@@ -714,9 +493,8 @@ static void local_var_gen(struct parser_params*, ID);
#define local_var(id) local_var_gen(parser, (id))
static void arg_var_gen(struct parser_params*, ID);
#define arg_var(id) arg_var_gen(parser, (id))
-static int local_id_gen(struct parser_params*, ID, ID **);
-#define local_id_ref(id, vidp) local_id_gen(parser, (id), &(vidp))
-#define local_id(id) local_id_gen(parser, (id), NULL)
+static int local_id_gen(struct parser_params*, ID);
+#define local_id(id) local_id_gen(parser, (id))
static ID internal_id_gen(struct parser_params*);
#define internal_id() internal_id_gen(parser)
@@ -727,21 +505,15 @@ static void dyna_pop_gen(struct parser_params*, const struct vtable *);
static int dyna_in_block_gen(struct parser_params*);
#define dyna_in_block() dyna_in_block_gen(parser)
#define dyna_var(id) local_var(id)
-static int dvar_defined_gen(struct parser_params*, ID, ID**);
-#define dvar_defined_ref(id, vidp) dvar_defined_gen(parser, (id), &(vidp))
-#define dvar_defined(id) dvar_defined_gen(parser, (id), NULL)
+static int dvar_defined_gen(struct parser_params*,ID,int);
+#define dvar_defined(id) dvar_defined_gen(parser, (id), 0)
+#define dvar_defined_get(id) dvar_defined_gen(parser, (id), 1)
static int dvar_curr_gen(struct parser_params*,ID);
#define dvar_curr(id) dvar_curr_gen(parser, (id))
static int lvar_defined_gen(struct parser_params*, ID);
#define lvar_defined(id) lvar_defined_gen(parser, (id))
-#ifdef RIPPER
-# define METHOD_NOT idNOT
-#else
-# define METHOD_NOT '!'
-#endif
-
#define RE_OPTION_ONCE (1<<16)
#define RE_OPTION_ENCODING_SHIFT 8
#define RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
@@ -750,75 +522,23 @@ static int lvar_defined_gen(struct parser_params*, ID);
#define RE_OPTION_MASK 0xff
#define RE_OPTION_ARG_ENCODING_NONE 32
-/* structs for managing terminator of string literal and heredocment */
-typedef struct rb_strterm_literal_struct {
- union {
- VALUE dummy;
- long nest;
- } u0;
- union {
- VALUE dummy;
- long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
- } u1;
- union {
- VALUE dummy;
- long paren; /* '(' of `%q(...)` */
- } u2;
- union {
- VALUE dummy;
- long term; /* ')' of `%q(...)` */
- } u3;
-} rb_strterm_literal_t;
-
-struct rb_strterm_heredoc_struct {
- SIGNED_VALUE sourceline;
- VALUE term; /* `"END"` of `<<"END"` */
- VALUE lastline; /* the string of line that contains `<<"END"` */
- union {
- VALUE dummy;
- long lastidx; /* the column of `<<"END"` */
- } u3;
-};
-
-#define STRTERM_HEREDOC IMEMO_FL_USER0
-
-struct rb_strterm_struct {
- VALUE flags;
- union {
- rb_strterm_literal_t literal;
- rb_strterm_heredoc_t heredoc;
- } u;
-};
-
-#ifndef RIPPER
-void
-rb_strterm_mark(VALUE obj)
-{
- rb_strterm_t *strterm = (rb_strterm_t*)obj;
- if (RBASIC(obj)->flags & STRTERM_HEREDOC) {
- rb_strterm_heredoc_t *heredoc = &strterm->u.heredoc;
- rb_gc_mark(heredoc->term);
- rb_gc_mark(heredoc->lastline);
- }
-}
+#define NODE_STRTERM NODE_ZARRAY /* nothing to gc */
+#define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */
+#define SIGN_EXTEND(x,n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1))
+#define nd_func u1.id
+#if SIZEOF_SHORT == 2
+#define nd_term(node) ((signed short)(node)->u2.id)
+#else
+#define nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2)
#endif
-
-#define TOKEN2ID(tok) ( \
- tTOKEN_LOCAL_BEGIN<(tok)&&(tok)<tTOKEN_LOCAL_END ? TOKEN2LOCALID(tok) : \
- tTOKEN_INSTANCE_BEGIN<(tok)&&(tok)<tTOKEN_INSTANCE_END ? TOKEN2INSTANCEID(tok) : \
- tTOKEN_GLOBAL_BEGIN<(tok)&&(tok)<tTOKEN_GLOBAL_END ? TOKEN2GLOBALID(tok) : \
- tTOKEN_CONST_BEGIN<(tok)&&(tok)<tTOKEN_CONST_END ? TOKEN2CONSTID(tok) : \
- tTOKEN_CLASS_BEGIN<(tok)&&(tok)<tTOKEN_CLASS_END ? TOKEN2CLASSID(tok) : \
- tTOKEN_ATTRSET_BEGIN<(tok)&&(tok)<tTOKEN_ATTRSET_END ? TOKEN2ATTRSETID(tok) : \
- ((tok) / ((tok)<tPRESERVED_ID_END && ((tok)>=128 || rb_ispunct(tok)))))
+#define nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2)
+#define nd_nest u3.cnt
/****** Ripper *******/
#ifdef RIPPER
#define RIPPER_VERSION "0.1.0"
-static inline VALUE intern_sym(const char *name);
-
#include "eventids1.c"
#include "eventids2.c"
@@ -829,8 +549,6 @@ static VALUE ripper_dispatch3(struct parser_params*,ID,VALUE,VALUE,VALUE);
static VALUE ripper_dispatch4(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE);
static VALUE ripper_dispatch5(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE);
static VALUE ripper_dispatch7(struct parser_params*,ID,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE);
-static void ripper_error_gen(struct parser_params *parser);
-#define ripper_error() ripper_error_gen(parser)
#define dispatch0(n) ripper_dispatch0(parser, TOKEN_PASTE(ripper_id_, n))
#define dispatch1(n,a) ripper_dispatch1(parser, TOKEN_PASTE(ripper_id_, n), (a))
@@ -842,9 +560,12 @@ static void ripper_error_gen(struct parser_params *parser);
#define yyparse ripper_yyparse
-#define ID2VAL(id) STATIC_ID2SYM(id)
-#define TOKEN2VAL(t) ID2VAL(TOKEN2ID(t))
-#define KWD2EID(t, v) ripper_new_yylval(keyword_##t, get_value(v), 0)
+#define ripper_intern(s) ID2SYM(rb_intern(s))
+static VALUE ripper_id2sym(ID);
+#ifdef __GNUC__
+#define ripper_id2sym(id) ((id) < 256 && rb_ispunct(id) ? \
+ ID2SYM(id) : ripper_id2sym(id))
+#endif
#define arg_new() dispatch0(args_new)
#define arg_add(l,a) dispatch2(args_add, (l), (a))
@@ -862,12 +583,13 @@ static void ripper_error_gen(struct parser_params *parser);
#define mlhs_new() dispatch0(mlhs_new)
#define mlhs_add(l,a) dispatch2(mlhs_add, (l), (a))
#define mlhs_add_star(l,a) dispatch2(mlhs_add_star, (l), (a))
-#define mlhs_add_post(l,a) dispatch2(mlhs_add_post, (l), (a))
#define params_new(pars, opts, rest, pars2, kws, kwrest, blk) \
dispatch7(params, (pars), (opts), (rest), (pars2), (kws), (kwrest), (blk))
#define blockvar_new(p,v) dispatch2(block_var, (p), (v))
+#define blockvar_add_star(l,a) dispatch2(block_var_add_star, (l), (a))
+#define blockvar_add_block(l,a) dispatch2(block_var_add_block, (l), (a))
#define method_optarg(m,a) ((a)==Qundef ? (m) : dispatch2(method_add_arg,(m),(a)))
#define method_arg(m,a) dispatch2(method_add_arg,(m),(a))
@@ -882,101 +604,68 @@ new_args_gen(struct parser_params *parser, VALUE f, VALUE o, VALUE r, VALUE p, V
VALUE k = t->u1.value, kr = t->u2.value, b = t->u3.value;
return params_new(f, o, r, p, k, kr, escape_Qundef(b));
}
-#define new_args(f,o,r,p,t,location) new_args_gen(parser, (f),(o),(r),(p),(t))
+#define new_args(f,o,r,p,t) new_args_gen(parser, (f),(o),(r),(p),(t))
static inline VALUE
new_args_tail_gen(struct parser_params *parser, VALUE k, VALUE kr, VALUE b)
{
- NODE *t = rb_node_newnode(NODE_ARGS_AUX, k, kr, b);
- add_mark_object(k);
- add_mark_object(kr);
- add_mark_object(b);
- return (VALUE)t;
+ return (VALUE)rb_node_newnode(NODE_MEMO, k, kr, b);
}
-#define new_args_tail(k,kr,b,location) new_args_tail_gen(parser, (k),(kr),(b))
+#define new_args_tail(k,kr,b) new_args_tail_gen(parser, (k),(kr),(b))
-#define new_defined(expr,location) dispatch1(defined, (expr))
-
-static VALUE parser_heredoc_dedent(struct parser_params*,VALUE);
-# define heredoc_dedent(str) parser_heredoc_dedent(parser, (str))
+#define new_defined(expr) dispatch1(defined, (expr))
#define FIXME 0
-#else
-#define ID2VAL(id) ((VALUE)(id))
-#define TOKEN2VAL(t) ID2VAL(t)
-#define KWD2EID(t, v) keyword_##t
#endif /* RIPPER */
#ifndef RIPPER
# define Qnone 0
-# define Qnull 0
# define ifndef_ripper(x) (x)
#else
# define Qnone Qnil
-# define Qnull Qundef
# define ifndef_ripper(x)
#endif
-# define rb_warn0(fmt) WARN_CALL(WARN_ARGS(fmt, 1))
-# define rb_warn1(fmt,a) WARN_CALL(WARN_ARGS(fmt, 2), (a))
-# define rb_warn2(fmt,a,b) WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
-# define rb_warn3(fmt,a,b,c) WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
-# define rb_warn4(fmt,a,b,c,d) WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
-# define rb_warning0(fmt) WARNING_CALL(WARNING_ARGS(fmt, 1))
-# define rb_warning1(fmt,a) WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
-# define rb_warning2(fmt,a,b) WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
-# define rb_warning3(fmt,a,b,c) WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
-# define rb_warning4(fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
-# define rb_warn0L(l,fmt) WARN_CALL(WARN_ARGS_L(l, fmt, 1))
-# define rb_warn1L(l,fmt,a) WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
-# define rb_warn2L(l,fmt,a,b) WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
-# define rb_warn3L(l,fmt,a,b,c) WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
-# define rb_warn4L(l,fmt,a,b,c,d) WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
-# define rb_warning0L(l,fmt) WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
-# define rb_warning1L(l,fmt,a) WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
-# define rb_warning2L(l,fmt,a,b) WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
-# define rb_warning3L(l,fmt,a,b,c) WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
-# define rb_warning4L(l,fmt,a,b,c,d) WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
+#ifndef RIPPER
+# define rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt))
+# define rb_warnI(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a))
+# define rb_warnS(fmt,a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a))
+# define rb_warn4S(file,line,fmt,a) rb_compile_warn((file), (line), (fmt), (a))
+# define rb_warn4V(file,line,fmt,a) rb_compile_warn((file), (line), (fmt), (a))
+# define rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt))
+# define rb_warningS(fmt,a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a))
+# define rb_warningV(fmt,a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a))
+#else
+# define rb_warn0(fmt) ripper_warn0(parser, (fmt))
+# define rb_warnI(fmt,a) ripper_warnI(parser, (fmt), (a))
+# define rb_warnS(fmt,a) ripper_warnS(parser, (fmt), (a))
+# define rb_warnV(fmt,a) ripper_warnV(parser, (fmt), (a))
+# define rb_warn4S(file,line,fmt,a) ripper_warnS(parser, (fmt), (a))
+# define rb_warn4V(file,line,fmt,a) ripper_warnV(parser, (fmt), (a))
+# define rb_warning0(fmt) ripper_warning0(parser, (fmt))
+# define rb_warningS(fmt,a) ripper_warningS(parser, (fmt), (a))
+# define rb_warningV(fmt,a) ripper_warningV(parser, (fmt), (a))
+static void ripper_warn0(struct parser_params*, const char*);
+static void ripper_warnI(struct parser_params*, const char*, int);
+#if 0 /* not in use right now */
+static void ripper_warnS(struct parser_params*, const char*, const char*);
+#endif
+static void ripper_warnV(struct parser_params*, const char*, VALUE);
+static void ripper_warning0(struct parser_params*, const char*);
+static void ripper_warningS(struct parser_params*, const char*, const char*);
+static void ripper_warningV(struct parser_params*, const char*, VALUE);
+#endif
+
#ifdef RIPPER
-static ID id_warn, id_warning, id_gets;
-# define WARN_S_L(s,l) STR_NEW(s,l)
-# define WARN_S(s) STR_NEW2(s)
-# define WARN_I(i) INT2NUM(i)
-# define WARN_ID(i) rb_id2str(i)
-# define PRIsWARN "s"
-# define WARN_ARGS(fmt,n) parser->value, id_warn, n, rb_usascii_str_new_lit(fmt)
-# define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
-# ifdef HAVE_VA_ARGS_MACRO
-# define WARN_CALL(...) rb_funcall(__VA_ARGS__)
-# else
-# define WARN_CALL rb_funcall
-# endif
-# define WARNING_ARGS(fmt,n) parser->value, id_warning, n, rb_usascii_str_new_lit(fmt)
-# define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
-# ifdef HAVE_VA_ARGS_MACRO
-# define WARNING_CALL(...) rb_funcall(__VA_ARGS__)
-# else
-# define WARNING_CALL rb_funcall
-# endif
-PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
+static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
+# define rb_compile_error ripper_compile_error
# define compile_error ripper_compile_error
# define PARSER_ARG parser,
#else
-# define WARN_S_L(s,l) s
-# define WARN_S(s) s
-# define WARN_I(i) i
-# define WARN_ID(i) rb_id2name(i)
-# define PRIsWARN PRIsVALUE
-# define WARN_ARGS(fmt,n) WARN_ARGS_L(ruby_sourceline,fmt,n)
-# define WARN_ARGS_L(l,fmt,n) ruby_sourcefile, (l), (fmt)
-# define WARN_CALL rb_compile_warn
-# define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n)
-# define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n)
-# define WARNING_CALL rb_compile_warning
-PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3);
-# define compile_error parser_compile_error
-# define PARSER_ARG parser,
+# define rb_compile_error rb_compile_error_with_enc
+# define compile_error parser->nerr++,rb_compile_error_with_enc
+# define PARSER_ARG ruby_sourcefile, ruby_sourceline, (void *)current_enc,
#endif
/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150,
@@ -988,10 +677,15 @@ PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *
#endif
#endif
-static void token_info_push_gen(struct parser_params*, const char *token, size_t len);
-static void token_info_pop_gen(struct parser_params*, const char *token, size_t len);
-#define token_info_push(token) token_info_push_gen(parser, (token), rb_strlen_lit(token))
-#define token_info_pop(token) token_info_pop_gen(parser, (token), rb_strlen_lit(token))
+#ifndef RIPPER
+static void token_info_push(struct parser_params*, const char *token);
+static void token_info_pop(struct parser_params*, const char *token);
+#define token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, (token)) : (void)0)
+#define token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, (token)) : (void)0)
+#else
+#define token_info_push(token) /* nothing */
+#define token_info_pop(token) /* nothing */
+#endif
%}
%pure-parser
@@ -1004,10 +698,13 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
ID id;
int num;
const struct vtable *vars;
- struct rb_strterm_struct *strterm;
}
-%token <id>
+/*%%%*/
+%token
+/*%
+%token <val>
+%*/
keyword_class
keyword_module
keyword_def
@@ -1069,12 +766,11 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%type <node> literal numeric simple_numeric dsym cpath
%type <node> top_compstmt top_stmts top_stmt
%type <node> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary command command_call method_call
-%type <node> expr_value arg_value primary_value fcall rel_expr
+%type <node> expr_value arg_value primary_value fcall
%type <node> if_tail opt_else case_body cases opt_rescue exc_list exc_var opt_ensure
%type <node> args call_args opt_call_args
%type <node> paren_args opt_paren_args args_tail opt_args_tail block_args_tail opt_block_args_tail
%type <node> command_args aref_args opt_block_arg block_arg var_ref var_lhs
-%type <node> command_rhs arg_rhs
%type <node> command_asgn mrhs mrhs_arg superclass block_call block_command
%type <node> f_block_optarg f_block_opt
%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs
@@ -1082,15 +778,15 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%type <node> block_param opt_block_param block_param_def f_opt
%type <node> f_kwarg f_kw f_block_kwarg f_block_kw
%type <node> bv_decls opt_bv_decl bvar
-%type <node> lambda f_larglist lambda_body brace_body do_body
+%type <node> lambda f_larglist lambda_body
%type <node> brace_block cmd_brace_block do_block lhs none fitem
%type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post mlhs_inner
%type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3
%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
-%type <id> f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop
+%type <id> f_kwrest f_label f_arg_asgn
/*%%%*/
/*%
-%type <val> program then do
+%type <val> program reswords then do dot_or_colon
%*/
%token END_OF_INPUT 0 "end-of-input"
%token tUPLUS RUBY_TOKEN(UPLUS) "unary+"
@@ -1102,8 +798,8 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%token tNEQ RUBY_TOKEN(NEQ) "!="
%token tGEQ RUBY_TOKEN(GEQ) ">="
%token tLEQ RUBY_TOKEN(LEQ) "<="
-%token tANDOP RUBY_TOKEN(ANDOP) "&&"
-%token tOROP RUBY_TOKEN(OROP) "||"
+%token tANDOP "&&"
+%token tOROP "||"
%token tMATCH RUBY_TOKEN(MATCH) "=~"
%token tNMATCH RUBY_TOKEN(NMATCH) "!~"
%token tDOT2 RUBY_TOKEN(DOT2) ".."
@@ -1112,8 +808,7 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%token tASET RUBY_TOKEN(ASET) "[]="
%token tLSHFT RUBY_TOKEN(LSHFT) "<<"
%token tRSHFT RUBY_TOKEN(RSHFT) ">>"
-%token tANDDOT RUBY_TOKEN(ANDDOT) "&."
-%token tCOLON2 RUBY_TOKEN(COLON2) "::"
+%token tCOLON2 "::"
%token tCOLON3 ":: at EXPR_BEG"
%token <id> tOP_ASGN /* +=, -= etc. */
%token tASSOC "=>"
@@ -1128,7 +823,7 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%token tAMPER "&"
%token tLAMBDA "->"
%token tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG tWORDS_BEG tQWORDS_BEG tSYMBOLS_BEG tQSYMBOLS_BEG
-%token tSTRING_DBEG tSTRING_DEND tSTRING_DVAR tSTRING_END tLAMBEG tLABEL_END
+%token tSTRING_DBEG tSTRING_DEND tSTRING_DVAR tSTRING_END tLAMBEG
/*
* precedence table
@@ -1162,9 +857,9 @@ static void token_info_pop_gen(struct parser_params*, const char *token, size_t
%%
program : {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
/*%%%*/
- local_push(compile_for_eval || in_main);
+ local_push(compile_for_eval || rb_parse_in_main());
/*%
local_push(0);
%*/
@@ -1183,7 +878,7 @@ program : {
void_expr(node->nd_head);
}
}
- ruby_eval_tree = new_scope(0, block_append(ruby_eval_tree, $2, &@$), &@$);
+ ruby_eval_tree = NEW_SCOPE(0, block_append(ruby_eval_tree, $2));
/*%
$$ = $2;
parser->result = dispatch1(program, $$);
@@ -1196,6 +891,7 @@ top_compstmt : top_stmts opt_terms
{
/*%%%*/
void_stmts($1);
+ fixup_nodes(&deferred_nodes);
/*%
%*/
$$ = $1;
@@ -1205,7 +901,7 @@ top_compstmt : top_stmts opt_terms
top_stmts : none
{
/*%%%*/
- $$ = new_begin(0, &@$);
+ $$ = NEW_BEGIN(0);
/*%
$$ = dispatch2(stmts_add, dispatch0(stmts_new),
dispatch0(void_stmt));
@@ -1222,7 +918,7 @@ top_stmts : none
| top_stmts terms top_stmt
{
/*%%%*/
- $$ = block_append($1, newline_node($3), &@$);
+ $$ = block_append($1, newline_node($3));
/*%
$$ = dispatch2(stmts_add, $1, $3);
%*/
@@ -1245,10 +941,10 @@ top_stmt : stmt
{
/*%%%*/
ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
- new_begin($4, &@$), &@$);
+ $4);
/* NEW_PREEXE($4)); */
/* local_pop(); */
- $$ = new_begin(0, &@$);
+ $$ = NEW_BEGIN(0);
/*%
$$ = dispatch1(BEGIN, $4);
%*/
@@ -1263,21 +959,18 @@ bodystmt : compstmt
/*%%%*/
$$ = $1;
if ($2) {
- $$ = new_rescue($1, $2, $3, &@$);
+ $$ = NEW_RESCUE($1, $2, $3);
}
else if ($3) {
rb_warn0("else without rescue is useless");
- $$ = block_append($$, $3, &@$);
+ $$ = block_append($$, $3);
}
if ($4) {
if ($$) {
$$ = NEW_ENSURE($$, $4);
- $$->nd_loc = @$;
}
else {
- NODE *nil = NEW_NIL();
- nil->nd_loc = @$;
- $$ = block_append($4, nil, &@$);
+ $$ = block_append($4, NEW_NIL());
}
}
fixpos($$, $1);
@@ -1295,6 +988,7 @@ compstmt : stmts opt_terms
{
/*%%%*/
void_stmts($1);
+ fixup_nodes(&deferred_nodes);
/*%
%*/
$$ = $1;
@@ -1304,7 +998,7 @@ compstmt : stmts opt_terms
stmts : none
{
/*%%%*/
- $$ = new_begin(0, &@$);
+ $$ = NEW_BEGIN(0);
/*%
$$ = dispatch2(stmts_add, dispatch0(stmts_new),
dispatch0(void_stmt));
@@ -1321,7 +1015,7 @@ stmts : none
| stmts terms stmt_or_begin
{
/*%%%*/
- $$ = block_append($1, newline_node($3), &@$);
+ $$ = block_append($1, newline_node($3));
/*%
$$ = dispatch2(stmts_add, $1, $3);
%*/
@@ -1338,7 +1032,7 @@ stmt_or_begin : stmt
}
| keyword_BEGIN
{
- yyerror0("BEGIN is permitted only at toplevel");
+ yyerror("BEGIN is permitted only at toplevel");
/*%%%*/
/* local_push(0); */
/*%
@@ -1348,21 +1042,19 @@ stmt_or_begin : stmt
{
/*%%%*/
ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
- $4, &@$);
+ $4);
/* NEW_PREEXE($4)); */
/* local_pop(); */
- $$ = new_begin(0, &@$);
+ $$ = NEW_BEGIN(0);
/*%
$$ = dispatch1(BEGIN, $4);
%*/
}
- ;
-stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
+stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem
{
/*%%%*/
$$ = NEW_ALIAS($2, $4);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(alias, $2, $4);
%*/
@@ -1371,7 +1063,6 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
{
/*%%%*/
$$ = NEW_VALIAS($2, $3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(var_alias, $2, $3);
%*/
@@ -1383,7 +1074,6 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
buf[0] = '$';
buf[1] = (char)$3->nd_nth;
$$ = NEW_VALIAS($2, rb_intern2(buf, 2));
- $$->nd_loc = @$;
/*%
$$ = dispatch2(var_alias, $2, $3);
%*/
@@ -1391,12 +1081,11 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
| keyword_alias tGVAR tNTH_REF
{
/*%%%*/
- yyerror0("can't make alias for the number variables");
- $$ = new_begin(0, &@$);
+ yyerror("can't make alias for the number variables");
+ $$ = NEW_BEGIN(0);
/*%
$$ = dispatch2(var_alias, $2, $3);
$$ = dispatch1(alias_error, $$);
- ripper_error();
%*/
}
| keyword_undef undef_list
@@ -1410,7 +1099,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
| stmt modifier_if expr_value
{
/*%%%*/
- $$ = new_if($3, remove_begin($1), 0, &@$);
+ $$ = NEW_IF(cond($3), remove_begin($1), 0);
fixpos($$, $3);
/*%
$$ = dispatch2(if_mod, $3, $1);
@@ -1419,7 +1108,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
| stmt modifier_unless expr_value
{
/*%%%*/
- $$ = new_unless($3, remove_begin($1), 0, &@$);
+ $$ = NEW_UNLESS(cond($3), remove_begin($1), 0);
fixpos($$, $3);
/*%
$$ = dispatch2(unless_mod, $3, $1);
@@ -1429,12 +1118,11 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
{
/*%%%*/
if ($1 && nd_type($1) == NODE_BEGIN) {
- $$ = NEW_WHILE(cond($3, &@3), $1->nd_body, 0);
+ $$ = NEW_WHILE(cond($3), $1->nd_body, 0);
}
else {
- $$ = NEW_WHILE(cond($3, &@3), $1, 1);
+ $$ = NEW_WHILE(cond($3), $1, 1);
}
- $$->nd_loc = @$;
/*%
$$ = dispatch2(while_mod, $3, $1);
%*/
@@ -1443,12 +1131,11 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
{
/*%%%*/
if ($1 && nd_type($1) == NODE_BEGIN) {
- $$ = NEW_UNTIL(cond($3, &@3), $1->nd_body, 0);
+ $$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
}
else {
- $$ = NEW_UNTIL(cond($3, &@3), $1, 1);
+ $$ = NEW_UNTIL(cond($3), $1, 1);
}
- $$->nd_loc = @$;
/*%
$$ = dispatch2(until_mod, $3, $1);
%*/
@@ -1456,29 +1143,20 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
| stmt modifier_rescue stmt
{
/*%%%*/
- NODE *resq;
- YYLTYPE location;
- location.first_loc = @2.first_loc;
- location.last_loc = @3.last_loc;
- resq = new_resbody(0, remove_begin($3), 0, &location);
- $$ = new_rescue(remove_begin($1), resq, 0, &@$);
+ NODE *resq = NEW_RESBODY(0, remove_begin($3), 0);
+ $$ = NEW_RESCUE(remove_begin($1), resq, 0);
/*%
$$ = dispatch2(rescue_mod, $1, $3);
%*/
}
| keyword_END '{' compstmt '}'
{
- if (in_def) {
+ if (in_def || in_single) {
rb_warn0("END in method; use at_exit");
}
/*%%%*/
- {
- NODE *scope = NEW_NODE(
- NODE_SCOPE, 0 /* tbl */, $3 /* body */, 0 /* args */);
- $$ = NEW_POSTEXE(scope);
- scope->nd_loc = @$;
- $$->nd_loc = @$;
- }
+ $$ = NEW_POSTEXE(NEW_NODE(
+ NODE_SCOPE, 0 /* tbl */, $3 /* body */, 0 /* args */));
/*%
$$ = dispatch1(END, $3);
%*/
@@ -1488,45 +1166,25 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
{
/*%%%*/
value_expr($3);
- $$ = node_assign($1, $3, &@$);
- /*%
- $$ = dispatch2(massign, $1, $3);
- %*/
- }
- | lhs '=' mrhs
- {
- value_expr($3);
- $$ = node_assign($1, $3, &@$);
- }
- | mlhs '=' mrhs_arg
- {
- /*%%%*/
- $$ = node_assign($1, $3, &@$);
+ $1->nd_value = $3;
+ $$ = $1;
/*%
$$ = dispatch2(massign, $1, $3);
%*/
}
- | expr
- ;
-
-command_asgn : lhs '=' command_rhs
- {
- value_expr($3);
- $$ = node_assign($1, $3, &@$);
- }
- | var_lhs tOP_ASGN command_rhs
+ | var_lhs tOP_ASGN command_call
{
value_expr($3);
- $$ = new_op_assign($1, $2, $3, &@$);
+ $$ = new_op_assign($1, $2, $3);
}
- | primary_value '[' opt_call_args rbracket tOP_ASGN command_rhs
+ | primary_value '[' opt_call_args rbracket tOP_ASGN command_call
{
/*%%%*/
NODE *args;
value_expr($6);
- $3 = make_array($3, &@3);
- args = arg_concat($3, $6, &@$);
+ if (!$3) $3 = NEW_ZARRAY();
+ args = arg_concat($3, $6);
if ($5 == tOROP) {
$5 = 0;
}
@@ -1535,84 +1193,120 @@ command_asgn : lhs '=' command_rhs
}
$$ = NEW_OP_ASGN1($1, $5, args);
fixpos($$, $1);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
$$ = dispatch3(opassign, $$, $5, $6);
%*/
}
- | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
+ | primary_value '.' tIDENTIFIER tOP_ASGN command_call
{
value_expr($5);
- $$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);
}
- | primary_value call_op tCONSTANT tOP_ASGN command_rhs
+ | primary_value '.' tCONSTANT tOP_ASGN command_call
{
value_expr($5);
- $$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);
}
- | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call
{
/*%%%*/
- YYLTYPE location;
- location.first_loc = @1.first_loc;
- location.last_loc = @3.last_loc;
+ $$ = NEW_COLON2($1, $3);
+ $$ = new_const_op_assign($$, $4, $5);
/*%
+ $$ = dispatch2(const_path_field, $1, $3);
+ $$ = dispatch3(opassign, $$, $4, $5);
%*/
- $$ = const_path_field($1, $3, &location);
- $$ = new_const_op_assign($$, $4, $5, &@$);
}
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call
{
value_expr($5);
- $$ = new_attr_op_assign($1, ID2VAL(idCOLON2), $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5);
+ }
+ | backref tOP_ASGN command_call
+ {
+ /*%%%*/
+ rb_backref_error($1);
+ $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch2(assign, dispatch1(var_field, $1), $3);
+ $$ = dispatch1(assign_error, $$);
+ %*/
+ }
+ | lhs '=' mrhs
+ {
+ /*%%%*/
+ value_expr($3);
+ $$ = node_assign($1, $3);
+ /*%
+ $$ = dispatch2(assign, $1, $3);
+ %*/
}
- | backref tOP_ASGN command_rhs
+ | mlhs '=' mrhs_arg
{
- $1 = var_field($1);
- $$ = backref_assign_error($1, node_assign($1, $3, &@$), &@$);
+ /*%%%*/
+ $1->nd_value = $3;
+ $$ = $1;
+ /*%
+ $$ = dispatch2(massign, $1, $3);
+ %*/
}
+ | expr
;
-command_rhs : command_call %prec tOP_ASGN
+command_asgn : lhs '=' command_call
{
/*%%%*/
- value_expr($1);
- $$ = $1;
+ value_expr($3);
+ $$ = node_assign($1, $3);
/*%
+ $$ = dispatch2(assign, $1, $3);
%*/
}
- | command_call modifier_rescue stmt
+ | lhs '=' command_asgn
{
/*%%%*/
- YYLTYPE location;
- location.first_loc = @2.first_loc;
- location.last_loc = @3.last_loc;
- value_expr($1);
- $$ = new_rescue($1, new_resbody(0, remove_begin($3), 0, &location), 0, &@$);
+ value_expr($3);
+ $$ = node_assign($1, $3);
/*%
- $$ = dispatch2(rescue_mod, $1, $3);
+ $$ = dispatch2(assign, $1, $3);
%*/
}
- | command_asgn
;
+
expr : command_call
| expr keyword_and expr
{
- $$ = logop(idAND, $1, $3, &@2, &@$);
+ /*%%%*/
+ $$ = logop(NODE_AND, $1, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("and"), $3);
+ %*/
}
| expr keyword_or expr
{
- $$ = logop(idOR, $1, $3, &@2, &@$);
+ /*%%%*/
+ $$ = logop(NODE_OR, $1, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("or"), $3);
+ %*/
}
| keyword_not opt_nl expr
{
- $$ = call_uni_op(method_cond($3, &@3), METHOD_NOT, &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op(cond($3), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), $3);
+ %*/
}
| '!' command_call
{
- $$ = call_uni_op(method_cond($2, &@2), '!', &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op(cond($2), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_id2sym('!'), $2);
+ %*/
}
| arg
;
@@ -1622,7 +1316,7 @@ expr_value : expr
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
+ if (!$$) $$ = NEW_NIL();
/*%
$$ = $1;
%*/
@@ -1634,34 +1328,43 @@ command_call : command
;
block_command : block_call
- | block_call call_op2 operation2 command_args
+ | block_call dot_or_colon operation2 command_args
{
- $$ = new_qcall($2, $1, $3, $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $4);
+ /*%
+ $$ = dispatch3(call, $1, $2, $3);
+ $$ = method_arg($$, $4);
+ %*/
}
;
cmd_brace_block : tLBRACE_ARG
{
+ $<vars>1 = dyna_push();
/*%%%*/
$<num>$ = ruby_sourceline;
/*%
%*/
}
- brace_body '}'
+ opt_block_param
+ compstmt
+ '}'
{
- $$ = $3;
/*%%%*/
- $3->nd_body->nd_loc.first_loc = @1.first_loc;
- $3->nd_body->nd_loc.last_loc = @4.last_loc;
+ $$ = NEW_ITER($3,$4);
nd_set_line($$, $<num>2);
- /*% %*/
+ /*%
+ $$ = dispatch2(brace_block, escape_Qundef($3), $4);
+ %*/
+ dyna_pop($<vars>1);
}
;
fcall : operation
{
/*%%%*/
- $$ = new_fcall($1, 0, &@$);
+ $$ = NEW_FCALL($1, 0);
nd_set_line($$, tokline);
/*%
%*/
@@ -1673,53 +1376,63 @@ command : fcall command_args %prec tLOWEST
/*%%%*/
$$ = $1;
$$->nd_args = $2;
- nd_set_last_loc($1, @2.last_loc);
/*%
$$ = dispatch2(command, $1, $2);
%*/
}
| fcall command_args cmd_brace_block
{
+ /*%%%*/
block_dup_check($2,$3);
- $$ = new_command($1, $2);
- $$ = method_add_block($$, $3);
+ $1->nd_args = $2;
+ $3->nd_iter = $1;
+ $$ = $3;
fixpos($$, $1);
- /*%%%*/
- $$->nd_loc = @$;
- nd_set_last_loc($1, @2.last_loc);
/*%
+ $$ = dispatch2(command, $1, $2);
+ $$ = method_add_block($$, $3);
%*/
}
- | primary_value call_op operation2 command_args %prec tLOWEST
+ | primary_value '.' operation2 command_args %prec tLOWEST
{
- $$ = new_command_qcall($2, $1, $3, $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $4);
fixpos($$, $1);
+ /*%
+ $$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
+ %*/
}
- | primary_value call_op operation2 command_args cmd_brace_block
+ | primary_value '.' operation2 command_args cmd_brace_block
{
+ /*%%%*/
block_dup_check($4,$5);
- $$ = new_command_qcall($2, $1, $3, $4, &@$);
- $$ = method_add_block($$, $5);
+ $5->nd_iter = NEW_CALL($1, $3, $4);
+ $$ = $5;
fixpos($$, $1);
- /*%%%*/
- $$->nd_loc = @$;
/*%
+ $$ = dispatch4(command_call, $1, ripper_id2sym('.'), $3, $4);
+ $$ = method_add_block($$, $5);
%*/
}
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
{
- $$ = new_command_qcall(ID2VAL(idCOLON2), $1, $3, $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $4);
fixpos($$, $1);
+ /*%
+ $$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
+ %*/
}
| primary_value tCOLON2 operation2 command_args cmd_brace_block
{
+ /*%%%*/
block_dup_check($4,$5);
- $$ = new_command_qcall(ID2VAL(idCOLON2), $1, $3, $4, &@$);
- $$ = method_add_block($$, $5);
+ $5->nd_iter = NEW_CALL($1, $3, $4);
+ $$ = $5;
fixpos($$, $1);
- /*%%%*/
- $$->nd_loc = @$;
/*%
+ $$ = dispatch4(command_call, $1, ripper_intern("::"), $3, $4);
+ $$ = method_add_block($$, $5);
%*/
}
| keyword_super command_args
@@ -1727,7 +1440,6 @@ command : fcall command_args %prec tLOWEST
/*%%%*/
$$ = NEW_SUPER($2);
fixpos($$, $2);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(super, $2);
%*/
@@ -1735,17 +1447,16 @@ command : fcall command_args %prec tLOWEST
| keyword_yield command_args
{
/*%%%*/
- $$ = new_yield($2, &@$);
+ $$ = new_yield($2);
fixpos($$, $2);
/*%
$$ = dispatch1(yield, $2);
%*/
}
- | k_return call_args
+ | keyword_return call_args
{
/*%%%*/
$$ = NEW_RETURN(ret_args($2));
- $$->nd_loc = @$;
/*%
$$ = dispatch1(return, $2);
%*/
@@ -1754,7 +1465,6 @@ command : fcall command_args %prec tLOWEST
{
/*%%%*/
$$ = NEW_BREAK(ret_args($2));
- $$->nd_loc = @$;
/*%
$$ = dispatch1(break, $2);
%*/
@@ -1763,7 +1473,6 @@ command : fcall command_args %prec tLOWEST
{
/*%%%*/
$$ = NEW_NEXT(ret_args($2));
- $$->nd_loc = @$;
/*%
$$ = dispatch1(next, $2);
%*/
@@ -1785,7 +1494,7 @@ mlhs_inner : mlhs_basic
| tLPAREN mlhs_inner rparen
{
/*%%%*/
- $$ = new_masgn(new_list($2, &@$), 0, &@$);
+ $$ = NEW_MASGN(NEW_LIST($2), 0);
/*%
$$ = dispatch1(mlhs_paren, $2);
%*/
@@ -1795,7 +1504,7 @@ mlhs_inner : mlhs_basic
mlhs_basic : mlhs_head
{
/*%%%*/
- $$ = new_masgn($1, 0, &@$);
+ $$ = NEW_MASGN($1, 0);
/*%
$$ = $1;
%*/
@@ -1803,7 +1512,7 @@ mlhs_basic : mlhs_head
| mlhs_head mlhs_item
{
/*%%%*/
- $$ = new_masgn(list_append($1,$2), 0, &@$);
+ $$ = NEW_MASGN(list_append($1,$2), 0);
/*%
$$ = mlhs_add($1, $2);
%*/
@@ -1811,7 +1520,7 @@ mlhs_basic : mlhs_head
| mlhs_head tSTAR mlhs_node
{
/*%%%*/
- $$ = new_masgn($1, $3, &@$);
+ $$ = NEW_MASGN($1, $3);
/*%
$$ = mlhs_add_star($1, $3);
%*/
@@ -1819,16 +1528,16 @@ mlhs_basic : mlhs_head
| mlhs_head tSTAR mlhs_node ',' mlhs_post
{
/*%%%*/
- $$ = new_masgn($1, new_postarg($3,$5,&@$), &@$);
+ $$ = NEW_MASGN($1, NEW_POSTARG($3,$5));
/*%
$1 = mlhs_add_star($1, $3);
- $$ = mlhs_add_post($1, $5);
+ $$ = mlhs_add($1, $5);
%*/
}
| mlhs_head tSTAR
{
/*%%%*/
- $$ = new_masgn($1, NODE_SPECIAL_NO_NAME_REST, &@$);
+ $$ = NEW_MASGN($1, -1);
/*%
$$ = mlhs_add_star($1, Qnil);
%*/
@@ -1836,16 +1545,16 @@ mlhs_basic : mlhs_head
| mlhs_head tSTAR ',' mlhs_post
{
/*%%%*/
- $$ = new_masgn($1, new_postarg(NODE_SPECIAL_NO_NAME_REST, $4, &@$), &@$);
+ $$ = NEW_MASGN($1, NEW_POSTARG(-1, $4));
/*%
$1 = mlhs_add_star($1, Qnil);
- $$ = mlhs_add_post($1, $4);
+ $$ = mlhs_add($1, $4);
%*/
}
| tSTAR mlhs_node
{
/*%%%*/
- $$ = new_masgn(0, $2, &@$);
+ $$ = NEW_MASGN(0, $2);
/*%
$$ = mlhs_add_star(mlhs_new(), $2);
%*/
@@ -1853,16 +1562,16 @@ mlhs_basic : mlhs_head
| tSTAR mlhs_node ',' mlhs_post
{
/*%%%*/
- $$ = new_masgn(0, new_postarg($2,$4,&@$), &@$);
+ $$ = NEW_MASGN(0, NEW_POSTARG($2,$4));
/*%
$2 = mlhs_add_star(mlhs_new(), $2);
- $$ = mlhs_add_post($2, $4);
+ $$ = mlhs_add($2, $4);
%*/
}
| tSTAR
{
/*%%%*/
- $$ = new_masgn(0, NODE_SPECIAL_NO_NAME_REST, &@$);
+ $$ = NEW_MASGN(0, -1);
/*%
$$ = mlhs_add_star(mlhs_new(), Qnil);
%*/
@@ -1870,10 +1579,10 @@ mlhs_basic : mlhs_head
| tSTAR ',' mlhs_post
{
/*%%%*/
- $$ = new_masgn(0, new_postarg(NODE_SPECIAL_NO_NAME_REST, $3, &@$), &@$);
+ $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
/*%
$$ = mlhs_add_star(mlhs_new(), Qnil);
- $$ = mlhs_add_post($$, $3);
+ $$ = mlhs_add($$, $3);
%*/
}
;
@@ -1892,7 +1601,7 @@ mlhs_item : mlhs_node
mlhs_head : mlhs_item ','
{
/*%%%*/
- $$ = new_list($1, &@1);
+ $$ = NEW_LIST($1);
/*%
$$ = mlhs_add(mlhs_new(), $1);
%*/
@@ -1910,7 +1619,7 @@ mlhs_head : mlhs_item ','
mlhs_post : mlhs_item
{
/*%%%*/
- $$ = new_list($1, &@$);
+ $$ = NEW_LIST($1);
/*%
$$ = mlhs_add(mlhs_new(), $1);
%*/
@@ -1927,121 +1636,175 @@ mlhs_post : mlhs_item
mlhs_node : user_variable
{
- $$ = assignable(var_field($1), 0, &@$);
+ $$ = assignable($1, 0);
}
| keyword_variable
{
- $$ = assignable(var_field($1), 0, &@$);
+ $$ = assignable($1, 0);
}
| primary_value '[' opt_call_args rbracket
{
/*%%%*/
- $$ = aryset($1, $3, &@$);
+ $$ = aryset($1, $3);
/*%
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
%*/
}
- | primary_value call_op tIDENTIFIER
+ | primary_value '.' tIDENTIFIER
{
/*%%%*/
- $$ = attrset($1, $2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
- $$ = dispatch3(field, $1, $2, $3);
+ $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
%*/
}
| primary_value tCOLON2 tIDENTIFIER
{
/*%%%*/
- $$ = attrset($1, idCOLON2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
$$ = dispatch2(const_path_field, $1, $3);
%*/
}
- | primary_value call_op tCONSTANT
+ | primary_value '.' tCONSTANT
{
/*%%%*/
- $$ = attrset($1, $2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
- $$ = dispatch3(field, $1, $2, $3);
+ $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
%*/
}
| primary_value tCOLON2 tCONSTANT
{
- $$ = const_decl(const_path_field($1, $3, &@$), &@$);
+ /*%%%*/
+ if (in_def || in_single)
+ yyerror("dynamic constant assignment");
+ $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
+ /*%
+ $$ = dispatch2(const_path_field, $1, $3);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
+ %*/
}
| tCOLON3 tCONSTANT
{
- $$ = const_decl(top_const_field($2), &@$);
+ /*%%%*/
+ if (in_def || in_single)
+ yyerror("dynamic constant assignment");
+ $$ = NEW_CDECL(0, 0, NEW_COLON3($2));
+ /*%
+ $$ = dispatch1(top_const_field, $2);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
+ %*/
}
| backref
{
- $1 = var_field($1);
- $$ = backref_assign_error($1, $1, &@$);
+ /*%%%*/
+ rb_backref_error($1);
+ $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch1(var_field, $1);
+ $$ = dispatch1(assign_error, $$);
+ %*/
}
;
lhs : user_variable
{
- $$ = assignable(var_field($1), 0, &@$);
+ $$ = assignable($1, 0);
+ /*%%%*/
+ if (!$$) $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch1(var_field, $$);
+ %*/
}
| keyword_variable
{
- $$ = assignable(var_field($1), 0, &@$);
+ $$ = assignable($1, 0);
+ /*%%%*/
+ if (!$$) $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch1(var_field, $$);
+ %*/
}
| primary_value '[' opt_call_args rbracket
{
/*%%%*/
- $$ = aryset($1, $3, &@$);
+ $$ = aryset($1, $3);
/*%
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
%*/
}
- | primary_value call_op tIDENTIFIER
+ | primary_value '.' tIDENTIFIER
{
/*%%%*/
- $$ = attrset($1, $2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
- $$ = dispatch3(field, $1, $2, $3);
+ $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
%*/
}
| primary_value tCOLON2 tIDENTIFIER
{
/*%%%*/
- $$ = attrset($1, idCOLON2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
- $$ = dispatch3(field, $1, ID2VAL(idCOLON2), $3);
+ $$ = dispatch3(field, $1, ripper_intern("::"), $3);
%*/
}
- | primary_value call_op tCONSTANT
+ | primary_value '.' tCONSTANT
{
/*%%%*/
- $$ = attrset($1, $2, $3, &@$);
+ $$ = attrset($1, $3);
/*%
- $$ = dispatch3(field, $1, $2, $3);
+ $$ = dispatch3(field, $1, ripper_id2sym('.'), $3);
%*/
}
| primary_value tCOLON2 tCONSTANT
{
- $$ = const_decl(const_path_field($1, $3, &@$), &@$);
+ /*%%%*/
+ if (in_def || in_single)
+ yyerror("dynamic constant assignment");
+ $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3));
+ /*%
+ $$ = dispatch2(const_path_field, $1, $3);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
+ %*/
}
| tCOLON3 tCONSTANT
{
- $$ = const_decl(top_const_field($2), &@$);
+ /*%%%*/
+ if (in_def || in_single)
+ yyerror("dynamic constant assignment");
+ $$ = NEW_CDECL(0, 0, NEW_COLON3($2));
+ /*%
+ $$ = dispatch1(top_const_field, $2);
+ if (in_def || in_single) {
+ $$ = dispatch1(assign_error, $$);
+ }
+ %*/
}
| backref
{
- $1 = var_field($1);
- $$ = backref_assign_error($1, $1, &@$);
+ /*%%%*/
+ rb_backref_error($1);
+ $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch1(assign_error, $1);
+ %*/
}
;
cname : tIDENTIFIER
{
/*%%%*/
- yyerror0("class/module name must be CONSTANT");
+ yyerror("class/module name must be CONSTANT");
/*%
$$ = dispatch1(class_name_error, $1);
- ripper_error();
%*/
}
| tCONSTANT
@@ -2051,7 +1814,6 @@ cpath : tCOLON3 cname
{
/*%%%*/
$$ = NEW_COLON3($2);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(top_const_ref, $2);
%*/
@@ -2060,7 +1822,6 @@ cpath : tCOLON3 cname
{
/*%%%*/
$$ = NEW_COLON2(0, $$);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(const_ref, $1);
%*/
@@ -2069,7 +1830,6 @@ cpath : tCOLON3 cname
{
/*%%%*/
$$ = NEW_COLON2($1, $3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(const_path_ref, $1, $3);
%*/
@@ -2081,13 +1841,17 @@ fname : tIDENTIFIER
| tFID
| op
{
- SET_LEX_STATE(EXPR_ENDFN);
+ lex_state = EXPR_ENDFN;
$$ = $1;
}
| reswords
{
- SET_LEX_STATE(EXPR_ENDFN);
+ lex_state = EXPR_ENDFN;
+ /*%%%*/
+ $$ = $<id>1;
+ /*%
$$ = $1;
+ %*/
}
;
@@ -2098,7 +1862,7 @@ fsym : fname
fitem : fsym
{
/*%%%*/
- $$ = new_lit(ID2SYM($1), &@$);
+ $$ = NEW_LIT(ID2SYM($1));
/*%
$$ = dispatch1(symbol_literal, $1);
%*/
@@ -2109,18 +1873,17 @@ fitem : fsym
undef_list : fitem
{
/*%%%*/
- $$ = new_undef($1, &@$);
+ $$ = NEW_UNDEF($1);
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
- | undef_list ',' {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
+ | undef_list ',' {lex_state = EXPR_FNAME;} fitem
{
/*%%%*/
- NODE *undef = new_undef($4, &@$);
- $$ = block_append($1, undef, &@$);
+ $$ = block_append($1, NEW_UNDEF($4));
/*%
- rb_ary_push($1, get_value($4));
+ rb_ary_push($1, $4);
%*/
}
;
@@ -2171,28 +1934,53 @@ reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__
| keyword_while | keyword_until
;
-arg : lhs '=' arg_rhs
+arg : lhs '=' arg
+ {
+ /*%%%*/
+ value_expr($3);
+ $$ = node_assign($1, $3);
+ /*%
+ $$ = dispatch2(assign, $1, $3);
+ %*/
+ }
+ | lhs '=' arg modifier_rescue arg
+ {
+ /*%%%*/
+ value_expr($3);
+ $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
+ $$ = node_assign($1, $3);
+ /*%
+ $$ = dispatch2(assign, $1, dispatch2(rescue_mod, $3, $5));
+ %*/
+ }
+ | var_lhs tOP_ASGN arg
{
- $$ = node_assign($1, $3, &@$);
+ value_expr($3);
+ $$ = new_op_assign($1, $2, $3);
}
- | var_lhs tOP_ASGN arg_rhs
+ | var_lhs tOP_ASGN arg modifier_rescue arg
{
- $$ = new_op_assign($1, $2, $3, &@$);
+ /*%%%*/
+ value_expr($3);
+ $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0);
+ /*%
+ $3 = dispatch2(rescue_mod, $3, $5);
+ %*/
+ $$ = new_op_assign($1, $2, $3);
}
- | primary_value '[' opt_call_args rbracket tOP_ASGN arg_rhs
+ | primary_value '[' opt_call_args rbracket tOP_ASGN arg
{
/*%%%*/
NODE *args;
value_expr($6);
- $3 = make_array($3, &@3);
+ if (!$3) $3 = NEW_ZARRAY();
if (nd_type($3) == NODE_BLOCK_PASS) {
args = NEW_ARGSCAT($3, $6);
- args->nd_loc = @$;
- }
- else {
- args = arg_concat($3, $6, &@$);
}
+ else {
+ args = arg_concat($3, $6);
+ }
if ($5 == tOROP) {
$5 = 0;
}
@@ -2201,47 +1989,56 @@ arg : lhs '=' arg_rhs
}
$$ = NEW_OP_ASGN1($1, $5, args);
fixpos($$, $1);
- $$->nd_loc = @$;
/*%
$1 = dispatch2(aref_field, $1, escape_Qundef($3));
$$ = dispatch3(opassign, $1, $5, $6);
%*/
}
- | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
+ | primary_value '.' tIDENTIFIER tOP_ASGN arg
{
value_expr($5);
- $$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);
}
- | primary_value call_op tCONSTANT tOP_ASGN arg_rhs
+ | primary_value '.' tCONSTANT tOP_ASGN arg
{
value_expr($5);
- $$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);
}
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg
{
value_expr($5);
- $$ = new_attr_op_assign($1, ID2VAL(idCOLON2), $3, $4, $5, &@$);
+ $$ = new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5);
}
- | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN arg
{
/*%%%*/
- YYLTYPE location;
- location.first_loc = @1.first_loc;
- location.last_loc = @3.last_loc;
+ $$ = NEW_COLON2($1, $3);
+ $$ = new_const_op_assign($$, $4, $5);
/*%
+ $$ = dispatch2(const_path_field, $1, $3);
+ $$ = dispatch3(opassign, $$, $4, $5);
%*/
- $$ = const_path_field($1, $3, &location);
- $$ = new_const_op_assign($$, $4, $5, &@$);
}
- | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
+ | tCOLON3 tCONSTANT tOP_ASGN arg
{
- $$ = top_const_field($2);
- $$ = new_const_op_assign($$, $3, $4, &@$);
+ /*%%%*/
+ $$ = NEW_COLON3($2);
+ $$ = new_const_op_assign($$, $3, $4);
+ /*%
+ $$ = dispatch1(top_const_field, $2);
+ $$ = dispatch3(opassign, $$, $3, $4);
+ %*/
}
- | backref tOP_ASGN arg_rhs
+ | backref tOP_ASGN arg
{
- $1 = var_field($1);
- $$ = backref_assign_error($1, new_op_assign($1, $2, $3, &@$), &@$);
+ /*%%%*/
+ rb_backref_error($1);
+ $$ = NEW_BEGIN(0);
+ /*%
+ $$ = dispatch1(var_field, $1);
+ $$ = dispatch3(opassign, $$, $2, $3);
+ $$ = dispatch1(assign_error, $$);
+ %*/
}
| arg tDOT2 arg
{
@@ -2249,7 +2046,10 @@ arg : lhs '=' arg_rhs
value_expr($1);
value_expr($3);
$$ = NEW_DOT2($1, $3);
- $$->nd_loc = @$;
+ if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
+ nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
+ deferred_nodes = list_append(deferred_nodes, $$);
+ }
/*%
$$ = dispatch2(dot2, $1, $3);
%*/
@@ -2260,118 +2060,256 @@ arg : lhs '=' arg_rhs
value_expr($1);
value_expr($3);
$$ = NEW_DOT3($1, $3);
- $$->nd_loc = @$;
+ if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
+ nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
+ deferred_nodes = list_append(deferred_nodes, $$);
+ }
/*%
$$ = dispatch2(dot3, $1, $3);
%*/
}
| arg '+' arg
{
- $$ = call_bin_op($1, '+', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '+', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('+'), $3);
+ %*/
}
| arg '-' arg
{
- $$ = call_bin_op($1, '-', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '-', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('-'), $3);
+ %*/
}
| arg '*' arg
{
- $$ = call_bin_op($1, '*', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '*', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('*'), $3);
+ %*/
}
| arg '/' arg
{
- $$ = call_bin_op($1, '/', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '/', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('/'), $3);
+ %*/
}
| arg '%' arg
{
- $$ = call_bin_op($1, '%', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '%', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('%'), $3);
+ %*/
}
| arg tPOW arg
{
- $$ = call_bin_op($1, idPow, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tPOW, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("**"), $3);
+ %*/
}
| tUMINUS_NUM simple_numeric tPOW arg
{
- $$ = call_uni_op(call_bin_op($2, idPow, $4, &@2, &@$), idUMinus, &@1, &@$);
+ /*%%%*/
+ $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);
+ /*%
+ $$ = dispatch3(binary, $2, ripper_intern("**"), $4);
+ $$ = dispatch2(unary, ripper_intern("-@"), $$);
+ %*/
}
| tUPLUS arg
{
- $$ = call_uni_op($2, idUPlus, &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op($2, tUPLUS);
+ /*%
+ $$ = dispatch2(unary, ripper_intern("+@"), $2);
+ %*/
}
| tUMINUS arg
{
- $$ = call_uni_op($2, idUMinus, &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op($2, tUMINUS);
+ /*%
+ $$ = dispatch2(unary, ripper_intern("-@"), $2);
+ %*/
}
| arg '|' arg
{
- $$ = call_bin_op($1, '|', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '|', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('|'), $3);
+ %*/
}
| arg '^' arg
{
- $$ = call_bin_op($1, '^', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '^', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('^'), $3);
+ %*/
}
| arg '&' arg
{
- $$ = call_bin_op($1, '&', $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, '&', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('&'), $3);
+ %*/
}
| arg tCMP arg
{
- $$ = call_bin_op($1, idCmp, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tCMP, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("<=>"), $3);
+ %*/
+ }
+ | arg '>' arg
+ {
+ /*%%%*/
+ $$ = call_bin_op($1, '>', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('>'), $3);
+ %*/
+ }
+ | arg tGEQ arg
+ {
+ /*%%%*/
+ $$ = call_bin_op($1, tGEQ, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern(">="), $3);
+ %*/
+ }
+ | arg '<' arg
+ {
+ /*%%%*/
+ $$ = call_bin_op($1, '<', $3);
+ /*%
+ $$ = dispatch3(binary, $1, ID2SYM('<'), $3);
+ %*/
+ }
+ | arg tLEQ arg
+ {
+ /*%%%*/
+ $$ = call_bin_op($1, tLEQ, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("<="), $3);
+ %*/
}
- | rel_expr %prec tCMP
| arg tEQ arg
{
- $$ = call_bin_op($1, idEq, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tEQ, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("=="), $3);
+ %*/
}
| arg tEQQ arg
{
- $$ = call_bin_op($1, idEqq, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tEQQ, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("==="), $3);
+ %*/
}
| arg tNEQ arg
{
- $$ = call_bin_op($1, idNeq, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tNEQ, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("!="), $3);
+ %*/
}
| arg tMATCH arg
{
- $$ = match_op($1, $3, &@2, &@$);
+ /*%%%*/
+ $$ = match_op($1, $3);
+ if (nd_type($1) == NODE_LIT && RB_TYPE_P($1->nd_lit, T_REGEXP)) {
+ $$ = reg_named_capture_assign($1->nd_lit, $$);
+ }
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("=~"), $3);
+ %*/
}
| arg tNMATCH arg
{
- $$ = call_bin_op($1, idNeqTilde, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tNMATCH, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("!~"), $3);
+ %*/
}
| '!' arg
{
- $$ = call_uni_op(method_cond($2, &@2), '!', &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op(cond($2), '!');
+ /*%
+ $$ = dispatch2(unary, ID2SYM('!'), $2);
+ %*/
}
| '~' arg
{
- $$ = call_uni_op($2, '~', &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op($2, '~');
+ /*%
+ $$ = dispatch2(unary, ID2SYM('~'), $2);
+ %*/
}
| arg tLSHFT arg
{
- $$ = call_bin_op($1, idLTLT, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tLSHFT, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("<<"), $3);
+ %*/
}
| arg tRSHFT arg
{
- $$ = call_bin_op($1, idGTGT, $3, &@2, &@$);
+ /*%%%*/
+ $$ = call_bin_op($1, tRSHFT, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern(">>"), $3);
+ %*/
}
| arg tANDOP arg
{
- $$ = logop(idANDOP, $1, $3, &@2, &@$);
+ /*%%%*/
+ $$ = logop(NODE_AND, $1, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("&&"), $3);
+ %*/
}
| arg tOROP arg
{
- $$ = logop(idOROP, $1, $3, &@2, &@$);
+ /*%%%*/
+ $$ = logop(NODE_OR, $1, $3);
+ /*%
+ $$ = dispatch3(binary, $1, ripper_intern("||"), $3);
+ %*/
}
| keyword_defined opt_nl {in_defined = 1;} arg
{
in_defined = 0;
- $$ = new_defined($4, &@$);
+ /*%%%*/
+ $$ = new_defined($4);
+ /*%
+ $$ = dispatch1(defined, $4);
+ %*/
}
| arg '?' arg opt_nl ':' arg
{
/*%%%*/
value_expr($1);
- $$ = new_if($1, $3, $6, &@$);
+ $$ = NEW_IF(cond($1), $3, $6);
fixpos($$, $1);
/*%
$$ = dispatch3(ifop, $1, $3, $6);
@@ -2383,29 +2321,12 @@ arg : lhs '=' arg_rhs
}
;
-relop : '>' {$$ = '>';}
- | '<' {$$ = '<';}
- | tGEQ {$$ = idGE;}
- | tLEQ {$$ = idLE;}
- ;
-
-rel_expr : arg relop arg %prec '>'
- {
- $$ = call_bin_op($1, $2, $3, &@2, &@$);
- }
- | rel_expr relop arg %prec '>'
- {
- rb_warning1("comparison '%s' after comparison", WARN_ID($2));
- $$ = call_bin_op($1, $2, $3, &@2, &@$);
- }
- ;
-
arg_value : arg
{
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
+ if (!$$) $$ = NEW_NIL();
/*%
$$ = $1;
%*/
@@ -2420,7 +2341,7 @@ aref_args : none
| args ',' assocs trailer
{
/*%%%*/
- $$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
+ $$ = arg_append($1, NEW_HASH($3));
/*%
$$ = arg_add_assocs($1, $3);
%*/
@@ -2428,35 +2349,13 @@ aref_args : none
| assocs trailer
{
/*%%%*/
- $$ = $1 ? new_list(new_hash($1, &@1), &@$) : 0;
+ $$ = NEW_LIST(NEW_HASH($1));
/*%
$$ = arg_add_assocs(arg_new(), $1);
%*/
}
;
-arg_rhs : arg %prec tOP_ASGN
- {
- /*%%%*/
- value_expr($1);
- $$ = $1;
- /*%
- %*/
- }
- | arg modifier_rescue arg
- {
- /*%%%*/
- YYLTYPE location;
- location.first_loc = @2.first_loc;
- location.last_loc = @3.last_loc;
- value_expr($1);
- $$ = new_rescue($1, new_resbody(0, remove_begin($3), 0, &location), 0, &@$);
- /*%
- $$ = dispatch2(rescue_mod, $1, $3);
- %*/
- }
- ;
-
paren_args : '(' opt_call_args rparen
{
/*%%%*/
@@ -2480,7 +2379,7 @@ opt_call_args : none
| args ',' assocs ','
{
/*%%%*/
- $$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
+ $$ = arg_append($1, NEW_HASH($3));
/*%
$$ = arg_add_assocs($1, $3);
%*/
@@ -2488,7 +2387,7 @@ opt_call_args : none
| assocs ','
{
/*%%%*/
- $$ = $1 ? new_list(new_hash($1, &@1), &@1) : 0;
+ $$ = NEW_LIST(NEW_HASH($1));
/*%
$$ = arg_add_assocs(arg_new(), $1);
%*/
@@ -2499,7 +2398,7 @@ call_args : command
{
/*%%%*/
value_expr($1);
- $$ = new_list($1, &@$);
+ $$ = NEW_LIST($1);
/*%
$$ = arg_add(arg_new(), $1);
%*/
@@ -2515,7 +2414,7 @@ call_args : command
| assocs opt_block_arg
{
/*%%%*/
- $$ = $1 ? new_list(new_hash($1, &@1), &@1) : 0;
+ $$ = NEW_LIST(NEW_HASH($1));
$$ = arg_blk_pass($$, $2);
/*%
$$ = arg_add_assocs(arg_new(), $1);
@@ -2525,7 +2424,7 @@ call_args : command
| args ',' assocs opt_block_arg
{
/*%%%*/
- $$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
+ $$ = arg_append($1, NEW_HASH($3));
$$ = arg_blk_pass($$, $4);
/*%
$$ = arg_add_optblock(arg_add_assocs($1, $3), $4);
@@ -2540,14 +2439,14 @@ call_args : command
%*/
;
-command_args : {
+command_args : {
$<val>$ = cmdarg_stack;
CMDARG_PUSH(1);
}
call_args
{
/* CMDARG_POP() */
- CMDARG_SET($<val>1);
+ cmdarg_stack = $<val>1;
$$ = $2;
}
;
@@ -2556,7 +2455,6 @@ block_arg : tAMPER arg_value
{
/*%%%*/
$$ = NEW_BLOCK_PASS($2);
- $$->nd_loc = @$;
/*%
$$ = $2;
%*/
@@ -2576,7 +2474,7 @@ opt_block_arg : ',' block_arg
args : arg_value
{
/*%%%*/
- $$ = new_list($1, &@$);
+ $$ = NEW_LIST($1);
/*%
$$ = arg_add(arg_new(), $1);
%*/
@@ -2585,7 +2483,6 @@ args : arg_value
{
/*%%%*/
$$ = NEW_SPLAT($2);
- $$->nd_loc = @$;
/*%
$$ = arg_add_star(arg_new(), $2);
%*/
@@ -2598,7 +2495,7 @@ args : arg_value
$$ = list_append(n1, $3);
}
else {
- $$ = arg_append($1, $3, &@$);
+ $$ = arg_append($1, $3);
}
/*%
$$ = arg_add($1, $3);
@@ -2612,7 +2509,7 @@ args : arg_value
$$ = list_concat(n1, $4);
}
else {
- $$ = arg_concat($1, $4, &@$);
+ $$ = arg_concat($1, $4);
}
/*%
$$ = arg_add_star($1, $4);
@@ -2632,7 +2529,7 @@ mrhs : args ',' arg_value
$$ = list_append(n1, $3);
}
else {
- $$ = arg_append($1, $3, &@$);
+ $$ = arg_append($1, $3);
}
/*%
$$ = mrhs_add(args2mrhs($1), $3);
@@ -2647,7 +2544,7 @@ mrhs : args ',' arg_value
$$ = list_concat(n1, $4);
}
else {
- $$ = arg_concat($1, $4, &@$);
+ $$ = arg_concat($1, $4);
}
/*%
$$ = mrhs_add_star(args2mrhs($1), $4);
@@ -2657,7 +2554,6 @@ mrhs : args ',' arg_value
{
/*%%%*/
$$ = NEW_SPLAT($2);
- $$->nd_loc = @$;
/*%
$$ = mrhs_add_star(mrhs_new(), $2);
%*/
@@ -2677,7 +2573,7 @@ primary : literal
| tFID
{
/*%%%*/
- $$ = new_fcall($1, 0, &@$);
+ $$ = NEW_FCALL($1, 0);
/*%
$$ = method_arg(dispatch1(fcall, $1), arg_new());
%*/
@@ -2685,7 +2581,7 @@ primary : literal
| k_begin
{
$<val>1 = cmdarg_stack;
- CMDARG_SET(0);
+ cmdarg_stack = 0;
/*%%%*/
$<num>$ = ruby_sourceline;
/*%
@@ -2694,25 +2590,26 @@ primary : literal
bodystmt
k_end
{
- CMDARG_SET($<val>1);
+ cmdarg_stack = $<val>1;
/*%%%*/
if ($3 == NULL) {
$$ = NEW_NIL();
- $$->nd_loc = @$;
}
else {
- set_line_body($3, $<num>2);
- $$ = new_begin($3, &@$);
+ if (nd_type($3) == NODE_RESCUE ||
+ nd_type($3) == NODE_ENSURE)
+ nd_set_line($3, $<num>2);
+ $$ = NEW_BEGIN($3);
}
nd_set_line($$, $<num>2);
/*%
$$ = dispatch1(begin, $3);
%*/
}
- | tLPAREN_ARG {SET_LEX_STATE(EXPR_ENDARG);} rparen
+ | tLPAREN_ARG {lex_state = EXPR_ENDARG;} rparen
{
/*%%%*/
- $$ = new_begin(0, &@$);
+ $$ = 0;
/*%
$$ = dispatch1(paren, 0);
%*/
@@ -2720,11 +2617,11 @@ primary : literal
| tLPAREN_ARG
{
$<val>1 = cmdarg_stack;
- CMDARG_SET(0);
+ cmdarg_stack = 0;
}
- stmt {SET_LEX_STATE(EXPR_ENDARG);} rparen
+ expr {lex_state = EXPR_ENDARG;} rparen
{
- CMDARG_SET($<val>1);
+ cmdarg_stack = $<val>1;
/*%%%*/
$$ = $3;
/*%
@@ -2743,7 +2640,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_COLON2($1, $3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(const_path_ref, $1, $3);
%*/
@@ -2752,7 +2648,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_COLON3($2);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(top_const_ref, $2);
%*/
@@ -2760,7 +2655,12 @@ primary : literal
| tLBRACK aref_args ']'
{
/*%%%*/
- $$ = make_array($2, &@$);
+ if ($2 == 0) {
+ $$ = NEW_ZARRAY(); /* zero length array*/
+ }
+ else {
+ $$ = $2;
+ }
/*%
$$ = dispatch1(array, escape_Qundef($2));
%*/
@@ -2768,17 +2668,15 @@ primary : literal
| tLBRACE assoc_list '}'
{
/*%%%*/
- $$ = new_hash($2, &@$);
- $$->nd_alen = TRUE;
+ $$ = NEW_HASH($2);
/*%
$$ = dispatch1(hash, escape_Qundef($2));
%*/
}
- | k_return
+ | keyword_return
{
/*%%%*/
$$ = NEW_RETURN(0);
- $$->nd_loc = @$;
/*%
$$ = dispatch0(return0);
%*/
@@ -2786,7 +2684,7 @@ primary : literal
| keyword_yield '(' call_args rparen
{
/*%%%*/
- $$ = new_yield($3, &@$);
+ $$ = new_yield($3);
/*%
$$ = dispatch1(yield, dispatch1(paren, $3));
%*/
@@ -2795,7 +2693,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_YIELD(0);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(yield, dispatch1(paren, arg_new()));
%*/
@@ -2804,7 +2701,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_YIELD(0);
- $$->nd_loc = @$;
/*%
$$ = dispatch0(yield0);
%*/
@@ -2812,21 +2708,32 @@ primary : literal
| keyword_defined opt_nl '(' {in_defined = 1;} expr rparen
{
in_defined = 0;
- $$ = new_defined($5, &@$);
+ /*%%%*/
+ $$ = new_defined($5);
+ /*%
+ $$ = dispatch1(defined, $5);
+ %*/
}
| keyword_not '(' expr rparen
{
- $$ = call_uni_op(method_cond($3, &@3), METHOD_NOT, &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op(cond($3), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), $3);
+ %*/
}
| keyword_not '(' rparen
{
- $$ = call_uni_op(method_cond(new_nil(&@2), &@2), METHOD_NOT, &@1, &@$);
+ /*%%%*/
+ $$ = call_uni_op(cond(NEW_NIL()), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), Qnil);
+ %*/
}
| fcall brace_block
{
/*%%%*/
$2->nd_iter = $1;
- $2->nd_loc = @$;
$$ = $2;
/*%
$$ = method_arg(dispatch1(fcall, $1), arg_new());
@@ -2839,7 +2746,6 @@ primary : literal
/*%%%*/
block_dup_check($1->nd_args, $2);
$2->nd_iter = $1;
- $2->nd_loc = @$;
$$ = $2;
/*%
$$ = method_add_block($1, $2);
@@ -2855,7 +2761,7 @@ primary : literal
k_end
{
/*%%%*/
- $$ = new_if($2, $4, $5, &@$);
+ $$ = NEW_IF(cond($2), $4, $5);
fixpos($$, $2);
/*%
$$ = dispatch3(if, $2, $4, escape_Qundef($5));
@@ -2867,7 +2773,7 @@ primary : literal
k_end
{
/*%%%*/
- $$ = new_unless($2, $4, $5, &@$);
+ $$ = NEW_UNLESS(cond($2), $4, $5);
fixpos($$, $2);
/*%
$$ = dispatch3(unless, $2, $4, escape_Qundef($5));
@@ -2878,9 +2784,8 @@ primary : literal
k_end
{
/*%%%*/
- $$ = NEW_WHILE(cond($3, &@3), $6, 1);
+ $$ = NEW_WHILE(cond($3), $6, 1);
fixpos($$, $3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(while, $3, $6);
%*/
@@ -2890,9 +2795,8 @@ primary : literal
k_end
{
/*%%%*/
- $$ = NEW_UNTIL(cond($3, &@3), $6, 1);
+ $$ = NEW_UNTIL(cond($3), $6, 1);
fixpos($$, $3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(until, $3, $6);
%*/
@@ -2904,7 +2808,6 @@ primary : literal
/*%%%*/
$$ = NEW_CASE($2, $4);
fixpos($$, $2);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(case, $2, $4);
%*/
@@ -2912,9 +2815,7 @@ primary : literal
| k_case opt_terms case_body k_end
{
/*%%%*/
- $$ = NEW_CASE2($3);
- nd_set_line($3, $<num>1);
- $$->nd_loc = @$;
+ $$ = NEW_CASE(0, $3);
/*%
$$ = dispatch2(case, Qnil, $3);
%*/
@@ -2930,7 +2831,7 @@ primary : literal
/*
* for a, b, c in e
* #=>
- * e.each{|*x| a, b, c = x}
+ * e.each{|*x| a, b, c = x
*
* for a in e
* #=>
@@ -2941,32 +2842,45 @@ primary : literal
NODE *m = NEW_ARGS_AUX(0, 0);
NODE *args, *scope;
- switch (nd_type($2)) {
- case NODE_MASGN:
- m->nd_next = node_assign($2, new_for(new_dvar(id, &@2), 0, 0, &@2), &@2);
- args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0, &@2), &@2);
- break;
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- $2->nd_value = new_dvar(id, &@2);
- m->nd_plen = 1;
- m->nd_next = $2;
- args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0, &@2), &@2);
- break;
- default:
- {
- NODE *masgn = new_masgn(new_list($2, &@2), 0, &@2);
- m->nd_next = node_assign(masgn, new_dvar(id, &@2), &@2);
- args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0, &@2), &@2);
- break;
+ if (nd_type($2) == NODE_MASGN) {
+ /* if args.length == 1 && args[0].kind_of?(Array)
+ * args = args[0]
+ * end
+ */
+ NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1)));
+ NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0)));
+ m->nd_next = block_append(
+ NEW_IF(
+ NEW_NODE(NODE_AND,
+ NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0),
+ idEq, one),
+ NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero),
+ rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))),
+ 0),
+ NEW_DASGN_CURR(id,
+ NEW_CALL(NEW_DVAR(id), idAREF, zero)),
+ 0),
+ node_assign($2, NEW_DVAR(id)));
+
+ args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0));
+ }
+ else {
+ if (nd_type($2) == NODE_LASGN ||
+ nd_type($2) == NODE_DASGN ||
+ nd_type($2) == NODE_DASGN_CURR) {
+ $2->nd_value = NEW_DVAR(id);
+ m->nd_plen = 1;
+ m->nd_next = $2;
+ args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0));
+ }
+ else {
+ m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id));
+ args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0));
}
}
- add_mark_object((VALUE)rb_imemo_alloc_new((VALUE)tbl, 0, 0, 0));
scope = NEW_NODE(NODE_SCOPE, tbl, $8, args);
- scope->nd_loc = @$;
tbl[0] = 1; tbl[1] = id;
- $$ = new_for(0, $5, scope, &@$);
+ $$ = NEW_FOR(0, $5, scope);
fixpos($$, $2);
/*%
$$ = dispatch3(for, $2, $5, $8);
@@ -2974,10 +2888,8 @@ primary : literal
}
| k_class cpath superclass
{
- if (in_def)
- yyerror0("class definition in method body");
- $<num>1 = in_class;
- in_class = 1;
+ if (in_def || in_single)
+ yyerror("class definition in method body");
local_push(0);
/*%%%*/
$<num>$ = ruby_sourceline;
@@ -2989,46 +2901,40 @@ primary : literal
{
/*%%%*/
$$ = NEW_CLASS($2, $5, $3);
- $$->nd_body->nd_loc = @$;
- set_line_body($5, $<num>4);
nd_set_line($$, $<num>4);
- $$->nd_loc = @$;
/*%
$$ = dispatch3(class, $2, $3, $5);
%*/
local_pop();
- in_class = $<num>1 & 1;
}
| k_class tLSHFT expr
{
- $<num>$ = (in_class << 1) | in_def;
+ $<num>$ = in_def;
in_def = 0;
- in_class = 0;
- local_push(0);
}
term
+ {
+ $<num>$ = in_single;
+ in_single = 0;
+ local_push(0);
+ }
bodystmt
k_end
{
/*%%%*/
- $$ = NEW_SCLASS($3, $6);
- $$->nd_body->nd_loc = @$;
- set_line_body($6, nd_line($3));
+ $$ = NEW_SCLASS($3, $7);
fixpos($$, $3);
- $$->nd_loc = @$;
/*%
- $$ = dispatch2(sclass, $3, $6);
+ $$ = dispatch2(sclass, $3, $7);
%*/
local_pop();
- in_def = $<num>4 & 1;
- in_class = ($<num>4 >> 1) & 1;
+ in_def = $<num>4;
+ in_single = $<num>6;
}
| k_module cpath
{
- if (in_def)
- yyerror0("module definition in method body");
- $<num>1 = in_class;
- in_class = 1;
+ if (in_def || in_single)
+ yyerror("module definition in method body");
local_push(0);
/*%%%*/
$<num>$ = ruby_sourceline;
@@ -3040,53 +2946,40 @@ primary : literal
{
/*%%%*/
$$ = NEW_MODULE($2, $4);
- $$->nd_body->nd_loc = @$;
- set_line_body($4, $<num>3);
nd_set_line($$, $<num>3);
- $$->nd_loc = @$;
/*%
$$ = dispatch2(module, $2, $4);
%*/
local_pop();
- in_class = $<num>1 & 1;
}
| k_def fname
{
+ $<id>$ = cur_mid;
+ cur_mid = $2;
+ in_def++;
local_push(0);
- $<id>$ = current_arg;
- current_arg = 0;
- }
- {
- $<num>$ = in_def;
- in_def = 1;
}
f_arglist
bodystmt
k_end
{
/*%%%*/
- NODE *body = remove_begin($6);
+ NODE *body = remove_begin($5);
reduce_nodes(&body);
- $$ = NEW_DEFN($2, $5, body, METHOD_VISI_PRIVATE);
- $$->nd_defn->nd_loc = @$;
- set_line_body(body, $<num>1);
+ $$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE);
nd_set_line($$, $<num>1);
- $$->nd_loc = @$;
/*%
- $$ = dispatch3(def, $2, $5, $6);
+ $$ = dispatch3(def, $2, $4, $5);
%*/
local_pop();
- in_def = $<num>4 & 1;
- current_arg = $<id>3;
+ in_def--;
+ cur_mid = $<id>3;
}
- | k_def singleton dot_or_colon {SET_LEX_STATE(EXPR_FNAME);} fname
+ | k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname
{
- $<num>4 = in_def;
- in_def = 1;
- SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
+ in_single++;
+ lex_state = EXPR_ENDFN; /* force for args */
local_push(0);
- $<id>$ = current_arg;
- current_arg = 0;
}
f_arglist
bodystmt
@@ -3096,22 +2989,17 @@ primary : literal
NODE *body = remove_begin($8);
reduce_nodes(&body);
$$ = NEW_DEFS($2, $5, $7, body);
- $$->nd_defn->nd_loc = @$;
- set_line_body(body, $<num>1);
nd_set_line($$, $<num>1);
- $$->nd_loc = @$;
/*%
- $$ = dispatch5(defs, $2, $<val>3, $5, $7, $8);
+ $$ = dispatch5(defs, $2, $3, $5, $7, $8);
%*/
local_pop();
- in_def = $<num>4 & 1;
- current_arg = $<id>6;
+ in_single--;
}
| keyword_break
{
/*%%%*/
$$ = NEW_BREAK(0);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(break, arg_new());
%*/
@@ -3120,7 +3008,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_NEXT(0);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(next, arg_new());
%*/
@@ -3129,7 +3016,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_REDO();
- $$->nd_loc = @$;
/*%
$$ = dispatch0(redo);
%*/
@@ -3138,7 +3024,6 @@ primary : literal
{
/*%%%*/
$$ = NEW_RETRY();
- $$->nd_loc = @$;
/*%
$$ = dispatch0(retry);
%*/
@@ -3150,7 +3035,7 @@ primary_value : primary
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
+ if (!$$) $$ = NEW_NIL();
/*%
$$ = $1;
%*/
@@ -3190,10 +3075,6 @@ k_until : keyword_until
k_case : keyword_case
{
token_info_push("case");
- /*%%%*/
- $<num>$ = ruby_sourceline;
- /*%
- %*/
}
;
@@ -3231,13 +3112,6 @@ k_end : keyword_end
}
;
-k_return : keyword_return
- {
- if (in_class && !in_def && !dyna_in_block())
- yyerror0("Invalid return in class/module body");
- }
- ;
-
then : term
/*%c%*/
/*%c
@@ -3265,7 +3139,7 @@ if_tail : opt_else
if_tail
{
/*%%%*/
- $$ = new_if($2, $4, $5, &@$);
+ $$ = NEW_IF(cond($2), $4, $5);
fixpos($$, $2);
/*%
$$ = dispatch3(elsif, $2, $4, escape_Qundef($5));
@@ -3290,9 +3164,10 @@ for_var : lhs
f_marg : f_norm_arg
{
- $$ = assignable($1, 0, &@$);
+ $$ = assignable($1, 0);
/*%%%*/
/*%
+ $$ = dispatch1(mlhs_paren, $$);
%*/
}
| tLPAREN f_margs rparen
@@ -3308,7 +3183,7 @@ f_marg : f_norm_arg
f_marg_list : f_marg
{
/*%%%*/
- $$ = new_list($1, &@$);
+ $$ = NEW_LIST($1);
/*%
$$ = mlhs_add(mlhs_new(), $1);
%*/
@@ -3326,34 +3201,33 @@ f_marg_list : f_marg
f_margs : f_marg_list
{
/*%%%*/
- $$ = new_masgn($1, 0, &@$);
+ $$ = NEW_MASGN($1, 0);
/*%
$$ = $1;
%*/
}
| f_marg_list ',' tSTAR f_norm_arg
{
- $$ = assignable($4, 0, &@$);
+ $$ = assignable($4, 0);
/*%%%*/
- $$ = new_masgn($1, $$, &@$);
+ $$ = NEW_MASGN($1, $$);
/*%
$$ = mlhs_add_star($1, $$);
%*/
}
| f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list
{
- $$ = assignable($4, 0, &@$);
+ $$ = assignable($4, 0);
/*%%%*/
- $$ = new_masgn($1, new_postarg($$, $6, &@$), &@$);
+ $$ = NEW_MASGN($1, NEW_POSTARG($$, $6));
/*%
$$ = mlhs_add_star($1, $$);
- $$ = mlhs_add_post($$, $6);
%*/
}
| f_marg_list ',' tSTAR
{
/*%%%*/
- $$ = new_masgn($1, NODE_SPECIAL_NO_NAME_REST, &@$);
+ $$ = NEW_MASGN($1, -1);
/*%
$$ = mlhs_add_star($1, Qnil);
%*/
@@ -3361,35 +3235,36 @@ f_margs : f_marg_list
| f_marg_list ',' tSTAR ',' f_marg_list
{
/*%%%*/
- $$ = new_masgn($1, new_postarg(NODE_SPECIAL_NO_NAME_REST, $5, &@$), &@$);
+ $$ = NEW_MASGN($1, NEW_POSTARG(-1, $5));
/*%
- $$ = mlhs_add_star($1, Qnil);
- $$ = mlhs_add_post($$, $5);
+ $$ = mlhs_add_star($1, $5);
%*/
}
| tSTAR f_norm_arg
{
- $$ = assignable($2, 0, &@$);
+ $$ = assignable($2, 0);
/*%%%*/
- $$ = new_masgn(0, $$, &@$);
+ $$ = NEW_MASGN(0, $$);
/*%
$$ = mlhs_add_star(mlhs_new(), $$);
%*/
}
| tSTAR f_norm_arg ',' f_marg_list
{
- $$ = assignable($2, 0, &@$);
+ $$ = assignable($2, 0);
/*%%%*/
- $$ = new_masgn(0, new_postarg($$, $4, &@$), &@$);
+ $$ = NEW_MASGN(0, NEW_POSTARG($$, $4));
/*%
- $$ = mlhs_add_star(mlhs_new(), $$);
- $$ = mlhs_add_post($$, $4);
+ #if 0
+ TODO: Check me
+ #endif
+ $$ = mlhs_add_star($$, $4);
%*/
}
| tSTAR
{
/*%%%*/
- $$ = new_masgn(0, NODE_SPECIAL_NO_NAME_REST, &@$);
+ $$ = NEW_MASGN(0, -1);
/*%
$$ = mlhs_add_star(mlhs_new(), Qnil);
%*/
@@ -3397,10 +3272,9 @@ f_margs : f_marg_list
| tSTAR ',' f_marg_list
{
/*%%%*/
- $$ = new_masgn(0, new_postarg(NODE_SPECIAL_NO_NAME_REST, $3, &@$), &@$);
+ $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3));
/*%
$$ = mlhs_add_star(mlhs_new(), Qnil);
- $$ = mlhs_add_post($$, $3);
%*/
}
;
@@ -3408,19 +3282,19 @@ f_margs : f_marg_list
block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg
{
- $$ = new_args_tail($1, $3, $4, &@3);
+ $$ = new_args_tail($1, $3, $4);
}
| f_block_kwarg opt_f_block_arg
{
- $$ = new_args_tail($1, Qnone, $2, &@1);
+ $$ = new_args_tail($1, Qnone, $2);
}
| f_kwrest opt_f_block_arg
{
- $$ = new_args_tail(Qnone, $1, $2, &@1);
+ $$ = new_args_tail(Qnone, $1, $2);
}
| f_block_arg
{
- $$ = new_args_tail(Qnone, Qnone, $1, &@1);
+ $$ = new_args_tail(Qnone, Qnone, $1);
}
;
@@ -3430,33 +3304,33 @@ opt_block_args_tail : ',' block_args_tail
}
| /* none */
{
- $$ = new_args_tail(Qnone, Qnone, Qnone, &@0);
+ $$ = new_args_tail(Qnone, Qnone, Qnone);
}
;
block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail
{
- $$ = new_args($1, $3, $5, Qnone, $6, &@$);
+ $$ = new_args($1, $3, $5, Qnone, $6);
}
| f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail
{
- $$ = new_args($1, $3, $5, $7, $8, &@$);
+ $$ = new_args($1, $3, $5, $7, $8);
}
| f_arg ',' f_block_optarg opt_block_args_tail
{
- $$ = new_args($1, $3, Qnone, Qnone, $4, &@$);
+ $$ = new_args($1, $3, Qnone, Qnone, $4);
}
| f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail
{
- $$ = new_args($1, $3, Qnone, $5, $6, &@$);
+ $$ = new_args($1, $3, Qnone, $5, $6);
}
| f_arg ',' f_rest_arg opt_block_args_tail
{
- $$ = new_args($1, Qnone, $3, Qnone, $4, &@$);
+ $$ = new_args($1, Qnone, $3, Qnone, $4);
}
| f_arg ','
{
- $$ = new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone, &@1), &@$);
+ $$ = new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone));
/*%%%*/
/*%
dispatch1(excessed_comma, $$);
@@ -3464,39 +3338,39 @@ block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail
}
| f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail
{
- $$ = new_args($1, Qnone, $3, $5, $6, &@$);
+ $$ = new_args($1, Qnone, $3, $5, $6);
}
| f_arg opt_block_args_tail
{
- $$ = new_args($1, Qnone, Qnone, Qnone, $2, &@$);
+ $$ = new_args($1, Qnone, Qnone, Qnone, $2);
}
| f_block_optarg ',' f_rest_arg opt_block_args_tail
{
- $$ = new_args(Qnone, $1, $3, Qnone, $4, &@$);
+ $$ = new_args(Qnone, $1, $3, Qnone, $4);
}
| f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail
{
- $$ = new_args(Qnone, $1, $3, $5, $6, &@$);
+ $$ = new_args(Qnone, $1, $3, $5, $6);
}
| f_block_optarg opt_block_args_tail
{
- $$ = new_args(Qnone, $1, Qnone, Qnone, $2, &@$);
+ $$ = new_args(Qnone, $1, Qnone, Qnone, $2);
}
| f_block_optarg ',' f_arg opt_block_args_tail
{
- $$ = new_args(Qnone, $1, Qnone, $3, $4, &@$);
+ $$ = new_args(Qnone, $1, Qnone, $3, $4);
}
| f_rest_arg opt_block_args_tail
{
- $$ = new_args(Qnone, Qnone, $1, Qnone, $2, &@$);
+ $$ = new_args(Qnone, Qnone, $1, Qnone, $2);
}
| f_rest_arg ',' f_arg opt_block_args_tail
{
- $$ = new_args(Qnone, Qnone, $1, $3, $4, &@$);
+ $$ = new_args(Qnone, Qnone, $1, $3, $4);
}
| block_args_tail
{
- $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1, &@$);
+ $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1);
}
;
@@ -3509,7 +3383,6 @@ opt_block_param : none
block_param_def : '|' opt_bv_decl '|'
{
- current_arg = 0;
/*%%%*/
$$ = 0;
/*%
@@ -3528,7 +3401,6 @@ block_param_def : '|' opt_bv_decl '|'
}
| '|' block_param opt_bv_decl '|'
{
- current_arg = 0;
/*%%%*/
$$ = $2;
/*%
@@ -3556,14 +3428,14 @@ bv_decls : bvar
/*%c%*/
/*%c
{
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
}
%*/
| bv_decls ',' bvar
/*%c%*/
/*%c
{
- rb_ary_push($1, get_value($3));
+ rb_ary_push($1, $3);
}
%*/
;
@@ -3593,22 +3465,14 @@ lambda : {
{
$<num>$ = ruby_sourceline;
}
- {
- $<val>$ = cmdarg_stack;
- CMDARG_SET(0);
- }
lambda_body
{
lpar_beg = $<num>2;
- CMDARG_SET($<val>5);
- CMDARG_LEXPOP();
/*%%%*/
- $$ = NEW_LAMBDA($3, $6);
+ $$ = NEW_LAMBDA($3, $5);
nd_set_line($$, $<num>4);
- $$->nd_loc = @$;
- $$->nd_body->nd_loc = @$;
/*%
- $$ = dispatch2(lambda, $3, $6);
+ $$ = dispatch2(lambda, $3, $5);
%*/
dyna_pop($<vars>1);
}
@@ -3630,10 +3494,9 @@ f_larglist : '(' f_args opt_bv_decl ')'
lambda_body : tLAMBEG compstmt '}'
{
- token_info_pop("}");
$$ = $2;
}
- | keyword_do_LAMBDA compstmt k_end
+ | keyword_do_LAMBDA compstmt keyword_end
{
$$ = $2;
}
@@ -3641,18 +3504,22 @@ lambda_body : tLAMBEG compstmt '}'
do_block : keyword_do_block
{
+ $<vars>1 = dyna_push();
/*%%%*/
$<num>$ = ruby_sourceline;
/*% %*/
}
- do_body keyword_end
+ opt_block_param
+ compstmt
+ keyword_end
{
- $$ = $3;
/*%%%*/
- $3->nd_body->nd_loc.first_loc = @1.first_loc;
- $3->nd_body->nd_loc.last_loc = @4.last_loc;
+ $$ = NEW_ITER($3,$4);
nd_set_line($$, $<num>2);
- /*% %*/
+ /*%
+ $$ = dispatch2(do_block, escape_Qundef($3), $4);
+ %*/
+ dyna_pop($<vars>1);
}
;
@@ -3666,23 +3533,26 @@ block_call : command do_block
block_dup_check($1->nd_args, $2);
}
$2->nd_iter = $1;
- $2->nd_loc = @$;
$$ = $2;
fixpos($$, $1);
/*%
$$ = method_add_block($1, $2);
%*/
}
- | block_call call_op2 operation2 opt_paren_args
+ | block_call dot_or_colon operation2 opt_paren_args
{
- $$ = new_qcall($2, $1, $3, $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $4);
+ /*%
+ $$ = dispatch3(call, $1, $2, $3);
+ $$ = method_optarg($$, $4);
+ %*/
}
- | block_call call_op2 operation2 opt_paren_args brace_block
+ | block_call dot_or_colon operation2 opt_paren_args brace_block
{
/*%%%*/
block_dup_check($4, $5);
- $5->nd_iter = new_command_qcall($2, $1, $3, $4, &@$);
- $5->nd_loc = @$;
+ $5->nd_iter = NEW_CALL($1, $3, $4);
$$ = $5;
fixpos($$, $1);
/*%
@@ -3690,12 +3560,11 @@ block_call : command do_block
$$ = method_add_block($$, $5);
%*/
}
- | block_call call_op2 operation2 command_args do_block
+ | block_call dot_or_colon operation2 command_args do_block
{
/*%%%*/
block_dup_check($4, $5);
- $5->nd_iter = new_command_qcall($2, $1, $3, $4, &@$);
- $5->nd_loc = @$;
+ $5->nd_iter = NEW_CALL($1, $3, $4);
$$ = $5;
fixpos($$, $1);
/*%
@@ -3710,12 +3579,11 @@ method_call : fcall paren_args
/*%%%*/
$$ = $1;
$$->nd_args = $2;
- nd_set_last_loc($1, @2.last_loc);
/*%
$$ = method_arg(dispatch1(fcall, $1), $2);
%*/
}
- | primary_value call_op operation2
+ | primary_value '.' operation2
{
/*%%%*/
$<num>$ = ruby_sourceline;
@@ -3723,8 +3591,13 @@ method_call : fcall paren_args
}
opt_paren_args
{
- $$ = new_qcall($2, $1, $3, $5, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $5);
nd_set_line($$, $<num>4);
+ /*%
+ $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
+ $$ = method_optarg($$, $5);
+ %*/
}
| primary_value tCOLON2 operation2
{
@@ -3734,14 +3607,23 @@ method_call : fcall paren_args
}
paren_args
{
- $$ = new_qcall(ID2VAL(idCOLON2), $1, $3, $5, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, $5);
nd_set_line($$, $<num>4);
+ /*%
+ $$ = dispatch3(call, $1, ripper_id2sym('.'), $3);
+ $$ = method_optarg($$, $5);
+ %*/
}
| primary_value tCOLON2 operation3
{
- $$ = new_qcall(ID2VAL(idCOLON2), $1, $3, Qnull, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, $3, 0);
+ /*%
+ $$ = dispatch3(call, $1, ripper_intern("::"), $3);
+ %*/
}
- | primary_value call_op
+ | primary_value '.'
{
/*%%%*/
$<num>$ = ruby_sourceline;
@@ -3749,8 +3631,14 @@ method_call : fcall paren_args
}
paren_args
{
- $$ = new_qcall($2, $1, ID2VAL(idCall), $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, rb_intern("call"), $4);
nd_set_line($$, $<num>3);
+ /*%
+ $$ = dispatch3(call, $1, ripper_id2sym('.'),
+ ripper_intern("call"));
+ $$ = method_optarg($$, $4);
+ %*/
}
| primary_value tCOLON2
{
@@ -3760,14 +3648,19 @@ method_call : fcall paren_args
}
paren_args
{
- $$ = new_qcall(ID2VAL(idCOLON2), $1, ID2VAL(idCall), $4, &@$);
+ /*%%%*/
+ $$ = NEW_CALL($1, rb_intern("call"), $4);
nd_set_line($$, $<num>3);
+ /*%
+ $$ = dispatch3(call, $1, ripper_intern("::"),
+ ripper_intern("call"));
+ $$ = method_optarg($$, $4);
+ %*/
}
| keyword_super paren_args
{
/*%%%*/
$$ = NEW_SUPER($2);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(super, $2);
%*/
@@ -3776,7 +3669,6 @@ method_call : fcall paren_args
{
/*%%%*/
$$ = NEW_ZSUPER();
- $$->nd_loc = @$;
/*%
$$ = dispatch0(zsuper);
%*/
@@ -3785,9 +3677,9 @@ method_call : fcall paren_args
{
/*%%%*/
if ($1 && nd_type($1) == NODE_SELF)
- $$ = new_fcall(tAREF, $3, &@$);
+ $$ = NEW_FCALL(tAREF, $3);
else
- $$ = new_call($1, tAREF, $3, &@$);
+ $$ = NEW_CALL($1, tAREF, $3);
fixpos($$, $1);
/*%
$$ = dispatch2(aref, $1, escape_Qundef($3));
@@ -3797,53 +3689,41 @@ method_call : fcall paren_args
brace_block : '{'
{
+ $<vars>1 = dyna_push();
/*%%%*/
$<num>$ = ruby_sourceline;
- /*% %*/
+ /*%
+ %*/
}
- brace_body '}'
+ opt_block_param
+ compstmt '}'
{
- $$ = $3;
/*%%%*/
- $3->nd_body->nd_loc.first_loc = @1.first_loc;
- $3->nd_body->nd_loc.last_loc = @4.last_loc;
+ $$ = NEW_ITER($3,$4);
nd_set_line($$, $<num>2);
- /*% %*/
+ /*%
+ $$ = dispatch2(brace_block, escape_Qundef($3), $4);
+ %*/
+ dyna_pop($<vars>1);
}
| keyword_do
{
+ $<vars>1 = dyna_push();
/*%%%*/
$<num>$ = ruby_sourceline;
- /*% %*/
+ /*%
+ %*/
}
- do_body keyword_end
+ opt_block_param
+ compstmt keyword_end
{
- $$ = $3;
/*%%%*/
- $3->nd_body->nd_loc.first_loc = @1.first_loc;
- $3->nd_body->nd_loc.last_loc = @4.last_loc;
+ $$ = NEW_ITER($3,$4);
nd_set_line($$, $<num>2);
- /*% %*/
- }
- ;
-
-brace_body : {$<vars>$ = dyna_push();}
- {$<val>$ = cmdarg_stack >> 1; CMDARG_SET(0);}
- opt_block_param compstmt
- {
- $$ = new_brace_body($3, $4, &@$);
- dyna_pop($<vars>1);
- CMDARG_SET($<val>2);
- }
- ;
-
-do_body : {$<vars>$ = dyna_push();}
- {$<val>$ = cmdarg_stack; CMDARG_SET(0);}
- opt_block_param bodystmt
- {
- $$ = new_do_body($3, $4, &@$);
+ /*%
+ $$ = dispatch2(do_block, escape_Qundef($3), $4);
+ %*/
dyna_pop($<vars>1);
- CMDARG_SET($<val>2);
}
;
@@ -3853,7 +3733,6 @@ case_body : keyword_when args then
{
/*%%%*/
$$ = NEW_WHEN($2, $4, $5);
- $$->nd_loc = @$;
/*%
$$ = dispatch3(when, $2, $4, escape_Qundef($5));
%*/
@@ -3870,13 +3749,10 @@ opt_rescue : keyword_rescue exc_list exc_var then
{
/*%%%*/
if ($3) {
- YYLTYPE location;
- location.first_loc = @3.first_loc;
- location.last_loc = @5.last_loc;
- $3 = node_assign($3, new_errinfo(&@3), &@3);
- $5 = block_append($3, $5, &location);
+ $3 = node_assign($3, NEW_ERRINFO());
+ $5 = block_append($3, $5);
}
- $$ = new_resbody($2, $5, $6, &@$);
+ $$ = NEW_RESBODY($2, $5, $6);
fixpos($$, $2?$2:$5);
/*%
$$ = dispatch4(rescue,
@@ -3892,9 +3768,9 @@ opt_rescue : keyword_rescue exc_list exc_var then
exc_list : arg_value
{
/*%%%*/
- $$ = new_list($1, &@$);
+ $$ = NEW_LIST($1);
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
| mrhs
@@ -3930,7 +3806,7 @@ literal : numeric
| symbol
{
/*%%%*/
- $$ = new_lit(ID2SYM($1), &@$);
+ $$ = NEW_LIT(ID2SYM($1));
/*%
$$ = dispatch1(symbol_literal, $1);
%*/
@@ -3943,7 +3819,7 @@ strings : string
/*%%%*/
NODE *node = $1;
if (!node) {
- node = new_str(STR_NEW0(), &@$);
+ node = NEW_STR(STR_NEW0());
}
else {
node = evstr2dstr(node);
@@ -3956,17 +3832,11 @@ strings : string
;
string : tCHAR
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
| string1
| string string1
{
/*%%%*/
- $$ = literal_concat($1, $2, &@$);
+ $$ = literal_concat($1, $2);
/*%
$$ = dispatch2(string_concat, $1, $2);
%*/
@@ -3975,32 +3845,121 @@ string : tCHAR
string1 : tSTRING_BEG string_contents tSTRING_END
{
- $$ = new_string1(heredoc_dedent($2));
/*%%%*/
- if ($$) nd_set_loc($$, &@$);
+ $$ = $2;
/*%
+ $$ = dispatch1(string_literal, $2);
%*/
}
;
xstring : tXSTRING_BEG xstring_contents tSTRING_END
{
- $$ = new_xstring(heredoc_dedent($2), &@$);
+ /*%%%*/
+ NODE *node = $2;
+ if (!node) {
+ node = NEW_XSTR(STR_NEW0());
+ }
+ else {
+ switch (nd_type(node)) {
+ case NODE_STR:
+ nd_set_type(node, NODE_XSTR);
+ break;
+ case NODE_DSTR:
+ nd_set_type(node, NODE_DXSTR);
+ break;
+ default:
+ node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node));
+ break;
+ }
+ }
+ $$ = node;
+ /*%
+ $$ = dispatch1(xstring_literal, $2);
+ %*/
}
;
regexp : tREGEXP_BEG regexp_contents tREGEXP_END
{
- $$ = new_regexp($2, $3, &@$);
+ /*%%%*/
+ int options = $3;
+ NODE *node = $2;
+ NODE *list, *prev;
+ if (!node) {
+ node = NEW_LIT(reg_compile(STR_NEW0(), options));
+ }
+ else switch (nd_type(node)) {
+ case NODE_STR:
+ {
+ VALUE src = node->nd_lit;
+ nd_set_type(node, NODE_LIT);
+ node->nd_lit = reg_compile(src, options);
+ }
+ break;
+ default:
+ node = NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node));
+ case NODE_DSTR:
+ if (options & RE_OPTION_ONCE) {
+ nd_set_type(node, NODE_DREGX_ONCE);
+ }
+ else {
+ nd_set_type(node, NODE_DREGX);
+ }
+ node->nd_cflag = options & RE_OPTION_MASK;
+ if (!NIL_P(node->nd_lit)) reg_fragment_check(node->nd_lit, options);
+ for (list = (prev = node)->nd_next; list; list = list->nd_next) {
+ if (nd_type(list->nd_head) == NODE_STR) {
+ VALUE tail = list->nd_head->nd_lit;
+ if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) {
+ VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
+ if (!literal_concat0(parser, lit, tail)) {
+ node = 0;
+ break;
+ }
+ rb_str_resize(tail, 0);
+ prev->nd_next = list->nd_next;
+ rb_gc_force_recycle((VALUE)list->nd_head);
+ rb_gc_force_recycle((VALUE)list);
+ list = prev;
+ }
+ else {
+ prev = list;
+ }
+ }
+ else {
+ prev = 0;
+ }
+ }
+ if (!node->nd_next) {
+ VALUE src = node->nd_lit;
+ nd_set_type(node, NODE_LIT);
+ node->nd_lit = reg_compile(src, options);
+ }
+ break;
+ }
+ $$ = node;
+ /*%
+ $$ = dispatch2(regexp_literal, $2, $3);
+ %*/
}
;
-words : tWORDS_BEG ' ' word_list tSTRING_END
+words : tWORDS_BEG ' ' tSTRING_END
+ {
+ /*%%%*/
+ $$ = NEW_ZARRAY();
+ /*%
+ $$ = dispatch0(words_new);
+ $$ = dispatch1(array, $$);
+ %*/
+ }
+ | tWORDS_BEG word_list tSTRING_END
{
/*%%%*/
- $$ = make_array($3, &@$);
+ $$ = $2;
/*%
- $$ = dispatch1(array, $3);
+ $$ = dispatch1(array, $2);
%*/
}
;
@@ -4034,19 +3993,28 @@ word : string_content
| word string_content
{
/*%%%*/
- $$ = literal_concat($1, $2, &@$);
+ $$ = literal_concat($1, $2);
/*%
$$ = dispatch2(word_add, $1, $2);
%*/
}
;
-symbols : tSYMBOLS_BEG ' ' symbol_list tSTRING_END
+symbols : tSYMBOLS_BEG ' ' tSTRING_END
+ {
+ /*%%%*/
+ $$ = NEW_ZARRAY();
+ /*%
+ $$ = dispatch0(symbols_new);
+ $$ = dispatch1(array, $$);
+ %*/
+ }
+ | tSYMBOLS_BEG symbol_list tSTRING_END
{
/*%%%*/
- $$ = make_array($3, &@$);
+ $$ = $2;
/*%
- $$ = dispatch1(array, $3);
+ $$ = dispatch1(array, $2);
%*/
}
;
@@ -4063,13 +4031,7 @@ symbol_list : /* none */
{
/*%%%*/
$2 = evstr2dstr($2);
- if (nd_type($2) == NODE_DSTR) {
- nd_set_type($2, NODE_DSYM);
- }
- else {
- nd_set_type($2, NODE_LIT);
- add_mark_object($2->nd_lit = rb_str_intern($2->nd_lit));
- }
+ nd_set_type($2, NODE_DSYM);
$$ = list_append($1, $2);
/*%
$$ = dispatch2(symbols_add, $1, $2);
@@ -4077,22 +4039,40 @@ symbol_list : /* none */
}
;
-qwords : tQWORDS_BEG ' ' qword_list tSTRING_END
+qwords : tQWORDS_BEG ' ' tSTRING_END
{
/*%%%*/
- $$ = make_array($3, &@$);
+ $$ = NEW_ZARRAY();
/*%
- $$ = dispatch1(array, $3);
+ $$ = dispatch0(qwords_new);
+ $$ = dispatch1(array, $$);
+ %*/
+ }
+ | tQWORDS_BEG qword_list tSTRING_END
+ {
+ /*%%%*/
+ $$ = $2;
+ /*%
+ $$ = dispatch1(array, $2);
%*/
}
;
-qsymbols : tQSYMBOLS_BEG ' ' qsym_list tSTRING_END
+qsymbols : tQSYMBOLS_BEG ' ' tSTRING_END
{
/*%%%*/
- $$ = make_array($3, &@$);
+ $$ = NEW_ZARRAY();
+ /*%
+ $$ = dispatch0(qsymbols_new);
+ $$ = dispatch1(array, $$);
+ %*/
+ }
+ | tQSYMBOLS_BEG qsym_list tSTRING_END
+ {
+ /*%%%*/
+ $$ = $2;
/*%
- $$ = dispatch1(array, $3);
+ $$ = dispatch1(array, $2);
%*/
}
;
@@ -4108,7 +4088,6 @@ qword_list : /* none */
| qword_list tSTRING_CONTENT ' '
{
/*%%%*/
- $2->nd_loc = @2;
$$ = list_append($1, $2);
/*%
$$ = dispatch2(qwords_add, $1, $2);
@@ -4129,9 +4108,8 @@ qsym_list : /* none */
/*%%%*/
VALUE lit;
lit = $2->nd_lit;
+ $2->nd_lit = ID2SYM(rb_intern_str(lit));
nd_set_type($2, NODE_LIT);
- add_mark_object($2->nd_lit = ID2SYM(rb_intern_str(lit)));
- $2->nd_loc = @2;
$$ = list_append($1, $2);
/*%
$$ = dispatch2(qsymbols_add, $1, $2);
@@ -4150,7 +4128,7 @@ string_contents : /* none */
| string_contents string_content
{
/*%%%*/
- $$ = literal_concat($1, $2, &@$);
+ $$ = literal_concat($1, $2);
/*%
$$ = dispatch2(string_add, $1, $2);
%*/
@@ -4168,7 +4146,7 @@ xstring_contents: /* none */
| xstring_contents string_content
{
/*%%%*/
- $$ = literal_concat($1, $2, &@$);
+ $$ = literal_concat($1, $2);
/*%
$$ = dispatch2(xstring_add, $1, $2);
%*/
@@ -4180,7 +4158,7 @@ regexp_contents: /* none */
/*%%%*/
$$ = 0;
/*%
- $$ = ripper_new_yylval(0, dispatch0(regexp_new), 0);
+ $$ = dispatch0(regexp_new);
%*/
}
| regexp_contents string_content
@@ -4201,50 +4179,31 @@ regexp_contents: /* none */
case NODE_DSTR:
break;
default:
- head = list_append(new_dstr(Qnil, &@$), head);
+ head = list_append(NEW_DSTR(Qnil), head);
break;
}
$$ = list_append(head, tail);
}
/*%
- VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
- if (ripper_is_node_yylval(n1)) {
- s1 = RNODE(n1)->nd_cval;
- n1 = RNODE(n1)->nd_rval;
- }
- if (ripper_is_node_yylval(n2)) {
- s2 = RNODE(n2)->nd_cval;
- n2 = RNODE(n2)->nd_rval;
- }
- $$ = dispatch2(regexp_add, n1, n2);
- if (!s1 && s2) {
- $$ = ripper_new_yylval(0, $$, s2);
- }
+ $$ = dispatch2(regexp_add, $1, $2);
%*/
}
;
string_content : tSTRING_CONTENT
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
| tSTRING_DVAR
{
- /* need to backup lex_strterm so that a string literal `%&foo,#$&,bar&` can be parsed */
- $<strterm>$ = lex_strterm;
+ $<node>$ = lex_strterm;
lex_strterm = 0;
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
}
string_dvar
{
- lex_strterm = $<strterm>2;
/*%%%*/
+ lex_strterm = $<node>2;
$$ = NEW_EVSTR($3);
- $$->nd_loc = @$;
/*%
+ lex_strterm = $<node>2;
$$ = dispatch1(string_dvar, $3);
%*/
}
@@ -4252,40 +4211,29 @@ string_content : tSTRING_CONTENT
{
$<val>1 = cond_stack;
$<val>$ = cmdarg_stack;
- COND_SET(0);
- CMDARG_SET(0);
+ cond_stack = 0;
+ cmdarg_stack = 0;
}
{
- /* need to backup lex_strterm so that a string literal `%!foo,#{ !0 },bar!` can be parsed */
- $<strterm>$ = lex_strterm;
+ $<node>$ = lex_strterm;
lex_strterm = 0;
- }
- {
- $<num>$ = lex_state;
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
}
{
$<num>$ = brace_nest;
brace_nest = 0;
}
- {
- $<num>$ = heredoc_indent;
- heredoc_indent = 0;
- }
compstmt tSTRING_DEND
{
- COND_SET($<val>1);
- CMDARG_SET($<val>2);
- lex_strterm = $<strterm>3;
- SET_LEX_STATE($<num>4);
- brace_nest = $<num>5;
- heredoc_indent = $<num>6;
- heredoc_line_indent = -1;
+ cond_stack = $<val>1;
+ cmdarg_stack = $<val>2;
+ lex_strterm = $<node>3;
+ brace_nest = $<num>4;
/*%%%*/
- if ($7) $7->flags &= ~NODE_FL_NEWLINE;
- $$ = new_evstr($7, &@$);
+ if ($5) $5->flags &= ~NODE_FL_NEWLINE;
+ $$ = new_evstr($5);
/*%
- $$ = dispatch1(string_embexpr, $7);
+ $$ = dispatch1(string_embexpr, $5);
%*/
}
;
@@ -4293,7 +4241,7 @@ string_content : tSTRING_CONTENT
string_dvar : tGVAR
{
/*%%%*/
- $$ = new_gvar($1, &@$);
+ $$ = NEW_GVAR($1);
/*%
$$ = dispatch1(var_ref, $1);
%*/
@@ -4301,7 +4249,7 @@ string_dvar : tGVAR
| tIVAR
{
/*%%%*/
- $$ = new_ivar($1, &@$);
+ $$ = NEW_IVAR($1);
/*%
$$ = dispatch1(var_ref, $1);
%*/
@@ -4310,7 +4258,6 @@ string_dvar : tGVAR
{
/*%%%*/
$$ = NEW_CVAR($1);
- $$->nd_loc = @$;
/*%
$$ = dispatch1(var_ref, $1);
%*/
@@ -4320,7 +4267,7 @@ string_dvar : tGVAR
symbol : tSYMBEG sym
{
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
+ lex_state = EXPR_END;
/*%%%*/
$$ = $2;
/*%
@@ -4335,11 +4282,11 @@ sym : fname
| tCVAR
;
-dsym : tSYMBEG string_contents tSTRING_END
+dsym : tSYMBEG xstring_contents tSTRING_END
{
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
+ lex_state = EXPR_END;
/*%%%*/
- $$ = dsym_node($2, &@$);
+ $$ = dsym_node($2);
/*%
$$ = dispatch1(dyna_symbol, $2);
%*/
@@ -4351,41 +4298,17 @@ numeric : simple_numeric
{
/*%%%*/
$$ = $2;
- add_mark_object($$->nd_lit = negate_lit($$->nd_lit));
+ $$->nd_lit = negate_lit($$->nd_lit);
/*%
- $$ = dispatch2(unary, ID2VAL(idUMinus), $2);
+ $$ = dispatch2(unary, ripper_intern("-@"), $2);
%*/
}
;
simple_numeric : tINTEGER
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
| tFLOAT
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
| tRATIONAL
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
| tIMAGINARY
- {
- /*%%%*/
- $$->nd_loc = @$;
- /*%
- %*/
- }
;
user_variable : tIDENTIFIER
@@ -4395,19 +4318,19 @@ user_variable : tIDENTIFIER
| tCVAR
;
-keyword_variable: keyword_nil {$$ = KWD2EID(nil, $1);}
- | keyword_self {$$ = KWD2EID(self, $1);}
- | keyword_true {$$ = KWD2EID(true, $1);}
- | keyword_false {$$ = KWD2EID(false, $1);}
- | keyword__FILE__ {$$ = KWD2EID(_FILE__, $1);}
- | keyword__LINE__ {$$ = KWD2EID(_LINE__, $1);}
- | keyword__ENCODING__ {$$ = KWD2EID(_ENCODING__, $1);}
+keyword_variable: keyword_nil {ifndef_ripper($$ = keyword_nil);}
+ | keyword_self {ifndef_ripper($$ = keyword_self);}
+ | keyword_true {ifndef_ripper($$ = keyword_true);}
+ | keyword_false {ifndef_ripper($$ = keyword_false);}
+ | keyword__FILE__ {ifndef_ripper($$ = keyword__FILE__);}
+ | keyword__LINE__ {ifndef_ripper($$ = keyword__LINE__);}
+ | keyword__ENCODING__ {ifndef_ripper($$ = keyword__ENCODING__);}
;
var_ref : user_variable
{
/*%%%*/
- if (!($$ = gettable($1, &@$))) $$ = new_begin(0, &@$);
+ if (!($$ = gettable($1))) $$ = NEW_BEGIN(0);
/*%
if (id_is_var(get_id($1))) {
$$ = dispatch1(var_ref, $1);
@@ -4420,7 +4343,7 @@ var_ref : user_variable
| keyword_variable
{
/*%%%*/
- if (!($$ = gettable($1, &@$))) $$ = new_begin(0, &@$);
+ if (!($$ = gettable($1))) $$ = NEW_BEGIN(0);
/*%
$$ = dispatch1(var_ref, $1);
%*/
@@ -4429,44 +4352,50 @@ var_ref : user_variable
var_lhs : user_variable
{
- $$ = assignable(var_field($1), 0, &@$);
+ $$ = assignable($1, 0);
+ /*%%%*/
+ /*%
+ $$ = dispatch1(var_field, $$);
+ %*/
}
| keyword_variable
{
- $$ = assignable(var_field($1), 0, &@$);
- }
- ;
-
-backref : tNTH_REF
- {
+ $$ = assignable($1, 0);
/*%%%*/
- $$->nd_loc = @$;
/*%
+ $$ = dispatch1(var_field, $$);
%*/
}
+ ;
+
+backref : tNTH_REF
| tBACK_REF
+ ;
+
+superclass : term
{
/*%%%*/
- $$->nd_loc = @$;
+ $$ = 0;
/*%
+ $$ = Qnil;
%*/
}
- ;
-
-superclass : '<'
+ | '<'
{
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
command_start = TRUE;
}
expr_value term
{
$$ = $3;
}
- | /* none */
+ | error term
{
/*%%%*/
+ yyerrok;
$$ = 0;
/*%
+ yyerrok;
$$ = Qnil;
%*/
}
@@ -4479,38 +4408,37 @@ f_arglist : '(' f_args rparen
/*%
$$ = dispatch1(paren, $2);
%*/
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
command_start = TRUE;
}
| {
- $<num>$ = parser->in_kwarg;
- parser->in_kwarg = 1;
- SET_LEX_STATE(lex_state|EXPR_LABEL); /* force for args */
+ $<num>$ = parser->parser_in_kwarg;
+ parser->parser_in_kwarg = 1;
}
f_args term
{
- parser->in_kwarg = !!$<num>1;
+ parser->parser_in_kwarg = $<num>1;
$$ = $2;
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
command_start = TRUE;
}
;
args_tail : f_kwarg ',' f_kwrest opt_f_block_arg
{
- $$ = new_args_tail($1, $3, $4, &@3);
+ $$ = new_args_tail($1, $3, $4);
}
| f_kwarg opt_f_block_arg
{
- $$ = new_args_tail($1, Qnone, $2, &@1);
+ $$ = new_args_tail($1, Qnone, $2);
}
| f_kwrest opt_f_block_arg
{
- $$ = new_args_tail(Qnone, $1, $2, &@1);
+ $$ = new_args_tail(Qnone, $1, $2);
}
| f_block_arg
{
- $$ = new_args_tail(Qnone, Qnone, $1, &@1);
+ $$ = new_args_tail(Qnone, Qnone, $1);
}
;
@@ -4520,111 +4448,107 @@ opt_args_tail : ',' args_tail
}
| /* none */
{
- $$ = new_args_tail(Qnone, Qnone, Qnone, &@0);
+ $$ = new_args_tail(Qnone, Qnone, Qnone);
}
;
f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail
{
- $$ = new_args($1, $3, $5, Qnone, $6, &@$);
+ $$ = new_args($1, $3, $5, Qnone, $6);
}
| f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail
{
- $$ = new_args($1, $3, $5, $7, $8, &@$);
+ $$ = new_args($1, $3, $5, $7, $8);
}
| f_arg ',' f_optarg opt_args_tail
{
- $$ = new_args($1, $3, Qnone, Qnone, $4, &@$);
+ $$ = new_args($1, $3, Qnone, Qnone, $4);
}
| f_arg ',' f_optarg ',' f_arg opt_args_tail
{
- $$ = new_args($1, $3, Qnone, $5, $6, &@$);
+ $$ = new_args($1, $3, Qnone, $5, $6);
}
| f_arg ',' f_rest_arg opt_args_tail
{
- $$ = new_args($1, Qnone, $3, Qnone, $4, &@$);
+ $$ = new_args($1, Qnone, $3, Qnone, $4);
}
| f_arg ',' f_rest_arg ',' f_arg opt_args_tail
{
- $$ = new_args($1, Qnone, $3, $5, $6, &@$);
+ $$ = new_args($1, Qnone, $3, $5, $6);
}
| f_arg opt_args_tail
{
- $$ = new_args($1, Qnone, Qnone, Qnone, $2, &@$);
+ $$ = new_args($1, Qnone, Qnone, Qnone, $2);
}
| f_optarg ',' f_rest_arg opt_args_tail
{
- $$ = new_args(Qnone, $1, $3, Qnone, $4, &@$);
+ $$ = new_args(Qnone, $1, $3, Qnone, $4);
}
| f_optarg ',' f_rest_arg ',' f_arg opt_args_tail
{
- $$ = new_args(Qnone, $1, $3, $5, $6, &@$);
+ $$ = new_args(Qnone, $1, $3, $5, $6);
}
| f_optarg opt_args_tail
{
- $$ = new_args(Qnone, $1, Qnone, Qnone, $2, &@$);
+ $$ = new_args(Qnone, $1, Qnone, Qnone, $2);
}
| f_optarg ',' f_arg opt_args_tail
{
- $$ = new_args(Qnone, $1, Qnone, $3, $4, &@$);
+ $$ = new_args(Qnone, $1, Qnone, $3, $4);
}
| f_rest_arg opt_args_tail
{
- $$ = new_args(Qnone, Qnone, $1, Qnone, $2, &@$);
+ $$ = new_args(Qnone, Qnone, $1, Qnone, $2);
}
| f_rest_arg ',' f_arg opt_args_tail
{
- $$ = new_args(Qnone, Qnone, $1, $3, $4, &@$);
+ $$ = new_args(Qnone, Qnone, $1, $3, $4);
}
| args_tail
{
- $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1, &@$);
+ $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1);
}
| /* none */
{
- $$ = new_args_tail(Qnone, Qnone, Qnone, &@0);
- $$ = new_args(Qnone, Qnone, Qnone, Qnone, $$, &@0);
+ $$ = new_args_tail(Qnone, Qnone, Qnone);
+ $$ = new_args(Qnone, Qnone, Qnone, Qnone, $$);
}
;
f_bad_arg : tCONSTANT
{
/*%%%*/
- yyerror0("formal argument cannot be a constant");
+ yyerror("formal argument cannot be a constant");
$$ = 0;
/*%
$$ = dispatch1(param_error, $1);
- ripper_error();
%*/
}
| tIVAR
{
/*%%%*/
- yyerror0("formal argument cannot be an instance variable");
+ yyerror("formal argument cannot be an instance variable");
$$ = 0;
/*%
$$ = dispatch1(param_error, $1);
- ripper_error();
%*/
}
| tGVAR
{
/*%%%*/
- yyerror0("formal argument cannot be a global variable");
+ yyerror("formal argument cannot be a global variable");
$$ = 0;
/*%
$$ = dispatch1(param_error, $1);
- ripper_error();
%*/
}
| tCVAR
{
/*%%%*/
- yyerror0("formal argument cannot be a class variable");
+ yyerror("formal argument cannot be a class variable");
$$ = 0;
/*%
$$ = dispatch1(param_error, $1);
- ripper_error();
%*/
}
;
@@ -4639,16 +4563,13 @@ f_norm_arg : f_bad_arg
f_arg_asgn : f_norm_arg
{
- ID id = get_id($1);
- arg_var(id);
- current_arg = id;
+ arg_var(get_id($1));
$$ = $1;
}
;
f_arg_item : f_arg_asgn
{
- current_arg = 0;
/*%%%*/
$$ = NEW_ARGS_AUX($1, 1);
/*%
@@ -4658,19 +4579,13 @@ f_arg_item : f_arg_asgn
| tLPAREN f_margs rparen
{
ID tid = internal_id();
- /*%%%*/
- YYLTYPE location;
- location.first_loc = @2.first_loc;
- location.last_loc = @2.first_loc;
- /*%
- %*/
arg_var(tid);
/*%%%*/
if (dyna_in_block()) {
- $2->nd_value = new_dvar(tid, &location);
+ $2->nd_value = NEW_DVAR(tid);
}
else {
- $2->nd_value = new_lvar(tid, &location);
+ $2->nd_value = NEW_LVAR(tid);
}
$$ = NEW_ARGS_AUX(tid, 1);
$$->nd_next = $2;
@@ -4684,7 +4599,7 @@ f_arg : f_arg_item
/*%c%*/
/*%c
{
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
}
c%*/
| f_arg ',' f_arg_item
@@ -4692,10 +4607,10 @@ f_arg : f_arg_item
/*%%%*/
$$ = $1;
$$->nd_plen++;
- $$->nd_next = block_append($$->nd_next, $3->nd_next, &@$);
- rb_discard_node($3);
+ $$->nd_next = block_append($$->nd_next, $3->nd_next);
+ rb_gc_force_recycle((VALUE)$3);
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -4703,51 +4618,47 @@ f_arg : f_arg_item
f_label : tLABEL
{
- ID id = get_id($1);
- arg_var(formal_argument(id));
- current_arg = id;
+ arg_var(formal_argument(get_id($1)));
$$ = $1;
}
;
f_kw : f_label arg_value
{
- current_arg = 0;
- $$ = assignable($1, $2, &@$);
+ $$ = assignable($1, $2);
/*%%%*/
- $$ = new_kw_arg($$, &@$);
+ $$ = NEW_KW_ARG(0, $$);
/*%
- $$ = rb_assoc_new(get_value($$), get_value($2));
+ $$ = rb_assoc_new($$, $2);
%*/
}
| f_label
{
- current_arg = 0;
- $$ = assignable($1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$);
+ $$ = assignable($1, (NODE *)-1);
/*%%%*/
- $$ = new_kw_arg($$, &@$);
+ $$ = NEW_KW_ARG(0, $$);
/*%
- $$ = rb_assoc_new(get_value($$), 0);
+ $$ = rb_assoc_new($$, 0);
%*/
}
;
f_block_kw : f_label primary_value
{
- $$ = assignable($1, $2, &@$);
+ $$ = assignable($1, $2);
/*%%%*/
- $$ = new_kw_arg($$, &@$);
+ $$ = NEW_KW_ARG(0, $$);
/*%
- $$ = rb_assoc_new(get_value($$), get_value($2));
+ $$ = rb_assoc_new($$, $2);
%*/
}
| f_label
{
- $$ = assignable($1, NODE_SPECIAL_REQUIRED_KEYWORD, &@$);
+ $$ = assignable($1, (NODE *)-1);
/*%%%*/
- $$ = new_kw_arg($$, &@$);
+ $$ = NEW_KW_ARG(0, $$);
/*%
- $$ = rb_assoc_new(get_value($$), 0);
+ $$ = rb_assoc_new($$, 0);
%*/
}
;
@@ -4757,15 +4668,21 @@ f_block_kwarg : f_block_kw
/*%%%*/
$$ = $1;
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
| f_block_kwarg ',' f_block_kw
{
/*%%%*/
- $$ = kwd_append($1, $3);
+ NODE *kws = $1;
+
+ while (kws->nd_next) {
+ kws = kws->nd_next;
+ }
+ kws->nd_next = $3;
+ $$ = $1;
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -4776,15 +4693,21 @@ f_kwarg : f_kw
/*%%%*/
$$ = $1;
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
| f_kwarg ',' f_kw
{
/*%%%*/
- $$ = kwd_append($1, $3);
+ NODE *kws = $1;
+
+ while (kws->nd_next) {
+ kws = kws->nd_next;
+ }
+ kws->nd_next = $3;
+ $$ = $1;
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -4796,45 +4719,32 @@ kwrest_mark : tPOW
f_kwrest : kwrest_mark tIDENTIFIER
{
shadowing_lvar(get_id($2));
- /*%%%*/
$$ = $2;
- /*%
- $$ = dispatch1(kwrest_param, $2);
- %*/
}
| kwrest_mark
{
- /*%%%*/
$$ = internal_id();
- arg_var($$);
- /*%
- $$ = dispatch1(kwrest_param, Qnil);
- %*/
}
;
f_opt : f_arg_asgn '=' arg_value
{
- current_arg = 0;
- $$ = assignable($1, $3, &@$);
+ $$ = assignable($1, $3);
/*%%%*/
$$ = NEW_OPT_ARG(0, $$);
- $$->nd_loc = @$;
/*%
- $$ = rb_assoc_new(get_value($$), get_value($3));
+ $$ = rb_assoc_new($$, $3);
%*/
}
;
f_block_opt : f_arg_asgn '=' primary_value
{
- current_arg = 0;
- $$ = assignable($1, $3, &@$);
+ $$ = assignable($1, $3);
/*%%%*/
$$ = NEW_OPT_ARG(0, $$);
- $$->nd_loc = @$;
/*%
- $$ = rb_assoc_new(get_value($$), get_value($3));
+ $$ = rb_assoc_new($$, $3);
%*/
}
;
@@ -4844,15 +4754,21 @@ f_block_optarg : f_block_opt
/*%%%*/
$$ = $1;
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
| f_block_optarg ',' f_block_opt
{
/*%%%*/
- $$ = opt_arg_append($1, $3);
+ NODE *opts = $1;
+
+ while (opts->nd_next) {
+ opts = opts->nd_next;
+ }
+ opts->nd_next = $3;
+ $$ = $1;
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -4862,15 +4778,21 @@ f_optarg : f_opt
/*%%%*/
$$ = $1;
/*%
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
%*/
}
| f_optarg ',' f_opt
{
/*%%%*/
- $$ = opt_arg_append($1, $3);
+ NODE *opts = $1;
+
+ while (opts->nd_next) {
+ opts = opts->nd_next;
+ }
+ opts->nd_next = $3;
+ $$ = $1;
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -4883,7 +4805,7 @@ f_rest_arg : restarg_mark tIDENTIFIER
{
/*%%%*/
if (!is_local_id($2))
- yyerror0("rest argument must be local variable");
+ yyerror("rest argument must be local variable");
/*% %*/
arg_var(shadowing_lvar(get_id($2)));
/*%%%*/
@@ -4911,9 +4833,9 @@ f_block_arg : blkarg_mark tIDENTIFIER
{
/*%%%*/
if (!is_local_id($2))
- yyerror0("block argument must be local variable");
+ yyerror("block argument must be local variable");
else if (!dyna_in_block() && local_id($2))
- yyerror0("duplicated block argument name");
+ yyerror("duplicated block argument name");
/*% %*/
arg_var(shadowing_lvar(get_id($2)));
/*%%%*/
@@ -4943,16 +4865,16 @@ singleton : var_ref
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL();
+ if (!$$) $$ = NEW_NIL();
/*%
$$ = $1;
%*/
}
- | '(' {SET_LEX_STATE(EXPR_BEG);} expr rparen
+ | '(' {lex_state = EXPR_BEG;} expr rparen
{
/*%%%*/
if ($3 == 0) {
- yyerror0("can't define singleton method for ().");
+ yyerror("can't define singleton method for ().");
}
else {
switch (nd_type($3)) {
@@ -4964,8 +4886,7 @@ singleton : var_ref
case NODE_LIT:
case NODE_ARRAY:
case NODE_ZARRAY:
- yyerror0("can't define singleton method for literals");
- break;
+ yyerror("can't define singleton method for literals");
default:
value_expr($3);
break;
@@ -4993,29 +4914,15 @@ assocs : assoc
/*%c%*/
/*%c
{
- $$ = rb_ary_new3(1, get_value($1));
+ $$ = rb_ary_new3(1, $1);
}
%*/
| assocs ',' assoc
{
/*%%%*/
- NODE *assocs = $1;
- NODE *tail = $3;
- if (!assocs) {
- assocs = tail;
- }
- else if (tail) {
- if (assocs->nd_head &&
- !tail->nd_head && nd_type(tail->nd_next) == NODE_ARRAY &&
- nd_type(tail->nd_next->nd_head) == NODE_HASH) {
- /* DSTAR */
- tail = tail->nd_next->nd_head->nd_head;
- }
- assocs = list_concat(assocs, tail);
- }
- $$ = assocs;
+ $$ = list_concat($1, $3);
/*%
- $$ = rb_ary_push($1, get_value($3));
+ $$ = rb_ary_push($1, $3);
%*/
}
;
@@ -5025,9 +4932,9 @@ assoc : arg_value tASSOC arg_value
/*%%%*/
if (nd_type($1) == NODE_STR) {
nd_set_type($1, NODE_LIT);
- add_mark_object($1->nd_lit = rb_fstring($1->nd_lit));
+ $1->nd_lit = rb_fstring($1->nd_lit);
}
- $$ = list_append(new_list($1, &@$), $3);
+ $$ = list_append(NEW_LIST($1), $3);
/*%
$$ = dispatch2(assoc_new, $1, $3);
%*/
@@ -5035,30 +4942,15 @@ assoc : arg_value tASSOC arg_value
| tLABEL arg_value
{
/*%%%*/
- $$ = list_append(new_list(new_lit(ID2SYM($1), &@1), &@$), $2);
+ $$ = list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2);
/*%
$$ = dispatch2(assoc_new, $1, $2);
%*/
}
- | tSTRING_BEG string_contents tLABEL_END arg_value
- {
- /*%%%*/
- YYLTYPE location;
- location.first_loc = @1.first_loc;
- location.last_loc = @3.last_loc;
- $$ = list_append(new_list(dsym_node($2, &location), &location), $4);
- /*%
- $$ = dispatch2(assoc_new, dispatch1(dyna_symbol, $2), $4);
- %*/
- }
| tDSTAR arg_value
{
/*%%%*/
- if (nd_type($2) == NODE_HASH &&
- !($2->nd_head && $2->nd_head->nd_alen))
- $$ = 0;
- else
- $$ = list_append(new_list(0, &@$), $2);
+ $$ = list_append(NEW_LIST(0), $2);
/*%
$$ = dispatch1(assoc_splat, $2);
%*/
@@ -5082,24 +4974,15 @@ operation3 : tIDENTIFIER
;
dot_or_colon : '.'
+ /*%c%*/
+ /*%c
+ { $$ = $<val>1; }
+ %*/
| tCOLON2
- ;
-
-call_op : '.'
- {
- $$ = TOKEN2VAL('.');
- }
- | tANDDOT
- {
- $$ = ID2VAL(idANDDOT);
- }
- ;
-
-call_op2 : call_op
- | tCOLON2
- {
- $$ = ID2VAL(idCOLON2);
- }
+ /*%c%*/
+ /*%c
+ { $$ = $<val>1; }
+ %*/
;
opt_terms : /* none */
@@ -5121,8 +5004,8 @@ trailer : /* none */
| ','
;
-term : ';' {yyerrok;token_flush(parser);}
- | '\n' {token_flush(parser);}
+term : ';' {yyerrok;}
+ | '\n'
;
terms : term
@@ -5131,20 +5014,24 @@ terms : term
none : /* none */
{
- $$ = Qnull;
+ /*%%%*/
+ $$ = 0;
+ /*%
+ $$ = Qundef;
+ %*/
}
;
%%
# undef parser
# undef yylex
# undef yylval
-# define yylval (*parser->lval)
+# define yylval (*((YYSTYPE*)(parser->parser_yylval)))
static int parser_regx_options(struct parser_params*);
-static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**,rb_encoding**);
+static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**);
static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);
-static enum yytokentype parser_parse_string(struct parser_params*,rb_strterm_literal_t*);
-static enum yytokentype parser_here_document(struct parser_params*,rb_strterm_heredoc_t*);
+static int parser_parse_string(struct parser_params*,NODE*);
+static int parser_here_document(struct parser_params*,NODE*);
# define nextc() parser_nextc(parser)
@@ -5156,7 +5043,7 @@ static enum yytokentype parser_here_document(struct parser_params*,rb_strterm_he
# define read_escape(flags,e) parser_read_escape(parser, (flags), (e))
# define tokadd_escape(e) parser_tokadd_escape(parser, (e))
# define regx_options() parser_regx_options(parser)
-# define tokadd_string(f,t,p,n,e,e2) parser_tokadd_string(parser,(f),(t),(p),(n),(e),(e2))
+# define tokadd_string(f,t,p,n,e) parser_tokadd_string(parser,(f),(t),(p),(n),(e))
# define parse_string(n) parser_parse_string(parser,(n))
# define tokaddmbc(c, enc) parser_tokaddmbc(parser, (c), (enc))
# define here_document(n) parser_here_document(parser,(n))
@@ -5177,13 +5064,12 @@ static enum yytokentype parser_here_document(struct parser_params*,rb_strterm_he
# define yylval_id() (yylval.id)
#else
static inline VALUE
-ripper_yylval_id_gen(struct parser_params *parser, ID x)
+ripper_yylval_id(ID x)
{
- return ripper_new_yylval(x, ID2SYM(x), 0);
+ return (VALUE)NEW_LASGN(x, ID2SYM(x));
}
-#define ripper_yylval_id(x) ripper_yylval_id_gen(parser, x)
-# define set_yylval_str(x) (yylval.val = (x))
-# define set_yylval_num(x) (yylval.val = ripper_new_yylval((x), 0, 0))
+# define set_yylval_str(x) (void)(x)
+# define set_yylval_num(x) (void)(x)
# define set_yylval_id(x) (void)(x)
# define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(x))
# define set_yylval_literal(x) (void)(x)
@@ -5192,22 +5078,12 @@ ripper_yylval_id_gen(struct parser_params *parser, ID x)
#endif
#ifndef RIPPER
-#define literal_flush(p) (parser->tokp = (p))
-#define dispatch_scan_event(t) ((void)0)
-#define dispatch_delayed_token(t) ((void)0)
-#define has_delayed_token() (0)
+#define ripper_flush(p) (void)(p)
#else
-#define literal_flush(p) ((void)0)
+#define ripper_flush(p) ((p)->tokp = (p)->parser_lex_p)
#define yylval_rval (*(RB_TYPE_P(yylval.val, T_NODE) ? &yylval.node->nd_rval : &yylval.val))
-static inline VALUE
-intern_sym(const char *name)
-{
- ID id = rb_intern_const(name);
- return ID2SYM(id);
-}
-
static int
ripper_has_scan_event(struct parser_params *parser)
{
@@ -5221,7 +5097,7 @@ ripper_scan_event_val(struct parser_params *parser, int t)
{
VALUE str = STR_NEW(parser->tokp, lex_p - parser->tokp);
VALUE rval = ripper_dispatch1(parser, ripper_token2eventid(t), str);
- token_flush(parser);
+ ripper_flush(parser);
return rval;
}
@@ -5229,9 +5105,15 @@ static void
ripper_dispatch_scan_event(struct parser_params *parser, int t)
{
if (!ripper_has_scan_event(parser)) return;
- add_mark_object(yylval_rval = ripper_scan_event_val(parser, t));
+ yylval_rval = ripper_scan_event_val(parser, t);
+}
+
+static void
+ripper_dispatch_ignored_scan_event(struct parser_params *parser, int t)
+{
+ if (!ripper_has_scan_event(parser)) return;
+ (void)ripper_scan_event_val(parser, t);
}
-#define dispatch_scan_event(t) ripper_dispatch_scan_event(parser, t)
static void
ripper_dispatch_delayed_token(struct parser_params *parser, int t)
@@ -5241,33 +5123,45 @@ ripper_dispatch_delayed_token(struct parser_params *parser, int t)
ruby_sourceline = parser->delayed_line;
parser->tokp = lex_pbeg + parser->delayed_col;
- add_mark_object(yylval_rval = ripper_dispatch1(parser, ripper_token2eventid(t), parser->delayed));
+ yylval_rval = ripper_dispatch1(parser, ripper_token2eventid(t), parser->delayed);
parser->delayed = Qnil;
ruby_sourceline = saved_line;
parser->tokp = saved_tokp;
}
-#define dispatch_delayed_token(t) ripper_dispatch_delayed_token(parser, t)
-#define has_delayed_token() (!NIL_P(parser->delayed))
#endif /* RIPPER */
#include "ruby/regex.h"
#include "ruby/util.h"
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+# define SIGN_EXTEND_CHAR(c) ((signed char)(c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
+#endif
+
#define parser_encoding_name() (current_enc->name)
#define parser_mbclen() mbclen((lex_p-1),lex_pend,current_enc)
+#define parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc)
#define is_identchar(p,e,enc) (rb_enc_isalnum((unsigned char)(*(p)),(enc)) || (*(p)) == '_' || !ISASCII(*(p)))
#define parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_enc))
#define parser_isascii() ISASCII(*(lex_p-1))
+#ifndef RIPPER
static int
-token_info_get_column(struct parser_params *parser, const char *pend)
+token_info_get_column(struct parser_params *parser, const char *token)
{
int column = 1;
- const char *p;
+ const char *p, *pend = lex_p - strlen(token);
for (p = lex_pbeg; p < pend; p++) {
if (*p == '\t') {
- column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
+ column = (((column - 1) / 8) + 1) * 8;
}
column++;
}
@@ -5275,9 +5169,9 @@ token_info_get_column(struct parser_params *parser, const char *pend)
}
static int
-token_info_has_nonspaces(struct parser_params *parser, const char *pend)
+token_info_has_nonspaces(struct parser_params *parser, const char *token)
{
- const char *p;
+ const char *p, *pend = lex_p - strlen(token);
for (p = lex_pbeg; p < pend; p++) {
if (*p != ' ' && *p != '\t') {
return 1;
@@ -5286,55 +5180,52 @@ token_info_has_nonspaces(struct parser_params *parser, const char *pend)
return 0;
}
+#undef token_info_push
static void
-token_info_push_gen(struct parser_params *parser, const char *token, size_t len)
+token_info_push(struct parser_params *parser, const char *token)
{
token_info *ptinfo;
- const char *t = lex_p - len;
- if (!parser->token_info_enabled) return;
+ if (!parser->parser_token_info_enabled) return;
ptinfo = ALLOC(token_info);
ptinfo->token = token;
ptinfo->linenum = ruby_sourceline;
- ptinfo->column = token_info_get_column(parser, t);
- ptinfo->nonspc = token_info_has_nonspaces(parser, t);
- ptinfo->next = parser->token_info;
+ ptinfo->column = token_info_get_column(parser, token);
+ ptinfo->nonspc = token_info_has_nonspaces(parser, token);
+ ptinfo->next = parser->parser_token_info;
- parser->token_info = ptinfo;
+ parser->parser_token_info = ptinfo;
}
+#undef token_info_pop
static void
-token_info_pop_gen(struct parser_params *parser, const char *token, size_t len)
+token_info_pop(struct parser_params *parser, const char *token)
{
int linenum;
- token_info *ptinfo = parser->token_info;
- const char *t = lex_p - len;
+ token_info *ptinfo = parser->parser_token_info;
if (!ptinfo) return;
- parser->token_info = ptinfo->next;
+ parser->parser_token_info = ptinfo->next;
+ if (token_info_get_column(parser, token) == ptinfo->column) { /* OK */
+ goto finish;
+ }
linenum = ruby_sourceline;
- if (parser->token_info_enabled &&
- linenum != ptinfo->linenum && !ptinfo->nonspc &&
- !token_info_has_nonspaces(parser, t) &&
- token_info_get_column(parser, t) != ptinfo->column) {
- rb_warn3L(linenum,
- "mismatched indentations at '%s' with '%s' at %d",
- WARN_S(token), WARN_S(ptinfo->token), WARN_I(ptinfo->linenum));
+ if (linenum == ptinfo->linenum) { /* SKIP */
+ goto finish;
+ }
+ if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { /* SKIP */
+ goto finish;
+ }
+ if (parser->parser_token_info_enabled) {
+ rb_compile_warn(ruby_sourcefile, linenum,
+ "mismatched indentations at '%s' with '%s' at %d",
+ token, ptinfo->token, ptinfo->linenum);
}
+ finish:
xfree(ptinfo);
}
-
-static int
-parser_precise_mbclen(struct parser_params *parser, const char *p)
-{
- int len = rb_enc_precise_mbclen(p, lex_pend, current_enc);
- if (!MBCLEN_CHARFOUND_P(len)) {
- compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
- return -1;
- }
- return len;
-}
+#endif /* RIPPER */
static int
parser_yyerror(struct parser_params *parser, const char *msg)
@@ -5342,178 +5233,65 @@ parser_yyerror(struct parser_params *parser, const char *msg)
#ifndef RIPPER
const int max_line_margin = 30;
const char *p, *pe;
- const char *pre = "", *post = "", *pend;
- const char *code = "", *caret = "", *newline = "";
- const char *lim;
char *buf;
long len;
int i;
- pend = lex_pend;
- if (pend > lex_pbeg && pend[-1] == '\n') {
- if (--pend > lex_pbeg && pend[-1] == '\r') --pend;
+ compile_error(PARSER_ARG "%s", msg);
+ p = lex_p;
+ while (lex_pbeg <= p) {
+ if (*p == '\n') break;
+ p--;
}
+ p++;
- p = pe = lex_p < pend ? lex_p : pend;
- lim = p - lex_pbeg > max_line_margin ? p - max_line_margin : lex_pbeg;
- while ((lim < p) && (*(p-1) != '\n')) p--;
-
- lim = pend - pe > max_line_margin ? pe + max_line_margin : pend;
- while ((pe < lim) && (*pe != '\n')) pe++;
+ pe = lex_p;
+ while (pe < lex_pend) {
+ if (*pe == '\n') break;
+ pe++;
+ }
len = pe - p;
if (len > 4) {
char *p2;
+ const char *pre = "", *post = "";
- if (p > lex_pbeg) {
- p = rb_enc_prev_char(lex_pbeg, p, lex_p, rb_enc_get(lex_lastline));
- if (p > lex_pbeg) pre = "...";
- }
- if (pe < pend) {
- pe = rb_enc_prev_char(lex_p, pe, pend, rb_enc_get(lex_lastline));
- if (pe < pend) post = "...";
- }
- len = pe - p;
- lim = lex_p < pend ? lex_p : pend;
- i = (int)(lim - p);
- buf = ALLOCA_N(char, i+2);
- code = p;
- caret = p2 = buf;
- pe = (parser->tokp < lim ? parser->tokp : lim);
- if (p <= pe) {
- while (p < pe) {
- *p2++ = *p++ == '\t' ? '\t' : ' ';
+ if (len > max_line_margin * 2 + 10) {
+ if (lex_p - p > max_line_margin) {
+ p = rb_enc_prev_char(p, lex_p - max_line_margin, pe, rb_enc_get(lex_lastline));
+ pre = "...";
+ }
+ if (pe - lex_p > max_line_margin) {
+ pe = rb_enc_prev_char(lex_p, lex_p + max_line_margin, pe, rb_enc_get(lex_lastline));
+ post = "...";
}
- *p2++ = '^';
- p++;
+ len = pe - p;
}
- if (lim > p) {
- memset(p2, '~', (lim - p));
- p2 += (lim - p);
+ buf = ALLOCA_N(char, len+2);
+ MEMCPY(buf, p, char, len);
+ buf[len] = '\0';
+ rb_compile_error_with_enc(NULL, 0, (void *)current_enc, "%s%s%s", pre, buf, post);
+
+ i = (int)(lex_p - p);
+ p2 = buf; pe = buf + len;
+
+ while (p2 < pe) {
+ if (*p2 != '\t') *p2 = ' ';
+ p2++;
}
- *p2 = '\0';
- newline = "\n";
- }
- else {
- len = 0;
+ buf[i] = '^';
+ buf[i+1] = '\0';
+ rb_compile_error_append("%s%s", pre, buf);
}
- compile_error(PARSER_ARG "%s%s""%s%.*s%s%s""%s%s",
- msg, newline,
- pre, (int)len, code, post, newline,
- pre, caret);
#else
dispatch1(parse_error, STR_NEW2(msg));
- ripper_error();
#endif /* !RIPPER */
return 0;
}
-static int
-vtable_size(const struct vtable *tbl)
-{
- if (POINTER_P(tbl)) {
- return tbl->pos;
- }
- else {
- return 0;
- }
-}
-
-static struct vtable *
-vtable_alloc_gen(struct parser_params *parser, int line, struct vtable *prev)
-{
- struct vtable *tbl = ALLOC(struct vtable);
- tbl->pos = 0;
- tbl->capa = 8;
- tbl->tbl = ALLOC_N(ID, tbl->capa);
- tbl->prev = prev;
-#ifndef RIPPER
- if (yydebug) {
- rb_parser_printf(parser, "vtable_alloc:%d: %p\n", line, tbl);
- }
-#endif
- return tbl;
-}
-#define vtable_alloc(prev) vtable_alloc_gen(parser, __LINE__, prev)
-
-static void
-vtable_free_gen(struct parser_params *parser, int line, const char *name,
- struct vtable *tbl)
-{
-#ifndef RIPPER
- if (yydebug) {
- rb_parser_printf(parser, "vtable_free:%d: %s(%p)\n", line, name, tbl);
- }
-#endif
- if (POINTER_P(tbl)) {
- if (tbl->tbl) {
- xfree(tbl->tbl);
- }
- xfree(tbl);
- }
-}
-#define vtable_free(tbl) vtable_free_gen(parser, __LINE__, #tbl, tbl)
-
-static void
-vtable_add_gen(struct parser_params *parser, int line, const char *name,
- struct vtable *tbl, ID id)
-{
-#ifndef RIPPER
- if (yydebug) {
- rb_parser_printf(parser, "vtable_add:%d: %s(%p), %s\n",
- line, name, tbl, rb_id2name(id));
- }
-#endif
- if (!POINTER_P(tbl)) {
- rb_parser_fatal(parser, "vtable_add: vtable is not allocated (%p)", (void *)tbl);
- return;
- }
- if (tbl->pos == tbl->capa) {
- tbl->capa = tbl->capa * 2;
- REALLOC_N(tbl->tbl, ID, tbl->capa);
- }
- tbl->tbl[tbl->pos++] = id;
-}
-#define vtable_add(tbl, id) vtable_add_gen(parser, __LINE__, #tbl, tbl, id)
-
-#ifndef RIPPER
-static void
-vtable_pop_gen(struct parser_params *parser, int line, const char *name,
- struct vtable *tbl, int n)
-{
- if (yydebug) {
- rb_parser_printf(parser, "vtable_pop:%d: %s(%p), %d\n",
- line, name, tbl, n);
- }
- if (tbl->pos < n) {
- rb_parser_fatal(parser, "vtable_pop: unreachable (%d < %d)", tbl->pos, n);
- return;
- }
- tbl->pos -= n;
-}
-#define vtable_pop(tbl, n) vtable_pop_gen(parser, __LINE__, #tbl, tbl, n)
-#endif
-
-static int
-vtable_included(const struct vtable * tbl, ID id)
-{
- int i;
-
- if (POINTER_P(tbl)) {
- for (i = 0; i < tbl->pos; i++) {
- if (tbl->tbl[i] == id) {
- return i+1;
- }
- }
- }
- return 0;
-}
-
static void parser_prepare(struct parser_params *parser);
#ifndef RIPPER
-static NODE *parser_append_options(struct parser_params *parser, NODE *node);
-
static VALUE
debug_lines(VALUE fname)
{
@@ -5535,12 +5313,9 @@ coverage(VALUE fname, int n)
{
VALUE coverages = rb_get_coverages();
if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
- VALUE coverage = rb_default_coverage(n);
- VALUE lines = RARRAY_AREF(coverage, COVERAGE_INDEX_LINES);
-
- rb_hash_aset(coverages, fname, coverage);
-
- return lines == Qnil ? Qfalse : lines;
+ VALUE lines = rb_ary_tmp_new_fill(n);
+ rb_hash_aset(coverages, fname, lines);
+ return lines;
}
return 0;
}
@@ -5557,7 +5332,6 @@ yycompile0(VALUE arg)
int n;
NODE *tree;
struct parser_params *parser = (struct parser_params *)arg;
- VALUE cov = Qfalse;
if (!compile_for_eval && rb_safe_level() == 0) {
ruby_debug_lines = debug_lines(ruby_sourcefile_string);
@@ -5571,50 +5345,44 @@ yycompile0(VALUE arg)
if (!e_option_supplied(parser)) {
ruby_coverage = coverage(ruby_sourcefile_string, ruby_sourceline);
- cov = Qtrue;
}
}
+ parser->last_cr_line = ruby_sourceline - 1;
parser_prepare(parser);
+ deferred_nodes = 0;
#ifndef RIPPER
-#define RUBY_DTRACE_PARSE_HOOK(name) \
- if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
- RUBY_DTRACE_PARSE_##name(ruby_sourcefile, ruby_sourceline); \
+ parser->parser_token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
+#endif
+#ifndef RIPPER
+ if (RUBY_DTRACE_PARSE_BEGIN_ENABLED()) {
+ RUBY_DTRACE_PARSE_BEGIN(parser->parser_ruby_sourcefile,
+ parser->parser_ruby_sourceline);
}
- RUBY_DTRACE_PARSE_HOOK(BEGIN);
#endif
n = yyparse((void*)parser);
#ifndef RIPPER
- RUBY_DTRACE_PARSE_HOOK(END);
+ if (RUBY_DTRACE_PARSE_END_ENABLED()) {
+ RUBY_DTRACE_PARSE_END(parser->parser_ruby_sourcefile,
+ parser->parser_ruby_sourceline);
+ }
#endif
ruby_debug_lines = 0;
ruby_coverage = 0;
+ compile_for_eval = 0;
lex_strterm = 0;
lex_p = lex_pbeg = lex_pend = 0;
- lex_prevline = lex_lastline = lex_nextline = 0;
- if (parser->error_p) {
- VALUE mesg = parser->error_buffer;
- if (!mesg) {
- mesg = rb_class_new_instance(0, 0, rb_eSyntaxError);
- }
- rb_set_errinfo(mesg);
+ lex_lastline = lex_nextline = 0;
+ if (parser->nerr) {
return 0;
}
tree = ruby_eval_tree;
if (!tree) {
tree = NEW_NIL();
}
- else {
- VALUE opt = parser->compile_option;
- NODE *prelude;
- NODE *body = parser_append_options(parser, tree->nd_body);
- if (!opt) opt = rb_obj_hide(rb_ident_hash_new());
- rb_hash_aset(opt, rb_sym_intern_ascii_cstr("coverage_enabled"), cov);
- prelude = NEW_PRELUDE(ruby_eval_tree_begin, body, opt);
- add_mark_object(opt);
- prelude->nd_loc = body->nd_loc;
- tree->nd_body = prelude;
+ else if (ruby_eval_tree_begin) {
+ tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body);
}
return (VALUE)tree;
}
@@ -5662,7 +5430,7 @@ lex_get_str(struct parser_params *parser, VALUE s)
static VALUE
lex_getline(struct parser_params *parser)
{
- VALUE line = (*lex_gets)(parser, lex_input);
+ VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input);
if (NIL_P(line)) return line;
must_be_ascii_compatible(line);
#ifndef RIPPER
@@ -5677,104 +5445,100 @@ lex_getline(struct parser_params *parser)
return line;
}
+#ifdef RIPPER
+static rb_data_type_t parser_data_type;
+#else
static const rb_data_type_t parser_data_type;
-#ifndef RIPPER
-static rb_ast_t*
-parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
+static NODE*
+parser_compile_string(volatile VALUE vparser, VALUE fname, VALUE s, int line)
{
struct parser_params *parser;
- rb_ast_t *ast;
+ NODE *node;
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- parser->ast = ast = rb_ast_new();
-
lex_gets = lex_get_str;
lex_gets_ptr = 0;
lex_input = rb_str_new_frozen(s);
lex_pbeg = lex_p = lex_pend = 0;
+ compile_for_eval = rb_parse_in_eval();
- ast->root = yycompile(parser, fname, line);
- parser->ast = 0;
+ node = yycompile(parser, fname, line);
RB_GC_GUARD(vparser); /* prohibit tail call optimization */
- return ast;
+ return node;
}
-rb_ast_t*
+NODE*
rb_compile_string(const char *f, VALUE s, int line)
{
must_be_ascii_compatible(s);
return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), s, line);
}
-rb_ast_t*
-rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
+NODE*
+rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
{
return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
}
-rb_ast_t*
-rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
+NODE*
+rb_parser_compile_string_path(volatile VALUE vparser, VALUE f, VALUE s, int line)
{
must_be_ascii_compatible(s);
return parser_compile_string(vparser, f, s, line);
}
-rb_ast_t*
+NODE*
rb_compile_cstr(const char *f, const char *s, int len, int line)
{
VALUE str = rb_str_new(s, len);
return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), str, line);
}
-rb_ast_t*
-rb_parser_compile_cstr(VALUE vparser, const char *f, const char *s, int len, int line)
+NODE*
+rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line)
{
VALUE str = rb_str_new(s, len);
return parser_compile_string(vparser, rb_filesystem_str_new_cstr(f), str, line);
}
-VALUE rb_io_gets_internal(VALUE io);
-
static VALUE
lex_io_gets(struct parser_params *parser, VALUE io)
{
- return rb_io_gets_internal(io);
+ return rb_io_gets(io);
}
-rb_ast_t*
+NODE*
rb_compile_file(const char *f, VALUE file, int start)
{
- VALUE vparser = rb_parser_new();
+ VALUE volatile vparser = rb_parser_new();
return rb_parser_compile_file(vparser, f, file, start);
}
-rb_ast_t*
-rb_parser_compile_file(VALUE vparser, const char *f, VALUE file, int start)
+NODE*
+rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start)
{
return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start);
}
-rb_ast_t*
-rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
+NODE*
+rb_parser_compile_file_path(volatile VALUE vparser, VALUE fname, VALUE file, int start)
{
struct parser_params *parser;
- rb_ast_t *ast;
+ NODE *node;
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- parser->ast = ast = rb_ast_new();
-
lex_gets = lex_io_gets;
lex_input = file;
lex_pbeg = lex_p = lex_pend = 0;
+ compile_for_eval = rb_parse_in_eval();
- ast->root = yycompile(parser, fname, start);
- parser->ast = 0;
+ node = yycompile(parser, fname, start);
RB_GC_GUARD(vparser); /* prohibit tail call optimization */
- return ast;
+ return node;
}
#endif /* !RIPPER */
@@ -5784,18 +5548,14 @@ rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
#define STR_FUNC_QWORDS 0x08
#define STR_FUNC_SYMBOL 0x10
#define STR_FUNC_INDENT 0x20
-#define STR_FUNC_LABEL 0x40
-#define STR_FUNC_LIST 0x4000
-#define STR_FUNC_TERM 0x8000
enum string_type {
- str_label = STR_FUNC_LABEL,
str_squote = (0),
str_dquote = (STR_FUNC_EXPAND),
str_xquote = (STR_FUNC_EXPAND),
str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND),
- str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST),
- str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
+ str_sword = (STR_FUNC_QWORDS),
+ str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND),
str_ssym = (STR_FUNC_SYMBOL),
str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
};
@@ -5817,90 +5577,70 @@ parser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *e
return str;
}
-#define lex_goto_eol(parser) ((parser)->lex.pcur = (parser)->lex.pend)
+#define lex_goto_eol(parser) ((parser)->parser_lex_p = (parser)->parser_lex_pend)
#define lex_eol_p() (lex_p >= lex_pend)
#define peek(c) peek_n((c), 0)
#define peek_n(c,n) (lex_p+(n) < lex_pend && (c) == (unsigned char)lex_p[n])
#define peekc() peekc_n(0)
#define peekc_n(n) (lex_p+(n) < lex_pend ? (unsigned char)lex_p[n] : -1)
-#ifdef RIPPER
-static void
-parser_add_delayed_token(struct parser_params *parser, const char *tok, const char *end)
-{
- if (tok < end) {
- if (!has_delayed_token()) {
- parser->delayed = rb_str_buf_new(1024);
- rb_enc_associate(parser->delayed, current_enc);
- parser->delayed_line = ruby_sourceline;
- parser->delayed_col = (int)(tok - lex_pbeg);
- }
- rb_str_buf_cat(parser->delayed, tok, end - tok);
- parser->tokp = end;
- }
-}
-#define add_delayed_token(tok, end) parser_add_delayed_token(parser, (tok), (end))
-#else
-#define add_delayed_token(tok, end) ((void)(tok), (void)(end))
-#endif
-
-static int
-parser_nextline(struct parser_params *parser)
-{
- VALUE v = lex_nextline;
- lex_nextline = 0;
- if (!v) {
- if (parser->eofp)
- return -1;
-
- if (!lex_input || NIL_P(v = lex_getline(parser))) {
- parser->eofp = 1;
- lex_goto_eol(parser);
- return -1;
- }
- parser->cr_seen = FALSE;
- }
- add_delayed_token(parser->tokp, lex_pend);
- if (heredoc_end > 0) {
- ruby_sourceline = heredoc_end;
- heredoc_end = 0;
- }
- ruby_sourceline++;
- parser->line_count++;
- lex_pbeg = lex_p = RSTRING_PTR(v);
- lex_pend = lex_p + RSTRING_LEN(v);
- token_flush(parser);
- lex_prevline = lex_lastline;
- lex_lastline = v;
- return 0;
-}
-
-static int
-parser_cr(struct parser_params *parser, int c)
-{
- if (peek('\n')) {
- lex_p++;
- c = '\n';
- }
- else if (!parser->cr_seen) {
- parser->cr_seen = TRUE;
- /* carried over with lex_nextline for nextc() */
- rb_warn0("encountered \\r in middle of line, treated as a mere space");
- }
- return c;
-}
-
static inline int
parser_nextc(struct parser_params *parser)
{
int c;
- if (UNLIKELY((lex_p == lex_pend) || parser->eofp || lex_nextline)) {
- if (parser_nextline(parser)) return -1;
+ if (lex_p == lex_pend) {
+ VALUE v = lex_nextline;
+ lex_nextline = 0;
+ if (!v) {
+ if (parser->eofp)
+ return -1;
+
+ if (!lex_input || NIL_P(v = lex_getline(parser))) {
+ parser->eofp = Qtrue;
+ lex_goto_eol(parser);
+ return -1;
+ }
+ }
+ {
+#ifdef RIPPER
+ if (parser->tokp < lex_pend) {
+ if (NIL_P(parser->delayed)) {
+ parser->delayed = rb_str_buf_new(1024);
+ rb_enc_associate(parser->delayed, current_enc);
+ rb_str_buf_cat(parser->delayed,
+ parser->tokp, lex_pend - parser->tokp);
+ parser->delayed_line = ruby_sourceline;
+ parser->delayed_col = (int)(parser->tokp - lex_pbeg);
+ }
+ else {
+ rb_str_buf_cat(parser->delayed,
+ parser->tokp, lex_pend - parser->tokp);
+ }
+ }
+#endif
+ if (heredoc_end > 0) {
+ ruby_sourceline = heredoc_end;
+ heredoc_end = 0;
+ }
+ ruby_sourceline++;
+ parser->line_count++;
+ lex_pbeg = lex_p = RSTRING_PTR(v);
+ lex_pend = lex_p + RSTRING_LEN(v);
+ ripper_flush(parser);
+ lex_lastline = v;
+ }
}
c = (unsigned char)*lex_p++;
- if (UNLIKELY(c == '\r')) {
- c = parser_cr(parser, c);
+ if (c == '\r') {
+ if (peek('\n')) {
+ lex_p++;
+ c = '\n';
+ }
+ else if (ruby_sourceline > parser->last_cr_line) {
+ parser->last_cr_line = ruby_sourceline;
+ rb_compile_warn(ruby_sourcefile, ruby_sourceline, "encountered \\r in middle of line, treated as a mere space");
+ }
}
return c;
@@ -5968,8 +5708,7 @@ parser_tok_hex(struct parser_params *parser, size_t *numlen)
c = scan_hex(lex_p, 2, numlen);
if (!*numlen) {
- parser->tokp = lex_p;
- yyerror0("invalid hex escape");
+ yyerror("invalid hex escape");
return 0;
}
lex_p += *numlen;
@@ -5978,52 +5717,10 @@ parser_tok_hex(struct parser_params *parser, size_t *numlen)
#define tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n))
-static int
-parser_tokadd_codepoint(struct parser_params *parser, rb_encoding **encp,
- int regexp_literal, int wide)
-{
- size_t numlen;
- int codepoint = scan_hex(lex_p, wide ? lex_pend - lex_p : 4, &numlen);
- literal_flush(lex_p);
- lex_p += numlen;
- if (wide ? (numlen == 0 || numlen > 6) : (numlen < 4)) {
- yyerror0("invalid Unicode escape");
- return wide && numlen > 0;
- }
- if (codepoint > 0x10ffff) {
- yyerror0("invalid Unicode codepoint (too large)");
- return wide;
- }
- if ((codepoint & 0xfffff800) == 0xd800) {
- yyerror0("invalid Unicode codepoint");
- return wide;
- }
- if (regexp_literal) {
- tokcopy((int)numlen);
- }
- else if (codepoint >= 0x80) {
- rb_encoding *utf8 = rb_utf8_encoding();
- if (*encp && utf8 != *encp) {
- static const char mixed_utf8[] = "UTF-8 mixed within %s source";
- size_t len = sizeof(mixed_utf8) - 2 + strlen(rb_enc_name(*encp));
- char *mesg = alloca(len);
- snprintf(mesg, len, mixed_utf8, rb_enc_name(*encp));
- yyerror0(mesg);
- return wide;
- }
- *encp = utf8;
- tokaddmbc(codepoint, *encp);
- }
- else {
- tokadd(codepoint);
- }
- return TRUE;
-}
-
/* return value is for ?\u3042 */
static int
parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp,
- int string_literal, int symbol_literal, int regexp_literal)
+ int string_literal, int symbol_literal, int regexp_literal)
{
/*
* If string_literal is true, then we allow multiple codepoints
@@ -6032,42 +5729,65 @@ parser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp,
* codepoint without adding it
*/
- const int open_brace = '{', close_brace = '}';
+ int codepoint;
+ size_t numlen;
if (regexp_literal) { tokadd('\\'); tokadd('u'); }
- if (peek(open_brace)) { /* handle \u{...} form */
- int c, last = nextc();
- if (lex_p >= lex_pend) goto unterminated;
- while (ISSPACE(c = *lex_p) && ++lex_p < lex_pend);
- while (c != close_brace) {
- if (regexp_literal) tokadd(last);
- if (!parser_tokadd_codepoint(parser, encp, regexp_literal, TRUE)) {
- break;
+ if (peek('{')) { /* handle \u{...} form */
+ do {
+ if (regexp_literal) { tokadd(*lex_p); }
+ nextc();
+ codepoint = scan_hex(lex_p, 6, &numlen);
+ if (numlen == 0) {
+ yyerror("invalid Unicode escape");
+ return 0;
}
- while (ISSPACE(c = *lex_p)) {
- if (++lex_p >= lex_pend) goto unterminated;
- last = c;
+ if (codepoint > 0x10ffff) {
+ yyerror("invalid Unicode codepoint (too large)");
+ return 0;
}
- }
+ lex_p += numlen;
+ if (regexp_literal) {
+ tokcopy((int)numlen);
+ }
+ else if (codepoint >= 0x80) {
+ *encp = rb_utf8_encoding();
+ if (string_literal) tokaddmbc(codepoint, *encp);
+ }
+ else if (string_literal) {
+ tokadd(codepoint);
+ }
+ } while (string_literal && (peek(' ') || peek('\t')));
- if (c != close_brace) {
- unterminated:
- literal_flush(lex_p);
- yyerror0("unterminated Unicode escape");
+ if (!peek('}')) {
+ yyerror("unterminated Unicode escape");
return 0;
}
- if (regexp_literal) tokadd(close_brace);
+ if (regexp_literal) { tokadd('}'); }
nextc();
}
else { /* handle \uxxxx form */
- if (!parser_tokadd_codepoint(parser, encp, regexp_literal, FALSE)) {
+ codepoint = scan_hex(lex_p, 4, &numlen);
+ if (numlen < 4) {
+ yyerror("invalid Unicode escape");
return 0;
}
+ lex_p += 4;
+ if (regexp_literal) {
+ tokcopy(4);
+ }
+ else if (codepoint >= 0x80) {
+ *encp = rb_utf8_encoding();
+ if (string_literal) tokaddmbc(codepoint, *encp);
+ }
+ else if (string_literal) {
+ tokadd(codepoint);
+ }
}
- return TRUE;
+ return codepoint;
}
#define ESCAPE_CONTROL 1
@@ -6126,6 +5846,7 @@ parser_read_escape(struct parser_params *parser, int flags,
case 'M':
if (flags & ESCAPE_META) goto eof;
if ((c = nextc()) != '-') {
+ pushback(c);
goto eof;
}
if ((c = nextc()) == '\\') {
@@ -6139,6 +5860,7 @@ parser_read_escape(struct parser_params *parser, int flags,
case 'C':
if ((c = nextc()) != '-') {
+ pushback(c);
goto eof;
}
case 'c':
@@ -6154,8 +5876,7 @@ parser_read_escape(struct parser_params *parser, int flags,
eof:
case -1:
- yyerror0("Invalid escape character syntax");
- pushback(c);
+ yyerror("Invalid escape character syntax");
return '\0';
default:
@@ -6233,7 +5954,7 @@ parser_tokadd_escape(struct parser_params *parser, rb_encoding **encp)
eof:
case -1:
- yyerror0("Invalid escape character syntax");
+ yyerror("Invalid escape character syntax");
return -1;
default:
@@ -6280,9 +6001,8 @@ parser_regx_options(struct parser_params *parser)
}
static void
-dispose_string(struct parser_params *parser, VALUE str)
+dispose_string(VALUE str)
{
- rb_ast_delete_mark_object(parser->ast, str);
rb_str_free(str);
rb_gc_force_recycle(str);
}
@@ -6290,8 +6010,11 @@ dispose_string(struct parser_params *parser, VALUE str)
static int
parser_tokadd_mbchar(struct parser_params *parser, int c)
{
- int len = parser_precise_mbclen(parser, lex_p-1);
- if (len < 0) return -1;
+ int len = parser_precise_mbclen();
+ if (!MBCLEN_CHARFOUND_P(len)) {
+ compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name());
+ return -1;
+ }
tokadd(c);
lex_p += --len;
if (len > 0) tokcopy(len);
@@ -6314,69 +6037,34 @@ simple_re_meta(int c)
}
static int
-parser_update_heredoc_indent(struct parser_params *parser, int c)
-{
- if (heredoc_line_indent == -1) {
- if (c == '\n') heredoc_line_indent = 0;
- }
- else {
- if (c == ' ') {
- heredoc_line_indent++;
- return TRUE;
- }
- else if (c == '\t') {
- int w = (heredoc_line_indent / TAB_WIDTH) + 1;
- heredoc_line_indent = w * TAB_WIDTH;
- return TRUE;
- }
- else if (c != '\n') {
- if (heredoc_indent > heredoc_line_indent) {
- heredoc_indent = heredoc_line_indent;
- }
- heredoc_line_indent = -1;
- }
- }
- return FALSE;
-}
-
-static void
-parser_mixed_error(struct parser_params *parser, rb_encoding *enc1, rb_encoding *enc2)
-{
- static const char mixed_msg[] = "%s mixed within %s source";
- const char *n1 = rb_enc_name(enc1), *n2 = rb_enc_name(enc2);
- const size_t len = sizeof(mixed_msg) - 4 + strlen(n1) + strlen(n2);
- char *errbuf = ALLOCA_N(char, len);
- snprintf(errbuf, len, mixed_msg, n1, n2);
- yyerror0(errbuf);
-}
-
-static void
-parser_mixed_escape(struct parser_params *p, const char *beg, rb_encoding *enc1, rb_encoding *enc2)
-{
- const char *pos = p->lex.pcur;
- p->lex.pcur = beg;
- parser_mixed_error(p, enc1, enc2);
- p->lex.pcur = pos;
-}
-
-static int
parser_tokadd_string(struct parser_params *parser,
int func, int term, int paren, long *nest,
- rb_encoding **encp, rb_encoding **enc)
+ rb_encoding **encp)
{
int c;
- bool erred = false;
+ int has_nonascii = 0;
+ rb_encoding *enc = *encp;
+ char *errbuf = 0;
+ static const char mixed_msg[] = "%s mixed within %s source";
-#define mixed_error(enc1, enc2) \
- (void)(erred || (parser_mixed_error(parser, enc1, enc2), erred = true))
-#define mixed_escape(beg, enc1, enc2) \
- (void)(erred || (parser_mixed_escape(parser, beg, enc1, enc2), erred = true))
+#define mixed_error(enc1, enc2) if (!errbuf) { \
+ size_t len = sizeof(mixed_msg) - 4; \
+ len += strlen(rb_enc_name(enc1)); \
+ len += strlen(rb_enc_name(enc2)); \
+ errbuf = ALLOCA_N(char, len); \
+ snprintf(errbuf, len, mixed_msg, \
+ rb_enc_name(enc1), \
+ rb_enc_name(enc2)); \
+ yyerror(errbuf); \
+ }
+#define mixed_escape(beg, enc1, enc2) do { \
+ const char *pos = lex_p; \
+ lex_p = (beg); \
+ mixed_error((enc1), (enc2)); \
+ lex_p = pos; \
+ } while (0)
while ((c = nextc()) != -1) {
- if (heredoc_indent > 0) {
- parser_update_heredoc_indent(parser, c);
- }
-
if (paren && c == paren) {
++*nest;
}
@@ -6395,19 +6083,12 @@ parser_tokadd_string(struct parser_params *parser,
}
}
else if (c == '\\') {
- literal_flush(lex_p - 1);
+ const char *beg = lex_p - 1;
c = nextc();
switch (c) {
case '\n':
if (func & STR_FUNC_QWORDS) break;
- if (func & STR_FUNC_EXPAND) {
- if (!(func & STR_FUNC_INDENT) || (heredoc_indent < 0))
- continue;
- if (c == term) {
- c = '\\';
- goto terminate;
- }
- }
+ if (func & STR_FUNC_EXPAND) continue;
tokadd('\\');
break;
@@ -6420,10 +6101,11 @@ parser_tokadd_string(struct parser_params *parser,
tokadd('\\');
break;
}
- if (!parser_tokadd_utf8(parser, enc, term,
- func & STR_FUNC_SYMBOL,
- func & STR_FUNC_REGEXP)) {
- return -1;
+ parser_tokadd_utf8(parser, &enc, 1,
+ func & STR_FUNC_SYMBOL,
+ func & STR_FUNC_REGEXP);
+ if (has_nonascii && enc != *encp) {
+ mixed_escape(beg, enc, *encp);
}
continue;
@@ -6439,17 +6121,17 @@ parser_tokadd_string(struct parser_params *parser,
continue;
}
pushback(c);
- if ((c = tokadd_escape(enc)) < 0)
+ if ((c = tokadd_escape(&enc)) < 0)
return -1;
- if (*enc && *enc != *encp) {
- mixed_escape(parser->tokp+2, *enc, *encp);
+ if (has_nonascii && enc != *encp) {
+ mixed_escape(beg, enc, *encp);
}
continue;
}
else if (func & STR_FUNC_EXPAND) {
pushback(c);
if (func & STR_FUNC_ESCAPE) tokadd('\\');
- c = read_escape(0, enc);
+ c = read_escape(0, &enc);
}
else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
/* ignore backslashed spaces in %w */
@@ -6463,11 +6145,9 @@ parser_tokadd_string(struct parser_params *parser,
}
else if (!parser_isascii()) {
non_ascii:
- if (!*enc) {
- *enc = *encp;
- }
- else if (*enc != *encp) {
- mixed_error(*enc, *encp);
+ has_nonascii = 1;
+ if (enc != *encp) {
+ mixed_error(enc, *encp);
continue;
}
if (tokadd_mbchar(c) == -1) return -1;
@@ -6478,48 +6158,36 @@ parser_tokadd_string(struct parser_params *parser,
break;
}
if (c & 0x80) {
- if (!*enc) {
- *enc = *encp;
- }
- else if (*enc != *encp) {
- mixed_error(*enc, *encp);
+ has_nonascii = 1;
+ if (enc != *encp) {
+ mixed_error(enc, *encp);
continue;
}
}
tokadd(c);
}
- terminate:
- if (*enc) *encp = *enc;
+ *encp = enc;
return c;
}
-/* imemo_parser_strterm for literal */
#define NEW_STRTERM(func, term, paren) \
- (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm, (VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
+ rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0)
#ifdef RIPPER
static void
-token_flush_string_content(struct parser_params *parser, rb_encoding *enc)
+ripper_flush_string_content(struct parser_params *parser, rb_encoding *enc)
{
- VALUE content = yylval.val;
- if (!ripper_is_node_yylval(content))
- content = ripper_new_yylval(0, 0, content);
- if (has_delayed_token()) {
+ if (!NIL_P(parser->delayed)) {
ptrdiff_t len = lex_p - parser->tokp;
if (len > 0) {
rb_enc_str_buf_cat(parser->delayed, parser->tokp, len, enc);
}
- dispatch_delayed_token(tSTRING_CONTENT);
+ ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
parser->tokp = lex_p;
- RNODE(content)->nd_rval = yylval.val;
}
- dispatch_scan_event(tSTRING_CONTENT);
- if (yylval.val != content)
- RNODE(content)->nd_rval = yylval.val;
- yylval.val = content;
}
-#define flush_string_content(enc) token_flush_string_content(parser, (enc))
+#define flush_string_content(enc) ripper_flush_string_content(parser, (enc))
#else
#define flush_string_content(enc) ((void)(enc))
#endif
@@ -6545,7 +6213,7 @@ const unsigned int ruby_global_name_punct_bits[] = {
#undef SPECIAL_PUNCT
#endif
-static enum yytokentype
+static int
parser_peek_variable_name(struct parser_params *parser)
{
int c;
@@ -6581,73 +6249,32 @@ parser_peek_variable_name(struct parser_params *parser)
return 0;
}
-#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
-#define IS_END() IS_lex_state(EXPR_END_ANY)
-#define IS_BEG() (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
-#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
-#define IS_LABEL_POSSIBLE() (\
- (IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
- IS_ARG())
-#define IS_LABEL_SUFFIX(n) (peek_n(':',(n)) && !peek_n(':', (n)+1))
-#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
-
-static inline enum yytokentype
-parser_string_term(struct parser_params *parser, int func)
-{
- lex_strterm = 0;
- if (func & STR_FUNC_REGEXP) {
- set_yylval_num(regx_options());
- dispatch_scan_event(tREGEXP_END);
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
- return tREGEXP_END;
- }
- if ((func & STR_FUNC_LABEL) && IS_LABEL_SUFFIX(0)) {
- nextc();
- SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
- return tLABEL_END;
- }
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
- return tSTRING_END;
-}
-
-static enum yytokentype
-parser_parse_string(struct parser_params *parser, rb_strterm_literal_t *quote)
+static int
+parser_parse_string(struct parser_params *parser, NODE *quote)
{
- int func = (int)quote->u1.func;
- int term = (int)quote->u3.term;
- int paren = (int)quote->u2.paren;
+ int func = (int)quote->nd_func;
+ int term = nd_term(quote);
+ int paren = nd_paren(quote);
int c, space = 0;
rb_encoding *enc = current_enc;
- rb_encoding *base_enc = 0;
- VALUE lit;
- if (func & STR_FUNC_TERM) {
- if (func & STR_FUNC_QWORDS) nextc(); /* delayed term */
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
- lex_strterm = 0;
- return func & STR_FUNC_REGEXP ? tREGEXP_END : tSTRING_END;
- }
+ if (func == -1) return tSTRING_END;
c = nextc();
if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) {
do {c = nextc();} while (ISSPACE(c));
space = 1;
}
- if (func & STR_FUNC_LIST) {
- quote->u1.func &= ~STR_FUNC_LIST;
- space = 1;
- }
- if (c == term && !quote->u0.nest) {
+ if (c == term && !quote->nd_nest) {
if (func & STR_FUNC_QWORDS) {
- quote->u1.func |= STR_FUNC_TERM;
- pushback(c); /* dispatch the term at tSTRING_END */
- add_delayed_token(parser->tokp, lex_p);
+ quote->nd_func = -1;
return ' ';
}
- return parser_string_term(parser, func);
+ if (!(func & STR_FUNC_REGEXP)) return tSTRING_END;
+ set_yylval_num(regx_options());
+ return tREGEXP_END;
}
if (space) {
pushback(c);
- add_delayed_token(parser->tokp, lex_p);
return ' ';
}
newtok();
@@ -6658,101 +6285,68 @@ parser_parse_string(struct parser_params *parser, rb_strterm_literal_t *quote)
c = nextc();
}
pushback(c);
- if (tokadd_string(func, term, paren, &quote->u0.nest,
- &enc, &base_enc) == -1) {
- if (parser->eofp) {
-#ifndef RIPPER
-# define unterminated_literal(mesg) yyerror0(mesg)
-#else
-# define unterminated_literal(mesg) compile_error(PARSER_ARG mesg)
-#endif
- literal_flush(lex_p);
- if (func & STR_FUNC_REGEXP) {
- unterminated_literal("unterminated regexp meets end of file");
- }
- else {
- unterminated_literal("unterminated string meets end of file");
- }
- quote->u1.func |= STR_FUNC_TERM;
+ if (tokadd_string(func, term, paren, &quote->nd_nest,
+ &enc) == -1) {
+ ruby_sourceline = nd_line(quote);
+ if (func & STR_FUNC_REGEXP) {
+ if (parser->eofp)
+ compile_error(PARSER_ARG "unterminated regexp meets end of file");
+ return tREGEXP_END;
+ }
+ else {
+ if (parser->eofp)
+ compile_error(PARSER_ARG "unterminated string meets end of file");
+ return tSTRING_END;
}
}
tokfix();
- add_mark_object(lit = STR_NEW3(tok(), toklen(), enc, func));
- set_yylval_str(lit);
+ set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
flush_string_content(enc);
return tSTRING_CONTENT;
}
-static enum yytokentype
+static int
parser_heredoc_identifier(struct parser_params *parser)
{
- int c = nextc(), term, func = 0, term_len = 2; /* length of "<<" */
- enum yytokentype token = tSTRING_BEG;
+ int c = nextc(), term, func = 0;
long len;
- int newline = 0;
- int indent = 0;
if (c == '-') {
c = nextc();
- term_len++;
- func = STR_FUNC_INDENT;
- }
- else if (c == '~') {
- c = nextc();
- term_len++;
func = STR_FUNC_INDENT;
- indent = INT_MAX;
}
switch (c) {
case '\'':
- term_len++;
func |= str_squote; goto quoted;
case '"':
- term_len++;
func |= str_dquote; goto quoted;
case '`':
- term_len++;
- token = tXSTRING_BEG;
- func |= str_xquote; goto quoted;
-
+ func |= str_xquote;
quoted:
- term_len++;
newtok();
- tokadd(term_len);
tokadd(func);
term = c;
while ((c = nextc()) != -1 && c != term) {
if (tokadd_mbchar(c) == -1) return 0;
- if (!newline && c == '\n') newline = 1;
- else if (newline) newline = 2;
}
if (c == -1) {
compile_error(PARSER_ARG "unterminated here document identifier");
return 0;
}
- switch (newline) {
- case 1:
- rb_warn0("here document identifier ends with a newline");
- if (--tokidx > 0 && tokenbuf[tokidx] == '\r') --tokidx;
- break;
- case 2:
- compile_error(PARSER_ARG "here document identifier across newlines, never match");
- return -1;
- }
break;
default:
if (!parser_is_identchar()) {
pushback(c);
if (func & STR_FUNC_INDENT) {
- pushback(indent > 0 ? '~' : '-');
+ pushback('-');
}
return 0;
}
newtok();
- tokadd(term_len);
+ term = '"';
tokadd(func |= str_dquote);
do {
if (tokadd_mbchar(c) == -1) return 0;
@@ -6761,126 +6355,38 @@ parser_heredoc_identifier(struct parser_params *parser)
break;
}
- tokenbuf[0] = tokenbuf[0] + toklen() - 2;
tokfix();
- dispatch_scan_event(tHEREDOC_BEG);
+#ifdef RIPPER
+ ripper_dispatch_scan_event(parser, tHEREDOC_BEG);
+#endif
len = lex_p - lex_pbeg;
lex_goto_eol(parser);
-
- lex_strterm = (rb_strterm_t*)rb_imemo_new(imemo_parser_strterm,
- STR_NEW(tok(), toklen()), /* term */
- lex_lastline, /* lastline */
- len, /* lastidx */
- ruby_sourceline);
- lex_strterm->flags |= STRTERM_HEREDOC;
-
- token_flush(parser);
- heredoc_indent = indent;
- heredoc_line_indent = 0;
- return token;
+ lex_strterm = rb_node_newnode(NODE_HEREDOC,
+ STR_NEW(tok(), toklen()), /* nd_lit */
+ len, /* nd_nth */
+ lex_lastline); /* nd_orig */
+ nd_set_line(lex_strterm, ruby_sourceline);
+ ripper_flush(parser);
+ return term == '`' ? tXSTRING_BEG : tSTRING_BEG;
}
static void
-parser_heredoc_restore(struct parser_params *parser, rb_strterm_heredoc_t *here)
+parser_heredoc_restore(struct parser_params *parser, NODE *here)
{
VALUE line;
lex_strterm = 0;
- line = here->lastline;
+ line = here->nd_orig;
lex_lastline = line;
lex_pbeg = RSTRING_PTR(line);
lex_pend = lex_pbeg + RSTRING_LEN(line);
- lex_p = lex_pbeg + here->u3.lastidx;
+ lex_p = lex_pbeg + here->nd_nth;
heredoc_end = ruby_sourceline;
- ruby_sourceline = (int)here->sourceline;
- token_flush(parser);
-}
-
-static int
-dedent_string(VALUE string, int width)
-{
- char *str;
- long len;
- int i, col = 0;
-
- RSTRING_GETMEM(string, str, len);
- for (i = 0; i < len && col < width; i++) {
- if (str[i] == ' ') {
- col++;
- }
- else if (str[i] == '\t') {
- int n = TAB_WIDTH * (col / TAB_WIDTH + 1);
- if (n > width) break;
- col = n;
- }
- else {
- break;
- }
- }
- if (!i) return 0;
- rb_str_modify(string);
- str = RSTRING_PTR(string);
- if (RSTRING_LEN(string) != len)
- rb_fatal("literal string changed: %+"PRIsVALUE, string);
- MEMMOVE(str, str + i, char, len - i);
- rb_str_set_len(string, len - i);
- return i;
-}
-
-#ifndef RIPPER
-static NODE *
-parser_heredoc_dedent(struct parser_params *parser, NODE *root)
-{
- NODE *node, *str_node;
- int indent = heredoc_indent;
-
- if (indent <= 0) return root;
- heredoc_indent = 0;
- if (!root) return root;
-
- node = str_node = root;
- if (nd_type(root) == NODE_ARRAY) str_node = root->nd_head;
-
- while (str_node) {
- VALUE lit = str_node->nd_lit;
- if (str_node->flags & NODE_FL_NEWLINE) {
- dedent_string(lit, indent);
- }
-
- str_node = 0;
- while ((node = node->nd_next) != 0 && nd_type(node) == NODE_ARRAY) {
- if ((str_node = node->nd_head) != 0) {
- enum node_type type = nd_type(str_node);
- if (type == NODE_STR || type == NODE_DSTR) break;
- str_node = 0;
- }
- }
- }
- return root;
+ ruby_sourceline = nd_line(here);
+ dispose_string(here->nd_lit);
+ rb_gc_force_recycle((VALUE)here);
+ ripper_flush(parser);
}
-#else /* RIPPER */
-static VALUE
-parser_heredoc_dedent(struct parser_params *parser, VALUE array)
-{
- int indent = heredoc_indent;
-
- if (indent <= 0) return array;
- heredoc_indent = 0;
- dispatch2(heredoc_dedent, array, INT2NUM(indent));
- return array;
-}
-
-static VALUE
-parser_dedent_string(VALUE self, VALUE input, VALUE width)
-{
- int wid, col;
-
- StringValue(input);
- wid = NUM2UINT(width);
- col = dedent_string(input, wid);
- return INT2NUM(col);
-}
-#endif
static int
parser_whole_match_p(struct parser_params *parser,
@@ -6926,14 +6432,13 @@ parser_number_literal_suffix(struct parser_params *parser, int mask)
}
if (!ISASCII(c) || ISALPHA(c) || c == '_') {
lex_p = lastp;
- literal_flush(lex_p);
return 0;
}
pushback(c);
if (c == '.') {
c = peekc_n(1);
if (ISDIGIT(c)) {
- yyerror0("unexpected fraction part after numeric literal");
+ yyerror("unexpected fraction part after numeric literal");
lex_p += 2;
while (parser_is_identchar()) nextc();
}
@@ -6943,24 +6448,21 @@ parser_number_literal_suffix(struct parser_params *parser, int mask)
return result;
}
-static enum yytokentype
-parser_set_number_literal(struct parser_params *parser, VALUE v,
- enum yytokentype type, int suffix)
+static int
+parser_set_number_literal(struct parser_params *parser, VALUE v, int type, int suffix)
{
if (suffix & NUM_SUFFIX_I) {
v = rb_complex_raw(INT2FIX(0), v);
type = tIMAGINARY;
}
set_yylval_literal(v);
- add_mark_object(v);
- SET_LEX_STATE(EXPR_END|EXPR_ENDARG);
return type;
}
static int
parser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix)
{
- enum yytokentype type = tINTEGER;
+ int type = tINTEGER;
if (suffix & NUM_SUFFIX_R) {
v = rb_rational_raw1(v);
type = tRATIONAL;
@@ -6972,13 +6474,10 @@ parser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix)
static void
ripper_dispatch_heredoc_end(struct parser_params *parser)
{
- VALUE str;
- if (has_delayed_token())
- dispatch_delayed_token(tSTRING_CONTENT);
- str = STR_NEW(parser->tokp, lex_pend - parser->tokp);
- ripper_dispatch1(parser, ripper_token2eventid(tHEREDOC_END), str);
+ if (!NIL_P(parser->delayed))
+ ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
lex_goto_eol(parser);
- token_flush(parser);
+ ripper_dispatch_ignored_scan_event(parser, tHEREDOC_END);
}
#define dispatch_heredoc_end() ripper_dispatch_heredoc_end(parser)
@@ -6986,66 +6485,43 @@ ripper_dispatch_heredoc_end(struct parser_params *parser)
#define dispatch_heredoc_end() ((void)0)
#endif
-static enum yytokentype
-parser_here_document(struct parser_params *parser, rb_strterm_heredoc_t *here)
+static int
+parser_here_document(struct parser_params *parser, NODE *here)
{
int c, func, indent = 0;
const char *eos, *p, *pend;
long len;
VALUE str = 0;
rb_encoding *enc = current_enc;
- rb_encoding *base_enc = 0;
- int bol;
- eos = RSTRING_PTR(here->term);
- len = RSTRING_LEN(here->term) - 2; /* here->term includes term_len and func */
- eos++; /* skip term_len */
+ eos = RSTRING_PTR(here->nd_lit);
+ len = RSTRING_LEN(here->nd_lit) - 1;
indent = (func = *eos++) & STR_FUNC_INDENT;
if ((c = nextc()) == -1) {
error:
compile_error(PARSER_ARG "can't find string \"%s\" anywhere before EOF", eos);
#ifdef RIPPER
- if (!has_delayed_token()) {
- dispatch_scan_event(tSTRING_CONTENT);
+ if (NIL_P(parser->delayed)) {
+ ripper_dispatch_scan_event(parser, tSTRING_CONTENT);
}
else {
- if (str) {
+ if (str ||
+ ((len = lex_p - parser->tokp) > 0 &&
+ (str = STR_NEW3(parser->tokp, len, enc, func), 1))) {
rb_str_append(parser->delayed, str);
}
- else if ((len = lex_p - parser->tokp) > 0) {
- if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
- int cr = ENC_CODERANGE_UNKNOWN;
- rb_str_coderange_scan_restartable(parser->tokp, lex_p, enc, &cr);
- if (cr != ENC_CODERANGE_7BIT &&
- current_enc == rb_usascii_encoding() &&
- enc != rb_utf8_encoding()) {
- enc = rb_ascii8bit_encoding();
- }
- }
- rb_enc_str_buf_cat(parser->delayed, parser->tokp, len, enc);
- }
- dispatch_delayed_token(tSTRING_CONTENT);
+ ripper_dispatch_delayed_token(parser, tSTRING_CONTENT);
}
lex_goto_eol(parser);
#endif
restore:
- heredoc_restore(&lex_strterm->u.heredoc);
- lex_strterm = 0;
+ heredoc_restore(lex_strterm);
return 0;
}
- bol = was_bol();
- /* `heredoc_line_indent == -1` means
- * - "after an interpolation in the same line", or
- * - "in a continuing line"
- */
- if (bol &&
- (heredoc_line_indent != -1 || (heredoc_line_indent = 0)) &&
- whole_match_p(eos, len, indent)) {
+ if (was_bol() && whole_match_p(eos, len, indent)) {
dispatch_heredoc_end();
- heredoc_restore(&lex_strterm->u.heredoc);
- lex_strterm = 0;
- SET_LEX_STATE(EXPR_END);
+ heredoc_restore(lex_strterm);
return tSTRING_END;
}
@@ -7064,28 +6540,14 @@ parser_here_document(struct parser_params *parser, rb_strterm_heredoc_t *here)
--pend;
}
}
-
- if (heredoc_indent > 0) {
- long i = 0;
- while (p + i < pend && parser_update_heredoc_indent(parser, p[i]))
- i++;
- heredoc_line_indent = 0;
- }
-
if (str)
rb_str_cat(str, p, pend - p);
else
str = STR_NEW(p, pend - p);
if (pend < lex_pend) rb_str_cat(str, "\n", 1);
lex_goto_eol(parser);
- if (heredoc_indent > 0) {
- goto flush_str;
- }
if (nextc() == -1) {
- if (str) {
- dispose_string(parser, str);
- str = 0;
- }
+ if (str) dispose_string(str);
goto error;
}
} while (!whole_match_p(eos, len, indent));
@@ -7095,58 +6557,31 @@ parser_here_document(struct parser_params *parser, rb_strterm_heredoc_t *here)
newtok();
if (c == '#') {
int t = parser_peek_variable_name(parser);
- if (heredoc_line_indent != -1) {
- if (heredoc_indent > heredoc_line_indent) {
- heredoc_indent = heredoc_line_indent;
- }
- heredoc_line_indent = -1;
- }
if (t) return t;
tokadd('#');
c = nextc();
}
do {
pushback(c);
- enc = current_enc;
- if ((c = tokadd_string(func, '\n', 0, NULL, &enc, &base_enc)) == -1) {
+ if ((c = tokadd_string(func, '\n', 0, NULL, &enc)) == -1) {
if (parser->eofp) goto error;
goto restore;
}
if (c != '\n') {
- if (c == '\\') heredoc_line_indent = -1;
- flush:
- str = STR_NEW3(tok(), toklen(), enc, func);
- flush_str:
- set_yylval_str(str);
- add_mark_object(str);
-#ifndef RIPPER
- if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
-#endif
+ set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));
flush_string_content(enc);
return tSTRING_CONTENT;
}
tokadd(nextc());
- if (heredoc_indent > 0) {
- lex_goto_eol(parser);
- goto flush;
- }
/* if (mbp && mb == ENC_CODERANGE_UNKNOWN) mbp = 0;*/
if ((c = nextc()) == -1) goto error;
} while (!whole_match_p(eos, len, indent));
str = STR_NEW3(tok(), toklen(), enc, func);
}
dispatch_heredoc_end();
-#ifdef RIPPER
- str = ripper_new_yylval(ripper_token2eventid(tSTRING_CONTENT),
- yylval.val, str);
-#endif
- heredoc_restore(&lex_strterm->u.heredoc);
- lex_strterm = NEW_STRTERM(func | STR_FUNC_TERM, 0, 0);
+ heredoc_restore(lex_strterm);
+ lex_strterm = NEW_STRTERM(-1, 0, 0);
set_yylval_str(str);
- add_mark_object(str);
-#ifndef RIPPER
- if (bol) yylval.node->flags |= NODE_FL_NEWLINE;
-#endif
return tSTRING_CONTENT;
}
@@ -7156,7 +6591,7 @@ static void
arg_ambiguous_gen(struct parser_params *parser, char c)
{
#ifndef RIPPER
- rb_warning1("ambiguous first argument; put parentheses or a space even after `%c' operator", WARN_I(c));
+ rb_warningS("ambiguous first argument; put parentheses or a space even after `%c' operator", c);
#else
dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
#endif
@@ -7166,32 +6601,10 @@ arg_ambiguous_gen(struct parser_params *parser, char c)
static ID
formal_argument_gen(struct parser_params *parser, ID lhs)
{
- switch (id_type(lhs)) {
- case ID_LOCAL:
- break;
#ifndef RIPPER
- case ID_CONST:
- yyerror0("formal argument cannot be a constant");
- return 0;
- case ID_INSTANCE:
- yyerror0("formal argument cannot be an instance variable");
- return 0;
- case ID_GLOBAL:
- yyerror0("formal argument cannot be a global variable");
- return 0;
- case ID_CLASS:
- yyerror0("formal argument cannot be a class variable");
- return 0;
- default:
- yyerror0("formal argument must be local variable");
- return 0;
-#else
- default:
- lhs = dispatch1(param_error, lhs);
- ripper_error();
- return 0;
+ if (!is_local_id(lhs))
+ yyerror("formal argument must be local variable");
#endif
- }
shadowing_lvar(lhs);
return lhs;
}
@@ -7199,7 +6612,7 @@ formal_argument_gen(struct parser_params *parser, ID lhs)
static int
lvar_defined_gen(struct parser_params *parser, ID id)
{
- return (dyna_in_block() && dvar_defined(id)) || local_id(id);
+ return (dyna_in_block() && dvar_defined_get(id)) || local_id(id);
}
/* emacsen -*- hack */
@@ -7235,7 +6648,7 @@ parser_set_encode(struct parser_params *parser, const char *name)
error:
excargs[0] = rb_eArgError;
excargs[2] = rb_make_backtrace();
- rb_ary_unshift(excargs[2], rb_sprintf("%"PRIsVALUE":%d", ruby_sourcefile_string, ruby_sourceline));
+ rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));
rb_exc_raise(rb_make_exception(3, excargs));
}
enc = rb_enc_from_index(idx);
@@ -7267,6 +6680,7 @@ comment_at_top(struct parser_params *parser)
return 1;
}
+#ifndef RIPPER
typedef long (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);
typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);
@@ -7279,60 +6693,28 @@ magic_comment_encoding(struct parser_params *parser, const char *name, const cha
parser_set_encode(parser, val);
}
-static int
-parser_get_bool(struct parser_params *parser, const char *name, const char *val)
+static void
+parser_set_token_info(struct parser_params *parser, const char *name, const char *val)
{
+ int *p = &parser->parser_token_info_enabled;
+
switch (*val) {
case 't': case 'T':
if (strcasecmp(val, "true") == 0) {
- return TRUE;
+ *p = TRUE;
+ return;
}
break;
case 'f': case 'F':
if (strcasecmp(val, "false") == 0) {
- return FALSE;
+ *p = FALSE;
+ return;
}
break;
}
rb_compile_warning(ruby_sourcefile, ruby_sourceline, "invalid value for %s: %s", name, val);
- return -1;
-}
-
-static void
-parser_set_token_info(struct parser_params *parser, const char *name, const char *val)
-{
- int b = parser_get_bool(parser, name, val);
- if (b >= 0) parser->token_info_enabled = b;
-}
-
-static void
-parser_set_compile_option_flag(struct parser_params *parser, const char *name, const char *val)
-{
- int b;
-
- if (parser->token_seen) {
- rb_warning1("`%s' is ignored after any tokens", WARN_S(name));
- return;
- }
-
- b = parser_get_bool(parser, name, val);
- if (b < 0) return;
-
- if (!parser->compile_option)
- parser->compile_option = rb_obj_hide(rb_ident_hash_new());
- rb_hash_aset(parser->compile_option, ID2SYM(rb_intern(name)),
- (b ? Qtrue : Qfalse));
}
-# if WARN_PAST_SCOPE
-static void
-parser_set_past_scope(struct parser_params *parser, const char *name, const char *val)
-{
- int b = parser_get_bool(parser, name, val);
- if (b >= 0) parser->past_scope_enabled = b;
-}
-# endif
-
struct magic_comment {
const char *name;
rb_magic_comment_setter_t func;
@@ -7342,12 +6724,9 @@ struct magic_comment {
static const struct magic_comment magic_comments[] = {
{"coding", magic_comment_encoding, parser_encode_length},
{"encoding", magic_comment_encoding, parser_encode_length},
- {"frozen_string_literal", parser_set_compile_option_flag},
{"warn_indent", parser_set_token_info},
-# if WARN_PAST_SCOPE
- {"warn_past_scope", parser_set_past_scope},
-# endif
};
+#endif
static const char *
magic_comment_marker(const char *str, long len)
@@ -7385,7 +6764,6 @@ magic_comment_marker(const char *str, long len)
static int
parser_magic_comment(struct parser_params *parser, const char *str, long len)
{
- int indicator = 0;
VALUE name = 0, val = 0;
const char *beg, *end, *vbeg, *vend;
#define str_copy(_s, _p, _n) ((_s) \
@@ -7394,17 +6772,16 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
: (void)((_s) = STR_NEW((_p), (_n))))
if (len <= 7) return FALSE;
- if (!!(beg = magic_comment_marker(str, len))) {
- if (!(end = magic_comment_marker(beg, str + len - beg)))
- return FALSE;
- indicator = TRUE;
- str = beg;
- len = end - beg - 3;
- }
+ if (!(beg = magic_comment_marker(str, len))) return FALSE;
+ if (!(end = magic_comment_marker(beg, str + len - beg))) return FALSE;
+ str = beg;
+ len = end - beg - 3;
/* %r"([^\\s\'\":;]+)\\s*:\\s*(\"(?:\\\\.|[^\"])*\"|[^\"\\s;]+)[\\s;]*" */
while (len > 0) {
+#ifndef RIPPER
const struct magic_comment *p = magic_comments;
+#endif
char *s;
int i;
long n = 0;
@@ -7428,10 +6805,7 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
}
for (end = str; len > 0 && ISSPACE(*str); str++, --len);
if (!len) break;
- if (*str != ':') {
- if (!indicator) return FALSE;
- continue;
- }
+ if (*str != ':') continue;
do str++; while (--len > 0 && ISSPACE(*str));
if (!len) break;
@@ -7452,13 +6826,7 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++);
vend = str;
}
- if (indicator) {
- while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
- }
- else {
- while (len > 0 && (ISSPACE(*str))) --len, str++;
- if (len) return FALSE;
- }
+ while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
n = end - beg;
str_copy(name, beg, n);
@@ -7466,18 +6834,19 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
for (i = 0; i < n; ++i) {
if (s[i] == '-') s[i] = '_';
}
+#ifndef RIPPER
do {
- if (STRNCASECMP(p->name, s, n) == 0 && !p->name[n]) {
+ if (STRNCASECMP(p->name, s, n) == 0) {
n = vend - vbeg;
if (p->length) {
n = (*p->length)(parser, vbeg, n);
}
str_copy(val, vbeg, n);
- (*p->func)(parser, p->name, RSTRING_PTR(val));
+ (*p->func)(parser, s, RSTRING_PTR(val));
break;
}
} while (++p < magic_comments + numberof(magic_comments));
-#ifdef RIPPER
+#else
str_copy(val, vbeg, vend - vbeg);
dispatch2(magic_comment, name, val);
#endif
@@ -7533,7 +6902,6 @@ static void
parser_prepare(struct parser_params *parser)
{
int c = nextc();
- parser->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
switch (c) {
case '#':
if (peek('!')) parser->has_shebang = 1;
@@ -7555,19 +6923,25 @@ parser_prepare(struct parser_params *parser)
parser->enc = rb_enc_get(lex_lastline);
}
+#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
+#define IS_END() IS_lex_state(EXPR_END_ANY)
+#define IS_BEG() IS_lex_state(EXPR_BEG_ANY)
+#define IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
+#define IS_LABEL_POSSIBLE() ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG())
+#define IS_LABEL_SUFFIX(n) (peek_n(':',(n)) && !peek_n(':', (n)+1))
+#define IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT)
+
#ifndef RIPPER
-#define ambiguous_operator(tok, op, syn) ( \
+#define ambiguous_operator(op, syn) ( \
rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
rb_warning0("even though it seems like "syn""))
#else
-#define ambiguous_operator(tok, op, syn) \
- dispatch2(operator_ambiguous, TOKEN2VAL(tok), rb_str_new_cstr(syn))
+#define ambiguous_operator(op, syn) dispatch2(operator_ambiguous, ripper_intern(op), rb_str_new_cstr(syn))
#endif
-#define warn_balanced(tok, op, syn) ((void) \
- (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
+#define warn_balanced(op, syn) ((void) \
+ (!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN|EXPR_ENDARG) && \
space_seen && !ISSPACE(c) && \
- (ambiguous_operator(tok, op, syn), 0)), \
- (enum yytokentype)(tok))
+ (ambiguous_operator(op, syn), 0)))
static VALUE
parse_rational(struct parser_params *parser, char *str, int len, int seen_point)
@@ -7587,14 +6961,14 @@ parse_numeric(struct parser_params *parser, int c)
int suffix;
is_float = seen_point = seen_e = nondigit = 0;
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_END;
newtok();
if (c == '-' || c == '+') {
tokadd(c);
c = nextc();
}
if (c == '0') {
-#define no_digits() do {yyerror0("numeric literal without digits"); return 0;} while (0)
+#define no_digits() do {yyerror("numeric literal without digits"); return 0;} while (0)
int start = toklen();
c = nextc();
if (c == 'x' || c == 'X') {
@@ -7708,7 +7082,7 @@ parse_numeric(struct parser_params *parser, int c)
}
if (c > '7' && c <= '9') {
invalid_octal:
- yyerror0("Invalid octal digit");
+ yyerror("Invalid octal digit");
}
else if (c == '.' || c == 'e' || c == 'E') {
tokadd('0');
@@ -7788,9 +7162,8 @@ parse_numeric(struct parser_params *parser, int c)
if (nondigit) {
char tmp[30];
trailing_uc:
- literal_flush(lex_p - 1);
snprintf(tmp, sizeof(tmp), "trailing `%c' in number", nondigit);
- yyerror0(tmp);
+ yyerror(tmp);
}
tokfix();
if (is_float) {
@@ -7805,7 +7178,7 @@ parse_numeric(struct parser_params *parser, int c)
else {
double d = strtod(tok(), 0);
if (errno == ERANGE) {
- rb_warning1("Float %s out of range", WARN_S(tok()));
+ rb_warningS("Float %s out of range", tok());
errno = 0;
}
v = DBL2NUM(d);
@@ -7816,15 +7189,14 @@ parse_numeric(struct parser_params *parser, int c)
return set_integer_literal(rb_cstr_to_inum(tok(), 10, FALSE), suffix);
}
-static enum yytokentype
-parse_qmark(struct parser_params *parser, int space_seen)
+static int
+parse_qmark(struct parser_params *parser)
{
rb_encoding *enc;
register int c;
- VALUE lit;
if (IS_END()) {
- SET_LEX_STATE(EXPR_VALUE);
+ lex_state = EXPR_VALUE;
return '?';
}
c = nextc();
@@ -7856,12 +7228,12 @@ parse_qmark(struct parser_params *parser, int space_seen)
break;
}
if (c2) {
- rb_warn1("invalid character syntax; use ?\\%c", WARN_I(c2));
+ rb_warnI("invalid character syntax; use ?\\%c", c2);
}
}
ternary:
pushback(c);
- SET_LEX_STATE(EXPR_VALUE);
+ lex_state = EXPR_VALUE;
return '?';
}
newtok();
@@ -7871,25 +7243,18 @@ parse_qmark(struct parser_params *parser, int space_seen)
}
else if ((rb_enc_isalnum(c, current_enc) || c == '_') &&
lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) {
- if (space_seen) {
- const char *start = lex_p - 1, *p = start;
- do {
- int n = parser_precise_mbclen(parser, p);
- if (n < 0) return -1;
- p += n;
- } while (p < lex_pend && is_identchar(p, lex_pend, current_enc));
- rb_warn2("`?' just followed by `%.*s' is interpreted as" \
- " a conditional operator, put a space after `?'",
- WARN_I((int)(p - start)), WARN_S_L(start, (p - start)));
- }
goto ternary;
}
else if (c == '\\') {
if (peek('u')) {
nextc();
- enc = rb_utf8_encoding();
- if (!parser_tokadd_utf8(parser, &enc, -1, 0, 0))
- return 0;
+ c = parser_tokadd_utf8(parser, &enc, 0, 0, 0);
+ if (0x80 <= c) {
+ tokaddmbc(c, enc);
+ }
+ else {
+ tokadd(c);
+ }
}
else if (!lex_eol_p() && !(c = *lex_p, ISASCII(c))) {
nextc();
@@ -7904,18 +7269,17 @@ parse_qmark(struct parser_params *parser, int space_seen)
tokadd(c);
}
tokfix();
- add_mark_object(lit = STR_NEW3(tok(), toklen(), enc, 0));
- set_yylval_str(lit);
- SET_LEX_STATE(EXPR_END);
+ set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0));
+ lex_state = EXPR_END;
return tCHAR;
}
-static enum yytokentype
+static int
parse_percent(struct parser_params *parser, const int space_seen, const enum lex_state_e last_state)
{
register int c;
- if (IS_BEG()) {
+ if (IS_lex_state(EXPR_BEG_ANY)) {
int term;
int paren;
@@ -7928,7 +7292,7 @@ parse_percent(struct parser_params *parser, const int space_seen, const enum lex
else {
term = nextc();
if (rb_enc_isalnum(term, current_enc) || !parser_isascii()) {
- yyerror0("unknown type of %string");
+ yyerror("unknown type of %string");
return 0;
}
}
@@ -7954,18 +7318,26 @@ parse_percent(struct parser_params *parser, const int space_seen, const enum lex
case 'W':
lex_strterm = NEW_STRTERM(str_dword, term, paren);
+ do {c = nextc();} while (ISSPACE(c));
+ pushback(c);
return tWORDS_BEG;
case 'w':
lex_strterm = NEW_STRTERM(str_sword, term, paren);
+ do {c = nextc();} while (ISSPACE(c));
+ pushback(c);
return tQWORDS_BEG;
case 'I':
lex_strterm = NEW_STRTERM(str_dword, term, paren);
+ do {c = nextc();} while (ISSPACE(c));
+ pushback(c);
return tSYMBOLS_BEG;
case 'i':
lex_strterm = NEW_STRTERM(str_sword, term, paren);
+ do {c = nextc();} while (ISSPACE(c));
+ pushback(c);
return tQSYMBOLS_BEG;
case 'x':
@@ -7978,25 +7350,26 @@ parse_percent(struct parser_params *parser, const int space_seen, const enum lex
case 's':
lex_strterm = NEW_STRTERM(str_ssym, term, paren);
- SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);
+ lex_state = EXPR_FNAME;
return tSYMBEG;
default:
- yyerror0("unknown type of %string");
+ yyerror("unknown type of %string");
return 0;
}
}
if ((c = nextc()) == '=') {
set_yylval_id('%');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
- if (IS_SPCARG(c) || (IS_lex_state(EXPR_FITEM) && c == 's')) {
+ if (IS_SPCARG(c)) {
goto quotation;
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
pushback(c);
- return warn_balanced('%', "%%", "string literal");
+ warn_balanced("%%", "string literal");
+ return '%';
}
static int
@@ -8010,43 +7383,24 @@ tokadd_ident(struct parser_params *parser, int c)
return 0;
}
-static ID
+static void
tokenize_ident(struct parser_params *parser, const enum lex_state_e last_state)
{
ID ident = TOK_INTERN();
set_yylval_name(ident);
-
- return ident;
-}
-
-static int
-parse_numvar(struct parser_params *parser)
-{
- size_t len;
- int overflow;
- unsigned long n = ruby_scan_digits(tok()+1, toklen()-1, 10, &len, &overflow);
- const unsigned long nth_ref_max =
- ((FIXNUM_MAX < INT_MAX) ? FIXNUM_MAX : INT_MAX) >> 1;
- /* NTH_REF is left-shifted to be ORed with back-ref flag and
- * turned into a Fixnum, in compile.c */
-
- if (overflow || n > nth_ref_max) {
- /* compile_error()? */
- rb_warn1("`%s' is too big for a number variable, always nil", WARN_S(tok()));
- return 0; /* $0 is $PROGRAM_NAME, not NTH_REF */
- }
- else {
- return (int)n;
+ if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
+ is_local_id(ident) && lvar_defined(ident)) {
+ lex_state = EXPR_END;
}
}
-static enum yytokentype
+static int
parse_gvar(struct parser_params *parser, const enum lex_state_e last_state)
{
register int c;
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_END;
newtok();
c = nextc();
switch (c) {
@@ -8093,7 +7447,7 @@ parse_gvar(struct parser_params *parser, const enum lex_state_e last_state)
return '$';
}
gvar:
- set_yylval_name(TOK_INTERN());
+ set_yylval_name(intern_cstr(tok(), tokidx, current_enc));
return tGVAR;
case '&': /* $&: last match */
@@ -8119,18 +7473,13 @@ parse_gvar(struct parser_params *parser, const enum lex_state_e last_state)
pushback(c);
if (IS_lex_state_for(last_state, EXPR_FNAME)) goto gvar;
tokfix();
- set_yylval_node(NEW_NTH_REF(parse_numvar(parser)));
+ set_yylval_node(NEW_NTH_REF(atoi(tok()+1)));
return tNTH_REF;
default:
if (!parser_is_identchar()) {
- if (c == -1 || ISSPACE(c)) {
- compile_error(PARSER_ARG "`$' without identifiers is not allowed as a global variable name");
- }
- else {
- pushback(c);
- compile_error(PARSER_ARG "`$%c' is not allowed as a global variable name", c);
- }
+ pushback(c);
+ compile_error(PARSER_ARG "`$%c' is not allowed as a global variable name", c);
return 0;
}
case '0':
@@ -8138,15 +7487,15 @@ parse_gvar(struct parser_params *parser, const enum lex_state_e last_state)
}
if (tokadd_ident(parser, c)) return 0;
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_END;
tokenize_ident(parser, last_state);
return tGVAR;
}
-static enum yytokentype
+static int
parse_atmark(struct parser_params *parser, const enum lex_state_e last_state)
{
- enum yytokentype result = tIVAR;
+ int result = tIVAR;
register int c = nextc();
newtok();
@@ -8156,18 +7505,9 @@ parse_atmark(struct parser_params *parser, const enum lex_state_e last_state)
tokadd('@');
c = nextc();
}
- if (c == -1 || ISSPACE(c)) {
- if (result == tIVAR) {
- compile_error(PARSER_ARG "`@' without identifiers is not allowed as an instance variable name");
- }
- else {
- compile_error(PARSER_ARG "`@@' without identifiers is not allowed as a class variable name");
- }
- return 0;
- }
- else if (ISDIGIT(c) || !parser_is_identchar()) {
+ if (c != -1 && (ISDIGIT(c) || !parser_is_identchar())) {
pushback(c);
- if (result == tIVAR) {
+ if (tokidx == 1) {
compile_error(PARSER_ARG "`@%c' is not allowed as an instance variable name", c);
}
else {
@@ -8177,18 +7517,17 @@ parse_atmark(struct parser_params *parser, const enum lex_state_e last_state)
}
if (tokadd_ident(parser, c)) return 0;
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_END;
tokenize_ident(parser, last_state);
return result;
}
-static enum yytokentype
+static int
parse_ident(struct parser_params *parser, int c, int cmd_state)
{
- enum yytokentype result;
+ int result = 0;
int mb = ENC_CODERANGE_7BIT;
const enum lex_state_e last_state = lex_state;
- ID ident;
do {
if (!ISASCII(c)) mb = ENC_CODERANGE_UNKNOWN;
@@ -8196,23 +7535,40 @@ parse_ident(struct parser_params *parser, int c, int cmd_state)
c = nextc();
} while (parser_is_identchar());
if ((c == '!' || c == '?') && !peek('=')) {
- result = tFID;
- tokadd(c);
- }
- else if (c == '=' && IS_lex_state(EXPR_FNAME) &&
- (!peek('~') && !peek('>') && (!peek('=') || (peek_n('>', 1))))) {
- result = tIDENTIFIER;
tokadd(c);
}
else {
- result = tCONSTANT; /* assume provisionally */
pushback(c);
}
tokfix();
+ if (toklast() == '!' || toklast() == '?') {
+ result = tFID;
+ }
+ else {
+ if (IS_lex_state(EXPR_FNAME)) {
+ register int c = nextc();
+ if (c == '=' && !peek('~') && !peek('>') &&
+ (!peek('=') || (peek_n('>', 1)))) {
+ result = tIDENTIFIER;
+ tokadd(c);
+ tokfix();
+ }
+ else {
+ pushback(c);
+ }
+ }
+ if (result == 0 && ISUPPER(tok()[0])) {
+ result = tCONSTANT;
+ }
+ else {
+ result = tIDENTIFIER;
+ }
+ }
+
if (IS_LABEL_POSSIBLE()) {
if (IS_LABEL_SUFFIX(0)) {
- SET_LEX_STATE(EXPR_ARG|EXPR_LABELED);
+ lex_state = EXPR_LABELARG;
nextc();
set_yylval_name(TOK_INTERN());
return tLABEL;
@@ -8225,16 +7581,16 @@ parse_ident(struct parser_params *parser, int c, int cmd_state)
kw = rb_reserved_word(tok(), toklen());
if (kw) {
enum lex_state_e state = lex_state;
- SET_LEX_STATE(kw->state);
+ lex_state = kw->state;
if (IS_lex_state_for(state, EXPR_FNAME)) {
- set_yylval_name(rb_intern2(tok(), toklen()));
+ set_yylval_name(rb_intern(kw->name));
return kw->id[0];
}
if (IS_lex_state(EXPR_BEG)) {
command_start = TRUE;
}
if (kw->id[0] == keyword_do) {
- if (lambda_beginning_p()) {
+ if (lpar_beg && lpar_beg == paren_nest) {
lpar_beg = 0;
--paren_nest;
return keyword_do_LAMBDA;
@@ -8246,11 +7602,11 @@ parse_ident(struct parser_params *parser, int c, int cmd_state)
return keyword_do_block;
return keyword_do;
}
- if (IS_lex_state_for(state, (EXPR_BEG | EXPR_LABELED)))
+ if (IS_lex_state_for(state, (EXPR_BEG | EXPR_VALUE)))
return kw->id[0];
else {
if (kw->id[0] != kw->id[1])
- SET_LEX_STATE(EXPR_BEG | EXPR_LABEL);
+ lex_state = EXPR_BEG;
return kw->id[1];
}
}
@@ -8258,57 +7614,57 @@ parse_ident(struct parser_params *parser, int c, int cmd_state)
if (IS_lex_state(EXPR_BEG_ANY | EXPR_ARG_ANY | EXPR_DOT)) {
if (cmd_state) {
- SET_LEX_STATE(EXPR_CMDARG);
+ lex_state = EXPR_CMDARG;
}
else {
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
}
}
else if (lex_state == EXPR_FNAME) {
- SET_LEX_STATE(EXPR_ENDFN);
+ lex_state = EXPR_ENDFN;
}
else {
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_END;
}
- ident = tokenize_ident(parser, last_state);
- if (result == tCONSTANT && is_local_id(ident)) result = tIDENTIFIER;
- if (!IS_lex_state_for(last_state, EXPR_DOT|EXPR_FNAME) &&
- (result == tIDENTIFIER) && /* not EXPR_FNAME, not attrasgn */
- lvar_defined(ident)) {
- SET_LEX_STATE(EXPR_END|EXPR_LABEL);
- }
+ tokenize_ident(parser, last_state);
return result;
}
-static enum yytokentype
+static int
parser_yylex(struct parser_params *parser)
{
register int c;
int space_seen = 0;
int cmd_state;
- int label;
enum lex_state_e last_state;
+#ifdef RIPPER
int fallthru = FALSE;
- int token_seen = parser->token_seen;
+#endif
if (lex_strterm) {
- if (lex_strterm->flags & STRTERM_HEREDOC) {
- return here_document(&lex_strterm->u.heredoc);
+ int token;
+ if (nd_type(lex_strterm) == NODE_HEREDOC) {
+ token = here_document(lex_strterm);
+ if (token == tSTRING_END) {
+ lex_strterm = 0;
+ lex_state = EXPR_END;
+ }
}
else {
- token_flush(parser);
- return parse_string(&lex_strterm->u.literal);
+ token = parse_string(lex_strterm);
+ if (token == tSTRING_END || token == tREGEXP_END) {
+ rb_gc_force_recycle((VALUE)lex_strterm);
+ lex_strterm = 0;
+ lex_state = EXPR_END;
+ }
}
+ return token;
}
cmd_state = command_start;
command_start = FALSE;
- parser->token_seen = TRUE;
retry:
last_state = lex_state;
-#ifndef RIPPER
- token_flush(parser);
-#endif
switch (c = nextc()) {
case '\0': /* NUL */
case '\004': /* ^D */
@@ -8332,12 +7688,11 @@ parser_yylex(struct parser_params *parser)
}
outofloop:
pushback(c);
- dispatch_scan_event(tSP);
+ ripper_dispatch_scan_event(parser, tSP);
#endif
goto retry;
case '#': /* it's a comment */
- parser->token_seen = token_seen;
/* no magic_comment in shebang line */
if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) {
if (comment_at_top(parser)) {
@@ -8345,50 +7700,43 @@ parser_yylex(struct parser_params *parser)
}
}
lex_p = lex_pend;
- dispatch_scan_event(tCOMMENT);
+#ifdef RIPPER
+ ripper_dispatch_scan_event(parser, tCOMMENT);
fallthru = TRUE;
+#endif
/* fall through */
case '\n':
- parser->token_seen = token_seen;
- c = (IS_lex_state(EXPR_BEG|EXPR_CLASS|EXPR_FNAME|EXPR_DOT) &&
- !IS_lex_state(EXPR_LABELED));
- if (c || IS_lex_state_all(EXPR_ARG|EXPR_LABELED)) {
+ if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT | EXPR_LABELARG)) {
+#ifdef RIPPER
if (!fallthru) {
- dispatch_scan_event(tIGNORED_NL);
+ ripper_dispatch_scan_event(parser, tIGNORED_NL);
}
fallthru = FALSE;
- if (!c && parser->in_kwarg) {
+#endif
+ if (IS_lex_state(EXPR_LABELARG) && parser->parser_in_kwarg) {
goto normal_newline;
}
goto retry;
}
- while (1) {
- switch (c = nextc()) {
+ while ((c = nextc())) {
+ switch (c) {
case ' ': case '\t': case '\f': case '\r':
case '\13': /* '\v' */
space_seen = 1;
break;
- case '&':
case '.': {
- dispatch_delayed_token(tIGNORED_NL);
- if (peek('.') == (c == '&')) {
- pushback(c);
- dispatch_scan_event(tSP);
- goto retry;
- }
+ if ((c = nextc()) != '.') {
+ pushback(c);
+ pushback('.');
+ goto retry;
+ }
}
default:
--ruby_sourceline;
lex_nextline = lex_lastline;
case -1: /* EOF no decrement*/
-#ifndef RIPPER
- if (lex_prevline && !parser->eofp) lex_lastline = lex_prevline;
- lex_pbeg = RSTRING_PTR(lex_lastline);
- lex_pend = lex_p = lex_pbeg + RSTRING_LEN(lex_lastline);
- pushback(1); /* always pushback */
- parser->tokp = lex_p;
-#else
lex_goto_eol(parser);
+#ifdef RIPPER
if (c != -1) {
parser->tokp = lex_p;
}
@@ -8398,14 +7746,14 @@ parser_yylex(struct parser_params *parser)
}
normal_newline:
command_start = TRUE;
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return '\n';
case '*':
if ((c = nextc()) == '*') {
if ((c = nextc()) == '=') {
set_yylval_id(tPOW);
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8417,13 +7765,14 @@ parser_yylex(struct parser_params *parser)
c = tDSTAR;
}
else {
- c = warn_balanced((enum ruby_method_ids)tPOW, "**", "argument prefix");
+ warn_balanced("**", "argument prefix");
+ c = tPOW;
}
}
else {
if (c == '=') {
set_yylval_id('*');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8435,22 +7784,23 @@ parser_yylex(struct parser_params *parser)
c = tSTAR;
}
else {
- c = warn_balanced('*', "*", "argument prefix");
+ warn_balanced("*", "argument prefix");
+ c = '*';
}
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
return c;
case '!':
c = nextc();
if (IS_AFTER_OPERATOR()) {
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
if (c == '@') {
return '!';
}
}
else {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
}
if (c == '=') {
return tNEQ;
@@ -8465,34 +7815,40 @@ parser_yylex(struct parser_params *parser)
if (was_bol()) {
/* skip embedded rd document */
if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) {
- int first_p = TRUE;
+#ifdef RIPPER
+ int first_p = TRUE;
- lex_goto_eol(parser);
- dispatch_scan_event(tEMBDOC_BEG);
+ lex_goto_eol(parser);
+ ripper_dispatch_scan_event(parser, tEMBDOC_BEG);
+#endif
for (;;) {
lex_goto_eol(parser);
- if (!first_p) {
- dispatch_scan_event(tEMBDOC);
- }
- first_p = FALSE;
+#ifdef RIPPER
+ if (!first_p) {
+ ripper_dispatch_scan_event(parser, tEMBDOC);
+ }
+ first_p = FALSE;
+#endif
c = nextc();
if (c == -1) {
compile_error(PARSER_ARG "embedded document meets end of file");
return 0;
}
if (c != '=') continue;
- if (c == '=' && strncmp(lex_p, "end", 3) == 0 &&
+ if (strncmp(lex_p, "end", 3) == 0 &&
(lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) {
break;
}
}
lex_goto_eol(parser);
- dispatch_scan_event(tEMBDOC_END);
+#ifdef RIPPER
+ ripper_dispatch_scan_event(parser, tEMBDOC_END);
+#endif
goto retry;
}
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
if ((c = nextc()) == '=') {
if ((c = nextc()) == '=') {
return tEQQ;
@@ -8515,17 +7871,17 @@ parser_yylex(struct parser_params *parser)
if (c == '<' &&
!IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
!IS_END() &&
- (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
+ (!IS_ARG() || space_seen)) {
int token = heredoc_identifier();
if (token) return token;
}
if (IS_AFTER_OPERATOR()) {
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
}
else {
if (IS_lex_state(EXPR_CLASS))
command_start = TRUE;
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
}
if (c == '=') {
if ((c = nextc()) == '>') {
@@ -8537,24 +7893,25 @@ parser_yylex(struct parser_params *parser)
if (c == '<') {
if ((c = nextc()) == '=') {
set_yylval_id(tLSHFT);
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
- return warn_balanced((enum ruby_method_ids)tLSHFT, "<<", "here document");
+ warn_balanced("<<", "here document");
+ return tLSHFT;
}
pushback(c);
return '<';
case '>':
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
if ((c = nextc()) == '=') {
return tGEQ;
}
if (c == '>') {
if ((c = nextc()) == '=') {
set_yylval_id(tRSHFT);
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8564,39 +7921,37 @@ parser_yylex(struct parser_params *parser)
return '>';
case '"':
- label = (IS_LABEL_POSSIBLE() ? str_label : 0);
- lex_strterm = NEW_STRTERM(str_dquote | label, '"', 0);
+ lex_strterm = NEW_STRTERM(str_dquote, '"', 0);
return tSTRING_BEG;
case '`':
if (IS_lex_state(EXPR_FNAME)) {
- SET_LEX_STATE(EXPR_ENDFN);
+ lex_state = EXPR_ENDFN;
return c;
}
if (IS_lex_state(EXPR_DOT)) {
if (cmd_state)
- SET_LEX_STATE(EXPR_CMDARG);
+ lex_state = EXPR_CMDARG;
else
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
return c;
}
lex_strterm = NEW_STRTERM(str_xquote, '`', 0);
return tXSTRING_BEG;
case '\'':
- label = (IS_LABEL_POSSIBLE() ? str_label : 0);
- lex_strterm = NEW_STRTERM(str_squote | label, '\'', 0);
+ lex_strterm = NEW_STRTERM(str_squote, '\'', 0);
return tSTRING_BEG;
case '?':
- return parse_qmark(parser, space_seen);
+ return parse_qmark(parser);
case '&':
if ((c = nextc()) == '&') {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
if ((c = nextc()) == '=') {
set_yylval_id(tANDOP);
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8604,38 +7959,30 @@ parser_yylex(struct parser_params *parser)
}
else if (c == '=') {
set_yylval_id('&');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
- else if (c == '.') {
- SET_LEX_STATE(EXPR_DOT);
- return tANDDOT;
- }
pushback(c);
if (IS_SPCARG(c)) {
- if ((c != ':') ||
- (c = peekc_n(1)) == -1 ||
- !(c == '\'' || c == '"' ||
- is_identchar((lex_p+1), lex_pend, current_enc))) {
- rb_warning0("`&' interpreted as argument prefix");
- }
+ rb_warning0("`&' interpreted as argument prefix");
c = tAMPER;
}
else if (IS_BEG()) {
c = tAMPER;
}
else {
- c = warn_balanced('&', "&", "argument prefix");
+ warn_balanced("&", "argument prefix");
+ c = '&';
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
return c;
case '|':
if ((c = nextc()) == '|') {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
if ((c = nextc()) == '=') {
set_yylval_id(tOROP);
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8643,17 +7990,17 @@ parser_yylex(struct parser_params *parser)
}
if (c == '=') {
set_yylval_id('|');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG|EXPR_LABEL);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
pushback(c);
return '|';
case '+':
c = nextc();
if (IS_AFTER_OPERATOR()) {
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
if (c == '@') {
return tUPLUS;
}
@@ -8662,25 +8009,26 @@ parser_yylex(struct parser_params *parser)
}
if (c == '=') {
set_yylval_id('+');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('+'))) {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
pushback(c);
if (c != -1 && ISDIGIT(c)) {
return parse_numeric(parser, '+');
}
return tUPLUS;
}
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
pushback(c);
- return warn_balanced('+', "+", "unary operator");
+ warn_balanced("+", "unary operator");
+ return '+';
case '-':
c = nextc();
if (IS_AFTER_OPERATOR()) {
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
if (c == '@') {
return tUMINUS;
}
@@ -8689,28 +8037,28 @@ parser_yylex(struct parser_params *parser)
}
if (c == '=') {
set_yylval_id('-');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
if (c == '>') {
- SET_LEX_STATE(EXPR_ENDFN);
- token_info_push("->");
+ lex_state = EXPR_ENDFN;
return tLAMBDA;
}
if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('-'))) {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
pushback(c);
if (c != -1 && ISDIGIT(c)) {
return tUMINUS_NUM;
}
return tUMINUS;
}
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
pushback(c);
- return warn_balanced('-', "-", "unary operator");
+ warn_balanced("-", "unary operator");
+ return '-';
case '.':
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
if ((c = nextc()) == '.') {
if ((c = nextc()) == '.') {
return tDOT3;
@@ -8720,9 +8068,9 @@ parser_yylex(struct parser_params *parser)
}
pushback(c);
if (c != -1 && ISDIGIT(c)) {
- yyerror0("no .<digit> floating literal anymore; put 0 before dot");
+ yyerror("no .<digit> floating literal anymore; put 0 before dot");
}
- SET_LEX_STATE(EXPR_DOT);
+ lex_state = EXPR_DOT;
return '.';
case '0': case '1': case '2': case '3': case '4':
@@ -8736,9 +8084,9 @@ parser_yylex(struct parser_params *parser)
COND_LEXPOP();
CMDARG_LEXPOP();
if (c == ')')
- SET_LEX_STATE(EXPR_ENDFN);
+ lex_state = EXPR_ENDFN;
else
- SET_LEX_STATE(EXPR_END);
+ lex_state = EXPR_ENDARG;
if (c == '}') {
if (!brace_nest--) c = tSTRING_DEND;
}
@@ -8748,17 +8096,17 @@ parser_yylex(struct parser_params *parser)
c = nextc();
if (c == ':') {
if (IS_BEG() || IS_lex_state(EXPR_CLASS) || IS_SPCARG(-1)) {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tCOLON3;
}
- SET_LEX_STATE(EXPR_DOT);
+ lex_state = EXPR_DOT;
return tCOLON2;
}
- if (IS_END() || ISSPACE(c) || c == '#') {
+ if (IS_END() || ISSPACE(c)) {
pushback(c);
- c = warn_balanced(':', ":", "symbol literal");
- SET_LEX_STATE(EXPR_BEG);
- return c;
+ warn_balanced(":", "symbol literal");
+ lex_state = EXPR_BEG;
+ return ':';
}
switch (c) {
case '\'':
@@ -8771,17 +8119,17 @@ parser_yylex(struct parser_params *parser)
pushback(c);
break;
}
- SET_LEX_STATE(EXPR_FNAME);
+ lex_state = EXPR_FNAME;
return tSYMBEG;
case '/':
- if (IS_BEG()) {
+ if (IS_lex_state(EXPR_BEG_ANY)) {
lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
return tREGEXP_BEG;
}
if ((c = nextc()) == '=') {
set_yylval_id('/');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
pushback(c);
@@ -8790,26 +8138,27 @@ parser_yylex(struct parser_params *parser)
lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
return tREGEXP_BEG;
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
- return warn_balanced('/', "/", "regexp literal");
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
+ warn_balanced("/", "regexp literal");
+ return '/';
case '^':
if ((c = nextc()) == '=') {
set_yylval_id('^');
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
return tOP_ASGN;
}
- SET_LEX_STATE(IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG);
+ lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG;
pushback(c);
return '^';
case ';':
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
command_start = TRUE;
return ';';
case ',':
- SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
+ lex_state = EXPR_BEG;
return ',';
case '~':
@@ -8817,10 +8166,10 @@ parser_yylex(struct parser_params *parser)
if ((c = nextc()) != '@') {
pushback(c);
}
- SET_LEX_STATE(EXPR_ARG);
+ lex_state = EXPR_ARG;
}
else {
- SET_LEX_STATE(EXPR_BEG);
+ lex_state = EXPR_BEG;
}
return '~';
@@ -8828,27 +8177,20 @@ parser_yylex(struct parser_params *parser)
if (IS_BEG()) {
c = tLPAREN;
}
- else if (!space_seen) {
- /* foo( ... ) => method call, no ambiguity */
- }
- else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) {
+ else if (IS_SPCARG(-1)) {
c = tLPAREN_ARG;
}
- else if (IS_lex_state(EXPR_ENDFN) && !lambda_beginning_p()) {
- rb_warning0("parentheses after method name is interpreted as "
- "an argument list, not a decomposed argument");
- }
paren_nest++;
COND_PUSH(0);
CMDARG_PUSH(0);
- SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
+ lex_state = EXPR_BEG;
return c;
case '[':
paren_nest++;
if (IS_AFTER_OPERATOR()) {
+ lex_state = EXPR_ARG;
if ((c = nextc()) == ']') {
- SET_LEX_STATE(EXPR_ARG);
if ((c = nextc()) == '=') {
return tASET;
}
@@ -8856,33 +8198,30 @@ parser_yylex(struct parser_params *parser)
return tAREF;
}
pushback(c);
- SET_LEX_STATE(EXPR_ARG|EXPR_LABEL);
return '[';
}
else if (IS_BEG()) {
c = tLBRACK;
}
- else if (IS_ARG() && (space_seen || IS_lex_state(EXPR_LABELED))) {
+ else if (IS_ARG() && space_seen) {
c = tLBRACK;
}
- SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
+ lex_state = EXPR_BEG;
COND_PUSH(0);
CMDARG_PUSH(0);
return c;
case '{':
++brace_nest;
- if (lambda_beginning_p()) {
- SET_LEX_STATE(EXPR_BEG);
+ if (lpar_beg && lpar_beg == paren_nest) {
+ lex_state = EXPR_BEG;
lpar_beg = 0;
--paren_nest;
COND_PUSH(0);
CMDARG_PUSH(0);
return tLAMBEG;
}
- if (IS_lex_state(EXPR_LABELED))
- c = tLBRACE; /* hash */
- else if (IS_lex_state(EXPR_ARG_ANY | EXPR_END | EXPR_ENDFN))
+ if (IS_ARG() || IS_lex_state(EXPR_END | EXPR_ENDFN))
c = '{'; /* block (primary) */
else if (IS_lex_state(EXPR_ENDARG))
c = tLBRACE_ARG; /* block (expr) */
@@ -8890,7 +8229,7 @@ parser_yylex(struct parser_params *parser)
c = tLBRACE; /* hash */
COND_PUSH(0);
CMDARG_PUSH(0);
- SET_LEX_STATE(c == tLBRACE_ARG ? EXPR_BEG : EXPR_BEG|EXPR_LABEL);
+ lex_state = EXPR_BEG;
if (c != tLBRACE) command_start = TRUE;
return c;
@@ -8898,7 +8237,9 @@ parser_yylex(struct parser_params *parser)
c = nextc();
if (c == '\n') {
space_seen = 1;
- dispatch_scan_event(tSP);
+#ifdef RIPPER
+ ripper_dispatch_scan_event(parser, tSP);
+#endif
goto retry; /* skip \\n */
}
pushback(c);
@@ -8916,12 +8257,12 @@ parser_yylex(struct parser_params *parser)
case '_':
if (was_bol() && whole_match_p("__END__", 7, 0)) {
ruby__end__seen = 1;
- parser->eofp = 1;
+ parser->eofp = Qtrue;
#ifndef RIPPER
return -1;
#else
lex_goto_eol(parser);
- dispatch_scan_event(k__END__);
+ ripper_dispatch_scan_event(parser, k__END__);
return 0;
#endif
}
@@ -8941,46 +8282,42 @@ parser_yylex(struct parser_params *parser)
return parse_ident(parser, c, cmd_state);
}
-static enum yytokentype
-yylex(YYSTYPE *lval, YYLTYPE *yylloc, struct parser_params *parser)
+#if YYPURE
+static int
+yylex(void *lval, void *p)
+#else
+yylex(void *p)
+#endif
{
- enum yytokentype t;
+ struct parser_params *parser = (struct parser_params*)p;
+ int t;
- parser->lval = lval;
- lval->val = Qundef;
+#if YYPURE
+ parser->parser_yylval = lval;
+ parser->parser_yylval->val = Qundef;
+#endif
t = parser_yylex(parser);
- if (has_delayed_token())
- dispatch_delayed_token(t);
- else if (t != 0)
- dispatch_scan_event(t);
-
- if (lex_strterm && (lex_strterm->flags & STRTERM_HEREDOC))
- RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(*yylloc);
- else
- RUBY_SET_YYLLOC(*yylloc);
+#ifdef RIPPER
+ if (!NIL_P(parser->delayed)) {
+ ripper_dispatch_delayed_token(parser, t);
+ return t;
+ }
+ if (t != 0)
+ ripper_dispatch_scan_event(parser, t);
+#endif
return t;
}
-#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
-
+#ifndef RIPPER
static NODE*
node_newnode(struct parser_params *parser, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
{
- NODE *n = rb_ast_newnode(parser->ast);
-
- rb_node_init(n, type, a0, a1, a2);
-
+ NODE *n = (rb_node_newnode)(type, a0, a1, a2);
nd_set_line(n, ruby_sourceline);
- /* mark not cared lineno to 0 and column to -1 */
- nd_set_first_lineno(n, 0);
- nd_set_first_column(n, -1);
- nd_set_last_lineno(n, 0);
- nd_set_last_column(n, -1);
return n;
}
-#ifndef RIPPER
static enum node_type
nodetype(NODE *node) /* for debug */
{
@@ -9008,6 +8345,7 @@ fixpos(NODE *node, NODE *orig)
{
if (!node) return;
if (!orig) return;
+ if (orig == (NODE*)1) return;
nd_set_line(node, nd_line(orig));
}
@@ -9025,16 +8363,8 @@ parser_warn(struct parser_params *parser, NODE *node, const char *mesg)
}
#define parser_warn(node, mesg) parser_warn(parser, (node), (mesg))
-static NODE *
-nd_set_loc(NODE *nd, const YYLTYPE *location)
-{
- nd->nd_loc = *location;
- nd_set_line(nd, location->first_loc.lineno);
- return nd;
-}
-
static NODE*
-block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYLTYPE *location)
+block_append_gen(struct parser_params *parser, NODE *head, NODE *tail)
{
NODE *end, *h = head, *nd;
@@ -9053,7 +8383,7 @@ block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYL
default:
h = end = NEW_BLOCK(head);
end->nd_end = end;
- nd_set_loc(end, location);
+ fixpos(end, head);
head = end;
break;
case NODE_BLOCK:
@@ -9079,12 +8409,10 @@ block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYL
if (nd_type(tail) != NODE_BLOCK) {
tail = NEW_BLOCK(tail);
- nd_set_loc(tail, location);
tail->nd_end = tail;
}
end->nd_next = tail;
h->nd_end = tail->nd_end;
- nd_set_last_loc(head, nd_last_loc(tail));
return head;
}
@@ -9094,7 +8422,7 @@ list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
{
NODE *last;
- if (list == 0) return new_list(item, &item->nd_loc);
+ if (list == 0) return NEW_LIST(item);
if (list->nd_next) {
last = list->nd_next->nd_end;
}
@@ -9103,17 +8431,14 @@ list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
}
list->nd_alen += 1;
- last->nd_next = new_list(item, &item->nd_loc);
+ last->nd_next = NEW_LIST(item);
list->nd_next->nd_end = last->nd_next;
-
- nd_set_last_loc(list, nd_last_loc(item));
-
return list;
}
/* concat two lists */
static NODE*
-list_concat(NODE *head, NODE *tail)
+list_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
{
NODE *last;
@@ -9133,8 +8458,6 @@ list_concat(NODE *head, NODE *tail)
head->nd_next->nd_end = tail;
}
- nd_set_last_loc(head, nd_last_loc(tail));
-
return head;
}
@@ -9156,7 +8479,7 @@ literal_concat0(struct parser_params *parser, VALUE head, VALUE tail)
/* concat two string literals */
static NODE *
-literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYLTYPE *location)
+literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
{
enum node_type htype;
NODE *headlast;
@@ -9167,20 +8490,10 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y
htype = nd_type(head);
if (htype == NODE_EVSTR) {
- NODE *node = new_dstr(STR_NEW0(), location);
+ NODE *node = NEW_DSTR(Qnil);
head = list_append(node, head);
htype = NODE_DSTR;
}
- if (heredoc_indent > 0) {
- switch (htype) {
- case NODE_STR:
- nd_set_type(head, NODE_DSTR);
- case NODE_DSTR:
- return list_append(head, tail);
- default:
- break;
- }
- }
switch (nd_type(tail)) {
case NODE_STR:
if (htype == NODE_DSTR && (headlast = head->nd_next->nd_end->nd_head) &&
@@ -9194,11 +8507,11 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y
if (htype == NODE_STR) {
if (!literal_concat0(parser, lit, tail->nd_lit)) {
error:
- rb_discard_node(head);
- rb_discard_node(tail);
+ rb_gc_force_recycle((VALUE)head);
+ rb_gc_force_recycle((VALUE)tail);
return 0;
}
- rb_discard_node(tail);
+ rb_gc_force_recycle((VALUE)tail);
}
else {
list_append(head, tail);
@@ -9210,7 +8523,7 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y
if (!literal_concat0(parser, head->nd_lit, tail->nd_lit))
goto error;
tail->nd_lit = head->nd_lit;
- rb_discard_node(head);
+ rb_gc_force_recycle((VALUE)head);
head = tail;
}
else if (NIL_P(tail->nd_lit)) {
@@ -9218,7 +8531,7 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y
head->nd_alen += tail->nd_alen - 1;
head->nd_next->nd_end->nd_next = tail->nd_next;
head->nd_next->nd_end = tail->nd_next->nd_end;
- rb_discard_node(tail);
+ rb_gc_force_recycle((VALUE)tail);
}
else if (htype == NODE_DSTR && (headlast = head->nd_next->nd_end->nd_head) &&
nd_type(headlast) == NODE_STR) {
@@ -9230,7 +8543,7 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const Y
}
else {
nd_set_type(tail, NODE_ARRAY);
- tail->nd_head = new_str(tail->nd_lit, location);
+ tail->nd_head = NEW_STR(tail->nd_lit);
list_concat(head, tail);
}
break;
@@ -9250,16 +8563,15 @@ static NODE *
evstr2dstr_gen(struct parser_params *parser, NODE *node)
{
if (nd_type(node) == NODE_EVSTR) {
- node = list_append(new_dstr(STR_NEW0(), &node->nd_loc), node);
+ node = list_append(NEW_DSTR(Qnil), node);
}
return node;
}
static NODE *
-new_evstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
+new_evstr_gen(struct parser_params *parser, NODE *node)
{
NODE *head = node;
- NODE *evstr;
if (node) {
switch (nd_type(node)) {
@@ -9267,501 +8579,95 @@ new_evstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
return node;
}
}
- evstr = NEW_EVSTR(head);
- nd_set_loc(evstr, location);
- return evstr;
+ return NEW_EVSTR(head);
}
static NODE *
-call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1,
- const YYLTYPE *op_loc, const YYLTYPE *location)
+call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1)
{
- NODE *expr;
value_expr(recv);
value_expr(arg1);
- expr = NEW_OPCALL(recv, id, new_list(arg1, &arg1->nd_loc));
- nd_set_line(expr, op_loc->first_loc.lineno);
- expr->nd_loc = *location;
- return expr;
+ return NEW_CALL(recv, id, NEW_LIST(arg1));
}
static NODE *
-call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id, const YYLTYPE *op_loc, const YYLTYPE *location)
+call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id)
{
- NODE *opcall;
value_expr(recv);
- opcall = NEW_OPCALL(recv, id, 0);
- opcall->nd_loc = *location;
- nd_set_line(opcall, op_loc->first_loc.lineno);
- return opcall;
-}
-
-static NODE *
-new_qcall_gen(struct parser_params* parser, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *location)
-{
- NODE *qcall = NEW_QCALL(atype, recv, mid, args);
- qcall->nd_loc = *location;
- return qcall;
+ return NEW_CALL(recv, id, 0);
}
-#define nd_once_body(node) (nd_type(node) == NODE_SCOPE ? (node)->nd_body : node)
static NODE*
-match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2, const YYLTYPE *op_loc, const YYLTYPE *location)
+match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
{
- NODE *n;
- int line = op_loc->first_loc.lineno;
-
value_expr(node1);
value_expr(node2);
- if (node1 && (n = nd_once_body(node1)) != 0) {
- switch (nd_type(n)) {
+ if (node1) {
+ switch (nd_type(node1)) {
case NODE_DREGX:
- {
- NODE *match = NEW_MATCH2(node1, node2);
- match->nd_loc = *location;
- nd_set_line(match, line);
- return match;
- }
+ case NODE_DREGX_ONCE:
+ return NEW_MATCH2(node1, node2);
case NODE_LIT:
- if (RB_TYPE_P(n->nd_lit, T_REGEXP)) {
- const VALUE lit = n->nd_lit;
- NODE *match = NEW_MATCH2(node1, node2);
- match->nd_args = reg_named_capture_assign(lit, location);
- match->nd_loc = *location;
- nd_set_line(match, line);
- return match;
+ if (RB_TYPE_P(node1->nd_lit, T_REGEXP)) {
+ return NEW_MATCH2(node1, node2);
}
}
}
- if (node2 && (n = nd_once_body(node2)) != 0) {
- NODE *match3;
+ if (node2) {
+ switch (nd_type(node2)) {
+ case NODE_DREGX:
+ case NODE_DREGX_ONCE:
+ return NEW_MATCH3(node2, node1);
- switch (nd_type(n)) {
case NODE_LIT:
- if (!RB_TYPE_P(n->nd_lit, T_REGEXP)) break;
- /* fallthru */
- case NODE_DREGX:
- match3 = NEW_MATCH3(node2, node1);
- match3->nd_loc = *location;
- nd_set_line(match3, line);
- return match3;
+ if (RB_TYPE_P(node2->nd_lit, T_REGEXP)) {
+ return NEW_MATCH3(node2, node1);
+ }
}
}
- n = new_call(node1, tMATCH, new_list(node2, &node2->nd_loc), location);
- nd_set_line(n, line);
- return n;
-}
-
-# if WARN_PAST_SCOPE
-static int
-past_dvar_p(struct parser_params *parser, ID id)
-{
- struct vtable *past = lvtbl->past;
- while (past) {
- if (vtable_included(past, id)) return 1;
- past = past->prev;
- }
- return 0;
+ return NEW_CALL(node1, tMATCH, NEW_LIST(node2));
}
-# endif
static NODE*
-gettable_gen(struct parser_params *parser, ID id, const YYLTYPE *location)
+gettable_gen(struct parser_params *parser, ID id)
{
- ID *vidp = NULL;
- NODE *node;
switch (id) {
case keyword_self:
- node = NEW_SELF();
- nd_set_loc(node, location);
- return node;
+ return NEW_SELF();
case keyword_nil:
- node = NEW_NIL();
- nd_set_loc(node, location);
- return node;
+ return NEW_NIL();
case keyword_true:
- node = NEW_TRUE();
- nd_set_loc(node, location);
- return node;
+ return NEW_TRUE();
case keyword_false:
- node = NEW_FALSE();
- nd_set_loc(node, location);
- return node;
+ return NEW_FALSE();
case keyword__FILE__:
- node = new_str(rb_str_dup(ruby_sourcefile_string), location);
- return node;
+ return NEW_STR(rb_str_dup(ruby_sourcefile_string));
case keyword__LINE__:
- return new_lit(INT2FIX(tokline), location);
+ return NEW_LIT(INT2FIX(tokline));
case keyword__ENCODING__:
- return new_lit(rb_enc_from_encoding(current_enc), location);
+ return NEW_LIT(rb_enc_from_encoding(current_enc));
}
switch (id_type(id)) {
case ID_LOCAL:
- if (dyna_in_block() && dvar_defined_ref(id, vidp)) {
- if (id == current_arg) {
- rb_warn1("circular argument reference - %"PRIsWARN, rb_id2str(id));
- }
- if (vidp) *vidp |= LVAR_USED;
- node = new_dvar(id, location);
- return node;
- }
- if (local_id_ref(id, vidp)) {
- if (id == current_arg) {
- rb_warn1("circular argument reference - %"PRIsWARN, rb_id2str(id));
- }
- if (vidp) *vidp |= LVAR_USED;
- node = new_lvar(id, location);
- return node;
- }
-# if WARN_PAST_SCOPE
- if (!in_defined && RTEST(ruby_verbose) && past_dvar_p(parser, id)) {
- rb_warning1("possible reference to past scope - %"PRIsWARN, rb_id2str(id));
- }
-# endif
+ if (dyna_in_block() && dvar_defined(id)) return NEW_DVAR(id);
+ if (local_id(id)) return NEW_LVAR(id);
/* method call without arguments */
- node = NEW_VCALL(id);
- nd_set_loc(node, location);
- return node;
+ return NEW_VCALL(id);
case ID_GLOBAL:
- node = new_gvar(id, location);
- return node;
+ return NEW_GVAR(id);
case ID_INSTANCE:
- node = new_ivar(id, location);
- return node;
+ return NEW_IVAR(id);
case ID_CONST:
- node = NEW_CONST(id);
- nd_set_loc(node, location);
- return node;
+ return NEW_CONST(id);
case ID_CLASS:
- node = NEW_CVAR(id);
- nd_set_loc(node, location);
- return node;
+ return NEW_CVAR(id);
}
compile_error(PARSER_ARG "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
return 0;
}
-
-static NODE *
-opt_arg_append(NODE *opt_list, NODE *opt)
-{
- NODE *opts = opt_list;
- opts->nd_loc.last_loc = opt->nd_loc.last_loc;
-
- while (opts->nd_next) {
- opts = opts->nd_next;
- opts->nd_loc.last_loc = opt->nd_loc.last_loc;
- }
- opts->nd_next = opt;
-
- return opt_list;
-}
-
-static NODE *
-kwd_append(NODE *kwlist, NODE *kw)
-{
- if (kwlist) {
- NODE *kws = kwlist;
- kws->nd_loc.last_loc = kw->nd_loc.last_loc;
- while (kws->nd_next) {
- kws = kws->nd_next;
- kws->nd_loc.last_loc = kw->nd_loc.last_loc;
- }
- kws->nd_next = kw;
- }
- return kwlist;
-}
-
-static NODE *
-new_defined_gen(struct parser_params *parser, NODE *expr, const YYLTYPE *location)
-{
- NODE *defined = NEW_DEFINED(remove_begin_all(expr));
- nd_set_loc(defined, location);
- return defined;
-}
-
-static NODE *
-new_regexp_gen(struct parser_params *parser, NODE *node, int options, const YYLTYPE *location)
-{
- NODE *list, *prev;
- VALUE lit;
-
- if (!node) {
- return new_lit(reg_compile(STR_NEW0(), options), location);
- }
- switch (nd_type(node)) {
- case NODE_STR:
- {
- VALUE src = node->nd_lit;
- nd_set_type(node, NODE_LIT);
- nd_set_loc(node, location);
- add_mark_object(node->nd_lit = reg_compile(src, options));
- }
- break;
- default:
- add_mark_object(lit = STR_NEW0());
- node = NEW_NODE(NODE_DSTR, lit, 1, new_list(node, location));
- case NODE_DSTR:
- nd_set_type(node, NODE_DREGX);
- nd_set_loc(node, location);
- node->nd_cflag = options & RE_OPTION_MASK;
- if (!NIL_P(node->nd_lit)) reg_fragment_check(node->nd_lit, options);
- for (list = (prev = node)->nd_next; list; list = list->nd_next) {
- if (nd_type(list->nd_head) == NODE_STR) {
- VALUE tail = list->nd_head->nd_lit;
- if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) {
- VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit;
- if (!literal_concat0(parser, lit, tail)) {
- return NEW_NIL(); /* dummy node on error */
- }
- rb_str_resize(tail, 0);
- prev->nd_next = list->nd_next;
- rb_discard_node(list->nd_head);
- rb_discard_node(list);
- list = prev;
- }
- else {
- prev = list;
- }
- }
- else {
- prev = 0;
- }
- }
- if (!node->nd_next) {
- VALUE src = node->nd_lit;
- nd_set_type(node, NODE_LIT);
- add_mark_object(node->nd_lit = reg_compile(src, options));
- }
- if (options & RE_OPTION_ONCE) {
- node = NEW_NODE(NODE_SCOPE, 0, node, 0);
- nd_set_loc(node, location);
- }
- break;
- }
- return node;
-}
-
-static NODE *
-new_lit_gen(struct parser_params *parser, VALUE sym, const YYLTYPE *location)
-{
- NODE *lit = NEW_LIT(sym);
- add_mark_object(sym);
- nd_set_loc(lit, location);
- return lit;
-}
-
-static NODE *
-new_list_gen(struct parser_params *parser, NODE *item, const YYLTYPE *location)
-{
- NODE *list = NEW_LIST(item);
- nd_set_loc(list, location);
- return list;
-}
-
-static NODE *
-new_str_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location)
-{
- NODE *nd_str = NEW_STR(str);
- add_mark_object(str);
- nd_set_loc(nd_str, location);
- return nd_str;
-}
-
-static NODE *
-new_dvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location)
-{
- NODE *dvar = NEW_DVAR(id);
- nd_set_loc(dvar, location);
- return dvar;
-}
-
-static NODE *
-new_resbody_gen(struct parser_params *parser, NODE *exc_list, NODE *stmt, NODE *rescue, const YYLTYPE *location)
-{
- NODE *resbody = NEW_RESBODY(exc_list, stmt, rescue);
- nd_set_loc(resbody, location);
- return resbody;
-}
-
-static NODE *
-new_errinfo_gen(struct parser_params *parser, const YYLTYPE *location)
-{
- NODE *errinfo = NEW_ERRINFO();
- nd_set_loc(errinfo, location);
- return errinfo;
-}
-
-static NODE *
-new_call_gen(struct parser_params *parser, NODE *recv, ID mid, NODE *args, const YYLTYPE *location)
-{
- NODE *call = NEW_CALL(recv, mid, args);
- nd_set_loc(call, location);
- return call;
-}
-
-static NODE *
-new_fcall_gen(struct parser_params *parser, ID mid, NODE *args, const YYLTYPE *location)
-{
- NODE *fcall = NEW_FCALL(mid, args);
- nd_set_loc(fcall, location);
- return fcall;
-}
-
-static NODE *
-new_for_gen(struct parser_params *parser, NODE *var, NODE *iter, NODE *body, const YYLTYPE *location)
-{
- NODE *nd_for = NEW_FOR(var, iter, body);
- nd_set_loc(nd_for, location);
- return nd_for;
-}
-
-static NODE *
-new_gvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location)
-{
- NODE *gvar = NEW_GVAR(id);
- nd_set_loc(gvar, location);
- return gvar;
-}
-
-static NODE *
-new_lvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location)
-{
- NODE *lvar = NEW_LVAR(id);
- nd_set_loc(lvar, location);
- return lvar;
-}
-
-static NODE *
-new_dstr_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location)
-{
- NODE *dstr = NEW_DSTR(str);
- add_mark_object(str);
- nd_set_loc(dstr, location);
- return dstr;
-}
-
-static NODE *
-new_rescue_gen(struct parser_params *parser, NODE *b, NODE *res, NODE *e, const YYLTYPE *location)
-{
- NODE *rescue = NEW_RESCUE(b, res, e);
- nd_set_loc(rescue, location);
- return rescue;
-}
-
-static NODE *
-new_undef_gen(struct parser_params *parser, NODE *i, const YYLTYPE *location)
-{
- NODE *undef = NEW_UNDEF(i);
- nd_set_loc(undef, location);
- return undef;
-}
-
-static NODE *
-new_zarray_gen(struct parser_params *parser, const YYLTYPE *location)
-{
- NODE *zarray = NEW_ZARRAY();
- nd_set_loc(zarray, location);
- return zarray;
-}
-
-static NODE *
-new_ivar_gen(struct parser_params *parser, ID id, const YYLTYPE *location)
-{
- NODE *ivar = NEW_IVAR(id);
- nd_set_loc(ivar, location);
- return ivar;
-}
-
-static NODE *
-new_postarg_gen(struct parser_params *parser, NODE *i, NODE *v, const YYLTYPE *location)
-{
- NODE *postarg = NEW_POSTARG(i, v);
- nd_set_loc(postarg, location);
- return postarg;
-}
-
-static NODE *
-new_cdecl_gen(struct parser_params *parser, ID v, NODE *val, NODE *path, const YYLTYPE *location)
-{
- NODE *nd_cdecl = NEW_CDECL(v, val, path);
- nd_set_loc(nd_cdecl, location);
- return nd_cdecl;
-}
-
-static NODE *
-new_scope_gen(struct parser_params *parser, NODE *a, NODE *b, const YYLTYPE *location)
-{
- NODE *scope = NEW_SCOPE(a, b);
- nd_set_loc(scope, location);
- return scope;
-}
-
-static NODE *
-new_begin_gen(struct parser_params *parser, NODE *b, const YYLTYPE *location)
-{
- NODE *begin = NEW_BEGIN(b);
- nd_set_loc(begin, location);
- return begin;
-}
-
-static NODE *
-new_masgn_gen(struct parser_params *parser, NODE *l, NODE *r, const YYLTYPE *location)
-{
- NODE *masgn = NEW_MASGN(l, r);
- nd_set_loc(masgn, location);
- return masgn;
-}
-
-
-static NODE *
-new_kw_arg_gen(struct parser_params *parser, NODE *k, const YYLTYPE *location)
-{
- NODE *kw_arg;
- if (!k) return 0;
- kw_arg = NEW_KW_ARG(0, (k));
- nd_set_loc(kw_arg, location);
- return kw_arg;
-}
-
-static NODE *
-new_xstring_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
-{
- if (!node) {
- VALUE lit = STR_NEW0();
- NODE *xstr = NEW_XSTR(lit);
- add_mark_object(lit);
- xstr->nd_loc = *location;
- return xstr;
- }
- switch (nd_type(node)) {
- case NODE_STR:
- nd_set_type(node, NODE_XSTR);
- nd_set_loc(node, location);
- break;
- case NODE_DSTR:
- nd_set_type(node, NODE_DXSTR);
- nd_set_loc(node, location);
- break;
- default:
- node = NEW_NODE(NODE_DXSTR, Qnil, 1, new_list(node, location));
- nd_set_loc(node, location);
- break;
- }
- return node;
-}
-
-static NODE *
-new_body_gen(struct parser_params *parser, NODE *param, NODE *stmt, const YYLTYPE *location)
-{
- NODE *iter = NEW_ITER(param, stmt);
- nd_set_loc(iter->nd_body, location);
- nd_set_loc(iter, location);
- return iter;
-
-}
#else /* !RIPPER */
static int
id_is_var_gen(struct parser_params *parser, ID id)
@@ -9777,234 +8683,64 @@ id_is_var_gen(struct parser_params *parser, ID id)
return 0;
}
}
- compile_error(PARSER_ARG "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id));
+ compile_error(PARSER_ARG "identifier %s is not valid to get", rb_id2str(id));
return 0;
}
-
-static VALUE
-new_regexp_gen(struct parser_params *parser, VALUE re, VALUE opt)
-{
- VALUE src = 0, err;
- int options = 0;
- if (ripper_is_node_yylval(re)) {
- src = RNODE(re)->nd_cval;
- re = RNODE(re)->nd_rval;
- }
- if (ripper_is_node_yylval(opt)) {
- options = (int)RNODE(opt)->nd_tag;
- opt = RNODE(opt)->nd_rval;
- }
- if (src && NIL_P(parser_reg_compile(parser, src, options, &err))) {
- compile_error(PARSER_ARG "%"PRIsVALUE, err);
- }
- return dispatch2(regexp_literal, re, opt);
-}
-
-static VALUE
-new_xstring_gen(struct parser_params *parser, VALUE str)
-{
- return dispatch1(xstring_literal, str);
-}
-#endif /* !RIPPER */
-
-#ifndef RIPPER
-const char rb_parser_lex_state_names[][13] = {
- "EXPR_BEG", "EXPR_END", "EXPR_ENDARG", "EXPR_ENDFN", "EXPR_ARG",
- "EXPR_CMDARG", "EXPR_MID", "EXPR_FNAME", "EXPR_DOT", "EXPR_CLASS",
- "EXPR_LABEL", "EXPR_LABELED","EXPR_FITEM",
-};
-
-static VALUE
-append_lex_state_name(enum lex_state_e state, VALUE buf)
-{
- int i, sep = 0;
- unsigned int mask = 1;
- static const char none[] = "EXPR_NONE";
-
- for (i = 0; i < EXPR_MAX_STATE; ++i, mask <<= 1) {
- if ((unsigned)state & mask) {
- if (sep) {
- rb_str_cat(buf, "|", 1);
- }
- sep = 1;
- rb_str_cat_cstr(buf, rb_parser_lex_state_names[i]);
- }
- }
- if (!sep) {
- rb_str_cat(buf, none, sizeof(none)-1);
- }
- return buf;
-}
-
-static void
-flush_debug_buffer(struct parser_params *parser, VALUE out, VALUE str)
-{
- VALUE mesg = parser->debug_buffer;
-
- if (!NIL_P(mesg) && RSTRING_LEN(mesg)) {
- parser->debug_buffer = Qnil;
- rb_io_puts(1, &mesg, out);
- }
- if (!NIL_P(str) && RSTRING_LEN(str)) {
- rb_io_write(parser->debug_output, str);
- }
-}
-
-enum lex_state_e
-rb_parser_trace_lex_state(struct parser_params *parser, enum lex_state_e from,
- enum lex_state_e to, int line)
-{
- VALUE mesg;
- mesg = rb_str_new_cstr("lex_state: ");
- append_lex_state_name(from, mesg);
- rb_str_cat_cstr(mesg, " -> ");
- append_lex_state_name(to, mesg);
- rb_str_catf(mesg, " at line %d\n", line);
- flush_debug_buffer(parser, parser->debug_output, mesg);
- return to;
-}
-
-VALUE
-rb_parser_lex_state_name(enum lex_state_e state)
-{
- return rb_fstring(append_lex_state_name(state, rb_str_new(0, 0)));
-}
-
-static void
-append_bitstack_value(stack_type stack, VALUE mesg)
-{
- if (stack == 0) {
- rb_str_cat_cstr(mesg, "0");
- }
- else {
- stack_type mask = (stack_type)1U << (CHAR_BIT * sizeof(stack_type) - 1);
- for (; mask && !(stack & mask); mask >>= 1) continue;
- for (; mask; mask >>= 1) rb_str_cat(mesg, stack & mask ? "1" : "0", 1);
- }
-}
-
-void
-rb_parser_show_bitstack(struct parser_params *parser, stack_type stack,
- const char *name, int line)
-{
- VALUE mesg = rb_sprintf("%s: ", name);
- append_bitstack_value(stack, mesg);
- rb_str_catf(mesg, " at line %d\n", line);
- flush_debug_buffer(parser, parser->debug_output, mesg);
-}
-
-void
-rb_parser_fatal(struct parser_params *parser, const char *fmt, ...)
-{
- va_list ap;
- VALUE mesg = rb_str_new_cstr("internal parser error: ");
-
- va_start(ap, fmt);
- rb_str_vcatf(mesg, fmt, ap);
- va_end(ap);
-#ifndef RIPPER
- parser_yyerror(parser, RSTRING_PTR(mesg));
- RB_GC_GUARD(mesg);
-#else
- dispatch1(parse_error, mesg);
- ripper_error();
#endif /* !RIPPER */
- mesg = rb_str_new(0, 0);
- append_lex_state_name(lex_state, mesg);
- compile_error(PARSER_ARG "lex_state: %"PRIsVALUE, mesg);
- rb_str_resize(mesg, 0);
- append_bitstack_value(cond_stack, mesg);
- compile_error(PARSER_ARG "cond_stack: %"PRIsVALUE, mesg);
- rb_str_resize(mesg, 0);
- append_bitstack_value(cmdarg_stack, mesg);
- compile_error(PARSER_ARG "cmdarg_stack: %"PRIsVALUE, mesg);
- if (parser->debug_output == rb_stdout)
- parser->debug_output = rb_stderr;
- yydebug = TRUE;
-}
-
-void
-rb_parser_set_location_from_strterm_heredoc(struct parser_params *parser, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
-{
- const char *eos = RSTRING_PTR(here->term);
- int term_len = (int)eos[0];
-
- yylloc->first_loc.lineno = (int)here->sourceline;
- yylloc->first_loc.column = (int)(here->u3.lastidx - term_len);
- yylloc->last_loc.lineno = (int)here->sourceline;
- yylloc->last_loc.column = (int)(here->u3.lastidx);
-}
-
-void
-rb_parser_set_location_of_none(struct parser_params *parser, YYLTYPE *yylloc)
-{
- yylloc->first_loc.lineno = ruby_sourceline;
- yylloc->first_loc.column = (int)(parser->tokp - lex_pbeg);
- yylloc->last_loc.lineno = ruby_sourceline;
- yylloc->last_loc.column = (int)(parser->tokp - lex_pbeg);
-}
-
-void
-rb_parser_set_location(struct parser_params *parser, YYLTYPE *yylloc)
+#if PARSER_DEBUG
+static const char *
+lex_state_name(enum lex_state_e state)
{
- yylloc->first_loc.lineno = ruby_sourceline;
- yylloc->first_loc.column = (int)(parser->tokp - lex_pbeg);
- yylloc->last_loc.lineno = ruby_sourceline;
- yylloc->last_loc.column = (int)(lex_p - lex_pbeg);
-}
-#endif /* !RIPPER */
+ static const char names[][12] = {
+ "EXPR_BEG", "EXPR_END", "EXPR_ENDARG", "EXPR_ENDFN", "EXPR_ARG",
+ "EXPR_CMDARG", "EXPR_MID", "EXPR_FNAME", "EXPR_DOT", "EXPR_CLASS",
+ "EXPR_VALUE",
+ };
-#ifndef RIPPER
-static NODE*
-assignable_result0(NODE *node, const YYLTYPE *location)
-{
- if (node) {
- nd_set_loc(node, location);
- }
- return node;
+ if ((unsigned)state & ~(~0u << EXPR_MAX_STATE))
+ return names[ffs(state)];
+ return NULL;
}
-#endif /* !RIPPER */
+#endif
#ifdef RIPPER
static VALUE
assignable_gen(struct parser_params *parser, VALUE lhs)
#else
static NODE*
-assignable_gen(struct parser_params *parser, ID id, NODE *val, const YYLTYPE *location)
+assignable_gen(struct parser_params *parser, ID id, NODE *val)
#endif
{
#ifdef RIPPER
ID id = get_id(lhs);
-# define assignable_result(x) (lhs)
-# define assignable_error() (lhs)
-# define parser_yyerror(parser, x) (lhs = assign_error_gen(parser, lhs))
+# define assignable_result(x) get_value(lhs)
+# define parser_yyerror(parser, x) dispatch1(assign_error, lhs)
#else
-# define assignable_result(x) assignable_result0(x, location)
-# define assignable_error() new_begin(0, location)
+# define assignable_result(x) (x)
#endif
- if (!id) return assignable_error();
+ if (!id) return assignable_result(0);
switch (id) {
case keyword_self:
- yyerror0("Can't change the value of self");
+ yyerror("Can't change the value of self");
goto error;
case keyword_nil:
- yyerror0("Can't assign to nil");
+ yyerror("Can't assign to nil");
goto error;
case keyword_true:
- yyerror0("Can't assign to true");
+ yyerror("Can't assign to true");
goto error;
case keyword_false:
- yyerror0("Can't assign to false");
+ yyerror("Can't assign to false");
goto error;
case keyword__FILE__:
- yyerror0("Can't assign to __FILE__");
+ yyerror("Can't assign to __FILE__");
goto error;
case keyword__LINE__:
- yyerror0("Can't assign to __LINE__");
+ yyerror("Can't assign to __LINE__");
goto error;
case keyword__ENCODING__:
- yyerror0("Can't assign to __ENCODING__");
+ yyerror("Can't assign to __ENCODING__");
goto error;
}
switch (id_type(id)) {
@@ -10036,9 +8772,9 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val, const YYLTYPE *lo
case ID_INSTANCE:
return assignable_result(NEW_IASGN(id, val));
case ID_CONST:
- if (!in_def)
- return assignable_result(new_cdecl(id, val, 0, location));
- yyerror0("dynamic constant assignment");
+ if (!in_def && !in_single)
+ return assignable_result(NEW_CDECL(id, val, 0));
+ yyerror("dynamic constant assignment");
break;
case ID_CLASS:
return assignable_result(NEW_CVASGN(id, val));
@@ -10046,7 +8782,7 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val, const YYLTYPE *lo
compile_error(PARSER_ARG "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id));
}
error:
- return assignable_error();
+ return assignable_result(0);
#undef assignable_result
#undef parser_yyerror
}
@@ -10062,16 +8798,18 @@ is_private_local_id(ID name)
return RSTRING_PTR(s)[0] == '_';
}
+#define LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
+
static int
shadowing_lvar_0(struct parser_params *parser, ID name)
{
if (is_private_local_id(name)) return 1;
if (dyna_in_block()) {
if (dvar_curr(name)) {
- yyerror0("duplicated argument name");
+ yyerror("duplicated argument name");
}
- else if (dvar_defined(name) || local_id(name)) {
- rb_warning1("shadowing outer local variable - %"PRIsWARN, rb_id2str(name));
+ else if (dvar_defined_get(name) || local_id(name)) {
+ rb_warningV("shadowing outer local variable - %"PRIsVALUE, rb_id2str(name));
vtable_add(lvtbl->vars, name);
if (lvtbl->used) {
vtable_add(lvtbl->used, (ID)ruby_sourceline | LVAR_USED);
@@ -10081,7 +8819,7 @@ shadowing_lvar_0(struct parser_params *parser, ID name)
}
else {
if (local_id(name)) {
- yyerror0("duplicated argument name");
+ yyerror("duplicated argument name");
}
}
return 1;
@@ -10109,11 +8847,9 @@ new_bv_gen(struct parser_params *parser, ID name)
#ifndef RIPPER
static NODE *
-aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx, const YYLTYPE *location)
+aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx)
{
- NODE *attrasgn = NEW_ATTRASGN(recv, tASET, idx);
- nd_set_loc(attrasgn, location);
- return attrasgn;
+ return NEW_ATTRASGN(recv, tASET, idx);
}
static void
@@ -10125,13 +8861,9 @@ block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
}
static NODE *
-attrset_gen(struct parser_params *parser, NODE *recv, ID atype, ID id, const YYLTYPE *location)
+attrset_gen(struct parser_params *parser, NODE *recv, ID id)
{
- NODE *attrasgn;
- if (!CALL_Q_P(atype)) id = rb_id_attrset(id);
- attrasgn = NEW_ATTRASGN(recv, id, 0);
- nd_set_loc(attrasgn, location);
- return attrasgn;
+ return NEW_ATTRASGN(recv, rb_id_attrset(id), 0);
}
static void
@@ -10148,21 +8880,19 @@ rb_backref_error_gen(struct parser_params *parser, NODE *node)
}
static NODE *
-arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2, const YYLTYPE *location)
+arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2)
{
- NODE *argscat;
-
if (!node2) return node1;
switch (nd_type(node1)) {
case NODE_BLOCK_PASS:
if (node1->nd_head)
- node1->nd_head = arg_concat(node1->nd_head, node2, location);
+ node1->nd_head = arg_concat(node1->nd_head, node2);
else
- node1->nd_head = new_list(node2, location);
+ node1->nd_head = NEW_LIST(node2);
return node1;
case NODE_ARGSPUSH:
if (nd_type(node2) != NODE_ARRAY) break;
- node1->nd_body = list_concat(new_list(node1->nd_body, location), node2);
+ node1->nd_body = list_concat(NEW_LIST(node1->nd_body), node2);
nd_set_type(node1, NODE_ARGSCAT);
return node1;
case NODE_ARGSCAT:
@@ -10171,33 +8901,25 @@ arg_concat_gen(struct parser_params *parser, NODE *node1, NODE *node2, const YYL
node1->nd_body = list_concat(node1->nd_body, node2);
return node1;
}
- argscat = NEW_ARGSCAT(node1, node2);
- nd_set_loc(argscat, location);
- return argscat;
+ return NEW_ARGSCAT(node1, node2);
}
static NODE *
-arg_append_gen(struct parser_params *parser, NODE *node1, NODE *node2, const YYLTYPE *location)
+arg_append_gen(struct parser_params *parser, NODE *node1, NODE *node2)
{
- NODE *argspush;
-
- if (!node1) return new_list(node2, &node2->nd_loc);
+ if (!node1) return NEW_LIST(node2);
switch (nd_type(node1)) {
case NODE_ARRAY:
return list_append(node1, node2);
case NODE_BLOCK_PASS:
- node1->nd_head = arg_append(node1->nd_head, node2, location);
- node1->nd_loc.last_loc = node1->nd_head->nd_loc.last_loc;
+ node1->nd_head = arg_append(node1->nd_head, node2);
return node1;
case NODE_ARGSPUSH:
- node1->nd_body = list_append(new_list(node1->nd_body, &node1->nd_body->nd_loc), node2);
- node1->nd_loc.last_loc = node1->nd_body->nd_loc.last_loc;
+ node1->nd_body = list_append(NEW_LIST(node1->nd_body), node2);
nd_set_type(node1, NODE_ARGSCAT);
return node1;
}
- argspush = NEW_ARGSPUSH(node1, node2);
- nd_set_loc(argspush, location);
- return argspush;
+ return NEW_ARGSPUSH(node1, node2);
}
static NODE *
@@ -10208,41 +8930,15 @@ splat_array(NODE* node)
return 0;
}
-static void
-mark_lvar_used(struct parser_params *parser, NODE *rhs)
-{
- ID *vidp = NULL;
- if (!rhs) return;
- switch (nd_type(rhs)) {
- case NODE_LASGN:
- if (local_id_ref(rhs->nd_vid, vidp)) {
- if (vidp) *vidp |= LVAR_USED;
- }
- break;
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- if (dvar_defined_ref(rhs->nd_vid, vidp)) {
- if (vidp) *vidp |= LVAR_USED;
- }
- break;
-#if 0
- case NODE_MASGN:
- for (rhs = rhs->nd_head; rhs; rhs = rhs->nd_next) {
- mark_lvar_used(parser, rhs->nd_head);
- }
- break;
-#endif
- }
-}
-
static NODE *
-node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYPE *location)
+node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
{
if (!lhs) return 0;
switch (nd_type(lhs)) {
case NODE_GASGN:
case NODE_IASGN:
+ case NODE_IASGN2:
case NODE_LASGN:
case NODE_DASGN:
case NODE_DASGN_CURR:
@@ -10250,12 +8946,11 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs, const YYLTYP
case NODE_CDECL:
case NODE_CVASGN:
lhs->nd_value = rhs;
- nd_set_loc(lhs, location);
break;
case NODE_ATTRASGN:
- lhs->nd_args = arg_append(lhs->nd_args, rhs, location);
- nd_set_loc(lhs, location);
+ case NODE_CALL:
+ lhs->nd_args = arg_append(lhs->nd_args, rhs);
break;
default:
@@ -10281,7 +8976,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
case NODE_NEXT:
case NODE_REDO:
case NODE_RETRY:
- if (!cond) yyerror0("void value expression");
+ if (!cond) yyerror("void value expression");
/* or "control never reach"? */
return FALSE;
@@ -10297,7 +8992,6 @@ value_expr_gen(struct parser_params *parser, NODE *node)
break;
case NODE_IF:
- case NODE_UNLESS:
if (!node->nd_body) {
node = node->nd_else;
break;
@@ -10316,13 +9010,6 @@ value_expr_gen(struct parser_params *parser, NODE *node)
node = node->nd_2nd;
break;
- case NODE_LASGN:
- case NODE_DASGN:
- case NODE_DASGN_CURR:
- case NODE_MASGN:
- mark_lvar_used(parser, node);
- return TRUE;
-
default:
return TRUE;
}
@@ -10338,9 +9025,9 @@ void_expr_gen(struct parser_params *parser, NODE *node)
if (!RTEST(ruby_verbose)) return;
- if (!node || !(node = nd_once_body(node))) return;
+ if (!node) return;
switch (nd_type(node)) {
- case NODE_OPCALL:
+ case NODE_CALL:
switch (node->nd_mid) {
case '+':
case '-':
@@ -10381,6 +9068,7 @@ void_expr_gen(struct parser_params *parser, NODE *node)
case NODE_STR:
case NODE_DSTR:
case NODE_DREGX:
+ case NODE_DREGX_ONCE:
useless = "a literal";
break;
case NODE_COLON2:
@@ -10411,7 +9099,11 @@ void_expr_gen(struct parser_params *parser, NODE *node)
}
if (useless) {
- rb_warn1L(nd_line(node), "possibly useless use of %s in void context", WARN_S(useless));
+ int line = ruby_sourceline;
+
+ ruby_sourceline = nd_line(node);
+ rb_warnS("possibly useless use of %s in void context", useless);
+ ruby_sourceline = line;
}
}
@@ -10482,7 +9174,6 @@ reduce_nodes_gen(struct parser_params *parser, NODE **body)
body = &node->nd_end->nd_head;
break;
case NODE_IF:
- case NODE_UNLESS:
if (subnodes(nd_body, nd_else)) break;
return;
case NODE_CASE:
@@ -10540,6 +9231,9 @@ assign_in_cond(struct parser_params *parser, NODE *node)
{
switch (nd_type(node)) {
case NODE_MASGN:
+ yyerror("multiple assignment in conditional");
+ return 1;
+
case NODE_LASGN:
case NODE_DASGN:
case NODE_DASGN_CURR:
@@ -10571,10 +9265,39 @@ warning_unless_e_option(struct parser_params *parser, NODE *node, const char *st
if (!e_option_supplied(parser)) parser_warning(node, str);
}
-static NODE *cond0(struct parser_params*,NODE*,int,const YYLTYPE*);
+static void
+fixup_nodes(NODE **rootnode)
+{
+ NODE *node, *next, *head;
+
+ for (node = *rootnode; node; node = next) {
+ enum node_type type;
+ VALUE val;
+
+ next = node->nd_next;
+ head = node->nd_head;
+ rb_gc_force_recycle((VALUE)node);
+ *rootnode = next;
+ switch (type = nd_type(head)) {
+ case NODE_DOT2:
+ case NODE_DOT3:
+ val = rb_range_new(head->nd_beg->nd_lit, head->nd_end->nd_lit,
+ type == NODE_DOT3);
+ rb_gc_force_recycle((VALUE)head->nd_beg);
+ rb_gc_force_recycle((VALUE)head->nd_end);
+ nd_set_type(head, NODE_LIT);
+ head->nd_lit = val;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static NODE *cond0(struct parser_params*,NODE*);
static NODE*
-range_op(struct parser_params *parser, NODE *node, const YYLTYPE *location)
+range_op(struct parser_params *parser, NODE *node)
{
enum node_type type;
@@ -10584,22 +9307,22 @@ range_op(struct parser_params *parser, NODE *node, const YYLTYPE *location)
value_expr(node);
if (type == NODE_LIT && FIXNUM_P(node->nd_lit)) {
warn_unless_e_option(parser, node, "integer literal in conditional range");
- return new_call(node, tEQ, new_list(new_gvar(rb_intern("$."), location), location), location);
+ return NEW_CALL(node, tEQ, NEW_LIST(NEW_GVAR(rb_intern("$."))));
}
- return cond0(parser, node, FALSE, location);
+ return cond0(parser, node);
}
static int
literal_node(NODE *node)
{
if (!node) return 1; /* same as NODE_NIL */
- if (!(node = nd_once_body(node))) return 1;
switch (nd_type(node)) {
case NODE_LIT:
case NODE_STR:
case NODE_DSTR:
case NODE_EVSTR:
case NODE_DREGX:
+ case NODE_DREGX_ONCE:
case NODE_DSYM:
return 2;
case NODE_TRUE:
@@ -10611,43 +9334,36 @@ literal_node(NODE *node)
}
static NODE*
-cond0(struct parser_params *parser, NODE *node, int method_op, const YYLTYPE *location)
+cond0(struct parser_params *parser, NODE *node)
{
if (node == 0) return 0;
- if (!(node = nd_once_body(node))) return 0;
assign_in_cond(parser, node);
switch (nd_type(node)) {
case NODE_DSTR:
case NODE_EVSTR:
case NODE_STR:
- if (!method_op) rb_warn0("string literal in condition");
+ rb_warn0("string literal in condition");
break;
case NODE_DREGX:
- {
- NODE *match;
- if (!method_op)
- warning_unless_e_option(parser, node, "regex literal in condition");
-
- match = NEW_MATCH2(node, new_gvar(idLASTLINE, location));
- nd_set_loc(match, location);
- return match;
- }
+ case NODE_DREGX_ONCE:
+ warning_unless_e_option(parser, node, "regex literal in condition");
+ return NEW_MATCH2(node, NEW_GVAR(rb_intern("$_")));
case NODE_AND:
case NODE_OR:
- node->nd_1st = cond0(parser, node->nd_1st, FALSE, location);
- node->nd_2nd = cond0(parser, node->nd_2nd, FALSE, location);
+ node->nd_1st = cond0(parser, node->nd_1st);
+ node->nd_2nd = cond0(parser, node->nd_2nd);
break;
case NODE_DOT2:
case NODE_DOT3:
- node->nd_beg = range_op(parser, node->nd_beg, location);
- node->nd_end = range_op(parser, node->nd_end, location);
+ node->nd_beg = range_op(parser, node->nd_beg);
+ node->nd_end = range_op(parser, node->nd_end);
if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
- if (!method_op && !e_option_supplied(parser)) {
+ if (!e_option_supplied(parser)) {
int b = literal_node(node->nd_beg);
int e = literal_node(node->nd_end);
if ((b == 1 && e == 1) || (b + e >= 2 && RTEST(ruby_verbose))) {
@@ -10657,18 +9373,16 @@ cond0(struct parser_params *parser, NODE *node, int method_op, const YYLTYPE *lo
break;
case NODE_DSYM:
- if (!method_op) parser_warning(node, "literal in condition");
+ parser_warning(node, "literal in condition");
break;
case NODE_LIT:
if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
- if (!method_op)
- warn_unless_e_option(parser, node, "regex literal in condition");
+ warn_unless_e_option(parser, node, "regex literal in condition");
nd_set_type(node, NODE_MATCH);
}
else {
- if (!method_op)
- parser_warning(node, "literal in condition");
+ parser_warning(node, "literal in condition");
}
default:
break;
@@ -10677,49 +9391,15 @@ cond0(struct parser_params *parser, NODE *node, int method_op, const YYLTYPE *lo
}
static NODE*
-cond_gen(struct parser_params *parser, NODE *node, int method_op, const YYLTYPE *location)
+cond_gen(struct parser_params *parser, NODE *node)
{
if (node == 0) return 0;
- return cond0(parser, node, method_op, location);
-}
-
-static NODE*
-new_nil_gen(struct parser_params *parser, const YYLTYPE *location)
-{
- NODE *node_nil = NEW_NIL();
- nd_set_loc(node_nil, location);
- return node_nil;
-}
-
-static NODE*
-new_if_gen(struct parser_params *parser, NODE *cc, NODE *left, NODE *right, const YYLTYPE *location)
-{
- NODE *node_if;
-
- if (!cc) return right;
- cc = cond0(parser, cc, FALSE, location);
- node_if = NEW_IF(cc, left, right);
- nd_set_loc(node_if, location);
- return newline_node(node_if);
-}
-
-static NODE*
-new_unless_gen(struct parser_params *parser, NODE *cc, NODE *left, NODE *right, const YYLTYPE *location)
-{
- NODE *node_unless;
-
- if (!cc) return right;
- cc = cond0(parser, cc, FALSE, location);
- node_unless = NEW_UNLESS(cc, left, right);
- nd_set_loc(node_unless, location);
- return newline_node(node_unless);
+ return cond0(parser, node);
}
static NODE*
-logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *right,
- const YYLTYPE *op_loc, const YYLTYPE *location)
+logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *right)
{
- NODE *op;
value_expr(left);
if (left && (enum node_type)nd_type(left) == type) {
NODE *node = left, *second;
@@ -10727,15 +9407,9 @@ logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *r
node = second;
}
node->nd_2nd = NEW_NODE(type, second, right, 0);
- node->nd_2nd->nd_loc = *location;
- nd_set_line(node->nd_2nd, op_loc->first_loc.lineno);
- left->nd_loc.last_loc = location->last_loc;
return left;
}
- op = NEW_NODE(type, left, right, 0);
- op->nd_loc = *location;
- nd_set_line(op, op_loc->first_loc.lineno);
- return op;
+ return NEW_NODE(type, left, right, 0);
}
static void
@@ -10764,18 +9438,15 @@ ret_args_gen(struct parser_params *parser, NODE *node)
}
static NODE *
-new_yield_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
+new_yield_gen(struct parser_params *parser, NODE *node)
{
- NODE *yield;
if (node) no_blockarg(parser, node);
- yield = NEW_YIELD(node);
- nd_set_loc(yield, location);
- return yield;
+ return NEW_YIELD(node);
}
static VALUE
-negate_lit_gen(struct parser_params *parser, VALUE lit)
+negate_lit(VALUE lit)
{
int type = TYPE(lit);
switch (type) {
@@ -10783,15 +9454,9 @@ negate_lit_gen(struct parser_params *parser, VALUE lit)
lit = LONG2FIX(-FIX2LONG(lit));
break;
case T_BIGNUM:
- BIGNUM_NEGATE(lit);
- lit = rb_big_norm(lit);
- break;
case T_RATIONAL:
- RRATIONAL_SET_NUM(lit, negate_lit(RRATIONAL(lit)->num));
- break;
case T_COMPLEX:
- RCOMPLEX_SET_REAL(lit, negate_lit(RCOMPLEX(lit)->real));
- RCOMPLEX_SET_IMAG(lit, negate_lit(RCOMPLEX(lit)->imag));
+ lit = rb_funcall(lit,tUMINUS,0,0);
break;
case T_FLOAT:
#if USE_FLONUM
@@ -10803,7 +9468,7 @@ negate_lit_gen(struct parser_params *parser, VALUE lit)
RFLOAT(lit)->float_value = -RFLOAT_VALUE(lit);
break;
default:
- rb_parser_fatal(parser, "unknown literal type (%d) passed to negate_lit", type);
+ rb_bug("unknown literal type (%d) passed to negate_lit", type);
break;
}
return lit;
@@ -10813,10 +9478,7 @@ static NODE *
arg_blk_pass(NODE *node1, NODE *node2)
{
if (node2) {
- if (!node1) return node2;
node2->nd_head = node1;
- nd_set_first_lineno(node2, nd_first_lineno(node1));
- nd_set_first_column(node2, nd_first_column(node1));
return node2;
}
return node1;
@@ -10824,7 +9486,7 @@ arg_blk_pass(NODE *node1, NODE *node2)
static NODE*
-new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, NODE *tail, const YYLTYPE *location)
+new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, NODE *tail)
{
int saved_line = ruby_sourceline;
struct rb_args_info *args = tail->nd_ainfo;
@@ -10841,181 +9503,76 @@ new_args_gen(struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, NODE
args->opt_args = o;
ruby_sourceline = saved_line;
- nd_set_loc(tail, location);
return tail;
}
static NODE*
-new_args_tail_gen(struct parser_params *parser, NODE *k, ID kr, ID b, const YYLTYPE *kr_location)
+new_args_tail_gen(struct parser_params *parser, NODE *k, ID kr, ID b)
{
int saved_line = ruby_sourceline;
struct rb_args_info *args;
+ NODE *kw_rest_arg = 0;
NODE *node;
+ int check = 0;
args = ZALLOC(struct rb_args_info);
- add_mark_object((VALUE)rb_imemo_alloc_new((VALUE)args, 0, 0, 0));
node = NEW_NODE(NODE_ARGS, 0, 0, args);
- if (parser->error_p) return node;
args->block_arg = b;
args->kw_args = k;
-
- if (k) {
- /*
- * def foo(k1: 1, kr1:, k2: 2, **krest, &b)
- * variable order: k1, kr1, k2, &b, internal_id, krest
- * #=> <reorder>
- * variable order: kr1, k1, k2, internal_id, krest, &b
- */
- ID kw_bits;
- NODE *kwn = k;
- struct vtable *required_kw_vars = vtable_alloc(NULL);
- struct vtable *kw_vars = vtable_alloc(NULL);
- int i;
-
- while (kwn) {
- NODE *val_node = kwn->nd_body->nd_value;
- ID vid = kwn->nd_body->nd_vid;
-
- if (val_node == NODE_SPECIAL_REQUIRED_KEYWORD) {
- vtable_add(required_kw_vars, vid);
- }
- else {
- vtable_add(kw_vars, vid);
- }
-
- kwn = kwn->nd_next;
- }
-
- kw_bits = internal_id();
- if (kr && is_junk_id(kr)) vtable_pop(lvtbl->args, 1);
- vtable_pop(lvtbl->args, vtable_size(required_kw_vars) + vtable_size(kw_vars) + (b != 0));
-
- for (i=0; i<vtable_size(required_kw_vars); i++) arg_var(required_kw_vars->tbl[i]);
- for (i=0; i<vtable_size(kw_vars); i++) arg_var(kw_vars->tbl[i]);
- vtable_free(required_kw_vars);
- vtable_free(kw_vars);
-
- arg_var(kw_bits);
- if (kr) arg_var(kr);
- if (b) arg_var(b);
-
- args->kw_rest_arg = new_dvar(kr, kr_location);
- args->kw_rest_arg->nd_cflag = kw_bits;
+ if (k && !kr) {
+ check = 1;
+ kr = internal_id();
}
- else if (kr) {
- if (b) vtable_pop(lvtbl->args, 1); /* reorder */
+ if (kr) {
arg_var(kr);
- if (b) arg_var(b);
- args->kw_rest_arg = new_dvar(kr, kr_location);
+ kw_rest_arg = NEW_DVAR(kr);
+ kw_rest_arg->nd_cflag = check;
}
+ args->kw_rest_arg = kw_rest_arg;
ruby_sourceline = saved_line;
return node;
}
static NODE*
-dsym_node_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
+dsym_node_gen(struct parser_params *parser, NODE *node)
{
VALUE lit;
if (!node) {
- return new_lit(ID2SYM(idNULL), location);
+ return NEW_LIT(ID2SYM(idNULL));
}
switch (nd_type(node)) {
case NODE_DSTR:
nd_set_type(node, NODE_DSYM);
- nd_set_loc(node, location);
break;
case NODE_STR:
lit = node->nd_lit;
- add_mark_object(node->nd_lit = ID2SYM(rb_intern_str(lit)));
+ node->nd_lit = ID2SYM(rb_intern_str(lit));
nd_set_type(node, NODE_LIT);
- nd_set_loc(node, location);
break;
default:
- node = NEW_NODE(NODE_DSYM, Qnil, 1, new_list(node, location));
- nd_set_loc(node, location);
+ node = NEW_NODE(NODE_DSYM, Qnil, 1, NEW_LIST(node));
break;
}
return node;
}
-
-static int
-append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
-{
- NODE *node = (NODE *)v;
- NODE **result = (NODE **)h;
- node->nd_alen = 2;
- node->nd_next->nd_end = node->nd_next;
- node->nd_next->nd_next = 0;
- if (*result)
- list_concat(*result, node);
- else
- *result = node;
- return ST_CONTINUE;
-}
-
-static NODE *
-remove_duplicate_keys(struct parser_params *parser, NODE *hash, const YYLTYPE *location)
-{
- st_table *literal_keys = st_init_numtable_with_size(hash->nd_alen / 2);
- NODE *result = 0;
- while (hash && hash->nd_head && hash->nd_next) {
- NODE *head = hash->nd_head;
- NODE *value = hash->nd_next;
- NODE *next = value->nd_next;
- VALUE key = (VALUE)head;
- st_data_t data;
- if (nd_type(head) == NODE_LIT &&
- st_lookup(literal_keys, (key = head->nd_lit), &data)) {
- rb_compile_warn(ruby_sourcefile, nd_line((NODE *)data),
- "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
- head->nd_lit, nd_line(head));
- head = ((NODE *)data)->nd_next;
- head->nd_head = block_append(head->nd_head, value->nd_head, location);
- }
- else {
- st_insert(literal_keys, (st_data_t)key, (st_data_t)hash);
- }
- hash = next;
- }
- st_foreach(literal_keys, append_literal_keys, (st_data_t)&result);
- st_free_table(literal_keys);
- if (hash) {
- if (!result) result = hash;
- else list_concat(result, hash);
- }
- return result;
-}
-
-static NODE *
-new_hash_gen(struct parser_params *parser, NODE *hash, const YYLTYPE *location)
-{
- NODE *nd_hash;
- if (hash) hash = remove_duplicate_keys(parser, hash, location);
- nd_hash = NEW_HASH(hash);
- nd_set_loc(nd_hash, location);
- return nd_hash;
-}
#endif /* !RIPPER */
#ifndef RIPPER
static NODE *
-new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location)
+new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs)
{
NODE *asgn;
if (lhs) {
ID vid = lhs->nd_vid;
- YYLTYPE lhs_location = lhs->nd_loc;
if (op == tOROP) {
lhs->nd_value = rhs;
- nd_set_loc(lhs, location);
- asgn = NEW_OP_ASGN_OR(gettable(vid, &lhs_location), lhs);
- nd_set_loc(asgn, location);
+ asgn = NEW_OP_ASGN_OR(gettable(vid), lhs);
if (is_notop_id(vid)) {
switch (id_type(vid)) {
case ID_GLOBAL:
@@ -11027,25 +9584,21 @@ new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, con
}
else if (op == tANDOP) {
lhs->nd_value = rhs;
- nd_set_loc(lhs, location);
- asgn = NEW_OP_ASGN_AND(gettable(vid, &lhs_location), lhs);
- nd_set_loc(asgn, location);
+ asgn = NEW_OP_ASGN_AND(gettable(vid), lhs);
}
else {
asgn = lhs;
- asgn->nd_value = new_call(gettable(vid, &lhs_location), op, new_list(rhs, &rhs->nd_loc), location);
- nd_set_loc(asgn, location);
+ asgn->nd_value = NEW_CALL(gettable(vid), op, NEW_LIST(rhs));
}
}
else {
- asgn = new_begin(0, location);
+ asgn = NEW_BEGIN(0);
}
return asgn;
}
static NODE *
-new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs,
- ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *location)
+new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID attr, ID op, NODE *rhs)
{
NODE *asgn;
@@ -11055,14 +9608,13 @@ new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs,
else if (op == tANDOP) {
op = 1;
}
- asgn = NEW_OP_ASGN2(lhs, CALL_Q_P(atype), attr, op, rhs);
- nd_set_loc(asgn, location);
+ asgn = NEW_OP_ASGN2(lhs, attr, op, rhs);
fixpos(asgn, lhs);
return asgn;
}
static NODE *
-new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location)
+new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs)
{
NODE *asgn;
@@ -11076,29 +9628,11 @@ new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rh
asgn = NEW_OP_CDECL(lhs, op, rhs);
}
else {
- asgn = new_begin(0, location);
+ asgn = NEW_BEGIN(0);
}
fixpos(asgn, lhs);
- nd_set_loc(asgn, location);
return asgn;
}
-
-static NODE *
-const_path_field_gen(struct parser_params *parser, NODE *head, ID mid, const YYLTYPE *location)
-{
- NODE *colon2 = NEW_COLON2(head, mid);
- nd_set_loc(colon2, location);
- return colon2;
-}
-
-static NODE *
-const_decl_gen(struct parser_params *parser, NODE *path, const YYLTYPE *location)
-{
- if (in_def) {
- yyerror0("dynamic constant assignment");
- }
- return new_cdecl(0, 0, (path), location);
-}
#else
static VALUE
new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs)
@@ -11112,37 +9646,6 @@ new_attr_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE type, VALU
VALUE recv = dispatch3(field, lhs, type, attr);
return dispatch3(opassign, recv, op, rhs);
}
-
-static VALUE
-new_qcall_gen(struct parser_params *parser, VALUE r, VALUE q, VALUE m, VALUE a)
-{
- VALUE ret = dispatch3(call, (r), (q), (m));
- return method_optarg(ret, (a));
-}
-
-static VALUE
-const_decl_gen(struct parser_params *parser, VALUE path)
-{
- if (in_def) {
- path = dispatch1(assign_error, path);
- ripper_error();
- }
- return path;
-}
-
-static VALUE
-assign_error_gen(struct parser_params *parser, VALUE a)
-{
- a = dispatch1(assign_error, a);
- ripper_error();
- return a;
-}
-
-static VALUE
-var_field_gen(struct parser_params *parser, VALUE a)
-{
- return ripper_new_yylval(get_id(a), dispatch1(var_field, a), 0);
-}
#endif
static void
@@ -11156,12 +9659,12 @@ warn_unused_var(struct parser_params *parser, struct local_vars *local)
u = local->used->tbl;
cnt = local->used->pos;
if (cnt != local->vars->pos) {
- rb_parser_fatal(parser, "local->used->pos != local->vars->pos");
+ rb_bug("local->used->pos != local->vars->pos");
}
for (i = 0; i < cnt; ++i) {
if (!v[i] || (u[i] & LVAR_USED)) continue;
if (is_private_local_id(v[i])) continue;
- rb_warn1L((int)u[i], "assigned but unused variable - %"PRIsWARN, rb_id2str(v[i]));
+ rb_warn4V(ruby_sourcefile, (int)u[i], "assigned but unused variable - %"PRIsVALUE, rb_id2str(v[i]));
}
}
@@ -11177,11 +9680,8 @@ local_push_gen(struct parser_params *parser, int inherit_dvars)
local->used = !(inherit_dvars &&
(ifndef_ripper(compile_for_eval || e_option_supplied(parser))+0)) &&
RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
-# if WARN_PAST_SCOPE
- local->past = 0;
-# endif
local->cmdargs = cmdarg_stack;
- CMDARG_SET(0);
+ cmdarg_stack = 0;
lvtbl = local;
}
@@ -11193,16 +9693,9 @@ local_pop_gen(struct parser_params *parser)
warn_unused_var(parser, lvtbl);
vtable_free(lvtbl->used);
}
-# if WARN_PAST_SCOPE
- while (lvtbl->past) {
- struct vtable *past = lvtbl->past;
- lvtbl->past = past->prev;
- vtable_free(past);
- }
-# endif
vtable_free(lvtbl->args);
vtable_free(lvtbl->vars);
- CMDARG_SET(lvtbl->cmdargs);
+ cmdarg_stack = lvtbl->cmdargs;
xfree(lvtbl);
lvtbl = local;
}
@@ -11229,9 +9722,6 @@ local_tbl_gen(struct parser_params *parser)
}
if (--j < cnt) REALLOC_N(buf, ID, (cnt = j) + 1);
buf[0] = cnt;
-
- add_mark_object((VALUE)rb_imemo_alloc_new((VALUE)buf, 0, 0, 0));
-
return buf;
}
#endif
@@ -11252,7 +9742,7 @@ local_var_gen(struct parser_params *parser, ID id)
}
static int
-local_id_gen(struct parser_params *parser, ID id, ID **vidrefp)
+local_id_gen(struct parser_params *parser, ID id)
{
struct vtable *vars, *args, *used;
@@ -11267,14 +9757,14 @@ local_id_gen(struct parser_params *parser, ID id, ID **vidrefp)
}
if (vars && vars->prev == DVARS_INHERIT) {
- return rb_local_defined(id, parser->base_block);
+ return rb_local_defined(id);
}
else if (vtable_included(args, id)) {
return 1;
}
else {
int i = vtable_included(vars, id);
- if (i && used && vidrefp) *vidrefp = &used->tbl[i-1];
+ if (i && used) used->tbl[i-1] |= LVAR_USED;
return i != 0;
}
}
@@ -11291,21 +9781,6 @@ dyna_push_gen(struct parser_params *parser)
}
static void
-dyna_pop_vtable(struct parser_params *parser, struct vtable **vtblp)
-{
- struct vtable *tmp = *vtblp;
- *vtblp = tmp->prev;
-# if WARN_PAST_SCOPE
- if (parser->past_scope_enabled) {
- tmp->prev = lvtbl->past;
- lvtbl->past = tmp;
- return;
- }
-# endif
- vtable_free(tmp);
-}
-
-static void
dyna_pop_1(struct parser_params *parser)
{
struct vtable *tmp;
@@ -11315,8 +9790,12 @@ dyna_pop_1(struct parser_params *parser)
lvtbl->used = lvtbl->used->prev;
vtable_free(tmp);
}
- dyna_pop_vtable(parser, &lvtbl->args);
- dyna_pop_vtable(parser, &lvtbl->vars);
+ tmp = lvtbl->args;
+ lvtbl->args = lvtbl->args->prev;
+ vtable_free(tmp);
+ tmp = lvtbl->vars;
+ lvtbl->vars = lvtbl->vars->prev;
+ vtable_free(tmp);
}
static void
@@ -11340,7 +9819,7 @@ dyna_in_block_gen(struct parser_params *parser)
}
static int
-dvar_defined_gen(struct parser_params *parser, ID id, ID **vidrefp)
+dvar_defined_gen(struct parser_params *parser, ID id, int get)
{
struct vtable *vars, *args, *used;
int i;
@@ -11354,17 +9833,17 @@ dvar_defined_gen(struct parser_params *parser, ID id, ID **vidrefp)
return 1;
}
if ((i = vtable_included(vars, id)) != 0) {
- if (used && vidrefp) *vidrefp = &used->tbl[i-1];
+ if (used) used->tbl[i-1] |= LVAR_USED;
return 1;
}
args = args->prev;
vars = vars->prev;
- if (!vidrefp) used = 0;
+ if (get) used = 0;
if (used) used = used->prev;
}
if (vars == DVARS_INHERIT) {
- return rb_dvar_defined(id, parser->base_block);
+ return rb_dvar_defined(id);
}
return 0;
@@ -11377,17 +9856,9 @@ dvar_curr_gen(struct parser_params *parser, ID id)
vtable_included(lvtbl->vars, id));
}
-static void
-reg_fragment_enc_error(struct parser_params* parser, VALUE str, int c)
-{
- compile_error(PARSER_ARG
- "regexp encoding option '%c' differs from source encoding '%s'",
- c, rb_enc_name(rb_enc_get(str)));
-}
-
#ifndef RIPPER
-int
-rb_reg_fragment_setenc(struct parser_params* parser, VALUE str, int options)
+static void
+reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
{
int c = RE_OPTION_ENCODING_IDX(options);
@@ -11417,17 +9888,12 @@ rb_reg_fragment_setenc(struct parser_params* parser, VALUE str, int options)
rb_enc_associate(str, rb_ascii8bit_encoding());
}
}
- return 0;
+ return;
error:
- return c;
-}
-
-static void
-reg_fragment_setenc_gen(struct parser_params* parser, VALUE str, int options)
-{
- int c = rb_reg_fragment_setenc(parser, str, options);
- if (c) reg_fragment_enc_error(parser, str, c);
+ compile_error(PARSER_ARG
+ "regexp encoding option '%c' differs from source encoding '%s'",
+ c, rb_enc_name(rb_enc_get(str)));
}
static int
@@ -11448,7 +9914,8 @@ typedef struct {
struct parser_params* parser;
rb_encoding *enc;
NODE *succ_block;
- const YYLTYPE *location;
+ NODE *fail_block;
+ int num;
} reg_named_capture_assign_t;
static int
@@ -11461,7 +9928,13 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
long len = name_end - name;
const char *s = (const char *)name;
ID var;
- NODE *node, *succ;
+
+ arg->num++;
+
+ if (arg->succ_block == 0) {
+ arg->succ_block = NEW_BEGIN(0);
+ arg->fail_block = NEW_BEGIN(0);
+ }
if (!len || (*name != '_' && ISASCII(*name) && !rb_enc_islower(*name, enc)) ||
(len < MAX_WORD_LENGTH && rb_reserved_word(s, (int)len)) ||
@@ -11469,40 +9942,52 @@ reg_named_capture_assign_iter(const OnigUChar *name, const OnigUChar *name_end,
return ST_CONTINUE;
}
var = intern_cstr(s, len, enc);
- node = node_assign(assignable(var, 0, arg->location), new_lit(ID2SYM(var), arg->location), arg->location);
- succ = arg->succ_block;
- if (!succ) succ = new_begin(0, arg->location);
- succ = block_append(succ, node, arg->location);
- arg->succ_block = succ;
+ if (dvar_defined(var) || local_id(var)) {
+ rb_warningV("named capture conflicts a local variable - %"PRIsVALUE,
+ rb_id2str(var));
+ }
+ arg->succ_block = block_append(arg->succ_block,
+ newline_node(node_assign(assignable(var,0),
+ NEW_CALL(
+ gettable(rb_intern("$~")),
+ idAREF,
+ NEW_LIST(NEW_LIT(ID2SYM(var))))
+ )));
+ arg->fail_block = block_append(arg->fail_block,
+ newline_node(node_assign(assignable(var,0), NEW_LIT(Qnil))));
return ST_CONTINUE;
}
static NODE *
-reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, const YYLTYPE *location)
+reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *match)
{
reg_named_capture_assign_t arg;
arg.parser = parser;
arg.enc = rb_enc_get(regexp);
arg.succ_block = 0;
- arg.location = location;
- onig_foreach_name(RREGEXP_PTR(regexp), reg_named_capture_assign_iter, &arg);
-
- if (!arg.succ_block) return 0;
- return arg.succ_block->nd_next;
-}
-
-static VALUE
-parser_reg_compile(struct parser_params* parser, VALUE str, int options)
-{
- reg_fragment_setenc(str, options);
- return rb_parser_reg_compile(parser, str, options);
-}
-
-VALUE
-rb_parser_reg_compile(struct parser_params* parser, VALUE str, int options)
-{
- return rb_reg_compile(str, options & RE_OPTION_MASK, ruby_sourcefile, ruby_sourceline);
+ arg.fail_block = 0;
+ arg.num = 0;
+ onig_foreach_name(RREGEXP(regexp)->ptr, reg_named_capture_assign_iter, &arg);
+
+ if (arg.num == 0)
+ return match;
+
+ return
+ block_append(
+ newline_node(match),
+ NEW_IF(gettable(rb_intern("$~")),
+ block_append(
+ newline_node(arg.succ_block),
+ newline_node(
+ NEW_CALL(
+ gettable(rb_intern("$~")),
+ rb_intern("begin"),
+ NEW_LIST(NEW_LIT(INT2FIX(0)))))),
+ block_append(
+ newline_node(arg.fail_block),
+ newline_node(
+ NEW_LIT(Qnil)))));
}
static VALUE
@@ -11511,73 +9996,95 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options)
VALUE re;
VALUE err;
+ reg_fragment_setenc(str, options);
err = rb_errinfo();
- re = parser_reg_compile(parser, str, options);
+ re = rb_reg_compile(str, options & RE_OPTION_MASK, ruby_sourcefile, ruby_sourceline);
if (NIL_P(re)) {
- VALUE m = rb_attr_get(rb_errinfo(), idMesg);
+ ID mesg = rb_intern("mesg");
+ VALUE m = rb_attr_get(rb_errinfo(), mesg);
rb_set_errinfo(err);
- compile_error(PARSER_ARG "%"PRIsVALUE, m);
+ if (!NIL_P(err)) {
+ rb_str_append(rb_str_cat(rb_attr_get(err, mesg), "\n", 1), m);
+ }
+ else {
+ compile_error(PARSER_ARG "%"PRIsVALUE, m);
+ }
return Qnil;
}
return re;
}
-#else
-static VALUE
-parser_reg_compile(struct parser_params* parser, VALUE str, int options, VALUE *errmsg)
+
+NODE*
+rb_parser_append_print(VALUE vparser, NODE *node)
{
- VALUE err = rb_errinfo();
- VALUE re;
- int c = rb_reg_fragment_setenc(parser, str, options);
- if (c) reg_fragment_enc_error(parser, str, c);
- re = rb_parser_reg_compile(parser, str, options);
- if (NIL_P(re)) {
- *errmsg = rb_attr_get(rb_errinfo(), idMesg);
- rb_set_errinfo(err);
+ NODE *prelude = 0;
+ NODE *scope = node;
+ struct parser_params *parser;
+
+ if (!node) return node;
+
+ TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
+
+ node = node->nd_body;
+
+ if (nd_type(node) == NODE_PRELUDE) {
+ prelude = node;
+ node = node->nd_body;
}
- return re;
+
+ node = block_append(node,
+ NEW_FCALL(rb_intern("print"),
+ NEW_ARRAY(NEW_GVAR(rb_intern("$_")))));
+ if (prelude) {
+ prelude->nd_body = node;
+ scope->nd_body = prelude;
+ }
+ else {
+ scope->nd_body = node;
+ }
+
+ return scope;
}
-#endif
-#ifndef RIPPER
-void
-rb_parser_set_options(VALUE vparser, int print, int loop, int chomp, int split)
+NODE *
+rb_parser_while_loop(VALUE vparser, NODE *node, int chop, int split)
{
+ NODE *prelude = 0;
+ NODE *scope = node;
struct parser_params *parser;
+
+ if (!node) return node;
+
TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- parser->do_print = print;
- parser->do_loop = loop;
- parser->do_chomp = chomp;
- parser->do_split = split;
-}
-static NODE *
-parser_append_options(struct parser_params *parser, NODE *node)
-{
- static const YYLTYPE default_location = {{1, 0}, {1, 0}};
+ node = node->nd_body;
- if (parser->do_print) {
- node = block_append(node,
- new_fcall(rb_intern("print"),
- NEW_ARRAY(new_gvar(idLASTLINE, &default_location)), &default_location),
- &default_location);
+ if (nd_type(node) == NODE_PRELUDE) {
+ prelude = node;
+ node = node->nd_body;
+ }
+ if (split) {
+ node = block_append(NEW_GASGN(rb_intern("$F"),
+ NEW_CALL(NEW_GVAR(rb_intern("$_")),
+ rb_intern("split"), 0)),
+ node);
+ }
+ if (chop) {
+ node = block_append(NEW_CALL(NEW_GVAR(rb_intern("$_")),
+ rb_intern("chop!"), 0), node);
}
- if (parser->do_loop) {
- if (parser->do_split) {
- node = block_append(NEW_GASGN(rb_intern("$F"),
- new_call(new_gvar(idLASTLINE, &default_location),
- rb_intern("split"), 0, &default_location)),
- node, &default_location);
- }
- if (parser->do_chomp) {
- node = block_append(new_call(new_gvar(idLASTLINE, &default_location),
- rb_intern("chomp!"), 0, &default_location), node, &default_location);
- }
+ node = NEW_OPT_N(node);
- node = NEW_WHILE(NEW_VCALL(idGets), node, 1);
+ if (prelude) {
+ prelude->nd_body = node;
+ scope->nd_body = prelude;
+ }
+ else {
+ scope->nd_body = node;
}
- return node;
+ return scope;
}
void
@@ -11586,33 +10093,66 @@ rb_init_parse(void)
/* just to suppress unused-function warnings */
(void)nodetype;
(void)nodeline;
+#if PARSER_DEBUG
+ (void)lex_state_name(-1);
+#endif
}
#endif /* !RIPPER */
static ID
internal_id_gen(struct parser_params *parser)
{
- const ID max_id = RB_ID_SERIAL_MAX & ~0xffff;
ID id = (ID)vtable_size(lvtbl->args) + (ID)vtable_size(lvtbl->vars);
- id = max_id - id;
+ id += ((tLAST_TOKEN - ID_INTERNAL) >> ID_SCOPE_SHIFT) + 1;
return ID_STATIC_SYM | ID_INTERNAL | (id << ID_SCOPE_SHIFT);
}
static void
parser_initialize(struct parser_params *parser)
{
- /* note: we rely on TypedData_Make_Struct to set most fields to 0 */
- command_start = TRUE;
- ruby_sourcefile_string = Qnil;
-#ifdef RIPPER
+ parser->eofp = Qfalse;
+
+ parser->parser_lex_strterm = 0;
+ parser->parser_cond_stack = 0;
+ parser->parser_cmdarg_stack = 0;
+ parser->parser_class_nest = 0;
+ parser->parser_paren_nest = 0;
+ parser->parser_lpar_beg = 0;
+ parser->parser_brace_nest = 0;
+ parser->parser_in_single = 0;
+ parser->parser_in_def = 0;
+ parser->parser_in_defined = 0;
+ parser->parser_in_kwarg = 0;
+ parser->parser_compile_for_eval = 0;
+ parser->parser_cur_mid = 0;
+ parser->parser_tokenbuf = NULL;
+ parser->parser_tokidx = 0;
+ parser->parser_toksiz = 0;
+ parser->parser_heredoc_end = 0;
+ parser->parser_command_start = TRUE;
+ parser->parser_deferred_nodes = 0;
+ parser->parser_lex_pbeg = 0;
+ parser->parser_lex_p = 0;
+ parser->parser_lex_pend = 0;
+ parser->parser_lvtbl = 0;
+ parser->parser_ruby__end__seen = 0;
+ parser->parser_ruby_sourcefile = 0;
+ parser->parser_ruby_sourcefile_string = Qnil;
+#ifndef RIPPER
+ parser->is_ripper = 0;
+ parser->parser_eval_tree_begin = 0;
+ parser->parser_eval_tree = 0;
+#else
+ parser->is_ripper = 1;
parser->delayed = Qnil;
+
parser->result = Qnil;
parser->parsing_thread = Qnil;
-#else
- parser->error_buffer = Qfalse;
+ parser->toplevel_p = TRUE;
+#endif
+#ifdef YYMALLOC
+ parser->heap = NULL;
#endif
- parser->debug_buffer = Qnil;
- parser->debug_output = rb_stdout;
parser->enc = rb_utf8_encoding();
}
@@ -11624,83 +10164,74 @@ parser_initialize(struct parser_params *parser)
static void
parser_mark(void *ptr)
{
- struct parser_params *parser = (struct parser_params*)ptr;
+ struct parser_params *p = (struct parser_params*)ptr;
- rb_gc_mark(lex_input);
- rb_gc_mark(lex_prevline);
- rb_gc_mark(lex_lastline);
- rb_gc_mark(lex_nextline);
- rb_gc_mark(ruby_sourcefile_string);
- rb_gc_mark((VALUE)lex_strterm);
- rb_gc_mark((VALUE)parser->ast);
+ rb_gc_mark((VALUE)p->parser_lex_strterm);
+ rb_gc_mark((VALUE)p->parser_deferred_nodes);
+ rb_gc_mark(p->parser_lex_input);
+ rb_gc_mark(p->parser_lex_lastline);
+ rb_gc_mark(p->parser_lex_nextline);
+ rb_gc_mark(p->parser_ruby_sourcefile_string);
#ifndef RIPPER
- rb_gc_mark(ruby_debug_lines);
- rb_gc_mark(parser->compile_option);
- rb_gc_mark(parser->error_buffer);
+ rb_gc_mark((VALUE)p->parser_eval_tree_begin) ;
+ rb_gc_mark((VALUE)p->parser_eval_tree) ;
+ rb_gc_mark(p->debug_lines);
#else
- rb_gc_mark(parser->delayed);
- rb_gc_mark(parser->value);
- rb_gc_mark(parser->result);
- rb_gc_mark(parser->parsing_thread);
+ rb_gc_mark(p->delayed);
+ rb_gc_mark(p->value);
+ rb_gc_mark(p->result);
+ rb_gc_mark(p->parsing_thread);
#endif
- rb_gc_mark(parser->debug_buffer);
- rb_gc_mark(parser->debug_output);
#ifdef YYMALLOC
- rb_gc_mark((VALUE)parser->heap);
+ rb_gc_mark((VALUE)p->heap);
#endif
}
static void
parser_free(void *ptr)
{
- struct parser_params *parser = (struct parser_params*)ptr;
+ struct parser_params *p = (struct parser_params*)ptr;
struct local_vars *local, *prev;
- if (tokenbuf) {
- xfree(tokenbuf);
+ if (p->parser_tokenbuf) {
+ xfree(p->parser_tokenbuf);
}
- for (local = lvtbl; local; local = prev) {
+ for (local = p->parser_lvtbl; local; local = prev) {
if (local->vars) xfree(local->vars);
prev = local->prev;
xfree(local);
}
- {
- token_info *ptinfo;
- while ((ptinfo = parser->token_info) != 0) {
- parser->token_info = ptinfo->next;
- xfree(ptinfo);
- }
- }
- xfree(ptr);
+ xfree(p);
}
static size_t
parser_memsize(const void *ptr)
{
- struct parser_params *parser = (struct parser_params*)ptr;
+ struct parser_params *p = (struct parser_params*)ptr;
struct local_vars *local;
- size_t size = sizeof(*parser);
+ size_t size = sizeof(*p);
- size += toksiz;
- for (local = lvtbl; local; local = local->prev) {
+ if (!ptr) return 0;
+ size += p->parser_toksiz;
+ for (local = p->parser_lvtbl; local; local = local->prev) {
size += sizeof(*local);
if (local->vars) size += local->vars->capa * sizeof(ID);
}
return size;
}
-static const rb_data_type_t parser_data_type = {
+static
#ifndef RIPPER
- "parser",
-#else
- "ripper",
+const
#endif
+rb_data_type_t parser_data_type = {
+ "parser",
{
parser_mark,
parser_free,
parser_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
#ifndef RIPPER
@@ -11712,58 +10243,27 @@ rb_reserved_word(const char *str, unsigned int len)
return reserved_word(str, len);
}
-VALUE
-rb_parser_new(void)
+static struct parser_params *
+parser_new(void)
{
struct parser_params *p;
- VALUE parser = TypedData_Make_Struct(0, struct parser_params,
- &parser_data_type, p);
+
+ p = ZALLOC(struct parser_params);
parser_initialize(p);
- return parser;
+ return p;
}
VALUE
-rb_parser_set_context(VALUE vparser, const struct rb_block *base, int main)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- parser->error_buffer = main ? Qfalse : Qnil;
- parser->base_block = base;
- in_main = main;
- return vparser;
-}
-#endif
-
-#ifdef RIPPER
-#define rb_parser_end_seen_p ripper_parser_end_seen_p
-#define rb_parser_encoding ripper_parser_encoding
-#define rb_parser_get_yydebug ripper_parser_get_yydebug
-#define rb_parser_set_yydebug ripper_parser_set_yydebug
-static VALUE ripper_parser_end_seen_p(VALUE vparser);
-static VALUE ripper_parser_encoding(VALUE vparser);
-static VALUE ripper_parser_get_yydebug(VALUE self);
-static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag);
-
-/*
- * call-seq:
- * ripper.error? -> Boolean
- *
- * Return true if parsed source has errors.
- */
-static VALUE
-ripper_error_p(VALUE vparser)
+rb_parser_new(void)
{
- struct parser_params *parser;
+ struct parser_params *p = parser_new();
- TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
- return parser->error_p ? Qtrue : Qfalse;
+ return TypedData_Wrap_Struct(0, &parser_data_type, p);
}
-#endif
/*
* call-seq:
- * ripper.end_seen? -> Boolean
+ * ripper#end_seen? -> Boolean
*
* Return true if parsed source ended by +\_\_END\_\_+.
*/
@@ -11778,7 +10278,7 @@ rb_parser_end_seen_p(VALUE vparser)
/*
* call-seq:
- * ripper.encoding -> encoding
+ * ripper#encoding -> encoding
*
* Return encoding of the source.
*/
@@ -11822,18 +10322,17 @@ rb_parser_set_yydebug(VALUE self, VALUE flag)
return flag;
}
-#ifndef RIPPER
#ifdef YYMALLOC
#define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE))
-#define NEWHEAP() rb_imemo_alloc_new(0, (VALUE)parser->heap, 0, 0)
-#define ADD2HEAP(n, c, p) ((parser->heap = (n))->ptr = (p), \
- (n)->cnt = (c), (p))
+#define NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0)
+#define ADD2HEAP(n, c, p) ((parser->heap = (n))->u1.node = (p), \
+ (n)->u3.cnt = (c), (p))
void *
rb_parser_malloc(struct parser_params *parser, size_t size)
{
size_t cnt = HEAPCNT(1, size);
- rb_imemo_alloc_t *n = NEWHEAP();
+ NODE *n = NEWHEAP();
void *ptr = xmalloc(size);
return ADD2HEAP(n, cnt, ptr);
@@ -11843,7 +10342,7 @@ void *
rb_parser_calloc(struct parser_params *parser, size_t nelem, size_t size)
{
size_t cnt = HEAPCNT(nelem, size);
- rb_imemo_alloc_t *n = NEWHEAP();
+ NODE *n = NEWHEAP();
void *ptr = xcalloc(nelem, size);
return ADD2HEAP(n, cnt, ptr);
@@ -11852,17 +10351,17 @@ rb_parser_calloc(struct parser_params *parser, size_t nelem, size_t size)
void *
rb_parser_realloc(struct parser_params *parser, void *ptr, size_t size)
{
- rb_imemo_alloc_t *n;
+ NODE *n;
size_t cnt = HEAPCNT(1, size);
if (ptr && (n = parser->heap) != NULL) {
do {
- if (n->ptr == ptr) {
- n->ptr = ptr = xrealloc(ptr, size);
- if (n->cnt) n->cnt = cnt;
+ if (n->u1.node == ptr) {
+ n->u1.node = ptr = xrealloc(ptr, size);
+ if (n->u3.cnt) n->u3.cnt = cnt;
return ptr;
}
- } while ((n = n->next) != NULL);
+ } while ((n = n->u2.node) != NULL);
}
n = NEWHEAP();
ptr = xrealloc(ptr, size);
@@ -11872,52 +10371,19 @@ rb_parser_realloc(struct parser_params *parser, void *ptr, size_t size)
void
rb_parser_free(struct parser_params *parser, void *ptr)
{
- rb_imemo_alloc_t **prev = &parser->heap, *n;
+ NODE **prev = &parser->heap, *n;
while ((n = *prev) != NULL) {
- if (n->ptr == ptr) {
- *prev = n->next;
+ if (n->u1.node == ptr) {
+ *prev = n->u2.node;
rb_gc_force_recycle((VALUE)n);
break;
}
- prev = &n->next;
+ prev = &n->u2.node;
}
xfree(ptr);
}
#endif
-
-void
-rb_parser_printf(struct parser_params *parser, const char *fmt, ...)
-{
- va_list ap;
- VALUE mesg = parser->debug_buffer;
-
- if (NIL_P(mesg)) parser->debug_buffer = mesg = rb_str_new(0, 0);
- va_start(ap, fmt);
- rb_str_vcatf(mesg, fmt, ap);
- va_end(ap);
- if (RSTRING_END(mesg)[-1] == '\n') {
- rb_io_write(parser->debug_output, mesg);
- parser->debug_buffer = Qnil;
- }
-}
-
-static void
-parser_compile_error(struct parser_params *parser, const char *fmt, ...)
-{
- va_list ap;
-
- rb_io_flush(parser->debug_output);
- parser->error_p = 1;
- va_start(ap, fmt);
- parser->error_buffer =
- rb_syntax_error_append(parser->error_buffer,
- ruby_sourcefile_string,
- ruby_sourceline,
- rb_long2int(lex_p - lex_pbeg),
- current_enc, fmt, ap);
- va_end(ap);
-}
#endif
#ifdef RIPPER
@@ -11947,7 +10413,7 @@ ripper_validate_object(VALUE self, VALUE x)
case T_RATIONAL:
return x;
case T_NODE:
- if (nd_type(x) != NODE_RIPPER) {
+ if (nd_type(x) != NODE_LASGN) {
rb_raise(rb_eArgError, "NODE given: %p", x);
}
return ((NODE *)x)->nd_rval;
@@ -12025,13 +10491,111 @@ ripper_dispatch7(struct parser_params *parser, ID mid, VALUE a, VALUE b, VALUE c
return rb_funcall(parser->value, mid, 7, a, b, c, d, e, f, g);
}
+static const struct kw_assoc {
+ ID id;
+ const char *name;
+} keyword_to_name[] = {
+ {keyword_class, "class"},
+ {keyword_module, "module"},
+ {keyword_def, "def"},
+ {keyword_undef, "undef"},
+ {keyword_begin, "begin"},
+ {keyword_rescue, "rescue"},
+ {keyword_ensure, "ensure"},
+ {keyword_end, "end"},
+ {keyword_if, "if"},
+ {keyword_unless, "unless"},
+ {keyword_then, "then"},
+ {keyword_elsif, "elsif"},
+ {keyword_else, "else"},
+ {keyword_case, "case"},
+ {keyword_when, "when"},
+ {keyword_while, "while"},
+ {keyword_until, "until"},
+ {keyword_for, "for"},
+ {keyword_break, "break"},
+ {keyword_next, "next"},
+ {keyword_redo, "redo"},
+ {keyword_retry, "retry"},
+ {keyword_in, "in"},
+ {keyword_do, "do"},
+ {keyword_do_cond, "do"},
+ {keyword_do_block, "do"},
+ {keyword_return, "return"},
+ {keyword_yield, "yield"},
+ {keyword_super, "super"},
+ {keyword_self, "self"},
+ {keyword_nil, "nil"},
+ {keyword_true, "true"},
+ {keyword_false, "false"},
+ {keyword_and, "and"},
+ {keyword_or, "or"},
+ {keyword_not, "not"},
+ {modifier_if, "if"},
+ {modifier_unless, "unless"},
+ {modifier_while, "while"},
+ {modifier_until, "until"},
+ {modifier_rescue, "rescue"},
+ {keyword_alias, "alias"},
+ {keyword_defined, "defined?"},
+ {keyword_BEGIN, "BEGIN"},
+ {keyword_END, "END"},
+ {keyword__LINE__, "__LINE__"},
+ {keyword__FILE__, "__FILE__"},
+ {keyword__ENCODING__, "__ENCODING__"},
+ {0, NULL}
+};
+
+static const char*
+keyword_id_to_str(ID id)
+{
+ const struct kw_assoc *a;
+
+ for (a = keyword_to_name; a->id; a++) {
+ if (a->id == id)
+ return a->name;
+ }
+ return NULL;
+}
+
+#undef ripper_id2sym
+static VALUE
+ripper_id2sym(ID id)
+{
+ const char *name;
+ char buf[8];
+
+ if (id <= 256) {
+ buf[0] = (char)id;
+ buf[1] = '\0';
+ return ID2SYM(rb_intern2(buf, 1));
+ }
+ if ((name = keyword_id_to_str(id))) {
+ return ID2SYM(rb_intern(name));
+ }
+ switch (id) {
+ case tOROP:
+ name = "||";
+ break;
+ case tANDOP:
+ name = "&&";
+ break;
+ default:
+ if (!rb_id2str(id)) {
+ rb_bug("cannot convert ID to string: %ld", (unsigned long)id);
+ }
+ return ID2SYM(id);
+ }
+ return ID2SYM(rb_intern(name));
+}
+
static ID
ripper_get_id(VALUE v)
{
NODE *nd;
if (!RB_TYPE_P(v, T_NODE)) return 0;
nd = (NODE *)v;
- if (nd_type(nd) != NODE_RIPPER) return 0;
+ if (nd_type(nd) != NODE_LASGN) return 0;
return nd->nd_vid;
}
@@ -12042,17 +10606,11 @@ ripper_get_value(VALUE v)
if (v == Qundef) return Qnil;
if (!RB_TYPE_P(v, T_NODE)) return v;
nd = (NODE *)v;
- if (nd_type(nd) != NODE_RIPPER) return Qnil;
+ if (nd_type(nd) != NODE_LASGN) return Qnil;
return nd->nd_rval;
}
static void
-ripper_error_gen(struct parser_params *parser)
-{
- parser->error_p = TRUE;
-}
-
-static void
ripper_compile_error(struct parser_params *parser, const char *fmt, ...)
{
VALUE str;
@@ -12062,23 +10620,59 @@ ripper_compile_error(struct parser_params *parser, const char *fmt, ...)
str = rb_vsprintf(fmt, args);
va_end(args);
rb_funcall(parser->value, rb_intern("compile_error"), 1, str);
- ripper_error_gen(parser);
}
-static VALUE
-ripper_lex_get_generic(struct parser_params *parser, VALUE src)
+static void
+ripper_warn0(struct parser_params *parser, const char *fmt)
{
- VALUE line = rb_funcallv_public(src, id_gets, 0, 0);
- if (!NIL_P(line) && !RB_TYPE_P(line, T_STRING)) {
- rb_raise(rb_eTypeError,
- "gets returned %"PRIsVALUE" (expected String or nil)",
- rb_obj_class(line));
- }
- return line;
+ rb_funcall(parser->value, rb_intern("warn"), 1, STR_NEW2(fmt));
+}
+
+static void
+ripper_warnI(struct parser_params *parser, const char *fmt, int a)
+{
+ rb_funcall(parser->value, rb_intern("warn"), 2,
+ STR_NEW2(fmt), INT2NUM(a));
+}
+
+#if 0 /* not in use right now */
+static void
+ripper_warnS(struct parser_params *parser, const char *fmt, const char *str)
+{
+ rb_funcall(parser->value, rb_intern("warn"), 2,
+ STR_NEW2(fmt), STR_NEW2(str));
+}
+#endif
+
+static void
+ripper_warnV(struct parser_params *parser, const char *fmt, VALUE v)
+{
+ rb_funcall(parser->value, rb_intern("warn"), 2,
+ STR_NEW2(fmt), v);
+}
+
+static void
+ripper_warning0(struct parser_params *parser, const char *fmt)
+{
+ rb_funcall(parser->value, rb_intern("warning"), 1, STR_NEW2(fmt));
+}
+
+static void
+ripper_warningS(struct parser_params *parser, const char *fmt, const char *str)
+{
+ rb_funcall(parser->value, rb_intern("warning"), 2,
+ STR_NEW2(fmt), STR_NEW2(str));
+}
+
+static void
+ripper_warningV(struct parser_params *parser, const char *fmt, VALUE v)
+{
+ rb_funcall(parser->value, rb_intern("warning"), 2,
+ STR_NEW2(fmt), v);
}
static VALUE
-ripper_lex_io_get(struct parser_params *parser, VALUE src)
+ripper_lex_get_generic(struct parser_params *parser, VALUE src)
{
return rb_io_gets(src);
}
@@ -12087,13 +10681,15 @@ static VALUE
ripper_s_allocate(VALUE klass)
{
struct parser_params *p;
- VALUE self = TypedData_Make_Struct(klass, struct parser_params,
- &parser_data_type, p);
+ VALUE self;
+
+ p = ZALLOC(struct parser_params);
+ self = TypedData_Wrap_Struct(klass, &parser_data_type, p);
p->value = self;
return self;
}
-#define ripper_initialized_p(r) ((r)->lex.input != 0)
+#define ripper_initialized_p(r) ((r)->parser_lex_input != 0)
/*
* call-seq:
@@ -12114,30 +10710,27 @@ ripper_initialize(int argc, VALUE *argv, VALUE self)
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
if (RB_TYPE_P(src, T_FILE)) {
- lex_gets = ripper_lex_io_get;
- }
- else if (rb_respond_to(src, id_gets)) {
- lex_gets = ripper_lex_get_generic;
+ parser->parser_lex_gets = ripper_lex_get_generic;
}
else {
StringValue(src);
- lex_gets = lex_get_str;
+ parser->parser_lex_gets = lex_get_str;
}
- lex_input = src;
- parser->eofp = 0;
+ parser->parser_lex_input = src;
+ parser->eofp = Qfalse;
if (NIL_P(fname)) {
fname = STR_NEW2("(ripper)");
OBJ_FREEZE(fname);
}
else {
- StringValueCStr(fname);
+ StringValue(fname);
fname = rb_str_new_frozen(fname);
}
parser_initialize(parser);
- ruby_sourcefile_string = fname;
- ruby_sourcefile = RSTRING_PTR(fname);
- ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
+ parser->parser_ruby_sourcefile_string = fname;
+ parser->parser_ruby_sourcefile = RSTRING_PTR(fname);
+ parser->parser_ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1;
return Qnil;
}
@@ -12155,10 +10748,7 @@ ripper_parse0(VALUE parser_v)
TypedData_Get_Struct(parser_v, struct parser_params, &parser_data_type, parser);
parser_prepare(parser);
- parser->ast = rb_ast_new();
ripper_yyparse((void*)parser);
- rb_ast_dispose(parser->ast);
- parser->ast = 0;
return parser->result;
}
@@ -12174,7 +10764,7 @@ ripper_ensure(VALUE parser_v)
/*
* call-seq:
- * ripper.parse
+ * ripper#parse
*
* Start parsing and returns the value of the root action.
*/
@@ -12201,7 +10791,7 @@ ripper_parse(VALUE self)
/*
* call-seq:
- * ripper.column -> Integer
+ * ripper#column -> Integer
*
* Return column number of current parsing line.
* This number starts from 0.
@@ -12217,13 +10807,13 @@ ripper_column(VALUE self)
rb_raise(rb_eArgError, "method called for uninitialized object");
}
if (NIL_P(parser->parsing_thread)) return Qnil;
- col = parser->tokp - lex_pbeg;
+ col = parser->tokp - parser->parser_lex_pbeg;
return LONG2NUM(col);
}
/*
* call-seq:
- * ripper.filename -> String
+ * ripper#filename -> String
*
* Return current parsing filename.
*/
@@ -12236,12 +10826,12 @@ ripper_filename(VALUE self)
if (!ripper_initialized_p(parser)) {
rb_raise(rb_eArgError, "method called for uninitialized object");
}
- return ruby_sourcefile_string;
+ return parser->parser_ruby_sourcefile_string;
}
/*
* call-seq:
- * ripper.lineno -> Integer
+ * ripper#lineno -> Integer
*
* Return line number of current parsing line.
* This number starts from 1.
@@ -12256,26 +10846,7 @@ ripper_lineno(VALUE self)
rb_raise(rb_eArgError, "method called for uninitialized object");
}
if (NIL_P(parser->parsing_thread)) return Qnil;
- return INT2NUM(ruby_sourceline);
-}
-
-/*
- * call-seq:
- * ripper.state -> Integer
- *
- * Return scanner state of current token.
- */
-static VALUE
-ripper_state(VALUE self)
-{
- struct parser_params *parser;
-
- TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
- if (!ripper_initialized_p(parser)) {
- rb_raise(rb_eArgError, "method called for uninitialized object");
- }
- if (NIL_P(parser->parsing_thread)) return Qnil;
- return INT2NUM(lex_state);
+ return INT2NUM(parser->parser_ruby_sourceline);
}
#ifdef RIPPER_DEBUG
@@ -12298,20 +10869,17 @@ ripper_value(VALUE self, VALUE obj)
}
#endif
-static VALUE
-ripper_lex_state_name(VALUE self, VALUE state)
-{
- return rb_parser_lex_state_name(NUM2INT(state));
-}
void
Init_ripper(void)
{
+ parser_data_type.parent = RTYPEDDATA_TYPE(rb_parser_new());
+
ripper_init_eventids1();
ripper_init_eventids2();
- id_warn = rb_intern_const("warn");
- id_warning = rb_intern_const("warning");
- id_gets = rb_intern_const("gets");
+ /* ensure existing in symbol table */
+ (void)rb_intern("||");
+ (void)rb_intern("&&");
InitVM(ripper);
}
@@ -12330,27 +10898,16 @@ InitVM_ripper(void)
rb_define_method(Ripper, "column", ripper_column, 0);
rb_define_method(Ripper, "filename", ripper_filename, 0);
rb_define_method(Ripper, "lineno", ripper_lineno, 0);
- rb_define_method(Ripper, "state", ripper_state, 0);
rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);
rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);
rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0);
rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1);
- rb_define_method(Ripper, "error?", ripper_error_p, 0);
#ifdef RIPPER_DEBUG
rb_define_method(rb_mKernel, "assert_Qundef", ripper_assert_Qundef, 2);
rb_define_method(rb_mKernel, "rawVALUE", ripper_value, 1);
rb_define_method(rb_mKernel, "validate_object", ripper_validate_object, 1);
#endif
- rb_define_singleton_method(Ripper, "dedent_string", parser_dedent_string, 2);
- rb_define_private_method(Ripper, "dedent_string", parser_dedent_string, 2);
-
- rb_define_singleton_method(Ripper, "lex_state_name", ripper_lex_state_name, 1);
-
-<% @exprs.each do |expr, desc| -%>
- /* <%=desc%> */
- rb_define_const(Ripper, "<%=expr%>", INT2NUM(<%=expr%>));
-<% end %>
ripper_init_eventids1_table(Ripper);
ripper_init_eventids2_table(Ripper);
diff --git a/prelude.rb b/prelude.rb
index 7cfe0892b3..cc24a81474 100644
--- a/prelude.rb
+++ b/prelude.rb
@@ -1,6 +1,5 @@
class Thread
- MUTEX_FOR_THREAD_EXCLUSIVE = Thread::Mutex.new # :nodoc:
- private_constant :MUTEX_FOR_THREAD_EXCLUSIVE
+ MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new # :nodoc:
# call-seq:
# Thread.exclusive { block } => obj
@@ -8,148 +7,9 @@ class Thread
# Wraps the block in a single, VM-global Mutex.synchronize, returning the
# value of the block. A thread executing inside the exclusive section will
# only block other threads which also use the Thread.exclusive mechanism.
- def self.exclusive(&block)
- warn "Thread.exclusive is deprecated, use Thread::Mutex", caller
- MUTEX_FOR_THREAD_EXCLUSIVE.synchronize(&block)
+ def self.exclusive
+ MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
+ yield
+ }
end
end
-
-class IO
-
- # call-seq:
- # ios.read_nonblock(maxlen [, options]) -> string
- # ios.read_nonblock(maxlen, outbuf [, options]) -> 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::EAGAIN,
- # 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.
- #
- # By specifying a keyword argument _exception_ to +false+, you can indicate
- # that read_nonblock should not raise an IO::WaitReadable exception, but
- # return the symbol +:wait_readable+ instead. At EOF, it will return nil
- # instead of raising EOFError.
- def read_nonblock(len, buf = nil, exception: true)
- __read_nonblock(len, buf, exception)
- end
-
- # 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::EAGAIN,
- # 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 a keyword argument _exception_ to +false+, you can indicate
- # that write_nonblock should not raise an IO::WaitWritable exception, but
- # return the symbol +:wait_writable+ instead.
- def write_nonblock(buf, exception: true)
- __write_nonblock(buf, exception)
- end
-end
-
-# :stopdoc:
-class Binding
- def irb
- require 'irb'
- irb
- end
-
- # suppress redefinition warning
- alias irb irb # :nodoc:
-end
-
-module Kernel
- def pp(*objs)
- require 'pp'
- pp(*objs)
- end
-
- # suppress redefinition warning
- alias pp pp # :nodoc:
-end
diff --git a/probes.d b/probes.d
index 57a3d762bd..dc20d30172 100644
--- a/probes.d
+++ b/probes.d
@@ -17,7 +17,7 @@ provider ruby {
ruby:::method-return(classname, methodname, filename, lineno);
This probe is fired just after a method has returned. The arguments are
- the same as "ruby:::method-entry".
+ the same as "ruby:::function-entry".
*/
probe method__return(const char *classname, const char *methodname, const char *filename, int lineno);
@@ -25,14 +25,14 @@ provider ruby {
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:::method-entry".
+ the same as "ruby:::function-entry".
*/
probe cmethod__entry(const char *classname, const char *methodname, const char *filename, int lineno);
/*
ruby:::cmethod-return(classname, methodname, filename, lineno);
This probe is fired just before a C method returns. The arguments are
- the same as "ruby:::method-entry".
+ the same as "ruby:::function-entry".
*/
probe cmethod__return(const char *classname, const char *methodname, const char *filename, int lineno);
diff --git a/probes_helper.h b/probes_helper.h
index 1393436b29..f01cbc374a 100644
--- a/probes_helper.h
+++ b/probes_helper.h
@@ -4,40 +4,64 @@
#include "ruby/ruby.h"
#include "probes.h"
-struct ruby_dtrace_method_hook_args {
- const char *classname;
- const char *methodname;
- const char *filename;
- int line_no;
- volatile VALUE klass;
- volatile VALUE name;
-};
-
-NOINLINE(int rb_dtrace_setup(rb_execution_context_t *, VALUE, ID, struct ruby_dtrace_method_hook_args *));
-
-#define RUBY_DTRACE_METHOD_HOOK(name, ec, klazz, id) \
+VALUE rb_class_path_no_cache(VALUE _klass);
+
+#define RUBY_DTRACE_HOOK(name, th, klazz, id) \
do { \
- if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
- struct ruby_dtrace_method_hook_args args; \
- if (rb_dtrace_setup(ec, klazz, id, &args)) { \
- RUBY_DTRACE_##name(args.classname, \
- args.methodname, \
- args.filename, \
- args.line_no); \
+ if (RUBY_DTRACE_##name##_ENABLED()) { \
+ VALUE _klass = (klazz); \
+ ID _id = (id); \
+ const char * classname; \
+ const char * methodname; \
+ const char * filename; \
+ if (!_klass) { \
+ rb_thread_method_id_and_class((th), &_id, &_klass); \
+ } \
+ if (_klass) { \
+ if (RB_TYPE_P(_klass, T_ICLASS)) { \
+ _klass = RBASIC(_klass)->klass; \
+ } \
+ else if (FL_TEST(_klass, FL_SINGLETON)) { \
+ _klass = rb_iv_get(_klass, "__attached__"); \
+ } \
+ switch (TYPE(_klass)) { \
+ case T_CLASS: \
+ case T_ICLASS: \
+ case T_MODULE: \
+ { \
+ VALUE _name = rb_class_path_no_cache(_klass); \
+ if (!NIL_P(_name)) { \
+ classname = StringValuePtr(_name); \
+ } \
+ else { \
+ classname = "<unknown>"; \
+ } \
+ methodname = rb_id2name(_id); \
+ filename = rb_sourcefile(); \
+ if (classname && methodname && filename) { \
+ RUBY_DTRACE_##name( \
+ classname, \
+ methodname, \
+ filename, \
+ rb_sourceline()); \
+ } \
+ break; \
+ } \
+ } \
} \
} \
} while (0)
-#define RUBY_DTRACE_METHOD_ENTRY_HOOK(ec, klass, id) \
- RUBY_DTRACE_METHOD_HOOK(METHOD_ENTRY, ec, klass, id)
+#define RUBY_DTRACE_METHOD_ENTRY_HOOK(th, klass, id) \
+ RUBY_DTRACE_HOOK(METHOD_ENTRY, th, klass, id)
-#define RUBY_DTRACE_METHOD_RETURN_HOOK(ec, klass, id) \
- RUBY_DTRACE_METHOD_HOOK(METHOD_RETURN, ec, klass, id)
+#define RUBY_DTRACE_METHOD_RETURN_HOOK(th, klass, id) \
+ RUBY_DTRACE_HOOK(METHOD_RETURN, th, klass, id)
-#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(ec, klass, id) \
- RUBY_DTRACE_METHOD_HOOK(CMETHOD_ENTRY, ec, klass, id)
+#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, klass, id) \
+ RUBY_DTRACE_HOOK(CMETHOD_ENTRY, th, klass, id)
-#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec, klass, id) \
- RUBY_DTRACE_METHOD_HOOK(CMETHOD_RETURN, ec, klass, id)
+#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, klass, id) \
+ RUBY_DTRACE_HOOK(CMETHOD_RETURN, th, klass, id)
#endif /* RUBY_PROBES_HELPER_H */
diff --git a/proc.c b/proc.c
index 303fc047c2..a3882a9acd 100644
--- a/proc.c
+++ b/proc.c
@@ -14,24 +14,15 @@
#include "gc.h"
#include "iseq.h"
-/* Proc.new with no block will raise an exception in the future
- * versions */
-#define PROC_NEW_REQUIRES_BLOCK 0
-
-#if !defined(__GNUC__) || __GNUC__ < 5 || defined(__MINGW32__)
-# define NO_CLOBBERED(v) (*(volatile VALUE *)&(v))
-#else
-# define NO_CLOBBERED(v) (v)
-#endif
-
-const rb_cref_t *rb_vm_cref_in_context(VALUE self, VALUE cbase);
+const NODE *rb_vm_cref_in_context(VALUE self, VALUE cbase);
struct METHOD {
- const VALUE recv;
- const VALUE klass;
- const VALUE iclass;
- const rb_method_entry_t * const me;
- /* for bound methods, `me' should be rb_callable_method_entry_t * */
+ VALUE recv;
+ VALUE rclass;
+ VALUE defined_class;
+ ID id;
+ rb_method_entry_t *me;
+ struct unlinked_method_entry_list_entry *ume;
};
VALUE rb_cUnboundMethod;
@@ -42,56 +33,30 @@ VALUE rb_cProc;
static VALUE bmcall(VALUE, VALUE, int, VALUE *, VALUE);
static int method_arity(VALUE);
static int method_min_max_arity(VALUE, int *max);
-
#define attached id__attached__
/* Proc */
-#define IS_METHOD_PROC_IFUNC(ifunc) ((ifunc)->func == bmcall)
-
-static void
-block_mark(const struct rb_block *block)
-{
- switch (vm_block_type(block)) {
- case block_type_iseq:
- case block_type_ifunc:
- {
- const struct rb_captured_block *captured = &block->as.captured;
- RUBY_MARK_UNLESS_NULL(captured->self);
- RUBY_MARK_UNLESS_NULL((VALUE)captured->code.val);
- if (captured->ep && captured->ep[VM_ENV_DATA_INDEX_ENV] != Qundef /* cfunc_proc_t */) {
- RUBY_MARK_UNLESS_NULL(VM_ENV_ENVVAL(captured->ep));
- }
- }
- break;
- case block_type_symbol:
- RUBY_MARK_UNLESS_NULL(block->as.symbol);
- break;
- case block_type_proc:
- RUBY_MARK_UNLESS_NULL(block->as.proc);
- break;
- }
-}
+#define IS_METHOD_PROC_NODE(node) (nd_type(node) == NODE_IFUNC && (node)->nd_cfnc == bmcall)
static void
proc_mark(void *ptr)
{
rb_proc_t *proc = ptr;
- block_mark(&proc->block);
+ RUBY_MARK_ENTER("proc");
+ RUBY_MARK_UNLESS_NULL(proc->envval);
+ RUBY_MARK_UNLESS_NULL(proc->blockprocval);
+ RUBY_MARK_UNLESS_NULL(proc->block.proc);
+ RUBY_MARK_UNLESS_NULL(proc->block.self);
+ if (proc->block.iseq && RUBY_VM_IFUNC_P(proc->block.iseq)) {
+ RUBY_MARK_UNLESS_NULL((VALUE)(proc->block.iseq));
+ }
RUBY_MARK_LEAVE("proc");
}
-typedef struct {
- rb_proc_t basic;
- VALUE env[VM_ENV_DATA_SIZE + 1]; /* ..., envval */
-} cfunc_proc_t;
-
static size_t
proc_memsize(const void *ptr)
{
- const rb_proc_t *proc = ptr;
- if (proc->block.as.captured.ep == ((const cfunc_proc_t *)ptr)->env+1)
- return sizeof(cfunc_proc_t);
return sizeof(rb_proc_t);
}
@@ -102,14 +67,15 @@ static const rb_data_type_t proc_data_type = {
RUBY_TYPED_DEFAULT_FREE,
proc_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
VALUE
-rb_proc_alloc(VALUE klass)
+rb_proc_wrap(VALUE klass, rb_proc_t *proc)
{
- rb_proc_t *proc;
- return TypedData_Make_Struct(klass, rb_proc_t, &proc_data_type, proc);
+ proc->block.proc = TypedData_Wrap_Struct(klass, &proc_data_type, proc);
+
+ return proc->block.proc;
}
VALUE
@@ -123,20 +89,19 @@ rb_obj_is_proc(VALUE proc)
}
}
-VALUE rb_proc_create(VALUE klass, const struct rb_block *block,
- int8_t safe_level, int8_t is_from_method, int8_t is_lambda);
-
/* :nodoc: */
static VALUE
proc_dup(VALUE self)
{
VALUE procval;
rb_proc_t *src;
+ rb_proc_t *dst = ALLOC(rb_proc_t);
GetProcPtr(self, src);
- procval = rb_proc_create(rb_cProc, &src->block,
- src->safe_level, src->is_from_method, src->is_lambda);
+ *dst = *src;
+ procval = rb_proc_wrap(rb_cProc, dst);
RB_GC_GUARD(self); /* for: body = proc_dup(body) */
+
return procval;
}
@@ -234,7 +199,7 @@ proc_clone(VALUE self)
* C.new.e(1,2) #=> ArgumentError
* C.new.method(:e).to_proc.lambda? #=> true
*
- * This exception ensures that methods never have tricks
+ * This exception insures that methods never have tricks
* and makes it easy to have wrappers to define methods that behave as usual.
*
* class C
@@ -264,26 +229,32 @@ rb_proc_lambda_p(VALUE procval)
static void
binding_free(void *ptr)
{
+ rb_binding_t *bind;
RUBY_FREE_ENTER("binding");
- ruby_xfree(ptr);
+ if (ptr) {
+ bind = ptr;
+ ruby_xfree(bind);
+ }
RUBY_FREE_LEAVE("binding");
}
static void
binding_mark(void *ptr)
{
- rb_binding_t *bind = ptr;
-
+ rb_binding_t *bind;
RUBY_MARK_ENTER("binding");
- block_mark(&bind->block);
- rb_gc_mark(bind->pathobj);
+ if (ptr) {
+ bind = ptr;
+ RUBY_MARK_UNLESS_NULL(bind->env);
+ RUBY_MARK_UNLESS_NULL(bind->path);
+ }
RUBY_MARK_LEAVE("binding");
}
static size_t
binding_memsize(const void *ptr)
{
- return sizeof(rb_binding_t);
+ return ptr ? sizeof(rb_binding_t) : 0;
}
const rb_data_type_t ruby_binding_data_type = {
@@ -293,11 +264,11 @@ const rb_data_type_t ruby_binding_data_type = {
binding_free,
binding_memsize,
},
- 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
-VALUE
-rb_binding_alloc(VALUE klass)
+static VALUE
+binding_alloc(VALUE klass)
{
VALUE obj;
rb_binding_t *bind;
@@ -305,17 +276,16 @@ rb_binding_alloc(VALUE klass)
return obj;
}
-
/* :nodoc: */
static VALUE
binding_dup(VALUE self)
{
- VALUE bindval = rb_binding_alloc(rb_cBinding);
+ VALUE bindval = binding_alloc(rb_cBinding);
rb_binding_t *src, *dst;
GetBindingPtr(self, src);
GetBindingPtr(bindval, dst);
- rb_vm_block_copy(bindval, &dst->block, &src->block);
- RB_OBJ_WRITE(bindval, &dst->pathobj, src->pathobj);
+ dst->env = src->env;
+ dst->path = src->path;
dst->first_lineno = src->first_lineno;
return bindval;
}
@@ -330,10 +300,39 @@ binding_clone(VALUE self)
}
VALUE
+rb_binding_new_with_cfp(rb_thread_t *th, const rb_control_frame_t *src_cfp)
+{
+ rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(th, src_cfp);
+ rb_control_frame_t *ruby_level_cfp = rb_vm_get_ruby_level_next_cfp(th, src_cfp);
+ VALUE bindval, envval;
+ rb_binding_t *bind;
+
+ if (cfp == 0 || ruby_level_cfp == 0) {
+ rb_raise(rb_eRuntimeError, "Can't create Binding Object on top of Fiber.");
+ }
+
+ while (1) {
+ envval = rb_vm_make_env_object(th, cfp);
+ if (cfp == ruby_level_cfp) {
+ break;
+ }
+ cfp = rb_vm_get_binding_creatable_next_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
+ }
+
+ bindval = binding_alloc(rb_cBinding);
+ GetBindingPtr(bindval, bind);
+ bind->env = envval;
+ bind->path = ruby_level_cfp->iseq->location.path;
+ bind->first_lineno = rb_vm_get_sourceline(ruby_level_cfp);
+
+ return bindval;
+}
+
+VALUE
rb_binding_new(void)
{
- rb_execution_context_t *ec = GET_EC();
- return rb_vm_make_binding(ec, ec->cfp);
+ rb_thread_t *th = GET_THREAD();
+ return rb_binding_new_with_cfp(th, th->cfp);
}
/*
@@ -346,7 +345,7 @@ rb_binding_new(void)
* environment. See also the description of class +Binding+.
*
* def get_binding(param)
- * binding
+ * return binding
* end
* b = get_binding("hello")
* eval("param", b) #=> "hello"
@@ -368,7 +367,7 @@ rb_f_binding(VALUE self)
* reporting syntax errors.
*
* def get_binding(param)
- * binding
+ * return binding
* end
* b = get_binding("hello")
* b.eval("param") #=> "hello"
@@ -384,42 +383,26 @@ bind_eval(int argc, VALUE *argv, VALUE bindval)
return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */);
}
-static const VALUE *
-get_local_variable_ptr(const rb_env_t **envp, ID lid)
+static VALUE *
+get_local_variable_ptr(VALUE envval, ID lid)
{
- const rb_env_t *env = *envp;
+ rb_env_t *env;
+
do {
- if (!VM_ENV_FLAGS(env->ep, VM_FRAME_FLAG_CFRAME)) {
- const rb_iseq_t *iseq = env->iseq;
- unsigned int i;
-
- VM_ASSERT(rb_obj_is_iseq((VALUE)iseq));
-
- for (i=0; i<iseq->body->local_table_size; i++) {
- if (iseq->body->local_table[i] == lid) {
- if (iseq->body->local_iseq == iseq &&
- iseq->body->param.flags.has_block &&
- (unsigned int)iseq->body->param.block_start == i) {
- const VALUE *ep = env->ep;
- if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) {
- RB_OBJ_WRITE(env, &env->env[i], rb_vm_bh_to_procval(GET_EC(), VM_ENV_BLOCK_HANDLER(ep)));
- VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM);
- }
- }
-
- *envp = env;
- return &env->env[i];
- }
+ const rb_iseq_t *iseq;
+ int i;
+
+ GetEnvPtr(envval, env);
+ iseq = env->block.iseq;
+
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == lid) {
+ return &env->env[i];
}
}
- else {
- *envp = NULL;
- return NULL;
- }
- } while ((env = rb_vm_env_prev_env(env)) != NULL);
+ } while ((envval = env->prev_envval) != 0);
- *envp = NULL;
- return NULL;
+ return 0;
}
/*
@@ -431,19 +414,18 @@ static ID
check_local_id(VALUE bindval, volatile VALUE *pname)
{
ID lid = rb_check_id(pname);
- VALUE name = *pname;
+ VALUE name = *pname, sym = name;
if (lid) {
if (!rb_is_local_id(lid)) {
- rb_name_err_raise("wrong local variable name `%1$s' for %2$s",
- bindval, ID2SYM(lid));
+ name = rb_id2str(lid);
+ wrong:
+ rb_name_error_str(sym, "wrong local variable name `% "PRIsVALUE"' for %"PRIsVALUE,
+ name, bindval);
}
}
else {
- if (!rb_is_local_name(name)) {
- rb_name_err_raise("wrong local variable name `%1$s' for %2$s",
- bindval, name);
- }
+ if (!rb_is_local_name(sym)) goto wrong;
return 0;
}
return lid;
@@ -453,7 +435,7 @@ check_local_id(VALUE bindval, volatile VALUE *pname)
* call-seq:
* binding.local_variables -> Array
*
- * Returns the names of the binding's local variables as symbols.
+ * Returns the +symbol+ names of the binding's local variables
*
* def foo
* a = 1
@@ -462,7 +444,7 @@ check_local_id(VALUE bindval, volatile VALUE *pname)
* end
* end
*
- * This method is the short version of the following code:
+ * This method is short version of the following code.
*
* binding.eval("local_variables")
*
@@ -471,18 +453,16 @@ static VALUE
bind_local_variables(VALUE bindval)
{
const rb_binding_t *bind;
- const rb_env_t *env;
GetBindingPtr(bindval, bind);
- env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
- return rb_vm_env_local_variables(env);
+ return rb_vm_env_local_variables(bind->env);
}
/*
* call-seq:
* binding.local_variable_get(symbol) -> obj
*
- * Returns the value of the local variable +symbol+.
+ * Returns a +value+ of local variable +symbol+.
*
* def foo
* a = 1
@@ -490,7 +470,7 @@ bind_local_variables(VALUE bindval)
* binding.local_variable_get(:b) #=> NameError
* end
*
- * This method is the short version of the following code:
+ * This method is short version of the following code.
*
* binding.eval("#{symbol}")
*
@@ -501,18 +481,15 @@ bind_local_variable_get(VALUE bindval, VALUE sym)
ID lid = check_local_id(bindval, &sym);
const rb_binding_t *bind;
const VALUE *ptr;
- const rb_env_t *env;
if (!lid) goto undefined;
GetBindingPtr(bindval, bind);
- env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
- if ((ptr = get_local_variable_ptr(&env, lid)) == NULL) {
- sym = ID2SYM(lid);
+ if ((ptr = get_local_variable_ptr(bind->env, lid)) == NULL) {
undefined:
- rb_name_err_raise("local variable `%1$s' is not defined for %2$s",
- bindval, sym);
+ rb_name_error_str(sym, "local variable `%"PRIsVALUE"' not defined for %"PRIsVALUE,
+ sym, bindval);
}
return *ptr;
@@ -526,42 +503,38 @@ bind_local_variable_get(VALUE bindval, VALUE sym)
*
* def foo
* a = 1
- * bind = binding
- * bind.local_variable_set(:a, 2) # set existing local variable `a'
- * bind.local_variable_set(:b, 3) # create new local variable `b'
- * # `b' exists only in binding
- *
- * p bind.local_variable_get(:a) #=> 2
- * p bind.local_variable_get(:b) #=> 3
- * p a #=> 2
- * p b #=> NameError
+ * b = binding
+ * b.local_variable_set(:a, 2) # set existing local variable `a'
+ * b.local_variable_set(:b, 3) # create new local variable `b'
+ * # `b' exists only in binding.
+ * b.local_variable_get(:a) #=> 2
+ * b.local_variable_get(:b) #=> 3
+ * p a #=> 2
+ * p b #=> NameError
* end
*
- * This method behaves similarly to the following code:
+ * This method is a similar behavior of the following code
*
* binding.eval("#{symbol} = #{obj}")
*
- * if +obj+ can be dumped in Ruby code.
+ * if obj can be dumped in Ruby code.
*/
static VALUE
bind_local_variable_set(VALUE bindval, VALUE sym, VALUE val)
{
ID lid = check_local_id(bindval, &sym);
rb_binding_t *bind;
- const VALUE *ptr;
- const rb_env_t *env;
+ VALUE *ptr;
if (!lid) lid = rb_intern_str(sym);
GetBindingPtr(bindval, bind);
- env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
- if ((ptr = get_local_variable_ptr(&env, lid)) == NULL) {
+ if ((ptr = get_local_variable_ptr(bind->env, lid)) == NULL) {
/* not found. create new env */
- ptr = rb_binding_add_dynavars(bindval, bind, 1, &lid);
- env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
+ ptr = rb_binding_add_dynavars(bind, 1, &lid);
}
- RB_OBJ_WRITE(env, ptr, val);
+ *ptr = val;
return val;
}
@@ -570,7 +543,7 @@ bind_local_variable_set(VALUE bindval, VALUE sym, VALUE val)
* call-seq:
* binding.local_variable_defined?(symbol) -> obj
*
- * Returns +true+ if a local variable +symbol+ exists.
+ * Returns a +true+ if a local variable +symbol+ exists.
*
* def foo
* a = 1
@@ -578,7 +551,7 @@ bind_local_variable_set(VALUE bindval, VALUE sym, VALUE val)
* binding.local_variable_defined?(:b) #=> false
* end
*
- * This method is the short version of the following code:
+ * This method is short version of the following code.
*
* binding.eval("defined?(#{symbol}) == 'local-variable'")
*
@@ -588,13 +561,11 @@ bind_local_variable_defined_p(VALUE bindval, VALUE sym)
{
ID lid = check_local_id(bindval, &sym);
const rb_binding_t *bind;
- const rb_env_t *env;
if (!lid) return Qfalse;
GetBindingPtr(bindval, bind);
- env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
- return get_local_variable_ptr(&env, lid) ? Qtrue : Qfalse;
+ return get_local_variable_ptr(bind->env, lid) ? Qtrue : Qfalse;
}
/*
@@ -607,129 +578,42 @@ static VALUE
bind_receiver(VALUE bindval)
{
const rb_binding_t *bind;
- GetBindingPtr(bindval, bind);
- return vm_block_self(&bind->block);
-}
+ const rb_env_t *env;
-static VALUE
-cfunc_proc_new(VALUE klass, VALUE ifunc, int8_t is_lambda)
-{
- rb_proc_t *proc;
- cfunc_proc_t *sproc;
- VALUE procval = TypedData_Make_Struct(klass, cfunc_proc_t, &proc_data_type, sproc);
- VALUE *ep;
-
- proc = &sproc->basic;
- vm_block_type_set(&proc->block, block_type_ifunc);
-
- *(VALUE **)&proc->block.as.captured.ep = ep = sproc->env + VM_ENV_DATA_SIZE-1;
- ep[VM_ENV_DATA_INDEX_FLAGS] = VM_FRAME_MAGIC_IFUNC | VM_FRAME_FLAG_CFRAME | VM_ENV_FLAG_LOCAL | VM_ENV_FLAG_ESCAPED;
- ep[VM_ENV_DATA_INDEX_ME_CREF] = Qfalse;
- ep[VM_ENV_DATA_INDEX_SPECVAL] = VM_BLOCK_HANDLER_NONE;
- ep[VM_ENV_DATA_INDEX_ENV] = Qundef; /* envval */
-
- /* self? */
- RB_OBJ_WRITE(procval, &proc->block.as.captured.code.ifunc, ifunc);
- proc->is_lambda = is_lambda;
- return procval;
+ GetBindingPtr(bindval, bind);
+ GetEnvPtr(bind->env, env);
+ return env->block.self;
}
static VALUE
-sym_proc_new(VALUE klass, VALUE sym)
+proc_new(VALUE klass, int is_lambda)
{
- VALUE procval = rb_proc_alloc(klass);
- rb_proc_t *proc;
- GetProcPtr(procval, proc);
-
- vm_block_type_set(&proc->block, block_type_symbol);
- RB_OBJ_WRITE(procval, &proc->block.as.symbol, sym);
- return procval;
-}
-
-struct vm_ifunc *
-rb_vm_ifunc_new(VALUE (*func)(ANYARGS), const void *data, int min_argc, int max_argc)
-{
- union {
- struct vm_ifunc_argc argc;
- VALUE packed;
- } arity;
+ VALUE procval = Qnil;
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ rb_block_t *block;
- if (min_argc < UNLIMITED_ARGUMENTS ||
-#if SIZEOF_INT * 2 > SIZEOF_VALUE
- min_argc >= (int)(1U << (SIZEOF_VALUE * CHAR_BIT) / 2) ||
-#endif
- 0) {
- rb_raise(rb_eRangeError, "minimum argument number out of range: %d",
- min_argc);
- }
- if (max_argc < UNLIMITED_ARGUMENTS ||
-#if SIZEOF_INT * 2 > SIZEOF_VALUE
- max_argc >= (int)(1U << (SIZEOF_VALUE * CHAR_BIT) / 2) ||
-#endif
- 0) {
- rb_raise(rb_eRangeError, "maximum argument number out of range: %d",
- max_argc);
+ if ((block = rb_vm_control_frame_block_ptr(cfp)) != 0) {
+ /* block found */
}
- arity.argc.min = min_argc;
- arity.argc.max = max_argc;
- return IFUNC_NEW(func, data, arity.packed);
-}
-
-VALUE
-rb_func_proc_new(rb_block_call_func_t func, VALUE val)
-{
- struct vm_ifunc *ifunc = rb_vm_ifunc_proc_new(func, (void *)val);
- return cfunc_proc_new(rb_cProc, (VALUE)ifunc, 0);
-}
-
-VALUE
-rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc)
-{
- struct vm_ifunc *ifunc = rb_vm_ifunc_new(func, (void *)val, min_argc, max_argc);
- return cfunc_proc_new(rb_cProc, (VALUE)ifunc, 1);
-}
-
-static const char proc_without_block[] = "tried to create Proc object without a block";
-
-static VALUE
-proc_new(VALUE klass, int8_t is_lambda)
-{
- VALUE procval;
- const rb_execution_context_t *ec = GET_EC();
- rb_control_frame_t *cfp = ec->cfp;
- VALUE block_handler;
-
- if ((block_handler = rb_vm_frame_block_handler(cfp)) == VM_BLOCK_HANDLER_NONE) {
-#if !PROC_NEW_REQUIRES_BLOCK
+ else {
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
- if ((block_handler = rb_vm_frame_block_handler(cfp)) != VM_BLOCK_HANDLER_NONE) {
- const VALUE *lep = rb_vm_ep_local_ep(cfp->ep);
-
- if (VM_ENV_ESCAPED_P(lep)) {
- procval = VM_ENV_PROCVAL(lep);
- goto return_existing_proc;
- }
-
+ if ((block = rb_vm_control_frame_block_ptr(cfp)) != 0) {
if (is_lambda) {
- rb_warn(proc_without_block);
+ rb_warn("tried to create Proc object without a block");
}
}
-#else
- if (0)
-#endif
else {
- rb_raise(rb_eArgError, proc_without_block);
+ rb_raise(rb_eArgError,
+ "tried to create Proc object without a block");
}
}
- /* block is in cf */
- switch (vm_block_handler_type(block_handler)) {
- case block_handler_type_proc:
- procval = VM_BH_TO_PROC(block_handler);
+ procval = block->proc;
- return_existing_proc:
- if (RBASIC_CLASS(procval) == klass) {
+ if (procval) {
+ if (RBASIC(procval)->klass == klass) {
return procval;
}
else {
@@ -737,20 +621,16 @@ proc_new(VALUE klass, int8_t is_lambda)
RBASIC_SET_CLASS(newprocval, klass);
return newprocval;
}
- break;
+ }
- case block_handler_type_symbol:
- return (klass != rb_cProc) ?
- sym_proc_new(klass, VM_BH_TO_SYMBOL(block_handler)) :
- rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler));
- break;
+ procval = rb_vm_make_proc(th, block, klass);
- case block_handler_type_ifunc:
- case block_handler_type_iseq:
- return rb_vm_make_proc_lambda(ec, VM_BH_TO_CAPT_BLOCK(block_handler), klass, is_lambda);
+ if (is_lambda) {
+ rb_proc_t *proc;
+ GetProcPtr(procval, proc);
+ proc->is_lambda = TRUE;
}
- VM_UNREACHABLE(proc_new);
- return Qnil;
+ return procval;
}
/*
@@ -806,6 +686,24 @@ rb_block_lambda(void)
return proc_new(rb_cProc, TRUE);
}
+VALUE
+rb_block_clear_env_self(VALUE proc)
+{
+ rb_proc_t *po;
+ rb_env_t *env;
+ GetProcPtr(proc, po);
+ GetEnvPtr(po->envval, env);
+ env->env[0] = Qnil;
+ return proc;
+}
+
+VALUE
+rb_f_lambda(void)
+{
+ rb_warn("rb_f_lambda() is deprecated; use rb_block_proc() instead");
+ return rb_block_lambda();
+}
+
/* Document-method: ===
*
* call-seq:
@@ -819,50 +717,64 @@ rb_block_lambda(void)
/* CHECKME: are the argument checking semantics correct? */
/*
- * Document-method: []
- * Document-method: call
- * Document-method: yield
- *
* call-seq:
* prc.call(params,...) -> obj
* prc[params,...] -> obj
* prc.(params,...) -> obj
- * prc.yield(params,...) -> obj
*
* Invokes the block, setting the block's parameters to the values in
* <i>params</i> using something close to method calling semantics.
- * Returns the value of the last expression evaluated in the block.
+ * Generates a warning if multiple values are passed to a proc that
+ * expects just one (previously this silently converted the parameters
+ * to an array). Note that prc.() invokes prc.call() with the parameters
+ * given. It's a syntax sugar to hide "call".
*
- * a_proc = Proc.new {|scalar, *values| values.map {|value| value*scalar } }
- * a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
- * a_proc[9, 1, 2, 3] #=> [9, 18, 27]
- * a_proc.(9, 1, 2, 3) #=> [9, 18, 27]
- * a_proc.yield(9, 1, 2, 3) #=> [9, 18, 27]
+ * For procs created using <code>lambda</code> or <code>->()</code> an error
+ * is generated if the wrong number of parameters are passed to a Proc with
+ * multiple parameters. For procs created using <code>Proc.new</code> or
+ * <code>Kernel.proc</code>, extra parameters are silently discarded.
*
- * Note that <code>prc.()</code> invokes <code>prc.call()</code> with
- * the parameters given. It's syntactic sugar to hide "call".
+ * Returns the value of the last expression evaluated in the block. See
+ * also <code>Proc#yield</code>.
*
- * For procs created using <code>lambda</code> or <code>->()</code> an error
- * is generated if the wrong number of parameters are passed to the proc.
- * For procs created using <code>Proc.new</code> or <code>Kernel.proc</code>,
- * extra parameters are silently discarded and missing parameters are
- * set to +nil+.
+ * a_proc = Proc.new {|a, *b| b.collect {|i| i*a }}
+ * a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
+ * a_proc[9, 1, 2, 3] #=> [9, 18, 27]
+ * a_proc = lambda {|a,b| a}
+ * a_proc.call(1,2,3)
*
- * a_proc = proc {|a,b| [a,b] }
- * a_proc.call(1) #=> [1, nil]
+ * <em>produces:</em>
*
- * a_proc = lambda {|a,b| [a,b] }
- * a_proc.call(1) # ArgumentError: wrong number of arguments (given 1, expected 2)
+ * prog.rb:4:in `block in <main>': wrong number of arguments (3 for 2) (ArgumentError)
+ * from prog.rb:5:in `call'
+ * from prog.rb:5:in `<main>'
*
- * See also Proc#lambda?.
*/
-#if 0
+
static VALUE
proc_call(int argc, VALUE *argv, VALUE procval)
{
- /* removed */
+ VALUE vret;
+ rb_proc_t *proc;
+ rb_block_t *blockptr = 0;
+ rb_iseq_t *iseq;
+ VALUE passed_procval;
+ GetProcPtr(procval, proc);
+
+ iseq = proc->block.iseq;
+ if (BUILTIN_TYPE(iseq) == T_NODE || iseq->arg_block != -1) {
+ if (rb_block_given_p()) {
+ rb_proc_t *passed_proc;
+ RB_GC_GUARD(passed_procval) = rb_block_proc();
+ GetProcPtr(passed_procval, passed_proc);
+ blockptr = &passed_proc->block;
+ }
+ }
+
+ vret = rb_vm_invoke_proc(GET_THREAD(), proc, argc, argv, blockptr);
+ RB_GC_GUARD(procval);
+ return vret;
}
-#endif
#if SIZEOF_LONG > SIZEOF_INT
static inline int
@@ -884,36 +796,36 @@ rb_proc_call(VALUE self, VALUE args)
VALUE vret;
rb_proc_t *proc;
GetProcPtr(self, proc);
- vret = rb_vm_invoke_proc(GET_EC(), proc,
- check_argc(RARRAY_LEN(args)), RARRAY_CONST_PTR(args),
- VM_BLOCK_HANDLER_NONE);
+ vret = rb_vm_invoke_proc(GET_THREAD(), proc, check_argc(RARRAY_LEN(args)), RARRAY_CONST_PTR(args), 0);
RB_GC_GUARD(self);
RB_GC_GUARD(args);
return vret;
}
-static VALUE
-proc_to_block_handler(VALUE procval)
-{
- return NIL_P(procval) ? VM_BLOCK_HANDLER_NONE : procval;
-}
-
VALUE
-rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_procval)
+rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE pass_procval)
{
- rb_execution_context_t *ec = GET_EC();
VALUE vret;
rb_proc_t *proc;
+ rb_block_t *block = 0;
GetProcPtr(self, proc);
- vret = rb_vm_invoke_proc(ec, proc, argc, argv, proc_to_block_handler(passed_procval));
+
+ if (!NIL_P(pass_procval)) {
+ rb_proc_t *pass_proc;
+ GetProcPtr(pass_procval, pass_proc);
+ block = &pass_proc->block;
+ }
+
+ vret = rb_vm_invoke_proc(GET_THREAD(), proc, argc, argv, block);
RB_GC_GUARD(self);
+ RB_GC_GUARD(pass_procval);
return vret;
}
/*
* call-seq:
- * prc.arity -> integer
+ * prc.arity -> fixnum
*
* Returns the number of mandatory arguments. If the block
* is declared to take no arguments, returns 0. If the block is known
@@ -922,10 +834,10 @@ rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_pr
* number of mandatory arguments, with the exception for blocks that
* are not lambdas and have only a finite number of optional arguments;
* in this latter case, returns n.
- * Keyword arguments will be considered as a single additional argument,
+ * Keywords arguments will considered as a single additional argument,
* that argument being mandatory if any keyword argument is mandatory.
* A <code>proc</code> with no argument declarations
- * is the same as a block declaring <code>||</code> as its arguments.
+ * is the same a block declaring <code>||</code> as its arguments.
*
* proc {}.arity #=> 0
* proc { || }.arity #=> 0
@@ -938,16 +850,16 @@ rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_pr
* proc { |x:, y:, z:0| }.arity #=> 1
* proc { |*a, x:, y:0| }.arity #=> -2
*
- * proc { |a=0| }.arity #=> 0
- * lambda { |a=0| }.arity #=> -1
- * proc { |a=0, b| }.arity #=> 1
- * lambda { |a=0, b| }.arity #=> -2
- * proc { |a=0, b=0| }.arity #=> 0
- * lambda { |a=0, b=0| }.arity #=> -1
- * proc { |a, b=0| }.arity #=> 1
- * lambda { |a, b=0| }.arity #=> -2
- * proc { |(a, b), c=0| }.arity #=> 1
- * lambda { |(a, b), c=0| }.arity #=> -2
+ * proc { |x=0| }.arity #=> 0
+ * lambda { |x=0| }.arity #=> -1
+ * proc { |x=0, y| }.arity #=> 1
+ * lambda { |x=0, y| }.arity #=> -2
+ * proc { |x=0, y=0| }.arity #=> 0
+ * lambda { |x=0, y=0| }.arity #=> -1
+ * proc { |x, y=0| }.arity #=> 1
+ * lambda { |x, y=0| }.arity #=> -2
+ * proc { |(x, y), z=0| }.arity #=> 1
+ * lambda { |(x, y), z=0| }.arity #=> -2
* proc { |a, x:0, y:0| }.arity #=> 1
* lambda { |a, x:0, y:0| }.arity #=> -2
*/
@@ -962,35 +874,28 @@ proc_arity(VALUE self)
static inline int
rb_iseq_min_max_arity(const rb_iseq_t *iseq, int *max)
{
- *max = iseq->body->param.flags.has_rest == FALSE ?
- iseq->body->param.lead_num + iseq->body->param.opt_num + iseq->body->param.post_num +
- (iseq->body->param.flags.has_kw == TRUE || iseq->body->param.flags.has_kwrest == TRUE)
+ *max = iseq->arg_rest == -1 ?
+ iseq->argc + iseq->arg_post_len + iseq->arg_opts -
+ (iseq->arg_opts > 0) + (iseq->arg_keyword != -1)
: UNLIMITED_ARGUMENTS;
- return iseq->body->param.lead_num + iseq->body->param.post_num + (iseq->body->param.flags.has_kw && iseq->body->param.keyword->required_num > 0);
+ return iseq->argc + iseq->arg_post_len + (iseq->arg_keyword_required > 0);
}
static int
-rb_vm_block_min_max_arity(const struct rb_block *block, int *max)
+rb_block_min_max_arity(rb_block_t *block, int *max)
{
- again:
- switch (vm_block_type(block)) {
- case block_type_iseq:
- return rb_iseq_min_max_arity(rb_iseq_check(block->as.captured.code.iseq), max);
- case block_type_proc:
- block = vm_proc_block(block->as.proc);
- goto again;
- case block_type_ifunc:
- {
- const struct vm_ifunc *ifunc = block->as.captured.code.ifunc;
- if (IS_METHOD_PROC_IFUNC(ifunc)) {
+ rb_iseq_t *iseq = block->iseq;
+ if (iseq) {
+ if (BUILTIN_TYPE(iseq) != T_NODE) {
+ return rb_iseq_min_max_arity(iseq, max);
+ }
+ else {
+ NODE *node = (NODE *)iseq;
+ if (IS_METHOD_PROC_NODE(node)) {
/* e.g. method(:foo).to_proc.arity */
- return method_min_max_arity((VALUE)ifunc->data, max);
+ return method_min_max_arity(node->nd_tval, max);
}
- *max = ifunc->argc.max;
- return ifunc->argc.min;
}
- case block_type_symbol:
- break;
}
*max = UNLIMITED_ARGUMENTS;
return 0;
@@ -1006,152 +911,93 @@ static int
rb_proc_min_max_arity(VALUE self, int *max)
{
rb_proc_t *proc;
+ rb_block_t *block;
GetProcPtr(self, proc);
- return rb_vm_block_min_max_arity(&proc->block, max);
+ block = &proc->block;
+ return rb_block_min_max_arity(block, max);
}
int
rb_proc_arity(VALUE self)
{
rb_proc_t *proc;
- int max, min;
+ int max, min = rb_proc_min_max_arity(self, &max);
GetProcPtr(self, proc);
- min = rb_vm_block_min_max_arity(&proc->block, &max);
return (proc->is_lambda ? min == max : max != UNLIMITED_ARGUMENTS) ? min : -min-1;
}
-static void
-block_setup(struct rb_block *block, VALUE block_handler)
-{
- switch (vm_block_handler_type(block_handler)) {
- case block_handler_type_iseq:
- block->type = block_type_iseq;
- block->as.captured = *VM_BH_TO_ISEQ_BLOCK(block_handler);
- break;
- case block_handler_type_ifunc:
- block->type = block_type_ifunc;
- block->as.captured = *VM_BH_TO_IFUNC_BLOCK(block_handler);
- break;
- case block_handler_type_symbol:
- block->type = block_type_symbol;
- block->as.symbol = VM_BH_TO_SYMBOL(block_handler);
- break;
- case block_handler_type_proc:
- block->type = block_type_proc;
- block->as.proc = VM_BH_TO_PROC(block_handler);
- }
-}
-
int
rb_block_arity(void)
{
int min, max;
- const rb_execution_context_t *ec = GET_EC();
- rb_control_frame_t *cfp = ec->cfp;
- VALUE block_handler = rb_vm_frame_block_handler(cfp);
- struct rb_block block;
-
- if (block_handler == VM_BLOCK_HANDLER_NONE) {
- rb_raise(rb_eArgError, "no block given");
- }
-
- block_setup(&block, block_handler);
- min = rb_vm_block_min_max_arity(&block, &max);
-
- switch (vm_block_type(&block)) {
- case block_handler_type_symbol:
- return -1;
-
- case block_handler_type_proc:
- {
- VALUE procval = block_handler;
- rb_proc_t *proc;
- GetProcPtr(procval, proc);
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
+ rb_block_t *block = rb_vm_control_frame_block_ptr(cfp);
+ VALUE proc_value;
+
+ if (!block) rb_raise(rb_eArgError, "no block given");
+ min = rb_block_min_max_arity(block, &max);
+ proc_value = block->proc;
+ if (proc_value) {
+ rb_proc_t *proc;
+ GetProcPtr(proc_value, proc);
+ if (proc)
return (proc->is_lambda ? min == max : max != UNLIMITED_ARGUMENTS) ? min : -min-1;
- /* fall through */
- }
-
- default:
- return max != UNLIMITED_ARGUMENTS ? min : -min-1;
}
+ return max != UNLIMITED_ARGUMENTS ? min : -min-1;
}
-int
-rb_block_min_max_arity(int *max)
-{
- const rb_execution_context_t *ec = GET_EC();
- rb_control_frame_t *cfp = ec->cfp;
- VALUE block_handler = rb_vm_frame_block_handler(cfp);
- struct rb_block block;
-
- if (block_handler == VM_BLOCK_HANDLER_NONE) {
- rb_raise(rb_eArgError, "no block given");
- }
-
- block_setup(&block, block_handler);
- return rb_vm_block_min_max_arity(&block, max);
-}
+#define get_proc_iseq rb_proc_get_iseq
-const rb_iseq_t *
+rb_iseq_t *
rb_proc_get_iseq(VALUE self, int *is_proc)
{
- const rb_proc_t *proc;
- const struct rb_block *block;
+ rb_proc_t *proc;
+ rb_iseq_t *iseq;
GetProcPtr(self, proc);
- block = &proc->block;
+ iseq = proc->block.iseq;
if (is_proc) *is_proc = !proc->is_lambda;
-
- switch (vm_block_type(block)) {
- case block_type_iseq:
- return rb_iseq_check(block->as.captured.code.iseq);
- case block_type_proc:
- return rb_proc_get_iseq(block->as.proc, is_proc);
- case block_type_ifunc:
- {
- const struct vm_ifunc *ifunc = block->as.captured.code.ifunc;
- if (IS_METHOD_PROC_IFUNC(ifunc)) {
- /* method(:foo).to_proc */
- if (is_proc) *is_proc = 0;
- return rb_method_iseq((VALUE)ifunc->data);
- }
- else {
- return NULL;
- }
+ if (!RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ NODE *node = (NODE *)iseq;
+ iseq = 0;
+ if (IS_METHOD_PROC_NODE(node)) {
+ /* method(:foo).to_proc */
+ iseq = rb_method_get_iseq(node->nd_tval);
+ if (is_proc) *is_proc = 0;
}
- case block_type_symbol:
- return NULL;
}
-
- VM_UNREACHABLE(rb_proc_get_iseq);
- return NULL;
+ return iseq;
}
static VALUE
-iseq_location(const rb_iseq_t *iseq)
+iseq_location(rb_iseq_t *iseq)
{
VALUE loc[2];
if (!iseq) return Qnil;
- rb_iseq_check(iseq);
- loc[0] = rb_iseq_path(iseq);
- loc[1] = iseq->body->location.first_lineno;
-
+ loc[0] = iseq->location.path;
+ if (iseq->line_info_table) {
+ loc[1] = rb_iseq_first_lineno(iseq->self);
+ }
+ else {
+ loc[1] = Qnil;
+ }
return rb_ary_new4(2, loc);
}
/*
* call-seq:
- * prc.source_location -> [String, Integer]
+ * prc.source_location -> [String, Fixnum]
*
* Returns the Ruby source filename and line number containing this proc
- * or +nil+ if this proc was not defined in Ruby (i.e. native).
+ * or +nil+ if this proc was not defined in Ruby (i.e. native)
*/
VALUE
rb_proc_location(VALUE self)
{
- return iseq_location(rb_proc_get_iseq(self, 0));
+ return iseq_location(get_proc_iseq(self, 0));
}
static VALUE
@@ -1187,7 +1033,7 @@ static VALUE
rb_proc_parameters(VALUE self)
{
int is_proc;
- const rb_iseq_t *iseq = rb_proc_get_iseq(self, &is_proc);
+ rb_iseq_t *iseq = get_proc_iseq(self, &is_proc);
if (!iseq) {
return unnamed_parameters(rb_proc_arity(self));
}
@@ -1199,40 +1045,9 @@ rb_hash_proc(st_index_t hash, VALUE prc)
{
rb_proc_t *proc;
GetProcPtr(prc, proc);
- hash = rb_hash_uint(hash, (st_index_t)proc->block.as.captured.code.val);
- hash = rb_hash_uint(hash, (st_index_t)proc->block.as.captured.self);
- return rb_hash_uint(hash, (st_index_t)proc->block.as.captured.ep >> 16);
-}
-
-VALUE
-rb_sym_to_proc(VALUE sym)
-{
- static VALUE sym_proc_cache = Qfalse;
- enum {SYM_PROC_CACHE_SIZE = 67};
- VALUE proc;
- long index;
- ID id;
- VALUE *aryp;
-
- if (!sym_proc_cache) {
- sym_proc_cache = rb_ary_tmp_new(SYM_PROC_CACHE_SIZE * 2);
- rb_gc_register_mark_object(sym_proc_cache);
- rb_ary_store(sym_proc_cache, SYM_PROC_CACHE_SIZE*2 - 1, Qnil);
- }
-
- id = SYM2ID(sym);
- index = (id % SYM_PROC_CACHE_SIZE) << 1;
-
- aryp = RARRAY_PTR(sym_proc_cache);
- if (aryp[index] == sym) {
- return aryp[index + 1];
- }
- else {
- proc = sym_proc_new(rb_cProc, ID2SYM(id));
- aryp[index] = sym;
- aryp[index + 1] = proc;
- return proc;
- }
+ hash = rb_hash_uint(hash, (st_index_t)proc->block.iseq);
+ hash = rb_hash_uint(hash, (st_index_t)proc->envval);
+ return rb_hash_uint(hash, (st_index_t)proc->block.ep >> 16);
}
/*
@@ -1251,40 +1066,7 @@ proc_hash(VALUE self)
hash = rb_hash_start(0);
hash = rb_hash_proc(hash, self);
hash = rb_hash_end(hash);
- return ST2FIX(hash);
-}
-
-VALUE
-rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info)
-{
- VALUE cname = rb_obj_class(self);
- VALUE str = rb_sprintf("#<%"PRIsVALUE":", cname);
-
- again:
- switch (vm_block_type(block)) {
- case block_type_proc:
- block = vm_proc_block(block->as.proc);
- goto again;
- case block_type_iseq:
- {
- const rb_iseq_t *iseq = rb_iseq_check(block->as.captured.code.iseq);
- rb_str_catf(str, "%p@%"PRIsVALUE":%d", (void *)self,
- rb_iseq_path(iseq),
- FIX2INT(iseq->body->location.first_lineno));
- }
- break;
- case block_type_symbol:
- rb_str_catf(str, "%p(&%+"PRIsVALUE")", (void *)self, block->as.symbol);
- break;
- case block_type_ifunc:
- rb_str_catf(str, "%p", block->as.captured.code.ifunc);
- break;
- }
-
- if (additional_info) rb_str_cat_cstr(str, additional_info);
- rb_str_cat_cstr(str, ">");
- OBJ_INFECT_RAW(str, self);
- return str;
+ return LONG2FIX(hash);
}
/*
@@ -1298,9 +1080,34 @@ rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_i
static VALUE
proc_to_s(VALUE self)
{
- const rb_proc_t *proc;
+ VALUE str = 0;
+ rb_proc_t *proc;
+ const char *cname = rb_obj_classname(self);
+ rb_iseq_t *iseq;
+ const char *is_lambda;
+
GetProcPtr(self, proc);
- return rb_block_to_s(self, &proc->block, proc->is_lambda ? " (lambda)" : NULL);
+ iseq = proc->block.iseq;
+ is_lambda = proc->is_lambda ? " (lambda)" : "";
+
+ if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ int first_lineno = 0;
+
+ if (iseq->line_info_table) {
+ first_lineno = FIX2INT(rb_iseq_first_lineno(iseq->self));
+ }
+ str = rb_sprintf("#<%s:%p@%"PRIsVALUE":%d%s>", cname, (void *)self,
+ iseq->location.path, first_lineno, is_lambda);
+ }
+ else {
+ str = rb_sprintf("#<%s:%p%s>", cname, (void *)proc->block.iseq,
+ is_lambda);
+ }
+
+ if (OBJ_TAINTED(self)) {
+ OBJ_TAINT(str);
+ }
+ return str;
}
/*
@@ -1322,26 +1129,38 @@ static void
bm_mark(void *ptr)
{
struct METHOD *data = ptr;
+ rb_gc_mark(data->defined_class);
+ rb_gc_mark(data->rclass);
rb_gc_mark(data->recv);
- rb_gc_mark(data->klass);
- rb_gc_mark(data->iclass);
- rb_gc_mark((VALUE)data->me);
+ if (data->me) rb_mark_method_entry(data->me);
+}
+
+static void
+bm_free(void *ptr)
+{
+ struct METHOD *data = ptr;
+ struct unlinked_method_entry_list_entry *ume = data->ume;
+ data->me->mark = 0;
+ ume->me = data->me;
+ ume->next = GET_VM()->unlinked_method_entry_list;
+ GET_VM()->unlinked_method_entry_list = ume;
+ xfree(ptr);
}
static size_t
bm_memsize(const void *ptr)
{
- return sizeof(struct METHOD);
+ return ptr ? sizeof(struct METHOD) : 0;
}
static const rb_data_type_t method_data_type = {
"method",
{
bm_mark,
- RUBY_TYPED_DEFAULT_FREE,
+ bm_free,
bm_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
VALUE
@@ -1355,122 +1174,110 @@ rb_obj_is_method(VALUE m)
}
}
-static int
-respond_to_missing_p(VALUE klass, VALUE obj, VALUE sym, int scope)
-{
- /* TODO: merge with obj_respond_to() */
- ID rmiss = idRespond_to_missing;
-
- if (obj == Qundef) return 0;
- if (rb_method_basic_definition_p(klass, rmiss)) return 0;
- return RTEST(rb_funcall(obj, rmiss, 2, sym, scope ? Qfalse : Qtrue));
-}
-
-
static VALUE
-mnew_missing(VALUE klass, VALUE obj, ID id, VALUE mclass)
-{
- struct METHOD *data;
- VALUE method = TypedData_Make_Struct(mclass, struct METHOD, &method_data_type, data);
- rb_method_entry_t *me;
- rb_method_definition_t *def;
-
- RB_OBJ_WRITE(method, &data->recv, obj);
- RB_OBJ_WRITE(method, &data->klass, klass);
-
- def = ZALLOC(rb_method_definition_t);
- def->type = VM_METHOD_TYPE_MISSING;
- def->original_id = id;
-
- me = rb_method_entry_create(id, klass, METHOD_VISI_UNDEF, def);
-
- RB_OBJ_WRITE(method, &data->me, me);
-
- OBJ_INFECT(method, klass);
-
- return method;
-}
-
-static VALUE
-mnew_internal(const rb_method_entry_t *me, VALUE klass, VALUE iclass,
+mnew_internal(rb_method_entry_t *me, VALUE defined_class, VALUE klass,
VALUE obj, ID id, VALUE mclass, int scope, int error)
{
- struct METHOD *data;
VALUE method;
- rb_method_visibility_t visi = METHOD_VISI_UNDEF;
+ VALUE rclass = klass;
+ ID rid = id;
+ struct METHOD *data;
+ rb_method_definition_t *def = 0;
+ rb_method_flag_t flag = NOEX_UNDEF;
again:
if (UNDEFINED_METHOD_ENTRY_P(me)) {
- if (respond_to_missing_p(klass, obj, ID2SYM(id), scope)) {
- return mnew_missing(klass, obj, id, mclass);
+ ID rmiss = idRespond_to_missing;
+ VALUE sym = ID2SYM(id);
+
+ if (obj != Qundef && !rb_method_basic_definition_p(klass, rmiss)) {
+ if (RTEST(rb_funcall(obj, rmiss, 2, sym, scope ? Qfalse : Qtrue))) {
+ me = 0;
+ defined_class = klass;
+
+ goto gen_method;
+ }
}
if (!error) return Qnil;
- rb_print_undef(klass, id, METHOD_VISI_UNDEF);
+ rb_print_undef(klass, id, 0);
}
- if (visi == METHOD_VISI_UNDEF) {
- visi = METHOD_ENTRY_VISI(me);
- if (scope && (visi != METHOD_VISI_PUBLIC)) {
+ def = me->def;
+ if (flag == NOEX_UNDEF) {
+ flag = me->flag;
+ if (scope && (flag & NOEX_MASK) != NOEX_PUBLIC) {
if (!error) return Qnil;
- rb_print_inaccessible(klass, id, visi);
+ rb_print_inaccessible(klass, id, flag & NOEX_MASK);
}
}
- if (me->def->type == VM_METHOD_TYPE_ZSUPER) {
- if (me->defined_class) {
- VALUE klass = RCLASS_SUPER(RCLASS_ORIGIN(me->defined_class));
- id = me->def->original_id;
- me = (rb_method_entry_t *)rb_callable_method_entry_without_refinements(klass, id, &iclass);
- }
- else {
- VALUE klass = RCLASS_SUPER(me->owner);
- id = me->def->original_id;
- me = rb_method_entry_without_refinements(klass, id, &iclass);
- }
+ if (def && def->type == VM_METHOD_TYPE_ZSUPER) {
+ klass = RCLASS_SUPER(defined_class);
+ id = def->original_id;
+ me = rb_method_entry_without_refinements(klass, id, &defined_class);
goto again;
}
+ klass = defined_class;
+
+ while (rclass != klass &&
+ (FL_TEST(rclass, FL_SINGLETON) || RB_TYPE_P(rclass, T_ICLASS))) {
+ rclass = RCLASS_SUPER(rclass);
+ }
+
+ gen_method:
method = TypedData_Make_Struct(mclass, struct METHOD, &method_data_type, data);
- RB_OBJ_WRITE(method, &data->recv, obj);
- RB_OBJ_WRITE(method, &data->klass, klass);
- RB_OBJ_WRITE(method, &data->iclass, iclass);
- RB_OBJ_WRITE(method, &data->me, me);
+ data->recv = obj;
+ data->rclass = rclass;
+ data->defined_class = defined_class;
+ data->id = rid;
+ data->me = ALLOC(rb_method_entry_t);
+ if (me) {
+ *data->me = *me;
+ }
+ else {
+ me = data->me;
+ me->flag = 0;
+ me->mark = 0;
+ me->called_id = id;
+ me->klass = klass;
+ me->def = 0;
+
+ def = ALLOC(rb_method_definition_t);
+ me->def = def;
+
+ def->type = VM_METHOD_TYPE_MISSING;
+ def->original_id = id;
+ def->alias_count = 0;
+
+ }
+ data->ume = ALLOC(struct unlinked_method_entry_list_entry);
+ data->me->def->alias_count++;
OBJ_INFECT(method, klass);
+
return method;
}
static VALUE
-mnew_from_me(const rb_method_entry_t *me, VALUE klass, VALUE iclass,
+mnew_from_me(rb_method_entry_t *me, VALUE defined_class, VALUE klass,
VALUE obj, ID id, VALUE mclass, int scope)
{
- return mnew_internal(me, klass, iclass, obj, id, mclass, scope, TRUE);
+ return mnew_internal(me, defined_class, klass, obj, id, mclass, scope, TRUE);
}
static VALUE
mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
{
- const rb_method_entry_t *me;
- VALUE iclass = Qnil;
-
- if (obj == Qundef) { /* UnboundMethod */
- me = rb_method_entry_without_refinements(klass, id, &iclass);
- }
- else {
- me = (rb_method_entry_t *)rb_callable_method_entry_without_refinements(klass, id, &iclass);
- }
- return mnew_from_me(me, klass, iclass, obj, id, mclass, scope);
+ VALUE defined_class;
+ rb_method_entry_t *me =
+ rb_method_entry_without_refinements(klass, id, &defined_class);
+ return mnew_from_me(me, defined_class, klass, obj, id, mclass, scope);
}
-static inline VALUE
-method_entry_defined_class(const rb_method_entry_t *me)
-{
- VALUE defined_class = me->defined_class;
- return defined_class ? defined_class : me->owner;
-}
/**********************************************************************
*
- * Document-class: Method
+ * Document-class : Method
*
* Method objects are created by <code>Object#method</code>, and are
* associated with a particular object (not just with a class). They
@@ -1506,7 +1313,6 @@ static VALUE
method_eq(VALUE method, VALUE other)
{
struct METHOD *m1, *m2;
- VALUE klass1, klass2;
if (!rb_obj_is_method(other))
return Qfalse;
@@ -1517,12 +1323,8 @@ method_eq(VALUE method, VALUE other)
m1 = (struct METHOD *)DATA_PTR(method);
m2 = (struct METHOD *)DATA_PTR(other);
- klass1 = method_entry_defined_class(m1->me);
- klass2 = method_entry_defined_class(m2->me);
-
if (!rb_method_entry_eq(m1->me, m2->me) ||
- klass1 != klass2 ||
- m1->klass != m2->klass ||
+ m1->rclass != m2->rclass ||
m1->recv != m2->recv) {
return Qfalse;
}
@@ -1546,11 +1348,12 @@ method_hash(VALUE method)
st_index_t hash;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, m);
- hash = rb_hash_start((st_index_t)m->recv);
+ hash = rb_hash_start((st_index_t)m->rclass);
+ hash = rb_hash_uint(hash, (st_index_t)m->recv);
hash = rb_hash_method_entry(hash, m->me);
hash = rb_hash_end(hash);
- return ST2FIX(hash);
+ return INT2FIX(hash);
}
/*
@@ -1571,9 +1374,14 @@ method_unbind(VALUE obj)
TypedData_Get_Struct(obj, struct METHOD, &method_data_type, orig);
method = TypedData_Make_Struct(rb_cUnboundMethod, struct METHOD,
&method_data_type, data);
- RB_OBJ_WRITE(method, &data->recv, Qundef);
- RB_OBJ_WRITE(method, &data->klass, orig->klass);
- RB_OBJ_WRITE(method, &data->me, rb_method_entry_clone(orig->me));
+ data->recv = Qundef;
+ data->id = orig->id;
+ data->me = ALLOC(rb_method_entry_t);
+ *data->me = *orig->me;
+ if (orig->me->def) orig->me->def->alias_count++;
+ data->rclass = orig->rclass;
+ data->defined_class = orig->defined_class;
+ data->ume = ALLOC(struct unlinked_method_entry_list_entry);
OBJ_INFECT(method, obj);
return method;
@@ -1608,7 +1416,7 @@ method_name(VALUE obj)
struct METHOD *data;
TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
- return ID2SYM(data->me->called_id);
+ return ID2SYM(data->id);
}
/*
@@ -1616,12 +1424,6 @@ method_name(VALUE obj)
* meth.original_name -> symbol
*
* Returns the original name of the method.
- *
- * class C
- * def foo; end
- * alias bar foo
- * end
- * C.instance_method(:bar).original_name # => :foo
*/
static VALUE
@@ -1644,54 +1446,39 @@ static VALUE
method_owner(VALUE obj)
{
struct METHOD *data;
+ VALUE defined_class;
+
TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
- return data->me->owner;
+ defined_class = data->defined_class;
+
+ if (RB_TYPE_P(defined_class, T_ICLASS)) {
+ defined_class = RBASIC_CLASS(defined_class);
+ }
+
+ return defined_class;
}
void
rb_method_name_error(VALUE klass, VALUE str)
{
-#define MSG(s) rb_fstring_cstr("undefined method `%1$s' for"s" `%2$s'")
+ const char *s0 = " class";
VALUE c = klass;
- VALUE s;
if (FL_TEST(c, FL_SINGLETON)) {
VALUE obj = rb_ivar_get(klass, attached);
- switch (BUILTIN_TYPE(obj)) {
+ switch (TYPE(obj)) {
case T_MODULE:
case T_CLASS:
c = obj;
- s = MSG("");
+ s0 = "";
}
- goto normal_class;
}
else if (RB_TYPE_P(c, T_MODULE)) {
- s = MSG(" module");
- }
- else {
- normal_class:
- s = MSG(" class");
+ s0 = " module";
}
- rb_name_err_raise_str(s, c, str);
-#undef MSG
-}
-
-static VALUE
-obj_method(VALUE obj, VALUE vid, int scope)
-{
- ID id = rb_check_id(&vid);
- const VALUE klass = CLASS_OF(obj);
- const VALUE mclass = rb_cMethod;
-
- if (!id) {
- if (respond_to_missing_p(klass, obj, vid, scope)) {
- id = rb_intern_str(vid);
- return mnew_missing(klass, obj, id, mclass);
- }
- rb_method_name_error(klass, vid);
- }
- return mnew(klass, obj, id, mclass, scope);
+ rb_name_error_str(str, "undefined method `%"PRIsVALUE"' for%s `%"PRIsVALUE"'",
+ QUOTE(str), s0, rb_class_name(c));
}
/*
@@ -1725,7 +1512,11 @@ obj_method(VALUE obj, VALUE vid, int scope)
VALUE
rb_obj_method(VALUE obj, VALUE vid)
{
- return obj_method(obj, vid, FALSE);
+ ID id = rb_check_id(&vid);
+ if (!id) {
+ rb_method_name_error(CLASS_OF(obj), vid);
+ }
+ return mnew(CLASS_OF(obj), obj, id, rb_cMethod, FALSE);
}
/*
@@ -1738,7 +1529,11 @@ rb_obj_method(VALUE obj, VALUE vid)
VALUE
rb_obj_public_method(VALUE obj, VALUE vid)
{
- return obj_method(obj, vid, TRUE);
+ ID id = rb_check_id(&vid);
+ if (!id) {
+ rb_method_name_error(CLASS_OF(obj), vid);
+ }
+ return mnew(CLASS_OF(obj), obj, id, rb_cMethod, TRUE);
}
/*
@@ -1768,27 +1563,17 @@ rb_obj_public_method(VALUE obj, VALUE vid)
VALUE
rb_obj_singleton_method(VALUE obj, VALUE vid)
{
- const rb_method_entry_t *me;
- VALUE klass = rb_singleton_class_get(obj);
+ rb_method_entry_t *me;
+ VALUE klass;
ID id = rb_check_id(&vid);
-
- if (NIL_P(klass) || NIL_P(klass = RCLASS_ORIGIN(klass))) {
- undef:
- rb_name_err_raise("undefined singleton method `%1$s' for `%2$s'",
- obj, vid);
- }
if (!id) {
- if (respond_to_missing_p(klass, obj, vid, FALSE)) {
- id = rb_intern_str(vid);
- return mnew_missing(klass, obj, id, rb_cMethod);
- }
- goto undef;
+ rb_name_error_str(vid, "undefined singleton method `%"PRIsVALUE"' for `%"PRIsVALUE"'",
+ QUOTE(vid), obj);
}
- me = rb_method_entry_at(klass, id);
- if (UNDEFINED_METHOD_ENTRY_P(me) ||
- UNDEFINED_REFINED_METHOD_P(me->def)) {
- vid = ID2SYM(id);
- goto undef;
+ if (NIL_P(klass = rb_singleton_class_get(obj)) ||
+ !(me = rb_method_entry_at(klass, id))) {
+ rb_name_error(id, "undefined singleton method `%"PRIsVALUE"' for `%"PRIsVALUE"'",
+ QUOTE_ID(id), obj);
}
return mnew_from_me(me, klass, klass, obj, id, rb_cMethod, FALSE);
}
@@ -1859,14 +1644,16 @@ rb_mod_public_instance_method(VALUE mod, VALUE vid)
* Defines an instance method in the receiver. The _method_
* parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object.
* If a block is specified, it is used as the method body. This block
- * is evaluated using <code>instance_eval</code>.
+ * is evaluated using <code>instance_eval</code>, a point that is
+ * tricky to demonstrate because <code>define_method</code> is private.
+ * (This is why we resort to the +send+ hack in this example.)
*
* class A
* def fred
* puts "In Fred"
* end
* def create_method(name, &block)
- * self.class.define_method(name, &block)
+ * self.class.send(:define_method, name, &block)
* end
* define_method(:wilma) { puts "Charge it!" }
* end
@@ -1891,98 +1678,76 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
{
ID id;
VALUE body;
- VALUE name;
- const rb_cref_t *cref = rb_vm_cref_in_context(mod, mod);
- const rb_scope_visibility_t default_scope_visi = {METHOD_VISI_PUBLIC, FALSE};
- const rb_scope_visibility_t *scope_visi = &default_scope_visi;
- int is_method = FALSE;
+ int noex = NOEX_PUBLIC;
+ const NODE *cref = rb_vm_cref_in_context(mod, mod);
if (cref) {
- scope_visi = CREF_SCOPE_VISI(cref);
+ noex = (int)cref->nd_visi;
}
- rb_check_arity(argc, 1, 2);
- name = argv[0];
- id = rb_check_id(&name);
if (argc == 1) {
-#if PROC_NEW_REQUIRES_BLOCK
+ id = rb_to_id(argv[0]);
body = rb_block_lambda();
-#else
- const rb_execution_context_t *ec = GET_EC();
- VALUE block_handler = rb_vm_frame_block_handler(ec->cfp);
- if (block_handler == VM_BLOCK_HANDLER_NONE) rb_raise(rb_eArgError, proc_without_block);
-
- switch (vm_block_handler_type(block_handler)) {
- case block_handler_type_proc:
- body = VM_BH_TO_PROC(block_handler);
- break;
- case block_handler_type_symbol:
- body = rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler));
- break;
- case block_handler_type_iseq:
- case block_handler_type_ifunc:
- body = rb_vm_make_lambda(ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc);
- }
-#endif
}
else {
+ rb_check_arity(argc, 1, 2);
+ id = rb_to_id(argv[0]);
body = argv[1];
-
- if (rb_obj_is_method(body)) {
- is_method = TRUE;
- }
- else if (rb_obj_is_proc(body)) {
- is_method = FALSE;
- }
- else {
+ if (!rb_obj_is_method(body) && !rb_obj_is_proc(body)) {
rb_raise(rb_eTypeError,
"wrong argument type %s (expected Proc/Method)",
rb_obj_classname(body));
}
}
- if (!id) id = rb_to_id(name);
- if (is_method) {
+ if (rb_obj_is_method(body)) {
struct METHOD *method = (struct METHOD *)DATA_PTR(body);
- if (method->me->owner != mod && !RB_TYPE_P(method->me->owner, T_MODULE) &&
- !RTEST(rb_class_inherited_p(mod, method->me->owner))) {
- if (FL_TEST(method->me->owner, FL_SINGLETON)) {
+ VALUE rclass = method->rclass;
+ if (rclass != mod && !RB_TYPE_P(rclass, T_MODULE) &&
+ !RTEST(rb_class_inherited_p(mod, rclass))) {
+ if (FL_TEST(rclass, FL_SINGLETON)) {
rb_raise(rb_eTypeError,
"can't bind singleton method to a different class");
}
else {
rb_raise(rb_eTypeError,
"bind argument must be a subclass of % "PRIsVALUE,
- method->me->owner);
+ rb_class_name(rclass));
}
}
- rb_method_entry_set(mod, id, method->me, scope_visi->method_visi);
- if (scope_visi->module_func) {
- rb_method_entry_set(rb_singleton_class(mod), id, method->me, METHOD_VISI_PUBLIC);
+ rb_method_entry_set(mod, id, method->me, noex);
+ if (noex == NOEX_MODFUNC) {
+ rb_method_entry_set(rb_singleton_class(mod), id, method->me, NOEX_PUBLIC);
}
- RB_GC_GUARD(body);
}
- else {
- VALUE procval = proc_dup(body);
- if (vm_proc_iseq(procval) != NULL) {
- rb_proc_t *proc;
- GetProcPtr(procval, proc);
+ else if (rb_obj_is_proc(body)) {
+ rb_proc_t *proc;
+ body = proc_dup(body);
+ GetProcPtr(body, proc);
+ if (BUILTIN_TYPE(proc->block.iseq) != T_NODE) {
+ proc->block.iseq->defined_method_id = id;
+ RB_OBJ_WRITE(proc->block.iseq->self, &proc->block.iseq->klass, mod);
proc->is_lambda = TRUE;
proc->is_from_method = TRUE;
+ proc->block.klass = mod;
}
- rb_add_method(mod, id, VM_METHOD_TYPE_BMETHOD, (void *)procval, scope_visi->method_visi);
- if (scope_visi->module_func) {
- rb_add_method(rb_singleton_class(mod), id, VM_METHOD_TYPE_BMETHOD, (void *)body, METHOD_VISI_PUBLIC);
+ rb_add_method(mod, id, VM_METHOD_TYPE_BMETHOD, (void *)body, noex);
+ if (noex == NOEX_MODFUNC) {
+ rb_add_method(rb_singleton_class(mod), id, VM_METHOD_TYPE_BMETHOD, (void *)body, NOEX_PUBLIC);
}
}
+ else {
+ /* type error */
+ rb_raise(rb_eTypeError, "wrong argument type (expected Proc/Method)");
+ }
return ID2SYM(id);
}
/*
* call-seq:
- * define_singleton_method(symbol, method) -> symbol
- * define_singleton_method(symbol) { block } -> symbol
+ * define_singleton_method(symbol, method) -> new_method
+ * define_singleton_method(symbol) { block } -> proc
*
* Defines a singleton method in the receiver. The _method_
* parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object.
@@ -2014,8 +1779,8 @@ rb_obj_define_method(int argc, VALUE *argv, VALUE obj)
}
/*
- * define_method(symbol, method) -> symbol
- * define_method(symbol) { block } -> symbol
+ * define_method(symbol, method) -> new_method
+ * define_method(symbol) { block } -> proc
*
* Defines a global function by _method_ or the block.
*/
@@ -2062,9 +1827,12 @@ method_clone(VALUE self)
TypedData_Get_Struct(self, struct METHOD, &method_data_type, orig);
clone = TypedData_Make_Struct(CLASS_OF(self), struct METHOD, &method_data_type, data);
CLONESETUP(clone, self);
- RB_OBJ_WRITE(clone, &data->recv, orig->recv);
- RB_OBJ_WRITE(clone, &data->klass, orig->klass);
- RB_OBJ_WRITE(clone, &data->me, rb_method_entry_clone(orig->me));
+ *data = *orig;
+ data->me = ALLOC(rb_method_entry_t);
+ *data->me = *orig->me;
+ if (data->me->def) data->me->def->alias_count++;
+ data->ume = ALLOC(struct unlinked_method_entry_list_entry);
+
return clone;
}
@@ -2084,66 +1852,53 @@ method_clone(VALUE self)
VALUE
rb_method_call(int argc, const VALUE *argv, VALUE method)
{
- VALUE procval = rb_block_given_p() ? rb_block_proc() : Qnil;
- return rb_method_call_with_block(argc, argv, method, procval);
-}
-
-static const rb_callable_method_entry_t *
-method_callable_method_entry(const struct METHOD *data)
-{
- if (data->me->defined_class == 0) rb_bug("method_callable_method_entry: not callable.");
- return (const rb_callable_method_entry_t *)data->me;
-}
-
-static inline VALUE
-call_method_data(rb_execution_context_t *ec, const struct METHOD *data,
- int argc, const VALUE *argv, VALUE passed_procval)
-{
- vm_passed_block_handler_set(ec, proc_to_block_handler(passed_procval));
- return rb_vm_call(ec, data->recv, data->me->called_id, argc, argv,
- method_callable_method_entry(data));
-}
-
-static VALUE
-call_method_data_safe(rb_execution_context_t *ec, const struct METHOD *data,
- int argc, const VALUE *argv, VALUE passed_procval,
- int safe)
-{
- VALUE result = Qnil; /* OK */
- enum ruby_tag_type state;
-
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- /* result is used only if state == 0, no exceptions is caught. */
- /* otherwise it doesn't matter even if clobbered. */
- NO_CLOBBERED(result) = call_method_data(ec, data, argc, argv, passed_procval);
- }
- EC_POP_TAG();
- rb_set_safe_level_force(safe);
- if (state)
- EC_JUMP_TAG(ec, state);
- return result;
+ VALUE proc = rb_block_given_p() ? rb_block_proc() : Qnil;
+ return rb_method_call_with_block(argc, argv, method, proc);
}
VALUE
-rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passed_procval)
+rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE pass_procval)
{
- const struct METHOD *data;
- rb_execution_context_t *ec = GET_EC();
+ VALUE result = Qnil; /* OK */
+ struct METHOD *data;
+ int state;
+ volatile int safe = -1;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
if (data->recv == Qundef) {
rb_raise(rb_eTypeError, "can't call unbound method; bind first");
}
+ PUSH_TAG();
if (OBJ_TAINTED(method)) {
- const int safe_level_to_run = RUBY_SAFE_LEVEL_MAX;
- int safe = rb_safe_level();
- if (safe < safe_level_to_run) {
+ const int safe_level_to_run = 4 /*SAFE_LEVEL_MAX*/;
+ safe = rb_safe_level();
+ if (rb_safe_level() < safe_level_to_run) {
rb_set_safe_level_force(safe_level_to_run);
- return call_method_data_safe(ec, data, argc, argv, passed_procval, safe);
}
}
- return call_method_data(ec, data, argc, argv, passed_procval);
+ if ((state = EXEC_TAG()) == 0) {
+ rb_thread_t *th = GET_THREAD();
+ rb_block_t *block = 0;
+ VALUE defined_class;
+
+ if (!NIL_P(pass_procval)) {
+ rb_proc_t *pass_proc;
+ GetProcPtr(pass_procval, pass_proc);
+ block = &pass_proc->block;
+ }
+
+ th->passed_block = block;
+ VAR_INITIALIZED(data);
+ defined_class = data->defined_class;
+ if (BUILTIN_TYPE(defined_class) == T_MODULE) defined_class = data->rclass;
+ result = rb_vm_call(th, data->recv, data->id, argc, argv, data->me, defined_class);
+ }
+ POP_TAG();
+ if (safe >= 0)
+ rb_set_safe_level_force(safe);
+ if (state)
+ JUMP_TAG(state);
+ return result;
}
/**********************************************************************
@@ -2163,7 +1918,7 @@ rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passe
* these is an <code>UnboundMethod</code> object.
*
* Unbound methods can only be called after they are bound to an
- * object. That object must be a kind_of? the method's original
+ * object. That object must be be a kind_of? the method's original
* class.
*
* class Square
@@ -2241,12 +1996,12 @@ static VALUE
umethod_bind(VALUE method, VALUE recv)
{
struct METHOD *data, *bound;
- VALUE methclass, klass;
+ VALUE methclass;
+ VALUE rclass;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- methclass = data->me->owner;
-
+ methclass = data->rclass;
if (!RB_TYPE_P(methclass, T_MODULE) &&
methclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, methclass)) {
if (FL_TEST(methclass, FL_SINGLETON)) {
@@ -2255,27 +2010,28 @@ umethod_bind(VALUE method, VALUE recv)
}
else {
rb_raise(rb_eTypeError, "bind argument must be an instance of % "PRIsVALUE,
- methclass);
+ rb_class_name(methclass));
}
}
- klass = CLASS_OF(recv);
-
method = TypedData_Make_Struct(rb_cMethod, struct METHOD, &method_data_type, bound);
- RB_OBJ_WRITE(method, &bound->recv, recv);
- RB_OBJ_WRITE(method, &bound->klass, data->klass);
- RB_OBJ_WRITE(method, &bound->me, rb_method_entry_clone(data->me));
-
- if (RB_TYPE_P(bound->me->owner, T_MODULE)) {
- VALUE ic = rb_class_search_ancestor(klass, bound->me->owner);
+ *bound = *data;
+ bound->me = ALLOC(rb_method_entry_t);
+ *bound->me = *data->me;
+ if (bound->me->def) bound->me->def->alias_count++;
+ rclass = CLASS_OF(recv);
+ if (BUILTIN_TYPE(bound->defined_class) == T_MODULE) {
+ VALUE ic = rb_class_search_ancestor(rclass, bound->defined_class);
if (ic) {
- klass = ic;
+ rclass = ic;
}
else {
- klass = rb_include_class_new(methclass, klass);
+ rclass = rb_include_class_new(methclass, rclass);
}
- RB_OBJ_WRITE(method, &bound->me, rb_method_entry_complement_defined_class(bound->me, bound->me->called_id, klass));
}
+ bound->recv = recv;
+ bound->rclass = rclass;
+ data->ume = ALLOC(struct unlinked_method_entry_list_entry);
return method;
}
@@ -2289,8 +2045,6 @@ static int
rb_method_entry_min_max_arity(const rb_method_entry_t *me, int *max)
{
const rb_method_definition_t *def = me->def;
-
- again:
if (!def) return *max = 0;
switch (def->type) {
case VM_METHOD_TYPE_CFUNC:
@@ -2306,13 +2060,12 @@ rb_method_entry_min_max_arity(const rb_method_entry_t *me, int *max)
return *max = 1;
case VM_METHOD_TYPE_IVAR:
return *max = 0;
- case VM_METHOD_TYPE_ALIAS:
- def = def->body.alias.original_me->def;
- goto again;
case VM_METHOD_TYPE_BMETHOD:
return rb_proc_min_max_arity(def->body.proc, max);
- case VM_METHOD_TYPE_ISEQ:
- return rb_iseq_min_max_arity(rb_iseq_check(def->body.iseq.iseqptr), max);
+ case VM_METHOD_TYPE_ISEQ: {
+ rb_iseq_t *iseq = def->body.iseq;
+ return rb_iseq_min_max_arity(iseq, max);
+ }
case VM_METHOD_TYPE_UNDEF:
case VM_METHOD_TYPE_NOTIMPLEMENTED:
return *max = 0;
@@ -2324,9 +2077,6 @@ rb_method_entry_min_max_arity(const rb_method_entry_t *me, int *max)
case OPTIMIZED_METHOD_TYPE_SEND:
*max = UNLIMITED_ARGUMENTS;
return 0;
- case OPTIMIZED_METHOD_TYPE_CALL:
- *max = UNLIMITED_ARGUMENTS;
- return 0;
default:
break;
}
@@ -2349,15 +2099,13 @@ rb_method_entry_arity(const rb_method_entry_t *me)
/*
* call-seq:
- * meth.arity -> integer
+ * meth.arity -> fixnum
*
* Returns an indication of the number of arguments accepted by a
* method. Returns a nonnegative integer for methods that take a fixed
* number of arguments. For Ruby methods that take a variable number of
- * arguments, returns -n-1, where n is the number of required arguments.
- * Keyword arguments will be considered as a single additional argument,
- * that argument being mandatory if any keyword argument is mandatory.
- * For methods written in C, returns -1 if the call takes a
+ * arguments, returns -n-1, where n is the number of required
+ * arguments. For methods written in C, returns -1 if the call takes a
* variable number of arguments.
*
* class C
@@ -2367,10 +2115,6 @@ rb_method_entry_arity(const rb_method_entry_t *me)
* def four(a, b); end
* def five(a, b, *c); end
* def six(a, b, *c, &d); end
- * def seven(a, b, x:0); end
- * def eight(x:, y:); end
- * def nine(x:, y:, **z); end
- * def ten(*a, x:, y:); end
* end
* c = C.new
* c.method(:one).arity #=> 0
@@ -2379,10 +2123,6 @@ rb_method_entry_arity(const rb_method_entry_t *me)
* c.method(:four).arity #=> 2
* c.method(:five).arity #=> -3
* c.method(:six).arity #=> -3
- * c.method(:seven).arity #=> -3
- * c.method(:eight).arity #=> 1
- * c.method(:nine).arity #=> 1
- * c.method(:ten).arity #=> -2
*
* "cat".method(:size).arity #=> 0
* "cat".method(:replace).arity #=> 1
@@ -2406,15 +2146,16 @@ method_arity(VALUE method)
return rb_method_entry_arity(data->me);
}
-static const rb_method_entry_t *
+static rb_method_entry_t *
original_method_entry(VALUE mod, ID id)
{
- const rb_method_entry_t *me;
-
- while ((me = rb_method_entry(mod, id)) != 0) {
- const rb_method_definition_t *def = me->def;
+ VALUE rclass;
+ rb_method_entry_t *me;
+ while ((me = rb_method_entry(mod, id, &rclass)) != 0) {
+ rb_method_definition_t *def = me->def;
+ if (!def) break;
if (def->type != VM_METHOD_TYPE_ZSUPER) break;
- mod = RCLASS_SUPER(me->owner);
+ mod = RCLASS_SUPER(rclass);
id = def->original_id;
}
return me;
@@ -2423,7 +2164,7 @@ original_method_entry(VALUE mod, ID id)
static int
method_min_max_arity(VALUE method, int *max)
{
- const struct METHOD *data;
+ struct METHOD *data;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
return rb_method_entry_min_max_arity(data->me, max);
@@ -2432,7 +2173,7 @@ method_min_max_arity(VALUE method, int *max)
int
rb_mod_method_arity(VALUE mod, ID id)
{
- const rb_method_entry_t *me = original_method_entry(mod, id);
+ rb_method_entry_t *me = original_method_entry(mod, id);
if (!me) return 0; /* should raise? */
return rb_method_entry_arity(me);
}
@@ -2443,84 +2184,56 @@ rb_obj_method_arity(VALUE obj, ID id)
return rb_mod_method_arity(CLASS_OF(obj), id);
}
-static inline const rb_method_definition_t *
-method_def(VALUE method)
+static inline rb_method_definition_t *
+method_get_def(VALUE method)
{
- const struct METHOD *data;
+ struct METHOD *data;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
return data->me->def;
}
-static const rb_iseq_t *
-method_def_iseq(const rb_method_definition_t *def)
+static rb_iseq_t *
+method_get_iseq(rb_method_definition_t *def)
{
switch (def->type) {
- case VM_METHOD_TYPE_ISEQ:
- return rb_iseq_check(def->body.iseq.iseqptr);
case VM_METHOD_TYPE_BMETHOD:
- return rb_proc_get_iseq(def->body.proc, 0);
- case VM_METHOD_TYPE_ALIAS:
- return method_def_iseq(def->body.alias.original_me->def);
- case VM_METHOD_TYPE_CFUNC:
- case VM_METHOD_TYPE_ATTRSET:
- case VM_METHOD_TYPE_IVAR:
- case VM_METHOD_TYPE_ZSUPER:
- case VM_METHOD_TYPE_UNDEF:
- case VM_METHOD_TYPE_NOTIMPLEMENTED:
- case VM_METHOD_TYPE_OPTIMIZED:
- case VM_METHOD_TYPE_MISSING:
- case VM_METHOD_TYPE_REFINED:
- break;
+ return get_proc_iseq(def->body.proc, 0);
+ case VM_METHOD_TYPE_ISEQ:
+ return def->body.iseq;
+ default:
+ return 0;
}
- return NULL;
}
-const rb_iseq_t *
-rb_method_iseq(VALUE method)
+rb_iseq_t *
+rb_method_get_iseq(VALUE method)
{
- return method_def_iseq(method_def(method));
-}
-
-static const rb_cref_t *
-method_cref(VALUE method)
-{
- const rb_method_definition_t *def = method_def(method);
-
- again:
- switch (def->type) {
- case VM_METHOD_TYPE_ISEQ:
- return def->body.iseq.cref;
- case VM_METHOD_TYPE_ALIAS:
- def = def->body.alias.original_me->def;
- goto again;
- default:
- return NULL;
- }
+ return method_get_iseq(method_get_def(method));
}
static VALUE
-method_def_location(const rb_method_definition_t *def)
+method_def_location(rb_method_definition_t *def)
{
if (def->type == VM_METHOD_TYPE_ATTRSET || def->type == VM_METHOD_TYPE_IVAR) {
if (!def->body.attr.location)
return Qnil;
return rb_ary_dup(def->body.attr.location);
}
- return iseq_location(method_def_iseq(def));
+ return iseq_location(method_get_iseq(def));
}
VALUE
-rb_method_entry_location(const rb_method_entry_t *me)
+rb_method_entry_location(rb_method_entry_t *me)
{
- if (!me) return Qnil;
+ if (!me || !me->def) return Qnil;
return method_def_location(me->def);
}
VALUE
rb_mod_method_location(VALUE mod, ID id)
{
- const rb_method_entry_t *me = original_method_entry(mod, id);
+ rb_method_entry_t *me = original_method_entry(mod, id);
return rb_method_entry_location(me);
}
@@ -2532,16 +2245,17 @@ rb_obj_method_location(VALUE obj, ID id)
/*
* call-seq:
- * meth.source_location -> [String, Integer]
+ * meth.source_location -> [String, Fixnum]
*
* Returns the Ruby source filename and line number containing this method
- * or nil if this method was not defined in Ruby (i.e. native).
+ * or nil if this method was not defined in Ruby (i.e. native)
*/
VALUE
rb_method_location(VALUE method)
{
- return method_def_location(method_def(method));
+ rb_method_definition_t *def = method_get_def(method);
+ return method_def_location(def);
}
/*
@@ -2549,24 +2263,12 @@ rb_method_location(VALUE method)
* meth.parameters -> array
*
* Returns the parameter information of this method.
- *
- * def foo(bar); end
- * method(:foo).parameters #=> [[:req, :bar]]
- *
- * def foo(bar, baz, bat, &blk); end
- * method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]]
- *
- * def foo(bar, *args); end
- * method(:foo).parameters #=> [[:req, :bar], [:rest, :args]]
- *
- * def foo(bar, baz, *args, &blk); end
- * method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
*/
static VALUE
rb_method_parameters(VALUE method)
{
- const rb_iseq_t *iseq = rb_method_iseq(method);
+ rb_iseq_t *iseq = rb_method_get_iseq(method);
if (!iseq) {
return unnamed_parameters(method_arity(method));
}
@@ -2588,27 +2290,17 @@ method_inspect(VALUE method)
{
struct METHOD *data;
VALUE str;
+ const char *s;
const char *sharp = "#";
VALUE mklass;
- VALUE defined_class;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- str = rb_sprintf("#<% "PRIsVALUE": ", rb_obj_class(method));
- OBJ_INFECT_RAW(str, method);
-
- mklass = data->klass;
-
- if (data->me->def->type == VM_METHOD_TYPE_ALIAS) {
- defined_class = data->me->def->body.alias.original_me->owner;
- }
- else {
- defined_class = method_entry_defined_class(data->me);
- }
-
- if (RB_TYPE_P(defined_class, T_ICLASS)) {
- defined_class = RBASIC_CLASS(defined_class);
- }
+ str = rb_str_buf_new2("#<");
+ s = rb_obj_classname(method);
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, ": ");
+ mklass = data->me->klass;
if (FL_TEST(mklass, FL_SINGLETON)) {
VALUE v = rb_ivar_get(mklass, attached);
@@ -2628,14 +2320,16 @@ method_inspect(VALUE method)
}
}
else {
- rb_str_buf_append(str, rb_inspect(mklass));
- if (defined_class != mklass) {
- rb_str_catf(str, "(% "PRIsVALUE")", defined_class);
+ rb_str_buf_append(str, rb_class_name(data->rclass));
+ if (data->rclass != mklass) {
+ rb_str_buf_cat2(str, "(");
+ rb_str_buf_append(str, rb_class_name(mklass));
+ rb_str_buf_cat2(str, ")");
}
}
rb_str_buf_cat2(str, sharp);
- rb_str_append(str, rb_id2str(data->me->called_id));
- if (data->me->called_id != data->me->def->original_id) {
+ rb_str_append(str, rb_id2str(data->id));
+ if (data->id != data->me->def->original_id) {
rb_str_catf(str, "(%"PRIsVALUE")",
rb_id2str(data->me->def->original_id));
}
@@ -2650,19 +2344,31 @@ method_inspect(VALUE method)
static VALUE
mproc(VALUE method)
{
- return rb_funcallv(rb_mRubyVMFrozenCore, idProc, 0, 0);
+ return rb_funcall2(rb_mRubyVMFrozenCore, idProc, 0, 0);
}
static VALUE
mlambda(VALUE method)
{
- return rb_funcallv(rb_mRubyVMFrozenCore, idLambda, 0, 0);
+ return rb_funcall(rb_mRubyVMFrozenCore, idLambda, 0, 0);
}
static VALUE
bmcall(VALUE args, VALUE method, int argc, VALUE *argv, VALUE passed_proc)
{
- return rb_method_call_with_block(argc, argv, method, passed_proc);
+ volatile VALUE a;
+ VALUE ret;
+
+ if (CLASS_OF(args) != rb_cArray) {
+ args = rb_ary_new3(1, args);
+ argc = 1;
+ }
+ else {
+ argc = check_argc(RARRAY_LEN(args));
+ }
+ ret = rb_method_call_with_block(argc, RARRAY_PTR(args), method, passed_proc);
+ RB_GC_GUARD(a) = args;
+ return ret;
}
VALUE
@@ -2682,15 +2388,14 @@ rb_proc_new(
*/
static VALUE
-method_to_proc(VALUE method)
+method_proc(VALUE method)
{
VALUE procval;
rb_proc_t *proc;
-
/*
* class Method
* def to_proc
- * lambda{|*args|
+ * proc{|*args|
* self.call(*args)
* }
* end
@@ -2703,30 +2408,25 @@ method_to_proc(VALUE method)
}
/*
- * call-seq:
- * meth.super_method -> method
- *
- * Returns a Method of superclass which would be called when super is used
- * or nil if there is no method on superclass.
+ * Returns a Method of superclass, which would be called when super is used.
*/
-
static VALUE
method_super_method(VALUE method)
{
- const struct METHOD *data;
- VALUE super_class, iclass;
- ID mid;
- const rb_method_entry_t *me;
+ struct METHOD *data;
+ VALUE defined_class, super_class;
+ rb_method_entry_t *me;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- iclass = data->iclass;
- if (!iclass) return Qnil;
- super_class = RCLASS_SUPER(RCLASS_ORIGIN(iclass));
- mid = data->me->called_id;
+ defined_class = data->defined_class;
+ if (BUILTIN_TYPE(defined_class) == T_MODULE) defined_class = data->rclass;
+ super_class = RCLASS_SUPER(defined_class);
if (!super_class) return Qnil;
- me = (rb_method_entry_t *)rb_callable_method_entry_without_refinements(super_class, mid, &iclass);
+ me = rb_method_entry_without_refinements(super_class, data->id, &defined_class);
if (!me) return Qnil;
- return mnew_internal(me, me->owner, iclass, data->recv, mid, rb_obj_class(method), FALSE, FALSE);
+ return mnew_internal(me, defined_class,
+ super_class, data->recv, data->id,
+ rb_obj_class(method), FALSE, FALSE);
}
/*
@@ -2755,31 +2455,6 @@ localjump_reason(VALUE exc)
return rb_iv_get(exc, "@reason");
}
-rb_cref_t *rb_vm_cref_new_toplevel(void); /* vm.c */
-
-static const rb_env_t *
-env_clone(const rb_env_t *env, const rb_cref_t *cref)
-{
- VALUE *new_ep;
- VALUE *new_body;
- const rb_env_t *new_env;
-
- VM_ASSERT(env->ep > env->env);
- VM_ASSERT(VM_ENV_ESCAPED_P(env->ep));
-
- if (cref == NULL) {
- cref = rb_vm_cref_new_toplevel();
- }
-
- new_body = ALLOC_N(VALUE, env->env_size);
- MEMCPY(new_body, env->env, VALUE, env->env_size);
- new_ep = &new_body[env->ep - env->env];
- new_env = vm_env_new(new_ep, new_body, env->env_size, env->iseq);
- RB_OBJ_WRITE(new_env, &new_ep[VM_ENV_DATA_INDEX_ME_CREF], (VALUE)cref);
- VM_ASSERT(VM_ENV_ESCAPED_P(new_ep));
- return new_env;
-}
-
/*
* call-seq:
* prc.binding -> binding
@@ -2798,68 +2473,28 @@ env_clone(const rb_env_t *env, const rb_cref_t *cref)
static VALUE
proc_binding(VALUE self)
{
- VALUE bindval, binding_self = Qundef;
+ rb_proc_t *proc;
+ VALUE bindval;
rb_binding_t *bind;
- const rb_proc_t *proc;
- const rb_iseq_t *iseq = NULL;
- const struct rb_block *block;
- const rb_env_t *env = NULL;
GetProcPtr(self, proc);
- block = &proc->block;
-
- again:
- switch (vm_block_type(block)) {
- case block_type_iseq:
- iseq = block->as.captured.code.iseq;
- binding_self = block->as.captured.self;
- env = VM_ENV_ENVVAL_PTR(block->as.captured.ep);
- break;
- case block_type_proc:
- GetProcPtr(block->as.proc, proc);
- block = &proc->block;
- goto again;
- case block_type_symbol:
- goto error;
- case block_type_ifunc:
- {
- const struct vm_ifunc *ifunc = block->as.captured.code.ifunc;
- if (IS_METHOD_PROC_IFUNC(ifunc)) {
- VALUE method = (VALUE)ifunc->data;
- binding_self = method_receiver(method);
- iseq = rb_method_iseq(method);
- env = VM_ENV_ENVVAL_PTR(block->as.captured.ep);
- env = env_clone(env, method_cref(method));
- /* set empty iseq */
- RB_OBJ_WRITE(env, &env->iseq, rb_iseq_new(NULL, rb_str_new2("<empty iseq>"), rb_str_new2("<empty_iseq>"), Qnil, 0, ISEQ_TYPE_TOP));
- break;
- }
- else {
- error:
- rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
- return Qnil;
- }
+ if (RB_TYPE_P((VALUE)proc->block.iseq, T_NODE)) {
+ if (!IS_METHOD_PROC_NODE((NODE *)proc->block.iseq)) {
+ rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
}
}
- bindval = rb_binding_alloc(rb_cBinding);
+ bindval = binding_alloc(rb_cBinding);
GetBindingPtr(bindval, bind);
- RB_OBJ_WRITE(bindval, &bind->block.as.captured.self, binding_self);
- RB_OBJ_WRITE(bindval, &bind->block.as.captured.code.iseq, env->iseq);
- rb_vm_block_ep_update(bindval, &bind->block, env->ep);
- RB_OBJ_WRITTEN(bindval, Qundef, VM_ENV_ENVVAL(env->ep));
-
- if (iseq) {
- rb_iseq_check(iseq);
- RB_OBJ_WRITE(bindval, &bind->pathobj, iseq->body->location.pathobj);
- bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq));
+ bind->env = proc->envval;
+ if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
+ bind->path = proc->block.iseq->location.path;
+ bind->first_lineno = FIX2INT(rb_iseq_first_lineno(proc->block.iseq->self));
}
else {
- RB_OBJ_WRITE(bindval, &bind->pathobj,
- rb_iseq_pathobj_new(rb_fstring_cstr("(binding)"), Qnil));
- bind->first_lineno = 1;
+ bind->path = Qnil;
+ bind->first_lineno = 0;
}
-
return bindval;
}
@@ -2933,16 +2568,16 @@ curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc)
*
* b = lambda {|x, y, z| (x||0) + (y||0) + (z||0) }
* p b.curry[1][2][3] #=> 6
- * p b.curry[1, 2][3, 4] #=> wrong number of arguments (given 4, expected 3)
- * p b.curry(5) #=> wrong number of arguments (given 5, expected 3)
- * p b.curry(1) #=> wrong number of arguments (given 1, expected 3)
+ * p b.curry[1, 2][3, 4] #=> wrong number of arguments (4 for 3)
+ * p b.curry(5) #=> wrong number of arguments (5 for 3)
+ * p b.curry(1) #=> wrong number of arguments (1 for 3)
*
* b = lambda {|x, y, z, *w| (x||0) + (y||0) + (z||0) + w.inject(0, &:+) }
* p b.curry[1][2][3] #=> 6
* p b.curry[1, 2][3, 4] #=> 10
* p b.curry(5)[1][2][3][4][5] #=> 15
* p b.curry(5)[1, 2][3, 4][5] #=> 15
- * p b.curry(1) #=> wrong number of arguments (given 1, expected 3)
+ * p b.curry(1) #=> wrong number of arguments (1 for 3)
*
* b = proc { :foo }
* p b.curry[] #=> :foo
@@ -3002,7 +2637,7 @@ proc_curry(int argc, const VALUE *argv, VALUE self)
static VALUE
rb_method_curry(int argc, const VALUE *argv, VALUE self)
{
- VALUE proc = method_to_proc(self);
+ VALUE proc = method_proc(self);
return proc_curry(argc, argv, proc);
}
@@ -3075,22 +2710,21 @@ Init_Proc(void)
rb_undef_alloc_func(rb_cProc);
rb_define_singleton_method(rb_cProc, "new", rb_proc_s_new, -1);
+#if 0 /* incomplete. */
rb_add_method(rb_cProc, rb_intern("call"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, METHOD_VISI_PUBLIC);
+ (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
rb_add_method(rb_cProc, rb_intern("[]"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, METHOD_VISI_PUBLIC);
+ (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
rb_add_method(rb_cProc, rb_intern("==="), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, METHOD_VISI_PUBLIC);
+ (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
rb_add_method(rb_cProc, rb_intern("yield"), VM_METHOD_TYPE_OPTIMIZED,
- (void *)OPTIMIZED_METHOD_TYPE_CALL, METHOD_VISI_PUBLIC);
-
-#if 0 /* for RDoc */
+ (void *)OPTIMIZED_METHOD_TYPE_CALL, 0);
+#else
rb_define_method(rb_cProc, "call", proc_call, -1);
rb_define_method(rb_cProc, "[]", proc_call, -1);
rb_define_method(rb_cProc, "===", proc_call, -1);
rb_define_method(rb_cProc, "yield", proc_call, -1);
#endif
-
rb_define_method(rb_cProc, "to_proc", proc_to_proc, 0);
rb_define_method(rb_cProc, "arity", proc_arity, 0);
rb_define_method(rb_cProc, "clone", proc_clone, 0);
@@ -3125,13 +2759,12 @@ Init_Proc(void)
rb_define_method(rb_cMethod, "hash", method_hash, 0);
rb_define_method(rb_cMethod, "clone", method_clone, 0);
rb_define_method(rb_cMethod, "call", rb_method_call, -1);
- rb_define_method(rb_cMethod, "===", rb_method_call, -1);
rb_define_method(rb_cMethod, "curry", rb_method_curry, -1);
rb_define_method(rb_cMethod, "[]", rb_method_call, -1);
rb_define_method(rb_cMethod, "arity", method_arity_m, 0);
rb_define_method(rb_cMethod, "inspect", method_inspect, 0);
rb_define_method(rb_cMethod, "to_s", method_inspect, 0);
- rb_define_method(rb_cMethod, "to_proc", method_to_proc, 0);
+ rb_define_method(rb_cMethod, "to_proc", method_proc, 0);
rb_define_method(rb_cMethod, "receiver", method_receiver, 0);
rb_define_method(rb_cMethod, "name", method_name, 0);
rb_define_method(rb_cMethod, "original_name", method_original_name, 0);
@@ -3166,7 +2799,7 @@ Init_Proc(void)
/* Module#*_method */
rb_define_method(rb_cModule, "instance_method", rb_mod_instance_method, 1);
rb_define_method(rb_cModule, "public_instance_method", rb_mod_public_instance_method, 1);
- rb_define_method(rb_cModule, "define_method", rb_mod_define_method, -1);
+ rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1);
/* Kernel */
rb_define_method(rb_mKernel, "define_singleton_method", rb_obj_define_method, -1);
@@ -3193,7 +2826,7 @@ Init_Proc(void)
* @secret = n
* end
* def get_binding
- * binding
+ * return binding()
* end
* end
*
@@ -3226,3 +2859,4 @@ Init_Binding(void)
rb_define_method(rb_cBinding, "receiver", bind_receiver, 0);
rb_define_global_function("binding", rb_f_binding, 0);
}
+
diff --git a/process.c b/process.c
index 6c7a117c20..1ea637a412 100644
--- a/process.c
+++ b/process.c
@@ -11,10 +11,11 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "ruby/util.h"
+#include "internal.h"
#include "vm_core.h"
#include <stdio.h>
@@ -60,7 +61,15 @@
#endif
#include "ruby/st.h"
+#ifdef __EMX__
+#undef HAVE_GETPGRP
+#endif
+
#include <sys/stat.h>
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/stat.h"
+# include "nacl/unistd.h"
+#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
@@ -74,9 +83,6 @@
#endif
#ifdef HAVE_GRP_H
#include <grp.h>
-# ifdef __CYGWIN__
-int initgroups(const char *, rb_gid_t);
-# endif
#endif
#ifdef HAVE_SYS_ID_H
#include <sys/id.h>
@@ -143,9 +149,11 @@ int setregid(rb_gid_t rgid, rb_gid_t egid);
#endif
#endif
+#define preserving_errno(stmts) \
+ do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
+
static void check_uid_switch(void);
static void check_gid_switch(void);
-static int exec_async_signal_safe(const struct rb_execarg *, char *, size_t);
#if 1
#define p_uid_from_name p_uid_from_name
@@ -163,7 +171,7 @@ static int exec_async_signal_safe(const struct rb_execarg *, char *, size_t);
# define PREPARE_GETPWNAM \
VALUE getpw_buf = 0
# define FINISH_GETPWNAM \
- (getpw_buf ? (void)rb_str_resize(getpw_buf, 0) : (void)0)
+ ALLOCV_END(getpw_buf)
# define OBJ2UID1(id) obj2uid((id), &getpw_buf)
# define OBJ2UID(id) obj2uid0(id)
static rb_uid_t obj2uid(VALUE id, VALUE *getpw_buf);
@@ -205,7 +213,7 @@ static rb_uid_t obj2uid(VALUE id);
# define PREPARE_GETGRNAM \
VALUE getgr_buf = 0
# define FINISH_GETGRNAM \
- (getgr_buf ? (void)rb_str_resize(getgr_buf, 0) : (void)0)
+ ALLOCV_END(getgr_buf)
# define OBJ2GID1(id) obj2gid((id), &getgr_buf)
# define OBJ2GID(id) obj2gid0(id)
static rb_gid_t obj2gid(VALUE id, VALUE *getgr_buf);
@@ -244,159 +252,10 @@ typedef unsigned long unsigned_clock_t;
#elif defined(HAVE_LONG_LONG) && SIZEOF_CLOCK_T == SIZEOF_LONG_LONG
typedef unsigned LONG_LONG unsigned_clock_t;
#endif
-#ifndef HAVE_SIG_T
-typedef void (*sig_t) (int);
-#endif
-
-static ID id_in, id_out, id_err, id_pid, id_uid, id_gid;
-static ID id_close, id_child;
-#ifdef HAVE_SETPGID
-static ID id_pgroup;
-#endif
-#ifdef _WIN32
-static ID id_new_pgroup;
-#endif
-static ID id_unsetenv_others, id_chdir, id_umask, id_close_others, id_ENV;
-static ID id_nanosecond, id_microsecond, id_millisecond, id_second;
-static ID id_float_microsecond, id_float_millisecond, id_float_second;
-static ID id_GETTIMEOFDAY_BASED_CLOCK_REALTIME, id_TIME_BASED_CLOCK_REALTIME;
-#ifdef HAVE_TIMES
-static ID id_TIMES_BASED_CLOCK_MONOTONIC;
-static ID id_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID;
-#endif
-#ifdef RUSAGE_SELF
-static ID id_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID;
-#endif
-static ID id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID;
-#ifdef __APPLE__
-static ID id_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC;
-#endif
-static ID id_hertz;
-extern ID ruby_static_id_status;
-#define id_status ruby_static_id_status
-
-/* execv and execl are async-signal-safe since SUSv4 (POSIX.1-2008, XPG7) */
-#if defined(__sun) && !defined(_XPG7) /* Solaris 10, 9, ... */
-#define execv(path, argv) (rb_async_bug_errno("unreachable: async-signal-unsafe execv() is called", 0))
-#define execl(path, arg0, arg1, arg2, term) do { extern char **environ; execle((path), (arg0), (arg1), (arg2), (term), (environ)); } while (0)
-#define ALWAYS_NEED_ENVP 1
-#else
-#define ALWAYS_NEED_ENVP 0
-#endif
-
-static inline int
-close_unless_reserved(int fd)
-{
- /* We should not have reserved FDs at this point */
- if (rb_reserved_fd_p(fd)) { /* async-signal-safe */
- rb_async_bug_errno("BUG timer thread still running", 0 /* EDOOFUS */);
- return 0;
- }
- return close(fd); /* async-signal-safe */
-}
-
-/*#define DEBUG_REDIRECT*/
-#if defined(DEBUG_REDIRECT)
-
-#include <stdarg.h>
-
-static void
-ttyprintf(const char *fmt, ...)
-{
- va_list ap;
- FILE *tty;
- int save = errno;
-#ifdef _WIN32
- tty = fopen("con", "w");
-#else
- tty = fopen("/dev/tty", "w");
-#endif
- if (!tty)
- return;
-
- va_start(ap, fmt);
- vfprintf(tty, fmt, ap);
- va_end(ap);
- fclose(tty);
- errno = save;
-}
-
-static int
-redirect_dup(int oldfd)
-{
- int ret;
- ret = dup(oldfd);
- ttyprintf("dup(%d) => %d\n", oldfd, ret);
- return ret;
-}
-
-static int
-redirect_dup2(int oldfd, int newfd)
-{
- int ret;
- ret = dup2(oldfd, newfd);
- ttyprintf("dup2(%d, %d) => %d\n", oldfd, newfd, ret);
- return ret;
-}
-
-static int
-redirect_cloexec_dup(int oldfd)
-{
- int ret;
- ret = rb_cloexec_dup(oldfd);
- ttyprintf("cloexec_dup(%d) => %d\n", oldfd, ret);
- return ret;
-}
-
-static int
-redirect_cloexec_dup2(int oldfd, int newfd)
-{
- int ret;
- ret = rb_cloexec_dup2(oldfd, newfd);
- ttyprintf("cloexec_dup2(%d, %d) => %d\n", oldfd, newfd, ret);
- return ret;
-}
-
-static int
-redirect_close(int fd)
-{
- int ret;
- ret = close_unless_reserved(fd);
- ttyprintf("close(%d) => %d\n", fd, ret);
- return ret;
-}
-
-static int
-parent_redirect_open(const char *pathname, int flags, mode_t perm)
-{
- int ret;
- ret = rb_cloexec_open(pathname, flags, perm);
- ttyprintf("parent_open(\"%s\", 0x%x, 0%o) => %d\n", pathname, flags, perm, ret);
- return ret;
-}
-
-static int
-parent_redirect_close(int fd)
-{
- int ret;
- ret = close_unless_reserved(fd);
- ttyprintf("parent_close(%d) => %d\n", fd, ret);
- return ret;
-}
-
-#else
-#define redirect_dup(oldfd) dup(oldfd)
-#define redirect_dup2(oldfd, newfd) dup2((oldfd), (newfd))
-#define redirect_cloexec_dup(oldfd) rb_cloexec_dup(oldfd)
-#define redirect_cloexec_dup2(oldfd, newfd) rb_cloexec_dup2((oldfd), (newfd))
-#define redirect_close(fd) close_unless_reserved(fd)
-#define parent_redirect_open(pathname, flags, perm) rb_cloexec_open((pathname), (flags), (perm))
-#define parent_redirect_close(fd) close_unless_reserved(fd)
-#endif
/*
* call-seq:
- * Process.pid -> integer
+ * Process.pid -> fixnum
*
* Returns the process id of this process. Not available on all
* platforms.
@@ -407,13 +266,14 @@ parent_redirect_close(int fd)
static VALUE
get_pid(void)
{
+ rb_secure(2);
return PIDT2NUM(getpid());
}
/*
* call-seq:
- * Process.ppid -> integer
+ * Process.ppid -> fixnum
*
* Returns the process id of the parent of this process. Returns
* untrustworthy value on Win32/64. Not available on all platforms.
@@ -430,6 +290,7 @@ get_pid(void)
static VALUE
get_ppid(void)
{
+ rb_secure(2);
return PIDT2NUM(getppid());
}
@@ -472,34 +333,13 @@ rb_last_status_get(void)
return GET_THREAD()->last_status;
}
-/*
- * call-seq:
- * Process.last_status -> Process::Status or nil
- *
- * Returns the status of the last executed child process in the
- * current thread.
- *
- * Process.wait Process.spawn("ruby", "-e", "exit 13")
- * Process.last_status #=> #<Process::Status: pid 4825 exit 13>
- *
- * If no child process has ever been executed in the current
- * thread, this returns +nil+.
- *
- * Process.last_status #=> nil
- */
-static VALUE
-proc_s_last_status(VALUE mod)
-{
- return rb_last_status_get();
-}
-
void
rb_last_status_set(int status, rb_pid_t pid)
{
rb_thread_t *th = GET_THREAD();
th->last_status = rb_obj_alloc(rb_cProcessStatus);
- rb_ivar_set(th->last_status, id_status, INT2FIX(status));
- rb_ivar_set(th->last_status, id_pid, PIDT2NUM(pid));
+ rb_iv_set(th->last_status, "status", INT2FIX(status));
+ rb_iv_set(th->last_status, "pid", PIDT2NUM(pid));
}
void
@@ -510,10 +350,10 @@ rb_last_status_clear(void)
/*
* call-seq:
- * stat.to_i -> integer
- * stat.to_int -> integer
+ * stat.to_i -> fixnum
+ * stat.to_int -> fixnum
*
- * Returns the bits in _stat_ as a <code>Integer</code>. Poking
+ * Returns the bits in _stat_ as a <code>Fixnum</code>. Poking
* around in these bits is platform dependent.
*
* fork { exit 0xab } #=> 26566
@@ -524,14 +364,14 @@ rb_last_status_clear(void)
static VALUE
pst_to_i(VALUE st)
{
- return rb_ivar_get(st, id_status);
+ return rb_iv_get(st, "status");
}
#define PST2INT(st) NUM2INT(pst_to_i(st))
/*
* call-seq:
- * stat.pid -> integer
+ * stat.pid -> fixnum
*
* Returns the process ID that this status object represents.
*
@@ -543,7 +383,7 @@ pst_to_i(VALUE st)
static VALUE
pst_pid(VALUE st)
{
- return rb_attr_get(st, id_pid);
+ return rb_attr_get(st, rb_intern("pid"));
}
static void
@@ -658,7 +498,7 @@ pst_equal(VALUE st1, VALUE st2)
/*
* call-seq:
- * stat & num -> integer
+ * stat & num -> fixnum
*
* Logical AND of the bits in _stat_ with <em>num</em>.
*
@@ -679,7 +519,7 @@ pst_bitand(VALUE st1, VALUE st2)
/*
* call-seq:
- * stat >> num -> integer
+ * stat >> num -> fixnum
*
* Shift the bits in _stat_ right <em>num</em> places.
*
@@ -721,7 +561,7 @@ pst_wifstopped(VALUE st)
/*
* call-seq:
- * stat.stopsig -> integer or nil
+ * stat.stopsig -> fixnum or nil
*
* Returns the number of the signal that caused _stat_ to stop
* (or +nil+ if self is not stopped).
@@ -760,7 +600,7 @@ pst_wifsignaled(VALUE st)
/*
* call-seq:
- * stat.termsig -> integer or nil
+ * stat.termsig -> fixnum or nil
*
* Returns the number of the signal that caused _stat_ to
* terminate (or +nil+ if self was not terminated by an
@@ -801,7 +641,7 @@ pst_wifexited(VALUE st)
/*
* call-seq:
- * stat.exitstatus -> integer or nil
+ * stat.exitstatus -> fixnum or nil
*
* Returns the least significant eight bits of the return code of
* _stat_. Only available if <code>exited?</code> is
@@ -871,59 +711,121 @@ pst_wcoredump(VALUE st)
#endif
}
-struct waitpid_arg {
+#if !defined(HAVE_WAITPID) && !defined(HAVE_WAIT4)
+#define NO_WAITPID
+static st_table *pid_tbl;
+
+struct wait_data {
rb_pid_t pid;
- int flags;
- int *st;
+ int status;
};
-static rb_pid_t
-do_waitpid(rb_pid_t pid, int *st, int flags)
+static int
+wait_each(rb_pid_t pid, int status, struct wait_data *data)
{
-#if defined HAVE_WAITPID
- return waitpid(pid, st, flags);
-#elif defined HAVE_WAIT4
- return wait4(pid, st, flags, NULL);
+ if (data->status != -1) return ST_STOP;
+
+ data->pid = pid;
+ data->status = status;
+ return ST_DELETE;
+}
+
+static int
+waitall_each(rb_pid_t pid, int status, VALUE ary)
+{
+ rb_last_status_set(status, pid);
+ rb_ary_push(ary, rb_assoc_new(PIDT2NUM(pid), rb_last_status_get()));
+ return ST_DELETE;
+}
#else
-# error waitpid or wait4 is required.
+struct waitpid_arg {
+ rb_pid_t pid;
+ int flags;
+ int *st;
+};
#endif
-}
static void *
rb_waitpid_blocking(void *data)
{
+ rb_pid_t result;
+#ifndef NO_WAITPID
struct waitpid_arg *arg = data;
- rb_pid_t result = do_waitpid(arg->pid, arg->st, arg->flags);
+#endif
+
+#if defined NO_WAITPID
+ result = wait(data);
+#elif defined HAVE_WAITPID
+ result = waitpid(arg->pid, arg->st, arg->flags);
+#else /* HAVE_WAIT4 */
+ result = wait4(arg->pid, arg->st, arg->flags, NULL);
+#endif
+
return (void *)(VALUE)result;
}
-static rb_pid_t
-do_waitpid_nonblocking(rb_pid_t pid, int *st, int flags)
+rb_pid_t
+rb_waitpid(rb_pid_t pid, int *st, int flags)
{
- void *result;
+ rb_pid_t result;
+#ifndef NO_WAITPID
struct waitpid_arg arg;
+
+ retry:
arg.pid = pid;
arg.st = st;
arg.flags = flags;
- result = rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
- RUBY_UBF_PROCESS, 0);
- return (rb_pid_t)(VALUE)result;
-}
-
-rb_pid_t
-rb_waitpid(rb_pid_t pid, int *st, int flags)
-{
- rb_pid_t result;
+ result = (rb_pid_t)(VALUE)rb_thread_call_without_gvl(rb_waitpid_blocking, &arg,
+ RUBY_UBF_PROCESS, 0);
+ if (result < 0) {
+ if (errno == EINTR) {
+ RUBY_VM_CHECK_INTS(GET_THREAD());
+ goto retry;
+ }
+ return (rb_pid_t)-1;
+ }
+#else /* NO_WAITPID */
+ if (pid_tbl) {
+ st_data_t status, piddata = (st_data_t)pid;
+ if (pid == (rb_pid_t)-1) {
+ struct wait_data data;
+ data.pid = (rb_pid_t)-1;
+ data.status = -1;
+ st_foreach(pid_tbl, wait_each, (st_data_t)&data);
+ if (data.status != -1) {
+ rb_last_status_set(data.status, data.pid);
+ return data.pid;
+ }
+ }
+ else if (st_delete(pid_tbl, &piddata, &status)) {
+ rb_last_status_set(*st = (int)status, pid);
+ return pid;
+ }
+ }
- if (flags & WNOHANG) {
- result = do_waitpid(pid, st, flags);
+ if (flags) {
+ rb_raise(rb_eArgError, "can't do waitpid with flags");
}
- else {
- while ((result = do_waitpid_nonblocking(pid, st, flags)) < 0 &&
- (errno == EINTR)) {
- RUBY_VM_CHECK_INTS(GET_EC());
+
+ for (;;) {
+ result = (rb_pid_t)(VALUE)rb_thread_blocking_region(rb_waitpid_blocking,
+ st, RUBY_UBF_PROCESS, 0);
+ if (result < 0) {
+ if (errno == EINTR) {
+ rb_thread_schedule();
+ continue;
+ }
+ return (rb_pid_t)-1;
}
+ if (result == pid || pid == (rb_pid_t)-1) {
+ break;
+ }
+ if (!pid_tbl)
+ pid_tbl = st_init_numtable();
+ st_insert(pid_tbl, pid, (st_data_t)st);
+ if (!rb_thread_alone()) rb_thread_schedule();
}
+#endif
if (result > 0) {
rb_last_status_set(*st, result);
}
@@ -947,9 +849,9 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
/*
* call-seq:
- * Process.wait() -> integer
- * Process.wait(pid=-1, flags=0) -> integer
- * Process.waitpid(pid=-1, flags=0) -> integer
+ * Process.wait() -> fixnum
+ * Process.wait(pid=-1, flags=0) -> fixnum
+ * Process.waitpid(pid=-1, flags=0) -> fixnum
*
* Waits for a child process to exit, returns its process id, and
* sets <code>$?</code> to a <code>Process::Status</code> object
@@ -992,17 +894,19 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
static VALUE
proc_wait(int argc, VALUE *argv)
{
+ VALUE vpid, vflags;
rb_pid_t pid;
int flags, status;
+ rb_secure(2);
flags = 0;
- if (rb_check_arity(argc, 0, 2) == 0) {
+ if (argc == 0) {
pid = -1;
}
else {
- VALUE vflags;
- pid = NUM2PIDT(argv[0]);
- if (argc == 2 && !NIL_P(vflags = argv[1])) {
+ rb_scan_args(argc, argv, "02", &vpid, &vflags);
+ pid = NUM2PIDT(vpid);
+ if (argc == 2 && !NIL_P(vflags)) {
flags = NUM2UINT(vflags);
}
}
@@ -1068,17 +972,36 @@ proc_waitall(void)
rb_pid_t pid;
int status;
+ rb_secure(2);
result = rb_ary_new();
+#ifdef NO_WAITPID
+ if (pid_tbl) {
+ st_foreach(pid_tbl, waitall_each, result);
+ }
+#else
rb_last_status_clear();
+#endif
for (pid = -1;;) {
+#ifdef NO_WAITPID
+ pid = wait(&status);
+#else
pid = rb_waitpid(-1, &status, 0);
+#endif
if (pid == -1) {
- int e = errno;
- if (e == ECHILD)
+ if (errno == ECHILD)
break;
- rb_syserr_fail(e, 0);
+#ifdef NO_WAITPID
+ if (errno == EINTR) {
+ rb_thread_schedule();
+ continue;
+ }
+#endif
+ rb_sys_fail(0);
}
+#ifdef NO_WAITPID
+ rb_last_status_set(status, pid);
+#endif
rb_ary_push(result, rb_assoc_new(PIDT2NUM(pid), rb_last_status_get()));
}
return result;
@@ -1086,10 +1009,18 @@ proc_waitall(void)
static VALUE rb_cWaiter;
+static inline ID
+id_pid(void)
+{
+ ID pid;
+ CONST_ID(pid, "pid");
+ return pid;
+}
+
static VALUE
detach_process_pid(VALUE thread)
{
- return rb_thread_local_aref(thread, id_pid);
+ return rb_thread_local_aref(thread, id_pid());
}
static VALUE
@@ -1108,7 +1039,7 @@ VALUE
rb_detach_process(rb_pid_t pid)
{
VALUE watcher = rb_thread_create(detach_process_watcher, (void*)(VALUE)pid);
- rb_thread_local_aset(watcher, id_pid, PIDT2NUM(pid));
+ rb_thread_local_aset(watcher, id_pid(), PIDT2NUM(pid));
RBASIC_SET_CLASS(watcher, rb_cWaiter);
return watcher;
}
@@ -1120,12 +1051,12 @@ rb_detach_process(rb_pid_t pid)
*
* Some operating systems retain the status of terminated child
* processes until the parent collects that status (normally using
- * some variant of <code>wait()</code>). If the parent never collects
+ * some variant of <code>wait()</code>. If the parent never collects
* this status, the child stays around as a <em>zombie</em> process.
* <code>Process::detach</code> prevents this by setting up a
* separate Ruby thread whose sole job is to reap the status of the
* process _pid_ when it terminates. Use <code>detach</code>
- * only when you do not intend to explicitly wait for the child to
+ * only when you do not intent to explicitly wait for the child to
* terminate.
*
* The waiting thread returns the exit status of the detached process
@@ -1164,17 +1095,38 @@ rb_detach_process(rb_pid_t pid)
static VALUE
proc_detach(VALUE obj, VALUE pid)
{
+ rb_secure(2);
return rb_detach_process(NUM2PIDT(pid));
}
+#ifdef SIGPIPE
+static RETSIGTYPE (*saved_sigpipe_handler)(int) = 0;
+#endif
+
+#ifdef SIGPIPE
+static RETSIGTYPE
+sig_do_nothing(int sig)
+{
+}
+#endif
+
/* This function should be async-signal-safe. Actually it is. */
static void
before_exec_async_signal_safe(void)
{
+#ifdef SIGPIPE
+ /*
+ * Some OS commands don't initialize signal handler properly. Thus we have
+ * to reset signal handler before exec(). Otherwise, system() and similar
+ * child process interaction might fail. (e.g. ruby -e "system 'yes | ls'")
+ * [ruby-dev:12261]
+ */
+ saved_sigpipe_handler = signal(SIGPIPE, sig_do_nothing); /* async-signal-safe */
+#endif
}
static void
-before_exec_non_async_signal_safe(void)
+before_exec_non_async_signal_safe()
{
/*
* On Mac OS X 10.5.x (Leopard) or earlier, exec() may return ENOTSUP
@@ -1182,14 +1134,12 @@ before_exec_non_async_signal_safe(void)
* internal threads temporary. [ruby-core:10583]
* This is also true on Haiku. It returns Errno::EPERM against exec()
* in multiple threads.
- *
- * Nowadays, we always stop the timer thread completely to allow redirects.
*/
- rb_thread_stop_timer_thread();
+ rb_thread_stop_timer_thread(0);
}
static void
-before_exec(void)
+before_exec()
{
before_exec_non_async_signal_safe();
before_exec_async_signal_safe();
@@ -1199,6 +1149,9 @@ before_exec(void)
static void
after_exec_async_signal_safe(void)
{
+#ifdef SIGPIPE
+ signal(SIGPIPE, saved_sigpipe_handler); /* async-signal-safe */
+#endif
}
static void
@@ -1230,10 +1183,10 @@ security(const char *str)
}
}
-#if defined(HAVE_WORKING_FORK)
+#if defined(HAVE_WORKING_FORK) && !defined(__native_client__)
/* try_with_sh and exec_with_sh should be async-signal-safe. Actually it is.*/
-#define try_with_sh(err, prog, argv, envp) ((err == ENOEXEC) ? exec_with_sh((prog), (argv), (envp)) : (void)0)
+#define try_with_sh(prog, argv, envp) ((saved_errno == ENOEXEC) ? exec_with_sh((prog), (argv), (envp)) : (void)0)
static void
exec_with_sh(const char *prog, char **argv, char **envp)
{
@@ -1242,7 +1195,7 @@ exec_with_sh(const char *prog, char **argv, char **envp)
if (envp)
execve("/bin/sh", argv, envp); /* async-signal-safe */
else
- execv("/bin/sh", argv); /* async-signal-safe (since SUSv4) */
+ execv("/bin/sh", argv); /* async-signal-safe */
}
#else
@@ -1253,30 +1206,64 @@ exec_with_sh(const char *prog, char **argv, char **envp)
static int
proc_exec_cmd(const char *prog, VALUE argv_str, VALUE envp_str)
{
+#ifdef __native_client__
+ rb_notimplement();
+ UNREACHABLE;
+#else
char **argv;
-#ifndef _WIN32
char **envp;
- int err;
-#endif
+# if defined(__EMX__) || defined(OS2)
+ char **new_argv = NULL;
+# endif
argv = ARGVSTR2ARGV(argv_str);
if (!prog) {
- return ENOENT;
+ errno = ENOENT;
+ return -1;
}
-#ifdef _WIN32
- rb_w32_uaspawn(P_OVERLAY, prog, argv);
- return errno;
-#else
+# if defined(__EMX__) || defined(OS2)
+ {
+# define COMMAND "cmd.exe"
+ char *extension;
+
+ if ((extension = strrchr(prog, '.')) != NULL && STRCASECMP(extension, ".bat") == 0) {
+ char *p;
+ int n;
+
+ for (n = 0; argv[n]; n++)
+ /* no-op */;
+ new_argv = ALLOC_N(char*, n + 2);
+ for (; n > 0; n--)
+ new_argv[n + 1] = argv[n];
+ new_argv[1] = strcpy(ALLOC_N(char, strlen(argv[0]) + 1), argv[0]);
+ for (p = new_argv[1]; *p != '\0'; p++)
+ if (*p == '/')
+ *p = '\\';
+ new_argv[0] = COMMAND;
+ argv = new_argv;
+ prog = dln_find_exe_r(argv[0], 0, fbuf, sizeof(fbuf));
+ if (!prog) {
+ errno = ENOENT;
+ return -1;
+ }
+ }
+ }
+# endif /* __EMX__ */
envp = envp_str ? (char **)RSTRING_PTR(envp_str) : NULL;
if (envp_str)
execve(prog, argv, envp); /* async-signal-safe */
else
- execv(prog, argv); /* async-signal-safe (since SUSv4) */
- err = errno;
- try_with_sh(err, prog, argv, envp); /* try_with_sh() is async-signal-safe. */
- return err;
+ execv(prog, argv); /* async-signal-safe */
+ preserving_errno(try_with_sh(prog, argv, envp)); /* try_with_sh() is async-signal-safe. */
+# if defined(__EMX__) || defined(OS2)
+ if (new_argv) {
+ xfree(new_argv[0]);
+ xfree(new_argv);
+ }
+# endif
+ return -1;
#endif
}
@@ -1284,6 +1271,10 @@ proc_exec_cmd(const char *prog, VALUE argv_str, VALUE envp_str)
static int
proc_exec_sh(const char *str, VALUE envp_str)
{
+#ifdef __native_client__
+ rb_notimplement();
+ UNREACHABLE;
+#else
const char *s;
s = str;
@@ -1291,12 +1282,15 @@ proc_exec_sh(const char *str, VALUE envp_str)
s++;
if (!*s) {
- return ENOENT;
+ errno = ENOENT;
+ return -1;
}
#ifdef _WIN32
rb_w32_uspawn(P_OVERLAY, (char *)str, 0);
-#elif defined(__CYGWIN32__)
+ return -1;
+#else
+#if defined(__CYGWIN32__) || defined(__EMX__)
{
char fbuf[MAXPATHLEN];
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
@@ -1312,9 +1306,11 @@ proc_exec_sh(const char *str, VALUE envp_str)
if (envp_str)
execle("/bin/sh", "sh", "-c", str, (char *)NULL, (char **)RSTRING_PTR(envp_str)); /* async-signal-safe */
else
- execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe (since SUSv4) */
+ execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe */
+#endif
+ return -1;
#endif /* _WIN32 */
- return errno;
+#endif
}
int
@@ -1323,9 +1319,8 @@ rb_proc_exec(const char *str)
int ret;
before_exec();
ret = proc_exec_sh(str, Qfalse);
- after_exec();
- errno = ret;
- return -1;
+ preserving_errno(after_exec());
+ return ret;
}
static void
@@ -1350,7 +1345,6 @@ mark_exec_arg(void *ptr)
rb_gc_mark(eargp->fd_open);
rb_gc_mark(eargp->fd_dup2_child);
rb_gc_mark(eargp->env_modification);
- rb_gc_mark(eargp->path_env);
rb_gc_mark(eargp->chdir_dir);
}
@@ -1363,7 +1357,7 @@ memsize_exec_arg(const void *ptr)
static const rb_data_type_t exec_arg_data_type = {
"exec_arg",
{mark_exec_arg, RUBY_TYPED_DEFAULT_FREE, memsize_exec_arg},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
#ifdef _WIN32
@@ -1476,17 +1470,17 @@ check_exec_redirect_fd(VALUE v, int iskey)
fd = FIX2INT(v);
}
else if (SYMBOL_P(v)) {
- ID id = rb_check_id(&v);
- if (id == id_in)
+ ID id = SYM2ID(v);
+ if (id == rb_intern("in"))
fd = 0;
- else if (id == id_out)
+ else if (id == rb_intern("out"))
fd = 1;
- else if (id == id_err)
+ else if (id == rb_intern("err"))
fd = 2;
else
goto wrong;
}
- else if (!NIL_P(tmp = rb_check_convert_type_with_id(v, T_FILE, "IO", idTo_io))) {
+ else if (!NIL_P(tmp = rb_check_convert_type(v, T_FILE, "IO", "to_io"))) {
rb_io_t *fptr;
GetOpenFile(tmp, fptr);
if (fptr->tied_io_for_writing)
@@ -1540,27 +1534,26 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp)
switch (TYPE(val)) {
case T_SYMBOL:
- if (!(id = rb_check_id(&val))) goto wrong_symbol;
- if (id == id_close) {
+ id = SYM2ID(val);
+ if (id == rb_intern("close")) {
param = Qnil;
eargp->fd_close = check_exec_redirect1(eargp->fd_close, key, param);
}
- else if (id == id_in) {
+ else if (id == rb_intern("in")) {
param = INT2FIX(0);
eargp->fd_dup2 = check_exec_redirect1(eargp->fd_dup2, key, param);
}
- else if (id == id_out) {
+ else if (id == rb_intern("out")) {
param = INT2FIX(1);
eargp->fd_dup2 = check_exec_redirect1(eargp->fd_dup2, key, param);
}
- else if (id == id_err) {
+ else if (id == rb_intern("err")) {
param = INT2FIX(2);
eargp->fd_dup2 = check_exec_redirect1(eargp->fd_dup2, key, param);
}
else {
- wrong_symbol:
- rb_raise(rb_eArgError, "wrong exec redirect symbol: %"PRIsVALUE,
- val);
+ rb_raise(rb_eArgError, "wrong exec redirect symbol: %s",
+ rb_id2name(id));
}
break;
@@ -1576,7 +1569,7 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp)
case T_ARRAY:
path = rb_ary_entry(val, 0);
if (RARRAY_LEN(val) == 2 && SYMBOL_P(path) &&
- path == ID2SYM(id_child)) {
+ SYM2ID(path) == rb_intern("child")) {
param = check_exec_redirect_fd(rb_ary_entry(val, 1), 0);
eargp->fd_dup2_child = check_exec_redirect1(eargp->fd_dup2_child, key, param);
}
@@ -1591,8 +1584,8 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp)
flags = rb_to_int(flags);
perm = rb_ary_entry(val, 2);
perm = NIL_P(perm) ? INT2FIX(0644) : rb_to_int(perm);
- param = hide_obj(rb_ary_new3(4, hide_obj(EXPORT_DUP(path)),
- flags, perm, Qnil));
+ param = hide_obj(rb_ary_new3(3, hide_obj(EXPORT_DUP(path)),
+ flags, perm));
eargp->fd_open = check_exec_redirect1(eargp->fd_open, key, param);
}
break;
@@ -1619,8 +1612,8 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp)
else
flags = INT2NUM(O_RDONLY);
perm = INT2FIX(0644);
- param = hide_obj(rb_ary_new3(4, hide_obj(EXPORT_DUP(path)),
- flags, perm, Qnil));
+ param = hide_obj(rb_ary_new3(3, hide_obj(EXPORT_DUP(path)),
+ flags, perm));
eargp->fd_open = check_exec_redirect1(eargp->fd_open, key, param);
break;
@@ -1634,35 +1627,7 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp)
}
#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
-static int rlimit_type_by_sym(VALUE key);
-
-static void
-rb_execarg_addopt_rlimit(struct rb_execarg *eargp, int rtype, VALUE val)
-{
- VALUE ary = eargp->rlimit_limits;
- VALUE tmp, softlim, hardlim;
- if (eargp->rlimit_limits == Qfalse)
- ary = eargp->rlimit_limits = hide_obj(rb_ary_new());
- else
- ary = eargp->rlimit_limits;
- tmp = rb_check_array_type(val);
- if (!NIL_P(tmp)) {
- if (RARRAY_LEN(tmp) == 1)
- softlim = hardlim = rb_to_int(rb_ary_entry(tmp, 0));
- else if (RARRAY_LEN(tmp) == 2) {
- softlim = rb_to_int(rb_ary_entry(tmp, 0));
- hardlim = rb_to_int(rb_ary_entry(tmp, 1));
- }
- else {
- rb_raise(rb_eArgError, "wrong exec rlimit option");
- }
- }
- else {
- softlim = hardlim = rb_to_int(val);
- }
- tmp = hide_obj(rb_ary_new3(3, INT2NUM(rtype), softlim, hardlim));
- rb_ary_push(ary, tmp);
-}
+static int rlimit_type_by_lname(const char *name);
#endif
int
@@ -1671,22 +1636,17 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
struct rb_execarg *eargp = rb_execarg_get(execarg_obj);
ID id;
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
+ int rtype;
+#endif
+
+ rb_secure(2);
switch (TYPE(key)) {
case T_SYMBOL:
-#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
- {
- int rtype = rlimit_type_by_sym(key);
- if (rtype != -1) {
- rb_execarg_addopt_rlimit(eargp, rtype, val);
- RB_GC_GUARD(execarg_obj);
- return ST_CONTINUE;
- }
- }
-#endif
- if (!(id = rb_check_id(&key))) return ST_STOP;
+ id = SYM2ID(key);
#ifdef HAVE_SETPGID
- if (id == id_pgroup) {
+ if (id == rb_intern("pgroup")) {
rb_pid_t pgroup;
if (eargp->pgroup_given) {
rb_raise(rb_eArgError, "pgroup option specified twice");
@@ -1707,7 +1667,7 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
else
#endif
#ifdef _WIN32
- if (id == id_new_pgroup) {
+ if (id == rb_intern("new_pgroup")) {
if (eargp->new_pgroup_given) {
rb_raise(rb_eArgError, "new_pgroup option specified twice");
}
@@ -1716,23 +1676,51 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
}
else
#endif
- if (id == id_unsetenv_others) {
+#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
+ if (strncmp("rlimit_", rb_id2name(id), 7) == 0 &&
+ (rtype = rlimit_type_by_lname(rb_id2name(id)+7)) != -1) {
+ VALUE ary = eargp->rlimit_limits;
+ VALUE tmp, softlim, hardlim;
+ if (eargp->rlimit_limits == Qfalse)
+ ary = eargp->rlimit_limits = hide_obj(rb_ary_new());
+ else
+ ary = eargp->rlimit_limits;
+ tmp = rb_check_array_type(val);
+ if (!NIL_P(tmp)) {
+ if (RARRAY_LEN(tmp) == 1)
+ softlim = hardlim = rb_to_int(rb_ary_entry(tmp, 0));
+ else if (RARRAY_LEN(tmp) == 2) {
+ softlim = rb_to_int(rb_ary_entry(tmp, 0));
+ hardlim = rb_to_int(rb_ary_entry(tmp, 1));
+ }
+ else {
+ rb_raise(rb_eArgError, "wrong exec rlimit option");
+ }
+ }
+ else {
+ softlim = hardlim = rb_to_int(val);
+ }
+ tmp = hide_obj(rb_ary_new3(3, INT2NUM(rtype), softlim, hardlim));
+ rb_ary_push(ary, tmp);
+ }
+ else
+#endif
+ if (id == rb_intern("unsetenv_others")) {
if (eargp->unsetenv_others_given) {
rb_raise(rb_eArgError, "unsetenv_others option specified twice");
}
eargp->unsetenv_others_given = 1;
eargp->unsetenv_others_do = RTEST(val) ? 1 : 0;
}
- else if (id == id_chdir) {
+ else if (id == rb_intern("chdir")) {
if (eargp->chdir_given) {
rb_raise(rb_eArgError, "chdir option specified twice");
}
FilePathValue(val);
- val = rb_str_encode_ospath(val);
eargp->chdir_given = 1;
eargp->chdir_dir = hide_obj(EXPORT_DUP(val));
}
- else if (id == id_umask) {
+ else if (id == rb_intern("umask")) {
mode_t cmask = NUM2MODET(val);
if (eargp->umask_given) {
rb_raise(rb_eArgError, "umask option specified twice");
@@ -1740,26 +1728,26 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
eargp->umask_given = 1;
eargp->umask_mask = cmask;
}
- else if (id == id_close_others) {
+ else if (id == rb_intern("close_others")) {
if (eargp->close_others_given) {
rb_raise(rb_eArgError, "close_others option specified twice");
}
eargp->close_others_given = 1;
eargp->close_others_do = RTEST(val) ? 1 : 0;
}
- else if (id == id_in) {
+ else if (id == rb_intern("in")) {
key = INT2FIX(0);
goto redirect;
}
- else if (id == id_out) {
+ else if (id == rb_intern("out")) {
key = INT2FIX(1);
goto redirect;
}
- else if (id == id_err) {
+ else if (id == rb_intern("err")) {
key = INT2FIX(2);
goto redirect;
}
- else if (id == id_uid) {
+ else if (id == rb_intern("uid")) {
#ifdef HAVE_SETUID
if (eargp->uid_given) {
rb_raise(rb_eArgError, "uid option specified twice");
@@ -1774,7 +1762,7 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
"uid option is unimplemented on this machine");
#endif
}
- else if (id == id_gid) {
+ else if (id == rb_intern("gid")) {
#ifdef HAVE_SETGID
if (eargp->gid_given) {
rb_raise(rb_eArgError, "gid option specified twice");
@@ -1817,7 +1805,7 @@ check_exec_options_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
VALUE execarg_obj = (VALUE)arg;
if (rb_execarg_addopt(execarg_obj, key, val) != ST_CONTINUE) {
if (SYMBOL_P(key))
- rb_raise(rb_eArgError, "wrong exec option symbol: % "PRIsVALUE,
+ rb_raise(rb_eArgError, "wrong exec option symbol: %"PRIsVALUE,
key);
rb_raise(rb_eArgError, "wrong exec option");
}
@@ -1851,7 +1839,7 @@ check_exec_fds_1(struct rb_execarg *eargp, VALUE h, int maxhint, VALUE ary)
if (RTEST(rb_hash_lookup(h, INT2FIX(fd)))) {
rb_raise(rb_eArgError, "fd %d specified twice", fd);
}
- if (ary == eargp->fd_dup2)
+ if (ary == eargp->fd_open || ary == eargp->fd_dup2)
rb_hash_aset(h, INT2FIX(fd), Qtrue);
else if (ary == eargp->fd_dup2_child)
rb_hash_aset(h, INT2FIX(fd), RARRAY_AREF(elt, 1));
@@ -1879,6 +1867,7 @@ check_exec_fds(struct rb_execarg *eargp)
maxhint = check_exec_fds_1(eargp, h, maxhint, eargp->fd_dup2);
maxhint = check_exec_fds_1(eargp, h, maxhint, eargp->fd_close);
+ maxhint = check_exec_fds_1(eargp, h, maxhint, eargp->fd_open);
maxhint = check_exec_fds_1(eargp, h, maxhint, eargp->fd_dup2_child);
if (eargp->fd_dup2_child) {
@@ -1936,19 +1925,12 @@ rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash)
return args[1];
}
-#ifdef ENV_IGNORECASE
-#define ENVMATCH(s1, s2) (STRCASECMP((s1), (s2)) == 0)
-#else
-#define ENVMATCH(n1, n2) (strcmp((n1), (n2)) == 0)
-#endif
-
static int
check_exec_env_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
{
VALUE key = (VALUE)st_key;
VALUE val = (VALUE)st_val;
- VALUE env = ((VALUE *)arg)[0];
- VALUE *path = &((VALUE *)arg)[1];
+ VALUE env = (VALUE)arg;
char *k;
k = StringValueCStr(key);
@@ -1961,25 +1943,20 @@ check_exec_env_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
key = EXPORT_STR(key);
if (!NIL_P(val)) val = EXPORT_STR(val);
- if (ENVMATCH(k, PATH_ENV)) {
- *path = val;
- }
rb_ary_push(env, hide_obj(rb_assoc_new(key, val)));
return ST_CONTINUE;
}
static VALUE
-rb_check_exec_env(VALUE hash, VALUE *path)
+rb_check_exec_env(VALUE hash)
{
- VALUE env[2];
+ VALUE env;
- env[0] = hide_obj(rb_ary_new());
- env[1] = Qfalse;
+ env = hide_obj(rb_ary_new());
st_foreach(rb_hash_tbl_raw(hash), check_exec_env_i, (st_data_t)env);
- *path = env[1];
- return env[0];
+ return env;
}
static VALUE
@@ -2014,24 +1991,12 @@ rb_check_argv(int argc, VALUE *argv)
}
static VALUE
-check_hash(VALUE obj)
-{
- if (RB_SPECIAL_CONST_P(obj)) return Qnil;
- switch (RB_BUILTIN_TYPE(obj)) {
- case T_STRING:
- case T_ARRAY:
- return Qnil;
- }
- return rb_check_hash_type(obj);
-}
-
-static VALUE
rb_exec_getargs(int *argc_p, VALUE **argv_p, int accept_shell, VALUE *env_ret, VALUE *opthash_ret)
{
VALUE hash, prog;
if (0 < *argc_p) {
- hash = check_hash((*argv_p)[*argc_p-1]);
+ hash = rb_check_hash_type((*argv_p)[*argc_p-1]);
if (!NIL_P(hash)) {
*opthash_ret = hash;
(*argc_p)--;
@@ -2039,7 +2004,7 @@ rb_exec_getargs(int *argc_p, VALUE **argv_p, int accept_shell, VALUE *env_ret, V
}
if (0 < *argc_p) {
- hash = check_hash((*argv_p)[0]);
+ hash = rb_check_hash_type((*argv_p)[0]);
if (!NIL_P(hash)) {
*env_ret = hash;
(*argc_p)--;
@@ -2085,7 +2050,7 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, VAL
rb_check_exec_options(opthash, execarg_obj);
}
if (!NIL_P(env)) {
- env = rb_check_exec_env(env, &eargp->path_env);
+ env = rb_check_exec_env(env);
eargp->env_modification = env;
}
@@ -2209,10 +2174,7 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, VAL
if (!eargp->use_shell) {
const char *abspath;
- const char *path_env = 0;
- if (RTEST(eargp->path_env)) path_env = RSTRING_PTR(eargp->path_env);
- abspath = dln_find_exe_r(RSTRING_PTR(eargp->invoke.cmd.command_name),
- path_env, fbuf, sizeof(fbuf));
+ abspath = dln_find_exe_r(RSTRING_PTR(eargp->invoke.cmd.command_name), 0, fbuf, sizeof(fbuf));
if (abspath)
eargp->invoke.cmd.command_abspath = rb_str_new_cstr(abspath);
else
@@ -2258,7 +2220,8 @@ rb_execarg_new(int argc, const VALUE *argv, int accept_shell)
{
VALUE execarg_obj;
struct rb_execarg *eargp;
- execarg_obj = TypedData_Make_Struct(0, struct rb_execarg, &exec_arg_data_type, eargp);
+ execarg_obj = TypedData_Make_Struct(rb_cData, struct rb_execarg, &exec_arg_data_type, eargp);
+ hide_obj(execarg_obj);
rb_execarg_init(argc, argv, accept_shell, execarg_obj);
return execarg_obj;
}
@@ -2292,7 +2255,7 @@ void
rb_execarg_setenv(VALUE execarg_obj, VALUE env)
{
struct rb_execarg *eargp = rb_execarg_get(execarg_obj);
- env = !NIL_P(env) ? rb_check_exec_env(env, &eargp->path_env) : Qfalse;
+ env = !NIL_P(env) ? rb_check_exec_env(env) : Qfalse;
eargp->env_modification = env;
}
@@ -2314,74 +2277,14 @@ fill_envp_buf_i(st_data_t st_key, st_data_t st_val, st_data_t arg)
static long run_exec_dup2_tmpbuf_size(long n);
-struct open_struct {
- VALUE fname;
- int oflags;
- mode_t perm;
- int ret;
- int err;
-};
-
-static void *
-open_func(void *ptr)
-{
- struct open_struct *data = ptr;
- const char *fname = RSTRING_PTR(data->fname);
- data->ret = parent_redirect_open(fname, data->oflags, data->perm);
- data->err = errno;
- return NULL;
-}
-
-static VALUE
-rb_execarg_parent_start1(VALUE execarg_obj)
+void
+rb_execarg_fixup(VALUE execarg_obj)
{
struct rb_execarg *eargp = rb_execarg_get(execarg_obj);
int unsetenv_others;
VALUE envopts;
VALUE ary;
- ary = eargp->fd_open;
- if (ary != Qfalse) {
- long i;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_AREF(ary, i);
- int fd = FIX2INT(RARRAY_AREF(elt, 0));
- VALUE param = RARRAY_AREF(elt, 1);
- VALUE vpath = RARRAY_AREF(param, 0);
- int flags = NUM2INT(RARRAY_AREF(param, 1));
- int perm = NUM2INT(RARRAY_AREF(param, 2));
- VALUE fd2v = RARRAY_AREF(param, 3);
- int fd2;
- if (NIL_P(fd2v)) {
- struct open_struct open_data;
- FilePathValue(vpath);
- vpath = rb_str_encode_ospath(vpath);
- again:
- open_data.fname = vpath;
- open_data.oflags = flags;
- open_data.perm = perm;
- open_data.ret = -1;
- open_data.err = EINTR;
- rb_thread_call_without_gvl2(open_func, (void *)&open_data, RUBY_UBF_IO, 0);
- if (open_data.ret == -1) {
- if (open_data.err == EINTR) {
- rb_thread_check_ints();
- goto again;
- }
- rb_syserr_fail_str(open_data.err, vpath);
- }
- fd2 = open_data.ret;
- rb_update_max_fd(fd2);
- RARRAY_ASET(param, 3, INT2FIX(fd2));
- rb_thread_check_ints();
- }
- else {
- fd2 = NUM2INT(fd2v);
- }
- rb_execarg_addopt(execarg_obj, INT2FIX(fd), INT2FIX(fd2));
- }
- }
-
eargp->redirect_fds = check_exec_fds(eargp);
ary = eargp->fd_dup2;
@@ -2394,15 +2297,15 @@ rb_execarg_parent_start1(VALUE execarg_obj)
unsetenv_others = eargp->unsetenv_others_given && eargp->unsetenv_others_do;
envopts = eargp->env_modification;
- if (ALWAYS_NEED_ENVP || unsetenv_others || envopts != Qfalse) {
+ if (unsetenv_others || envopts != Qfalse) {
VALUE envtbl, envp_str, envp_buf;
char *p, *ep;
if (unsetenv_others) {
envtbl = rb_hash_new();
}
else {
- envtbl = rb_const_get(rb_cObject, id_ENV);
- envtbl = rb_to_hash_type(envtbl);
+ envtbl = rb_const_get(rb_cObject, rb_intern("ENV"));
+ envtbl = rb_convert_type(envtbl, T_HASH, "Hash", "to_hash");
}
hide_obj(envtbl);
if (envopts != Qfalse) {
@@ -2447,75 +2350,11 @@ rb_execarg_parent_start1(VALUE execarg_obj)
}
*/
}
-
- RB_GC_GUARD(execarg_obj);
- return Qnil;
-}
-
-void
-rb_execarg_parent_start(VALUE execarg_obj)
-{
- int state;
- rb_protect(rb_execarg_parent_start1, execarg_obj, &state);
- if (state) {
- rb_execarg_parent_end(execarg_obj);
- rb_jump_tag(state);
- }
-}
-
-static VALUE
-execarg_parent_end(VALUE execarg_obj)
-{
- struct rb_execarg *eargp = rb_execarg_get(execarg_obj);
- int err = errno;
- VALUE ary;
-
- ary = eargp->fd_open;
- if (ary != Qfalse) {
- long i;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = RARRAY_AREF(ary, i);
- VALUE param = RARRAY_AREF(elt, 1);
- VALUE fd2v;
- int fd2;
- fd2v = RARRAY_AREF(param, 3);
- if (!NIL_P(fd2v)) {
- fd2 = FIX2INT(fd2v);
- parent_redirect_close(fd2);
- RARRAY_ASET(param, 3, Qnil);
- }
- }
- }
-
- errno = err;
- return execarg_obj;
-}
-
-void
-rb_execarg_parent_end(VALUE execarg_obj)
-{
- execarg_parent_end(execarg_obj);
RB_GC_GUARD(execarg_obj);
}
-static void
-rb_exec_fail(struct rb_execarg *eargp, int err, const char *errmsg)
-{
- if (!errmsg || !*errmsg) return;
- if (strcmp(errmsg, "chdir") == 0) {
- rb_sys_fail_str(eargp->chdir_dir);
- }
- rb_sys_fail(errmsg);
-}
-
-#if 0
-void
-rb_execarg_fail(VALUE execarg_obj, int err, const char *errmsg)
-{
- if (!errmsg || !*errmsg) return;
- rb_exec_fail(rb_execarg_get(execarg_obj), err, errmsg);
- RB_GC_GUARD(execarg_obj);
-}
+#if defined(__APPLE__) || defined(__HAIKU__)
+static int rb_exec_without_timer_thread(const struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen);
#endif
/*
@@ -2598,37 +2437,103 @@ rb_f_exec(int argc, const VALUE *argv)
struct rb_execarg *eargp;
#define CHILD_ERRMSG_BUFLEN 80
char errmsg[CHILD_ERRMSG_BUFLEN] = { '\0' };
- int err;
execarg_obj = rb_execarg_new(argc, argv, TRUE);
eargp = rb_execarg_get(execarg_obj);
- before_exec(); /* stop timer thread before redirects */
- rb_execarg_parent_start(execarg_obj);
+ rb_execarg_fixup(execarg_obj);
fail_str = eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name;
- err = exec_async_signal_safe(eargp, errmsg, sizeof(errmsg));
- after_exec(); /* restart timer thread */
-
- rb_exec_fail(eargp, err, errmsg);
+#if defined(__APPLE__) || defined(__HAIKU__)
+ rb_exec_without_timer_thread(eargp, errmsg, sizeof(errmsg));
+#else
+ before_exec_async_signal_safe(); /* async-signal-safe */
+ rb_exec_async_signal_safe(eargp, errmsg, sizeof(errmsg));
+ preserving_errno(after_exec_async_signal_safe()); /* async-signal-safe */
+#endif
RB_GC_GUARD(execarg_obj);
- rb_syserr_fail_str(err, fail_str);
- UNREACHABLE;
+ if (errmsg[0])
+ rb_sys_fail(errmsg);
+ rb_sys_fail_str(fail_str);
+ return Qnil; /* dummy */
}
#define ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)
-#define ERRMSG1(str, a) do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a)); } while (0)
-#define ERRMSG2(str, a, b) do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a), (b)); } while (0)
-static int fd_get_cloexec(int fd, char *errmsg, size_t errmsg_buflen);
-static int fd_set_cloexec(int fd, char *errmsg, size_t errmsg_buflen);
-static int fd_clear_cloexec(int fd, char *errmsg, size_t errmsg_buflen);
+/*#define DEBUG_REDIRECT*/
+#if defined(DEBUG_REDIRECT)
+
+#include <stdarg.h>
+
+static void
+ttyprintf(const char *fmt, ...)
+{
+ va_list ap;
+ FILE *tty;
+ int save = errno;
+#ifdef _WIN32
+ tty = fopen("con", "w");
+#else
+ tty = fopen("/dev/tty", "w");
+#endif
+ if (!tty)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(tty, fmt, ap);
+ va_end(ap);
+ fclose(tty);
+ errno = save;
+}
+
+static int
+redirect_dup(int oldfd)
+{
+ int ret;
+ ret = dup(oldfd);
+ ttyprintf("dup(%d) => %d\n", oldfd, ret);
+ return ret;
+}
+
+static int
+redirect_dup2(int oldfd, int newfd)
+{
+ int ret;
+ ret = dup2(oldfd, newfd);
+ ttyprintf("dup2(%d, %d)\n", oldfd, newfd);
+ return ret;
+}
+
+static int
+redirect_close(int fd)
+{
+ int ret;
+ ret = close(fd);
+ ttyprintf("close(%d)\n", fd);
+ return ret;
+}
+
+static int
+redirect_open(const char *pathname, int flags, mode_t perm)
+{
+ int ret;
+ ret = open(pathname, flags, perm);
+ ttyprintf("open(\"%s\", 0x%x, 0%o) => %d\n", pathname, flags, perm, ret);
+ return ret;
+}
+
+#else
+#define redirect_dup(oldfd) dup(oldfd)
+#define redirect_dup2(oldfd, newfd) dup2((oldfd), (newfd))
+#define redirect_close(fd) close(fd)
+#define redirect_open(pathname, flags, perm) open((pathname), (flags), (perm))
+#endif
static int
save_redirect_fd(int fd, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
{
if (sargp) {
- VALUE newary, redirection;
- int save_fd = redirect_cloexec_dup(fd), cloexec;
+ VALUE newary;
+ int save_fd = redirect_dup(fd);
if (save_fd == -1) {
if (errno == EBADF)
return 0;
@@ -2641,10 +2546,8 @@ save_redirect_fd(int fd, struct rb_execarg *sargp, char *errmsg, size_t errmsg_b
newary = hide_obj(rb_ary_new());
sargp->fd_dup2 = newary;
}
- cloexec = fd_get_cloexec(fd, errmsg, errmsg_buflen);
- redirection = hide_obj(rb_assoc_new(INT2FIX(fd), INT2FIX(save_fd)));
- if (cloexec) rb_ary_push(redirection, Qtrue);
- rb_ary_push(newary, redirection);
+ rb_ary_push(newary,
+ hide_obj(rb_assoc_new(INT2FIX(fd), INT2FIX(save_fd))));
newary = sargp->fd_close;
if (newary == Qfalse) {
@@ -2674,7 +2577,6 @@ struct run_exec_dup2_fd_pair {
int newfd;
long older_index;
long num_newer;
- int cloexec;
};
static long
@@ -2683,68 +2585,6 @@ run_exec_dup2_tmpbuf_size(long n)
return sizeof(struct run_exec_dup2_fd_pair) * n;
}
-/* This function should be async-signal-safe. Actually it is. */
-static int
-fd_get_cloexec(int fd, char *errmsg, size_t errmsg_buflen)
-{
-#ifdef F_GETFD
- int ret = 0;
- ret = fcntl(fd, F_GETFD); /* async-signal-safe */
- if (ret == -1) {
- ERRMSG("fcntl(F_GETFD)");
- return -1;
- }
- if (ret & FD_CLOEXEC) return 1;
-#endif
- return 0;
-}
-
-/* This function should be async-signal-safe. Actually it is. */
-static int
-fd_set_cloexec(int fd, char *errmsg, size_t errmsg_buflen)
-{
-#ifdef F_GETFD
- int ret = 0;
- ret = fcntl(fd, F_GETFD); /* async-signal-safe */
- if (ret == -1) {
- ERRMSG("fcntl(F_GETFD)");
- return -1;
- }
- if (!(ret & FD_CLOEXEC)) {
- ret |= FD_CLOEXEC;
- ret = fcntl(fd, F_SETFD, ret); /* async-signal-safe */
- if (ret == -1) {
- ERRMSG("fcntl(F_SETFD)");
- return -1;
- }
- }
-#endif
- return 0;
-}
-
-/* This function should be async-signal-safe. Actually it is. */
-static int
-fd_clear_cloexec(int fd, char *errmsg, size_t errmsg_buflen)
-{
-#ifdef F_GETFD
- int ret;
- ret = fcntl(fd, F_GETFD); /* async-signal-safe */
- if (ret == -1) {
- ERRMSG("fcntl(F_GETFD)");
- return -1;
- }
- if (ret & FD_CLOEXEC) {
- ret &= ~FD_CLOEXEC;
- ret = fcntl(fd, F_SETFD, ret); /* async-signal-safe */
- if (ret == -1) {
- ERRMSG("fcntl(F_SETFD)");
- return -1;
- }
- }
-#endif
- return 0;
-}
-
/* This function should be async-signal-safe when sargp is NULL. Hopefully it is. */
static int
run_exec_dup2(VALUE ary, VALUE tmpbuf, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
@@ -2762,7 +2602,6 @@ run_exec_dup2(VALUE ary, VALUE tmpbuf, struct rb_execarg *sargp, char *errmsg, s
VALUE elt = RARRAY_AREF(ary, i);
pairs[i].oldfd = FIX2INT(RARRAY_AREF(elt, 1));
pairs[i].newfd = FIX2INT(RARRAY_AREF(elt, 0)); /* unique */
- pairs[i].cloexec = RARRAY_LEN(elt) > 2 && RTEST(RARRAY_AREF(elt, 2));
pairs[i].older_index = -1;
}
@@ -2801,10 +2640,6 @@ run_exec_dup2(VALUE ary, VALUE tmpbuf, struct rb_execarg *sargp, char *errmsg, s
ERRMSG("dup2");
goto fail;
}
- if (pairs[j].cloexec &&
- fd_set_cloexec(pairs[j].newfd, errmsg, errmsg_buflen)) {
- goto fail;
- }
rb_update_max_fd(pairs[j].newfd); /* async-signal-safe but don't need to call it in a child process. */
pairs[j].oldfd = -1;
j = pairs[j].older_index;
@@ -2819,8 +2654,22 @@ run_exec_dup2(VALUE ary, VALUE tmpbuf, struct rb_execarg *sargp, char *errmsg, s
if (pairs[i].oldfd == -1)
continue;
if (pairs[i].oldfd == pairs[i].newfd) { /* self cycle */
- if (fd_clear_cloexec(pairs[i].oldfd, errmsg, errmsg_buflen) == -1) /* async-signal-safe */
+#ifdef F_GETFD
+ int fd = pairs[i].oldfd;
+ ret = fcntl(fd, F_GETFD); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("fcntl(F_GETFD)");
goto fail;
+ }
+ if (ret & FD_CLOEXEC) {
+ ret &= ~FD_CLOEXEC;
+ ret = fcntl(fd, F_SETFD, ret); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("fcntl(F_SETFD)");
+ goto fail;
+ }
+ }
+#endif
pairs[i].oldfd = -1;
continue;
}
@@ -2889,6 +2738,57 @@ run_exec_close(VALUE ary, char *errmsg, size_t errmsg_buflen)
/* This function should be async-signal-safe when sargp is NULL. Actually it is. */
static int
+run_exec_open(VALUE ary, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
+{
+ long i;
+ int ret;
+
+ for (i = 0; i < RARRAY_LEN(ary);) {
+ VALUE elt = RARRAY_AREF(ary, i);
+ int fd = FIX2INT(RARRAY_AREF(elt, 0));
+ VALUE param = RARRAY_AREF(elt, 1);
+ const VALUE vpath = RARRAY_AREF(param, 0);
+ const char *path = RSTRING_PTR(vpath);
+ int flags = NUM2INT(RARRAY_AREF(param, 1));
+ int perm = NUM2INT(RARRAY_AREF(param, 2));
+ int need_close = 1;
+ int fd2 = redirect_open(path, flags, perm); /* async-signal-safe */
+ if (fd2 == -1) {
+ ERRMSG("open");
+ return -1;
+ }
+ rb_update_max_fd(fd2);
+ while (i < RARRAY_LEN(ary) &&
+ (elt = RARRAY_AREF(ary, i), RARRAY_AREF(elt, 1) == param)) {
+ fd = FIX2INT(RARRAY_AREF(elt, 0));
+ if (fd == fd2) {
+ need_close = 0;
+ }
+ else {
+ if (save_redirect_fd(fd, sargp, errmsg, errmsg_buflen) < 0) /* async-signal-safe */
+ return -1;
+ ret = redirect_dup2(fd2, fd); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("dup2");
+ return -1;
+ }
+ rb_update_max_fd(fd);
+ }
+ i++;
+ }
+ if (need_close) {
+ ret = redirect_close(fd2); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("close");
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+/* This function should be async-signal-safe when sargp is NULL. Actually it is. */
+static int
run_exec_dup2_child(VALUE ary, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
{
long i;
@@ -2995,7 +2895,7 @@ save_env(struct rb_execarg *sargp)
if (!sargp)
return;
if (sargp->env_modification == Qfalse) {
- VALUE env = rb_const_get(rb_cObject, id_ENV);
+ VALUE env = rb_const_get(rb_cObject, rb_intern("ENV"));
if (RTEST(env)) {
VALUE ary = hide_obj(rb_ary_new());
rb_block_call(env, idEach, 0, 0, save_env_i,
@@ -3008,11 +2908,6 @@ save_env(struct rb_execarg *sargp)
}
#endif
-#ifdef _WIN32
-#undef chdir
-#define chdir(p) rb_w32_uchdir(p)
-#endif
-
/* This function should be async-signal-safe when sargp is NULL. Hopefully it is. */
int
rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
@@ -3093,6 +2988,12 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
}
#endif
+ obj = eargp->fd_open;
+ if (obj != Qfalse) {
+ if (run_exec_open(obj, sargp, errmsg, errmsg_buflen) == -1) /* async-signal-safe */
+ return -1;
+ }
+
obj = eargp->fd_dup2_child;
if (obj != Qfalse) {
if (run_exec_dup2_child(obj, sargp, errmsg, errmsg_buflen) == -1) /* async-signal-safe */
@@ -3101,7 +3002,7 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
if (eargp->chdir_given) {
if (sargp) {
- char *cwd = ruby_getcwd();
+ char *cwd = my_getcwd();
sargp->chdir_given = 1;
sargp->chdir_dir = hide_obj(rb_str_new2(cwd));
xfree(cwd);
@@ -3146,40 +3047,45 @@ rb_execarg_run_options(const struct rb_execarg *eargp, struct rb_execarg *sargp,
int
rb_exec_async_signal_safe(const struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
{
- errno = exec_async_signal_safe(eargp, errmsg, errmsg_buflen);
- return -1;
-}
-
-static int
-exec_async_signal_safe(const struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
-{
#if !defined(HAVE_WORKING_FORK)
struct rb_execarg sarg, *const sargp = &sarg;
#else
struct rb_execarg *const sargp = NULL;
#endif
- int err;
if (rb_execarg_run_options(eargp, sargp, errmsg, errmsg_buflen) < 0) { /* hopefully async-signal-safe */
- return errno;
+ goto failure;
}
if (eargp->use_shell) {
- err = proc_exec_sh(RSTRING_PTR(eargp->invoke.sh.shell_script), eargp->envp_str); /* async-signal-safe */
+ proc_exec_sh(RSTRING_PTR(eargp->invoke.sh.shell_script), eargp->envp_str); /* async-signal-safe */
}
else {
char *abspath = NULL;
if (!NIL_P(eargp->invoke.cmd.command_abspath))
abspath = RSTRING_PTR(eargp->invoke.cmd.command_abspath);
- err = proc_exec_cmd(abspath, eargp->invoke.cmd.argv_str, eargp->envp_str); /* async-signal-safe */
+ proc_exec_cmd(abspath, eargp->invoke.cmd.argv_str, eargp->envp_str); /* async-signal-safe */
}
#if !defined(HAVE_WORKING_FORK)
- rb_execarg_run_options(sargp, NULL, errmsg, errmsg_buflen);
+ preserving_errno(rb_execarg_run_options(sargp, NULL, errmsg, errmsg_buflen));
#endif
- return err;
+failure:
+ return -1;
}
+#if defined(__APPLE__) || defined(__HAIKU__)
+static int
+rb_exec_without_timer_thread(const struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
+{
+ int ret;
+ before_exec();
+ ret = rb_exec_async_signal_safe(eargp, errmsg, errmsg_buflen); /* hopefully async-signal-safe */
+ preserving_errno(after_exec()); /* not async-signal-safe because it calls rb_thread_start_timer_thread. */
+ return ret;
+}
+#endif
+
#ifdef HAVE_WORKING_FORK
/* This function should be async-signal-safe. Hopefully it is. */
static int
@@ -3248,11 +3154,11 @@ pipe_nocrash(int filedes[2], VALUE fds)
#endif
static int
-handle_fork_error(int err, int *status, int *ep, volatile int *try_gc_p)
+handle_fork_error(int *status, int *ep, volatile int *try_gc_p)
{
int state = 0;
- switch (err) {
+ switch (errno) {
case ENOMEM:
if ((*try_gc_p)-- > 0 && !rb_during_gc()) {
rb_gc();
@@ -3275,9 +3181,7 @@ handle_fork_error(int err, int *status, int *ep, volatile int *try_gc_p)
break;
}
if (ep) {
- close(ep[0]);
- close(ep[1]);
- errno = err;
+ preserving_errno((close(ep[0]), close(ep[1])));
}
if (state && !status) rb_jump_tag(state);
return -1;
@@ -3485,23 +3389,21 @@ disable_child_handler_before_fork(struct child_handler_disabler_state *old)
int ret;
sigset_t all;
-#ifdef HAVE_PTHREAD_SIGMASK
ret = sigfillset(&all);
if (ret == -1)
rb_sys_fail("sigfillset");
ret = pthread_sigmask(SIG_SETMASK, &all, &old->sigmask); /* not async-signal-safe */
if (ret != 0) {
- rb_syserr_fail(ret, "pthread_sigmask");
+ errno = ret;
+ rb_sys_fail("pthread_sigmask");
}
-#else
-# pragma GCC warning "pthread_sigmask on fork is not available. potentially dangerous"
-#endif
#ifdef PTHREAD_CANCEL_DISABLE
ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old->cancelstate);
if (ret != 0) {
- rb_syserr_fail(ret, "pthread_setcancelstate");
+ errno = ret;
+ rb_sys_fail("pthread_setcancelstate");
}
#endif
}
@@ -3514,18 +3416,16 @@ disable_child_handler_fork_parent(struct child_handler_disabler_state *old)
#ifdef PTHREAD_CANCEL_DISABLE
ret = pthread_setcancelstate(old->cancelstate, NULL);
if (ret != 0) {
- rb_syserr_fail(ret, "pthread_setcancelstate");
+ errno = ret;
+ rb_sys_fail("pthread_setcancelstate");
}
#endif
-#ifdef HAVE_PTHREAD_SIGMASK
ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */
if (ret != 0) {
- rb_syserr_fail(ret, "pthread_sigmask");
+ errno = ret;
+ rb_sys_fail("pthread_sigmask");
}
-#else
-# pragma GCC warning "pthread_sigmask on fork is not available. potentially dangerous"
-#endif
}
/* This function should be async-signal-safe. Actually it is. */
@@ -3534,26 +3434,41 @@ disable_child_handler_fork_child(struct child_handler_disabler_state *old, char
{
int sig;
int ret;
+ struct sigaction act, oact;
- for (sig = 1; sig < NSIG; sig++) {
- sig_t handler = signal(sig, SIG_DFL);
+ act.sa_handler = SIG_DFL;
+ act.sa_flags = 0;
+ ret = sigemptyset(&act.sa_mask); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("sigemptyset");
+ return -1;
+ }
- if (handler == SIG_ERR && errno == EINVAL) {
- continue; /* Ignore invalid signal number */
- }
- if (handler == SIG_ERR) {
- ERRMSG("signal to obtain old action");
- return -1;
- }
+ for (sig = 1; sig < NSIG; sig++) {
+ int reset = 0;
#ifdef SIGPIPE
- if (sig == SIGPIPE) {
- continue;
- }
+ if (sig == SIGPIPE)
+ reset = 1;
#endif
- /* it will be reset to SIG_DFL at execve time, instead */
- if (handler == SIG_IGN) {
- signal(sig, SIG_IGN);
- }
+ if (!reset) {
+ ret = sigaction(sig, NULL, &oact); /* async-signal-safe */
+ if (ret == -1 && errno == EINVAL) {
+ continue; /* Ignore invalid signal number. */
+ }
+ if (ret == -1) {
+ ERRMSG("sigaction to obtain old action");
+ return -1;
+ }
+ reset = (oact.sa_flags & SA_SIGINFO) ||
+ (oact.sa_handler != SIG_IGN && oact.sa_handler != SIG_DFL);
+ }
+ if (reset) {
+ ret = sigaction(sig, &act, NULL); /* async-signal-safe */
+ if (ret == -1) {
+ ERRMSG("sigaction to set default action");
+ return -1;
+ }
+ }
}
ret = sigprocmask(SIG_SETMASK, &old->sigmask, NULL); /* async-signal-safe */
@@ -3572,7 +3487,6 @@ retry_fork_async_signal_safe(int *status, int *ep,
rb_pid_t pid;
volatile int try_gc = 1;
struct child_handler_disabler_state old;
- int err;
while (1) {
prefork();
@@ -3600,12 +3514,11 @@ retry_fork_async_signal_safe(int *status, int *ep,
_exit(127);
#endif
}
- err = errno;
- disable_child_handler_fork_parent(&old);
+ preserving_errno(disable_child_handler_fork_parent(&old));
if (0 < pid) /* fork succeed, parent process */
return pid;
/* fork failed */
- if (handle_fork_error(err, status, ep, &try_gc))
+ if (handle_fork_error(status, ep, &try_gc))
return -1;
}
}
@@ -3615,8 +3528,9 @@ rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), voi
char *errmsg, size_t errmsg_buflen)
{
rb_pid_t pid;
- int err;
+ int err, state = 0;
int ep[2];
+ VALUE exc = Qnil;
int error_occurred;
if (status) *status = 0;
@@ -3627,12 +3541,14 @@ rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), voi
return pid;
close(ep[1]);
error_occurred = recv_child_error(ep[0], &err, errmsg, errmsg_buflen);
- if (error_occurred) {
+ if (state || error_occurred) {
if (status) {
rb_protect(proc_syswait, (VALUE)pid, status);
+ if (state) *status = state;
}
else {
rb_syswait(pid);
+ if (state) rb_exc_raise(exc);
}
errno = err;
return -1;
@@ -3640,29 +3556,41 @@ rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), voi
return pid;
}
+static rb_pid_t
+retry_fork_ruby(int *status)
+{
+ rb_pid_t pid;
+ int try_gc = 1;
+
+ while (1) {
+ prefork();
+ before_fork_ruby();
+ pid = fork();
+ if (pid == 0) /* fork succeed, child process */
+ return pid;
+ preserving_errno(after_fork_ruby());
+ if (0 < pid) /* fork succeed, parent process */
+ return pid;
+ /* fork failed */
+ if (handle_fork_error(status, NULL, &try_gc))
+ return -1;
+ }
+}
+
rb_pid_t
rb_fork_ruby(int *status)
{
rb_pid_t pid;
- int try_gc = 1, err;
- struct child_handler_disabler_state old;
if (status) *status = 0;
- while (1) {
- prefork();
- disable_child_handler_before_fork(&old);
- before_fork_ruby();
- pid = fork();
- err = errno;
- after_fork_ruby();
- disable_child_handler_fork_parent(&old); /* yes, bad name */
- if (pid >= 0) /* fork succeed */
- return pid;
- /* fork failed */
- if (handle_fork_error(err, status, NULL, &try_gc))
- return -1;
+ pid = retry_fork_ruby(status);
+ if (pid < 0)
+ return pid;
+ if (!pid) {
+ after_fork_ruby();
}
+ return pid;
}
#endif
@@ -3670,8 +3598,8 @@ rb_fork_ruby(int *status)
#if defined(HAVE_WORKING_FORK) && !defined(CANNOT_FORK_WITH_PTHREAD)
/*
* call-seq:
- * Kernel.fork [{ block }] -> integer or nil
- * Process.fork [{ block }] -> integer or nil
+ * Kernel.fork [{ block }] -> fixnum or nil
+ * Process.fork [{ block }] -> fixnum or nil
*
* Creates a subprocess. If a block is specified, that block is run
* in the subprocess, and the subprocess terminates with a status of
@@ -3699,11 +3627,14 @@ rb_f_fork(VALUE obj)
{
rb_pid_t pid;
+ rb_secure(2);
+
switch (pid = rb_fork_ruby(NULL)) {
case 0:
rb_thread_atfork();
if (rb_block_given_p()) {
int status;
+
rb_protect(rb_yield, Qundef, &status);
ruby_stop(status);
}
@@ -3758,10 +3689,11 @@ exit_status_code(VALUE status)
static VALUE
rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
{
+ VALUE status;
int istatus;
- if (rb_check_arity(argc, 0, 1) == 1) {
- istatus = exit_status_code(argv[0]);
+ if (argc > 0 && rb_scan_args(argc, argv, "01", &status) == 1) {
+ istatus = exit_status_code(status);
}
else {
istatus = EXIT_FAILURE;
@@ -3774,7 +3706,7 @@ rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
void
rb_exit(int status)
{
- if (GET_EC()->tag) {
+ if (GET_THREAD()->tag) {
VALUE args[2];
args[0] = INT2NUM(status);
@@ -3829,10 +3761,11 @@ rb_exit(int status)
VALUE
rb_f_exit(int argc, const VALUE *argv)
{
+ VALUE status;
int istatus;
- if (rb_check_arity(argc, 0, 1) == 1) {
- istatus = exit_status_code(argv[0]);
+ if (argc > 0 && rb_scan_args(argc, argv, "01", &status) == 1) {
+ istatus = exit_status_code(status);
}
else {
istatus = EXIT_SUCCESS;
@@ -3847,7 +3780,7 @@ rb_f_exit(int argc, const VALUE *argv)
* call-seq:
* abort
* Kernel::abort([msg])
- * Process.abort([msg])
+ * Process::abort([msg])
*
* Terminate execution immediately, effectively by calling
* <code>Kernel.exit(false)</code>. If _msg_ is given, it is written
@@ -3859,10 +3792,8 @@ rb_f_abort(int argc, const VALUE *argv)
{
rb_check_arity(argc, 0, 1);
if (argc == 0) {
- rb_execution_context_t *ec = GET_EC();
- VALUE errinfo = ec->errinfo;
- if (!NIL_P(errinfo)) {
- rb_ec_error_print(ec, errinfo);
+ if (!NIL_P(GET_THREAD()->errinfo)) {
+ ruby_error_print();
}
rb_exit(EXIT_FAILURE);
}
@@ -3887,43 +3818,20 @@ rb_syswait(rb_pid_t pid)
rb_waitpid(pid, &status, 0);
}
-#if !defined HAVE_WORKING_FORK && !defined HAVE_SPAWNV
-char *
-rb_execarg_commandline(const struct rb_execarg *eargp, VALUE *prog)
-{
- VALUE cmd = *prog;
- if (eargp && !eargp->use_shell) {
- VALUE str = eargp->invoke.cmd.argv_str;
- VALUE buf = eargp->invoke.cmd.argv_buf;
- char *p, **argv = ARGVSTR2ARGV(str);
- long i, argc = ARGVSTR2ARGC(str);
- const char *start = RSTRING_PTR(buf);
- cmd = rb_str_new(start, RSTRING_LEN(buf));
- p = RSTRING_PTR(cmd);
- for (i = 1; i < argc; ++i) {
- p[argv[i] - start - 1] = ' ';
- }
- *prog = cmd;
- return p;
- }
- return StringValueCStr(*prog);
-}
-#endif
-
static rb_pid_t
rb_spawn_process(struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
{
rb_pid_t pid;
+#if !USE_SPAWNV
+ int status;
+#endif
#if !defined HAVE_WORKING_FORK || USE_SPAWNV
VALUE prog;
struct rb_execarg sarg;
-# if !defined HAVE_SPAWNV
- int status;
-# endif
#endif
#if defined HAVE_WORKING_FORK && !USE_SPAWNV
- pid = rb_fork_async_signal_safe(NULL, rb_exec_atfork, eargp, eargp->redirect_fds, errmsg, errmsg_buflen);
+ pid = rb_fork_async_signal_safe(&status, rb_exec_atfork, eargp, eargp->redirect_fds, errmsg, errmsg_buflen);
#else
prog = eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name;
@@ -3946,9 +3854,13 @@ rb_spawn_process(struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
if (pid == -1)
rb_last_status_set(0x7f << 8, 0);
# else
- status = system(rb_execarg_commandline(eargp, &prog));
+ if (!eargp->use_shell) {
+ char **argv = ARGVSTR2ARGV(eargp->invoke.cmd.argv_str);
+ int argc = ARGVSTR2ARGC(eargp->invoke.cmd.argv_str);
+ prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
+ }
+ status = system(StringValuePtr(prog));
rb_last_status_set((status & 0xff) << 8, 0);
- pid = 1; /* dummy */
# endif
rb_execarg_run_options(&sarg, NULL, errmsg, errmsg_buflen);
@@ -3956,42 +3868,19 @@ rb_spawn_process(struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
return pid;
}
-struct spawn_args {
- VALUE execarg;
- struct {
- char *ptr;
- size_t buflen;
- } errmsg;
-};
-
-static VALUE
-do_spawn_process(VALUE arg)
-{
- struct spawn_args *argp = (struct spawn_args *)arg;
- rb_execarg_parent_start1(argp->execarg);
- return (VALUE)rb_spawn_process(DATA_PTR(argp->execarg),
- argp->errmsg.ptr, argp->errmsg.buflen);
-}
-
-static rb_pid_t
-rb_execarg_spawn(VALUE execarg_obj, char *errmsg, size_t errmsg_buflen)
-{
- struct spawn_args args;
-
- args.execarg = execarg_obj;
- args.errmsg.ptr = errmsg;
- args.errmsg.buflen = errmsg_buflen;
- return (rb_pid_t)rb_ensure(do_spawn_process, (VALUE)&args,
- execarg_parent_end, execarg_obj);
-}
-
static rb_pid_t
rb_spawn_internal(int argc, const VALUE *argv, char *errmsg, size_t errmsg_buflen)
{
VALUE execarg_obj;
+ struct rb_execarg *eargp;
+ rb_pid_t ret;
execarg_obj = rb_execarg_new(argc, argv, TRUE);
- return rb_execarg_spawn(execarg_obj, errmsg, errmsg_buflen);
+ eargp = rb_execarg_get(execarg_obj);
+ rb_execarg_fixup(execarg_obj);
+ ret = rb_spawn_process(eargp, errmsg, errmsg_buflen);
+ RB_GC_GUARD(execarg_obj);
+ return ret;
}
rb_pid_t
@@ -4103,8 +3992,6 @@ rb_f_system(int argc, VALUE *argv)
* env: hash
* name => val : set the environment variable
* name => nil : unset the environment variable
- *
- * the keys and the values except for +nil+ must be strings.
* command...:
* commandline : command line string which is passed to the standard shell
* cmdname, arg1, ... : command name and one or more arguments (This form does not use the shell. See below for caveats.)
@@ -4115,7 +4002,7 @@ rb_f_system(int argc, VALUE *argv)
* :unsetenv_others => false : don't clear (default)
* process group:
* :pgroup => true or 0 : make a new process group
- * :pgroup => pgid : join the specified process group
+ * :pgroup => pgid : join to specified process group
* :pgroup => nil : don't change the process group (default)
* create new process group: Windows only
* :new_pgroup => true : the new process is the root process of a new process group
@@ -4180,10 +4067,10 @@ rb_f_system(int argc, VALUE *argv)
* pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true) # FOO only
*
* The <code>:pgroup</code> key in +options+ specifies a process group.
- * The corresponding value should be true, zero, a positive integer, or nil.
- * true and zero cause the process to be a process leader of a new process group.
- * A non-zero positive integer causes the process to join the provided process group.
- * The default value, nil, causes the process to remain in the same process group.
+ * The corresponding value should be true, zero or positive integer.
+ * true and zero means the process should be a process leader of a new
+ * process group.
+ * Other values specifies a process group to be belongs.
*
* pid = spawn(command, :pgroup=>true) # process leader
* pid = spawn(command, :pgroup=>10) # belongs to the process group 10
@@ -4214,7 +4101,7 @@ rb_f_system(int argc, VALUE *argv)
*
* pid = spawn(command, :umask=>077)
*
- * The :in, :out, :err, an integer, an IO and an array key specifies a redirection.
+ * The :in, :out, :err, a fixnum, an IO and an array key specifies a redirection.
* The redirection maps a file descriptor in the child process.
*
* For example, stderr can be merged into stdout as follows:
@@ -4353,15 +4240,18 @@ rb_f_spawn(int argc, VALUE *argv)
execarg_obj = rb_execarg_new(argc, argv, TRUE);
eargp = rb_execarg_get(execarg_obj);
+ rb_execarg_fixup(execarg_obj);
fail_str = eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name;
- pid = rb_execarg_spawn(execarg_obj, errmsg, sizeof(errmsg));
+ pid = rb_spawn_process(eargp, errmsg, sizeof(errmsg));
+ RB_GC_GUARD(execarg_obj);
if (pid == -1) {
- int err = errno;
- rb_exec_fail(eargp, err, errmsg);
- RB_GC_GUARD(execarg_obj);
- rb_syserr_fail_str(err, fail_str);
+ const char *prog = errmsg;
+ if (!prog[0]) {
+ rb_sys_fail_str(fail_str);
+ }
+ rb_sys_fail(prog);
}
#if defined(HAVE_WORKING_FORK) || defined(HAVE_SPAWNV)
return PIDT2NUM(pid);
@@ -4372,7 +4262,7 @@ rb_f_spawn(int argc, VALUE *argv)
/*
* call-seq:
- * sleep([duration]) -> integer
+ * sleep([duration]) -> fixnum
*
* Suspends the current thread for _duration_ seconds (which may be any number,
* including a +Float+ with fractional seconds). Returns the actual number of
@@ -4424,6 +4314,7 @@ proc_getpgrp(void)
{
rb_pid_t pgrp;
+ rb_secure(2);
#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
pgrp = getpgrp();
if (pgrp < 0) rb_sys_fail(0);
@@ -4451,6 +4342,7 @@ proc_getpgrp(void)
static VALUE
proc_setpgrp(void)
{
+ rb_secure(2);
/* check for posix setpgid() first; this matches the posix */
/* getpgrp() above. It appears that configure will set SETPGRP_VOID */
/* even though setpgrp(0,0) would be preferred. The posix call avoids */
@@ -4483,6 +4375,7 @@ proc_getpgid(VALUE obj, VALUE pid)
{
rb_pid_t i;
+ rb_secure(2);
i = getpgid(NUM2PIDT(pid));
if (i < 0) rb_sys_fail(0);
return PIDT2NUM(i);
@@ -4506,6 +4399,7 @@ proc_setpgid(VALUE obj, VALUE pid, VALUE pgrp)
{
rb_pid_t ipid, ipgrp;
+ rb_secure(2);
ipid = NUM2PIDT(pid);
ipgrp = NUM2PIDT(pgrp);
@@ -4523,7 +4417,7 @@ proc_setpgid(VALUE obj, VALUE pid, VALUE pgrp)
* Process.getsid() -> integer
* Process.getsid(pid) -> integer
*
- * Returns the session ID for the given process id. If not given,
+ * Returns the session ID for for the given process id. If not give,
* return current process sid. Not available on all platforms.
*
* Process.getsid() #=> 27422
@@ -4534,12 +4428,15 @@ static VALUE
proc_getsid(int argc, VALUE *argv)
{
rb_pid_t sid;
- rb_pid_t pid = 0;
+ VALUE pid;
+
+ rb_secure(2);
+ rb_scan_args(argc, argv, "01", &pid);
- if (rb_check_arity(argc, 0, 1) == 1 && !NIL_P(argv[0]))
- pid = NUM2PIDT(argv[0]);
+ if (NIL_P(pid))
+ pid = INT2FIX(0);
- sid = getsid(pid);
+ sid = getsid(NUM2PIDT(pid));
if (sid < 0) rb_sys_fail(0);
return PIDT2NUM(sid);
}
@@ -4555,7 +4452,7 @@ static rb_pid_t ruby_setsid(void);
#endif
/*
* call-seq:
- * Process.setsid -> integer
+ * Process.setsid -> fixnum
*
* Establishes this process as a new session and process group
* leader, with no controlling tty. Returns the session id. Not
@@ -4569,6 +4466,7 @@ proc_setsid(void)
{
rb_pid_t pid;
+ rb_secure(2);
pid = setsid();
if (pid < 0) rb_sys_fail(0);
return PIDT2NUM(pid);
@@ -4609,7 +4507,7 @@ ruby_setsid(void)
#ifdef HAVE_GETPRIORITY
/*
* call-seq:
- * Process.getpriority(kind, integer) -> integer
+ * Process.getpriority(kind, integer) -> fixnum
*
* Gets the scheduling priority for specified process, process group,
* or user. <em>kind</em> indicates the kind of entity to find: one
@@ -4629,6 +4527,7 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
{
int prio, iwhich, iwho;
+ rb_secure(2);
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
@@ -4660,6 +4559,7 @@ proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
{
int iwhich, iwho, iprio;
+ rb_secure(2);
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
iprio = NUM2INT(prio);
@@ -4674,13 +4574,13 @@ proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
static int
-rlimit_resource_name2int(const char *name, long len, int casetype)
+rlimit_resource_name2int(const char *name, int casetype)
{
int resource;
const char *p;
#define RESCHECK(r) \
do { \
- if (len == rb_strlen_lit(#r) && STRCASECMP(name, #r) == 0) { \
+ if (STRCASECMP(name, #r) == 0) { \
resource = RLIMIT_##r; \
goto found; \
} \
@@ -4783,40 +4683,21 @@ rlimit_resource_name2int(const char *name, long len, int casetype)
}
static int
-rlimit_type_by_hname(const char *name, long len)
+rlimit_type_by_hname(const char *name)
{
- return rlimit_resource_name2int(name, len, 0);
+ return rlimit_resource_name2int(name, 0);
}
static int
-rlimit_type_by_lname(const char *name, long len)
+rlimit_type_by_lname(const char *name)
{
- return rlimit_resource_name2int(name, len, 1);
-}
-
-static int
-rlimit_type_by_sym(VALUE key)
-{
- VALUE name = rb_sym2str(key);
- const char *rname = RSTRING_PTR(name);
- long len = RSTRING_LEN(name);
- int rtype = -1;
- static const char prefix[] = "rlimit_";
- enum {prefix_len = sizeof(prefix)-1};
-
- if (len > prefix_len && strncmp(prefix, rname, prefix_len) == 0) {
- rtype = rlimit_type_by_lname(rname + prefix_len, len - prefix_len);
- }
-
- RB_GC_GUARD(key);
- return rtype;
+ return rlimit_resource_name2int(name, 1);
}
static int
rlimit_resource_type(VALUE rtype)
{
const char *name;
- long len;
VALUE v;
int r;
@@ -4824,7 +4705,6 @@ rlimit_resource_type(VALUE rtype)
case T_SYMBOL:
v = rb_sym2str(rtype);
name = RSTRING_PTR(v);
- len = RSTRING_LEN(v);
break;
default:
@@ -4833,7 +4713,6 @@ rlimit_resource_type(VALUE rtype)
rtype = v;
case T_STRING:
name = StringValueCStr(rtype);
- len = RSTRING_LEN(rtype);
break;
}
/* fall through */
@@ -4843,11 +4722,11 @@ rlimit_resource_type(VALUE rtype)
return NUM2INT(rtype);
}
- r = rlimit_type_by_hname(name, len);
+ r = rlimit_type_by_hname(name);
if (r != -1)
return r;
- rb_raise(rb_eArgError, "invalid resource name: % "PRIsVALUE, rtype);
+ rb_raise(rb_eArgError, "invalid resource name: %"PRIsVALUE, rtype);
UNREACHABLE;
}
@@ -4920,6 +4799,8 @@ proc_getrlimit(VALUE obj, VALUE resource)
{
struct rlimit rlim;
+ rb_secure(2);
+
if (getrlimit(rlimit_resource_type(resource), &rlim) < 0) {
rb_sys_fail("getrlimit");
}
@@ -4987,10 +4868,10 @@ proc_setrlimit(int argc, VALUE *argv, VALUE obj)
VALUE resource, rlim_cur, rlim_max;
struct rlimit rlim;
- rb_check_arity(argc, 2, 3);
- resource = argv[0];
- rlim_cur = argv[1];
- if (argc < 3 || NIL_P(rlim_max = argv[2]))
+ rb_secure(2);
+
+ rb_scan_args(argc, argv, "21", &resource, &rlim_cur, &rlim_max);
+ if (rlim_max == Qnil)
rlim_max = rlim_cur;
rlim.rlim_cur = rlimit_resource_value(rlim_cur);
@@ -5009,6 +4890,7 @@ static int under_uid_switch = 0;
static void
check_uid_switch(void)
{
+ rb_secure(2);
if (under_uid_switch) {
rb_raise(rb_eRuntimeError, "can't handle UID while evaluating block given to Process::UID.switch method");
}
@@ -5018,6 +4900,7 @@ static int under_gid_switch = 0;
static void
check_gid_switch(void)
{
+ rb_secure(2);
if (under_gid_switch) {
rb_raise(rb_eRuntimeError, "can't handle GID while evaluating block given to Process::UID.switch method");
}
@@ -5055,20 +4938,21 @@ obj2uid(VALUE id
struct passwd pwbuf;
char *getpw_buf;
long getpw_buf_len;
- int e;
if (!*getpw_tmp) {
getpw_buf_len = GETPW_R_SIZE_INIT;
if (getpw_buf_len < 0) getpw_buf_len = GETPW_R_SIZE_DEFAULT;
- *getpw_tmp = rb_str_tmp_new(getpw_buf_len);
+ getpw_buf = rb_alloc_tmp_buffer(getpw_tmp, getpw_buf_len);
+ }
+ else {
+ getpw_buf = RSTRING_PTR(*getpw_tmp);
+ getpw_buf_len = rb_str_capacity(*getpw_tmp);
}
- getpw_buf = RSTRING_PTR(*getpw_tmp);
- getpw_buf_len = rb_str_capacity(*getpw_tmp);
- rb_str_set_len(*getpw_tmp, getpw_buf_len);
- errno = 0;
- while ((e = getpwnam_r(usrname, &pwbuf, getpw_buf, getpw_buf_len, &pwptr)) != 0) {
- if (e != ERANGE || getpw_buf_len >= GETPW_R_SIZE_LIMIT) {
- rb_str_resize(*getpw_tmp, 0);
- rb_syserr_fail(e, "getpwnam_r");
+ errno = ERANGE;
+ /* gepwnam_r() on MacOS X doesn't set errno if buffer size is insufficient */
+ while (getpwnam_r(usrname, &pwbuf, getpw_buf, getpw_buf_len, &pwptr)) {
+ if (errno != ERANGE || getpw_buf_len >= GETPW_R_SIZE_LIMIT) {
+ rb_free_tmp_buffer(getpw_tmp);
+ rb_sys_fail("getpwnam_r");
}
rb_str_modify_expand(*getpw_tmp, getpw_buf_len);
getpw_buf = RSTRING_PTR(*getpw_tmp);
@@ -5132,29 +5016,28 @@ obj2gid(VALUE id
struct group grbuf;
char *getgr_buf;
long getgr_buf_len;
- int e;
if (!*getgr_tmp) {
getgr_buf_len = GETGR_R_SIZE_INIT;
if (getgr_buf_len < 0) getgr_buf_len = GETGR_R_SIZE_DEFAULT;
- *getgr_tmp = rb_str_tmp_new(getgr_buf_len);
+ getgr_buf = rb_alloc_tmp_buffer(getgr_tmp, getgr_buf_len);
+ }
+ else {
+ getgr_buf = RSTRING_PTR(*getgr_tmp);
+ getgr_buf_len = rb_str_capacity(*getgr_tmp);
}
- getgr_buf = RSTRING_PTR(*getgr_tmp);
- getgr_buf_len = rb_str_capacity(*getgr_tmp);
- rb_str_set_len(*getgr_tmp, getgr_buf_len);
- errno = 0;
- while ((e = getgrnam_r(grpname, &grbuf, getgr_buf, getgr_buf_len, &grptr)) != 0) {
- if (e != ERANGE || getgr_buf_len >= GETGR_R_SIZE_LIMIT) {
- rb_str_resize(*getgr_tmp, 0);
- rb_syserr_fail(e, "getgrnam_r");
+ errno = ERANGE;
+ /* gegrnam_r() on MacOS X doesn't set errno if buffer size is insufficient */
+ while (getgrnam_r(grpname, &grbuf, getgr_buf, getgr_buf_len, &grptr)) {
+ if (errno != ERANGE || getgr_buf_len >= GETGR_R_SIZE_LIMIT) {
+ rb_free_tmp_buffer(getgr_tmp);
+ rb_sys_fail("getgrnam_r");
}
rb_str_modify_expand(*getgr_tmp, getgr_buf_len);
getgr_buf = RSTRING_PTR(*getgr_tmp);
getgr_buf_len = rb_str_capacity(*getgr_tmp);
}
-#elif defined(HAVE_GETGRNAM)
- grptr = getgrnam(grpname);
#else
- grptr = NULL;
+ grptr = getgrnam(grpname);
#endif
if (!grptr) {
#if !defined(USE_GETGRNAM_R) && defined(HAVE_ENDGRENT)
@@ -5317,9 +5200,9 @@ p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
/*
* call-seq:
- * Process.uid -> integer
- * Process::UID.rid -> integer
- * Process::Sys.getuid -> integer
+ * Process.uid -> fixnum
+ * Process::UID.rid -> fixnum
+ * Process::Sys.getuid -> fixnum
*
* Returns the (real) user ID of this process.
*
@@ -5403,7 +5286,7 @@ setreuid(rb_uid_t ruid, rb_uid_t euid)
/*
* call-seq:
- * Process::UID.change_privilege(user) -> integer
+ * Process::UID.change_privilege(user) -> fixnum
*
* Change the current process's real and effective user ID to that
* specified by _user_. Returns the new user ID. Not
@@ -5536,7 +5419,8 @@ p_uid_change_privilege(VALUE obj, VALUE id)
if (setruid(uid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_44BSD_SETUID
if (getuid() == uid) {
@@ -5545,21 +5429,24 @@ p_uid_change_privilege(VALUE obj, VALUE id)
SAVED_USER_ID = uid;
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_SETEUID
if (getuid() == uid && SAVED_USER_ID == uid) {
if (seteuid(uid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_SETUID
if (getuid() == uid && SAVED_USER_ID == uid) {
if (setuid(uid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#else
rb_notimplement();
@@ -5710,6 +5597,7 @@ p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
static VALUE
p_sys_issetugid(VALUE obj)
{
+ rb_secure(2);
if (issetugid()) {
return Qtrue;
}
@@ -5724,9 +5612,9 @@ p_sys_issetugid(VALUE obj)
/*
* call-seq:
- * Process.gid -> integer
- * Process::GID.rid -> integer
- * Process::Sys.getgid -> integer
+ * Process.gid -> fixnum
+ * Process::GID.rid -> fixnum
+ * Process::Sys.getgid -> fixnum
*
* Returns the (real) group ID for this process.
*
@@ -5744,7 +5632,7 @@ proc_getgid(VALUE obj)
#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETRGID) || defined(HAVE_SETGID)
/*
* call-seq:
- * Process.gid= integer -> integer
+ * Process.gid= fixnum -> fixnum
*
* Sets the group ID for this process.
*/
@@ -5780,7 +5668,7 @@ proc_setgid(VALUE obj, VALUE id)
#endif
-#if defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX)
+#if defined(HAVE_SETGROUPS) || defined(HAVE_GETGROUPS)
/*
* Maximum supplementary groups are platform dependent.
* FWIW, 65536 is enough big for our supported OSs.
@@ -5940,7 +5828,7 @@ proc_setgroups(VALUE obj, VALUE ary)
static VALUE
proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
{
- if (initgroups(StringValueCStr(uname), OBJ2GID(base_grp)) != 0) {
+ if (initgroups(StringValuePtr(uname), OBJ2GID(base_grp)) != 0) {
rb_sys_fail(0);
}
return proc_getgroups(obj);
@@ -5952,7 +5840,7 @@ proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
#if defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX)
/*
* call-seq:
- * Process.maxgroups -> integer
+ * Process.maxgroups -> fixnum
*
* Returns the maximum number of gids allowed in the supplemental
* group access list.
@@ -5972,7 +5860,7 @@ proc_getmaxgroups(VALUE obj)
#ifdef HAVE_SETGROUPS
/*
* call-seq:
- * Process.maxgroups= integer -> integer
+ * Process.maxgroups= fixnum -> fixnum
*
* Sets the maximum number of gids allowed in the supplemental group
* access list.
@@ -6021,15 +5909,14 @@ static int rb_daemon(int nochdir, int noclose);
static VALUE
proc_daemon(int argc, VALUE *argv)
{
- int n, nochdir = FALSE, noclose = FALSE;
+ VALUE nochdir, noclose;
+ int n;
- switch (rb_check_arity(argc, 0, 2)) {
- case 2: noclose = RTEST(argv[1]);
- case 1: nochdir = RTEST(argv[0]);
- }
+ rb_secure(2);
+ rb_scan_args(argc, argv, "02", &nochdir, &noclose);
prefork();
- n = rb_daemon(nochdir, noclose);
+ n = rb_daemon(RTEST(nochdir), RTEST(noclose));
if (n < 0) rb_sys_fail("daemon");
return INT2FIX(n);
}
@@ -6107,7 +5994,7 @@ setregid(rb_gid_t rgid, rb_gid_t egid)
/*
* call-seq:
- * Process::GID.change_privilege(group) -> integer
+ * Process::GID.change_privilege(group) -> fixnum
*
* Change the current process's real and effective group ID to that
* specified by _group_. Returns the new group ID. Not
@@ -6240,7 +6127,8 @@ p_gid_change_privilege(VALUE obj, VALUE id)
if (setrgid(gid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_44BSD_SETGID
if (getgid() == gid) {
@@ -6249,21 +6137,24 @@ p_gid_change_privilege(VALUE obj, VALUE id)
SAVED_GROUP_ID = gid;
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_SETEGID
if (getgid() == gid && SAVED_GROUP_ID == gid) {
if (setegid(gid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#elif defined HAVE_SETGID
if (getgid() == gid && SAVED_GROUP_ID == gid) {
if (setgid(gid) < 0) rb_sys_fail(0);
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
#else
(void)gid;
@@ -6276,9 +6167,9 @@ p_gid_change_privilege(VALUE obj, VALUE id)
/*
* call-seq:
- * Process.euid -> integer
- * Process::UID.eid -> integer
- * Process::Sys.geteuid -> integer
+ * Process.euid -> fixnum
+ * Process::UID.eid -> fixnum
+ * Process::Sys.geteuid -> fixnum
*
* Returns the effective user ID for this process.
*
@@ -6377,8 +6268,8 @@ rb_seteuid_core(rb_uid_t euid)
/*
* call-seq:
- * Process::UID.grant_privilege(user) -> integer
- * Process::UID.eid= user -> integer
+ * Process::UID.grant_privilege(user) -> fixnum
+ * Process::UID.eid= user -> fixnum
*
* Set the effective user ID, and if possible, the saved user ID of
* the process to the given _user_. Returns the new
@@ -6399,9 +6290,9 @@ p_uid_grant_privilege(VALUE obj, VALUE id)
/*
* call-seq:
- * Process.egid -> integer
- * Process::GID.eid -> integer
- * Process::Sys.geteid -> integer
+ * Process.egid -> fixnum
+ * Process::GID.eid -> fixnum
+ * Process::Sys.geteid -> fixnum
*
* Returns the effective group ID for this process. Not available on
* all platforms.
@@ -6420,7 +6311,7 @@ proc_getegid(VALUE obj)
#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) || defined(_POSIX_SAVED_IDS)
/*
* call-seq:
- * Process.egid = integer -> integer
+ * Process.egid = fixnum -> fixnum
*
* Sets the effective group ID for this process. Not available on all
* platforms.
@@ -6507,8 +6398,8 @@ rb_setegid_core(rb_gid_t egid)
/*
* call-seq:
- * Process::GID.grant_privilege(group) -> integer
- * Process::GID.eid = group -> integer
+ * Process::GID.grant_privilege(group) -> fixnum
+ * Process::GID.eid = group -> fixnum
*
* Set the effective group ID, and if possible, the saved group ID of
* the process to the given _group_. Returns the new
@@ -6551,7 +6442,7 @@ p_uid_exchangeable(void)
/*
* call-seq:
- * Process::UID.re_exchange -> integer
+ * Process::UID.re_exchange -> fixnum
*
* Exchange real and effective user IDs and return the new effective
* user ID. Not available on all platforms.
@@ -6613,7 +6504,7 @@ p_gid_exchangeable(void)
/*
* call-seq:
- * Process::GID.re_exchange -> integer
+ * Process::GID.re_exchange -> fixnum
*
* Exchange real and effective group IDs and return the new effective
* group ID. Not available on all platforms.
@@ -6684,7 +6575,7 @@ p_uid_sw_ensure(rb_uid_t id)
/*
* call-seq:
- * Process::UID.switch -> integer
+ * Process::UID.switch -> fixnum
* Process::UID.switch {|| block} -> object
*
* Switch the effective and real user IDs of the current process. If
@@ -6726,7 +6617,8 @@ p_uid_switch(VALUE obj)
}
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
UNREACHABLE;
@@ -6750,7 +6642,8 @@ p_uid_switch(VALUE obj)
euid = geteuid();
if (uid == euid) {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
p_uid_exchange(obj);
if (rb_block_given_p()) {
@@ -6797,7 +6690,7 @@ p_gid_sw_ensure(rb_gid_t id)
/*
* call-seq:
- * Process::GID.switch -> integer
+ * Process::GID.switch -> fixnum
* Process::GID.switch {|| block} -> object
*
* Switch the effective and real group IDs of the current process. If
@@ -6839,7 +6732,8 @@ p_gid_switch(VALUE obj)
}
}
else {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
UNREACHABLE;
@@ -6863,7 +6757,8 @@ p_gid_switch(VALUE obj)
egid = getegid();
if (gid == egid) {
- rb_syserr_fail(EPERM, 0);
+ errno = EPERM;
+ rb_sys_fail(0);
}
p_gid_exchange(obj);
if (rb_block_given_p()) {
@@ -6912,26 +6807,15 @@ get_clk_tck(void)
VALUE
rb_proc_times(VALUE obj)
{
- VALUE utime, stime, cutime, cstime, ret;
-#if defined(RUSAGE_SELF) && defined(RUSAGE_CHILDREN)
- struct rusage usage_s, usage_c;
-
- if (getrusage(RUSAGE_SELF, &usage_s) != 0 || getrusage(RUSAGE_CHILDREN, &usage_c) != 0)
- rb_sys_fail("getrusage");
- utime = DBL2NUM((double)usage_s.ru_utime.tv_sec + (double)usage_s.ru_utime.tv_usec/1e6);
- stime = DBL2NUM((double)usage_s.ru_stime.tv_sec + (double)usage_s.ru_stime.tv_usec/1e6);
- cutime = DBL2NUM((double)usage_c.ru_utime.tv_sec + (double)usage_c.ru_utime.tv_usec/1e6);
- cstime = DBL2NUM((double)usage_c.ru_stime.tv_sec + (double)usage_c.ru_stime.tv_usec/1e6);
-#else
const double hertz = get_clk_tck();
struct tms buf;
+ VALUE utime, stime, cutime, cstime, ret;
times(&buf);
utime = DBL2NUM(buf.tms_utime / hertz);
stime = DBL2NUM(buf.tms_stime / hertz);
cutime = DBL2NUM(buf.tms_cutime / hertz);
cstime = DBL2NUM(buf.tms_cstime / hertz);
-#endif
ret = rb_struct_new(rb_cProcessTms, utime, stime, cutime, cstime);
RB_GC_GUARD(utime);
RB_GC_GUARD(stime);
@@ -6948,16 +6832,13 @@ typedef LONG_LONG timetick_int_t;
#define TIMETICK_INT_MIN LLONG_MIN
#define TIMETICK_INT_MAX LLONG_MAX
#define TIMETICK_INT2NUM(v) LL2NUM(v)
-#define MUL_OVERFLOW_TIMETICK_P(a, b) MUL_OVERFLOW_LONG_LONG_P(a, b)
#else
typedef long timetick_int_t;
#define TIMETICK_INT_MIN LONG_MIN
#define TIMETICK_INT_MAX LONG_MAX
#define TIMETICK_INT2NUM(v) LONG2NUM(v)
-#define MUL_OVERFLOW_TIMETICK_P(a, b) MUL_OVERFLOW_LONG_P(a, b)
#endif
-CONSTFUNC(static timetick_int_t gcd_timetick_int(timetick_int_t, timetick_int_t));
static timetick_int_t
gcd_timetick_int(timetick_int_t a, timetick_int_t b)
{
@@ -7070,7 +6951,8 @@ timetick2integer(struct timetick *ttp,
timetick_int_t t = ttp->giga_count * 1000000000 + ttp->count;
for (i = 0; i < num_numerators; i++) {
timetick_int_t factor = numerators[i];
- if (MUL_OVERFLOW_TIMETICK_P(factor, t))
+ if (MUL_OVERFLOW_SIGNED_INTEGER_P(factor, t,
+ TIMETICK_INT_MIN, TIMETICK_INT_MAX))
goto generic;
t *= factor;
}
@@ -7102,30 +6984,30 @@ make_clock_result(struct timetick *ttp,
timetick_int_t *denominators, int num_denominators,
VALUE unit)
{
- if (unit == ID2SYM(id_nanosecond)) {
+ if (unit == ID2SYM(rb_intern("nanosecond"))) {
numerators[num_numerators++] = 1000000000;
return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (unit == ID2SYM(id_microsecond)) {
+ else if (unit == ID2SYM(rb_intern("microsecond"))) {
numerators[num_numerators++] = 1000000;
return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (unit == ID2SYM(id_millisecond)) {
+ else if (unit == ID2SYM(rb_intern("millisecond"))) {
numerators[num_numerators++] = 1000;
return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (unit == ID2SYM(id_second)) {
+ else if (unit == ID2SYM(rb_intern("second"))) {
return timetick2integer(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (unit == ID2SYM(id_float_microsecond)) {
+ else if (unit == ID2SYM(rb_intern("float_microsecond"))) {
numerators[num_numerators++] = 1000000;
return timetick2dblnum(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (unit == ID2SYM(id_float_millisecond)) {
+ else if (unit == ID2SYM(rb_intern("float_millisecond"))) {
numerators[num_numerators++] = 1000;
return timetick2dblnum(ttp, numerators, num_numerators, denominators, num_denominators);
}
- else if (NIL_P(unit) || unit == ID2SYM(id_float_second)) {
+ else if (NIL_P(unit) || unit == ID2SYM(rb_intern("float_second"))) {
return timetick2dblnum(ttp, numerators, num_numerators, denominators, num_denominators);
}
else
@@ -7156,16 +7038,16 @@ get_mach_timebase_info(void)
* #=> 896053.968060096
*
* +clock_id+ specifies a kind of clock.
- * It is specified as a constant which begins with <code>Process::CLOCK_</code>
+ * It is specifed as a constant which begins with <code>Process::CLOCK_</code>
* such as Process::CLOCK_REALTIME and Process::CLOCK_MONOTONIC.
*
* The supported constants depends on OS and version.
* Ruby provides following types of +clock_id+ if available.
*
- * [CLOCK_REALTIME] SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1, macOS 10.12
- * [CLOCK_MONOTONIC] SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4, macOS 10.12
- * [CLOCK_PROCESS_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, OpenBSD 5.4, macOS 10.12
- * [CLOCK_THREAD_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD 5.4, macOS 10.12
+ * [CLOCK_REALTIME] SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1
+ * [CLOCK_MONOTONIC] SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4
+ * [CLOCK_PROCESS_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, OpenBSD 5.4
+ * [CLOCK_THREAD_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD 5.4
* [CLOCK_VIRTUAL] FreeBSD 3.0, OpenBSD 2.1
* [CLOCK_PROF] FreeBSD 3.0, OpenBSD 2.1
* [CLOCK_REALTIME_FAST] FreeBSD 8.1
@@ -7175,14 +7057,11 @@ get_mach_timebase_info(void)
* [CLOCK_MONOTONIC_FAST] FreeBSD 8.1
* [CLOCK_MONOTONIC_PRECISE] FreeBSD 8.1
* [CLOCK_MONOTONIC_COARSE] Linux 2.6.32
- * [CLOCK_MONOTONIC_RAW] Linux 2.6.28, macOS 10.12
- * [CLOCK_MONOTONIC_RAW_APPROX] macOS 10.12
+ * [CLOCK_MONOTONIC_RAW] Linux 2.6.28
* [CLOCK_BOOTTIME] Linux 2.6.39
* [CLOCK_BOOTTIME_ALARM] Linux 3.0
* [CLOCK_UPTIME] FreeBSD 7.0, OpenBSD 5.5
* [CLOCK_UPTIME_FAST] FreeBSD 8.1
- * [CLOCK_UPTIME_RAW] macOS 10.12
- * [CLOCK_UPTIME_RAW_APPROX] macOS 10.12
* [CLOCK_UPTIME_PRECISE] FreeBSD 8.1
* [CLOCK_SECOND] FreeBSD 8.1
*
@@ -7275,6 +7154,7 @@ get_mach_timebase_info(void)
VALUE
rb_clock_gettime(int argc, VALUE *argv)
{
+ VALUE clk_id, unit;
int ret;
struct timetick tt;
@@ -7283,8 +7163,7 @@ rb_clock_gettime(int argc, VALUE *argv)
int num_numerators = 0;
int num_denominators = 0;
- VALUE unit = (rb_check_arity(argc, 1, 2) == 2) ? argv[1] : Qnil;
- VALUE clk_id = argv[0];
+ rb_scan_args(argc, argv, "11", &clk_id, &unit);
if (SYMBOL_P(clk_id)) {
/*
@@ -7294,7 +7173,7 @@ rb_clock_gettime(int argc, VALUE *argv)
* GETTIMEOFDAY_BASED_CLOCK_REALTIME is used for
* CLOCK_REALTIME if clock_gettime is not available.
*/
-#define RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME ID2SYM(id_GETTIMEOFDAY_BASED_CLOCK_REALTIME)
+#define RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME ID2SYM(rb_intern("GETTIMEOFDAY_BASED_CLOCK_REALTIME"))
if (clk_id == RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME) {
struct timeval tv;
ret = gettimeofday(&tv, 0);
@@ -7306,7 +7185,7 @@ rb_clock_gettime(int argc, VALUE *argv)
goto success;
}
-#define RUBY_TIME_BASED_CLOCK_REALTIME ID2SYM(id_TIME_BASED_CLOCK_REALTIME)
+#define RUBY_TIME_BASED_CLOCK_REALTIME ID2SYM(rb_intern("TIME_BASED_CLOCK_REALTIME"))
if (clk_id == RUBY_TIME_BASED_CLOCK_REALTIME) {
time_t t;
t = time(NULL);
@@ -7320,7 +7199,7 @@ rb_clock_gettime(int argc, VALUE *argv)
#ifdef HAVE_TIMES
#define RUBY_TIMES_BASED_CLOCK_MONOTONIC \
- ID2SYM(id_TIMES_BASED_CLOCK_MONOTONIC)
+ ID2SYM(rb_intern("TIMES_BASED_CLOCK_MONOTONIC"))
if (clk_id == RUBY_TIMES_BASED_CLOCK_MONOTONIC) {
struct tms buf;
clock_t c;
@@ -7338,7 +7217,7 @@ rb_clock_gettime(int argc, VALUE *argv)
#ifdef RUSAGE_SELF
#define RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID \
- ID2SYM(id_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID)
+ ID2SYM(rb_intern("GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID"))
if (clk_id == RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID) {
struct rusage usage;
int32_t usec;
@@ -7359,7 +7238,7 @@ rb_clock_gettime(int argc, VALUE *argv)
#ifdef HAVE_TIMES
#define RUBY_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID \
- ID2SYM(id_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID)
+ ID2SYM(rb_intern("TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID"))
if (clk_id == RUBY_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID) {
struct tms buf;
unsigned_clock_t utime, stime;
@@ -7379,7 +7258,7 @@ rb_clock_gettime(int argc, VALUE *argv)
#endif
#define RUBY_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID \
- ID2SYM(id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID)
+ ID2SYM(rb_intern("CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID"))
if (clk_id == RUBY_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID) {
clock_t c;
unsigned_clock_t uc;
@@ -7395,7 +7274,7 @@ rb_clock_gettime(int argc, VALUE *argv)
}
#ifdef __APPLE__
-#define RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC ID2SYM(id_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC)
+#define RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC ID2SYM(rb_intern("MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC"))
if (clk_id == RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC) {
mach_timebase_info_data_t *info = get_mach_timebase_info();
uint64_t t = mach_absolute_time();
@@ -7423,7 +7302,8 @@ rb_clock_gettime(int argc, VALUE *argv)
#endif
}
/* EINVAL emulates clock_gettime behavior when clock_id is invalid. */
- rb_syserr_fail(EINVAL, 0);
+ errno = EINVAL;
+ rb_sys_fail(0);
success:
return make_clock_result(&tt, numerators, num_numerators, denominators, num_denominators, unit);
@@ -7470,14 +7350,15 @@ rb_clock_gettime(int argc, VALUE *argv)
VALUE
rb_clock_getres(int argc, VALUE *argv)
{
+ VALUE clk_id, unit;
+
struct timetick tt;
timetick_int_t numerators[2];
timetick_int_t denominators[2];
int num_numerators = 0;
int num_denominators = 0;
- VALUE unit = (rb_check_arity(argc, 1, 2) == 2) ? argv[1] : Qnil;
- VALUE clk_id = argv[0];
+ rb_scan_args(argc, argv, "11", &clk_id, &unit);
if (SYMBOL_P(clk_id)) {
#ifdef RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME
@@ -7560,10 +7441,11 @@ rb_clock_getres(int argc, VALUE *argv)
#endif
}
/* EINVAL emulates clock_getres behavior when clock_id is invalid. */
- rb_syserr_fail(EINVAL, 0);
+ errno = EINVAL;
+ rb_sys_fail(0);
success:
- if (unit == ID2SYM(id_hertz)) {
+ if (unit == ID2SYM(rb_intern("hertz"))) {
return timetick2dblnum_reciprocal(&tt, numerators, num_numerators, denominators, num_denominators);
}
else {
@@ -7583,7 +7465,7 @@ VALUE rb_mProcID_Syscall;
*/
void
-InitVM_process(void)
+Init_process(void)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
@@ -7621,7 +7503,6 @@ InitVM_process(void)
rb_define_singleton_method(rb_mProcess, "exit!", rb_f_exit_bang, -1);
rb_define_singleton_method(rb_mProcess, "exit", rb_f_exit, -1);
rb_define_singleton_method(rb_mProcess, "abort", rb_f_abort, -1);
- rb_define_singleton_method(rb_mProcess, "last_status", proc_s_last_status, 0);
rb_define_module_function(rb_mProcess, "kill", rb_f_kill, -1); /* in signal.c */
rb_define_module_function(rb_mProcess, "wait", proc_wait, -1);
@@ -7838,104 +7719,69 @@ InitVM_process(void)
rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0);
#ifdef CLOCK_REALTIME
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME", CLOCKID2NUM(CLOCK_REALTIME));
#elif defined(RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME)
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME", RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME);
#endif
#ifdef CLOCK_MONOTONIC
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", CLOCKID2NUM(CLOCK_MONOTONIC));
#elif defined(RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC)
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC);
#endif
#ifdef CLOCK_PROCESS_CPUTIME_ID
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_PROCESS_CPUTIME_ID", CLOCKID2NUM(CLOCK_PROCESS_CPUTIME_ID));
#elif defined(RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID)
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_PROCESS_CPUTIME_ID", RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID);
#endif
#ifdef CLOCK_THREAD_CPUTIME_ID
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_THREAD_CPUTIME_ID", CLOCKID2NUM(CLOCK_THREAD_CPUTIME_ID));
#endif
#ifdef CLOCK_VIRTUAL
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_VIRTUAL", CLOCKID2NUM(CLOCK_VIRTUAL));
#endif
#ifdef CLOCK_PROF
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_PROF", CLOCKID2NUM(CLOCK_PROF));
#endif
#ifdef CLOCK_REALTIME_FAST
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME_FAST", CLOCKID2NUM(CLOCK_REALTIME_FAST));
#endif
#ifdef CLOCK_REALTIME_PRECISE
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME_PRECISE", CLOCKID2NUM(CLOCK_REALTIME_PRECISE));
#endif
#ifdef CLOCK_REALTIME_COARSE
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME_COARSE", CLOCKID2NUM(CLOCK_REALTIME_COARSE));
#endif
#ifdef CLOCK_REALTIME_ALARM
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_REALTIME_ALARM", CLOCKID2NUM(CLOCK_REALTIME_ALARM));
#endif
#ifdef CLOCK_MONOTONIC_FAST
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_FAST", CLOCKID2NUM(CLOCK_MONOTONIC_FAST));
#endif
#ifdef CLOCK_MONOTONIC_PRECISE
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_PRECISE", CLOCKID2NUM(CLOCK_MONOTONIC_PRECISE));
#endif
#ifdef CLOCK_MONOTONIC_RAW
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW", CLOCKID2NUM(CLOCK_MONOTONIC_RAW));
#endif
-#ifdef CLOCK_MONOTONIC_RAW_APPROX
- /* see Process.clock_gettime */
- rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW_APPROX", CLOCKID2NUM(CLOCK_MONOTONIC_RAW_APPROX));
-#endif
#ifdef CLOCK_MONOTONIC_COARSE
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_COARSE", CLOCKID2NUM(CLOCK_MONOTONIC_COARSE));
#endif
#ifdef CLOCK_BOOTTIME
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_BOOTTIME", CLOCKID2NUM(CLOCK_BOOTTIME));
#endif
#ifdef CLOCK_BOOTTIME_ALARM
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_BOOTTIME_ALARM", CLOCKID2NUM(CLOCK_BOOTTIME_ALARM));
#endif
#ifdef CLOCK_UPTIME
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_UPTIME", CLOCKID2NUM(CLOCK_UPTIME));
#endif
#ifdef CLOCK_UPTIME_FAST
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_UPTIME_FAST", CLOCKID2NUM(CLOCK_UPTIME_FAST));
#endif
#ifdef CLOCK_UPTIME_PRECISE
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_UPTIME_PRECISE", CLOCKID2NUM(CLOCK_UPTIME_PRECISE));
#endif
-#ifdef CLOCK_UPTIME_RAW
- /* see Process.clock_gettime */
- rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW", CLOCKID2NUM(CLOCK_UPTIME_RAW));
-#endif
-#ifdef CLOCK_UPTIME_RAW_APPROX
- /* see Process.clock_gettime */
- rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW_APPROX", CLOCKID2NUM(CLOCK_UPTIME_RAW_APPROX));
-#endif
#ifdef CLOCK_SECOND
- /* see Process.clock_gettime */
rb_define_const(rb_mProcess, "CLOCK_SECOND", CLOCKID2NUM(CLOCK_SECOND));
#endif
rb_define_module_function(rb_mProcess, "clock_gettime", rb_clock_gettime, -1);
@@ -8000,50 +7846,3 @@ InitVM_process(void)
rb_define_module_function(rb_mProcID_Syscall, "setresgid", p_sys_setresgid, 3);
rb_define_module_function(rb_mProcID_Syscall, "issetugid", p_sys_issetugid, 0);
}
-
-void
-Init_process(void)
-{
- id_in = rb_intern("in");
- id_out = rb_intern("out");
- id_err = rb_intern("err");
- id_pid = rb_intern("pid");
- id_uid = rb_intern("uid");
- id_gid = rb_intern("gid");
- id_close = rb_intern("close");
- id_child = rb_intern("child");
-#ifdef HAVE_SETPGID
- id_pgroup = rb_intern("pgroup");
-#endif
-#ifdef _WIN32
- id_new_pgroup = rb_intern("new_pgroup");
-#endif
- id_unsetenv_others = rb_intern("unsetenv_others");
- id_chdir = rb_intern("chdir");
- id_umask = rb_intern("umask");
- id_close_others = rb_intern("close_others");
- id_ENV = rb_intern("ENV");
- id_nanosecond = rb_intern("nanosecond");
- id_microsecond = rb_intern("microsecond");
- id_millisecond = rb_intern("millisecond");
- id_second = rb_intern("second");
- id_float_microsecond = rb_intern("float_microsecond");
- id_float_millisecond = rb_intern("float_millisecond");
- id_float_second = rb_intern("float_second");
- id_GETTIMEOFDAY_BASED_CLOCK_REALTIME = rb_intern("GETTIMEOFDAY_BASED_CLOCK_REALTIME");
- id_TIME_BASED_CLOCK_REALTIME = rb_intern("TIME_BASED_CLOCK_REALTIME");
-#ifdef HAVE_TIMES
- id_TIMES_BASED_CLOCK_MONOTONIC = rb_intern("TIMES_BASED_CLOCK_MONOTONIC");
- id_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern("TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID");
-#endif
-#ifdef RUSAGE_SELF
- id_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern("GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID");
-#endif
- id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID = rb_intern("CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID");
-#ifdef __APPLE__
- id_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC = rb_intern("MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC");
-#endif
- id_hertz = rb_intern("hertz");
-
- InitVM(process);
-}
diff --git a/random.c b/random.c
index 4fbbebfc14..a1deecf5d7 100644
--- a/random.c
+++ b/random.c
@@ -59,6 +59,7 @@ The original copyright notice follows.
email: matumoto@math.keio.ac.jp
*/
+#include "ruby/ruby.h"
#include "internal.h"
#include <limits.h>
@@ -77,17 +78,14 @@ The original copyright notice follows.
#include <sys/time.h>
#endif
-#ifdef HAVE_SYSCALL_H
-#include <syscall.h>
-#elif defined HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
-#endif
-
#ifdef _WIN32
-#include <windows.h>
+# if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0400
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x400
+# undef __WINCRYPT_H__
+# endif
#include <wincrypt.h>
#endif
-#include "ruby_atomic.h"
typedef int int_must_be_32bit_at_least[sizeof(int) * CHAR_BIT < 32 ? -1 : 1];
@@ -104,8 +102,8 @@ enum {MT_MAX_STATE = N};
struct MT {
/* assume int is enough to store 32bits */
- uint32_t state[N]; /* the array for the state vector */
- uint32_t *next;
+ unsigned int state[N]; /* the array for the state vector */
+ unsigned int *next;
int left;
};
@@ -135,7 +133,7 @@ init_genrand(struct MT *mt, unsigned int s)
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
static void
-init_by_array(struct MT *mt, const uint32_t init_key[], int key_length)
+init_by_array(struct MT *mt, unsigned int init_key[], int key_length)
{
int i, j, k;
init_genrand(mt, 19650218U);
@@ -163,7 +161,7 @@ init_by_array(struct MT *mt, const uint32_t init_key[], int key_length)
static void
next_state(struct MT *mt)
{
- uint32_t *p = mt->state;
+ unsigned int *p = mt->state;
int j;
mt->left = N;
@@ -198,26 +196,16 @@ genrand_int32(struct MT *mt)
}
/* generates a random number on [0,1) with 53-bit resolution*/
-static double int_pair_to_real_exclusive(uint32_t a, uint32_t b);
static double
genrand_real(struct MT *mt)
{
/* mt must be initialized */
- unsigned int a = genrand_int32(mt), b = genrand_int32(mt);
- return int_pair_to_real_exclusive(a, b);
-}
-
-static double
-int_pair_to_real_exclusive(uint32_t a, uint32_t b)
-{
- a >>= 5;
- b >>= 6;
+ unsigned int a = genrand_int32(mt)>>5, b = genrand_int32(mt)>>6;
return(a*67108864.0+b)*(1.0/9007199254740992.0);
}
/* generates a random number on [0,1] with 53-bit resolution*/
static double int_pair_to_real_inclusive(uint32_t a, uint32_t b);
-#if 0
static double
genrand_real2(struct MT *mt)
{
@@ -225,7 +213,6 @@ genrand_real2(struct MT *mt)
uint32_t a = genrand_int32(mt), b = genrand_int32(mt);
return int_pair_to_real_inclusive(a, b);
}
-#endif
/* These real versions are due to Isaku Wada, 2002/01/09 added */
@@ -279,23 +266,41 @@ rb_genrand_real(void)
static double
int_pair_to_real_inclusive(uint32_t a, uint32_t b)
{
+ VALUE x;
+ VALUE m;
+ uint32_t xary[2], mary[2];
double r;
- enum {dig = 53};
- enum {dig_u = dig-32, dig_r64 = 64-dig, bmask = ~(~0u<<(dig_r64))};
-#if defined HAVE_UINT128_T
- const uint128_t m = ((uint128_t)1 << dig) | 1;
- uint128_t x = ((uint128_t)a << 32) | b;
- r = (double)(uint64_t)((x * m) >> 64);
-#elif defined HAVE_UINT64_T && !(defined _MSC_VER && _MSC_VER <= 1200)
- uint64_t x = ((uint64_t)a << dig_u) +
- (((uint64_t)b + (a >> dig_u)) >> dig_r64);
- r = (double)x;
+
+ /* (a << 32) | b */
+ xary[0] = a;
+ xary[1] = b;
+ x = rb_integer_unpack(xary, 2, sizeof(uint32_t), 0,
+ INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER|
+ INTEGER_PACK_FORCE_BIGNUM);
+
+ /* (1 << 53) | 1 */
+ mary[0] = 0x00200000;
+ mary[1] = 0x00000001;
+ m = rb_integer_unpack(mary, 2, sizeof(uint32_t), 0,
+ INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER|
+ INTEGER_PACK_FORCE_BIGNUM);
+
+ x = rb_big_mul(x, m);
+ if (FIXNUM_P(x)) {
+#if CHAR_BIT * SIZEOF_LONG > 64
+ r = (double)(FIX2ULONG(x) >> 64);
#else
- /* shift then add to get rid of overflow */
- b = (b >> dig_r64) + (((a >> dig_u) + (b & bmask)) >> dig_r64);
- r = (double)a * (1 << dig_u) + b;
+ return 0.0;
#endif
- return ldexp(r, -dig);
+ }
+ else {
+ uint32_t uary[4];
+ rb_integer_pack(x, uary, numberof(uary), sizeof(uint32_t), 0,
+ INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
+ /* r = x >> 64 */
+ r = (double)uary[0] * (0x10000 * (double)0x10000) + (double)uary[1];
+ }
+ return ldexp(r, -53);
}
VALUE rb_cRandom;
@@ -320,7 +325,7 @@ random_free(void *ptr)
static size_t
random_memsize(const void *ptr)
{
- return sizeof(rb_random_t);
+ return ptr ? sizeof(rb_random_t) : 0;
}
static const rb_data_type_t random_data_type = {
@@ -330,7 +335,7 @@ static const rb_data_type_t random_data_type = {
random_free,
random_memsize,
},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static rb_random_t *
@@ -338,7 +343,7 @@ get_rnd(VALUE obj)
{
rb_random_t *ptr;
TypedData_Get_Struct(obj, rb_random_t, &random_data_type, ptr);
- return rand_start(ptr);
+ return ptr;
}
static rb_random_t *
@@ -348,7 +353,7 @@ try_get_rnd(VALUE obj)
return rand_start(&default_rand);
}
if (!rb_typeddata_is_kind_of(obj, &random_data_type)) return NULL;
- return rand_start(DATA_PTR(obj));
+ return DATA_PTR(obj);
}
/* :nodoc: */
@@ -362,15 +367,18 @@ random_alloc(VALUE klass)
}
static VALUE
-rand_init(struct MT *mt, VALUE seed)
+rand_init(struct MT *mt, VALUE vseed)
{
+ volatile VALUE seed;
uint32_t buf0[SIZEOF_LONG / SIZEOF_INT32 * 4], *buf = buf0;
size_t len;
int sign;
+ seed = rb_to_int(vseed);
+
len = rb_absint_numwords(seed, 32, NULL);
if (len > numberof(buf0))
- buf = ALLOC_N(uint32_t, len);
+ buf = ALLOC_N(unsigned int, len);
sign = rb_integer_pack(seed, buf, len, sizeof(uint32_t), 0,
INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
if (sign < 0)
@@ -387,7 +395,6 @@ rand_init(struct MT *mt, VALUE seed)
len--;
init_by_array(mt, buf, (int)len);
}
- explicit_bzero(buf, len * sizeof(*buf));
if (buf != buf0) xfree(buf);
return seed;
}
@@ -407,14 +414,13 @@ random_init(int argc, VALUE *argv, VALUE obj)
VALUE vseed;
rb_random_t *rnd = get_rnd(obj);
- if (rb_check_arity(argc, 0, 1) == 0) {
+ if (argc == 0) {
rb_check_frozen(obj);
vseed = random_seed();
}
else {
- vseed = argv[0];
+ rb_scan_args(argc, argv, "01", &vseed);
rb_check_copyable(obj, vseed);
- vseed = rb_to_int(vseed);
}
rnd->seed = rand_init(&rnd->mt, vseed);
return obj;
@@ -428,143 +434,44 @@ random_init(int argc, VALUE *argv, VALUE obj)
# define USE_DEV_URANDOM 0
#endif
-#if USE_DEV_URANDOM
-static int
-fill_random_bytes_urandom(void *seed, size_t size)
+static void
+fill_random_seed(uint32_t seed[DEFAULT_SEED_CNT])
{
- /*
- O_NONBLOCK and O_NOCTTY is meaningless if /dev/urandom correctly points
- to a urandom device. But it protects from several strange hazard if
- /dev/urandom is not a urandom device.
- */
- int fd = rb_cloexec_open("/dev/urandom",
-# ifdef O_NONBLOCK
- O_NONBLOCK|
-# endif
-# ifdef O_NOCTTY
- O_NOCTTY|
-# endif
- O_RDONLY, 0);
+ static int n = 0;
+ struct timeval tv;
+#if USE_DEV_URANDOM
+ int fd;
struct stat statbuf;
- ssize_t ret = 0;
- size_t offset = 0;
-
- if (fd < 0) return -1;
- rb_update_max_fd(fd);
- if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
- do {
- ret = read(fd, ((char*)seed) + offset, size - offset);
- if (ret < 0) {
- close(fd);
- return -1;
- }
- offset += (size_t)ret;
- } while(offset < size);
- }
- close(fd);
- return 0;
-}
-#else
-# define fill_random_bytes_urandom(seed, size) -1
+#elif defined(_WIN32)
+ HCRYPTPROV prov;
#endif
-#if 0
-#elif defined(HAVE_ARC4RANDOM_BUF)
-static int
-fill_random_bytes_syscall(void *buf, size_t size, int unused)
-{
- arc4random_buf(buf, size);
- return 0;
-}
-#elif defined(_WIN32)
-static void
-release_crypt(void *p)
-{
- HCRYPTPROV prov = (HCRYPTPROV)ATOMIC_PTR_EXCHANGE(*(HCRYPTPROV *)p, INVALID_HANDLE_VALUE);
- if (prov && prov != (HCRYPTPROV)INVALID_HANDLE_VALUE) {
- CryptReleaseContext(prov, 0);
- }
-}
+ memset(seed, 0, DEFAULT_SEED_LEN);
-static int
-fill_random_bytes_syscall(void *seed, size_t size, int unused)
-{
- static HCRYPTPROV perm_prov;
- HCRYPTPROV prov = perm_prov, old_prov;
- if (!prov) {
- if (!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
- prov = (HCRYPTPROV)INVALID_HANDLE_VALUE;
- }
- old_prov = (HCRYPTPROV)ATOMIC_PTR_CAS(perm_prov, 0, prov);
- if (LIKELY(!old_prov)) { /* no other threads acquried */
- if (prov != (HCRYPTPROV)INVALID_HANDLE_VALUE) {
- rb_gc_register_mark_object(Data_Wrap_Struct(0, 0, release_crypt, &perm_prov));
- }
- }
- else { /* another thread acquried */
- if (prov != (HCRYPTPROV)INVALID_HANDLE_VALUE) {
- CryptReleaseContext(prov, 0);
+#if USE_DEV_URANDOM
+ if ((fd = rb_cloexec_open("/dev/urandom", O_RDONLY
+#ifdef O_NONBLOCK
+ |O_NONBLOCK
+#endif
+#ifdef O_NOCTTY
+ |O_NOCTTY
+#endif
+ , 0)) >= 0) {
+ rb_update_max_fd(fd);
+ if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
+ if (read(fd, seed, DEFAULT_SEED_LEN) < DEFAULT_SEED_LEN) {
+ /* abandon */;
}
- prov = old_prov;
- }
+ }
+ close(fd);
}
- if (prov == (HCRYPTPROV)INVALID_HANDLE_VALUE) return -1;
- CryptGenRandom(prov, size, seed);
- return 0;
-}
-#elif defined __linux__ && defined __NR_getrandom
-#include <linux/random.h>
-
-# ifndef GRND_NONBLOCK
-# define GRND_NONBLOCK 0x0001 /* not defined in musl libc */
-# endif
-
-static int
-fill_random_bytes_syscall(void *seed, size_t size, int need_secure)
-{
- static rb_atomic_t try_syscall = 1;
- if (try_syscall) {
- long ret;
- size_t offset = 0;
- int flags = 0;
- if (!need_secure)
- flags = GRND_NONBLOCK;
- do {
- errno = 0;
- ret = syscall(__NR_getrandom, ((char*)seed) + offset, size - offset, flags);
- if (ret == -1) {
- ATOMIC_SET(try_syscall, 0);
- return -1;
- }
- offset += (size_t)ret;
- } while(offset < size);
- return 0;
+#elif defined(_WIN32)
+ if (CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
+ CryptGenRandom(prov, DEFAULT_SEED_LEN, (void *)seed);
+ CryptReleaseContext(prov, 0);
}
- return -1;
-}
-#else
-# define fill_random_bytes_syscall(seed, size, need_secure) -1
#endif
-static int
-fill_random_bytes(void *seed, size_t size, int need_secure)
-{
- int ret = fill_random_bytes_syscall(seed, size, need_secure);
- if (ret == 0) return ret;
- return fill_random_bytes_urandom(seed, size);
-}
-
-static void
-fill_random_seed(uint32_t *seed, size_t cnt)
-{
- static int n = 0;
- struct timeval tv;
- size_t len = cnt * sizeof(*seed);
-
- memset(seed, 0, len);
-
- fill_random_bytes(seed, len, TRUE);
-
gettimeofday(&tv, 0);
seed[0] ^= tv.tv_usec;
seed[1] ^= (uint32_t)tv.tv_sec;
@@ -579,13 +486,21 @@ fill_random_seed(uint32_t *seed, size_t cnt)
}
static VALUE
-make_seed_value(uint32_t *ptr, size_t len)
+make_seed_value(const uint32_t *ptr)
{
VALUE seed;
+ size_t len;
+ uint32_t buf[DEFAULT_SEED_CNT+1];
- if (ptr[len-1] <= 1) {
+ if (ptr[DEFAULT_SEED_CNT-1] <= 1) {
/* set leading-zero-guard */
- ptr[len++] = 1;
+ MEMCPY(buf, ptr, uint32_t, DEFAULT_SEED_CNT);
+ buf[DEFAULT_SEED_CNT] = 1;
+ ptr = buf;
+ len = DEFAULT_SEED_CNT+1;
+ }
+ else {
+ len = DEFAULT_SEED_CNT;
}
seed = rb_integer_unpack(ptr, len, sizeof(uint32_t), 0,
@@ -605,39 +520,9 @@ make_seed_value(uint32_t *ptr, size_t len)
static VALUE
random_seed(void)
{
- VALUE v;
- uint32_t buf[DEFAULT_SEED_CNT+1];
- fill_random_seed(buf, DEFAULT_SEED_CNT);
- v = make_seed_value(buf, DEFAULT_SEED_CNT);
- explicit_bzero(buf, DEFAULT_SEED_LEN);
- return v;
-}
-
-/*
- * call-seq: Random.urandom(size) -> string
- *
- * Returns a string, using platform providing features.
- * Returned value is expected to be a cryptographically secure
- * pseudo-random number in binary form.
- * This method raises a RuntimeError if the feature provided by platform
- * failed to prepare the result.
- *
- * In 2017, Linux manpage random(7) writes that "no cryptographic
- * primitive available today can hope to promise more than 256 bits of
- * security". So it might be questionable to pass size > 32 to this
- * method.
- *
- * Random.urandom(8) #=> "\x78\x41\xBA\xAF\x7D\xEA\xD8\xEA"
- */
-static VALUE
-random_raw_seed(VALUE self, VALUE size)
-{
- long n = NUM2ULONG(size);
- VALUE buf = rb_str_new(0, n);
- if (n == 0) return buf;
- if (fill_random_bytes(RSTRING_PTR(buf), n, FALSE))
- rb_raise(rb_eRuntimeError, "failed to get urandom");
- return buf;
+ uint32_t buf[DEFAULT_SEED_CNT];
+ fill_random_seed(buf);
+ return make_seed_value(buf);
}
/*
@@ -797,11 +682,11 @@ rb_f_srand(int argc, VALUE *argv, VALUE obj)
VALUE seed, old;
rb_random_t *r = &default_rand;
- if (rb_check_arity(argc, 0, 1) == 0) {
+ if (argc == 0) {
seed = random_seed();
}
else {
- seed = rb_to_int(argv[0]);
+ rb_scan_args(argc, argv, "01", &seed);
}
old = r->seed;
r->seed = rand_init(&r->mt, seed);
@@ -827,31 +712,21 @@ static unsigned long
limited_rand(struct MT *mt, unsigned long limit)
{
/* mt must be initialized */
+ int i;
unsigned long val, mask;
if (!limit) return 0;
mask = make_mask(limit);
-
-#if 4 < SIZEOF_LONG
- if (0xffffffff < limit) {
- int i;
- retry:
- val = 0;
- for (i = SIZEOF_LONG/SIZEOF_INT32-1; 0 <= i; i--) {
- if ((mask >> (i * 32)) & 0xffffffff) {
- val |= (unsigned long)genrand_int32(mt) << (i * 32);
- val &= mask;
- if (limit < val)
- goto retry;
- }
+ retry:
+ val = 0;
+ for (i = SIZEOF_LONG/SIZEOF_INT32-1; 0 <= i; i--) {
+ if ((mask >> (i * 32)) & 0xffffffff) {
+ val |= (unsigned long)genrand_int32(mt) << (i * 32);
+ val &= mask;
+ if (limit < val)
+ goto retry;
}
- return val;
}
-#endif
-
- do {
- val = genrand_int32(mt) & mask;
- } while (limit < val);
return val;
}
@@ -916,61 +791,21 @@ rb_genrand_ulong_limited(unsigned long limit)
return limited_rand(default_mt(), limit);
}
-static VALUE
-obj_random_bytes(VALUE obj, void *p, long n)
-{
- VALUE len = LONG2NUM(n);
- VALUE v = rb_funcallv_public(obj, id_bytes, 1, &len);
- long l;
- Check_Type(v, T_STRING);
- l = RSTRING_LEN(v);
- if (l < n)
- rb_raise(rb_eRangeError, "random data too short %ld", l);
- else if (l > n)
- rb_raise(rb_eRangeError, "random data too long %ld", l);
- if (p) memcpy(p, RSTRING_PTR(v), n);
- return v;
-}
-
-static unsigned int
-random_int32(rb_random_t *rnd)
-{
- return genrand_int32(&rnd->mt);
-}
-
unsigned int
rb_random_int32(VALUE obj)
{
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
- uint32_t x;
- obj_random_bytes(obj, &x, sizeof(x));
- return (unsigned int)x;
- }
- return random_int32(rnd);
-}
-
-static double
-random_real(VALUE obj, rb_random_t *rnd, int excl)
-{
- uint32_t a, b;
-
- if (!rnd) {
- uint32_t x[2] = {0, 0};
- obj_random_bytes(obj, x, sizeof(x));
- a = x[0];
- b = x[1];
- }
- else {
- a = random_int32(rnd);
- b = random_int32(rnd);
- }
- if (excl) {
- return int_pair_to_real_exclusive(a, b);
- }
- else {
- return int_pair_to_real_inclusive(a, b);
+#if SIZEOF_LONG * CHAR_BIT > 32
+ VALUE lim = ULONG2NUM(0x100000000UL);
+#elif defined HAVE_LONG_LONG
+ VALUE lim = ULL2NUM((LONG_LONG)0xffffffff+1);
+#else
+ VALUE lim = rb_big_plus(ULONG2NUM(0xffffffff), INT2FIX(1));
+#endif
+ return (unsigned int)NUM2ULONG(rb_funcall2(obj, id_rand, 1, &lim));
}
+ return genrand_int32(&rnd->mt);
}
double
@@ -978,7 +813,7 @@ rb_random_real(VALUE obj)
{
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
- VALUE v = rb_funcallv(obj, id_rand, 0, 0);
+ VALUE v = rb_funcall2(obj, id_rand, 0, 0);
double d = NUM2DBL(v);
if (d < 0.0) {
rb_raise(rb_eRangeError, "random number too small %g", d);
@@ -1004,42 +839,14 @@ ulong_to_num_plus_1(unsigned long n)
#endif
}
-static unsigned long
-random_ulong_limited(VALUE obj, rb_random_t *rnd, unsigned long limit)
-{
- if (!limit) return 0;
- if (!rnd) {
- const int w = sizeof(limit) * CHAR_BIT - nlz_long(limit);
- const int n = w > 32 ? sizeof(unsigned long) : sizeof(uint32_t);
- const unsigned long mask = ~(~0UL << w);
- const unsigned long full =
- (size_t)n >= sizeof(unsigned long) ? ~0UL :
- ~(~0UL << n * CHAR_BIT);
- unsigned long val, bits = 0, rest = 0;
- do {
- if (mask & ~rest) {
- union {uint32_t u32; unsigned long ul;} buf;
- obj_random_bytes(obj, &buf, n);
- rest = full;
- bits = (n == sizeof(uint32_t)) ? buf.u32 : buf.ul;
- }
- val = bits;
- bits >>= w;
- rest >>= w;
- val &= mask;
- } while (limit < val);
- return val;
- }
- return limited_rand(&rnd->mt, limit);
-}
-
unsigned long
rb_random_ulong_limited(VALUE obj, unsigned long limit)
{
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
+ extern int rb_num_negative_p(VALUE);
VALUE lim = ulong_to_num_plus_1(limit);
- VALUE v = rb_to_int(rb_funcallv_public(obj, id_rand, 1, &lim));
+ VALUE v = rb_to_int(rb_funcall2(obj, id_rand, 1, &lim));
unsigned long r = NUM2ULONG(v);
if (rb_num_negative_p(v)) {
rb_raise(rb_eRangeError, "random number too small %ld", r);
@@ -1052,37 +859,6 @@ rb_random_ulong_limited(VALUE obj, unsigned long limit)
return limited_rand(&rnd->mt, limit);
}
-static VALUE
-random_ulong_limited_big(VALUE obj, rb_random_t *rnd, VALUE vmax)
-{
- if (!rnd) {
- VALUE v, vtmp;
- size_t i, nlz, len = rb_absint_numwords(vmax, 32, &nlz);
- uint32_t *tmp = ALLOCV_N(uint32_t, vtmp, len * 2);
- uint32_t mask = (uint32_t)~0 >> nlz;
- uint32_t *lim_array = tmp;
- uint32_t *rnd_array = tmp + len;
- int flag = INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER;
- rb_integer_pack(vmax, lim_array, len, sizeof(uint32_t), 0, flag);
-
- retry:
- obj_random_bytes(obj, rnd_array, len * sizeof(uint32_t));
- rnd_array[0] &= mask;
- for (i = 0; i < len; ++i) {
- if (lim_array[i] < rnd_array[i])
- goto retry;
- if (rnd_array[i] < lim_array[i])
- break;
- }
- v = rb_integer_unpack(rnd_array, len, sizeof(uint32_t), 0, flag);
- ALLOCV_END(vtmp);
- return v;
- }
- return limited_big_rand(&rnd->mt, vmax);
-}
-
-static VALUE genrand_bytes(rb_random_t *rnd, long n);
-
/*
* call-seq: prng.bytes(size) -> a_string
*
@@ -1094,16 +870,21 @@ static VALUE genrand_bytes(rb_random_t *rnd, long n);
static VALUE
random_bytes(VALUE obj, VALUE len)
{
- return genrand_bytes(get_rnd(obj), NUM2LONG(rb_to_int(len)));
+ return rb_random_bytes(obj, NUM2LONG(rb_to_int(len)));
}
-static VALUE
-genrand_bytes(rb_random_t *rnd, long n)
+VALUE
+rb_random_bytes(VALUE obj, long n)
{
+ rb_random_t *rnd = try_get_rnd(obj);
VALUE bytes;
char *ptr;
unsigned int r, i;
+ if (!rnd) {
+ VALUE len = LONG2NUM(n);
+ return rb_funcall2(obj, id_bytes, 1, &len);
+ }
bytes = rb_str_new(0, n);
ptr = RSTRING_PTR(bytes);
for (; n >= SIZEOF_INT32; n -= SIZEOF_INT32) {
@@ -1124,16 +905,6 @@ genrand_bytes(rb_random_t *rnd, long n)
return bytes;
}
-VALUE
-rb_random_bytes(VALUE obj, long n)
-{
- rb_random_t *rnd = try_get_rnd(obj);
- if (!rnd) {
- return obj_random_bytes(obj, NULL, n);
- }
- return genrand_bytes(rnd, n);
-}
-
static VALUE
range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
{
@@ -1142,25 +913,26 @@ range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse;
if (endp) *endp = end;
if (!rb_respond_to(end, id_minus)) return Qfalse;
- r = rb_funcallv(end, id_minus, 1, begp);
+ r = rb_funcall2(end, id_minus, 1, begp);
if (NIL_P(r)) return Qfalse;
return r;
}
static VALUE
-rand_int(VALUE obj, rb_random_t *rnd, VALUE vmax, int restrictive)
+rand_int(struct MT *mt, VALUE vmax, int restrictive)
{
/* mt must be initialized */
+ long max;
unsigned long r;
if (FIXNUM_P(vmax)) {
- long max = FIX2LONG(vmax);
+ max = FIX2LONG(vmax);
if (!max) return Qnil;
if (max < 0) {
if (restrictive) return Qnil;
max = -max;
}
- r = random_ulong_limited(obj, rnd, (unsigned long)max - 1);
+ r = limited_rand(mt, (unsigned long)max - 1);
return ULONG2NUM(r);
}
else {
@@ -1172,71 +944,44 @@ rand_int(VALUE obj, rb_random_t *rnd, VALUE vmax, int restrictive)
}
vmax = rb_big_minus(vmax, INT2FIX(1));
if (FIXNUM_P(vmax)) {
- long max = FIX2LONG(vmax);
+ max = FIX2LONG(vmax);
if (max == -1) return Qnil;
- r = random_ulong_limited(obj, rnd, max);
+ r = limited_rand(mt, max);
return LONG2NUM(r);
}
- ret = random_ulong_limited_big(obj, rnd, vmax);
+ ret = limited_big_rand(mt, vmax);
RB_GC_GUARD(vmax);
return ret;
}
}
-NORETURN(static void domain_error(void));
-static void
-domain_error(void)
-{
- VALUE error = INT2FIX(EDOM);
- rb_exc_raise(rb_class_new_instance(1, &error, rb_eSystemCallError));
-}
-
-NORETURN(static void invalid_argument(VALUE));
-static void
-invalid_argument(VALUE arg0)
-{
- rb_raise(rb_eArgError, "invalid argument - %"PRIsVALUE, arg0);
-}
-
-static VALUE
-check_random_number(VALUE v, const VALUE *argv)
-{
- switch (v) {
- case Qfalse:
- (void)NUM2LONG(argv[0]);
- break;
- case Qnil:
- invalid_argument(argv[0]);
- }
- return v;
-}
-
static inline double
float_value(VALUE v)
{
double x = RFLOAT_VALUE(v);
if (isinf(x) || isnan(x)) {
- domain_error();
+ VALUE error = INT2FIX(EDOM);
+ rb_exc_raise(rb_class_new_instance(1, &error, rb_eSystemCallError));
}
return x;
}
static inline VALUE
-rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
+rand_range(struct MT* mt, VALUE range)
{
VALUE beg = Qundef, end = Qundef, vmax, v;
int excl = 0;
if ((v = vmax = range_values(range, &beg, &end, &excl)) == Qfalse)
return Qfalse;
- if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_int(vmax), !NIL_P(v))) {
+ if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
long max;
vmax = v;
v = Qnil;
if (FIXNUM_P(vmax)) {
fixnum:
if ((max = FIX2LONG(vmax) - excl) >= 0) {
- unsigned long r = random_ulong_limited(obj, rnd, (unsigned long)max);
+ unsigned long r = limited_rand(mt, (unsigned long)max);
v = ULONG2NUM(r);
}
}
@@ -1246,7 +991,7 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
excl = 0;
goto fixnum;
}
- v = random_ulong_limited_big(obj, rnd, vmax);
+ v = limited_big_rand(mt, vmax);
}
}
else if (v = rb_check_to_float(vmax), !NIL_P(v)) {
@@ -1259,12 +1004,17 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
mid = max + min;
max -= min;
}
- else if (isnan(max)) {
- domain_error();
+ else {
+ float_value(v);
}
v = Qnil;
if (max > 0.0) {
- r = random_real(obj, rnd, excl);
+ if (excl) {
+ r = genrand_real(mt);
+ }
+ else {
+ r = genrand_real2(mt);
+ }
if (scale > 1) {
return rb_float_new(+(+(+(r - 0.5) * max) * scale) + mid);
}
@@ -1291,13 +1041,13 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
}
}
default:
- return rb_funcallv(beg, id_plus, 1, &v);
+ return rb_funcall2(beg, id_plus, 1, &v);
}
return v;
}
-static VALUE rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd);
+static VALUE rand_random(int argc, VALUE *argv, rb_random_t *rnd);
/*
* call-seq:
@@ -1331,47 +1081,47 @@ static VALUE rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd);
static VALUE
random_rand(int argc, VALUE *argv, VALUE obj)
{
- VALUE v = rand_random(argc, argv, obj, get_rnd(obj));
- check_random_number(v, argv);
- return v;
+ return rand_random(argc, argv, get_rnd(obj));
}
static VALUE
-rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd)
+rand_random(int argc, VALUE *argv, rb_random_t *rnd)
{
VALUE vmax, v;
- if (rb_check_arity(argc, 0, 1) == 0) {
- return rb_float_new(random_real(obj, rnd, TRUE));
+ if (argc == 0) {
+ return rb_float_new(genrand_real(&rnd->mt));
+ }
+ else {
+ rb_check_arity(argc, 0, 1);
}
vmax = argv[0];
- if (NIL_P(vmax)) return Qnil;
- if (!RB_TYPE_P(vmax, T_FLOAT)) {
- v = rb_check_to_int(vmax);
- if (!NIL_P(v)) return rand_int(obj, rnd, v, 1);
+ if (NIL_P(vmax)) {
+ v = Qnil;
}
- v = rb_check_to_float(vmax);
- if (!NIL_P(v)) {
- const double max = float_value(v);
- if (max < 0.0) {
- return Qnil;
- }
- else {
- double r = random_real(obj, rnd, TRUE);
- if (max > 0.0) r *= max;
- return rb_float_new(r);
- }
+ else if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
+ v = rand_int(&rnd->mt, v, 1);
+ }
+ else if (v = rb_check_to_float(vmax), !NIL_P(v)) {
+ double max = float_value(v);
+ if (max > 0.0)
+ v = rb_float_new(max * genrand_real(&rnd->mt));
+ else
+ v = Qnil;
+ }
+ else if ((v = rand_range(&rnd->mt, vmax)) != Qfalse) {
+ /* nothing to do */
+ }
+ else {
+ v = Qnil;
+ (void)NUM2LONG(vmax);
+ }
+ if (NIL_P(v)) {
+ VALUE mesg = rb_str_new_cstr("invalid argument - ");
+ rb_str_append(mesg, rb_obj_as_string(argv[0]));
+ rb_exc_raise(rb_exc_new3(rb_eArgError, mesg));
}
- return rand_range(obj, rnd, vmax);
-}
-static VALUE
-rand_random_number(int argc, VALUE *argv, VALUE obj)
-{
- rb_random_t *rnd = try_get_rnd(obj);
- VALUE v = rand_random(argc, argv, obj, rnd);
- if (NIL_P(v)) v = rand_random(0, 0, obj, rnd);
- else if (!v) invalid_argument(argv[0]);
return v;
}
@@ -1406,10 +1156,11 @@ random_equal(VALUE self, VALUE other)
if (rb_obj_class(self) != rb_obj_class(other)) return Qfalse;
r1 = get_rnd(self);
r2 = get_rnd(other);
+ if (!RTEST(rb_funcall2(r1->seed, rb_intern("=="), 1, &r2->seed))) return Qfalse;
if (memcmp(r1->mt.state, r2->mt.state, sizeof(r1->mt.state))) return Qfalse;
if ((r1->mt.next - r1->mt.state) != (r2->mt.next - r2->mt.state)) return Qfalse;
if (r1->mt.left != r2->mt.left) return Qfalse;
- return rb_equal(r1->seed, r2->seed);
+ return Qtrue;
}
/*
@@ -1446,19 +1197,21 @@ random_equal(VALUE self, VALUE other)
static VALUE
rb_f_rand(int argc, VALUE *argv, VALUE obj)
{
- VALUE vmax;
- rb_random_t *rnd = rand_start(&default_rand);
-
- if (rb_check_arity(argc, 0, 1) && !NIL_P(vmax = argv[0])) {
- VALUE v = rand_range(Qnil, rnd, vmax);
- if (v != Qfalse) return v;
- vmax = rb_to_int(vmax);
- if (vmax != INT2FIX(0)) {
- v = rand_int(Qnil, rnd, vmax, 0);
- if (!NIL_P(v)) return v;
- }
+ VALUE v, vmax, r;
+ struct MT *mt = default_mt();
+
+ if (argc == 0) goto zero_arg;
+ rb_scan_args(argc, argv, "01", &vmax);
+ if (NIL_P(vmax)) goto zero_arg;
+ if ((v = rand_range(mt, vmax)) != Qfalse) {
+ return v;
+ }
+ vmax = rb_to_int(vmax);
+ if (vmax == INT2FIX(0) || NIL_P(r = rand_int(mt, vmax, 0))) {
+ zero_arg:
+ return DBL2NUM(genrand_real(mt));
}
- return DBL2NUM(genrand_real(&rnd->mt));
+ return r;
}
/*
@@ -1472,13 +1225,11 @@ rb_f_rand(int argc, VALUE *argv, VALUE obj)
static VALUE
random_s_rand(int argc, VALUE *argv, VALUE obj)
{
- VALUE v = rand_random(argc, argv, Qnil, rand_start(&default_rand));
- check_random_number(v, argv);
- return v;
+ return rand_random(argc, argv, rand_start(&default_rand));
}
#define SIP_HASH_STREAMING 0
-#define sip_hash13 ruby_sip_hash13
+#define sip_hash24 ruby_sip_hash24
#if !defined _WIN32 && !defined BYTE_ORDER
# ifdef WORDS_BIGENDIAN
# define BYTE_ORDER BIG_ENDIAN
@@ -1494,35 +1245,63 @@ random_s_rand(int argc, VALUE *argv, VALUE obj)
#endif
#include "siphash.c"
-typedef struct {
- st_index_t hash;
- uint8_t sip[16];
-} seed_keys_t;
-
+static st_index_t hashseed;
static union {
- seed_keys_t key;
- uint32_t u32[type_roomof(seed_keys_t, uint32_t)];
-} seed;
+ uint8_t key[16];
+ uint32_t u32[(16 * sizeof(uint8_t) - 1) / sizeof(uint32_t)];
+} sipseed;
-static void
-init_seed(struct MT *mt)
+static VALUE
+init_randomseed(struct MT *mt, uint32_t initial[DEFAULT_SEED_CNT])
+{
+ VALUE seed;
+ fill_random_seed(initial);
+ init_by_array(mt, initial, DEFAULT_SEED_CNT);
+ seed = make_seed_value(initial);
+ memset(initial, 0, DEFAULT_SEED_LEN);
+ return seed;
+}
+
+void
+Init_RandomSeed(void)
{
+ rb_random_t *r = &default_rand;
+ uint32_t initial[DEFAULT_SEED_CNT];
+ struct MT *mt = &r->mt;
+ VALUE seed = init_randomseed(mt, initial);
int i;
- for (i = 0; i < numberof(seed.u32); ++i)
- seed.u32[i] = genrand_int32(mt);
+ hashseed = genrand_int32(mt);
+#if SIZEOF_ST_INDEX_T*CHAR_BIT > 4*8
+ hashseed <<= 32;
+ hashseed |= genrand_int32(mt);
+#endif
+#if SIZEOF_ST_INDEX_T*CHAR_BIT > 8*8
+ hashseed <<= 32;
+ hashseed |= genrand_int32(mt);
+#endif
+#if SIZEOF_ST_INDEX_T*CHAR_BIT > 12*8
+ hashseed <<= 32;
+ hashseed |= genrand_int32(mt);
+#endif
+
+ for (i = 0; i < numberof(sipseed.u32); ++i)
+ sipseed.u32[i] = genrand_int32(mt);
+
+ rb_global_variable(&r->seed);
+ r->seed = seed;
}
st_index_t
rb_hash_start(st_index_t h)
{
- return st_hash_start(seed.key.hash + h);
+ return st_hash_start(hashseed + h);
}
st_index_t
rb_memhash(const void *ptr, long len)
{
- sip_uint64_t h = sip_hash13(seed.key.sip, ptr, len);
+ sip_uint64_t h = sip_hash24(sipseed.key, ptr, len);
#ifdef HAVE_UINT64_T
return (st_index_t)h;
#else
@@ -1530,51 +1309,14 @@ rb_memhash(const void *ptr, long len)
#endif
}
-/* Initialize Ruby internal seeds. This function is called at very early stage
- * of Ruby startup. Thus, you can't use Ruby's object. */
-void
-Init_RandomSeedCore(void)
-{
- /*
- Don't reuse this MT for Random::DEFAULT. Random::DEFAULT::seed shouldn't
- provide a hint that an attacker guess siphash's seed.
- */
- struct MT mt;
- uint32_t initial_seed[DEFAULT_SEED_CNT];
-
- fill_random_seed(initial_seed, DEFAULT_SEED_CNT);
- init_by_array(&mt, initial_seed, DEFAULT_SEED_CNT);
-
- init_seed(&mt);
-
- explicit_bzero(initial_seed, DEFAULT_SEED_LEN);
-}
-
-static VALUE
-init_randomseed(struct MT *mt)
-{
- uint32_t initial[DEFAULT_SEED_CNT+1];
- VALUE seed;
-
- fill_random_seed(initial, DEFAULT_SEED_CNT);
- init_by_array(mt, initial, DEFAULT_SEED_CNT);
- seed = make_seed_value(initial, DEFAULT_SEED_CNT);
- explicit_bzero(initial, DEFAULT_SEED_LEN);
- return seed;
-}
-
-/* construct Random::DEFAULT bits */
-static VALUE
-Init_Random_default(void)
+static void
+Init_RandomSeed2(void)
{
- rb_random_t *r = &default_rand;
- struct MT *mt = &r->mt;
- VALUE v = TypedData_Wrap_Struct(rb_cRandom, &random_data_type, r);
-
- rb_gc_register_mark_object(v);
- r->seed = init_randomseed(mt);
+ VALUE seed = default_rand.seed;
- return v;
+ if (RB_TYPE_P(seed, T_BIGNUM)) {
+ rb_obj_reveal(seed, rb_cBignum);
+ }
}
void
@@ -1612,6 +1354,7 @@ rb_reset_random_seed(void)
void
InitVM_Random(void)
{
+ Init_RandomSeed2();
rb_define_global_function("srand", rb_f_srand, -1);
rb_define_global_function("rand", rb_f_rand, -1);
@@ -1629,24 +1372,17 @@ InitVM_Random(void)
rb_define_method(rb_cRandom, "==", random_equal, 1);
{
+ VALUE rand_default = TypedData_Wrap_Struct(rb_cRandom, &random_data_type, &default_rand);
+ rb_gc_register_mark_object(rand_default);
/* Direct access to Ruby's Pseudorandom number generator (PRNG). */
- VALUE rand_default = Init_Random_default();
rb_define_const(rb_cRandom, "DEFAULT", rand_default);
}
rb_define_singleton_method(rb_cRandom, "srand", rb_f_srand, -1);
rb_define_singleton_method(rb_cRandom, "rand", random_s_rand, -1);
rb_define_singleton_method(rb_cRandom, "new_seed", random_seed, 0);
- rb_define_singleton_method(rb_cRandom, "urandom", random_raw_seed, 1);
rb_define_private_method(CLASS_OF(rb_cRandom), "state", random_s_state, 0);
rb_define_private_method(CLASS_OF(rb_cRandom), "left", random_s_left, 0);
-
- {
- VALUE m = rb_define_module_under(rb_cRandom, "Formatter");
- rb_include_module(rb_cRandom, m);
- rb_define_method(m, "random_number", rand_random_number, -1);
- rb_define_method(m, "rand", rand_random_number, -1);
- }
}
#undef rb_intern
diff --git a/range.c b/range.c
index 4993a5e645..0a67b6f7c3 100644
--- a/range.c
+++ b/range.c
@@ -9,6 +9,8 @@
**********************************************************************/
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "internal.h"
#include "id.h"
@@ -18,11 +20,7 @@
#include <math.h>
VALUE rb_cRange;
-static ID id_beg, id_end, id_excl, id_integer_p, id_div;
-#define id_cmp idCmp
-#define id_succ idSucc
-
-static VALUE r_cover_p(VALUE, VALUE, VALUE, VALUE);
+static ID id_cmp, id_succ, id_beg, id_end, id_excl, id_integer_p, id_div;
#define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
#define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
@@ -34,15 +32,33 @@ static VALUE r_cover_p(VALUE, VALUE, VALUE, VALUE);
#define EXCL(r) RTEST(RANGE_EXCL(r))
+static VALUE
+range_failed(void)
+{
+ rb_raise(rb_eArgError, "bad value for range");
+ return Qnil; /* dummy */
+}
+
+static VALUE
+range_check(VALUE *args)
+{
+ return rb_funcall(args[0], id_cmp, 1, args[1]);
+}
+
static void
range_init(VALUE range, VALUE beg, VALUE end, VALUE exclude_end)
{
+ VALUE args[2];
+
+ args[0] = beg;
+ args[1] = end;
+
if (!FIXNUM_P(beg) || !FIXNUM_P(end)) {
VALUE v;
- v = rb_funcall(beg, id_cmp, 1, end);
+ v = rb_rescue(range_check, (VALUE)args, range_failed, 0);
if (NIL_P(v))
- rb_raise(rb_eArgError, "bad value for range");
+ range_failed();
}
RANGE_SET_EXCL(range, exclude_end);
@@ -62,10 +78,9 @@ rb_range_new(VALUE beg, VALUE end, int exclude_end)
static void
range_modify(VALUE range)
{
- rb_check_frozen(range);
/* Ranges are immutable, so that they should be initialized only once. */
if (RANGE_EXCL(range) != Qnil) {
- rb_name_err_raise("`initialize' called twice", range, ID2SYM(idInitialize));
+ rb_name_error(idInitialize, "`initialize' called twice");
}
}
@@ -154,21 +169,35 @@ range_eq(VALUE range, VALUE obj)
return rb_exec_recursive_paired(recursive_equal, range, obj, obj);
}
-/* compares _a_ and _b_ and returns:
- * < 0: a < b
- * = 0: a = b
- * > 0: a > b or non-comparable
- */
static int
-r_less(VALUE a, VALUE b)
+r_lt(VALUE a, VALUE b)
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
if (NIL_P(r))
- return INT_MAX;
- return rb_cmpint(r, a, b);
+ return (int)Qfalse;
+ if (rb_cmpint(r, a, b) < 0)
+ return (int)Qtrue;
+ return (int)Qfalse;
}
+static int
+r_le(VALUE a, VALUE b)
+{
+ int c;
+ VALUE r = rb_funcall(a, id_cmp, 1, b);
+
+ if (NIL_P(r))
+ return (int)Qfalse;
+ c = rb_cmpint(r, a, b);
+ if (c == 0)
+ return (int)INT2FIX(0);
+ if (c < 0)
+ return (int)Qtrue;
+ return (int)Qfalse;
+}
+
+
static VALUE
recursive_eql(VALUE range, VALUE obj, int recur)
{
@@ -209,7 +238,7 @@ range_eql(VALUE range, VALUE obj)
/*
* call-seq:
- * rng.hash -> integer
+ * rng.hash -> fixnum
*
* Compute a hash-code for this range. Two ranges with equal
* begin and end points (using <code>eql?</code>), and the same
@@ -232,7 +261,7 @@ range_hash(VALUE range)
hash = rb_hash_uint(hash, EXCL(range) << 24);
hash = rb_hash_end(hash);
- return ST2FIX(hash);
+ return LONG2FIX(hash);
}
static void
@@ -244,16 +273,17 @@ range_each_func(VALUE range, rb_block_call_func *func, VALUE arg)
VALUE v = b;
if (EXCL(range)) {
- while (r_less(v, e) < 0) {
+ while (r_lt(v, e)) {
(*func) (v, arg, 0, 0, 0);
- v = rb_funcallv(v, id_succ, 0, 0);
+ v = rb_funcall(v, id_succ, 0, 0);
}
}
else {
- while ((c = r_less(v, e)) <= 0) {
+ while ((c = r_le(v, e)) != Qfalse) {
(*func) (v, arg, 0, 0, 0);
- if (!c) break;
- v = rb_funcallv(v, id_succ, 0, 0);
+ if (c == (int)INT2FIX(0))
+ break;
+ v = rb_funcall(v, id_succ, 0, 0);
}
}
}
@@ -301,46 +331,22 @@ discrete_object_p(VALUE obj)
return rb_respond_to(obj, id_succ);
}
-static int
-linear_object_p(VALUE obj)
-{
- if (FIXNUM_P(obj) || FLONUM_P(obj)) return TRUE;
- if (SPECIAL_CONST_P(obj)) return FALSE;
- switch (BUILTIN_TYPE(obj)) {
- case T_FLOAT:
- case T_BIGNUM:
- return TRUE;
- }
- if (rb_obj_is_kind_of(obj, rb_cNumeric)) return TRUE;
- if (rb_obj_is_kind_of(obj, rb_cTime)) return TRUE;
- return FALSE;
-}
-
-static VALUE
-check_step_domain(VALUE step)
-{
- VALUE zero = INT2FIX(0);
- int cmp;
- if (!rb_obj_is_kind_of(step, rb_cNumeric)) {
- step = rb_to_int(step);
- }
- cmp = rb_cmpint(rb_funcallv(step, idCmp, 1, &zero), step, zero);
- if (cmp < 0) {
- rb_raise(rb_eArgError, "step can't be negative");
- }
- else if (cmp == 0) {
- rb_raise(rb_eArgError, "step can't be 0");
- }
- return step;
-}
-
static VALUE
range_step_size(VALUE range, VALUE args, VALUE eobj)
{
VALUE b = RANGE_BEG(range), e = RANGE_END(range);
VALUE step = INT2FIX(1);
if (args) {
- step = check_step_domain(RARRAY_AREF(args, 0));
+ step = RARRAY_AREF(args, 0);
+ if (!rb_obj_is_kind_of(step, rb_cNumeric)) {
+ step = rb_to_int(step);
+ }
+ }
+ if (rb_funcall(step, '<', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be negative");
+ }
+ else if (!rb_funcall(step, '>', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be 0");
}
if (rb_obj_is_kind_of(b, rb_cNumeric) && rb_obj_is_kind_of(e, rb_cNumeric)) {
@@ -397,7 +403,15 @@ range_step(int argc, VALUE *argv, VALUE range)
}
else {
rb_scan_args(argc, argv, "01", &step);
- step = check_step_domain(step);
+ if (!rb_obj_is_kind_of(step, rb_cNumeric)) {
+ step = rb_to_int(step);
+ }
+ if (rb_funcall(step, '<', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be negative");
+ }
+ else if (!rb_funcall(step, '>', 1, INT2FIX(0))) {
+ rb_raise(rb_eArgError, "step can't be 0");
+ }
}
if (FIXNUM_P(b) && FIXNUM_P(e) && FIXNUM_P(step)) { /* fixnums are special */
@@ -417,11 +431,11 @@ range_step(int argc, VALUE *argv, VALUE range)
else if (SYMBOL_P(b) && SYMBOL_P(e)) { /* symbols are special */
VALUE args[2], iter[2];
- args[0] = rb_sym2str(e);
+ args[0] = rb_sym_to_s(e);
args[1] = EXCL(range) ? Qtrue : Qfalse;
iter[0] = INT2FIX(1);
iter[1] = step;
- rb_block_call(rb_sym2str(b), rb_intern("upto"), 2, args, sym_step_i, (VALUE)iter);
+ rb_block_call(rb_sym_to_s(b), rb_intern("upto"), 2, args, sym_step_i, (VALUE)iter);
}
else if (ruby_float_step(b, e, step, EXCL(range))) {
/* done */
@@ -558,8 +572,8 @@ is_integer_p(VALUE v)
static VALUE
range_bsearch(VALUE range)
{
- VALUE beg, end, satisfied = Qnil;
- int smaller;
+ VALUE beg, end;
+ int smaller, satisfied = 0;
/* Implementation notes:
* Floats are handled by mapping them to 64 bits integers.
@@ -575,16 +589,15 @@ range_bsearch(VALUE range)
* (-1...0.0).bsearch to yield -0.0.
*/
-#define BSEARCH_CHECK(expr) \
+#define BSEARCH_CHECK(val) \
do { \
- VALUE val = (expr); \
VALUE v = rb_yield(val); \
if (FIXNUM_P(v)) { \
- if (v == INT2FIX(0)) return val; \
- smaller = (SIGNED_VALUE)v < 0; \
+ if (FIX2INT(v) == 0) return val; \
+ smaller = FIX2INT(v) < 0; \
} \
else if (v == Qtrue) { \
- satisfied = val; \
+ satisfied = 1; \
smaller = 1; \
} \
else if (v == Qfalse || v == Qnil) { \
@@ -596,9 +609,9 @@ range_bsearch(VALUE range)
smaller = cmp < 0; \
} \
else { \
- rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE \
- " (must be numeric, true, false or nil)", \
- rb_obj_class(v)); \
+ rb_raise(rb_eTypeError, "wrong argument type %s" \
+ " (must be numeric, true, false or nil)", \
+ rb_obj_classname(v)); \
} \
} while (0)
@@ -622,7 +635,8 @@ range_bsearch(VALUE range)
BSEARCH_CHECK(conv(low)); \
if (!smaller) return Qnil; \
} \
- return satisfied; \
+ if (!satisfied) return Qnil; \
+ return conv(low); \
} while (0)
@@ -665,7 +679,8 @@ range_bsearch(VALUE range)
BSEARCH_CHECK(low);
if (!smaller) return Qnil;
}
- return satisfied;
+ if (!satisfied) return Qnil;
+ return low;
}
else {
rb_raise(rb_eTypeError, "can't do binary search for %s", rb_obj_classname(beg));
@@ -759,9 +774,9 @@ range_each(VALUE range)
else if (SYMBOL_P(beg) && SYMBOL_P(end)) { /* symbols are special */
VALUE args[2];
- args[0] = rb_sym2str(end);
+ args[0] = rb_sym_to_s(end);
args[1] = EXCL(range) ? Qtrue : Qfalse;
- rb_block_call(rb_sym2str(beg), rb_intern("upto"), 2, args, sym_each_i, 0);
+ rb_block_call(rb_sym_to_s(beg), rb_intern("upto"), 2, args, sym_each_i, 0);
}
else {
VALUE tmp = rb_check_string_type(beg);
@@ -894,8 +909,7 @@ range_last(int argc, VALUE *argv, VALUE range)
* rng.min(n) {| a,b | block } -> array
*
* Returns the minimum value in the range. Returns +nil+ if the begin
- * value of the range is larger than the end value. Returns +nil+ if
- * the begin value of an exclusive range is equal to the end value.
+ * value of the range is larger than the end value.
*
* Can be given an optional block to override the default comparison
* method <code>a <=> b</code>.
@@ -914,10 +928,9 @@ range_min(int argc, VALUE *argv, VALUE range)
return range_first(argc, argv, range);
}
else {
- struct cmp_opt_data cmp_opt = { 0, 0 };
VALUE b = RANGE_BEG(range);
VALUE e = RANGE_END(range);
- int c = OPTIMIZED_CMP(b, e, cmp_opt);
+ int c = rb_cmpint(rb_funcall(b, id_cmp, 1, e), b, e);
if (c > 0 || (c == 0 && EXCL(range)))
return Qnil;
@@ -933,8 +946,7 @@ range_min(int argc, VALUE *argv, VALUE range)
* rng.max(n) {| a,b | block } -> obj
*
* Returns the maximum value in the range. Returns +nil+ if the begin
- * value of the range larger than the end value. Returns +nil+ if
- * the begin value of an exclusive range is equal to the end value.
+ * value of the range larger than the end value.
*
* Can be given an optional block to override the default comparison
* method <code>a <=> b</code>.
@@ -952,9 +964,8 @@ range_max(int argc, VALUE *argv, VALUE range)
return rb_call_super(argc, argv);
}
else {
- struct cmp_opt_data cmp_opt = { 0, 0 };
VALUE b = RANGE_BEG(range);
- int c = OPTIMIZED_CMP(b, e, cmp_opt);
+ int c = rb_cmpint(rb_funcall(b, id_cmp, 1, e), b, e);
if (c > 0)
return Qnil;
@@ -987,14 +998,11 @@ rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
excl = EXCL(range);
}
else {
- VALUE x;
- b = rb_check_funcall(range, id_beg, 0, 0);
- if (b == Qundef) return (int)Qfalse;
- e = rb_check_funcall(range, id_end, 0, 0);
- if (e == Qundef) return (int)Qfalse;
- x = rb_check_funcall(range, rb_intern("exclude_end?"), 0, 0);
- if (x == Qundef) return (int)Qfalse;
- excl = RTEST(x);
+ if (!rb_respond_to(range, id_beg)) return (int)Qfalse;
+ if (!rb_respond_to(range, id_end)) return (int)Qfalse;
+ b = rb_funcall(range, id_beg, 0);
+ e = rb_funcall(range, id_end, 0);
+ excl = RTEST(rb_funcall(range, rb_intern("exclude_end?"), 0));
}
*begp = b;
*endp = e;
@@ -1064,7 +1072,7 @@ range_to_s(VALUE range)
str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
rb_str_append(str, str2);
- OBJ_INFECT(str, range);
+ OBJ_INFECT(str, str2);
return str;
}
@@ -1082,7 +1090,7 @@ inspect_range(VALUE range, VALUE dummy, int recur)
str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
rb_str_append(str, str2);
- OBJ_INFECT(str, range);
+ OBJ_INFECT(str, str2);
return str;
}
@@ -1149,16 +1157,42 @@ range_include(VALUE range, VALUE val)
VALUE beg = RANGE_BEG(range);
VALUE end = RANGE_END(range);
int nv = FIXNUM_P(beg) || FIXNUM_P(end) ||
- linear_object_p(beg) || linear_object_p(end);
+ rb_obj_is_kind_of(beg, rb_cNumeric) ||
+ rb_obj_is_kind_of(end, rb_cNumeric);
if (nv ||
!NIL_P(rb_check_to_integer(beg, "to_int")) ||
!NIL_P(rb_check_to_integer(end, "to_int"))) {
- return r_cover_p(range, beg, end, val);
+ if (r_le(beg, val)) {
+ if (EXCL(range)) {
+ if (r_lt(val, end))
+ return Qtrue;
+ }
+ else {
+ if (r_le(val, end))
+ return Qtrue;
+ }
+ }
+ return Qfalse;
}
- else if (RB_TYPE_P(beg, T_STRING) && RB_TYPE_P(end, T_STRING)) {
- VALUE rb_str_include_range_p(VALUE beg, VALUE end, VALUE val, VALUE exclusive);
- return rb_str_include_range_p(beg, end, val, RANGE_EXCL(range));
+ else if (RB_TYPE_P(beg, T_STRING) && RB_TYPE_P(end, T_STRING) &&
+ RSTRING_LEN(beg) == 1 && RSTRING_LEN(end) == 1) {
+ if (NIL_P(val)) return Qfalse;
+ if (RB_TYPE_P(val, T_STRING)) {
+ if (RSTRING_LEN(val) == 0 || RSTRING_LEN(val) > 1)
+ return Qfalse;
+ else {
+ char b = RSTRING_PTR(beg)[0];
+ char e = RSTRING_PTR(end)[0];
+ char v = RSTRING_PTR(val)[0];
+
+ if (ISASCII(b) && ISASCII(e) && ISASCII(v)) {
+ if (b <= v && v < e) return Qtrue;
+ if (!EXCL(range) && v == e) return Qtrue;
+ return Qfalse;
+ }
+ }
+ }
}
/* TODO: ruby_frame->this_func = rb_intern("include?"); */
return rb_call_super(1, &val);
@@ -1187,16 +1221,15 @@ range_cover(VALUE range, VALUE val)
beg = RANGE_BEG(range);
end = RANGE_END(range);
- return r_cover_p(range, beg, end, val);
-}
-
-static VALUE
-r_cover_p(VALUE range, VALUE beg, VALUE end, VALUE val)
-{
- if (r_less(beg, val) <= 0) {
- int excl = EXCL(range);
- if (r_less(val, end) <= -excl)
- return Qtrue;
+ if (r_le(beg, val)) {
+ if (EXCL(range)) {
+ if (r_lt(val, end))
+ return Qtrue;
+ }
+ else {
+ if (r_le(val, end))
+ return Qtrue;
+ }
}
return Qfalse;
}
@@ -1218,27 +1251,22 @@ range_dumper(VALUE range)
static VALUE
range_loader(VALUE range, VALUE obj)
{
- VALUE beg, end, excl;
-
if (!RB_TYPE_P(obj, T_OBJECT) || RBASIC(obj)->klass != rb_cObject) {
rb_raise(rb_eTypeError, "not a dumped range object");
}
range_modify(range);
- beg = rb_ivar_get(obj, id_beg);
- end = rb_ivar_get(obj, id_end);
- excl = rb_ivar_get(obj, id_excl);
- if (!NIL_P(excl)) {
- range_init(range, beg, end, RBOOL(RTEST(excl)));
- }
+ RANGE_SET_BEG(range, rb_ivar_get(obj, id_beg));
+ RANGE_SET_END(range, rb_ivar_get(obj, id_end));
+ RANGE_SET_EXCL(range, rb_ivar_get(obj, id_excl));
return range;
}
static VALUE
range_alloc(VALUE klass)
{
- /* rb_struct_alloc_noinit itself should not be used because
- * rb_marshal_define_compat uses equality of allocation function */
+ /* rb_struct_alloc_noinit itself should not be used because
+ * rb_marshal_define_compat uses equality of allocation function */
return rb_struct_alloc_noinit(klass);
}
@@ -1305,6 +1333,8 @@ Init_Range(void)
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ id_cmp = rb_intern("<=>");
+ id_succ = rb_intern("succ");
id_beg = rb_intern("begin");
id_end = rb_intern("end");
id_excl = rb_intern("excl");
diff --git a/rational.c b/rational.c
index a29aec4000..23b4bb0864 100644
--- a/rational.c
+++ b/rational.c
@@ -5,8 +5,8 @@
which is written in ruby.
*/
+#include "ruby.h"
#include "internal.h"
-#include "id.h"
#include <math.h>
#include <float.h>
@@ -15,7 +15,7 @@
#endif
#define NDEBUG
-#include "ruby_assert.h"
+#include <assert.h>
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
#define USE_GMP
@@ -28,13 +28,11 @@
#define GMP_GCD_DIGITS 1
-#define INT_POSITIVE_P(x) (FIXNUM_P(x) ? FIXNUM_POSITIVE_P(x) : BIGNUM_POSITIVE_P(x))
-#define INT_ZERO_P(x) (FIXNUM_P(x) ? FIXNUM_ZERO_P(x) : rb_bigzero_p(x))
-
VALUE rb_cRational;
-static ID id_abs, id_idiv, id_integer_p, id_to_i,
- id_i_num, id_i_den;
+static ID id_abs, id_cmp, id_convert, id_eqeq_p, id_expt, id_fdiv,
+ id_idiv, id_integer_p, id_negate, id_to_f,
+ id_to_i, id_truncate, id_i_num, id_i_den;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
#define f_inspect rb_inspect
@@ -54,38 +52,54 @@ f_##n(VALUE x)\
return rb_funcall(x, id_##n, 0);\
}
+#define fun2(n) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, id_##n, 1, y);\
+}
+
inline static VALUE
f_add(VALUE x, VALUE y)
{
- if (FIXNUM_P(y) && FIXNUM_ZERO_P(y))
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
return x;
- else if (FIXNUM_P(x) && FIXNUM_ZERO_P(x))
+ else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
return y;
return rb_funcall(x, '+', 1, 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)
return x;
- if (RB_INTEGER_TYPE_P(x))
- return rb_int_div(x, y);
return rb_funcall(x, '/', 1, y);
}
-inline static int
+inline static VALUE
f_lt_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
- return (SIGNED_VALUE)x < (SIGNED_VALUE)y;
- return RTEST(rb_funcall(x, '<', 1, y));
+ return f_boolcast(FIX2LONG(x) < FIX2LONG(y));
+ return rb_funcall(x, '<', 1, y);
}
-#ifndef NDEBUG
-/* f_mod is used only in f_gcd defined when NDEBUG is not defined */
binop(mod, '%')
-#endif
inline static VALUE
f_mul(VALUE x, VALUE y)
@@ -93,7 +107,7 @@ f_mul(VALUE x, VALUE y)
if (FIXNUM_P(y)) {
long iy = FIX2LONG(y);
if (iy == 0) {
- if (RB_INTEGER_TYPE_P(x))
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
return ZERO;
}
else if (iy == 1)
@@ -102,35 +116,26 @@ f_mul(VALUE x, VALUE y)
else if (FIXNUM_P(x)) {
long ix = FIX2LONG(x);
if (ix == 0) {
- if (RB_INTEGER_TYPE_P(y))
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
return ZERO;
}
else if (ix == 1)
return y;
- return rb_int_mul(x, y);
}
- else if (RB_TYPE_P(x, T_BIGNUM))
- return rb_int_mul(x, y);
return rb_funcall(x, '*', 1, y);
}
inline static VALUE
f_sub(VALUE x, VALUE y)
{
- if (FIXNUM_P(y) && FIXNUM_ZERO_P(y))
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
return x;
return rb_funcall(x, '-', 1, y);
}
-inline static VALUE
-f_abs(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x))
- return rb_int_abs(x);
- return rb_funcall(x, id_abs, 0);
-}
-
+fun1(abs)
fun1(integer_p)
+fun1(negate)
inline static VALUE
f_to_i(VALUE x)
@@ -139,61 +144,81 @@ f_to_i(VALUE x)
return rb_str_to_inum(x, 10, 0);
return rb_funcall(x, id_to_i, 0);
}
+inline static VALUE
+f_to_f(VALUE x)
+{
+ if (RB_TYPE_P(x, T_STRING))
+ return DBL2NUM(rb_str_to_dbl(x, 0));
+ return rb_funcall(x, id_to_f, 0);
+}
inline static VALUE
f_eqeq_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
- return x == y;
- return (int)rb_equal(x, y);
+ return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
+ return rb_funcall(x, id_eqeq_p, 1, y);
}
+fun2(expt)
+fun2(fdiv)
+fun2(idiv)
+
+#define f_expt10(x) f_expt(INT2FIX(10), x)
+
inline static VALUE
-f_idiv(VALUE x, VALUE y)
+f_negative_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x))
- return rb_int_idiv(x, y);
- return rb_funcall(x, id_idiv, 1, y);
+ if (FIXNUM_P(x))
+ return f_boolcast(FIX2LONG(x) < 0);
+ return rb_funcall(x, '<', 1, ZERO);
}
-#define f_expt10(x) rb_int_pow(INT2FIX(10), x)
+#define f_positive_p(x) (!f_negative_p(x))
-inline static int
+inline static VALUE
f_zero_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return FIXNUM_ZERO_P(x);
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 0);
+ }
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
}
else if (RB_TYPE_P(x, T_RATIONAL)) {
VALUE num = RRATIONAL(x)->num;
- return FIXNUM_ZERO_P(num);
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
}
- return (int)rb_equal(x, ZERO);
+ return rb_funcall(x, id_eqeq_p, 1, ZERO);
}
#define f_nonzero_p(x) (!f_zero_p(x))
-inline static int
+inline static VALUE
f_one_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return x == LONG2FIX(1);
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 1);
+ }
+ else if (RB_TYPE_P(x, T_BIGNUM)) {
+ return Qfalse;
}
else if (RB_TYPE_P(x, T_RATIONAL)) {
VALUE num = RRATIONAL(x)->num;
VALUE den = RRATIONAL(x)->den;
- return num == LONG2FIX(1) && den == LONG2FIX(1);
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
+ FIXNUM_P(den) && FIX2LONG(den) == 1);
}
- return (int)rb_equal(x, ONE);
+ return rb_funcall(x, id_eqeq_p, 1, ONE);
}
-inline static int
+inline static VALUE
f_minus_one_p(VALUE x)
{
- if (RB_INTEGER_TYPE_P(x)) {
- return x == LONG2FIX(-1);
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == -1);
}
else if (RB_TYPE_P(x, T_BIGNUM)) {
return Qfalse;
@@ -202,39 +227,40 @@ f_minus_one_p(VALUE x)
VALUE num = RRATIONAL(x)->num;
VALUE den = RRATIONAL(x)->den;
- return num == LONG2FIX(-1) && den == LONG2FIX(1);
+ return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == -1 &&
+ FIXNUM_P(den) && FIX2LONG(den) == 1);
}
- return (int)rb_equal(x, INT2FIX(-1));
+ return rb_funcall(x, id_eqeq_p, 1, INT2FIX(-1));
}
-inline static int
+inline static VALUE
f_kind_of_p(VALUE x, VALUE c)
{
- return (int)rb_obj_is_kind_of(x, c);
+ return rb_obj_is_kind_of(x, c);
}
-inline static int
+inline static VALUE
k_numeric_p(VALUE x)
{
return f_kind_of_p(x, rb_cNumeric);
}
-inline static int
+inline static VALUE
k_integer_p(VALUE x)
{
- return RB_INTEGER_TYPE_P(x);
+ return f_kind_of_p(x, rb_cInteger);
}
-inline static int
+inline static VALUE
k_float_p(VALUE x)
{
- return RB_FLOAT_TYPE_P(x);
+ return f_kind_of_p(x, rb_cFloat);
}
-inline static int
+inline static VALUE
k_rational_p(VALUE x)
{
- return RB_TYPE_P(x, T_RATIONAL);
+ return f_kind_of_p(x, rb_cRational);
}
#define k_exact_p(x) (!k_float_p(x))
@@ -261,15 +287,10 @@ rb_gcd_gmp(VALUE x, VALUE y)
mpz_gcd(mz, mx, my);
- mpz_clear(mx);
- mpz_clear(my);
-
zn = (mpz_sizeinbase(mz, 16) + SIZEOF_BDIGIT*2 - 1) / (SIZEOF_BDIGIT*2);
z = rb_big_new(zn, 1);
mpz_export(BIGNUM_DIGITS(z), &count, -1, sizeof(BDIGIT), 0, nails, mz);
- mpz_clear(mz);
-
return rb_big_norm(z);
}
#endif
@@ -281,9 +302,6 @@ rb_gcd_gmp(VALUE x, VALUE y)
inline static long
i_gcd(long x, long y)
{
- unsigned long u, v, t;
- int shift;
-
if (x < 0)
x = -x;
if (y < 0)
@@ -294,29 +312,12 @@ i_gcd(long x, long y)
if (y == 0)
return x;
- u = (unsigned long)x;
- v = (unsigned long)y;
- for (shift = 0; ((u | v) & 1) == 0; ++shift) {
- u >>= 1;
- v >>= 1;
+ while (x > 0) {
+ long t = x;
+ x = y % x;
+ y = t;
}
-
- while ((u & 1) == 0)
- u >>= 1;
-
- do {
- while ((v & 1) == 0)
- v >>= 1;
-
- if (u > v) {
- t = v;
- v = u;
- u = t;
- }
- v = v - u;
- } while (v != 0);
-
- return (long)(u << shift);
+ return y;
}
inline static VALUE
@@ -327,25 +328,25 @@ f_gcd_normal(VALUE x, VALUE y)
if (FIXNUM_P(x) && FIXNUM_P(y))
return LONG2NUM(i_gcd(FIX2LONG(x), FIX2LONG(y)));
- if (INT_NEGATIVE_P(x))
- x = rb_int_uminus(x);
- if (INT_NEGATIVE_P(y))
- y = rb_int_uminus(y);
+ if (f_negative_p(x))
+ x = f_negate(x);
+ if (f_negative_p(y))
+ y = f_negate(y);
- if (INT_ZERO_P(x))
+ if (f_zero_p(x))
return y;
- if (INT_ZERO_P(y))
+ if (f_zero_p(y))
return x;
for (;;) {
if (FIXNUM_P(x)) {
- if (FIXNUM_ZERO_P(x))
+ if (FIX2LONG(x) == 0)
return y;
if (FIXNUM_P(y))
return LONG2NUM(i_gcd(FIX2LONG(x), FIX2LONG(y)));
}
z = x;
- x = rb_int_modulo(y, x);
+ x = f_mod(y, x);
y = z;
}
/* NOTREACHED */
@@ -389,16 +390,19 @@ f_gcd(VALUE x, VALUE y)
inline static VALUE
f_lcm(VALUE x, VALUE y)
{
- if (INT_ZERO_P(x) || INT_ZERO_P(y))
+ if (f_zero_p(x) || f_zero_p(y))
return ZERO;
return f_abs(f_mul(f_div(x, f_gcd(x, y)), y));
}
#define get_dat1(x) \
- struct RRational *dat = RRATIONAL(x)
+ struct RRational *dat;\
+ dat = ((struct RRational *)(x))
#define get_dat2(x,y) \
- struct RRational *adat = RRATIONAL(x), *bdat = RRATIONAL(y)
+ struct RRational *adat, *bdat;\
+ adat = ((struct RRational *)(x));\
+ bdat = ((struct RRational *)(y))
#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))
@@ -410,7 +414,6 @@ nurat_s_new_internal(VALUE klass, VALUE num, VALUE den)
RRATIONAL_SET_NUM(obj, num);
RRATIONAL_SET_DEN(obj, den);
- OBJ_FREEZE_RAW(obj);
return (VALUE)obj;
}
@@ -421,6 +424,8 @@ nurat_s_alloc(VALUE klass)
return nurat_s_new_internal(klass, ZERO, ONE);
}
+#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
+
#if 0
static VALUE
nurat_s_new_bang(int argc, VALUE *argv, VALUE klass)
@@ -439,13 +444,15 @@ nurat_s_new_bang(int argc, VALUE *argv, VALUE klass)
if (!k_integer_p(den))
den = f_to_i(den);
- if (INT_NEGATIVE_P(den)) {
- num = rb_int_uminus(num);
- den = rb_int_uminus(den);
- }
- else if (INT_ZERO_P(den)) {
- rb_num_zerodiv();
- }
+ switch (FIX2INT(f_cmp(den, ZERO))) {
+ case -1:
+ num = f_negate(num);
+ den = f_negate(den);
+ break;
+ case 0:
+ rb_raise_zerodiv();
+ break;
+ }
break;
}
@@ -471,14 +478,12 @@ nurat_canonicalization(int f)
{
canonicalization = f;
}
-#else
-# define canonicalization 0
#endif
inline static void
nurat_int_check(VALUE num)
{
- if (!RB_INTEGER_TYPE_P(num)) {
+ if (!(RB_TYPE_P(num, T_FIXNUM) || RB_TYPE_P(num, T_BIGNUM))) {
if (!k_numeric_p(num) || !f_integer_p(num))
rb_raise(rb_eTypeError, "not an integer");
}
@@ -493,48 +498,49 @@ nurat_int_value(VALUE num)
return num;
}
-static void
-nurat_canonicalize(VALUE *num, VALUE *den)
-{
- assert(num != NULL && RB_INTEGER_TYPE_P(*num));
- assert(den != NULL && RB_INTEGER_TYPE_P(*den));
- if (INT_NEGATIVE_P(*den)) {
- *num = rb_int_uminus(*num);
- *den = rb_int_uminus(*den);
- }
- else if (INT_ZERO_P(*den)) {
- rb_num_zerodiv();
- }
-}
-
-static void
-nurat_reduce(VALUE *x, VALUE *y)
-{
- VALUE gcd;
- if (*x == ONE || *y == ONE) return;
- gcd = f_gcd(*x, *y);
- *x = f_idiv(*x, gcd);
- *y = f_idiv(*y, gcd);
-}
-
inline static VALUE
nurat_s_canonicalize_internal(VALUE klass, VALUE num, VALUE den)
{
- nurat_canonicalize(&num, &den);
- nurat_reduce(&num, &den);
+ VALUE gcd;
+
+ switch (FIX2INT(f_cmp(den, ZERO))) {
+ case -1:
+ num = f_negate(num);
+ den = f_negate(den);
+ break;
+ case 0:
+ rb_raise_zerodiv();
+ break;
+ }
+
+ gcd = f_gcd(num, den);
+ num = f_idiv(num, gcd);
+ den = f_idiv(den, gcd);
- if (canonicalization && f_one_p(den))
+#ifdef CANON
+ if (f_one_p(den) && canonicalization)
return num;
+#endif
return nurat_s_new_internal(klass, num, den);
}
inline static VALUE
nurat_s_canonicalize_internal_no_reduce(VALUE klass, VALUE num, VALUE den)
{
- nurat_canonicalize(&num, &den);
+ switch (FIX2INT(f_cmp(den, ZERO))) {
+ case -1:
+ num = f_negate(num);
+ den = f_negate(den);
+ break;
+ case 0:
+ rb_raise_zerodiv();
+ break;
+ }
- if (canonicalization && f_one_p(den))
+#ifdef CANON
+ if (f_one_p(den) && canonicalization)
return num;
+#endif
return nurat_s_new_internal(klass, num, den);
}
@@ -573,27 +579,18 @@ f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
return nurat_s_canonicalize_internal_no_reduce(klass, x, y);
}
-static VALUE nurat_s_convert(int argc, VALUE *argv, VALUE klass);
/*
* call-seq:
- * Rational(x, y) -> rational
- * Rational(arg) -> rational
+ * Rational(x[, y]) -> numeric
*
- * Returns +x/y+ or +arg+ as a Rational.
+ * Returns x/y;
*
- * Rational(2, 3) #=> (2/3)
- * Rational(5) #=> (5/1)
- * Rational(0.5) #=> (1/2)
- * Rational(0.3) #=> (5404319552844595/18014398509481984)
- *
- * Rational("2/3") #=> (2/3)
- * Rational("0.3") #=> (3/10)
+ * Rational(1, 2) #=> (1/2)
+ * Rational('1/2') #=> (1/2)
+ * Rational(nil) #=> TypeError
+ * Rational(1, nil) #=> TypeError
*
- * Rational("10 cents") #=> ArgumentError
- * Rational(nil) #=> TypeError
- * Rational(1, nil) #=> TypeError
- *
- * Syntax of the string form:
+ * Syntax of string form:
*
* string form = extra spaces , rational , extra spaces ;
* rational = [ sign ] , unsigned rational ;
@@ -607,12 +604,12 @@ static VALUE nurat_s_convert(int argc, VALUE *argv, VALUE klass);
* digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
* extra spaces = ? \s* ? ;
*
- * See also String#to_r.
+ * See String#to_r.
*/
static VALUE
nurat_f_rational(int argc, VALUE *argv, VALUE klass)
{
- return nurat_s_convert(argc, argv, rb_cRational);
+ return rb_funcall2(rb_cRational, id_convert, argc, argv);
}
/*
@@ -643,6 +640,7 @@ nurat_numerator(VALUE self)
* Rational(7, 1).denominator #=> 1
* Rational(9, -4).denominator #=> 4
* Rational(-2, -10).denominator #=> 5
+ * rat.numerator.gcd(rat.denominator) #=> 1
*/
static VALUE
nurat_denominator(VALUE self)
@@ -651,21 +649,6 @@ nurat_denominator(VALUE self)
return dat->den;
}
-/*
- * call-seq:
- * -rat -> rational
- *
- * Negates +rat+.
- */
-VALUE
-rb_rational_uminus(VALUE self)
-{
- const int unused = (assert(RB_TYPE_P(self, T_RATIONAL)), 0);
- get_dat1(self);
- (void)unused;
- return f_rational_new2(CLASS_OF(self), rb_int_uminus(dat->num), dat->den);
-}
-
#ifndef NDEBUG
#define f_imul f_imul_orig
#endif
@@ -720,37 +703,36 @@ f_addsub(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
VALUE c;
if (k == '+')
- c = rb_int_plus(a, b);
+ c = f_add(a, b);
else
- c = rb_int_minus(a, b);
+ c = f_sub(a, b);
- b = rb_int_idiv(aden, g);
+ b = f_idiv(aden, g);
g = f_gcd(c, g);
- num = rb_int_idiv(c, g);
- a = rb_int_idiv(bden, g);
- den = rb_int_mul(a, b);
+ num = f_idiv(c, g);
+ a = f_idiv(bden, g);
+ den = f_mul(a, b);
}
else {
VALUE g = f_gcd(aden, bden);
- VALUE a = rb_int_mul(anum, rb_int_idiv(bden, g));
- VALUE b = rb_int_mul(bnum, rb_int_idiv(aden, g));
+ VALUE a = f_mul(anum, f_idiv(bden, g));
+ VALUE b = f_mul(bnum, f_idiv(aden, g));
VALUE c;
if (k == '+')
- c = rb_int_plus(a, b);
+ c = f_add(a, b);
else
- c = rb_int_minus(a, b);
+ c = f_sub(a, b);
- b = rb_int_idiv(aden, g);
+ b = f_idiv(aden, g);
g = f_gcd(c, g);
- num = rb_int_idiv(c, g);
- a = rb_int_idiv(bden, g);
- den = rb_int_mul(a, b);
+ num = f_idiv(c, g);
+ a = f_idiv(bden, g);
+ den = f_mul(a, b);
}
return f_rational_new_no_reduce2(CLASS_OF(self), num, den);
}
-static double nurat_to_double(VALUE self);
/*
* call-seq:
* rat + numeric -> numeric
@@ -758,25 +740,25 @@ static double nurat_to_double(VALUE self);
* Performs addition.
*
* Rational(2, 3) + Rational(2, 3) #=> (4/3)
- * Rational(900) + Rational(1) #=> (901/1)
+ * Rational(900) + Rational(1) #=> (900/1)
* Rational(-2, 9) + Rational(-9, 2) #=> (-85/18)
* Rational(9, 8) + 4 #=> (41/8)
* Rational(20, 9) + 9.8 #=> 12.022222222222222
*/
-VALUE
-rb_rational_plus(VALUE self, VALUE other)
+static VALUE
+nurat_add(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
{
get_dat1(self);
- return f_rational_new_no_reduce2(CLASS_OF(self),
- rb_int_plus(dat->num, rb_int_mul(other, dat->den)),
- dat->den);
+ return f_addsub(self,
+ dat->num, dat->den,
+ other, ONE, '+');
}
}
- else if (RB_FLOAT_TYPE_P(other)) {
- return DBL2NUM(nurat_to_double(self) + RFLOAT_VALUE(other));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return f_add(f_to_f(self), other);
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
{
@@ -801,23 +783,23 @@ rb_rational_plus(VALUE self, VALUE other)
* Rational(2, 3) - Rational(2, 3) #=> (0/1)
* Rational(900) - Rational(1) #=> (899/1)
* Rational(-2, 9) - Rational(-9, 2) #=> (77/18)
- * Rational(9, 8) - 4 #=> (-23/8)
+ * Rational(9, 8) - 4 #=> (23/8)
* Rational(20, 9) - 9.8 #=> -7.577777777777778
*/
static VALUE
nurat_sub(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
{
get_dat1(self);
- return f_rational_new_no_reduce2(CLASS_OF(self),
- rb_int_minus(dat->num, rb_int_mul(other, dat->den)),
- dat->den);
+ return f_addsub(self,
+ dat->num, dat->den,
+ other, ONE, '-');
}
}
- else if (RB_FLOAT_TYPE_P(other)) {
- return DBL2NUM(nurat_to_double(self) - RFLOAT_VALUE(other));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return f_sub(f_to_f(self), other);
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
{
@@ -838,18 +820,12 @@ f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
{
VALUE num, den;
- assert(RB_TYPE_P(self, T_RATIONAL));
- assert(RB_INTEGER_TYPE_P(anum));
- assert(RB_INTEGER_TYPE_P(aden));
- assert(RB_INTEGER_TYPE_P(bnum));
- assert(RB_INTEGER_TYPE_P(bden));
-
if (k == '/') {
VALUE t;
- if (INT_NEGATIVE_P(bnum)) {
- anum = rb_int_uminus(anum);
- bnum = rb_int_uminus(bnum);
+ if (f_negative_p(bnum)) {
+ anum = f_negate(anum);
+ bnum = f_negate(bnum);
}
t = bnum;
bnum = bden;
@@ -872,8 +848,8 @@ f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
VALUE g1 = f_gcd(anum, bden);
VALUE g2 = f_gcd(aden, bnum);
- num = rb_int_mul(rb_int_idiv(anum, g1), rb_int_idiv(bnum, g2));
- den = rb_int_mul(rb_int_idiv(aden, g2), rb_int_idiv(bden, g1));
+ num = f_mul(f_idiv(anum, g1), f_idiv(bnum, g2));
+ den = f_mul(f_idiv(aden, g2), f_idiv(bden, g1));
}
return f_rational_new_no_reduce2(CLASS_OF(self), num, den);
}
@@ -893,7 +869,7 @@ f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
static VALUE
nurat_mul(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
{
get_dat1(self);
@@ -902,8 +878,8 @@ nurat_mul(VALUE self, VALUE other)
other, ONE, '*');
}
}
- else if (RB_FLOAT_TYPE_P(other)) {
- return DBL2NUM(nurat_to_double(self) * RFLOAT_VALUE(other));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return f_mul(f_to_f(self), other);
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
{
@@ -935,9 +911,9 @@ nurat_mul(VALUE self, VALUE other)
static VALUE
nurat_div(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
if (f_zero_p(other))
- rb_num_zerodiv();
+ rb_raise_zerodiv();
{
get_dat1(self);
@@ -946,11 +922,11 @@ nurat_div(VALUE self, VALUE other)
other, ONE, '/');
}
}
- else if (RB_FLOAT_TYPE_P(other))
- return DBL2NUM(nurat_to_double(self) / RFLOAT_VALUE(other));
+ else if (RB_TYPE_P(other, T_FLOAT))
+ return rb_funcall(f_to_f(self), '/', 1, other);
else if (RB_TYPE_P(other, T_RATIONAL)) {
if (f_zero_p(other))
- rb_num_zerodiv();
+ rb_raise_zerodiv();
{
get_dat2(self, other);
@@ -968,13 +944,11 @@ nurat_div(VALUE self, VALUE other)
}
}
-static VALUE nurat_to_f(VALUE self);
-
/*
* call-seq:
* rat.fdiv(numeric) -> float
*
- * Performs division and returns the value as a Float.
+ * Performs division and returns the value as a float.
*
* Rational(2, 3).fdiv(1) #=> 0.6666666666666666
* Rational(2, 3).fdiv(0.5) #=> 1.3333333333333333
@@ -983,17 +957,9 @@ static VALUE nurat_to_f(VALUE self);
static VALUE
nurat_fdiv(VALUE self, VALUE other)
{
- VALUE div;
if (f_zero_p(other))
- return DBL2NUM(nurat_to_double(self) / 0.0);
- if (FIXNUM_P(other) && other == LONG2FIX(1))
- return nurat_to_f(self);
- div = nurat_div(self, other);
- if (RB_TYPE_P(div, T_RATIONAL))
- return nurat_to_f(div);
- if (RB_FLOAT_TYPE_P(div))
- return div;
- return rb_funcall(div, rb_intern("to_f"), 0);
+ return f_div(self, f_to_f(other));
+ return f_to_f(f_div(self, other));
}
inline static VALUE
@@ -1011,12 +977,12 @@ f_odd_p(VALUE integer)
*
* Performs exponentiation.
*
- * Rational(2) ** Rational(3) #=> (8/1)
- * Rational(10) ** -2 #=> (1/100)
- * Rational(10) ** -2.0 #=> 0.01
- * Rational(-4) ** Rational(1, 2) #=> (0.0+2.0i)
- * Rational(1, 2) ** 0 #=> (1/1)
- * Rational(1, 2) ** 0.0 #=> 1.0
+ * Rational(2) ** Rational(3) #=> (8/1)
+ * Rational(10) ** -2 #=> (1/100)
+ * Rational(10) ** -2.0 #=> 0.01
+ * Rational(-4) ** Rational(1,2) #=> (1.2246063538223773e-16+2.0i)
+ * Rational(1, 2) ** 0 #=> (1/1)
+ * Rational(1, 2) ** 0.0 #=> 1.0
*/
static VALUE
nurat_expt(VALUE self, VALUE other)
@@ -1038,12 +1004,12 @@ nurat_expt(VALUE self, VALUE other)
if (f_one_p(dat->num)) {
return f_rational_new_bang1(CLASS_OF(self), ONE);
}
- else if (f_minus_one_p(dat->num) && RB_INTEGER_TYPE_P(other)) {
+ else if (f_minus_one_p(dat->num) && k_integer_p(other)) {
return f_rational_new_bang1(CLASS_OF(self), INT2FIX(f_odd_p(other) ? -1 : 1));
}
- else if (INT_ZERO_P(dat->num)) {
- if (rb_num_negative_p(other)) {
- rb_num_zerodiv();
+ else if (f_zero_p(dat->num)) {
+ if (FIX2INT(f_cmp(other, ZERO)) == -1) {
+ rb_raise_zerodiv();
}
else {
return f_rational_new_bang1(CLASS_OF(self), ZERO);
@@ -1053,82 +1019,71 @@ nurat_expt(VALUE self, VALUE other)
}
/* General case */
- if (FIXNUM_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM)) {
{
VALUE num, den;
get_dat1(self);
- if (INT_POSITIVE_P(other)) {
- num = rb_int_pow(dat->num, other);
- den = rb_int_pow(dat->den, other);
- }
- else if (INT_NEGATIVE_P(other)) {
- num = rb_int_pow(dat->den, rb_int_uminus(other));
- den = rb_int_pow(dat->num, rb_int_uminus(other));
- }
- else {
+ switch (FIX2INT(f_cmp(other, ZERO))) {
+ case 1:
+ num = f_expt(dat->num, other);
+ den = f_expt(dat->den, other);
+ break;
+ case -1:
+ num = f_expt(dat->den, f_negate(other));
+ den = f_expt(dat->num, f_negate(other));
+ break;
+ default:
num = ONE;
den = ONE;
- }
- if (RB_FLOAT_TYPE_P(num)) { /* infinity due to overflow */
- if (RB_FLOAT_TYPE_P(den)) return DBL2NUM(NAN);
- return num;
- }
- if (RB_FLOAT_TYPE_P(den)) { /* infinity due to overflow */
- num = ZERO;
- den = ONE;
+ break;
}
return f_rational_new2(CLASS_OF(self), num, den);
}
}
else if (RB_TYPE_P(other, T_BIGNUM)) {
rb_warn("in a**b, b may be too big");
- return rb_float_pow(nurat_to_f(self), other);
+ return f_expt(f_to_f(self), other);
}
- else if (RB_FLOAT_TYPE_P(other) || RB_TYPE_P(other, T_RATIONAL)) {
- return rb_float_pow(nurat_to_f(self), other);
+ else if (RB_TYPE_P(other, T_FLOAT) || RB_TYPE_P(other, T_RATIONAL)) {
+ return f_expt(f_to_f(self), other);
}
else {
- return rb_num_coerce_bin(self, other, rb_intern("**"));
+ return rb_num_coerce_bin(self, other, id_expt);
}
}
/*
* call-seq:
- * rational <=> numeric -> -1, 0, +1, or nil
+ * rational <=> numeric -> -1, 0, +1 or nil
*
- * Returns -1, 0, or +1 depending on whether +rational+ is
- * less than, equal to, or greater than +numeric+.
+ * Performs comparison and returns -1, 0, or +1.
*
* +nil+ is returned if the two values are incomparable.
*
- * Rational(2, 3) <=> Rational(2, 3) #=> 0
- * Rational(5) <=> 5 #=> 0
- * Rational(2, 3) <=> Rational(1, 3) #=> 1
- * Rational(1, 3) <=> 1 #=> -1
- * Rational(1, 3) <=> 0.3 #=> 1
- *
- * Rational(1, 3) <=> "0.3" #=> nil
+ * Rational(2, 3) <=> Rational(2, 3) #=> 0
+ * Rational(5) <=> 5 #=> 0
+ * Rational(2,3) <=> Rational(1,3) #=> 1
+ * Rational(1,3) <=> 1 #=> -1
+ * Rational(1,3) <=> 0.3 #=> 1
*/
-VALUE
-rb_rational_cmp(VALUE self, VALUE other)
+static VALUE
+nurat_cmp(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
{
get_dat1(self);
- if (dat->den == LONG2FIX(1))
- return rb_int_cmp(dat->num, other); /* c14n */
- other = f_rational_new_bang1(CLASS_OF(self), other);
- goto other_is_rational;
+ if (FIXNUM_P(dat->den) && FIX2LONG(dat->den) == 1)
+ return f_cmp(dat->num, other); /* c14n */
+ return f_cmp(self, f_rational_new_bang1(CLASS_OF(self), other));
}
}
- else if (RB_FLOAT_TYPE_P(other)) {
- return rb_dbl_cmp(nurat_to_double(self), RFLOAT_VALUE(other));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return f_cmp(f_to_f(self), other);
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
- other_is_rational:
{
VALUE num1, num2;
@@ -1140,14 +1095,14 @@ rb_rational_cmp(VALUE self, VALUE other)
num2 = f_imul(FIX2LONG(bdat->num), FIX2LONG(adat->den));
}
else {
- num1 = rb_int_mul(adat->num, bdat->den);
- num2 = rb_int_mul(bdat->num, adat->den);
+ num1 = f_mul(adat->num, bdat->den);
+ num2 = f_mul(bdat->num, adat->den);
}
- return rb_int_cmp(rb_int_minus(num1, num2), ZERO);
+ return f_cmp(f_sub(num1, num2), ZERO);
}
}
else {
- return rb_num_coerce_cmp(self, other, rb_intern("<=>"));
+ return rb_num_coerce_cmp(self, other, id_cmp);
}
}
@@ -1155,7 +1110,7 @@ rb_rational_cmp(VALUE self, VALUE other)
* call-seq:
* rat == object -> true or false
*
- * Returns +true+ if +rat+ equals +object+ numerically.
+ * Returns true if rat equals object numerically.
*
* Rational(2, 3) == Rational(2, 3) #=> true
* Rational(5) == 5 #=> true
@@ -1166,37 +1121,38 @@ rb_rational_cmp(VALUE self, VALUE other)
static VALUE
nurat_eqeq_p(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
{
get_dat1(self);
- if (INT_ZERO_P(dat->num) && INT_ZERO_P(other))
+ if (f_zero_p(dat->num) && f_zero_p(other))
return Qtrue;
if (!FIXNUM_P(dat->den))
return Qfalse;
if (FIX2LONG(dat->den) != 1)
return Qfalse;
- return rb_int_equal(dat->num, other);
+ if (f_eqeq_p(dat->num, other))
+ return Qtrue;
+ return Qfalse;
}
}
- else if (RB_FLOAT_TYPE_P(other)) {
- const double d = nurat_to_double(self);
- return f_boolcast(FIXNUM_ZERO_P(rb_dbl_cmp(d, RFLOAT_VALUE(other))));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return f_eqeq_p(f_to_f(self), other);
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
{
get_dat2(self, other);
- if (INT_ZERO_P(adat->num) && INT_ZERO_P(bdat->num))
+ if (f_zero_p(adat->num) && f_zero_p(bdat->num))
return Qtrue;
- return f_boolcast(rb_int_equal(adat->num, bdat->num) &&
- rb_int_equal(adat->den, bdat->den));
+ return f_boolcast(f_eqeq_p(adat->num, bdat->num) &&
+ f_eqeq_p(adat->den, bdat->den));
}
}
else {
- return rb_equal(other, self);
+ return f_eqeq_p(other, self);
}
}
@@ -1204,11 +1160,11 @@ nurat_eqeq_p(VALUE self, VALUE other)
static VALUE
nurat_coerce(VALUE self, VALUE other)
{
- if (RB_INTEGER_TYPE_P(other)) {
+ if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
return rb_assoc_new(f_rational_new_bang1(CLASS_OF(self), other), self);
}
- else if (RB_FLOAT_TYPE_P(other)) {
- return rb_assoc_new(other, nurat_to_f(self));
+ else if (RB_TYPE_P(other, T_FLOAT)) {
+ return rb_assoc_new(other, f_to_f(self));
}
else if (RB_TYPE_P(other, T_RATIONAL)) {
return rb_assoc_new(other, self);
@@ -1259,68 +1215,18 @@ nurat_true(VALUE self)
}
#endif
-/*
- * call-seq:
- * rat.positive? -> true or false
- *
- * Returns +true+ if +rat+ is greater than 0.
- */
-static VALUE
-nurat_positive_p(VALUE self)
-{
- get_dat1(self);
- return f_boolcast(INT_POSITIVE_P(dat->num));
-}
-
-/*
- * call-seq:
- * rat.negative? -> true or false
- *
- * Returns +true+ if +rat+ is less than 0.
- */
-static VALUE
-nurat_negative_p(VALUE self)
-{
- get_dat1(self);
- return f_boolcast(INT_NEGATIVE_P(dat->num));
-}
-
-/*
- * call-seq:
- * rat.abs -> rational
- * rat.magnitude -> rational
- *
- * Returns the absolute value of +rat+.
- *
- * (1/2r).abs #=> (1/2)
- * (-1/2r).abs #=> (1/2)
- *
- * Rational#magnitude is an alias for Rational#abs.
- */
-
-VALUE
-rb_rational_abs(VALUE self)
-{
- get_dat1(self);
- if (INT_NEGATIVE_P(dat->num)) {
- VALUE num = rb_int_abs(dat->num);
- return nurat_s_canonicalize_internal_no_reduce(CLASS_OF(self), num, dat->den);
- }
- return self;
-}
-
static VALUE
nurat_floor(VALUE self)
{
get_dat1(self);
- return rb_int_idiv(dat->num, dat->den);
+ return f_idiv(dat->num, dat->den);
}
static VALUE
nurat_ceil(VALUE self)
{
get_dat1(self);
- return rb_int_uminus(rb_int_idiv(rb_int_uminus(dat->num), dat->den));
+ return f_negate(f_idiv(f_negate(dat->num), dat->den));
}
/*
@@ -1329,25 +1235,26 @@ nurat_ceil(VALUE self)
*
* Returns the truncated value as an integer.
*
- * Equivalent to Rational#truncate.
+ * Equivalent to
+ * rat.truncate.
*
- * Rational(2, 3).to_i #=> 0
- * Rational(3).to_i #=> 3
- * Rational(300.6).to_i #=> 300
- * Rational(98, 71).to_i #=> 1
- * Rational(-31, 2).to_i #=> -15
+ * Rational(2, 3).to_i #=> 0
+ * Rational(3).to_i #=> 3
+ * Rational(300.6).to_i #=> 300
+ * Rational(98,71).to_i #=> 1
+ * Rational(-30,2).to_i #=> -15
*/
static VALUE
nurat_truncate(VALUE self)
{
get_dat1(self);
- if (INT_NEGATIVE_P(dat->num))
- return rb_int_uminus(rb_int_idiv(rb_int_uminus(dat->num), dat->den));
- return rb_int_idiv(dat->num, dat->den);
+ if (f_negative_p(dat->num))
+ return f_negate(f_idiv(f_negate(dat->num), dat->den));
+ return f_idiv(dat->num, dat->den);
}
static VALUE
-nurat_round_half_up(VALUE self)
+nurat_round(VALUE self)
{
VALUE num, den, neg;
@@ -1355,69 +1262,17 @@ nurat_round_half_up(VALUE self)
num = dat->num;
den = dat->den;
- neg = INT_NEGATIVE_P(num);
+ neg = f_negative_p(num);
if (neg)
- num = rb_int_uminus(num);
+ num = f_negate(num);
- num = rb_int_plus(rb_int_mul(num, TWO), den);
- den = rb_int_mul(den, TWO);
- num = rb_int_idiv(num, den);
+ num = f_add(f_mul(num, TWO), den);
+ den = f_mul(den, TWO);
+ num = f_idiv(num, den);
if (neg)
- num = rb_int_uminus(num);
-
- return num;
-}
-
-static VALUE
-nurat_round_half_down(VALUE self)
-{
- VALUE num, den, neg;
-
- get_dat1(self);
-
- num = dat->num;
- den = dat->den;
- neg = INT_NEGATIVE_P(num);
-
- if (neg)
- num = rb_int_uminus(num);
-
- num = rb_int_plus(rb_int_mul(num, TWO), den);
- num = rb_int_minus(num, ONE);
- den = rb_int_mul(den, TWO);
- num = rb_int_idiv(num, den);
-
- if (neg)
- num = rb_int_uminus(num);
-
- return num;
-}
-
-static VALUE
-nurat_round_half_even(VALUE self)
-{
- VALUE num, den, neg, qr;
-
- get_dat1(self);
-
- num = dat->num;
- den = dat->den;
- neg = INT_NEGATIVE_P(num);
-
- if (neg)
- num = rb_int_uminus(num);
-
- num = rb_int_plus(rb_int_mul(num, TWO), den);
- den = rb_int_mul(den, TWO);
- qr = rb_int_divmod(num, den);
- num = RARRAY_AREF(qr, 0);
- if (INT_ZERO_P(RARRAY_AREF(qr, 1)))
- num = rb_int_and(num, LONG2FIX(((int)~1)));
-
- if (neg)
- num = rb_int_uminus(num);
+ num = f_negate(num);
return num;
}
@@ -1436,10 +1291,10 @@ f_round_common(int argc, VALUE *argv, VALUE self, VALUE (*func)(VALUE))
rb_raise(rb_eTypeError, "not an integer");
b = f_expt10(n);
- s = nurat_mul(self, b);
+ s = f_mul(self, b);
if (k_float_p(s)) {
- if (INT_NEGATIVE_P(n))
+ if (f_lt_p(n, ZERO))
return ZERO;
return self;
}
@@ -1450,37 +1305,31 @@ f_round_common(int argc, VALUE *argv, VALUE self, VALUE (*func)(VALUE))
s = (*func)(s);
- s = nurat_div(f_rational_new_bang1(CLASS_OF(self), s), b);
+ s = f_div(f_rational_new_bang1(CLASS_OF(self), s), b);
- if (RB_TYPE_P(s, T_RATIONAL) && FIX2INT(rb_int_cmp(n, ONE)) < 0)
- s = nurat_truncate(s);
+ if (f_lt_p(n, ONE))
+ s = f_to_i(s);
return s;
}
/*
* call-seq:
- * rat.floor([ndigits]) -> integer or rational
- *
- * Returns the largest number less than or equal to +rat+ with
- * a precision of +ndigits+ decimal digits (default: 0).
+ * rat.floor -> integer
+ * rat.floor(precision=0) -> rational
*
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
- *
- * Returns a rational when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the truncated value (toward negative infinity).
*
* Rational(3).floor #=> 3
* Rational(2, 3).floor #=> 0
- * Rational(-3, 2).floor #=> -2
+ * Rational(-3, 2).floor #=> -1
*
- * # decimal - 1 2 3 . 4 5 6
- * # ^ ^ ^ ^ ^ ^
- * # precision -3 -2 -1 0 +1 +2
+ * decimal - 1 2 3 . 4 5 6
+ * ^ ^ ^ ^ ^ ^
+ * precision -3 -2 -1 0 +1 +2
*
- * Rational('-123.456').floor(+1).to_f #=> -123.5
- * Rational('-123.456').floor(-1) #=> -130
+ * '%f' % Rational('-123.456').floor(+1) #=> "-123.500000"
+ * '%f' % Rational('-123.456').floor(-1) #=> "-130.000000"
*/
static VALUE
nurat_floor_n(int argc, VALUE *argv, VALUE self)
@@ -1490,27 +1339,21 @@ nurat_floor_n(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * rat.ceil([ndigits]) -> integer or rational
- *
- * Returns the smallest number greater than or equal to +rat+ with
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * rat.ceil -> integer
+ * rat.ceil(precision=0) -> rational
*
- * Returns a rational when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the truncated value (toward positive infinity).
*
* Rational(3).ceil #=> 3
* Rational(2, 3).ceil #=> 1
* Rational(-3, 2).ceil #=> -1
*
- * # decimal - 1 2 3 . 4 5 6
- * # ^ ^ ^ ^ ^ ^
- * # precision -3 -2 -1 0 +1 +2
+ * decimal - 1 2 3 . 4 5 6
+ * ^ ^ ^ ^ ^ ^
+ * precision -3 -2 -1 0 +1 +2
*
- * Rational('-123.456').ceil(+1).to_f #=> -123.4
- * Rational('-123.456').ceil(-1) #=> -120
+ * '%f' % Rational('-123.456').ceil(+1) #=> "-123.400000"
+ * '%f' % Rational('-123.456').ceil(-1) #=> "-120.000000"
*/
static VALUE
nurat_ceil_n(int argc, VALUE *argv, VALUE self)
@@ -1520,27 +1363,21 @@ nurat_ceil_n(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * rat.truncate([ndigits]) -> integer or rational
- *
- * Returns +rat+ truncated (toward zero) to
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
+ * rat.truncate -> integer
+ * rat.truncate(precision=0) -> rational
*
- * Returns a rational when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the truncated value (toward zero).
*
* Rational(3).truncate #=> 3
* Rational(2, 3).truncate #=> 0
* Rational(-3, 2).truncate #=> -1
*
- * # decimal - 1 2 3 . 4 5 6
- * # ^ ^ ^ ^ ^ ^
- * # precision -3 -2 -1 0 +1 +2
+ * decimal - 1 2 3 . 4 5 6
+ * ^ ^ ^ ^ ^ ^
+ * precision -3 -2 -1 0 +1 +2
*
- * Rational('-123.456').truncate(+1).to_f #=> -123.4
- * Rational('-123.456').truncate(-1) #=> -120
+ * '%f' % Rational('-123.456').truncate(+1) #=> "-123.400000"
+ * '%f' % Rational('-123.456').truncate(-1) #=> "-120.000000"
*/
static VALUE
nurat_truncate_n(int argc, VALUE *argv, VALUE self)
@@ -1550,64 +1387,34 @@ nurat_truncate_n(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * rat.round([ndigits] [, half: mode]) -> integer or rational
+ * rat.round -> integer
+ * rat.round(precision=0) -> rational
*
- * Returns +rat+ rounded to the nearest value with
- * a precision of +ndigits+ decimal digits (default: 0).
- *
- * When the precision is negative, the returned value is an integer
- * with at least <code>ndigits.abs</code> trailing zeros.
- *
- * Returns a rational when +ndigits+ is positive,
- * otherwise returns an integer.
+ * Returns the truncated value (toward the nearest integer;
+ * 0.5 => 1; -0.5 => -1).
*
* Rational(3).round #=> 3
* Rational(2, 3).round #=> 1
* Rational(-3, 2).round #=> -2
*
- * # decimal - 1 2 3 . 4 5 6
- * # ^ ^ ^ ^ ^ ^
- * # precision -3 -2 -1 0 +1 +2
- *
- * Rational('-123.456').round(+1).to_f #=> -123.5
- * Rational('-123.456').round(-1) #=> -120
- *
- * The optional +half+ keyword argument is available
- * similar to Float#round.
- *
- * Rational(25, 100).round(1, half: :up) #=> (3/10)
- * Rational(25, 100).round(1, half: :down) #=> (1/5)
- * Rational(25, 100).round(1, half: :even) #=> (1/5)
- * Rational(35, 100).round(1, half: :up) #=> (2/5)
- * Rational(35, 100).round(1, half: :down) #=> (3/10)
- * Rational(35, 100).round(1, half: :even) #=> (2/5)
- * Rational(-25, 100).round(1, half: :up) #=> (-3/10)
- * Rational(-25, 100).round(1, half: :down) #=> (-1/5)
- * Rational(-25, 100).round(1, half: :even) #=> (-1/5)
+ * decimal - 1 2 3 . 4 5 6
+ * ^ ^ ^ ^ ^ ^
+ * precision -3 -2 -1 0 +1 +2
+ *
+ * '%f' % Rational('-123.456').round(+1) #=> "-123.500000"
+ * '%f' % Rational('-123.456').round(-1) #=> "-120.000000"
*/
static VALUE
nurat_round_n(int argc, VALUE *argv, VALUE self)
{
- VALUE opt;
- enum ruby_num_rounding_mode mode = (
- argc = rb_scan_args(argc, argv, "*:", NULL, &opt),
- rb_num_get_rounding_option(opt));
- VALUE (*round_func)(VALUE) = ROUND_FUNC(mode, nurat_round);
- return f_round_common(argc, argv, self, round_func);
-}
-
-static double
-nurat_to_double(VALUE self)
-{
- get_dat1(self);
- return rb_int_fdiv_double(dat->num, dat->den);
+ return f_round_common(argc, argv, self, nurat_round);
}
/*
* call-seq:
* rat.to_f -> float
*
- * Returns the value as a Float.
+ * Return the value as a float.
*
* Rational(2).to_f #=> 2.0
* Rational(9, 4).to_f #=> 2.25
@@ -1617,7 +1424,8 @@ nurat_to_double(VALUE self)
static VALUE
nurat_to_f(VALUE self)
{
- return DBL2NUM(nurat_to_double(self));
+ get_dat1(self);
+ return f_fdiv(dat->num, dat->den);
}
/*
@@ -1737,8 +1545,8 @@ nurat_rationalize_internal(VALUE a, VALUE b, VALUE *p, VALUE *q)
* rat.rationalize(eps) -> rational
*
* Returns a simpler approximation of the value if the optional
- * argument +eps+ is given (rat-|eps| <= result <= rat+|eps|),
- * self otherwise.
+ * argument eps is given (rat-|eps| <= result <= rat+|eps|), self
+ * otherwise.
*
* r = Rational(5033165, 16777216)
* r.rationalize #=> (5033165/16777216)
@@ -1753,8 +1561,8 @@ nurat_rationalize(int argc, VALUE *argv, VALUE self)
if (argc == 0)
return self;
- if (nurat_negative_p(self))
- return rb_rational_uminus(nurat_rationalize(argc, argv, rb_rational_uminus(self)));
+ if (f_negative_p(self))
+ return f_negate(nurat_rationalize(argc, argv, f_abs(self)));
rb_scan_args(argc, argv, "01", &e);
e = f_abs(e);
@@ -1781,7 +1589,7 @@ nurat_hash(VALUE self)
n = rb_hash(dat->den);
h[1] = NUM2LONG(n);
v = rb_memhash(h, sizeof(h));
- return ST2FIX(v);
+ return LONG2FIX(v);
}
static VALUE
@@ -1846,17 +1654,10 @@ nurat_dumper(VALUE self)
static VALUE
nurat_loader(VALUE self, VALUE a)
{
- VALUE num, den;
-
get_dat1(self);
- num = rb_ivar_get(a, id_i_num);
- den = rb_ivar_get(a, id_i_den);
- nurat_int_check(num);
- nurat_int_check(den);
- nurat_canonicalize(&num, &den);
- RRATIONAL_SET_NUM(dat, num);
- RRATIONAL_SET_DEN(dat, den);
- OBJ_FREEZE_RAW(self);
+
+ RRATIONAL_SET_NUM(dat, rb_ivar_get(a, id_i_num));
+ RRATIONAL_SET_DEN(dat, rb_ivar_get(a, id_i_den));
return self;
}
@@ -1877,22 +1678,17 @@ nurat_marshal_dump(VALUE self)
static VALUE
nurat_marshal_load(VALUE self, VALUE a)
{
- VALUE num, den;
-
rb_check_frozen(self);
rb_check_trusted(self);
Check_Type(a, T_ARRAY);
if (RARRAY_LEN(a) != 2)
rb_raise(rb_eArgError, "marshaled rational must have an array whose length is 2 but %ld", RARRAY_LEN(a));
+ if (f_zero_p(RARRAY_AREF(a, 1)))
+ rb_raise_zerodiv();
- num = RARRAY_AREF(a, 0);
- den = RARRAY_AREF(a, 1);
- nurat_int_check(num);
- nurat_int_check(den);
- nurat_canonicalize(&num, &den);
- rb_ivar_set(self, id_i_num, num);
- rb_ivar_set(self, id_i_den, den);
+ rb_ivar_set(self, id_i_num, RARRAY_AREF(a, 0));
+ rb_ivar_set(self, id_i_den, RARRAY_AREF(a, 1));
return self;
}
@@ -1908,12 +1704,11 @@ rb_rational_reciprocal(VALUE x)
/*
* call-seq:
- * int.gcd(other_int) -> integer
+ * int.gcd(int2) -> integer
*
- * Returns the greatest common divisor of the two integers.
- * The result is always positive. 0.gcd(x) and x.gcd(0) return x.abs.
+ * Returns the greatest common divisor (always positive). 0.gcd(x)
+ * and x.gcd(0) return abs(x).
*
- * 36.gcd(60) #=> 12
* 2.gcd(2) #=> 2
* 3.gcd(-7) #=> 1
* ((1<<31)-1).gcd((1<<61)-1) #=> 1
@@ -1927,12 +1722,11 @@ rb_gcd(VALUE self, VALUE other)
/*
* call-seq:
- * int.lcm(other_int) -> integer
+ * int.lcm(int2) -> integer
*
- * Returns the least common multiple of the two integers.
- * The result is always positive. 0.lcm(x) and x.lcm(0) return zero.
+ * Returns the least common multiple (always positive). 0.lcm(x) and
+ * x.lcm(0) return zero.
*
- * 36.lcm(60) #=> 180
* 2.lcm(2) #=> 2
* 3.lcm(-7) #=> 21
* ((1<<31)-1).lcm((1<<61)-1) #=> 4951760154835678088235319297
@@ -1946,12 +1740,10 @@ rb_lcm(VALUE self, VALUE other)
/*
* call-seq:
- * int.gcdlcm(other_int) -> array
+ * int.gcdlcm(int2) -> array
*
- * Returns an array with the greatest common divisor and
- * the least common multiple of the two integers, [gcd, lcm].
+ * Returns an array; [int.gcd(int2), int.lcm(int2)].
*
- * 36.gcdlcm(60) #=> [12, 180]
* 2.gcdlcm(2) #=> [2, 2]
* 3.gcdlcm(-7) #=> [1, 21]
* ((1<<31)-1).gcdlcm((1<<61)-1) #=> [1, 4951760154835678088235319297]
@@ -1975,6 +1767,8 @@ rb_rational_new(VALUE x, VALUE y)
return nurat_s_canonicalize_internal(rb_cRational, x, y);
}
+static VALUE nurat_s_convert(int argc, VALUE *argv, VALUE klass);
+
VALUE
rb_Rational(VALUE x, VALUE y)
{
@@ -2035,23 +1829,26 @@ numeric_denominator(VALUE self)
* num.quo(int_or_rat) -> rat
* num.quo(flo) -> flo
*
- * Returns the most exact division (rational for integers, float for floats).
+ * Returns most exact division (rational for integers, float for floats).
*/
-VALUE
-rb_numeric_quo(VALUE x, VALUE y)
+static VALUE
+numeric_quo(VALUE x, VALUE y)
{
- if (RB_FLOAT_TYPE_P(y)) {
- return rb_funcall(x, rb_intern("fdiv"), 1, y);
+ if (RB_TYPE_P(y, T_FLOAT)) {
+ return f_fdiv(x, y);
}
+#ifdef CANON
if (canonicalization) {
x = rb_rational_raw1(x);
}
- else {
+ else
+#endif
+ {
x = rb_convert_type(x, T_RATIONAL, "Rational", "to_r");
}
- return nurat_div(x, y);
+ return rb_funcall(x, '/', 1, y);
}
@@ -2079,7 +1876,6 @@ integer_denominator(VALUE self)
return INT2FIX(1);
}
-static VALUE float_to_r(VALUE self);
/*
* call-seq:
* flo.numerator -> integer
@@ -2089,21 +1885,14 @@ static VALUE float_to_r(VALUE self);
* n = 0.3.numerator #=> 5404319552844595
* d = 0.3.denominator #=> 18014398509481984
* n.fdiv(d) #=> 0.3
- *
- * See also Float#denominator.
*/
static VALUE
float_numerator(VALUE self)
{
double d = RFLOAT_VALUE(self);
- VALUE r;
if (isinf(d) || isnan(d))
return self;
- r = float_to_r(self);
- if (canonicalization && k_integer_p(r)) {
- return r;
- }
- return nurat_numerator(r);
+ return rb_call_super(0, 0);
}
/*
@@ -2113,20 +1902,15 @@ float_numerator(VALUE self)
* Returns the denominator (always positive). The result is machine
* dependent.
*
- * See also Float#numerator.
+ * See numerator.
*/
static VALUE
float_denominator(VALUE self)
{
double d = RFLOAT_VALUE(self);
- VALUE r;
if (isinf(d) || isnan(d))
return INT2FIX(1);
- r = float_to_r(self);
- if (canonicalization && k_integer_p(r)) {
- return ONE;
- }
- return nurat_denominator(r);
+ return rb_call_super(0, 0);
}
/*
@@ -2145,7 +1929,7 @@ nilclass_to_r(VALUE self)
* call-seq:
* nil.rationalize([eps]) -> (0/1)
*
- * Returns zero as a rational. The optional argument +eps+ is always
+ * Returns zero as a rational. The optional argument eps is always
* ignored.
*/
static VALUE
@@ -2174,7 +1958,7 @@ integer_to_r(VALUE self)
* call-seq:
* int.rationalize([eps]) -> rational
*
- * Returns the value as a rational. The optional argument +eps+ is
+ * Returns the value as a rational. The optional argument eps is
* always ignored.
*/
static VALUE
@@ -2208,25 +1992,24 @@ float_decode(VALUE self)
}
#endif
+#define id_lshift rb_intern("<<")
+#define f_lshift(x,n) rb_funcall((x), id_lshift, 1, (n))
+
/*
* call-seq:
* flt.to_r -> rational
*
* Returns the value as a rational.
*
+ * NOTE: 0.3.to_r isn't the same as '0.3'.to_r. The latter is
+ * equivalent to '3/10'.to_r, but the former isn't so.
+ *
* 2.0.to_r #=> (2/1)
* 2.5.to_r #=> (5/2)
* -0.75.to_r #=> (-3/4)
* 0.0.to_r #=> (0/1)
- * 0.3.to_r #=> (5404319552844595/18014398509481984)
*
- * NOTE: 0.3.to_r isn't the same as "0.3".to_r. The latter is
- * equivalent to "3/10".to_r, but the former isn't so.
- *
- * 0.3.to_r == 3/10r #=> false
- * "0.3".to_r == 3/10r #=> true
- *
- * See also Float#rationalize.
+ * See rationalize.
*/
static VALUE
float_to_r(VALUE self)
@@ -2239,17 +2022,14 @@ float_to_r(VALUE self)
long ln = FIX2LONG(n);
if (ln == 0)
- return rb_rational_new1(f);
+ return f_to_r(f);
if (ln > 0)
- return rb_rational_new1(rb_int_lshift(f, n));
+ return f_to_r(f_lshift(f, n));
ln = -ln;
- return rb_rational_new2(f, rb_int_lshift(ONE, INT2FIX(ln)));
+ return rb_rational_new2(f, f_lshift(ONE, INT2FIX(ln)));
}
#else
- f = rb_int_mul(f, rb_int_pow(INT2FIX(FLT_RADIX), n));
- if (RB_TYPE_P(f, T_RATIONAL))
- return f;
- return rb_rational_new1(f);
+ return f_to_r(f_mul(f, f_expt(INT2FIX(FLT_RADIX), n)));
#endif
}
@@ -2263,7 +2043,7 @@ rb_flt_rationalize_with_prec(VALUE flt, VALUE prec)
b = f_add(flt, e);
if (f_eqeq_p(a, b))
- return float_to_r(flt);
+ return f_to_r(flt);
nurat_rationalize_internal(a, b, &p, &q);
return rb_rational_new2(p, q);
@@ -2275,33 +2055,33 @@ rb_flt_rationalize(VALUE flt)
VALUE a, b, f, n, p, q;
float_decode_internal(flt, &f, &n);
- if (INT_ZERO_P(f) || FIX2INT(n) >= 0)
- return rb_rational_new1(rb_int_lshift(f, n));
+ if (f_zero_p(f) || f_positive_p(n))
+ return rb_rational_new1(f_lshift(f, n));
#if FLT_RADIX == 2
{
VALUE two_times_f, den;
- two_times_f = rb_int_mul(TWO, f);
- den = rb_int_lshift(ONE, rb_int_minus(ONE, n));
+ two_times_f = f_mul(TWO, f);
+ den = f_lshift(ONE, f_sub(ONE, n));
- a = rb_rational_new2(rb_int_minus(two_times_f, ONE), den);
- b = rb_rational_new2(rb_int_plus(two_times_f, ONE), den);
+ a = rb_rational_new2(f_sub(two_times_f, ONE), den);
+ b = rb_rational_new2(f_add(two_times_f, ONE), den);
}
#else
{
VALUE radix_times_f, den;
- radix_times_f = rb_int_mul(INT2FIX(FLT_RADIX), f);
- den = rb_int_pow(INT2FIX(FLT_RADIX), rb_int_minus(ONE, n));
+ radix_times_f = f_mul(INT2FIX(FLT_RADIX), f);
+ den = f_expt(INT2FIX(FLT_RADIX), f_sub(ONE, n));
- a = rb_rational_new2(rb_int_minus(radix_times_f, INT2FIX(FLT_RADIX - 1)), den);
- b = rb_rational_new2(rb_int_plus(radix_times_f, INT2FIX(FLT_RADIX - 1)), den);
+ a = rb_rational_new2(f_sub(radix_times_f, INT2FIX(FLT_RADIX - 1)), den);
+ b = rb_rational_new2(f_add(radix_times_f, INT2FIX(FLT_RADIX - 1)), den);
}
#endif
- if (nurat_eqeq_p(a, b))
- return float_to_r(flt);
+ if (f_eqeq_p(a, b))
+ return f_to_r(flt);
nurat_rationalize_internal(a, b, &p, &q);
return rb_rational_new2(p, q);
@@ -2312,23 +2092,22 @@ rb_flt_rationalize(VALUE flt)
* flt.rationalize([eps]) -> rational
*
* Returns a simpler approximation of the value (flt-|eps| <= result
- * <= flt+|eps|). If the optional argument +eps+ is not given,
- * it will be chosen automatically.
+ * <= flt+|eps|). if the optional eps is not given, it will be chosen
+ * automatically.
*
* 0.3.rationalize #=> (3/10)
* 1.333.rationalize #=> (1333/1000)
* 1.333.rationalize(0.01) #=> (4/3)
*
- * See also Float#to_r.
+ * See to_r.
*/
static VALUE
float_rationalize(int argc, VALUE *argv, VALUE self)
{
VALUE e;
- double d = RFLOAT_VALUE(self);
- if (d < 0.0)
- return rb_rational_uminus(float_rationalize(argc, argv, DBL2NUM(-d)));
+ if (f_negative_p(self))
+ return f_negate(float_rationalize(argc, argv, f_abs(self)));
rb_scan_args(argc, argv, "01", &e);
@@ -2349,11 +2128,11 @@ issign(int c)
}
static int
-read_sign(const char **s, const char *const e)
+read_sign(const char **s)
{
int sign = '?';
- if (*s < e && issign(**s)) {
+ if (issign(**s)) {
sign = **s;
(*s)++;
}
@@ -2361,160 +2140,200 @@ read_sign(const char **s, const char *const e)
}
inline static int
-islettere(int c)
+isdecimal(int c)
{
- return (c == 'e' || c == 'E');
+ return isdigit((unsigned char)c);
}
-static VALUE
-negate_num(VALUE num)
+static int
+read_digits(const char **s, int strict,
+ VALUE *num, int *count)
{
- if (FIXNUM_P(num)) {
- return rb_int_uminus(num);
+ char *b, *bb;
+ int us = 1, ret = 1;
+ VALUE tmp;
+
+ if (!isdecimal(**s)) {
+ *num = ZERO;
+ return 0;
}
- else {
- BIGNUM_NEGATE(num);
- return rb_big_norm(num);
+
+ bb = b = ALLOCV_N(char, tmp, strlen(*s) + 1);
+
+ while (isdecimal(**s) || **s == '_') {
+ if (**s == '_') {
+ if (strict) {
+ if (us) {
+ ret = 0;
+ goto conv;
+ }
+ }
+ us = 1;
+ }
+ else {
+ if (count)
+ (*count)++;
+ *b++ = **s;
+ us = 0;
+ }
+ (*s)++;
}
+ if (us)
+ do {
+ (*s)--;
+ } while (**s == '_');
+ conv:
+ *b = '\0';
+ *num = rb_cstr_to_inum(bb, 10, 0);
+ ALLOCV_END(tmp);
+ return ret;
+}
+
+inline static int
+islettere(int c)
+{
+ return (c == 'e' || c == 'E');
}
static int
-read_num(const char **s, const char *const end, VALUE *num, VALUE *div)
-{
- VALUE fp = ONE, exp, fn = ZERO, n = ZERO;
- int expsign = 0, ok = 0;
- char *e;
-
- *div = ONE;
- *num = ZERO;
- if (*s < end && **s != '.') {
- n = rb_int_parse_cstr(*s, end-*s, &e, NULL,
- 10, RB_INT_PARSE_UNDERSCORE);
- if (NIL_P(n))
+read_num(const char **s, int numsign, int strict,
+ VALUE *num)
+{
+ VALUE ip, fp, exp;
+
+ *num = rb_rational_new2(ZERO, ONE);
+ exp = Qnil;
+
+ if (**s != '.') {
+ if (!read_digits(s, strict, &ip, NULL))
return 0;
- *s = e;
- *num = n;
- ok = 1;
+ *num = rb_rational_new2(ip, ONE);
}
- if (*s < end && **s == '.') {
- size_t count = 0;
+ if (**s == '.') {
+ int count = 0;
(*s)++;
- fp = rb_int_parse_cstr(*s, end-*s, &e, &count,
- 10, RB_INT_PARSE_UNDERSCORE);
- if (NIL_P(fp))
- return 1;
- *s = e;
+ if (!read_digits(s, strict, &fp, &count))
+ return 0;
{
- VALUE l = f_expt10(SIZET2NUM(count));
- n = n == ZERO ? fp : rb_int_plus(rb_int_mul(*num, l), fp);
- *num = n;
- *div = l;
- fn = SIZET2NUM(count);
+ VALUE l = f_expt10(INT2NUM(count));
+ *num = f_mul(*num, l);
+ *num = f_add(*num, fp);
+ *num = f_div(*num, l);
}
- ok = 1;
}
- if (ok && *s + 1 < end && islettere(**s)) {
+ if (islettere(**s)) {
+ int expsign;
+
(*s)++;
- expsign = read_sign(s, end);
- exp = rb_int_parse_cstr(*s, end-*s, &e, NULL,
- 10, RB_INT_PARSE_UNDERSCORE);
- if (NIL_P(exp))
- return 1;
- *s = e;
- if (exp != ZERO) {
- if (expsign == '-') {
- if (fn != ZERO) exp = rb_int_plus(exp, fn);
- *div = f_expt10(exp);
- }
- else {
- if (fn != ZERO) exp = rb_int_minus(exp, fn);
- if (INT_NEGATIVE_P(exp)) {
- *div = f_expt10(negate_num(exp));
- }
- else {
- *num = rb_int_mul(n, f_expt10(exp));
- *div = ONE;
- }
- }
- }
+ expsign = read_sign(s);
+ if (!read_digits(s, strict, &exp, NULL))
+ return 0;
+ if (expsign == '-')
+ exp = f_negate(exp);
}
- return ok;
+ if (numsign == '-')
+ *num = f_negate(*num);
+ if (!NIL_P(exp)) {
+ VALUE l = f_expt10(exp);
+ *num = f_mul(*num, l);
+ }
+ return 1;
}
-inline static const char *
-skip_ws(const char *s, const char *e)
+inline static int
+read_den(const char **s, int strict,
+ VALUE *num)
{
- while (s < e && isspace((unsigned char)*s))
- ++s;
- return s;
+ if (!read_digits(s, strict, num, NULL))
+ return 0;
+ return 1;
}
-static VALUE
-parse_rat(const char *s, const char *const e, int strict)
+static int
+read_rat_nos(const char **s, int sign, int strict,
+ VALUE *num)
{
- int sign;
- VALUE num, den, ndiv, ddiv;
-
- s = skip_ws(s, e);
- sign = read_sign(&s, e);
-
- if (!read_num(&s, e, &num, &ndiv)) {
- if (strict) return Qnil;
- return canonicalization ? ZERO : nurat_s_alloc(rb_cRational);
- }
- nurat_reduce(&num, &ndiv);
- den = ndiv;
- if (s < e && *s == '/') {
- s++;
- if (!read_num(&s, e, &den, &ddiv)) {
- if (strict) return Qnil;
- den = ndiv;
- }
- else if (den == ZERO) {
- rb_num_zerodiv();
- }
- else if (strict && skip_ws(s, e) != e) {
- return Qnil;
- }
- else {
- nurat_reduce(&den, &ddiv);
- nurat_reduce(&num, &den);
- nurat_reduce(&ndiv, &ddiv);
- if (ndiv != ONE) den = rb_int_mul(den, ndiv);
- if (ddiv != ONE) num = rb_int_mul(num, ddiv);
- }
- }
- else if (strict && skip_ws(s, e) != e) {
- return Qnil;
- }
+ VALUE den;
- if (sign == '-') {
- num = negate_num(num);
+ if (!read_num(s, sign, strict, num))
+ return 0;
+ if (**s == '/') {
+ (*s)++;
+ if (!read_den(s, strict, &den))
+ return 0;
+ if (!(FIXNUM_P(den) && FIX2LONG(den) == 1))
+ *num = f_div(*num, den);
}
+ return 1;
+}
- if (!canonicalization || den != ONE)
- num = rb_rational_raw(num, den);
- return num;
+static int
+read_rat(const char **s, int strict,
+ VALUE *num)
+{
+ int sign;
+
+ sign = read_sign(s);
+ if (!read_rat_nos(s, sign, strict, num))
+ return 0;
+ return 1;
+}
+
+inline static void
+skip_ws(const char **s)
+{
+ while (isspace((unsigned char)**s))
+ (*s)++;
+}
+
+static int
+parse_rat(const char *s, int strict,
+ VALUE *num)
+{
+ skip_ws(&s);
+ if (!read_rat(&s, strict, num))
+ return 0;
+ skip_ws(&s);
+
+ if (strict)
+ if (*s != '\0')
+ return 0;
+ return 1;
}
static VALUE
string_to_r_strict(VALUE self)
{
+ char *s;
VALUE num;
rb_must_asciicompat(self);
- num = parse_rat(RSTRING_PTR(self), RSTRING_END(self), 1);
- if (NIL_P(num)) {
- rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
- self);
+ s = RSTRING_PTR(self);
+
+ if (!s || memchr(s, '\0', RSTRING_LEN(self)))
+ rb_raise(rb_eArgError, "string contains null byte");
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
+
+ if (!s)
+ s = (char *)"";
+
+ if (!parse_rat(s, 1, &num)) {
+ VALUE ins = f_inspect(self);
+ rb_raise(rb_eArgError, "invalid value for convert(): %s",
+ StringValuePtr(ins));
}
- if (RB_FLOAT_TYPE_P(num))
+ if (RB_TYPE_P(num, T_FLOAT))
rb_raise(rb_eFloatDomainError, "Infinity");
return num;
}
@@ -2523,40 +2342,47 @@ string_to_r_strict(VALUE self)
* call-seq:
* str.to_r -> rational
*
- * Returns the result of interpreting leading characters in +str+
- * as a rational. Leading whitespace and extraneous characters
- * past the end of a valid number are ignored.
- * Digit sequences can be separated by an underscore.
- * If there is not a valid number at the start of +str+,
- * zero is returned. This method never raises an exception.
+ * Returns a rational which denotes the string form. The parser
+ * ignores leading whitespaces and trailing garbage. Any digit
+ * sequences can be separated by an underscore. Returns zero for null
+ * or garbage string.
+ *
+ * NOTE: '0.3'.to_r isn't the same as 0.3.to_r. The former is
+ * equivalent to '3/10'.to_r, but the latter isn't so.
*
* ' 2 '.to_r #=> (2/1)
* '300/2'.to_r #=> (150/1)
* '-9.2'.to_r #=> (-46/5)
* '-9.2e2'.to_r #=> (-920/1)
* '1_234_567'.to_r #=> (1234567/1)
- * '21 June 09'.to_r #=> (21/1)
+ * '21 june 09'.to_r #=> (21/1)
* '21/06/09'.to_r #=> (7/2)
- * 'BWV 1079'.to_r #=> (0/1)
- *
- * NOTE: "0.3".to_r isn't the same as 0.3.to_r. The former is
- * equivalent to "3/10".to_r, but the latter isn't so.
- *
- * "0.3".to_r == 3/10r #=> true
- * 0.3.to_r == 3/10r #=> false
+ * 'bwv 1079'.to_r #=> (0/1)
*
- * See also Kernel#Rational.
+ * See Kernel.Rational.
*/
static VALUE
string_to_r(VALUE self)
{
+ char *s;
VALUE num;
rb_must_asciicompat(self);
- num = parse_rat(RSTRING_PTR(self), RSTRING_END(self), 0);
+ s = RSTRING_PTR(self);
+
+ if (s && s[RSTRING_LEN(self)]) {
+ rb_str_modify(self);
+ s = RSTRING_PTR(self);
+ s[RSTRING_LEN(self)] = '\0';
+ }
- if (RB_FLOAT_TYPE_P(num))
+ if (!s)
+ s = (char *)"";
+
+ (void)parse_rat(s, 0, &num);
+
+ if (RB_TYPE_P(num, T_FLOAT))
rb_raise(rb_eFloatDomainError, "Infinity");
return num;
}
@@ -2566,9 +2392,9 @@ rb_cstr_to_rat(const char *s, int strict) /* for complex's internal */
{
VALUE num;
- num = parse_rat(s, s + strlen(s), strict);
+ (void)parse_rat(s, strict, &num);
- if (RB_FLOAT_TYPE_P(num))
+ if (RB_TYPE_P(num, T_FLOAT))
rb_raise(rb_eFloatDomainError, "Infinity");
return num;
}
@@ -2596,15 +2422,15 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass)
backref = rb_backref_get();
rb_match_busy(backref);
- if (RB_FLOAT_TYPE_P(a1)) {
- a1 = float_to_r(a1);
+ if (RB_TYPE_P(a1, T_FLOAT)) {
+ a1 = f_to_r(a1);
}
else if (RB_TYPE_P(a1, T_STRING)) {
a1 = string_to_r_strict(a1);
}
- if (RB_FLOAT_TYPE_P(a2)) {
- a2 = float_to_r(a2);
+ if (RB_TYPE_P(a2, T_FLOAT)) {
+ a2 = f_to_r(a2);
}
else if (RB_TYPE_P(a2, T_STRING)) {
a2 = string_to_r_strict(a2);
@@ -2619,7 +2445,7 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass)
if (argc == 1) {
if (!(k_numeric_p(a1) && k_integer_p(a1)))
- return rb_convert_type_with_id(a1, T_RATIONAL, "Rational", idTo_r);
+ return rb_convert_type(a1, T_RATIONAL, "Rational", "to_r");
}
else {
if ((k_numeric_p(a1) && k_numeric_p(a2)) &&
@@ -2636,21 +2462,19 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass)
}
/*
- * A rational number can be represented as a pair of integer numbers:
- * a/b (b>0), where a is the numerator and b is the denominator.
- * Integer a equals rational a/1 mathematically.
+ * A rational number can be represented as a paired integer number;
+ * a/b (b>0). Where a is numerator and b is denominator. Integer a
+ * equals rational a/1 mathematically.
*
- * In Ruby, you can create rational objects with the Kernel#Rational,
- * to_r, or rationalize methods or by suffixing +r+ to a literal.
- * The return values will be irreducible fractions.
+ * In ruby, you can create rational object with Rational, to_r or
+ * rationalize method. The return values will be irreducible.
*
* Rational(1) #=> (1/1)
* Rational(2, 3) #=> (2/3)
* Rational(4, -6) #=> (-2/3)
* 3.to_r #=> (3/1)
- * 2/3r #=> (2/3)
*
- * You can also create rational objects from floating-point numbers or
+ * You can also create rational object from floating-point numbers or
* strings.
*
* Rational(0.3) #=> (5404319552844595/18014398509481984)
@@ -2663,13 +2487,13 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass)
* 0.3.rationalize #=> (3/10)
*
* A rational object is an exact number, which helps you to write
- * programs without any rounding errors.
+ * program without any rounding errors.
*
- * 10.times.inject(0) {|t| t + 0.1 } #=> 0.9999999999999999
- * 10.times.inject(0) {|t| t + Rational('0.1') } #=> (1/1)
+ * 10.times.inject(0){|t,| t + 0.1} #=> 0.9999999999999999
+ * 10.times.inject(0){|t,| t + Rational('0.1')} #=> (1/1)
*
- * However, when an expression includes an inexact component (numerical value
- * or operation), it will produce an inexact result.
+ * However, when an expression has inexact factor (numerical value or
+ * operation), will produce an inexact result.
*
* Rational(10) / 3 #=> (10/3)
* Rational(10) / 3.0 #=> 3.3333333333333335
@@ -2687,9 +2511,17 @@ Init_Rational(void)
assert(fprintf(stderr, "assert() is now active\n"));
id_abs = rb_intern("abs");
+ id_cmp = rb_intern("<=>");
+ id_convert = rb_intern("convert");
+ id_eqeq_p = rb_intern("==");
+ id_expt = rb_intern("**");
+ id_fdiv = rb_intern("fdiv");
id_idiv = rb_intern("div");
id_integer_p = rb_intern("integer?");
+ id_negate = rb_intern("-@");
+ id_to_f = rb_intern("to_f");
id_to_i = rb_intern("to_i");
+ id_truncate = rb_intern("truncate");
id_i_num = rb_intern("@numerator");
id_i_den = rb_intern("@denominator");
@@ -2710,8 +2542,7 @@ Init_Rational(void)
rb_define_method(rb_cRational, "numerator", nurat_numerator, 0);
rb_define_method(rb_cRational, "denominator", nurat_denominator, 0);
- rb_define_method(rb_cRational, "-@", rb_rational_uminus, 0);
- rb_define_method(rb_cRational, "+", rb_rational_plus, 1);
+ rb_define_method(rb_cRational, "+", nurat_add, 1);
rb_define_method(rb_cRational, "-", nurat_sub, 1);
rb_define_method(rb_cRational, "*", nurat_mul, 1);
rb_define_method(rb_cRational, "/", nurat_div, 1);
@@ -2719,10 +2550,14 @@ Init_Rational(void)
rb_define_method(rb_cRational, "fdiv", nurat_fdiv, 1);
rb_define_method(rb_cRational, "**", nurat_expt, 1);
- rb_define_method(rb_cRational, "<=>", rb_rational_cmp, 1);
+ rb_define_method(rb_cRational, "<=>", nurat_cmp, 1);
rb_define_method(rb_cRational, "==", nurat_eqeq_p, 1);
rb_define_method(rb_cRational, "coerce", nurat_coerce, 1);
+#if 0 /* NUBY */
+ rb_define_method(rb_cRational, "//", nurat_idiv, 1);
+#endif
+
#if 0
rb_define_method(rb_cRational, "quot", nurat_quot, 1);
rb_define_method(rb_cRational, "quotrem", nurat_quotrem, 1);
@@ -2732,10 +2567,6 @@ Init_Rational(void)
rb_define_method(rb_cRational, "rational?", nurat_true, 0);
rb_define_method(rb_cRational, "exact?", nurat_true, 0);
#endif
- rb_define_method(rb_cRational, "positive?", nurat_positive_p, 0);
- rb_define_method(rb_cRational, "negative?", nurat_negative_p, 0);
- rb_define_method(rb_cRational, "abs", rb_rational_abs, 0);
- rb_define_method(rb_cRational, "magnitude", rb_rational_abs, 0);
rb_define_method(rb_cRational, "floor", nurat_floor_n, -1);
rb_define_method(rb_cRational, "ceil", nurat_ceil_n, -1);
@@ -2765,7 +2596,7 @@ Init_Rational(void)
rb_define_method(rb_cNumeric, "numerator", numeric_numerator, 0);
rb_define_method(rb_cNumeric, "denominator", numeric_denominator, 0);
- rb_define_method(rb_cNumeric, "quo", rb_numeric_quo, 1);
+ rb_define_method(rb_cNumeric, "quo", numeric_quo, 1);
rb_define_method(rb_cInteger, "numerator", integer_numerator, 0);
rb_define_method(rb_cInteger, "denominator", integer_denominator, 0);
diff --git a/re.c b/re.c
index 5030519fc9..d110fe63ef 100644
--- a/re.c
+++ b/re.c
@@ -9,11 +9,12 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "ruby/re.h"
+#include "ruby/encoding.h"
#include "ruby/util.h"
+#include "internal.h"
#include "regint.h"
-#include "encindex.h"
#include <ctype.h>
VALUE rb_eRegexpError;
@@ -88,6 +89,14 @@ rb_memcicmp(const void *x, const void *y, long len)
return 0;
}
+#undef rb_memcmp
+
+int
+rb_memcmp(const void *p1, const void *p2, long len)
+{
+ return memcmp(p1, p2, len);
+}
+
#ifdef HAVE_MEMMEM
static inline long
rb_memsearch_ss(const unsigned char *xs, long m, const unsigned char *ys, long n)
@@ -214,32 +223,6 @@ rb_memsearch_qs_utf8(const unsigned char *xs, long m, const unsigned char *ys, l
return -1;
}
-static inline long
-rb_memsearch_wchar(const unsigned char *xs, long m, const unsigned char *ys, long n)
-{
- const unsigned char *x = xs, x0 = *xs, *y = ys;
- enum {char_size = 2};
-
- for (n -= m; n >= 0; n -= char_size, y += char_size) {
- if (x0 == *y && memcmp(x+1, y+1, m-1) == 0)
- return y - ys;
- }
- return -1;
-}
-
-static inline long
-rb_memsearch_qchar(const unsigned char *xs, long m, const unsigned char *ys, long n)
-{
- const unsigned char *x = xs, x0 = *xs, *y = ys;
- enum {char_size = 4};
-
- for (n -= m; n >= 0; n -= char_size, y += char_size) {
- if (x0 == *y && memcmp(x+1, y+1, m-1) == 0)
- return y - ys;
- }
- return -1;
-}
-
long
rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
{
@@ -260,21 +243,15 @@ rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
else
return -1;
}
- else if (LIKELY(rb_enc_mbminlen(enc) == 1)) {
- if (m <= SIZEOF_VALUE) {
- return rb_memsearch_ss(x0, m, y0, n);
- }
- else if (enc == rb_utf8_encoding()){
- return rb_memsearch_qs_utf8(x0, m, y0, n);
- }
+ else if (m <= SIZEOF_VALUE) {
+ return rb_memsearch_ss(x0, m, y0, n);
}
- else if (LIKELY(rb_enc_mbminlen(enc) == 2)) {
- return rb_memsearch_wchar(x0, m, y0, n);
+ else if (enc == rb_utf8_encoding()){
+ return rb_memsearch_qs_utf8(x0, m, y0, n);
}
- else if (LIKELY(rb_enc_mbminlen(enc) == 4)) {
- return rb_memsearch_qchar(x0, m, y0, n);
+ else {
+ return rb_memsearch_qs(x0, m, y0, n);
}
- return rb_memsearch_qs(x0, m, y0, n);
}
#define REG_LITERAL FL_USER5
@@ -349,7 +326,7 @@ rb_char_to_option_kcode(int c, int *option, int *kcode)
static void
rb_reg_check(VALUE re)
{
- if (!RREGEXP_PTR(re) || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
+ if (!RREGEXP(re)->ptr || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
rb_raise(rb_eTypeError, "uninitialized Regexp");
}
}
@@ -365,7 +342,8 @@ rb_reg_expr_str(VALUE str, const char *s, long len,
p = s; pend = p + len;
rb_str_coderange_scan_restartable(p, pend, enc, &cr);
- if (rb_enc_asciicompat(enc) && ENC_CODERANGE_CLEAN_P(cr)) {
+ if (rb_enc_asciicompat(enc) &&
+ (cr == ENC_CODERANGE_VALID || cr == ENC_CODERANGE_7BIT)) {
while (p < pend) {
c = rb_enc_ascget(p, pend, &clen, enc);
if (c == -1) {
@@ -462,7 +440,7 @@ rb_reg_desc(const char *s, long len, VALUE re)
if (re) {
char opts[4];
rb_reg_check(re);
- if (*option_to_str(opts, RREGEXP_PTR(re)->options))
+ if (*option_to_str(opts, RREGEXP(re)->ptr->options))
rb_str_buf_cat2(str, opts);
if (RBASIC(re)->flags & REG_ENCODING_NONE)
rb_str_buf_cat2(str, "n");
@@ -492,7 +470,7 @@ rb_reg_source(VALUE re)
VALUE str;
rb_reg_check(re);
- str = rb_str_dup(RREGEXP_SRC(re));
+ str = rb_enc_str_new(RREGEXP_SRC_PTR(re),RREGEXP_SRC_LEN(re), rb_enc_get(re));
if (OBJ_TAINTED(re)) OBJ_TAINT(str);
return str;
}
@@ -512,7 +490,7 @@ rb_reg_source(VALUE re)
static VALUE
rb_reg_inspect(VALUE re)
{
- if (!RREGEXP_PTR(re) || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
+ if (!RREGEXP(re)->ptr || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
return rb_any_to_s(re);
}
return rb_reg_desc(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), re);
@@ -553,7 +531,7 @@ rb_reg_to_s(VALUE re)
rb_reg_check(re);
rb_enc_copy(str, re);
- options = RREGEXP_PTR(re)->options;
+ options = RREGEXP(re)->ptr->options;
ptr = (UChar*)RREGEXP_SRC_PTR(re);
len = RREGEXP_SRC_LEN(re);
again:
@@ -598,13 +576,13 @@ rb_reg_to_s(VALUE re)
++ptr;
len -= 2;
- err = onig_new(&rp, ptr, ptr + len, options,
+ err = onig_new(&rp, ptr, ptr + len, ONIG_OPTION_DEFAULT,
enc, OnigDefaultSyntax, NULL);
onig_free(rp);
ruby_verbose = verbose;
}
if (err) {
- options = RREGEXP_PTR(re)->options;
+ options = RREGEXP(re)->ptr->options;
ptr = (UChar*)RREGEXP_SRC_PTR(re);
len = RREGEXP_SRC_LEN(re);
}
@@ -709,14 +687,14 @@ static VALUE
rb_reg_casefold_p(VALUE re)
{
rb_reg_check(re);
- if (RREGEXP_PTR(re)->options & ONIG_OPTION_IGNORECASE) return Qtrue;
+ if (RREGEXP(re)->ptr->options & ONIG_OPTION_IGNORECASE) return Qtrue;
return Qfalse;
}
/*
* call-seq:
- * rxp.options -> integer
+ * rxp.options -> fixnum
*
* Returns the set of bits corresponding to the options used when creating this
* Regexp (see <code>Regexp::new</code> for details. Note that additional bits
@@ -749,7 +727,7 @@ reg_names_iter(const OnigUChar *name, const OnigUChar *name_end,
int back_num, int *back_refs, OnigRegex regex, void *arg)
{
VALUE ary = (VALUE)arg;
- rb_ary_push(ary, rb_enc_str_new((const char *)name, name_end-name, regex->enc));
+ rb_ary_push(ary, rb_str_new((const char *)name, name_end-name));
return 0;
}
@@ -772,10 +750,9 @@ reg_names_iter(const OnigUChar *name, const OnigUChar *name_end,
static VALUE
rb_reg_names(VALUE re)
{
- VALUE ary;
+ VALUE ary = rb_ary_new();
rb_reg_check(re);
- ary = rb_ary_new_capa(onig_number_of_names(RREGEXP_PTR(re)));
- onig_foreach_name(RREGEXP_PTR(re), reg_names_iter, (void*)ary);
+ onig_foreach_name(RREGEXP(re)->ptr, reg_names_iter, (void*)ary);
return ary;
}
@@ -820,32 +797,32 @@ reg_named_captures_iter(const OnigUChar *name, const OnigUChar *name_end,
static VALUE
rb_reg_named_captures(VALUE re)
{
- regex_t *reg = (rb_reg_check(re), RREGEXP_PTR(re));
- VALUE hash = rb_hash_new_with_size(onig_number_of_names(reg));
- onig_foreach_name(reg, reg_named_captures_iter, (void*)hash);
+ VALUE hash = rb_hash_new();
+ rb_reg_check(re);
+ onig_foreach_name(RREGEXP(re)->ptr, reg_named_captures_iter, (void*)hash);
return hash;
}
static int
onig_new_with_source(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
- OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax,
- OnigErrorInfo* einfo, const char *sourcefile, int sourceline)
+ OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax,
+ OnigErrorInfo* einfo, const char *sourcefile, int sourceline)
{
- int r;
+ int r;
- *reg = (regex_t* )malloc(sizeof(regex_t));
- if (IS_NULL(*reg)) return ONIGERR_MEMORY;
+ *reg = (regex_t* )malloc(sizeof(regex_t));
+ if (IS_NULL(*reg)) return ONIGERR_MEMORY;
- r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
- if (r) goto err;
+ r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
+ if (r) goto err;
- r = onig_compile_ruby(*reg, pattern, pattern_end, einfo, sourcefile, sourceline);
- if (r) {
- err:
- onig_free(*reg);
- *reg = NULL;
- }
- return r;
+ r = onig_compile(*reg, pattern, pattern_end, einfo, sourcefile, sourceline);
+ if (r) {
+ err:
+ onig_free(*reg);
+ *reg = NULL;
+ }
+ return r;
}
static Regexp*
@@ -900,17 +877,6 @@ match_alloc(VALUE klass)
return (VALUE)match;
}
-int
-rb_reg_region_copy(struct re_registers *to, const struct re_registers *from)
-{
- onig_region_copy(to, (OnigRegion *)from);
- if (to->allocated) return 0;
- rb_gc();
- onig_region_copy(to, (OnigRegion *)from);
- if (to->allocated) return 0;
- return ONIGERR_MEMORY;
-}
-
typedef struct {
long byte_pos;
long char_pos;
@@ -1018,8 +984,7 @@ match_init_copy(VALUE obj, VALUE orig)
RMATCH(obj)->regexp = RMATCH(orig)->regexp;
rm = RMATCH(obj)->rmatch;
- if (rb_reg_region_copy(&rm->regs, RMATCH_REGS(orig)))
- rb_memerror();
+ onig_region_copy(&rm->regs, RMATCH_REGS(orig));
if (!RMATCH(orig)->rmatch->char_offset_updated) {
rm->char_offset_updated = 0;
@@ -1032,7 +997,6 @@ match_init_copy(VALUE obj, VALUE orig)
MEMCPY(rm->char_offset, RMATCH(orig)->rmatch->char_offset,
struct rmatch_offset, rm->regs.num_regs);
rm->char_offset_updated = 1;
- RB_GC_GUARD(orig);
}
return obj;
@@ -1081,8 +1045,6 @@ static VALUE
match_names(VALUE match)
{
match_check(match);
- if (NIL_P(RMATCH(match)->regexp))
- return rb_ary_new_capa(0);
return rb_reg_names(RMATCH(match)->regexp);
}
@@ -1105,8 +1067,6 @@ match_size(VALUE match)
return INT2FIX(RMATCH_REGS(match)->num_regs);
}
-static int name_to_backref_number(struct re_registers *, VALUE, const char*, const char*);
-
static int
match_backref_number(VALUE match, VALUE backref)
{
@@ -1117,15 +1077,23 @@ match_backref_number(VALUE match, VALUE backref)
VALUE regexp = RMATCH(match)->regexp;
match_check(match);
- if (SYMBOL_P(backref)) {
+ switch (TYPE(backref)) {
+ default:
+ return NUM2INT(backref);
+
+ case T_SYMBOL:
backref = rb_sym2str(backref);
+ /* fall through */
+
+ case T_STRING:
+ name = StringValueCStr(backref);
+ break;
}
- else if (!RB_TYPE_P(backref, T_STRING)) {
- return NUM2INT(backref);
- }
- name = StringValueCStr(backref);
- num = name_to_backref_number(regs, regexp, name, name + strlen(name));
+ num = onig_name_to_backref_number(RREGEXP(regexp)->ptr,
+ (const unsigned char*)name,
+ (const unsigned char*)name + strlen(name),
+ regs);
if (num < 1) {
rb_raise(rb_eIndexError, "undefined group name reference: %s", name);
@@ -1254,33 +1222,6 @@ rb_match_busy(VALUE match)
FL_SET(match, MATCH_BUSY);
}
-int
-rb_match_count(VALUE match)
-{
- struct re_registers *regs;
- if (NIL_P(match)) return -1;
- regs = RMATCH_REGS(match);
- if (!regs) return -1;
- return regs->num_regs;
-}
-
-int
-rb_match_nth_defined(int nth, VALUE match)
-{
- struct re_registers *regs;
- if (NIL_P(match)) return FALSE;
- regs = RMATCH_REGS(match);
- if (!regs) return FALSE;
- if (nth >= regs->num_regs) {
- return FALSE;
- }
- if (nth < 0) {
- nth += regs->num_regs;
- if (nth <= 0) return FALSE;
- }
- return (BEG(nth) != -1);
-}
-
static void
match_set_string(VALUE m, VALUE string, long pos, long len)
{
@@ -1325,14 +1266,14 @@ rb_backref_set_string(VALUE string, long pos, long len)
* r.fixed_encoding? #=> true
* r.encoding #=> #<Encoding:UTF-8>
* r =~ "\u{6666} a" #=> 2
- * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> Encoding::CompatibilityError
+ * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> ArgumentError
* r =~ "abc".force_encoding("euc-jp") #=> 0
*
* r = /\u{6666}/
* r.fixed_encoding? #=> true
* r.encoding #=> #<Encoding:UTF-8>
* r =~ "\u{6666} a" #=> 0
- * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> Encoding::CompatibilityError
+ * r =~ "\xa1\xa2".force_encoding("euc-jp") #=> ArgumentError
* r =~ "abc".force_encoding("euc-jp") #=> nil
*/
@@ -1359,23 +1300,12 @@ reg_enc_error(VALUE re, VALUE str)
rb_enc_name(rb_enc_get(str)));
}
-static inline int
-str_coderange(VALUE str)
-{
- int cr = ENC_CODERANGE(str);
- if (cr == ENC_CODERANGE_UNKNOWN) {
- cr = rb_enc_str_coderange(str);
- }
- return cr;
-}
-
static rb_encoding*
rb_reg_prepare_enc(VALUE re, VALUE str, int warn)
{
rb_encoding *enc = 0;
- int cr = str_coderange(str);
- if (cr == ENC_CODERANGE_BROKEN) {
+ if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
rb_raise(rb_eArgError,
"invalid byte sequence in %s",
rb_enc_name(rb_enc_get(str)));
@@ -1383,35 +1313,33 @@ rb_reg_prepare_enc(VALUE re, VALUE str, int warn)
rb_reg_check(re);
enc = rb_enc_get(str);
- if (RREGEXP_PTR(re)->enc == enc) {
- }
- else if (cr == ENC_CODERANGE_7BIT &&
- RREGEXP_PTR(re)->enc == rb_usascii_encoding()) {
- enc = RREGEXP_PTR(re)->enc;
- }
- else if (!rb_enc_asciicompat(enc)) {
- reg_enc_error(re, str);
+ if (!rb_enc_str_asciicompat_p(str)) {
+ if (RREGEXP(re)->ptr->enc != enc) {
+ reg_enc_error(re, str);
+ }
}
else if (rb_reg_fixed_encoding_p(re)) {
- if ((!rb_enc_asciicompat(RREGEXP_PTR(re)->enc) ||
- cr != ENC_CODERANGE_7BIT)) {
+ if (RREGEXP(re)->ptr->enc != enc &&
+ (!rb_enc_asciicompat(RREGEXP(re)->ptr->enc) ||
+ rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT)) {
reg_enc_error(re, str);
}
- enc = RREGEXP_PTR(re)->enc;
+ enc = RREGEXP(re)->ptr->enc;
}
- else if (warn && (RBASIC(re)->flags & REG_ENCODING_NONE) &&
+ if (warn && (RBASIC(re)->flags & REG_ENCODING_NONE) &&
enc != rb_ascii8bit_encoding() &&
- cr != ENC_CODERANGE_7BIT) {
- rb_warn("historical binary regexp match /.../n against %s string",
+ rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
+ rb_warn("regexp match /.../n against to %s string",
rb_enc_name(enc));
}
return enc;
}
regex_t *
-rb_reg_prepare_re0(VALUE re, VALUE str, onig_errmsg_buffer err)
+rb_reg_prepare_re(VALUE re, VALUE str)
{
- regex_t *reg = RREGEXP_PTR(re);
+ regex_t *reg = RREGEXP(re)->ptr;
+ onig_errmsg_buffer err = "";
int r;
OnigErrorInfo einfo;
const char *pattern;
@@ -1422,7 +1350,7 @@ rb_reg_prepare_re0(VALUE re, VALUE str, onig_errmsg_buffer err)
if (reg->enc == enc) return reg;
rb_reg_check(re);
- reg = RREGEXP_PTR(re);
+ reg = RREGEXP(re)->ptr;
pattern = RREGEXP_SRC_PTR(re);
unescaped = rb_reg_preprocess(
@@ -1446,13 +1374,6 @@ rb_reg_prepare_re0(VALUE re, VALUE str, onig_errmsg_buffer err)
return reg;
}
-regex_t *
-rb_reg_prepare_re(VALUE re, VALUE str)
-{
- onig_errmsg_buffer err = "";
- return rb_reg_prepare_re0(re, str, err);
-}
-
long
rb_reg_adjust_startpos(VALUE re, VALUE str, long pos, int reverse)
{
@@ -1494,15 +1415,14 @@ rb_reg_search0(VALUE re, VALUE str, long pos, int reverse, int set_backref_str)
char *range = RSTRING_PTR(str);
regex_t *reg;
int tmpreg;
- onig_errmsg_buffer err = "";
if (pos > RSTRING_LEN(str) || pos < 0) {
rb_backref_set(Qnil);
return -1;
}
- reg = rb_reg_prepare_re0(re, str, err);
- tmpreg = reg != RREGEXP_PTR(re);
+ reg = rb_reg_prepare_re(re, str);
+ tmpreg = reg != RREGEXP(re)->ptr;
if (!tmpreg) RREGEXP(re)->usecnt++;
match = rb_backref_get();
@@ -1532,8 +1452,8 @@ rb_reg_search0(VALUE re, VALUE str, long pos, int reverse, int set_backref_str)
onig_free(reg);
}
else {
- onig_free(RREGEXP_PTR(re));
- RREGEXP_PTR(re) = reg;
+ onig_free(RREGEXP(re)->ptr);
+ RREGEXP(re)->ptr = reg;
}
}
if (result < 0) {
@@ -1544,20 +1464,22 @@ rb_reg_search0(VALUE re, VALUE str, long pos, int reverse, int set_backref_str)
return result;
}
else {
+ onig_errmsg_buffer err = "";
onig_error_code_to_str((UChar*)err, (int)result);
rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, re);
}
}
if (NIL_P(match)) {
- int err;
match = match_alloc(rb_cMatch);
- err = rb_reg_region_copy(RMATCH_REGS(match), regs);
+ onig_region_copy(RMATCH_REGS(match), regs);
onig_region_free(regs, 0);
- if (err) rb_memerror();
}
else {
- FL_UNSET(match, FL_TAINT);
+ if (rb_safe_level() >= 3)
+ OBJ_TAINT(match);
+ else
+ FL_UNSET(match, FL_TAINT);
}
if (set_backref_str) {
@@ -1580,83 +1502,6 @@ rb_reg_search(VALUE re, VALUE str, long pos, int reverse)
return rb_reg_search0(re, str, pos, reverse, 1);
}
-bool
-rb_reg_start_with_p(VALUE re, VALUE str)
-{
- long result;
- VALUE match;
- struct re_registers regi, *regs = &regi;
- regex_t *reg;
- int tmpreg;
- onig_errmsg_buffer err = "";
-
- reg = rb_reg_prepare_re0(re, str, err);
- tmpreg = reg != RREGEXP_PTR(re);
- if (!tmpreg) RREGEXP(re)->usecnt++;
-
- match = rb_backref_get();
- if (!NIL_P(match)) {
- if (FL_TEST(match, MATCH_BUSY)) {
- match = Qnil;
- }
- else {
- regs = RMATCH_REGS(match);
- }
- }
- if (NIL_P(match)) {
- MEMZERO(regs, struct re_registers, 1);
- }
- result = onig_match(reg,
- (UChar*)(RSTRING_PTR(str)),
- ((UChar*)(RSTRING_PTR(str)) + RSTRING_LEN(str)),
- (UChar*)(RSTRING_PTR(str)),
- regs, ONIG_OPTION_NONE);
- if (!tmpreg) RREGEXP(re)->usecnt--;
- if (tmpreg) {
- if (RREGEXP(re)->usecnt) {
- onig_free(reg);
- }
- else {
- onig_free(RREGEXP_PTR(re));
- RREGEXP_PTR(re) = reg;
- }
- }
- if (result < 0) {
- if (regs == &regi)
- onig_region_free(regs, 0);
- if (result == ONIG_MISMATCH) {
- rb_backref_set(Qnil);
- return false;
- }
- else {
- onig_error_code_to_str((UChar*)err, (int)result);
- rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, re);
- }
- }
-
- if (NIL_P(match)) {
- int err;
- match = match_alloc(rb_cMatch);
- err = rb_reg_region_copy(RMATCH_REGS(match), regs);
- onig_region_free(regs, 0);
- if (err) rb_memerror();
- }
- else {
- FL_UNSET(match, FL_TAINT);
- }
-
- RMATCH(match)->str = rb_str_new4(str);
- OBJ_INFECT(match, str);
-
- RMATCH(match)->regexp = re;
- RMATCH(match)->rmatch->char_offset_updated = 0;
- rb_backref_set(match);
-
- OBJ_INFECT(match, re);
-
- return true;
-}
-
VALUE
rb_reg_nth_defined(int nth, VALUE match)
{
@@ -1833,6 +1678,10 @@ match_array(VALUE match, int start)
}
+/* [MG]:FIXME: I put parens around the /.../.match() in the first line of the
+ second example to prevent the '*' followed by a '/' from ending the
+ comment. */
+
/*
* call-seq:
* mtch.to_a -> anArray
@@ -1848,7 +1697,7 @@ match_array(VALUE match, int start)
* accessing the fields directly (as an intermediate array is
* generated).
*
- * all,f1,f2,f3 = * /(.)(.)(\d+)(\d)/.match("THX1138.")
+ * all,f1,f2,f3 = *(/(.)(.)(\d+)(\d)/.match("THX1138."))
* all #=> "HX1138"
* f1 #=> "H"
* f2 #=> "X"
@@ -1883,8 +1732,8 @@ match_captures(VALUE match)
static int
name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name, const char* name_end)
{
- return onig_name_to_backref_number(RREGEXP_PTR(regexp),
- (const unsigned char *)name, (const unsigned char *)name_end, regs);
+ return onig_name_to_backref_number(RREGEXP(regexp)->ptr,
+ (const unsigned char* )name, (const unsigned char* )name_end, regs);
}
NORETURN(static void name_to_backref_error(VALUE name));
@@ -1895,66 +1744,6 @@ name_to_backref_error(VALUE name)
name);
}
-#define NAME_TO_NUMBER(regs, re, name, name_ptr, name_end) \
- (NIL_P(re) ? 0 : \
- !rb_enc_compatible(RREGEXP_SRC(re), (name)) ? 0 : \
- name_to_backref_number((regs), (re), (name_ptr), (name_end)))
-
-static int
-namev_to_backref_number(struct re_registers *regs, VALUE re, VALUE name)
-{
- int num;
-
- if (SYMBOL_P(name)) {
- name = rb_sym2str(name);
- }
- else if (!RB_TYPE_P(name, T_STRING)) {
- return -1;
- }
- num = NAME_TO_NUMBER(regs, re, name,
- RSTRING_PTR(name), RSTRING_END(name));
- if (num < 1) {
- name_to_backref_error(name);
- }
- return num;
-}
-
-static VALUE
-match_ary_subseq(VALUE match, long beg, long len, VALUE result)
-{
- long olen = RMATCH_REGS(match)->num_regs;
- long j, end = olen < beg+len ? olen : beg+len;
- if (NIL_P(result)) result = rb_ary_new_capa(len);
- if (len == 0) return result;
-
- for (j = beg; j < end; j++) {
- rb_ary_push(result, rb_reg_nth_match((int)j, match));
- }
- if (beg + len > j) {
- rb_ary_resize(result, RARRAY_LEN(result) + (beg + len) - j);
- }
- return result;
-}
-
-static VALUE
-match_ary_aref(VALUE match, VALUE idx, VALUE result)
-{
- long beg, len;
- int num_regs = RMATCH_REGS(match)->num_regs;
-
- /* check if idx is Range */
- switch (rb_range_beg_len(idx, &beg, &len, (long)num_regs, !NIL_P(result))) {
- case Qfalse:
- if (NIL_P(result)) return rb_reg_nth_match(NUM2INT(idx), match);
- rb_ary_push(result, rb_reg_nth_match(NUM2INT(idx), match));
- return result;
- case Qnil:
- return Qnil;
- default:
- return match_ary_subseq(match, beg, len, result);
- }
-}
-
/*
* call-seq:
* mtch[i] -> str or nil
@@ -1985,46 +1774,51 @@ match_ary_aref(VALUE match, VALUE idx, VALUE result)
static VALUE
match_aref(int argc, VALUE *argv, VALUE match)
{
- VALUE idx, length;
+ VALUE idx, rest;
match_check(match);
- rb_scan_args(argc, argv, "11", &idx, &length);
+ rb_scan_args(argc, argv, "11", &idx, &rest);
- if (NIL_P(length)) {
+ if (NIL_P(rest)) {
if (FIXNUM_P(idx)) {
- return rb_reg_nth_match(FIX2INT(idx), match);
+ if (FIX2INT(idx) >= 0) {
+ return rb_reg_nth_match(FIX2INT(idx), match);
+ }
}
else {
- int num = namev_to_backref_number(RMATCH_REGS(match), RMATCH(match)->regexp, idx);
- if (num >= 0) {
+ const char *p;
+ int num;
+
+ switch (TYPE(idx)) {
+ case T_SYMBOL:
+ idx = rb_sym2str(idx);
+ /* fall through */
+ case T_STRING:
+ p = StringValuePtr(idx);
+ if (!rb_enc_compatible(RREGEXP(RMATCH(match)->regexp)->src, idx) ||
+ (num = name_to_backref_number(RMATCH_REGS(match), RMATCH(match)->regexp,
+ p, p + RSTRING_LEN(idx))) < 1) {
+ name_to_backref_error(idx);
+ }
return rb_reg_nth_match(num, match);
+
+ default:
+ break;
}
- else {
- return match_ary_aref(match, idx, Qnil);
- }
- }
- }
- else {
- long beg = NUM2LONG(idx);
- long len = NUM2LONG(length);
- long num_regs = RMATCH_REGS(match)->num_regs;
- if (len < 0) {
- return Qnil;
- }
- if (beg < 0) {
- beg += num_regs;
- if (beg < 0) return Qnil;
- }
- else if (beg > num_regs) {
- return Qnil;
- }
- else if (beg+len > num_regs) {
- len = num_regs - beg;
}
- return match_ary_subseq(match, beg, len, Qnil);
}
+
+ return rb_ary_aref(argc, argv, match_to_a(match));
+}
+
+static VALUE
+match_entry(VALUE match, long n)
+{
+ /* n should not exceed num_regs */
+ return rb_reg_nth_match((int)n, match);
}
+
/*
* call-seq:
*
@@ -2036,36 +1830,16 @@ match_aref(int argc, VALUE *argv, VALUE match)
* m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
* m.to_a #=> ["HX1138", "H", "X", "113", "8"]
* m.values_at(0, 2, -2) #=> ["HX1138", "X", "113"]
- *
- * m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
- * m.to_a #=> ["1 + 2", "1", "+", "2"]
- * m.values_at(:a, :b, :op) #=> ["1", "2", "+"]
*/
static VALUE
match_values_at(int argc, VALUE *argv, VALUE match)
{
- VALUE result;
- int i;
+ struct re_registers *regs;
match_check(match);
- result = rb_ary_new2(argc);
-
- for (i=0; i<argc; i++) {
- if (FIXNUM_P(argv[i])) {
- rb_ary_push(result, rb_reg_nth_match(FIX2INT(argv[i]), match));
- }
- else {
- int num = namev_to_backref_number(RMATCH_REGS(match), RMATCH(match)->regexp, argv[i]);
- if (num >= 0) {
- rb_ary_push(result, rb_reg_nth_match(num, match));
- }
- else {
- match_ary_aref(match, argv[i], result);
- }
- }
- }
- return result;
+ regs = RMATCH_REGS(match);
+ return rb_get_values_at(match, regs->num_regs, argc, argv, match_entry);
}
@@ -2091,74 +1865,6 @@ match_to_s(VALUE match)
return str;
}
-static int
-match_named_captures_iter(const OnigUChar *name, const OnigUChar *name_end,
- int back_num, int *back_refs, OnigRegex regex, void *arg) {
- struct MEMO *memo = MEMO_CAST(arg);
- VALUE hash = memo->v1;
- VALUE match = memo->v2;
-
- VALUE key = rb_enc_str_new((const char *)name, name_end-name, regex->enc);
- VALUE value;
-
- int i;
- int found = 0;
-
- for (i = 0; i < back_num; i++) {
- value = rb_reg_nth_match(back_refs[i], match);
- if (RTEST(value)) {
- rb_hash_aset(hash, key, value);
- found = 1;
- }
- }
-
- if (found == 0) {
- rb_hash_aset(hash, key, Qnil);
- }
-
- return 0;
-}
-
-/*
- * call-seq:
- * mtch.named_captures -> hash
- *
- * Returns a Hash using named capture.
- *
- * A key of the hash is a name of the named captures.
- * A value of the hash is a string of last successful capture of corresponding
- * group.
- *
- * m = /(?<a>.)(?<b>.)/.match("01")
- * m.named_captures #=> {"a" => "0", "b" => "1"}
- *
- * m = /(?<a>.)(?<b>.)?/.match("0")
- * m.named_captures #=> {"a" => "0", "b" => nil}
- *
- * m = /(?<a>.)(?<a>.)/.match("01")
- * m.named_captures #=> {"a" => "1"}
- *
- * m = /(?<a>x)|(?<a>y)/.match("x")
- * m.named_captures #=> {"a" => "x"}
- */
-
-static VALUE
-match_named_captures(VALUE match)
-{
- VALUE hash;
- struct MEMO *memo;
-
- match_check(match);
- if (NIL_P(RMATCH(match)->regexp))
- return rb_hash_new();
-
- hash = rb_hash_new();
- memo = MEMO_NEW(hash, match, 0);
-
- onig_foreach_name(RREGEXP(RMATCH(match)->regexp)->ptr, match_named_captures_iter, (void*)memo);
-
- return hash;
-}
/*
* call-seq:
@@ -2238,7 +1944,7 @@ match_inspect(VALUE match)
names = ALLOCA_N(struct backref_name_tag, num_regs);
MEMZERO(names, struct backref_name_tag, num_regs);
- onig_foreach_name(RREGEXP_PTR(regexp),
+ onig_foreach_name(RREGEXP(regexp)->ptr,
match_inspect_name_iter, names);
str = rb_str_buf_new2("#<");
@@ -2561,8 +2267,8 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc,
case '1': case '2': case '3':
case '4': case '5': case '6': case '7': /* \O, \OO, \OOO or backref */
{
- size_t len = end-(p-1), octlen;
- if (ruby_scan_oct(p-1, len < 3 ? len : 3, &octlen) <= 0177) {
+ size_t octlen;
+ if (ruby_scan_oct(p-1, end-(p-1), &octlen) <= 0177) {
/* backref or 7bit octal.
no need to unescape anyway.
re-escaping may break backref */
@@ -2578,16 +2284,8 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc,
case 'C': /* \C-X, \C-\M-X */
case 'M': /* \M-X, \M-\C-X, \M-\cX */
p = p-2;
- if (enc == rb_usascii_encoding()) {
- const char *pbeg = p;
- c = read_escaped_byte(&p, end, err);
- if (c == (char)-1) return -1;
- rb_str_buf_cat(buf, pbeg, p-pbeg);
- }
- else {
- if (unescape_escaped_nonascii(&p, end, enc, buf, encp, err) != 0)
- return -1;
- }
+ if (unescape_escaped_nonascii(&p, end, enc, buf, encp, err) != 0)
+ return -1;
break;
case 'u':
@@ -2714,7 +2412,7 @@ rb_reg_preprocess_dregexp(VALUE ary, int options)
src_enc = rb_enc_get(str);
if (options & ARG_ENCODING_NONE &&
src_enc != ascii8bit) {
- if (str_coderange(str) != ENC_CODERANGE_7BIT)
+ if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT)
rb_raise(rb_eRegexpError, "/.../n has a non escaped non ASCII character in non ASCII-8BIT script");
else
src_enc = ascii8bit;
@@ -2802,30 +2500,21 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
options & ARG_REG_OPTION_MASK, err,
sourcefile, sourceline);
if (!re->ptr) return -1;
+ RB_OBJ_WRITE(obj, &re->src, rb_fstring(rb_enc_str_new(s, len, enc)));
RB_GC_GUARD(unescaped);
return 0;
}
-static void
-reg_set_source(VALUE reg, VALUE str, rb_encoding *enc)
-{
- rb_encoding *regenc = rb_enc_get(reg);
- if (regenc != enc) {
- str = rb_enc_associate(rb_str_dup(str), enc = regenc);
- }
- RB_OBJ_WRITE(reg, &RREGEXP(reg)->src, rb_fstring(str));
-}
-
static int
rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err,
const char *sourcefile, int sourceline)
{
int ret;
- rb_encoding *str_enc = rb_enc_get(str), *enc = str_enc;
+ rb_encoding *enc = rb_enc_get(str);
if (options & ARG_ENCODING_NONE) {
rb_encoding *ascii8bit = rb_ascii8bit_encoding();
if (enc != ascii8bit) {
- if (str_coderange(str) != ENC_CODERANGE_7BIT) {
+ if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT) {
errcpy(err, "/.../n has a non escaped non ASCII character in non ASCII-8BIT script");
return -1;
}
@@ -2835,7 +2524,7 @@ rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err,
ret = rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), enc,
options, err, sourcefile, sourceline);
OBJ_INFECT(obj, str);
- if (ret == 0) reg_set_source(obj, str, str_enc);
+ RB_GC_GUARD(str);
return ret;
}
@@ -2875,20 +2564,6 @@ rb_reg_init_str(VALUE re, VALUE s, int options)
return re;
}
-static VALUE
-rb_reg_init_str_enc(VALUE re, VALUE s, rb_encoding *enc, int options)
-{
- onig_errmsg_buffer err = "";
-
- if (rb_reg_initialize(re, RSTRING_PTR(s), RSTRING_LEN(s),
- enc, options, err, NULL, 0) != 0) {
- rb_reg_raise_str(s, options, err);
- }
- reg_set_source(re, s, enc);
-
- return re;
-}
-
VALUE
rb_reg_new_ary(VALUE ary, int opt)
{
@@ -2904,7 +2579,6 @@ rb_enc_reg_new(const char *s, long len, rb_encoding *enc, int options)
if (rb_reg_initialize(re, s, len, enc, options, err, NULL, 0) != 0) {
rb_enc_reg_raise(s, len, enc, options, err);
}
- RB_OBJ_WRITE(re, &RREGEXP(re)->src, rb_fstring(rb_enc_str_new(s, len, enc)));
return re;
}
@@ -2946,7 +2620,7 @@ rb_reg_regcomp(VALUE str)
static st_index_t reg_hash(VALUE re);
/*
* call-seq:
- * rxp.hash -> integer
+ * rxp.hash -> fixnum
*
* Produce a hash based on the text and options of this regular expression.
*
@@ -2957,7 +2631,7 @@ static VALUE
rb_reg_hash(VALUE re)
{
st_index_t hashval = reg_hash(re);
- return ST2FIX(hashval);
+ return LONG2FIX(hashval);
}
static st_index_t
@@ -2966,7 +2640,7 @@ reg_hash(VALUE re)
st_index_t hashval;
rb_reg_check(re);
- hashval = RREGEXP_PTR(re)->options;
+ hashval = RREGEXP(re)->ptr->options;
hashval = rb_hash_uint(hashval, rb_memhash(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re)));
return rb_hash_end(hashval);
}
@@ -2994,7 +2668,7 @@ rb_reg_equal(VALUE re1, VALUE re2)
if (!RB_TYPE_P(re2, T_REGEXP)) return Qfalse;
rb_reg_check(re1); rb_reg_check(re2);
if (FL_TEST(re1, KCODE_FIXED) != FL_TEST(re2, KCODE_FIXED)) return Qfalse;
- if (RREGEXP_PTR(re1)->options != RREGEXP_PTR(re2)->options) return Qfalse;
+ if (RREGEXP(re1)->ptr->options != RREGEXP(re2)->ptr->options) return Qfalse;
if (RREGEXP_SRC_LEN(re1) != RREGEXP_SRC_LEN(re2)) return Qfalse;
if (ENCODING_GET(re1) != ENCODING_GET(re2)) return Qfalse;
if (memcmp(RREGEXP_SRC_PTR(re1), RREGEXP_SRC_PTR(re2), RREGEXP_SRC_LEN(re1)) == 0) {
@@ -3017,17 +2691,15 @@ static VALUE
match_hash(VALUE match)
{
const struct re_registers *regs;
- st_index_t hashval;
+ st_index_t hashval = rb_hash_start(rb_str_hash(RMATCH(match)->str));
- match_check(match);
- hashval = rb_hash_start(rb_str_hash(RMATCH(match)->str));
- hashval = rb_hash_uint(hashval, reg_hash(match_regexp(match)));
+ rb_hash_uint(hashval, reg_hash(RMATCH(match)->regexp));
regs = RMATCH_REGS(match);
hashval = rb_hash_uint(hashval, regs->num_regs);
hashval = rb_hash_uint(hashval, rb_memhash(regs->beg, regs->num_regs * sizeof(*regs->beg)));
hashval = rb_hash_uint(hashval, rb_memhash(regs->end, regs->num_regs * sizeof(*regs->end)));
hashval = rb_hash_end(hashval);
- return ST2FIX(hashval);
+ return LONG2FIX(hashval);
}
/*
@@ -3043,12 +2715,10 @@ static VALUE
match_equal(VALUE match1, VALUE match2)
{
const struct re_registers *regs1, *regs2;
-
if (match1 == match2) return Qtrue;
if (!RB_TYPE_P(match2, T_MATCH)) return Qfalse;
- if (!RMATCH(match1)->regexp || !RMATCH(match2)->regexp) return Qfalse;
if (!rb_str_equal(RMATCH(match1)->str, RMATCH(match2)->str)) return Qfalse;
- if (!rb_reg_equal(match_regexp(match1), match_regexp(match2))) return Qfalse;
+ if (!rb_reg_equal(RMATCH(match1)->regexp, RMATCH(match2)->regexp)) return Qfalse;
regs1 = RMATCH_REGS(match1);
regs2 = RMATCH_REGS(match2);
if (regs1->num_regs != regs2->num_regs) return Qfalse;
@@ -3061,7 +2731,7 @@ static VALUE
reg_operand(VALUE s, int check)
{
if (SYMBOL_P(s)) {
- return rb_sym2str(s);
+ return rb_sym_to_s(s);
}
else {
return (check ? rb_str_to_str : rb_check_string_type)(s);
@@ -3156,9 +2826,9 @@ rb_reg_match(VALUE re, VALUE str)
*
* a = "HELLO"
* case a
- * when /\A[a-z]*\z/; print "Lower case\n"
- * when /\A[A-Z]*\z/; print "Upper case\n"
- * else; print "Mixed case\n"
+ * when /^[a-z]*$/; print "Lower case\n"
+ * when /^[A-Z]*$/; print "Upper case\n"
+ * else; print "Mixed case\n"
* end
* #=> "Upper case"
*
@@ -3235,16 +2905,12 @@ rb_reg_match2(VALUE re)
* If a block is given, invoke the block with MatchData if match succeed, so
* that you can write
*
- * /M(.*)/.match("Matz") do |m|
- * puts m[0]
- * puts m[1]
- * end
+ * pat.match(str) {|m| ...}
*
* instead of
*
- * if m = /M(.*)/.match("Matz")
- * puts m[0]
- * puts m[1]
+ * if m = pat.match(str)
+ * ...
* end
*
* The return value is a value from block execution in this case.
@@ -3277,102 +2943,31 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
}
/*
- * call-seq:
- * rxp.match?(str) -> true or false
- * rxp.match?(str,pos) -> true or false
- *
- * Returns a <code>true</code> or <code>false</code> indicates whether the
- * regexp is matched or not without updating $~ and other related variables.
- * If the second parameter is present, it specifies the position in the string
- * to begin the search.
- *
- * /R.../.match?("Ruby") #=> true
- * /R.../.match?("Ruby", 1) #=> false
- * /P.../.match?("Ruby") #=> false
- * $& #=> nil
- */
-
-static VALUE
-rb_reg_match_m_p(int argc, VALUE *argv, VALUE re)
-{
- long pos = rb_check_arity(argc, 1, 2) > 1 ? NUM2LONG(argv[1]) : 0;
- return rb_reg_match_p(re, argv[0], pos);
-}
-
-VALUE
-rb_reg_match_p(VALUE re, VALUE str, long pos)
-{
- regex_t *reg;
- onig_errmsg_buffer err = "";
- OnigPosition result;
- const UChar *start, *end;
- int tmpreg;
-
- if (NIL_P(str)) return Qfalse;
- str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
- if (pos) {
- if (pos < 0) {
- pos += NUM2LONG(rb_str_length(str));
- if (pos < 0) return Qfalse;
- }
- if (pos > 0) {
- long len = 1;
- const char *beg = rb_str_subpos(str, pos, &len);
- if (!beg) return Qfalse;
- pos = beg - RSTRING_PTR(str);
- }
- }
- reg = rb_reg_prepare_re0(re, str, err);
- tmpreg = reg != RREGEXP_PTR(re);
- if (!tmpreg) RREGEXP(re)->usecnt++;
- start = ((UChar*)RSTRING_PTR(str));
- end = start + RSTRING_LEN(str);
- result = onig_search(reg, start, end, start + pos, end,
- NULL, ONIG_OPTION_NONE);
- if (!tmpreg) RREGEXP(re)->usecnt--;
- if (tmpreg) {
- if (RREGEXP(re)->usecnt) {
- onig_free(reg);
- }
- else {
- onig_free(RREGEXP_PTR(re));
- RREGEXP_PTR(re) = reg;
- }
- }
- if (result < 0) {
- if (result == ONIG_MISMATCH) {
- return Qfalse;
- }
- else {
- onig_error_code_to_str((UChar*)err, (int)result);
- rb_reg_raise(RREGEXP_SRC_PTR(re), RREGEXP_SRC_LEN(re), err, re);
- }
- }
- return Qtrue;
-}
-
-/*
* Document-method: compile
*
- * Alias for <code>Regexp.new</code>
+ * Synonym for <code>Regexp.new</code>
*/
+
/*
* call-seq:
- * Regexp.new(string, [options]) -> regexp
- * Regexp.new(regexp) -> regexp
- * Regexp.compile(string, [options]) -> regexp
- * Regexp.compile(regexp) -> regexp
+ * Regexp.new(string, [options [, kcode]]) -> regexp
+ * Regexp.new(regexp) -> regexp
+ * Regexp.compile(string, [options [, kcode]]) -> regexp
+ * Regexp.compile(regexp) -> regexp
*
* Constructs a new regular expression from +pattern+, which can be either a
* String or a Regexp (in which case that regexp's options are propagated),
* and new options may not be specified (a change as of Ruby 1.8).
*
- * If +options+ is an Integer, it should be one or more of the constants
+ * If +options+ is a Fixnum, it should be one or more of the constants
* Regexp::EXTENDED, Regexp::IGNORECASE, and Regexp::MULTILINE,
* <em>or</em>-ed together. Otherwise, if +options+ is not
* +nil+ or +false+, the regexp will be case insensitive.
*
+ * When the +kcode+ parameter is `n' or `N' sets the regexp no encoding.
+ * It means that the regexp is for binary strings.
+ *
* r1 = Regexp.new('^a-z+:\\s+\w+') #=> /^a-z+:\s+\w+/
* r2 = Regexp.new('cat', true) #=> /cat/i
* r3 = Regexp.new(r2) #=> /cat/i
@@ -3382,9 +2977,12 @@ rb_reg_match_p(VALUE re, VALUE str, long pos)
static VALUE
rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
{
+ onig_errmsg_buffer err = "";
int flags = 0;
VALUE str;
- rb_encoding *enc = 0;
+ rb_encoding *enc;
+ const char *ptr;
+ long len;
rb_check_arity(argc, 1, 3);
if (RB_TYPE_P(argv[0], T_REGEXP)) {
@@ -3395,13 +2993,20 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
}
rb_reg_check(re);
flags = rb_reg_options(re);
- str = RREGEXP_SRC(re);
+ ptr = RREGEXP_SRC_PTR(re);
+ len = RREGEXP_SRC_LEN(re);
+ enc = rb_enc_get(re);
+ if (rb_reg_initialize(self, ptr, len, enc, flags, err, NULL, 0)) {
+ str = rb_enc_str_new(ptr, len, enc);
+ rb_reg_raise_str(str, flags, err);
+ }
}
else {
if (argc >= 2) {
if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]);
else if (RTEST(argv[1])) flags = ONIG_OPTION_IGNORECASE;
}
+ enc = 0;
if (argc == 3 && !NIL_P(argv[2])) {
char *kcode = StringValuePtr(argv[2]);
if (kcode[0] == 'n' || kcode[0] == 'N') {
@@ -3412,12 +3017,14 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
rb_warn("encoding option is ignored - %s", kcode);
}
}
- str = StringValue(argv[0]);
+ str = argv[0];
+ ptr = StringValuePtr(str);
+ if (enc
+ ? rb_reg_initialize(self, ptr, RSTRING_LEN(str), enc, flags, err, NULL, 0)
+ : rb_reg_initialize_str(self, str, flags, err, NULL, 0)) {
+ rb_reg_raise_str(str, flags, err);
+ }
}
- if (enc && rb_enc_get(str) != enc)
- rb_reg_init_str_enc(self, str, enc, flags);
- else
- rb_reg_init_str(self, str, flags);
return self;
}
@@ -3545,7 +3152,7 @@ rb_reg_options(VALUE re)
int options;
rb_reg_check(re);
- options = RREGEXP_PTR(re)->options & ARG_REG_OPTION_MASK;
+ options = RREGEXP(re)->ptr->options & ARG_REG_OPTION_MASK;
if (RBASIC(re)->flags & KCODE_FIXED) options |= ARG_ENCODING_FIXED;
if (RBASIC(re)->flags & REG_ENCODING_NONE) options |= ARG_ENCODING_NONE;
return options;
@@ -3643,7 +3250,7 @@ rb_reg_s_union(VALUE self, VALUE args0)
rb_encoding *enc;
StringValue(e);
enc = rb_enc_get(e);
- if (!rb_enc_asciicompat(enc)) {
+ if (!rb_enc_str_asciicompat_p(e)) {
if (!has_ascii_incompat)
has_ascii_incompat = enc;
else if (has_ascii_incompat != enc)
@@ -3730,9 +3337,19 @@ rb_reg_s_union_m(VALUE self, VALUE args)
static VALUE
rb_reg_init_copy(VALUE copy, VALUE re)
{
+ onig_errmsg_buffer err = "";
+ const char *s;
+ long len;
+
if (!OBJ_INIT_COPY(copy, re)) return copy;
rb_reg_check(re);
- return rb_reg_init_str(copy, RREGEXP_SRC(re), rb_reg_options(re));
+ s = RREGEXP_SRC_PTR(re);
+ len = RREGEXP_SRC_LEN(re);
+ if (rb_reg_initialize(copy, s, len, rb_enc_get(re), rb_reg_options(re),
+ err, NULL, 0) != 0) {
+ rb_reg_raise(s, len, err, re);
+ }
+ return copy;
}
VALUE
@@ -3780,7 +3397,7 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
switch (c) {
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (!NIL_P(regexp) && onig_noname_group_capture_is_active(RREGEXP_PTR(regexp))) {
+ if (!NIL_P(regexp) && onig_noname_group_capture_is_active(RREGEXP(regexp)->ptr)) {
no = c - '0';
}
else {
@@ -3801,7 +3418,8 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
if (name_end < e) {
VALUE n = rb_str_subseq(str, (long)(name - RSTRING_PTR(str)),
(long)(name_end - name));
- if ((no = NAME_TO_NUMBER(regs, regexp, n, name, name_end)) < 1) {
+ if (!rb_enc_compatible(RREGEXP(regexp)->src, n) ||
+ (no = name_to_backref_number(regs, regexp, name, name_end)) < 1) {
name_to_backref_error(n);
}
p = s = name_end + clen;
@@ -3980,6 +3598,7 @@ Init_Regexp(void)
{
rb_eRegexpError = rb_define_class("RegexpError", rb_eStandardError);
+ onigenc_set_default_caseconv_table((UChar*)casetable);
onigenc_set_default_encoding(ONIG_ENCODING_ASCII);
onig_set_warn_func(re_warn);
onig_set_verb_warn_func(re_warn);
@@ -4012,7 +3631,6 @@ Init_Regexp(void)
rb_define_method(rb_cRegexp, "===", rb_reg_eqq, 1);
rb_define_method(rb_cRegexp, "~", rb_reg_match2, 0);
rb_define_method(rb_cRegexp, "match", rb_reg_match_m, -1);
- rb_define_method(rb_cRegexp, "match?", rb_reg_match_m_p, -1);
rb_define_method(rb_cRegexp, "to_s", rb_reg_to_s, 0);
rb_define_method(rb_cRegexp, "inspect", rb_reg_inspect, 0);
rb_define_method(rb_cRegexp, "source", rb_reg_source, 0);
@@ -4051,7 +3669,6 @@ Init_Regexp(void)
rb_define_method(rb_cMatch, "to_a", match_to_a, 0);
rb_define_method(rb_cMatch, "[]", match_aref, -1);
rb_define_method(rb_cMatch, "captures", match_captures, 0);
- rb_define_method(rb_cMatch, "named_captures", match_named_captures, 0);
rb_define_method(rb_cMatch, "values_at", match_values_at, -1);
rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0);
rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0);
diff --git a/regcomp.c b/regcomp.c
index 59b1f40d46..c1698ea1dc 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2,8 +2,8 @@
regcomp.c - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne 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
@@ -30,6 +30,15 @@
#include "regparse.h"
+#if defined(USE_MULTI_THREAD_SYSTEM) \
+ && defined(USE_DEFAULT_MULTI_THREAD_SYSTEM)
+#ifdef _WIN32
+CRITICAL_SECTION gOnigMutex;
+#else
+pthread_mutex_t gOnigMutex;
+#endif
+#endif
+
OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN;
extern OnigCaseFoldType
@@ -126,6 +135,12 @@ bitset_is_empty(BitSetRef bs)
#ifdef ONIG_DEBUG
static int
+onig_is_prelude(void)
+{
+ return !rb_const_defined(rb_cThread, rb_intern_const("MUTEX_FOR_THREAD_EXCLUSIVE"));
+}
+
+static int
bitset_on_num(BitSetRef bs)
{
int i, n;
@@ -254,7 +269,6 @@ add_mem_num(regex_t* reg, int num)
return 0;
}
-#if 0
static int
add_pointer(regex_t* reg, void* addr)
{
@@ -263,7 +277,6 @@ add_pointer(regex_t* reg, void* addr)
BBUF_ADD(reg, &ptr, SIZE_POINTER);
return 0;
}
-#endif
static int
add_option(regex_t* reg, OnigOptionType option)
@@ -584,6 +597,11 @@ compile_length_cclass_node(CClassNode* cc, regex_t* reg)
{
int len;
+ if (IS_NCCLASS_SHARE(cc)) {
+ len = SIZE_OPCODE + SIZE_POINTER;
+ return len;
+ }
+
if (IS_NULL(cc->mbuf)) {
len = SIZE_OPCODE + SIZE_BITSET;
}
@@ -609,6 +627,12 @@ compile_cclass_node(CClassNode* cc, regex_t* reg)
{
int r;
+ if (IS_NCCLASS_SHARE(cc)) {
+ add_opcode(reg, OP_CCLASS_NODE);
+ r = add_pointer(reg, cc);
+ return r;
+ }
+
if (IS_NULL(cc->mbuf)) {
if (IS_NCCLASS_NOT(cc))
add_opcode(reg, OP_CCLASS_NOT);
@@ -620,17 +644,17 @@ compile_cclass_node(CClassNode* cc, regex_t* reg)
else {
if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) {
if (IS_NCCLASS_NOT(cc))
- add_opcode(reg, OP_CCLASS_MB_NOT);
+ add_opcode(reg, OP_CCLASS_MB_NOT);
else
- add_opcode(reg, OP_CCLASS_MB);
+ add_opcode(reg, OP_CCLASS_MB);
r = add_multi_byte_cclass(cc->mbuf, reg);
}
else {
if (IS_NCCLASS_NOT(cc))
- add_opcode(reg, OP_CCLASS_MIX_NOT);
+ add_opcode(reg, OP_CCLASS_MIX_NOT);
else
- add_opcode(reg, OP_CCLASS_MIX);
+ add_opcode(reg, OP_CCLASS_MIX);
r = add_bitset(reg, cc->bs);
if (r) return r;
@@ -742,9 +766,9 @@ compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
if (NTYPE(qn->target) == NT_CANY) {
if (qn->greedy && infinite) {
if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON)
- return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;
+ return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;
else
- return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;
+ return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;
}
}
@@ -971,9 +995,9 @@ compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
if (NTYPE(qn->target) == NT_CANY) {
if (qn->greedy && infinite) {
if (IS_NOT_NULL(qn->next_head_exact))
- return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower;
+ return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower;
else
- return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower;
+ return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower;
}
}
@@ -992,12 +1016,9 @@ compile_length_quantifier_node(QtfrNode* qn, regex_t* reg)
}
if (qn->greedy) {
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
if (IS_NOT_NULL(qn->head_exact))
len += SIZE_OP_PUSH_OR_JUMP_EXACT1 + mod_tlen + SIZE_OP_JUMP;
- else
-#endif
- if (IS_NOT_NULL(qn->next_head_exact))
+ else if (IS_NOT_NULL(qn->next_head_exact))
len += SIZE_OP_PUSH_IF_PEEK_NEXT + mod_tlen + SIZE_OP_JUMP;
else
len += SIZE_OP_PUSH + mod_tlen + SIZE_OP_JUMP;
@@ -1063,12 +1084,9 @@ compile_quantifier_node(QtfrNode* qn, regex_t* reg)
(qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {
if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) {
if (qn->greedy) {
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
if (IS_NOT_NULL(qn->head_exact))
r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_OR_JUMP_EXACT1);
- else
-#endif
- if (IS_NOT_NULL(qn->next_head_exact))
+ else if (IS_NOT_NULL(qn->next_head_exact))
r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_IF_PEEK_NEXT);
else
r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH);
@@ -1084,7 +1102,6 @@ compile_quantifier_node(QtfrNode* qn, regex_t* reg)
}
if (qn->greedy) {
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
if (IS_NOT_NULL(qn->head_exact)) {
r = add_opcode_rel_addr(reg, OP_PUSH_OR_JUMP_EXACT1,
mod_tlen + SIZE_OP_JUMP);
@@ -1095,9 +1112,7 @@ compile_quantifier_node(QtfrNode* qn, regex_t* reg)
r = add_opcode_rel_addr(reg, OP_JUMP,
-(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_OR_JUMP_EXACT1));
}
- else
-#endif
- if (IS_NOT_NULL(qn->next_head_exact)) {
+ else if (IS_NOT_NULL(qn->next_head_exact)) {
r = add_opcode_rel_addr(reg, OP_PUSH_IF_PEEK_NEXT,
mod_tlen + SIZE_OP_JUMP);
if (r) return r;
@@ -1234,11 +1249,6 @@ compile_length_enclose_node(EncloseNode* node, regex_t* reg)
len += (IS_ENCLOSE_RECURSION(node)
? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END);
}
- else if (IS_ENCLOSE_RECURSION(node)) {
- len = SIZE_OP_MEMORY_START_PUSH;
- len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)
- ? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_REC);
- }
else
#endif
{
@@ -1286,10 +1296,6 @@ compile_length_enclose_node(EncloseNode* node, regex_t* reg)
}
break;
- case ENCLOSE_ABSENT:
- len = SIZE_OP_PUSH_ABSENT_POS + SIZE_OP_ABSENT + tlen + SIZE_OP_ABSENT_END;
- break;
-
default:
return ONIGERR_TYPE_BUG;
break;
@@ -1354,14 +1360,6 @@ compile_enclose_node(EncloseNode* node, regex_t* reg)
if (r) return r;
r = add_opcode(reg, OP_RETURN);
}
- else if (IS_ENCLOSE_RECURSION(node)) {
- if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))
- r = add_opcode(reg, OP_MEMORY_END_PUSH_REC);
- else
- r = add_opcode(reg, OP_MEMORY_END_REC);
- if (r) return r;
- r = add_mem_num(reg, node->regnum);
- }
else
#endif
{
@@ -1434,19 +1432,6 @@ compile_enclose_node(EncloseNode* node, regex_t* reg)
}
break;
- case ENCLOSE_ABSENT:
- len = compile_length_tree(node->target, reg);
- if (len < 0) return len;
-
- r = add_opcode(reg, OP_PUSH_ABSENT_POS);
- if (r) return r;
- r = add_opcode_rel_addr(reg, OP_ABSENT, len + SIZE_OP_ABSENT_END);
- if (r) return r;
- r = compile_tree(node->target, reg);
- if (r) return r;
- r = add_opcode(reg, OP_ABSENT_END);
- break;
-
default:
return ONIGERR_TYPE_BUG;
break;
@@ -1501,6 +1486,9 @@ compile_anchor_node(AnchorNode* node, regex_t* reg)
case ANCHOR_SEMI_END_BUF: r = add_opcode(reg, OP_SEMI_END_BUF); break;
case ANCHOR_BEGIN_POSITION: r = add_opcode(reg, OP_BEGIN_POSITION); break;
+ /* used for implicit anchor optimization: /.*a/ ==> /(?:^|\G).*a/ */
+ case ANCHOR_ANYCHAR_STAR: r = add_opcode(reg, OP_BEGIN_POS_OR_LINE); break;
+
case ANCHOR_WORD_BOUND:
if (node->ascii_range) r = add_opcode(reg, OP_ASCII_WORD_BOUND);
else r = add_opcode(reg, OP_WORD_BOUND);
@@ -1604,15 +1592,13 @@ compile_length_tree(Node* node, regex_t* reg)
case NT_ALT:
{
- int n = 0;
- len = 0;
+ int n;
+
+ n = r = 0;
do {
- r = compile_length_tree(NCAR(node), reg);
- if (r < 0) return r;
- len += r;
+ r += compile_length_tree(NCAR(node), reg);
n++;
} while (IS_NOT_NULL(node = NCDR(node)));
- r = len;
r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1);
}
break;
@@ -1639,7 +1625,7 @@ compile_length_tree(Node* node, regex_t* reg)
#ifdef USE_BACKREF_WITH_LEVEL
if (IS_BACKREF_NEST_LEVEL(br)) {
- r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH +
+ r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH +
SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);
}
else
@@ -1803,12 +1789,12 @@ compile_tree(Node* node, regex_t* reg)
int i;
int* p;
- if (IS_IGNORECASE(reg->options)) {
- r = add_opcode(reg, OP_BACKREF_MULTI_IC);
- }
- else {
- r = add_opcode(reg, OP_BACKREF_MULTI);
- }
+ if (IS_IGNORECASE(reg->options)) {
+ r = add_opcode(reg, OP_BACKREF_MULTI_IC);
+ }
+ else {
+ r = add_opcode(reg, OP_BACKREF_MULTI);
+ }
if (r) return r;
#ifdef USE_BACKREF_WITH_LEVEL
@@ -1888,22 +1874,32 @@ noname_disable_map(Node** plink, GroupNumRemap* map, int* counter)
(*counter)++;
map[en->regnum].new_val = *counter;
en->regnum = *counter;
+ r = noname_disable_map(&(en->target), map, counter);
}
- else if (en->regnum != 0) {
+ else {
*plink = en->target;
en->target = NULL_NODE;
onig_node_free(node);
r = noname_disable_map(plink, map, counter);
- break;
}
}
- r = noname_disable_map(&(en->target), map, counter);
+ else
+ r = noname_disable_map(&(en->target), map, counter);
}
break;
case NT_ANCHOR:
- if (NANCHOR(node)->target)
- r = noname_disable_map(&(NANCHOR(node)->target), map, counter);
+ {
+ AnchorNode* an = NANCHOR(node);
+ switch (an->type) {
+ case ANCHOR_PREC_READ:
+ case ANCHOR_PREC_READ_NOT:
+ case ANCHOR_LOOK_BEHIND:
+ case ANCHOR_LOOK_BEHIND_NOT:
+ r = noname_disable_map(&(an->target), map, counter);
+ break;
+ }
+ }
break;
default:
@@ -1960,7 +1956,7 @@ renumber_by_map(Node* node, GroupNumRemap* map)
{
EncloseNode* en = NENCLOSE(node);
if (en->type == ENCLOSE_CONDITION)
- en->regnum = map[en->regnum].new_val;
+ en->regnum = map[en->regnum].new_val;
r = renumber_by_map(en->target, map);
}
break;
@@ -1970,8 +1966,17 @@ renumber_by_map(Node* node, GroupNumRemap* map)
break;
case NT_ANCHOR:
- if (NANCHOR(node)->target)
- r = renumber_by_map(NANCHOR(node)->target, map);
+ {
+ AnchorNode* an = NANCHOR(node);
+ switch (an->type) {
+ case ANCHOR_PREC_READ:
+ case ANCHOR_PREC_READ_NOT:
+ case ANCHOR_LOOK_BEHIND:
+ case ANCHOR_LOOK_BEHIND_NOT:
+ r = renumber_by_map(an->target, map);
+ break;
+ }
+ }
break;
default:
@@ -2005,11 +2010,6 @@ numbered_ref_check(Node* node)
return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
break;
- case NT_ANCHOR:
- if (NANCHOR(node)->target)
- r = numbered_ref_check(NANCHOR(node)->target);
- break;
-
default:
break;
}
@@ -2096,7 +2096,7 @@ quantifiers_memory_node_info(Node* node)
}
break;
-# ifdef USE_SUBEXP_CALL
+#ifdef USE_SUBEXP_CALL
case NT_CALL:
if (IS_CALL_RECURSION(NCALL(node))) {
return NQ_TARGET_IS_EMPTY_REC; /* tiny version */
@@ -2104,7 +2104,7 @@ quantifiers_memory_node_info(Node* node)
else
r = quantifiers_memory_node_info(NCALL(node)->target);
break;
-# endif
+#endif
case NT_QTFR:
{
@@ -2126,7 +2126,6 @@ quantifiers_memory_node_info(Node* node)
case ENCLOSE_OPTION:
case ENCLOSE_STOP_BACKTRACK:
case ENCLOSE_CONDITION:
- case ENCLOSE_ABSENT:
r = quantifiers_memory_node_info(en->target);
break;
default:
@@ -2244,31 +2243,23 @@ get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env)
EncloseNode* en = NENCLOSE(node);
switch (en->type) {
case ENCLOSE_MEMORY:
- if (IS_ENCLOSE_MIN_FIXED(en))
- *min = en->min_len;
- else {
- if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
- *min = 0; /* recursive */
- else {
- SET_ENCLOSE_STATUS(node, NST_MARK1);
- r = get_min_match_length(en->target, min, env);
- CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
- if (r == 0) {
- en->min_len = *min;
- SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);
- }
+#ifdef USE_SUBEXP_CALL
+ if (IS_ENCLOSE_MIN_FIXED(en))
+ *min = en->min_len;
+ else {
+ r = get_min_match_length(en->target, min, env);
+ if (r == 0) {
+ en->min_len = *min;
+ SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);
}
- }
- break;
-
+ }
+ break;
+#endif
case ENCLOSE_OPTION:
case ENCLOSE_STOP_BACKTRACK:
case ENCLOSE_CONDITION:
r = get_min_match_length(en->target, min, env);
break;
-
- case ENCLOSE_ABSENT:
- break;
}
}
break;
@@ -2370,31 +2361,23 @@ get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env)
EncloseNode* en = NENCLOSE(node);
switch (en->type) {
case ENCLOSE_MEMORY:
+#ifdef USE_SUBEXP_CALL
if (IS_ENCLOSE_MAX_FIXED(en))
*max = en->max_len;
else {
- if (IS_ENCLOSE_MARK1(NENCLOSE(node)))
- *max = ONIG_INFINITE_DISTANCE;
- else {
- SET_ENCLOSE_STATUS(node, NST_MARK1);
- r = get_max_match_length(en->target, max, env);
- CLEAR_ENCLOSE_STATUS(node, NST_MARK1);
- if (r == 0) {
- en->max_len = *max;
- SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);
- }
+ r = get_max_match_length(en->target, max, env);
+ if (r == 0) {
+ en->max_len = *max;
+ SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);
}
}
break;
-
+#endif
case ENCLOSE_OPTION:
case ENCLOSE_STOP_BACKTRACK:
case ENCLOSE_CONDITION:
r = get_max_match_length(en->target, max, env);
break;
-
- case ENCLOSE_ABSENT:
- break;
}
}
break;
@@ -2518,7 +2501,6 @@ get_char_length_tree1(Node* node, regex_t* reg, int* len, int level)
case ENCLOSE_CONDITION:
r = get_char_length_tree1(en->target, reg, len, level);
break;
- case ENCLOSE_ABSENT:
default:
break;
}
@@ -2645,10 +2627,10 @@ is_not_included(Node* x, Node* y, regex_t* reg)
for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
v = BITSET_AT(xc->bs, i);
if ((v != 0 && !IS_NCCLASS_NOT(xc)) ||
- (v == 0 && IS_NCCLASS_NOT(xc))) {
+ (v == 0 && IS_NCCLASS_NOT(xc))) {
v = BITSET_AT(yc->bs, i);
if ((v != 0 && !IS_NCCLASS_NOT(yc)) ||
- (v == 0 && IS_NCCLASS_NOT(yc)))
+ (v == 0 && IS_NCCLASS_NOT(yc)))
return 0;
}
}
@@ -2698,24 +2680,24 @@ is_not_included(Node* x, Node* y, regex_t* reg)
break;
case NT_CCLASS:
- {
- CClassNode* cc = NCCLASS(y);
+ {
+ CClassNode* cc = NCCLASS(y);
- code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s,
- xs->s + ONIGENC_MBC_MAXLEN(reg->enc));
- return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1);
- }
- break;
+ code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s,
+ xs->s + ONIGENC_MBC_MAXLEN(reg->enc));
+ return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1);
+ }
+ break;
case NT_STR:
- {
- UChar *q;
- StrNode* ys = NSTR(y);
- len = NSTRING_LEN(x);
- if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y);
- if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) {
- /* tiny version */
- return 0;
+ {
+ UChar *q;
+ StrNode* ys = NSTR(y);
+ len = NSTRING_LEN(x);
+ if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y);
+ if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) {
+ /* tiny version */
+ return 0;
}
else {
for (i = 0, p = ys->s, q = xs->s; (OnigDistance )i < len; i++, p++, q++) {
@@ -2726,7 +2708,7 @@ is_not_included(Node* x, Node* y, regex_t* reg)
break;
default:
- break;
+ break;
}
}
break;
@@ -2783,11 +2765,9 @@ get_head_value_node(Node* node, int exact, regex_t* reg)
{
QtfrNode* qn = NQTFR(node);
if (qn->lower > 0) {
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
if (IS_NOT_NULL(qn->head_exact))
n = qn->head_exact;
else
-#endif
n = get_head_value_node(qn->target, exact, reg);
}
}
@@ -2812,9 +2792,6 @@ get_head_value_node(Node* node, int exact, regex_t* reg)
case ENCLOSE_CONDITION:
n = get_head_value_node(en->target, exact, reg);
break;
-
- case ENCLOSE_ABSENT:
- break;
}
}
break;
@@ -2882,8 +2859,8 @@ check_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask)
#ifdef USE_SUBEXP_CALL
-# define RECURSION_EXIST 1
-# define RECURSION_INFINITE 2
+#define RECURSION_EXIST 1
+#define RECURSION_INFINITE 2
static int
subexp_inf_recursive_check(Node* node, ScanEnv* env, int head)
@@ -3083,7 +3060,7 @@ subexp_recursive_check(Node* node)
static int
subexp_recursive_check_trav(Node* node, ScanEnv* env)
{
-# define FOUND_CALLED_NODE 1
+#define FOUND_CALLED_NODE 1
int type;
int r = 0;
@@ -3184,22 +3161,22 @@ setup_subexp_call(Node* node, ScanEnv* env)
if (cn->group_num != 0) {
int gnum = cn->group_num;
-# ifdef USE_NAMED_GROUP
+#ifdef USE_NAMED_GROUP
if (env->num_named > 0 &&
IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&
!ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) {
return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
}
-# endif
+#endif
if (gnum > env->num_mem) {
onig_scan_env_set_error_string(env,
ONIGERR_UNDEFINED_GROUP_REFERENCE, cn->name, cn->name_end);
return ONIGERR_UNDEFINED_GROUP_REFERENCE;
}
-# ifdef USE_NAMED_GROUP
+#ifdef USE_NAMED_GROUP
set_call_attr:
-# endif
+#endif
cn->target = nodes[cn->group_num];
if (IS_NULL(cn->target)) {
onig_scan_env_set_error_string(env,
@@ -3210,12 +3187,12 @@ setup_subexp_call(Node* node, ScanEnv* env)
BIT_STATUS_ON_AT(env->bt_mem_start, cn->group_num);
cn->unset_addr_list = env->unset_addr_list;
}
-# ifdef USE_NAMED_GROUP
-# ifdef USE_PERL_SUBEXP_CALL
+#ifdef USE_NAMED_GROUP
+#ifdef USE_PERL_SUBEXP_CALL
else if (cn->name == cn->name_end) {
goto set_call_attr;
}
-# endif
+#endif
else {
int *refs;
@@ -3237,7 +3214,7 @@ setup_subexp_call(Node* node, ScanEnv* env)
goto set_call_attr;
}
}
-# endif
+#endif
}
break;
@@ -3320,7 +3297,7 @@ setup_look_behind(Node* node, regex_t* reg, ScanEnv* env)
}
static int
-next_setup(Node* node, Node* next_node, regex_t* reg)
+next_setup(Node* node, Node* next_node, int in_root, regex_t* reg)
{
int type;
@@ -3354,10 +3331,32 @@ next_setup(Node* node, Node* next_node, regex_t* reg)
}
}
}
+
+#ifndef ONIG_DONT_OPTIMIZE
+ if (NTYPE(node) == NT_QTFR && /* the type may be changed by above block */
+ in_root && /* qn->lower == 0 && */
+ NTYPE(qn->target) == NT_CANY &&
+ ! IS_MULTILINE(reg->options)) {
+ /* implicit anchor: /.*a/ ==> /(?:^|\G).*a/ */
+ Node *np;
+ np = onig_node_new_list(NULL_NODE, NULL_NODE);
+ CHECK_NULL_RETURN_MEMERR(np);
+ swap_node(node, np);
+ NCDR(node) = onig_node_new_list(np, NULL_NODE);
+ if (IS_NULL(NCDR(node))) {
+ onig_node_free(np);
+ return ONIGERR_MEMORY;
+ }
+ np = onig_node_new_anchor(ANCHOR_ANYCHAR_STAR); /* (?:^|\G) */
+ CHECK_NULL_RETURN_MEMERR(np);
+ NCAR(node) = np;
+ }
+#endif
}
}
else if (type == NT_ENCLOSE) {
EncloseNode* en = NENCLOSE(node);
+ in_root = 0;
if (en->type == ENCLOSE_MEMORY) {
node = en->target;
goto retry;
@@ -3404,9 +3403,13 @@ update_string_node_case_fold(regex_t* reg, Node *node)
}
r = onig_node_str_set(node, sbuf, sp);
+ if (r != 0) {
+ xfree(sbuf);
+ return r;
+ }
xfree(sbuf);
- return r;
+ return 0;
}
static int
@@ -3514,29 +3517,29 @@ expand_case_fold_string_alt(int item_num, OnigCaseFoldCodeItem items[],
UChar *q = p + items[i].byte_len;
if (q < end) {
- r = expand_case_fold_make_rem_string(&rem, q, end, reg);
- if (r != 0) {
- onig_node_free(an);
- goto mem_err2;
- }
+ r = expand_case_fold_make_rem_string(&rem, q, end, reg);
+ if (r != 0) {
+ onig_node_free(an);
+ goto mem_err2;
+ }
- xnode = onig_node_list_add(NULL_NODE, snode);
- if (IS_NULL(xnode)) {
- onig_node_free(an);
- onig_node_free(rem);
- goto mem_err2;
- }
- if (IS_NULL(onig_node_list_add(xnode, rem))) {
- onig_node_free(an);
- onig_node_free(xnode);
- onig_node_free(rem);
- goto mem_err;
- }
+ xnode = onig_node_list_add(NULL_NODE, snode);
+ if (IS_NULL(xnode)) {
+ onig_node_free(an);
+ onig_node_free(rem);
+ goto mem_err2;
+ }
+ if (IS_NULL(onig_node_list_add(xnode, rem))) {
+ onig_node_free(an);
+ onig_node_free(xnode);
+ onig_node_free(rem);
+ goto mem_err;
+ }
- NCAR(an) = xnode;
+ NCAR(an) = xnode;
}
else {
- NCAR(an) = snode;
+ NCAR(an) = snode;
}
NCDR(var_anode) = an;
@@ -3713,12 +3716,12 @@ expand_case_fold_string(Node* node, regex_t* reg)
#ifdef USE_COMBINATION_EXPLOSION_CHECK
-# define CEC_THRES_NUM_BIG_REPEAT 512
-# define CEC_INFINITE_NUM 0x7fffffff
+#define CEC_THRES_NUM_BIG_REPEAT 512
+#define CEC_INFINITE_NUM 0x7fffffff
-# define CEC_IN_INFINITE_REPEAT (1<<0)
-# define CEC_IN_FINITE_REPEAT (1<<1)
-# define CEC_CONT_BIG_REPEAT (1<<2)
+#define CEC_IN_INFINITE_REPEAT (1<<0)
+#define CEC_IN_FINITE_REPEAT (1<<1)
+#define CEC_CONT_BIG_REPEAT (1<<2)
static int
setup_comb_exp_check(Node* node, int state, ScanEnv* env)
@@ -3834,14 +3837,14 @@ setup_comb_exp_check(Node* node, int state, ScanEnv* env)
}
break;
-# ifdef USE_SUBEXP_CALL
+#ifdef USE_SUBEXP_CALL
case NT_CALL:
if (IS_CALL_RECURSION(NCALL(node)))
env->has_recursion = 1;
else
r = setup_comb_exp_check(NCALL(node)->target, state, env);
break;
-# endif
+#endif
default:
break;
@@ -3855,8 +3858,7 @@ setup_comb_exp_check(Node* node, int state, ScanEnv* env)
#define IN_NOT (1<<1)
#define IN_REPEAT (1<<2)
#define IN_VAR_REPEAT (1<<3)
-#define IN_CALL (1<<4)
-#define IN_RECCALL (1<<5)
+#define IN_ROOT (1<<4)
/* setup_tree does the following work.
1. check empty loop. (set qn->target_empty_info)
@@ -3871,19 +3873,25 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
{
int type;
int r = 0;
+ int in_root = state & IN_ROOT;
+ state &= ~IN_ROOT;
restart:
type = NTYPE(node);
switch (type) {
case NT_LIST:
{
Node* prev = NULL_NODE;
+ int prev_in_root = 0;
+ state |= in_root;
do {
r = setup_tree(NCAR(node), reg, state, env);
if (IS_NOT_NULL(prev) && r == 0) {
- r = next_setup(prev, NCAR(node), reg);
+ r = next_setup(prev, NCAR(node), prev_in_root, reg);
}
prev = NCAR(node);
+ prev_in_root = state & IN_ROOT;
+ state &= ~IN_ROOT;
} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));
}
break;
@@ -3940,7 +3948,7 @@ restart:
Node* target = qn->target;
if ((state & IN_REPEAT) != 0) {
- qn->state |= NST_IN_REPEAT;
+ qn->state |= NST_IN_REPEAT;
}
if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {
@@ -4047,6 +4055,7 @@ restart:
case ENCLOSE_OPTION:
{
OnigOptionType options = reg->options;
+ state |= in_root;
reg->options = NENCLOSE(node)->option;
r = setup_tree(NENCLOSE(node)->target, reg, state, env);
reg->options = options;
@@ -4054,18 +4063,12 @@ restart:
break;
case ENCLOSE_MEMORY:
- if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT | IN_CALL)) != 0) {
+ if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT)) != 0) {
BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum);
/* SET_ENCLOSE_STATUS(node, NST_MEM_IN_ALT_NOT); */
}
- if (IS_ENCLOSE_CALLED(en))
- state |= IN_CALL;
- if (IS_ENCLOSE_RECURSION(en))
- state |= IN_RECCALL;
- else if ((state & IN_RECCALL) != 0)
- SET_CALL_RECURSION(node);
- r = setup_tree(en->target, reg, state, env);
- break;
+ r = setup_tree(en->target, reg, state, env);
+ break;
case ENCLOSE_STOP_BACKTRACK:
{
@@ -4092,12 +4095,6 @@ restart:
return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;
}
#endif
- if (NENCLOSE(node)->regnum > env->num_mem)
- return ONIGERR_INVALID_BACKREF;
- r = setup_tree(NENCLOSE(node)->target, reg, state, env);
- break;
-
- case ENCLOSE_ABSENT:
r = setup_tree(NENCLOSE(node)->target, reg, state, env);
break;
}
@@ -4141,10 +4138,10 @@ restart:
ALLOWED_ENCLOSE_IN_LB, ALLOWED_ANCHOR_IN_LB);
if (r < 0) return r;
if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
+ r = setup_look_behind(node, reg, env);
+ if (r != 0) return r;
if (NTYPE(node) != NT_ANCHOR) goto restart;
r = setup_tree(an->target, reg, state, env);
- if (r != 0) return r;
- r = setup_look_behind(node, reg, env);
}
break;
@@ -4154,10 +4151,10 @@ restart:
ALLOWED_ENCLOSE_IN_LB_NOT, ALLOWED_ANCHOR_IN_LB_NOT);
if (r < 0) return r;
if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;
+ r = setup_look_behind(node, reg, env);
+ if (r != 0) return r;
if (NTYPE(node) != NT_ANCHOR) goto restart;
r = setup_tree(an->target, reg, (state | IN_NOT), env);
- if (r != 0) return r;
- r = setup_look_behind(node, reg, env);
}
break;
}
@@ -4194,8 +4191,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
p, end, items);
clen = enclen(enc, p, end);
- if (p + clen > end)
- clen = (int )(end - p);
for (j = 0; j < n; j++) {
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
@@ -4213,10 +4208,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
}
}
else {
-# if OPT_EXACT_MAXLEN < ONIG_CHAR_TABLE_SIZE
- /* This should not happen. */
- return ONIGERR_TYPE_BUG;
-# else
if (IS_NULL(*int_skip)) {
*int_skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);
if (IS_NULL(*int_skip)) return ONIGERR_MEMORY;
@@ -4230,8 +4221,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
p, end, items);
clen = enclen(enc, p, end);
- if (p + clen > end)
- clen = (int )(end - p);
for (j = 0; j < n; j++) {
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
@@ -4247,7 +4236,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
}
}
}
-# endif
}
return 0;
}
@@ -4276,8 +4264,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
p, end, items);
clen = enclen(enc, p, end);
- if (p + clen > end)
- clen = (int )(end - p);
for (j = 0; j < n; j++) {
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
@@ -4295,10 +4281,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
}
}
else {
-# if OPT_EXACT_MAXLEN < ONIG_CHAR_TABLE_SIZE
- /* This should not happen. */
- return ONIGERR_TYPE_BUG;
-# else
if (IS_NULL(*int_skip)) {
*int_skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);
if (IS_NULL(*int_skip)) return ONIGERR_MEMORY;
@@ -4312,8 +4294,6 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
p, end, items);
clen = enclen(enc, p, end);
- if (p + clen > end)
- clen = (int )(end - p);
for (j = 0; j < n; j++) {
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
@@ -4329,12 +4309,13 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
}
}
}
-# endif
}
return 0;
}
#endif /* USE_SUNDAY_QUICK_SEARCH */
+#define OPT_EXACT_MAXLEN 24
+
typedef struct {
OnigDistance min; /* min byte length */
OnigDistance max; /* max byte length */
@@ -5004,14 +4985,14 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
if (slen > 0) {
add_char_opt_map_info(&opt->map, *(sn->s), env->enc);
}
- set_mml(&opt->len, slen, slen);
+ set_mml(&opt->len, slen, slen);
}
else {
- OnigDistance max;
+ OnigDistance max;
if (NSTRING_IS_DONT_GET_OPT_INFO(node)) {
- int n = onigenc_strlen(env->enc, sn->s, sn->end);
- max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;
+ int n = onigenc_strlen(env->enc, sn->s, sn->end);
+ max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;
}
else {
concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,
@@ -5027,7 +5008,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
max = slen;
}
- set_mml(&opt->len, slen, max);
+ set_mml(&opt->len, slen, max);
}
if ((OnigDistance )opt->exb.len == slen)
@@ -5043,18 +5024,18 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
/* no need to check ignore case. (set in setup_tree()) */
if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) {
- OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);
+ OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);
OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
set_mml(&opt->len, min, max);
}
else {
- for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
- z = BITSET_AT(cc->bs, i);
- if ((z && !IS_NCCLASS_NOT(cc)) || (!z && IS_NCCLASS_NOT(cc))) {
- add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
- }
- }
+ for (i = 0; i < SINGLE_BYTE_SIZE; i++) {
+ z = BITSET_AT(cc->bs, i);
+ if ((z && !IS_NCCLASS_NOT(cc)) || (!z && IS_NCCLASS_NOT(cc))) {
+ add_char_opt_map_info(&opt->map, (UChar )i, env->enc);
+ }
+ }
set_mml(&opt->len, 1, 1);
}
}
@@ -5068,7 +5049,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
max = ONIGENC_MBC_MAXLEN_DIST(env->enc);
if (max == 1) {
- min = 1;
+ min = 1;
maxcode = NCTYPE(node)->ascii_range ? 0x80 : SINGLE_BYTE_SIZE;
switch (NCTYPE(node)->ctype) {
@@ -5091,7 +5072,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
}
}
else {
- min = ONIGENC_MBC_MINLEN(env->enc);
+ min = ONIGENC_MBC_MINLEN(env->enc);
}
set_mml(&opt->len, min, max);
}
@@ -5210,7 +5191,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
if (nopt.exb.len > 0) {
if (nopt.exb.reach_end) {
for (i = 2; i <= qn->lower &&
- ! is_full_opt_exact_info(&opt->exb); i++) {
+ ! is_full_opt_exact_info(&opt->exb); i++) {
concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc);
}
if (i < qn->lower) {
@@ -5281,17 +5262,13 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
case ENCLOSE_CONDITION:
r = optimize_node_left(en->target, opt, env);
break;
-
- case ENCLOSE_ABSENT:
- set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);
- break;
}
}
break;
default:
#ifdef ONIG_DEBUG
- fprintf(stderr, "optimize_node_left: undefined node type %d\n",
+ if (!onig_is_prelude()) fprintf(stderr, "optimize_node_left: undefined node type %d\n",
NTYPE(node));
#endif
r = ONIGERR_TYPE_BUG;
@@ -5336,14 +5313,11 @@ set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
else {
if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
r = set_bm_skip(reg->exact, reg->exact_end, reg,
- reg->map, &(reg->int_map), 0);
- if (r == 0) {
- reg->optimize = (allow_reverse != 0
+ reg->map, &(reg->int_map), 0);
+ if (r) return r;
+
+ reg->optimize = (allow_reverse != 0
? ONIG_OPTIMIZE_EXACT_BM : ONIG_OPTIMIZE_EXACT_BM_NOT_REV);
- }
- else {
- reg->optimize = ONIG_OPTIMIZE_EXACT;
- }
}
else {
reg->optimize = ONIG_OPTIMIZE_EXACT;
@@ -5384,7 +5358,7 @@ set_sub_anchor(regex_t* reg, OptAncInfo* anc)
reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE;
}
-#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
+#ifdef ONIG_DEBUG
static void print_optimize_info(FILE* f, regex_t* reg);
#endif
@@ -5409,9 +5383,6 @@ set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env)
ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML |
ANCHOR_LOOK_BEHIND);
- if ((opt.anc.left_anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) != 0)
- reg->anchor &= ~ANCHOR_ANYCHAR_STAR_ML;
-
reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF |
ANCHOR_PREC_READ_NOT);
@@ -5443,7 +5414,7 @@ set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env)
}
#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
- print_optimize_info(stderr, reg);
+ if (!onig_is_prelude()) print_optimize_info(stderr, reg);
#endif
return r;
}
@@ -5497,9 +5468,7 @@ static void print_enc_string(FILE* fp, OnigEncoding enc,
fprintf(fp, "/ (%s)\n", enc->name);
}
-#endif /* ONIG_DEBUG */
-#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)
static void
print_distance_range(FILE* f, OnigDistance a, OnigDistance b)
{
@@ -5604,20 +5573,20 @@ print_optimize_info(FILE* f, regex_t* reg)
fputc('[', f);
for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) {
if (reg->map[i] != 0) {
- if (c > 0) fputs(", ", f);
- c++;
- if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 &&
- ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint )i))
- fputc(i, f);
- else
- fprintf(f, "%d", i);
- }
+ if (c > 0) fputs(", ", f);
+ c++;
+ if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 &&
+ ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint )i))
+ fputc(i, f);
+ else
+ fprintf(f, "%d", i);
+ }
}
fprintf(f, "]\n");
}
}
}
-#endif /* ONIG_DEBUG_COMPILE || ONIG_DEBUG_MATCH */
+#endif /* ONIG_DEBUG */
extern void
@@ -5646,7 +5615,6 @@ onig_free(regex_t* reg)
}
}
-#ifdef RUBY
size_t
onig_memsize(const regex_t *reg)
{
@@ -5670,47 +5638,65 @@ onig_region_memsize(const OnigRegion *regs)
size += regs->allocated * (sizeof(*regs->beg) + sizeof(*regs->end));
return size;
}
-#endif
#define REGEX_TRANSFER(to,from) do {\
+ (to)->state = ONIG_STATE_MODIFY;\
onig_free_body(to);\
xmemcpy(to, from, sizeof(regex_t));\
xfree(from);\
} while (0)
-#if 0
extern void
onig_transfer(regex_t* to, regex_t* from)
{
+ THREAD_ATOMIC_START;
REGEX_TRANSFER(to, from);
+ THREAD_ATOMIC_END;
}
-#endif
-#ifdef ONIG_DEBUG_COMPILE
-static void print_compiled_byte_code_list(FILE* f, regex_t* reg);
-#endif
-#ifdef ONIG_DEBUG_PARSE_TREE
-static void print_tree(FILE* f, Node* node);
-#endif
+#define REGEX_CHAIN_HEAD(reg) do {\
+ while (IS_NOT_NULL((reg)->chain)) {\
+ (reg) = (reg)->chain;\
+ }\
+} while (0)
-#ifdef RUBY
-extern int
-onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
- OnigErrorInfo* einfo)
+extern void
+onig_chain_link_add(regex_t* to, regex_t* add)
+{
+ THREAD_ATOMIC_START;
+ REGEX_CHAIN_HEAD(to);
+ to->chain = add;
+ THREAD_ATOMIC_END;
+}
+
+extern void
+onig_chain_reduce(regex_t* reg)
{
- return onig_compile_ruby(reg, pattern, pattern_end, einfo, NULL, 0);
+ regex_t *head, *prev;
+
+ prev = reg;
+ head = prev->chain;
+ if (IS_NOT_NULL(head)) {
+ reg->state = ONIG_STATE_MODIFY;
+ while (IS_NOT_NULL(head->chain)) {
+ prev = head;
+ head = head->chain;
+ }
+ prev->chain = (regex_t* )NULL;
+ REGEX_TRANSFER(reg, head);
+ }
}
+
+#ifdef ONIG_DEBUG
+static void print_compiled_byte_code_list P_((FILE* f, regex_t* reg));
+#endif
+#ifdef ONIG_DEBUG_PARSE_TREE
+static void print_tree P_((FILE* f, Node* node));
#endif
-#ifdef RUBY
-extern int
-onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
- OnigErrorInfo* einfo, const char *sourcefile, int sourceline)
-#else
extern int
onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
- OnigErrorInfo* einfo)
-#endif
+ OnigErrorInfo* einfo, const char *sourcefile, int sourceline)
{
#define COMPILE_INIT_SIZE 20
@@ -5724,13 +5710,12 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
-#ifdef RUBY
scan_env.sourcefile = sourcefile;
scan_env.sourceline = sourceline;
-#endif
+ reg->state = ONIG_STATE_COMPILING;
#ifdef ONIG_DEBUG
- print_enc_string(stderr, reg->enc, pattern, pattern_end);
+ if (!onig_is_prelude()) print_enc_string(stderr, reg->enc, pattern, pattern_end);
#endif
if (reg->alloc == 0) {
@@ -5757,7 +5742,9 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
#ifdef ONIG_DEBUG_PARSE_TREE
# if 0
fprintf(stderr, "ORIGINAL PARSE TREE:\n");
- print_tree(stderr, root);
+ if (!onig_is_prelude()) {
+ print_tree(stderr, root);
+ }
# endif
#endif
@@ -5793,11 +5780,11 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
reg->num_call = 0;
#endif
- r = setup_tree(root, reg, 0, &scan_env);
+ r = setup_tree(root, reg, IN_ROOT, &scan_env);
if (r != 0) goto err_unset;
#ifdef ONIG_DEBUG_PARSE_TREE
- print_tree(stderr, root);
+ if (!onig_is_prelude()) print_tree(stderr, root);
#endif
reg->capture_history = scan_env.capture_history;
@@ -5812,17 +5799,17 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
#ifdef USE_COMBINATION_EXPLOSION_CHECK
if (scan_env.backrefed_mem == 0
-# ifdef USE_SUBEXP_CALL
+#ifdef USE_SUBEXP_CALL
|| scan_env.num_call == 0
-# endif
+#endif
) {
setup_comb_exp_check(root, 0, &scan_env);
-# ifdef USE_SUBEXP_CALL
+#ifdef USE_SUBEXP_CALL
if (scan_env.has_recursion != 0) {
scan_env.num_comb_exp_check = 0;
}
else
-# endif
+#endif
if (scan_env.comb_exp_max_regnum > 0) {
int i;
for (i = 1; i <= scan_env.comb_exp_max_regnum; i++) {
@@ -5876,13 +5863,14 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
onig_node_free(root);
#ifdef ONIG_DEBUG_COMPILE
-# ifdef USE_NAMED_GROUP
- onig_print_names(stderr, reg);
-# endif
- print_compiled_byte_code_list(stderr, reg);
+#ifdef USE_NAMED_GROUP
+ if (!onig_is_prelude()) onig_print_names(stderr, reg);
+#endif
+ if (!onig_is_prelude()) print_compiled_byte_code_list(stderr, reg);
#endif
end:
+ reg->state = ONIG_STATE_NORMAL;
return r;
err_unset:
@@ -5906,6 +5894,27 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
return r;
}
+#ifdef USE_RECOMPILE_API
+extern int
+onig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
+ OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,
+ OnigErrorInfo* einfo)
+{
+ int r;
+ regex_t *new_reg;
+
+ r = onig_new(&new_reg, pattern, pattern_end, option, enc, syntax, einfo);
+ if (r) return r;
+ if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
+ onig_transfer(reg, new_reg);
+ }
+ else {
+ onig_chain_link_add(reg, new_reg);
+ }
+ return 0;
+}
+#endif
+
static int onig_inited = 0;
extern int
@@ -5927,6 +5936,8 @@ onig_reg_init(regex_t* reg, OnigOptionType option,
return ONIGERR_INVALID_COMBINATION_OF_OPTIONS;
}
+ (reg)->state = ONIG_STATE_MODIFY;
+
if ((option & ONIG_OPTION_NEGATE_SINGLELINE) != 0) {
option |= syntax->options;
option &= ~ONIG_OPTION_SINGLELINE;
@@ -5955,14 +5966,14 @@ onig_reg_init(regex_t* reg, OnigOptionType option,
extern int
onig_new_without_alloc(regex_t* reg, const UChar* pattern,
const UChar* pattern_end, OnigOptionType option, OnigEncoding enc,
- const OnigSyntaxType* syntax, OnigErrorInfo* einfo)
+ OnigSyntaxType* syntax, OnigErrorInfo* einfo)
{
int r;
r = onig_reg_init(reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
if (r) return r;
- r = onig_compile(reg, pattern, pattern_end, einfo);
+ r = onig_compile(reg, pattern, pattern_end, einfo, NULL, 0);
return r;
}
@@ -5979,7 +5990,7 @@ onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
if (r) goto err;
- r = onig_compile(*reg, pattern, pattern_end, einfo);
+ r = onig_compile(*reg, pattern, pattern_end, einfo, NULL, 0);
if (r) {
err:
onig_free(*reg);
@@ -5988,11 +5999,6 @@ onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
return r;
}
-extern int
-onig_initialize(OnigEncoding encodings[] ARG_UNUSED, int n ARG_UNUSED)
-{
- return onig_init();
-}
extern int
onig_init(void)
@@ -6000,11 +6006,10 @@ onig_init(void)
if (onig_inited != 0)
return 0;
- onig_inited = 1;
+ THREAD_SYSTEM_INIT;
+ THREAD_ATOMIC_START;
-#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER)
- _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
-#endif
+ onig_inited = 1;
onigenc_init();
/* onigenc_set_default_caseconv_table((UChar* )0); */
@@ -6013,56 +6018,32 @@ onig_init(void)
onig_statistics_init();
#endif
+ THREAD_ATOMIC_END;
return 0;
}
-static OnigEndCallListItemType* EndCallTop;
-
-extern void onig_add_end_call(void (*func)(void))
-{
- OnigEndCallListItemType* item;
-
- item = (OnigEndCallListItemType* )xmalloc(sizeof(*item));
- if (item == 0) return ;
-
- item->next = EndCallTop;
- item->func = func;
-
- EndCallTop = item;
-}
-
-static void
-exec_end_call_list(void)
-{
- OnigEndCallListItemType* prev;
- void (*func)(void);
-
- while (EndCallTop != 0) {
- func = EndCallTop->func;
- (*func)();
-
- prev = EndCallTop;
- EndCallTop = EndCallTop->next;
- xfree(prev);
- }
-}
-
extern int
onig_end(void)
{
- exec_end_call_list();
+ THREAD_ATOMIC_START;
#ifdef ONIG_DEBUG_STATISTICS
- onig_print_statistics(stderr);
+ if (!onig_is_prelude()) onig_print_statistics(stderr);
#endif
-#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER)
- _CrtDumpMemoryLeaks();
+#ifdef USE_SHARED_CCLASS_TABLE
+ onig_free_shared_cclass_table();
+#endif
+
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+ onig_free_node_list();
#endif
onig_inited = 0;
+ THREAD_ATOMIC_END;
+ THREAD_SYSTEM_END;
return 0;
}
@@ -6128,14 +6109,14 @@ onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc)
#ifdef ONIG_DEBUG
/* arguments type */
-# define ARG_SPECIAL -1
-# define ARG_NON 0
-# define ARG_RELADDR 1
-# define ARG_ABSADDR 2
-# define ARG_LENGTH 3
-# define ARG_MEMNUM 4
-# define ARG_OPTION 5
-# define ARG_STATE_CHECK 6
+#define ARG_SPECIAL -1
+#define ARG_NON 0
+#define ARG_RELADDR 1
+#define ARG_ABSADDR 2
+#define ARG_LENGTH 3
+#define ARG_MEMNUM 4
+#define ARG_OPTION 5
+#define ARG_STATE_CHECK 6
OnigOpInfoType OnigOpInfo[] = {
{ OP_FINISH, "finish", ARG_NON },
@@ -6160,6 +6141,7 @@ OnigOpInfoType OnigOpInfo[] = {
{ OP_CCLASS_NOT, "cclass-not", ARG_SPECIAL },
{ OP_CCLASS_MB_NOT, "cclass-mb-not", ARG_SPECIAL },
{ OP_CCLASS_MIX_NOT, "cclass-mix-not", ARG_SPECIAL },
+ { OP_CCLASS_NODE, "cclass-node", ARG_SPECIAL },
{ OP_ANYCHAR, "anychar", ARG_NON },
{ OP_ANYCHAR_ML, "anychar-ml", ARG_NON },
{ OP_ANYCHAR_STAR, "anychar*", ARG_NON },
@@ -6184,6 +6166,7 @@ OnigOpInfoType OnigOpInfo[] = {
{ OP_END_LINE, "end-line", ARG_NON },
{ OP_SEMI_END_BUF, "semi-end-buf", ARG_NON },
{ OP_BEGIN_POSITION, "begin-position", ARG_NON },
+ { OP_BEGIN_POS_OR_LINE, "begin-pos-or-line", ARG_NON },
{ OP_BACKREF1, "backref1", ARG_NON },
{ OP_BACKREF2, "backref2", ARG_NON },
{ OP_BACKREFN, "backrefn", ARG_MEMNUM },
@@ -6225,9 +6208,6 @@ OnigOpInfoType OnigOpInfo[] = {
{ OP_LOOK_BEHIND, "look-behind", ARG_SPECIAL },
{ OP_PUSH_LOOK_BEHIND_NOT, "push-look-behind-not", ARG_SPECIAL },
{ OP_FAIL_LOOK_BEHIND_NOT, "fail-look-behind-not", ARG_NON },
- { OP_PUSH_ABSENT_POS, "push-absent-pos", ARG_NON },
- { OP_ABSENT, "absent", ARG_RELADDR },
- { OP_ABSENT_END, "absent-end", ARG_NON },
{ OP_CALL, "call", ARG_ABSADDR },
{ OP_RETURN, "return", ARG_NON },
{ OP_CONDITION, "condition", ARG_SPECIAL },
@@ -6264,17 +6244,15 @@ op2arg_type(int opcode)
return ARG_SPECIAL;
}
-# ifdef ONIG_DEBUG_PARSE_TREE
static void
Indent(FILE* f, int indent)
{
int i;
for (i = 0; i < indent; i++) putc(' ', f);
}
-# endif /* ONIG_DEBUG_PARSE_TREE */
static void
-p_string(FILE* f, ptrdiff_t len, UChar* s)
+p_string(FILE* f, int len, UChar* s)
{
fputs(":", f);
while (len-- > 0) { fputc(*s++, f); }
@@ -6310,7 +6288,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
break;
case ARG_RELADDR:
GET_RELADDR_INC(addr, bp);
- fprintf(f, ":(%s%d)", (addr >= 0) ? "+" : "", addr);
+ fprintf(f, ":(%d)", addr);
break;
case ARG_ABSADDR:
GET_ABSADDR_INC(addr, bp);
@@ -6415,9 +6393,9 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
case OP_CCLASS_MB_NOT:
GET_LENGTH_INC(len, bp);
q = bp;
-# ifndef PLATFORM_UNALIGNED_WORD_ACCESS
+#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
ALIGNMENT_RIGHT(q);
-# endif
+#endif
GET_CODE_POINT(code, q);
bp += len;
fprintf(f, ":%d:%d", (int )code, len);
@@ -6429,14 +6407,24 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
bp += SIZE_BITSET;
GET_LENGTH_INC(len, bp);
q = bp;
-# ifndef PLATFORM_UNALIGNED_WORD_ACCESS
+#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
ALIGNMENT_RIGHT(q);
-# endif
+#endif
GET_CODE_POINT(code, q);
bp += len;
fprintf(f, ":%d:%d:%d", n, (int )code, len);
break;
+ case OP_CCLASS_NODE:
+ {
+ CClassNode *cc;
+
+ GET_POINTER_INC(cc, bp);
+ n = bitset_on_num(cc->bs);
+ fprintf(f, ":%"PRIuPTR":%d", (uintptr_t )cc, n);
+ }
+ break;
+
case OP_BACKREFN_IC:
mem = *((MemNumType* )bp);
bp += SIZE_MEMNUM;
@@ -6489,7 +6477,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
case OP_PUSH_IF_PEEK_NEXT:
addr = *((RelAddrType* )bp);
bp += SIZE_RELADDR;
- fprintf(f, ":(%s%d)", (addr >= 0) ? "+" : "", addr);
+ fprintf(f, ":(%d)", addr);
p_string(f, 1, bp);
bp += 1;
break;
@@ -6502,7 +6490,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
case OP_PUSH_LOOK_BEHIND_NOT:
GET_RELADDR_INC(addr, bp);
GET_LENGTH_INC(len, bp);
- fprintf(f, ":%d:(%s%d)", len, (addr >= 0) ? "+" : "", addr);
+ fprintf(f, ":%d:(%d)", len, addr);
break;
case OP_STATE_CHECK_PUSH:
@@ -6511,25 +6499,24 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp,
bp += SIZE_STATE_CHECK_NUM;
addr = *((RelAddrType* )bp);
bp += SIZE_RELADDR;
- fprintf(f, ":%d:(%s%d)", scn, (addr >= 0) ? "+" : "", addr);
+ fprintf(f, ":%d:(%d)", scn, addr);
break;
case OP_CONDITION:
GET_MEMNUM_INC(mem, bp);
GET_RELADDR_INC(addr, bp);
- fprintf(f, ":%d:(%s%d)", mem, (addr >= 0) ? "+" : "", addr);
+ fprintf(f, ":%d:(%d)", mem, addr);
break;
default:
fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n",
- bp[-1]);
+ *--bp);
}
}
fputs("]", f);
if (nextp) *nextp = bp;
}
-# ifdef ONIG_DEBUG_COMPILE
static void
print_compiled_byte_code_list(FILE* f, regex_t* reg)
{
@@ -6551,9 +6538,7 @@ print_compiled_byte_code_list(FILE* f, regex_t* reg)
fprintf(f, "\n");
}
-# endif /* ONIG_DEBUG_COMPILE */
-# ifdef ONIG_DEBUG_PARSE_TREE
static void
print_indent_tree(FILE* f, Node* node, int indent)
{
@@ -6600,15 +6585,12 @@ print_indent_tree(FILE* f, Node* node, int indent)
case NT_CCLASS:
fprintf(f, "<cclass:%"PRIxPTR">", (intptr_t )node);
- if (IS_NCCLASS_NOT(NCCLASS(node))) fputs("not ", f);
+ if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f);
if (NCCLASS(node)->mbuf) {
BBuf* bbuf = NCCLASS(node)->mbuf;
- OnigCodePoint* data = (OnigCodePoint* )bbuf->p;
- OnigCodePoint* end = (OnigCodePoint* )(bbuf->p + bbuf->used);
- fprintf(f, "%d", *data++);
- for (; data < end; data+=2) {
- fprintf(f, ",");
- fprintf(f, "%04x-%04x", data[0], data[1]);
+ for (i = 0; i < (int )bbuf->used; i++) {
+ if (i > 0) fprintf(f, ",");
+ fprintf(f, "%0x", bbuf->p[i]);
}
}
break;
@@ -6642,13 +6624,14 @@ print_indent_tree(FILE* f, Node* node, int indent)
case ANCHOR_END_LINE: fputs("end line", f); break;
case ANCHOR_SEMI_END_BUF: fputs("semi end buf", f); break;
case ANCHOR_BEGIN_POSITION: fputs("begin position", f); break;
+ case ANCHOR_ANYCHAR_STAR: fputs("begin position/line", f); break;
case ANCHOR_WORD_BOUND: fputs("word bound", f); break;
case ANCHOR_NOT_WORD_BOUND: fputs("not word bound", f); break;
-# ifdef USE_WORD_BEGIN_END
+#ifdef USE_WORD_BEGIN_END
case ANCHOR_WORD_BEGIN: fputs("word begin", f); break;
case ANCHOR_WORD_END: fputs("word end", f); break;
-# endif
+#endif
case ANCHOR_PREC_READ: fputs("prec read", f); container_p = TRUE; break;
case ANCHOR_PREC_READ_NOT: fputs("prec read not", f); container_p = TRUE; break;
case ANCHOR_LOOK_BEHIND: fputs("look_behind", f); container_p = TRUE; break;
@@ -6674,7 +6657,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
}
break;
-# ifdef USE_SUBEXP_CALL
+#ifdef USE_SUBEXP_CALL
case NT_CALL:
{
CallNode* cn = NCALL(node);
@@ -6682,7 +6665,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
p_string(f, cn->name_end - cn->name, cn->name);
}
break;
-# endif
+#endif
case NT_QTFR:
fprintf(f, "<quantifier:%"PRIxPTR">{%d,%d}%s\n", (intptr_t )node,
@@ -6706,9 +6689,6 @@ print_indent_tree(FILE* f, Node* node, int indent)
case ENCLOSE_CONDITION:
fprintf(f, "condition:%d", NENCLOSE(node)->regnum);
break;
- case ENCLOSE_ABSENT:
- fprintf(f, "absent");
- break;
default:
break;
@@ -6730,11 +6710,12 @@ print_indent_tree(FILE* f, Node* node, int indent)
fflush(f);
}
+#endif /* ONIG_DEBUG */
+#ifdef ONIG_DEBUG_PARSE_TREE
static void
print_tree(FILE* f, Node* node)
{
print_indent_tree(f, node, 0);
}
-# endif /* ONIG_DEBUG_PARSE_TREE */
-#endif /* ONIG_DEBUG */
+#endif
diff --git a/regenc.c b/regenc.c
index 16d62fdf40..2683b826f2 100644
--- a/regenc.c
+++ b/regenc.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,11 +54,11 @@ onigenc_set_default_encoding(OnigEncoding enc)
extern int
onigenc_mbclen_approximate(const OnigUChar* p,const OnigUChar* e, OnigEncoding enc)
{
- int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e);
+ int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e);
if (ONIGENC_MBCLEN_CHARFOUND_P(ret))
return ONIGENC_MBCLEN_CHARFOUND_LEN(ret);
else if (ONIGENC_MBCLEN_NEEDMORE_P(ret))
- return (int )(e - p) + ONIGENC_MBCLEN_NEEDMORE_LEN(ret);
+ return (int)(e-p)+ONIGENC_MBCLEN_NEEDMORE_LEN(ret);
return 1;
}
@@ -364,14 +364,12 @@ const UChar OnigEncISO_8859_1_ToUpperCaseTable[256] = {
};
#endif
-#if 0
extern void
onigenc_set_default_caseconv_table(const UChar* table ARG_UNUSED)
{
/* nothing */
/* obsoleted. */
}
-#endif
extern UChar*
onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s, const UChar* end)
@@ -633,10 +631,8 @@ onigenc_single_byte_code_to_mbclen(OnigCodePoint code ARG_UNUSED, OnigEncoding e
extern int
onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
{
-#ifdef RUBY
if (code > 0xff)
rb_raise(rb_eRangeError, "%u out of char range", code);
-#endif
*buf = (UChar )(code & 0xff);
return 1;
}
@@ -794,7 +790,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
}
extern int
-onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
+onigenc_minimum_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
static const PosixBracketEntryType PBS[] = {
POSIX_BRACKET_ENTRY_INIT("Alnum", ONIGENC_CTYPE_ALNUM),
@@ -896,7 +892,6 @@ onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end,
return 0;
}
-#if 0
/* Property management */
static int
resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize)
@@ -907,15 +902,13 @@ resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize)
size = sizeof(OnigCodePoint*) * new_size;
if (IS_NULL(list)) {
list = (const OnigCodePoint** )xmalloc(size);
- if (IS_NULL(list)) return ONIGERR_MEMORY;
}
else {
- const OnigCodePoint **tmp;
- tmp = (const OnigCodePoint** )xrealloc((void* )list, size);
- if (IS_NULL(tmp)) return ONIGERR_MEMORY;
- list = tmp;
+ list = (const OnigCodePoint** )xrealloc((void* )list, size);
}
+ if (IS_NULL(list)) return ONIGERR_MEMORY;
+
*plist = list;
*psize = new_size;
@@ -949,64 +942,16 @@ onigenc_property_list_add_property(UChar* name, const OnigCodePoint* prop,
(hash_data_type )(*pnum + ONIGENC_MAX_STD_CTYPE));
return 0;
}
-#endif
extern int
-onigenc_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end,
- OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc)
+onigenc_property_list_init(int (*f)(void))
{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
- int codepoint_length;
-
- while (*pp < end && to < to_end) {
- codepoint_length = ONIGENC_PRECISE_MBC_ENC_LEN(enc, *pp, end);
- if (codepoint_length < 0)
- return codepoint_length; /* encoding invalid */
- code = ONIGENC_MBC_TO_CODE(enc, *pp, end);
- *pp += codepoint_length;
-
- if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- code += 'A' - 'a';
- } else if (code >= 'A' && code <= 'Z' &&
- (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code += 'a' - 'A';
- }
- to += ONIGENC_CODE_TO_MBC(enc, code, to);
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
-}
+ int r;
-extern int
-onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
- const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
- const struct OnigEncodingTypeST* enc)
-{
- OnigCodePoint code;
- OnigUChar *to_start = to;
- OnigCaseFoldType flags = *flagP;
-
- while (*pp < end && to < to_end) {
- code = *(*pp)++;
-
- if (code >= 'a' && code <= 'z' && (flags & ONIGENC_CASE_UPCASE)) {
- flags |= ONIGENC_CASE_MODIFIED;
- code += 'A' - 'a';
- } else if (code >= 'A' && code <= 'Z' &&
- (flags & (ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_FOLD))) {
- flags |= ONIGENC_CASE_MODIFIED;
- code += 'a' - 'A';
- }
- *to++ = code;
- if (flags & ONIGENC_CASE_TITLECASE) /* switch from titlecase to lowercase for capitalize */
- flags ^= (ONIGENC_CASE_UPCASE | ONIGENC_CASE_DOWNCASE | ONIGENC_CASE_TITLECASE);
- }
- *flagP = flags;
- return (int )(to - to_start);
+ THREAD_ATOMIC_START;
+
+ r = f();
+
+ THREAD_ATOMIC_END;
+ return r;
}
diff --git a/regenc.h b/regenc.h
index 969e114bfd..5e467961a1 100644
--- a/regenc.h
+++ b/regenc.h
@@ -1,11 +1,11 @@
-#ifndef ONIGMO_REGENC_H
-#define ONIGMO_REGENC_H
+#ifndef ONIGURUMA_REGENC_H
+#define ONIGURUMA_REGENC_H
/**********************************************************************
regenc.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,32 +30,18 @@
* SUCH DAMAGE.
*/
-#if !defined(RUBY) && (defined(RUBY_EXPORT) || defined(ONIG_ENC_REGISTER))
-# define RUBY
+#ifndef REGINT_H
+#ifndef RUBY_EXTERN
+#include "ruby/config.h"
+#include "ruby/defines.h"
+#endif
#endif
-#ifdef RUBY
-# ifndef ONIGMO_REGINT_H
-# ifndef RUBY_EXTERN
-# include "ruby/config.h"
-# include "ruby/defines.h"
-# endif
-# endif
-#else /* RUBY */
-# ifndef PACKAGE
-/* PACKAGE is defined in config.h */
-# include "config.h"
-# endif
-#endif /* RUBY */
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
-# undef ONIG_ESCAPE_UCHAR_COLLISION
+#undef ONIG_ESCAPE_UCHAR_COLLISION
#endif
-#ifdef RUBY
-# include "ruby/onigmo.h"
-#else
-# include "onigmo.h"
-#endif
+#include "ruby/oniguruma.h"
RUBY_SYMBOL_EXPORT_BEGIN
@@ -66,23 +52,23 @@ typedef struct {
#ifndef NULL
-# define NULL ((void* )0)
+#define NULL ((void* )0)
#endif
#ifndef TRUE
-# define TRUE 1
+#define TRUE 1
#endif
#ifndef FALSE
-# define FALSE 0
+#define FALSE 0
#endif
#ifndef ARG_UNUSED
-# if defined(__GNUC__)
+#if defined(__GNUC__)
# define ARG_UNUSED __attribute__ ((unused))
-# else
+#else
# define ARG_UNUSED
-# endif
+#endif
#endif
#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0)
@@ -125,7 +111,7 @@ typedef struct {
{(short int )(sizeof(name) - 1), (name), (ctype)}
#ifndef numberof
-# define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
+#define numberof(array) (int )(sizeof(array) / sizeof((array)[0]))
#endif
@@ -139,56 +125,50 @@ typedef struct {
#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
/* for encoding system implementation (internal) */
-ONIG_EXTERN int onigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
-ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc);
-ONIG_EXTERN int onigenc_apply_all_case_fold_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);
-ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map(int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
-ONIG_EXTERN int onigenc_not_support_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
-ONIG_EXTERN int onigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end, OnigEncoding enc);
-ONIG_EXTERN int onigenc_single_byte_ascii_only_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
+ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
+ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc));
+ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
+ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
+ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
+ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end, OnigEncoding enc));
/* methods for single byte encoding */
-ONIG_EXTERN int onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc);
-ONIG_EXTERN int onigenc_single_byte_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc);
-ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc);
-ONIG_EXTERN int onigenc_single_byte_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
-ONIG_EXTERN int onigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc);
-ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head(const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc);
-ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
-ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc);
-ONIG_EXTERN int onigenc_ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
+ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e, OnigEncoding enc));
+ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf, OnigEncoding enc));
+ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
+ONIG_EXTERN int onigenc_ascii_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
/* methods for multi byte encoding */
-ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end);
-ONIG_EXTERN int onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower);
-ONIG_EXTERN int onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
-ONIG_EXTERN int onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
-ONIG_EXTERN int onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
-ONIG_EXTERN int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end);
-ONIG_EXTERN int onigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
-ONIG_EXTERN int onigenc_mb4_code_to_mbclen(OnigCodePoint code, OnigEncoding enc);
-ONIG_EXTERN int onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf);
-ONIG_EXTERN int onigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code, unsigned int ctype);
-
-ONIG_EXTERN int onigenc_unicode_case_map(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
+ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
+ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
+ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
+ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
+ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
+ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
+ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
+ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
/* in enc/unicode.c */
-ONIG_EXTERN int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc);
-ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc);
-ONIG_EXTERN int onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]);
-ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]);
-ONIG_EXTERN int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold);
-ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc);
+ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
+ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
+ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));
+ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
+ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));
+ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, OnigEncoding enc));
#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)
-#define UNICODE_VALID_CODEPOINT_P(c) ( \
- ((c) <= 0x10ffff) && \
- !((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8)))
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
OnigEncISO_8859_1_ToLowerCaseTable[c]
@@ -199,14 +179,14 @@ ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[];
ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[];
ONIG_EXTERN int
-onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
+onigenc_with_ascii_strncmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));
ONIG_EXTERN int
-onigenc_with_ascii_strnicmp(OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n);
+onigenc_with_ascii_strnicmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));
ONIG_EXTERN UChar*
-onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n);
+onigenc_step P_((OnigEncoding enc, const UChar* p, const UChar* end, int n));
/* defined in regexec.c, but used in enc/xxx.c */
-extern int onig_is_in_code_range(const UChar* p, OnigCodePoint code);
+extern int onig_is_in_code_range P_((const UChar* p, OnigCodePoint code));
ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[];
@@ -229,9 +209,9 @@ ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
#ifdef ONIG_ENC_REGISTER
extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
-# define OnigEncodingName(n) encoding_##n
-# define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n)
-# define OnigEncodingDefine(f,n) \
+#define OnigEncodingName(n) encoding_##n
+#define OnigEncodingDeclare(n) static const OnigEncodingType OnigEncodingName(n)
+#define OnigEncodingDefine(f,n) \
OnigEncodingDeclare(n); \
void Init_##f(void) { \
ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
@@ -239,9 +219,9 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
} \
OnigEncodingDeclare(n)
#else
-# define OnigEncodingName(n) OnigEncoding##n
-# define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n)
-# define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
+#define OnigEncodingName(n) OnigEncoding##n
+#define OnigEncodingDeclare(n) const OnigEncodingType OnigEncodingName(n)
+#define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
#endif
/* macros for define replica encoding and encoding alias */
@@ -251,4 +231,4 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
RUBY_SYMBOL_EXPORT_END
-#endif /* ONIGMO_REGENC_H */
+#endif /* ONIGURUMA_REGENC_H */
diff --git a/regerror.c b/regerror.c
index aff6354196..9ec3f65f4c 100644
--- a/regerror.c
+++ b/regerror.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 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
@@ -31,7 +31,13 @@
#include "regint.h"
#include <stdio.h> /* for vsnprintf() */
+#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
extern UChar*
onig_error_code_to_format(OnigPosition code)
@@ -59,8 +65,6 @@ onig_error_code_to_format(OnigPosition code)
p = "unexpected bytecode (bug)"; break;
case ONIGERR_MATCH_STACK_LIMIT_OVER:
p = "match-stack limit over"; break;
- case ONIGERR_PARSE_DEPTH_LIMIT_OVER:
- p = "parse depth limit over"; break;
case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET:
p = "default multibyte-encoding is not set"; break;
case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:
@@ -175,6 +179,8 @@ onig_error_code_to_format(OnigPosition code)
p = "not supported encoding combination"; break;
case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
p = "invalid combination of options"; break;
+ case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
+ p = "over thread pass limit count"; break;
default:
p = "undefined error code"; break;
@@ -185,12 +191,12 @@ onig_error_code_to_format(OnigPosition code)
static void sprint_byte(char* s, unsigned int v)
{
- xsnprintf(s, 3, "%02x", (v & 0377));
+ sprintf(s, "%02x", (v & 0377));
}
static void sprint_byte_with_x(char* s, unsigned int v)
{
- xsnprintf(s, 5, "\\x%02x", (v & 0377));
+ sprintf(s, "\\x%02x", (v & 0377));
}
static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
@@ -246,7 +252,14 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
#define MAX_ERROR_PAR_LEN 30
extern int
+#ifdef HAVE_STDARG_PROTOTYPES
onig_error_code_to_str(UChar* s, OnigPosition code, ...)
+#else
+onig_error_code_to_str(s, code, va_alist)
+ UChar* s;
+ OnigPosition code;
+ va_dcl
+#endif
{
UChar *p, *q;
OnigErrorInfo* einfo;
@@ -255,7 +268,7 @@ onig_error_code_to_str(UChar* s, OnigPosition code, ...)
UChar parbuf[MAX_ERROR_PAR_LEN];
va_list vargs;
- va_start(vargs, code);
+ va_init_list(vargs, code);
switch (code) {
case ONIGERR_UNDEFINED_NAME_REFERENCE:
@@ -324,18 +337,26 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
need = (pat_end - pat) * 4 + 4;
if (n + need < (size_t )bufsize) {
- static const char sep[] = ": /";
- memcpy((char* )buf + n, sep, sizeof(sep));
+ strcat((char* )buf, ": /");
s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
p = pat;
while (p < pat_end) {
- if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
+ if (*p == '\\') {
+ *s++ = *p++;
+ len = enclen(enc, p, pat_end);
+ while (len-- > 0) *s++ = *p++;
+ }
+ else if (*p == '/') {
+ *s++ = (unsigned char )'\\';
+ *s++ = *p++;
+ }
+ else if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
len = enclen(enc, p, pat_end);
if (ONIGENC_MBC_MINLEN(enc) == 1) {
while (len-- > 0) *s++ = *p++;
}
- else { /* for UTF16/32 */
+ else { /* for UTF16 */
int blen;
while (len-- > 0) {
@@ -346,15 +367,6 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
}
}
}
- else if (*p == '\\') {
- *s++ = *p++;
- len = enclen(enc, p, pat_end);
- while (len-- > 0) *s++ = *p++;
- }
- else if (*p == '/') {
- *s++ = (unsigned char )'\\';
- *s++ = *p++;
- }
else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
!ONIGENC_IS_CODE_SPACE(enc, *p)) {
sprint_byte_with_x((char* )bs, (unsigned int )(*p++));
@@ -372,15 +384,25 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
}
}
-#if 0 /* unused */
void
+#ifdef HAVE_STDARG_PROTOTYPES
onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
UChar* pat, UChar* pat_end, const UChar *fmt, ...)
+#else
+onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
+ UChar buf[];
+ int bufsize;
+ OnigEncoding enc;
+ UChar* pat;
+ UChar* pat_end;
+ const UChar *fmt;
+ va_dcl
+#endif
{
va_list args;
- va_start(args, fmt);
+ va_init_list(args, fmt);
onig_vsnprintf_with_pattern(buf, bufsize, enc,
pat, pat_end, fmt, args);
va_end(args);
}
-#endif
+
diff --git a/regexec.c b/regexec.c
index 4582c35c3f..1336468a74 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 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
@@ -30,39 +30,13 @@
#include "regint.h"
-#ifdef RUBY
-# undef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-#else
-# define USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-#endif
-
-#ifndef USE_TOKEN_THREADED_VM
-# ifdef __GNUC__
-# define USE_TOKEN_THREADED_VM 1
-# else
-# define USE_TOKEN_THREADED_VM 0
-# endif
-#endif
-
-#ifdef RUBY
-# define ENC_DUMMY_FLAG (1<<24)
-static inline int
-rb_enc_asciicompat(OnigEncoding enc)
-{
- return ONIGENC_MBC_MINLEN(enc)==1 && !((enc)->ruby_encoding_index & ENC_DUMMY_FLAG);
-}
-# undef ONIGENC_IS_MBC_ASCII_WORD
-# define ONIGENC_IS_MBC_ASCII_WORD(enc,s,end) \
- (rb_enc_asciicompat(enc) ? (ISALNUM(*s) || *s=='_') : \
- onigenc_ascii_is_code_ctype( \
- ONIGENC_MBC_TO_CODE(enc,s,end),ONIGENC_CTYPE_WORD,enc))
-#endif /* RUBY */
+/* #define USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
#ifdef USE_CRNL_AS_LINE_TERMINATOR
-# define ONIGENC_IS_MBC_CRNL(enc,p,end) \
+#define ONIGENC_IS_MBC_CRNL(enc,p,end) \
(ONIGENC_MBC_TO_CODE(enc,p,end) == 13 && \
ONIGENC_MBC_TO_CODE(enc,(p+enclen(enc,p,end)),end) == 10)
-# define ONIGENC_IS_MBC_NEWLINE_EX(enc,p,start,end,option,check_prev) \
+#define ONIGENC_IS_MBC_NEWLINE_EX(enc,p,start,end,option,check_prev) \
is_mbc_newline_ex((enc),(p),(start),(end),(option),(check_prev))
static int
is_mbc_newline_ex(OnigEncoding enc, const UChar *p, const UChar *start,
@@ -96,7 +70,7 @@ is_mbc_newline_ex(OnigEncoding enc, const UChar *p, const UChar *start,
}
}
#else /* USE_CRNL_AS_LINE_TERMINATOR */
-# define ONIGENC_IS_MBC_NEWLINE_EX(enc,p,start,end,option,check_prev) \
+#define ONIGENC_IS_MBC_NEWLINE_EX(enc,p,start,end,option,check_prev) \
ONIGENC_IS_MBC_NEWLINE((enc), (p), (end))
#endif /* USE_CRNL_AS_LINE_TERMINATOR */
@@ -111,7 +85,7 @@ history_tree_clear(OnigCaptureTreeNode* node)
if (IS_NOT_NULL(node)) {
for (i = 0; i < node->num_childs; i++) {
if (IS_NOT_NULL(node->childs[i])) {
- history_tree_free(node->childs[i]);
+ history_tree_free(node->childs[i]);
}
}
for (i = 0; i < node->allocated; i++) {
@@ -162,7 +136,7 @@ history_node_new(void)
static int
history_tree_add_child(OnigCaptureTreeNode* parent, OnigCaptureTreeNode* child)
{
-# define HISTORY_TREE_INIT_ALLOC_SIZE 8
+#define HISTORY_TREE_INIT_ALLOC_SIZE 8
if (parent->num_childs >= parent->allocated) {
int n, i;
@@ -170,15 +144,15 @@ history_tree_add_child(OnigCaptureTreeNode* parent, OnigCaptureTreeNode* child)
if (IS_NULL(parent->childs)) {
n = HISTORY_TREE_INIT_ALLOC_SIZE;
parent->childs =
- (OnigCaptureTreeNode** )xmalloc(sizeof(OnigCaptureTreeNode*) * n);
+ (OnigCaptureTreeNode** )xmalloc(sizeof(OnigCaptureTreeNode*) * n);
CHECK_NULL_RETURN_MEMERR(parent->childs);
}
else {
OnigCaptureTreeNode** tmp;
n = parent->allocated * 2;
tmp =
- (OnigCaptureTreeNode** )xrealloc(parent->childs,
- sizeof(OnigCaptureTreeNode*) * n);
+ (OnigCaptureTreeNode** )xrealloc(parent->childs,
+ sizeof(OnigCaptureTreeNode*) * n);
if (tmp == 0) {
history_tree_clear(parent);
return ONIGERR_MEMORY;
@@ -354,7 +328,7 @@ onig_region_free(OnigRegion* r, int free_self)
}
extern void
-onig_region_copy(OnigRegion* to, const OnigRegion* from)
+onig_region_copy(OnigRegion* to, OnigRegion* from)
{
#define RREGC_SIZE (sizeof(int) * from->num_regs)
int i, r;
@@ -403,8 +377,6 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
#define STK_CALL_FRAME 0x0800
#define STK_RETURN 0x0900
#define STK_VOID 0x0a00 /* for fill a blank */
-#define STK_ABSENT_POS 0x0b00 /* for absent */
-#define STK_ABSENT 0x0c00 /* absent inner loop marker */
/* stack type check mask */
#define STK_MASK_POP_USED 0x00ff
@@ -412,7 +384,7 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
#define STK_MASK_MEM_END_OR_MARK 0x8000 /* MEM_END or MEM_END_MARK */
#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-# define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) do {\
+#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) do {\
(msa).stack_p = (void* )0;\
(msa).options = (arg_option);\
(msa).region = (arg_region);\
@@ -421,7 +393,7 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
(msa).best_len = ONIG_MISMATCH;\
} while(0)
#else
-# define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) do {\
+#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) do {\
(msa).stack_p = (void* )0;\
(msa).options = (arg_option);\
(msa).region = (arg_region);\
@@ -432,9 +404,9 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
#ifdef USE_COMBINATION_EXPLOSION_CHECK
-# define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16
+#define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16
-# define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) do { \
+#define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) do { \
if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) {\
unsigned int size = (unsigned int )(((str_len) + 1) * (state_num) + 7) >> 3;\
offset = ((offset) * (state_num)) >> 3;\
@@ -460,14 +432,14 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from)
}\
} while(0)
-# define MATCH_ARG_FREE(msa) do {\
+#define MATCH_ARG_FREE(msa) do {\
if ((msa).stack_p) xfree((msa).stack_p);\
if ((msa).state_check_buff_size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) { \
if ((msa).state_check_buff) xfree((msa).state_check_buff);\
}\
} while(0)
#else /* USE_COMBINATION_EXPLOSION_CHECK */
-# define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)
+#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)
#endif /* USE_COMBINATION_EXPLOSION_CHECK */
@@ -556,9 +528,9 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
n *= 2;
if (limit_size != 0 && n > limit_size) {
if ((unsigned int )(stk_end - stk_base) == limit_size)
- return ONIGERR_MATCH_STACK_LIMIT_OVER;
+ return ONIGERR_MATCH_STACK_LIMIT_OVER;
else
- n = limit_size;
+ n = limit_size;
}
x = (OnigStackType* )xrealloc(stk_base, sizeof(OnigStackType) * n);
if (IS_NULL(x)) {
@@ -595,9 +567,9 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
#define IS_TO_VOID_TARGET(stk) (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)
#ifdef USE_COMBINATION_EXPLOSION_CHECK
-# define STATE_CHECK_POS(s,snum) \
+#define STATE_CHECK_POS(s,snum) \
(((s) - str) * num_comb_exp_check + ((snum) - 1))
-# define STATE_CHECK_VAL(v,snum) do {\
+#define STATE_CHECK_VAL(v,snum) do {\
if (state_check_buff != NULL) {\
int x = STATE_CHECK_POS(s,snum);\
(v) = state_check_buff[x/8] & (1<<(x%8));\
@@ -606,13 +578,13 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
} while(0)
-# define ELSE_IF_STATE_CHECK_MARK(stk) \
+#define ELSE_IF_STATE_CHECK_MARK(stk) \
else if ((stk)->type == STK_STATE_CHECK_MARK) { \
int x = STATE_CHECK_POS(stk->u.state.pstr, stk->u.state.state_check);\
state_check_buff[x/8] |= (1<<(x%8)); \
}
-# define STACK_PUSH(stack_type,pat,s,sprev,keep) do {\
+#define STACK_PUSH(stack_type,pat,s,sprev,keep) do {\
STACK_ENSURE(1);\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
@@ -623,14 +595,14 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
STACK_INC;\
} while(0)
-# define STACK_PUSH_ENSURED(stack_type,pat) do {\
+#define STACK_PUSH_ENSURED(stack_type,pat) do {\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
stk->u.state.state_check = 0;\
STACK_INC;\
} while(0)
-# define STACK_PUSH_ALT_WITH_STATE_CHECK(pat,s,sprev,snum,keep) do {\
+#define STACK_PUSH_ALT_WITH_STATE_CHECK(pat,s,sprev,snum,keep) do {\
STACK_ENSURE(1);\
stk->type = STK_ALT;\
stk->u.state.pcode = (pat);\
@@ -641,7 +613,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
STACK_INC;\
} while(0)
-# define STACK_PUSH_STATE_CHECK(s,snum) do {\
+#define STACK_PUSH_STATE_CHECK(s,snum) do {\
if (state_check_buff != NULL) {\
STACK_ENSURE(1);\
stk->type = STK_STATE_CHECK_MARK;\
@@ -653,9 +625,9 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
#else /* USE_COMBINATION_EXPLOSION_CHECK */
-# define ELSE_IF_STATE_CHECK_MARK(stk)
+#define ELSE_IF_STATE_CHECK_MARK(stk)
-# define STACK_PUSH(stack_type,pat,s,sprev,keep) do {\
+#define STACK_PUSH(stack_type,pat,s,sprev,keep) do {\
STACK_ENSURE(1);\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
@@ -665,7 +637,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
STACK_INC;\
} while(0)
-# define STACK_PUSH_ENSURED(stack_type,pat) do {\
+#define STACK_PUSH_ENSURED(stack_type,pat) do {\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
STACK_INC;\
@@ -675,8 +647,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
#define STACK_PUSH_ALT(pat,s,sprev,keep) STACK_PUSH(STK_ALT,pat,s,sprev,keep)
#define STACK_PUSH_POS(s,sprev,keep) STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev,keep)
#define STACK_PUSH_POS_NOT(pat,s,sprev,keep) STACK_PUSH(STK_POS_NOT,pat,s,sprev,keep)
-#define STACK_PUSH_ABSENT STACK_PUSH_TYPE(STK_ABSENT)
-#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT)
+#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT)
#define STACK_PUSH_LOOK_BEHIND_NOT(pat,s,sprev,keep) \
STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev,keep)
@@ -788,23 +759,15 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
STACK_INC;\
} while(0)
-#define STACK_PUSH_ABSENT_POS(start, end) do {\
- STACK_ENSURE(1);\
- stk->type = STK_ABSENT_POS;\
- stk->u.absent_pos.abs_pstr = (start);\
- stk->u.absent_pos.end_pstr = (end);\
- STACK_INC;\
-} while(0)
-
#ifdef ONIG_DEBUG
-# define STACK_BASE_CHECK(p, at) \
+#define STACK_BASE_CHECK(p, at) \
if ((p) < stk_base) {\
fprintf(stderr, "at %s\n", at);\
goto stack_error;\
}
#else
-# define STACK_BASE_CHECK(p, at)
+#define STACK_BASE_CHECK(p, at)
#endif
#define STACK_POP_ONE do {\
@@ -896,33 +859,6 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
}\
} while(0)
-#define STACK_POP_TIL_ABSENT do {\
- while (1) {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP_TIL_ABSENT"); \
- if (stk->type == STK_ABSENT) break;\
- else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- else if (stk->type == STK_REPEAT_INC) {\
- STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
- }\
- else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
- mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
- }\
- ELSE_IF_STATE_CHECK_MARK(stk);\
- }\
-} while(0)
-
-#define STACK_POP_ABSENT_POS(start, end) do {\
- stk--;\
- STACK_BASE_CHECK(stk, "STACK_POP_ABSENT_POS"); \
- (start) = stk->u.absent_pos.abs_pstr;\
- (end) = stk->u.absent_pos.end_pstr;\
-} while(0)
-
#define STACK_POS_END(k) do {\
k = stk;\
while (1) {\
@@ -1168,18 +1104,16 @@ static int string_cmp_ic(OnigEncoding enc, int case_fold_flag,
#define IS_EMPTY_STR (str == end)
-#define ON_STR_BEGIN(s) ((s) == str)
-#define ON_STR_END(s) ((s) == end)
+#define ON_STR_BEGIN(s) ((s) == str)
+#define ON_STR_END(s) ((s) == end)
#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-# define DATA_ENSURE_CHECK1 (s < right_range)
-# define DATA_ENSURE_CHECK(n) (s + (n) <= right_range)
-# define DATA_ENSURE(n) if (s + (n) > right_range) goto fail
-# define ABSENT_END_POS right_range
+#define DATA_ENSURE_CHECK1 (s < right_range)
+#define DATA_ENSURE_CHECK(n) (s + (n) <= right_range)
+#define DATA_ENSURE(n) if (s + (n) > right_range) goto fail
#else
-# define DATA_ENSURE_CHECK1 (s < end)
-# define DATA_ENSURE_CHECK(n) (s + (n) <= end)
-# define DATA_ENSURE(n) if (s + (n) > end) goto fail
-# define ABSENT_END_POS end
+#define DATA_ENSURE_CHECK1 (s < end)
+#define DATA_ENSURE_CHECK(n) (s + (n) <= end)
+#define DATA_ENSURE(n) if (s + (n) > end) goto fail
#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
@@ -1196,29 +1130,29 @@ make_capture_history_tree(OnigCaptureTreeNode* node, OnigStackType** kp,
if (k->type == STK_MEM_START) {
n = k->u.mem.num;
if (n <= ONIG_MAX_CAPTURE_HISTORY_GROUP &&
- BIT_STATUS_AT(reg->capture_history, n) != 0) {
- child = history_node_new();
- CHECK_NULL_RETURN_MEMERR(child);
- child->group = n;
- child->beg = k->u.mem.pstr - str;
- r = history_tree_add_child(node, child);
- if (r != 0) {
- history_tree_free(child);
- return r;
- }
- *kp = (k + 1);
- r = make_capture_history_tree(child, kp, stk_top, str, reg);
- if (r != 0) return r;
-
- k = *kp;
- child->end = k->u.mem.pstr - str;
+ BIT_STATUS_AT(reg->capture_history, n) != 0) {
+ child = history_node_new();
+ CHECK_NULL_RETURN_MEMERR(child);
+ child->group = n;
+ child->beg = k->u.mem.pstr - str;
+ r = history_tree_add_child(node, child);
+ if (r != 0) {
+ history_tree_free(child);
+ return r;
+ }
+ *kp = (k + 1);
+ r = make_capture_history_tree(child, kp, stk_top, str, reg);
+ if (r != 0) return r;
+
+ k = *kp;
+ child->end = k->u.mem.pstr - str;
}
}
else if (k->type == STK_MEM_END) {
if (k->u.mem.num == node->group) {
- node->end = k->u.mem.pstr - str;
- *kp = k;
- return 0;
+ node->end = k->u.mem.pstr - str;
+ *kp = k;
+ return 0;
}
}
k++;
@@ -1241,10 +1175,10 @@ static int mem_is_in_memp(int mem, int num, UChar* memp)
return 0;
}
-static int backref_match_at_nested_level(regex_t* reg,
- OnigStackType* top, OnigStackType* stk_base,
- int ignore_case, int case_fold_flag,
- int nest, int mem_num, UChar* memp, UChar** s, const UChar* send)
+static int backref_match_at_nested_level(regex_t* reg
+ , OnigStackType* top, OnigStackType* stk_base
+ , int ignore_case, int case_fold_flag
+ , int nest, int mem_num, UChar* memp, UChar** s, const UChar* send)
{
UChar *ss, *p, *pstart, *pend = NULL_UCHARP;
int level;
@@ -1301,37 +1235,27 @@ static int backref_match_at_nested_level(regex_t* reg,
#ifdef ONIG_DEBUG_STATISTICS
-# ifdef _WIN32
-# include <windows.h>
-static LARGE_INTEGER ts, te, freq;
-# define GETTIME(t) QueryPerformanceCounter(&(t))
-# define TIMEDIFF(te,ts) (unsigned long )(((te).QuadPart - (ts).QuadPart) \
- * 1000000 / freq.QuadPart)
-# else /* _WIN32 */
-
-# define USE_TIMEOFDAY
-
-# ifdef USE_TIMEOFDAY
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# endif
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
+#define USE_TIMEOFDAY
+
+#ifdef USE_TIMEOFDAY
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
static struct timeval ts, te;
-# define GETTIME(t) gettimeofday(&(t), (struct timezone* )0)
-# define TIMEDIFF(te,ts) (((te).tv_usec - (ts).tv_usec) + \
- (((te).tv_sec - (ts).tv_sec)*1000000))
-# else /* USE_TIMEOFDAY */
-# ifdef HAVE_SYS_TIMES_H
-# include <sys/times.h>
-# endif
+#define GETTIME(t) gettimeofday(&(t), (struct timezone* )0)
+#define TIMEDIFF(te,ts) (((te).tv_usec - (ts).tv_usec) + \
+ (((te).tv_sec - (ts).tv_sec)*1000000))
+#else /* USE_TIMEOFDAY */
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
static struct tms ts, te;
-# define GETTIME(t) times(&(t))
-# define TIMEDIFF(te,ts) ((te).tms_utime - (ts).tms_utime)
-# endif /* USE_TIMEOFDAY */
-
-# endif /* _WIN32 */
+#define GETTIME(t) times(&(t))
+#define TIMEDIFF(te,ts) ((te).tms_utime - (ts).tms_utime)
+#endif /* USE_TIMEOFDAY */
static int OpCounter[256];
static int OpPrevCounter[256];
@@ -1340,14 +1264,14 @@ static int OpCurr = OP_FINISH;
static int OpPrevTarget = OP_FAIL;
static int MaxStackDepth = 0;
-# define MOP_IN(opcode) do {\
+#define MOP_IN(opcode) do {\
if (opcode == OpPrevTarget) OpPrevCounter[OpCurr]++;\
OpCurr = opcode;\
OpCounter[opcode]++;\
GETTIME(ts);\
} while(0)
-# define MOP_OUT do {\
+#define MOP_OUT do {\
GETTIME(te);\
OpTime[OpCurr] += TIMEDIFF(te, ts);\
} while(0)
@@ -1360,9 +1284,6 @@ onig_statistics_init(void)
OpCounter[i] = OpPrevCounter[i] = 0; OpTime[i] = 0;
}
MaxStackDepth = 0;
-# ifdef _WIN32
- QueryPerformanceFrequency(&freq);
-# endif
}
extern void
@@ -1371,53 +1292,34 @@ onig_print_statistics(FILE* f)
int i;
fprintf(f, " count prev time\n");
for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {
- fprintf(f, "%8d: %8d: %10lu: %s\n",
+ fprintf(f, "%8d: %8d: %10ld: %s\n",
OpCounter[i], OpPrevCounter[i], OpTime[i], OnigOpInfo[i].name);
}
fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth);
}
-# define STACK_INC do {\
+#define STACK_INC do {\
stk++;\
if (stk - stk_base > MaxStackDepth) \
MaxStackDepth = stk - stk_base;\
} while(0)
#else /* ONIG_DEBUG_STATISTICS */
-# define STACK_INC stk++
+#define STACK_INC stk++
-# define MOP_IN(opcode)
-# define MOP_OUT
+#define MOP_IN(opcode)
+#define MOP_OUT
#endif /* ONIG_DEBUG_STATISTICS */
-#ifdef ONIG_DEBUG_MATCH
-static char *
-stack_type_str(int stack_type)
-{
- switch (stack_type) {
- case STK_ALT: return "Alt ";
- case STK_LOOK_BEHIND_NOT: return "LBNot ";
- case STK_POS_NOT: return "PosNot";
- case STK_MEM_START: return "MemS ";
- case STK_MEM_END: return "MemE ";
- case STK_REPEAT_INC: return "RepInc";
- case STK_STATE_CHECK_MARK: return "StChMk";
- case STK_NULL_CHECK_START: return "NulChS";
- case STK_NULL_CHECK_END: return "NulChE";
- case STK_MEM_END_MARK: return "MemEMk";
- case STK_POS: return "Pos ";
- case STK_STOP_BT: return "StopBt";
- case STK_REPEAT: return "Rep ";
- case STK_CALL_FRAME: return "Call ";
- case STK_RETURN: return "Ret ";
- case STK_VOID: return "Void ";
- case STK_ABSENT_POS: return "AbsPos";
- case STK_ABSENT: return "Absent";
- default: return " ";
- }
-}
-#endif
+
+/* matching region of POSIX API */
+typedef int regoff_t;
+
+typedef struct {
+ regoff_t rm_so;
+ regoff_t rm_eo;
+} posix_regmatch_t;
/* match data(str - end) from position (sstart). */
/* if sstart == str then set sprev to NULL. */
@@ -1454,209 +1356,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
int num_comb_exp_check = reg->num_comb_exp_check;
#endif
-#if USE_TOKEN_THREADED_VM
-# define OP_OFFSET 1
-# define VM_LOOP JUMP;
-# define VM_LOOP_END
-# define CASE(x) L_##x: sbegin = s; OPCODE_EXEC_HOOK;
-# define DEFAULT L_DEFAULT:
-# define NEXT sprev = sbegin; JUMP
-# define JUMP goto *oplabels[*p++]
-
- static const void *oplabels[] = {
- &&L_OP_FINISH, /* matching process terminator (no more alternative) */
- &&L_OP_END, /* pattern code terminator (success end) */
-
- &&L_OP_EXACT1, /* single byte, N = 1 */
- &&L_OP_EXACT2, /* single byte, N = 2 */
- &&L_OP_EXACT3, /* single byte, N = 3 */
- &&L_OP_EXACT4, /* single byte, N = 4 */
- &&L_OP_EXACT5, /* single byte, N = 5 */
- &&L_OP_EXACTN, /* single byte */
- &&L_OP_EXACTMB2N1, /* mb-length = 2 N = 1 */
- &&L_OP_EXACTMB2N2, /* mb-length = 2 N = 2 */
- &&L_OP_EXACTMB2N3, /* mb-length = 2 N = 3 */
- &&L_OP_EXACTMB2N, /* mb-length = 2 */
- &&L_OP_EXACTMB3N, /* mb-length = 3 */
- &&L_OP_EXACTMBN, /* other length */
-
- &&L_OP_EXACT1_IC, /* single byte, N = 1, ignore case */
- &&L_OP_EXACTN_IC, /* single byte, ignore case */
-
- &&L_OP_CCLASS,
- &&L_OP_CCLASS_MB,
- &&L_OP_CCLASS_MIX,
- &&L_OP_CCLASS_NOT,
- &&L_OP_CCLASS_MB_NOT,
- &&L_OP_CCLASS_MIX_NOT,
-
- &&L_OP_ANYCHAR, /* "." */
- &&L_OP_ANYCHAR_ML, /* "." multi-line */
- &&L_OP_ANYCHAR_STAR, /* ".*" */
- &&L_OP_ANYCHAR_ML_STAR, /* ".*" multi-line */
- &&L_OP_ANYCHAR_STAR_PEEK_NEXT,
- &&L_OP_ANYCHAR_ML_STAR_PEEK_NEXT,
-
- &&L_OP_WORD,
- &&L_OP_NOT_WORD,
- &&L_OP_WORD_BOUND,
- &&L_OP_NOT_WORD_BOUND,
-# ifdef USE_WORD_BEGIN_END
- &&L_OP_WORD_BEGIN,
- &&L_OP_WORD_END,
-# else
- &&L_DEFAULT,
- &&L_DEFAULT,
-# endif
- &&L_OP_ASCII_WORD,
- &&L_OP_NOT_ASCII_WORD,
- &&L_OP_ASCII_WORD_BOUND,
- &&L_OP_NOT_ASCII_WORD_BOUND,
-# ifdef USE_WORD_BEGIN_END
- &&L_OP_ASCII_WORD_BEGIN,
- &&L_OP_ASCII_WORD_END,
-# else
- &&L_DEFAULT,
- &&L_DEFAULT,
-# endif
-
- &&L_OP_BEGIN_BUF,
- &&L_OP_END_BUF,
- &&L_OP_BEGIN_LINE,
- &&L_OP_END_LINE,
- &&L_OP_SEMI_END_BUF,
- &&L_OP_BEGIN_POSITION,
-
- &&L_OP_BACKREF1,
- &&L_OP_BACKREF2,
- &&L_OP_BACKREFN,
- &&L_OP_BACKREFN_IC,
- &&L_OP_BACKREF_MULTI,
- &&L_OP_BACKREF_MULTI_IC,
-# ifdef USE_BACKREF_WITH_LEVEL
- &&L_OP_BACKREF_WITH_LEVEL, /* \k<xxx+n>, \k<xxx-n> */
-# else
- &&L_DEFAULT,
-# endif
- &&L_OP_MEMORY_START,
- &&L_OP_MEMORY_START_PUSH, /* push back-tracker to stack */
- &&L_OP_MEMORY_END_PUSH, /* push back-tracker to stack */
-# ifdef USE_SUBEXP_CALL
- &&L_OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */
-# else
- &&L_DEFAULT,
-# endif
- &&L_OP_MEMORY_END,
-# ifdef USE_SUBEXP_CALL
- &&L_OP_MEMORY_END_REC, /* push marker to stack */
-# else
- &&L_DEFAULT,
-# endif
-
- &&L_OP_KEEP,
-
- &&L_OP_FAIL, /* pop stack and move */
- &&L_OP_JUMP,
- &&L_OP_PUSH,
- &&L_OP_POP,
-# ifdef USE_OP_PUSH_OR_JUMP_EXACT
- &&L_OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */
-# else
- &&L_DEFAULT,
-# endif
- &&L_OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */
- &&L_OP_REPEAT, /* {n,m} */
- &&L_OP_REPEAT_NG, /* {n,m}? (non greedy) */
- &&L_OP_REPEAT_INC,
- &&L_OP_REPEAT_INC_NG, /* non greedy */
- &&L_OP_REPEAT_INC_SG, /* search and get in stack */
- &&L_OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */
- &&L_OP_NULL_CHECK_START, /* null loop checker start */
- &&L_OP_NULL_CHECK_END, /* null loop checker end */
-# ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
- &&L_OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */
-# else
- &&L_DEFAULT,
-# endif
-# ifdef USE_SUBEXP_CALL
- &&L_OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */
-# else
- &&L_DEFAULT,
-# endif
-
- &&L_OP_PUSH_POS, /* (?=...) start */
- &&L_OP_POP_POS, /* (?=...) end */
- &&L_OP_PUSH_POS_NOT, /* (?!...) start */
- &&L_OP_FAIL_POS, /* (?!...) end */
- &&L_OP_PUSH_STOP_BT, /* (?>...) start */
- &&L_OP_POP_STOP_BT, /* (?>...) end */
- &&L_OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */
- &&L_OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */
- &&L_OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
- &&L_OP_PUSH_ABSENT_POS, /* (?~...) start */
- &&L_OP_ABSENT, /* (?~...) start of inner loop */
- &&L_OP_ABSENT_END, /* (?~...) end */
-
-# ifdef USE_SUBEXP_CALL
- &&L_OP_CALL, /* \g<name> */
- &&L_OP_RETURN,
-# else
- &&L_DEFAULT,
- &&L_DEFAULT,
-# endif
- &&L_OP_CONDITION,
-
-# ifdef USE_COMBINATION_EXPLOSION_CHECK
- &&L_OP_STATE_CHECK_PUSH, /* combination explosion check and push */
- &&L_OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */
- &&L_OP_STATE_CHECK, /* check only */
-# else
- &&L_DEFAULT,
- &&L_DEFAULT,
- &&L_DEFAULT,
-# endif
-# ifdef USE_COMBINATION_EXPLOSION_CHECK
- &&L_OP_STATE_CHECK_ANYCHAR_STAR,
- &&L_OP_STATE_CHECK_ANYCHAR_ML_STAR,
-# else
- &&L_DEFAULT,
- &&L_DEFAULT,
-# endif
- /* no need: IS_DYNAMIC_OPTION() == 0 */
-# if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */
- &&L_OP_SET_OPTION_PUSH, /* set option and push recover option */
- &&L_OP_SET_OPTION /* set option */
-# else
- &&L_DEFAULT,
- &&L_DEFAULT
-# endif
- };
-#else /* USE_TOKEN_THREADED_VM */
-
-# define OP_OFFSET 0
-# define VM_LOOP \
- while (1) { \
- OPCODE_EXEC_HOOK; \
- sbegin = s; \
- switch (*p++) {
-# define VM_LOOP_END } sprev = sbegin; }
-# define CASE(x) case x:
-# define DEFAULT default:
-# define NEXT break
-# define JUMP continue; break
-#endif /* USE_TOKEN_THREADED_VM */
-
-
#ifdef USE_SUBEXP_CALL
-/* Stack #0 is used to store the pattern itself and used for (?R), \g<0>,
- etc. Additional space is required. */
-# define ADD_NUMMEM 1
-#else
-/* Stack #0 not is used. */
-# define ADD_NUMMEM 0
-#endif
-
- n = reg->num_repeat + (reg->num_mem + ADD_NUMMEM) * 2;
+ /* Stack #0 is used to store the pattern itself and used for (?R), \g<0>, etc. */
+ n = reg->num_repeat + (reg->num_mem + 1) * 2;
STACK_INIT(alloca_base, xmalloc_base, n, INIT_MATCH_STACK_SIZE);
pop_level = reg->stack_pop_level;
@@ -1664,69 +1366,68 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
repeat_stk = (OnigStackIndex* )alloca_base;
mem_start_stk = (OnigStackIndex* )(repeat_stk + reg->num_repeat);
- mem_end_stk = mem_start_stk + (num_mem + ADD_NUMMEM);
- {
- OnigStackIndex *pp = mem_start_stk;
- for (; pp < repeat_stk + n; pp += 2) {
- pp[0] = INVALID_STACK_INDEX;
- pp[1] = INVALID_STACK_INDEX;
- }
+ mem_end_stk = mem_start_stk + (num_mem + 1);
+ for (i = 0; i <= num_mem; i++) {
+ mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;
}
-#ifndef USE_SUBEXP_CALL
+#else /* USE_SUBEXP_CALL */
+ /* Stack #0 not is used. */
+ n = reg->num_repeat + reg->num_mem * 2;
+
+ STACK_INIT(alloca_base, xmalloc_base, n, INIT_MATCH_STACK_SIZE);
+ pop_level = reg->stack_pop_level;
+ num_mem = reg->num_mem;
+ repeat_stk = (OnigStackIndex* )alloca_base;
+
+ mem_start_stk = (OnigStackIndex* )(repeat_stk + reg->num_repeat);
+ mem_end_stk = mem_start_stk + num_mem;
mem_start_stk--; /* for index start from 1,
mem_start_stk[1]..mem_start_stk[num_mem] */
mem_end_stk--; /* for index start from 1,
mem_end_stk[1]..mem_end_stk[num_mem] */
-#endif
+ for (i = 1; i <= num_mem; i++) {
+ mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;
+ }
+#endif /* USE_SUBEXP_CALL */
#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "match_at: str: %"PRIuPTR" (%p), end: %"PRIuPTR" (%p), start: %"PRIuPTR" (%p), sprev: %"PRIuPTR" (%p)\n",
- (uintptr_t )str, str, (uintptr_t )end, end, (uintptr_t )sstart, sstart, (uintptr_t )sprev, sprev);
+ fprintf(stderr, "match_at: str: %"PRIdPTR" (%p), end: %"PRIdPTR" (%p), start: %"PRIdPTR" (%p), sprev: %"PRIdPTR" (%p)\n",
+ (intptr_t )str, str, (intptr_t )end, end, (intptr_t )sstart, sstart, (intptr_t )sprev, sprev);
fprintf(stderr, "size: %d, start offset: %d\n",
(int )(end - str), (int )(sstart - str));
- fprintf(stderr, "\n ofs> str stk:type addr:opcode\n");
#endif
STACK_PUSH_ENSURED(STK_ALT, (UChar* )FinishCode); /* bottom stack */
best_len = ONIG_MISMATCH;
s = (UChar* )sstart;
pkeep = (UChar* )sstart;
-
-
+ while (1) {
#ifdef ONIG_DEBUG_MATCH
-# define OPCODE_EXEC_HOOK \
- if (s) { \
- UChar *op, *q, *bp, buf[50]; \
- int len; \
- op = p - OP_OFFSET; \
- fprintf(stderr, "%4"PRIdPTR"> \"", (*op == OP_FINISH) ? (ptrdiff_t )-1 : s - str); \
- bp = buf; \
- q = s; \
- if (*op != OP_FINISH) { /* s may not be a valid pointer if OP_FINISH. */ \
- for (i = 0; i < 7 && q < end; i++) { \
- len = enclen(encode, q, end); \
- while (len-- > 0) *bp++ = *q++; \
- } \
- if (q < end) { xmemcpy(bp, "...", 3); bp += 3; } \
- } \
- xmemcpy(bp, "\"", 1); bp += 1; \
- *bp = 0; \
- fputs((char* )buf, stderr); \
- for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr); \
- fprintf(stderr, "%4"PRIdPTR":%s %4"PRIdPTR":", \
- stk - stk_base - 1, \
- (stk > stk_base) ? stack_type_str(stk[-1].type) : " ", \
- (op == FinishCode) ? (ptrdiff_t )-1 : op - reg->p); \
- onig_print_compiled_byte_code(stderr, op, reg->p+reg->used, NULL, encode); \
- fprintf(stderr, "\n"); \
+ if (s) {
+ UChar *q, *bp, buf[50];
+ int len;
+ fprintf(stderr, "%4"PRIdPTR"> \"", (*p == OP_FINISH) ? (ptrdiff_t )-1 : s - str);
+ bp = buf;
+ if (*p != OP_FINISH) { /* s may not be a valid pointer if OP_FINISH. */
+ for (i = 0, q = s; i < 7 && q < end; i++) {
+ len = enclen(encode, q, end);
+ while (len-- > 0) *bp++ = *q++;
+ }
+ }
+ if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; }
+ else { xmemcpy(bp, "\"", 1); bp += 1; }
+ *bp = 0;
+ fputs((char* )buf, stderr);
+ for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr);
+ fprintf(stderr, "%4"PRIdPTR":", (p == FinishCode) ? (ptrdiff_t )-1 : p - reg->p);
+ onig_print_compiled_byte_code(stderr, p, p + strlen((char *)p), NULL, encode);
+ fprintf(stderr, "\n");
}
-#else
-# define OPCODE_EXEC_HOOK ((void) 0)
#endif
-
- VM_LOOP {
- CASE(OP_END) MOP_IN(OP_END);
+ sbegin = s;
+ switch (*p++) {
+ case OP_END: MOP_IN(OP_END);
n = s - sstart;
if (n > best_len) {
OnigRegion* region;
@@ -1738,56 +1439,83 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
else
goto end_best_len;
- }
+ }
#endif
best_len = n;
region = msa->region;
if (region) {
- region->beg[0] = ((pkeep > s) ? s : pkeep) - str;
- region->end[0] = s - str;
- for (i = 1; i <= num_mem; i++) {
- if (mem_end_stk[i] != INVALID_STACK_INDEX) {
- if (BIT_STATUS_AT(reg->bt_mem_start, i))
- region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
- else
- region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str;
-
- region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i)
+#ifdef USE_POSIX_API_REGION_OPTION
+ if (IS_POSIX_REGION(msa->options)) {
+ posix_regmatch_t* rmt = (posix_regmatch_t* )region;
+
+ rmt[0].rm_so = (regoff_t )(((pkeep > s) ? s : pkeep) - str);
+ rmt[0].rm_eo = (regoff_t )(s - str);
+ for (i = 1; i <= num_mem; i++) {
+ if (mem_end_stk[i] != INVALID_STACK_INDEX) {
+ if (BIT_STATUS_AT(reg->bt_mem_start, i))
+ rmt[i].rm_so = (regoff_t )(STACK_AT(mem_start_stk[i])->u.mem.pstr - str);
+ else
+ rmt[i].rm_so = (regoff_t )((UChar* )((void* )(mem_start_stk[i])) - str);
+
+ rmt[i].rm_eo = (regoff_t )((BIT_STATUS_AT(reg->bt_mem_end, i)
? STACK_AT(mem_end_stk[i])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[i])) - str;
- }
- else {
- region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
+ : (UChar* )((void* )mem_end_stk[i])) - str);
+ }
+ else {
+ rmt[i].rm_so = rmt[i].rm_eo = ONIG_REGION_NOTPOS;
+ }
}
}
-
-#ifdef USE_CAPTURE_HISTORY
- if (reg->capture_history != 0) {
- int r;
- OnigCaptureTreeNode* node;
-
- if (IS_NULL(region->history_root)) {
- region->history_root = node = history_node_new();
- CHECK_NULL_RETURN_MEMERR(node);
- }
- else {
- node = region->history_root;
- history_tree_clear(node);
+ else {
+#endif /* USE_POSIX_API_REGION_OPTION */
+ region->beg[0] = ((pkeep > s) ? s : pkeep) - str;
+ region->end[0] = s - str;
+ for (i = 1; i <= num_mem; i++) {
+ if (mem_end_stk[i] != INVALID_STACK_INDEX) {
+ if (BIT_STATUS_AT(reg->bt_mem_start, i))
+ region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
+ else
+ region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str;
+
+ region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i)
+ ? STACK_AT(mem_end_stk[i])->u.mem.pstr
+ : (UChar* )((void* )mem_end_stk[i])) - str;
+ }
+ else {
+ region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
+ }
}
- node->group = 0;
- node->beg = ((pkeep > s) ? s : pkeep) - str;
- node->end = s - str;
-
- stkp = stk_base;
- r = make_capture_history_tree(region->history_root, &stkp,
- stk, (UChar* )str, reg);
- if (r < 0) {
- best_len = r; /* error code */
- goto finish;
+#ifdef USE_CAPTURE_HISTORY
+ if (reg->capture_history != 0) {
+ int r;
+ OnigCaptureTreeNode* node;
+
+ if (IS_NULL(region->history_root)) {
+ region->history_root = node = history_node_new();
+ CHECK_NULL_RETURN_MEMERR(node);
+ }
+ else {
+ node = region->history_root;
+ history_tree_clear(node);
+ }
+
+ node->group = 0;
+ node->beg = ((pkeep > s) ? s : pkeep) - str;
+ node->end = s - str;
+
+ stkp = stk_base;
+ r = make_capture_history_tree(region->history_root, &stkp,
+ stk, (UChar* )str, reg);
+ if (r < 0) {
+ best_len = r; /* error code */
+ goto finish;
+ }
}
- }
#endif /* USE_CAPTURE_HISTORY */
+#ifdef USE_POSIX_API_REGION_OPTION
+ } /* else IS_POSIX_REGION() */
+#endif
} /* if (region) */
} /* n > best_len */
@@ -1808,16 +1536,21 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
/* default behavior: return first-matching result. */
goto finish;
- NEXT;
+ break;
- CASE(OP_EXACT1) MOP_IN(OP_EXACT1);
+ case OP_EXACT1: MOP_IN(OP_EXACT1);
+#if 0
DATA_ENSURE(1);
if (*p != *s) goto fail;
p++; s++;
+#endif
+ if (*p != *s++) goto fail;
+ DATA_ENSURE(0);
+ p++;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_EXACT1_IC) MOP_IN(OP_EXACT1_IC);
+ case OP_EXACT1_IC: MOP_IN(OP_EXACT1_IC);
{
int len;
UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
@@ -1831,15 +1564,15 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
q = lowbuf;
while (len-- > 0) {
if (*p != *q) {
- goto fail;
- }
+ goto fail;
+ }
p++; q++;
}
}
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_EXACT2) MOP_IN(OP_EXACT2);
+ case OP_EXACT2: MOP_IN(OP_EXACT2);
DATA_ENSURE(2);
if (*p != *s) goto fail;
p++; s++;
@@ -1847,9 +1580,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = s;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACT3) MOP_IN(OP_EXACT3);
+ case OP_EXACT3: MOP_IN(OP_EXACT3);
DATA_ENSURE(3);
if (*p != *s) goto fail;
p++; s++;
@@ -1859,9 +1593,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = s;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACT4) MOP_IN(OP_EXACT4);
+ case OP_EXACT4: MOP_IN(OP_EXACT4);
DATA_ENSURE(4);
if (*p != *s) goto fail;
p++; s++;
@@ -1873,9 +1608,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = s;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACT5) MOP_IN(OP_EXACT5);
+ case OP_EXACT5: MOP_IN(OP_EXACT5);
DATA_ENSURE(5);
if (*p != *s) goto fail;
p++; s++;
@@ -1889,9 +1625,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = s;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTN) MOP_IN(OP_EXACTN);
+ case OP_EXACTN: MOP_IN(OP_EXACTN);
GET_LENGTH_INC(tlen, p);
DATA_ENSURE(tlen);
while (tlen-- > 0) {
@@ -1899,9 +1636,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
sprev = s - 1;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTN_IC) MOP_IN(OP_EXACTN_IC);
+ case OP_EXACTN_IC: MOP_IN(OP_EXACTN_IC);
{
int len;
UChar *q, *endp, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
@@ -1926,18 +1664,19 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTMB2N1) MOP_IN(OP_EXACTMB2N1);
+ case OP_EXACTMB2N1: MOP_IN(OP_EXACTMB2N1);
DATA_ENSURE(2);
if (*p != *s) goto fail;
p++; s++;
if (*p != *s) goto fail;
p++; s++;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_EXACTMB2N2) MOP_IN(OP_EXACTMB2N2);
+ case OP_EXACTMB2N2: MOP_IN(OP_EXACTMB2N2);
DATA_ENSURE(4);
if (*p != *s) goto fail;
p++; s++;
@@ -1949,9 +1688,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
if (*p != *s) goto fail;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTMB2N3) MOP_IN(OP_EXACTMB2N3);
+ case OP_EXACTMB2N3: MOP_IN(OP_EXACTMB2N3);
DATA_ENSURE(6);
if (*p != *s) goto fail;
p++; s++;
@@ -1967,9 +1707,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
if (*p != *s) goto fail;
p++; s++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTMB2N) MOP_IN(OP_EXACTMB2N);
+ case OP_EXACTMB2N: MOP_IN(OP_EXACTMB2N);
GET_LENGTH_INC(tlen, p);
DATA_ENSURE(tlen * 2);
while (tlen-- > 0) {
@@ -1980,9 +1721,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
sprev = s - 2;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTMB3N) MOP_IN(OP_EXACTMB3N);
+ case OP_EXACTMB3N: MOP_IN(OP_EXACTMB3N);
GET_LENGTH_INC(tlen, p);
DATA_ENSURE(tlen * 3);
while (tlen-- > 0) {
@@ -1995,9 +1737,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
sprev = s - 3;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_EXACTMBN) MOP_IN(OP_EXACTMBN);
+ case OP_EXACTMBN: MOP_IN(OP_EXACTMBN);
GET_LENGTH_INC(tlen, p); /* mb-len */
GET_LENGTH_INC(tlen2, p); /* string len */
tlen2 *= tlen;
@@ -2008,17 +1751,18 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
sprev = s - tlen;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_CCLASS) MOP_IN(OP_CCLASS);
+ case OP_CCLASS: MOP_IN(OP_CCLASS);
DATA_ENSURE(1);
if (BITSET_AT(((BitSetRef )p), *s) == 0) goto fail;
p += SIZE_BITSET;
s += enclen(encode, s, end); /* OP_CCLASS can match mb-code. \D, \S */
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_CCLASS_MB) MOP_IN(OP_CCLASS_MB);
+ case OP_CCLASS_MB: MOP_IN(OP_CCLASS_MB);
if (! ONIGENC_IS_MBC_HEAD(encode, s, end)) goto fail;
cclass_mb:
@@ -2045,9 +1789,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
p += tlen;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_CCLASS_MIX) MOP_IN(OP_CCLASS_MIX);
+ case OP_CCLASS_MIX: MOP_IN(OP_CCLASS_MIX);
DATA_ENSURE(1);
if (ONIGENC_IS_MBC_HEAD(encode, s, end)) {
p += SIZE_BITSET;
@@ -2063,17 +1807,17 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
s++;
}
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_CCLASS_NOT) MOP_IN(OP_CCLASS_NOT);
+ case OP_CCLASS_NOT: MOP_IN(OP_CCLASS_NOT);
DATA_ENSURE(1);
if (BITSET_AT(((BitSetRef )p), *s) != 0) goto fail;
p += SIZE_BITSET;
s += enclen(encode, s, end);
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_CCLASS_MB_NOT) MOP_IN(OP_CCLASS_MB_NOT);
+ case OP_CCLASS_MB_NOT: MOP_IN(OP_CCLASS_MB_NOT);
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_HEAD(encode, s, end)) {
s++;
@@ -2090,7 +1834,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
int mb_len = enclen(encode, s, end);
if (! DATA_ENSURE_CHECK(mb_len)) {
- DATA_ENSURE(1);
+ DATA_ENSURE(1);
s = (UChar* )end;
p += tlen;
goto cc_mb_not_success;
@@ -2112,9 +1856,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
cc_mb_not_success:
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_CCLASS_MIX_NOT) MOP_IN(OP_CCLASS_MIX_NOT);
+ case OP_CCLASS_MIX_NOT: MOP_IN(OP_CCLASS_MIX_NOT);
DATA_ENSURE(1);
if (ONIGENC_IS_MBC_HEAD(encode, s, end)) {
p += SIZE_BITSET;
@@ -2130,38 +1874,57 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
s++;
}
MOP_OUT;
- NEXT;
+ break;
+
+ case OP_CCLASS_NODE: MOP_IN(OP_CCLASS_NODE);
+ {
+ OnigCodePoint code;
+ void *node;
+ int mb_len;
+ UChar *ss;
+
+ DATA_ENSURE(1);
+ GET_POINTER_INC(node, p);
+ mb_len = enclen(encode, s, end);
+ ss = s;
+ s += mb_len;
+ DATA_ENSURE(0);
+ code = ONIGENC_MBC_TO_CODE(encode, ss, s);
+ if (onig_is_code_in_cc_len(mb_len, code, node) == 0) goto fail;
+ }
+ MOP_OUT;
+ break;
- CASE(OP_ANYCHAR) MOP_IN(OP_ANYCHAR);
+ case OP_ANYCHAR: MOP_IN(OP_ANYCHAR);
DATA_ENSURE(1);
n = enclen(encode, s, end);
DATA_ENSURE(n);
if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
s += n;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_ANYCHAR_ML) MOP_IN(OP_ANYCHAR_ML);
+ case OP_ANYCHAR_ML: MOP_IN(OP_ANYCHAR_ML);
DATA_ENSURE(1);
n = enclen(encode, s, end);
DATA_ENSURE(n);
s += n;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_ANYCHAR_STAR) MOP_IN(OP_ANYCHAR_STAR);
+ case OP_ANYCHAR_STAR: MOP_IN(OP_ANYCHAR_STAR);
while (DATA_ENSURE_CHECK1) {
STACK_PUSH_ALT(p, s, sprev, pkeep);
n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
- sprev = s;
- s += n;
+ DATA_ENSURE(n);
+ if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
+ sprev = s;
+ s += n;
}
MOP_OUT;
- JUMP;
+ break;
- CASE(OP_ANYCHAR_ML_STAR) MOP_IN(OP_ANYCHAR_ML_STAR);
+ case OP_ANYCHAR_ML_STAR: MOP_IN(OP_ANYCHAR_ML_STAR);
while (DATA_ENSURE_CHECK1) {
STACK_PUSH_ALT(p, s, sprev, pkeep);
n = enclen(encode, s, end);
@@ -2176,24 +1939,24 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- JUMP;
+ break;
- CASE(OP_ANYCHAR_STAR_PEEK_NEXT) MOP_IN(OP_ANYCHAR_STAR_PEEK_NEXT);
+ case OP_ANYCHAR_STAR_PEEK_NEXT: MOP_IN(OP_ANYCHAR_STAR_PEEK_NEXT);
while (DATA_ENSURE_CHECK1) {
if (*p == *s) {
STACK_PUSH_ALT(p + 1, s, sprev, pkeep);
}
n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
- sprev = s;
- s += n;
+ DATA_ENSURE(n);
+ if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
+ sprev = s;
+ s += n;
}
p++;
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_ANYCHAR_ML_STAR_PEEK_NEXT)MOP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT);
+ case OP_ANYCHAR_ML_STAR_PEEK_NEXT:MOP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT);
while (DATA_ENSURE_CHECK1) {
if (*p == *s) {
STACK_PUSH_ALT(p + 1, s, sprev, pkeep);
@@ -2211,10 +1974,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
p++;
MOP_OUT;
- NEXT;
+ break;
#ifdef USE_COMBINATION_EXPLOSION_CHECK
- CASE(OP_STATE_CHECK_ANYCHAR_STAR) MOP_IN(OP_STATE_CHECK_ANYCHAR_STAR);
+ case OP_STATE_CHECK_ANYCHAR_STAR: MOP_IN(OP_STATE_CHECK_ANYCHAR_STAR);
GET_STATE_CHECK_NUM_INC(mem, p);
while (DATA_ENSURE_CHECK1) {
STATE_CHECK_VAL(scv, mem);
@@ -2222,15 +1985,15 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem, pkeep);
n = enclen(encode, s, end);
- DATA_ENSURE(n);
- if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
- sprev = s;
- s += n;
+ DATA_ENSURE(n);
+ if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 0)) goto fail;
+ sprev = s;
+ s += n;
}
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_STATE_CHECK_ANYCHAR_ML_STAR)
+ case OP_STATE_CHECK_ANYCHAR_ML_STAR:
MOP_IN(OP_STATE_CHECK_ANYCHAR_ML_STAR);
GET_STATE_CHECK_NUM_INC(mem, p);
@@ -2251,46 +2014,46 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- NEXT;
+ break;
#endif /* USE_COMBINATION_EXPLOSION_CHECK */
- CASE(OP_WORD) MOP_IN(OP_WORD);
+ case OP_WORD: MOP_IN(OP_WORD);
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_WORD(encode, s, end))
goto fail;
s += enclen(encode, s, end);
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_ASCII_WORD) MOP_IN(OP_ASCII_WORD);
+ case OP_ASCII_WORD: MOP_IN(OP_ASCII_WORD);
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_ASCII_WORD(encode, s, end))
goto fail;
s += enclen(encode, s, end);
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_NOT_WORD) MOP_IN(OP_NOT_WORD);
+ case OP_NOT_WORD: MOP_IN(OP_NOT_WORD);
DATA_ENSURE(1);
if (ONIGENC_IS_MBC_WORD(encode, s, end))
goto fail;
s += enclen(encode, s, end);
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_NOT_ASCII_WORD) MOP_IN(OP_NOT_ASCII_WORD);
+ case OP_NOT_ASCII_WORD: MOP_IN(OP_NOT_ASCII_WORD);
DATA_ENSURE(1);
if (ONIGENC_IS_MBC_ASCII_WORD(encode, s, end))
goto fail;
s += enclen(encode, s, end);
MOP_OUT;
- NEXT;
+ break;
- CASE(OP_WORD_BOUND) MOP_IN(OP_WORD_BOUND);
+ case OP_WORD_BOUND: MOP_IN(OP_WORD_BOUND);
if (ON_STR_BEGIN(s)) {
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_WORD(encode, s, end))
@@ -2306,9 +2069,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
goto fail;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_ASCII_WORD_BOUND) MOP_IN(OP_ASCII_WORD_BOUND);
+ case OP_ASCII_WORD_BOUND: MOP_IN(OP_ASCII_WORD_BOUND);
if (ON_STR_BEGIN(s)) {
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_ASCII_WORD(encode, s, end))
@@ -2324,9 +2088,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
goto fail;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_NOT_WORD_BOUND) MOP_IN(OP_NOT_WORD_BOUND);
+ case OP_NOT_WORD_BOUND: MOP_IN(OP_NOT_WORD_BOUND);
if (ON_STR_BEGIN(s)) {
if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end))
goto fail;
@@ -2341,9 +2106,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
goto fail;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_NOT_ASCII_WORD_BOUND) MOP_IN(OP_NOT_ASCII_WORD_BOUND);
+ case OP_NOT_ASCII_WORD_BOUND: MOP_IN(OP_NOT_ASCII_WORD_BOUND);
if (ON_STR_BEGIN(s)) {
if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_ASCII_WORD(encode, s, end))
goto fail;
@@ -2358,69 +2124,73 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
goto fail;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
#ifdef USE_WORD_BEGIN_END
- CASE(OP_WORD_BEGIN) MOP_IN(OP_WORD_BEGIN);
+ case OP_WORD_BEGIN: MOP_IN(OP_WORD_BEGIN);
if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end)) {
if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_WORD(encode, sprev, end)) {
MOP_OUT;
- JUMP;
+ continue;
}
}
goto fail;
- NEXT;
+ break;
- CASE(OP_ASCII_WORD_BEGIN) MOP_IN(OP_ASCII_WORD_BEGIN);
+ case OP_ASCII_WORD_BEGIN: MOP_IN(OP_ASCII_WORD_BEGIN);
if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) {
if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) {
MOP_OUT;
- JUMP;
+ continue;
}
}
goto fail;
- NEXT;
+ break;
- CASE(OP_WORD_END) MOP_IN(OP_WORD_END);
+ case OP_WORD_END: MOP_IN(OP_WORD_END);
if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_WORD(encode, sprev, end)) {
if (ON_STR_END(s) || !ONIGENC_IS_MBC_WORD(encode, s, end)) {
MOP_OUT;
- JUMP;
+ continue;
}
}
goto fail;
- NEXT;
+ break;
- CASE(OP_ASCII_WORD_END) MOP_IN(OP_ASCII_WORD_END);
+ case OP_ASCII_WORD_END: MOP_IN(OP_ASCII_WORD_END);
if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_ASCII_WORD(encode, sprev, end)) {
if (ON_STR_END(s) || !ONIGENC_IS_MBC_ASCII_WORD(encode, s, end)) {
MOP_OUT;
- JUMP;
+ continue;
}
}
goto fail;
- NEXT;
+ break;
#endif
- CASE(OP_BEGIN_BUF) MOP_IN(OP_BEGIN_BUF);
+ case OP_BEGIN_BUF: MOP_IN(OP_BEGIN_BUF);
if (! ON_STR_BEGIN(s)) goto fail;
if (IS_NOTBOS(msa->options)) goto fail;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_END_BUF) MOP_IN(OP_END_BUF);
+ case OP_END_BUF: MOP_IN(OP_END_BUF);
if (! ON_STR_END(s)) goto fail;
if (IS_NOTEOS(msa->options)) goto fail;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_BEGIN_LINE) MOP_IN(OP_BEGIN_LINE);
+ case OP_BEGIN_LINE: MOP_IN(OP_BEGIN_LINE);
+ op_begin_line:
if (ON_STR_BEGIN(s)) {
if (IS_NOTBOL(msa->options)) goto fail;
MOP_OUT;
- JUMP;
+ continue;
}
else if (ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)
#ifdef USE_CRNL_AS_LINE_TERMINATOR
@@ -2429,38 +2199,38 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
#endif
&& !ON_STR_END(s)) {
MOP_OUT;
- JUMP;
+ continue;
}
goto fail;
- NEXT;
+ break;
- CASE(OP_END_LINE) MOP_IN(OP_END_LINE);
+ case OP_END_LINE: MOP_IN(OP_END_LINE);
if (ON_STR_END(s)) {
#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE_EX(encode, sprev, str, end, option, 1)) {
#endif
if (IS_NOTEOL(msa->options)) goto fail;
MOP_OUT;
- JUMP;
+ continue;
#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
}
#endif
}
else if (ONIGENC_IS_MBC_NEWLINE_EX(encode, s, str, end, option, 1)) {
MOP_OUT;
- JUMP;
+ continue;
}
goto fail;
- NEXT;
+ break;
- CASE(OP_SEMI_END_BUF) MOP_IN(OP_SEMI_END_BUF);
+ case OP_SEMI_END_BUF: MOP_IN(OP_SEMI_END_BUF);
if (ON_STR_END(s)) {
#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
if (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE_EX(encode, sprev, str, end, option, 1)) {
#endif
if (IS_NOTEOL(msa->options)) goto fail;
MOP_OUT;
- JUMP;
+ continue;
#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE
}
#endif
@@ -2469,7 +2239,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
UChar* ss = s + enclen(encode, s, end);
if (ON_STR_END(ss)) {
MOP_OUT;
- JUMP;
+ continue;
}
#ifdef USE_CRNL_AS_LINE_TERMINATOR
else if (IS_NEWLINE_CRLF(option)
@@ -2477,61 +2247,75 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
ss += enclen(encode, ss, end);
if (ON_STR_END(ss)) {
MOP_OUT;
- JUMP;
+ continue;
}
}
#endif
}
goto fail;
- NEXT;
+ break;
- CASE(OP_BEGIN_POSITION) MOP_IN(OP_BEGIN_POSITION);
+ case OP_BEGIN_POSITION: MOP_IN(OP_BEGIN_POSITION);
if (s != msa->gpos)
goto fail;
MOP_OUT;
- JUMP;
+ continue;
+ break;
+
+ case OP_BEGIN_POS_OR_LINE: MOP_IN(OP_BEGIN_POS_OR_LINE);
+ if (s != msa->gpos)
+ goto op_begin_line;
+
+ MOP_OUT;
+ continue;
+ break;
- CASE(OP_MEMORY_START_PUSH) MOP_IN(OP_MEMORY_START_PUSH);
+ case OP_MEMORY_START_PUSH: MOP_IN(OP_MEMORY_START_PUSH);
GET_MEMNUM_INC(mem, p);
STACK_PUSH_MEM_START(mem, s);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_MEMORY_START) MOP_IN(OP_MEMORY_START);
+ case OP_MEMORY_START: MOP_IN(OP_MEMORY_START);
GET_MEMNUM_INC(mem, p);
mem_start_stk[mem] = (OnigStackIndex )((void* )s);
- mem_end_stk[mem] = INVALID_STACK_INDEX;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_MEMORY_END_PUSH) MOP_IN(OP_MEMORY_END_PUSH);
+ case OP_MEMORY_END_PUSH: MOP_IN(OP_MEMORY_END_PUSH);
GET_MEMNUM_INC(mem, p);
STACK_PUSH_MEM_END(mem, s);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_MEMORY_END) MOP_IN(OP_MEMORY_END);
+ case OP_MEMORY_END: MOP_IN(OP_MEMORY_END);
GET_MEMNUM_INC(mem, p);
mem_end_stk[mem] = (OnigStackIndex )((void* )s);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_KEEP) MOP_IN(OP_KEEP);
+ case OP_KEEP: MOP_IN(OP_KEEP);
pkeep = s;
MOP_OUT;
- JUMP;
+ continue;
+ break;
#ifdef USE_SUBEXP_CALL
- CASE(OP_MEMORY_END_PUSH_REC) MOP_IN(OP_MEMORY_END_PUSH_REC);
+ case OP_MEMORY_END_PUSH_REC: MOP_IN(OP_MEMORY_END_PUSH_REC);
GET_MEMNUM_INC(mem, p);
STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */
STACK_PUSH_MEM_END(mem, s);
mem_start_stk[mem] = GET_STACK_INDEX(stkp);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_MEMORY_END_REC) MOP_IN(OP_MEMORY_END_REC);
+ case OP_MEMORY_END_REC: MOP_IN(OP_MEMORY_END_REC);
GET_MEMNUM_INC(mem, p);
mem_end_stk[mem] = (OnigStackIndex )((void* )s);
STACK_GET_MEM_START(mem, stkp);
@@ -2543,20 +2327,21 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
STACK_PUSH_MEM_END_MARK(mem);
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif
- CASE(OP_BACKREF1) MOP_IN(OP_BACKREF1);
+ case OP_BACKREF1: MOP_IN(OP_BACKREF1);
mem = 1;
goto backref;
- NEXT;
+ break;
- CASE(OP_BACKREF2) MOP_IN(OP_BACKREF2);
+ case OP_BACKREF2: MOP_IN(OP_BACKREF2);
mem = 2;
goto backref;
- NEXT;
+ break;
- CASE(OP_BACKREFN) MOP_IN(OP_BACKREFN);
+ case OP_BACKREFN: MOP_IN(OP_BACKREFN);
GET_MEMNUM_INC(mem, p);
backref:
{
@@ -2585,10 +2370,11 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev += len;
MOP_OUT;
- JUMP;
+ continue;
}
+ break;
- CASE(OP_BACKREFN_IC) MOP_IN(OP_BACKREFN_IC);
+ case OP_BACKREFN_IC: MOP_IN(OP_BACKREFN_IC);
GET_MEMNUM_INC(mem, p);
{
int len;
@@ -2616,11 +2402,11 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev += len;
MOP_OUT;
- JUMP;
+ continue;
}
- NEXT;
+ break;
- CASE(OP_BACKREF_MULTI) MOP_IN(OP_BACKREF_MULTI);
+ case OP_BACKREF_MULTI: MOP_IN(OP_BACKREF_MULTI);
{
int len, is_fail;
UChar *pstart, *pend, *swork;
@@ -2655,11 +2441,11 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
if (i == tlen) goto fail;
MOP_OUT;
- JUMP;
+ continue;
}
- NEXT;
+ break;
- CASE(OP_BACKREF_MULTI_IC) MOP_IN(OP_BACKREF_MULTI_IC);
+ case OP_BACKREF_MULTI_IC: MOP_IN(OP_BACKREF_MULTI_IC);
{
int len, is_fail;
UChar *pstart, *pend, *swork;
@@ -2694,11 +2480,12 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
if (i == tlen) goto fail;
MOP_OUT;
- JUMP;
+ continue;
}
+ break;
#ifdef USE_BACKREF_WITH_LEVEL
- CASE(OP_BACKREF_WITH_LEVEL)
+ case OP_BACKREF_WITH_LEVEL:
{
int len;
OnigOptionType ic;
@@ -2709,8 +2496,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
GET_LENGTH_INC(tlen, p);
sprev = s;
- if (backref_match_at_nested_level(reg, stk, stk_base, ic,
- case_fold_flag, (int )level, (int )tlen, p, &s, end)) {
+ if (backref_match_at_nested_level(reg, stk, stk_base, ic
+ , case_fold_flag, (int )level, (int )tlen, p, &s, end)) {
while (sprev + (len = enclen(encode, sprev, end)) < s)
sprev += len;
@@ -2720,32 +2507,36 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
goto fail;
MOP_OUT;
- JUMP;
+ continue;
}
+ break;
#endif
#if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */
- CASE(OP_SET_OPTION_PUSH) MOP_IN(OP_SET_OPTION_PUSH);
+ case OP_SET_OPTION_PUSH: MOP_IN(OP_SET_OPTION_PUSH);
GET_OPTION_INC(option, p);
STACK_PUSH_ALT(p, s, sprev, pkeep);
p += SIZE_OP_SET_OPTION + SIZE_OP_FAIL;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_SET_OPTION) MOP_IN(OP_SET_OPTION);
+ case OP_SET_OPTION: MOP_IN(OP_SET_OPTION);
GET_OPTION_INC(option, p);
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif
- CASE(OP_NULL_CHECK_START) MOP_IN(OP_NULL_CHECK_START);
+ case OP_NULL_CHECK_START: MOP_IN(OP_NULL_CHECK_START);
GET_MEMNUM_INC(mem, p); /* mem: null check id */
STACK_PUSH_NULL_CHECK_START(mem, s);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_NULL_CHECK_END) MOP_IN(OP_NULL_CHECK_END);
+ case OP_NULL_CHECK_END: MOP_IN(OP_NULL_CHECK_END);
{
int isnull;
@@ -2753,8 +2544,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
STACK_NULL_CHECK(isnull, mem, s);
if (isnull) {
#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%"PRIuPTR" (%p)\n",
- (int )mem, (uintptr_t )s, s);
+ fprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%"PRIdPTR" (%p)\n",
+ (int )mem, (intptr_t )s, s);
#endif
null_check_found:
/* empty loop founded, skip next instruction */
@@ -2776,45 +2567,47 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
- CASE(OP_NULL_CHECK_END_MEMST) MOP_IN(OP_NULL_CHECK_END_MEMST);
+ case OP_NULL_CHECK_END_MEMST: MOP_IN(OP_NULL_CHECK_END_MEMST);
{
int isnull;
GET_MEMNUM_INC(mem, p); /* mem: null check id */
STACK_NULL_CHECK_MEMST(isnull, mem, s, reg);
if (isnull) {
-# ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END_MEMST: skip id:%d, s:%"PRIuPTR" (%p)\n",
- (int )mem, (uintptr_t )s, s);
-# endif
+#ifdef ONIG_DEBUG_MATCH
+ fprintf(stderr, "NULL_CHECK_END_MEMST: skip id:%d, s:%"PRIdPTR" (%p)\n",
+ (int )mem, (intptr_t )s, s);
+#endif
if (isnull == -1) goto fail;
goto null_check_found;
}
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif
#ifdef USE_SUBEXP_CALL
- CASE(OP_NULL_CHECK_END_MEMST_PUSH)
+ case OP_NULL_CHECK_END_MEMST_PUSH:
MOP_IN(OP_NULL_CHECK_END_MEMST_PUSH);
{
int isnull;
GET_MEMNUM_INC(mem, p); /* mem: null check id */
-# ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
+#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT
STACK_NULL_CHECK_MEMST_REC(isnull, mem, s, reg);
-# else
+#else
STACK_NULL_CHECK_REC(isnull, mem, s);
-# endif
+#endif
if (isnull) {
-# ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%"PRIuPTR" (%p)\n",
- (int )mem, (uintptr_t )s, s);
-# endif
+#ifdef ONIG_DEBUG_MATCH
+ fprintf(stderr, "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%"PRIdPTR" (%p)\n",
+ (int )mem, (intptr_t )s, s);
+#endif
if (isnull == -1) goto fail;
goto null_check_found;
}
@@ -2823,24 +2616,27 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif
- CASE(OP_JUMP) MOP_IN(OP_JUMP);
+ case OP_JUMP: MOP_IN(OP_JUMP);
GET_RELADDR_INC(addr, p);
p += addr;
MOP_OUT;
CHECK_INTERRUPT_IN_MATCH_AT;
- JUMP;
+ continue;
+ break;
- CASE(OP_PUSH) MOP_IN(OP_PUSH);
+ case OP_PUSH: MOP_IN(OP_PUSH);
GET_RELADDR_INC(addr, p);
STACK_PUSH_ALT(p + addr, s, sprev, pkeep);
MOP_OUT;
- JUMP;
+ continue;
+ break;
#ifdef USE_COMBINATION_EXPLOSION_CHECK
- CASE(OP_STATE_CHECK_PUSH) MOP_IN(OP_STATE_CHECK_PUSH);
+ case OP_STATE_CHECK_PUSH: MOP_IN(OP_STATE_CHECK_PUSH);
GET_STATE_CHECK_NUM_INC(mem, p);
STATE_CHECK_VAL(scv, mem);
if (scv) goto fail;
@@ -2848,9 +2644,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
GET_RELADDR_INC(addr, p);
STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem, pkeep);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_STATE_CHECK_PUSH_OR_JUMP) MOP_IN(OP_STATE_CHECK_PUSH_OR_JUMP);
+ case OP_STATE_CHECK_PUSH_OR_JUMP: MOP_IN(OP_STATE_CHECK_PUSH_OR_JUMP);
GET_STATE_CHECK_NUM_INC(mem, p);
GET_RELADDR_INC(addr, p);
STATE_CHECK_VAL(scv, mem);
@@ -2861,50 +2658,53 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem, pkeep);
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_STATE_CHECK) MOP_IN(OP_STATE_CHECK);
+ case OP_STATE_CHECK: MOP_IN(OP_STATE_CHECK);
GET_STATE_CHECK_NUM_INC(mem, p);
STATE_CHECK_VAL(scv, mem);
if (scv) goto fail;
STACK_PUSH_STATE_CHECK(s, mem);
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif /* USE_COMBINATION_EXPLOSION_CHECK */
- CASE(OP_POP) MOP_IN(OP_POP);
+ case OP_POP: MOP_IN(OP_POP);
STACK_POP_ONE;
MOP_OUT;
- JUMP;
+ continue;
+ break;
-#ifdef USE_OP_PUSH_OR_JUMP_EXACT
- CASE(OP_PUSH_OR_JUMP_EXACT1) MOP_IN(OP_PUSH_OR_JUMP_EXACT1);
+ case OP_PUSH_OR_JUMP_EXACT1: MOP_IN(OP_PUSH_OR_JUMP_EXACT1);
GET_RELADDR_INC(addr, p);
if (*p == *s && DATA_ENSURE_CHECK1) {
p++;
STACK_PUSH_ALT(p + addr, s, sprev, pkeep);
MOP_OUT;
- JUMP;
+ continue;
}
p += (addr + 1);
MOP_OUT;
- JUMP;
-#endif
+ continue;
+ break;
- CASE(OP_PUSH_IF_PEEK_NEXT) MOP_IN(OP_PUSH_IF_PEEK_NEXT);
+ case OP_PUSH_IF_PEEK_NEXT: MOP_IN(OP_PUSH_IF_PEEK_NEXT);
GET_RELADDR_INC(addr, p);
if (*p == *s) {
p++;
STACK_PUSH_ALT(p + addr, s, sprev, pkeep);
MOP_OUT;
- JUMP;
+ continue;
}
p++;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_REPEAT) MOP_IN(OP_REPEAT);
+ case OP_REPEAT: MOP_IN(OP_REPEAT);
{
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
GET_RELADDR_INC(addr, p);
@@ -2918,9 +2718,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_REPEAT_NG) MOP_IN(OP_REPEAT_NG);
+ case OP_REPEAT_NG: MOP_IN(OP_REPEAT_NG);
{
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
GET_RELADDR_INC(addr, p);
@@ -2935,9 +2736,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_REPEAT_INC) MOP_IN(OP_REPEAT_INC);
+ case OP_REPEAT_INC: MOP_IN(OP_REPEAT_INC);
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
si = repeat_stk[mem];
stkp = STACK_AT(si);
@@ -2945,28 +2747,29 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
repeat_inc:
stkp->u.repeat.count++;
if (stkp->u.repeat.count >= reg->repeat_range[mem].upper) {
- /* end of repeat. Nothing to do. */
+ /* end of repeat. Nothing to do. */
}
else if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
- STACK_PUSH_ALT(p, s, sprev, pkeep);
- p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */
+ STACK_PUSH_ALT(p, s, sprev, pkeep);
+ p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */
}
else {
- p = stkp->u.repeat.pcode;
+ p = stkp->u.repeat.pcode;
}
STACK_PUSH_REPEAT_INC(si);
MOP_OUT;
CHECK_INTERRUPT_IN_MATCH_AT;
- JUMP;
+ continue;
+ break;
- CASE(OP_REPEAT_INC_SG) MOP_IN(OP_REPEAT_INC_SG);
+ case OP_REPEAT_INC_SG: MOP_IN(OP_REPEAT_INC_SG);
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
STACK_GET_REPEAT(mem, stkp);
si = GET_STACK_INDEX(stkp);
goto repeat_inc;
- NEXT;
+ break;
- CASE(OP_REPEAT_INC_NG) MOP_IN(OP_REPEAT_INC_NG);
+ case OP_REPEAT_INC_NG: MOP_IN(OP_REPEAT_INC_NG);
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
si = repeat_stk[mem];
stkp = STACK_AT(si);
@@ -2974,75 +2777,82 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
repeat_inc_ng:
stkp->u.repeat.count++;
if (stkp->u.repeat.count < reg->repeat_range[mem].upper) {
- if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
- UChar* pcode = stkp->u.repeat.pcode;
-
- STACK_PUSH_REPEAT_INC(si);
- STACK_PUSH_ALT(pcode, s, sprev, pkeep);
- }
- else {
- p = stkp->u.repeat.pcode;
- STACK_PUSH_REPEAT_INC(si);
- }
+ if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
+ UChar* pcode = stkp->u.repeat.pcode;
+
+ STACK_PUSH_REPEAT_INC(si);
+ STACK_PUSH_ALT(pcode, s, sprev, pkeep);
+ }
+ else {
+ p = stkp->u.repeat.pcode;
+ STACK_PUSH_REPEAT_INC(si);
+ }
}
else if (stkp->u.repeat.count == reg->repeat_range[mem].upper) {
- STACK_PUSH_REPEAT_INC(si);
+ STACK_PUSH_REPEAT_INC(si);
}
MOP_OUT;
CHECK_INTERRUPT_IN_MATCH_AT;
- JUMP;
+ continue;
+ break;
- CASE(OP_REPEAT_INC_NG_SG) MOP_IN(OP_REPEAT_INC_NG_SG);
+ case OP_REPEAT_INC_NG_SG: MOP_IN(OP_REPEAT_INC_NG_SG);
GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */
STACK_GET_REPEAT(mem, stkp);
si = GET_STACK_INDEX(stkp);
goto repeat_inc_ng;
- NEXT;
+ break;
- CASE(OP_PUSH_POS) MOP_IN(OP_PUSH_POS);
+ case OP_PUSH_POS: MOP_IN(OP_PUSH_POS);
STACK_PUSH_POS(s, sprev, pkeep);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_POP_POS) MOP_IN(OP_POP_POS);
+ case OP_POP_POS: MOP_IN(OP_POP_POS);
{
STACK_POS_END(stkp);
s = stkp->u.state.pstr;
sprev = stkp->u.state.pstr_prev;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_PUSH_POS_NOT) MOP_IN(OP_PUSH_POS_NOT);
+ case OP_PUSH_POS_NOT: MOP_IN(OP_PUSH_POS_NOT);
GET_RELADDR_INC(addr, p);
STACK_PUSH_POS_NOT(p + addr, s, sprev, pkeep);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_FAIL_POS) MOP_IN(OP_FAIL_POS);
+ case OP_FAIL_POS: MOP_IN(OP_FAIL_POS);
STACK_POP_TIL_POS_NOT;
goto fail;
- NEXT;
+ break;
- CASE(OP_PUSH_STOP_BT) MOP_IN(OP_PUSH_STOP_BT);
+ case OP_PUSH_STOP_BT: MOP_IN(OP_PUSH_STOP_BT);
STACK_PUSH_STOP_BT;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_POP_STOP_BT) MOP_IN(OP_POP_STOP_BT);
+ case OP_POP_STOP_BT: MOP_IN(OP_POP_STOP_BT);
STACK_STOP_BT_END;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_LOOK_BEHIND) MOP_IN(OP_LOOK_BEHIND);
+ case OP_LOOK_BEHIND: MOP_IN(OP_LOOK_BEHIND);
GET_LENGTH_INC(tlen, p);
s = (UChar* )ONIGENC_STEP_BACK(encode, str, s, end, (int )tlen);
if (IS_NULL(s)) goto fail;
sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s, end);
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_PUSH_LOOK_BEHIND_NOT) MOP_IN(OP_PUSH_LOOK_BEHIND_NOT);
+ case OP_PUSH_LOOK_BEHIND_NOT: MOP_IN(OP_PUSH_LOOK_BEHIND_NOT);
GET_RELADDR_INC(addr, p);
GET_LENGTH_INC(tlen, p);
q = (UChar* )ONIGENC_STEP_BACK(encode, str, s, end, (int )tlen);
@@ -3058,86 +2868,32 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s, end);
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_FAIL_LOOK_BEHIND_NOT) MOP_IN(OP_FAIL_LOOK_BEHIND_NOT);
+ case OP_FAIL_LOOK_BEHIND_NOT: MOP_IN(OP_FAIL_LOOK_BEHIND_NOT);
STACK_POP_TIL_LOOK_BEHIND_NOT;
goto fail;
- NEXT;
-
- CASE(OP_PUSH_ABSENT_POS) MOP_IN(OP_PUSH_ABSENT_POS);
- /* Save the absent-start-pos and the original end-pos. */
- STACK_PUSH_ABSENT_POS(s, ABSENT_END_POS);
- MOP_OUT;
- JUMP;
-
- CASE(OP_ABSENT) MOP_IN(OP_ABSENT);
- {
- const UChar* aend = ABSENT_END_POS;
- UChar* absent;
- UChar* selfp = p - 1;
-
- STACK_POP_ABSENT_POS(absent, ABSENT_END_POS); /* Restore end-pos. */
- GET_RELADDR_INC(addr, p);
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "ABSENT: s:%p, end:%p, absent:%p, aend:%p\n", s, end, absent, aend);
-#endif
- if ((absent > aend) && (s > absent)) {
- /* An empty match occurred in (?~...) at the start point.
- * Never match. */
- STACK_POP;
- goto fail;
- }
- else if ((s >= aend) && (s > absent)) {
- if (s > aend) {
- /* Only one (or less) character matched in the last iteration.
- * This is not a possible point. */
- goto fail;
- }
- /* All possible points were found. Try matching after (?~...). */
- DATA_ENSURE(0);
- p += addr;
- }
- else {
- STACK_PUSH_ALT(p + addr, s, sprev, pkeep); /* Push possible point. */
- n = enclen(encode, s, end);
- STACK_PUSH_ABSENT_POS(absent, ABSENT_END_POS); /* Save the original pos. */
- STACK_PUSH_ALT(selfp, s + n, s, pkeep); /* Next iteration. */
- STACK_PUSH_ABSENT;
- ABSENT_END_POS = aend;
- }
- }
- MOP_OUT;
- JUMP;
-
- CASE(OP_ABSENT_END) MOP_IN(OP_ABSENT_END);
- /* The pattern inside (?~...) was matched.
- * Set the end-pos temporary and go to next iteration. */
- if (sprev < ABSENT_END_POS)
- ABSENT_END_POS = sprev;
-#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "ABSENT_END: end:%p\n", ABSENT_END_POS);
-#endif
- STACK_POP_TIL_ABSENT;
- goto fail;
- NEXT;
+ break;
#ifdef USE_SUBEXP_CALL
- CASE(OP_CALL) MOP_IN(OP_CALL);
+ case OP_CALL: MOP_IN(OP_CALL);
GET_ABSADDR_INC(addr, p);
STACK_PUSH_CALL_FRAME(p);
p = reg->p + addr;
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_RETURN) MOP_IN(OP_RETURN);
+ case OP_RETURN: MOP_IN(OP_RETURN);
STACK_RETURN(p);
STACK_PUSH_RETURN;
MOP_OUT;
- JUMP;
+ continue;
+ break;
#endif
- CASE(OP_CONDITION) MOP_IN(OP_CONDITION);
+ case OP_CONDITION: MOP_IN(OP_CONDITION);
GET_MEMNUM_INC(mem, p);
GET_RELADDR_INC(addr, p);
if ((mem > num_mem) ||
@@ -3146,19 +2902,17 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
p += addr;
}
MOP_OUT;
- JUMP;
+ continue;
+ break;
- CASE(OP_FINISH)
+ case OP_FINISH:
goto finish;
- NEXT;
+ break;
- CASE(OP_FAIL)
- if (0) {
- /* fall */
- fail:
- MOP_OUT;
- }
- MOP_IN(OP_FAIL);
+ fail:
+ MOP_OUT;
+ /* fall */
+ case OP_FAIL: MOP_IN(OP_FAIL);
STACK_POP;
p = stk->u.state.pcode;
s = stk->u.state.pstr;
@@ -3167,17 +2921,21 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
#ifdef USE_COMBINATION_EXPLOSION_CHECK
if (stk->u.state.state_check != 0) {
- stk->type = STK_STATE_CHECK_MARK;
- stk++;
+ stk->type = STK_STATE_CHECK_MARK;
+ stk++;
}
#endif
MOP_OUT;
- JUMP;
+ continue;
+ break;
- DEFAULT
+ default:
goto bytecode_error;
- } VM_LOOP_END
+
+ } /* end of switch */
+ sprev = sbegin;
+ } /* end of while(1) */
finish:
STACK_SAVE;
@@ -3245,7 +3003,7 @@ slow_search(OnigEncoding enc, UChar* target, UChar* target_end,
static int
str_lower_case_match(OnigEncoding enc, int case_fold_flag,
- const UChar* t, const UChar* tend,
+ const UChar* t, const UChar* tend,
const UChar* p, const UChar* end)
{
int lowlen;
@@ -3337,7 +3095,7 @@ slow_search_backward_ic(OnigEncoding enc, int case_fold_flag,
while (s >= text) {
if (str_lower_case_match(enc, case_fold_flag,
- target, target_end, s, text_end))
+ target, target_end, s, text_end))
return s;
s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s, text_end);
@@ -3357,10 +3115,10 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
const UChar *tail;
ptrdiff_t skip, tlen1;
-# ifdef ONIG_DEBUG_SEARCH
+#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "bm_search_notrev: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
+ text, text, text_end, text_end, text_range, text_range);
+#endif
tail = target_end - 1;
tlen1 = tail - target;
@@ -3381,12 +3139,11 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->map[*se];
t = s;
do {
- s += enclen(reg->enc, s, end);
+ s += enclen(reg->enc, s, end);
} while ((s - t) < skip && s < end);
}
}
else {
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = se = s + tlen1;
t = tail;
@@ -3397,10 +3154,9 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->int_map[*se];
t = s;
do {
- s += enclen(reg->enc, s, end);
+ s += enclen(reg->enc, s, end);
} while ((s - t) < skip && s < end);
}
-# endif
}
return (UChar* )NULL;
@@ -3414,10 +3170,10 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
const UChar *s, *t, *p, *end;
const UChar *tail;
-# ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
+#ifdef ONIG_DEBUG_SEARCH
+ fprintf(stderr, "bm_search: text: %"PRIuPTR", text_end: %"PRIuPTR", text_range: %"PRIuPTR"\n",
+ text, text_end, text_range);
+#endif
end = text_range + (target_end - target) - 1;
if (end > text_end)
@@ -3429,10 +3185,10 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
while (s < end) {
p = s;
t = tail;
-# ifdef ONIG_DEBUG_SEARCH
+#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "bm_search_loop: pos: %"PRIdPTR" %s\n",
(intptr_t )(s - text), s);
-# endif
+#endif
while (*p == *t) {
if (t == target) return (UChar* )p;
p--; t--;
@@ -3441,7 +3197,6 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
}
}
else { /* see int_map[] */
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = s;
t = tail;
@@ -3451,7 +3206,6 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
}
s += reg->int_map[*s];
}
-# endif
}
return (UChar* )NULL;
}
@@ -3468,10 +3222,10 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
OnigEncoding enc = reg->enc;
int case_fold_flag = reg->case_fold_flag;
-# ifdef ONIG_DEBUG_SEARCH
+#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "bm_search_notrev_ic: text: %d (%p), text_end: %d (%p), text_range: %d (%p)\n",
(int )text, text, (int )text_end, text_end, (int )text_range, text_range);
-# endif
+#endif
tail = target_end - 1;
tlen1 = tail - target;
@@ -3490,12 +3244,11 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->map[*se];
t = s;
do {
- s += enclen(reg->enc, s, end);
+ s += enclen(reg->enc, s, end);
} while ((s - t) < skip && s < end);
}
}
else {
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
se = s + tlen1;
if (str_lower_case_match(enc, case_fold_flag, target, target_end,
@@ -3504,10 +3257,9 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->int_map[*se];
t = s;
do {
- s += enclen(reg->enc, s, end);
+ s += enclen(reg->enc, s, end);
} while ((s - t) < skip && s < end);
}
-# endif
}
return (UChar* )NULL;
@@ -3523,10 +3275,10 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
OnigEncoding enc = reg->enc;
int case_fold_flag = reg->case_fold_flag;
-# ifdef ONIG_DEBUG_SEARCH
+#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "bm_search_ic: text: %d (%p), text_end: %d (%p), text_range: %d (%p)\n",
(int )text, text, (int )text_end, text_end, (int )text_range, text_range);
-# endif
+#endif
end = text_range + (target_end - target) - 1;
if (end > text_end)
@@ -3544,7 +3296,6 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
}
}
else { /* see int_map[] */
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = s - (target_end - target) + 1;
if (str_lower_case_match(enc, case_fold_flag, target, target_end,
@@ -3552,7 +3303,6 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
return (UChar* )p;
s += reg->int_map[*s];
}
-# endif
}
return (UChar* )NULL;
}
@@ -3570,10 +3320,10 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
ptrdiff_t skip, tlen1;
OnigEncoding enc = reg->enc;
-# ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search_notrev: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
+#ifdef ONIG_DEBUG_SEARCH
+ fprintf(stderr, "bm_search_notrev: text: %"PRIdPTR" (%p), text_end: %"PRIdPTR" (%p), text_range: %"PRIdPTR" (%p)\n",
+ (intptr_t )text, text, (intptr_t )text_end, text_end, (intptr_t )text_range, text_range);
+#endif
tail = target_end - 1;
tlen1 = tail - target;
@@ -3595,12 +3345,11 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->map[se[1]];
t = s;
do {
- s += enclen(enc, s, end);
+ s += enclen(enc, s, end);
} while ((s - t) < skip && s < end);
}
}
else {
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = se = s + tlen1;
t = tail;
@@ -3612,10 +3361,9 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->int_map[se[1]];
t = s;
do {
- s += enclen(enc, s, end);
+ s += enclen(enc, s, end);
} while ((s - t) < skip && s < end);
}
-# endif
}
return (UChar* )NULL;
@@ -3630,11 +3378,6 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
const UChar *tail;
ptrdiff_t tlen1;
-# ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
-
tail = target_end - 1;
tlen1 = tail - target;
end = text_range + tlen1;
@@ -3655,7 +3398,6 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
}
}
else { /* see int_map[] */
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = s;
t = tail;
@@ -3666,7 +3408,6 @@ bm_search(regex_t* reg, const UChar* target, const UChar* target_end,
if (s + 1 >= end) break;
s += reg->int_map[s[1]];
}
-# endif
}
return (UChar* )NULL;
}
@@ -3683,10 +3424,10 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
OnigEncoding enc = reg->enc;
int case_fold_flag = reg->case_fold_flag;
-# ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search_notrev_ic: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
+#ifdef ONIG_DEBUG_SEARCH
+ fprintf(stderr, "bm_search_notrev_ic: text: %"PRIdPTR" (%p), text_end: %"PRIdPTR" (%p), text_range: %"PRIdPTR" (%p)\n",
+ (intptr_t )text, text, (intptr_t )text_end, text_end, (intptr_t )text_range, text_range);
+#endif
tail = target_end - 1;
tlen1 = tail - target;
@@ -3706,12 +3447,11 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->map[se[1]];
t = s;
do {
- s += enclen(enc, s, end);
+ s += enclen(enc, s, end);
} while ((s - t) < skip && s < end);
}
}
else {
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
se = s + tlen1;
if (str_lower_case_match(enc, case_fold_flag, target, target_end,
@@ -3721,10 +3461,9 @@ bm_search_notrev_ic(regex_t* reg, const UChar* target, const UChar* target_end,
skip = reg->int_map[se[1]];
t = s;
do {
- s += enclen(enc, s, end);
+ s += enclen(enc, s, end);
} while ((s - t) < skip && s < end);
}
-# endif
}
return (UChar* )NULL;
@@ -3741,10 +3480,10 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
OnigEncoding enc = reg->enc;
int case_fold_flag = reg->case_fold_flag;
-# ifdef ONIG_DEBUG_SEARCH
- fprintf(stderr, "bm_search_ic: text: %"PRIuPTR" (%p), text_end: %"PRIuPTR" (%p), text_range: %"PRIuPTR" (%p)\n",
- (uintptr_t )text, text, (uintptr_t )text_end, text_end, (uintptr_t )text_range, text_range);
-# endif
+#ifdef ONIG_DEBUG_SEARCH
+ fprintf(stderr, "bm_search_ic: text: %"PRIdPTR" (%p), text_end: %"PRIdPTR" (%p), text_range: %"PRIdPTR" (%p)\n",
+ (intptr_t )text, text, (intptr_t )text_end, text_end, (intptr_t )text_range, text_range);
+#endif
tail = target_end - 1;
tlen1 = tail - target;
@@ -3764,7 +3503,6 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
}
}
else { /* see int_map[] */
-# if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE
while (s < end) {
p = s - tlen1;
if (str_lower_case_match(enc, case_fold_flag, target, target_end,
@@ -3773,13 +3511,11 @@ bm_search_ic(regex_t* reg, const UChar* target, const UChar* target_end,
if (s + 1 >= end) break;
s += reg->int_map[s[1]];
}
-# endif
}
return (UChar* )NULL;
}
#endif /* USE_SUNDAY_QUICK_SEARCH */
-#ifdef USE_INT_MAP_BACKWARD
static int
set_bm_backward_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,
int** skip)
@@ -3829,7 +3565,6 @@ bm_search_backward(regex_t* reg, const UChar* target, const UChar* target_end,
return (UChar* )NULL;
}
-#endif
static UChar*
map_search(OnigEncoding enc, UChar map[],
@@ -3868,6 +3603,31 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
UChar *prev;
OnigMatchArg msa;
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+ start:
+ THREAD_ATOMIC_START;
+ if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
+ ONIG_STATE_INC(reg);
+ if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
+ onig_chain_reduce(reg);
+ ONIG_STATE_INC(reg);
+ }
+ }
+ else {
+ int n;
+
+ THREAD_ATOMIC_END;
+ n = 0;
+ while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {
+ if (++n > THREAD_PASS_LIMIT_COUNT)
+ return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;
+ THREAD_PASS;
+ }
+ goto start;
+ }
+ THREAD_ATOMIC_END;
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
+
MATCH_ARG_INIT(msa, option, region, at, at);
#ifdef USE_COMBINATION_EXPLOSION_CHECK
{
@@ -3876,7 +3636,11 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
}
#endif
- if (region) {
+ if (region
+#ifdef USE_POSIX_API_REGION_OPTION
+ && !IS_POSIX_REGION(option)
+#endif
+ ) {
r = onig_region_resize_clear(region, reg->num_mem + 1);
}
else
@@ -3892,6 +3656,7 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
}
MATCH_ARG_FREE(msa);
+ ONIG_STATE_DEC_THREAD(reg);
return r;
}
@@ -3903,7 +3668,7 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "forward_search_range: str: %"PRIuPTR" (%p), end: %"PRIuPTR" (%p), s: %"PRIuPTR" (%p), range: %"PRIuPTR" (%p)\n",
- (uintptr_t )str, str, (uintptr_t )end, end, (uintptr_t )s, s, (uintptr_t )range, range);
+ (intptr_t )str, str, (intptr_t )end, end, (intptr_t )s, s, (intptr_t )range, range);
#endif
p = s;
@@ -3913,8 +3678,6 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
}
else {
UChar *q = p + reg->dmin;
-
- if (q >= end) return 0; /* fail */
while (p < q) p += enclen(reg->enc, p, end);
}
}
@@ -3926,7 +3689,7 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
break;
case ONIG_OPTIMIZE_EXACT_IC:
p = slow_search_ic(reg->enc, reg->case_fold_flag,
- reg->exact, reg->exact_end, p, end, range);
+ reg->exact, reg->exact_end, p, end, range);
break;
case ONIG_OPTIMIZE_EXACT_BM:
@@ -3998,25 +3761,18 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
}
else {
if (reg->dmax != ONIG_INFINITE_DISTANCE) {
- if (p < str + reg->dmax) {
- *low = (UChar* )str;
- if (low_prev)
- *low_prev = onigenc_get_prev_char_head(reg->enc, str, *low, end);
+ *low = p - reg->dmax;
+ if (*low > s) {
+ *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
+ *low, end, (const UChar** )low_prev);
+ if (low_prev && IS_NULL(*low_prev))
+ *low_prev = onigenc_get_prev_char_head(reg->enc,
+ (pprev ? pprev : s), *low, end);
}
else {
- *low = p - reg->dmax;
- if (*low > s) {
- *low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
- *low, end, (const UChar** )low_prev);
- if (low_prev && IS_NULL(*low_prev))
- *low_prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : s), *low, end);
- }
- else {
- if (low_prev)
- *low_prev = onigenc_get_prev_char_head(reg->enc,
- (pprev ? pprev : str), *low, end);
- }
+ if (low_prev)
+ *low_prev = onigenc_get_prev_char_head(reg->enc,
+ (pprev ? pprev : str), *low, end);
}
}
}
@@ -4034,6 +3790,9 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
return 0; /* fail */
}
+static int set_bm_backward_skip P_((UChar* s, UChar* end, OnigEncoding enc,
+ int** skip));
+
#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD 100
static int
@@ -4041,6 +3800,7 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
UChar* s, const UChar* range, UChar* adjrange,
UChar** low, UChar** high)
{
+ int r;
UChar *p;
range += reg->dmin;
@@ -4058,15 +3818,13 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
case ONIG_OPTIMIZE_EXACT_BM_IC:
case ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC:
p = slow_search_backward_ic(reg->enc, reg->case_fold_flag,
- reg->exact, reg->exact_end,
- range, adjrange, end, p);
+ reg->exact, reg->exact_end,
+ range, adjrange, end, p);
break;
case ONIG_OPTIMIZE_EXACT_BM:
case ONIG_OPTIMIZE_EXACT_BM_NOT_REV:
-#ifdef USE_INT_MAP_BACKWARD
if (IS_NULL(reg->int_map_backward)) {
- int r;
if (s - range < BM_BACKWARD_SEARCH_LENGTH_THRESHOLD)
goto exact_method;
@@ -4076,9 +3834,6 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
}
p = bm_search_backward(reg, reg->exact, reg->exact_end, range, adjrange,
end, p);
-#else
- goto exact_method;
-#endif
break;
case ONIG_OPTIMIZE_MAP:
@@ -4163,13 +3918,42 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
const UChar *orig_range = range;
#endif
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+ start:
+ THREAD_ATOMIC_START;
+ if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
+ ONIG_STATE_INC(reg);
+ if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
+ onig_chain_reduce(reg);
+ ONIG_STATE_INC(reg);
+ }
+ }
+ else {
+ int n;
+
+ THREAD_ATOMIC_END;
+ n = 0;
+ while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {
+ if (++n > THREAD_PASS_LIMIT_COUNT)
+ return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;
+ THREAD_PASS;
+ }
+ goto start;
+ }
+ THREAD_ATOMIC_END;
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
+
#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr,
"onig_search (entry point): str: %"PRIuPTR" (%p), end: %"PRIuPTR", start: %"PRIuPTR", range: %"PRIuPTR"\n",
- (uintptr_t )str, str, end - str, start - str, range - str);
+ (intptr_t )str, str, end - str, start - str, range - str);
#endif
- if (region) {
+ if (region
+#ifdef USE_POSIX_API_REGION_OPTION
+ && !IS_POSIX_REGION(option)
+#endif
+ ) {
r = onig_region_resize_clear(region, reg->num_mem + 1);
if (r) goto finish_no_msa;
}
@@ -4178,8 +3962,8 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE
-# ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-# define MATCH_AND_RETURN_CHECK(upper_range) \
+#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
+#define MATCH_AND_RETURN_CHECK(upper_range) \
r = match_at(reg, str, end, (upper_range), s, prev, &msa); \
if (r != ONIG_MISMATCH) {\
if (r >= 0) {\
@@ -4189,8 +3973,8 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}\
else goto finish; /* error */ \
}
-# else
-# define MATCH_AND_RETURN_CHECK(upper_range) \
+#else
+#define MATCH_AND_RETURN_CHECK(upper_range) \
r = match_at(reg, str, end, (upper_range), s, prev, &msa); \
if (r != ONIG_MISMATCH) {\
if (r >= 0) {\
@@ -4198,10 +3982,10 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}\
else goto finish; /* error */ \
}
-# endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
+#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
#else
-# ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
-# define MATCH_AND_RETURN_CHECK(none) \
+#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
+#define MATCH_AND_RETURN_CHECK(none) \
r = match_at(reg, str, end, s, prev, &msa);\
if (r != ONIG_MISMATCH) {\
if (r >= 0) {\
@@ -4211,8 +3995,8 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}\
else goto finish; /* error */ \
}
-# else
-# define MATCH_AND_RETURN_CHECK(none) \
+#else
+#define MATCH_AND_RETURN_CHECK(none) \
r = match_at(reg, str, end, s, prev, &msa);\
if (r != ONIG_MISMATCH) {\
if (r >= 0) {\
@@ -4220,7 +4004,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}\
else goto finish; /* error */ \
}
-# endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
+#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */
#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */
@@ -4232,15 +4016,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
/* search start-position only */
begin_position:
if (range > start)
- {
- if (global_pos > start)
- {
- if (global_pos < range)
- range = global_pos + 1;
- }
- else
- range = start + 1;
- }
+ range = start + 1;
else
range = start;
}
@@ -4316,7 +4092,9 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}
}
else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) {
- goto begin_position;
+ if (! (reg->anchor & ANCHOR_LOOK_BEHIND)) {
+ goto begin_position;
+ }
}
}
else if (str == end) { /* empty string */
@@ -4376,7 +4154,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
}
if ((end - start) < reg->threshold_len)
- goto mismatch;
+ goto mismatch;
if (reg->dmax != ONIG_INFINITE_DISTANCE) {
do {
@@ -4398,22 +4176,24 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
if (! forward_search_range(reg, str, end, s, sch_range,
&low, &high, (UChar** )NULL)) goto mismatch;
- if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {
- do {
- MATCH_AND_RETURN_CHECK(orig_range);
- prev = s;
- s += enclen(reg->enc, s, end);
-
- if ((reg->anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) == 0) {
- while (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, reg->options, 0)
- && s < range) {
- prev = s;
- s += enclen(reg->enc, s, end);
- }
- }
- } while (s < range);
- goto mismatch;
- }
+ if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {
+ do {
+ if ((reg->anchor & ANCHOR_BEGIN_POSITION) == 0)
+ msa.gpos = s; /* move \G position */
+ MATCH_AND_RETURN_CHECK(orig_range);
+ prev = s;
+ s += enclen(reg->enc, s, end);
+
+ if ((reg->anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) == 0) {
+ while (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, reg->options, 0)
+ && s < range) {
+ prev = s;
+ s += enclen(reg->enc, s, end);
+ }
+ }
+ } while (s < range);
+ goto mismatch;
+ }
}
}
@@ -4496,107 +4276,72 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
finish:
MATCH_ARG_FREE(msa);
+ ONIG_STATE_DEC_THREAD(reg);
/* If result is mismatch and no FIND_NOT_EMPTY option,
then the region is not set in match_at(). */
- if (IS_FIND_NOT_EMPTY(reg->options) && region) {
+ if (IS_FIND_NOT_EMPTY(reg->options) && region
+#ifdef USE_POSIX_API_REGION_OPTION
+ && !IS_POSIX_REGION(option)
+#endif
+ ) {
onig_region_clear(region);
}
#ifdef ONIG_DEBUG
if (r != ONIG_MISMATCH)
- fprintf(stderr, "onig_search: error %"PRIdPTRDIFF"\n", r);
+ fprintf(stderr, "onig_search: error %"PRIdPTR"\n", r);
#endif
return r;
mismatch_no_msa:
r = ONIG_MISMATCH;
finish_no_msa:
+ ONIG_STATE_DEC_THREAD(reg);
#ifdef ONIG_DEBUG
if (r != ONIG_MISMATCH)
- fprintf(stderr, "onig_search: error %"PRIdPTRDIFF"\n", r);
+ fprintf(stderr, "onig_search: error %"PRIdPTR"\n", r);
#endif
return r;
match:
+ ONIG_STATE_DEC_THREAD(reg);
MATCH_ARG_FREE(msa);
return s - str;
}
-extern OnigPosition
-onig_scan(regex_t* reg, const UChar* str, const UChar* end,
- OnigRegion* region, OnigOptionType option,
- int (*scan_callback)(OnigPosition, OnigPosition, OnigRegion*, void*),
- void* callback_arg)
-{
- OnigPosition r;
- OnigPosition n;
- int rs;
- const UChar* start;
-
- n = 0;
- start = str;
- while (1) {
- r = onig_search(reg, str, end, start, end, region, option);
- if (r >= 0) {
- rs = scan_callback(n, r, region, callback_arg);
- n++;
- if (rs != 0)
- return rs;
-
- if (region->end[0] == start - str) {
- if (start >= end) break;
- start += enclen(reg->enc, start, end);
- }
- else
- start = str + region->end[0];
-
- if (start > end)
- break;
- }
- else if (r == ONIG_MISMATCH) {
- break;
- }
- else { /* error */
- return r;
- }
- }
-
- return n;
-}
-
extern OnigEncoding
-onig_get_encoding(const regex_t* reg)
+onig_get_encoding(regex_t* reg)
{
return reg->enc;
}
extern OnigOptionType
-onig_get_options(const regex_t* reg)
+onig_get_options(regex_t* reg)
{
return reg->options;
}
extern OnigCaseFoldType
-onig_get_case_fold_flag(const regex_t* reg)
+onig_get_case_fold_flag(regex_t* reg)
{
return reg->case_fold_flag;
}
extern const OnigSyntaxType*
-onig_get_syntax(const regex_t* reg)
+onig_get_syntax(regex_t* reg)
{
return reg->syntax;
}
extern int
-onig_number_of_captures(const regex_t* reg)
+onig_number_of_captures(regex_t* reg)
{
return reg->num_mem;
}
extern int
-onig_number_of_capture_histories(const regex_t* reg)
+onig_number_of_capture_histories(regex_t* reg)
{
#ifdef USE_CAPTURE_HISTORY
int i, n;
diff --git a/regint.h b/regint.h
index a2f5bbba1d..3abc8809c9 100644
--- a/regint.h
+++ b/regint.h
@@ -1,11 +1,11 @@
-#ifndef ONIGMO_REGINT_H
-#define ONIGMO_REGINT_H
+#ifndef ONIGURUMA_REGINT_H
+#define ONIGURUMA_REGINT_H
/**********************************************************************
regint.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne 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
@@ -35,7 +35,6 @@
/* #define ONIG_DEBUG_COMPILE */
/* #define ONIG_DEBUG_SEARCH */
/* #define ONIG_DEBUG_MATCH */
-/* #define ONIG_DEBUG_MEMLEAK */
/* #define ONIG_DONT_OPTIMIZE */
/* for byte-code statistical data. */
@@ -43,25 +42,17 @@
#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \
defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \
- defined(ONIG_DEBUG_STATISTICS) || defined(ONIG_DEBUG_MEMLEAK)
-# ifndef ONIG_DEBUG
-# define ONIG_DEBUG
-# endif
+ defined(ONIG_DEBUG_STATISTICS)
+#ifndef ONIG_DEBUG
+#define ONIG_DEBUG
#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
-#if UNALIGNED_WORD_ACCESS
-# define PLATFORM_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 PLATFORM_UNALIGNED_WORD_ACCESS
#endif
/* config */
@@ -74,165 +65,213 @@
#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */
#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */
#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
+/* #define USE_RECOMPILE_API */
/* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR */
#define USE_NO_INVALID_QUANTIFIER
/* internal config */
-/* #define USE_OP_PUSH_OR_JUMP_EXACT */
+#define USE_PARSE_TREE_NODE_RECYCLE
+#define USE_OP_PUSH_OR_JUMP_EXACT
#define USE_QTFR_PEEK_NEXT
#define USE_ST_LIBRARY
+#define USE_SHARED_CCLASS_TABLE
#define USE_SUNDAY_QUICK_SEARCH
#define INIT_MATCH_STACK_SIZE 160
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
-#define DEFAULT_PARSE_DEPTH_LIMIT 4096
-
-#define OPT_EXACT_MAXLEN 24
/* check config */
#if defined(USE_PERL_SUBEXP_CALL) || defined(USE_CAPITAL_P_NAMED_GROUP)
-# if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
-# error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
-# endif
+#if !defined(USE_NAMED_GROUP) || !defined(USE_SUBEXP_CALL)
+#error USE_NAMED_GROUP and USE_SUBEXP_CALL must be defined.
+#endif
#endif
#if defined(__GNUC__)
-# define ARG_UNUSED __attribute__ ((unused))
+# define ARG_UNUSED __attribute__ ((unused))
#else
-# define ARG_UNUSED
+# define ARG_UNUSED
#endif
-#if !defined(RUBY) && defined(RUBY_EXPORT)
-# define RUBY
+#ifndef RUBY_DEFINES_H
+#include "ruby/ruby.h"
+#undef xmalloc
+#undef xrealloc
+#undef xcalloc
+#undef xfree
#endif
-#ifdef RUBY
-# ifndef RUBY_DEFINES_H
-# include "ruby/ruby.h"
-# undef xmalloc
-# undef xrealloc
-# undef xcalloc
-# undef xfree
-# endif
-#else /* RUBY */
-# include "config.h"
-# if SIZEOF_LONG_LONG > 0
-# define LONG_LONG long long
-# endif
-#endif /* RUBY */
-
-#include <stdarg.h>
/* */
/* escape other system UChar definition */
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
-# undef ONIG_ESCAPE_UCHAR_COLLISION
+#undef ONIG_ESCAPE_UCHAR_COLLISION
#endif
#define USE_WORD_BEGIN_END /* "\<": word-begin, "\>": word-end */
-#ifdef RUBY
-# undef USE_CAPTURE_HISTORY
-#else
-# define USE_CAPTURE_HISTORY
-#endif
+#undef USE_CAPTURE_HISTORY
#define USE_VARIABLE_META_CHARS
+#define USE_POSIX_API_REGION_OPTION /* needed for POSIX API support */
#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */
+/* multithread config */
+/* #define USE_MULTI_THREAD_SYSTEM */
+/* #define USE_DEFAULT_MULTI_THREAD_SYSTEM */
+
+#if defined(USE_MULTI_THREAD_SYSTEM) \
+ && defined(USE_DEFAULT_MULTI_THREAD_SYSTEM)
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+extern CRITICAL_SECTION gOnigMutex;
+#define THREAD_SYSTEM_INIT InitializeCriticalSection(&gOnigMutex)
+#define THREAD_SYSTEM_END DeleteCriticalSection(&gOnigMutex)
+#define THREAD_ATOMIC_START EnterCriticalSection(&gOnigMutex)
+#define THREAD_ATOMIC_END LeaveCriticalSection(&gOnigMutex)
+#define THREAD_PASS Sleep(0)
+#else /* _WIN32 */
+#include <pthread.h>
+#include <sched.h>
+extern pthread_mutex_t gOnigMutex;
+#define THREAD_SYSTEM_INIT pthread_mutex_init(&gOnigMutex, NULL)
+#define THREAD_SYSTEM_END pthread_mutex_destroy(&gOnigMutex)
+#define THREAD_ATOMIC_START pthread_mutex_lock(&gOnigMutex)
+#define THREAD_ATOMIC_END pthread_mutex_unlock(&gOnigMutex)
+#define THREAD_PASS sched_yield()
+#endif /* _WIN32 */
+
+#else /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
+
+#ifndef THREAD_SYSTEM_INIT
+#define THREAD_SYSTEM_INIT /* depend on thread system */
+#endif
+#ifndef THREAD_SYSTEM_END
+#define THREAD_SYSTEM_END /* depend on thread system */
+#endif
+#ifndef THREAD_ATOMIC_START
+#define THREAD_ATOMIC_START /* depend on thread system */
+#endif
+#ifndef THREAD_ATOMIC_END
+#define THREAD_ATOMIC_END /* depend on thread system */
+#endif
+#ifndef THREAD_PASS
+#define THREAD_PASS /* depend on thread system */
+#endif
+
+#endif /* USE_DEFAULT_MULTI_THREAD_SYSTEM */
#ifndef xmalloc
-# define xmalloc malloc
-# define xrealloc realloc
-# define xcalloc calloc
-# define xfree free
+#define xmalloc malloc
+#define xrealloc realloc
+#define xcalloc calloc
+#define xfree free
#endif
#ifdef RUBY
-# define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
-# define onig_st_init_table st_init_table
-# define onig_st_init_table_with_size st_init_table_with_size
-# define onig_st_init_numtable st_init_numtable
-# define onig_st_init_numtable_with_size st_init_numtable_with_size
-# define onig_st_init_strtable st_init_strtable
-# define onig_st_init_strtable_with_size st_init_strtable_with_size
-# define onig_st_delete st_delete
-# define onig_st_delete_safe st_delete_safe
-# define onig_st_insert st_insert
-# define onig_st_lookup st_lookup
-# define onig_st_foreach st_foreach
-# define onig_st_add_direct st_add_direct
-# define onig_st_free_table st_free_table
-# define onig_st_cleanup_safe st_cleanup_safe
-# define onig_st_copy st_copy
-# define onig_st_nothing_key_clone st_nothing_key_clone
-# define onig_st_nothing_key_free st_nothing_key_free
-# define onig_st_is_member st_is_member
-
-# define USE_UPPER_CASE_TABLE
-#else /* RUBY */
-
-# define CHECK_INTERRUPT_IN_MATCH_AT
-
-# define st_init_table onig_st_init_table
-# define st_init_table_with_size onig_st_init_table_with_size
-# define st_init_numtable onig_st_init_numtable
-# define st_init_numtable_with_size onig_st_init_numtable_with_size
-# define st_init_strtable onig_st_init_strtable
-# define st_init_strtable_with_size onig_st_init_strtable_with_size
-# define st_delete onig_st_delete
-# define st_delete_safe onig_st_delete_safe
-# define st_insert onig_st_insert
-# define st_lookup onig_st_lookup
-# define st_foreach onig_st_foreach
-# define st_add_direct onig_st_add_direct
-# define st_free_table onig_st_free_table
-# define st_cleanup_safe onig_st_cleanup_safe
-# define st_copy onig_st_copy
-# define st_nothing_key_clone onig_st_nothing_key_clone
-# define st_nothing_key_free onig_st_nothing_key_free
+#define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
+#define onig_st_init_table st_init_table
+#define onig_st_init_table_with_size st_init_table_with_size
+#define onig_st_init_numtable st_init_numtable
+#define onig_st_init_numtable_with_size st_init_numtable_with_size
+#define onig_st_init_strtable st_init_strtable
+#define onig_st_init_strtable_with_size st_init_strtable_with_size
+#define onig_st_delete st_delete
+#define onig_st_delete_safe st_delete_safe
+#define onig_st_insert st_insert
+#define onig_st_lookup st_lookup
+#define onig_st_foreach st_foreach
+#define onig_st_add_direct st_add_direct
+#define onig_st_free_table st_free_table
+#define onig_st_cleanup_safe st_cleanup_safe
+#define onig_st_copy st_copy
+#define onig_st_nothing_key_clone st_nothing_key_clone
+#define onig_st_nothing_key_free st_nothing_key_free
+#define onig_st_is_member st_is_member
+
+#define USE_UPPER_CASE_TABLE
+#else
+
+#define CHECK_INTERRUPT_IN_MATCH_AT
+
+#define st_init_table onig_st_init_table
+#define st_init_table_with_size onig_st_init_table_with_size
+#define st_init_numtable onig_st_init_numtable
+#define st_init_numtable_with_size onig_st_init_numtable_with_size
+#define st_init_strtable onig_st_init_strtable
+#define st_init_strtable_with_size onig_st_init_strtable_with_size
+#define st_delete onig_st_delete
+#define st_delete_safe onig_st_delete_safe
+#define st_insert onig_st_insert
+#define st_lookup onig_st_lookup
+#define st_foreach onig_st_foreach
+#define st_add_direct onig_st_add_direct
+#define st_free_table onig_st_free_table
+#define st_cleanup_safe onig_st_cleanup_safe
+#define st_copy onig_st_copy
+#define st_nothing_key_clone onig_st_nothing_key_clone
+#define st_nothing_key_free onig_st_nothing_key_free
/* */
-# define onig_st_is_member st_is_member
+#define onig_st_is_member st_is_member
-#endif /* RUBY */
+#endif
#define STATE_CHECK_STRING_THRESHOLD_LEN 7
#define STATE_CHECK_BUFF_MAX_SIZE 0x4000
+#define THREAD_PASS_LIMIT_COUNT 8
#define xmemset memset
#define xmemcpy memcpy
#define xmemmove memmove
-#if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \
- || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \
- && !defined(__GNUC__)
-# define xalloca _alloca
-# define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)
-# define xsnprintf sprintf_s
-# define xstrcat(dest,src,size) strcat_s(dest,size,src)
+#if defined(_WIN32) && !defined(__GNUC__)
+#define xalloca _alloca
+#define xvsnprintf _vsnprintf
#else
-# define xalloca alloca
-# define xvsnprintf vsnprintf
-# define xsnprintf snprintf
-# define xstrcat(dest,src,size) strcat(dest,src)
+#define xalloca alloca
+#define xvsnprintf vsnprintf
#endif
-#if defined(ONIG_DEBUG_MEMLEAK) && defined(_MSC_VER)
-# define _CRTDBG_MAP_ALLOC
-# include <malloc.h>
-# include <crtdbg.h>
-#endif
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+#define ONIG_STATE_INC(reg) (reg)->state++
+#define ONIG_STATE_DEC(reg) (reg)->state--
+
+#define ONIG_STATE_INC_THREAD(reg) do {\
+ THREAD_ATOMIC_START;\
+ (reg)->state++;\
+ THREAD_ATOMIC_END;\
+} while(0)
+#define ONIG_STATE_DEC_THREAD(reg) do {\
+ THREAD_ATOMIC_START;\
+ (reg)->state--;\
+ THREAD_ATOMIC_END;\
+} while(0)
+#else
+#define ONIG_STATE_INC(reg) /* Nothing */
+#define ONIG_STATE_DEC(reg) /* Nothing */
+#define ONIG_STATE_INC_THREAD(reg) /* Nothing */
+#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
+
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
#if defined(HAVE_ALLOCA_H) && (defined(_AIX) || !defined(__GNUC__))
-# include <alloca.h>
+#include <alloca.h>
#endif
-#include <string.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
#include <ctype.h>
#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <sys/types.h>
#endif
#ifdef HAVE_STDINT_H
@@ -243,10 +282,12 @@
# include <inttypes.h>
#endif
-#include <stddef.h>
+#ifdef STDC_HEADERS
+# include <stddef.h>
+#endif
#ifdef _WIN32
-# include <malloc.h> /* for alloca() */
+#include <malloc.h> /* for alloca() */
#endif
#ifdef ONIG_DEBUG
@@ -254,32 +295,28 @@
#endif
#ifdef _WIN32
-# if defined(_MSC_VER) && (_MSC_VER < 1300)
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#ifndef _INTPTR_T_DEFINED
+#define _INTPTR_T_DEFINED
typedef int intptr_t;
-# endif
-# ifndef _UINTPTR_T_DEFINED
-# define _UINTPTR_T_DEFINED
+#endif
+#ifndef _UINTPTR_T_DEFINED
+#define _UINTPTR_T_DEFINED
typedef unsigned int uintptr_t;
-# endif
-# endif
+#endif
+#endif
#endif /* _WIN32 */
#ifndef PRIdPTR
-# ifdef _WIN64
-# define PRIdPTR "I64d"
-# define PRIuPTR "I64u"
-# define PRIxPTR "I64x"
-# else
-# define PRIdPTR "ld"
-# define PRIuPTR "lu"
-# define PRIxPTR "lx"
-# endif
+#ifdef _WIN64
+#define PRIdPTR "I64d"
+#define PRIuPTR "I64u"
+#define PRIxPTR "I64x"
+#else
+#define PRIdPTR "ld"
+#define PRIuPTR "lu"
+#define PRIxPTR "lx"
#endif
-
-#ifndef PRIdPTRDIFF
-# define PRIdPTRDIFF PRIdPTR
#endif
#include "regenc.h"
@@ -287,10 +324,10 @@ typedef unsigned int uintptr_t;
RUBY_SYMBOL_EXPORT_BEGIN
#ifdef MIN
-# undef MIN
+#undef MIN
#endif
#ifdef MAX
-# undef MAX
+#undef MAX
#endif
#define MIN(a,b) (((a)>(b))?(b):(a))
#define MAX(a,b) (((a)<(b))?(b):(a))
@@ -305,28 +342,28 @@ RUBY_SYMBOL_EXPORT_BEGIN
#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
-# define PLATFORM_GET_INC(val,p,type) do{\
+#define PLATFORM_GET_INC(val,p,type) do{\
val = *(type* )p;\
(p) += sizeof(type);\
} while(0)
#else
-# define PLATFORM_GET_INC(val,p,type) do{\
+#define PLATFORM_GET_INC(val,p,type) do{\
xmemcpy(&val, (p), sizeof(type));\
(p) += sizeof(type);\
} while(0)
/* sizeof(OnigCodePoint) */
-# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
+#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
-# define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
+#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
(pad_size) = WORD_ALIGNMENT_SIZE \
- ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
} while (0)
-# define ALIGNMENT_RIGHT(addr) do {\
+#define ALIGNMENT_RIGHT(addr) do {\
(addr) += (WORD_ALIGNMENT_SIZE - 1);\
(addr) -= ((uintptr_t )(addr) % WORD_ALIGNMENT_SIZE);\
} while (0)
@@ -355,17 +392,17 @@ typedef unsigned int BitStatusType;
#define BIT_STATUS_CLEAR(stats) (stats) = 0
#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0)
#define BIT_STATUS_AT(stats,n) \
- ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & ((BitStatusType )1 << n)) : ((stats) & 1))
+ ((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & (1 << n)) : ((stats) & 1))
#define BIT_STATUS_ON_AT(stats,n) do {\
- if ((n) < (int )BIT_STATUS_BITS_NUM)\
+ if ((n) < (int )BIT_STATUS_BITS_NUM) \
(stats) |= (1 << (n));\
else\
(stats) |= 1;\
} while (0)
#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\
- if ((n) < (int )BIT_STATUS_BITS_NUM)\
+ if ((n) < (int )BIT_STATUS_BITS_NUM)\
(stats) |= (1 << (n));\
} while (0)
@@ -390,6 +427,7 @@ typedef unsigned int BitStatusType;
#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL)
#define IS_NOTBOS(option) ((option) & ONIG_OPTION_NOTBOS)
#define IS_NOTEOS(option) ((option) & ONIG_OPTION_NOTEOS)
+#define IS_POSIX_REGION(option) ((option) & ONIG_OPTION_POSIX_REGION)
#define IS_ASCII_RANGE(option) ((option) & ONIG_OPTION_ASCII_RANGE)
#define IS_POSIX_BRACKET_ALL_RANGE(option) ((option) & ONIG_OPTION_POSIX_BRACKET_ALL_RANGE)
#define IS_WORD_BOUND_ALL_RANGE(option) ((option) & ONIG_OPTION_WORD_BOUND_ALL_RANGE)
@@ -430,7 +468,7 @@ typedef Bits* BitSetRef;
} while (0)
#define BS_ROOM(bs,pos) (bs)[(int )(pos) / BITS_IN_ROOM]
-#define BS_BIT(pos) (1U << ((int )(pos) % BITS_IN_ROOM))
+#define BS_BIT(pos) (1 << ((int )(pos) % BITS_IN_ROOM))
#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos))
#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos)
@@ -447,29 +485,23 @@ typedef struct _BBuf {
#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size))
#define BBUF_SIZE_INC(buf,inc) do{\
- UChar *tmp;\
(buf)->alloc += (inc);\
- tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
- if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\
- (buf)->p = tmp;\
+ (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
+ if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
} while (0)
#define BBUF_EXPAND(buf,low) do{\
- UChar *tmp;\
do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\
- tmp = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
- if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\
- (buf)->p = tmp;\
+ (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
+ if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
} while (0)
#define BBUF_ENSURE_SIZE(buf,size) do{\
unsigned int new_alloc = (buf)->alloc;\
while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\
if ((buf)->alloc != new_alloc) {\
- UChar *tmp;\
- tmp = (UChar* )xrealloc((buf)->p, new_alloc);\
- if (IS_NULL(tmp)) return(ONIGERR_MEMORY);\
- (buf)->p = tmp;\
+ (buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\
+ if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
(buf)->alloc = new_alloc;\
}\
} while (0)
@@ -572,6 +604,7 @@ enum OpCode {
OP_CCLASS_NOT,
OP_CCLASS_MB_NOT,
OP_CCLASS_MIX_NOT,
+ OP_CCLASS_NODE, /* pointer to CClassNode node */
OP_ANYCHAR, /* "." */
OP_ANYCHAR_ML, /* "." multi-line */
@@ -600,6 +633,7 @@ enum OpCode {
OP_END_LINE,
OP_SEMI_END_BUF,
OP_BEGIN_POSITION,
+ OP_BEGIN_POS_OR_LINE, /* used for implicit anchor optimization */
OP_BACKREF1,
OP_BACKREF2,
@@ -644,9 +678,6 @@ enum OpCode {
OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */
OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */
OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
- OP_PUSH_ABSENT_POS, /* (?~...) start */
- OP_ABSENT, /* (?~...) start of inner loop */
- OP_ABSENT_END, /* (?~...) end */
OP_CALL, /* \g<name> */
OP_RETURN,
@@ -734,15 +765,12 @@ typedef void* PointerType;
#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)
#define SIZE_OP_RETURN SIZE_OPCODE
#define SIZE_OP_CONDITION (SIZE_OPCODE + SIZE_MEMNUM + SIZE_RELADDR)
-#define SIZE_OP_PUSH_ABSENT_POS SIZE_OPCODE
-#define SIZE_OP_ABSENT (SIZE_OPCODE + SIZE_RELADDR)
-#define SIZE_OP_ABSENT_END SIZE_OPCODE
#ifdef USE_COMBINATION_EXPLOSION_CHECK
-# define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
-# define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
-# define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
-# define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
+#define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
+#define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
+#define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
+#define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
#endif
#define MC_ESC(syn) (syn)->meta_char_table.esc
@@ -790,10 +818,13 @@ typedef void* PointerType;
/* cclass node */
#define FLAG_NCCLASS_NOT (1<<0)
+#define FLAG_NCCLASS_SHARE (1<<1)
#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT)
+#define NCCLASS_SET_SHARE(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_SHARE)
#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT)
#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT)
+#define IS_NCCLASS_SHARE(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE)
typedef struct {
int type;
@@ -848,10 +879,6 @@ typedef struct _OnigStackType {
UChar *pstr; /* string position */
} call_frame;
#endif
- struct {
- UChar *abs_pstr; /* absent start position */
- const UChar *end_pstr; /* end position */
- } absent_pos;
} u;
} OnigStackType;
@@ -876,14 +903,6 @@ typedef struct {
#define IS_CODE_SB_WORD(enc,code) \
(ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code))
-typedef struct OnigEndCallListItem {
- struct OnigEndCallListItem* next;
- void (*func)(void);
-} OnigEndCallListItemType;
-
-extern void onig_add_end_call(void (*func)(void));
-
-
#ifdef ONIG_DEBUG
typedef struct {
@@ -894,45 +913,60 @@ typedef struct {
extern OnigOpInfoType OnigOpInfo[];
+extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc));
-extern void onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar* bpend, UChar** nextp, OnigEncoding enc);
-
-# ifdef ONIG_DEBUG_STATISTICS
-extern void onig_statistics_init(void);
-extern void onig_print_statistics(FILE* f);
-# endif
+#ifdef ONIG_DEBUG_STATISTICS
+extern void onig_statistics_init P_((void));
+extern void onig_print_statistics P_((FILE* f));
#endif
-
-extern UChar* onig_error_code_to_format(OnigPosition code);
-extern void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, va_list args);
-extern void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...);
-extern int onig_bbuf_init(BBuf* buf, OnigDistance size);
-extern int onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo);
-#ifdef RUBY
-extern int onig_compile_ruby(regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline);
#endif
-extern void onig_transfer(regex_t* to, regex_t* from);
-extern int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc);
-extern int onig_is_code_in_cc_len(int enclen, OnigCodePoint code, CClassNode* cc);
+
+extern UChar* onig_error_code_to_format P_((OnigPosition code));
+extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
+extern int onig_bbuf_init P_((BBuf* buf, OnigDistance size));
+extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo, const char *sourcefile, int sourceline));
+extern void onig_chain_reduce P_((regex_t* reg));
+extern void onig_chain_link_add P_((regex_t* to, regex_t* add));
+extern void onig_transfer P_((regex_t* to, regex_t* from));
+extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));
+extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc));
/* strend hash */
typedef void hash_table_type;
#ifdef RUBY
-# include "ruby/st.h"
+#include "ruby/st.h"
+typedef st_data_t hash_data_type;
#else
-# include "st.h"
+#include "st.h"
+typedef uintptr_t hash_data_type;
#endif
-typedef st_data_t hash_data_type;
-extern hash_table_type* onig_st_init_strend_table_with_size(st_index_t size);
-extern int onig_st_lookup_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value);
-extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value);
+extern hash_table_type* onig_st_init_strend_table_with_size P_((st_index_t size));
+extern int onig_st_lookup_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value));
+extern int onig_st_insert_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value));
-#ifdef RUBY
-extern size_t onig_memsize(const regex_t *reg);
-extern size_t onig_region_memsize(const struct re_registers *regs);
-#endif
+/* encoding property management */
+#define PROPERTY_LIST_ADD_PROP(Name, CR) \
+ r = onigenc_property_list_add_property((UChar* )Name, CR,\
+ &PropertyNameTable, &PropertyList, &PropertyListNum,\
+ &PropertyListSize);\
+ if (r != 0) goto end
+
+#define PROPERTY_LIST_INIT_CHECK \
+ if (PropertyInited == 0) {\
+ int r = onigenc_property_list_init(init_property_list);\
+ if (r != 0) return r;\
+ }
+
+extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));
+
+typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
+
+extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
+
+extern size_t onig_memsize P_((const regex_t *reg));
+extern size_t onig_region_memsize P_((const struct re_registers *regs));
RUBY_SYMBOL_EXPORT_END
-#endif /* ONIGMO_REGINT_H */
+#endif /* ONIGURUMA_REGINT_H */
diff --git a/regparse.c b/regparse.c
index c2812924a6..094332f90e 100644
--- a/regparse.c
+++ b/regparse.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 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
@@ -29,13 +29,11 @@
*/
#include "regparse.h"
-#include <stdarg.h>
#define WARN_BUFSIZE 256
#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
-extern const int onigenc_unicode_version_number[3];
const OnigSyntaxType OnigSyntaxRuby = {
(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
@@ -53,14 +51,10 @@ const OnigSyntaxType OnigSyntaxRuby = {
ONIG_SYN_OP2_CCLASS_SET_OP | ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL |
ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META | ONIG_SYN_OP2_ESC_V_VTAB |
ONIG_SYN_OP2_ESC_H_XDIGIT |
-#ifndef RUBY
- ONIG_SYN_OP2_ESC_U_HEX4 |
-#endif
ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER |
ONIG_SYN_OP2_QMARK_LPAREN_CONDITION |
ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK |
- ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP |
- ONIG_SYN_OP2_QMARK_TILDE_ABSENT )
+ ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP )
, ( SYN_GNU_REGEX_BV |
ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV |
ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND |
@@ -111,26 +105,6 @@ extern void onig_set_verb_warn_func(OnigWarnFunc f)
static void CC_DUP_WARN(ScanEnv *env);
-
-static unsigned int ParseDepthLimit = DEFAULT_PARSE_DEPTH_LIMIT;
-
-extern unsigned int
-onig_get_parse_depth_limit(void)
-{
- return ParseDepthLimit;
-}
-
-extern int
-onig_set_parse_depth_limit(unsigned int depth)
-{
- if (depth == 0)
- ParseDepthLimit = DEFAULT_PARSE_DEPTH_LIMIT;
- else
- ParseDepthLimit = depth;
- return 0;
-}
-
-
static void
bbuf_free(BBuf* bbuf)
{
@@ -242,7 +216,6 @@ bitset_copy(BitSetRef dest, BitSetRef bs)
for (i = 0; i < BITSET_SIZE; i++) { dest[i] = bs[i]; }
}
-#if defined(USE_NAMED_GROUP) && !defined(USE_ST_LIBRARY)
extern int
onig_strncmp(const UChar* s1, const UChar* s2, int n)
{
@@ -254,7 +227,6 @@ onig_strncmp(const UChar* s1, const UChar* s2, int n)
}
return 0;
}
-#endif
extern void
onig_strcpy(UChar* dest, const UChar* src, const UChar* end)
@@ -293,9 +265,9 @@ strdup_with_null(OnigEncoding enc, UChar* s, UChar* end)
#ifdef __GNUC__
/* get rid of Wunused-but-set-variable and Wuninitialized */
-# define PFETCH_READY UChar* pfetch_prev = NULL; (void)pfetch_prev
+#define PFETCH_READY UChar* pfetch_prev = NULL; (void)pfetch_prev
#else
-# define PFETCH_READY UChar* pfetch_prev
+#define PFETCH_READY UChar* pfetch_prev
#endif
#define PEND (p < end ? 0 : 1)
#define PUNFETCH p = pfetch_prev
@@ -353,11 +325,7 @@ strcat_capa_from_static(UChar* dest, UChar* dest_end,
#ifdef USE_ST_LIBRARY
-# ifdef RUBY
-# include "ruby/st.h"
-# else
-# include "st.h"
-# endif
+#include "ruby/st.h"
typedef struct {
const UChar* s;
@@ -449,7 +417,7 @@ onig_st_insert_strend(hash_table_type* table, const UChar* str_key,
#ifdef USE_NAMED_GROUP
-# define INIT_NAME_BACKREFS_ALLOC_NUM 8
+#define INIT_NAME_BACKREFS_ALLOC_NUM 8
typedef struct {
UChar* name;
@@ -460,12 +428,12 @@ typedef struct {
int* back_refs;
} NameEntry;
-# ifdef USE_ST_LIBRARY
+#ifdef USE_ST_LIBRARY
typedef st_table NameTable;
typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */
-# ifdef ONIG_DEBUG
+#ifdef ONIG_DEBUG
static int
i_print_name_entry(UChar* key, NameEntry* e, void* arg)
{
@@ -499,7 +467,7 @@ onig_print_names(FILE* fp, regex_t* reg)
}
return 0;
}
-# endif /* ONIG_DEBUG */
+#endif /* ONIG_DEBUG */
static int
i_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED)
@@ -562,8 +530,8 @@ static int
i_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg)
{
int r = (*(arg->func))(e->name,
- e->name + e->name_len,
- e->back_num,
+ e->name + e->name_len,
+ e->back_num,
(e->back_num > 1 ? e->back_refs : &(e->back_ref1)),
arg->reg, arg->arg);
if (r != 0) {
@@ -621,7 +589,7 @@ onig_renumber_name_table(regex_t* reg, GroupNumRemap* map)
extern int
-onig_number_of_names(const regex_t* reg)
+onig_number_of_names(regex_t* reg)
{
NameTable* t = (NameTable* )reg->name_table;
@@ -631,9 +599,9 @@ onig_number_of_names(const regex_t* reg)
return 0;
}
-# else /* USE_ST_LIBRARY */
+#else /* USE_ST_LIBRARY */
-# define INIT_NAMES_ALLOC_NUM 8
+#define INIT_NAMES_ALLOC_NUM 8
typedef struct {
NameEntry* e;
@@ -641,7 +609,7 @@ typedef struct {
int alloc;
} NameTable;
-# ifdef ONIG_DEBUG
+#ifdef ONIG_DEBUG
extern int
onig_print_names(FILE* fp, regex_t* reg)
{
@@ -672,7 +640,7 @@ onig_print_names(FILE* fp, regex_t* reg)
}
return 0;
}
-# endif
+#endif
static int
names_clear(regex_t* reg)
@@ -757,7 +725,7 @@ onig_foreach_name(regex_t* reg,
}
extern int
-onig_number_of_names(const regex_t* reg)
+onig_number_of_names(regex_t* reg)
{
NameTable* t = (NameTable* )reg->name_table;
@@ -767,7 +735,7 @@ onig_number_of_names(const regex_t* reg)
return 0;
}
-# endif /* else USE_ST_LIBRARY */
+#endif /* else USE_ST_LIBRARY */
static int
name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
@@ -781,7 +749,7 @@ name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
e = name_find(reg, name, name_end);
if (IS_NULL(e)) {
-# ifdef USE_ST_LIBRARY
+#ifdef USE_ST_LIBRARY
if (IS_NULL(t)) {
t = onig_st_init_strend_table_with_size(5);
reg->name_table = (void* )t;
@@ -802,7 +770,7 @@ name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
e->back_alloc = 0;
e->back_refs = (int* )NULL;
-# else
+#else
if (IS_NULL(t)) {
alloc = INIT_NAMES_ALLOC_NUM;
@@ -845,7 +813,7 @@ name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
e->name = strdup_with_null(reg->enc, name, name_end);
if (IS_NULL(e->name)) return ONIGERR_MEMORY;
e->name_len = name_end - name;
-# endif
+#endif
}
if (e->back_num >= 1 &&
@@ -908,7 +876,7 @@ onig_name_to_group_numbers(regex_t* reg, const UChar* name,
extern int
onig_name_to_backref_number(regex_t* reg, const UChar* name,
- const UChar* name_end, const OnigRegion *region)
+ const UChar* name_end, OnigRegion *region)
{
int i, n, *nums;
@@ -941,7 +909,7 @@ onig_name_to_group_numbers(regex_t* reg, const UChar* name,
extern int
onig_name_to_backref_number(regex_t* reg, const UChar* name,
- const UChar* name_end, const OnigRegion* region)
+ const UChar* name_end, OnigRegion* region)
{
return ONIG_NO_SUPPORT_CONFIG;
}
@@ -954,14 +922,14 @@ onig_foreach_name(regex_t* reg,
}
extern int
-onig_number_of_names(const regex_t* reg)
+onig_number_of_names(regex_t* reg)
{
return 0;
}
#endif /* else USE_NAMED_GROUP */
extern int
-onig_noname_group_capture_is_active(const regex_t* reg)
+onig_noname_group_capture_is_active(regex_t* reg)
{
if (ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_DONT_CAPTURE_GROUP))
return 0;
@@ -1008,7 +976,6 @@ scan_env_clear(ScanEnv* env)
env->curr_max_regnum = 0;
env->has_recursion = 0;
#endif
- env->parse_depth = 0;
env->warnings_flag = 0;
}
@@ -1026,15 +993,14 @@ scan_env_add_mem_entry(ScanEnv* env)
if (IS_NULL(env->mem_nodes_dynamic)) {
alloc = INIT_SCANENV_MEMNODES_ALLOC_SIZE;
p = (Node** )xmalloc(sizeof(Node*) * alloc);
- CHECK_NULL_RETURN_MEMERR(p);
xmemcpy(p, env->mem_nodes_static,
sizeof(Node*) * SCANENV_MEMNODES_SIZE);
}
else {
alloc = env->mem_alloc * 2;
p = (Node** )xrealloc(env->mem_nodes_dynamic, sizeof(Node*) * alloc);
- CHECK_NULL_RETURN_MEMERR(p);
}
+ CHECK_NULL_RETURN_MEMERR(p);
for (i = env->num_mem + 1; i < alloc; i++)
p[i] = NULL_NODE;
@@ -1059,6 +1025,14 @@ scan_env_set_mem_node(ScanEnv* env, int num, Node* node)
}
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+typedef struct _FreeNode {
+ struct _FreeNode* next;
+} FreeNode;
+
+static FreeNode* FreeNodeList = (FreeNode* )NULL;
+#endif
+
extern void
onig_node_free(Node* node)
{
@@ -1079,7 +1053,18 @@ onig_node_free(Node* node)
{
Node* next_node = NCDR(node);
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+ {
+ FreeNode* n = (FreeNode* )node;
+
+ THREAD_ATOMIC_START;
+ n->next = FreeNodeList;
+ FreeNodeList = n;
+ THREAD_ATOMIC_END;
+ }
+#else
xfree(node);
+#endif
node = next_node;
goto start;
}
@@ -1089,8 +1074,9 @@ onig_node_free(Node* node)
{
CClassNode* cc = NCCLASS(node);
+ if (IS_NCCLASS_SHARE(cc)) return ;
if (cc->mbuf)
- bbuf_free(cc->mbuf);
+ bbuf_free(cc->mbuf);
}
break;
@@ -1115,19 +1101,78 @@ onig_node_free(Node* node)
break;
}
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+ {
+ FreeNode* n = (FreeNode* )node;
+
+ THREAD_ATOMIC_START;
+ n->next = FreeNodeList;
+ FreeNodeList = n;
+ THREAD_ATOMIC_END;
+ }
+#else
xfree(node);
+#endif
}
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+extern int
+onig_free_node_list(void)
+{
+ FreeNode* n;
+
+ /* THREAD_ATOMIC_START; */
+ while (IS_NOT_NULL(FreeNodeList)) {
+ n = FreeNodeList;
+ FreeNodeList = FreeNodeList->next;
+ xfree(n);
+ }
+ /* THREAD_ATOMIC_END; */
+ return 0;
+}
+#endif
+
static Node*
node_new(void)
{
Node* node;
+#ifdef USE_PARSE_TREE_NODE_RECYCLE
+ THREAD_ATOMIC_START;
+ if (IS_NOT_NULL(FreeNodeList)) {
+ node = (Node* )FreeNodeList;
+ FreeNodeList = FreeNodeList->next;
+ THREAD_ATOMIC_END;
+ return node;
+ }
+ THREAD_ATOMIC_END;
+#endif
+
node = (Node* )xmalloc(sizeof(Node));
/* xmemset(node, 0, sizeof(Node)); */
return node;
}
+#if defined(USE_MULTI_THREAD_SYSTEM) && \
+ defined(USE_SHARED_CCLASS_TABLE) && \
+ defined(USE_PARSE_TREE_NODE_RECYCLE)
+static Node*
+node_new_locked(void)
+{
+ Node* node;
+
+ if (IS_NOT_NULL(FreeNodeList)) {
+ node = (Node* )FreeNodeList;
+ FreeNodeList = FreeNodeList->next;
+ return node;
+ }
+
+ node = (Node* )xmalloc(sizeof(Node));
+ /* xmemset(node, 0, sizeof(Node)); */
+ return node;
+}
+#endif
+
static void
initialize_cclass(CClassNode* cc)
{
@@ -1148,6 +1193,75 @@ node_new_cclass(void)
return node;
}
+#if defined(USE_MULTI_THREAD_SYSTEM) && \
+ defined(USE_SHARED_CCLASS_TABLE) && \
+ defined(USE_PARSE_TREE_NODE_RECYCLE)
+static Node*
+node_new_cclass_locked(void)
+{
+ Node* node = node_new_locked();
+ CHECK_NULL_RETURN(node);
+
+ SET_NTYPE(node, NT_CCLASS);
+ initialize_cclass(NCCLASS(node));
+ return node;
+}
+#else
+#define node_new_cclass_locked() node_new_cclass()
+#endif
+
+#ifdef USE_SHARED_CCLASS_TABLE
+static Node*
+node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out,
+ const OnigCodePoint ranges[])
+{
+ int n, i;
+ CClassNode* cc;
+ OnigCodePoint j;
+
+ Node* node = node_new_cclass_locked();
+ CHECK_NULL_RETURN(node);
+
+ cc = NCCLASS(node);
+ if (not != 0) NCCLASS_SET_NOT(cc);
+
+ BITSET_CLEAR(cc->bs);
+ if (sb_out > 0 && IS_NOT_NULL(ranges)) {
+ n = ONIGENC_CODE_RANGE_NUM(ranges);
+ for (i = 0; i < n; i++) {
+ for (j = ONIGENC_CODE_RANGE_FROM(ranges, i);
+ j <= (OnigCodePoint )ONIGENC_CODE_RANGE_TO(ranges, i); j++) {
+ if (j >= sb_out) goto sb_end;
+
+ BITSET_SET_BIT(cc->bs, j);
+ }
+ }
+ }
+
+ sb_end:
+ if (IS_NULL(ranges)) {
+ is_null:
+ cc->mbuf = NULL;
+ }
+ else {
+ BBuf* bbuf;
+
+ n = ONIGENC_CODE_RANGE_NUM(ranges);
+ if (n == 0) goto is_null;
+
+ bbuf = (BBuf* )xmalloc(sizeof(BBuf));
+ CHECK_NULL_RETURN(bbuf);
+ bbuf->alloc = n + 1;
+ bbuf->used = n + 1;
+ bbuf->p = (UChar* )((void* )ranges);
+
+ cc->mbuf = bbuf;
+ }
+
+ return node;
+}
+#endif /* USE_SHARED_CCLASS_TABLE */
+
static Node*
node_new_ctype(int type, int not, int ascii_range)
{
@@ -1434,7 +1548,6 @@ node_str_cat_codepoint(Node* node, OnigEncoding enc, OnigCodePoint c)
return onig_node_str_cat(node, buf, buf + num);
}
-#if 0
extern void
onig_node_conv_to_str_node(Node* node, int flag)
{
@@ -1444,7 +1557,6 @@ onig_node_conv_to_str_node(Node* node, int flag)
NSTR(node)->s = NSTR(node)->buf;
NSTR(node)->end = NSTR(node)->buf;
}
-#endif
extern void
onig_node_str_clear(Node* node)
@@ -1603,7 +1715,6 @@ scan_unsigned_hexadecimal_number(UChar** src, UChar* end, int minlen,
}
else {
PUNFETCH;
- maxlen++;
break;
}
}
@@ -1775,7 +1886,7 @@ add_code_range0(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePoint to,
static int
add_code_range(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePoint to)
{
- return add_code_range0(pbuf, env, from, to, 1);
+ return add_code_range0(pbuf, env, from, to, 1);
}
static int
@@ -1879,7 +1990,7 @@ or_code_range_buf(OnigEncoding enc, BBuf* bbuf1, int not1,
static int
and_code_range1(BBuf** pbuf, ScanEnv* env, OnigCodePoint from1, OnigCodePoint to1,
- OnigCodePoint* data, int n)
+ OnigCodePoint* data, int n)
{
int i, r;
OnigCodePoint from2, to2;
@@ -2093,8 +2204,8 @@ or_cclass(CClassNode* dest, CClassNode* cc, ScanEnv* env)
static void UNKNOWN_ESC_WARN(ScanEnv *env, int c);
-static OnigCodePoint
-conv_backslash_value(OnigCodePoint c, ScanEnv* env)
+static int
+conv_backslash_value(int c, ScanEnv* env)
{
if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_CONTROL_CHARS)) {
switch (c) {
@@ -2120,7 +2231,7 @@ conv_backslash_value(OnigCodePoint c, ScanEnv* env)
}
#ifdef USE_NO_INVALID_QUANTIFIER
-# define is_invalid_quantifier_target(node) 0
+#define is_invalid_quantifier_target(node) 0
#else
static int
is_invalid_quantifier_target(Node* node)
@@ -2192,7 +2303,6 @@ enum ReduceType {
};
static enum ReduceType const ReduceTypeTable[6][6] = {
-/* '?', '*', '+', '??', '*?', '+?' p / c */
{RQ_DEL, RQ_A, RQ_A, RQ_QQ, RQ_AQ, RQ_ASIS}, /* '?' */
{RQ_DEL, RQ_DEL, RQ_DEL, RQ_P_QQ, RQ_P_QQ, RQ_DEL}, /* '*' */
{RQ_A, RQ_A, RQ_DEL, RQ_ASIS, RQ_P_QQ, RQ_DEL}, /* '+' */
@@ -2395,7 +2505,6 @@ fetch_range_quantifier(UChar** src, UChar* end, OnigToken* tok, ScanEnv* env)
PFETCH(c);
if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) {
if (c != MC_ESC(env->syntax)) goto invalid;
- if (PEND) goto invalid;
PFETCH(c);
}
if (c != '}') goto invalid;
@@ -2419,7 +2528,7 @@ fetch_range_quantifier(UChar** src, UChar* end, OnigToken* tok, ScanEnv* env)
/* \M-, \C-, \c, or \... */
static int
-fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env, OnigCodePoint* val)
+fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env)
{
int v;
OnigCodePoint c;
@@ -2438,8 +2547,9 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env, OnigCodePoint* val)
if (PEND) return ONIGERR_END_PATTERN_AT_META;
PFETCH_S(c);
if (c == MC_ESC(env->syntax)) {
- v = fetch_escaped_value(&p, end, env, &c);
- if (v < 0) return v;
+ v = fetch_escaped_value(&p, end, env);
+ if (v < 0) return v;
+ c = (OnigCodePoint )v;
}
c = ((c & 0xff) | 0x80);
}
@@ -2463,14 +2573,15 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env, OnigCodePoint* val)
if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL;
PFETCH_S(c);
if (c == '?') {
- c = 0177;
+ c = 0177;
}
else {
- if (c == MC_ESC(env->syntax)) {
- v = fetch_escaped_value(&p, end, env, &c);
- if (v < 0) return v;
- }
- c &= 0x9f;
+ if (c == MC_ESC(env->syntax)) {
+ v = fetch_escaped_value(&p, end, env);
+ if (v < 0) return v;
+ c = (OnigCodePoint )v;
+ }
+ c &= 0x9f;
}
break;
}
@@ -2485,8 +2596,7 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env, OnigCodePoint* val)
}
*src = p;
- *val = c;
- return 0;
+ return c;
}
static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env);
@@ -2507,13 +2617,7 @@ get_name_end_code_point(OnigCodePoint start)
}
#ifdef USE_NAMED_GROUP
-# ifdef RUBY
-# define ONIGENC_IS_CODE_NAME(enc, c) TRUE
-# else
-# define ONIGENC_IS_CODE_NAME(enc, c) ONIGENC_IS_CODE_WORD(enc, c)
-# endif
-
-# ifdef USE_BACKREF_WITH_LEVEL
+#ifdef USE_BACKREF_WITH_LEVEL
/*
\k<name+n>, \k<name-n>
\k<num+n>, \k<num-n>
@@ -2558,7 +2662,7 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
sign = -1;
pnum_head = p;
}
- else if (!ONIGENC_IS_CODE_NAME(enc, c)) {
+ else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
}
}
@@ -2573,14 +2677,14 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
if (is_num != 0) {
if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
+ is_num = 1;
}
else {
- r = ONIGERR_INVALID_GROUP_NAME;
- is_num = 0;
+ r = ONIGERR_INVALID_GROUP_NAME;
+ is_num = 0;
}
}
- else if (!ONIGENC_IS_CODE_NAME(enc, c)) {
+ else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
}
}
@@ -2590,10 +2694,6 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
int level;
int flag = (c == '-' ? -1 : 1);
- if (PEND) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- goto end;
- }
PFETCH(c);
if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err;
PUNFETCH;
@@ -2602,11 +2702,9 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
*rlevel = (level * flag);
exist_level = 1;
- if (!PEND) {
- PFETCH(c);
- if (c == end_code)
- goto end;
- }
+ PFETCH(c);
+ if (c == end_code)
+ goto end;
}
err:
@@ -2633,7 +2731,7 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
return r;
}
}
-# endif /* USE_BACKREF_WITH_LEVEL */
+#endif /* USE_BACKREF_WITH_LEVEL */
/*
ref: 0 -> define name (don't allow number name)
@@ -2670,24 +2768,24 @@ fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
if (ref == 1)
- is_num = 1;
+ is_num = 1;
else {
- r = ONIGERR_INVALID_GROUP_NAME;
- is_num = 0;
+ r = ONIGERR_INVALID_GROUP_NAME;
+ is_num = 0;
}
}
else if (c == '-') {
if (ref == 1) {
- is_num = 2;
- sign = -1;
- pnum_head = p;
+ is_num = 2;
+ sign = -1;
+ pnum_head = p;
}
else {
r = ONIGERR_INVALID_GROUP_NAME;
is_num = 0;
}
}
- else if (!ONIGENC_IS_CODE_NAME(enc, c)) {
+ else if (!ONIGENC_IS_CODE_WORD(enc, c)) {
r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
}
}
@@ -2697,45 +2795,40 @@ fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
name_end = p;
PFETCH_S(c);
if (c == end_code || c == ')') {
- if (is_num == 2) {
- r = ONIGERR_INVALID_GROUP_NAME;
- goto teardown;
- }
+ if (is_num == 2) r = ONIGERR_INVALID_GROUP_NAME;
break;
}
if (is_num != 0) {
- if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
- is_num = 1;
- }
- else {
- if (!ONIGENC_IS_CODE_WORD(enc, c))
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- else
- r = ONIGERR_INVALID_GROUP_NAME;
- goto teardown;
- }
+ if (ONIGENC_IS_CODE_DIGIT(enc, c)) {
+ is_num = 1;
+ }
+ else {
+ if (!ONIGENC_IS_CODE_WORD(enc, c))
+ r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
+ else
+ r = ONIGERR_INVALID_GROUP_NAME;
+ is_num = 0;
+ }
}
else {
- if (!ONIGENC_IS_CODE_NAME(enc, c)) {
- r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
- goto teardown;
- }
+ if (!ONIGENC_IS_CODE_WORD(enc, c)) {
+ r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
+ }
}
}
if (c != end_code) {
r = ONIGERR_INVALID_GROUP_NAME;
name_end = end;
- goto err;
}
if (is_num != 0) {
*rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);
if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;
else if (*rback_num == 0) {
- r = ONIGERR_INVALID_GROUP_NAME;
- goto err;
+ r = ONIGERR_INVALID_GROUP_NAME;
+ goto err;
}
*rback_num *= sign;
@@ -2746,12 +2839,11 @@ fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
return 0;
}
else {
-teardown:
while (!PEND) {
name_end = p;
PFETCH_S(c);
if (c == end_code || c == ')')
- break;
+ break;
}
if (PEND)
name_end = end;
@@ -2840,6 +2932,8 @@ fetch_name(OnigCodePoint start_code, UChar** src, UChar* end,
}
#endif /* USE_NAMED_GROUP */
+void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
+ UChar* pat, UChar* pat_end, const UChar *fmt, va_list args);
static void
onig_syntax_warn(ScanEnv *env, const char *fmt, ...)
@@ -2851,14 +2945,10 @@ onig_syntax_warn(ScanEnv *env, const char *fmt, ...)
env->pattern, env->pattern_end,
(const UChar *)fmt, args);
va_end(args);
-#ifdef RUBY
if (env->sourcefile == NULL)
rb_warn("%s", (char *)buf);
else
rb_compile_warn(env->sourcefile, env->sourceline, "%s", (char *)buf);
-#else
- (*onig_warn)((char* )buf);
-#endif
}
static void
@@ -2882,10 +2972,6 @@ CLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv* env, UChar* c)
}
}
-#ifndef RTEST
-# define RTEST(v) 1
-#endif
-
static void
CC_DUP_WARN(ScanEnv *env)
{
@@ -3055,8 +3141,6 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case 'p':
case 'P':
- if (PEND) break;
-
c2 = PPEEK;
if (c2 == '{' &&
IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {
@@ -3064,7 +3148,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->type = TK_CHAR_PROPERTY;
tok->u.prop.not = (c == 'P' ? 1 : 0);
- if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
+ if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
PFETCH(c2);
if (c2 == '^') {
tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);
@@ -3087,10 +3171,10 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc);
if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
if (!PEND) {
- c2 = PPEEK;
- if (ONIGENC_IS_CODE_XDIGIT(enc, c2))
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
+ c2 = PPEEK;
+ if (ONIGENC_IS_CODE_XDIGIT(enc, c2))
+ return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
+ }
if (p > prev + enclen(enc, prev, end) && !PEND && (PPEEK_IS('}'))) {
PINC;
@@ -3132,40 +3216,13 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
break;
- case 'o':
- if (PEND) break;
-
- prev = p;
- if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_O_BRACE_OCTAL)) {
- PINC;
- num = scan_unsigned_octal_number(&p, end, 11, enc);
- if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
- if (!PEND) {
- c2 = PPEEK;
- if (ONIGENC_IS_CODE_DIGIT(enc, c2) && c2 < '8')
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
-
- if (p > prev + enclen(enc, prev, end) && !PEND && (PPEEK_IS('}'))) {
- PINC;
- tok->type = TK_CODE_POINT;
- tok->base = 8;
- tok->u.code = (OnigCodePoint )num;
- }
- else {
- /* can't read nothing or invalid format */
- p = prev;
- }
- }
- break;
-
case '0':
case '1': case '2': case '3': case '4': case '5': case '6': case '7':
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
PUNFETCH;
prev = p;
num = scan_unsigned_octal_number(&p, end, 3, enc);
- if (num < 0 || 0xff < num) return ONIGERR_TOO_BIG_NUMBER;
+ if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -3177,10 +3234,10 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
default:
PUNFETCH;
- num = fetch_escaped_value(&p, end, env, &c2);
+ num = fetch_escaped_value(&p, end, env);
if (num < 0) return num;
- if ((OnigCodePoint )tok->u.c != c2) {
- tok->u.code = (OnigCodePoint )c2;
+ if (tok->u.c != num) {
+ tok->u.code = (OnigCodePoint )num;
tok->type = TK_CODE_POINT;
}
break;
@@ -3238,15 +3295,15 @@ fetch_named_backref_token(OnigCodePoint c, OnigToken* tok, UChar** src,
prev = p;
-# ifdef USE_BACKREF_WITH_LEVEL
+#ifdef USE_BACKREF_WITH_LEVEL
name_end = NULL_UCHARP; /* no need. escape gcc warning. */
r = fetch_name_with_level(c, &p, end, &name_end,
env, &back_num, &tok->u.backref.level);
if (r == 1) tok->u.backref.exist_level = 1;
else tok->u.backref.exist_level = 0;
-# else
+#else
r = fetch_name(&p, end, &name_end, env, &back_num, 1);
-# endif
+#endif
if (r < 0) return r;
if (back_num != 0) {
@@ -3284,7 +3341,7 @@ fetch_named_backref_token(OnigCodePoint c, OnigToken* tok, UChar** src,
tok->type = TK_BACKREF;
tok->u.backref.by_name = 1;
- if (num == 1 || IS_SYNTAX_BV(syn, ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP)) {
+ if (num == 1) {
tok->u.backref.num = 1;
tok->u.backref.ref1 = backs[0];
}
@@ -3537,9 +3594,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc);
if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
if (!PEND) {
- if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK))
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
+ if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK))
+ return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
+ }
if ((p > prev + enclen(enc, prev, end)) && !PEND && PPEEK_IS('}')) {
PINC;
@@ -3580,39 +3637,13 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
break;
- case 'o':
- if (PEND) break;
-
- prev = p;
- if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_O_BRACE_OCTAL)) {
- PINC;
- num = scan_unsigned_octal_number(&p, end, 11, enc);
- if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
- if (!PEND) {
- OnigCodePoint c = PPEEK;
- if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8')
- return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
- }
-
- if ((p > prev + enclen(enc, prev, end)) && !PEND && PPEEK_IS('}')) {
- PINC;
- tok->type = TK_CODE_POINT;
- tok->u.code = (OnigCodePoint )num;
- }
- else {
- /* can't read nothing or invalid format */
- p = prev;
- }
- }
- break;
-
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
PUNFETCH;
prev = p;
num = onig_scan_unsigned_number(&p, end, enc);
if (num < 0 || num > ONIG_MAX_BACKREF_NUM) {
- goto skip_backref;
+ goto skip_backref;
}
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_DECIMAL_BACKREF) &&
@@ -3645,7 +3676,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
prev = p;
num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
- if (num < 0 || 0xff < num) return ONIGERR_TOO_BIG_NUMBER;
+ if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -3660,7 +3691,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
#ifdef USE_NAMED_GROUP
case 'k':
- if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) {
+ if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) {
PFETCH(c);
if (c == '<' || c == '\'') {
r = fetch_named_backref_token(c, tok, &p, end, env);
@@ -3676,8 +3707,8 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
#if defined(USE_SUBEXP_CALL) || defined(USE_NAMED_GROUP)
case 'g':
-# ifdef USE_NAMED_GROUP
- if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_BRACE_BACKREF)) {
+#ifdef USE_NAMED_GROUP
+ if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_BRACE_BACKREF)) {
PFETCH(c);
if (c == '{') {
r = fetch_named_backref_token(c, tok, &p, end, env);
@@ -3686,9 +3717,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
else
PUNFETCH;
}
-# endif
-# ifdef USE_SUBEXP_CALL
- if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) {
+#endif
+#ifdef USE_SUBEXP_CALL
+ if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) {
PFETCH(c);
if (c == '<' || c == '\'') {
int gnum = -1, rel = 0;
@@ -3725,7 +3756,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
PUNFETCH;
}
}
-# endif
+#endif
break;
#endif
@@ -3743,7 +3774,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->type = TK_CHAR_PROPERTY;
tok->u.prop.not = (c == 'P' ? 1 : 0);
- if (!PEND && IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
+ if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {
PFETCH(c);
if (c == '^') {
tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);
@@ -3776,20 +3807,16 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
break;
default:
- {
- OnigCodePoint c2;
-
- PUNFETCH;
- num = fetch_escaped_value(&p, end, env, &c2);
- if (num < 0) return num;
- /* set_raw: */
- if ((OnigCodePoint )tok->u.c != c2) {
- tok->type = TK_CODE_POINT;
- tok->u.code = (OnigCodePoint )c2;
- }
- else { /* string */
- p = tok->backp + enclen(enc, tok->backp, end);
- }
+ PUNFETCH;
+ num = fetch_escaped_value(&p, end, env);
+ if (num < 0) return num;
+ /* set_raw: */
+ if (tok->u.c != num) {
+ tok->type = TK_CODE_POINT;
+ tok->u.code = (OnigCodePoint )num;
+ }
+ else { /* string */
+ p = tok->backp + enclen(enc, tok->backp, end);
}
break;
}
@@ -3879,22 +3906,22 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case '(':
if (PPEEK_IS('?') &&
- IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {
- PINC;
- if (PPEEK_IS('#')) {
- PFETCH(c);
- while (1) {
- if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
- PFETCH(c);
- if (c == MC_ESC(syn)) {
- if (!PEND) PFETCH(c);
- }
- else {
- if (c == ')') break;
- }
- }
- goto start;
- }
+ IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {
+ PINC;
+ if (PPEEK_IS('#')) {
+ PFETCH(c);
+ while (1) {
+ if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
+ PFETCH(c);
+ if (c == MC_ESC(syn)) {
+ if (!PEND) PFETCH(c);
+ }
+ else {
+ if (c == ')') break;
+ }
+ }
+ goto start;
+ }
#ifdef USE_PERL_SUBEXP_CALL
/* (?&name), (?n), (?R), (?0), (?+n), (?-n) */
c = PPEEK;
@@ -3965,7 +3992,6 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
PFETCH_READY;
PINC; /* skip 'P' */
- if (PEND) return ONIGERR_UNDEFINED_GROUP_OPTION;
PFETCH(c);
if (c == '=') { /* (?P=name): backref */
r = fetch_named_backref_token((OnigCodePoint )'(', tok, &p, end, env);
@@ -3984,9 +4010,10 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->u.call.rel = 0;
break;
}
+ PUNFETCH;
}
#endif /* USE_CAPITAL_P_NAMED_GROUP */
- PUNFETCH;
+ PUNFETCH;
}
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break;
@@ -4064,8 +4091,8 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,
if (not == 0) {
for (i = 0; i < n; i++) {
- for (j = ONIGENC_CODE_RANGE_FROM(mbr, i);
- j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) {
+ for (j = ONIGENC_CODE_RANGE_FROM(mbr, i);
+ j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) {
if (j >= sb_out) {
if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) {
r = add_code_range_to_buf(&(cc->mbuf), env, j,
@@ -4076,7 +4103,7 @@ add_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,
goto sb_end;
}
- BITSET_SET_BIT_CHKDUP(cc->bs, j);
+ BITSET_SET_BIT_CHKDUP(cc->bs, j);
}
}
@@ -4149,15 +4176,12 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, int ascii_range, ScanEnv* en
CClassNode ccascii;
initialize_cclass(&ccascii);
if (ONIGENC_MBC_MINLEN(env->enc) > 1) {
- r = add_code_range(&(ccascii.mbuf), env, 0x00, 0x7F);
+ add_code_range(&(ccascii.mbuf), env, 0x00, 0x7F);
}
else {
bitset_set_range(env, ccascii.bs, 0x00, 0x7F);
- r = 0;
- }
- if (r == 0) {
- r = and_cclass(&ccwork, &ccascii, env);
}
+ r = and_cclass(&ccwork, &ccascii, env);
if (IS_NOT_NULL(ccascii.mbuf)) bbuf_free(ccascii.mbuf);
}
if (r == 0) {
@@ -4213,7 +4237,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, int ascii_range, ScanEnv* en
BITSET_SET_BIT_CHKDUP(cc->bs, c);
}
if (ascii_range)
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
+ ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
}
else {
for (c = 0; c < maxcode; c++) {
@@ -4221,7 +4245,7 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, int ascii_range, ScanEnv* en
BITSET_SET_BIT_CHKDUP(cc->bs, c);
}
if (! ascii_range)
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
+ ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
}
break;
@@ -4231,16 +4255,16 @@ add_ctype_to_cc(CClassNode* cc, int ctype, int not, int ascii_range, ScanEnv* en
if (ONIGENC_IS_CODE_WORD(enc, c)) BITSET_SET_BIT_CHKDUP(cc->bs, c);
}
if (! ascii_range)
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
+ ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
}
else {
for (c = 0; c < SINGLE_BYTE_SIZE; c++) {
- if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* check invalid code point */
+ if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* check invalid code point */
&& (! ONIGENC_IS_CODE_WORD(enc, c) || c >= maxcode))
BITSET_SET_BIT_CHKDUP(cc->bs, c);
}
if (ascii_range)
- ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
+ ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);
}
break;
@@ -4299,7 +4323,7 @@ parse_posix_bracket(CClassNode* cc, CClassNode* asc_cc,
if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) {
p = (UChar* )onigenc_step(enc, p, end, pb->len);
if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0)
- return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
+ return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
r = add_ctype_to_cc(cc, pb->ctype, not, ascii_range, env);
if (r != 0) return r;
@@ -4330,7 +4354,7 @@ parse_posix_bracket(CClassNode* cc, CClassNode* asc_cc,
if (! PEND) {
PFETCH_S(c);
if (c == ']')
- return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
+ return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
}
}
@@ -4410,7 +4434,7 @@ enum CCVALTYPE {
static int
next_state_class(CClassNode* cc, CClassNode* asc_cc,
- OnigCodePoint* vs, enum CCVALTYPE* type,
+ OnigCodePoint* vs, enum CCVALTYPE* type,
enum CCSTATE* state, ScanEnv* env)
{
int r;
@@ -4441,8 +4465,8 @@ next_state_class(CClassNode* cc, CClassNode* asc_cc,
static int
next_state_val(CClassNode* cc, CClassNode* asc_cc,
- OnigCodePoint *from, OnigCodePoint to,
- int* from_israw, int to_israw,
+ OnigCodePoint *vs, OnigCodePoint v,
+ int* vs_israw, int v_israw,
enum CCVALTYPE intype, enum CCVALTYPE* type,
enum CCSTATE* state, ScanEnv* env)
{
@@ -4451,15 +4475,15 @@ next_state_val(CClassNode* cc, CClassNode* asc_cc,
switch (*state) {
case CCS_VALUE:
if (*type == CCV_SB) {
- BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*from));
+ BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*vs));
if (IS_NOT_NULL(asc_cc))
- BITSET_SET_BIT(asc_cc->bs, (int )(*from));
+ BITSET_SET_BIT(asc_cc->bs, (int )(*vs));
}
else if (*type == CCV_CODE_POINT) {
- r = add_code_range(&(cc->mbuf), env, *from, *from);
+ r = add_code_range(&(cc->mbuf), env, *vs, *vs);
if (r < 0) return r;
if (IS_NOT_NULL(asc_cc)) {
- r = add_code_range0(&(asc_cc->mbuf), env, *from, *from, 0);
+ r = add_code_range0(&(asc_cc->mbuf), env, *vs, *vs, 0);
if (r < 0) return r;
}
}
@@ -4468,43 +4492,51 @@ next_state_val(CClassNode* cc, CClassNode* asc_cc,
case CCS_RANGE:
if (intype == *type) {
if (intype == CCV_SB) {
- if (*from > 0xff || to > 0xff)
- return ONIGERR_INVALID_CODE_POINT_VALUE;
+ if (*vs > 0xff || v > 0xff)
+ return ONIGERR_INVALID_CODE_POINT_VALUE;
- if (*from > to) {
+ if (*vs > v) {
if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
goto ccs_range_end;
else
return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
}
- bitset_set_range(env, cc->bs, (int )*from, (int )to);
+ bitset_set_range(env, cc->bs, (int )*vs, (int )v);
if (IS_NOT_NULL(asc_cc))
- bitset_set_range(env, asc_cc->bs, (int )*from, (int )to);
+ bitset_set_range(env, asc_cc->bs, (int )*vs, (int )v);
}
else {
- r = add_code_range(&(cc->mbuf), env, *from, to);
+ r = add_code_range(&(cc->mbuf), env, *vs, v);
if (r < 0) return r;
if (IS_NOT_NULL(asc_cc)) {
- r = add_code_range0(&(asc_cc->mbuf), env, *from, to, 0);
+ r = add_code_range0(&(asc_cc->mbuf), env, *vs, v, 0);
if (r < 0) return r;
}
}
}
else {
- if (*from > to) {
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
- goto ccs_range_end;
- else
- return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
- }
- bitset_set_range(env, cc->bs, (int )*from, (int )(to < 0xff ? to : 0xff));
- r = add_code_range(&(cc->mbuf), env, (OnigCodePoint )*from, to);
- if (r < 0) return r;
- if (IS_NOT_NULL(asc_cc)) {
- bitset_set_range(env, asc_cc->bs, (int )*from, (int )(to < 0xff ? to : 0xff));
- r = add_code_range0(&(asc_cc->mbuf), env, (OnigCodePoint )*from, to, 0);
+#if 0
+ if (intype == CCV_CODE_POINT && *type == CCV_SB) {
+#endif
+ if (*vs > v) {
+ if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))
+ goto ccs_range_end;
+ else
+ return ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;
+ }
+ bitset_set_range(env, cc->bs, (int )*vs, (int )(v < 0xff ? v : 0xff));
+ r = add_code_range(&(cc->mbuf), env, (OnigCodePoint )*vs, v);
if (r < 0) return r;
+ if (IS_NOT_NULL(asc_cc)) {
+ bitset_set_range(env, asc_cc->bs, (int )*vs, (int )(v < 0xff ? v : 0xff));
+ r = add_code_range0(&(asc_cc->mbuf), env, (OnigCodePoint )*vs, v, 0);
+ if (r < 0) return r;
+ }
+#if 0
}
+ else
+ return ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE;
+#endif
}
ccs_range_end:
*state = CCS_COMPLETE;
@@ -4519,9 +4551,9 @@ next_state_val(CClassNode* cc, CClassNode* asc_cc,
break;
}
- *from_israw = to_israw;
- *from = to;
- *type = intype;
+ *vs_israw = v_israw;
+ *vs = v;
+ *type = intype;
return 0;
}
@@ -4565,11 +4597,8 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
enum CCVALTYPE val_type, in_type;
int val_israw, in_israw;
- *np = *asc_np = NULL_NODE;
- env->parse_depth++;
- if (env->parse_depth > ParseDepthLimit)
- return ONIGERR_PARSE_DEPTH_LIMIT_OVER;
prev_cc = asc_prev_cc = (CClassNode* )NULL;
+ *np = *asc_np = NULL_NODE;
r = fetch_token_in_cc(tok, src, end, env);
if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) {
neg = 1;
@@ -4651,7 +4680,7 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
goto err;
}
- len = enclen(env->enc, buf, buf + i);
+ len = enclen(env->enc, buf, buf+i);
if (i < len) {
r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;
goto err;
@@ -4659,8 +4688,7 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
else if (i > len) { /* fetch back */
p = psave;
for (i = 1; i < len; i++) {
- (void)fetch_token_in_cc(tok, &p, end, env);
- /* no need to check the retun value (already checked above) */
+ r = fetch_token_in_cc(tok, &p, end, env);
}
fetched = 0;
}
@@ -4760,12 +4788,6 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
CC_ESC_WARN(env, (UChar* )"-");
goto range_end_val;
}
-
- if (val_type == CCV_CLASS) {
- r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS;
- goto err;
- }
-
state = CCS_RANGE;
}
else if (state == CCS_START) {
@@ -4919,17 +4941,16 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
#define NEWLINE_CODE 0x0a
if (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) {
- if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1)
- BITSET_SET_BIT_CHKDUP(cc->bs, NEWLINE_CODE);
- else {
- r = add_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE);
- if (r < 0) goto err;
- }
+ if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1)
+ BITSET_SET_BIT_CHKDUP(cc->bs, NEWLINE_CODE);
+ else {
+ r = add_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE);
+ if (r < 0) goto err;
+ }
}
}
}
*src = p;
- env->parse_depth--;
return 0;
err:
@@ -4990,14 +5011,6 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
case '>': /* (?>...) stop backtrack */
*np = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
break;
- case '~': /* (?~...) absent operator */
- if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_TILDE_ABSENT)) {
- *np = node_new_enclose(ENCLOSE_ABSENT);
- }
- else {
- return ONIGERR_UNDEFINED_GROUP_OPTION;
- }
- break;
#ifdef USE_NAMED_GROUP
case '\'':
@@ -5008,20 +5021,18 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
return ONIGERR_UNDEFINED_GROUP_OPTION;
break;
-# ifdef USE_CAPITAL_P_NAMED_GROUP
+#ifdef USE_CAPITAL_P_NAMED_GROUP
case 'P': /* (?P<name>...) */
- if (!PEND &&
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP)) {
+ if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP)) {
PFETCH(c);
if (c == '<') goto named_group1;
}
return ONIGERR_UNDEFINED_GROUP_OPTION;
break;
-# endif
+#endif
#endif
case '<': /* look behind (?<=...), (?<!...) */
- if (PEND) return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS;
PFETCH(c);
if (c == '=')
*np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND);
@@ -5039,9 +5050,7 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
named_group1:
list_capture = 0;
-# ifdef USE_CAPTURE_HISTORY
named_group2:
-# endif
name = p;
r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &num, 0);
if (r < 0) return r;
@@ -5071,12 +5080,10 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
#endif
break;
-#ifdef USE_CAPTURE_HISTORY
case '@':
if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)) {
-# ifdef USE_NAMED_GROUP
- if (!PEND &&
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {
+#ifdef USE_NAMED_GROUP
+ if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {
PFETCH(c);
if (c == '<' || c == '\'') {
list_capture = 1;
@@ -5084,7 +5091,7 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
}
PUNFETCH;
}
-# endif
+#endif
*np = node_new_enclose_memory(env->option, 0);
CHECK_NULL_RETURN_MEMERR(*np);
num = scan_env_add_mem_entry(env);
@@ -5099,11 +5106,9 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
return ONIGERR_UNDEFINED_GROUP_OPTION;
}
break;
-#endif /* USE_CAPTURE_HISTORY */
case '(': /* conditional expression: (?(cond)yes), (?(cond)yes|no) */
- if (!PEND &&
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LPAREN_CONDITION)) {
+ if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LPAREN_CONDITION)) {
UChar *name = NULL;
UChar *name_end;
PFETCH(c);
@@ -5121,29 +5126,36 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
#endif
if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_STRICT_CHECK_BACKREF)) {
if (num > env->num_mem ||
- IS_NULL(SCANENV_MEM_NODES(env)[num]))
+ IS_NULL(SCANENV_MEM_NODES(env)[num]))
return ONIGERR_INVALID_BACKREF;
}
}
#ifdef USE_NAMED_GROUP
else if (c == '<' || c == '\'') { /* (<name>), ('name') */
+ int nums;
+ int *backs;
+
name = p;
- r = fetch_named_backref_token(c, tok, &p, end, env);
+ r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &num, 0);
if (r < 0) return r;
- if (!PPEEK_IS(')')) return ONIGERR_UNDEFINED_GROUP_OPTION;
- PINC;
+ PFETCH(c);
+ if (c != ')') return ONIGERR_UNDEFINED_GROUP_OPTION;
- if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP)) {
- num = tok->u.backref.ref1;
+ nums = onig_name_to_group_numbers(env->reg, name, name_end, &backs);
+ if (nums <= 0) {
+ onig_scan_env_set_error_string(env,
+ ONIGERR_UNDEFINED_NAME_REFERENCE, name, name_end);
+ return ONIGERR_UNDEFINED_NAME_REFERENCE;
}
- else {
- /* FIXME:
- * Use left most named group for now. This is the same as Perl.
- * However this should use the same strategy as normal back-
- * references on Ruby syntax; search right to left. */
- int len = tok->u.backref.num;
- num = len > 1 ? tok->u.backref.refs[0] : tok->u.backref.ref1;
+ if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_STRICT_CHECK_BACKREF)) {
+ int i;
+ for (i = 0; i < nums; i++) {
+ if (backs[i] > env->num_mem ||
+ IS_NULL(SCANENV_MEM_NODES(env)[backs[i]]))
+ return ONIGERR_INVALID_BACKREF;
+ }
}
+ num = backs[0]; /* XXX: use left most named group as Perl */
}
#endif
else
@@ -5168,7 +5180,7 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
#endif
case '^': /* loads default options */
- if (!PEND && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {
+ if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {
/* d-imsx */
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1);
ONOFF(option, ONIG_OPTION_IGNORECASE, 1);
@@ -5178,7 +5190,7 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
PFETCH(c);
}
#if 0
- else if (!PEND && IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) {
+ else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) {
/* d-imx */
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0);
ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 0);
@@ -5236,8 +5248,8 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
case 'a': /* limits \d, \s, \w and POSIX brackets to ASCII range */
if ((IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) ||
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) &&
- (neg == 0)) {
+ IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) &&
+ (neg == 0)) {
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0);
ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 1);
ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 1);
@@ -5248,8 +5260,8 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
case 'u':
if ((IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) ||
- IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) &&
- (neg == 0)) {
+ IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) &&
+ (neg == 0)) {
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1);
ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 1);
ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 1);
@@ -5260,11 +5272,11 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
case 'd':
if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL) &&
- (neg == 0)) {
+ (neg == 0)) {
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 1);
}
else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY) &&
- (neg == 0)) {
+ (neg == 0)) {
ONOFF(option, ONIG_OPTION_ASCII_RANGE, 0);
ONOFF(option, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, 0);
ONOFF(option, ONIG_OPTION_WORD_BOUND_ALL_RANGE, 0);
@@ -5294,12 +5306,9 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
else if (c == ':') {
OnigOptionType prev = env->option;
- env->option = option;
+ env->option = option;
r = fetch_token(tok, &p, end, env);
- if (r < 0) {
- env->option = prev;
- return r;
- }
+ if (r < 0) return r;
r = parse_subexp(&target, tok, term, &p, end, env);
env->option = prev;
if (r < 0) return r;
@@ -5414,29 +5423,29 @@ set_quantifier(Node* qnode, Node* target, int group, ScanEnv* env)
int targetq_num = popular_quantifier_num(qnt);
#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
- if (nestq_num >= 0 && targetq_num >= 0 &&
+ if (!IS_QUANTIFIER_BY_NUMBER(qn) && !IS_QUANTIFIER_BY_NUMBER(qnt) &&
IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) {
- switch (ReduceTypeTable[targetq_num][nestq_num]) {
- case RQ_ASIS:
- break;
-
- case RQ_DEL:
- if (onig_warn != onig_null_warn) {
- onig_syntax_warn(env, "regular expression has redundant nested repeat operator '%s'",
- PopularQStr[targetq_num]);
- }
- goto warn_exit;
- break;
-
- default:
- if (onig_warn != onig_null_warn) {
- onig_syntax_warn(env, "nested repeat operator '%s' and '%s' was replaced with '%s' in regular expression",
- PopularQStr[targetq_num], PopularQStr[nestq_num],
- ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
- }
- goto warn_exit;
- break;
- }
+ switch (ReduceTypeTable[targetq_num][nestq_num]) {
+ case RQ_ASIS:
+ break;
+
+ case RQ_DEL:
+ if (onig_warn != onig_null_warn) {
+ onig_syntax_warn(env, "regular expression has redundant nested repeat operator '%s'",
+ PopularQStr[targetq_num]);
+ }
+ goto warn_exit;
+ break;
+
+ default:
+ if (onig_warn != onig_null_warn) {
+ onig_syntax_warn(env, "nested repeat operator '%s' and '%s' was replaced with '%s' in regular expression",
+ PopularQStr[targetq_num], PopularQStr[nestq_num],
+ ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
+ }
+ goto warn_exit;
+ break;
+ }
}
warn_exit:
@@ -5466,6 +5475,85 @@ set_quantifier(Node* qnode, Node* target, int group, ScanEnv* env)
}
+#ifdef USE_SHARED_CCLASS_TABLE
+
+#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS 8
+
+/* for ctype node hash table */
+
+typedef struct {
+ OnigEncoding enc;
+ int not;
+ int type;
+} type_cclass_key;
+
+static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y)
+{
+ if (x->type != y->type) return 1;
+ if (x->enc != y->enc) return 1;
+ if (x->not != y->not) return 1;
+ return 0;
+}
+
+static st_index_t type_cclass_hash(type_cclass_key* key)
+{
+ int i, val;
+ UChar *p;
+
+ val = 0;
+
+ p = (UChar* )&(key->enc);
+ for (i = 0; i < (int )sizeof(key->enc); i++) {
+ val = val * 997 + (int )*p++;
+ }
+
+ p = (UChar* )(&key->type);
+ for (i = 0; i < (int )sizeof(key->type); i++) {
+ val = val * 997 + (int )*p++;
+ }
+
+ val += key->not;
+ return val + (val >> 5);
+}
+
+static const struct st_hash_type type_type_cclass_hash = {
+ type_cclass_cmp,
+ type_cclass_hash,
+};
+
+static st_table* OnigTypeCClassTable;
+
+
+static int
+i_free_shared_class(type_cclass_key* key, Node* node, void* arg ARG_UNUSED)
+{
+ if (IS_NOT_NULL(node)) {
+ CClassNode* cc = NCCLASS(node);
+ if (IS_NOT_NULL(cc->mbuf)) xfree(cc->mbuf);
+ xfree(node);
+ }
+
+ if (IS_NOT_NULL(key)) xfree(key);
+ return ST_DELETE;
+}
+
+extern int
+onig_free_shared_cclass_table(void)
+{
+ /* THREAD_ATOMIC_START; */
+ if (IS_NOT_NULL(OnigTypeCClassTable)) {
+ onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);
+ onig_st_free_table(OnigTypeCClassTable);
+ OnigTypeCClassTable = NULL;
+ }
+ /* THREAD_ATOMIC_END; */
+
+ return 0;
+}
+
+#endif /* USE_SHARED_CCLASS_TABLE */
+
+
#ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
static int
clear_not_flag_cclass(CClassNode* cc, OnigEncoding enc)
@@ -5508,7 +5596,7 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
CClassNode* cc;
CClassNode* asc_cc;
BitSetRef bs;
- int add_flag, r;
+ int add_flag;
iarg = (IApplyCaseFoldArg* )arg;
env = iarg->env;
@@ -5535,8 +5623,7 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
(is_in == 0 && IS_NCCLASS_NOT(cc))) {
if (add_flag) {
if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {
- r = add_code_range0(&(cc->mbuf), env, *to, *to, 0);
- if (r < 0) return r;
+ add_code_range0(&(cc->mbuf), env, *to, *to, 0);
}
else {
BITSET_SET_BIT(bs, *to);
@@ -5548,8 +5635,7 @@ i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],
if (add_flag) {
if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {
if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc);
- r = add_code_range0(&(cc->mbuf), env, *to, *to, 0);
- if (r < 0) return r;
+ add_code_range0(&(cc->mbuf), env, *to, *to, 0);
}
else {
if (IS_NCCLASS_NOT(cc)) {
@@ -5639,7 +5725,7 @@ node_linebreak(Node** np, ScanEnv* env)
Node* target1 = NULL;
Node* target2 = NULL;
CClassNode* cc;
- int num1, num2, r;
+ int num1, num2;
UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN * 2];
/* \x0D\x0A */
@@ -5655,8 +5741,7 @@ node_linebreak(Node** np, ScanEnv* env)
if (IS_NULL(right)) goto err;
cc = NCCLASS(right);
if (ONIGENC_MBC_MINLEN(env->enc) > 1) {
- r = add_code_range(&(cc->mbuf), env, 0x0A, 0x0D);
- if (r != 0) goto err;
+ add_code_range(&(cc->mbuf), env, 0x0A, 0x0D);
}
else {
bitset_set_range(env, cc->bs, 0x0A, 0x0D);
@@ -5665,10 +5750,8 @@ node_linebreak(Node** np, ScanEnv* env)
/* TODO: move this block to enc/unicode.c */
if (ONIGENC_IS_UNICODE(env->enc)) {
/* UTF-8, UTF-16BE/LE, UTF-32BE/LE */
- r = add_code_range(&(cc->mbuf), env, 0x85, 0x85);
- if (r != 0) goto err;
- r = add_code_range(&(cc->mbuf), env, 0x2028, 0x2029);
- if (r != 0) goto err;
+ add_code_range(&(cc->mbuf), env, 0x85, 0x85);
+ add_code_range(&(cc->mbuf), env, 0x2028, 0x2029);
}
/* ...|... */
@@ -5695,767 +5778,82 @@ node_linebreak(Node** np, ScanEnv* env)
}
static int
-propname2ctype(ScanEnv* env, const char* propname)
-{
- UChar* name = (UChar* )propname;
- int ctype = env->enc->property_name_to_ctype(ONIG_ENCODING_ASCII,
- name, name + strlen(propname));
- return ctype;
-}
-
-static int
node_extended_grapheme_cluster(Node** np, ScanEnv* env)
{
- Node* tmp = NULL;
+ /* same as (?>\P{M}\p{M}*) */
Node* np1 = NULL;
- Node* list = NULL;
+ Node* np2 = NULL;
+ Node* qn = NULL;
+ Node* list1 = NULL;
Node* list2 = NULL;
- Node* alt = NULL;
- Node* alt2 = NULL;
- BBuf *pbuf1 = NULL;
int r = 0;
- int num1;
- UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN * 2];
- OnigOptionType option;
#ifdef USE_UNICODE_PROPERTIES
if (ONIGENC_IS_UNICODE(env->enc)) {
/* UTF-8, UTF-16BE/LE, UTF-32BE/LE */
- CClassNode* cc;
- OnigCodePoint sb_out = (ONIGENC_MBC_MINLEN(env->enc) > 1) ? 0x00 : 0x80;
- int extend = propname2ctype(env, "Grapheme_Cluster_Break=Extend");
-
- /* Prepend*
- * ( RI-sequence | Hangul-Syllable | !Control )
- * ( Grapheme_Extend | SpacingMark )* */
-
- /* ( Grapheme_Extend | SpacingMark )* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, extend, 0, 0, env);
- if (r != 0) goto err;
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=SpacingMark"), 0, 0, env);
- if (r != 0) goto err;
- r = add_code_range(&(cc->mbuf), env, 0x200D, 0x200D);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list = tmp;
- np1 = NULL;
-
- /* ( RI-sequence | Hangul-Syllable | !Control ) */
- /* !Control */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=Control"), 1, 0, env);
- if (r != 0) goto err;
- if (ONIGENC_MBC_MINLEN(env->enc) > 1) {
- BBuf *pbuf2 = NULL;
- r = add_code_range(&pbuf1, env, 0x0a, 0x0a);
- if (r != 0) goto err;
- r = add_code_range(&pbuf1, env, 0x0d, 0x0d);
- if (r != 0) goto err;
- r = and_code_range_buf(cc->mbuf, 0, pbuf1, 1, &pbuf2, env);
- if (r != 0) {
- bbuf_free(pbuf2);
- goto err;
- }
- bbuf_free(pbuf1);
- pbuf1 = NULL;
- bbuf_free(cc->mbuf);
- cc->mbuf = pbuf2;
- }
- else {
- BITSET_CLEAR_BIT(cc->bs, 0x0a);
- BITSET_CLEAR_BIT(cc->bs, 0x0d);
- }
-
- tmp = onig_node_new_alt(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- np1 = NULL;
-
- /* Hangul-Syllable
- * := L* V+ T*
- * | L* LV V* T*
- * | L* LVT T*
- * | L+
- * | T+ */
-
- /* T+ */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(1, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = onig_node_new_alt(np1, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- np1 = NULL;
-
- /* L+ */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(1, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = onig_node_new_alt(np1, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- np1 = NULL;
-
- /* L* LVT T* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=LVT"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- /* L* LV V* T* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=V"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=LV"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- /* L* V+ T* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=T"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=V"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(1, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=L"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- /* Emoji sequence := (E_Base | EBG) Extend* E_Modifier?
- * (ZWJ (Glue_After_Zwj | EBG Extend* E_Modifier?) )* */
-
- /* ZWJ (Glue_After_Zwj | E_Base_GAZ Extend* E_Modifier?) */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, 1, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, extend, 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- alt2 = tmp;
- list2 = NULL;
-
- /* Glue_After_Zwj */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, extend, 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- if (onigenc_unicode_version_number[0] < 10) {
- static const OnigCodePoint ranges[] = {
- 13,
- 0x1F308, 0x1F308,
- 0x1F33E, 0x1F33E,
- 0x1F373, 0x1F373,
- 0x1F393, 0x1F393,
- 0x1F3A4, 0x1F3A4,
- 0x1F3A8, 0x1F3A8,
- 0x1F3EB, 0x1F3EB,
- 0x1F3ED, 0x1F3ED,
- 0x1F4BB, 0x1F4BC,
- 0x1F527, 0x1F527,
- 0x1F52C, 0x1F52C,
- 0x1F680, 0x1F680,
- 0x1F692, 0x1F692,
- };
- r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
+ CClassNode* cc1;
+ CClassNode* cc2;
+ UChar* propname = (UChar* )"M";
+ int ctype = env->enc->property_name_to_ctype(ONIG_ENCODING_ASCII,
+ propname, propname + 1);
+ if (ctype >= 0) {
+ /* \P{M} */
+ np1 = node_new_cclass();
+ if (IS_NULL(np1)) goto err;
+ cc1 = NCCLASS(np1);
+ r = add_ctype_to_cc(cc1, ctype, 0, 0, env);
if (r != 0) goto err;
- }
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt2);
- if (IS_NULL(tmp)) goto err;
- alt2 = tmp;
- list2 = NULL;
-
- /* Emoji variation sequence
- * http://unicode.org/Public/emoji/4.0/emoji-zwj-sequences.txt
- */
- r = ONIGENC_CODE_TO_MBC(env->enc, 0xfe0f, buf);
- if (r < 0) goto err;
- np1 = node_new_str_raw(buf, buf + r);
- if (IS_NULL(np1)) goto err;
-
- tmp = node_new_quantifier(0, 1, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
+ NCCLASS_SET_NOT(cc1);
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- {
- static const OnigCodePoint ranges[] = {
- 4,
- 0x2640, 0x2640,
- 0x2642, 0x2642,
- 0x2695, 0x2696,
- 0x2708, 0x2708,
- };
- r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
+ /* \p{M}* */
+ np2 = node_new_cclass();
+ if (IS_NULL(np2)) goto err;
+ cc2 = NCCLASS(np2);
+ r = add_ctype_to_cc(cc2, ctype, 0, 0, env);
if (r != 0) goto err;
- }
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt2);
- if (IS_NULL(tmp)) goto err;
- alt2 = tmp;
- list2 = NULL;
-
- tmp = node_new_list(alt2, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- alt2 = NULL;
-
- /* ZWJ */
- r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf);
- if (r < 0) goto err;
- np1 = node_new_str_raw(buf, buf + r);
- if (IS_NULL(np1)) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = list2;
- np1 = tmp;
- list2 = NULL;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- /* E_Modifier? */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, 1, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
- /* Extend* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, extend, 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- /* (E_Base | EBG) */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- {
- static const OnigCodePoint ranges9[] = {
- 8,
- 0x1F3C2, 0x1F3C2,
- 0x1F3C7, 0x1F3C7,
- 0x1F3CC, 0x1F3CC,
- 0x1F3F3, 0x1F3F3,
- 0x1F441, 0x1F441,
- 0x1F46F, 0x1F46F,
- 0x1F574, 0x1F574,
- 0x1F6CC, 0x1F6CC,
- };
- static const OnigCodePoint ranges10[] = {
- 3,
- 0x1F3F3, 0x1F3F3,
- 0x1F441, 0x1F441,
- 0x1F46F, 0x1F46F,
- };
- const OnigCodePoint *ranges =
- (onigenc_unicode_version_number[0] < 10) ? ranges9 : ranges10;
- r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
- if (r != 0) goto err;
+ qn = node_new_quantifier(0, REPEAT_INFINITE, 0);
+ if (IS_NULL(qn)) goto err;
+ NQTFR(qn)->target = np2;
+ np2 = NULL;
+
+ /* \P{M}\p{M}* */
+ list2 = node_new_list(qn, NULL_NODE);
+ if (IS_NULL(list2)) goto err;
+ qn = NULL;
+ list1 = node_new_list(np1, list2);
+ if (IS_NULL(list1)) goto err;
+ np1 = NULL;
+ list2 = NULL;
+
+ /* (?>...) */
+ *np = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
+ if (IS_NULL(*np)) goto err;
+ NENCLOSE(*np)->target = list1;
+ return ONIG_NORMAL;
}
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base"), 0, 0, env);
- if (r != 0) goto err;
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- /* ZWJ (E_Base_GAZ | Glue_After_Zwj) E_Modifier? */
- /* a sequence starting with ZWJ seems artificial, but GraphemeBreakTest
- * has such examples.
- * http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakTest.html
- */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, 1, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, env);
- if (r != 0) goto err;
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf);
- if (r < 0) goto err;
- np1 = node_new_str_raw(buf, buf + r);
- if (IS_NULL(np1)) goto err;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- /* RI-Sequence := Regional_Indicator{2} */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_code_range(&(cc->mbuf), env, 0x1F1E6, 0x1F1FF);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(2, 2, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- tmp = node_new_list(alt, list);
- if (IS_NULL(tmp)) goto err;
- list = tmp;
- alt = NULL;
-
- /* Prepend* */
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=Prepend"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list);
- if (IS_NULL(tmp)) goto err;
- list = tmp;
- np1 = NULL;
-
- /* PerlSyntax: (?s:.), RubySyntax: (?m:.) */
- np1 = node_new_anychar();
- if (IS_NULL(np1)) goto err;
-
- option = env->option;
- ONOFF(option, ONIG_OPTION_MULTILINE, 0);
- tmp = node_new_option(option);
- if (IS_NULL(tmp)) goto err;
- NENCLOSE(tmp)->target = np1;
- np1 = tmp;
-
- tmp = onig_node_new_alt(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- np1 = NULL;
-
- /* Prepend+ */
- r = ONIGENC_CODE_TO_MBC(env->enc, 0x200D, buf);
- if (r < 0) goto err;
- np1 = node_new_str_raw(buf, buf + r);
- if (IS_NULL(np1)) goto err;
-
- tmp = node_new_quantifier(0, 1, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, NULL_NODE);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- np1 = node_new_cclass();
- if (IS_NULL(np1)) goto err;
- cc = NCCLASS(np1);
- r = add_ctype_to_cc(cc, propname2ctype(env, "Grapheme_Cluster_Break=Prepend"), 0, 0, env);
- if (r != 0) goto err;
-
- tmp = node_new_quantifier(1, REPEAT_INFINITE, 0);
- if (IS_NULL(tmp)) goto err;
- NQTFR(tmp)->target = np1;
- np1 = tmp;
-
- tmp = node_new_list(np1, list2);
- if (IS_NULL(tmp)) goto err;
- list2 = tmp;
- np1 = NULL;
-
- tmp = onig_node_new_alt(list2, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list2 = NULL;
-
- tmp = onig_node_new_alt(list, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- list = NULL;
}
- else
#endif /* USE_UNICODE_PROPERTIES */
- {
+ if (IS_NULL(*np)) {
/* PerlSyntax: (?s:.), RubySyntax: (?m:.) */
+ OnigOptionType option;
np1 = node_new_anychar();
if (IS_NULL(np1)) goto err;
option = env->option;
ONOFF(option, ONIG_OPTION_MULTILINE, 0);
- tmp = node_new_option(option);
- if (IS_NULL(tmp)) goto err;
- NENCLOSE(tmp)->target = np1;
- np1 = tmp;
-
- alt = onig_node_new_alt(np1, NULL_NODE);
- if (IS_NULL(alt)) goto err;
- np1 = NULL;
- }
-
- /* \x0D\x0A */
- r = ONIGENC_CODE_TO_MBC(env->enc, 0x0D, buf);
- if (r < 0) goto err;
- num1 = r;
- r = ONIGENC_CODE_TO_MBC(env->enc, 0x0A, buf + num1);
- if (r < 0) goto err;
- np1 = node_new_str_raw(buf, buf + num1 + r);
- if (IS_NULL(np1)) goto err;
-
- tmp = onig_node_new_alt(np1, alt);
- if (IS_NULL(tmp)) goto err;
- alt = tmp;
- np1 = NULL;
-
- /* (?>\x0D\x0A|...) */
- tmp = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
- if (IS_NULL(tmp)) goto err;
- NENCLOSE(tmp)->target = alt;
- np1 = tmp;
-
-#ifdef USE_UNICODE_PROPERTIES
- if (ONIGENC_IS_UNICODE(env->enc)) {
- /* Don't ignore case. */
- option = env->option;
- ONOFF(option, ONIG_OPTION_IGNORECASE, 1);
*np = node_new_option(option);
if (IS_NULL(*np)) goto err;
NENCLOSE(*np)->target = np1;
}
- else
-#endif
- {
- *np = np1;
- }
return ONIG_NORMAL;
err:
onig_node_free(np1);
- onig_node_free(list);
+ onig_node_free(np2);
+ onig_node_free(qn);
+ onig_node_free(list1);
onig_node_free(list2);
- onig_node_free(alt);
- onig_node_free(alt2);
- bbuf_free(pbuf1);
return (r == 0) ? ONIGERR_MEMORY : r;
}
@@ -6488,7 +5886,7 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
/* only one char found in the bbuf, save the code point. */
c = data[0];
if (((c < SINGLE_BYTE_SIZE) && BITSET_AT(cc->bs, c))) {
- /* skip if c is included in the bitset */
+ /* skip if c is included in the bitset */
c = not_found;
}
}
@@ -6502,9 +5900,9 @@ is_onechar_cclass(CClassNode* cc, OnigCodePoint* code)
Bits b1 = cc->bs[i];
if (b1 != 0) {
if (((b1 & (b1 - 1)) == 0) && (c == not_found)) {
- c = BITS_IN_ROOM * i + countbits(b1 - 1);
+ c = BITS_IN_ROOM * i + countbits(b1 - 1);
} else {
- return 0; /* the character class contains multiple chars */
+ return 0; /* the character class contains multiple chars */
}
}
}
@@ -6549,10 +5947,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
env->option = NENCLOSE(*np)->option;
r = fetch_token(tok, src, end, env);
- if (r < 0) {
- env->option = prev;
- return r;
- }
+ if (r < 0) return r;
r = parse_subexp(&target, tok, term, src, end, env);
env->option = prev;
if (r < 0) {
@@ -6705,13 +6100,69 @@ parse_exp(Node** np, OnigToken* tok, int term,
{
CClassNode* cc;
- *np = node_new_cclass();
- CHECK_NULL_RETURN_MEMERR(*np);
- cc = NCCLASS(*np);
- r = add_ctype_to_cc(cc, tok->u.prop.ctype, 0,
- IS_ASCII_RANGE(env->option), env);
- if (r != 0) return r;
- if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
+#ifdef USE_SHARED_CCLASS_TABLE
+ const OnigCodePoint *mbr;
+ OnigCodePoint sb_out;
+
+ r = ONIGENC_GET_CTYPE_CODE_RANGE(env->enc, tok->u.prop.ctype,
+ &sb_out, &mbr);
+ if (r == 0 &&
+ ! IS_ASCII_RANGE(env->option) &&
+ ONIGENC_CODE_RANGE_NUM(mbr)
+ >= THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS) {
+ type_cclass_key key;
+ type_cclass_key* new_key;
+
+ key.enc = env->enc;
+ key.not = tok->u.prop.not;
+ key.type = tok->u.prop.ctype;
+
+ THREAD_ATOMIC_START;
+
+ if (IS_NULL(OnigTypeCClassTable)) {
+ OnigTypeCClassTable
+ = onig_st_init_table_with_size(&type_type_cclass_hash, 10);
+ if (IS_NULL(OnigTypeCClassTable)) {
+ THREAD_ATOMIC_END;
+ return ONIGERR_MEMORY;
+ }
+ }
+ else {
+ if (onig_st_lookup(OnigTypeCClassTable, (st_data_t )&key,
+ (st_data_t* )np)) {
+ THREAD_ATOMIC_END;
+ break;
+ }
+ }
+
+ *np = node_new_cclass_by_codepoint_range(tok->u.prop.not,
+ sb_out, mbr);
+ if (IS_NULL(*np)) {
+ THREAD_ATOMIC_END;
+ return ONIGERR_MEMORY;
+ }
+
+ cc = NCCLASS(*np);
+ NCCLASS_SET_SHARE(cc);
+ new_key = (type_cclass_key* )xmalloc(sizeof(type_cclass_key));
+ xmemcpy(new_key, &key, sizeof(type_cclass_key));
+ onig_st_add_direct(OnigTypeCClassTable, (st_data_t )new_key,
+ (st_data_t )*np);
+
+ THREAD_ATOMIC_END;
+ }
+ else {
+#endif
+ *np = node_new_cclass();
+ CHECK_NULL_RETURN_MEMERR(*np);
+ cc = NCCLASS(*np);
+ r = add_ctype_to_cc(cc, tok->u.prop.ctype, 0,
+ IS_ASCII_RANGE(env->option), env);
+ if (r != 0) return r;
+ if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
+#ifdef USE_SHARED_CCLASS_TABLE
+ }
+#endif
}
break;
@@ -6941,9 +6392,6 @@ parse_subexp(Node** top, OnigToken* tok, int term,
Node *node, **headp;
*top = NULL;
- env->parse_depth++;
- if (env->parse_depth > ParseDepthLimit)
- return ONIGERR_PARSE_DEPTH_LIMIT_OVER;
r = parse_branch(&node, tok, term, src, end, env);
if (r < 0) {
onig_node_free(node);
@@ -6981,7 +6429,6 @@ parse_subexp(Node** top, OnigToken* tok, int term,
return ONIGERR_PARSER_BUG;
}
- env->parse_depth--;
return r;
}
@@ -7006,10 +6453,7 @@ parse_regexp(Node** top, UChar** src, UChar* end, ScanEnv* env)
NENCLOSE(np)->regnum = num;
NENCLOSE(np)->target = *top;
r = scan_env_set_mem_node(env, num, np);
- if (r != 0) {
- onig_node_free(np);
- return r;
- }
+ if (r != 0) return r;
*top = np;
}
#endif
diff --git a/regparse.h b/regparse.h
index 888ebf4ce6..35de54671e 100644
--- a/regparse.h
+++ b/regparse.h
@@ -1,11 +1,11 @@
-#ifndef ONIGMO_REGPARSE_H
-#define ONIGMO_REGPARSE_H
+#ifndef ONIGURUMA_REGPARSE_H
+#define ONIGURUMA_REGPARSE_H
/**********************************************************************
regparse.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,11 +67,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
BIT_NT_CANY | BIT_NT_BREF)) != 0)
#define NTYPE(node) ((node)->u.base.type)
-#define SET_NTYPE(node, ntype) \
- do { \
- int value = ntype; \
- memcpy(&((node)->u.base.type), &value, sizeof(int)); \
- } while (0)
+#define SET_NTYPE(node, ntype) (node)->u.base.type = (ntype)
#define NSTR(node) (&((node)->u.str))
#define NCCLASS(node) (&((node)->u.cclass))
@@ -95,7 +91,6 @@ RUBY_SYMBOL_EXPORT_BEGIN
#define ENCLOSE_OPTION (1<<1)
#define ENCLOSE_STOP_BACKTRACK (1<<2)
#define ENCLOSE_CONDITION (1<<3)
-#define ENCLOSE_ABSENT (1<<4)
#define NODE_STR_MARGIN 16
#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */
@@ -318,12 +313,9 @@ typedef struct {
int curr_max_regnum;
int has_recursion;
#endif
- unsigned int parse_depth;
int warnings_flag;
-#ifdef RUBY
const char* sourcefile;
int sourceline;
-#endif
} ScanEnv;
@@ -336,35 +328,36 @@ typedef struct {
int new_val;
} GroupNumRemap;
-extern int onig_renumber_name_table(regex_t* reg, GroupNumRemap* map);
+extern int onig_renumber_name_table P_((regex_t* reg, GroupNumRemap* map));
#endif
-extern int onig_strncmp(const UChar* s1, const UChar* s2, int n);
-extern void onig_strcpy(UChar* dest, const UChar* src, const UChar* end);
-extern void onig_scan_env_set_error_string(ScanEnv* env, int ecode, UChar* arg, UChar* arg_end);
-extern int onig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc);
-extern void onig_reduce_nested_quantifier(Node* pnode, Node* cnode);
-extern void onig_node_conv_to_str_node(Node* node, int raw);
-extern int onig_node_str_cat(Node* node, const UChar* s, const UChar* end);
-extern int onig_node_str_set(Node* node, const UChar* s, const UChar* end);
-extern void onig_node_free(Node* node);
-extern Node* onig_node_new_enclose(int type);
-extern Node* onig_node_new_anchor(int type);
-extern Node* onig_node_new_str(const UChar* s, const UChar* end);
-extern Node* onig_node_new_list(Node* left, Node* right);
-extern Node* onig_node_list_add(Node* list, Node* x);
-extern Node* onig_node_new_alt(Node* left, Node* right);
-extern void onig_node_str_clear(Node* node);
-extern int onig_names_free(regex_t* reg);
-extern int onig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env);
-extern int onig_free_shared_cclass_table(void);
+extern int onig_strncmp P_((const UChar* s1, const UChar* s2, int n));
+extern void onig_strcpy P_((UChar* dest, const UChar* src, const UChar* end));
+extern void onig_scan_env_set_error_string P_((ScanEnv* env, int ecode, UChar* arg, UChar* arg_end));
+extern int onig_scan_unsigned_number P_((UChar** src, const UChar* end, OnigEncoding enc));
+extern void onig_reduce_nested_quantifier P_((Node* pnode, Node* cnode));
+extern void onig_node_conv_to_str_node P_((Node* node, int raw));
+extern int onig_node_str_cat P_((Node* node, const UChar* s, const UChar* end));
+extern int onig_node_str_set P_((Node* node, const UChar* s, const UChar* end));
+extern void onig_node_free P_((Node* node));
+extern Node* onig_node_new_enclose P_((int type));
+extern Node* onig_node_new_anchor P_((int type));
+extern Node* onig_node_new_str P_((const UChar* s, const UChar* end));
+extern Node* onig_node_new_list P_((Node* left, Node* right));
+extern Node* onig_node_list_add P_((Node* list, Node* x));
+extern Node* onig_node_new_alt P_((Node* left, Node* right));
+extern void onig_node_str_clear P_((Node* node));
+extern int onig_free_node_list P_((void));
+extern int onig_names_free P_((regex_t* reg));
+extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env));
+extern int onig_free_shared_cclass_table P_((void));
#ifdef ONIG_DEBUG
-# ifdef USE_NAMED_GROUP
+#ifdef USE_NAMED_GROUP
extern int onig_print_names(FILE*, regex_t*);
-# endif
+#endif
#endif
RUBY_SYMBOL_EXPORT_END
-#endif /* ONIGMO_REGPARSE_H */
+#endif /* ONIGURUMA_REGPARSE_H */
diff --git a/regsyntax.c b/regsyntax.c
index 657ffcd0f3..7cb98f2d46 100644
--- a/regsyntax.c
+++ b/regsyntax.c
@@ -3,7 +3,7 @@
**********************************************************************/
/*-
* Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
- * Copyright (c) 2011-2016 K.Takata <kentkt AT csc DOT jp>
+ * Copyright (c) 2011-2012 K.Takata <kentkt AT csc DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -229,7 +229,7 @@ const OnigSyntaxType OnigSyntaxPerl = {
(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |
ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |
ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |
- ONIG_SYN_OP_ESC_O_BRACE_OCTAL | ONIG_SYN_OP_ESC_C_CONTROL )
+ ONIG_SYN_OP_ESC_C_CONTROL )
& ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END )
, ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE |
ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL |
@@ -248,8 +248,7 @@ const OnigSyntaxType OnigSyntaxPerl = {
ONIG_SYN_OP2_ESC_K_NAMED_BACKREF )
, ( SYN_GNU_REGEX_BV |
ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME |
- ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL |
- ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP )
+ ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL )
, ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_CAPTURE_GROUP )
,
{
@@ -333,25 +332,25 @@ onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options)
}
extern unsigned int
-onig_get_syntax_op(const OnigSyntaxType* syntax)
+onig_get_syntax_op(OnigSyntaxType* syntax)
{
return syntax->op;
}
extern unsigned int
-onig_get_syntax_op2(const OnigSyntaxType* syntax)
+onig_get_syntax_op2(OnigSyntaxType* syntax)
{
return syntax->op2;
}
extern unsigned int
-onig_get_syntax_behavior(const OnigSyntaxType* syntax)
+onig_get_syntax_behavior(OnigSyntaxType* syntax)
{
return syntax->behavior;
}
extern OnigOptionType
-onig_get_syntax_options(const OnigSyntaxType* syntax)
+onig_get_syntax_options(OnigSyntaxType* syntax)
{
return syntax->options;
}
diff --git a/ruby-runner.c b/ruby-runner.c
deleted file mode 100644
index 99be4a0013..0000000000
--- a/ruby-runner.c
+++ /dev/null
@@ -1,77 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "ruby-runner.h"
-
-#define STRINGIZE(expr) STRINGIZE0(expr)
-#define STRINGIZE0(expr) #expr
-
-static void
-insert_env_path(const char *envname, const char *paths, size_t size, int prepend)
-{
- const char *env = getenv(envname);
- char c = 0;
- size_t n = 0;
-
- if (env) {
- while ((c = *env) == PATH_SEP) ++env;
- n = strlen(env);
- while (n > 0 && env[n-1] == PATH_SEP) --n;
- }
- if (c) {
- char *e = malloc(size+n+1);
- size_t pos = 0;
- if (prepend) {
- memcpy(e, paths, pos = size-1);
- e[pos++] = PATH_SEP;
- }
- memcpy(e+pos, env, n);
- pos += n;
- if (!prepend) {
- e[pos++] = PATH_SEP;
- memcpy(e+pos, paths, size-1);
- pos += size-1;
- }
- e[pos] = '\0';
- env = e;
- }
- else {
- env = paths;
- }
- setenv(envname, env, 1);
-}
-
-#define EXTOUT_DIR BUILDDIR"/"EXTOUT
-int
-main(int argc, char **argv)
-{
- static const char builddir[] = BUILDDIR;
- static const char rubypath[] = BUILDDIR"/"STRINGIZE(RUBY_INSTALL_NAME);
- static const char rubylib[] =
- ABS_SRCDIR"/lib"
- PATH_SEPARATOR
- EXTOUT_DIR"/common"
- PATH_SEPARATOR
- EXTOUT_DIR"/"ARCH
- ;
- const size_t dirsize = sizeof(builddir);
- const size_t namesize = sizeof(rubypath) - dirsize;
- const char *rubyname = rubypath + dirsize;
- char *arg0 = argv[0], *p;
-
- insert_env_path(LIBPATHENV, builddir, dirsize, 1);
- insert_env_path("RUBYLIB", rubylib, sizeof(rubylib), 0);
-
- if (!(p = strrchr(arg0, '/'))) p = arg0; else p++;
- if (strlen(p) < namesize - 1) {
- argv[0] = malloc(p - arg0 + namesize);
- memcpy(argv[0], arg0, p - arg0);
- p = argv[0] + (p - arg0);
- }
- memcpy(p, rubyname, namesize);
-
- execv(rubypath, argv);
- return -1;
-}
diff --git a/ruby.c b/ruby.c
index 4ff30cceca..d0130ec7d3 100644
--- a/ruby.c
+++ b/ruby.c
@@ -15,8 +15,9 @@
#include <windows.h>
#include <sys/cygwin.h>
#endif
+#include "ruby/ruby.h"
+#include "ruby/encoding.h"
#include "internal.h"
-#include "ruby/thread.h"
#include "eval_intern.h"
#include "dln.h"
#include <stdio.h>
@@ -44,9 +45,6 @@
#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
#endif
-#ifndef O_ACCMODE
-# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
#include "ruby/util.h"
@@ -63,65 +61,38 @@ char *getenv();
#define DEFAULT_RUBYGEMS_ENABLED "enabled"
#endif
-#define COMMA ,
-#define FEATURE_BIT(bit) (1U << feature_##bit)
-#define EACH_FEATURES(X, SEP) \
- X(gems) \
- SEP \
- X(did_you_mean) \
- SEP \
- X(rubyopt) \
- SEP \
- X(frozen_string_literal) \
- /* END OF FEATURES */
-#define EACH_DEBUG_FEATURES(X, SEP) \
- X(frozen_string_literal) \
- /* END OF DEBUG FEATURES */
-#define AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */
-#define DEFINE_FEATURE(bit) feature_##bit
-#define DEFINE_DEBUG_FEATURE(bit) feature_debug_##bit
-enum feature_flag_bits {
- EACH_FEATURES(DEFINE_FEATURE, COMMA),
- feature_debug_flag_first,
- feature_debug_flag_begin = feature_debug_flag_first - 1,
- EACH_DEBUG_FEATURES(DEFINE_DEBUG_FEATURE, COMMA),
- feature_flag_count
+#define DISABLE_BIT(bit) (1U << disable_##bit)
+enum disable_flag_bits {
+ disable_gems,
+ disable_rubyopt,
+ disable_flag_count
};
-#define DEBUG_BIT(bit) (1U << feature_debug_##bit)
-
#define DUMP_BIT(bit) (1U << dump_##bit)
-#define DEFINE_DUMP(bit) dump_##bit
-#define EACH_DUMPS(X, SEP) \
- X(version) \
- SEP \
- X(copyright) \
- SEP \
- X(usage) \
- SEP \
- X(help) \
- SEP \
- X(yydebug) \
- SEP \
- X(syntax) \
- SEP \
- X(parsetree) \
- SEP \
- X(parsetree_with_comment) \
- SEP \
- X(insns) \
- /* END OF DUMPS */
enum dump_flag_bits {
+ dump_version,
dump_version_v,
- EACH_DUMPS(DEFINE_DUMP, COMMA),
- dump_exit_bits = (DUMP_BIT(yydebug) | DUMP_BIT(syntax) |
- DUMP_BIT(parsetree) | DUMP_BIT(parsetree_with_comment) |
- DUMP_BIT(insns))
+ dump_copyright,
+ dump_usage,
+ dump_help,
+ dump_yydebug,
+ dump_syntax,
+ dump_parsetree,
+ dump_parsetree_with_comment,
+ dump_insns,
+ dump_flag_count
};
-typedef struct ruby_cmdline_options ruby_cmdline_options_t;
-
-struct ruby_cmdline_options {
+struct cmdline_options {
+ int sflag, xflag;
+ int do_loop, do_print;
+ int do_line, do_split;
+ int do_search;
+ unsigned int disable;
+ int verbose;
+ int safe_level;
+ unsigned int setids;
+ unsigned int dump;
const char *script;
VALUE script_name;
VALUE e_script;
@@ -132,55 +103,28 @@ struct ruby_cmdline_options {
} enc;
} src, ext, intern;
VALUE req_list;
- unsigned int features;
- unsigned int dump;
- int safe_level;
- int sflag, xflag;
- unsigned int warning: 1;
- unsigned int verbose: 1;
- unsigned int do_loop: 1;
- unsigned int do_print: 1;
- unsigned int do_line: 1;
- unsigned int do_split: 1;
- unsigned int do_search: 1;
- unsigned int setids: 2;
};
-static void init_ids(ruby_cmdline_options_t *);
+static void init_ids(struct cmdline_options *);
#define src_encoding_index GET_VM()->src_encoding_index
-enum {
- COMPILATION_FEATURES = (
- 0
- | FEATURE_BIT(frozen_string_literal)
- | FEATURE_BIT(debug_frozen_string_literal)
- ),
- DEFAULT_FEATURES = (
- (FEATURE_BIT(debug_flag_first)-1)
-#if DISABLE_RUBYGEMS
- & ~FEATURE_BIT(gems)
-#endif
- & ~FEATURE_BIT(frozen_string_literal)
- )
-};
-
-static ruby_cmdline_options_t *
-cmdline_options_init(ruby_cmdline_options_t *opt)
+static struct cmdline_options *
+cmdline_options_init(struct cmdline_options *opt)
{
MEMZERO(opt, *opt, 1);
init_ids(opt);
opt->src.enc.index = src_encoding_index;
opt->ext.enc.index = -1;
opt->intern.enc.index = -1;
- opt->features = DEFAULT_FEATURES;
+#if DISABLE_RUBYGEMS
+ opt->disable |= DISABLE_BIT(gems);
+#endif
return opt;
}
-static rb_ast_t *load_file(VALUE parser, VALUE fname, VALUE f, int script,
- ruby_cmdline_options_t *opt);
-static VALUE open_load_file(VALUE fname_v, int *xflag);
-static void forbid_setid(const char *, const ruby_cmdline_options_t *);
+static NODE *load_file(VALUE, VALUE, int, struct cmdline_options *);
+static void forbid_setid(const char *, struct cmdline_options *);
#define forbid_setid(s) forbid_setid((s), opt)
static struct {
@@ -189,18 +133,6 @@ static struct {
} origarg;
static void
-show_usage_line(const char *str, unsigned int namelen, unsigned int secondlen, int help)
-{
- const unsigned int w = 16;
- const int wrap = help && namelen + secondlen - 2 > w;
- printf(" %.*s%-*.*s%-*s%s\n", namelen-1, str,
- (wrap ? 0 : w - namelen + 1),
- (help ? secondlen-1 : 0), str + namelen,
- (wrap ? w + 3 : 0), (wrap ? "\n" : ""),
- str + namelen + secondlen);
-}
-
-static void
usage(const char *name, int help)
{
/* This message really ought to be max 23 lines.
@@ -240,31 +172,27 @@ usage(const char *name, int help)
M("-h", "", "show this message, --help for more info"),
};
static const struct message help_msg[] = {
- M("--copyright", "", "print the copyright"),
- M("--dump={insns|parsetree|...}[,...]", "",
- "dump debug information. see below for available dump list"),
- M("--enable={gems|rubyopt|...}[,...]", ", --disable={gems|rubyopt|...}[,...]",
- "enable or disable features. see below for available features"),
- M("--external-encoding=encoding", ", --internal-encoding=encoding",
+ M("--copyright", "", "print the copyright"),
+ M("--enable=feature[,...]", ", --disable=feature[,...]",
+ "enable or disable features"),
+ M("--external-encoding=encoding", ", --internal-encoding=encoding",
"specify the default external or internal character encoding"),
- M("--version", "", "print the version"),
- M("--help", "", "show this message, -h for short message"),
- };
- static const struct message dumps[] = {
- M("insns", "", "instruction sequences"),
- M("yydebug", "", "yydebug of yacc parser generator"),
- M("parsetree", "", "AST"),
- M("parsetree_with_comment", "", "AST with comments"),
+ M("--version", "", "print the version"),
+ M("--help", "", "show this message, -h for short message"),
};
static const struct message features[] = {
M("gems", "", "rubygems (default: "DEFAULT_RUBYGEMS_ENABLED")"),
- M("did_you_mean", "", "did_you_mean (default: "DEFAULT_RUBYGEMS_ENABLED")"),
M("rubyopt", "", "RUBYOPT environment variable (default: enabled)"),
- M("frozen-string-literal", "", "freeze all string literals (default: disabled)"),
};
- int i;
- const int num = numberof(usage_msg) - (help ? 1 : 0);
-#define SHOW(m) show_usage_line((m).str, (m).namelen, (m).secondlen, help)
+ int i, w = 16, num = numberof(usage_msg) - (help ? 1 : 0);
+#define SHOW(m) do { \
+ int wrap = help && (m).namelen + (m).secondlen - 2 > w; \
+ printf(" %.*s%-*.*s%-*s%s\n", (m).namelen-1, (m).str, \
+ (wrap ? 0 : w - (m).namelen + 1), \
+ (help ? (m).secondlen-1 : 0), (m).str + (m).namelen, \
+ (wrap ? w + 3 : 0), (wrap ? "\n" : ""), \
+ (m).str + (m).namelen + (m).secondlen); \
+ } while (0)
printf("Usage: %s [switches] [--] [programfile] [arguments]\n", name);
for (i = 0; i < num; ++i)
@@ -274,9 +202,6 @@ usage(const char *name, int help)
for (i = 0; i < numberof(help_msg); ++i)
SHOW(help_msg[i]);
- puts("Dump List:");
- for (i = 0; i < numberof(dumps); ++i)
- SHOW(dumps[i]);
puts("Features:");
for (i = 0; i < numberof(features); ++i)
SHOW(features[i]);
@@ -388,7 +313,6 @@ ruby_incpush_expand(const char *path)
ruby_push_include(path, expand_include_path);
}
-#undef UTF8_PATH
#if defined _WIN32 || defined __CYGWIN__
static HMODULE libruby;
@@ -405,41 +329,6 @@ rb_libruby_handle(void)
{
return libruby;
}
-
-static inline void
-translit_char_bin(char *p, int from, int to)
-{
- while (*p) {
- if ((unsigned char)*p == from)
- *p = to;
- p++;
- }
-}
-#endif
-
-#ifdef _WIN32
-# define UTF8_PATH 1
-#endif
-
-#ifndef UTF8_PATH
-# define UTF8_PATH 0
-#endif
-#if UTF8_PATH
-# define IF_UTF8_PATH(t, f) t
-#else
-# define IF_UTF8_PATH(t, f) f
-#endif
-
-#if UTF8_PATH
-static VALUE
-str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
-{
- return rb_str_conv_enc_opts(str, from, to,
- ECONV_UNDEF_REPLACE|ECONV_INVALID_REPLACE,
- Qnil);
-}
-#else
-# define str_conv_enc(str, from, to) (str)
#endif
void ruby_init_loadpath_safe(int safe_level);
@@ -450,38 +339,12 @@ ruby_init_loadpath(void)
ruby_init_loadpath_safe(0);
}
-#if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR) && !defined(__CYGWIN__)
-static VALUE
-dladdr_path(const void* addr)
-{
- Dl_info dli;
- VALUE fname, path;
-
- if (!dladdr(addr, &dli)) {
- return rb_str_new(0, 0);
- }
-#ifdef __linux__
- else if (origarg.argc > 0 && origarg.argv && dli.dli_fname == origarg.argv[0]) {
- fname = rb_str_new_cstr("/proc/self/exe");
- path = rb_readlink(fname, NULL);
- }
-#endif
- else {
- fname = rb_str_new_cstr(dli.dli_fname);
- path = rb_realpath_internal(Qnil, fname, 1);
- }
- rb_str_resize(fname, 0);
- return path;
-}
-#endif
-
-#define INITIAL_LOAD_PATH_MARK rb_intern_const("@gem_prelude_index")
-
void
ruby_init_loadpath_safe(int safe_level)
{
VALUE load_path;
ID id_initial_load_path_mark;
+ extern const char ruby_initial_load_paths[];
const char *paths = ruby_initial_load_paths;
#if defined LOAD_RELATIVE
# if defined HAVE_DLADDR || defined __CYGWIN__ || defined _WIN32
@@ -499,39 +362,30 @@ ruby_init_loadpath_safe(int safe_level)
char *p;
#if defined _WIN32 || defined __CYGWIN__
- {
- DWORD len = RSTRING_EMBED_LEN_MAX, ret, i;
- VALUE wsopath = rb_str_new(0, len*sizeof(WCHAR));
- WCHAR *wlibpath;
- while (wlibpath = (WCHAR *)RSTRING_PTR(wsopath),
- ret = GetModuleFileNameW(libruby, wlibpath, len),
- (ret == len))
- {
- rb_str_modify_expand(wsopath, len*sizeof(WCHAR));
- rb_str_set_len(wsopath, (len += len)*sizeof(WCHAR));
- }
- if (!ret || ret > len) rb_fatal("failed to get module file name");
- for (len = ret, i = 0; i < len; ++i) {
- if (wlibpath[i] == L'\\') {
- wlibpath[i] = L'/';
- ret = i+1; /* chop after the last separator */
- }
- }
- len = WideCharToMultiByte(CP_UTF8, 0, wlibpath, ret, NULL, 0, NULL, NULL);
- sopath = rb_utf8_str_new(0, len);
- libpath = RSTRING_PTR(sopath);
- WideCharToMultiByte(CP_UTF8, 0, wlibpath, ret, libpath, len, NULL, NULL);
- rb_str_resize(wsopath, 0);
- }
+ sopath = rb_str_new(0, MAXPATHLEN);
+ libpath = RSTRING_PTR(sopath);
+ GetModuleFileName(libruby, libpath, MAXPATHLEN);
+#elif defined(__EMX__)
+ _execname(libpath, sizeof(libpath) - 1);
#elif defined(HAVE_DLADDR)
- sopath = dladdr_path((void *)(VALUE)expand_include_path);
+ Dl_info dli;
+ if (dladdr((void *)(VALUE)expand_include_path, &dli)) {
+ char fbuf[MAXPATHLEN];
+ char *f = dln_find_file_r(dli.dli_fname, getenv(PATH_ENV), fbuf, sizeof(fbuf));
+ VALUE fname = rb_str_new_cstr(f ? f : dli.dli_fname);
+ rb_str_freeze(fname);
+ sopath = rb_realpath_internal(Qnil, fname, 1);
+ }
+ else {
+ sopath = rb_str_new(0, 0);
+ }
libpath = RSTRING_PTR(sopath);
#endif
#if !VARIABLE_LIBPATH
libpath[sizeof(libpath) - 1] = '\0';
#endif
-#if defined DOSISH && !defined _WIN32
+#if defined DOSISH
translit_char(libpath, '\\', '/');
#elif defined __CYGWIN__
{
@@ -581,9 +435,7 @@ ruby_init_loadpath_safe(int safe_level)
p = p2;
}
#endif
-#if !VARIABLE_LIBPATH
*p = 0;
-#endif
}
#if !VARIABLE_LIBPATH
else {
@@ -603,6 +455,7 @@ ruby_init_loadpath_safe(int safe_level)
#define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), (path), (len))
#else
+ extern const char ruby_exec_prefix[];
const size_t exec_prefix_len = strlen(ruby_exec_prefix);
#define RUBY_RELATIVE(path, len) rubylib_path_new((path), (len))
#define PREFIX_PATH() RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len)
@@ -613,7 +466,7 @@ ruby_init_loadpath_safe(int safe_level)
ruby_push_include(getenv("RUBYLIB"), identical_path);
}
- id_initial_load_path_mark = INITIAL_LOAD_PATH_MARK;
+ id_initial_load_path_mark = rb_intern_const("@gem_prelude_index");
while (*paths) {
size_t len = strlen(paths);
VALUE path = RUBY_RELATIVE(paths, len);
@@ -647,7 +500,10 @@ require_libraries(VALUE *req_list)
VALUE list = *req_list;
VALUE self = rb_vm_top_self();
ID require;
+ rb_thread_t *th = GET_THREAD();
rb_encoding *extenc = rb_default_external_encoding();
+ int prev_parse_in_eval = th->parse_in_eval;
+ th->parse_in_eval = 0;
CONST_ID(require, "require");
while (list && RARRAY_LEN(list) > 0) {
@@ -655,15 +511,22 @@ require_libraries(VALUE *req_list)
rb_enc_associate(feature, extenc);
RBASIC_SET_CLASS_RAW(feature, rb_cString);
OBJ_FREEZE(feature);
- rb_funcallv(self, require, 1, &feature);
+ rb_funcall2(self, require, 1, &feature);
}
*req_list = 0;
+
+ th->parse_in_eval = prev_parse_in_eval;
}
-static const struct rb_block*
-toplevel_context(rb_binding_t *bind)
+static rb_env_t*
+toplevel_context(VALUE toplevel_binding)
{
- return &bind->block;
+ rb_env_t *env;
+ rb_binding_t *bind;
+
+ GetBindingPtr(toplevel_binding, bind);
+ GetEnvPtr(bind->env, env);
+ return env;
}
static void
@@ -730,10 +593,10 @@ process_sflag(int *sflag)
}
}
-static long proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt);
+static long proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt);
static void
-moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
+moreswitches(const char *s, struct cmdline_options *opt, int envopt)
{
long argc, i, len;
char **argv, *p;
@@ -742,11 +605,11 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
while (ISSPACE(*s)) s++;
if (!*s) return;
- argstr = rb_str_tmp_new((len = strlen(s)) + (envopt!=0));
+ argstr = rb_str_tmp_new((len = strlen(s)) + 2);
argary = rb_str_tmp_new(0);
p = RSTRING_PTR(argstr);
- if (envopt) *p++ = ' ';
+ *p++ = ' ';
memcpy(p, s, len + 1);
ap = 0;
rb_str_cat(argary, (char *)&ap, sizeof(ap));
@@ -763,7 +626,7 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
rb_str_cat(argary, (char *)&ap, sizeof(ap));
argv = (char **)RSTRING_PTR(argary);
- while ((i = proc_options(argc, argv, opt, envopt)) > 1 && envopt && (argc -= i) > 0) {
+ while ((i = proc_options(argc, argv, opt, envopt)) > 1 && (argc -= i) > 0) {
argv += i;
if (**argv != '-') {
*--*argv = '-';
@@ -779,26 +642,8 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
rb_str_resize(argstr, 0);
}
-static int
-name_match_p(const char *name, const char *str, size_t len)
-{
- if (len == 0) return 0;
- do {
- while (TOLOWER(*str) == *name) {
- if (!--len || !*++str) return 1;
- ++name;
- }
- if (*str != '-' && *str != '_') return 0;
- while (ISALNUM(*name)) name++;
- if (*name != '-' && *name != '_') return 0;
- ++name;
- ++str;
- } while (len > 0);
- return !*name;
-}
-
#define NAME_MATCH_P(name, str, len) \
- ((len) < (int)sizeof(name) && name_match_p((name), (str), (len)))
+ ((len) < (int)sizeof(name) && strncmp((str), (name), (len)) == 0)
#define UNSET_WHEN(name, bit, str, len) \
if (NAME_MATCH_P((name), (str), (len))) { \
@@ -812,85 +657,47 @@ name_match_p(const char *name, const char *str, size_t len)
return; \
}
-#define LITERAL_NAME_ELEMENT(name) #name
-
static void
-feature_option(const char *str, int len, void *arg, const unsigned int enable)
+enable_option(const char *str, int len, void *arg)
{
- static const char list[] = EACH_FEATURES(LITERAL_NAME_ELEMENT, ", ");
- unsigned int *argp = arg;
- unsigned int mask = ~0U;
-#if AMBIGUOUS_FEATURE_NAMES
- unsigned int set = 0U;
- int matched = 0;
-#define SET_FEATURE(bit) \
- if (NAME_MATCH_P(#bit, str, len)) {set |= mask = FEATURE_BIT(bit); ++matched;}
-#else
-#define SET_FEATURE(bit) \
- if (NAME_MATCH_P(#bit, str, len)) {mask = FEATURE_BIT(bit); goto found;}
-#endif
- EACH_FEATURES(SET_FEATURE, ;);
+#define UNSET_WHEN_DISABLE(bit) UNSET_WHEN(#bit, DISABLE_BIT(bit), str, len)
+ UNSET_WHEN_DISABLE(gems);
+ UNSET_WHEN_DISABLE(rubyopt);
if (NAME_MATCH_P("all", str, len)) {
- found:
- *argp = (*argp & ~mask) | (mask & enable);
+ *(unsigned int *)arg = 0U;
return;
}
-#if AMBIGUOUS_FEATURE_NAMES
- if (matched == 1) goto found;
- if (matched > 1) {
- VALUE mesg = rb_sprintf("ambiguous feature: `%.*s' (", len, str);
-#define ADD_FEATURE_NAME(bit) \
- if (FEATURE_BIT(bit) & set) { \
- rb_str_cat_cstr(mesg, #bit); \
- if (--matched) rb_str_cat_cstr(mesg, ", "); \
- }
- EACH_FEATURES(ADD_FEATURE_NAME, ;);
- rb_str_cat_cstr(mesg, ")");
- rb_exc_raise(rb_exc_new_str(rb_eRuntimeError, mesg));
-#undef ADD_FEATURE_NAME
- }
-#endif
- rb_warn("unknown argument for --%s: `%.*s'",
- enable ? "enable" : "disable", len, str);
- rb_warn("features are [%.*s].", (int)strlen(list), list);
-}
-
-static void
-enable_option(const char *str, int len, void *arg)
-{
- feature_option(str, len, arg, ~0U);
+ rb_warn("unknown argument for --enable: `%.*s'", len, str);
}
static void
disable_option(const char *str, int len, void *arg)
{
- feature_option(str, len, arg, 0U);
-}
-
-RUBY_EXTERN const int ruby_patchlevel;
-int ruby_env_debug_option(const char *str, int len, void *arg);
-
-static void
-debug_option(const char *str, int len, void *arg)
-{
- static const char list[] = EACH_DEBUG_FEATURES(LITERAL_NAME_ELEMENT, ", ");
-#define SET_WHEN_DEBUG(bit) SET_WHEN(#bit, DEBUG_BIT(bit), str, len)
- EACH_DEBUG_FEATURES(SET_WHEN_DEBUG, ;);
-#ifdef RUBY_DEVEL
- if (ruby_patchlevel < 0 && ruby_env_debug_option(str, len, 0)) return;
-#endif
- rb_warn("unknown argument for --debug: `%.*s'", len, str);
- rb_warn("debug features are [%.*s].", (int)strlen(list), list);
+#define SET_WHEN_DISABLE(bit) SET_WHEN(#bit, DISABLE_BIT(bit), str, len)
+ SET_WHEN_DISABLE(gems);
+ SET_WHEN_DISABLE(rubyopt);
+ if (NAME_MATCH_P("all", str, len)) {
+ *(unsigned int *)arg = ~0U;
+ return;
+ }
+ rb_warn("unknown argument for --disable: `%.*s'", len, str);
}
static void
dump_option(const char *str, int len, void *arg)
{
- static const char list[] = EACH_DUMPS(LITERAL_NAME_ELEMENT, ", ");
#define SET_WHEN_DUMP(bit) SET_WHEN(#bit, DUMP_BIT(bit), str, len)
- EACH_DUMPS(SET_WHEN_DUMP, ;);
+ SET_WHEN_DUMP(version);
+ SET_WHEN_DUMP(copyright);
+ SET_WHEN_DUMP(usage);
+ SET_WHEN_DUMP(help);
+ SET_WHEN_DUMP(yydebug);
+ SET_WHEN_DUMP(syntax);
+ SET_WHEN_DUMP(parsetree);
+ SET_WHEN_DUMP(parsetree_with_comment);
+ SET_WHEN_DUMP(insns);
rb_warn("don't know how to dump `%.*s',", len, str);
- rb_warn("but only [%.*s].", (int)strlen(list), list);
+ rb_warn("but only [version, copyright, usage, yydebug, syntax, parsetree, parsetree_with_comment, insns].");
}
static void
@@ -917,13 +724,12 @@ set_option_encoding_once(const char *type, VALUE *name, const char *e, long elen
set_option_encoding_once("source", &(opt)->src.enc.name, (e), (elen))
static long
-proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
+proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
{
long n, argc0 = argc;
const char *s;
- int warning = opt->warning;
- if (argc <= 0 || !argv)
+ if (argc == 0)
return 0;
for (argc--, argv++; argc > 0; argc--, argv++) {
@@ -970,10 +776,7 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
opt->dump |= DUMP_BIT(version_v);
opt->verbose = 1;
case 'w':
- if (!opt->warning) {
- warning = 1;
- ruby_verbose = Qtrue;
- }
+ ruby_verbose = Qtrue;
s++;
goto reswitch;
@@ -988,20 +791,17 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
v = 1;
s += numlen;
}
- if (!opt->warning) {
- switch (v) {
- case 0:
- ruby_verbose = Qnil;
- break;
- case 1:
- ruby_verbose = Qfalse;
- break;
- default:
- ruby_verbose = Qtrue;
- break;
- }
+ switch (v) {
+ case 0:
+ ruby_verbose = Qnil;
+ break;
+ case 1:
+ ruby_verbose = Qfalse;
+ break;
+ default:
+ ruby_verbose = Qtrue;
+ break;
}
- warning = 1;
}
goto reswitch;
@@ -1073,7 +873,6 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
case 'x':
if (envopt) goto noenvopt;
- forbid_setid("-x");
opt->xflag = TRUE;
s++;
if (*s && chdir(s) < 0) {
@@ -1173,7 +972,7 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
if (v > 0377)
rb_rs = Qnil;
else if (v == 0 && numlen >= 2) {
- rb_rs = rb_str_new2("");
+ rb_rs = rb_str_new2("\n\n");
}
else {
c = v & 0xff;
@@ -1194,35 +993,30 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
# define check_envopt(name, allow_envopt) \
(((allow_envopt) || !envopt) ? (void)0 : \
rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --" name))
-# define need_argument(name, s, needs_arg, next_arg) \
- ((*(s) ? !*++(s) : (next_arg) && (!argc || !((s) = argv[1]) || (--argc, ++argv, 0))) && (needs_arg) ? \
+# define need_argument(name, s, needs_arg) \
+ ((*(s)++ ? !*(s) : (!--argc || !((s) = *++argv))) && (needs_arg) ? \
rb_raise(rb_eRuntimeError, "missing argument for --" name) \
: (void)0)
# define is_option_with_arg(name, allow_hyphen, allow_envopt) \
- is_option_with_optarg(name, allow_hyphen, allow_envopt, Qtrue, Qtrue)
-# define is_option_with_optarg(name, allow_hyphen, allow_envopt, needs_arg, next_arg) \
+ is_option_with_optarg(name, allow_hyphen, allow_envopt, Qtrue)
+# define is_option_with_optarg(name, allow_hyphen, allow_envopt, needs_arg) \
(strncmp((name), s, n = sizeof(name) - 1) == 0 && is_option_end(s[n], (allow_hyphen)) ? \
(check_envopt(name, (allow_envopt)), s += n, \
- need_argument(name, s, needs_arg, next_arg), 1) : 0)
+ need_argument(name, s, needs_arg), 1) : 0)
if (strcmp("copyright", s) == 0) {
if (envopt) goto noenvopt_long;
opt->dump |= DUMP_BIT(copyright);
}
- else if (is_option_with_optarg("debug", Qtrue, Qtrue, Qfalse, Qfalse)) {
- if (s && *s) {
- ruby_each_words(s, debug_option, &opt->features);
- }
- else {
- ruby_debug = Qtrue;
- ruby_verbose = Qtrue;
- }
+ else if (strcmp("debug", s) == 0) {
+ ruby_debug = Qtrue;
+ ruby_verbose = Qtrue;
}
else if (is_option_with_arg("enable", Qtrue, Qtrue)) {
- ruby_each_words(s, enable_option, &opt->features);
+ ruby_each_words(s, enable_option, &opt->disable);
}
else if (is_option_with_arg("disable", Qtrue, Qtrue)) {
- ruby_each_words(s, disable_option, &opt->features);
+ ruby_each_words(s, disable_option, &opt->disable);
}
else if (is_option_with_arg("encoding", Qfalse, Qtrue)) {
char *p;
@@ -1325,7 +1119,6 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
}
switch_end:
- if (warning) opt->warning = warning;
return argc0 - argc;
}
@@ -1458,37 +1251,31 @@ rb_f_chomp(int argc, VALUE *argv)
return str;
}
+/* blank function in dmyext.c or generated by enc/make_encmake.rb */
+extern void Init_enc(void);
+
static VALUE
-process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
+process_options(int argc, char **argv, struct cmdline_options *opt)
{
- rb_ast_t *ast = 0;
+ NODE *tree = 0;
VALUE parser;
- VALUE script_name;
- const rb_iseq_t *iseq;
+ VALUE iseq;
rb_encoding *enc, *lenc;
-#if UTF8_PATH
- rb_encoding *uenc, *ienc = 0;
-#endif
const char *s;
char fbuf[MAXPATHLEN];
int i = (int)proc_options(argc, argv, opt, 0);
- rb_binding_t *toplevel_binding;
- const struct rb_block *base_block;
- unsigned int dump = opt->dump & dump_exit_bits;
+ rb_thread_t *th = GET_THREAD();
+ VALUE toplevel_binding = Qundef;
+
+ argc -= i;
+ argv += i;
if (opt->dump & (DUMP_BIT(usage)|DUMP_BIT(help))) {
- const char *const progname =
- (argc > 0 && argv && argv[0] ? argv[0] :
- origarg.argc > 0 && origarg.argv && origarg.argv[0] ? origarg.argv[0] :
- ruby_engine);
- usage(progname, (opt->dump & DUMP_BIT(help)));
+ usage(origarg.argv[0], (opt->dump & DUMP_BIT(help)));
return Qtrue;
}
- argc -= i;
- argv += i;
-
- if ((opt->features & FEATURE_BIT(rubyopt)) &&
+ if (!(opt->disable & DISABLE_BIT(rubyopt)) &&
opt->safe_level == 0 && (s = getenv("RUBYOPT"))) {
VALUE src_enc_name = opt->src.enc.name;
VALUE ext_enc_name = opt->ext.enc.name;
@@ -1513,11 +1300,15 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
}
if (opt->dump & DUMP_BIT(copyright)) {
ruby_show_copyright();
- return Qtrue;
+ }
+
+ if (opt->safe_level >= 4) {
+ OBJ_TAINT(rb_argv);
+ OBJ_TAINT(GET_VM()->load_path);
}
if (!opt->e_script) {
- if (argc <= 0) { /* no more args */
+ if (argc == 0) { /* no more args */
if (opt->verbose)
return Qtrue;
opt->script = "-";
@@ -1543,23 +1334,18 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
argc--;
argv++;
}
- if (opt->script[0] == '-' && !opt->script[1]) {
- forbid_setid("program input from stdin");
- }
}
opt->script_name = rb_str_new_cstr(opt->script);
opt->script = RSTRING_PTR(opt->script_name);
-
-#if _WIN32
- translit_char_bin(RSTRING_PTR(opt->script_name), '\\', '/');
-#elif defined DOSISH
+#if defined DOSISH || defined __CYGWIN__
translit_char(RSTRING_PTR(opt->script_name), '\\', '/');
#endif
ruby_gc_set_params(opt->safe_level);
ruby_init_loadpath_safe(opt->safe_level);
Init_enc();
+ rb_enc_find_index("encdb");
lenc = rb_locale_encoding();
rb_enc_associate(rb_progname, lenc);
rb_obj_freeze(rb_progname);
@@ -1588,77 +1374,36 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
enc = rb_enc_from_index(opt->intern.enc.index);
rb_enc_set_default_internal(rb_enc_from_encoding(enc));
opt->intern.enc.index = -1;
-#if UTF8_PATH
- ienc = enc;
-#endif
}
- script_name = opt->script_name;
- rb_enc_associate(opt->script_name,
- IF_UTF8_PATH(uenc = rb_utf8_encoding(), lenc));
-#if UTF8_PATH
- if (uenc != lenc) {
- opt->script_name = str_conv_enc(opt->script_name, uenc, lenc);
- opt->script = RSTRING_PTR(opt->script_name);
- }
-#endif
+ rb_enc_associate(opt->script_name, lenc);
rb_obj_freeze(opt->script_name);
- if (IF_UTF8_PATH(uenc != lenc, 1)) {
+ {
long i;
- rb_vm_t *vm = GET_VM();
- VALUE load_path = vm->load_path;
- const ID id_initial_load_path_mark = INITIAL_LOAD_PATH_MARK;
- int modifiable = FALSE;
-
- rb_get_expanded_load_path();
+ VALUE load_path = GET_VM()->load_path;
for (i = 0; i < RARRAY_LEN(load_path); ++i) {
VALUE path = RARRAY_AREF(load_path, i);
- int mark = rb_attr_get(path, id_initial_load_path_mark) == path;
-#if UTF8_PATH
- VALUE newpath = rb_str_conv_enc(path, uenc, lenc);
- if (newpath == path) continue;
- path = newpath;
-#else
path = rb_enc_associate(rb_str_dup(path), lenc);
-#endif
- if (mark) rb_ivar_set(path, id_initial_load_path_mark, path);
- if (!modifiable) {
- rb_ary_modify(load_path);
- modifiable = TRUE;
- }
RARRAY_ASET(load_path, i, path);
}
- if (modifiable) {
- rb_ary_replace(vm->load_path_snapshot, load_path);
- }
}
Init_ext(); /* load statically linked extensions before rubygems */
- if (opt->features & FEATURE_BIT(gems)) {
+ if (!(opt->disable & DISABLE_BIT(gems))) {
rb_define_module("Gem");
}
- if (opt->features & FEATURE_BIT(did_you_mean)) {
- rb_define_module("DidYouMean");
- }
ruby_init_prelude();
- if ((opt->features ^ DEFAULT_FEATURES) & COMPILATION_FEATURES) {
- VALUE option = rb_hash_new();
-#define SET_COMPILE_OPTION(h, o, name) \
- rb_hash_aset((h), ID2SYM(rb_intern_const(#name)), \
- ((o)->features & FEATURE_BIT(name) ? Qtrue : Qfalse));
- SET_COMPILE_OPTION(option, opt, frozen_string_literal);
- SET_COMPILE_OPTION(option, opt, debug_frozen_string_literal);
- rb_funcallv(rb_cISeq, rb_intern_const("compile_option="), 1, &option);
-#undef SET_COMPILE_OPTION
- }
ruby_set_argv(argc, argv);
process_sflag(&opt->sflag);
- GetBindingPtr(rb_const_get(rb_cObject, rb_intern("TOPLEVEL_BINDING")),
- toplevel_binding);
- /* need to acquire env from toplevel_binding each time, since it
- * may update after eval() */
+ toplevel_binding = rb_const_get(rb_cObject, rb_intern("TOPLEVEL_BINDING"));
- base_block = toplevel_context(toplevel_binding);
- rb_parser_set_context(parser, base_block, TRUE);
+#define PREPARE_PARSE_MAIN(expr) do { \
+ rb_env_t *env = toplevel_context(toplevel_binding); \
+ th->parse_in_eval--; \
+ th->base_block = &env->block; \
+ expr; \
+ th->parse_in_eval++; \
+ th->base_block = 0; \
+} while (0)
if (opt->e_script) {
VALUE progname = rb_progname;
@@ -1668,35 +1413,27 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
}
else {
eenc = lenc;
-#if UTF8_PATH
- if (ienc) eenc = ienc;
-#endif
}
-#if UTF8_PATH
- if (eenc != uenc) {
- opt->e_script = str_conv_enc(opt->e_script, uenc, eenc);
- }
-#endif
rb_enc_associate(opt->e_script, eenc);
- if (!(opt->dump & ~DUMP_BIT(version_v))) {
- ruby_set_script_name(opt->script_name);
- require_libraries(&opt->req_list);
- }
+ ruby_set_script_name(opt->script_name);
+ require_libraries(&opt->req_list);
ruby_set_script_name(progname);
- rb_parser_set_options(parser, opt->do_print, opt->do_loop,
- opt->do_line, opt->do_split);
- ast = rb_parser_compile_string(parser, opt->script, opt->e_script, 1);
+
+ PREPARE_PARSE_MAIN({
+ tree = rb_parser_compile_string(parser, opt->script, opt->e_script, 1);
+ });
}
else {
- VALUE f;
- f = open_load_file(script_name, &opt->xflag);
- ast = load_file(parser, opt->script_name, f, 1, opt);
+ if (opt->script[0] == '-' && !opt->script[1]) {
+ forbid_setid("program input from stdin");
+ }
+
+ PREPARE_PARSE_MAIN({
+ tree = load_file(parser, opt->script_name, 1, opt);
+ });
}
ruby_set_script_name(opt->script_name);
- if (dump & DUMP_BIT(yydebug)) {
- dump &= ~DUMP_BIT(yydebug);
- if (!dump) return Qtrue;
- }
+ if (opt->dump & DUMP_BIT(yydebug)) return Qtrue;
if (opt->ext.enc.index >= 0) {
enc = rb_enc_from_index(opt->ext.enc.index);
@@ -1715,62 +1452,55 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
rb_enc_set_default_internal(Qnil);
rb_stdio_set_default_encoding();
- if (!ast->root) {
- rb_ast_dispose(ast);
- return Qfalse;
- }
+ if (!tree) return Qfalse;
process_sflag(&opt->sflag);
opt->xflag = 0;
- if (dump & DUMP_BIT(syntax)) {
+ if (opt->safe_level >= 4) {
+ FL_UNSET(rb_argv, FL_TAINT);
+ FL_UNSET(GET_VM()->load_path, FL_TAINT);
+ }
+
+ if (opt->dump & DUMP_BIT(syntax)) {
printf("Syntax OK\n");
- dump &= ~DUMP_BIT(syntax);
- if (!dump) return Qtrue;
+ return Qtrue;
}
+ if (opt->do_print) {
+ PREPARE_PARSE_MAIN({
+ tree = rb_parser_append_print(parser, tree);
+ });
+ }
if (opt->do_loop) {
+ PREPARE_PARSE_MAIN({
+ tree = rb_parser_while_loop(parser, tree, opt->do_line, opt->do_split);
+ });
rb_define_global_function("sub", rb_f_sub, -1);
rb_define_global_function("gsub", rb_f_gsub, -1);
rb_define_global_function("chop", rb_f_chop, 0);
rb_define_global_function("chomp", rb_f_chomp, -1);
}
- if (dump & (DUMP_BIT(parsetree)|DUMP_BIT(parsetree_with_comment))) {
- rb_io_write(rb_stdout, rb_parser_dump_tree(ast->root, dump & DUMP_BIT(parsetree_with_comment)));
+ if (opt->dump & DUMP_BIT(parsetree) || opt->dump & DUMP_BIT(parsetree_with_comment)) {
+ rb_io_write(rb_stdout, rb_parser_dump_tree(tree, opt->dump & DUMP_BIT(parsetree_with_comment)));
rb_io_flush(rb_stdout);
- dump &= ~DUMP_BIT(parsetree)&~DUMP_BIT(parsetree_with_comment);
- if (!dump) {
- rb_ast_dispose(ast);
- return Qtrue;
- }
+ return Qtrue;
}
- {
+ PREPARE_PARSE_MAIN({
VALUE path = Qnil;
if (!opt->e_script && strcmp(opt->script, "-")) {
- path = rb_realpath_internal(Qnil, script_name, 1);
-#if UTF8_PATH
- if (uenc != lenc) {
- path = str_conv_enc(path, uenc, lenc);
- }
-#endif
- if (!ENCODING_GET(path)) { /* ASCII-8BIT */
- rb_enc_copy(path, opt->script_name);
- }
+ path = rb_realpath_internal(Qnil, opt->script_name, 1);
}
- base_block = toplevel_context(toplevel_binding);
- iseq = rb_iseq_new_main(ast->root, opt->script_name, path, vm_block_iseq(base_block));
- rb_ast_dispose(ast);
- }
+ iseq = rb_iseq_new_main(tree, opt->script_name, path);
+ });
- if (dump & DUMP_BIT(insns)) {
- rb_io_write(rb_stdout, rb_iseq_disasm((const rb_iseq_t *)iseq));
+ if (opt->dump & DUMP_BIT(insns)) {
+ rb_io_write(rb_stdout, rb_iseq_disasm(iseq));
rb_io_flush(rb_stdout);
- dump &= ~DUMP_BIT(insns);
- if (!dump) return Qtrue;
+ return Qtrue;
}
- if (opt->dump & dump_exit_bits) return Qtrue;
rb_define_readonly_boolean("$-p", opt->do_print);
rb_define_readonly_boolean("$-l", opt->do_line);
@@ -1778,49 +1508,38 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
rb_set_safe_level(opt->safe_level);
- return (VALUE)iseq;
+ return iseq;
}
-#ifndef DOSISH
-static void
-warn_cr_in_shebang(const char *str, long len)
-{
- if (str[len-1] == '\n' && str[len-2] == '\r') {
- rb_warn("shebang line ending with \\r may cause problems");
- }
-}
-#else
-#define warn_cr_in_shebang(str, len) (void)0
-#endif
-
struct load_file_arg {
VALUE parser;
VALUE fname;
int script;
- ruby_cmdline_options_t *opt;
+ struct cmdline_options *opt;
VALUE f;
+ int xflag;
};
static VALUE
-load_file_internal(VALUE argp_v)
+load_file_internal2(VALUE argp_v)
{
struct load_file_arg *argp = (struct load_file_arg *)argp_v;
VALUE parser = argp->parser;
VALUE orig_fname = argp->fname;
int script = argp->script;
- ruby_cmdline_options_t *opt = argp->opt;
+ struct cmdline_options *opt = argp->opt;
VALUE f = argp->f;
int line_start = 1;
- rb_ast_t *ast = 0;
+ NODE *tree = 0;
rb_encoding *enc;
ID set_encoding;
+ int xflag = argp->xflag;
CONST_ID(set_encoding, "set_encoding");
if (script) {
VALUE c = 1; /* something not nil */
VALUE line;
- char *p, *str;
- long len;
+ char *p;
int no_src_enc = !opt->src.enc.name;
int no_ext_enc = !opt->ext.enc.name;
int no_int_enc = !opt->intern.enc.name;
@@ -1828,15 +1547,17 @@ load_file_internal(VALUE argp_v)
enc = rb_ascii8bit_encoding();
rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc));
- if (opt->xflag) {
+ if (xflag || opt->xflag) {
line_start--;
search_shebang:
+ forbid_setid("-x");
+ opt->xflag = FALSE;
while (!NIL_P(line = rb_io_gets(f))) {
line_start++;
- RSTRING_GETMEM(line, str, len);
- if (len > 2 && str[0] == '#' && str[1] == '!') {
- if (line_start == 1) warn_cr_in_shebang(str, len);
- if ((p = strstr(str+2, ruby_engine)) != 0) {
+ if (RSTRING_LEN(line) > 2
+ && RSTRING_PTR(line)[0] == '#'
+ && RSTRING_PTR(line)[1] == '!') {
+ if ((p = strstr(RSTRING_PTR(line), "ruby")) != 0) {
goto start_read;
}
}
@@ -1847,21 +1568,22 @@ load_file_internal(VALUE argp_v)
c = rb_io_getbyte(f);
if (c == INT2FIX('#')) {
c = rb_io_getbyte(f);
- if (c == INT2FIX('!') && !NIL_P(line = rb_io_gets(f))) {
- RSTRING_GETMEM(line, str, len);
- warn_cr_in_shebang(str, len);
- if ((p = strstr(str, ruby_engine)) == 0) {
+ if (c == INT2FIX('!')) {
+ line = rb_io_gets(f);
+ if (NIL_P(line))
+ return 0;
+
+ if ((p = strstr(RSTRING_PTR(line), "ruby")) == 0) {
/* not ruby script, assume -x flag */
goto search_shebang;
}
start_read:
- str += len - 1;
- if (*str == '\n') *str-- = '\0';
- if (*str == '\r') *str-- = '\0';
- /* ruby_engine should not contain a space */
+ p += 4;
+ RSTRING_PTR(line)[RSTRING_LEN(line) - 1] = '\0';
+ if (RSTRING_PTR(line)[RSTRING_LEN(line) - 2] == '\r')
+ RSTRING_PTR(line)[RSTRING_LEN(line) - 2] = '\0';
if ((p = strstr(p, " -")) != 0) {
- opt->warning = 0;
moreswitches(p + 1, opt, 0);
}
@@ -1887,12 +1609,11 @@ load_file_internal(VALUE argp_v)
rb_io_ungetbyte(f, c);
}
else {
- argp->f = f = Qnil;
- }
- if (!(opt->dump & ~DUMP_BIT(version_v))) {
- ruby_set_script_name(opt->script_name);
- require_libraries(&opt->req_list); /* Why here? unnatural */
+ if (f != rb_stdin) rb_io_close(f);
+ f = Qnil;
}
+ ruby_set_script_name(opt->script_name);
+ require_libraries(&opt->req_list); /* Why here? unnatural */
}
if (opt->src.enc.index >= 0) {
enc = rb_enc_from_index(opt->src.enc.index);
@@ -1903,135 +1624,109 @@ load_file_internal(VALUE argp_v)
else {
enc = rb_utf8_encoding();
}
- rb_parser_set_options(parser, opt->do_print, opt->do_loop,
- opt->do_line, opt->do_split);
if (NIL_P(f)) {
f = rb_str_new(0, 0);
rb_enc_associate(f, enc);
return (VALUE)rb_parser_compile_string_path(parser, orig_fname, f, line_start);
}
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
- ast = rb_parser_compile_file_path(parser, orig_fname, f, line_start);
+ tree = rb_parser_compile_file_path(parser, orig_fname, f, line_start);
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
- if (script && rb_parser_end_seen_p(parser)) {
- /*
- * DATA is a File that contains the data section of the executed file.
- * To create a data section use <tt>__END__</tt>:
- *
- * $ cat t.rb
- * puts DATA.gets
- * __END__
- * hello world!
- *
- * $ ruby t.rb
- * hello world!
- */
- rb_define_global_const("DATA", f);
- argp->f = Qnil;
- }
- return (VALUE)ast;
+ return (VALUE)tree;
}
static VALUE
-open_load_file(VALUE fname_v, int *xflag)
+load_file_internal(VALUE arg)
{
- const char *fname = (fname_v = rb_str_encode_ospath(fname_v),
- StringValueCStr(fname_v));
- long flen = RSTRING_LEN(fname_v);
+ extern VALUE rb_stdin;
+ struct load_file_arg *argp = (struct load_file_arg *)arg;
+ VALUE parser = argp->parser;
+ VALUE orig_fname = argp->fname;
+ VALUE fname_v = rb_str_encode_ospath(orig_fname);
+ const char *fname = StringValueCStr(fname_v);
+ int script = argp->script;
VALUE f;
- int e;
+ NODE *tree;
+ int xflag = 0;
+ int state;
- if (flen == 1 && fname[0] == '-') {
+ if (strcmp(fname, "-") == 0) {
f = rb_stdin;
}
else {
- int fd;
- /* open(2) may block if fname is point to FIFO and it's empty. Let's
- use O_NONBLOCK. */
-#if defined O_NONBLOCK && HAVE_FCNTL && !(O_NONBLOCK & O_ACCMODE)
- /* TODO: fix conflicting O_NONBLOCK in ruby/win32.h */
-# define MODE_TO_LOAD (O_RDONLY | O_NONBLOCK)
-#elif defined O_NDELAY && HAVE_FCNTL && !(O_NDELAY & O_ACCMODE)
-# define MODE_TO_LOAD (O_RDONLY | O_NDELAY)
-#else
-# define MODE_TO_LOAD (O_RDONLY)
-#endif
- int mode = MODE_TO_LOAD;
+ int fd, mode = O_RDONLY;
#if defined DOSISH || defined __CYGWIN__
-# define isdirsep(x) ((x) == '/' || (x) == '\\')
{
- static const char exeext[] = ".exe";
- enum {extlen = sizeof(exeext)-1};
- if (flen > extlen && !isdirsep(fname[flen-extlen-1]) &&
- STRNCASECMP(fname+flen-extlen, exeext, extlen) == 0) {
+ const char *ext = strrchr(fname, '.');
+ if (ext && STRCASECMP(ext, ".exe") == 0) {
mode |= O_BINARY;
- *xflag = 1;
+ xflag = 1;
}
}
#endif
-
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
- int e = errno;
- if (!rb_gc_for_fd(e)) {
- rb_load_fail(fname_v, strerror(e));
- }
- if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
+ rb_load_fail(fname_v, strerror(errno));
+ }
+ rb_update_max_fd(fd);
+#if !defined DOSISH && !defined __CYGWIN__
+ {
+ struct stat st;
+ if (fstat(fd, &st) != 0)
rb_load_fail(fname_v, strerror(errno));
+ if (S_ISDIR(st.st_mode)) {
+ errno = EISDIR;
+ rb_load_fail(fname_v, strerror(EISDIR));
}
}
- rb_update_max_fd(fd);
-
-#if defined HAVE_FCNTL && MODE_TO_LOAD != O_RDONLY
- /* disabling O_NONBLOCK */
- if (fcntl(fd, F_SETFL, 0) < 0) {
- e = errno;
- (void)close(fd);
- rb_load_fail(fname_v, strerror(e));
- }
#endif
+ f = rb_io_fdopen(fd, mode, fname);
+ }
- e = ruby_is_fd_loadable(fd);
- if (!e) {
- e = errno;
- (void)close(fd);
- rb_load_fail(fname_v, strerror(e));
- }
+ argp->f = f;
+ argp->xflag = xflag;
+ tree = (NODE *)rb_protect(load_file_internal2, (VALUE)argp, &state);
+ if (state) {
+ if (f != rb_stdin)
+ rb_io_close(f);
+ rb_jump_tag(state);
+ }
- f = rb_io_fdopen(fd, mode, fname);
- if (e < 0) {
- /*
- We need to wait if FIFO is empty. It's FIFO's semantics.
- rb_thread_wait_fd() release GVL. So, it's safe.
- */
- rb_thread_wait_fd(fd);
- }
+ if (script && tree && rb_parser_end_seen_p(parser)) {
+ /*
+ * DATA is a File that contains the data section of the executed file.
+ * To create a data section use <tt>__END__</tt>:
+ *
+ * $ cat t.rb
+ * puts DATA.gets
+ * __END__
+ * hello world!
+ *
+ * $ ruby t.rb
+ * hello world!
+ */
+ rb_define_global_const("DATA", f);
+ }
+ else if (f != rb_stdin) {
+ rb_io_close(f);
}
- return f;
+ return (VALUE)tree;
}
static VALUE
-restore_load_file(VALUE arg)
+restore_lineno(VALUE lineno)
{
- struct load_file_arg *argp = (struct load_file_arg *)arg;
- VALUE f = argp->f;
-
- if (!NIL_P(f) && f != rb_stdin) {
- rb_io_close(f);
- }
- return Qnil;
+ return rb_gv_set("$.", lineno);
}
-static rb_ast_t *
-load_file(VALUE parser, VALUE fname, VALUE f, int script, ruby_cmdline_options_t *opt)
+static NODE *
+load_file(VALUE parser, VALUE fname, int script, struct cmdline_options *opt)
{
struct load_file_arg arg;
arg.parser = parser;
arg.fname = fname;
arg.script = script;
arg.opt = opt;
- arg.f = f;
- return (rb_ast_t *)rb_ensure(load_file_internal, (VALUE)&arg,
- restore_load_file, (VALUE)&arg);
+ return (NODE *)rb_ensure(load_file_internal, (VALUE)&arg, restore_lineno, rb_gv_get("$."));
}
void *
@@ -2044,15 +1739,9 @@ rb_load_file(const char *fname)
void *
rb_load_file_str(VALUE fname_v)
{
- return rb_parser_load_file(rb_parser_new(), fname_v);
-}
+ struct cmdline_options opt;
-void *
-rb_parser_load_file(VALUE parser, VALUE fname_v)
-{
- ruby_cmdline_options_t opt;
- VALUE f = open_load_file(fname_v, &cmdline_options_init(&opt)->xflag);
- return load_file(parser, fname_v, f, 0, &opt);
+ return load_file(rb_parser_new(), fname_v, 0, cmdline_options_init(&opt));
}
/*
@@ -2072,8 +1761,6 @@ proc_argv0(VALUE process)
return rb_orig_progname;
}
-static VALUE ruby_setproctitle(VALUE title);
-
/*
* call-seq:
* Process.setproctitle(string) -> string
@@ -2094,14 +1781,10 @@ static VALUE ruby_setproctitle(VALUE title);
static VALUE
proc_setproctitle(VALUE process, VALUE title)
{
- return ruby_setproctitle(title);
-}
+ StringValue(title);
+
+ setproctitle("%.*s", RSTRING_LENINT(title), RSTRING_PTR(title));
-static VALUE
-ruby_setproctitle(VALUE title)
-{
- const char *ptr = StringValueCStr(title);
- setproctitle("%.*s", RSTRING_LENINT(title), ptr);
return title;
}
@@ -2111,20 +1794,7 @@ set_arg0(VALUE val, ID id)
if (origarg.argv == 0)
rb_raise(rb_eRuntimeError, "$0 not initialized");
- rb_progname = rb_str_new_frozen(ruby_setproctitle(val));
-}
-
-static inline VALUE
-external_str_new_cstr(const char *p)
-{
-#if UTF8_PATH
- VALUE str = rb_utf8_str_new_cstr(p);
- str = str_conv_enc(str, NULL, rb_default_external_encoding());
- OBJ_TAINT_RAW(str);
- return str;
-#else
- return rb_external_str_new_cstr(p);
-#endif
+ rb_progname = rb_str_new_frozen(proc_setproctitle(rb_mProcess, val));
}
/*! Sets the current script name to this value.
@@ -2136,7 +1806,7 @@ void
ruby_script(const char *name)
{
if (name) {
- rb_orig_progname = rb_progname = external_str_new_cstr(name);
+ rb_orig_progname = rb_progname = rb_external_str_new(name, strlen(name));
rb_vm_set_progname(rb_progname);
}
}
@@ -2153,7 +1823,7 @@ ruby_set_script_name(VALUE name)
}
static void
-init_ids(ruby_cmdline_options_t *opt)
+init_ids(struct cmdline_options *opt)
{
rb_uid_t uid = getuid();
rb_uid_t euid = geteuid();
@@ -2169,7 +1839,7 @@ init_ids(ruby_cmdline_options_t *opt)
#undef forbid_setid
static void
-forbid_setid(const char *s, const ruby_cmdline_options_t *opt)
+forbid_setid(const char *s, struct cmdline_options *opt)
{
if (opt->setids & 1)
rb_raise(rb_eSecurityError, "no %s allowed while running setuid", s);
@@ -2220,7 +1890,8 @@ ruby_prog_init(void)
rb_define_module_function(rb_mProcess, "setproctitle", proc_setproctitle, 1);
/*
- * ARGV contains the command line arguments used to run ruby.
+ * ARGV contains the command line arguments used to run ruby with the
+ * first value containing the name of the executable.
*
* A library like OptionParser can be used to process command-line
* arguments.
@@ -2235,14 +1906,14 @@ ruby_set_argv(int argc, char **argv)
VALUE av = rb_argv;
#if defined(USE_DLN_A_OUT)
- if (origarg.argc > 0 && origarg.argv)
+ if (origarg.argv)
dln_argv0 = origarg.argv[0];
- else if (argc > 0 && argv)
+ else
dln_argv0 = argv[0];
#endif
rb_ary_clear(av);
for (i = 0; i < argc; i++) {
- VALUE arg = external_str_new_cstr(argv[i]);
+ VALUE arg = rb_external_str_new_cstr(argv[i]);
OBJ_FREEZE(arg);
rb_ary_push(av, arg);
@@ -2252,21 +1923,20 @@ ruby_set_argv(int argc, char **argv)
void *
ruby_process_options(int argc, char **argv)
{
- ruby_cmdline_options_t opt;
+ struct cmdline_options opt;
VALUE iseq;
- const char *script_name = (argc > 0 && argv[0]) ? argv[0] : ruby_engine;
+ const char *script_name = (argc > 0 && argv[0]) ? argv[0] : "ruby";
- if (!origarg.argv || origarg.argc <= 0) {
- origarg.argc = argc;
- origarg.argv = argv;
- }
ruby_script(script_name); /* for the time being */
rb_argv0 = rb_str_new4(rb_progname);
rb_gc_register_mark_object(rb_argv0);
iseq = process_options(argc, argv, cmdline_options_init(&opt));
#ifndef HAVE_SETPROCTITLE
- ruby_init_setproctitle(argc, argv);
+ {
+ extern void ruby_init_setproctitle(int argc, char *argv[]);
+ ruby_init_setproctitle(argc, argv);
+ }
#endif
return (void*)(struct RData*)iseq;
@@ -2302,25 +1972,23 @@ fill_standard_fds(void)
}
}
-/*! Initializes the process for libruby.
+/*! Initializes the process for ruby(1).
*
* This function assumes this process is ruby(1) and it has just started.
- * Usually programs that embed CRuby interpreter may not call this function,
- * and may do their own initialization.
- * argc and argv cannot be NULL.
+ * Usually programs that embeds CRuby interpreter should not call this function,
+ * and should do their own initialization.
*/
void
ruby_sysinit(int *argc, char ***argv)
{
#if defined(_WIN32)
+ void rb_w32_sysinit(int *argc, char ***argv);
rb_w32_sysinit(argc, argv);
#endif
- if (*argc >= 0 && *argv) {
- origarg.argc = *argc;
- origarg.argv = *argv;
+ origarg.argc = *argc;
+ origarg.argv = *argv;
#if defined(USE_DLN_A_OUT)
- dln_argv0 = origarg.argv[0];
+ dln_argv0 = origarg.argv[0];
#endif
- }
fill_standard_fds();
}
diff --git a/ruby_assert.h b/ruby_assert.h
deleted file mode 100644
index 3383e4fc6c..0000000000
--- a/ruby_assert.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef RUBY_ASSERT_H
-#define RUBY_ASSERT_H
-
-#include "ruby/ruby.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-NORETURN(void rb_assert_failure(const char *, int, const char *, const char *));
-#ifdef RUBY_FUNCTION_NAME_STRING
-# define RUBY_ASSERT_FAIL(expr) \
- rb_assert_failure(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, expr)
-#else
-# define RUBY_ASSERT_FAIL(expr) \
- rb_assert_failure(__FILE__, __LINE__, NULL, expr)
-#endif
-#define RUBY_ASSERT_MESG(expr, mesg) \
- ((expr) ? (void)0 : RUBY_ASSERT_FAIL(mesg))
-#ifdef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
-# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \
- __builtin_choose_expr( \
- __builtin_constant_p(cond), \
- __builtin_choose_expr(cond, RUBY_ASSERT_MESG(expr, mesg), (void)0), \
- RUBY_ASSERT_MESG(!(cond) || (expr), mesg))
-#else
-# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \
- RUBY_ASSERT_MESG(!(cond) || (expr), mesg)
-#endif
-#define RUBY_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)
-#define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)
-
-#undef assert
-#define assert RUBY_ASSERT
-
-#ifndef RUBY_NDEBUG
-# ifdef NDEBUG
-# define RUBY_NDEBUG 1
-# else
-# define RUBY_NDEBUG 0
-# endif
-#endif
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-#endif
-
-#endif
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 4bc9f37e0d..789efdc4ea 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -7,17 +7,17 @@ typedef unsigned int rb_atomic_t;
# define ATOMIC_SET(var, val) (void)__atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_INC(var) __atomic_fetch_add(&(var), 1, __ATOMIC_SEQ_CST)
# define ATOMIC_DEC(var) __atomic_fetch_sub(&(var), 1, __ATOMIC_SEQ_CST)
-# define ATOMIC_OR(var, val) __atomic_fetch_or(&(var), (val), __ATOMIC_SEQ_CST)
+# define ATOMIC_OR(var, val) __atomic_or_fetch(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_CAS(var, oldval, newval) \
-({ __typeof__(var) oldvaldup = (oldval); /* oldval should not be modified */ \
+({ __typeof__(oldval) oldvaldup = (oldval); /* oldval should not be modified */ \
__atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
oldvaldup; })
# define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
# define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
-# define RUBY_ATOMIC_GENERIC_MACRO 1
+# define ATOMIC_PTR_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
#elif defined HAVE_GCC_SYNC_BUILTINS
/* @shyouhei hack to support atomic operations in case of gcc. Gcc
@@ -28,14 +28,14 @@ typedef unsigned int rb_atomic_t; /* Anything OK */
# define ATOMIC_SET(var, val) (void)__sync_lock_test_and_set(&(var), (val))
# define ATOMIC_INC(var) __sync_fetch_and_add(&(var), 1)
# define ATOMIC_DEC(var) __sync_fetch_and_sub(&(var), 1)
-# define ATOMIC_OR(var, val) __sync_fetch_and_or(&(var), (val))
+# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
# define ATOMIC_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
# define ATOMIC_CAS(var, oldval, newval) __sync_val_compare_and_swap(&(var), (oldval), (newval))
# define ATOMIC_SIZE_ADD(var, val) __sync_fetch_and_add(&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) __sync_fetch_and_sub(&(var), (val))
-# define RUBY_ATOMIC_GENERIC_MACRO 1
+# define ATOMIC_PTR_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
#elif defined _WIN32
#if defined _MSC_VER && _MSC_VER > 1200
@@ -81,7 +81,7 @@ rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t new
# define ATOMIC_SIZE_INC(var) InterlockedIncrement64(&(var))
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement64(&(var))
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange64(&(var), (val))
-# define ATOMIC_SIZE_CAS(var, oldval, newval) InterlockedCompareExchange64(&(var), (newval), (oldval))
+# define ATOMIC_SIZE_CAS(var, oldval, val) InterlockedCompareExchange64(&(var), (oldval), (val))
# else
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))
@@ -133,9 +133,9 @@ extern rb_atomic_t ruby_atomic_compare_and_swap(rb_atomic_t *ptr,
# define ATOMIC_SIZE_ADD(var, val) (void)((var) += (val))
# define ATOMIC_SIZE_SUB(var, val) (void)((var) -= (val))
-# define ATOMIC_SIZE_EXCHANGE(var, val) ruby_atomic_size_exchange(&(var), (val))
+# define ATOMIC_SIZE_EXCHANGE(var, val) atomic_size_exchange(&(var), (val))
static inline size_t
-ruby_atomic_size_exchange(size_t *ptr, size_t val)
+atomic_size_exchange(size_t *ptr, size_t val)
{
size_t old = *ptr;
*ptr = val;
@@ -156,77 +156,14 @@ ruby_atomic_size_exchange(size_t *ptr, size_t val)
# define ATOMIC_SIZE_CAS(var, oldval, val) ATOMIC_CAS(var, oldval, val)
#endif
-#if RUBY_ATOMIC_GENERIC_MACRO
-# ifndef ATOMIC_PTR_EXCHANGE
-# define ATOMIC_PTR_EXCHANGE(var, val) ATOMIC_EXCHANGE(var, val)
-# endif
-# ifndef ATOMIC_PTR_CAS
-# define ATOMIC_PTR_CAS(var, oldval, newval) ATOMIC_CAS(var, oldval, newval)
-# endif
-
-# ifndef ATOMIC_VALUE_EXCHANGE
-# define ATOMIC_VALUE_EXCHANGE(var, val) ATOMIC_EXCHANGE(var, val)
-# endif
-# ifndef ATOMIC_VALUE_CAS
-# define ATOMIC_VALUE_CAS(var, oldval, val) ATOMIC_CAS(var, oldval, val)
-# endif
-#endif
-
#ifndef ATOMIC_PTR_EXCHANGE
# if SIZEOF_VOIDP == SIZEOF_SIZE_T
# define ATOMIC_PTR_EXCHANGE(var, val) (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val))
-# else
-# define ATOMIC_PTR_EXCHANGE(var, val) ruby_atomic_ptr_exchange((const void **)&(var), (val))
-static inline void *
-ruby_atomic_ptr_exchange(const void **ptr, const void *val)
-{
- const void *const old = *ptr;
- *ptr = val;
- return (void *)old;
-}
# endif
#endif
#ifndef ATOMIC_PTR_CAS
# if SIZEOF_VOIDP == SIZEOF_SIZE_T
# define ATOMIC_PTR_CAS(var, oldval, val) (void *)ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val))
-# else
-# define ATOMIC_PTR_CAS(var, oldval, val) ruby_atomic_ptr_cas(&(var), (oldval), (val))
-static inline void *
-ruby_atomic_ptr_cas(const void **ptr, const void *oldval, const void *val)
-{
- const void *const old = *ptr;
- if (old == oldval) *ptr = val;
- return (void *)old;
-}
-# endif
-#endif
-
-#ifndef ATOMIC_VALUE_EXCHANGE
-# if SIZEOF_VALUE == SIZEOF_SIZE_T
-# define ATOMIC_VALUE_EXCHANGE(var, val) ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val))
-# else
-# define ATOMIC_VALUE_EXCHANGE(var, val) ruby_atomic_value_exchange(&(var), (val))
-static inline VALUE
-ruby_atomic_value_exchange(VALUE *ptr, VALUE val)
-{
- const VALUE old = *ptr;
- *ptr = val;
- return old;
-}
-# endif
-#endif
-#ifndef ATOMIC_VALUE_CAS
-# if SIZEOF_VALUE == SIZEOF_SIZE_T
-# define ATOMIC_VALUE_CAS(var, oldval, val) ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val))
-# else
-# define ATOMIC_VALUE_CAS(var, oldval, val) ruby_atomic_value_cas(&(var), (oldval), (val))
-static inline VALUE
-ruby_atomic_value_cas(VALUE *ptr, VALUE oldval, VALUE val)
-{
- const VALUE old = *ptr;
- if (old == oldval) *ptr = val;
- return old;
-}
# endif
#endif
diff --git a/rubystub.c b/rubystub.c
deleted file mode 100644
index 1b10cdd4c4..0000000000
--- a/rubystub.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "internal.h"
-#if defined HAVE_DLADDR
-#include <dlfcn.h>
-#endif
-#if defined HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-static void* stub_options(int argc, char **argv);
-#define ruby_options stub_options
-#include <main.c>
-#undef ruby_options
-
-void *
-stub_options(int argc, char **argv)
-{
- char xflag[] = "-x";
- char *xargv[4] = {NULL, xflag};
- char *cmd = argv[0];
- void *ret;
-
-#if defined __CYGWIN__ || defined _WIN32
- /* GetCommandLineW should contain the accessible path,
- * use argv[0] as is */
-#elif defined __linux__
- {
- char selfexe[MAXPATHLEN];
- ssize_t len = readlink("/proc/self/exe", selfexe, sizeof(selfexe));
- if (len < 0) {
- perror("readlink(\"/proc/self/exe\")");
- return NULL;
- }
- selfexe[len] = '\0';
- cmd = selfexe;
- }
-#elif defined HAVE_DLADDR
- {
- Dl_info dli;
- if (!dladdr(stub_options, &dli)) {
- perror("dladdr");
- return NULL;
- }
- cmd = (char *)dli.dli_fname;
- }
-#endif
-
-#ifndef HAVE_SETPROCTITLE
- /* argc and argv must be the original */
- ruby_init_setproctitle(argc, argv);
-#endif
-
- /* set script with -x option */
- /* xargv[0] is NULL not to re-initialize setproctitle again */
- xargv[2] = cmd;
- ret = ruby_options(3, xargv);
-
- /* set all arguments to ARGV */
- ruby_set_argv(argc - 1, argv + 1);
-
- return ret;
-}
diff --git a/safe.c b/safe.c
index 3575ecca15..7f3a412686 100644
--- a/safe.c
+++ b/safe.c
@@ -12,6 +12,8 @@
/* safe-level:
0 - strings from streams/environment/ARGV are tainted (default)
1 - no dangerous operation by tainted value
+ 2 - process/file operations prohibited
+ 3 - all generated objects are tainted
*/
#define SAFE_LEVEL_MAX RUBY_SAFE_LEVEL_MAX
@@ -23,39 +25,36 @@
#undef rb_secure
#undef rb_set_safe_level
-#undef ruby_safe_level_2_warning
+#undef ruby_safe_level_4_warning
int
-ruby_safe_level_2_warning(void)
+ruby_safe_level_4_warning(void)
{
- return 2;
+ return 4;
}
int
rb_safe_level(void)
{
- return GET_EC()->safe_level;
+ return GET_THREAD()->safe_level;
}
void
rb_set_safe_level_force(int safe)
{
- GET_EC()->safe_level = safe;
+ GET_THREAD()->safe_level = safe;
}
void
rb_set_safe_level(int level)
{
- rb_execution_context_t *ec = GET_EC();
+ rb_thread_t *th = GET_THREAD();
- if (level > ec->safe_level) {
+ if (level > th->safe_level) {
if (level > SAFE_LEVEL_MAX) {
- rb_raise(rb_eArgError, "$SAFE=2 to 4 are obsolete");
+ rb_raise(rb_eArgError, "$SAFE=4 is obsolete");
}
- /* block parameters */
- rb_vm_stack_to_heap(ec);
-
- ec->safe_level = level;
+ th->safe_level = level;
}
}
@@ -68,26 +67,21 @@ safe_getter(void)
static void
safe_setter(VALUE val)
{
- rb_execution_context_t *ec = GET_EC();
- int current_level = ec->safe_level;
int level = NUM2INT(val);
+ rb_thread_t *th = GET_THREAD();
- if (level == current_level) {
- return;
- }
- else if (level < current_level) {
+ if (level < th->safe_level) {
rb_raise(rb_eSecurityError,
"tried to downgrade safe level from %d to %d",
- current_level, level);
+ th->safe_level, level);
}
- else if (level > SAFE_LEVEL_MAX) {
- rb_raise(rb_eArgError, "$SAFE=2 to 4 are obsolete");
+ if (level == 3) {
+ rb_warning("$SAFE=3 does no sandboxing");
}
-
- /* block parameters */
- rb_vm_stack_to_heap(ec);
-
- ec->safe_level = level;
+ if (level > SAFE_LEVEL_MAX) {
+ rb_raise(rb_eArgError, "$SAFE=4 is obsolete");
+ }
+ th->safe_level = level;
}
void
@@ -96,8 +90,8 @@ rb_secure(int level)
if (level <= rb_safe_level()) {
ID caller_name = rb_frame_callee();
if (caller_name) {
- rb_raise(rb_eSecurityError, "Insecure operation `%"PRIsVALUE"' at level %d",
- rb_id2str(caller_name), rb_safe_level());
+ rb_raise(rb_eSecurityError, "Insecure operation `%s' at level %d",
+ rb_id2name(caller_name), rb_safe_level());
}
else {
rb_raise(rb_eSecurityError, "Insecure operation at level %d",
@@ -116,8 +110,8 @@ rb_insecure_operation(void)
{
ID caller_name = rb_frame_callee();
if (caller_name) {
- rb_raise(rb_eSecurityError, "Insecure operation - %"PRIsVALUE,
- rb_id2str(caller_name));
+ rb_raise(rb_eSecurityError, "Insecure operation - %s",
+ rb_id2name(caller_name));
}
else {
rb_raise(rb_eSecurityError, "Insecure operation: -r");
diff --git a/sample/cbreak.rb b/sample/cbreak.rb
index 7f1385cce3..76b534a76a 100644
--- a/sample/cbreak.rb
+++ b/sample/cbreak.rb
@@ -5,15 +5,15 @@ ECHO = 0x00000008
TIOCGETP = 0x40067408
TIOCSETP = 0x80067409
-def cbreak
+def cbreak ()
set_cbreak(true)
end
-def cooked
+def cooked ()
set_cbreak(false)
end
-def set_cbreak(on)
+def set_cbreak (on)
tty = "\0" * 256
STDIN.ioctl(TIOCGETP, tty)
ttys = tty.unpack("C4 S")
@@ -30,7 +30,7 @@ end
cbreak();
print("this is no-echo line: ");
-readline().display
+readline().print
cooked();
print("this is echo line: ");
readline()
diff --git a/sample/delegate.rb b/sample/delegate.rb
index dc7ea2a0af..918dc08877 100644
--- a/sample/delegate.rb
+++ b/sample/delegate.rb
@@ -1,6 +1,6 @@
require 'delegate'
-class ExtArray < DelegateClass(Array)
+class ExtArray<DelegateClass(Array)
def initialize()
super([])
end
diff --git a/sample/dir.rb b/sample/dir.rb
index 44733c2cf4..b627383946 100644
--- a/sample/dir.rb
+++ b/sample/dir.rb
@@ -3,7 +3,7 @@
dirp = Dir.open(".")
for f in dirp
case f
- when /\A\./, /~\z/, /\.o/
+ when /^\./, /~$/, /\.o/
# do not print
else
print f, "\n"
diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb
index 58af3cf005..c07f748e99 100644
--- a/sample/drb/dchats.rb
+++ b/sample/drb/dchats.rb
@@ -2,6 +2,7 @@
distributed Ruby --- chat server
Copyright (c) 1999-2000 Masatoshi SEKI
=end
+require 'thread'
require 'drb/drb'
class ChatEntry
diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb
index 13ff38940e..651b9c6c8a 100644
--- a/sample/drb/dhasen.rb
+++ b/sample/drb/dhasen.rb
@@ -17,12 +17,13 @@
require 'drb/drb'
require 'chasen'
+require 'thread'
class Dhasen
include DRbUndumped
def initialize
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
end
def sparse(str, *arg)
diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb
index a87e660346..42f302e64e 100644
--- a/sample/drb/dlogd.rb
+++ b/sample/drb/dlogd.rb
@@ -4,12 +4,13 @@
=end
require 'drb/drb'
+require 'thread'
class Logger
def initialize(fname)
@fname = fname.to_s
@fp = File.open(@fname, "a+")
- @queue = Thread::Queue.new
+ @queue = Queue.new
@th = Thread.new { self.flush }
end
diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb
index a9afa8c858..1c8878c080 100644
--- a/sample/drb/dqueue.rb
+++ b/sample/drb/dqueue.rb
@@ -3,9 +3,10 @@
Copyright (c) 1999-2000 Masatoshi SEKI
=end
+require 'thread'
require 'drb/drb'
-DRb.start_service(nil, Thread::Queue.new)
+DRb.start_service(nil, Queue.new)
puts DRb.uri
DRb.thread.join
diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb
index 1a58811fed..9503a1790c 100644
--- a/sample/drb/http0serv.rb
+++ b/sample/drb/http0serv.rb
@@ -1,6 +1,7 @@
require 'webrick'
require 'drb/drb'
require 'drb/http0'
+require 'thread'
module DRb
module HTTP0
@@ -17,7 +18,7 @@ module DRb
def initialize(config, drb)
@config = config
@drb = drb
- @queue = Thread::Queue.new
+ @queue = Queue.new
end
def do_POST(req, res)
@@ -45,7 +46,7 @@ module DRb
def initialize(uri, config)
@uri = uri
@config = config
- @queue = Thread::Queue.new
+ @queue = Queue.new
setup_webrick(uri)
end
attr_reader :uri
diff --git a/sample/drb/name.rb b/sample/drb/name.rb
index a8ad28749d..9527d47764 100644
--- a/sample/drb/name.rb
+++ b/sample/drb/name.rb
@@ -35,6 +35,7 @@ How to play.
| 2
=end
+require 'thread.rb'
require 'drb/drb'
module DRbNamedObject
@@ -74,7 +75,7 @@ class Seq
def initialize(v, name)
@counter = v
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
self.drb_name = name
end
@@ -89,7 +90,7 @@ end
class Front
def initialize
seq = Seq.new(0, 'seq')
- mutex = Thread::Mutex.new
+ mutex = Mutex.new
mutex.extend(DRbUndumped)
mutex.extend(DRbNamedObject)
mutex.drb_name = 'mutex'
diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb
index 8be1542c06..9c10a34527 100644
--- a/sample/drb/old_tuplespace.rb
+++ b/sample/drb/old_tuplespace.rb
@@ -3,6 +3,8 @@
# Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
+require 'thread'
+
class TupleSpace
class Template
def initialize(list)
diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb
index c54628b54c..3b743cab8e 100644
--- a/sample/drb/ring_echo.rb
+++ b/sample/drb/ring_echo.rb
@@ -1,6 +1,7 @@
require 'drb/drb'
require 'drb/eq'
require 'rinda/ring'
+require 'thread'
class RingEcho
include DRbUndumped
diff --git a/sample/drb/simpletuple.rb b/sample/drb/simpletuple.rb
index 4bb4b1cff9..bfbd86e665 100644
--- a/sample/drb/simpletuple.rb
+++ b/sample/drb/simpletuple.rb
@@ -3,6 +3,8 @@
# Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
+require 'thread'
+
class SimpleTupleSpace
def initialize
@hash = {}
diff --git a/sample/dualstack-httpd.rb b/sample/dualstack-httpd.rb
index ab02e17aea..a6d4d3a2c2 100644
--- a/sample/dualstack-httpd.rb
+++ b/sample/dualstack-httpd.rb
@@ -3,6 +3,7 @@
# The code demonstrates how a multi-protocol daemon should be written.
require "socket"
+require "thread"
port = 8888
res = Socket.getaddrinfo(nil, port, nil, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE)
diff --git a/sample/export.rb b/sample/export.rb
index 2ab2e93f2e..949e5b10bf 100644
--- a/sample/export.rb
+++ b/sample/export.rb
@@ -30,7 +30,7 @@ f.printf "%s\n", Foo
f.quux
-class Bar < Foo
+class Bar<Foo
def quux
super
baz()
diff --git a/sample/exyacc.rb b/sample/exyacc.rb
index 9a9435a0dc..7b37a8b236 100644
--- a/sample/exyacc.rb
+++ b/sample/exyacc.rb
@@ -1,6 +1,6 @@
#! /usr/local/bin/ruby -Kn
# usage: exyacc.rb [yaccfiles]
-# this is covered from exyacc.pl in the camel book
+# this is coverted from exyacc.pl in the camel book
ARGF.each(nil) do |source|
sbeg = source.index("\n%%") + 1
diff --git a/sample/iseq_loader.rb b/sample/iseq_loader.rb
deleted file mode 100644
index bb2d92ea77..0000000000
--- a/sample/iseq_loader.rb
+++ /dev/null
@@ -1,243 +0,0 @@
-#
-# iseq_loader.rb - sample of compiler/loader for binary compiled file
-#
-# Usage as a compiler: ruby iseq_loader.rb [file or directory] ...
-#
-# It compiles and stores specified files.
-# If directories are specified, then compiles and stores all *.rb files.
-# (using Dir.glob)
-#
-# TODO: add remove option
-# TODO: add verify option
-#
-# Usage as a loader: simply require this file with the following setting.
-#
-# Setting with environment variables.
-#
-# * RUBY_ISEQ_LOADER_STORAGE to select storage type
-# * dbm: use dbm
-# * fs: [default] use file system. locate a compiled binary files in same
-# directory of scripts like Rubinius. foo.rb.yarb will be created for foo.rb.
-# * fs2: use file system. locate compiled file in specified directory.
-# * nothing: do nothing.
-#
-# * RUBY_ISEQ_LOADER_STORAGE_DIR to select directory
-# * default: ~/.ruby_binaries/
-#
-# * RUBY_ISEQ_LOADER_STORAGE_COMPILE_IF_NOT_COMPILED
-# * true: store compiled file if compiled data is not available.
-# * false: [default] do nothing if there is no compiled iseq data.
-
-class RubyVM::InstructionSequence
- $ISEQ_LOADER_LOADED = 0
- $ISEQ_LOADER_COMPILED = 0
- $ISEQ_LOADER_IGNORED = 0
- LAUNCHED_TIME = Time.now
- COMPILE_FILE_ENABLE = false || true
- COMPILE_VERBOSE = $VERBOSE || false # || true
- COMPILE_DEBUG = ENV['RUBY_ISEQ_LOADER_DEBUG']
- COMPILE_IF_NOT_COMPILED = ENV['RUBY_ISEQ_LOADER_STORAGE_COMPILE_IF_NOT_COMPILED'] == 'true'
-
- at_exit{
- STDERR.puts "[ISEQ_LOADER] #{Process.pid} time: #{Time.now - LAUNCHED_TIME}, " +
- "loaded: #{$ISEQ_LOADER_LOADED}, " +
- "compied: #{$ISEQ_LOADER_COMPILED}, " +
- "ignored: #{$ISEQ_LOADER_IGNORED}"
- } if COMPILE_VERBOSE
-
- unless cf_dir = ENV['RUBY_ISEQ_LOADER_STORAGE_DIR']
- cf_dir = File.expand_path("~/.ruby_binaries")
- unless File.exist?(cf_dir)
- Dir.mkdir(cf_dir)
- end
- end
- CF_PREFIX = "#{cf_dir}/cb."
-
- class NullStorage
- def load_iseq fname; end
- def compile_and_save_isq fname; end
- def unlink_compiled_iseq; end
- end
-
- class BasicStorage
- def initialize
- require 'digest/sha1'
- end
-
- def load_iseq fname
- iseq_key = iseq_key_name(fname)
- if compiled_iseq_exist?(fname, iseq_key) && compiled_iseq_is_younger?(fname, iseq_key)
- $ISEQ_LOADER_LOADED += 1
- STDERR.puts "[ISEQ_LOADER] #{Process.pid} load #{fname} from #{iseq_key}" if COMPILE_DEBUG
- binary = read_compiled_iseq(fname, iseq_key)
- iseq = RubyVM::InstructionSequence.load_from_binary(binary)
- # p [extra_data(iseq.path), RubyVM::InstructionSequence.load_from_binary_extra_data(binary)]
- # raise unless extra_data(iseq.path) == RubyVM::InstructionSequence.load_from_binary_extra_data(binary)
- iseq
- elsif COMPILE_IF_NOT_COMPILED
- compile_and_save_iseq(fname, iseq_key)
- else
- $ISEQ_LOADER_IGNORED += 1
- # p fname
- nil
- end
- end
-
- def extra_data fname
- "SHA-1:#{::Digest::SHA1.file(fname).digest}"
- end
-
- def compile_and_save_iseq fname, iseq_key = iseq_key_name(fname)
- $ISEQ_LOADER_COMPILED += 1
- STDERR.puts "[RUBY_COMPILED_FILE] compile #{fname}" if COMPILE_DEBUG
- iseq = RubyVM::InstructionSequence.compile_file(fname)
-
- binary = iseq.to_binary(extra_data(fname))
- write_compiled_iseq(fname, iseq_key, binary)
- iseq
- end
-
- # def unlink_compiled_iseq; nil; end # should implement at sub classes
-
- private
-
- def iseq_key_name fname
- fname
- end
-
- # should implement at sub classes
- # def compiled_iseq_younger? fname, iseq_key; end
- # def compiled_iseq_exist? fname, iseq_key; end
- # def read_compiled_file fname, iseq_key; end
- # def write_compiled_file fname, iseq_key, binary; end
- end
-
- class FSStorage < BasicStorage
- def initialize
- super
- require 'fileutils'
- @dir = CF_PREFIX + "files"
- unless File.directory?(@dir)
- FileUtils.mkdir_p(@dir)
- end
- end
-
- def unlink_compiled_iseq
- File.unlink(compile_file_path)
- end
-
- private
-
- def iseq_key_name fname
- "#{fname}.yarb" # same directory
- end
-
- def compiled_iseq_exist? fname, iseq_key
- File.exist?(iseq_key)
- end
-
- def compiled_iseq_is_younger? fname, iseq_key
- File.mtime(iseq_key) >= File.mtime(fname)
- end
-
- def read_compiled_iseq fname, iseq_key
- open(iseq_key, 'rb'){|f| f.read}
- end
-
- def write_compiled_iseq fname, iseq_key, binary
- open(iseq_key, 'wb'){|f| f.write(binary)}
- end
- end
-
- class FS2Storage < FSStorage
- def iseq_key_name fname
- @dir + fname.gsub(/[^A-Za-z0-9\._-]/){|c| '%02x' % c.ord} # special directory
- end
- end
-
- class DBMStorage < BasicStorage
- def initialize
- require 'dbm'
- @db = DBM.open(CF_PREFIX+'db')
- end
-
- def unlink_compiled_iseq
- @db.delete fname
- end
-
- private
-
- def date_key_name fname
- "date.#{fname}"
- end
-
- def iseq_key_name fname
- "body.#{fname}"
- end
-
- def compiled_iseq_exist? fname, iseq_key
- @db.has_key? iseq_key
- end
-
- def compiled_iseq_is_younger? fname, iseq_key
- date_key = date_key_name(fname)
- if @db.has_key? date_key
- @db[date_key].to_i >= File.mtime(fname).to_i
- end
- end
-
- def read_compiled_iseq fname, iseq_key
- @db[iseq_key]
- end
-
- def write_compiled_iseq fname, iseq_key, binary
- date_key = date_key_name(fname)
- @db[iseq_key] = binary
- @db[date_key] = Time.now.to_i
- end
- end
-
- STORAGE = case ENV['RUBY_ISEQ_LOADER_STORAGE']
- when 'dbm'
- DBMStorage.new
- when 'fs'
- FSStorage.new
- when 'fs2'
- FS2Storage.new
- when 'null'
- NullStorage.new
- else
- FSStorage.new
- end
-
- STDERR.puts "[ISEQ_LOADER] use #{STORAGE.class} " if COMPILE_VERBOSE
-
- def self.load_iseq fname
- STORAGE.load_iseq(fname)
- end
-
- def self.compile_and_save_iseq fname
- STORAGE.compile_and_save_iseq fname
- end
-
- def self.unlink_compiled_iseq fname
- STORAGE.unlink_compiled_iseq fname
- end
-end
-
-if __FILE__ == $0
- ARGV.each{|path|
- if File.directory?(path)
- pattern = File.join(path, '**/*.rb')
- Dir.glob(pattern){|file|
- begin
- RubyVM::InstructionSequence.compile_and_save_iseq(file)
- rescue SyntaxError => e
- STDERR.puts e
- end
- }
- else
- RubyVM::InstructionSequence.compile_and_save_iseq(path)
- end
- }
-end
diff --git a/sample/list.rb b/sample/list.rb
index b4d1d653e4..85899ce7ff 100644
--- a/sample/list.rb
+++ b/sample/list.rb
@@ -76,6 +76,6 @@ $list2.add_to_list(20)
$list2.add_to_list(Point.new(4, 5))
$list2.add_to_list($list1)
-# parenthesises around method arguments can be omitted unless ambiguous.
+# parenthesises around method arguments can be ommitted unless ambiguous.
print "list1:\n", $list1, "\n"
print "list2:\n", $list2, "\n"
diff --git a/sample/observ.rb b/sample/observ.rb
index a7ea45271d..061e3c6a10 100644
--- a/sample/observ.rb
+++ b/sample/observ.rb
@@ -1,5 +1,6 @@
#! /usr/local/bin/ruby
+require "thread"
require "observer"
class Tick
diff --git a/sample/openssl/cipher.rb b/sample/openssl/cipher.rb
index a33dc3e95c..58b10d6046 100644
--- a/sample/openssl/cipher.rb
+++ b/sample/openssl/cipher.rb
@@ -10,7 +10,7 @@ def crypt_by_password(alg, pass, salt, text)
puts
puts "--Encrypting--"
- enc = OpenSSL::Cipher.new(alg)
+ enc = OpenSSL::Cipher::Cipher.new(alg)
enc.encrypt
enc.pkcs5_keyivgen(pass, salt)
cipher = enc.update(text)
@@ -19,7 +19,7 @@ def crypt_by_password(alg, pass, salt, text)
puts
puts "--Decrypting--"
- dec = OpenSSL::Cipher.new(alg)
+ dec = OpenSSL::Cipher::Cipher.new(alg)
dec.decrypt
dec.pkcs5_keyivgen(pass, salt)
plain = dec.update(cipher)
diff --git a/sample/philos.rb b/sample/philos.rb
index c38aa4a1cc..5c8f43c819 100644
--- a/sample/philos.rb
+++ b/sample/philos.rb
@@ -1,13 +1,14 @@
#
# The Dining Philosophers - thread example
#
+require "thread"
srand
#srand
N=9 # number of philosophers
$forks = []
for i in 0..N-1
- $forks[i] = Thread::Mutex.new
+ $forks[i] = Mutex.new
end
$state = "-o"*N
diff --git a/sample/pty/expect_sample.rb b/sample/pty/expect_sample.rb
index 199d98b79c..2f87f21895 100644
--- a/sample/pty/expect_sample.rb
+++ b/sample/pty/expect_sample.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# sample program of expect.rb
#
@@ -24,17 +23,8 @@ PTY.spawn("ftp ftp.ruby-lang.org") do |r_f,w_f,pid|
username = 'guest'
end
- r_f.expect(/^Name.*: /) do
- w_f.puts("ftp")
- end
- r_f.expect(/word:/) do
- w_f.puts("#{username}@")
- end
- r_f.expect(/> /) do
- w_f.puts("cd pub/ruby")
- end
- r_f.expect("> ") do
- w_f.print "pass\n"
+ r_f.expect(/^(Name).*: |(word):|> /) do
+ w_f.puts($1 ? "ftp" : $2 ? "#{username}@" : "cd pub/ruby")
end
r_f.expect("> ") do
w_f.print "dir\n"
diff --git a/sample/pty/script.rb b/sample/pty/script.rb
index c6659a4807..903a6f75bd 100644
--- a/sample/pty/script.rb
+++ b/sample/pty/script.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'pty'
if ARGV.size == 0 then
@@ -35,3 +34,4 @@ PTY.spawn("/bin/csh") do |r_pty,w_pty,pid|
end
system "stty echo -raw lnext ^v"
+
diff --git a/sample/pty/shl.rb b/sample/pty/shl.rb
index 980748e8f5..cdaf8d7398 100644
--- a/sample/pty/shl.rb
+++ b/sample/pty/shl.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# old-fashioned 'shl' like program
# by A. Ito
@@ -11,40 +10,39 @@
# q quit
require 'pty'
-require 'io/console'
$shells = []
+$n_shells = 0
$r_pty = nil
$w_pty = nil
def writer
- STDIN.raw!
+ system "stty -echo raw"
begin
while true
c = STDIN.getc
- if c == ?\C-z then
- $reader.raise('Suspend')
+ if c == 26 then # C-z
+ $reader.raise(nil)
return 'Suspend'
end
$w_pty.print c.chr
$w_pty.flush
end
rescue
- $reader.raise('Exit')
+ $reader.raise(nil)
return 'Exit'
ensure
- STDIN.cooked!
+ system "stty echo -raw"
end
end
$reader = Thread.new {
while true
begin
- Thread.stop unless $r_pty
+ next if $r_pty.nil?
c = $r_pty.getc
if c.nil? then
- Thread.main.raise('Exit')
Thread.stop
end
print c.chr
@@ -61,14 +59,19 @@ $reader = Thread.new {
while true
print ">> "
STDOUT.flush
- n = nil
case gets
when /^c/i
- $shells << PTY.spawn("/bin/csh")
- n = -1
+ $shells[$n_shells] = PTY.spawn("/bin/csh")
+ $r_pty,$w_pty = $shells[$n_shells]
+ $n_shells += 1
+ $reader.run
+ if writer == 'Exit'
+ $n_shells -= 1
+ $shells[$n_shells] = nil
+ end
when /^p/i
- $shells.each_with_index do |s, i|
- if s
+ for i in 0..$n_shells
+ unless $shells[i].nil?
print i,"\n"
end
end
@@ -76,18 +79,14 @@ while true
n = $1.to_i
if $shells[n].nil?
print "\##{i} doesn't exist\n"
- n = nil
+ else
+ $r_pty,$w_pty = $shells[n]
+ $reader.run
+ if writer == 'Exit' then
+ $shells[n] = nil
+ end
end
when /^q/i
exit
end
- if n
- $r_pty, $w_pty, pid = $shells[n]
- $reader.run
- if writer == 'Exit' then
- Process.wait(pid)
- $shells[n] = nil
- $shells.pop until $shells.empty? or $shells[-1]
- end
- end
end
diff --git a/sample/simple-bench.rb b/sample/simple-bench.rb
deleted file mode 100644
index 607fdbf6e9..0000000000
--- a/sample/simple-bench.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-require 'benchmark'
-
-def foo0
-end
-def foo3 a, b, c
-end
-def foo6 a, b, c, d, e, f
-end
-
-def iter0
- yield
-end
-
-def iter1
- yield 1
-end
-
-def iter3
- yield 1, 2, 3
-end
-
-def iter6
- yield 1, 2, 3, 4, 5, 6
-end
-
-(1..6).each{|i|
- kws = (1..i).map{|e| "k#{e}: #{e}"}
- eval %Q{
- def foo_kw#{i}(#{kws.join(', ')})
- end
- }
-
- kws = (1..i).map{|e| "k#{e}:"}
- eval %Q{
- def foo_required_kw#{i}(#{kws.join(', ')})
- end
- }
-}
-
-(1..6).each{|i|
- kws = (1..i).map{|e| "k#{e}: #{e} + 1"}
- eval %Q{
- def foo_complex_kw#{i}(#{kws.join(', ')})
- end
- }
-}
-
-(1..6).each{|i|
- kws = (1..i).map{|e| "k#{e}: #{e}"}
- eval %Q{
- def iter_kw#{i}
- yield #{kws.join(', ')}
- end
- }
-}
-
-ary1 = [1]
-ary2 = [[1, 2, 3, 4, 5]]
-
-test_methods = %Q{
- # empty 1
- # empty 2
- foo0
- foo3 1, 2, 3
- foo6 1, 2, 3, 4, 5, 6
- foo_kw1
- foo_kw2
- foo_kw3
- foo_kw4
- foo_kw5
- foo_kw6
- foo_kw6 k1: 1
- foo_kw6 k1: 1, k2: 2
- foo_kw6 k1: 1, k2: 2, k3: 3
- foo_kw6 k1: 1, k2: 2, k3: 3, k4: 4
- foo_kw6 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5
- foo_kw6 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5, k6: 6
- foo_required_kw1 k1: 1
- foo_required_kw2 k1: 1, k2: 2
- foo_required_kw3 k1: 1, k2: 2, k3: 3
- foo_required_kw4 k1: 1, k2: 2, k3: 3, k4: 4
- foo_required_kw5 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5
- foo_required_kw6 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5, k6: 6
- foo_complex_kw1
- foo_complex_kw2
- foo_complex_kw3
- foo_complex_kw4
- foo_complex_kw5
- foo_complex_kw6
- foo_complex_kw6 k1: 1
- foo_complex_kw6 k1: 1, k2: 2
- foo_complex_kw6 k1: 1, k2: 2, k3: 3
- foo_complex_kw6 k1: 1, k2: 2, k3: 3, k4: 4
- foo_complex_kw6 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5
- foo_complex_kw6 k1: 1, k2: 2, k3: 3, k4: 4, k5: 5, k6: 6
- iter0{}
- iter1{}
- iter1{|a|}
- iter3{}
- iter3{|a|}
- iter3{|a, b, c|}
- iter6{}
- iter6{|a|}
- iter6{|a, b, c, d, e, f, g|}
- iter0{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw1{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw2{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw3{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw4{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw5{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- iter_kw6{|k1: nil, k2: nil, k3: nil, k4: nil, k5: nil, k6: nil|}
- ary1.each{|e|}
- ary1.each{|e,|}
- ary1.each{|a, b, c, d, e|}
- ary2.each{|e|}
- ary2.each{|e,|}
- ary2.each{|a, b, c, d, e|}
-}
-
-N = 10_000_000
-
-max_line = test_methods.each_line.max_by{|line| line.strip.size}
-max_size = max_line.strip.size
-
-Benchmark.bm(max_size){|x|
-
- str = test_methods.each_line.map{|line| line.strip!
- next if line.empty?
- %Q{
- x.report(#{line.dump}){
- i = 0
- while i<#{N}
- #{line}
- i+=1
- end
- }
- }
- }.join("\n")
- eval str
-}
diff --git a/sample/test.rb b/sample/test.rb
index 65dd9abd10..4bef6bc392 100755
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1,2 +1,2363 @@
-# backward compatibility for chkbuild
-require_relative '../basictest/test'
+#! /usr/bin/env ruby
+# -*- coding: us-ascii -*-
+
+$testnum=0
+$ntest=0
+$failed = 0
+class Progress
+ def initialize
+ @color = nil
+ @tty = nil
+ @quiet = nil
+ @verbose = nil
+ ARGV.each do |arg|
+ case arg
+ when /\A--color(?:=(?:always|(auto)|(never)|(.*)))?\z/
+ warn "unknown --color argument: #$3" if $3
+ @color = $1 ? nil : !$2
+ when /\A--tty(=(?:yes|(no)|(.*)))?\z/
+ warn "unknown --tty argument: #$3" if $3
+ @tty = !$1 || !$2
+ true
+ when /\A-(q|-quiet)\z/
+ @quiet = true
+ when /\A-(v|-verbose)\z/
+ @verbose = true
+ end
+ end
+ @tty = STDERR.tty? && !STDOUT.tty? && /dumb/ !~ ENV["TERM"] if @tty.nil?
+ @eol = @tty && !@verbose ? "\r\e[K\r" : "\n"
+ case @color
+ when nil
+ @color = @tty
+ end
+ if @color
+ # dircolors-like style
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ @passed = "\e[#{colors["pass"] || "32"}m"
+ @failed = "\e[#{colors["fail"] || "31"}m"
+ @reset = "\e[m"
+ else
+ @passed = @failed = @reset = ""
+ end
+ extend(Rotator) if @tty
+ end
+
+ def passed_string
+ "."
+ end
+ def failed_string
+ "#{@failed}F#{@reset}"
+ end
+ def init_string
+ end
+ def finish_string
+ if @quiet
+ @eol
+ else
+ "#{@passed}#{@ok ? 'OK' : ''} #{$testnum}#{@reset}#{@eol}"
+ end
+ end
+ def pass
+ STDERR.print passed_string
+ end
+ def fail
+ @ok = false
+ STDERR.print failed_string
+ end
+ def init
+ @ok = true
+ STDERR.print init_string
+ end
+ def finish
+ STDERR.print finish_string
+ end
+
+ module Rotator
+ ROTATOR = %w[- \\ | /]
+ BS = "\b" * ROTATOR[0].size
+ def passed_string
+ "#{BS}#{ROTATOR[(@count += 1) % ROTATOR.size]}"
+ end
+ def failed_string
+ "#{BS}#{super}#{ROTATOR[@count % ROTATOR.size]}"
+ end
+ def init_string
+ @count = 0
+ " "
+ end
+ def finish_string
+ s = "#{BS}#{' ' * BS.size}#{BS}#{super}"
+ s.gsub!(/\n/, "\r\e[2K\r") if @quiet
+ s
+ end
+ end
+end
+PROGRESS = Progress.new
+
+def test_check(what)
+ unless $ntest.zero?
+ PROGRESS.finish
+ end
+ STDERR.print "sample/test.rb:#{what} "
+ PROGRESS.init
+ $what = what
+ $testnum = 0
+end
+
+def test_ok(cond,n=1)
+ $testnum+=1
+ $ntest+=1
+ where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}"
+ if cond
+ PROGRESS.pass
+ printf "ok %d (%s)\n", $testnum, where
+ else
+ PROGRESS.fail
+ printf "not ok %s %d -- %s\n", $what, $testnum, where
+ $failed+=1
+ end
+ STDOUT.flush
+ STDERR.flush
+end
+
+# make sure conditional operators work
+
+test_check "assignment"
+
+a=[]; a[0] ||= "bar";
+test_ok(a[0] == "bar")
+h={}; h["foo"] ||= "bar";
+test_ok(h["foo"] == "bar")
+
+aa = 5
+aa ||= 25
+test_ok(aa == 5)
+bb ||= 25
+test_ok(bb == 25)
+cc &&=33
+test_ok(cc == nil)
+cc = 5
+cc &&=44
+test_ok(cc == 44)
+
+a = nil; test_ok(a == nil)
+a = 1; test_ok(a == 1)
+a = []; test_ok(a == [])
+a = [1]; test_ok(a == [1])
+a = [nil]; test_ok(a == [nil])
+a = [[]]; test_ok(a == [[]])
+a = [1,2]; test_ok(a == [1,2])
+a = [*[]]; test_ok(a == [])
+a = [*[1]]; test_ok(a == [1])
+a = [*[1,2]]; test_ok(a == [1,2])
+
+a = *[]; test_ok(a == [])
+a = *[1]; test_ok(a == [1])
+a = *[nil]; test_ok(a == [nil])
+a = *[[]]; test_ok(a == [[]])
+a = *[1,2]; test_ok(a == [1,2])
+a = *[*[]]; test_ok(a == [])
+a = *[*[1]]; test_ok(a == [1])
+a = *[*[1,2]]; test_ok(a == [1,2])
+
+a, = nil; test_ok(a == nil)
+a, = 1; test_ok(a == 1)
+a, = []; test_ok(a == nil)
+a, = [1]; test_ok(a == 1)
+a, = [nil]; test_ok(a == nil)
+a, = [[]]; test_ok(a == [])
+a, = 1,2; test_ok(a == 1)
+a, = [1,2]; test_ok(a == 1)
+a, = [*[]]; test_ok(a == nil)
+a, = [*[1]]; test_ok(a == 1)
+a, = *[1,2]; test_ok(a == 1)
+a, = [*[1,2]]; test_ok(a == 1)
+
+a, = *[]; test_ok(a == nil)
+a, = *[1]; test_ok(a == 1)
+a, = *[nil]; test_ok(a == nil)
+a, = *[[]]; test_ok(a == [])
+a, = *[1,2]; test_ok(a == 1)
+a, = *[*[]]; test_ok(a == nil)
+a, = *[*[1]]; test_ok(a == 1)
+a, = *[*[1,2]]; test_ok(a == 1)
+
+*a = nil; test_ok(a == [nil])
+*a = 1; test_ok(a == [1])
+*a = []; test_ok(a == [])
+*a = [1]; test_ok(a == [1])
+*a = [nil]; test_ok(a == [nil])
+*a = [[]]; test_ok(a == [[]])
+*a = [1,2]; test_ok(a == [1,2])
+*a = [*[]]; test_ok(a == [])
+*a = [*[1]]; test_ok(a == [1])
+*a = [*[1,2]]; test_ok(a == [1,2])
+
+*a = *[]; test_ok(a == [])
+*a = *[1]; test_ok(a == [1])
+*a = *[nil]; test_ok(a == [nil])
+*a = *[[]]; test_ok(a == [[]])
+*a = *[1,2]; test_ok(a == [1,2])
+*a = *[*[]]; test_ok(a == [])
+*a = *[*[1]]; test_ok(a == [1])
+*a = *[*[1,2]]; test_ok(a == [1,2])
+
+a,b,*c = nil; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = 1; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = []; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = [1]; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = [nil]; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = [[]]; test_ok([a,b,c] == [[],nil,[]])
+a,b,*c = [1,2]; test_ok([a,b,c] == [1,2,[]])
+a,b,*c = [*[]]; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = [*[1]]; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = [*[1,2]]; test_ok([a,b,c] == [1,2,[]])
+
+a,b,*c = *[]; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = *[1]; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = *[nil]; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = *[[]]; test_ok([a,b,c] == [[],nil,[]])
+a,b,*c = *[1,2]; test_ok([a,b,c] == [1,2,[]])
+a,b,*c = *[*[]]; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = *[*[1]]; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = *[*[1,2]]; test_ok([a,b,c] == [1,2,[]])
+
+def f; yield nil; end; f {|a| test_ok(a == nil)}
+def f; yield 1; end; f {|a| test_ok(a == 1)}
+def f; yield []; end; f {|a| test_ok(a == [])}
+def f; yield [1]; end; f {|a| test_ok(a == [1])}
+def f; yield [nil]; end; f {|a| test_ok(a == [nil])}
+def f; yield [[]]; end; f {|a| test_ok(a == [[]])}
+def f; yield [*[]]; end; f {|a| test_ok(a == [])}
+def f; yield [*[1]]; end; f {|a| test_ok(a == [1])}
+def f; yield [*[1,2]]; end; f {|a| test_ok(a == [1,2])}
+def f; yield *[]; end; f {|a| test_ok(a == nil)}
+def f; yield *[1]; end; f {|a| test_ok(a == 1)}
+def f; yield *[nil]; end; f {|a| test_ok(a == nil)}
+def f; yield *[[]]; end; f {|a| test_ok(a == [])}
+def f; yield *[*[]]; end; f {|a| test_ok(a == nil)}
+def f; yield *[*[1]]; end; f {|a| test_ok(a == 1)}
+def f; yield *[*[1,2]]; end; f {|a| test_ok(a == 1)}
+
+def f; yield; end; f {|a,| test_ok(a == nil)}
+def f; yield nil; end; f {|a,| test_ok(a == nil)}
+def f; yield 1; end; f {|a,| test_ok(a == 1)}
+def f; yield []; end; f {|a,| test_ok(a == nil)}
+def f; yield [1]; end; f {|a,| test_ok(a == 1)}
+def f; yield [nil]; end; f {|a,| test_ok(a == nil)}
+def f; yield [[]]; end; f {|a,| test_ok(a == [])}
+def f; yield [*[]]; end; f {|a,| test_ok(a == nil)}
+def f; yield [*[1]]; end; f {|a,| test_ok(a == 1)}
+def f; yield [*[1,2]]; end; f {|a,| test_ok(a == 1)}
+
+def f; yield *[]; end; f {|a,| test_ok(a == nil)}
+def f; yield *[1]; end; f {|a,| test_ok(a == 1)}
+def f; yield *[nil]; end; f {|a,| test_ok(a == nil)}
+def f; yield *[[]]; end; f {|a,| test_ok(a == nil)}
+def f; yield *[*[]]; end; f {|a,| test_ok(a == nil)}
+def f; yield *[*[1]]; end; f {|a,| test_ok(a == 1)}
+def f; yield *[*[1,2]]; end; f {|a,| test_ok(a == 1)}
+
+def f; yield; end; f {|*a| test_ok(a == [])}
+def f; yield nil; end; f {|*a| test_ok(a == [nil])}
+def f; yield 1; end; f {|*a| test_ok(a == [1])}
+def f; yield []; end; f {|*a| test_ok(a == [[]])}
+def f; yield [1]; end; f {|*a| test_ok(a == [[1]])}
+def f; yield [nil]; end; f {|*a| test_ok(a == [[nil]])}
+def f; yield [[]]; end; f {|*a| test_ok(a == [[[]]])}
+def f; yield [1,2]; end; f {|*a| test_ok(a == [[1,2]])}
+def f; yield [*[]]; end; f {|*a| test_ok(a == [[]])}
+def f; yield [*[1]]; end; f {|*a| test_ok(a == [[1]])}
+def f; yield [*[1,2]]; end; f {|*a| test_ok(a == [[1,2]])}
+
+def f; yield *[]; end; f {|*a| test_ok(a == [])}
+def f; yield *[1]; end; f {|*a| test_ok(a == [1])}
+def f; yield *[nil]; end; f {|*a| test_ok(a == [nil])}
+def f; yield *[[]]; end; f {|*a| test_ok(a == [[]])}
+def f; yield *[*[]]; end; f {|*a| test_ok(a == [])}
+def f; yield *[*[1]]; end; f {|*a| test_ok(a == [1])}
+def f; yield *[*[1,2]]; end; f {|*a| test_ok(a == [1,2])}
+
+def f; yield; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield nil; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield 1; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
+def f; yield []; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield [1]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
+def f; yield [nil]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield [[]]; end; f {|a,b,*c| test_ok([a,b,c] == [[],nil,[]])}
+def f; yield [*[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield [*[1]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
+def f; yield [*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])}
+
+def f; yield *[]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield *[1]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
+def f; yield *[nil]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield *[[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield *[*[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])}
+def f; yield *[*[1]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])}
+def f; yield *[*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])}
+
+def r; return; end; a = r(); test_ok(a == nil)
+def r; return nil; end; a = r(); test_ok(a == nil)
+def r; return 1; end; a = r(); test_ok(a == 1)
+def r; return []; end; a = r(); test_ok(a == [])
+def r; return [1]; end; a = r(); test_ok(a == [1])
+def r; return [nil]; end; a = r(); test_ok(a == [nil])
+def r; return [[]]; end; a = r(); test_ok(a == [[]])
+def r; return [*[]]; end; a = r(); test_ok(a == [])
+def r; return [*[1]]; end; a = r(); test_ok(a == [1])
+def r; return [*[1,2]]; end; a = r(); test_ok(a == [1,2])
+
+def r; return *[]; end; a = r(); test_ok(a == [])
+def r; return *[1]; end; a = r(); test_ok(a == [1])
+def r; return *[nil]; end; a = r(); test_ok(a == [nil])
+def r; return *[[]]; end; a = r(); test_ok(a == [[]])
+def r; return *[*[]]; end; a = r(); test_ok(a == [])
+def r; return *[*[1]]; end; a = r(); test_ok(a == [1])
+def r; return *[*[1,2]]; end; a = r(); test_ok(a == [1,2])
+
+def r; return *[[]]; end; a = *r(); test_ok(a == [[]])
+def r; return *[*[1,2]]; end; a = *r(); test_ok(a == [1,2])
+
+def r; return; end; *a = r(); test_ok(a == [nil])
+def r; return nil; end; *a = r(); test_ok(a == [nil])
+def r; return 1; end; *a = r(); test_ok(a == [1])
+def r; return []; end; *a = r(); test_ok(a == [])
+def r; return [1]; end; *a = r(); test_ok(a == [1])
+def r; return [nil]; end; *a = r(); test_ok(a == [nil])
+def r; return [[]]; end; *a = r(); test_ok(a == [[]])
+def r; return [1,2]; end; *a = r(); test_ok(a == [1,2])
+def r; return [*[]]; end; *a = r(); test_ok(a == [])
+def r; return [*[1]]; end; *a = r(); test_ok(a == [1])
+def r; return [*[1,2]]; end; *a = r(); test_ok(a == [1,2])
+
+def r; return *[]; end; *a = r(); test_ok(a == [])
+def r; return *[1]; end; *a = r(); test_ok(a == [1])
+def r; return *[nil]; end; *a = r(); test_ok(a == [nil])
+def r; return *[[]]; end; *a = r(); test_ok(a == [[]])
+def r; return *[1,2]; end; *a = r(); test_ok(a == [1,2])
+def r; return *[*[]]; end; *a = r(); test_ok(a == [])
+def r; return *[*[1]]; end; *a = r(); test_ok(a == [1])
+def r; return *[*[1,2]]; end; *a = r(); test_ok(a == [1,2])
+
+def r; return *[[]]; end; *a = *r(); test_ok(a == [[]])
+def r; return *[1,2]; end; *a = *r(); test_ok(a == [1,2])
+def r; return *[*[1,2]]; end; *a = *r(); test_ok(a == [1,2])
+
+def r; return; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return nil; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return 1; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
+def r; return []; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return [1]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
+def r; return [nil]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return [[]]; end; a,b,*c = r(); test_ok([a,b,c] == [[],nil,[]])
+def r; return [1,2]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
+def r; return [*[]]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return [*[1]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
+def r; return [*[1,2]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
+
+def r; return *[]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return *[1]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
+def r; return *[nil]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return *[[]]; end; a,b,*c = r(); test_ok([a,b,c] == [[],nil,[]])
+def r; return *[1,2]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
+def r; return *[*[]]; end; a,b,*c = r(); test_ok([a,b,c] == [nil,nil,[]])
+def r; return *[*[1]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,nil,[]])
+def r; return *[*[1,2]]; end; a,b,*c = r(); test_ok([a,b,c] == [1,2,[]])
+
+f = lambda {|r,| test_ok([] == r)}
+f.call([], *[])
+
+f = lambda {|r,*l| test_ok([] == r); test_ok([1] == l)}
+f.call([], *[1])
+
+f = lambda{|x| x}
+test_ok(f.call(42) == 42)
+test_ok(f.call([42]) == [42])
+test_ok(f.call([[42]]) == [[42]])
+test_ok(f.call([42,55]) == [42,55])
+
+f = lambda{|x,| x}
+test_ok(f.call(42) == 42)
+test_ok(f.call([42]) == [42])
+test_ok(f.call([[42]]) == [[42]])
+test_ok(f.call([42,55]) == [42,55])
+
+f = lambda{|*x| x}
+test_ok(f.call(42) == [42])
+test_ok(f.call([42]) == [[42]])
+test_ok(f.call([[42]]) == [[[42]]])
+test_ok(f.call([42,55]) == [[42,55]])
+test_ok(f.call(42,55) == [42,55])
+
+f = lambda { |a, b=42, *c| [a,b,c] }
+test_ok(f.call(1 ) == [1,42,[ ]] )
+test_ok(f.call(1,43 ) == [1,43,[ ]] )
+test_ok(f.call(1,43,44) == [1,43,[44]] )
+
+f = lambda { |a, b=(a|16), *c, &block| [a,b,c,block&&block[]] }
+test_ok(f.call(8 ) == [8,24,[ ],nil] )
+test_ok(f.call(8,43 ) == [8,43,[ ],nil] )
+test_ok(f.call(8,43,44) == [8,43,[44],nil] )
+test_ok(f.call(8 ){45} == [8,24,[ ],45 ] )
+test_ok(f.call(8,43 ){45} == [8,43,[ ],45 ] )
+test_ok(f.call(8,43,44){45} == [8,43,[44],45 ] )
+
+f = lambda { |a, b=42, *c, d| [a,b,c,d] }
+test_ok(f.call(1 ,99) == [1,42,[ ],99] )
+test_ok(f.call(1,43 ,99) == [1,43,[ ],99] )
+test_ok(f.call(1,43,44,99) == [1,43,[44],99] )
+
+f = lambda { |a, b=(a|16), &block| [a,b,block&&block[]] }
+test_ok(f.call(8 ) == [8,24,nil] )
+test_ok(f.call(8,43) == [8,43,nil] )
+test_ok(f.call(8,43) == [8,43,nil] )
+test_ok(f.call(8 ){45} == [8,24,45 ] )
+test_ok(f.call(8,43){45} == [8,43,45 ] )
+test_ok(f.call(8,43){45} == [8,43,45 ] )
+
+f = lambda { |a, b=42, d| [a,b,d] }
+test_ok(f.call(1 ,99) == [1,42,99] )
+test_ok(f.call(1,43,99) == [1,43,99] )
+test_ok(f.call(1,43,99) == [1,43,99] )
+
+f = lambda { |b=42, *c, &block| [b,c,block&&block[]] }
+test_ok(f.call( ) == [42,[ ],nil] )
+test_ok(f.call(43 ) == [43,[ ],nil] )
+test_ok(f.call(43,44) == [43,[44],nil] )
+test_ok(f.call( ){45} == [42,[ ],45 ] )
+test_ok(f.call(43 ){45} == [43,[ ],45 ] )
+test_ok(f.call(43,44){45} == [43,[44],45 ] )
+
+f = lambda { |b=42, *c, d| [b,c,d] }
+test_ok(f.call( 99) == [42,[ ],99] )
+test_ok(f.call(43 ,99) == [43,[ ],99] )
+test_ok(f.call(43,44,99) == [43,[44],99] )
+
+f = lambda { |b=42, &block| [b,block&&block[]] }
+test_ok(f.call( ) == [42,nil] )
+test_ok(f.call(43) == [43,nil] )
+test_ok(f.call(43) == [43,nil] )
+test_ok(f.call( ){45} == [42,45 ] )
+test_ok(f.call(43){45} == [43,45 ] )
+test_ok(f.call(43){45} == [43,45 ] )
+
+f = lambda { |b=42, d| [b,d] }
+test_ok(f.call( 99) == [42,99] )
+test_ok(f.call(43,99) == [43,99] )
+test_ok(f.call(43,99) == [43,99] )
+
+
+a,=*[1]
+test_ok(a == 1)
+a,=*[[1]]
+test_ok(a == [1])
+a,=*[[[1]]]
+test_ok(a == [[1]])
+
+x, (y, z) = 1, 2, 3
+test_ok([1,2,nil] == [x,y,z])
+x, (y, z) = 1, [2,3]
+test_ok([1,2,3] == [x,y,z])
+x, (y, z) = 1, [2]
+test_ok([1,2,nil] == [x,y,z])
+
+a = loop do break; end; test_ok(a == nil)
+a = loop do break nil; end; test_ok(a == nil)
+a = loop do break 1; end; test_ok(a == 1)
+a = loop do break []; end; test_ok(a == [])
+a = loop do break [1]; end; test_ok(a == [1])
+a = loop do break [nil]; end; test_ok(a == [nil])
+a = loop do break [[]]; end; test_ok(a == [[]])
+a = loop do break [*[]]; end; test_ok(a == [])
+a = loop do break [*[1]]; end; test_ok(a == [1])
+a = loop do break [*[1,2]]; end; test_ok(a == [1,2])
+
+a = loop do break *[]; end; test_ok(a == [])
+a = loop do break *[1]; end; test_ok(a == [1])
+a = loop do break *[nil]; end; test_ok(a == [nil])
+a = loop do break *[[]]; end; test_ok(a == [[]])
+a = loop do break *[*[]]; end; test_ok(a == [])
+a = loop do break *[*[1]]; end; test_ok(a == [1])
+a = loop do break *[*[1,2]]; end; test_ok(a == [1,2])
+
+*a = loop do break; end; test_ok(a == [nil])
+*a = loop do break nil; end; test_ok(a == [nil])
+*a = loop do break 1; end; test_ok(a == [1])
+*a = loop do break []; end; test_ok(a == [])
+*a = loop do break [1]; end; test_ok(a == [1])
+*a = loop do break [nil]; end; test_ok(a == [nil])
+*a = loop do break [[]]; end; test_ok(a == [[]])
+*a = loop do break [1,2]; end; test_ok(a == [1,2])
+*a = loop do break [*[]]; end; test_ok(a == [])
+*a = loop do break [*[1]]; end; test_ok(a == [1])
+*a = loop do break [*[1,2]]; end; test_ok(a == [1,2])
+
+*a = loop do break *[]; end; test_ok(a == [])
+*a = loop do break *[1]; end; test_ok(a == [1])
+*a = loop do break *[nil]; end; test_ok(a == [nil])
+*a = loop do break *[[]]; end; test_ok(a == [[]])
+*a = loop do break *[1,2]; end; test_ok(a == [1,2])
+*a = loop do break *[*[]]; end; test_ok(a == [])
+*a = loop do break *[*[1]]; end; test_ok(a == [1])
+*a = loop do break *[*[1,2]]; end; test_ok(a == [1,2])
+
+*a = *loop do break *[[]]; end; test_ok(a == [[]])
+*a = *loop do break *[1,2]; end; test_ok(a == [1,2])
+*a = *loop do break *[*[1,2]]; end; test_ok(a == [1,2])
+
+a,b,*c = loop do break; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break nil; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break 1; end; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = loop do break []; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break [1]; end; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = loop do break [nil]; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break [[]]; end; test_ok([a,b,c] == [[],nil,[]])
+a,b,*c = loop do break [1,2]; end; test_ok([a,b,c] == [1,2,[]])
+a,b,*c = loop do break [*[]]; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break [*[1]]; end; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = loop do break [*[1,2]]; end; test_ok([a,b,c] == [1,2,[]])
+
+a,b,*c = loop do break *[]; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break *[1]; end; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = loop do break *[nil]; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break *[[]]; end; test_ok([a,b,c] == [[],nil,[]])
+a,b,*c = loop do break *[1,2]; end; test_ok([a,b,c] == [1,2,[]])
+a,b,*c = loop do break *[*[]]; end; test_ok([a,b,c] == [nil,nil,[]])
+a,b,*c = loop do break *[*[1]]; end; test_ok([a,b,c] == [1,nil,[]])
+a,b,*c = loop do break *[*[1,2]]; end; test_ok([a,b,c] == [1,2,[]])
+
+def r(val); a = yield(); test_ok(a == val, 2); end
+r(nil){next}
+r(nil){next nil}
+r(1){next 1}
+r([]){next []}
+r([1]){next [1]}
+r([nil]){next [nil]}
+r([[]]){next [[]]}
+r([]){next [*[]]}
+r([1]){next [*[1]]}
+r([1,2]){next [*[1,2]]}
+
+r([]){next *[]}
+r([1]){next *[1]}
+r([nil]){next *[nil]}
+r([[]]){next *[[]]}
+r([]){next *[*[]]}
+r([1]){next *[*[1]]}
+r([1,2]){next *[*[1,2]]}
+
+def r(val); *a = yield(); test_ok(a == val, 2); end
+r([nil]){next}
+r([nil]){next nil}
+r([1]){next 1}
+r([]){next []}
+r([1]){next [1]}
+r([nil]){next [nil]}
+r([[]]){next [[]]}
+r([1,2]){next [1,2]}
+r([]){next [*[]]}
+r([1]){next [*[1]]}
+r([1,2]){next [*[1,2]]}
+
+def r(val); *a = *yield(); test_ok(a == val, 2); end
+r([[]]){next *[[]]}
+r([1,2]){next *[1,2]}
+r([1,2]){next *[*[1,2]]}
+
+def r(val); a,b,*c = yield(); test_ok([a,b,c] == val, 2); end
+r([nil,nil,[]]){next}
+r([nil,nil,[]]){next nil}
+r([1,nil,[]]){next 1}
+r([nil,nil,[]]){next []}
+r([1,nil,[]]){next [1]}
+r([nil,nil,[]]){next [nil]}
+r([[],nil,[]]){next [[]]}
+r([1,2,[]]){next [1,2]}
+r([nil,nil,[]]){next [*[]]}
+r([1,nil,[]]){next [*[1]]}
+r([1,2,[]]){next [*[1,2]]}
+
+def r(val); a,b,*c = *yield(); test_ok([a,b,c] == val, 2); end
+r([[],nil,[]]){next *[[]]}
+r([1,2,[]]){next *[1,2]}
+r([1,2,[]]){next *[*[1,2]]}
+
+test_check "condition"
+
+$x = '0';
+
+$x == $x && test_ok(true)
+$x != $x && test_ok(false)
+$x == $x || test_ok(false)
+$x != $x || test_ok(true)
+
+# first test to see if we can run the tests.
+
+test_check "if/unless";
+
+$x = 'test';
+test_ok(if $x == $x then true else false end)
+$bad = false
+unless $x == $x
+ $bad = true
+end
+test_ok(!$bad)
+test_ok(unless $x != $x then true else false end)
+
+test_check "case"
+
+case 5
+when 1, 2, 3, 4, 6, 7, 8
+ test_ok(false)
+when 5
+ test_ok(true)
+end
+
+case 5
+when 5
+ test_ok(true)
+when 1..10
+ test_ok(false)
+end
+
+case 5
+when 1..10
+ test_ok(true)
+else
+ test_ok(false)
+end
+
+case 5
+when 5
+ test_ok(true)
+else
+ test_ok(false)
+end
+
+case "foobar"
+when /^f.*r$/
+ test_ok(true)
+else
+ test_ok(false)
+end
+
+test_check "while/until";
+
+while_tmp = "while_tmp.#{$$}"
+tmp = open(while_tmp, "w")
+tmp.print "tvi925\n";
+tmp.print "tvi920\n";
+tmp.print "vt100\n";
+tmp.print "Amiga\n";
+tmp.print "paper\n";
+tmp.close
+
+# test break
+
+tmp = open(while_tmp, "r")
+test_ok(tmp.kind_of?(File))
+
+while line = tmp.gets()
+ break if /vt100/ =~ line
+end
+
+test_ok(!tmp.eof? && /vt100/ =~ line)
+tmp.close
+
+# test next
+$bad = false
+tmp = open(while_tmp, "r")
+while line = tmp.gets()
+ next if /vt100/ =~ line
+ $bad = 1 if /vt100/ =~ line
+end
+test_ok(!(!tmp.eof? || /vt100/ =~ line || $bad))
+tmp.close
+
+# test redo
+$bad = false
+tmp = open(while_tmp, "r")
+while line = tmp.gets()
+ lastline = line
+ line = line.gsub(/vt100/, 'VT100')
+ if lastline != line
+ line.gsub!('VT100', 'Vt100')
+ redo
+ end
+ $bad = 1 if /vt100/ =~ line
+ $bad = 1 if /VT100/ =~ line
+end
+test_ok(tmp.eof? && !$bad)
+tmp.close
+
+sum=0
+for i in 1..10
+ sum += i
+ i -= 1
+ if i > 0
+ redo
+ end
+end
+test_ok(sum == 220)
+
+# test interval
+$bad = false
+tmp = open(while_tmp, "r")
+while line = tmp.gets()
+ break if 3
+ case line
+ when /vt100/, /Amiga/, /paper/
+ $bad = true
+ end
+end
+test_ok(!$bad)
+tmp.close
+
+File.unlink while_tmp or `/bin/rm -f "#{while_tmp}"`
+test_ok(!File.exist?(while_tmp))
+
+i = 0
+until i>4
+ i+=1
+end
+test_ok(i>4)
+
+
+# exception handling
+test_check "exception";
+
+begin
+ raise "this must be handled"
+ test_ok(false)
+rescue
+ test_ok(true)
+end
+
+$bad = true
+begin
+ raise "this must be handled no.2"
+rescue
+ if $bad
+ $bad = false
+ retry
+ test_ok(false)
+ end
+end
+test_ok(true)
+
+# exception in rescue clause
+$string = "this must be handled no.3"
+begin
+ begin
+ raise "exception in rescue clause"
+ rescue
+ raise $string
+ end
+ test_ok(false)
+rescue => e
+ test_ok($! == e)
+ test_ok(e.message == $string)
+ test_ok(e != $string)
+end
+
+# exception in ensure clause
+begin
+ begin
+ raise "this must be handled no.4"
+ ensure
+ raise "exception in ensure clause"
+ end
+ test_ok(false)
+rescue
+ test_ok(true)
+end
+
+$bad = true
+begin
+ begin
+ raise "this must be handled no.5"
+ ensure
+ $bad = false
+ end
+rescue
+end
+test_ok(!$bad)
+
+$bad = true
+begin
+ begin
+ raise "this must be handled no.6"
+ ensure
+ $bad = false
+ end
+rescue
+end
+test_ok(!$bad)
+
+$bad = true
+while true
+ begin
+ break
+ ensure
+ $bad = false
+ end
+end
+test_ok(!$bad)
+
+test_ok(catch(:foo) {
+ loop do
+ loop do
+ throw :foo, true
+ break
+ end
+ break
+ test_ok(false) # should no reach here
+ end
+ false
+ })
+
+test_check "array"
+test_ok([1, 2] + [3, 4] == [1, 2, 3, 4])
+test_ok([1, 2] * 2 == [1, 2, 1, 2])
+test_ok([1, 2] * ":" == "1:2")
+
+test_ok([1, 2].hash == [1, 2].hash)
+
+test_ok([1,2,3] & [2,3,4] == [2,3])
+test_ok([1,2,3] | [2,3,4] == [1,2,3,4])
+test_ok([1,2,3] - [2,3] == [1])
+
+$x = [0, 1, 2, 3, 4, 5]
+test_ok($x[2] == 2)
+test_ok($x[1..3] == [1, 2, 3])
+test_ok($x[1,3] == [1, 2, 3])
+
+$x[0, 2] = 10
+test_ok($x[0] == 10 && $x[1] == 2)
+
+$x[0, 0] = -1
+test_ok($x[0] == -1 && $x[1] == 10)
+
+$x[-1, 1] = 20
+test_ok($x[-1] == 20 && $x.pop == 20)
+
+# array and/or
+test_ok(([1,2,3]&[2,4,6]) == [2])
+test_ok(([1,2,3]|[2,4,6]) == [1,2,3,4,6])
+
+# compact
+$x = [nil, 1, nil, nil, 5, nil, nil]
+$x.compact!
+test_ok($x == [1, 5])
+
+# uniq
+$x = [1, 1, 4, 2, 5, 4, 5, 1, 2]
+$x.uniq!
+test_ok($x == [1, 4, 2, 5])
+
+# empty?
+test_ok(!$x.empty?)
+$x = []
+test_ok($x.empty?)
+
+# sort
+$x = ["it", "came", "to", "pass", "that", "..."]
+$x = $x.sort.join(" ")
+test_ok($x == "... came it pass that to")
+$x = [2,5,3,1,7]
+$x.sort!{|a,b| a<=>b} # sort with condition
+test_ok($x == [1,2,3,5,7])
+$x.sort!{|a,b| b-a} # reverse sort
+test_ok($x == [7,5,3,2,1])
+
+# split test
+$x = "The Book of Mormon"
+test_ok($x.split(//).reverse!.join == $x.reverse)
+test_ok($x.reverse == $x.reverse!)
+test_ok("1 byte string".split(//).reverse.join(":") == "g:n:i:r:t:s: :e:t:y:b: :1")
+$x = "a b c d"
+test_ok($x.split == ['a', 'b', 'c', 'd'])
+test_ok($x.split(' ') == ['a', 'b', 'c', 'd'])
+test_ok(defined? "a".chomp)
+test_ok("abc".scan(/./) == ["a", "b", "c"])
+test_ok("1a2b3c".scan(/(\d.)/) == [["1a"], ["2b"], ["3c"]])
+# non-greedy match
+test_ok("a=12;b=22".scan(/(.*?)=(\d*);?/) == [["a", "12"], ["b", "22"]])
+
+$x = [1]
+test_ok(($x * 5).join(":") == '1:1:1:1:1')
+test_ok(($x * 1).join(":") == '1')
+test_ok(($x * 0).join(":") == '')
+
+*$x = *(1..7).to_a
+test_ok($x.size == 7)
+test_ok($x == [1, 2, 3, 4, 5, 6, 7])
+
+$x = [1,2,3]
+$x[1,0] = $x
+test_ok($x == [1,1,2,3,2,3])
+
+$x = [1,2,3]
+$x[-1,0] = $x
+test_ok($x == [1,2,1,2,3,3])
+
+$x = [1,2,3]
+$x.concat($x)
+test_ok($x == [1,2,3,1,2,3])
+
+test_check "hash"
+$x = {1=>2, 2=>4, 3=>6}
+
+test_ok($x[1] == 2)
+
+test_ok(begin
+ for k,v in $x
+ raise if k*2 != v
+ end
+ true
+ rescue
+ false
+ end)
+
+test_ok($x.length == 3)
+test_ok($x.has_key?(1))
+test_ok($x.has_value?(4))
+test_ok($x.values_at(2,3) == [4,6])
+test_ok($x == {1=>2, 2=>4, 3=>6})
+
+$z = $x.keys.sort.join(":")
+test_ok($z == "1:2:3")
+
+$z = $x.values.sort.join(":")
+test_ok($z == "2:4:6")
+test_ok($x == $x)
+
+$x.shift
+test_ok($x.length == 2)
+
+$z = [1,2]
+$x[$z] = 256
+test_ok($x[$z] == 256)
+
+$x = Hash.new(0)
+$x[1] = 1
+test_ok($x[1] == 1)
+test_ok($x[2] == 0)
+
+$x = Hash.new([])
+test_ok($x[22] == [])
+test_ok($x[22].equal?($x[22]))
+
+$x = Hash.new{[]}
+test_ok($x[22] == [])
+test_ok(!$x[22].equal?($x[22]))
+
+$x = Hash.new{|h,k| $z = k; h[k] = k*2}
+$z = 0
+test_ok($x[22] == 44)
+test_ok($z == 22)
+$z = 0
+test_ok($x[22] == 44)
+test_ok($z == 0)
+$x.default = 5
+test_ok($x[23] == 5)
+
+$x = Hash.new
+def $x.default(k)
+ $z = k
+ self[k] = k*2
+end
+$z = 0
+test_ok($x[22] == 44)
+test_ok($z == 22)
+$z = 0
+test_ok($x[22] == 44)
+test_ok($z == 0)
+
+test_check "iterator"
+
+test_ok(!iterator?)
+
+def ttt
+ test_ok(iterator?)
+end
+ttt{}
+
+# yield at top level
+test_ok(!defined?(yield))
+
+$x = [1, 2, 3, 4]
+$y = []
+
+# iterator over array
+for i in $x
+ $y.push i
+end
+test_ok($x == $y)
+
+# nested iterator
+def tt
+ 1.upto(10) {|i|
+ yield i
+ }
+end
+
+i=0
+tt{|i| break if i == 5}
+test_ok(i == 0)
+
+def tt2(dummy)
+ yield 1
+end
+
+def tt3(&block)
+ tt2(raise(ArgumentError,""),&block)
+end
+
+$x = false
+begin
+ tt3{}
+rescue ArgumentError
+ $x = true
+rescue Exception
+end
+test_ok($x)
+
+def tt4 &block
+ tt2(raise(ArgumentError,""),&block)
+end
+$x = false
+begin
+ tt4{}
+rescue ArgumentError
+ $x = true
+rescue Exception
+end
+test_ok($x)
+
+# iterator break/redo/next/retry
+done = true
+loop{
+ break
+ done = false # should not reach here
+}
+test_ok(done)
+
+done = false
+$bad = false
+loop {
+ break if done
+ done = true
+ next
+ $bad = true # should not reach here
+}
+test_ok(!$bad)
+
+done = false
+$bad = false
+loop {
+ break if done
+ done = true
+ redo
+ $bad = true # should not reach here
+}
+test_ok(!$bad)
+
+$x = []
+for i in 1 .. 7
+ $x.push i
+end
+test_ok($x.size == 7)
+test_ok($x == [1, 2, 3, 4, 5, 6, 7])
+
+# append method to built-in class
+class Array
+ def iter_test1
+ collect{|e| [e, yield(e)]}.sort{|a,b|a[1]<=>b[1]}
+ end
+ def iter_test2
+ a = collect{|e| [e, yield(e)]}
+ a.sort{|a,b|a[1]<=>b[1]}
+ end
+end
+$x = [[1,2],[3,4],[5,6]]
+test_ok($x.iter_test1{|x|x} == $x.iter_test2{|x|x})
+
+class IterTest
+ def initialize(e); @body = e; end
+
+ def each0(&block); @body.each(&block); end
+ def each1(&block); @body.each {|*x| block.call(*x) } end
+ def each2(&block); @body.each {|*x| block.call(x) } end
+ def each3(&block); @body.each {|x| block.call(*x) } end
+ def each4(&block); @body.each {|x| block.call(x) } end
+ def each5; @body.each {|*x| yield(*x) } end
+ def each6; @body.each {|*x| yield(x) } end
+ def each7; @body.each {|x| yield(*x) } end
+ def each8; @body.each {|x| yield(x) } end
+
+ def f(a)
+ a
+ end
+end
+test_ok(IterTest.new(nil).method(:f).to_proc.call([1]) == [1])
+m = /\w+/.match("abc")
+test_ok(IterTest.new(nil).method(:f).to_proc.call([m]) == [m])
+
+IterTest.new([0]).each0 {|x| test_ok(x == 0)}
+IterTest.new([1]).each1 {|x| test_ok(x == 1)}
+IterTest.new([2]).each2 {|x| test_ok(x == [2])}
+#IterTest.new([3]).each3 {|x| test_ok(x == 3)}
+IterTest.new([4]).each4 {|x| test_ok(x == 4)}
+IterTest.new([5]).each5 {|x| test_ok(x == 5)}
+IterTest.new([6]).each6 {|x| test_ok(x == [6])}
+#IterTest.new([7]).each7 {|x| test_ok(x == 7)}
+IterTest.new([8]).each8 {|x| test_ok(x == 8)}
+
+IterTest.new([[0]]).each0 {|x| test_ok(x == [0])}
+IterTest.new([[1]]).each1 {|x| test_ok(x == [1])}
+IterTest.new([[2]]).each2 {|x| test_ok(x == [[2]])}
+IterTest.new([[3]]).each3 {|x| test_ok(x == 3)}
+IterTest.new([[4]]).each4 {|x| test_ok(x == [4])}
+IterTest.new([[5]]).each5 {|x| test_ok(x == [5])}
+IterTest.new([[6]]).each6 {|x| test_ok(x == [[6]])}
+IterTest.new([[7]]).each7 {|x| test_ok(x == 7)}
+IterTest.new([[8]]).each8 {|x| test_ok(x == [8])}
+
+IterTest.new([[0,0]]).each0 {|*x| test_ok(x == [[0,0]])}
+IterTest.new([[8,8]]).each8 {|*x| test_ok(x == [[8,8]])}
+
+def m0(v)
+ v
+end
+
+def m1
+ m0(block_given?)
+end
+test_ok(m1{p 'test'})
+test_ok(!m1)
+
+def m
+ m0(block_given?,&Proc.new{})
+end
+test_ok(m1{p 'test'})
+test_ok(!m1)
+
+class C
+ include Enumerable
+ def initialize
+ @a = [1,2,3]
+ end
+ def each(&block)
+ @a.each(&block)
+ end
+end
+
+test_ok(C.new.collect{|n| n} == [1,2,3])
+
+test_ok(Proc == lambda{}.class)
+test_ok(Proc == Proc.new{}.class)
+lambda{|a|test_ok(a==1)}.call(1)
+def block_test(klass, &block)
+ test_ok(klass === block)
+end
+
+block_test(NilClass)
+block_test(Proc){}
+
+def call_argument_test(state, proc, *args)
+ x = state
+ begin
+ proc.call(*args)
+ rescue ArgumentError
+ x = !x
+ end
+ test_ok(x,2)
+end
+
+call_argument_test(true, lambda{||})
+call_argument_test(false, lambda{||}, 1)
+call_argument_test(true, lambda{|a,|}, 1)
+call_argument_test(false, lambda{|a,|})
+call_argument_test(false, lambda{|a,|}, 1,2)
+
+call_argument_test(true, Proc.new{||})
+call_argument_test(true, Proc.new{||}, 1)
+call_argument_test(true, Proc.new{|a,|}, 1)
+call_argument_test(true, Proc.new{|a,|})
+call_argument_test(true, Proc.new{|a,|}, 1,2)
+
+def block_get(&block)
+ block
+end
+
+test_ok(Proc == block_get{}.class)
+call_argument_test(true, block_get{||})
+call_argument_test(true, block_get{||}, 1)
+call_argument_test(true, block_get{|a,|}, 1)
+call_argument_test(true, block_get{|a,|})
+call_argument_test(true, block_get{|a,|}, 1,2)
+
+call_argument_test(true, block_get(&lambda{||}))
+call_argument_test(false, block_get(&lambda{||}),1)
+call_argument_test(true, block_get(&lambda{|a,|}),1)
+call_argument_test(false, block_get(&lambda{|a,|}),1,2)
+
+blk = block_get{11}
+test_ok(blk.class == Proc)
+test_ok(blk.to_proc.class == Proc)
+test_ok(blk.clone.call == 11)
+test_ok(block_get(&blk).class == Proc)
+
+lmd = lambda{44}
+test_ok(lmd.class == Proc)
+test_ok(lmd.to_proc.class == Proc)
+test_ok(lmd.clone.call == 44)
+test_ok(block_get(&lmd).class == Proc)
+
+test_ok(Proc.new{|a,| a}.yield(1,2,3) == 1)
+call_argument_test(true, Proc.new{|a,|}, 1,2)
+
+test_ok(Proc.new{|&b| b.call(10)}.call {|x| x} == 10)
+test_ok(Proc.new{|a,&b| b.call(a)}.call(12) {|x| x} == 12)
+
+def test_return1
+ Proc.new {
+ return 55
+ }.yield + 5
+end
+test_ok(test_return1() == 55)
+def test_return2
+ lambda {
+ return 55
+ }.call + 5
+end
+test_ok(test_return2() == 60)
+
+def proc_call(&b)
+ b.call
+end
+def proc_yield()
+ yield
+end
+def proc_return1
+ lambda{return 42}.call+1
+end
+test_ok(proc_return1() == 43)
+def proc_return2
+ ->{return 42}.call+1
+end
+test_ok(proc_return2() == 43)
+def proc_return3
+ proc_call{return 42}+1
+end
+test_ok(proc_return3() == 42)
+def proc_return4
+ proc_yield{return 42}+1
+end
+test_ok(proc_return4() == 42)
+
+def ljump_test(state, proc, *args)
+ x = state
+ begin
+ proc.call(*args)
+ rescue LocalJumpError
+ x = !x
+ end
+ test_ok(x,2)
+end
+
+ljump_test(false, block_get{break})
+ljump_test(true, lambda{break})
+
+def exit_value_test(&block)
+ block.call
+rescue LocalJumpError
+ $!.exit_value
+end
+
+test_ok(45 == exit_value_test{break 45})
+
+test_ok(55 == begin
+ block_get{break 55}.call
+ rescue LocalJumpError
+ $!.exit_value
+ end)
+
+def block_call(&block)
+ block.call
+end
+
+def test_b1
+ block_call{break 11}
+end
+test_ok(test_b1() == 11)
+
+def ljump_rescue(r)
+ begin
+ yield
+ rescue LocalJumpError => e
+ r if /from proc-closure/ =~ e.message
+ end
+end
+
+def test_b2
+ ljump_rescue(22) do
+ block_get{break 21}.call
+ end
+end
+test_ok(test_b2() == 22)
+
+def test_b3
+ ljump_rescue(33) do
+ Proc.new{break 31}.yield
+ end
+end
+test_ok(test_b3() == 33)
+
+def test_b4
+ lambda{break 44}.call
+end
+test_ok(test_b4() == 44)
+
+def test_b5
+ ljump_rescue(55) do
+ b = block_get{break 54}
+ block_call(&b)
+ end
+end
+test_ok(test_b5() == 55)
+
+def test_b6
+ b = lambda{break 67}
+ block_call(&b)
+ 66
+end
+test_ok(test_b6() == 66)
+
+def util_r7
+ block_get{break 78}
+end
+
+def test_b7
+ b = util_r7()
+ ljump_rescue(77) do
+ block_call(&b)
+ end
+end
+test_ok(test_b7() == 77)
+
+def util_b8(&block)
+ block_call(&block)
+end
+
+def test_b8
+ util_b8{break 88}
+end
+test_ok(test_b8() == 88)
+
+def util_b9(&block)
+ lambda{block.call; 98}.call
+end
+
+def test_b9
+ util_b9{break 99}
+end
+test_ok(test_b9() == 99)
+
+def util_b10
+ util_b9{break 100}
+end
+
+def test_b10
+ util_b10()
+end
+test_ok(test_b10() == 100)
+
+def test_b11
+ ljump_rescue(111) do
+ loop do
+ Proc.new{break 110}.yield
+ break 112
+ end
+ end
+end
+test_ok(test_b11() == 111)
+
+def test_b12
+ loop do
+ break lambda{break 122}.call
+ break 121
+ end
+end
+test_ok(test_b12() == 122)
+
+def test_b13
+ ljump_rescue(133) do
+ while true
+ Proc.new{break 130}.yield
+ break 131
+ end
+ end
+end
+test_ok(test_b13() == 133)
+
+def test_b14
+ while true
+ break lambda{break 144}.call
+ break 143
+ end
+end
+test_ok(test_b14() == 144)
+
+def test_b15
+ [0].each {|c| yield 1 }
+ 156
+end
+test_ok(test_b15{|e| break 155 } == 155)
+
+def marity_test(m)
+ method = method(m)
+ test_ok(method.arity == method.to_proc.arity, 2)
+end
+marity_test(:test_ok)
+marity_test(:marity_test)
+marity_test(:p)
+
+lambda(&method(:test_ok)).call(true)
+lambda(&block_get{|a,n| test_ok(a,n)}).call(true, 2)
+
+class ITER_TEST1
+ def a
+ block_given?
+ end
+end
+
+class ITER_TEST2 < ITER_TEST1
+ def a
+ test_ok(super)
+ super
+ end
+end
+test_ok(ITER_TEST2.new.a {})
+
+class ITER_TEST3
+ def foo x
+ return yield if block_given?
+ x
+ end
+end
+
+class ITER_TEST4 < ITER_TEST3
+ def foo x
+ test_ok(super == yield)
+ test_ok(super(x, &nil) == x)
+ end
+end
+
+ITER_TEST4.new.foo(44){55}
+
+class ITER_TEST5
+ def tt(aa)
+ aa
+ end
+
+ def uu(a)
+ class << self
+ define_method(:tt) do |sym|
+ super(sym)
+ end
+ end
+ end
+
+ def xx(*x)
+ x.size
+ end
+end
+
+a = ITER_TEST5.new
+a.uu(12)
+test_ok(a.tt(1) == 1)
+
+class ITER_TEST6 < ITER_TEST5
+ def xx(*a)
+ a << 12
+ super
+ end
+end
+
+test_ok(ITER_TEST6.new.xx([24]) == 2)
+
+test_check "float"
+test_ok(2.6.floor == 2)
+test_ok((-2.6).floor == -3)
+test_ok(2.6.ceil == 3)
+test_ok((-2.6).ceil == -2)
+test_ok(2.6.truncate == 2)
+test_ok((-2.6).truncate == -2)
+test_ok(2.6.round == 3)
+test_ok((-2.4).truncate == -2)
+test_ok((13.4 % 1 - 0.4).abs < 0.0001)
+nan = 0.0/0
+def nan_test(x,y)
+ test_ok(x != y)
+ test_ok((x < y) == false)
+ test_ok((x > y) == false)
+ test_ok((x <= y) == false)
+ test_ok((x >= y) == false)
+end
+nan_test(nan, nan)
+nan_test(nan, 0)
+nan_test(nan, 1)
+nan_test(nan, -1)
+nan_test(nan, 1000)
+nan_test(nan, -1000)
+nan_test(nan, 1_000_000_000_000)
+nan_test(nan, -1_000_000_000_000)
+nan_test(nan, 100.0);
+nan_test(nan, -100.0);
+nan_test(nan, 0.001);
+nan_test(nan, -0.001);
+nan_test(nan, 1.0/0);
+nan_test(nan, -1.0/0);
+
+#s = "3.7517675036461267e+17"
+#test_ok(s == sprintf("%.16e", s.to_f))
+f = 3.7517675036461267e+17
+test_ok(f == sprintf("%.16e", f).to_f)
+
+
+test_check "bignum"
+def fact(n)
+ return 1 if n == 0
+ f = 1
+ while n>0
+ f *= n
+ n -= 1
+ end
+ return f
+end
+$x = fact(40)
+test_ok($x == $x)
+test_ok($x == fact(40))
+test_ok($x < $x+2)
+test_ok($x > $x-2)
+test_ok($x == 815915283247897734345611269596115894272000000000)
+test_ok($x != 815915283247897734345611269596115894272000000001)
+test_ok($x+1 == 815915283247897734345611269596115894272000000001)
+test_ok($x/fact(20) == 335367096786357081410764800000)
+$x = -$x
+test_ok($x == -815915283247897734345611269596115894272000000000)
+test_ok(2-(2**32) == -(2**32-2))
+test_ok(2**32 - 5 == (2**32-3)-2)
+
+$good = true;
+for i in 1000..1014
+ $good = false if ((1 << i) != (2**i))
+end
+test_ok($good)
+
+$good = true;
+n1= 1 << 1000
+for i in 1000..1014
+ $good = false if ((1 << i) != n1)
+ n1 *= 2
+end
+test_ok($good)
+
+$good = true;
+n2=n1
+for i in 1..10
+ n1 = n1 / 2
+ n2 = n2 >> 1
+ $good = false if (n1 != n2)
+end
+test_ok($good)
+
+$good = true;
+for i in 4000..4096
+ n1 = 1 << i;
+ if (n1**2-1) / (n1+1) != (n1-1)
+ $good = false
+ end
+end
+test_ok($good)
+
+b = 10**80
+a = b * 9 + 7
+test_ok(7 == a.modulo(b))
+test_ok(-b + 7 == a.modulo(-b))
+test_ok(b + -7 == (-a).modulo(b))
+test_ok(-7 == (-a).modulo(-b))
+test_ok(7 == a.remainder(b))
+test_ok(7 == a.remainder(-b))
+test_ok(-7 == (-a).remainder(b))
+test_ok(-7 == (-a).remainder(-b))
+
+test_ok(10**40+10**20 == 10000000000000000000100000000000000000000)
+test_ok(10**40/10**20 == 100000000000000000000)
+
+a = 677330545177305025495135714080
+b = 14269972710765292560
+test_ok(a % b == 0)
+test_ok(-a % b == 0)
+
+def shift_test(a)
+ b = a / (2 ** 32)
+ c = a >> 32
+ test_ok(b == c)
+
+ b = a * (2 ** 32)
+ c = a << 32
+ test_ok(b == c)
+end
+
+shift_test(-4518325415524767873)
+shift_test(-0xfffffffffffffffff)
+
+test_check "string & char"
+
+test_ok("abcd" == "abcd")
+test_ok("abcd" =~ /abcd/)
+test_ok("abcd" === "abcd")
+# compile time string concatenation
+test_ok("ab" "cd" == "abcd")
+test_ok("#{22}aa" "cd#{44}" == "22aacd44")
+test_ok("#{22}aa" "cd#{44}" "55" "#{66}" == "22aacd445566")
+test_ok("abc" !~ /^$/)
+test_ok("abc\n" !~ /^$/)
+test_ok("abc" !~ /^d*$/)
+test_ok(("abc" =~ /d*$/) == 3)
+test_ok("" =~ /^$/)
+test_ok("\n" =~ /^$/)
+test_ok("a\n\n" =~ /^$/)
+test_ok("abcabc" =~ /.*a/ && $& == "abca")
+test_ok("abcabc" =~ /.*c/ && $& == "abcabc")
+test_ok("abcabc" =~ /.*?a/ && $& == "a")
+test_ok("abcabc" =~ /.*?c/ && $& == "abc")
+test_ok(/(.|\n)*?\n(b|\n)/ =~ "a\nb\n\n" && $& == "a\nb")
+
+test_ok(/^(ab+)+b/ =~ "ababb" && $& == "ababb")
+test_ok(/^(?:ab+)+b/ =~ "ababb" && $& == "ababb")
+test_ok(/^(ab+)+/ =~ "ababb" && $& == "ababb")
+test_ok(/^(?:ab+)+/ =~ "ababb" && $& == "ababb")
+
+test_ok(/(\s+\d+){2}/ =~ " 1 2" && $& == " 1 2")
+test_ok(/(?:\s+\d+){2}/ =~ " 1 2" && $& == " 1 2")
+
+$x = <<END;
+ABCD
+ABCD
+END
+$x.gsub!(/((.|\n)*?)B((.|\n)*?)D/, '\1\3')
+test_ok($x == "AC\nAC\n")
+
+test_ok("foobar" =~ /foo(?=(bar)|(baz))/)
+test_ok("foobaz" =~ /foo(?=(bar)|(baz))/)
+
+$foo = "abc"
+test_ok("#$foo = abc" == "abc = abc")
+test_ok("#{$foo} = abc" == "abc = abc")
+
+foo = "abc"
+test_ok("#{foo} = abc" == "abc = abc")
+
+test_ok('-' * 5 == '-----')
+test_ok('-' * 1 == '-')
+test_ok('-' * 0 == '')
+
+foo = '-'
+test_ok(foo * 5 == '-----')
+test_ok(foo * 1 == '-')
+test_ok(foo * 0 == '')
+
+$x = "a.gif"
+test_ok($x.sub(/.*\.([^\.]+)$/, '\1') == "gif")
+test_ok($x.sub(/.*\.([^\.]+)$/, 'b.\1') == "b.gif")
+test_ok($x.sub(/.*\.([^\.]+)$/, '\2') == "")
+test_ok($x.sub(/.*\.([^\.]+)$/, 'a\2b') == "ab")
+test_ok($x.sub(/.*\.([^\.]+)$/, '<\&>') == "<a.gif>")
+
+# character constants(assumes ASCII)
+test_ok("a"[0] == ?a)
+test_ok(?a == ?a)
+test_ok(?\C-a == "\1")
+test_ok(?\M-a == "\341")
+test_ok(?\M-\C-a == "\201")
+test_ok("a".upcase![0] == ?A)
+test_ok("A".downcase![0] == ?a)
+test_ok("abc".tr!("a-z", "A-Z") == "ABC")
+test_ok("aabbcccc".tr_s!("a-z", "A-Z") == "ABC")
+test_ok("abcc".squeeze!("a-z") == "abc")
+test_ok("abcd".delete!("bc") == "ad")
+
+$x = "abcdef"
+$y = [ ?a, ?b, ?c, ?d, ?e, ?f ]
+$bad = false
+$x.each_byte {|i|
+ if i.chr != $y.shift
+ $bad = true
+ break
+ end
+}
+test_ok(!$bad)
+
+s = "a string"
+s[0..s.size]="another string"
+test_ok(s == "another string")
+
+s = <<EOS
+#{
+[1,2,3].join(",")
+}
+EOS
+test_ok(s == "1,2,3\n")
+test_ok("Just".to_i(36) == 926381)
+test_ok("-another".to_i(36) == -23200231779)
+test_ok(1299022.to_s(36) == "ruby")
+test_ok(-1045307475.to_s(36) == "-hacker")
+test_ok("Just_another_Ruby_hacker".to_i(36) == 265419172580680477752431643787347)
+test_ok(-265419172580680477752431643787347.to_s(36) == "-justanotherrubyhacker")
+
+a = []
+(0..255).each {|n|
+ ch = [n].pack("C")
+ a.push ch if /a#{Regexp.quote ch}b/x =~ "ab"
+}
+test_ok(a.size == 0)
+
+test_check "assignment"
+a = nil
+test_ok(defined?(a))
+test_ok(a == nil)
+
+# multiple asignment
+a, b = 1, 2
+test_ok(a == 1 && b == 2)
+
+a, b = b, a
+test_ok(a == 2 && b == 1)
+
+a, = 1,2
+test_ok(a == 1)
+
+a, *b = 1, 2, 3
+test_ok(a == 1 && b == [2, 3])
+
+a, (b, c), d = 1, [2, 3], 4
+test_ok(a == 1 && b == 2 && c == 3 && d == 4)
+
+*a = 1, 2, 3
+test_ok(a == [1, 2, 3])
+
+*a = 4
+test_ok(a == [4])
+
+*a = nil
+test_ok(a == [nil])
+
+test_check "call"
+def aaa(a, b=100, *rest)
+ res = [a, b]
+ res += rest if rest
+ return res
+end
+
+# not enough argument
+begin
+ aaa() # need at least 1 arg
+ test_ok(false)
+rescue
+ test_ok(true)
+end
+
+begin
+ aaa # no arg given (exception raised)
+ test_ok(false)
+rescue
+ test_ok(true)
+end
+
+test_ok(aaa(1) == [1, 100])
+test_ok(aaa(1, 2) == [1, 2])
+test_ok(aaa(1, 2, 3, 4) == [1, 2, 3, 4])
+test_ok(aaa(1, *[2, 3, 4]) == [1, 2, 3, 4])
+
+test_check "proc"
+$proc = Proc.new{|i| i}
+test_ok($proc.call(2) == 2)
+test_ok($proc.call(3) == 3)
+
+$proc = Proc.new{|i| i*2}
+test_ok($proc.call(2) == 4)
+test_ok($proc.call(3) == 6)
+
+Proc.new{
+ iii=5 # nested local variable
+ $proc = Proc.new{|i|
+ iii = i
+ }
+ $proc2 = Proc.new {
+ $x = iii # nested variables shared by procs
+ }
+ # scope of nested variables
+ test_ok(defined?(iii))
+}.call
+test_ok(!defined?(iii)) # out of scope
+
+loop{iii=5; test_ok(eval("defined? iii")); break}
+loop {
+ iii = 10
+ def dyna_var_check
+ loop {
+ test_ok(!defined?(iii))
+ break
+ }
+ end
+ dyna_var_check
+ break
+}
+$x=0
+$proc.call(5)
+$proc2.call
+test_ok($x == 5)
+
+if defined? Process.kill
+ test_check "signal"
+
+ $x = 0
+ trap "SIGINT", Proc.new{|sig| $x = 2}
+ Process.kill "SIGINT", $$
+ 100.times {
+ sleep 0.1
+ break if $x != 0
+ }
+ test_ok($x == 2)
+
+ trap "SIGINT", Proc.new{raise "Interrupt"}
+
+ x = false
+ begin
+ Process.kill "SIGINT", $$
+ sleep 0.1
+ rescue
+ x = $!
+ end
+ test_ok(x && /Interrupt/ =~ x.message)
+end
+
+test_check "eval"
+test_ok(eval("") == nil)
+$bad=false
+eval 'while false; $bad = true; print "foo\n" end'
+test_ok(!$bad)
+
+test_ok(eval('TRUE'))
+test_ok(eval('true'))
+test_ok(!eval('NIL'))
+test_ok(!eval('nil'))
+test_ok(!eval('FALSE'))
+test_ok(!eval('false'))
+
+$foo = 'test_ok(true)'
+begin
+ eval $foo
+rescue
+ test_ok(false)
+end
+
+test_ok(eval("$foo") == 'test_ok(true)')
+test_ok(eval("true") == true)
+i = 5
+test_ok(eval("i == 5"))
+test_ok(eval("i") == 5)
+test_ok(eval("defined? i"))
+
+# eval with binding
+def test_ev
+ local1 = "local1"
+ lambda {
+ local2 = "local2"
+ return binding
+ }.call
+end
+
+$x = test_ev
+test_ok(eval("local1", $x) == "local1") # normal local var
+test_ok(eval("local2", $x) == "local2") # nested local var
+$bad = true
+begin
+ p eval("local1")
+rescue NameError # must raise error
+ $bad = false
+end
+test_ok(!$bad)
+
+module EvTest
+ EVTEST1 = 25
+ evtest2 = 125
+ $x = binding
+end
+test_ok(eval("EVTEST1", $x) == 25) # constant in module
+test_ok(eval("evtest2", $x) == 125) # local var in module
+$bad = true
+begin
+ eval("EVTEST1")
+rescue NameError # must raise error
+ $bad = false
+end
+test_ok(!$bad)
+
+x = binding #! YARV Limitation: Proc.new{}
+eval "i4 = 1", x
+test_ok(eval("i4", x) == 1)
+x = Proc.new{binding}.call #! YARV Limitation: Proc.new{Proc.new{}}.call
+eval "i4 = 22", x
+test_ok(eval("i4", x) == 22)
+$x = []
+x = Proc.new{binding}.call #! YARV Limitation: Proc.new{Proc.new{}}.call
+eval "(0..9).each{|i5| $x[i5] = Proc.new{i5*2}}", x
+test_ok($x[4].call == 8)
+
+x = binding
+eval "i = 1", x
+test_ok(eval("i", x) == 1)
+x = Proc.new{binding}.call
+eval "i = 22", x
+test_ok(eval("i", x) == 22)
+$x = []
+x = Proc.new{binding}.call
+eval "(0..9).each{|i5| $x[i5] = Proc.new{i5*2}}", x
+test_ok($x[4].call == 8)
+x = Proc.new{binding}.call
+eval "for i6 in 1..1; j6=i6; end", x
+test_ok(eval("defined? i6", x))
+test_ok(eval("defined? j6", x))
+
+Proc.new {
+ p = binding
+ eval "foo11 = 1", p
+ foo22 = 5
+ Proc.new{foo11=22}.call
+ Proc.new{foo22=55}.call
+ test_ok(eval("foo11", p) == eval("foo11"))
+ test_ok(eval("foo11") == 1)
+ test_ok(eval("foo22", p) == eval("foo22"))
+ test_ok(eval("foo22") == 55)
+}.call if false #! YARV Limitation
+
+#! YARV Limitation: p1 = Proc.new{i7 = 0; Proc.new{i7}}.call
+p1 = Proc.new{i7 = 0; binding}.call
+#! YARV Limitation: test_ok(p1.call == 0)
+eval "i7=5", p1
+#! YARV Limitation: test_ok(p1.call == 5)
+test_ok(!defined?(i7))
+
+if false #! YARV Limitation
+p1 = Proc.new{i7 = 0; Proc.new{i7}}.call
+i7 = nil
+test_ok(p1.call == 0)
+eval "i7=1", p1
+test_ok(p1.call == 1)
+eval "i7=5", p1
+test_ok(p1.call == 5)
+test_ok(i7 == nil)
+end
+
+test_check "system"
+test_ok(`echo foobar` == "foobar\n")
+test_ok(`./miniruby -e 'print "foobar"'` == 'foobar')
+
+script_tmp = "script_tmp.#{$$}"
+tmp = open(script_tmp, "w")
+tmp.print "print $zzz\n";
+tmp.close
+
+test_ok(`./miniruby -s #{script_tmp} -zzz` == 'true')
+test_ok(`./miniruby -s #{script_tmp} -zzz=555` == '555')
+
+tmp = open(script_tmp, "w")
+tmp.print "#! /usr/local/bin/ruby -s\n";
+tmp.print "print $zzz\n";
+tmp.close
+
+test_ok(`./miniruby #{script_tmp} -zzz=678` == '678')
+
+tmp = open(script_tmp, "w")
+tmp.print "this is a leading junk\n";
+tmp.print "#! /usr/local/bin/ruby -s\n";
+tmp.print "print $zzz\n";
+tmp.print "__END__\n";
+tmp.print "this is a trailing junk\n";
+tmp.close
+
+test_ok(`./miniruby -x #{script_tmp}` == '')
+test_ok(`./miniruby -x #{script_tmp} -zzz=555` == '555')
+
+tmp = open(script_tmp, "w")
+for i in 1..5
+ tmp.print i, "\n"
+end
+tmp.close
+
+`./miniruby -i.bak -pe '$_.sub!(/^[0-9]+$/){$&.to_i * 5}' #{script_tmp}`
+done = true
+tmp = open(script_tmp, "r")
+while tmp.gets
+ if $_.to_i % 5 != 0
+ done = false
+ break
+ end
+end
+tmp.close
+test_ok(done)
+
+File.unlink script_tmp or `/bin/rm -f "#{script_tmp}"`
+File.unlink "#{script_tmp}.bak" or `/bin/rm -f "#{script_tmp}.bak"`
+
+test_check "const"
+TEST1 = 1
+TEST2 = 2
+
+module Const
+ TEST3 = 3
+ TEST4 = 4
+end
+
+module Const2
+ TEST3 = 6
+ TEST4 = 8
+end
+
+include Const
+
+test_ok([TEST1,TEST2,TEST3,TEST4] == [1,2,3,4])
+
+include Const2
+STDERR.print "intentionally redefines TEST3, TEST4\n" if $VERBOSE
+test_ok([TEST1,TEST2,TEST3,TEST4] == [1,2,6,8])
+
+
+test_ok((String <=> Object) == -1)
+test_ok((Object <=> String) == 1)
+test_ok((Array <=> String) == nil)
+
+test_check "clone"
+foo = Object.new
+def foo.test
+ "test"
+end
+bar = foo.clone
+def bar.test2
+ "test2"
+end
+
+test_ok(bar.test2 == "test2")
+test_ok(bar.test == "test")
+test_ok(foo.test == "test")
+
+begin
+ foo.test2
+ test_ok false
+rescue NoMethodError
+ test_ok true
+end
+
+module M001; end
+module M002; end
+module M003; include M002; end
+module M002; include M001; end
+module M003; include M002; end
+
+test_ok(M003.ancestors == [M003, M002, M001])
+
+test_check "marshal"
+$x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
+$y = Marshal.dump($x)
+test_ok($x == Marshal.load($y))
+
+StrClone=String.clone;
+test_ok(Marshal.load(Marshal.dump(StrClone.new("abc"))).class == StrClone)
+
+[[1,2,3,4], [81, 2, 118, 3146]].each { |w,x,y,z|
+ a = (x.to_f + y.to_f / z.to_f) * Math.exp(w.to_f / (x.to_f + y.to_f / z.to_f))
+ ma = Marshal.dump(a)
+ b = Marshal.load(ma)
+ test_ok(a == b)
+}
+
+test_check "pack"
+
+$format = "c2x5CCxsdils_l_a6";
+# Need the expression in here to force ary[5] to be numeric. This avoids
+# test2 failing because ary2 goes str->numeric->str and ary does not.
+ary = [1,-100,127,128,32767,987.654321098 / 100.0,12345,123456,-32767,-123456,"abcdef"]
+$x = ary.pack($format)
+ary2 = $x.unpack($format)
+
+test_ok(ary.length == ary2.length)
+test_ok(ary.join(':') == ary2.join(':'))
+test_ok($x =~ /def/)
+
+$x = [-1073741825]
+test_ok($x.pack("q").unpack("q") == $x)
+
+test_check "math"
+test_ok(Math.sqrt(4) == 2)
+
+include Math
+test_ok(sqrt(4) == 2)
+
+test_check "struct"
+struct_test = Struct.new("Test", :foo, :bar)
+test_ok(struct_test == Struct::Test)
+
+test = struct_test.new(1, 2)
+test_ok(test.foo == 1 && test.bar == 2)
+test_ok(test[0] == 1 && test[1] == 2)
+
+a, b = test.to_a
+test_ok(a == 1 && b == 2)
+
+test[0] = 22
+test_ok(test.foo == 22)
+
+test.bar = 47
+test_ok(test.bar == 47)
+
+test_check "variable"
+test_ok($$.instance_of?(Fixnum))
+
+# read-only variable
+begin
+ $$ = 5
+ test_ok false
+rescue NameError
+ test_ok true
+end
+
+foobar = "foobar"
+$_ = foobar
+test_ok($_ == foobar)
+
+class Gods
+ @@rule = "Uranus" # private to Gods
+ def ruler0
+ @@rule
+ end
+
+ def self.ruler1 # <= per method definition style
+ @@rule
+ end
+ class << self # <= multiple method definition style
+ def ruler2
+ @@rule
+ end
+ end
+end
+
+module Olympians
+ @@rule ="Zeus"
+ def ruler3
+ @@rule
+ end
+end
+
+class Titans < Gods
+ @@rule = "Cronus" # do not affect @@rule in Gods
+ include Olympians
+ def ruler4
+ @@rule
+ end
+end
+
+test_ok(Gods.new.ruler0 == "Cronus")
+test_ok(Gods.ruler1 == "Cronus")
+test_ok(Gods.ruler2 == "Cronus")
+test_ok(Titans.ruler1 == "Cronus")
+test_ok(Titans.ruler2 == "Cronus")
+atlas = Titans.new
+test_ok(atlas.ruler0 == "Cronus")
+test_ok(atlas.ruler3 == "Zeus")
+test_ok(atlas.ruler4 == "Cronus")
+
+test_check "trace"
+$x = 1234
+$y = 0
+trace_var :$x, Proc.new{$y = $x}
+$x = 40414
+test_ok($y == $x)
+
+untrace_var :$x
+$x = 19660208
+test_ok($y != $x)
+
+trace_var :$x, Proc.new{$x *= 2}
+$x = 5
+test_ok($x == 10)
+
+untrace_var :$x
+
+test_check "defined?"
+
+test_ok(defined?($x)) # global variable
+test_ok(defined?($x) == 'global-variable')# returns description
+
+foo=5
+test_ok(defined?(foo)) # local variable
+
+test_ok(defined?(Array)) # constant
+test_ok(defined?(Object.new)) # method
+test_ok(!defined?(Object.print))# private method
+test_ok(defined?(1 == 2)) # operator expression
+
+class Foo
+ def foo
+ p :foo
+ end
+ protected :foo
+ def bar(f)
+ test_ok(defined?(self.foo))
+ test_ok(defined?(f.foo))
+ end
+end
+f = Foo.new
+test_ok(defined?(f.foo) == nil)
+f.bar(f)
+
+def defined_test
+ return !defined?(yield)
+end
+
+test_ok(defined_test) # not iterator
+test_ok(!defined_test{}) # called as iterator
+
+test_check "alias"
+class Alias0
+ def foo; "foo" end
+end
+class Alias1<Alias0
+ alias bar foo
+ def foo; "foo+" + super end
+end
+class Alias2<Alias1
+ alias baz foo
+ undef foo
+end
+
+x = Alias2.new
+test_ok(x.bar == "foo")
+test_ok(x.baz == "foo+foo")
+
+# test_check for cache
+test_ok(x.baz == "foo+foo")
+
+class Alias3<Alias2
+ def foo
+ defined? super
+ end
+ def bar
+ defined? super
+ end
+ def quux
+ defined? super
+ end
+end
+x = Alias3.new
+test_ok(!x.foo)
+test_ok(x.bar)
+test_ok(!x.quux)
+
+test_check "path"
+test_ok(File.basename("a") == "a")
+test_ok(File.basename("a/b") == "b")
+test_ok(File.basename("a/b/") == "b")
+test_ok(File.basename("/") == "/")
+test_ok(File.basename("//") == "/")
+test_ok(File.basename("///") == "/")
+test_ok(File.basename("a/b////") == "b")
+test_ok(File.basename("a.rb", ".rb") == "a")
+test_ok(File.basename("a.rb///", ".rb") == "a")
+test_ok(File.basename("a.rb///", ".*") == "a")
+test_ok(File.basename("a.rb///", ".c") == "a.rb")
+test_ok(File.dirname("a") == ".")
+test_ok(File.dirname("/") == "/")
+test_ok(File.dirname("/a") == "/")
+test_ok(File.dirname("a/b") == "a")
+test_ok(File.dirname("a/b/c") == "a/b")
+test_ok(File.dirname("/a/b/c") == "/a/b")
+test_ok(File.dirname("/a/b/") == "/a")
+test_ok(File.dirname("/a/b///") == "/a")
+case Dir.pwd
+when %r'\A\w:'
+ test_ok(/\A\w:\/\z/ =~ File.expand_path(".", "/"))
+ test_ok(/\A\w:\/a\z/ =~ File.expand_path("a", "/"))
+ dosish = true
+when %r'\A//'
+ test_ok(%r'\A//[^/]+/[^/]+\z' =~ File.expand_path(".", "/"))
+ test_ok(%r'\A//[^/]+/[^/]+/a\z' =~ File.expand_path(".", "/"))
+ dosish = true
+else
+ test_ok(File.expand_path(".", "/") == "/")
+ test_ok(File.expand_path("sub", "/") == "/sub")
+end
+if dosish
+ test_ok(File.expand_path("/", "//machine/share/sub") == "//machine/share")
+ test_ok(File.expand_path("/dir", "//machine/share/sub") == "//machine/share/dir")
+ test_ok(File.expand_path("/", "z:/sub") == "z:/")
+ test_ok(File.expand_path("/dir", "z:/sub") == "z:/dir")
+end
+test_ok(File.expand_path(".", "//") == "//")
+test_ok(File.expand_path("sub", "//") == "//sub")
+
+# test_check "Proc#binding"
+ObjectSpace.each_object(Proc){|o|
+ begin
+ b = o.binding
+ eval 'self', b
+ rescue ArgumentError
+ end
+}
+
+test_check "gc"
+begin
+ 1.upto(10000) {
+ tmp = [0,1,2,3,4,5,6,7,8,9]
+ }
+ tmp = nil
+ test_ok true
+rescue
+ test_ok false
+end
+class S
+ def initialize(a)
+ @a = a
+ end
+end
+l=nil
+100000.times {
+ l = S.new(l)
+}
+GC.start
+test_ok true # reach here or dumps core
+l = []
+100000.times {
+ l.push([l])
+}
+GC.start
+test_ok true # reach here or dumps core
+
+ObjectSpace.each_object{|o|
+ o.class.name
+}
+
+test_ok true # reach here or dumps core
+
+PROGRESS.finish
+if $failed > 0
+ printf "not ok/test: %d failed %d\n", $ntest, $failed
+else
+ printf "end of test(test: %d)\n", $ntest
+end
diff --git a/sample/timeout.rb b/sample/timeout.rb
index 8d25d72a76..2870ddb239 100644
--- a/sample/timeout.rb
+++ b/sample/timeout.rb
@@ -8,7 +8,7 @@ end
p timeout(5) {
45
}
-p timeout(5, Timeout::Error) {
+p timeout(5, TimeoutError) {
45
}
p timeout(nil) {
diff --git a/sample/trick2013/README.md b/sample/trick2013/README.md
index d6458c9d51..65f1d3b8ad 100644
--- a/sample/trick2013/README.md
+++ b/sample/trick2013/README.md
@@ -8,8 +8,6 @@ THESE ARE BAD EXAMPLES! You must NOT use them as a sample code.
* shinh/entry.rb: "Most Readable" - Silver award
* yhara/entry.rb: "Worst abuse of constants" - Dishonorable mention
-These files are licensed under MIT license.
-
For the contest outline and other winning entries, see:
https://github.com/tric/trick2013
diff --git a/sample/trick2013/kinaba/remarks.markdown b/sample/trick2013/kinaba/remarks.markdown
index a454a5f0a1..e35550e9af 100644
--- a/sample/trick2013/kinaba/remarks.markdown
+++ b/sample/trick2013/kinaba/remarks.markdown
@@ -18,11 +18,11 @@ The program contains each ASCII character from 0x20 ' ' to 0x7e '~' exactly once
The algorthim is the obvious loop "32.upto(126){|x| putc x}".
-It is not so hard to transform it to use each character *at most once*. The only slight difficulty comes from the constraint that we cannot "declare and then use" variables, because then the code will contain the variable name twice. This restriction is worked around by the $. global variable, the best friend of Ruby golfers.
+It is not so hard to transform it to use each character *at most once*. Only the slight difficulty comes from the constraint that we cannot "declare and then use" variables, because then the code will contain the variable name twice. This restriction is worked around by the $. global variable, the best friend of Ruby golfers.
-The relatively interesting part is to use all the charcters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unused...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
+The relatively interesting part is to use all the charcters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unsed...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
-* "@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz". Trash box of unused alphabet. I wish I could have used "gkyz" somewhere else.
+* "@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz". Trash box of unused alphabet. I with I could have used "gkyz" somewhere else.
* "%r{\"}mosx". Regex literal, with %-syntax. I don't even know what each m,o,s,x means...
diff --git a/sample/trick2013/yhara/entry.rb b/sample/trick2013/yhara/entry.rb
index ce125ed3df..a2deb54399 100644
--- a/sample/trick2013/yhara/entry.rb
+++ b/sample/trick2013/yhara/entry.rb
@@ -2,7 +2,7 @@ def _(&b)$><<->(x){x ? (String===x ?x.upcase:
(Class===x ? x : x.class).name[$a?0:($a=5)]):
" "}[ begin b[];rescue Exception;$!;end ] end
-_ { yield }
+_ { return }
_ { method(:p).unbind }
_ { eval "{ " }
_ { Thread.current.join }
diff --git a/sample/trick2015/README.md b/sample/trick2015/README.md
deleted file mode 100644
index 6cae824796..0000000000
--- a/sample/trick2015/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-This directory contains the award-winning entries of
-the 2nd Transcendental Ruby Imbroglio Contest for rubyKaigi (TRICK 2015).
-
-THESE ARE BAD EXAMPLES! You must NOT use them as a sample code.
-
-* kinaba/entry.rb: "Best piphilology" - **Gold award**
-* ksk\_1/entry.rb: "Most unreadable ALU" - **Silver award**
-* monae/entry.rb: "Doubling amphisbaena award" - **Bronze award**
-* eregon/entry.rb: "Least general solver" - 4th prize
-* ksk\_2/entry.rb: "Most general solver" - 5th prize
-
-These files are licensed under MIT license.
-
-For the contest outline and other winning entries, see:
-
-https://github.com/tric/trick2015
diff --git a/sample/trick2015/eregon/authors.markdown b/sample/trick2015/eregon/authors.markdown
deleted file mode 100644
index 68ca8cdfe0..0000000000
--- a/sample/trick2015/eregon/authors.markdown
+++ /dev/null
@@ -1,3 +0,0 @@
-* Benoit Daloze (eregon)
- * eregontp@gmail.com
- * cctld: be
diff --git a/sample/trick2015/eregon/entry.rb b/sample/trick2015/eregon/entry.rb
deleted file mode 100644
index 51d5c768b2..0000000000
--- a/sample/trick2015/eregon/entry.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class String;def[]*a;$*<<a;b;end;end;
-_=0;z="C=Fiber;s=$*;a=*0..8;l=C.new{e
-xit},*a.product(a).select{|r,c|s[r][c
-]==0}."[1,9,_, _,_,8, _,_,5]+"map{|r,
-c|C.ne"[_,_,2, _,5,_, _,8,9]+"w{o=s[r
-][c];l"[8,_,6, 7,4,_, _,_,_]+"oop{(1.
-.9).map{|n|C.yield(s[r][c]=n)if a.non
-e?{|k|"[_,_,_, _,_,4, _,9,2]+"s[r][k]
-==n||s"[_,2,3, _,7,_, 8,1,_]+"[k][c]=
-=n||s["[5,6,_, 8,_,_, _,_,_]+"r-r%3+k
-%3][c-c%3+k/3]==n}};s[r][c]=o;C.yield
-}}},C."[_,_,_, _,2,7, 9,_,3]+"new{loo
-p{puts"[9,3,_, _,8,_, 1,_,_]+" s.map{
-|r|r*'"[2,_,_, 5,_,_, _,4,8]+" '}<<''
-;C.yield}};c=l[i=1];loop{c=l[i+=c.res
-ume ? 1:-1]}";eval z.tr ?\n,''
diff --git a/sample/trick2015/eregon/remarks.markdown b/sample/trick2015/eregon/remarks.markdown
deleted file mode 100644
index a56f24da71..0000000000
--- a/sample/trick2015/eregon/remarks.markdown
+++ /dev/null
@@ -1,70 +0,0 @@
-### Remarks
-
-Just run it without arguments:
-
- ruby entry.rb
-
-I confirmed the following implementations and platforms:
-
-* Linux:
- * ruby 2.3.0dev (2015-10-30 trunk 52394) [x86\_64-linux]
- * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86\_64-linux]
- * ruby 2.0.0p647 (2015-08-18) [x86\_64-linux]
-* Darwin:
- * ruby 2.0.0p247 (2013-06-27 revision 41674) [x86\_64-darwin10.8.0]
- * jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa Java HotSpot(TM) 64-Bit Server VM 25.11-b03 on 1.8.0\_11-b12 +jit [darwin-x86\_64]
- * rubinius 2.2.6.n74 (2.1.0 94b3a9b4 2014-03-15 JI) [x86\_64-darwin12.5.0]
-
-### Description
-
-This program shows all solutions of any sudoku puzzle.
-
-The embedded sudoku puzzle can be changed at wish.
-
-Giving an empty puzzle (all `0` or `_`), the program will print every possible completed sudoku puzzle.
-We do not however make any time guarantee on such behavior.
-
-The program is rather small for the task: the solver is actually 302 characters long,
-assuming the sudoku puzzle is in a variable `s` and encoded as an array of rows of numbers.
-
-### Internals
-
-* The program implements backtracking and keeps state in a very elegant way.
-* The whole program never goes deeper than 9 stack frames,
- but yet can backtrack up to 81 levels!
-* The main loop of a program is a dance between cells.
- On one end is the solutions, on the other the program ends.
-* The program only uses *infinite* loops and no `break`.
-* The program interleaves the creation of the solver and the puzzle.
-* The program is easy to deobfuscate but finding how it works will be more challenging.
-* The last line contains a smiley.
-
-The author likes good numbers:
-
- $ wc entry.rb
- 15 42 600
-
-The inspiration for this entry comes from:
-
-* A newspaper sudoku with multiple solutions
-* An inspiring paper: `Revisiting Coroutines`
-
-Various tricks used for brevity:
-
-* The method defined is one of the fews which may contain neither parenthesis nor spaces.
-* The program uses the return value of Fiber.yield without arguments.
-* `String#b` is used as a very short `self`.
-
-Design issues:
-
-* Since `return`-ing from a Fiber is not allowed, the programs must `exit`.
-* The program reveals that the cartesian product operator is still too long: `a.product(a)` while it could be `a*a`.
-
-Note:
-
-* In the original code, the last cell was: `C.new{loop{yield s; C.yield}}`,
- implementing some sort of "forwarding coroutine".
-
-### Limitation
-
-* The program does not want any *argument* with you and will quit quietly if you try some.
diff --git a/sample/trick2015/kinaba/authors.markdown b/sample/trick2015/kinaba/authors.markdown
deleted file mode 100644
index 23d4448cf3..0000000000
--- a/sample/trick2015/kinaba/authors.markdown
+++ /dev/null
@@ -1,4 +0,0 @@
-* kinaba
- * twitter.com/kinaba
- * kiki@kmonos.net
- * cctld: jp
diff --git a/sample/trick2015/kinaba/entry.rb b/sample/trick2015/kinaba/entry.rb
deleted file mode 100644
index 18923a6a9f..0000000000
--- a/sample/trick2015/kinaba/entry.rb
+++ /dev/null
@@ -1,150 +0,0 @@
-big, temp = Array 100000000**0x04e2
-srand big
-alias $curTerm $initTerm
-
-Numeric
-Interrupt
-
-big += big
-printout _pi_ finish if $never
-init ||= big
-$counter ||= 02
-
-private
-@mainloop
-while 0x00012345 >= $counter
-
- Rational aprx = 3.141592r
- numbase = 0o0000
-
- @justonce
- def increment
- $initTerm ||= Integer srand * 0x00000002
- srand $counter += 0x00000001
-
- $noaction
- Integer rand
- $noaction
- rand
- rand
- alias $line_cnt $.
- end
-
- @lets_just
- @assume
- diameter = 100000
-
- @you
- @then_have
- permtr |= +3_14159
-
- return if $nomeaning
-
- @onlyuse
- increment
-
- beautiful computer action if $nothing
- $sigmaTerm ||= init
- $curTerm /= srand and init
- pi, = Integer $sigmaTerm unless $nomean
-
- iterator?
- $counter += 1
- atan real_one multiplied by__four unless
- srand +big && $counter >> 0b1
-
- Enumerable
- Fixnum
- Bignum
- Math
- Complex
- Comparable
- TrueClass
- Dir
- Encoding
- Data
- Hash
- Method
- Enumerator
- Exception
- Fiber
- Errno
- FalseClass
- Mutex
- NilClass
- IO
- GC
-
- num = numbase |= srand
-
- ENV
- Float
- MatchData
- Proc
- TracePoint
- KeyError
- p or
- FileTest
- File
- EOFError
- p
- p
- p
- Binding
- Time
- Class
-
- $sigmaTerm += $curTerm
- puts a HelloWorld if $nomean
- SystemExit
-
- !LoadError
- 31i
- 3.1415e0
- Array 14 + 3
- IndexError
- Range
- false
- 55555
- NameError
-
- Object
- @ori
- @ent
- RubyVM
-
- pi += 3_3_1_3_8
-
- @use
- @lots_of
- @keywords
- begin
- self
- $noaction
- not $important
- nil
- __FILE__.object_id
- rescue
- next
- redo if __LINE__
- defined? +$nomeaning
- $noaction
- $nomean
- break $never
- ensure
- class PiCompute
- end
- end
-
- This code cannot _ be executed with typical style unless true
- $curTerm *= num
-end
-
-@ll_set
-@re_U_ok
-
-$Enjoy
-$Superb
-$TRICK15 and a number
-
-print pi
diff --git a/sample/trick2015/kinaba/remarks.markdown b/sample/trick2015/kinaba/remarks.markdown
deleted file mode 100644
index 6316c51fb6..0000000000
--- a/sample/trick2015/kinaba/remarks.markdown
+++ /dev/null
@@ -1,85 +0,0 @@
-### Remarks
-
-Just run it with no argument:
-
- $ ruby entry.rb
-
-I confirmed the following implementation/platform:
-
-- ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
-
-
-### Description
-
-The program is a [Piphilology](https://en.wikipedia.org/wiki/Piphilology#Examples_in_English)
-suitable for Rubyists to memorize the digits of [Pi](https://en.wikipedia.org/wiki/Pi).
-
-In English, the poems for memorizing Pi start with a word consisting of 3-letters,
-1-letter, 4-letters, 1-letter, 5-letters, ... and so on. 10-letter words are used for the
-digit `0`. In Ruby, the lengths of the lexical tokens tell you the number.
-
- $ ruby -r ripper -e \
- 'puts Ripper.tokenize(STDIN).grep(/\S/).map{|t|t.size%10}.join' < entry.rb
- 31415926535897932384626433832795028841971693993751058209749445923078164062862...
-
-The program also tells you the first 10000 digits of Pi, by running.
-
- $ ruby entry.rb
- 31415926535897932384626433832795028841971693993751058209749445923078164062862...
-
-
-### Internals
-
-Random notes on what you might think interesting:
-
-- The 10000 digits output of Pi is seriously computed with no cheets. It is calculated
- by the formula `Pi/2 = 1 + 1/3 + 1/3*2/5 + 1/3*2/5*3/7 + 1/3*2/5*3/7*4/9 + ...`.
-
-- Lexical tokens are not just space-separated units. For instance, `a*b + cdef` does
- not represent [3,1,4]; rather it's [1,1,1,1,4]. The token length
- burden imposes hard constraints on what we can write.
-
-- That said, Pi is [believed](https://en.wikipedia.org/wiki/Normal_number) to contain
- all digit sequences in it. If so, you can find any program inside Pi in theory.
- In practice it isn't that easy particularly under the TRICK's 4096-char
- limit rule. Suppose we want to embed `g += hij`. We have to find [1,2,3] from Pi.
- Assuming uniform distribution, it occurs once in 1000 digits, which already consumes
- 5000 chars in average to reach the point. We need some TRICK.
-
- - `alias` of global variables was useful. It allows me to access the same value from
- different token-length positions.
-
- - `srand` was amazingly useful. Since it returns the "previous seed", the token-length
- `5` essentially becomes a value-store that can be written without waiting for the
- 1-letter token `=`.
-
-- Combination of these techniques leads to a carefully chosen 77-token Pi computation
- program (quoted below), which is embeddable to the first 242 tokens of Pi.
- Though the remaining 165 tokens are just no-op fillers, it's not so bad compared to
- the 1000/3 = 333x blowup mentioned above.
-
-
- big, temp = Array 100000000**0x04e2
- srand big
- alias $curTerm $initTerm
- big += big
- init ||= big
- $counter ||= 02
- while 0x00012345 >= $counter
- numbase = 0x0000
- $initTerm ||= Integer srand * 0x00000002
- srand $counter += 0x00000001
- $sigmaTerm ||= init
- $curTerm /= srand
- pi, = Integer $sigmaTerm
- $counter += 1
- srand +big && $counter >> 0b1
- num = numbase |= srand
- $sigmaTerm += $curTerm
- pi += 3_3_1_3_8
- $curTerm *= num
- end
- print pi
-
-- By the way, what's the blowup ratio of the final code, then?
- It's 242/77, whose first three digits are, of course, 3.14.
diff --git a/sample/trick2015/ksk_1/authors.markdown b/sample/trick2015/ksk_1/authors.markdown
deleted file mode 100644
index bd6d41f6c7..0000000000
--- a/sample/trick2015/ksk_1/authors.markdown
+++ /dev/null
@@ -1,3 +0,0 @@
-* Keisuke Nakano
- * ksk@github, ksknac@twitter
- * cctld: jp
diff --git a/sample/trick2015/ksk_1/entry.rb b/sample/trick2015/ksk_1/entry.rb
deleted file mode 100644
index 64d3efd799..0000000000
--- a/sample/trick2015/ksk_1/entry.rb
+++ /dev/null
@@ -1 +0,0 @@
-%%%while eval '_=%%r%%(.)...\1=%%=~[%%%%,,,,,%%%s ?=]*%%%%%%#"]*%%%%3x+1?%%'.% %%",%*p(_||=eval($**%%%))
diff --git a/sample/trick2015/ksk_1/remarks.markdown b/sample/trick2015/ksk_1/remarks.markdown
deleted file mode 100644
index b822dc55c8..0000000000
--- a/sample/trick2015/ksk_1/remarks.markdown
+++ /dev/null
@@ -1,120 +0,0 @@
-### Remarks
-
-The program is run with a positive integer as an argument, e.g.,
-```shell
- ruby entry.rb 27
-```
-It has been confirmed to be run on
-```
- ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin11.4.2]
- ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
- ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
-```
-
-
-### Description
-
-The program prints a Collatz sequence started with a given number,
-that is, it repeatedly outputs numbers obtained by applying the
-following Half-Or-Triple-Plus-One (HOTPO) process to the previous
-number:
-
-> If the number is even, divide it by two, otherwise, multiply it by three and add one.
-
-until the number becomes 1. Collatz conjectured that no matter from
-the process starts it always eventually terminates. This is still
-an open problem, hence the program may not terminate for some
-numbers. It is known that there is no such exception below 2<sup>60</sup>.
-
-
-### Internals
-
-The source code does not contain either conditional branch or arithmetic operation.
-The trick shall be revealed step by step.
-
-First, the code is obfuscated by using `%`-notations,
-`*`(String#join), `%`-formatting, restructuring, and so on.
-Here is an equivalent readable program:
-```ruby
-n = ARGV[0].to_i
-begin
- # do nothing
-end while begin
- puts n
- n = (/(.)...\1=/ =~ eval('[",,,,,"'+ '",'*n + ' ?=].join#"].join("3x+1?")'))
-end
-```
-The line
-```ruby
- n = (/(.)...\1=/ =~ eval('[",,,,,"'+ '",'*n + ' ?=].join#"].join("3x+1?")'))
-```
-performs the HOTPO process.
-The `eval` expression here returns a string as explained in detail later.
-Since *regex*`=~`*str* returns index of first match of *regex* in *str*,
-the regular expression `(.)...\1` must match the string
-at index `n/2` if `n` is even and
-at `3*n+1` if `n` is odd greater than 1.
-The match must fail in the case of `n = 1` so that it returns `nil`.
-
-The key of simulating the even-odd conditional branch on `n` in the
-HOTPO process is an `n`-length sequence of the incomplete fragments
-`",` where the double-quote `"` changes its role of opening/closing
-string literals alternately. If `n` is even, the string in the `eval`
-expression is evaluated as
-```ruby
- => '[",,,,,"'+ '",' + '",' + '",' + ... + '",' + ' ?=].join#...'
- => '[",,,,,"",",",...", ?=].join#...'
-```
-where the last double-quote `"` is closing hence the code after `#` is
-ignored as comments. Note that `"ab""cd"` in Ruby is equivalent to
-`"abcd"`. Therefore the `eval` expression is evaluated into
-```ruby
- ",,,,,...,="
-```
-where the number of commas is `5+n/2`.
-As a result, the regular expression `(.)...\1=` matches `,,,,,=`
-at the end of string, that is, at index `5+n/2-5 = n/2`.
-
-If `n` is odd, the string in the `eval` expression is evaluated as
-```ruby
- => '[",,,,,"'+ '",' + '",' + '",' + '",' + ... + '",' + ' ?=].join#"].join("3x+1?")'
- => '[",,,,,"",",",",...,", ?=].join#"].join("3x+1?")'
-```
-where the last element in the array is `", ?=].join#"`. Threfore the
-`eval` expression is evaluated into
-```
- ",,,,,,3x+1?,3x+1?,...,3x+1?, ?=].join#"
-```
-where the number of `,3x+1?` is `(n-1)/2`. As a result, the regular
-expression `(.)...\1=` matches `?, ?=` at the almost end of string,
-that is, at index `5+(n-1)/2*6-1 = 3n+1`, provided that the match
-fails in the case of `n = 1` because the symbol `?` occurs only once
-in the string.
-
-One may notice that the string `3x+1` in the code could be other
-four-character words. I chose it because the Collatz conjecture is
-also called the 3x+1 problem.
-
-
-### Variant
-
-The Collatz conjecture is equivalently stated as,
-
-> no matter from the HOTPO process starts, it always eventually
- reaches the cycle of 4, 2, and 1
-
-instead of termination of the process at 1. This alternative
-statement makes the program simpler because we do not have to care the
-case of n = 1. It can be obtained by replacing the regular expression
-is simply `/=/` and removing a padding `",,,,,"`. The program no
-longer terminates, though.
-
-
-### Limination
-
-The implementation requires to manipulate long strings even for some
-small starting numbers. For example, starting from 1,819, the number
-will reach up to 1,276,936 which causes SystemStackError on Ruby 1.9.3.
-The program works on Ruby 2.0.0 and 2.2.3, though.
-
-
diff --git a/sample/trick2015/ksk_2/abnormal.cnf b/sample/trick2015/ksk_2/abnormal.cnf
deleted file mode 100644
index 084303f041..0000000000
--- a/sample/trick2015/ksk_2/abnormal.cnf
+++ /dev/null
@@ -1,6 +0,0 @@
-c Example CNF format file
-c
-p cnf 4 3
-1 3 -4 0
-4 0 2
--3
diff --git a/sample/trick2015/ksk_2/authors.markdown b/sample/trick2015/ksk_2/authors.markdown
deleted file mode 100644
index bd6d41f6c7..0000000000
--- a/sample/trick2015/ksk_2/authors.markdown
+++ /dev/null
@@ -1,3 +0,0 @@
-* Keisuke Nakano
- * ksk@github, ksknac@twitter
- * cctld: jp
diff --git a/sample/trick2015/ksk_2/entry.rb b/sample/trick2015/ksk_2/entry.rb
deleted file mode 100644
index 55b488e3a8..0000000000
--- a/sample/trick2015/ksk_2/entry.rb
+++ /dev/null
@@ -1 +0,0 @@
-_='s %sSATISFIABLE';puts eval$<.read.gsub(/.*p.*?(\d+).*?$|\d+/m){$1?%w[?-* +'=-'=~/#{'(-?)'* }-*=(?=]*$1:$&>?0?"\\#$&$|":'$)(?='}+')/x?[_%p%i=0,[*$~].map{|x|x>?-?:v:eval(x+?1)*i-=1}*" "]:_%:UN'
diff --git a/sample/trick2015/ksk_2/quinn.cnf b/sample/trick2015/ksk_2/quinn.cnf
deleted file mode 100644
index 556a9b33f5..0000000000
--- a/sample/trick2015/ksk_2/quinn.cnf
+++ /dev/null
@@ -1,21 +0,0 @@
-c quinn.cnf
-c
-p cnf 16 18
- 1 2 0
- -2 -4 0
- 3 4 0
- -4 -5 0
- 5 -6 0
- 6 -7 0
- 6 7 0
- 7 -16 0
- 8 -9 0
- -8 -14 0
- 9 10 0
- 9 -10 0
--10 -11 0
- 10 12 0
- 11 12 0
- 13 14 0
- 14 -15 0
- 15 16 0 \ No newline at end of file
diff --git a/sample/trick2015/ksk_2/remarks.markdown b/sample/trick2015/ksk_2/remarks.markdown
deleted file mode 100644
index bb9b705773..0000000000
--- a/sample/trick2015/ksk_2/remarks.markdown
+++ /dev/null
@@ -1,204 +0,0 @@
-### Remarks
-
-The program is run with a data file from the standard input, e.g.,
-```shell
- ruby entry.rb < data
-```
-where ``<`` can be omitted. The data file must be in the DIMACS CNF
-format (see Description for detail). It has been confirmed to be run on
-```
- ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin11.4.2]
- ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
- ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
-```
-For particular inputs, the program works differently on these environments
-(see Limitation).
-
-
-### Description
-
-The program is a very small SAT solver with 194 bytes making use of a
-powerful feature of Regexp matching in Ruby. It receives a data file
-from the standard input in the DIMACS CNF that is a standard format
-for inputs of SAT solvers. For example, the text in the DIMACS CNF
-format,
-```
-c
-c This is a sample input file.
-c
-p cnf 3 5
- 1 -2 3 0
--1 2 0
--2 -3 0
- 1 2 -3 0
- 1 3 0
-```
-corresponds to a propositional formula in conjunctive normal form,
-
- (L1 &or; &not;L2 &or; L3) &and;
- (&not;L1 &or; L2) &and;
- (&not;L2 &or; &not;L3) &and;
- (L1 &or; L2 &or; &not;L3) &and;
- (L1 &or; L3).
-
-In the DIMACS CNF format, the lines starting with ``c`` are comments
-that are allowed only before the line ``p cnf ...``. The line ``p cnf
-3 5`` represents that the problem is given in conjunctive normal form
-with 3 variables (L1,L2,and L3) and 5 clauses. A clause is given by a
-sequence of the indices of positive literals and the negative indices
-of negative literals. Each clause is terminated by ``0``. For the
-input above, the program outputs
-```
-s SATISFIABLE
-v 1 2 -3
-```
-because the formula is satisfiable by L1=true, L2=true, and L3=false.
-If an unsatisfiable formula is given, the program should output
-```
-s UNSATISFIABLE
-```
-This specification is common in most exiting SAT solvers and required
-for entries of [SAT competition](http://www.satcompetition.org/).
-
-The program is very small with no other external libraries thanks to
-the wealth of string manipulations in Ruby. It is much smaller than
-existing small SAT solvers like [minisat](http://minisat.se/) and
-[picosat](http://fmv.jku.at/picosat/)!
-
-
-### Internals
-
-The basic idea of the program is a translation from DIMACS CNF format
-into Ruby. For example, the data file above is translated into a
-``Regexp`` matching expression equivalent to
-```ruby
- '---=-' =~
- /(-?)(-?)(-?)-*=(?=\1$|-\2$|\3$|$)(?=-\1$|\2$|$)(?=-\2$|-\3$|$)(?=\1$|\2$|-\3$|$)(?=\1$|\3$|$)(?=)/
-```
-that returns ``MatchData`` if the formula is satisfiable and otherwise
-returns ``nil``. The beginning of regular expression
-``(-?)(-?)(-?)-*=`` matches a string ``"---="`` so that each
-capturing pattern ``(-?)`` matches either ``"-"`` or `""`, which
-corresponds to an assignment of true or false, respectively, for a
-propositional variable. Each clause is translated into positive
-lookahead assertion like ``(?=\1$|-\2$|\3$|$)`` that matches
-``"-"`` only when ``\1`` holds ``"-"``, ``\2`` holds ``""``, or ``\3``
-holds ``"-"``. This exactly corresponds to the condition for
-L1&or;&not;L2&or;L3 to be true. The last case ``|$`` never matches
-``"-"`` but it is required for making the translation simple.
-The last meaningless positive lookahead assertion ``(?=)`` is added
-for a similar reason. This translation is based on
-[Abigail's idea](http://perl.plover.com/NPC/NPC-3SAT.html) where a
-3SAT formula is translated into a similar Perl regular expression.
-The differences are the submitted Ruby program translates directly
-from the DIMACS CNF format and tries to make the code shorter by using
-lookahead assertion which can also make matching more faster.
-
-Thanks to the ``x`` option for regular expression, the input above is
-simply translated into
-```ruby
- ?-*3+'=-'=~/#{'(-?)'*3}-*=(?=
- \1$| -\2$| \3$| $)(?=
- -\1$| \2$| $)(?=
- -\2$| -\3$| $)(?=
- \1$| \2$| -\3$| $)(?=
- \1$| \3$| $)(?=
- )/x
-```
-which has a structure similar to the DIMACS CNF format.
-
-The part of formatting outputs in the program is obfuscated as an
-inevitable result of 'golfing' the original program
-```ruby
- if ...the matching expression above... then
- puts 's SATISFIABLE'
- puts 'v '+$~[1..-1].map.with_index{|x,i|
- if x == '-' then
- i+1
- else
- ['-',i+1].join
- end
- }.join(' ')
- else
- puts 's UNSATISFIABLE'
- end
-```
-In the satisfiable case, the MatchData ``$~`` obtained by the regular expression
-has the form of
-```
- #<MatchData "---=" 1:"-" 2:"-" 3:"">
-```
-which should be translated into a string ``1 2 -3``. The golfed code simply
-does it by `eval(x+?1)*i-=1` where ``x`` is matched string ``"x"`` or ``""``
-and ``i`` be a negated index.
-
-
-### Data files
-
-The submission includes some input files in the DIMACS CNF format for
-testing the program.
-
-* [sample.cnf](sample.cnf) : an example shown above.
-
-* [unsat.cnf](unsat.cnf) : an example of an unsatisfiable formula.
-
-* [quinn.cnf](quinn.cnf) : an example from Quinn's text, 16 variables and 18 clauses
- (available from [http://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html])
-
-* [abnormal.cnf](abnormal.cnf) : an example from [the unofficial manual of the DIMACS challenge](http://www.domagoj-babic.com/uploads/ResearchProjects/Spear/dimacs-cnf.pdf)
- where a single clause may be on multiple lines.
-
-* [uf20-01.cnf](uf20-01.cnf) : an example, with 20 variables and 91 clauses, from [SATLIB benchmark suite](http://www.cs.ubc.ca/~hoos/SATLIB/benchm.html). The last two lines are removed from the original because they are illegal in the DIMACS CNF format (all examples in 'Uniform Random-3-SAT' of the linked page need this modification).
-
-
-### Limitation
-
-The program may not work when the number of variables exceeds 99
-because ``\nnn`` in regular expression with number ``nnn`` does not
-always represent backreference but octal notation of characters. For
-example,
-```ruby
- /#{"(x)"*999}:\502/=~"x"*999+":x"
- /#{"(x)"*999}:\661/=~"x"*999+":x"
- /#{"(x)"*999}:\775/=~"x"*999+":x"
-```
-fail due to the syntax error (invalid escape), while
-```ruby
- /#{"(x)"*999}:\508/=~"x"*999+":x"
- /#{"(x)"*999}:\691/=~"x"*999+":x"
- /#{"(x)"*999}:\785/=~"x"*999+":x"
-```
-succeed (to return 0) because 508, 691, and 785 are not in octal notation.
-Since Ruby 1.9.3 incorrectly returns ``nil`` instead of terminating
-with the error for
-```ruby
- /#{"(x)"*999}:\201/=~"x"*999+":x"
- /#{"(x)"*999}:\325/=~"x"*999+":x"
-```
-the present SAT solver may unexpectedly return "UNSATISFIABLE" even
-for satisfiable inputs. This happens when the number is in octal
-notation starting with either 2 or 3.
-
-In the case of the number starting with 1, the code like the above
-does work on all versions of Ruby I tried. For example,
-```ruby
- /#{"(x)"*999}:\101/=~"x"*999+":x"
- /#{"(x)"*999}:\177/=~"x"*999+":x"
-```
-succeed (to return 0). Interestingly,
-```ruby
- /#{"(x)"*999}:\101/=~"x"*999+":\101"
- /#{"(x)"*999}:\177/=~"x"*999+":\177"
-```
-return ``nil``, while
-```ruby
- /:\101/=~":\101"
- /:\177/=~":\177"
-```
-succeed to return 0. The meaning of ``\1nn`` in regular expression
-seems to depend on the existence of capturing expressions.
-
-In spite of these Ruby's behaviors, we have a good news! The present
-SAT sover does not suffer from the issues because the program cannot
-return solutions in practical time for inputs with variables more than
-40. \ No newline at end of file
diff --git a/sample/trick2015/ksk_2/sample.cnf b/sample/trick2015/ksk_2/sample.cnf
deleted file mode 100644
index 295f81c942..0000000000
--- a/sample/trick2015/ksk_2/sample.cnf
+++ /dev/null
@@ -1,9 +0,0 @@
-c
-c This is a sample input file.
-c
-p cnf 3 5
- 1 -2 3 0
--1 2 0
--2 -3 0
- 1 2 -3 0
- 1 3 0
diff --git a/sample/trick2015/ksk_2/uf20-01.cnf b/sample/trick2015/ksk_2/uf20-01.cnf
deleted file mode 100644
index 0d9503c451..0000000000
--- a/sample/trick2015/ksk_2/uf20-01.cnf
+++ /dev/null
@@ -1,99 +0,0 @@
-c This Formular is generated by mcnf
-c
-c horn? no
-c forced? no
-c mixed sat? no
-c clause length = 3
-c
-p cnf 20 91
- 4 -18 19 0
-3 18 -5 0
--5 -8 -15 0
--20 7 -16 0
-10 -13 -7 0
--12 -9 17 0
-17 19 5 0
--16 9 15 0
-11 -5 -14 0
-18 -10 13 0
--3 11 12 0
--6 -17 -8 0
--18 14 1 0
--19 -15 10 0
-12 18 -19 0
--8 4 7 0
--8 -9 4 0
-7 17 -15 0
-12 -7 -14 0
--10 -11 8 0
-2 -15 -11 0
-9 6 1 0
--11 20 -17 0
-9 -15 13 0
-12 -7 -17 0
--18 -2 20 0
-20 12 4 0
-19 11 14 0
--16 18 -4 0
--1 -17 -19 0
--13 15 10 0
--12 -14 -13 0
-12 -14 -7 0
--7 16 10 0
-6 10 7 0
-20 14 -16 0
--19 17 11 0
--7 1 -20 0
--5 12 15 0
--4 -9 -13 0
-12 -11 -7 0
--5 19 -8 0
-1 16 17 0
-20 -14 -15 0
-13 -4 10 0
-14 7 10 0
--5 9 20 0
-10 1 -19 0
--16 -15 -1 0
-16 3 -11 0
--15 -10 4 0
-4 -15 -3 0
--10 -16 11 0
--8 12 -5 0
-14 -6 12 0
-1 6 11 0
--13 -5 -1 0
--7 -2 12 0
-1 -20 19 0
--2 -13 -8 0
-15 18 4 0
--11 14 9 0
--6 -15 -2 0
-5 -12 -15 0
--6 17 5 0
--13 5 -19 0
-20 -1 14 0
-9 -17 15 0
--5 19 -18 0
--12 8 -10 0
--18 14 -4 0
-15 -9 13 0
-9 -5 -1 0
-10 -19 -14 0
-20 9 4 0
--9 -2 19 0
--5 13 -17 0
-2 -10 -18 0
--18 3 11 0
-7 -9 17 0
--15 -6 -3 0
--2 3 -13 0
-12 3 -2 0
--2 -3 17 0
-20 -15 -16 0
--5 -17 -19 0
--20 -18 11 0
--9 1 -5 0
--19 9 17 0
-12 -2 17 0
-4 -16 -5 0
diff --git a/sample/trick2015/ksk_2/unsat.cnf b/sample/trick2015/ksk_2/unsat.cnf
deleted file mode 100644
index 7283933a9f..0000000000
--- a/sample/trick2015/ksk_2/unsat.cnf
+++ /dev/null
@@ -1,11 +0,0 @@
-c
-c This is a sample input file.
-c (unsatisfiable)
-c
-p cnf 3 5
-1 -2 3 0
--1 2 0
--2 -3 0
-1 2 -3 0
-1 3 0
--1 -2 3 0
diff --git a/sample/trick2015/monae/authors.markdown b/sample/trick2015/monae/authors.markdown
deleted file mode 100644
index 58d63b16ac..0000000000
--- a/sample/trick2015/monae/authors.markdown
+++ /dev/null
@@ -1 +0,0 @@
-monae (@monae, jp)
diff --git a/sample/trick2015/monae/entry.rb b/sample/trick2015/monae/entry.rb
deleted file mode 100644
index 6961df21cd..0000000000
--- a/sample/trick2015/monae/entry.rb
+++ /dev/null
@@ -1,26 +0,0 @@
- ;; ;; ;; ;;
- ;; ;; ;; ;;
- ;;eval$s =%q[i=1#
- eval(%q[ xxxxxxxx
- xx xxxx xx xx xxxx xx
- xx xxxx xx xx xxxx xx
- xxxxxxxx xxxxxxxx
- xxxxxxxx xxxxxxxx
- xx xx xxxxxxxxxx xx xxxxxxxx
- j, t, p=0,[?;]," ev al$s=%qx
-[#$s]".split*"";i,j,t=i-j,i+j,(x
- [b=?\s]*j.abs+t).map{|s|r=t.shix
-ft ||b;r.gsub!(?;){p.slice!0}if $x
- f| |=p>p=p.center(i*i+j*j,?;);r ,x
- s=[s,r]if(i*j<0);(b*i.abs+s).ljx
- ust(r.size).gsub(b){r[$`.size]|x
- |b}}unti l$ f;puts(t)# xx xx
- xxxxxxxx xx xxxxxxxxxx xx xx
-xxxxxxxx xxxxxxxx
- xxxxxxxx xxxxxxxx
-xx xxxx xx xx xxxx xx
- xx xxxx xx xx xxxx xx
- xxxxxxxx x].gsub\
- /x.*|\s/ ,"")#];;
- ;; ;; ;; ;;
- ;; ;; ;; ;;
diff --git a/sample/trick2015/monae/remarks.markdown b/sample/trick2015/monae/remarks.markdown
deleted file mode 100644
index 48be61bd12..0000000000
--- a/sample/trick2015/monae/remarks.markdown
+++ /dev/null
@@ -1,25 +0,0 @@
-
-# How to run
-
-```
-ruby entry.rb
-ruby entry.rb | ruby
-ruby entry.rb | ruby | ruby
-ruby entry.rb | ruby | ruby | ruby
-...
-```
-
-Confirmed on the following environments:
-- ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
-- ruby 2.0.0p353 (2013-11-22) [i386-mingw32]
-
-# Description
-
-A simple quine which prints itself twice
-on a slightly complex base.
-
-> geminum caput amphisbaenae, hoc est et a cauda,
-> tamquam parum esset uno ore fundi venenum.
-> aliis squamas esse, aliis picturas, omnibus exitiale virus.
->
-> &mdash; <cite>GAIUS PLINIUS SECUNDUS, Naturalis Historia 8.85.1</cite>
diff --git a/signal.c b/signal.c
index e5468efb53..075738576b 100644
--- a/signal.c
+++ b/signal.c
@@ -11,22 +11,17 @@
**********************************************************************/
-#include "internal.h"
+#include "ruby/ruby.h"
#include "vm_core.h"
#include <signal.h>
#include <stdio.h>
#include <errno.h>
#include "ruby_atomic.h"
#include "eval_intern.h"
+#include "internal.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-#ifdef HAVE_UCONTEXT_H
-#include <ucontext.h>
-#endif
#ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
@@ -41,8 +36,9 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif
-extern ID ruby_static_id_signo;
-#define id_signo ruby_static_id_signo
+#if defined(__native_client__) && defined(NACL_NEWLIB)
+# include "nacl/signal.h"
+#endif
#ifdef NEED_RUBY_ATOMIC_OPS
rb_atomic_t
@@ -65,6 +61,10 @@ ruby_atomic_compare_and_swap(rb_atomic_t *ptr, rb_atomic_t cmp,
}
#endif
+#if defined(__BEOS__) || defined(__HAIKU__)
+#undef SIGBUS
+#endif
+
#ifndef NSIG
# define NSIG (_SIGMAX + 1) /* For QNX */
#endif
@@ -234,10 +234,9 @@ signo2signm(int no)
/*
* call-seq:
- * Signal.signame(signo) -> string or nil
+ * Signal.signame(signo) -> string
*
- * Convert signal number to signal name.
- * Returns +nil+ if the signo is an invalid signal number.
+ * convert signal number to signal name
*
* Signal.trap("INT") { |signo| puts Signal.signame(signo) }
* Process.kill("INT", 0)
@@ -250,7 +249,6 @@ static VALUE
sig_signame(VALUE recv, VALUE signo)
{
const char *signame = signo2signm(NUM2INT(signo));
- if (!signame) return Qnil;
return rb_str_new_cstr(signame);
}
@@ -260,18 +258,6 @@ ruby_signal_name(int no)
return signo2signm(no);
}
-static VALUE
-rb_signo2signm(int signo)
-{
- const char *const signm = signo2signm(signo);
- if (signm) {
- return rb_sprintf("SIG%s", signm);
- }
- else {
- return rb_sprintf("SIG%u", signo);
- }
-}
-
/*
* call-seq:
* SignalException.new(sig_name) -> signal_exception
@@ -304,7 +290,13 @@ esignal_init(int argc, VALUE *argv, VALUE self)
sig = argv[1];
}
else {
- sig = rb_signo2signm(signo);
+ signm = signo2signm(signo);
+ if (signm) {
+ sig = rb_sprintf("SIG%s", signm);
+ }
+ else {
+ sig = rb_sprintf("SIG%u", signo);
+ }
}
}
else {
@@ -323,7 +315,7 @@ esignal_init(int argc, VALUE *argv, VALUE self)
sig = rb_sprintf("SIG%s", signm);
}
rb_call_super(1, &sig);
- rb_ivar_set(self, id_signo, INT2NUM(signo));
+ rb_iv_set(self, "signo", INT2NUM(signo));
return self;
}
@@ -338,7 +330,7 @@ esignal_init(int argc, VALUE *argv, VALUE self)
static VALUE
esignal_signo(VALUE self)
{
- return rb_ivar_get(self, id_signo);
+ return rb_iv_get(self, "signo");
}
/* :nodoc: */
@@ -359,13 +351,12 @@ ruby_default_signal(int sig)
raise(sig);
}
-static RETSIGTYPE sighandler(int sig);
static int signal_ignored(int sig);
static void signal_enque(int sig);
/*
* call-seq:
- * Process.kill(signal, pid, ...) -> integer
+ * Process.kill(signal, pid, ...) -> fixnum
*
* Sends the given signal to the specified process id(s) if _pid_ is positive.
* If _pid_ is zero _signal_ is sent to all processes whose group ID is equal
@@ -373,8 +364,6 @@ static void signal_enque(int sig);
* a POSIX signal name (either with or without a +SIG+ prefix). If _signal_ is
* negative (or starts with a minus sign), kills process groups instead of
* processes. Not all signals are available on all platforms.
- * The keys and values of +Signal.list+ are known signal names and numbers,
- * respectively.
*
* pid = fork do
* Signal.trap("HUP") { puts "Ouch!"; exit }
@@ -411,6 +400,7 @@ rb_f_kill(int argc, const VALUE *argv)
VALUE str;
const char *s;
+ rb_secure(2);
rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS);
switch (TYPE(argv[0])) {
@@ -469,7 +459,6 @@ rb_f_kill(int argc, const VALUE *argv)
rb_pid_t pid = NUM2PIDT(argv[i]);
if ((sig != 0) && (self != -1) && (pid == self)) {
- int t;
/*
* When target pid is self, many caller assume signal will be
* delivered immediately and synchronously.
@@ -482,24 +471,13 @@ rb_f_kill(int argc, const VALUE *argv)
#ifdef SIGKILL
case SIGKILL:
#endif
-#ifdef SIGILL
- case SIGILL:
-#endif
-#ifdef SIGFPE
- case SIGFPE:
-#endif
#ifdef SIGSTOP
case SIGSTOP:
#endif
- kill(pid, sig);
+ ruby_kill(pid, sig);
break;
default:
- t = signal_ignored(sig);
- if (t) {
- if (t < 0 && kill(pid, sig))
- rb_sys_fail(0);
- break;
- }
+ if (signal_ignored(sig)) break;
signal_enque(sig);
wakeup = 1;
}
@@ -544,7 +522,7 @@ int
rb_sigaltstack_size(void)
{
/* XXX: BSD_vfprintf() uses >1500KiB stack and x86-64 need >5KiB stack. */
- int size = 16*1024;
+ int size = 8192;
#ifdef MINSIGSTKSZ
if (size < MINSIGSTKSZ)
@@ -622,14 +600,14 @@ ruby_signal(int signum, sighandler_t handler)
}
(void)VALGRIND_MAKE_MEM_DEFINED(&old, sizeof(old));
if (sigaction(signum, &sigact, &old) < 0) {
- return SIG_ERR;
+ if (errno != 0 && errno != EINVAL) {
+ rb_bug_errno("sigaction", errno);
+ }
}
if (old.sa_flags & SA_SIGINFO)
- handler = (sighandler_t)old.sa_sigaction;
+ return (sighandler_t)old.sa_sigaction;
else
- handler = old.sa_handler;
- ASSUME(handler != SIG_ERR);
- return handler;
+ return old.sa_handler;
}
sighandler_t
@@ -638,17 +616,6 @@ posix_signal(int signum, sighandler_t handler)
return ruby_signal(signum, handler);
}
-#elif defined _WIN32
-static inline sighandler_t
-ruby_signal(int signum, sighandler_t handler)
-{
- if (signum == SIGKILL) {
- errno = EINVAL;
- return SIG_ERR;
- }
- return signal(signum, handler);
-}
-
#else /* !POSIX_SIGNAL */
#define ruby_signal(sig,handler) (/* rb_trap_accept_nativethreads[(sig)] = 0,*/ signal((sig),(handler)))
#if 0 /* def HAVE_NATIVETHREAD */
@@ -667,19 +634,16 @@ ruby_nativethread_signal(int signum, sighandler_t handler)
static int
signal_ignored(int sig)
{
- sighandler_t func;
#ifdef POSIX_SIGNAL
struct sigaction old;
(void)VALGRIND_MAKE_MEM_DEFINED(&old, sizeof(old));
if (sigaction(sig, NULL, &old) < 0) return FALSE;
- func = old.sa_handler;
+ return old.sa_handler == SIG_IGN;
#else
sighandler_t old = signal(sig, SIG_DFL);
signal(sig, old);
- func = old;
+ return old == SIG_IGN;
#endif
- if (func == SIG_IGN) return 1;
- return func == sighandler ? 0 : -1;
}
static void
@@ -692,15 +656,11 @@ signal_enque(int sig)
static RETSIGTYPE
sighandler(int sig)
{
- int old_errnum = errno;
-
signal_enque(sig);
rb_thread_wakeup_timer_thread();
#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
ruby_signal(sig, sighandler);
#endif
-
- errno = old_errnum;
}
int
@@ -751,160 +711,97 @@ rb_get_next_signal(void)
return sig;
}
-#if defined SIGSEGV || defined SIGBUS || defined SIGILL || defined SIGFPE
-static const char *received_signal;
-# define clear_received_signal() (void)(ruby_disable_gc = 0, received_signal = 0)
-#else
-# define clear_received_signal() ((void)0)
-#endif
#if defined(USE_SIGALTSTACK) || defined(_WIN32)
-NORETURN(void rb_ec_stack_overflow(rb_execution_context_t *ec, int crit));
-# if defined __HAIKU__
-# define USE_UCONTEXT_REG 1
-# elif !(defined(HAVE_UCONTEXT_H) && (defined __i386__ || defined __x86_64__ || defined __amd64__))
-# elif defined __linux__
-# define USE_UCONTEXT_REG 1
-# elif defined __APPLE__
-# define USE_UCONTEXT_REG 1
-# elif defined __FreeBSD__
-# define USE_UCONTEXT_REG 1
-# endif
-#if defined(HAVE_PTHREAD_SIGMASK)
-# define ruby_sigunmask pthread_sigmask
-#elif defined(HAVE_SIGPROCMASK)
-# define ruby_sigunmask sigprocmask
-#endif
+NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
+#if !(defined(HAVE_UCONTEXT_H) && (defined __i386__ || defined __x86_64__))
+#elif defined __linux__
+# define USE_UCONTEXT_REG 1
+#elif defined __APPLE__
+# define USE_UCONTEXT_REG 1
+#endif
+#ifdef USE_UCONTEXT_REG
static void
-reset_sigmask(int sig)
+check_stack_overflow(const uintptr_t addr, const ucontext_t *ctx)
{
-#if defined(ruby_sigunmask)
- sigset_t mask;
-#endif
- clear_received_signal();
-#if defined(ruby_sigunmask)
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- if (ruby_sigunmask(SIG_UNBLOCK, &mask, NULL)) {
- rb_bug_errno(STRINGIZE(ruby_sigunmask)":unblock", errno);
- }
-#endif
-}
-
-# ifdef USE_UCONTEXT_REG
-static void
-check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx)
-{
- const DEFINE_MCONTEXT_PTR(mctx, ctx);
# if defined __linux__
+ const mcontext_t *mctx = &ctx->uc_mcontext;
# if defined REG_RSP
const greg_t sp = mctx->gregs[REG_RSP];
- const greg_t bp = mctx->gregs[REG_RBP];
# else
const greg_t sp = mctx->gregs[REG_ESP];
- const greg_t bp = mctx->gregs[REG_EBP];
# endif
# elif defined __APPLE__
+ const mcontext_t mctx = ctx->uc_mcontext;
# if defined(__LP64__)
const uintptr_t sp = mctx->__ss.__rsp;
- const uintptr_t bp = mctx->__ss.__rbp;
# else
const uintptr_t sp = mctx->__ss.__esp;
- const uintptr_t bp = mctx->__ss.__ebp;
-# endif
-# elif defined __FreeBSD__
-# if defined(__amd64__)
- const __register_t sp = mctx->mc_rsp;
- const __register_t bp = mctx->mc_rbp;
-# else
- const __register_t sp = mctx->mc_esp;
- const __register_t bp = mctx->mc_ebp;
-# endif
-# elif defined __HAIKU__
-# if defined(__amd64__)
- const unsigned long sp = mctx->rsp;
- const unsigned long bp = mctx->rbp;
-# else
- const unsigned long sp = mctx->esp;
- const unsigned long bp = mctx->ebp;
# endif
# endif
enum {pagesize = 4096};
const uintptr_t sp_page = (uintptr_t)sp / pagesize;
- const uintptr_t bp_page = (uintptr_t)bp / pagesize;
const uintptr_t fault_page = addr / pagesize;
/* SP in ucontext is not decremented yet when `push` failed, so
* the fault page can be the next. */
- if (sp_page == fault_page || sp_page == fault_page + 1 ||
- sp_page <= fault_page && fault_page <= bp_page) {
- rb_execution_context_t *ec = GET_EC();
- int crit = FALSE;
- if ((uintptr_t)ec->tag->buf / pagesize <= fault_page + 1) {
+ if (sp_page == fault_page || sp_page == fault_page + 1) {
+ rb_thread_t *th = ruby_current_thread;
+ if ((uintptr_t)th->tag->buf / pagesize == sp_page) {
/* drop the last tag if it is close to the fault,
* otherwise it can cause stack overflow again at the same
* place. */
- ec->tag = ec->tag->prev;
- crit = TRUE;
+ th->tag = th->tag->prev;
}
- reset_sigmask(sig);
- rb_ec_stack_overflow(ec, crit);
+ ruby_thread_stack_overflow(th);
}
}
-# else
+#else
static void
-check_stack_overflow(int sig, const void *addr)
+check_stack_overflow(const void *addr)
{
int ruby_stack_overflowed_p(const rb_thread_t *, const void *);
- rb_thread_t *th = GET_THREAD();
+ rb_thread_t *th = ruby_current_thread;
if (ruby_stack_overflowed_p(th, addr)) {
- reset_sigmask(sig);
- rb_ec_stack_overflow(th->ec, FALSE);
+ ruby_thread_stack_overflow(th);
}
}
-# endif
-# ifdef _WIN32
-# define CHECK_STACK_OVERFLOW() check_stack_overflow(sig, 0)
-# else
-# define FAULT_ADDRESS info->si_addr
-# ifdef USE_UCONTEXT_REG
-# define CHECK_STACK_OVERFLOW() check_stack_overflow(sig, (uintptr_t)FAULT_ADDRESS, ctx)
-# else
-# define CHECK_STACK_OVERFLOW() check_stack_overflow(sig, FAULT_ADDRESS)
-# endif
-# define MESSAGE_FAULT_ADDRESS " at %p", FAULT_ADDRESS
-# endif
+#endif
+#ifdef _WIN32
+#define CHECK_STACK_OVERFLOW() check_stack_overflow(0)
#else
-# define CHECK_STACK_OVERFLOW() (void)0
+#define FAULT_ADDRESS info->si_addr
+# ifdef USE_UCONTEXT_REG
+# define CHECK_STACK_OVERFLOW() check_stack_overflow((uintptr_t)FAULT_ADDRESS, ctx)
+#else
+# define CHECK_STACK_OVERFLOW() check_stack_overflow(FAULT_ADDRESS)
+#endif
+#define MESSAGE_FAULT_ADDRESS " at %p", FAULT_ADDRESS
+#endif
+#else
+#define CHECK_STACK_OVERFLOW() (void)0
#endif
#ifndef MESSAGE_FAULT_ADDRESS
-# define MESSAGE_FAULT_ADDRESS
+#define MESSAGE_FAULT_ADDRESS
#endif
-#if defined SIGSEGV || defined SIGBUS || defined SIGILL || defined SIGFPE
-NOINLINE(static void check_reserved_signal_(const char *name, size_t name_len));
-/* noinine to reduce stack usage in signal handers */
-
-#define check_reserved_signal(name) check_reserved_signal_(name, sizeof(name)-1)
-
#ifdef SIGBUS
static RETSIGTYPE
sigbus(int sig SIGINFO_ARG)
{
- check_reserved_signal("BUS");
/*
* Mac OS X makes KERN_PROTECTION_FAILURE when thread touch guard page.
* and it's delivered as SIGBUS instead of SIGSEGV to userland. It's crazy
* wrong IMHO. but anyway we have to care it. Sigh.
*/
- /* Seems Linux also delivers SIGBUS. */
-#if defined __APPLE__ || defined __linux__
+#if defined __APPLE__
CHECK_STACK_OVERFLOW();
#endif
rb_bug_context(SIGINFO_CTX, "Bus Error" MESSAGE_FAULT_ADDRESS);
}
#endif
+#ifdef SIGSEGV
static void
ruby_abort(void)
{
@@ -919,77 +816,34 @@ ruby_abort(void)
}
-#ifdef SIGSEGV
-static RETSIGTYPE
-sigsegv(int sig SIGINFO_ARG)
-{
- check_reserved_signal("SEGV");
- CHECK_STACK_OVERFLOW();
- rb_bug_context(SIGINFO_CTX, "Segmentation fault" MESSAGE_FAULT_ADDRESS);
-}
-#endif
+static int segv_received = 0;
+extern int ruby_disable_gc;
-#ifdef SIGILL
static RETSIGTYPE
-sigill(int sig SIGINFO_ARG)
-{
- check_reserved_signal("ILL");
-#if defined __APPLE__
- CHECK_STACK_OVERFLOW();
-#endif
- rb_bug_context(SIGINFO_CTX, "Illegal instruction" MESSAGE_FAULT_ADDRESS);
-}
-#endif
-
-static void
-check_reserved_signal_(const char *name, size_t name_len)
+sigsegv(int sig SIGINFO_ARG)
{
- const char *prev = ATOMIC_PTR_EXCHANGE(received_signal, name);
-
- if (prev) {
+ if (segv_received) {
ssize_t RB_UNUSED_VAR(err);
-#define NOZ(name, str) name[sizeof(str)-1] = str
- static const char NOZ(msg1, " received in ");
- static const char NOZ(msg2, " handler\n");
-
-#ifdef HAVE_WRITEV
- struct iovec iov[4];
-
- iov[0].iov_base = (void *)name;
- iov[0].iov_len = name_len;
- iov[1].iov_base = (void *)msg1;
- iov[1].iov_len = sizeof(msg1);
- iov[2].iov_base = (void *)prev;
- iov[2].iov_len = strlen(prev);
- iov[3].iov_base = (void *)msg2;
- iov[3].iov_len = sizeof(msg2);
- err = writev(2, iov, 4);
-#else
- err = write(2, name, name_len);
- err = write(2, msg1, sizeof(msg1));
- err = write(2, prev, strlen(prev));
- err = write(2, msg2, sizeof(msg2));
-#endif
+ static const char msg[] = "SEGV received in SEGV handler\n";
+
+ err = write(2, msg, sizeof(msg));
ruby_abort();
}
- ruby_disable_gc = 1;
-}
-#endif
+ CHECK_STACK_OVERFLOW();
-#if defined SIGPIPE || defined SIGSYS
-static RETSIGTYPE
-sig_do_nothing(int sig)
-{
+ segv_received = 1;
+ ruby_disable_gc = 1;
+ rb_bug_context(SIGINFO_CTX, "Segmentation fault" MESSAGE_FAULT_ADDRESS);
}
#endif
static void
signal_exec(VALUE cmd, int safe, int sig)
{
- rb_execution_context_t *ec = GET_EC();
- volatile unsigned long old_interrupt_mask = ec->interrupt_mask;
- enum ruby_tag_type state;
+ rb_thread_t *cur_th = GET_THREAD();
+ volatile unsigned long old_interrupt_mask = cur_th->interrupt_mask;
+ int state;
/*
* workaround the following race:
@@ -1000,19 +854,19 @@ signal_exec(VALUE cmd, int safe, int sig)
if (IMMEDIATE_P(cmd))
return;
- ec->interrupt_mask |= TRAP_INTERRUPT_MASK;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
+ cur_th->interrupt_mask |= TRAP_INTERRUPT_MASK;
+ TH_PUSH_TAG(cur_th);
+ if ((state = EXEC_TAG()) == 0) {
VALUE signum = INT2NUM(sig);
rb_eval_cmd(cmd, rb_ary_new3(1, signum), safe);
}
- EC_POP_TAG();
- ec = GET_EC();
- ec->interrupt_mask = old_interrupt_mask;
+ TH_POP_TAG();
+ cur_th = GET_THREAD();
+ cur_th->interrupt_mask = old_interrupt_mask;
if (state) {
/* XXX: should be replaced with rb_threadptr_pending_interrupt_enque() */
- EC_JUMP_TAG(ec, state);
+ JUMP_TAG(state);
}
}
@@ -1020,11 +874,11 @@ void
rb_trap_exit(void)
{
rb_vm_t *vm = GET_VM();
- VALUE trap_exit = vm->trap_list.cmd[0];
+ VALUE trap_exit = vm->trap_list[0].cmd;
if (trap_exit) {
- vm->trap_list.cmd[0] = 0;
- signal_exec(trap_exit, vm->trap_list.safe[0], 0);
+ vm->trap_list[0].cmd = 0;
+ signal_exec(trap_exit, vm->trap_list[0].safe, 0);
}
}
@@ -1032,8 +886,8 @@ void
rb_signal_exec(rb_thread_t *th, int sig)
{
rb_vm_t *vm = GET_VM();
- VALUE cmd = vm->trap_list.cmd[sig];
- int safe = vm->trap_list.safe[sig];
+ VALUE cmd = vm->trap_list[sig].cmd;
+ int safe = vm->trap_list[sig].safe;
if (cmd == 0) {
switch (sig) {
@@ -1108,12 +962,7 @@ default_handler(int sig)
#endif
#ifdef SIGPIPE
case SIGPIPE:
- func = sig_do_nothing;
- break;
-#endif
-#ifdef SIGSYS
- case SIGSYS:
- func = sig_do_nothing;
+ func = SIG_IGN;
break;
#endif
default:
@@ -1140,43 +989,40 @@ trap_handler(VALUE *cmd, int sig)
if (!command) rb_raise(rb_eArgError, "bad handler");
}
if (!NIL_P(command)) {
- const char *cptr;
- long len;
SafeStringValue(command); /* taint check */
*cmd = command;
- RSTRING_GETMEM(command, cptr, len);
- switch (len) {
+ switch (RSTRING_LEN(command)) {
case 0:
goto sig_ign;
break;
case 14:
- if (memcmp(cptr, "SYSTEM_DEFAULT", 14) == 0) {
+ if (strncmp(RSTRING_PTR(command), "SYSTEM_DEFAULT", 14) == 0) {
func = SIG_DFL;
*cmd = 0;
}
break;
case 7:
- if (memcmp(cptr, "SIG_IGN", 7) == 0) {
+ if (strncmp(RSTRING_PTR(command), "SIG_IGN", 7) == 0) {
sig_ign:
func = SIG_IGN;
*cmd = Qtrue;
}
- else if (memcmp(cptr, "SIG_DFL", 7) == 0) {
+ else if (strncmp(RSTRING_PTR(command), "SIG_DFL", 7) == 0) {
sig_dfl:
func = default_handler(sig);
*cmd = 0;
}
- else if (memcmp(cptr, "DEFAULT", 7) == 0) {
+ else if (strncmp(RSTRING_PTR(command), "DEFAULT", 7) == 0) {
goto sig_dfl;
}
break;
case 6:
- if (memcmp(cptr, "IGNORE", 6) == 0) {
+ if (strncmp(RSTRING_PTR(command), "IGNORE", 6) == 0) {
goto sig_ign;
}
break;
case 4:
- if (memcmp(cptr, "EXIT", 4) == 0) {
+ if (strncmp(RSTRING_PTR(command), "EXIT", 4) == 0) {
*cmd = Qundef;
}
break;
@@ -1235,18 +1081,12 @@ trap(int sig, sighandler_t func, VALUE command)
rb_vm_t *vm = GET_VM();
/*
- * Be careful. ruby_signal() and trap_list.cmd[sig] must be changed
+ * Be careful. ruby_signal() and trap_list[sig].cmd must be changed
* atomically. In current implementation, we only need to don't call
* RUBY_VM_CHECK_INTS().
*/
- if (sig == 0) {
- oldfunc = SIG_ERR;
- }
- else {
- oldfunc = ruby_signal(sig, func);
- if (oldfunc == SIG_ERR) rb_sys_fail_str(rb_signo2signm(sig));
- }
- oldcmd = vm->trap_list.cmd[sig];
+ oldfunc = ruby_signal(sig, func);
+ oldcmd = vm->trap_list[sig].cmd;
switch (oldcmd) {
case 0:
case Qtrue:
@@ -1262,8 +1102,8 @@ trap(int sig, sighandler_t func, VALUE command)
break;
}
- vm->trap_list.cmd[sig] = command;
- vm->trap_list.safe[sig] = rb_safe_level();
+ vm->trap_list[sig].cmd = command;
+ vm->trap_list[sig].safe = rb_safe_level();
return oldcmd;
}
@@ -1336,6 +1176,7 @@ sig_trap(int argc, VALUE *argv)
sighandler_t func;
VALUE cmd;
+ rb_secure(2);
rb_check_arity(argc, 1, 2);
sig = trap_signm(argv[0]);
@@ -1379,53 +1220,42 @@ sig_list(void)
const struct signals *sigs;
for (sigs = siglist; sigs->signm; sigs++) {
- rb_hash_aset(h, rb_fstring_cstr(sigs->signm), INT2FIX(sigs->signo));
+ rb_hash_aset(h, rb_str_new2(sigs->signm), INT2FIX(sigs->signo));
}
return h;
}
-#define INSTALL_SIGHANDLER(cond, signame, signum) do { \
- static const char failed[] = "failed to install "signame" handler"; \
- if (!(cond)) break; \
- if (reserved_signal_p(signum)) rb_bug(failed); \
- perror(failed); \
- } while (0)
-static int
+static void
install_sighandler(int signum, sighandler_t handler)
{
sighandler_t old;
+ /* At this time, there is no subthread. Then sigmask guarantee atomics. */
+ rb_disable_interrupt();
old = ruby_signal(signum, handler);
- if (old == SIG_ERR) return -1;
/* signal handler should be inherited during exec. */
if (old != SIG_DFL) {
ruby_signal(signum, old);
}
- return 0;
+ rb_enable_interrupt();
}
-# define install_sighandler(signum, handler) \
- INSTALL_SIGHANDLER(install_sighandler(signum, handler), #signum, signum)
-
#if defined(SIGCLD) || defined(SIGCHLD)
-static int
+static void
init_sigchld(int sig)
{
sighandler_t oldfunc;
+ rb_disable_interrupt();
oldfunc = ruby_signal(sig, SIG_DFL);
- if (oldfunc == SIG_ERR) return -1;
if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) {
ruby_signal(sig, oldfunc);
}
else {
- GET_VM()->trap_list.cmd[sig] = 0;
+ GET_VM()->trap_list[sig].cmd = 0;
}
- return 0;
+ rb_enable_interrupt();
}
-
-# define init_sigchld(signum) \
- INSTALL_SIGHANDLER(init_sigchld(signum), #signum, signum)
#endif
void
@@ -1441,6 +1271,9 @@ ruby_sig_finalize(void)
int ruby_enable_coredump = 0;
+#ifndef RUBY_DEBUG_ENV
+#define ruby_enable_coredump 0
+#endif
/*
* Many operating systems allow signals to be sent to running
@@ -1494,9 +1327,6 @@ Init_signal(void)
rb_alias(rb_eSignal, rb_intern_const("signm"), rb_intern_const("message"));
rb_define_method(rb_eInterrupt, "initialize", interrupt_init, -1);
- /* At this time, there is no subthread. Then sigmask guarantee atomics. */
- rb_disable_interrupt();
-
install_sighandler(SIGINT, sighandler);
#ifdef SIGHUP
install_sighandler(SIGHUP, sighandler);
@@ -1521,9 +1351,6 @@ Init_signal(void)
#ifdef SIGBUS
install_sighandler(SIGBUS, (sighandler_t)sigbus);
#endif
-#ifdef SIGILL
- install_sighandler(SIGILL, (sighandler_t)sigill);
-#endif
#ifdef SIGSEGV
# ifdef USE_SIGALTSTACK
rb_register_sigaltstack(GET_THREAD());
@@ -1532,10 +1359,7 @@ Init_signal(void)
#endif
}
#ifdef SIGPIPE
- install_sighandler(SIGPIPE, sig_do_nothing);
-#endif
-#ifdef SIGSYS
- install_sighandler(SIGSYS, sig_do_nothing);
+ install_sighandler(SIGPIPE, SIG_IGN);
#endif
#if defined(SIGCLD)
@@ -1543,6 +1367,4 @@ Init_signal(void)
#elif defined(SIGCHLD)
init_sigchld(SIGCHLD);
#endif
-
- rb_enable_interrupt();
}
diff --git a/siphash.c b/siphash.c
index 153d2c690a..0df96f8320 100644
--- a/siphash.c
+++ b/siphash.c
@@ -386,15 +386,16 @@ sip_hash_dump(sip_hash *h)
}
#endif /* SIP_HASH_STREAMING */
-#define SIP_ROUND(m, v0, v1, v2, v3) \
+#define SIP_2_ROUND(m, v0, v1, v2, v3) \
do { \
XOR64_TO((v3), (m)); \
SIP_COMPRESS(v0, v1, v2, v3); \
+ SIP_COMPRESS(v0, v1, v2, v3); \
XOR64_TO((v0), (m)); \
} while (0)
uint64_t
-sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)
+sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len)
{
uint64_t k0, k1;
uint64_t v0, v1, v2, v3;
@@ -414,13 +415,13 @@ sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)
uint64_t *data64 = (uint64_t *)data;
while (data64 != (uint64_t *) end) {
m = *data64++;
- SIP_ROUND(m, v0, v1, v2, v3);
+ SIP_2_ROUND(m, v0, v1, v2, v3);
}
}
#else
for (; data != end; data += sizeof(uint64_t)) {
m = U8TO64_LE(data);
- SIP_ROUND(m, v0, v1, v2, v3);
+ SIP_2_ROUND(m, v0, v1, v2, v3);
}
#endif
@@ -467,13 +468,14 @@ sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)
break;
}
- SIP_ROUND(last, v0, v1, v2, v3);
+ SIP_2_ROUND(last, v0, v1, v2, v3);
XOR64_INT(v2, 0xff);
SIP_COMPRESS(v0, v1, v2, v3);
SIP_COMPRESS(v0, v1, v2, v3);
SIP_COMPRESS(v0, v1, v2, v3);
+ SIP_COMPRESS(v0, v1, v2, v3);
XOR64_TO(v0, v1);
XOR64_TO(v0, v2);
diff --git a/siphash.h b/siphash.h
index 2e7553f208..3f3988408b 100644
--- a/siphash.h
+++ b/siphash.h
@@ -43,6 +43,6 @@ int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, u
void sip_hash_free(sip_hash *h);
void sip_hash_dump(sip_hash *h);
-uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len);
+uint64_t sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len);
#endif
diff --git a/sparc.c b/sparc.c
index 7f3a70fd0e..dc3779035f 100644
--- a/sparc.c
+++ b/sparc.c
@@ -26,7 +26,7 @@ rb_sparc_flush_register_windows(void)
__volatile__
#endif
-/* This condition should be in sync with one in configure.ac */
+/* This condition should be in sync with one in configure.in */
#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
# ifdef __GNUC__
("flushw" : : : "%o7")
diff --git a/spec/README b/spec/README
new file mode 100644
index 0000000000..9821404697
--- /dev/null
+++ b/spec/README
@@ -0,0 +1,31 @@
+= RubySpec
+
+RubySpec (http://rubyspec.org) provides the annotation of the Ruby
+implementation in an executable format. The make task
+`update-rubyspec' retrieves the specification and puts it into this
+directory.
+
+== Directory structure
+ spec
+ +-- mspec driver library for executing the specification.
+ +-- rubyspec
+ +-- core specification for core libraries
+ | +-- array
+ | +-- bignum
+ | +-- ...
+ |
+ +-- fixtures example classes for writing specs
+ +-- language specification for Ruby language itself
+ +-- library specification for standard libraries
+ +-- addrev
+ +-- ...
+
+== How to run
+:make target
+ verifies all specs.
+ $ make test-rubyspec
+:mspec command
+ verifies the specified spec.
+ $ mspec {language|core|library}
+ or
+ $ mspec spec/path/to/some_spec.rb
diff --git a/spec/README.md b/spec/README.md
deleted file mode 100644
index 60d4849f9c..0000000000
--- a/spec/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# spec/ruby
-
-ruby/spec (https://github.com/ruby/spec/) is
-a test suite for the Ruby language.
-
-Once a month, @eregon merges the in-tree copy under spec/ruby
-with the upstream repository, preserving the commits and history.
-The same happens for other implementations such as JRuby and TruffleRuby.
-
-Feel welcome to modify the in-tree spec/ruby.
-This is the purpose of the in-tree copy,
-to facilitate contributions to ruby/spec for MRI developers.
-
-New features, additional tests for existing features and
-regressions tests are all welcome in ruby/spec.
-There is very little behavior that is implementation-specific,
-as in the end user programs tend to rely on every behavior MRI exhibits.
-In other words: If adding a spec might reveal a bug in
-another implementation, then it is worth adding it.
-Currently, the only module which is MRI-specific is `RubyVM`.
-
-## Running ruby/spec
-
-To run all specs:
-```bash
-make test-spec
-```
-
-Extra arguments can be added via `MSPECOPT`.
-For instance, to show the help:
-```bash
-make test-spec MSPECOPT=-h
-```
-
-You can also run the specs in parallel, which is currently experimental.
-It takes around 10s instead of 60s on a quad-core laptop.
-```bash
-make test-spec MSPECOPT=-j
-```
-
-To run a specific test, add its path to the command:
-```bash
-make test-spec MSPECOPT=spec/ruby/language/for_spec.rb
-```
-
-If ruby trunk is your current `ruby` in `$PATH`, you can also run `mspec` directly:
-```bash
-# change ruby to trunk
-ruby -v # => trunk
-spec/mspec/bin/mspec spec/ruby/language/for_spec.rb
-```
-
-## ruby/spec and test/
-
-The main difference between a "spec" under spec/ruby and
-a test under test/ is that specs are documenting what they test.
-This is extremely valuable when reading these tests, as it
-helps to quickly understand what specific behavior is tested,
-and how a method should behave. Basic English is fine for spec descriptions.
-Specs also tend to have few expectations (assertions) per spec,
-as they specify one aspect of the behavior and not everything at once.
-Beyond that, the syntax is slightly different but it does the same thing:
-`assert_equal 3, 1+2` is just `(1+2).should == 3`.
-
-Example:
-
-```ruby
-describe "The for expression" do
- it "iterates over an Enumerable passing each element to the block" do
- j = 0
- for i in 1..3
- j += i
- end
- j.should == 6
- end
-end
-```
-
-For more details, see spec/ruby/CONTRIBUTING.md.
diff --git a/spec/default.mspec b/spec/default.mspec
index 8791058f95..0506f1d86a 100644
--- a/spec/default.mspec
+++ b/spec/default.mspec
@@ -1,11 +1,4 @@
-# -*- ruby -*-
-$VERBOSE = false
-if (opt = ENV["RUBYOPT"]) and (opt = opt.dup).sub!(/(?:\A|\s)-w(?=\z|\s)/, '')
- ENV["RUBYOPT"] = opt
-end
-require "./rbconfig" unless defined?(RbConfig)
-load File.dirname(__FILE__) + '/ruby/default.mspec'
-OBJDIR = File.expand_path("spec/ruby/optional/capi/ext")
+load File.dirname(__FILE__) + '/rubyspec/ruby.2.2.mspec'
class MSpecScript
builddir = Dir.pwd
srcdir = ENV['SRCDIR']
@@ -14,54 +7,15 @@ class MSpecScript
f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1
}
end
- srcdir = File.expand_path(srcdir)
- config = RbConfig::CONFIG
+ config = proc{|name| `#{builddir}/miniruby -I#{srcdir} -r#{builddir}/rbconfig -e 'print RbConfig::CONFIG["#{name}"]'`}
# The default implementation to run the specs.
set :target, File.join(builddir, "miniruby#{config['exeext']}")
- set :prefix, File.expand_path('ruby', File.dirname(__FILE__))
+ set :prefix, File.expand_path('rubyspec', File.dirname(__FILE__))
set :flags, %W[
- -I#{srcdir}/lib
- #{srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']}
- --
+ -I#{File.expand_path srcdir}/lib
+ -I#{File.expand_path srcdir}/#{config['EXTOUT']}/common
+ -I#{File.expand_path srcdir}/-
+ #{File.expand_path srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']}
]
end
-
-module MSpecScript::JobServer
- def cores(max = 1)
- if max > 1 and /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
- cores = 1
- begin
- r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
- w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
- jobtokens = r.read_nonblock(max - 1)
- cores = jobtokens.size
- if cores > 0
- cores += 1
- jobserver = w
- w = nil
- at_exit {
- jobserver.print(jobtokens)
- jobserver.close
- }
- MSpecScript::JobServer.module_eval do
- remove_method :cores
- define_method(:cores) do
- cores
- end
- end
- return cores
- end
- rescue Errno::EBADF
- ensure
- r&.close
- w&.close
- end
- end
- super
- end
-end
-
-class MSpecScript
- prepend JobServer
-end
diff --git a/spec/mspec/.gitignore b/spec/mspec/.gitignore
deleted file mode 100644
index 5c5ecd9731..0000000000
--- a/spec/mspec/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-pkg
-*.rbc
-*.iml
-*.iws
-*.ipr
-*.sw?
-
-.rbx
-
-# ctags dir
-/tags
-
-*.gem
-.bundle
-.config
-.yardoc
-InstalledFiles
-_yardoc
-coverage
-doc/
-lib/bundler/man
-rdoc
-spec/reports
-test/tmp
-test/version_tmp
-tmp
diff --git a/spec/mspec/.travis.yml b/spec/mspec/.travis.yml
deleted file mode 100644
index 73f141d2ae..0000000000
--- a/spec/mspec/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-sudo: false
-language: ruby
-before_script:
- # https://github.com/travis-ci/travis-ci/issues/8408
- - unset _JAVA_OPTIONS
-script:
- - bundle exec rspec
-matrix:
- include:
- - rvm: 2.2.8
- - rvm: 2.3.5
- - rvm: 2.4.2
- - rvm: ruby-head
- - jdk: oraclejdk8
- install:
- - curl -L https://github.com/graalvm/truffleruby/releases/download/vm-enterprise-0.28/truffleruby-testing-0.28.tar.gz | tar xz
- - source truffleruby/setup_env
- - bundle install
diff --git a/spec/mspec/Gemfile b/spec/mspec/Gemfile
deleted file mode 100644
index 3dc3c4145b..0000000000
--- a/spec/mspec/Gemfile
+++ /dev/null
@@ -1,4 +0,0 @@
-source 'https://rubygems.org'
-
-gem "rake", "~> 10.0"
-gem "rspec", "~> 2.14.1"
diff --git a/spec/mspec/Gemfile.lock b/spec/mspec/Gemfile.lock
deleted file mode 100644
index d07c04638b..0000000000
--- a/spec/mspec/Gemfile.lock
+++ /dev/null
@@ -1,24 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- diff-lcs (1.2.5)
- rake (10.4.2)
- rspec (2.14.1)
- rspec-core (~> 2.14.0)
- rspec-expectations (~> 2.14.0)
- rspec-mocks (~> 2.14.0)
- rspec-core (2.14.8)
- rspec-expectations (2.14.5)
- diff-lcs (>= 1.1.3, < 2.0)
- rspec-mocks (2.14.6)
-
-PLATFORMS
- java
- ruby
-
-DEPENDENCIES
- rake (~> 10.0)
- rspec (~> 2.14.1)
-
-BUNDLED WITH
- 1.14.5
diff --git a/spec/mspec/LICENSE b/spec/mspec/LICENSE
deleted file mode 100644
index d581dd1c9f..0000000000
--- a/spec/mspec/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2008 Engine Yard, Inc. All rights reserved.
-
-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/spec/mspec/README.md b/spec/mspec/README.md
deleted file mode 100644
index 18ca8fcdd3..0000000000
--- a/spec/mspec/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-[![Build Status](https://travis-ci.org/ruby/mspec.svg?branch=master)](https://travis-ci.org/ruby/mspec)
-
-## Overview
-
-MSpec is a specialized framework that is syntax-compatible with RSpec for
-basic things like 'describe', 'it' blocks and 'before', 'after' actions. MSpec
-contains additional features that assist in writing the RubySpecs used by
-multiple Ruby implementations.
-
-MSpec attempts to use the simplest Ruby language features so that beginning
-Ruby implementations can run the Ruby specs.
-
-MSpec is not intended as a replacement for RSpec. MSpec attempts to provide a
-subset of RSpec's features in some cases and a superset in others. It does not
-provide all the matchers, for instance.
-
-However, MSpec provides several extensions to facilitate writing the Ruby
-specs in a manner compatible with multiple Ruby implementations.
-
- 1. MSpec offers a set of guards to control execution of the specs. These
- guards not only enable or disable execution but also annotate the specs
- with additional information about why they are run or not run.
-
- 2. MSpec provides a different shared spec implementation specifically
- designed to ease writing specs for the numerous aliased methods in Ruby.
- The MSpec shared spec implementation should not conflict with RSpec's own
- shared behavior facility.
-
- 3. MSpec provides various helper methods to simplify some specs, for
- example, creating temporary file names.
-
- 4. MSpec has several specialized runner scripts that includes a
- configuration facility with a default project file and user-specific
- overrides.
-
-## Requirements
-
-MSpec requires Ruby 2.2 or more recent.
-
-## Bundler
-
-A Gemfile is provided. Use Bundler to install gem dependencies. To install
-Bundler, run the following:
-
-```bash
-gem install bundler
-```
-
-To install the gem dependencies with Bundler, run the following:
-
-```bash
-ruby -S bundle install
-```
-
-## Running Specs
-
-Use RSpec to run the MSpec specs. There are no plans currently to make the
-MSpec specs runnable by MSpec.
-
-After installing the gem dependencies, the specs can be run as follows:
-
-```bash
-ruby -S bundle exec rspec
-```
-
-Or
-
-```bash
-ruby -S rake
-```
-
-To run an individual spec file, use the following example:
-
-```bash
-ruby -S bundle exec rspec spec/helpers/ruby_exe_spec.rb
-```
-
-
-## Documentation
-
-See http://ruby.github.io/rubyspec.github.io/
-
-
-## Source Code
-
-See https://github.com/ruby/mspec
-
-
-## License
-
-See the LICENSE in the source code.
diff --git a/spec/mspec/Rakefile b/spec/mspec/Rakefile
deleted file mode 100644
index 0e294cde8e..0000000000
--- a/spec/mspec/Rakefile
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'bundler/gem_tasks'
-require 'bundler/setup'
-require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/spec/mspec/bin/mkspec b/spec/mspec/bin/mkspec
deleted file mode 100755
index 00f1fdff47..0000000000
--- a/spec/mspec/bin/mkspec
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'mspec/commands/mkspec'
-
-MkSpec.main
diff --git a/spec/mspec/bin/mkspec.bat b/spec/mspec/bin/mkspec.bat
deleted file mode 100755
index 1073d20a9b..0000000000
--- a/spec/mspec/bin/mkspec.bat
+++ /dev/null
@@ -1 +0,0 @@
-@"ruby.exe" "%~dpn0" %*
diff --git a/spec/mspec/bin/mspec b/spec/mspec/bin/mspec
deleted file mode 100755
index f833257bb0..0000000000
--- a/spec/mspec/bin/mspec
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'mspec/commands/mspec'
-
-MSpecMain.main
diff --git a/spec/mspec/bin/mspec-ci b/spec/mspec/bin/mspec-ci
deleted file mode 100755
index d7cd50a827..0000000000
--- a/spec/mspec/bin/mspec-ci
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'mspec/commands/mspec-ci'
-
-MSpecCI.main
diff --git a/spec/mspec/bin/mspec-ci.bat b/spec/mspec/bin/mspec-ci.bat
deleted file mode 100755
index 1073d20a9b..0000000000
--- a/spec/mspec/bin/mspec-ci.bat
+++ /dev/null
@@ -1 +0,0 @@
-@"ruby.exe" "%~dpn0" %*
diff --git a/spec/mspec/bin/mspec-run b/spec/mspec/bin/mspec-run
deleted file mode 100755
index 010ecefe35..0000000000
--- a/spec/mspec/bin/mspec-run
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'mspec/commands/mspec-run'
-
-MSpecRun.main
diff --git a/spec/mspec/bin/mspec-run.bat b/spec/mspec/bin/mspec-run.bat
deleted file mode 100755
index 1073d20a9b..0000000000
--- a/spec/mspec/bin/mspec-run.bat
+++ /dev/null
@@ -1 +0,0 @@
-@"ruby.exe" "%~dpn0" %*
diff --git a/spec/mspec/bin/mspec-tag b/spec/mspec/bin/mspec-tag
deleted file mode 100755
index a5f9fffaaa..0000000000
--- a/spec/mspec/bin/mspec-tag
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'mspec/commands/mspec-tag'
-
-MSpecTag.main
diff --git a/spec/mspec/bin/mspec-tag.bat b/spec/mspec/bin/mspec-tag.bat
deleted file mode 100755
index 1073d20a9b..0000000000
--- a/spec/mspec/bin/mspec-tag.bat
+++ /dev/null
@@ -1 +0,0 @@
-@"ruby.exe" "%~dpn0" %*
diff --git a/spec/mspec/bin/mspec.bat b/spec/mspec/bin/mspec.bat
deleted file mode 100755
index 1073d20a9b..0000000000
--- a/spec/mspec/bin/mspec.bat
+++ /dev/null
@@ -1 +0,0 @@
-@"ruby.exe" "%~dpn0" %*
diff --git a/spec/mspec/lib/mspec.rb b/spec/mspec/lib/mspec.rb
deleted file mode 100644
index 42d590c99a..0000000000
--- a/spec/mspec/lib/mspec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'mspec/matchers'
-require 'mspec/expectations'
-require 'mspec/mocks'
-require 'mspec/runner'
-require 'mspec/guards'
-require 'mspec/helpers'
-require 'mspec/version'
-
-# If the implementation on which the specs are run cannot
-# load pp from the standard library, add a pp.rb file that
-# defines the #pretty_inspect method on Object or Kernel.
-begin
- require 'pp'
-rescue LoadError
- module Kernel
- def pretty_inspect
- inspect
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/commands/mkspec.rb b/spec/mspec/lib/mspec/commands/mkspec.rb
deleted file mode 100755
index 7a943aa1fe..0000000000
--- a/spec/mspec/lib/mspec/commands/mkspec.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rbconfig'
-require 'mspec/version'
-require 'mspec/utils/options'
-require 'mspec/utils/name_map'
-require 'mspec/helpers/fs'
-
-class MkSpec
- attr_reader :config
-
- def initialize
- @config = {
- :constants => [],
- :requires => [],
- :base => "core",
- :version => nil
- }
- @map = NameMap.new true
- end
-
- def options(argv=ARGV)
- options = MSpecOptions.new "mkspec [options]", 32
-
- options.on("-c", "--constant", "CONSTANT",
- "Class or Module to generate spec stubs for") do |name|
- config[:constants] << name
- end
- options.on("-b", "--base", "DIR",
- "Directory to generate specs into") do |directory|
- config[:base] = File.expand_path directory
- end
- options.on("-r", "--require", "LIBRARY",
- "A library to require") do |file|
- config[:requires] << file
- end
- options.on("-V", "--version-guard", "VERSION",
- "Specify version for ruby_version_is guards") do |version|
- config[:version] = version
- end
- options.version MSpec::VERSION
- options.help
-
- options.doc "\n How might this work in the real world?\n"
- options.doc " 1. To create spec stubs for every class or module in Object\n"
- options.doc " $ mkspec\n"
- options.doc " 2. To create spec stubs for Fixnum\n"
- options.doc " $ mkspec -c Fixnum\n"
- options.doc " 3. To create spec stubs for Complex in 'superspec/complex'\n"
- options.doc " $ mkspec -c Complex -r complex -b superspec"
- options.doc ""
-
- options.parse argv
- end
-
- def create_directory(mod)
- subdir = @map.dir_name mod, config[:base]
-
- if File.exist? subdir
- unless File.directory? subdir
- puts "#{subdir} already exists and is not a directory."
- return nil
- end
- else
- mkdir_p subdir
- end
-
- subdir
- end
-
- def write_requires(dir, file)
- prefix = config[:base] + '/'
- raise dir unless dir.start_with? prefix
- sub = dir[prefix.size..-1]
- parents = '../' * (sub.split('/').length + 1)
-
- File.open(file, 'w') do |f|
- f.puts "require File.expand_path('../#{parents}spec_helper', __FILE__)"
- config[:requires].each do |lib|
- f.puts "require '#{lib}'"
- end
- end
- end
-
- def write_version(f)
- f.puts ""
- if version = config[:version]
- f.puts "ruby_version_is #{version} do"
- yield " "
- f.puts "end"
- else
- yield ""
- end
- end
-
- def write_spec(file, meth, exists)
- if exists
- out = `#{ruby} #{MSPEC_HOME}/bin/mspec-run --dry-run --unguarded -fs -e '#{meth}' #{file}`
- return if out.include?(meth)
- end
-
- File.open file, 'a' do |f|
- write_version(f) do |indent|
- f.puts <<-EOS
-#{indent}describe "#{meth}" do
-#{indent} it "needs to be reviewed for spec completeness"
-#{indent}end
-EOS
- end
- end
-
- puts file
- end
-
- def create_file(dir, mod, meth, name)
- file = File.join dir, @map.file_name(meth, mod)
- exists = File.exist? file
-
- write_requires dir, file unless exists
- write_spec file, name, exists
- end
-
- def run
- config[:requires].each { |lib| require lib }
- constants = config[:constants]
- constants = Object.constants if constants.empty?
-
- @map.map({}, constants).each do |mod, methods|
- name = mod.chop
- next unless dir = create_directory(name)
-
- methods.each { |method| create_file dir, name, method, mod + method }
- end
- end
-
- ##
- # Determine and return the path of the ruby executable.
-
- def ruby
- ruby = File.join(RbConfig::CONFIG['bindir'],
- RbConfig::CONFIG['ruby_install_name'])
-
- ruby.gsub! File::SEPARATOR, File::ALT_SEPARATOR if File::ALT_SEPARATOR
-
- return ruby
- end
-
- def self.main
- ENV['MSPEC_RUNNER'] = '1'
-
- script = new
- script.options
- script.run
- end
-end
diff --git a/spec/mspec/lib/mspec/commands/mspec-ci.rb b/spec/mspec/lib/mspec/commands/mspec-ci.rb
deleted file mode 100644
index cb0193f42d..0000000000
--- a/spec/mspec/lib/mspec/commands/mspec-ci.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
-
-require 'mspec/version'
-require 'mspec/utils/options'
-require 'mspec/utils/script'
-
-
-class MSpecCI < MSpecScript
- def options(argv=ARGV)
- options = MSpecOptions.new "mspec ci [options] (FILE|DIRECTORY|GLOB)+", 30, config
-
- options.doc " Ask yourself:"
- options.doc " 1. How to run the specs?"
- options.doc " 2. How to modify the guard behavior?"
- options.doc " 2. How to display the output?"
- options.doc " 3. What action to perform?"
- options.doc " 4. When to perform it?"
-
- options.doc "\n How to run the specs"
- options.chdir
- options.prefix
- options.configure { |f| load f }
- options.pretend
- options.interrupt
-
- options.doc "\n How to modify the guard behavior"
- options.unguarded
- options.verify
-
- options.doc "\n How to display their output"
- options.formatters
- options.verbose
-
- options.doc "\n What action to perform"
- options.actions
-
- options.doc "\n When to perform it"
- options.action_filters
-
- options.doc "\n Help!"
- options.debug
- options.version MSpec::VERSION
- options.help
-
- options.doc "\n Custom options"
- custom_options options
-
- options.doc "\n How might this work in the real world?"
- options.doc "\n 1. To simply run the known good specs"
- options.doc "\n $ mspec ci"
- options.doc "\n 2. To run a subset of the known good specs"
- options.doc "\n $ mspec ci path/to/specs"
- options.doc "\n 3. To start the debugger before the spec matching 'this crashes'"
- options.doc "\n $ mspec ci --spec-debug -S 'this crashes'"
- options.doc ""
-
- patterns = options.parse argv
- patterns = config[:ci_files] if patterns.empty?
- @files = files patterns
- end
-
- def run
- MSpec.register_tags_patterns config[:tags_patterns]
- MSpec.register_files @files
-
- tags = ["fails", "critical", "unstable", "incomplete", "unsupported"]
- tags += Array(config[:ci_xtags])
-
- require 'mspec/runner/filters/tag'
- filter = TagFilter.new(:exclude, *tags)
- filter.register
-
- MSpec.process
- exit MSpec.exit_code
- end
-end
diff --git a/spec/mspec/lib/mspec/commands/mspec-run.rb b/spec/mspec/lib/mspec/commands/mspec-run.rb
deleted file mode 100644
index 249f9f5771..0000000000
--- a/spec/mspec/lib/mspec/commands/mspec-run.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
-
-require 'mspec/version'
-require 'mspec/utils/options'
-require 'mspec/utils/script'
-
-
-class MSpecRun < MSpecScript
- def initialize
- super
-
- config[:files] = []
- end
-
- def options(argv=ARGV)
- options = MSpecOptions.new "mspec run [options] (FILE|DIRECTORY|GLOB)+", 30, config
-
- options.doc " Ask yourself:"
- options.doc " 1. What specs to run?"
- options.doc " 2. How to modify the execution?"
- options.doc " 3. How to modify the guard behavior?"
- options.doc " 4. How to display the output?"
- options.doc " 5. What action to perform?"
- options.doc " 6. When to perform it?"
-
- options.doc "\n What specs to run"
- options.filters
-
- options.doc "\n How to modify the execution"
- options.chdir
- options.prefix
- options.configure { |f| load f }
- options.randomize
- options.repeat
- options.pretend
- options.interrupt
-
- options.doc "\n How to modify the guard behavior"
- options.unguarded
- options.verify
-
- options.doc "\n How to display their output"
- options.formatters
- options.verbose
-
- options.doc "\n What action to perform"
- options.actions
-
- options.doc "\n When to perform it"
- options.action_filters
-
- options.doc "\n Help!"
- options.debug
- options.version MSpec::VERSION
- options.help
-
- options.doc "\n Custom options"
- custom_options options
-
- options.doc "\n How might this work in the real world?"
- options.doc "\n 1. To simply run some specs"
- options.doc "\n $ mspec path/to/the/specs"
- options.doc " mspec path/to/the_file_spec.rb"
- options.doc "\n 2. To run specs tagged with 'fails'"
- options.doc "\n $ mspec -g fails path/to/the_file_spec.rb"
- options.doc "\n 3. To start the debugger before the spec matching 'this crashes'"
- options.doc "\n $ mspec --spec-debug -S 'this crashes' path/to/the_file_spec.rb"
- options.doc "\n 4. To run some specs matching 'this crashes'"
- options.doc "\n $ mspec -e 'this crashes' path/to/the_file_spec.rb"
-
- options.doc ""
-
- patterns = options.parse argv
- @files = files_from_patterns(patterns)
- end
-
- def run
- MSpec.register_tags_patterns config[:tags_patterns]
- MSpec.register_files @files
-
- MSpec.process
- exit MSpec.exit_code
- end
-end
diff --git a/spec/mspec/lib/mspec/commands/mspec-tag.rb b/spec/mspec/lib/mspec/commands/mspec-tag.rb
deleted file mode 100644
index 8bc3382e91..0000000000
--- a/spec/mspec/lib/mspec/commands/mspec-tag.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'mspec/version'
-require 'mspec/utils/options'
-require 'mspec/utils/script'
-
-
-class MSpecTag < MSpecScript
- def initialize
- super
-
- config[:tagger] = :add
- config[:tag] = 'fails:'
- config[:outcome] = :fail
- config[:ltags] = []
- end
-
- def options(argv=ARGV)
- options = MSpecOptions.new "mspec tag [options] (FILE|DIRECTORY|GLOB)+", 30, config
-
- options.doc " Ask yourself:"
- options.doc " 1. What specs to run?"
- options.doc " 2. How to modify the execution?"
- options.doc " 3. How to display the output?"
- options.doc " 4. What tag action to perform?"
- options.doc " 5. When to perform it?"
-
- options.doc "\n What specs to run"
- options.filters
-
- options.doc "\n How to modify the execution"
- options.configure { |f| load f }
- options.pretend
- options.unguarded
- options.interrupt
-
- options.doc "\n How to display their output"
- options.formatters
- options.verbose
-
- options.doc "\n What action to perform and when to perform it"
- options.on("-N", "--add", "TAG",
- "Add TAG with format 'tag' or 'tag(comment)' (see -Q, -F, -L)") do |o|
- config[:tagger] = :add
- config[:tag] = "#{o}:"
- end
- options.on("-R", "--del", "TAG",
- "Delete TAG (see -Q, -F, -L)") do |o|
- config[:tagger] = :del
- config[:tag] = "#{o}:"
- config[:outcome] = :pass
- end
- options.on("-Q", "--pass", "Apply action to specs that pass (default for --del)") do
- config[:outcome] = :pass
- end
- options.on("-F", "--fail", "Apply action to specs that fail (default for --add)") do
- config[:outcome] = :fail
- end
- options.on("-L", "--all", "Apply action to all specs") do
- config[:outcome] = :all
- end
- options.on("--list", "TAG", "Display descriptions of any specs tagged with TAG") do |t|
- config[:tagger] = :list
- config[:ltags] << t
- end
- options.on("--list-all", "Display descriptions of any tagged specs") do
- config[:tagger] = :list_all
- end
- options.on("--purge", "Remove all tags not matching any specs") do
- config[:tagger] = :purge
- end
-
- options.doc "\n Help!"
- options.debug
- options.version MSpec::VERSION
- options.help
-
- options.doc "\n Custom options"
- custom_options options
-
- options.doc "\n How might this work in the real world?"
- options.doc "\n 1. To add the 'fails' tag to failing specs"
- options.doc "\n $ mspec tag path/to/the_file_spec.rb"
- options.doc "\n 2. To remove the 'fails' tag from passing specs"
- options.doc "\n $ mspec tag --del fails path/to/the_file_spec.rb"
- options.doc "\n 3. To display the descriptions for all specs tagged with 'fails'"
- options.doc "\n $ mspec tag --list fails path/to/the/specs"
- options.doc ""
-
- patterns = options.parse argv
- if patterns.empty?
- puts options
- puts "No files specified."
- exit 1
- end
- @files = files patterns
- end
-
- def register
- require 'mspec/runner/actions'
-
- case config[:tagger]
- when :add, :del
- tag = SpecTag.new config[:tag]
- tagger = TagAction.new(config[:tagger], config[:outcome], tag.tag, tag.comment,
- config[:atags], config[:astrings])
- when :list, :list_all
- tagger = TagListAction.new config[:tagger] == :list_all ? nil : config[:ltags]
- MSpec.register_mode :pretend
- config[:formatter] = false
- when :purge
- tagger = TagPurgeAction.new
- MSpec.register_mode :pretend
- MSpec.register_mode :unguarded
- config[:formatter] = false
- else
- raise ArgumentError, "No recognized action given"
- end
- tagger.register
-
- super
- end
-
- def run
- MSpec.register_tags_patterns config[:tags_patterns]
- MSpec.register_files @files
-
- MSpec.process
- exit MSpec.exit_code
- end
-end
-
diff --git a/spec/mspec/lib/mspec/commands/mspec.rb b/spec/mspec/lib/mspec/commands/mspec.rb
deleted file mode 100755
index 6cb1e87a58..0000000000
--- a/spec/mspec/lib/mspec/commands/mspec.rb
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'mspec/version'
-require 'mspec/utils/options'
-require 'mspec/utils/script'
-require 'mspec/helpers/tmp'
-require 'mspec/runner/actions/filter'
-require 'mspec/runner/actions/timer'
-
-
-class MSpecMain < MSpecScript
- def initialize
- super
-
- config[:loadpath] = []
- config[:requires] = []
- config[:target] = ENV['RUBY'] || 'ruby'
- config[:flags] = []
- config[:command] = nil
- config[:options] = []
- config[:launch] = []
- end
-
- def options(argv=ARGV)
- config[:command] = argv.shift if ["ci", "run", "tag"].include?(argv[0])
-
- options = MSpecOptions.new "mspec [COMMAND] [options] (FILE|DIRECTORY|GLOB)+", 30, config
-
- options.doc " The mspec command sets up and invokes the sub-commands"
- options.doc " (see below) to enable, for instance, running the specs"
- options.doc " with different implementations like ruby, jruby, rbx, etc.\n"
-
- options.configure do |f|
- load f
- config[:options] << '-B' << f
- end
-
- options.targets
-
- options.on("--warnings", "Don't suppress warnings") do
- config[:flags] << '-w'
- ENV['OUTPUT_WARNINGS'] = '1'
- end
-
- options.on("-j", "--multi", "Run multiple (possibly parallel) subprocesses") do
- config[:multi] = true
- end
-
- options.version MSpec::VERSION do
- if config[:command]
- config[:options] << "-v"
- else
- puts "#{File.basename $0} #{MSpec::VERSION}"
- exit
- end
- end
-
- options.help do
- if config[:command]
- config[:options] << "-h"
- else
- puts options
- exit 1
- end
- end
-
- options.doc "\n Custom options"
- custom_options options
-
- # The rest of the help output
- options.doc "\n where COMMAND is one of:\n"
- options.doc " run - Run the specified specs (default)"
- options.doc " ci - Run the known good specs"
- options.doc " tag - Add or remove tags\n"
- options.doc " mspec COMMAND -h for more options\n"
- options.doc " example: $ mspec run -h\n"
-
- options.on_extra { |o| config[:options] << o }
- options.parse(argv)
-
- if config[:multi]
- options = MSpecOptions.new "mspec", 30, config
- options.all
- patterns = options.parse(config[:options])
- @files = files_from_patterns(patterns)
- end
- end
-
- def register; end
-
- def multi_exec(argv)
- MSpec.register_files @files
-
- require 'mspec/runner/formatters/multi'
- formatter = MultiFormatter.new
- if config[:formatter]
- warn "formatter options is ignored due to multi option"
- end
-
- output_files = []
- processes = cores(@files.size)
- children = processes.times.map { |i|
- name = tmp "mspec-multi-#{i}"
- output_files << name
-
- env = {
- "SPEC_TEMP_DIR" => "rubyspec_temp_#{i}",
- "MSPEC_MULTI" => i.to_s
- }
- command = argv + ["-fy", "-o", name]
- $stderr.puts "$ #{command.join(' ')}" if $MSPEC_DEBUG
- IO.popen([env, *command, close_others: false], "rb+")
- }
-
- puts children.map { |child| child.gets }.uniq
- formatter.start
- last_files = {}
-
- until @files.empty?
- IO.select(children)[0].each { |io|
- reply = io.read(1)
- case reply
- when '.'
- formatter.unload
- when nil
- raise "Worker died!"
- else
- while chunk = (io.read_nonblock(4096) rescue nil)
- reply += chunk
- end
- reply.chomp!('.')
- msg = "A child mspec-run process printed unexpected output on STDOUT"
- if last_file = last_files[io]
- msg += " while running #{last_file}"
- end
- abort "\n#{msg}: #{reply.inspect}"
- end
-
- unless @files.empty?
- file = @files.shift
- last_files[io] = file
- io.puts file
- end
- }
- end
-
- success = true
- children.each { |child|
- child.puts "QUIT"
- _pid, status = Process.wait2(child.pid)
- success &&= status.success?
- child.close
- }
-
- formatter.aggregate_results(output_files)
- formatter.finish
- success
- end
-
- def run
- argv = config[:target].split(/\s+/)
-
- argv.concat config[:launch]
- argv.concat config[:flags]
- argv.concat config[:loadpath]
- argv.concat config[:requires]
- argv << "#{MSPEC_HOME}/bin/mspec-#{config[:command] || 'run'}"
- argv.concat config[:options]
-
- if config[:multi]
- exit multi_exec(argv)
- else
- $stderr.puts "$ #{argv.join(' ')}"
- $stderr.flush
- exec(*argv, close_others: false)
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/expectations.rb b/spec/mspec/lib/mspec/expectations.rb
deleted file mode 100644
index d07f959b27..0000000000
--- a/spec/mspec/lib/mspec/expectations.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/expectations/should'
diff --git a/spec/mspec/lib/mspec/expectations/expectations.rb b/spec/mspec/lib/mspec/expectations/expectations.rb
deleted file mode 100644
index cfdc2b63a3..0000000000
--- a/spec/mspec/lib/mspec/expectations/expectations.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class SpecExpectationNotMetError < StandardError
-end
-
-class SpecExpectationNotFoundError < StandardError
- def message
- "No behavior expectation was found in the example"
- end
-end
-
-class SpecExpectation
- def self.fail_with(expected, actual)
- expected_to_s = expected.to_s
- actual_to_s = actual.to_s
- if expected_to_s.size + actual_to_s.size > 80
- message = "#{expected_to_s.chomp}\n#{actual_to_s}"
- else
- message = "#{expected_to_s} #{actual_to_s}"
- end
- Kernel.raise SpecExpectationNotMetError, message
- end
-end
diff --git a/spec/mspec/lib/mspec/expectations/should.rb b/spec/mspec/lib/mspec/expectations/should.rb
deleted file mode 100644
index f6d83053f5..0000000000
--- a/spec/mspec/lib/mspec/expectations/should.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class Object
- NO_MATCHER_GIVEN = Object.new
-
- def should(matcher = NO_MATCHER_GIVEN)
- MSpec.expectation
- MSpec.actions :expectation, MSpec.current.state
- unless matcher.equal? NO_MATCHER_GIVEN
- unless matcher.matches? self
- expected, actual = matcher.failure_message
- SpecExpectation.fail_with(expected, actual)
- end
- else
- SpecPositiveOperatorMatcher.new(self)
- end
- end
-
- def should_not(matcher = NO_MATCHER_GIVEN)
- MSpec.expectation
- MSpec.actions :expectation, MSpec.current.state
- unless matcher.equal? NO_MATCHER_GIVEN
- if matcher.matches? self
- expected, actual = matcher.negative_failure_message
- SpecExpectation.fail_with(expected, actual)
- end
- else
- SpecNegativeOperatorMatcher.new(self)
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/guards.rb b/spec/mspec/lib/mspec/guards.rb
deleted file mode 100644
index 454ac0c776..0000000000
--- a/spec/mspec/lib/mspec/guards.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'mspec/guards/block_device'
-require 'mspec/guards/bug'
-require 'mspec/guards/conflict'
-require 'mspec/guards/endian'
-require 'mspec/guards/feature'
-require 'mspec/guards/guard'
-require 'mspec/guards/platform'
-require 'mspec/guards/quarantine'
-require 'mspec/guards/support'
-require 'mspec/guards/superuser'
-require 'mspec/guards/version'
diff --git a/spec/mspec/lib/mspec/guards/block_device.rb b/spec/mspec/lib/mspec/guards/block_device.rb
deleted file mode 100644
index ae736a2d4e..0000000000
--- a/spec/mspec/lib/mspec/guards/block_device.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'mspec/guards/guard'
-
-class BlockDeviceGuard < SpecGuard
- def match?
- platform_is_not :freebsd, :windows, :opal do
- block = `find /dev /devices -type b 2> /dev/null`
- return !(block.nil? || block.empty?)
- end
-
- false
- end
-end
-
-def with_block_device(&block)
- BlockDeviceGuard.new.run_if(:with_block_device, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/bug.rb b/spec/mspec/lib/mspec/guards/bug.rb
deleted file mode 100644
index b1bfc6413e..0000000000
--- a/spec/mspec/lib/mspec/guards/bug.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'mspec/guards/version'
-
-class BugGuard < VersionGuard
- def initialize(bug, version)
- @bug = bug
- if String === version
- MSpec.deprecate "ruby_bug with a single version", 'an exclusive range ("2.1"..."2.3")'
- @version = SpecVersion.new version, true
- else
- super(version)
- end
- @parameters = [@bug, @version]
- end
-
- def match?
- return false if MSpec.mode? :no_ruby_bug
- return false unless PlatformGuard.standard?
- if Range === @version
- super
- else
- FULL_RUBY_VERSION <= @version
- end
- end
-end
-
-def ruby_bug(bug, version, &block)
- BugGuard.new(bug, version).run_unless(:ruby_bug, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/conflict.rb b/spec/mspec/lib/mspec/guards/conflict.rb
deleted file mode 100644
index 7a27671c1e..0000000000
--- a/spec/mspec/lib/mspec/guards/conflict.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'mspec/guards/guard'
-
-class ConflictsGuard < SpecGuard
- def match?
- # Always convert constants to symbols regardless of version.
- constants = Object.constants.map { |x| x.to_sym }
- @parameters.any? { |mod| constants.include? mod }
- end
-end
-
-# In some cases, libraries will modify another Ruby method's
-# behavior. The specs for the method's behavior will then fail
-# if that library is loaded. This guard will not run if any of
-# the specified constants exist in Object.constants.
-def conflicts_with(*modules, &block)
- ConflictsGuard.new(*modules).run_unless(:conflicts_with, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/endian.rb b/spec/mspec/lib/mspec/guards/endian.rb
deleted file mode 100644
index 79335a8933..0000000000
--- a/spec/mspec/lib/mspec/guards/endian.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'mspec/guards/guard'
-
-# Despite that these are inverses, the two classes are
-# used to simplify MSpec guard reporting modes
-
-class EndianGuard < SpecGuard
- def pattern
- @pattern ||= [1].pack('L')
- end
- private :pattern
-end
-
-class BigEndianGuard < EndianGuard
- def match?
- pattern[-1] == ?\001
- end
-end
-
-def big_endian(&block)
- BigEndianGuard.new.run_if(:big_endian, &block)
-end
-
-def little_endian(&block)
- BigEndianGuard.new.run_unless(:little_endian, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/feature.rb b/spec/mspec/lib/mspec/guards/feature.rb
deleted file mode 100644
index 30984e0cc5..0000000000
--- a/spec/mspec/lib/mspec/guards/feature.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'mspec/guards/guard'
-
-class FeatureGuard < SpecGuard
- def self.enabled?(*features)
- new(*features).match?
- end
-
- def match?
- @parameters.all? { |f| MSpec.feature_enabled? f }
- end
-end
-
-# Provides better documentation in the specs by
-# naming sets of features that work together as
-# a whole. Examples include :encoding, :fiber,
-# :continuation, :fork.
-#
-# Usage example:
-#
-# with_feature :encoding do
-# # specs for a method that provides aspects
-# # of the encoding feature
-# end
-#
-# Multiple features must all be enabled for the
-# guard to run:
-#
-# with_feature :one, :two do
-# # these specs will run if features :one AND
-# # :two are enabled.
-# end
-#
-# The implementation must explicitly enable a feature
-# by adding code like the following to the .mspec
-# configuration file:
-#
-# MSpec.enable_feature :encoding
-#
-def with_feature(*features, &block)
- FeatureGuard.new(*features).run_if(:with_feature, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/guard.rb b/spec/mspec/lib/mspec/guards/guard.rb
deleted file mode 100644
index 322a08145d..0000000000
--- a/spec/mspec/lib/mspec/guards/guard.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-require 'mspec/runner/mspec'
-require 'mspec/runner/actions/tally'
-
-class SpecGuard
- def self.report
- @report ||= Hash.new { |h,k| h[k] = [] }
- end
-
- def self.clear
- @report = nil
- end
-
- def self.finish
- report.keys.sort.each do |key|
- desc = report[key]
- size = desc.size
- spec = size == 1 ? "spec" : "specs"
- print "\n\n#{size} #{spec} omitted by guard: #{key}:\n"
- desc.each { |description| print "\n", description; }
- end
-
- print "\n\n"
- end
-
- def self.guards
- @guards ||= []
- end
-
- def self.clear_guards
- @guards = []
- end
-
- # Returns a partial Ruby version string based on +which+.
- # For example, if RUBY_VERSION = 8.2.3:
- #
- # :major => "8"
- # :minor => "8.2"
- # :tiny => "8.2.3"
- # :teeny => "8.2.3"
- # :full => "8.2.3"
- def self.ruby_version(which = :minor)
- case which
- when :major
- n = 1
- when :minor
- n = 2
- when :tiny, :teeny, :full
- n = 3
- end
-
- RUBY_VERSION.split('.')[0,n].join('.')
- end
-
- attr_accessor :name
-
- def initialize(*args)
- @parameters = args
- end
-
- def yield?(invert = false)
- return true if MSpec.mode? :unguarded
-
- allow = match? ^ invert
-
- if !allow and reporting?
- MSpec.guard
- MSpec.register :finish, SpecGuard
- MSpec.register :add, self
- return true
- elsif MSpec.mode? :verify
- return true
- end
-
- allow
- end
-
- def run_if(name, &block)
- @name = name
- if block
- yield if yield?(false)
- else
- yield?(false)
- end
- ensure
- unregister
- end
-
- def run_unless(name, &block)
- @name = name
- if block
- yield if yield?(true)
- else
- yield?(true)
- end
- ensure
- unregister
- end
-
- def reporting?
- MSpec.mode?(:report) or
- (MSpec.mode?(:report_on) and SpecGuard.guards.include?(name))
- end
-
- def report_key
- "#{name} #{@parameters.join(", ")}"
- end
-
- def record(description)
- SpecGuard.report[report_key] << description
- end
-
- def add(example)
- record example.description
- MSpec.retrieve(:formatter).tally.counter.guards!
- end
-
- def unregister
- MSpec.unguard
- MSpec.unregister :add, self
- end
-
- def match?
- raise "must be implemented by the subclass"
- end
-end
-
-# Combined guards
-
-def guard(condition, &block)
- raise "condition must be a Proc" unless condition.is_a?(Proc)
- raise LocalJumpError, "no block given" unless block
- return yield if MSpec.mode? :unguarded or MSpec.mode? :verify or MSpec.mode? :report
- yield if condition.call
-end
-
-def guard_not(condition, &block)
- raise "condition must be a Proc" unless condition.is_a?(Proc)
- raise LocalJumpError, "no block given" unless block
- return yield if MSpec.mode? :unguarded or MSpec.mode? :verify or MSpec.mode? :report
- yield unless condition.call
-end
diff --git a/spec/mspec/lib/mspec/guards/platform.rb b/spec/mspec/lib/mspec/guards/platform.rb
deleted file mode 100644
index 96176b8753..0000000000
--- a/spec/mspec/lib/mspec/guards/platform.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'mspec/guards/guard'
-
-class PlatformGuard < SpecGuard
- def self.implementation?(*args)
- args.any? do |name|
- case name
- when :rubinius
- RUBY_ENGINE.start_with?('rbx')
- when :ruby, :jruby, :truffleruby, :ironruby, :macruby, :maglev, :topaz, :opal
- RUBY_ENGINE.start_with?(name.to_s)
- else
- raise "unknown implementation #{name}"
- end
- end
- end
-
- def self.standard?
- implementation? :ruby
- end
-
- HOST_OS = begin
- require 'rbconfig'
- RbConfig::CONFIG['host_os'] || RUBY_PLATFORM
- rescue LoadError
- RUBY_PLATFORM
- end.downcase
-
- def self.os?(*oses)
- oses.any? do |os|
- raise ":java is not a valid OS" if os == :java
- if os == :windows
- HOST_OS =~ /(mswin|mingw)/
- else
- HOST_OS.include?(os.to_s)
- end
- end
- end
-
- def self.windows?
- os?(:windows)
- end
-
- def self.wordsize?(size)
- size == 8 * 1.size
- end
-
- def initialize(*args)
- if args.last.is_a?(Hash)
- @options, @platforms = args.last, args[0..-2]
- else
- @options, @platforms = {}, args
- end
- @parameters = args
- end
-
- def match?
- match = @platforms.empty? ? true : PlatformGuard.os?(*@platforms)
- @options.each do |key, value|
- case key
- when :os
- match &&= PlatformGuard.os?(*value)
- when :wordsize
- match &&= PlatformGuard.wordsize? value
- end
- end
- match
- end
-end
-
-def platform_is(*args, &block)
- PlatformGuard.new(*args).run_if(:platform_is, &block)
-end
-
-def platform_is_not(*args, &block)
- PlatformGuard.new(*args).run_unless(:platform_is_not, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/quarantine.rb b/spec/mspec/lib/mspec/guards/quarantine.rb
deleted file mode 100644
index ec4d01f9ea..0000000000
--- a/spec/mspec/lib/mspec/guards/quarantine.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'mspec/guards/guard'
-
-class QuarantineGuard < SpecGuard
- def match?
- true
- end
-end
-
-def quarantine!(&block)
- QuarantineGuard.new.run_unless(:quarantine!, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/superuser.rb b/spec/mspec/lib/mspec/guards/superuser.rb
deleted file mode 100644
index e92ea7e862..0000000000
--- a/spec/mspec/lib/mspec/guards/superuser.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'mspec/guards/guard'
-
-class SuperUserGuard < SpecGuard
- def match?
- Process.euid == 0
- end
-end
-
-def as_superuser(&block)
- SuperUserGuard.new.run_if(:as_superuser, &block)
-end
-
-def as_user(&block)
- SuperUserGuard.new.run_unless(:as_user, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/support.rb b/spec/mspec/lib/mspec/guards/support.rb
deleted file mode 100644
index 790bea1077..0000000000
--- a/spec/mspec/lib/mspec/guards/support.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'mspec/guards/platform'
-
-class SupportedGuard < SpecGuard
- def match?
- if @parameters.include? :ruby
- raise Exception, "improper use of not_supported_on guard"
- end
- !PlatformGuard.standard? and PlatformGuard.implementation?(*@parameters)
- end
-end
-
-def not_supported_on(*args, &block)
- SupportedGuard.new(*args).run_unless(:not_supported_on, &block)
-end
diff --git a/spec/mspec/lib/mspec/guards/version.rb b/spec/mspec/lib/mspec/guards/version.rb
deleted file mode 100644
index cb08fdac73..0000000000
--- a/spec/mspec/lib/mspec/guards/version.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'mspec/utils/deprecate'
-require 'mspec/utils/version'
-require 'mspec/guards/guard'
-
-class VersionGuard < SpecGuard
- FULL_RUBY_VERSION = SpecVersion.new SpecGuard.ruby_version(:full)
-
- def initialize(version)
- case version
- when String
- @version = SpecVersion.new version
- when Range
- MSpec.deprecate "an empty version range end", 'a specific version' if version.end.empty?
- a = SpecVersion.new version.begin
- b = SpecVersion.new version.end
- unless version.exclude_end?
- MSpec.deprecate "ruby_version_is with an inclusive range", 'an exclusive range ("2.1"..."2.3")'
- end
- @version = version.exclude_end? ? a...b : a..b
- else
- raise "version must be a String or Range but was a #{version.class}"
- end
- @parameters = [version]
- end
-
- def match?
- if Range === @version
- @version.include? FULL_RUBY_VERSION
- else
- FULL_RUBY_VERSION >= @version
- end
- end
-end
-
-def ruby_version_is(*args, &block)
- VersionGuard.new(*args).run_if(:ruby_version_is, &block)
-end
diff --git a/spec/mspec/lib/mspec/helpers.rb b/spec/mspec/lib/mspec/helpers.rb
deleted file mode 100644
index b7ac9f4e85..0000000000
--- a/spec/mspec/lib/mspec/helpers.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'mspec/helpers/argf'
-require 'mspec/helpers/argv'
-require 'mspec/helpers/datetime'
-require 'mspec/helpers/fixture'
-require 'mspec/helpers/flunk'
-require 'mspec/helpers/frozen_error_class'
-require 'mspec/helpers/fs'
-require 'mspec/helpers/io'
-require 'mspec/helpers/mock_to_path'
-require 'mspec/helpers/numeric'
-require 'mspec/helpers/ruby_exe'
-require 'mspec/helpers/scratch'
-require 'mspec/helpers/tmp'
-require 'mspec/helpers/warning'
diff --git a/spec/mspec/lib/mspec/helpers/argf.rb b/spec/mspec/lib/mspec/helpers/argf.rb
deleted file mode 100644
index 4d3e0f46b3..0000000000
--- a/spec/mspec/lib/mspec/helpers/argf.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# Convenience helper for specs using ARGF.
-# Set @argf to an instance of ARGF.class with the given +argv+.
-# That instance must be used instead of ARGF as ARGF is global
-# and it is not always possible to reset its state correctly.
-#
-# The helper yields to the block and then close
-# the files open by the instance. Example:
-#
-# describe "That" do
-# it "does something" do
-# argf ['a', 'b'] do
-# # do something
-# end
-# end
-# end
-def argf(argv)
- if argv.empty? or argv.length > 2
- raise "Only 1 or 2 filenames are allowed for the argf helper so files can be properly closed: #{argv.inspect}"
- end
- @argf ||= nil
- raise "Cannot nest calls to the argf helper" if @argf
-
- @argf = ARGF.class.new(*argv)
- @__mspec_saved_argf_file__ = @argf.file
- begin
- yield
- ensure
- file1 = @__mspec_saved_argf_file__
- file2 = @argf.file # Either the first file or the second
- file1.close if !file1.closed? and file1 != STDIN
- file2.close if !file2.closed? and file2 != STDIN
- @argf = nil
- @__mspec_saved_argf_file__ = nil
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/argv.rb b/spec/mspec/lib/mspec/helpers/argv.rb
deleted file mode 100644
index 9dac384dbd..0000000000
--- a/spec/mspec/lib/mspec/helpers/argv.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Convenience helper for altering ARGV. Saves the
-# value of ARGV and sets it to +args+. If a block
-# is given, yields to the block and then restores
-# the value of ARGV. The previously saved value of
-# ARGV can be restored by passing +:restore+. The
-# former is useful in a single spec. The latter is
-# useful in before/after actions. For example:
-#
-# describe "This" do
-# before do
-# argv ['a', 'b']
-# end
-#
-# after do
-# argv :restore
-# end
-#
-# it "does something" do
-# # do something
-# end
-# end
-#
-# describe "That" do
-# it "does something" do
-# argv ['a', 'b'] do
-# # do something
-# end
-# end
-# end
-def argv(args)
- if args == :restore
- ARGV.replace(@__mspec_saved_argv__ || [])
- else
- @__mspec_saved_argv__ = ARGV.dup
- ARGV.replace args
- if block_given?
- begin
- yield
- ensure
- argv :restore
- end
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/datetime.rb b/spec/mspec/lib/mspec/helpers/datetime.rb
deleted file mode 100644
index 1520b971ea..0000000000
--- a/spec/mspec/lib/mspec/helpers/datetime.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# The new_datetime helper makes writing DateTime specs more simple by
-# providing default constructor values and accepting a Hash of only the
-# constructor values needed for the particular spec. For example:
-#
-# new_datetime :hour => 1, :minute => 20
-#
-# Possible keys are:
-# :year, :month, :day, :hour, :minute, :second, :offset and :sg.
-def new_datetime(opts={})
- require 'date'
-
- value = {
- :year => -4712,
- :month => 1,
- :day => 1,
- :hour => 0,
- :minute => 0,
- :second => 0,
- :offset => 0,
- :sg => Date::ITALY
- }.merge opts
-
- DateTime.new value[:year], value[:month], value[:day], value[:hour],
- value[:minute], value[:second], value[:offset], value[:sg]
-end
-
-def with_timezone(name, offset = nil, daylight_saving_zone = "")
- zone = name.dup
-
- if offset
- # TZ convention is backwards
- offset = -offset
-
- zone += offset.to_s
- zone += ":00:00"
- end
- zone += daylight_saving_zone
-
- old = ENV["TZ"]
- ENV["TZ"] = zone
-
- begin
- yield
- ensure
- ENV["TZ"] = old
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/fixture.rb b/spec/mspec/lib/mspec/helpers/fixture.rb
deleted file mode 100644
index f3bbe423bd..0000000000
--- a/spec/mspec/lib/mspec/helpers/fixture.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# Returns the name of a fixture file by adjoining the directory
-# of the +file+ argument with "fixtures" and the contents of the
-# +args+ array. For example,
-#
-# +file+ == "some/example_spec.rb"
-#
-# and
-#
-# +args+ == ["subdir", "file.txt"]
-#
-# then the result is the expanded path of
-#
-# "some/fixtures/subdir/file.txt".
-def fixture(file, *args)
- path = File.dirname(file)
- path = path[0..-7] if path[-7..-1] == "/shared"
- fixtures = path[-9..-1] == "/fixtures" ? "" : "fixtures"
- if File.respond_to?(:realpath)
- path = File.realpath(path)
- else
- path = File.expand_path(path)
- end
- File.join(path, fixtures, args)
-end
diff --git a/spec/mspec/lib/mspec/helpers/flunk.rb b/spec/mspec/lib/mspec/helpers/flunk.rb
deleted file mode 100644
index 68fb3cadac..0000000000
--- a/spec/mspec/lib/mspec/helpers/flunk.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-def flunk(msg="This example is a failure")
- SpecExpectation.fail_with "Failed:", msg
-end
diff --git a/spec/mspec/lib/mspec/helpers/frozen_error_class.rb b/spec/mspec/lib/mspec/helpers/frozen_error_class.rb
deleted file mode 100644
index 26788ad9ad..0000000000
--- a/spec/mspec/lib/mspec/helpers/frozen_error_class.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'mspec/guards/version'
-
-# This helper makes it easy to write version independent
-# specs for frozen objects.
-unless respond_to? :frozen_error_class
- ruby_version_is "2.5" do
- def frozen_error_class
- FrozenError
- end
- end
-
- ruby_version_is ""..."2.5" do
- def frozen_error_class
- RuntimeError
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/fs.rb b/spec/mspec/lib/mspec/helpers/fs.rb
deleted file mode 100644
index fb2c0f702c..0000000000
--- a/spec/mspec/lib/mspec/helpers/fs.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copies a file
-def cp(source, dest)
- File.open(dest, "wb") do |d|
- File.open(source, "rb") do |s|
- while data = s.read(1024)
- d.write data
- end
- end
- end
-end
-
-# Creates each directory in path that does not exist.
-def mkdir_p(path)
- parts = File.expand_path(path).split %r[/|\\]
- name = parts.shift
- parts.each do |part|
- name = File.join name, part
-
- if File.file? name
- raise ArgumentError, "path component of #{path} is a file"
- end
-
- unless File.directory? name
- begin
- Dir.mkdir name
- rescue Errno::EEXIST => e
- if File.directory? name
- # OK, another process/thread created the same directory
- else
- raise e
- end
- end
- end
- end
-end
-
-# Recursively removes all files and directories in +path+
-# if +path+ is a directory. Removes the file if +path+ is
-# a file.
-def rm_r(*paths)
- paths.each do |path|
- path = File.expand_path path
-
- prefix = SPEC_TEMP_DIR
- unless path[0, prefix.size] == prefix
- raise ArgumentError, "#{path} is not prefixed by #{prefix}"
- end
-
- # File.symlink? needs to be checked first as
- # File.exist? returns false for dangling symlinks
- if File.symlink? path
- File.unlink path
- elsif File.directory? path
- Dir.entries(path).each { |x| rm_r "#{path}/#{x}" unless x =~ /^\.\.?$/ }
- Dir.rmdir path
- elsif File.exist? path
- File.delete path
- end
- end
-end
-
-# Creates a file +name+. Creates the directory for +name+
-# if it does not exist.
-def touch(name, mode="w")
- mkdir_p File.dirname(name)
-
- File.open(name, mode) do |f|
- yield f if block_given?
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/io.rb b/spec/mspec/lib/mspec/helpers/io.rb
deleted file mode 100644
index 57dc0d53a4..0000000000
--- a/spec/mspec/lib/mspec/helpers/io.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'mspec/guards/feature'
-
-class IOStub
- def initialize
- @buffer = []
- @output = ''
- end
-
- def write(*str)
- self << str.join
- end
-
- def << str
- @buffer << str
- self
- end
-
- def print(*str)
- write(str.join + $\.to_s)
- end
-
- def method_missing(name, *args, &block)
- to_s.send(name, *args, &block)
- end
-
- def == other
- to_s == other
- end
-
- def =~ other
- to_s =~ other
- end
-
- def puts(*str)
- if str.empty?
- write "\n"
- else
- write(str.collect { |s| s.to_s.chomp }.concat([nil]).join("\n"))
- end
- end
-
- def printf(format, *args)
- self << sprintf(format, *args)
- end
-
- def flush
- @output += @buffer.join('')
- @buffer.clear
- self
- end
-
- def to_s
- flush
- @output
- end
-
- alias_method :to_str, :to_s
-
- def inspect
- to_s.inspect
- end
-end
-
-# Creates a "bare" file descriptor (i.e. one that is not associated
-# with any Ruby object). The file descriptor can safely be passed
-# to IO.new without creating a Ruby object alias to the fd.
-def new_fd(name, mode="w:utf-8")
- mode = options_or_mode(mode)
-
- if mode.kind_of? Hash
- if mode.key? :mode
- mode = mode[:mode]
- else
- raise ArgumentError, "new_fd options Hash must include :mode"
- end
- end
-
- IO.sysopen name, fmode(mode)
-end
-
-# Creates an IO instance for a temporary file name. The file
-# must be deleted.
-def new_io(name, mode="w:utf-8")
- IO.new new_fd(name, options_or_mode(mode)), options_or_mode(mode)
-end
-
-# This helper simplifies passing file access modes regardless of
-# whether the :encoding feature is enabled. Only the access specifier
-# itself will be returned if :encoding is not enabled. Otherwise,
-# the full mode string will be returned (i.e. the helper is a no-op).
-def fmode(mode)
- if FeatureGuard.enabled? :encoding
- mode
- else
- mode.split(':').first
- end
-end
-
-# This helper simplifies passing file access modes or options regardless of
-# whether the :encoding feature is enabled. Only the access specifier itself
-# will be returned if :encoding is not enabled. Otherwise, the full mode
-# string or option will be returned (i.e. the helper is a no-op).
-def options_or_mode(oom)
- return fmode(oom) if oom.kind_of? String
-
- if FeatureGuard.enabled? :encoding
- oom
- else
- fmode(oom[:mode] || "r:utf-8")
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/mock_to_path.rb b/spec/mspec/lib/mspec/helpers/mock_to_path.rb
deleted file mode 100644
index 2780afc54a..0000000000
--- a/spec/mspec/lib/mspec/helpers/mock_to_path.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-def mock_to_path(path)
- # Cannot use our Object#mock here since it conflicts with RSpec
- obj = MockObject.new('path')
- obj.should_receive(:to_path).and_return(path)
- obj
-end
diff --git a/spec/mspec/lib/mspec/helpers/numeric.rb b/spec/mspec/lib/mspec/helpers/numeric.rb
deleted file mode 100644
index 312aafae35..0000000000
--- a/spec/mspec/lib/mspec/helpers/numeric.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'mspec/guards/platform'
-
-def nan_value
- 0/0.0
-end
-
-def infinity_value
- 1/0.0
-end
-
-def bignum_value(plus=0)
- 0x8000_0000_0000_0000 + plus
-end
-
-# This is a bit hairy, but we need to be able to write specs that cover the
-# boundary between Fixnum and Bignum for operations like Fixnum#<<. Since
-# this boundary is implementation-dependent, we use these helpers to write
-# specs based on the relationship between values rather than specific
-# values.
-if PlatformGuard.standard? or PlatformGuard.implementation? :topaz
- if PlatformGuard.wordsize? 32
- def fixnum_max
- (2**30) - 1
- end
-
- def fixnum_min
- -(2**30)
- end
- elsif PlatformGuard.wordsize? 64
- def fixnum_max
- (2**62) - 1
- end
-
- def fixnum_min
- -(2**62)
- end
- end
-elsif PlatformGuard.implementation? :opal
- def fixnum_max
- Integer::MAX
- end
-
- def fixnum_min
- Integer::MIN
- end
-elsif PlatformGuard.implementation? :rubinius
- def fixnum_max
- Fixnum::MAX
- end
-
- def fixnum_min
- Fixnum::MIN
- end
-elsif PlatformGuard.implementation?(:jruby) || PlatformGuard.implementation?(:truffleruby)
- def fixnum_max
- 9223372036854775807
- end
-
- def fixnum_min
- -9223372036854775808
- end
-else
- def fixnum_max
- raise "unknown implementation for fixnum_max() helper"
- end
-
- def fixnum_min
- raise "unknown implementation for fixnum_min() helper"
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/ruby_exe.rb b/spec/mspec/lib/mspec/helpers/ruby_exe.rb
deleted file mode 100644
index f74ed014ce..0000000000
--- a/spec/mspec/lib/mspec/helpers/ruby_exe.rb
+++ /dev/null
@@ -1,186 +0,0 @@
-require 'mspec/guards/platform'
-require 'mspec/helpers/tmp'
-
-# The ruby_exe helper provides a wrapper for invoking the
-# same Ruby interpreter with the same falgs as the one running
-# the specs and getting the output from running the code.
-# If +code+ is a file that exists, it will be run.
-# Otherwise, +code+ should be Ruby code that will be run with
-# the -e command line option. For example:
-#
-# ruby_exe('path/to/some/file.rb')
-#
-# will be executed as
-#
-# `#{RUBY_EXE} 'path/to/some/file.rb'`
-#
-# while
-#
-# ruby_exe('puts "hello, world."')
-#
-# will be executed as
-#
-# `#{RUBY_EXE} -e 'puts "hello, world."'`
-#
-# The ruby_exe helper also accepts an options hash with three
-# keys: :options, :args and :env. For example:
-#
-# ruby_exe('file.rb', :options => "-w",
-# :args => "> file.txt",
-# :env => { :FOO => "bar" })
-#
-# will be executed as
-#
-# `#{RUBY_EXE} -w #{'file.rb'} > file.txt`
-#
-# with access to ENV["FOO"] with value "bar".
-#
-# If +nil+ is passed for the first argument, the command line
-# will be built only from the options hash.
-#
-# If no arguments are passed to ruby_exe, it returns an Array
-# containing the interpreter executable and the flags:
-#
-# spawn(*ruby_exe, "-e", "puts :hello")
-#
-# This avoids spawning an extra shell, and ensure the pid returned by spawn
-# corresponds to the ruby process and not the shell.
-#
-# The RUBY_EXE constant is setup by mspec automatically
-# and is used by ruby_exe and ruby_cmd. The mspec runner script
-# will set ENV['RUBY_EXE'] to the name of the executable used
-# to invoke the mspec-run script. The value of RUBY_EXE will be
-# constructed as follows:
-#
-# 1. the value of ENV['RUBY_EXE']
-# 2. an explicit value based on RUBY_ENGINE
-# 3. cwd/(RUBY_ENGINE + $(EXEEXT) || $(exeext) || '')
-# 4. $(bindir)/$(RUBY_INSTALL_NAME)
-#
-# The value will only be used if the file exists and is executable.
-# The flags will then be appended to the resulting value.
-#
-# These 4 ways correspond to the following scenarios:
-#
-# 1. Using the MSpec runner scripts, the name of the
-# executable is explicitly passed by ENV['RUBY_EXE']
-# so there is no ambiguity.
-#
-# Otherwise, if using RSpec (or something else)
-#
-# 2. Running the specs while developing an alternative
-# Ruby implementation. This explicitly names the
-# executable in the development directory based on
-# the value of RUBY_ENGINE.
-# 3. Running the specs within the source directory for
-# some implementation. (E.g. a local build directory.)
-# 4. Running the specs against some installed Ruby
-# implementation.
-#
-# Additionally, the flags passed to mspec
-# (with -T on the command line or in the config with set :flags)
-# will be appended to RUBY_EXE so that the interpreter
-# is always called with those flags.
-
-def ruby_exe_options(option)
- case option
- when :env
- ENV['RUBY_EXE']
- when :engine
- case RUBY_ENGINE
- when 'rbx'
- "bin/rbx"
- when 'jruby'
- "bin/jruby"
- when 'maglev'
- "maglev-ruby"
- when 'topaz'
- "topaz"
- when 'ironruby'
- "ir"
- end
- when :name
- require 'rbconfig'
- bin = RUBY_ENGINE + (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
- File.join(".", bin)
- when :install_name
- require 'rbconfig'
- bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
- bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
- File.join(RbConfig::CONFIG['bindir'], bin)
- end
-end
-
-def resolve_ruby_exe
- [:env, :engine, :name, :install_name].each do |option|
- next unless exe = ruby_exe_options(option)
-
- if File.file?(exe) and File.executable?(exe)
- exe = File.expand_path(exe)
- exe = exe.tr('/', '\\') if PlatformGuard.windows?
- flags = ENV['RUBY_FLAGS']
- if flags and !flags.empty?
- return exe + ' ' + flags
- else
- return exe
- end
- end
- end
- raise Exception, "Unable to find a suitable ruby executable."
-end
-
-def ruby_exe(code = :not_given, opts = {})
- if opts[:dir]
- raise "ruby_exe(..., dir: dir) is no longer supported, use Dir.chdir"
- end
-
- if code == :not_given
- return RUBY_EXE.split(' ')
- end
-
- env = opts[:env] || {}
- saved_env = {}
- env.each do |key, value|
- key = key.to_s
- saved_env[key] = ENV[key] if ENV.key? key
- ENV[key] = value
- end
-
- escape = opts.delete(:escape)
- if code and !File.exist?(code) and escape != false
- tmpfile = tmp("rubyexe.rb")
- File.open(tmpfile, "w") { |f| f.write(code) }
- code = tmpfile
- end
-
- begin
- platform_is_not :opal do
- `#{ruby_cmd(code, opts)}`
- end
- ensure
- saved_env.each { |key, value| ENV[key] = value }
- env.keys.each do |key|
- key = key.to_s
- ENV.delete key unless saved_env.key? key
- end
- File.delete tmpfile if tmpfile
- end
-end
-
-def ruby_cmd(code, opts = {})
- body = code
-
- if opts[:escape]
- raise "escape: true is no longer supported in ruby_cmd, use ruby_exe or a fixture"
- end
-
- if code and !File.exist?(code)
- body = "-e #{code.inspect}"
- end
-
- [RUBY_EXE, opts[:options], body, opts[:args]].compact.join(' ')
-end
-
-unless Object.const_defined?(:RUBY_EXE) and RUBY_EXE
- RUBY_EXE = resolve_ruby_exe
-end
diff --git a/spec/mspec/lib/mspec/helpers/scratch.rb b/spec/mspec/lib/mspec/helpers/scratch.rb
deleted file mode 100644
index a6b0c02748..0000000000
--- a/spec/mspec/lib/mspec/helpers/scratch.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module ScratchPad
- def self.clear
- @record = nil
- end
-
- def self.record(arg)
- @record = arg
- end
-
- def self.<<(arg)
- @record << arg
- end
-
- def self.recorded
- @record
- end
-end
diff --git a/spec/mspec/lib/mspec/helpers/tmp.rb b/spec/mspec/lib/mspec/helpers/tmp.rb
deleted file mode 100644
index 4e1273dcfe..0000000000
--- a/spec/mspec/lib/mspec/helpers/tmp.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# Creates a temporary directory in the current working directory
-# for temporary files created while running the specs. All specs
-# should clean up any temporary files created so that the temp
-# directory is empty when the process exits.
-
-SPEC_TEMP_DIR = File.expand_path(ENV["SPEC_TEMP_DIR"] || "rubyspec_temp")
-
-SPEC_TEMP_UNIQUIFIER = "0"
-
-SPEC_TEMP_DIR_PID = Process.pid
-
-at_exit do
- begin
- if SPEC_TEMP_DIR_PID == Process.pid
- Dir.delete SPEC_TEMP_DIR if File.directory? SPEC_TEMP_DIR
- end
- rescue SystemCallError
- STDERR.puts <<-EOM
-
------------------------------------------------------
-The rubyspec temp directory is not empty. Ensure that
-all specs are cleaning up temporary files:
- #{SPEC_TEMP_DIR}
------------------------------------------------------
-
- EOM
- rescue Object => e
- STDERR.puts "failed to remove spec temp directory"
- STDERR.puts e.message
- end
-end
-
-def tmp(name, uniquify=true)
- Dir.mkdir SPEC_TEMP_DIR unless Dir.exist? SPEC_TEMP_DIR
-
- if uniquify and !name.empty?
- slash = name.rindex "/"
- index = slash ? slash + 1 : 0
- name.insert index, "#{SPEC_TEMP_UNIQUIFIER.succ!}-"
- end
-
- File.join SPEC_TEMP_DIR, name
-end
diff --git a/spec/mspec/lib/mspec/helpers/warning.rb b/spec/mspec/lib/mspec/helpers/warning.rb
deleted file mode 100644
index 9e093074e5..0000000000
--- a/spec/mspec/lib/mspec/helpers/warning.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-def suppress_warning
- verbose = $VERBOSE
- $VERBOSE = nil
- yield
-ensure
- $VERBOSE = verbose
-end
diff --git a/spec/mspec/lib/mspec/matchers.rb b/spec/mspec/lib/mspec/matchers.rb
deleted file mode 100644
index 8eab73198a..0000000000
--- a/spec/mspec/lib/mspec/matchers.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'mspec/matchers/base'
-require 'mspec/matchers/be_an_instance_of'
-require 'mspec/matchers/be_ancestor_of'
-require 'mspec/matchers/be_close'
-require 'mspec/matchers/be_computed_by'
-require 'mspec/matchers/be_empty'
-require 'mspec/matchers/be_false'
-require 'mspec/matchers/be_kind_of'
-require 'mspec/matchers/be_nan'
-require 'mspec/matchers/be_nil'
-require 'mspec/matchers/be_true'
-require 'mspec/matchers/be_true_or_false'
-require 'mspec/matchers/complain'
-require 'mspec/matchers/eql'
-require 'mspec/matchers/equal'
-require 'mspec/matchers/equal_element'
-require 'mspec/matchers/have_constant'
-require 'mspec/matchers/have_class_variable'
-require 'mspec/matchers/have_instance_method'
-require 'mspec/matchers/have_instance_variable'
-require 'mspec/matchers/have_method'
-require 'mspec/matchers/have_private_instance_method'
-require 'mspec/matchers/have_private_method'
-require 'mspec/matchers/have_protected_instance_method'
-require 'mspec/matchers/have_public_instance_method'
-require 'mspec/matchers/have_singleton_method'
-require 'mspec/matchers/include'
-require 'mspec/matchers/infinity'
-require 'mspec/matchers/match_yaml'
-require 'mspec/matchers/raise_error'
-require 'mspec/matchers/output'
-require 'mspec/matchers/output_to_fd'
-require 'mspec/matchers/respond_to'
-require 'mspec/matchers/signed_zero'
-require 'mspec/matchers/block_caller'
diff --git a/spec/mspec/lib/mspec/matchers/base.rb b/spec/mspec/lib/mspec/matchers/base.rb
deleted file mode 100644
index fc2d36c84a..0000000000
--- a/spec/mspec/lib/mspec/matchers/base.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-module MSpecMatchers
-end
-
-class MSpecEnv
- include MSpecMatchers
-end
-
-# Expectations are sometimes used in a module body
-class Module
- include MSpecMatchers
-end
-
-class SpecPositiveOperatorMatcher
- def initialize(actual)
- @actual = actual
- end
-
- def ==(expected)
- unless @actual == expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to equal #{expected.pretty_inspect}")
- end
- end
-
- def <(expected)
- unless @actual < expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to be less than #{expected.pretty_inspect}")
- end
- end
-
- def <=(expected)
- unless @actual <= expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to be less than or equal to #{expected.pretty_inspect}")
- end
- end
-
- def >(expected)
- unless @actual > expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to be greater than #{expected.pretty_inspect}")
- end
- end
-
- def >=(expected)
- unless @actual >= expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to be greater than or equal to #{expected.pretty_inspect}")
- end
- end
-
- def =~(expected)
- unless @actual =~ expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "to match #{expected.pretty_inspect}")
- end
- end
-end
-
-class SpecNegativeOperatorMatcher
- def initialize(actual)
- @actual = actual
- end
-
- def ==(expected)
- if @actual == expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to equal #{expected.pretty_inspect}")
- end
- end
-
- def <(expected)
- if @actual < expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to be less than #{expected.pretty_inspect}")
- end
- end
-
- def <=(expected)
- if @actual <= expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to be less than or equal to #{expected.pretty_inspect}")
- end
- end
-
- def >(expected)
- if @actual > expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to be greater than #{expected.pretty_inspect}")
- end
- end
-
- def >=(expected)
- if @actual >= expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to be greater than or equal to #{expected.pretty_inspect}")
- end
- end
-
- def =~(expected)
- if @actual =~ expected
- SpecExpectation.fail_with("Expected #{@actual.pretty_inspect}",
- "not to match #{expected.pretty_inspect}")
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_an_instance_of.rb b/spec/mspec/lib/mspec/matchers/be_an_instance_of.rb
deleted file mode 100644
index fdf3736ac2..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_an_instance_of.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class BeAnInstanceOfMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @actual.instance_of?(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})",
- "to be an instance of #{@expected}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})",
- "not to be an instance of #{@expected}"]
- end
-end
-
-module MSpecMatchers
- private def be_an_instance_of(expected)
- BeAnInstanceOfMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_ancestor_of.rb b/spec/mspec/lib/mspec/matchers/be_ancestor_of.rb
deleted file mode 100644
index 05f72099e4..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_ancestor_of.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class BeAncestorOfMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @expected.ancestors.include? @actual
- end
-
- def failure_message
- ["Expected #{@actual}", "to be an ancestor of #{@expected}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual}", "not to be an ancestor of #{@expected}"]
- end
-end
-
-module MSpecMatchers
- private def be_ancestor_of(expected)
- BeAncestorOfMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_close.rb b/spec/mspec/lib/mspec/matchers/be_close.rb
deleted file mode 100644
index 8662aabd26..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_close.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-TOLERANCE = 0.00003 unless Object.const_defined?(:TOLERANCE)
-
-class BeCloseMatcher
- def initialize(expected, tolerance)
- @expected = expected
- @tolerance = tolerance
- end
-
- def matches?(actual)
- @actual = actual
- (@actual - @expected).abs < @tolerance
- end
-
- def failure_message
- ["Expected #{@actual}", "to be within #{@expected} +/- #{@tolerance}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual}", "not to be within #{@expected} +/- #{@tolerance}"]
- end
-end
-
-module MSpecMatchers
- private def be_close(expected, tolerance)
- BeCloseMatcher.new(expected, tolerance)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_computed_by.rb b/spec/mspec/lib/mspec/matchers/be_computed_by.rb
deleted file mode 100644
index 2e31bc93af..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_computed_by.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class BeComputedByMatcher
- def initialize(sym, *args)
- @method = sym
- @args = args
- end
-
- def matches?(array)
- array.each do |line|
- @receiver = line.shift
- @value = line.pop
- @arguments = line
- @arguments += @args
- @actual = @receiver.send(@method, *@arguments)
- return false unless @actual == @value
- end
-
- return true
- end
-
- def method_call
- method_call = "#{@receiver.inspect}.#{@method}"
- unless @arguments.empty?
- method_call = "#{method_call} from #{@arguments.map { |x| x.inspect }.join(", ")}"
- end
- method_call
- end
-
- def failure_message
- ["Expected #{@value.inspect}", "to be computed by #{method_call} (computed #{@actual.inspect} instead)"]
- end
-end
-
-module MSpecMatchers
- private def be_computed_by(sym, *args)
- BeComputedByMatcher.new(sym, *args)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_empty.rb b/spec/mspec/lib/mspec/matchers/be_empty.rb
deleted file mode 100644
index 5abd5c9485..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_empty.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeEmptyMatcher
- def matches?(actual)
- @actual = actual
- @actual.empty?
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to be empty"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to be empty"]
- end
-end
-
-module MSpecMatchers
- private def be_empty
- BeEmptyMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_false.rb b/spec/mspec/lib/mspec/matchers/be_false.rb
deleted file mode 100644
index 9e9a2608e1..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_false.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeFalseMatcher
- def matches?(actual)
- @actual = actual
- @actual == false
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to be false"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to be false"]
- end
-end
-
-module MSpecMatchers
- private def be_false
- BeFalseMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_kind_of.rb b/spec/mspec/lib/mspec/matchers/be_kind_of.rb
deleted file mode 100644
index a69906f210..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_kind_of.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class BeKindOfMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @actual.is_a?(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})", "to be kind of #{@expected}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})", "not to be kind of #{@expected}"]
- end
-end
-
-module MSpecMatchers
- private def be_kind_of(expected)
- BeKindOfMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_nan.rb b/spec/mspec/lib/mspec/matchers/be_nan.rb
deleted file mode 100644
index b279d8f1cf..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_nan.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeNaNMatcher
- def matches?(actual)
- @actual = actual
- @actual.kind_of?(Float) && @actual.nan?
- end
-
- def failure_message
- ["Expected #{@actual}", "to be NaN"]
- end
-
- def negative_failure_message
- ["Expected #{@actual}", "not to be NaN"]
- end
-end
-
-module MSpecMatchers
- private def be_nan
- BeNaNMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_nil.rb b/spec/mspec/lib/mspec/matchers/be_nil.rb
deleted file mode 100644
index 049b1e3a53..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_nil.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeNilMatcher
- def matches?(actual)
- @actual = actual
- @actual.nil?
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to be nil"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to be nil"]
- end
-end
-
-module MSpecMatchers
- private def be_nil
- BeNilMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_true.rb b/spec/mspec/lib/mspec/matchers/be_true.rb
deleted file mode 100644
index 52f5013752..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_true.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeTrueMatcher
- def matches?(actual)
- @actual = actual
- @actual == true
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to be true"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to be true"]
- end
-end
-
-module MSpecMatchers
- private def be_true
- BeTrueMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/be_true_or_false.rb b/spec/mspec/lib/mspec/matchers/be_true_or_false.rb
deleted file mode 100644
index 4294b08d1b..0000000000
--- a/spec/mspec/lib/mspec/matchers/be_true_or_false.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class BeTrueOrFalseMatcher
- def matches?(actual)
- @actual = actual
- @actual == true || @actual == false
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to be true or false"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to be true or false"]
- end
-end
-
-module MSpecMatchers
- private def be_true_or_false
- BeTrueOrFalseMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/block_caller.rb b/spec/mspec/lib/mspec/matchers/block_caller.rb
deleted file mode 100644
index 017bce3cb7..0000000000
--- a/spec/mspec/lib/mspec/matchers/block_caller.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-class BlockingMatcher
- def matches?(block)
- started = false
- blocking = true
-
- thread = Thread.new do
- started = true
- block.call
-
- blocking = false
- end
-
- while !started and status = thread.status and status != "sleep"
- Thread.pass
- end
- thread.kill
- thread.join
-
- blocking
- end
-
- def failure_message
- ['Expected the given Proc', 'to block the caller']
- end
-
- def negative_failure_message
- ['Expected the given Proc', 'to not block the caller']
- end
-end
-
-module MSpecMatchers
- private def block_caller(timeout = 0.1)
- BlockingMatcher.new
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/complain.rb b/spec/mspec/lib/mspec/matchers/complain.rb
deleted file mode 100644
index 4bcb255040..0000000000
--- a/spec/mspec/lib/mspec/matchers/complain.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'mspec/helpers/io'
-
-class ComplainMatcher
- def initialize(complaint)
- @complaint = complaint
- end
-
- def matches?(proc)
- @saved_err = $stderr
- @verbose = $VERBOSE
- begin
- err = $stderr = IOStub.new
- $VERBOSE = false
- Thread.current[:in_mspec_complain_matcher] = true
- proc.call
- ensure
- $VERBOSE = @verbose
- $stderr = @saved_err
- Thread.current[:in_mspec_complain_matcher] = false
- end
-
- @warning = err.to_s
- unless @complaint.nil?
- case @complaint
- when Regexp
- return false unless @warning =~ @complaint
- else
- return false unless @warning == @complaint
- end
- end
-
- return @warning.empty? ? false : true
- end
-
- def failure_message
- if @complaint.nil?
- ["Expected a warning", "but received none"]
- elsif @complaint.kind_of? Regexp
- ["Expected warning to match: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
- else
- ["Expected warning: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
- end
- end
-
- def negative_failure_message
- if @complaint.nil?
- ["Unexpected warning: ", @warning.chomp.inspect]
- elsif @complaint.kind_of? Regexp
- ["Expected warning not to match: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
- else
- ["Expected warning: #{@complaint.inspect}", "but got: #{@warning.chomp.inspect}"]
- end
- end
-end
-
-module MSpecMatchers
- private def complain(complaint=nil)
- ComplainMatcher.new(complaint)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/eql.rb b/spec/mspec/lib/mspec/matchers/eql.rb
deleted file mode 100644
index a855789550..0000000000
--- a/spec/mspec/lib/mspec/matchers/eql.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class EqlMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @actual.eql?(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.pretty_inspect}",
- "to have same value and type as #{@expected.pretty_inspect}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.pretty_inspect}",
- "not to have same value or type as #{@expected.pretty_inspect}"]
- end
-end
-
-module MSpecMatchers
- private def eql(expected)
- EqlMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/equal.rb b/spec/mspec/lib/mspec/matchers/equal.rb
deleted file mode 100644
index 5dc77d27ea..0000000000
--- a/spec/mspec/lib/mspec/matchers/equal.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class EqualMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @actual.equal?(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.pretty_inspect}",
- "to be identical to #{@expected.pretty_inspect}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.pretty_inspect}",
- "not to be identical to #{@expected.pretty_inspect}"]
- end
-end
-
-module MSpecMatchers
- private def equal(expected)
- EqualMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/equal_element.rb b/spec/mspec/lib/mspec/matchers/equal_element.rb
deleted file mode 100644
index 1e9dfbcca1..0000000000
--- a/spec/mspec/lib/mspec/matchers/equal_element.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-class EqualElementMatcher
- def initialize(element, attributes = nil, content = nil, options = {})
- @element = element
- @attributes = attributes
- @content = content
- @options = options
- end
-
- def matches?(actual)
- @actual = actual
-
- matched = true
-
- if @options[:not_closed]
- matched &&= actual =~ /^#{Regexp.quote("<" + @element)}.*#{Regexp.quote(">" + (@content || ''))}$/
- else
- matched &&= actual =~ /^#{Regexp.quote("<" + @element)}/
- matched &&= actual =~ /#{Regexp.quote("</" + @element + ">")}$/
- matched &&= actual =~ /#{Regexp.quote(">" + @content + "</")}/ if @content
- end
-
- if @attributes
- if @attributes.empty?
- matched &&= actual.scan(/\w+\=\"(.*)\"/).size == 0
- else
- @attributes.each do |key, value|
- if value == true
- matched &&= (actual.scan(/#{Regexp.quote(key)}(\s|>)/).size == 1)
- else
- matched &&= (actual.scan(%Q{ #{key}="#{value}"}).size == 1)
- end
- end
- end
- end
-
- !!matched
- end
-
- def failure_message
- ["Expected #{@actual.pretty_inspect}",
- "to be a '#{@element}' element with #{attributes_for_failure_message} and #{content_for_failure_message}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.pretty_inspect}",
- "not to be a '#{@element}' element with #{attributes_for_failure_message} and #{content_for_failure_message}"]
- end
-
- def attributes_for_failure_message
- if @attributes
- if @attributes.empty?
- "no attributes"
- else
- @attributes.inject([]) { |memo, n| memo << %Q{#{n[0]}="#{n[1]}"} }.join(" ")
- end
- else
- "any attributes"
- end
- end
-
- def content_for_failure_message
- if @content
- if @content.empty?
- "no content"
- else
- "#{@content.inspect} as content"
- end
- else
- "any content"
- end
- end
-end
-
-module MSpecMatchers
- private def equal_element(*args)
- EqualElementMatcher.new(*args)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_class_variable.rb b/spec/mspec/lib/mspec/matchers/have_class_variable.rb
deleted file mode 100644
index dd43ced621..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_class_variable.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'mspec/matchers/variable'
-
-class HaveClassVariableMatcher < VariableMatcher
- self.variables_method = :class_variables
- self.description = 'class variable'
-end
-
-module MSpecMatchers
- private def have_class_variable(variable)
- HaveClassVariableMatcher.new(variable)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_constant.rb b/spec/mspec/lib/mspec/matchers/have_constant.rb
deleted file mode 100644
index 6ec7c75b85..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_constant.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'mspec/matchers/variable'
-
-class HaveConstantMatcher < VariableMatcher
- self.variables_method = :constants
- self.description = 'constant'
-end
-
-module MSpecMatchers
- private def have_constant(variable)
- HaveConstantMatcher.new(variable)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_instance_method.rb b/spec/mspec/lib/mspec/matchers/have_instance_method.rb
deleted file mode 100644
index 636aaf3e47..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_instance_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HaveInstanceMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- mod.instance_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have instance method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have instance method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_instance_method(method, include_super=true)
- HaveInstanceMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_instance_variable.rb b/spec/mspec/lib/mspec/matchers/have_instance_variable.rb
deleted file mode 100644
index de51b3209d..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_instance_variable.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'mspec/matchers/variable'
-
-class HaveInstanceVariableMatcher < VariableMatcher
- self.variables_method = :instance_variables
- self.description = 'instance variable'
-end
-
-module MSpecMatchers
- private def have_instance_variable(variable)
- HaveInstanceVariableMatcher.new(variable)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_method.rb b/spec/mspec/lib/mspec/matchers/have_method.rb
deleted file mode 100644
index 35dae03af0..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HaveMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- @mod.methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_method(method, include_super=true)
- HaveMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_private_instance_method.rb b/spec/mspec/lib/mspec/matchers/have_private_instance_method.rb
deleted file mode 100644
index 4eb7133055..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_private_instance_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HavePrivateInstanceMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- mod.private_instance_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have private instance method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have private instance method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_private_instance_method(method, include_super=true)
- HavePrivateInstanceMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_private_method.rb b/spec/mspec/lib/mspec/matchers/have_private_method.rb
deleted file mode 100644
index 3433d982cc..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_private_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HavePrivateMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- mod.private_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have private method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have private method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_private_method(method, include_super=true)
- HavePrivateMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_protected_instance_method.rb b/spec/mspec/lib/mspec/matchers/have_protected_instance_method.rb
deleted file mode 100644
index 641d4d0dc2..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_protected_instance_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HaveProtectedInstanceMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- mod.protected_instance_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have protected instance method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have protected instance method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_protected_instance_method(method, include_super=true)
- HaveProtectedInstanceMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_public_instance_method.rb b/spec/mspec/lib/mspec/matchers/have_public_instance_method.rb
deleted file mode 100644
index 501c0a418e..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_public_instance_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HavePublicInstanceMethodMatcher < MethodMatcher
- def matches?(mod)
- @mod = mod
- mod.public_instance_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@mod} to have public instance method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@mod} NOT to have public instance method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_public_instance_method(method, include_super=true)
- HavePublicInstanceMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/have_singleton_method.rb b/spec/mspec/lib/mspec/matchers/have_singleton_method.rb
deleted file mode 100644
index 95d78709ff..0000000000
--- a/spec/mspec/lib/mspec/matchers/have_singleton_method.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/matchers/method'
-
-class HaveSingletonMethodMatcher < MethodMatcher
- def matches?(obj)
- @obj = obj
- obj.singleton_methods(@include_super).include? @method
- end
-
- def failure_message
- ["Expected #{@obj} to have singleton method '#{@method.to_s}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@obj} NOT to have singleton method '#{@method.to_s}'",
- "but it does"]
- end
-end
-
-module MSpecMatchers
- private def have_singleton_method(method, include_super=true)
- HaveSingletonMethodMatcher.new method, include_super
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/include.rb b/spec/mspec/lib/mspec/matchers/include.rb
deleted file mode 100644
index 0b7eaf3ce2..0000000000
--- a/spec/mspec/lib/mspec/matchers/include.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-class IncludeMatcher
- def initialize(*expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @expected.each do |e|
- @element = e
- unless @actual.include?(e)
- return false
- end
- end
- return true
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", "to include #{@element.inspect}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", "not to include #{@element.inspect}"]
- end
-end
-
-# Cannot override #include at the toplevel in MRI
-module MSpecMatchers
- private def include(*expected)
- IncludeMatcher.new(*expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/infinity.rb b/spec/mspec/lib/mspec/matchers/infinity.rb
deleted file mode 100644
index 8bfa6dbd10..0000000000
--- a/spec/mspec/lib/mspec/matchers/infinity.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-class InfinityMatcher
- def initialize(expected_sign)
- @expected_sign = expected_sign
- end
-
- def matches?(actual)
- @actual = actual
- @actual.kind_of?(Float) && @actual.infinite? == @expected_sign
- end
-
- def failure_message
- ["Expected #{@actual}", "to be #{"-" if @expected_sign == -1}Infinity"]
- end
-
- def negative_failure_message
- ["Expected #{@actual}", "not to be #{"-" if @expected_sign == -1}Infinity"]
- end
-end
-
-module MSpecMatchers
- private def be_positive_infinity
- InfinityMatcher.new(1)
- end
-
- private def be_negative_infinity
- InfinityMatcher.new(-1)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/match_yaml.rb b/spec/mspec/lib/mspec/matchers/match_yaml.rb
deleted file mode 100644
index 920d85a14f..0000000000
--- a/spec/mspec/lib/mspec/matchers/match_yaml.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-class MatchYAMLMatcher
-
- def initialize(expected)
- if valid_yaml?(expected)
- @expected = expected
- else
- @expected = expected.to_yaml
- end
- end
-
- def matches?(actual)
- @actual = actual
- clean_yaml(@actual) == clean_yaml(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.inspect}", " to match #{@expected.inspect}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect}", " to match #{@expected.inspect}"]
- end
-
- protected
-
- def clean_yaml(yaml)
- yaml.gsub(/([^-]|^---)\s+\n/, "\\1\n").sub(/\n\.\.\.\n$/, "\n")
- end
-
- def valid_yaml?(obj)
- require 'yaml'
- begin
- YAML.load(obj)
- rescue
- false
- else
- true
- end
- end
-end
-
-module MSpecMatchers
- private def match_yaml(expected)
- MatchYAMLMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/method.rb b/spec/mspec/lib/mspec/matchers/method.rb
deleted file mode 100644
index e8cdfa62ff..0000000000
--- a/spec/mspec/lib/mspec/matchers/method.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-class MethodMatcher
- def initialize(method, include_super=true)
- @include_super = include_super
- @method = method.to_sym
- end
-
- def matches?(mod)
- raise Exception, "define #matches? in the subclass"
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/output.rb b/spec/mspec/lib/mspec/matchers/output.rb
deleted file mode 100644
index b89b6ca0f6..0000000000
--- a/spec/mspec/lib/mspec/matchers/output.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require 'mspec/helpers/io'
-
-class OutputMatcher
- def initialize(stdout, stderr)
- @out = stdout
- @err = stderr
- end
-
- def matches?(proc)
- @saved_out = $stdout
- @saved_err = $stderr
- @stdout = $stdout = IOStub.new
- @stderr = $stderr = IOStub.new
-
- proc.call
-
- unless @out.nil?
- case @out
- when Regexp
- return false unless $stdout =~ @out
- else
- return false unless $stdout == @out
- end
- end
-
- unless @err.nil?
- case @err
- when Regexp
- return false unless $stderr =~ @err
- else
- return false unless $stderr == @err
- end
- end
-
- return true
- ensure
- $stdout = @saved_out
- $stderr = @saved_err
- end
-
- def failure_message
- expected_out = "\n"
- actual_out = "\n"
- unless @out.nil?
- expected_out += " $stdout: #{@out.inspect}\n"
- actual_out += " $stdout: #{@stdout.inspect}\n"
- end
- unless @err.nil?
- expected_out += " $stderr: #{@err.inspect}\n"
- actual_out += " $stderr: #{@stderr.inspect}\n"
- end
- ["Expected:#{expected_out}", " got:#{actual_out}"]
- end
-
- def negative_failure_message
- out = ""
- out += " $stdout: #{@stdout.chomp.dump}\n" unless @out.nil?
- out += " $stderr: #{@stderr.chomp.dump}\n" unless @err.nil?
- ["Expected output not to be:\n", out]
- end
-end
-
-module MSpecMatchers
- private def output(stdout=nil, stderr=nil)
- OutputMatcher.new(stdout, stderr)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/output_to_fd.rb b/spec/mspec/lib/mspec/matchers/output_to_fd.rb
deleted file mode 100644
index f4d7b4ea1f..0000000000
--- a/spec/mspec/lib/mspec/matchers/output_to_fd.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require 'mspec/helpers/tmp'
-
-# Lower-level output speccing mechanism for a single
-# output stream. Unlike OutputMatcher which provides
-# methods to capture the output, we actually replace
-# the FD itself so that there is no reliance on a
-# certain method being used.
-class OutputToFDMatcher
- def initialize(expected, to)
- @to, @expected = to, expected
-
- case @to
- when STDOUT
- @to_name = "STDOUT"
- when STDERR
- @to_name = "STDERR"
- when IO
- @to_name = @to.object_id.to_s
- else
- raise ArgumentError, "#{@to.inspect} is not a supported output target"
- end
- end
-
- def with_tmp
- path = tmp("mspec_output_to_#{$$}_#{Time.now.to_i}")
- File.open(path, 'w+') { |io|
- yield(io)
- }
- ensure
- File.delete path if path
- end
-
- def matches?(block)
- old_to = @to.dup
- with_tmp do |out|
- # Replacing with a file handle so that Readline etc. work
- @to.reopen out
- begin
- block.call
- ensure
- @to.reopen old_to
- old_to.close
- end
-
- out.rewind
- @actual = out.read
-
- case @expected
- when Regexp
- !(@actual =~ @expected).nil?
- else
- @actual == @expected
- end
- end
- end
-
- def failure_message()
- ["Expected (#{@to_name}): #{@expected.inspect}\n",
- "#{'but got'.rjust(@to_name.length + 10)}: #{@actual.inspect}\nBacktrace"]
- end
-
- def negative_failure_message()
- ["Expected output (#{@to_name}) to NOT be:\n", @actual.inspect]
- end
-end
-
-module MSpecMatchers
- private def output_to_fd(what, where = STDOUT)
- OutputToFDMatcher.new what, where
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/raise_error.rb b/spec/mspec/lib/mspec/matchers/raise_error.rb
deleted file mode 100644
index 2f9afdc687..0000000000
--- a/spec/mspec/lib/mspec/matchers/raise_error.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require 'mspec/utils/deprecate'
-
-class RaiseErrorMatcher
- def initialize(exception, message, &block)
- @exception = exception
- @message = message
- @block = block
- @actual = nil
- end
-
- def matches?(proc)
- @result = proc.call
- return false
- rescue Exception => actual
- @actual = actual
- if matching_exception?(actual)
- return true
- else
- raise actual
- end
- end
-
- def matching_exception?(exc)
- return false unless @exception === exc
- if @message then
- case @message
- when String
- return false if @message != exc.message
- when Regexp
- return false if @message !~ exc.message
- end
- end
-
- # The block has its own expectations and will throw an exception if it fails
- @block[exc] if @block
-
- return true
- end
-
- def exception_class_and_message(exception_class, message)
- if message
- "#{exception_class} (#{message})"
- else
- "#{exception_class}"
- end
- end
-
- def format_expected_exception
- exception_class_and_message(@exception, @message)
- end
-
- def format_exception(exception)
- exception_class_and_message(exception.class, exception.message)
- end
-
- def format_result(result)
- result.pretty_inspect.chomp
- rescue => e
- "#pretty_inspect raised #{e.class}; A #<#{result.class}>"
- end
-
- def failure_message
- message = ["Expected #{format_expected_exception}"]
-
- if @actual
- message << "but got #{format_exception(@actual)}"
- else
- message << "but no exception was raised (#{format_result(@result)} was returned)"
- end
-
- message
- end
-
- def negative_failure_message
- message = ["Expected to not get #{format_expected_exception}", ""]
- unless @actual.class == @exception
- message[1] = "but got #{format_exception(@actual)}"
- end
- message
- end
-end
-
-module MSpecMatchers
- private def raise_error(exception=Exception, message=nil, &block)
- RaiseErrorMatcher.new(exception, message, &block)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/respond_to.rb b/spec/mspec/lib/mspec/matchers/respond_to.rb
deleted file mode 100644
index 6b35ae2d3c..0000000000
--- a/spec/mspec/lib/mspec/matchers/respond_to.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class RespondToMatcher
- def initialize(expected)
- @expected = expected
- end
-
- def matches?(actual)
- @actual = actual
- @actual.respond_to?(@expected)
- end
-
- def failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})", "to respond to #{@expected}"]
- end
-
- def negative_failure_message
- ["Expected #{@actual.inspect} (#{@actual.class})", "not to respond to #{@expected}"]
- end
-end
-
-module MSpecMatchers
- private def respond_to(expected)
- RespondToMatcher.new(expected)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/signed_zero.rb b/spec/mspec/lib/mspec/matchers/signed_zero.rb
deleted file mode 100644
index 2ff90f4994..0000000000
--- a/spec/mspec/lib/mspec/matchers/signed_zero.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-class SignedZeroMatcher
- def initialize(expected_sign)
- @expected_sign = expected_sign
- end
-
- def matches?(actual)
- @actual = actual
- (1.0/actual).infinite? == @expected_sign
- end
-
- def failure_message
- ["Expected #{@actual}", "to be #{"-" if @expected_sign == -1}0.0"]
- end
-
- def negative_failure_message
- ["Expected #{@actual}", "not to be #{"-" if @expected_sign == -1}0.0"]
- end
-end
-
-module MSpecMatchers
- private def be_positive_zero
- SignedZeroMatcher.new(1)
- end
-
- private def be_negative_zero
- SignedZeroMatcher.new(-1)
- end
-end
diff --git a/spec/mspec/lib/mspec/matchers/variable.rb b/spec/mspec/lib/mspec/matchers/variable.rb
deleted file mode 100644
index 4d801ea337..0000000000
--- a/spec/mspec/lib/mspec/matchers/variable.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class VariableMatcher
- class << self
- attr_accessor :variables_method, :description
- end
-
- def initialize(variable)
- @variable = variable.to_sym
- end
-
- def matches?(object)
- @object = object
- @object.send(self.class.variables_method).include? @variable
- end
-
- def failure_message
- ["Expected #{@object} to have #{self.class.description} '#{@variable}'",
- "but it does not"]
- end
-
- def negative_failure_message
- ["Expected #{@object} NOT to have #{self.class.description} '#{@variable}'",
- "but it does"]
- end
-end
diff --git a/spec/mspec/lib/mspec/mocks.rb b/spec/mspec/lib/mspec/mocks.rb
deleted file mode 100644
index 6a029c7b53..0000000000
--- a/spec/mspec/lib/mspec/mocks.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'mspec/mocks/mock'
-require 'mspec/mocks/proxy'
-require 'mspec/mocks/object'
diff --git a/spec/mspec/lib/mspec/mocks/mock.rb b/spec/mspec/lib/mspec/mocks/mock.rb
deleted file mode 100644
index b11d469186..0000000000
--- a/spec/mspec/lib/mspec/mocks/mock.rb
+++ /dev/null
@@ -1,198 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/helpers/warning'
-
-module Mock
- def self.reset
- @mocks = @stubs = @objects = nil
- end
-
- def self.objects
- @objects ||= {}
- end
-
- def self.mocks
- @mocks ||= Hash.new { |h,k| h[k] = [] }
- end
-
- def self.stubs
- @stubs ||= Hash.new { |h,k| h[k] = [] }
- end
-
- def self.replaced_name(obj, sym)
- :"__mspec_#{obj.__id__}_#{sym}__"
- end
-
- def self.replaced_key(obj, sym)
- [replaced_name(obj, sym), sym]
- end
-
- def self.has_key?(keys, sym)
- !!keys.find { |k| k.first == sym }
- end
-
- def self.replaced?(sym)
- has_key?(mocks.keys, sym) or has_key?(stubs.keys, sym)
- end
-
- def self.clear_replaced(key)
- mocks.delete key
- stubs.delete key
- end
-
- def self.mock_respond_to?(obj, sym, include_private = false)
- name = replaced_name(obj, :respond_to?)
- if replaced? name
- obj.__send__ name, sym, include_private
- else
- obj.respond_to? sym, include_private
- end
- end
-
- def self.install_method(obj, sym, type=nil)
- meta = obj.singleton_class
-
- key = replaced_key obj, sym
- sym = sym.to_sym
-
- if (sym == :respond_to? or mock_respond_to?(obj, sym, true)) and !replaced?(key.first)
- meta.__send__ :alias_method, key.first, sym
- end
-
- suppress_warning {
- meta.class_eval {
- define_method(sym) do |*args, &block|
- Mock.verify_call self, sym, *args, &block
- end
- }
- }
-
- proxy = MockProxy.new type
-
- if proxy.mock?
- MSpec.expectation
- MSpec.actions :expectation, MSpec.current.state
- end
-
- if proxy.stub?
- stubs[key].unshift proxy
- else
- mocks[key] << proxy
- end
- objects[key] = obj
-
- proxy
- end
-
- def self.name_or_inspect(obj)
- obj.instance_variable_get(:@name) || obj.inspect
- end
-
- def self.verify_count
- mocks.each do |key, proxies|
- obj = objects[key]
- proxies.each do |proxy|
- qualifier, count = proxy.count
- pass = case qualifier
- when :at_least
- proxy.calls >= count
- when :at_most
- proxy.calls <= count
- when :exactly
- proxy.calls == count
- when :any_number_of_times
- true
- else
- false
- end
- unless pass
- SpecExpectation.fail_with(
- "Mock '#{name_or_inspect obj}' expected to receive '#{key.last}' " + \
- "#{qualifier.to_s.sub('_', ' ')} #{count} times",
- "but received it #{proxy.calls} times")
- end
- end
- end
- end
-
- def self.verify_call(obj, sym, *args, &block)
- compare = *args
- compare = compare.first if compare.length <= 1
-
- key = replaced_key obj, sym
- [mocks, stubs].each do |proxies|
- proxies[key].each do |proxy|
- pass = case proxy.arguments
- when :any_args
- true
- when :no_args
- compare.nil?
- else
- proxy.arguments == compare
- end
-
- if proxy.yielding?
- if block
- proxy.yielding.each do |args_to_yield|
- if block.arity == -1 || block.arity == args_to_yield.size
- block.call(*args_to_yield)
- else
- SpecExpectation.fail_with(
- "Mock '#{name_or_inspect obj}' asked to yield " + \
- "|#{proxy.yielding.join(', ')}| on #{sym}\n",
- "but a block with arity #{block.arity} was passed")
- end
- end
- else
- SpecExpectation.fail_with(
- "Mock '#{name_or_inspect obj}' asked to yield " + \
- "|[#{proxy.yielding.join('], [')}]| on #{sym}\n",
- "but no block was passed")
- end
- end
-
- if pass
- proxy.called
-
- if proxy.raising?
- raise proxy.raising
- else
- return proxy.returning
- end
- end
- end
- end
-
- if sym.to_sym == :respond_to?
- mock_respond_to? obj, *args
- else
- SpecExpectation.fail_with("Mock '#{name_or_inspect obj}': method #{sym}\n",
- "called with unexpected arguments (#{Array(compare).join(' ')})")
- end
- end
-
- def self.cleanup
- objects.each do |key, obj|
- if obj.kind_of? MockIntObject
- clear_replaced key
- next
- end
-
- replaced = key.first
- sym = key.last
- meta = obj.singleton_class
-
- if mock_respond_to? obj, replaced, true
- suppress_warning do
- meta.__send__ :alias_method, sym, replaced
- end
- meta.__send__ :remove_method, replaced
- else
- meta.__send__ :remove_method, sym
- end
-
- clear_replaced key
- end
- ensure
- reset
- end
-end
diff --git a/spec/mspec/lib/mspec/mocks/object.rb b/spec/mspec/lib/mspec/mocks/object.rb
deleted file mode 100644
index 19a50ac4e1..0000000000
--- a/spec/mspec/lib/mspec/mocks/object.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'mspec/mocks/proxy'
-
-class Object
- def should_receive(sym)
- Mock.install_method self, sym
- end
-
- def should_not_receive(sym)
- proxy = Mock.install_method self, sym
- proxy.exactly(0).times
- end
-
- def stub!(sym)
- Mock.install_method self, sym, :stub
- end
-end
-
-def mock(name, options={})
- MockObject.new name, options
-end
-
-def mock_int(val)
- MockIntObject.new(val)
-end
-
-def mock_numeric(name, options={})
- NumericMockObject.new name, options
-end
diff --git a/spec/mspec/lib/mspec/mocks/proxy.rb b/spec/mspec/lib/mspec/mocks/proxy.rb
deleted file mode 100644
index f5acc89d62..0000000000
--- a/spec/mspec/lib/mspec/mocks/proxy.rb
+++ /dev/null
@@ -1,186 +0,0 @@
-class MockObject
- def initialize(name, options={})
- @name = name
- @null = options[:null_object]
- end
-
- def method_missing(sym, *args, &block)
- @null ? self : super
- end
- private :method_missing
-end
-
-class NumericMockObject < Numeric
- def initialize(name, options={})
- @name = name
- @null = options[:null_object]
- end
-
- def method_missing(sym, *args, &block)
- @null ? self : super
- end
-
- def singleton_method_added(val)
- end
-end
-
-class MockIntObject
- def initialize(val)
- @value = val
- @calls = 0
-
- key = [self, :to_int]
-
- Mock.objects[key] = self
- Mock.mocks[key] << self
- end
-
- attr_reader :calls
-
- def to_int
- @calls += 1
- @value.to_int
- end
-
- def count
- [:at_least, 1]
- end
-end
-
-class MockProxy
- attr_reader :raising, :yielding
-
- def initialize(type=nil)
- @multiple_returns = nil
- @returning = nil
- @raising = nil
- @yielding = []
- @arguments = :any_args
- @type = type || :mock
- end
-
- def mock?
- @type == :mock
- end
-
- def stub?
- @type == :stub
- end
-
- def count
- @count ||= mock? ? [:exactly, 1] : [:any_number_of_times, 0]
- end
-
- def arguments
- @arguments
- end
-
- def returning
- if @multiple_returns
- if @returning.size == 1
- @multiple_returns = false
- return @returning = @returning.shift
- end
- return @returning.shift
- end
- @returning
- end
-
- def times
- self
- end
-
- def calls
- @calls ||= 0
- end
-
- def called
- @calls = calls + 1
- end
-
- def exactly(n)
- @count = [:exactly, n_times(n)]
- self
- end
-
- def at_least(n)
- @count = [:at_least, n_times(n)]
- self
- end
-
- def at_most(n)
- @count = [:at_most, n_times(n)]
- self
- end
-
- def once
- exactly 1
- end
-
- def twice
- exactly 2
- end
-
- def any_number_of_times
- @count = [:any_number_of_times, 0]
- self
- end
-
- def with(*args)
- raise ArgumentError, "you must specify the expected arguments" if args.empty?
- if args.length == 1
- @arguments = args.first
- else
- @arguments = args
- end
- self
- end
-
- def and_return(*args)
- case args.size
- when 0
- @returning = nil
- when 1
- @returning = args[0]
- else
- @multiple_returns = true
- @returning = args
- count[1] = args.size if count[1] < args.size
- end
- self
- end
-
- def and_raise(exception)
- if exception.kind_of? String
- @raising = RuntimeError.new exception
- else
- @raising = exception
- end
- end
-
- def raising?
- @raising != nil
- end
-
- def and_yield(*args)
- @yielding << args
- self
- end
-
- def yielding?
- !@yielding.empty?
- end
-
- private
-
- def n_times(n)
- case n
- when :once
- 1
- when :twice
- 2
- else
- Integer n
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/runner.rb b/spec/mspec/lib/mspec/runner.rb
deleted file mode 100644
index df57b9f69b..0000000000
--- a/spec/mspec/lib/mspec/runner.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'mspec/mocks'
-require 'mspec/runner/mspec'
-require 'mspec/runner/context'
-require 'mspec/runner/evaluate'
-require 'mspec/runner/example'
-require 'mspec/runner/exception'
-require 'mspec/runner/object'
-require 'mspec/runner/formatters'
-require 'mspec/runner/actions'
-require 'mspec/runner/filters'
-require 'mspec/runner/shared'
-require 'mspec/runner/tag'
diff --git a/spec/mspec/lib/mspec/runner/actions.rb b/spec/mspec/lib/mspec/runner/actions.rb
deleted file mode 100644
index 0a5a05fbd1..0000000000
--- a/spec/mspec/lib/mspec/runner/actions.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'mspec/runner/actions/tally'
-require 'mspec/runner/actions/timer'
-require 'mspec/runner/actions/filter'
-require 'mspec/runner/actions/tag'
-require 'mspec/runner/actions/taglist'
-require 'mspec/runner/actions/tagpurge'
diff --git a/spec/mspec/lib/mspec/runner/actions/filter.rb b/spec/mspec/lib/mspec/runner/actions/filter.rb
deleted file mode 100644
index 35899c8dc8..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/filter.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'mspec/runner/filters/match'
-
-# ActionFilter is a base class for actions that are triggered by
-# specs that match the filter. The filter may be specified by
-# strings that match spec descriptions or by tags for strings
-# that match spec descriptions.
-#
-# Unlike TagFilter and RegexpFilter, ActionFilter instances do
-# not affect the specs that are run. The filter is only used to
-# trigger the action.
-
-class ActionFilter
- def initialize(tags=nil, descs=nil)
- @tags = Array(tags)
- descs = Array(descs)
- @sfilter = descs.empty? ? nil : MatchFilter.new(nil, *descs)
- @tfilter = nil
- end
-
- def ===(string)
- @sfilter === string or @tfilter === string
- end
-
- def load
- return if @tags.empty?
-
- desc = MSpec.read_tags(@tags).map { |t| t.description }
- return if desc.empty?
-
- @tfilter = MatchFilter.new(nil, *desc)
- end
-
- def register
- MSpec.register :load, self
- end
-
- def unregister
- MSpec.unregister :load, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
deleted file mode 100644
index ec17a156bf..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
+++ /dev/null
@@ -1,301 +0,0 @@
-# Adapted from ruby's test/lib/leakchecker.rb.
-# Ruby's 2-clause BSDL follows.
-
-# Copyright (C) 1993-2013 Yukihiro Matsumoto. 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.
-
-class LeakChecker
- def initialize
- @fd_info = find_fds
- @tempfile_info = find_tempfiles
- @thread_info = find_threads
- @env_info = find_env
- @argv_info = find_argv
- @encoding_info = find_encodings
- end
-
- def check(test_name)
- @no_leaks = true
- leaks = [
- check_fd_leak(test_name),
- check_tempfile_leak(test_name),
- check_thread_leak(test_name),
- check_process_leak(test_name),
- check_env(test_name),
- check_argv(test_name),
- check_encodings(test_name)
- ]
- GC.start if leaks.any?
- return leaks.none?
- end
-
- private
- def find_fds
- fd_dir = "/proc/self/fd"
- if File.directory?(fd_dir)
- fds = Dir.open(fd_dir) {|d|
- a = d.grep(/\A\d+\z/, &:to_i)
- if d.respond_to? :fileno
- a -= [d.fileno]
- end
- a
- }
- fds.sort
- else
- []
- end
- end
-
- def check_fd_leak(test_name)
- leaked = false
- live1 = @fd_info
- if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
- m[:close]
- end
- live2 = find_fds
- fd_closed = live1 - live2
- if !fd_closed.empty?
- fd_closed.each {|fd|
- puts "Closed file descriptor: #{test_name}: #{fd}"
- }
- end
- fd_leaked = live2 - live1
- if !fd_leaked.empty?
- leaked = true
- h = {}
- ObjectSpace.each_object(IO) {|io|
- inspect = io.inspect
- begin
- autoclose = io.autoclose?
- fd = io.fileno
- rescue IOError # closed IO object
- next
- end
- (h[fd] ||= []) << [io, autoclose, inspect]
- }
- fd_leaked.each {|fd|
- str = ''
- if h[fd]
- str << ' :'
- h[fd].map {|io, autoclose, inspect|
- s = ' ' + inspect
- s << "(not-autoclose)" if !autoclose
- s
- }.sort.each {|s|
- str << s
- }
- end
- puts "Leaked file descriptor: #{test_name}: #{fd}#{str}"
- }
- #system("lsof -p #$$") if !fd_leaked.empty?
- h.each {|fd, list|
- next if list.length <= 1
- if 1 < list.count {|io, autoclose, inspect| autoclose }
- str = list.map {|io, autoclose, inspect| " #{inspect}" + (autoclose ? "(autoclose)" : "") }.sort.join
- puts "Multiple autoclose IO object for a file descriptor:#{str}"
- end
- }
- end
- @fd_info = live2
- return leaked
- end
-
- def extend_tempfile_counter
- return if defined? LeakChecker::TempfileCounter
- m = Module.new {
- @count = 0
- class << self
- attr_accessor :count
- end
-
- def new(data)
- LeakChecker::TempfileCounter.count += 1
- super(data)
- end
- }
- LeakChecker.const_set(:TempfileCounter, m)
-
- class << Tempfile::Remover
- prepend LeakChecker::TempfileCounter
- end
- end
-
- def find_tempfiles(prev_count=-1)
- return [prev_count, []] unless defined? Tempfile
- extend_tempfile_counter
- count = TempfileCounter.count
- if prev_count == count
- [prev_count, []]
- else
- tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t| t.path }
- [count, tempfiles]
- end
- end
-
- def check_tempfile_leak(test_name)
- return false unless defined? Tempfile
- count1, initial_tempfiles = @tempfile_info
- count2, current_tempfiles = find_tempfiles(count1)
- leaked = false
- tempfiles_leaked = current_tempfiles - initial_tempfiles
- if !tempfiles_leaked.empty?
- leaked = true
- list = tempfiles_leaked.map {|t| t.inspect }.sort
- list.each {|str|
- puts "Leaked tempfile: #{test_name}: #{str}"
- }
- tempfiles_leaked.each {|t| t.close! }
- end
- @tempfile_info = [count2, initial_tempfiles]
- return leaked
- end
-
- def find_threads
- Thread.list.find_all {|t|
- t != Thread.current && t.alive?
- }
- end
-
- def check_thread_leak(test_name)
- live1 = @thread_info
- live2 = find_threads
- thread_finished = live1 - live2
- leaked = false
- if !thread_finished.empty?
- list = thread_finished.map {|t| t.inspect }.sort
- list.each {|str|
- puts "Finished thread: #{test_name}: #{str}"
- }
- end
- thread_leaked = live2 - live1
- if !thread_leaked.empty?
- leaked = true
- list = thread_leaked.map {|t| t.inspect }.sort
- list.each {|str|
- puts "Leaked thread: #{test_name}: #{str}"
- }
- end
- @thread_info = live2
- return leaked
- end
-
- def check_process_leak(test_name)
- subprocesses_leaked = Process.waitall
- subprocesses_leaked.each { |pid, status|
- puts "Leaked subprocess: #{pid}: #{status}"
- }
- return !subprocesses_leaked.empty?
- end
-
- def find_env
- ENV.to_h
- end
-
- def check_env(test_name)
- old_env = @env_info
- new_env = find_env
- return false if old_env == new_env
- (old_env.keys | new_env.keys).sort.each {|k|
- if old_env.has_key?(k)
- if new_env.has_key?(k)
- if old_env[k] != new_env[k]
- puts "Environment variable changed: #{test_name} : #{k.inspect} changed : #{old_env[k].inspect} -> #{new_env[k].inspect}"
- end
- else
- puts "Environment variable changed: #{test_name} : #{k.inspect} deleted"
- end
- else
- if new_env.has_key?(k)
- puts "Environment variable changed: #{test_name} : #{k.inspect} added"
- else
- flunk "unreachable"
- end
- end
- }
- @env_info = new_env
- return true
- end
-
- def find_argv
- ARGV.map { |e| e.dup }
- end
-
- def check_argv(test_name)
- old_argv = @argv_info
- new_argv = find_argv
- leaked = false
- if new_argv != old_argv
- puts "ARGV changed: #{test_name} : #{old_argv.inspect} to #{new_argv.inspect}"
- @argv_info = new_argv
- leaked = true
- end
- return leaked
- end
-
- def find_encodings
- [Encoding.default_internal, Encoding.default_external]
- end
-
- def check_encodings(test_name)
- old_internal, old_external = @encoding_info
- new_internal, new_external = find_encodings
- leaked = false
- if new_internal != old_internal
- leaked = true
- puts "Encoding.default_internal changed: #{test_name} : #{old_internal.inspect} to #{new_internal.inspect}"
- end
- if new_external != old_external
- leaked = true
- puts "Encoding.default_external changed: #{test_name} : #{old_external.inspect} to #{new_external.inspect}"
- end
- @encoding_info = [new_internal, new_external]
- return leaked
- end
-
- def puts(*args)
- if @no_leaks
- @no_leaks = false
- print "\n"
- end
- super(*args)
- end
-end
-
-class LeakCheckerAction
- def register
- MSpec.register :start, self
- MSpec.register :after, self
- end
-
- def start
- @checker = LeakChecker.new
- end
-
- def after(state)
- unless @checker.check(state.description)
- if state.example
- puts state.example.source_location.join(':')
- end
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/tag.rb b/spec/mspec/lib/mspec/runner/actions/tag.rb
deleted file mode 100644
index 760152b2a3..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/tag.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-require 'mspec/runner/actions/filter'
-
-# TagAction - Write tagged spec description string to a
-# tag file associated with each spec file.
-#
-# The action is triggered by specs whose descriptions
-# match the filter created with 'tags' and/or 'desc'
-#
-# The action fires in the :after event, after the spec
-# had been run. The action fires if the outcome of
-# running the spec matches 'outcome'.
-#
-# The arguments are:
-#
-# action: :add, :del
-# outcome: :pass, :fail, :all
-# tag: the tag to create/delete
-# comment: the comment to create
-# tags: zero or more tags to get matching
-# spec description strings from
-# desc: zero or more strings to match the
-# spec description strings
-
-class TagAction < ActionFilter
- def initialize(action, outcome, tag, comment, tags=nil, descs=nil)
- super tags, descs
- @action = action
- @outcome = outcome
- @tag = tag
- @comment = comment
- @report = []
- @exception = false
- end
-
- # Returns true if there are no _tag_ or _description_ filters. This
- # means that a TagAction matches any example by default. Otherwise,
- # returns true if either the _tag_ or the _description_ filter
- # matches +string+.
- def ===(string)
- return true unless @sfilter or @tfilter
- @sfilter === string or @tfilter === string
- end
-
- # Callback for the MSpec :before event. Resets the +#exception?+
- # flag to false.
- def before(state)
- @exception = false
- end
-
- # Callback for the MSpec :exception event. Sets the +#exception?+
- # flag to true.
- def exception(exception)
- @exception = true
- end
-
- # Callback for the MSpec :after event. Performs the tag action
- # depending on the type of action and the outcome of evaluating
- # the example. See +TagAction+ for a description of the actions.
- def after(state)
- if self === state.description and outcome?
- tag = SpecTag.new
- tag.tag = @tag
- tag.comment = @comment
- tag.description = state.description
-
- case @action
- when :add
- changed = MSpec.write_tag tag
- when :del
- changed = MSpec.delete_tag tag
- end
-
- @report << state.description if changed
- end
- end
-
- # Returns true if the result of evaluating the example matches
- # the _outcome_ registered for this tag action. See +TagAction+
- # for a description of the _outcome_ types.
- def outcome?
- @outcome == :all or
- (@outcome == :pass and not exception?) or
- (@outcome == :fail and exception?)
- end
-
- # Returns true if an exception was raised while evaluating the
- # current example.
- def exception?
- @exception
- end
-
- def report
- @report.join("\n") + "\n"
- end
- private :report
-
- # Callback for the MSpec :finish event. Prints the actions
- # performed while evaluating the examples.
- def finish
- case @action
- when :add
- if @report.empty?
- print "\nTagAction: no specs were tagged with '#{@tag}'\n"
- else
- print "\nTagAction: specs tagged with '#{@tag}':\n\n"
- print report
- end
- when :del
- if @report.empty?
- print "\nTagAction: no tags '#{@tag}' were deleted\n"
- else
- print "\nTagAction: tag '#{@tag}' deleted for specs:\n\n"
- print report
- end
- end
- end
-
- def register
- super
- MSpec.register :before, self
- MSpec.register :exception, self
- MSpec.register :after, self
- MSpec.register :finish, self
- end
-
- def unregister
- super
- MSpec.unregister :before, self
- MSpec.unregister :exception, self
- MSpec.unregister :after, self
- MSpec.unregister :finish, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/taglist.rb b/spec/mspec/lib/mspec/runner/actions/taglist.rb
deleted file mode 100644
index c1aba53794..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/taglist.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'mspec/runner/actions/filter'
-
-# TagListAction - prints out the descriptions for any specs
-# tagged with +tags+. If +tags+ is an empty list, prints out
-# descriptions for any specs that are tagged.
-class TagListAction
- def initialize(tags=nil)
- @tags = tags.nil? || tags.empty? ? nil : Array(tags)
- @filter = nil
- end
-
- # Returns true. This enables us to match any tag when loading
- # tags from the file.
- def include?(arg)
- true
- end
-
- # Returns true if any tagged descriptions matches +string+.
- def ===(string)
- @filter === string
- end
-
- # Prints a banner about matching tagged specs.
- def start
- if @tags
- print "\nListing specs tagged with #{@tags.map { |t| "'#{t}'" }.join(", ") }\n\n"
- else
- print "\nListing all tagged specs\n\n"
- end
- end
-
- # Creates a MatchFilter for specific tags or for all tags.
- def load
- @filter = nil
- desc = MSpec.read_tags(@tags || self).map { |t| t.description }
- @filter = MatchFilter.new(nil, *desc) unless desc.empty?
- end
-
- # Prints the spec description if it matches the filter.
- def after(state)
- return unless self === state.description
- print state.description, "\n"
- end
-
- def register
- MSpec.register :start, self
- MSpec.register :load, self
- MSpec.register :after, self
- end
-
- def unregister
- MSpec.unregister :start, self
- MSpec.unregister :load, self
- MSpec.unregister :after, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/tagpurge.rb b/spec/mspec/lib/mspec/runner/actions/tagpurge.rb
deleted file mode 100644
index f4587de6bc..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/tagpurge.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'mspec/runner/actions/filter'
-require 'mspec/runner/actions/taglist'
-
-# TagPurgeAction - removes all tags not matching any spec
-# descriptions.
-class TagPurgeAction < TagListAction
- attr_reader :matching
-
- def initialize
- @matching = []
- @filter = nil
- @tags = nil
- end
-
- # Prints a banner about purging tags.
- def start
- print "\nRemoving tags not matching any specs\n\n"
- end
-
- # Creates a MatchFilter for all tags.
- def load
- @filter = nil
- @tags = MSpec.read_tags self
- desc = @tags.map { |t| t.description }
- @filter = MatchFilter.new(nil, *desc) unless desc.empty?
- end
-
- # Saves any matching tags
- def after(state)
- @matching << state.description if self === state.description
- end
-
- # Rewrites any matching tags. Prints non-matching tags.
- # Deletes the tag file if there were no tags (this cleans
- # up empty or malformed tag files).
- def unload
- if @filter
- matched = @tags.select { |t| @matching.any? { |s| s == t.description } }
- MSpec.write_tags matched
-
- (@tags - matched).each { |t| print t.description, "\n" }
- else
- MSpec.delete_tags
- end
- end
-
- def register
- super
- MSpec.register :unload, self
- end
-
- def unregister
- super
- MSpec.unregister :unload, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/tally.rb b/spec/mspec/lib/mspec/runner/actions/tally.rb
deleted file mode 100644
index 33f937293c..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/tally.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-class Tally
- attr_accessor :files, :examples, :expectations, :failures, :errors, :guards, :tagged
-
- def initialize
- @files = @examples = @expectations = @failures = @errors = @guards = @tagged = 0
- end
-
- def files!(add=1)
- @files += add
- end
-
- def examples!(add=1)
- @examples += add
- end
-
- def expectations!(add=1)
- @expectations += add
- end
-
- def failures!(add=1)
- @failures += add
- end
-
- def errors!(add=1)
- @errors += add
- end
-
- def guards!(add=1)
- @guards += add
- end
-
- def tagged!(add=1)
- @tagged += add
- end
-
- def file
- pluralize files, "file"
- end
-
- def example
- pluralize examples, "example"
- end
-
- def expectation
- pluralize expectations, "expectation"
- end
-
- def failure
- pluralize failures, "failure"
- end
-
- def error
- pluralize errors, "error"
- end
-
- def guard
- pluralize guards, "guard"
- end
-
- def tag
- "#{tagged} tagged"
- end
-
- def format
- results = [ file, example, expectation, failure, error, tag ]
- if [:report, :report_on, :verify].any? { |m| MSpec.mode? m }
- results << guard
- end
- results.join(", ")
- end
-
- alias_method :to_s, :format
-
- def pluralize(count, singular)
- "#{count} #{singular}#{'s' unless count == 1}"
- end
- private :pluralize
-end
-
-class TallyAction
- attr_reader :counter
-
- def initialize
- @counter = Tally.new
- end
-
- def register
- MSpec.register :load, self
- MSpec.register :exception, self
- MSpec.register :example, self
- MSpec.register :tagged, self
- MSpec.register :expectation, self
- end
-
- def unregister
- MSpec.unregister :load, self
- MSpec.unregister :exception, self
- MSpec.unregister :example, self
- MSpec.unregister :tagged, self
- MSpec.unregister :expectation, self
- end
-
- def load
- @counter.files!
- end
-
- # Callback for the MSpec :expectation event. Increments the
- # tally of expectations (e.g. #should, #should_receive, etc.).
- def expectation(state)
- @counter.expectations!
- end
-
- # Callback for the MSpec :exception event. Increments the
- # tally of errors and failures.
- def exception(exception)
- exception.failure? ? @counter.failures! : @counter.errors!
- end
-
- # Callback for the MSpec :example event. Increments the tally
- # of examples.
- def example(state, block)
- @counter.examples!
- end
-
- def tagged(state)
- @counter.examples!
- @counter.tagged!
- end
-
- def format
- @counter.format
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/actions/timer.rb b/spec/mspec/lib/mspec/runner/actions/timer.rb
deleted file mode 100644
index e7ebfebe0d..0000000000
--- a/spec/mspec/lib/mspec/runner/actions/timer.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class TimerAction
- def register
- MSpec.register :start, self
- MSpec.register :finish, self
- end
-
- def start
- @start = Time.now
- end
-
- def finish
- @stop = Time.now
- end
-
- def elapsed
- @stop - @start
- end
-
- def format
- "Finished in %f seconds" % elapsed
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/context.rb b/spec/mspec/lib/mspec/runner/context.rb
deleted file mode 100644
index 30d8a4ad1b..0000000000
--- a/spec/mspec/lib/mspec/runner/context.rb
+++ /dev/null
@@ -1,239 +0,0 @@
-# Holds the state of the +describe+ block that is being
-# evaluated. Every example (i.e. +it+ block) is evaluated
-# in a context, which may include state set up in <tt>before
-# :each</tt> or <tt>before :all</tt> blocks.
-#
-#--
-# A note on naming: this is named _ContextState_ rather
-# than _DescribeState_ because +describe+ is the keyword
-# in the DSL for referring to the context in which an example
-# is evaluated, just as +it+ refers to the example itself.
-#++
-class ContextState
- attr_reader :state, :parent, :parents, :children, :examples, :to_s
-
- def initialize(mod, options=nil)
- @to_s = mod.to_s
- if options.is_a? Hash
- @options = options
- else
- @to_s += "#{".:#".include?(options[0,1]) ? "" : " "}#{options}" if options
- @options = { }
- end
- @options[:shared] ||= false
-
- @parsed = false
- @before = { :all => [], :each => [] }
- @after = { :all => [], :each => [] }
- @pre = {}
- @post = {}
- @examples = []
- @parent = nil
- @parents = [self]
- @children = []
-
- @mock_verify = Proc.new { Mock.verify_count }
- @mock_cleanup = Proc.new { Mock.cleanup }
- @expectation_missing = Proc.new { raise SpecExpectationNotFoundError }
- end
-
- # Remove caching when a ContextState is dup'd for shared specs.
- def initialize_copy(other)
- @pre = {}
- @post = {}
- end
-
- # Returns true if this is a shared +ContextState+. Essentially, when
- # created with: describe "Something", :shared => true { ... }
- def shared?
- return @options[:shared]
- end
-
- # Set the parent (enclosing) +ContextState+ for this state. Creates
- # the +parents+ list.
- def parent=(parent)
- @description = nil
-
- if shared?
- @parent = nil
- else
- @parent = parent
- parent.child self if parent
-
- @parents = [self]
- state = parent
- while state
- @parents.unshift state
- state = state.parent
- end
- end
- end
-
- # Add the ContextState instance +child+ to the list of nested
- # describe blocks.
- def child(child)
- @children << child
- end
-
- # Adds a nested ContextState in a shared ContextState to a containing
- # ContextState.
- #
- # Normal adoption is from the parent's perspective. But adopt is a good
- # verb and it's reasonable for the child to adopt the parent as well. In
- # this case, manipulating state from inside the child avoids needlessly
- # exposing the state to manipulate it externally in the dup. (See
- # #it_should_behave_like)
- def adopt(parent)
- self.parent = parent
-
- @examples = @examples.map do |example|
- example = example.dup
- example.context = self
- example
- end
-
- children = @children
- @children = []
-
- children.each { |child| child.dup.adopt self }
- end
-
- # Returns a list of all before(+what+) blocks from self and any parents.
- def pre(what)
- @pre[what] ||= parents.inject([]) { |l, s| l.push(*s.before(what)) }
- end
-
- # Returns a list of all after(+what+) blocks from self and any parents.
- # The list is in reverse order. In other words, the blocks defined in
- # inner describes are in the list before those defined in outer describes,
- # and in a particular describe block those defined later are in the list
- # before those defined earlier.
- def post(what)
- @post[what] ||= parents.inject([]) { |l, s| l.unshift(*s.after(what)) }
- end
-
- # Records before(:each) and before(:all) blocks.
- def before(what, &block)
- return if MSpec.guarded?
- block ? @before[what].push(block) : @before[what]
- end
-
- # Records after(:each) and after(:all) blocks.
- def after(what, &block)
- return if MSpec.guarded?
- block ? @after[what].unshift(block) : @after[what]
- end
-
- # Creates an ExampleState instance for the block and stores it
- # in a list of examples to evaluate unless the example is filtered.
- def it(desc, &block)
- example = ExampleState.new(self, desc, block)
- MSpec.actions :add, example
- return if MSpec.guarded?
- @examples << example
- end
-
- # Evaluates the block and resets the toplevel +ContextState+ to #parent.
- def describe(&block)
- @parsed = protect @to_s, block, false
- MSpec.register_current parent
- MSpec.register_shared self if shared?
- end
-
- # Returns a description string generated from self and all parents
- def description
- @description ||= parents.map { |p| p.to_s }.compact.join(" ")
- end
-
- # Injects the before/after blocks and examples from the shared
- # describe block into this +ContextState+ instance.
- def it_should_behave_like(desc)
- return if MSpec.guarded?
-
- unless state = MSpec.retrieve_shared(desc)
- raise Exception, "Unable to find shared 'describe' for #{desc}"
- end
-
- state.before(:all).each { |b| before :all, &b }
- state.before(:each).each { |b| before :each, &b }
- state.after(:each).each { |b| after :each, &b }
- state.after(:all).each { |b| after :all, &b }
-
- state.examples.each do |example|
- example = example.dup
- example.context = self
- @examples << example
- end
-
- state.children.each do |child|
- child.dup.adopt self
- end
- end
-
- # Evaluates each block in +blocks+ using the +MSpec.protect+ method
- # so that exceptions are handled and tallied. Returns true and does
- # NOT evaluate any blocks if +check+ is true and
- # <tt>MSpec.mode?(:pretend)</tt> is true.
- def protect(what, blocks, check=true)
- return true if check and MSpec.mode? :pretend
- Array(blocks).all? { |block| MSpec.protect what, &block }
- end
-
- # Removes filtered examples. Returns true if there are examples
- # left to evaluate.
- def filter_examples
- filtered, @examples = @examples.partition do |ex|
- ex.filtered?
- end
-
- filtered.each do |ex|
- MSpec.actions :tagged, ex
- end
-
- !@examples.empty?
- end
-
- # Evaluates the examples in a +ContextState+. Invokes the MSpec events
- # for :enter, :before, :after, :leave.
- def process
- MSpec.register_current self
-
- if @parsed and filter_examples
- MSpec.shuffle @examples if MSpec.randomize?
- MSpec.actions :enter, description
-
- if protect "before :all", pre(:all)
- @examples.each do |state|
- MSpec.repeat do
- @state = state
- example = state.example
- MSpec.actions :before, state
-
- if protect "before :each", pre(:each)
- MSpec.clear_expectations
- if example
- passed = protect nil, example
- MSpec.actions :example, state, example
- protect nil, @expectation_missing unless MSpec.expectation? or !passed
- end
- end
- protect "after :each", post(:each)
- protect "Mock.verify_count", @mock_verify
-
- protect "Mock.cleanup", @mock_cleanup
- MSpec.actions :after, state
- @state = nil
- end
- end
- protect "after :all", post(:all)
- else
- protect "Mock.cleanup", @mock_cleanup
- end
-
- MSpec.actions :leave
- end
-
- MSpec.register_current nil
- children.each { |child| child.process }
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/evaluate.rb b/spec/mspec/lib/mspec/runner/evaluate.rb
deleted file mode 100644
index ecf7460a90..0000000000
--- a/spec/mspec/lib/mspec/runner/evaluate.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-class SpecEvaluate
- include MSpecMatchers
-
- def self.desc=(desc)
- @desc = desc
- end
-
- def self.desc
- @desc ||= "evaluates "
- end
-
- def initialize(ruby, desc)
- @ruby = ruby.rstrip
- @desc = desc || self.class.desc
- end
-
- # Formats the Ruby source code for reabable output in the -fs formatter
- # option. If the source contains no newline characters, wraps the source in
- # single quotes to set if off from the rest of the description string. If
- # the source does contain newline characters, sets the indent level to four
- # characters.
- def format(ruby, newline=true)
- if ruby.include?("\n")
- lines = ruby.each_line.to_a
- if /( *)/ =~ lines.first
- if $1.size > 4
- dedent = $1.size - 4
- ruby = lines.map { |l| l[dedent..-1] }.join
- else
- indent = " " * (4 - $1.size)
- ruby = lines.map { |l| "#{indent}#{l}" }.join
- end
- end
- "\n#{ruby}"
- else
- "'#{ruby.lstrip}'"
- end
- end
-
- def define(&block)
- ruby = @ruby
- desc = @desc
- evaluator = self
-
- specify "#{desc} #{format ruby}" do
- evaluator.instance_eval(ruby)
- evaluator.instance_eval(&block)
- end
- end
-end
-
-def evaluate(str, desc=nil, &block)
- SpecEvaluate.new(str, desc).define(&block)
-end
diff --git a/spec/mspec/lib/mspec/runner/example.rb b/spec/mspec/lib/mspec/runner/example.rb
deleted file mode 100644
index 19eb29b079..0000000000
--- a/spec/mspec/lib/mspec/runner/example.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'mspec/runner/mspec'
-
-# Holds some of the state of the example (i.e. +it+ block) that is
-# being evaluated. See also +ContextState+.
-class ExampleState
- attr_reader :context, :it, :example
-
- def initialize(context, it, example=nil)
- @context = context
- @it = it
- @example = example
- end
-
- def context=(context)
- @description = nil
- @context = context
- end
-
- def describe
- @context.description
- end
-
- def description
- @description ||= "#{describe} #{@it}"
- end
-
- def filtered?
- incl = MSpec.retrieve(:include) || []
- excl = MSpec.retrieve(:exclude) || []
- included = incl.empty? || incl.any? { |f| f === description }
- included &&= excl.empty? || !excl.any? { |f| f === description }
- !included
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/exception.rb b/spec/mspec/lib/mspec/runner/exception.rb
deleted file mode 100644
index 0d9bb43105..0000000000
--- a/spec/mspec/lib/mspec/runner/exception.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# Initialize $MSPEC_DEBUG
-$MSPEC_DEBUG ||= false
-
-class ExceptionState
- attr_reader :description, :describe, :it, :exception
-
- def initialize(state, location, exception)
- @exception = exception
-
- @description = location ? "An exception occurred during: #{location}" : ""
- if state
- @description += "\n" unless @description.empty?
- @description += state.description
- @describe = state.describe
- @it = state.it
- else
- @describe = @it = ""
- end
- end
-
- def failure?
- [SpecExpectationNotMetError, SpecExpectationNotFoundError].any? { |e| @exception.is_a? e }
- end
-
- def message
- if @exception.message.empty?
- "<No message>"
- elsif @exception.class == SpecExpectationNotMetError ||
- @exception.class == SpecExpectationNotFoundError
- @exception.message
- else
- "#{@exception.class}: #{@exception.message}"
- end
- end
-
- def backtrace
- @backtrace_filter ||= MSpecScript.config[:backtrace_filter]
-
- bt = @exception.backtrace || []
-
- bt.select { |line| $MSPEC_DEBUG or @backtrace_filter !~ line }.join("\n")
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/filters.rb b/spec/mspec/lib/mspec/runner/filters.rb
deleted file mode 100644
index d0420faca6..0000000000
--- a/spec/mspec/lib/mspec/runner/filters.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'mspec/runner/filters/match'
-require 'mspec/runner/filters/regexp'
-require 'mspec/runner/filters/tag'
-require 'mspec/runner/filters/profile'
diff --git a/spec/mspec/lib/mspec/runner/filters/match.rb b/spec/mspec/lib/mspec/runner/filters/match.rb
deleted file mode 100644
index 539fd02d01..0000000000
--- a/spec/mspec/lib/mspec/runner/filters/match.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-class MatchFilter
- def initialize(what, *strings)
- @what = what
- @strings = strings
- end
-
- def ===(string)
- @strings.any? { |s| string.include?(s) }
- end
-
- def register
- MSpec.register @what, self
- end
-
- def unregister
- MSpec.unregister @what, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/filters/profile.rb b/spec/mspec/lib/mspec/runner/filters/profile.rb
deleted file mode 100644
index a59722c451..0000000000
--- a/spec/mspec/lib/mspec/runner/filters/profile.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-class ProfileFilter
- def initialize(what, *files)
- @what = what
- @methods = load(*files)
- @pattern = /([^ .#]+[.#])([^ ]+)/
- end
-
- def find(name)
- return name if File.exist?(File.expand_path(name))
-
- ["spec/profiles", "spec", "profiles", "."].each do |dir|
- file = File.join dir, name
- return file if File.exist? file
- end
- end
-
- def parse(file)
- pattern = /(\S+):\s*/
- key = ""
- file.inject(Hash.new { |h,k| h[k] = [] }) do |hash, line|
- line.chomp!
- if line[0,2] == "- "
- hash[key] << line[2..-1].gsub(/[ '"]/, "")
- elsif m = pattern.match(line)
- key = m[1]
- end
- hash
- end
- end
-
- def load(*files)
- files.inject({}) do |hash, file|
- next hash unless name = find(file)
-
- File.open name, "r" do |f|
- hash.merge parse(f)
- end
- end
- end
-
- def ===(string)
- return false unless m = @pattern.match(string)
- return false unless l = @methods[m[1]]
- l.include? m[2]
- end
-
- def register
- MSpec.register @what, self
- end
-
- def unregister
- MSpec.unregister @what, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/filters/regexp.rb b/spec/mspec/lib/mspec/runner/filters/regexp.rb
deleted file mode 100644
index 2bd1448d3f..0000000000
--- a/spec/mspec/lib/mspec/runner/filters/regexp.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'mspec/runner/filters/match'
-
-class RegexpFilter < MatchFilter
- def to_regexp(*strings)
- strings.map { |str| Regexp.new str }
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/filters/tag.rb b/spec/mspec/lib/mspec/runner/filters/tag.rb
deleted file mode 100644
index c641c01606..0000000000
--- a/spec/mspec/lib/mspec/runner/filters/tag.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class TagFilter
- def initialize(what, *tags)
- @what = what
- @tags = tags
- end
-
- def load
- @descriptions = MSpec.read_tags(@tags).map { |t| t.description }
- MSpec.register @what, self
- end
-
- def unload
- MSpec.unregister @what, self
- end
-
- def ===(string)
- @descriptions.include?(string)
- end
-
- def register
- MSpec.register :load, self
- MSpec.register :unload, self
- end
-
- def unregister
- MSpec.unregister :load, self
- MSpec.unregister :unload, self
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters.rb b/spec/mspec/lib/mspec/runner/formatters.rb
deleted file mode 100644
index d085031a12..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'mspec/runner/formatters/describe'
-require 'mspec/runner/formatters/dotted'
-require 'mspec/runner/formatters/file'
-require 'mspec/runner/formatters/specdoc'
-require 'mspec/runner/formatters/html'
-require 'mspec/runner/formatters/summary'
-require 'mspec/runner/formatters/unit'
-require 'mspec/runner/formatters/spinner'
-require 'mspec/runner/formatters/method'
-require 'mspec/runner/formatters/yaml'
-require 'mspec/runner/formatters/profile'
-require 'mspec/runner/formatters/junit'
diff --git a/spec/mspec/lib/mspec/runner/formatters/describe.rb b/spec/mspec/lib/mspec/runner/formatters/describe.rb
deleted file mode 100644
index 176bd79279..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/describe.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'mspec/runner/formatters/dotted'
-require 'mspec/runner/actions/tally'
-
-class DescribeFormatter < DottedFormatter
- # Callback for the MSpec :finish event. Prints a summary of
- # the number of errors and failures for each +describe+ block.
- def finish
- describes = Hash.new { |h,k| h[k] = Tally.new }
-
- @exceptions.each do |exc|
- desc = describes[exc.describe]
- exc.failure? ? desc.failures! : desc.errors!
- end
-
- print "\n"
- describes.each do |d, t|
- text = d.size > 40 ? "#{d[0,37]}..." : d.ljust(40)
- print "\n#{text} #{t.failure}, #{t.error}"
- end
- print "\n" unless describes.empty?
-
- print "\n#{@timer.format}\n\n#{@tally.format}\n"
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/dotted.rb b/spec/mspec/lib/mspec/runner/formatters/dotted.rb
deleted file mode 100644
index 61c8e4c27c..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/dotted.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/actions/timer'
-require 'mspec/runner/actions/tally'
-require 'mspec/runner/actions/leakchecker' if ENV['CHECK_LEAKS']
-
-class DottedFormatter
- attr_reader :exceptions, :timer, :tally
-
- def initialize(out=nil)
- @exception = @failure = false
- @exceptions = []
- @count = 0 # For subclasses
- if out.nil?
- @out = $stdout
- else
- @out = File.open out, "w"
- end
-
- @current_state = nil
- end
-
- # Creates the +TimerAction+ and +TallyAction+ instances and
- # registers them. Registers +self+ for the +:exception+,
- # +:before+, +:after+, and +:finish+ actions.
- def register
- (@timer = TimerAction.new).register
- (@tally = TallyAction.new).register
- LeakCheckerAction.new.register if ENV['CHECK_LEAKS']
- @counter = @tally.counter
-
- MSpec.register :exception, self
- MSpec.register :before, self
- MSpec.register :after, self
- MSpec.register :finish, self
- MSpec.register :abort, self
- end
-
- def abort
- if @current_state
- puts "\naborting example: #{@current_state.description}"
- end
- end
-
- # Returns true if any exception is raised while running
- # an example. This flag is reset before each example
- # is evaluated.
- def exception?
- @exception
- end
-
- # Returns true if all exceptions during the evaluation
- # of an example are failures rather than errors. See
- # <tt>ExceptionState#failure</tt>. This flag is reset
- # before each example is evaluated.
- def failure?
- @failure
- end
-
- # Callback for the MSpec :before event. Resets the
- # +#exception?+ and +#failure+ flags.
- def before(state=nil)
- @current_state = state
- @failure = @exception = false
- end
-
- # Callback for the MSpec :exception event. Stores the
- # +ExceptionState+ object to generate the list of backtraces
- # after all the specs are run. Also updates the internal
- # +#exception?+ and +#failure?+ flags.
- def exception(exception)
- @count += 1
- @failure = @exception ? @failure && exception.failure? : exception.failure?
- @exception = true
- @exceptions << exception
- end
-
- # Callback for the MSpec :after event. Prints an indicator
- # for the result of evaluating this example as follows:
- # . = No failure or error
- # F = An SpecExpectationNotMetError was raised
- # E = Any exception other than SpecExpectationNotMetError
- def after(state = nil)
- @current_state = nil
-
- unless exception?
- print "."
- else
- print failure? ? "F" : "E"
- end
- end
-
- # Callback for the MSpec :finish event. Prints a description
- # and backtrace for every exception that occurred while
- # evaluating the examples.
- def finish
- print "\n"
- count = 0
- @exceptions.each do |exc|
- count += 1
- print_exception(exc, count)
- end
- print "\n#{@timer.format}\n\n#{@tally.format}\n"
- end
-
- def print_exception(exc, count)
- outcome = exc.failure? ? "FAILED" : "ERROR"
- print "\n#{count})\n#{exc.description} #{outcome}\n"
- print exc.message, "\n"
- print exc.backtrace, "\n"
- end
-
- # A convenience method to allow printing to different outputs.
- def print(*args)
- @out.print(*args)
- @out.flush
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/file.rb b/spec/mspec/lib/mspec/runner/formatters/file.rb
deleted file mode 100644
index 6db72af4ff..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/file.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'mspec/runner/formatters/dotted'
-
-class FileFormatter < DottedFormatter
- # Unregisters DottedFormatter#before, #after methods and
- # registers #load, #unload, which perform the same duties
- # as #before, #after in DottedFormatter.
- def register
- super
-
- MSpec.unregister :before, self
- MSpec.unregister :after, self
-
- MSpec.register :load, self
- MSpec.register :unload, self
- end
-
- alias_method :load, :before
- alias_method :unload, :after
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/html.rb b/spec/mspec/lib/mspec/runner/formatters/html.rb
deleted file mode 100644
index fd64cd0d20..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/html.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class HtmlFormatter < DottedFormatter
- def register
- super
- MSpec.register :start, self
- MSpec.register :enter, self
- MSpec.register :leave, self
- end
-
- def start
- print <<-EOH
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>Spec Output For #{RUBY_ENGINE} (#{RUBY_VERSION})</title>
-<style type="text/css">
-ul {
- list-style: none;
-}
-.fail {
- color: red;
-}
-.pass {
- color: green;
-}
-#details :target {
- background-color: #ffffe0;
-}
-</style>
-</head>
-<body>
-EOH
- end
-
- def enter(describe)
- print "<div><p>#{describe}</p>\n<ul>\n"
- end
-
- def leave
- print "</ul>\n</div>\n"
- end
-
- def exception(exception)
- super
- outcome = exception.failure? ? "FAILED" : "ERROR"
- print %[<li class="fail">- #{exception.it} (<a href="#details-#{@count}">]
- print %[#{outcome} - #{@count}</a>)</li>\n]
- end
-
- def after(state)
- print %[<li class="pass">- #{state.it}</li>\n] unless exception?
- end
-
- def finish
- success = @exceptions.empty?
- unless success
- print "<hr>\n"
- print %[<ol id="details">]
- count = 0
- @exceptions.each do |exc|
- outcome = exc.failure? ? "FAILED" : "ERROR"
- print %[\n<li id="details-#{count += 1}"><p>#{escape(exc.description)} #{outcome}</p>\n<p>]
- print escape(exc.message)
- print "</p>\n<pre>\n"
- print escape(exc.backtrace)
- print "</pre>\n</li>\n"
- end
- print "</ol>\n"
- end
- print %[<p>#{@timer.format}</p>\n]
- print %[<p class="#{success ? "pass" : "fail"}">#{@tally.format}</p>\n]
- print "</body>\n</html>\n"
- end
-
- def escape(string)
- string.gsub("&", "&nbsp;").gsub("<", "&lt;").gsub(">", "&gt;")
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/junit.rb b/spec/mspec/lib/mspec/runner/formatters/junit.rb
deleted file mode 100644
index 76d46c2414..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/junit.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/yaml'
-
-class JUnitFormatter < YamlFormatter
- def initialize(out=nil)
- super
- @tests = []
- end
-
- def after(state = nil)
- super
- @tests << {:test => state, :exception => false} unless exception?
- end
-
- def exception(exception)
- super
- @tests << {:test => exception, :exception => true}
- end
-
- def finish
- switch
-
- time = @timer.elapsed
- tests = @tally.counter.examples
- errors = @tally.counter.errors
- failures = @tally.counter.failures
-
- printf <<-XML
-
-<?xml version="1.0" encoding="UTF-8" ?>
- <testsuites
- testCount="#{tests}"
- errorCount="#{errors}"
- failureCount="#{failures}"
- timeCount="#{time}" time="#{time}">
- <testsuite
- tests="#{tests}"
- errors="#{errors}"
- failures="#{failures}"
- time="#{time}"
- name="Spec Output For #{::RUBY_ENGINE} (#{::RUBY_VERSION})">
- XML
- @tests.each do |h|
- description = encode_for_xml h[:test].description
-
- printf <<-XML, "Spec", description, 0.0
- <testcase classname="%s" name="%s" time="%f">
- XML
- if h[:exception]
- outcome = h[:test].failure? ? "failure" : "error"
- message = encode_for_xml h[:test].message
- backtrace = encode_for_xml h[:test].backtrace
- print <<-XML
- <#{outcome} message="error in #{description}" type="#{outcome}">
- #{message}
- #{backtrace}
- </#{outcome}>
- XML
- end
- print <<-XML
- </testcase>
- XML
- end
-
- print <<-XML
- </testsuite>
- </testsuites>
- XML
- end
-
- private
- LT = "&lt;"
- GT = "&gt;"
- QU = "&quot;"
- AP = "&apos;"
- AM = "&amp;"
- TARGET_ENCODING = "ISO-8859-1"
-
- def encode_for_xml(str)
- encode_as_latin1(str).gsub("<", LT).gsub(">", GT).
- gsub('"', QU).gsub("'", AP).gsub("&", AM).
- tr("\x00-\x08", "?")
- end
-
- def encode_as_latin1(str)
- str.encode(TARGET_ENCODING, :undef => :replace, :invalid => :replace)
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/method.rb b/spec/mspec/lib/mspec/runner/formatters/method.rb
deleted file mode 100644
index ff115193fd..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/method.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require 'mspec/runner/formatters/dotted'
-
-class MethodFormatter < DottedFormatter
- attr_accessor :methods
-
- def initialize(out=nil)
- super
- @methods = Hash.new do |h, k|
- hash = {}
- hash[:examples] = 0
- hash[:expectations] = 0
- hash[:failures] = 0
- hash[:errors] = 0
- hash[:exceptions] = []
- h[k] = hash
- end
- end
-
- # Returns the type of method as a "class", "instance",
- # or "unknown".
- def method_type(sep)
- case sep
- when '.', '::'
- "class"
- when '#'
- "instance"
- else
- "unknown"
- end
- end
-
- # Callback for the MSpec :before event. Parses the
- # describe string into class and method if possible.
- # Resets the tallies so the counts are only for this
- # example.
- def before(state)
- super
-
- # The pattern for a method name is not correctly
- # restrictive but it is simplistic and useful
- # for our purpose.
- /^([A-Za-z_]+\w*)(\.|#|::)([^ ]+)/ =~ state.describe
- @key = $1 && $2 && $3 ? "#{$1}#{$2}#{$3}" : state.describe
-
- unless methods.key? @key
- h = methods[@key]
- h[:class] = "#{$1}"
- h[:method] = "#{$3}"
- h[:type] = method_type $2
- h[:description] = state.description
- end
-
- tally.counter.examples = 0
- tally.counter.expectations = 0
- tally.counter.failures = 0
- tally.counter.errors = 0
-
- @exceptions = []
- end
-
- # Callback for the MSpec :after event. Sets or adds to
- # tallies for the example block.
- def after(state)
- h = methods[@key]
- h[:examples] += tally.counter.examples
- h[:expectations] += tally.counter.expectations
- h[:failures] += tally.counter.failures
- h[:errors] += tally.counter.errors
- @exceptions.each do |exc|
- h[:exceptions] << "#{exc.message}\n#{exc.backtrace}\n"
- end
- end
-
- # Callback for the MSpec :finish event. Prints out the
- # summary information in YAML format for all the methods.
- def finish
- print "---\n"
-
- methods.each do |key, hash|
- print key.inspect, ":\n"
- print " class: ", hash[:class].inspect, "\n"
- print " method: ", hash[:method].inspect, "\n"
- print " type: ", hash[:type], "\n"
- print " description: ", hash[:description].inspect, "\n"
- print " examples: ", hash[:examples], "\n"
- print " expectations: ", hash[:expectations], "\n"
- print " failures: ", hash[:failures], "\n"
- print " errors: ", hash[:errors], "\n"
- print " exceptions:\n"
- hash[:exceptions].each { |exc| print " - ", exc.inspect, "\n" }
- end
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/multi.rb b/spec/mspec/lib/mspec/runner/formatters/multi.rb
deleted file mode 100644
index f69055025f..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/multi.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'mspec/runner/formatters/spinner'
-
-class MultiFormatter < SpinnerFormatter
- def initialize(out=nil)
- super(out)
- @counter = @tally = Tally.new
- @timer = TimerAction.new
- @timer.start
- end
-
- def aggregate_results(files)
- require 'yaml'
-
- @timer.finish
- @exceptions = []
-
- files.each do |file|
- d = File.open(file, "r") { |f| YAML.load f }
- File.delete file
-
- @exceptions += Array(d['exceptions'])
- @tally.files! d['files']
- @tally.examples! d['examples']
- @tally.expectations! d['expectations']
- @tally.errors! d['errors']
- @tally.failures! d['failures']
- end
- end
-
- def print_exception(exc, count)
- print "\n#{count})\n#{exc}\n"
- end
-
- def finish
- super(false)
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/profile.rb b/spec/mspec/lib/mspec/runner/formatters/profile.rb
deleted file mode 100644
index 498cd4a3b7..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/profile.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class ProfileFormatter < DottedFormatter
- def initialize(out=nil)
- super
-
- @describe_name = nil
- @describe_time = nil
- @describes = []
- @its = []
- end
-
- def register
- super
- MSpec.register :enter, self
- end
-
- # Callback for the MSpec :enter event. Prints the
- # +describe+ block string.
- def enter(describe)
- if @describe_time
- @describes << [@describe_name, Time.now.to_f - @describe_time]
- end
-
- @describe_name = describe
- @describe_time = Time.now.to_f
- end
-
- # Callback for the MSpec :before event. Prints the
- # +it+ block string.
- def before(state)
- super
-
- @it_name = state.it
- @it_time = Time.now.to_f
- end
-
- # Callback for the MSpec :after event. Prints a
- # newline to finish the description string output.
- def after(state)
- @its << [@describe_name, @it_name, Time.now.to_f - @it_time]
- super
- end
-
- def finish
- puts "\nProfiling info:"
-
- desc = @describes.sort { |a,b| b.last <=> a.last }
- desc.delete_if { |a| a.last <= 0.001 }
- show = desc[0, 100]
-
- puts "Top #{show.size} describes:"
-
- show.each do |des, time|
- printf "%3.3f - %s\n", time, des
- end
-
- its = @its.sort { |a,b| b.last <=> a.last }
- its.delete_if { |a| a.last <= 0.001 }
- show = its[0, 100]
-
- puts "\nTop #{show.size} its:"
- show.each do |des, it, time|
- printf "%3.3f - %s %s\n", time, des, it
- end
-
- super
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/specdoc.rb b/spec/mspec/lib/mspec/runner/formatters/specdoc.rb
deleted file mode 100644
index 29adde3c5c..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/specdoc.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class SpecdocFormatter < DottedFormatter
- def register
- super
- MSpec.register :enter, self
- end
-
- # Callback for the MSpec :enter event. Prints the
- # +describe+ block string.
- def enter(describe)
- print "\n#{describe}\n"
- end
-
- # Callback for the MSpec :before event. Prints the
- # +it+ block string.
- def before(state)
- super
- print "- #{state.it}"
- end
-
- # Callback for the MSpec :exception event. Prints
- # either 'ERROR - X' or 'FAILED - X' where _X_ is
- # the sequential number of the exception raised. If
- # there has already been an exception raised while
- # evaluating this example, it prints another +it+
- # block description string so that each discription
- # string has an associated 'ERROR' or 'FAILED'
- def exception(exception)
- print "\n- #{exception.it}" if exception?
- super
- print " (#{exception.failure? ? 'FAILED' : 'ERROR'} - #{@count})"
- end
-
- # Callback for the MSpec :after event. Prints a
- # newline to finish the description string output.
- def after(state)
- print "\n"
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/spinner.rb b/spec/mspec/lib/mspec/runner/formatters/spinner.rb
deleted file mode 100644
index f6f35cc476..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/spinner.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class SpinnerFormatter < DottedFormatter
- attr_reader :length
-
- Spins = %w!| / - \\!
- HOUR = 3600
- MIN = 60
-
- def initialize(out=nil)
- super(nil)
-
- @which = 0
- @loaded = 0
- self.length = 40
- @percent = 0
- @start = Time.now
-
- term = ENV['TERM']
- @color = (term != "dumb")
- @fail_color = "32"
- @error_color = "32"
- end
-
- def register
- super
-
- MSpec.register :start, self
- MSpec.register :unload, self
- MSpec.unregister :before, self
- end
-
- def length=(length)
- @length = length
- @ratio = 100.0 / length
- @position = length / 2 - 2
- end
-
- def compute_etr
- return @etr = "00:00:00" if @percent == 0
- elapsed = Time.now - @start
- remain = (100 * elapsed / @percent) - elapsed
-
- hour = remain >= HOUR ? (remain / HOUR).to_i : 0
- remain -= hour * HOUR
- min = remain >= MIN ? (remain / MIN).to_i : 0
- sec = remain - min * MIN
-
- @etr = "%02d:%02d:%02d" % [hour, min, sec]
- end
-
- def compute_percentage
- @percent = @loaded * 100 / @total
- bar = ("=" * (@percent / @ratio)).ljust @length
- label = "%d%%" % @percent
- bar[@position, label.size] = label
- @bar = bar
- end
-
- def compute_progress
- compute_percentage
- compute_etr
- end
-
- def progress_line
- @which = (@which + 1) % Spins.size
- data = [Spins[@which], @bar, @etr, @counter.failures, @counter.errors]
- if @color
- "\r[%s | %s | %s] \e[0;#{@fail_color}m%6dF \e[0;#{@error_color}m%6dE\e[0m " % data
- else
- "\r[%s | %s | %s] %6dF %6dE " % data
- end
- end
-
- def clear_progress_line
- print "\r#{' '*progress_line.length}"
- end
-
- # Callback for the MSpec :start event. Stores the total
- # number of files that will be processed.
- def start
- @total = MSpec.retrieve(:files).size
- compute_progress
- print progress_line
- end
-
- # Callback for the MSpec :unload event. Increments the number
- # of files that have been run.
- def unload
- @loaded += 1
- compute_progress
- print progress_line
- end
-
- # Callback for the MSpec :exception event. Changes the color
- # used to display the tally of errors and failures
- def exception(exception)
- super
- @fail_color = "31" if exception.failure?
- @error_color = "33" unless exception.failure?
-
- clear_progress_line
- print_exception(exception, @count)
- end
-
- # Callback for the MSpec :after event. Updates the spinner.
- def after(state)
- print progress_line
- end
-
- def finish(printed_exceptions = true)
- # We already printed the exceptions
- @exceptions = [] if printed_exceptions
- super()
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/summary.rb b/spec/mspec/lib/mspec/runner/formatters/summary.rb
deleted file mode 100644
index 0c9207194c..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/summary.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class SummaryFormatter < DottedFormatter
- # Callback for the MSpec :after event. Overrides the
- # callback provided by +DottedFormatter+ and does not
- # print any output for each example evaluated.
- def after(state)
- # do nothing
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/unit.rb b/spec/mspec/lib/mspec/runner/formatters/unit.rb
deleted file mode 100644
index cebc18a49b..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/unit.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class UnitdiffFormatter < DottedFormatter
- def finish
- print "\n\n#{@timer.format}\n"
- count = 0
- @exceptions.each do |exc|
- outcome = exc.failure? ? "FAILED" : "ERROR"
- print "\n#{count += 1})\n#{exc.description} #{outcome}\n"
- print exc.message, ":\n"
- print exc.backtrace, "\n"
- end
- print "\n#{@tally.format}\n"
- end
-
- def backtrace(exc)
- exc.backtrace && exc.backtrace.join("\n")
- end
- private :backtrace
-end
diff --git a/spec/mspec/lib/mspec/runner/formatters/yaml.rb b/spec/mspec/lib/mspec/runner/formatters/yaml.rb
deleted file mode 100644
index 090a9b1b9d..0000000000
--- a/spec/mspec/lib/mspec/runner/formatters/yaml.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'mspec/expectations/expectations'
-require 'mspec/runner/formatters/dotted'
-
-class YamlFormatter < DottedFormatter
- def initialize(out=nil)
- super(nil)
-
- if out.nil?
- @finish = $stdout
- else
- @finish = File.open out, "w"
- end
- end
-
- def switch
- @out = @finish
- end
-
- def after(state)
- end
-
- def finish
- switch
-
- print "---\n"
- print "exceptions:\n"
- @exceptions.each do |exc|
- outcome = exc.failure? ? "FAILED" : "ERROR"
- str = "#{exc.description} #{outcome}\n"
- str << exc.message << "\n" << exc.backtrace
- print "- ", str.inspect, "\n"
- end
-
- print "time: ", @timer.elapsed, "\n"
- print "files: ", @tally.counter.files, "\n"
- print "examples: ", @tally.counter.examples, "\n"
- print "expectations: ", @tally.counter.expectations, "\n"
- print "failures: ", @tally.counter.failures, "\n"
- print "errors: ", @tally.counter.errors, "\n"
- print "tagged: ", @tally.counter.tagged, "\n"
- end
-end
diff --git a/spec/mspec/lib/mspec/runner/mspec.rb b/spec/mspec/lib/mspec/runner/mspec.rb
deleted file mode 100644
index d47657326b..0000000000
--- a/spec/mspec/lib/mspec/runner/mspec.rb
+++ /dev/null
@@ -1,408 +0,0 @@
-require 'mspec/runner/context'
-require 'mspec/runner/exception'
-require 'mspec/runner/tag'
-
-module MSpec
-end
-
-class MSpecEnv
- include MSpec
-end
-
-module MSpec
-
- @exit = nil
- @abort = nil
- @start = nil
- @enter = nil
- @before = nil
- @add = nil
- @after = nil
- @leave = nil
- @finish = nil
- @exclude = nil
- @include = nil
- @leave = nil
- @load = nil
- @unload = nil
- @tagged = nil
- @current = nil
- @example = nil
- @modes = []
- @shared = {}
- @guarded = []
- @features = {}
- @exception = nil
- @randomize = nil
- @repeat = nil
- @expectation = nil
- @expectations = false
-
- def self.describe(mod, options=nil, &block)
- state = ContextState.new mod, options
- state.parent = current
-
- MSpec.register_current state
- state.describe(&block)
-
- state.process unless state.shared? or current
- end
-
- def self.process
- STDOUT.puts RUBY_DESCRIPTION
-
- actions :start
- files
- actions :finish
- end
-
- def self.each_file(&block)
- if ENV["MSPEC_MULTI"]
- STDOUT.print "."
- STDOUT.flush
- while file = STDIN.gets and file = file.chomp
- return if file == "QUIT"
- yield file
- begin
- STDOUT.print "."
- STDOUT.flush
- rescue Errno::EPIPE
- # The parent died
- exit 1
- end
- end
- # The parent closed the connection without QUIT
- abort "the parent did not send QUIT"
- else
- return unless files = retrieve(:files)
- shuffle files if randomize?
- files.each(&block)
- end
- end
-
- def self.files
- each_file do |file|
- setup_env
- store :file, file
- actions :load
- protect("loading #{file}") { Kernel.load file }
- actions :unload
- end
- end
-
- def self.setup_env
- @env = MSpecEnv.new
- end
-
- def self.actions(action, *args)
- actions = retrieve(action)
- actions.each { |obj| obj.send action, *args } if actions
- end
-
- def self.protect(location, &block)
- begin
- @env.instance_eval(&block)
- return true
- rescue SystemExit => e
- raise e
- rescue Exception => exc
- register_exit 1
- actions :exception, ExceptionState.new(current && current.state, location, exc)
- return false
- end
- end
-
- # Guards can be nested, so a stack is necessary to know when we have
- # exited the toplevel guard.
- def self.guard
- @guarded << true
- end
-
- def self.unguard
- @guarded.pop
- end
-
- def self.guarded?
- !@guarded.empty?
- end
-
- # Sets the toplevel ContextState to +state+.
- def self.register_current(state)
- store :current, state
- end
-
- # Sets the toplevel ContextState to +nil+.
- def self.clear_current
- store :current, nil
- end
-
- # Returns the toplevel ContextState.
- def self.current
- retrieve :current
- end
-
- # Stores the shared ContextState keyed by description.
- def self.register_shared(state)
- @shared[state.to_s] = state
- end
-
- # Returns the shared ContextState matching description.
- def self.retrieve_shared(desc)
- @shared[desc.to_s]
- end
-
- # Stores the exit code used by the runner scripts.
- def self.register_exit(code)
- store :exit, code
- end
-
- # Retrieves the stored exit code.
- def self.exit_code
- retrieve(:exit).to_i
- end
-
- # Stores the list of files to be evaluated.
- def self.register_files(files)
- store :files, files
- end
-
- # Stores one or more substitution patterns for transforming
- # a spec filename into a tags filename, where each pattern
- # has the form:
- #
- # [Regexp, String]
- #
- # See also +tags_file+.
- def self.register_tags_patterns(patterns)
- store :tags_patterns, patterns
- end
-
- # Registers an operating mode. Modes recognized by MSpec:
- #
- # :pretend - actions execute but specs are not run
- # :verify - specs are run despite guards and the result is
- # verified to match the expectation of the guard
- # :report - specs that are guarded are reported
- # :unguarded - all guards are forced off
- def self.register_mode(mode)
- modes = retrieve :modes
- modes << mode unless modes.include? mode
- end
-
- # Clears all registered modes.
- def self.clear_modes
- store :modes, []
- end
-
- # Returns +true+ if +mode+ is registered.
- def self.mode?(mode)
- retrieve(:modes).include? mode
- end
-
- def self.enable_feature(feature)
- retrieve(:features)[feature] = true
- end
-
- def self.disable_feature(feature)
- retrieve(:features)[feature] = false
- end
-
- def self.feature_enabled?(feature)
- retrieve(:features)[feature] || false
- end
-
- def self.retrieve(symbol)
- instance_variable_get :"@#{symbol}"
- end
-
- def self.store(symbol, value)
- instance_variable_set :"@#{symbol}", value
- end
-
- # This method is used for registering actions that are
- # run at particular points in the spec cycle:
- # :start before any specs are run
- # :load before a spec file is loaded
- # :enter before a describe block is run
- # :before before a single spec is run
- # :add while a describe block is adding examples to run later
- # :expectation before a 'should', 'should_receive', etc.
- # :example after an example block is run, passed the block
- # :exception after an exception is rescued
- # :after after a single spec is run
- # :leave after a describe block is run
- # :unload after a spec file is run
- # :finish after all specs are run
- #
- # Objects registered as actions above should respond to
- # a method of the same name. For example, if an object
- # is registered as a :start action, it should respond to
- # a #start method call.
- #
- # Additionally, there are two "action" lists for
- # filtering specs:
- # :include return true if the spec should be run
- # :exclude return true if the spec should NOT be run
- #
- def self.register(symbol, action)
- unless value = retrieve(symbol)
- value = store symbol, []
- end
- value << action unless value.include? action
- end
-
- def self.unregister(symbol, action)
- if value = retrieve(symbol)
- value.delete action
- end
- end
-
- def self.randomize(flag=true)
- @randomize = flag
- end
-
- def self.randomize?
- @randomize == true
- end
-
- def self.repeat=(times)
- @repeat = times
- end
-
- def self.repeat
- (@repeat || 1).times do
- yield
- end
- end
-
- def self.shuffle(ary)
- return if ary.empty?
-
- size = ary.size
- size.times do |i|
- r = rand(size - i - 1)
- ary[i], ary[r] = ary[r], ary[i]
- end
- end
-
- # Records that an expectation has been encountered in an example.
- def self.expectation
- store :expectations, true
- end
-
- # Returns true if an expectation has been encountered
- def self.expectation?
- retrieve :expectations
- end
-
- # Resets the flag that an expectation has been encountered in an example.
- def self.clear_expectations
- store :expectations, false
- end
-
- # Transforms a spec filename into a tags filename by applying each
- # substitution pattern in :tags_pattern. The default patterns are:
- #
- # [%r(/spec/), '/spec/tags/'], [/_spec.rb$/, '_tags.txt']
- #
- # which will perform the following transformation:
- #
- # path/to/spec/class/method_spec.rb => path/to/spec/tags/class/method_tags.txt
- #
- # See also +register_tags_patterns+.
- def self.tags_file
- patterns = retrieve(:tags_patterns) ||
- [[%r(spec/), 'spec/tags/'], [/_spec.rb$/, '_tags.txt']]
- patterns.inject(retrieve(:file).dup) do |file, pattern|
- file.gsub(*pattern)
- end
- end
-
- # Returns a list of tags matching any tag string in +keys+ based
- # on the return value of <tt>keys.include?("tag_name")</tt>
- def self.read_tags(keys)
- tags = []
- file = tags_file
- if File.exist? file
- File.open(file, "r:utf-8") do |f|
- f.each_line do |line|
- line.chomp!
- next if line.empty?
- tag = SpecTag.new line
- tags << tag if keys.include? tag.tag
- end
- end
- end
- tags
- end
-
- def self.make_tag_dir(path)
- parent = File.dirname(path)
- return if File.exist? parent
- begin
- Dir.mkdir(parent)
- rescue SystemCallError
- make_tag_dir(parent)
- Dir.mkdir(parent)
- end
- end
-
- # Writes each tag in +tags+ to the tag file. Overwrites the
- # tag file if it exists.
- def self.write_tags(tags)
- file = tags_file
- make_tag_dir(file)
- File.open(file, "w:utf-8") do |f|
- tags.each { |t| f.puts t }
- end
- end
-
- # Writes +tag+ to the tag file if it does not already exist.
- # Returns +true+ if the tag is written, +false+ otherwise.
- def self.write_tag(tag)
- tags = read_tags([tag.tag])
- tags.each do |t|
- if t.tag == tag.tag and t.description == tag.description
- return false
- end
- end
-
- file = tags_file
- make_tag_dir(file)
- File.open(file, "a:utf-8") { |f| f.puts tag.to_s }
- return true
- end
-
- # Deletes +tag+ from the tag file if it exists. Returns +true+
- # if the tag is deleted, +false+ otherwise. Deletes the tag
- # file if it is empty.
- def self.delete_tag(tag)
- deleted = false
- desc = tag.escape(tag.description)
- file = tags_file
- if File.exist? file
- lines = IO.readlines(file)
- File.open(file, "w:utf-8") do |f|
- lines.each do |line|
- line = line.chomp
- if line.start_with?(tag.tag) and line.end_with?(desc)
- deleted = true
- else
- f.puts line unless line.empty?
- end
- end
- end
- File.delete file unless File.size? file
- end
- return deleted
- end
-
- # Removes the tag file associated with a spec file.
- def self.delete_tags
- file = tags_file
- File.delete file if File.exist? file
- end
-
- # Initialize @env
- setup_env
-end
diff --git a/spec/mspec/lib/mspec/runner/object.rb b/spec/mspec/lib/mspec/runner/object.rb
deleted file mode 100644
index 2ea8197165..0000000000
--- a/spec/mspec/lib/mspec/runner/object.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-class Object
- private def before(at=:each, &block)
- MSpec.current.before at, &block
- end
-
- private def after(at=:each, &block)
- MSpec.current.after at, &block
- end
-
- private def describe(mod, msg=nil, options=nil, &block)
- MSpec.describe mod, msg, &block
- end
-
- private def it(msg, &block)
- MSpec.current.it msg, &block
- end
-
- private def it_should_behave_like(desc)
- MSpec.current.it_should_behave_like desc
- end
-
- alias_method :context, :describe
- private :context
- alias_method :specify, :it
- private :specify
-end
diff --git a/spec/mspec/lib/mspec/runner/shared.rb b/spec/mspec/lib/mspec/runner/shared.rb
deleted file mode 100644
index b606de473b..0000000000
--- a/spec/mspec/lib/mspec/runner/shared.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'mspec/runner/mspec'
-
-def it_behaves_like(desc, meth, obj=nil)
- send :before, :all do
- @method = meth
- @object = obj
- end
-
- send :it_should_behave_like, desc.to_s
-end
diff --git a/spec/mspec/lib/mspec/runner/tag.rb b/spec/mspec/lib/mspec/runner/tag.rb
deleted file mode 100644
index e2275ad3a6..0000000000
--- a/spec/mspec/lib/mspec/runner/tag.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-class SpecTag
- attr_accessor :tag, :comment, :description
-
- def initialize(string=nil)
- parse(string) if string
- end
-
- def parse(string)
- m = /^([^()#:]+)(\(([^)]+)?\))?:(.*)$/.match string
- @tag, @comment, description = m.values_at(1, 3, 4) if m
- @description = unescape description
- end
-
- def unescape(str)
- return unless str
- if str[0] == ?" and str[-1] == ?"
- str[1..-2].gsub('\n', "\n")
- else
- str
- end
- end
-
- def escape(str)
- if str.include? "\n"
- %["#{str.gsub("\n", '\n')}"]
- else
- str
- end
- end
-
- def to_s
- "#{@tag}#{ "(#{@comment})" if @comment }:#{escape @description}"
- end
-
- def ==(o)
- @tag == o.tag and @comment == o.comment and @description == o.description
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/deprecate.rb b/spec/mspec/lib/mspec/utils/deprecate.rb
deleted file mode 100644
index 1db843b329..0000000000
--- a/spec/mspec/lib/mspec/utils/deprecate.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module MSpec
- def self.deprecate(what, replacement)
- user_caller = caller.find { |line| !line.include?('lib/mspec') }
- $stderr.puts "\n#{what} is deprecated, use #{replacement} instead.\nfrom #{user_caller}"
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/name_map.rb b/spec/mspec/lib/mspec/utils/name_map.rb
deleted file mode 100644
index c1de081af0..0000000000
--- a/spec/mspec/lib/mspec/utils/name_map.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-class NameMap
- MAP = {
- '`' => 'backtick',
- '+' => 'plus',
- '-' => 'minus',
- '+@' => 'uplus',
- '-@' => 'uminus',
- '*' => 'multiply',
- '/' => 'divide',
- '%' => 'modulo',
- '<<' => {'Bignum' => 'left_shift',
- 'Fixnum' => 'left_shift',
- 'IO' => 'output',
- :default => 'append' },
- '>>' => 'right_shift',
- '<' => 'lt',
- '<=' => 'lte',
- '>' => 'gt',
- '>=' => 'gte',
- '=' => 'assignment',
- '==' => 'equal_value',
- '===' => 'case_compare',
- '<=>' => 'comparison',
- '[]' => 'element_reference',
- '[]=' => 'element_set',
- '**' => 'exponent',
- '!' => 'not',
- '~' => {'Bignum' => 'complement',
- 'Fixnum' => 'complement',
- 'Regexp' => 'match',
- 'String' => 'match' },
- '!=' => 'not_equal',
- '!~' => 'not_match',
- '=~' => 'match',
- '&' => {'Bignum' => 'bit_and',
- 'Fixnum' => 'bit_and',
- 'Array' => 'intersection',
- 'TrueClass' => 'and',
- 'FalseClass' => 'and',
- 'NilClass' => 'and',
- 'Set' => 'intersection' },
- '|' => {'Bignum' => 'bit_or',
- 'Fixnum' => 'bit_or',
- 'Array' => 'union',
- 'TrueClass' => 'or',
- 'FalseClass' => 'or',
- 'NilClass' => 'or',
- 'Set' => 'union' },
- '^' => {'Bignum' => 'bit_xor',
- 'Fixnum' => 'bit_xor',
- 'TrueClass' => 'xor',
- 'FalseClass' => 'xor',
- 'NilClass' => 'xor',
- 'Set' => 'exclusion'},
- }
-
- EXCLUDED = %w[
- MSpecScript
- MkSpec
- MSpecOption
- MSpecOptions
- NameMap
- SpecVersion
- ]
-
- def initialize(filter=false)
- @seen = {}
- @filter = filter
- end
-
- def exception?(name)
- return false unless c = class_or_module(name)
- c == Errno or c.ancestors.include? Exception
- end
-
- def class_or_module(c)
- const = Object.const_get(c, false)
- filtered = @filter && EXCLUDED.include?(const.name)
- return const if Module === const and !filtered
- rescue NameError
- end
-
- def namespace(mod, const)
- return const.to_s if mod.nil? or %w[Object Class Module].include? mod
- "#{mod}::#{const}"
- end
-
- def map(hash, constants, mod=nil)
- @seen = {} unless mod
-
- constants.each do |const|
- name = namespace mod, const
- m = class_or_module name
- next unless m and !@seen[m]
- @seen[m] = true
-
- ms = m.methods(false).map { |x| x.to_s }
- hash["#{name}."] = ms.sort unless ms.empty?
-
- ms = m.public_instance_methods(false) +
- m.protected_instance_methods(false)
- ms.map! { |x| x.to_s }
- hash["#{name}#"] = ms.sort unless ms.empty?
-
- map hash, m.constants(false), name
- end
-
- hash
- end
-
- def dir_name(c, base)
- return File.join(base, 'exception') if exception? c
-
- c.split('::').inject(base) do |dir, name|
- name.gsub!(/Class/, '') unless name == 'Class'
- File.join dir, name.downcase
- end
- end
-
- def file_name(m, c)
- if MAP.key?(m)
- name = MAP[m].is_a?(Hash) ? MAP[m][c.split('::').last] || MAP[m][:default] : MAP[m]
- else
- name = m.gsub(/[?!=]/, '')
- end
- "#{name}_spec.rb"
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/options.rb b/spec/mspec/lib/mspec/utils/options.rb
deleted file mode 100644
index 9f8dd01dbf..0000000000
--- a/spec/mspec/lib/mspec/utils/options.rb
+++ /dev/null
@@ -1,481 +0,0 @@
-require 'mspec/version'
-
-MSPEC_HOME = File.expand_path('../../../..', __FILE__)
-
-class MSpecOption
- attr_reader :short, :long, :arg, :description, :block
-
- def initialize(short, long, arg, description, block)
- @short = short
- @long = long
- @arg = arg
- @description = description
- @block = block
- end
-
- def arg?
- @arg != nil
- end
-
- def match?(opt)
- opt == @short or opt == @long
- end
-end
-
-# MSpecOptions provides a parser for command line options. It also
-# provides a composable set of options from which the runner scripts
-# can select for their particular functionality.
-class MSpecOptions
- # Raised if incorrect or incomplete formats are passed to #on.
- class OptionError < Exception; end
-
- # Raised if an unrecognized option is encountered.
- class ParseError < Exception; end
-
- attr_accessor :config, :banner, :width, :options
-
- def initialize(banner="", width=30, config=nil)
- @banner = banner
- @config = config
- @width = width
- @options = []
- @doc = []
- @extra = []
- @on_extra = lambda { |x|
- raise ParseError, "Unrecognized option: #{x}" if x[0] == ?-
- @extra << x
- }
-
- yield self if block_given?
- end
-
- # Registers an option. Acceptable formats for arguments are:
- #
- # on "-a", "description"
- # on "-a", "--abdc", "description"
- # on "-a", "ARG", "description"
- # on "--abdc", "ARG", "description"
- # on "-a", "--abdc", "ARG", "description"
- #
- # If an block is passed, it will be invoked when the option is
- # matched. Not passing a block is permitted, but nonsensical.
- def on(*args, &block)
- raise OptionError, "option and description are required" if args.size < 2
-
- description = args.pop
- short, long, argument = nil
- args.each do |arg|
- if arg[0] == ?-
- if arg[1] == ?-
- long = arg
- else
- short = arg
- end
- else
- argument = arg
- end
- end
-
- add short, long, argument, description, block
- end
-
- # Adds documentation text for an option and adds an +MSpecOption+
- # instance to the list of registered options.
- def add(short, long, arg, description, block)
- s = short ? short.dup : " "
- s += (short ? ", " : " ") if long
- doc " #{s}#{long} #{arg}".ljust(@width-1) + " #{description}"
- @options << MSpecOption.new(short, long, arg, description, block)
- end
-
- # Searches all registered options to find a match for +opt+. Returns
- # +nil+ if no registered options match.
- def match?(opt)
- @options.find { |o| o.match? opt }
- end
-
- # Processes an option. Calles the #on_extra block (or default) for
- # unrecognized options. For registered options, possibly fetches an
- # argument and invokes the option's block if it is not nil.
- def process(argv, entry, opt, arg)
- unless option = match?(opt)
- @on_extra[entry]
- else
- if option.arg?
- arg = argv.shift if arg.nil?
- raise ParseError, "No argument provided for #{opt}" unless arg
- option.block[arg] if option.block
- else
- option.block[] if option.block
- end
- end
- option
- end
-
- # Splits a string at +n+ characters into the +opt+ and the +rest+.
- # The +arg+ is set to +nil+ if +rest+ is an empty string.
- def split(str, n)
- opt = str[0, n]
- rest = str[n, str.size]
- arg = rest == "" ? nil : rest
- return opt, arg, rest
- end
-
- # Parses an array of command line entries, calling blocks for
- # registered options.
- def parse(argv=ARGV)
- argv = Array(argv).dup
-
- while entry = argv.shift
- # collect everything that is not an option
- if entry[0] != ?- or entry.size < 2
- @on_extra[entry]
- next
- end
-
- # this is a long option
- if entry[1] == ?-
- opt, arg = entry.split "="
- process argv, entry, opt, arg
- next
- end
-
- # disambiguate short option group from short option with argument
- opt, arg, rest = split entry, 2
-
- # process first option
- option = process argv, entry, opt, arg
- next unless option and !option.arg?
-
- # process the rest of the options
- while rest.size > 0
- opt, arg, rest = split rest, 1
- opt = "-" + opt
- option = process argv, opt, opt, arg
- break if !option or option.arg?
- end
- end
-
- @extra
- rescue ParseError => e
- puts self
- puts e
- exit 1
- end
-
- # Adds a string of documentation text inline in the text generated
- # from the options. See #on and #add.
- def doc(str)
- @doc << str
- end
-
- # Convenience method for providing -v, --version options.
- def version(version, &block)
- show = block || lambda { puts "#{File.basename $0} #{version}"; exit }
- on "-v", "--version", "Show version", &show
- end
-
- # Convenience method for providing -h, --help options.
- def help(&block)
- help = block || lambda { puts self; exit 1 }
- on "-h", "--help", "Show this message", &help
- end
-
- # Stores a block that will be called with unrecognized options
- def on_extra(&block)
- @on_extra = block
- end
-
- # Returns a string representation of the options and doc strings.
- def to_s
- @banner + "\n\n" + @doc.join("\n") + "\n"
- end
-
- # The methods below provide groups of options that
- # are composed by the particular runners to provide
- # their functionality
-
- def configure(&block)
- on("-B", "--config", "FILE",
- "Load FILE containing configuration options", &block)
- end
-
- def targets
- on("-t", "--target", "TARGET",
- "Implementation to run the specs, where TARGET is:") do |t|
- case t
- when 'r', 'ruby'
- config[:target] = 'ruby'
- when 'x', 'rubinius'
- config[:target] = './bin/rbx'
- when 'X', 'rbx'
- config[:target] = 'rbx'
- when 'j', 'jruby'
- config[:target] = 'jruby'
- when 'i','ironruby'
- config[:target] = 'ir'
- when 'm','maglev'
- config[:target] = 'maglev-ruby'
- when 't','topaz'
- config[:target] = 'topaz'
- when 'o','opal'
- mspec_lib = File.expand_path('../../../', __FILE__)
- config[:target] = "./bin/opal -syaml -sfileutils -rnodejs -rnodejs/require -rnodejs/yaml -rprocess -Derror -I#{mspec_lib} -I./lib/ -I. "
- else
- config[:target] = t
- end
- end
-
- doc ""
- doc " r or ruby invokes ruby in PATH"
- doc " x or rubinius invokes ./bin/rbx"
- doc " X or rbx invokes rbx in PATH"
- doc " j or jruby invokes jruby in PATH"
- doc " i or ironruby invokes ir in PATH"
- doc " m or maglev invokes maglev-ruby in PATH"
- doc " t or topaz invokes topaz in PATH"
- doc " o or opal invokes ./bin/opal with options"
- doc " full path to EXE invokes EXE directly\n"
-
- on("-T", "--target-opt", "OPT",
- "Pass OPT as a flag to the target implementation") do |t|
- config[:flags] << t
- end
- on("-I", "--include", "DIR",
- "Pass DIR through as the -I option to the target") do |d|
- config[:loadpath] << "-I#{d}"
- end
- on("-r", "--require", "LIBRARY",
- "Pass LIBRARY through as the -r option to the target") do |f|
- config[:requires] << "-r#{f}"
- end
- end
-
- def formatters
- on("-f", "--format", "FORMAT",
- "Formatter for reporting, where FORMAT is one of:") do |o|
- require 'mspec/runner/formatters'
- case o
- when 's', 'spec', 'specdoc'
- config[:formatter] = SpecdocFormatter
- when 'h', 'html'
- config[:formatter] = HtmlFormatter
- when 'd', 'dot', 'dotted'
- config[:formatter] = DottedFormatter
- when 'b', 'describe'
- config[:formatter] = DescribeFormatter
- when 'f', 'file'
- config[:formatter] = FileFormatter
- when 'u', 'unit', 'unitdiff'
- config[:formatter] = UnitdiffFormatter
- when 'm', 'summary'
- config[:formatter] = SummaryFormatter
- when 'a', '*', 'spin'
- config[:formatter] = SpinnerFormatter
- when 't', 'method'
- config[:formatter] = MethodFormatter
- when 'y', 'yaml'
- config[:formatter] = YamlFormatter
- when 'p', 'profile'
- config[:formatter] = ProfileFormatter
- when 'j', 'junit'
- config[:formatter] = JUnitFormatter
- else
- abort "Unknown format: #{o}\n#{@parser}" unless File.exist?(o)
- require File.expand_path(o)
- if Object.const_defined?(:CUSTOM_MSPEC_FORMATTER)
- config[:formatter] = CUSTOM_MSPEC_FORMATTER
- else
- abort "You must define CUSTOM_MSPEC_FORMATTER in your custom formatter file"
- end
- end
- end
-
- doc ""
- doc " s, spec, specdoc SpecdocFormatter"
- doc " h, html, HtmlFormatter"
- doc " d, dot, dotted DottedFormatter"
- doc " f, file FileFormatter"
- doc " u, unit, unitdiff UnitdiffFormatter"
- doc " m, summary SummaryFormatter"
- doc " a, *, spin SpinnerFormatter"
- doc " t, method MethodFormatter"
- doc " y, yaml YamlFormatter"
- doc " p, profile ProfileFormatter"
- doc " j, junit JUnitFormatter\n"
-
- on("-o", "--output", "FILE",
- "Write formatter output to FILE") do |f|
- config[:output] = f
- end
- end
-
- def filters
- on("-e", "--example", "STR",
- "Run examples with descriptions matching STR") do |o|
- config[:includes] << o
- end
- on("-E", "--exclude", "STR",
- "Exclude examples with descriptions matching STR") do |o|
- config[:excludes] << o
- end
- on("-p", "--pattern", "PATTERN",
- "Run examples with descriptions matching PATTERN") do |o|
- config[:patterns] << Regexp.new(o)
- end
- on("-P", "--excl-pattern", "PATTERN",
- "Exclude examples with descriptions matching PATTERN") do |o|
- config[:xpatterns] << Regexp.new(o)
- end
- on("-g", "--tag", "TAG",
- "Run examples with descriptions matching ones tagged with TAG") do |o|
- config[:tags] << o
- end
- on("-G", "--excl-tag", "TAG",
- "Exclude examples with descriptions matching ones tagged with TAG") do |o|
- config[:xtags] << o
- end
- on("-w", "--profile", "FILE",
- "Run examples for methods listed in the profile FILE") do |f|
- config[:profiles] << f
- end
- on("-W", "--excl-profile", "FILE",
- "Exclude examples for methods listed in the profile FILE") do |f|
- config[:xprofiles] << f
- end
- end
-
- def chdir
- on("-C", "--chdir", "DIR",
- "Change the working directory to DIR before running specs") do |d|
- Dir.chdir d
- end
- end
-
- def prefix
- on("--prefix", "STR", "Prepend STR when resolving spec file names") do |p|
- config[:prefix] = p
- end
- end
-
- def pretend
- on("-Z", "--dry-run",
- "Invoke formatters and other actions, but don't execute the specs") do
- MSpec.register_mode :pretend
- end
- end
-
- def unguarded
- on("--unguarded", "Turn off all guards") do
- MSpec.register_mode :unguarded
- end
- on("--no-ruby_bug", "Turn off the ruby_bug guard") do
- MSpec.register_mode :no_ruby_bug
- end
- end
-
- def randomize
- on("-H", "--random",
- "Randomize the list of spec files") do
- MSpec.randomize
- end
- end
-
- def repeat
- on("-R", "--repeat", "NUMBER",
- "Repeatedly run an example NUMBER times") do |o|
- MSpec.repeat = o.to_i
- end
- end
-
- def verbose
- on("-V", "--verbose", "Output the name of each file processed") do
- obj = Object.new
- def obj.start
- @width = MSpec.retrieve(:files).inject(0) { |max, f| f.size > max ? f.size : max }
- end
- def obj.load
- file = MSpec.retrieve :file
- STDERR.print "\n#{file.ljust(@width)}"
- end
- MSpec.register :start, obj
- MSpec.register :load, obj
- end
-
- on("-m", "--marker", "MARKER",
- "Output MARKER for each file processed") do |o|
- obj = Object.new
- obj.instance_variable_set :@marker, o
- def obj.load
- STDERR.print @marker
- end
- MSpec.register :load, obj
- end
- end
-
- def interrupt
- on("--int-spec", "Control-C interupts the current spec only") do
- config[:abort] = false
- end
- end
-
- def verify
- on("--report-on", "GUARD", "Report specs guarded by GUARD") do |g|
- MSpec.register_mode :report_on
- SpecGuard.guards << g.to_sym
- end
- on("-O", "--report", "Report guarded specs") do
- MSpec.register_mode :report
- end
- on("-Y", "--verify",
- "Verify that guarded specs pass and fail as expected") do
- MSpec.register_mode :verify
- end
- end
-
- def action_filters
- on("-K", "--action-tag", "TAG",
- "Spec descriptions marked with TAG will trigger the specified action") do |o|
- config[:atags] << o
- end
- on("-S", "--action-string", "STR",
- "Spec descriptions matching STR will trigger the specified action") do |o|
- config[:astrings] << o
- end
- end
-
- def actions
- on("--spec-debug",
- "Invoke the debugger when a spec description matches (see -K, -S)") do
- config[:debugger] = true
- end
- end
-
- def debug
- on("-d", "--debug",
- "Set MSpec debugging flag for more verbose output") do
- $MSPEC_DEBUG = true
- end
- end
-
- def all
- # Generated with:
- # puts File.read(__FILE__).scan(/def (\w+).*\n\s*on\(/)
- configure {}
- targets
- formatters
- filters
- chdir
- prefix
- pretend
- unguarded
- randomize
- repeat
- verbose
- interrupt
- verify
- action_filters
- actions
- debug
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/script.rb b/spec/mspec/lib/mspec/utils/script.rb
deleted file mode 100644
index 24cd069bb4..0000000000
--- a/spec/mspec/lib/mspec/utils/script.rb
+++ /dev/null
@@ -1,274 +0,0 @@
-require 'mspec/guards/guard'
-require 'mspec/guards/version'
-require 'mspec/utils/warnings'
-
-# MSpecScript provides a skeleton for all the MSpec runner scripts.
-
-class MSpecScript
- # Returns the config object. Maintained at the class
- # level to easily enable simple config files. See the
- # class method +set+.
- def self.config
- @config ||= {
- :path => ['.', 'spec'],
- :config_ext => '.mspec'
- }
- end
-
- # Associates +value+ with +key+ in the config object. Enables
- # simple config files of the form:
- #
- # class MSpecScript
- # set :target, "ruby"
- # set :files, ["one_spec.rb", "two_spec.rb"]
- # end
- def self.set(key, value)
- config[key] = value
- end
-
- # Gets the value of +key+ from the config object. Simplifies
- # getting values in a config file:
- #
- # class MSpecScript
- # set :a, 1
- # set :b, 2
- # set :c, get(:a) + get(:b)
- # end
- def self.get(key)
- config[key]
- end
-
- def initialize
- ruby_version_is ""..."2.2" do
- abort "MSpec needs Ruby 2.2 or more recent"
- end
-
- config[:formatter] = nil
- config[:includes] = []
- config[:excludes] = []
- config[:patterns] = []
- config[:xpatterns] = []
- config[:tags] = []
- config[:xtags] = []
- config[:profiles] = []
- config[:xprofiles] = []
- config[:atags] = []
- config[:astrings] = []
- config[:ltags] = []
- config[:abort] = true
- @loaded = []
- end
-
- # Returns the config object maintained by the instance's class.
- # See the class methods +set+ and +config+.
- def config
- MSpecScript.config
- end
-
- # Returns +true+ if the file was located in +config[:path]+,
- # possibly appending +config[:config_ext]. Returns +false+
- # otherwise.
- def try_load(target)
- names = [target]
- unless target[-6..-1] == config[:config_ext]
- names << target + config[:config_ext]
- end
-
- names.each do |name|
- config[:path].each do |dir|
- file = File.expand_path name, dir
- if @loaded.include?(file)
- return true
- elsif File.exist? file
- value = Kernel.load(file)
- @loaded << file
- return value
- end
- end
- end
-
- false
- end
-
- def load(target)
- try_load(target) or abort "Could not load config file #{target}"
- end
-
- # Attempts to load a default config file. First tries to load
- # 'default.mspec'. If that fails, attempts to load a config
- # file name constructed from the value of RUBY_ENGINE and the
- # first two numbers in RUBY_VERSION. For example, on MRI 1.8.6,
- # the file name would be 'ruby.1.8.mspec'.
- def load_default
- try_load 'default.mspec'
-
- if Object.const_defined?(:RUBY_ENGINE)
- engine = RUBY_ENGINE
- else
- engine = 'ruby'
- end
- try_load "#{engine}.#{SpecGuard.ruby_version}.mspec"
- try_load "#{engine}.mspec"
- end
-
- # Callback for enabling custom options. This version is a no-op.
- # Provide an implementation specific version in a config file.
- # Called by #options after the MSpec-provided options are added.
- def custom_options(options)
- options.doc " No custom options registered"
- end
-
- # Registers all filters and actions.
- def register
- require 'mspec/runner/formatters/dotted'
- require 'mspec/runner/formatters/spinner'
- require 'mspec/runner/formatters/file'
- require 'mspec/runner/filters'
-
- if config[:formatter].nil?
- config[:formatter] = STDOUT.tty? ? SpinnerFormatter : @files.size < 50 ? DottedFormatter : FileFormatter
- end
-
- if config[:formatter]
- formatter = config[:formatter].new(config[:output])
- formatter.register
- MSpec.store :formatter, formatter
- end
-
- MatchFilter.new(:include, *config[:includes]).register unless config[:includes].empty?
- MatchFilter.new(:exclude, *config[:excludes]).register unless config[:excludes].empty?
- RegexpFilter.new(:include, *config[:patterns]).register unless config[:patterns].empty?
- RegexpFilter.new(:exclude, *config[:xpatterns]).register unless config[:xpatterns].empty?
- TagFilter.new(:include, *config[:tags]).register unless config[:tags].empty?
- TagFilter.new(:exclude, *config[:xtags]).register unless config[:xtags].empty?
- ProfileFilter.new(:include, *config[:profiles]).register unless config[:profiles].empty?
- ProfileFilter.new(:exclude, *config[:xprofiles]).register unless config[:xprofiles].empty?
-
- DebugAction.new(config[:atags], config[:astrings]).register if config[:debugger]
-
- custom_register
- end
-
- # Callback for enabling custom actions, etc. This version is a
- # no-op. Provide an implementation specific version in a config
- # file. Called by #register.
- def custom_register
- end
-
- # Sets up signal handlers. Only a handler for SIGINT is
- # registered currently.
- def signals
- if config[:abort]
- Signal.trap "INT" do
- MSpec.actions :abort
- puts "\nProcess aborted!"
- exit! 1
- end
- end
- end
-
- # Attempts to resolve +partial+ as a file or directory name in the
- # following order:
- #
- # 1. +partial+
- # 2. +partial+ + "_spec.rb"
- # 3. <tt>File.join(config[:prefix], partial)</tt>
- # 4. <tt>File.join(config[:prefix], partial + "_spec.rb")</tt>
- #
- # If it is a file name, returns the name as an entry in an array.
- # If it is a directory, returns all *_spec.rb files in the
- # directory and subdirectories.
- #
- # If unable to resolve +partial+, +Kernel.abort+ is called.
- def entries(partial)
- file = partial + "_spec.rb"
- patterns = [partial, file]
- if config[:prefix]
- patterns << File.join(config[:prefix], partial)
- patterns << File.join(config[:prefix], file)
- end
-
- patterns.each do |pattern|
- expanded = File.expand_path(pattern)
- if File.file?(expanded) && expanded.end_with?('.rb')
- return [expanded]
- elsif File.directory?(expanded)
- specs = Dir["#{expanded}/**/*_spec.rb"].sort
- return specs unless specs.empty?
- end
- end
-
- abort "Could not find spec file #{partial}"
- end
-
- # Resolves each entry in +patterns+ to a set of files.
- #
- # If the pattern has a leading '^' character, the list of files
- # is subtracted from the list of files accumulated to that point.
- #
- # If the entry has a leading ':' character, the corresponding
- # key is looked up in the config object and the entries in the
- # value retrieved are processed through #entries.
- def files(patterns)
- list = []
- patterns.each do |pattern|
- case pattern[0]
- when ?^
- list -= entries(pattern[1..-1])
- when ?:
- key = pattern[1..-1].to_sym
- value = config[key]
- abort "Key #{pattern} not found in mspec config." unless value
- list += files(Array(value))
- else
- list += entries(pattern)
- end
- end
- list
- end
-
- def files_from_patterns(patterns)
- unless $0.end_with?("_spec.rb")
- if patterns.empty?
- patterns = config[:files]
- end
- if patterns.empty? and File.directory? "./spec"
- patterns = ["spec/"]
- end
- end
- list = files(patterns)
- abort "No files specified." if list.empty?
- list
- end
-
- def cores(max)
- require 'etc'
- [Etc.nprocessors, max].min
- end
-
- def setup_env
- ENV['MSPEC_RUNNER'] = '1'
-
- unless ENV['RUBY_EXE']
- ENV['RUBY_EXE'] = config[:target] if config[:target]
- end
-
- unless ENV['RUBY_FLAGS']
- ENV['RUBY_FLAGS'] = config[:flags].join(" ") if config[:flags]
- end
- end
-
- # Instantiates an instance and calls the series of methods to
- # invoke the script.
- def self.main
- script = new
- script.load_default
- script.try_load '~/.mspecrc'
- script.options
- script.signals
- script.register
- script.setup_env
- require 'mspec'
- script.run
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/version.rb b/spec/mspec/lib/mspec/utils/version.rb
deleted file mode 100644
index 787a76b053..0000000000
--- a/spec/mspec/lib/mspec/utils/version.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-class SpecVersion
- # If beginning implementations have a problem with this include, we can
- # manually implement the relational operators that are needed.
- include Comparable
-
- # SpecVersion handles comparison correctly for the context by filling in
- # missing version parts according to the value of +ceil+. If +ceil+ is
- # +false+, 0 digits fill in missing version parts. If +ceil+ is +true+, 9
- # digits fill in missing parts. (See e.g. VersionGuard and BugGuard.)
- def initialize(version, ceil = false)
- @version = version
- @ceil = ceil
- @integer = nil
- end
-
- def to_s
- @version
- end
-
- def to_str
- to_s
- end
-
- # Converts a string representation of a version major.minor.tiny
- # to an integer representation so that comparisons can be made. For example,
- # "2.2.10" < "2.2.2" would be false if compared as strings.
- def to_i
- unless @integer
- major, minor, tiny = @version.split "."
- if @ceil
- tiny = 99 unless tiny
- end
- parts = [major, minor, tiny].map { |x| x.to_i }
- @integer = ("1%02d%02d%02d" % parts).to_i
- end
- @integer
- end
-
- def to_int
- to_i
- end
-
- def <=>(other)
- if other.respond_to? :to_int
- other = Integer other
- else
- other = SpecVersion.new(String(other)).to_i
- end
-
- self.to_i <=> other
- end
-end
diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb
deleted file mode 100644
index 4d23474236..0000000000
--- a/spec/mspec/lib/mspec/utils/warnings.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-require 'mspec/guards/version'
-
-if RUBY_ENGINE == "ruby" and ruby_version_is("2.4")
- ruby_version_is "2.4"..."2.5" do
- # Kernel#warn does not delegate to Warning.warn in 2.4
- module Kernel
- remove_method :warn
- def warn(*messages)
- return if $VERBOSE == nil or messages.empty?
- msg = messages.join("\n")
- msg += "\n" unless msg.end_with?("\n")
- Warning.warn(msg)
- end
- private :warn
- end
- end
-
- def Warning.warn(message)
- if Thread.current[:in_mspec_complain_matcher]
- return $stderr.write(message)
- end
-
- case message
- # $VERBOSE = true warnings
- when /(.+\.rb):(\d+):.+possibly useless use of (<|<=|==|>=|>) in void context/
- # Make sure there is a .should otherwise it is missing
- line_nb = Integer($2)
- unless File.exist?($1) and /\.should(_not)? (<|<=|==|>=|>)/ === File.readlines($1)[line_nb-1]
- $stderr.write message
- end
- when /possibly useless use of (\+|-) in void context/
- when /assigned but unused variable/
- when /method redefined/
- when /previous definition of/
- when /instance variable @.+ not initialized/
- when /statement not reached/
- when /shadowing outer local variable/
- when /setting Encoding.default_(in|ex)ternal/
- when /unknown (un)?pack directive/
- when /(un)?trust(ed\?)? is deprecated/
- when /\.exists\? is a deprecated name/
- when /Float .+ out of range/
- when /passing a block to String#(bytes|chars|codepoints|lines) is deprecated/
- when /core\/string\/modulo_spec\.rb:\d+: warning: too many arguments for format string/
- when /regexp\/shared\/new_ascii(_8bit)?\.rb:\d+: warning: Unknown escape .+ is ignored/
-
- # $VERBOSE = false warnings
- when /constant ::(Fixnum|Bignum) is deprecated/
- when /\/(argf|io|stringio)\/.+(ARGF|IO)#(lines|chars|bytes|codepoints) is deprecated/
- when /Thread\.exclusive is deprecated.+\n.+thread\/exclusive_spec\.rb/
- when /hash\/shared\/index\.rb:\d+: warning: Hash#index is deprecated; use Hash#key/
- when /env\/shared\/key\.rb:\d+: warning: ENV\.index is deprecated; use ENV\.key/
- when /exponent(_spec)?\.rb:\d+: warning: in a\*\*b, b may be too big/
- when /enumerator\/(new|initialize_spec)\.rb:\d+: warning: Enumerator\.new without a block is deprecated/
- else
- $stderr.write message
- end
- end
-else
- $VERBOSE = nil unless ENV['OUTPUT_WARNINGS']
-end
diff --git a/spec/mspec/lib/mspec/version.rb b/spec/mspec/lib/mspec/version.rb
deleted file mode 100644
index 9126f5366e..0000000000
--- a/spec/mspec/lib/mspec/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'mspec/utils/version'
-
-module MSpec
- VERSION = SpecVersion.new "1.8.0"
-end
diff --git a/spec/mspec/spec/commands/fixtures/four.txt b/spec/mspec/spec/commands/fixtures/four.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/spec/mspec/spec/commands/fixtures/four.txt
+++ /dev/null
diff --git a/spec/mspec/spec/commands/fixtures/one_spec.rb b/spec/mspec/spec/commands/fixtures/one_spec.rb
deleted file mode 100644
index 8b13789179..0000000000
--- a/spec/mspec/spec/commands/fixtures/one_spec.rb
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/spec/mspec/spec/commands/fixtures/three.rb b/spec/mspec/spec/commands/fixtures/three.rb
deleted file mode 100644
index 8b13789179..0000000000
--- a/spec/mspec/spec/commands/fixtures/three.rb
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/spec/mspec/spec/commands/fixtures/two_spec.rb b/spec/mspec/spec/commands/fixtures/two_spec.rb
deleted file mode 100644
index 8b13789179..0000000000
--- a/spec/mspec/spec/commands/fixtures/two_spec.rb
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/spec/mspec/spec/commands/mkspec_spec.rb b/spec/mspec/spec/commands/mkspec_spec.rb
deleted file mode 100644
index 14c363f286..0000000000
--- a/spec/mspec/spec/commands/mkspec_spec.rb
+++ /dev/null
@@ -1,363 +0,0 @@
-require 'spec_helper'
-require 'mspec/commands/mkspec'
-
-
-describe "The -c, --constant CONSTANT option" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
- @script = MkSpec.new
- @config = @script.config
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-c", "--constant", "CONSTANT",
- an_instance_of(String))
- @script.options []
- end
-
- it "adds CONSTANT to the list of constants" do
- ["-c", "--constant"].each do |opt|
- @config[:constants] = []
- @script.options [opt, "Object"]
- @config[:constants].should include("Object")
- end
- end
-end
-
-describe "The -b, --base DIR option" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
- @script = MkSpec.new
- @config = @script.config
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-b", "--base", "DIR",
- an_instance_of(String))
- @script.options []
- end
-
- it "sets the base directory relative to which the spec directories are created" do
- ["-b", "--base"].each do |opt|
- @config[:base] = nil
- @script.options [opt, "superspec"]
- @config[:base].should == File.expand_path("superspec")
- end
- end
-end
-
-describe "The -r, --require LIBRARY option" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
- @script = MkSpec.new
- @config = @script.config
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-r", "--require", "LIBRARY",
- an_instance_of(String))
- @script.options []
- end
-
- it "adds CONSTANT to the list of constants" do
- ["-r", "--require"].each do |opt|
- @config[:requires] = []
- @script.options [opt, "libspec"]
- @config[:requires].should include("libspec")
- end
- end
-end
-
-describe "The -V, --version-guard VERSION option" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
- @script = MkSpec.new
- @config = @script.config
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-V", "--version-guard", "VERSION",
- an_instance_of(String))
- @script.options []
- end
-
- it "sets the version for the ruby_version_is guards to VERSION" do
- ["-r", "--require"].each do |opt|
- @config[:requires] = []
- @script.options [opt, "libspec"]
- @config[:requires].should include("libspec")
- end
- end
-end
-
-describe MkSpec, "#options" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
- @script = MkSpec.new
- end
-
- it "parses the command line options" do
- @options.should_receive(:parse).with(["--this", "and", "--that"])
- @script.options ["--this", "and", "--that"]
- end
-
- it "parses ARGV unless passed other options" do
- @options.should_receive(:parse).with(ARGV)
- @script.options
- end
-
- it "prints help and exits if passed an unrecognized option" do
- @options.should_receive(:raise).with(MSpecOptions::ParseError, an_instance_of(String))
- @options.stub(:puts)
- @options.stub(:exit)
- @script.options ["--iunknown"]
- end
-end
-
-describe MkSpec, "#create_directory" do
- before :each do
- @script = MkSpec.new
- @script.config[:base] = "spec"
- end
-
- it "prints a warning if a file with the directory name exists" do
- File.should_receive(:exist?).and_return(true)
- File.should_receive(:directory?).and_return(false)
- FileUtils.should_not_receive(:mkdir_p)
- @script.should_receive(:puts).with("spec/class already exists and is not a directory.")
- @script.create_directory("Class").should == nil
- end
-
- it "does nothing if the directory already exists" do
- File.should_receive(:exist?).and_return(true)
- File.should_receive(:directory?).and_return(true)
- FileUtils.should_not_receive(:mkdir_p)
- @script.create_directory("Class").should == "spec/class"
- end
-
- it "creates the directory if it does not exist" do
- File.should_receive(:exist?).and_return(false)
- @script.should_receive(:mkdir_p).with("spec/class")
- @script.create_directory("Class").should == "spec/class"
- end
-
- it "creates the directory for a namespaced module if it does not exist" do
- File.should_receive(:exist?).and_return(false)
- @script.should_receive(:mkdir_p).with("spec/struct/tms")
- @script.create_directory("Struct::Tms").should == "spec/struct/tms"
- end
-end
-
-describe MkSpec, "#write_requires" do
- before :each do
- @script = MkSpec.new
- @script.config[:base] = "spec"
-
- @file = double("file")
- File.stub(:open).and_yield(@file)
- end
-
- it "writes the spec_helper require line" do
- @file.should_receive(:puts).with("require File.expand_path('../../../../spec_helper', __FILE__)")
- @script.write_requires("spec/core/tcejbo", "spec/core/tcejbo/inspect_spec.rb")
- end
-
- it "writes require lines for each library specified on the command line" do
- @file.stub(:puts)
- @file.should_receive(:puts).with("require File.expand_path('../../../../spec_helper', __FILE__)")
- @file.should_receive(:puts).with("require 'complex'")
- @script.config[:requires] << 'complex'
- @script.write_requires("spec/core/tcejbo", "spec/core/tcejbo/inspect_spec.rb")
- end
-end
-
-describe MkSpec, "#write_spec" do
- before :each do
- @file = IOStub.new
- File.stub(:open).and_yield(@file)
-
- @script = MkSpec.new
- @script.stub(:puts)
-
- @response = double("system command response")
- @response.stub(:include?).and_return(false)
- @script.stub(:`).and_return(@response)
- end
-
- it "checks if specs exist for the method if the spec file exists" do
- name = Regexp.escape(@script.ruby)
- @script.should_receive(:`).with(
- %r"#{name} #{MSPEC_HOME}/bin/mspec-run --dry-run --unguarded -fs -e 'Object#inspect' spec/core/tcejbo/inspect_spec.rb")
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- end
-
- it "checks for the method name in the spec file output" do
- @response.should_receive(:include?).with("Array#[]=")
- @script.write_spec("spec/core/yarra/element_set_spec.rb", "Array#[]=", true)
- end
-
- it "returns nil if the spec file exists and contains a spec for the method" do
- @response.stub(:include?).and_return(true)
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true).should == nil
- end
-
- it "does not print the spec file name if it exists and contains a spec for the method" do
- @response.stub(:include?).and_return(true)
- @script.should_not_receive(:puts)
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- end
-
- it "prints the spec file name if a template spec is written" do
- @script.should_receive(:puts).with("spec/core/tcejbo/inspect_spec.rb")
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- end
-
- it "writes a template spec to the file if the spec file does not exist" do
- @file.should_receive(:puts).twice
- @script.should_receive(:puts).with("spec/core/tcejbo/inspect_spec.rb")
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", false)
- end
-
- it "writes a template spec to the file if it exists but contains no spec for the method" do
- @response.should_receive(:include?).and_return(false)
- @file.should_receive(:puts).twice
- @script.should_receive(:puts).with("spec/core/tcejbo/inspect_spec.rb")
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- end
-
- it "writes a template spec" do
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- @file.should == <<EOS
-
-describe "Object#inspect" do
- it "needs to be reviewed for spec completeness"
-end
-EOS
- end
-
- it "writes a template spec with version guard" do
- @script.config[:version] = '""..."1.9"'
- @script.write_spec("spec/core/tcejbo/inspect_spec.rb", "Object#inspect", true)
- @file.should == <<EOS
-
-ruby_version_is ""..."1.9" do
- describe "Object#inspect" do
- it "needs to be reviewed for spec completeness"
- end
-end
-EOS
-
- end
-end
-
-describe MkSpec, "#create_file" do
- before :each do
- @script = MkSpec.new
- @script.stub(:write_requires)
- @script.stub(:write_spec)
-
- File.stub(:exist?).and_return(false)
- end
-
- it "generates a file name based on the directory, class/module, and method" do
- File.should_receive(:join).with("spec/tcejbo", "inspect_spec.rb"
- ).and_return("spec/tcejbo/inspect_spec.rb")
- @script.create_file("spec/tcejbo", "Object", "inspect", "Object#inspect")
- end
-
- it "does not call #write_requires if the spec file already exists" do
- File.should_receive(:exist?).and_return(true)
- @script.should_not_receive(:write_requires)
- @script.create_file("spec/tcejbo", "Object", "inspect", "Object#inspect")
- end
-
- it "calls #write_requires if the spec file does not exist" do
- File.should_receive(:exist?).and_return(false)
- @script.should_receive(:write_requires).with(
- "spec/tcejbo", "spec/tcejbo/inspect_spec.rb")
- @script.create_file("spec/tcejbo", "Object", "inspect", "Object#inspect")
- end
-
- it "calls #write_spec with the file, method name" do
- @script.should_receive(:write_spec).with(
- "spec/tcejbo/inspect_spec.rb", "Object#inspect", false)
- @script.create_file("spec/tcejbo", "Object", "inspect", "Object#inspect")
- end
-end
-
-describe MkSpec, "#run" do
- before :each do
- @options = MSpecOptions.new
- MSpecOptions.stub(:new).and_return(@options)
-
- @map = NameMap.new
- NameMap.stub(:new).and_return(@map)
-
- @script = MkSpec.new
- @script.stub(:create_directory).and_return("spec/mkspec")
- @script.stub(:create_file)
- @script.config[:constants] = [MkSpec]
- end
-
- it "loads files in the requires list" do
- @script.stub(:require)
- @script.should_receive(:require).with("alib")
- @script.should_receive(:require).with("blib")
- @script.config[:requires] = ["alib", "blib"]
- @script.run
- end
-
- it "creates a map of constants to methods" do
- @map.should_receive(:map).with({}, @script.config[:constants]).and_return({})
- @script.run
- end
-
- it "calls #create_directory for each class/module in the map" do
- @script.should_receive(:create_directory).with("MkSpec").twice
- @script.run
- end
-
- it "calls #create_file for each method on each class/module in the map" do
- @map.should_receive(:map).with({}, @script.config[:constants]
- ).and_return({"MkSpec#" => ["run"]})
- @script.should_receive(:create_file).with("spec/mkspec", "MkSpec", "run", "MkSpec#run")
- @script.run
- end
-end
-
-describe MkSpec, ".main" do
- before :each do
- @script = double("MkSpec").as_null_object
- MkSpec.stub(:new).and_return(@script)
- end
-
- it "sets MSPEC_RUNNER = '1' in the environment" do
- ENV["MSPEC_RUNNER"] = "0"
- MkSpec.main
- ENV["MSPEC_RUNNER"].should == "1"
- end
-
- it "creates an instance of MSpecScript" do
- MkSpec.should_receive(:new).and_return(@script)
- MkSpec.main
- end
-
- it "calls the #options method on the script" do
- @script.should_receive(:options)
- MkSpec.main
- end
-
- it "calls the #run method on the script" do
- @script.should_receive(:run)
- MkSpec.main
- end
-end
diff --git a/spec/mspec/spec/commands/mspec_ci_spec.rb b/spec/mspec/spec/commands/mspec_ci_spec.rb
deleted file mode 100644
index a90cbd8d0d..0000000000
--- a/spec/mspec/spec/commands/mspec_ci_spec.rb
+++ /dev/null
@@ -1,150 +0,0 @@
-require 'spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters/tag'
-require 'mspec/commands/mspec-ci'
-
-describe MSpecCI, "#options" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
-
- @script = MSpecCI.new
- @script.stub(:config).and_return(@config)
- @script.stub(:files).and_return([])
- end
-
- it "enables the chdir option" do
- @options.should_receive(:chdir)
- @script.options []
- end
-
- it "enables the prefix option" do
- @options.should_receive(:prefix)
- @script.options []
- end
-
- it "enables the config option" do
- @options.should_receive(:configure)
- @script.options []
- end
-
- it "provides a custom action (block) to the config option" do
- @script.should_receive(:load).with("cfg.mspec")
- @script.options ["-B", "cfg.mspec"]
- end
-
- it "enables the dry run option" do
- @options.should_receive(:pretend)
- @script.options []
- end
-
- it "enables the unguarded option" do
- @options.should_receive(:unguarded)
- @script.options []
- end
-
- it "enables the interrupt single specs option" do
- @options.should_receive(:interrupt)
- @script.options []
- end
-
- it "enables the formatter options" do
- @options.should_receive(:formatters)
- @script.options []
- end
-
- it "enables the verbose option" do
- @options.should_receive(:verbose)
- @script.options []
- end
-
- it "enables the action options" do
- @options.should_receive(:actions)
- @script.options []
- end
-
- it "enables the action filter options" do
- @options.should_receive(:action_filters)
- @script.options []
- end
-
- it "enables the version option" do
- @options.should_receive(:version)
- @script.options []
- end
-
- it "enables the help option" do
- @options.should_receive(:help)
- @script.options []
- end
-
- it "calls #custom_options" do
- @script.should_receive(:custom_options).with(@options)
- @script.options []
- end
-end
-
-describe MSpecCI, "#run" do
- before :each do
- MSpec.stub(:process)
-
- @filter = double("TagFilter")
- TagFilter.stub(:new).and_return(@filter)
- @filter.stub(:register)
-
- @tags = ["fails", "critical", "unstable", "incomplete", "unsupported"]
-
- @config = { :ci_files => ["one", "two"] }
- @script = MSpecCI.new
- @script.stub(:exit)
- @script.stub(:config).and_return(@config)
- @script.stub(:files).and_return(["one", "two"])
- @script.options []
- end
-
- it "registers the tags patterns" do
- @config[:tags_patterns] = [/spec/, "tags"]
- MSpec.should_receive(:register_tags_patterns).with([/spec/, "tags"])
- @script.run
- end
-
- it "registers the files to process" do
- MSpec.should_receive(:register_files).with(["one", "two"])
- @script.run
- end
-
- it "registers a tag filter for 'fails', 'unstable', 'incomplete', 'critical', 'unsupported'" do
- filter = double("fails filter")
- TagFilter.should_receive(:new).with(:exclude, *@tags).and_return(filter)
- filter.should_receive(:register)
- @script.run
- end
-
- it "registers an additional exclude tag specified by :ci_xtags" do
- @config[:ci_xtags] = "windows"
- filter = double("fails filter")
- TagFilter.should_receive(:new).with(:exclude, *(@tags + ["windows"])).and_return(filter)
- filter.should_receive(:register)
- @script.run
- end
-
- it "registers additional exclude tags specified by a :ci_xtags array" do
- @config[:ci_xtags] = ["windows", "windoze"]
- filter = double("fails filter")
- TagFilter.should_receive(:new).with(:exclude,
- *(@tags + ["windows", "windoze"])).and_return(filter)
- filter.should_receive(:register)
- @script.run
- end
-
- it "processes the files" do
- MSpec.should_receive(:process)
- @script.run
- end
-
- it "exits with the exit code registered with MSpec" do
- MSpec.stub(:exit_code).and_return(7)
- @script.should_receive(:exit).with(7)
- @script.run
- end
-end
diff --git a/spec/mspec/spec/commands/mspec_run_spec.rb b/spec/mspec/spec/commands/mspec_run_spec.rb
deleted file mode 100644
index fcb44ad5a9..0000000000
--- a/spec/mspec/spec/commands/mspec_run_spec.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-require 'spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/commands/mspec-run'
-
-one_spec = File.expand_path(File.dirname(__FILE__)) + '/fixtures/one_spec.rb'
-two_spec = File.expand_path(File.dirname(__FILE__)) + '/fixtures/two_spec.rb'
-
-describe MSpecRun, ".new" do
- before :each do
- @script = MSpecRun.new
- end
-
- it "sets config[:files] to an empty list" do
- @script.config[:files].should == []
- end
-end
-
-describe MSpecRun, "#options" do
- before :each do
- @argv = [one_spec, two_spec]
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
-
- @script = MSpecRun.new
- @script.stub(:config).and_return(@config)
- end
-
- it "enables the filter options" do
- @options.should_receive(:filters)
- @script.options @argv
- end
-
- it "enables the chdir option" do
- @options.should_receive(:chdir)
- @script.options @argv
- end
-
- it "enables the prefix option" do
- @options.should_receive(:prefix)
- @script.options @argv
- end
-
- it "enables the configure option" do
- @options.should_receive(:configure)
- @script.options @argv
- end
-
- it "provides a custom action (block) to the config option" do
- @script.should_receive(:load).with("cfg.mspec")
- @script.options ["-B", "cfg.mspec", one_spec]
- end
-
- it "enables the randomize option to runs specs in random order" do
- @options.should_receive(:randomize)
- @script.options @argv
- end
-
- it "enables the dry run option" do
- @options.should_receive(:pretend)
- @script.options @argv
- end
-
- it "enables the unguarded option" do
- @options.should_receive(:unguarded)
- @script.options @argv
- end
-
- it "enables the interrupt single specs option" do
- @options.should_receive(:interrupt)
- @script.options @argv
- end
-
- it "enables the formatter options" do
- @options.should_receive(:formatters)
- @script.options @argv
- end
-
- it "enables the verbose option" do
- @options.should_receive(:verbose)
- @script.options @argv
- end
-
- it "enables the verify options" do
- @options.should_receive(:verify)
- @script.options @argv
- end
-
- it "enables the action options" do
- @options.should_receive(:actions)
- @script.options @argv
- end
-
- it "enables the action filter options" do
- @options.should_receive(:action_filters)
- @script.options @argv
- end
-
- it "enables the version option" do
- @options.should_receive(:version)
- @script.options @argv
- end
-
- it "enables the help option" do
- @options.should_receive(:help)
- @script.options @argv
- end
-
- it "exits if there are no files to process and './spec' is not a directory" do
- File.should_receive(:directory?).with("./spec").and_return(false)
- @options.should_receive(:parse).and_return([])
- @script.should_receive(:abort).with("No files specified.")
- @script.options
- end
-
- it "process 'spec/' if it is a directory and no files were specified" do
- File.should_receive(:directory?).with("./spec").and_return(true)
- @options.should_receive(:parse).and_return([])
- @script.should_receive(:files).with(["spec/"]).and_return(["spec/a_spec.rb"])
- @script.options
- end
-
- it "calls #custom_options" do
- @script.should_receive(:custom_options).with(@options)
- @script.options @argv
- end
-end
-
-describe MSpecRun, "#run" do
- before :each do
- @script = MSpecRun.new
- @script.stub(:exit)
- @spec_dir = File.expand_path(File.dirname(__FILE__)+"/fixtures")
- @file_patterns = [
- @spec_dir+"/level2",
- @spec_dir+"/one_spec.rb",
- @spec_dir+"/two_spec.rb"]
- @files = [
- @spec_dir+"/level2/three_spec.rb",
- @spec_dir+"/one_spec.rb",
- @spec_dir+"/two_spec.rb"]
- @script.options @file_patterns
- MSpec.stub :process
- end
-
- it "registers the tags patterns" do
- @script.config[:tags_patterns] = [/spec/, "tags"]
- MSpec.should_receive(:register_tags_patterns).with([/spec/, "tags"])
- @script.run
- end
-
- it "registers the files to process" do
- MSpec.should_receive(:register_files).with(@files)
- @script.run
- end
-
- it "uses config[:files] if no files are given on the command line" do
- @script.config[:files] = @file_patterns
- MSpec.should_receive(:register_files).with(@files)
- @script.options []
- @script.run
- end
-
- it "processes the files" do
- MSpec.should_receive(:process)
- @script.run
- end
-
- it "exits with the exit code registered with MSpec" do
- MSpec.stub(:exit_code).and_return(7)
- @script.should_receive(:exit).with(7)
- @script.run
- end
-end
diff --git a/spec/mspec/spec/commands/mspec_spec.rb b/spec/mspec/spec/commands/mspec_spec.rb
deleted file mode 100644
index b01af6b41b..0000000000
--- a/spec/mspec/spec/commands/mspec_spec.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-require 'spec_helper'
-require 'yaml'
-require 'mspec/commands/mspec'
-
-describe MSpecMain, "#options" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
-
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- @script.stub(:load)
- end
-
- it "enables the configure option" do
- @options.should_receive(:configure)
- @script.options
- end
-
- it "provides a custom action (block) to the config option" do
- @script.options ["-B", "config"]
- @config[:options].should include("-B", "config")
- end
-
- it "loads the file specified by the config option" do
- @script.should_receive(:load).with("config")
- @script.options ["-B", "config"]
- end
-
- it "enables the target options" do
- @options.should_receive(:targets)
- @script.options
- end
-
- it "sets config[:options] to all argv entries that are not registered options" do
- @options.on "-X", "--exclude", "ARG", "description"
- @script.options [".", "-G", "fail", "-X", "ARG", "--list", "unstable", "some/file.rb"]
- @config[:options].should == [".", "-G", "fail", "--list", "unstable", "some/file.rb"]
- end
-
- it "calls #custom_options" do
- @script.should_receive(:custom_options).with(@options)
- @script.options
- end
-end
-
-describe MSpecMain, "#run" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- @script.stub(:exec)
- @err = $stderr
- $stderr = IOStub.new
- end
-
- after :each do
- $stderr = @err
- end
-
- it "uses exec to invoke the runner script" do
- @script.should_receive(:exec).with("ruby", "#{MSPEC_HOME}/bin/mspec-run", close_others: false)
- @script.options []
- @script.run
- end
-
- it "shows the command line on stderr" do
- @script.should_receive(:exec).with("ruby", "#{MSPEC_HOME}/bin/mspec-run", close_others: false)
- @script.options []
- @script.run
- $stderr.to_s.should == "$ ruby #{Dir.pwd}/bin/mspec-run\n"
- end
-
- it "adds config[:launch] to the exec options" do
- @script.should_receive(:exec).with("ruby",
- "-Xlaunch.option", "#{MSPEC_HOME}/bin/mspec-run", close_others: false)
- @config[:launch] << "-Xlaunch.option"
- @script.options []
- @script.run
- $stderr.to_s.should == "$ ruby -Xlaunch.option #{Dir.pwd}/bin/mspec-run\n"
- end
-
- it "calls #multi_exec if the command is 'ci' and the multi option is passed" do
- @script.should_receive(:multi_exec).and_return do |argv|
- argv.should == ["ruby", "#{MSPEC_HOME}/bin/mspec-ci"]
- end
- @script.options ["ci", "-j"]
- lambda do
- @script.run
- end.should raise_error(SystemExit)
- end
-end
-
-describe "The --warnings option" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("--warnings", an_instance_of(String))
- @script.options
- end
-
- it "sets flags to -w" do
- @config[:flags] = []
- @script.options ["--warnings"]
- @config[:flags].should include("-w")
- end
-
- it "set OUTPUT_WARNINGS = '1' in the environment" do
- ENV['OUTPUT_WARNINGS'] = '0'
- @script.options ["--warnings"]
- ENV['OUTPUT_WARNINGS'].should == '1'
- end
-end
-
-describe "The -j, --multi option" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-j", "--multi", an_instance_of(String))
- @script.options
- end
-
- it "sets the multiple process option" do
- ["-j", "--multi"].each do |opt|
- @config[:multi] = nil
- @script.options [opt]
- @config[:multi].should == true
- end
- end
-end
-
-describe "The -h, --help option" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-h", "--help", an_instance_of(String))
- @script.options
- end
-
- it "passes the option to the subscript" do
- ["-h", "--help"].each do |opt|
- @config[:options] = []
- @script.options ["ci", opt]
- @config[:options].sort.should == ["-h"]
- end
- end
-
- it "prints help and exits" do
- @script.should_receive(:puts).twice
- @script.should_receive(:exit).twice
- ["-h", "--help"].each do |opt|
- @script.options [opt]
- end
- end
-end
-
-describe "The -v, --version option" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecMain.new
- @script.stub(:config).and_return(@config)
- end
-
- it "is enabled by #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-v", "--version", an_instance_of(String))
- @script.options
- end
-
- it "passes the option to the subscripts" do
- ["-v", "--version"].each do |opt|
- @config[:options] = []
- @script.options ["ci", opt]
- @config[:options].sort.should == ["-v"]
- end
- end
-
- it "prints the version and exits if no subscript is invoked" do
- @config[:command] = nil
- File.stub(:basename).and_return("mspec")
- @script.should_receive(:puts).twice.with("mspec #{MSpec::VERSION}")
- @script.should_receive(:exit).twice
- ["-v", "--version"].each do |opt|
- @script.options [opt]
- end
- end
-end
diff --git a/spec/mspec/spec/commands/mspec_tag_spec.rb b/spec/mspec/spec/commands/mspec_tag_spec.rb
deleted file mode 100644
index cdb3ac1a60..0000000000
--- a/spec/mspec/spec/commands/mspec_tag_spec.rb
+++ /dev/null
@@ -1,414 +0,0 @@
-require 'spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/commands/mspec-tag'
-require 'mspec/runner/actions/tag'
-require 'mspec/runner/actions/taglist'
-require 'mspec/runner/actions/tagpurge'
-
-one_spec = File.expand_path(File.dirname(__FILE__)) + '/fixtures/one_spec.rb'
-two_spec = File.expand_path(File.dirname(__FILE__)) + '/fixtures/two_spec.rb'
-
-describe MSpecTag, ".new" do
- before :each do
- @script = MSpecTag.new
- end
-
- it "sets config[:ltags] to an empty list" do
- @script.config[:ltags].should == []
- end
-
- it "sets config[:tagger] to :add" do
- @script.config[:tagger] = :add
- end
-
- it "sets config[:tag] to 'fails:'" do
- @script.config[:tag] = 'fails:'
- end
-
- it "sets config[:outcome] to :fail" do
- @script.config[:outcome] = :fail
- end
-end
-
-describe MSpecTag, "#options" do
- before :each do
- @stdout, $stdout = $stdout, IOStub.new
-
- @argv = [one_spec, two_spec]
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
-
- @script = MSpecTag.new
- @script.stub(:config).and_return(@config)
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "enables the filter options" do
- @options.should_receive(:filters)
- @script.options @argv
- end
-
- it "enables the configure option" do
- @options.should_receive(:configure)
- @script.options @argv
- end
-
- it "provides a custom action (block) to the config option" do
- @script.should_receive(:load).with("cfg.mspec")
- @script.options ["-B", "cfg.mspec", one_spec]
- end
-
- it "enables the dry run option" do
- @options.should_receive(:pretend)
- @script.options @argv
- end
-
- it "enables the unguarded option" do
- @options.should_receive(:unguarded)
- @script.options @argv
- end
-
- it "enables the interrupt single specs option" do
- @options.should_receive(:interrupt)
- @script.options @argv
- end
-
- it "enables the formatter options" do
- @options.should_receive(:formatters)
- @script.options @argv
- end
-
- it "enables the verbose option" do
- @options.should_receive(:verbose)
- @script.options @argv
- end
-
- it "enables the version option" do
- @options.should_receive(:version)
- @script.options @argv
- end
-
- it "enables the help option" do
- @options.should_receive(:help)
- @script.options @argv
- end
-
- it "calls #custom_options" do
- @script.should_receive(:custom_options).with(@options)
- @script.options @argv
- end
-
- it "exits if there are no files to process" do
- @options.should_receive(:parse).and_return([])
- @script.should_receive(:exit)
- @script.options
- $stdout.should include "No files specified"
- end
-end
-
-describe MSpecTag, "options" do
- before :each do
- @options, @config = new_option
- MSpecOptions.stub(:new).and_return(@options)
- @script = MSpecTag.new
- @script.stub(:config).and_return(@config)
- end
-
- describe "-N, --add TAG" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-N", "--add", "TAG", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the mode to :add and sets the tag to TAG" do
- ["-N", "--add"].each do |opt|
- @config[:tagger] = nil
- @config[:tag] = nil
- @script.options [opt, "taggit", one_spec]
- @config[:tagger].should == :add
- @config[:tag].should == "taggit:"
- end
- end
- end
-
- describe "-R, --del TAG" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-R", "--del", "TAG",
- an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "it sets the mode to :del, the tag to TAG, and the outcome to :pass" do
- ["-R", "--del"].each do |opt|
- @config[:tagger] = nil
- @config[:tag] = nil
- @config[:outcome] = nil
- @script.options [opt, "taggit", one_spec]
- @config[:tagger].should == :del
- @config[:tag].should == "taggit:"
- @config[:outcome].should == :pass
- end
- end
- end
-
- describe "-Q, --pass" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-Q", "--pass", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the outcome to :pass" do
- ["-Q", "--pass"].each do |opt|
- @config[:outcome] = nil
- @script.options [opt, one_spec]
- @config[:outcome].should == :pass
- end
- end
- end
-
- describe "-F, --fail" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-F", "--fail", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the outcome to :fail" do
- ["-F", "--fail"].each do |opt|
- @config[:outcome] = nil
- @script.options [opt, one_spec]
- @config[:outcome].should == :fail
- end
- end
- end
-
- describe "-L, --all" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("-L", "--all", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the outcome to :all" do
- ["-L", "--all"].each do |opt|
- @config[:outcome] = nil
- @script.options [opt, one_spec]
- @config[:outcome].should == :all
- end
- end
- end
-
- describe "--list TAG" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("--list", "TAG", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the mode to :list" do
- @config[:tagger] = nil
- @script.options ["--list", "TAG", one_spec]
- @config[:tagger].should == :list
- end
-
- it "sets ltags to include TAG" do
- @config[:tag] = nil
- @script.options ["--list", "TAG", one_spec]
- @config[:ltags].should == ["TAG"]
- end
- end
-
- describe "--list-all" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("--list-all", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the mode to :list_all" do
- @config[:tagger] = nil
- @script.options ["--list-all", one_spec]
- @config[:tagger].should == :list_all
- end
- end
-
- describe "--purge" do
- it "is enabled with #options" do
- @options.stub(:on)
- @options.should_receive(:on).with("--purge", an_instance_of(String))
- @script.options [one_spec]
- end
-
- it "sets the mode to :purge" do
- @config[:tagger] = nil
- @script.options ["--purge", one_spec]
- @config[:tagger].should == :purge
- end
- end
-end
-
-describe MSpecTag, "#run" do
- before :each do
- MSpec.stub(:process)
-
- options = double("MSpecOptions").as_null_object
- options.stub(:parse).and_return(["one", "two"])
- MSpecOptions.stub(:new).and_return(options)
-
- @config = { }
- @script = MSpecTag.new
- @script.stub(:exit)
- @script.stub(:config).and_return(@config)
- @script.stub(:files).and_return(["one", "two"])
- @script.options
- end
-
- it "registers the tags patterns" do
- @config[:tags_patterns] = [/spec/, "tags"]
- MSpec.should_receive(:register_tags_patterns).with([/spec/, "tags"])
- @script.run
- end
-
- it "registers the files to process" do
- MSpec.should_receive(:register_files).with(["one", "two"])
- @script.run
- end
-
- it "processes the files" do
- MSpec.should_receive(:process)
- @script.run
- end
-
- it "exits with the exit code registered with MSpec" do
- MSpec.stub(:exit_code).and_return(7)
- @script.should_receive(:exit).with(7)
- @script.run
- end
-end
-
-describe MSpecTag, "#register" do
- before :each do
- @script = MSpecTag.new
- @config = @script.config
- @config[:tag] = "fake:"
- @config[:atags] = []
- @config[:astrings] = []
- @config[:ltags] = ["fails", "unstable"]
-
- @script.stub(:files).and_return([])
- @script.options "fake"
-
- @t = double("TagAction")
- @t.stub(:register)
-
- @tl = double("TagListAction")
- @tl.stub(:register)
- end
-
- it "raises an ArgumentError if no recognized action is given" do
- @config[:tagger] = :totally_whack
- lambda { @script.register }.should raise_error(ArgumentError)
- end
-
- describe "when config[:tagger] is the default (:add)" do
- before :each do
- @config[:formatter] = false
- end
-
- it "creates a TagAction" do
- TagAction.should_receive(:new).and_return(@t)
- @script.register
- end
-
- it "creates a TagAction if config[:tagger] is :del" do
- @config[:tagger] = :del
- @config[:outcome] = :pass
- TagAction.should_receive(:new).with(:del, :pass, "fake", nil, [], []).and_return(@t)
- @script.register
- end
-
- it "calls #register on the TagAction instance" do
- TagAction.should_receive(:new).and_return(@t)
- @t.should_receive(:register)
- @script.register
- end
- end
-
- describe "when config[:tagger] is :list" do
- before :each do
- TagListAction.should_receive(:new).with(@config[:ltags]).and_return(@tl)
- @config[:tagger] = :list
- end
-
- it "creates a TagListAction" do
- @tl.should_receive(:register)
- @script.register
- end
-
- it "registers MSpec pretend mode" do
- MSpec.should_receive(:register_mode).with(:pretend)
- @script.register
- end
-
- it "sets config[:formatter] to false" do
- @script.register
- @config[:formatter].should be_false
- end
- end
-
- describe "when config[:tagger] is :list_all" do
- before :each do
- TagListAction.should_receive(:new).with(nil).and_return(@tl)
- @config[:tagger] = :list_all
- end
-
- it "creates a TagListAction" do
- @tl.should_receive(:register)
- @script.register
- end
-
- it "registers MSpec pretend mode" do
- MSpec.should_receive(:register_mode).with(:pretend)
- @script.register
- end
-
- it "sets config[:formatter] to false" do
- @script.register
- @config[:formatter].should be_false
- end
- end
-
- describe "when config[:tagger] is :purge" do
- before :each do
- TagPurgeAction.should_receive(:new).and_return(@tl)
- MSpec.stub(:register_mode)
- @config[:tagger] = :purge
- end
-
- it "creates a TagPurgeAction" do
- @tl.should_receive(:register)
- @script.register
- end
-
- it "registers MSpec in pretend mode" do
- MSpec.should_receive(:register_mode).with(:pretend)
- @script.register
- end
-
- it "registers MSpec in unguarded mode" do
- MSpec.should_receive(:register_mode).with(:unguarded)
- @script.register
- end
-
- it "sets config[:formatter] to false" do
- @script.register
- @config[:formatter].should be_false
- end
- end
-end
diff --git a/spec/mspec/spec/expectations/expectations_spec.rb b/spec/mspec/spec/expectations/expectations_spec.rb
deleted file mode 100644
index fea692f3e3..0000000000
--- a/spec/mspec/spec/expectations/expectations_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-
-describe SpecExpectationNotMetError do
- it "is a subclass of StandardError" do
- SpecExpectationNotMetError.ancestors.should include(StandardError)
- end
-end
-
-describe SpecExpectationNotFoundError do
- it "is a subclass of StandardError" do
- SpecExpectationNotFoundError.ancestors.should include(StandardError)
- end
-end
-
-describe SpecExpectationNotFoundError, "#message" do
- it "returns 'No behavior expectation was found in the example'" do
- m = SpecExpectationNotFoundError.new.message
- m.should == "No behavior expectation was found in the example"
- end
-end
-
-describe SpecExpectation, "#fail_with" do
- it "raises an SpecExpectationNotMetError" do
- lambda {
- SpecExpectation.fail_with "expected this", "to equal that"
- }.should raise_error(SpecExpectationNotMetError, "expected this to equal that")
- end
-end
diff --git a/spec/mspec/spec/expectations/should.rb b/spec/mspec/spec/expectations/should.rb
deleted file mode 100644
index 24b1cf2bf8..0000000000
--- a/spec/mspec/spec/expectations/should.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-$: << File.dirname(__FILE__) + '/../../lib'
-require 'mspec'
-require 'mspec/utils/script'
-
-# The purpose of these specs is to confirm that the #should
-# and #should_not methods are functioning appropriately. We
-# use a separate spec file that is invoked from the MSpec
-# specs but is run by MSpec. This avoids conflicting with
-# RSpec's #should and #should_not methods.
-
-class ShouldSpecsMonitor
- def initialize
- @called = 0
- end
-
- def expectation(state)
- @called += 1
- end
-
- def finish
- puts "I was called #{@called} times"
- end
-end
-
-# Simplistic runner
-formatter = DottedFormatter.new
-formatter.register
-
-monitor = ShouldSpecsMonitor.new
-MSpec.register :expectation, monitor
-MSpec.register :finish, monitor
-
-at_exit { MSpec.actions :finish }
-
-MSpec.actions :start
-MSpec.setup_env
-
-# Specs
-describe "MSpec expectation method #should" do
- it "accepts a matcher" do
- :sym.should be_kind_of(Symbol)
- end
-
- it "causes a failue to be recorded" do
- 1.should == 2
- end
-
- it "registers that an expectation has been encountered" do
- # an empty example block causes an exception because
- # no expectation was encountered
- end
-
- it "invokes the MSpec :expectation actions" do
- 1.should == 1
- end
-end
-
-describe "MSpec expectation method #should_not" do
- it "accepts a matcher" do
- "sym".should_not be_kind_of(Symbol)
- end
-
- it "causes a failure to be recorded" do
- 1.should_not == 1
- end
-
- it "registers that an expectation has been encountered" do
- end
-
- it "invokes the MSpec :expectation actions" do
- 1.should_not == 2
- end
-end
diff --git a/spec/mspec/spec/expectations/should_spec.rb b/spec/mspec/spec/expectations/should_spec.rb
deleted file mode 100644
index 3258caf13c..0000000000
--- a/spec/mspec/spec/expectations/should_spec.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-require 'spec_helper'
-require 'rbconfig'
-
-describe "MSpec" do
- before :all do
- path = RbConfig::CONFIG['bindir']
- exe = RbConfig::CONFIG['ruby_install_name']
- file = File.dirname(__FILE__) + '/should.rb'
- @out = `#{path}/#{exe} #{file}`
- end
-
- describe "#should" do
- it "records failures" do
- @out.should include <<-EOS
-1)
-MSpec expectation method #should causes a failue to be recorded FAILED
-Expected 1
- to equal 2
-EOS
- end
-
- it "raises exceptions for examples with no expectations" do
- @out.should include <<-EOS
-2)
-MSpec expectation method #should registers that an expectation has been encountered FAILED
-No behavior expectation was found in the example
-EOS
- end
- end
-
- describe "#should_not" do
- it "records failures" do
- @out.should include <<-EOS
-3)
-MSpec expectation method #should_not causes a failure to be recorded FAILED
-Expected 1
- not to equal 1
-EOS
- end
-
- it "raises exceptions for examples with no expectations" do
- @out.should include <<-EOS
-4)
-MSpec expectation method #should_not registers that an expectation has been encountered FAILED
-No behavior expectation was found in the example
-EOS
- end
- end
-
- it "prints status information" do
- @out.should include ".FF..FF."
- end
-
- it "prints out a summary" do
- @out.should include "0 files, 8 examples, 6 expectations, 4 failures, 0 errors"
- end
-
- it "records expectations" do
- @out.should include "I was called 6 times"
- end
-end
diff --git a/spec/mspec/spec/fixtures/a_spec.rb b/spec/mspec/spec/fixtures/a_spec.rb
deleted file mode 100644
index 17a7e8b664..0000000000
--- a/spec/mspec/spec/fixtures/a_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-unless defined?(RSpec)
- describe "Foo#bar" do
- it "passes" do
- 1.should == 1
- end
-
- it "errors" do
- 1.should == 2
- end
-
- it "fails" do
- raise "failure"
- end
- end
-end
diff --git a/spec/mspec/spec/fixtures/b_spec.rb b/spec/mspec/spec/fixtures/b_spec.rb
deleted file mode 100644
index f1f63317cb..0000000000
--- a/spec/mspec/spec/fixtures/b_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-unless defined?(RSpec)
- describe "Bar#baz" do
- it "works" do
- 1.should == 1
- end
- end
-end
diff --git a/spec/mspec/spec/fixtures/config.mspec b/spec/mspec/spec/fixtures/config.mspec
deleted file mode 100644
index 4a069e2eb0..0000000000
--- a/spec/mspec/spec/fixtures/config.mspec
+++ /dev/null
@@ -1,10 +0,0 @@
-class MSpecScript
- set :target, 'ruby'
-
- set :backtrace_filter, /lib\/mspec\//
-
- set :tags_patterns, [
- [%r(spec/fixtures/), 'spec/fixtures/tags/'],
- [/_spec.rb$/, '_tags.txt']
- ]
-end
diff --git a/spec/mspec/spec/fixtures/my_ruby b/spec/mspec/spec/fixtures/my_ruby
deleted file mode 100755
index 4d552f27fb..0000000000
--- a/spec/mspec/spec/fixtures/my_ruby
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-
-echo $RUBY_EXE
-ruby "$@"
diff --git a/spec/mspec/spec/fixtures/object_methods_spec.rb b/spec/mspec/spec/fixtures/object_methods_spec.rb
deleted file mode 100644
index 9b7c1523e5..0000000000
--- a/spec/mspec/spec/fixtures/object_methods_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-unless defined?(RSpec)
- describe "Object" do
- it ".public_instance_methods(false) is empty" do
- Object.public_instance_methods(false).sort.should ==
- [:should, :should_not, :should_not_receive, :should_receive, :stub!]
- end
- end
-end
diff --git a/spec/mspec/spec/fixtures/print_interpreter_spec.rb b/spec/mspec/spec/fixtures/print_interpreter_spec.rb
deleted file mode 100644
index a662346d0a..0000000000
--- a/spec/mspec/spec/fixtures/print_interpreter_spec.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-unless defined?(RSpec)
- puts ENV["RUBY_EXE"]
- puts ruby_cmd(nil).split.first
-end
diff --git a/spec/mspec/spec/fixtures/tagging_spec.rb b/spec/mspec/spec/fixtures/tagging_spec.rb
deleted file mode 100644
index 0097fd1808..0000000000
--- a/spec/mspec/spec/fixtures/tagging_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# encoding: utf-8
-unless defined?(RSpec)
- describe "Tag#me" do
- it "passes" do
- 1.should == 1
- end
-
- it "errors" do
- 1.should == 2
- end
-
- it "érròrs in unicode" do
- 1.should == 2
- end
- end
-end
diff --git a/spec/mspec/spec/guards/block_device_spec.rb b/spec/mspec/spec/guards/block_device_spec.rb
deleted file mode 100644
index 3b437b6d74..0000000000
--- a/spec/mspec/spec/guards/block_device_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#with_block_device" do
- before :each do
- ScratchPad.clear
-
- @guard = BlockDeviceGuard.new
- BlockDeviceGuard.stub(:new).and_return(@guard)
- end
-
- platform_is_not :freebsd, :windows do
- it "yields if block device is available" do
- @guard.should_receive(:`).and_return("block devices")
- with_block_device { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield if block device is not available" do
- @guard.should_receive(:`).and_return(nil)
- with_block_device { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
- end
-
- platform_is :freebsd, :windows do
- it "does not yield, since platform does not support block devices" do
- @guard.should_not_receive(:`)
- with_block_device { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
- end
-
- it "sets the name of the guard to :with_block_device" do
- with_block_device { }
- @guard.name.should == :with_block_device
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(true)
- @guard.should_receive(:unregister)
- lambda do
- with_block_device { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/bug_spec.rb b/spec/mspec/spec/guards/bug_spec.rb
deleted file mode 100644
index c8529a49f7..0000000000
--- a/spec/mspec/spec/guards/bug_spec.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe BugGuard, "#match? when #implementation? is 'ruby'" do
- before :all do
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- after :all do
- $VERBOSE = @verbose
- end
-
- before :each do
- hide_deprecation_warnings
- stub_const "VersionGuard::FULL_RUBY_VERSION", SpecVersion.new('1.8.6')
- @ruby_engine = Object.const_get :RUBY_ENGINE
- Object.const_set :RUBY_ENGINE, 'ruby'
- end
-
- after :each do
- Object.const_set :RUBY_ENGINE, @ruby_engine
- end
-
- it "returns false when version argument is less than RUBY_VERSION" do
- BugGuard.new("#1", "1.8.5").match?.should == false
- end
-
- it "returns true when version argument is equal to RUBY_VERSION" do
- BugGuard.new("#1", "1.8.6").match?.should == true
- end
-
- it "returns true when version argument is greater than RUBY_VERSION" do
- BugGuard.new("#1", "1.8.7").match?.should == true
- end
-
- it "returns true when version argument implicitly includes RUBY_VERSION" do
- BugGuard.new("#1", "1.8").match?.should == true
- BugGuard.new("#1", "1.8.6").match?.should == true
- end
-
- it "returns true when the argument range includes RUBY_VERSION" do
- BugGuard.new("#1", '1.8.5'..'1.8.7').match?.should == true
- BugGuard.new("#1", '1.8'..'1.9').match?.should == true
- BugGuard.new("#1", '1.8'...'1.9').match?.should == true
- BugGuard.new("#1", '1.8'..'1.8.6').match?.should == true
- BugGuard.new("#1", '1.8.5'..'1.8.6').match?.should == true
- BugGuard.new("#1", ''...'1.8.7').match?.should == true
- end
-
- it "returns false when the argument range does not include RUBY_VERSION" do
- BugGuard.new("#1", '1.8.7'..'1.8.9').match?.should == false
- BugGuard.new("#1", '1.8.4'..'1.8.5').match?.should == false
- BugGuard.new("#1", '1.8.4'...'1.8.6').match?.should == false
- BugGuard.new("#1", '1.8.5'...'1.8.6').match?.should == false
- BugGuard.new("#1", ''...'1.8.6').match?.should == false
- end
-
- it "returns false when MSpec.mode?(:no_ruby_bug) is true" do
- MSpec.should_receive(:mode?).with(:no_ruby_bug).twice.and_return(:true)
- BugGuard.new("#1", "1.8.5").match?.should == false
- BugGuard.new("#1", "1.8").match?.should == false
- end
-end
-
-describe BugGuard, "#match? when #implementation? is not 'ruby'" do
- before :all do
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- after :all do
- $VERBOSE = @verbose
- end
-
- before :each do
- hide_deprecation_warnings
- @ruby_version = Object.const_get :RUBY_VERSION
- @ruby_engine = Object.const_get :RUBY_ENGINE
-
- Object.const_set :RUBY_VERSION, '1.8.6'
- Object.const_set :RUBY_ENGINE, 'jruby'
- end
-
- after :each do
- Object.const_set :RUBY_VERSION, @ruby_version
- Object.const_set :RUBY_ENGINE, @ruby_engine
- end
-
- it "returns false when version argument is less than RUBY_VERSION" do
- BugGuard.new("#1", "1.8").match?.should == false
- BugGuard.new("#1", "1.8.6").match?.should == false
- end
-
- it "returns false when version argument is equal to RUBY_VERSION" do
- BugGuard.new("#1", "1.8.6").match?.should == false
- end
-
- it "returns false when version argument is greater than RUBY_VERSION" do
- BugGuard.new("#1", "1.8.7").match?.should == false
- end
-
- it "returns false no matter if the argument range includes RUBY_VERSION" do
- BugGuard.new("#1", '1.8'...'1.9').match?.should == false
- BugGuard.new("#1", '1.8.5'...'1.8.7').match?.should == false
- BugGuard.new("#1", '1.8.4'...'1.8.6').match?.should == false
- end
-
- it "returns false when MSpec.mode?(:no_ruby_bug) is true" do
- MSpec.stub(:mode?).and_return(:true)
- BugGuard.new("#1", "1.8.6").match?.should == false
- end
-end
-
-describe Object, "#ruby_bug" do
- before :each do
- hide_deprecation_warnings
- @guard = BugGuard.new "#1234", "x.x.x"
- BugGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields when #match? returns false" do
- @guard.stub(:match?).and_return(false)
- ruby_bug("#1234", "1.8.6") { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield when #match? returns true" do
- @guard.stub(:match?).and_return(true)
- ruby_bug("#1234", "1.8.6") { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "requires a bug tracker number and a version number" do
- lambda { ruby_bug { } }.should raise_error(ArgumentError)
- lambda { ruby_bug("#1234") { } }.should raise_error(ArgumentError)
- end
-
- it "sets the name of the guard to :ruby_bug" do
- ruby_bug("#1234", "1.8.6") { }
- @guard.name.should == :ruby_bug
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:unregister)
- lambda do
- ruby_bug("", "") { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/conflict_spec.rb b/spec/mspec/spec/guards/conflict_spec.rb
deleted file mode 100644
index e06a2809ee..0000000000
--- a/spec/mspec/spec/guards/conflict_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#conflicts_with" do
- before :each do
- ScratchPad.clear
- end
-
- it "does not yield if Object.constants includes any of the arguments" do
- Object.stub(:constants).and_return(["SomeClass", "OtherClass"])
- conflicts_with(:SomeClass, :AClass, :BClass) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "does not yield if Object.constants (as Symbols) includes any of the arguments" do
- Object.stub(:constants).and_return([:SomeClass, :OtherClass])
- conflicts_with(:SomeClass, :AClass, :BClass) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "yields if Object.constants does not include any of the arguments" do
- Object.stub(:constants).and_return(["SomeClass", "OtherClass"])
- conflicts_with(:AClass, :BClass) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "yields if Object.constants (as Symbols) does not include any of the arguments" do
- Object.stub(:constants).and_return([:SomeClass, :OtherClass])
- conflicts_with(:AClass, :BClass) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-end
-
-describe Object, "#conflicts_with" do
- before :each do
- @guard = ConflictsGuard.new
- ConflictsGuard.stub(:new).and_return(@guard)
- end
-
- it "sets the name of the guard to :conflicts_with" do
- conflicts_with(:AClass, :BClass) { }
- @guard.name.should == :conflicts_with
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:unregister)
- lambda do
- conflicts_with(:AClass, :BClass) { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/endian_spec.rb b/spec/mspec/spec/guards/endian_spec.rb
deleted file mode 100644
index 5b40c203ab..0000000000
--- a/spec/mspec/spec/guards/endian_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#big_endian" do
- before :each do
- @guard = BigEndianGuard.new
- BigEndianGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields on big-endian platforms" do
- @guard.stub(:pattern).and_return([?\001])
- big_endian { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield on little-endian platforms" do
- @guard.stub(:pattern).and_return([?\000])
- big_endian { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "sets the name of the guard to :big_endian" do
- big_endian { }
- @guard.name.should == :big_endian
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.stub(:pattern).and_return([?\001])
- @guard.should_receive(:unregister)
- lambda do
- big_endian { raise Exception }
- end.should raise_error(Exception)
- end
-end
-
-describe Object, "#little_endian" do
- before :each do
- @guard = BigEndianGuard.new
- BigEndianGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields on little-endian platforms" do
- @guard.stub(:pattern).and_return([?\000])
- little_endian { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield on big-endian platforms" do
- @guard.stub(:pattern).and_return([?\001])
- little_endian { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-end
diff --git a/spec/mspec/spec/guards/feature_spec.rb b/spec/mspec/spec/guards/feature_spec.rb
deleted file mode 100644
index d14e5f8e67..0000000000
--- a/spec/mspec/spec/guards/feature_spec.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe FeatureGuard, ".enabled?" do
- it "returns true if the feature is enabled" do
- MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(true)
- FeatureGuard.enabled?(:encoding).should be_true
- end
-
- it "returns false if the feature is not enabled" do
- MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(false)
- FeatureGuard.enabled?(:encoding).should be_false
- end
-
- it "returns true if all the features are enabled" do
- MSpec.should_receive(:feature_enabled?).with(:one).and_return(true)
- MSpec.should_receive(:feature_enabled?).with(:two).and_return(true)
- FeatureGuard.enabled?(:one, :two).should be_true
- end
-
- it "returns false if any of the features are not enabled" do
- MSpec.should_receive(:feature_enabled?).with(:one).and_return(true)
- MSpec.should_receive(:feature_enabled?).with(:two).and_return(false)
- FeatureGuard.enabled?(:one, :two).should be_false
- end
-end
-
-describe Object, "#with_feature" do
- before :each do
- ScratchPad.clear
-
- @guard = FeatureGuard.new :encoding
- FeatureGuard.stub(:new).and_return(@guard)
- end
-
- it "sets the name of the guard to :with_feature" do
- with_feature(:encoding) { }
- @guard.name.should == :with_feature
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(true)
- @guard.should_receive(:unregister)
- lambda do
- with_feature { raise Exception }
- end.should raise_error(Exception)
- end
-end
-
-describe Object, "#with_feature" do
- before :each do
- ScratchPad.clear
- end
-
- it "yields if the feature is enabled" do
- MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(true)
- with_feature(:encoding) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "yields if all the features are enabled" do
- MSpec.should_receive(:feature_enabled?).with(:one).and_return(true)
- MSpec.should_receive(:feature_enabled?).with(:two).and_return(true)
- with_feature(:one, :two) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield if the feature is not enabled" do
- MSpec.should_receive(:feature_enabled?).with(:encoding).and_return(false)
- with_feature(:encoding) { ScratchPad.record :yield }
- ScratchPad.recorded.should be_nil
- end
-
- it "does not yield if any of the features are not enabled" do
- MSpec.should_receive(:feature_enabled?).with(:one).and_return(true)
- MSpec.should_receive(:feature_enabled?).with(:two).and_return(false)
- with_feature(:one, :two) { ScratchPad.record :yield }
- ScratchPad.recorded.should be_nil
- end
-end
diff --git a/spec/mspec/spec/guards/guard_spec.rb b/spec/mspec/spec/guards/guard_spec.rb
deleted file mode 100644
index 5c3dae4b3f..0000000000
--- a/spec/mspec/spec/guards/guard_spec.rb
+++ /dev/null
@@ -1,421 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'rbconfig'
-
-describe SpecGuard, ".ruby_version" do
- before :each do
- stub_const "RUBY_VERSION", "8.2.3"
- end
-
- it "returns the full version for :full" do
- SpecGuard.ruby_version(:full).should == "8.2.3"
- end
-
- it "returns major.minor.tiny for :tiny" do
- SpecGuard.ruby_version(:tiny).should == "8.2.3"
- end
-
- it "returns major.minor.tiny for :teeny" do
- SpecGuard.ruby_version(:tiny).should == "8.2.3"
- end
-
- it "returns major.minor for :minor" do
- SpecGuard.ruby_version(:minor).should == "8.2"
- end
-
- it "defaults to :minor" do
- SpecGuard.ruby_version.should == "8.2"
- end
-
- it "returns major for :major" do
- SpecGuard.ruby_version(:major).should == "8"
- end
-end
-
-describe SpecGuard, "#yield?" do
- before :each do
- MSpec.clear_modes
- @guard = SpecGuard.new
- @guard.stub(:match?).and_return(false)
- end
-
- after :each do
- MSpec.unregister :add, @guard
- MSpec.clear_modes
- SpecGuard.clear_guards
- end
-
- it "returns true if MSpec.mode?(:unguarded) is true" do
- MSpec.register_mode :unguarded
- @guard.yield?.should == true
- end
-
- it "returns true if MSpec.mode?(:verify) is true" do
- MSpec.register_mode :verify
- @guard.yield?.should == true
- end
-
- it "returns true if MSpec.mode?(:verify) is true regardless of invert being true" do
- MSpec.register_mode :verify
- @guard.yield?(true).should == true
- end
-
- it "returns true if MSpec.mode?(:report) is true" do
- MSpec.register_mode :report
- @guard.yield?.should == true
- end
-
- it "returns true if MSpec.mode?(:report) is true regardless of invert being true" do
- MSpec.register_mode :report
- @guard.yield?(true).should == true
- end
-
- it "returns true if MSpec.mode?(:report_on) is true and SpecGuards.guards contains the named guard" do
- MSpec.register_mode :report_on
- SpecGuard.guards << :guard_name
- @guard.yield?.should == false
- @guard.name = :guard_name
- @guard.yield?.should == true
- end
-
- it "returns #match? if neither report nor verify mode are true" do
- @guard.stub(:match?).and_return(false)
- @guard.yield?.should == false
- @guard.stub(:match?).and_return(true)
- @guard.yield?.should == true
- end
-
- it "returns #match? if invert is true and neither report nor verify mode are true" do
- @guard.stub(:match?).and_return(false)
- @guard.yield?(true).should == true
- @guard.stub(:match?).and_return(true)
- @guard.yield?(true).should == false
- end
-end
-
-describe SpecGuard, "#match?" do
- before :each do
- @guard = SpecGuard.new
- end
-
- it "must be implemented in subclasses" do
- lambda {
- @guard.match?
- }.should raise_error("must be implemented by the subclass")
- end
-end
-
-describe SpecGuard, "#unregister" do
- before :each do
- MSpec.stub(:unregister)
- @guard = SpecGuard.new
- end
-
- it "unregisters from MSpec :add actions" do
- MSpec.should_receive(:unregister).with(:add, @guard)
- @guard.unregister
- end
-end
-
-describe SpecGuard, "#record" do
- after :each do
- SpecGuard.clear
- end
-
- it "saves the name of the guarded spec under the name of the guard" do
- guard = SpecGuard.new "a", "1.8"..."1.9"
- guard.name = :named_guard
- guard.record "SomeClass#action returns true"
- SpecGuard.report.should == {
- 'named_guard a, 1.8...1.9' => ["SomeClass#action returns true"]
- }
- end
-end
-
-describe SpecGuard, ".guards" do
- it "returns an Array" do
- SpecGuard.guards.should be_kind_of(Array)
- end
-end
-
-describe SpecGuard, ".clear_guards" do
- it "resets the array to empty" do
- SpecGuard.guards << :guard
- SpecGuard.guards.should == [:guard]
- SpecGuard.clear_guards
- SpecGuard.guards.should == []
- end
-end
-
-describe SpecGuard, ".finish" do
- before :each do
- $stdout = @out = IOStub.new
- end
-
- after :each do
- $stdout = STDOUT
- SpecGuard.clear
- end
-
- it "prints the descriptions of the guarded specs" do
- guard = SpecGuard.new "a", "1.8"..."1.9"
- guard.name = :named_guard
- guard.record "SomeClass#action returns true"
- guard.record "SomeClass#reverse returns false"
- SpecGuard.finish
- $stdout.should == %[
-
-2 specs omitted by guard: named_guard a, 1.8...1.9:
-
-SomeClass#action returns true
-SomeClass#reverse returns false
-
-]
- end
-end
-
-describe SpecGuard, ".run_if" do
- before :each do
- @guard = SpecGuard.new
- ScratchPad.clear
- end
-
- it "yields if match? returns true" do
- @guard.stub(:match?).and_return(true)
- @guard.run_if(:name) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield if match? returns false" do
- @guard.stub(:match?).and_return(false)
- @guard.run_if(:name) { fail }
- end
-
- it "returns the result of the block if match? is true" do
- @guard.stub(:match?).and_return(true)
- @guard.run_if(:name) { 42 }.should == 42
- end
-
- it "returns nil if given a block and match? is false" do
- @guard.stub(:match?).and_return(false)
- @guard.run_if(:name) { 42 }.should == nil
- end
-
- it "returns what #match? returns when no block is given" do
- @guard.stub(:match?).and_return(true)
- @guard.run_if(:name).should == true
- @guard.stub(:match?).and_return(false)
- @guard.run_if(:name).should == false
- end
-end
-
-describe SpecGuard, ".run_unless" do
- before :each do
- @guard = SpecGuard.new
- ScratchPad.clear
- end
-
- it "yields if match? returns false" do
- @guard.stub(:match?).and_return(false)
- @guard.run_unless(:name) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield if match? returns true" do
- @guard.stub(:match?).and_return(true)
- @guard.run_unless(:name) { fail }
- end
-
- it "returns the result of the block if match? is false" do
- @guard.stub(:match?).and_return(false)
- @guard.run_unless(:name) { 42 }.should == 42
- end
-
- it "returns nil if given a block and match? is true" do
- @guard.stub(:match?).and_return(true)
- @guard.run_unless(:name) { 42 }.should == nil
- end
-
- it "returns the opposite of what #match? returns when no block is given" do
- @guard.stub(:match?).and_return(true)
- @guard.run_unless(:name).should == false
- @guard.stub(:match?).and_return(false)
- @guard.run_unless(:name).should == true
- end
-end
-
-describe Object, "#guard" do
- before :each do
- ScratchPad.clear
- end
-
- after :each do
- MSpec.clear_modes
- end
-
- it "allows to combine guards" do
- guard1 = VersionGuard.new 'x.x.x'
- VersionGuard.stub(:new).and_return(guard1)
- guard2 = PlatformGuard.new :dummy
- PlatformGuard.stub(:new).and_return(guard2)
-
- guard1.stub(:match?).and_return(true)
- guard2.stub(:match?).and_return(true)
- guard -> { ruby_version_is "2.4" and platform_is :linux } do
- ScratchPad.record :yield
- end
- ScratchPad.recorded.should == :yield
-
- guard1.stub(:match?).and_return(false)
- guard2.stub(:match?).and_return(true)
- guard -> { ruby_version_is "2.4" and platform_is :linux } do
- fail
- end
-
- guard1.stub(:match?).and_return(true)
- guard2.stub(:match?).and_return(false)
- guard -> { ruby_version_is "2.4" and platform_is :linux } do
- fail
- end
-
- guard1.stub(:match?).and_return(false)
- guard2.stub(:match?).and_return(false)
- guard -> { ruby_version_is "2.4" and platform_is :linux } do
- fail
- end
- end
-
- it "yields when the Proc returns true" do
- guard -> { true } do
- ScratchPad.record :yield
- end
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield when the Proc returns false" do
- guard -> { false } do
- fail
- end
- end
-
- it "yields if MSpec.mode?(:unguarded) is true" do
- MSpec.register_mode :unguarded
-
- guard -> { false } do
- ScratchPad.record :yield1
- end
- ScratchPad.recorded.should == :yield1
-
- guard -> { true } do
- ScratchPad.record :yield2
- end
- ScratchPad.recorded.should == :yield2
- end
-
- it "yields if MSpec.mode?(:verify) is true" do
- MSpec.register_mode :verify
-
- guard -> { false } do
- ScratchPad.record :yield1
- end
- ScratchPad.recorded.should == :yield1
-
- guard -> { true } do
- ScratchPad.record :yield2
- end
- ScratchPad.recorded.should == :yield2
- end
-
- it "yields if MSpec.mode?(:report) is true" do
- MSpec.register_mode :report
-
- guard -> { false } do
- ScratchPad.record :yield1
- end
- ScratchPad.recorded.should == :yield1
-
- guard -> { true } do
- ScratchPad.record :yield2
- end
- ScratchPad.recorded.should == :yield2
- end
-
- it "raises an error if no Proc is given" do
- -> { guard :foo }.should raise_error(RuntimeError)
- end
-
- it "requires a block" do
- -> {
- guard(-> { true })
- }.should raise_error(LocalJumpError)
- -> {
- guard(-> { false })
- }.should raise_error(LocalJumpError)
- end
-end
-
-describe Object, "#guard_not" do
- before :each do
- ScratchPad.clear
- end
-
- it "allows to combine guards" do
- guard1 = VersionGuard.new 'x.x.x'
- VersionGuard.stub(:new).and_return(guard1)
- guard2 = PlatformGuard.new :dummy
- PlatformGuard.stub(:new).and_return(guard2)
-
- guard1.stub(:match?).and_return(true)
- guard2.stub(:match?).and_return(true)
- guard_not -> { ruby_version_is "2.4" and platform_is :linux } do
- fail
- end
-
- guard1.stub(:match?).and_return(false)
- guard2.stub(:match?).and_return(true)
- guard_not -> { ruby_version_is "2.4" and platform_is :linux } do
- ScratchPad.record :yield1
- end
- ScratchPad.recorded.should == :yield1
-
- guard1.stub(:match?).and_return(true)
- guard2.stub(:match?).and_return(false)
- guard_not -> { ruby_version_is "2.4" and platform_is :linux } do
- ScratchPad.record :yield2
- end
- ScratchPad.recorded.should == :yield2
-
- guard1.stub(:match?).and_return(false)
- guard2.stub(:match?).and_return(false)
- guard_not -> { ruby_version_is "2.4" and platform_is :linux } do
- ScratchPad.record :yield3
- end
- ScratchPad.recorded.should == :yield3
- end
-
- it "yields when the Proc returns false" do
- guard_not -> { false } do
- ScratchPad.record :yield
- end
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield when the Proc returns true" do
- guard_not -> { true } do
- fail
- end
- end
-
- it "raises an error if no Proc is given" do
- -> { guard_not :foo }.should raise_error(RuntimeError)
- end
-
- it "requires a block" do
- -> {
- guard_not(-> { true })
- }.should raise_error(LocalJumpError)
- -> {
- guard_not(-> { false })
- }.should raise_error(LocalJumpError)
- end
-end
diff --git a/spec/mspec/spec/guards/platform_spec.rb b/spec/mspec/spec/guards/platform_spec.rb
deleted file mode 100644
index 749963d3db..0000000000
--- a/spec/mspec/spec/guards/platform_spec.rb
+++ /dev/null
@@ -1,328 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#platform_is" do
- before :each do
- @guard = PlatformGuard.new :dummy
- PlatformGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "does not yield when #os? returns false" do
- PlatformGuard.stub(:os?).and_return(false)
- platform_is(:ruby) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "yields when #os? returns true" do
- PlatformGuard.stub(:os?).and_return(true)
- platform_is(:solarce) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "returns what #os? returns when no block is given" do
- PlatformGuard.stub(:os?).and_return(true)
- platform_is(:solarce).should == true
- PlatformGuard.stub(:os?).and_return(false)
- platform_is(:solarce).should == false
- end
-
- it "sets the name of the guard to :platform_is" do
- platform_is(:solarce) { }
- @guard.name.should == :platform_is
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(true)
- @guard.should_receive(:unregister)
- lambda do
- platform_is(:solarce) { raise Exception }
- end.should raise_error(Exception)
- end
-end
-
-describe Object, "#platform_is_not" do
- before :each do
- @guard = PlatformGuard.new :dummy
- PlatformGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "does not yield when #os? returns true" do
- PlatformGuard.stub(:os?).and_return(true)
- platform_is_not(:ruby) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "yields when #os? returns false" do
- PlatformGuard.stub(:os?).and_return(false)
- platform_is_not(:solarce) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "returns the opposite of what #os? returns when no block is given" do
- PlatformGuard.stub(:os?).and_return(true)
- platform_is_not(:solarce).should == false
- PlatformGuard.stub(:os?).and_return(false)
- platform_is_not(:solarce).should == true
- end
-
- it "sets the name of the guard to :platform_is_not" do
- platform_is_not(:solarce) { }
- @guard.name.should == :platform_is_not
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(false)
- @guard.should_receive(:unregister)
- lambda do
- platform_is_not(:solarce) { raise Exception }
- end.should raise_error(Exception)
- end
-end
-
-describe Object, "#platform_is :wordsize => SIZE_SPEC" do
- before :each do
- @guard = PlatformGuard.new :darwin, :wordsize => 32
- PlatformGuard.stub(:os?).and_return(true)
- PlatformGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields when #wordsize? returns true" do
- PlatformGuard.stub(:wordsize?).and_return(true)
- platform_is(:wordsize => 32) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "doesn not yield when #wordsize? returns false" do
- PlatformGuard.stub(:wordsize?).and_return(false)
- platform_is(:wordsize => 32) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-end
-
-describe Object, "#platform_is_not :wordsize => SIZE_SPEC" do
- before :each do
- @guard = PlatformGuard.new :darwin, :wordsize => 32
- PlatformGuard.stub(:os?).and_return(true)
- PlatformGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields when #wordsize? returns false" do
- PlatformGuard.stub(:wordsize?).and_return(false)
- platform_is_not(:wordsize => 32) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "doesn not yield when #wordsize? returns true" do
- PlatformGuard.stub(:wordsize?).and_return(true)
- platform_is_not(:wordsize => 32) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-end
-
-describe PlatformGuard, ".implementation?" do
- it "returns true if passed :ruby and RUBY_ENGINE == 'ruby'" do
- stub_const 'RUBY_ENGINE', 'ruby'
- PlatformGuard.implementation?(:ruby).should == true
- end
-
- it "returns true if passed :rubinius and RUBY_ENGINE == 'rbx'" do
- stub_const 'RUBY_ENGINE', 'rbx'
- PlatformGuard.implementation?(:rubinius).should == true
- end
-
- it "returns true if passed :jruby and RUBY_ENGINE == 'jruby'" do
- stub_const 'RUBY_ENGINE', 'jruby'
- PlatformGuard.implementation?(:jruby).should == true
- end
-
- it "returns true if passed :ironruby and RUBY_ENGINE == 'ironruby'" do
- stub_const 'RUBY_ENGINE', 'ironruby'
- PlatformGuard.implementation?(:ironruby).should == true
- end
-
- it "returns true if passed :maglev and RUBY_ENGINE == 'maglev'" do
- stub_const 'RUBY_ENGINE', 'maglev'
- PlatformGuard.implementation?(:maglev).should == true
- end
-
- it "returns true if passed :topaz and RUBY_ENGINE == 'topaz'" do
- stub_const 'RUBY_ENGINE', 'topaz'
- PlatformGuard.implementation?(:topaz).should == true
- end
-
- it "returns true if passed :ruby and RUBY_ENGINE matches /^ruby/" do
- stub_const 'RUBY_ENGINE', 'ruby'
- PlatformGuard.implementation?(:ruby).should == true
-
- stub_const 'RUBY_ENGINE', 'ruby1.8'
- PlatformGuard.implementation?(:ruby).should == true
-
- stub_const 'RUBY_ENGINE', 'ruby1.9'
- PlatformGuard.implementation?(:ruby).should == true
- end
-
- it "raises an error when passed an unrecognized name" do
- stub_const 'RUBY_ENGINE', 'ruby'
- lambda {
- PlatformGuard.implementation?(:python)
- }.should raise_error(/unknown implementation/)
- end
-end
-
-describe PlatformGuard, ".standard?" do
- it "returns true if implementation? returns true" do
- PlatformGuard.should_receive(:implementation?).with(:ruby).and_return(true)
- PlatformGuard.standard?.should be_true
- end
-
- it "returns false if implementation? returns false" do
- PlatformGuard.should_receive(:implementation?).with(:ruby).and_return(false)
- PlatformGuard.standard?.should be_false
- end
-end
-
-describe PlatformGuard, ".wordsize?" do
- it "returns true when arg is 32 and 1.size is 4" do
- PlatformGuard.wordsize?(32).should == (1.size == 4)
- end
-
- it "returns true when arg is 64 and 1.size is 8" do
- PlatformGuard.wordsize?(64).should == (1.size == 8)
- end
-end
-
-describe PlatformGuard, ".os?" do
- before :each do
- stub_const 'PlatformGuard::HOST_OS', 'solarce'
- end
-
- it "returns false when arg does not match the platform" do
- PlatformGuard.os?(:ruby).should == false
- end
-
- it "returns false when no arg matches the platform" do
- PlatformGuard.os?(:ruby, :jruby, :rubinius, :maglev).should == false
- end
-
- it "returns true when arg matches the platform" do
- PlatformGuard.os?(:solarce).should == true
- end
-
- it "returns true when any arg matches the platform" do
- PlatformGuard.os?(:ruby, :jruby, :solarce, :rubinius, :maglev).should == true
- end
-
- it "returns true when arg is :windows and the platform contains 'mswin'" do
- stub_const 'PlatformGuard::HOST_OS', 'mswin32'
- PlatformGuard.os?(:windows).should == true
- end
-
- it "returns true when arg is :windows and the platform contains 'mingw'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.os?(:windows).should == true
- end
-
- it "returns false when arg is not :windows and RbConfig::CONFIG['host_os'] contains 'mswin'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mswin32'
- PlatformGuard.os?(:linux).should == false
- end
-
- it "returns false when arg is not :windows and RbConfig::CONFIG['host_os'] contains 'mingw'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.os?(:linux).should == false
- end
-end
-
-describe PlatformGuard, ".os? on JRuby" do
- before :all do
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- after :all do
- $VERBOSE = @verbose
- end
-
- before :each do
- @ruby_platform = Object.const_get :RUBY_PLATFORM
- Object.const_set :RUBY_PLATFORM, 'java'
- end
-
- after :each do
- Object.const_set :RUBY_PLATFORM, @ruby_platform
- end
-
- it "raises an error when testing for a :java platform" do
- lambda {
- PlatformGuard.os?(:java)
- }.should raise_error(":java is not a valid OS")
- end
-
- it "returns true when arg is :windows and RUBY_PLATFORM contains 'java' and os?(:windows) is true" do
- stub_const 'PlatformGuard::HOST_OS', 'mswin32'
- PlatformGuard.os?(:windows).should == true
- end
-
- it "returns true when RUBY_PLATFORM contains 'java' and os?(argument) is true" do
- stub_const 'PlatformGuard::HOST_OS', 'amiga'
- PlatformGuard.os?(:amiga).should == true
- end
-end
-
-describe PlatformGuard, ".os?" do
- before :each do
- stub_const 'PlatformGuard::HOST_OS', 'unreal'
- end
-
- it "returns true if argument matches RbConfig::CONFIG['host_os']" do
- PlatformGuard.os?(:unreal).should == true
- end
-
- it "returns true if any argument matches RbConfig::CONFIG['host_os']" do
- PlatformGuard.os?(:bsd, :unreal, :amiga).should == true
- end
-
- it "returns false if no argument matches RbConfig::CONFIG['host_os']" do
- PlatformGuard.os?(:bsd, :netbsd, :amiga, :msdos).should == false
- end
-
- it "returns false if argument does not match RbConfig::CONFIG['host_os']" do
- PlatformGuard.os?(:amiga).should == false
- end
-
- it "returns true when arg is :windows and RbConfig::CONFIG['host_os'] contains 'mswin'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mswin32'
- PlatformGuard.os?(:windows).should == true
- end
-
- it "returns true when arg is :windows and RbConfig::CONFIG['host_os'] contains 'mingw'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.os?(:windows).should == true
- end
-
- it "returns false when arg is not :windows and RbConfig::CONFIG['host_os'] contains 'mswin'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.os?(:linux).should == false
- end
-
- it "returns false when arg is not :windows and RbConfig::CONFIG['host_os'] contains 'mingw'" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.os?(:linux).should == false
- end
-end
-
-describe PlatformGuard, ".windows?" do
- it "returns true on windows" do
- stub_const 'PlatformGuard::HOST_OS', 'i386-mingw32'
- PlatformGuard.windows?.should == true
- end
-
- it "returns false on non-windows" do
- stub_const 'PlatformGuard::HOST_OS', 'i586-linux'
- PlatformGuard.windows?.should == false
- end
-end
diff --git a/spec/mspec/spec/guards/quarantine_spec.rb b/spec/mspec/spec/guards/quarantine_spec.rb
deleted file mode 100644
index e5c7da7939..0000000000
--- a/spec/mspec/spec/guards/quarantine_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe QuarantineGuard, "#match?" do
- it "returns true" do
- QuarantineGuard.new.match?.should == true
- end
-end
-
-describe Object, "#quarantine!" do
- before :each do
- ScratchPad.clear
-
- @guard = QuarantineGuard.new
- QuarantineGuard.stub(:new).and_return(@guard)
- end
-
- it "does not yield" do
- quarantine! { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "sets the name of the guard to :quarantine!" do
- quarantine! { }
- @guard.name.should == :quarantine!
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(false)
- @guard.should_receive(:unregister)
- lambda do
- quarantine! { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/superuser_spec.rb b/spec/mspec/spec/guards/superuser_spec.rb
deleted file mode 100644
index f8815057e1..0000000000
--- a/spec/mspec/spec/guards/superuser_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#as_superuser" do
- before :each do
- @guard = SuperUserGuard.new
- SuperUserGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "does not yield when Process.euid is not 0" do
- Process.stub(:euid).and_return(501)
- as_superuser { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "yields when Process.euid is 0" do
- Process.stub(:euid).and_return(0)
- as_superuser { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "sets the name of the guard to :as_superuser" do
- as_superuser { }
- @guard.name.should == :as_superuser
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(true)
- @guard.should_receive(:unregister)
- lambda do
- as_superuser { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/support_spec.rb b/spec/mspec/spec/guards/support_spec.rb
deleted file mode 100644
index 38414abebd..0000000000
--- a/spec/mspec/spec/guards/support_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#not_supported_on" do
- before :each do
- ScratchPad.clear
- end
-
- it "raises an Exception when passed :ruby" do
- stub_const "RUBY_ENGINE", "jruby"
- lambda {
- not_supported_on(:ruby) { ScratchPad.record :yield }
- }.should raise_error(Exception)
- ScratchPad.recorded.should_not == :yield
- end
-
- it "does not yield when #implementation? returns true" do
- stub_const "RUBY_ENGINE", "jruby"
- not_supported_on(:jruby) { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "yields when #standard? returns true" do
- stub_const "RUBY_ENGINE", "ruby"
- not_supported_on(:rubinius) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "yields when #implementation? returns false" do
- stub_const "RUBY_ENGINE", "jruby"
- not_supported_on(:rubinius) { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-end
-
-describe Object, "#not_supported_on" do
- before :each do
- @guard = SupportedGuard.new
- SupportedGuard.stub(:new).and_return(@guard)
- end
-
- it "sets the name of the guard to :not_supported_on" do
- not_supported_on(:rubinius) { }
- @guard.name.should == :not_supported_on
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(false)
- @guard.should_receive(:unregister)
- lambda do
- not_supported_on(:rubinius) { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/guards/user_spec.rb b/spec/mspec/spec/guards/user_spec.rb
deleted file mode 100644
index 2de4db7390..0000000000
--- a/spec/mspec/spec/guards/user_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-describe Object, "#as_user" do
- before :each do
- ScratchPad.clear
- end
-
- it "yields when the Process.euid is not 0" do
- Process.stub(:euid).and_return(501)
- as_user { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield when the Process.euid is 0" do
- Process.stub(:euid).and_return(0)
- as_user { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-end
diff --git a/spec/mspec/spec/guards/version_spec.rb b/spec/mspec/spec/guards/version_spec.rb
deleted file mode 100644
index 07eb451ec9..0000000000
--- a/spec/mspec/spec/guards/version_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-
-# The VersionGuard specifies a version of Ruby with a String of
-# the form: v = 'major.minor.tiny'.
-#
-# A VersionGuard instance can be created with a single String,
-# which means any version >= each component of v.
-# Or, the guard can be created with a Range, a..b, or a...b,
-# where a, b are of the same form as v. The meaning of the Range
-# is as typically understood: a..b means v >= a and v <= b;
-# a...b means v >= a and v < b.
-
-describe VersionGuard, "#match?" do
- before :each do
- hide_deprecation_warnings
- stub_const "VersionGuard::FULL_RUBY_VERSION", SpecVersion.new('1.8.6')
- end
-
- it "returns true when the argument is equal to RUBY_VERSION" do
- VersionGuard.new('1.8.6').match?.should == true
- end
-
- it "returns true when the argument is less than RUBY_VERSION" do
- VersionGuard.new('1.8').match?.should == true
- VersionGuard.new('1.8.5').match?.should == true
- end
-
- it "returns false when the argument is greater than RUBY_VERSION" do
- VersionGuard.new('1.8.7').match?.should == false
- VersionGuard.new('1.9.2').match?.should == false
- end
-
- it "returns true when the argument range includes RUBY_VERSION" do
- VersionGuard.new('1.8.5'..'1.8.7').match?.should == true
- VersionGuard.new('1.8'..'1.9').match?.should == true
- VersionGuard.new('1.8'...'1.9').match?.should == true
- VersionGuard.new('1.8'..'1.8.6').match?.should == true
- VersionGuard.new('1.8.5'..'1.8.6').match?.should == true
- VersionGuard.new(''...'1.8.7').match?.should == true
- end
-
- it "returns false when the argument range does not include RUBY_VERSION" do
- VersionGuard.new('1.8.7'..'1.8.9').match?.should == false
- VersionGuard.new('1.8.4'..'1.8.5').match?.should == false
- VersionGuard.new('1.8.4'...'1.8.6').match?.should == false
- VersionGuard.new('1.8.5'...'1.8.6').match?.should == false
- VersionGuard.new(''...'1.8.6').match?.should == false
- end
-end
-
-describe Object, "#ruby_version_is" do
- before :each do
- @guard = VersionGuard.new 'x.x.x'
- VersionGuard.stub(:new).and_return(@guard)
- ScratchPad.clear
- end
-
- it "yields when #match? returns true" do
- @guard.stub(:match?).and_return(true)
- ruby_version_is('x.x.x') { ScratchPad.record :yield }
- ScratchPad.recorded.should == :yield
- end
-
- it "does not yield when #match? returns false" do
- @guard.stub(:match?).and_return(false)
- ruby_version_is('x.x.x') { ScratchPad.record :yield }
- ScratchPad.recorded.should_not == :yield
- end
-
- it "returns what #match? returns when no block is given" do
- @guard.stub(:match?).and_return(true)
- ruby_version_is('x.x.x').should == true
- @guard.stub(:match?).and_return(false)
- ruby_version_is('x.x.x').should == false
- end
-
- it "sets the name of the guard to :ruby_version_is" do
- ruby_version_is("") { }
- @guard.name.should == :ruby_version_is
- end
-
- it "calls #unregister even when an exception is raised in the guard block" do
- @guard.should_receive(:match?).and_return(true)
- @guard.should_receive(:unregister)
- lambda do
- ruby_version_is("") { raise Exception }
- end.should raise_error(Exception)
- end
-end
diff --git a/spec/mspec/spec/helpers/argf_spec.rb b/spec/mspec/spec/helpers/argf_spec.rb
deleted file mode 100644
index cf5eb0fe88..0000000000
--- a/spec/mspec/spec/helpers/argf_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#argf" do
- before :each do
- @saved_argv = ARGV.dup
- @argv = [__FILE__]
- end
-
- it "sets @argf to an instance of ARGF.class with the given argv" do
- argf @argv do
- @argf.should be_an_instance_of ARGF.class
- @argf.filename.should == @argv.first
- end
- @argf.should be_nil
- end
-
- it "does not alter ARGV nor ARGF" do
- argf @argv do
- end
- ARGV.should == @saved_argv
- ARGF.argv.should == @saved_argv
- end
-
- it "does not close STDIN" do
- argf ['-'] do
- end
- STDIN.should_not be_closed
- end
-
- it "disallows nested calls" do
- argf @argv do
- lambda { argf @argv }.should raise_error
- end
- end
-end
diff --git a/spec/mspec/spec/helpers/argv_spec.rb b/spec/mspec/spec/helpers/argv_spec.rb
deleted file mode 100644
index c3b21c7639..0000000000
--- a/spec/mspec/spec/helpers/argv_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#argv" do
- before :each do
- ScratchPad.clear
-
- @saved_argv = ARGV.dup
- @argv = ["a", "b"]
- end
-
- it "replaces and restores the value of ARGV" do
- argv @argv
- ARGV.should == @argv
- argv :restore
- ARGV.should == @saved_argv
- end
-
- it "yields to the block after setting ARGV" do
- argv @argv do
- ScratchPad.record ARGV.dup
- end
- ScratchPad.recorded.should == @argv
- ARGV.should == @saved_argv
- end
-end
diff --git a/spec/mspec/spec/helpers/datetime_spec.rb b/spec/mspec/spec/helpers/datetime_spec.rb
deleted file mode 100644
index 8696c0c9c7..0000000000
--- a/spec/mspec/spec/helpers/datetime_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#new_datetime" do
- it "returns a default DateTime instance" do
- new_datetime.should == DateTime.new
- end
-
- it "returns a DateTime instance with the specified year value" do
- d = new_datetime :year => 1970
- d.year.should == 1970
- end
-
- it "returns a DateTime instance with the specified month value" do
- d = new_datetime :month => 11
- d.mon.should == 11
- end
-
- it "returns a DateTime instance with the specified day value" do
- d = new_datetime :day => 23
- d.day.should == 23
- end
-
- it "returns a DateTime instance with the specified hour value" do
- d = new_datetime :hour => 10
- d.hour.should == 10
- end
-
- it "returns a DateTime instance with the specified minute value" do
- d = new_datetime :minute => 10
- d.min.should == 10
- end
-
- it "returns a DateTime instance with the specified second value" do
- d = new_datetime :second => 2
- d.sec.should == 2
- end
-
- it "returns a DateTime instance with the specified offset value" do
- d = new_datetime :offset => Rational(3,24)
- d.offset.should == Rational(3,24)
- end
-end
diff --git a/spec/mspec/spec/helpers/fixture_spec.rb b/spec/mspec/spec/helpers/fixture_spec.rb
deleted file mode 100644
index 4dbdd092f1..0000000000
--- a/spec/mspec/spec/helpers/fixture_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#fixture" do
- before :each do
- @dir = File.realpath("..", __FILE__)
- end
-
- it "returns the expanded path to a fixture file" do
- name = fixture(__FILE__, "subdir", "file.txt")
- name.should == "#{@dir}/fixtures/subdir/file.txt"
- end
-
- it "omits '/shared' if it is the suffix of the directory string" do
- name = fixture("#{@dir}/shared/file.rb", "subdir", "file.txt")
- name.should == "#{@dir}/fixtures/subdir/file.txt"
- end
-
- it "does not append '/fixtures' if it is the suffix of the directory string" do
- commands_dir = "#{File.dirname(@dir)}/commands"
- name = fixture("#{commands_dir}/fixtures/file.rb", "subdir", "file.txt")
- name.should == "#{commands_dir}/fixtures/subdir/file.txt"
- end
-end
diff --git a/spec/mspec/spec/helpers/flunk_spec.rb b/spec/mspec/spec/helpers/flunk_spec.rb
deleted file mode 100644
index 7b1216d3f7..0000000000
--- a/spec/mspec/spec/helpers/flunk_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/runner/mspec'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#flunk" do
- before :each do
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
- end
-
- it "raises an SpecExpectationNotMetError unconditionally" do
- lambda { flunk }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "accepts on argument for an optional message" do
- lambda {flunk "test"}.should raise_error(SpecExpectationNotMetError)
- end
-end
diff --git a/spec/mspec/spec/helpers/fs_spec.rb b/spec/mspec/spec/helpers/fs_spec.rb
deleted file mode 100644
index e40c6c5607..0000000000
--- a/spec/mspec/spec/helpers/fs_spec.rb
+++ /dev/null
@@ -1,195 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#cp" do
- before :each do
- @source = tmp("source.txt")
- @copy = tmp("copied.txt")
-
- @contents = "This is a copy."
- File.open(@source, "w") { |f| f.write @contents }
- end
-
- after :each do
- File.delete @source if File.exist? @source
- File.delete @copy if File.exist? @copy
- end
-
- it "copies a file" do
- cp @source, @copy
- data = IO.read(@copy)
- data.should == @contents
- data.should == IO.read(@source)
- end
-end
-
-describe Object, "#touch" do
- before :all do
- @name = tmp("touched.txt")
- end
-
- after :each do
- File.delete @name if File.exist? @name
- end
-
- it "creates a file" do
- touch @name
- File.exist?(@name).should be_true
- end
-
- it "accepts an optional mode argument" do
- touch @name, "wb"
- File.exist?(@name).should be_true
- end
-
- it "overwrites an existing file" do
- File.open(@name, "w") { |f| f.puts "used" }
- File.size(@name).should > 0
-
- touch @name
- File.size(@name).should == 0
- end
-
- it "yields the open file if passed a block" do
- touch(@name) { |f| f.write "touching" }
- IO.read(@name).should == "touching"
- end
-end
-
-describe Object, "#touch" do
- before :all do
- @name = tmp("subdir/touched.txt")
- end
-
- after :each do
- rm_r File.dirname(@name)
- end
-
- it "creates all the directories in the path to the file" do
- touch @name
- File.exist?(@name).should be_true
- end
-end
-
-describe Object, "#mkdir_p" do
- before :all do
- @dir1 = tmp("/nested")
- @dir2 = @dir1 + "/directory"
- @paths = [ @dir2, @dir1 ]
- end
-
- after :each do
- File.delete @dir1 if File.file? @dir1
- @paths.each { |path| Dir.rmdir path if File.directory? path }
- end
-
- it "creates all the directories in a path" do
- mkdir_p @dir2
- File.directory?(@dir2).should be_true
- end
-
- it "raises an ArgumentError if a path component is a file" do
- File.open(@dir1, "w") { |f| }
- lambda { mkdir_p @dir2 }.should raise_error(ArgumentError)
- end
-
- it "works if multiple processes try to create the same directory concurrently" do
- original = File.method(:directory?)
- File.should_receive(:directory?).at_least(:once) { |dir|
- ret = original.call(dir)
- if !ret and dir == @dir1
- Dir.mkdir(dir) # Simulate race
- end
- ret
- }
- mkdir_p @dir1
- original.call(@dir1).should be_true
- end
-end
-
-describe Object, "#rm_r" do
- before :all do
- @topdir = tmp("rm_r_tree")
- @topfile = @topdir + "/file.txt"
- @link = @topdir + "/file.lnk"
- @socket = @topdir + "/socket.sck"
- @subdir1 = @topdir + "/subdir1"
- @subdir2 = @subdir1 + "/subdir2"
- @subfile = @subdir1 + "/subfile.txt"
- end
-
- before :each do
- mkdir_p @subdir2
- touch @topfile
- touch @subfile
- end
-
- after :each do
- File.delete @link if File.exist? @link or File.symlink? @link
- File.delete @socket if File.exist? @socket
- File.delete @subfile if File.exist? @subfile
- File.delete @topfile if File.exist? @topfile
-
- Dir.rmdir @subdir2 if File.directory? @subdir2
- Dir.rmdir @subdir1 if File.directory? @subdir1
- Dir.rmdir @topdir if File.directory? @topdir
- end
-
- it "raises an ArgumentError if the path is not prefixed by MSPEC_RM_PREFIX" do
- lambda { rm_r "some_file.txt" }.should raise_error(ArgumentError)
- end
-
- it "removes a single file" do
- rm_r @subfile
- File.exist?(@subfile).should be_false
- end
-
- it "removes multiple files" do
- rm_r @topfile, @subfile
- File.exist?(@topfile).should be_false
- File.exist?(@subfile).should be_false
- end
-
- platform_is_not :windows do
- it "removes a symlink to a file" do
- File.symlink @topfile, @link
- rm_r @link
- File.exist?(@link).should be_false
- end
-
- it "removes a symlink to a directory" do
- File.symlink @subdir1, @link
- rm_r @link
- lambda do
- File.lstat(@link)
- end.should raise_error(Errno::ENOENT)
- File.exist?(@subdir1).should be_true
- end
-
- it "removes a dangling symlink" do
- File.symlink "non_existent_file", @link
- rm_r @link
- lambda do
- File.lstat(@link)
- end.should raise_error(Errno::ENOENT)
- end
-
- it "removes a socket" do
- require 'socket'
- UNIXServer.new(@socket).close
- rm_r @socket
- File.exist?(@socket).should be_false
- end
- end
-
- it "removes a single directory" do
- rm_r @subdir2
- File.directory?(@subdir2).should be_false
- end
-
- it "recursively removes a directory tree" do
- rm_r @topdir
- File.directory?(@topdir).should be_false
- end
-end
diff --git a/spec/mspec/spec/helpers/io_spec.rb b/spec/mspec/spec/helpers/io_spec.rb
deleted file mode 100644
index 3219f59947..0000000000
--- a/spec/mspec/spec/helpers/io_spec.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe IOStub do
- before :each do
- @out = IOStub.new
- @sep = $\
- end
-
- after :each do
- $\ = @sep
- end
-
- it "provides a write method" do
- @out.write "this"
- @out.should == "this"
- end
-
- it "concatenates the arguments sent to write" do
- @out.write "flim ", "flam"
- @out.should == "flim flam"
- end
-
- it "provides a print method that appends the default separator" do
- $\ = " [newline] "
- @out.print "hello"
- @out.print "world"
- @out.should == "hello [newline] world [newline] "
- end
-
- it "provides a puts method that appends the default separator" do
- @out.puts "hello", 1, 2, 3
- @out.should == "hello\n1\n2\n3\n"
- end
-
- it "provides a puts method that appends separator if argument not given" do
- @out.puts
- @out.should == "\n"
- end
-
- it "provides a printf method" do
- @out.printf "%-10s, %03d, %2.1f", "test", 42, 4.2
- @out.should == "test , 042, 4.2"
- end
-
- it "provides a flush method that does nothing and returns self" do
- @out.flush.should == @out
- end
-end
-
-describe Object, "#new_fd" do
- before :each do
- @name = tmp("io_specs")
- @io = nil
- end
-
- after :each do
- @io.close if @io and not @io.closed?
- rm_r @name
- end
-
- it "returns a Integer that can be used to create an IO instance" do
- fd = new_fd @name
- fd.should be_kind_of(Integer)
-
- @io = IO.new fd, fmode('w:utf-8')
- @io.sync = true
- @io.print "io data"
-
- IO.read(@name).should == "io data"
- end
-
- it "accepts an options Hash" do
- FeatureGuard.stub(:enabled?).and_return(true)
- fd = new_fd @name, { :mode => 'w:utf-8' }
- fd.should be_kind_of(Integer)
-
- @io = IO.new fd, fmode('w:utf-8')
- @io.sync = true
- @io.print "io data"
-
- IO.read(@name).should == "io data"
- end
-
- it "raises an ArgumentError if the options Hash does not include :mode" do
- FeatureGuard.stub(:enabled?).and_return(true)
- lambda { new_fd @name, { :encoding => "utf-8" } }.should raise_error(ArgumentError)
- end
-end
-
-describe Object, "#new_io" do
- before :each do
- @name = tmp("io_specs.txt")
- end
-
- after :each do
- @io.close if @io and !@io.closed?
- rm_r @name
- end
-
- it "returns an IO instance" do
- @io = new_io @name
- @io.should be_an_instance_of(IO)
- end
-
- it "opens the IO for reading if passed 'r'" do
- touch(@name) { |f| f.print "io data" }
- @io = new_io @name, "r"
- @io.read.should == "io data"
- lambda { @io.puts "more data" }.should raise_error(IOError)
- end
-
- it "opens the IO for writing if passed 'w'" do
- @io = new_io @name, "w"
- @io.sync = true
-
- @io.print "io data"
- IO.read(@name).should == "io data"
- end
-
- it "opens the IO for reading if passed { :mode => 'r' }" do
- touch(@name) { |f| f.print "io data" }
- @io = new_io @name, { :mode => "r" }
- @io.read.should == "io data"
- lambda { @io.puts "more data" }.should raise_error(IOError)
- end
-
- it "opens the IO for writing if passed { :mode => 'w' }" do
- @io = new_io @name, { :mode => "w" }
- @io.sync = true
-
- @io.print "io data"
- IO.read(@name).should == "io data"
- end
-end
-
-describe Object, "#fmode" do
- it "returns the argument unmodified if :encoding feature is enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true)
- fmode("rb:binary:utf-8").should == "rb:binary:utf-8"
- end
-
- it "returns only the file access mode if :encoding feature is not enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(false)
- fmode("rb:binary:utf-8").should == "rb"
- end
-end
-
-describe Object, "#options_or_mode" do
- describe "if passed a Hash" do
- it "returns a mode string if :encoding feature is not enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).twice.and_return(false)
- options_or_mode(:mode => "rb:binary").should == "rb"
- end
-
- it "returns a Hash if :encoding feature is enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true)
- options_or_mode(:mode => "rb:utf-8").should == { :mode => "rb:utf-8" }
- end
- end
-
- describe "if passed a String" do
- it "returns only the file access mode if :encoding feature is not enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(false)
- options_or_mode("rb:binary:utf-8").should == "rb"
- end
-
- it "returns the argument unmodified if :encoding feature is enabled" do
- FeatureGuard.should_receive(:enabled?).with(:encoding).and_return(true)
- options_or_mode("rb:binary:utf-8").should == "rb:binary:utf-8"
- end
- end
-end
diff --git a/spec/mspec/spec/helpers/mock_to_path_spec.rb b/spec/mspec/spec/helpers/mock_to_path_spec.rb
deleted file mode 100644
index 464e7e5440..0000000000
--- a/spec/mspec/spec/helpers/mock_to_path_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#mock_to_path" do
- it "returns an object that responds to #to_path" do
- obj = mock_to_path("foo")
- obj.should be_a(MockObject)
- obj.should respond_to(:to_path)
- obj.to_path
- end
-
- it "returns the provided path when #to_path is called" do
- obj = mock_to_path("/tmp/foo")
- obj.to_path.should == "/tmp/foo"
- end
-end
diff --git a/spec/mspec/spec/helpers/numeric_spec.rb b/spec/mspec/spec/helpers/numeric_spec.rb
deleted file mode 100644
index 2ea56e5961..0000000000
--- a/spec/mspec/spec/helpers/numeric_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#bignum_value" do
- it "returns a value that is an instance of Bignum on any platform" do
- bignum_value.should == 0x8000_0000_0000_0000
- end
-
- it "returns the default value incremented by the argument" do
- bignum_value(42).should == 0x8000_0000_0000_002a
- end
-end
-
-describe Object, "#nan_value" do
- it "returns NaN" do
- nan_value.nan?.should be_true
- end
-end
-
-describe Object, "#infinity_value" do
- it "returns Infinity" do
- infinity_value.infinite?.should == 1
- end
-end
diff --git a/spec/mspec/spec/helpers/ruby_exe_spec.rb b/spec/mspec/spec/helpers/ruby_exe_spec.rb
deleted file mode 100644
index 8036043578..0000000000
--- a/spec/mspec/spec/helpers/ruby_exe_spec.rb
+++ /dev/null
@@ -1,197 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-require 'rbconfig'
-
-class RubyExeSpecs
- public :ruby_exe_options
- public :resolve_ruby_exe
- public :ruby_cmd
- public :ruby_exe
-end
-
-describe "#ruby_exe_options" do
- before :each do
- @ruby_exe_env = ENV['RUBY_EXE']
- @script = RubyExeSpecs.new
- end
-
- after :each do
- ENV['RUBY_EXE'] = @ruby_exe_env
- end
-
- it "returns ENV['RUBY_EXE'] when passed :env" do
- ENV['RUBY_EXE'] = "kowabunga"
- @script.ruby_exe_options(:env).should == "kowabunga"
- end
-
- it "returns 'bin/jruby' when passed :engine and RUBY_ENGINE is 'jruby'" do
- stub_const "RUBY_ENGINE", 'jruby'
- @script.ruby_exe_options(:engine).should == 'bin/jruby'
- end
-
- it "returns 'bin/rbx' when passed :engine, RUBY_ENGINE is 'rbx'" do
- stub_const "RUBY_ENGINE", 'rbx'
- @script.ruby_exe_options(:engine).should == 'bin/rbx'
- end
-
- it "returns 'ir' when passed :engine and RUBY_ENGINE is 'ironruby'" do
- stub_const "RUBY_ENGINE", 'ironruby'
- @script.ruby_exe_options(:engine).should == 'ir'
- end
-
- it "returns 'maglev-ruby' when passed :engine and RUBY_ENGINE is 'maglev'" do
- stub_const "RUBY_ENGINE", 'maglev'
- @script.ruby_exe_options(:engine).should == 'maglev-ruby'
- end
-
- it "returns 'topaz' when passed :engine and RUBY_ENGINE is 'topaz'" do
- stub_const "RUBY_ENGINE", 'topaz'
- @script.ruby_exe_options(:engine).should == 'topaz'
- end
-
- it "returns RUBY_ENGINE + $(EXEEXT) when passed :name" do
- bin = RUBY_ENGINE + (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
- name = File.join ".", bin
- @script.ruby_exe_options(:name).should == name
- end
-
- it "returns $(bindir)/$(RUBY_INSTALL_NAME) + $(EXEEXT) when passed :install_name" do
- bin = RbConfig::CONFIG['RUBY_INSTALL_NAME'] + (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
- name = File.join RbConfig::CONFIG['bindir'], bin
- @script.ruby_exe_options(:install_name).should == name
- end
-end
-
-describe "#resolve_ruby_exe" do
- before :each do
- @name = "ruby_spec_exe"
- @script = RubyExeSpecs.new
- end
-
- it "returns the value returned by #ruby_exe_options if it exists and is executable" do
- @script.should_receive(:ruby_exe_options).and_return(@name)
- File.should_receive(:file?).with(@name).and_return(true)
- File.should_receive(:executable?).with(@name).and_return(true)
- File.should_receive(:expand_path).with(@name).and_return(@name)
- @script.resolve_ruby_exe.should == @name
- end
-
- it "expands the path portion of the result of #ruby_exe_options" do
- @script.should_receive(:ruby_exe_options).and_return("#{@name}")
- File.should_receive(:file?).with(@name).and_return(true)
- File.should_receive(:executable?).with(@name).and_return(true)
- File.should_receive(:expand_path).with(@name).and_return("/usr/bin/#{@name}")
- @script.resolve_ruby_exe.should == "/usr/bin/#{@name}"
- end
-
- it "adds the flags after the executable" do
- @name = 'bin/rbx'
- @script.should_receive(:ruby_exe_options).and_return(@name)
- File.should_receive(:file?).with(@name).and_return(true)
- File.should_receive(:executable?).with(@name).and_return(true)
- File.should_receive(:expand_path).with(@name).and_return(@name)
-
- ENV.should_receive(:[]).with("RUBY_FLAGS").and_return('-X19')
- @script.resolve_ruby_exe.should == 'bin/rbx -X19'
- end
-
- it "raises an exception if no exe is found" do
- File.should_receive(:file?).at_least(:once).and_return(false)
- lambda {
- @script.resolve_ruby_exe
- }.should raise_error(Exception)
- end
-end
-
-describe Object, "#ruby_cmd" do
- before :each do
- stub_const 'RUBY_EXE', 'ruby_spec_exe -w -Q'
-
- @file = "some/ruby/file.rb"
- @code = %(some "real" 'ruby' code)
-
- @script = RubyExeSpecs.new
- end
-
- it "returns a command that runs the given file if it is a file that exists" do
- File.should_receive(:exist?).with(@file).and_return(true)
- @script.ruby_cmd(@file).should == "ruby_spec_exe -w -Q some/ruby/file.rb"
- end
-
- it "includes the given options and arguments with a file" do
- File.should_receive(:exist?).with(@file).and_return(true)
- @script.ruby_cmd(@file, :options => "-w -Cdir", :args => "< file.txt").should ==
- "ruby_spec_exe -w -Q -w -Cdir some/ruby/file.rb < file.txt"
- end
-
- it "includes the given options and arguments with -e" do
- File.should_receive(:exist?).with(@code).and_return(false)
- @script.ruby_cmd(@code, :options => "-W0 -Cdir", :args => "< file.txt").should ==
- %(ruby_spec_exe -w -Q -W0 -Cdir -e "some \\"real\\" 'ruby' code" < file.txt)
- end
-
- it "returns a command with options and arguments but without code or file" do
- @script.ruby_cmd(nil, :options => "-c", :args => "> file.txt").should ==
- "ruby_spec_exe -w -Q -c > file.txt"
- end
-end
-
-describe Object, "#ruby_exe" do
- before :each do
- stub_const 'RUBY_EXE', 'ruby_spec_exe -w -Q'
-
- @script = RubyExeSpecs.new
- @script.stub(:`)
- end
-
- it "returns an Array containing the interpreter executable and flags when given no arguments" do
- @script.ruby_exe.should == ['ruby_spec_exe', '-w', '-Q']
- end
-
- it "executes (using `) the result of calling #ruby_cmd with the given arguments" do
- code = "code"
- options = {}
- @script.should_receive(:ruby_cmd).and_return("ruby_cmd")
- @script.should_receive(:`).with("ruby_cmd")
- @script.ruby_exe(code, options)
- end
-
- describe "with :dir option" do
- it "is deprecated" do
- lambda {
- @script.ruby_exe nil, :dir => "tmp"
- }.should raise_error(/no longer supported, use Dir\.chdir/)
- end
- end
-
- describe "with :env option" do
- it "preserves the values of existing ENV keys" do
- ENV["ABC"] = "123"
- ENV.stub(:[])
- ENV.should_receive(:[]).with("ABC")
- @script.ruby_exe nil, :env => { :ABC => "xyz" }
- end
-
- it "adds the :env entries to ENV" do
- ENV.should_receive(:[]=).with("ABC", "xyz")
- @script.ruby_exe nil, :env => { :ABC => "xyz" }
- end
-
- it "deletes the :env entries in ENV when an exception is raised" do
- ENV.should_receive(:delete).with("XYZ")
- @script.ruby_exe nil, :env => { :XYZ => "xyz" }
- end
-
- it "resets the values of existing ENV keys when an exception is raised" do
- ENV["ABC"] = "123"
- ENV.should_receive(:[]=).with("ABC", "xyz")
- ENV.should_receive(:[]=).with("ABC", "123")
-
- @script.should_receive(:`).and_raise(Exception)
- lambda do
- @script.ruby_exe nil, :env => { :ABC => "xyz" }
- end.should raise_error(Exception)
- end
- end
-end
diff --git a/spec/mspec/spec/helpers/scratch_spec.rb b/spec/mspec/spec/helpers/scratch_spec.rb
deleted file mode 100644
index 6a9eb2cf73..0000000000
--- a/spec/mspec/spec/helpers/scratch_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe ScratchPad do
- it "records an object and returns a previously recorded object" do
- ScratchPad.record :this
- ScratchPad.recorded.should == :this
- end
-
- it "clears the recorded object" do
- ScratchPad.record :that
- ScratchPad.recorded.should == :that
- ScratchPad.clear
- ScratchPad.recorded.should == nil
- end
-
- it "provides a convenience shortcut to append to a previously recorded object" do
- ScratchPad.record []
- ScratchPad << :new
- ScratchPad << :another
- ScratchPad.recorded.should == [:new, :another]
- end
-end
diff --git a/spec/mspec/spec/helpers/suppress_warning_spec.rb b/spec/mspec/spec/helpers/suppress_warning_spec.rb
deleted file mode 100644
index d16361fa55..0000000000
--- a/spec/mspec/spec/helpers/suppress_warning_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#suppress_warning" do
- it "hides warnings" do
- suppress_warning do
- warn "should not be shown"
- end
- end
-
- it "yields the block" do
- a = 0
- suppress_warning do
- a = 1
- end
- a.should == 1
- end
-end
diff --git a/spec/mspec/spec/helpers/tmp_spec.rb b/spec/mspec/spec/helpers/tmp_spec.rb
deleted file mode 100644
index afadc7f51c..0000000000
--- a/spec/mspec/spec/helpers/tmp_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-require 'mspec/guards'
-require 'mspec/helpers'
-
-describe Object, "#tmp" do
- before :all do
- @dir = "#{File.expand_path(Dir.pwd)}/rubyspec_temp"
- end
-
- it "returns a name relative to the current working directory" do
- tmp("test.txt").should == "#{@dir}/#{SPEC_TEMP_UNIQUIFIER}-test.txt"
- end
-
- it "returns a 'unique' name on repeated calls" do
- a = tmp("text.txt")
- b = tmp("text.txt")
- a.should_not == b
- end
-
- it "does not 'uniquify' the name if requested not to" do
- tmp("test.txt", false).should == "#{@dir}/test.txt"
- end
-
- it "returns the name of the temporary directory when passed an empty string" do
- tmp("").should == "#{@dir}/"
- end
-end
diff --git a/spec/mspec/spec/integration/interpreter_spec.rb b/spec/mspec/spec/integration/interpreter_spec.rb
deleted file mode 100644
index b6fa6859d1..0000000000
--- a/spec/mspec/spec/integration/interpreter_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-
-describe "The interpreter passed with -t" do
- it "is used in subprocess" do
- fixtures = "spec/fixtures"
- interpreter = "#{fixtures}/my_ruby"
- out, ret = run_mspec("run", "#{fixtures}/print_interpreter_spec.rb -t #{interpreter}")
- out = out.lines.map(&:chomp).reject { |line|
- line == 'RUBY_DESCRIPTION'
- }.take(3)
- out.should == [
- interpreter,
- interpreter,
- "CWD/#{interpreter}"
- ]
- ret.success?.should == true
- end
-end
diff --git a/spec/mspec/spec/integration/object_methods_spec.rb b/spec/mspec/spec/integration/object_methods_spec.rb
deleted file mode 100644
index 3be704beb6..0000000000
--- a/spec/mspec/spec/integration/object_methods_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-
-expected_output = <<EOS
-RUBY_DESCRIPTION
-.
-
-Finished in D.DDDDDD seconds
-
-1 file, 1 example, 1 expectation, 0 failures, 0 errors, 0 tagged
-EOS
-
-describe "MSpec" do
- it "does not define public methods on Object" do
- out, ret = run_mspec("run", "spec/fixtures/object_methods_spec.rb")
- out.should == expected_output
- ret.success?.should == true
- end
-end
diff --git a/spec/mspec/spec/integration/run_spec.rb b/spec/mspec/spec/integration/run_spec.rb
deleted file mode 100644
index 93d2ef8b68..0000000000
--- a/spec/mspec/spec/integration/run_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe "Running mspec" do
- a_spec_output = <<EOS
-
-1)
-Foo#bar errors FAILED
-Expected 1
- to equal 2
-
-CWD/spec/fixtures/a_spec.rb:8:in `block (2 levels) in <top (required)>'
-CWD/spec/fixtures/a_spec.rb:2:in `<top (required)>'
-CWD/bin/mspec-run:7:in `<main>'
-
-2)
-Foo#bar fails ERROR
-RuntimeError: failure
-CWD/spec/fixtures/a_spec.rb:12:in `block (2 levels) in <top (required)>'
-CWD/spec/fixtures/a_spec.rb:2:in `<top (required)>'
-CWD/bin/mspec-run:7:in `<main>'
-
-Finished in D.DDDDDD seconds
-EOS
-
- a_stats = "1 file, 3 examples, 2 expectations, 1 failure, 1 error, 0 tagged\n"
- ab_stats = "2 files, 4 examples, 3 expectations, 1 failure, 1 error, 0 tagged\n"
-
- it "runs the specs" do
- fixtures = "spec/fixtures"
- out, ret = run_mspec("run", "#{fixtures}/a_spec.rb")
- out.should == "RUBY_DESCRIPTION\n.FE\n#{a_spec_output}\n#{a_stats}"
- ret.success?.should == false
- end
-
- it "directly with mspec-run runs the specs" do
- fixtures = "spec/fixtures"
- out, ret = run_mspec("-run", "#{fixtures}/a_spec.rb")
- out.should == "RUBY_DESCRIPTION\n.FE\n#{a_spec_output}\n#{a_stats}"
- ret.success?.should == false
- end
-
- it "runs the specs in parallel with -j" do
- fixtures = "spec/fixtures"
- out, ret = run_mspec("run", "-j #{fixtures}/a_spec.rb #{fixtures}/b_spec.rb")
- progress_bar =
- "\r[/ | 0% | 00:00:00] \e[0;32m 0F \e[0;32m 0E\e[0m " +
- "\r[- | ==================50% | 00:00:00] \e[0;32m 0F \e[0;32m 0E\e[0m " +
- "\r[\\ | ==================100%================== | 00:00:00] \e[0;32m 0F \e[0;32m 0E\e[0m "
- out.should == "RUBY_DESCRIPTION\n#{progress_bar}\n#{a_spec_output}\n#{ab_stats}"
- ret.success?.should == false
- end
-end
diff --git a/spec/mspec/spec/integration/tag_spec.rb b/spec/mspec/spec/integration/tag_spec.rb
deleted file mode 100644
index d980769043..0000000000
--- a/spec/mspec/spec/integration/tag_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# encoding: utf-8
-require 'spec_helper'
-
-describe "Running mspec tag" do
- before :all do
- FileUtils.rm_rf 'spec/fixtures/tags'
- end
-
- after :all do
- FileUtils.rm_rf 'spec/fixtures/tags'
- end
-
- it "tags the failing specs" do
- fixtures = "spec/fixtures"
- out, ret = run_mspec("tag", "--add fails --fail #{fixtures}/tagging_spec.rb")
- out.should == <<EOS
-RUBY_DESCRIPTION
-.FF
-TagAction: specs tagged with 'fails':
-
-Tag#me errors
-Tag#me érròrs in unicode
-
-
-1)
-Tag#me errors FAILED
-Expected 1
- to equal 2
-
-CWD/spec/fixtures/tagging_spec.rb:9:in `block (2 levels) in <top (required)>'
-CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
-CWD/bin/mspec-tag:7:in `<main>'
-
-2)
-Tag#me érròrs in unicode FAILED
-Expected 1
- to equal 2
-
-CWD/spec/fixtures/tagging_spec.rb:13:in `block (2 levels) in <top (required)>'
-CWD/spec/fixtures/tagging_spec.rb:3:in `<top (required)>'
-CWD/bin/mspec-tag:7:in `<main>'
-
-Finished in D.DDDDDD seconds
-
-1 file, 3 examples, 3 expectations, 2 failures, 0 errors, 0 tagged
-EOS
- ret.success?.should == false
- end
-
- it "does not run already tagged specs" do
- fixtures = "spec/fixtures"
- out, ret = run_mspec("run", "--excl-tag fails #{fixtures}/tagging_spec.rb")
- out.should == <<EOS
-RUBY_DESCRIPTION
-.
-
-Finished in D.DDDDDD seconds
-
-1 file, 3 examples, 1 expectation, 0 failures, 0 errors, 2 tagged
-EOS
- ret.success?.should == true
- end
-end
diff --git a/spec/mspec/spec/matchers/base_spec.rb b/spec/mspec/spec/matchers/base_spec.rb
deleted file mode 100644
index cc13c29d1d..0000000000
--- a/spec/mspec/spec/matchers/base_spec.rb
+++ /dev/null
@@ -1,225 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-require 'time'
-
-describe SpecPositiveOperatorMatcher, "== operator" do
- it "raises an SpecExpectationNotMetError when expected == actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new(1) == 2
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x to equal y'" do
- SpecExpectation.should_receive(:fail_with).with("Expected 1\n", "to equal 2\n")
- SpecPositiveOperatorMatcher.new(1) == 2
- end
-
- it "does not raise an exception when expected == actual returns true" do
- SpecPositiveOperatorMatcher.new(1) == 1
- end
-end
-
-describe SpecPositiveOperatorMatcher, "=~ operator" do
- it "raises an SpecExpectationNotMetError when expected =~ actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new('real') =~ /fake/
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected \"x\" to match y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected \"real\"\n", "to match /fake/\n")
- SpecPositiveOperatorMatcher.new('real') =~ /fake/
- end
-
- it "does not raise an exception when expected =~ actual returns true" do
- SpecPositiveOperatorMatcher.new('real') =~ /real/
- end
-end
-
-describe SpecPositiveOperatorMatcher, "> operator" do
- it "raises an SpecExpectationNotMetError when expected > actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new(4) > 5
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x to be greater than y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 4\n", "to be greater than 5\n")
- SpecPositiveOperatorMatcher.new(4) > 5
- end
-
- it "does not raise an exception when expected > actual returns true" do
- SpecPositiveOperatorMatcher.new(5) > 4
- end
-end
-
-describe SpecPositiveOperatorMatcher, ">= operator" do
- it "raises an SpecExpectationNotMetError when expected >= actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new(4) >= 5
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x to be greater than or equal to y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 4\n", "to be greater than or equal to 5\n")
- SpecPositiveOperatorMatcher.new(4) >= 5
- end
-
- it "does not raise an exception when expected > actual returns true" do
- SpecPositiveOperatorMatcher.new(5) >= 4
- SpecPositiveOperatorMatcher.new(5) >= 5
- end
-end
-
-describe SpecPositiveOperatorMatcher, "< operater" do
- it "raises an SpecExpectationNotMetError when expected < actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new(5) < 4
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x to be less than y'" do
- SpecExpectation.should_receive(:fail_with).with("Expected 5\n", "to be less than 4\n")
- SpecPositiveOperatorMatcher.new(5) < 4
- end
-
- it "does not raise an exception when expected < actual returns true" do
- SpecPositiveOperatorMatcher.new(4) < 5
- end
-end
-
-describe SpecPositiveOperatorMatcher, "<= operater" do
- it "raises an SpecExpectationNotMetError when expected < actual returns false" do
- lambda {
- SpecPositiveOperatorMatcher.new(5) <= 4
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x to be less than or equal to y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 5\n", "to be less than or equal to 4\n")
- SpecPositiveOperatorMatcher.new(5) <= 4
- end
-
- it "does not raise an exception when expected < actual returns true" do
- SpecPositiveOperatorMatcher.new(4) <= 5
- SpecPositiveOperatorMatcher.new(4) <= 4
- end
-end
-
-describe SpecNegativeOperatorMatcher, "== operator" do
- it "raises an SpecExpectationNotMetError when expected == actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new(1) == 1
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x not to equal y'" do
- SpecExpectation.should_receive(:fail_with).with("Expected 1\n", "not to equal 1\n")
- SpecNegativeOperatorMatcher.new(1) == 1
- end
-
- it "does not raise an exception when expected == actual returns false" do
- SpecNegativeOperatorMatcher.new(1) == 2
- end
-end
-
-describe SpecNegativeOperatorMatcher, "=~ operator" do
- it "raises an SpecExpectationNotMetError when expected =~ actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new('real') =~ /real/
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected \"x\" not to match /y/'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected \"real\"\n", "not to match /real/\n")
- SpecNegativeOperatorMatcher.new('real') =~ /real/
- end
-
- it "does not raise an exception when expected =~ actual returns false" do
- SpecNegativeOperatorMatcher.new('real') =~ /fake/
- end
-end
-
-describe SpecNegativeOperatorMatcher, "< operator" do
- it "raises an SpecExpectationNotMetError when expected < actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new(4) < 5
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x not to be less than y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 4\n", "not to be less than 5\n")
- SpecNegativeOperatorMatcher.new(4) < 5
- end
-
- it "does not raise an exception when expected < actual returns false" do
- SpecNegativeOperatorMatcher.new(5) < 4
- end
-end
-
-describe SpecNegativeOperatorMatcher, "<= operator" do
- it "raises an SpecExpectationNotMetError when expected <= actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new(4) <= 5
- }.should raise_error(SpecExpectationNotMetError)
- lambda {
- SpecNegativeOperatorMatcher.new(5) <= 5
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x not to be less than or equal to y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 4\n", "not to be less than or equal to 5\n")
- SpecNegativeOperatorMatcher.new(4) <= 5
- end
-
- it "does not raise an exception when expected <= actual returns false" do
- SpecNegativeOperatorMatcher.new(5) <= 4
- end
-end
-
-describe SpecNegativeOperatorMatcher, "> operator" do
- it "raises an SpecExpectationNotMetError when expected > actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new(5) > 4
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x not to be greater than y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 5\n", "not to be greater than 4\n")
- SpecNegativeOperatorMatcher.new(5) > 4
- end
-
- it "does not raise an exception when expected > actual returns false" do
- SpecNegativeOperatorMatcher.new(4) > 5
- end
-end
-
-describe SpecNegativeOperatorMatcher, ">= operator" do
- it "raises an SpecExpectationNotMetError when expected >= actual returns true" do
- lambda {
- SpecNegativeOperatorMatcher.new(5) >= 4
- }.should raise_error(SpecExpectationNotMetError)
- lambda {
- SpecNegativeOperatorMatcher.new(5) >= 5
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "provides a failure message that 'Expected x not to be greater than or equal to y'" do
- SpecExpectation.should_receive(:fail_with).with(
- "Expected 5\n", "not to be greater than or equal to 4\n")
- SpecNegativeOperatorMatcher.new(5) >= 4
- end
-
- it "does not raise an exception when expected >= actual returns false" do
- SpecNegativeOperatorMatcher.new(4) >= 5
- end
-end
diff --git a/spec/mspec/spec/matchers/be_an_instance_of_spec.rb b/spec/mspec/spec/matchers/be_an_instance_of_spec.rb
deleted file mode 100644
index 7f2126df7d..0000000000
--- a/spec/mspec/spec/matchers/be_an_instance_of_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-module BeAnInOfSpecs
- class A
- end
-
- class B < A
- end
-
- class C < B
- end
-end
-
-describe BeAnInstanceOfMatcher do
- it "matches when actual is an instance_of? expected" do
- a = BeAnInOfSpecs::A.new
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(a).should be_true
-
- b = BeAnInOfSpecs::B.new
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(b).should be_true
- end
-
- it "does not match when actual is not an instance_of? expected" do
- a = BeAnInOfSpecs::A.new
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(a).should be_false
-
- b = BeAnInOfSpecs::B.new
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(b).should be_false
-
- c = BeAnInOfSpecs::C.new
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::A).matches?(c).should be_false
- BeAnInstanceOfMatcher.new(BeAnInOfSpecs::B).matches?(c).should be_false
- end
-
- it "provides a useful failure message" do
- matcher = BeAnInstanceOfMatcher.new(Numeric)
- matcher.matches?("string")
- matcher.failure_message.should == [
- "Expected \"string\" (String)", "to be an instance of Numeric"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeAnInstanceOfMatcher.new(Numeric)
- matcher.matches?(4.0)
- matcher.negative_failure_message.should == [
- "Expected 4.0 (Float)", "not to be an instance of Numeric"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_ancestor_of_spec.rb b/spec/mspec/spec/matchers/be_ancestor_of_spec.rb
deleted file mode 100644
index c6bd1a26c7..0000000000
--- a/spec/mspec/spec/matchers/be_ancestor_of_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class Parent; end
-class Child < Parent; end
-
-describe BeAncestorOfMatcher do
- it "matches when actual is an ancestor of expected" do
- BeAncestorOfMatcher.new(Child).matches?(Parent).should == true
- end
-
- it "does not match when actual is not an ancestor of expected" do
- BeAncestorOfMatcher.new(Parent).matches?(Child).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeAncestorOfMatcher.new(Parent)
- matcher.matches?(Child)
- matcher.failure_message.should == ["Expected Child", "to be an ancestor of Parent"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeAncestorOfMatcher.new(Child)
- matcher.matches?(Parent)
- matcher.negative_failure_message.should == ["Expected Parent", "not to be an ancestor of Child"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_close_spec.rb b/spec/mspec/spec/matchers/be_close_spec.rb
deleted file mode 100644
index 9b6e56e6d5..0000000000
--- a/spec/mspec/spec/matchers/be_close_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-# Adapted from RSpec 1.0.8
-describe BeCloseMatcher do
- it "matches when actual == expected" do
- BeCloseMatcher.new(5.0, 0.5).matches?(5.0).should == true
- end
-
- it "matches when actual < (expected + tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(5.49).should == true
- end
-
- it "matches when actual > (expected - tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(4.51).should == true
- end
-
- it "does not match when actual == (expected + tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == false
- end
-
- it "does not match when actual == (expected - tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == false
- end
-
- it "does not match when actual < (expected - tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(4.49).should == false
- end
-
- it "does not match when actual > (expected + tolerance)" do
- BeCloseMatcher.new(5.0, 0.5).matches?(5.51).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeCloseMatcher.new(5.0, 0.5)
- matcher.matches?(6.5)
- matcher.failure_message.should == ["Expected 6.5", "to be within 5.0 +/- 0.5"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeCloseMatcher.new(5.0, 0.5)
- matcher.matches?(4.9)
- matcher.negative_failure_message.should == ["Expected 4.9", "not to be within 5.0 +/- 0.5"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_computed_by_spec.rb b/spec/mspec/spec/matchers/be_computed_by_spec.rb
deleted file mode 100644
index 9833e211a4..0000000000
--- a/spec/mspec/spec/matchers/be_computed_by_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'spec_helper'
-require 'mspec/matchers'
-
-describe BeComputedByMatcher do
- it "matches when all entries in the Array compute" do
- array = [ [65, "A"],
- [90, "Z"] ]
- BeComputedByMatcher.new(:chr).matches?(array).should be_true
- end
-
- it "matches when all entries in the Array with arguments compute" do
- array = [ [1, 2, 3],
- [2, 4, 6] ]
- BeComputedByMatcher.new(:+).matches?(array).should be_true
- end
-
- it "does not match when any entry in the Array does not compute" do
- array = [ [65, "A" ],
- [91, "Z" ] ]
- BeComputedByMatcher.new(:chr).matches?(array).should be_false
- end
-
- it "accepts an argument list to apply to each method call" do
- array = [ [65, "1000001" ],
- [90, "1011010" ] ]
- BeComputedByMatcher.new(:to_s, 2).matches?(array).should be_true
- end
-
- it "does not match when any entry in the Array with arguments does not compute" do
- array = [ [1, 2, 3],
- [2, 4, 7] ]
- BeComputedByMatcher.new(:+).matches?(array).should be_false
- end
-
- it "provides a useful failure message" do
- array = [ [65, "A" ],
- [91, "Z" ] ]
- matcher = BeComputedByMatcher.new(:chr)
- matcher.matches?(array)
- matcher.failure_message.should == ["Expected \"Z\"", "to be computed by 91.chr (computed \"[\" instead)"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_empty_spec.rb b/spec/mspec/spec/matchers/be_empty_spec.rb
deleted file mode 100644
index cb8663f5ee..0000000000
--- a/spec/mspec/spec/matchers/be_empty_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeEmptyMatcher do
- it "matches when actual is empty" do
- BeEmptyMatcher.new.matches?("").should == true
- end
-
- it "does not match when actual is not empty" do
- BeEmptyMatcher.new.matches?([10]).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeEmptyMatcher.new
- matcher.matches?("not empty string")
- matcher.failure_message.should == ["Expected \"not empty string\"", "to be empty"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeEmptyMatcher.new
- matcher.matches?("")
- matcher.negative_failure_message.should == ["Expected \"\"", "not to be empty"]
- end
-end
-
diff --git a/spec/mspec/spec/matchers/be_false_spec.rb b/spec/mspec/spec/matchers/be_false_spec.rb
deleted file mode 100644
index 31afd24ebc..0000000000
--- a/spec/mspec/spec/matchers/be_false_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeFalseMatcher do
- it "matches when actual is false" do
- BeFalseMatcher.new.matches?(false).should == true
- end
-
- it "does not match when actual is not false" do
- BeFalseMatcher.new.matches?("").should == false
- BeFalseMatcher.new.matches?(true).should == false
- BeFalseMatcher.new.matches?(nil).should == false
- BeFalseMatcher.new.matches?(0).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeFalseMatcher.new
- matcher.matches?("some string")
- matcher.failure_message.should == ["Expected \"some string\"", "to be false"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeFalseMatcher.new
- matcher.matches?(false)
- matcher.negative_failure_message.should == ["Expected false", "not to be false"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_kind_of_spec.rb b/spec/mspec/spec/matchers/be_kind_of_spec.rb
deleted file mode 100644
index 7c4a59f7b9..0000000000
--- a/spec/mspec/spec/matchers/be_kind_of_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeKindOfMatcher do
- it "matches when actual is a kind_of? expected" do
- BeKindOfMatcher.new(Numeric).matches?(1).should == true
- BeKindOfMatcher.new(Integer).matches?(2).should == true
- BeKindOfMatcher.new(Regexp).matches?(/m/).should == true
- end
-
- it "does not match when actual is not a kind_of? expected" do
- BeKindOfMatcher.new(Integer).matches?(1.5).should == false
- BeKindOfMatcher.new(String).matches?(:a).should == false
- BeKindOfMatcher.new(Hash).matches?([]).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeKindOfMatcher.new(Numeric)
- matcher.matches?('string')
- matcher.failure_message.should == [
- "Expected \"string\" (String)", "to be kind of Numeric"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeKindOfMatcher.new(Numeric)
- matcher.matches?(4.0)
- matcher.negative_failure_message.should == [
- "Expected 4.0 (Float)", "not to be kind of Numeric"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_nan_spec.rb b/spec/mspec/spec/matchers/be_nan_spec.rb
deleted file mode 100644
index 2062763a92..0000000000
--- a/spec/mspec/spec/matchers/be_nan_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/guards'
-require 'mspec/helpers'
-require 'mspec/matchers'
-
-describe BeNaNMatcher do
- it "matches when actual is NaN" do
- BeNaNMatcher.new.matches?(nan_value).should == true
- end
-
- it "does not match when actual is not NaN" do
- BeNaNMatcher.new.matches?(1.0).should == false
- BeNaNMatcher.new.matches?(0).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeNaNMatcher.new
- matcher.matches?(0)
- matcher.failure_message.should == ["Expected 0", "to be NaN"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeNaNMatcher.new
- matcher.matches?(nan_value)
- matcher.negative_failure_message.should == ["Expected NaN", "not to be NaN"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_nil_spec.rb b/spec/mspec/spec/matchers/be_nil_spec.rb
deleted file mode 100644
index 6551feb5de..0000000000
--- a/spec/mspec/spec/matchers/be_nil_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeNilMatcher do
- it "matches when actual is nil" do
- BeNilMatcher.new.matches?(nil).should == true
- end
-
- it "does not match when actual is not nil" do
- BeNilMatcher.new.matches?("").should == false
- BeNilMatcher.new.matches?(false).should == false
- BeNilMatcher.new.matches?(0).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeNilMatcher.new
- matcher.matches?("some string")
- matcher.failure_message.should == ["Expected \"some string\"", "to be nil"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeNilMatcher.new
- matcher.matches?(nil)
- matcher.negative_failure_message.should == ["Expected nil", "not to be nil"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_true_or_false_spec.rb b/spec/mspec/spec/matchers/be_true_or_false_spec.rb
deleted file mode 100644
index 3edffcb1b1..0000000000
--- a/spec/mspec/spec/matchers/be_true_or_false_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeTrueOrFalseMatcher do
- it "matches when actual is true" do
- BeTrueOrFalseMatcher.new.matches?(true).should == true
- end
-
- it "matches when actual is false" do
- BeTrueOrFalseMatcher.new.matches?(false).should == true
- end
-
- it "provides a useful failure message" do
- matcher = BeTrueOrFalseMatcher.new
- matcher.matches?("some string")
- matcher.failure_message.should == ["Expected \"some string\"", "to be true or false"]
- end
-end
diff --git a/spec/mspec/spec/matchers/be_true_spec.rb b/spec/mspec/spec/matchers/be_true_spec.rb
deleted file mode 100644
index 90c89b3911..0000000000
--- a/spec/mspec/spec/matchers/be_true_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BeTrueMatcher do
- it "matches when actual is true" do
- BeTrueMatcher.new.matches?(true).should == true
- end
-
- it "does not match when actual is not true" do
- BeTrueMatcher.new.matches?("").should == false
- BeTrueMatcher.new.matches?(false).should == false
- BeTrueMatcher.new.matches?(nil).should == false
- BeTrueMatcher.new.matches?(0).should == false
- end
-
- it "provides a useful failure message" do
- matcher = BeTrueMatcher.new
- matcher.matches?("some string")
- matcher.failure_message.should == ["Expected \"some string\"", "to be true"]
- end
-
- it "provides a useful negative failure message" do
- matcher = BeTrueMatcher.new
- matcher.matches?(true)
- matcher.negative_failure_message.should == ["Expected true", "not to be true"]
- end
-end
diff --git a/spec/mspec/spec/matchers/block_caller_spec.rb b/spec/mspec/spec/matchers/block_caller_spec.rb
deleted file mode 100644
index d6793b9779..0000000000
--- a/spec/mspec/spec/matchers/block_caller_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe BlockingMatcher do
- it 'matches when a Proc blocks the caller' do
- BlockingMatcher.new.matches?(proc { sleep }).should == true
- end
-
- it 'does not match when a Proc does not block the caller' do
- BlockingMatcher.new.matches?(proc { 1 }).should == false
- end
-end
diff --git a/spec/mspec/spec/matchers/complain_spec.rb b/spec/mspec/spec/matchers/complain_spec.rb
deleted file mode 100644
index 709b57be6c..0000000000
--- a/spec/mspec/spec/matchers/complain_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe ComplainMatcher do
- it "matches when executing the proc results in output to $stderr" do
- proc = lambda { warn "I'm gonna tell yo mama" }
- ComplainMatcher.new(nil).matches?(proc).should == true
- end
-
- it "maches when executing the proc results in the expected output to $stderr" do
- proc = lambda { warn "Que haces?" }
- ComplainMatcher.new("Que haces?\n").matches?(proc).should == true
- ComplainMatcher.new("Que pasa?\n").matches?(proc).should == false
- ComplainMatcher.new(/Que/).matches?(proc).should == true
- ComplainMatcher.new(/Quoi/).matches?(proc).should == false
- end
-
- it "does not match when there is no output to $stderr" do
- ComplainMatcher.new(nil).matches?(lambda {}).should == false
- end
-
- it "provides a useful failure message" do
- matcher = ComplainMatcher.new(nil)
- matcher.matches?(lambda { })
- matcher.failure_message.should == ["Expected a warning", "but received none"]
- matcher = ComplainMatcher.new("listen here")
- matcher.matches?(lambda { warn "look out" })
- matcher.failure_message.should ==
- ["Expected warning: \"listen here\"", "but got: \"look out\""]
- matcher = ComplainMatcher.new(/talk/)
- matcher.matches?(lambda { warn "listen up" })
- matcher.failure_message.should ==
- ["Expected warning to match: /talk/", "but got: \"listen up\""]
- end
-
- it "provides a useful negative failure message" do
- proc = lambda { warn "ouch" }
- matcher = ComplainMatcher.new(nil)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Unexpected warning: ", "\"ouch\""]
- matcher = ComplainMatcher.new("ouchy")
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected warning: \"ouchy\"", "but got: \"ouch\""]
- matcher = ComplainMatcher.new(/ou/)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected warning not to match: /ou/", "but got: \"ouch\""]
- end
-end
diff --git a/spec/mspec/spec/matchers/eql_spec.rb b/spec/mspec/spec/matchers/eql_spec.rb
deleted file mode 100644
index 711ebdb679..0000000000
--- a/spec/mspec/spec/matchers/eql_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe EqlMatcher do
- it "matches when actual is eql? to expected" do
- EqlMatcher.new(1).matches?(1).should == true
- EqlMatcher.new(1.5).matches?(1.5).should == true
- EqlMatcher.new("red").matches?("red").should == true
- EqlMatcher.new(:blue).matches?(:blue).should == true
- EqlMatcher.new(Object).matches?(Object).should == true
-
- o = Object.new
- EqlMatcher.new(o).matches?(o).should == true
- end
-
- it "does not match when actual is not eql? to expected" do
- EqlMatcher.new(1).matches?(1.0).should == false
- EqlMatcher.new(Hash).matches?(Object).should == false
- end
-
- it "provides a useful failure message" do
- matcher = EqlMatcher.new("red")
- matcher.matches?("red")
- matcher.failure_message.should == ["Expected \"red\"\n", "to have same value and type as \"red\"\n"]
- end
-
- it "provides a useful negative failure message" do
- matcher = EqlMatcher.new(1)
- matcher.matches?(1.0)
- matcher.negative_failure_message.should == ["Expected 1.0\n", "not to have same value or type as 1\n"]
- end
-end
diff --git a/spec/mspec/spec/matchers/equal_element_spec.rb b/spec/mspec/spec/matchers/equal_element_spec.rb
deleted file mode 100644
index 45b8390364..0000000000
--- a/spec/mspec/spec/matchers/equal_element_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe EqualElementMatcher do
- it "matches if it finds an element with the passed name, no matter what attributes/content" do
- EqualElementMatcher.new("A").matches?('<A></A>').should be_true
- EqualElementMatcher.new("A").matches?('<A HREF="http://example.com"></A>').should be_true
- EqualElementMatcher.new("A").matches?('<A HREF="http://example.com"></A>').should be_true
-
- EqualElementMatcher.new("BASE").matches?('<BASE></A>').should be_false
- EqualElementMatcher.new("BASE").matches?('<A></BASE>').should be_false
- EqualElementMatcher.new("BASE").matches?('<A></A>').should be_false
- EqualElementMatcher.new("BASE").matches?('<A HREF="http://example.com"></A>').should be_false
- EqualElementMatcher.new("BASE").matches?('<A HREF="http://example.com"></A>').should be_false
- end
-
- it "matches if it finds an element with the passed name and the passed attributes" do
- EqualElementMatcher.new("A", {}).matches?('<A></A>').should be_true
- EqualElementMatcher.new("A", nil).matches?('<A HREF="http://example.com"></A>').should be_true
- EqualElementMatcher.new("A", "HREF" => "http://example.com").matches?('<A HREF="http://example.com"></A>').should be_true
-
- EqualElementMatcher.new("A", {}).matches?('<A HREF="http://example.com"></A>').should be_false
- EqualElementMatcher.new("A", "HREF" => "http://example.com").matches?('<A></A>').should be_false
- EqualElementMatcher.new("A", "HREF" => "http://example.com").matches?('<A HREF="http://test.com"></A>').should be_false
- EqualElementMatcher.new("A", "HREF" => "http://example.com").matches?('<A HREF="http://example.com" HREF="http://example.com"></A>').should be_false
- end
-
- it "matches if it finds an element with the passed name, the passed attributes and the passed content" do
- EqualElementMatcher.new("A", {}, "").matches?('<A></A>').should be_true
- EqualElementMatcher.new("A", {"HREF" => "http://example.com"}, "Example").matches?('<A HREF="http://example.com">Example</A>').should be_true
-
- EqualElementMatcher.new("A", {}, "Test").matches?('<A></A>').should be_false
- EqualElementMatcher.new("A", {"HREF" => "http://example.com"}, "Example").matches?('<A HREF="http://example.com"></A>').should be_false
- EqualElementMatcher.new("A", {"HREF" => "http://example.com"}, "Example").matches?('<A HREF="http://example.com">Test</A>').should be_false
- end
-
- it "can match unclosed elements" do
- EqualElementMatcher.new("BASE", nil, nil, :not_closed => true).matches?('<BASE>').should be_true
- EqualElementMatcher.new("BASE", {"HREF" => "http://example.com"}, nil, :not_closed => true).matches?('<BASE HREF="http://example.com">').should be_true
- EqualElementMatcher.new("BASE", {"HREF" => "http://example.com"}, "Example", :not_closed => true).matches?('<BASE HREF="http://example.com">Example').should be_true
-
- EqualElementMatcher.new("BASE", {}, nil, :not_closed => true).matches?('<BASE HREF="http://example.com">').should be_false
- EqualElementMatcher.new("BASE", {"HREF" => "http://example.com"}, "", :not_closed => true).matches?('<BASE HREF="http://example.com">Example').should be_false
- EqualElementMatcher.new("BASE", {"HREF" => "http://example.com"}, "Test", :not_closed => true).matches?('<BASE HREF="http://example.com">Example').should be_false
- end
-
- it "provides a useful failure message" do
- equal_element = EqualElementMatcher.new("A", {}, "Test")
- equal_element.matches?('<A></A>').should be_false
- equal_element.failure_message.should == [%{Expected "<A></A>"\n}, %{to be a 'A' element with no attributes and "Test" as content}]
-
- equal_element = EqualElementMatcher.new("A", {}, "")
- equal_element.matches?('<A>Test</A>').should be_false
- equal_element.failure_message.should == [%{Expected "<A>Test</A>"\n}, %{to be a 'A' element with no attributes and no content}]
-
- equal_element = EqualElementMatcher.new("A", "HREF" => "http://www.example.com")
- equal_element.matches?('<A>Test</A>').should be_false
- equal_element.failure_message.should == [%{Expected "<A>Test</A>"\n}, %{to be a 'A' element with HREF="http://www.example.com" and any content}]
- end
-
- it "provides a useful negative failure message" do
- equal_element = EqualElementMatcher.new("A", {}, "Test")
- equal_element.matches?('<A></A>').should be_false
- equal_element.negative_failure_message.should == [%{Expected "<A></A>"\n}, %{not to be a 'A' element with no attributes and "Test" as content}]
-
- equal_element = EqualElementMatcher.new("A", {}, "")
- equal_element.matches?('<A>Test</A>').should be_false
- equal_element.negative_failure_message.should == [%{Expected "<A>Test</A>"\n}, %{not to be a 'A' element with no attributes and no content}]
-
- equal_element = EqualElementMatcher.new("A", "HREF" => "http://www.example.com")
- equal_element.matches?('<A>Test</A>').should be_false
- equal_element.negative_failure_message.should == [%{Expected "<A>Test</A>"\n}, %{not to be a 'A' element with HREF="http://www.example.com" and any content}]
- end
-end
diff --git a/spec/mspec/spec/matchers/equal_spec.rb b/spec/mspec/spec/matchers/equal_spec.rb
deleted file mode 100644
index ca7bf83fdd..0000000000
--- a/spec/mspec/spec/matchers/equal_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe EqualMatcher do
- it "matches when actual is equal? to expected" do
- EqualMatcher.new(1).matches?(1).should == true
- EqualMatcher.new(:blue).matches?(:blue).should == true
- EqualMatcher.new(Object).matches?(Object).should == true
-
- o = Object.new
- EqualMatcher.new(o).matches?(o).should == true
- end
-
- it "does not match when actual is not a equal? to expected" do
- EqualMatcher.new(1).matches?(1.0).should == false
- EqualMatcher.new("blue").matches?("blue").should == false
- EqualMatcher.new(Hash).matches?(Object).should == false
- end
-
- it "provides a useful failure message" do
- matcher = EqualMatcher.new("red")
- matcher.matches?("red")
- matcher.failure_message.should == ["Expected \"red\"\n", "to be identical to \"red\"\n"]
- end
-
- it "provides a useful negative failure message" do
- matcher = EqualMatcher.new(1)
- matcher.matches?(1)
- matcher.negative_failure_message.should == ["Expected 1\n", "not to be identical to 1\n"]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_class_variable_spec.rb b/spec/mspec/spec/matchers/have_class_variable_spec.rb
deleted file mode 100644
index 01ba9d0f57..0000000000
--- a/spec/mspec/spec/matchers/have_class_variable_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class IVarModMock
- def self.class_variables
- [:@foo]
- end
-end
-
-describe HaveClassVariableMatcher, "on RUBY_VERSION >= 1.9" do
- it "matches when mod has the class variable, given as string" do
- matcher = HaveClassVariableMatcher.new('@foo')
- matcher.matches?(IVarModMock).should be_true
- end
-
- it "matches when mod has the class variable, given as symbol" do
- matcher = HaveClassVariableMatcher.new(:@foo)
- matcher.matches?(IVarModMock).should be_true
- end
-
- it "does not match when mod hasn't got the class variable, given as string" do
- matcher = HaveClassVariableMatcher.new('@bar')
- matcher.matches?(IVarModMock).should be_false
- end
-
- it "does not match when mod hasn't got the class variable, given as symbol" do
- matcher = HaveClassVariableMatcher.new(:@bar)
- matcher.matches?(IVarModMock).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveClassVariableMatcher.new(:@bar)
- matcher.matches?(IVarModMock)
- matcher.failure_message.should == [
- "Expected IVarModMock to have class variable '@bar'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveClassVariableMatcher.new(:@bar)
- matcher.matches?(IVarModMock)
- matcher.negative_failure_message.should == [
- "Expected IVarModMock NOT to have class variable '@bar'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_constant_spec.rb b/spec/mspec/spec/matchers/have_constant_spec.rb
deleted file mode 100644
index 20c5f161d4..0000000000
--- a/spec/mspec/spec/matchers/have_constant_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HCMSpecs
- X = :x
-end
-
-describe HaveConstantMatcher do
- it "matches when mod has the constant" do
- matcher = HaveConstantMatcher.new :X
- matcher.matches?(HCMSpecs).should be_true
- end
-
- it "does not match when mod does not have the constant" do
- matcher = HaveConstantMatcher.new :A
- matcher.matches?(HCMSpecs).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveConstantMatcher.new :A
- matcher.matches?(HCMSpecs)
- matcher.failure_message.should == [
- "Expected HCMSpecs to have constant 'A'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveConstantMatcher.new :X
- matcher.matches?(HCMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HCMSpecs NOT to have constant 'X'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_instance_method_spec.rb b/spec/mspec/spec/matchers/have_instance_method_spec.rb
deleted file mode 100644
index 738f5f875d..0000000000
--- a/spec/mspec/spec/matchers/have_instance_method_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HIMMSpecs
- def instance_method
- end
-
- class Subclass < HIMMSpecs
- def instance_sub_method
- end
- end
-end
-
-describe HaveInstanceMethodMatcher do
- it "inherits from MethodMatcher" do
- HaveInstanceMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the instance method" do
- matcher = HaveInstanceMethodMatcher.new :instance_method
- matcher.matches?(HIMMSpecs).should be_true
- matcher.matches?(HIMMSpecs::Subclass).should be_true
- end
-
- it "does not match when mod does not have the instance method" do
- matcher = HaveInstanceMethodMatcher.new :another_method
- matcher.matches?(HIMMSpecs).should be_false
- end
-
- it "does not match if the method is in a superclass and include_super is false" do
- matcher = HaveInstanceMethodMatcher.new :instance_method, false
- matcher.matches?(HIMMSpecs::Subclass).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveInstanceMethodMatcher.new :some_method
- matcher.matches?(HIMMSpecs)
- matcher.failure_message.should == [
- "Expected HIMMSpecs to have instance method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveInstanceMethodMatcher.new :some_method
- matcher.matches?(HIMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HIMMSpecs NOT to have instance method 'some_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_instance_variable_spec.rb b/spec/mspec/spec/matchers/have_instance_variable_spec.rb
deleted file mode 100644
index 4122c6551b..0000000000
--- a/spec/mspec/spec/matchers/have_instance_variable_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe HaveInstanceVariableMatcher do
- before :each do
- @object = Object.new
- def @object.instance_variables
- [:@foo]
- end
- end
-
- it "matches when object has the instance variable, given as string" do
- matcher = HaveInstanceVariableMatcher.new('@foo')
- matcher.matches?(@object).should be_true
- end
-
- it "matches when object has the instance variable, given as symbol" do
- matcher = HaveInstanceVariableMatcher.new(:@foo)
- matcher.matches?(@object).should be_true
- end
-
- it "does not match when object hasn't got the instance variable, given as string" do
- matcher = HaveInstanceVariableMatcher.new('@bar')
- matcher.matches?(@object).should be_false
- end
-
- it "does not match when object hasn't got the instance variable, given as symbol" do
- matcher = HaveInstanceVariableMatcher.new(:@bar)
- matcher.matches?(@object).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveInstanceVariableMatcher.new(:@bar)
- matcher.matches?(@object)
- matcher.failure_message.should == [
- "Expected #{@object.inspect} to have instance variable '@bar'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveInstanceVariableMatcher.new(:@bar)
- matcher.matches?(@object)
- matcher.negative_failure_message.should == [
- "Expected #{@object.inspect} NOT to have instance variable '@bar'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_method_spec.rb b/spec/mspec/spec/matchers/have_method_spec.rb
deleted file mode 100644
index 41bd485119..0000000000
--- a/spec/mspec/spec/matchers/have_method_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HMMSpecs
- def instance_method
- end
-
- class Subclass < HMMSpecs
- def instance_sub_method
- end
- end
-end
-
-describe HaveMethodMatcher do
- it "inherits from MethodMatcher" do
- HaveMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the method" do
- matcher = HaveMethodMatcher.new :instance_method
- matcher.matches?(HMMSpecs).should be_true
- matcher.matches?(HMMSpecs.new).should be_true
- matcher.matches?(HMMSpecs::Subclass).should be_true
- matcher.matches?(HMMSpecs::Subclass.new).should be_true
- end
-
- it "does not match when mod does not have the method" do
- matcher = HaveMethodMatcher.new :another_method
- matcher.matches?(HMMSpecs).should be_false
- end
-
- it "does not match if the method is in a superclass and include_super is false" do
- matcher = HaveMethodMatcher.new :instance_method, false
- matcher.matches?(HMMSpecs::Subclass).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveMethodMatcher.new :some_method
- matcher.matches?(HMMSpecs)
- matcher.failure_message.should == [
- "Expected HMMSpecs to have method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveMethodMatcher.new :some_method
- matcher.matches?(HMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HMMSpecs NOT to have method 'some_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_private_instance_method_spec.rb b/spec/mspec/spec/matchers/have_private_instance_method_spec.rb
deleted file mode 100644
index 827c6b6034..0000000000
--- a/spec/mspec/spec/matchers/have_private_instance_method_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HPIMMSpecs
- private
-
- def private_method
- end
-
- class Subclass < HPIMMSpecs
- private
-
- def private_sub_method
- end
- end
-end
-
-describe HavePrivateInstanceMethodMatcher do
- it "inherits from MethodMatcher" do
- HavePrivateInstanceMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the private instance method" do
- matcher = HavePrivateInstanceMethodMatcher.new :private_method
- matcher.matches?(HPIMMSpecs).should be_true
- matcher.matches?(HPIMMSpecs::Subclass).should be_true
- end
-
- it "does not match when mod does not have the private instance method" do
- matcher = HavePrivateInstanceMethodMatcher.new :another_method
- matcher.matches?(HPIMMSpecs).should be_false
- end
-
- it "does not match if the method is in a superclass and include_super is false" do
- matcher = HavePrivateInstanceMethodMatcher.new :private_method, false
- matcher.matches?(HPIMMSpecs::Subclass).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HavePrivateInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.failure_message.should == [
- "Expected HPIMMSpecs to have private instance method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure message for #should_not" do
- matcher = HavePrivateInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HPIMMSpecs NOT to have private instance method 'some_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_private_method_spec.rb b/spec/mspec/spec/matchers/have_private_method_spec.rb
deleted file mode 100644
index e63a9a3c2f..0000000000
--- a/spec/mspec/spec/matchers/have_private_method_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HPMMSpecs
- def self.private_method
- end
-
- private_class_method :private_method
-end
-
-describe HavePrivateMethodMatcher do
- it "inherits from MethodMatcher" do
- HavePrivateMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the private method" do
- matcher = HavePrivateMethodMatcher.new :private_method
- matcher.matches?(HPMMSpecs).should be_true
- end
-
- it "does not match when mod does not have the private method" do
- matcher = HavePrivateMethodMatcher.new :another_method
- matcher.matches?(HPMMSpecs).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HavePrivateMethodMatcher.new :some_method
- matcher.matches?(HPMMSpecs)
- matcher.failure_message.should == [
- "Expected HPMMSpecs to have private method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure message for #should_not" do
- matcher = HavePrivateMethodMatcher.new :private_method
- matcher.matches?(HPMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HPMMSpecs NOT to have private method 'private_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_protected_instance_method_spec.rb b/spec/mspec/spec/matchers/have_protected_instance_method_spec.rb
deleted file mode 100644
index 460d0368fb..0000000000
--- a/spec/mspec/spec/matchers/have_protected_instance_method_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HPIMMSpecs
- protected
-
- def protected_method
- end
-
- class Subclass < HPIMMSpecs
- protected
-
- def protected_sub_method
- end
- end
-end
-
-describe HaveProtectedInstanceMethodMatcher do
- it "inherits from MethodMatcher" do
- HaveProtectedInstanceMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the protected instance method" do
- matcher = HaveProtectedInstanceMethodMatcher.new :protected_method
- matcher.matches?(HPIMMSpecs).should be_true
- matcher.matches?(HPIMMSpecs::Subclass).should be_true
- end
-
- it "does not match when mod does not have the protected instance method" do
- matcher = HaveProtectedInstanceMethodMatcher.new :another_method
- matcher.matches?(HPIMMSpecs).should be_false
- end
-
- it "does not match if the method is in a superclass and include_super is false" do
- matcher = HaveProtectedInstanceMethodMatcher.new :protected_method, false
- matcher.matches?(HPIMMSpecs::Subclass).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HaveProtectedInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.failure_message.should == [
- "Expected HPIMMSpecs to have protected instance method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HaveProtectedInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HPIMMSpecs NOT to have protected instance method 'some_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_public_instance_method_spec.rb b/spec/mspec/spec/matchers/have_public_instance_method_spec.rb
deleted file mode 100644
index bff1046f04..0000000000
--- a/spec/mspec/spec/matchers/have_public_instance_method_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HPIMMSpecs
- def public_method
- end
-
- class Subclass < HPIMMSpecs
- def public_sub_method
- end
- end
-end
-
-describe HavePublicInstanceMethodMatcher do
- it "inherits from MethodMatcher" do
- HavePublicInstanceMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when mod has the public instance method" do
- matcher = HavePublicInstanceMethodMatcher.new :public_method
- matcher.matches?(HPIMMSpecs).should be_true
- matcher.matches?(HPIMMSpecs::Subclass).should be_true
- end
-
- it "does not match when mod does not have the public instance method" do
- matcher = HavePublicInstanceMethodMatcher.new :another_method
- matcher.matches?(HPIMMSpecs).should be_false
- end
-
- it "does not match if the method is in a superclass and include_super is false" do
- matcher = HavePublicInstanceMethodMatcher.new :public_method, false
- matcher.matches?(HPIMMSpecs::Subclass).should be_false
- end
-
- it "provides a failure message for #should" do
- matcher = HavePublicInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.failure_message.should == [
- "Expected HPIMMSpecs to have public instance method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure messoge for #should_not" do
- matcher = HavePublicInstanceMethodMatcher.new :some_method
- matcher.matches?(HPIMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HPIMMSpecs NOT to have public instance method 'some_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/have_singleton_method_spec.rb b/spec/mspec/spec/matchers/have_singleton_method_spec.rb
deleted file mode 100644
index 57c37e01d9..0000000000
--- a/spec/mspec/spec/matchers/have_singleton_method_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class HSMMSpecs
- def self.singleton_method
- end
-end
-
-describe HaveSingletonMethodMatcher do
- it "inherits from MethodMatcher" do
- HaveSingletonMethodMatcher.new(:m).should be_kind_of(MethodMatcher)
- end
-
- it "matches when the class has a singleton method" do
- matcher = HaveSingletonMethodMatcher.new :singleton_method
- matcher.matches?(HSMMSpecs).should be_true
- end
-
- it "matches when the object has a singleton method" do
- obj = double("HSMMSpecs")
- def obj.singleton_method; end
-
- matcher = HaveSingletonMethodMatcher.new :singleton_method
- matcher.matches?(obj).should be_true
- end
-
- it "provides a failure message for #should" do
- matcher = HaveSingletonMethodMatcher.new :some_method
- matcher.matches?(HSMMSpecs)
- matcher.failure_message.should == [
- "Expected HSMMSpecs to have singleton method 'some_method'",
- "but it does not"
- ]
- end
-
- it "provides a failure message for #should_not" do
- matcher = HaveSingletonMethodMatcher.new :singleton_method
- matcher.matches?(HSMMSpecs)
- matcher.negative_failure_message.should == [
- "Expected HSMMSpecs NOT to have singleton method 'singleton_method'",
- "but it does"
- ]
- end
-end
diff --git a/spec/mspec/spec/matchers/include_spec.rb b/spec/mspec/spec/matchers/include_spec.rb
deleted file mode 100644
index f045c5e0cb..0000000000
--- a/spec/mspec/spec/matchers/include_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe IncludeMatcher do
- it "matches when actual includes expected" do
- IncludeMatcher.new(2).matches?([1,2,3]).should == true
- IncludeMatcher.new("b").matches?("abc").should == true
- end
-
- it "does not match when actual does not include expected" do
- IncludeMatcher.new(4).matches?([1,2,3]).should == false
- IncludeMatcher.new("d").matches?("abc").should == false
- end
-
- it "matches when actual includes all expected" do
- IncludeMatcher.new(3, 2, 1).matches?([1,2,3]).should == true
- IncludeMatcher.new("a", "b", "c").matches?("abc").should == true
- end
-
- it "does not match when actual does not include all expected" do
- IncludeMatcher.new(3, 2, 4).matches?([1,2,3]).should == false
- IncludeMatcher.new("a", "b", "c", "d").matches?("abc").should == false
- end
-
- it "provides a useful failure message" do
- matcher = IncludeMatcher.new(5, 2)
- matcher.matches?([1,2,3])
- matcher.failure_message.should == ["Expected [1, 2, 3]", "to include 5"]
- end
-
- it "provides a useful negative failure message" do
- matcher = IncludeMatcher.new(1, 2, 3)
- matcher.matches?([1,2,3])
- matcher.negative_failure_message.should == ["Expected [1, 2, 3]", "not to include 3"]
- end
-end
diff --git a/spec/mspec/spec/matchers/infinity_spec.rb b/spec/mspec/spec/matchers/infinity_spec.rb
deleted file mode 100644
index 6eb8ac2940..0000000000
--- a/spec/mspec/spec/matchers/infinity_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/guards'
-require 'mspec/helpers'
-require 'mspec/matchers'
-
-describe InfinityMatcher do
- it "matches when actual is infinite and has the correct sign" do
- InfinityMatcher.new(1).matches?(infinity_value).should == true
- InfinityMatcher.new(-1).matches?(-infinity_value).should == true
- end
-
- it "does not match when actual is not infinite" do
- InfinityMatcher.new(1).matches?(1.0).should == false
- InfinityMatcher.new(-1).matches?(-1.0).should == false
- end
-
- it "does not match when actual is infinite but has the incorrect sign" do
- InfinityMatcher.new(1).matches?(-infinity_value).should == false
- InfinityMatcher.new(-1).matches?(infinity_value).should == false
- end
-
- it "provides a useful failure message" do
- matcher = InfinityMatcher.new(-1)
- matcher.matches?(0)
- matcher.failure_message.should == ["Expected 0", "to be -Infinity"]
- end
-
- it "provides a useful negative failure message" do
- matcher = InfinityMatcher.new(1)
- matcher.matches?(infinity_value)
- matcher.negative_failure_message.should == ["Expected Infinity", "not to be Infinity"]
- end
-end
diff --git a/spec/mspec/spec/matchers/match_yaml_spec.rb b/spec/mspec/spec/matchers/match_yaml_spec.rb
deleted file mode 100644
index 4f16aee0ec..0000000000
--- a/spec/mspec/spec/matchers/match_yaml_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe MatchYAMLMatcher do
- before :each do
- @matcher = MatchYAMLMatcher.new("--- \nfoo: bar\n")
- end
-
- it "compares YAML documents and matches if they're equivalent" do
- @matcher.matches?("--- \nfoo: bar\n").should == true
- end
-
- it "compares YAML documents and does not match if they're not equivalent" do
- @matcher.matches?("--- \nbar: foo\n").should == false
- @matcher.matches?("--- \nfoo: \nbar\n").should == false
- end
-
- it "also receives objects that respond_to to_yaml" do
- matcher = MatchYAMLMatcher.new("some string")
- matcher.matches?("some string").should == true
-
- matcher = MatchYAMLMatcher.new(['a', 'b'])
- matcher.matches?("--- \n- a\n- b\n").should == true
-
- matcher = MatchYAMLMatcher.new("foo" => "bar")
- matcher.matches?("--- \nfoo: bar\n").should == true
- end
-
- it "matches documents with trailing whitespace" do
- @matcher.matches?("--- \nfoo: bar \n").should == true
- @matcher.matches?("--- \nfoo: bar \n").should == true
- end
-
- it "fails with a descriptive error message" do
- @matcher.matches?("foo").should == false
- @matcher.failure_message.should == ["Expected \"foo\"", " to match \"--- \\nfoo: bar\\n\""]
- end
-end
diff --git a/spec/mspec/spec/matchers/output_spec.rb b/spec/mspec/spec/matchers/output_spec.rb
deleted file mode 100644
index 264da3b569..0000000000
--- a/spec/mspec/spec/matchers/output_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe OutputMatcher do
- it "matches when executing the proc results in the expected output to $stdout" do
- proc = Proc.new { puts "bang!" }
- OutputMatcher.new("bang!\n", nil).matches?(proc).should == true
- OutputMatcher.new("pop", nil).matches?(proc).should == false
- OutputMatcher.new(/bang/, nil).matches?(proc).should == true
- OutputMatcher.new(/po/, nil).matches?(proc).should == false
- end
-
- it "matches when executing the proc results in the expected output to $stderr" do
- proc = Proc.new { $stderr.write "boom!" }
- OutputMatcher.new(nil, "boom!").matches?(proc).should == true
- OutputMatcher.new(nil, "fizzle").matches?(proc).should == false
- OutputMatcher.new(nil, /boom/).matches?(proc).should == true
- OutputMatcher.new(nil, /fizzl/).matches?(proc).should == false
- end
-
- it "provides a useful failure message" do
- proc = Proc.new { print "unexpected"; $stderr.print "unerror" }
- matcher = OutputMatcher.new("expected", "error")
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected:\n $stdout: \"expected\"\n $stderr: \"error\"\n",
- " got:\n $stdout: \"unexpected\"\n $stderr: \"unerror\"\n"]
- matcher = OutputMatcher.new("expected", nil)
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected:\n $stdout: \"expected\"\n",
- " got:\n $stdout: \"unexpected\"\n"]
- matcher = OutputMatcher.new(nil, "error")
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected:\n $stderr: \"error\"\n",
- " got:\n $stderr: \"unerror\"\n"]
- matcher = OutputMatcher.new(/base/, nil)
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected:\n $stdout: /base/\n",
- " got:\n $stdout: \"unexpected\"\n"]
- matcher = OutputMatcher.new(nil, /octave/)
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected:\n $stderr: /octave/\n",
- " got:\n $stderr: \"unerror\"\n"]
- end
-
- it "provides a useful negative failure message" do
- proc = Proc.new { puts "expected"; $stderr.puts "error" }
- matcher = OutputMatcher.new("expected", "error")
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected output not to be:\n", " $stdout: \"expected\"\n $stderr: \"error\"\n"]
- matcher = OutputMatcher.new("expected", nil)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected output not to be:\n", " $stdout: \"expected\"\n"]
- matcher = OutputMatcher.new(nil, "error")
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected output not to be:\n", " $stderr: \"error\"\n"]
- matcher = OutputMatcher.new(/expect/, nil)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected output not to be:\n", " $stdout: \"expected\"\n"]
- matcher = OutputMatcher.new(nil, /err/)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected output not to be:\n", " $stderr: \"error\"\n"]
- end
-end
diff --git a/spec/mspec/spec/matchers/output_to_fd_spec.rb b/spec/mspec/spec/matchers/output_to_fd_spec.rb
deleted file mode 100644
index e584c4e003..0000000000
--- a/spec/mspec/spec/matchers/output_to_fd_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe OutputToFDMatcher do
- # Figure out how in the hell to achieve this
- it "matches when running the block produces the expected output to the given FD" do
- OutputToFDMatcher.new("Hi\n", STDERR).matches?(lambda { $stderr.print "Hi\n" }).should == true
- end
-
- it "does not match if running the block does not produce the expected output to the FD" do
- OutputToFDMatcher.new("Hi\n", STDERR).matches?(lambda { $stderr.puts("Hello\n") }).should == false
- end
-
- it "propagate the exception if one is thrown while matching" do
- exc = RuntimeError.new("propagates")
- lambda {
- OutputToFDMatcher.new("Hi\n", STDERR).matches?(lambda {
- raise exc
- }).should == false
- }.should raise_error(exc)
- end
-
- it "defaults to matching against STDOUT" do
- object = Object.new
- object.extend MSpecMatchers
- object.send(:output_to_fd, "Hi\n").matches?(lambda { $stdout.print "Hi\n" }).should == true
- end
-
- it "accepts any IO instance" do
- io = IO.new STDOUT.fileno
- OutputToFDMatcher.new("Hi\n", io).matches?(lambda { io.print "Hi\n" }).should == true
- end
-
- it "allows matching with a Regexp" do
- s = "Hi there\n"
- OutputToFDMatcher.new(/Hi/, STDERR).matches?(lambda { $stderr.print s }).should == true
- OutputToFDMatcher.new(/Hi?/, STDERR).matches?(lambda { $stderr.print s }).should == true
- OutputToFDMatcher.new(/[hH]i?/, STDERR).matches?(lambda { $stderr.print s }).should == true
- OutputToFDMatcher.new(/.*/, STDERR).matches?(lambda { $stderr.print s }).should == true
- OutputToFDMatcher.new(/H.*?here/, STDERR).matches?(lambda { $stderr.print s }).should == true
- OutputToFDMatcher.new(/Ahoy/, STDERR).matches?(lambda { $stderr.print s }).should == false
- end
-end
diff --git a/spec/mspec/spec/matchers/raise_error_spec.rb b/spec/mspec/spec/matchers/raise_error_spec.rb
deleted file mode 100644
index 7c93f0f64c..0000000000
--- a/spec/mspec/spec/matchers/raise_error_spec.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-class ExpectedException < Exception; end
-class UnexpectedException < Exception; end
-
-describe RaiseErrorMatcher do
- it "matches when the proc raises the expected exception" do
- proc = Proc.new { raise ExpectedException }
- matcher = RaiseErrorMatcher.new(ExpectedException, nil)
- matcher.matches?(proc).should == true
- end
-
- it "executes it's optional block if matched" do
- run = false
- proc = Proc.new { raise ExpectedException }
- matcher = RaiseErrorMatcher.new(ExpectedException, nil) { |error|
- run = true
- error.class.should == ExpectedException
- }
-
- matcher.matches?(proc).should == true
- run.should == true
- end
-
- it "matches when the proc raises the expected exception with the expected message" do
- proc = Proc.new { raise ExpectedException, "message" }
- matcher = RaiseErrorMatcher.new(ExpectedException, "message")
- matcher.matches?(proc).should == true
- end
-
- it "matches when the proc raises the expected exception with a matching message" do
- proc = Proc.new { raise ExpectedException, "some message" }
- matcher = RaiseErrorMatcher.new(ExpectedException, /some/)
- matcher.matches?(proc).should == true
- end
-
- it "does not match when the proc does not raise the expected exception" do
- exc = UnexpectedException.new
- matcher = RaiseErrorMatcher.new(ExpectedException, nil)
-
- matcher.matching_exception?(exc).should == false
- lambda {
- matcher.matches?(Proc.new { raise exc })
- }.should raise_error(UnexpectedException)
- end
-
- it "does not match when the proc raises the expected exception with an unexpected message" do
- exc = ExpectedException.new("unexpected")
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
-
- matcher.matching_exception?(exc).should == false
- lambda {
- matcher.matches?(Proc.new { raise exc })
- }.should raise_error(ExpectedException)
- end
-
- it "does not match when the proc does not raise an exception" do
- proc = Proc.new {}
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
- matcher.matches?(proc).should == false
- end
-
- it "provides a useful failure message" do
- exc = UnexpectedException.new("unexpected")
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
-
- matcher.matching_exception?(exc).should == false
- lambda {
- matcher.matches?(Proc.new { raise exc })
- }.should raise_error(UnexpectedException)
- matcher.failure_message.should ==
- ["Expected ExpectedException (expected)", "but got UnexpectedException (unexpected)"]
- end
-
- it "provides a useful failure message when no exception is raised" do
- proc = Proc.new { 120 }
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected ExpectedException (expected)", "but no exception was raised (120 was returned)"]
- end
-
- it "provides a useful failure message when no exception is raised and nil is returned" do
- proc = Proc.new { nil }
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected ExpectedException (expected)", "but no exception was raised (nil was returned)"]
- end
-
- it "provides a useful failure message when no exception is raised and the result raises in #pretty_inspect" do
- result = Object.new
- def result.pretty_inspect
- raise ArgumentError, "bad"
- end
- proc = Proc.new { result }
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
- matcher.matches?(proc)
- matcher.failure_message.should ==
- ["Expected ExpectedException (expected)", "but no exception was raised (#pretty_inspect raised ArgumentError; A #<Object> was returned)"]
- end
-
- it "provides a useful negative failure message" do
- proc = Proc.new { raise ExpectedException, "expected" }
- matcher = RaiseErrorMatcher.new(ExpectedException, "expected")
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected to not get ExpectedException (expected)", ""]
- end
-
- it "provides a useful negative failure message for strict subclasses of the matched exception class" do
- proc = Proc.new { raise UnexpectedException, "unexpected" }
- matcher = RaiseErrorMatcher.new(Exception, nil)
- matcher.matches?(proc)
- matcher.negative_failure_message.should ==
- ["Expected to not get Exception", "but got UnexpectedException (unexpected)"]
- end
-end
diff --git a/spec/mspec/spec/matchers/respond_to_spec.rb b/spec/mspec/spec/matchers/respond_to_spec.rb
deleted file mode 100644
index 988caf4dff..0000000000
--- a/spec/mspec/spec/matchers/respond_to_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe RespondToMatcher do
- it "matches when actual does respond_to? expected" do
- RespondToMatcher.new(:to_s).matches?(Object.new).should == true
- RespondToMatcher.new(:inject).matches?([]).should == true
- RespondToMatcher.new(:[]).matches?(1).should == true
- RespondToMatcher.new(:[]=).matches?("string").should == true
- end
-
- it "does not match when actual does not respond_to? expected" do
- RespondToMatcher.new(:to_i).matches?(Object.new).should == false
- RespondToMatcher.new(:inject).matches?(1).should == false
- RespondToMatcher.new(:non_existent_method).matches?([]).should == false
- RespondToMatcher.new(:[]=).matches?(1).should == false
- end
-
- it "provides a useful failure message" do
- matcher = RespondToMatcher.new(:non_existent_method)
- matcher.matches?('string')
- matcher.failure_message.should == [
- "Expected \"string\" (String)", "to respond to non_existent_method"]
- end
-
- it "provides a useful negative failure message" do
- matcher = RespondToMatcher.new(:to_i)
- matcher.matches?(4.0)
- matcher.negative_failure_message.should == [
- "Expected 4.0 (Float)", "not to respond to to_i"]
- end
-end
diff --git a/spec/mspec/spec/matchers/signed_zero_spec.rb b/spec/mspec/spec/matchers/signed_zero_spec.rb
deleted file mode 100644
index 9c5c50c602..0000000000
--- a/spec/mspec/spec/matchers/signed_zero_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers'
-
-describe SignedZeroMatcher do
- it "matches when actual is zero and has the correct sign" do
- SignedZeroMatcher.new(1).matches?(0.0).should == true
- SignedZeroMatcher.new(-1).matches?(-0.0).should == true
- end
-
- it "does not match when actual is non-zero" do
- SignedZeroMatcher.new(1).matches?(1.0).should == false
- SignedZeroMatcher.new(-1).matches?(-1.0).should == false
- end
-
- it "does not match when actual is zero but has the incorrect sign" do
- SignedZeroMatcher.new(1).matches?(-0.0).should == false
- SignedZeroMatcher.new(-1).matches?(0.0).should == false
- end
-
- it "provides a useful failure message" do
- matcher = SignedZeroMatcher.new(-1)
- matcher.matches?(0.0)
- matcher.failure_message.should == ["Expected 0.0", "to be -0.0"]
- end
-
- it "provides a useful negative failure message" do
- matcher = SignedZeroMatcher.new(-1)
- matcher.matches?(-0.0)
- matcher.negative_failure_message.should == ["Expected -0.0", "not to be -0.0"]
- end
-end
diff --git a/spec/mspec/spec/mocks/mock_spec.rb b/spec/mspec/spec/mocks/mock_spec.rb
deleted file mode 100644
index c814ec7bfe..0000000000
--- a/spec/mspec/spec/mocks/mock_spec.rb
+++ /dev/null
@@ -1,467 +0,0 @@
-# This is a bit awkward. Currently the way to verify that the
-# opposites are true (for example a failure when the specified
-# arguments are NOT provided) is to simply alter the particular
-# spec to a failure condition.
-require 'spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/mocks/mock'
-require 'mspec/mocks/proxy'
-
-describe Mock, ".mocks" do
- it "returns a Hash" do
- Mock.mocks.should be_kind_of(Hash)
- end
-end
-
-describe Mock, ".stubs" do
- it "returns a Hash" do
- Mock.stubs.should be_kind_of(Hash)
- end
-end
-
-describe Mock, ".replaced_name" do
- it "returns the name for a method that is being replaced by a mock method" do
- m = double('a fake id')
- Mock.replaced_name(m, :method_call).should == :"__mspec_#{m.object_id}_method_call__"
- end
-end
-
-describe Mock, ".replaced_key" do
- it "returns a key used internally by Mock" do
- m = double('a fake id')
- Mock.replaced_key(m, :method_call).should == [:"__mspec_#{m.object_id}_method_call__", :method_call]
- end
-end
-
-describe Mock, ".replaced?" do
- before :each do
- @mock = double('install_method')
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
- end
-
- it "returns true if a method has been stubbed on an object" do
- Mock.install_method @mock, :method_call
- Mock.replaced?(Mock.replaced_name(@mock, :method_call)).should be_true
- end
-
- it "returns true if a method has been mocked on an object" do
- Mock.install_method @mock, :method_call, :stub
- Mock.replaced?(Mock.replaced_name(@mock, :method_call)).should be_true
- end
-
- it "returns false if a method has not been stubbed or mocked" do
- Mock.replaced?(Mock.replaced_name(@mock, :method_call)).should be_false
- end
-end
-
-describe Mock, ".name_or_inspect" do
- before :each do
- @mock = double("I have a #name")
- end
-
- it "returns the value of @name if set" do
- @mock.instance_variable_set(:@name, "Myself")
- Mock.name_or_inspect(@mock).should == "Myself"
- end
-end
-
-describe Mock, ".install_method for mocks" do
- before :each do
- @mock = double('install_method')
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "returns a MockProxy instance" do
- Mock.install_method(@mock, :method_call).should be_an_instance_of(MockProxy)
- end
-
- it "does not override a previously mocked method with the same name" do
- Mock.install_method(@mock, :method_call).with(:a, :b).and_return(1)
- Mock.install_method(@mock, :method_call).with(:c).and_return(2)
- @mock.method_call(:a, :b)
- @mock.method_call(:c)
- lambda { @mock.method_call(:d) }.should raise_error(SpecExpectationNotMetError)
- end
-
- # This illustrates RSpec's behavior. This spec fails in mock call count verification
- # on RSpec (i.e. Mock 'foo' expected :foo with (any args) once, but received it 0 times)
- # and we mimic the behavior of RSpec.
- #
- # describe "A mock receiving multiple calls to #should_receive" do
- # it "returns the first value mocked" do
- # m = mock 'multiple #should_receive'
- # m.should_receive(:foo).and_return(true)
- # m.foo.should == true
- # m.should_receive(:foo).and_return(false)
- # m.foo.should == true
- # end
- # end
- #
- it "does not override a previously mocked method having the same arguments" do
- Mock.install_method(@mock, :method_call).with(:a).and_return(true)
- @mock.method_call(:a).should == true
- Mock.install_method(@mock, :method_call).with(:a).and_return(false)
- @mock.method_call(:a).should == true
- lambda { Mock.verify_count }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "properly sends #respond_to? calls to the aliased respond_to? method when not matching mock expectations" do
- Mock.install_method(@mock, :respond_to?).with(:to_str).and_return('mock to_str')
- Mock.install_method(@mock, :respond_to?).with(:to_int).and_return('mock to_int')
- @mock.respond_to?(:to_str).should == 'mock to_str'
- @mock.respond_to?(:to_int).should == 'mock to_int'
- @mock.respond_to?(:to_s).should == true
- @mock.respond_to?(:not_really_a_real_method_seriously).should == false
- end
-
- it "adds to the expectation tally" do
- state = double("run state").as_null_object
- state.stub(:state).and_return(double("spec state"))
- MSpec.should_receive(:current).and_return(state)
- MSpec.should_receive(:actions).with(:expectation, state.state)
- Mock.install_method(@mock, :method_call).and_return(1)
- @mock.method_call.should == 1
- end
-
- it "registers that an expectation has been encountered" do
- state = double("run state").as_null_object
- state.stub(:state).and_return(double("spec state"))
- MSpec.should_receive(:expectation)
- Mock.install_method(@mock, :method_call).and_return(1)
- @mock.method_call.should == 1
- end
-end
-
-describe Mock, ".install_method for stubs" do
- before :each do
- @mock = double('install_method')
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "returns a MockProxy instance" do
- Mock.install_method(@mock, :method_call, :stub).should be_an_instance_of(MockProxy)
- end
-
- # This illustrates RSpec's behavior. This spec passes on RSpec and we mimic it
- #
- # describe "A mock receiving multiple calls to #stub" do
- # it "returns the last value stubbed" do
- # m = mock 'multiple #stub'
- # m.stub(:foo).and_return(true)
- # m.foo.should == true
- # m.stub(:foo).and_return(false)
- # m.foo.should == false
- # end
- # end
- it "inserts new stubs before old stubs" do
- Mock.install_method(@mock, :method_call, :stub).with(:a).and_return(true)
- @mock.method_call(:a).should == true
- Mock.install_method(@mock, :method_call, :stub).with(:a).and_return(false)
- @mock.method_call(:a).should == false
- Mock.verify_count
- end
-
- it "does not add to the expectation tally" do
- state = double("run state").as_null_object
- state.stub(:state).and_return(double("spec state"))
- MSpec.should_not_receive(:actions)
- Mock.install_method(@mock, :method_call, :stub).and_return(1)
- @mock.method_call.should == 1
- end
-end
-
-describe Mock, ".install_method" do
- before :each do
- @mock = double('install_method')
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "does not alias a mocked or stubbed method when installing a new mock or stub" do
- @mock.should_not respond_to(:method_call)
-
- Mock.install_method @mock, :method_call
- @mock.should respond_to(:method_call)
- @mock.should_not respond_to(Mock.replaced_name(@mock, :method_call))
-
- Mock.install_method @mock, :method_call, :stub
- @mock.should respond_to(:method_call)
- @mock.should_not respond_to(Mock.replaced_name(@mock, :method_call))
- end
-end
-
-class MockAndRaiseError < Exception; end
-
-describe Mock, ".verify_call" do
- before :each do
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
-
- @mock = double('verify_call')
- @proxy = Mock.install_method @mock, :method_call
- end
-
- after :each do
- ScratchPad.clear
- Mock.cleanup
- end
-
- it "does not raise an exception when the mock method receives the expected arguments" do
- @proxy.with(1, 'two', :three)
- Mock.verify_call @mock, :method_call, 1, 'two', :three
- end
-
- it "raises an SpecExpectationNotMetError when the mock method does not receive the expected arguments" do
- @proxy.with(4, 2)
- lambda {
- Mock.verify_call @mock, :method_call, 42
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "raises an SpecExpectationNotMetError when the mock method is called with arguments but expects none" do
- lambda {
- @proxy.with(:no_args)
- Mock.verify_call @mock, :method_call, "hello"
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "raises an SpecExpectationNotMetError when the mock method is called with no arguments but expects some" do
- @proxy.with("hello", "beautiful", "world")
- lambda {
- Mock.verify_call @mock, :method_call
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "does not raise an exception when the mock method is called with arguments and is expecting :any_args" do
- @proxy.with(:any_args)
- Mock.verify_call @mock, :method_call, 1, 2, 3
- end
-
- it "yields a passed block when it is expected to" do
- @proxy.and_yield()
- Mock.verify_call @mock, :method_call do
- ScratchPad.record true
- end
- ScratchPad.recorded.should == true
- end
-
- it "does not yield a passed block when it is not expected to" do
- Mock.verify_call @mock, :method_call do
- ScratchPad.record true
- end
- ScratchPad.recorded.should == nil
- end
-
- it "can yield subsequently" do
- @proxy.and_yield(1).and_yield(2).and_yield(3)
-
- ScratchPad.record []
- Mock.verify_call @mock, :method_call do |arg|
- ScratchPad << arg
- end
- ScratchPad.recorded.should == [1, 2, 3]
- end
-
- it "can yield and return an expected value" do
- @proxy.and_yield(1).and_return(3)
-
- Mock.verify_call(@mock, :method_call) { |arg| ScratchPad.record arg }.should == 3
- ScratchPad.recorded.should == 1
- end
-
- it "raises an exception when it is expected to yield but no block is given" do
- @proxy.and_yield(1, 2, 3)
- lambda {
- Mock.verify_call(@mock, :method_call)
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "raises an exception when it is expected to yield more arguments than the block can take" do
- @proxy.and_yield(1, 2, 3)
- lambda {
- Mock.verify_call(@mock, :method_call) {|a, b|}
- }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "does not raise an exception when it is expected to yield to a block that can take any number of arguments" do
- @proxy.and_yield(1, 2, 3)
- expect {
- Mock.verify_call(@mock, :method_call) {|*a|}
- }.not_to raise_error
- end
-
- it "raises an exception when expected to" do
- @proxy.and_raise(MockAndRaiseError)
- lambda {
- Mock.verify_call @mock, :method_call
- }.should raise_error(MockAndRaiseError)
- end
-end
-
-describe Mock, ".verify_count" do
- before :each do
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
-
- @mock = double('verify_count')
- @proxy = Mock.install_method @mock, :method_call
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "does not raise an exception when the mock receives at least the expected number of calls" do
- @proxy.at_least(2)
- @mock.method_call
- @mock.method_call
- Mock.verify_count
- end
-
- it "raises an SpecExpectationNotMetError when the mock receives less than at least the expected number of calls" do
- @proxy.at_least(2)
- @mock.method_call
- lambda { Mock.verify_count }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "does not raise an exception when the mock receives at most the expected number of calls" do
- @proxy.at_most(2)
- @mock.method_call
- @mock.method_call
- Mock.verify_count
- end
-
- it "raises an SpecExpectationNotMetError when the mock receives more than at most the expected number of calls" do
- @proxy.at_most(2)
- @mock.method_call
- @mock.method_call
- @mock.method_call
- lambda { Mock.verify_count }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "does not raise an exception when the mock receives exactly the expected number of calls" do
- @proxy.exactly(2)
- @mock.method_call
- @mock.method_call
- Mock.verify_count
- end
-
- it "raises an SpecExpectationNotMetError when the mock receives less than exactly the expected number of calls" do
- @proxy.exactly(2)
- @mock.method_call
- lambda { Mock.verify_count }.should raise_error(SpecExpectationNotMetError)
- end
-
- it "raises an SpecExpectationNotMetError when the mock receives more than exactly the expected number of calls" do
- @proxy.exactly(2)
- @mock.method_call
- @mock.method_call
- @mock.method_call
- lambda { Mock.verify_count }.should raise_error(SpecExpectationNotMetError)
- end
-end
-
-describe Mock, ".verify_count mixing mocks and stubs" do
- before :each do
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
-
- @mock = double('verify_count')
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "does not raise an exception for a stubbed method that is never called" do
- Mock.install_method @mock, :method_call, :stub
- Mock.verify_count
- end
-
- it "verifies the calls to the mocked method when a mock is defined after a stub" do
- Mock.install_method @mock, :method_call, :stub
- Mock.install_method @mock, :method_call, :mock
- @mock.method_call
- Mock.verify_count
- end
-
- it "verifies the calls to the mocked method when a mock is defined before a stub" do
- Mock.install_method @mock, :method_call, :mock
- Mock.install_method @mock, :method_call, :stub
- @mock.method_call
- Mock.verify_count
- end
-end
-
-describe Mock, ".cleanup" do
- before :each do
- MSpec.stub(:actions)
- MSpec.stub(:current).and_return(double("spec state").as_null_object)
-
- @mock = double('cleanup')
- @proxy = Mock.install_method @mock, :method_call
- @stub = Mock.install_method @mock, :method_call, :stub
- end
-
- after :each do
- Mock.cleanup
- end
-
- it "removes the mock method call if it did not override an existing method" do
- @mock.should respond_to(:method_call)
-
- Mock.cleanup
- @mock.should_not respond_to(:method_call)
- end
-
- it "removes the replaced method if the mock method overrides an existing method" do
- def @mock.already_here() :hey end
- @mock.should respond_to(:already_here)
- replaced_name = Mock.replaced_name(@mock, :already_here)
- Mock.install_method @mock, :already_here
- @mock.should respond_to(replaced_name)
-
- Mock.cleanup
- @mock.should_not respond_to(replaced_name)
- @mock.should respond_to(:already_here)
- @mock.already_here.should == :hey
- end
-
- it "removes all mock expectations" do
- Mock.mocks.should == { Mock.replaced_key(@mock, :method_call) => [@proxy] }
- Mock.cleanup
- Mock.mocks.should == {}
- end
-
- it "removes all stubs" do
- Mock.stubs.should == { Mock.replaced_key(@mock, :method_call) => [@stub] }
- Mock.cleanup
- Mock.stubs.should == {}
- end
-
- it "removes the replaced name for mocks" do
- replaced_key = Mock.replaced_key(@mock, :method_call)
- Mock.should_receive(:clear_replaced).with(replaced_key)
-
- replaced_name = Mock.replaced_name(@mock, :method_call)
- Mock.replaced?(replaced_name).should be_true
-
- Mock.cleanup
- Mock.replaced?(replaced_name).should be_false
- end
-end
diff --git a/spec/mspec/spec/mocks/proxy_spec.rb b/spec/mspec/spec/mocks/proxy_spec.rb
deleted file mode 100644
index d9e754b972..0000000000
--- a/spec/mspec/spec/mocks/proxy_spec.rb
+++ /dev/null
@@ -1,405 +0,0 @@
-require 'spec_helper'
-require 'mspec/mocks/proxy'
-
-describe MockObject, ".new" do
- it "creates a new mock object" do
- m = MockObject.new('not a null object')
- lambda { m.not_a_method }.should raise_error(NoMethodError)
- end
-
- it "creates a new mock object that follows the NullObject pattern" do
- m = MockObject.new('null object', :null_object => true)
- m.not_really_a_method.should equal(m)
- end
-end
-
-describe MockProxy, ".new" do
- it "creates a mock proxy by default" do
- MockProxy.new.mock?.should be_true
- end
-
- it "creates a stub proxy by request" do
- MockProxy.new(:stub).stub?.should be_true
- end
-
- it "sets the call expectation to 1 call for a mock" do
- MockProxy.new.count.should == [:exactly, 1]
- end
-
- it "sets the call expectation to any number of times for a stub" do
- MockProxy.new(:stub).count.should == [:any_number_of_times, 0]
- end
-end
-
-describe MockProxy, "#count" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns the expected number of calls the mock should receive" do
- @proxy.count.should == [:exactly, 1]
- @proxy.at_least(3).count.should == [:at_least, 3]
- end
-end
-
-describe MockProxy, "#arguments" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns the expected arguments" do
- @proxy.arguments.should == :any_args
- end
-end
-
-describe MockProxy, "#with" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.with(:a).should be_equal(@proxy)
- end
-
- it "raises an ArgumentError if no arguments are given" do
- lambda { @proxy.with }.should raise_error(ArgumentError)
- end
-
- it "accepts any number of arguments" do
- @proxy.with(1, 2, 3).should be_an_instance_of(MockProxy)
- @proxy.arguments.should == [1,2,3]
- end
-end
-
-describe MockProxy, "#once" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.once.should be_equal(@proxy)
- end
-
- it "sets the expected calls to 1" do
- @proxy.once
- @proxy.count.should == [:exactly, 1]
- end
-
- it "accepts no arguments" do
- lambda { @proxy.once(:a) }.should raise_error
- end
-end
-
-describe MockProxy, "#twice" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.twice.should be_equal(@proxy)
- end
-
- it "sets the expected calls to 2" do
- @proxy.twice
- @proxy.count.should == [:exactly, 2]
- end
-
- it "accepts no arguments" do
- lambda { @proxy.twice(:b) }.should raise_error
- end
-end
-
-describe MockProxy, "#exactly" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.exactly(2).should be_equal(@proxy)
- end
-
- it "sets the expected calls to exactly n" do
- @proxy.exactly(5)
- @proxy.count.should == [:exactly, 5]
- end
-
- it "does not accept an argument that Integer() cannot convert" do
- lambda { @proxy.exactly('x') }.should raise_error
- end
-end
-
-describe MockProxy, "#at_least" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.at_least(3).should be_equal(@proxy)
- end
-
- it "sets the expected calls to at least n" do
- @proxy.at_least(3)
- @proxy.count.should == [:at_least, 3]
- end
-
- it "accepts :once :twice" do
- @proxy.at_least(:once)
- @proxy.count.should == [:at_least, 1]
- @proxy.at_least(:twice)
- @proxy.count.should == [:at_least, 2]
- end
-
- it "does not accept an argument that Integer() cannot convert" do
- lambda { @proxy.at_least('x') }.should raise_error
- end
-end
-
-describe MockProxy, "#at_most" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.at_most(2).should be_equal(@proxy)
- end
-
- it "sets the expected calls to at most n" do
- @proxy.at_most(2)
- @proxy.count.should == [:at_most, 2]
- end
-
- it "accepts :once, :twice" do
- @proxy.at_most(:once)
- @proxy.count.should == [:at_most, 1]
- @proxy.at_most(:twice)
- @proxy.count.should == [:at_most, 2]
- end
-
- it "does not accept an argument that Integer() cannot convert" do
- lambda { @proxy.at_most('x') }.should raise_error
- end
-end
-
-describe MockProxy, "#any_number_of_times" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.any_number_of_times.should be_equal(@proxy)
- end
-
- it "sets the expected calls to any number of times" do
- @proxy.any_number_of_times
- @proxy.count.should == [:any_number_of_times, 0]
- end
-
- it "does not accept an argument" do
- lambda { @proxy.any_number_of_times(2) }.should raise_error
- end
-end
-
-describe MockProxy, "#and_return" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.and_return(false).should equal(@proxy)
- end
-
- it "sets the expected return value" do
- @proxy.and_return(false)
- @proxy.returning.should == false
- end
-
- it "accepts any number of return values" do
- @proxy.and_return(1, 2, 3)
- @proxy.returning.should == 1
- @proxy.returning.should == 2
- @proxy.returning.should == 3
- end
-
- it "implicitly sets the expected number of calls" do
- @proxy.and_return(1, 2, 3)
- @proxy.count.should == [:exactly, 3]
- end
-
- it "only sets the expected number of calls if it is higher than what is already set" do
- @proxy.at_least(5).times.and_return(1, 2, 3)
- @proxy.count.should == [:at_least, 5]
-
- @proxy.at_least(2).times.and_return(1, 2, 3)
- @proxy.count.should == [:at_least, 3]
- end
-end
-
-describe MockProxy, "#returning" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns nil by default" do
- @proxy.returning.should be_nil
- end
-
- it "returns the value set by #and_return" do
- @proxy.and_return(2)
- @proxy.returning.should == 2
- @proxy.returning.should == 2
- end
-
- it "returns a sequence of values set by #and_return" do
- @proxy.and_return(1,2,3,4)
- @proxy.returning.should == 1
- @proxy.returning.should == 2
- @proxy.returning.should == 3
- @proxy.returning.should == 4
- @proxy.returning.should == 4
- @proxy.returning.should == 4
- end
-end
-
-describe MockProxy, "#calls" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns the number of times the proxy is called" do
- @proxy.calls.should == 0
- end
-end
-
-describe MockProxy, "#called" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "increments the number of times the proxy is called" do
- @proxy.called
- @proxy.called
- @proxy.calls.should == 2
- end
-end
-
-describe MockProxy, "#times" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "is a no-op" do
- @proxy.times.should == @proxy
- end
-end
-
-describe MockProxy, "#stub?" do
- it "returns true if the proxy is created as a stub" do
- MockProxy.new(:stub).stub?.should be_true
- end
-
- it "returns false if the proxy is created as a mock" do
- MockProxy.new(:mock).stub?.should be_false
- end
-end
-
-describe MockProxy, "#mock?" do
- it "returns true if the proxy is created as a mock" do
- MockProxy.new(:mock).mock?.should be_true
- end
-
- it "returns false if the proxy is created as a stub" do
- MockProxy.new(:stub).mock?.should be_false
- end
-end
-
-describe MockProxy, "#and_yield" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns self" do
- @proxy.and_yield(false).should equal(@proxy)
- end
-
- it "sets the expected values to yield" do
- @proxy.and_yield(1).yielding.should == [[1]]
- end
-
- it "accepts multiple values to yield" do
- @proxy.and_yield(1, 2, 3).yielding.should == [[1, 2, 3]]
- end
-end
-
-describe MockProxy, "#raising" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns nil by default" do
- @proxy.raising.should be_nil
- end
-
- it "returns the exception object passed to #and_raise" do
- exc = double("exception")
- @proxy.and_raise(exc)
- @proxy.raising.should equal(exc)
- end
-
- it "returns an instance of RuntimeError when a String is passed to #and_raise" do
- @proxy.and_raise("an error")
- exc = @proxy.raising
- exc.should be_an_instance_of(RuntimeError)
- exc.message.should == "an error"
- end
-end
-
-describe MockProxy, "#yielding" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns an empty array by default" do
- @proxy.yielding.should == []
- end
-
- it "returns an array of arrays of values the proxy should yield" do
- @proxy.and_yield(3)
- @proxy.yielding.should == [[3]]
- end
-
- it "returns an accumulation of arrays of values the proxy should yield" do
- @proxy.and_yield(1).and_yield(2, 3)
- @proxy.yielding.should == [[1], [2, 3]]
- end
-end
-
-describe MockProxy, "#yielding?" do
- before :each do
- @proxy = MockProxy.new
- end
-
- it "returns false if the proxy is not yielding" do
- @proxy.yielding?.should be_false
- end
-
- it "returns true if the proxy is yielding" do
- @proxy.and_yield(1)
- @proxy.yielding?.should be_true
- end
-end
-
-describe MockIntObject, "#to_int" do
- before :each do
- @int = MockIntObject.new(10)
- end
-
- it "returns the number if to_int is called" do
- @int.to_int.should == 10
- @int.count.should == [:at_least, 1]
- end
-
- it "tries to convert the target to int if to_int is called" do
- MockIntObject.new(@int).to_int.should == 10
- @int.count.should == [:at_least, 1]
- end
-end
diff --git a/spec/mspec/spec/runner/actions/filter_spec.rb b/spec/mspec/spec/runner/actions/filter_spec.rb
deleted file mode 100644
index d185781757..0000000000
--- a/spec/mspec/spec/runner/actions/filter_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/actions/filter'
-require 'mspec/runner/mspec'
-require 'mspec/runner/tag'
-
-describe ActionFilter do
- it "creates a filter when not passed a description" do
- MatchFilter.should_not_receive(:new)
- ActionFilter.new(nil, nil)
- end
-
- it "creates a filter from a single description" do
- MatchFilter.should_receive(:new).with(nil, "match me")
- ActionFilter.new(nil, "match me")
- end
-
- it "creates a filter from an array of descriptions" do
- MatchFilter.should_receive(:new).with(nil, "match me", "again")
- ActionFilter.new(nil, ["match me", "again"])
- end
-end
-
-describe ActionFilter, "#===" do
- before :each do
- MSpec.stub(:read_tags).and_return(["match"])
- @action = ActionFilter.new(nil, ["catch", "if you"])
- end
-
- it "returns false if there are no filters" do
- action = ActionFilter.new
- action.===("anything").should == false
- end
-
- it "returns true if the argument matches any of the descriptions" do
- @action.===("catch").should == true
- @action.===("if you can").should == true
- end
-
- it "returns false if the argument does not match any of the descriptions" do
- @action.===("patch me").should == false
- @action.===("if I can").should == false
- end
-end
-
-describe ActionFilter, "#load" do
- before :each do
- @tag = SpecTag.new "tag(comment):description"
- end
-
- it "creates a filter from a single tag" do
- MSpec.should_receive(:read_tags).with(["tag"]).and_return([@tag])
- MatchFilter.should_receive(:new).with(nil, "description")
- ActionFilter.new("tag", nil).load
- end
-
- it "creates a filter from an array of tags" do
- MSpec.should_receive(:read_tags).with(["tag", "key"]).and_return([@tag])
- MatchFilter.should_receive(:new).with(nil, "description")
- ActionFilter.new(["tag", "key"], nil).load
- end
-
- it "creates a filter from both tags and descriptions" do
- MSpec.should_receive(:read_tags).and_return([@tag])
- filter = ActionFilter.new("tag", ["match me", "again"])
- MatchFilter.should_receive(:new).with(nil, "description")
- filter.load
- end
-end
-
-describe ActionFilter, "#register" do
- it "registers itself with MSpec for the :load actions" do
- filter = ActionFilter.new
- MSpec.should_receive(:register).with(:load, filter)
- filter.register
- end
-end
-
-describe ActionFilter, "#unregister" do
- it "unregisters itself with MSpec for the :load actions" do
- filter = ActionFilter.new
- MSpec.should_receive(:unregister).with(:load, filter)
- filter.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/actions/tag_spec.rb b/spec/mspec/spec/runner/actions/tag_spec.rb
deleted file mode 100644
index 92df362d02..0000000000
--- a/spec/mspec/spec/runner/actions/tag_spec.rb
+++ /dev/null
@@ -1,315 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/actions/tag'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/runner/tag'
-
-describe TagAction, ".new" do
- it "creates an MatchFilter with its tag and desc arguments" do
- filter = double('action filter').as_null_object
- MatchFilter.should_receive(:new).with(nil, "some", "thing").and_return(filter)
- TagAction.new :add, :all, nil, nil, ["tag", "key"], ["some", "thing"]
- end
-end
-
-describe TagAction, "#===" do
- before :each do
- MSpec.stub(:read_tags).and_return(["match"])
- @action = TagAction.new :add, :fail, nil, nil, nil, ["catch", "if you"]
- end
-
- it "returns true if there are no filters" do
- action = TagAction.new :add, :all, nil, nil
- action.===("anything").should == true
- end
-
- it "returns true if the argument matches any of the descriptions" do
- @action.===("catch").should == true
- @action.===("if you can").should == true
- end
-
- it "returns false if the argument does not match any of the descriptions" do
- @action.===("patch me").should == false
- @action.===("if I can").should == false
- end
-end
-
-describe TagAction, "#exception?" do
- before :each do
- @action = TagAction.new :add, :fail, nil, nil, nil, nil
- end
-
- it "returns false if no exception has been raised while evaluating an example" do
- @action.exception?.should be_false
- end
-
- it "returns true if an exception was raised while evaluating an example" do
- @action.exception ExceptionState.new nil, nil, Exception.new("failed")
- @action.exception?.should be_true
- end
-end
-
-describe TagAction, "#outcome?" do
- before :each do
- MSpec.stub(:read_tags).and_return([])
- @exception = ExceptionState.new nil, nil, Exception.new("failed")
- end
-
- it "returns true if outcome is :fail and the spec fails" do
- action = TagAction.new :add, :fail, nil, nil, nil, nil
- action.exception @exception
- action.outcome?.should == true
- end
-
- it "returns false if the outcome is :fail and the spec passes" do
- action = TagAction.new :add, :fail, nil, nil, nil, nil
- action.outcome?.should == false
- end
-
- it "returns true if the outcome is :pass and the spec passes" do
- action = TagAction.new :del, :pass, nil, nil, nil, nil
- action.outcome?.should == true
- end
-
- it "returns false if the outcome is :pass and the spec fails" do
- action = TagAction.new :del, :pass, nil, nil, nil, nil
- action.exception @exception
- action.outcome?.should == false
- end
-
- it "returns true if the outcome is :all" do
- action = TagAction.new :add, :all, nil, nil, nil, nil
- action.exception @exception
- action.outcome?.should == true
- end
-end
-
-describe TagAction, "#before" do
- it "resets the #exception? flag to false" do
- action = TagAction.new :add, :fail, nil, nil, nil, nil
- action.exception?.should be_false
- action.exception ExceptionState.new(nil, nil, Exception.new("Fail!"))
- action.exception?.should be_true
- action.before(ExampleState.new(ContextState.new("describe"), "it"))
- action.exception?.should be_false
- end
-end
-
-describe TagAction, "#exception" do
- it "sets the #exception? flag" do
- action = TagAction.new :add, :fail, nil, nil, nil, nil
- action.exception?.should be_false
- action.exception ExceptionState.new(nil, nil, Exception.new("Fail!"))
- action.exception?.should be_true
- end
-end
-
-describe TagAction, "#after when action is :add" do
- before :each do
- MSpec.stub(:read_tags).and_return([])
- context = ContextState.new "Catch#me"
- @state = ExampleState.new context, "if you can"
- @tag = SpecTag.new "tag(comment):Catch#me if you can"
- SpecTag.stub(:new).and_return(@tag)
- @exception = ExceptionState.new nil, nil, Exception.new("failed")
- end
-
- it "does not write a tag if the description does not match" do
- MSpec.should_not_receive(:write_tag)
- action = TagAction.new :add, :all, "tag", "comment", nil, "match"
- action.after @state
- end
-
- it "does not write a tag if outcome is :fail and the spec passed" do
- MSpec.should_not_receive(:write_tag)
- action = TagAction.new :add, :fail, "tag", "comment", nil, "can"
- action.after @state
- end
-
- it "writes a tag if the outcome is :fail and the spec failed" do
- MSpec.should_receive(:write_tag).with(@tag)
- action = TagAction.new :add, :fail, "tag", "comment", nil, "can"
- action.exception @exception
- action.after @state
- end
-
- it "does not write a tag if outcome is :pass and the spec failed" do
- MSpec.should_not_receive(:write_tag)
- action = TagAction.new :add, :pass, "tag", "comment", nil, "can"
- action.exception @exception
- action.after @state
- end
-
- it "writes a tag if the outcome is :pass and the spec passed" do
- MSpec.should_receive(:write_tag).with(@tag)
- action = TagAction.new :add, :pass, "tag", "comment", nil, "can"
- action.after @state
- end
-
- it "writes a tag if the outcome is :all" do
- MSpec.should_receive(:write_tag).with(@tag)
- action = TagAction.new :add, :all, "tag", "comment", nil, "can"
- action.after @state
- end
-end
-
-describe TagAction, "#after when action is :del" do
- before :each do
- MSpec.stub(:read_tags).and_return([])
- context = ContextState.new "Catch#me"
- @state = ExampleState.new context, "if you can"
- @tag = SpecTag.new "tag(comment):Catch#me if you can"
- SpecTag.stub(:new).and_return(@tag)
- @exception = ExceptionState.new nil, nil, Exception.new("failed")
- end
-
- it "does not delete a tag if the description does not match" do
- MSpec.should_not_receive(:delete_tag)
- action = TagAction.new :del, :all, "tag", "comment", nil, "match"
- action.after @state
- end
-
- it "does not delete a tag if outcome is :fail and the spec passed" do
- MSpec.should_not_receive(:delete_tag)
- action = TagAction.new :del, :fail, "tag", "comment", nil, "can"
- action.after @state
- end
-
- it "deletes a tag if the outcome is :fail and the spec failed" do
- MSpec.should_receive(:delete_tag).with(@tag)
- action = TagAction.new :del, :fail, "tag", "comment", nil, "can"
- action.exception @exception
- action.after @state
- end
-
- it "does not delete a tag if outcome is :pass and the spec failed" do
- MSpec.should_not_receive(:delete_tag)
- action = TagAction.new :del, :pass, "tag", "comment", nil, "can"
- action.exception @exception
- action.after @state
- end
-
- it "deletes a tag if the outcome is :pass and the spec passed" do
- MSpec.should_receive(:delete_tag).with(@tag)
- action = TagAction.new :del, :pass, "tag", "comment", nil, "can"
- action.after @state
- end
-
- it "deletes a tag if the outcome is :all" do
- MSpec.should_receive(:delete_tag).with(@tag)
- action = TagAction.new :del, :all, "tag", "comment", nil, "can"
- action.after @state
- end
-end
-
-describe TagAction, "#finish" do
- before :each do
- $stdout = @out = IOStub.new
- context = ContextState.new "Catch#me"
- @state = ExampleState.new context, "if you can"
- MSpec.stub(:write_tag).and_return(true)
- MSpec.stub(:delete_tag).and_return(true)
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "reports no specs tagged if none where tagged" do
- action = TagAction.new :add, :fail, "tag", "comment", nil, "can"
- action.stub(:outcome?).and_return(false)
- action.after @state
- action.finish
- @out.should == "\nTagAction: no specs were tagged with 'tag'\n"
- end
-
- it "reports no specs tagged if none where tagged" do
- action = TagAction.new :del, :fail, "tag", "comment", nil, "can"
- action.stub(:outcome?).and_return(false)
- action.after @state
- action.finish
- @out.should == "\nTagAction: no tags 'tag' were deleted\n"
- end
-
- it "reports the spec descriptions that were tagged" do
- action = TagAction.new :add, :fail, "tag", "comment", nil, "can"
- action.stub(:outcome?).and_return(true)
- action.after @state
- action.finish
- @out.should ==
-%[
-TagAction: specs tagged with 'tag':
-
-Catch#me if you can
-]
- end
-
- it "reports the spec descriptions for the tags that were deleted" do
- action = TagAction.new :del, :fail, "tag", "comment", nil, "can"
- action.stub(:outcome?).and_return(true)
- action.after @state
- action.finish
- @out.should ==
-%[
-TagAction: tag 'tag' deleted for specs:
-
-Catch#me if you can
-]
- end
-end
-
-describe TagAction, "#register" do
- before :each do
- MSpec.stub(:register)
- MSpec.stub(:read_tags).and_return([])
- @action = TagAction.new :add, :all, nil, nil, nil, nil
- end
-
- it "registers itself with MSpec for the :before event" do
- MSpec.should_receive(:register).with(:before, @action)
- @action.register
- end
-
- it "registers itself with MSpec for the :after event" do
- MSpec.should_receive(:register).with(:after, @action)
- @action.register
- end
-
- it "registers itself with MSpec for the :exception event" do
- MSpec.should_receive(:register).with(:exception, @action)
- @action.register
- end
-
- it "registers itself with MSpec for the :finish event" do
- MSpec.should_receive(:register).with(:finish, @action)
- @action.register
- end
-end
-
-describe TagAction, "#unregister" do
- before :each do
- MSpec.stub(:unregister)
- MSpec.stub(:read_tags).and_return([])
- @action = TagAction.new :add, :all, nil, nil, nil, nil
- end
-
- it "unregisters itself with MSpec for the :before event" do
- MSpec.should_receive(:unregister).with(:before, @action)
- @action.unregister
- end
-
- it "unregisters itself with MSpec for the :after event" do
- MSpec.should_receive(:unregister).with(:after, @action)
- @action.unregister
- end
-
- it "unregisters itself with MSpec for the :exception event" do
- MSpec.should_receive(:unregister).with(:exception, @action)
- @action.unregister
- end
-
- it "unregisters itself with MSpec for the :finish event" do
- MSpec.should_receive(:unregister).with(:finish, @action)
- @action.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/actions/taglist_spec.rb b/spec/mspec/spec/runner/actions/taglist_spec.rb
deleted file mode 100644
index 418c761c2d..0000000000
--- a/spec/mspec/spec/runner/actions/taglist_spec.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/actions/taglist'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/runner/tag'
-
-describe TagListAction, "#include?" do
- it "returns true" do
- TagListAction.new.include?(:anything).should be_true
- end
-end
-
-describe TagListAction, "#===" do
- before :each do
- tag = SpecTag.new "fails:description"
- MSpec.stub(:read_tags).and_return([tag])
- @filter = double("MatchFilter").as_null_object
- MatchFilter.stub(:new).and_return(@filter)
- @action = TagListAction.new
- @action.load
- end
-
- it "returns true if filter === string returns true" do
- @filter.should_receive(:===).with("str").and_return(true)
- @action.===("str").should be_true
- end
-
- it "returns false if filter === string returns false" do
- @filter.should_receive(:===).with("str").and_return(false)
- @action.===("str").should be_false
- end
-end
-
-describe TagListAction, "#start" do
- before :each do
- @stdout = $stdout
- $stdout = IOStub.new
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "prints a banner for specific tags" do
- action = TagListAction.new ["fails", "unstable"]
- action.start
- $stdout.should == "\nListing specs tagged with 'fails', 'unstable'\n\n"
- end
-
- it "prints a banner for all tags" do
- action = TagListAction.new
- action.start
- $stdout.should == "\nListing all tagged specs\n\n"
- end
-end
-
-describe TagListAction, "#load" do
- before :each do
- @t1 = SpecTag.new "fails:I fail"
- @t2 = SpecTag.new "unstable:I'm unstable"
- end
-
- it "creates a MatchFilter for matching tags" do
- MSpec.should_receive(:read_tags).with(["fails"]).and_return([@t1])
- MatchFilter.should_receive(:new).with(nil, "I fail")
- TagListAction.new(["fails"]).load
- end
-
- it "creates a MatchFilter for all tags" do
- MSpec.should_receive(:read_tags).and_return([@t1, @t2])
- MatchFilter.should_receive(:new).with(nil, "I fail", "I'm unstable")
- TagListAction.new.load
- end
-
- it "does not create a MatchFilter if there are no matching tags" do
- MSpec.stub(:read_tags).and_return([])
- MatchFilter.should_not_receive(:new)
- TagListAction.new(["fails"]).load
- end
-end
-
-describe TagListAction, "#after" do
- before :each do
- @stdout = $stdout
- $stdout = IOStub.new
-
- @state = double("ExampleState")
- @state.stub(:description).and_return("str")
-
- @action = TagListAction.new
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "prints nothing if the filter does not match" do
- @action.should_receive(:===).with("str").and_return(false)
- @action.after(@state)
- $stdout.should == ""
- end
-
- it "prints the example description if the filter matches" do
- @action.should_receive(:===).with("str").and_return(true)
- @action.after(@state)
- $stdout.should == "str\n"
- end
-end
-
-describe TagListAction, "#register" do
- before :each do
- MSpec.stub(:register)
- @action = TagListAction.new
- end
-
- it "registers itself with MSpec for the :start event" do
- MSpec.should_receive(:register).with(:start, @action)
- @action.register
- end
-
- it "registers itself with MSpec for the :load event" do
- MSpec.should_receive(:register).with(:load, @action)
- @action.register
- end
-
- it "registers itself with MSpec for the :after event" do
- MSpec.should_receive(:register).with(:after, @action)
- @action.register
- end
-end
-
-describe TagListAction, "#unregister" do
- before :each do
- MSpec.stub(:unregister)
- @action = TagListAction.new
- end
-
- it "unregisters itself with MSpec for the :start event" do
- MSpec.should_receive(:unregister).with(:start, @action)
- @action.unregister
- end
-
- it "unregisters itself with MSpec for the :load event" do
- MSpec.should_receive(:unregister).with(:load, @action)
- @action.unregister
- end
-
- it "unregisters itself with MSpec for the :after event" do
- MSpec.should_receive(:unregister).with(:after, @action)
- @action.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/actions/tagpurge_spec.rb b/spec/mspec/spec/runner/actions/tagpurge_spec.rb
deleted file mode 100644
index 27ad2a1470..0000000000
--- a/spec/mspec/spec/runner/actions/tagpurge_spec.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/actions/tagpurge'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/runner/tag'
-
-describe TagPurgeAction, "#start" do
- before :each do
- @stdout = $stdout
- $stdout = IOStub.new
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "prints a banner" do
- action = TagPurgeAction.new
- action.start
- $stdout.should == "\nRemoving tags not matching any specs\n\n"
- end
-end
-
-describe TagPurgeAction, "#load" do
- before :each do
- @t1 = SpecTag.new "fails:I fail"
- @t2 = SpecTag.new "unstable:I'm unstable"
- end
-
- it "creates a MatchFilter for all tags" do
- MSpec.should_receive(:read_tags).and_return([@t1, @t2])
- MatchFilter.should_receive(:new).with(nil, "I fail", "I'm unstable")
- TagPurgeAction.new.load
- end
-end
-
-describe TagPurgeAction, "#after" do
- before :each do
- @state = double("ExampleState")
- @state.stub(:description).and_return("str")
-
- @action = TagPurgeAction.new
- end
-
- it "does not save the description if the filter does not match" do
- @action.should_receive(:===).with("str").and_return(false)
- @action.after @state
- @action.matching.should == []
- end
-
- it "saves the description if the filter matches" do
- @action.should_receive(:===).with("str").and_return(true)
- @action.after @state
- @action.matching.should == ["str"]
- end
-end
-
-describe TagPurgeAction, "#unload" do
- before :each do
- @stdout = $stdout
- $stdout = IOStub.new
-
- @t1 = SpecTag.new "fails:I fail"
- @t2 = SpecTag.new "unstable:I'm unstable"
- @t3 = SpecTag.new "fails:I'm unstable"
-
- MSpec.stub(:read_tags).and_return([@t1, @t2, @t3])
- MSpec.stub(:write_tags)
-
- @state = double("ExampleState")
- @state.stub(:description).and_return("I'm unstable")
-
- @action = TagPurgeAction.new
- @action.load
- @action.after @state
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "does not rewrite any tags if there were no tags for the specs" do
- MSpec.should_receive(:read_tags).and_return([])
- MSpec.should_receive(:delete_tags)
- MSpec.should_not_receive(:write_tags)
-
- @action.load
- @action.after @state
- @action.unload
-
- $stdout.should == ""
- end
-
- it "rewrites tags that were matched" do
- MSpec.should_receive(:write_tags).with([@t2, @t3])
- @action.unload
- end
-
- it "prints tags that were not matched" do
- @action.unload
- $stdout.should == "I fail\n"
- end
-end
-
-describe TagPurgeAction, "#unload" do
- before :each do
- @stdout = $stdout
- $stdout = IOStub.new
-
- MSpec.stub(:read_tags).and_return([])
-
- @state = double("ExampleState")
- @state.stub(:description).and_return("I'm unstable")
-
- @action = TagPurgeAction.new
- @action.load
- @action.after @state
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "deletes the tag file if no tags were found" do
- MSpec.should_not_receive(:write_tags)
- MSpec.should_receive(:delete_tags)
- @action.unload
- $stdout.should == ""
- end
-end
-
-describe TagPurgeAction, "#register" do
- before :each do
- MSpec.stub(:register)
- @action = TagPurgeAction.new
- end
-
- it "registers itself with MSpec for the :unload event" do
- MSpec.should_receive(:register).with(:unload, @action)
- @action.register
- end
-end
-
-describe TagPurgeAction, "#unregister" do
- before :each do
- MSpec.stub(:unregister)
- @action = TagPurgeAction.new
- end
-
- it "unregisters itself with MSpec for the :unload event" do
- MSpec.should_receive(:unregister).with(:unload, @action)
- @action.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/actions/tally_spec.rb b/spec/mspec/spec/runner/actions/tally_spec.rb
deleted file mode 100644
index be4635ffeb..0000000000
--- a/spec/mspec/spec/runner/actions/tally_spec.rb
+++ /dev/null
@@ -1,352 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/runner/actions/tally'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-
-describe Tally, "#files!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #files" do
- @tally.files! 3
- @tally.files.should == 3
- @tally.files!
- @tally.files.should == 4
- end
-end
-
-describe Tally, "#examples!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #examples" do
- @tally.examples! 2
- @tally.examples.should == 2
- @tally.examples! 2
- @tally.examples.should == 4
- end
-end
-
-describe Tally, "#expectations!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #expectations" do
- @tally.expectations!
- @tally.expectations.should == 1
- @tally.expectations! 3
- @tally.expectations.should == 4
- end
-end
-
-describe Tally, "#failures!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #failures" do
- @tally.failures! 1
- @tally.failures.should == 1
- @tally.failures!
- @tally.failures.should == 2
- end
-end
-
-describe Tally, "#errors!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #errors" do
- @tally.errors!
- @tally.errors.should == 1
- @tally.errors! 2
- @tally.errors.should == 3
- end
-end
-
-describe Tally, "#guards!" do
- before :each do
- @tally = Tally.new
- end
-
- it "increments the count returned by #guards" do
- @tally.guards!
- @tally.guards.should == 1
- @tally.guards! 2
- @tally.guards.should == 3
- end
-end
-
-describe Tally, "#file" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #files" do
- @tally.file.should == "0 files"
- @tally.files!
- @tally.file.should == "1 file"
- @tally.files!
- @tally.file.should == "2 files"
- end
-end
-
-describe Tally, "#example" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #examples" do
- @tally.example.should == "0 examples"
- @tally.examples!
- @tally.example.should == "1 example"
- @tally.examples!
- @tally.example.should == "2 examples"
- end
-end
-
-describe Tally, "#expectation" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #expectations" do
- @tally.expectation.should == "0 expectations"
- @tally.expectations!
- @tally.expectation.should == "1 expectation"
- @tally.expectations!
- @tally.expectation.should == "2 expectations"
- end
-end
-
-describe Tally, "#failure" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #failures" do
- @tally.failure.should == "0 failures"
- @tally.failures!
- @tally.failure.should == "1 failure"
- @tally.failures!
- @tally.failure.should == "2 failures"
- end
-end
-
-describe Tally, "#error" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #errors" do
- @tally.error.should == "0 errors"
- @tally.errors!
- @tally.error.should == "1 error"
- @tally.errors!
- @tally.error.should == "2 errors"
- end
-end
-
-describe Tally, "#guard" do
- before :each do
- @tally = Tally.new
- end
-
- it "returns a formatted string of the number of #guards" do
- @tally.guard.should == "0 guards"
- @tally.guards!
- @tally.guard.should == "1 guard"
- @tally.guards!
- @tally.guard.should == "2 guards"
- end
-end
-
-describe Tally, "#format" do
- before :each do
- @tally = Tally.new
- end
-
- after :each do
- MSpec.clear_modes
- end
-
- it "returns a formatted string of counts" do
- @tally.files!
- @tally.examples! 2
- @tally.expectations! 4
- @tally.errors!
- @tally.tagged!
- @tally.format.should == "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged"
- end
-
- it "includes guards if MSpec is in verify mode" do
- MSpec.register_mode :verify
- @tally.files!
- @tally.examples! 2
- @tally.expectations! 4
- @tally.errors!
- @tally.tagged!
- @tally.guards!
- @tally.format.should ==
- "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 1 guard"
- end
-
- it "includes guards if MSpec is in report mode" do
- MSpec.register_mode :report
- @tally.files!
- @tally.examples! 2
- @tally.expectations! 4
- @tally.errors!
- @tally.tagged!
- @tally.guards! 2
- @tally.format.should ==
- "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 1 tagged, 2 guards"
- end
-
- it "includes guards if MSpec is in report_on mode" do
- MSpec.register_mode :report_on
- @tally.files!
- @tally.examples! 2
- @tally.expectations! 4
- @tally.errors!
- @tally.guards! 2
- @tally.format.should ==
- "1 file, 2 examples, 4 expectations, 0 failures, 1 error, 0 tagged, 2 guards"
- end
-end
-
-describe TallyAction, "#counter" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "returns the Tally object" do
- @tally.counter.should be_kind_of(Tally)
- end
-end
-
-describe TallyAction, "#load" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "increments the count returned by Tally#files" do
- @tally.load
- @tally.counter.files.should == 1
- end
-end
-
-describe TallyAction, "#expectation" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "increments the count returned by Tally#expectations" do
- @tally.expectation @state
- @tally.counter.expectations.should == 1
- end
-end
-
-describe TallyAction, "#example" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "increments counts returned by Tally#examples" do
- @tally.example @state, nil
- @tally.counter.examples.should == 1
- @tally.counter.expectations.should == 0
- @tally.counter.failures.should == 0
- @tally.counter.errors.should == 0
- end
-end
-
-describe TallyAction, "#exception" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "increments counts returned by Tally#failures" do
- exc = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("Failed!")
- @tally.exception exc
- @tally.counter.examples.should == 0
- @tally.counter.expectations.should == 0
- @tally.counter.failures.should == 1
- @tally.counter.errors.should == 0
- end
-end
-
-describe TallyAction, "#exception" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "increments counts returned by Tally#errors" do
- exc = ExceptionState.new nil, nil, Exception.new("Error!")
- @tally.exception exc
- @tally.counter.examples.should == 0
- @tally.counter.expectations.should == 0
- @tally.counter.failures.should == 0
- @tally.counter.errors.should == 1
- end
-end
-
-describe TallyAction, "#format" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "returns a readable string of counts" do
- @tally.load
- @tally.example @state, nil
- @tally.expectation @state
- @tally.expectation @state
- exc = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("Failed!")
- @tally.exception exc
- @tally.format.should == "1 file, 1 example, 2 expectations, 1 failure, 0 errors, 0 tagged"
- end
-end
-
-describe TallyAction, "#register" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "registers itself with MSpec for appropriate actions" do
- MSpec.should_receive(:register).with(:load, @tally)
- MSpec.should_receive(:register).with(:exception, @tally)
- MSpec.should_receive(:register).with(:example, @tally)
- MSpec.should_receive(:register).with(:tagged, @tally)
- MSpec.should_receive(:register).with(:expectation, @tally)
- @tally.register
- end
-end
-
-describe TallyAction, "#unregister" do
- before :each do
- @tally = TallyAction.new
- @state = ExampleState.new("describe", "it")
- end
-
- it "unregisters itself with MSpec for appropriate actions" do
- MSpec.should_receive(:unregister).with(:load, @tally)
- MSpec.should_receive(:unregister).with(:exception, @tally)
- MSpec.should_receive(:unregister).with(:example, @tally)
- MSpec.should_receive(:unregister).with(:tagged, @tally)
- MSpec.should_receive(:unregister).with(:expectation, @tally)
- @tally.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/actions/timer_spec.rb b/spec/mspec/spec/runner/actions/timer_spec.rb
deleted file mode 100644
index 417367d5a2..0000000000
--- a/spec/mspec/spec/runner/actions/timer_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/actions/timer'
-require 'mspec/runner/mspec'
-require 'time'
-
-describe TimerAction do
- before :each do
- @timer = TimerAction.new
- @start_time = Time.utc(2009, 3, 30, 14, 5, 19)
- @stop_time = Time.utc(2009, 3, 30, 14, 5, 52)
- end
-
- it "responds to #start by recording the current time" do
- Time.should_receive(:now)
- @timer.start
- end
-
- it "responds to #finish by recording the current time" do
- Time.should_receive(:now)
- @timer.finish
- end
-
- it "responds to #elapsed by returning the difference between stop and start" do
- Time.stub(:now).and_return(@start_time)
- @timer.start
- Time.stub(:now).and_return(@stop_time)
- @timer.finish
- @timer.elapsed.should == 33
- end
-
- it "responds to #format by returning a readable string of elapsed time" do
- Time.stub(:now).and_return(@start_time)
- @timer.start
- Time.stub(:now).and_return(@stop_time)
- @timer.finish
- @timer.format.should == "Finished in 33.000000 seconds"
- end
-
- it "responds to #register by registering itself with MSpec for appropriate actions" do
- MSpec.should_receive(:register).with(:start, @timer)
- MSpec.should_receive(:register).with(:finish, @timer)
- @timer.register
- end
-end
diff --git a/spec/mspec/spec/runner/context_spec.rb b/spec/mspec/spec/runner/context_spec.rb
deleted file mode 100644
index d9c20aa0cf..0000000000
--- a/spec/mspec/spec/runner/context_spec.rb
+++ /dev/null
@@ -1,1041 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/matchers/base'
-require 'mspec/runner/mspec'
-require 'mspec/mocks/mock'
-require 'mspec/runner/context'
-require 'mspec/runner/example'
-
-describe ContextState, "#describe" do
- before :each do
- @state = ContextState.new "C#m"
- @proc = proc { ScratchPad.record :a }
- ScratchPad.clear
- end
-
- it "evaluates the passed block" do
- @state.describe(&@proc)
- ScratchPad.recorded.should == :a
- end
-
- it "evaluates the passed block via #protect" do
- @state.should_receive(:protect).with("C#m", @proc, false)
- @state.describe(&@proc)
- end
-
- it "registers #parent as the current MSpec ContextState" do
- parent = ContextState.new ""
- @state.parent = parent
- MSpec.should_receive(:register_current).with(parent)
- @state.describe { }
- end
-
- it "registers self with MSpec when #shared? is true" do
- state = ContextState.new "something shared", :shared => true
- MSpec.should_receive(:register_shared).with(state)
- state.describe { }
- end
-end
-
-describe ContextState, "#shared?" do
- it "returns false when the ContextState is not shared" do
- ContextState.new("").shared?.should be_false
- end
-
- it "returns true when the ContextState is shared" do
- ContextState.new("", {:shared => true}).shared?.should be_true
- end
-end
-
-describe ContextState, "#to_s" do
- it "returns a description string for self when passed a Module" do
- ContextState.new(Object).to_s.should == "Object"
- end
-
- it "returns a description string for self when passed a String" do
- ContextState.new("SomeClass").to_s.should == "SomeClass"
- end
-
- it "returns a description string for self when passed a Module, String" do
- ContextState.new(Object, "when empty").to_s.should == "Object when empty"
- end
-
- it "returns a description string for self when passed a Module and String beginning with '#'" do
- ContextState.new(Object, "#to_s").to_s.should == "Object#to_s"
- end
-
- it "returns a description string for self when passed a Module and String beginning with '.'" do
- ContextState.new(Object, ".to_s").to_s.should == "Object.to_s"
- end
-
- it "returns a description string for self when passed a Module and String beginning with '::'" do
- ContextState.new(Object, "::to_s").to_s.should == "Object::to_s"
- end
-end
-
-describe ContextState, "#description" do
- before :each do
- @state = ContextState.new "when empty"
- @parent = ContextState.new "Toplevel"
- end
-
- it "returns a composite description string from self and all parents" do
- @parent.description.should == "Toplevel"
- @state.description.should == "when empty"
- @state.parent = @parent
- @state.description.should == "Toplevel when empty"
- end
-end
-
-describe ContextState, "#it" do
- before :each do
- @state = ContextState.new ""
- @proc = lambda {|*| }
-
- @ex = ExampleState.new("", "", &@proc)
- end
-
- it "creates an ExampleState instance for the block" do
- ExampleState.should_receive(:new).with(@state, "it", @proc).and_return(@ex)
- @state.describe(&@proc)
- @state.it("it", &@proc)
- end
-
- it "calls registered :add actions" do
- ExampleState.should_receive(:new).with(@state, "it", @proc).and_return(@ex)
-
- add_action = double("add")
- add_action.should_receive(:add).with(@ex).and_return { ScratchPad.record :add }
- MSpec.register :add, add_action
-
- @state.it("it", &@proc)
- ScratchPad.recorded.should == :add
- MSpec.unregister :add, add_action
- end
-end
-
-describe ContextState, "#examples" do
- before :each do
- @state = ContextState.new ""
- end
-
- it "returns a list of all examples in this ContextState" do
- @state.it("first") { }
- @state.it("second") { }
- @state.examples.size.should == 2
- end
-end
-
-describe ContextState, "#before" do
- before :each do
- @state = ContextState.new ""
- @proc = lambda {|*| }
- end
-
- it "records the block for :each" do
- @state.before(:each, &@proc)
- @state.before(:each).should == [@proc]
- end
-
- it "records the block for :all" do
- @state.before(:all, &@proc)
- @state.before(:all).should == [@proc]
- end
-end
-
-describe ContextState, "#after" do
- before :each do
- @state = ContextState.new ""
- @proc = lambda {|*| }
- end
-
- it "records the block for :each" do
- @state.after(:each, &@proc)
- @state.after(:each).should == [@proc]
- end
-
- it "records the block for :all" do
- @state.after(:all, &@proc)
- @state.after(:all).should == [@proc]
- end
-end
-
-describe ContextState, "#pre" do
- before :each do
- @a = lambda {|*| }
- @b = lambda {|*| }
- @c = lambda {|*| }
-
- parent = ContextState.new ""
- parent.before(:each, &@c)
- parent.before(:all, &@c)
-
- @state = ContextState.new ""
- @state.parent = parent
- end
-
- it "returns before(:each) actions in the order they were defined" do
- @state.before(:each, &@a)
- @state.before(:each, &@b)
- @state.pre(:each).should == [@c, @a, @b]
- end
-
- it "returns before(:all) actions in the order they were defined" do
- @state.before(:all, &@a)
- @state.before(:all, &@b)
- @state.pre(:all).should == [@c, @a, @b]
- end
-end
-
-describe ContextState, "#post" do
- before :each do
- @a = lambda {|*| }
- @b = lambda {|*| }
- @c = lambda {|*| }
-
- parent = ContextState.new ""
- parent.after(:each, &@c)
- parent.after(:all, &@c)
-
- @state = ContextState.new ""
- @state.parent = parent
- end
-
- it "returns after(:each) actions in the reverse order they were defined" do
- @state.after(:each, &@a)
- @state.after(:each, &@b)
- @state.post(:each).should == [@b, @a, @c]
- end
-
- it "returns after(:all) actions in the reverse order they were defined" do
- @state.after(:all, &@a)
- @state.after(:all, &@b)
- @state.post(:all).should == [@b, @a, @c]
- end
-end
-
-describe ContextState, "#protect" do
- before :each do
- ScratchPad.record []
- @a = lambda {|*| ScratchPad << :a }
- @b = lambda {|*| ScratchPad << :b }
- @c = lambda {|*| raise Exception, "Fail!" }
- end
-
- it "returns true and does execute any blocks if check and MSpec.mode?(:pretend) are true" do
- MSpec.should_receive(:mode?).with(:pretend).and_return(true)
- ContextState.new("").protect("message", [@a, @b]).should be_true
- ScratchPad.recorded.should == []
- end
-
- it "executes the blocks if MSpec.mode?(:pretend) is false" do
- MSpec.should_receive(:mode?).with(:pretend).and_return(false)
- ContextState.new("").protect("message", [@a, @b])
- ScratchPad.recorded.should == [:a, :b]
- end
-
- it "executes the blocks if check is false" do
- ContextState.new("").protect("message", [@a, @b], false)
- ScratchPad.recorded.should == [:a, :b]
- end
-
- it "returns true if none of the blocks raise an exception" do
- ContextState.new("").protect("message", [@a, @b]).should be_true
- end
-
- it "returns false if any of the blocks raise an exception" do
- ContextState.new("").protect("message", [@a, @c, @b]).should be_false
- end
-end
-
-describe ContextState, "#parent=" do
- before :each do
- @state = ContextState.new ""
- @parent = double("describe")
- @parent.stub(:parent).and_return(nil)
- @parent.stub(:child)
- end
-
- it "does not set self as a child of parent if shared" do
- @parent.should_not_receive(:child)
- state = ContextState.new "", :shared => true
- state.parent = @parent
- end
-
- it "does not set parents if shared" do
- state = ContextState.new "", :shared => true
- state.parent = @parent
- state.parents.should == [state]
- end
-
- it "sets self as a child of parent" do
- @parent.should_receive(:child).with(@state)
- @state.parent = @parent
- end
-
- it "creates the list of parents" do
- @state.parent = @parent
- @state.parents.should == [@parent, @state]
- end
-end
-
-describe ContextState, "#parent" do
- before :each do
- @state = ContextState.new ""
- @parent = double("describe")
- @parent.stub(:parent).and_return(nil)
- @parent.stub(:child)
- end
-
- it "returns nil if parent has not been set" do
- @state.parent.should be_nil
- end
-
- it "returns the parent" do
- @state.parent = @parent
- @state.parent.should == @parent
- end
-end
-
-describe ContextState, "#parents" do
- before :each do
- @first = ContextState.new ""
- @second = ContextState.new ""
- @parent = double("describe")
- @parent.stub(:parent).and_return(nil)
- @parent.stub(:child)
- end
-
- it "returns a list of all enclosing ContextState instances" do
- @first.parent = @parent
- @second.parent = @first
- @second.parents.should == [@parent, @first, @second]
- end
-end
-
-describe ContextState, "#child" do
- before :each do
- @first = ContextState.new ""
- @second = ContextState.new ""
- @parent = double("describe")
- @parent.stub(:parent).and_return(nil)
- @parent.stub(:child)
- end
-
- it "adds the ContextState to the list of contained ContextStates" do
- @first.child @second
- @first.children.should == [@second]
- end
-end
-
-describe ContextState, "#children" do
- before :each do
- @parent = ContextState.new ""
- @first = ContextState.new ""
- @second = ContextState.new ""
- end
-
- it "returns the list of directly contained ContextStates" do
- @first.parent = @parent
- @second.parent = @first
- @parent.children.should == [@first]
- @first.children.should == [@second]
- end
-end
-
-describe ContextState, "#state" do
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- end
-
- it "returns nil if no spec is being executed" do
- @state.state.should == nil
- end
-
- it "returns a ExampleState instance if an example is being executed" do
- ScratchPad.record @state
- @state.describe { }
- @state.it("") { ScratchPad.record ScratchPad.recorded.state }
- @state.process
- @state.state.should == nil
- ScratchPad.recorded.should be_kind_of(ExampleState)
- end
-end
-
-describe ContextState, "#process" do
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
- MSpec.stub(:register_current)
-
- @state = ContextState.new ""
- @state.describe { }
-
- @a = lambda {|*| ScratchPad << :a }
- @b = lambda {|*| ScratchPad << :b }
- ScratchPad.record []
- end
-
- it "calls each before(:all) block" do
- @state.before(:all, &@a)
- @state.before(:all, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == [:a, :b]
- end
-
- it "calls each after(:all) block" do
- @state.after(:all, &@a)
- @state.after(:all, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == [:b, :a]
- end
-
- it "calls each it block" do
- @state.it("one", &@a)
- @state.it("two", &@b)
- @state.process
- ScratchPad.recorded.should == [:a, :b]
- end
-
- it "does not call the #it block if #filtered? returns true" do
- @state.it("one", &@a)
- @state.it("two", &@b)
- @state.examples.first.stub(:filtered?).and_return(true)
- @state.process
- ScratchPad.recorded.should == [:b]
- end
-
- it "calls each before(:each) block" do
- @state.before(:each, &@a)
- @state.before(:each, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == [:a, :b]
- end
-
- it "calls each after(:each) block" do
- @state.after(:each, &@a)
- @state.after(:each, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == [:b, :a]
- end
-
- it "calls Mock.cleanup for each it block" do
- @state.it("") { }
- @state.it("") { }
- Mock.should_receive(:cleanup).twice
- @state.process
- end
-
- it "calls Mock.verify_count for each it block" do
- @state.it("") { }
- @state.it("") { }
- Mock.should_receive(:verify_count).twice
- @state.process
- end
-
- it "calls the describe block" do
- ScratchPad.record []
- @state.describe { ScratchPad << :a }
- @state.process
- ScratchPad.recorded.should == [:a]
- end
-
- it "creates a new ExampleState instance for each example" do
- ScratchPad.record @state
- @state.describe { }
- @state.it("it") { ScratchPad.record ScratchPad.recorded.state }
- @state.process
- ScratchPad.recorded.should be_kind_of(ExampleState)
- end
-
- it "clears the expectations flag before evaluating the #it block" do
- MSpec.clear_expectations
- MSpec.should_receive(:clear_expectations)
- @state.it("it") { ScratchPad.record MSpec.expectation? }
- @state.process
- ScratchPad.recorded.should be_false
- end
-
- it "shuffles the spec list if MSpec.randomize? is true" do
- MSpec.randomize
- MSpec.should_receive(:shuffle)
- @state.it("") { }
- @state.process
- MSpec.randomize false
- end
-
- it "sets the current MSpec ContextState" do
- MSpec.should_receive(:register_current).with(@state)
- @state.process
- end
-
- it "resets the current MSpec ContextState to nil when there are examples" do
- MSpec.should_receive(:register_current).with(nil)
- @state.it("") { }
- @state.process
- end
-
- it "resets the current MSpec ContextState to nil when there are no examples" do
- MSpec.should_receive(:register_current).with(nil)
- @state.process
- end
-
- it "call #process on children when there are examples" do
- child = ContextState.new ""
- child.should_receive(:process)
- @state.child child
- @state.it("") { }
- @state.process
- end
-
- it "call #process on children when there are no examples" do
- child = ContextState.new ""
- child.should_receive(:process)
- @state.child child
- @state.process
- end
-end
-
-describe ContextState, "#process" do
- before :each do
- MSpec.store :exception, []
-
- @state = ContextState.new ""
- @state.describe { }
-
- action = double("action")
- def action.exception(exc)
- ScratchPad.record :exception if exc.exception.is_a? SpecExpectationNotFoundError
- end
- MSpec.register :exception, action
-
- MSpec.clear_expectations
- ScratchPad.clear
- end
-
- after :each do
- MSpec.store :exception, nil
- end
-
- it "raises an SpecExpectationNotFoundError if an #it block does not contain an expectation" do
- @state.it("it") { }
- @state.process
- ScratchPad.recorded.should == :exception
- end
-
- it "does not raise an SpecExpectationNotFoundError if an #it block does contain an expectation" do
- @state.it("it") { MSpec.expectation }
- @state.process
- ScratchPad.recorded.should be_nil
- end
-
- it "does not raise an SpecExpectationNotFoundError if the #it block causes a failure" do
- @state.it("it") { raise Exception, "Failed!" }
- @state.process
- ScratchPad.recorded.should be_nil
- end
-end
-
-describe ContextState, "#process" do
- before :each do
- MSpec.store :example, []
-
- @state = ContextState.new ""
- @state.describe { }
-
- example = double("example")
- def example.example(state, spec)
- ScratchPad << state << spec
- end
- MSpec.register :example, example
-
- ScratchPad.record []
- end
-
- after :each do
- MSpec.store :example, nil
- end
-
- it "calls registered :example actions with the current ExampleState and block" do
- @state.it("") { MSpec.expectation }
- @state.process
-
- ScratchPad.recorded.first.should be_kind_of(ExampleState)
- ScratchPad.recorded.last.should be_kind_of(Proc)
- end
-
- it "does not call registered example actions if the example has no block" do
- @state.it("empty example")
- @state.process
- ScratchPad.recorded.should == []
- end
-end
-
-describe ContextState, "#process" do
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- @state.describe { }
- @state.it("") { MSpec.expectation }
- end
-
- after :each do
- MSpec.store :before, nil
- MSpec.store :after, nil
- end
-
- it "calls registered :before actions with the current ExampleState instance" do
- before = double("before")
- before.should_receive(:before).and_return {
- ScratchPad.record :before
- @spec_state = @state.state
- }
- MSpec.register :before, before
- @state.process
- ScratchPad.recorded.should == :before
- @spec_state.should be_kind_of(ExampleState)
- end
-
- it "calls registered :after actions with the current ExampleState instance" do
- after = double("after")
- after.should_receive(:after).and_return {
- ScratchPad.record :after
- @spec_state = @state.state
- }
- MSpec.register :after, after
- @state.process
- ScratchPad.recorded.should == :after
- @spec_state.should be_kind_of(ExampleState)
- end
-end
-
-describe ContextState, "#process" do
- before :each do
- MSpec.store :enter, []
- MSpec.store :leave, []
-
- @state = ContextState.new "C#m"
- @state.describe { }
- @state.it("") { MSpec.expectation }
- end
-
- after :each do
- MSpec.store :enter, nil
- MSpec.store :leave, nil
- end
-
- it "calls registered :enter actions with the current #describe string" do
- enter = double("enter")
- enter.should_receive(:enter).with("C#m").and_return { ScratchPad.record :enter }
- MSpec.register :enter, enter
- @state.process
- ScratchPad.recorded.should == :enter
- end
-
- it "calls registered :leave actions" do
- leave = double("leave")
- leave.should_receive(:leave).and_return { ScratchPad.record :leave }
- MSpec.register :leave, leave
- @state.process
- ScratchPad.recorded.should == :leave
- end
-end
-
-describe ContextState, "#process when an exception is raised in before(:all)" do
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- @state.describe { }
-
- @a = lambda {|*| ScratchPad << :a }
- @b = lambda {|*| ScratchPad << :b }
- ScratchPad.record []
-
- @state.before(:all) { raise Exception, "Fail!" }
- end
-
- after :each do
- MSpec.store :before, nil
- MSpec.store :after, nil
- end
-
- it "does not call before(:each)" do
- @state.before(:each, &@a)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call the it block" do
- @state.it("one", &@a)
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call after(:each)" do
- @state.after(:each, &@a)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call after(:each)" do
- @state.after(:all, &@a)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call Mock.verify_count" do
- @state.it("") { }
- Mock.should_not_receive(:verify_count)
- @state.process
- end
-
- it "calls Mock.cleanup" do
- @state.it("") { }
- Mock.should_receive(:cleanup)
- @state.process
- end
-end
-
-describe ContextState, "#process when an exception is raised in before(:each)" do
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- @state.describe { }
-
- @a = lambda {|*| ScratchPad << :a }
- @b = lambda {|*| ScratchPad << :b }
- ScratchPad.record []
-
- @state.before(:each) { raise Exception, "Fail!" }
- end
-
- after :each do
- MSpec.store :before, nil
- MSpec.store :after, nil
- end
-
- it "does not call the it block" do
- @state.it("one", &@a)
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does call after(:each)" do
- @state.after(:each, &@a)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == [:a]
- end
-
- it "does not call Mock.verify_count" do
- @state.it("") { }
- Mock.should_not_receive(:verify_count)
- @state.process
- end
-end
-
-describe ContextState, "#process in pretend mode" do
- before :all do
- MSpec.register_mode :pretend
- end
-
- after :all do
- MSpec.clear_modes
- end
-
- before :each do
- ScratchPad.clear
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- @state.describe { }
- @state.it("") { }
- end
-
- after :each do
- MSpec.store :before, nil
- MSpec.store :after, nil
- end
-
- it "calls registered :before actions with the current ExampleState instance" do
- before = double("before")
- before.should_receive(:before).and_return {
- ScratchPad.record :before
- @spec_state = @state.state
- }
- MSpec.register :before, before
- @state.process
- ScratchPad.recorded.should == :before
- @spec_state.should be_kind_of(ExampleState)
- end
-
- it "calls registered :after actions with the current ExampleState instance" do
- after = double("after")
- after.should_receive(:after).and_return {
- ScratchPad.record :after
- @spec_state = @state.state
- }
- MSpec.register :after, after
- @state.process
- ScratchPad.recorded.should == :after
- @spec_state.should be_kind_of(ExampleState)
- end
-end
-
-describe ContextState, "#process in pretend mode" do
- before :all do
- MSpec.register_mode :pretend
- end
-
- after :all do
- MSpec.clear_modes
- end
-
- before :each do
- MSpec.store :before, []
- MSpec.store :after, []
-
- @state = ContextState.new ""
- @state.describe { }
-
- @a = lambda {|*| ScratchPad << :a }
- @b = lambda {|*| ScratchPad << :b }
- ScratchPad.record []
- end
-
- it "calls the describe block" do
- ScratchPad.record []
- @state.describe { ScratchPad << :a }
- @state.process
- ScratchPad.recorded.should == [:a]
- end
-
- it "does not call any before(:all) block" do
- @state.before(:all, &@a)
- @state.before(:all, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call any after(:all) block" do
- @state.after(:all, &@a)
- @state.after(:all, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call any it block" do
- @state.it("one", &@a)
- @state.it("two", &@b)
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call any before(:each) block" do
- @state.before(:each, &@a)
- @state.before(:each, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call any after(:each) block" do
- @state.after(:each, &@a)
- @state.after(:each, &@b)
- @state.it("") { }
- @state.process
- ScratchPad.recorded.should == []
- end
-
- it "does not call Mock.cleanup" do
- @state.it("") { }
- @state.it("") { }
- Mock.should_not_receive(:cleanup)
- @state.process
- end
-end
-
-describe ContextState, "#process in pretend mode" do
- before :all do
- MSpec.register_mode :pretend
- end
-
- after :all do
- MSpec.clear_modes
- end
-
- before :each do
- MSpec.store :enter, []
- MSpec.store :leave, []
-
- @state = ContextState.new ""
- @state.describe { }
- @state.it("") { }
- end
-
- after :each do
- MSpec.store :enter, nil
- MSpec.store :leave, nil
- end
-
- it "calls registered :enter actions with the current #describe string" do
- enter = double("enter")
- enter.should_receive(:enter).and_return { ScratchPad.record :enter }
- MSpec.register :enter, enter
- @state.process
- ScratchPad.recorded.should == :enter
- end
-
- it "calls registered :leave actions" do
- leave = double("leave")
- leave.should_receive(:leave).and_return { ScratchPad.record :leave }
- MSpec.register :leave, leave
- @state.process
- ScratchPad.recorded.should == :leave
- end
-end
-
-describe ContextState, "#it_should_behave_like" do
- before :each do
- @shared_desc = :shared_context
- @shared = ContextState.new(@shared_desc, :shared => true)
- MSpec.stub(:retrieve_shared).and_return(@shared)
-
- @state = ContextState.new "Top level"
- @a = lambda {|*| }
- @b = lambda {|*| }
- end
-
- it "raises an Exception if unable to find the shared ContextState" do
- MSpec.should_receive(:retrieve_shared).and_return(nil)
- lambda { @state.it_should_behave_like "this" }.should raise_error(Exception)
- end
-
- describe "for nested ContextState instances" do
- before :each do
- @nested = ContextState.new "nested context"
- @nested.parents.unshift @shared
-
- @shared.children << @nested
-
- @nested_dup = @nested.dup
- @nested.stub(:dup).and_return(@nested_dup)
- end
-
- it "duplicates the nested ContextState" do
- @state.it_should_behave_like @shared_desc
- @state.children.first.should equal(@nested_dup)
- end
-
- it "sets the parent of the nested ContextState to the containing ContextState" do
- @state.it_should_behave_like @shared_desc
- @nested_dup.parent.should equal(@state)
- end
-
- it "sets the context for nested examples to the nested ContextState's dup" do
- @shared.it "an example", &@a
- @shared.it "another example", &@b
- @state.it_should_behave_like @shared_desc
- @nested_dup.examples.each { |x| x.context.should equal(@nested_dup) }
- end
-
- it "omits the shored ContextState's description" do
- @nested.it "an example", &@a
- @nested.it "another example", &@b
- @state.it_should_behave_like @shared_desc
-
- @nested_dup.description.should == "Top level nested context"
- @nested_dup.examples.first.description.should == "Top level nested context an example"
- @nested_dup.examples.last.description.should == "Top level nested context another example"
- end
- end
-
- it "adds duped examples from the shared ContextState" do
- @shared.it "some method", &@a
- ex_dup = @shared.examples.first.dup
- @shared.examples.first.stub(:dup).and_return(ex_dup)
-
- @state.it_should_behave_like @shared_desc
- @state.examples.should == [ex_dup]
- end
-
- it "sets the context for examples to the containing ContextState" do
- @shared.it "an example", &@a
- @shared.it "another example", &@b
- @state.it_should_behave_like @shared_desc
- @state.examples.each { |x| x.context.should equal(@state) }
- end
-
- it "adds before(:all) blocks from the shared ContextState" do
- @shared.before :all, &@a
- @shared.before :all, &@b
- @state.it_should_behave_like @shared_desc
- @state.before(:all).should include(*@shared.before(:all))
- end
-
- it "adds before(:each) blocks from the shared ContextState" do
- @shared.before :each, &@a
- @shared.before :each, &@b
- @state.it_should_behave_like @shared_desc
- @state.before(:each).should include(*@shared.before(:each))
- end
-
- it "adds after(:each) blocks from the shared ContextState" do
- @shared.after :each, &@a
- @shared.after :each, &@b
- @state.it_should_behave_like @shared_desc
- @state.after(:each).should include(*@shared.after(:each))
- end
-
- it "adds after(:all) blocks from the shared ContextState" do
- @shared.after :all, &@a
- @shared.after :all, &@b
- @state.it_should_behave_like @shared_desc
- @state.after(:all).should include(*@shared.after(:all))
- end
-end
-
-describe ContextState, "#filter_examples" do
- before :each do
- @state = ContextState.new ""
- @state.it("one") { }
- @state.it("two") { }
- end
-
- it "removes examples that are filtered" do
- @state.examples.first.stub(:filtered?).and_return(true)
- @state.examples.size.should == 2
- @state.filter_examples
- @state.examples.size.should == 1
- end
-
- it "returns true if there are remaining examples to evaluate" do
- @state.examples.first.stub(:filtered?).and_return(true)
- @state.filter_examples.should be_true
- end
-
- it "returns false if there are no remaining examples to evaluate" do
- @state.examples.first.stub(:filtered?).and_return(true)
- @state.examples.last.stub(:filtered?).and_return(true)
- @state.filter_examples.should be_false
- end
-end
diff --git a/spec/mspec/spec/runner/example_spec.rb b/spec/mspec/spec/runner/example_spec.rb
deleted file mode 100644
index b4391f802d..0000000000
--- a/spec/mspec/spec/runner/example_spec.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require 'spec_helper'
-require 'mspec/matchers/base'
-require 'mspec/runner/mspec'
-require 'mspec/mocks/mock'
-require 'mspec/runner/example'
-
-describe ExampleState do
- it "is initialized with the ContextState, #it string, and #it block" do
- prc = lambda { }
- context = ContextState.new ""
- ExampleState.new(context, "does", prc).should be_kind_of(ExampleState)
- end
-end
-
-describe ExampleState, "#describe" do
- before :each do
- @context = ContextState.new Object, "#to_s"
- @state = ExampleState.new @context, "it"
- end
-
- it "returns the ContextState#description" do
- @state.describe.should == @context.description
- end
-end
-
-describe ExampleState, "#it" do
- before :each do
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- it "returns the argument to the #it block" do
- @state.it.should == "it"
- end
-end
-
-describe ExampleState, "#context=" do
- before :each do
- @state = ExampleState.new ContextState.new("describe"), "it"
- @context = ContextState.new "New#context"
- end
-
- it "sets the containing ContextState" do
- @state.context = @context
- @state.context.should == @context
- end
-
- it "resets the description" do
- @state.description.should == "describe it"
- @state.context = @context
- @state.description.should == "New#context it"
- end
-end
-
-describe ExampleState, "#example" do
- before :each do
- @proc = lambda { }
- @state = ExampleState.new ContextState.new("describe"), "it", @proc
- end
-
- it "returns the #it block" do
- @state.example.should == @proc
- end
-end
-
-describe ExampleState, "#filtered?" do
- before :each do
- MSpec.store :include, nil
- MSpec.store :exclude, nil
-
- @state = ExampleState.new ContextState.new("describe"), "it"
- @filter = double("filter")
- end
-
- after :each do
- MSpec.store :include, nil
- MSpec.store :exclude, nil
- end
-
- it "returns false if MSpec include filters list is empty" do
- @state.filtered?.should == false
- end
-
- it "returns false if MSpec include filters match this spec" do
- @filter.should_receive(:===).and_return(true)
- MSpec.register :include, @filter
- @state.filtered?.should == false
- end
-
- it "returns true if MSpec include filters do not match this spec" do
- @filter.should_receive(:===).and_return(false)
- MSpec.register :include, @filter
- @state.filtered?.should == true
- end
-
- it "returns false if MSpec exclude filters list is empty" do
- @state.filtered?.should == false
- end
-
- it "returns false if MSpec exclude filters do not match this spec" do
- @filter.should_receive(:===).and_return(false)
- MSpec.register :exclude, @filter
- @state.filtered?.should == false
- end
-
- it "returns true if MSpec exclude filters match this spec" do
- @filter.should_receive(:===).and_return(true)
- MSpec.register :exclude, @filter
- @state.filtered?.should == true
- end
-
- it "returns true if MSpec include and exclude filters match this spec" do
- @filter.should_receive(:===).twice.and_return(true)
- MSpec.register :include, @filter
- MSpec.register :exclude, @filter
- @state.filtered?.should == true
- end
-end
diff --git a/spec/mspec/spec/runner/exception_spec.rb b/spec/mspec/spec/runner/exception_spec.rb
deleted file mode 100644
index 309442435c..0000000000
--- a/spec/mspec/spec/runner/exception_spec.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require 'spec_helper'
-require 'mspec/expectations/expectations'
-require 'mspec/runner/example'
-require 'mspec/runner/exception'
-require 'mspec/utils/script'
-
-describe ExceptionState, "#initialize" do
- it "takes a state, location (e.g. before :each), and exception" do
- context = ContextState.new "Class#method"
- state = ExampleState.new context, "does something"
- exc = Exception.new "Fail!"
- ExceptionState.new(state, "location", exc).should be_kind_of(ExceptionState)
- end
-end
-
-describe ExceptionState, "#description" do
- before :each do
- context = ContextState.new "Class#method"
- @state = ExampleState.new context, "does something"
- end
-
- it "returns the state description if state was not nil" do
- exc = ExceptionState.new(@state, nil, nil)
- exc.description.should == "Class#method does something"
- end
-
- it "returns the location if it is not nil and description is nil" do
- exc = ExceptionState.new(nil, "location", nil)
- exc.description.should == "An exception occurred during: location"
- end
-
- it "returns both description and location if neither are nil" do
- exc = ExceptionState.new(@state, "location", nil)
- exc.description.should == "An exception occurred during: location\nClass#method does something"
- end
-end
-
-describe ExceptionState, "#describe" do
- before :each do
- context = ContextState.new "Class#method"
- @state = ExampleState.new context, "does something"
- end
-
- it "returns the ExampleState#describe string if created with a non-nil state" do
- ExceptionState.new(@state, nil, nil).describe.should == @state.describe
- end
-
- it "returns an empty string if created with a nil state" do
- ExceptionState.new(nil, nil, nil).describe.should == ""
- end
-end
-
-describe ExceptionState, "#it" do
- before :each do
- context = ContextState.new "Class#method"
- @state = ExampleState.new context, "does something"
- end
-
- it "returns the ExampleState#it string if created with a non-nil state" do
- ExceptionState.new(@state, nil, nil).it.should == @state.it
- end
-
- it "returns an empty string if created with a nil state" do
- ExceptionState.new(nil, nil, nil).it.should == ""
- end
-end
-
-describe ExceptionState, "#failure?" do
- before :each do
- @state = ExampleState.new ContextState.new("C#m"), "works"
- end
-
- it "returns true if the exception is an SpecExpectationNotMetError" do
- exc = ExceptionState.new @state, "", SpecExpectationNotMetError.new("Fail!")
- exc.failure?.should be_true
- end
-
- it "returns true if the exception is an SpecExpectationNotFoundError" do
- exc = ExceptionState.new @state, "", SpecExpectationNotFoundError.new("Fail!")
- exc.failure?.should be_true
- end
-
- it "returns false if the exception is not an SpecExpectationNotMetError or an SpecExpectationNotFoundError" do
- exc = ExceptionState.new @state, "", Exception.new("Fail!")
- exc.failure?.should be_false
- end
-end
-
-describe ExceptionState, "#message" do
- before :each do
- @state = ExampleState.new ContextState.new("C#m"), "works"
- end
-
- it "returns <No message> if the exception message is empty" do
- exc = ExceptionState.new @state, "", Exception.new("")
- exc.message.should == "<No message>"
- end
-
- it "returns the message without exception class when the exception is an SpecExpectationNotMetError" do
- exc = ExceptionState.new @state, "", SpecExpectationNotMetError.new("Fail!")
- exc.message.should == "Fail!"
- end
-
- it "returns SpecExpectationNotFoundError#message when the exception is an SpecExpectationNotFoundError" do
- e = SpecExpectationNotFoundError.new
- exc = ExceptionState.new @state, "", e
- exc.message.should == e.message
- end
-
- it "returns the message with exception class when the exception is not an SpecExpectationNotMetError or an SpecExpectationNotFoundError" do
- exc = ExceptionState.new @state, "", Exception.new("Fail!")
- exc.message.should == "Exception: Fail!"
- end
-end
-
-describe ExceptionState, "#backtrace" do
- before :each do
- @state = ExampleState.new ContextState.new("C#m"), "works"
- begin
- raise Exception
- rescue Exception => @exception
- @exc = ExceptionState.new @state, "", @exception
- end
- end
-
- after :each do
- $MSPEC_DEBUG = nil
- end
-
- it "returns a string representation of the exception backtrace" do
- @exc.backtrace.should be_kind_of(String)
- end
-
- it "does not filter files from the backtrace if $MSPEC_DEBUG is true" do
- $MSPEC_DEBUG = true
- @exc.backtrace.should == @exception.backtrace.join("\n")
- end
-
- it "filters files matching config[:backtrace_filter]" do
- MSpecScript.set :backtrace_filter, %r[mspec/lib]
- $MSPEC_DEBUG = nil
- @exc.backtrace.split("\n").each do |line|
- line.should_not =~ %r[mspec/lib]
- end
- end
-end
diff --git a/spec/mspec/spec/runner/filters/a.yaml b/spec/mspec/spec/runner/filters/a.yaml
deleted file mode 100644
index 1940e3cba6..0000000000
--- a/spec/mspec/spec/runner/filters/a.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-A#:
-- a
-- aa
diff --git a/spec/mspec/spec/runner/filters/b.yaml b/spec/mspec/spec/runner/filters/b.yaml
deleted file mode 100644
index a24bdb2f19..0000000000
--- a/spec/mspec/spec/runner/filters/b.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-B.:
-- b
-- bb
-B::C#:
-- b!
-- b=
-- b?
-- "-"
-- "[]"
-- "[]="
diff --git a/spec/mspec/spec/runner/filters/match_spec.rb b/spec/mspec/spec/runner/filters/match_spec.rb
deleted file mode 100644
index f2c665c495..0000000000
--- a/spec/mspec/spec/runner/filters/match_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters/match'
-
-describe MatchFilter, "#===" do
- before :each do
- @filter = MatchFilter.new nil, 'a', 'b', 'c'
- end
-
- it "returns true if the argument matches any of the #initialize strings" do
- @filter.===('aaa').should == true
- @filter.===('bccb').should == true
- end
-
- it "returns false if the argument matches none of the #initialize strings" do
- @filter.===('d').should == false
- end
-end
-
-describe MatchFilter, "#register" do
- it "registers itself with MSpec for the designated action list" do
- filter = MatchFilter.new :include
- MSpec.should_receive(:register).with(:include, filter)
- filter.register
- end
-end
-
-describe MatchFilter, "#unregister" do
- it "unregisters itself with MSpec for the designated action list" do
- filter = MatchFilter.new :exclude
- MSpec.should_receive(:unregister).with(:exclude, filter)
- filter.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/filters/profile_spec.rb b/spec/mspec/spec/runner/filters/profile_spec.rb
deleted file mode 100644
index 89d0ad1911..0000000000
--- a/spec/mspec/spec/runner/filters/profile_spec.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters/profile'
-
-describe ProfileFilter, "#find" do
- before :each do
- @filter = ProfileFilter.new nil
- File.stub(:exist?).and_return(false)
- @file = "rails.yaml"
- end
-
- it "attempts to locate the file through the expanded path name" do
- File.should_receive(:expand_path).with(@file).and_return(@file)
- File.should_receive(:exist?).with(@file).and_return(true)
- @filter.find(@file).should == @file
- end
-
- it "attempts to locate the file in 'spec/profiles'" do
- path = File.join "spec/profiles", @file
- File.should_receive(:exist?).with(path).and_return(true)
- @filter.find(@file).should == path
- end
-
- it "attempts to locate the file in 'spec'" do
- path = File.join "spec", @file
- File.should_receive(:exist?).with(path).and_return(true)
- @filter.find(@file).should == path
- end
-
- it "attempts to locate the file in 'profiles'" do
- path = File.join "profiles", @file
- File.should_receive(:exist?).with(path).and_return(true)
- @filter.find(@file).should == path
- end
-
- it "attempts to locate the file in '.'" do
- path = File.join ".", @file
- File.should_receive(:exist?).with(path).and_return(true)
- @filter.find(@file).should == path
- end
-end
-
-describe ProfileFilter, "#parse" do
- before :each do
- @filter = ProfileFilter.new nil
- @file = File.open(File.dirname(__FILE__) + "/b.yaml", "r")
- end
-
- after :each do
- @file.close
- end
-
- it "creates a Hash of the contents of the YAML file" do
- @filter.parse(@file).should == {
- "B." => ["b", "bb"],
- "B::C#" => ["b!", "b=", "b?", "-", "[]", "[]="]
- }
- end
-end
-
-describe ProfileFilter, "#load" do
- before :each do
- @filter = ProfileFilter.new nil
- @files = [
- File.dirname(__FILE__) + "/a.yaml",
- File.dirname(__FILE__) + "/b.yaml"
- ]
- end
-
- it "generates a composite hash from multiple YAML files" do
- @filter.load(*@files).should == {
- "A#" => ["a", "aa"],
- "B." => ["b", "bb"],
- "B::C#" => ["b!", "b=", "b?", "-", "[]", "[]="]
- }
- end
-end
-
-describe ProfileFilter, "#===" do
- before :each do
- @filter = ProfileFilter.new nil
- @filter.stub(:load).and_return({ "A#" => ["[]=", "a", "a!", "a?", "aa="]})
- @filter.send :initialize, nil
- end
-
- it "returns true if the spec description is for a method in the profile" do
- @filter.===("The A#[]= method").should == true
- @filter.===("A#a returns").should == true
- @filter.===("A#a! replaces").should == true
- @filter.===("A#a? returns").should == true
- @filter.===("A#aa= raises").should == true
- end
-
- it "returns false if the spec description is for a method not in the profile" do
- @filter.===("The A#[] method").should == false
- @filter.===("B#a returns").should == false
- @filter.===("A.a! replaces").should == false
- @filter.===("AA#a? returns").should == false
- @filter.===("A#aa raises").should == false
- end
-end
-
-describe ProfileFilter, "#register" do
- it "registers itself with MSpec for the designated action list" do
- filter = ProfileFilter.new :include
- MSpec.should_receive(:register).with(:include, filter)
- filter.register
- end
-end
-
-describe ProfileFilter, "#unregister" do
- it "unregisters itself with MSpec for the designated action list" do
- filter = ProfileFilter.new :exclude
- MSpec.should_receive(:unregister).with(:exclude, filter)
- filter.unregister
- end
-end
diff --git a/spec/mspec/spec/runner/filters/regexp_spec.rb b/spec/mspec/spec/runner/filters/regexp_spec.rb
deleted file mode 100644
index 6c05b0f42f..0000000000
--- a/spec/mspec/spec/runner/filters/regexp_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters/regexp'
-
-describe RegexpFilter, "#to_regexp" do
- before :each do
- @filter = RegexpFilter.new nil
- end
-
- it "converts its arguments to Regexp instances" do
- @filter.to_regexp('a(b|c)', 'b[^ab]', 'cc?').should == [/a(b|c)/, /b[^ab]/, /cc?/]
- end
-end
diff --git a/spec/mspec/spec/runner/filters/tag_spec.rb b/spec/mspec/spec/runner/filters/tag_spec.rb
deleted file mode 100644
index fe1f3df039..0000000000
--- a/spec/mspec/spec/runner/filters/tag_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters/match'
-require 'mspec/runner/filters/tag'
-
-describe TagFilter, "#load" do
- before :each do
- @match = double("match filter").as_null_object
- @filter = TagFilter.new :include, "tag", "key"
- @tag = SpecTag.new "tag(comment):description"
- MSpec.stub(:read_tags).and_return([@tag])
- MSpec.stub(:register)
- end
-
- it "loads tags from the tag file" do
- MSpec.should_receive(:read_tags).with(["tag", "key"]).and_return([])
- @filter.load
- end
-
-
- it "registers itself with MSpec for the :include action" do
- filter = TagFilter.new(:include)
- MSpec.should_receive(:register).with(:include, filter)
- filter.load
- end
-
- it "registers itself with MSpec for the :exclude action" do
- filter = TagFilter.new(:exclude)
- MSpec.should_receive(:register).with(:exclude, filter)
- filter.load
- end
-end
-
-describe TagFilter, "#unload" do
- before :each do
- @filter = TagFilter.new :include, "tag", "key"
- @tag = SpecTag.new "tag(comment):description"
- MSpec.stub(:read_tags).and_return([@tag])
- MSpec.stub(:register)
- end
-
- it "unregisters itself" do
- @filter.load
- MSpec.should_receive(:unregister).with(:include, @filter)
- @filter.unload
- end
-end
-
-describe TagFilter, "#register" do
- before :each do
- MSpec.stub(:register)
- end
-
- it "registers itself with MSpec for the :load, :unload actions" do
- filter = TagFilter.new(nil)
- MSpec.should_receive(:register).with(:load, filter)
- MSpec.should_receive(:register).with(:unload, filter)
- filter.register
- end
-end
-
-describe TagFilter, "#unregister" do
- before :each do
- MSpec.stub(:unregister)
- end
-
- it "unregisters itself with MSpec for the :load, :unload actions" do
- filter = TagFilter.new(nil)
- MSpec.should_receive(:unregister).with(:load, filter)
- MSpec.should_receive(:unregister).with(:unload, filter)
- filter.unregister
- end
-end
-
-describe TagFilter, "#===" do
- before :each do
- @filter = TagFilter.new nil, "tag", "key"
- @tag = SpecTag.new "tag(comment):description"
- MSpec.stub(:read_tags).and_return([@tag])
- MSpec.stub(:register)
- @filter.load
- end
-
- it "returns true if the argument matches any of the descriptions" do
- @filter.===('description').should == true
- end
-
- it "returns false if the argument matches none of the descriptions" do
- @filter.===('descriptionA').should == false
- @filter.===('adescription').should == false
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/describe_spec.rb b/spec/mspec/spec/runner/formatters/describe_spec.rb
deleted file mode 100644
index 415ced71fb..0000000000
--- a/spec/mspec/spec/runner/formatters/describe_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/describe'
-require 'mspec/runner/example'
-
-describe DescribeFormatter, "#finish" do
- before :each do
- MSpec.stub(:register)
- MSpec.stub(:unregister)
-
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
- @timer.stub(:format).and_return("Finished in 2.0 seconds")
-
- $stdout = @out = IOStub.new
- context = ContextState.new "Class#method"
- @state = ExampleState.new(context, "runs")
-
- @formatter = DescribeFormatter.new
- @formatter.register
-
- @tally = @formatter.tally
- @counter = @tally.counter
-
- @counter.files!
- @counter.examples!
- @counter.expectations! 2
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a summary of elapsed time" do
- @formatter.finish
- @out.should =~ /^Finished in 2.0 seconds$/
- end
-
- it "prints a tally of counts" do
- @formatter.finish
- @out.should =~ /^1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged$/
- end
-
- it "does not print exceptions" do
- @formatter.finish
- @out.should == %[
-
-Finished in 2.0 seconds
-
-1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
-]
- end
-
- it "prints a summary of failures and errors for each describe block" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.finish
- @out.should == %[
-
-Class#method 0 failures, 1 error
-
-Finished in 2.0 seconds
-
-1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/dotted_spec.rb b/spec/mspec/spec/runner/formatters/dotted_spec.rb
deleted file mode 100644
index 1e9b06f6e1..0000000000
--- a/spec/mspec/spec/runner/formatters/dotted_spec.rb
+++ /dev/null
@@ -1,285 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/dotted'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/utils/script'
-
-describe DottedFormatter, "#initialize" do
- it "permits zero arguments" do
- DottedFormatter.new
- end
-
- it "accepts one argument" do
- DottedFormatter.new nil
- end
-end
-
-describe DottedFormatter, "#register" do
- before :each do
- @formatter = DottedFormatter.new
- MSpec.stub(:register)
- end
-
- it "registers self with MSpec for appropriate actions" do
- MSpec.should_receive(:register).with(:exception, @formatter)
- MSpec.should_receive(:register).with(:before, @formatter)
- MSpec.should_receive(:register).with(:after, @formatter)
- MSpec.should_receive(:register).with(:finish, @formatter)
- @formatter.register
- end
-
- it "creates TimerAction and TallyAction" do
- timer = double("timer")
- tally = double("tally")
- timer.should_receive(:register)
- tally.should_receive(:register)
- tally.should_receive(:counter)
- TimerAction.should_receive(:new).and_return(timer)
- TallyAction.should_receive(:new).and_return(tally)
- @formatter.register
- end
-end
-
-describe DottedFormatter, "#print" do
- before :each do
- $stdout = IOStub.new
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "writes to $stdout by default" do
- formatter = DottedFormatter.new
- formatter.print "begonias"
- $stdout.should == "begonias"
- end
-
- it "writes to the file specified when the formatter was created" do
- out = IOStub.new
- File.should_receive(:open).with("some/file", "w").and_return(out)
- formatter = DottedFormatter.new "some/file"
- formatter.print "begonias"
- out.should == "begonias"
- end
-
- it "flushes the IO output" do
- $stdout.should_receive(:flush)
- formatter = DottedFormatter.new
- formatter.print "begonias"
- end
-end
-
-describe DottedFormatter, "#exception" do
- before :each do
- @formatter = DottedFormatter.new
- @failure = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("failed")
- @error = ExceptionState.new nil, nil, MSpecExampleError.new("boom!")
- end
-
- it "sets the #failure? flag" do
- @formatter.exception @failure
- @formatter.failure?.should be_true
- @formatter.exception @error
- @formatter.failure?.should be_false
- end
-
- it "sets the #exception? flag" do
- @formatter.exception @error
- @formatter.exception?.should be_true
- @formatter.exception @failure
- @formatter.exception?.should be_true
- end
-
- it "addes the exception to the list of exceptions" do
- @formatter.exceptions.should == []
- @formatter.exception @error
- @formatter.exception @failure
- @formatter.exceptions.should == [@error, @failure]
- end
-end
-
-describe DottedFormatter, "#exception?" do
- before :each do
- @formatter = DottedFormatter.new
- @failure = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("failed")
- @error = ExceptionState.new nil, nil, MSpecExampleError.new("boom!")
- end
-
- it "returns false if there have been no exceptions" do
- @formatter.exception?.should be_false
- end
-
- it "returns true if any exceptions are errors" do
- @formatter.exception @failure
- @formatter.exception @error
- @formatter.exception?.should be_true
- end
-
- it "returns true if all exceptions are failures" do
- @formatter.exception @failure
- @formatter.exception @failure
- @formatter.exception?.should be_true
- end
-
- it "returns true if all exceptions are errors" do
- @formatter.exception @error
- @formatter.exception @error
- @formatter.exception?.should be_true
- end
-end
-
-describe DottedFormatter, "#failure?" do
- before :each do
- @formatter = DottedFormatter.new
- @failure = ExceptionState.new nil, nil, SpecExpectationNotMetError.new("failed")
- @error = ExceptionState.new nil, nil, MSpecExampleError.new("boom!")
- end
-
- it "returns false if there have been no exceptions" do
- @formatter.failure?.should be_false
- end
-
- it "returns false if any exceptions are errors" do
- @formatter.exception @failure
- @formatter.exception @error
- @formatter.failure?.should be_false
- end
-
- it "returns true if all exceptions are failures" do
- @formatter.exception @failure
- @formatter.exception @failure
- @formatter.failure?.should be_true
- end
-end
-
-describe DottedFormatter, "#before" do
- before :each do
- @state = ExampleState.new ContextState.new("describe"), "it"
- @formatter = DottedFormatter.new
- @formatter.exception ExceptionState.new(nil, nil, SpecExpectationNotMetError.new("Failed!"))
- end
-
- it "resets the #failure? flag to false" do
- @formatter.failure?.should be_true
- @formatter.before @state
- @formatter.failure?.should be_false
- end
-
- it "resets the #exception? flag to false" do
- @formatter.exception?.should be_true
- @formatter.before @state
- @formatter.exception?.should be_false
- end
-end
-
-describe DottedFormatter, "#after" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = DottedFormatter.new
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a '.' if there was no exception raised" do
- @formatter.after(@state)
- @out.should == "."
- end
-
- it "prints an 'F' if there was an expectation failure" do
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.after(@state)
- @out.should == "F"
- end
-
- it "prints an 'E' if there was an exception other than expectation failure" do
- exc = MSpecExampleError.new("boom!")
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.after(@state)
- @out.should == "E"
- end
-
- it "prints an 'E' if there are mixed exceptions and exepctation failures" do
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(@state, nil, exc)
- exc = MSpecExampleError.new("boom!")
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.after(@state)
- @out.should == "E"
- end
-end
-
-describe DottedFormatter, "#finish" do
- before :each do
- @tally = double("tally").as_null_object
- TallyAction.stub(:new).and_return(@tally)
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
-
- $stdout = @out = IOStub.new
- context = ContextState.new "Class#method"
- @state = ExampleState.new(context, "runs")
- MSpec.stub(:register)
- @formatter = DottedFormatter.new
- @formatter.register
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a failure message for an exception" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- @formatter.exception exc
- @formatter.after @state
- @formatter.finish
- @out.should =~ /^1\)\nClass#method runs ERROR$/
- end
-
- it "prints a backtrace for an exception" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.after @state
- @formatter.finish
- @out.should =~ %r[path/to/some/file.rb:35:in method$]
- end
-
- it "prints a summary of elapsed time" do
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @formatter.finish
- @out.should =~ /^Finished in 2.0 seconds$/
- end
-
- it "prints a tally of counts" do
- @tally.should_receive(:format).and_return("1 example, 0 failures")
- @formatter.finish
- @out.should =~ /^1 example, 0 failures$/
- end
-
- it "prints errors, backtraces, elapsed time, and tallies" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @tally.should_receive(:format).and_return("1 example, 1 failure")
- @formatter.after @state
- @formatter.finish
- @out.should ==
-%[E
-
-1)
-Class#method runs ERROR
-MSpecExampleError: broken
-path/to/some/file.rb:35:in method
-
-Finished in 2.0 seconds
-
-1 example, 1 failure
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/file_spec.rb b/spec/mspec/spec/runner/formatters/file_spec.rb
deleted file mode 100644
index 946683ad58..0000000000
--- a/spec/mspec/spec/runner/formatters/file_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/file'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-
-describe FileFormatter, "#register" do
- before :each do
- @formatter = FileFormatter.new
- MSpec.stub(:register)
- MSpec.stub(:unregister)
- end
-
- it "registers self with MSpec for :load, :unload actions" do
- MSpec.should_receive(:register).with(:load, @formatter)
- MSpec.should_receive(:register).with(:unload, @formatter)
- @formatter.register
- end
-
- it "unregisters self with MSpec for :before, :after actions" do
- MSpec.should_receive(:unregister).with(:before, @formatter)
- MSpec.should_receive(:unregister).with(:after, @formatter)
- @formatter.register
- end
-end
-
-describe FileFormatter, "#load" do
- before :each do
- @state = ExampleState.new ContextState.new("describe"), "it"
- @formatter = FileFormatter.new
- @formatter.exception ExceptionState.new(nil, nil, SpecExpectationNotMetError.new("Failed!"))
- end
-
- it "resets the #failure? flag to false" do
- @formatter.failure?.should be_true
- @formatter.load @state
- @formatter.failure?.should be_false
- end
-
- it "resets the #exception? flag to false" do
- @formatter.exception?.should be_true
- @formatter.load @state
- @formatter.exception?.should be_false
- end
-end
-
-describe FileFormatter, "#unload" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = FileFormatter.new
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a '.' if there was no exception raised" do
- @formatter.unload(@state)
- @out.should == "."
- end
-
- it "prints an 'F' if there was an expectation failure" do
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.unload(@state)
- @out.should == "F"
- end
-
- it "prints an 'E' if there was an exception other than expectation failure" do
- exc = MSpecExampleError.new("boom!")
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.unload(@state)
- @out.should == "E"
- end
-
- it "prints an 'E' if there are mixed exceptions and exepctation failures" do
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(@state, nil, exc)
- exc = MSpecExampleError.new("boom!")
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.unload(@state)
- @out.should == "E"
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/html_spec.rb b/spec/mspec/spec/runner/formatters/html_spec.rb
deleted file mode 100644
index 3783ab6a89..0000000000
--- a/spec/mspec/spec/runner/formatters/html_spec.rb
+++ /dev/null
@@ -1,216 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/guards/guard'
-require 'mspec/runner/formatters/html'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/utils/script'
-
-describe HtmlFormatter do
- before :each do
- @formatter = HtmlFormatter.new
- end
-
- it "responds to #register by registering itself with MSpec for appropriate actions" do
- MSpec.stub(:register)
- MSpec.should_receive(:register).with(:start, @formatter)
- MSpec.should_receive(:register).with(:enter, @formatter)
- MSpec.should_receive(:register).with(:leave, @formatter)
- @formatter.register
- end
-end
-
-describe HtmlFormatter, "#start" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = HtmlFormatter.new
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the HTML head" do
- @formatter.start
- ruby_engine = RUBY_ENGINE
- ruby_engine.should =~ /^#{ruby_engine}/
- @out.should ==
-%[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>Spec Output For #{ruby_engine} (#{RUBY_VERSION})</title>
-<style type="text/css">
-ul {
- list-style: none;
-}
-.fail {
- color: red;
-}
-.pass {
- color: green;
-}
-#details :target {
- background-color: #ffffe0;
-}
-</style>
-</head>
-<body>
-]
- end
-end
-
-describe HtmlFormatter, "#enter" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = HtmlFormatter.new
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the #describe string" do
- @formatter.enter "describe"
- @out.should == "<div><p>describe</p>\n<ul>\n"
- end
-end
-
-describe HtmlFormatter, "#leave" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = HtmlFormatter.new
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the closing tags for the #describe string" do
- @formatter.leave
- @out.should == "</ul>\n</div>\n"
- end
-end
-
-describe HtmlFormatter, "#exception" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = HtmlFormatter.new
- @formatter.register
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the #it string once for each exception raised" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("painful")
- @formatter.exception exc
- @out.should ==
-%[<li class="fail">- it (<a href="#details-1">FAILED - 1</a>)</li>
-<li class="fail">- it (<a href="#details-2">ERROR - 2</a>)</li>
-]
- end
-end
-
-describe HtmlFormatter, "#after" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = HtmlFormatter.new
- @formatter.register
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the #it once when there are no exceptions raised" do
- @formatter.after @state
- @out.should == %[<li class="pass">- it</li>\n]
- end
-
- it "does not print any output if an exception is raised" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- out = @out.dup
- @formatter.after @state
- @out.should == out
- end
-end
-
-describe HtmlFormatter, "#finish" do
- before :each do
- @tally = double("tally").as_null_object
- TallyAction.stub(:new).and_return(@tally)
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
-
- $stdout = @out = IOStub.new
- context = ContextState.new "describe"
- @state = ExampleState.new(context, "it")
- MSpec.stub(:register)
- @formatter = HtmlFormatter.new
- @formatter.register
- @exception = MSpecExampleError.new("broken")
- @exception.stub(:backtrace).and_return(["file.rb:1", "file.rb:2"])
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a failure message for an exception" do
- exc = ExceptionState.new @state, nil, @exception
- @formatter.exception exc
- @formatter.finish
- @out.should include "<p>describe it ERROR</p>"
- end
-
- it "prints a backtrace for an exception" do
- exc = ExceptionState.new @state, nil, @exception
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.finish
- @out.should =~ %r[<pre>.*path/to/some/file.rb:35:in method.*</pre>]m
- end
-
- it "prints a summary of elapsed time" do
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @formatter.finish
- @out.should include "<p>Finished in 2.0 seconds</p>\n"
- end
-
- it "prints a tally of counts" do
- @tally.should_receive(:format).and_return("1 example, 0 failures")
- @formatter.finish
- @out.should include '<p class="pass">1 example, 0 failures</p>'
- end
-
- it "prints errors, backtraces, elapsed time, and tallies" do
- exc = ExceptionState.new @state, nil, @exception
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
-
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @tally.should_receive(:format).and_return("1 example, 1 failures")
- @formatter.finish
- @out.should ==
-%[<li class=\"fail\">- it (<a href=\"#details-1\">ERROR - 1</a>)</li>
-<hr>
-<ol id="details">
-<li id="details-1"><p>describe it ERROR</p>
-<p>MSpecExampleError: broken</p>
-<pre>
-path/to/some/file.rb:35:in method</pre>
-</li>
-</ol>
-<p>Finished in 2.0 seconds</p>
-<p class="fail">1 example, 1 failures</p>
-</body>
-</html>
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/junit_spec.rb b/spec/mspec/spec/runner/formatters/junit_spec.rb
deleted file mode 100644
index 66e7d70e92..0000000000
--- a/spec/mspec/spec/runner/formatters/junit_spec.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-# -*- coding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/junit'
-require 'mspec/runner/example'
-
-describe JUnitFormatter, "#initialize" do
- it "permits zero arguments" do
- lambda { JUnitFormatter.new }.should_not raise_error
- end
-
- it "accepts one argument" do
- lambda { JUnitFormatter.new nil }.should_not raise_error
- end
-end
-
-describe JUnitFormatter, "#print" do
- before :each do
- $stdout = IOStub.new
- @out = IOStub.new
- File.stub(:open).and_return(@out)
- @formatter = JUnitFormatter.new "some/file"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "writes to $stdout if #switch has not been called" do
- @formatter.print "begonias"
- $stdout.should == "begonias"
- @out.should == ""
- end
-
- it "writes to the file passed to #initialize once #switch has been called" do
- @formatter.switch
- @formatter.print "begonias"
- $stdout.should == ""
- @out.should == "begonias"
- end
-
- it "writes to $stdout once #switch is called if no file was passed to #initialize" do
- formatter = JUnitFormatter.new
- formatter.switch
- formatter.print "begonias"
- $stdout.should == "begonias"
- @out.should == ""
- end
-end
-
-describe JUnitFormatter, "#finish" do
- before :each do
- @tally = double("tally").as_null_object
- @counter = double("counter").as_null_object
- @tally.stub(:counter).and_return(@counter)
- TallyAction.stub(:new).and_return(@tally)
-
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
-
- $stdout = IOStub.new
- context = ContextState.new "describe"
- @state = ExampleState.new(context, "it")
-
- @formatter = JUnitFormatter.new
- @formatter.stub(:backtrace).and_return("")
- MSpec.stub(:register)
- @formatter.register
-
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.after @state
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "calls #switch" do
- @formatter.should_receive(:switch)
- @formatter.finish
- end
-
- it "outputs a failure message and backtrace" do
- @formatter.finish
- $stdout.should include 'message="error in describe it" type="error"'
- $stdout.should include "MSpecExampleError: broken\n"
- $stdout.should include "path/to/some/file.rb:35:in method"
- end
-
- it "encodes message and backtrace in latin1 for jenkins" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken…")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in methød")
- @formatter.exception exc
- @formatter.finish
- $stdout.should =~ /MSpecExampleError: broken((\.\.\.)|\?)\n/
- $stdout.should =~ /path\/to\/some\/file\.rb:35:in meth(\?|o)d/
- end
-
- it "outputs an elapsed time" do
- @timer.should_receive(:elapsed).and_return(4.2)
- @formatter.finish
- $stdout.should include 'time="4.2"'
- end
-
- it "outputs overall elapsed time" do
- @timer.should_receive(:elapsed).and_return(4.2)
- @formatter.finish
- $stdout.should include 'timeCount="4.2"'
- end
-
- it "outputs the number of examples as test count" do
- @counter.should_receive(:examples).and_return(9)
- @formatter.finish
- $stdout.should include 'tests="9"'
- end
-
- it "outputs overall number of examples as test count" do
- @counter.should_receive(:examples).and_return(9)
- @formatter.finish
- $stdout.should include 'testCount="9"'
- end
-
- it "outputs a failure count" do
- @counter.should_receive(:failures).and_return(2)
- @formatter.finish
- $stdout.should include 'failureCount="2"'
- end
-
- it "outputs overall failure count" do
- @counter.should_receive(:failures).and_return(2)
- @formatter.finish
- $stdout.should include 'failures="2"'
- end
-
- it "outputs an error count" do
- @counter.should_receive(:errors).and_return(1)
- @formatter.finish
- $stdout.should include 'errors="1"'
- end
-
- it "outputs overall error count" do
- @counter.should_receive(:errors).and_return(1)
- @formatter.finish
- $stdout.should include 'errorCount="1"'
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/method_spec.rb b/spec/mspec/spec/runner/formatters/method_spec.rb
deleted file mode 100644
index 77204f74c5..0000000000
--- a/spec/mspec/spec/runner/formatters/method_spec.rb
+++ /dev/null
@@ -1,178 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/method'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-require 'mspec/utils/script'
-
-describe MethodFormatter, "#method_type" do
- before :each do
- @formatter = MethodFormatter.new
- end
-
- it "returns 'class' if the separator is '.' or '::'" do
- @formatter.method_type('.').should == "class"
- @formatter.method_type('::').should == "class"
- end
-
- it "returns 'instance' if the separator is '#'" do
- @formatter.method_type('#').should == "instance"
- end
-
- it "returns 'unknown' for all other cases" do
- @formatter.method_type(nil).should == "unknown"
- end
-end
-
-describe MethodFormatter, "#before" do
- before :each do
- @formatter = MethodFormatter.new
- MSpec.stub(:register)
- @formatter.register
- end
-
- it "resets the tally counters to 0" do
- @formatter.tally.counter.examples = 3
- @formatter.tally.counter.expectations = 4
- @formatter.tally.counter.failures = 2
- @formatter.tally.counter.errors = 1
-
- state = ExampleState.new ContextState.new("describe"), "it"
- @formatter.before state
- @formatter.tally.counter.examples.should == 0
- @formatter.tally.counter.expectations.should == 0
- @formatter.tally.counter.failures.should == 0
- @formatter.tally.counter.errors.should == 0
- end
-
- it "records the class, method if available" do
- state = ExampleState.new ContextState.new("Some#method"), "it"
- @formatter.before state
- key = "Some#method"
- @formatter.methods.keys.should include(key)
- h = @formatter.methods[key]
- h[:class].should == "Some"
- h[:method].should == "method"
- h[:description].should == "Some#method it"
- end
-
- it "does not record class, method unless both are available" do
- state = ExampleState.new ContextState.new("Some method"), "it"
- @formatter.before state
- key = "Some method"
- @formatter.methods.keys.should include(key)
- h = @formatter.methods[key]
- h[:class].should == ""
- h[:method].should == ""
- h[:description].should == "Some method it"
- end
-
- it "sets the method type to unknown if class and method are not available" do
- state = ExampleState.new ContextState.new("Some method"), "it"
- @formatter.before state
- key = "Some method"
- h = @formatter.methods[key]
- h[:type].should == "unknown"
- end
-
- it "sets the method type based on the class, method separator" do
- [["C#m", "instance"], ["C.m", "class"], ["C::m", "class"]].each do |k, t|
- state = ExampleState.new ContextState.new(k), "it"
- @formatter.before state
- h = @formatter.methods[k]
- h[:type].should == t
- end
- end
-
- it "clears the list of exceptions" do
- state = ExampleState.new ContextState.new("describe"), "it"
- @formatter.exceptions << "stuff"
- @formatter.before state
- @formatter.exceptions.should be_empty
- end
-end
-
-describe MethodFormatter, "#after" do
- before :each do
- @formatter = MethodFormatter.new
- MSpec.stub(:register)
- @formatter.register
- end
-
- it "sets the tally counts" do
- state = ExampleState.new ContextState.new("Some#method"), "it"
- @formatter.before state
-
- @formatter.tally.counter.examples = 3
- @formatter.tally.counter.expectations = 4
- @formatter.tally.counter.failures = 2
- @formatter.tally.counter.errors = 1
-
- @formatter.after state
- h = @formatter.methods["Some#method"]
- h[:examples].should == 3
- h[:expectations].should == 4
- h[:failures].should == 2
- h[:errors].should == 1
- end
-
- it "renders the list of exceptions" do
- state = ExampleState.new ContextState.new("Some#method"), "it"
- @formatter.before state
-
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(state, nil, exc)
- @formatter.exception ExceptionState.new(state, nil, exc)
-
- @formatter.after state
- h = @formatter.methods["Some#method"]
- h[:exceptions].should == [
- %[failed\n\n],
- %[failed\n\n]
- ]
- end
-end
-
-describe MethodFormatter, "#after" do
- before :each do
- $stdout = IOStub.new
- context = ContextState.new "Class#method"
- @state = ExampleState.new(context, "runs")
- @formatter = MethodFormatter.new
- MSpec.stub(:register)
- @formatter.register
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a summary of the results of an example in YAML format" do
- @formatter.before @state
- @formatter.tally.counter.examples = 3
- @formatter.tally.counter.expectations = 4
- @formatter.tally.counter.failures = 2
- @formatter.tally.counter.errors = 1
-
- exc = SpecExpectationNotMetError.new "failed"
- @formatter.exception ExceptionState.new(@state, nil, exc)
- @formatter.exception ExceptionState.new(@state, nil, exc)
-
- @formatter.after @state
- @formatter.finish
- $stdout.should ==
-%[---
-"Class#method":
- class: "Class"
- method: "method"
- type: instance
- description: "Class#method runs"
- examples: 3
- expectations: 4
- failures: 2
- errors: 1
- exceptions:
- - "failed\\n\\n"
- - "failed\\n\\n"
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/multi_spec.rb b/spec/mspec/spec/runner/formatters/multi_spec.rb
deleted file mode 100644
index afcc7e9cea..0000000000
--- a/spec/mspec/spec/runner/formatters/multi_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/multi'
-require 'mspec/runner/example'
-
-describe MultiFormatter, "#aggregate_results" do
- before :each do
- @stdout, $stdout = $stdout, IOStub.new
-
- @file = double("file").as_null_object
-
- File.stub(:delete)
- YAML.stub(:load)
-
- @hash = { "files"=>1, "examples"=>1, "expectations"=>2, "failures"=>0, "errors"=>0 }
- File.stub(:open).and_yield(@file).and_return(@hash)
-
- @formatter = MultiFormatter.new
- @formatter.timer.stub(:format).and_return("Finished in 42 seconds")
- end
-
- after :each do
- $stdout = @stdout
- end
-
- it "outputs a summary without errors" do
- @formatter.aggregate_results(["a", "b"])
- @formatter.finish
- $stdout.should ==
-%[
-
-Finished in 42 seconds
-
-2 files, 2 examples, 4 expectations, 0 failures, 0 errors, 0 tagged
-]
- end
-
- it "outputs a summary with errors" do
- @hash["exceptions"] = [
- "Some#method works real good FAILED\nExpected real good\n to equal fail\n\nfoo.rb:1\nfoo.rb:2",
- "Some#method never fails ERROR\nExpected 5\n to equal 3\n\nfoo.rb:1\nfoo.rb:2"
- ]
- @formatter.aggregate_results(["a"])
- @formatter.finish
- $stdout.should ==
-%[
-
-1)
-Some#method works real good FAILED
-Expected real good
- to equal fail
-
-foo.rb:1
-foo.rb:2
-
-2)
-Some#method never fails ERROR
-Expected 5
- to equal 3
-
-foo.rb:1
-foo.rb:2
-
-Finished in 42 seconds
-
-1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/specdoc_spec.rb b/spec/mspec/spec/runner/formatters/specdoc_spec.rb
deleted file mode 100644
index edb439fc11..0000000000
--- a/spec/mspec/spec/runner/formatters/specdoc_spec.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/specdoc'
-require 'mspec/runner/example'
-
-describe SpecdocFormatter do
- before :each do
- @formatter = SpecdocFormatter.new
- end
-
- it "responds to #register by registering itself with MSpec for appropriate actions" do
- MSpec.stub(:register)
- MSpec.should_receive(:register).with(:enter, @formatter)
- @formatter.register
- end
-end
-
-describe SpecdocFormatter, "#enter" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = SpecdocFormatter.new
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the #describe string" do
- @formatter.enter("describe")
- @out.should == "\ndescribe\n"
- end
-end
-
-describe SpecdocFormatter, "#before" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = SpecdocFormatter.new
- @state = ExampleState.new ContextState.new("describe"), "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints the #it string" do
- @formatter.before @state
- @out.should == "- it"
- end
-
- it "resets the #exception? flag" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- @formatter.exception?.should be_true
- @formatter.before @state
- @formatter.exception?.should be_false
- end
-end
-
-describe SpecdocFormatter, "#exception" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = SpecdocFormatter.new
- context = ContextState.new "describe"
- @state = ExampleState.new context, "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints 'ERROR' if an exception is not an SpecExpectationNotMetError" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("painful")
- @formatter.exception exc
- @out.should == " (ERROR - 1)"
- end
-
- it "prints 'FAILED' if an exception is an SpecExpectationNotMetError" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- @out.should == " (FAILED - 1)"
- end
-
- it "prints the #it string if an exception has already been raised" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("painful")
- @formatter.exception exc
- @out.should == " (FAILED - 1)\n- it (ERROR - 2)"
- end
-end
-
-describe SpecdocFormatter, "#after" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = SpecdocFormatter.new
- @state = ExampleState.new "describe", "it"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a newline character" do
- @formatter.after @state
- @out.should == "\n"
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/spinner_spec.rb b/spec/mspec/spec/runner/formatters/spinner_spec.rb
deleted file mode 100644
index a122620e39..0000000000
--- a/spec/mspec/spec/runner/formatters/spinner_spec.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/spinner'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-
-describe SpinnerFormatter, "#initialize" do
- it "permits zero arguments" do
- SpinnerFormatter.new
- end
-
- it "accepts one argument" do
- SpinnerFormatter.new nil
- end
-end
-
-describe SpinnerFormatter, "#register" do
- before :each do
- @formatter = SpinnerFormatter.new
- MSpec.stub(:register)
- end
-
- it "registers self with MSpec for appropriate actions" do
- MSpec.should_receive(:register).with(:start, @formatter)
- MSpec.should_receive(:register).with(:unload, @formatter)
- MSpec.should_receive(:register).with(:after, @formatter)
- MSpec.should_receive(:register).with(:finish, @formatter)
- @formatter.register
- end
-
- it "creates TimerAction and TallyAction" do
- timer = double("timer")
- tally = double("tally")
- timer.should_receive(:register)
- tally.should_receive(:register)
- tally.should_receive(:counter)
- TimerAction.should_receive(:new).and_return(timer)
- TallyAction.should_receive(:new).and_return(tally)
- @formatter.register
- end
-end
-
-describe SpinnerFormatter, "#print" do
- after :each do
- $stdout = STDOUT
- end
-
- it "ignores the argument to #initialize and writes to $stdout" do
- $stdout = IOStub.new
- formatter = SpinnerFormatter.new "some/file"
- formatter.print "begonias"
- $stdout.should == "begonias"
- end
-end
-
-describe SpinnerFormatter, "#after" do
- before :each do
- $stdout = IOStub.new
- MSpec.store(:files, ["a", "b", "c", "d"])
- @formatter = SpinnerFormatter.new
- @formatter.register
- @state = ExampleState.new("describe", "it")
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "updates the spinner" do
- @formatter.start
- @formatter.after @state
- @formatter.unload
-
- if ENV["TERM"] != "dumb"
- green = "\e[0;32m"
- reset = "\e[0m"
- end
-
- output = "\r[/ | 0% | 00:00:00] #{green} 0F #{green} 0E#{reset} " \
- "\r[- | 0% | 00:00:00] #{green} 0F #{green} 0E#{reset} " \
- "\r[\\ | ========== 25% | 00:00:00] #{green} 0F #{green} 0E#{reset} "
- $stdout.should == output
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/summary_spec.rb b/spec/mspec/spec/runner/formatters/summary_spec.rb
deleted file mode 100644
index 16a156b695..0000000000
--- a/spec/mspec/spec/runner/formatters/summary_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/summary'
-require 'mspec/runner/example'
-
-describe SummaryFormatter, "#after" do
- before :each do
- $stdout = @out = IOStub.new
- @formatter = SummaryFormatter.new
- @formatter.register
- context = ContextState.new "describe"
- @state = ExampleState.new(context, "it")
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "does not print anything" do
- exc = ExceptionState.new @state, nil, SpecExpectationNotMetError.new("disappointing")
- @formatter.exception exc
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("painful")
- @formatter.exception exc
- @formatter.after(@state)
- @out.should == ""
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/unit_spec.rb b/spec/mspec/spec/runner/formatters/unit_spec.rb
deleted file mode 100644
index 18167a32b8..0000000000
--- a/spec/mspec/spec/runner/formatters/unit_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/unit'
-require 'mspec/runner/example'
-require 'mspec/utils/script'
-
-describe UnitdiffFormatter, "#finish" do
- before :each do
- @tally = double("tally").as_null_object
- TallyAction.stub(:new).and_return(@tally)
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
-
- $stdout = @out = IOStub.new
- context = ContextState.new "describe"
- @state = ExampleState.new(context, "it")
- MSpec.stub(:register)
- @formatter = UnitdiffFormatter.new
- @formatter.register
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "prints a failure message for an exception" do
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- @formatter.exception exc
- @formatter.after @state
- @formatter.finish
- @out.should =~ /^1\)\ndescribe it ERROR$/
- end
-
- it "prints a backtrace for an exception" do
- exc = ExceptionState.new @state, nil, Exception.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.finish
- @out.should =~ %r[path/to/some/file.rb:35:in method$]
- end
-
- it "prints a summary of elapsed time" do
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @formatter.finish
- @out.should =~ /^Finished in 2.0 seconds$/
- end
-
- it "prints a tally of counts" do
- @tally.should_receive(:format).and_return("1 example, 0 failures")
- @formatter.finish
- @out.should =~ /^1 example, 0 failures$/
- end
-
- it "prints errors, backtraces, elapsed time, and tallies" do
- exc = ExceptionState.new @state, nil, Exception.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.after @state
- @timer.should_receive(:format).and_return("Finished in 2.0 seconds")
- @tally.should_receive(:format).and_return("1 example, 0 failures")
- @formatter.finish
- @out.should ==
-%[E
-
-Finished in 2.0 seconds
-
-1)
-describe it ERROR
-Exception: broken:
-path/to/some/file.rb:35:in method
-
-1 example, 0 failures
-]
- end
-end
diff --git a/spec/mspec/spec/runner/formatters/yaml_spec.rb b/spec/mspec/spec/runner/formatters/yaml_spec.rb
deleted file mode 100644
index eb4d99f74c..0000000000
--- a/spec/mspec/spec/runner/formatters/yaml_spec.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require 'mspec/runner/formatters/yaml'
-require 'mspec/runner/example'
-
-describe YamlFormatter, "#initialize" do
- it "permits zero arguments" do
- YamlFormatter.new
- end
-
- it "accepts one argument" do
- YamlFormatter.new nil
- end
-end
-
-describe YamlFormatter, "#print" do
- before :each do
- $stdout = IOStub.new
- @out = IOStub.new
- File.stub(:open).and_return(@out)
- @formatter = YamlFormatter.new "some/file"
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "writes to $stdout if #switch has not been called" do
- @formatter.print "begonias"
- $stdout.should == "begonias"
- @out.should == ""
- end
-
- it "writes to the file passed to #initialize once #switch has been called" do
- @formatter.switch
- @formatter.print "begonias"
- $stdout.should == ""
- @out.should == "begonias"
- end
-
- it "writes to $stdout once #switch is called if no file was passed to #initialize" do
- formatter = YamlFormatter.new
- formatter.switch
- formatter.print "begonias"
- $stdout.should == "begonias"
- @out.should == ""
- end
-end
-
-describe YamlFormatter, "#finish" do
- before :each do
- @tally = double("tally").as_null_object
- @counter = double("counter").as_null_object
- @tally.stub(:counter).and_return(@counter)
- TallyAction.stub(:new).and_return(@tally)
-
- @timer = double("timer").as_null_object
- TimerAction.stub(:new).and_return(@timer)
-
- $stdout = IOStub.new
- context = ContextState.new "describe"
- @state = ExampleState.new(context, "it")
-
- @formatter = YamlFormatter.new
- @formatter.stub(:backtrace).and_return("")
- MSpec.stub(:register)
- @formatter.register
-
- exc = ExceptionState.new @state, nil, MSpecExampleError.new("broken")
- exc.stub(:backtrace).and_return("path/to/some/file.rb:35:in method")
- @formatter.exception exc
- @formatter.after @state
- end
-
- after :each do
- $stdout = STDOUT
- end
-
- it "calls #switch" do
- @formatter.should_receive(:switch)
- @formatter.finish
- end
-
- it "outputs a failure message and backtrace" do
- @formatter.finish
- $stdout.should include "describe it ERROR"
- $stdout.should include "MSpecExampleError: broken\\n"
- $stdout.should include "path/to/some/file.rb:35:in method"
- end
-
- it "outputs an elapsed time" do
- @timer.should_receive(:elapsed).and_return(4.2)
- @formatter.finish
- $stdout.should include "time: 4.2"
- end
-
- it "outputs a file count" do
- @counter.should_receive(:files).and_return(3)
- @formatter.finish
- $stdout.should include "files: 3"
- end
-
- it "outputs an example count" do
- @counter.should_receive(:examples).and_return(3)
- @formatter.finish
- $stdout.should include "examples: 3"
- end
-
- it "outputs an expectation count" do
- @counter.should_receive(:expectations).and_return(9)
- @formatter.finish
- $stdout.should include "expectations: 9"
- end
-
- it "outputs a failure count" do
- @counter.should_receive(:failures).and_return(2)
- @formatter.finish
- $stdout.should include "failures: 2"
- end
-
- it "outputs an error count" do
- @counter.should_receive(:errors).and_return(1)
- @formatter.finish
- $stdout.should include "errors: 1"
- end
-end
diff --git a/spec/mspec/spec/runner/mspec_spec.rb b/spec/mspec/spec/runner/mspec_spec.rb
deleted file mode 100644
index 91338c6ddb..0000000000
--- a/spec/mspec/spec/runner/mspec_spec.rb
+++ /dev/null
@@ -1,595 +0,0 @@
-require 'spec_helper'
-require 'mspec/helpers/tmp'
-require 'mspec/helpers/fs'
-require 'mspec/matchers/base'
-require 'mspec/runner/mspec'
-require 'mspec/runner/example'
-
-describe MSpec, ".register_files" do
- it "records which spec files to run" do
- MSpec.register_files [:one, :two, :three]
- MSpec.retrieve(:files).should == [:one, :two, :three]
- end
-end
-
-describe MSpec, ".register_mode" do
- before :each do
- MSpec.clear_modes
- end
-
- it "sets execution mode flags" do
- MSpec.register_mode :verify
- MSpec.retrieve(:modes).should == [:verify]
- end
-end
-
-describe MSpec, ".register_tags_patterns" do
- it "records the patterns for generating a tag file from a spec file" do
- MSpec.register_tags_patterns [[/spec\/ruby/, "spec/tags"], [/frozen/, "ruby"]]
- MSpec.retrieve(:tags_patterns).should == [[/spec\/ruby/, "spec/tags"], [/frozen/, "ruby"]]
- end
-end
-
-describe MSpec, ".register_exit" do
- before :each do
- MSpec.store :exit, 0
- end
-
- it "records the exit code" do
- MSpec.exit_code.should == 0
- MSpec.register_exit 1
- MSpec.exit_code.should == 1
- end
-end
-
-describe MSpec, ".exit_code" do
- it "retrieves the code set with .register_exit" do
- MSpec.register_exit 99
- MSpec.exit_code.should == 99
- end
-end
-
-describe MSpec, ".store" do
- it "records data for MSpec settings" do
- MSpec.store :anything, :value
- MSpec.retrieve(:anything).should == :value
- end
-end
-
-describe MSpec, ".retrieve" do
- it "accesses .store'd data" do
- MSpec.register :retrieve, :first
- MSpec.retrieve(:retrieve).should == [:first]
- end
-end
-
-describe MSpec, ".randomize" do
- it "sets the flag to randomize spec execution order" do
- MSpec.randomize?.should == false
- MSpec.randomize
- MSpec.randomize?.should == true
- MSpec.randomize false
- MSpec.randomize?.should == false
- end
-end
-
-describe MSpec, ".register" do
- it "is the gateway behind the register(symbol, action) facility" do
- MSpec.register :bonus, :first
- MSpec.register :bonus, :second
- MSpec.register :bonus, :second
- MSpec.retrieve(:bonus).should == [:first, :second]
- end
-end
-
-describe MSpec, ".unregister" do
- it "is the gateway behind the unregister(symbol, actions) facility" do
- MSpec.register :unregister, :first
- MSpec.register :unregister, :second
- MSpec.unregister :unregister, :second
- MSpec.retrieve(:unregister).should == [:first]
- end
-end
-
-describe MSpec, ".protect" do
- before :each do
- MSpec.clear_current
- @cs = ContextState.new "C#m"
- @cs.parent = MSpec.current
-
- @es = ExampleState.new @cs, "runs"
- ScratchPad.record Exception.new("Sharp!")
- end
-
- it "returns true if no exception is raised" do
- MSpec.protect("passed") { 1 }.should be_true
- end
-
- it "returns false if an exception is raised" do
- MSpec.protect("testing") { raise ScratchPad.recorded }.should be_false
- end
-
- it "rescues any exceptions raised when evaluating the block argument" do
- MSpec.protect("") { raise Exception, "Now you see me..." }
- end
-
- it "does not rescue SystemExit" do
- begin
- MSpec.protect("") { exit 1 }
- rescue SystemExit
- ScratchPad.record :system_exit
- end
- ScratchPad.recorded.should == :system_exit
- end
-
- it "calls all the exception actions" do
- exc = ExceptionState.new @es, "testing", ScratchPad.recorded
- ExceptionState.stub(:new).and_return(exc)
- action = double("exception")
- action.should_receive(:exception).with(exc)
- MSpec.register :exception, action
- MSpec.protect("testing") { raise ScratchPad.recorded }
- MSpec.unregister :exception, action
- end
-
- it "registers a non-zero exit code when an exception is raised" do
- MSpec.should_receive(:register_exit).with(1)
- MSpec.protect("testing") { raise ScratchPad.recorded }
- end
-end
-
-describe MSpec, ".register_current" do
- before :each do
- MSpec.clear_current
- end
-
- it "sets the value returned by MSpec.current" do
- MSpec.current.should be_nil
- MSpec.register_current :a
- MSpec.current.should == :a
- end
-end
-
-describe MSpec, ".clear_current" do
- it "sets the value returned by MSpec.current to nil" do
- MSpec.register_current :a
- MSpec.current.should_not be_nil
- MSpec.clear_current
- MSpec.current.should be_nil
- end
-end
-
-describe MSpec, ".current" do
- before :each do
- MSpec.clear_current
- end
-
- it "returns nil if no ContextState has been registered" do
- MSpec.current.should be_nil
- end
-
- it "returns the most recently registered ContextState" do
- first = ContextState.new ""
- second = ContextState.new ""
- MSpec.register_current first
- MSpec.current.should == first
- MSpec.register_current second
- MSpec.current.should == second
- end
-end
-
-describe MSpec, ".actions" do
- before :each do
- MSpec.store :start, []
- ScratchPad.record []
- start_one = double("one")
- start_one.stub(:start).and_return { ScratchPad << :one }
- start_two = double("two")
- start_two.stub(:start).and_return { ScratchPad << :two }
- MSpec.register :start, start_one
- MSpec.register :start, start_two
- end
-
- it "does not attempt to run any actions if none have been registered" do
- MSpec.store :finish, nil
- lambda { MSpec.actions :finish }.should_not raise_error
- end
-
- it "runs each action registered as a start action" do
- MSpec.actions :start
- ScratchPad.recorded.should == [:one, :two]
- end
-end
-
-describe MSpec, ".mode?" do
- before :each do
- MSpec.clear_modes
- end
-
- it "returns true if the mode has been set" do
- MSpec.mode?(:verify).should == false
- MSpec.register_mode :verify
- MSpec.mode?(:verify).should == true
- end
-end
-
-describe MSpec, ".clear_modes" do
- it "clears all registered modes" do
- MSpec.register_mode(:pretend)
- MSpec.register_mode(:verify)
-
- MSpec.mode?(:pretend).should == true
- MSpec.mode?(:verify).should == true
-
- MSpec.clear_modes
-
- MSpec.mode?(:pretend).should == false
- MSpec.mode?(:verify).should == false
- end
-end
-
-describe MSpec, ".guarded?" do
- before :each do
- MSpec.instance_variable_set :@guarded, []
- end
-
- it "returns false if no guard has run" do
- MSpec.guarded?.should == false
- end
-
- it "returns true if a single guard has run" do
- MSpec.guard
- MSpec.guarded?.should == true
- end
-
- it "returns true if more than one guard has run" do
- MSpec.guard
- MSpec.guard
- MSpec.guarded?.should == true
- end
-
- it "returns true until all guards have finished" do
- MSpec.guard
- MSpec.guard
- MSpec.guarded?.should == true
- MSpec.unguard
- MSpec.guarded?.should == true
- MSpec.unguard
- MSpec.guarded?.should == false
- end
-end
-
-describe MSpec, ".describe" do
- before :each do
- MSpec.clear_current
- @cs = ContextState.new ""
- ContextState.stub(:new).and_return(@cs)
- MSpec.stub(:current).and_return(nil)
- MSpec.stub(:register_current)
- end
-
- it "creates a new ContextState for the block" do
- ContextState.should_receive(:new).and_return(@cs)
- MSpec.describe(Object) { }
- end
-
- it "accepts an optional second argument" do
- ContextState.should_receive(:new).and_return(@cs)
- MSpec.describe(Object, "msg") { }
- end
-
- it "registers the newly created ContextState" do
- MSpec.should_receive(:register_current).with(@cs).twice
- MSpec.describe(Object) { }
- end
-
- it "invokes the ContextState#describe method" do
- prc = lambda { }
- @cs.should_receive(:describe).with(&prc)
- MSpec.describe(Object, "msg", &prc)
- end
-end
-
-describe MSpec, ".process" do
- before :each do
- MSpec.stub(:files)
- MSpec.store :start, []
- MSpec.store :finish, []
- STDOUT.stub(:puts)
- end
-
- it "prints the RUBY_DESCRIPTION" do
- STDOUT.should_receive(:puts).with(RUBY_DESCRIPTION)
- MSpec.process
- end
-
- it "calls all start actions" do
- start = double("start")
- start.stub(:start).and_return { ScratchPad.record :start }
- MSpec.register :start, start
- MSpec.process
- ScratchPad.recorded.should == :start
- end
-
- it "calls all finish actions" do
- finish = double("finish")
- finish.stub(:finish).and_return { ScratchPad.record :finish }
- MSpec.register :finish, finish
- MSpec.process
- ScratchPad.recorded.should == :finish
- end
-
- it "calls the files method" do
- MSpec.should_receive(:files)
- MSpec.process
- end
-end
-
-describe MSpec, ".files" do
- before :each do
- MSpec.store :load, []
- MSpec.store :unload, []
- MSpec.register_files [:one, :two, :three]
- Kernel.stub(:load)
- end
-
- it "calls load actions before each file" do
- load = double("load")
- load.stub(:load).and_return { ScratchPad.record :load }
- MSpec.register :load, load
- MSpec.files
- ScratchPad.recorded.should == :load
- end
-
- it "shuffles the file list if .randomize? is true" do
- MSpec.randomize
- MSpec.should_receive(:shuffle)
- MSpec.files
- MSpec.randomize false
- end
-
- it "registers the current file" do
- MSpec.should_receive(:store).with(:file, :one)
- MSpec.should_receive(:store).with(:file, :two)
- MSpec.should_receive(:store).with(:file, :three)
- MSpec.files
- end
-end
-
-describe MSpec, ".shuffle" do
- before :each do
- @base = (0..100).to_a
- @list = @base.clone
- MSpec.shuffle @list
- end
-
- it "does not alter the elements in the list" do
- @base.each do |elt|
- @list.should include(elt)
- end
- end
-
- it "changes the order of the list" do
- # obviously, this spec has a certain probability
- # of failing. If it fails, run it again.
- @list.should_not == @base
- end
-end
-
-describe MSpec, ".tags_file" do
- before :each do
- MSpec.store :file, "path/to/spec/something/some_spec.rb"
- MSpec.store :tags_patterns, nil
- end
-
- it "returns the default tags file for the current spec file" do
- MSpec.tags_file.should == "path/to/spec/tags/something/some_tags.txt"
- end
-
- it "returns the tags file for the current spec file with custom tags_patterns" do
- MSpec.register_tags_patterns [[/^(.*)\/spec/, '\1/tags'], [/_spec.rb/, "_tags.txt"]]
- MSpec.tags_file.should == "path/to/tags/something/some_tags.txt"
- end
-
- it "performs multiple substitutions" do
- MSpec.register_tags_patterns [
- [%r(/spec/something/), "/spec/other/"],
- [%r(/spec/), "/spec/tags/"],
- [/_spec.rb/, "_tags.txt"]
- ]
- MSpec.tags_file.should == "path/to/spec/tags/other/some_tags.txt"
- end
-
- it "handles cases where no substitution is performed" do
- MSpec.register_tags_patterns [[/nothing/, "something"]]
- MSpec.tags_file.should == "path/to/spec/something/some_spec.rb"
- end
-end
-
-describe MSpec, ".read_tags" do
- before :each do
- MSpec.stub(:tags_file).and_return(File.dirname(__FILE__) + '/tags.txt')
- end
-
- it "returns a list of tag instances for matching tag names found" do
- one = SpecTag.new "fail(broken):Some#method? works"
- MSpec.read_tags(["fail", "pass"]).should == [one]
- end
-
- it "returns [] if no tags names match" do
- MSpec.read_tags("super").should == []
- end
-end
-
-describe MSpec, ".read_tags" do
- before :each do
- @tag = SpecTag.new "fails:Some#method"
- File.open(tmp("tags.txt", false), "w") do |f|
- f.puts ""
- f.puts @tag
- f.puts ""
- end
- MSpec.stub(:tags_file).and_return(tmp("tags.txt", false))
- end
-
- it "does not return a tag object for empty lines" do
- MSpec.read_tags(["fails"]).should == [@tag]
- end
-end
-
-describe MSpec, ".write_tags" do
- before :each do
- FileUtils.cp File.dirname(__FILE__) + "/tags.txt", tmp("tags.txt", false)
- MSpec.stub(:tags_file).and_return(tmp("tags.txt", false))
- @tag1 = SpecTag.new "check(broken):Tag#rewrite works"
- @tag2 = SpecTag.new "broken:Tag#write_tags fails"
- end
-
- after :all do
- rm_r tmp("tags.txt", false)
- end
-
- it "overwrites the tags in the tag file" do
- IO.read(tmp("tags.txt", false)).should == %[fail(broken):Some#method? works
-incomplete(20%):The#best method ever
-benchmark(0.01825):The#fastest method today
-extended():\"Multi-line\\ntext\\ntag\"
-]
- MSpec.write_tags [@tag1, @tag2]
- IO.read(tmp("tags.txt", false)).should == %[check(broken):Tag#rewrite works
-broken:Tag#write_tags fails
-]
- end
-end
-
-describe MSpec, ".write_tag" do
- before :each do
- FileUtils.stub(:mkdir_p)
- MSpec.stub(:tags_file).and_return(tmp("tags.txt", false))
- @tag = SpecTag.new "fail(broken):Some#method works"
- end
-
- after :all do
- rm_r tmp("tags.txt", false)
- end
-
- it "writes a tag to the tags file for the current spec file" do
- MSpec.write_tag @tag
- IO.read(tmp("tags.txt", false)).should == "fail(broken):Some#method works\n"
- end
-
- it "does not write a duplicate tag" do
- File.open(tmp("tags.txt", false), "w") { |f| f.puts @tag }
- MSpec.write_tag @tag
- IO.read(tmp("tags.txt", false)).should == "fail(broken):Some#method works\n"
- end
-end
-
-describe MSpec, ".delete_tag" do
- before :each do
- FileUtils.cp File.dirname(__FILE__) + "/tags.txt", tmp("tags.txt", false)
- MSpec.stub(:tags_file).and_return(tmp("tags.txt", false))
- @tag = SpecTag.new "fail(Comments don't matter):Some#method? works"
- end
-
- after :each do
- rm_r tmp("tags.txt", false)
- end
-
- it "deletes the tag if it exists" do
- MSpec.delete_tag(@tag).should == true
- IO.read(tmp("tags.txt", false)).should == %[incomplete(20%):The#best method ever
-benchmark(0.01825):The#fastest method today
-extended():\"Multi-line\\ntext\\ntag\"
-]
- end
-
- it "deletes a tag with escaped newlines" do
- MSpec.delete_tag(SpecTag.new('extended:"Multi-line\ntext\ntag"')).should == true
- IO.read(tmp("tags.txt", false)).should == %[fail(broken):Some#method? works
-incomplete(20%):The#best method ever
-benchmark(0.01825):The#fastest method today
-]
- end
-
- it "does not change the tags file contents if the tag doesn't exist" do
- @tag.tag = "failed"
- MSpec.delete_tag(@tag).should == false
- IO.read(tmp("tags.txt", false)).should == %[fail(broken):Some#method? works
-incomplete(20%):The#best method ever
-benchmark(0.01825):The#fastest method today
-extended():\"Multi-line\\ntext\\ntag\"
-]
- end
-
- it "deletes the tag file if it is empty" do
- MSpec.delete_tag(@tag).should == true
- MSpec.delete_tag(SpecTag.new("incomplete:The#best method ever")).should == true
- MSpec.delete_tag(SpecTag.new("benchmark:The#fastest method today")).should == true
- MSpec.delete_tag(SpecTag.new('extended:"Multi-line\ntext\ntag"')).should == true
- File.exist?(tmp("tags.txt", false)).should == false
- end
-end
-
-describe MSpec, ".delete_tags" do
- before :each do
- @tags = tmp("tags.txt", false)
- FileUtils.cp File.dirname(__FILE__) + "/tags.txt", @tags
- MSpec.stub(:tags_file).and_return(@tags)
- end
-
- it "deletes the tag file" do
- MSpec.delete_tags
- File.exist?(@tags).should be_false
- end
-end
-
-describe MSpec, ".expectation" do
- it "sets the flag that an expectation has been reported" do
- MSpec.clear_expectations
- MSpec.expectation?.should be_false
- MSpec.expectation
- MSpec.expectation?.should be_true
- end
-end
-
-describe MSpec, ".expectation?" do
- it "returns true if an expectation has been reported" do
- MSpec.expectation
- MSpec.expectation?.should be_true
- end
-
- it "returns false if an expectation has not been reported" do
- MSpec.clear_expectations
- MSpec.expectation?.should be_false
- end
-end
-
-describe MSpec, ".clear_expectations" do
- it "clears the flag that an expectation has been reported" do
- MSpec.expectation
- MSpec.expectation?.should be_true
- MSpec.clear_expectations
- MSpec.expectation?.should be_false
- end
-end
-
-describe MSpec, ".register_shared" do
- it "stores a shared ContextState by description" do
- parent = ContextState.new "container"
- state = ContextState.new "shared"
- state.parent = parent
- prc = lambda { }
- state.describe(&prc)
- MSpec.register_shared(state)
- MSpec.retrieve(:shared)["shared"].should == state
- end
-end
-
-describe MSpec, ".retrieve_shared" do
- it "retrieves the shared ContextState matching description" do
- state = ContextState.new ""
- MSpec.retrieve(:shared)["shared"] = state
- MSpec.retrieve_shared(:shared).should == state
- end
-end
diff --git a/spec/mspec/spec/runner/shared_spec.rb b/spec/mspec/spec/runner/shared_spec.rb
deleted file mode 100644
index b91800b7db..0000000000
--- a/spec/mspec/spec/runner/shared_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'spec_helper'
-require 'mspec/runner/shared'
-require 'mspec/runner/context'
-require 'mspec/runner/example'
-
-describe Object, "#it_behaves_like" do
- before :each do
- ScratchPad.clear
-
- MSpec.setup_env
-
- @state = ContextState.new "Top level"
- @state.instance_variable_set :@parsed, true
- @state.singleton_class.send(:public, :it_behaves_like)
-
- @shared = ContextState.new :shared_spec, :shared => true
- MSpec.stub(:retrieve_shared).and_return(@shared)
- end
-
- it "creates @method set to the name of the aliased method" do
- @shared.it("an example") { ScratchPad.record @method }
- @state.it_behaves_like :shared_spec, :some_method
- @state.process
- ScratchPad.recorded.should == :some_method
- end
-
- it "creates @object if the passed object" do
- object = Object.new
- @shared.it("an example") { ScratchPad.record @object }
- @state.it_behaves_like :shared_spec, :some_method, object
- @state.process
- ScratchPad.recorded.should == object
- end
-
- it "creates @object if the passed false" do
- object = false
- @shared.it("an example") { ScratchPad.record @object }
- @state.it_behaves_like :shared_spec, :some_method, object
- @state.process
- ScratchPad.recorded.should == object
- end
-
- it "sends :it_should_behave_like" do
- @state.should_receive(:it_should_behave_like)
- @state.it_behaves_like :shared_spec, :some_method
- end
-
- describe "with multiple shared contexts" do
- before :each do
- @obj = Object.new
- @obj2 = Object.new
-
- @state2 = ContextState.new "Second top level"
- @state2.instance_variable_set :@parsed, true
- @state2.singleton_class.send(:public, :it_behaves_like)
- end
-
- it "ensures the shared spec state is distinct" do
- @shared.it("an example") { ScratchPad.record [@method, @object] }
-
- @state.it_behaves_like :shared_spec, :some_method, @obj
-
- @state.process
- ScratchPad.recorded.should == [:some_method, @obj]
-
- @state2.it_behaves_like :shared_spec, :another_method, @obj2
-
- @state2.process
- ScratchPad.recorded.should == [:another_method, @obj2]
- end
-
- it "ensures the shared spec state is distinct for nested shared specs" do
- nested = ContextState.new "nested context"
- nested.instance_variable_set :@parsed, true
- nested.parent = @shared
-
- nested.it("another example") { ScratchPad.record [:shared, @method, @object] }
-
- @state.it_behaves_like :shared_spec, :some_method, @obj
-
- @state.process
- ScratchPad.recorded.should == [:shared, :some_method, @obj]
-
- @state2.it_behaves_like :shared_spec, :another_method, @obj2
-
- @state2.process
- ScratchPad.recorded.should == [:shared, :another_method, @obj2]
- end
- end
-end
diff --git a/spec/mspec/spec/runner/tag_spec.rb b/spec/mspec/spec/runner/tag_spec.rb
deleted file mode 100644
index db55a1b186..0000000000
--- a/spec/mspec/spec/runner/tag_spec.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require 'spec_helper'
-require 'mspec/runner/tag'
-
-describe SpecTag do
- it "accepts an optional string to parse into fields" do
- tag = SpecTag.new "tag(comment):description"
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "description"
- end
-end
-
-describe SpecTag, "#parse" do
- before :each do
- @tag = SpecTag.new
- end
-
- it "accepts 'tag(comment):description'" do
- @tag.parse "tag(I'm real):Some#method returns a value"
- @tag.tag.should == "tag"
- @tag.comment.should == "I'm real"
- @tag.description.should == "Some#method returns a value"
- end
-
- it "accepts 'tag:description'" do
- @tag.parse "tag:Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == "Another#method"
- end
-
- it "accepts 'tag():description'" do
- @tag.parse "tag():Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == "Another#method"
- end
-
- it "accepts 'tag:'" do
- @tag.parse "tag:"
- @tag.tag.should == "tag"
- @tag.comment.should == nil
- @tag.description.should == ""
- end
-
- it "accepts 'tag(bug:555):Another#method'" do
- @tag.parse "tag(bug:555):Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == "bug:555"
- @tag.description.should == "Another#method"
- end
-
- it "accepts 'tag(http://someplace.com/neato):Another#method'" do
- @tag.parse "tag(http://someplace.com/neato):Another#method"
- @tag.tag.should == "tag"
- @tag.comment.should == "http://someplace.com/neato"
- @tag.description.should == "Another#method"
- end
-
- it "accepts 'tag(comment):\"Multi-line\\ntext\"'" do
- @tag.parse 'tag(comment):"Multi-line\ntext"'
- @tag.tag.should == "tag"
- @tag.comment.should == "comment"
- @tag.description.should == "Multi-line\ntext"
- end
-
- it "ignores '#anything'" do
- @tag.parse "# this could be a comment"
- @tag.tag.should == nil
- @tag.comment.should == nil
- @tag.description.should == nil
- end
-end
-
-describe SpecTag, "#to_s" do
- it "formats itself as 'tag(comment):description'" do
- txt = "tag(comment):description"
- tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "description"
- tag.to_s.should == txt
- end
-
- it "formats itself as 'tag:description" do
- txt = "tag:description"
- tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == nil
- tag.description.should == "description"
- tag.to_s.should == txt
- end
-
- it "formats itself as 'tag(comment):\"multi-line\\ntext\\ntag\"'" do
- txt = 'tag(comment):"multi-line\ntext\ntag"'
- tag = SpecTag.new txt
- tag.tag.should == "tag"
- tag.comment.should == "comment"
- tag.description.should == "multi-line\ntext\ntag"
- tag.to_s.should == txt
- end
-end
-
-describe SpecTag, "#==" do
- it "returns true if the tags have the same fields" do
- one = SpecTag.new "tag(this):unicorn"
- two = SpecTag.new "tag(this):unicorn"
- one.==(two).should == true
- [one].==([two]).should == true
- end
-end
-
-describe SpecTag, "#unescape" do
- it "replaces \\n by LF when the description is quoted" do
- tag = SpecTag.new 'tag:"desc with\nnew line"'
- tag.description.should == "desc with\nnew line"
- end
-
- it "does not replaces \\n by LF when the description is not quoted " do
- tag = SpecTag.new 'tag:desc with\nnew line'
- tag.description.should == "desc with\\nnew line"
- end
-end
diff --git a/spec/mspec/spec/runner/tags.txt b/spec/mspec/spec/runner/tags.txt
deleted file mode 100644
index f4eb6ad034..0000000000
--- a/spec/mspec/spec/runner/tags.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-fail(broken):Some#method? works
-incomplete(20%):The#best method ever
-benchmark(0.01825):The#fastest method today
-extended():"Multi-line\ntext\ntag"
diff --git a/spec/mspec/spec/spec_helper.rb b/spec/mspec/spec/spec_helper.rb
deleted file mode 100644
index 0d497f6627..0000000000
--- a/spec/mspec/spec/spec_helper.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'pp'
-require 'mspec/helpers/io'
-require 'mspec/helpers/scratch'
-
-# Remove this when MRI has intelligent warnings
-$VERBOSE = nil unless $VERBOSE
-
-class MOSConfig < Hash
- def initialize
- self[:loadpath] = []
- self[:requires] = []
- self[:flags] = []
- self[:options] = []
- self[:includes] = []
- self[:excludes] = []
- self[:patterns] = []
- self[:xpatterns] = []
- self[:tags] = []
- self[:xtags] = []
- self[:atags] = []
- self[:astrings] = []
- self[:target] = 'ruby'
- self[:command] = nil
- self[:ltags] = []
- self[:files] = []
- self[:launch] = []
- end
-end
-
-def new_option
- config = MOSConfig.new
- return MSpecOptions.new("spec", 20, config), config
-end
-
-# Just to have an exception name output not be "Exception"
-class MSpecExampleError < Exception
-end
-
-def hide_deprecation_warnings
- MSpec.stub(:deprecate)
-end
-
-def run_mspec(command, args)
- cwd = Dir.pwd
- command = " #{command}" unless command.start_with?('-')
- cmd = "#{cwd}/bin/mspec#{command} -B spec/fixtures/config.mspec #{args}"
- out = `#{cmd} 2>&1`
- ret = $?
- out = out.sub(/\A\$.+\n/, '') # Remove printed command line
- out = out.sub(RUBY_DESCRIPTION, "RUBY_DESCRIPTION")
- out = out.gsub(/\d+\.\d{6}/, "D.DDDDDD") # Specs total time
- out = out.gsub(/\d{2}:\d{2}:\d{2}/, "00:00:00") # Progress bar time
- out = out.gsub(cwd, "CWD")
- return out, ret
-end
diff --git a/spec/mspec/spec/utils/deprecate_spec.rb b/spec/mspec/spec/utils/deprecate_spec.rb
deleted file mode 100644
index 7fa60df26a..0000000000
--- a/spec/mspec/spec/utils/deprecate_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-require 'mspec/utils/deprecate'
-
-describe MSpec, "#deprecate" do
- it "warns when using a deprecated method" do
- warning = nil
- $stderr.stub(:puts) { |str| warning = str }
- MSpec.deprecate(:some_method, :other_method)
- warning.should start_with(<<-EOS.chomp)
-
-some_method is deprecated, use other_method instead.
-from
-EOS
- warning.should include(__FILE__)
- warning.should include('8')
- end
-end
diff --git a/spec/mspec/spec/utils/name_map_spec.rb b/spec/mspec/spec/utils/name_map_spec.rb
deleted file mode 100644
index d38230ce06..0000000000
--- a/spec/mspec/spec/utils/name_map_spec.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-require 'spec_helper'
-require 'mspec/utils/name_map'
-
-module NameMapSpecs
- class A
- A = self
-
- def self.a; end
- def a; end
- def c; end
-
- class B
- def b; end
- end
- end
-
- class Error
- end
-
- class Fixnum
- def f; end
- end
-
- def self.n; end
- def n; end
-end
-
-describe NameMap, "#exception?" do
- before :each do
- @map = NameMap.new
- end
-
- it "returns true if the constant is Errno" do
- @map.exception?("Errno").should == true
- end
-
- it "returns true if the constant is a kind of Exception" do
- @map.exception?("Errno::EBADF").should == true
- @map.exception?("LoadError").should == true
- @map.exception?("SystemExit").should == true
- end
-
- it "returns false if the constant is not a kind of Exception" do
- @map.exception?("NameMapSpecs::Error").should == false
- @map.exception?("NameMapSpecs").should == false
- end
-
- it "returns false if the constant does not exist" do
- @map.exception?("Nonexistent").should == false
- end
-end
-
-describe NameMap, "#class_or_module" do
- before :each do
- @map = NameMap.new true
- end
-
- it "returns the constant specified by the string" do
- @map.class_or_module("NameMapSpecs").should == NameMapSpecs
- end
-
- it "returns the constant specified by the 'A::B' string" do
- @map.class_or_module("NameMapSpecs::A").should == NameMapSpecs::A
- end
-
- it "returns nil if the constant is not a class or module" do
- @map.class_or_module("Float::MAX").should == nil
- end
-
- it "returns nil if the constant is in the set of excluded constants" do
- excluded = %w[
- MSpecScript
- MkSpec
- NameMap
- ]
-
- excluded.each do |const|
- @map.class_or_module(const).should == nil
- end
- end
-
- it "returns nil if the constant does not exist" do
- @map.class_or_module("Heaven").should == nil
- @map.class_or_module("Hell").should == nil
- @map.class_or_module("Bush::Brain").should == nil
- end
-end
-
-describe NameMap, "#dir_name" do
- before :each do
- @map = NameMap.new
- end
-
- it "returns a directory name from the base name and constant" do
- @map.dir_name("NameMapSpecs", 'spec/core').should == 'spec/core/namemapspecs'
- end
-
- it "returns a directory name from the components in the constants name" do
- @map.dir_name("NameMapSpecs::A", 'spec').should == 'spec/namemapspecs/a'
- @map.dir_name("NameMapSpecs::A::B", 'spec').should == 'spec/namemapspecs/a/b'
- end
-
- it "returns a directory name without 'class' for constants like TrueClass" do
- @map.dir_name("TrueClass", 'spec').should == 'spec/true'
- @map.dir_name("FalseClass", 'spec').should == 'spec/false'
- end
-
- it "returns 'exception' for the directory name of any Exception subclass" do
- @map.dir_name("SystemExit", 'spec').should == 'spec/exception'
- @map.dir_name("Errno::EBADF", 'spec').should == 'spec/exception'
- end
-
- it "returns 'class' for Class" do
- @map.dir_name("Class", 'spec').should == 'spec/class'
- end
-end
-
-# These specs do not cover all the mappings, but only describe how the
-# name is derived when the hash item maps to a single value, a hash with
-# a specific item, or a hash with a :default item.
-describe NameMap, "#file_name" do
- before :each do
- @map = NameMap.new
- end
-
- it "returns the name of the spec file based on the constant and method" do
- @map.file_name("[]=", "Array").should == "element_set_spec.rb"
- end
-
- it "returns the name of the spec file based on the special entry for the method" do
- @map.file_name("~", "Regexp").should == "match_spec.rb"
- @map.file_name("~", "Fixnum").should == "complement_spec.rb"
- end
-
- it "returns the name of the spec file based on the default entry for the method" do
- @map.file_name("<<", "NameMapSpecs").should == "append_spec.rb"
- end
-
- it "uses the last component of the constant to look up the method name" do
- @map.file_name("^", "NameMapSpecs::Fixnum").should == "bit_xor_spec.rb"
- end
-end
-
-describe NameMap, "#namespace" do
- before :each do
- @map = NameMap.new
- end
-
- it "prepends the module to the constant name" do
- @map.namespace("SubModule", Integer).should == "SubModule::Integer"
- end
-
- it "does not prepend Object, Class, or Module to the constant name" do
- @map.namespace("Object", String).should == "String"
- @map.namespace("Module", Integer).should == "Integer"
- @map.namespace("Class", Float).should == "Float"
- end
-end
-
-describe NameMap, "#map" do
- before :each do
- @map = NameMap.new
- end
-
- it "flattens an object hierarchy into a single Hash" do
- @map.map({}, [NameMapSpecs]).should == {
- "NameMapSpecs." => ["n"],
- "NameMapSpecs#" => ["n"],
- "NameMapSpecs::A." => ["a"],
- "NameMapSpecs::A#" => ["a", "c"],
- "NameMapSpecs::A::B#" => ["b"],
- "NameMapSpecs::Fixnum#" => ["f"]
- }
- end
-end
diff --git a/spec/mspec/spec/utils/options_spec.rb b/spec/mspec/spec/utils/options_spec.rb
deleted file mode 100644
index face909286..0000000000
--- a/spec/mspec/spec/utils/options_spec.rb
+++ /dev/null
@@ -1,1285 +0,0 @@
-require 'spec_helper'
-require 'mspec/utils/options'
-require 'mspec/version'
-require 'mspec/guards/guard'
-require 'mspec/runner/mspec'
-require 'mspec/runner/formatters'
-
-describe MSpecOption, ".new" do
- before :each do
- @opt = MSpecOption.new("-a", "--bdc", "ARG", "desc", :block)
- end
-
- it "sets the short attribute" do
- @opt.short.should == "-a"
- end
-
- it "sets the long attribute" do
- @opt.long.should == "--bdc"
- end
-
- it "sets the arg attribute" do
- @opt.arg.should == "ARG"
- end
-
- it "sets the description attribute" do
- @opt.description.should == "desc"
- end
-
- it "sets the block attribute" do
- @opt.block.should == :block
- end
-end
-
-describe MSpecOption, "#arg?" do
- it "returns true if arg attribute is not nil" do
- MSpecOption.new(nil, nil, "ARG", nil, nil).arg?.should be_true
- end
-
- it "returns false if arg attribute is nil" do
- MSpecOption.new(nil, nil, nil, nil, nil).arg?.should be_false
- end
-end
-
-describe MSpecOption, "#match?" do
- before :each do
- @opt = MSpecOption.new("-a", "--bdc", "ARG", "desc", :block)
- end
-
- it "returns true if the argument matches the short option" do
- @opt.match?("-a").should be_true
- end
-
- it "returns true if the argument matches the long option" do
- @opt.match?("--bdc").should be_true
- end
-
- it "returns false if the argument matches neither the short nor long option" do
- @opt.match?("-b").should be_false
- @opt.match?("-abdc").should be_false
- end
-end
-
-describe MSpecOptions, ".new" do
- before :each do
- @opt = MSpecOptions.new("cmd", 20, :config)
- end
-
- it "sets the banner attribute" do
- @opt.banner.should == "cmd"
- end
-
- it "sets the config attribute" do
- @opt.config.should == :config
- end
-
- it "sets the width attribute" do
- @opt.width.should == 20
- end
-
- it "sets the default width attribute" do
- MSpecOptions.new.width.should == 30
- end
-end
-
-describe MSpecOptions, "#on" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "adds a short option" do
- @opt.should_receive(:add).with("-a", nil, nil, "desc", nil)
- @opt.on("-a", "desc")
- end
-
- it "adds a short option taking an argument" do
- @opt.should_receive(:add).with("-a", nil, "ARG", "desc", nil)
- @opt.on("-a", "ARG", "desc")
- end
-
- it "adds a long option" do
- @opt.should_receive(:add).with("-a", nil, nil, "desc", nil)
- @opt.on("-a", "desc")
- end
-
- it "adds a long option taking an argument" do
- @opt.should_receive(:add).with("-a", nil, nil, "desc", nil)
- @opt.on("-a", "desc")
- end
-
- it "adds a short and long option" do
- @opt.should_receive(:add).with("-a", nil, nil, "desc", nil)
- @opt.on("-a", "desc")
- end
-
- it "adds a short and long option taking an argument" do
- @opt.should_receive(:add).with("-a", nil, nil, "desc", nil)
- @opt.on("-a", "desc")
- end
-
- it "raises MSpecOptions::OptionError if pass less than 2 arguments" do
- lambda { @opt.on }.should raise_error(MSpecOptions::OptionError)
- lambda { @opt.on "" }.should raise_error(MSpecOptions::OptionError)
- end
-end
-
-describe MSpecOptions, "#add" do
- before :each do
- @opt = MSpecOptions.new "cmd", 20
- @prc = lambda { }
- end
-
- it "adds documentation for an option" do
- @opt.should_receive(:doc).with(" -t, --typo ARG Correct typo ARG")
- @opt.add("-t", "--typo", "ARG", "Correct typo ARG", @prc)
- end
-
- it "leaves spaces in the documentation for a missing short option" do
- @opt.should_receive(:doc).with(" --typo ARG Correct typo ARG")
- @opt.add(nil, "--typo", "ARG", "Correct typo ARG", @prc)
- end
-
- it "handles a short option with argument but no long argument" do
- @opt.should_receive(:doc).with(" -t ARG Correct typo ARG")
- @opt.add("-t", nil, "ARG", "Correct typo ARG", @prc)
- end
-
- it "registers an option" do
- option = MSpecOption.new "-t", "--typo", "ARG", "Correct typo ARG", @prc
- MSpecOption.should_receive(:new).with(
- "-t", "--typo", "ARG", "Correct typo ARG", @prc).and_return(option)
- @opt.add("-t", "--typo", "ARG", "Correct typo ARG", @prc)
- @opt.options.should == [option]
- end
-end
-
-describe MSpecOptions, "#match?" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "returns the MSpecOption instance matching the argument" do
- @opt.on "-a", "--abdc", "desc"
- option = @opt.match? "-a"
- @opt.match?("--abdc").should be(option)
- option.should be_kind_of(MSpecOption)
- option.short.should == "-a"
- option.long.should == "--abdc"
- option.description.should == "desc"
- end
-end
-
-describe MSpecOptions, "#process" do
- before :each do
- @opt = MSpecOptions.new
- ScratchPad.clear
- end
-
- it "calls the on_extra block if the argument does not match any option" do
- @opt.on_extra { ScratchPad.record :extra }
- @opt.process ["-a"], "-a", "-a", nil
- ScratchPad.recorded.should == :extra
- end
-
- it "returns the matching option" do
- @opt.on "-a", "ARG", "desc"
- option = @opt.process [], "-a", "-a", "ARG"
- option.should be_kind_of(MSpecOption)
- option.short.should == "-a"
- option.arg.should == "ARG"
- option.description.should == "desc"
- end
-
- it "raises an MSpecOptions::ParseError if arg is nil and there are no more entries in argv" do
- @opt.on "-a", "ARG", "desc"
- lambda { @opt.process [], "-a", "-a", nil }.should raise_error(MSpecOptions::ParseError)
- end
-
- it "fetches the argument for the option from argv if arg is nil" do
- @opt.on("-a", "ARG", "desc") { |o| ScratchPad.record o }
- @opt.process ["ARG"], "-a", "-a", nil
- ScratchPad.recorded.should == "ARG"
- end
-
- it "calls the option's block" do
- @opt.on("-a", "ARG", "desc") { ScratchPad.record :option }
- @opt.process [], "-a", "-a", "ARG"
- ScratchPad.recorded.should == :option
- end
-
- it "does not call the option's block if it is nil" do
- @opt.on "-a", "ARG", "desc"
- lambda { @opt.process [], "-a", "-a", "ARG" }.should_not raise_error
- end
-end
-
-describe MSpecOptions, "#split" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "breaks a string at the nth character" do
- opt, arg, rest = @opt.split "-bdc", 2
- opt.should == "-b"
- arg.should == "dc"
- rest.should == "dc"
- end
-
- it "returns nil for arg if there are no characters left" do
- opt, arg, rest = @opt.split "-b", 2
- opt.should == "-b"
- arg.should == nil
- rest.should == ""
- end
-end
-
-describe MSpecOptions, "#parse" do
- before :each do
- @opt = MSpecOptions.new
- @prc = lambda { ScratchPad.record :parsed }
- @arg_prc = lambda { |o| ScratchPad.record [:parsed, o] }
- ScratchPad.clear
- end
-
- it "parses a short option" do
- @opt.on "-a", "desc", &@prc
- @opt.parse ["-a"]
- ScratchPad.recorded.should == :parsed
- end
-
- it "parse a long option" do
- @opt.on "--abdc", "desc", &@prc
- @opt.parse ["--abdc"]
- ScratchPad.recorded.should == :parsed
- end
-
- it "parses a short option group" do
- @opt.on "-a", "ARG", "desc", &@arg_prc
- @opt.parse ["-a", "ARG"]
- ScratchPad.recorded.should == [:parsed, "ARG"]
- end
-
- it "parses a short option with an argument" do
- @opt.on "-a", "ARG", "desc", &@arg_prc
- @opt.parse ["-a", "ARG"]
- ScratchPad.recorded.should == [:parsed, "ARG"]
- end
-
- it "parses a short option with connected argument" do
- @opt.on "-a", "ARG", "desc", &@arg_prc
- @opt.parse ["-aARG"]
- ScratchPad.recorded.should == [:parsed, "ARG"]
- end
-
- it "parses a long option with an argument" do
- @opt.on "--abdc", "ARG", "desc", &@arg_prc
- @opt.parse ["--abdc", "ARG"]
- ScratchPad.recorded.should == [:parsed, "ARG"]
- end
-
- it "parses a long option with an '=' argument" do
- @opt.on "--abdc", "ARG", "desc", &@arg_prc
- @opt.parse ["--abdc=ARG"]
- ScratchPad.recorded.should == [:parsed, "ARG"]
- end
-
- it "parses a short option group with the final option taking an argument" do
- ScratchPad.record []
- @opt.on("-a", "desc") { |o| ScratchPad << :a }
- @opt.on("-b", "ARG", "desc") { |o| ScratchPad << [:b, o] }
- @opt.parse ["-ab", "ARG"]
- ScratchPad.recorded.should == [:a, [:b, "ARG"]]
- end
-
- it "parses a short option group with a connected argument" do
- ScratchPad.record []
- @opt.on("-a", "desc") { |o| ScratchPad << :a }
- @opt.on("-b", "ARG", "desc") { |o| ScratchPad << [:b, o] }
- @opt.on("-c", "desc") { |o| ScratchPad << :c }
- @opt.parse ["-acbARG"]
- ScratchPad.recorded.should == [:a, :c, [:b, "ARG"]]
- end
-
- it "returns the unprocessed entries" do
- @opt.on "-a", "ARG", "desc", &@arg_prc
- @opt.parse(["abdc", "-a", "ilny"]).should == ["abdc"]
- end
-
- it "calls the on_extra handler with unrecognized options" do
- ScratchPad.record []
- @opt.on_extra { |o| ScratchPad << o }
- @opt.on "-a", "desc"
- @opt.parse ["-a", "-b"]
- ScratchPad.recorded.should == ["-b"]
- end
-
- it "does not attempt to call the block if it is nil" do
- @opt.on "-a", "ARG", "desc"
- @opt.parse(["-a", "ARG"]).should == []
- end
-
- it "raises MSpecOptions::ParseError if passed an unrecognized option" do
- @opt.should_receive(:raise).with(MSpecOptions::ParseError, an_instance_of(String))
- @opt.stub(:puts)
- @opt.stub(:exit)
- @opt.parse "-u"
- end
-end
-
-describe MSpecOptions, "#banner=" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "sets the banner attribute" do
- @opt.banner.should == ""
- @opt.banner = "banner"
- @opt.banner.should == "banner"
- end
-end
-
-describe MSpecOptions, "#width=" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "sets the width attribute" do
- @opt.width.should == 30
- @opt.width = 20
- @opt.width.should == 20
- end
-end
-
-describe MSpecOptions, "#config=" do
- before :each do
- @opt = MSpecOptions.new
- end
-
- it "sets the config attribute" do
- @opt.config.should be_nil
- @opt.config = :config
- @opt.config.should == :config
- end
-end
-
-describe MSpecOptions, "#doc" do
- before :each do
- @opt = MSpecOptions.new "command"
- end
-
- it "adds text to be displayed with #to_s" do
- @opt.doc "Some message"
- @opt.doc "Another message"
- @opt.to_s.should == <<-EOD
-command
-
-Some message
-Another message
-EOD
- end
-end
-
-describe MSpecOptions, "#version" do
- before :each do
- @opt = MSpecOptions.new
- ScratchPad.clear
- end
-
- it "installs a basic -v, --version option" do
- @opt.should_receive(:puts)
- @opt.should_receive(:exit)
- @opt.version "1.0.0"
- @opt.parse "-v"
- end
-
- it "accepts a block instead of using the default block" do
- @opt.version("1.0.0") { |o| ScratchPad.record :version }
- @opt.parse "-v"
- ScratchPad.recorded.should == :version
- end
-end
-
-describe MSpecOptions, "#help" do
- before :each do
- @opt = MSpecOptions.new
- ScratchPad.clear
- end
-
- it "installs a basic -h, --help option" do
- @opt.should_receive(:puts)
- @opt.should_receive(:exit).with(1)
- @opt.help
- @opt.parse "-h"
- end
-
- it "accepts a block instead of using the default block" do
- @opt.help { |o| ScratchPad.record :help }
- @opt.parse "-h"
- ScratchPad.recorded.should == :help
- end
-end
-
-describe MSpecOptions, "#on_extra" do
- before :each do
- @opt = MSpecOptions.new
- ScratchPad.clear
- end
-
- it "registers a block to be called when an option is not recognized" do
- @opt.on_extra { ScratchPad.record :extra }
- @opt.parse "-g"
- ScratchPad.recorded.should == :extra
- end
-end
-
-describe MSpecOptions, "#to_s" do
- before :each do
- @opt = MSpecOptions.new "command"
- end
-
- it "returns the banner and descriptive strings for all registered options" do
- @opt.on "-t", "--this ARG", "Adds this ARG to the list"
- @opt.to_s.should == <<-EOD
-command
-
- -t, --this ARG Adds this ARG to the list
-EOD
- end
-end
-
-describe "The -B, --config FILE option" do
- before :each do
- @options, @config = new_option
- end
-
- it "is enabled with #configure { }" do
- @options.should_receive(:on).with("-B", "--config", "FILE",
- an_instance_of(String))
- @options.configure {}
- end
-
- it "calls the passed block" do
- ["-B", "--config"].each do |opt|
- ScratchPad.clear
-
- @options.configure { |x| ScratchPad.record x }
- @options.parse [opt, "file"]
- ScratchPad.recorded.should == "file"
- end
- end
-end
-
-describe "The -C, --chdir DIR option" do
- before :each do
- @options, @config = new_option
- @options.chdir
- end
-
- it "is enabled with #chdir" do
- @options.should_receive(:on).with("-C", "--chdir", "DIR",
- an_instance_of(String))
- @options.chdir
- end
-
- it "changes the working directory to DIR" do
- Dir.should_receive(:chdir).with("dir").twice
- ["-C", "--chdir"].each do |opt|
- @options.parse [opt, "dir"]
- end
- end
-end
-
-describe "The --prefix STR option" do
- before :each do
- @options, @config = new_option
- end
-
- it "is enabled with #prefix" do
- @options.should_receive(:on).with("--prefix", "STR",
- an_instance_of(String))
- @options.prefix
- end
-
- it "sets the prefix config value" do
- @options.prefix
- @options.parse ["--prefix", "some/dir"]
- @config[:prefix].should == "some/dir"
- end
-end
-
-describe "The -t, --target TARGET option" do
- before :each do
- @options, @config = new_option
- @options.targets
- end
-
- it "is enabled with #targets" do
- @options.stub(:on)
- @options.should_receive(:on).with("-t", "--target", "TARGET",
- an_instance_of(String))
- @options.targets
- end
-
- it "sets the target to 'ruby' and flags to verbose with TARGET 'r' or 'ruby'" do
- ["-t", "--target"].each do |opt|
- ["r", "ruby"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "ruby"
- end
- end
- end
-
- it "sets the target to 'jruby' with TARGET 'j' or 'jruby'" do
- ["-t", "--target"].each do |opt|
- ["j", "jruby"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "jruby"
- end
- end
- end
-
- it "sets the target to 'shotgun/rubinius' with TARGET 'x' or 'rubinius'" do
- ["-t", "--target"].each do |opt|
- ["x", "rubinius"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "./bin/rbx"
- end
- end
- end
-
- it "set the target to 'rbx' with TARGET 'rbx'" do
- ["-t", "--target"].each do |opt|
- ["X", "rbx"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "rbx"
- end
- end
- end
-
- it "sets the target to 'maglev' with TARGET 'm' or 'maglev'" do
- ["-t", "--target"].each do |opt|
- ["m", "maglev"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "maglev-ruby"
- end
- end
- end
-
- it "sets the target to 'topaz' with TARGET 't' or 'topaz'" do
- ["-t", "--target"].each do |opt|
- ["t", "topaz"].each do |t|
- @config[:target] = nil
- @options.parse [opt, t]
- @config[:target].should == "topaz"
- end
- end
- end
-
- it "sets the target to TARGET" do
- ["-t", "--target"].each do |opt|
- @config[:target] = nil
- @options.parse [opt, "whateva"]
- @config[:target].should == "whateva"
- end
- end
-end
-
-describe "The -T, --target-opt OPT option" do
- before :each do
- @options, @config = new_option
- @options.targets
- end
-
- it "is enabled with #targets" do
- @options.stub(:on)
- @options.should_receive(:on).with("-T", "--target-opt", "OPT",
- an_instance_of(String))
- @options.targets
- end
-
- it "adds OPT to flags" do
- ["-T", "--target-opt"].each do |opt|
- @config[:flags].delete "--whateva"
- @options.parse [opt, "--whateva"]
- @config[:flags].should include("--whateva")
- end
- end
-end
-
-describe "The -I, --include DIR option" do
- before :each do
- @options, @config = new_option
- @options.targets
- end
-
- it "is enabled with #targets" do
- @options.stub(:on)
- @options.should_receive(:on).with("-I", "--include", "DIR",
- an_instance_of(String))
- @options.targets
- end
-
- it "add DIR to the load path" do
- ["-I", "--include"].each do |opt|
- @config[:loadpath].delete "-Ipackage"
- @options.parse [opt, "package"]
- @config[:loadpath].should include("-Ipackage")
- end
- end
-end
-
-describe "The -r, --require LIBRARY option" do
- before :each do
- @options, @config = new_option
- @options.targets
- end
-
- it "is enabled with #targets" do
- @options.stub(:on)
- @options.should_receive(:on).with("-r", "--require", "LIBRARY",
- an_instance_of(String))
- @options.targets
- end
-
- it "adds LIBRARY to the requires list" do
- ["-r", "--require"].each do |opt|
- @config[:requires].delete "-rlibrick"
- @options.parse [opt, "librick"]
- @config[:requires].should include("-rlibrick")
- end
- end
-end
-
-describe "The -f, --format FORMAT option" do
- before :each do
- @options, @config = new_option
- @options.formatters
- end
-
- it "is enabled with #formatters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-f", "--format", "FORMAT",
- an_instance_of(String))
- @options.formatters
- end
-
- it "sets the SpecdocFormatter with FORMAT 's' or 'specdoc'" do
- ["-f", "--format"].each do |opt|
- ["s", "specdoc"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == SpecdocFormatter
- end
- end
- end
-
- it "sets the HtmlFormatter with FORMAT 'h' or 'html'" do
- ["-f", "--format"].each do |opt|
- ["h", "html"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == HtmlFormatter
- end
- end
- end
-
- it "sets the DottedFormatter with FORMAT 'd', 'dot' or 'dotted'" do
- ["-f", "--format"].each do |opt|
- ["d", "dot", "dotted"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == DottedFormatter
- end
- end
- end
-
- it "sets the DescribeFormatter with FORMAT 'b' or 'describe'" do
- ["-f", "--format"].each do |opt|
- ["b", "describe"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == DescribeFormatter
- end
- end
- end
-
- it "sets the FileFormatter with FORMAT 'f', 'file'" do
- ["-f", "--format"].each do |opt|
- ["f", "file"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == FileFormatter
- end
- end
- end
-
- it "sets the UnitdiffFormatter with FORMAT 'u', 'unit', or 'unitdiff'" do
- ["-f", "--format"].each do |opt|
- ["u", "unit", "unitdiff"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == UnitdiffFormatter
- end
- end
- end
-
- it "sets the SummaryFormatter with FORMAT 'm' or 'summary'" do
- ["-f", "--format"].each do |opt|
- ["m", "summary"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == SummaryFormatter
- end
- end
- end
-
- it "sets the SpinnerFormatter with FORMAT 'a', '*', or 'spin'" do
- ["-f", "--format"].each do |opt|
- ["a", "*", "spin"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == SpinnerFormatter
- end
- end
- end
-
- it "sets the MethodFormatter with FORMAT 't' or 'method'" do
- ["-f", "--format"].each do |opt|
- ["t", "method"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == MethodFormatter
- end
- end
- end
-
- it "sets the YamlFormatter with FORMAT 'y' or 'yaml'" do
- ["-f", "--format"].each do |opt|
- ["y", "yaml"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == YamlFormatter
- end
- end
- end
-
- it "sets the JUnitFormatter with FORMAT 'j' or 'junit'" do
- ["-f", "--format"].each do |opt|
- ["j", "junit"].each do |f|
- @config[:formatter] = nil
- @options.parse [opt, f]
- @config[:formatter].should == JUnitFormatter
- end
- end
- end
-end
-
-describe "The -o, --output FILE option" do
- before :each do
- @options, @config = new_option
- @options.formatters
- end
-
- it "is enabled with #formatters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-o", "--output", "FILE",
- an_instance_of(String))
- @options.formatters
- end
-
- it "sets the output to FILE" do
- ["-o", "--output"].each do |opt|
- @config[:output] = nil
- @options.parse [opt, "some/file"]
- @config[:output].should == "some/file"
- end
- end
-end
-
-describe "The -e, --example STR" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-e", "--example", "STR",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds STR to the includes list" do
- ["-e", "--example"].each do |opt|
- @config[:includes] = []
- @options.parse [opt, "this spec"]
- @config[:includes].should include("this spec")
- end
- end
-end
-
-describe "The -E, --exclude STR" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-E", "--exclude", "STR",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds STR to the excludes list" do
- ["-E", "--exclude"].each do |opt|
- @config[:excludes] = []
- @options.parse [opt, "this spec"]
- @config[:excludes].should include("this spec")
- end
- end
-end
-
-describe "The -p, --pattern PATTERN" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-p", "--pattern", "PATTERN",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds PATTERN to the included patterns list" do
- ["-p", "--pattern"].each do |opt|
- @config[:patterns] = []
- @options.parse [opt, "this spec"]
- @config[:patterns].should include(/this spec/)
- end
- end
-end
-
-describe "The -P, --excl-pattern PATTERN" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-P", "--excl-pattern", "PATTERN",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds PATTERN to the excluded patterns list" do
- ["-P", "--excl-pattern"].each do |opt|
- @config[:xpatterns] = []
- @options.parse [opt, "this spec"]
- @config[:xpatterns].should include(/this spec/)
- end
- end
-end
-
-describe "The -g, --tag TAG" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-g", "--tag", "TAG",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds TAG to the included tags list" do
- ["-g", "--tag"].each do |opt|
- @config[:tags] = []
- @options.parse [opt, "this spec"]
- @config[:tags].should include("this spec")
- end
- end
-end
-
-describe "The -G, --excl-tag TAG" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-G", "--excl-tag", "TAG",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds TAG to the excluded tags list" do
- ["-G", "--excl-tag"].each do |opt|
- @config[:xtags] = []
- @options.parse [opt, "this spec"]
- @config[:xtags].should include("this spec")
- end
- end
-end
-
-describe "The -w, --profile FILE option" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-w", "--profile", "FILE",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds FILE to the included profiles list" do
- ["-w", "--profile"].each do |opt|
- @config[:profiles] = []
- @options.parse [opt, "spec/profiles/rails.yaml"]
- @config[:profiles].should include("spec/profiles/rails.yaml")
- end
- end
-end
-
-describe "The -W, --excl-profile FILE option" do
- before :each do
- @options, @config = new_option
- @options.filters
- end
-
- it "is enabled with #filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-W", "--excl-profile", "FILE",
- an_instance_of(String))
- @options.filters
- end
-
- it "adds FILE to the excluded profiles list" do
- ["-W", "--excl-profile"].each do |opt|
- @config[:xprofiles] = []
- @options.parse [opt, "spec/profiles/rails.yaml"]
- @config[:xprofiles].should include("spec/profiles/rails.yaml")
- end
- end
-end
-
-describe "The -Z, --dry-run option" do
- before :each do
- @options, @config = new_option
- @options.pretend
- end
-
- it "is enabled with #pretend" do
- @options.should_receive(:on).with("-Z", "--dry-run", an_instance_of(String))
- @options.pretend
- end
-
- it "registers the MSpec pretend mode" do
- MSpec.should_receive(:register_mode).with(:pretend).twice
- ["-Z", "--dry-run"].each do |opt|
- @options.parse opt
- end
- end
-end
-
-describe "The --unguarded option" do
- before :each do
- @options, @config = new_option
- @options.unguarded
- end
-
- it "is enabled with #unguarded" do
- @options.stub(:on)
- @options.should_receive(:on).with("--unguarded", an_instance_of(String))
- @options.unguarded
- end
-
- it "registers the MSpec unguarded mode" do
- MSpec.should_receive(:register_mode).with(:unguarded)
- @options.parse "--unguarded"
- end
-end
-
-describe "The --no-ruby_guard option" do
- before :each do
- @options, @config = new_option
- @options.unguarded
- end
-
- it "is enabled with #unguarded" do
- @options.stub(:on)
- @options.should_receive(:on).with("--no-ruby_bug", an_instance_of(String))
- @options.unguarded
- end
-
- it "registers the MSpec no_ruby_bug mode" do
- MSpec.should_receive(:register_mode).with(:no_ruby_bug)
- @options.parse "--no-ruby_bug"
- end
-end
-
-describe "The -H, --random option" do
- before :each do
- @options, @config = new_option
- @options.randomize
- end
-
- it "is enabled with #randomize" do
- @options.should_receive(:on).with("-H", "--random", an_instance_of(String))
- @options.randomize
- end
-
- it "registers the MSpec randomize mode" do
- MSpec.should_receive(:randomize).twice
- ["-H", "--random"].each do |opt|
- @options.parse opt
- end
- end
-end
-
-describe "The -R, --repeat option" do
- before :each do
- @options, @config = new_option
- @options.repeat
- end
-
- it "is enabled with #repeat" do
- @options.should_receive(:on).with("-R", "--repeat", "NUMBER", an_instance_of(String))
- @options.repeat
- end
-
- it "registers the MSpec repeat mode" do
- ["-R", "--repeat"].each do |opt|
- MSpec.repeat = 1
- @options.parse [opt, "10"]
- repeat_count = 0
- MSpec.repeat do
- repeat_count += 1
- end
- repeat_count.should == 10
- end
- end
-end
-
-describe "The -V, --verbose option" do
- before :each do
- @options, @config = new_option
- @options.verbose
- end
-
- it "is enabled with #verbose" do
- @options.stub(:on)
- @options.should_receive(:on).with("-V", "--verbose", an_instance_of(String))
- @options.verbose
- end
-
- it "registers a verbose output object with MSpec" do
- MSpec.should_receive(:register).with(:start, anything()).twice
- MSpec.should_receive(:register).with(:load, anything()).twice
- ["-V", "--verbose"].each do |opt|
- @options.parse opt
- end
- end
-end
-
-describe "The -m, --marker MARKER option" do
- before :each do
- @options, @config = new_option
- @options.verbose
- end
-
- it "is enabled with #verbose" do
- @options.stub(:on)
- @options.should_receive(:on).with("-m", "--marker", "MARKER",
- an_instance_of(String))
- @options.verbose
- end
-
- it "registers a marker output object with MSpec" do
- MSpec.should_receive(:register).with(:load, anything()).twice
- ["-m", "--marker"].each do |opt|
- @options.parse [opt, ","]
- end
- end
-end
-
-describe "The --int-spec option" do
- before :each do
- @options, @config = new_option
- @options.interrupt
- end
-
- it "is enabled with #interrupt" do
- @options.should_receive(:on).with("--int-spec", an_instance_of(String))
- @options.interrupt
- end
-
- it "sets the abort config option to false to only abort the running spec with ^C" do
- @config[:abort] = true
- @options.parse "--int-spec"
- @config[:abort].should == false
- end
-end
-
-describe "The -Y, --verify option" do
- before :each do
- @options, @config = new_option
- @options.verify
- end
-
- it "is enabled with #interrupt" do
- @options.stub(:on)
- @options.should_receive(:on).with("-Y", "--verify", an_instance_of(String))
- @options.verify
- end
-
- it "sets the MSpec mode to :verify" do
- MSpec.should_receive(:register_mode).with(:verify).twice
- ["-Y", "--verify"].each do |m|
- @options.parse m
- end
- end
-end
-
-describe "The -O, --report option" do
- before :each do
- @options, @config = new_option
- @options.verify
- end
-
- it "is enabled with #interrupt" do
- @options.stub(:on)
- @options.should_receive(:on).with("-O", "--report", an_instance_of(String))
- @options.verify
- end
-
- it "sets the MSpec mode to :report" do
- MSpec.should_receive(:register_mode).with(:report).twice
- ["-O", "--report"].each do |m|
- @options.parse m
- end
- end
-end
-
-describe "The --report-on GUARD option" do
- before :all do
- MSpec.stub(:register_mode)
- end
-
- before :each do
- @options, @config = new_option
- @options.verify
-
- SpecGuard.clear_guards
- end
-
- after :each do
- SpecGuard.clear_guards
- end
-
- it "is enabled with #interrupt" do
- @options.stub(:on)
- @options.should_receive(:on).with("--report-on", "GUARD", an_instance_of(String))
- @options.verify
- end
-
- it "sets the MSpec mode to :report_on" do
- MSpec.should_receive(:register_mode).with(:report_on)
- @options.parse ["--report-on", "ruby_bug"]
- end
-
- it "converts the guard name to a symbol" do
- name = double("ruby_bug")
- name.should_receive(:to_sym)
- @options.parse ["--report-on", name]
- end
-
- it "saves the name of the guard" do
- @options.parse ["--report-on", "ruby_bug"]
- SpecGuard.guards.should == [:ruby_bug]
- end
-end
-
-describe "The -K, --action-tag TAG option" do
- before :each do
- @options, @config = new_option
- @options.action_filters
- end
-
- it "is enabled with #action_filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-K", "--action-tag", "TAG",
- an_instance_of(String))
- @options.action_filters
- end
-
- it "adds TAG to the list of tags that trigger actions" do
- ["-K", "--action-tag"].each do |opt|
- @config[:atags] = []
- @options.parse [opt, "action-tag"]
- @config[:atags].should include("action-tag")
- end
- end
-end
-
-describe "The -S, --action-string STR option" do
- before :each do
- @options, @config = new_option
- @options.action_filters
- end
-
- it "is enabled with #action_filters" do
- @options.stub(:on)
- @options.should_receive(:on).with("-S", "--action-string", "STR",
- an_instance_of(String))
- @options.action_filters
- end
-
- it "adds STR to the list of spec descriptions that trigger actions" do
- ["-S", "--action-string"].each do |opt|
- @config[:astrings] = []
- @options.parse [opt, "action-str"]
- @config[:astrings].should include("action-str")
- end
- end
-end
-
-describe "The -d, --debug option" do
- before :each do
- @options, @config = new_option
- @options.debug
- end
-
- after :each do
- $MSPEC_DEBUG = nil
- end
-
- it "is enabled with #debug" do
- @options.stub(:on)
- @options.should_receive(:on).with("-d", "--debug", an_instance_of(String))
- @options.debug
- end
-
- it "sets $MSPEC_DEBUG to true" do
- ["-d", "--debug"].each do |opt|
- $MSPEC_DEBUG.should_not be_true
- @options.parse opt
- $MSPEC_DEBUG.should be_true
- $MSPEC_DEBUG = nil
- end
- end
-end
diff --git a/spec/mspec/spec/utils/script_spec.rb b/spec/mspec/spec/utils/script_spec.rb
deleted file mode 100644
index 2582809fae..0000000000
--- a/spec/mspec/spec/utils/script_spec.rb
+++ /dev/null
@@ -1,475 +0,0 @@
-require 'spec_helper'
-require 'mspec/utils/script'
-require 'mspec/runner/mspec'
-require 'mspec/runner/filters'
-require 'mspec/runner/actions/filter'
-
-describe MSpecScript, ".config" do
- it "returns a Hash" do
- MSpecScript.config.should be_kind_of(Hash)
- end
-end
-
-describe MSpecScript, ".set" do
- it "sets the config hash key, value" do
- MSpecScript.set :a, 10
- MSpecScript.config[:a].should == 10
- end
-end
-
-describe MSpecScript, ".get" do
- it "gets the config hash value for a key" do
- MSpecScript.set :a, 10
- MSpecScript.get(:a).should == 10
- end
-end
-
-describe MSpecScript, "#config" do
- it "returns the MSpecScript config hash" do
- MSpecScript.set :b, 5
- MSpecScript.new.config[:b].should == 5
- end
-
- it "returns the MSpecScript config hash from subclasses" do
- class MSSClass < MSpecScript; end
- MSpecScript.set :b, 5
- MSSClass.new.config[:b].should == 5
- end
-end
-
-describe MSpecScript, "#load_default" do
- before :all do
- @verbose = $VERBOSE
- $VERBOSE = nil
- end
-
- after :all do
- $VERBOSE = @verbose
- end
-
- before :each do
- @version = RUBY_VERSION
- if Object.const_defined? :RUBY_ENGINE
- @engine = Object.const_get :RUBY_ENGINE
- end
- @script = MSpecScript.new
- MSpecScript.stub(:new).and_return(@script)
- end
-
- after :each do
- Object.const_set :RUBY_VERSION, @version
- Object.const_set :RUBY_ENGINE, @engine if @engine
- end
-
- it "attempts to load 'default.mspec'" do
- @script.stub(:try_load)
- @script.should_receive(:try_load).with('default.mspec').and_return(true)
- @script.load_default
- end
-
- it "attempts to load a config file based on RUBY_ENGINE and RUBY_VERSION" do
- Object.const_set :RUBY_ENGINE, "ybur"
- Object.const_set :RUBY_VERSION, "1.8.9"
- default = "ybur.1.8.mspec"
- @script.should_receive(:try_load).with('default.mspec').and_return(false)
- @script.should_receive(:try_load).with(default)
- @script.should_receive(:try_load).with('ybur.mspec')
- @script.load_default
- end
-end
-
-describe MSpecScript, ".main" do
- before :each do
- @script = double("MSpecScript").as_null_object
- MSpecScript.stub(:new).and_return(@script)
- # Do not require full mspec as it would conflict with RSpec
- MSpecScript.should_receive(:require).with('mspec')
- end
-
- it "creates an instance of MSpecScript" do
- MSpecScript.should_receive(:new).and_return(@script)
- MSpecScript.main
- end
-
- it "attempts to load the default config" do
- @script.should_receive(:load_default)
- MSpecScript.main
- end
-
- it "attempts to load the '~/.mspecrc' script" do
- @script.should_receive(:try_load).with('~/.mspecrc')
- MSpecScript.main
- end
-
- it "calls the #options method on the script" do
- @script.should_receive(:options)
- MSpecScript.main
- end
-
- it "calls the #signals method on the script" do
- @script.should_receive(:signals)
- MSpecScript.main
- end
-
- it "calls the #register method on the script" do
- @script.should_receive(:register)
- MSpecScript.main
- end
-
- it "calls the #setup_env method on the script" do
- @script.should_receive(:setup_env)
- MSpecScript.main
- end
-
- it "calls the #run method on the script" do
- @script.should_receive(:run)
- MSpecScript.main
- end
-end
-
-describe MSpecScript, "#initialize" do
- before :each do
- @config = MSpecScript.new.config
- end
-
- it "sets the default config values" do
- @config[:formatter].should == nil
- @config[:includes].should == []
- @config[:excludes].should == []
- @config[:patterns].should == []
- @config[:xpatterns].should == []
- @config[:tags].should == []
- @config[:xtags].should == []
- @config[:atags].should == []
- @config[:astrings].should == []
- @config[:abort].should == true
- @config[:config_ext].should == '.mspec'
- end
-end
-
-describe MSpecScript, "#load" do
- before :each do
- File.stub(:exist?).and_return(false)
- @script = MSpecScript.new
- @file = "default.mspec"
- @base = "default"
- end
-
- it "attempts to locate the file through the expanded path name" do
- File.should_receive(:expand_path).with(@file, ".").and_return(@file)
- File.should_receive(:exist?).with(@file).and_return(true)
- Kernel.should_receive(:load).with(@file).and_return(:loaded)
- @script.load(@file).should == :loaded
- end
-
- it "appends config[:config_ext] to the name and attempts to locate the file through the expanded path name" do
- File.should_receive(:expand_path).with(@base, ".").and_return(@base)
- File.should_receive(:expand_path).with(@base, "spec").and_return(@base)
- File.should_receive(:expand_path).with(@file, ".").and_return(@file)
- File.should_receive(:exist?).with(@base).and_return(false)
- File.should_receive(:exist?).with(@file).and_return(true)
- Kernel.should_receive(:load).with(@file).and_return(:loaded)
- @script.load(@base).should == :loaded
- end
-
- it "attempts to locate the file in '.'" do
- path = File.expand_path @file, "."
- File.should_receive(:exist?).with(path).and_return(true)
- Kernel.should_receive(:load).with(path).and_return(:loaded)
- @script.load(@file).should == :loaded
- end
-
- it "appends config[:config_ext] to the name and attempts to locate the file in '.'" do
- path = File.expand_path @file, "."
- File.should_receive(:exist?).with(path).and_return(true)
- Kernel.should_receive(:load).with(path).and_return(:loaded)
- @script.load(@base).should == :loaded
- end
-
- it "attempts to locate the file in 'spec'" do
- path = File.expand_path @file, "spec"
- File.should_receive(:exist?).with(path).and_return(true)
- Kernel.should_receive(:load).with(path).and_return(:loaded)
- @script.load(@file).should == :loaded
- end
-
- it "appends config[:config_ext] to the name and attempts to locate the file in 'spec'" do
- path = File.expand_path @file, "spec"
- File.should_receive(:exist?).with(path).and_return(true)
- Kernel.should_receive(:load).with(path).and_return(:loaded)
- @script.load(@base).should == :loaded
- end
-
- it "loads a given file only once" do
- path = File.expand_path @file, "spec"
- File.should_receive(:exist?).with(path).and_return(true)
- Kernel.should_receive(:load).once.with(path).and_return(:loaded)
- @script.load(@base).should == :loaded
- @script.load(@base).should == true
- end
-end
-
-describe MSpecScript, "#custom_options" do
- before :each do
- @script = MSpecScript.new
- end
-
- after :each do
- end
-
- it "prints 'None'" do
- options = double("options")
- options.should_receive(:doc).with(" No custom options registered")
- @script.custom_options options
- end
-end
-
-describe MSpecScript, "#register" do
- before :each do
- @script = MSpecScript.new
-
- @formatter = double("formatter").as_null_object
- @script.config[:formatter] = @formatter
- end
-
- it "creates and registers the formatter" do
- @formatter.should_receive(:new).and_return(@formatter)
- @formatter.should_receive(:register)
- @script.register
- end
-
- it "does not register the formatter if config[:formatter] is false" do
- @script.config[:formatter] = false
- @script.register
- end
-
- it "calls #custom_register" do
- @script.should_receive(:custom_register)
- @script.register
- end
-
- it "registers :formatter with the formatter instance" do
- @formatter.stub(:new).and_return(@formatter)
- MSpec.should_receive(:store).with(:formatter, @formatter)
- @script.register
- end
-
- it "does not register :formatter if config[:formatter] is false" do
- @script.config[:formatter] = false
- MSpec.should_not_receive(:store)
- @script.register
- end
-end
-
-describe MSpecScript, "#register" do
- before :each do
- @script = MSpecScript.new
-
- @formatter = double("formatter").as_null_object
- @script.config[:formatter] = @formatter
-
- @filter = double("filter")
- @filter.should_receive(:register)
-
- @ary = ["some", "spec"]
- end
-
- it "creates and registers a MatchFilter for include specs" do
- MatchFilter.should_receive(:new).with(:include, *@ary).and_return(@filter)
- @script.config[:includes] = @ary
- @script.register
- end
-
- it "creates and registers a MatchFilter for excluded specs" do
- MatchFilter.should_receive(:new).with(:exclude, *@ary).and_return(@filter)
- @script.config[:excludes] = @ary
- @script.register
- end
-
- it "creates and registers a RegexpFilter for include specs" do
- RegexpFilter.should_receive(:new).with(:include, *@ary).and_return(@filter)
- @script.config[:patterns] = @ary
- @script.register
- end
-
- it "creates and registers a RegexpFilter for excluded specs" do
- RegexpFilter.should_receive(:new).with(:exclude, *@ary).and_return(@filter)
- @script.config[:xpatterns] = @ary
- @script.register
- end
-
- it "creates and registers a TagFilter for include specs" do
- TagFilter.should_receive(:new).with(:include, *@ary).and_return(@filter)
- @script.config[:tags] = @ary
- @script.register
- end
-
- it "creates and registers a TagFilter for excluded specs" do
- TagFilter.should_receive(:new).with(:exclude, *@ary).and_return(@filter)
- @script.config[:xtags] = @ary
- @script.register
- end
-
- it "creates and registers a ProfileFilter for include specs" do
- ProfileFilter.should_receive(:new).with(:include, *@ary).and_return(@filter)
- @script.config[:profiles] = @ary
- @script.register
- end
-
- it "creates and registers a ProfileFilter for excluded specs" do
- ProfileFilter.should_receive(:new).with(:exclude, *@ary).and_return(@filter)
- @script.config[:xprofiles] = @ary
- @script.register
- end
-end
-
-describe MSpecScript, "#signals" do
- before :each do
- @script = MSpecScript.new
- @abort = @script.config[:abort]
- end
-
- after :each do
- @script.config[:abort] = @abort
- end
-
- it "traps the INT signal if config[:abort] is true" do
- Signal.should_receive(:trap).with("INT")
- @script.config[:abort] = true
- @script.signals
- end
-
- it "does not trap the INT signal if config[:abort] is not true" do
- Signal.should_not_receive(:trap).with("INT")
- @script.config[:abort] = false
- @script.signals
- end
-end
-
-describe MSpecScript, "#entries" do
- before :each do
- @script = MSpecScript.new
-
- File.stub(:expand_path).and_return("name")
- File.stub(:file?).and_return(false)
- File.stub(:directory?).and_return(false)
- end
-
- it "returns the pattern in an array if it is a file" do
- File.should_receive(:expand_path).with("file").and_return("file/expanded.rb")
- File.should_receive(:file?).with("file/expanded.rb").and_return(true)
- @script.entries("file").should == ["file/expanded.rb"]
- end
-
- it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do
- File.should_receive(:directory?).with("name").and_return(true)
- File.stub(:expand_path).and_return("name","name/**/*_spec.rb")
- Dir.should_receive(:[]).with("name/**/*_spec.rb").and_return(["dir1", "dir2"])
- @script.entries("name").should == ["dir1", "dir2"]
- end
-
- it "aborts if pattern cannot be resolved to a file nor a directory" do
- @script.should_receive(:abort)
- @script.entries("pattern")
- end
-
- describe "with config[:prefix] set" do
- before :each do
- prefix = "prefix/dir"
- @script.config[:prefix] = prefix
- @name = prefix + "/name"
- end
-
- it "returns the pattern in an array if it is a file" do
- name = "#{@name}.rb"
- File.should_receive(:expand_path).with(name).and_return(name)
- File.should_receive(:file?).with(name).and_return(true)
- @script.entries("name.rb").should == [name]
- end
-
- it "returns Dir['pattern/**/*_spec.rb'] if pattern is a directory" do
- File.stub(:expand_path).and_return(@name, @name+"/**/*_spec.rb")
- File.should_receive(:directory?).with(@name).and_return(true)
- Dir.should_receive(:[]).with(@name + "/**/*_spec.rb").and_return(["dir1", "dir2"])
- @script.entries("name").should == ["dir1", "dir2"]
- end
-
- it "aborts if pattern cannot be resolved to a file nor a directory" do
- @script.should_receive(:abort)
- @script.entries("pattern")
- end
- end
-end
-
-describe MSpecScript, "#files" do
- before :each do
- @script = MSpecScript.new
- end
-
- it "accumlates the values returned by #entries" do
- @script.should_receive(:entries).and_return(["file1"], ["file2"])
- @script.files(["a", "b"]).should == ["file1", "file2"]
- end
-
- it "strips a leading '^' and removes the values returned by #entries" do
- @script.should_receive(:entries).and_return(["file1"], ["file2"], ["file1"])
- @script.files(["a", "b", "^a"]).should == ["file2"]
- end
-
- it "processes the array elements in order" do
- @script.should_receive(:entries).and_return(["file1"], ["file1"], ["file2"])
- @script.files(["^a", "a", "b"]).should == ["file1", "file2"]
- end
-end
-
-describe MSpecScript, "#files" do
- before :each do
- MSpecScript.set :files, ["file1", "file2"]
-
- @script = MSpecScript.new
- end
-
- after :each do
- MSpecScript.config.delete :files
- end
-
- it "looks up items with leading ':' in the config object" do
- @script.should_receive(:entries).and_return(["file1"], ["file2"])
- @script.files([":files"]).should == ["file1", "file2"]
- end
-
- it "aborts if the config key is not set" do
- @script.should_receive(:abort).with("Key :all_files not found in mspec config.")
- @script.files([":all_files"])
- end
-end
-
-describe MSpecScript, "#setup_env" do
- before :each do
- @script = MSpecScript.new
- @options, @config = new_option
- @script.stub(:config).and_return(@config)
- end
-
- after :each do
- end
-
- it "sets MSPEC_RUNNER = '1' in the environment" do
- ENV["MSPEC_RUNNER"] = "0"
- @script.setup_env
- ENV["MSPEC_RUNNER"].should == "1"
- end
-
- it "sets RUBY_EXE = config[:target] in the environment" do
- ENV["RUBY_EXE"] = nil
- @script.setup_env
- ENV["RUBY_EXE"].should == @config[:target]
- end
-
- it "sets RUBY_FLAGS = config[:flags] in the environment" do
- ENV["RUBY_FLAGS"] = nil
- @config[:flags] = ["-w", "-Q"]
- @script.setup_env
- ENV["RUBY_FLAGS"].should == "-w -Q"
- end
-end
diff --git a/spec/mspec/spec/utils/version_spec.rb b/spec/mspec/spec/utils/version_spec.rb
deleted file mode 100644
index 0b2d383c6d..0000000000
--- a/spec/mspec/spec/utils/version_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-require 'mspec/utils/version'
-
-describe SpecVersion, "#to_s" do
- it "returns the string with which it was initialized" do
- SpecVersion.new("1.8").to_s.should == "1.8"
- SpecVersion.new("2.118.9").to_s.should == "2.118.9"
- end
-end
-
-describe SpecVersion, "#to_str" do
- it "returns the same string as #to_s" do
- version = SpecVersion.new("2.118.9")
- version.to_str.should == version.to_s
- end
-end
-
-describe SpecVersion, "#to_i with ceil = false" do
- it "returns an integer representation of the version string" do
- SpecVersion.new("2.23.10").to_i.should == 1022310
- end
-
- it "replaces missing version parts with zeros" do
- SpecVersion.new("1.8").to_i.should == 1010800
- SpecVersion.new("1.8.6").to_i.should == 1010806
- end
-end
-
-describe SpecVersion, "#to_i with ceil = true" do
- it "returns an integer representation of the version string" do
- SpecVersion.new("1.8.6", true).to_i.should == 1010806
- end
-
- it "fills in 9s for missing tiny values" do
- SpecVersion.new("1.8", true).to_i.should == 1010899
- SpecVersion.new("1.8.6", true).to_i.should == 1010806
- end
-end
-
-describe SpecVersion, "#to_int" do
- it "returns the same value as #to_i" do
- version = SpecVersion.new("4.16.87")
- version.to_int.should == version.to_i
- end
-end
diff --git a/spec/mspec/tool/find.rb b/spec/mspec/tool/find.rb
deleted file mode 100755
index 322b023f15..0000000000
--- a/spec/mspec/tool/find.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-Dir.chdir('../rubyspec') do
- regexp = Regexp.new(ARGV[0])
- Dir.glob('**/*.rb') do |file|
- contents = File.read(file)
- if regexp =~ contents
- puts file
- end
- end
-end
diff --git a/spec/mspec/tool/remove_old_guards.rb b/spec/mspec/tool/remove_old_guards.rb
deleted file mode 100644
index feb4ee4662..0000000000
--- a/spec/mspec/tool/remove_old_guards.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# Remove old version guards in ruby/spec
-
-def dedent(line)
- if line.start_with?(" ")
- line[2..-1]
- else
- line
- end
-end
-
-def remove_guards(guard, keep)
- Dir["*/**/*.rb"].each do |file|
- contents = File.read(file)
- if contents =~ guard
- puts file
- lines = contents.lines.to_a
- while first = lines.find_index { |line| line =~ guard }
- indent = lines[first][/^(\s*)/, 1].length
- last = (first+1...lines.size).find { |i|
- space = lines[i][/^(\s*)end$/, 1] and space.length == indent
- }
- raise file unless last
- if keep
- lines[first..last] = lines[first+1..last-1].map { |l| dedent(l) }
- else
- if first > 0 and lines[first-1] == "\n"
- first -= 1
- elsif lines[last+1] == "\n"
- last += 1
- end
- lines[first..last] = []
- end
- end
- File.write file, lines.join
- end
- end
-end
-
-version = (ARGV[0] || "2.2")
-remove_guards(/ruby_version_is ["']#{version}["'] do/, true)
-remove_guards(/ruby_version_is ["'][0-9.]*["']...["']#{version}["'] do/, false)
diff --git a/spec/mspec/tool/sync/.gitignore b/spec/mspec/tool/sync/.gitignore
deleted file mode 100644
index e64f1e8542..0000000000
--- a/spec/mspec/tool/sync/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/jruby
-/rubinius
-/ruby
-/truffleruby
diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb
deleted file mode 100644
index fbd37fe95b..0000000000
--- a/spec/mspec/tool/sync/sync-rubyspec.rb
+++ /dev/null
@@ -1,240 +0,0 @@
-IMPLS = {
- truffleruby: {
- git: "https://github.com/graalvm/truffleruby.git",
- from_commit: "f10ab6988d",
- },
- jruby: {
- git: "https://github.com/jruby/jruby.git",
- from_commit: "f10ab6988d",
- },
- rbx: {
- git: "https://github.com/rubinius/rubinius.git",
- },
- mri: {
- git: "https://github.com/ruby/ruby.git",
- master: "trunk",
- merge_message: "Update to ruby/spec@",
- },
-}
-
-MSPEC = ARGV.delete('--mspec')
-
-MSPEC_REPO = File.expand_path("../../..", __FILE__)
-raise MSPEC_REPO if !Dir.exist?(MSPEC_REPO) or !Dir.exist?("#{MSPEC_REPO}/.git")
-
-# Assuming the rubyspec repo is a sibling of the mspec repo
-RUBYSPEC_REPO = File.expand_path("../rubyspec", MSPEC_REPO)
-raise RUBYSPEC_REPO unless Dir.exist?(RUBYSPEC_REPO)
-
-SOURCE_REPO = MSPEC ? MSPEC_REPO : RUBYSPEC_REPO
-
-NOW = Time.now
-
-BRIGHT_RED = "\e[31;1m"
-BRIGHT_YELLOW = "\e[33;1m"
-RESET = "\e[0m"
-
-class RubyImplementation
- attr_reader :name
-
- def initialize(name, data)
- @name = name.to_s
- @data = data
- end
-
- def git_url
- @data[:git]
- end
-
- def default_branch
- @data[:master] || "master"
- end
-
- def repo_name
- File.basename(git_url, ".git")
- end
-
- def repo_org
- File.basename(File.dirname(git_url))
- end
-
- def from_commit
- from = @data[:from_commit]
- "#{from}..." if from
- end
-
- def last_merge_message
- message = @data[:merge_message] || "Merge ruby/spec commit"
- message.gsub!("ruby/spec", "ruby/mspec") if MSPEC
- message
- end
-
- def prefix
- MSPEC ? "spec/mspec" : "spec/ruby"
- end
-
- def rebased_branch
- "#{@name}-rebased"
- end
-end
-
-def sh(*args)
- puts args.join(' ')
- system(*args)
- raise unless $?.success?
-end
-
-def branch?(name)
- branches = `git branch`.sub('*', '').lines.map(&:strip)
- branches.include?(name)
-end
-
-def update_repo(impl)
- unless File.directory? impl.repo_name
- sh "git", "clone", impl.git_url
- end
-
- Dir.chdir(impl.repo_name) do
- puts Dir.pwd
-
- sh "git", "checkout", impl.default_branch
- sh "git", "pull"
- end
-end
-
-def filter_commits(impl)
- Dir.chdir(impl.repo_name) do
- date = NOW.strftime("%F")
- branch = "#{MSPEC ? :mspec : :specs}-#{date}"
-
- unless branch?(branch)
- sh "git", "checkout", "-b", branch
- sh "git", "filter-branch", "-f", "--subdirectory-filter", impl.prefix, *impl.from_commit
- sh "git", "push", "-f", SOURCE_REPO, "#{branch}:#{impl.name}"
- end
- end
-end
-
-def rebase_commits(impl)
- Dir.chdir(SOURCE_REPO) do
- sh "git", "checkout", "master"
- sh "git", "pull"
-
- rebased = impl.rebased_branch
- if branch?(rebased)
- last_commit = Time.at(Integer(`git log -n 1 --format='%ct' #{rebased}`))
- days_since_last_commit = (NOW-last_commit) / 86400
- if days_since_last_commit > 7
- abort "#{BRIGHT_RED}#{rebased} exists but last commit is old (#{last_commit}), delete the branch if it was merged#{RESET}"
- else
- puts "#{BRIGHT_YELLOW}#{rebased} already exists, last commit on #{last_commit}, assuming it correct#{RESET}"
- sh "git", "checkout", rebased
- end
- else
- sh "git", "checkout", impl.name
-
- if ENV["LAST_MERGE"]
- last_merge = `git log -n 1 --format='%H %ct' #{ENV["LAST_MERGE"]}`
- else
- last_merge = `git log --grep='^#{impl.last_merge_message}' -n 1 --format='%H %ct'`
- end
- last_merge, commit_timestamp = last_merge.chomp.split(' ')
-
- raise "Could not find last merge" unless last_merge
- puts "Last merge is #{last_merge}"
-
- commit_date = Time.at(Integer(commit_timestamp))
- days_since_last_merge = (NOW-commit_date) / 86400
- if days_since_last_merge > 60
- raise "#{days_since_last_merge.floor} days since last merge, probably wrong commit"
- end
-
- puts "Rebasing..."
- sh "git", "branch", "-D", rebased if branch?(rebased)
- sh "git", "checkout", "-b", rebased, impl.name
- sh "git", "rebase", "--onto", "master", last_merge
- end
- end
-end
-
-def test_new_specs
- require "yaml"
- Dir.chdir(SOURCE_REPO) do
- if MSPEC
- sh "bundle", "exec", "rspec"
- else
- versions = YAML.load_file(".travis.yml")
- versions = versions["matrix"]["include"].map { |job| job["rvm"] }
- versions.delete "ruby-head"
- min_version, max_version = versions.minmax
-
- run_rubyspec = -> version {
- command = "chruby #{version} && ../mspec/bin/mspec -j"
- sh ENV["SHELL"], "-c", command
- }
- run_rubyspec[min_version]
- run_rubyspec[max_version]
- run_rubyspec["trunk"]
- end
- end
-end
-
-def verify_commits(impl)
- puts
- Dir.chdir(SOURCE_REPO) do
- history = `git log master...`
- history.lines.slice_before(/^commit \h{40}$/).each do |commit, *message|
- commit = commit.chomp.split.last
- message = message.join
- if /\W(#\d+)/ === message
- puts "Commit #{commit} contains an unqualified issue number: #{$1}"
- puts "Replace it with #{impl.repo_org}/#{impl.repo_name}#{$1}"
- sh "git", "rebase", "-i", "#{commit}^"
- end
- end
-
- puts "Manually check commit messages:"
- print "Press enter >"
- STDIN.gets
- sh "git", "log", "master..."
- end
-end
-
-def fast_forward_master(impl)
- Dir.chdir(SOURCE_REPO) do
- sh "git", "checkout", "master"
- sh "git", "merge", "--ff-only", "#{impl.name}-rebased"
- end
-end
-
-def check_ci
- puts
- puts <<-EOS
- Push to master, and check that the CI passes:
- https://github.com/ruby/#{:m if MSPEC}spec/commits/master
-
- EOS
-end
-
-def main(impls)
- impls.each_pair do |impl, data|
- impl = RubyImplementation.new(impl, data)
- update_repo(impl)
- filter_commits(impl)
- rebase_commits(impl)
- test_new_specs
- verify_commits(impl)
- fast_forward_master(impl)
- check_ci
- end
-end
-
-if ARGV == ["all"]
- impls = IMPLS
-else
- args = ARGV.map { |arg| arg.to_sym }
- raise ARGV.to_s unless (args - IMPLS.keys).empty?
- impls = IMPLS.select { |impl| args.include?(impl) }
-end
-
-main(impls)
diff --git a/spec/ruby/.gitignore b/spec/ruby/.gitignore
deleted file mode 100644
index 3f1206a16e..0000000000
--- a/spec/ruby/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/Gemfile.lock
-/rubyspec_temp
-/ext
-/.ruby-version
-/.ruby-gemset
diff --git a/spec/ruby/.rubocop.yml b/spec/ruby/.rubocop.yml
deleted file mode 100644
index 762fe42bad..0000000000
--- a/spec/ruby/.rubocop.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-inherit_from: .rubocop_todo.yml
-
-AllCops:
- TargetRubyVersion: 2.4
- DisplayCopNames: true
- Exclude:
- - command_line/fixtures/bad_syntax.rb
- DisabledByDefault: true
-
-Layout/TrailingWhitespace:
- Enabled: true
-
-Lint:
- Enabled: true
-
-# {...} has higher precedence than do ... end, on purpose
-Lint/AmbiguousBlockAssociation:
- Enabled: false
-
-Lint/AssignmentInCondition:
- Enabled: false
-
-Lint/BooleanSymbol:
- Enabled: false
-
-Lint/InterpolationCheck:
- Enabled: false
-
-Lint/LiteralAsCondition:
- Enabled: false
-
-Lint/UnneededRequireStatement:
- Enabled: false
-
-Lint/UnifiedInteger:
- Enabled: false
-
-Lint/UnusedBlockArgument:
- Enabled: false
-
-Lint/UnusedMethodArgument:
- Enabled: false
-
-Lint/UselessAssignment:
- Enabled: false
-
-Lint/UselessComparison:
- Enabled: false
-
-# The cop registers too many false positives to `.should == something`
-Lint/Void:
- Enabled: false
-
-Lint/EmptyExpression:
- Exclude:
- - 'language/**/*.rb'
-
-Lint/UriRegexp:
- Exclude:
- - 'library/uri/regexp_spec.rb'
diff --git a/spec/ruby/.rubocop_todo.yml b/spec/ruby/.rubocop_todo.yml
deleted file mode 100644
index c227ca032d..0000000000
--- a/spec/ruby/.rubocop_todo.yml
+++ /dev/null
@@ -1,207 +0,0 @@
-# This configuration was generated by
-# `rubocop --auto-gen-config`
-# on 2017-12-15 22:14:22 +0900 using RuboCop version 0.52.0.
-# The point is for the user to remove these configuration records
-# one by one as the offenses are removed from the code base.
-# Note that changes in the inspected code, or installation of new
-# versions of RuboCop, may require this file to be generated again.
-
-# Offense count: 2
-Lint/DuplicateCaseCondition:
- Exclude:
- - 'language/case_spec.rb'
-
-# Offense count: 6
-Lint/DuplicateMethods:
- Exclude:
- - 'core/array/fixtures/encoded_strings.rb'
- - 'core/method/fixtures/classes.rb'
- - 'core/module/fixtures/classes.rb'
- - 'core/unboundmethod/fixtures/classes.rb'
- - 'fixtures/class.rb'
-
-# Offense count: 4
-Lint/EmptyWhen:
- Exclude:
- - 'language/case_spec.rb'
-
-# Offense count: 5
-Lint/EnsureReturn:
- Exclude:
- - 'language/fixtures/ensure.rb'
- - 'language/fixtures/return.rb'
- - 'language/return_spec.rb'
-
-# Offense count: 10
-Lint/FloatOutOfRange:
- Exclude:
- - 'core/string/modulo_spec.rb'
-
-# Offense count: 107
-Lint/FormatParameterMismatch:
- Exclude:
- - 'core/kernel/shared/sprintf.rb'
- - 'core/string/modulo_spec.rb'
-
-# Offense count: 28
-Lint/HandleExceptions:
- Enabled: false
-
-# Offense count: 2
-Lint/ImplicitStringConcatenation:
- Exclude:
- - 'language/string_spec.rb'
-
-# Offense count: 4
-Lint/IneffectiveAccessModifier:
- Exclude:
- - 'core/kernel/fixtures/classes.rb'
- - 'core/module/fixtures/classes.rb'
- - 'language/fixtures/private.rb'
-
-# Offense count: 5
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: runtime_error, standard_error
-Lint/InheritException:
- Exclude:
- - 'core/enumerator/lazy/fixtures/classes.rb'
- - 'core/exception/fixtures/common.rb'
- - 'core/module/fixtures/autoload_ex1.rb'
-
-# Offense count: 3
-# Cop supports --auto-correct.
-Lint/LiteralInInterpolation:
- Exclude:
- - 'language/defined_spec.rb'
- - 'language/fixtures/squiggly_heredoc.rb'
- - 'core/module/refine_spec.rb'
-
-# Offense count: 16
-Lint/Loop:
- Exclude:
- - 'language/until_spec.rb'
- - 'language/while_spec.rb'
-
-# Offense count: 8
-# Cop supports --auto-correct.
-Lint/MultipleCompare:
- Exclude:
- - 'language/precedence_spec.rb'
-
-# Offense count: 8
-Lint/NestedMethodDefinition:
- Exclude:
- - 'language/def_spec.rb'
-
-# Offense count: 12
-Lint/ParenthesesAsGroupedExpression:
- Exclude:
- - 'command_line/rubyopt_spec.rb'
- - 'core/string/fixtures/freeze_magic_comment.rb'
- - 'language/block_spec.rb'
- - 'language/fixtures/send.rb'
- - 'language/method_spec.rb'
- - 'library/socket/socket/getaddrinfo_spec.rb'
-
-# Offense count: 1
-# Cop supports --auto-correct.
-Lint/RedundantWithIndex:
- Exclude:
- - 'core/enumerator/with_index_spec.rb'
-
-# Offense count: 24
-Lint/RescueException:
- Exclude:
- - 'command_line/fixtures/debug_info.rb'
- - 'core/dir/fileno_spec.rb'
- - 'core/exception/cause_spec.rb'
- - 'core/exception/no_method_error_spec.rb'
- - 'core/kernel/fixtures/autoload_frozen.rb'
- - 'core/module/autoload_spec.rb'
- - 'core/mutex/sleep_spec.rb'
- - 'core/process/euid_spec.rb'
- - 'core/process/setsid_spec.rb'
- - 'core/process/uid_spec.rb'
- - 'core/thread/abort_on_exception_spec.rb'
- - 'core/thread/shared/exit.rb'
- - 'language/rescue_spec.rb'
- - 'library/erb/filename_spec.rb'
-
-# Offense count: 1
-# Cop supports --auto-correct.
-Lint/ScriptPermission:
- Exclude:
- - 'command_line/fixtures/bin/launcher.rb'
-
-# Offense count: 2
-# Configuration parameters: IgnoreImplicitReferences.
-Lint/ShadowedArgument:
- Exclude:
- - 'language/fixtures/super.rb'
-
-# Offense count: 10
-Lint/ShadowingOuterLocalVariable:
- Exclude:
- - 'core/binding/local_variables_spec.rb'
- - 'language/block_spec.rb'
- - 'language/proc_spec.rb'
-
-# Offense count: 2
-# Cop supports --auto-correct.
-Lint/StringConversionInInterpolation:
- Exclude:
- - 'core/io/print_spec.rb'
-
-# Offense count: 9
-Lint/UnderscorePrefixedVariableName:
- Exclude:
- - 'core/io/pipe_spec.rb'
- - 'core/io/popen_spec.rb'
- - 'language/block_spec.rb'
-
-# Offense count: 90
-# Cop supports --auto-correct.
-Lint/UnneededSplatExpansion:
- Exclude:
- - 'core/array/element_reference_spec.rb'
- - 'core/enumerable/fixtures/classes.rb'
- - 'core/enumerable/max_by_spec.rb'
- - 'core/enumerable/min_by_spec.rb'
- - 'core/enumerable/minmax_by_spec.rb'
- - 'core/enumerator/lazy/fixtures/classes.rb'
- - 'core/file/basename_spec.rb'
- - 'core/kernel/p_spec.rb'
- - 'language/array_spec.rb'
- - 'language/break_spec.rb'
- - 'language/case_spec.rb'
- - 'language/next_spec.rb'
- - 'language/send_spec.rb'
- - 'language/variables_spec.rb'
-
-# Offense count: 54
-Lint/UnreachableCode:
- Exclude:
- - 'core/enumerator/lazy/fixtures/classes.rb'
- - 'core/kernel/catch_spec.rb'
- - 'core/kernel/throw_spec.rb'
- - 'language/break_spec.rb'
- - 'language/fixtures/break.rb'
- - 'language/fixtures/break_lambda_toplevel.rb'
- - 'language/fixtures/break_lambda_toplevel_block.rb'
- - 'language/fixtures/break_lambda_toplevel_method.rb'
- - 'language/fixtures/return.rb'
- - 'language/next_spec.rb'
- - 'language/return_spec.rb'
- - 'optional/capi/kernel_spec.rb'
- - 'shared/kernel/raise.rb'
-
-# Offense count: 7
-# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
-Lint/UselessAccessModifier:
- Exclude:
- - 'core/module/define_method_spec.rb'
- - 'core/module/fixtures/classes.rb'
- - 'core/module/module_function_spec.rb'
- - 'core/module/private_class_method_spec.rb'
- - 'language/fixtures/send.rb'
diff --git a/spec/ruby/.travis.yml b/spec/ruby/.travis.yml
deleted file mode 100644
index 767d437f67..0000000000
--- a/spec/ruby/.travis.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-sudo: false
-language: ruby
-install:
- - git clone https://github.com/ruby/mspec.git ../mspec
-script:
- - if [ -n "$RUBOCOP" ]; then gem install rubocop -v 0.52.0 && rubocop; fi
- - ../mspec/bin/mspec $MSPEC_OPTS
-matrix:
- include:
- - os: osx
- osx_image: xcode9
- rvm: 2.4.2
- env: CHECK_LEAKS=true
- - os: linux
- rvm: 2.4.2
- env: MSPEC_OPTS="-R2 -ff"
- - os: linux
- rvm: 2.2.8
- - os: linux
- rvm: 2.3.5
- - os: linux
- rvm: 2.4.2
- env: CHECK_LEAKS=true RUBOCOP=true
- - os: linux
- rvm: ruby-head
- allow_failures:
- - os: linux
- rvm: ruby-head
-branches:
- only:
- - master
- - /^try/
-notifications:
- email:
- on_success: change
- on_failure: change
diff --git a/spec/ruby/CHANGES.before-2008-05-10 b/spec/ruby/CHANGES.before-2008-05-10
deleted file mode 100644
index 18778bc146..0000000000
--- a/spec/ruby/CHANGES.before-2008-05-10
+++ /dev/null
@@ -1,17796 +0,0 @@
- Changelog
-===========
-
-This file contains the entire revision history of the specs from
-December 2006 onwards, when the spec project got started more or
-less officially by converting the remaining Test::Unit style tests
-in Rubinius to the spec style. The history is not preserved in the
-git repository history itself, so this data is here for reference.
-All the commit hashes are from the Rubinius repository.
-
-It still misses quite a few of the earlier, disparate specs and
-tests because up to that point the organisation was much looser
-and gathering an exhaustive accounting of the entire history of
-TDD/BDD would be time-consuming, particularly with the few full
-directory moves in there and such. All of the data is preserved
-in the Rubinius repository if someone is interested in that bit
-of history.
-
-Be aware that the history contains some Rubinius-specific specs
-by necessity. If you find any commits listed that were _solely_
-for Rubinius, feel free to strip them out.
-
-Thanks to everyone committing up to this point--over 2600 commits
-in just this incomplete version. Keep it up.
-
-
-
- Revision History
-------------------
-
-
-commit 2b24a1e84c350810817885eeb6532f43c698a95c
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Fri May 9 16:45:07 2008 -0700
-
- Fixed up pack for base64 and uuencode to be MUCH MUCH cleaner and 2x faster
-
-commit 022bc5dbfafcf1f9fd5e25820104718bd4d45661
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 9 23:51:47 2008 +0200
-
- Share common specs for BigDecimal's #mult and #*.
-
-commit 414e7eedce9d0cea982e24f1031c407daccc648b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 9 23:19:38 2008 +0200
-
- New rubyspecs for BigDecimal#mult
-
- * Verifies that proper signs are calculated when
- zero is involved.
-
-commit 6883d7d0c67f7be84e7ea1703912452eaecaac6c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 9 22:54:49 2008 +0200
-
- New rubyspec for Module#new with block.
-
-commit f8bd3e34014a7351470685676b6b168abd787794
-Author: Phil Hagelberg <technomancy@gmail.com>
-Date: Fri May 9 12:53:00 2008 -0700
-
- Added specs for OpenSSL::HMAC.hexdigest and .digest
-
-commit 686c28493d42b9c798aa791823395d1000423225
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 9 20:20:13 2008 +0200
-
- Some more rubyspecs for BigDecimal's #floor and #ceil.
-
-commit aba022a6620ec8d3a09067e9677f0f9c5d8078ee
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 9 17:51:35 2008 +0200
-
- New rubyspecs for BigDecimal's #floor and #ceil.
-
-commit e4d844ba5851a798b7acb684cf68fdcef353d13c
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu May 8 22:13:58 2008 -0700
-
- Excluded stdlib specs from default CI run. Added spec/full.mspec.
-
-commit 6a133574617cb435ad1684f208430112ff6839f6
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu May 8 16:19:50 2008 -0700
-
- String#unpack overhaul. NO extra methods littered through Fixnum/Integer/String. NO procs. More readable, but still messy.
-
-commit 11dd3ae2c4e0dd81304e85ba662db41196f1ce4c
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed May 7 23:59:31 2008 -0700
-
- Fixed constant type clash for ModuleSpecs modules.
-
-commit 4e702d10b32fdba62cdeae476b8217019839c3b0
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed May 7 21:42:11 2008 -0700
-
- Some specs for Kernel#__add_method__ and Module.__add_method__.
-
-commit 819649f24f59819be185b0562b94f9089f8c000c
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed May 7 14:48:01 2008 -0700
-
- Added spec for Kernel#eval with binding from method defined by #eval.
-
-commit d73b17b88b6084fdf7cab764b0fbdd3b3882dd81
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed May 7 10:06:26 2008 -0700
-
- Use literals in Bignum#to_f specs (alternate fix for #535).
-
-commit ee211770eb8792b3f58f78ff60eec6d5289caa20
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed May 7 02:38:00 2008 -0700
-
- Added specs for big uncovered areas, still not 100%
-
-commit 7ce9bc2d7edc64f6886c3d34836bc0394414ed66
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue May 6 03:56:19 2008 -0700
-
- Fixed typo
-
-commit af3407251ee0f287ec80232c354153af169636e4
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue May 6 22:01:23 2008 +1000
-
- Fix bug in Debugger::Output.wrap
-
-commit d9322306ea70f2b847b0f806bdb13ea02f2d6b4d
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon May 5 13:09:32 2008 -0400
-
- Fix some bugs in BigDecimal#/. More may yet lurk.
-
-commit 2f3a4cc14433858b13caa932c8a50c31e024c7e8
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon May 5 12:04:26 2008 -0500
-
- Adding more specs for REXML::Element
-
- * Covers REXML::Element#{add_attribute, add_attributes, add_namespace, add_text, clone, comments}
-
-commit 7db8c2b563ea474cf2db5fa14bb2a6345c8c469f
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon May 5 10:54:00 2008 -0500
-
- One more case for YAML.load specs
-
-commit 098decdf510b05f82ff9a6cc6769cf478a3236ab
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun May 4 22:29:35 2008 -0400
-
- Define BigDecimal#ver.
-
-commit f6f1fe6a667570e4c1521649b964dca1352d1c32
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun May 4 22:12:08 2008 -0400
-
- BigDecimal#new: Make space between '-' and 'Infinity' unparsable, as per spec.
-
-commit 503aae7cdbb208da8f25080762e17f0866845c4d
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon May 5 06:19:40 2008 -0400
-
- Method call parsing spec from Jim Kingdon with minor addition.
-
- * Moved the SyntaxError producing code into an #eval because the file
- cannot be compiled to run otherwise.
-
-commit 398d5de0a0ffaf746e39e5f6a6ded02483fd1842
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon May 5 02:26:39 2008 -0400
-
- Spec for :match node, implicit Regexp matches against $_.
-
- * Compiler and Language specs.
-
-commit 206cea31c6a93fe434948dcb79321e2c119edf21
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat May 3 11:40:17 2008 -0400
-
- Implement BigDecimal#power and #**, fix some bugs in #mult.
-
-commit a197099d9be6e48ad32480ae323302c83146147b
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat May 3 02:18:35 2008 -0400
-
- Fixed a logic and syntax error in BigDecimal#mult specs.
-
- * Removed some parentheses too.
-
-commit 081afd58a29ccd5025b806f53e9d7679b9296a7f
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat May 3 02:25:45 2008 -0400
-
- Make sure subclasses that implement their own Hash#default work (Merb)
-
-commit 203ca288175416fadb110b2aa9cdf8cfbf13215d
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat May 3 01:49:35 2008 -0400
-
- Specs and implementation for module include order (fixes abstract.rb)
-
-commit c788a9f2d9c4561a2837bbf78f68a6885d626917
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 18:14:32 2008 -0400
-
- Implement BigDecimal#*, as well as #mult without precision support.
-
-commit 57d78528ff4cf249d906785ffbfdde1fda4aa3cc
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 17:36:15 2008 -0400
-
- Implement BigDecimal#/ and #quo. Not perfect; still relies on #/.
-
-commit c42cc2cacc347d8284650c7046d4dadf94d7d4a5
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 16:13:07 2008 -0400
-
- Fix a typo in specs.
-
-commit ae179b410665da18628f249e6796f1e07ab83763
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 16:10:43 2008 -0400
-
- Get BigDecimal#floor basically working.
- * The failing specs depend on #/, which isn't implemented yet.
-
-commit f8221117d174b91affe406c8089ed25e887232b3
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 16:06:32 2008 -0400
-
- Fix bugs in BigDecimal#add and #+. This also affects #sub, #-, and #ceil.
-
-commit cdd196daf7643e846b7f3582b1e441b883e02aba
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 15:41:29 2008 -0400
-
- More specs to fix bugs in BigDecimal#add and #+.
-
-commit c1c52a2a531b570fa1025d99e464d93c570cf59e
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 15:22:33 2008 -0400
-
- Write another spec for BigDecimal#ceil.
-
-commit 71b65cdbfa5aae461fc52c997df9fca3bee9c8d5
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri May 2 14:47:34 2008 -0400
-
- Write tests for a bug in BigDecimal#add and #+ where 0 + 1 = 0.1.
-
-commit 55988ef53879c1c489c570b3f37717365c7f8e2b
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat May 3 01:04:11 2008 -0400
-
- Fix use of alias keyword inside instance_eval
-
-commit d4011595a0077e91665f85410d458c57367cf50b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 2 20:38:15 2008 +0200
-
- Added news specs for BigDecimal#mult.
-
-commit b6771644d35b6b8f3c87f7f4461bcaba99cd976f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 2 19:41:09 2008 +0200
-
- More BigDecimal#divmod rubyspecs.
-
- MRI-specific bug is hidden behind ruby-bug guard.
-
-commit 854a011324ce717cfd47ddec6389a9e9abb0db18
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 2 18:45:29 2008 +0200
-
- New BigDecimal#divmod specs.
-
-commit b9806e0efb2a8e51d70f6d51733df7bed88152d9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 2 16:45:10 2008 +0200
-
- A couple of test cases for BigDecimal's #quo, #div, #/.
-
-commit 3cf6c1e03001ba1dda966e3392b665f5b08a1b9d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri May 2 15:03:37 2008 +0200
-
- More tests for BigDecimal#floor.
-
-commit b70023978562af89cf4349e14e9443adb37ecbbe
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu May 1 21:15:29 2008 -0400
-
- Improved a spec description for String#index.
-
- * The description looks exactly like we had the wrong implementation
- relying on % 256 and someone wrote a spec to make sure that did not
- happen. However, the description was more or less meaningless to
- what was actually being specced.
-
-commit 6e6aa411ff4c7a837d5d4adb9ab893719cf9e122
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu May 1 10:48:20 2008 -0700
-
- Fix a number of things to pass all def specs
-
- This is the result of ping-pong between Evan and Wilson. It refactors
- out enclosing_class from being used, and instead information is always
- pulled directly from the StaticScope object. This lets us inject proper
- scoping changes in ruby.
-
-commit 2db27aef88e2ca7752beba846d172ede276275e0
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu May 1 19:03:50 2008 +0200
-
- Implemented Socket.unpack_sockaddr_un
-
-commit d515221698e02b52ed4661113d659744fbfae36f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu May 1 18:18:32 2008 +0200
-
- Forgot to update spec tags for TCPSocket.gethostbyname
-
-commit bf839a99c3a5b773b6b96c6d5a1fcc5056511e7a
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu May 1 14:03:30 2008 +0200
-
- Implement File#mtime specs
-
-commit b8c713e6b972b464788c740b4283a5b4226c123c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu May 1 13:55:36 2008 +0200
-
- Implemented File.lchmod and initial specs
-
-commit 059c926d7280c2e7c9f8bf710c5aef70cde3e777
-Author: Adam Wiggins <adam@heroku.com>
-Date: Sun Apr 27 15:03:31 2008 -0700
-
- IO.popen read/write pipes
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit d9a050aa45efd00a40395b7ac7ac069f4be1fd1c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu May 1 16:25:18 2008 +1000
-
- Spec fixes for Tuple#to_a
-
-commit 0b610359fbfe8137fdba95d90b659238168d6788
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 30 17:45:51 2008 -0400
-
- Update spectags.
-
-commit 024ebfdf3fa9c54b8a81134edb52fe10b09e4b91
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 30 22:56:44 2008 +0200
-
- Added BigDecimal#divmod excludes.
-
-commit e12d21a90760df723c0f48265cb49a9c4463db7c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 30 20:51:06 2008 +0200
-
- More tests for BigDecimal#divmod.
-
-commit 68cfef604f9b5411ca9e0349883bac4f59541f0d
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 30 16:47:31 2008 -0400
-
- Make BigDecimal#finite? handle NaN correctly, and refactor accordingly.
-
-commit 5066bcb8881241caf6d13be625b32633bda6567e
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 30 15:01:12 2008 -0400
-
- Make BigDecimal#<= and #>= pass Vladimir's new specs.
-
-commit 49601aff01c394fe2168f5f221a987be63a9ebc7
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 30 20:20:18 2008 +0200
-
- Various improvements to BigDecimal rubyspecs.
-
- * Corrected comparison specs (properly add arrays there)
- * New reminder specs
- * New modulo and % specs
- * Tagged rbx failures
-
-commit dd1700b747ba26b27eff0b249623aca559db06e1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 30 17:48:20 2008 +0200
-
- More test cases for BigDecimal#modulo and #%.
-
-commit 8eb9dc1b0aee3587f4da8b9cbe306fd431159d79
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 30 16:57:16 2008 +0200
-
- New specs for BigDecimal#modulo and #%.
-
-commit 4a846f807fe2c4c12d8719bc5c9ccb4ab696aff9
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Tue Apr 29 15:29:34 2008 -0500
-
- Fixes REXML::Element#namespaces specs
-
- * Use sort on the arrays to make sure the specs pass on JRuby too.
-
-commit 823683a864072ef6a81e808dbf792dee45d29c52
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Tue Apr 29 14:54:08 2008 -0500
-
- Adds more specs for REXML.
-
- * Specs for REXML#{inspect, namespace, namespaces, prefixes, text and text=}.
-
-commit a11a10760ce92ee373e04a5445234521a27874cc
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 17:55:55 2008 -0400
-
- Committing so we can bisect.
-
-commit df94214b1d132b02e3dd5b166d1c7c5cd5d50a21
-Author: Drew Olson <olsonas@gmail.com>
-Date: Mon Apr 28 19:21:07 2008 -0700
-
- Added spec for Array#remove_outer_arrays
-
-commit ec4ece9c06b42c257b4ffce2cf319f0ad23f65e8
-Author: Drew Olson <olsonas@gmail.com>
-Date: Sun Apr 27 20:15:47 2008 -0500
-
- Added more edge cases for recursive arrays to spec for File#join
- * an empty array containing an empty array which contains a recursive array should return
- '[...]' when File#join is called on it.
-
-commit 698a5d291cf63e56e9a3508a8850c77fa2c23430
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 16:17:05 2008 -0400
-
- Implement BigDecimal#=== as alias of #eql?.
-
-commit 18f515e735eecc519be55a6e3253db7135a137ad
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 16:09:43 2008 -0400
-
- Implement BigDecimal#sub.
-
-commit b331faa567dc1d98163c6447897221877cf756eb
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 16:04:06 2008 -0400
-
- Implement BigDecimal#add.
-
-commit f3f94c9b53045ddde335981897e2f6087dab7ef2
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Apr 28 12:01:41 2008 -0500
-
- hack to fix DRb.start_service spec to at least test start_service
-
-commit 4c8d6d90c69615386e26c71633e242f4e1f19342
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Apr 28 11:56:47 2008 -0500
-
- spec for DRb.stop_service to see if it clears the socket correctly
-
-commit 03cb539f42f0b558fa29911c1dfc71ec5f2b183f
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Apr 28 11:20:17 2008 -0500
-
- Revert "Revert "Made DRb spec depend partially on PID so multiple runs don't clash.""
-
- Apparently this is a supposed fix for concurrent spec runs, not for the spec failure
-
- This reverts commit 08695d9a6940ab74f6eb8965e449a417002a42a6.
-
-commit 2172e2ac20b69a97c2ad66551b3620a43bfda700
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 02:14:18 2008 -0400
-
- Make BigDecimal#exponent return Bignums as necessary, not just Fixnums.
-
-commit dc93d06163e80cdf89a67532654a850828119287
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 28 01:23:19 2008 -0400
-
- Correct implementation of BigDecimal#+ and #-. There's still a lot of repetition to be factored out, but this algorithm is more correct than the last try.
-
-commit 1da58bb7f0afbba4f8412e06983304dc7d887ac9
-Author: Luis Lavena <luislavena@gmail.com>
-Date: Thu Apr 24 16:37:59 2008 -0300
-
- Corrected small typo on File#join specs under Windows.
-
-commit b287619579ad11535722a2374b6f849d88fe9931
-Author: Drew Olson <olsonas@gmail.com>
-Date: Thu Apr 24 14:24:10 2008 -0700
-
- Spec for File#join now describes correct behavior for arrays with recursive sub-arrays.
-
-commit 5830380895c0bec16c6af39d0f29d8d70268028d
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Sun Apr 27 14:53:47 2008 -0500
-
- DRb.start_service spec fails because of a timing bug in DRb
-
- See http://jira.codehaus.org/browse/JRUBY-2347
-
-commit 08695d9a6940ab74f6eb8965e449a417002a42a6
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Sun Apr 27 14:51:16 2008 -0500
-
- Revert "Made DRb spec depend partially on PID so multiple runs don't clash."
-
- The spec is designed for sane behavior, if Rubinius or the
- implementation of DRb is causing problems then they should be
- fixed, not the spec in this case. Fixing the spec will only
- hide the bug.
-
- See http://jira.codehaus.org/browse/JRUBY-2347 for more commentary on the problem.
-
- This reverts commit f89bd8c6c425c9d9bcc3e589b8d3b05ce3ccbced.
-
-commit 94ba0884c8e7f398b6fe8d6736834f62f6a49815
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Apr 27 21:23:47 2008 +0200
-
- More checks for BigDecimal#abs specs.
-
-commit 80932d25ca95e2e8c803d244a7636e3004525ade
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Apr 27 21:10:26 2008 +0200
-
- More test cases for BigDecimal#finite? specs.
-
-commit 4b541ed23ccac65f6f4b2ef8aad56e9aa7a69e12
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Apr 27 21:04:08 2008 +0200
-
- Added testcase for BigDecimal#infinite? for NaN.
-
-commit 4a1f39426fc60ae7c2ed0470259fa0752a46d030
-Author: Adam Wiggins <adam@heroku.com>
-Date: Sat Apr 26 22:57:09 2008 -0700
-
- IO#write returns 0 when writing a blank string, to match behavior of MRI
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 56c0088f9b075769933c8c87e3c2d256cff3a3e8
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun Apr 27 00:28:47 2008 -0400
-
- Typo.
-
-commit c11410654b9046cdb58dba1d116f58ce74f4c263
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun Apr 27 00:24:32 2008 -0400
-
- Finish implementing #@- and #infinite?. Update spectags, of course
-
-commit dc9f427ecb9d55559d800af70f9c1a3f2f2123b5
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun Apr 27 00:07:31 2008 -0400
-
- Amplify a comment.
-
-commit b9776b953ae67f2088e44b640145af464a1cf942
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sun Apr 27 00:02:48 2008 -0400
-
- Get BigDecimal#+ working. I hate this algorithm, but it works without running out of memory.
- * Update spec tags.
-
-commit b87ff5c22891f19ad0b956e7e02cc3a3d1adcc93
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 14:27:00 2008 -0400
-
- Implement BigDecimal#coerce.
- * Update spectags.
- * Rewrite one spec so it doesn't depend on BigDecimal#-, which is not yet implemented.
-
-commit f89bd8c6c425c9d9bcc3e589b8d3b05ce3ccbced
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Apr 26 15:52:49 2008 -0700
-
- Made DRb spec depend partially on PID so multiple runs don't clash.
-
-commit 3c49a1d16f20726c4ee2d7eb5f5c671537aa59d5
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Apr 26 15:13:47 2008 -0700
-
- Added wordsize guard for BigDecimal#exponent spec.
-
-commit 3aac5f6d64f4cbbca70ecf01b7ed9be596fa5b76
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Apr 26 15:09:40 2008 -0700
-
- Updated spec_helper and renamed CaptureOutput to IOStub.
-
-commit 94322a6a95770a030d28925cc7213a38c5687ea1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Apr 26 23:16:59 2008 +0200
-
- A bit more test cases for BigDecimal#-@.
-
-commit 9919c5e3be59562532c967b479c959cf6270046e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Apr 26 21:01:44 2008 +0200
-
- New specs for BigDecimal#uminus.
-
-commit c3e74531f1ca1e70671f529671c0fa474968dc87
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Sat Apr 26 13:08:04 2008 +0200
-
- FreeBSD seems to work like the rest, not darwin
-
- Tested on FreeBSD/i386 7-STABLE
-
-commit c06a091b285f388f09b11037975921662759eea2
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 12:14:33 2008 -0400
-
- Implement BigDecimal#exponent, update spectags. Looks like parts of #** have accidentally stopped failing too. :)
-
-commit e5b753b7e659b29f5ed4aa57018f922111b238f5
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 11:53:55 2008 -0400
-
- Specify return type of BigDecimal#ceil as BigDecimal, as per library documentation.
-
-commit 0ca3b9ceb6ef5ca1898250b89f75c0194b5da481
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 11:50:24 2008 -0400
-
- Fix BigDecimal#inspect output, update spectags.
-
-commit ca99aa062afe9106ec614e2d8969d3491803c9a2
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 11:48:00 2008 -0400
-
- Specify return type of BigDecimal#ceil as BigDecimal, as per library documentation.
-
-commit 587a5cdbbfa4cccdbfe98339ca999f1d63bd66cf
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Apr 26 15:02:33 2008 +0200
-
- Corrected one Array#hash test case.
-
- Now Array#hash pass MRI 1.8.6, 1.8.7, 1.9 and JRuby.
-
-commit f86bdb98b8b9f5ea878c5d142f3a694e5278db77
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Apr 26 14:19:14 2008 +0200
-
- Quarantined couple of specs that fail on *ALL* implmenetations.
-
- Probably, we need a better way to do that, but quarantine
- is a quick and simple way, easily detectable later on.
-
-commit 7ca928211180c66b9879afbc382c376a7649e1b0
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 00:51:39 2008 -0400
-
- Implement BigDecimal#to_f, update tags. Will this need more work?
-
-commit 69dec41f6b5b532c5de7f46e97f97c9e102305c7
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 00:44:40 2008 -0400
-
- Implement BigDecimal#truncate.
- * Update spec tags.
- * Reorganize variables slightly to remove duplication.
-
-commit c823e62c3a6776b62f65c34b16bdca5748d1add9
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 00:36:43 2008 -0400
-
- Implement BigDecimal#truncate.
- * Update spec tags.
- * Reorganize variables slightly to remove duplication.
-
-commit 3f4e5dc78de5bf3e81ae1ce7a0d14852a32aeade
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Sat Apr 26 00:16:38 2008 -0400
-
- Rewrite spec description to bring it in line with what the spec actually does. :)
-
-commit 15d87e8a983d08d99fc3ec6bfbb7f36ed0cd4c4e
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 25 18:09:33 2008 -0400
-
- Implement BigDecimal#to_i, update spec tags.
-
-commit 59873b144ea836e2f9bbef7d5186a1287155e76a
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Apr 25 20:46:17 2008 -0400
-
- Specs for autoload path normalization
-
-commit 71fe2d45d147fe2c41937ae5ef6dbb8814f491c4
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Apr 25 17:05:17 2008 -0400
-
- Use a separate class in Singleton 'new' specs to avoid contamination
-
-commit 2dc8f9eb9c6db014bd6cc132d987fdb4612816f8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Apr 25 16:45:28 2008 -0400
-
- Handle more nightmare Autoload edge cases by hooking into Kernel#require
-
-commit 5c1a375a15adbe20a9bf3d1b95e1f2d30feaa90e
-Author: Michael Fellinger <m.fellinger@gmail.com>
-Date: Sat Apr 26 04:26:52 2008 +0900
-
- Spec for Module#autoload when the load path has already been required
-
- Signed-off-by: Wilson Bilkovich <wilson@supremetyrant.com>
-
-commit ee47a0cc0da787599479fc8dd085b7481b591176
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Fri Apr 25 15:41:19 2008 -0500
-
- Enabled another $_ spec and added a proc dispatch scoping test to $~ and $_
-
-commit eabc4609758dc99727c77493c58f187782ea957f
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Fri Apr 25 15:32:03 2008 -0500
-
- Added some basic specs for $_: implicit assign, explicit assign, scoping
-
-commit 61194dec429a9f288791156639f058e45a4e72e9
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Fri Apr 25 14:49:53 2008 -0500
-
- Add some specs for $~ scoping and assignment.
-
-commit 4c5cec4f6e10864c68b140e71cc2559e7a7d636b
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 24 18:28:08 2008 -0700
-
- Added incomplete tags for CSV spec stubs.
-
-commit 6e231caef62e678413e86317881aaab200d0802e
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 24 18:15:06 2008 -0700
-
- Reprocessed library CSV specs with new mkspec.
-
-commit 4cdc61a76cce73b52f05f53f820838cc7e3c2823
-Author: Michael Fellinger <m.fellinger@gmail.com>
-Date: Fri Apr 25 08:46:32 2008 +0900
-
- Updating specs for the module #included calling #extend issue.
-
- Signed-off-by: Brian Ford <bford@engineyard.com>
-
-commit 40e775bf036aa59e69268708f8c78b8a56e0f9ce
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 24 17:10:55 2008 -0700
-
- Moved #bignum_value helper to MSpec.
-
-commit 9b52edbb14ff2fc18faa429daf4ceaff5b87db11
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 24 14:37:53 2008 -0400
-
- Implement BigDecimal#fix, make #frac trap for a few common cases without running out of memory for big numbers.
-
- * Update spec tags.
-
-commit 6a604c0a9863073cfd7540ff755e7ca035a7dff5
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Thu Apr 24 19:32:14 2008 +0200
-
- Don't run Process.setpriority spec on FreeBSD
-
-commit 0ab639af500d947c5b5feb1d8f00f5fbc97a0edc
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 13:37:23 2008 +0200
-
- Adjusted IO specs to supply blocks for each-like methods.
-
- See [ruby-core:16557] for more details.
-
-commit a7b603a9ce6bfb570785e803bdb89ae36bb6253d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 13:14:40 2008 +0200
-
- Fixed IO, Process, Regexp specs ('should' was missing).
-
-commit 26de6c05c050d0dbcb073c407abda47f964bfd29
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:50:46 2008 +0200
-
- Fixed File specs ('should' is misspelled)
-
-commit 99a2b23d8fb42cb377cb3fb9ab2569c555aec8bf
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:47:57 2008 +0200
-
- Fixed Array specs ('should' was missing).
-
-commit 67b301a03fd6f7f0fa38ce106ab05825f2cbb15c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:43:39 2008 +0200
-
- Fixed specs ('should' was missing), some new test cases for BigDecimal.
-
-commit aecbea57de7ee1b50bd4b06871dd08e762a6ccb8
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:35:54 2008 +0200
-
- More test cases for BigDecimal#nan?
-
-commit 7aaf8fa137b8961ca122eb92e7447936ad7a44cc
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:26:20 2008 +0200
-
- More test cases for BigDecimal#zero?
-
-commit 58ecee694f191aa05e7867544cf8d63129558447
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:19:11 2008 +0200
-
- A bit more test cases for BigDecimas#-.
-
-commit e946dd03d590e29a1d344e7579d5ff047df4a76b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 24 12:17:16 2008 +0200
-
- New and updated specs for BigDecimal#-.
-
-commit 01d82db424b4e447b98e5f2eb3e162b991dece8a
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 24 01:25:20 2008 -0700
-
- Tag for new private setter method spec.
-
-commit c0ee2e133a4e5fc179b96329ffd3934dd9263c2b
-Merge: 374ab81... e9826b9...
-Author: Tony Arcieri <tony@medioh.com>
-Date: Thu Apr 24 02:19:00 2008 -0600
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 374ab81e2c01ea5ac48cda2004ae92a989d7f3d7
-Author: Tony Arcieri <tony@medioh.com>
-Date: Thu Apr 24 02:18:26 2008 -0600
-
- Specs for calling a private setter method on self
-
- * Not presently working under rbx, works under MRI
- * I don't entirely know the process for this, but this is expected to break
-
-commit 39505393f330b5f622788f1d98ea8ff3781499c7
-Author: Luis Lavena <luislavena@gmail.com>
-Date: Thu Apr 24 04:04:32 2008 -0300
-
- Fixes Dir fixtures and specs for Windows.
-
- Usage of special characters *, ?, | and : is not allowed under Windows
- * and ? represent wildcards, | is pipe tunelling and : is drive letter
- separator.
-
- Files or Directories cannot contain slashes (\/), wildcards, double-
- quotes, pipe tunelling or stream redirectors (<>).
-
-commit 2ecc076e488ed1a519fc5b6876c68a3d91d55c87
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 23 22:55:44 2008 -0700
-
- Update tags for newly passing File.join specs.
-
-commit ff3756e179920b84d5a55fc7bbc2688706df044f
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Apr 24 01:09:17 2008 -0400
-
- Add specs for nested method definitions and other complex scenarios
-
-commit 24785f7c28cde09ce0400e5d80f832ae11cddefa
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Apr 23 20:56:55 2008 -0400
-
- Spec for using ||= to initialize a class variable
-
-commit 98b0c44057cb827107cae0f0174b5e81ac2064fd
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Apr 23 19:49:21 2008 -0400
-
- Rewrite descriptions of language/def specs
-
-commit 598c287cc36179644a1bbf2a303a56fc85bb1b12
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 23 12:39:04 2008 -0700
-
- Replaced use of :mswin with :windows in platform_is[_not] guards.
-
-commit 01fe417f27ad43495327a522ece2f02769064df7
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 23 21:30:34 2008 +0200
-
- Added excludes for BigDecimal#div specs.
-
-commit 46f022d49c394b027491295e7fd5cb305af33404
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 23 21:27:42 2008 +0200
-
- More specs for BigDecimal#div
-
-commit 72433091c6a845c5f550b27111748e29fb5eac09
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 23 10:56:57 2008 -0700
-
- Added #tmp helper to MSpec for returning a temp file name.
-
-commit f4e975e5255fb36bb8e9be7d310850135ce3515f
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 23 10:54:42 2008 -0400
-
- Implement BigDecimal#frac, update spec tags.
-
-commit b60deba2368a1212d6acd3e49481ba9495de7f2f
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 23 10:49:39 2008 -0400
-
- Correct a spec error.
-
-commit e19cf9401c029f90e117b1c17083c928b0d1c9ca
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 23 10:24:50 2008 -0400
-
- Implement BigDecimal#-@, update spec tags.
-
-commit c3fc05389c75aca3150038814b324266501fdb8f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 23 16:12:24 2008 +0200
-
- A bit more test cases for BigDecimal#sqrt.
-
-commit b2a220f86887bfe6030a34bc8cd1b748c88cc2b8
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Wed Apr 23 01:43:16 2008 -0400
-
- Get BigDecimal#to_s working according to spec.
-
- * Implement #to_s.
- * Update spec tags.
-
-commit 82638601be12e410413047779f01840d6d0db3d8
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Apr 23 09:56:48 2008 +1000
-
- Refactor Debugger to remove dependencies on Debugger::Interface
-
- Also:
- - Add List#inspect to show number of items in list
- - Fix decode output to show original instructions in place of
- yield_debugger
- - Improve regex used to match method names to handle more
- operators
-
-commit 41c64f2825d347fbe2ef9edc33dd8f1e84773251
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Apr 22 18:12:06 2008 -0400
-
- Spec and implementation for NilClass#dup
-
-commit d3e313ed38a847e29225ba814a956d0929ea6460
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Apr 22 22:03:47 2008 +0200
-
- New and updated specs for Bigdecimal's #abs and #sqrt.
-
-commit 2013e106181879b886f2e1cb78e81f52cd284666
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Apr 22 15:52:10 2008 -0400
-
- Re-implement Module#autoload and autoload?. Now passing all autoload specs.
-
-commit 9156271e2b12138e2b2b712a76f0110f20a757b7
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Apr 22 15:34:43 2008 -0400
-
- Add (failing) spec for toplevel autoloaded constant access
-
-commit 8eb5451f88a37dc247e42913c1d72d072a9b02ef
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Apr 22 19:06:00 2008 +0200
-
- One more test case, for BigDecimal#sqrt with nil.
-
-commit e7894fb78cf92b53e9bdc6dcf023d8dd2d66b2ed
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Apr 22 18:52:24 2008 +0200
-
- More detailed specs for BigDecimal#sqrt and fixes for old ones.
-
-commit 527a4b663c487cd9222ee2e6917e330ff9a130a1
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Apr 22 12:38:53 2008 -0400
-
- Rename ambiguously-worded autoload spec
-
-commit 3e6f16c41569dbba291bc3cececf137fc8952ee2
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 12:31:17 2008 -0400
-
- Change to a significand-and-exponent implementation.
-
- * Update spec tags.
-
-commit f1b2bf51042ca563ca74a9cf83db0e46a1bfabce
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 09:54:53 2008 -0400
-
- Fix BigDecimal#zero, update spec tags. Also make #precs deal correctly with lowercase exponents.
-
-commit d0171de114e777f07a3e62972663475dd7747b05
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 09:24:06 2008 -0400
-
- Implement BigDecimal#precs.
-
- * Get #precs working. This will be less tortured once I implement a significand-and-exponent format.
- * Update spec tags.
-
-commit e1fc7c6dc4c02c1763947c34d05f894661a84525
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 01:30:10 2008 -0400
-
- Continue implementing bits of #inspect and updating spec tags.
-
-commit e4371f120c9c5c3c88a26d5f24f0d3ab888c954f
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 01:24:14 2008 -0400
-
- Implement BigDecimal#==/eql? and the beginnings of #inspect.
-
- * Find a way of implementing the equality test that satisfies the specs.
- * Don't be so baroque in parsing strings in constructor.
- * Update spec tags.
- * Fix regression in abs_spec.
- * Start implementing #inspect. Not really ready for prime time yet.
-
-commit 0494c1c35582381345194c76f7384eb9044797fc
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Tue Apr 22 00:41:03 2008 -0400
-
- Start implementing BigDecimal#sign and #zero?.
-
- * Clean up specs for #sign.
- * Write some initial code to get these working. Not all there yet.
-
-commit 3c071b5f921898d87437803a500535b639d465ef
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 21 23:43:10 2008 -0400
-
- Get BigDecimal#abs working.
-
- * Implement the function.
- * Improve the spec.
-
-commit 054582f3b89d757f033cd5f09cbf90fa08ad81d6
-Author: MenTaLguY <mental@rydia.net>
-Date: Mon Apr 21 22:32:42 2008 -0400
-
- fix linked actors spec (sort of)
-
-commit d7a7d0c4d0d83d7e69216c96a249c4091fe75323
-Author: MenTaLguY <mental@rydia.net>
-Date: Mon Apr 21 22:28:29 2008 -0400
-
- fix up registration spec
-
-commit 645784c3d39f776f583874e7c9244ff3de64cfe7
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 21 19:56:51 2008 -0400
-
- Update tags on failing specs.
-
-commit 960faf5382d90db376ff14bb836463f1860a4b62
-Merge: 2e2150f... 046ba62...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 21 18:46:45 2008 -0400
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 046ba622836321f487f241c145a3bdf0968f0a67
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Apr 21 18:44:50 2008 -0400
-
- Specs for failing Module#autoload case (replicates a scenario from Merb)
-
-commit 18a2a26fa511d4943a724e27ce09e5855a257e90
-Merge: 1f5f4b5... 991c6e6...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Mon Apr 21 14:15:07 2008 -0400
-
- Merge branch 'master' of git://git.rubini.us/code
-
- Conflicts:
-
- lib/bigdecimal.rb
- spec/ruby/1.8/library/matrix/diagonal_spec.rb
- spec/ruby/1.8/library/matrix/element_reference_spec.rb
- spec/ruby/1.8/library/matrix/shared/identity.rb
- spec/ruby/1.8/library/matrix/shared/transpose.rb
-
-commit edd397c82a924e406eabbcd7e84243d94f8e8067
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sun Apr 20 18:11:23 2008 -0500
-
- Adds MinGW to the IO#popen spec guard
-
-commit 10df9f89189637b2c5a54b01a88eca6c9fbb4601
-Author: Adam Wiggins <adam@heroku.com>
-Date: Sun Apr 20 14:53:41 2008 -0700
-
- IO.popen specs for reading and writing to pipes
-
-commit 3f70eceb3b9415a14f602c5b96121a459dca1e67
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Apr 19 22:32:28 2008 -0700
-
- Fix silly typo in Numeric#quo specs.
-
-commit 6101a4992ddc15c0140f4d7702cf88d2d3a2ac53
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Apr 19 22:23:14 2008 -0700
-
- Guard affected specs with conflicts_with :Rational.
-
-commit 354445f4d20ec66f207d65d1ccceb681bba7fff0
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sat Apr 19 14:23:14 2008 -0500
-
- Clarifying some of the Matrix specs
-
- * Fixes two errors introduced by 28700c5cf7
-
-commit 2f5ca541fc08f0c033bc6541c72962228ea607de
-Author: Eero Saynatkari <projects@kittensoft.org>
-Date: Sat Apr 19 15:07:49 2008 -0400
-
- Compiler specs' TestGenerator relies on broken #=== semantics, comply.
-
-commit 37cc9d4d6eb3442814ecc51845f025f464da64f7
-Author: Eero Saynatkari <projects@kittensoft.org>
-Date: Sat Apr 19 15:05:30 2008 -0400
-
- Specs for default #=== and its relationship with #== and #equal?
-
- * Rubinius deviates to not check object id directly.
-
-commit 28700c5cf7630be59877122e6470c42622b7365a
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sat Apr 19 13:53:33 2008 -0500
-
- Additional specs for Matrix
-
- * Some of the constructors in Matrix keep referencing the original arguments after creation, these specs cover those cases.
-
-commit 12b0bc93e5a6b328ad0968c03c47af71f671aae2
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sat Apr 19 13:06:04 2008 -0500
-
- Replace object_id for equal? in Matrix specs
-
-commit ae377f0e56b8f31356935b3ac0800f561b2d1b2c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Apr 19 14:49:34 2008 +0200
-
- Fix File::Stat#uid specs
-
-commit 2e01a86a3977fe87f4f0734e50598b41f66f29d7
-Author: MenTaLguY <mental@rydia.net>
-Date: Sat Apr 19 03:24:32 2008 -0400
-
- Gutted and reworked Actor, following Erlang more closely.
-
-commit de40303e17e2de1e7980564b43ee162c5080afa6
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sat Apr 19 01:05:43 2008 -0500
-
- Fixes Matrix#clone specs for MRI
-
- * Makes sure the values (not the references) of the original rows are copied.
-
-commit 2b3a44158ae93ab5883da22e5f36df92485f3ad4
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Fri Apr 18 22:47:15 2008 -0500
-
- Fixes a few things inside the Matrix specs.
-
- * Removes some of the "needs to be reviewed for completeness" messages.
- * Changes some of the descriptions
-
-commit 3be265a93a75b6a0267b1770f8cad671c4244671
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:26:29 2008 -0400
-
- Matrix.unit, one more alias for .identity.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 57aa8ba9a1dbdf62e9cf644bbde4603b841ffc76
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:25:55 2008 -0400
-
- Name spec correctly.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 3390dc4c6725d996eeb0c2e4ec73949bc0be2290
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:23:54 2008 -0400
-
- Specs for Matrix.scalar and .identity/I.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 958ca1faa1dc60ce591b4b2f768f22ac7f6cb56f
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:22:09 2008 -0400
-
- Move the "needs to be reviewed" indicator to the right place.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit bf3eab630654eaaca9256850d258343e3024989e
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:03:45 2008 -0400
-
- Use size functions instead of constants.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 3981c931e7f4fde730d51614d40e44b9209347f9
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 11:58:22 2008 -0400
-
- Specs for Matrix#clone and #transpose (alias #t).
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 72e1ea8900a638c796de9e715c5dffcf4ac90546
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:27:06 2008 -0400
-
- Basic specs for Matrix.zero.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit f5d294ad941c477060e9b5d2329790db7e1e5700
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:20:27 2008 -0400
-
- Move before block to a clearer place.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit b6bc5b224ade56ab96f3585b6b1c25e6dd5e1ad5
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:19:27 2008 -0400
-
- Write specs for Matrix.diagonal.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit b4d056baa33a2181ab64c065ad1eb4adebcfaddf
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:11:11 2008 -0400
-
- Some initial specs for Matrix#[] and Matrix.[].
-
- These are in the same file because of coding conventions, but they probably should not be since .[] is a constructor and has very little in common conceptually with #[], which is a subscript operator.
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 5476d836577c0fbdbda097762862cf153ffb5e07
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Apr 18 18:35:34 2008 -0700
-
- Some method profiles of data provided by John Lam.
-
- Run these as follows:
-
- bin/mspec -w rails.yaml spec/ruby
-
- We'll be adding our own trace script, but for now, these
- are snapshots of methods used by Rails loading a simple
- "hello world" controller. The rails.yaml file is core
- methods. The core.yaml file is generated by NameMap from
- mspec/bin/name_map.rb.
-
-commit 24c71675cc63c86832ef8bc55d2f0167dff53073
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 17:24:08 2008 -0400
-
- First stab at BigDecimal.
-
- * A skeleton of a somewhat naïve implementation of BigDecimal.
- * Updated spec tags.
-
-commit 1f5f4b59400b8b11df83b274efc8ce98186220ef
-Merge: 9d21b0e... 968a0ec...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 17:28:02 2008 -0400
-
- Merge branch 'bigdecimal'
-
-commit 9d21b0e890a9394658689af2bdee7e449cd2200b
-Merge: c3f3507... 1a08506...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 17:25:09 2008 -0400
-
- Merge branch 'master' of git://git.rubini.us/code
-
-commit 968a0ecda8477b33ceab2e7d0c7e7d084a105bdb
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 17:24:08 2008 -0400
-
- First stab at BigDecimal.
-
- * A skeleton of a somewhat naïve implementation of BigDecimal.
- * Updated spec tags.
-
-commit 1f410d918a59b9b49e87a407cc8fba4bbf342a79
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Apr 18 22:34:53 2008 +0200
-
- Fix a bunch of specs and minor issues in File::Stat
-
- Specs for File::Stat#<=>, File::Stat#ino, File::Stat#inspect,
- File::Stat#mode, File#Stat.initialize and some minor bugfixes
- such as the fact that File::Stat needs to include Comparable
- (like MRI).
-
-commit d6f2c6995941762878f4b777a39b0c23ea654605
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Apr 17 22:30:36 2008 +0200
-
- Remove specs for non-existent File::Stat#initialize_copy
-
-commit c3f350716a35cb869b3ea0289c0e404d07b8819f
-Merge: 810afff... b861102...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 16:18:34 2008 -0400
-
- Merge branch 'master' of git://git.rubini.us/code
-
-commit 72101783ec6e66a4f9ac3f9c90f7e8f5b67058ec
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 17:05:26 2008 -0700
-
- Reworked masgn specs to evaluate L2R and assign L2R. excluded.
-
-commit 4e4bec628b21938617bdfa5a2ef17aedf02c112c
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 15:17:00 2008 -0700
-
- trailing whitespace is killing me... evan\! fix your editor\!
-
-commit 810afffa2e549048947c07b30d77be255db42d73
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:26:29 2008 -0400
-
- Matrix.unit, one more alias for .identity.
-
-commit 2c84f77535d677a42bee93759c77f79c2cdd4d93
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:25:55 2008 -0400
-
- Name spec correctly.
-
-commit 762f5ee0f7ba4234847c695c92e3ed27dd05e134
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:23:54 2008 -0400
-
- Specs for Matrix.scalar and .identity/I.
-
-commit b68295e0046a2eb1fb911ea891d6e0a29174ea30
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:22:09 2008 -0400
-
- Move the "needs to be reviewed" indicator to the right place.
-
-commit 4b6e1097feafe2247e59d6004a36bb0987734138
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 12:03:45 2008 -0400
-
- Use size functions instead of constants.
-
-commit 2086f0c1f1f899f2e41307a5434a5bb6446e20a2
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 11:58:22 2008 -0400
-
- Specs for Matrix#clone and #transpose (alias #t).
-
-commit 2939c55b2e9f38b5115b98429de97bc4fff6f165
-Merge: a47f2b8... 42d3212...
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 02:09:07 2008 -0400
-
- Merge branch 'master' of git://github.com/evanphx/rubinius
-
-commit a47f2b852ca309a68b687157a6cd973716328887
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:27:06 2008 -0400
-
- Basic specs for Matrix.zero.
-
-commit aa3b2eeef70cb8967ef6c92ee24a226c2d1202c1
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:20:27 2008 -0400
-
- Move before block to a clearer place.
-
-commit ca6ac1e59ddb268b388975a2fb5b11e6026e65c8
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:19:27 2008 -0400
-
- Write specs for Matrix.diagonal.
-
-commit b24216d8b0ecfba6888f909415e2523eaed2aeb2
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Fri Apr 18 01:11:11 2008 -0400
-
- Some initial specs for Matrix#[] and Matrix.[].
-
- These are in the same file because of coding conventions, but they probably should not be since .[] is a constructor and has very little in common conceptually with #[], which is a subscript operator.
-
-commit 9313f29ed952f604e0d124ced38ee930b5780b27
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 17 22:35:43 2008 -0400
-
- New spec tags for Complex#%.
-
-commit 08f316de96c94b7d4865d77873327deddeabb664
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 17 22:32:08 2008 -0400
-
- More specs for Complex.
-
- * Specs for <=>, conj/conjugate, to_s.
-
-commit 973c304cc16fa6b78dba31de11b151da2daae762
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 17 22:09:20 2008 -0400
-
- More specs for Complex
- * Complex#abs, abs2, angle, arg, and %. Not sure that % is correctly specified.
-
-commit e32b26694277065fe28f138dca837b8c0509c735
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 17 21:17:26 2008 -0400
-
- More specs for Complex.
-
- * Write specs for * and /.
- * Rewrite + and - to use alternate constructor syntax.
-
- Signed-off-by: Marnen Laibow-Koser <marnen@marnen.org>
-
-commit 0cbf88a6c61e477f4b9a7758a9fab1258efbf30f
-Author: Marnen Laibow-Koser <marnen@marnen.org>
-Date: Thu Apr 17 20:46:04 2008 -0400
-
- Write some specs for Complex.
-
- * Basic specs for Complex.new, Complex.new!, Complex#+, and Complex#-.
-
- Signed-off-by: Marnen Laibow-Koser <marnen@marnen.org>
-
-commit 71909e78b8d77f7e48d306e30f51fbc21b5fbefb
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 17 15:26:53 2008 -0700
-
- Reorganize and fix Matrix specs.
-
-commit 5a9325457696dfba3c410c0adcbdec706ecda3bf
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 17 12:49:45 2008 -0700
-
- Added spec templates and incomplete tags for CGI.
-
-commit d62de6b4096a9b3bd3fda197b70d6e603596e865
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 17 21:12:08 2008 +0200
-
- More detailed speecs for BigDecimal#new
-
-commit ebd6fb8f879f94ff51b74cb4e76080fad7b66cb5
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 17 19:55:31 2008 +0200
-
- More detailed specs for BigDecimal's <, <=, >, >=, <=>.
-
-commit 8caef40cbe873dc2825bc0ba1e66f983b8219cca
-Author: MenTaLguY <mental@rydia.net>
-Date: Thu Apr 17 01:16:25 2008 -0400
-
- add tag object argument to send_in_*
-
-commit 0596b1aca45a85de5f3d727632585da924fd3eb0
-Author: Matthias Reitinger <m.reitinger@mytum.de>
-Date: Sat Apr 12 10:11:13 2008 +0200
-
- New specs for BigDecimal.new.
-
- Signed-off-by: Marius Nuennerich <marius@nuenneri.ch>
-
-commit 5c176e50fe962de1095a75221b4d63e75acc505f
-Author: Benjamin Stiglitz <ben@tanjero.com>
-Date: Wed Apr 16 11:32:18 2008 -0700
-
- Cleaned up Numeric#div spec
-
- The spec names are no longer quite as atrocious; the spec output is now fairly
- readable. The different Integer-Float quotient permutations are now correctly
- specified as well.
-
- Signed-off-by: Brian Ford <bford@engineyard.com>
-
-commit e1406b19c51bfca5f6936d143087043316c68c13
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 15 20:07:48 2008 -0400
-
- Specs for Kernel#p behaviour.
-
- * Args vs. no args.
- * Record separator is not taken into account.
-
-commit 30c717e1736b65a852df501f71e320599fc17786
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Apr 15 21:32:13 2008 +0200
-
- Fix typo in File.grpowned? spec
-
-commit 1bc17a0b4c8f19b84ffdd0b17ec24243a1df6092
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Apr 15 21:31:02 2008 +0200
-
- Fix File.grpowned? and it's spec
-
-commit f49cf4d0319b5772ede7bcddd763c691d5253b18
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Apr 15 20:44:18 2008 +0200
-
- Update tags for implemented File.grpowned? specs
-
-commit ea19fb07cb7b789165aec5da0f571345b96f1f0f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Apr 15 20:41:02 2008 +0200
-
- Spec File::Stat#grpowned? and implement File.grpowned?
-
-commit c411b15b9f94fec21b02a9208cbae4b42452431d
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Apr 15 20:19:24 2008 +0200
-
- Properly rename File::Stat#dev_major and File::Stat#dev_minor specs
-
-commit 26ba3ad30cd726b058cd76f23dc7a79555be724e
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Tue Apr 15 10:25:44 2008 -0700
-
- Quarantine the cvar-related instance_eval spec for now; it's not clean.
-
-commit d72c609ce4567d7a7fdfd2ee4713ac07033c81db
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Mon Apr 14 20:13:38 2008 +0200
-
- Use EnvSpecs where possible
-
-commit 8ccdf2d612f15515837095e2e4a570861024294c
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Mon Apr 14 17:42:36 2008 +0200
-
- Use EnvSpecs module for platform dependent stuff
-
-commit 130e4bdb1d9fa9512dfe45d4ff4d718096683cdb
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Apr 14 19:45:24 2008 +0200
-
- Fix specs for a bunch of File::Stat methods and implement File::Stat#<=>
-
- Created specs for atime, blksize, blocks, ctime, mtime and <=>
-
-commit e5aa89ff13128afb9b43ad77678792aeae4d48ea
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Apr 12 17:54:57 2008 +0200
-
- Remove tag for fixed File#lstat
-
-commit 21cd4a10833ef3bdda1593423faccb334de16536
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Apr 12 17:52:33 2008 +0200
-
- Remove unneccary spec placeholders for File#stat / File#lstat
-
- The shared spec already tests this behavior. With the new added spec
- for the difference between the two, File.stat / File.lstat is pretty
- well covered for now.
-
-commit eacb4f8a4d0ba606458a5756ddd6f2ce723a3dfa
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Apr 12 17:45:55 2008 +0200
-
- Specced different behavior between File.stat and File.lstat
-
-commit 4ae163810074effc068babf538f004e9ff117156
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Apr 14 16:49:04 2008 +1000
-
- Refactor Debugger interface into a CmdLineInterface class
-
-commit e61241498f6ca63b7d5e50e94a70456bc40e929b
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Apr 14 14:17:03 2008 +1000
-
- Breakpoint clean-up
-
-commit ae738f21979edf727437438b992629dd0b59a42e
-Author: MenTaLguY <mental@rydia.net>
-Date: Sun Apr 13 16:14:34 2008 -0400
-
- elminate Mailbox#clear; difficult to implement with sane semanitics
-
-commit 76385484049e47f53b840ddf3c0dfe9e365ca8cf
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Sat Apr 12 16:39:19 2008 -0500
-
- More specs for REXML::Element
-
-commit 00547bc562c359ddac13d04a5c955ee25171bcb4
-Author: Matthias Reitinger <m.reitinger@mytum.de>
-Date: Sat Apr 12 11:15:12 2008 +0200
-
- Fixed incorrect check for object equality in BigDecimal#nonzero? spec
-
- One should not use == to check if the method returns self, but equal?
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit e8403792167c86f120ce7bdcd1e2c7ce1bc31fea
-Author: Matthias Reitinger <m.reitinger@mytum.de>
-Date: Sat Apr 12 11:31:25 2008 +0200
-
- Eliminated use of to_s to check for NaN in BigDecimal specs
-
- Changed "to_s.should == 'NaN'" to "nan?.should == true"
-
- Signed-off-by: Federico Builes <federico.builes@gmail.com>
-
-commit 5883dd78ad92031c920bb9ee2b703702969a5854
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Sat Apr 12 09:42:11 2008 -0500
-
- A few more instance_eval specs, for non-immediate numerics and cvars.
-
-commit e8fd8e696d5487fa698a9a8b1bab2fb54b420133
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Sat Apr 12 08:28:41 2008 -0500
-
- Added instance_eval spec for defining methods under immediates.
-
-commit c23b365a95862cd438e6228929a3a4e935d60de9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 22:09:06 2008 +0200
-
- New rubypsecs for BigDecimal#fix and #frac.
-
-commit 6b6b63ebedb61466b4f04f510bf859574efec7d9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 20:07:07 2008 +0200
-
- New rubyspecs for Bigdecimal#floor and #ceil.
-
-commit 75e9118aea32baaeec82efedb5106c63bb0eef44
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 17:50:36 2008 +0200
-
- Corrected Bigdecimal specs since they were missing "should" statements. :)
-
- Also, added some more cases.
-
-commit 18fafb2e1f653887fdd3cdef693448d9b2bea29e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 17:21:02 2008 +0200
-
- New rubyspecs for BigDecimal's #power, #** and #exponent.
-
-commit 35e32daa38c7df385aac99f7b709a4038141faaa
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 13:41:13 2008 +0200
-
- New and updated rubyspecs for BigDecimal#precs.
-
-commit e0172d4eee7a775ab53562477997855ed66615a7
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 12:31:22 2008 +0200
-
- More rubyspecs for BigDecimal#split and some corrections for older ones.
-
-commit 37d312770700da5eb124fdce7a7b1687c2d9b839
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Apr 11 13:55:00 2008 +1000
-
- Get breakpoint handling working properly
-
-commit 498b95a720e98b70b56af9dfd2c1ba20c0bf89c3
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Apr 9 17:23:56 2008 +1000
-
- Make ISeq#decode return symbols rather than objects by default
-
-commit b8bda0546cdb9ac04ae629f13ccfce5f474e6f2c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Mar 17 14:33:45 2008 +1100
-
- Ensure breakpoint original instruction is correct
-
- When multiple breakpoints are set at the same location,
- only the first breakpoint sees the original instruction.
- This commit ensures the BreakpointTracker detects such
- situations, and updates the breakpoint to set the correct
- oringinal instruction to use.
-
-commit 2700924f23e0283a059583f9e92188b1c3c4f220
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Mar 13 17:20:49 2008 +1100
-
- Reorganize Breakpoint class hierarchy
-
- Refactor Breakpoint class hierarchy in preparation for
- adding PersistentBreakpoint and BreakpointRestorer classes.
-
-commit bfa69d930c38897df18b656d7b86f0b549bed57f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 03:01:37 2008 +0200
-
- Some more test cases for BigDecimas#finite? and #nonzero?.
-
-commit 71a4b0a51ea4da0c41d7b096aa7b88deb8d0d049
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 02:42:33 2008 +0200
-
- A bit more rubyspecs for BigDecimal#sub and #to_s.
-
-commit 8ff9ae455c6c7f4b38f3b4dcbdc6c677759f13e2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Apr 11 01:35:16 2008 +0200
-
- New rubyspecs for BigDecimal#truncate.
-
-commit f0a5c13f218d1e2187dfff09bd27cbd6dde544ca
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 15:09:55 2008 -0700
-
- Converted VMActor specs to dir/files. Added incomplete tags.
-
-commit df74b0fd98597b51d4c1d51ae09706d51e1a5d3c
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 15:01:08 2008 -0700
-
- Converted Mailbox specs to dir/files. Added incomplete tags.
-
-commit 29d223d8bfcc36edc16db58d50f8186905df773a
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 14:49:52 2008 -0700
-
- Converted Actor specs to dir/files. Added incomplete tags.
-
-commit 08ab8db440cfdaa7e06b19a0d88750678d4fccbf
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 10 22:09:39 2008 +0200
-
- New rubyspecs for bigdecimal, and excludes.
-
-commit b76a9e964899348d667181d288c5d4ec0e422c9f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 10 19:33:03 2008 +0200
-
- One rubyspec for the class definition: def nil:Foo; end
-
-commit c526f5744ece40e312340556991ee54e4504ebcd
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 00:53:06 2008 -0700
-
- Processed Rational, Complex, Matrix with mkspec.
-
-commit 3de6f530c42bdca8c9b1202e60d0d14850024d15
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 00:27:40 2008 -0700
-
- Processed IO with mkspec. Added incomplete tags.
-
-commit faaf8bdb8893f71234d7e2fab07aa11d6c556384
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 00:17:35 2008 -0700
-
- Clean up especially bad whitespace in File specs.
-
-commit fedda8f6865c6cdb07c7599606204f0700042574
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 10 00:09:56 2008 -0700
-
- Processed File specs with mkspec. Added incomplete tags.
-
-commit 09f6f1b5138b7ca1d276a8c68ee6bf1cba7691b7
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 9 23:42:40 2008 -0700
-
- Processed Kernel specs with mkspec. Added incomplete tags.
-
-commit e3ca2e3e077c0e026b96e1e68808b95d44233cf5
-Merge: cf0c855... 4d0d1f6...
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Thu Apr 10 02:48:31 2008 +0200
-
- Merge branch 'master' into bigdecimal_specs
-
-commit cf0c8552f31cfd856822c8aa43a5d9d265481ac0
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Thu Apr 10 02:40:22 2008 +0200
-
- Next bunch of specs for Bigdecimal.
-
-commit 4d0d1f6b98ac2dafa487ece31512443a07bbc928
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Wed Apr 9 23:42:10 2008 +0200
-
- Fix ENV specs
-
- * Try to avoid `env`
-
-commit dfcc69ea8bd78e9e463defdef3b4529a5af40bb5
-Merge: 75e6ccd... 6a50f0d...
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Wed Apr 9 22:26:26 2008 +0200
-
- Merge branch 'master' of git://git.rubini.us/code
-
-commit 75e6ccd48bce9e0e939a0ff1d484f14a029969f9
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Wed Apr 9 22:26:11 2008 +0200
-
- Fixes for ENV
-
- * Add specs
- * Add some missing methods to ENV
-
-commit 6a50f0d2f5146901fe96fe86802df155c9266a21
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Wed Apr 9 21:11:05 2008 +0200
-
- Fixed failures for BigDecimal#specs.
-
-commit 09bc62e39a8b92c25aeb6287f9fbf4e9cd2b9a6f
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Wed Apr 9 19:55:45 2008 +0200
-
- Bunch of specs for BigDecimal.
-
-commit c281add79d621f6327740109895c624dd25a2e1b
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Wed Apr 9 09:13:29 2008 -0500
-
- Cleaning up UPSocket#send specs
-
- * Got rid of the weird exception catching
- * DRY things up a bit with before :each
-
-commit 8ebefe3c0a61b7aab8ac3d0ae9768c35b657cdb6
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Wed Apr 9 09:11:43 2008 -0500
-
- Adding spec helpers to REXML specs
-
-commit e3064084efbbac1147d477435010d933ce101413
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 8 22:20:43 2008 -0400
-
- Amended spec wording for Singleton._load slightly. Updated exclude.
-
-commit 23e621625b95e0db82bd406a5eb8fa7324e41a6e
-Author: Chris Shea <chris@tie-rack.org>
-Date: Tue Apr 8 15:49:11 2008 -0600
-
- Create spec for Marshal.load of Singleton instance
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit eec07baa07d591059c64f32c0ddef169cfcccaef
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 8 20:20:02 2008 -0500
-
- Thread#wakeup deadlock for MRI marked as ruby_bug
-
-commit dbb744d9692c2432d7aebecac17365125efe9087
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 8 20:02:08 2008 -0500
-
- spec for wakeup which causes MRI to deadlock when it shouldn't
-
-commit 208a7df6ec2d3c8f550a7ac24db849e593cdc9f3
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 8 17:58:15 2008 -0500
-
- specs for Thread::list
-
-commit f6f307e75e49cdf597b0b3755ab214c6fc1950dd
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Wed Apr 9 00:54:34 2008 +0200
-
- specs for BigDecimal.new and BigDecimal#zero? (plus tag files).
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 5b1f2043f70b0088f1c32be79eeaa8179c2210a6
-Author: Jeff Rose <jeff@rosejn.net>
-Date: Wed Apr 9 00:44:27 2008 +0200
-
- Specs for Actor linking and registration, and Mailbox timeouts.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 4eea149d3d503c121fb7c65115e374838fff8c8a
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 14:55:18 2008 -0700
-
- Added extra Array subclass dup spec
-
-commit 783a884931b718b8fa65dd9768fbebd8a0d1ac0c
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 14:18:45 2008 -0700
-
- minor cleanup
-
-commit 0e047cc97aa6a5acd7193bdde1139f6a89f108b8
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 14:18:27 2008 -0700
-
- minor cleanup
-
-commit f4797827393e0d9d0e5df5aa5184ecebb066d766
-Author: Matthias Reitinger <m.reitinger@mytum.de>
-Date: Tue Apr 8 17:08:32 2008 +0200
-
- Extended Symbol#inspect spec and reworked Symbol#inspect to fulfill them
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit b3c3a5f60177f9c52725b6cacf019412d2c747ea
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 8 17:29:58 2008 -0400
-
- Excludes for BigDecimal specs.
-
-commit b7cd3c38d146a7833ef1d426ea8acd4ee4cb09bf
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 8 17:13:48 2008 -0400
-
- Switched #requires around to have access to #pretty_inspect.
-
-commit aba428095e09ead8ed66895b175e5f3673c4310e
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Tue Apr 8 17:45:13 2008 +0200
-
- Spec for BigDecimal#to_f.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 20a5789f9dc4e6d30dffb594476b354e4aeee201
-Author: Thomas Lachmann <thomas_lachmann@gmx.de>
-Date: Tue Apr 8 17:21:39 2008 +0200
-
- Spec for BigDecimal#finite?
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 896609e7ae8ee12c72e4e3ce86897c1f8b98f3fb
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 02:03:22 2008 -0700
-
- overlooked 2 specs
-
-commit 77774ed4300d5245c58dbcc686cd72dc48f08a1f
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Apr 8 02:00:24 2008 -0700
-
- Added a bunch of specs to String#to_f
-
-commit 1b91113c3e8fb46a0d355cae9000ee4c82f95ac3
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon Apr 7 21:46:17 2008 -0500
-
- More specs for REXML
-
-commit 2460839e3fbe2967b9df70db3de33b2a102b9a44
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Apr 7 12:19:40 2008 -0700
-
- Reworked how MSpec handles config files. Use 'set :sym, value' now.
-
-commit 67d3869e9b3fef6d47727206d02814da410e02fc
-Author: Jeff <rosejn@warp.(none)>
-Date: Mon Apr 7 15:04:09 2008 +0200
-
- Adding specs for Mailbox and Actor, and renaming the VMActor describe to match the standard scheme.
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit 7391c1fbc02966165de03724c42fc1d5243ac99f
-Author: Marius Nuennerich <marius@nuenneri.ch>
-Date: Sun Apr 6 22:29:22 2008 +0200
-
- repair UDPSocket spec
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 5a205207faad0a85271bfcb459390793702c4143
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Apr 5 04:54:21 2008 -0400
-
- Partially revert "Add spec files for cgi.rb."
-
- This partially reverts commit e2714f2fd2d8825ac8af761a5a4545e4d0731735.
-
- Conflicts, left these files:
-
- spec/ruby/1.8/library/cgi/escapeHTML_spec.rb
- spec/ruby/1.8/library/cgi/escape_spec.rb
- spec/ruby/1.8/library/cgi/rfc1123_date_spec.rb
- spec/ruby/1.8/library/cgi/unescapeHTML_spec.rb
- spec/ruby/1.8/library/cgi/unescape_spec.rb
-
-commit 22f3042377731cb6ff963b9e322b24014b286895
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Apr 5 03:18:15 2008 -0400
-
- Added excludes for the CGI specs.
-
-commit 7b9f5a213c971636b663e992fcb8578888d27f52
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Sat Apr 5 13:03:59 2008 +0900
-
- Add spec file for CGI::rfc1123_date().
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 31edbd64bba7f352930ac04d51b63e72553796a9
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Sat Apr 5 13:03:14 2008 +0900
-
- Add spec files for CGI::escapeHTML() and CGI::unescapeHTML().
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit fc321869d73f58dcfbb55ba374646c1568528004
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Sat Apr 5 13:01:33 2008 +0900
-
- Add spec files for CGI::escape() and CGI::unescape().
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit e2714f2fd2d8825ac8af761a5a4545e4d0731735
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Sat Apr 5 12:44:57 2008 +0900
-
- Add spec files for cgi.rb.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 2a1d0ad7e51ba52a918111d53be6a641c41a0445
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Apr 4 22:21:47 2008 -0400
-
- Improved the *rest argument count spec a bit.
-
-commit e8053e4bb108cf877ac8fdafc104eb34bad671f0
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Apr 4 20:38:23 2008 -0400
-
- Specs for unlimited argument count for *rest defns.
-
-commit 03e092e45015f8115f806e11460121c560e60b4b
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Fri Apr 4 17:54:25 2008 -0700
-
- Converted symbol spec to be generative, allowing easier pattern detection
-
-commit bbda617127a8ac319a58fa190d43b3a0d960d309
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Apr 4 14:07:50 2008 -0500
-
- updated File#inspect tags
-
-commit 38eb679d6b6c5aef8bccb2139e681c926b3290c7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Apr 4 06:00:37 2008 -0400
-
- Specs for ~/ expansion in #require, #load. It has broken at some point.
-
-commit 2d600c01205fbb7ccd98e7f7a88ebcbd0e1d1d43
-Author: Paul Thornthwaite <tokengeek@gmail.com>
-Date: Fri Apr 4 08:43:42 2008 +0100
-
- Updated specs for Set library
-
- * Added specs for Set#subset and Set#proper_subset
- * Added specs covering empty sets and comparisons
- * Corrected spec string to include ? on superset method names
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 3a547c2b82434c64b72967ebd917fc063ff1317d
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Apr 3 23:16:18 2008 -0700
-
- Fixed GetoptLong specs to not depend on value of ARGV.
-
-commit 5dd9b0ecdddfd990d6387a0a7c70173ea0cededa
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 2 23:27:04 2008 -0700
-
- Add config file for and rework MSpec runners.
-
-commit 773a13ed9005628e48ed146180041caa035f4072
-Author: David Yip <yipdw@member.fsf.org>
-Date: Thu Apr 3 03:18:48 2008 -0400
-
- Added spec: full contents of StringIO stream should be accessible after rewind.
-
- Spec tested against Ruby 1.8.6p111 and Ruby 1.8.6p114 on OS X 10.4.11.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit ba2ca41cb29ac08c94231a2383940464e6fd1c9d
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Thu Apr 3 08:45:49 2008 -0500
-
- Updated tags for REXML specs
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 09c080bf33092b9d147d1b0a5de920fce8527fdc
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Thu Apr 3 08:45:26 2008 -0500
-
- Fixes whitespace in REXML::Element specs
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 3a997bc18f589b91b4cd518448644171f3054abf
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Thu Apr 3 08:29:23 2008 -0500
-
- More specs for REXML::Element
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit d250939060a4a91a6fee59bd4bfa4e86eb271373
-Author: Paul Thornthwaite <tokengeek@gmail.com>
-Date: Thu Apr 3 14:36:42 2008 +0100
-
- Specs for Set#superset and Set#proper_superset added
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 01399738d5ad0136ef205b8501b12012c7e42230
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Apr 3 18:09:20 2008 -0400
-
- Removed excludes for Object#kind_of?, #is_a?.
-
-commit 0e7d1c6e02e5617bb251366e0d60760edb29377e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Apr 3 20:04:34 2008 +0200
-
- Fixed copy-paste error in Object#is_a? specs.
-
- Adjusted the Object#is_a? exclude.
-
-commit 4a9cb7cc0c734b4280c3a65906c85e1c1e2f4990
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Apr 3 19:02:05 2008 +0200
-
- Add specs for #kind_of? / #is_a? behaviour that are failing in Rubinius.
-
-commit e88fdb6cbd9fa829a81e6c7664e88f6956ddae64
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Apr 3 07:18:56 2008 -0400
-
- Spec to check `A = 12; class A; end` raises TypeError. Works as is.
-
-commit 3c0db09626333405bdcb72e62ddb8fb2ea176ff5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Apr 3 06:44:32 2008 -0400
-
- Spec for const lookup: `A = 12; class A::B; end` should raise TypeError.
-
- * Currently crashes due to a lookup problem.
- * VVSiz discovered and reported.
-
-commit edda5994c293e4d26b4a741e90e0ab61513e8dec
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Apr 2 16:39:09 2008 +1100
-
- Do not strip leading spaces in debugger output
-
-commit eecc2bca5045921368378abfccafcf70339441f9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 2 21:34:52 2008 +0200
-
- Enabled File#truncate testcase for JRuby.
-
-commit 4d555cf50dfe6a8e9cb2f24a6a636a9df3f03768
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Apr 2 20:03:02 2008 +0200
-
- Added test case to File.open rubyspecs.
-
- Courtesy of David Yip.
-
-commit 42f0b52cd9fbac4a39fc1e5c2a241462bee5bf3b
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Apr 2 01:11:38 2008 -0700
-
- Use kind_of instruction since #kind_of? is not available at all times.
-
-commit 9ee52514eee820b9af7c9e6d2eaaca8d2bca363b
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 1 17:16:47 2008 -0500
-
- IO#reopen should return self
-
-commit f1481283091fcbe662fd01d409f5a2d2d7e3aa59
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 1 18:57:06 2008 -0500
-
- added primitive io_close_ng and tagged IO#close spec failures
-
-commit 3861e75e01af9319e2af879e2644fc8509947903
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 1 16:07:27 2008 -0500
-
- IO#close should return nil and refactored TCPServer.accept specs
-
-commit d6dfbd3b0bab57453e67991c3320744b08346979
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Apr 1 15:04:18 2008 -0500
-
- DRb specs now attempt to check if server is up/down prior to each call to start_server
-
- note that there is something wrong with the way stop_server works in rubinius as it appears that the TCPServer is still binding the port. Spec is tagged to deal with this but technically it's probably a bug in TCPServer
-
-commit 4119fe8baab45be6b1d1370b8a9537e710b1a60a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 1 12:40:47 2008 -0400
-
- Sanity changes to #load specs to bring them up to date.
-
- * Please change the specs if you change the implementation, sheesh.
-
-commit 3b58cb35abeba31f7ac72e3ab37b2630949406a7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 1 10:59:58 2008 -0400
-
- Spec for forced recompiling through second parameter of Kernel#load.
-
-commit 5d7a73ae15a4c40e31486a60cbb66f3de1ac4697
-Author: David Whittington <djwhitt@gmail.com>
-Date: Wed Apr 2 02:57:35 2008 +0000
-
- Add tags for failing private keyword specs
-
-commit 1b2f118be7ff9b6adfea736ecbbb8f3fd8dd0f49
-Author: David Whittington <djwhitt@gmail.com>
-Date: Wed Apr 2 02:53:43 2008 +0000
-
- Added a couple evil private keyword tests
-
-commit f58c67e33a99f751c3520ab65c96e28a91c45900
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 1 09:59:22 2008 -0400
-
- Conditional compilation. Rubinius.compile_if($DEBUG) { p somevariable }.
-
- * Hacky and probably fragile but it seems to work. Whenever the gvar
- given as condition evaluates to false, the entire block is omitted
- from the produced bytecode. If it evaluates to true, then the extra
- block itself is stripped and only the block contents remain.
- * Do NOT use indiscriminately until we have played around with it for
- a bit to avoid problems.
- * Manipulates the sexp, not the AST to avoid worrying about locals
- and scopes and whatnot.
- * Enabled by default; for example -d will work out of the box (you
- do need to have the file recompiled obviously.)
-
-commit 4f78ee2b0bebb9170a483927af9c7520ca67f912
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Apr 1 09:58:53 2008 -0400
-
- Specs to verify conditional compilation in the compiler.
-
-commit 8dfece35e3bc83e14e92bfee9ea0ebabb795da70
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Apr 1 01:07:14 2008 -0700
-
- Fix up language symbol specs.
-
-commit 29cc22f2c1f7ce2ce15a7f339d1159cf93510daa
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Apr 1 00:40:34 2008 -0700
-
- Constant lookup only searches class or module (#457).
-
-commit 538611f2aa06a1cf1c3958583bd6a8487deee994
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Mar 31 18:03:41 2008 -0400
-
- Spec for empty loop body.
-
-commit fd0d1079671d7664de3a6a836c5e5624d487a4e1
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Mar 31 23:47:40 2008 +0200
-
- Spec for constant lookup on non Module or Class objects
-
- This exposes the bug also described in ticket \#457
-
-commit 3b7cf550c70db2dd53cb58ef3efd2651ee352134
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 31 21:53:40 2008 +0200
-
- Added a couple of Dir.glob/Dir[] rubyspecs.
- (Courtesy of Roland Swingler)
-
-commit bbfa77a8517390bdc807f41bfe6d101791980d8f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 31 19:04:09 2008 +0200
-
- Fixed DRb rubyspecs (proper spec name, removed invalid file, better cleanup).
-
-commit d8a4fb0b16dc4c722cf148ff83bcad05fbb4af1e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 31 14:29:54 2008 +0200
-
- Make sure Marshall#load rubyspec closes the file.
-
-commit 4082a7663eaef50000be46d909c22fbb97a1a3e8
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 31 13:57:35 2008 +0200
-
- Reverted new Range#step rubyspecs, since they fail on MRI and JRuby.
-
- Partial revert "Fixes for Range#step."
- This (PARTIALLY) reverts commit a6b06a67207c40ffa9ccf191c051fdf2fa0f5359.
-
- The specs are reverted since they fail on:
- MRI 1.8.6 pl 36 (Ubuntu default)
- MRI 1.8.6 pl 114 (Current compatibility target)
- MRI 1.8.6 from 1_8 branch
- MRI 1.9 from Ruby trunk
- JRuby 1.1 from trunk
-
- The specs expect that to_f is invoked, but MRI and JRuby don't behave
- that way. Furthermore, Float is not a special case. There are other
- cases, like Rational. Take a look into MRI code, there is no special
- handling for Float.
-
- Please, test your spec updates at least against the current
- compatibility target (MRI 1.8.6 patchlevel 114) to avoid problems.
-
-commit 6d9680ecaaa2a9aadd35699c8064bf6481acc107
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 31 13:23:20 2008 +0200
-
- Added new rubyspecs for IndexError out of String#[]=
-
-commit c8a52bb7cf191bb35efc89c560bdeced4241f015
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Mar 31 04:38:49 2008 -0400
-
- Split Regexp#=~, #match specs; they behave differently on match.
-
- * #=~ Returns index, #match returns MatchData.
- * Grammar fixes.
-
-commit 6c2727e928991cdf9f809cb5941c3afedb5171ff
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Mar 31 04:07:17 2008 -0400
-
- Fix Regexp#match, #=~ spec to actually be shared. Exposes #454.
-
-commit e258a2bccafffba57ab86d1c1a104839bda424da
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Mar 31 03:30:48 2008 -0400
-
- Spec to verify IO behaviour with an altered BufferSize from Le Huy.
-
- * Moved spec to spec/core/io/ and simply used the first one.
- * This problem seems to have been largely corrected.
-
-commit 7a39be8bea055464838ff24c70e170a91f8df68c
-Author: Ben Burkert <ben@benburkert.com>
-Date: Sat Mar 29 19:39:11 2008 -0500
-
- Added spec for Module#define_method
-
- Methods defined by define_method with a proc should have the
- same scope for local variables as the proc.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 12c639d90ff3d14f8010ca7c782612bd7c1777ab
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Mar 29 23:58:13 2008 -0400
-
- Tony Arcieri's specs for inter-VM Actors.
-
- * VMActor implements the Actor interface to work in Rubinius' Multi-VM
- context: VMActors can reside on any VM instance.
-
-commit a0d0884aa3c9e7a6fa949cbde1cdf2392bc4ff23
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Mar 29 15:59:42 2008 -0400
-
- Module#attach_foreign allows using a symbol to give the function name.
-
- * Specs for the same.
-
-commit a5f397f38d6c9eafcac163c2cf678d5c55a6b79b
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Mar 28 23:40:04 2008 -0400
-
- Specs for FFI in general and Module#attach_foreign in particular.
-
- * Very basic specs to verify that FFI in fact works correctly.
- * We need to define what the behaviour should be in the case of e.g. an
- incorrect function signature. Currently it may or may not cause SEGVs
- depending on the exact usage. Remainder specs are in but quarantined.
-
-commit 3dc5c635b56bc599a718a94f990976b67ab52b6c
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Mar 26 02:01:12 2008 -0400
-
- Specs for Module#attach_foreign.
-
- * The method is a replacement for #attach_function but allows
- giving the library name as well to access external libs.
- * This acts a higher-level interface to FFI.create_function. The
- "real" FFI specs will be written for that method instead.
-
-commit 677412353409ba4e5d67f19a3d095c62d009c88f
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 28 18:04:40 2008 -0700
-
- Added CType#isctrl, #toprint. Rework String#inspect, #dump.
-
-commit 87ba991b9b488b808ebf729b9e41765df76cc602
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 28 15:09:11 2008 -0700
-
- Reworked String#each and #sum. Added String#modified? and specs.
-
-commit 204d8ce1a792a61882e549953b5b878139ac9cda
-Author: Hongli Lai <hongli@plan99.net>
-Date: Fri Mar 28 23:32:18 2008 +0100
-
- Spec: Marshal raises EOFError on loading an empty file
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit f6e698f96ce9e2a8c8abe856322add02931df8b7
-Author: Michael S. Klishin <michael@novemberain.com>
-Date: Sat Mar 29 02:20:23 2008 +0200
-
- Tag new spec for ensure as failing
-
-commit ef7e4436389a0f4346b3a3bc5c275b653f46d6bb
-Author: Hongli Lai <hongli@plan99.net>
-Date: Fri Mar 28 23:22:44 2008 +0100
-
- Add spec for exception handling inside ensure block.
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit f54c91f6cb7498fe44b1b05a1372d9f6ed3ea1ee
-Author: Stuart Halloway <stu@thinkrelevance.com>
-Date: Fri Mar 28 10:11:05 2008 -0400
-
- Fixes Pathname#absolute? and #relative?.
-
- * specs now pass
- * underlying cause was corner case in File#basename
- * new passing spec for corner case
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit 0d4606d53d8fc0bcb2370bd648546abffd402673
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Mar 28 16:45:47 2008 -0500
-
- fixed CSV::Reader.parse spec to use local fixtures
-
-commit 35a15c6c85ebb6eabaec16e03aa88399061844e9
-Author: Alister Lee <rubinius@dev.shortepic.com>
-Date: Sat Mar 8 18:11:24 2008 +1100
-
- Beginning of specs for CVS::Reader.parse
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit d4161a379eab621e338a8c82f088b834756082e9
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Mar 28 16:39:50 2008 -0500
-
- removed csv/reader/parse_spec to commit alister lee's spec
-
-commit 534806c10a95435873efcb0d215732d7da4f2fd6
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Mar 28 16:38:03 2008 -0500
-
- mkspec generated specs for csv.rb
-
-commit a6b06a67207c40ffa9ccf191c051fdf2fa0f5359
-Author: Stuart Halloway <stu@thinkrelevance.com>
-Date: Fri Mar 28 06:09:34 2008 -0400
-
- Fixes for Range#step.
-
- * previously failing specs pass
- * new spec added to cover float/int difference
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit 6886ec5851783c5364ff5bc464ee94071fc8535e
-Author: Michael S. Klishin <michael@novemberain.com>
-Date: Fri Mar 28 00:06:56 2008 +0200
-
- Update stdlib and specs for REXML from 1.8.6 patchlevel 114 (see details!)
-
- * Update stdlib/rexml to use REXML from Ruby 1.8.6 p114.
- * REXML in p114 is screwed up: call sites were not updated
- after REXML::Formatters::Transient#initialize arity
- change. Ruby 1.8.x branch in SVN though has
- completely different REXML layout and organization
- (rev. 15833) so there's no way to fix it until we know
- where REXML changes are headed in 1.8.x branch.
- * Update REXML spec and tags for it.
-
-commit 3145a74a85d72f6ef8a93384a74d96a589bfb5eb
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Mar 26 22:27:41 2008 -0700
-
- Rework and cleanup of various String methods.
-
- Also, ensure that when Strings are converted through FFI
- and passed to C functions, the char array is explicitly
- terminated with \0.
-
-commit 9ba3e515b49729e0cb80181af9e28e3ce4c70e97
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Mar 26 18:40:57 2008 -0700
-
- Shuffle some String methods. Add specs for and rework String#substring.
-
-commit 990d47b84bc6301be2a8bcbaccbae65ef697c417
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Mar 25 16:22:45 2008 -0700
-
- Added String#compare_substring. Reworked String#chop! and #chomp!.
-
- Also, to ensure that ByteArray instances that are accessible in
- Ruby are properly handled by C functions, changed string_equal_p
- to use strncmp instead of strcmp.
-
-commit f47c446daa136e6f31f5c590dd535ba22e89a0b2
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Mar 25 11:36:16 2008 -0700
-
- Fix errors in String#count_table spec descriptions.
-
-commit 9425d0de9a7883c14de6ae9ae5db05ab92141ab9
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Mar 26 22:38:48 2008 +0100
-
- Guarded two failing specs on OpenBSD that also fail on MRI
-
- MRI on OpenBSD also suffers from the 0.0 / -0.0 issue (the
- GCC version on that platform too). The child reaping spec
- also fails on both MRI and Rubinius
-
-commit 288a6e2ca3675a1e60bfd6b8b328c2a4d513c12f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Mar 26 22:15:16 2008 +0100
-
- Fix Socket specs for more strict BSD behavior
-
-commit 63513d23f16ca7919b8605e016a3a941b79c0834
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 25 17:20:53 2008 -0700
-
- oops! extra exclude
-
-commit a36a4bf8cde95c99282e07f46438430588288736
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 25 17:20:19 2008 -0700
-
- really minor changes
-
-commit e9b759812deaf97e7fe5846c116d53f69b63e244
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 25 17:19:41 2008 -0700
-
- Added the sucky parser spec--not passed yet
-
-commit 90eb74998e132373e6b96e3c66bfa909854e3ef0
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 18 17:41:50 2008 -0700
-
- Added spec for 'a [ 42 ]'
-
-commit 2d34643c75b53b832e89d2473d501ab1c8a5df02
-Author: David Whittington <djwhitt@gmail.com>
-Date: Wed Mar 26 08:01:20 2008 +0000
-
- Tagged Generator specs as unstable due to memory consumption
-
- Each spec consumes > 60MB of memory. After looking at the specs there is no way
- they should be consuming that much memory.
-
-commit 52d81e0593dbca8abfecefe2e9c3d2ab504cfe0b
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Mar 25 10:43:17 2008 -0700
-
- Added String#copy_from primitive. Reworked String justify methods.
-
-commit 1aabda50ea82974b96a7032a0ea13865b2332b5d
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Mar 24 21:57:02 2008 -0700
-
- Added Tuple.template and reworked String#tr and friends.
-
-commit bc7d9ccb8b8ca77d8479f325ea314fc09bc34907
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 21 00:51:10 2008 -0700
-
- Rework methods that behave like String#count.
-
-commit 1e5ac9a6818c972882e080aeb723a105108e0c57
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Mar 19 21:25:07 2008 -0700
-
- Rewrite of String#casecmp, approx 2x faster.
-
-commit c39f2cb708169d35c2fbeb969ee3323c704f0566
-Author: Matt Palmer <mpalmer@engineyard.com>
-Date: Tue Mar 25 21:09:37 2008 +1100
-
- Some specs for the timeout library
-
-commit cb69bdadeb10cf6b4b2c71a095562f8d8371d76d
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon Mar 24 17:55:23 2008 -0500
-
- Small fix for Socket.getaddrinfo spec
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit 5c3a61edef3c456b8296e65f8e06026347339a36
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon Mar 24 17:06:36 2008 -0500
-
- Fix for the socket's issue
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit f3fd9ac4eebd0bc2a0a06bbe06921463d03177eb
-Author: Federico Builes <federico.builes@gmail.com>
-Date: Mon Mar 24 14:10:46 2008 -0500
-
- Fixes specs for Socket and adds a gethostname spec
-
- * Changes hardcoded "localhost"s to Socket#gethostname calls.
- * Adds a simple spec for Socket#gethostname
-
- Signed-off-by: Michael S. Klishin <michael@novemberain.com>
-
-commit 7131328bc02057b16071a933fe98f331b27e00bb
-Author: Michael S. Klishin <michael@novemberain.com>
-Date: Tue Mar 25 00:24:01 2008 +0200
-
- Applied slightly modified patch by Federico Builes:
-
- * Add REXML::Document and REXML::Attribute specs
-
-commit cb464295e5accb00e783f7f9e2a0b10c64ad6579
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Mar 23 12:06:07 2008 +0100
-
- Added new Range#step rubyspecs.
-
- Excludes for rbx also updated.
-
-commit 7d181716ac3b92d8a31a20ec30daee455d36fc58
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Sat Mar 22 14:51:30 2008 -0500
-
- Added order-of-evaluation spec and tags for rubinius failures.
-
-commit 5caf94ce6deb5e28c9a3de02e60a9b86cbdaf7ec
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Mar 21 12:37:02 2008 -0500
-
- tagged new specs for pathname
-
-commit 62f88983ee3fa1b09d8f7df56e35cbfdac6d2a06
-Author: Martin Stannard <mstannard@gmail.com>
-Date: Fri Mar 21 12:10:23 2008 +1100
-
- added some specs for pathname library
-
- there are failures in absolute and relative specs
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit 655f61650bb299f38c9fd978594baa483fc0d0cc
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 18 16:22:24 2008 -0700
-
- Reduced parser todos from 113 to 89
-
-commit f97b2fc2ee3310e81871200125bbd7e33c2636bf
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Tue Mar 18 13:51:31 2008 -0700
-
- Moved sexp_expectations.rb to fixtures subdir
-
-commit 0a185e5ac48954cf4addae0c8f09dcb5be259f8e
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Mar 17 17:55:50 2008 -0700
-
- Added f'd up note about the spec failing
-
-commit 978f043e1ed3a2b7cb7d4129e0002be485b0a78c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 18 21:17:32 2008 +0100
-
- Fix Process.groups spec
-
- Process.groups can return an array with the same gid multiple
- times on certain platforms (at least on FreeBSD and OpenBSD).
-
-commit 8812658dde5e317dfebd0ea3c159ad0a1b98e8e8
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 18 21:02:00 2008 +0100
-
- Update spec tags for ERB
-
-commit 47216560d4a980cbaac2855e0c5ee302e0754bf8
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 18 20:53:16 2008 +0100
-
- Update spec tags for IO
-
-commit 7d34f4053023d99c3be4964bfebb3a1c74cd40c9
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 18 20:32:39 2008 +0100
-
- Update spec tags for File
-
-commit 8a66bc6f5e378f49febb80fba37723a7de0d2475
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Mar 17 15:46:51 2008 -0700
-
- Added specs for File.[l]chown/#chown, code for File.lchown.
-
-commit 960872ae163a5615f513c58d727a7fd93664673e
-Author: Glenn Davy <glenn@thor.local>
-Date: Mon Mar 10 10:00:40 2008 +1100
-
- Make File.fnmatch respect case when using square brackets
-
-commit 0e32f8e224543a3c152b0351540eaa36fdfcdb06
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Mar 17 11:04:27 2008 -0700
-
- Added exclude for failing spec added in b635fcf0.
-
-commit 62687753b239984acba4f0e80899ca75a8a08cfe
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Mar 17 10:56:31 2008 -0700
-
- Fixes and specs for Module class_variables methods.
-
-commit b635fcf041707fe55a26b7709aef8dc1b2509161
-Author: Charles Oliver Nutter <charles.nutter@sun.com>
-Date: Mon Mar 17 12:52:13 2008 -0500
-
- Add a simple Module#private spec.
-
-commit 2aa98e1df50bba768b57018f6e90c56fe39206f4
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 17 13:28:17 2008 +0100
-
- Make sure no processes left hanging after IO#close specs.
-
-commit 8f332dde4460c03c378f1d1ecc1fbae54557d8ee
-Author: Matt Palmer <mpalmer@engineyard.com>
-Date: Mon Mar 17 16:44:24 2008 +1100
-
- Raise an Errno exception if a write fails
-
-commit 55c830063115e4455eeda3f8de639a7f7e0624f5
-Author: Matt Palmer <mpalmer@engineyard.com>
-Date: Mon Mar 17 16:42:16 2008 +1100
-
- Raise IOError if we attempt to write to a readonly file
-
-commit ad64c0ea7598b8a4c62ba2dd435f70c976186a50
-Author: David Whittington <djwhitt@gmail.com>
-Date: Sun Mar 16 04:24:54 2008 +0000
-
- Modified file type specs to search for sockets in /var/run instead of /var
-
- Doing a find on /var could take quite a while + might do nasty things like do
- finds on backup files etc. Running a find on /var/run should be faster and
- safer.
-
-commit ff5e9d3b9d7f3e484211b66fff96e665ed13614b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Mar 12 17:44:55 2008 +0100
-
- Revert "Added simple spec for range splatting".
-
- This reverts commit 9b3988436a21f61c86168a7566d472c4dfa22162.
-
- The spec uses '=' instead of '==', and it verifies something
- that is not true for MRI (1.8, 1.9) or JRuby.
-
-commit 004662e54477269a98475f84724972b82885d9cb
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Mar 15 01:09:43 2008 -0700
-
- Exclude failing UNIXServer.new spec.
-
-commit 13340924519f607d9c48da04c3f3ab41a1de3e86
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 14 18:14:06 2008 -0700
-
- Tagged unstable Process.kill specs that cause hangup on linux.
-
-commit c4a4dc19a26db058594c8056933cdab42d4f26fd
-Author: Matt Palmer <mpalmer@engineyard.com>
-Date: Fri Mar 14 21:13:31 2008 +1100
-
- Fix up IO#write spec so it works cross-platform
-
- It looks like the Linux implementation of IO#write and IO#read are a bit
- different from the OS X version, because the spec worked on OS X.
- Presumably this tiny change won't cause any conniptions.
-
-commit 33890d9a77d5a34c15263f84b9b415ffc084815a
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Mar 14 14:42:11 2008 +0800
-
- Remove fail tags from passing ruby/1.8/core specs
-
-commit 4bdd3df099fe627d158f4c6d35e5a7df0a891e86
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Mar 14 12:58:40 2008 +1100
-
- Fix bug where stepping by line would sometimes skip a line
-
-commit 260190092afbcfadd1a6e1d6db1674ecf021b686
-Author: Matt Palmer <mpalmer@hezmatt.org>
-Date: Sat Mar 8 19:26:41 2008 +1100
-
- Put in an explicit IO.new test for single-argument
-
- Assuming that your UDPSocket tests passing will prove that IO.new takes
- one argument might have been, in retrospect, a little retarded.
-
-commit 58216e07f0728415762fe5fbe98e1e984dfea31b
-Author: Matt Palmer <mpalmer@hezmatt.org>
-Date: Sat Mar 8 18:45:17 2008 +1100
-
- Mark changing failures in the CI test suite
-
- Fix up so that the CI doesn't fail as a result of my previous changes to the
- UDPSocket specs.
-
-commit 36f91c5da132f309fbf6d047fd74ebd8aa7cbf22
-Author: Matt Palmer <mpalmer@hezmatt.org>
-Date: Sat Mar 8 17:26:49 2008 +1100
-
- Rearrange the UDPSocket test cases for better separation
-
- * open_specs now only contains a spec that calls UDPSocket.open;
- * send_specs now has separate tests for ad-hoc and connection-oriented
- sends.
-
-commit b40c1cf434bd0879f672ec1dc471f1e1dfaccc1c
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Mar 13 17:07:50 2008 -0700
-
- Add (failing) Symbol#to_yaml spec based on ticket 322
-
-commit c0bcb0151379fe9858d0fafd2ef56cf1b08daff3
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Mar 13 16:23:37 2008 -0700
-
- Apply ticket 351 and resolve ticket 350 (RbYAML bugs)
-
-commit a8d6e8cddfd8bc2dccaa93b25adfb31b39b96dba
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 13 16:25:55 2008 -0700
-
- Removed all should_not raise_error from shared/time_params.rb
-
-commit 01f09f4e5697c4a775ac321a71d3b777196d9001
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 13 15:47:37 2008 -0700
-
- cleaned up spec with new raise_error block form
-
-commit e965fc735311915dd43c47cc4853e163376cc6be
-Author: Lachie Cox <lachie@smartbomb.com.au>
-Date: Sat Mar 8 17:14:37 2008 +1100
-
- enhanced syntax error to give same message as MRI
-
-commit 868b38152ca99189fce85542a9068c0d01ee4a41
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 13 15:07:33 2008 -0700
-
- Added exclude for last patch applied
-
-commit 9b3988436a21f61c86168a7566d472c4dfa22162
-Author: Patrick Hurley <phurley@gmail.com>
-Date: Mon Mar 3 14:04:14 2008 -0500
-
- Added simple spec for range splatting
-
-commit 3c7a017e173945d3f9b18d566bb1c3d6d04e97e4
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Mar 13 17:18:39 2008 -0500
-
- fixed tags for new constant specs
-
-commit a966436b7be78bc063e32bc16496f5cabbb0a152
-Author: Matt Palmer <mpalmer@hezmatt.org>
-Date: Sat Mar 8 14:56:58 2008 +1100
-
- Make sure modules included in Object are found
-
- Add a spec to make sure that constants from modules included in Object are
- found. Evan is committing the fix for this separately.
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit 4e0ddd3e701f68b592cb69972f7d587b90392913
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Mar 13 15:05:54 2008 -0700
-
- Correct a 'defined?' spec added by ticket 388
-
-commit 407095d8ffbf0563fa46e5d4ed6a08423eddb2ad
-Author: Martin Stannard <mstannard@gmail.com>
-Date: Sat Mar 8 15:47:59 2008 +1100
-
- Added tests where defined? method should return string descriptions of objects
-
-commit f366309a8fff28552d7d27101d8b3d7b4352e235
-Author: Gianluigi Spagnuolo <glgspg@gmail.com>
-Date: Fri Feb 29 10:42:42 2008 +0100
-
- Fixed Array set element problem
-
-commit 42c22bf542edc8c8379587507fd9e35ba25b190c
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Mar 13 17:00:31 2008 -0500
-
- updated tags for new read specs
-
-commit 45c43a7ab3310a41b0b3367f4762a1bb55b02405
-Author: Ben Askins <benj@supernova.local>
-Date: Sun Mar 9 11:41:49 2008 +1100
-
- Fix typo in file/open_spec.rb
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit a221ea56325fe082154a629094abb27d40919a39
-Author: Alister Lee <rubinius@dev.shortepic.com>
-Date: Sun Mar 9 15:27:34 2008 +1100
-
- Specs to expose defect in eof treatment in IO.read
-
- Signed-off-by: Charles Comstock <dgtized@gmail.com>
-
-commit 4967adb3d49252aae75b6b57159fb5879ac75db1
-Author: Myles Byrne <myles@ducknewmedia.com.au>
-Date: Sat Mar 8 12:14:20 2008 +1100
-
- Check existence of ArgumentError
-
-commit 45e46234da288052e639bb5c9c122874fd4d4e1c
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Mar 13 10:28:54 2008 -0700
-
- Fix File[Test].size? and specs for it.
-
-commit d467bf21c4037784a21ba964b24c28fc80b34736
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 17:36:56 2008 +0800
-
- Fix IO::foreach when separator is nil
-
-commit 70615e1c15692b8a8149e1616c802db9eb5bad11
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 17:32:40 2008 +0800
-
- Fix IO#flush to raise IOError on closed stream. Remove empty tag files.
-
-commit 9c9e7f422c98bf6add6c9a426ae25e3a6dbced85
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 17:29:31 2008 +0800
-
- Fix IO#fcntl to raise IOError on closed stream
-
-commit 215d600002948efb949422c0163aa9bbe5790507
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 17:27:43 2008 +0800
-
- Fix IO#dup to raise IOError on closed stream
-
-commit 879ee8124a2ad8ce83bcd9c51b2d6df0baecb40d
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 16:29:03 2008 +0800
-
- Fix a bunch more IOError when closed stream
-
-commit 487d9561992eb03c3d12de5128772cd194b37b8b
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 16:26:33 2008 +0800
-
- Implement IO#read_nonblock
-
-commit 15c58fa2c47d2dc61b3dac436ab3b56a727b7dc5
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 15:46:22 2008 +0800
-
- Fix remaining IO.read specs
-
- * Passing nil to length treats it as no length limit
- * Passing nil to offset treats it as 0
-
-commit 9daee4f9c3b62db34b07d74171d1017fa823533c
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 15:32:13 2008 +0800
-
- Fix IO#sync to raise IOError on closed stream
-
-commit 2ac848c09e055b3eacc8bb18f713d56715484063
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 15:24:36 2008 +0800
-
- Fix IO#sync to raise IOError on closed stream
-
-commit 36aa8577603f1d8ca76344fc3e889bb7c991bfe9
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 14:51:13 2008 +0800
-
- Fix IO#sysseek to raise IOError on closed stream
-
-commit 3307f5a4db121c2097b450278bc3cf19550f267b
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 14:48:30 2008 +0800
-
- Fix IO#pos and #IO#tell to raise IOError, move their specs to shared
-
-commit 72890065371f3e1d1cde43618a3da04c900749aa
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 14:39:21 2008 +0800
-
- Implement IO#to_io
-
-commit 4977bd1f22278e19ba69203c2545ad97c297ae23
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 14:33:03 2008 +0800
-
- Remove IO#isatty tag file also, since they are sharing the same specs
-
-commit 5dd3115465852ddb03b7100b21739f9d38f0ee58
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 14:29:13 2008 +0800
-
- Fix IO#tty? should raise IOError on closed stream
-
-commit 063f56b4c402180c2c989a15b75fe7a15d4c5c61
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 13:55:55 2008 +0800
-
- Make IO#syswrite use the shared IO#write specs
-
-commit 22de413f6cccb3eb100fd29da90c2ded84ea19f3
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 12:08:50 2008 +0800
-
- Update IO#write_nonblock's tag
-
-commit 25a5ac7e9123512e87e6460f1fa5ecbcfc7349b5
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 12:07:22 2008 +0800
-
- Pull out 2 differences between IO#write and IO#write_nonblock specs
-
-commit a40dbd0f36f0237bc27c905c399aba1e62bbfa70
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 11:39:03 2008 +0800
-
- Alias IO#write_nonblock IO#write and make IO#write specs shared
-
-commit 1c8eb4bc04405753dd607af1f5d231df01fd2536
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 11:06:09 2008 +0800
-
- Make the mock return a string to prevent a coercion error
-
-commit a85b2105c826a7d39dc45c90cad37faf75baac86
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 10:39:00 2008 +0800
-
- Fix IO#write should raise IOError on closed stream
-
-commit e8c8af1aa888dc3e5600cad64f03c09aebaf6d22
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Mar 13 10:34:08 2008 +0800
-
- Fix IO#to_i should raise IOError on closed stream
-
-commit 49d48c381b7ed0f2576c2c5bff3ac8825a0dd49e
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Mar 12 17:56:26 2008 -0700
-
- Fix the insanity
-
-commit 646136d0f75b165a3a62266791556d3f4f03c835
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Mar 12 17:04:30 2008 -0700
-
- Finally got compiler specs passing
-
-commit 052bbcbe4f51b322ae44dc387320f9b4964d74cd
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Mar 12 16:23:58 2008 -0700
-
- Correctly set Syslog mask in Syslog::open and add crappy spec for it
-
-commit dbabc5bda94a2bd77b2cb777666d286155c75ee0
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Mar 12 14:55:08 2008 -0700
-
- Correct Syslog specs and modify syslog.rb to pass them
-
-commit 5b8bee08f2a19d6f25df98183a24745ed33ed519
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Mar 12 14:54:38 2008 -0700
-
- Modify Kernel#load specs so that they pass on 1.8.6-p111
-
-commit b96974693cee75772b09052f8ec7110a000c2429
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Mar 12 14:00:42 2008 -0700
-
- Fixed specs for wilson's compiler encloser changes
-
-commit 2a21597719bea1ea7db27a552ea6dfb6865963d7
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Mar 12 14:00:06 2008 -0700
-
- half work on pretty_inspect
-
-commit 6e398ca491b67a6c468798fd92a9764f70bc68a8
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Mar 12 15:18:02 2008 +0800
-
- Share String#to_a a specs with String#entries
-
-commit 2ff775cbcf2ade4315fbdbb37fa78ee84a1e645a
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Mar 12 11:59:26 2008 +0800
-
- Add String#to_a specs
-
-commit 4f1204bac224ad28375f06e5fb77156367895156
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Mar 11 19:53:32 2008 -0700
-
- Spec and implement Array#pack 'v' option
-
-commit 91d51783f44c3a9b1adfe03b7b9fa35476494ce1
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Mar 12 12:45:56 2008 +1100
-
- Debugger::Output#wrap should handle width of 0
-
-commit 51c316464ad44cadad7ecd997ce45e8392695f4c
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Mar 11 15:26:52 2008 -0700
-
- Implement support for :postexe nodes (END { some_code })
-
-commit 569dd9f10d5194c22335ce58a678d1f9c73f91d0
-Author: oleg dashevskii <be9@be9.ru>
-Date: Wed Mar 12 03:54:39 2008 +0600
-
- Import matrix lib with specs (#389 and #400)
-
- Original patches by Chris Lloyd and matta.
-
-commit 6beb50b7cc2dd3a0f57f3dee45767bb363082159
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Mar 11 13:20:07 2008 -0700
-
- More Integer#times specs.
-
-commit 746d89d6d55c82f26be08f182301926efd62d362
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Mar 10 15:39:26 2008 -0700
-
- Correctly set the enclosing class for evaled code.
-
-commit 218cc7fbdd1b5d1c52248e65817752b8a50821ad
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 10 04:46:00 2008 +0100
-
- Added JRuby speciifc guard to singleton rubyspecs (JRUBY-2239).
-
-commit 25e3f23e78f2b17e02d2c0a058925f8a0ec0d790
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Mar 10 11:25:38 2008 +0100
-
- Be sure not to close the socket before the Errno.handle call
-
- Also a small fix for a spec that fails on OpenBSD
-
-commit 9e7fdf3b0040971f7b8402b9cf5422efaedb2f4f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Mar 10 09:54:16 2008 +0100
-
- Fix TCPSocket#new spec, BSD systems make a distinction between IPv6/IPv4 localhost
-
-commit e5512b2a7725a67471eba086b107b0f4b1f136b2
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Mar 10 08:35:50 2008 +0100
-
- Fix for failing unpack_sockaddr_in spec on Linux
-
-commit b9eab2266e5d1f073b6f876710dc9e848fe25b0c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 23:37:05 2008 +0100
-
- Remove spec tag for now fixed Hash.allocate
-
-commit b6ba9a757b0531791424df38bce6587a53db6002
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 23:12:16 2008 +0100
-
- Remove tag for now correct Fixnum#[] spec
-
-commit 6785c2b44da90d95ef77e98cba42a953828b622f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 23:11:37 2008 +0100
-
- Fix Fixnum#[] specs
-
-commit 0aa09ce9b7269d54cdef583a2eaf0cb57c32f773
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 23:05:21 2008 +0100
-
- Removed tags for working Socket specs
-
-commit 18b27b0ebdc3713962771ca75c1321cabee08d61
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 22:48:45 2008 +0100
-
- Untag now working IPAddr specs
-
-commit f4c0d08bec8fb2db7d130363b0609de7b7720d7e
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 19:56:25 2008 +0100
-
- Slow IPAddr specs are now fast
-
-commit ff71385a67b2853130e63f9942bcea6ac69d591f
-Author: Eero <ruerue@yawn.kittensoft.org>
-Date: Sun Mar 9 10:35:27 2008 -0400
-
- Specs for #412. Array#sort and #sort block form calls #<=> on elements.
-
- * Block form should not expect anything of the elements, all is
- done through the return value of the block.
-
-commit e6edd1bb4bc52053bdb834d52e31fa185f2a2d62
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 14:51:00 2008 +0100
-
- Updated tags for IPAddr because of fixed bit operations
-
-commit 4f59fa9bd187822cd836aa046bb8fd40e4412c30
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 14:49:02 2008 +0100
-
- Fix Fixnum and Bignum shift operations to match MRI
-
- Added behavior for the edge cases, but took a different
- approach than the LH tickets. I don't think we should
- change coercion functions for this.
-
-commit ad8c630662dcb611cd955db08a6f4d53d1dc0dfd
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Mar 9 13:43:38 2008 +0100
-
- Fix Bignum#& and specs for Fixnum AND, OR and XOR
-
-commit 2529acd5e1cc8e61bd995e00834ee1f6941b1d9d
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sun Mar 9 14:18:04 2008 +1100
-
- Fix require_spec and load_spec.
-
-commit 57c7ded8e4d9567aa3c392e8a8262389387ebbfb
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sun Mar 9 12:25:40 2008 +1100
-
- Don't spec .rba require behavior in spec/ruby/1.8.
-
-commit ac630b23da01dcc3a1de1bfa06bac4d301a5031b
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 8 17:23:34 2008 -0800
-
- Better fix for calling to_proc on BlockPass nodes
-
-commit c17b32d44be8452cd867a8212a0fd8bb49c94821
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 8 16:34:02 2008 -0800
-
- Tag failing Method spec for CI
-
-commit c5d4a3b8f84b7558a5dfedb699a1a3ee4d61f118
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 8 16:26:58 2008 -0800
-
- Call Proc.__from_block__ on block_pass arguments
-
-commit a63f457821e67d138d9cf1c5ac8b0760cb25bfc2
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sun Mar 9 10:42:51 2008 +1100
-
- Remove support for zip rba files, libzip. rake clean required.
-
-commit 142222e41bddd2138d82f349f73dbc0fe2cf3fc2
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Sat Mar 8 16:23:37 2008 -0600
-
- Adding a spec for Method#to_proc proc used in define_method.
-
-commit b748efa9904baf0be26aa5b7297fc8ba76e46a74
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 8 13:09:44 2008 -0800
-
- Fix Module#method_defined? and friends for accessors
-
-commit 9b9d8216014c95eb7b4a925e93d0db8e9f5fd308
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Mar 8 10:46:18 2008 +0100
-
- Adedd a couple of GzipReader#rewind specs.
-
-commit 4612812bde4a2fccbaa72ea54ef76c7d964d216b
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Mar 8 15:49:57 2008 +0100
-
- Fix the Array#pack specs, network order is the same everywhere
-
-commit a720bba1619deb4358b453f58913d30a1a311b07
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Mar 8 15:27:47 2008 +0100
-
- Fix Sprintf for positive non decimal notation
-
- This fix combined with the pack/unpack implementation for
- type n also fix some IPAddr specs.
-
-commit caef838aca82665d4c2f691e4873e339a9c7238d
-Author: Lachie Cox <lachie@smartbomb.com.au>
-Date: Sat Mar 8 12:47:19 2008 +1100
-
- updated Array#pack specs to work on big endian machines
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit e3763469a224b4b3668bc1ddef2d982245787646
-Author: Lachie Cox <lachie@smartbomb.com.au>
-Date: Sat Mar 8 12:42:36 2008 +1100
-
- Added implementation of pack schemes for "n" and added handling of multiple items for "i","s" and "l"
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 41b26c49f5a16377af2c677eb702d665dd062a56
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sat Mar 8 15:35:10 2008 +1100
-
- Fix IO#pos EOF spec. Pair: Lincoln, Evan.
-
-commit 1e039fb5c9bcff987769c8644ec47c30aa250952
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sat Mar 8 14:53:01 2008 +1100
-
- Fix Zlib::GzipWriter#finish. Pair: Lincoln.
-
-commit 8551da47a01ef24eaf31fac55253fb05fe81cfcd
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sat Mar 8 14:21:08 2008 +1100
-
- Add Zlib::GzipReader #eof?, #pos, #read w/length
-
-commit a4dba8317311cc3a51231895b2eaea09daaa61be
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Sat Mar 8 10:41:33 2008 +1100
-
- Ensure #pos clears internal eof flag
-
-commit 407e1a4191da6ecd59c1347198a60be2556e043b
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 7 17:04:09 2008 -0800
-
- Tweaks to LookupTable. Converted Errno::Mapping to use LT.
-
-commit eb937c8f1041884e412e3d074387ca9f14bb03ef
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 7 13:48:45 2008 -0800
-
- Fixed LookupTable#delete. Added LookupTable#entries, #dup.
-
-commit d7d9bfd01180cf2c4fc74d2709f71fc7dd59f2f6
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Mar 7 15:03:14 2008 -0800
-
- Bandaid fix for failing #autoload specs.
-
- These need to be properly scoped. However, changing
- :A to ModuleSpec:A causes a sigbus.
-
-commit aea5cc446cd2c1b0cbd29e606b21b6d5959eb5ee
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Fri Mar 7 16:18:19 2008 -0500
-
- Add rb_gv_get and rb_gv_set, plus specs.
-
- Add rb_set_safe_level, rb_secure, and rb_safe_level methods, and specs.
-
-commit cd0b8969487af84a4f40466714dab2d5a1efc224
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 6 17:11:20 2008 -0800
-
- excluded
-
-commit e40f2bb09d8e3137de2856cb1e9c9438945603dc
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 6 17:11:00 2008 -0800
-
- More specs to test out const scoping with eval
-
-commit 3926add9039d1af4a60b633ef8805d471f28e02f
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Mar 6 17:01:21 2008 -0800
-
- Further clarified StringIO#getc specs.
- They weren't really testing what they were doing.
- Fixed StringIO#getc. now properly pushes single chars and sets @pos so it can be mixed with puts/write as needed
-
-commit d2d3750c4960d4a6f2a5d2b16b8bae3d598fbe36
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Thu Mar 6 19:16:24 2008 -0500
-
- Add rb_define_global_function to subtend, with tests
-
-commit 4ab5cc17b70b6569cf9311142d4b278dedfd0a64
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Mar 6 09:53:20 2008 -0800
-
- Added LookupTable and specs.
-
-commit 1ca8a272137ed7020cb977bf51dd2b7164ccbd7e
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Wed Mar 5 17:28:40 2008 -0600
-
- TCPServer.new coerces non-integer port to string and uses getservbyname logic.
-
-commit f0c03880972c19d1a12367dc51ed77f69d9ce8ca
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Wed Mar 5 16:44:33 2008 -0600
-
- Add a couple specs for killing/raising in a thread blocked on accept.
-
-commit 9f80ef157851671727653f46225b99af5d1a259e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Mar 4 21:26:33 2008 +0100
-
- Proper spec for %u with negative bignums and comments on MRI behavior.
-
-commit 3f9c36081c9b62bcde40206e64afdc2ac088bee8
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 4 19:09:56 2008 +0100
-
- Update tags for fixed File#chmod specs
-
-commit 735e818c38f8cefe0cd90514dac5282845a67dd4
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Mar 4 15:13:23 2008 +0100
-
- Improve testing of coercion in File#chmod specs
-
-commit 77a717f5962b2965ad9146e16cb36bedac891c80
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Mar 3 18:16:04 2008 +0100
-
- Adjusted syslog specs to better handle impls that don't provide syslog.
-
- For example, JRuby does not provide syslog (yet).
-
-commit 605bdc53e9dd4fb95dae6557d9ee6f9e2b8ceb80
-Author: David Whittington <djwhitt@gmail.com>
-Date: Mon Mar 3 08:44:33 2008 +0000
-
- Modified Bignum threshold specs to take into account platform wordsize
-
-commit 0af27d11d7dd68cfe49985dc4588933cc41f4fc8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Mar 2 16:40:15 2008 -0500
-
- Tag headius's new to_proc spec as failing
-
-commit b1caeeac673451a960917bb699a20e74cf488432
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Mar 2 13:30:35 2008 +0100
-
- Adjusted Kernel#catch test a bit, to make it more generic.
-
-commit 60f9544ade9d6e71fe3e423ab82cc87838478032
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Sun Mar 2 04:36:53 2008 -0600
-
- Add a spec for #363, & not coercing using to_proc.
-
-commit 70aa320f7f5bc75ed95362b0fb6d724e64224a88
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 1 17:17:55 2008 -0500
-
- Tweak new Marshal spec to pass on MatzRuby
-
-commit 35476e1bde23de26c01df409b750e91ef981fefc
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 1 17:11:53 2008 -0500
-
- Tag new failing Marshal spec
-
-commit d9f83819f1ed2505740ae0737199fecab29809bb
-Author: Jared Luxenberg <jared@jaredlux.com>
-Date: Sat Mar 1 16:20:18 2008 -0500
-
- Added specs for marshalling subclasses of Hash with init parameters
-
- Test that Marshal.dump gives correct output for such an object (passes)
- Test that Marshal.load is able to deal such an object (fails)
-
-commit 6039a3bd457c5d3dc99f5935999da574d17f1e5d
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Mar 1 16:20:08 2008 -0500
-
- Tweak Process.setrlimit spec for odd Linux platforms
-
-commit 25cfa6a96315ee203d06381ee3ddb76b60023360
-Author: Chuck Remes <cremes.devlist@mac.com>
-Date: Sat Mar 1 10:24:55 2008 -0600
-
- Fixes a race condition on OSX when "find"-ing character devices
-
- - on OSX the spec fixture would return /dev/fd/0 as a character
- device when run from the command line. This always succeeded.
- When run as a subprocess (like from cron or rubuildius'
- IO#popen) then OSX uses /dev/fd/0 and /dev/fd/2 for capturing
- stdin, stdout, stderr and others in that environment. While
- the fixture would "find" /dev/fd/2 as a character device, by
- the time the assertion tested it the underlying OS would change
- it to another device type causing the assertion to fail. This
- is just bad luck. We now grab the #last device found rather
- than the first.
-
-commit b6e95321df023ac989c4e5bb926ec55493260bc9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 29 16:04:10 2008 +0100
-
- New rubyspecs for IO#ungetc.
-
-commit 9bd2f0740c71d426cfa3c3636c2451762f640c14
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 28 21:59:35 2008 -0800
-
- Specs for Hash.allocate. Fix awaits replacing Hash with LookupTable in core.
-
-commit c1d979639bfc19072351211815ffd5c8da772dcd
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 28 21:56:33 2008 -0800
-
- Specs and fixes for Module.allocate.
-
-commit 904fd6136f00bab5fec62e8e702a0508dec44bac
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 28 19:45:39 2008 -0800
-
- Specs and fixes for Array.allocate.
-
-commit 776a24f0d14bbb5127c804cf0579960335c1a049
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 28 19:35:55 2008 -0800
-
- Specs for String.allocate and fixes to make them pass.
-
-commit fa35211f357ff1b9660a318c12b86ca156c5f26d
-Author: Ari Brown <ari@aribrown.com>
-Date: Thu Feb 28 20:27:55 2008 -0500
-
- Moved stdlib/syslog.rb to lib/syslog.rb . it works!
-
- * everything runs! yay!
-
-commit 8f103a6f9d7a168e37d1063e40bee960d64fc609
-Author: Ari Brown <ari@aribrown.com>
-Date: Thu Feb 28 19:42:11 2008 -0500
-
- Added specs and the constant module for stdlib/syslog.rb
-
- * added some specs for that which is testable
- * fixed the constant module so the constants are defined
- * fixed 'undefined method' problem in #write (private)
-
-commit 0c89dc90fdcb7933169e23462197d59f9627f510
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Feb 28 14:31:05 2008 -0800
-
- Added basic throw/catch specs. Fixed raised NameError to contain the name
-
-commit c8f4db4270984b60a087dd423c9e0da3e3760622
-Author: Phil Hagelberg <phil@hagelb.org>
-Date: Thu Feb 28 14:11:30 2008 -0800
-
- tag failing proc spec
-
-commit a1591319696385191f3301516d2f8265cd8fedcb
-Merge: f167f8f... 3f1acce...
-Author: Phil Hagelberg <phil@hagelb.org>
-Date: Thu Feb 28 13:43:52 2008 -0800
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit f167f8f6f7f3a1b8804a5452643236a23c0ce4c4
-Author: Phil Hagelberg <phil@hagelb.org>
-Date: Thu Feb 28 13:43:40 2008 -0800
-
- failing spec for returning from procs
-
-commit 3f1acce781c0dcf43698441036a085a0cef02d29
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Feb 28 16:14:55 2008 -0500
-
- Basic support for UNIXSocket and UNIXServer
- Fix some 'Errno' typos in socket.rb
-
-commit afbf38613364436630933753d99ee94c03b85074
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Feb 28 21:34:10 2008 +0100
-
- Added specs for File.fnmatch with case-sensitive brackets.
-
-commit 28323bda3d1f3295371b6ea99ed8ba6ee15661bb
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Feb 28 20:47:51 2008 +0100
-
- Added specs for File.fnmatch with '**/' patterns.
-
-commit 893ff4729d024198d5b423cc4426153f49cb5ebe
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 28 11:30:49 2008 -0800
-
- Fixed lookup of class variables defined in metaclasses.
-
-commit dee531b18d96199d608d8e2e8e27f54ef500a716
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 27 21:47:13 2008 -0800
-
- Additional Symbol#inspect specs. Another try at making them pass.
-
-commit 3bfb705b709ab35593684a68b35fb0ee8e1e01d7
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 27 21:46:37 2008 -0800
-
- Silence 'woot' echo on ubuntu from #system specs.
-
-commit 7fb76f2c4a9fb0c5695a38b90150ea6f50097237
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Feb 27 18:05:48 2008 -0800
-
- Fixed Symbol#inspect from over quoting
-
-commit 4ac32e4c9d0ff55aad50a00944f1a64931cfd1c6
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Wed Feb 27 17:18:09 2008 -0800
-
- Added some pretty rude specs for Kernel#system and got them to pass.
- Fixed a wierd problem with system/exec not cleaning up the fork process right
-
-commit 73be3b88af1ac96a6d4afabddd2871cfc4691eec
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 27 15:36:17 2008 -0800
-
- Fix String to properly initialize backing store when subclassed.
-
-commit 5ab2f9e594b7e66a04028e60f3517488e345f508
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 27 15:04:09 2008 -0800
-
- Scope classes used in String specs.
-
-commit e45d58100850443fedada905f654bae3f4144790
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Wed Feb 27 17:04:58 2008 -0600
-
- Add /devices to find commands; Solaris uses /devices instead of /dev.
-
-commit 1403477197873d613cfb93d644f78b4067d180d3
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 27 20:21:48 2008 +0100
-
- Adjusted Env spec, to be able to run it on Solaris.
-
- grep is replaced by egrep, since older greps don't
- take -e parameter (like on Solaris).
-
-commit b239a3b615d341f982a7a4a3a1b1200d95f79684
-Author: Adam Shelly <adam.shelly@gmail.com>
-Date: Wed Feb 27 04:09:24 2008 -0500
-
- Amending specs for Array#pack('U')
-
- * rbx is now passing most specs
- * failing specs are due to String#unpack.
-
- Signed-off-by: Brian Ford <bford@engineyard.com>
-
-commit 328c40e0f24601e739f404ab252652deca477513
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 27 02:46:21 2008 -0800
-
- Fixed Array instantiation to work with subclasses.
-
-commit 96c4ea885fbd075765b9d234de2754df3c857b07
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Feb 27 09:26:25 2008 +1100
-
- Move Debugger::Output specs to match new location of class
-
-commit c59f16f34f47860b200c6de4a2c1144c566de3dd
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Feb 26 10:23:14 2008 -0800
-
- Exclude new failing Array specs.
-
-commit 27248a45f079fd5a8cdb9ee71d008d135dcbe63d
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Tue Feb 26 00:10:29 2008 -0600
-
- Add additional Array tests from BFTS.
-
-commit a0e156f4c5bc12bf39950afeb58a6962b37efaa7
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Feb 26 16:53:01 2008 +1100
-
- Fix Debugger help output formatting to use wrapping
-
-commit fa5304d42c72a07b09cece99cb22c90f6b399a51
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Feb 26 13:22:31 2008 +1100
-
- Add wrapping to debugger column output
-
-commit 1a5d830b41eef37bb78168c959dd5b2f0757fde4
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 25 18:58:11 2008 -0800
-
- Conform Bignum#div, #divmod to weird MRI maths.
-
-commit eb5c6e367990bfdd193bcdf3055009f3e3e1aeaf
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Feb 26 13:23:29 2008 +1100
-
- Fix Debugger specs to pass on ci
-
-commit a2feff6782a052a9b71da90e9d4e1b2d991cc598
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Feb 25 18:53:24 2008 -0500
-
- Patch by Jos Backus (josb) - Closes ticket 364 (FreeBSD warnings)
-
-commit cee08883cc3de2e41a88b506f7d7f8d40697eaa2
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Feb 25 13:20:21 2008 -0800
-
- Fixed autotest churn by removing empty.txt and moving to /tmp
-
-commit f26bb0c4e3b8435a853a9f4843173748d98075fd
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 25 11:25:10 2008 -0800
-
- Add the rest of spec/* directories to CI process.
-
-commit 29f36833e79de6115c27d744adf158e1b3ba42f0
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 25 00:29:45 2008 -0800
-
- Excludes for spec/kernel, spec/debugger to run with CI.
-
-commit 12bbdf70af31d5168c2df0a9b53651f94b36899d
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 25 00:22:13 2008 -0800
-
- Excludes for subtend specs so they will run with CI.
-
-commit 0cbc2b1f20d8aee7ea74eb14e1f9cf242f8b47d5
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 24 23:57:56 2008 -0800
-
- Remove specs for removed Compression::ZLib.
-
-commit 1b4fbc76c2eb84e5cb45562f54ac105784f9e134
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 24 23:49:57 2008 -0800
-
- Conform Ar specs.
-
-commit f8e62002711c3cfd8024faca497775f7253a326a
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Mon Feb 25 05:24:54 2008 +0100
-
- Add a second case for truncating IO buffers that specifies too-small size.
-
-commit 9f3e25289cc52cd3f3fb240de1ad82a16a8b135c
-Author: Nikolai Lugovoi <meadow.nnick@gmail.com>
-Date: Tue Feb 12 23:19:27 2008 +0200
-
- Fixes for String#to_sub_replacement:
-
- * removed String#replace_slashes
- * using plain byte-by-byte scan instead of regexps to detect and handle backslash escapes
- * better handle unknown escapes and cases like '\\\1'
- * updated specs for String#sub
-
- Signed-off-by: Brian Ford <bford@engineyard.com>
-
-commit d87df0b7634ae37f85fc8f2795e4c8c425614b11
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Mon Feb 25 02:57:27 2008 +0100
-
- Add a spec for Enumerable#inject with a *arg; JRUBY-2162 exposed it.
-
-commit f04fcabf8c064dfcbf3b118bdc83289da169a30c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Feb 24 21:24:51 2008 +0100
-
- truncate behaves different on OpenBSD, changed specs according to MRI behavior
-
-commit b74a2f45b32a02469d61d4ace04912ec25f19543
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Feb 24 20:18:02 2008 +0100
-
- Looks like Darwin does provide Process::RLIMIT_AS
-
-commit 7113973abff64eeb1304b15be46f07d301d84f3f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Feb 24 18:25:55 2008 +0100
-
- OpenBSD doesn't provide Process::RLIMIT_AS, so this spec should be excluded
-
-commit 49b72719bf5c732f4aa2ad0d70e5a224556fb471
-Author: oleg dashevskii <be9@be9.ru>
-Date: Sun Feb 24 11:04:07 2008 +0600
-
- Spec for method taking lambda and block.
-
- * should raise SyntaxError
- * passes on MRI
- * fails on rubinius
-
- Signed-off-by: oleg dashevskii <be9@be9.ru>
-
-commit 60bbc8506d70571249972dbf124df520f0a4a476
-Author: Chuck Remes <cremes.devlist@mac.com>
-Date: Sat Feb 23 10:23:09 2008 -0600
-
- Fix unpack_spec expectation for little-endian byte ordering
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 17e45cee97057684e6c24608f97de48c28947384
-Author: Chuck Remes <cremes.devlist@mac.com>
-Date: Sat Feb 23 09:44:37 2008 -0600
-
- Fix unpack to use native host byte order for formats /ILQS/
-
- - unpack_spec had a bad expectation on little-endian platforms
- - unpack_spec got some updated description strings to correctly identify
- the host byte ordering expected in the spec
- - kernel/core/string.rb now unpacks formats /ILQS/ in the platform's native byte
- ordering
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 1540cb7caa0f200ed6d318971fb7302cd089e27d
-Author: Chuck Remes <cremes.devlist@mac.com>
-Date: Sat Feb 23 08:10:00 2008 -0600
-
- Add some missing endian guards to the unpack_spec
-
- - in my haste, forgot one set of guards around some specs
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 8488676fc0dac5db5d01dd92e061476226d58bd1
-Author: Chuck Remes <cremes.devlist@mac.com>
-Date: Sat Feb 23 00:19:33 2008 -0600
-
- Fix several Array#pack and String#unpack bugs related to byte ordering (endiannes)
-
- - added a small utility method endian? to the kernel module; determines host byte
- ordering by taking a symbol (:big, :little) and comparing it to Rubinius::ENDIAN
- - modified Array#pack to check for the native byte ordering for /ils/i formats
- - modified String#unpack to use native byte ordering for /DdFfIiLlQqSs/ formats
- - modified String#extract_number to do special processing for big-endian platforms
- and for formats using native byte ordering on a big-endian platform
- - added little_endian and big_endian guards around several String#unpack specs;
- now passes running against MRI and rbx
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit f8146d29bfdf67349f3f9c0c7105ce595981255f
-Author: Gianluigi Spagnuolo <glgspg@gmail.com>
-Date: Sat Feb 23 12:44:25 2008 +0100
-
- Added some test to Regexp.quote to manage tab and white space
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 714efa8574687e1fd31f904a4f35cce8056719f5
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Feb 23 00:01:38 2008 -0800
-
- Fixed Digest specs to pass with RSpec.
-
-commit a0fe2f7fa080729b77b32ffe21be5705a162ed71
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 22 22:26:52 2008 -0800
-
- Remove ffi_decode_sockaddr, replace with existing ruby code.
-
-commit b2baf0911e4a88ba2f6c4cb8e3e31d2a3aa1c6bf
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 22 17:06:18 2008 -0800
-
- Move Ar to kernel/core.
-
-commit 01baf002a8c7bd6e249b9477c1f78e6b99a67bf6
-Author: Philipp Bruschweiler <blei42@gmail.com>
-Date: Wed Jan 16 00:11:12 2008 +0100
-
- added specs for SHA256/384/512
-
- these specs were as well shamelessly copied from the md5 specs.
- they work, but every sha* class has a folder for itsself, that's a
- lot of duplicatd code. maybe someone with more experience in
- writing specs should have a look at this.
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 924224fcf655da90148ebd8234033a71e1b23090
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Fri Feb 22 17:13:14 2008 -0500
-
- Catch no block given in rb_yield, raise LocalJumpError
-
- As well, define that as an exception for subtend
-
- Update spec
-
-commit 3748843421832df5b842a677ddd2e55fbefb0b5f
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Fri Feb 22 17:04:33 2008 -0500
-
- Update rb_yield spec
-
-commit f60ca442b1466f29432995700457e8b34f4ff294
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Fri Feb 22 17:00:36 2008 -0500
-
- Fix rb_yield call
-
-commit a75afc4595fd20d7853ff65afe015de88b265b93
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Fri Feb 22 16:48:17 2008 -0500
-
- Add blocks to subtend methods, as they should be able to access them like any other method.
-
- Also, update the spec
-
-commit d9911f8b00243f3c95759612dde35edf6edaa678
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Thu Jan 31 13:54:24 2008 -0500
-
- Add block specs and rb_block_given_p
-
-commit b6c806f0d8213c4751c69638174f60b80f9ba303
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Feb 22 15:31:58 2008 -0500
-
- Failing spec and exclude for left-to-right masgn evaluation order
-
-commit 8f9e3c9e5e7dfc535e8fe6b10b945587586651ec
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Feb 22 13:59:44 2008 +0100
-
- Fix Socket#getservbyname, not every platform defines http/udp
-
-commit f29ff3bcaf0bf83d2924d08ea5f6c0bbb5df9948
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Thu Feb 21 16:47:02 2008 -0800
-
- Allow Ar to create archives
-
-commit e50ec6470dfc905198065a98b65b33a99da60e15
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Feb 21 20:20:41 2008 -0500
-
- Some compiler specs for 'defined?' handling
-
-commit ba5a0d87182d83000205e1202f5c473568a50489
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Feb 22 01:08:51 2008 +0100
-
- Fixed #332 and cleaned up Time a bit. Thanks to gls
-
-commit edf1e0d530ebb39a1b46d0fa518b9ca85db544da
-Author: Evan Phoenix <ephoenix@engineyard.com>
-Date: Thu Feb 21 02:01:21 2008 -0800
-
- Fix the last usage of block return (ie, internal long return).
-
- * LongReturnException is now used whenever a block requests that
- it's home context should return.
-
-commit 83ed7161701202d48490e7f38b568bc504f9690f
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 23:59:47 2008 -0800
-
- Added little/big_endian guards to Array#pack and String#unpack specs.
-
-commit 65b4ed86002371f2b56759aadc61e61c1cbbdba4
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Feb 20 22:49:19 2008 -0800
-
- Exclude Socket#unpack_sockaddr_in spec. See tag comment.
-
-commit 9fbda05c4dffb964a9f10e26d62240fbd52200a0
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Feb 20 22:48:31 2008 -0800
-
- Exclude super slow IPAddr specs.
-
-commit 3d39fb35dcd3c28fa626aeb96057b927c6bfe7c9
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 18:54:50 2008 -0800
-
- Redo expectation in Socket#getaddrinfo spec.
-
-commit 69576ede38d9bf09d1afd0120726ca756a0aa7cf
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 18:31:27 2008 -0800
-
- Account for variable length array in Socket#getaddrinfo.
-
-commit f396bd718572d9402d0d7eeb8da02474914396a8
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 17:59:29 2008 -0800
-
- Use File.delete in YAML specs instead of rm.
-
-commit 7698ec3855ce572f1e10962596804b82f3cd6534
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Feb 14 10:07:48 2008 +1100
-
- Hook-up new StepBreakpoint to new debugger step commands
-
- * The commands step and stepi have now been added to the
- debugger, and step into called methods.
- * The commands next, nexti and out have been converted
- to use the new StepBreakpoint. The legacy versions
- remain, but have been renamed as ln, lni, and lo; these
- will be removed once the new commands have proven stable.
- * Replaced VM method cache command with VM send site command
- to show details of SendSites in the current method.
-
-commit f192d65ec5eb31b4a807b9c3eb7360b84739d9f2
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Jan 31 16:43:19 2008 +1100
-
- Initial implementation of StepBreakpoint
-
- StepBreakpoint class moves step logic out of the Debugger
- and into breakpoint, where it more logically belongs.
-
-commit fd0ff43d2d384e221ff8de611843f3406d192657
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 17:04:46 2008 -0800
-
- Fixed YAML spec to pass MRI. Added fails tag for rbx.
-
-commit d69834a5217ddc6667b495fbe7d4dd8ad413ba88
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Feb 20 15:42:25 2008 -0500
-
- Fix dead code in TCPSocket.new specs
-
-commit 4644222e63046783933ca9b2e4514e3ff21fbb57
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 12:31:14 2008 -0800
-
- Add missing tag file for method_spec.
-
-commit 230d5d506f4203bcd3922880fae506fa480e6308
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 12:17:13 2008 -0800
-
- Fix typo in socket specs.
-
-commit a5d49537832a9cc33b07cade265af0834f123533
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 12:09:11 2008 -0800
-
- Move specs for calling methods to language/method_spec.rb.
-
-commit ead32a1f2820a4e2fcc906a8e7f3603490ba901c
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 11:53:45 2008 -0800
-
- Use bignum_value where a Bignum is intended in the specs.
-
-commit 1021345337bca1f928879713cb84a76b9c7935a1
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 10:21:42 2008 -0800
-
- Removed unused require 'stringio' from io/syswrite specs.
-
-commit cfd51af482321b4d672d69569de185f582a21831
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 09:00:36 2008 -0800
-
- Symbols as Fixnums is long deprecated. We don't spec it.
-
-commit a8bd2a1aba97653625a9b568d1a7112b5fce45f6
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 00:15:54 2008 -0800
-
- RbYAML is not in Ruby standard lib. Move specs for it to spec/library/rbyaml.
-
-commit 56b454af2ded18d0459bc974efa666ccf3b8de0f
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 20 00:10:24 2008 -0800
-
- Restrict specs in spec/ruby/1.8 to current stable 1.8 version.
-
-commit 22e01d1914db92d159ee15d3cf73c9d6e9d0a24b
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Feb 19 23:20:27 2008 -0800
-
- Fix Dir#pos=/#seek specs. We shouldn't spec undefined platform behavior.
-
-commit d522af83d0cfcdf39932afff7ba7d75d77dd0453
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 20 11:51:44 2008 +0100
-
- New IO.read specs.
-
-commit 77fdbe404e31f44e1c302eb99a7ff129523183ce
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Feb 19 16:14:43 2008 -0800
-
- Add library to read/write ar(5) files
-
-commit d7702f979732de90358dc35d795c6ac621f815bc
-Author: Matthijs Langenberg <mlangenberg@gmail.com>
-Date: Mon Feb 18 18:04:27 2008 +0100
-
- writen some examples for Base64 module
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 33b189478c05bd687ac8b062cd5307a3290d8931
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Feb 19 00:27:51 2008 -0800
-
- Convert platform guard :size option to :wordsize.
-
-commit cbcdb8346a2c75ba65910b486cee718cd3aa5175
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Feb 18 23:07:41 2008 -0800
-
- Exclude TCPSocket.new for now, hangs on ubuntu gutsy.
-
-commit ec990b6ebcd35cbf9dc192852f37e184c3e4079b
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Feb 19 15:55:25 2008 +1100
-
- Re-enable debug on context change
-
- The cpu_yield_debugger_check was not being performed as
- a result of changes to method dispatch related to the
- implementation of SendSite.
-
-commit aa585b7e637e2fd873602ee6725256429f413582
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 18 18:59:18 2008 -0800
-
- Removed :version guarded specs that are not current stable.
-
-commit 431af5920a0a02dfca927961a2d6457ae5f050e2
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 18 17:40:56 2008 -0800
-
- Added new tags files for excludes.
-
-commit 10dd37903533cac9a6f77ead70f3aa9ee1dc9098
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 18 16:38:58 2008 -0800
-
- Removed deprecated $deferr from getoptlong.rb. Moved to /lib.
-
- Small fixes to other library specs to get them running under CI.
-
-commit ee2dabf771a5e6d8d70c47fa49b1298d2d002c8c
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 18 00:42:54 2008 -0800
-
- Use the spec guards properly.
-
-commit 91d6c64be8827768ba2e39b80a4eb81b9affc122
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 17 22:40:21 2008 -0800
-
- Deprecate #setup, #teardown in specs; use #before, #after.
-
-commit 6ba49012504c08973e1fb2fd1b9fce75c351d148
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 17 22:00:56 2008 -0800
-
- The #fails_on guard has been removed. Use #ruby_bug or tagged excludes.
-
-commit e24231f5c62c0b73768c7503f50b53e8ffc345d1
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 17 21:08:01 2008 -0800
-
- Renamed *_excludes.txt to *_tags.txt for specs.
-
-commit a1c707b517e13115692173bc2048309e74c00915
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 17 20:45:14 2008 -0800
-
- Hand merge recent excludes changes to spec/tags directory.
-
-commit 838bee7e99bb1179c9a3a7782dcab9c2b904e72e
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 17 00:17:51 2008 -0800
-
- Moved excludes from spec/data to spec/tags. Added "fails" tags.
-
-commit 8ad91b03788d89ccd12fbcf19c06c9ef4f0cfee8
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 4 19:19:00 2008 -0800
-
- Misc fixes to get MSpec running specs.
-
-commit a683dd75786ab6c6a255c9bac399dc6be7aaa4b5
-Author: Tyler McMullen <tbmcmullen@gmail.com>
-Date: Sat Feb 16 23:39:38 2008 -0500
-
- Add support for H and h to Array#pack.
-
- * Updated array/pack_spec with specs for H and h, separately
- * Updated Array#pack to handle both with a single block of code
-
- Signed-off-by: Brian Ford <bford@engineyard.com>
-
-commit b1d3ba9d10f6a9ea87d8cb9be21d0d432e973117
-Author: oleg dashevskii <be9@be9.ru>
-Date: Mon Feb 18 01:18:24 2008 +0600
-
- Update specs for calling methods.
-
- Nasty binding stuff (first noted in #293) got specced and put into excludes.
-
-commit 02225daa5cef4fa3f48cac73d4bf0f9d02f3ebe0
-Author: oleg dashevskii <be9@be9.ru>
-Date: Sun Feb 17 23:20:08 2008 +0600
-
- Cross-breed and update for, while & until language specs. Little fix for hash spec.
-
- The compiler drops out on "for @@var in 1..3", so this is commented out.
- Variable scope stuff arrived into excludes.
-
-commit f43383a150131278d30535196e8da4e60dff97b1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Feb 17 13:10:55 2008 +0100
-
- New specs for RangeExceptions out of Fixnum and Array methods.
-
-commit 7d1c744d9c1ae50376be406a28e383a04ca6b4fc
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Feb 16 13:49:11 2008 +0100
-
- Corrected copy-paste error in recent fixnum specs.
-
-commit 08982321472008f7645212289d2624d19053ed7e
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 15 21:18:53 2008 -0800
-
- Fix IO#read for large files and small parts of files.
-
- Fix IO#read with buffer.
-
- Fix IO#eof? when buffer reaches eof.
-
-commit 1d07588d61b3835a6165c5de1f731277812cff79
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 15 19:11:42 2008 -0800
-
- Add missing spec for IO#eof? and fix.
-
-commit e0a6c8e179e48b423b6eb142b27460cd86d0223b
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 15 17:50:47 2008 -0800
-
- (Last change was ok). Force check for data so #eof? works
-
-commit d7e67c257c213f9e25b3123ce85576feb71a0089
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 15 17:28:48 2008 -0800
-
- Revert "Force a check for more data on the IO for IO#eof?"
-
- This reverts commit 3d4427e802756678608bf9840ba6f26fc81cf7fe.
-
-commit 4c1182c184bb6c2c97c5fc8ce83f242fe5f5144b
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 15 17:26:08 2008 -0800
-
- Force a check for more data on the IO for IO#eof?
-
-commit 94466db3347889850feb25dd7c83883df21bac92
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Feb 15 14:13:29 2008 -0800
-
- Added Float examples to Bignum bitwise operator specs.
-
-commit 3a668451d3bcc46b162a69ce1f8ec5d6a98b2d22
-Author: Brian Ford <bford@engineyard.com>
-Date: Fri Feb 15 13:44:24 2008 -0800
-
- Added bignum_value helper. Added specs for Fixnum bitwise operators.
-
-commit 217eb67a4c2f0bf1222628abfecfadbede5fb3b8
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Feb 15 21:09:43 2008 +0100
-
- Fix process specs for FreeBSD
-
-commit f25e0e130110ebbef0b5bc0c28c9b08db6c73a1f
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Feb 15 13:18:40 2008 +0100
-
- Removed now working exclude for Array#sort
-
-commit 56af7be26dcc9b7270de6d96e73e09a4f17cc710
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Feb 14 20:48:37 2008 -0500
-
- Improved Array#sort, #sort! specs.
-
-commit 714ea4b5245172cc6d5c815ef7399d1a991dd83f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Feb 13 10:30:22 2008 -0500
-
- Improved Array#sort specs a bit.
-
-commit 8944e873848c610182405c2de466e41e6260573d
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Feb 13 02:34:37 2008 -0500
-
- Tuple#swap specs.
-
-commit 24199f731dba40b72af6d121121dec9f085f890d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Feb 14 20:03:16 2008 +0100
-
- New rubyspecs for IO#reopen.
-
-commit 4f70320e5b7089c74b3899216763cd37d8854230
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Feb 14 17:27:32 2008 +0100
-
- Removed JRuby-specific guards. Please don't use guards to hide bugs.
-
- Guards to be used only when it is agreed that the JRuby behavior
- is intentionally differs from MRI. For plain bugs, guards should
- not be used. Instead, we maintain spec exclusions in JRuby repository.
-
-commit 0198a11b3bdf60983846a6c722dfa11d1b9f57bb
-Merge: ef3393e... 1f1e32e...
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 15:57:57 2008 +0100
-
- Merge branch 'mutle_file_specs_refactoring'
-
-commit 1f1e32e5e1fd12fb323e2a74a7f5caae96aa867b
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 15:18:14 2008 +0100
-
- Specs for File#chown #flock and #truncate now pass on JRuby
-
-commit 3a8e601d5205e050f83179376d2be3e922e80c20
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Feb 14 17:25:02 2008 +1100
-
- Fix context specs to wait for debug listener thread
-
-commit 608d7a99e75d293d6f9786cee940c0dd23156be3
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 12:59:32 2008 +0100
-
- Adding guards to only run File#chown and File.chown specs as root.
-
-commit b3a1069cf6c18b844b9eced32b7bcdb91ad7c558
-Author: Brian Ford <bford@engineyard.com>
-Date: Thu Feb 14 01:31:47 2008 -0800
-
- Rework Bignum#==. Change Numeric#== to conform to MRI.
-
-commit 4eb58ebc45b2ee79f01d75fdb3e9104c73ad66e2
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Wed Feb 13 23:56:37 2008 -0800
-
- Common implementation for Zlib::Inflate and Zlib::Deflate.
-
-commit 1804fdacce5c195a90befe502706d1f1e066e886
-Author: Brian Ford <bford@engineyard.com>
-Date: Wed Feb 13 19:31:20 2008 -0800
-
- Port of JRuby's File.fnmatch to Ruby (yeah, like writing Java in Ruby).
-
-commit 1a78da8438535ee8ed231359bdb15ff3624c6b37
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 01:27:52 2008 +0100
-
- Adding File#truncate improvements from #325 and #326
-
-commit 5b62acbdcf0aab2e89be5ac3e12859ae36cd6950
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 00:47:53 2008 +0100
-
- Adding File#truncate with specs
-
-commit 1a2b3dde4f67abe0936e7ec6fb749e5bb8fda7d2
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 00:36:32 2008 +0100
-
- Adding File#chown with specs
-
-commit e132cd6f11285f0e106a5d2a292e23c8375fa1ee
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 00:12:31 2008 +0100
-
- Renamed File#flock spec to properly reflect an instance method
-
-commit 00cd22ccdf2b70fa53693000d4a5bb803c7d6df6
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Thu Feb 14 00:07:05 2008 +0100
-
- Adding File::flock with specs
-
-commit 3c9b3e4e4272889dd26ec9ddb25f7aaf88c6c380
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Wed Feb 13 23:25:30 2008 +0100
-
- Adding File::chown with specs
-
- * The spec works fine on OS X, but was not tested anywhere else
-
-commit c894a6c46b4a3d0b9010020c394d3ba366bf145e
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Feb 13 11:59:38 2008 +0100
-
- Module#undef_method should accept string parameter, not only symbols by Nikolai Lugovoi (#321)
-
-commit c968d5c29cc3126c789cf5bb2005bd9637e85312
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Feb 13 11:52:10 2008 +0100
-
- Update excludes for File#truncate
-
-commit 408e69864546aea061e006073bb452b8db8c4610
-Author: Ragnar Dahlén <r.dahlen@gmail.com>
-Date: Wed Feb 13 11:15:31 2008 +0100
-
- Implement File.truncate, passes specs.
-
- * Adds truncate, ftruncate (not used yet) to posix.rb
-
- Only tested on Mac OS X 10.5.1.
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit 5c75721d5a78e25a77e9f068bf4c95e729604959
-Author: oleg dashevskii <be9@be9.ru>
-Date: Wed Feb 13 11:26:34 2008 +0600
-
- Remove tests that have been superseded by precedence_spec.
-
-commit 83a372674786a0be51a206cadcae644d72a1e8d2
-Author: oleg dashevskii <be9@be9.ru>
-Date: Wed Feb 13 11:05:34 2008 +0600
-
- Made a real precedence_spec.
-
- One test still commented out till the bug with flip2 is fixed.
-
-commit c3988a4a906594c050e058add8aa6996870dc115
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Feb 13 02:10:49 2008 +0100
-
- Remove excludes for File#stats specs
-
-commit 1624b463d0f70a27b6772d90626c94b6eed4e5c4
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Feb 12 18:25:05 2008 -0500
-
- Add specs for pass subclasses of Module to 'include'
-
-commit 64b0fb4131276feda0d0ab13301824b20f8d7f8e
-Author: oleg dashevskii <be9@be9.ru>
-Date: Wed Feb 13 00:49:37 2008 +0600
-
- Make Dir.chdir spec work when /home is symlinked to /usr/home.
-
-commit 8cbf6312df160f30e284a4537039f808a42543fe
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Feb 12 12:30:19 2008 -0500
-
- Add failing Array#sort spec and matching exclude
-
-commit 9bef807b3b469b8790edbe96f1442394d528cb5a
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Feb 12 12:09:11 2008 -0500
-
- Move Time#<=> specs around until the descriptions make sense
-
-commit 60fbbc62cb04b2fddcd406f01f906482fbc84370
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 12 05:33:49 2008 +0100
-
- Mark JRuby as not deviating from MRI on unboundmethod specs.
-
-commit 4e6d8f7e3326f937a6916ed11984172670a71094
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Mon Feb 11 23:26:31 2008 -0800
-
- Zlib.adler32
-
-commit 2f2d10e1aa57bae79f7fcda5e5a30b2a2ef3e37c
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Mon Feb 11 23:12:40 2008 -0800
-
- Zlib.crc_table
-
-commit 49b9e4b624074d151e89f078c4080a0a7584abaa
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Mon Feb 11 22:56:52 2008 -0800
-
- Zlib#crc32
-
-commit 7cb2ebfa008afc96135912ceefdbd81b1cd7e478
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Mon Feb 11 17:36:32 2008 -0800
-
- Fix class variables for RDoc.
-
-commit 571d837bbeff221daacebc79c1ccab7de15c77f2
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Feb 11 08:54:36 2008 -0800
-
- Exclude [r]dev_(major|minor) specs. We need some autoconf facilities.
-
-commit fb2bc81d50bf504e3997d009e3c13f841b859803
-Merge: 55a52f1... 9b58a59...
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Mon Feb 11 16:19:02 2008 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 55a52f18133fc9f92eef64838008a83dfaab3ffc
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Mon Feb 11 16:18:37 2008 +0100
-
- Removed Math.asinh excludes.
-
- It wasn't working on OS X. Evan fixed the culprit FFI over the weekend.
-
-commit 9b58a59ca21c6622d246e629410230bfbe8cd4ce
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Mon Feb 11 21:24:05 2008 +0900
-
- Modified to address differences of SyntaxError class between MRI and Rubinius in 'erb/filename_spec.rb'
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit d1c4280b70b82d6cd541251e3d7e1a3091fb304f
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Mon Feb 11 20:19:12 2008 +0900
-
- Add 'erb/util/shared/url_encode.rb' which is missed file
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit b4b1114ac7dffabd672d462b5857a7e1957e8f07
-Author: makoto kuwata <kwa@kuwata-lab.com>
-Date: Mon Feb 11 19:10:58 2008 +0900
-
- Add spec files for erb.rb
-
- Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
-
-commit dfdf90968e78f14e0755b5f3279ec878034dbdb5
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Mon Feb 11 00:09:23 2008 -0800
-
- Added singleton specs (and reorganized stale one):
- * Singleton#_dump
- * Singleton._load
- * Singleton#instance
- * Singleton.instantiate?
- * Singleton.new and Singleton.allocate
- * Singleton#dup and Singleton#clone
-
-commit 54c4a4cab187be4328d6a810bae4bc4bd01ca1d8
-Author: Brian Ford <bford@engineyard.com>
-Date: Sun Feb 10 20:19:30 2008 -0800
-
- Additional specs for File::Stat#rdev, #rdev_major, #rdev_minor.
-
-commit 6b2f05af4758c488b3e2e3b19ee9d2e872817932
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Feb 10 23:00:41 2008 -0500
-
- Rubinius now passes all 'super' specs
-
-commit 5be84fce241c67bd8439bccbe54cec575b0ea93a
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Feb 10 22:53:11 2008 -0500
-
- Failing spec for 'super' behavior
-
-commit 975d51e80d3df437eaa8ddd3c3384a5766255b12
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Feb 9 15:18:37 2008 -0800
-
- Exclude Process constants spec until LFS is fixed on 32bit linux.
-
-commit 236def62bcfa3dca75a6eebf378a68235c4613ed
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Sat Feb 9 17:04:59 2008 -0500
-
- Fixes exclude
-
-commit 26bedb481b45e77434b487c6395903c6110ef99e
-Author: Yehuda Katz <ephoenix@engineyard.com>
-Date: Sat Feb 9 16:01:58 2008 -0500
-
- Moved bad variables spec out
-
-commit 87efbf9036e5c524e1b40481c89107538d574ba8
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Feb 9 11:26:30 2008 -0800
-
- Revert all File::Stat stuff. We'll fix Dir first.
-
-commit 1f5bc0f98a23fc90b9bd00048af1551df8e534f7
-Author: Brian Ford <bford@engineyard.com>
-Date: Sat Feb 9 00:39:20 2008 -0800
-
- Reduced File::Stat.stat primitive further. Details follow.
-
- * Added ffi_major and ffi_minor to calculate the major, minor
- parts of st_dev and st_rdev.
- * Added (temporary) new primitive basic_stat to change the
- return type from a tuple to a single MemoryPointer instance.
- * Added simple specs for rdev, rdev_major, rdev_minor, nlink.
-
-commit e478731a2fc558c62cecbe327c5b35882d90b53d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 8 16:45:05 2008 +0100
-
- One more rubyspec for File#open.
-
-commit 5f6ac709500cb64df110a44d31e0c0b89dd68aec
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 8 16:39:47 2008 +0100
-
- New rubyspecs for File#umask.
-
-commit fddaa684bd7e8c403ff96179ca71a5837f609b63
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 8 16:30:20 2008 +0100
-
- New File#chmod rubyspecs.
-
-commit ed20c3f9f36f343a37e2ac05ea91d84b54c87bc8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Feb 8 12:00:57 2008 -0500
-
- Correctly guard Bignum specs for CI
-
-commit 36e9749984d6e4412c26d348afa8c501cf043ecf
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 8 13:09:37 2008 +0100
-
- Some more specs for File#new and File#open, and permissions.
-
-commit 29376695550c5608f466d63d49de76a6ee163e37
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 8 12:10:27 2008 +0100
-
- New specs for IO#new and IO#open, invoked with permissions parameter..
-
-commit 8cf27fcd86f88b75716b65dc1d94b721c01c3af9
-Author: oleg dashevskii <be9@be9.ru>
-Date: Fri Feb 1 21:03:08 2008 +0600
-
- Heredocs and more stuff added to string_spec.
-
-commit 2cccd38a081c0303f8fa567058e4c26fa354abc5
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Feb 8 12:51:53 2008 +0100
-
- Add exclude for currently failing for_spec
-
-commit 031bb1b565a3446ab995ea55e6ae8890573ba6c0
-Author: oleg dashevskii <be9@be9.ru>
-Date: Fri Feb 1 20:23:56 2008 +0600
-
- Added more tests to for expression spec.
-
-commit 73e40331c6b4c1c1b6e41ae312299f6815e089c2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Feb 7 19:12:46 2008 -0500
-
- Add a failing spec for Array#join and then fix it
-
-commit fa49548fe704252c352a1bc4833b5da20262061a
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Feb 7 23:12:03 2008 +0100
-
- Fix last two Failing Time specs for Time#+ and Time#-
-
-commit e4e51c6aa39e5a5a61b0df919ba02b88d4878f43
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Feb 7 22:35:57 2008 +0100
-
- Fix Time.at so it also works with floats
-
-commit f5505522fd0396c3864fce155681ac577bf2e7e6
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Feb 7 17:10:48 2008 +0100
-
- Fix Time#<=> for objects other than Time
-
-commit e8ab7b5eb30da84262a9395e20ac420e83674edf
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Wed Feb 6 13:59:18 2008 -0800
-
- Only call Class#inherited once
-
-commit dc9ff28ae919292287f5562b8c105ff6310c5920
-Author: Phil Hagelberg <phil@hagelb.org>
-Date: Wed Feb 6 15:00:59 2008 -0800
-
- Kernel#eval should be a module function
-
- Added a spec as well
-
-commit 7dd83410a2159fd65f951689a8a1297baded4fa6
-Merge: 698ffa4... 339fed9...
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Wed Feb 6 22:54:12 2008 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 698ffa4e04fee58da5c3f2191372c4e4f2bc070d
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Wed Feb 6 22:51:54 2008 +0100
-
- Adding missing specs for ftools
-
- * specs for chmod, compare, copy, install, makedirs, move and safe_unlink
-
-commit 339fed9821b75de056febc406b32fe52ff9354a9
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Feb 6 22:00:46 2008 +0100
-
- Forgot to remove spec excludes...
-
-commit 7ecca7222823a82252ed09b17eefafe6fec9f12e
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Feb 6 21:46:19 2008 +0100
-
- Fix last two failing Dir#glob specs
-
-commit fec39f27d287ca74becbecc120de8533e346b864
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 18:13:13 2008 +0100
-
- A few more corner cases fo IO#lineno specs.
-
-commit 3691d3f9a202abb22e11024e41b868d531a549be
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 18:02:50 2008 +0100
-
- New rubyspecs for IO#lineno.
-
-commit a5b0f9aa15c9372f74816e77073926780a9cc219
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 15:58:26 2008 +0100
-
- Improved IO#foreach specs.
-
-commit 91ea9f304c75592e7454411ef21391a0e34da5e5
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 15:03:02 2008 +0100
-
- New rubyspecs for IO#gets and IO#foreach.
-
-commit 9c494786fbf400bb295e1f19d142e2c903c21e54
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 13:37:43 2008 +0100
-
- New rubyspecs for IO#foreach.
-
-commit cdbbeba8f3351fe43f44d732348f380599ad5719
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 10:40:13 2008 +0100
-
- New rubyspecs for IO's sysread and read with buffer argument.
-
-commit e1cb4410b7e0a0ba2fd580784334bdfd05ba4b8a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 10:15:29 2008 +0100
-
- Excluded rbx failure after spec rename.
-
-commit 1fde018b9378b55f6d51cb85bd65813b5cef5493
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Wed Feb 6 02:50:44 2008 -0600
-
- Tidy up an apparent copy/paste mistake in IO#syswrite spec
-
-commit 1aa624e625dafaeebd70eac11819f02ecf570f8e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Feb 6 00:19:39 2008 +0100
-
- New IO specs for writing non-string data.
-
-commit f94a0cffd5fd0e186a9403d97800b55f8c44bdd1
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Feb 5 15:13:47 2008 -0800
-
- Regenerate zlib stubs.
-
-commit 52ce0e702170676ce02dcc288305097d58834cf8
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Feb 5 13:34:47 2008 -0800
-
- Add Zlib spec stubs
-
-commit b24ad594837b974a3ae3b207d63ce5cdc956a1a0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 5 21:45:09 2008 +0100
-
- Added some boundary test cases for Float.
-
-commit 1a8c9966fa148fc3e912f8aecd42c8c00ca4f89c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Feb 5 22:46:18 2008 +0100
-
- Removed problematic Marshal spec because 2**40 is a Bignum on some archs and a Fixnum on others
-
-commit 6ad8a0a25f20fd137bcb7fcb83bc88440a2a2069
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 5 17:03:56 2008 +0100
-
- Eliminated file descriptors leakage out of IO tests.
-
- These things make runs unpredictable, causing all kinds
- of troubles (non-deterministic failures, fluctating
- number of tests).
-
-commit 95ac3cb9900c52e4819b37166c71840d4bb4e3d9
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 5 14:50:31 2008 +0100
-
- New rubyspecs for File.open with block.
-
- Also, IO.open specs improved to handle closing better.
-
-commit 66f636c346a63853ae37a06f1c3e8b5083370892
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 5 13:22:34 2008 +0100
-
- New tests for IO.open, and additional cases for IO's inspect and stat.
-
-commit dfb941da0f7503bce58dc88a85ccfd201615e13b
-Author: Brian Ford <bford@engineyard.com>
-Date: Tue Feb 5 01:57:20 2008 -0800
-
- Ezra's patch for Regexp#inspect, #309.
-
-commit c5f9381ee74ed2d9c91cca1dd2ce9719b6f51bd8
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Feb 5 10:07:57 2008 +0100
-
- Corrected IO test to not interfere with Kernel#puts tests.
-
-commit 751293c1ea14de1b1d2757bf5d60b082cc771e7a
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Feb 4 17:43:06 2008 -0800
-
- removed empty excludes
-
-commit 206399aee9ae7845d76c0726702c424b9fc44e80
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Feb 4 17:39:45 2008 -0800
-
- StringIO#seek now raises if passed bignum offset - should be platform specific, but this'll do for now
-
-commit b00f04ec0fcd8f8edf9943abb5999f1cca9e9e9e
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Feb 4 17:06:34 2008 -0800
-
- Knocked off the last of the method excludes.
- Tightened up the spec for #to_s
-
-commit 3d4f87741135343a2e8ec6032fa3a69529cfbf69
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Mon Feb 4 16:51:37 2008 -0800
-
- Fix Hash#key? to work with objects that have the same #hash.
-
-commit f814a15639f6e6ecd47ab99ad9e37e93fd6bc165
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Mon Feb 4 15:17:08 2008 -0800
-
- Fix Marshal format version check
-
-commit 6d9e0afb5600416e5d66d5123abcfa5dd6c40903
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Mon Feb 4 14:24:48 2008 -0800
-
- removed tmpfiles from dir/fixtures and moved them to tmp where they belong
-
-commit 4e18d1cf49573b1fa3f484686352734aa39457d0
-Author: Ruben Nine <ruben@leftbee.net>
-Date: Mon Feb 4 02:32:26 2008 +0100
-
- Added support for tag:yaml.org,2002:sym to RbYAML library.
-
- Signed-off-by: Jonas Pfenniger <zimbatm@oree.ch>
-
-commit 220ed05f204f4b8fe7f1f303fae9a18988f8879b
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Feb 4 17:16:44 2008 -0500
-
- Use an example number that is actually a Bignum everywhere in compiler Bignum spec
-
-commit db3f20c8ec905641de887bbd1ed581aa78f73471
-Merge: e33350e... 6e3dad3...
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Feb 4 16:50:14 2008 -0500
-
- Merge branch 'wilson64'
-
-commit 6e3dad3e5b2e982f96e991e9df2d46de5bf4ee1f
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Feb 4 16:49:09 2008 -0500
-
- Use the correct Fixnum#size spec on 64bit platforms
-
-commit e33350eddc3441b2ebe06336500e6445406285d1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 22:12:14 2008 +0100
-
- Moved one IO#inspect spec to File#inspect specs.
-
- Since the behavior is File-specific.
-
-commit 1586e3a2c5d12f5438adddb8c84bc90c3defee82
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 20:57:09 2008 +0100
-
- Add more IO specs. God, make it stop!
-
-commit e64f3b02423acb783ba8a62996847b0393e7f3ee
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 20:33:57 2008 +0100
-
- And more IO specs.
-
-commit 3d584f0ee2cf988720bb5985c20b3bec6c2e143f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 20:08:26 2008 +0100
-
- Next batch of IO methods specs with closed streams.
-
-commit 6e22a99350195cfa7a40d6049d6d72a9ae7e1168
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 19:47:06 2008 +0100
-
- And yet more specs for IO methods with closed streams.
-
-commit 12e8d881b90cbd60bc792693e799923fdb1041b0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 19:20:39 2008 +0100
-
- More rubysecs for IO methods invoked on closed streams.
-
- Plus some refactoring to move repetitive code to the fixture.
-
- NOTE: two specs marked as fails_on :rubinius due to fact
- that they crash rubinius.
-
-commit 3ae3cafcb10725953c8e595641af277f36c88677
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 18:39:34 2008 +0100
-
- New rubyspecs for IO#to_io.
-
-commit 4980bb83f53845e88cd0d1a3b0823fdbf0c0a001
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 18:09:36 2008 +0100
-
- New rubyspecs for IO#ungetc.
-
- Unfortunately, MRI doesn't follow some of its own
- specified behaviors...
-
-commit f27fe4f3e4ccb298dcaa5014dac69d3148ee169e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 17:18:08 2008 +0100
-
- Added rubyspecs for IO's putc, puts, printf, print and closed streams.
-
-commit a1d7b67942aed8d1b185476dee6f2d99403ed227
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 17:07:00 2008 +0100
-
- Added rubyspecs for IO#pid.
-
-commit cfa1ef21ce862a05ae352a4fe49a3ac4c04b9bed
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 16:36:21 2008 +0100
-
- Added new rubyspecs for IO#sync and IO#sync=.
-
-commit b4f6c33c17e57fa44322124af088a97d475905e2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 16:20:50 2008 +0100
-
- New exclusions for rbx.
-
-commit 60309280c48b2bd1f1d8a5ea018f401e75b7dac1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 16:17:27 2008 +0100
-
- Added new tests for IO's pos, pos=, rewind, seek on closed streams.
-
-commit 40414ad1b39222494ff2a79a0091890a60b7adf1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 14:26:13 2008 +0100
-
- One more test for IO#eof?.
-
-commit 29db340f24c043b240fec6722c323fa1567ce855
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 14:19:46 2008 +0100
-
- Added new rubyspecs for IO#getc and IO#getchar.
-
-commit 0e0a987782fc7834ba95a2e8e2c8ab6cd8dcea81
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Feb 4 13:54:59 2008 +0100
-
- More rubyspecs for IO#eof?.
-
-commit f7d1139e4eace4a86f0c0512bf9269964442628d
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Feb 3 15:55:10 2008 +0100
-
- Fix Date#strptime specs
-
-commit ac4600fcb42928aeba508371aea2f76510e70d5c
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Feb 3 13:26:52 2008 +0100
-
- Fixed Time specs for non Rubinius platforms
-
-commit a5081ca646e99ec94fedfabf03b7eb0a8d37afc3
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Feb 2 23:53:52 2008 +0100
-
- Fixed Time specs for 64 bit archs
-
-commit 26eef47571b921fe6b3228033119e5969c4100db
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Feb 2 13:30:16 2008 -0500
-
- Updated IO excludes.
-
-commit 8edd73d9915f72ee70b661b23e8b42f8b985fa9c
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Feb 2 10:45:23 2008 -0600
-
- Repair IO#sysseek spec to not write to fixture file; uses a tmpfile now.
-
-commit bf6348c935c816a981672e9c26a40354cf0d722c
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Feb 2 02:35:42 2008 -0600
-
- Additional IO#sysseek spec for the warning after buffered writes
-
-commit 5241316a1c74e6580fb91940a9f061047e89cdbf
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Feb 2 02:32:36 2008 -0600
-
- Modify IO#seek specs for IO#sysseek, adding appropriate error tests
-
-commit 7f124cbf66b96fdcdaec73917e86eedfb4a9ddf8
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Fri Feb 1 18:05:15 2008 -0800
-
- Refactored Marshal#dump specs and merged with fixtures/marshal_data.rb
-
-commit 3766b3ed41ffba71ecb1bef8079027bffe518e2a
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Fri Feb 1 16:54:32 2008 -0800
-
- Refactored specs for Marshal#load
-
-commit e134d5bf8e247f4a231bfbfc1c3251b262f219e4
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 1 15:36:06 2008 -0800
-
- Update excludes for recent failures
-
-commit 8ded8b443f55b47a1c30b59cfb0d96d8752d5fa9
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 1 15:11:37 2008 -0800
-
- Process.group spec is missing a suplemental group on OS X
-
-commit 4b7de6ff839b220115dd29f34b5a9f46cb8f5bef
-Author: Evan Phoenix <ephoenix@engineyard.com>
-Date: Thu Jan 31 17:16:13 2008 -0800
-
- Add proper primitive failures, fix empty symbol.
-
-commit dc55c88beee6a3a3a7fd352c1e374ecf84863459
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 1 16:17:00 2008 +0100
-
- Fixed 2 Date#strptime specs that otherwise would pass only in January.
-
-commit 86c372d0fb50aeb6235ed1595d18a876e09330db
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 1 15:32:40 2008 +0100
-
- Few specs for Time#<=> with non-Time arguments.
-
-commit 765ef93acd294922dc22a986213a5842ce3e67a7
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 1 14:09:01 2008 +0100
-
- Added more specs to Time#+ and Time#-.
-
-commit af76adac2182e46e34e68d29b3cd8614edd27d50
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 1 13:38:20 2008 +0100
-
- Added more test cases for Array#join on recursive arrays.
-
-commit bb15b72393b34d3d10bb644fb1d6ce47b6dc0826
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Feb 1 13:15:24 2008 +0100
-
- Added more test cases for File::join with recursive arrays.
-
-commit 7041b2aef1e574dfe220a70da5210c683074f8ae
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 1 03:18:31 2008 -0800
-
- Describe an unambiguous method.
-
-commit 84edf54799e0ccd09276a5cda3fccf544f971c48
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Fri Feb 1 03:07:48 2008 -0800
-
- Use fixed Marshal data for all specs and fix many broken or useless specs.
-
- Clean up spec naming and definition.
-
- Use descriptive names for test classes.
-
-commit e0c3aa074c9525450a7a667ec2cc843ff3560e65
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 23:29:57 2008 -0500
-
- Hash.new patch from Phil Hagelberg + MethodTable workaround.
-
- * The Hash.new patch splits a separate #setup method so that subclasses
- can override #initialize without problems.
- * Because it is part of the core code, MethodTable needs to explicitly
- call #setup in its #initialize.
-
-commit a32f16d9288c5c0822cc6962ce3caed5e1bac5d0
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 15:35:08 2008 -0500
-
- Updated Module excludes.
-
-commit df731f327c4d47373ba6f2fe2f79d5d9acbf398e
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 15:30:11 2008 -0500
-
- More Module#module_function specs in #eval and #module_eval.
-
- * #module_eval separates the two scopes but #eval does not.
-
-commit 6358e5893c52042c10c355173d1ad8441a00bcfa
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 15:13:49 2008 -0500
-
- Better Module#module_function specs.
-
-commit 1646bb6e99a6b4190641046ae730ea1be9c8be2a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 13:59:20 2008 -0500
-
- Various whitespace removal in preparation to fix #module_function.
-
-commit 108601d85d2c41d05f9c00945664d9980e0e46c3
-Author: Evan Phoenix <ephoenix@engineyard.com>
-Date: Thu Jan 31 13:39:53 2008 -0800
-
- Add meta_send_call instruction, speeds up calling blocks
-
-commit 50f9c50820b4305877af1c7fd7597c5dc94c623c
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 12:20:11 2008 -0500
-
- Added LC_ALL=C for all other platforms for Time specs too.
-
- * If it breaks, report and we will figure out something else.
-
-commit 26059c1570c5ad2a64a796e2678ff2d9ace23e58
-Author: Pierre Yager <pierre@levosgien.net>
-Date: Tue Jan 29 22:48:22 2008 +0100
-
- Fix for bin/ci spec failure on localised linux
-
- * Force system date to be executed against "C" locale
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit e5ce9e7c29a34f685f7d3f8a9f855db28aece460
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 31 11:32:56 2008 -0500
-
- Removed trailing whitespace for Time and some Time specs.
-
-commit 3546f721ac86efa318b3802a2f498d41aa830c9f
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Thu Jan 31 10:53:53 2008 -0500
-
- Subtend: Add rb_define_private_method, rb_define_protected_method, rb_define_module_method, etc.
-
-commit 7553cb993a0c7e60c2212800b0ecc033ffc0b206
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Thu Jan 31 10:39:08 2008 -0500
-
- Add rb_class2name in subtend
-
-commit 4570b7c5d837025d765a6a2909d5536c466b9dcb
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Jan 31 02:26:09 2008 -0800
-
- quick addition of 2 exclusions
-
-commit 53c76326e76869a87ad0fc67adbd3aef9059ee35
-Author: Ryan Davis <rdavis@engineyard.com>
-Date: Thu Jan 31 02:15:15 2008 -0800
-
- Parser spec updates
-
-commit 8fb2eb68858a1ee1dafb06b833f43d6da817756f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 19:29:25 2008 -0500
-
- Slightly more permissive TCPServer.new spec for hostname string.
-
-commit 2a60dbbf011e806ae51c30ab2cb2b8e7b9b633a5
-Author: Mutwin Kraus <mutwin.kraus@blogage.de>
-Date: Wed Jan 23 18:41:12 2008 +0100
-
- Fixing TCPSocket#new for localhost (with specs for both IPv4 and IPv6)
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit f485a6818a754c8110feafa9f6dced42a99187d0
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Tue Jan 29 21:13:28 2008 -0500
-
- Making Enumerable#inject only accept one paramter
-
- Uses 'Undefined' idiom, which fixes spec, and cleans up code (thanks
- for the pointer Eero)
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit ebfa5a0bf9f8e3efe61c0d34fe63a8cd74b7ddf8
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Tue Jan 29 20:52:16 2008 -0500
-
- spec to verify inject accepts one argument, at the most
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit b131b80df72a9ceaa9e920b7f78434f301135a6f
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Wed Jan 30 00:33:03 2008 -0500
-
- Adding Enumerable#count spec, including a few failing specs.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 82b63bc0f5b79735a8021b6c5c69786dc76fa7f6
-Author: Alexandre Perrin <alexandre.perrin@epfl.ch>
-Date: Tue Jan 29 15:59:22 2008 +0100
-
- udpdated language/string_spec.rb
-
- * added spec for class/global variable with the \# simple interpolation
- * added spec for ends of a \# simple interpolation
- * added more delimiter character with the percent String construction
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit c58110bde52d64b30cf36ba3cb342357f3654812
-Author: Evan Phoenix <ephoenix@engineyard.com>
-Date: Wed Jan 30 17:19:26 2008 -0800
-
- Fix break. It now uses LRE to properly return to callsite and appear like
- it returned.
-
-commit 45109c222502de955d705f810333d8e7b331c953
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 31 00:42:12 2008 +0100
-
- Added Date#strptime specs
-
-commit fe60e6a022d9e64bb568ccd47494f07a99382c58
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 11:36:46 2008 -0500
-
- Updated excludes for Marshal. Looks like Fixnum/Bignum issues.
-
-commit 209dde412310edc384be7d4a86bdfb0444f3b3bf
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 01:45:27 2008 -0500
-
- Updated IO/File excludes.
-
-commit 91031e51e49a1a3ddb9f74da31e2ed65c48e1ef5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 01:43:11 2008 -0500
-
- IO.new and IO#close use stream API.
-
- * IO.new uses fdopen() to open the given fd which also checks the mode
- string for us. The returned FILE* is stored as a MemoryPointer in
- @fptr.
- * IO#close checks for presence of @fptr and if found, uses fflush() and
- fclose() to release the handle instead of going the normal route.
-
-commit f4d64553a2a53c77235ef9acc3353ac455514057
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 01:20:32 2008 -0500
-
- Made probably broken File.open spec compliant_on :ruby.
-
- * File.open should not take three args. File.new does.
-
-commit dc496f35502b4642137d3f0f74571c8245a6ae56
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 30 01:19:29 2008 -0500
-
- Slight IO.new spec tweaks.
-
-commit a9d9288315e88cffd59ec1b27e3c3209ceb1a3a9
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Jan 29 20:32:44 2008 -0500
-
- Combined IO.new and IO.open specs for the shared parts.
-
-commit effa81cce1d42f7c1bc2e275cb75bd9069e934b8
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Jan 29 19:14:51 2008 -0500
-
- Changed specs to use the two-argument IO.new.
-
-commit 1394b360fe70966e25809a349b400a69262060ca
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Jan 29 14:56:47 2008 -0500
-
- Rewrote IO.new specs (still a bit sparse.)
-
-commit 94d50eb3e60971ffeff28bffa0beaff405c581bd
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 30 21:47:35 2008 +0100
-
- File#utime specs to use be_close rather than ==.
-
- On some platforms, direct comparison just doesn't work,
- producing non-deterministic test failures.
-
-commit 0f5574c28ff08c96326298b98b4ea50108168044
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 30 13:13:25 2008 +1100
-
- Remove race in debug_context_change specs
-
-commit 00a62c3476dd0717f5c4caece453914e1392de9d
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Jan 29 14:39:06 2008 -0800
-
- Remove bogus Marshal specs for Fixnum/Bignum changeover
-
-commit db1b140db0fbecf70f8adda983e010ef2bbe94c4
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Jan 29 22:58:18 2008 +0100
-
- Finished first version of Date specs. All public methods are specced
-
-commit 8ee52fd8dfd3ef6048c63b30d8aea71da944abb2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 29 17:21:57 2008 +0100
-
- Follow rbx lead, and allow deviation in UnboundMethod#== for JRuby.
-
-commit f670bcb9e086ac9cc73b6ef6083966b296268f04
-Author: Caleb Tennis <ctennis@engineyard.com>
-Date: Tue Jan 29 09:46:50 2008 -0500
-
- Fix typo
-
-commit 4e990269fd42aabd48cdc29b4288c78984d0e5cf
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Jan 29 02:44:20 2008 -0800
-
- Add File::join recursive Array spec.
-
-commit 4d947218e949e19515a9e89af99d4823048f3bb2
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Jan 29 02:41:54 2008 -0800
-
- Fix File::join spec name, duplication
-
-commit a38e10ddc19ebd59f8775a01f3e899c5348ba23f
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Jan 29 02:40:37 2008 -0800
-
- Make File::join remove extra / appropriately.
-
-commit 074251c03093ba40c0fc3558d512a77844ac45aa
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Tue Jan 29 00:53:23 2008 -0800
-
- Make File::join specs more clear, remove whitespace
-
-commit f968bbe15a27d8ac6716d103119d41c4eef37696
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Mon Jan 28 18:07:24 2008 -0800
-
- Use const_lookup in Marshal, fix #marshal_load.
-
-commit 7e00b857f56879564c1bf27f2e694f3c0783a4bb
-Author: Eric Hodel <ehodel@engineyard.com>
-Date: Mon Jan 28 17:23:26 2008 -0800
-
- Support nested modules in Marshal
-
-commit 5c6e2af3d9ace07ca8387c5aecaa5c1d85e8d81f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 28 20:22:40 2008 -0500
-
- Added specs for rest of the filetypes to File::Stat#ftype specs.
-
-commit 221a077bef5e9007b548993eaf16c86137c6b0b3
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 28 20:08:12 2008 -0500
-
- Added support to spec file type against sockets too.
-
-commit 9cb4791db10bc79f8c30a86f17e6c099dabeea80
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 28 19:52:07 2008 -0500
-
- Moved File and File::Stat-related fixtures to fixtures.
-
- * Module FileSpecs defines methods that yield filenames corresponding
- to specific file types so they can be easily tested.
-
-commit c28c85602d3ab6770ed567a64b744baa15795511
-Author: Ben Hughes <ben@pixelmachine.org>
-Date: Sat Jan 19 16:10:36 2008 -0500
-
- Added spec for File::Stat#dev, dev_major, and dev_minor
-
- * Check that the result values are Integers for each operation
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 86ce52e32a35cb11564d0d5f306f4eea6d6b714d
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Jan 22 15:21:38 2008 +1100
-
- Added yield_debugger on context change
-
- Added capability to set a flag in the VM that causes a
- yield to the debugger to occur immediately following a
- change in the active context. This provides a foundation
- for step in logic for the debugger, which need only set
- a flag on a task and have a breakpoint triggered at
- whatever receiver is activated following a send.
-
-commit 3904ff2fbb209b8c2d476bb3f4a4ea4825a16f6e
-Author: Brian Ford <bford@engineyard.com>
-Date: Mon Jan 28 17:58:35 2008 -0800
-
- Fixes for mSpec to coexist with autotest.
-
-commit 45f2d6de4b025acfa2429d88c729a3eb58a79528
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Mon Jan 28 17:08:45 2008 -0800
-
- Added more brains to .autotest. Removed bad files that it pointed out
-
-commit 70eaa7feffcfd552c51b67a651cdf6063c9b549a
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Mon Jan 28 15:57:24 2008 -0800
-
- Add File::Stat#dev.
-
-commit 020f4bec691ba658fab0f1ff24fa5df5a6f1921f
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Mon Jan 28 16:13:11 2008 -0800
-
- Added enough process spec exclusions to drop the HUP issues
-
-commit 76b393566f2a89001952dbf1ec46dd52a5750448
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Sat Jan 26 10:58:42 2008 -0800
-
- Fixed autotest support (needs latest version of zentest).
- Minor clean up on bin/ci and kernel/core/module.rb.
- Hacked mspec/matchers/base.rb to output with pretty print.
- Fixed mspec's runner to output time BEFORE failures. Fixes unit_diff.
- Updated Parser excludes.
- Deleted a bunch of excludes.
- Updated spec/parser/sexp_expectations.rb with latest ParseTreeTestCase.
- Started adding a rewriter to make maintaining sexp_expectations easier.
-
-commit d147f6f0a87e30e240750d8c660bc89f8c84a472
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Mon Jan 28 18:20:38 2008 -0600
-
- update CI excludes
-
-commit 159f17a228fa6a42cea79b9e3663e1f2b9dea9e4
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Mon Jan 28 18:07:56 2008 -0600
-
- add Marshal specs
-
-commit 72e739590b6bbe571607df674e2f4106c64c8042
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Mon Jan 28 15:15:26 2008 -0800
-
- Fix String#gsub when matching '^'.
-
-commit fc8c2c5584305b3e0b2a74ba8250a0b7072a372f
-Author: Ben Hughes <ben@pixelmachine.org>
-Date: Sat Jan 19 16:20:55 2008 -0500
-
- Added specs for File::Stat#ftype. #264.
-
- * Tests "file" and "directory"
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 2f9872b66d4dffc82e0a97e617fb9de18105f668
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 19:56:06 2008 -0500
-
- Better living through mocks. String#+ spec cleanup & correction.
-
- * String#+ in fact raises a TypeError when given ANY non-#to_str
- object.
- * Simplified spec code.
-
-commit f5a0f1e0e401db8f28727cdd8be99228c9c6aee3
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 19:37:08 2008 -0500
-
- Removed trailing whitespace in String.
-
-commit 03c1c270236786b66930063669b95ac7cbf17f10
-Author: Matthew Draper <matthew@trebex.net>
-Date: Thu Jan 10 22:40:35 2008 +1030
-
- String#+(65) throws a TypeError, unlike String#<<(65).
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit a17ede3e9c85c1bd2e06efa7381c1e5dbab47f80
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 19:10:33 2008 -0500
-
- Minimal IO#open specs, IO#sysseek. Merged from Chen Yufei's patch.
-
- * Merged patch by hand, most of it was already implemented separately
- too.
-
-commit 30116d672d950687646c1668eac4d9f5b10f4df7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 18:53:19 2008 -0500
-
- IO#readline EOFError spec modified from Chen Yufei's patch.
-
- * Patch was out-of-date, applied by hand.
-
-commit 1b81e68249741d53b38857440bba897987d00e43
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 17:44:30 2008 -0500
-
- Separated and excluded NUL byte stripping for String#lstrip specs.
-
- * Rubinius does strip leading NULs, MRI does not.
-
-commit 55f50888f22288b0fa45298d873dd265d7340aec
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 16:52:51 2008 -0500
-
- Updated various excludes.
-
-commit b085f63d66519f93b59e3851b7e6796877e97107
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 16:47:24 2008 -0500
-
- Documented Method, deleted unnecessary Method#module spec.
-
-commit f71f5c91e8ceab59d59614fe885dfeff096d7655
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 15:41:26 2008 -0500
-
- More precise specs for Method and UnboundMethod #to_s / #inspect.
-
- * Checks presence of own class, method name, name of the Module where
- the method is defined and name of the Module where the method was
- extracted from.
-
-commit 400b522d27515698e0a35b2507a4a8825ec9bf8f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 15:22:46 2008 -0500
-
- Rewrote Method#unbind specs, touch-up for Module#instance_method spec.
-
-commit 57bddb7b38dbb762b2469c51eb961e01f03c8518
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 14:50:38 2008 -0500
-
- Updated UnboundMethod#== spec for Rubinius/MRI difference on Modules.
-
- * Rubinius' UnboundMethod#== is true for methods from included Modules also.
-
-commit 8503c92f914d72e72eeeaede225f52242a1afad9
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 14:25:29 2008 -0500
-
- Rewrote and added Module#instance_method specs.
-
-commit 8541f4cf83f8b776276e81ca41eb0f7b595e4fb7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 13:43:36 2008 -0500
-
- Improved/added UnboundMethod#bind specs.
-
- * Removed unnecessarily specific error message check. Exception type
- is plenty.
- * Specified correct behaviour only in terms of Method since a Method
- is returned and anything after that is not #bind's responsibility.
- * Rubinius allows binding to any object that is kind_of? with respect
- to the Module that the method is *defined* in. MRI requires that it
- can only apply to objects of the same Module that the method was
- extracted from.
-
-commit fc7073c85b5e201265e24a82c19bd6413681f6e1
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 13:02:24 2008 -0500
-
- Removed trailing whitespace in UnboundMethod#bind specs.
-
-commit bde0cacff5f061accab7feb8a27b2417456f2f95
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 12:38:39 2008 -0500
-
- Specced Rubinius to deviate in UnboundMethod#==.
-
- * MRI requires that both UMs were extracted from the exact same
- Module. Subclasses etc. are not OK even if the UMs both refer to
- the original in the parent. This is somewhat nonsensical and
- harder to implement so Rubinius allows it.
-
-commit e7ba146d3d0ef0aed1d297d157008661458723eb
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 12:16:07 2008 -0500
-
- Much more comprehensive and precise UnboundMethod#== specs, documented.
-
- * #== has some stupid behaviour but this is what we get.
- * Explanation of criteria in the method doc.
-
-commit 43f2226c8882900a472f0a5347fa549936e8f000
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 09:37:51 2008 -0500
-
- UnboundMethod String representation specs improved.
-
- * Specs require that the returned String contains this object's class
- and the [Module]#[method_name] it was extracted from.
- * The spec specifies nothing else about the format or order etc.
-
-commit 67e3b5993d92776e0c9535549e8ffdb172225d52
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 09:11:19 2008 -0500
-
- Trimmed whitespace for kernel/core/method.rb for patching.
-
-commit c61c5185589cf5a86b58b2e8c8b8d7a26cdc25ec
-Author: Scott Taylor <scott@railsnewbie.com>
-Date: Mon Jan 14 00:23:27 2008 -0500
-
- fixing the specs for UnboundMethod#inspect
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 48bcca32329d48a20d5a6f2dd19598ea7b4167ce
-Author: Scott Taylor <scott@railsnewbie.com>
-Date: Mon Jan 14 00:16:24 2008 -0500
-
- UnboundMethod#==, plus an extra spec
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 232015fed94b59adf627a7712da0d5d4d44c87d0
-Author: Scott Taylor <scott@railsnewbie.com>
-Date: Mon Jan 14 00:03:32 2008 -0500
-
- UnboundMethod#bind
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit fcd0139307fd48f78f122457af1af43a543343ce
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 12:11:34 2008 -0500
-
- Updated excludes for IO#write.
-
-commit eed253158fe0cc20b91f6c8dcc06f6a671092d84
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Sat Jan 26 14:36:33 2008 -0800
-
- IO#write calls #to_s on it's argument
-
-commit bb5ff251bcc4baceac25a3a1fa64797b94551145
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 03:22:02 2008 -0500
-
- Updated #attr_writer spec that was picking up a stray method.
-
-commit fa985a57f6cf802d6a83a6d02a31dd7fd33ebd36
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 01:20:27 2008 -0500
-
- Module#const_get can now access top-level constants for Modules also.
-
- * Modules explicitly check Object last, Classes already do it since
- they all inherit from Object.
- * Added some more specs too.
-
-commit fbc1cfb2d461891ee478802f44de3736959905a7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 00:47:52 2008 -0500
-
- Renamed the Module field 'parent' to 'encloser.' Some docs.
-
- * When dealing with Modules and Classes, 'parent' is an ambiguous term.
- In typical OO literature, 'parent' means the superclass which is not
- the case here. Two separate sections of code already showedsome
- uncertainty about the intent of this field.
- * Added a few bits of documentation to Module.
-
-commit 92903e92564857350061d83f8eb3b54886986ac3
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 00:36:10 2008 -0500
-
- Updated Module excludes.
-
-commit a705e687ce0d55e7ea184e1a3e67ba8d9d7c610c
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 27 00:24:20 2008 -0500
-
- Improved Module#const_get specs for better coverage.
-
-commit bca6aef9b81166f9c5f4aeaafc673a54710d4d35
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 19:57:33 2008 -0500
-
- Corrected semantics of spec statements for Module#const_get.
-
- * Specs were correct but the description was inaccurate.
- * Prettified just a little.
-
-commit f699c18b68dee73086afb92d15b61745319a5321
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 19:55:40 2008 -0500
-
- Module#const_get specs for top-level constants by Le Huy.
-
-commit f3831a0693ea90271843bcc5910516e5a40ed3c1
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 19:15:27 2008 -0500
-
- Module whitespace cleanup before patching.
-
-commit e3cbe8136351f055bd99f10646d4f77515078430
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sun Jan 27 00:51:55 2008 -0600
-
- A few basic IO#write specs for file IO
-
-commit fd05adfedf70d795d8d91f650d5b76b05104dd7a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 18:54:35 2008 -0500
-
- Specs for Enumerable#max_by (Rubinius extension.)
-
-commit 560b6460745c7821b9479b356c032a10daaa61ec
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 18:53:52 2008 -0500
-
- Specs for Enumerable#min_by (Rubinius extension.)
-
-commit 6ab0bc901bdc60bde1e251f72f0028dfb736a2dd
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 14:25:41 2008 -0500
-
- Updated excludes for Enumerable.
-
-commit 2e09eedb31e15c791e491e97bc2af1977a629c2b
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 14:20:19 2008 -0500
-
- Fixed Enumerable#max and #min nil problems using Undefined.
-
-commit d8e6ebf604fdcc228e9158336250dd29c6d35932
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Sat Jan 26 13:22:33 2008 -0500
-
- Failing spec for finding max when Enumerable contains nil
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 313ee6badb177c101e39e122c5b5d6ff4d73d93d
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Sat Jan 26 13:01:06 2008 -0500
-
- Failing spec for sorting a list that contains nils
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 467e8a60e0e25003894013e68f6d48e7bd6a22fc
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Sat Jan 26 12:01:15 2008 -0500
-
- adding failing spec for sorting enumerables that contain nils
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 8719a4ad46d7643c6e54aab3dffedb6831bde5f3
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 13:42:11 2008 -0500
-
- Whitespace cleanup before applying Enumerable patches.
-
-commit 015a0d023e8c649160800ddb8a269aa789266d51
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Jan 26 13:31:00 2008 -0500
-
- Added/changed the Dir open specs after previous simplification.
-
-commit 6735df441af2489d47674b0cc500dab37dd4319e
-Author: Jonathan Younger <jonathan@daikini.com>
-Date: Thu Jan 24 17:09:49 2008 -0700
-
- Simplify Dir#open spec dependencies.
-
- The "takes a block which yields the Dir instance and closes it after"
- expectation was failing because it depended on File.for_fd working
- properly with closed file descriptors which it does not.
-
- This revision removes the dependency on File.for_fd as well as
- IO.sysopen (which is not yet implemented in jruby) such that
- the spec now passes on ruby, rbx and jruby.
-
- Signed-off-by: Eero Saynatkari <rubinius@projects.kittensoft.org>
-
-commit 27834ebec570c78011eaaf37998272d46ab9d118
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Jan 26 21:51:13 2008 +0100
-
- Added Date#strftime specs and fixed some constants
-
-commit 767e58ec38af7c3bc78dd98541fb8235616e9691
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Jan 26 21:45:23 2008 +0100
-
- Add spec for Rational#round, works because of added Numeric#round
-
-commit 2497d3b7b9d6112356204dc429c3c368e1a65573
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 26 12:31:45 2008 -0800
-
- Templates for Rational specs.
-
-commit 5d63550a13cad4acbae3ae67e9ee9f672cbe5e61
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sat Jan 26 00:47:35 2008 -0800
-
- Revert back old date.rb, but use newer date/format.rb, with some fixes
-
-commit ecd3ee8a0a528f516283558585b86e729bd388ec
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 21:47:38 2008 +0100
-
- Updated not_compliant_on --> not_supported_on, where appropriate.
-
-commit 78ca098893d6231f74386eeadf0c30787f3dd2e6
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Jan 25 12:18:43 2008 -0800
-
- A couple of easy fixes, fix Time to handle 2 digit dates, pull in trunk date
-
-commit fe8433cda8ca49835e2581f35bbf0d31025e84c1
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 18:42:31 2008 +0100
-
- Better detection of AF_INET6 support in socket specs.
-
-commit 1834801229bf8b2c0abfea4c18448ed105691682
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 18:16:56 2008 +0100
-
- Added a guard for undefined AF_UNIX in Socket specs.
-
-commit 3af242cc180675272ee24d588f3328bc11342048
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 14:32:04 2008 +0100
-
- New specs for IO#seek, IO#pos=, StringIO#seek and non-fixnum args.
-
- Rubinius fails all of them.
-
-commit 0ef7d55ebb5108bd5cf2f951236c8fade3999dfb
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 13:42:08 2008 +0100
-
- New specs for String#unpack with 'Q/q' patterns.
-
-commit 907081db80262a1403f659433934ef707c2ddee0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 25 12:35:07 2008 +0100
-
- Adjusted socket specs, so they pass on MacOS (MRI/JRuby).
-
-commit 9cca76acbe066da357692a19d5af1c8f5e4601c9
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 24 17:31:38 2008 -0800
-
- Fix race in compiler version number, fix regex spec
-
-commit be18fcc2e0ee16f861f1e2bff0636c3288bce8d6
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 24 15:10:00 2008 -0800
-
- Be more flexible with set_priority (OSs are a bitch)
-
-commit 845336d81df42b5d1f93123ef148b78c2b220d25
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 24 13:46:08 2008 -0800
-
- Kernel flesh out, passes all but 1 spec now
-
-commit ab87e7641336dfb07f0ad99cc2881ec59a25053a
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Thu Jan 24 12:36:50 2008 +0100
-
- Changed __const_set__ to handle corner cases.
-
- * Kernel#__const_set__ is now the catch-all. It triggers on things like :
- M = 3
- M::M = 3
- * MAIN#__const_set__ is forwarded to Object
- * Module#__const_set__: logic has been moved here, it is no more and alias
- of Module#const_set because it needs to trigger a warning on re-assignment.
-
-commit 13dbdf62e802028cb61f9375196712f0b789ff37
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Jan 24 21:30:02 2008 +0100
-
- Added some SystemCallError specs.
-
- And exclusions for rubinius too.
-
-commit 75e2aac1d4b031fa36c8967549452436521b5eea
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 23 19:41:30 2008 -0800
-
- Rework Class.new and Module.new to initialize without VM help
-
-commit 2551e57644d091d44e5e2fa715a017a557a0b18c
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 23 19:03:51 2008 -0800
-
- Userland now uses __const_set__ for 'A = 3' syntax
-
-commit 400c5ceaf677aa2cd05a451c22144613ad7bdbe9
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 23 14:32:26 2008 -0800
-
- Introduce kernel/user land. Adds use of Module#__add_method__
-
-commit 9ee17f227ebe572b09d44b3b0d703b9f95717751
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 23 14:50:25 2008 -0800
-
- Fix Hash#clone
-
-commit bf4875d337017736bd94781c1bf4cd7500fae5f5
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Jan 23 22:55:02 2008 +0100
-
- Implemented Enumerable#inject fix
-
-commit 0bd07f50ba75910ab579e3356dae93bc32b695bd
-Author: Jacob Maine <jacob.maine@gmail.com>
-Date: Wed Jan 23 15:46:06 2008 -0500
-
- Enumerable#inject(nil) should yield nil as the first 'memo'
-
- * Currently yields the first element of the enumerable instead
-
-commit 319f937284e60acc156c6b7f91e56d460e65ac94
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 18:12:56 2008 +0100
-
- Excluded the IO#new spec.
-
-commit 04da4120d939603d4a64aab71bbf94ca202e04b2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 18:11:45 2008 +0100
-
- Added IO#new spec (block should be ignored, warning printed)
-
-commit 5617c3eb81a3f1d8f9a581695fe7897fadee500a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 17:50:48 2008 +0100
-
- Excluded failures after IO specs additions.
-
-commit 107a072689bc9b97842f049f4fab2860ab79237d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 17:48:34 2008 +0100
-
- Added specs for IO#open/popen, File#open with close inside block.
-
-commit bc3393a9041f8116d53bedfa6b604ec6dce3fd19
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 23 14:25:13 2008 +0100
-
- Revert "Added Module#name memoization spec". dbussink told me this behavior
- is not wished.
-
- This reverts commit ff411600202a59d00ffaca2c51330599c6b84966.
-
-commit 73e7d61d756cb7a06ea18b7f92c49bbebb06cc3f
-Merge: ff41160... 1dab607...
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 23 13:57:28 2008 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit ff411600202a59d00ffaca2c51330599c6b84966
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 23 13:55:36 2008 +0100
-
- Added Module#name memoization spec
-
-commit 1dab607a79b79b370eda4776daf07a262451aea0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 13:28:29 2008 +0100
-
- Added IO#close specs.
-
-commit c78091236495f4a16aa874de97cce3ec485c1f5b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 23 12:54:25 2008 +0100
-
- Added IO#close_write and IO#close_read specs.
-
- And all of them fail in rubinius. (not implemented)
- And most of them fail in JRuby. (recent bugs)
- They pass just fine on MRI 1.8.6 (p111 and latest)
-
-commit dc39943a4595855d64f23f9155a4e9cf658c39a3
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Jan 23 10:37:45 2008 +0100
-
- Small refactor of regexp_new
-
-commit 132ac4986a648dbf1354216145e5715a727a735b
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 23 00:14:34 2008 -0500
-
- Type.coerce_to no longer falls prey to identity fraudsters.
-
- * Type.obj_kind_of? directly uses the internal kind_of instruction
- so that overridden #kind_of? does not get in the way.
- * Type.coerce_to uses Type.obj_kind_of? for its checks so that
- Core can safely use it without worrying about breakage due to
- overridden #kind_of?.
- * Specs for both and a little documentation.
-
-commit 192882902154c9a68554337ccd1b8f3ee9aedd9e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 23 00:42:24 2008 -0800
-
- Remove Symbol#to_i and Symbol#to_int. Farewell bastard children.
-
-commit f854667ff62528fe541c8cf67b9a1b291598d654
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 23 00:35:29 2008 -0800
-
- Removed Fixnum#to_sym and Fixnum#id2name, as well as fixed specs
-
-commit eb6cbc3604c81cc093edb1c182be1e456b05bef6
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 23 16:30:22 2008 +1100
-
- Added specs for context iseq manipulation
-
- Added specs to test MethodContext#reload_method and
-
-commit fd5fb764ee21b354b75b84f34906663874a24639
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Jan 22 22:28:02 2008 -0600
-
- spec for DRb method call using a block
-
-commit a928762b48f7dc84bba0d43125063e9d8d54f183
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 22 19:15:10 2008 -0800
-
- Better test of #instance_method.
-
-commit c055a5981bf4ecfd2efc0df74adb071056ff83b9
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 22 15:40:59 2008 -0800
-
- removed remove_method_excludes.txt
-
-commit 08cb27454e7ae73e79bb432887dba917feaa1f92
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 22 15:36:36 2008 -0800
-
- Clarified undef/remove specs a bit.
- Fixed remove_method to raise NameError if you're not acting on local method.
- Removed some fails_on calls to make specs pass... gonna remove them all soon.
-
-commit 62d93ac7916ff0d56a5b40ae1b9b501f10081638
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 22 15:35:05 2008 -0800
-
- Fix up sysread and syswrite, disable testing for warnings on rubinius
-
-commit a482b17c4bfe9f40474839ba0cce2a37d8524c62
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 22 15:13:19 2008 -0800
-
- Remove stale binding excludes
-
-commit f45030d33a9e1fe3c6bc111401a893e5649239f7
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 22 15:03:37 2008 -0800
-
- Update Proc excludes
-
-commit 7f932fbdf5fa4e16df10d7731313d458ca21966c
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 22 14:55:50 2008 -0800
-
- Add Proc#==
-
-commit 811cbe8ef876ef452051a9b07b3c95dbf57a7d9f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 23:41:55 2008 +0100
-
- Removed debugging stdout from one spec.
-
-commit 2bf52de43bb90721d921f6d29504a8f098ed09b5
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 22 14:11:17 2008 -0800
-
- Removed a lot of passing specs from the excludes
-
-commit b0e5a9ba6577c301f2737682d745128e268ebdab
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 22 14:02:38 2008 -0800
-
- Fixed Symbol::all_symbols
-
-commit 68ae0b5acd647b9ebd73e53638b728cfaee6b6e0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 22:09:45 2008 +0100
-
- Revert "Completed MRI's Module#name spec with corner case."
-
- This reverts commit 970ede321d31ec75dd578866c683defe768fa356.
-
- This spec seems like an implementation detail rather than
- a specified behavior. It was agreed on IRC to revert it,
- and that rbx won't support it.
-
-commit cc0e45cab2167e0fbc1d29308a5dcb4e7e077319
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 22:06:28 2008 +0100
-
- Revert "Module#name memoization work."
-
- This reverts commit 7cd9fce4908aaeea9a35e273a3f15ed7ee7aa783.
-
-commit 996f9f4e5fc05f1b3aa618db3e1a4947730780b7
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 22 12:23:39 2008 -0800
-
- Fix LongReturnException to be terminated in the correct place
-
-commit f453121dd2f3b4d9506a3f1c1e61d24e46bc9083
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 20:53:45 2008 +0100
-
- Corrected Module#instance_method failing spec. It was failing on all impls.
-
-commit c1d59239ddea95e73e2edd3a97ed6e1113a35d3c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 19:58:32 2008 +0100
-
- Corrected Module#instance_method spec, it was failing on MRI/1.8/1.9/JRuby.
-
-commit ef5f4489caac2ad4bad94783a780aa40a054481c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 22 19:30:48 2008 +0100
-
- Corrected String#to_f spec.
-
-commit 7cd9fce4908aaeea9a35e273a3f15ed7ee7aa783
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sun Jan 20 22:00:34 2008 -0600
-
- Module#name memoization work.
-
- * Module#name is now memoized on access if @name is set
- * Full module path is lazily calculcated on memoization
- * Module#const_set(Ruby) and module_const_set(C) only set @name and @parent.
- * The following methods unifily use module_const_set:
- * cpu_const_set
- * cpu_open_class
- * cpu_open_module
- * module_setup_name
- * Module#calculate_name reworked, hack removed
-
-commit 7b4ef1344812faa76018ab41cc7fba97a3af8448
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Tue Jan 22 02:47:49 2008 -0600
-
- implement more of Marshal.load
-
- Float, obj._load, obj.marshal_load, IO.read, proc arg
-
-commit 41f07f0253a8fba205dbb0402e5d5e88c115d76c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Jan 22 16:32:01 2008 +1100
-
- Fix Task#get_stack_value to not raise exception from primitive
-
-commit 14c811adaba3e8cfc5104d70e67c2e89c18cac4d
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 21 19:28:18 2008 -0800
-
- Exclude Kernel#require is private spec when running with RSpec.
-
-commit 05a180e0051a0409c685d326a41e882545faaa53
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 21 19:26:41 2008 -0800
-
- Explicitly run /bin/sh to get around limited /bin/pwd on linux.
-
-commit c09b3da391995a0e9006055ce19e838d3f180947
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 21 19:09:07 2008 -0800
-
- Protect String#% specs from segfaulting on linux (ubuntu gutsy).
-
-commit d36b3f65f92b08ae078812788482387077d03380
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 21 17:55:03 2008 -0800
-
- Removed use of `pwd -P` as at least ubuntu bin/pwd doesn't support it.
-
-commit 6d7a8292fb9a68a0dcfbd3f29f595e0ecf5902ae
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 21 17:54:11 2008 -0800
-
- Unexclude Kernel#callcc specs as Evan's recent commits seems to fix it.
-
-commit eb04d409575772a85510770bd0db4f36490de6aa
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Mon Jan 21 13:28:06 2008 +0100
-
- Fix Regexp error handling
-
-commit 93e50808eb7355c404a7f5295923083c8cf63549
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sun Jan 20 22:00:34 2008 -0600
-
- Quarantining IO#dup spec "sharing" example due to platform differences.
-
-commit ae9e2829becc495892c7ddce5eae67514f268120
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 10:26:56 2008 +0800
-
- Update Module instance_method_specs excludes after revert put it back in
-
-commit df6c82f97987c233eab0534740054e2d0f0f2f2c
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 10:25:00 2008 +0800
-
- Revert "Update CI excludes for Module"
-
- This reverts commit 8aa00146f2eee9576094daa76c6f158b0deaf2e2.
-
- * Fails when run with other specs
-
-commit 6f5245d4c20bf009bc120967f4a93d24faae66ba
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 10:23:15 2008 +0800
-
- Revert "Update CI excludes for Symbol.all_symbols spec"
-
- This reverts commit cb27e31b2a757ad108842bfa579eb9170d6cf244.
-
- * Returns an F if run with other specs in ./bin/ci
-
-commit ec9677e593247ed8dfcbfc680151d04ac97936e3
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 10:11:35 2008 +0800
-
- Fix Module instance_method_spec to match the inspect with a regexp
-
-commit 7e3474a16ec20094630e865594405ea7f1658c58
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 10:08:06 2008 +0800
-
- Module#instance_method raises TypeError/ArgumentError on invalid arg
-
- * Fixed spec to expect TypeError when passed nil
- * Fixed spec to expect ArgumentError when passed non-symbol/string
-
-commit 8aa00146f2eee9576094daa76c6f158b0deaf2e2
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 09:41:37 2008 +0800
-
- Update CI excludes for Module
-
-commit 9158b959d30babdceafc416650c1ba3234e5029a
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 09:10:06 2008 +0800
-
- Add alias for Proc.to_s from Proc.inspect
-
-commit cb27e31b2a757ad108842bfa579eb9170d6cf244
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 09:09:40 2008 +0800
-
- Update CI excludes for Symbol.all_symbols spec
-
-commit 7f16f313c907de0e22762d97fbba24e70c3259a3
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 21 08:46:36 2008 +0800
-
- Raise TypeError/ArgumentError for invalid Thread key
-
- * Raise TypeError is key is nil
- * Raise ArgumentError is key is not Symbol or String
- * Correct the description of Thread's element_set_spec to use #[]=
-
-commit 0b849f884beae9d11327e315da5c79fe789b8391
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Jan 20 23:05:33 2008 +0100
-
- Added rubyspecs for Zlib.crc32.
-
-commit 67b52b6fb92b9e9a037e584474cff2dc97ce0163
-Merge: e6d8a61... 6f08d5e...
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Sun Jan 20 22:30:52 2008 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit e6d8a61771b76198c0784677bb0a8fc97b1988bc
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Sun Jan 20 22:30:29 2008 +0100
-
- Fixed Struct#[] and Struct#[]= with negative indexes.
-
- * Added corresponding specs
- * Fixed kernel/core/struct.rb code
-
- Example:
-
- s = Struct.new(:x, :y)
- x1 = s.new(:a, :b)
- x1[-4] #=> should raise IndexError: offset -2 too small for struct
-
-commit 6f08d5e21473d0f2adff66a32acd46ddd8945fa0
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 20 12:47:11 2008 -0800
-
- Added spec for Kernel.format.
-
-commit 6ab2691b455ac07643d98dc58f8a0f45487ab20d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 20 11:52:56 2008 -0800
-
- Added sane handling of non-reals for #format %e, %E.
-
-commit 1caab1ce237a52d78a402a5f0a7ce1d3ed9ac6b7
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Jan 20 18:55:27 2008 +0100
-
- Add spec for singleton_methods and fix for Fixnum
-
-commit d7c46a0a1660f1d53e03a97571f3ec7b2431d0e4
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sun Jan 20 12:29:10 2008 +0100
-
- Added failing spec for Regexp#new that could cause a segfailt. Needs error handling as stated in shotgut/lib/regexp.c:122
-
-commit d15c6605b7fb7db337d87ac1bd15f9a1371caa42
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 19:28:00 2008 -0800
-
- Added language spec for return within a block.
-
-commit 3b516c028c4c9e064fbe839f0f9402a135eb90b0
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 17:27:13 2008 -0800
-
- Added spec for class vars set from Kernel#instance_eval based on #267.
-
-commit 970ede321d31ec75dd578866c683defe768fa356
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Sun Jan 20 00:44:04 2008 +0100
-
- Completed MRI's Module#name spec with corner case.
-
- It looks like Module#name is memoized in MRI
-
-commit caf440ac6a8037a2c223834c0ca4c5decd8e68ab
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Jan 19 22:48:31 2008 +0100
-
- Revert "Wrapped one spec to prevent JRuby crash."
-
- This reverts commit 9f266e3c785c7e3edbb6a30271f32debe6c14164.
- JRuby issue is resolved.
-
-commit 9673e2c1c5a1142af52a0d82d8981bdd9e236c27
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 12:46:12 2008 -0800
-
- Changed IO#syswrite to use should complain matcher.
-
-commit 8522186df7050782c4911f40aef381106e5e8c5b
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 12:29:12 2008 -0800
-
- Added mSpec lambda { .. }.should complain matcher for warnings.
-
-commit 9f266e3c785c7e3edbb6a30271f32debe6c14164
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Jan 19 21:24:13 2008 +0100
-
- Wrapped one spec to prevent JRuby crash.
-
-commit 54d1989997561271553ba72bd99f59ef2deb7c72
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Sat Jan 19 19:13:06 2008 +0100
-
- Fixed "X::X = 3". It would return a tuple instead of 3.
-
- * changed shotgun's const_set instruction to push the variable on the stack.
- * added corresponding specs under `language'
- * found a new problem but added it to excludes
-
-commit d25ec129902789bc7d636ff5ccda8ff858ae38d3
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 10:21:19 2008 -0800
-
- Added spec/README. Reformatted mspec/README. Removed old sprintf spec.
-
-commit 5eb06e3010707de1e273c23b3f0addf2ceaa824d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 19 09:37:29 2008 -0800
-
- Removed unused Sprintf, rename YSprintf to Sprintf.
-
-commit c144abc12230175a2a503c4426804ed19c8559e7
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Jan 19 16:21:08 2008 +0100
-
- File::Stat time functions should return Time objects and added stat and lstat instance methods on File
-
-commit 177ef99db435a59e942566f7904167fc5e849d8d
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 19 22:24:16 2008 +0800
-
- Fix ThreadGroup's add spec
-
- * Fix is by initializing a new ThreadGroup on Thread setup
-
-commit 3fad84ec370eda1cab596adf5589e43240dfc381
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Sat Jan 19 12:16:55 2008 +0100
-
- Removed empty *excludes.txt for better searchability
-
- `find -name "*excludes.txt" -size 0 -exec git rm {} \;`
-
-commit 9a2b1e6232f36c7a1508085b4606e25fbcf3cb4a
-Author: Jonathan Younger <jonathan@daikini.com>
-Date: Fri Jan 18 23:19:16 2008 -0700
-
- Additional String#% platform specific formatting failure fixes
-
-commit aa32d6fcbed79b9e2afedc00f429ea78f5c540d3
-Author: Jonathan Younger <jonathan@daikini.com>
-Date: Fri Jan 18 22:12:23 2008 -0700
-
- Fix String#% platform specific formatting failure
-
- Darwin and FreeBSD return a different string format than other platforms,
- so a different expectation is needed to match the appropriate format.
-
-commit c64dfd449dc89ec0016f14afd7f85522dbaa4148
-Author: Jonathan Younger <jonathan@daikini.com>
-Date: Fri Jan 18 21:05:44 2008 -0700
-
- Moved String#% specs to ruby/1.8 and fixed to work with rbx and MRI
-
-commit e5e7f44983f1dbbc79726776b56a9cc7cb910e9f
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 18 19:53:50 2008 -0800
-
- Updated IO excludes.
-
-commit b8b549dbc1aaf63e15717c3902d4485c97f845f7
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Jan 18 21:40:01 2008 -0600
-
- Add regexp matching for output matcher and enable warning specs for syswrite.
-
-commit 004bd58b597034cbe734d9b7da318135a689190f
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Fri Jan 18 21:06:38 2008 -0600
-
- implement some of Marshal.load
-
-commit 2c52db8022f060866d839992aaa6bff0f61963cf
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 19 11:21:55 2008 +0800
-
- Fix UnboundMethod#bind
-
-commit a5680db20cf998f0db292e3b9aa69ed74fb19b10
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 18 17:49:44 2008 +0800
-
- Implement UnboundMethod#==
-
-commit a1de7b0f405830f6bfe8000c051f4445135d8f63
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Jan 18 20:54:11 2008 -0600
-
- Added some specs for sysread/syswrite on a file and p flushing to File.
-
-commit e7bc994d96398519ca205e87dec8e775bb0e67c6
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Sat Jan 19 01:31:46 2008 +0100
-
- Fixed File#utime segfault
-
-commit 9887c6135e9353c3094dcf3c76d8e788b98f2bed
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 18 22:00:10 2008 +0100
-
- Added Time#strftime specs for '%U' and '%W' patterns.
-
-commit 0338fb5adb325e58d1ce61bccc9310fc7284e235
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 18 20:35:23 2008 +0100
-
- Added two testcases for String#% rubyspecs ('x', 'X').
-
- There was a bug in JRuby's sprintf, which wasn't
- detected by rubyspecs.
-
-commit 97db9fb72d6205227d61d92ed3153331b2328f97
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 18 10:50:00 2008 -0800
-
- File#utime spec. Some cleanup of File#open specs.
-
-commit 10647cf8abfd0ea7a87d39978a22f68fdfa9fbd6
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 18 17:08:04 2008 +0100
-
- Wrapped 3 IO spec tests into fails_on :jruby.
-
- Because these tests just break the spec run completely.
-
-commit cf6195eeabe382c4267e295ab786acedaed89050
-Author: Jonathan Younger <jonathan@daikini.com>
-Date: Thu Jan 17 21:55:48 2008 -0700
-
- Fix specs that use `pwd` to use -P option so that symlinks are resolved
-
-commit 1b79705fb965ecd6fc897b6bf14c605d8325dabe
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Jan 18 15:57:46 2008 +0100
-
- Added IPAddr specs by manveru. Closes #262
-
-commit f05b96b33970e3f08da5c8992f7c6cb710649f42
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 18 02:23:15 2008 -0800
-
- Fix spec for IPv6 environments
-
-commit 2007019ebad7974d7a54e6d599320675548313f0
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 18 17:39:09 2008 +0800
-
- Fix UnboundMethod#inspect to use regexp
-
- * Also aliased UnboundMethod#to_s to UnboundMethod#inspect
-
-commit c47b473b99b59074673adb7e8d50a250e34436e7
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 18 17:37:29 2008 +0800
-
- Use a regexp to match the inspect output instead of deviating on rbx
-
-commit 8dc2a2b3115a49a15ed931301b1999560ee27db5
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Jan 18 01:05:14 2008 -0800
-
- Fix up specs and finalize LongReturnException
-
-commit 7c30ca7337b56a4194eb58952f74662e222b7707
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 17 23:23:27 2008 -0800
-
- Add support for return in a block obeying ensure properly
-
-commit c06fc665c6bf5898163f2854b93d62b8b314216e
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 17 21:20:42 2008 -0800
-
- Changed Exception#backtrace to return an MRI compatible one.
-
- * Exception#awesome_backtrace returns an Rubinius Backtrace
- instance, as Exception#backtrace used to.
- * Added templates for Backtrace specs.
- * UnHACKed lib/test/unit to use the #backtrace as expected.
-
-commit a29f35c5a45776f10132c3ce0ef058b1e98a4f75
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Jan 17 20:18:04 2008 -0500
-
- Guard failing Process.setpriority spec, add an exclude to CI
-
-commit 333d5c6920c01366c8b2887ecc7e33f775210c00
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 17 16:50:31 2008 -0800
-
- Specs and fixes for Class.inherited.
-
-commit ac90d87a69c19c441b854660105d21ed771989f0
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Thu Jan 17 16:37:31 2008 -0800
-
- One more step into the foray of bootstrap madness... removed useless 0 from lasgn nodes. needs full clean
-
-commit 0dbabefd081be4890d0d789a9c3ec122b9196cf8
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 17 12:00:55 2008 -0800
-
- Fixes to enable RSpec 1.1.2 to run the spec/ruby specs.
-
-commit 9bd611ff5c5b411518c2f4ce5d3cd4b93f4bcebe
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 17 08:25:24 2008 -0500
-
- IO#puts, #isatty fixes from Dan Lucraft, slightly modified.
-
- * The #puts spec exposed an issue with String#suffix? which Ifixed in
- fa9a6c which means IO#puts did not need to be changed.
- * #puts spec uses output_to_fd.
-
-commit 3f519a98bbc3a66d59884add5fcd98d5ca095149
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Jan 17 08:02:51 2008 -0500
-
- String#suffix? specs and correct behaviour.
-
- * The suffix can be the entire string, there is no need for it to
- just be a substring always.
-
-commit ca6fa9cd760b06827f4f953ff28e8baed357f447
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 17 12:48:20 2008 +0100
-
- Additional Date specs
-
-commit 8541022ffc918879142ecb3707e977050f774ece
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 17 00:47:04 2008 -0800
-
- Added ?d, ?e, ?f to Kernel#test.
-
-commit e6f36980c2c94414e5c051b35d9ce403c492f1a2
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Jan 17 02:18:25 2008 -0600
-
- Fix my oops; missing 'do' for the fails_on
-
-commit 44483d8e414f107b3202cc69b8cdfbbe1222ee33
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Jan 17 02:07:57 2008 -0600
-
- Add a fails_on guard to IO#printf spec for JRuby; output dies otherwise
-
-commit 53a36c934ec44fad7e6d18424cb13b37496cf720
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 16 18:39:34 2008 -0800
-
- Updates to compiler and core to protect Fixnum#/.
-
- * Added compiler plugin SafeMathOperators.
- * Added very simplistic way to pass flags to the compiler.
- * Added -frbx-safe-math flag
- * Changed core Fixnum, Float, Bignum, and Numeric methods
- to use #divide rather than #/. Aliased #/ to #divide.
- * Updated Rakefile to send flag when compiling core.
-
-commit feb260b904d87487428b558f7b7e9ac0170c160c
-Author: Ryan T Mulligan <ryan@ryantm.com>
-Date: Wed Jan 16 22:47:02 2008 -0600
-
- very minimal SHA1 specs
-
-commit 511732d932d2fe934968c78b89cefa46e699b996
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Wed Jan 16 16:30:40 2008 -0800
-
- Moved old spec excludes to new location and deleted all old
-
-commit cae6bba077190e158ceee7b8991daf16fd8c55d1
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Wed Jan 16 13:36:19 2008 +0100
-
- Added more Date specs
-
-commit 75d49657f31091d37dfdba1fc5487164db861802
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Jan 16 15:58:42 2008 -0600
-
- more specs for TcpServer and TcpSocket
-
-commit b1d45cb0fdc573bfe5995456d846c11747d48b90
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 16 13:31:33 2008 -0800
-
- Implement ObjectSpace.define_finalizer, using WeakRef.
-
-commit 4e8a0d264dc7d5a4866a1a1b83238bebb47e4ab6
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 16 21:51:52 2008 +0100
-
- Removed platform-specific specs in spec/ruby/1.8/core/signal/list_spec.rb
-
- There is not direct way to know if a signal exists or not, since it all
- depends on <signal.h>. In practice, there is no real risk for rubinius
- to miss a signal.
-
-commit 32537f8d3378154f7f52c278cd56a7d4159a3446
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 16 12:41:54 2008 -0800
-
- Added IO#printf, fixed Kernel#printf to use IO's.
-
-commit e7bccb3f38f6ace3cb25a9f227ab5f6b1d2be346
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 16 21:19:48 2008 +0100
-
- Signal.list spec now passes. bin/ci removed list_excludes.txt
-
-commit b3a6461af30f2c144b4ee65e8539c51291e0156b
-Author: Jonas Pfenniger <zimbatm@oree.ch>
-Date: Wed Jan 16 20:03:15 2008 +0100
-
- kernel/core/signal is no more platform dependent
-
- * Now publishing platform.conf with rbx.platform.signal.* (only using the ones
- defined in MRI's "signal.c")
- * Signal::Names is now published with those values on @after_loaded@
- * New method: Signal.list => Signal::Names
- * Added EXIT=>0 and CLD=CHLD exceptions (see "signal.c" in MRI)
- * Updated the corresponding specs for more details (on FIXME, please help !)
-
-commit bdbd712a5953f011f8d6f1142d50a452e1607f65
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Jan 16 13:42:01 2008 -0600
-
- updated Continuation excludes -- Kernel#callcc specs still bleedover
-
-commit 22d32d3461660ee7cd29760163b622fc94b6ea5b
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Wed Jan 16 01:55:21 2008 -0600
-
- apply Marshal.dump patch by Justin Bradford. #252
-
-commit 513de8ab67ab9c017285a48108ccceb185ebaf24
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 16 16:44:34 2008 +1100
-
- Bunch of Debugger fixes
-
- * Debugger now has proper quit behaviour, which causes
- the debugger to remove all breakpoints, clear the debug
- channel, and resume the debuggee.
- * Fix singleton(-ish) semantics of Debugger; essentially,
- only a single Debugger instance can be instantiated at
- one time.
- * Added a bunch of specs for the above
- * Changed Rubinius::VM.set_debug_channel to accessor
- style Rubinius::VM.debug_channel.
-
-commit 2174009b215ce2f0445fc8df4711e7e6c64b0332
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Tue Jan 15 21:59:30 2008 -0600
-
- add Marshal.load specs
-
-commit ec002dd0f0daddedaa5241c4f8f6d85fad0e9768
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 16 09:47:28 2008 +1100
-
- Move VM under Rubinius namespace
-
-commit 983c54400542a03535accf2705ae227ae58970dc
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Tue Jan 15 15:24:10 2008 -0600
-
- Added spec for File.new coercing filename using to_str.
-
-commit ff6a081de28711b0d8c1136e6e4272baf769043c
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Jan 15 14:29:43 2008 -0600
-
- since DRbObject is within DRb it should be a subdirectory but mkspec generated the wrong path to helper
-
-commit a48cbbd3f5da3c971a215423b3e27b058de04196
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Jan 15 21:15:09 2008 +0100
-
- Add more Date specs
-
-commit 9de289f1bbae86b12bc383e7e535de404f8aaa5f
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Tue Jan 15 14:58:31 2008 -0500
-
- Add a servent class to StructGenerator for Socket.getservbyname
-
- Also, add Socket.htons and Socket.ntohs for byte order encoding
-
- And complete Socket.getservbyname along with specs.
-
-commit d9e37ff3c0f975a418fafbc7163ee1a9717dd92b
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Jan 16 03:31:05 2008 +0800
-
- Fix Proc#[] calling the wrong #call method
-
- * Re-aliasing in Proc::Function because aiases don't follow subclass
- methods
-
-commit 2273c919e80ab7186e3139941dc4d73a292bcd2d
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Jan 15 19:30:23 2008 +0100
-
- Add add and minus specs for Date
-
-commit 1325e22c11c48c366d9f0387823de5941b59df66
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Jan 15 16:35:23 2008 +0100
-
- First specs for Date object
-
-commit a3b76d162e58e75b4523151bb6911c840db8319f
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Tue Jan 15 12:58:14 2008 -0500
-
- Implement Socket#pair (and Socket#socketpair) with corresponding spec.
-
-commit 836f1cf828ab62606a6b0e2f7313228b7482dcbe
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Jan 15 11:47:11 2008 -0600
-
- generate spec files for DRbObject
-
-commit ef99f25be36f6ccd33b297bed14c1175847f1ecc
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Jan 15 11:31:08 2008 -0600
-
- generated spec files for DRb with a basic spec for DRb.start_service
-
-commit 9637cf1e77efd1a3b53e6c4d82a7c7afe8509621
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Jan 15 18:48:09 2008 +0100
-
- Eliminate stdout from IO#dup spec runs.
-
- At least, under JRuby it was printing things like:
- "No such file or directory".
-
-commit 30a2fce2a4fd7e840586ce8ae390ecb632c8bee0
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Tue Jan 15 23:00:32 2008 +0800
-
- Implemented Dir#pos which fixes #pos, #pos=, #seek, and #rewind specs
-
-commit 013ab2e88ecd8d887c6a0009e7f8d2add4849143
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Tue Jan 15 22:52:26 2008 +0800
-
- Revert "Updated CI excludes"
-
- This reverts commit 15d1c7674496a99bf1d5ec42420864b22bf1569a.
-
-commit 15d1c7674496a99bf1d5ec42420864b22bf1569a
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Tue Jan 15 21:50:55 2008 +0800
-
- Updated CI excludes
-
-commit 18470055d83a43c3371609aaac4471767adb3b1b
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 15 04:32:54 2008 -0800
-
- Make TCPSocket.new work. Use socket library names for familiarity.
-
- Make inheritance hierarchy of sockets better match MRI.
-
- Add syscall names to Errno.handle checks.
-
- Spec less of the socket library.
-
-commit bd34303986a068b40cce1366c85ea288fc24a3f5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 14 23:55:38 2008 -0500
-
- Regexp subclasses work now. Documented Regexp.new.
-
-commit 343acee55519fc97a35a9d50e8bdcfd679d432b7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 14 23:49:47 2008 -0500
-
- More Regexp.new specs.
-
- * Subclass initialization verification.
- * Multibyte options are case-insensitive.
-
-commit 758a468ffafdeea78016dbbce78f21e19f6735f6
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Mon Jan 14 18:22:32 2008 -0800
-
- Fixed require modifying LOADED_FEATURES even if require raises an exception
-
-commit 5c8ff74b64f7ec6bd4c413b0e0e93334dff009ca
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 14 21:57:19 2008 -0500
-
- Fixed Regexp#kcode specs.
-
-commit 34867cc1f1f3b7ac3145fb926491c0dc44629312
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Mon Jan 14 22:41:58 2008 -0800
-
- Add Socket::getaddrinfo. Raise SocketError appropriately.
-
-commit e2009a38a8e1ef0dff6394b92a677f3120280f72
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Mon Jan 14 22:39:55 2008 -0800
-
- Remove platform-specific code, remove spec of socket library behavior.
-
-commit 5afa1c34808c68c17bc02f5f76c42d64efdd7dd2
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Tue Jan 15 00:32:14 2008 -0600
-
- Modified retry-in-rescue example to test nested blocks and be clearer.
-
-commit 17fd0cb781ec90d268668c5678e1135eb5f6e323
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 22:28:46 2008 -0800
-
- Added Module#autload?.
-
-commit 96ca83312d1b5a1e38e25f94504f6f69a137b96d
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 21:50:37 2008 -0800
-
- Updated CI excludes for language.
-
-commit ef4f49de672d40f43f53dadff1aa8fdbcafe1d45
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Jan 14 21:37:23 2008 -0800
-
- Fix specs for dregx change, fix regexp for specs
-
-commit 5cd2ef2a173394910249d93d8ef433d220f2d9a9
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Jan 15 16:32:15 2008 +1100
-
- Fix breakpoint specs
-
- The breakpoint specs were interfering with one another,
- due to the fact that each was modifying the bytecode for
- a fixture class that is compiled only once.
-
- Workaround this by saving off the bytecode and resetting
- before each test.
-
-commit 29bf88b07f87182d94fcf7c550724efc07067239
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 20:00:27 2008 -0800
-
- File spec/data/critical.txt is empty! Congrats to everyone!
-
-commit 8082760cc2215742464a9846295ec4a8a0c49244
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 19:37:33 2008 -0800
-
- Removed Module methods from critical excludes.
-
-commit d075c115087c001d0d35562aeeea21efadc5e3b6
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 18:53:46 2008 -0800
-
- Added not_compliant_on :rbx for class variable specs that use Fixnums.
-
-commit 23f1b523da2478f2ad962f0045dca3e7034f9b56
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 18:16:46 2008 -0800
-
- Multiple fixes for #class_variable_get/set. Updated CI excludes.
-
-commit dbc5675058aa426dbfbbf7489d5393819edb16f8
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Jan 14 16:42:27 2008 -0800
-
- Fix attrasgn usage to pass specs
-
-commit 3e250999d6f1a7fdaf2bb5cd169a1024e2ab5ddc
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 16:07:08 2008 -0800
-
- Removed leftover excludes for compiler[12].
-
-commit a2b8b5511e79b47fa7777e716ee16511fdec3fd4
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Mon Jan 14 16:47:21 2008 -0600
-
- Remove the goofy Hash#delete spec and replace with two others.
-
- The old version of this example depended on individual hash buckets having a
- specific ordering, which overreaches a bit. The new version, while a little
- cumbersome, should work correctly regardless of hash implementation or hash
- and bucket ordering.
-
- I also moved out a few lines that were unrelated to this example into a
- separate one.
-
-commit 67d858885f1841e9c9aa295150da3c472949198d
-Author: Gregor Schmidt <ruby@schmidtwisser.de>
-Date: Mon Jan 14 14:57:53 2008 +0100
-
- Passes Module#extended specs by added extended method to module and adding a call to it in Object#extend
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 302ba965def902ccc5d3e97ed6bd5841f09d8f00
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 14 14:14:08 2008 -0800
-
- Philipp Brüschweiler's patch for String#%, #242.
-
-commit abaf2efa9e467bb7b5ef3b53b8490f1e056a832e
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Mon Jan 14 16:59:23 2008 -0500
-
- Another round of socket specs, and add a Rake StructGenerator to find sockaddr_un if it's available
-
-commit f5d0e435023a80bcc4c101a8d3ab9fc056a14c80
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Mon Jan 14 15:52:47 2008 -0500
-
- More socket specs
-
-commit 7bbc927a9d8a6f9202025be62a3db861ced3216f
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Mon Jan 14 14:58:34 2008 -0500
-
- More socket functions and specs.
-
- Namely, this implements a Socket::SockAddr_In class that is a FFI::Struct around the
- sockaddr_in C struct. This gives us a better ability to inspect what's going on in the
- struct from the Ruby side of things.
-
-commit f351c6d3d8831705f0398abdae240abba9252a75
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Mon Jan 14 11:09:04 2008 -0500
-
- More socket specs update
-
-commit cb8ce936394cafa00f77008083bccf9cded59f28
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Jan 14 14:39:41 2008 -0500
-
- Split process/constant expectations into Linux and BSD sections
-
-commit 0964d53edd80367611f63cd6eb4b294ec898cc8d
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 14 10:04:53 2008 -0500
-
- Revert IO#dup spec to unmask errors, removed FileUtils dependency.
-
- * Any errors occurring in specs should generally be raised normally
- so that any potential problem or spec deficiency is exposed.
-
-commit 04f542e928c5fa0df460d8f11b4d87e008fa343f
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Jan 14 13:36:49 2008 -0500
-
- Update Process::Constants to fetch values from RUBY_CONFIG
- Update process/constants_spec so that it passes on MRI as well
-
-commit 0ad02b57fd040196d11662bd1ab9b259dc2ce6d2
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Mon Jan 14 12:23:20 2008 -0600
-
- squash Marshal.dump bugs
-
- * fix order of evaluation problem
- * put more objects in links and symlinks hashes
-
-commit ed98b9a14459b011f97fee5c781410c4d413ed9a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 14 17:36:00 2008 +0100
-
- Updated Arry#pack specs to guard for always big-endian JRuby.
-
-commit 550f07dc7551573a975183209ba8904fdbd62607
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 14 15:57:04 2008 +0100
-
- More robust cleanup in IO#dup specs.
-
- Without it, mspec against JRuby was reporting EIGHT
- failures, while only 5 tests are actually exist.
-
-commit 1ea4f82183190c4c87da48c381f1db417c7403ac
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Mon Jan 14 09:26:36 2008 -0500
-
- Updated some socket specs
-
-commit e20ab7ea377cd39209011b44204d2688b53611c5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 14 02:23:26 2008 -0500
-
- Fixed Regexp.new kcode setting, improved Regexp specs.
-
- * Regexp kcode can be upper- or lowercase.
- * More robust Regexp#options and #inspect specs.
- * Updated Regexp excludes.
-
-commit cc71f359aa65101d2c00cfbb0c396b7cdc697ef2
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Jan 14 01:25:21 2008 -0800
-
- Improve bytecode performance a tiny bit, fix Kernel#`
-
-commit c561368c03c605de41746fac2ce5a6386fcf4f54
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Mon Jan 14 03:17:15 2008 -0600
-
- Quarantine a suspicious TCPSocket.new speck failing on MRI on OS X.
-
-commit 71a9cf2afbbe6903b8d652b3ee201957e0b0c633
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 13 22:58:16 2008 -0500
-
- Finished IO#print specs.
-
-commit ff75b95a690051736f49a9a113d21027f7f03e92
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 13 22:44:21 2008 -0500
-
- IO#dup and specs.
-
-commit 02f1c03f4df3327ce1ddd20e2249a5e9830627a0
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 23:11:48 2008 -0800
-
- Justin Bradford's patch for Float failure, #237.
-
-commit e43c148954ad609c438e5a4f14811c0349239374
-Author: Matthew Draper <matthew@trebex.net>
-Date: Fri Jan 11 21:35:57 2008 +1030
-
- Kernel#Integer is very fussy about the strings it accepts.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit adad84f7a26bf40809366f2f7b6acfc61dcfefc2
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Mon Jan 14 00:31:12 2008 -0600
-
- Class.inherited gets invoked regardless of visibility
-
-commit c746fad52e9503d04c3cf65de979b0a5a9f9e495
-Author: Matthew Draper <matthew@trebex.net>
-Date: Mon Jan 14 10:25:58 2008 +1030
-
- Many of Kernel's methods should be module_functions.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 0b8a4bfefaed3179f96721fdde35e32ed8ff7263
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 21:43:45 2008 -0800
-
- Update CI excludes for Regexp. Remove empty CI exclude files.
-
-commit 89a87edbc61a877621c6f43266000aff32e92ae7
-Author: Warren Seen <warren@warrenseen.com>
-Date: Mon Jan 14 07:12:13 2008 +1100
-
- Fixes visibility of methods passed to Module#module_function
-
- * Make instance methods versions of functions passed to Module#module_function private
- * Correctly identify visibility in error message raised in Module#set_visibility
- * Added specs for module_function
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 25d6fa558f88732d1aa28c68b0eb7c9910366243
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 13 20:42:52 2008 -0500
-
- Updated Regexp excludes.
-
-commit 69e200276898f1c9208be527bdc64c318c56f86e
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 13 20:24:42 2008 -0500
-
- Shared spec for Object#dup and Object#clone.
-
-commit 8a6fe609224c126bcf86987edd3f0690fc9e45ff
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Jan 13 18:19:56 2008 -0500
-
- VM calls private hook methods now. Object#dup and #clone specs.
-
- * Object#dup and #clone have rudimentary specs which also partially
- confirm the private hook fix through #initialize_copy.
-
-commit 84773b6ba63ea6f715dcc4e99e0a8a2e2b739152
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Jan 11 10:46:15 2008 -0500
-
- Specs for Regexp.{new,compile}, updated excludes for same.
-
-commit 6c1603723bba7d58203aa9b03bbf92b4900e53d1
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 18:49:40 2008 -0800
-
- Numerous fixes for File::Stat.
-
- * Implemented readable(_real)?, writable(_real)?, executable(_real)?.
- * Implemented a number of helper methods like rowned?, rgrpowned?,
- superuser?, rsuperuser?. Made these private.
- * Implemented owned?, grpowned?.
-
-commit d1b05e0bf98a3cdfda8a3d2398e78035a49c0c66
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Jan 14 12:25:41 2008 +1100
-
- Deprecate meta_send_stack* opcodes
-
- The code path for these opcodes is almost identical to
- send_stack, and no measurable performance improvement
- comes from using them.
-
-commit 154fe5e1faad94f371c51a979240a6d7f5cd8909
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 20:07:12 2008 -0500
-
- Implement BasicSocket#setsocketopt for String optvals, and add a spec for it.
-
-commit c21636d6b2502db344049e7dc62d42ff8c18b040
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 19:34:50 2008 -0500
-
- Add specs for BasicSocket#getsockopt
-
-commit 1584f41148b8d8967df4c3ee6376b59919cb7db3
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 19:24:58 2008 -0500
-
- Add Array.pack for i, s and l arguments.
-
-commit 7131e187e19bf0889f8ece802495865f7b3f1e5c
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sat Jan 12 13:55:20 2008 -0800
-
- Cleanup String#split, add edge case check
-
-commit 4ff46602c8a54a61697bb8d9eaa9ae89e56f7abe
-Merge: 1c95721... 908ccff...
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 14:49:48 2008 -0500
-
- Merge branch 'socketspecs'
-
-commit 908ccff0a854038372dad0780e1de35727e2d657
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 14:49:17 2008 -0500
-
- Some TCPSocket spec mods
-
-commit 1c95721bd873c4b30c187bfa7673cd7e3568a0fb
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 10:20:43 2008 -0800
-
- Fixed File::Stat specs to output method name correctly with -f s.
-
-commit acb7505d41aa789157e50962253e686827a702d5
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sun Jan 13 12:07:06 2008 -0600
-
- update CI excludes
-
-commit c8db419ae06e9642b346e1bcae99367f3b72845f
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sun Jan 13 11:55:50 2008 -0600
-
- squash bug in Marshal.dump
-
- symbols need a separate links hash
-
-commit eb953ae2c3fdeac4ae13b5461246b9f51b0f39cc
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 09:40:39 2008 -0500
-
- Make the spec text more verbose
-
-commit db013bc06cef2dea4b77a215d4437e2172b391b6
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Sun Jan 13 09:04:08 2008 -0500
-
- Commit an updated spec that shows the failure on rbx and passes MRI,
- w.r.t. opening a module and aliasing a private module function from that
- module.
-
-commit 759a9f8bd70ead9b5d2fc67b3872e3bf3bd34001
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 01:45:07 2008 -0800
-
- Updated CI excludes for File::Stat.
-
-commit 107feb74eaf01c09d8c5bd14ac29e53900a5ed26
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 13 00:38:00 2008 -0800
-
- Modified File, File::Stat, FileTest specs.
-
- * Added templates for File::Stat specs.
- * Added shared specs for some File::Stat methods.
- * Altered toplevel File shared specs to take the name
- of the constant to enable File::Stat to use a fixture
- proxy but still have the correct name show with -f s.
- * Split out specs for missing files because File.[l]stat
- behaves differently than e.g. File.file?.
-
-commit e1a13f7ecfe7f2d18fd6ac20dd8c63cbd6d11855
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sun Jan 13 02:26:09 2008 -0600
-
- implement more of Marshal.dump
-
- obj.marshal_dump, IO.write, depth limit, exceptions
-
-commit bc070232eab1bfa5d294897487339d259a406e74
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sat Jan 12 15:16:21 2008 -0600
-
- implement more of Marshal.dump
-
- Float, obj._dump
-
-commit ad7a67ed5a3a1399773dda74c4688e9b00c8f9aa
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 13 01:46:36 2008 +0800
-
- Update CI excludes for Process.initgroups
-
- * It was affected earlier by the Enumerable lambda/Proc-arity issue
-
-commit 7b7a1e3e4712f35688823543b7a7c3c25405ef77
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 13 01:40:22 2008 +0800
-
- Fix implicit block in Enumerable not passing the arg check in Proc#call
-
- * Changed instances of lambda to Proc.new and arity once again
- returned the correct value. Will investigate, but until then, this
- passes.
-
-commit d9c21aaa18044bd54ed3b1f6ec5daacf9bd250fa
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 13 01:02:00 2008 +0800
-
- WIP Fix block argument checking
-
- * Passes all the proc/lambda call specs
- * However, specs for methods that add implicit blocks like
- Enumerable#all fail because their arity is somehow 0 - excluded for now
-
-commit 3d400bc8a91a793f49dcf5655dc28e6141d999d0
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 12 20:03:26 2008 +0800
-
- Update CI excludes and add Module#class_variable_get to critical.txt
-
-commit 6bf7b8616837649ddd2c1435a54c86ed30910985
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 12 19:27:12 2008 +0800
-
- Move custom classes for NoMethodError specs into fixtures
-
-commit 10cc61bb816ae67a7fad5b135f66d263d7ee07b1
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 12 19:20:27 2008 +0800
-
- Swap the protected/private method calls around in the NoMethodError spec
-
-commit 6b2e66d3f9222b52cdae42b57206363ad47949e2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sat Jan 12 11:51:28 2008 +0100
-
- Corrected Module#alias_method spec.
-
- Now it should pass on both MRI and JRuby.
-
-commit 67f74a936655b72c689d09c77d9fbe9d7194a0a0
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sat Jan 12 17:50:22 2008 +0800
-
- Fix proc/lambda/Proc.new arity
-
-commit 03440114d5e3f07111cdcae3657258cae4c803e7
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 11 13:24:26 2008 +0800
-
- Fix Kernel.Integer parsing of invalid String
-
-commit 598598c10c66de38b52a8092cdd2fa99604eda6e
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Sat Jan 12 00:21:22 2008 -0800
-
- Clean up expectations to use a common list.
-
- Update excludes for other things using shared glob specs.
-
-commit 55aa5a1f10655618e45d0ec84502cc13c982227e
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 11 23:31:45 2008 -0800
-
- Specs for File.fnmatch handling of Regexp specials.
-
-commit 7c0dc7edfcdf4948047ba051b0cbed7ba761f1dc
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 11 21:57:10 2008 -0800
-
- Dir.glob support for {}.
-
-commit 9a097fe5634c1109919d1e120b1276827371c332
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 11 19:42:31 2008 -0800
-
- Exclude {} specs for WIP Dir.glob
-
-commit ccdc6f5ae5fabbd0d2c32072811e2ecf7cca8987
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Fri Jan 11 21:40:04 2008 -0500
-
- In MRI, you can alias private module methods. Not so here. This spec catches it.
-
-commit 8b402d1e32dc283124375374532024f6cfe7020d
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 11 17:35:21 2008 -0800
-
- Added toplevel shared specs. Converted File, FileTest specs.
-
- * spec/ruby/1.8/shared is the directory for sharing
- specs across multiple classes.
- * Added methods for FileTest
-
-commit c6aea2e10d7a4d0ee14175d5b79894e1e11699b1
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 11 15:59:34 2008 -0800
-
- Converted File/FileTest#exist(s)? to toplevel shared specs.
-
-commit 06a5d8a3d5874303a71e4e9b939b44c204041edf
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Fri Jan 11 17:39:39 2008 -0500
-
- Fix failing specs in udpsocket/open_spec.rb
-
-commit 530e40005d09140fdb55608890f0994f3a48d8be
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Fri Jan 11 13:11:58 2008 -0500
-
- Observer specs
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 0907a20d2bad2207be8e937c403c49634f3a23b6
-Author: Caleb Tennis <caleb@tarknology.com>
-Date: Fri Jan 11 12:24:44 2008 -0500
-
- Add observer to lib and base-spec file
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit ec0ff1dfa1ee9de38d35537bec5071f6bb31cf7f
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Fri Jan 11 13:11:02 2008 -0600
-
- implement more of Marshal.dump
-
- Array, Hash, links
-
-commit 640e81394ad2385b535b08b535a4fca06a5f3eec
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 11 10:24:54 2008 -0800
-
- Added CI exclude for failing MD5#== spec.
-
-commit 3c238cc9f4b32f63bc681bd64a507fc2ff49b017
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 11 10:00:50 2008 -0800
-
- Converted Socket specs to use subdirs for subclasses.
-
-commit 2b98950eaa33b532fcef079b0997f9793228c608
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Jan 11 09:23:23 2008 -0500
-
- Specs and implementation for IO#print. Closes #222.
-
- * IO#print without arguments spec excluded due to a lack of a lower
- level output matcher. To be added shortly.
-
-commit d65c8c6899cf8e4a1fa56486cf417451e0c7fce6
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Fri Jan 11 19:19:56 2008 +0100
-
- Fix String#* spec.
-
-commit 481e075bfeb9f8fb3bd4db645129a463307de09e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 11 17:41:07 2008 +0100
-
- Improved digest/md5 specs a bit, some new test cases.
-
-commit 67f48236da3d114638310ab37bcc706719bf7fcd
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 11 11:59:06 2008 +0800
-
- Updated Method's specs as Method#inspect and #to_s deviates on Rubinius
-
-commit 76846154773a87bc8d99c97e91250abda22f6378
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 10 19:24:57 2008 -0800
-
- A bunch of fixes found while working on Socket
-
-commit f69613740662d3ba4f85573c6c860a5987b29765
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Fri Jan 11 00:17:14 2008 +0100
-
- Fixed Time object for throwing errors where appropriate
-
-commit 9396386f700646d0c55b9a7a75bc399dfe055d2c
-Merge: baae72c... 4d2e53e...
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 10 22:39:24 2008 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit baae72cc47c9c1f41c3478732b7bbfdfe514024a
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 10 22:39:11 2008 +0100
-
- Fixed Time#xmlschema conversion
-
-commit 4d2e53e7376080e42b84dca486debcf4f153f32f
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Thu Jan 10 15:17:00 2008 -0600
-
- implement more of Marshal.dump
-
- negative Fixnum, Bignum, Regexp, Struct
-
-commit abdbcd70bba99149b7391effa48452971407b4d2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 13:18:52 2008 -0800
-
- Annotate Rubinius spec as non compliant.
-
-commit 2a2b3a016bfd70eb8cd14b6a043d59f119e0ad7c
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Jan 10 21:52:18 2008 +0100
-
- Re-added divmod specs for Ruby/JRuby, with comments.
-
-commit 2f079e416e4389b091c8c9b5522d49c6f356c6c9
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 12:29:39 2008 -0800
-
- Updated Bignum#divmod specs.
-
-commit 7a5c79415f2e6555bf2c69e416f6d3189f2e0c3e
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 10:46:05 2008 -0800
-
- Simplify wording of VM.coerce_to_array specs.
-
-commit abc1237a0c96ecd77baee6ecbcf71a7bba338139
-Author: Ryan T Mulligan <ryan@ryantm.com>
-Date: Thu Jan 10 12:35:23 2008 -0600
-
- md5 is now fully 1.8.6 MRI compatible
-
- * MD5 digest specs
- * Specs pass on MRI and RBX
- * Platform::POSIX.memcpy hooked
-
-commit 9f991bd850c51cd624169b51768c2215d4b56edb
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 11 01:35:15 2008 +0800
-
- Method#bind raises TypeError when binding a method from a non-descendant
-
-commit fc029ab13ded7eeb1ba838b99f00e2f14e232d65
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 11 00:12:44 2008 +0800
-
- Implement that Precision.induced_from raises TypeError in certain cases
-
- * For case when mixer class doesn't define it's own induced_from method
- * Update CI exclude for precision
-
-commit 35d1a7bc3694bdcc327dd5ac89ca0f261e0bd705
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Jan 10 16:57:38 2008 +0100
-
- Added one more Bignum#divmod testcase, known to fail on some implementations.
-
- In fact, this test case fails on Rubinius and JRuby.
-
-commit 955676613f5e38cf029998e2712013e4575dd03e
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 10 16:12:37 2008 +0100
-
- Changed spec failing on MRI
-
-commit f7b4f3fe02833081cc7f40c0feebbef0e5012f10
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 10 15:58:23 2008 +0100
-
- Fixed Float#divmod
-
-commit aff6e1fc1a16eb9e7b7e207ebc2234154d891a92
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Jan 10 22:53:25 2008 +0800
-
- Converted VM specs
-
-commit 969c0d8e0dbf43caa3999976cf259c623ff05ff1
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Jan 10 22:50:17 2008 +0800
-
- Convert Options specs
-
-commit cc7c9dcb6697dea991342328a9b00fa01740e809
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Jan 10 22:28:42 2008 +0800
-
- Replace example blocks using 'specify' with 'it'
-
-commit 7a5fa30a71072346abda17cdb79c2aa3b3922239
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Thu Jan 10 15:27:49 2008 +0100
-
- Fixed Bignum#quo
-
-commit f2aafe4a352fd884d217b0361d2e7e617f58ebd5
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Jan 10 20:38:45 2008 +0800
-
- Converted Generator specs and generated new CI exclude files for it
-
-commit edb7e341d9b3ab1c3bdc08bc57ec55d6bf8ace8b
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Thu Jan 10 19:33:53 2008 +0800
-
- Remove generator_spec.rb because of spec conversion
-
-commit bb4de530c5980f0205875bdb5548e40a22ef6a62
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 01:45:47 2008 -0800
-
- Updated CI excludes for library because of spec conversions.
-
-commit 61a66f69fe3a94d9ad5568ee2dd846cfc0b5211a
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 01:45:17 2008 -0800
-
- Converted Socket specs.
-
-commit 167e05039eeeeb959f7aab1f3611268170037296
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 00:59:20 2008 -0800
-
- Converted YAML specs and added template files for other methods.
-
-commit 027f568f79222cdee492f088edf8a2f14250635a
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 00:47:35 2008 -0800
-
- Converted ostruct specs and added template files for other methods.
-
-commit e964c9342ade9341518bc46cf998703a2c16aa2b
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 00:39:49 2008 -0800
-
- Converted ftools specs.
-
-commit 6263280187c81b0ee27893eae90f9d6a8a511b65
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 00:26:40 2008 -0800
-
- Converted Etc specs.
-
-commit 7b94284063222eef42b9b7ad0d1c820adabe210d
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 10 00:39:01 2008 -0800
-
- Fix a few more Kernel bugs
-
-commit 1c58ee51f388da0490a7815c9a1787d21e151aab
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 10 00:08:15 2008 -0800
-
- Fixed path for mock dirs in Dir specs.
-
-commit 320f7e7d3503d53216733f9b6eb75c387155ae5f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 9 22:44:37 2008 -0800
-
- Converted StringIO and Singleton specs.
-
-commit 5a94a7c3b73103c99a337a089f9cf2c7e601d2bc
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 9 21:50:14 2008 -0800
-
- Converted stdlib Singleton specs.
-
-commit 12864a2057d1b6f5fa392f34d1fa3e8873a8c566
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Dec 24 23:06:12 2007 +1100
-
- Initial commit of Rubinius Debugger
-
- * Created Debugger class for debugging Ruby code in Rubinius
- * Added Kernel#debugger convenience method to set a breakpoint
- and activate the debugger at the point at which the
- debugger statement is encountered.
- * Implemented the following debug commands:
- - h: get a listing of commands
- - b: list breakpoints
- - b <Method>: set a breakpoint at the start of the method
- - n: Step to the next line
- - ni: step to the next VM instruction
- - c: continue execution until the next breakpoint
- - l: list source code around the current breakpoint
- - d: decode VM bytecode around the current breakpoint
- - v: display local variables and their values
- - vs: display the contents of the VM stack
- - Anything else is evaluated as a Ruby expression in the
- context of the current breakpoint (so you can, e.g. change
- the value of locals before resuming, etc)
-
-commit 01a189cc3e52e8bcc6f22bcc5713e765bba84160
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 9 10:29:27 2008 -0500
-
- Object#is_a?, #kind_of? and #instance_of? specs.
-
- * Removed obsolete kernel specs for same.
-
-commit ab9645614bbbd0bca63c215819c12cc85a1507b1
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 9 21:35:39 2008 -0800
-
- Converted specs for stdlib Time.
-
-commit 733b069f11c7136175036154a45b924cf89cc8ff
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Wed Jan 9 20:01:09 2008 -0600
-
- update CI excludes
-
-commit 01e98dee4c24838ca518610443e43473ffdcf43c
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Wed Jan 9 16:42:07 2008 -0800
-
- Fixed block args for |*a|
-
-commit dc9c1d05dd5e0e828a77acc09220f5894a9aa453
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 9 16:04:11 2008 -0800
-
- Fixed Enumerator spec style. Updated YAML excludes.
-
-commit 0363685a97df83feb0d07f40a7a5c4d7a78e2a27
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 9 14:55:53 2008 -0800
-
- Spec for String#sub bug.
-
-commit 23052eb5f993c959fdb2b327895df08e0a344edb
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 8 23:47:27 2008 -0800
-
- Implement { } matching for Dir.glob
-
-commit c90b2531d183e4534268d4699634828f29e803cb
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 8 23:44:35 2008 -0800
-
- Spec File::Stat#blksize.
-
-commit 62d2a1809936a304c0cf0b94fd28f5b83932f58f
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 8 22:47:37 2008 -0800
-
- Implement Dir.glob '{a,b}'
-
-commit d9430ad1a3e582e830a994a83d6f99e017bfbe4d
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Jan 8 20:56:37 2008 -0800
-
- Fix module X::Y; end; X::Y.name
-
-commit 1baa9468e0d89777fdb6f23e78e8ab510a19d534
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Wed Jan 9 16:16:35 2008 -0600
-
- incomplete Marshal.dump
-
- an evil ivar_as_index is added to Object to hold
- the names of modules that extend the object
-
-commit 85e98490fe45446e03801840d4628149f8977098
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Jan 9 12:26:19 2008 -0800
-
- Move compiler2 => compiler, and Compiler2 => Compiler
-
-commit 5aa5cc66e2b0196728c80eb394ec3b2dfccd77ae
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 9 10:30:42 2008 -0500
-
- Centralised specs for Object#=~.
-
-commit e1fe9f57c942460338a18e38f66fbf6feb69b4bc
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 9 13:23:59 2008 +0100
-
- Added few edge cases to Numeric#eql? tests.
-
-commit b8dfd675fad5e82ebfd50c737beb9a9b919a9c8b
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Jan 9 15:52:18 2008 +0800
-
- Remove excludes for String#slice with the fixed send in place
-
-commit d7f69f17ac30f6b3161851e8df6a1e0a7694219d
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 8 22:42:43 2008 -0800
-
- A couple more fixups
-
-commit 055d7545c7046102cd92b7054992b1b47f711c4a
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 8 22:31:50 2008 -0800
-
- A boatload of fixes done while getting flexmock and rake running
-
-commit fd7c266e52c25d151214512cc801901813630d7a
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Jan 9 11:49:02 2008 +0800
-
- Removed last array exclude due to fix in 02e6e28
-
-commit 690626f43f7b4ce888de081033eaadfba543acff
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 8 18:58:50 2008 -0800
-
- Removed subtend specs from CI run. Increase File#mtime tolerance.
-
-commit dec4f25a47a9a962b77a97dea47985fe17421e5f
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 9 13:39:51 2008 +1100
-
- Specs for stack usage
-
-commit d699f6605db86e6f6bc61d0f3a79fc1535816c70
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Wed Jan 9 10:38:06 2008 +0800
-
- Add spec to illustrate Numeric#divmod bug in MRI and rubinius (excluded)
-
-commit 8a55f3047dc0fd502bb632dc9f5bdb9668b180fe
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 8 18:32:18 2008 -0800
-
- Subtend CI exclude to (hopefully) fix the build server runs.
-
-commit 33bde75b57a88baa850edccea382e1130ed586da
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 8 17:19:30 2008 -0800
-
- Added spec/compiler2 to CI. Added CI excludes for compiler2.
-
-commit 6964fc5644fddeef2238591674786f035d9db842
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 8 17:19:20 2008 -0800
-
- Fixed up against evan's changes. ping
-
-commit 9423d1e8e9ed91fb9f0934b939899c753972cee1
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue Jan 8 20:11:54 2008 -0500
-
- Fix warnings encountered when running compiler2 specs under MRI
-
-commit d71ad87c14a4378ad2f01c49d90304c29be548f3
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jan 8 17:02:02 2008 -0800
-
- Fix a block_arg bytecode generation case
-
-commit 57199b5b468c0009512a479e13bbcf086d0d9526
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 8 16:16:07 2008 -0800
-
- Added new combo bytecode/runtime tests for block args
-
-commit 8a88699af73d272a61332e11d022bd629aa0460d
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Tue Jan 8 16:15:24 2008 -0800
-
- Improved inspect output for compiler spec objects. Added convencience methods for testing iter bytecode generation.
-
-commit 0dd9cd298cf735dc13cc2a2410ad6b5195790c11
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 8 13:19:21 2008 -0800
-
- Added subtend specs to CI. Updated subtend excludes.
-
-commit c07a5273844b32fe39090bb16d0e4ad59ecb0564
-Author: Dirkjan Bussink <d.bussink@gmail.com>
-Date: Tue Jan 8 21:28:48 2008 +0100
-
- Fixed given_spec? because of changed block_given? behavior
-
-commit 0f9a8dfee9dd1c7af1f8ba69497c8dd85539760a
-Author: Nitay <nitay@powerset.com>
-Date: Tue Jan 8 11:49:41 2008 -0800
-
- Fix setpgid spec using pipes to avoid race condition
-
-commit 09feb8677c529d04969e63d1ff4e3746037611cf
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 8 10:00:06 2008 -0800
-
- CI excludes for ruby/1.8/library.
-
-commit cda3d86fa44f1d62fe503e54f42c5c5df361b8f9
-Author: Benjamin Andresen <bandresen@gmail.com>
-Date: Tue Jan 8 08:22:49 2008 +0100
-
- Added explicit umask to File permission spec so it won't fail on
- non-standard umasks.
-
-commit 6df303e29d7fd04f4a1a0af379f4947854dd4635
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Mon Jan 7 23:20:22 2008 -0500
-
- Method#== and specs from Scott Taylor, slightly tweaked. Closes #137.
-
-commit 9b86b12be687bb29e25d0292786351d89a698adc
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 7 19:45:24 2008 -0800
-
- Added CI exclude for Array#pack.
-
-commit 17a746b0aa2c89aa9e61b8965d125e962748c20d
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Mon Jan 7 21:07:25 2008 -0600
-
- adds Marshal.dump and Float#to_s specs
-
-commit d5c19db2778e0cc3cbee5bf994b511448cb6bd78
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Mon Jan 7 15:31:11 2008 -0800
-
- Fix IO#pos=
-
-commit 21f44f03f0aa44b2f172f89ad27797c943dc618b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 7 22:03:28 2008 +0100
-
- Remove non-needed std output from Array#pack test.
-
-commit 9ec20509ad6533876bbbc984052e6b7e05d2ea55
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 7 21:50:46 2008 +0100
-
- Added Array#pack tests with empty array.
-
-commit 35170103bdba14d824780a41112f12034cb5c79e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 7 21:13:47 2008 +0100
-
- Added Array#pack tests with 'w' pattern.
-
-commit 71b00e03ce2c6424fd262d737feb991835605da2
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Jan 7 20:46:58 2008 +0100
-
- Added Array#pack('U') test with negative values.
-
-commit 7be0813127635ea54909179c9553c5052c4a3d90
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 7 18:00:03 2008 +0800
-
- Add specs for Array.[]
-
-commit 0b762336e8c6040cbbe794cece64c56bfa46c296
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sun Jan 6 23:35:35 2008 -0800
-
- Fix breakages, comment out at_exit spec (need a better way to test)
-
-commit 8896e459f1bffb7ae2da2f2aa708419e6316cb4b
-Author: Matijs van Zuijlen <Matijs.van.Zuijlen@xs4all.nl>
-Date: Mon Jan 7 14:03:03 2008 +0900
-
- Spec to demo failure of cases like "yield 1, *[1, 2]"
-
-commit 79da85bb1b1d63e617251b3a3ea6b0657c1e8ddb
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Mon Jan 7 13:04:22 2008 +1100
-
- Modified CompiledMethod#decode to use #local_names
-
- * CompiledMethod#decode now leverages new #local_names
- method to return the names of locals accessed via
- push_local/set_local etc.
- * Removed excludes, as all decode specs now pass
-
-commit 89c1026cecbb9fcd09a62139e2d28b24b5658c25
-Author: David Whittington <djwhitt@gmail.com>
-Date: Mon Jan 7 01:37:10 2008 +0000
-
- Added args to NoMethodError raised by Object.method_missing
-
-commit 0e4a02f0e2fede5d785b15a6b34c582c6ba586f1
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Sun Jan 6 12:43:14 2008 -0800
-
- Removed redundant Bignum#to_s. Moved private radix_to_s to bottom. Cleaned up to_s spec a bit
-
-commit 48446c40a759d60b7465d82b40f2911d0f7e444b
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sun Jan 6 13:45:22 2008 -0600
-
- Add some additional Math.asinh specs from JRuby.
-
-commit 7c81ca307cd01d3752a08487bc3742c8452d61c4
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Mon Jan 7 00:41:10 2008 +0800
-
- Add failing specs for Time.{local|mktime|utc|gm}
-
-commit 35816e118b327a150a2d26638f289633f5e51f16
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 6 17:56:23 2008 +0800
-
- Add spec for Time.local to handle string arguments (excluded for now)
-
-commit f9f36f5bb99ddb62e15cb9a9ddd98414e3df93e2
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Sat Jan 5 23:44:33 2008 -0800
-
- Allow Regexp to match nil.
-
-commit e650c39627b81498fc97c51725f2ac1277870e15
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Sat Jan 5 23:38:52 2008 -0800
-
- Add some IO#read specs
-
-commit 20257ecce0d3161fae7ac78454f2b8672f2c1de3
-Merge: bc576b8... e549cc5...
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 6 14:45:13 2008 +0800
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit bc576b8e26fdb43d050df4fe3ad5ed974ec85057
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Sun Jan 6 14:44:44 2008 +0800
-
- Fix handling of string-like second parameter to Time.local
-
-commit e549cc53a4905f21082a97cd6bcb279ace6d9eae
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Sat Jan 5 22:31:42 2008 -0800
-
- Don't shift more bytes than available in the Buffer.
-
-commit 71285a2a9a8d0d3e71c678872ff2a146d5b2dc16
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Sat Jan 5 22:53:51 2008 -0500
-
- Fixup the Process specs for setpgrp, getpgrp, setpgid, and getpgid.
-
- They no longer may unwarranted assumptions about the relationship
- between a progress group ids and process ids.
-
-commit 7b57b3ac6df612f81d60d3a31b030ba054b357a6
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 5 13:22:51 2008 -0800
-
- Patch from Brandon Mitchell for #195, Float#to_s bug.
-
-commit 70ddfd43fd727122f56e8bdfcf3febd1ac1b5479
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 4 01:01:11 2008 +0800
-
- Fix for Time#yday spec when Time.at might return yday+1 depending on tz
-
- * Wrapped Time.at in a with_timezone("UTC") for consistent results
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 7d4396e4e69fb7b046efdaaf87d1090a02c883a0
-Author: Kamal Fariz Mahyuddin <kamal.fariz@gmail.com>
-Date: Fri Jan 4 02:26:38 2008 +0800
-
- Fixed Array#fill behavior when passed index and negative count
-
- * Added additional spec when negative count is acceptable
- * raise ArgumentError when negative count absolute value exceeds index
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 8af2b55313eb55082df6a71cd3e6bd865f2901fc
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Jan 5 13:33:26 2008 -0600
-
- Save mtime during file creation to make mtime spec more reliable.
-
-commit 7043933af0475370462984c8d2df2b9301e58cfa
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 5 00:45:01 2008 -0800
-
- Updated CI excludes after spec description changes.
-
-commit 3d7650100ba1756a4d67be8044e31498ea96d88e
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 4 21:13:28 2008 -0800
-
- Multitudinous style cleanups in spec description strings.
-
-commit d54ed8791a74661adb87c938e92e037ece924c90
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sat Jan 5 00:29:22 2008 -0800
-
- A real, working eval and friends.
-
- * Implements binding, eval, etc.
- * Passes all eval and instance_eval specs currently
-
-commit 02ad19ab4132bf5d3ae35c2e11fa1a963d1f1805
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Jan 4 00:25:39 2008 -0800
-
- Fix a few more String specs, fix Integer()
-
-commit d67cfbcf4e7d35641de555ac1edd61b51780def8
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 4 19:16:43 2008 -0800
-
- Make class variables work with inheritance.
-
- Move class_variable* to Module.
-
-commit d79836e04d72796b723cdaab228871c87abe064a
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 4 16:26:21 2008 -0800
-
- Replace Struct with a Struct that can be subclassed
-
-commit 8efb042a9c160af9e9c177ca14aed220dedcc26f
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Fri Jan 4 15:41:43 2008 -0800
-
- Finished |*args| spec. Fixed MethodDescription and TestGenerator inspect methods
-
-commit 76cc487434f6cd9d60356560f1bbc3fba000397c
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Thu Jan 3 16:54:56 2008 -0800
-
- Fuck you git. Adds a broken spec to compiler2/masgn for splatted goalpost arg
-
-commit dd2697b602a732e3e00c131f54f9cc557ae0cbe3
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Fri Jan 4 15:40:50 2008 -0800
-
- Failing spec for case when with an empty body
-
-commit 22dcedebd484f655bba51399e38e83c5a14d4053
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Jan 4 18:31:48 2008 +0100
-
- Added Time#local specs with string-like second arg.
-
-commit 43ff733a3097fff44ba8a12334f20a1bf77a965f
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Jan 3 23:54:34 2008 +1100
-
- CompiledMethod#decode now uses local variable names (if avail)
-
- * CompiledMethod#decode now looks in the bonus tuple for the names
- of stack and slot local variables
- * Moved compiledmethod specs to spec/core/compiledmethod
-
- Note: Compiler2 appears not to be setting the bonus tuple, so code
- compiled under it cannot decode local names at present.
-
-commit 06006ec2a053ae49b243fa0aa98fc71c2ea7a524
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 4 01:24:49 2008 -0800
-
- Updated CI excludes.
-
-commit dff2e75df3c371522b6a3ba4495d269bf793fe97
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 4 01:01:24 2008 -0800
-
- Updated CI excludes for Bignum.
-
-commit 569fa3b9fc81410ce9fe6568427f0a0bc65b7036
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 3 19:26:22 2008 -0800
-
- Updated CI excludes for String, Regexp.
-
-commit 7aedec383850eacad5db8248bfcea7615a3d1793
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 3 17:48:32 2008 -0800
-
- Fix up setrlimit/getrlimit on darwin
-
-commit d9aea8bba7276b53ca7c18b8625531be389d2cdc
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 3 16:40:09 2008 -0800
-
- Refactor $~ out as a global, into Regexp.last_match directly
-
- * Uses MethodContext to store $~ now, so it's method local.
-
-commit c19dde305fd751c14a1b4dc798557e0b63c08c8d
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 3 16:25:54 2008 -0800
-
- Clean up compiler2 specs
-
- * For is still broken, needs more love
-
-commit d02603a7e225d3b48ecf7899ea74768880aba7ec
-Author: Gregor Schmidt <ruby@schmidtwisser.de>
-Date: Wed Dec 12 16:56:11 2007 +0100
-
- Add default implementation of Module#method_added
-
-commit 7ba5d1478106e4e0f5fcf21c66029df2f38d7e2f
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Sun Dec 30 17:55:21 2007 -0500
-
- Unquarantine Process.kill specs.
-
-commit d68b380bdd2e0a0ec3bd968ffabd02f6e30a3aa1
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Tue Jan 1 22:14:59 2008 -0500
-
- Improve kill, wait, detach, and setpriority specs for Process.
-
- Restore any previously installed signal handler after the spec has run.
-
- User IO.read(1) instead of IO.getc since rubinius has it implemented.
-
- Fix a failing Process.detach spec uncovered by the raise_error fix.
-
-commit da7329d094b6ff437d37e6a1fcaf93883ac9172f
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Mon Dec 31 16:23:24 2007 -0500
-
- Add specs for Process.setrlimit, Process.getrlimit, and Process.setsid.
-
-commit 42bef2feb46434b0ea67bc3f93d941d587c2d9c9
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 3 12:46:57 2008 -0800
-
- Updated Process spec excludes.
-
-commit ca98172b8a923cce1691b0fcc5d2418417d82662
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 3 10:07:55 2008 -0800
-
- Update CI excludes for IO from Evan's fixes.
-
-commit cde20d6c32156e4fc06859f1e84414f81f5af69e
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Jan 2 23:40:59 2008 -0500
-
- Fixed #require specs.
-
-commit 06d99a2ac4be06b50848056b381c91531293a49e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Jan 3 01:12:29 2008 -0800
-
- Add read buffering to IO, passes 100% of IO specs
-
-commit 86170283715371b5a87c0518f89c2b882a49bc93
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Jan 3 01:21:52 2008 -0600
-
- Fix off-by-one on a few signal values. Doh!
-
-commit c7a64b10410308cec83077a66cda5859b326f296
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Jan 3 01:13:27 2008 -0600
-
- Modify Signal.list spec to not depend on hash ordering.
-
-commit f2980d9584c08d873cf1646c281d083946bcbc6c
-Author: Nitay <nitay@powerset.com>
-Date: Wed Jan 2 14:36:56 2008 -0800
-
- Module#autoload:
- * raises a NameError when an invalid constant name is given
- * raises an ArgumentError when an empty filename is given
- * does not autoload when the specified constant was already set
- * registers the given filename to be loaded the first time that the Module
- with the given name is accessed
-
-commit e68bd05defe5ab749110af507c86769c9a036b25
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Wed Jan 2 19:04:48 2008 -0600
-
- Removing 'Range#initialize can't be called twice' spec.
-
- Evan agreed that these specs aren't useful, and I don't believe they're
- within the bounds of reasonable language specification since they're
- going around visibility and testing behaviors no sane programmer would
- ever be able to see.
-
-commit 1870720bac174feb627654f08c1749e1666c2acc
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Wed Jan 2 18:54:33 2008 -0600
-
- Fix inspect spec to guarantee the target thread is actually sleeping.
-
- A reminder for folks adding Thread specs: You *CAN NOT* know that a target
- thread is sleeping unless you are polling for status == 'sleep'. No amount
- of channel, lock, or state variable tricks will get around that. Please
- use polling if you want to guarantee a target thread is asleep.
-
-commit df3057a541862bbd1c5c72b8626bb591bb5ae6fd
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 2 16:39:37 2008 -0800
-
- Refactor Module#undef_method spec to #respond_to? and #instance_methods.
-
- Now only method dispatch is tested for #undef_method. #respond_to? and
-
-commit d2ecd4119a152370210ccb6c2a816c9dccb9fe90
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 2 16:00:09 2008 -0800
-
- Fix Rails indenting and whitespace
-
-commit f5b8afee4931bd09b0ce9fb88fc959c2ea0a1743
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 2 15:30:41 2008 -0800
-
- Fix Module#undef_method and Module#instance_methods
-
-commit 82bf31562361a21f85a90d5628a40ff50280c555
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 2 14:10:35 2008 -0800
-
- Rebuild excludes for #eof?
-
-commit b2aa0d56b04d7da5d333ba1449acda7c0b64c0c4
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Wed Jan 2 14:09:21 2008 -0800
-
- Add IO#eof? spec.
-
-commit addeb47d834d1ce60f8146f747defacf1682e6c4
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 2 22:31:30 2008 +0100
-
- Removed JRuby spec excludes.
-
- The JRuby excludes will reside in JRuby repository.
-
-commit 3239661ed5c38b37c966588341a043d6cdd9445b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Jan 2 21:28:11 2008 +0100
-
- Corrected String#modulo tests after clarifications from ruby-core.
-
-commit a0f3ba6632f8486e8f07a21a8e4720d8727ba4d2
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 2 11:28:42 2008 -0800
-
- Fix require_spec_recursive on Ubuntu.
-
-commit 857c39564df2d8da480f549fff46ec3ab880066e
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 2 00:48:53 2008 -0800
-
- A couple fixes. Updated CI excludes for last couple failures.
-
-commit 58c48ed05b493c71ee445062f27d47909e18b395
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 1 23:49:14 2008 -0800
-
- Updated CI excludes.
-
-commit 426f5a15eaac05ed1e900433837de0b9d0246c8d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 1 22:43:47 2008 -0800
-
- Moved CI excludes files from .spec dirs to spec/data/*.
-
-commit a1d6211f3185f23cbc2c929f0352feca05fd079c
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 1 22:03:43 2008 -0800
-
- Moved ruby specs to spec/ruby/1.8/...
-
-commit af55eefd29c8acaf462efe03d2e0b3d95195cb21
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 1 21:44:35 2008 -0800
-
- Updates for bin/ci and bin/mspec.
-
- * Removed -2 switch from both because compiler 2 is default.
- * Added CI_EXCLUDES_DIR and -E switch to bin/ci to allow for
- specifying the exclude directories. The default is '.spec'
- in each directory containing spec files. Use a path starting
- with a '/' to create the exclude directories relative to
- that path, otherwise the exclude directories are created
- relative to the directories containing the spec files.
- * Moved spec/excludes.txt to spec/data/critical.txt
-
-commit 0e6645eb74f1f63b84f674dbcdfa991153a3ccd0
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Jan 2 12:10:39 2008 +1100
-
- Couple of Breakpoint changes
-
- * Raise ArgumentError if no block given (spec for this
- existed, but was masked by RaiseErrorMatcher bug)
- * Added line property to Breakpoint
-
-commit 36a7acddfe74ab25895d13dd775741b042ba3b0c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Jan 1 23:10:13 2008 +1100
-
- Reorganise breakpoint specs to new dir layout
-
-commit 8aa6712dd9e5e870194f77ff74dc8cf11c273805
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Dec 21 16:15:19 2007 +1100
-
- Refactored BreakpointTracker in preparation for debugger
-
- * Moved code from debugger.rb to breakpoint.rb
- * Refactored code extensively to support debugger
- * Added breakpoint specs
-
-commit d16e905a67d64f67d7a24ce113f39b4b059c4139
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 31 17:51:59 2007 -0800
-
- Removed the rubinius dir from specs. It was redundant.
-
-commit 85ed07b6d739f013892a6cbcae5d0bb2c19f6e80
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 29 15:45:31 2007 -0800
-
- Split Ruby specs proper from Rubinius specs.
-
-commit b8e1466dc1b814bfb2022c1e4319d5ba63f5d762
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 29 15:02:55 2007 -0800
-
- Updated guards in specs.
-
- * Changed guard names to new, more descriptive names.
- * Removed all #extended_on guards for Rubinius-only specs.
-
-commit 5773ebe9e6f78abec9bfb03f144b5c7a86a27c7e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 29 00:50:56 2007 -0800
-
- Changed Float constants specs to compare against precise values.
-
-commit 71874fcdc9eaf45a5adecf57d7609831a2a8e6c2
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Dec 29 17:26:06 2007 -0600
-
- Fix dump_spec to expect 1 or more write calls, rather than exactly 1.
-
-commit d4bfb39910aa4adf2c0c4e2dee214487bac34093
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Dec 29 14:51:38 2007 -0600
-
- Add a spec for procs being block-passed and some peculiarities therein.
-
-commit 1b0333479bf6da2c76c8d3c1e1640dc156086d9f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Dec 28 08:24:30 2007 +0100
-
- Improved ObjectSpace#each_object spec test.
-
- Previously, the test was failing from time to time,
- depending on Garbage Collector behavior.
-
-commit 3d7e628acc6699f9652383317bd416d8c75329d5
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Fri Dec 28 05:27:24 2007 +0100
-
- Updated Time specs to use new :os guard.
-
- The Time specs use this :os guard to properly detect
- which external program with proper parameters to invoke.
-
-commit 7662638e9afa631f0581fc1c2b2b422b1b926f98
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sat Dec 29 03:06:51 2007 -0600
-
- adds Marshal.dump specs
-
- for nil, true, false, String, Symbol, Fixnum, Bignum
-
-commit 93431a28d687372b95f1a1420a3bd1f24e660117
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Dec 29 00:15:44 2007 -0600
-
- Guard Continuation specs to not run on JRuby (JRuby does not, will not support continuations)
-
-commit ccf745b9eafe068de6f888de24387bc0a0e68859
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Sat Dec 29 00:08:04 2007 -0600
-
- Fix for Fixnum size spec to guard "java" platform with 8 byte size
-
-commit 6f448f0dd72b5df2cc69e28db3d5593f897a9dbd
-Author: MenTaLguY <mental@rydia.net>
-Date: Sat Dec 29 00:58:58 2007 -0500
-
- a more modest spec for Thread.pass
-
-commit b32c2d95d044a4979ab92b5881e32fc8b169d931
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 23:51:10 2007 -0600
-
- Adjust Float MAX spec tolerance to work on both JRuby and MRI, since there's a few powers of precision difference.
-
-commit af7bb00beeb359fd6183def039b9a1fcd0ce7c48
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 23:39:15 2007 -0600
-
- Expand Float divmod array equality comparisons to use be_close with a default tolerance.
-
-commit dbdf373751bce2c8a334315c8c5ed21458614c70
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 23:34:09 2007 -0600
-
- Add a tolerance to the Float induced spec around the same scale as the value under test.
-
-commit a713d277e6a8148d4c53b66a3a8fa3aedbd6a108
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 23:31:25 2007 -0600
-
- Modify Float multiply spec to be_close with a TOLERANCE multiplied by a similar scale as the value under test.
-
-commit b82d8af43356de31d16b1c36296d9e819ce70d46
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 23:13:38 2007 -0600
-
- Fix Module class_variables spec to sort the variables before checking if they are all there.
-
-commit 1e60a25b57273dd6fd7e21b0a443da1f5c0be9e5
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 19:44:51 2007 -0600
-
- Mark Process#fork specs as not_compliant_on jruby.
-
-commit 021a6ff317ed826a46ca2168f4ee9c7540a27214
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 19:19:14 2007 -0600
-
- Remove fail and "failure" guard around the require/extension spec, since an unimplemented spec isn't necessarily a failure of any kind.
-
-commit 520c423860ef6553dae34eefd85188ab9b4773f6
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 19:12:52 2007 -0600
-
- Modify previous compliance change to callcc spec to use not_compliant_on instead.
-
-commit ab85bfff2f9fea8e28f9518311aacccd30f380dd
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 17:56:42 2007 -0600
-
- Remove compliance guards on identical spec's link/unlink, since they don't blow up now and JRuby supports them.
-
-commit e79c8af0ad6fb7ddf094b6ba4747932145f9b89b
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 15:19:24 2007 -0600
-
- Removing "fail" and "failure" wrapper from unimplemented "loads extension files" spec; an empty or unimplemented spec is not a failing spec.
-
-commit 0f6b7387bcc8df946ec8d7504cc3935b6d0f9c58
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 15:06:07 2007 -0600
-
- Add compliance to callcc specs, so JRuby doesn't run them (since it never will)
-
-commit ed43292ce58468e31b771eb4926a39dff8d70793
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 14:48:45 2007 -0600
-
- Make umask spec work with different host process starting umasks, clean up literals to be easier to read through.
-
-commit 7e9f96741739e544c547f2898e8b5183dec87323
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 14:43:02 2007 -0600
-
- Fix goofed-up paths in requires for rubinius-specific Integer spec
-
-commit d54fb1e7c3f586a6d8ac200d6de839ebe6cb4c46
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 28 14:40:50 2007 -0600
-
- Move rubinius-specific spec from core/kernel/Integer_spec to rubinius/core/kernel/Integer_spec.
-
-commit eb561025707736ebe196eab3b4ff2bd1c98f45a4
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 27 23:51:42 2007 -0800
-
- Fixed language/block specs to guard ruby18 feature.
-
-commit 5659d057d756effe3acba1037d0ad6d638d930dd
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 27 22:58:17 2007 -0800
-
- Changed Bignum specs to use value suitable for all implementations.
-
-commit 2646b1a17f898f05233622c9251c3c36632e82a7
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Thu Dec 27 23:43:42 2007 -0600
-
- implements m directive for String#unpack
-
- moves a couple misplaced methods from Numeric to Integer
-
-commit 496d6761d7377081ff76b263a51bb39d0e30d80a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 18:07:45 2007 +0100
-
- Marked one Rubinius-specific Kernel spec test as such.
-
- Kernel#compile is not official part of Ruby.
-
-commit 50e35293bd3a117874203a75d214c3435170e5d3
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 17:43:03 2007 +0100
-
- Corrected String#pack with 'DEFG' pattern test.
-
- Now, numeric comparison of values is used, with precision,
- not literal string comparison.
-
-commit 0ef00fe14a04ef240fcca17d15271f92f2a44525
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 16:00:20 2007 +0100
-
- Added String#inspect test case with malformed UTF-8 string.
-
-commit 5bbde0cda03ea782090586a9afdb620663633456
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Dec 27 13:30:34 2007 -0600
-
- switched ThreadGroup specs to use Channels
-
-commit e3abd8b834b9f923d94ae381e81977feb4a4f6f8
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Dec 27 13:22:20 2007 -0600
-
- added Thread#stop? and fixed Thread#status + specs for Thread#status
-
-commit f8835353bc8be47760f70811616991463e4e681e
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 09:18:24 2007 +0100
-
- "Unexcluded" one Struct spec test for JRuby.
-
-commit 8a1b127cb33e43b916b0ccd820c6e16680cd4030
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 09:12:23 2007 +0100
-
- "Unexcluded" 6 Hash tests for JRuby.
-
-commit ae4ce805fb7611ea6de12b01b2500f501b54bd6a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Wed Dec 26 09:01:35 2007 +0100
-
- "Unexcluded" 27 Array tests for JRuby.
-
-commit c84540f96d7e265732a204ed72b3873545624444
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 27 00:08:06 2007 -0800
-
- Fixed Set#delete? spec to actually call delete?.
-
-commit e137c3279f511b49442ce2cea1b1832c1a0c6ab0
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 27 00:00:56 2007 -0800
-
- Added some specs for Set.
-
-commit 8054ed86a93a72ad4629d6f52455892d620138b0
-Author: Nitay <nitay@powerset.com>
-Date: Tue Dec 25 17:30:56 2007 -0800
-
- require should prevent recursive includes infinite loop
-
-commit 23fb497a7ba2a853cbdc5e8a38b091df284a377e
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 26 16:50:22 2007 -0800
-
- Updated status output options for bin/ci and bin/mspec.
-
- * Made dotted the default output format for bin/ci.
- * Added -m MARKER option to ci and mspec.
- * Added "Started" output as requested by autotest folks.
-
-commit 036b073753763afe86330d3f7fa0f61d755ac991
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Dec 26 10:41:01 2007 -0500
-
- Moved class fixture back to spec/fixtures/.
-
-commit 91d46b86a86270bb3174909a2d5cbc343ea138c7
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Dec 25 19:20:18 2007 -0500
-
- Added specs for $~, $&, $`, $', $+ and $1..N.
-
-commit c434614505511b8816548efcf4a4cf56d77220f4
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Dec 25 19:19:11 2007 -0500
-
- Improved language-level class specs, moved fixture.
-
- * Class fixture copied to spec/language/fixtures/.
- * Disabled unnecessary class instance variable check and added
- new ones.
-
-commit 0a49f3485fe7e26cc7d7d5bc3cb800ddf9fd6231
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Dec 25 19:13:22 2007 -0500
-
- Changed strange_block_args_subspec.rb to block_args_subspec_strange.rb
-
- * Name change to improve alphabetical sorting.
-
-commit 2ac50215dd32fd7ad2f2c20c7ae06ed73dc9f856
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Dec 25 13:32:06 2007 +0100
-
- Added tests for Array#pack with "U" pattern.
-
- Note: The tests are exclided for Rubinius.
-
-commit 4c0993fa90010322bb823a9799a8b3ccdd585e2e
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Wed Dec 26 04:07:02 2007 -0600
-
- return excluded spec
-
-commit 0a69d9cd5a7d3a0be9411fa00c4eeebe5d270a0c
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Wed Dec 26 03:55:43 2007 -0600
-
- implements @AM directives for String#unpack
-
- squashes bug in a regexp where an alternation of things
- between begin and end assertions wasn't wrapped in group delimiters
-
-commit ddda4d49f5535577c147d2154ecdae7cb4e32e24
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 26 01:16:13 2007 -0800
-
- Moved Kernel#load/#require fixtures to spec/fixtures.
-
-commit 0438e9e61c5958c5daf691b025e34bc79e7b2573
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 26 01:06:12 2007 -0800
-
- Reorganized specs to group all Rubinius specs under spec/rubinius.
-
-commit a4c3e286e44ee3df88395b9b5f44d5804154ed2b
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 25 19:32:55 2007 -0800
-
- Updated CI excludes.
-
-commit 8535481571712cf8c35f437c42ec53dcbfd44bc0
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 25 15:52:53 2007 -0800
-
- Enhanced guard for detecting :ruby, :ruby18, :ruby19 engines.
-
- Changed dir specs to create the fixture directories with every
- run to prevent pollution of the directories from causing spurious
- errors.
-
- Added spec/core/dir/fixtures/mock to .gitignore.
-
-commit a6b07ec37da7a59f34f45dfc84a66729b12f63b7
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 24 16:25:16 2007 -0800
-
- Removed Dir specs mock directories from version control.
-
-commit b0e4addbf7c6505c760e143e5fac0dab0109d8ac
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Dec 25 13:17:28 2007 -0500
-
- Updated CI excludes for Dir.
-
-commit 80a9c6c2e2e5cd2acdcb6492c4a06fef258bb49e
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Dec 25 13:17:09 2007 -0500
-
- Moved Rubinius-specific parts of #load/#require specs to extensions.
-
-commit 85f6b6e24518868f39ff39a5014a41a233237671
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Tue Dec 25 02:53:45 2007 -0600
-
- implements U directive for String#unpack
-
- uses only one of the exception messages every time
-
-commit b414c94db1fa1af8e6cd3382c34fc6de5ed3bd1e
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Mon Dec 24 16:42:22 2007 -0800
-
- Merge identical specs
-
-commit e0f28c224a2348dbf7c005694971a86f8e6162e1
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Mon Dec 24 15:59:24 2007 -0800
-
- Kernel.Integer() shouldn't pass a base to String#to_inum
-
-commit eb93da7c578599469fe209f7b1d30f0f77d148f5
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Dec 23 16:43:33 2007 +0100
-
- Wrapped one String#crypt case into compliant block for JRuby.
-
- "hello".crypt("\x00\x00") is not really defined,
- and heavily platform dependent.
-
-commit 7594c89cf2f017cb1fffad16bac6fcc7c9629422
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Sun Dec 23 10:53:30 2007 +0100
-
- Added JRuby wrapper for String#% test.
-
- Allow "%e" % (0.0/0) in JRuby to return "NaN", and not "nan".
- I think, returning "NaN" is a proper behavior, and
- it seems that MRI 1.9 is also following it.
-
-commit eaf9e328e81f9c1d4e80737a96d0eea6b511fabb
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Mon Dec 24 06:55:30 2007 -0600
-
- implements BbHhIiLlSs directives for String#unpack
-
-commit 701945421d6a656f8b0b183052c4535a895e2afd
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 24 00:44:26 2007 -0800
-
- Converted specs to use the new #platform guard syntax.
-
-commit 238fbbc2331a1926f3d3f447d8433b046e7d34ac
-Author: Tom Mornini <tmornini@engineyard.com>
-Date: Sun Dec 23 15:43:26 2007 -0800
-
- Clean up language on now understood and fixed alias_method e2mmap spec.
- Fixing the alias_method problem has now uncovered something in const_set,
- so I've included a very vague test (require 'e2mmap') to document the
- problem until it's better understood.
-
-commit 69149b261ac13cc1a2b7c80c7b103d397fd96b9b
-Author: Tom Mornini <tmornini@engineyard.com>
-Date: Sun Dec 23 14:13:22 2007 -0800
-
- Add spec for alias usage that breaks e2mmap.rb
-
-commit 71d9a4144811b2c9c74edc55f348637c57b0cb84
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sun Dec 23 05:25:37 2007 -0600
-
- implements aDdEeFfGgXx directives for String#unpack
-
-commit bebafb1383a5126c959c33a1336f3a2e4b6993f6
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 18:16:14 2007 -0500
-
- Saner specs for stream-style Dir access. Passes 1.8.6-p111.
-
- * Dir#read, #tell, #pos, #pos=, #seek and #rewind which are a part
- of the stream interface to Dir no longer rely on platform-specific
- position values, instead opting to just ensure they work as expected.
-
-commit a2e4c318a3406c9532404611f14d2790695c0a7a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 16:29:00 2007 -0500
-
- Enabled Time#at spec to work with BSD `date`.
-
-commit 0e983f2e948ab997834dbc703e9eeb11d86a7022
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 16:17:14 2007 -0500
-
- String#to_i spec to check for correctly parsing 0x-1 and the like.
-
- * This was fixed in 1.8.6-p111.
-
-commit 5e635a46f4733bcc2071b52ea076584614fe5655
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 15:52:03 2007 -0500
-
- Fixed various String spec issues and added a few. Passes 1.8.6-p111.
-
- * String#% with o for octal numbers is still broken but that seems
- to be due to MRI's sprintf.c.
-
-commit 780f22bde03e280f5af2509bef260585341f4e0b
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 15:48:55 2007 -0500
-
- Fixed incorrect use of #should raise_error.
-
-commit 0b239b4f66c20ad5690e429639c4bf11a809ab58
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 12:22:20 2007 -0500
-
- Hash specs fixed. Pass under 1.8.6-p111.
-
- * Changed to use HashSpecs#frozen_hash and #empty_frozen_hash
- for clarity and being less error-prone.
- * Fixed various typos causing problems.
-
-commit 9a2450e5c51333474cf012c3a1364e95384af9e0
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 12:20:48 2007 -0500
-
- Kernel.caller specs revised. Pass 1.8.6-p111.
-
- * Fuzzier matching of the data in the call stack.
- * Fixed specs for omitting frames.
-
-commit 692f4e8a652e273096c0f77ffe571318c59d2b12
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 10:59:19 2007 -0500
-
- File.ftype specs pass on 1.8.6.
-
- * Use `find` to locate specific file types instead of relying on
- predefined paths being correct.
- * Re-enabled character devices.
- * FreeBSD does not implement block devices.
-
-commit f1251ebc602311ec305a4b1b35a765ee45b9c164
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 10:11:07 2007 -0500
-
- Bignum#div returns an Integer if evenly divided.
-
-commit b62e1b7a21df1d7736767530f216148b8a93e38a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 09:52:33 2007 -0500
-
- Fixed Array spec failures under 1.8.6-p111.
-
- * Array#fill raises if given a negative count.
- * Array#initialize will always raise if frozen.
-
-commit e3d6a3df6c1dfc37731ff4de5de32dc996bb61bb
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 09:37:46 2007 -0500
-
- Silence warnings from removing *.rbc in #load and #require specs.
-
-commit a11171e853b3efb94b4cba03786ea851d81411c6
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Sat Dec 22 07:39:40 2007 -0600
-
- implements CcQqVv directives for String#unpack
-
-commit eea90994f2a1b76ed11b29e05a16c9c299d59235
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Dec 22 00:23:29 2007 -0500
-
- Added __FILE__ specs to #load.
-
-commit 0e04ca49ebdba35a7a293b6de82d9d67c6ff4ac5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Dec 21 22:59:50 2007 -0500
-
- Correct __FILE__ information from #load and #require.
-
-commit 51c2543fe032b680a6c8f8cf8121196070c61c66
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 21 23:51:37 2007 -0800
-
- Replaced use of @path1 with equivalent nil in File#fnmatch.
-
-commit b9f979393456dc3c93250e3a50b54b489a25c5d1
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 21 23:29:51 2007 -0800
-
- Added -w to bin/mspec to emit warnings. Fixed warning in mSpec.
-
-commit 16ce249216f490b9f7921aa69932f9e8bd60ca0e
-Author: Jeremy Roach <jero_rub@yahoo.com>
-Date: Fri Dec 21 22:50:40 2007 -0800
-
- Implements N, n, and Z directives for String#unpack.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit e1d292e28fe409c087f314bb139371a1f248850d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Thu Dec 20 15:04:12 2007 +0100
-
- Fixed race condition in ThreadGroup#add specs.
-
-commit 469527ddf33484a4a77f3d73c611e9a393bd48ad
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Dec 21 12:02:50 2007 +1100
-
- Added CompiledMethod#decode specs
-
- * Added UnboundMethod#compiled_method accessor
- * Improved robustness of ISeq decode when dealing with junk at
- the end of an iseq
-
-commit 08c2f5c29a2debed90ae1fff817c30e269913609
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Dec 20 23:45:53 2007 -0500
-
- Re-enabled purging .rbc files in require_spec and fixed the masked problem.
-
-commit dd4f3c52e79d01e826918e49fa626d7358f87901
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 20 22:53:48 2007 -0800
-
- Clean up a couple of failures seen in ci. spec/core passes.
-
-commit a5667632ae8d112c0271e00cbba53a274075cd1a
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 20 22:49:05 2007 -0800
-
- Removed legacy, unused spec/reports/base.txt.
-
-commit 853e100b6f7fff24e4aaa40ed30c6add523f8df2
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 20 17:49:36 2007 -0800
-
- Fix a bunch of String specs (thanks random8r)
-
- * Note: rubinius now has the same behavior as MRI for Nan,
- Infinity and -Infinity when using String#to_f
-
-commit b220f4921fd799ac28c60132ca08cf16df6f713e
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Dec 20 15:37:25 2007 -0600
-
- fixed require specs to work correctly on any run including first
-
-commit 56ac483e3559e1d4913e4c36c9a8f007523fdab0
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Thu Dec 20 19:36:21 2007 +0000
-
- Fix typo in spec/core/regexp/union_spec.rb
-
-commit 634300eed40ef0ded16ab7cac7865dd783486c2d
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Dec 20 03:46:59 2007 -0600
-
- Add 'sleep' checks to threadgroup spec to avoid the same race conditions seen in kernel/sleep_spec.
-
-commit 72b7123c9b3d1d266f4ce035b4e99dd0c2dbd88d
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Dec 19 22:46:17 2007 -0500
-
- New compliant (moreso, anyway) #load and #require.
-
- * Improved #load and #require.
- * Specs for the above.
- * File.to_sexp and String#to_sexp allow empty input. They are
- processed as a file containing 'nil'.
- * Archive#get_object_fuzzy allows no extension or .rb instead
- of .rbc only.
-
-commit fe633062095096fe00599cbb89aa4370ab5ccb3e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 19 23:03:08 2007 -0800
-
- Fix Kernel#puts
-
-commit 364ca08cbbb1848b549d99deb11e2449ad99334a
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 19 23:10:17 2007 -0800
-
- Updated CI excludes.
-
-commit 5f1c381560a8d4d594749d42b5b2feeec341d4e5
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 19 22:24:10 2007 -0800
-
- Fix Kernel#open
-
-commit 3b3ed6304deab01cb448665c5f4b17d813f04e65
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 19 21:43:58 2007 -0800
-
- Cleanup more method specs, all pass on rubinius now
-
-commit 76bbbf275f4e835444f684b2e688b292f20c1ffe
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 19 18:08:09 2007 -0800
-
- Implement protected methods
-
- * Added a bit more verbose specs to methods_spec.rb, to show
- specific cases.
-
-commit dce06b35481bb1951c587d36f63abaae069d0ae4
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Dec 18 22:28:30 2007 +0100
-
- Wrapped one String#unpack test case into compliant block.
-
- The test case is platform-specific, and not suitable for, say, JRuby.
-
-commit bb4945ea7b9253150f753508e92633b6e355194a
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Dec 18 21:30:24 2007 +0100
-
- Added new String#unpack test to exclude file for CI.
-
-commit 1bd8beb8e0b335f1de309d6320312a1b64af1e4d
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Tue Dec 18 19:51:47 2007 +0100
-
- Added more tests for String#unpack with Z/Z* patterns.
-
- These patterns are known to be tricky, and their
- handling was changed during Ruby's life.
- See [ruby-talk:98364].
-
-commit d26edc2269a77667dbefcfb1ea6212d8ada9ef97
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 19 01:25:27 2007 -0800
-
- Fix a bunch of Task GC problems, better memory management.
-
- * Use ALLOC* macros instead of malloc/calloc directly
- * Also, simple fix for Time
- * A Kernel#loop implementation
-
-commit 4143b92e6112241ff2facd64047491ce579bf0e9
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 19 00:43:32 2007 -0800
-
- Finished converting Object.new to mock() in specs.
-
-commit 9cae61f827d2eeca0a744e551551efd6bc85a2ae
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 19 00:02:46 2007 -0800
-
- Spec #it blocks must be inside #describe blocks for RSpec.
-
-commit 7df00ef6d2471d0b37829e0a4d1ef45edf782a44
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 18 23:28:43 2007 -0800
-
- More conversion of Object.new to mock() in specs.
-
-commit 12463512d0ad48fae3a1843d9d409649551dd13b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 22:53:38 2007 +0100
-
- Corrected String#* test to pick large enough Bignum, even on x64.
-
-commit 79cbff2c9a0cb15e9e5767f94242fa4360a0c4a0
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 16:43:16 2007 +0100
-
- Removed race condition from Kernel.sleep spec.
-
- This problem caused JRuby spec runs to hang.
-
-commit 3032e60e10dd1ae61ffb40b351f4f6731395602b
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 15:43:42 2007 +0100
-
- Enabled one Hash#rehash test case for JRuby
-
-commit 1808106191856f4f82b948abc5c7e708a747d059
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 15:40:49 2007 +0100
-
- Issue #153: Hash#rehash test enforces unspecified impl detail
-
- Wrapped the test so that it won't run with JRuby.
-
-commit efbf30477ea289911d9cafbde89ecbe2c8c65089
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 15:25:23 2007 +0100
-
- Corrected :mri --> :ruby
-
-commit 60a3ede3c64b62fb26905ed1c236c0e241b64515
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 15:23:42 2007 +0100
-
- Issue #182: String#to_f spec corrections for NaN, Infinity
-
- JRuby AND Rubinius treat "Infinity".to_f, "-Infinity".to_f ,
- "NaN".to_f differently than MRI.
-
- MRI returns 0.0 in all those cases, but JRuby and Rubinius probably
- do something more meaningful, they return Infinity, -Infinity and Nan
- respectively.
-
- It was agreed that JRuby's and Rubinius' behavior is a feature rather
- than a bug, and worth preserving and checking for.
-
-commit 521a82d8c325a33b3409423d61b589c7b8681870
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 15:14:28 2007 +0100
-
- Refactored commonly used generators into fixtures.
-
- Thus reducing copy-paste.
-
-commit 86820a339c74e3ca8fc9515e5fdf31ad42780201
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 14:12:43 2007 +0100
-
- Initial version of Generator specs.
-
-commit 91353183ace65d8e751db14a829e8f24d043710c
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 03:18:19 2007 -0600
-
- updated excludes for Kernel#sleep and Thread
-
-commit 6de193c0819f74717eb2e9eff8480f0d801b0e41
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 18 01:01:31 2007 -0800
-
- Replaced Object.new with mock() where appropriate.
-
-commit 1217fa030ff26712e9718ebecfe351830c543d7e
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 02:16:10 2007 -0600
-
- fixed redo in loop by save/restore condmod around loop context in compiler1
-
-commit df757142c774becfc2cbc4b38e43e31056acbae2
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 02:00:27 2007 -0600
-
- spec for using redo,next, and break in one loop
-
-commit 7169fd31b7c22750241212c242bc8aacdafe632f
-Author: Vladimir Sizikov <vsizikov@gmail.com>
-Date: Mon Dec 17 13:08:09 2007 +0100
-
- String#sub specs wrapped to correct JRuby test failures.
-
- JRuby reports Ruby version to be 1.8.5, but in this
- particular case it behaves like Ruby 1.8.6
-
- Differences between Ruby 1.8.5 and Ruby 1.8.6:
- different error raised.
-
-commit 04e228e131d06cd764d69375ddfdf44e4fec2b38
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 01:27:00 2007 -0600
-
- spec for Thread.pass and updated :mri to :ruby
-
-commit 11348e25ba30199e3beb05f8c38c18820fbefc3f
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 01:11:38 2007 -0600
-
- Some minor fixes in Thread specs
-
-commit 5cb3bcbf8f1d2a2237200ca0a9a9c6408d478ad6
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 01:11:05 2007 -0600
-
- spec and basic functionality for Thread.stop
-
-commit 3301fbb3ec43b5252c0aa6d45eb2f0e21581ff0a
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 01:09:49 2007 -0600
-
- Thread.sleep doesn't even exist in rubinius
-
-commit bd964f579f84a39097ecee1271664d672b6553a7
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 17 21:40:16 2007 -0800
-
- Replaced :mri with :ruby for spec guards.
-
-commit d21810882621356c35dcd101daca5ee5549f6607
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 00:42:32 2007 -0600
-
- Threads should report there status of sleep, aborting, and run
-
-commit 85a6476a236bd1e65d42ca03846c662a10842f37
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 18 00:41:09 2007 -0600
-
- Thread#status should return nil if Thread terminates with an exception
-
-commit ecb4455a75f4af2ae0059ca4960c2282b4ec632a
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Dec 17 23:50:24 2007 -0600
-
- specs for Thread#{key?,keys} and added key type checks for Thread#{[],[]=}
-
-commit c1a5d7e52b33ba6686441c61652bcc41ae0547f8
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Dec 17 22:15:37 2007 -0600
-
- specs for Thread#[]
-
-commit c2c7f0adc6ebbad925adb2471b6064b67528b420
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Dec 17 21:47:52 2007 -0600
-
- ensure LocalThread#current != Thread.current
-
-commit d05dac276f36326e143aa75bb43e4ab07bd8ddc9
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Dec 17 21:28:44 2007 -0800
-
- Fix a bunch more Kernel specs
-
-commit 4ddd0e144b4e4f64c51fc8d64952826d92a5e83f
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Dec 17 19:45:26 2007 -0800
-
- Fix Thread.abort_on_exception and Thread#inspect
-
-commit a12ad6fbc2589a7864a7c784386fb6ce7dae1db1
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Dec 17 21:29:49 2007 -0600
-
- Kernel#sleep and Thread#join specs now use locks to maintain automaticity instead of while th.status == 'run' loops
- added a Channel fixture to Kernel to support the use of locks in Kernel#sleep specs
-
-commit 72e3fb453c266e514b817daa66bf6033f1d19e40
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Dec 17 19:01:18 2007 -0800
-
- Fix callcc specs, revert all locals back to using the locals tuple
-
- * compiler1 now does what compiler2 is going to do, ie, only use the
- locals tuple to store locals. Storing them on the stack has proved
- to be a pain, and wont be used further.
-
-commit 6e35be2ddef8d055e064462c88a8b3f33eb4fe0f
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Dec 17 18:37:16 2007 -0800
-
- Faster Class#new, initialize can be private
-
- * Class#new now uses a bunch of inline assembly to be able
- to call a private initialize
- * Clean up Module#name a little
- * Made machine's rbt a little more robust
-
-commit 47a5bbf34ef8a60a18c1c8c6130d493a299ff852
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Tue Dec 18 01:10:33 2007 +0000
-
- Make sure files opened with "w" are truncated.
-
-commit 0fdc8c9b7d05cc2e96908b280ac144de0d04f646
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Tue Dec 18 00:16:27 2007 +0000
-
- Fix excludes for spec/core/stuct/{new,struct}_spec.rb
-
-commit 5b1252e6b2d8f8d70343b06f3520114de2040524
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Sat Dec 15 17:31:25 2007 +0000
-
- Minor fix to struct_spec to include fixture.
-
-commit 4fd0356ab9e9bb5c2a805b1f863b3177458966fe
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Sat Dec 15 16:29:49 2007 +0000
-
- Add case to spec/core/class/new_spec for names of nested classes.
-
- * Updated spec
- * Add some comments where this may be fixed
-
-commit 86736d564f34a2f97f7c7bedcab09c2472861b01
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Sat Dec 15 16:16:26 2007 +0000
-
- Fixes for struct class names.
-
- * Tighten up specs to show what class names should be.
- * Fixes #inspect
- * (Partially) solves the larger issue of an anon class getting a name when
- assigned to a constant - works now when Module.const_set is called.
-
-commit ad0d5ff2396baf43c8b2e37a3132765a074b241d
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Fri Dec 14 02:33:23 2007 +0000
-
- Fixes related to Struct.new
-
- * Fix to method_table to correctly handle DelegatedMethods
- * Changed spec/core/stuct/new_spec.rb to allow :rbx to call
- to_sym on objects passed to Struct.new to get the symbol
- value.
-
-commit 18f10dc700fe24f3bd230063bc7c1e8a82e8348f
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 17 08:58:22 2007 -0800
-
- Updated spec excludes to run with bin/ci under the new mspec.
-
-commit 678fb90c5c8aa96e10a9f95f520312f12f8fa3f2
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 15 22:43:44 2007 -0800
-
- Changed true/false/nil specs to not use def in describe block.
-
-commit 9e132474aafb6a0f0c968c2e085b09bfc07e1a0d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 15 18:49:31 2007 -0800
-
- Fixes to run the specs under RSpec and mSpec.
-
-commit cd3ecf52645b94921db92393e6e4d295d12bba88
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 15 00:59:11 2007 -0800
-
- Misc fixes to mspec. bin/mspec -t r spec finally runs!
-
-commit f3b3f70bb47b04e7a67c1dbc3ae38711857b5184
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 13 22:46:54 2007 -0800
-
- Multitudinous miscellaneous fixups for mspec and mmock.
-
-commit 55ab5b2ee42e4fabcfd8c51d6fac304cdfec31c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 10 01:01:58 2007 -0800
-
- Various fixes to mspec to run Rubinius specs.
-
-commit 86c0f131608b4ad7cba93eabd172a48e5b60ca0f
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 7 15:34:06 2007 -0800
-
- Added runner guards to omit specs that will always fail under RSpec.
-
-commit 75706dbfabbe359b6410f0d3743f0ea682146ac1
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 7 14:03:46 2007 -0800
-
- Added #runner guards to mspec.
-
-commit 3da390988031bf0066a849934ee758475ebbfa04
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 7 02:38:13 2007 -0800
-
- More fixes to run the specs under RSpec.
-
-commit 2b0f4e408b733dcd9089a19d78cd8e4cce20b99c
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 6 18:40:33 2007 -0800
-
- Yet more spec cleanup to run under RSpec.
-
-commit 1e4171d4682f55776e01e42f564714548c1d9bd9
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 6 02:16:42 2007 -0800
-
- More changes to run specs under RSpec.
-
-commit db020d30374e419792f76077757784008953c0a6
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 5 02:01:30 2007 -0800
-
- Various changes to get the specs running under RSpec.
-
-commit 968c2daa5345a0cddb8d3d5bd2b6bf2eeb0c1d6f
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 23:51:52 2007 -0800
-
- Convert remaining mocks to RSpec syntax.
-
-commit e5dc3ac814d1cda923131257dfbc9a30bf501b62
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 23:28:17 2007 -0800
-
- Convert remaining 'should_raise' to 'should raise_error'.
-
-commit a7be230ac71ece2bb8dcece72d629bcd0ce6a5e0
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 18:29:26 2007 -0800
-
- Converted specs from mini_mock to RSpec mock syntax.
-
-commit 4136e2fef4a81eb6e9e14070ff5301638f9acf14
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 02:25:31 2007 -0800
-
- Integrated mini mock with mspec. Updated spec_helper for main specs.
-
-commit d71c0c7412af01d6295d8caab43a80d0221ea16d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 01:49:17 2007 -0800
-
- Added #shared and #it_behaves_like to mspec.
-
-commit da61adc0a079c858385773b12d683e2f5e2cc0e8
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 4 00:43:15 2007 -0800
-
- Converted 'should_be_ancestor_of' to 'should be_ancestor_of'.
-
-commit 5ed0096aac58fef09fc766d808aea74356aacfa8
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 3 17:57:56 2007 -0800
-
- Replaced dev_null with CaptureOutput.
-
-commit 62282bd5cb5c555e6447dcf2d6d0da355913fe8b
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 3 17:30:01 2007 -0800
-
- Replaced 'should_include' with 'should include'.
-
-commit f990a7c58a7eee6dbbb3c50df7682942048b959f
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 3 17:21:50 2007 -0800
-
- Replaced 'should_be_close' to 'should be_close'.
-
-commit c53601c56bd222dfacf03f134132869eb71c5146
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 3 17:10:41 2007 -0800
-
- Finished converting should_raise to raise_error.
-
-commit 165dd99535b0829d2e2364fac24375068969c6ab
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 2 23:22:54 2007 -0800
-
- Convert should_raise to should raise_error for RSpec compatibility.
-
-commit c9ff50a4b4be25614cc0ac2ea5540cfe87a939d3
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 23:30:44 2007 -0800
-
- Moved mspec out of spec dir.
-
-commit e9a40a77b6fa7d08969ea195aabbb930b665fe02
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 23:25:59 2007 -0800
-
- MSpec base formatter and specs.
-
-commit 2fc3ac3f8efbaf0861cadfd59bcdf926d2196284
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 20:32:42 2007 -0800
-
- Port fix to ruby engine detection from mainline.
-
-commit 9a52e660536b4723bf24e2717fec757a1bdfa49f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 01:35:52 2007 -0800
-
- Match RUBY_NAME against /^ruby/ to pick up e.g. ruby1.8.
-
-commit 85536b98862f6abec310bfad03be17652ee65944
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 01:01:46 2007 -0800
-
- Implemented mspec matchers.
-
-commit c953335397c6c8b9d7b27a3d240fde3b3518cb48
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Nov 27 01:35:07 2007 -0800
-
- The rest of the mspec big picture.
-
-commit 2f598f193eb1b10065c8e1a8d5c2aaa89c689072
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Nov 27 00:39:59 2007 -0800
-
- Added base operator matchers and specs.
-
-commit 0cc0b5a97661970d4cbb5e46406e7ee06421e637
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 26 21:03:33 2007 -0800
-
- Migrated mspec and ci runners to mspec dir.
-
- Created stubs in bin/ci and bin/mspec that call the respective
- scripts in spec/mspec/scripts.
-
-commit b98d65eaa90d966fc2f7b8f8387266e241c202de
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 25 01:03:26 2007 -0800
-
- Added specs and guards for mspec.
-
-commit 7bb316d1291c9d0a16904d4a3ee60094a713f215
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 24 21:40:46 2007 -0800
-
- Prevent MSpec's #should(_not) from overriding RSpec's.
-
-commit c446988257a2104d72abd4a362dc21ca6183aab0
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Nov 20 22:47:25 2007 -0800
-
- Defines #should and #should_not for mspec.
-
- Specs for #should and #should_not.
- Adds example for using mspec "base" layer.
-
-commit 1aecf8e828dfd3d86f43d8c9c927e7c0ccb16b68
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 12 00:40:04 2007 -0800
-
- The mini rspec big picture.
-
-commit f2979b03f29e7ac810b81f9087ea53923de5a35c
-Author: Charles Lowe <aquasync@gmail.com>
-Date: Mon Dec 17 15:18:24 2007 +0100
-
- Added missing error checks to Dir.chdir block form.
-
-commit 028fee4e6d48514cae53f87c143bb68501bf58e9
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Wed Dec 12 20:01:35 2007 -0500
-
- Add further specification of size changes during Hash#delete.
-
- This was actually failing a while ago but now passes after recent
- changes.
-
-commit f757f4359c86f778ac8e5931b8915511fd03506d
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Wed Dec 12 19:59:28 2007 -0500
-
- Tighten another spec in core/hash/equal_value_spec.rb
-
- Hash#== compares keys with matching hash codes via eql?
-
- This spec was using hash keys where key.eql?(key) was false.
-
- That's pretty pathological, but there's probably some real
- non-conformance with MRI here. MRI can test for object identity
- without calling eql? so a key is still found even if it doesn't
- eql? itself.
-
- That's not really related to the behavior this spec is specifying,
- though. So, this patch just uses a less pathological implementation
- of eql?
-
-commit 3f73ddf6bec5c704ceb5ed43481971860293353d
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Wed Dec 12 19:49:49 2007 -0500
-
- Tighten spec in core/hash/equal_value_spec.rb
-
- "Hash does not compare keys with different hash codes via eql?" was
- failing because it detected that eql? was called on a key. However,
- eql? was not being used to compare keys with different hash codes
- from the two hashes. Instead, eql? is used to compare a key to itself
- during hash element reference, in order to distinguish between two keys
- with equal hash codes that aren't eql?.
-
- The tightened spec only fails if the keys are compared eql? to each other.
-
-commit e355e98a32f34619628a17f5052750da6881cda9
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Wed Dec 12 12:26:15 2007 -0500
-
- Add specs for hash stability of various Numeric subclasses.
-
-commit 0d774c99254b2c5992a17ecb2a5a12dcd2cad05e
-Author: Chris Shoemaker <chris.shoemaker@cox.net>
-Date: Tue Dec 11 20:37:45 2007 -0500
-
- Add a Hash#store spec for storing unequal keys w/ same hash.
-
-commit edfff4981285007ecac132f565243150a8a8bd7e
-Author: Curtis Schofield <123@noself.net>
-Date: Tue Nov 27 19:02:45 2007 -0800
-
- Specs created for Process#gid and Process#uid
-
- * both are using the unix system command 'id'
-
-commit 4e269d01238537cc45f4c347b12053616007d94d
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Dec 16 23:46:50 2007 +0100
-
- Excluded evil Thread specs.
-
- This makes bin/ci usable (pass) again on my system, where it was horribly
- broken before.
-
-commit b32c46ba95f2ecdaf646a030b96ee9b3737929a0
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Dec 16 23:37:26 2007 +0100
-
- Excluded failing Kernel#eval specs.
-
-commit 0c56f3a1f84dd94d1f9685af9e9d6e0efd0cfabf
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Sun Dec 16 20:24:54 2007 +0000
-
- Tighten up specs for what should happen when array shrinks during iteration.
-
-commit bfa8c532605c9e3b3d7f853516de9aae596c611d
-Author: Hunter Kelly <retnuh@gmail.com>
-Date: Sun Dec 16 19:11:25 2007 +0000
-
- Added specs for Array#each when the array is changed during iteration.
-
- Ditto for Array#each_index.
-
-commit b3aa2af4a3467b4eeb8765010286c12bd5adfbf9
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Dec 15 22:53:35 2007 +0100
-
- Sanitized Object#id spec.
-
-commit cce5b7004a774041d78c3b2e55af8063335a9512
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Dec 14 19:02:57 2007 -0800
-
- Fix sleep spec, implement Thread sleep status and death detection
-
-commit c2475838be23ae287075b7e9ea832013f1db77c4
-Merge: 30f20cf... d061b86...
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 14 10:56:53 2007 +0100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 30f20cfbd67487c426827406890fdb06fac8045c
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Fri Dec 14 10:56:17 2007 +0100
-
- Fix race conditions in Kernel#sleep spec by ensuring target thread is actually sleeping before continuing.
-
-commit d061b864f636210e40982d961b0aa5afc24543d0
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 13 23:04:27 2007 -0800
-
- Fix require specs to not require checked in .rbc or .rba files
-
-commit 41831976d25a4d5a8e26673199276098cc45b4d3
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 13 22:40:43 2007 -0800
-
- Fixed Thread#run, added corruption detection to rbc files
-
- * Thread#run was confusing the Thread scheduler, cause things the VM
- to quit running.
- * Added corruption detection to .rbc files in the form of a SHA1
- hash placed in the .rbc, just after the header.
-
-commit 77f0f29060d5ba3f33dc45029525acb715eb61c2
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Dec 14 15:10:59 2007 +1100
-
- Compiler2 fix for attrasgn in masgn
-
- An attrasgn node contained within an masgn does not include
- the assigned value in the attrasgn sexp. This was leading
- to the argument count to []= to be understated by 1.
-
-commit faaa1932fe05ee4d506b768f8d9d884af5345547
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Dec 12 19:59:11 2007 -0600
-
- fix non-determinism from Thread.sleep by removing blocking sleep
- add check for duration of 0 or 0.0 to instant return and added more specs
-
-commit e98b2d1f9788c1813bef2d920779c95effbd3d9f
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 11 17:27:43 2007 -0600
-
- spec and fix to allow floating point timeouts to Thread#join
-
-commit 801cb5ef58a6debfd348a33f864737cbce7c3d77
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 11 17:26:58 2007 -0600
-
- added noncompliant spec showing that sleep(nil) is allowed in rubinius
-
-commit 84d280810c840d6699b5c9ad094964fe779235df
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Tue Dec 11 16:30:41 2007 -0600
-
- fixed Thread#sleep to allows floats, and switched Thread::sleep, Kernel::sleep to use Thread#sleep on current thread
-
-commit 3d10a8a10741786ba76a4cc1083934f908d52ec2
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Mon Dec 10 17:13:34 2007 -0800
-
- Allow Thread.new to take arguments
-
-commit 4f5258b938a7aacf31e73b5fe6312e3c927d9cf8
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Mon Dec 10 00:21:20 2007 -0800
-
- Fix rb_define_alloc_func
-
-commit 7ab0f524de5a6b796ec1000402392cb138150eed
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Fri Dec 7 15:06:45 2007 -0800
-
- Initial ThreadGroup implementation
-
-commit 53fff95e300b1b26ed16f12c13684eadf8235d7a
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Fri Dec 7 01:30:55 2007 -0800
-
- Add rb_str_substr
-
-commit ec82de9f67e271718b874c0d777765da696bef88
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sat Dec 8 15:26:17 2007 -0800
-
- Add wrapped struct spec
-
-commit 65998d601aae601b3b43878f534362136a01ff17
-Author: Brian Takita & Nathan Sobo <brian.takita@gmail.com>
-Date: Fri Dec 7 17:18:24 2007 -0800
-
- Added specs for Module#undef_method.
-
-commit 97f8c9c32b9400ae42d0dc80aa7e17b22864fce9
-Author: Brian Takita & Nathan Sobo <brian.takita@gmail.com>
-Date: Fri Dec 7 16:13:02 2007 -0800
-
- Moved Object#to_a to Kernel#to_a. Added VM.coerce_to_array.
-
- VM.coerce_to_array will be used for splatting any object.
-
-commit 865ce7d771a101bc8c2c9ae3a82cbc3f37450c4b
-Author: Brian Takita <brian.takita@gmail.com>
-Date: Fri Dec 7 12:47:08 2007 -0800
-
- Merge branch 'array'; commit 'nathan/array' into array
-
-commit b4541a90f84c898e3cd9851ac4b207d559078a59
-Author: Nathan Sobo <nathansobo@gmail.com>
-Date: Thu Dec 6 23:33:10 2007 -0800
-
- Updated language/array_spec.rb for more detail on splat operator.
-
-commit 577b2f1c395dc49165842c405fb47bbb7591158a
-Author: Nathan Sobo <nathansobo@gmail.com>
-Date: Thu Dec 6 18:30:16 2007 -0800
-
- Fixed :many_if for compiler 1.
-
- Before it was translating many_ifs to a flat array of if statements instead
- of nesting them. Also, multiple boolean expressions in the case were not
- expanded to a boolean disjunction.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 1d555fa07aaed8e59e728cb0013daa10b3b17b25
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Dec 6 21:24:44 2007 -0500
-
- Add some JRuby-inspired eval specs
-
-commit 3131fb81eef380d163d028f5587475bbf170befb
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 6 12:19:49 2007 -0800
-
- Fix minor constant lookup issue and add timing to mspec
-
-commit 26897cd85c693cac10229d7467436717552088c0
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Dec 6 11:42:36 2007 -0800
-
- Fix another constant lookup bug
-
-commit 06a3f07999aeb4f7379ea40205451d326d1ba596
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 16:37:15 2007 +0100
-
- Updated CI excludes for IO#each and IO#each_line.
-
-commit b495ab1019e9ee136e9d099faa51cba03c48e947
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 16:01:31 2007 +0100
-
- Extended argument checking in IO.read.
-
- We're now checking that offset isn't negative either. This is done
- before the length argument is checked, mirroring MRI's behaviour.
- Also fixed a typo in the length check.
-
-commit 4fa2fbb6b6c27ced5d6cf902e63e3989c2d29b64
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 14:56:41 2007 +0100
-
- File.truncate raises Errno::ENOENT if the given file doesn't exist.
-
-commit cb7a0a7315e57f1adff0976bcd6b0c4a1a94d8c5
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 14:15:55 2007 +0100
-
- Added support for the length and offset arguments to IO.read.
-
-commit 9fe8f2bd73e28d28b7a9249e629ab7681321e4d5
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 14:07:21 2007 +0100
-
- IO.read only accepts file names and uses File to open and read them.
-
-commit 7ab1d9f3434e3f3b021de2f4087f2502e229c7a0
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 14:00:19 2007 +0100
-
- IO.new(nil) raises TypeError now.
-
-commit 227f6b4bf45b55eb659d41507d38fe5071ef7424
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Dec 6 13:24:31 2007 +0100
-
- Fixed a typo in File.writable?.
-
-commit 645f30882c9dd39d13f49e45f2f32c43ebe25182
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Thu Dec 6 03:51:11 2007 -0800
-
- Update Dir excludes
-
-commit e60ee517013d44c2ec6faf147f7dbd685fa520c2
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Thu Dec 6 00:40:17 2007 -0800
-
- Fix flag checking in Dir.glob
-
- Also clean ".", ".." skipping
-
-commit fa681ad7a3c1d0e1b4fb0702c2fc63cd80ec9377
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Wed Dec 5 18:08:41 2007 -0800
-
- File.fnmatch? should accept escaped wildcards
-
- Also fixes more Dir.glob specs
-
-commit e6b8ce23729606bf6fa748ea63c0e0a59b48a476
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Wed Dec 5 15:35:32 2007 -0800
-
- Don't unescape leading period in File.fnmatch?
-
-commit 1cf054a08b0aeea7c348ff26c71ccaf22c02ce70
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Dec 6 02:36:54 2007 -0500
-
- Rename Array#pretty_inspect to avoid conflict with pp
- Hardcore bikeshed action on the way TestGenerators are inspected
- Change describe.rb to call the renamed pretty_inspect
-
-commit 519d1226027623274766641a256e2a9753257266
-Author: Nitay <nitay@powerset.com>
-Date: Wed Dec 5 16:07:25 2007 -0800
-
- Fix Constant = Class.new setting of name
-
- Signed-off-by: Kevin Clark <kevin.clark@gmail.com>
-
-commit 568c57ca57d4a9183e492024e17aa1352902d1d2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Dec 5 20:31:43 2007 -0500
-
- Clean up mspec output to prepare for unit_diff support
- Use pretty_inspect to display compiler2 TestGenerator output
-
-commit e250521194380f4c942fd6d53664b746ca63e3e3
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 5 17:27:27 2007 -0800
-
- Fix constants spec to scope the fixtures
-
-commit 7010073617a4fa95ea5491284fef97a083d9d4f3
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Dec 5 14:42:27 2007 -0800
-
- Vastly simplify and fix constant lookup
-
- * New constant lookup specs to test behavior
- * Added StaticScope object and field on CompiledMethod which stores
- a StaticScope instance which indicates the lexical scope of the CM.
-
-commit 163e56646a817301201af843b45c973da058688c
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Dec 5 23:00:16 2007 +0100
-
- The spec for Dir#rewind doesn't pass on Rubinius.
-
- It's not platform specific, but we don't have a working Dir#pos yet
- and the Dir#rewind spec relies on it.
-
-commit 3afe61bd78aa9e850f081b83ca2c478ae297bda1
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 5 13:51:05 2007 -0800
-
- Changed mini_rspec to show failures unless being run by autotest.
-
- Added dir_entry.rb to .gitignore.
-
-commit 0c661894b54615ee4915d61569e072ffdfa8826d
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Wed Dec 5 09:17:24 2007 -0500
-
- Much-improved tiny option parser lib/options.rb.
-
- * The Options API is much more user-friendly now,
- size is still about 100 LoC
- * Specs for the API.
-
-commit 092e0081c26eeda2ca6561eb19123b468965c84a
-Author: Ryan Davis <ryand-ruby@zenspider.com>
-Date: Wed Dec 5 01:40:31 2007 -0800
-
- Added support for autotest.
- Requires a new release of ZenTest to actually work.
- I'm tired, I'll do that tomorrow
-
-commit 9e3e41d71d1bab8104ae17ff34aaa2311be3b0b1
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Dec 4 22:59:49 2007 -0800
-
- Commit miss for require specs
-
-commit d1a6f0805b739930e54406188e32ac1e0f30a74b
-Author: Eric Hodel <drbrain@segment7.net>
-Date: Tue Dec 4 22:24:49 2007 -0800
-
- Add specs for Kernel#require, never add .rbc files to $LOADED_FEATURES
-
-commit a60e3bf901b62fbbbef59acb2c6c9f164be1fbbc
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Dec 5 14:10:15 2007 +1100
-
- Cleanup case spec, update excludes
-
- * converted case specs to not use should
- * separated out case specs with target expressions from those without
- * updated excludes for two failing specs under compiler1
-
-commit f0de77911ff0b4532a47fb9803685e8d968d51ec
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Tue Dec 4 09:42:49 2007 +1100
-
- Fixes for compiler2 when_spec failures
-
- * Added compiler2 spec for when without an arg
- * Added spec for when without arg with an else to
- spec/language/case_spec.rb
- * Implemented many_if sexp compilation
-
-commit c9c67738ecae341441098993923838a15b64d166
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Dec 4 20:42:27 2007 +0100
-
- Test Etc.getgrnam() with "daemon" instead of "root".
-
- The "root" group seems to be a Linux-ism.
-
-commit 1fd6d97e8eb20ce9908cc0abd09b7c5555ff5720
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Dec 4 19:31:24 2007 +0100
-
- Post-move fix for the Options spec.
-
-commit ead52428d99549b6b53b8897d969e80072395ef6
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Dec 4 19:12:28 2007 +0100
-
- Moved codearchive.rb, options.rb and readline.rb from kernel/core to lib.
-
-commit 0e4568bcc23011957cc250de2a93031648281b21
-Merge: 78fba04... fbc5ad5...
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Tue Dec 4 00:50:46 2007 -0600
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 78fba04c31e9d97c32862e9e104e3917dcff9137
-Author: Charles Nutter <headius@wlan100.headius.com>
-Date: Tue Dec 4 00:39:05 2007 -0600
-
- Making socket spec more reliable by using nonblocking accept for TCPServer and adding a "ready" flag for UDPServer.
-
-commit 7e925ea53239207f5dd9ac5daddda8e0f1f3b687
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Dec 2 23:33:29 2007 +0100
-
- Implemented Etc.
-
-commit 450778cf5f416f6b9531664d4fff2c159c93cbe7
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Sun Dec 2 01:39:28 2007 -0600
-
- Shared spec for class_eval.
-
- - removed method-arguments from describe string
- This was causing bin/completeness to report 0 examples for Module#class_eval/module_eval
- - examples checking for TypeErrors test the exception is raised, but don't check
- the exact message as it is not part of the interface.
-
-commit cd0d11c7eb23d881f1dd73701bd3edc12c5bd744
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 1 15:28:41 2007 -0800
-
- Updated CI excludes for Dir.[].
-
-commit e41e501bcf686937fbd3b8cfc86f325d7e06184d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 1 10:54:35 2007 -0800
-
- CI spec excludes updates.
-
- * Fixed rake pristine task to whitelist Kernel#require fixtures.
- * Updated CI excludes for Dir.glob and Dir.[].
-
-commit 8f362a0350238366565a373f1feb9594efe03407
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Dec 1 18:50:55 2007 +0100
-
- Make sure we delete the directories we're creating in the mock dir.
-
-commit dfc1b1cd32f47b48dd358ca50226d614425ef8b2
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Dec 1 18:08:27 2007 +0100
-
- Dir.chdir now always resets the working directory when called with a block.
-
-commit 02f41a92bbafd1a555344e1082970e090cd1f9a5
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 30 23:41:29 2007 +0100
-
- Call StringValue on require's and load's argument.
-
-commit 601fd404ba04f383ee286be015edb7e8c58574d5
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Nov 30 14:27:44 2007 -0800
-
- Refactor Kernel#require
-
- * Refactor a bunch of Kernel#require into Compile#require_feature
- * VM.load_library now detects if the extension is already there
- and doesn't readd it
- * Added specs for #require
-
-commit 9b903cb7c5c6a3bfbaa3a7a91dc7bad830af7294
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Nov 30 10:56:02 2007 +1100
-
- Compiler2 fix for anonymous masgn, e.g. * = 1,2
-
-commit 08bc0a2f14494a30d5956d5bdcca9eb37c921780
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 30 00:16:07 2007 +0100
-
- Made check_argcount work with methods that don't take any arguments.
-
-commit 96108240fead7d764f3ec37d5eb20294f3a9dd97
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 29 21:45:32 2007 +0100
-
- Updated the CI excludes for Method#call.
-
-commit 61805ab7fac6ae9855baa05b42aebe66c3a2b3d3
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 29 21:44:49 2007 +0100
-
- Made Method#[] an alias for Method#call.
-
-commit 219d34dedf6ff0ed083cb5f1e8b6a5c437ad366c
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 29 21:22:05 2007 +0100
-
- Enabled the Kernel#method_missing specs.
-
- They pass now that they specs aren't confused by the Dir spec helper
- methods anymore.
-
-commit de5320efe8095e612e235bea7053084bb61d300d
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 29 21:17:58 2007 +0100
-
- Moved the Dir spec helper methods in their own module.
-
-commit 1ae47b5c091c209597bec7475935bbcff34b50b5
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 23:45:09 2007 -0800
-
- Applied patch from #151.
-
-commit adb5b139afa452869464fe53b710d7cb8b93131b
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 20:29:38 2007 -0800
-
- Better fix for guards to distinguish ruby, ruby1.x from ruby1.9.
-
-commit e53f72172e395c7766dcecadd2ffd6c7caf303e7
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 28 20:15:27 2007 -0800
-
- Patches (or modified patches) from #157-162.
-
-commit b07eeee79ea5a0c0160c34aec2d690f1b46f7380
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Nov 28 14:43:41 2007 +0100
-
- Fixed Bignum#modulo and Bignum#remainder.
-
-commit 85b05b5103aaeb5d946e0f691f77af2dafa6f30a
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Nov 28 01:00:07 2007 +0100
-
- Unified the File.unlink and File.delete specs.
-
-commit 2ec59a82f279a4ba6b5b781c90a7714aba767ed9
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 23:30:43 2007 +0100
-
- Be more specific wrt the expected exception.
-
-commit 54236949e9b974d4c4dcf95b63318c844c62aca4
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Tue Nov 27 19:58:50 2007 -0600
-
- Module#<=> is working, Updated CI excludes for Module specs.
-
-commit 55c7529f4c8b02eff7e0b594f33b28750877fca2
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Tue Nov 27 14:53:02 2007 -0600
-
- Specs for Module#private/public/protected
-
-commit 5b693fae3464abb6a5aa05d8236bd8f4610c89d4
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 19:36:06 2007 +0100
-
- We cannot use File.exists? to check whether a symlink exists.
-
- Use File.symlink? instead.
-
-commit e7eb6a8e1e1310c08220db0ed7979ec4c721fccb
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 19:34:48 2007 +0100
-
- Moved the after(:each) block before the specs, so the block is actually run.
-
-commit 4c284abb32029029ab7002147ef544493c7070f6
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 19:00:30 2007 +0100
-
- Added a missing Errno.handle to File.readlink.
-
-commit f163ca7c5e4a03d698a881853d1e0fab8a5be1a4
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 18:42:08 2007 +0100
-
- readlink() only works with symbolic links.
-
- This makes the spec pass on MRI.
-
-commit ca1cb21b5f694b3850a838f88d3ac5ded7de3e1f
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Nov 27 18:40:43 2007 +0100
-
- Naming convention fixes.
-
-commit cbf351cb59152a5528f6c6105cee96c67f7f6fcd
-Merge: f70d531... 5452983...
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Mon Nov 26 19:48:21 2007 +1100
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit f70d5314fcc75ef2e32fbd484de58bd5f7ed6cbc
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sat Nov 24 17:29:29 2007 +1100
-
- Implemented File::symlink and spec.
-
- Kudos to the Melbourne Railscamp :)
-
-commit c4a6a804185c18a182206afc1b8d5209d208077e
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sat Nov 24 01:08:41 2007 +1100
-
- Removed trailing whitespace.
-
-commit 9b9820e512f56b2c23c760887251d72c187aa297
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sat Nov 24 00:50:11 2007 +1100
-
- "Added File::readlink spec"
-
-commit 2dd272afe315dae0ad0b9bd49b6dfa9e98e50b1c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Nov 23 17:11:54 2007 +1100
-
- Spec-ed implementation differences on masgn RHS eval order
-
- Rubinius is (for now) deliberately non-compliant wrt eval
- order of RHS expressions in an masgn.
- * MRI, JRuby eval left-to-right
- * Rubinius evals right-to-left
-
-commit 361a1adcee182cf069352effd0949064b621bddc
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Fri Nov 23 16:16:08 2007 +1100
-
- Additional parallel assignment specs - use of to_ary
-
- * Added spec for when to_ary should be called on the RHS of an masgn
- * Added additional example of a complex masgn (from JRuby tests)
-
-commit 97cb3f5758f102cf8a07262c4c9bef4b22ca88b7
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Thu Nov 22 22:04:51 2007 -0600
-
- Added specs for metaclasses of true/false/nil on metaclass_spec as suggested by rue.
-
-commit d4f9eb7cd5fb17e3e8ce52db39e95a96362d3ad0
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Nov 22 13:05:10 2007 -0800
-
- Fixed wording of Rubinius extension Bignum domain specs.
-
-commit 50e1f80ef54d25aaa69d52a3d422547593836ac6
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Thu Nov 22 17:18:54 2007 -0500
-
- Added excludes for Kernel#open and Thread#abort_on_exception
-
- * Excludes Kernel#open raise specs
- * Excludes Thread#abort_on_exception specs
-
-commit 25607d4d884b4597bc69560e9390cd9dc1f4e44d
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Thu Nov 22 13:47:50 2007 -0600
-
- Specs for Module#alias_method
-
-commit c207618ad4113501aa5df4adb5d5aa3a60f5b9ff
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Nov 22 10:59:34 2007 -0800
-
- Use RUBY_ENGINE first, then pull in rbconfig
-
-commit ed5a46e13b35d6ad48cce1d3eed96c2f78ace049
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Thu Nov 22 11:42:36 2007 -0500
-
- Added basic specs for abort_on_exception
-
- * Added specs for Thread#abort_on_exception ($DEBUG on and off)
- * Added specs for Thread#abort_on_exception=
-
-commit 05ecef9162ba2c4a0da90c966a20a4f45c353d93
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Thu Nov 22 08:39:53 2007 -0500
-
- Added specs for when parameters are missing or invalid parameters are given
-
-commit 25d2c940d561dcac2c06df747762a229dddfbed1
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Nov 22 15:33:17 2007 +1100
-
- Another parallel assignment spec - rhs should evaluate l->r
-
-commit 8e4f8de446b842c13ad45a8e0e2c3c1ebf30bddb
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 21 17:42:17 2007 -0800
-
- Stop-gap prevention for Kernel#callcc hanging CI specs.
-
-commit a9d7163e4d9e8d4fb79c9769691b232676a44bd8
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Nov 21 15:50:39 2007 -0600
-
- remove compliant(MRI) from callcc specs
-
-commit 812e922c8e7cda728d6b7f32933b75eb009eef11
-Merge: 2e221b9... f24bb1f...
-Author: Nathan Witmer <nwitmer@gmail.com>
-Date: Wed Nov 21 12:32:18 2007 -0700
-
- Merge branch 'callcc_spec'
-
-commit f24bb1ffdf941df78098da262a62e881653b1a99
-Author: Nathan Witmer <nwitmer@gmail.com>
-Date: Wed Nov 21 12:31:28 2007 -0700
-
- Added scope-related callcc specs, compliant(:ruby) only.
-
-commit 2e221b9f1d7ffa41431e5bd51fdd36434e7f838f
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Nov 21 14:41:43 2007 +0100
-
- Spec and fix some more String#slice bugs when given nil, also use Undefined.
-
-commit db338d9d8705fd668a5639d483ff47908aa014ca
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Nov 6 16:53:13 2007 +0100
-
- Fix String#rindex when given nil as offset.
-
-commit 6eab3b692a50c1a37cc39c21d743de1488402f64
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 21 00:00:24 2007 -0800
-
- Added MRI stdlib Fcntl to lib/ext with build script.
-
- Added lib/fcntl to load extension. This may need a better solution.
- Added INT2FIX to subtend.
-
-commit 5268c0b29c1fb07a911fe601e30b21ffe04f7e81
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Nov 21 17:02:14 2007 +1100
-
- Additional specs for parallel assignment
-
- MRI allows parallel assignment to:
- - assign via object.method=
- - assign via []=
- - use a lhs arg as an arg to another lhs assignment
-
- All three scenarios currently fail in Rubinius, apparently due to
- miscalculating the number of args to an assignment method under
- parallel assignment.
-
-commit 462f68b95a70c24e41cad5a40969c4651c7de181
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Tue Nov 20 02:12:44 2007 -0500
-
- Added specs for Kernel#open when block is given
-
-commit ab9e40600fd2522d4abce86f7b8bdc632f6e9018
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Mon Nov 19 23:42:55 2007 -0500
-
- Added very basic specs for Kernel#open
-
-commit b47efc9f9872ecca68a06f6864f39617e06762b0
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 19 00:24:15 2007 -0800
-
- Updated CI excludes. Runs clean on Leopard.
-
-commit 3ff04e52bc9cb03439567ddb9b3b63b3034b30c3
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Nov 19 00:03:58 2007 -0600
-
- more specs for Kernel.callcc, ensures callcc return value semantics
-
-commit 06d5312c51b09faef87d2deb53f3c472eaa94100
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Sun Nov 18 17:49:44 2007 -0600
-
- basic callcc behavioral specs
-
-commit 53433f0e9ddba2eac876f7a1fb0f9d292ee37286
-Author: Nathan Witmer <nwitmer@gmail.com>
-Date: Fri Nov 16 16:51:18 2007 -0700
-
- Added Kernel#callcc spec and fix for LocalJumpError with no block given
-
-commit d324779b8b5c8dd84438c08ec4f2b2574282f93e
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 15:17:21 2007 -0600
-
- Added Module.nesting
-
- Some specs are failing on rubinius because the parent
- field is not being properly set.
-
-commit cff726c9dc3631b2e0ddc3e12bd3af532f7e1ef4
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 14:49:38 2007 -0600
-
- Added spec for calling Module.nesting on root level
-
-commit 05adb6070889d7021a1e53ab82b855c3554d4f5c
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 14:45:23 2007 -0600
-
- Fixed specs for Module#constants
-
-commit 1f1c857e1d8c37213a91daaad3fc3bfcbf2bef61
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 14:43:55 2007 -0600
-
- Fixed spec description for calling Module.nesting from methods.
-
-commit 242c947c6e4d007685e8aa0c44ac505c7dab4239
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 14:38:32 2007 -0600
-
- More specs for Module.nesting
-
-commit 3560fd7ef0d5a65a9cb055d87fa7103ed3bdb029
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 10:24:45 2007 -0600
-
- private keyword specs reflecting problem described on ticket #133
-
-commit fd31e1e592237832bd5e605f604d15385df0615a
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 16 04:15:27 2007 -0600
-
- specs for Kernel#block_given? by Francisco Laguna
-
-commit 87ebce4cf2430198578decdb4c7dc1003db37f8e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Nov 15 22:07:39 2007 -0800
-
- Ticket #121 by Jeremy Durham -- File modes
-
-commit 4a67e0ade233aaaa3a2ff17161b298872f8a5f83
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Thu Nov 15 14:20:19 2007 -0600
-
- Splitted enumerable_spec.rb into a file per method.
-
- Added some specs by Francisco Laguna.
-
-commit 0b933650330f57e7db1bf8574d0b7eecf0635996
-Author: Bryan Helmkamp <bryan@brynary.com>
-Date: Tue Nov 13 11:34:20 2007 -0500
-
- Added specs for File.mtime.
-
-commit 42a7de27c1a6082fee7b9baaf05b9394ffe90ddd
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Nov 12 19:57:38 2007 +0100
-
- Updated CI excludes for File#atime and File.new.
-
-commit 3d106d6a9b8ce0b34e7b6f9426da51b83fe5f676
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Nov 12 19:54:43 2007 +0100
-
- Added File#path.
-
-commit 247da25a0120d468fe9f189a6235962f9658b65e
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Nov 12 19:23:09 2007 +0100
-
- File now deals with numeric modes and accepts a permission argument, too.
-
-commit 087deaed0dcf4ae2c8dc713eeccfed9a0ebabe6f
-Merge: 4355e96... 1c9d213...
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 23:15:01 2007 -0800
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 4355e96b05de4d4d086dfa86b8fe19bdcecfbe82
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 23:14:16 2007 -0800
-
- -a
-
-commit 7e975d1aca38a3bfe07fda431aeaba376bce19c1
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 23:09:47 2007 -0800
-
- Get rid of irrelevant specs
-
-commit 1c9d2133fc294964ce08e9a7020083c379f74ca0
-Author: David Waite <david@alkaline-solutions.com>
-Date: Sun Nov 11 23:46:08 2007 -0700
-
- Remove temp directories within mkdir spec on exception.
-
-commit 2110fc75dc6a7ab521249f259bc6fdc78d565b11
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 22:36:08 2007 -0800
-
- Update CI Excludes
-
- * Expected failure of "raise an Exception if it has
- the wrong number of argments" due to dispatcher bug
-
-commit 0f2a183a46ba085d9c99ed4767cd18c0482e6d45
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 22:14:07 2007 -0800
-
- Implement File#atime
-
-commit 671b340f340ab6b8d9c13b27d52a782ce3268b2a
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 11 21:24:34 2007 -0800
-
- Update CI excludes
-
-commit f7ba96f6b41de9a3696a03e9efe25c8b037a4f07
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sat Nov 10 11:24:12 2007 -0800
-
- Adds spec for File.open
-
- * In resonse to Lighthouse Ticket #102
- "File.open should throw Errno::EACCES opening non-permitted file"
- * Passes MRI, doesn't yet pass RBX
-
-commit 719329b3f5179766e23a27e427cd0c0846c85ffa
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Mon Nov 12 10:38:42 2007 +1100
-
- Added IO#to_i implementation and spec.
-
-commit cc100fc08be101ecdf0daba1966977fb8e39fa6e
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Mon Nov 12 10:30:25 2007 +1100
-
- Added IO#fileno implementation and spec.
-
-commit d036f5c16a4836d638be83108be35df532d9221a
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Nov 11 23:17:12 2007 +0100
-
- Made SystemStackError subclass of StandardError.
-
-commit bf1c3dc3e463aeaf4e0cee1cbd46b15e7693a395
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Nov 11 20:36:25 2007 +0100
-
- Removed an old Method#arity spec exclude.
-
-commit 72c3495f3513e54c2488292bcdaca9208b6f0339
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 11 10:44:53 2007 -0800
-
- Removed transient dirs from Dir specs.
-
-commit 11f0ed51b4bfb3bea2b544a82b3158fd3daf2ad8
-Author: Victor Hugo Borja <vic.borja@gmail.com>
-Date: Fri Nov 2 03:02:28 2007 -0600
-
- Specs for Module#remove_const
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit e8158f14f0f02e3b0cdcb4182e1277928324cc0c
-Author: Nathan Witmer <nwitmer@gmail.com>
-Date: Sun Nov 11 08:19:10 2007 -0700
-
- Fixes for UDPSocket spec
-
- * Renamed the description to match what was actually being tested
- * Uncommented the code and wrapped it in an "it" block, to prevent
- conflicts/hangs with bin/completeness runs.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 9b973a98d2ebddacd50f0fcb58903bb53bdff3f5
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Nov 11 13:30:22 2007 +0100
-
- Ticket #98: Dir includes Enumerable now.
-
-commit 8d957f186cd4d2c5e6b236de4a0878d38b464848
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Nov 11 13:26:00 2007 +0100
-
- Implemented Module#included_modules.
-
-commit 0021b24ba490fe01f96ef17957328feeedfc4c29
-Author: Nathan Witmer <nwitmer@gmail.com>
-Date: Thu Nov 8 21:42:41 2007 -0700
-
- Commented out code in UDPSocket spec so bin/completeness doesn't hang
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 56687aed201fb864587807cca893268a9f1e2050
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 11 00:10:14 2007 -0800
-
- Method fixture for yield specs.
-
-commit 421aa58f9135807487864adcdcac79f7b6da33c1
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 11 00:08:35 2007 -0800
-
- Specs for yield keyword based on patch in #114.
-
-commit 5ba0b2030c55474f9d8a096d309678ca24a4699b
-Author: Jeremy Durham <jeremydurham@gmail.com>
-Date: Sun Nov 11 01:35:08 2007 +0100
-
- Ticket #105: Implemented Bignum#eql?.
-
-commit 47356fe39033f8571559a4fef933681fda871efd
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Nov 11 01:14:26 2007 +0100
-
- Made specs for Kernel#respond_to? and Kernel#method pass.
-
- KernelSpecs::Foo#baz is defined in another spec, so these two specs
- may not rely on #baz being undefined. This is a horrible workaround
- for the problem that multiple specs make use of the same module and modify
- it freely.
-
-commit 68b4fc7c0192f537fe9727927ac35c440dbdc03a
-Author: Akshay Rawat <akshay.rawat@gmail.com>
-Date: Thu Nov 8 18:21:03 2007 +0530
-
- Updated CI excludes.
-
-commit a1eee3814a5d054cd00e26b40c063d41880bf6c7
-Author: Chris Pettitt <cpettitt@gmail.com>
-Date: Sat Nov 10 14:10:47 2007 -0800
-
- Refactor IO.gets spec to have less duplication.
-
-commit 56497d27bdb3a82d549f89b9fc9fcf0709f99b3e
-Author: Chris Pettitt <cpettitt@gmail.com>
-Date: Sat Nov 10 14:07:21 2007 -0800
-
- New spec: IO.gets('') should advance the file position to the next non $/ character.
-
-commit 95158f5a4141d5d3e2893304e49bfeb62cc7b226
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 10 13:35:03 2007 -0800
-
- Added rescue to prevent meltdown until rbx begin/rescue/ensure is fixed.
-
-commit a39155cb029ca3c1e5e5d69e0e269c685c040f6e
-Author: Chen Yufei <cyfdecyf@gmail.com>
-Date: Sat Nov 10 12:24:38 2007 +0000
-
- Fixed IO#gets when separator is empty.
-
-commit f9c31ce1d2a68c15def98aad6c6ff35eb56cd523
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Fri Nov 9 20:24:40 2007 -0800
-
- Clean up Enumerable#include? specs
-
-commit f017fad69be5d4034a4c5437acf77ec4749b0d75
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 4 20:54:06 2007 -0500
-
- Clean up Enumerable#(collect, entries, find, find_all) specs
-
-commit 81550f082396b4455c3681ae966be1371be0a5db
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 4 13:18:52 2007 -0500
-
- Update excludes
-
-commit d5fd2ee893ea608c7e19cb674a4da7b9f49542e6
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 4 12:16:58 2007 -0500
-
- Cleanup/rewrite Enumerable#find tests for sanity and clarity
-
-commit 39f21aa76f6ddc45be79e4e4e978b4c1c2beed71
-Merge: 17d2e4c... c1b9f74...
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Fri Nov 9 20:25:13 2007 -0800
-
- Merge branch 'master' of http://git.rubini.us/code
-
-commit c1b9f74f88be963e72de763da9130f46869d89fb
-Author: Chris Pettitt <cpettitt@gmail.com>
-Date: Fri Nov 9 12:36:04 2007 -0800
-
- Fix some failing specs for IO#each and IO#each_line.
-
- Also refactor some common code into a helper method.
-
-commit 74af37b849507e504503359a08245effaad7634a
-Author: Chris Pettitt <cpettitt@gmail.com>
-Date: Fri Nov 9 10:58:33 2007 -0800
-
- New specs for IO#each and IO#each_line
-
- This change adds some new specs for IO#each and IO#each_line factored into
- a shared .rb, because one is the alias of the other. Added failing specs to
- excludes.
-
-commit d162a396b566846445328d6c42d3d5f10fcf7ee6
-Author: Matt Pelletier <matt@eastmedia.com>
-Date: Fri Nov 9 02:32:25 2007 -0500
-
- Add and refactor patches from Andrea OK regarding #send
-
-commit 63f0ed010e65549597f6bddb0686ba04157ca478
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Nov 7 09:52:25 2007 -0800
-
- Fixed Method#call spec failing from renamed fixture method name.
-
-commit 1ef46468d7808c52b07388130069cb2e7854bff8
-Author: Matt Pelletier <matt@eastmedia.com>
-Date: Wed Nov 7 04:48:39 2007 -0500
-
- * Update CompiledMethod#arity to be accurate for cases of required and/or optional arguments, with or without blocks
- * CompiledMethod#arity is still inaccurate when splat argument is present (the presence of splat overrides #required)
- * Add specs for more thorough coverage of various argument use cases
- * Includes known Rubinius-failing specs for splat-related arity
-
-commit b7726f26dae95936aa1c3fdf2c52dd18ef7413cf
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 17:48:51 2007 -0800
-
- Updated CI excludes for fixes to public|private_class_method.
-
-commit eb18f898e3ae8e5a1bf3b01291a12516c6a22301
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 17:18:22 2007 -0800
-
- Added Module#protected_method_defined?. Updated CI excludes.
-
-commit aa8904cdbd8b4851be4f05cec3000b04cfc9f6c1
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 17:14:12 2007 -0800
-
- Added Module#private_method_defined?.
-
- Fixed specs for Module#public_method_defined? and
- private_method_defined?. Updated CI excludes.
-
-commit 063b61759ee86f5def2422d16f1eb854c8b9eb76
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 13:39:21 2007 -0800
-
- Updated CI excludes for StringIO.
-
-commit 3c79f871379d2d4b5431138033f723efbf4a795d
-Author: Dr Nic <drnicwilliams@gmail.com>
-Date: Sun Nov 4 16:45:30 2007 -0500
-
- Extended StringIO spec "flattens a nested array before writing it" to ensure deeper test scenario
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 916d617a60cf83ac26c3090310236193f5842ff6
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 13:11:54 2007 -0800
-
- Updated CI excludes for String#scan.
-
-commit fee1d904197c369c561ae3b11aaf582f1b87d1b0
-Author: Matt Pelletier <matt@eastmedia.com>
-Date: Sat Nov 3 16:06:16 2007 -0400
-
- Fix test of String#scan. Do not force matches into array using splat.
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit cc9182cfcde60a63bf566f73c6004b7e46347e77
-Author: Daniel Lucraft <dan@fluentradical.com>
-Date: Thu Nov 1 17:01:03 2007 +0000
-
- Added File.rename
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit fc2b7aa65ab338d8ff543552659046c93659c3ce
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 12:06:13 2007 -0800
-
- Commit rework of Carl Drinkwater's patch from #72.
-
-commit 7f6564b96762d7b3deb9f021789182f5c664a766
-Author: Chris Pettitt <cpettitt@gmail.com>
-Date: Sun Nov 4 10:38:04 2007 -0800
-
- Fixes for two IO#gets spec failures.
-
- This patch fixes the following two IO#gets spec failures:
-
- IO#gets assigns the returned line to $_
- IO#gets returns the entire content if the separator is nil
-
- Signed-off-by: Brian Ford <brixen@gmail.com>
-
-commit 705e8e05496167b1af3a1e3ff3446d325ca54e07
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Nov 5 02:10:56 2007 -0800
-
- Added Module#public_method_defined?.
-
- Updated CI specs for #public_method_defined?.
- Small fix to find_method_in_hierarchy to symbolize arg.
- Updated some spec wording and removed spec'ing exception string.
-
-commit 17d2e4c6ae0c40376fe121786a362c8bc8ce951c
-Merge: 2b77ee8... c07472c...
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 4 20:58:42 2007 -0500
-
- Merge branch 'master' of http://git.rubini.us/code
-
-commit bd6c27f4724bdc461a7036e6373a0ad23060020a
-Author: Trotter Cashion <cashion@gmail.com>
-Date: Sat Nov 3 15:57:21 2007 -0400
-
- Added operator precedence specs for '&&' and 'and'.
-
-commit 2b77ee8b74373a3251973d96c931422909605e29
-Merge: 30d7618... 76aa72e...
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sun Nov 4 13:43:23 2007 -0500
-
- Merge branch 'master' of http://git.rubini.us/code
-
-commit 2c90ce28cc73e08d9fb74b5c7e815807314ba269
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 4 07:18:09 2007 -0800
-
- Updated CI excludes from 85d63b676e.
-
-commit 85d63b676e463a2bec9a322bc8eeffd2daee433b
-Author: Chen Yufei <cyfdecyf@gmail.com>
-Date: Sat Nov 3 23:39:23 2007 +0000
-
- Added specs for IO#gets
-
-commit be5b9595f2077080c0c1179ab9689352d8faea3a
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 4 00:31:12 2007 -0700
-
- Updated CI excludes.
-
-commit d46ad4b63d4a5f77609b0880b7f24e8e27404805
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 4 00:11:52 2007 -0700
-
- Updated CI excludes.
-
-commit 1f307223c673c6744f8b85fc3e707a3419b1a0e8
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Nov 4 00:06:48 2007 -0700
-
- Guarded #freeze specs for MRI and JRuby.
-
-commit ca50fd7d979c36f8af306e0e1474aac5408dd66d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 3 23:22:31 2007 -0700
-
- Guarded specs for #frozen? for MRI and JRuby.
-
-commit 16b36030a796b877809d5d6ea556266c4b4a6413
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 3 20:53:26 2007 -0700
-
- Removed NULL characters from language/precedence.
-
- Enhanced rescue output when loading spec files.
-
-commit 10510ece16ebb5e0ba921e0be631a4740f3e4453
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sat Nov 3 23:09:30 2007 -0400
-
- Fix a method_missing cache error.
-
-commit b313c5632b039c03a448ae3b1046701c8b3243a2
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 3 14:10:29 2007 -0700
-
- Changed shared spec behavior to be compatible with RSpec.
-
-commit 7b825b89e96b3c8e38f9b8bcc8edf2bc6ec6ff22
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 3 14:09:47 2007 -0700
-
- Fixed language/class specs.
-
-commit 30d76181b0b3a9c5ac99c9d0e22a6a451346eff4
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Sat Nov 3 16:47:49 2007 -0400
-
- Fix Dir#each/Dir#entries/Dir.foreach specs. They weren't updated for fixtures
-
-commit f44a8cceb9a186a7127276db2207dfc79957ee8d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Nov 3 13:06:35 2007 -0700
-
- Guard File.(un)link for jruby.
-
-commit 1ec2c3a99ca562c8944aac1f4a60f8e0af0aaf17
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Nov 3 18:20:48 2007 +0100
-
- Properly resize the array in Array#<<.
-
-commit 8dec9918d8a6233ec2cde29d54687a5d950dc8df
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Nov 3 17:13:57 2007 +0100
-
- Fixed Array#unshift for the case when @start > 0 && @start < values.size.
-
- Also extended the Array#unshift specs to cover this case.
-
-commit 50b90918cd5a9a05e475690703c7867b443d191b
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Nov 2 13:47:53 2007 -0500
-
- added IO::foreach, fixed gets to use string separator, and fixed IO::readlines to use File.open
-
-commit 3efc01e110473d003ffb0a1376ec179f30e600de
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Nov 2 13:30:44 2007 -0500
-
- specs for IO::foreach and specs to test IO::readlines,IO.readlines with string separator
-
-commit fad18610b4416dfcfaf35db5029e880dff7e9820
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 29 14:10:11 2007 -0500
-
- basic exec implementation and a single basic spec (not sure how test test exec)
-
-commit 730fc3ed9afc54612d14093148fb8583c9e39fe3
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 21:41:25 2007 +0100
-
- Return mkdir()'s return value from Dir.mkdir.
-
-commit f5766696e701a069f908b3b5d5cfbccfee15ef1f
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 20:46:11 2007 +0100
-
- Implemented Dir.foreach.
-
-commit c696f1edc50c58b87270811c0c9aa0e49b356fe7
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 20:38:36 2007 +0100
-
- Implemented Dir.entries.
-
-commit e8e6188b252172690c1b584e528e3c71035897cd
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 18:16:13 2007 +0100
-
- Raise an error if the opendir() call in Dir#initialize fails.
-
-commit 024309b560c6c69f6f331c614df1da221be7054c
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 16:15:19 2007 +0100
-
- The Array#[]= spec seems to work now, so enable it.
-
-commit 76f118e62a0784326f5edf1c0fe46f6b6e682eee
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 14:28:49 2007 +0100
-
- Made Math.ldexp only accept integers as the second argument.
-
-commit 22bd7369efd1f738835e9c0a6a4624a26dae02d1
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Nov 2 13:30:50 2007 +0100
-
- Implemented some missing File::Stat methods.
-
-commit d6dc42d9085fed5f8bf482d7f84dd9c5fbd4423c
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Nov 1 12:24:53 2007 -0700
-
- Fixed specs failing MRI for File.stat and File.basename.
-
-commit 46f4de189e987f3071ede57f2bb1f7c892d67bd4
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 1 17:30:47 2007 +0100
-
- Fixed ticket #83: Array#push doesn't die anymore after calling Array#shift.
-
-commit 8debed24e957e48b10d60885d9a43083aab4d923
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Nov 1 11:14:22 2007 +0100
-
- In the Numeric#coerce spec, coercing strings to numerics should work.
-
- We can remove the TypeError checks from this spec, since those
- are included in the specs for the Numeric operators.
-
-commit 28cf656fb25ce38453acb2efdcf2e9ac16bb4460
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Nov 1 01:33:31 2007 -0700
-
- Removed Hash#fetch definition from fetch spec.
-
- Fixed spelling of Hash#find_unambiguous.
- Updated CI excludes.
-
-commit a6a69b469d94d0912ccbf123fdb9f53cbaf32830
-Author: Akshay Rawat <akshay.rawat@gmail.com>
-Date: Tue Oct 30 21:47:51 2007 +0530
-
- In the Time#isdst spec, don't depend on the system's current time zone.
-
-commit 1be129f98e0d548a023cc32f5ab763361e2a9c6b
-Author: Daniel Lucraft <dan@fluentradical.com>
-Date: Wed Oct 31 21:05:04 2007 +0000
-
- Fixed String#split to not return non-matching captures anymore.
-
-commit 5f7f798ef26fc8ee1e83c5e392c1fb2e60e31382
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Oct 31 21:54:56 2007 +0100
-
- In the Numeric#coerce spec, don't try to coerce strings to numerics.
-
-commit e26b7645af27d5bfc250c2c11f7e72349750f5c7
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Oct 31 10:52:13 2007 +0100
-
- Added a failing spec for Ticket #83.
-
-commit 9144f0c55eb5f40409bec514f08f89bdba61f800
-Author: Daniel Lucraft <dan@fluentradical.com>
-Date: Wed Oct 31 13:57:54 2007 +0100
-
- Fixed math/constants_spec.rb.
-
-commit 4b521cacb667ca5245954bc03ebfec67c0ac235c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Wed Oct 31 23:26:45 2007 +1100
-
- Modified spec to reflect expected differences in masgn retval behavior
- between rbx (true) and MRI (array of rhs vals).
-
-commit 1f6c50f5c77566e66cb0b842733b7f4f4b24e937
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 30 18:13:47 2007 +0100
-
- Use a fixed timezone for the Time#strftime spec.
-
-commit 60a25e997def085f3ae29773ce70ddc5b7c38d46
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 30 00:47:38 2007 -0700
-
- Fixed Kernel#raise to not output if $VERBOSE == nil.
-
- Guard Marshal.dump specs to eliminate error output until
- a proper Marshal is implemented.
-
-commit e446f2e329a6dfaacb45b5b86ba43ebd9ec606a3
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 29 23:17:49 2007 -0700
-
- Added IO::SEEK_SET, SEEK_CUR, SEEK_END with FFI.
-
- Fixed IO#close to raise IOError if already closed.
-
-commit fcb1ac4d076c07065878c2e65bf7bb44ddef400c
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 29 22:37:23 2007 -0700
-
- Specs for IO#seek and IO::SEEK_SET, SEEK_CUR, SEEK_END.
-
-commit a3570f6702dabd303fcd10d4cfc0e753cff69bb5
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Oct 29 22:33:34 2007 +0100
-
- Make Module.new actually work.
-
-commit 9709fa96b91afe5140f76726f1f7d4b89f8a6d54
-Author: Brian Donovan <brian.donovan@gmail.com>
-Date: Mon Oct 29 11:30:32 2007 -0700
-
- Ticket #75: Fixed Enumerable#sort_by.
-
- We must not call the comparison proc when the object and pivot are
- identical.
-
-commit 52e97da6bbcd28ec4349abcf25b089648d085652
-Author: Akshay Rawat <akshay.rawat@gmail.com>
-Date: Tue Oct 30 02:18:56 2007 +0530
-
- Enabled Math specs that were fixed by Ticket #59.
-
-commit 0f98800d4ab1db526304f1d26597ca3880c811da
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Oct 29 19:29:16 2007 +0100
-
- Ticket #59: Kernel#send now calls private methods, too.
-
-commit 754e48c223c3464c7d048452585c07b8d0b3d8c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 29 00:11:41 2007 -0700
-
- Specs for IO#rewind.
-
-commit 0bfd6bcca8fb287899fadeae81dd7c00b05d07e9
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Oct 28 23:40:37 2007 +0100
-
- Module#public_instance_methods now handles attribute accessor methods.
-
-commit 0a22b36b9bc50a34f1da1d0e994f1a6689195652
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Oct 28 23:26:17 2007 +0100
-
- Added a failing spec for Enumerable#sort_by.
-
-commit 006534b173a186c25c228b653d5ac9d81b20f57e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 21:51:40 2007 +0100
-
- Update Module spec excludes.
-
-commit 496df827eeeb600858fa8c7b26482aa3f653fee1
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 21:50:47 2007 +0100
-
- Make Module#ancestors specs pass.
-
-commit 18185cde2b47374c304e2528a084ea1f7b5178d2
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sun Oct 28 19:46:22 2007 +0100
-
- Added a failing spec for building an array that includes a splatted array.
-
-commit f120a470a5e07a7e53b1e006173942d58956e86b
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 19:33:10 2007 +0100
-
- Extended Kernel#` specs.
-
-commit 7e184c5bbc7be16cc8f7be01713543f222edd267
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 19:00:52 2007 +0100
-
- Removed Exception message dependencies and extended Kernel.String specs.
-
-commit 2853dc58209b3b8d122cee66c7d83e967d0879de
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Sun Oct 28 23:01:54 2007 +1100
-
- Fix for multi-arg operator assign through [], e.g. x[0,3] += 5
-
-commit 91b88710ddc1e8553e51c404cee4039f4d6abf24
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 13:05:08 2007 +0100
-
- Fixed File.ftype specs.
-
-commit 448fdc2def3a9ab249dadf9335568ca30b76f70e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Oct 28 00:36:11 2007 -0700
-
- Updated compiler specs.
-
-commit 0fb510c14ee8787b5965d5665e50da92a988faa6
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Oct 28 00:32:41 2007 -0700
-
- Fixed Bignum#coerce specs.
-
-commit 5e52a259b91e81fe5497f44107dee6ffd613b3be
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Oct 28 00:22:40 2007 -0700
-
- Fixed wording on Rubinius Bignum#coerce extension specs.
-
-commit 19e0259ca51691afe341b1217ab92862b307fe17
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Oct 28 00:15:18 2007 -0700
-
- Revert "Remove invalid and failing Bignum#coerce spec."
-
- This reverts commit 2371b920ca3f956213ab9e406a3b5d2afab4f18e.
-
-commit 4986ec283ee5aa9e392065c74d64952d36554b91
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Oct 27 23:50:05 2007 -0700
-
- Updated CI excludes for Array#pack.
-
-commit 5472f30201d7cddd4465adb246fa32927fe03d91
-Author: Alan Hurdle <alan.hurdle@gmail.com>
-Date: Sat Oct 27 18:38:30 2007 +1000
-
- Bunch of fixes to Array#pack to pass the current set of pack specs
-
-commit 20210a617a3f31c5dc0eda9fa371c49200c11f67
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 02:30:02 2007 +0100
-
- Updated spec excludes for Module specs.
-
-commit 712e3cc6a5d8a69834449e1039dfae3e07fcdcc2
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 28 02:18:00 2007 +0100
-
- Removed the dependency on some Exception messages.
-
-commit 2371b920ca3f956213ab9e406a3b5d2afab4f18e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 27 16:15:33 2007 +0200
-
- Remove invalid and failing Bignum#coerce spec.
-
-commit e1e62e7749d47c838d6b7cd1e95863c0c90d3de0
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 27 20:59:49 2007 +0200
-
- Fixnum#div now always rounds towards negative infinity.
-
-commit 9a4ccbe8381db5b6280c9d1dfcf6fa21a4838c4e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 27 15:09:57 2007 +0200
-
- Updated Spec excludes for Bignum and Fixnum specs.
-
-commit 889c939a668b9b1a4fd8f5a0cfd8bad85c3a5977
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 27 14:24:27 2007 +0200
-
- Fix Integer#[] when given a Bignum.
-
-commit 45d97332f4ec5a174884024c954ceeb6eb852f5f
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 27 13:46:51 2007 +0200
-
- Partial fix for #68: Fix Hash#fetch to correctly handle yielding with a default value passed.
-
-commit a785ea28f39c71a98007a7fafc23985dd21b596f
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 27 13:39:42 2007 +0200
-
- Updated CI excludes for recent Hash fixes.
-
-commit 6dd909fede466ed813ec7c5d207c5deeb69c9eb7
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 27 11:33:22 2007 +0200
-
- Fix for #67: Enumerable#sort should not depend on #size.
-
-commit 720489aa52bfabd492c307330204772b5eba6755
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 26 00:21:37 2007 -0700
-
- Updated CI excludes for spec/language.
-
-commit 41e8a07252b2df9c1e858922195a72f9a40c882c
-Author: Akshay Rawat <akshay.rawat@gmail.com>
-Date: Fri Oct 26 02:37:18 2007 +0530
-
- private keyword should mark a Module method private
-
-commit a201e631cbaabcc5964cfa3eb28a9fa8be1bf347
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 26 00:11:01 2007 -0700
-
- Added spec/language into CI specs.
-
- Updated CI excludes for spec/language.
-
-commit 833fe76de0c0b900ef5255b2abecd19943404c0c
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 25 23:53:35 2007 -0700
-
- Updated compiler specs and CI excludes.
-
-commit f31e5af358d2b5c3ff4afd3819b3a3e571427f8e
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 25 23:28:13 2007 -0700
-
- Migrated Adam Gardiner's compiler patch 236d213de8 to stable.
-
- Updated CI excludes for language/variables specs.
-
-commit bd9e47b1b7624df5e2ae0f31a7fd53c787ecc7e4
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 25 22:50:22 2007 -0700
-
- Fixed language/variables spec to use fixture class.
-
- Added CI exclude file for language/variables specs.
-
-commit 688f03ac452f698105812c28c29dcc7162b7037c
-Author: Adam Gardiner <adam.b.gardiner@gmail.com>
-Date: Thu Oct 25 22:43:20 2007 +1000
-
- Added specs for operator assignment, i.e. +=, *=, ||= etc
-
-commit 982dfee01bedb55e8dbf62d279bc4a375e58ec50
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Oct 25 16:53:45 2007 +0200
-
- Don't hardcode the result of Hash#to_a in the Hash#shift spec.
-
-commit 4bf7c8d2d387c002004da5df9f9c2a06fb65e61e
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 25 01:42:32 2007 -0700
-
- Commit tilman's language block spec additions with some modifications.
-
-commit ff8f6f5b5f5285b0fcf361d84523bf21320074b2
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Oct 24 20:20:12 2007 +0200
-
- Extended the Hash#[] spec with a test case for ticket #65.
-
-commit dc61b1e771c70e54f98859da3dd31a4ea61384e1
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Oct 24 07:11:07 2007 -0700
-
- Specs after(:each) MUST come before it blocks.
-
- Updated CI excludes for IO.read specs.
-
-commit 06539bad037e0ef7368ea5cbb5780fce7bbea443
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Wed Oct 24 21:26:49 2007 +1000
-
- Initial IO::read specs.
-
-commit a2f26d7a7b1997510edff1792eaec6507ba38208
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 23 19:30:46 2007 +0200
-
- Implemented Numeric#remainder.
-
-commit 2bc5fcee6be4db3e0e0c46aa7c1b8ef5a5c57957
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 23 19:10:54 2007 +0200
-
- Fixed Bignum#modulo(0.0).
-
-commit 68965dc12ea369f6db64c208cb2ce123c1398bb8
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 23 10:20:04 2007 +0200
-
- Extended the Numeric#nonzero? spec a bit.
-
-commit 290ddde29d6c64e9c81f69780b7b0c967b2b4901
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 23 10:15:57 2007 +0200
-
- Added Numeric#nonzero? and killed bad Fixnum#nonzero? in bootstrap.
-
- This fixes the Numeric#nonzero? specs.
-
-commit e9a1b257fc95c181e46c679d301a324134a725d4
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 23 16:07:58 2007 +0200
-
- Enabled the Numeric#step spec now that it works fine.
-
-commit f4016db94eee2ec93a2cc487181c9ec2fa0d59d0
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Oct 17 13:51:04 2007 -0700
-
- A number of fixes found while debugging test/unit and optparse
-
-commit 7c7920c3e7727c3514b493ba299a52c5e5cde8f6
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 22 18:12:42 2007 -0500
-
- Numeric#step is capable of floats and passes all tests
-
-commit ebc6ec5be0239bba544c55ff77fdc88903f4bb28
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Oct 22 20:56:33 2007 +0200
-
- Made the Symbol#inspect spec pass.
-
-commit f0db8c3d1bb5dc444fc72ed5ca222f4cf5df8b35
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 21 14:00:30 2007 +0200
-
- Fixed a bug in process_op_asgn1 and added a simple spec for it.
-
-commit 4fbce6e8a6ab8fbb6b69944677678611db68bcf2
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 20 20:03:50 2007 +0200
-
- Fixed a failure in String#sub specs
-
-commit ca0332f9edb9e01ae216dee90674fb6f9809951c
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 20 22:33:42 2007 +0200
-
- Fixed the Bignum#size spec for Rubinius' implementation.
-
-commit ae9c2ac3fe9dc59a027af7571d6d3083bcccb490
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 20 14:14:49 2007 +0200
-
- Don't rely on #respond_to? calls.
-
-commit 94938622aaf74e1f068c3b7ec8bfeccf763792ba
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Fri Oct 19 20:56:50 2007 +0200
-
- Extended the private spec.
-
-commit bf000a15edcfdd30c43ae6563b5766617f245a60
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 19 00:49:16 2007 -0700
-
- Updated CI excludes.
-
-commit ad146fc7ae22bfc26a536a40cf8dc4c0338cf25c
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Oct 18 19:45:27 2007 +0200
-
- Added a spec for the 'private' keyword.
-
-commit f15b5a8c818932d0ab5bea46f48a326e468b3511
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Thu Oct 18 19:44:54 2007 +0200
-
- Added Object#should_not_include.
-
-commit 80fdbd626d8ff99dc7ba4cf23a05d44ad98bd0cb
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Oct 18 09:31:51 2007 -0700
-
- Updates Hash so:
- * No longer freezes keys
- * Specs reflect the lack of freezing
- * shift spec doesn't fail purely because to_a is broken
-
-commit 197f36b6626b61203709704db869324a539764d5
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 20:11:50 2007 -0500
-
- moved File::expand_path to platform and made several fixes + new specs
-
-commit 7e8506fd510ab4e6f07e6d36456fdfef6e5b080a
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Wed Oct 17 21:07:44 2007 +0200
-
- Make sure that File.dirname doesn't modify its argument.
-
-commit 271bc31ba814e68fb414ebf29cf9648f57fe4cb6
-Author: David Altenburg <david@gensym.org>
-Date: Wed Oct 17 00:39:59 2007 -0500
-
- Added to fork spec: check that fork returns a nil pid for the child process
-
-commit 5d45341c55400a51d8cae3128bba265e7d441fab
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 05:19:49 2007 -0500
-
- moved File.basename to platform, added specs, and fixed specs for all but a disputable behavior
-
-commit ae7afd794881a4dedadf876f61369e5e88da695b
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 04:47:24 2007 -0500
-
- added platform/file.rb and fixed File.dirname for all and updated specs
-
-commit 71bf9b1c9cd7fb81692186d21b133fde43e8a6b7
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 03:44:33 2007 -0500
-
- spec to check if break exits all types of yields and loops correctly
-
-commit 3a546b40271d35bf7c60bb56a68ca49089ac9a34
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 03:01:40 2007 -0500
-
- clarified include_spec
-
-commit 40d8ed96fa689daf31039e71f91ed5520a821aa2
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 02:38:46 2007 -0500
-
- specs Module#include and Class#include that check to see if constants, public_methods and instance_methods are imported correctly
-
-commit ff462080a58aaa61759830e18f3a5757a883980d
-Merge: 5a2c858... 5cf41ab...
-Author: Jon Guymon <gnarg@kiryo.(none)>
-Date: Wed Oct 17 01:55:33 2007 -0400
-
- Merge branch 'puts_specs'
-
-commit 5cf41abaff9dc04cdba5fe50492d4ebfdde2a274
-Author: Jon Guymon <gnarg@kiryo.(none)>
-Date: Wed Oct 17 01:55:01 2007 -0400
-
- normalized specs for IO#puts StringIO#puts and Kernel#puts
-
-commit 5a2c858086c1b02a54864ff82c12d4bf3a559535
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 17 00:43:24 2007 -0500
-
- fixed posix File.join and added edge cases to specs
-
-commit e7972b8617b8b0ef2a19a1f7ddedd4d93ab80f5c
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 16 21:17:21 2007 -0700
-
- Commit gnarg's loop specs (#49).
-
-commit 3fcdd60b4c9fc20081987bb13aab37b9419939a3
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Tue Oct 16 19:46:36 2007 +0200
-
- Make this spec usable by loading pathname.
-
-commit 276b6cc5620a5a3629d56b04ade7c397a48c2488
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 16 00:53:11 2007 -0700
-
- Exclude metaclass instances from Module#ancestors list.
-
-commit e108e7f3f8a6ef7cf2acf4bb7e7a6609900a3ebc
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 16 00:06:54 2007 -0700
-
- Updated CI excludes.
-
- Updated compiler specs to match recent changes.
- Added compiled core/string.rb from changes in edeffe90517.
-
-commit 1a1410f394b3de23b63560f2a5c1312cc6451d2e
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 15 19:49:40 2007 -0500
-
- spec for __FILE__ added
-
-commit e158c3130f033a1029ae26888b8e7e541f2b388a
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 15 19:46:58 2007 -0500
-
- spec for __LINE__ added
-
-commit d09ad9e6b28c91f5d00db5d0b369c4932eabbe2b
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 15 18:45:48 2007 -0500
-
- spec for throw/catch inside of ensure reverted and clarified
-
-commit 0e5336f1572fc1ad766cff61d8843410d28df9db
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 15 18:33:27 2007 -0500
-
- spec super refactored into fixtures and expanded to test all methods on each class
-
-commit b998ec8e682c3a0f2160066bb84f40b68f748407
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Oct 15 16:26:58 2007 -0700
-
- Implement undef and Module#undef_method
-
-commit fed8486110930cabce64e0421638a867740e4d21
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon Oct 15 15:54:44 2007 -0700
-
- A bunch more language spec cleanups.
-
-commit 66086cb333432a29d4c4ce4fec6a01c0ac88c5a5
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Oct 12 19:33:59 2007 -0700
-
- Bunch of compiler fixes to pass more language specs
-
-commit 680e0ca4cafb20fa053f0dd5cd72915da9fbc86f
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Mon Oct 15 17:36:09 2007 -0500
-
- specs for super involving inheritence, modules and metaclasses
-
-commit 167febd232f5cf4696cf8e81a96d1c9d80744e36
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 15 15:32:48 2007 -0700
-
- Update CI excludes on OS X.
-
-commit 948e2573800859931e8c61e72069c21e9a50193b
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 15 14:23:02 2007 -0700
-
- Update compiler specs to match recent changes.
-
-commit a015bac050e1080548bd947c5f59b344175a809d
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Oct 15 23:51:01 2007 +0200
-
- Enabled the remaining Bignum#& spec.
-
-commit 0b37b2946772ea41fe7b14c762be7fdbaa4a6f8d
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Oct 15 18:20:56 2007 +0200
-
- Updated Spec excludes for Bignum.
-
-commit ae613272bcf0c260ad3da00ffd14d4a76422ac46
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Mon Oct 15 08:30:11 2007 +0200
-
- Added the beginnings of a File.stat spec.
-
-commit 81147d2eadb0397c2bcc1b9dd620bb55b6e0e53d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Oct 14 11:33:21 2007 -0700
-
- Fixed Float#to_s for numbers of the form "\d+.0".
-
-commit 2f9ba53190ca19ca425126d1319f47b3bbce12f6
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 14 18:57:04 2007 +0200
-
- Updated Bignum excludes.
-
-commit 0c81822cf703da13f6a8783cc6cd4ad453d2ff74
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 14 18:05:45 2007 +0200
-
- Add some OpenStruct specs.
-
-commit add2a900029530cb35b6463525313f432b7f36f4
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 14 17:29:38 2007 +0200
-
- Extended some more Bignum specs.
-
-commit 45cf3a275d390d4ae1d995eca89e10ba82d2288f
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 14 17:29:01 2007 +0200
-
- Extended the Fixnum#to_s specs a bit.
-
-commit d8a42cdd57967ee07cccfa5f3f814d97353c48c9
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 13 23:16:37 2007 +0200
-
- Fixed the bug that broke 'case' blocks with a single 'when' statement.
-
- Acked-by: Wilson Bilkovich <wilson@supremetyrant.com>
-
-commit 5624627fd61378fce65aebf2ffacc39c45ac5ee6
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 13 23:48:32 2007 +0200
-
- Ticket #37: Fixed Bignum#& segfaults when the argument isn't a bignum.
-
-commit 2081e5f53ba80cb9aa2ee272d4e543db1d4e732e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 23:43:08 2007 +0200
-
- Modify and extend Bignum specs a bit.
-
-commit 7917f4f8a538a3251e3cb17d55e4cf2a523af8d5
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 23:42:44 2007 +0200
-
- Modify the fixnum specs a bit.
-
- Remove dependencies on Exception messages.
-
-commit 171f25c25865da618c2e2a9a7b221abda613efa4
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 02:02:12 2007 +0200
-
- Extended Fixnum#<=> specs a bit.
-
-commit f708429a161c52dd713b4239527247c57fa158af
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 13 23:30:37 2007 +0200
-
- Guard bin/ci from running the new Bignum#& specs, which segfault (on OS X at least).
-
-commit 19f40e0ae1b60c037d0c38537a0924ad5726902a
-Author: Ben Curren <ben@esomnie.com>
-Date: Sat Oct 13 13:46:35 2007 -0700
-
- Refactored const_name_to_sym to share logic with Class#attr.
-
-commit ee9daad614fa746a3fe2fc1b9123c65dbb0814c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Oct 13 11:52:08 2007 -0700
-
- Identify which ruby platform and version before changing this spec!
-
- Revert "Fix spec to expect correct result."
-
- This reverts commit 8268469c563943cba6c1afce5d84defbc35f1789.
-
-commit 14a7781944491e5a1c3f5c664adcac4e1c383f2f
-Author: Tilman Sauerbeck <tilman@code-monkey.de>
-Date: Sat Oct 13 17:15:24 2007 +0200
-
- Added a failing spec for 'case' with only one 'when' statement.
-
-commit 8268469c563943cba6c1afce5d84defbc35f1789
-Author: Tom Mornini <tmornini@engineyard.com>
-Date: Sat Oct 13 03:22:47 2007 -0700
-
- Fix spec to expect correct result.
-
-commit 671f93c69e74976c3f5886c7fe8eb32402ccd338
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Oct 12 19:06:07 2007 -0500
-
- specs exiting threads using return, raise, and throw
-
-commit 119154a3ea5ecee20e77726b38fb58ee4b536d48
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Oct 12 18:59:47 2007 -0500
-
- spec to ensure throw exits from correct nesting and can return a value
-
-commit f36f68f075b34b5436257aba1ae41c14c04adcae
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 01:54:42 2007 +0200
-
- Method#[] specs should include the fixture classes.
-
-commit 22d32a24eb799307e42af55b04752c74ff500080
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 01:40:01 2007 +0200
-
- Extend Bignum#coerce, Bignum#&, Bignum#| and Bignum#^ specs.
-
-commit e1f682e27d2486d65297cf2121c354a99954a56e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 13 01:38:55 2007 +0200
-
- Removed a dependency on an exception message in Fixnum#coerce specs.
-
-commit 9754ed5e74eeb6d62f0015f3615d077aa2e58a6f
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Fri Oct 12 21:41:56 2007 +0200
-
- Fixed File.chmod and File#chmod specs on win32.
-
-commit 5ad3a4b7035bdade48586191c6e26cde1e74976c
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 13 01:37:46 2007 +0200
-
- Remove wrong spec from Bignum#divmod.
- Update CI excludes.
-
-commit b068c8634b56cd9129f9fc7c309bfa81869209c8
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Oct 12 18:21:52 2007 -0500
-
- specs for behavior of throw/catch and how they interact with ensure
-
-commit 45d4a8be8f20b2b70d32d0fdd340feb8897a1ad7
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 13 01:21:21 2007 +0200
-
- Add (skeletal) Process::Status.
- Set $? in Kernel#system and Kernel#`.
-
-commit ef1499962a16a7ce85bffe9e61863d2806caf6ec
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 23:52:16 2007 +0200
-
- Regenerate core/dir.rbc and CI excludes for Dir.
-
-commit b999f31ded2a7eccb856d95653a2826a3a190204
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 23:02:39 2007 +0200
-
- Fix typo in Dir.mkdir.
-
-commit de235630aa08df803be0420084b0a61ee35f5448
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 12 13:56:13 2007 -0700
-
- Added dev_null spec helper for capturing or silencing $stderr, etc.
-
- Fixed failing specs on OS X MRI 1.8.5.
-
-commit 01e27ea5fa0e0f0d170cd88f128adfbb2a2703bd
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 22:01:43 2007 +0200
-
- Add spec for backticks and their setting of $?.
-
-commit f7b18c19e47c15f3ab05f8fa548eff034206b0d8
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 12 13:21:03 2007 -0700
-
- Added guards to make specs pass on ubuntu feisty MRI 1.8.5.
-
- Fixed rspec_helper should_include to take multiple args.
-
-commit b2d25d4a502dca79ea98f60d937be7dbd8f496d2
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Oct 12 14:19:55 2007 -0500
-
- spec for retry/redo to control order of an enumeration
-
-commit eec535a19dc2b20156349720dc3bb526c9fa4f1e
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 18:53:33 2007 +0200
-
- Revert "Fix Kernel#`: set $? to the subprocesses exit status. Add a spec to check that."
-
- This reverts commit 40da2d5c68196c3c9002c4ca75ead0fefc520bef.
-
-commit 40da2d5c68196c3c9002c4ca75ead0fefc520bef
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 18:43:44 2007 +0200
-
- Fix Kernel#`: set $? to the subprocesses exit status. Add a spec to check that.
-
-commit 5da57253750e854bd9baf5378684222a895e7fd9
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 16:24:18 2007 +0200
-
- Shield "strange block args" spec from being run by mspec.
-
-commit 2a8f7d7dd6b0f7f800320f84d16d5d089357e085
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 12 14:48:42 2007 +0200
-
- Fix block specs for MRI.
-
-commit ade6c39f6199198e0015558698bc7d0333f7bcd0
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Fri Oct 12 12:07:49 2007 +0200
-
- Fix Array#delete specs.
-
-commit 825af45d5effb6909bb0832f92621b96e51dc380
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 12 01:15:23 2007 -0700
-
- Updated CI excludes.
-
-commit e1bfb47d3560929512cbdf5c27f56c92435ce29f
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 12 00:40:53 2007 -0700
-
- Removed printing summary at exit in mini_rspec.
-
- Set $VERBOSE=nil when running the specs.
- Fixed specs failing MRI.
-
-commit 1f1a041d8bcfaeb8dd3cb17f7d31b21281e690a2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 11 18:26:14 2007 -0700
-
- Moved shared specs to shared directories.
-
- Rewrote Module#method_missing specs.
-
-commit f9177eb198003b495f485a13910808fe603030ad
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 20:54:22 2007 -0700
-
- Added a failing test for setting and getting constants on an instance of a module.
-
-commit d9cbad87fd4d578e4f637627fa03cab312882a36
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 20:51:27 2007 -0700
-
- Updated the excludes for module tests.
-
-commit 938f034bad41f4fe3391b941e536bce9e1be0af6
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 20:49:57 2007 -0700
-
- Updated const_set_spec to not create a new instance of Module for testing purposes.
-
-commit 550caaf78723b00f95c5f8f38215b15a0940698a
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 18:21:01 2007 -0700
-
- Updated the excludes for the tests that are now passing.
-
-commit 82c51fc652e215f0dc421099329c03a37af8e8f8
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 17:56:48 2007 -0700
-
- Updated const_set and refactored the valid_const_name? further.
-
-commit c6323c74d0ee7b554d2cfbff3bd8d85ea910e0c9
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 12:01:27 2007 -0700
-
- Added logic to remove Object and empty from a recursive string for const_get and const_defined?
-
-commit c108d2a623f5041f46b6efa32d0b331f4f91d669
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 11:58:04 2007 -0700
-
- Added back the recursive case for const_get and const_defined?
-
-commit b976f184d8ade3b5d32d3e7ec11027c21c2bce2a
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 11:33:41 2007 -0700
-
- Refactored const_defined to use const_get.
-
-commit 82c5c14b948cedbf3bed5f7996634b0238e4de55
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Oct 11 17:38:05 2007 -0700
-
- Bunch of compiler fixes, almost have test/unit and optparse running.
-
- * Adds support for /ao#{name}/o (aka dregx_once)
- * Invalid redo's raise an exception at runtime instead of compile time
- * defined?(a.foo) works
- * Lots of work on getting the block arg semantics right, including a new
- instruction, passed_blockarg which is used to detect at runtime how
- many block args were passed in.
- * bug in 'yield 1, 2' versus 'yield [1, 2]' fixed
- * A little better error reporting on compile errors
- * Fixed Class#<, added #>, #<=, and #>=
- * Fixed Hash.new
- * Fixed nested case problem
-
-commit 1369b104a3f966dd4d279362afdc6ccb72f06de3
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Oct 11 22:47:16 2007 +0200
-
- Fix String#eql? specs.
-
-commit b190009707c120edb257a9ad92697145092c5612
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Oct 11 10:57:10 2007 -0700
-
- Shield parse errors in block args properly
-
-commit 0509ecbd6aeb973061866c5e04c590f975174b41
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 10:21:08 2007 -0700
-
- Updated tests to test FixNum being passed to const_defined?
-
-commit 80116298779dc5afd3294cd83d758d76d0dcdf50
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 10:16:46 2007 -0700
-
- Added error checking to const_defined?
-
-commit eed3ae097b1dae17e45cdb959b75d1fa7cf21c1b
-Author: Ben Curren <ben@esomnie.com>
-Date: Thu Oct 11 09:25:53 2007 -0700
-
- Convert paramter to_str if it responds to the method.
-
-commit 348df85a082eee56c301bce594d6c522050e34dd
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 10 18:49:34 2007 -0500
-
- specs for language/retry and updated redo to show differences between them
-
-commit e924e2bb206317e8f5375c979f5e4e1046fccca9
-Author: Tom Mornini <tmornini@engineyard.com>
-Date: Wed Oct 10 00:55:47 2007 -0700
-
- Add Class#attr, refactor Class#attr_reader, Class#attr_writer and
- Class#attr_accessor, pass all specs for Class#attr_*, fix a couple of issues
- with said specs.
-
-commit 21b0bdc67c6a8cc4ad4b9d3942a2608fb45da31d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 9 15:10:04 2007 -0700
-
- Commit #198, patch from Will for Module#(private|public)_class_method.
-
-commit 2cf5f0b4683d0a65181c1450d0714c4e165db1cd
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Oct 9 21:00:13 2007 +0200
-
- Moved shared specs.
-
- Moved shared specs into the 'shared'-subdirectory so specs don't depend on each other anymore. Added some more shared specs.
-
-commit e558fab61ce9f7c5211d005aff2c5e8fc1b39931
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Oct 9 19:53:46 2007 +0200
-
- Fixed a failing Array#each spec. Closes #14.
-
-commit 0d77eefd718c826e02376edc8643364eb511773d
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Oct 9 19:09:17 2007 +0200
-
- Removed remaining dependencies on Exception messages in Fixnum specs.
-
-commit dd4063ba46eb313a57957d76dce3608dd8e5c161
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Oct 9 18:58:01 2007 +0200
-
- Fixed String#crypt spec.
-
-commit d5a2bb2b000fae7391e512c5bcab054ce967de3b
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 9 09:35:51 2007 -0700
-
- Updated CI excludes after applying Akshay's Precision specs patch.
-
-commit 10cd5764bbf51f1defa6815f8b07fcdce0de8875
-Author: Akshay Rawat <akshay.rawat@gmail.com>
-Date: Thu Oct 4 21:48:15 2007 +0530
-
- Specs for the module Precision
-
-commit 2e711c30e4e9ce50d9c20ab14a3b99ea47be32e9
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 13:56:45 2007 +0200
-
- Make IO#puts specs pass in MRI.
-
-commit 13dc28c47c3211f01663d002847badb50277f277
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 13:44:51 2007 +0200
-
- Silence warnings when running Hash specs in MRI.
-
-commit 52f903938f4eacf4465f7a36cacb25aa662aa559
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 13:44:02 2007 +0200
-
- Turn Hash#values_at into a shared spec.
-
-commit 1e02ced5a68f16b8a65809136d954c68c9fdc590
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 12:59:58 2007 +0200
-
- Add a few more specs for Struct#new.
- Regenerate CI excludes for Struct.
-
-commit 94ea8c1f25761384796e9499e0b4b3faeba9da66
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 12:48:03 2007 +0200
-
- Silence warnings when running Struct specs in MRI.
-
-commit 5ea6b219a8465cfad86dae9ae12d6a8d85812532
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 9 12:42:58 2007 +0200
-
- Apply patch from ticker #23 by Jon Guymon (gnarg).
- Make Struct specs not depend on method argument evaluation order.
-
-commit 8cbf7b94300e6ebcc0ee3cbe0de8123ef3563e96
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 8 22:08:29 2007 -0700
-
- Fixed that including a module includes the whole chain.
-
- Fixed that Module#include only allows modules.
- Simplified some module fixtures.
- Updated CI specs for module.
-
-commit 4e7e2768d50392831a4d26f236d4cff733418225
-Author: Ben Curren <ben@esomnie.com>
-Date: Mon Oct 8 11:54:51 2007 -0700
-
- Added puts spec for io and updated IO implementation to match MRI's. Updated Kernal#puts to delegate to $stdout.puts.
-
-commit edc724086e84725995ed1720d4fa7a781fd9c3c6
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 8 09:24:40 2007 -0700
-
- Updated CI excludes for Module#define_method.
-
-commit a53ddb723a10d692223f05a49679e17f403fa128
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Oct 8 01:05:04 2007 +0200
-
- Fixed some Fixnum specs to not depend on error messages.
-
-commit d6bc4b47f3f395980c92f323cf029da1ccdba709
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 7 23:42:12 2007 +0200
-
- Added another failing spec for Module#define_method.
-
-commit 49435e31289f593a118377b3513ec9e7cdfea06b
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 7 23:37:19 2007 +0200
-
- Added failing specs for Module#define_method when given an UnboundMethod.
-
-commit 821c0114777fb2a77f1c85f216ee54e4c5340943
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Oct 7 22:29:47 2007 +0200
-
- Apply patch from ticket #15 by Jon Guymon (gnarg).
- Add Struct#eql?.
- Rebuild core/struct.rbc.
- Add more struct specs.
- Update CI excludes for Struct.
-
-commit 1f14c3510d4563930d11155f36717c0fb851c678
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Oct 7 18:13:33 2007 +0200
-
- Added some GetoptLong Specs.
-
-commit f9c8c00649212b924561300abbd0cb037c1d278d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Oct 6 23:00:05 2007 -0700
-
- Update CI excludes for File#executable.
-
-commit 6d4427d07fc474e2404cdd2b6f3b925d99d90e67
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Oct 6 22:50:45 2007 -0700
-
- Updated spec/excludes.txt from 72 items to 17.
-
- Added -V | --verbose flag to bin/mspec.
- Updated CI excludes.
-
-commit d4f5e44a8e2f8e682b779f45d12d060e83eb9fc7
-Merge: a035e9d... 42abc5e...
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 15:18:45 2007 -0400
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit a035e9d3d204cf7e5ddb2fec72ca471ff33c3b9b
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 15:13:28 2007 -0400
-
- fix a bug in the File.executable? spec
-
-commit 3c23c945aaf143aa8706b1cd2956908a71940e26
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 15:09:55 2007 -0400
-
- fix bug in File.executable? spec
-
-commit 94e59065bf921ae167a6b04edfef40de336978a1
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 15:03:14 2007 -0400
-
- Revert "Revert "Add a few more Proc#call specs. And CI excludes.""
-
- This reverts commit 7658362c3882c6be2ef67f6b57d6c6796ff5de98.
-
-commit 42abc5ed6e1ced2fa86e9dc9379c6bed4da4537e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Oct 6 11:40:49 2007 -0700
-
- Updated CI excludes for Kernel specs.
-
-commit 7658362c3882c6be2ef67f6b57d6c6796ff5de98
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 14:29:28 2007 -0400
-
- Revert "Add a few more Proc#call specs. And CI excludes."
-
- This reverts commit 567659dee34014d037d4797bf0c171597e0ac05d.
-
-commit 567659dee34014d037d4797bf0c171597e0ac05d
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 16:23:54 2007 +0200
-
- Add a few more Proc#call specs. And CI excludes.
-
-commit d8e737b09f8ed984e57b4fbbd5c016a7643aa67d
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 15:56:33 2007 +0200
-
- Fix Array#slice specs. Regenerate CI excludes.
-
-commit c79eeb620296a1802e6d194463063555638911bf
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 14:34:05 2007 +0200
-
- Fix Array specs that depended on respond_to? being called on coercion.
- Regenerate CI excludes for core/array.
-
-commit 8a60522fd8237fdfa36ef5518c9642216c66f8d6
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 14:08:22 2007 +0200
-
- Guard Array specs for #freeze. Fix MRI Array specs for #freeze.
- Regenerate CI excludes.
-
-commit eaaab65c54c3b81397441169761774ef95867297
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 12:47:55 2007 +0200
-
- Add specs for Proc#call. Regenerate CI excludes.
- (Most of these seem to be from e6cf8978.)
-
-commit 19bcb0f6ec1b2247985823492f0c25f0aa5d94ab
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 12:09:29 2007 +0200
-
- Slightly amend the core/hash specs.
- Regenerate CI excludes.
-
-commit 6d1afe325098a73757980bb208fb2c8c64bd016b
-Merge: ac9365e... 0d22ef5...
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 01:13:59 2007 -0400
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit ac9365e384263b6f062353f2afab3e33d8f84f3e
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 01:13:23 2007 -0400
-
- added spec for OpenStruct
-
-commit e6cf8978a6dd441d5d4793c48438fab4150ca750
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Sat Oct 6 00:14:01 2007 -0400
-
- added several tests to Proc
- added tests for Kernel#lambda and Kernel#proc
-
-commit 7b69ae066cab2252375d1ad19c6f17b365c47c32
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 18:51:11 2007 -0700
-
- Updated CI excludes for Array.
-
-commit f216e89033d10f3500798561282e48aa0e5b5537
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Fri Oct 5 20:45:41 2007 -0400
-
- really simple spec for the Singleton class.
-
-commit d682b176237a988afa7ebdb3460d64ea41fab919
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Oct 6 01:54:31 2007 +0200
-
- Applied esomnies
-
-commit b3018362c0cad86a5a026eb39b5f6ea4a8af1192
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 01:24:05 2007 +0200
-
- Guard Hash specs for #freeze.
-
-commit a185f463adbab1d6f82126dde9abe88a29e83283
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 01:15:23 2007 +0200
-
- Fix workarounds in core/hash specs.
-
-commit d796eb3d8a5d9a070b105f1fe0e9f46be5bfaaee
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Fri Oct 5 17:09:48 2007 -0500
-
- specs for UDPSocket client/server
-
-commit 46a9c1a0d0610865b659c289293b444f0b3d6ae9
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 15:32:56 2007 -0700
-
- Fixed bin/ci to not load spec/excludes.txt for every file.
-
- Fixed bin/mkspec to not overwrite an existing spec file.
- Updated Fixnum CI excludes.
-
-commit 1099f49c06de5621aff36216179f46c308e60a38
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 14:40:24 2007 -0700
-
- Added basic IO#readlines spec and implementation.
-
-commit edc438039ee503c7b9d1fb83b04bd9bc1664cda5
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sat Oct 6 00:09:41 2007 +0200
-
- Regenerate core/hash.rbc, core/hash CI excludes.
-
-commit 2ad7d015a316620a488ed1cdeb45fe696b9d410a
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 5 23:56:59 2007 +0200
-
- Extend core/hash specs to check for LocalJumpErrors.
-
-commit 42d961f0ab8a7e23a822b41ca82aaed5a48da2bf
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 5 23:21:20 2007 +0200
-
- Refactor and fix Hash#inspect.
-
-commit b51402d8724478b85789d19857a2a48442470fcb
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 11:29:08 2007 -0700
-
- Fixed bin/mkspec to not create the spec file stub if the file exists.
-
-commit efe79de398db491ce97666a3f4f3b38265c1ab95
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 10:55:52 2007 -0700
-
- Updated CI specs. Guarded String specs for #freeze.
-
-commit 8647951df433d427be31bec060edf5b7efb46e46
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Fri Oct 5 17:04:25 2007 +0200
-
- Replaced all occurrences of Object#coerce_to with Type.coerce_to and removed Object#coerce_to.
-
-commit 778e11d2df647cf91a712bb30df34152c71dbc3f
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 5 11:42:40 2007 +0200
-
- Don't work around rbx bugs in Hash specs.
-
-commit 4b42923eb2cdebe43f9e9dd80fff98d9ded26e4b
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 5 11:29:33 2007 +0200
-
- Fix Hash specs to pass in MRI again. (Doh!)
-
-commit 8a4f0b1c0d95b7a87ed99583797cf7d3710fb15a
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 02:24:30 2007 -0700
-
- Updated CI excludes for Hash.
-
-commit cecbf342546f37f4923728e8381e7fafcb039633
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Oct 5 02:22:41 2007 -0700
-
- Changed bin/ci to run in a single process. Updated CI excludes.
-
-commit ba0f4ef5405665c84af4410d70be5ef911a93195
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Oct 4 22:58:50 2007 -0700
-
- Adds the intern spec from Ticket #8
-
-commit 0721f6ea40f51202ec9d2d421061be92e05a18b9
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 22:39:00 2007 -0400
-
- Commit #207 Xavier Shay Enhanced specs for Hash
- fixed Binding#dup spec
-
-commit ce4a1866ef65e041fbed224c3f694ca534d0a0d1
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Oct 4 18:24:21 2007 -0700
-
- makes String#delete faster
-
-commit 7ec0eeadf554150159f0a04468b16de8f06c2e8a
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Fri Oct 5 00:32:25 2007 +0200
-
- Whoops, two more frozen TypeErrors I forgot.
-
-commit 78a3de42bf0e6f1478b2aac903c25143fd56195a
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Thu Oct 4 23:17:42 2007 +0200
-
- Regenerate CI excludes and core/hash.rbc after revert.
-
-commit beaa5d022b19cb70213d4fe14e10d7f1a5f90a3a
-Merge: c7ea881... 8cb4b0b...
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Oct 4 16:12:41 2007 -0500
-
- Merge branch 'spec_block_parameters'
-
-commit 8cb4b0b2c3c766618a523a0ef9a83106761ee2f8
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Thu Oct 4 16:11:15 2007 -0500
-
- specs for setting variables in block parameters
-
-commit c7ea8812f74184e6ee33bb236766f32fface2f95
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Thu Oct 4 22:57:09 2007 +0200
-
- Regenerate CI excludes for spec/core/hash. New hash.rbc.
-
-commit 939e8c533fb70586f8c7c6f3506d6be13f492d78
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Thu Oct 4 22:11:18 2007 +0200
-
- Fix Hash specs: don't depend on coercion to call respond_to?
-
-commit 422e45f210ec9dc2438ae3b11544823bb6ffdd50
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 16:21:27 2007 -0400
-
- added specs for FileTest#exists? and FileTest#exist?
-
-commit e43466b52184a042bd38d33273acf7afa4580a96
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 16:12:58 2007 -0400
-
- added spec for File.exists?
-
-commit 9f69c8193d92752a2be7c21d23dfe90fb9765f11
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 16:03:33 2007 -0400
-
- fixed grammar error in Method#clone
-
-commit 9321aacf703eaec6d6bc26cce83ed7475cb27d46
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 16:00:31 2007 -0400
-
- added several specs for Module
-
-commit a282c1c4c137e1bdeae34f2f9cd58bc73f257809
-Author: Jason Yates <jaywhy@gmail.com>
-Date: Thu Oct 4 14:19:07 2007 -0400
-
- added specs for Kernel#binding and Binding
-
-commit 3e92b4528dbf47b80a25232979554f7e4309460a
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Oct 4 10:45:10 2007 -0700
-
- Fixed ffi_sprintf_[fd]. Updated String spec CI excludes.
-
-commit 9e9a292a8a4befeb8a928d476119b02ac0df976e
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Thu Oct 4 18:53:47 2007 +0200
-
- Alias Object#object_id to Object#__id__
- Regenerate CI excludes for spec/core/kernel
-
-commit 8790e93c6d231baf7da07f11d02b91a38d28375e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Oct 3 18:23:42 2007 -0700
-
- Superclass checking and loop {} fix.
-
-commit 718ae6f28223e94b8ca0f3af7ce321c81a597804
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Thu Oct 4 15:05:59 2007 +0200
-
- Slightly extend Object#kind_of? specs.
-
-commit 7fa087a7058fe8872bb9743abd6dd472cd2119d7
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Oct 4 08:43:55 2007 +0200
-
- Fixed some String#slice specs.
-
-commit b9be176a9e64669f2a787c9bdebc1ba30e344d97
-Author: Paul Meserve <pmeserve@gmail.com>
-Date: Thu Oct 4 01:37:56 2007 -0400
-
- adding String#each_char
-
-commit c1b17108a78a4dc5d3e224158f8f9d76232003e6
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 3 17:42:06 2007 -0500
-
- basic specs for Kernel#sleep
-
-commit 1fe895518bdccb93991f85a92f53876ed3d4df13
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 3 14:16:14 2007 -0500
-
- added spec for Kernel.local_variables
-
-commit 00417283b36dcb58da82c6fc2e9be7580de945b0
-Author: Charles Comstock <dgtized@gmail.com>
-Date: Wed Oct 3 14:15:25 2007 -0500
-
- added specs for Kernel#global_variables
-
-commit 5b944520099f129462c3b03fa6ee7d1bb0636fc0
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Oct 3 14:07:09 2007 +0200
-
- Fix String#index specs.
-
-commit c9cdef77c7fa8dda92c91cee5a47624b9c9dc9e8
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Oct 3 14:05:34 2007 +0200
-
- Fix String#hex specs
-
-commit 4625a7afe509545f782cd4631632b4d7a58011aa
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Tue Oct 2 23:53:20 2007 -0700
-
- String#% works with a few exceptions:
-
- * %u doesn't work (it's aliased to %d for now, as in 1.9)
- * There's a weird glitch in Float(10_1_0.5_5_5) that I can't track down
-
-commit 54ab6f559093e66f78cfa30db8aa6587061552d6
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 02:05:41 2007 +0200
-
- Extend Kernel#kind_of? specs.
- Regenerate CI excludes.
-
-commit 4583be7e7ed76e5843dcb396f8bae735f341de73
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 02:03:58 2007 +0200
-
- Remove superfluous whitespace from Object#kind_of? specs.
-
-commit 5c237626469f4b0f4d227916752dd2e03510fcf9
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:50:33 2007 +0200
-
- Remove superfluous comment from Object#kind_of? specs.
-
-commit 7a2c673d04b0d0506e89073ff231104e21c3304c
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:47:56 2007 +0200
-
- Simplify Kernel#freeze specs.
- Move Object#extend vs. frozen? spec to extend_spec.
- Rebuild CI excludes for Object#extend specs.
-
-commit 3f6a27603b0b1f91ce32b9ff2a5fe3222fa7220b
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 2 17:03:37 2007 -0700
-
- Commit Charles Comstock's language return specs.
-
-commit ad4e7affcbaae4f0e967c97da485313168595a5e
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:36:27 2007 +0200
-
- Fix Kernel#caller.
- New core/kernel.rbc.
- Regenerate CI excludes for Kernel#caller.
-
-commit 73b2ef1c889c940d22da6ad6bb8882eef66592fa
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:34:10 2007 +0200
-
- Add spec for checking the default argument value for Kernel#caller.
-
-commit 180ecd6a7fa1d32e1932a322b1f8f82efd558e7f
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:32:29 2007 +0200
-
- Add spec for checking that Kernel#caller returns nil.
-
-commit 9ad0c1428df70c9fd9e0081651e3b60cf5773267
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:30:46 2007 +0200
-
- Add spec for checking the argument handling of Kernel#caller.
-
-commit 7a9483b823115b3122a4e42b21dfcb5b0f369a54
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:23:17 2007 +0200
-
- Refactor the tedious part of the Kernel#caller specs.
-
-commit e204755859e4dc147217816ab3bf587db3d51dd6
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Wed Oct 3 01:22:26 2007 +0200
-
- Cleanup description of Kernel#caller specs.
-
-commit dadbbb7930b62a4a6e47c8c32a4d9f26fcea38b4
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 23:52:49 2007 +0200
-
- Regenerate CI excludes for spec/core/kernel. Again. Because I fixed the typos.
-
-commit 4a3587da37fd27effb30356fdd2e496f8c898be7
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 23:45:33 2007 +0200
-
- Fix CI specs to pass in MRI 1.8.6.
-
-commit a46f5085f3c2a4849fe709044e447e5d6dacda4f
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 23:27:51 2007 +0200
-
- Fix typos in spec/core/kernel specs.
-
-commit cb3d5867ec91a59a2a75136eb5210a10540b0ce0
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 23:27:23 2007 +0200
-
- Regenerate spec/core/kernel excludes.
-
-commit 22e6fe0ef8dbf13aa01124447e09c9dc96f63fe3
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 23:26:51 2007 +0200
-
- Fix Kernel#Array spec: don't depend on the exception message.
-
-commit 7b79130f38925cb48712be617cef5a80c71f0ba4
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 2 14:29:42 2007 -0700
-
- Commit #5 (LH) Charles Comstock Process.wait2 spec.
-
-commit 859c119a48909030f29a2085fbe0a80ed96d2408
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Oct 2 20:57:31 2007 +0200
-
- Fix Float#to_i and add a spec to catch the old misbehaviour.
-
-commit f2b5b2304588b4fb0efd9818c79a4b9774b2c850
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Oct 2 19:07:49 2007 +0200
-
- Fix some String#scan specs.
-
-commit 8e0ce11df329181efa440cbd55f29848e12188bf
-Author: Kevin Clark <kevin.clark@gmail.com>
-Date: Tue Oct 2 00:39:15 2007 -0700
-
- Add error handling for Dir.mkdir/rmdir
-
- Add aliases for Dir.delete/unlink
-
-commit 20e66dd965bfceb29e4939090a0fd543d05392a3
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Oct 2 00:21:49 2007 -0700
-
- Commit #206 Jason Yates' UnboundMethod specs.
-
-commit 00d7d22b7d106c6aac5d9664cb444e14811171b0
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Mon Oct 1 17:57:29 2007 -0700
-
- First pass at actually getting my modulo impl working
-
-commit c90766a09c7e1fe7a2261f8b09d9caa8eaf2214e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Oct 1 21:21:34 2007 +0200
-
- Fix the String#crypt spec.
-
-commit a0f6f8e51a6f7a65230f8f2ea53587ccb09f9270
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Oct 1 20:18:29 2007 +0200
-
- Changed the String#to_f specs a bit.
-
-commit 21d43e565bb55a31b45dc9fabbefface156ec516
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Oct 1 16:13:28 2007 -0400
-
- Add failing Array#pack spec for use case taken from Mongrel
-
-commit b1d70b4a847fc1c8df3eb4a219c4318420121e82
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Oct 1 09:04:03 2007 -0700
-
- Commit #205 Jason Yates' Method specs.
-
-commit de7e0f0183d072f101e0781635fc2fdb1af1b851
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Mon Oct 1 00:11:12 2007 +0200
-
- Fix compiler specs to expect sret when appropriate.
- Rewrite compiler specs for multiple assignments.
- Regenerate CI excludes for compiler specs.
-
-commit 1d1e704306fca4453d600259e87175dcdc9de314
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 23:27:12 2007 +0200
-
- Add edge cases for File#extname specs.
-
-commit 108d757e6c24447b89fa785b2bf091b72d29933d
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 22:34:15 2007 +0200
-
- Regenerate CI excludes for Dir specs.
-
-commit 20c6c3cd9b5d59b9782b702ac6afeb828e895d5f
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 21:49:52 2007 +0200
-
- Make Dir specs pass in MRI.
-
-commit dcd172338bce5b70cb367db3c1e6f4653c05f9e8
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 21:10:36 2007 +0200
-
- Fix case comparison with Symbols.
-
-commit 2a45cd71d1eb90a7c11ff62d81371df9479b0d43
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:28:32 2007 +0200
-
- Add specs for String#tr! and String#tr_s!.
- Cleanup specs for String#tr! and String#tr_s!.
- Regenerate CI excludes for String#tr! and String#tr_s!.
-
-commit 6418bd672c8ea031d8ac2364c8a98bb631e53deb
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:26:19 2007 +0200
-
- Add specs for multiple asignments with splats vs. Array#dup.
-
-commit 10b04881d286acab9dc97147750743e03ee4509f
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:25:14 2007 +0200
-
- Fix Class.new to raise TypeError when the superclass is not a class.
-
-commit 0b9debba0672305f8551f5d5f35cdd3aaf16c1f1
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:20:49 2007 +0200
-
- Add specs for the names of classes generated with Class.new.
-
-commit e15cef6eb851318838351a4d8717b708bb09d31d
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:15:43 2007 +0200
-
- Remove debugging output from spec/core/dir/chdir_spec.rb
-
-commit f3251ba0e8ade79f157bc02dca550481488bf888
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Sun Sep 30 13:15:17 2007 +0200
-
- Remove debugging output from spec/core/extensions/rubinius/options_spec.rb
-
-commit 5d4d2abaf02aef6caa7e532208da5e5f57bc6373
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Sep 30 20:54:14 2007 -0400
-
- Working Socket implementation and specs. Still needs readpartial to support Mongrel.
-
-commit b514e53f589d509c287516d8dd985f96e66d9a1c
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat Sep 29 15:44:06 2007 -0400
-
- Working IPSocket#peername implementation
-
-commit 965ed2d88527ae8aa4ac962e8ca84180f61e6345
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Sep 24 02:34:26 2007 -0400
-
- Yet another interim socket commit
-
-commit ecd54e981a1098c4b3abf14587212e7d1d9049a6
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Sep 20 16:29:21 2007 -0400
-
- Another interim Socket commit
-
-commit 351bbdf08f190e24328328df7b3f995b8dc27a9f
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Sep 19 22:17:52 2007 -0400
-
- Interim commit of Socket work so I can generate a patch
-
-commit 65a73cdfea95c5991f2044bee150e53643216ad3
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Sep 26 13:15:45 2007 +0200
-
- Added some Marshal#load and Marshal#dump specs.
-
-commit 89e1b91c606dfe18581c3ed3923340b952471d8e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Sep 26 13:15:19 2007 +0200
-
- Extended Specs for Kernel.Float and Kernel.Array
-
-commit 5d46933362b8c54cb5d0370bbf61e063459de514
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Wed Sep 26 13:14:41 2007 +0200
-
- Added specs for Symbol.all_symbols.
-
-commit b3324808584d7b4ee6af58d98eeb7c2162c31208
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Sep 27 10:57:46 2007 -0700
-
- Commit #180, Jason Barton's specs for Module#undef_method, #remove_method.
-
-commit 2e1219fc03d9cb673074ee34b1f8af4bdffe9c0e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Sep 27 18:49:26 2007 +0200
-
- Fix Kernel.Integer by making use of String#to_inum. Add some more Kernel.Integer specs.
-
-commit b0d4747cab49f4a17e9899392171087d7b67f687
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Sep 27 18:23:42 2007 +0200
-
- Fixed String#to_i. Added String#to_inum. Extended String#to_i specs.
-
-commit 2799c392b3f5383e9e74745ceb9cf7a52f82918b
-Author: Paul Meserve <pmeserve@gmail.com>
-Date: Thu Sep 27 01:20:00 2007 -0400
-
- fix for Struct#new and a small struct spec changes
-
- (also re-ran bin/ci on struct specs - most of the changes were from previous commits though)
-
-commit 30d9bf1f6ef9dcff067d427d6226bbce985f5e69
-Author: Paul Meserve <pmeserve@gmail.com>
-Date: Wed Sep 26 19:08:37 2007 -0400
-
- raise proper error when passing non-block args to Enumerable#all?
-
-commit 1ef1e0ef65ef3c86558da3d313dee5cada6dd4c5
-Author: Paul Meserve <pmeserve@gmail.com>
-Date: Wed Sep 26 17:25:17 2007 -0400
-
- adding alias for Float#quo to fix a couple number specs, and some modifications to Enumerable#min/#max, along with a couple new spec assertions. fixes failing specs and implementation should be a lot closer to MRI
-
-commit 547dd89791d92f061afcaef7184f054affae871d
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 26 09:46:50 2007 -0700
-
- Fixed placement of after(:each) block in numerous File specs.
-
-commit fa3dcbfdd623a7a7cdb15bc29b38ae47bb4056d5
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Sep 25 20:25:36 2007 +0200
-
- Added specs for UnboundMethod#arity
-
-commit 33783408b8ce1bdfcd205fd02bc3848119a632cc
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Sep 25 18:00:10 2007 +0200
-
- Added specs for Class.
-
-commit 0edea3c3a7dda5c453c527b2cef3ffba1eef1396
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Tue Sep 25 17:25:40 2007 +0200
-
- Created some specs for Proc.
-
-commit 62c92f1c3aef6c2ff7ab8cbcd49eefb236d5caed
-Merge: b79d04d... 2d9c698...
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 26 01:09:42 2007 -0700
-
- Merge branch 'dir'
-
-commit 2d9c69848f4ca34685b95b07e17d1b5fe1ec2391
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 26 01:09:28 2007 -0700
-
- Updated CI spec excludes for Array, Dir, Fixnum, Enumerable, Hash.
-
-commit b79d04db673d9b7b5cc47f2918bccf1b0400bdbd
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 26 00:56:01 2007 -0700
-
- Commit crayz's patch from #195, #196, #197.
-
-commit ec960578671a327469d9545d6ced827736ceafa0
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Sep 25 19:40:54 2007 -0700
-
- Fixed Dir specs failing MRI after conversion.
-
-commit 00b398352ed0f4cbcd326d56b7f8a4469056ee0d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Sep 25 00:54:06 2007 -0700
-
- Many cleanups of Dir specs.
-
- Added Dir specs fixture directories and files.
-
-commit b75cfa7c0a9871dc34b8b315ca2311e65000b2f3
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Sep 23 00:41:36 2007 -0700
-
- Converted Dir.glob specs.
-
-commit 3d8ea2a55e67cc6cfb85d2f4f7845a45984f6504
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Sep 25 21:52:54 2007 +0200
-
- Fix a few Struct specs. Failures are down to 15.
-
-commit a477ff678e9f5f39d3d2b94e559c77b34f0c56c5
-Author: Martin Kuehl <martin.kuehl@gmail.com>
-Date: Tue Sep 25 20:51:38 2007 +0200
-
- Fix compiler warnings in Subtend spec extensions.
-
-commit db3e1be4e25b7e8cc463443d050afe9a5acaa7de
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Mon Sep 24 22:31:03 2007 +0200
-
- Extended Fixnum specs.
-
-commit d136b779736af52d1eac08a40814ab4a47de93b3
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Sun Sep 23 17:47:30 2007 -0700
-
- Array#each explosion spec
-
-commit 8a24a71ff13aac465f7f4a14587981c3c23dc800
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 23 20:06:04 2007 +0200
-
- Extended Comparable specs.
-
-commit ea9ba046ddfe91601d4453972a6d6f8fce96c392
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 23 12:17:17 2007 +0200
-
- Fix Numeric#divmod and Fixnum#divmod.
-
-commit 1c5ecb9d2e9066c66b9f0625d65cc4cefaee1f83
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 23 12:00:16 2007 +0200
-
- Fix Float#to_i for infinite, negative values. Fix Numeric#/ and Numeric#div. Add Numeric#do_coerce.
-
-commit 2d67d024e11e887eb07622963bfc36b0ec377746
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Sat Sep 22 20:08:38 2007 -0700
-
- Added Onig 5 and got rindex working with it
-
-commit adc26eb525447010e28fc884eaa54b9d2228f4d6
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 23 01:35:11 2007 +0200
-
- Fix Kernel.Float specs
-
-commit 9a2ecf258fee3bda410776b3d3b77366590d64fe
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Sep 22 23:18:46 2007 +0200
-
- Extended more Fixnum specs. Removed the spec/fixnum/induced_from_spec.rb.
-
-commit 53b0042824bb1b1c523d790cb3645aec6b789abe
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Sep 22 22:35:53 2007 +0200
-
- Extended many Fixnum specs.
-
-commit 8661cdb78cd2c4afa0fb231aa9cc959e338e097e
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Sep 22 22:35:11 2007 +0200
-
- Extended nil#to_s spec.
-
-commit 4008d8b39032ffa5667e95fb445ff816b1428330
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Sep 22 14:25:27 2007 +0200
-
- Added some more specs and fixed some bugs in Range#initialize, Range#step and Range#each.
-
-commit 254e3d57dc6e859616ca7e0c44058d4b73211f68
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sat Sep 22 11:31:02 2007 +0200
-
- Some updates to Range specs.
-
-commit b87e28bfc06e81fe5c4c3d6e285947f635f79f61
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Sep 21 20:12:18 2007 -0700
-
- Commit wycats Regexp.regexp_match_region primitive.
-
-commit eaa56811836b4b5ed09a5e26d00f26eb004f2853
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Sep 21 18:44:25 2007 -0700
-
- Added StringValue to some File methods.
-
- Upated File CI spec excludes.
-
-commit 83f7b6020dbc881fbd6bd13da6ebb049d6080c2c
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Sep 21 17:54:53 2007 -0700
-
- Upated spec excludes for Float, Fixnum, and Math.
-
-commit af0b0c8da8357fcae7437f6cdfd7797f03ffd73b
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 20 22:10:54 2007 -0700
-
- Fixed a number of string-related issues:
-
- String#inspect respects $KCODE
- String#inspect returns tainted subclass
- String#dump is no longer a copy of inspect, and does not respect $KCODE
- String#match tries to call #to_str if it can before throwing an error
-
-commit 9409ace6d3e97946d10f9f7fcefa69ebcae43c47
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 20 16:55:11 2007 -0700
-
- String#index works
-
- Tweaked spec because [[x,y], [x,y]].each{|x,y| ... } wasn't working
-
-commit 6a72e4c4defef170f53a31c930c112022934dbc4
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Sep 20 15:22:28 2007 -0400
-
- Correct StringIO#reopen specs and implementation. Submitted patch for 1.8.x stable.
-
-commit 2b10dd99c2de4f97b5faa45060eba929d02052c4
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Wed Sep 19 22:20:33 2007 +0200
-
- Implemented File.identical?
-
-commit 2c3c1fc7bd2f6365b28262cae46872eb0925c2e7
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Wed Sep 19 21:48:13 2007 +0200
-
- Implemented File.link.
-
- Kudos to the Frankfurt Rails User Group! :)
-
-commit 0330b22006e39b5b173c78800f412831296de59a
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 20 01:32:43 2007 -0700
-
- String#gsub works correctly
-
- There was a weird segfault issue which I tracked down to a use of gsub inside of gsub.
- I got things working by extracting that functionality into a mini-gsub for just that
- use case, but we should fix it.
-
-commit 6c825ce63ca0eb7d6f882a767ee0e6a597219883
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Sep 19 22:14:31 2007 -0400
-
- Discover and fix an edge case in StringIO
-
-commit 6bd7adcfa115f11829a7efe8f526fabbb56d5c4c
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Sep 18 19:00:20 2007 -0700
-
- File.fnmatch(?) now passes all existing specs.
-
-commit f626f4199b88ca09a2ba75127270c0bec2ec2c86
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Mon Sep 17 15:04:44 2007 -0700
-
- Adds a new match_all primitive
-
- * will be used as the base of regex-related String functions
- * is called match_all instead of scan because it's more primitive than Ruby's scan
-
-commit 0b42d4d2610ec36a4ae5e21c37d5b587f2b9dcf8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Sep 17 02:06:50 2007 -0400
-
- Avoid using $/ in IO#puts and StringIO#puts
- Additional StringIO specs and fixes for failures
-
-commit 75969031a57bea50e4a6450bbc9ae9e5adf76fa7
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Sep 16 18:26:29 2007 -0700
-
- Replaced File.fnmatch FFI version with custom version.
-
- The custom version is needed to be as compliant as possible
- with MRI on different platforms.
-
- Lots of fixups to File.fnmatch specs.
-
-commit 18d098062cb1b996a571a946740eea7c52421e12
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Sep 17 01:11:45 2007 -0400
-
- Some failing sprintf specs and then the fixes for said failures
-
-commit 84f94ab41d72012e4ec3d0d236b183fd8a51fbe0
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon Sep 17 00:53:30 2007 -0400
-
- Additional StringIO specs and fixes for the failures that arose
-
-commit 9b44df55c682f239f036d46efe45edc2190a7345
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Sep 16 12:55:27 2007 -0400
-
- Add StringIO spec for $/ global handling
-
-commit dfcba62eb69f88d373359c75c3fa7fe827e24c69
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Sun Sep 16 00:43:41 2007 -0700
-
- Fixes string/equal_spec to pass
-
-commit 5026350a166b94fc5fffff70dae510fa2abf2094
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Sun Sep 16 00:20:52 2007 -0700
-
- String#slice works
-
-commit a4f3aa09d3aeb8d2b0a640ca9f659a5945692e04
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Sep 15 13:49:42 2007 -0700
-
- Added ability to read/write to pointer to int or double in FFI.
-
- * Fixed Math.frexp to use pointer to int to return exponent.
- * Completed Math specs.
-
-commit 1a88ca4def8d7aa566a4254eebee3236a1359fc8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Sep 14 20:57:01 2007 -0400
-
- mini_rspec.expectation_messages.yak_shave!
-
-commit 64f53c8b40b3a80b41a2c27b4ac7255b7aad5f4d
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Sep 14 02:18:16 2007 -0400
-
- Hopefully full StringIO coverage now
-
-commit 7cf9fe62bc9a5a00ae69ed3cac82e50012f3bb69
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Sep 14 00:54:33 2007 -0400
-
- Yet more StringIO specs
-
-commit 92da0550bd32db984fbb54f105b9701867d4faf9
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Sep 14 00:38:55 2007 -0400
-
- More StringIO specs
-
-commit 29826669197f44850d323910c7e60897e1ef7796
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Sep 14 00:23:45 2007 -0400
-
- Beginnings of StringIO specs
-
-commit 0c19e3557125dd366ddd119a34451715bfe5e7a1
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Wed Sep 12 18:11:49 2007 -0700
-
- Fixed object allocation bug and Bignum spec
-
-commit e42a1b960f530a987527d8795a98b2de18fea824
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Sep 13 19:19:03 2007 -0400
-
- Re-implement Module#define_method. Passes existing specs.
-
-commit a8b1a148e5fbfeb3c91558fd6caccc95006a5617
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Thu Sep 13 03:55:15 2007 -0500
-
- Adding a non-compiling spec to case_spec and updating core.rba that didn't seem to get updated correctly.
-
-commit bbd682ba2e12ba5907fe2edf2f14f11fb110cac8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Sep 13 04:04:33 2007 -0400
-
- Fix anonymous 'rest' arguments
- Suppress stray STDOUT traffic from 'defined?'
-
-commit 8f11498019eb49a4dd8bf52c4361432ebb1175d5
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 22:21:30 2007 -0700
-
- Updated CI process.
-
- * Changed bin/ci to generate an exclude file per file put
- in .spec directory.
- * Generated CI spec excludes files.
- * Updated .gitignore to not exclude .spec directory.
- * Moved the critical excludes file to spec/excludes.txt
-
-commit b736263ff325efabb907f300c1c69a2e63bd5620
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 22:21:30 2007 -0700
-
- Updated CI process.
-
- * Changed bin/ci to generate an exclude file per file put
- in .spec directory.
- * Generated CI spec excludes files.
- * Updated .gitignore to not exclude .spec directory.
- * Moved the critical excludes file to spec/excludes.txt
-
-commit 58ff9428a2a20e93e3682f834e32f754ed2c47d4
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 18:39:48 2007 -0700
-
- Fixed specs failing MRI.
-
-commit f54b1dffb9372e5cb1c71d93c67f2407fce0a1d0
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 17:17:46 2007 -0700
-
- Fixes to specs failing MRI for hash, float, fixnum, file, enumerable.
-
-commit e1d359eec451a69deb67ffdedd09b86d00774cc2
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 14:34:50 2007 -0700
-
- Fixes to Hash specs based on Ruby version differences.
-
-commit ee5eec5d32bb42fbf549068905ddebe215fbcf70
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 08:53:47 2007 -0700
-
- Fixed failing specs in kernel, module, numeric, string.
-
-commit 4f0af824f132428762f1e06409ca16c1022867bc
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Sep 12 06:24:16 2007 -0700
-
- Added #platform and #version guards for specs.
-
-commit 355c602704cd402a1d7cbadc9b4d8fae0b34f1f4
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Sep 11 00:35:03 2007 -0700
-
- Misc changes to specs to cleanup after the breakup.
-
-commit 85336c6a83736b01d63b645baf0e7e18bb5ce569
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 23:21:24 2007 -0700
-
- Converted exception, kernel, struct, object specs.
-
-commit e10bc8cbbaa26123724dad9f97f44d82e8cbf600
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 21:48:15 2007 -0700
-
- Converted string and numeric specs.
-
-commit 8ec64d24811a7951756c840c98a66a7c7d2ae7c8
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 18:35:18 2007 -0700
-
- Converted array and module specs.
-
-commit 2849f4a41b3fbda6c626d934bbf3d7476ea31848
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 15:22:36 2007 -0700
-
- Converted enumerable, file, hash, process, regexp, thread.
-
- Fixed bin/mkspec to remove '=' from string for file name.
-
-commit ffa5328aa8ed7ea079c0cc8b4228ababa5919cf6
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 13:16:14 2007 -0700
-
- Converted time and bignum specs.
-
-commit 7798952047471d28a8e12a796092c4df7ae002f2
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Sep 10 01:21:38 2007 -0700
-
- Converted range, math, matchdata, integer, float, fixnum, comparable, io.
-
-commit 423d85f4a7eb4b40d2eea83a462f5c38c4a6aee3
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Sep 9 23:43:14 2007 -0700
-
- Added dir and files for ENV. Converted true, false, nil, symbol, process.
-
- Added .spec to .gitignore.
-
-commit 8274bdcd0c747c21806065feb743e7794231f48f
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Sep 9 22:40:37 2007 -0700
-
- Converted kernel specs.
-
-commit bc1917d630d7938b62a866c3825dfa08e5ec99e1
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Sep 9 21:57:03 2007 -0700
-
- Initial create of spec/core subdirectories and files.
-
- Updated bin/mkspec to exclude Exception subclasses and
- OptionParser (which is in Object.constants because of
- the script requiring it). Also normalize TrueClass etc.
- to directory 'true'.
-
-commit b941eceb681c57d23d35f952b11b2a2d3a1ea4dd
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Sep 13 01:00:22 2007 -0400
-
- Add a minimal spec for the 'undef' keyword
-
-commit 3af389594f3828763a85d8eef65f773b183e1b46
-Author: Charles Nutter <headius@charles-nutters-computer.local>
-Date: Wed Sep 12 19:33:36 2007 -0500
-
- Adding a bunch of default argument specs to language/def_spec.
-
-commit 6b4936e834a2814602be54f01e08dcdc1f9433b5
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 9 16:58:35 2007 +0200
-
- Another fix for multiple mock expectations on the same method.
-
-commit f686ff256289263eb473249dd734cf2214c41cc2
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Sun Sep 9 16:13:53 2007 +0200
-
- Mocks now support multiple expectations of the same method with different arguments.
-
-commit 860e0d08adc8cdee9ac4d9ff3bd0e30d5d3aaa49
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Sep 8 02:36:19 2007 -0700
-
- Added to critical-excludes and ci-excludes. bin/ci -f s -C runs to completion.
-
- rake build:core compiled string.rb, so checking in core.rba.
-
-commit c9c79c910a57e5628d1743f3b440c0066875500e
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Sep 7 23:24:44 2007 -0700
-
- Added Math methods using FFI.
-
- Added Kernel.coerce_to and rewrote Float(), Integer(),
- Array(), and String() with it. Float() needs to be fixed
- to raise on strings like rb_cstr_to_dbl does.
-
- Fixed -C options for bin/ci and bin/mspec.
-
-commit b8d8b8c8475fde1ce3519e29788a34780dffae8c
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 19:40:02 2007 -0700
-
- Fixes String#<<
-
- * Added taint if other has taint
- * Fixed 10 spec failures
-
-commit b0b85547ab9dd16ba88a75c64a91c3ae0d079b27
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 15:36:44 2007 -0700
-
- Added bus error to critical-excludes
-
-commit ed13a10112d0a262a48c8e5db7d1eaaa3e076e55
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 15:19:51 2007 -0700
-
- String specs work in 1.8.6 MRI
-
-commit 6fc507c96e990139c311900c73c7e31447879071
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Sep 7 12:03:09 2007 -0700
-
- Changed VERSION and RUBY_VERSION to shadow MRI (currently 1.8.6).
-
- Added RBX_VERSION (currently 0.8.0). Updated loader -v to display
- RBX_VERSION and RUBY_VERSION and truncated BUILDREV.
-
- Enabled before|after(:all) for mini_rspec.
-
-commit 8ce602f80b35f5859c58730968a9a7053a87bd59
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Sep 7 11:16:16 2007 -0400
-
- Array#uniq, #uniq! simplified. 72 failures.
-
-commit 38f271a1b7d49074d8db9285553756fb75ffe78b
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 11:23:36 2007 -0700
-
- define_attr added to subtend
-
-commit 843706d585334c30943c8bbdd3ef6ca22297d42d
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 10:48:51 2007 -0700
-
- Added rb_cstr2inum to subtend
-
-commit 97a22e2144b623a62780995333d65986c98c4ba2
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 10:42:30 2007 -0700
-
- Added rb_const_defined to subtend
-
- It also seems that my fixture for require didn't make it in; adding that as well
-
-commit 0ac9ec2b0f381bf2fb3a36cd0b6f30748771e818
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 10:21:28 2007 -0700
-
- Added check_*_type to subtend
-
- * check_array_type
- * check_string_type
- * check_convert_type
-
-commit b2bf1c44fa7c2663e6fc0b27127aa4f5e38e073f
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 09:45:03 2007 -0700
-
- Added rb_attr_get to subtend
-
-commit 81605662ab8acc5a50536f1fc613e7d24e142df1
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 00:27:38 2007 -0700
-
- int2inum added to subtend as well as INT2NUM
-
-commit e80084e6b245173c17403891c65d86db1e6b3022
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Fri Sep 7 00:02:06 2007 -0700
-
- rb_str_split added to subtend
-
-commit 90f1fa95825caa8b21e147248d1a7d999579b937
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 23:51:56 2007 -0700
-
- rb_require in subtend added
-
-commit 5bb87f516b2a26f77a864a15636331102d6d8499
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 22:58:29 2007 -0700
-
- rb_to_id added
-
-commit e0532b3fb62089da7b7362ec2232997878a1221d
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 22:31:30 2007 -0700
-
- Added specs
-
-commit 75f7a1d2b37067f55099dd117e8fcd905baa748d
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 21:59:12 2007 -0700
-
- string subtend fixes
-
- * rb_str_cmp added
- * rb_str_cat fixed with working spec
-
-commit f058cea3e5291c349f5b2b1cfbdad4d734240f95
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 21:34:52 2007 -0700
-
- added rb_define_const
-
-commit ec7ca7f45ef32794afb919851e4bfd5e8d7aa46d
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 21:03:44 2007 -0700
-
- rb_include_module added
-
-commit 5b3471544508e973ba6afbd16daf47f5796f8b30
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Sep 6 20:41:09 2007 -0700
-
- float_new added and some functions missing in ruby.h added
-
-commit cd2af0bae996a4addfe23baa0558125a8a5523e7
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Sep 6 17:09:06 2007 -0700
-
- Fixed subtend. Added diagram of the context chain.
-
- NMCs (NativeMethodContext) now use the proper context stack.
- The stack maintenance was all screwed up when calling in and out of
- native methods, which was the source of a few problems.
-
-commit da5f9e6f942c11d906760e952debae4d05b3d872
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Sep 4 22:26:48 2007 -0700
-
- Added load-order dependency generation to rake build:(core|platform) task.
-
- Added 'depends on:' declarations to kernel/platform and kernel/core files.
-
- Updated ci-excludes.txt to reflect recent spec checkins.
-
-commit 7b1ca6f305e33b34a99e8c9e049843a76cceeca7
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Sep 2 21:29:49 2007 -0400
-
- Add more 'alias' specs. Show singleton methods in 'public_methods' output.
-
-commit 5c0b5fcb2a0c9f47a04e6a5d5027484224d0a942
-Merge: 4896039... 01c2126...
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Sep 2 18:58:53 2007 -0400
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 48960394ab7f36ccd1b18609677b40721c30d7a2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun Sep 2 18:57:29 2007 -0400
-
- Add some 'alias' specs that fail on rbx and pass on MRI
-
-commit 01c2126b705327d99aa183d51dc014169e8b4e07
-Merge: 04602c6... b6d92ec...
-Author: Florian Gross <flgr@ccan.de>
-Date: Sun Sep 2 19:45:25 2007 +0200
-
- Merge branch 'master' of git@git.rubini.us:code
-
- Conflicts:
-
- spec/core/string_spec.rb
-
-commit 04602c6756a9199b64e7d909c01dc995b25fa8a7
-Author: Florian Gross <flgr@ccan.de>
-Date: Sun Sep 2 19:32:47 2007 +0200
-
- * New specs for String#tr_s(!) and upcase(!)
- * Improved specs for String#capitalize!, downcase(!) and swapcase
-
-commit c94f83b20f7b11dc48c523c84de59b9ac6f76cce
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 23:15:07 2007 -0400
-
- Array#reverse_each, #rindex fixed and cleaned. 80 failures.
-
-commit f531f812f87283b950c62648e3cf08a7400c2779
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 22:03:05 2007 -0400
-
- Array#replace fixed, specs. 88 failures. * Disabled specs for #initialize_copy which is private.
-
-commit 1656b8a04a40bc5a43adec88ffd1480d9da6ba28
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 11:50:56 2007 -0400
-
- Array#reject, #reject!, specs fixed and cleaned * Added spec to check #reject returning Array and corrected implementation.
-
-commit e1c499c6feafc19788addd098a6da052904cb09c
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 11:25:45 2007 -0400
-
- Fixed logic in Array#rassoc, specs. 91 failures.
-
-commit da79b116d3fdc5fd4cd04f5ad1ad44b2c269ad77
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 10:38:39 2007 -0400
-
- Array#push checks frozenness, specs. 92 failures.
-
-commit 290aa6fe561453821f59be3fa92695d0b0d77c04
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 10:26:25 2007 -0400
-
- Uncommented most of Array#pack specs. * float -> int conversions still hang both C and c and are therefore disabled.
-
-commit 885f2522244c1792f45260194aba085028d5c919
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Fri Aug 31 09:59:30 2007 -0400
-
- Fixed logic errors in Array#assoc, Array#include? * Both, contrary to docs, compare elem == obj, not the other way around.
-
-commit d825038a409f4d931e80736e2de49ff0752857a9
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Aug 31 00:12:06 2007 -0700
-
- bin/ci supports options for separately running spec files
-
- Use bin/ci -s to separately process each spec file. Use
- bin/ci -m to run all the spec files in a single VM process.
- -s is the default for --create, but -m is the default for
- everything else.
-
- Updated ci-excludes.txt and critical-excludes.txt.
-
-commit 7dfe5cb7936051685a2c79effb6295b9aa179810
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Aug 30 23:44:28 2007 -0700
-
- Updated ci-excludes.txt to only exclude failing specs.
-
-commit fb09f0a7a6969adffd8d99bf869eb50c91eef097
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu Aug 30 20:31:20 2007 -0400
-
- Fix object and array specs that failed under MRI
-
-commit 6fb73244537b61a20538c1f3d5a060a40a358be5
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Thu Aug 30 17:08:12 2007 -0700
-
- Fixed two typos in the subtend string specs
-
-commit 00256f41d4e3ebfcdafdc25e27bfbf4bc7d3de3f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 11:19:09 2007 -0400
-
- Array#last fixed. 48 failures.
-
-commit 887d41c64c6bdff693f6ecd8d3078f8453669648
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 11:02:27 2007 -0400
-
- Array#insert, specs corrected. 49 failures.
- * Fixed Array#insert
- * Re-complianced frozenness specs for Array#inspect.
-
-commit 1bc536e1128bc76b1c9efae593340f67bdcb5fb5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 10:42:05 2007 -0400
-
- Array#indexes correct implementation. 51 failures.
- * Array#indexes and #indices is now correct although
- both methods are deprecated in favour of #values_at.
-
-commit 5de09c707b1ce43bf689e8ded9ea19784e77a49e
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 10:09:27 2007 -0400
-
- Array#include? implemented. 53 failures.
- * Replaced use of Enumerable#include?
- * Re-complianced to a simpler Array#include? spec to
- avoid implementation-dependedness.
-
-commit 14ca6c2533764eea508b24b0ec89475a7aae5e94
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 09:32:40 2007 -0400
-
- Array#hash spec compliance change. 54 failures.
- * Disabled an Array#hash spec for Rubinius because it
- relies too much on implementation details.
-
-commit fc4f392fa7fba88b36bfdec61db3acaa1f1fadc2
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Thu Aug 30 00:42:03 2007 -0400
-
- Array#flatten, #flatten!. Improved Array specs. 384 ex, 55 failures.
- * Array#flatten, #flatten! implementation improved, they
- also work recursively now.
- * Re-enabled Array#flatten, #flatten! specs and the
- recursive test for Array#inspect.
-
-commit efeaa622994e9868b9324247b0ff1fd5743792ac
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Wed Aug 29 23:29:36 2007 -0700
-
- A series of rb_str functions in subtend, plus fixes to some of the tests earlier committed
-
-commit e4f5281148799ed716065c489d384a42d208290d
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Wed Aug 29 19:16:26 2007 -0700
-
- rb_str_append() added
-
-commit a05c376478f7407da4e0aa2a6a7e3de98176a63b
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Wed Aug 29 13:25:17 2007 -0700
-
- Updated subtend array functions
-
- * rb_ary_reverse() added
- * tests added for rb_ary_join() and rb_ary_reverse()
-
-commit 779fb97c35b78b9749cbb118fcb555096957e4c6
-Merge: 2793a99... e17987e...
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Wed Aug 29 12:40:33 2007 -0700
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 2793a9917f8f5cc2f0fc14ba605cec499532e680
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Wed Aug 29 12:40:21 2007 -0700
-
- Slightly improved rb_ary_pop() test
-
-commit c196c60b6cd32c85b18bdab31ee000cf097309b5
-Author: Me <rue@meow.kittensoft.org>
-Date: Tue Aug 28 23:49:46 2007 -0400
-
- Array#fill fixed, cleaned up. 375 examples, 59 failures.
-
-commit 7736413f262357479c2f3354a73533fd89b3c9a6
-Author: Yehuda Katz <wycats@gmail.com>
-Date: Tue Aug 28 17:54:28 2007 -0700
-
- added rb_ary_join() to subtend
-
- Trying to get tests working but it's hard to see if I'm correct without the ability to run them.
- I'll take care of making sure there are passing tests as soon as I can.
-
-commit 0effcaf3e948d80ae3ad17b33f0483313d85cdbe
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Tue Aug 28 00:24:41 2007 -0400
-
- Array#fetch, specs, slightly cleaned array.rb. 62 failures.
- * Array#fetch uses to_int.
- * Specs for Array#fetch check for correct block var.
- * Removed extra comments from array.rb.
- * Removed old implementations from array.rb.
-
-commit 51737d35c24f853a23e14f7a227138d4d0f6b457
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Aug 27 21:46:30 2007 -0700
-
- Added failing File specs to ci-excludes
-
-commit a195970e2b2d34fa4388e6a72e91ada13b4b0d32
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Tue Aug 28 09:20:33 2007 +1000
-
- Ensure exists? is prefixed by File.
-
-commit 804b6f3358c1bb73492beaa0e978d4df8dbac138
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Tue Aug 28 00:18:41 2007 +1000
-
- Minor refactoring work on file spec.
-
- Removed duplicated constant tests.
-
-commit ef18eaaaa1a79b964667900b19f3f10e1b67032b
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Aug 27 14:25:06 2007 -0700
-
- Updates to enable bin/ci to run to completion.
-
- Changed mini_rspec to not use File.open with a block to work
- around IO#read failing to catch EOFError.
-
- Commented out object_spec.rb specs that need to be completely redone.
-
- Updated spec/reports exclude files to enable bin/ci to work.
-
-commit 505617b26829d5f489c4488ed934a6dc720f64f0
-Author: Florian Gross <flgr@ccan.de>
-Date: Sun Aug 26 22:53:42 2007 +0200
-
- A few new specs for String#sum, #to_i, #to_s, #to_str, #tr and #tr!
-
-commit a6a24a97dce2a4072a6ea17e48259b76f0c3681a
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Aug 26 02:52:55 2007 -0400
-
- Array#delete, Array#delete_at, Array#delete_if. 63 failures.
- * Fixed the three delete* methods, they still need clean-up
- * The specs reflect difference in frozen handling for rbx and r18
-
-commit 063f8c25d45e0934bca236ecb8af36dcb517187f
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Aug 26 02:26:15 2007 -0400
-
- Array#concat fixed. 69 failures.
- * Array#concat checks frozenness and cleaned up
- * Improved specs for #concat
-
-commit a9f3593593948cf72d94712765d05bfcc27f2e78
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sun Aug 26 01:53:05 2007 -0400
-
- Array#dup, Array#compact, Array#compact!. 71 failing.
- * Array#dup properly returns subclass
- * Array#compact(!) improved to pass specs
-
-commit 7be3bc12ea2e5432e442cb44103b4b1c6d981163
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 23:57:38 2007 -0400
-
- Array#clear, Array#frozen?. 372 examples, 73 failures. * Array#frozen? checks for sorting freezes * Array#clear fails on frozen Arrays
-
-commit 5c958242fe25f8a18cd8d315f81fb3db80dc7a40
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 17:19:23 2007 -0400
-
- Array#==, Array#assoc improvements. 75 failures
- * Cleaned up Array#==
- * Array#assoc processes correctly
-
-commit f82f8a300ee394f9f1038cc84de1cf6b132d7ef5
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 16:24:22 2007 -0400
-
- Array#* improved. 371 specs, 81 failures
- * Array#* processes to_int and to_ary correctly and forwards
- to #join when needed.
-
-commit 91e16f06d5b5b16f1fa7ffc1d3673d7f1c681587
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 15:54:12 2007 -0400
-
- Array#join can process recursive Arrays.
- * Rubinius cannot create recursive Arrays so this is somewhat moot.
-
-commit 2d7427bb638f1af6d7437beed4beafde5274dbdf
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 13:46:45 2007 -0400
-
- Array#|, better Array#&. 371 examples, 86 failures.
- * Array#& explicitly uses #eql? semantics
- * Cleaned up Array#|, uses to_ary
-
-commit 2b8707466f763662d52efaeab71b4789b132bb40
-Merge: c61b1e5... 76be87f...
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 12:41:06 2007 -0400
-
- Merge branch 'array'
-
-commit 76be87f74d352d79425e9c46d3df55678257fda9
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 12:28:32 2007 -0400
-
- Array#<< improvements. 371 examples, 89 failures.
- * Specced and fixed resizing bug in Array#<<
-
-commit c61b1e54cc11c297b9e9a9eca70cb6a354ed21d9
-Merge: 3618a8b... c6cc98f...
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Sat Aug 25 18:16:45 2007 +0200
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 3618a8bc588588ef8fb0dcc4753bc42606b86c13
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Sat Aug 25 18:16:05 2007 +0200
-
- Update object specs
- Update the object_spec.rb file
- * add more specs
- * refactor using it_behave_like
-
-commit 294e5aacda8a74a9d8f57d05bb433f2fadcd08f1
-Author: Eero Saynatkari <rubinius@projects.kittensoft.org>
-Date: Sat Aug 25 12:07:06 2007 -0400
-
- Array#[], modified parts of array_spec. 369 examples, 90 failures.
- * Array#[] passes its specs
- * Disabled some parts of array_spec while fixing Array. These
- will be re-enabled as soon as possible.
-
-commit 1369465aefcd1d50ddd268ba9af968c62137e2b2
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Fri Aug 24 11:14:20 2007 +0200
-
- Array#new correct implementation
-
-commit e321427a52878ef9d9c7c04aa7c3c4f1e3a6c940
-Merge: bff7c05... 69c0407...
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Fri Aug 24 11:14:20 2007 +0200
-
- Merge branch 'master' of git@git.rubini.us:code
-
-commit 07c7f93a64fc37f3cf94a0a2c272468d015a7fb3
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Aug 23 21:18:13 2007 -0700
-
- Converted Regexp specs to new describe style.
-
- Fixed String specs to be compatible with bin/completeness.
- Fixed bin/completeness to use dotted reporter instead of CI
- reporter since the latter no longer outputs summary info.
-
-commit 6776e1478fa7e78a0944a1ee59c55c3839f51ea4
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Fri Aug 24 13:14:47 2007 +1000
-
- Added implementation of File.split and updated specs.
-
-commit 4053b9076b4b996f544095a75317453967723faa
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Wed Aug 22 21:58:13 2007 +1000
-
- Added spec for mocking methods on a class
-
-commit 54cae1196db08f6a734c35079db8df62e491f300
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Thu Aug 23 17:38:40 2007 -0700
-
- Added more IO stuff and platform methods.
-
- I'm still a little unhappy with the input buffer situation.
- (ie, there is none.)
-
- Adds IO#sysread and IO#syswrite as well as a bunch of POSIX stuff.
-
-commit 12a755004c0a8a0319212965da61385738166f98
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Aug 21 12:44:48 2007 -0700
-
- Beginnings of ftools spec, fix backtrace generation.
-
- Backtraces were failing to be properly built if the sender was a Block.
-
-commit bff7c05ce12c79ef111422ecf4525f1a65e7a5f0
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Fri Aug 24 01:15:41 2007 +0200
-
- More specs dor enumerable
- * add inject, min, grep, find, detect, find_all, select
-
-commit ed9a8fefcc384bb6548a7f66bbafb97192ec8fd3
-Merge: 4ef0b9f... 8dd800e...
-Author: Arthur Schreiber <schreiber.arthur@gmail.com>
-Date: Thu Aug 23 11:01:25 2007 +0200
-
- Merge branch 'specs'
-
-commit 8dd800e8189f616dc54390c0ebf96c331de41230
-Author: schreiber.arthur@gmail.com <arthur@arthur-desktop.(none)>
-Date: Thu Aug 23 10:45:56 2007 +0200
-
- * Some more Module Specs.
-
-commit 0f414f56f9050d86011df75e7fd23428fe378996
-Author: schreiber.arthur@gmail.com <arthur@arthur-desktop.(none)>
-Date: Thu Aug 23 10:44:59 2007 +0200
-
- * Added :count => :any option to mock expectations
-
-commit 4ef0b9feddfebfd1b6177fce6e3a1a4077f4f098
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Aug 22 23:10:22 2007 -0700
-
- Updated exclusion list for CI specs.
- Updated rake spec:ci task.
- Changed ci spec run action to execute all specs in one process.
- Added guard on file specs to prevent compilation exception.
-
-commit c3b61b239fa6a02327e5651513986d998d826eaf
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Aug 22 21:48:08 2007 -0700
-
- Updated CI spec process to exclude specs failing on compilation.
-
- Added critical failures to enable running especially spec/core.
- Added failure guards to struct specs.
-
-commit f339a284c66357bc52749e5fe9c0d59bbbdc7ade
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Aug 20 22:31:56 2007 -0700
-
- Fleshed out bin/ci constructs for running specs.
-
-commit 4f750d59adfff6c1751372c0d2853778dc7ae16d
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Tue Aug 21 22:40:33 2007 +0200
-
- * more enumerable specs
- * refactor to it_behaves_like
-
-commit 3c79d5cf67b40b945602d5c5fa77589e0d7bae2c
-Author: Pedro Del Gallego Vida <pedro@la-vaca-roja.(none)>
-Date: Tue Aug 21 20:52:16 2007 +0200
-
- update file_spec.rb
-
-commit b2a64089bffe5afb9148a665ecb6e70c3bc62b67
-Merge: 6865b97... 1b6a8a1...
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 19 16:22:53 2007 -0700
-
- merge 1b6a8a157
-
-commit bf54767922eb8d494c683ed8d57c6ffb5164fc29
-Merge: 6c6032e... 37d71c9...
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 19 15:24:21 2007 -0700
-
- merge from e83bcd022
-
-commit 05db33909c319231ac375812025ea2378710a299
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sun Aug 19 21:26:15 2007 +1000
-
- Add conditional when deleting a file in after(:each) block to prevent an exception if the file is missing.
-
-commit 138ab001175987cd38aff092a850e515745f9292
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sun Aug 19 21:18:22 2007 +1000
-
- Converted remaining context/specify spec's into describe/it, and followed class/method naming convention.
-
-commit 749b883d0260326573c581cc63eab67e1a4bc590
-Author: Marcus Crafter <crafterm@redartisan.com>
-Date: Sun Aug 19 20:23:11 2007 +1000
-
- Added implementation of exists? blockdev? chardev? zero? size size? writable_real? executable_real? readable_real? unlink delete and chmod using ffi where needed. Specs for most of these methods existed already, added specs for those that weren't. Fixed a few typos.
-
-commit ddcb14f9f2311ec843a1f1f8d2b3fa868384ff0d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 18 23:19:32 2007 -0700
-
- more misc changes to get ci specs working
- added alias for File.exists? and File.exist?
- added Dir.getcwd
- added empty File.delete
-
-commit afb252fd6170ed051e97f1911e5f1200414ebf98
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 18 22:20:10 2007 -0700
-
- updated compiler specs.
-
-commit d0e6b658d9065b0fbc9180cd5d19139834f64f59
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 18 21:04:18 2007 -0700
-
- changes to support better CI specs
- hat mini_rspec will take a filename as an exclude/include argument and read the actual excludes/includes from the file.
- added that mspec will take -o FILE to use an alternate to STDOUT for the spec reporter output.
- updated spec tasks. misc spec changes.
- added naive implementation of IO#each.
-
-commit 541bcb521a8ee589c7d28c095ad7ee1489af42db
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri Aug 17 19:30:05 2007 -0700
-
- Complete reorganization of bootstrap. Addition of kernel/platform. FFI fixed.
-
- New restrictions for meta-programming in core bodies (not in methods).
- kernel/platform is now where platform specific code, mainly related to FFI, lives.
- A bunch of FFI bugs have been fixed and it should be working much better now.
-
- FFI Note: you may now only specify :state as your first argument, and you must
- leave it off when you call the method (rather than passing nil like before).
-
-commit af245dfbc80ff942de62408e70db7499a798fb0a
-Author: schreiber.arthur@gmail.com <arthur@arthur-desktop.(none)>
-Date: Tue Aug 14 01:30:09 2007 +0200
-
- Forgot to add the autoloaded file for Module#autoload
-
-commit b946940f463028de067ef2e082c96fe431c94b0a
-Author: schreiber.arthur@gmail.com <arthur@arthur-desktop.(none)>
-Date: Tue Aug 14 01:09:10 2007 +0200
-
- Updated Module Specs
-
-commit 6cd6aa53a5d20c78941442f7e367ef8c7aee17c2
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Aug 10 00:14:09 2007 +0000
-
- converted array specs with a few edits.
-
-commit c075f7f70da2a029c69f3fff1f9caec419db64d5
-Author: Arthur <arthur@unknown>
-Date: Wed Aug 8 12:47:18 2007 +0000
-
- fix a small typo
-
-commit c7262df9ee1c2544890b001574c8cb0f8ae26a75
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Aug 8 01:24:25 2007 +0000
-
- converted exception specs. added #should_be_ancestor_of. use ExpectationNotMetError in mini_rspec like rspec does.
-
-commit f591e18978b73c508505db73f274f4bd69c372c5
-Author: Arthur <arthur@unknown>
-Date: Tue Aug 7 08:36:15 2007 +0000
-
- * String#to_str specs should actually use String#to_str
-
-commit 80f69571c5378d6bbb2e7a118ada00db66226797
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Aug 7 06:47:53 2007 +0000
-
- converted range specs.
-
-commit aca62d253a6b2df891ca4ec4b177ea95b621d636
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Aug 7 03:52:46 2007 +0000
-
- fixed mini_rspec -e option, allows multiples. converted hash specs.
-
-commit 928c9a392102fa7b7945f332480a7477ec203467
-Author: Florian Gross <florgro@gmail.com>
-Date: Mon Aug 6 22:04:16 2007 +0000
-
- New specs for String#swapcase(!), to_f, to_i, to_str, to_sym
-
-commit 6d0a6b0051a55af32743d9d98d6425489a622ebe
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Mon Aug 6 21:58:55 2007 +0000
-
- * more specs for File.open. Specs for File.truncate
-
-commit 8b19b683a8593b4dd5024841d8023df827a44875
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 5 23:39:36 2007 +0000
-
- fixed completeness to not over match methods. converted comparable specs.
-
-commit c6f4d90df72b103884fa5470a433f5513d2c524d
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Sun Aug 5 22:52:17 2007 +0000
-
- * more specs for File.open. Some of them are plataform dependent
-
-commit 38bfff9d014b90409e272ddf041dc63f53d48f5d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 5 22:45:31 2007 +0000
-
- converted bignum specs. misc cleanup.
-
-commit 14890b68c447731417ce53ca2e4310175e39b440
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Aug 5 22:00:04 2007 +0000
-
- Small spec fix
-
-commit b6c3cfca5cf1b2cb85dc216180ad21a6bf653a10
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 5 17:20:32 2007 +0000
-
- converted time specs. according to completeness, need to spec 9 more methods.
-
-commit 8829cf7e94ec0434f642fafa7dbf117a860045b9
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 5 07:53:47 2007 +0000
-
- more converted specs.
-
-commit 5bf174780e893b7ee9b82b6ca3964db7cad84e30
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Aug 5 07:08:08 2007 +0000
-
- converted fixnum specs to describe per method.
-
-commit 88023701a88c1113e4874c193d26c6bf21fad383
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 4 22:19:18 2007 +0000
-
- misc noise cleanup in specs. use bin/completeness to find missing specs rather than warns.
-
-commit 3d960a021cb9ac2bdc2a204f94b4f024f3ef60a4
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 4 22:06:12 2007 +0000
-
- fixed completeness to pass correct spec example string for class methods. changed float specs to describe per method.
-
-commit 8a7abb5996e5bdf8b9d6c5884e0e0d8ae73d060e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 4 20:10:38 2007 +0000
-
- beginning of a completeness reporter. use 'bin/completeness -t ruby' to report on the completeness of the specs against MRI. use 'bin/completeness' to report on the completeness of rbx relative to MRI. use -t target for other implementations. updated some specs to the 'describe Class#method' style.
-
-commit 463f13be4462e22bc3f4491a475658624c5832ab
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Sat Aug 4 17:09:25 2007 +0000
-
- * fix some bugs in bignum_spec
- * changed the File::Foo.shouid == bar assert to defined?(File::Foo).should == "constant". The specific value dependence on OS.
-
-commit 989d72394f1e175b058f55ccf3e60f09a2c76401
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Aug 4 04:15:01 2007 +0000
-
- fixed mini_rspec specdox reporter to not output describe message until examples are executed. fixed specdox and dotted reporter to distinguish between errors and failures.
-
-commit f98fe7f211e5784a35e99643fb52c9350b20d7ae
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Aug 4 01:40:52 2007 +0000
-
- More compatibility and a few small fixes
-
-commit c78ba9f96d7d4d229d6b1b1b11cf314fb5a0271d
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Aug 4 00:40:42 2007 +0000
-
- Compatibility for USE_RSPEC=1, sanity, some clean-up
-
-commit 761d05b5cbd92339f9d02e65d005a65c5155618e
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Aug 3 21:49:26 2007 +0000
-
- * Compiler and Normalizer fixes for method definitions without bodies
-
-commit ad7abe4d61171f9650d08b277d45c7f680f37950
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Aug 3 17:07:19 2007 +0000
-
- fixed mini_rspec shared behavior to be compatible with rspec.
-
-commit 1e1ccb902d11547e9f67db82c31a5898e6227d67
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Aug 3 16:39:07 2007 +0000
-
- added an implementation of shared behavior for mini_rspec. altered Array#[] and Array#slice specs to use shared behavior.
-
-commit 7697b2ae3db6ed1d8697010a7e0f52f8e3587c8a
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Aug 2 20:41:43 2007 +0000
-
- added SpecRunner class to mini_rspec to properly encapsulate behavior. added --example option to specify a regexp to match examples to execute.
-
-commit b80bb3d295d3648988b15a29553189f219d8ac0a
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Thu Aug 2 15:56:07 2007 +0000
-
- * added specs for file_spec
-
-commit c277fd3de82678f055693422af19c3f45ffc2a88
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Aug 2 00:46:27 2007 +0000
-
- mspec: Add -x option for excluding specs by RE
-
-commit aa53967c694ed7621aa1a8a8b542d067d9e58925
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Aug 2 00:05:53 2007 +0000
-
- New specs for String#succ(!)
-
-commit eafa5b0fd43168b4ae649b145f9528f7deae3aa7
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Aug 1 22:59:38 2007 +0000
-
- New specs for String#sub(!)
-
-commit 3406e64032251a2a9849da3f6c27d872dd339175
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Aug 1 22:17:18 2007 +0000
-
- New specs for String#squeeze(!) and String#strip(!)
-
-commit fa4d66576528725085ef47cca27c5c85c55b3150
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Aug 1 21:08:26 2007 +0000
-
- added Object#(public|private|protected)_methods and Module#(public|private|protected)_instance_methods. added Tuple#first, last.
-
-commit 4ca071ba4a48aa984308e0ba9448718a6e214d7a
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jul 31 20:56:37 2007 +0000
-
- Some Object#methods et al specs.
-
-commit 67be404ac0714ec01c1c92c77465915d90fd794b
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 31 18:41:54 2007 +0000
-
- Renamed variables_spec.rb to assignment_spec.rb
-
-commit c0187db3e51297dfffabebe9acb6d6321bd04578
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 31 18:22:41 2007 +0000
-
- New specs for String#split
-
-commit 06cb5ab7c39866c99bb8d9a5fbb678f2f8a19cf2
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jul 22 06:47:54 2007 +0000
-
- Removed the .rbc files from externals dir and set svn:ignore. Added Tuple specs, fixed a couple small problems with Tuple. Modified mspec to pass -I, -r to the target; added -n RUBY_NAME to affect which specs are run. Added hashi dir as an experiment to implement a bootstrap that could be run on e.g. MRI or JRuby to allow the core libs to be run and tested against the specs.
-
-commit 567d4f710bc232fc9223972e22a7d92e4abe940d
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue Jul 17 17:49:53 2007 +0000
-
- Stack allocated lvars, GC fixes, compiler changes, oh my!
-
- This is a biggy (too big in fact). It started as a change to allow
- arguments to be accessed directly from the stack, and turned into a
- monster.
-
- Arguments and some lvars can now be accessed directly from the stack,
- making them cheaper to create and use. This turned out to expose
- a large number of bugs in the VM related to stack access, as well
- as some in the GC.
-
- The big GC change here is that the mark/sweep GC is actually run now,
- as opposed to before when it would just allocated more and more memory
- (the source of memory issues I suspect).
-
-commit 564ac024e14a790f4a3d257ddf1d9fa0cb93ee3b
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 17 00:20:52 2007 +0000
-
- $~ specs all over the place;
- Revised % format string specs (match MRI trunk);
- Revised hex and oct specs (match MRI trunk);
- Merged slice together with [];
- New specs for scan and slice!
-
-commit 2389eb4b36d86732dbb621be1cad3edca0e36aa5
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Mon Jul 16 09:26:20 2007 +0000
-
- * added specs for file_spec
-
-commit a6453b6184353633d14c271533c2e2af7a6c4b12
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jul 15 17:53:58 2007 +0000
-
- A few specs for char numbers outside of 0..255;
- A few specs for modifying strings while iterating;
- New specs for hex, index, initialize(_copy), ljust, lstrip(!), match, next(!), oct, replace, reverse(!), rindex, rjust, rstrip(!);
- Small additions, fixes & refactoring
-
-commit 217dd5dae127c146559dd1512edac23a94565ae9
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Jul 14 23:52:52 2007 +0000
-
- Taintedness specs all over the place;
- String subclass specs for String#%;
- Range subclass specs for access methods;
- str[idx, count] = str specs (contributed by John Lam);
- New cases for capitalize(!) / center / gsub(!);
- Refactoring
-
-commit b8b0c3dd380335260c3870934ca51dce736ce15d
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Jul 14 23:39:38 2007 +0000
-
- Added custom range subclass cases for access methods
-
-commit 558552ec549fd605bed2c8f5c384e8c944e780a2
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Fri Jul 13 14:40:15 2007 +0000
-
- * added cases for file_spec
-
-commit 5218708c630bd8a631522a00aa6cba4e91cbec54
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Fri Jul 13 13:36:53 2007 +0000
-
- * added cases for file_spec
- * refactoring numeric_spec.rb
-
-commit 3e9dbc15a81950e55a15a7fcca0ab04a5fd5353f
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jul 11 22:09:49 2007 +0000
-
- Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
- Small clean up
-
-commit 23961f46af6f74d2d6b9019972e451a5ae12b728
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jul 11 22:00:26 2007 +0000
-
- Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
- Removed a few duplicate specs (probably resulting from a mismerge)
-
-commit 639c64ca0965ff79401989ca7dbde862815f13fb
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jul 11 21:09:33 2007 +0000
-
- Add specs for to_* calls having correct semantics with method_missing() and respond_to?();
- Fixed String#%'s %E/e/f/G/g and %b/d/i/o/u/X/x specs to verify Kernel#Float / Kernel#Integer semantics instead of to_f / to_i ones
-
-commit e97879670bbc8425810a3c83f15a523066899a89
-Author: Arthur <arthur@unknown>
-Date: Tue Jul 10 20:04:48 2007 +0000
-
- * fix a typo
-
-commit 1e8890613a215c61ef90629b8b6023ac4612c499
-Author: Arthur <arthur@unknown>
-Date: Tue Jul 10 20:03:44 2007 +0000
-
- * Update Symbol Specs to the new format.
- * make Symbol#to_int show a warning as in MRI.
-
-commit 1262f24460463628c7cc4e275b7c814048937b57
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 10 18:28:06 2007 +0000
-
- New specs for gsub() without block
-
-commit 0ba87f6edc183385551e4cf8c05212fadaf36427
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 10 16:48:46 2007 +0000
-
- New specs for capitalize, chomp, concat, crypt, eql?;
- Added missing methods chop, chop!, count;
- Small improvements and refactoring
-
-commit 226942caef6bd217a13dc235a89c5ccf4a18f98b
-Author: Florian Gross <florgro@gmail.com>
-Date: Mon Jul 9 21:29:19 2007 +0000
-
- Strings specs for letters c through e
-
-commit e41c027537f1e4f8ea4b8b5b6fe90df9a21e3aff
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Fri Jul 6 17:13:39 2007 +0000
-
- * added 62 cases for file_spec
- * remove a bug from obejct#method_missing_spec that break the specs
-
-commit 06d2fd71b847e139a39ab3b7a132ab041a8d4c1e
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Wed Jul 4 16:05:21 2007 +0000
-
- * add 84 cases to the numeric_spec.rb
-
-commit b8d334f575322c65932279346bba61caead61555
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Wed Jul 4 10:28:27 2007 +0000
-
- * 14 cases for Object.method_missing
- * Add File#atime, File.atime, File#ctime, File.ctime, File.delete, File.executable?, File.executable?
-
-commit f2276130c4bf1894ffb6efb451203dcbfe9322bb
-Author: Charles Nutter <charles.nutter@sun.com>
-Date: Wed Jul 4 08:48:57 2007 +0000
-
- Added a spec for Process::times...it's not great, but it's something.
-
-commit f71bb57b3fc69c35d34abdb9959e27efb71bbdff
-Author: Charles Nutter <charles.nutter@sun.com>
-Date: Wed Jul 4 06:14:06 2007 +0000
-
- Fixes for #150; handle Time - Time correctly, don't assume it's a number of seconds.
-
-commit 895f1abdc0bfcdb213f97067704b1bb87a7e6d17
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 3 17:01:27 2007 +0000
-
- New specs for casecmp
-
-commit 2aa7cb37925cd92c3b23d4a33a6d7bc7c2b66737
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jul 3 14:07:56 2007 +0000
-
- New #[] and #[]=, capitalize and casecmp specs;
- Converted "should work" messages to "works" using a few regular expressions -- I'm still going through the file so bad replacements (if any) will be fixed
-
-commit 719ff3b8959d93d7da8165d6e5b44989afde92d7
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Tue Jul 3 00:33:59 2007 +0000
-
- * new NoMethodErro_spec.rb
-
-commit 5363324044fdc1457cfbf1b738dd931d3255b191
-Author: Florian Gross <florgro@gmail.com>
-Date: Mon Jul 2 23:58:09 2007 +0000
-
- Some more new specs
-
-commit fa1b3694e366bf087a8d1ac107257c38ce447251
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Mon Jul 2 20:29:20 2007 +0000
-
- * Add to_s with a base spec
- * Change foo.aMethod.to_s.should == "bar" with foo.aMethod.should_be_close(bar,TOLERANCE) because floats representation are plataform/implementation dependents, but not changed aBignum.to_s.should = ...
-
-commit 2a5c93afd4ddfef7c30de17c531f49849e9bb957
-Author: Pedro Del Gallego <pedro.delgallego@gmail.com>
-Date: Mon Jul 2 00:10:06 2007 +0000
-
- * Add Float::Constant specs
- * Change foo.aMethod.to_s.should == "bar" with foo.aMethod.should_be_close(bar,TOLERANCE) because floats representation are plataform/implementation dependents
-
-commit 7d3dcc24cb72d6548cf44d8519691f4cd7344801
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jul 1 21:00:37 2007 +0000
-
- Heavily extended and refactored String#% specs;
- some cleanup
-
-commit 79ce6628df39d20d03efcd715ea42ba70ae9f03e
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jul 1 20:59:38 2007 +0000
-
- Add support for MRI as :mri for failure() and similar methods
-
-commit 7e43cd858c0380aaf17dd7bacd8a24cef96bb309
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jul 1 17:11:08 2007 +0000
-
- rindex terror specs
-
-commit e5b7cf88092cf59357124e3d8f35bc19f8ee589a
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jul 1 01:14:09 2007 +0000
-
- Added a few new format specs (Most of these should probably be moved to Kernel::format later)
-
-commit a533693824608a03ab6a66882b607fecab3a3a75
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Jun 30 00:29:29 2007 +0000
-
- A few more specs, clean up and compatibility with MRI 1.9 head
-
-commit b9e8936562ec23db63879f9c127dadeadd8adf2e
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 29 02:41:40 2007 +0000
-
- New specs for [], default(), delete(), shift(), yield argument count semantics and modifying hashes while iterating over them;
- Also removed some warnings and cleaned up the code a bit
-
-commit 72d1b106c1de4b00b9af184eb890e950854a9c77
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 29 02:37:55 2007 +0000
-
- Adding spec for join passing along separator argument for nested arrays
-
-commit 6e2848b7143cd0ae47a7b9ac632a567df7fd30fc
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 29 02:35:09 2007 +0000
-
- Adding message argument for should_raise()
-
-commit 31591886dde4bfd9b4e9de34c26960e45566b7ee
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jun 27 05:15:15 2007 +0000
-
- Commiting (#147) math specs by pedro (modified for style, structure, and legibility).
-
-commit c7d623ee836363d0f3d443ba1c676ef0f86e34f7
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jun 26 04:06:49 2007 +0000
-
- enhanced spec:ci to take a target on the command line, invoke like: SPEC_TARGET=jruby rake spec:ci. removed deprecated #only and #except from spec_helper.
-
-commit c13a588cb7e37c20ce7e8a9430d854cc51be7b00
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 25 08:28:10 2007 +0000
-
- misc cleanups to specs to eliminate interaction effects.
-
-commit 280296208bd699cb574c662f92b585519a739c6b
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 25 02:42:07 2007 +0000
-
- removed extension dir and added README for subtend specs.
-
-commit 7ce8d4addc77ea9da0daf3ea3dc1fc7b00030b29
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 25 02:30:15 2007 +0000
-
- reorganized subtend specs. stragglers from spec/language reorg.
-
-commit d499ebfd98d8fb9bd50c0f7a46b3587aa1f28c8a
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jun 24 19:44:12 2007 +0000
-
- significant reorganization of spec/language, added files that correspond to the desired layout of this section. there remains to be done a large amount of cleanup for existing language specs, and especially spec description strings.
-
-commit bc0d0965bb5a6b3966884b63edd37218359aa46d
-Author: Tilman <tilman@unknown>
-Date: Sun Jun 24 14:52:15 2007 +0000
-
- Extended specs for File.join.
-
-commit a4e189f31a8c256821564041c4dbce2a832ba78e
-Author: Tilman <tilman@unknown>
-Date: Sun Jun 24 13:00:33 2007 +0000
-
- Fixed a typo.
-
-commit ecaf1abafeb69994b05463742ca4220797f62ad3
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Fri Jun 22 23:25:13 2007 +0000
-
- * Array specs by Josh Susser (hasmanyjosh)
-
-commit 1c8987b6195d356126ebc3cc9c21e473be915240
-Author: Arthur <arthur@unknown>
-Date: Fri Jun 22 21:22:30 2007 +0000
-
- * Heavily extended String specs
-
-commit 663e2cbe0c026aa7e792b6aab682301570ccd766
-Author: Tilman <tilman@unknown>
-Date: Fri Jun 22 08:59:42 2007 +0000
-
- Added specs for Time#dup.
-
-commit f9dd8149bd7d794e8686053e8dca010ea71eacba
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jun 21 06:47:57 2007 +0000
-
- added methods #compliant, #noncompliant, #extension, #failure. Please read the comments for them in spec_helper.rb. #only, #except are deprecated but have not yet been removed.
-
-commit 389b3cef5176b0244f78294a3c820cc84797e0df
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jun 21 05:22:36 2007 +0000
-
- added -f i (immediate) reporter for mini_rspec.
-
-commit d113f855e32d09abaa74bb0ccafa4a65ffce66b1
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jun 20 21:59:27 2007 +0000
-
- A few more hash order consistency specs
-
-commit 8df2a605937c29b0ca4e89fae37b725e7244fbee
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jun 20 21:24:01 2007 +0000
-
- Small spec improvements all over the place
-
-commit 5c2472584637b6f5accaaf2450d4c23904b0bbd7
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 23:06:33 2007 +0000
-
- Small tweaks to let us run specs against Ruby 1.9
-
-commit 18b06659146f00f0ecf72846c445b03268305328
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 15:56:02 2007 +0000
-
- More specs, including frozen hash ones
-
-commit 3cc17a6c7d4c4e4d13b67da4e2bd8937160916f0
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 15:02:21 2007 +0000
-
- Specs for methods involving to_hash and more
-
-commit a33e72ba27dc7c80fb7c3947d4fe86521b8987e0
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 13:35:14 2007 +0000
-
- New specs for each, each_key, each_pair, each_value, fetch, has_value?, index, initialize_copy, inspect, invert, key?, keys, length, merge, merge!, rehash, to_a and value?
-
-commit f5ec55b0233fd6b7825b04afc6157caac0c529ce
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 13:18:33 2007 +0000
-
- Using except(:rbx) for "inspect should handle recursive arrays" instead of commenting it out
-
-commit 7fec6cb5534d22dbfa4dd245cf3b0c0776b3b465
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 00:56:35 2007 +0000
-
- New specs for Hash.new, #==, #[], #[]=, #clear, #default=, #delete and #empty?
-
-commit e3085af8e97177f8b7e4ff1c2aad2f306a4f474d
-Author: Florian Gross <florgro@gmail.com>
-Date: Tue Jun 19 00:53:43 2007 +0000
-
- Specs for how Array#uniq should use eql?() and hash()
-
-commit 01799e95c71453e8dff9730dd283bf76989e75e5
-Author: Florian Gross <florgro@gmail.com>
-Date: Mon Jun 18 11:22:47 2007 +0000
-
- Adding new specs from rue plus more. The diff is a bit chaotic, but everything should be OK.
-
-commit 890deed76153d05c6874b46ec29c474eb4e36e41
-Author: Florian Gross <florgro@gmail.com>
-Date: Mon Jun 18 11:12:04 2007 +0000
-
- Moving only() to general spec helpers, adding expect()
-
-commit bf89af6c3b632b88e3cc74bead42f21561da58a7
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 18 07:19:15 2007 +0000
-
- (Jason Toy) added some specs for File (with some modifications) (#130).
-
-commit a7a6d8e336f8d331c60e973fb8f9e0aac1fb61ac
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 18 05:20:29 2007 +0000
-
- (Jason Toy) initial specs for YAML (#123).
-
-commit 4c2f70040050e35da28a8684296f913a3dd4a198
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 18 05:14:41 2007 +0000
-
- (nitay) patch for Bignum#size (#120).
-
-commit b1e57c9c718acfc7f1e61ae1fb60f10b918f8e5c
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 18 01:40:29 2007 +0000
-
- Range specs and code from Ryan Mulligan (#141).
-
-commit 9fa70f392bf83c55d67e682c36d9ebd247cff62c
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jun 17 22:02:48 2007 +0000
-
- New specs from Ryan Mulligan (#140)
-
-commit 64c970bddeb754115ed193d2f786c797ea90dab3
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jun 17 20:08:40 2007 +0000
-
- reorganized specs to put implementation-specific extensions in a subdirectory within the logical division of the specs into core, library, language.
-
-commit 8d437f0f63d4d3f9eea6e4436a28f437e6e76053
-Author: Florian Gross <florgro@gmail.com>
-Date: Sun Jun 17 19:39:37 2007 +0000
-
- Initial work on hash specs -- a few new cases and a bit of reorganization
-
-commit d8222049004ba0d6ec51db0c962b5200bb180aec
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jun 17 03:53:45 2007 +0000
-
- (yipstar) module specs for undef_method, define_method, remove_method. all pass MRI.
-
-commit 0162cfe6a443ded5d6c8e01a866f5a8d1fbce901
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Jun 16 23:11:31 2007 +0000
-
- Added specs for * / join / to_s with recursive arrays
-
-commit 0744e57d7860b9f6eefcc8e14962d7ee777d2ec4
-Author: Florian Gross <florgro@gmail.com>
-Date: Sat Jun 16 22:05:32 2007 +0000
-
- A few more specs for array sub classes with to_ary [ruby-core:11472]
-
-commit 07e0df5111c8ceeda83e50ef434948ee17e92aae
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jun 16 19:09:19 2007 +0000
-
- commented out specs that cause the VM to seriously misbehave allocating memory without bound or causing SIGBUS. currently 434 examples, 130 failures at r1357 on MBP.
-
-commit 2abc6e6dc5df662e8f0587636bd1cf3573e39f28
-Author: Tilman <tilman@unknown>
-Date: Sat Jun 16 16:41:07 2007 +0000
-
- Don't use timezone names that aren't portable.
- Instead, specify timezones by their standard name and the offset from GMT.
- This makes the specs pass on FreeBSD w/ MRI.
-
-commit d4106115c2ca9a4678b7060b6ac0091d66312624
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jun 16 08:20:29 2007 +0000
-
- a first, big step to making the entire set of specs more agnostic about the ruby implementation/engine by, paradoxically, qualifying certain specs to only run under certain ruby engines. removed incompatible and rubinius directories. folded in specs where appropriate and moved spec files (e.g. bytearray, tuple, compression) into the appropriate directories. the spec/parser and spec/compiler dividing line is not clearly defined given the range of types of implementations and perhaps should be merged.
-
-commit 3de0340e693e20b5e32c643f1f4dae7e1943e077
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jun 16 07:07:41 2007 +0000
-
- migrated more tests from shotgun-tests to specs.
-
-commit 369813306643d98c277841c1e9b400f6b60d3316
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 15 22:43:05 2007 +0000
-
- Add spec for elements returning odd stuff on <=>
-
-commit d70ab64def5ebdcb0e1946618b06e810270eb2aa
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 15 22:17:03 2007 +0000
-
- New specs for frozen arrays
-
-commit fda7128521254d2db2668fec55ef7ce9337ecf1a
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 15 21:55:30 2007 +0000
-
- More specs, mostly for array subclasses
-
-commit 2d57166d2ef2ff63f333b7ee0c196f5c4e10b8cf
-Author: Florian Gross <florgro@gmail.com>
-Date: Fri Jun 15 16:56:25 2007 +0000
-
- More than five bazillion new specs including a ton for the very evil []= method (letters i through s)
-
-commit b905a952af41a96f72499750c4635b1352b237ba
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 14 23:06:33 2007 +0000
-
- A few more specs.
-
-commit e17aa3690f7dcd2dab346bf7def0dd26b38072f1
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 14 22:16:54 2007 +0000
-
- A bunch of new specs. Includes highly exotic corner cases.
-
-commit 7845d8928d138353ad03bd496d1800c03e82b538
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 14 20:52:23 2007 +0000
-
- Fix cleanup to work with symbolic method names like ==
-
-commit c677ac036baa847cef3de6a34b2b56c9fd09213c
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 14 18:04:43 2007 +0000
-
- Fixed the test for DATA to match MRI (it's only supposed to be defined when the main file contains __END__);
- Added test for TOPLEVEL_BINDING
-
-commit 27b2767cd21b5a69ee10a2a629a68de64fd8ae5a
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 14 18:03:26 2007 +0000
-
- Introducing RUBY_NAME so we can spawn a new Ruby for things that can't be tested otherwise
-
-commit 4c4a96f51b4c06dd6896f996ae0e87a68152a3bc
-Author: Tilman <tilman@unknown>
-Date: Thu Jun 14 15:15:56 2007 +0000
-
- Don't call Time.now multiple times when comparing their values.
-
-commit cde774be8b188f5870b1ee387b5e5fffd9948163
-Author: Tilman <tilman@unknown>
-Date: Thu Jun 14 15:00:17 2007 +0000
-
- Fixed a typo.
-
-commit 6e51eee65c310255183d81d97a98be313ca68afc
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 11 04:07:03 2007 +0000
-
- put guards on imcompatible specs to prevent ruby, jruby from running them. work around for Dir ** globbing being broken.
-
-commit 03dfae6b896a6b67ac6066e94284d992833afac5
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jun 11 02:00:25 2007 +0000
-
- Added rake task spec:ci. added svn:executable for bin/mspec. enhanced readability of system command in mspec. added globbing across directories to mspec command.
-
-commit 96425667fbff044333c13c5a88c3b8cad156504f
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jun 10 21:45:52 2007 +0000
-
- modified mini_rspec to include proper reporters. converted mspec to use ruby to generate a command line to run specs. mspec usage should be similar to spec: mspec spec/core spec/language/class_spec.rb will execute any spec/core/*_spec.rb plus spec/language/class_spec.rb and output a single summary of exceptions, examples, failures.
-
-commit 1075f2cf34a81c00a1b06d2474c78300ae013161
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sun Jun 10 06:59:40 2007 +0000
-
- Cleaned up MatchData, added support for accessing named groups.
-
-commit c678d79f125d67328e267001e5fe353f5ef38a2c
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sat Jun 9 04:20:51 2007 +0000
-
- * =~ for regexps to mini_rspec by dean (Ticket #136)
- * Kernel.caller spec relocation for reliability
-
-commit 00eec364dbf3cef03915a68a359ed06b7e501553
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jun 8 07:10:56 2007 +0000
-
- reintegrated String specs. all specs in core follow the convention that there is one file named <class>_spec.
-
-commit 9f9817bbb9fea5cc02eb280f01eb50e45ea03118
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:49:47 2007 +0000
-
- * String#replace, String#chop! and String#chop behave now as in MRI.
- * Specs
-
-commit 129e492fcacf937473bb1c602176b48a352f8572
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:39:00 2007 +0000
-
- * Fix String#<=> when the given object is not a String.
- * Fix String#to_sym for invalid symbols.
- * String#to_i raises an error when invalid radix is given.
- * More specs.
-
-commit 8d7a9e21874d9e44c63d17dd8f6832b942805707
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:31:25 2007 +0000
-
- * Make String#capitalize!, String#downcase! and String#upcase! check for the 'frozenness' of self
- * Specs
-
-commit 10087a0c92217d1fbadfede9fdb0099c7eb195e6
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:25:08 2007 +0000
-
- * Spec for String#==
-
-commit e51ca54f6f4e9e3dabd48895fa2cb746fb0d3c17
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:23:23 2007 +0000
-
- * Fix String#=~ to work as in MRI.
- * Specs
-
-commit d2c7d6e6bb624c23e994888b6a235022486e0c69
-Author: Arthur <arthur@unknown>
-Date: Thu Jun 7 23:16:35 2007 +0000
-
- * Alias String#size to String#length.
- * String#<< now correctly checks and converts (where applicable) arguments.
- * String#<< raises an error if used on frozen string.
- * Added extended specs for String#<<.
-
-commit c389493556e3394cce846698aa4fc6a67a5f4b40
-Author: Tilman <tilman@unknown>
-Date: Thu Jun 7 18:14:02 2007 +0000
-
- Time#zone_offset and #zone_utc? are also in stdlib already.
-
-commit 7dcd86dca123edaec7edec2853cba2af27ca6d52
-Author: Tilman <tilman@unknown>
-Date: Thu Jun 7 18:07:59 2007 +0000
-
- Moved the specs for Time methods that should be in stdlib rather than in core to spec/lib/time_spec.rb
-
-commit 953dfdfdea395ead465a9e19339d94f8b8c7d684
-Author: Hapk <hapk@unknown>
-Date: Thu Jun 7 17:36:20 2007 +0000
-
- Added more specs for Array#pack: covering %#bB.
-
-commit 7aa84bc102ad6943aed46cbb357f233ac4b6d3f9
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 7 16:47:03 2007 +0000
-
- Make next with arg match MRI; Fixed typos and a copy&paste error
-
-commit 40c354444d6d7a2fd3aeb940c3bdcf6fd2a28940
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 7 16:43:17 2007 +0000
-
- Fixed to run on MRI (uses Object.const_get now)
-
-commit 95dd0ca698d0b1f79a11f4a556c171bea33ba176
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 7 12:52:40 2007 +0000
-
- Make behaviour match MRI, fixed copy&paste errors, did some refactoring
-
-commit 191d4e80406a6e4ffd08594ddeada47fb3219bf0
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 7 01:41:08 2007 +0000
-
- Fix chaos introduced in rev 1283
-
-commit e0f5184493607f7d9c216146207dc298893a744c
-Author: Florian Gross <florgro@gmail.com>
-Date: Thu Jun 7 01:28:55 2007 +0000
-
- Fix Dir.chdir test on OS X (/tmp is symlinked to /private/tmp)
-
-commit a32062d6099556a93afee61f0b0000a28675fbb6
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 21:44:00 2007 +0000
-
- Deleted old specs.
-
-commit de7b3ecaa61c4d3514c8a3534805e9c8d0d1bb2f
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 21:09:48 2007 +0000
-
- Made the Time#to_a spec pass with any time zone, too. MRI passes all the specs for me now.
-
-commit ac1e295da36f23184e583f5e62a4909959550dbd
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 21:06:32 2007 +0000
-
- Fixed specs for Time#localtime, #gmtime and friends.
-
-commit 064a5967f5550cf4a2e10885ab2c9f22afa59da2
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:56:41 2007 +0000
-
- Fixed a few more Time specs. Instead of the imaginary time zone "PDT"
- I'm now using Asia/Kuwait for some specs, because those lucky people
- don't have DST, which means we don't have to flip the spec expectations
- every 6 months.
-
-commit 8f6b6a5a5f8e62631a58061b6cdeeaff5654aeb0
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jun 6 20:41:32 2007 +0000
-
- module_function specs matched to MRI (module_function makes the instance methods private)
-
-commit 8cc656b95cb71ea476e787ce635df889090f8050
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:41:02 2007 +0000
-
- Fixed the Time#year spec. Using CET, too, since specc'ing using 1969 just feels wrong.
-
-commit ed7be9eaa73b8b1d85964f5c8fdfc250e2e8f62f
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:38:43 2007 +0000
-
- Oops, fixed a stupid error in r1281.
-
-commit e81d716092e0c6a8b52775ca2b9e0d44c4e3ef7f
-Author: Florian Gross <florgro@gmail.com>
-Date: Wed Jun 6 20:35:42 2007 +0000
-
- Divmod matched to MRI (Special casing darwin on MRI because it doesn't raise FloatDomainError exceptions in some cases)
-
-commit fc5f461c47b7212f05f8699110e313aeab46d46d
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:35:34 2007 +0000
-
- Fixed the Time#hour, #min and #day specs.
-
-commit 6847a1e49ff4ad4dfe7c6e9e4d7352f92d72b4cd
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:26:26 2007 +0000
-
- Don't call Time#seconds as MRI doesn't have it and it doesn't seem to be needed anyway.
-
-commit b9a6ccc89d46ffa910c9bdc0fece9d013440872d
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:14:15 2007 +0000
-
- Time#asctime needs to use %e to print the day of the month.
-
-commit 7311fdf31481ba7a4373d5b007efb62c1f84c389
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 20:03:30 2007 +0000
-
- Hardcode output for Time.gm(...).inspect. This makes utctime superfluous for now.
-
-commit 229e7eefe7944df92ab2f84e553992fc0c868dbd
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 19:19:38 2007 +0000
-
- Fixed two more Time specs.
-
-commit 7f490d752ed97bfb9b830d24f4e2c2f44107c141
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 18:41:47 2007 +0000
-
- Make sure that with_timezone resets .
-
-commit 9c8d25c4d072510215407209fa52a06b85e95d35
-Author: Tilman <tilman@unknown>
-Date: Wed Jun 6 15:57:32 2007 +0000
-
- Made the wday spec work with any timezone.
-
-commit 4882f8a676d5234339296d6a4489f3a7134cf5fd
-Author: Tilman <tilman@unknown>
-Date: Tue Jun 5 20:08:22 2007 +0000
-
- Fixed a typo.
-
-commit fb63faa2165cafdc7907f173344638609f884833
-Author: Tilman <tilman@unknown>
-Date: Tue Jun 5 20:03:06 2007 +0000
-
- Make sure that a GMT Time object returns true from gmt?
-
-commit deae4911588b555264f529e765dc5baf7a2c6e69
-Author: Tilman <tilman@unknown>
-Date: Tue Jun 5 20:00:45 2007 +0000
-
- Use with_timezone for the gmtoff specs.
-
-commit 625dd8e366f846cf15165e323a719199627ae422
-Author: Tilman <tilman@unknown>
-Date: Tue Jun 5 19:47:29 2007 +0000
-
- Added a helper method to temporarily override the TZ env var and fixed one of the specs by using it.
-
-commit b359eb74d41749919c6177ec2af6b5b516308bd8
-Author: Tilman <tilman@unknown>
-Date: Tue Jun 5 19:33:01 2007 +0000
-
- Provided 'date' calls for coreutils' date program.
- Checking for coreutils using RUBY_PLATFORM isn't the right way,
- but it will do for now.
-
-commit b19c3c8d886885adc08ac69469792b14e47ba265
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Mon Jun 4 23:42:20 2007 +0000
-
- * Improved Array#sort with additional spec by wycats (ticket #135)
-
-commit 8513e72a5af7596c8782ee45dff39607489dbf12
-Author: Tilman <tilman@unknown>
-Date: Mon Jun 4 16:39:53 2007 +0000
-
- Ticket #132: Implemented ENV in core and removed read-only ENV from shotgun.
-
-commit 03d75a78855213f6267fb8f80f9c71d0a031641f
-Author: Mojombo <mojombo@unknown>
-Date: Sun Jun 3 20:49:41 2007 +0000
-
- Implemented most of Time, updated time specs accordingly
-
-commit 36975b1b79abbd38de68223cdc8ecbca9ba0feee
-Author: Bremac <bremac@unknown>
-Date: Sun Jun 3 16:20:59 2007 +0000
-
- Add Functions::abort, Functions::printf, and Functions::sprintf, and minimal specs. Closes ticket 87.
-
-commit 9d25d95a4aa3fd22d3f3a340427d40410488a770
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sun Jun 3 12:41:49 2007 +0000
-
- * Lots of new assignment specs by crafterm (Marcus Crafter) (Ticket #133)
- * MatchData#inspect and #to_s now indicate it is an MD object
- * -dc notes which file/method is being compiled
-
-commit ec0fb5beed68155c9e1ff67185cc2c8e4e474c04
-Author: Arthur <arthur@unknown>
-Date: Fri Jun 1 22:23:39 2007 +0000
-
- * Fix String#[] and add some edge cases to the specs
-
-commit 068b48538ec574558ab787d59b14ebd2925f1126
-Author: Tilman <tilman@unknown>
-Date: Fri Jun 1 18:12:10 2007 +0000
-
- Renamed module 'B' to something more meaningful to avoid name clashes.
-
-commit eb3de8af03d070b03216daa4fc0c2216d9d3e2a2
-Author: Arthur <arthur@unknown>
-Date: Fri Jun 1 18:09:52 2007 +0000
-
- * Extend String#slice! specs
-
-commit db4775403d57ea29165165b9cbf0110739d91e2a
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Jun 1 02:26:30 2007 +0000
-
- * Ticket #128 - Patch by Marcus Crafter to enhance assignment specs
-
-commit 6098aa16357ce4261feb51bdf083c02442b1f074
-Author: Tilman <tilman@unknown>
-Date: Thu May 31 19:05:45 2007 +0000
-
- Implemented rb_obj_alloc() and friends in subtend.
- The spec for rb_class_new_instance() is still failing because of strange
- subtend behavior.
-
-commit ae2c3cb4502ba9475111eeef10b2b70780a1b9f4
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu May 31 13:54:24 2007 +0000
-
- * Fixed shotgun compile failure (possibly r1204)
- * Various casts to avoid warnings
-
-commit d317d336412d0c1778d4c015dfe96287c44e1bd9
-Author: Hapk <hapk@unknown>
-Date: Thu May 31 11:12:02 2007 +0000
-
- Added specs for "break", "next" and "redo" keywords.
-
-commit a33f801f8f142d997a553e41cde9f5b10d75ee65
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu May 31 04:23:33 2007 +0000
-
- * Kernel.caller spec by jtoy (Ticket #112)
- (kernel_spec is badly broken still)
-
-commit ce15eb69e721820e75b0f7aeae6488701cbe9555
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu May 31 03:55:27 2007 +0000
-
- * Fixed String#dump spec expectation (Ticket #105)
- * Moved RUBY_ENGINE to rubinius-specific variables_spec (Ticket #109)
-
-commit 7d2c575164dfbbd436d7c6ff400c088a68b29fa8
-Author: Hapk <hapk@unknown>
-Date: Thu May 31 00:42:50 2007 +0000
-
- Added "if" specs for variable scoping.
-
-commit ceb4430f9c713f409f2567a0aa324f19afb09b79
-Author: Hapk <hapk@unknown>
-Date: Thu May 31 00:35:49 2007 +0000
-
- Added specs for while / until condition/block evaluation order.
- Added specs for next and redo statements.
-
-commit 4adeecf9333236800396bd77f928fb902e785692
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 30 22:17:04 2007 +0000
-
- * Fixes to RSpec cleanliness of specs, most patches by zimbatm.
- (Tickets #97 #98 #100 #103, partially #99)
-
-commit bbb0714b6ae60adb0af7445ed56544ceec3bc890
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 30 21:41:03 2007 +0000
-
- * Array specs are RSpec/MRI-clean and pass (Ticket #95)
- * Fix to should_raise for MRI by zimbatm
-
-commit d627ab36d3839745e057d9f5de781269ba7b154a
-Author: Hapk <hapk@unknown>
-Date: Wed May 30 21:15:39 2007 +0000
-
- Added specs for 'while' and 'until' statements.
-
-commit 8a2177c7f23181909c5dcb51dd6df1e5b930fdbe
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 30 20:32:13 2007 +0000
-
- * Enhanced hatefulness of 'for' specs
-
-commit 9f64f2a1c584420fcabfc73a7c464aa3b1ba2e90
-Author: Hapk <hapk@unknown>
-Date: Wed May 30 19:46:57 2007 +0000
-
- Added specs for postfix "if" form.
-
-commit 9dd8a846adf356d75ceac566612f35d1d30840bf
-Author: Hapk <hapk@unknown>
-Date: Wed May 30 19:34:50 2007 +0000
-
- Moved loop specs from spec/language/expressions into spec/core/kernel_spec.rb.
- Added more specs for Kernel#loop.
-
-commit ddf2e3169c3a8b587f9abfb0ddf196635aec5186
-Author: Hapk <hapk@unknown>
-Date: Wed May 30 18:57:38 2007 +0000
-
- Removed obsolete "elsif" statement spec.
-
-commit 3b6dca92ea810aa7866a2c7aa0b8812e72b6630e
-Author: Hapk <hapk@unknown>
-Date: Wed May 30 18:56:00 2007 +0000
-
- Updated specs for "if" statement to cover more cases.
-
-commit 678f609bfe826538ec16e75f7362bcb3f50c8d6d
-Author: Arthur <arthur@unknown>
-Date: Wed May 30 17:09:09 2007 +0000
-
- * Extend Specs for expressions
- * Break the Specs up
-
-commit df60cc21e4213ac8344b5ed91e802d8cbbfa47a0
-Author: Tilman <tilman@unknown>
-Date: Wed May 30 17:00:17 2007 +0000
-
- Implemented rb_ary_store() in subtend. The last spec still fails, but we'll fix that later.
-
-commit 8e0fea820c1683913625dfe95c7d3210d4548814
-Author: Arthur <arthur@unknown>
-Date: Wed May 30 10:09:55 2007 +0000
-
- * Extend Specs for Class Definitions (nested class definitions, class definitions that extend objects, Multiple Definitions of the same class).
- * Lots of them are failing in rbx.
-
-commit ce16f2b568ea89cb5f13660d3175165b105e4233
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 30 01:18:39 2007 +0000
-
- * OK, that should really be in 'rubinius', not 'incompatible'
-
-commit 888b777539baa116eedc14191ac85d57aec54349
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 30 01:15:37 2007 +0000
-
- * 'Options' is a Rubinius-only class, and should therefore be in 'incompatible'. Closes ticket #102
-
-commit 46a58344fa2f03fb4154b78f34239a815b2d9944
-Author: Bremac <bremac@unknown>
-Date: Tue May 29 23:52:52 2007 +0000
-
- Fix typos in specc'ing module_function, and make that spec play nicer with MRI.
-
-commit e0cedb691f76af4554bfc7522a7668ff861492f0
-Author: Bremac <bremac@unknown>
-Date: Tue May 29 20:49:42 2007 +0000
-
- More complete raise implementation and specs: Handle instantiation.
-
-commit 9f3a3bfe9d2610dd7e9e752c86a1b8aba47f7fdf
-Author: Hapk <hapk@unknown>
-Date: Tue May 29 20:39:07 2007 +0000
-
- Added 'case' spec for case with empty 'else' body.
-
-commit 8f888bd3d0a01afc945c45c0502a0b97f3227c48
-Author: Arthur <arthur@unknown>
-Date: Tue May 29 20:34:18 2007 +0000
-
- Extend Class specs. Some specs failing in rbx.
-
-commit f52d9faadc1eac31e7b92c1edb1cf45ca1d42c89
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 20:29:53 2007 +0000
-
- Implemented rb_str_new2() in subtend.
-
-commit d4d5e3d1eb8e5ee44acff6697a29a37b9eca25b2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 29 20:00:51 2007 +0000
-
- * Patch by HaPK - Add specs for 'case', and enhance specs for 'for'
-
-commit f3e736731e852dacbf90e8e3e33d840384909354
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:56:41 2007 +0000
-
- Actually exercise rb_ary_unshift() in the spec.
-
-commit 69d756ae17fce1fb53be5e7a1b5b7169b69c4aa2
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:55:32 2007 +0000
-
- Implemented rb_ary_shift() in subtend.
-
-commit 9f84a5ecddae6c0daf1fd7e46815275c7d7429db
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Tue May 29 18:50:41 2007 +0000
-
- * Fix to Array#to_a for subclasses
-
-commit 2bbc87fc1b5261b57927a02f75915829b398b478
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:50:33 2007 +0000
-
- Implemented rb_ary_unshift() in subtend.
-
-commit 4e69b95ad7991a57fd3f9b7cbf350cb5b13c6a5c
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:46:53 2007 +0000
-
- Implemented rb_ary_dup() in subtend.
-
-commit 122a9cfbe79e872146116c8e045a243fffd333e6
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:31:48 2007 +0000
-
- Marked SubtendArray method functions as static.
-
-commit 0e3319c07aa1d536343343fbbe1004c4cdce2df0
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 18:28:05 2007 +0000
-
- Implemented rb_ary_clear() in subtend.
-
-commit 621f0082fca85140791e2c40aabc8ad3fe3318a6
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 17:58:31 2007 +0000
-
- Implemented rb_ary_entry() in subtend.
-
-commit 9c7d05c0bb19e65f57fc6aab778785e2a727c4a4
-Author: Tilman <tilman@unknown>
-Date: Tue May 29 17:42:40 2007 +0000
-
- Ticket #91: Made spec/subtend/rake_helper.rb more portable.
-
-commit 5dba201079bdf8da63364ea760342f3cef85df74
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 29 15:56:01 2007 +0000
-
- * Add specs for Array#pack, patch by HaPK
-
-commit 2d71e18c6f08144d4fb402904a9226a8500343bd
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 29 15:28:45 2007 +0000
-
- * Better fix to method argument scoping, to support: def foo(a, b=a.length)
-
-commit f9deebb38b80cdea3dff44d7461404e5f501f566
-Author: Defunkt <defunkt@unknown>
-Date: Tue May 29 09:59:00 2007 +0000
-
- * Add spec for Struct subclasses. Closes ticket #110
- * Add failing specs for Class.new. Closes tickets #89 and #94
-
-commit 3be02f950f32a288fac1cd5cff0ae014057c96fb
-Author: Defunkt <defunkt@unknown>
-Date: Tue May 29 09:12:00 2007 +0000
-
- * Add should_include convenience method to make rspec more compatible with mspec. Closes ticket #106
-
-commit 68e716e1874e7dd4186c7eef2aea5e25157a44fd
-Author: Vagabond <vagabond@unknown>
-Date: Tue May 29 03:46:33 2007 +0000
-
- * Add HaPk's fix to Numeric#== to handle failed coersion with corresponding specs
- * Removed duplicate definition of Numeric#==
-
-commit a63e6fcb08e34c625957d8d23bbe602964863c5b
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 29 02:59:43 2007 +0000
-
- * Add Kernel#eval. Probably lacks some crazy MRI semantics at the moment
- * Method definitions should properly create a clean scope for locals
- * Support wacky default arguments, such as blah = lambda {|z| z.foo(another_arg) }
- * Optional label prefixes in assembly output, for easier debugging
-
-commit f1295ac58d2b601f539efe0e660dfed9d043d1d7
-Author: Vagabond <vagabond@unknown>
-Date: Tue May 29 01:39:46 2007 +0000
-
- Change Time specs to use ENV['TZ'] instead of `date` in hopes of being more portable
-
-commit 404faeca93c007f3eb9b3df52c2bde7673565113
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Mon May 28 19:20:27 2007 +0000
-
- * Fix some mistakes in method_spec that caused it not to pass under MRI
-
-commit d336078c02e1306acb4b2664a427b63e93b02788
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun May 27 06:03:25 2007 +0000
-
- * Fix local scoping to allow for method definitions on local variables
- * Pass all the horrible method definition specs
-
-commit 7759a0f91f794d05a32d48dd2e67d05c0b1dace7
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sun May 27 05:03:53 2007 +0000
-
- * Rename Thread.yield to Thread.pass
- * Implementation of 'module_function' by bremac, with minor tweaks
-
-commit 55f30c5e59d16ebbf045be93a7d406fed9a4dcbd
-Author: Vagabond <vagabond@unknown>
-Date: Sun May 27 00:34:44 2007 +0000
-
- Added defunkt's implementation of Module#const_set and const_get and associated specs (Ticket #72)
-
-commit 9cebe0c56fda41b83ab14d39275e327daf0bdcc9
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sun May 27 00:31:47 2007 +0000
-
- * Fixes to mini_mock by bremac (Tickets #85 and #86)
-
-commit f33756f22597bd280e453d5c7ad97685fa284579
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sun May 27 00:24:51 2007 +0000
-
- * Fix typos in splat_spec (Ticket #77) by tilman
-
-commit ea13a828e5fc19694fc24da25b2224a75462a88c
-Author: Vagabond <vagabond@unknown>
-Date: Sun May 27 00:11:58 2007 +0000
-
- Add Chris Wanstrath's (defunkt) Struct patches. Tested working against MRI.
-
-commit 3ca0ddcc2c39fec74f10b75df2af5c1581b9eaa3
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sat May 26 23:56:26 2007 +0000
-
- * Array fixes. Only spec failure remaining is #pack
-
-commit 4d91aa707a47189398455eb1c40b341dc3766ccf
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sat May 26 20:05:13 2007 +0000
-
- * Array fixes to pass specs (including HaPK's code).
- All remaining failing Array specs except #pack are
- not Array bugs. Test this heavily.
-
-commit 6793b34a54ab8e24e8a66a8af026a34315ac9f5b
-Author: Vagabond <vagabond@unknown>
-Date: Sat May 26 07:34:12 2007 +0000
-
- Add cdcarter's Enumerator implementation and specs translated from his test/unit tests
-
-commit fd10c39192825aeef68c8843c2813cf50b8137f2
-Author: Vagabond <vagabond@unknown>
-Date: Fri May 25 20:12:22 2007 +0000
-
- Some fixes to rand with associated specs
-
-commit 60d37d28b715854f5186598c90101824665ce715
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri May 25 19:43:11 2007 +0000
-
- * Properly normalize default method arguments, to support: def(x, y=puts('hi'))
- * Fix 'for' loops so that they use 'create_block' in the proper way
- * Move all 'for' processing out of compiler.rb
-
-commit 3c04a44e8ff9e84f48fbd2d3afabb886494b5a98
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri May 25 06:35:48 2007 +0000
-
- * Patch by HaPK - Fixes String#dump / inspect / upto
-
-commit 9e2442110ec33ff9ca4875407b227f2cf79a606a
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri May 25 05:36:31 2007 +0000
-
- * Use a random pivot point for better worst-case Array#sort performance
- * Add 'rake pristine' task to kill all .rbc files
- * More tricky specs for splats and multiple-assignments
-
-commit 7bea77d8d3e8f190dba4f34fead888551fd07730
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu May 24 23:50:06 2007 +0000
-
- * HaPK's patch to String#<=>, along with its specs
-
-commit 0e6007e7eb9eee5e3ab1acdf55da00f4ab8c4be0
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu May 24 23:29:49 2007 +0000
-
- * Add spec for masgn semantics
- * Fix numerous multiple assignment bugs
-
-commit 6d68d22efd7d2dba75c77cf957edb28dca6df6ef
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu May 24 07:05:00 2007 +0000
-
- * New Array#sort implementation, fixes several Array and Hash specs
- * Add a warning comment to bytearray.rb about some incorrect <=> behavior
- * Prevent unimplemented Array specs from crashing the spec run
-
-commit 0ca089c7354ec96103cb637f861751ca7df01136
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Thu May 24 01:15:40 2007 +0000
-
- * Support all kinda crazy splat syntax
- * Updated some compiler specs, though some TODOs remain
- * Added a comment above unshift_tuple, since it really shifts
-
-commit bbe0b73b07a393f94724964941d2fdd717a2d72e
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 23 19:58:10 2007 +0000
-
- * Add compiler support for: yield(*args)
- * Update some compiler specs to match recent fixes
-
-commit 32a7082205d3d214ad43a477286270a96076b140
-Author: Kev <kev@unknown>
-Date: Wed May 23 17:32:06 2007 +0000
-
- Make spec titles consistent (describing C api behavior)
-
-commit 699c66f8c8304522fbb3589356fe2bcd298277c8
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 23 06:56:25 2007 +0000
-
- * Use yield instead of &prc.call when initializing a thread.
- * Fixes VM crash / closes ticket #68
- * TODO - Why the HELL does this fix it?
-
-commit f8b6e1ff9e19e786b08fee30988eb874eae748b5
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 23 03:18:26 2007 +0000
-
- * Implement Thread.main
- * Prevent Object#inspect from crashing the VM when the inspected object has itself as one of its instance variables
-
-commit f24f573608ee5569b29754a017769db0f866cf4c
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 22 22:35:14 2007 +0000
-
- * Implement 'class_variables' method
- * instance_variables and class_variables now accept an optional argument, causing them to return symbols instead of strings
- * Support defined?(@@class_var)
- * Support defined?(a_vcall)
- * Fix false-positives in defined_spec.rb
-
-commit da540b51c47b2349b0ab8d4ca0bd11124138f9ce
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 22 20:52:30 2007 +0000
-
- * Add compiler support for begin/rescue/else/end syntax
- * Default rescue clause should be StandardError, not RuntimeError
- * Add specs for 'else' and empty begin sections
- * All Exception specs now pass
-
-commit 82abf73fd99ec45f7cb6d98d19b219a61af59a61
-Author: Vagabond <vagabond@unknown>
-Date: Tue May 22 18:39:59 2007 +0000
-
- * Fix Object#instance_eval to bring it into line with the specs and MRI
- * Fix Object#instance_variable_validate to not accept fixnums as instance variable names
- * Add another Object#send spec that tests exception raising for missing singleton method names
-
-commit 3b624f3f49c0433289224baf656b3d7be78cecd8
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue May 22 08:15:48 2007 +0000
-
- Fix the block arg scoping problem, also add a missing file from the compiler specs.
-
-commit 59af7028c060c8e3f9b9c107fb750a71dd37a1d6
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Tue May 22 07:14:54 2007 +0000
-
- A bunch of yummy-ness. Local variables now conform to the 'standard' behavior, ie they're allocated at different depths inside blocks (this is the yarv/jruby behavior).
-
- Cleaned up a couple of subtend things.
-
-commit f8ed63efac6fa661dd39db2c207b66c34d132546
-Author: Vagabond <vagabond@unknown>
-Date: Tue May 22 03:28:17 2007 +0000
-
- Add specs for Object #method, #respond_to? and #__send__. These currently fail with singleton methods on rubinius.
-
-commit 0d6e6b7109014c97d8f8be136166b3279d5a1108
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 22 02:06:19 2007 +0000
-
- * Handle 'call' nodes containing newlines, e.g. x = [5,6,7,8];p Hash[*x]
- * This is probably the wrong implementation, but it does work
-
-commit 518f7d34112e536d726cecfb2473c7b3db9ec33e
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 22 00:52:01 2007 +0000
-
- * Fix mini_mock's cleanup process
- * Add the ParseTree sexp test cases as specs. Currently in serious need of auditing
-
-commit 17ad76c162ff0cfe9662c20d418f455581389b42
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon May 21 21:50:13 2007 +0000
-
- Add a failing spec
-
-commit 1744773b7f57c766c75d188b04e55540d45e19d0
-Author: Vagabond <vagabond@unknown>
-Date: Mon May 21 20:22:04 2007 +0000
-
- Do some env trickery to make Kernel#at_exit testable
- Improve implementation and specs for Kernel#warn
-
-commit 45733aa44e8daee9e8c5e552ac9312f21163fe39
-Author: Vagabond <vagabond@unknown>
-Date: Mon May 21 20:16:18 2007 +0000
-
- Convert time specs to compare against output of the date command
- Change Time#inspect to use %z (GMT offset) instead of %Z (timezone)
-
-commit e58ef35a05d2a565befeaf3600bc00f21203a84c
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon May 21 20:12:34 2007 +0000
-
- Add spec for breakage caused by 1089.
-
-commit a5d54efe9a45f3acc1cdb0183a8c13ce6ed5e327
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Mon May 21 04:57:41 2007 +0000
-
- * Options implements a minimal lightweight option parser
-
-commit b28b77af82d99a7a3ec5a78f6ab8b4e138ac577b
-Author: Kev <kev@unknown>
-Date: Mon May 21 03:54:33 2007 +0000
-
- Add missing hash spec
-
-commit 81496352bdc2b6b27e293b7542908c6be54b9b6b
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon May 21 02:08:57 2007 +0000
-
- added specs from ticket #38 (David Anderson), but not patch because implementation was invalid (e.g. [].first(0) => [] not nil) and superceded by recent patches. fixed Array#[i,0] => [] exposed by the added specs.
-
-commit 4ed6afc81262a4197f1ddc646ada94277cd9abe6
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon May 21 01:07:36 2007 +0000
-
- HaPK's patch to Array#[] with specs. Knocks 14 failures down to 6. Ticket #60.
-
-commit b267aee1c10b6092d954c72d5776f4eafc109e51
-Author: Kev <kev@unknown>
-Date: Sun May 20 21:09:49 2007 +0000
-
- rb_raise, rb_const_get, exception definitions. Wooooo exceptions from C
-
-commit 37793ed650e6ce7352a7547cf4bc68f2ceb2f0b4
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat May 19 08:42:23 2007 +0000
-
- * Added nastier multiple-assignment-with-splat specs
-
-commit 39c9817fa1932f9fe708a8ba78f43cb39e7cb68b
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat May 19 08:30:06 2007 +0000
-
- twifkak's Kernel.fail patch with slightly modified specs.
-
-commit 264a42e8c11d08afa895b415453d59e1e1efe2e1
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Sat May 19 08:01:47 2007 +0000
-
- * Remove a misleading comment in exception_spec
- * Pre-compile bin/*.rb after a make install
-
-commit 7608e585e02283677275aaf5e5283e397ed2d671
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri May 18 23:57:09 2007 +0000
-
- Vagabond's Kernel.warn.
-
-commit 9a41c5a21bbc822ff9ff758eb2962ba80e2d454b
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri May 18 18:52:36 2007 +0000
-
- * Re-enable tr and unpack String specs
- * Change 'Nan' to 'nan' in Sprintf to match MRI
-
-commit fdc7032c6e4823727312cc7e5c33386cf9d91429
-Author: Mental <mental@unknown>
-Date: Fri May 18 06:01:20 2007 +0000
-
- add spec for ensure result elision
-
-commit 37438dc826624c3fee3afc1d30a9f661bbb1ab8d
-Author: Mental <mental@unknown>
-Date: Fri May 18 05:45:28 2007 +0000
-
- basic thread spec
-
-commit d89b7728d148ba8c1ddd74323aa8f9e3dae79691
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri May 18 02:37:55 2007 +0000
-
- * Fix 'should_raise' in mspec and rspec helpers
- * Added some new Module specs, and fixed existing failures
-
-commit f63e0cf797158a239f65714918debf7a6c1bb687
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu May 17 04:12:58 2007 +0000
-
- * First draft of a mock lib for mini_rspec
-
-commit c7fd82a8b4b84088de45463dbc25ae7eea5aabe2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 16 22:38:27 2007 +0000
-
- * at_exit handlers should run in reverse order of registration
-
-commit 2fb5c6e46f1682d927be8a9e116a609c75ec8be5
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 16 22:14:21 2007 +0000
-
- * Fix Kernel.Array(). All core/kernel specs pass now
- * Add Kernel#at_exit specs
- * Fix Kernel#`
- * Move AtExit handler array from Ruby namespace to Rubinius
- * It's spelled 'occurred', not 'occured'
-
-commit 3d1605a3ca731b05b5c03ebd8a6edcf386612930
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed May 16 06:04:16 2007 +0000
-
- added incompatible specs for #instance_methods returning symbols.
-
-commit 8ba8409ae0ab94a33cd082f02a81d4d1eab35b59
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 16 04:27:22 2007 +0000
-
- * Patch by shadowfiend - Enhance Module specs and implement Module#instance_methods
- * Make sure instance_methods always returns symbols, not strings
-
-commit 1e9b0066d712d4507260be02cf2bf116b2519af2
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed May 16 03:24:35 2007 +0000
-
- * MethodTable 'is a' Hash, and does not need its own fields in the bootstrap. Fixes 'Object.methods.keys'
-
-commit 8c57dd0e26cb5468c1b0150c5d9c5d80ae6f2de2
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon May 14 06:18:42 2007 +0000
-
- fixed class specs to pass on MRI. put rbx-specific integer specs in spec/rubinius.
-
-commit 8b43acd25a14f540447a9f958f7671822f836817
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon May 14 05:59:06 2007 +0000
-
- moved rbx-specific proc specs to a new home. made core proc_specs pass MRI.
-
-commit 4feb384d0a02b272bd1a3581dd4070ef475b25af
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon May 14 02:59:22 2007 +0000
-
- added RUBY_ENGINE == 'rbx' to global constants and exposed Rubinius::<const> on Object like MRI. converted sprintf specs.
-
-commit 34ad791d5f60177de7992a24f07992bb0d6c8b09
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Mon May 14 02:25:06 2007 +0000
-
- * Disabled Lightning's dissembler on amd64
- * Split specrunner into bin/mspec and a wrapper
-
-commit 8796b1f00501813c62676266508a6f89a82ec48e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 13 22:47:28 2007 +0000
-
- minor reorganization, cleanup of spec dir.
-
-commit 9be73815e2037dcc5347c2ef9876e76316efc504
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 13 22:06:54 2007 +0000
-
- specrunner outputs summary with 'examples'. converted language/literals, keywords, straggler method_spec.
-
-commit 647fe38ce5f132b7944cca8550233249d8b3c113
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 13 21:21:04 2007 +0000
-
- converted language, parser, library specs.
-
-commit d9e8f1fd3bc70231c89a1bdc17a9af5a46fce819
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 13 08:28:21 2007 +0000
-
- converted incompatible specs.
-
-commit 9a07bb52c526ce8883c53d437077d78510b0ac73
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 13 08:09:34 2007 +0000
-
- added Object#coerce_string that should act like 1.8.x StringValue function. added String#crypt and a couple other String things.
-
-commit 2bae9b5e3baa33da21c1335e84c2eab062eac3a4
-Author: Kev <kev@unknown>
-Date: Sun May 13 06:21:06 2007 +0000
-
- add rb_hash_delete
-
-commit 0ca1a5baa94b5984b0812365a408688420168d24
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Sun May 13 05:31:24 2007 +0000
-
- Imported GNU Lightning. subtend's rb_define_method_ now generates stub's to pop the args and call the function. Next step, add type conversion to call functions that don't take handles.
-
-commit 141e795d5042cb4ea398c9b8eaa9cd7045f5625e
-Author: Kev <kev@unknown>
-Date: Sun May 13 05:15:33 2007 +0000
-
- Add rb_hash_aset
-
-commit 0988a253d8e23b400a738ad74637e8b3655eae8c
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat May 12 19:40:35 2007 +0000
-
- new .rba's with rue's changes. converted spec/shotgun specs. added specs for Tuple. added aliases size, length for Tuple#fields.
-
-commit abd44484b4b2a28a4c7f0bf7acdf12ff30123729
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sat May 12 19:32:06 2007 +0000
-
- * Fixed class variables, should work everywhere now
- * Specs for cvar behaviour
-
-commit 8ec7dac58577cea314ff0fcd976219b23591bc4d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat May 12 07:40:42 2007 +0000
-
- reimplemented Object#instance_variable_get|set and #instance_variables. now works with immediate values, and classes with no __ivars__.
-
-commit 30c4dd441243277ec5b814ad9b4d4697e87641d0
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri May 11 07:56:14 2007 +0000
-
- added primitives for instance_variable_get|set so that methods operate identically on objects that do not have an __ivars__ field (e.g. Array, String). this needs more work because an exception occurs when attempting to set|get instance vars on an immediate value.
-
-commit 998a0ab62542f36f9e36bdd497116349421951ce
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 9 23:07:35 2007 +0000
-
- * Converted rest of spec/core/
- * mini_rspec/specrunner improvements
-
-commit 0cac71dd1e4dbb728bd3401e73fda5b3fbe95e38
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed May 9 08:18:59 2007 +0000
-
- updated expectations to be the actual compiler output. these specs should be carefully reviewed.
-
-commit 8d551887fd1fabc7700f9f0a432b728829dcef96
-Author: Kev <kev@unknown>
-Date: Wed May 9 07:42:15 2007 +0000
-
- Pull out bundle that got caught in the commit
-
-commit 736916decc6d9bfd7096079a0118f41a168d735d
-Author: Kev <kev@unknown>
-Date: Wed May 9 07:41:42 2007 +0000
-
- Add hash specs, and impl of rb_hash_new
-
-commit 2352f0a526be0f277f2e5d60f18acddc216045c1
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed May 9 07:06:45 2007 +0000
-
- converted test/bytecode/test_compiler to specs.
-
-commit 1f1d30f9ca690214a61f299a4bb408c2d28ef004
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 9 06:08:41 2007 +0000
-
- * Converted MatchData specs
- * Default warnings for empty spec files
- * Improved specrunner
-
-commit 04c03e648ca83de2c2aee37f9aef9079d0493bd7
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Tue May 8 06:24:48 2007 +0000
-
- * Converted Integer and Kernel specs
-
-commit a202ef1dfb21cebf3ee33376775d86b9dc89269d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue May 8 05:45:33 2007 +0000
-
- added before, after methods to mini_rspec. started adding compiler specs as conversion from test/bytecode/test_compiler. removed all host/target junk. thanks. bye.
-
-commit 692da2d89089bc94c95915c90da756480a057dc1
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue May 8 03:36:51 2007 +0000
-
- converted object specs. these really blow up rubinius.
-
-commit 714f5df86f583158d73eda366e2f2527156c3b8e
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Mon May 7 17:29:56 2007 +0000
-
- The first compiler spec, testing the masgn assembly. Some are commented out because they don't yet work.
-
-commit 8ccfe13ca0eca4ceae6a201905a64666a75dd6ba
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Mon May 7 05:52:41 2007 +0000
-
- * Converted and reviewed Hash specs
- * specrunner reports specifications and failures
-
-commit aa32b8e94de5c1ccd49a9d6ddca5836d6303c460
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun May 6 06:50:52 2007 +0000
-
- finished converting fixnum specs.
-
-commit 7c55264dc15ed2b8a1b341a5d605701c6626ad34
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Sat May 5 06:22:37 2007 +0000
-
- * Converted Enumerable specs
-
-commit 1c660edd87fa91d8c244289b00eb9252d5654c3d
-Author: Evan Phoenix <evan@fallingsnow.net>
-Date: Fri May 4 23:45:08 2007 +0000
-
- Fix array_append as well as the logic to call the extension function so the arguments are correct.
-
-commit 6b9c27b8f8d12be443d37635e17b23b7f0d76388
-Author: Kev <kev@unknown>
-Date: Fri May 4 07:54:10 2007 +0000
-
- Complete rspec coverage of subtend string compat to date.
-
-commit 32db2e9a157cee24ae883b7b8fd563d98fc2dce5
-Author: Kev <kev@unknown>
-Date: Fri May 4 07:11:21 2007 +0000
-
- Add loading of C extensions via require.
- Stop grammar.c from generating every fricking time
- Cleanup formatting on subtend
- Add proper minispec tests for subtend
- Remove old subtend test extension
-
-commit 851fbe6e587596fd074b4c99e42c43865118ae00
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri May 4 06:58:35 2007 +0000
-
- converted (but not to the new new style) fixnum specs. fixed mini_rspec to rescue backtrace.show on MRI.
-
-commit 3e8deacb57ef80684281b1329778bc52681a8601
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri May 4 06:22:53 2007 +0000
-
- converted module specs. added incompatible spec for const_defined?(Some::Class). made mini_rspec print backtrace on error.
-
-commit 3c1cc4ff4f6bf4fa28f65d9909a74f77f6524aa8
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri May 4 05:45:50 2007 +0000
-
- converted math and exception. added two helper methods: should_be_close, should_include. I think spec_translator should handle converting these to 0.9.x syntax as soon as rspec runs.
-
-commit 28e3cdba63f2853b9e9a084f27ad764437830799
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu May 3 15:26:39 2007 +0000
-
- converted float specs. added ignore for *.rbc on externals/rspec-0.9.1.
-
-commit 69ea5db15fb0562d8a4114d4e8ec54f2e19ad8fd
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu May 3 06:40:17 2007 +0000
-
- converted range, nil, regexp specs. added ignore *.rbc on rspec dirs.
-
-commit 6cc364770406e4e04ef7baf2fdaab7425a7f5a6c
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu May 3 03:27:04 2007 +0000
-
- * Converted Dir specs
-
-commit 5e39be7f97d5cd131b0cf564746d881245030f7d
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu May 3 03:04:24 2007 +0000
-
- okay, rue insists that we use describe ... it now. (see spec_translator with rspec 0.9.1).
-
-commit 99f05b9d6572600ed0bf6a732048c1c4a2d2bb0b
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu May 3 03:00:06 2007 +0000
-
- converted bignum specs. 100% pass on MRI.
-
-commit f9e4df4bdb721eb32c4ac7e5abd4a646daaf20d2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu May 3 00:06:19 2007 +0000
-
- fixed mini_rspec aliases for specify, etc. to work around exception: No method 'alias_method' on an instance of Object. (NoMethodError)
-
-commit 89d3ca0681816afd389907cbb52f7e0372dbecef
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 2 07:13:56 2007 +0000
-
- * Converted spec/core/ binding, class and continuation
-
-commit 086f889a9bae2e40dd6a8b1ffa80113070f3ad46
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed May 2 04:22:12 2007 +0000
-
- * bin/specrunner is a small bash kludge for running mini_rspec over
- a directory (recursively) or a single file
- * Rakefile allows diffing a current spec run against a base run to
- easily see all changes among the thousands of specs as well as
- storing a base run
- * specrunner produces decent output for the minimal spec output
- from mini_rspec
-
-commit ba89b2c015d2754b6470b324a013f018d8202cfe
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Tue May 1 22:57:22 2007 +0000
-
- * Converted spec/core/array_spec.rb to mini_rspec
- * Reviewed and fixed some specs for Array
- * Spec-style output to mini_rspec (manual comment/uncomment to switch)
- * should_raise for slightly more natural exception verification
-
-commit 0330bcc23fa1609db291cd382cb13fc168ec5bf3
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Tue May 1 22:44:40 2007 +0000
-
- * Implement correct behavior for String#split when called with a zero-width Regexp
-
-commit c8e806e2dafd237fa8117ead21553a195900613e
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue May 1 02:29:35 2007 +0000
-
- converted symbol_spec. 100% pass.
-
-commit 76e31065df70ebc5790fdb604f1b07d28ffaa81c
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue May 1 02:19:33 2007 +0000
-
- commented out specs that cause rubinius to hang. String#delete and #tr (and methods that are implemented in terms of these).
-
-commit 2ae8aea13161a71c3fb4ca8e0486acd55c897579
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue May 1 01:17:14 2007 +0000
-
- converted core/string_spec to regular syntax. added mspec_helper.
-
-commit ff84053991295b259ca8b1c17adff95f5d471961
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Apr 30 22:31:26 2007 +0000
-
- converted false_spec. added svn:ignore *.rbc on all spec dirs.
-
-commit 3fc864ba235c56118e1db66dbf9537d6ff8c0c5f
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Apr 30 22:00:12 2007 +0000
-
- Let the breakage begin. Converting all specs to use mini_rspec with 100% compatible syntax with rspec proper. usage: 'USE_RSPEC=1 spec spec/core/false_spec.rb' for any specs that use example {} method. spec spec/core/true_spec.rb OR ./shotgun/rubinius spec/core/true_spec.rb for converted specs.
-
-commit 4c6c7f406d0e5504a72c52b1ae5339a9dba36865
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Apr 29 17:28:11 2007 +0000
-
- added setup method and print to STDERR and STDOUT to support a shell script runner.
-
-commit 958a0e9b1a066cf2d825b960b66788b05c928f36
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Apr 29 08:26:09 2007 +0000
-
- mini rspec implementation. example {} method is dead.
-
-commit a323b3d424f226322cf20e65e87f8a4e962ed497
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Apr 29 03:23:17 2007 +0000
-
- Added Array#first, Array#last that take numeric args to core. Added a bunch of failing specs for Array#[]. #first and #last are implemented using #[] so several of the specs for those fail, but the implementation of #first and #last was tested in MRI.
-
-commit 3897c943069582b1e5d1649a097bd77c0c895e0a
-Author: Hurdlea <hurdlea@unknown>
-Date: Thu Mar 29 13:51:13 2007 +0000
-
- * Support for Floats in Sprintf
- - Sprintf is still missing support for unsigned twos complement
- * String#% now implemented
- * Fixed a minor issue in the Rakefile
-
-commit 5ed87ff88793f8d44cfe34b443eb032d27dc2a4c
-Author: Hurdlea <hurdlea@unknown>
-Date: Thu Mar 15 05:08:34 2007 +0000
-
- * Added Sprintf core module and classes for string % and Kernel
- - Still needs some work with floats and requires a couple of
- primitives to achieve this.
- * Fixed a small issue with String#Index(Fixnum, offset)
-
-commit 982c09b15710429fc97d8d43d9f24a3a0badb6d5
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Mar 10 22:35:18 2007 +0000
-
- Fixed array spec for #sort which improperly depended on the accidental order in which two elements of the array were being compared.
-
-commit 32fe004da7f35e9b7dcc96f8e57e1acb37164748
-Author: Hornbeck <hornbeck@unknown>
-Date: Sat Mar 10 06:38:23 2007 +0000
-
- Two tests in the ObjectSpace spec. It was bare and needed love.
-
-commit e1530bb1999118bf88037dccc27d78f54bdbe5e4
-Author: Tlockney <tlockney@unknown>
-Date: Sat Mar 3 23:28:27 2007 +0000
-
- updated all rspec exceptions. exception specs all pass in MRI. still a few rubinius exception spec issues
-
-commit 2c278533cbfe0efc7076d2c947323640be5f207a
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Mar 3 21:29:55 2007 +0000
-
- Committing tlockney's additions to core/exception_spec.rb. These pass on MRI but illustrate areas to fix on rubinius.
-
-commit fd8993c0996e4524440a6572c45dad4ab112fb2f
-Author: Hornbeck <hornbeck@unknown>
-Date: Fri Feb 23 15:58:33 2007 +0000
-
- committing Aki Reijonen's Hash patches for hash.rb and the hash_spec.rb. Also included is Thomas Lockney's exception_spec.rb patches.
-
-commit 08e6d924b8c0175242c1c40322ed3e45855a86c2
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Feb 18 07:48:46 2007 +0000
-
- Altered Object#instance_variable_[get|set] rearranging flow control. Added specs for instance_variable_[get|set] for Array, IO, String.
-
-commit 2a2385413c03f21dfc038e110f46a7a3bd2fc9c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Feb 18 06:05:47 2007 +0000
-
- Increased time out value when running rspec error report. Minor changes to text in class specs.
-
-commit bd0d7fcf72546a0a3a5a6a59b1a6f2aadd8e4262
-Author: Mae <mae@unknown>
-Date: Sun Feb 18 03:53:00 2007 +0000
-
- Integer#bits for future refactoring of shift
- * added Integer#bits which calculates minimum bit storage required for (signed int) form of the Integer
- * spec'd it too
-
-commit 4e6b39d5e69c04d92ceac76ce5a5bd792fb65f39
-Author: Mae <mae@unknown>
-Date: Sun Feb 18 02:55:55 2007 +0000
-
- Object#extend-a-gogo
- *Fixed Small bug in rubinius_target where failures wouldn't be reported
- *Implemented Object#extend and changed math.rb to use it accordingly
-
-commit 5472c10579cef38f9f28c904710246509633a040
-Author: Mae <mae@unknown>
-Date: Sun Feb 18 01:21:11 2007 +0000
-
- A great Time patch from John Hornbeck <hornbeck@gmail.com>:
-
- A more complete Time diff. This includes many of the instance methods for Time and a new primitive for usec. This diff also includes some failing specs as I went ahead and added the specs for the rest of the class methods. Also included is the constants for Time.
-
- Keep the good work coming John!
-
-commit 83ab11e0ab6679b1c9eefc5095d3f20af9a61661
-Author: Mae <mae@unknown>
-Date: Sat Feb 17 23:26:33 2007 +0000
-
- Patch from Aki Reijonen <aki.reijonen@gmail.com> without the Float.induced_from part
-
- Summary of the changes:
-
- ** Added methods **
-
- Numeric#integer?
- Numeric#div
-
- Integer#to_int
- Integer#round
- Integer#truncate
- Integer#next
- Integer#succ
- Integer#integer?
-
- String#slice!
-
- Object#to_a
-
- Kernel#Array
- Kernel#String
-
- ** Fixed methods **
- Float.induced_from
- - Now return the passed object if it's an Float insted of calling #to_f
-
- ** Removed methods **
- Fixnum#div was broken, the end result should be converted to Integer,
- not the number passed as a argument. (superceded by Numeric#div)
-
- --
- Aki Reijonen
-
-commit 243a4e9ba46149b8ba39c7238f8ff3d5f267689e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Feb 17 06:17:44 2007 +0000
-
- Ditched all the instance vars in array specs since we've got locals now.
-
-commit be5363e22e04b8baf26cb4abd8a8a67e7dd3cc0c
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed Feb 14 01:05:49 2007 +0000
-
- Fixed * varargs to work in method definitions. Currently still
- does not work as the single named parameter (foo(*a)). This
- means that lib/bytecode/encoder.rb now compiles under Shotgun.
-
-commit 3bb810688e848c90d5c20929c630f36a32796d2d
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 13 18:42:09 2007 +0000
-
- Added Object#instance_variable_set and specs.
-
-commit 54392c99dc3db5b58c85799416cc528c60b12533
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 13 18:25:24 2007 +0000
-
- Added Object#instance_variable_get and specs. Uncommented Math module constants specs.
-
-commit 84267901502ca1e8e8b13afa0e3a16e0cdc8e493
-Author: Mae <mae@unknown>
-Date: Sun Feb 11 10:30:13 2007 +0000
-
- * Primitive Specs
- - Added spec for bignum_div (and fixed a problem where it would always fail)
- - Fixed primitive_spec_helper (because it broke the old specs last time)
- - Removed magic method chaining because it sucks
- - DISCLAIMER: primitive specs atm just test functional things, _NOT_ stateful side-effects
- - We can do this properly once rubinius can run rspec
-
- * SIRB
- - Made it so that => wouldn't get printed before the command prompt if you typed "exit"
- - Made Kernel#p, Kernel#puts, Kernel#print return nil (like MRI)
- - added #!shotgun/rubinius to top of sirb and symlinked it to bin/sirb.rb as well (for convenience)
-
- * Removed unused local from __loader
-
-commit efce7d8a56748ab1831a34d21b8c92ff8b2eb977
-Author: Mae <mae@unknown>
-Date: Sun Feb 11 07:25:51 2007 +0000
-
- Moved math to math_spec; added object_spec for primitives; made primitives_spec_helper maybe too smart? -- they chain methods on to the remote target
-
-commit 087a5e5a6e89e4a53a39e025ffe08d21e96b8f6e
-Author: Mae <mae@unknown>
-Date: Sun Feb 11 05:51:30 2007 +0000
-
- * Made rubinius_target and example much more helpful
- - backtraces are shown on failure now
- - you can do this: example { 1 + nil }.should_raise(TypeError) and it works :) (with bt and all)
- - injected some extra code in example snippets so try(exc) syntax still works
- - Float, Nil, True, False specs all pass 100 %
- - made rubinius_target make use of @src (used in bignum)
-
- * Made Kernel.Float() and Kernel.Integer() behave appropriately like MRI _with_ the exception of Float() also checking for to_i method
- - Integer(nil) => 0 and Float(nil) => 0.0
- - lots of spec coverage
-
- * Numeric#coerce was slightly tweaked to use new Float() and Integer() behavior
- - Specifically complains about other being nil (so 1 == nil doesn't work)
-
- * Made Float.induced_from() more anal retentive (only accepts core Fixnum, Bignum, Float types like mri)
- - specs cover it
-
- * Fixed infinite loop on Bignum#& and moved & out of Numeric into Integer (Float doesn't have &)
-
-commit eadf1ead754d3dbfaf703c205f6f5e8f4dc5c430
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Feb 11 03:00:25 2007 +0000
-
- Put object flags values into a single include file. Added Object#taint, tainted?, freeze, frozen?. Neither of these states actually effect execution yet. Fixed up Object specs.
-
-commit 38e7f757e67b4ec985835e0e93ba4d32bbee5ca4
-Author: Mae <mae@unknown>
-Date: Sat Feb 10 23:57:37 2007 +0000
-
- - Created specs for math_sqrt primitive (and created spec/primitives/math_spec.rb)
- - Tweaked primitives_spec_helper to properly transport NaN's to testing environment
- - Removed non-needed self parameter from math_sqrt c function
-
-commit a4267a136d7f0bf7f92421fcebd8011600a1d92e
-Author: Mae <mae@unknown>
-Date: Sat Feb 10 22:29:46 2007 +0000
-
- Float.induced_from love
- - made Float.induced_from work for any to_f item (controversial whether this should be done in Kernel.Float() or not)
- - apparently this fixed some float failures
- - made Float.induced_from safer because it now complains if to_f returns a non-float
- - wrote specs for new induced_from behavior
- - try (spec_helper) needs to be investigated, manual running of the premises of 'Float divmod should raise FloatDomainError if other is zero' show this to be a spec that _should_ pass
-
-commit 65a4e8abfc7f690456e4f44e7e4cc38911288516
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Feb 10 18:54:15 2007 +0000
-
- Added spec files for the rest of the core classes documented in Pickaxe book. Add simple class hierarchy specs for exception classes.
-
-commit c7a2f68c36dd95f51af88e8fa62b24b71d68578a
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Feb 10 17:29:46 2007 +0000
-
- Commit of scoopr's Math module beginnings. Thanks scoopr.
-
-commit b1e8d150460f2ae9ea2e5ef87d0df3b705c1d0d6
-Author: Mae <mae@unknown>
-Date: Fri Feb 9 08:54:25 2007 +0000
-
- Bignum primitive specs
- - Added spec and changed to metaprogramming style for primitives: bignum_add, bignum_compare, bignum_equal, bignum_and, bignum_divmod
- - fixed bug that bignum_divmod spec found where bignum_divmod would always fail on divide by zero GUARD
-
-commit 0487a39ec9995af8eb5a8dff5ec64492261852e7
-Author: Mae <mae@unknown>
-Date: Fri Feb 9 07:48:56 2007 +0000
-
- Primitive Spec Sexiness
- - Added spec and changed to metaprogramming style for primitive fixnum_to_f
- - Made usage of run_primitive(:add, 1, 5) more sexy i.e. 1.prim.add(5)
- - converted fixnum spes to use sexiness
-
-commit 95fa48f29eaa7e3f10ccd63d385fb3f582f57eea
-Author: Hurdlea <hurdlea@unknown>
-Date: Fri Feb 9 01:36:14 2007 +0000
-
- * Added String#delete, delete!, tr, tr!, tr_s, tr_s!
- - String#count and squeeze to follow ...
- * String#<< now accepts Fixnums
-
-commit 017bdc57602e2e5d55705de070c07edba46a347f
-Author: Mae <mae@unknown>
-Date: Thu Feb 8 09:23:55 2007 +0000
-
- - removed noop from primitives (it does nothing)
- - removed noop primitive spec
- - changed CPU::Primitives.name_to_index to offset by +1 (to leave room for special 0 value)
- - still having same closed parens issue with spec:primitives:
- syntax error, unexpected $end, expecting ')' (SyntaxError)
-
-commit 18a3347bb32d8ac5269438376f0100ecce2c9e73
-Author: Mae <mae@unknown>
-Date: Thu Feb 8 08:20:14 2007 +0000
-
- - made shotgun/lib/primitives.rb have less dependencies
- - fixed bug where if a false was popped of the stack it wouldn't be recognized as an argument in primitives_spec_helper (nil will only do this now)
- - fixed regression in primitives_spec_helper where the proper code wasn't showed when shotgun crashes
- - noop_spec works again
-
-commit 16b08e446b69344da1edbc1f793e0161deac8e6c
-Author: Mae <mae@unknown>
-Date: Wed Feb 7 23:59:14 2007 +0000
-
- More Primitive Goodness, Conform to unified rspec standards
- - Added specs and changed to new metaprogramming style for the following primitives: fixnum_and, fixnum_or, fixnum_xor, fixnum_invert, fixnum_neg
-
-commit cb2ac85b45a41a63100cac673919ad8db1f93f43
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed Feb 7 23:16:35 2007 +0000
-
- Basic specs for Symbol literals.
-
-commit 3ab7aced51f3a63c8f76706a2f159d0d5753dc64
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Feb 7 20:35:27 2007 +0000
-
- Changed Fixnum primitives specs to be in a single file, spec/primitives/fixnum_spec.rb. Added back the alternative example of writing specs for others to evaluate or use. Updated the wiki specs page to lay down the law on spec files. Kindly follow it.
-
-commit cf16d691990f43f5bf8807bbef2ba1876892be57
-Author: Mae <mae@unknown>
-Date: Wed Feb 7 18:27:15 2007 +0000
-
- Autotest, C warnings cleanup, and some primitive_spec usage cleanup
- - Added Autotest Facilities for primitive bin/autotest/primitives
- - need to gem install zentest to use this (and some diff gem i can't remember)
- - Removed ugly require statement from cpu/primitives it was causing annoying ruby errors
- - Added missing prototypes to cpu.h and regexp.h (primitives.gen was complaining)
- - Localized bt and bt_size variable declarations to where they would be included by the preprocessor to make more warnings go away
- - Added newlines to the end of numeric.c, numeric.h, float.c
- - Used one of brixens suggestions (injection of primitive spec helper automatically)
- - Removed extraneous primitive helper inclusion in each spec
-
-commit f4bbce9d761d27e1381b95a4ff6076e85577074d
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Feb 7 16:56:21 2007 +0000
-
- This shows an example to 'fix' mae's rubyesquely-challenged (bluntly, ugly) primitive specs. Also, there should be one spec file for a group of related contexts. In this case, the group is the class Fixnum. So, mae, fixnum_spec.rb, NOT fixnum_xxx_spec.rb. Sorry. Cry tyrany, weep and gnash thy teeth, howl in protest, but please fix it. This is non-negotiable. Thank you and good work on the primitive specs. :)
-
-commit e5f6215824a40beb0ca678575596bd06afa8dd3a
-Author: Mae <mae@unknown>
-Date: Wed Feb 7 09:54:54 2007 +0000
-
- - Added specs for primitives: add, sub, fixnum_mul, fixnum_size, fixnum_div, fixnum_modulo, fixnum_divmod, fixnum_to_s
- - Updated primitives to new metaprogramming style: sub, fixnum_mul, fixnum_size, fixnum_div, fixnum_modulo, fixnum_divmod, fixnum_to_s
- - Changed wording in a couple primitive spec files to be more explicit
- - Made reporting by primitive_spec_helper more helpful when shotgun crashes from injected code
-
-commit 3032c6bd869a04c1517508850f94119975c36e54
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Feb 7 02:26:47 2007 +0000
-
- Fixed up String#to_i a bit; added a bunch more specs for it.
-
-commit d8a24ffa8d9983a85b0f03784a89bfa667af1615
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Wed Feb 7 01:46:30 2007 +0000
-
- Added very basic set of specs for assignment and multiple assignment semantics.
-
-commit edb7c82523b36b26e24437de42fd2638eef1653f
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 19:02:46 2007 +0000
-
- Added specs for and methods CType#isalnum, isdigit.
-
-commit e84ba1b12c51331d00bdd06684dcff96ea229322
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 17:30:55 2007 +0000
-
- Added spec/shotgun/bytearray_spec.rb. Added spec for ByteArray#[], []=. Modified various string methods to use BA#[], []= instead of get_byte, set_byte.
-
-commit be9589cc47cbf35edd94ca22407de4b1527a3fdb
-Author: Mae <mae@unknown>
-Date: Tue Feb 6 11:26:31 2007 +0000
-
- Tweaks to primitive metaprogramming and addition of noop spec
- - Added types 'qnil' 'qtrue' 'qfalse' to be used in primitive metaprogramming
- - Added spec for noop primitive
- - Added run_asm method to primitives_spec_helper for those tricky tests
- - Converted noop primitive to new metaprogramming style
-
-commit e31f1af903dd8dd31427e34a718b30f5c63af8df
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 10:33:00 2007 +0000
-
- Some fixes to String#to_i and additions to specs. Added String#oct and hex.
-
-commit 2a157827bd72b6c7ce8a025928cdd9d7f2f8d00f
-Author: Mae <mae@unknown>
-Date: Tue Feb 6 10:18:16 2007 +0000
-
- moved equal and compare to use new primitive technique
- - also updated equal_spec to ask for ArgumentError instead
- - uploaded new rba *glares at brixen*
-
-commit 771d0fede3086ce58d225ac4001ea0934f3bb0e3
-Author: Mae <mae@unknown>
-Date: Tue Feb 6 09:33:03 2007 +0000
-
- ARITY macro raises ArgumentError directly from the primtive now and made specs pass
- - Made ARITY macro raise an argument error exception instead of just ambiguously failing
- - Made _ret return TRUE on arity failure (exception directly raised)
- - Moved GUARD and POP macros to shotgun/lib/cpu_primitives.c where they belong (localized)
- - Removed side-effect printf in cpu_raise_arg_error since stack trace is fine now
- - Tweaked primitives_spec_helper should_raise to work for all exceptions
- - Made specs for equal/compare pass again (expect ArgumentError instead of PrimitiveFailure)
- - New compiler.rba (update these ppl!)
-
-commit e89190c8fdc4a71c7b8cd9c8b873a63b9d1888c5
-Author: Hurdlea <hurdlea@unknown>
-Date: Tue Feb 6 07:51:08 2007 +0000
-
- * Finished String#[]= for string index
- * found odd bug with spec where string[1,2]="foo" is not interpreted correctly
- changed methods to use send(:[]=, ... and the tests pass
-
-commit c6e1bb68e930a537bd51d77afd37cdc8b5d62d31
-Author: Hurdlea <hurdlea@unknown>
-Date: Tue Feb 6 07:18:15 2007 +0000
-
- * Added String#[]= slice functionality
-
-commit e405d4f5f32fd8192c435b3488f394b2635c7db7
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 06:37:31 2007 +0000
-
- Added String#chomp[(bang)].
-
-commit ff48a6c333f34c1b1882c260db7145facce3d71f
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 06:00:56 2007 +0000
-
- Added String#replace_if that calls replace if self != other else returns nil; Added upcase, downcase.
-
-commit f46d747eba82c215fa07b067a30f2a2e8868d284
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 05:31:13 2007 +0000
-
- Implemented String#reverse directly rather than with String#<<. Modified some string specs for [lr]strip but forgot to commit them earlier.
-
-commit d3b0e71e810a985f3b8f2e5f5c7d5c4619f151f9
-Author: Hurdlea <hurdlea@unknown>
-Date: Tue Feb 6 03:00:28 2007 +0000
-
- * Added NilClass specs to detect NilClass coercion
-
-commit c570ca475cabeb3fcfcca26d4c57b8e57f6606b4
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Feb 6 02:01:19 2007 +0000
-
- Added module CType mixin for Integer to provide isspace, isupper and friends. Added specs for CType in spec/shotgun. Implemented String#capitalize[(bang)]. Moved ByteArray into it's own file. Updated various string specs and commented out temporarily index spec.
-
-commit 4694d1511e880e43dfccb3e3f5309f0920395ba0
-Author: Hurdlea <hurdlea@unknown>
-Date: Tue Feb 6 00:22:17 2007 +0000
-
- * Fixed operation of Regexp#=~
- * Updated Regexp spec for =~
- * String#== now works correcly for duck typed objects
-
-commit 8e42aa9c789fcc9bc475d460e7158f2adcc8ab64
-Author: Mae <mae@unknown>
-Date: Mon Feb 5 22:46:21 2007 +0000
-
- Added arity checking for primitives
- -for use in primitives: #define ARITY(length) GUARD( (length) == num_args )
- -for instance if i have a primitive that takes one argument (self + arg) i put ARITY(1) at the top
- -changed specs with regard to arity accordingly
- -made block_given conform to the "self rule for primitives" by padding Qtrue where self would be
- -fixed block_given? to pass the right arity (0) in the compiler
- -specs for compare and equal pass now
- -added primitives_spec_helper (forgot last time)
-
- NOTE: Binary .rbc compatibility is broken now since there are arity checks done on block_given?
- -the rba's i uploaded should be fine but if they arent...
- do find -type f | grep .rbc | grep -v .svn | xargs rm
- then rake build:rubinius
-
-commit 2d5c9bc3170bf959390627def10c0208088b48ee
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Feb 5 22:39:08 2007 +0000
-
- Added Integer#isspace and spec in spec/incompatible. Added spec/incompatible/string_spec to describe behavior of stripping runs of whitespace and nulls from end of a string. Added or modified String#lstrip, lstrip(bang), strip, strip(bang), rstrip, rstrip(bang).
-
-commit d4b07b06ca85543423a308f12b82ae4671bdd0c2
-Author: Mae <mae@unknown>
-Date: Mon Feb 5 21:01:59 2007 +0000
-
- -split out common primitive testing functionality to primitives_spec_helper.rb
- -added spec for primitive "equal"
- -again primitive specs are rake spec:primitives
-
-commit c1a7896f24e018df13af7f0d3d60db9f461130a5
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Feb 5 20:58:21 2007 +0000
-
- Added that Module#include passes off to append_features. Added Module#include that takes multiple args later in the bootstrap sequence. Added specs for include and append_features.
-
-commit d407ecab13722599b75fecc20bdebd86c9f76fa6
-Author: Mae <mae@unknown>
-Date: Mon Feb 5 20:48:02 2007 +0000
-
- Misc Changes to Tweak primitive specs
- -Added spec to test arity restrictions of compare
- -Fixed bug where should_raise for primitives was not catching the error condition
- -Changed wording of some specs to be english rather than engrish :)
-
-commit f68ad63065002d4a3c9a0742770da4a112780aa7
-Author: Mae <mae@unknown>
-Date: Mon Feb 5 20:02:24 2007 +0000
-
- - Remove printf from cpu_raise_primitive_failure so that the screen doesn't get littered
- - Created PrimitiveSpecHelper and a "primitives" spec subdirectory
- - Added rake task spec:primitives
- - Added compare_spec as an example
- - New rba's
-
-commit f997d3791099912001d09a427f24252182ba1d6c
-Author: Hurdlea <hurdlea@unknown>
-Date: Sat Feb 3 08:10:48 2007 +0000
-
- * Added MatchData#values_at
- * Fixed implementation of MatchData#select
- * Updated specs for MatchData#values_at, select
-
-commit 4f8301aeb3a5a296a64b887b0f164ca02be2a71f
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Feb 2 17:00:10 2007 +0000
-
- Added specs for and empty module methods private, protected, public as a first approximation to allow code that uses them to not choke. Added String#match.
-
-commit 15c3678ddcc365891fd92cc9cd33eb22308916e8
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Feb 2 10:43:58 2007 +0000
-
- Committing Adam Ritter's patch to recognize 'for i in ...' expression, and associated spec. Uncommented line in float_spec.
-
-commit 370d7a955bf6e41c4ea7cf0f9217128ae7a72fd4
-Author: Hurdlea <hurdlea@unknown>
-Date: Fri Feb 2 07:06:22 2007 +0000
-
- * Added MatchData#inspect, select, to_a, size, to_s
- * MatchData#[] is now more compliant - behaves more like Array#[]
- * Added Regexp#hash
- * Added Regexp#hash spec
-
-commit b496d50c0ebf7d5c523efe2ef5383dd8043aa3f0
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Fri Feb 2 00:36:37 2007 +0000
-
- Added specs for Dir and modified rubinius_target to allow
- specs to change directories safely.
-
-commit 6ddf4051f3a6be7076e947bf3eccbc5dd9a7803f
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 19:11:14 2007 +0000
-
- Fixed Float#divmod, returning 0 guard on primitive, raising FloatDomainError rather than ZeroDivisionError. Fixed Float#% when other is zero. Spec try helper doesn't yet work with rubinius_target
-
-commit 679f3fbe54960a690f4e41e1403fdc8f50c0f346
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 18:36:44 2007 +0000
-
- Added more zero division behavior specs.
-
-commit b4d739a7cb68d6f82d657b69aee00923e0bfdbb4
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 18:12:02 2007 +0000
-
- oops, damn keystrokes. Previous commit msg should just include Fixnum. This change points out a problem that I'm not sure about: 1.quo(0) => Infinity in irb and run from a file, but in the spec I get zero division error. wth?
-
-commit 4e24fe43a7d6c55a53880a1c347e836f12937ed4
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 18:03:13 2007 +0000
-
- Added more specs around zero division behavior for Float and Fixnum.
-
-commit b8f412ee2bf3701acd211372d28ec596d6858ac8
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 18:01:44 2007 +0000
-
- Added more specs around zero division behavior for Float and Fixnum.
-
-commit 17a17e3008422bab9e91f8464d1ce2823c13ce78
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 17:51:47 2007 +0000
-
- Added try spec helper method for spec'ing things that raise exceptions. Added more Float specs that describe division by 0 behavior.
-
-commit 2c2bfc3663a34fbf4fd70a5787236ec8b9a87024
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 17:22:39 2007 +0000
-
- Added spec for Float#% when other is zero to show current implementation is broken.
-
-commit d1ddd71d5bd45df0c16651ecad2db3c1b75d90f8
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Feb 1 17:06:56 2007 +0000
-
- Reverted mae's breakage to Float. seriously mae: you did NOT run the float specs and you did NOT write new specs for the behavior you were changing so you did NOT understand what you were doing. As a good CS student, you can negate the above to know what you SHOULD do. ;) Please, WRITE and RUN your specs.
-
-commit b2e08a170d1ab222d67d8767fa880a5e21c5bf74
-Author: Mae <mae@unknown>
-Date: Thu Feb 1 10:53:48 2007 +0000
-
- know when to shoot your baby in the crib -- cleanup outdated unused code
-
-commit aac75dd658c96cf930852d86dbc79b66830bace5
-Author: Eero Saynatkari <eero@kittensoft.org>
-Date: Thu Feb 1 09:12:03 2007 +0000
-
- Improved specs for Hash.[].
-
-commit 40f637f2685e969f097fbbb2ffa3f0173e6f9866
-Author: Mae <mae@unknown>
-Date: Thu Feb 1 02:44:14 2007 +0000
-
- Fixed my pure ruby Numeric#floor and Numeric#ceil methods
- - Please smash your c primitive brix BWAHAHA
- - Also implemented eql? for float and now all 32 float specs pass
- - Added some edge cases for ceil/float that were not previously covered in specs
-
-commit 5cc6f6b6068e945c6f5896370ee20567e57122e7
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 31 11:24:23 2007 +0000
-
- Added Float#round. We now have 32 of 32 float specs passing. Please confirm on your platform.
-
-commit 9b902a80a008120a86ae18d4abff04d42efefc8f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 31 06:22:10 2007 +0000
-
- Folded in coerce specs.
-
-commit 09e61132d5b9e9b08d27f2f51db9580808bb370e
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 31 03:22:23 2007 +0000
-
- Created spec/incompatible for specs that show where Rubinius is incompatible with other implementations. Added bignum_spec and fixnum_spec to incompatible dir. Under MRI, Bignum.coerce(Fixnum) => [Bignum, Bignum] whereas Fixnum.coerce(Bignum) => [Float, Float]. Since Bignum should be a seamless extension of Fixnum, this behavior in MRI seems less than consistent. Under Rubinius, mixed Fixnum and Bignum promote to Bignum uniformly, and this makes much more sense. There are other places where Rubinius implementation may deviate from MRI, so spec/incompatible is for describing those behaviors. Updated coerce specs.
-
-commit cb52bb9633d0e323d2f7d6c90879fb7decfea7d7
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 30 10:44:46 2007 +0000
-
- Added Numeric#coerce primitive. Reimplemented a number of primitves and methods on Fixnum, Float, Bignum to use Numeric#coerce rather than implementing knowledge of one another all over the place. Folded in mae's coerce specs. There is currently a (desirable IMHO) incompatibility in Numeric#coerce in that Bignum.coerce(Fixnum) == Fixnum.coerce(Bignum). There are a lot of other methods that need to be reimplemented using Numeric#coerce. Also, bignum_compare needs to be implemented (just returns 0 atm).
-
-commit e1aa382f2d596a73ef20dfde4184af7a721724e9
-Author: Mae <mae@unknown>
-Date: Tue Jan 30 00:26:11 2007 +0000
-
- added specs for coercion of Fixnum, Bignum, and Float
-
-commit bd292d64a511eba51ea1569870bcf0fa365c903d
-Author: Cabo <cabo@unknown>
-Date: Sun Jan 28 21:05:10 2007 +0000
-
- include yesterday's failed cases
-
-commit 7cac7f32e5c80e78aa75dfed7f4822e65d1ab4df
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 28 08:08:12 2007 +0000
-
- committing rue's continuation specs. doomo arigatoo.
-
-commit f542b93031f8982daa13777d2eada81068e96ad5
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 28 07:03:46 2007 +0000
-
- committing rue's class specs. thanks rue!
-
-commit 319b6f194d3c699a75de8da2ba3b53b8a4feffb1
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 28 04:49:01 2007 +0000
-
- Commiting rue's binding specs.
-
-commit d8326b1321cc09c0aa64f441d2a81df6735603fd
-Author: Cabo <cabo@unknown>
-Date: Sat Jan 27 00:02:33 2007 +0000
-
- remove superfluous p from "& should create an array with no
- duplicates" (which now passes)
-
-commit 7d3baf10a79c1500e660fe5566ba8f3107d5a826
-Author: Hurdlea <hurdlea@unknown>
-Date: Thu Jan 25 05:43:50 2007 +0000
-
- * Added MatchData specs
-
-commit 2d9966c9c30e541c18ac77ca646a1af41daf702e
-Author: Hurdlea <hurdlea@unknown>
-Date: Thu Jan 25 05:42:44 2007 +0000
-
- * Added Match2 and correct Match3 in compiler.rb
- * Added alias String#to_str
- * Tweaked a few regexep specs for string return types
- * Fixed MatchData#length so it uses Tuple#fields to get the no. items
-
-commit 0d9f9e21c2a268e0710c963c745f07d494e2ab1f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 24 21:43:17 2007 +0000
-
- Commiting zimbatm's update to exception_spec.
-
-commit 037d8b29872f1c4a81108a0713afd78cbdf9b484
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 20 04:03:20 2007 +0000
-
- a few more tweaks to get string specs to execute with rcompile and shotgun.
-
-commit cfe7a6b4c87ac3ffccaeb7e70b9e6c386054e052
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 20 03:49:01 2007 +0000
-
- added parser dir under spec. added parser/symbol_spec.rb to capture parsing a complex symbol like :' for one or two', which rcompile and shotgun choke on at the moment. removed this from core/string_spec because it crashes shotgun and makes it impossible to run all the specs.
-
-commit d39040ab1563f063192a3835723cfbae7bf147cb
-Author: Cabo <cabo@unknown>
-Date: Fri Jan 19 23:45:52 2007 +0000
-
- lib/kernel.rbc is no longer a required (or wanted) command line argument
-
-commit 4774788e0ae9b24b3ff0b769aede0ba2de3f00b1
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 19 21:05:10 2007 +0000
-
- added correct guard on Array#first to return nil when array is empty. added specs for #first and #last to describe this behavior. Thanks to cabo for finding this.
-
-commit baf1453678c9906c65b2f7c82bdb0e179e22d1b8
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 19 02:49:02 2007 +0000
-
- added some minor changes to structure and wording of language/expression_spec. removed array and defined spec from language directory since they were added to language/literals directory. renamed several spec files to follow naming conventions.
-
-commit 7a24923ab9b79b226b6d8831e834ab509d5d2b76
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 19 01:27:10 2007 +0000
-
- committing zimbatm's patch to language specs. super nice and thank you. please give zimbatm a commit bit!
-
-commit 9cd8c779a88f48604733afbe4357b7101a487669
-Author: Vic <vic@unknown>
-Date: Thu Jan 18 22:20:34 2007 +0000
-
- Added Proc.given, the analog of MethodContext.current
- Proc.given obtains the proc given to the current MethodContext.
- Later will be able to get a Proc from a given Binding.
-
- Original author: Victor Hugo Borja <vic@rubyforge.org>
- Date: 2007-01-18 16:16:06+00:00
-
-commit 50c42413d33951397a46edb55ca910a2e8fb87e6
-Author: Vic <vic@unknown>
-Date: Thu Jan 18 21:34:29 2007 +0000
-
- No output is available for specs if the returning value is a Numeric or Symbol
- When the :example execution on shotgun evaluates to a Numeric or Symbol, no method
- :stdout is added, because these object do not have singleton-classes on MRI.
- If you really need both, stdout and a Numeric/Symbol, your evaluation may lead to
- an array containing that Numeric/Symbol.
-
- Also saved MRI from getting eval errors in cases like the following:
-
- example do
- class A; end
- A.new
- end
-
- This leads to the following being evaled by MRI: [ #<A:0xb7a69c8c> , stdout]
- which causes an error because of #<A:0xb7a69c8c> being invalid ruby syntax.
- This patch fixes this situation by converting #<A:0xb7a69c8c> into "#<A:0xb7a69c8c>"
-
- Original author: Victor Hugo Borja <vic@rubyforge.org>
- Date: 2007-01-18 15:23:55+00:00
-
-commit ec5bea103b4b96ecde54668e47ab9e10ac8ec4ee
-Author: Hurdlea <hurdlea@unknown>
-Date: Thu Jan 18 21:04:22 2007 +0000
-
- * Added bitwsie operators to Fixnum & | ^ << >> ~
- * Split the fixnum specs into coerced and non-coerced tests
- * Added primitives to support fixnum bitwise ops
- * Fixed a bounds tests in Interger#chr
-
-commit 238d7e0611e9198c28a5e0ebe684bc7f1f03bf0f
-Author: Vic <vic@unknown>
-Date: Thu Jan 18 20:11:58 2007 +0000
-
- [rAdded specs for the new STDOUT support] Empty log message
-
- Original author: Victor Hugo Borja <vic@rubyforge.org>
- Date: 2007-01-18 13:44:19+00:00
-
-commit 859b26f38749f160a706ed9dbb8f2a80886e94ef
-Author: Vic <vic@unknown>
-Date: Thu Jan 18 19:37:03 2007 +0000
-
- Allow to specs to test what is written to STDOUT
-
- also added String#unindent on spec_helper to help make output heredocs more readable.
-
- You can access both the evaluation result and the stdout produced, ej:
-
- context "Rubinius target" do
-
- specify "should allow to get the resulting STDOUT" do
- example do
- puts "hola"
- puts "space is significant in this heredoc"
- puts "unindent removes the first blanks found on the first line"
- puts "on each of these lines"
- puts "adios"
- end.stdout.should == <<-OUT.unindent
- hola
- space is significant in this heredoc
- unindent removes the first blanks found on the first line
- on each of these lines
- adios
- OUT
- end
-
- specify "should allow to get the lines written to STDOUT" do
- example do
- puts "hello"
- end.stdout_lines.length == 1
-
- example do
- print "bye"
- end.stdout_lines.first.should == "bye"
- end
-
- specify "should allow to access the evaluation result along with STDOUT" do
- result = example do
- puts "ok"
- Object.new.class
- end
- result.should == Object
- result.stdout_lines.should == ["ok\n"]
- end
-
- end
-
-commit e17069925d139c93acec00161a7111e6c78d54bb
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 18 08:44:33 2007 +0000
-
- converted shotgun-test/test_sexp to spec/shotgun/sexp_spec. thanks to Victor Borja's recent additions to rubinius_target, it was a breeze.
-
-commit 46e9a259bc2212dee1fa7efa8ead468e63970731
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 17 08:02:35 2007 +0000
-
- filled in the rest of the documented String instance methods except #pack.
-
-commit dfd08d6536ea497cf86d06ca503206d54b19479d
-Author: Cabo <cabo@unknown>
-Date: Tue Jan 16 10:24:18 2007 +0000
-
- A bit more array fun (and lots of FIXMEs)
-
-commit b1e50e43d8d79a5dbd82345134ecd4bdffc6d182
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 16 08:46:48 2007 +0000
-
- and yet a few more string specs. these will asymptotically approach done.
-
-commit 4048d3dfa90a6de54ea2ed0aec2ec6adafb50b0c
-Author: Cabo <cabo@unknown>
-Date: Tue Jan 16 07:02:50 2007 +0000
-
- I want to see what 'Shotgun has crashed' means, beautiful backtrace and all
-
-commit 0387baa914cb35c589c7872f7f98cf9f8ee10711
-Author: Cabo <cabo@unknown>
-Date: Tue Jan 16 02:19:45 2007 +0000
-
- Fix Array#slice! bug workarounds
-
-commit c6b110b47667c5d6750492177492434f4c0446f8
-Author: Cabo <cabo@unknown>
-Date: Tue Jan 16 01:33:18 2007 +0000
-
- add shift spec and fix String#strip so it works
-
-commit 19bcc086b7674f12e01f879a6ca83f3289feb770
-Author: Cabo <cabo@unknown>
-Date: Tue Jan 16 00:06:03 2007 +0000
-
- Integer#chr should return a new string (spec)
-
-commit 5aa81499711ad5e57f5dfc03417f23705eb79b44
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 23:48:16 2007 +0000
-
- a few more string specs.
-
-commit 8cd873e183c62b8929305ea54b9a437ca22ddb28
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 22:42:24 2007 +0000
-
- committing Victor's define_method patch.
-
-commit cd04f4c570cd95fb869f025c4dac6e9342e2ba2a
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 22:02:23 2007 +0000
-
- committing Victor Hugo Borja's instance_eval patch.
-
-commit a481142988d585bb8fa54e0186f5c9cf88ada8d9
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 20:13:03 2007 +0000
-
- added a code method to mri_target and jruby_target to parallel the behavior of the code method for rubinius_target. now core/proc_spec.rb is passing with mri target.
-
-commit a4c621e8319349eda766f73ed9ca55f2a9323ac2
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 19:08:22 2007 +0000
-
- checked in nicksieger's patch to spec_helper that enables specs to run on jruby, woohoo!
-
-commit 6b02aac6107b01258f85f9d15a77b498ad15e5b0
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 18:06:23 2007 +0000
-
- checking in cabo's changes to target specs for jruby and rubinius. modified rubinius_target specs that compared paths to use should_match because a hash is used to generate part of the path.
-
-commit 6aa175d3367d76152476888ff1c52479530c56a2
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 15 17:57:25 2007 +0000
-
- committing cabo's changes to remove heredocs from a number of specs. It is still possible to pass code as a source string to the example method. Use this if the block method is causing rubinius to choke on the ruby2ruby generated source. soon, soon, we'll have rspec running (I hope\!).
-
-commit 6679194f8e6afdbbb71f5213508bb81f12fdb2e7
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 14 17:28:06 2007 +0000
-
- incorporated nicksieger's changes to mri_target removing needless requires. added jruby_target.rb and spec to parallel mri_target.rb.
-
-commit f573b9c16efccb92eec98d923831deafc7a3c809
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 14 08:10:24 2007 +0000
-
- converted mri_target to use eval, yield to execute specs. converted some specs to new style. addressed issues with hash specs that implicitly relied on hash ordering, fixed numerous issues that result from loss of floating-point precision by using #inspect where necessary (more of these issues may arise in the specs on different platforms). added spec templates for documented String instance methods (many of which need to be filled in).
-
-commit 917cd03e5bee749d18d8d0c257381bca2362abbd
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 14 00:11:17 2007 +0000
-
- checking in Alan Hurdles patch to allow running specific files, e.g. COMPILER=rcompile rake spec:core:array .
-
-commit 508eaacf9aaf67465a78ac53284ba6f06c3bcb3d
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 21:09:51 2007 +0000
-
- added integer specs. these should be platform independent but other platforms may have some trouble with spec for 'chr' ;)
-
-commit 21463a87bac2121fa61c1c99927cdb039c724d89
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 20:37:37 2007 +0000
-
- implemented the rest of the hash specs, this should cover the documented class, instance methods.
-
-commit 3656a95a1829b0be1a8b0d968e0a9e433ef9c847
-Author: Frederick <frederick@unknown>
-Date: Sat Jan 13 13:14:41 2007 +0000
-
- Implements Fixnum#size
-
-commit ca38e49022f6bdf41b0e98409d3fec3528e59bfd
-Author: Frederick <frederick@unknown>
-Date: Sat Jan 13 12:54:30 2007 +0000
-
- shotgun/string_spec.rb now follow new spec conventions
-
-commit 1b684385fe970f11a526e280d15c3f147a826886
-Author: Frederick <frederick@unknown>
-Date: Sat Jan 13 12:42:38 2007 +0000
-
- language/expression_spec.rb and language/exception_spec.rb now use new spec style
-
-commit f62c2539a1eef27b356e4d809d76c4f9ddecd2a5
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 08:14:12 2007 +0000
-
- new style specs for hash. numerous of these need to be implemented but there should be templates for all the documented class and instance methods.
-
-commit 28083a6e6dc89502d1c76e2a16f0003a589f01e0
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 08:12:37 2007 +0000
-
- one more, bignum.
-
-commit 076aab00b795ff777c5ac11955130f12f69e1377
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 08:07:30 2007 +0000
-
- new style specs for float, fixnum, symbol, string, object, file, module, regexp, range.
-
-commit 0161ab3527e91674eed4eeaad029eee654325155
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 07:39:26 2007 +0000
-
- true, false, nil, enumerable specs are new style.
-
-commit bb11cce41a472606312eb0a62948c4a339f23dd9
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 07:27:05 2007 +0000
-
- converted existing class and comparable specs to new style.
-
-commit 595b83a75044772136b83eaf84402ed73eb79da5
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Jan 13 07:08:14 2007 +0000
-
- ladies and gentlemen, a huge round of applause and gratitude to headius for inspiration and help getting specs in a form that will easily run on MRI, JRuby, and Rubinius. Checking in the modified spec/core/array_spec.rb. The rest to follow. The mri_target is still using the sub-process method, but that should be superfluous now.
-
-commit ae75e76915432757be3c9a7126c2ee8c6656652c
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 12 08:13:29 2007 +0000
-
- added a bunch more specs for array. two still need to be filled out. I think that covers all the documented class and instance methods.
-
-commit 8daf38e0f99eed3e42d654086a98e673d9855bef
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 12 01:14:35 2007 +0000
-
- checking in more of cabo's changes to kernel/core/array.rb and array specs.
-
-commit 0a349583aba629748d5e85de0ede6f38730512f1
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 12 00:57:22 2007 +0000
-
- checking in cabo's changes to array and array spec.
-
-commit 052512fea9b74e532ef6b68612c81061ad84e4f2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 11 05:16:47 2007 +0000
-
- finished Bignum specs for documented instance methods.
-
-commit 7f4786c85b2e0e95abc2728492ed1a7424d01dbe
-Author: Frederick <frederick@unknown>
-Date: Wed Jan 10 23:44:34 2007 +0000
-
- Added File.mtime, File.atime, File.ctime
- Avoid reusing old .rbc is .rb is newer
- Remove useless CHECK_PTR
-
-commit 70458d6446f0858570571a64b5294c0bb4ac358f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 10 17:40:36 2007 +0000
-
- moved exception and expression specs to spec/language. added stub for time_spec in spec/library. updated a string spec that was failing. added specs for all (I think) float and fixnum instance methods. added specs for bignum, but about half need examples.
-
-commit ffe4a7a48dcc116f73b89b9a046d4430ed51975a
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 9 18:07:31 2007 +0000
-
- removed duplicate bk task from Rakefile. removed shotgun-tests/test-array.rb as all tests have corresponding specs in spec/core. added beginning of specs for bignum separated into spec/core for stuff that should be indendent of mri or rubinius, and spec/shotgun for implementation specific.
-
-commit 946d0b42293ea081666e71e13c4b77d5b5dba886
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 7 05:38:33 2007 +0000
-
- checking in Alan Hurdles patches to regexp, string, and spec_string.
-
-commit 5f035040c4b3ce842fff4b39d1ca657c97deb7a4
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 7 03:03:31 2007 +0000
-
- updated mri and rubinius target impl specs. added environment option for running rubinius target using obsolete.rcompile, e.g.: COMPILER=rcompile spec spec/core/symbol_spec -f s. If you don't use the COMPILER env var, rubinius target will use shotgun to compile.
-
-commit 6ea911ae5740508cdbd8feb5cddba5b8bf7fe1c3
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Jan 7 02:32:35 2007 +0000
-
- changed some Hash specs to use instance vars rather than local vars because some versions of Ruby2Ruby output borked sexp for block local vars. E.g. use @h rather than h.
-
-commit 256fe9a8cada7ed512556e1701a5264670c6c28f
-Author: Mae <mae@unknown>
-Date: Sat Jan 6 07:55:32 2007 +0000
-
- made regression spec for buggy behavior of [1,2,3][2..-1]
-
-commit 0ffe8a3e6cd92bc5cd872cc22919885ea80366a0
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 5 20:05:03 2007 +0000
-
- added spec for String#reverse! to Laurent Julliard's spec for String#reverse and his implementation of both methods.
-
-commit 170737d2c77a4b2de862380cb87f7705560cca64
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Jan 5 18:24:32 2007 +0000
-
- * Much better implementation of Hash#key?
- * Added working support for default Hash values and procs
- * Added hash_get_undef for situations where nil and undefined hash values need to be differentiated
-
-commit 332378a8900f09009626cb7c4dbf0c8740a657c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 5 07:31:56 2007 +0000
-
- added specs for aliases of Hash#key?
-
-commit 27c3b2aeaa3208a7e0218f051f623b93e2e635d8
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 5 07:28:29 2007 +0000
-
- added spec for Hash#key?
-
-commit 2e88d941bc1b1ea506396a915e3c3c4e3dfd1601
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Jan 5 06:35:09 2007 +0000
-
- updated and simplified float and fixnum specs.
-
-commit e4a5b6d8529d60e62875004bb60f33c6452ccf98
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Fri Jan 5 06:28:04 2007 +0000
-
- * defined?() now handles: defined?(Kernel.puts) flavors of arguments.
-
-commit 27660379c09e561590cf1bc48a9459e29fc00e9c
-Author: Mae <mae@unknown>
-Date: Fri Jan 5 06:10:11 2007 +0000
-
- Added spec for cvar declaration in class bodies
-
-commit a9b7b9f7db02ba78514eb869c2c52d4e5067f8d2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 4 08:08:59 2007 +0000
-
- added class def source code to specs.
-
-commit cdfa499ee238671c655800a81b51611704383500
-Author: Mae <mae@unknown>
-Date: Thu Jan 4 07:54:20 2007 +0000
-
- fixed typo in spec still 7 failing specs *GLARES AT DEFILER*
-
-commit 03be9ca7da61363f8f0a02ee951bbafaf297c31b
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 4 07:43:58 2007 +0000
-
- added specs for Module#const_defined?.
-
-commit c511d4c7a75001f2597b13f9fc2e910d2dd4d9a2
-Author: Mae <mae@unknown>
-Date: Thu Jan 4 06:54:07 2007 +0000
-
- changed defined spec to be more dumb and just figure out whether its a true/false evaluation
-
-commit 4d9135f9694e4b692faf6a4c7b8dcd59f79f5069
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 4 06:38:57 2007 +0000
-
- added library spec (beginning) for enumerator. trivial update for comparable specs. added specs for enumerable.
-
-commit 3de6e339526b1402f8995a5acc38fde707ec0695
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Jan 4 00:34:50 2007 +0000
-
- added specs for comparable methods.
-
-commit ea25c6b17533c280e640dc97e3fec1207fb4be7b
-Author: Mae <mae@unknown>
-Date: Wed Jan 3 17:47:09 2007 +0000
-
- almost done with defined? spec -- still need 'yield' and 'zsuper' test cases
- from project dir: SPEC_TARGET=mri spec spec/language/defined_spec.rb
- change SPEC_TARGET to rubinius to test on rubinius
-
-commit b795f6c2dc98952e7fa7231cded9156ade962b18
-Author: Mae <mae@unknown>
-Date: Wed Jan 3 17:25:31 2007 +0000
-
- added incomplete specs for defined? behavior -- more work to be done
-
-commit 25e30e4668f1ef814bfb1182e032449263651590
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 3 17:17:03 2007 +0000
-
- small fix to mri_target to generate reasonable cache soure name. added a couple specs.
-
-commit 3b5bc977ea2a4a3ad42ff83bcab2966459c262c0
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 3 08:51:18 2007 +0000
-
- added object_spec for methods provided by Object, even mixed in ones. added a few specs for basic class, module, exceptions.
-
-commit c4f4dd722658b2a09ae273092744b76e65ce05b2
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Jan 3 02:36:58 2007 +0000
-
- renamed flow_control_spec to expression_spec as these are all covered under heading expressions in pickaxe. run expression spec with mri target and then rubinius target to see an interesting rubinius failure. updated an incorrect string splice spec.
-
-commit ef8aa2f74896944134f5a8884ccc723ca9b472c1
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Jan 2 01:40:16 2007 +0000
-
- separated specs that are shotgun specific methods (e.g. String#prefix?) into spec/shotgun/... fixed wrong specs so that all pass under mri/mir configuration.
-
-commit 8661488b40b9fccccf356889834c6a9162c8bebf
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 22:37:41 2007 +0000
-
- very quick n' dirty implementation of example et al to run specs under mri like under rubinius.
-
-commit 0ebfa43e222ca4794243d36f10c2e429e930f527
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 20:47:13 2007 +0000
-
- added methods for TrueClass and FalseClass, updated specs for each.
-
-commit e9bb50ced8bf997535f0bc9c6deeeffb86c40879
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 20:29:37 2007 +0000
-
- added specs for true, false, nil.
-
-commit c30b0e38b88c686c11c6f7442e027d685d405505
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 18:59:59 2007 +0000
-
- added spec templates for true, false, nil, class, module, enumerable, comparable, flow_control, exception. added specs to various others.
-
-commit b26777261970c213506e444b90412543f39b3c59
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 18:58:37 2007 +0000
-
- added that rubinius target example method takes a default argument to pass strings of code to allow for creating classes, since classes can't be defined in a method body and for now example puts the block code into a method using ruby2ruby.
-
-commit 560c5a1331c76bce07289f1e5950b816fe7c9c24
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Jan 1 01:17:44 2007 +0000
-
- added more string specs.
-
-commit 807864c76b701f6f976f3f2935599ba875fcc10e
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 31 23:13:16 2006 +0000
-
- added more core specs (or templates for specs) to cover existing tests in shotgun-tests.
-
-commit 8f83b600b12722d46b9791b2e2c3a399618474a0
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 31 21:23:07 2006 +0000
-
- removed shotgun/primitives_spec as spec/shotgun should be for shotgun-specific code. created spec/core for ruby core classes. spec/library is now for ruby stdlib classes. added more array specs.
-
-commit 58cc3ce5bd8b84a151b1a6e2334845f268ab894a
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 31 08:58:50 2006 +0000
-
- added specs for class methods of Regexp. added alias Regexp.compile for Regexp.new.
-
-commit 0a5a31bc6ef539eeda3de951ab633f5152d58153
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 31 02:01:34 2006 +0000
-
- added specs for symbol methods. added aliases to symbol for to_i, to_int, and id2name.
-
-commit cdfa28e492b8edfa55b950b06ce05ebb04b64643
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 30 17:27:18 2006 +0000
-
- changed example method for rubinius_target to raise exception if compile fails. added specs for range.
-
-commit 5316e652084b8624828d0a9306f580bfc93184dc
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 29 20:37:46 2006 +0000
-
- added spec files in spec/library for basic types (according to pickaxe book). added specs for all the methods in Regexp. there are many failing specs for a variety of reasons, but the goal is to get a good overview of where work needs to be done. more specs to follow.
-
-commit 06cd5ad6da819f2894996e42f4da70321767c9c7
-Author: Mae <mae@unknown>
-Date: Thu Dec 28 07:36:21 2006 +0000
-
- Added Array expressions gleaned from spec/library/array_spec.rb as proof of concept for rapid compatibility testing
- - A thought occurred to me that the scope for this type of testing might be limited severely to simple compatibility testing
- - Its not very human understandable as a spec -- it just unravels incompatibilities given no hint as to why things are the way they are.
- - It lets the ruby rval speak for itself
- - Is this useful for rubinius?!
-
-commit 1c1fc9335aee4acbcd692c555b0ca194c5301013
-Author: Frederick <frederick@unknown>
-Date: Wed Dec 27 22:46:43 2006 +0000
-
- Fix a bug in the allocation of a string. The underlying storage (byte array) did not have the correct size, leading to a write in a non allocated memory area.
- The rationale is that, the storage are should be able to store the string plus a terminal \0. As we're allocating per block of 4 bytes (a word) we need to get the nearest multiple of 4.
- This patch adds a spec to highlight the bug, and a fix to .. well, fix it ;)
-
-commit cdfdc272b71bbfca23b4c17e5572ebd2b966615e
-Author: Mae <mae@unknown>
-Date: Tue Dec 26 17:52:24 2006 +0000
-
- Added my idea of a sanity check against MRI for compatibility purposes
- - try it out!
- - rake spec:compatibility
- - example compatibility expressions go in spec/compatibility/expressions/*
- - all the expression files are line-separated ruby expressions that return something basic and eval-able
-
-commit f9887648c7f239f8c862158b39f44b2410377204
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 22 19:20:58 2006 +0000
-
- added spec file for String methods.
-
-commit 8178e4478977c81940ac4bdcd8bea608be11708b
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 22 17:14:46 2006 +0000
-
- fixed that ruby2ruby was not generating correct ruby source when a local var was used in a block. changed local var to instance var and it works, converted primitives_spec to new block-style.
-
-commit 8a00080a1edb864af7573e8f9761f65fa1202d07
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 22 06:58:28 2006 +0000
-
- changed array_spec to not use local variables in blocks where possible because rubytoruby is not converting them to ruby source correctly. Array#uniq! fails at the moment. re-added that compile checks code-cache first so specs run faster.
-
-commit 4a199c559eebe73cd21d0997126b799f5d4e2be5
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 22 06:00:21 2006 +0000
-
- converted array_spec.rb to block-style specs, but they still depend on strings to be output. rewrote spec_helper based on nicksieger's example code. some specs are failing due to bugs converting to sexp and back to ruby source.
-
-commit 854bbc3617559a2ceac975d79a57ffa825a5cda6
-Author: Brian Ford <brixen@gmail.com>
-Date: Fri Dec 22 03:34:18 2006 +0000
-
- added spec/targets for specs for 'target' part of host/target spec runner configuration. added mri_target and rubinius_target and specs.
-
-commit db81559c9c914413d2064b4202ec8ce43e503af2
-Author: Brian Ford <brixen@gmail.com>
-Date: Thu Dec 21 05:51:55 2006 +0000
-
- added spec:targets task to run specs for target part of host/target spec configuration. added specs for mri_target and rubinius_target.
-
-commit a243a70bd17ec7e9839b69bb18e63d5d943b6095
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 20 19:02:01 2006 +0000
-
- updated primitives_spec to use example method.
-
-commit 9ce077283dd10c21377add499c5bcc4ea87cfe0f
-Author: Brian Ford <brixen@gmail.com>
-Date: Wed Dec 20 17:11:00 2006 +0000
-
- Changed method from rubinius to example for specs. This is in anticipation of having independent 'host' (system running rspec) and 'target' (system executing spec). Created parallel arrayb_spec that illustrates this with a mri/mri configuration. Also added spec_bhelper that is a *very rough* beginning for having mri/rubinius configuration using block-style specs.
-
-commit a8ad71a0da9e1a866521074743ea1dfcceb596cb
-Author: Wilson Bilkovich <wilson@supremetyrant.com>
-Date: Wed Dec 20 15:39:36 2006 +0000
-
- Applying 'array patch' from Jason Perkins (2006-12-20 8:30 EST)
-
-commit 82b3d880131e7080ebc6b4289b3954d89a988c13
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 19 17:30:21 2006 +0000
-
- added more specs to array_spec. most of these are failing, so there seems to be a lot of Array that needs implementing.
-
-commit c24f0e83b4d446afd541ffefbcb313f199b684ee
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 19 08:24:00 2006 +0000
-
- added specs for Array#* and <<, simplified other specs.
-
-commit 62b0737ce69768a8292bd3d9f13401ec8056f6eb
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 19 07:46:39 2006 +0000
-
- fixed messed up spec for &.
-
-commit 7635389b2abf5c492952a49eb8251d6fb34250c7
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 19 07:40:01 2006 +0000
-
- added spec for Array#&, which is currently unimplemented. updated spec_helper.
-
-commit 42b5e9fc47bcf6bcd403d25795c9bcf07bb5c007
-Author: Brian Ford <brixen@gmail.com>
-Date: Tue Dec 19 06:13:15 2006 +0000
-
- added spec tasks :only to run only spec, :language for high level language conformance spcs, :library for ruby stdlib implementation specs, and :shotgun for specs related to shotgun. rake spec will run all specs and tests. removed spec/spec_suite.rb because all specs can be run from rake. minor updates to spec_helper.
-
-commit da4c42890f4b8163b8d49de64bdb76c16b0e5d1f
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 18 17:41:44 2006 +0000
-
- added shotgun dir under spec for things that relate to shotgun implementation of VM, like the prmitives_spec, while reserving spec/library for general ruby implementation of the std lib.
-
-commit 925cbf9f84f78a48189f7030c205942d266a6f66
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 18 09:45:25 2006 +0000
-
- added Fixnum#% primitive implementation. changed array_spec to use Fixnum#%. fixed test_primitive test for Fixnum#%.
-
-commit 06e50e48a92e3fa7d1fc4d6b681872d08e5aeba3
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 18 09:10:37 2006 +0000
-
- Added Fixnum#% primitive test, spec, cpu/primitive, stub.
-
-commit e0fbcf29f46dde89f65d13c1b6d7601a470cf223
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 18 07:54:02 2006 +0000
-
- all ports of test_array test to array_spec are now passing.
-
-commit c2330c2ff65cfa964d954340fb0eb2507972efd5
-Author: Brian Ford <brixen@gmail.com>
-Date: Mon Dec 18 07:39:55 2006 +0000
-
- updated spec_helper to ensure code-cache dir exists. fixed several failing specs in array_spec by correcting expected value.
-
-commit 81cc03c6f7ce499da563543f00d273d3a9c3a184
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 17 06:27:15 2006 +0000
-
- Ported the rest of test_array.rb tests to specs. Several of these specs are not passing but ported them all to illustrate behavior of specs.
-
-commit b4cb073931f403119a5ed9b63a2c915612a9c46f
-Author: Brian Ford <brixen@gmail.com>
-Date: Sun Dec 17 04:42:55 2006 +0000
-
- spec/spec_helper.rb rubinius method is a very naive port of shotgun-tests/helper.rb run_code method. spec/library/array_spec.rb is several ports of the tests in shotgun-tests/test_array.rb, which is testing /kernel/array.rb. In other words, you can now create specs that run under RSpec (which is running under MRI 1.8.x) that exercises the rubinius vm, shotgun, and the stdlib that is being written in ruby. Confused? Read the source, Luke. :)
-
-commit 1b37cd1ee800060fb215a52d2902c3f4b778a656
-Author: Brian Ford <brixen@gmail.com>
-Date: Sat Dec 16 07:55:41 2006 +0000
-
- Added spec dir with spec_suite.rb and spec_helper.rb provided by nullstyle.
diff --git a/spec/ruby/CONTRIBUTING.md b/spec/ruby/CONTRIBUTING.md
deleted file mode 100644
index fc88475970..0000000000
--- a/spec/ruby/CONTRIBUTING.md
+++ /dev/null
@@ -1,171 +0,0 @@
-Contributions are much appreciated.
-Please open a pull request or add an issue to discuss what you intend to work on.
-If the pull requests passes the CI and conforms to the existing style of specs, it will be merged.
-
-### File organization
-
-Spec are grouped in 5 separate top-level groups:
-
-* `command_line`: for the ruby executable command-line flags (`-v`, `-e`, etc)
-* `language`: for the language keywords and syntax constructs (`if`, `def`, `A::B`, etc)
-* `core`: for the core methods (`Fixnum#+`, `String#upcase`, no need to require anything)
-* `library`: for the standard libraries methods (`CSV.new`, `YAML.parse`, need to require the stdlib)
-* `optional/capi`: for functions available to the Ruby C-extension API
-
-The exact file for methods is decided by the `#owner` of a method, for instance for `#group_by`:
-```ruby
-> [].method(:group_by)
-=> #<Method: Array(Enumerable)#group_by>
-> [].method(:group_by).owner
-=> Enumerable
-```
-Which should therefore be specified in `core/enumerable/group_by_spec.rb`.
-
-### MkSpec - a tool to generate the spec structure
-
-If you want to create new specs, you should use `mkspec`, part of [MSpec](http://github.com/ruby/mspec).
-
- $ ../mspec/bin/mkspec -h
-
-#### Creating files for unspecified modules or classes
-
-For instance, to create specs for `forwardable`:
-
- $ ../mspec/bin/mkspec -b library -rforwardable -c Forwardable
-
-Specify `core` or `library` as the `base`.
-
-#### Finding unspecified core methods
-
-This is very easy, just run the command below in your `spec` directory.
-`ruby` must be a recent version of MRI.
-
- $ ruby --disable-gem ../mspec/bin/mkspec
-
-You might also want to search for:
-
- it "needs to be reviewed for spec completeness"
-
-which indicates the file was generated but the method unspecified.
-
-### Matchers and expectations
-
-Here is a list of frequently-used matchers, which should be enough for most specs.
-There are a few extra specific matchers used in the couple specs that need it.
-
-```ruby
-(1 + 2).should == 3 # Calls #==
-(1 + 2).should_not == 5
-
-File.should equal(File) # Calls #equal? (tests identity)
-(1 + 2).should eql(3) # Calls #eql? (Hash equality)
-
-1.should < 2
-2.should <= 2
-3.should >= 3
-4.should > 3
-
-"Hello".should =~ /l{2}/ # Calls #=~ (Regexp match)
-
-[].should be_empty # Calls #empty?
-[1,2,3].should include(2) # Calls #include?
-
-(0.1 + 0.2).should be_close(0.3, TOLERANCE) # (0.2-0.1).abs < TOLERANCE
-(0.0/0.0).should be_nan # Calls Float#nan?
-(1.0/0.0).should be_positive_infinity
-(-1.0/0.0).should be_negative_infinity
-
-3.14.should be_an_instance_of(Float) # Calls #instance_of?
-3.14.should be_kind_of(Numeric) # Calls #is_a?
-Numeric.should be_ancestor_of(Float) # Float.ancestors.include?(Numeric)
-
-3.14.should respond_to(:to_i) # Calls #respond_to?
-Fixnum.should have_instance_method(:+)
-Array.should have_method(:new)
-# Also have_constant, have_private_instance_method, have_singleton_method, etc
-
--> {
- raise "oops"
-}.should raise_error(RuntimeError, /oops/)
-
-# To avoid! Instead, use an expectation testing what the code in the lambda does.
-# If an exception is raised, it will fail the example anyway.
--> { ... }.should_not raise_error
-
--> {
- Fixnum
-}.should complain(/constant ::Fixnum is deprecated/) # Expect a warning
-```
-
-### Guards
-
-Different guards are available as defined by mspec.
-Here is a list of the most commonly-used guards:
-
-```ruby
-ruby_version_is ""..."2.4" do
- # Specs for RUBY_VERSION < 2.4
-end
-
-ruby_version_is "2.4" do
- # Specs for RUBY_VERSION >= 2.4
-end
-
-platform_is :windows do
- # Specs only valid on Windows
-end
-
-platform_is_not :windows do
- # Specs valid on platforms other than Windows
-end
-
-platform_is :linux, :darwin do # OR
-end
-
-platform_is_not :linux, :darwin do # Not Linux and not Darwin
-end
-
-platform_is wordsize: 64 do
- # 64-bit platform
-end
-
-big_endian do
- # Big-endian platform
-end
-
-# In case there is a bug in MRI but the expected behavior is obvious
-# First file a bug at https://bugs.ruby-lang.org/
-# It is better to use a ruby_version_is guard if there was a release with the fix
-ruby_bug '#13669', ''...'2.5' do
- it "works like this" do
- # Specify the expected behavior here, not the bug
- end
-end
-
-
-# Combining guards
-guard -> { platform_is :windows and ruby_version_is ""..."2.3" } do
- # Windows and RUBY_VERSION < 2.3
-end
-
-guard_not -> { platform_is :windows and ruby_version_is ""..."2.3" } do
- # The opposite
-end
-
-# Custom guard
-max_uint = (1 << 32) - 1
-guard -> { max_uint <= fixnum_max } do
-end
-```
-
-In general, the usage of guards should be minimized as possible.
-
-There are no guards to define implementation-specific behavior because
-the Ruby Spec Suite defines common behavior and not implementation details.
-Use the implementation test suite for these.
-
-If an implementation does not support some feature, simply tag the related specs as failing instead.
-
-### Style
-
-Do not leave any trailing space and respect the existing style.
diff --git a/spec/ruby/LICENSE b/spec/ruby/LICENSE
deleted file mode 100644
index d581dd1c9f..0000000000
--- a/spec/ruby/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2008 Engine Yard, Inc. All rights reserved.
-
-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/spec/ruby/README.md b/spec/ruby/README.md
deleted file mode 100644
index 9c13ede75c..0000000000
--- a/spec/ruby/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-# The Ruby Spec Suite
-
-[![Build Status](https://travis-ci.org/ruby/spec.svg)](https://travis-ci.org/ruby/spec)
-[![Build Status](https://ci.appveyor.com/api/projects/status/1gs6f399320o44b1?svg=true)](https://ci.appveyor.com/project/eregon/spec-x948i)
-[![Gitter](https://badges.gitter.im/ruby/spec.svg)](https://gitter.im/ruby/spec)
-
-The Ruby Spec Suite is a test suite for the behavior of the Ruby programming language.
-
-It is not a standardized specification like the ISO one, and does not aim to become one.
-Instead, it is a practical tool to describe and test the behavior of Ruby with code.
-
-Every example code has a textual description, which presents several advantages:
-
-* It is easier to understand the intent of the author
-* It documents how recent versions of Ruby should behave
-* It helps Ruby implementations to agree on a common behavior
-
-The specs are written with syntax similar to RSpec 2.
-They are run with MSpec, the purpose-built framework for running the Ruby Spec Suite.
-For more information, see the [MSpec](http://github.com/ruby/mspec) project.
-
-The specs describe the [language syntax](language/), the [core library](core/), the [standard library](library/), the [C API for extensions](optional/capi) and the [command line flags](command_line/).
-The language specs are grouped by keyword while the core and standard library specs are grouped by class and method.
-
-ruby/spec is known to be tested in these implementations for every commit:
-* [MRI](http://rubyci.org/) on 30 platforms and 4 versions
-* [JRuby](https://github.com/jruby/jruby/tree/master/spec/ruby) on Travis for both 1.7 and 9.x
-* [TruffleRuby](https://github.com/graalvm/truffleruby) on Travis
-* [Opal](https://github.com/opal/opal/tree/master/spec) on Travis
-
-ruby/spec describes the behavior of Ruby 2.2 and more recent Ruby versions.
-More precisely, every latest stable MRI release [passes](https://rubyci.org/) all specs of ruby/spec
-(latest 2.2.x, 2.3.x, 2.4.x, etc).
-
-For older specs try these commits:
-* Ruby 2.0.0-p647 - [Suite](https://github.com/ruby/spec/commit/245862558761d5abc676843ef74f86c9bcc8ea8d) using [MSpec](https://github.com/ruby/mspec/commit/f90efa068791064f955de7a843e96e2d7d3041c2) (may encounter 2 failures)
-* Ruby 2.1.9 - [Suite](https://github.com/ruby/spec/commit/f029e65241374386077ac500add557ae65069b55) using [MSpec](https://github.com/ruby/mspec/commit/55568ea3918c6380e64db8c567d732fa5781efed)
-
-### Running the specs
-
-First, clone this repository:
-
- $ git clone https://github.com/ruby/spec.git
-
-Then move to it:
-
- $ cd spec
-
-Clone [MSpec](http://github.com/ruby/mspec):
-
- $ git clone https://github.com/ruby/mspec.git ../mspec
-
-And run the spec suite:
-
- $ ../mspec/bin/mspec
-
-This will execute all the specs using the executable named `ruby` on your current PATH.
-
-### Running Specs with a Specific Ruby Implementation
-
-Use the `-t` option to specify the Ruby implementation with which to run the specs.
-The argument may be a full path to the Ruby binary.
-
- $ ../mspec/bin/mspec -t /path/to/some/bin/ruby
-
-### Running Selected Specs
-
-To run a single spec file, pass the filename to `mspec`:
-
- $ ../mspec/bin/mspec core/kernel/kind_of_spec.rb
-
-You can also pass a directory, in which case all specs in that directories will be run:
-
- $ ../mspec/bin/mspec core/kernel
-
-Finally, you can also run them per group as defined in `default.mspec`.
-The following command will run all language specs:
-
- $ ../mspec/bin/mspec :language
-
-In similar fashion, the following commands run the respective specs:
-
- $ ../mspec/bin/mspec :core
- $ ../mspec/bin/mspec :library
- $ ../mspec/bin/mspec :capi
-
-### Contributing
-
-See [CONTRIBUTING.md](https://github.com/ruby/spec/blob/master/CONTRIBUTING.md).
-
-### History and RubySpec
-
-This project was originally born from [Rubinius](https://github.com/rubinius/rubinius) tests being converted to the spec style.
-These specs were later extracted to their own project, RubySpec, with a specific vision and principles.
-At the end of 2014, Brian Shirai, the creator of RubySpec, decided to [end RubySpec](http://rubinius.com/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/).
-A couple months later, the different repositories were merged and [the project was revived](http://eregon.github.io/rubyspec/2015/07/29/rubyspec-is-reborn.html).
-On 12 January 2016, the name was changed to "The Ruby Spec Suite" for clarity and to let the RubySpec ideology rest in peace.
diff --git a/spec/ruby/TODO b/spec/ruby/TODO
deleted file mode 100644
index f81f070d71..0000000000
--- a/spec/ruby/TODO
+++ /dev/null
@@ -1,8 +0,0 @@
-* Decide a way to test methods that are only visible given a specific
- command-line option. For example, Kernel#gsub with -n/-p on 1.9.
-* Look at automating discovery of guarded bugs which have been fixed.
-* Use mocks for all Math functions that coerce with #to_f; currently a fixture
- is used.
-* investigate slow specs (run with -fp) and make them faster.
-* restore some caller specs from 642bf529
-* restore refinements specs and update. See 56c5528f and f20a62e8.
diff --git a/spec/ruby/appveyor.yml b/spec/ruby/appveyor.yml
deleted file mode 100644
index 8ee5abd8b4..0000000000
--- a/spec/ruby/appveyor.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-version: "{build}"
-clone_depth: 5
-init:
- # To avoid duplicated executables in PATH, see https://github.com/ruby/spec/pull/468
- - set PATH=C:\ruby%RUBY_VERSION%\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Program Files;C:\Windows
- # Loads trunk build and updates MSYS2 / MinGW to most recent gcc compiler
- - if %ruby_version%==_trunk (
- appveyor DownloadFile https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z -FileName C:\ruby_trunk.7z &
- 7z x C:\ruby_trunk.7z -oC:\ruby_trunk & C:\ruby_trunk\trunk_msys2.cmd)
-environment:
- matrix:
- - RUBY_VERSION: 23-x64
- - RUBY_VERSION: 24-x64
- - RUBY_VERSION: _trunk # So the folder name is ruby_trunk
-install:
- - git clone https://github.com/ruby/mspec.git ../mspec
-build: off
-test_script:
- - SET CHECK_LEAKS=true
- - ../mspec/bin/mspec -rdevkit -ff
-on_finish:
- - ruby -v
-matrix:
- allow_failures:
- - ruby_version: _trunk
-branches:
- only:
- - master
- - /^try/
diff --git a/spec/ruby/command_line/dash_a_spec.rb b/spec/ruby/command_line/dash_a_spec.rb
deleted file mode 100644
index 65f79ec208..0000000000
--- a/spec/ruby/command_line/dash_a_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-describe "The -a command line option" do
- before :each do
- @names = fixture __FILE__, "full_names.txt"
- end
-
- it "runs the code in loop conditional on Kernel.gets()" do
- ruby_exe("puts $F.last", options: "-n -a", escape: true,
- args: " < #{@names}").should ==
- "jones\nfield\ngrey\n"
- end
-
- it "sets $-a" do
- ruby_exe("puts $-a", options: "-n -a", escape: true,
- args: " < #{@names}").should ==
- "true\ntrue\ntrue\n"
- end
-end
diff --git a/spec/ruby/command_line/dash_c_spec.rb b/spec/ruby/command_line/dash_c_spec.rb
deleted file mode 100644
index 375d945a07..0000000000
--- a/spec/ruby/command_line/dash_c_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -c command line option" do
- it "checks syntax in given file" do
- ruby_exe(nil, args: "-c #{__FILE__}").chomp.should == "Syntax OK"
- end
-
- it "checks syntax in -e strings" do
- ruby_exe(nil, args: "-c -e 'puts 1' -e 'hello world'").chomp.should == "Syntax OK"
- end
-
- #Also needs spec for reading from STDIN
-end
diff --git a/spec/ruby/command_line/dash_d_spec.rb b/spec/ruby/command_line/dash_d_spec.rb
deleted file mode 100644
index 009a14e16c..0000000000
--- a/spec/ruby/command_line/dash_d_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -d command line option" do
- before :each do
- @script = fixture __FILE__, "debug.rb"
- end
-
- it "sets $DEBUG to true" do
- ruby_exe(@script, options: "-d",
- args: "0 2> #{File::NULL}").chomp.should == "$DEBUG true"
- end
-
- it "sets $VERBOSE to true" do
- ruby_exe(@script, options: "-d",
- args: "1 2> #{File::NULL}").chomp.should == "$VERBOSE true"
- end
-
- it "sets $-d to true" do
- ruby_exe(@script, options: "-d",
- args: "2 2> #{File::NULL}").chomp.should == "$-d true"
- end
-end
diff --git a/spec/ruby/command_line/dash_e_spec.rb b/spec/ruby/command_line/dash_e_spec.rb
deleted file mode 100644
index 3435e78e29..0000000000
--- a/spec/ruby/command_line/dash_e_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -e command line option" do
- it "evaluates the given string" do
- ruby_exe("puts 'foo'").chomp.should == "foo"
- end
-
- it "joins multiple strings with newlines" do
- ruby_exe(nil, args: %Q{-e "puts 'hello" -e "world'" 2>&1}).chomp.should == "hello\nworld"
- end
-
- it "uses 'main' as self" do
- ruby_exe("puts self", escape: false).chomp.should == "main"
- end
-
- it "uses '-e' as file" do
- ruby_exe("puts __FILE__", escape: false).chomp.should == "-e"
- end
-
- it "uses '-e' in $0" do
- system(*ruby_exe, '-e', 'exit $0 == "-e"').should == true
- end
-
- #needs to test return => LocalJumpError
-
- describe "with -n and a Fixnum range" do
- before :each do
- @script = "-ne 'print if %s' #{fixture(__FILE__, "conditional_range.txt")}"
- end
-
- it "mimics an awk conditional by comparing an inclusive-end range with $." do
- ruby_exe(nil, args: (@script % "2..3")).should == "2\n3\n"
- ruby_exe(nil, args: (@script % "2..2")).should == "2\n"
- end
-
- it "mimics a sed conditional by comparing an exclusive-end range with $." do
- ruby_exe(nil, args: (@script % "2...3")).should == "2\n3\n"
- ruby_exe(nil, args: (@script % "2...2")).should == "2\n3\n4\n5\n"
- end
- end
-end
diff --git a/spec/ruby/command_line/dash_n_spec.rb b/spec/ruby/command_line/dash_n_spec.rb
deleted file mode 100644
index f4dd9f1851..0000000000
--- a/spec/ruby/command_line/dash_n_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-describe "The -n command line option" do
- before :each do
- @names = fixture __FILE__, "names.txt"
- end
-
- it "runs the code in loop conditional on Kernel.gets()" do
- ruby_exe("puts $_", options: "-n", escape: true,
- args: " < #{@names}").should ==
- "alice\nbob\njames\n"
- end
-
- it "only evaluates BEGIN blocks once" do
- ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n", escape: true,
- args: " < #{@names}").should ==
- "hi\nalice\nbob\njames\n"
- end
-
- it "only evaluates END blocks once" do
- ruby_exe("puts $_; END {puts \"bye\"}", options: "-n", escape: true,
- args: " < #{@names}").should ==
- "alice\nbob\njames\nbye\n"
- end
-
- it "allows summing over a whole file" do
- script = <<-script
- BEGIN { $total = 0 }
- $total += 1
- END { puts $total }
- script
- ruby_exe(script, options: "-n", escape: true,
- args: " < #{@names}").should ==
- "3\n"
- end
-end
diff --git a/spec/ruby/command_line/dash_p_spec.rb b/spec/ruby/command_line/dash_p_spec.rb
deleted file mode 100644
index 67562b5bc3..0000000000
--- a/spec/ruby/command_line/dash_p_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-describe "The -p command line option" do
- before :each do
- @names = fixture __FILE__, "names.txt"
- end
-
- it "runs the code in loop conditional on Kernel.gets() and prints $_" do
- ruby_exe("$_ = $_.upcase", options: "-p", escape: true,
- args: " < #{@names}").should ==
- "ALICE\nBOB\nJAMES\n"
- end
-
- it "sets $-p" do
- ruby_exe("$_ = $-p", options: "-p", escape: true,
- args: " < #{@names}").should ==
- "truetruetrue"
- end
-end
diff --git a/spec/ruby/command_line/dash_r_spec.rb b/spec/ruby/command_line/dash_r_spec.rb
deleted file mode 100644
index 3d3abcf0b7..0000000000
--- a/spec/ruby/command_line/dash_r_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -r command line option" do
- before :each do
- @script = fixture __FILE__, "require.rb"
- @test_file = fixture __FILE__, "test_file"
- end
-
- it "requires the specified file" do
- result = ruby_exe(@script, options: "-r #{@test_file}")
- result.should include(@test_file + ".rb")
- end
-end
diff --git a/spec/ruby/command_line/dash_s_spec.rb b/spec/ruby/command_line/dash_s_spec.rb
deleted file mode 100644
index 70e41208e0..0000000000
--- a/spec/ruby/command_line/dash_s_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -s command line option" do
- describe "when using -- to stop parsing" do
- it "sets the value to true without an explicit value" do
- ruby_exe(nil, options: "-s -e 'p $n'",
- args: "-- -n").chomp.should == "true"
- end
-
- it "parses single letter args into globals" do
- ruby_exe(nil, options: "-s -e 'puts $n'",
- args: "-- -n=blah").chomp.should == "blah"
- end
-
- it "parses long args into globals" do
- ruby_exe(nil, options: "-s -e 'puts $_name'",
- args: "-- --name=blah").chomp.should == "blah"
- end
-
- it "converts extra dashes into underscores" do
- ruby_exe(nil, options: "-s -e 'puts $___name__test__'",
- args: "-- ----name--test--=blah").chomp.should == "blah"
- end
- end
-
- describe "when running a script" do
- before :all do
- @script = fixture __FILE__, "dash_s_script.rb"
- end
-
- it "sets the value to true without an explicit value" do
- ruby_exe(@script, options: "-s",
- args: "-n 0").chomp.should == "true"
- end
-
- it "parses single letter args into globals" do
- ruby_exe(@script, options: "-s",
- args: "-n=blah 1").chomp.should == "blah"
- end
-
- it "parses long args into globals" do
- ruby_exe(@script, options: "-s",
- args: "--name=blah 2").chomp.should == "blah"
- end
-
- it "converts extra dashes into underscores" do
- ruby_exe(@script, options: "-s",
- args: "----name--test--=blah 3").chomp.should == "blah"
- end
-
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_c_spec.rb b/spec/ruby/command_line/dash_upper_c_spec.rb
deleted file mode 100644
index e8a54b01c1..0000000000
--- a/spec/ruby/command_line/dash_upper_c_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe 'The -C command line option' do
- before :all do
- @script = fixture(__FILE__, 'dash_upper_c_script.rb')
- @tempdir = File.dirname(@script)
- end
-
- it 'changes the PWD when using a file' do
- output = ruby_exe(@script, options: "-C #{@tempdir}")
- output.should == @tempdir
- end
-
- it 'changes the PWD when using -e' do
- output = ruby_exe(nil, options: "-C #{@tempdir} -e 'print Dir.pwd'")
- output.should == @tempdir
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_e_spec.rb b/spec/ruby/command_line/dash_upper_e_spec.rb
deleted file mode 100644
index 716f1304b7..0000000000
--- a/spec/ruby/command_line/dash_upper_e_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-describe "ruby -E" do
- it "raises a RuntimeError if used with -U" do
- ruby_exe("p 1",
- options: '-Eascii:ascii -U',
- args: '2>&1').should =~ /RuntimeError/
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_f_spec.rb b/spec/ruby/command_line/dash_upper_f_spec.rb
deleted file mode 100644
index 020968b1f9..0000000000
--- a/spec/ruby/command_line/dash_upper_f_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-describe "the -F command line option" do
- before :each do
- @passwd = fixture __FILE__, "passwd_file.txt"
- end
-
- it "specifies the field separator pattern for -a" do
- ruby_exe("puts $F[0]", options: "-naF:", escape: true,
- args: " < #{@passwd}").should ==
- "nobody\nroot\ndaemon\n"
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_i_spec.rb b/spec/ruby/command_line/dash_upper_i_spec.rb
deleted file mode 100644
index 0a00059949..0000000000
--- a/spec/ruby/command_line/dash_upper_i_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The -I command line option" do
- before :each do
- @script = fixture __FILE__, "loadpath.rb"
- end
-
- it "adds the path to the load path ($:)" do
- ruby_exe(@script, options: "-I fixtures").should include("fixtures")
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_k_spec.rb b/spec/ruby/command_line/dash_upper_k_spec.rb
deleted file mode 100644
index 3c3b9fa4d3..0000000000
--- a/spec/ruby/command_line/dash_upper_k_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-describe 'The -K command line option sets __ENCODING__' do
- it "to Encoding::ASCII_8BIT with -Ka" do
- ruby_exe("print __ENCODING__", options: '-Ka').should == Encoding::ASCII_8BIT.to_s
- end
-
- it "to Encoding::ASCII_8BIT with -KA" do
- ruby_exe("print __ENCODING__", options: '-KA').should == Encoding::ASCII_8BIT.to_s
- end
-
- it "to Encoding::EUC_JP with -Ke" do
- ruby_exe("print __ENCODING__", options: '-Ke').should == Encoding::EUC_JP.to_s
- end
-
- it "to Encoding::EUC_JP with -KE" do
- ruby_exe("print __ENCODING__", options: '-KE').should == Encoding::EUC_JP.to_s
- end
-
- it "to Encoding::UTF_8 with -Ku" do
- ruby_exe("print __ENCODING__", options: '-Ku').should == Encoding::UTF_8.to_s
- end
-
- it "to Encoding::UTF_8 with -KU" do
- ruby_exe("print __ENCODING__", options: '-KU').should == Encoding::UTF_8.to_s
- end
-
- it "to Encoding::Windows_31J with -Ks" do
- ruby_exe("print __ENCODING__", options: '-Ks').should == Encoding::Windows_31J.to_s
- end
-
- it "to Encoding::Windows_31J with -KS" do
- ruby_exe("print __ENCODING__", options: '-KS').should == Encoding::Windows_31J.to_s
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_s_spec.rb b/spec/ruby/command_line/dash_upper_s_spec.rb
deleted file mode 100644
index 2e293e9a62..0000000000
--- a/spec/ruby/command_line/dash_upper_s_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe 'The -S command line option' do
- before :each do
- @path = [ENV['PATH'], fixture(__FILE__, "bin")].join(':')
- end
-
- platform_is_not :windows do
- # On VirtualBox shared directory (vboxsf) all files are world writable
- # and MRI shows warning when including world writable path in ENV['PATH'].
- # This is why we are using /success$/ matching in the following cases.
-
- it "runs launcher found in PATH, but only code after the first /\#!.*ruby.*/-ish line in target file" do
- result = ruby_exe(nil, options: '-S hybrid_launcher.sh', env: { 'PATH' => @path }, args: '2>&1')
- result.should =~ /success$/
- end
-
- it "runs launcher found in PATH" do
- result = ruby_exe(nil, options: '-S launcher.rb', env: { 'PATH' => @path }, args: '2>&1')
- result.should =~ /success$/
- end
-
- it "runs launcher found in PATH and sets the exit status to 1 if it fails" do
- result = ruby_exe(nil, options: '-S dash_s_fail', env: { 'PATH' => @path }, args: '2>&1')
- result.should =~ /\bdie\b/
- $?.exitstatus.should == 1
- end
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_u_spec.rb b/spec/ruby/command_line/dash_upper_u_spec.rb
deleted file mode 100644
index 6cd52a3647..0000000000
--- a/spec/ruby/command_line/dash_upper_u_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-describe "ruby -U" do
- it "sets Encoding.default_internal to UTF-8" do
- ruby_exe('print Encoding.default_internal.name',
- options: '-U').should == 'UTF-8'
- end
-
- it "does nothing different if specified multiple times" do
- ruby_exe('print Encoding.default_internal.name',
- options: '-U -U').should == 'UTF-8'
- end
-
- it "is overruled by Encoding.default_internal=" do
- ruby_exe('Encoding.default_internal="ascii"; print Encoding.default_internal.name',
- options: '-U').should == 'US-ASCII'
- end
-
- it "does not affect the default external encoding" do
- ruby_exe('Encoding.default_external="ascii"; print Encoding.default_external.name',
- options: '-U').should == 'US-ASCII'
- end
-
- it "does not affect the source encoding" do
- ruby_exe("print __ENCODING__.name",
- options: '-U -KE').should == 'EUC-JP'
- ruby_exe("print __ENCODING__.name",
- options: '-KE -U').should == 'EUC-JP'
- end
-
- # I assume IO redirection will break on Windows...
- it "raises a RuntimeError if used with -Eext:int" do
- ruby_exe("p 1",
- options: '-U -Eascii:ascii',
- args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError if used with -E:int" do
- ruby_exe("p 1",
- options: '-U -E:ascii',
- args: '2>&1').should =~ /RuntimeError/
- end
-end
diff --git a/spec/ruby/command_line/dash_upper_w_spec.rb b/spec/ruby/command_line/dash_upper_w_spec.rb
deleted file mode 100644
index 4e517a422a..0000000000
--- a/spec/ruby/command_line/dash_upper_w_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-require File.expand_path('../shared/verbose', __FILE__)
-
-describe "The -W command line option" do
- before :each do
- @script = fixture __FILE__, "verbose.rb"
- end
-
- it "with 0 sets $VERBOSE to nil" do
- ruby_exe(@script, options: "-W0").chomp.should == "nil"
- end
-
- it "with 1 sets $VERBOSE to false" do
- ruby_exe(@script, options: "-W1").chomp.should == "false"
- end
-end
-
-describe "The -W command line option with 2" do
- it_behaves_like :command_line_verbose, "-W2"
-end
diff --git a/spec/ruby/command_line/dash_v_spec.rb b/spec/ruby/command_line/dash_v_spec.rb
deleted file mode 100644
index 2ee9099419..0000000000
--- a/spec/ruby/command_line/dash_v_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-require File.expand_path('../shared/verbose', __FILE__)
-
-describe "The -v command line option" do
- it_behaves_like :command_line_verbose, "-v"
-
- describe "when used alone" do
- it "prints version and ends" do
- ruby_exe(nil, args: '-v').include?(RUBY_DESCRIPTION).should == true
- end
- end
-end
diff --git a/spec/ruby/command_line/dash_w_spec.rb b/spec/ruby/command_line/dash_w_spec.rb
deleted file mode 100644
index bb038cb10c..0000000000
--- a/spec/ruby/command_line/dash_w_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-require File.expand_path('../shared/verbose', __FILE__)
-
-describe "The -w command line option" do
- it_behaves_like :command_line_verbose, "-w"
-end
diff --git a/spec/ruby/command_line/dash_x_spec.rb b/spec/ruby/command_line/dash_x_spec.rb
deleted file mode 100644
index a5306b4f75..0000000000
--- a/spec/ruby/command_line/dash_x_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-describe "The -x command line option" do
- it "runs code after the first /\#!.*ruby.*/-ish line in target file" do
- embedded_ruby = fixture __FILE__, "bin/embedded_ruby.txt"
- result = ruby_exe(embedded_ruby, options: '-x')
- result.should == "success\n"
- end
-
- it "fails when /\#!.*ruby.*/-ish line in target file is not found" do
- bad_embedded_ruby = fixture __FILE__, "bin/bad_embedded_ruby.txt"
- result = ruby_exe(bad_embedded_ruby, options: '-x', args: '2>&1')
- result.should include "no Ruby script found in input"
- end
-
- it "behaves as -x was set when non-ruby shebang is encountered on first line" do
- embedded_ruby = fixture __FILE__, "bin/hybrid_launcher.sh"
- result = ruby_exe(embedded_ruby)
- result.should == "success\n"
- end
-
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/ruby/command_line/error_message_spec.rb b/spec/ruby/command_line/error_message_spec.rb
deleted file mode 100644
index 6212452739..0000000000
--- a/spec/ruby/command_line/error_message_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The error message caused by an exception" do
- it "is not printed to stdout" do
- out = ruby_exe("this_does_not_exist", args: "2> #{File::NULL}")
- out.chomp.empty?.should == true
-
- out = ruby_exe("end #syntax error", args: "2> #{File::NULL}")
- out.chomp.empty?.should == true
- end
-end
diff --git a/spec/ruby/command_line/fixtures/bad_syntax.rb b/spec/ruby/command_line/fixtures/bad_syntax.rb
deleted file mode 100644
index e7b8c7a357..0000000000
--- a/spec/ruby/command_line/fixtures/bad_syntax.rb
+++ /dev/null
@@ -1 +0,0 @@
-f {
diff --git a/spec/ruby/command_line/fixtures/bin/bad_embedded_ruby.txt b/spec/ruby/command_line/fixtures/bin/bad_embedded_ruby.txt
deleted file mode 100644
index a2b7ad085f..0000000000
--- a/spec/ruby/command_line/fixtures/bin/bad_embedded_ruby.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-@@@This line is not value Ruby
-#!rub_y
-puts 'success'
diff --git a/spec/ruby/command_line/fixtures/bin/dash_s_fail b/spec/ruby/command_line/fixtures/bin/dash_s_fail
deleted file mode 100644
index 70c1b8759c..0000000000
--- a/spec/ruby/command_line/fixtures/bin/dash_s_fail
+++ /dev/null
@@ -1 +0,0 @@
-raise 'die'
diff --git a/spec/ruby/command_line/fixtures/bin/embedded_ruby.txt b/spec/ruby/command_line/fixtures/bin/embedded_ruby.txt
deleted file mode 100644
index c556bf0b71..0000000000
--- a/spec/ruby/command_line/fixtures/bin/embedded_ruby.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-@@@This line is not value Ruby
-#!ruby
-puts 'success' \ No newline at end of file
diff --git a/spec/ruby/command_line/fixtures/bin/hybrid_launcher.sh b/spec/ruby/command_line/fixtures/bin/hybrid_launcher.sh
deleted file mode 100644
index 0eede2a99f..0000000000
--- a/spec/ruby/command_line/fixtures/bin/hybrid_launcher.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-exec somehow this file
-#!ruby
-puts 'success'
diff --git a/spec/ruby/command_line/fixtures/bin/launcher.rb b/spec/ruby/command_line/fixtures/bin/launcher.rb
deleted file mode 100644
index 92a0ee2b49..0000000000
--- a/spec/ruby/command_line/fixtures/bin/launcher.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-#!ruby
-puts 'success'
diff --git a/spec/ruby/command_line/fixtures/conditional_range.txt b/spec/ruby/command_line/fixtures/conditional_range.txt
deleted file mode 100644
index 8a1218a102..0000000000
--- a/spec/ruby/command_line/fixtures/conditional_range.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-1
-2
-3
-4
-5
diff --git a/spec/ruby/command_line/fixtures/dash_s_script.rb b/spec/ruby/command_line/fixtures/dash_s_script.rb
deleted file mode 100644
index 500eccbb84..0000000000
--- a/spec/ruby/command_line/fixtures/dash_s_script.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-which = ARGV.shift.to_i
-
-case which
-when 0
- p $n
-when 1
- puts $n
-when 2
- puts $_name
-when 3
- puts $___name__test__
-end
diff --git a/spec/ruby/command_line/fixtures/dash_upper_c_script.rb b/spec/ruby/command_line/fixtures/dash_upper_c_script.rb
deleted file mode 100644
index abe244705f..0000000000
--- a/spec/ruby/command_line/fixtures/dash_upper_c_script.rb
+++ /dev/null
@@ -1 +0,0 @@
-print Dir.pwd
diff --git a/spec/ruby/command_line/fixtures/debug.rb b/spec/ruby/command_line/fixtures/debug.rb
deleted file mode 100644
index 2d84c5faf6..0000000000
--- a/spec/ruby/command_line/fixtures/debug.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-which = ARGV.first.to_i
-
-case which
-when 0
- puts "$DEBUG #{$DEBUG}"
-when 1
- puts "$VERBOSE #{$VERBOSE}"
-when 2
- puts "$-d #{$-d}"
-end
diff --git a/spec/ruby/command_line/fixtures/debug_info.rb b/spec/ruby/command_line/fixtures/debug_info.rb
deleted file mode 100644
index ee607910c0..0000000000
--- a/spec/ruby/command_line/fixtures/debug_info.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-a = 'string'
-b = a
-c = b
-d = c
-e = d
-begin
- a << 'new part'
-rescue Exception => e
- print e.message
-end
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_across_files.rb b/spec/ruby/command_line/fixtures/freeze_flag_across_files.rb
deleted file mode 100644
index b258249f3a..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_across_files.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require_relative 'freeze_flag_required'
-
-p "abc".object_id == $second_literal_id
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_across_files_diff_enc.rb b/spec/ruby/command_line/fixtures/freeze_flag_across_files_diff_enc.rb
deleted file mode 100644
index e9f045e9ea..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_across_files_diff_enc.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require_relative 'freeze_flag_required_diff_enc'
-
-p "abc".object_id != $second_literal_id
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_one_literal.rb b/spec/ruby/command_line/fixtures/freeze_flag_one_literal.rb
deleted file mode 100644
index 3718899d61..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_one_literal.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ids = Array.new(2) { "abc".object_id }
-p ids.first == ids.last
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_required.rb b/spec/ruby/command_line/fixtures/freeze_flag_required.rb
deleted file mode 100644
index e09232a5f4..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_required.rb
+++ /dev/null
@@ -1 +0,0 @@
-$second_literal_id = "abc".object_id
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_required_diff_enc.rb b/spec/ruby/command_line/fixtures/freeze_flag_required_diff_enc.rb
deleted file mode 100644
index fa348d59e7..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_required_diff_enc.rb
+++ /dev/null
Binary files differ
diff --git a/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb b/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb
deleted file mode 100644
index 074092c9d9..0000000000
--- a/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb
+++ /dev/null
@@ -1 +0,0 @@
-p "abc".object_id == "abc".object_id
diff --git a/spec/ruby/command_line/fixtures/full_names.txt b/spec/ruby/command_line/fixtures/full_names.txt
deleted file mode 100644
index 602a20b9dd..0000000000
--- a/spec/ruby/command_line/fixtures/full_names.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-alice jones
-bob field
-james grey
diff --git a/spec/ruby/command_line/fixtures/loadpath.rb b/spec/ruby/command_line/fixtures/loadpath.rb
deleted file mode 100644
index d7fdf45d46..0000000000
--- a/spec/ruby/command_line/fixtures/loadpath.rb
+++ /dev/null
@@ -1 +0,0 @@
-puts $:
diff --git a/spec/ruby/command_line/fixtures/names.txt b/spec/ruby/command_line/fixtures/names.txt
deleted file mode 100644
index ae4bf4c8ad..0000000000
--- a/spec/ruby/command_line/fixtures/names.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-alice
-bob
-james
diff --git a/spec/ruby/command_line/fixtures/passwd_file.txt b/spec/ruby/command_line/fixtures/passwd_file.txt
deleted file mode 100644
index 08a4b23bbd..0000000000
--- a/spec/ruby/command_line/fixtures/passwd_file.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false
-root:*:0:0:System Administrator:/var/root:/bin/sh
-daemon:*:1:1:System Services:/var/root:/usr/bin/false
diff --git a/spec/ruby/command_line/fixtures/require.rb b/spec/ruby/command_line/fixtures/require.rb
deleted file mode 100644
index 0be7049c66..0000000000
--- a/spec/ruby/command_line/fixtures/require.rb
+++ /dev/null
@@ -1 +0,0 @@
-puts $"
diff --git a/spec/ruby/command_line/fixtures/rubyopt.rb b/spec/ruby/command_line/fixtures/rubyopt.rb
deleted file mode 100644
index 48d81e1bca..0000000000
--- a/spec/ruby/command_line/fixtures/rubyopt.rb
+++ /dev/null
@@ -1 +0,0 @@
-puts "rubyopt.rb required"
diff --git a/spec/ruby/command_line/fixtures/test_file.rb b/spec/ruby/command_line/fixtures/test_file.rb
deleted file mode 100644
index 961e3c0b0c..0000000000
--- a/spec/ruby/command_line/fixtures/test_file.rb
+++ /dev/null
@@ -1 +0,0 @@
-"test file"
diff --git a/spec/ruby/command_line/fixtures/verbose.rb b/spec/ruby/command_line/fixtures/verbose.rb
deleted file mode 100644
index 2aa99ed44d..0000000000
--- a/spec/ruby/command_line/fixtures/verbose.rb
+++ /dev/null
@@ -1 +0,0 @@
-puts $VERBOSE.inspect
diff --git a/spec/ruby/command_line/frozen_strings_spec.rb b/spec/ruby/command_line/frozen_strings_spec.rb
deleted file mode 100644
index f3ee797c78..0000000000
--- a/spec/ruby/command_line/frozen_strings_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-ruby_version_is "2.3" do
- describe "The --enable-frozen-string-literal flag causes string literals to" do
-
- it "produce the same object each time" do
- ruby_exe(fixture(__FILE__, "freeze_flag_one_literal.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
- end
-
- it "produce the same object for literals with the same content" do
- ruby_exe(fixture(__FILE__, "freeze_flag_two_literals.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
- end
-
- it "produce the same object for literals with the same content in different files" do
- ruby_exe(fixture(__FILE__, "freeze_flag_across_files.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
- end
-
- it "produce different objects for literals with the same content in different files if they have different encodings" do
- ruby_exe(fixture(__FILE__, "freeze_flag_across_files_diff_enc.rb"), options: "--enable-frozen-string-literal").chomp.should == "true"
- end
- end
-
- describe "The --debug flag produces" do
- it "debugging info on attempted frozen string modification" do
- error_str = ruby_exe(fixture(__FILE__, 'debug_info.rb'), options: '--debug', args: "2>&1")
- error_str.should include("can't modify frozen String, created at ")
- error_str.should include("command_line/fixtures/debug_info.rb:2")
- end
- end
-end
diff --git a/spec/ruby/command_line/rubyopt_spec.rb b/spec/ruby/command_line/rubyopt_spec.rb
deleted file mode 100644
index a662b026bf..0000000000
--- a/spec/ruby/command_line/rubyopt_spec.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "Processing RUBYOPT" do
- before (:each) do
- @rubyopt, ENV["RUBYOPT"] = ENV["RUBYOPT"], nil
- end
-
- after (:each) do
- ENV["RUBYOPT"] = @rubyopt
- end
-
- it "adds the -I path to $LOAD_PATH" do
- ENV["RUBYOPT"] = "-Ioptrubyspecincl"
- result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", escape: true)
- result.chomp[-15..-1].should == "optrubyspecincl"
- end
-
- it "sets $DEBUG to true for '-d'" do
- ENV["RUBYOPT"] = '-d'
- command = %[puts "value of $DEBUG is \#{$DEBUG}"]
- result = ruby_exe(command, escape: true, args: "2>&1")
- result.should =~ /value of \$DEBUG is true/
- end
-
- it "prints the version number for '-v'" do
- ENV["RUBYOPT"] = '-v'
- ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION
- end
-
- it "ignores whitespace around the option" do
- ENV["RUBYOPT"] = ' -v '
- ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION
- end
-
- it "sets $VERBOSE to true for '-w'" do
- ENV["RUBYOPT"] = '-w'
- ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
- end
-
- it "sets $VERBOSE to true for '-W'" do
- ENV["RUBYOPT"] = '-W'
- ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
- end
-
- it "sets $VERBOSE to nil for '-W0'" do
- ENV["RUBYOPT"] = '-W0'
- ruby_exe("p $VERBOSE", escape: true).chomp.should == "nil"
- end
-
- it "sets $VERBOSE to false for '-W1'" do
- ENV["RUBYOPT"] = '-W1'
- ruby_exe("p $VERBOSE", escape: true).chomp.should == "false"
- end
-
- it "sets $VERBOSE to true for '-W2'" do
- ENV["RUBYOPT"] = '-W2'
- ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
- end
-
- it "requires the file for '-r'" do
- f = fixture __FILE__, "rubyopt"
- ENV["RUBYOPT"] = "-r#{f}"
- ruby_exe("0", args: '2>&1').should =~ /^rubyopt.rb required/
- end
-
- it "raises a RuntimeError for '-a'" do
- ENV["RUBYOPT"] = '-a'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-p'" do
- ENV["RUBYOPT"] = '-p'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-n'" do
- ENV["RUBYOPT"] = '-n'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-y'" do
- ENV["RUBYOPT"] = '-y'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-c'" do
- ENV["RUBYOPT"] = '-c'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-s'" do
- ENV["RUBYOPT"] = '-s'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-h'" do
- ENV["RUBYOPT"] = '-h'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '--help'" do
- ENV["RUBYOPT"] = '--help'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-l'" do
- ENV["RUBYOPT"] = '-l'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-S'" do
- ENV["RUBYOPT"] = '-S irb'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-e'" do
- ENV["RUBYOPT"] = '-e0'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-i'" do
- ENV["RUBYOPT"] = '-i.bak'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-x'" do
- ENV["RUBYOPT"] = '-x'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-C'" do
- ENV["RUBYOPT"] = '-C'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-X'" do
- ENV["RUBYOPT"] = '-X.'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-F'" do
- ENV["RUBYOPT"] = '-F'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '-0'" do
- ENV["RUBYOPT"] = '-0'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '--copyright'" do
- ENV["RUBYOPT"] = '--copyright'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '--version'" do
- ENV["RUBYOPT"] = '--version'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-
- it "raises a RuntimeError for '--yydebug'" do
- ENV["RUBYOPT"] = '--yydebug'
- ruby_exe("", args: '2>&1').should =~ /RuntimeError/
- end
-end
diff --git a/spec/ruby/command_line/shared/verbose.rb b/spec/ruby/command_line/shared/verbose.rb
deleted file mode 100644
index 457fe3006a..0000000000
--- a/spec/ruby/command_line/shared/verbose.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-describe :command_line_verbose, shared: true do
- before :each do
- @script = fixture __FILE__, "verbose.rb"
- end
-
- it "sets $VERBOSE to true" do
- ruby_exe(@script, options: @method).chomp.split.last.should == "true"
- end
-end
diff --git a/spec/ruby/command_line/syntax_error_spec.rb b/spec/ruby/command_line/syntax_error_spec.rb
deleted file mode 100644
index 71cee32e23..0000000000
--- a/spec/ruby/command_line/syntax_error_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../spec_helper', __FILE__)
-
-describe "The interpreter" do
- it "prints an error when given a file with invalid syntax" do
- out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), args: "2>&1")
- out.should include "syntax error"
- end
-
- it "prints an error when given code via -e with invalid syntax" do
- out = ruby_exe(nil, args: "-e 'a{' 2>&1")
- out.should include "syntax error"
- end
-end
diff --git a/spec/ruby/core/argf/argf_spec.rb b/spec/ruby/core/argf/argf_spec.rb
deleted file mode 100644
index b47e77c17f..0000000000
--- a/spec/ruby/core/argf/argf_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF" do
- it "is extended by the Enumerable module" do
- ARGF.should be_kind_of(Enumerable)
- end
-
- it "is an instance of ARGF.class" do
- ARGF.should be_an_instance_of(ARGF.class)
- end
-end
diff --git a/spec/ruby/core/argf/argv_spec.rb b/spec/ruby/core/argf/argv_spec.rb
deleted file mode 100644
index e294b3993f..0000000000
--- a/spec/ruby/core/argf/argv_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.argv" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "returns ARGV for the initial ARGF" do
- ARGF.argv.should equal ARGV
- end
-
- it "returns the remaining arguments to treat" do
- argf [@file1, @file2] do
- # @file1 is stored in current file
- @argf.argv.should == [@file2]
- end
- end
-end
diff --git a/spec/ruby/core/argf/binmode_spec.rb b/spec/ruby/core/argf/binmode_spec.rb
deleted file mode 100644
index 62202360e3..0000000000
--- a/spec/ruby/core/argf/binmode_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.binmode" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- @bin_file = fixture __FILE__, "bin_file.txt"
- end
-
- it "returns self" do
- argf [@bin_file] do
- @argf.binmode.should equal @argf
- end
- end
-
- platform_is :windows do
- it "puts reading into binmode" do
- argf [@bin_file, @bin_file] do
- @argf.gets.should == "test\n"
- @argf.binmode
- @argf.gets.should == "test\r\n"
- end
- end
-
- it "puts alls subsequent stream reading through ARGF into binmode" do
- argf [@bin_file, @bin_file] do
- @argf.binmode
- @argf.gets.should == "test\r\n"
- @argf.gets.should == "test\r\n"
- end
- end
- end
-
- it "sets the file's encoding to ASCII-8BIT" do
- argf [@bin_file, @file1] do
- @argf.binmode
- @argf.binmode?.should == true
- @argf.gets.encoding.should == Encoding::ASCII_8BIT
- @argf.skip
- @argf.read.encoding.should == Encoding::ASCII_8BIT
- end
- end
-end
diff --git a/spec/ruby/core/argf/bytes_spec.rb b/spec/ruby/core/argf/bytes_spec.rb
deleted file mode 100644
index 01a3a3db0d..0000000000
--- a/spec/ruby/core/argf/bytes_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_byte', __FILE__)
-
-describe "ARGF.bytes" do
- it_behaves_like :argf_each_byte, :bytes
-end
diff --git a/spec/ruby/core/argf/chars_spec.rb b/spec/ruby/core/argf/chars_spec.rb
deleted file mode 100644
index 8c9e4844c0..0000000000
--- a/spec/ruby/core/argf/chars_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_char', __FILE__)
-
-describe "ARGF.chars" do
- it_behaves_like :argf_each_char, :chars
-end
diff --git a/spec/ruby/core/argf/close_spec.rb b/spec/ruby/core/argf/close_spec.rb
deleted file mode 100644
index b56f7f5564..0000000000
--- a/spec/ruby/core/argf/close_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.close" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
- end
-
- it "closes the current open stream" do
- argf [@file1_name, @file2_name] do
- io = @argf.to_io
- @argf.close
- io.closed?.should be_true
- end
- end
-
- it "returns self" do
- argf [@file1_name, @file2_name] do
- @argf.close.should equal(@argf)
- end
- end
-
- ruby_version_is ""..."2.3" do
- it "raises an IOError if called on a closed stream" do
- argf [@file1_name] do
- lambda { @argf.close }.should_not raise_error
- lambda { @argf.close }.should raise_error(IOError)
- end
- end
- end
-
- ruby_version_is "2.3" do
- it "doesn't raise an IOError if called on a closed stream" do
- argf [@file1_name] do
- lambda { @argf.close }.should_not raise_error
- lambda { @argf.close }.should_not raise_error
- end
- end
- end
-end
-
-describe "ARGF.close" do
- it "does not close STDIN" do
- ruby_exe("ARGV.replace(['-']); ARGF.close; print ARGF.closed?").should == "false"
- end
-end
diff --git a/spec/ruby/core/argf/closed_spec.rb b/spec/ruby/core/argf/closed_spec.rb
deleted file mode 100644
index 745f102484..0000000000
--- a/spec/ruby/core/argf/closed_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.closed?" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
- end
-
- it "returns true if the current stream has been closed" do
- argf [@file1_name, @file2_name] do
- stream = @argf.to_io
- stream.close
-
- @argf.closed?.should be_true
- stream.reopen(@argf.filename, 'r')
- end
- end
-end
diff --git a/spec/ruby/core/argf/codepoints_spec.rb b/spec/ruby/core/argf/codepoints_spec.rb
deleted file mode 100644
index cd839cbb8c..0000000000
--- a/spec/ruby/core/argf/codepoints_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_codepoint', __FILE__)
-
-describe "ARGF.codepoints" do
- it_behaves_like :argf_each_codepoint, :codepoints
-end
diff --git a/spec/ruby/core/argf/each_byte_spec.rb b/spec/ruby/core/argf/each_byte_spec.rb
deleted file mode 100644
index 8b4a62c2b1..0000000000
--- a/spec/ruby/core/argf/each_byte_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_byte', __FILE__)
-
-describe "ARGF.each_byte" do
- it_behaves_like :argf_each_byte, :each_byte
-end
diff --git a/spec/ruby/core/argf/each_char_spec.rb b/spec/ruby/core/argf/each_char_spec.rb
deleted file mode 100644
index 58ac0bf783..0000000000
--- a/spec/ruby/core/argf/each_char_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_char', __FILE__)
-
-describe "ARGF.each_char" do
- it_behaves_like :argf_each_char, :each_char
-end
diff --git a/spec/ruby/core/argf/each_codepoint_spec.rb b/spec/ruby/core/argf/each_codepoint_spec.rb
deleted file mode 100644
index d0725841a7..0000000000
--- a/spec/ruby/core/argf/each_codepoint_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_codepoint', __FILE__)
-
-describe "ARGF.each_codepoint" do
- it_behaves_like :argf_each_codepoint, :each_codepoint
-end
diff --git a/spec/ruby/core/argf/each_line_spec.rb b/spec/ruby/core/argf/each_line_spec.rb
deleted file mode 100644
index d37968af3d..0000000000
--- a/spec/ruby/core/argf/each_line_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_line', __FILE__)
-
-describe "ARGF.each_line" do
- it_behaves_like :argf_each_line, :each_line
-end
diff --git a/spec/ruby/core/argf/each_spec.rb b/spec/ruby/core/argf/each_spec.rb
deleted file mode 100644
index 5a1e0dc73c..0000000000
--- a/spec/ruby/core/argf/each_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_line', __FILE__)
-
-describe "ARGF.each" do
- it_behaves_like :argf_each_line, :each
-end
diff --git a/spec/ruby/core/argf/eof_spec.rb b/spec/ruby/core/argf/eof_spec.rb
deleted file mode 100644
index 534bf1f8d8..0000000000
--- a/spec/ruby/core/argf/eof_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/eof', __FILE__)
-
-describe "ARGF.eof" do
- it_behaves_like :argf_eof, :eof
-end
-
-describe "ARGF.eof?" do
- it_behaves_like :argf_eof, :eof?
-end
diff --git a/spec/ruby/core/argf/file_spec.rb b/spec/ruby/core/argf/file_spec.rb
deleted file mode 100644
index 248ffeff17..0000000000
--- a/spec/ruby/core/argf/file_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.file" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "returns the current file object on each file" do
- argf [@file1, @file2] do
- result = []
- # returns first current file even when not yet open
- result << @argf.file.path
- result << @argf.file.path while @argf.gets
- # returns last current file even when closed
- result << @argf.file.path
- result.should == [@file1, @file1, @file1, @file2, @file2, @file2]
- end
- end
-end
diff --git a/spec/ruby/core/argf/filename_spec.rb b/spec/ruby/core/argf/filename_spec.rb
deleted file mode 100644
index f7ebafa7c5..0000000000
--- a/spec/ruby/core/argf/filename_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/filename', __FILE__)
-
-describe "ARGF.filename" do
- it_behaves_like :argf_filename, :filename
-end
diff --git a/spec/ruby/core/argf/fileno_spec.rb b/spec/ruby/core/argf/fileno_spec.rb
deleted file mode 100644
index b35047695c..0000000000
--- a/spec/ruby/core/argf/fileno_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/fileno', __FILE__)
-
-describe "ARGF.fileno" do
- it_behaves_like :argf_fileno, :fileno
-end
diff --git a/spec/ruby/core/argf/fixtures/bin_file.txt b/spec/ruby/core/argf/fixtures/bin_file.txt
deleted file mode 100644
index 2545e9037e..0000000000
--- a/spec/ruby/core/argf/fixtures/bin_file.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-test
-test
diff --git a/spec/ruby/core/argf/fixtures/file1.txt b/spec/ruby/core/argf/fixtures/file1.txt
deleted file mode 100644
index 1c89bfbd82..0000000000
--- a/spec/ruby/core/argf/fixtures/file1.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-file1.1
-file1.2
diff --git a/spec/ruby/core/argf/fixtures/file2.txt b/spec/ruby/core/argf/fixtures/file2.txt
deleted file mode 100644
index 62e8dba00b..0000000000
--- a/spec/ruby/core/argf/fixtures/file2.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-line2.1
-line2.2
diff --git a/spec/ruby/core/argf/fixtures/filename.rb b/spec/ruby/core/argf/fixtures/filename.rb
deleted file mode 100644
index 599c97dd57..0000000000
--- a/spec/ruby/core/argf/fixtures/filename.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-puts $FILENAME while ARGF.gets
-# returns last current file even when closed
-puts $FILENAME
diff --git a/spec/ruby/core/argf/fixtures/lineno.rb b/spec/ruby/core/argf/fixtures/lineno.rb
deleted file mode 100644
index 079cc92e8e..0000000000
--- a/spec/ruby/core/argf/fixtures/lineno.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-puts $.
-ARGF.gets
-puts $.
-ARGF.gets
-puts $.
diff --git a/spec/ruby/core/argf/fixtures/rewind.rb b/spec/ruby/core/argf/fixtures/rewind.rb
deleted file mode 100644
index 90a334cd89..0000000000
--- a/spec/ruby/core/argf/fixtures/rewind.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-puts ARGF.lineno
-ARGF.gets
-puts ARGF.lineno
-ARGF.rewind
-puts ARGF.lineno
diff --git a/spec/ruby/core/argf/fixtures/stdin.txt b/spec/ruby/core/argf/fixtures/stdin.txt
deleted file mode 100644
index 063cdcb1d4..0000000000
--- a/spec/ruby/core/argf/fixtures/stdin.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-stdin.1
-stdin.2
diff --git a/spec/ruby/core/argf/getc_spec.rb b/spec/ruby/core/argf/getc_spec.rb
deleted file mode 100644
index de5e6fa73c..0000000000
--- a/spec/ruby/core/argf/getc_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/getc', __FILE__)
-
-describe "ARGF.getc" do
- it_behaves_like :argf_getc, :getc
-end
-
-describe "ARGF.getc" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "returns nil when end of stream reached" do
- argf [@file1, @file2] do
- @argf.read
- @argf.getc.should == nil
- end
- end
-end
diff --git a/spec/ruby/core/argf/gets_spec.rb b/spec/ruby/core/argf/gets_spec.rb
deleted file mode 100644
index b65aa076bd..0000000000
--- a/spec/ruby/core/argf/gets_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/gets', __FILE__)
-
-describe "ARGF.gets" do
- it_behaves_like :argf_gets, :gets
-end
-
-describe "ARGF.gets" do
- it_behaves_like :argf_gets_inplace_edit, :gets
-end
-
-describe "ARGF.gets" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @file1 = File.readlines @file1_name
- @file2 = File.readlines @file2_name
- end
-
- it "returns nil when reaching end of files" do
- argf [@file1_name, @file2_name] do
- total = @file1.size + @file2.size
- total.times { @argf.gets }
- @argf.gets.should == nil
- end
- end
-
- with_feature :encoding do
- before :each do
- @external = Encoding.default_external
- @internal = Encoding.default_internal
-
- Encoding.default_external = Encoding::UTF_8
- Encoding.default_internal = nil
- end
-
- after :each do
- Encoding.default_external = @external
- Encoding.default_internal = @internal
- end
-
- it "reads the contents of the file with default encoding" do
- Encoding.default_external = Encoding::US_ASCII
- argf [@file1_name, @file2_name] do
- @argf.gets.encoding.should == Encoding::US_ASCII
- end
- end
- end
-
-end
diff --git a/spec/ruby/core/argf/lineno_spec.rb b/spec/ruby/core/argf/lineno_spec.rb
deleted file mode 100644
index 13b1916fb1..0000000000
--- a/spec/ruby/core/argf/lineno_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.lineno" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- # TODO: break this into four specs
- it "returns the current line number on each file" do
- argf [@file1, @file2] do
- @argf.lineno = 0
- @argf.gets
- @argf.lineno.should == 1
- @argf.gets
- @argf.lineno.should == 2
- @argf.gets
- @argf.lineno.should == 3
- @argf.gets
- @argf.lineno.should == 4
- end
- end
-
- it "aliases to $." do
- script = fixture __FILE__, "lineno.rb"
- out = ruby_exe(script, args: [@file1, @file2])
- out.should == "0\n1\n2\n"
- end
-end
diff --git a/spec/ruby/core/argf/lines_spec.rb b/spec/ruby/core/argf/lines_spec.rb
deleted file mode 100644
index ea3578e3a2..0000000000
--- a/spec/ruby/core/argf/lines_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/each_line', __FILE__)
-
-describe "ARGF.lines" do
- it_behaves_like :argf_each_line, :lines
-end
diff --git a/spec/ruby/core/argf/path_spec.rb b/spec/ruby/core/argf/path_spec.rb
deleted file mode 100644
index 098de8693a..0000000000
--- a/spec/ruby/core/argf/path_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/filename', __FILE__)
-
-describe "ARGF.path" do
- it_behaves_like :argf_filename, :path
-end
diff --git a/spec/ruby/core/argf/pos_spec.rb b/spec/ruby/core/argf/pos_spec.rb
deleted file mode 100644
index b6e5c3a254..0000000000
--- a/spec/ruby/core/argf/pos_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/pos', __FILE__)
-
-describe "ARGF.pos" do
- it_behaves_like :argf_pos, :pos
-end
-
-describe "ARGF.pos=" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @file1 = File.readlines @file1_name
- @file2 = File.readlines @file2_name
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "sets the correct position in files" do
- argf [@file1_name, @file2_name] do
- @argf.pos = @file1.first.size
- @argf.gets.should == @file1.last
- @argf.pos = 0
- @argf.gets.should == @file1.first
-
- # finish reading file1
- @argf.gets
-
- @argf.gets
- @argf.pos = 1
- @argf.gets.should == @file2.first[1..-1]
-
- @argf.pos = @file2.first.size + @file2.last.size - 1
- @argf.gets.should == @file2.last[-1,1]
- @argf.pos = 1000
- @argf.read.should == ""
- end
- end
-end
diff --git a/spec/ruby/core/argf/read_nonblock_spec.rb b/spec/ruby/core/argf/read_nonblock_spec.rb
deleted file mode 100644
index 8176a206e5..0000000000
--- a/spec/ruby/core/argf/read_nonblock_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/read', __FILE__)
-
-platform_is_not :windows do
- describe 'ARGF.read_nonblock' do
- it_behaves_like :argf_read, :read_nonblock
-
- before do
- @file1_name = fixture(__FILE__, 'file1.txt')
- @file2_name = fixture(__FILE__, 'file2.txt')
-
- @file1 = File.read(@file1_name)
- @file2 = File.read(@file2_name)
-
- @chunk1 = File.read(@file1_name, 4)
- @chunk2 = File.read(@file2_name, 4)
- end
-
- it 'reads up to the given amount of bytes' do
- argf [@file1_name] do
- @argf.read_nonblock(4).should == @chunk1
- end
- end
-
- describe 'when using multiple files' do
- it 'reads up to the given amount of bytes from the first file' do
- argf [@file1_name, @file2_name] do
- @argf.read_nonblock(4).should == @chunk1
- end
- end
-
- it 'returns an empty String when reading after having read the first file in its entirety' do
- argf [@file1_name, @file2_name] do
- @argf.read_nonblock(File.size(@file1_name)).should == @file1
- @argf.read_nonblock(4).should == ''
- end
- end
- end
-
- it 'reads up to the given bytes from STDIN' do
- stdin = ruby_exe('print ARGF.read_nonblock(4)', :args => "< #{@file1_name}")
-
- stdin.should == @chunk1
- end
-
- it 'reads up to the given bytes from a file when a file and STDIN are present' do
- stdin = ruby_exe("print ARGF.read_nonblock(4)", :args => "#{@file1_name} - < #{@file2_name}")
-
- stdin.should == @chunk1
- end
-
- context "with STDIN" do
- before do
- @r, @w = IO.pipe
- @stdin = $stdin
- $stdin = @r
- end
-
- after do
- $stdin = @stdin
- @w.close
- @r.close unless @r.closed?
- end
-
- it 'raises IO::EAGAINWaitReadable when empty' do
- argf ['-'] do
- lambda {
- @argf.read_nonblock(4)
- }.should raise_error(IO::EAGAINWaitReadable)
- end
- end
-
- ruby_version_is "2.3" do
- it 'returns :wait_readable when the :exception is set to false' do
- argf ['-'] do
- @argf.read_nonblock(4, nil, exception: false).should == :wait_readable
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/read_spec.rb b/spec/ruby/core/argf/read_spec.rb
deleted file mode 100644
index 4eaaea46bb..0000000000
--- a/spec/ruby/core/argf/read_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/read', __FILE__)
-
-describe "ARGF.read" do
- it_behaves_like :argf_read, :read
-
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
- @stdin_name = fixture __FILE__, "stdin.txt"
-
- @file1 = File.read @file1_name
- @file2 = File.read @file2_name
- @stdin = File.read @stdin_name
- end
-
- it "reads the contents of a file" do
- argf [@file1_name] do
- @argf.read().should == @file1
- end
- end
-
- it "treats first nil argument as no length limit" do
- argf [@file1_name] do
- @argf.read(nil).should == @file1
- end
- end
-
- it "reads the contents of two files" do
- argf [@file1_name, @file2_name] do
- @argf.read.should == @file1 + @file2
- end
- end
-
- it "reads the contents of one file and some characters from the second" do
- argf [@file1_name, @file2_name] do
- len = @file1.size + (@file2.size / 2)
- @argf.read(len).should == (@file1 + @file2)[0,len]
- end
- end
-
- it "reads across two files consecutively" do
- argf [@file1_name, @file2_name] do
- @argf.read(@file1.size - 2).should == @file1[0..-3]
- @argf.read(2+5).should == @file1[-2..-1] + @file2[0,5]
- end
- end
-
- it "reads the contents of stdin" do
- stdin = ruby_exe("print ARGF.read", args: "< #{@stdin_name}")
- stdin.should == @stdin
- end
-
- it "reads the contents of one file and stdin" do
- stdin = ruby_exe("print ARGF.read", args: "#{@file1_name} - < #{@stdin_name}")
- stdin.should == @file1 + @stdin
- end
-
- it "reads the contents of the same file twice" do
- argf [@file1_name, @file1_name] do
- @argf.read.should == @file1 + @file1
- end
- end
-
- with_feature :encoding do
-
- before :each do
- @external = Encoding.default_external
- @internal = Encoding.default_internal
-
- Encoding.default_external = Encoding::UTF_8
- Encoding.default_internal = nil
- end
-
- after :each do
- Encoding.default_external = @external
- Encoding.default_internal = @internal
- end
-
- it "reads the contents of the file with default encoding" do
- Encoding.default_external = Encoding::US_ASCII
- argf [@file1_name, @file2_name] do
- @argf.read.encoding.should == Encoding::US_ASCII
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/readchar_spec.rb b/spec/ruby/core/argf/readchar_spec.rb
deleted file mode 100644
index 71e2a6c742..0000000000
--- a/spec/ruby/core/argf/readchar_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/getc', __FILE__)
-
-describe "ARGF.getc" do
- it_behaves_like :argf_getc, :readchar
-end
-
-describe "ARGF.readchar" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "raises EOFError when end of stream reached" do
- argf [@file1, @file2] do
- lambda { while @argf.readchar; end }.should raise_error(EOFError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/readline_spec.rb b/spec/ruby/core/argf/readline_spec.rb
deleted file mode 100644
index d31cfce415..0000000000
--- a/spec/ruby/core/argf/readline_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/gets', __FILE__)
-
-describe "ARGF.readline" do
- it_behaves_like :argf_gets, :readline
-end
-
-describe "ARGF.readline" do
- it_behaves_like :argf_gets_inplace_edit, :readline
-end
-
-describe "ARGF.readline" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "raises an EOFError when reaching end of files" do
- argf [@file1, @file2] do
- lambda { while @argf.readline; end }.should raise_error(EOFError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/readlines_spec.rb b/spec/ruby/core/argf/readlines_spec.rb
deleted file mode 100644
index 8e68429aa8..0000000000
--- a/spec/ruby/core/argf/readlines_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/readlines', __FILE__)
-
-describe "ARGF.readlines" do
- it_behaves_like :argf_readlines, :readlines
-end
diff --git a/spec/ruby/core/argf/readpartial_spec.rb b/spec/ruby/core/argf/readpartial_spec.rb
deleted file mode 100644
index 61c330182c..0000000000
--- a/spec/ruby/core/argf/readpartial_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/read', __FILE__)
-
-describe "ARGF.readpartial" do
- it_behaves_like :argf_read, :readpartial
-
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
- @stdin_name = fixture __FILE__, "stdin.txt"
-
- @file1 = File.read @file1_name
- @file2 = File.read @file2_name
- @stdin = File.read @stdin_name
- end
-
- it "raises an ArgumentError if called without a maximum read length" do
- argf [@file1_name] do
- lambda { @argf.readpartial }.should raise_error(ArgumentError)
- end
- end
-
- it "reads maximum number of bytes from one file at a time" do
- argf [@file1_name, @file2_name] do
- len = @file1.size + @file2.size
- @argf.readpartial(len).should == @file1
- end
- end
-
- it "clears output buffer even if EOFError is raised because @argf is at end" do
- begin
- output = "to be cleared"
-
- argf [@file1_name] do
- @argf.read
- @argf.readpartial(1, output)
- end
- rescue EOFError
- output.should == ""
- end
- end
-
- it "reads maximum number of bytes from one file at a time" do
- argf [@file1_name, @file2_name] do
- len = @file1.size + @file2.size
- @argf.readpartial(len).should == @file1
- end
- end
-
- it "returns an empty string if EOFError is raised while reading any but the last file" do
- argf [@file1_name, @file2_name] do
- @argf.readpartial(@file1.size)
- @argf.readpartial(1).should == ""
- end
- end
-
- ruby_version_is "2.3" do
- it "raises an EOFError if the exception was raised while reading the last file" do
- argf [@file1_name, @file2_name] do
- @argf.readpartial(@file1.size)
- @argf.readpartial(1)
- @argf.readpartial(@file2.size)
- lambda { @argf.readpartial(1) }.should raise_error(EOFError)
- lambda { @argf.readpartial(1) }.should raise_error(EOFError)
- end
- end
- end
-
- it "raises an EOFError if the exception was raised while reading STDIN" do
- ruby_str = <<-STR
- print ARGF.readpartial(#{@stdin.size})
- ARGF.readpartial(1) rescue print $!.class
- STR
- stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}", escape: true)
- stdin.should == @stdin + "EOFError"
- end
-end
diff --git a/spec/ruby/core/argf/rewind_spec.rb b/spec/ruby/core/argf/rewind_spec.rb
deleted file mode 100644
index d6abc3a856..0000000000
--- a/spec/ruby/core/argf/rewind_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.rewind" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @file1 = File.readlines @file1_name
- @file2 = File.readlines @file2_name
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "goes back to beginning of current file" do
- argf [@file1_name, @file2_name] do
- @argf.gets
- @argf.rewind
- @argf.gets.should == @file1.first
-
- @argf.gets # finish reading file1
-
- @argf.gets
- @argf.rewind
- @argf.gets.should == @file2.first
- end
- end
-
- it "resets ARGF.lineno to 0" do
- script = fixture __FILE__, "rewind.rb"
- out = ruby_exe(script, args: [@file1_name, @file2_name])
- out.should == "0\n1\n0\n"
- end
-
- it "raises an ArgumentError when end of stream reached" do
- argf [@file1_name, @file2_name] do
- @argf.read
- lambda { @argf.rewind }.should raise_error(ArgumentError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/seek_spec.rb b/spec/ruby/core/argf/seek_spec.rb
deleted file mode 100644
index 97dacb6cfc..0000000000
--- a/spec/ruby/core/argf/seek_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.seek" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @file1 = File.readlines @file1_name
- @file2 = File.readlines @file2_name
- end
-
- it "sets the absolute position relative to beginning of file" do
- argf [@file1_name, @file2_name] do
- @argf.seek 2
- @argf.gets.should == @file1.first[2..-1]
- @argf.seek @file1.first.size
- @argf.gets.should == @file1.last
- @argf.seek 0, IO::SEEK_END
- @argf.gets.should == @file2.first
- end
- end
-
- it "sets the position relative to current position in file" do
- argf [@file1_name, @file2_name] do
- @argf.seek(0, IO::SEEK_CUR)
- @argf.gets.should == @file1.first
- @argf.seek(-@file1.first.size+2, IO::SEEK_CUR)
- @argf.gets.should == @file1.first[2..-1]
- @argf.seek(1, IO::SEEK_CUR)
- @argf.gets.should == @file1.last[1..-1]
- @argf.seek(3, IO::SEEK_CUR)
- @argf.gets.should == @file2.first
- @argf.seek(@file1.last.size, IO::SEEK_CUR)
- @argf.gets.should == nil
- end
- end
-
- it "sets the absolute position relative to end of file" do
- argf [@file1_name, @file2_name] do
- @argf.seek(-@file1.first.size-@file1.last.size, IO::SEEK_END)
- @argf.gets.should == @file1.first
- @argf.seek(-6, IO::SEEK_END)
- @argf.gets.should == @file1.last[-6..-1]
- @argf.seek(-4, IO::SEEK_END)
- @argf.gets.should == @file1.last[4..-1]
- @argf.gets.should == @file2.first
- @argf.seek(-6, IO::SEEK_END)
- @argf.gets.should == @file2.last[-6..-1]
- end
- end
-end
-
-describe "ARGF.seek" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- end
-
- it "takes at least one argument (offset)" do
- argf [@file1_name] do
- lambda { @argf.seek }.should raise_error(ArgumentError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/set_encoding_spec.rb b/spec/ruby/core/argf/set_encoding_spec.rb
deleted file mode 100644
index f6ec74ded1..0000000000
--- a/spec/ruby/core/argf/set_encoding_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.set_encoding" do
- before :each do
- @file = fixture __FILE__, "file1.txt"
- end
-
- it "sets the external encoding when passed an encoding instance" do
- argf [@file] do
- @argf.set_encoding(Encoding::US_ASCII)
- @argf.external_encoding.should == Encoding::US_ASCII
- @argf.gets.encoding.should == Encoding::US_ASCII
- end
- end
-
- it "sets the external encoding when passed an encoding name" do
- argf [@file] do
- @argf.set_encoding("us-ascii")
- @argf.external_encoding.should == Encoding::US_ASCII
- @argf.gets.encoding.should == Encoding::US_ASCII
- end
- end
-
- it "sets the external, internal encoding when passed two encoding instances" do
- argf [@file] do
- @argf.set_encoding(Encoding::US_ASCII, Encoding::EUC_JP)
- @argf.external_encoding.should == Encoding::US_ASCII
- @argf.internal_encoding.should == Encoding::EUC_JP
- @argf.gets.encoding.should == Encoding::EUC_JP
- end
- end
-
- it "sets the external, internal encoding when passed 'ext:int' String" do
- argf [@file] do
- @argf.set_encoding("us-ascii:euc-jp")
- @argf.external_encoding.should == Encoding::US_ASCII
- @argf.internal_encoding.should == Encoding::EUC_JP
- @argf.gets.encoding.should == Encoding::EUC_JP
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/each_byte.rb b/spec/ruby/core/argf/shared/each_byte.rb
deleted file mode 100644
index 6b1dc1dae2..0000000000
--- a/spec/ruby/core/argf/shared/each_byte.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-describe :argf_each_byte, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @bytes = []
- File.read(@file1_name).each_byte { |b| @bytes << b }
- File.read(@file2_name).each_byte { |b| @bytes << b }
- end
-
- it "yields each byte of all streams to the passed block" do
- argf [@file1_name, @file2_name] do
- bytes = []
- @argf.send(@method) { |b| bytes << b }
- bytes.should == @bytes
- end
- end
-
- it "returns self when passed a block" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
- end
- end
-
- it "returns an Enumerator when passed no block" do
- argf [@file1_name, @file2_name] do
- enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
-
- bytes = []
- enum.each { |b| bytes << b }
- bytes.should == @bytes
- end
- end
-
- describe "when no block is given" do
- it "returns an Enumerator" do
- argf [@file1_name, @file2_name] do
- enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
-
- bytes = []
- enum.each { |b| bytes << b }
- bytes.should == @bytes
- end
- end
-
- describe "returned Enumerator" do
- describe "size" do
- it "should return nil" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method).size.should == nil
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/each_char.rb b/spec/ruby/core/argf/shared/each_char.rb
deleted file mode 100644
index 9e333ecc5b..0000000000
--- a/spec/ruby/core/argf/shared/each_char.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-describe :argf_each_char, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @chars = []
- File.read(@file1_name).each_char { |c| @chars << c }
- File.read(@file2_name).each_char { |c| @chars << c }
- end
-
- it "yields each char of all streams to the passed block" do
- argf [@file1_name, @file2_name] do
- chars = []
- @argf.send(@method) { |c| chars << c }
- chars.should == @chars
- end
- end
-
- it "returns self when passed a block" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
- end
- end
-
- it "returns an Enumerator when passed no block" do
- argf [@file1_name, @file2_name] do
- enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
-
- chars = []
- enum.each { |c| chars << c }
- chars.should == @chars
- end
- end
-
- describe "when no block is given" do
- it "returns an Enumerator" do
- argf [@file1_name, @file2_name] do
- enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
-
- chars = []
- enum.each { |c| chars << c }
- chars.should == @chars
- end
- end
-
- describe "returned Enumerator" do
- describe "size" do
- it "should return nil" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method).size.should == nil
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/each_codepoint.rb b/spec/ruby/core/argf/shared/each_codepoint.rb
deleted file mode 100644
index e2a2dfff46..0000000000
--- a/spec/ruby/core/argf/shared/each_codepoint.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-describe :argf_each_codepoint, shared: true do
- before :each do
- file1_name = fixture __FILE__, "file1.txt"
- file2_name = fixture __FILE__, "file2.txt"
- @filenames = [file1_name, file2_name]
-
- @codepoints = File.read(file1_name).codepoints
- @codepoints.concat File.read(file2_name).codepoints
- end
-
- it "is a public method" do
- argf @filenames do
- @argf.public_methods(false).should include(@method)
- end
- end
-
- it "does not require arguments" do
- argf @filenames do
- @argf.method(@method).arity.should == 0
- end
- end
-
- it "returns self when passed a block" do
- argf @filenames do
- @argf.send(@method) {}.should equal(@argf)
- end
- end
-
- it "returns an Enumerator when passed no block" do
- argf @filenames do
- @argf.send(@method).should be_an_instance_of(Enumerator)
- end
- end
-
- it "yields each codepoint of all streams" do
- argf @filenames do
- @argf.send(@method).to_a.should == @codepoints
- end
- end
-
- describe "when no block is given" do
- it "returns an Enumerator" do
- argf @filenames do
- @argf.send(@method).should be_an_instance_of(Enumerator)
- end
- end
-
- describe "returned Enumerator" do
- describe "size" do
- it "should return nil" do
- argf @filenames do
- @argf.send(@method).size.should == nil
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/each_line.rb b/spec/ruby/core/argf/shared/each_line.rb
deleted file mode 100644
index c0ef77dc54..0000000000
--- a/spec/ruby/core/argf/shared/each_line.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-describe :argf_each_line, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @lines = File.readlines @file1_name
- @lines += File.readlines @file2_name
- end
-
- it "is a public method" do
- argf [@file1_name, @file2_name] do
- @argf.public_methods(false).should include(@method)
- end
- end
-
- it "requires multiple arguments" do
- argf [@file1_name, @file2_name] do
- @argf.method(@method).arity.should < 0
- end
- end
-
- it "reads each line of files" do
- argf [@file1_name, @file2_name] do
- lines = []
- @argf.send(@method) { |b| lines << b }
- lines.should == @lines
- end
- end
-
- it "returns self when passed a block" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
- end
- end
-
- describe "with a separator" do
- it "yields each separated section of all streams" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method, '.').to_a.should ==
- (File.readlines(@file1_name, '.') + File.readlines(@file2_name, '.'))
- end
- end
- end
-
- describe "when no block is given" do
- it "returns an Enumerator" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method).should be_an_instance_of(Enumerator)
- end
- end
-
- describe "returned Enumerator" do
- describe "size" do
- it "should return nil" do
- argf [@file1_name, @file2_name] do
- @argf.send(@method).size.should == nil
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/eof.rb b/spec/ruby/core/argf/shared/eof.rb
deleted file mode 100644
index bba18ede50..0000000000
--- a/spec/ruby/core/argf/shared/eof.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-describe :argf_eof, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "returns true when reaching the end of a file" do
- argf [@file1, @file2] do
- result = []
- while @argf.gets
- result << @argf.send(@method)
- end
- result.should == [false, true, false, true]
- end
- end
-
- it "raises IOError when called on a closed stream" do
- argf [@file1] do
- @argf.read
- lambda { @argf.send(@method) }.should raise_error(IOError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/filename.rb b/spec/ruby/core/argf/shared/filename.rb
deleted file mode 100644
index f47c673dc0..0000000000
--- a/spec/ruby/core/argf/shared/filename.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-describe :argf_filename, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "returns the current file name on each file" do
- argf [@file1, @file2] do
- result = []
- # returns first current file even when not yet open
- result << @argf.send(@method)
- result << @argf.send(@method) while @argf.gets
- # returns last current file even when closed
- result << @argf.send(@method)
-
- result.map! { |f| File.expand_path(f) }
- result.should == [@file1, @file1, @file1, @file2, @file2, @file2]
- end
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "sets the $FILENAME global variable with the current file name on each file" do
- script = fixture __FILE__, "filename.rb"
- out = ruby_exe(script, args: [@file1, @file2])
- out.should == "#{@file1}\n#{@file1}\n#{@file2}\n#{@file2}\n#{@file2}\n"
- end
-end
diff --git a/spec/ruby/core/argf/shared/fileno.rb b/spec/ruby/core/argf/shared/fileno.rb
deleted file mode 100644
index 891e250ad9..0000000000
--- a/spec/ruby/core/argf/shared/fileno.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-describe :argf_fileno, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "returns the current file number on each file" do
- argf [@file1, @file2] do
- result = []
- # returns first current file even when not yet open
- result << @argf.send(@method) while @argf.gets
- # returns last current file even when closed
- result.map { |d| d.class }.should == [Fixnum, Fixnum, Fixnum, Fixnum]
- end
- end
-
- it "raises an ArgumentError when called on a closed stream" do
- argf [@file1] do
- @argf.read
- lambda { @argf.send(@method) }.should raise_error(ArgumentError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/getc.rb b/spec/ruby/core/argf/shared/getc.rb
deleted file mode 100644
index 8be39c60b6..0000000000
--- a/spec/ruby/core/argf/shared/getc.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-describe :argf_getc, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
-
- @chars = File.read @file1
- @chars += File.read @file2
- end
-
- it "reads each char of files" do
- argf [@file1, @file2] do
- chars = ""
- @chars.size.times { chars << @argf.send(@method) }
- chars.should == @chars
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/gets.rb b/spec/ruby/core/argf/shared/gets.rb
deleted file mode 100644
index 160d24c27b..0000000000
--- a/spec/ruby/core/argf/shared/gets.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-describe :argf_gets, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
- @stdin_name = fixture __FILE__, "stdin.txt"
-
- @file1 = File.readlines @file1_name
- @file2 = File.readlines @file2_name
- @stdin = File.read @stdin_name
- end
-
- it "reads one line of a file" do
- argf [@file1_name] do
- @argf.send(@method).should == @file1.first
- end
- end
-
- it "reads all lines of a file" do
- argf [@file1_name] do
- lines = []
- @file1.size.times { lines << @argf.send(@method) }
- lines.should == @file1
- end
- end
-
- it "reads all lines of stdin" do
- total = @stdin.count $/
- stdin = ruby_exe(
- "#{total}.times { print ARGF.send(#{@method.inspect}) }",
- args: "< #{@stdin_name}")
- stdin.should == @stdin
- end
-
- it "reads all lines of two files" do
- argf [@file1_name, @file2_name] do
- total = @file1.size + @file2.size
- lines = []
- total.times { lines << @argf.send(@method) }
- lines.should == @file1 + @file2
- end
- end
-
- it "sets $_ global variable with each line read" do
- argf [@file1_name, @file2_name] do
- total = @file1.size + @file2.size
- total.times do
- line = @argf.send(@method)
- $_.should == line
- end
- end
- end
-end
-
-describe :argf_gets_inplace_edit, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @tmp1_name = tmp "file1.txt"
- @tmp2_name = tmp "file2.txt"
-
- @tmp1_name_bak = @tmp1_name + ".bak"
- @tmp2_name_bak = @tmp2_name + ".bak"
-
- cp @file1_name, @tmp1_name
- cp @file2_name, @tmp2_name
-
- method = "ARGF.send(#{@method.inspect})"
- @code = "begin while line = #{method} do puts 'x' end rescue EOFError; end"
- end
-
- after :each do
- rm_r @tmp1_name, @tmp2_name, @tmp1_name_bak, @tmp2_name_bak
- end
-
- # -i with no backup extension is not supported on Windows
- platform_is_not :windows do
- it "modifies the files when in place edit mode is on" do
- ruby_exe(@code,
- options: "-i",
- args: "#{@tmp1_name} #{@tmp2_name}")
-
- File.read(@tmp1_name).should == "x\nx\n"
- File.read(@tmp2_name).should == "x\nx\n"
- end
- end
-
- it "modifies and backups two files when in place edit mode is on" do
- ruby_exe(@code,
- options: "-i.bak",
- args: "#{@tmp1_name} #{@tmp2_name}")
-
- File.read(@tmp1_name).should == "x\nx\n"
- File.read(@tmp2_name).should == "x\nx\n"
-
- File.read(@tmp1_name_bak).should == "file1.1\nfile1.2\n"
- File.read(@tmp2_name_bak).should == "line2.1\nline2.2\n"
- end
-end
diff --git a/spec/ruby/core/argf/shared/pos.rb b/spec/ruby/core/argf/shared/pos.rb
deleted file mode 100644
index f7184f3d7c..0000000000
--- a/spec/ruby/core/argf/shared/pos.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-describe :argf_pos, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "gives the correct position for each read operation" do
- argf [@file1, @file2] do
- size1 = File.size(@file1)
- size2 = File.size(@file2)
-
- @argf.read(2)
- @argf.send(@method).should == 2
- @argf.read(size1-2)
- @argf.send(@method).should == size1
- @argf.read(6)
- @argf.send(@method).should == 6
- @argf.rewind
- @argf.send(@method).should == 0
- @argf.read(size2)
- @argf.send(@method).should == size2
- end
- end
-
- it "raises an ArgumentError when called on a closed stream" do
- argf [@file1] do
- @argf.read
- lambda { @argf.send(@method) }.should raise_error(ArgumentError)
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/read.rb b/spec/ruby/core/argf/shared/read.rb
deleted file mode 100644
index fe903983c0..0000000000
--- a/spec/ruby/core/argf/shared/read.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-describe :argf_read, shared: true do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @stdin_name = fixture __FILE__, "stdin.txt"
-
- @file1 = File.read @file1_name
- @stdin = File.read @stdin_name
- end
-
- it "treats second nil argument as no output buffer" do
- argf [@file1_name] do
- @argf.send(@method, @file1.size, nil).should == @file1
- end
- end
-
- it "treats second argument as an output buffer" do
- argf [@file1_name] do
- buffer = ""
- @argf.send(@method, @file1.size, buffer)
- buffer.should == @file1
- end
- end
-
- it "clears output buffer before appending to it" do
- argf [@file1_name] do
- buffer = "to be cleared"
- @argf.send(@method, @file1.size, buffer)
- buffer.should == @file1
- end
- end
-
- it "reads a number of bytes from the first file" do
- argf [@file1_name] do
- @argf.send(@method, 5).should == @file1[0, 5]
- end
- end
-
- it "reads from a single file consecutively" do
- argf [@file1_name] do
- @argf.send(@method, 1).should == @file1[0, 1]
- @argf.send(@method, 2).should == @file1[1, 2]
- @argf.send(@method, 3).should == @file1[3, 3]
- end
- end
-
- it "reads a number of bytes from stdin" do
- stdin = ruby_exe("print ARGF.#{@method}(10)", :args => "< #{@stdin_name}")
- stdin.should == @stdin[0, 10]
- end
-
- platform_is_not :windows do
- it "reads the contents of a special device file" do
- argf ['/dev/zero'] do
- @argf.send(@method, 100).should == "\000" * 100
- end
- end
- end
-end
diff --git a/spec/ruby/core/argf/shared/readlines.rb b/spec/ruby/core/argf/shared/readlines.rb
deleted file mode 100644
index 505fa94acb..0000000000
--- a/spec/ruby/core/argf/shared/readlines.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-describe :argf_readlines, shared: true do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
-
- @lines = File.readlines(@file1)
- @lines += File.readlines(@file2)
- end
-
- it "reads all lines of all files" do
- argf [@file1, @file2] do
- @argf.send(@method).should == @lines
- end
- end
-
- it "returns an empty Array when end of stream reached" do
- argf [@file1, @file2] do
- @argf.read
- @argf.send(@method).should == []
- end
- end
-end
diff --git a/spec/ruby/core/argf/skip_spec.rb b/spec/ruby/core/argf/skip_spec.rb
deleted file mode 100644
index 5f5e9eb79a..0000000000
--- a/spec/ruby/core/argf/skip_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.skip" do
- before :each do
- @file1_name = fixture __FILE__, "file1.txt"
- @file2_name = fixture __FILE__, "file2.txt"
-
- @file2 = File.readlines @file2_name
- end
-
- it "skips the current file" do
- argf [@file1_name, @file2_name] do
- @argf.read(1)
- @argf.skip
- @argf.gets.should == @file2.first
- end
- end
-
- it "has no effect when called twice in a row" do
- argf [@file1_name, @file2_name] do
- @argf.read(1)
- @argf.skip
- @argf.skip
- @argf.gets.should == @file2.first
- end
- end
-
- it "has no effect at end of stream" do
- argf [@file1_name, @file2_name] do
- @argf.read
- @argf.skip
- @argf.gets.should == nil
- end
- end
-
- # This bypasses argf helper because the helper will call argf.file
- # which as a side-effect calls argf.file which will initialize
- # internals of ARGF enough for this to work.
- it "has no effect when nothing has been processed yet" do
- lambda { ARGF.class.new(@file1_name).skip }.should_not raise_error
- end
-end
diff --git a/spec/ruby/core/argf/tell_spec.rb b/spec/ruby/core/argf/tell_spec.rb
deleted file mode 100644
index bcd824f087..0000000000
--- a/spec/ruby/core/argf/tell_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/pos', __FILE__)
-
-describe "ARGF.tell" do
- it_behaves_like :argf_pos, :tell
-end
diff --git a/spec/ruby/core/argf/to_a_spec.rb b/spec/ruby/core/argf/to_a_spec.rb
deleted file mode 100644
index 75b5c10c9b..0000000000
--- a/spec/ruby/core/argf/to_a_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/readlines', __FILE__)
-
-describe "ARGF.to_a" do
- it_behaves_like :argf_readlines, :to_a
-end
diff --git a/spec/ruby/core/argf/to_i_spec.rb b/spec/ruby/core/argf/to_i_spec.rb
deleted file mode 100644
index 27359014af..0000000000
--- a/spec/ruby/core/argf/to_i_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/fileno', __FILE__)
-
-describe "ARGF.to_i" do
- it_behaves_like :argf_fileno, :to_i
-end
diff --git a/spec/ruby/core/argf/to_io_spec.rb b/spec/ruby/core/argf/to_io_spec.rb
deleted file mode 100644
index 0575c35f25..0000000000
--- a/spec/ruby/core/argf/to_io_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.to_io" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- # NOTE: this test assumes that fixtures files have two lines each
- it "returns the IO of the current file" do
- argf [@file1, @file2] do
- result = []
- 4.times do
- @argf.gets
- result << @argf.to_io
- end
-
- result.each { |io| io.should be_kind_of(IO) }
- result[0].should == result[1]
- result[2].should == result[3]
- end
- end
-end
diff --git a/spec/ruby/core/argf/to_s_spec.rb b/spec/ruby/core/argf/to_s_spec.rb
deleted file mode 100644
index 0128049c3f..0000000000
--- a/spec/ruby/core/argf/to_s_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "ARGF.to_s" do
- before :each do
- @file1 = fixture __FILE__, "file1.txt"
- @file2 = fixture __FILE__, "file2.txt"
- end
-
- it "returns 'ARGF'" do
- argf [@file1, @file2] do
- @argf.to_s.should == "ARGF"
- end
- end
-end
diff --git a/spec/ruby/core/array/allocate_spec.rb b/spec/ruby/core/array/allocate_spec.rb
deleted file mode 100644
index bb5168cb74..0000000000
--- a/spec/ruby/core/array/allocate_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array.allocate" do
- it "returns an instance of Array" do
- ary = Array.allocate
- ary.should be_an_instance_of(Array)
- end
-
- it "returns a fully-formed instance of Array" do
- ary = Array.allocate
- ary.size.should == 0
- ary << 1
- ary.should == [1]
- end
-
- it "does not accept any arguments" do
- lambda { Array.allocate(1) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/any_spec.rb b/spec/ruby/core/array/any_spec.rb
deleted file mode 100644
index 7e9863420f..0000000000
--- a/spec/ruby/core/array/any_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#any?" do
- describe 'with no block given (a default block of { |x| x } is implicit)' do
- it "is false if the array is empty" do
- empty_array = []
- empty_array.any?.should == false
- end
-
- it "is false if the array is not empty, but all the members of the array are falsy" do
- falsy_array = [false, nil, false]
- falsy_array.any?.should == false
- end
-
- it "is true if the array has any truthy members" do
- not_empty_array = ['anything', nil]
- not_empty_array.any?.should == true
- end
- end
-
- describe 'with a block given' do
- it 'is false if the array is empty' do
- empty_array = []
- empty_array.any? {|v| 1 == 1 }.should == false
- end
-
- it 'is true if the block returns true for any member of the array' do
- array_with_members = [false, false, true, false]
- array_with_members.any? {|v| v == true }.should == true
- end
-
- it 'is false if the block returns false for all members of the array' do
- array_with_members = [false, false, true, false]
- array_with_members.any? {|v| v == 42 }.should == false
- end
- end
-end
diff --git a/spec/ruby/core/array/append_spec.rb b/spec/ruby/core/array/append_spec.rb
deleted file mode 100644
index 90e1688c5a..0000000000
--- a/spec/ruby/core/array/append_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/push', __FILE__)
-
-describe "Array#<<" do
- it "pushes the object onto the end of the array" do
- ([ 1, 2 ] << "c" << "d" << [ 3, 4 ]).should == [1, 2, "c", "d", [3, 4]]
- end
-
- it "returns self to allow chaining" do
- a = []
- b = a
- (a << 1).should equal(b)
- (a << 2 << 3).should equal(b)
- end
-
- it "correctly resizes the Array" do
- a = []
- a.size.should == 0
- a << :foo
- a.size.should == 1
- a << :bar << :baz
- a.size.should == 3
-
- a = [1, 2, 3]
- a.shift
- a.shift
- a.shift
- a << :foo
- a.should == [:foo]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array << 5 }.should raise_error(RuntimeError)
- end
-end
-
-ruby_version_is "2.5" do
- describe "Array#append" do
- it_behaves_like(:array_push, :append)
- end
-end
diff --git a/spec/ruby/core/array/array_spec.rb b/spec/ruby/core/array/array_spec.rb
deleted file mode 100644
index 186bd40f10..0000000000
--- a/spec/ruby/core/array/array_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array" do
- it "includes Enumerable" do
- Array.include?(Enumerable).should == true
- end
-end
diff --git a/spec/ruby/core/array/assoc_spec.rb b/spec/ruby/core/array/assoc_spec.rb
deleted file mode 100644
index 37b0357806..0000000000
--- a/spec/ruby/core/array/assoc_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#assoc" do
- it "returns the first array whose 1st item is == obj or nil" do
- s1 = ["colors", "red", "blue", "green"]
- s2 = [:letters, "a", "b", "c"]
- s3 = [4]
- s4 = ["colors", "cyan", "yellow", "magenda"]
- s5 = [:letters, "a", "i", "u"]
- s_nil = [nil, nil]
- a = [s1, s2, s3, s4, s5, s_nil]
- a.assoc(s1.first).should equal(s1)
- a.assoc(s2.first).should equal(s2)
- a.assoc(s3.first).should equal(s3)
- a.assoc(s4.first).should equal(s1)
- a.assoc(s5.first).should equal(s2)
- a.assoc(s_nil.first).should equal(s_nil)
- a.assoc(4).should equal(s3)
- a.assoc("key not in array").should be_nil
- end
-
- it "calls == on first element of each array" do
- key1 = 'it'
- key2 = mock('key2')
- items = [['not it', 1], [ArraySpecs::AssocKey.new, 2], ['na', 3]]
-
- items.assoc(key1).should equal(items[1])
- items.assoc(key2).should be_nil
- end
-
- it "ignores any non-Array elements" do
- [1, 2, 3].assoc(2).should be_nil
- s1 = [4]
- s2 = [5, 4, 3]
- a = ["foo", [], s1, s2, nil, []]
- a.assoc(s1.first).should equal(s1)
- a.assoc(s2.first).should equal(s2)
- end
-end
diff --git a/spec/ruby/core/array/at_spec.rb b/spec/ruby/core/array/at_spec.rb
deleted file mode 100644
index f2af0e13a1..0000000000
--- a/spec/ruby/core/array/at_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#at" do
- it "returns the (n+1)'th element for the passed index n" do
- a = [1, 2, 3, 4, 5, 6]
- a.at(0).should == 1
- a.at(1).should == 2
- a.at(5).should == 6
- end
-
- it "returns nil if the given index is greater than or equal to the array's length" do
- a = [1, 2, 3, 4, 5, 6]
- a.at(6).should == nil
- a.at(7).should == nil
- end
-
- it "returns the (-n)'th element from the last, for the given negative index n" do
- a = [1, 2, 3, 4, 5, 6]
- a.at(-1).should == 6
- a.at(-2).should == 5
- a.at(-6).should == 1
- end
-
- it "returns nil if the given index is less than -len, where len is length of the array" do
- a = [1, 2, 3, 4, 5, 6]
- a.at(-7).should == nil
- a.at(-8).should == nil
- end
-
- it "does not extend the array unless the given index is out of range" do
- a = [1, 2, 3, 4, 5, 6]
- a.length.should == 6
- a.at(100)
- a.length.should == 6
- a.at(-100)
- a.length.should == 6
- end
-
- it "tries to convert the passed argument to an Integer using #to_int" do
- a = ["a", "b", "c"]
- a.at(0.5).should == "a"
-
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- a.at(obj).should == "c"
- end
-
- it "raises a TypeError when the passed argument can't be coerced to Integer" do
- lambda { [].at("cat") }.should raise_error(TypeError)
- end
-
- it "raises an ArgumentError when 2 or more arguments are passed" do
- lambda { [:a, :b].at(0,1) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/bsearch_index_spec.rb b/spec/ruby/core/array/bsearch_index_spec.rb
deleted file mode 100644
index 1ed11876b4..0000000000
--- a/spec/ruby/core/array/bsearch_index_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-ruby_version_is "2.3" do
- describe "Array#bsearch_index" do
- context "when not passed a block" do
- before :each do
- @enum = [1, 2, 42, 100, 666].bsearch_index
- end
-
- it "returns an Enumerator" do
- @enum.should be_an_instance_of(Enumerator)
- end
-
- it "returns an Enumerator with unknown size" do
- @enum.size.should be_nil
- end
-
- it "returns index of element when block condition is satisfied" do
- @enum.each { |x| x >= 33 }.should == 2
- end
- end
-
- it "raises a TypeError when block returns a String" do
- lambda { [1, 2, 3].bsearch_index { "not ok" } }.should raise_error(TypeError)
- end
-
- it "returns nil when block is empty" do
- [1, 2, 3].bsearch_index {}.should be_nil
- end
-
- context "minimum mode" do
- before :each do
- @array = [0, 4, 7, 10, 12]
- end
-
- it "returns index of first element which satisfies the block" do
- @array.bsearch_index { |x| x >= 4 }.should == 1
- @array.bsearch_index { |x| x >= 6 }.should == 2
- @array.bsearch_index { |x| x >= -1 }.should == 0
- end
-
- it "returns nil when block condition is never satisfied" do
- @array.bsearch_index { false }.should be_nil
- @array.bsearch_index { |x| x >= 100 }.should be_nil
- end
- end
-
- context "find any mode" do
- before :each do
- @array = [0, 4, 7, 10, 12]
- end
-
- it "returns the index of any matched elements where element is between 4 <= x < 8" do
- [1, 2].should include(@array.bsearch_index { |x| 1 - x / 4 })
- end
-
- it "returns the index of any matched elements where element is between 8 <= x < 10" do
- @array.bsearch_index { |x| 4 - x / 2 }.should be_nil
- end
-
- it "returns nil when block never returns 0" do
- @array.bsearch_index { |x| 1 }.should be_nil
- @array.bsearch_index { |x| -1 }.should be_nil
- end
-
- it "returns the middle element when block always returns zero" do
- @array.bsearch_index { |x| 0 }.should == 2
- end
-
- context "magnitude does not effect the result" do
- it "returns the index of any matched elements where element is between 4n <= xn < 8n" do
- [1, 2].should include(@array.bsearch_index { |x| (1 - x / 4) * (2**100) })
- end
-
- it "returns nil when block never returns 0" do
- @array.bsearch_index { |x| 1 * (2**100) }.should be_nil
- @array.bsearch_index { |x| (-1) * (2**100) }.should be_nil
- end
-
- it "handles values from Bignum#coerce" do
- [1, 2].should include(@array.bsearch_index { |x| (2**100).coerce((1 - x / 4) * (2**100)).first })
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/bsearch_spec.rb b/spec/ruby/core/array/bsearch_spec.rb
deleted file mode 100644
index 71e945f390..0000000000
--- a/spec/ruby/core/array/bsearch_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#bsearch" do
- it "returns an Enumerator when not passed a block" do
- [1].bsearch.should be_an_instance_of(Enumerator)
- end
-
- it_behaves_like :enumeratorized_with_unknown_size, :bsearch, [1,2,3]
-
- it "raises a TypeError if the block returns an Object" do
- lambda { [1].bsearch { Object.new } }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if the block returns a String" do
- lambda { [1].bsearch { "1" } }.should raise_error(TypeError)
- end
-
- context "with a block returning true or false" do
- it "returns nil if the block returns false for every element" do
- [0, 1, 2, 3].bsearch { |x| x > 3 }.should be_nil
- end
-
- it "returns nil if the block returns nil for every element" do
- [0, 1, 2, 3].bsearch { |x| nil }.should be_nil
- end
-
- it "returns element at zero if the block returns true for every element" do
- [0, 1, 2, 3].bsearch { |x| x < 4 }.should == 0
-
- end
-
- it "returns the element at the smallest index for which block returns true" do
- [0, 1, 3, 4].bsearch { |x| x >= 2 }.should == 3
- [0, 1, 3, 4].bsearch { |x| x >= 1 }.should == 1
- end
- end
-
- context "with a block returning negative, zero, positive numbers" do
- it "returns nil if the block returns less than zero for every element" do
- [0, 1, 2, 3].bsearch { |x| x <=> 5 }.should be_nil
- end
-
- it "returns nil if the block returns greater than zero for every element" do
- [0, 1, 2, 3].bsearch { |x| x <=> -1 }.should be_nil
-
- end
-
- it "returns nil if the block never returns zero" do
- [0, 1, 3, 4].bsearch { |x| x <=> 2 }.should be_nil
- end
-
- it "accepts (+/-)Float::INFINITY from the block" do
- [0, 1, 3, 4].bsearch { |x| Float::INFINITY }.should be_nil
- [0, 1, 3, 4].bsearch { |x| -Float::INFINITY }.should be_nil
- end
-
- it "returns an element at an index for which block returns 0.0" do
- result = [0, 1, 2, 3, 4].bsearch { |x| x < 2 ? 1.0 : x > 2 ? -1.0 : 0.0 }
- result.should == 2
- end
-
- it "returns an element at an index for which block returns 0" do
- result = [0, 1, 2, 3, 4].bsearch { |x| x < 1 ? 1 : x > 3 ? -1 : 0 }
- [1, 2].should include(result)
- end
- end
-
- context "with a block that calls break" do
- it "returns nil if break is called without a value" do
- ['a', 'b', 'c'].bsearch { |v| break }.should be_nil
- end
-
- it "returns nil if break is called with a nil value" do
- ['a', 'b', 'c'].bsearch { |v| break nil }.should be_nil
- end
-
- it "returns object if break is called with an object" do
- ['a', 'b', 'c'].bsearch { |v| break 1234 }.should == 1234
- ['a', 'b', 'c'].bsearch { |v| break 'hi' }.should == 'hi'
- ['a', 'b', 'c'].bsearch { |v| break [42] }.should == [42]
- end
- end
-end
diff --git a/spec/ruby/core/array/clear_spec.rb b/spec/ruby/core/array/clear_spec.rb
deleted file mode 100644
index 851c90d654..0000000000
--- a/spec/ruby/core/array/clear_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#clear" do
- it "removes all elements" do
- a = [1, 2, 3, 4]
- a.clear.should equal(a)
- a.should == []
- end
-
- it "returns self" do
- a = [1]
- oid = a.object_id
- a.clear.object_id.should == oid
- end
-
- it "leaves the Array empty" do
- a = [1]
- a.clear
- a.empty?.should == true
- a.size.should == 0
- end
-
- it "keeps tainted status" do
- a = [1]
- a.taint
- a.tainted?.should be_true
- a.clear
- a.tainted?.should be_true
- end
-
- it "does not accept any arguments" do
- lambda { [1].clear(true) }.should raise_error(ArgumentError)
- end
-
- it "keeps untrusted status" do
- a = [1]
- a.untrust
- a.untrusted?.should be_true
- a.clear
- a.untrusted?.should be_true
- end
-
- it "raises a RuntimeError on a frozen array" do
- a = [1]
- a.freeze
- lambda { a.clear }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/clone_spec.rb b/spec/ruby/core/array/clone_spec.rb
deleted file mode 100644
index c88e10337f..0000000000
--- a/spec/ruby/core/array/clone_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/clone', __FILE__)
-
-describe "Array#clone" do
- it_behaves_like :array_clone, :clone
-
- it "copies frozen status from the original" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- a.freeze
- aa = a.clone
- bb = b.clone
-
- aa.frozen?.should == true
- bb.frozen?.should == false
- end
-
- it "copies singleton methods" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- def a.a_singleton_method; end
- aa = a.clone
- bb = b.clone
-
- a.respond_to?(:a_singleton_method).should be_true
- b.respond_to?(:a_singleton_method).should be_false
- aa.respond_to?(:a_singleton_method).should be_true
- bb.respond_to?(:a_singleton_method).should be_false
- end
-end
diff --git a/spec/ruby/core/array/collect_spec.rb b/spec/ruby/core/array/collect_spec.rb
deleted file mode 100644
index 1c2c28c6bd..0000000000
--- a/spec/ruby/core/array/collect_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/collect', __FILE__)
-
-describe "Array#collect" do
- it_behaves_like(:array_collect, :collect)
-end
-
-describe "Array#collect!" do
- it_behaves_like(:array_collect_b, :collect!)
-end
diff --git a/spec/ruby/core/array/combination_spec.rb b/spec/ruby/core/array/combination_spec.rb
deleted file mode 100644
index 7869783d1e..0000000000
--- a/spec/ruby/core/array/combination_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#combination" do
- before :each do
- @array = [1, 2, 3, 4]
- end
-
- it "returns an enumerator when no block is provided" do
- @array.combination(2).should be_an_instance_of(Enumerator)
- end
-
- it "returns self when a block is given" do
- @array.combination(2){}.should equal(@array)
- end
-
- it "yields nothing for out of bounds length and return self" do
- @array.combination(5).to_a.should == []
- @array.combination(-1).to_a.should == []
- end
-
- it "yields the expected combinations" do
- @array.combination(3).to_a.sort.should == [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
- end
-
- it "yields nothing if the argument is out of bounds" do
- @array.combination(-1).to_a.should == []
- @array.combination(5).to_a.should == []
- end
-
- it "yields a copy of self if the argument is the size of the receiver" do
- r = @array.combination(4).to_a
- r.should == [@array]
- r[0].should_not equal(@array)
- end
-
- it "yields [] when length is 0" do
- @array.combination(0).to_a.should == [[]] # one combination of length 0
- [].combination(0).to_a.should == [[]] # one combination of length 0
- end
-
- it "yields a partition consisting of only singletons" do
- @array.combination(1).to_a.sort.should == [[1],[2],[3],[4]]
- end
-
- it "generates from a defensive copy, ignoring mutations" do
- accum = []
- @array.combination(2) do |x|
- accum << x
- @array[0] = 1
- end
- accum.should == [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
- end
-
- describe "when no block is given" do
- describe "returned Enumerator" do
- describe "size" do
- it "returns 0 when the number of combinations is < 0" do
- @array.combination(-1).size.should == 0
- [].combination(-2).size.should == 0
- end
- it "returns the binomial coeficient between the array size the number of combinations" do
- @array.combination(5).size.should == 0
- @array.combination(4).size.should == 1
- @array.combination(3).size.should == 4
- @array.combination(2).size.should == 6
- @array.combination(1).size.should == 4
- @array.combination(0).size.should == 1
- [].combination(0).size.should == 1
- [].combination(1).size.should == 0
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/compact_spec.rb b/spec/ruby/core/array/compact_spec.rb
deleted file mode 100644
index b80f0214ec..0000000000
--- a/spec/ruby/core/array/compact_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#compact" do
- it "returns a copy of array with all nil elements removed" do
- a = [1, 2, 4]
- a.compact.should == [1, 2, 4]
- a = [1, nil, 2, 4]
- a.compact.should == [1, 2, 4]
- a = [1, 2, 4, nil]
- a.compact.should == [1, 2, 4]
- a = [nil, 1, 2, 4]
- a.compact.should == [1, 2, 4]
- end
-
- it "does not return self" do
- a = [1, 2, 3]
- a.compact.should_not equal(a)
- end
-
- it "does not return subclass instance for Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3, nil].compact.should be_an_instance_of(Array)
- end
-
- it "does not keep tainted status even if all elements are removed" do
- a = [nil, nil]
- a.taint
- a.compact.tainted?.should be_false
- end
-
- it "does not keep untrusted status even if all elements are removed" do
- a = [nil, nil]
- a.untrust
- a.compact.untrusted?.should be_false
- end
-end
-
-describe "Array#compact!" do
- it "removes all nil elements" do
- a = ['a', nil, 'b', false, 'c']
- a.compact!.should equal(a)
- a.should == ["a", "b", false, "c"]
- a = [nil, 'a', 'b', false, 'c']
- a.compact!.should equal(a)
- a.should == ["a", "b", false, "c"]
- a = ['a', 'b', false, 'c', nil]
- a.compact!.should equal(a)
- a.should == ["a", "b", false, "c"]
- end
-
- it "returns self if some nil elements are removed" do
- a = ['a', nil, 'b', false, 'c']
- a.compact!.object_id.should == a.object_id
- end
-
- it "returns nil if there are no nil elements to remove" do
- [1, 2, false, 3].compact!.should == nil
- end
-
- it "keeps tainted status even if all elements are removed" do
- a = [nil, nil]
- a.taint
- a.compact!
- a.tainted?.should be_true
- end
-
- it "keeps untrusted status even if all elements are removed" do
- a = [nil, nil]
- a.untrust
- a.compact!
- a.untrusted?.should be_true
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.compact! }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/comparison_spec.rb b/spec/ruby/core/array/comparison_spec.rb
deleted file mode 100644
index e5a5f4da10..0000000000
--- a/spec/ruby/core/array/comparison_spec.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#<=>" do
- it "calls <=> left to right and return first non-0 result" do
- [-1, +1, nil, "foobar"].each do |result|
- lhs = Array.new(3) { mock("#{result}") }
- rhs = Array.new(3) { mock("#{result}") }
-
- lhs[0].should_receive(:<=>).with(rhs[0]).and_return(0)
- lhs[1].should_receive(:<=>).with(rhs[1]).and_return(result)
- lhs[2].should_not_receive(:<=>)
-
- (lhs <=> rhs).should == result
- end
- end
-
- it "returns 0 if the arrays are equal" do
- ([] <=> []).should == 0
- ([1, 2, 3, 4, 5, 6] <=> [1, 2, 3, 4, 5.0, 6.0]).should == 0
- end
-
- it "returns -1 if the array is shorter than the other array" do
- ([] <=> [1]).should == -1
- ([1, 1] <=> [1, 1, 1]).should == -1
- end
-
- it "returns +1 if the array is longer than the other array" do
- ([1] <=> []).should == +1
- ([1, 1, 1] <=> [1, 1]).should == +1
- end
-
- it "returns -1 if the arrays have same length and a pair of corresponding elements returns -1 for <=>" do
- eq_l = mock('an object equal to the other')
- eq_r = mock('an object equal to the other')
- eq_l.should_receive(:<=>).with(eq_r).any_number_of_times.and_return(0)
-
- less = mock('less than the other')
- greater = mock('greater then the other')
- less.should_receive(:<=>).with(greater).any_number_of_times.and_return(-1)
-
- rest = mock('an rest element of the arrays')
- rest.should_receive(:<=>).with(rest).any_number_of_times.and_return(0)
- lhs = [eq_l, eq_l, less, rest]
- rhs = [eq_r, eq_r, greater, rest]
-
- (lhs <=> rhs).should == -1
- end
-
- it "returns +1 if the arrays have same length and a pair of corresponding elements returns +1 for <=>" do
- eq_l = mock('an object equal to the other')
- eq_r = mock('an object equal to the other')
- eq_l.should_receive(:<=>).with(eq_r).any_number_of_times.and_return(0)
-
- greater = mock('greater then the other')
- less = mock('less than the other')
- greater.should_receive(:<=>).with(less).any_number_of_times.and_return(+1)
-
- rest = mock('an rest element of the arrays')
- rest.should_receive(:<=>).with(rest).any_number_of_times.and_return(0)
- lhs = [eq_l, eq_l, greater, rest]
- rhs = [eq_r, eq_r, less, rest]
-
- (lhs <=> rhs).should == +1
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty <=> empty).should == 0
- (empty <=> []).should == 1
- ([] <=> empty).should == -1
-
- (ArraySpecs.recursive_array <=> []).should == 1
- ([] <=> ArraySpecs.recursive_array).should == -1
-
- (ArraySpecs.recursive_array <=> ArraySpecs.empty_recursive_array).should == nil
-
- array = ArraySpecs.recursive_array
- (array <=> array).should == 0
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('to_ary')
- obj.stub!(:to_ary).and_return([1, 2, 3])
- ([4, 5] <=> obj).should == ([4, 5] <=> obj.to_ary)
- end
-
- it "does not call #to_ary on Array subclasses" do
- obj = ArraySpecs::ToAryArray[5, 6, 7]
- obj.should_not_receive(:to_ary)
- ([5, 6, 7] <=> obj).should == 0
- end
-
- it "returns nil when the argument is not array-like" do
- ([] <=> false).should be_nil
- end
-end
diff --git a/spec/ruby/core/array/concat_spec.rb b/spec/ruby/core/array/concat_spec.rb
deleted file mode 100644
index 86ec557bde..0000000000
--- a/spec/ruby/core/array/concat_spec.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#concat" do
- it "returns the array itself" do
- ary = [1,2,3]
- ary.concat([4,5,6]).equal?(ary).should be_true
- end
-
- it "appends the elements in the other array" do
- ary = [1, 2, 3]
- ary.concat([9, 10, 11]).should equal(ary)
- ary.should == [1, 2, 3, 9, 10, 11]
- ary.concat([])
- ary.should == [1, 2, 3, 9, 10, 11]
- end
-
- it "does not loop endlessly when argument is self" do
- ary = ["x", "y"]
- ary.concat(ary).should == ["x", "y", "x", "y"]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('to_ary')
- obj.should_receive(:to_ary).and_return(["x", "y"])
- [4, 5, 6].concat(obj).should == [4, 5, 6, "x", "y"]
- end
-
- it "does not call #to_ary on Array subclasses" do
- obj = ArraySpecs::ToAryArray[5, 6, 7]
- obj.should_not_receive(:to_ary)
- [].concat(obj).should == [5, 6, 7]
- end
-
- it "raises a RuntimeError when Array is frozen and modification occurs" do
- lambda { ArraySpecs.frozen_array.concat [1] }.should raise_error(RuntimeError)
- end
-
- # see [ruby-core:23666]
- it "raises a RuntimeError when Array is frozen and no modification occurs" do
- lambda { ArraySpecs.frozen_array.concat([]) }.should raise_error(RuntimeError)
- end
-
- it "keeps tainted status" do
- ary = [1, 2]
- ary.taint
- ary.concat([3])
- ary.tainted?.should be_true
- ary.concat([])
- ary.tainted?.should be_true
- end
-
- it "is not infected by the other" do
- ary = [1,2]
- other = [3]; other.taint
- ary.tainted?.should be_false
- ary.concat(other)
- ary.tainted?.should be_false
- end
-
- it "keeps the tainted status of elements" do
- ary = [ Object.new, Object.new, Object.new ]
- ary.each {|x| x.taint }
-
- ary.concat([ Object.new ])
- ary[0].tainted?.should be_true
- ary[1].tainted?.should be_true
- ary[2].tainted?.should be_true
- ary[3].tainted?.should be_false
- end
-
- it "keeps untrusted status" do
- ary = [1, 2]
- ary.untrust
- ary.concat([3])
- ary.untrusted?.should be_true
- ary.concat([])
- ary.untrusted?.should be_true
- end
-
- it "is not infected untrustedness by the other" do
- ary = [1,2]
- other = [3]; other.untrust
- ary.untrusted?.should be_false
- ary.concat(other)
- ary.untrusted?.should be_false
- end
-
- it "keeps the untrusted status of elements" do
- ary = [ Object.new, Object.new, Object.new ]
- ary.each {|x| x.untrust }
-
- ary.concat([ Object.new ])
- ary[0].untrusted?.should be_true
- ary[1].untrusted?.should be_true
- ary[2].untrusted?.should be_true
- ary[3].untrusted?.should be_false
- end
-
- it "appends elements to an Array with enough capacity that has been shifted" do
- ary = [1, 2, 3, 4, 5]
- 2.times { ary.shift }
- 2.times { ary.pop }
- ary.concat([5, 6]).should == [3, 5, 6]
- end
-
- it "appends elements to an Array without enough capacity that has been shifted" do
- ary = [1, 2, 3, 4]
- 3.times { ary.shift }
- ary.concat([5, 6]).should == [4, 5, 6]
- end
-
- ruby_version_is "2.4" do
- it "takes multiple arguments" do
- ary = [1, 2]
- ary.concat [3, 4]
- ary.should == [1, 2, 3, 4]
- end
-
- it "concatenates the initial value when given arguments contain 2 self" do
- ary = [1, 2]
- ary.concat ary, ary
- ary.should == [1, 2, 1, 2, 1, 2]
- end
-
- it "returns self when given no arguments" do
- ary = [1, 2]
- ary.concat.should equal(ary)
- ary.should == [1, 2]
- end
- end
-end
diff --git a/spec/ruby/core/array/constructor_spec.rb b/spec/ruby/core/array/constructor_spec.rb
deleted file mode 100644
index 8ec2e5de1e..0000000000
--- a/spec/ruby/core/array/constructor_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array.[]" do
- it "returns a new array populated with the given elements" do
- obj = Object.new
- Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
-
- a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
- a.should be_an_instance_of(ArraySpecs::MyArray)
- a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
- end
-end
-
-describe "Array[]" do
- it "is a synonym for .[]" do
- obj = Object.new
- Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
-
- a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
- a.should be_an_instance_of(ArraySpecs::MyArray)
- a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
- end
-end
diff --git a/spec/ruby/core/array/count_spec.rb b/spec/ruby/core/array/count_spec.rb
deleted file mode 100644
index 52314d8579..0000000000
--- a/spec/ruby/core/array/count_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#count" do
- it "returns the number of elements" do
- [:a, :b, :c].count.should == 3
- end
-
- it "returns the number of elements that equal the argument" do
- [:a, :b, :b, :c].count(:b).should == 2
- end
-
- it "returns the number of element for which the block evaluates to true" do
- [:a, :b, :c].count { |s| s != :b }.should == 2
- end
-end
diff --git a/spec/ruby/core/array/cycle_spec.rb b/spec/ruby/core/array/cycle_spec.rb
deleted file mode 100644
index 2e60798c8c..0000000000
--- a/spec/ruby/core/array/cycle_spec.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#cycle" do
- before :each do
- ScratchPad.record []
-
- @array = [1, 2, 3]
- @prc = lambda { |x| ScratchPad << x }
- end
-
- it "does not yield and returns nil when the array is empty and passed value is an integer" do
- [].cycle(6, &@prc).should be_nil
- ScratchPad.recorded.should == []
- end
-
- it "does not yield and returns nil when the array is empty and passed value is nil" do
- [].cycle(nil, &@prc).should be_nil
- ScratchPad.recorded.should == []
- end
-
- it "does not yield and returns nil when passed 0" do
- @array.cycle(0, &@prc).should be_nil
- ScratchPad.recorded.should == []
- end
-
- it "iterates the array 'count' times yielding each item to the block" do
- @array.cycle(2, &@prc)
- ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
- end
-
- it "iterates indefinitely when not passed a count" do
- @array.cycle do |x|
- ScratchPad << x
- break if ScratchPad.recorded.size > 7
- end
- ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3, 1, 2]
- end
-
- it "iterates indefinitely when passed nil" do
- @array.cycle(nil) do |x|
- ScratchPad << x
- break if ScratchPad.recorded.size > 7
- end
- ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3, 1, 2]
- end
-
- it "does not rescue StopIteration when not passed a count" do
- lambda do
- @array.cycle { raise StopIteration }
- end.should raise_error(StopIteration)
- end
-
- it "does not rescue StopIteration when passed a count" do
- lambda do
- @array.cycle(3) { raise StopIteration }
- end.should raise_error(StopIteration)
- end
-
- it "iterates the array Integer(count) times when passed a Float count" do
- @array.cycle(2.7, &@prc)
- ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
- end
-
- it "calls #to_int to convert count to an Integer" do
- count = mock("cycle count 2")
- count.should_receive(:to_int).and_return(2)
-
- @array.cycle(count, &@prc)
- ScratchPad.recorded.should == [1, 2, 3, 1, 2, 3]
- end
-
- it "raises a TypeError if #to_int does not return an Integer" do
- count = mock("cycle count 2")
- count.should_receive(:to_int).and_return("2")
-
- lambda { @array.cycle(count, &@prc) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed a String" do
- lambda { @array.cycle("4") { } }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed an Object" do
- lambda { @array.cycle(mock("cycle count")) { } }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed true" do
- lambda { @array.cycle(true) { } }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed false" do
- lambda { @array.cycle(false) { } }.should raise_error(TypeError)
- end
-
- before :all do
- @object = [1, 2, 3, 4]
- @empty_object = []
- end
- it_should_behave_like :enumeratorized_with_cycle_size
-end
diff --git a/spec/ruby/core/array/delete_at_spec.rb b/spec/ruby/core/array/delete_at_spec.rb
deleted file mode 100644
index 1d73ceb33a..0000000000
--- a/spec/ruby/core/array/delete_at_spec.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#delete_at" do
- it "removes the element at the specified index" do
- a = [1, 2, 3, 4]
- a.delete_at(2)
- a.should == [1, 2, 4]
- a.delete_at(-1)
- a.should == [1, 2]
- end
-
- it "returns the removed element at the specified index" do
- a = [1, 2, 3, 4]
- a.delete_at(2).should == 3
- a.delete_at(-1).should == 4
- end
-
- it "returns nil and makes no modification if the index is out of range" do
- a = [1, 2]
- a.delete_at(3).should == nil
- a.should == [1, 2]
- a.delete_at(-3).should == nil
- a.should == [1, 2]
- end
-
- it "tries to convert the passed argument to an Integer using #to_int" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(-1)
- [1, 2].delete_at(obj).should == 2
- end
-
- it "accepts negative indices" do
- a = [1, 2]
- a.delete_at(-2).should == 1
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { [1,2,3].freeze.delete_at(0) }.should raise_error(RuntimeError)
- end
-
- it "keeps tainted status" do
- ary = [1, 2]
- ary.taint
- ary.tainted?.should be_true
- ary.delete_at(0)
- ary.tainted?.should be_true
- ary.delete_at(0) # now empty
- ary.tainted?.should be_true
- end
-
- it "keeps untrusted status" do
- ary = [1, 2]
- ary.untrust
- ary.untrusted?.should be_true
- ary.delete_at(0)
- ary.untrusted?.should be_true
- ary.delete_at(0) # now empty
- ary.untrusted?.should be_true
- end
-end
diff --git a/spec/ruby/core/array/delete_if_spec.rb b/spec/ruby/core/array/delete_if_spec.rb
deleted file mode 100644
index 4276a1fb65..0000000000
--- a/spec/ruby/core/array/delete_if_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../shared/delete_if', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#delete_if" do
- before do
- @a = [ "a", "b", "c" ]
- end
-
- it "removes each element for which block returns true" do
- @a = [ "a", "b", "c" ]
- @a.delete_if { |x| x >= "b" }
- @a.should == ["a"]
- end
-
- it "returns self" do
- @a.delete_if{ true }.equal?(@a).should be_true
- end
-
- it_behaves_like :enumeratorize, :delete_if
-
- it "returns self when called on an Array emptied with #shift" do
- array = [1]
- array.shift
- array.delete_if { |x| true }.should equal(array)
- end
-
- it "returns an Enumerator if no block given, and the enumerator can modify the original array" do
- enum = @a.delete_if
- enum.should be_an_instance_of(Enumerator)
- @a.should_not be_empty
- enum.each { true }
- @a.should be_empty
- end
-
- it "returns an Enumerator if no block given, and the array is frozen" do
- @a.freeze.delete_if.should be_an_instance_of(Enumerator)
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.delete_if {} }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.delete_if {} }.should raise_error(RuntimeError)
- end
-
- it "keeps tainted status" do
- @a.taint
- @a.tainted?.should be_true
- @a.delete_if{ true }
- @a.tainted?.should be_true
- end
-
- it "keeps untrusted status" do
- @a.untrust
- @a.untrusted?.should be_true
- @a.delete_if{ true }
- @a.untrusted?.should be_true
- end
-
- it_behaves_like :enumeratorized_with_origin_size, :delete_if, [1,2,3]
- it_behaves_like :delete_if, :delete_if
-end
diff --git a/spec/ruby/core/array/delete_spec.rb b/spec/ruby/core/array/delete_spec.rb
deleted file mode 100644
index 7b6bf3930c..0000000000
--- a/spec/ruby/core/array/delete_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#delete" do
- it "removes elements that are #== to object" do
- x = mock('delete')
- def x.==(other) 3 == other end
-
- a = [1, 2, 3, x, 4, 3, 5, x]
- a.delete mock('not contained')
- a.should == [1, 2, 3, x, 4, 3, 5, x]
-
- a.delete 3
- a.should == [1, 2, 4, 5]
- end
-
- it "calculates equality correctly for reference values" do
- a = ["foo", "bar", "foo", "quux", "foo"]
- a.delete "foo"
- a.should == ["bar","quux"]
- end
-
- it "returns object or nil if no elements match object" do
- [1, 2, 4, 5].delete(1).should == 1
- [1, 2, 4, 5].delete(3).should == nil
- end
-
- it "may be given a block that is executed if no element matches object" do
- [1].delete(1) {:not_found}.should == 1
- [].delete('a') {:not_found}.should == :not_found
- end
-
- it "returns nil if the array is empty due to a shift" do
- a = [1]
- a.shift
- a.delete(nil).should == nil
- end
-
- it "returns nil on a frozen array if a modification does not take place" do
- [1, 2, 3].freeze.delete(0).should == nil
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { [1, 2, 3].freeze.delete(1) }.should raise_error(RuntimeError)
- end
-
- it "keeps tainted status" do
- a = [1, 2]
- a.taint
- a.tainted?.should be_true
- a.delete(2)
- a.tainted?.should be_true
- a.delete(1) # now empty
- a.tainted?.should be_true
- end
-
- it "keeps untrusted status" do
- a = [1, 2]
- a.untrust
- a.untrusted?.should be_true
- a.delete(2)
- a.untrusted?.should be_true
- a.delete(1) # now empty
- a.untrusted?.should be_true
- end
-end
diff --git a/spec/ruby/core/array/dig_spec.rb b/spec/ruby/core/array/dig_spec.rb
deleted file mode 100644
index 9c20b2d160..0000000000
--- a/spec/ruby/core/array/dig_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-ruby_version_is '2.3' do
- describe "Array#dig" do
-
- it "returns #at with one arg" do
- ['a'].dig(0).should == 'a'
- ['a'].dig(1).should be_nil
- end
-
- it "recurses array elements" do
- a = [ [ 1, [2, '3'] ] ]
- a.dig(0, 0).should == 1
- a.dig(0, 1, 1).should == '3'
- a.dig(0, -1, 0).should == 2
- end
-
- it "returns the nested value specified if the sequence includes a key" do
- a = [42, { foo: :bar }]
- a.dig(1, :foo).should == :bar
- end
-
- it "raises a TypeError for a non-numeric index" do
- lambda {
- ['a'].dig(:first)
- }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if any intermediate step does not respond to #dig" do
- a = [1, 2]
- lambda {
- a.dig(0, 1)
- }.should raise_error(TypeError)
- end
-
- it "raises an ArgumentError if no arguments provided" do
- lambda {
- [10].dig()
- }.should raise_error(ArgumentError)
- end
-
- it "returns nil if any intermediate step is nil" do
- a = [[1, [2, 3]]]
- a.dig(1, 2, 3).should == nil
- end
-
- it "calls #dig on the result of #at with the remaining arguments" do
- h = [[nil, [nil, nil, 42]]]
- h[0].should_receive(:dig).with(1, 2).and_return(42)
- h.dig(0, 1, 2).should == 42
- end
-
- end
-end
diff --git a/spec/ruby/core/array/drop_spec.rb b/spec/ruby/core/array/drop_spec.rb
deleted file mode 100644
index 763b45e05a..0000000000
--- a/spec/ruby/core/array/drop_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#drop" do
- it "removes the specified number of elements from the start of the array" do
- [1, 2, 3, 4, 5].drop(2).should == [3, 4, 5]
- end
-
- it "raises an ArgumentError if the number of elements specified is negative" do
- lambda { [1, 2].drop(-3) }.should raise_error(ArgumentError)
- end
-
- it "returns an empty Array if all elements are dropped" do
- [1, 2].drop(2).should == []
- end
-
- it "returns an empty Array when called on an empty Array" do
- [].drop(0).should == []
- end
-
- it "does not remove any elements when passed zero" do
- [1, 2].drop(0).should == [1, 2]
- end
-
- it "returns an empty Array if more elements than exist are dropped" do
- [1, 2].drop(3).should == []
- end
-
- it 'acts correctly after a shift' do
- ary = [nil, 1, 2]
- ary.shift
- ary.drop(1).should == [2]
- end
-end
diff --git a/spec/ruby/core/array/drop_while_spec.rb b/spec/ruby/core/array/drop_while_spec.rb
deleted file mode 100644
index 40cc29d6b3..0000000000
--- a/spec/ruby/core/array/drop_while_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#drop_while" do
- it "removes elements from the start of the array while the block evaluates to true" do
- [1, 2, 3, 4].drop_while { |n| n < 4 }.should == [4]
- end
-
- it "removes elements from the start of the array until the block returns nil" do
- [1, 2, 3, nil, 5].drop_while { |n| n }.should == [nil, 5]
- end
-
- it "removes elements from the start of the array until the block returns false" do
- [1, 2, 3, false, 5].drop_while { |n| n }.should == [false, 5]
- end
-end
diff --git a/spec/ruby/core/array/dup_spec.rb b/spec/ruby/core/array/dup_spec.rb
deleted file mode 100644
index 01ad12523d..0000000000
--- a/spec/ruby/core/array/dup_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/clone', __FILE__)
-
-describe "Array#dup" do
- it_behaves_like :array_clone, :dup # FIX: no, clone and dup are not alike
-
- it "does not copy frozen status from the original" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- a.freeze
- aa = a.dup
- bb = b.dup
-
- aa.frozen?.should be_false
- bb.frozen?.should be_false
- end
-
- it "does not copy singleton methods" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- def a.a_singleton_method; end
- aa = a.dup
- bb = b.dup
-
- a.respond_to?(:a_singleton_method).should be_true
- b.respond_to?(:a_singleton_method).should be_false
- aa.respond_to?(:a_singleton_method).should be_false
- bb.respond_to?(:a_singleton_method).should be_false
- end
-end
diff --git a/spec/ruby/core/array/each_index_spec.rb b/spec/ruby/core/array/each_index_spec.rb
deleted file mode 100644
index 8872c00f8c..0000000000
--- a/spec/ruby/core/array/each_index_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-# Modifying a collection while the contents are being iterated
-# gives undefined behavior. See
-# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23633
-
-describe "Array#each_index" do
- before :each do
- ScratchPad.record []
- end
-
- it "passes the index of each element to the block" do
- a = ['a', 'b', 'c', 'd']
- a.each_index { |i| ScratchPad << i }
- ScratchPad.recorded.should == [0, 1, 2, 3]
- end
-
- it "returns self" do
- a = [:a, :b, :c]
- a.each_index { |i| }.should equal(a)
- end
-
- it "is not confused by removing elements from the front" do
- a = [1, 2, 3]
-
- a.shift
- ScratchPad.record []
- a.each_index { |i| ScratchPad << i }
- ScratchPad.recorded.should == [0, 1]
-
- a.shift
- ScratchPad.record []
- a.each_index { |i| ScratchPad << i }
- ScratchPad.recorded.should == [0]
- end
-
- it_behaves_like :enumeratorize, :each_index
- it_behaves_like :enumeratorized_with_origin_size, :each_index, [1,2,3]
-end
diff --git a/spec/ruby/core/array/each_spec.rb b/spec/ruby/core/array/each_spec.rb
deleted file mode 100644
index a8bac6442e..0000000000
--- a/spec/ruby/core/array/each_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-# Modifying a collection while the contents are being iterated
-# gives undefined behavior. See
-# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23633
-
-describe "Array#each" do
- it "yields each element to the block" do
- a = []
- x = [1, 2, 3]
- x.each { |item| a << item }.should equal(x)
- a.should == [1, 2, 3]
- end
-
- it "yields each element to a block that takes multiple arguments" do
- a = [[1, 2], :a, [3, 4]]
- b = []
-
- a.each { |x, y| b << x }
- b.should == [1, :a, 3]
-
- b = []
- a.each { |x, y| b << y }
- b.should == [2, nil, 4]
- end
-
- it_behaves_like :enumeratorize, :each
- it_behaves_like :enumeratorized_with_origin_size, :each, [1,2,3]
-end
diff --git a/spec/ruby/core/array/element_reference_spec.rb b/spec/ruby/core/array/element_reference_spec.rb
deleted file mode 100644
index 55b6b73d1e..0000000000
--- a/spec/ruby/core/array/element_reference_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/slice', __FILE__)
-
-describe "Array#[]" do
- it_behaves_like(:array_slice, :[])
-end
-
-describe "Array.[]" do
- it "[] should return a new array populated with the given elements" do
- array = Array[1, 'a', nil]
- array[0].should == 1
- array[1].should == 'a'
- array[2].should == nil
- end
-
- it "when applied to a literal nested array, unpacks its elements into the containing array" do
- Array[1, 2, *[3, 4, 5]].should == [1, 2, 3, 4, 5]
- end
-
- it "when applied to a nested referenced array, unpacks its elements into the containing array" do
- splatted_array = Array[3, 4, 5]
- Array[1, 2, *splatted_array].should == [1, 2, 3, 4, 5]
- end
-
- it "can unpack 2 or more nested referenced array" do
- splatted_array = Array[3, 4, 5]
- splatted_array2 = Array[6, 7, 8]
- Array[1, 2, *splatted_array, *splatted_array2].should == [1, 2, 3, 4, 5, 6, 7, 8]
- end
-
- it "constructs a nested Hash for tailing key-value pairs" do
- Array[1, 2, 3 => 4, 5 => 6].should == [1, 2, { 3 => 4, 5 => 6 }]
- end
-
- describe "with a subclass of Array" do
- before :each do
- ScratchPad.clear
- end
-
- it "returns an instance of the subclass" do
- ArraySpecs::MyArray[1, 2, 3].should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "does not call #initialize on the subclass instance" do
- ArraySpecs::MyArray[1, 2, 3].should == [1, 2, 3]
- ScratchPad.recorded.should be_nil
- end
- end
-end
diff --git a/spec/ruby/core/array/element_set_spec.rb b/spec/ruby/core/array/element_set_spec.rb
deleted file mode 100644
index 6544ad9b6f..0000000000
--- a/spec/ruby/core/array/element_set_spec.rb
+++ /dev/null
@@ -1,417 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#[]=" do
- it "sets the value of the element at index" do
- a = [1, 2, 3, 4]
- a[2] = 5
- a[-1] = 6
- a[5] = 3
- a.should == [1, 2, 5, 6, nil, 3]
-
- a = []
- a[4] = "e"
- a.should == [nil, nil, nil, nil, "e"]
- a[3] = "d"
- a.should == [nil, nil, nil, "d", "e"]
- a[0] = "a"
- a.should == ["a", nil, nil, "d", "e"]
- a[-3] = "C"
- a.should == ["a", nil, "C", "d", "e"]
- a[-1] = "E"
- a.should == ["a", nil, "C", "d", "E"]
- a[-5] = "A"
- a.should == ["A", nil, "C", "d", "E"]
- a[5] = "f"
- a.should == ["A", nil, "C", "d", "E", "f"]
- a[1] = []
- a.should == ["A", [], "C", "d", "E", "f"]
- a[-1] = nil
- a.should == ["A", [], "C", "d", "E", nil]
- end
-
- it "sets the section defined by [start,length] to other" do
- a = [1, 2, 3, 4, 5, 6]
- a[0, 1] = 2
- a[3, 2] = ['a', 'b', 'c', 'd']
- a.should == [2, 2, 3, "a", "b", "c", "d", 6]
- end
- it "replaces the section defined by [start,length] with the given values" do
- a = [1, 2, 3, 4, 5, 6]
- a[3, 2] = 'a', 'b', 'c', 'd'
- a.should == [1, 2, 3, "a", "b", "c", "d", 6]
- end
-
- it "just sets the section defined by [start,length] to other even if other is nil" do
- a = ['a', 'b', 'c', 'd', 'e']
- a[1, 3] = nil
- a.should == ["a", nil, "e"]
- end
-
- it "returns nil if the rhs is nil" do
- a = [1, 2, 3]
- (a[1, 3] = nil).should == nil
- (a[1..3] = nil).should == nil
- end
-
- it "sets the section defined by range to other" do
- a = [6, 5, 4, 3, 2, 1]
- a[1...2] = 9
- a[3..6] = [6, 6, 6]
- a.should == [6, 9, 4, 6, 6, 6]
- end
-
- it "replaces the section defined by range with the given values" do
- a = [6, 5, 4, 3, 2, 1]
- a[3..6] = :a, :b, :c
- a.should == [6, 5, 4, :a, :b, :c]
- end
-
- it "just sets the section defined by range to other even if other is nil" do
- a = [1, 2, 3, 4, 5]
- a[0..1] = nil
- a.should == [nil, 3, 4, 5]
- end
-
- it 'expands and nil-pads the array if section assigned by range is outside array boundaries' do
- a = ['a']
- a[3..4] = ['b', 'c']
- a.should == ['a', nil, nil, 'b', 'c']
- end
-
- it "calls to_int on its start and length arguments" do
- obj = mock('to_int')
- obj.stub!(:to_int).and_return(2)
-
- a = [1, 2, 3, 4]
- a[obj, 0] = [9]
- a.should == [1, 2, 9, 3, 4]
- a[obj, obj] = []
- a.should == [1, 2, 4]
- a[obj] = -1
- a.should == [1, 2, -1]
- end
-
- it "checks frozen before attempting to coerce arguments" do
- a = [1,2,3,4].freeze
- lambda {a[:foo] = 1}.should raise_error(RuntimeError)
- lambda {a[:foo, :bar] = 1}.should raise_error(RuntimeError)
- end
-
- it "sets elements in the range arguments when passed ranges" do
- ary = [1, 2, 3]
- rhs = [nil, [], ["x"], ["x", "y"]]
- (0 .. ary.size + 2).each do |a|
- (a .. ary.size + 3).each do |b|
- rhs.each do |c|
- ary1 = ary.dup
- ary1[a .. b] = c
- ary2 = ary.dup
- ary2[a, 1 + b-a] = c
- ary1.should == ary2
-
- ary1 = ary.dup
- ary1[a ... b] = c
- ary2 = ary.dup
- ary2[a, b-a] = c
- ary1.should == ary2
- end
- end
- end
- end
-
- it "inserts the given elements with [range] which the range is zero-width" do
- ary = [1, 2, 3]
- ary[1...1] = 0
- ary.should == [1, 0, 2, 3]
- ary[1...1] = [5]
- ary.should == [1, 5, 0, 2, 3]
- ary[1...1] = :a, :b, :c
- ary.should == [1, :a, :b, :c, 5, 0, 2, 3]
- end
-
- it "inserts the given elements with [start, length] which length is zero" do
- ary = [1, 2, 3]
- ary[1, 0] = 0
- ary.should == [1, 0, 2, 3]
- ary[1, 0] = [5]
- ary.should == [1, 5, 0, 2, 3]
- ary[1, 0] = :a, :b, :c
- ary.should == [1, :a, :b, :c, 5, 0, 2, 3]
- end
-
- # Now we only have to test cases where the start, length interface would
- # have raise an exception because of negative size
- it "inserts the given elements with [range] which the range has negative width" do
- ary = [1, 2, 3]
- ary[1..0] = 0
- ary.should == [1, 0, 2, 3]
- ary[1..0] = [4, 3]
- ary.should == [1, 4, 3, 0, 2, 3]
- ary[1..0] = :a, :b, :c
- ary.should == [1, :a, :b, :c, 4, 3, 0, 2, 3]
- end
-
- it "just inserts nil if the section defined by range is zero-width and the rhs is nil" do
- ary = [1, 2, 3]
- ary[1...1] = nil
- ary.should == [1, nil, 2, 3]
- end
-
- it "just inserts nil if the section defined by range has negative width and the rhs is nil" do
- ary = [1, 2, 3]
- ary[1..0] = nil
- ary.should == [1, nil, 2, 3]
- end
-
- it "does nothing if the section defined by range is zero-width and the rhs is an empty array" do
- ary = [1, 2, 3]
- ary[1...1] = []
- ary.should == [1, 2, 3]
- end
- it "does nothing if the section defined by range has negative width and the rhs is an empty array" do
- ary = [1, 2, 3, 4, 5]
- ary[1...0] = []
- ary.should == [1, 2, 3, 4, 5]
- ary[-2..2] = []
- ary.should == [1, 2, 3, 4, 5]
- end
-
- it "tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]" do
- from = mock('from')
- to = mock('to')
-
- # So we can construct a range out of them...
- def from.<=>(o) 0 end
- def to.<=>(o) 0 end
-
- def from.to_int() 1 end
- def to.to_int() -2 end
-
- a = [1, 2, 3, 4]
-
- a[from .. to] = ["a", "b", "c"]
- a.should == [1, "a", "b", "c", 4]
-
- a[to .. from] = ["x"]
- a.should == [1, "a", "b", "x", "c", 4]
- lambda { a["a" .. "b"] = [] }.should raise_error(TypeError)
- lambda { a[from .. "b"] = [] }.should raise_error(TypeError)
- end
-
- it "raises an IndexError when passed indexes out of bounds" do
- a = [1, 2, 3, 4]
- lambda { a[-5] = "" }.should raise_error(IndexError)
- lambda { a[-5, -1] = "" }.should raise_error(IndexError)
- lambda { a[-5, 0] = "" }.should raise_error(IndexError)
- lambda { a[-5, 1] = "" }.should raise_error(IndexError)
- lambda { a[-5, 2] = "" }.should raise_error(IndexError)
- lambda { a[-5, 10] = "" }.should raise_error(IndexError)
-
- lambda { a[-5..-5] = "" }.should raise_error(RangeError)
- lambda { a[-5...-5] = "" }.should raise_error(RangeError)
- lambda { a[-5..-4] = "" }.should raise_error(RangeError)
- lambda { a[-5...-4] = "" }.should raise_error(RangeError)
- lambda { a[-5..10] = "" }.should raise_error(RangeError)
- lambda { a[-5...10] = "" }.should raise_error(RangeError)
-
- # ok
- a[0..-9] = [1]
- a.should == [1, 1, 2, 3, 4]
- end
-
- it "calls to_ary on its rhs argument for multi-element sets" do
- obj = mock('to_ary')
- def obj.to_ary() [1, 2, 3] end
- ary = [1, 2]
- ary[0, 0] = obj
- ary.should == [1, 2, 3, 1, 2]
- ary[1, 10] = obj
- ary.should == [1, 1, 2, 3]
- end
-
- it "does not call to_ary on rhs array subclasses for multi-element sets" do
- ary = []
- ary[0, 0] = ArraySpecs::ToAryArray[5, 6, 7]
- ary.should == [5, 6, 7]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array[0, 0] = [] }.should raise_error(RuntimeError)
- end
-end
-
-describe "Array#[]= with [index]" do
- it "returns value assigned if idx is inside array" do
- a = [1, 2, 3, 4, 5]
- (a[3] = 6).should == 6
- end
-
- it "returns value assigned if idx is right beyond right array boundary" do
- a = [1, 2, 3, 4, 5]
- (a[5] = 6).should == 6
- end
-
- it "returns value assigned if idx far beyond right array boundary" do
- a = [1, 2, 3, 4, 5]
- (a[10] = 6).should == 6
- end
-
- it "sets the value of the element at index" do
- a = [1, 2, 3, 4]
- a[2] = 5
- a[-1] = 6
- a[5] = 3
- a.should == [1, 2, 5, 6, nil, 3]
- end
-
- it "sets the value of the element if it is right beyond the array boundary" do
- a = [1, 2, 3, 4]
- a[4] = 8
- a.should == [1, 2, 3, 4, 8]
- end
-
-end
-
-describe "Array#[]= with [index, count]" do
- it "returns non-array value if non-array value assigned" do
- a = [1, 2, 3, 4, 5]
- (a[2, 3] = 10).should == 10
- end
-
- it "returns array if array assigned" do
- a = [1, 2, 3, 4, 5]
- (a[2, 3] = [4, 5]).should == [4, 5]
- end
-
- it "just sets the section defined by [start,length] to nil even if the rhs is nil" do
- a = ['a', 'b', 'c', 'd', 'e']
- a[1, 3] = nil
- a.should == ["a", nil, "e"]
- end
-
- it "just sets the section defined by [start,length] to nil if negative index within bounds, cnt > 0 and the rhs is nil" do
- a = ['a', 'b', 'c', 'd', 'e']
- a[-3, 2] = nil
- a.should == ["a", "b", nil, "e"]
- end
-
- it "replaces the section defined by [start,length] to other" do
- a = [1, 2, 3, 4, 5, 6]
- a[0, 1] = 2
- a[3, 2] = ['a', 'b', 'c', 'd']
- a.should == [2, 2, 3, "a", "b", "c", "d", 6]
- end
-
- it "replaces the section to other if idx < 0 and cnt > 0" do
- a = [1, 2, 3, 4, 5, 6]
- a[-3, 2] = ["x", "y", "z"]
- a.should == [1, 2, 3, "x", "y", "z", 6]
- end
-
- it "replaces the section to other even if cnt spanning beyond the array boundary" do
- a = [1, 2, 3, 4, 5]
- a[-1, 3] = [7, 8]
- a.should == [1, 2, 3, 4, 7, 8]
- end
-
- it "pads the Array with nils if the span is past the end" do
- a = [1, 2, 3, 4, 5]
- a[10, 1] = [1]
- a.should == [1, 2, 3, 4, 5, nil, nil, nil, nil, nil, 1]
-
- b = [1, 2, 3, 4, 5]
- b[10, 0] = [1]
- a.should == [1, 2, 3, 4, 5, nil, nil, nil, nil, nil, 1]
- end
-
- it "inserts other section in place defined by idx" do
- a = [1, 2, 3, 4, 5]
- a[3, 0] = [7, 8]
- a.should == [1, 2, 3, 7, 8, 4, 5]
-
- b = [1, 2, 3, 4, 5]
- b[1, 0] = b
- b.should == [1, 1, 2, 3, 4, 5, 2, 3, 4, 5]
- end
-
- it "raises an IndexError when passed start and negative length" do
- a = [1, 2, 3, 4]
- lambda { a[-2, -1] = "" }.should raise_error(IndexError)
- lambda { a[0, -1] = "" }.should raise_error(IndexError)
- lambda { a[2, -1] = "" }.should raise_error(IndexError)
- lambda { a[4, -1] = "" }.should raise_error(IndexError)
- lambda { a[10, -1] = "" }.should raise_error(IndexError)
- lambda { [1, 2, 3, 4, 5][2, -1] = [7, 8] }.should raise_error(IndexError)
- end
-end
-
-describe "Array#[]= with [m..n]" do
- it "returns non-array value if non-array value assigned" do
- a = [1, 2, 3, 4, 5]
- (a[2..4] = 10).should == 10
- end
-
- it "returns array if array assigned" do
- a = [1, 2, 3, 4, 5]
- (a[2..4] = [7, 8]).should == [7, 8]
- end
-
- it "just sets the section defined by range to nil even if the rhs is nil" do
- a = [1, 2, 3, 4, 5]
- a[0..1] = nil
- a.should == [nil, 3, 4, 5]
- end
-
- it "just sets the section defined by range to nil if m and n < 0 and the rhs is nil" do
- a = [1, 2, 3, 4, 5]
- a[-3..-2] = nil
- a.should == [1, 2, nil, 5]
- end
-
- it "replaces the section defined by range" do
- a = [6, 5, 4, 3, 2, 1]
- a[1...2] = 9
- a[3..6] = [6, 6, 6]
- a.should == [6, 9, 4, 6, 6, 6]
- end
-
- it "replaces the section if m and n < 0" do
- a = [1, 2, 3, 4, 5]
- a[-3..-2] = [7, 8, 9]
- a.should == [1, 2, 7, 8, 9, 5]
- end
-
- it "replaces the section if m < 0 and n > 0" do
- a = [1, 2, 3, 4, 5]
- a[-4..3] = [8]
- a.should == [1, 8, 5]
- end
-
- it "inserts the other section at m if m > n" do
- a = [1, 2, 3, 4, 5]
- a[3..1] = [8]
- a.should == [1, 2, 3, 8, 4, 5]
- end
-
- it "accepts Range subclasses" do
- a = [1, 2, 3, 4]
- range_incl = ArraySpecs::MyRange.new(1, 2)
- range_excl = ArraySpecs::MyRange.new(-3, -1, true)
-
- a[range_incl] = ["a", "b"]
- a.should == [1, "a", "b", 4]
- a[range_excl] = ["A", "B"]
- a.should == [1, "A", "B", 4]
- end
-end
-
-describe "Array#[] after a shift" do
- it "works for insertion" do
- a = [1,2]
- a.shift
- a.shift
- a[0,0] = [3,4]
- a.should == [3,4]
- end
-end
diff --git a/spec/ruby/core/array/empty_spec.rb b/spec/ruby/core/array/empty_spec.rb
deleted file mode 100644
index d6235114b7..0000000000
--- a/spec/ruby/core/array/empty_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#empty?" do
- it "returns true if the array has no elements" do
- [].empty?.should == true
- [1].empty?.should == false
- [1, 2].empty?.should == false
- end
-end
diff --git a/spec/ruby/core/array/eql_spec.rb b/spec/ruby/core/array/eql_spec.rb
deleted file mode 100644
index 7621316e07..0000000000
--- a/spec/ruby/core/array/eql_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/eql', __FILE__)
-
-describe "Array#eql?" do
- it_behaves_like :array_eql, :eql?
-
- it "returns false if any corresponding elements are not #eql?" do
- [1, 2, 3, 4].send(@method, [1, 2, 3, 4.0]).should be_false
- end
-
- it "returns false if other is not a kind of Array" do
- obj = mock("array eql?")
- obj.should_not_receive(:to_ary)
- obj.should_not_receive(@method)
-
- [1, 2, 3].send(@method, obj).should be_false
- end
-end
diff --git a/spec/ruby/core/array/equal_value_spec.rb b/spec/ruby/core/array/equal_value_spec.rb
deleted file mode 100644
index d923d0e503..0000000000
--- a/spec/ruby/core/array/equal_value_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/eql', __FILE__)
-
-describe "Array#==" do
- it_behaves_like :array_eql, :==
-
- it "compares with an equivalent Array-like object using #to_ary" do
- obj = mock('array-like')
- obj.should_receive(:respond_to?).at_least(1).with(:to_ary).and_return(true)
- obj.should_receive(:==).with([1]).at_least(1).and_return(true)
-
- ([1] == obj).should be_true
- ([[1]] == [obj]).should be_true
- ([[[1], 3], 2] == [[obj, 3], 2]).should be_true
-
- # recursive arrays
- arr1 = [[1]]
- arr1 << arr1
- arr2 = [obj]
- arr2 << arr2
- (arr1 == arr2).should be_true
- (arr2 == arr1).should be_true
- end
-
- it "returns false if any corresponding elements are not #==" do
- a = ["a", "b", "c"]
- b = ["a", "b", "not equal value"]
- a.should_not == b
-
- c = mock("c")
- c.should_receive(:==).and_return(false)
- ["a", "b", c].should_not == a
- end
-
- it "returns true if corresponding elements are #==" do
- [].should == []
- ["a", "c", 7].should == ["a", "c", 7]
-
- [1, 2, 3].should == [1.0, 2.0, 3.0]
-
- obj = mock('5')
- obj.should_receive(:==).and_return(true)
- [obj].should == [5]
- end
-
- # As per bug #1720
- it "returns false for [NaN] == [NaN]" do
- [nan_value].should_not == [nan_value]
- end
-end
diff --git a/spec/ruby/core/array/fetch_spec.rb b/spec/ruby/core/array/fetch_spec.rb
deleted file mode 100644
index 5adf96fed8..0000000000
--- a/spec/ruby/core/array/fetch_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#fetch" do
- it "returns the element at the passed index" do
- [1, 2, 3].fetch(1).should == 2
- [nil].fetch(0).should == nil
- end
-
- it "counts negative indices backwards from end" do
- [1, 2, 3, 4].fetch(-1).should == 4
- end
-
- it "raises an IndexError if there is no element at index" do
- lambda { [1, 2, 3].fetch(3) }.should raise_error(IndexError)
- lambda { [1, 2, 3].fetch(-4) }.should raise_error(IndexError)
- lambda { [].fetch(0) }.should raise_error(IndexError)
- end
-
- it "returns default if there is no element at index if passed a default value" do
- [1, 2, 3].fetch(5, :not_found).should == :not_found
- [1, 2, 3].fetch(5, nil).should == nil
- [1, 2, 3].fetch(-4, :not_found).should == :not_found
- [nil].fetch(0, :not_found).should == nil
- end
-
- it "returns the value of block if there is no element at index if passed a block" do
- [1, 2, 3].fetch(9) { |i| i * i }.should == 81
- [1, 2, 3].fetch(-9) { |i| i * i }.should == 81
- end
-
- it "passes the original index argument object to the block, not the converted Integer" do
- o = mock('5')
- def o.to_int(); 5; end
-
- [1, 2, 3].fetch(o) { |i| i }.should equal(o)
- end
-
- it "gives precedence to the default block over the default argument" do
- lambda {
- @result = [1, 2, 3].fetch(9, :foo) { |i| i * i }
- }.should complain(/block supersedes default value argument/)
- @result.should == 81
- end
-
- it "tries to convert the passed argument to an Integer using #to_int" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- ["a", "b", "c"].fetch(obj).should == "c"
- end
-
- it "raises a TypeError when the passed argument can't be coerced to Integer" do
- lambda { [].fetch("cat") }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/array/fill_spec.rb b/spec/ruby/core/array/fill_spec.rb
deleted file mode 100644
index 5ff7f8a250..0000000000
--- a/spec/ruby/core/array/fill_spec.rb
+++ /dev/null
@@ -1,317 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#fill" do
- before :all do
- @never_passed = lambda do |i|
- raise ExpectationNotMetError, "the control path should not pass here"
- end
- end
-
- it "returns self" do
- ary = [1, 2, 3]
- ary.fill(:a).should equal(ary)
- end
-
- it "is destructive" do
- ary = [1, 2, 3]
- ary.fill(:a)
- ary.should == [:a, :a, :a]
- end
-
- it "does not replicate the filler" do
- ary = [1, 2, 3, 4]
- str = "x"
- ary.fill(str).should == [str, str, str, str]
- str << "y"
- ary.should == [str, str, str, str]
- ary[0].should equal(str)
- ary[1].should equal(str)
- ary[2].should equal(str)
- ary[3].should equal(str)
- end
-
- it "replaces all elements in the array with the filler if not given a index nor a length" do
- ary = ['a', 'b', 'c', 'duh']
- ary.fill(8).should == [8, 8, 8, 8]
-
- str = "x"
- ary.fill(str).should == [str, str, str, str]
- end
-
- it "replaces all elements with the value of block (index given to block)" do
- [nil, nil, nil, nil].fill { |i| i * 2 }.should == [0, 2, 4, 6]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.fill('x') }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.fill('x') }.should raise_error(RuntimeError)
- end
-
- it "raises an ArgumentError if 4 or more arguments are passed when no block given" do
- lambda { [].fill('a') }.should_not raise_error(ArgumentError)
-
- lambda { [].fill('a', 1) }.should_not raise_error(ArgumentError)
-
- lambda { [].fill('a', 1, 2) }.should_not raise_error(ArgumentError)
- lambda { [].fill('a', 1, 2, true) }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError if no argument passed and no block given" do
- lambda { [].fill }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError if 3 or more arguments are passed when a block given" do
- lambda { [].fill() {|i|} }.should_not raise_error(ArgumentError)
-
- lambda { [].fill(1) {|i|} }.should_not raise_error(ArgumentError)
-
- lambda { [].fill(1, 2) {|i|} }.should_not raise_error(ArgumentError)
- lambda { [].fill(1, 2, true) {|i|} }.should raise_error(ArgumentError)
- end
-end
-
-describe "Array#fill with (filler, index, length)" do
- it "replaces length elements beginning with the index with the filler if given an index and a length" do
- ary = [1, 2, 3, 4, 5, 6]
- ary.fill('x', 2, 3).should == [1, 2, 'x', 'x', 'x', 6]
- end
-
- it "replaces length elements beginning with the index with the value of block" do
- [true, false, true, false, true, false, true].fill(1, 4) { |i| i + 3 }.should == [true, 4, 5, 6, 7, false, true]
- end
-
- it "replaces all elements after the index if given an index and no length" do
- ary = [1, 2, 3]
- ary.fill('x', 1).should == [1, 'x', 'x']
- ary.fill(1){|i| i*2}.should == [1, 2, 4]
- end
-
- it "replaces all elements after the index if given an index and nil as a length" do
- a = [1, 2, 3]
- a.fill('x', 1, nil).should == [1, 'x', 'x']
- a.fill(1, nil){|i| i*2}.should == [1, 2, 4]
- a.fill('y', nil).should == ['y', 'y', 'y']
- end
-
- it "replaces the last (-n) elements if given an index n which is negative and no length" do
- a = [1, 2, 3, 4, 5]
- a.fill('x', -2).should == [1, 2, 3, 'x', 'x']
- a.fill(-2){|i| i.to_s}.should == [1, 2, 3, '3', '4']
- end
-
- it "replaces the last (-n) elements if given an index n which is negative and nil as a length" do
- a = [1, 2, 3, 4, 5]
- a.fill('x', -2, nil).should == [1, 2, 3, 'x', 'x']
- a.fill(-2, nil){|i| i.to_s}.should == [1, 2, 3, '3', '4']
- end
-
- it "makes no modifications if given an index greater than end and no length" do
- [1, 2, 3, 4, 5].fill('a', 5).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill(5, &@never_passed).should == [1, 2, 3, 4, 5]
- end
-
- it "makes no modifications if given an index greater than end and nil as a length" do
- [1, 2, 3, 4, 5].fill('a', 5, nil).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill(5, nil, &@never_passed).should == [1, 2, 3, 4, 5]
- end
-
- it "replaces length elements beginning with start index if given an index >= 0 and a length >= 0" do
- [1, 2, 3, 4, 5].fill('a', 2, 0).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill('a', 2, 2).should == [1, 2, "a", "a", 5]
-
- [1, 2, 3, 4, 5].fill(2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill(2, 2){|i| i*2}.should == [1, 2, 4, 6, 5]
- end
-
- it "increases the Array size when necessary" do
- a = [1, 2, 3]
- a.size.should == 3
- a.fill 'a', 0, 10
- a.size.should == 10
- end
-
- it "pads between the last element and the index with nil if given an index which is greater than size of the array" do
- [1, 2, 3, 4, 5].fill('a', 8, 5).should == [1, 2, 3, 4, 5, nil, nil, nil, 'a', 'a', 'a', 'a', 'a']
- [1, 2, 3, 4, 5].fill(8, 5){|i| 'a'}.should == [1, 2, 3, 4, 5, nil, nil, nil, 'a', 'a', 'a', 'a', 'a']
- end
-
- it "replaces length elements beginning with the (-n)th if given an index n < 0 and a length > 0" do
- [1, 2, 3, 4, 5].fill('a', -2, 2).should == [1, 2, 3, "a", "a"]
- [1, 2, 3, 4, 5].fill('a', -2, 4).should == [1, 2, 3, "a", "a", "a", "a"]
-
- [1, 2, 3, 4, 5].fill(-2, 2){|i| 'a'}.should == [1, 2, 3, "a", "a"]
- [1, 2, 3, 4, 5].fill(-2, 4){|i| 'a'}.should == [1, 2, 3, "a", "a", "a", "a"]
- end
-
- it "starts at 0 if the negative index is before the start of the array" do
- [1, 2, 3, 4, 5].fill('a', -25, 3).should == ['a', 'a', 'a', 4, 5]
- [1, 2, 3, 4, 5].fill('a', -10, 10).should == %w|a a a a a a a a a a|
-
- [1, 2, 3, 4, 5].fill(-25, 3){|i| 'a'}.should == ['a', 'a', 'a', 4, 5]
- [1, 2, 3, 4, 5].fill(-10, 10){|i| 'a'}.should == %w|a a a a a a a a a a|
- end
-
- it "makes no modifications if the given length <= 0" do
- [1, 2, 3, 4, 5].fill('a', 2, 0).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill('a', -2, 0).should == [1, 2, 3, 4, 5]
-
- [1, 2, 3, 4, 5].fill('a', 2, -2).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill('a', -2, -2).should == [1, 2, 3, 4, 5]
-
- [1, 2, 3, 4, 5].fill(2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill(-2, 0, &@never_passed).should == [1, 2, 3, 4, 5]
-
- [1, 2, 3, 4, 5].fill(2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
- [1, 2, 3, 4, 5].fill(-2, -2, &@never_passed).should == [1, 2, 3, 4, 5]
- end
-
- # See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17481
- it "does not raise an exception if the given length is negative and its absolute value does not exceed the index" do
- lambda { [1, 2, 3, 4].fill('a', 3, -1)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill('a', 3, -2)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill('a', 3, -3)}.should_not raise_error(ArgumentError)
-
- lambda { [1, 2, 3, 4].fill(3, -1, &@never_passed)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill(3, -2, &@never_passed)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill(3, -3, &@never_passed)}.should_not raise_error(ArgumentError)
- end
-
- it "does not raise an exception even if the given length is negative and its absolute value exceeds the index" do
- lambda { [1, 2, 3, 4].fill('a', 3, -4)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill('a', 3, -5)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill('a', 3, -10000)}.should_not raise_error(ArgumentError)
-
- lambda { [1, 2, 3, 4].fill(3, -4, &@never_passed)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill(3, -5, &@never_passed)}.should_not raise_error(ArgumentError)
- lambda { [1, 2, 3, 4].fill(3, -10000, &@never_passed)}.should_not raise_error(ArgumentError)
- end
-
- it "tries to convert the second and third arguments to Integers using #to_int" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2, 2)
- filler = mock('filler')
- filler.should_not_receive(:to_int)
- [1, 2, 3, 4, 5].fill(filler, obj, obj).should == [1, 2, filler, filler, 5]
- end
-
- it "raises a TypeError if the index is not numeric" do
- lambda { [].fill 'a', true }.should raise_error(TypeError)
-
- obj = mock('nonnumeric')
- lambda { [].fill('a', obj) }.should raise_error(TypeError)
- end
-
- not_supported_on :opal do
- it "raises an ArgumentError or RangeError for too-large sizes" do
- arr = [1, 2, 3]
- lambda { arr.fill(10, 1, fixnum_max) }.should raise_error(ArgumentError)
- lambda { arr.fill(10, 1, bignum_value) }.should raise_error(RangeError)
- end
- end
-end
-
-describe "Array#fill with (filler, range)" do
- it "replaces elements in range with object" do
- [1, 2, 3, 4, 5, 6].fill(8, 0..3).should == [8, 8, 8, 8, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(8, 0...3).should == [8, 8, 8, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', 4..6).should == [1, 2, 3, 4, 'x', 'x', 'x']
- [1, 2, 3, 4, 5, 6].fill('x', 4...6).should == [1, 2, 3, 4, 'x', 'x']
- [1, 2, 3, 4, 5, 6].fill('x', -2..-1).should == [1, 2, 3, 4, 'x', 'x']
- [1, 2, 3, 4, 5, 6].fill('x', -2...-1).should == [1, 2, 3, 4, 'x', 6]
- [1, 2, 3, 4, 5, 6].fill('x', -2...-2).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', -2..-2).should == [1, 2, 3, 4, 'x', 6]
- [1, 2, 3, 4, 5, 6].fill('x', -2..0).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', 0...0).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', 1..1).should == [1, 'x', 3, 4, 5, 6]
- end
-
- it "replaces all elements in range with the value of block" do
- [1, 1, 1, 1, 1, 1].fill(1..6) { |i| i + 1 }.should == [1, 2, 3, 4, 5, 6, 7]
- end
-
- it "increases the Array size when necessary" do
- [1, 2, 3].fill('x', 1..6).should == [1, 'x', 'x', 'x', 'x', 'x', 'x']
- [1, 2, 3].fill(1..6){|i| i+1}.should == [1, 2, 3, 4, 5, 6, 7]
- end
-
- it "raises a TypeError with range and length argument" do
- lambda { [].fill('x', 0 .. 2, 5) }.should raise_error(TypeError)
- end
-
- it "replaces elements between the (-m)th to the last and the (n+1)th from the first if given an range m..n where m < 0 and n >= 0" do
- [1, 2, 3, 4, 5, 6].fill('x', -4..4).should == [1, 2, 'x', 'x', 'x', 6]
- [1, 2, 3, 4, 5, 6].fill('x', -4...4).should == [1, 2, 'x', 'x', 5, 6]
-
- [1, 2, 3, 4, 5, 6].fill(-4..4){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
- [1, 2, 3, 4, 5, 6].fill(-4...4){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
- end
-
- it "replaces elements between the (-m)th and (-n)th to the last if given an range m..n where m < 0 and n < 0" do
- [1, 2, 3, 4, 5, 6].fill('x', -4..-2).should == [1, 2, 'x', 'x', 'x', 6]
- [1, 2, 3, 4, 5, 6].fill('x', -4...-2).should == [1, 2, 'x', 'x', 5, 6]
-
- [1, 2, 3, 4, 5, 6].fill(-4..-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
- [1, 2, 3, 4, 5, 6].fill(-4...-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
- end
-
- it "replaces elements between the (m+1)th from the first and (-n)th to the last if given an range m..n where m >= 0 and n < 0" do
- [1, 2, 3, 4, 5, 6].fill('x', 2..-2).should == [1, 2, 'x', 'x', 'x', 6]
- [1, 2, 3, 4, 5, 6].fill('x', 2...-2).should == [1, 2, 'x', 'x', 5, 6]
-
- [1, 2, 3, 4, 5, 6].fill(2..-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', '5', 6]
- [1, 2, 3, 4, 5, 6].fill(2...-2){|i| (i+1).to_s}.should == [1, 2, '3', '4', 5, 6]
- end
-
- it "makes no modifications if given an range which implies a section of zero width" do
- [1, 2, 3, 4, 5, 6].fill('x', 2...2).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', -4...2).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', -4...-4).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', 2...-4).should == [1, 2, 3, 4, 5, 6]
-
- [1, 2, 3, 4, 5, 6].fill(2...2, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(-4...2, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(-4...-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(2...-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- end
-
- it "makes no modifications if given an range which implies a section of negative width" do
- [1, 2, 3, 4, 5, 6].fill('x', 2..1).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', -4..1).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', -2..-4).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill('x', 2..-5).should == [1, 2, 3, 4, 5, 6]
-
- [1, 2, 3, 4, 5, 6].fill(2..1, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(-4..1, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(-2..-4, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- [1, 2, 3, 4, 5, 6].fill(2..-5, &@never_passed).should == [1, 2, 3, 4, 5, 6]
- end
-
- it "raises an exception if some of the given range lies before the first of the array" do
- lambda { [1, 2, 3].fill('x', -5..-3) }.should raise_error(RangeError)
- lambda { [1, 2, 3].fill('x', -5...-3) }.should raise_error(RangeError)
- lambda { [1, 2, 3].fill('x', -5..-4) }.should raise_error(RangeError)
-
- lambda { [1, 2, 3].fill(-5..-3, &@never_passed) }.should raise_error(RangeError)
- lambda { [1, 2, 3].fill(-5...-3, &@never_passed) }.should raise_error(RangeError)
- lambda { [1, 2, 3].fill(-5..-4, &@never_passed) }.should raise_error(RangeError)
- end
-
- it "tries to convert the start and end of the passed range to Integers using #to_int" do
- obj = mock('to_int')
- def obj.<=>(rhs); rhs == self ? 0 : nil end
- obj.should_receive(:to_int).twice.and_return(2)
- filler = mock('filler')
- filler.should_not_receive(:to_int)
- [1, 2, 3, 4, 5].fill(filler, obj..obj).should == [1, 2, filler, 4, 5]
- end
-
- it "raises a TypeError if the start or end of the passed range is not numeric" do
- obj = mock('nonnumeric')
- def obj.<=>(rhs); rhs == self ? 0 : nil end
- lambda { [].fill('a', obj..obj) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/array/find_index_spec.rb b/spec/ruby/core/array/find_index_spec.rb
deleted file mode 100644
index 522b4b31c6..0000000000
--- a/spec/ruby/core/array/find_index_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/index', __FILE__)
-
-describe "Array#find_index" do
- it_behaves_like :array_index, :find_index
-end
diff --git a/spec/ruby/core/array/first_spec.rb b/spec/ruby/core/array/first_spec.rb
deleted file mode 100644
index 60a0a76594..0000000000
--- a/spec/ruby/core/array/first_spec.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#first" do
- it "returns the first element" do
- %w{a b c}.first.should == 'a'
- [nil].first.should == nil
- end
-
- it "returns nil if self is empty" do
- [].first.should == nil
- end
-
- it "returns the first count elements if given a count" do
- [true, false, true, nil, false].first(2).should == [true, false]
- end
-
- it "returns an empty array when passed count on an empty array" do
- [].first(0).should == []
- [].first(1).should == []
- [].first(2).should == []
- end
-
- it "returns an empty array when passed count == 0" do
- [1, 2, 3, 4, 5].first(0).should == []
- end
-
- it "returns an array containing the first element when passed count == 1" do
- [1, 2, 3, 4, 5].first(1).should == [1]
- end
-
- it "raises an ArgumentError when count is negative" do
- lambda { [1, 2].first(-1) }.should raise_error(ArgumentError)
- end
-
- it "raises a RangeError when count is a Bignum" do
- lambda { [].first(bignum_value) }.should raise_error(RangeError)
- end
-
- it "returns the entire array when count > length" do
- [1, 2, 3, 4, 5, 9].first(10).should == [1, 2, 3, 4, 5, 9]
- end
-
- it "returns an array which is independent to the original when passed count" do
- ary = [1, 2, 3, 4, 5]
- ary.first(0).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- ary.first(1).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- ary.first(6).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.first.should equal(empty)
-
- ary = ArraySpecs.head_recursive_array
- ary.first.should equal(ary)
- end
-
- it "tries to convert the passed argument to an Integer using #to_int" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- [1, 2, 3, 4, 5].first(obj).should == [1, 2]
- end
-
- it "raises a TypeError if the passed argument is not numeric" do
- lambda { [1,2].first(nil) }.should raise_error(TypeError)
- lambda { [1,2].first("a") }.should raise_error(TypeError)
-
- obj = mock("nonnumeric")
- lambda { [1,2].first(obj) }.should raise_error(TypeError)
- end
-
- it "does not return subclass instance when passed count on Array subclasses" do
- ArraySpecs::MyArray[].first(0).should be_an_instance_of(Array)
- ArraySpecs::MyArray[].first(2).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].first(0).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].first(1).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].first(2).should be_an_instance_of(Array)
- end
-
- it "is not destructive" do
- a = [1, 2, 3]
- a.first
- a.should == [1, 2, 3]
- a.first(2)
- a.should == [1, 2, 3]
- a.first(3)
- a.should == [1, 2, 3]
- end
-end
diff --git a/spec/ruby/core/array/fixtures/classes.rb b/spec/ruby/core/array/fixtures/classes.rb
deleted file mode 100644
index 4292554724..0000000000
--- a/spec/ruby/core/array/fixtures/classes.rb
+++ /dev/null
@@ -1,525 +0,0 @@
-class Object
- # This helper is defined here rather than in MSpec because
- # it is only used in #pack specs.
- def pack_format(count=nil, repeat=nil)
- format = "#{instance_variable_get(:@method)}#{count}"
- format *= repeat if repeat
- format
- end
-end
-
-module ArraySpecs
- SampleRange = 0..1000
- SampleCount = 1000
-
- def self.frozen_array
- frozen_array = [1,2,3]
- frozen_array.freeze
- frozen_array
- end
-
- def self.empty_frozen_array
- frozen_array = []
- frozen_array.freeze
- frozen_array
- end
-
- def self.recursive_array
- a = [1, 'two', 3.0]
- 5.times { a << a }
- a
- end
-
- def self.head_recursive_array
- a = []
- 5.times { a << a }
- a << 1 << 'two' << 3.0
- a
- end
-
- def self.empty_recursive_array
- a = []
- a << a
- a
- end
-
- class MyArray < Array
- # The #initialize method has a different signature than Array to help
- # catch places in the specs that do not assert the #initialize is not
- # called when Array methods make new instances.
- def initialize(a, b)
- self << a << b
- ScratchPad.record :my_array_initialize
- end
- end
-
- class Sexp < Array
- def initialize(*args)
- super(args)
- end
- end
-
- # TODO: replace specs that use this with #should_not_receive(:to_ary)
- # expectations on regular objects (e.g. Array instances).
- class ToAryArray < Array
- def to_ary() ["to_ary", "was", "called!"] end
- end
-
- class MyRange < Range; end
-
- class AssocKey
- def ==(other); other == 'it'; end
- end
-
- class D
- def <=>(obj)
- return 4 <=> obj unless obj.class == D
- 0
- end
- end
-
- class SubArray < Array
- def initialize(*args)
- ScratchPad.record args
- end
- end
-
- class ArrayConvertable
- attr_accessor :called
- def initialize(*values, &block)
- @values = values;
- end
-
- def to_a
- self.called = :to_a
- @values
- end
-
- def to_ary
- self.called = :to_ary
- @values
- end
- end
-
- class SortSame
- def <=>(other); 0; end
- def ==(other); true; end
- end
-
- class UFOSceptic
- def <=>(other); raise "N-uh, UFO:s do not exist!"; end
- end
-
- class MockForCompared
- @@count = 0
- @@compared = false
- def initialize
- @@compared = false
- @order = (@@count += 1)
- end
- def <=>(rhs)
- @@compared = true
- return rhs.order <=> self.order
- end
- def self.compared?
- @@compared
- end
-
- protected
- attr_accessor :order
- end
-
- class ComparableWithFixnum
- include Comparable
- def initialize(num)
- @num = num
- end
-
- def <=>(fixnum)
- @num <=> fixnum
- end
- end
-
- class Uncomparable
- def <=>(obj)
- nil
- end
- end
-
- def self.universal_pack_object
- obj = mock("string float int")
- obj.stub!(:to_int).and_return(1)
- obj.stub!(:to_str).and_return("1")
- obj.stub!(:to_f).and_return(1.0)
- obj
- end
-
- LargeArray = ["test_create_table_with_force_true_does_not_drop_nonexisting_table",
- "test_add_table",
- "assert_difference",
- "assert_operator",
- "instance_variables",
- "class",
- "instance_variable_get",
- "__class__",
- "expects",
- "assert_no_difference",
- "name",
- "assert_blank",
- "assert_not_same",
- "is_a?",
- "test_add_table_with_decimals",
- "test_create_table_with_timestamps_should_create_datetime_columns",
- "assert_present",
- "assert_no_match",
- "__instance_of__",
- "assert_deprecated",
- "assert",
- "assert_throws",
- "kind_of?",
- "try",
- "__instance_variable_get__",
- "object_id",
- "timeout",
- "instance_variable_set",
- "assert_nothing_thrown",
- "__instance_variable_set__",
- "copy_object",
- "test_create_table_with_timestamps_should_create_datetime_columns_with_options",
- "assert_not_deprecated",
- "assert_in_delta",
- "id",
- "copy_metaclass",
- "test_create_table_without_a_block",
- "dup",
- "assert_not_nil",
- "send",
- "__instance_variables__",
- "to_sql",
- "mock",
- "assert_send",
- "instance_variable_defined?",
- "clone",
- "require",
- "test_migrator",
- "__instance_variable_defined_eh__",
- "frozen?",
- "test_add_column_not_null_with_default",
- "freeze",
- "test_migrator_one_up",
- "test_migrator_one_down",
- "singleton_methods",
- "method_exists?",
- "create_fixtures",
- "test_migrator_one_up_one_down",
- "test_native_decimal_insert_manual_vs_automatic",
- "instance_exec",
- "__is_a__",
- "test_migrator_double_up",
- "stub",
- "private_methods",
- "stubs",
- "test_migrator_double_down",
- "fixture_path",
- "private_singleton_methods",
- "stub_everything",
- "test_migrator_one_up_with_exception_and_rollback",
- "sequence",
- "protected_methods",
- "enum_for",
- "test_finds_migrations",
- "run_before_mocha",
- "states",
- "protected_singleton_methods",
- "to_json",
- "instance_values",
- "==",
- "mocha_setup",
- "public_methods",
- "test_finds_pending_migrations",
- "mocha_verify",
- "assert_kind_of",
- "===",
- "=~",
- "test_relative_migrations",
- "mocha_teardown",
- "gem",
- "mocha",
- "test_only_loads_pending_migrations",
- "test_add_column_with_precision_and_scale",
- "require_or_load",
- "eql?",
- "require_dependency",
- "test_native_types",
- "test_target_version_zero_should_run_only_once",
- "extend",
- "to_matcher",
- "unloadable",
- "require_association",
- "hash",
- "__id__",
- "load_dependency",
- "equals",
- "test_migrator_db_has_no_schema_migrations_table",
- "test_migrator_verbosity",
- "kind_of",
- "to_yaml",
- "to_bool",
- "test_migrator_verbosity_off",
- "taint",
- "test_migrator_going_down_due_to_version_target",
- "tainted?",
- "mocha_inspect",
- "test_migrator_rollback",
- "vim",
- "untaint",
- "taguri=",
- "test_migrator_forward",
- "test_schema_migrations_table_name",
- "test_proper_table_name",
- "all_of",
- "test_add_drop_table_with_prefix_and_suffix",
- "_setup_callbacks",
- "setup",
- "Not",
- "test_create_table_with_binary_column",
- "assert_not_equal",
- "enable_warnings",
- "acts_like?",
- "Rational",
- "_removed_setup_callbacks",
- "Table",
- "bind",
- "any_of",
- "__method__",
- "test_migrator_with_duplicates",
- "_teardown_callbacks",
- "method",
- "test_migrator_with_duplicate_names",
- "_removed_teardown_callbacks",
- "any_parameters",
- "test_migrator_with_missing_version_numbers",
- "test_add_remove_single_field_using_string_arguments",
- "test_create_table_with_custom_sequence_name",
- "test_add_remove_single_field_using_symbol_arguments",
- "_one_time_conditions_valid_14?",
- "_one_time_conditions_valid_16?",
- "run_callbacks",
- "anything",
- "silence_warnings",
- "instance_variable_names",
- "_fixture_path",
- "copy_instance_variables_from",
- "fixture_path?",
- "has_entry",
- "__marshal__",
- "_fixture_table_names",
- "__kind_of__",
- "fixture_table_names?",
- "test_add_rename",
- "assert_equal",
- "_fixture_class_names",
- "fixture_class_names?",
- "has_entries",
- "_use_transactional_fixtures",
- "people",
- "test_rename_column_using_symbol_arguments",
- "use_transactional_fixtures?",
- "instance_eval",
- "blank?",
- "with_warnings",
- "__nil__",
- "load",
- "metaclass",
- "_use_instantiated_fixtures",
- "has_key",
- "class_eval",
- "present?",
- "test_rename_column",
- "teardown",
- "use_instantiated_fixtures?",
- "method_name",
- "silence_stderr",
- "presence",
- "test_rename_column_preserves_default_value_not_null",
- "silence_stream",
- "_pre_loaded_fixtures",
- "__metaclass__",
- "__fixnum__",
- "pre_loaded_fixtures?",
- "has_value",
- "suppress",
- "to_yaml_properties",
- "test_rename_nonexistent_column",
- "test_add_index",
- "includes",
- "find_correlate_in",
- "equality_predicate_sql",
- "assert_nothing_raised",
- "let",
- "not_predicate_sql",
- "test_rename_column_with_sql_reserved_word",
- "singleton_class",
- "test_rename_column_with_an_index",
- "display",
- "taguri",
- "to_yaml_style",
- "test_remove_column_with_index",
- "size",
- "current_adapter?",
- "test_remove_column_with_multi_column_index",
- "respond_to?",
- "test_change_type_of_not_null_column",
- "is_a",
- "to_a",
- "test_rename_table_for_sqlite_should_work_with_reserved_words",
- "require_library_or_gem",
- "setup_fixtures",
- "equal?",
- "teardown_fixtures",
- "nil?",
- "fixture_table_names",
- "fixture_class_names",
- "test_create_table_without_id",
- "use_transactional_fixtures",
- "test_add_column_with_primary_key_attribute",
- "repair_validations",
- "use_instantiated_fixtures",
- "instance_of?",
- "test_create_table_adds_id",
- "test_rename_table",
- "pre_loaded_fixtures",
- "to_enum",
- "test_create_table_with_not_null_column",
- "instance_of",
- "test_change_column_nullability",
- "optionally",
- "test_rename_table_with_an_index",
- "run",
- "test_change_column",
- "default_test",
- "assert_raise",
- "test_create_table_with_defaults",
- "assert_nil",
- "flunk",
- "regexp_matches",
- "duplicable?",
- "reset_mocha",
- "stubba_method",
- "filter_backtrace",
- "test_create_table_with_limits",
- "responds_with",
- "stubba_object",
- "test_change_column_with_nil_default",
- "assert_block",
- "__show__",
- "assert_date_from_db",
- "__respond_to_eh__",
- "run_in_transaction?",
- "inspect",
- "assert_sql",
- "test_change_column_with_new_default",
- "yaml_equivalent",
- "build_message",
- "to_s",
- "test_change_column_default",
- "assert_queries",
- "pending",
- "as_json",
- "assert_no_queries",
- "test_change_column_quotes_column_names",
- "assert_match",
- "test_keeping_default_and_notnull_constaint_on_change",
- "methods",
- "connection_allow_concurrency_setup",
- "connection_allow_concurrency_teardown",
- "test_create_table_with_primary_key_prefix_as_table_name_with_underscore",
- "__send__",
- "make_connection",
- "assert_raises",
- "tap",
- "with_kcode",
- "assert_instance_of",
- "test_create_table_with_primary_key_prefix_as_table_name",
- "assert_respond_to",
- "test_change_column_default_to_null",
- "assert_same",
- "__extend__"]
-
- LargeTestArraySorted = ["test_add_column_not_null_with_default",
- "test_add_column_with_precision_and_scale",
- "test_add_column_with_primary_key_attribute",
- "test_add_drop_table_with_prefix_and_suffix",
- "test_add_index",
- "test_add_remove_single_field_using_string_arguments",
- "test_add_remove_single_field_using_symbol_arguments",
- "test_add_rename",
- "test_add_table",
- "test_add_table_with_decimals",
- "test_change_column",
- "test_change_column_default",
- "test_change_column_default_to_null",
- "test_change_column_nullability",
- "test_change_column_quotes_column_names",
- "test_change_column_with_new_default",
- "test_change_column_with_nil_default",
- "test_change_type_of_not_null_column",
- "test_create_table_adds_id",
- "test_create_table_with_binary_column",
- "test_create_table_with_custom_sequence_name",
- "test_create_table_with_defaults",
- "test_create_table_with_force_true_does_not_drop_nonexisting_table",
- "test_create_table_with_limits",
- "test_create_table_with_not_null_column",
- "test_create_table_with_primary_key_prefix_as_table_name",
- "test_create_table_with_primary_key_prefix_as_table_name_with_underscore",
- "test_create_table_with_timestamps_should_create_datetime_columns",
- "test_create_table_with_timestamps_should_create_datetime_columns_with_options",
- "test_create_table_without_a_block",
- "test_create_table_without_id",
- "test_finds_migrations",
- "test_finds_pending_migrations",
- "test_keeping_default_and_notnull_constaint_on_change",
- "test_migrator",
- "test_migrator_db_has_no_schema_migrations_table",
- "test_migrator_double_down",
- "test_migrator_double_up",
- "test_migrator_forward",
- "test_migrator_going_down_due_to_version_target",
- "test_migrator_one_down",
- "test_migrator_one_up",
- "test_migrator_one_up_one_down",
- "test_migrator_one_up_with_exception_and_rollback",
- "test_migrator_rollback",
- "test_migrator_verbosity",
- "test_migrator_verbosity_off",
- "test_migrator_with_duplicate_names",
- "test_migrator_with_duplicates",
- "test_migrator_with_missing_version_numbers",
- "test_native_decimal_insert_manual_vs_automatic",
- "test_native_types",
- "test_only_loads_pending_migrations",
- "test_proper_table_name",
- "test_relative_migrations",
- "test_remove_column_with_index",
- "test_remove_column_with_multi_column_index",
- "test_rename_column",
- "test_rename_column_preserves_default_value_not_null",
- "test_rename_column_using_symbol_arguments",
- "test_rename_column_with_an_index",
- "test_rename_column_with_sql_reserved_word",
- "test_rename_nonexistent_column",
- "test_rename_table",
- "test_rename_table_for_sqlite_should_work_with_reserved_words",
- "test_rename_table_with_an_index",
- "test_schema_migrations_table_name",
- "test_target_version_zero_should_run_only_once"]
-
- class PrivateToAry
- private
-
- def to_ary
- [1, 2, 3]
- end
- end
-end
diff --git a/spec/ruby/core/array/fixtures/encoded_strings.rb b/spec/ruby/core/array/fixtures/encoded_strings.rb
deleted file mode 100644
index e31e247afe..0000000000
--- a/spec/ruby/core/array/fixtures/encoded_strings.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# encoding: utf-8
-module ArraySpecs
- def self.array_with_usascii_and_7bit_utf8_strings
- [
- 'foo'.force_encoding('US-ASCII'),
- 'bar'
- ]
- end
-
- def self.array_with_usascii_and_utf8_strings
- [
- 'foo'.force_encoding('US-ASCII'),
- 'báz'
- ]
- end
-
- def self.array_with_7bit_utf8_and_usascii_strings
- [
- 'bar',
- 'foo'.force_encoding('US-ASCII')
- ]
- end
-
- def self.array_with_utf8_and_usascii_strings
- [
- 'báz',
- 'bar',
- 'foo'.force_encoding('US-ASCII')
- ]
- end
-
- def self.array_with_usascii_and_utf8_strings
- [
- 'foo'.force_encoding('US-ASCII'),
- 'bar',
- 'báz'
- ]
- end
-
- def self.array_with_utf8_and_7bit_ascii8bit_strings
- [
- 'bar',
- 'báz',
- 'foo'.force_encoding('ASCII-8BIT')
- ]
- end
-
- def self.array_with_utf8_and_ascii8bit_strings
- [
- 'bar',
- 'báz',
- [255].pack('C').force_encoding('ASCII-8BIT')
- ]
- end
-
- def self.array_with_usascii_and_7bit_ascii8bit_strings
- [
- 'bar'.force_encoding('US-ASCII'),
- 'foo'.force_encoding('ASCII-8BIT')
- ]
- end
-
- def self.array_with_usascii_and_ascii8bit_strings
- [
- 'bar'.force_encoding('US-ASCII'),
- [255].pack('C').force_encoding('ASCII-8BIT')
- ]
- end
-end
diff --git a/spec/ruby/core/array/flatten_spec.rb b/spec/ruby/core/array/flatten_spec.rb
deleted file mode 100644
index 3b20e976b6..0000000000
--- a/spec/ruby/core/array/flatten_spec.rb
+++ /dev/null
@@ -1,286 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#flatten" do
- it "returns a one-dimensional flattening recursively" do
- [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []].flatten.should == [1, 2, 3, 2, 3, 4, 4, 5, 5, 1, 2, 3, 4]
- end
-
- it "takes an optional argument that determines the level of recursion" do
- [ 1, 2, [3, [4, 5] ] ].flatten(1).should == [1, 2, 3, [4, 5]]
- end
-
- it "returns dup when the level of recursion is 0" do
- a = [ 1, 2, [3, [4, 5] ] ]
- a.flatten(0).should == a
- a.flatten(0).should_not equal(a)
- end
-
- it "ignores negative levels" do
- [ 1, 2, [ 3, 4, [5, 6] ] ].flatten(-1).should == [1, 2, 3, 4, 5, 6]
- [ 1, 2, [ 3, 4, [5, 6] ] ].flatten(-10).should == [1, 2, 3, 4, 5, 6]
- end
-
- it "tries to convert passed Objects to Integers using #to_int" do
- obj = mock("Converted to Integer")
- obj.should_receive(:to_int).and_return(1)
-
- [ 1, 2, [3, [4, 5] ] ].flatten(obj).should == [1, 2, 3, [4, 5]]
- end
-
- it "raises a TypeError when the passed Object can't be converted to an Integer" do
- obj = mock("Not converted")
- lambda { [ 1, 2, [3, [4, 5] ] ].flatten(obj) }.should raise_error(TypeError)
- end
-
- it "does not call flatten on elements" do
- obj = mock('[1,2]')
- obj.should_not_receive(:flatten)
- [obj, obj].flatten.should == [obj, obj]
-
- obj = [5, 4]
- obj.should_not_receive(:flatten)
- [obj, obj].flatten.should == [5, 4, 5, 4]
- end
-
- it "raises an ArgumentError on recursive arrays" do
- x = []
- x << x
- lambda { x.flatten }.should raise_error(ArgumentError)
-
- x = []
- y = []
- x << y
- y << x
- lambda { x.flatten }.should raise_error(ArgumentError)
- end
-
- it "flattens any element which responds to #to_ary, using the return value of said method" do
- x = mock("[3,4]")
- x.should_receive(:to_ary).at_least(:once).and_return([3, 4])
- [1, 2, x, 5].flatten.should == [1, 2, 3, 4, 5]
-
- y = mock("MyArray[]")
- y.should_receive(:to_ary).at_least(:once).and_return(ArraySpecs::MyArray[])
- [y].flatten.should == []
-
- z = mock("[2,x,y,5]")
- z.should_receive(:to_ary).and_return([2, x, y, 5])
- [1, z, 6].flatten.should == [1, 2, 3, 4, 5, 6]
- end
-
- ruby_version_is "2.3" do
- it "does not call #to_ary on elements beyond the given level" do
- obj = mock("1")
- obj.should_not_receive(:to_ary)
- [[obj]].flatten(1)
- end
- end
-
- it "returns subclass instance for Array subclasses" do
- ArraySpecs::MyArray[].flatten.should be_an_instance_of(ArraySpecs::MyArray)
- ArraySpecs::MyArray[1, 2, 3].flatten.should be_an_instance_of(ArraySpecs::MyArray)
- ArraySpecs::MyArray[1, [2], 3].flatten.should be_an_instance_of(ArraySpecs::MyArray)
- ArraySpecs::MyArray[1, [2, 3], 4].flatten.should == ArraySpecs::MyArray[1, 2, 3, 4]
- [ArraySpecs::MyArray[1, 2, 3]].flatten.should be_an_instance_of(Array)
- end
-
- it "is not destructive" do
- ary = [1, [2, 3]]
- ary.flatten
- ary.should == [1, [2, 3]]
- end
-
- describe "with a non-Array object in the Array" do
- before :each do
- @obj = mock("Array#flatten")
- ScratchPad.record []
- end
-
- it "does not call #to_ary if the method is not defined" do
- [@obj].flatten.should == [@obj]
- end
-
- it "does not raise an exception if #to_ary returns nil" do
- @obj.should_receive(:to_ary).and_return(nil)
- [@obj].flatten.should == [@obj]
- end
-
- it "raises a TypeError if #to_ary does not return an Array" do
- @obj.should_receive(:to_ary).and_return(1)
- lambda { [@obj].flatten }.should raise_error(TypeError)
- end
-
- ruby_version_is ""..."2.5" do
- it "calls respond_to_missing?(:to_ary, false) to try coercing" do
- def @obj.respond_to_missing?(*args) ScratchPad << args; false end
- [@obj].flatten.should == [@obj]
- ScratchPad.recorded.should == [[:to_ary, false]]
- end
- end
-
- ruby_version_is "2.5" do
- it "calls respond_to_missing?(:to_ary, true) to try coercing" do
- def @obj.respond_to_missing?(*args) ScratchPad << args; false end
- [@obj].flatten.should == [@obj]
- ScratchPad.recorded.should == [[:to_ary, true]]
- end
- end
-
- it "does not call #to_ary if not defined when #respond_to_missing? returns false" do
- def @obj.respond_to_missing?(name, priv) ScratchPad << name; false end
-
- [@obj].flatten.should == [@obj]
- ScratchPad.recorded.should == [:to_ary]
- end
-
- it "calls #to_ary if not defined when #respond_to_missing? returns true" do
- def @obj.respond_to_missing?(name, priv) ScratchPad << name; true end
-
- lambda { [@obj].flatten }.should raise_error(NoMethodError)
- ScratchPad.recorded.should == [:to_ary]
- end
-
- it "calls #method_missing if defined" do
- @obj.should_receive(:method_missing).with(:to_ary).and_return([1, 2, 3])
- [@obj].flatten.should == [1, 2, 3]
- end
- end
-
- it "returns a tainted array if self is tainted" do
- [].taint.flatten.tainted?.should be_true
- end
-
- it "returns an untrusted array if self is untrusted" do
- [].untrust.flatten.untrusted?.should be_true
- end
-
- it "performs respond_to? and method_missing-aware checks when coercing elements to array" do
- bo = BasicObject.new
- [bo].flatten.should == [bo]
-
- def bo.method_missing(name, *)
- [1,2]
- end
-
- [bo].flatten.should == [1,2]
-
- def bo.respond_to?(name, *)
- false
- end
-
- [bo].flatten.should == [bo]
-
- def bo.respond_to?(name, *)
- true
- end
-
- [bo].flatten.should == [1,2]
- end
-end
-
-describe "Array#flatten!" do
- it "modifies array to produce a one-dimensional flattening recursively" do
- a = [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []]
- a.flatten!
- a.should == [1, 2, 3, 2, 3, 4, 4, 5, 5, 1, 2, 3, 4]
- end
-
- it "returns self if made some modifications" do
- a = [[[1, [2, 3]],[2, 3, [4, [4, [5, 5]], [1, 2, 3]]], [4]], []]
- a.flatten!.should equal(a)
- end
-
- it "returns nil if no modifications took place" do
- a = [1, 2, 3]
- a.flatten!.should == nil
- a = [1, [2, 3]]
- a.flatten!.should_not == nil
- end
-
- it "should not check modification by size" do
- a = [1, 2, [3]]
- a.flatten!.should_not == nil
- a.should == [1, 2, 3]
- end
-
- it "takes an optional argument that determines the level of recursion" do
- [ 1, 2, [3, [4, 5] ] ].flatten!(1).should == [1, 2, 3, [4, 5]]
- end
-
- # redmine #1440
- it "returns nil when the level of recursion is 0" do
- a = [ 1, 2, [3, [4, 5] ] ]
- a.flatten!(0).should == nil
- end
-
- it "treats negative levels as no arguments" do
- [ 1, 2, [ 3, 4, [5, 6] ] ].flatten!(-1).should == [1, 2, 3, 4, 5, 6]
- [ 1, 2, [ 3, 4, [5, 6] ] ].flatten!(-10).should == [1, 2, 3, 4, 5, 6]
- end
-
- it "tries to convert passed Objects to Integers using #to_int" do
- obj = mock("Converted to Integer")
- obj.should_receive(:to_int).and_return(1)
-
- [ 1, 2, [3, [4, 5] ] ].flatten!(obj).should == [1, 2, 3, [4, 5]]
- end
-
- it "raises a TypeError when the passed Object can't be converted to an Integer" do
- obj = mock("Not converted")
- lambda { [ 1, 2, [3, [4, 5] ] ].flatten!(obj) }.should raise_error(TypeError)
- end
-
- it "does not call flatten! on elements" do
- obj = mock('[1,2]')
- obj.should_not_receive(:flatten!)
- [obj, obj].flatten!.should == nil
-
- obj = [5, 4]
- obj.should_not_receive(:flatten!)
- [obj, obj].flatten!.should == [5, 4, 5, 4]
- end
-
- it "raises an ArgumentError on recursive arrays" do
- x = []
- x << x
- lambda { x.flatten! }.should raise_error(ArgumentError)
-
- x = []
- y = []
- x << y
- y << x
- lambda { x.flatten! }.should raise_error(ArgumentError)
- end
-
- it "flattens any elements which responds to #to_ary, using the return value of said method" do
- x = mock("[3,4]")
- x.should_receive(:to_ary).at_least(:once).and_return([3, 4])
- [1, 2, x, 5].flatten!.should == [1, 2, 3, 4, 5]
-
- y = mock("MyArray[]")
- y.should_receive(:to_ary).at_least(:once).and_return(ArraySpecs::MyArray[])
- [y].flatten!.should == []
-
- z = mock("[2,x,y,5]")
- z.should_receive(:to_ary).and_return([2, x, y, 5])
- [1, z, 6].flatten!.should == [1, 2, 3, 4, 5, 6]
-
- ary = [ArraySpecs::MyArray[1, 2, 3]]
- ary.flatten!
- ary.should be_an_instance_of(Array)
- ary.should == [1, 2, 3]
- end
-
- it "raises a RuntimeError on frozen arrays when the array is modified" do
- nested_ary = [1, 2, []]
- nested_ary.freeze
- lambda { nested_ary.flatten! }.should raise_error(RuntimeError)
- end
-
- # see [ruby-core:23663]
- it "raises a RuntimeError on frozen arrays when the array would not be modified" do
- lambda { ArraySpecs.frozen_array.flatten! }.should raise_error(RuntimeError)
- lambda { ArraySpecs.empty_frozen_array.flatten! }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/frozen_spec.rb b/spec/ruby/core/array/frozen_spec.rb
deleted file mode 100644
index 6c8384f5f7..0000000000
--- a/spec/ruby/core/array/frozen_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#frozen?" do
- it "returns true if array is frozen" do
- a = [1, 2, 3]
- a.frozen?.should == false
- a.freeze
- a.frozen?.should == true
- end
-
- it "returns false for an array being sorted by #sort" do
- a = [1, 2, 3]
- a.sort { |x,y| a.frozen?.should == false; x <=> y }
- end
-end
diff --git a/spec/ruby/core/array/hash_spec.rb b/spec/ruby/core/array/hash_spec.rb
deleted file mode 100644
index b576cbbdc6..0000000000
--- a/spec/ruby/core/array/hash_spec.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#hash" do
- it "returns the same fixnum for arrays with the same content" do
- [].respond_to?(:hash).should == true
-
- [[], [1, 2, 3]].each do |ary|
- ary.hash.should == ary.dup.hash
- ary.hash.should be_an_instance_of(Fixnum)
- end
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- lambda { empty.hash }.should_not raise_error
-
- array = ArraySpecs.recursive_array
- lambda { array.hash }.should_not raise_error
- end
-
- it "returns the same hash for equal recursive arrays" do
- rec = []; rec << rec
- rec.hash.should == [rec].hash
- rec.hash.should == [[rec]].hash
- # This is because rec.eql?([[rec]])
- # Remember that if two objects are eql?
- # then the need to have the same hash
- # Check the Array#eql? specs!
- end
-
- it "returns the same hash for equal recursive arrays through hashes" do
- h = {} ; rec = [h] ; h[:x] = rec
- rec.hash.should == [h].hash
- rec.hash.should == [{x: rec}].hash
- # Like above, this is because rec.eql?([{x: rec}])
- end
-
- it "calls to_int on result of calling hash on each element" do
- ary = Array.new(5) do
- obj = mock('0')
- obj.should_receive(:hash).and_return(obj)
- obj.should_receive(:to_int).and_return(0)
- obj
- end
-
- ary.hash
-
-
- hash = mock('1')
- hash.should_receive(:to_int).and_return(1.hash)
-
- obj = mock('@hash')
- obj.instance_variable_set(:@hash, hash)
- def obj.hash() @hash end
-
- [obj].hash.should == [1].hash
- end
-
- it "ignores array class differences" do
- ArraySpecs::MyArray[].hash.should == [].hash
- ArraySpecs::MyArray[1, 2].hash.should == [1, 2].hash
- end
-
- it "returns same hash code for arrays with the same content" do
- a = [1, 2, 3, 4]
- a.fill 'a', 0..3
- b = %w|a a a a|
- a.hash.should == b.hash
- end
-
- it "returns the same value if arrays are #eql?" do
- a = [1, 2, 3, 4]
- a.fill 'a', 0..3
- b = %w|a a a a|
- a.hash.should == b.hash
- a.should eql(b)
- end
-
- it "produces different hashes for nested arrays with different values and empty terminator" do
- [1, [1, []]].hash.should_not == [2, [2, []]].hash
- end
-end
diff --git a/spec/ruby/core/array/include_spec.rb b/spec/ruby/core/array/include_spec.rb
deleted file mode 100644
index 26d788afeb..0000000000
--- a/spec/ruby/core/array/include_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#include?" do
- it "returns true if object is present, false otherwise" do
- [1, 2, "a", "b"].include?("c").should == false
- [1, 2, "a", "b"].include?("a").should == true
- end
-
- it "determines presence by using element == obj" do
- o = mock('')
-
- [1, 2, "a", "b"].include?(o).should == false
-
- def o.==(other); other == 'a'; end
-
- [1, 2, o, "b"].include?('a').should == true
-
- [1, 2.0, 3].include?(2).should == true
- end
-
- it "calls == on elements from left to right until success" do
- key = "x"
- one = mock('one')
- two = mock('two')
- three = mock('three')
- one.should_receive(:==).any_number_of_times.and_return(false)
- two.should_receive(:==).any_number_of_times.and_return(true)
- three.should_not_receive(:==)
- ary = [one, two, three]
- ary.include?(key).should == true
- end
-end
diff --git a/spec/ruby/core/array/index_spec.rb b/spec/ruby/core/array/index_spec.rb
deleted file mode 100644
index 55ed7b2a94..0000000000
--- a/spec/ruby/core/array/index_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/index', __FILE__)
-
-describe "Array#index" do
- it_behaves_like(:array_index, :index)
-end
diff --git a/spec/ruby/core/array/initialize_spec.rb b/spec/ruby/core/array/initialize_spec.rb
deleted file mode 100644
index 0c37c6136d..0000000000
--- a/spec/ruby/core/array/initialize_spec.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#initialize" do
- before :each do
- ScratchPad.clear
- end
-
- it "is private" do
- Array.should have_private_instance_method("initialize")
- end
-
- it "is called on subclasses" do
- b = ArraySpecs::SubArray.new :size_or_array, :obj
-
- b.should == []
- ScratchPad.recorded.should == [:size_or_array, :obj]
- end
-
- it "preserves the object's identity even when changing its value" do
- a = [1, 2, 3]
- a.send(:initialize).should equal(a)
- a.should_not == [1, 2, 3]
- end
-
- it "raises an ArgumentError if passed 3 or more arguments" do
- lambda do
- [1, 2].send :initialize, 1, 'x', true
- end.should raise_error(ArgumentError)
- lambda do
- [1, 2].send(:initialize, 1, 'x', true) {}
- end.should raise_error(ArgumentError)
- end
-
- it "raises a RuntimeError on frozen arrays" do
- lambda do
- ArraySpecs.frozen_array.send :initialize
- end.should raise_error(RuntimeError)
- lambda do
- ArraySpecs.frozen_array.send :initialize, ArraySpecs.frozen_array
- end.should raise_error(RuntimeError)
- end
-
- it "calls #to_ary to convert the value to an array, even if it's private" do
- a = ArraySpecs::PrivateToAry.new
- [].send(:initialize, a).should == [1, 2, 3]
- end
-end
-
-describe "Array#initialize with no arguments" do
- it "makes the array empty" do
- [1, 2, 3].send(:initialize).should be_empty
- end
-
- it "does not use the given block" do
- lambda{ [1, 2, 3].send(:initialize) { raise } }.should_not raise_error
- end
-end
-
-describe "Array#initialize with (array)" do
- it "replaces self with the other array" do
- b = [4, 5, 6]
- [1, 2, 3].send(:initialize, b).should == b
- end
-
- it "does not use the given block" do
- lambda{ [1, 2, 3].send(:initialize) { raise } }.should_not raise_error
- end
-
- it "calls #to_ary to convert the value to an array" do
- a = mock("array")
- a.should_receive(:to_ary).and_return([1, 2])
- a.should_not_receive(:to_int)
- [].send(:initialize, a).should == [1, 2]
- end
-
- it "does not call #to_ary on instances of Array or subclasses of Array" do
- a = [1, 2]
- a.should_not_receive(:to_ary)
- [].send(:initialize, a).should == a
- end
-
- it "raises a TypeError if an Array type argument and a default object" do
- lambda { [].send(:initialize, [1, 2], 1) }.should raise_error(TypeError)
- end
-end
-
-describe "Array#initialize with (size, object=nil)" do
- it "sets the array to size and fills with the object" do
- a = []
- obj = [3]
- a.send(:initialize, 2, obj).should == [obj, obj]
- a[0].should equal(obj)
- a[1].should equal(obj)
-
- b = []
- b.send(:initialize, 3, 14).should == [14, 14, 14]
- b.should == [14, 14, 14]
- end
-
- it "sets the array to size and fills with nil when object is omitted" do
- [].send(:initialize, 3).should == [nil, nil, nil]
- end
-
- it "raises an ArgumentError if size is negative" do
- lambda { [].send(:initialize, -1, :a) }.should raise_error(ArgumentError)
- lambda { [].send(:initialize, -1) }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError if size is too large" do
- lambda { [].send(:initialize, fixnum_max+1) }.should raise_error(ArgumentError)
- end
-
- it "calls #to_int to convert the size argument to an Integer when object is given" do
- obj = mock('1')
- obj.should_receive(:to_int).and_return(1)
- [].send(:initialize, obj, :a).should == [:a]
- end
-
- it "calls #to_int to convert the size argument to an Integer when object is not given" do
- obj = mock('1')
- obj.should_receive(:to_int).and_return(1)
- [].send(:initialize, obj).should == [nil]
- end
-
- it "raises a TypeError if the size argument is not an Integer type" do
- obj = mock('nonnumeric')
- obj.stub!(:to_ary).and_return([1, 2])
- lambda{ [].send(:initialize, obj, :a) }.should raise_error(TypeError)
- end
-
- it "yields the index of the element and sets the element to the value of the block" do
- [].send(:initialize, 3) { |i| i.to_s }.should == ['0', '1', '2']
- end
-
- it "uses the block value instead of using the default value" do
- lambda {
- @result = [].send(:initialize, 3, :obj) { |i| i.to_s }
- }.should complain(/block supersedes default value argument/)
- @result.should == ['0', '1', '2']
- end
-
- it "returns the value passed to break" do
- [].send(:initialize, 3) { break :a }.should == :a
- end
-
- it "sets the array to the values returned by the block before break is executed" do
- a = [1, 2, 3]
- a.send(:initialize, 3) do |i|
- break if i == 2
- i.to_s
- end
-
- a.should == ['0', '1']
- end
-end
diff --git a/spec/ruby/core/array/insert_spec.rb b/spec/ruby/core/array/insert_spec.rb
deleted file mode 100644
index cdf870df2a..0000000000
--- a/spec/ruby/core/array/insert_spec.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#insert" do
- it "returns self" do
- ary = []
- ary.insert(0).should equal(ary)
- ary.insert(0, :a).should equal(ary)
- end
-
- it "inserts objects before the element at index for non-negative index" do
- ary = []
- ary.insert(0, 3).should == [3]
- ary.insert(0, 1, 2).should == [1, 2, 3]
- ary.insert(0).should == [1, 2, 3]
-
- # Let's just assume insert() always modifies the array from now on.
- ary.insert(1, 'a').should == [1, 'a', 2, 3]
- ary.insert(0, 'b').should == ['b', 1, 'a', 2, 3]
- ary.insert(5, 'c').should == ['b', 1, 'a', 2, 3, 'c']
- ary.insert(7, 'd').should == ['b', 1, 'a', 2, 3, 'c', nil, 'd']
- ary.insert(10, 5, 4).should == ['b', 1, 'a', 2, 3, 'c', nil, 'd', nil, nil, 5, 4]
- end
-
- it "appends objects to the end of the array for index == -1" do
- [1, 3, 3].insert(-1, 2, 'x', 0.5).should == [1, 3, 3, 2, 'x', 0.5]
- end
-
- it "inserts objects after the element at index with negative index" do
- ary = []
- ary.insert(-1, 3).should == [3]
- ary.insert(-2, 2).should == [2, 3]
- ary.insert(-3, 1).should == [1, 2, 3]
- ary.insert(-2, -3).should == [1, 2, -3, 3]
- ary.insert(-1, []).should == [1, 2, -3, 3, []]
- ary.insert(-2, 'x', 'y').should == [1, 2, -3, 3, 'x', 'y', []]
- ary = [1, 2, 3]
- end
-
- it "pads with nils if the index to be inserted to is past the end" do
- [].insert(5, 5).should == [nil, nil, nil, nil, nil, 5]
- end
-
- it "can insert before the first element with a negative index" do
- [1, 2, 3].insert(-4, -3).should == [-3, 1, 2, 3]
- end
-
- it "raises an IndexError if the negative index is out of bounds" do
- lambda { [].insert(-2, 1) }.should raise_error(IndexError)
- lambda { [1].insert(-3, 2) }.should raise_error(IndexError)
- end
-
- it "does nothing of no object is passed" do
- [].insert(0).should == []
- [].insert(-1).should == []
- [].insert(10).should == []
- [].insert(-2).should == []
- end
-
- it "tries to convert the passed position argument to an Integer using #to_int" do
- obj = mock('2')
- obj.should_receive(:to_int).and_return(2)
- [].insert(obj, 'x').should == [nil, nil, 'x']
- end
-
- it "raises an ArgumentError if no argument passed" do
- lambda { [].insert() }.should raise_error(ArgumentError)
- end
-
- it "raises a RuntimeError on frozen arrays when the array is modified" do
- lambda { ArraySpecs.frozen_array.insert(0, 'x') }.should raise_error(RuntimeError)
- end
-
- # see [ruby-core:23666]
- it "raises a RuntimeError on frozen arrays when the array would not be modified" do
- lambda { ArraySpecs.frozen_array.insert(0) }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/inspect_spec.rb b/spec/ruby/core/array/inspect_spec.rb
deleted file mode 100644
index 9896406fd5..0000000000
--- a/spec/ruby/core/array/inspect_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/inspect', __FILE__)
-
-describe "Array#inspect" do
- it_behaves_like :array_inspect, :inspect
-end
diff --git a/spec/ruby/core/array/intersection_spec.rb b/spec/ruby/core/array/intersection_spec.rb
deleted file mode 100644
index e399509ea7..0000000000
--- a/spec/ruby/core/array/intersection_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#&" do
- it "creates an array with elements common to both arrays (intersection)" do
- ([] & []).should == []
- ([1, 2] & []).should == []
- ([] & [1, 2]).should == []
- ([ 1, 3, 5 ] & [ 1, 2, 3 ]).should == [1, 3]
- end
-
- it "creates an array with no duplicates" do
- ([ 1, 1, 3, 5 ] & [ 1, 2, 3 ]).uniq!.should == nil
- end
-
- it "creates an array with elements in order they are first encountered" do
- ([ 1, 2, 3, 2, 5 ] & [ 5, 2, 3, 4 ]).should == [2, 3, 5]
- end
-
- it "does not modify the original Array" do
- a = [1, 1, 3, 5]
- (a & [1, 2, 3]).should == [1, 3]
- a.should == [1, 1, 3, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty & empty).should == empty
-
- (ArraySpecs.recursive_array & []).should == []
- ([] & ArraySpecs.recursive_array).should == []
-
- (ArraySpecs.recursive_array & ArraySpecs.recursive_array).should == [1, 'two', 3.0, ArraySpecs.recursive_array]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('[1,2,3]')
- obj.should_receive(:to_ary).and_return([1, 2, 3])
- ([1, 2] & obj).should == ([1, 2])
- end
-
- it "determines equivalence between elements in the sense of eql?" do
- not_supported_on :opal do
- ([5.0, 4.0] & [5, 4]).should == []
- end
-
- str = "x"
- ([str] & [str.dup]).should == [str]
-
- obj1 = mock('1')
- obj2 = mock('2')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj1.should_receive(:eql?).at_least(1).and_return(true)
- obj2.stub!(:eql?).and_return(true)
-
- ([obj1] & [obj2]).should == [obj1]
- ([obj1, obj1, obj2, obj2] & [obj2]).should == [obj1]
-
- obj1 = mock('3')
- obj2 = mock('4')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj1.should_receive(:eql?).at_least(1).and_return(false)
-
- ([obj1] & [obj2]).should == []
- ([obj1, obj1, obj2, obj2] & [obj2]).should == [obj2]
- end
-
- it "does return subclass instances for Array subclasses" do
- (ArraySpecs::MyArray[1, 2, 3] & []).should be_an_instance_of(Array)
- (ArraySpecs::MyArray[1, 2, 3] & ArraySpecs::MyArray[1, 2, 3]).should be_an_instance_of(Array)
- ([] & ArraySpecs::MyArray[1, 2, 3]).should be_an_instance_of(Array)
- end
-
- it "does not call to_ary on array subclasses" do
- ([5, 6] & ArraySpecs::ToAryArray[1, 2, 5, 6]).should == [5, 6]
- end
-
- it "properly handles an identical item even when its #eql? isn't reflexive" do
- x = mock('x')
- x.stub!(:hash).and_return(42)
- x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI.
-
- ([x] & [x]).should == [x]
- end
-end
diff --git a/spec/ruby/core/array/join_spec.rb b/spec/ruby/core/array/join_spec.rb
deleted file mode 100644
index c4c6277c87..0000000000
--- a/spec/ruby/core/array/join_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/join', __FILE__)
-
-describe "Array#join" do
- it_behaves_like :array_join_with_string_separator, :join
- it_behaves_like :array_join_with_default_separator, :join
-
- it "does not separate elements when the passed separator is nil" do
- [1, 2, 3].join(nil).should == '123'
- end
-
- it "calls #to_str to convert the separator to a String" do
- sep = mock("separator")
- sep.should_receive(:to_str).and_return(", ")
- [1, 2].join(sep).should == "1, 2"
- end
-
- it "does not call #to_str on the separator if the array is empty" do
- sep = mock("separator")
- sep.should_not_receive(:to_str)
- [].join(sep).should == ""
- end
-
- it "raises a TypeError if the separator cannot be coerced to a String by calling #to_str" do
- obj = mock("not a string")
- lambda { [1, 2].join(obj) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed false as the separator" do
- lambda { [1, 2].join(false) }.should raise_error(TypeError)
- end
-end
-
-describe "Array#join with $," do
- before :each do
- @before_separator = $,
- end
-
- after :each do
- $, = @before_separator
- end
-
- it "separates elements with default separator when the passed separator is nil" do
- $, = "_"
- [1, 2, 3].join(nil).should == '1_2_3'
- end
-end
diff --git a/spec/ruby/core/array/keep_if_spec.rb b/spec/ruby/core/array/keep_if_spec.rb
deleted file mode 100644
index 2657d5e3b6..0000000000
--- a/spec/ruby/core/array/keep_if_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../shared/keep_if', __FILE__)
-
-describe "Array#keep_if" do
- it "returns the same array if no changes were made" do
- array = [1, 2, 3]
- array.keep_if { true }.should equal(array)
- end
-
- it_behaves_like :keep_if, :keep_if
-end
diff --git a/spec/ruby/core/array/last_spec.rb b/spec/ruby/core/array/last_spec.rb
deleted file mode 100644
index c707e3ff7e..0000000000
--- a/spec/ruby/core/array/last_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#last" do
- it "returns the last element" do
- [1, 1, 1, 1, 2].last.should == 2
- end
-
- it "returns nil if self is empty" do
- [].last.should == nil
- end
-
- it "returns the last count elements if given a count" do
- [1, 2, 3, 4, 5, 9].last(3).should == [4, 5, 9]
- end
-
- it "returns an empty array when passed a count on an empty array" do
- [].last(0).should == []
- [].last(1).should == []
- end
-
- it "returns an empty array when count == 0" do
- [1, 2, 3, 4, 5].last(0).should == []
- end
-
- it "returns an array containing the last element when passed count == 1" do
- [1, 2, 3, 4, 5].last(1).should == [5]
- end
-
- it "raises an ArgumentError when count is negative" do
- lambda { [1, 2].last(-1) }.should raise_error(ArgumentError)
- end
-
- it "returns the entire array when count > length" do
- [1, 2, 3, 4, 5, 9].last(10).should == [1, 2, 3, 4, 5, 9]
- end
-
- it "returns an array which is independent to the original when passed count" do
- ary = [1, 2, 3, 4, 5]
- ary.last(0).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- ary.last(1).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- ary.last(6).replace([1,2])
- ary.should == [1, 2, 3, 4, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.last.should equal(empty)
-
- array = ArraySpecs.recursive_array
- array.last.should equal(array)
- end
-
- it "tries to convert the passed argument to an Integer usinig #to_int" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- [1, 2, 3, 4, 5].last(obj).should == [4, 5]
- end
-
- it "raises a TypeError if the passed argument is not numeric" do
- lambda { [1,2].last(nil) }.should raise_error(TypeError)
- lambda { [1,2].last("a") }.should raise_error(TypeError)
-
- obj = mock("nonnumeric")
- lambda { [1,2].last(obj) }.should raise_error(TypeError)
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[].last(0).should be_an_instance_of(Array)
- ArraySpecs::MyArray[].last(2).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].last(0).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].last(1).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2, 3].last(2).should be_an_instance_of(Array)
- end
-
- it "is not destructive" do
- a = [1, 2, 3]
- a.last
- a.should == [1, 2, 3]
- a.last(2)
- a.should == [1, 2, 3]
- a.last(3)
- a.should == [1, 2, 3]
- end
-end
diff --git a/spec/ruby/core/array/length_spec.rb b/spec/ruby/core/array/length_spec.rb
deleted file mode 100644
index 6f4469dda5..0000000000
--- a/spec/ruby/core/array/length_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/length', __FILE__)
-
-describe "Array#length" do
- it_behaves_like(:array_length, :length)
-end
diff --git a/spec/ruby/core/array/map_spec.rb b/spec/ruby/core/array/map_spec.rb
deleted file mode 100644
index c23bb4241a..0000000000
--- a/spec/ruby/core/array/map_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/collect', __FILE__)
-
-describe "Array#map" do
- it_behaves_like(:array_collect, :map)
-end
-
-describe "Array#map!" do
- it_behaves_like(:array_collect_b, :map!)
-end
diff --git a/spec/ruby/core/array/max_spec.rb b/spec/ruby/core/array/max_spec.rb
deleted file mode 100644
index db1d755645..0000000000
--- a/spec/ruby/core/array/max_spec.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#max" do
- ruby_version_is "2.4" do
- it "is defined on Array" do
- [1].method(:max).owner.should equal Array
- end
- end
-
- it "returns nil with no values" do
- [].max.should == nil
- end
-
- it "returns only element in one element array" do
- [1].max.should == 1
- end
-
- it "returns largest value with multiple elements" do
- [1,2].max.should == 2
- [2,1].max.should == 2
- end
-
- describe "given a block with one argument" do
- it "yields in turn the last length-1 values from the array" do
- ary = []
- result = [1,2,3,4,5].max {|x| ary << x; x}
-
- ary.should == [2,3,4,5]
- result.should == 5
- end
- end
-end
-
-# From Enumerable#max, copied for better readability
-describe "Array#max" do
- before :each do
- @a = [2, 4, 6, 8, 10]
-
- @e_strs = ["333", "22", "666666", "1", "55555", "1010101010"]
- @e_ints = [333, 22, 666666, 55555, 1010101010]
- end
-
- it "max should return the maximum element" do
- [18, 42].max.should == 42
- [2, 5, 3, 6, 1, 4].max.should == 6
- end
-
- it "returns the maximum element (basics cases)" do
- [55].max.should == 55
-
- [11,99].max.should == 99
- [99,11].max.should == 99
- [2, 33, 4, 11].max.should == 33
-
- [1,2,3,4,5].max.should == 5
- [5,4,3,2,1].max.should == 5
- [1,4,3,5,2].max.should == 5
- [5,5,5,5,5].max.should == 5
-
- ["aa","tt"].max.should == "tt"
- ["tt","aa"].max.should == "tt"
- ["2","33","4","11"].max.should == "4"
-
- @e_strs.max.should == "666666"
- @e_ints.max.should == 1010101010
- end
-
- it "returns nil for an empty Enumerable" do
- [].max.should == nil
- end
-
- it "raises a NoMethodError for elements without #<=>" do
- lambda do
- [BasicObject.new, BasicObject.new].max
- end.should raise_error(NoMethodError)
- end
-
- it "raises an ArgumentError for incomparable elements" do
- lambda do
- [11,"22"].max
- end.should raise_error(ArgumentError)
- lambda do
- [11,12,22,33].max{|a, b| nil}
- end.should raise_error(ArgumentError)
- end
-
- it "returns the maximum element (with block)" do
- # with a block
- ["2","33","4","11"].max {|a,b| a <=> b }.should == "4"
- [ 2 , 33 , 4 , 11 ].max {|a,b| a <=> b }.should == 33
-
- ["2","33","4","11"].max {|a,b| b <=> a }.should == "11"
- [ 2 , 33 , 4 , 11 ].max {|a,b| b <=> a }.should == 2
-
- @e_strs.max {|a,b| a.length <=> b.length }.should == "1010101010"
-
- @e_strs.max {|a,b| a <=> b }.should == "666666"
- @e_strs.max {|a,b| a.to_i <=> b.to_i }.should == "1010101010"
-
- @e_ints.max {|a,b| a <=> b }.should == 1010101010
- @e_ints.max {|a,b| a.to_s <=> b.to_s }.should == 666666
- end
-
- it "returns the minimum for enumerables that contain nils" do
- arr = [nil, nil, true]
- arr.max { |a, b|
- x = a.nil? ? 1 : a ? 0 : -1
- y = b.nil? ? 1 : b ? 0 : -1
- x <=> y
- }.should == nil
- end
-
- it "gathers whole arrays as elements when each yields multiple" do
- multi = [[1,2], [3,4,5], [6,7,8,9]]
- multi.max.should == [6, 7, 8, 9]
- end
-
-end
diff --git a/spec/ruby/core/array/min_spec.rb b/spec/ruby/core/array/min_spec.rb
deleted file mode 100644
index 59f3814da2..0000000000
--- a/spec/ruby/core/array/min_spec.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#min" do
- ruby_version_is "2.4" do
- it "is defined on Array" do
- [1].method(:max).owner.should equal Array
- end
- end
-
- it "returns nil with no values" do
- [].min.should == nil
- end
-
- it "returns only element in one element array" do
- [1].min.should == 1
- end
-
- it "returns smallest value with multiple elements" do
- [1,2].min.should == 1
- [2,1].min.should == 1
- end
-
- describe "given a block with one argument" do
- it "yields in turn the last length-1 values from the array" do
- ary = []
- result = [1,2,3,4,5].min {|x| ary << x; x}
-
- ary.should == [2,3,4,5]
- result.should == 1
- end
- end
-end
-
-# From Enumerable#min, copied for better readability
-describe "Array#min" do
- before :each do
- @a = [2, 4, 6, 8, 10]
-
- @e_strs = ["333", "22", "666666", "1", "55555", "1010101010"]
- @e_ints = [ 333, 22, 666666, 55555, 1010101010]
- end
-
- it "min should return the minimum element" do
- [18, 42].min.should == 18
- [2, 5, 3, 6, 1, 4].min.should == 1
- end
-
- it "returns the minimum (basic cases)" do
- [55].min.should == 55
-
- [11,99].min.should == 11
- [99,11].min.should == 11
- [2, 33, 4, 11].min.should == 2
-
- [1,2,3,4,5].min.should == 1
- [5,4,3,2,1].min.should == 1
- [4,1,3,5,2].min.should == 1
- [5,5,5,5,5].min.should == 5
-
- ["aa","tt"].min.should == "aa"
- ["tt","aa"].min.should == "aa"
- ["2","33","4","11"].min.should == "11"
-
- @e_strs.min.should == "1"
- @e_ints.min.should == 22
- end
-
- it "returns nil for an empty Enumerable" do
- [].min.should be_nil
- end
-
- it "raises a NoMethodError for elements without #<=>" do
- lambda do
- [BasicObject.new, BasicObject.new].min
- end.should raise_error(NoMethodError)
- end
-
- it "raises an ArgumentError for incomparable elements" do
- lambda do
- [11,"22"].min
- end.should raise_error(ArgumentError)
- lambda do
- [11,12,22,33].min{|a, b| nil}
- end.should raise_error(ArgumentError)
- end
-
- it "returns the minimum when using a block rule" do
- ["2","33","4","11"].min {|a,b| a <=> b }.should == "11"
- [ 2 , 33 , 4 , 11 ].min {|a,b| a <=> b }.should == 2
-
- ["2","33","4","11"].min {|a,b| b <=> a }.should == "4"
- [ 2 , 33 , 4 , 11 ].min {|a,b| b <=> a }.should == 33
-
- [ 1, 2, 3, 4 ].min {|a,b| 15 }.should == 1
-
- [11,12,22,33].min{|a, b| 2 }.should == 11
- @i = -2
- [11,12,22,33].min{|a, b| @i += 1 }.should == 12
-
- @e_strs.min {|a,b| a.length <=> b.length }.should == "1"
-
- @e_strs.min {|a,b| a <=> b }.should == "1"
- @e_strs.min {|a,b| a.to_i <=> b.to_i }.should == "1"
-
- @e_ints.min {|a,b| a <=> b }.should == 22
- @e_ints.min {|a,b| a.to_s <=> b.to_s }.should == 1010101010
- end
-
- it "returns the minimum for enumerables that contain nils" do
- arr = [nil, nil, true]
- arr.min { |a, b|
- x = a.nil? ? -1 : a ? 0 : 1
- y = b.nil? ? -1 : b ? 0 : 1
- x <=> y
- }.should == nil
- end
-
- it "gathers whole arrays as elements when each yields multiple" do
- multi = [[1,2], [3,4,5], [6,7,8,9]]
- multi.min.should == [1, 2]
- end
-
-end
diff --git a/spec/ruby/core/array/minus_spec.rb b/spec/ruby/core/array/minus_spec.rb
deleted file mode 100644
index ffb8d7db06..0000000000
--- a/spec/ruby/core/array/minus_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#-" do
- it "creates an array minus any items from other array" do
- ([] - [ 1, 2, 4 ]).should == []
- ([1, 2, 4] - []).should == [1, 2, 4]
- ([ 1, 2, 3, 4, 5 ] - [ 1, 2, 4 ]).should == [3, 5]
- end
-
- it "removes multiple items on the lhs equal to one on the rhs" do
- ([1, 1, 2, 2, 3, 3, 4, 5] - [1, 2, 4]).should == [3, 3, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty - empty).should == []
-
- ([] - ArraySpecs.recursive_array).should == []
-
- array = ArraySpecs.recursive_array
- (array - array).should == []
- end
-
- it "tries to convert the passed arguments to Arrays using #to_ary" do
- obj = mock('[2,3,3,4]')
- obj.should_receive(:to_ary).and_return([2, 3, 3, 4])
- ([1, 1, 2, 2, 3, 4] - obj).should == [1, 1]
- end
-
- it "raises a TypeError if the argument cannot be coerced to an Array by calling #to_ary" do
- obj = mock('not an array')
- lambda { [1, 2, 3] - obj }.should raise_error(TypeError)
- end
-
- it "does not return subclass instance for Array subclasses" do
- (ArraySpecs::MyArray[1, 2, 3] - []).should be_an_instance_of(Array)
- (ArraySpecs::MyArray[1, 2, 3] - ArraySpecs::MyArray[]).should be_an_instance_of(Array)
- ([1, 2, 3] - ArraySpecs::MyArray[]).should be_an_instance_of(Array)
- end
-
- it "does not call to_ary on array subclasses" do
- ([5, 6, 7] - ArraySpecs::ToAryArray[7]).should == [5, 6]
- end
-
- it "removes an item identified as equivalent via #hash and #eql?" do
- obj1 = mock('1')
- obj2 = mock('2')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj1.should_receive(:eql?).at_least(1).and_return(true)
-
- ([obj1] - [obj2]).should == []
- ([obj1, obj1, obj2, obj2] - [obj2]).should == []
- end
-
- it "doesn't remove an item with the same hash but not #eql?" do
- obj1 = mock('1')
- obj2 = mock('2')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj1.should_receive(:eql?).at_least(1).and_return(false)
-
- ([obj1] - [obj2]).should == [obj1]
- ([obj1, obj1, obj2, obj2] - [obj2]).should == [obj1, obj1]
- end
-
- it "removes an identical item even when its #eql? isn't reflexive" do
- x = mock('x')
- x.stub!(:hash).and_return(42)
- x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI.
-
- ([x] - [x]).should == []
- end
-
- it "is not destructive" do
- a = [1, 2, 3]
- a - []
- a.should == [1, 2, 3]
- a - [1]
- a.should == [1, 2, 3]
- a - [1,2,3]
- a.should == [1, 2, 3]
- a - [:a, :b, :c]
- a.should == [1, 2, 3]
- end
-end
diff --git a/spec/ruby/core/array/multiply_spec.rb b/spec/ruby/core/array/multiply_spec.rb
deleted file mode 100644
index ecd5eba5f7..0000000000
--- a/spec/ruby/core/array/multiply_spec.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/join', __FILE__)
-
-describe "Array#*" do
- it "tries to convert the passed argument to a String using #to_str" do
- obj = mock('separator')
- obj.should_receive(:to_str).and_return('::')
- ([1, 2, 3, 4] * obj).should == '1::2::3::4'
- end
-
- it "tires to convert the passed argument to an Integer using #to_int" do
- obj = mock('count')
- obj.should_receive(:to_int).and_return(2)
- ([1, 2, 3, 4] * obj).should == [1, 2, 3, 4, 1, 2, 3, 4]
- end
-
- it "raises a TypeError if the argument can neither be converted to a string nor an integer" do
- obj = mock('not a string or integer')
- lambda{ [1,2] * obj }.should raise_error(TypeError)
- end
-
- it "converts the passed argument to a String rather than an Integer" do
- obj = mock('2')
- def obj.to_int() 2 end
- def obj.to_str() "2" end
- ([:a, :b, :c] * obj).should == "a2b2c"
- end
-
- it "raises a TypeError is the passed argument is nil" do
- lambda{ [1,2] * nil }.should raise_error(TypeError)
- end
-
- it "raises an ArgumentError when passed 2 or more arguments" do
- lambda{ [1,2].send(:*, 1, 2) }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError when passed no arguments" do
- lambda{ [1,2].send(:*) }.should raise_error(ArgumentError)
- end
-end
-
-describe "Array#* with an integer" do
- it "concatenates n copies of the array when passed an integer" do
- ([ 1, 2, 3 ] * 0).should == []
- ([ 1, 2, 3 ] * 1).should == [1, 2, 3]
- ([ 1, 2, 3 ] * 3).should == [1, 2, 3, 1, 2, 3, 1, 2, 3]
- ([] * 10).should == []
- end
-
- it "does not return self even if the passed integer is 1" do
- ary = [1, 2, 3]
- (ary * 1).should_not equal(ary)
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty * 0).should == []
- (empty * 1).should == empty
- (empty * 3).should == [empty, empty, empty]
-
- array = ArraySpecs.recursive_array
- (array * 0).should == []
- (array * 1).should == array
- end
-
- it "raises an ArgumentError when passed a negative integer" do
- lambda { [ 1, 2, 3 ] * -1 }.should raise_error(ArgumentError)
- lambda { [] * -1 }.should raise_error(ArgumentError)
- end
-
- describe "with a subclass of Array" do
- before :each do
- ScratchPad.clear
-
- @array = ArraySpecs::MyArray[1, 2, 3, 4, 5]
- end
-
- it "returns a subclass instance" do
- (@array * 0).should be_an_instance_of(ArraySpecs::MyArray)
- (@array * 1).should be_an_instance_of(ArraySpecs::MyArray)
- (@array * 2).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "does not call #initialize on the subclass instance" do
- (@array * 2).should == [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
- ScratchPad.recorded.should be_nil
- end
- end
-
- it "copies the taint status of the original array even if the passed count is 0" do
- ary = [1, 2, 3]
- ary.taint
- (ary * 0).tainted?.should == true
- end
-
- it "copies the taint status of the original array even if the array is empty" do
- ary = []
- ary.taint
- (ary * 3).tainted?.should == true
- end
-
- it "copies the taint status of the original array if the passed count is not 0" do
- ary = [1, 2, 3]
- ary.taint
- (ary * 1).tainted?.should == true
- (ary * 2).tainted?.should == true
- end
-
- it "copies the untrusted status of the original array even if the passed count is 0" do
- ary = [1, 2, 3]
- ary.untrust
- (ary * 0).untrusted?.should == true
- end
-
- it "copies the untrusted status of the original array even if the array is empty" do
- ary = []
- ary.untrust
- (ary * 3).untrusted?.should == true
- end
-
- it "copies the untrusted status of the original array if the passed count is not 0" do
- ary = [1, 2, 3]
- ary.untrust
- (ary * 1).untrusted?.should == true
- (ary * 2).untrusted?.should == true
- end
-end
-
-describe "Array#* with a string" do
- it_behaves_like :array_join_with_string_separator, :*
-end
diff --git a/spec/ruby/core/array/new_spec.rb b/spec/ruby/core/array/new_spec.rb
deleted file mode 100644
index 4d26024ff2..0000000000
--- a/spec/ruby/core/array/new_spec.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array.new" do
- it "returns an instance of Array" do
- Array.new.should be_an_instance_of(Array)
- end
-
- it "returns an instance of a subclass" do
- ArraySpecs::MyArray.new(1, 2).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "raises an ArgumentError if passed 3 or more arguments" do
- lambda do
- [1, 2].send :initialize, 1, 'x', true
- end.should raise_error(ArgumentError)
- lambda do
- [1, 2].send(:initialize, 1, 'x', true) {}
- end.should raise_error(ArgumentError)
- end
-end
-
-describe "Array.new with no arguments" do
- it "returns an empty array" do
- Array.new.should be_empty
- end
-
- it "does not use the given block" do
- lambda{ Array.new { raise } }.should_not raise_error
- end
-end
-
-describe "Array.new with (array)" do
- it "returns an array initialized to the other array" do
- b = [4, 5, 6]
- Array.new(b).should == b
- end
-
- it "does not use the given block" do
- lambda{ Array.new([1, 2]) { raise } }.should_not raise_error
- end
-
- it "calls #to_ary to convert the value to an array" do
- a = mock("array")
- a.should_receive(:to_ary).and_return([1, 2])
- a.should_not_receive(:to_int)
- Array.new(a).should == [1, 2]
- end
-
- it "does not call #to_ary on instances of Array or subclasses of Array" do
- a = [1, 2]
- a.should_not_receive(:to_ary)
- Array.new(a)
- end
-
- it "raises a TypeError if an Array type argument and a default object" do
- lambda { Array.new([1, 2], 1) }.should raise_error(TypeError)
- end
-end
-
-describe "Array.new with (size, object=nil)" do
- it "returns an array of size filled with object" do
- obj = [3]
- a = Array.new(2, obj)
- a.should == [obj, obj]
- a[0].should equal(obj)
- a[1].should equal(obj)
-
- Array.new(3, 14).should == [14, 14, 14]
- end
-
- it "returns an array of size filled with nil when object is omitted" do
- Array.new(3).should == [nil, nil, nil]
- end
-
- it "raises an ArgumentError if size is negative" do
- lambda { Array.new(-1, :a) }.should raise_error(ArgumentError)
- lambda { Array.new(-1) }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError if size is too large" do
- lambda { Array.new(fixnum_max+1) }.should raise_error(ArgumentError)
- end
-
- it "calls #to_int to convert the size argument to an Integer when object is given" do
- obj = mock('1')
- obj.should_receive(:to_int).and_return(1)
- Array.new(obj, :a).should == [:a]
- end
-
- it "calls #to_int to convert the size argument to an Integer when object is not given" do
- obj = mock('1')
- obj.should_receive(:to_int).and_return(1)
- Array.new(obj).should == [nil]
- end
-
- it "raises a TypeError if the size argument is not an Integer type" do
- obj = mock('nonnumeric')
- obj.stub!(:to_ary).and_return([1, 2])
- lambda{ Array.new(obj, :a) }.should raise_error(TypeError)
- end
-
- it "yields the index of the element and sets the element to the value of the block" do
- Array.new(3) { |i| i.to_s }.should == ['0', '1', '2']
- end
-
- it "uses the block value instead of using the default value" do
- lambda {
- @result = Array.new(3, :obj) { |i| i.to_s }
- }.should complain(/block supersedes default value argument/)
- @result.should == ['0', '1', '2']
- end
-
- it "returns the value passed to break" do
- a = Array.new(3) do |i|
- break if i == 2
- i.to_s
- end
-
- a.should == nil
- end
-end
diff --git a/spec/ruby/core/array/pack/a_spec.rb b/spec/ruby/core/array/pack/a_spec.rb
deleted file mode 100644
index e7fbdcd179..0000000000
--- a/spec/ruby/core/array/pack/a_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/string', __FILE__)
-
-describe "Array#pack with format 'A'" do
- it_behaves_like :array_pack_basic, 'A'
- it_behaves_like :array_pack_basic_non_float, 'A'
- it_behaves_like :array_pack_no_platform, 'A'
- it_behaves_like :array_pack_string, 'A'
-
- it "adds all the bytes to the output when passed the '*' modifier" do
- ["abc"].pack("A*").should == "abc"
- end
-
- it "padds the output with spaces when the count exceeds the size of the String" do
- ["abc"].pack("A6").should == "abc "
- end
-
- it "adds a space when the value is nil" do
- [nil].pack("A").should == " "
- end
-
- it "pads the output with spaces when the value is nil" do
- [nil].pack("A3").should == " "
- end
-
- it "does not pad with spaces when passed the '*' modifier and the value is nil" do
- [nil].pack("A*").should == ""
- end
-end
-
-describe "Array#pack with format 'a'" do
- it_behaves_like :array_pack_basic, 'a'
- it_behaves_like :array_pack_basic_non_float, 'a'
- it_behaves_like :array_pack_no_platform, 'a'
- it_behaves_like :array_pack_string, 'a'
-
- it "adds all the bytes to the output when passed the '*' modifier" do
- ["abc"].pack("a*").should == "abc"
- end
-
- it "padds the output with NULL bytes when the count exceeds the size of the String" do
- ["abc"].pack("a6").should == "abc\x00\x00\x00"
- end
-
- it "adds a NULL byte when the value is nil" do
- [nil].pack("a").should == "\x00"
- end
-
- it "pads the output with NULL bytes when the value is nil" do
- [nil].pack("a3").should == "\x00\x00\x00"
- end
-
- it "does not pad with NULL bytes when passed the '*' modifier and the value is nil" do
- [nil].pack("a*").should == ""
- end
-end
diff --git a/spec/ruby/core/array/pack/at_spec.rb b/spec/ruby/core/array/pack/at_spec.rb
deleted file mode 100644
index dd538e8951..0000000000
--- a/spec/ruby/core/array/pack/at_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-
-describe "Array#pack with format '@'" do
- it_behaves_like :array_pack_basic, '@'
- it_behaves_like :array_pack_basic_non_float, '@'
- it_behaves_like :array_pack_no_platform, '@'
-
- it "moves the insertion point to the index specified by the count modifier" do
- [1, 2, 3, 4, 5].pack("C4@2C").should == "\x01\x02\x05"
- end
-
- it "does not consume any elements" do
- [1, 2, 3].pack("C@3C").should == "\x01\x00\x00\x02"
- end
-
- it "extends the string with NULL bytes if the string size is less than the count" do
- [1, 2, 3].pack("@3C*").should == "\x00\x00\x00\x01\x02\x03"
- end
-
- it "truncates the string if the string size is greater than the count" do
- [1, 2, 3].pack("Cx5@2C").should == "\x01\x00\x02"
- end
-
- it "implicitly has a count of one when no count modifier is passed" do
- [1, 2, 3].pack("C*@").should == "\x01"
- end
-end
diff --git a/spec/ruby/core/array/pack/b_spec.rb b/spec/ruby/core/array/pack/b_spec.rb
deleted file mode 100644
index 62294ab8d1..0000000000
--- a/spec/ruby/core/array/pack/b_spec.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/encodings', __FILE__)
-
-describe "Array#pack with format 'B'" do
- it_behaves_like :array_pack_basic, 'B'
- it_behaves_like :array_pack_basic_non_float, 'B'
- it_behaves_like :array_pack_arguments, 'B'
- it_behaves_like :array_pack_hex, 'B'
-
- it "calls #to_str to convert an Object to a String" do
- obj = mock("pack H string")
- obj.should_receive(:to_str).and_return("``abcdef")
- [obj].pack("B*").should == "\x2a"
- end
-
- it "encodes one bit for each character starting with the most significant bit" do
- [ [["0"], "\x00"],
- [["1"], "\x80"]
- ].should be_computed_by(:pack, "B")
- end
-
- it "implicitly has a count of one when not passed a count modifier" do
- ["1"].pack("B").should == "\x80"
- end
-
- it "implicitly has count equal to the string length when passed the '*' modifier" do
- [ [["00101010"], "\x2a"],
- [["00000000"], "\x00"],
- [["11111111"], "\xff"],
- [["10000000"], "\x80"],
- [["00000001"], "\x01"]
- ].should be_computed_by(:pack, "B*")
- end
-
- it "encodes the least significant bit of a character other than 0 or 1" do
- [ [["bbababab"], "\x2a"],
- [["^&#&#^#^"], "\x2a"],
- [["(()()()("], "\x2a"],
- [["@@%@%@%@"], "\x2a"],
- [["ppqrstuv"], "\x2a"],
- [["rqtvtrqp"], "\x42"]
- ].should be_computed_by(:pack, "B*")
- end
-
- it "returns an ASCII-8BIT string" do
- ["1"].pack("B").encoding.should == Encoding::ASCII_8BIT
- end
-
- it "encodes the string as a sequence of bytes" do
- ["ああああああああ"].pack("B*").should == "\xdbm\xb6"
- end
-end
-
-describe "Array#pack with format 'b'" do
- it_behaves_like :array_pack_basic, 'b'
- it_behaves_like :array_pack_basic_non_float, 'b'
- it_behaves_like :array_pack_arguments, 'b'
- it_behaves_like :array_pack_hex, 'b'
-
- it "calls #to_str to convert an Object to a String" do
- obj = mock("pack H string")
- obj.should_receive(:to_str).and_return("`abcdef`")
- [obj].pack("b*").should == "\x2a"
- end
-
- it "encodes one bit for each character starting with the least significant bit" do
- [ [["0"], "\x00"],
- [["1"], "\x01"]
- ].should be_computed_by(:pack, "b")
- end
-
- it "implicitly has a count of one when not passed a count modifier" do
- ["1"].pack("b").should == "\x01"
- end
-
- it "implicitly has count equal to the string length when passed the '*' modifier" do
- [ [["0101010"], "\x2a"],
- [["00000000"], "\x00"],
- [["11111111"], "\xff"],
- [["10000000"], "\x01"],
- [["00000001"], "\x80"]
- ].should be_computed_by(:pack, "b*")
- end
-
- it "encodes the least significant bit of a character other than 0 or 1" do
- [ [["bababab"], "\x2a"],
- [["&#&#^#^"], "\x2a"],
- [["()()()("], "\x2a"],
- [["@%@%@%@"], "\x2a"],
- [["pqrstuv"], "\x2a"],
- [["qrtrtvs"], "\x41"]
- ].should be_computed_by(:pack, "b*")
- end
-
- it "returns an ASCII-8BIT string" do
- ["1"].pack("b").encoding.should == Encoding::ASCII_8BIT
- end
-
- it "encodes the string as a sequence of bytes" do
- ["ああああああああ"].pack("b*").should == "\xdb\xb6m"
- end
-end
diff --git a/spec/ruby/core/array/pack/buffer_spec.rb b/spec/ruby/core/array/pack/buffer_spec.rb
deleted file mode 100644
index 928f7db731..0000000000
--- a/spec/ruby/core/array/pack/buffer_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# encoding: ascii-8bit
-
-require File.expand_path('../../../../spec_helper', __FILE__)
-
-ruby_version_is '2.4' do
- describe "Aray#pack with `buffer` option" do
- it "returns specified buffer" do
- n = [ 65, 66, 67 ]
- buffer = " "*3
- result = n.pack("ccc", buffer: buffer) #=> "ABC"
- result.should equal(buffer)
- end
-
- it "adds result at the end of buffer content" do
- n = [ 65, 66, 67 ] # result without buffer is "ABC"
-
- buffer = ""
- n.pack("ccc", buffer: buffer).should == "ABC"
-
- buffer = "123"
- n.pack("ccc", buffer: buffer).should == "123ABC"
-
- buffer = "12345"
- n.pack("ccc", buffer: buffer).should == "12345ABC"
- end
-
- it "raises TypeError exception if buffer is not String" do
- lambda { [65].pack("ccc", buffer: []) }.should raise_error(
- TypeError, "buffer must be String, not Array")
- end
-
- context "offset (@) is specified" do
- it 'keeps buffer content if it is longer than offset' do
- n = [ 65, 66, 67 ]
- buffer = "123456"
- n.pack("@3ccc", buffer: buffer).should == "123ABC"
- end
-
- it "fills the gap with \0 if buffer content is shorter than offset" do
- n = [ 65, 66, 67 ]
- buffer = "123"
- n.pack("@6ccc", buffer: buffer).should == "123\0\0\0ABC"
- end
-
- it 'does not keep buffer content if it is longer than offset + result' do
- n = [ 65, 66, 67 ]
- buffer = "1234567890"
- n.pack("@3ccc", buffer: buffer).should == "123ABC"
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/pack/c_spec.rb b/spec/ruby/core/array/pack/c_spec.rb
deleted file mode 100644
index 74afa72f56..0000000000
--- a/spec/ruby/core/array/pack/c_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-
-describe :array_pack_8bit, shared: true do
- it "encodes the least significant eight bits of a positive number" do
- [ [[49], "1"],
- [[0b11111111], "\xFF"],
- [[0b100000000], "\x00"],
- [[0b100000001], "\x01"]
- ].should be_computed_by(:pack, pack_format)
- end
-
- it "encodes the least significant eight bits of a negative number" do
- [ [[-1], "\xFF"],
- [[-0b10000000], "\x80"],
- [[-0b11111111], "\x01"],
- [[-0b100000000], "\x00"],
- [[-0b100000001], "\xFF"]
- ].should be_computed_by(:pack, pack_format)
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[5.2], "\x05"],
- [[5.8], "\x05"]
- ].should be_computed_by(:pack, pack_format)
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(5)
- [obj].pack(pack_format).should == "\x05"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [ [[1, 2, 3], pack_format(3), "\x01\x02\x03"],
- [[1, 2, 3], pack_format(2) + pack_format(1), "\x01\x02\x03"]
- ].should be_computed_by(:pack)
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [1, 2, 3, 4, 5].pack(pack_format('*')).should == "\x01\x02\x03\x04\x05"
- end
-
- it "ignores NULL bytes between directives" do
- [1, 2, 3].pack(pack_format("\000", 2)).should == "\x01\x02"
- end
-
- it "ignores spaces between directives" do
- [1, 2, 3].pack(pack_format(' ', 2)).should == "\x01\x02"
- end
-end
-
-describe "Array#pack with format 'C'" do
- it_behaves_like :array_pack_basic, 'C'
- it_behaves_like :array_pack_basic_non_float, 'C'
- it_behaves_like :array_pack_8bit, 'C'
- it_behaves_like :array_pack_arguments, 'C'
- it_behaves_like :array_pack_numeric_basic, 'C'
- it_behaves_like :array_pack_integer, 'C'
- it_behaves_like :array_pack_no_platform, 'C'
-end
-
-describe "Array#pack with format 'c'" do
- it_behaves_like :array_pack_basic, 'c'
- it_behaves_like :array_pack_basic_non_float, 'c'
- it_behaves_like :array_pack_8bit, 'c'
- it_behaves_like :array_pack_arguments, 'c'
- it_behaves_like :array_pack_numeric_basic, 'c'
- it_behaves_like :array_pack_integer, 'c'
- it_behaves_like :array_pack_no_platform, 'c'
-end
diff --git a/spec/ruby/core/array/pack/comment_spec.rb b/spec/ruby/core/array/pack/comment_spec.rb
deleted file mode 100644
index 00c5fb6ecd..0000000000
--- a/spec/ruby/core/array/pack/comment_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-
-describe "Array#pack" do
- it "ignores directives text from '#' to the first newline" do
- [1, 2, 3].pack("c#this is a comment\nc").should == "\x01\x02"
- end
-
- it "ignores directives text from '#' to the end if no newline is present" do
- [1, 2, 3].pack("c#this is a comment c").should == "\x01"
- end
-
- it "ignores comments at the start of the directives string" do
- [1, 2, 3].pack("#this is a comment\nc").should == "\x01"
- end
-
- it "ignores the entire directive string if it is a comment" do
- [1, 2, 3].pack("#this is a comment").should == ""
- end
-
- it "ignores multiple comments" do
- [1, 2, 3].pack("c#comment\nc#comment\nc#c").should == "\x01\x02\x03"
- end
-end
diff --git a/spec/ruby/core/array/pack/d_spec.rb b/spec/ruby/core/array/pack/d_spec.rb
deleted file mode 100644
index 40f28d1e52..0000000000
--- a/spec/ruby/core/array/pack/d_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/float', __FILE__)
-
-describe "Array#pack with format 'D'" do
- it_behaves_like :array_pack_basic, 'D'
- it_behaves_like :array_pack_basic_float, 'D'
- it_behaves_like :array_pack_arguments, 'D'
- it_behaves_like :array_pack_no_platform, 'D'
- it_behaves_like :array_pack_numeric_basic, 'D'
- it_behaves_like :array_pack_float, 'D'
-
- little_endian do
- it_behaves_like :array_pack_double_le, 'D'
- end
-
- big_endian do
- it_behaves_like :array_pack_double_be, 'D'
- end
-end
-
-describe "Array#pack with format 'd'" do
- it_behaves_like :array_pack_basic, 'd'
- it_behaves_like :array_pack_basic_float, 'd'
- it_behaves_like :array_pack_arguments, 'd'
- it_behaves_like :array_pack_no_platform, 'd'
- it_behaves_like :array_pack_numeric_basic, 'd'
- it_behaves_like :array_pack_float, 'd'
-
- little_endian do
- it_behaves_like :array_pack_double_le, 'd'
- end
-
- big_endian do
- it_behaves_like :array_pack_double_be, 'd'
- end
-end
diff --git a/spec/ruby/core/array/pack/e_spec.rb b/spec/ruby/core/array/pack/e_spec.rb
deleted file mode 100644
index 9c6a1b5485..0000000000
--- a/spec/ruby/core/array/pack/e_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/float', __FILE__)
-
-describe "Array#pack with format 'E'" do
- it_behaves_like :array_pack_basic, 'E'
- it_behaves_like :array_pack_basic_float, 'E'
- it_behaves_like :array_pack_arguments, 'E'
- it_behaves_like :array_pack_no_platform, 'E'
- it_behaves_like :array_pack_numeric_basic, 'E'
- it_behaves_like :array_pack_float, 'E'
- it_behaves_like :array_pack_double_le, 'E'
-end
-
-describe "Array#pack with format 'e'" do
- it_behaves_like :array_pack_basic, 'e'
- it_behaves_like :array_pack_basic_float, 'e'
- it_behaves_like :array_pack_arguments, 'e'
- it_behaves_like :array_pack_no_platform, 'e'
- it_behaves_like :array_pack_numeric_basic, 'e'
- it_behaves_like :array_pack_float, 'e'
- it_behaves_like :array_pack_float_le, 'e'
-end
diff --git a/spec/ruby/core/array/pack/empty_spec.rb b/spec/ruby/core/array/pack/empty_spec.rb
deleted file mode 100644
index 701e20b0af..0000000000
--- a/spec/ruby/core/array/pack/empty_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-
-describe "Array#pack with empty format" do
- it "returns an empty String" do
- [1, 2, 3].pack("").should == ""
- end
-
- it "returns a String with US-ASCII encoding" do
- [1, 2, 3].pack("").encoding.should == Encoding::US_ASCII
- end
-end
diff --git a/spec/ruby/core/array/pack/f_spec.rb b/spec/ruby/core/array/pack/f_spec.rb
deleted file mode 100644
index 94ce57f34d..0000000000
--- a/spec/ruby/core/array/pack/f_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/float', __FILE__)
-
-describe "Array#pack with format 'F'" do
- it_behaves_like :array_pack_basic, 'F'
- it_behaves_like :array_pack_basic_float, 'F'
- it_behaves_like :array_pack_arguments, 'F'
- it_behaves_like :array_pack_no_platform, 'F'
- it_behaves_like :array_pack_numeric_basic, 'F'
- it_behaves_like :array_pack_float, 'F'
-
- little_endian do
- it_behaves_like :array_pack_float_le, 'F'
- end
-
- big_endian do
- it_behaves_like :array_pack_float_be, 'F'
- end
-end
-
-describe "Array#pack with format 'f'" do
- it_behaves_like :array_pack_basic, 'f'
- it_behaves_like :array_pack_basic_float, 'f'
- it_behaves_like :array_pack_arguments, 'f'
- it_behaves_like :array_pack_no_platform, 'f'
- it_behaves_like :array_pack_numeric_basic, 'f'
- it_behaves_like :array_pack_float, 'f'
-
- little_endian do
- it_behaves_like :array_pack_float_le, 'f'
- end
-
- big_endian do
- it_behaves_like :array_pack_float_be, 'f'
- end
-end
diff --git a/spec/ruby/core/array/pack/g_spec.rb b/spec/ruby/core/array/pack/g_spec.rb
deleted file mode 100644
index a0a902ebbe..0000000000
--- a/spec/ruby/core/array/pack/g_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/float', __FILE__)
-
-describe "Array#pack with format 'G'" do
- it_behaves_like :array_pack_basic, 'G'
- it_behaves_like :array_pack_basic_float, 'G'
- it_behaves_like :array_pack_arguments, 'G'
- it_behaves_like :array_pack_no_platform, 'G'
- it_behaves_like :array_pack_numeric_basic, 'G'
- it_behaves_like :array_pack_float, 'G'
- it_behaves_like :array_pack_double_be, 'G'
-end
-
-describe "Array#pack with format 'g'" do
- it_behaves_like :array_pack_basic, 'g'
- it_behaves_like :array_pack_basic_float, 'g'
- it_behaves_like :array_pack_arguments, 'g'
- it_behaves_like :array_pack_no_platform, 'g'
- it_behaves_like :array_pack_numeric_basic, 'g'
- it_behaves_like :array_pack_float, 'g'
- it_behaves_like :array_pack_float_be, 'g'
-end
diff --git a/spec/ruby/core/array/pack/h_spec.rb b/spec/ruby/core/array/pack/h_spec.rb
deleted file mode 100644
index 2412bf57c9..0000000000
--- a/spec/ruby/core/array/pack/h_spec.rb
+++ /dev/null
@@ -1,197 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/encodings', __FILE__)
-
-describe "Array#pack with format 'H'" do
- it_behaves_like :array_pack_basic, 'H'
- it_behaves_like :array_pack_basic_non_float, 'H'
- it_behaves_like :array_pack_arguments, 'H'
- it_behaves_like :array_pack_hex, 'H'
-
- it "calls #to_str to convert an Object to a String" do
- obj = mock("pack H string")
- obj.should_receive(:to_str).and_return("a")
- [obj].pack("H").should == "\xa0"
- end
-
- it "encodes the first character as the most significant nibble when passed no count modifier" do
- ["ab"].pack("H").should == "\xa0"
- end
-
- it "implicitly has count equal to the string length when passed the '*' modifier" do
- ["deadbeef"].pack("H*").should == "\xde\xad\xbe\xef"
- end
-
- it "encodes count nibbles when passed a count modifier exceeding the string length" do
- ["ab"].pack('H8').should == "\xab\x00\x00\x00"
- end
-
- it "encodes the first character as the most significant nibble of a hex value" do
- [ [["0"], "\x00"],
- [["1"], "\x10"],
- [["2"], "\x20"],
- [["3"], "\x30"],
- [["4"], "\x40"],
- [["5"], "\x50"],
- [["6"], "\x60"],
- [["7"], "\x70"],
- [["8"], "\x80"],
- [["9"], "\x90"],
- [["a"], "\xa0"],
- [["b"], "\xb0"],
- [["c"], "\xc0"],
- [["d"], "\xd0"],
- [["e"], "\xe0"],
- [["f"], "\xf0"],
- [["A"], "\xa0"],
- [["B"], "\xb0"],
- [["C"], "\xc0"],
- [["D"], "\xd0"],
- [["E"], "\xe0"],
- [["F"], "\xf0"]
- ].should be_computed_by(:pack, "H")
- end
-
- it "encodes the second character as the least significant nibble of a hex value" do
- [ [["00"], "\x00"],
- [["01"], "\x01"],
- [["02"], "\x02"],
- [["03"], "\x03"],
- [["04"], "\x04"],
- [["05"], "\x05"],
- [["06"], "\x06"],
- [["07"], "\x07"],
- [["08"], "\x08"],
- [["09"], "\x09"],
- [["0a"], "\x0a"],
- [["0b"], "\x0b"],
- [["0c"], "\x0c"],
- [["0d"], "\x0d"],
- [["0e"], "\x0e"],
- [["0f"], "\x0f"],
- [["0A"], "\x0a"],
- [["0B"], "\x0b"],
- [["0C"], "\x0c"],
- [["0D"], "\x0d"],
- [["0E"], "\x0e"],
- [["0F"], "\x0f"]
- ].should be_computed_by(:pack, "H2")
- end
-
- it "encodes the least significant nibble of a non alphanumeric character as the most significant nibble of the hex value" do
- [ [["^"], "\xe0"],
- [["*"], "\xa0"],
- [["#"], "\x30"],
- [["["], "\xb0"],
- [["]"], "\xd0"],
- [["@"], "\x00"],
- [["!"], "\x10"],
- [["H"], "\x10"],
- [["O"], "\x80"],
- [["T"], "\xd0"],
- [["Z"], "\x30"],
- ].should be_computed_by(:pack, "H")
- end
-
- it "returns an ASCII-8BIT string" do
- ["41"].pack("H").encoding.should == Encoding::ASCII_8BIT
- end
-end
-
-describe "Array#pack with format 'h'" do
- it_behaves_like :array_pack_basic, 'h'
- it_behaves_like :array_pack_basic_non_float, 'h'
- it_behaves_like :array_pack_arguments, 'h'
- it_behaves_like :array_pack_hex, 'h'
-
- it "calls #to_str to convert an Object to a String" do
- obj = mock("pack H string")
- obj.should_receive(:to_str).and_return("a")
- [obj].pack("h").should == "\x0a"
- end
-
- it "encodes the first character as the least significant nibble when passed no count modifier" do
- ["ab"].pack("h").should == "\x0a"
- end
-
- it "implicitly has count equal to the string length when passed the '*' modifier" do
- ["deadbeef"].pack("h*").should == "\xed\xda\xeb\xfe"
- end
-
- it "encodes count nibbles when passed a count modifier exceeding the string length" do
- ["ab"].pack('h8').should == "\xba\x00\x00\x00"
- end
-
- it "encodes the first character as the least significant nibble of a hex value" do
- [ [["0"], "\x00"],
- [["1"], "\x01"],
- [["2"], "\x02"],
- [["3"], "\x03"],
- [["4"], "\x04"],
- [["5"], "\x05"],
- [["6"], "\x06"],
- [["7"], "\x07"],
- [["8"], "\x08"],
- [["9"], "\x09"],
- [["a"], "\x0a"],
- [["b"], "\x0b"],
- [["c"], "\x0c"],
- [["d"], "\x0d"],
- [["e"], "\x0e"],
- [["f"], "\x0f"],
- [["A"], "\x0a"],
- [["B"], "\x0b"],
- [["C"], "\x0c"],
- [["D"], "\x0d"],
- [["E"], "\x0e"],
- [["F"], "\x0f"]
- ].should be_computed_by(:pack, "h")
- end
-
- it "encodes the second character as the most significant nibble of a hex value" do
- [ [["00"], "\x00"],
- [["01"], "\x10"],
- [["02"], "\x20"],
- [["03"], "\x30"],
- [["04"], "\x40"],
- [["05"], "\x50"],
- [["06"], "\x60"],
- [["07"], "\x70"],
- [["08"], "\x80"],
- [["09"], "\x90"],
- [["0a"], "\xa0"],
- [["0b"], "\xb0"],
- [["0c"], "\xc0"],
- [["0d"], "\xd0"],
- [["0e"], "\xe0"],
- [["0f"], "\xf0"],
- [["0A"], "\xa0"],
- [["0B"], "\xb0"],
- [["0C"], "\xc0"],
- [["0D"], "\xd0"],
- [["0E"], "\xe0"],
- [["0F"], "\xf0"]
- ].should be_computed_by(:pack, "h2")
- end
-
- it "encodes the least significant nibble of a non alphanumeric character as the least significant nibble of the hex value" do
- [ [["^"], "\x0e"],
- [["*"], "\x0a"],
- [["#"], "\x03"],
- [["["], "\x0b"],
- [["]"], "\x0d"],
- [["@"], "\x00"],
- [["!"], "\x01"],
- [["H"], "\x01"],
- [["O"], "\x08"],
- [["T"], "\x0d"],
- [["Z"], "\x03"],
- ].should be_computed_by(:pack, "h")
- end
-
- it "returns an ASCII-8BIT string" do
- ["41"].pack("h").encoding.should == Encoding::ASCII_8BIT
- end
-end
diff --git a/spec/ruby/core/array/pack/i_spec.rb b/spec/ruby/core/array/pack/i_spec.rb
deleted file mode 100644
index c22f367a65..0000000000
--- a/spec/ruby/core/array/pack/i_spec.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'I'" do
- it_behaves_like :array_pack_basic, 'I'
- it_behaves_like :array_pack_basic_non_float, 'I'
- it_behaves_like :array_pack_arguments, 'I'
- it_behaves_like :array_pack_numeric_basic, 'I'
- it_behaves_like :array_pack_integer, 'I'
-end
-
-describe "Array#pack with format 'i'" do
- it_behaves_like :array_pack_basic, 'i'
- it_behaves_like :array_pack_basic_non_float, 'i'
- it_behaves_like :array_pack_arguments, 'i'
- it_behaves_like :array_pack_numeric_basic, 'i'
- it_behaves_like :array_pack_integer, 'i'
-end
-
-describe "Array#pack with format 'I'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_32bit_le, 'I<'
- end
-
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'I<_'
- it_behaves_like :array_pack_32bit_le, 'I_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'I<!'
- it_behaves_like :array_pack_32bit_le, 'I!<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_32bit_be, 'I>'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'I>_'
- it_behaves_like :array_pack_32bit_be, 'I_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'I>!'
- it_behaves_like :array_pack_32bit_be, 'I!>'
- end
-end
-
-describe "Array#pack with format 'i'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_32bit_le, 'i<'
- end
-
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'i<_'
- it_behaves_like :array_pack_32bit_le, 'i_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'i<!'
- it_behaves_like :array_pack_32bit_le, 'i!<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_32bit_be, 'i>'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'i>_'
- it_behaves_like :array_pack_32bit_be, 'i_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'i>!'
- it_behaves_like :array_pack_32bit_be, 'i!>'
- end
-end
-
-little_endian do
- describe "Array#pack with format 'I'" do
- it_behaves_like :array_pack_32bit_le, 'I'
- end
-
- describe "Array#pack with format 'I' with modifier '_'" do
- it_behaves_like :array_pack_32bit_le_platform, 'I_'
- end
-
- describe "Array#pack with format 'I' with modifier '!'" do
- it_behaves_like :array_pack_32bit_le_platform, 'I!'
- end
-
- describe "Array#pack with format 'i'" do
- it_behaves_like :array_pack_32bit_le, 'i'
- end
-
- describe "Array#pack with format 'i' with modifier '_'" do
- it_behaves_like :array_pack_32bit_le_platform, 'i_'
- end
-
- describe "Array#pack with format 'i' with modifier '!'" do
- it_behaves_like :array_pack_32bit_le_platform, 'i!'
- end
-end
-
-big_endian do
- describe "Array#pack with format 'I'" do
- it_behaves_like :array_pack_32bit_be, 'I'
- end
-
- describe "Array#pack with format 'I' with modifier '_'" do
- it_behaves_like :array_pack_32bit_be_platform, 'I_'
- end
-
- describe "Array#pack with format 'I' with modifier '!'" do
- it_behaves_like :array_pack_32bit_be_platform, 'I!'
- end
-
- describe "Array#pack with format 'i'" do
- it_behaves_like :array_pack_32bit_be, 'i'
- end
-
- describe "Array#pack with format 'i' with modifier '_'" do
- it_behaves_like :array_pack_32bit_be_platform, 'i_'
- end
-
- describe "Array#pack with format 'i' with modifier '!'" do
- it_behaves_like :array_pack_32bit_be_platform, 'i!'
- end
-end
diff --git a/spec/ruby/core/array/pack/j_spec.rb b/spec/ruby/core/array/pack/j_spec.rb
deleted file mode 100644
index 88f074724c..0000000000
--- a/spec/ruby/core/array/pack/j_spec.rb
+++ /dev/null
@@ -1,222 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-ruby_version_is '2.3' do
- # To handle the special case of x64-mingw32
- pointer_size = RUBY_PLATFORM =~ /\bx64\b/ ? 64 : 1.size * 8
-
- guard -> { pointer_size == 64 } do
- describe "Array#pack with format 'J'" do
- it_behaves_like :array_pack_basic, 'J'
- it_behaves_like :array_pack_basic_non_float, 'J'
- it_behaves_like :array_pack_arguments, 'J'
- it_behaves_like :array_pack_numeric_basic, 'J'
- it_behaves_like :array_pack_integer, 'J'
- end
-
- describe "Array#pack with format 'j'" do
- it_behaves_like :array_pack_basic, 'j'
- it_behaves_like :array_pack_basic_non_float, 'j'
- it_behaves_like :array_pack_arguments, 'j'
- it_behaves_like :array_pack_numeric_basic, 'j'
- it_behaves_like :array_pack_integer, 'j'
- end
-
- little_endian do
- describe "Array#pack with format 'J'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_64bit_le, 'J_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_64bit_le, 'J!'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_64bit_le, 'j_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_64bit_le, 'j!'
- end
- end
- end
-
- big_endian do
- describe "Array#pack with format 'J'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_64bit_be, 'J_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_64bit_be, 'J!'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_64bit_be, 'j_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_64bit_be, 'j!'
- end
- end
- end
-
- describe "Array#pack with format 'J'" do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_64bit_le, 'J<_'
- it_behaves_like :array_pack_64bit_le, 'J_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_64bit_le, 'J<!'
- it_behaves_like :array_pack_64bit_le, 'J!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_64bit_be, 'J>_'
- it_behaves_like :array_pack_64bit_be, 'J_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_64bit_be, 'J>!'
- it_behaves_like :array_pack_64bit_be, 'J!>'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_64bit_le, 'j<_'
- it_behaves_like :array_pack_64bit_le, 'j_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_64bit_le, 'j<!'
- it_behaves_like :array_pack_64bit_le, 'j!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_64bit_be, 'j>_'
- it_behaves_like :array_pack_64bit_be, 'j_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_64bit_be, 'j>!'
- it_behaves_like :array_pack_64bit_be, 'j!>'
- end
- end
- end
-
- guard -> { pointer_size == 32 } do
- describe "Array#pack with format 'J'" do
- it_behaves_like :array_pack_basic, 'J'
- it_behaves_like :array_pack_basic_non_float, 'J'
- it_behaves_like :array_pack_arguments, 'J'
- it_behaves_like :array_pack_numeric_basic, 'J'
- it_behaves_like :array_pack_integer, 'J'
- end
-
- describe "Array#pack with format 'j'" do
- it_behaves_like :array_pack_basic, 'j'
- it_behaves_like :array_pack_basic_non_float, 'j'
- it_behaves_like :array_pack_arguments, 'j'
- it_behaves_like :array_pack_numeric_basic, 'j'
- it_behaves_like :array_pack_integer, 'j'
- end
-
- big_endian do
- describe "Array#pack with format 'J'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_32bit_be, 'J_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_32bit_be, 'J!'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_32bit_be, 'j_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_32bit_be, 'j!'
- end
- end
- end
-
- little_endian do
- describe "Array#pack with format 'J'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_32bit_le, 'J_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_32bit_le, 'J!'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '_'" do
- it_behaves_like :array_pack_32bit_le, 'j_'
- end
-
- describe "with modifier '!'" do
- it_behaves_like :array_pack_32bit_le, 'j!'
- end
- end
- end
-
- describe "Array#pack with format 'J'" do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'J<_'
- it_behaves_like :array_pack_32bit_le, 'J_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'J<!'
- it_behaves_like :array_pack_32bit_le, 'J!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'J>_'
- it_behaves_like :array_pack_32bit_be, 'J_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'J>!'
- it_behaves_like :array_pack_32bit_be, 'J!>'
- end
- end
-
- describe "Array#pack with format 'j'" do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'j<_'
- it_behaves_like :array_pack_32bit_le, 'j_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'j<!'
- it_behaves_like :array_pack_32bit_le, 'j!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'j>_'
- it_behaves_like :array_pack_32bit_be, 'j_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'j>!'
- it_behaves_like :array_pack_32bit_be, 'j!>'
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/pack/l_spec.rb b/spec/ruby/core/array/pack/l_spec.rb
deleted file mode 100644
index 5c1ad21d12..0000000000
--- a/spec/ruby/core/array/pack/l_spec.rb
+++ /dev/null
@@ -1,221 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'L'" do
- it_behaves_like :array_pack_basic, 'L'
- it_behaves_like :array_pack_basic_non_float, 'L'
- it_behaves_like :array_pack_arguments, 'L'
- it_behaves_like :array_pack_numeric_basic, 'L'
- it_behaves_like :array_pack_integer, 'L'
-end
-
-describe "Array#pack with format 'l'" do
- it_behaves_like :array_pack_basic, 'l'
- it_behaves_like :array_pack_basic_non_float, 'l'
- it_behaves_like :array_pack_arguments, 'l'
- it_behaves_like :array_pack_numeric_basic, 'l'
- it_behaves_like :array_pack_integer, 'l'
-end
-
-describe "Array#pack with format 'L'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_32bit_le, 'L<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_32bit_be, 'L>'
- end
-
- guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'L<_'
- it_behaves_like :array_pack_32bit_le, 'L_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'L<!'
- it_behaves_like :array_pack_32bit_le, 'L!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'L>_'
- it_behaves_like :array_pack_32bit_be, 'L_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'L>!'
- it_behaves_like :array_pack_32bit_be, 'L!>'
- end
- end
-
- guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_64bit_le, 'L<_'
- it_behaves_like :array_pack_64bit_le, 'L_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_64bit_le, 'L<!'
- it_behaves_like :array_pack_64bit_le, 'L!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_64bit_be, 'L>_'
- it_behaves_like :array_pack_64bit_be, 'L_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_64bit_be, 'L>!'
- it_behaves_like :array_pack_64bit_be, 'L!>'
- end
- end
-end
-
-describe "Array#pack with format 'l'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_32bit_le, 'l<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_32bit_be, 'l>'
- end
-
- guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_32bit_le, 'l<_'
- it_behaves_like :array_pack_32bit_le, 'l_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_32bit_le, 'l<!'
- it_behaves_like :array_pack_32bit_le, 'l!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_32bit_be, 'l>_'
- it_behaves_like :array_pack_32bit_be, 'l_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_32bit_be, 'l>!'
- it_behaves_like :array_pack_32bit_be, 'l!>'
- end
- end
-
- guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_64bit_le, 'l<_'
- it_behaves_like :array_pack_64bit_le, 'l_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_64bit_le, 'l<!'
- it_behaves_like :array_pack_64bit_le, 'l!<'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_64bit_be, 'l>_'
- it_behaves_like :array_pack_64bit_be, 'l_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_64bit_be, 'l>!'
- it_behaves_like :array_pack_64bit_be, 'l!>'
- end
- end
-end
-
-little_endian do
- describe "Array#pack with format 'L'" do
- it_behaves_like :array_pack_32bit_le, 'L'
- end
-
- describe "Array#pack with format 'l'" do
- it_behaves_like :array_pack_32bit_le, 'l'
- end
-
- guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do
- describe "Array#pack with format 'L' with modifier '_'" do
- it_behaves_like :array_pack_32bit_le, 'L_'
- end
-
- describe "Array#pack with format 'L' with modifier '!'" do
- it_behaves_like :array_pack_32bit_le, 'L!'
- end
-
- describe "Array#pack with format 'l' with modifier '_'" do
- it_behaves_like :array_pack_32bit_le, 'l_'
- end
-
- describe "Array#pack with format 'l' with modifier '!'" do
- it_behaves_like :array_pack_32bit_le, 'l!'
- end
- end
-
- guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do
- describe "Array#pack with format 'L' with modifier '_'" do
- it_behaves_like :array_pack_64bit_le, 'L_'
- end
-
- describe "Array#pack with format 'L' with modifier '!'" do
- it_behaves_like :array_pack_64bit_le, 'L!'
- end
-
- describe "Array#pack with format 'l' with modifier '_'" do
- it_behaves_like :array_pack_64bit_le, 'l_'
- end
-
- describe "Array#pack with format 'l' with modifier '!'" do
- it_behaves_like :array_pack_64bit_le, 'l!'
- end
- end
-end
-
-big_endian do
- describe "Array#pack with format 'L'" do
- it_behaves_like :array_pack_32bit_be, 'L'
- end
-
- describe "Array#pack with format 'l'" do
- it_behaves_like :array_pack_32bit_be, 'l'
- end
-
- guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do
- describe "Array#pack with format 'L' with modifier '_'" do
- it_behaves_like :array_pack_32bit_be, 'L_'
- end
-
- describe "Array#pack with format 'L' with modifier '!'" do
- it_behaves_like :array_pack_32bit_be, 'L!'
- end
-
- describe "Array#pack with format 'l' with modifier '_'" do
- it_behaves_like :array_pack_32bit_be, 'l_'
- end
-
- describe "Array#pack with format 'l' with modifier '!'" do
- it_behaves_like :array_pack_32bit_be, 'l!'
- end
- end
-
- guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do
- describe "Array#pack with format 'L' with modifier '_'" do
- it_behaves_like :array_pack_64bit_be, 'L_'
- end
-
- describe "Array#pack with format 'L' with modifier '!'" do
- it_behaves_like :array_pack_64bit_be, 'L!'
- end
-
- describe "Array#pack with format 'l' with modifier '_'" do
- it_behaves_like :array_pack_64bit_be, 'l_'
- end
-
- describe "Array#pack with format 'l' with modifier '!'" do
- it_behaves_like :array_pack_64bit_be, 'l!'
- end
- end
-end
diff --git a/spec/ruby/core/array/pack/m_spec.rb b/spec/ruby/core/array/pack/m_spec.rb
deleted file mode 100644
index 36d996cba6..0000000000
--- a/spec/ruby/core/array/pack/m_spec.rb
+++ /dev/null
@@ -1,306 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-
-describe "Array#pack with format 'M'" do
- it_behaves_like :array_pack_basic, 'M'
- it_behaves_like :array_pack_basic_non_float, 'M'
- it_behaves_like :array_pack_arguments, 'M'
-
- it "encodes an empty string as an empty string" do
- [""].pack("M").should == ""
- end
-
- it "encodes nil as an empty string" do
- [nil].pack("M").should == ""
- end
-
- it "appends a soft line break at the end of an encoded string" do
- ["a"].pack("M").should == "a=\n"
- end
-
- it "does not append a soft break if the string ends with a newline" do
- ["a\n"].pack("M").should == "a\n"
- end
-
- it "encodes one element for each directive" do
- ["a", "b", "c"].pack("MM").should == "a=\nb=\n"
- end
-
- it "encodes byte values 33..60 directly" do
- [ [["!\"\#$%&'()*+,-./"], "!\"\#$%&'()*+,-./=\n"],
- [["0123456789"], "0123456789=\n"],
- [[":;<"], ":;<=\n"]
- ].should be_computed_by(:pack, "M")
- end
-
- it "encodes byte values 62..126 directly" do
- [ [[">?@"], ">?@=\n"],
- [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"], "ABCDEFGHIJKLMNOPQRSTUVWXYZ=\n"],
- [["[\\]^_`"], "[\\]^_`=\n"],
- [["abcdefghijklmnopqrstuvwxyz"], "abcdefghijklmnopqrstuvwxyz=\n"],
- [["{|}~"], "{|}~=\n"]
- ].should be_computed_by(:pack, "M")
- end
-
- it "encodes an '=' character in hex format" do
- ["="].pack("M").should == "=3D=\n"
- end
-
- it "encodes an embedded space directly" do
- ["a b"].pack("M").should == "a b=\n"
- end
-
- it "encodes a space at the end of the string directly" do
- ["a "].pack("M").should == "a =\n"
- end
-
- it "encodes an embedded tab directly" do
- ["a\tb"].pack("M").should == "a\tb=\n"
- end
-
- it "encodes a tab at the end of the string directly" do
- ["a\t"].pack("M").should == "a\t=\n"
- end
-
- it "encodes an embedded newline directly" do
- ["a\nb"].pack("M").should == "a\nb=\n"
- end
-
- it "encodes 0..31 except tab and newline in hex format" do
- [ [["\x00\x01\x02\x03\x04\x05\x06"], "=00=01=02=03=04=05=06=\n"],
- [["\a\b\v\f\r"], "=07=08=0B=0C=0D=\n"],
- [["\x0e\x0f\x10\x11\x12\x13\x14"], "=0E=0F=10=11=12=13=14=\n"],
- [["\x15\x16\x17\x18\x19\x1a"], "=15=16=17=18=19=1A=\n"],
- [["\e"], "=1B=\n"],
- [["\x1c\x1d\x1e\x1f"], "=1C=1D=1E=1F=\n"]
- ].should be_computed_by(:pack, "M")
- end
-
- it "encodes a tab followed by a newline with an encoded newline" do
- ["\t\n"].pack("M").should == "\t=\n\n"
- end
-
- it "encodes 127..255 in hex format" do
- [ [["\x7f\x80\x81\x82\x83\x84\x85\x86"], "=7F=80=81=82=83=84=85=86=\n"],
- [["\x87\x88\x89\x8a\x8b\x8c\x8d\x8e"], "=87=88=89=8A=8B=8C=8D=8E=\n"],
- [["\x8f\x90\x91\x92\x93\x94\x95\x96"], "=8F=90=91=92=93=94=95=96=\n"],
- [["\x97\x98\x99\x9a\x9b\x9c\x9d\x9e"], "=97=98=99=9A=9B=9C=9D=9E=\n"],
- [["\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6"], "=9F=A0=A1=A2=A3=A4=A5=A6=\n"],
- [["\xa7\xa8\xa9\xaa\xab\xac\xad\xae"], "=A7=A8=A9=AA=AB=AC=AD=AE=\n"],
- [["\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6"], "=AF=B0=B1=B2=B3=B4=B5=B6=\n"],
- [["\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe"], "=B7=B8=B9=BA=BB=BC=BD=BE=\n"],
- [["\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6"], "=BF=C0=C1=C2=C3=C4=C5=C6=\n"],
- [["\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce"], "=C7=C8=C9=CA=CB=CC=CD=CE=\n"],
- [["\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6"], "=CF=D0=D1=D2=D3=D4=D5=D6=\n"],
- [["\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde"], "=D7=D8=D9=DA=DB=DC=DD=DE=\n"],
- [["\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6"], "=DF=E0=E1=E2=E3=E4=E5=E6=\n"],
- [["\xe7\xe8\xe9\xea\xeb\xec\xed\xee"], "=E7=E8=E9=EA=EB=EC=ED=EE=\n"],
- [["\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6"], "=EF=F0=F1=F2=F3=F4=F5=F6=\n"],
- [["\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"], "=F7=F8=F9=FA=FB=FC=FD=FE=\n"],
- [["\xff"], "=FF=\n"]
- ].should be_computed_by(:pack, "M")
- end
-
- it "emits a soft line break when the output exceeds 72 characters when passed '*', 0, 1, or no count modifier" do
- s1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- r1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=\na=\n"
- s2 = "\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19"
- r2 = "=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=19=\n=19=\n"
- s3 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x15a"
- r3 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=15=\na=\n"
- s4 = "\x15aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x15a"
- r4 = "=15aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=\na=15a=\n"
-
- [ [[s1], "M", r1],
- [[s1], "M0", r1],
- [[s1], "M1", r1],
- [[s2], "M", r2],
- [[s2], "M0", r2],
- [[s2], "M1", r2],
- [[s3], "M", r3],
- [[s3], "M0", r3],
- [[s3], "M1", r3],
- [[s4], "M", r4],
- [[s4], "M0", r4],
- [[s4], "M1", r4]
- ].should be_computed_by(:pack)
- end
-
- it "emits a soft line break when the output exceeds count characters" do
- [ [["abcdefghi"], "M2", "abc=\ndef=\nghi=\n"],
- [["abcdefghi"], "M3", "abcd=\nefgh=\ni=\n"],
- [["abcdefghi"], "M4", "abcde=\nfghi=\n"],
- [["abcdefghi"], "M5", "abcdef=\nghi=\n"],
- [["abcdefghi"], "M6", "abcdefg=\nhi=\n"],
- [["\x19\x19\x19\x19"], "M2", "=19=\n=19=\n=19=\n=19=\n"],
- [["\x19\x19\x19\x19"], "M3", "=19=19=\n=19=19=\n"],
- [["\x19\x19\x19\x19"], "M4", "=19=19=\n=19=19=\n"],
- [["\x19\x19\x19\x19"], "M5", "=19=19=\n=19=19=\n"],
- [["\x19\x19\x19\x19"], "M6", "=19=19=19=\n=19=\n"],
- [["\x19\x19\x19\x19"], "M7", "=19=19=19=\n=19=\n"]
- ].should be_computed_by(:pack)
- end
-
- it "encodes a recursive array" do
- empty = ArraySpecs.empty_recursive_array
- empty.pack('M').should be_an_instance_of(String)
-
- array = ArraySpecs.recursive_array
- array.pack('M').should == "1=\n"
- end
-
- it "calls #to_s to convert an object to a String" do
- obj = mock("pack M string")
- obj.should_receive(:to_s).and_return("packing")
-
- [obj].pack("M").should == "packing=\n"
- end
-
- it "converts the object to a String representation if #to_s does not return a String" do
- obj = mock("pack M non-string")
- obj.should_receive(:to_s).and_return(2)
-
- [obj].pack("M").should be_an_instance_of(String)
- end
-
- it "encodes a Symbol as a String" do
- [:symbol].pack("M").should == "symbol=\n"
- end
-
- it "encodes an Integer as a String" do
- [ [[1], "1=\n"],
- [[bignum_value], "#{bignum_value}=\n"]
- ].should be_computed_by(:pack, "M")
- end
-
- it "encodes a Float as a String" do
- [1.0].pack("M").should == "1.0=\n"
- end
-
- it "converts Floats to the minimum unique representation" do
- [1.0 / 3.0].pack("M").should == "0.3333333333333333=\n"
- end
-
- it "sets the output string to US-ASCII encoding" do
- ["abcd"].pack("M").encoding.should == Encoding::US_ASCII
- end
-end
-
-describe "Array#pack with format 'm'" do
- it_behaves_like :array_pack_basic, 'm'
- it_behaves_like :array_pack_basic_non_float, 'm'
- it_behaves_like :array_pack_arguments, 'm'
-
- it "encodes an empty string as an empty string" do
- [""].pack("m").should == ""
- end
-
- it "appends a newline to the end of the encoded string" do
- ["a"].pack("m").should == "YQ==\n"
- end
-
- it "encodes one element per directive" do
- ["abc", "DEF"].pack("mm").should == "YWJj\nREVG\n"
- end
-
- it "encodes 1, 2, or 3 characters in 4 output characters (Base64 encoding)" do
- [ [["a"], "YQ==\n"],
- [["ab"], "YWI=\n"],
- [["abc"], "YWJj\n"],
- [["abcd"], "YWJjZA==\n"],
- [["abcde"], "YWJjZGU=\n"],
- [["abcdef"], "YWJjZGVm\n"],
- [["abcdefg"], "YWJjZGVmZw==\n"],
- ].should be_computed_by(:pack, "m")
- end
-
- it "emits a newline after complete groups of count / 3 input characters when passed a count modifier" do
- ["abcdefg"].pack("m3").should == "YWJj\nZGVm\nZw==\n"
- end
-
- it "implicitly has a count of 45 when passed '*', 1, 2 or no count modifier" do
- s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- r = "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\nYWFhYWE=\n"
- [ [[s], "m", r],
- [[s], "m*", r],
- [[s], "m1", r],
- [[s], "m2", r],
- ].should be_computed_by(:pack)
- end
-
- it "encodes all ascii characters" do
- [ [["\x00\x01\x02\x03\x04\x05\x06"], "AAECAwQFBg==\n"],
- [["\a\b\t\n\v\f\r"], "BwgJCgsMDQ==\n"],
- [["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"], "Dg8QERITFBUW\n"],
- [["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"], "FxgZGhscHR4f\n"],
- [["!\"\#$%&'()*+,-./"], "ISIjJCUmJygpKissLS4v\n"],
- [["0123456789"], "MDEyMzQ1Njc4OQ==\n"],
- [[":;<=>?@"], "Ojs8PT4/QA==\n"],
- [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"], "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=\n"],
- [["[\\]^_`"], "W1xdXl9g\n"],
- [["abcdefghijklmnopqrstuvwxyz"], "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=\n"],
- [["{|}~"], "e3x9fg==\n"],
- [["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"], "f8KAwoHCgsKD\n"],
- [["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"], "woTChcKGwofC\n"],
- [["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"], "iMKJworCi8KM\n"],
- [["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"], "wo3CjsKPwpDC\n"],
- [["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"], "kcKSwpPClMKV\n"],
- [["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"], "wpbCl8KYwpnC\n"],
- [["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"], "msKbwpzCncKe\n"],
- [["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"], "wp/CoMKhwqLC\n"],
- [["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"], "o8KkwqXCpsKn\n"],
- [["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"], "wqjCqcKqwqvC\n"],
- [["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"], "rMKtwq7Cr8Kw\n"],
- [["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"], "wrHCssKzwrTC\n"],
- [["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"], "tcK2wrfCuMK5\n"],
- [["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"], "wrrCu8K8wr3C\n"],
- [["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"], "vsK/w4DDgcOC\n"],
- [["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"], "w4PDhMOFw4bD\n"],
- [["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"], "h8OIw4nDisOL\n"],
- [["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"], "w4zDjcOOw4/D\n"],
- [["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"], "kMORw5LDk8OU\n"],
- [["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"], "w5XDlsOXw5jD\n"],
- [["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"], "mcOaw5vDnMOd\n"],
- [["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"], "w57Dn8Ogw6HD\n"],
- [["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"], "osOjw6TDpcOm\n"],
- [["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"], "w6fDqMOpw6rD\n"],
- [["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"], "q8Osw63DrsOv\n"],
- [["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"], "w7DDscOyw7PD\n"],
- [["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"], "tMO1w7bDt8O4\n"],
- [["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"], "w7nDusO7w7zD\n"],
- [["\xbd\xc3\xbe\xc3\xbf"], "vcO+w78=\n"]
- ].should be_computed_by(:pack, "m")
- end
-
- it "calls #to_str to convert an object to a String" do
- obj = mock("pack m string")
- obj.should_receive(:to_str).and_return("abc")
- [obj].pack("m").should == "YWJj\n"
- end
-
- it "raises a TypeError if #to_str does not return a String" do
- obj = mock("pack m non-string")
- lambda { [obj].pack("m") }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed nil" do
- lambda { [nil].pack("m") }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed an Integer" do
- lambda { [0].pack("m") }.should raise_error(TypeError)
- lambda { [bignum_value].pack("m") }.should raise_error(TypeError)
- end
-
- it "does not emit a newline if passed zero as the count modifier" do
- s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- r = "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE="
- [s].pack("m0").should == r
- end
-
- it "sets the output string to US-ASCII encoding" do
- ["abcd"].pack("m").encoding.should == Encoding::US_ASCII
- end
-end
diff --git a/spec/ruby/core/array/pack/n_spec.rb b/spec/ruby/core/array/pack/n_spec.rb
deleted file mode 100644
index 72a83e082b..0000000000
--- a/spec/ruby/core/array/pack/n_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'N'" do
- it_behaves_like :array_pack_basic, 'N'
- it_behaves_like :array_pack_basic_non_float, 'N'
- it_behaves_like :array_pack_arguments, 'N'
- it_behaves_like :array_pack_numeric_basic, 'N'
- it_behaves_like :array_pack_integer, 'N'
- it_behaves_like :array_pack_no_platform, 'N'
- it_behaves_like :array_pack_32bit_be, 'N'
-end
-
-describe "Array#pack with format 'n'" do
- it_behaves_like :array_pack_basic, 'n'
- it_behaves_like :array_pack_basic_non_float, 'n'
- it_behaves_like :array_pack_arguments, 'n'
- it_behaves_like :array_pack_numeric_basic, 'n'
- it_behaves_like :array_pack_integer, 'n'
- it_behaves_like :array_pack_no_platform, 'n'
- it_behaves_like :array_pack_16bit_be, 'n'
-end
diff --git a/spec/ruby/core/array/pack/p_spec.rb b/spec/ruby/core/array/pack/p_spec.rb
deleted file mode 100644
index 65a08281e2..0000000000
--- a/spec/ruby/core/array/pack/p_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-
-describe "Array#pack with format 'P'" do
- it_behaves_like :array_pack_basic_non_float, 'P'
-end
-
-describe "Array#pack with format 'p'" do
- it_behaves_like :array_pack_basic_non_float, 'p'
-end
diff --git a/spec/ruby/core/array/pack/percent_spec.rb b/spec/ruby/core/array/pack/percent_spec.rb
deleted file mode 100644
index 55d6de3424..0000000000
--- a/spec/ruby/core/array/pack/percent_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-
-describe "Array#pack with format '%'" do
- it "raises an Argument Error" do
- lambda { [1].pack("%") }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/pack/q_spec.rb b/spec/ruby/core/array/pack/q_spec.rb
deleted file mode 100644
index 83e115c54a..0000000000
--- a/spec/ruby/core/array/pack/q_spec.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'Q'" do
- it_behaves_like :array_pack_basic, 'Q'
- it_behaves_like :array_pack_basic_non_float, 'Q'
- it_behaves_like :array_pack_arguments, 'Q'
- it_behaves_like :array_pack_numeric_basic, 'Q'
- it_behaves_like :array_pack_integer, 'Q'
-end
-
-describe "Array#pack with format 'q'" do
- it_behaves_like :array_pack_basic, 'q'
- it_behaves_like :array_pack_basic_non_float, 'q'
- it_behaves_like :array_pack_arguments, 'q'
- it_behaves_like :array_pack_numeric_basic, 'q'
- it_behaves_like :array_pack_integer, 'q'
-end
-
-describe "Array#pack with format 'Q'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_64bit_le, 'Q<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_64bit_be, 'Q>'
- end
-end
-
-describe "Array#pack with format 'q'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_64bit_le, 'q<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_64bit_be, 'q>'
- end
-end
-
-little_endian do
- describe "Array#pack with format 'Q'" do
- it_behaves_like :array_pack_64bit_le, 'Q'
- end
-
- describe "Array#pack with format 'q'" do
- it_behaves_like :array_pack_64bit_le, 'q'
- end
-end
-
-big_endian do
- describe "Array#pack with format 'Q'" do
- it_behaves_like :array_pack_64bit_be, 'Q'
- end
-
- describe "Array#pack with format 'q'" do
- it_behaves_like :array_pack_64bit_be, 'q'
- end
-end
diff --git a/spec/ruby/core/array/pack/s_spec.rb b/spec/ruby/core/array/pack/s_spec.rb
deleted file mode 100644
index b2f8cb48f8..0000000000
--- a/spec/ruby/core/array/pack/s_spec.rb
+++ /dev/null
@@ -1,133 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'S'" do
- it_behaves_like :array_pack_basic, 'S'
- it_behaves_like :array_pack_basic_non_float, 'S'
- it_behaves_like :array_pack_arguments, 'S'
- it_behaves_like :array_pack_numeric_basic, 'S'
- it_behaves_like :array_pack_integer, 'S'
-end
-
-describe "Array#pack with format 's'" do
- it_behaves_like :array_pack_basic, 's'
- it_behaves_like :array_pack_basic_non_float, 's'
- it_behaves_like :array_pack_arguments, 's'
- it_behaves_like :array_pack_numeric_basic, 's'
- it_behaves_like :array_pack_integer, 's'
-end
-
-describe "Array#pack with format 'S'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_16bit_le, 'S<'
- end
-
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_16bit_le, 'S<_'
- it_behaves_like :array_pack_16bit_le, 'S_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_16bit_le, 'S<!'
- it_behaves_like :array_pack_16bit_le, 'S!<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_16bit_be, 'S>'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_16bit_be, 'S>_'
- it_behaves_like :array_pack_16bit_be, 'S_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_16bit_be, 'S>!'
- it_behaves_like :array_pack_16bit_be, 'S!>'
- end
-end
-
-describe "Array#pack with format 's'" do
- describe "with modifier '<'" do
- it_behaves_like :array_pack_16bit_le, 's<'
- end
-
- describe "with modifier '<' and '_'" do
- it_behaves_like :array_pack_16bit_le, 's<_'
- it_behaves_like :array_pack_16bit_le, 's_<'
- end
-
- describe "with modifier '<' and '!'" do
- it_behaves_like :array_pack_16bit_le, 's<!'
- it_behaves_like :array_pack_16bit_le, 's!<'
- end
-
- describe "with modifier '>'" do
- it_behaves_like :array_pack_16bit_be, 's>'
- end
-
- describe "with modifier '>' and '_'" do
- it_behaves_like :array_pack_16bit_be, 's>_'
- it_behaves_like :array_pack_16bit_be, 's_>'
- end
-
- describe "with modifier '>' and '!'" do
- it_behaves_like :array_pack_16bit_be, 's>!'
- it_behaves_like :array_pack_16bit_be, 's!>'
- end
-end
-
-little_endian do
- describe "Array#pack with format 'S'" do
- it_behaves_like :array_pack_16bit_le, 'S'
- end
-
- describe "Array#pack with format 'S' with modifier '_'" do
- it_behaves_like :array_pack_16bit_le, 'S_'
- end
-
- describe "Array#pack with format 'S' with modifier '!'" do
- it_behaves_like :array_pack_16bit_le, 'S!'
- end
-
- describe "Array#pack with format 's'" do
- it_behaves_like :array_pack_16bit_le, 's'
- end
-
- describe "Array#pack with format 's' with modifier '_'" do
- it_behaves_like :array_pack_16bit_le, 's_'
- end
-
- describe "Array#pack with format 's' with modifier '!'" do
- it_behaves_like :array_pack_16bit_le, 's!'
- end
-end
-
-big_endian do
- describe "Array#pack with format 'S'" do
- it_behaves_like :array_pack_16bit_be, 'S'
- end
-
- describe "Array#pack with format 'S' with modifier '_'" do
- it_behaves_like :array_pack_16bit_be, 'S_'
- end
-
- describe "Array#pack with format 'S' with modifier '!'" do
- it_behaves_like :array_pack_16bit_be, 'S!'
- end
-
- describe "Array#pack with format 's'" do
- it_behaves_like :array_pack_16bit_be, 's'
- end
-
- describe "Array#pack with format 's' with modifier '_'" do
- it_behaves_like :array_pack_16bit_be, 's_'
- end
-
- describe "Array#pack with format 's' with modifier '!'" do
- it_behaves_like :array_pack_16bit_be, 's!'
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/basic.rb b/spec/ruby/core/array/pack/shared/basic.rb
deleted file mode 100644
index 39ab15308d..0000000000
--- a/spec/ruby/core/array/pack/shared/basic.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-describe :array_pack_arguments, shared: true do
- it "raises an ArgumentError if there are fewer elements than the format requires" do
- lambda { [].pack(pack_format(1)) }.should raise_error(ArgumentError)
- end
-end
-
-describe :array_pack_basic, shared: true do
- before :each do
- @obj = ArraySpecs.universal_pack_object
- end
-
- it "raises a TypeError when passed nil" do
- lambda { [@obj].pack(nil) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed an Integer" do
- lambda { [@obj].pack(1) }.should raise_error(TypeError)
- end
-end
-
-describe :array_pack_basic_non_float, shared: true do
- before :each do
- @obj = ArraySpecs.universal_pack_object
- end
-
- it "ignores whitespace in the format string" do
- [@obj, @obj].pack("a \t\n\v\f\r"+pack_format).should be_an_instance_of(String)
- end
-
- it "calls #to_str to coerce the directives string" do
- d = mock("pack directive")
- d.should_receive(:to_str).and_return("x"+pack_format)
- [@obj, @obj].pack(d).should be_an_instance_of(String)
- end
-
- it "taints the output string if the format string is tainted" do
- [@obj, @obj].pack("x"+pack_format.taint).tainted?.should be_true
- end
-end
-
-describe :array_pack_basic_float, shared: true do
- it "ignores whitespace in the format string" do
- [9.3, 4.7].pack(" \t\n\v\f\r"+pack_format).should be_an_instance_of(String)
- end
-
- it "calls #to_str to coerce the directives string" do
- d = mock("pack directive")
- d.should_receive(:to_str).and_return("x"+pack_format)
- [1.2, 4.7].pack(d).should be_an_instance_of(String)
- end
-
- it "taints the output string if the format string is tainted" do
- [3.2, 2.8].pack("x"+pack_format.taint).tainted?.should be_true
- end
-end
-
-describe :array_pack_no_platform, shared: true do
- it "raises ArgumentError when the format modifier is '_'" do
- lambda{ [1].pack(pack_format("_")) }.should raise_error(ArgumentError)
- end
-
- it "raises ArgumentError when the format modifier is '!'" do
- lambda{ [1].pack(pack_format("!")) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/encodings.rb b/spec/ruby/core/array/pack/shared/encodings.rb
deleted file mode 100644
index 3724a5d859..0000000000
--- a/spec/ruby/core/array/pack/shared/encodings.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-describe :array_pack_hex, shared: true do
- it "encodes no bytes when passed zero as the count modifier" do
- ["abc"].pack(pack_format(0)).should == ""
- end
-
- it "raises a TypeError if the object does not respond to #to_str" do
- obj = mock("pack hex non-string")
- lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if #to_str does not return a String" do
- obj = mock("pack hex non-string")
- obj.should_receive(:to_str).and_return(1)
- lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/float.rb b/spec/ruby/core/array/pack/shared/float.rb
deleted file mode 100644
index 082de27acd..0000000000
--- a/spec/ruby/core/array/pack/shared/float.rb
+++ /dev/null
@@ -1,249 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-
-describe :array_pack_float_le, shared: true do
- it "encodes a positive Float" do
- [1.42].pack(pack_format).should == "\x8f\xc2\xb5?"
- end
-
- it "encodes a negative Float" do
- [-34.2].pack(pack_format).should == "\xcd\xcc\x08\xc2"
- end
-
- it "converts an Integer to a Float" do
- [8].pack(pack_format).should == "\x00\x00\x00A"
- end
-
- it "raises a TypeError if passed a String representation of a floating point number" do
- lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "\x9a\x999@33\xb3?"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [2.9, 1.4, 8.2].pack(pack_format("*")).should == "\x9a\x999@33\xb3?33\x03A"
- end
-
- it "ignores NULL bytes between directives" do
- [5.3, 9.2].pack(pack_format("\000", 2)).should == "\x9a\x99\xa9@33\x13A"
- end
-
- it "ignores spaces between directives" do
- [5.3, 9.2].pack(pack_format(" ", 2)).should == "\x9a\x99\xa9@33\x13A"
- end
-
- it "encodes positive Infinity" do
- [infinity_value].pack(pack_format).should == "\x00\x00\x80\x7f"
- end
-
- it "encodes negative Infinity" do
- [-infinity_value].pack(pack_format).should == "\x00\x00\x80\xff"
- end
-
- platform_is "86" do # x86 / x86_64
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x00\x00\xc0\xff"
- end
- end
-
- platform_is "powerpc64" do
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x00\x00\xc0\x7f"
- end
- end
-
- it "encodes a positive Float outside the range of a single precision float" do
- [1e150].pack(pack_format).should == "\x00\x00\x80\x7f"
- end
-
- it "encodes a negative Float outside the range of a single precision float" do
- [-1e150].pack(pack_format).should == "\x00\x00\x80\xff"
- end
-end
-
-describe :array_pack_float_be, shared: true do
- it "encodes a positive Float" do
- [1.42].pack(pack_format).should == "?\xb5\xc2\x8f"
- end
-
- it "encodes a negative Float" do
- [-34.2].pack(pack_format).should == "\xc2\x08\xcc\xcd"
- end
-
- it "converts an Integer to a Float" do
- [8].pack(pack_format).should == "A\x00\x00\x00"
- end
-
- it "raises a TypeError if passed a String representation of a floating point number" do
- lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "@9\x99\x9a?\xb333"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [2.9, 1.4, 8.2].pack(pack_format("*")).should == "@9\x99\x9a?\xb333A\x0333"
- end
-
- it "ignores NULL bytes between directives" do
- [5.3, 9.2].pack(pack_format("\000", 2)).should == "@\xa9\x99\x9aA\x1333"
- end
-
- it "ignores spaces between directives" do
- [5.3, 9.2].pack(pack_format(" ", 2)).should == "@\xa9\x99\x9aA\x1333"
- end
-
- it "encodes positive Infinity" do
- [infinity_value].pack(pack_format).should == "\x7f\x80\x00\x00"
- end
-
- it "encodes negative Infinity" do
- [-infinity_value].pack(pack_format).should == "\xff\x80\x00\x00"
- end
-
- platform_is "86" do # x86 / x86_64
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\xff\xc0\x00\x00"
- end
- end
-
- platform_is "powerpc64" do
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x7f\xc0\x00\x00"
- end
- end
-
- it "encodes a positive Float outside the range of a single precision float" do
- [1e150].pack(pack_format).should == "\x7f\x80\x00\x00"
- end
-
- it "encodes a negative Float outside the range of a single precision float" do
- [-1e150].pack(pack_format).should == "\xff\x80\x00\x00"
- end
-end
-
-describe :array_pack_double_le, shared: true do
- it "encodes a positive Float" do
- [1.42].pack(pack_format).should == "\xb8\x1e\x85\xebQ\xb8\xf6?"
- end
-
- it "encodes a negative Float" do
- [-34.2].pack(pack_format).should == "\x9a\x99\x99\x99\x99\x19A\xc0"
- end
-
- it "converts an Integer to a Float" do
- [8].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\x20@"
- end
-
- it "raises a TypeError if passed a String representation of a floating point number" do
- lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "333333\x07@ffffff\xf6?"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [2.9, 1.4, 8.2].pack(pack_format("*")).should == "333333\x07@ffffff\xf6?ffffff\x20@"
- end
-
- it "ignores NULL bytes between directives" do
- [5.3, 9.2].pack(pack_format("\000", 2)).should == "333333\x15@ffffff\x22@"
- end
-
- it "ignores spaces between directives" do
- [5.3, 9.2].pack(pack_format(" ", 2)).should == "333333\x15@ffffff\x22@"
- end
-
- it "encodes positive Infinity" do
- [infinity_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf0\x7f"
- end
-
- it "encodes negative Infinity" do
- [-infinity_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf0\xff"
- end
-
- platform_is "86" do # x86 / x86_64
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf8\xff"
- end
- end
-
- platform_is "powerpc64" do
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x00\x00\x00\x00\x00\x00\xf8\x7f"
- end
- end
-
- it "encodes a positive Float outside the range of a single precision float" do
- [1e150].pack(pack_format).should == "\xaf\x96P\x2e5\x8d\x13_"
- end
-
- it "encodes a negative Float outside the range of a single precision float" do
- [-1e150].pack(pack_format).should == "\xaf\x96P\x2e5\x8d\x13\xdf"
- end
-end
-
-describe :array_pack_double_be, shared: true do
- it "encodes a positive Float" do
- [1.42].pack(pack_format).should == "?\xf6\xb8Q\xeb\x85\x1e\xb8"
- end
-
- it "encodes a negative Float" do
- [-34.2].pack(pack_format).should == "\xc0A\x19\x99\x99\x99\x99\x9a"
- end
-
- it "converts an Integer to a Float" do
- [8].pack(pack_format).should == "@\x20\x00\x00\x00\x00\x00\x00"
- end
-
- it "raises a TypeError if passed a String representation of a floating point number" do
- lambda { ["13"].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [2.9, 1.4, 8.2].pack(pack_format(nil, 2)).should == "@\x07333333?\xf6ffffff"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [2.9, 1.4, 8.2].pack(pack_format("*")).should == "@\x07333333?\xf6ffffff@\x20ffffff"
- end
-
- it "ignores NULL bytes between directives" do
- [5.3, 9.2].pack(pack_format("\000", 2)).should == "@\x15333333@\x22ffffff"
- end
-
- it "ignores spaces between directives" do
- [5.3, 9.2].pack(pack_format(" ", 2)).should == "@\x15333333@\x22ffffff"
- end
-
- it "encodes positive Infinity" do
- [infinity_value].pack(pack_format).should == "\x7f\xf0\x00\x00\x00\x00\x00\x00"
- end
-
- it "encodes negative Infinity" do
- [-infinity_value].pack(pack_format).should == "\xff\xf0\x00\x00\x00\x00\x00\x00"
- end
-
- platform_is "86" do # x86 / x86_64
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\xff\xf8\x00\x00\x00\x00\x00\x00"
- end
- end
-
- platform_is "powerpc64" do
- it "encodes NaN" do
- [nan_value].pack(pack_format).should == "\x7f\xf8\x00\x00\x00\x00\x00\x00"
- end
- end
-
- it "encodes a positive Float outside the range of a single precision float" do
- [1e150].pack(pack_format).should == "_\x13\x8d5\x2eP\x96\xaf"
- end
-
- it "encodes a negative Float outside the range of a single precision float" do
- [-1e150].pack(pack_format).should == "\xdf\x13\x8d5\x2eP\x96\xaf"
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/integer.rb b/spec/ruby/core/array/pack/shared/integer.rb
deleted file mode 100644
index 0df03bbfd1..0000000000
--- a/spec/ruby/core/array/pack/shared/integer.rb
+++ /dev/null
@@ -1,381 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-
-describe :array_pack_16bit_le, shared: true do
- it "encodes the least significant 16 bits of a positive number" do
- [ [[0x0000_0021], "\x21\x00"],
- [[0x0000_4321], "\x21\x43"],
- [[0x0065_4321], "\x21\x43"],
- [[0x7865_4321], "\x21\x43"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 16 bits of a negative number" do
- [ [[-0x0000_0021], "\xdf\xff"],
- [[-0x0000_4321], "\xdf\xbc"],
- [[-0x0065_4321], "\xdf\xbc"],
- [[-0x7865_4321], "\xdf\xbc"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[2019902241.2], "\x21\x43"],
- [[2019902241.8], "\x21\x43"],
- [[-2019902241.2], "\xdf\xbc"],
- [[-2019902241.8], "\xdf\xbc"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678)
- [obj].pack(pack_format()).should == "\x78\x56"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x78\x65\xcd\xab"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x78\x65\xcd\xab\x21\x43"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
- str.should == "\x78\x65\xcd\xab"
- end
-
- it "ignores spaces between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format(' ', 2))
- str.should == "\x78\x65\xcd\xab"
- end
-end
-
-describe :array_pack_16bit_be, shared: true do
- it "encodes the least significant 16 bits of a positive number" do
- [ [[0x0000_0021], "\x00\x21"],
- [[0x0000_4321], "\x43\x21"],
- [[0x0065_4321], "\x43\x21"],
- [[0x7865_4321], "\x43\x21"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 16 bits of a negative number" do
- [ [[-0x0000_0021], "\xff\xdf"],
- [[-0x0000_4321], "\xbc\xdf"],
- [[-0x0065_4321], "\xbc\xdf"],
- [[-0x7865_4321], "\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[2019902241.2], "\x43\x21"],
- [[2019902241.8], "\x43\x21"],
- [[-2019902241.2], "\xbc\xdf"],
- [[-2019902241.8], "\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678)
- [obj].pack(pack_format()).should == "\x56\x78"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x65\x78\xab\xcd"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x65\x78\xab\xcd\x43\x21"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
- str.should == "\x65\x78\xab\xcd"
- end
-
- it "ignores spaces between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format(' ', 2))
- str.should == "\x65\x78\xab\xcd"
- end
-end
-
-describe :array_pack_32bit_le, shared: true do
- it "encodes the least significant 32 bits of a positive number" do
- [ [[0x0000_0021], "\x21\x00\x00\x00"],
- [[0x0000_4321], "\x21\x43\x00\x00"],
- [[0x0065_4321], "\x21\x43\x65\x00"],
- [[0x7865_4321], "\x21\x43\x65\x78"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 32 bits of a negative number" do
- [ [[-0x0000_0021], "\xdf\xff\xff\xff"],
- [[-0x0000_4321], "\xdf\xbc\xff\xff"],
- [[-0x0065_4321], "\xdf\xbc\x9a\xff"],
- [[-0x7865_4321], "\xdf\xbc\x9a\x87"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[2019902241.2], "\x21\x43\x65\x78"],
- [[2019902241.8], "\x21\x43\x65\x78"],
- [[-2019902241.2], "\xdf\xbc\x9a\x87"],
- [[-2019902241.8], "\xdf\xbc\x9a\x87"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678)
- [obj].pack(pack_format()).should == "\x78\x56\x34\x12"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde\x21\x43\x65\x78"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
- end
-
- it "ignores spaces between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format(' ', 2))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
- end
-end
-
-describe :array_pack_32bit_be, shared: true do
- it "encodes the least significant 32 bits of a positive number" do
- [ [[0x0000_0021], "\x00\x00\x00\x21"],
- [[0x0000_4321], "\x00\x00\x43\x21"],
- [[0x0065_4321], "\x00\x65\x43\x21"],
- [[0x7865_4321], "\x78\x65\x43\x21"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 32 bits of a negative number" do
- [ [[-0x0000_0021], "\xff\xff\xff\xdf"],
- [[-0x0000_4321], "\xff\xff\xbc\xdf"],
- [[-0x0065_4321], "\xff\x9a\xbc\xdf"],
- [[-0x7865_4321], "\x87\x9a\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[2019902241.2], "\x78\x65\x43\x21"],
- [[2019902241.8], "\x78\x65\x43\x21"],
- [[-2019902241.2], "\x87\x9a\xbc\xdf"],
- [[-2019902241.8], "\x87\x9a\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678)
- [obj].pack(pack_format()).should == "\x12\x34\x56\x78"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd\x78\x65\x43\x21"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
- end
-
- it "ignores spaces between directives" do
- str = [0x1243_6578, 0xdef0_abcd].pack(pack_format(' ', 2))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
- end
-end
-
-describe :array_pack_32bit_le_platform, shared: true do
- it "encodes the least significant 32 bits of a number" do
- [ [[0x7865_4321], "\x21\x43\x65\x78"],
- [[-0x7865_4321], "\xdf\xbc\x9a\x87"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde\x21\x43\x65\x78"
- end
-
- platform_is wordsize: 64 do
- it "encodes the least significant 32 bits of a number that is greater than 32 bits" do
- [ [[0xff_7865_4321], "\x21\x43\x65\x78"],
- [[-0xff_7865_4321], "\xdf\xbc\x9a\x87"]
- ].should be_computed_by(:pack, pack_format())
- end
- end
-end
-
-describe :array_pack_32bit_be_platform, shared: true do
- it "encodes the least significant 32 bits of a number" do
- [ [[0x7865_4321], "\x78\x65\x43\x21"],
- [[-0x7865_4321], "\x87\x9a\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format(2))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0x1243_6578, 0xdef0_abcd, 0x7865_4321].pack(pack_format('*'))
- str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd\x78\x65\x43\x21"
- end
-
- platform_is wordsize: 64 do
- it "encodes the least significant 32 bits of a number that is greater than 32 bits" do
- [ [[0xff_7865_4321], "\x78\x65\x43\x21"],
- [[-0xff_7865_4321], "\x87\x9a\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
- end
-end
-
-describe :array_pack_64bit_le, shared: true do
- it "encodes the least significant 64 bits of a positive number" do
- [ [[0x0000_0000_0000_0021], "\x21\x00\x00\x00\x00\x00\x00\x00"],
- [[0x0000_0000_0000_4321], "\x21\x43\x00\x00\x00\x00\x00\x00"],
- [[0x0000_0000_0065_4321], "\x21\x43\x65\x00\x00\x00\x00\x00"],
- [[0x0000_0000_7865_4321], "\x21\x43\x65\x78\x00\x00\x00\x00"],
- [[0x0000_0090_7865_4321], "\x21\x43\x65\x78\x90\x00\x00\x00"],
- [[0x0000_ba90_7865_4321], "\x21\x43\x65\x78\x90\xba\x00\x00"],
- [[0x00dc_ba90_7865_4321], "\x21\x43\x65\x78\x90\xba\xdc\x00"],
- [[0x7edc_ba90_7865_4321], "\x21\x43\x65\x78\x90\xba\xdc\x7e"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 64 bits of a negative number" do
- [ [[-0x0000_0000_0000_0021], "\xdf\xff\xff\xff\xff\xff\xff\xff"],
- [[-0x0000_0000_0000_4321], "\xdf\xbc\xff\xff\xff\xff\xff\xff"],
- [[-0x0000_0000_0065_4321], "\xdf\xbc\x9a\xff\xff\xff\xff\xff"],
- [[-0x0000_0000_7865_4321], "\xdf\xbc\x9a\x87\xff\xff\xff\xff"],
- [[-0x0000_0090_7865_4321], "\xdf\xbc\x9a\x87\x6f\xff\xff\xff"],
- [[-0x0000_ba90_7865_4321], "\xdf\xbc\x9a\x87\x6f\x45\xff\xff"],
- [[-0x00dc_ba90_7865_4321], "\xdf\xbc\x9a\x87\x6f\x45\x23\xff"],
- [[-0x7edc_ba90_7865_4321], "\xdf\xbc\x9a\x87\x6f\x45\x23\x81"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[9.14138647331322368e+18], "\x00\x44\x65\x78\x90\xba\xdc\x7e"],
- [[-9.14138647331322368e+18], "\x00\xbc\x9a\x87\x6f\x45\x23\x81"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678_90ab_cdef)
- [obj].pack(pack_format()).should == "\xef\xcd\xab\x90\x78\x56\x34\x12"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1234_5678_90ab_cdef,
- 0xdef0_abcd_3412_7856,
- 0x7865_4321_dcba_def0].pack(pack_format(2))
- str.should == "\xef\xcd\xab\x90\x78\x56\x34\x12\x56\x78\x12\x34\xcd\xab\xf0\xde"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format('*'))
- str.should == "\x56\x78\x12\x34\xcd\xab\xf0\xde\xf0\xde\xba\xdc\x21\x43\x65\x78"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
- str.should == "\x56\x78\x12\x34\xcd\xab\xf0\xde\xf0\xde\xba\xdc\x21\x43\x65\x78"
- end
-
- it "ignores spaces between directives" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format(' ', 2))
- str.should == "\x56\x78\x12\x34\xcd\xab\xf0\xde\xf0\xde\xba\xdc\x21\x43\x65\x78"
- end
-end
-
-describe :array_pack_64bit_be, shared: true do
- it "encodes the least significant 64 bits of a positive number" do
- [ [[0x0000_0000_0000_0021], "\x00\x00\x00\x00\x00\x00\x00\x21"],
- [[0x0000_0000_0000_4321], "\x00\x00\x00\x00\x00\x00\x43\x21"],
- [[0x0000_0000_0065_4321], "\x00\x00\x00\x00\x00\x65\x43\x21"],
- [[0x0000_0000_7865_4321], "\x00\x00\x00\x00\x78\x65\x43\x21"],
- [[0x0000_0090_7865_4321], "\x00\x00\x00\x90\x78\x65\x43\x21"],
- [[0x0000_ba90_7865_4321], "\x00\x00\xba\x90\x78\x65\x43\x21"],
- [[0x00dc_ba90_7865_4321], "\x00\xdc\xba\x90\x78\x65\x43\x21"],
- [[0x7edc_ba90_7865_4321], "\x7e\xdc\xba\x90\x78\x65\x43\x21"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes the least significant 64 bits of a negative number" do
- [ [[-0x0000_0000_0000_0021], "\xff\xff\xff\xff\xff\xff\xff\xdf"],
- [[-0x0000_0000_0000_4321], "\xff\xff\xff\xff\xff\xff\xbc\xdf"],
- [[-0x0000_0000_0065_4321], "\xff\xff\xff\xff\xff\x9a\xbc\xdf"],
- [[-0x0000_0000_7865_4321], "\xff\xff\xff\xff\x87\x9a\xbc\xdf"],
- [[-0x0000_0090_7865_4321], "\xff\xff\xff\x6f\x87\x9a\xbc\xdf"],
- [[-0x0000_ba90_7865_4321], "\xff\xff\x45\x6f\x87\x9a\xbc\xdf"],
- [[-0x00dc_ba90_7865_4321], "\xff\x23\x45\x6f\x87\x9a\xbc\xdf"],
- [[-0x7edc_ba90_7865_4321], "\x81\x23\x45\x6f\x87\x9a\xbc\xdf"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "encodes a Float truncated as an Integer" do
- [ [[9.14138647331322368e+18], "\x7e\xdc\xba\x90\x78\x65\x44\x00"],
- [[-9.14138647331322368e+18], "\x81\x23\x45\x6f\x87\x9a\xbc\x00"]
- ].should be_computed_by(:pack, pack_format())
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(0x1234_5678_90ab_cdef)
- [obj].pack(pack_format()).should == "\x12\x34\x56\x78\x90\xab\xcd\xef"
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- str = [0x1234_5678_90ab_cdef,
- 0xdef0_abcd_3412_7856,
- 0x7865_4321_dcba_def0].pack(pack_format(2))
- str.should == "\x12\x34\x56\x78\x90\xab\xcd\xef\xde\xf0\xab\xcd\x34\x12\x78\x56"
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format('*'))
- str.should == "\xde\xf0\xab\xcd\x34\x12\x78\x56\x78\x65\x43\x21\xdc\xba\xde\xf0"
- end
-
- it "ignores NULL bytes between directives" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
- str.should == "\xde\xf0\xab\xcd\x34\x12\x78\x56\x78\x65\x43\x21\xdc\xba\xde\xf0"
- end
-
- it "ignores spaces between directives" do
- str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format(' ', 2))
- str.should == "\xde\xf0\xab\xcd\x34\x12\x78\x56\x78\x65\x43\x21\xdc\xba\xde\xf0"
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/numeric_basic.rb b/spec/ruby/core/array/pack/shared/numeric_basic.rb
deleted file mode 100644
index 9224d6080e..0000000000
--- a/spec/ruby/core/array/pack/shared/numeric_basic.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-describe :array_pack_numeric_basic, shared: true do
- it "returns an empty String if count is zero" do
- [1].pack(pack_format(0)).should == ""
- end
-
- it "raises a TypeError when passed nil" do
- lambda { [nil].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed true" do
- lambda { [true].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed false" do
- lambda { [false].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "returns an ASCII-8BIT string" do
- [0xFF].pack(pack_format).encoding.should == Encoding::ASCII_8BIT
- [0xE3, 0x81, 0x82].pack(pack_format(3)).encoding.should == Encoding::ASCII_8BIT
- end
-end
-
-describe :array_pack_integer, shared: true do
- it "raises a TypeError when the object does not respond to #to_int" do
- obj = mock('not an integer')
- lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed a String" do
- lambda { ["5"].pack(pack_format) }.should raise_error(TypeError)
- end
-end
-
-describe :array_pack_float, shared: true do
- it "raises a TypeError if a String does not represent a floating point number" do
- lambda { ["a"].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when the object does not respond to #to_f" do
- obj = mock('not an float')
- lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/string.rb b/spec/ruby/core/array/pack/shared/string.rb
deleted file mode 100644
index cedb0886e2..0000000000
--- a/spec/ruby/core/array/pack/shared/string.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- encoding: binary -*-
-describe :array_pack_string, shared: true do
- it "adds count bytes of a String to the output" do
- ["abc"].pack(pack_format(2)).should == "ab"
- end
-
- it "implicitly has a count of one when no count is specified" do
- ["abc"].pack(pack_format).should == "a"
- end
-
- it "does not add any bytes when the count is zero" do
- ["abc"].pack(pack_format(0)).should == ""
- end
-
- it "is not affected by a previous count modifier" do
- ["abcde", "defg"].pack(pack_format(3)+pack_format).should == "abcd"
- end
-
- it "raises an ArgumentError when the Array is empty" do
- lambda { [].pack(pack_format) }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError when the Array has too few elements" do
- lambda { ["a"].pack(pack_format(nil, 2)) }.should raise_error(ArgumentError)
- end
-
- it "calls #to_str to convert the element to a String" do
- obj = mock('pack string')
- obj.should_receive(:to_str).and_return("abc")
-
- [obj].pack(pack_format).should == "a"
- end
-
- it "raises a TypeError when the object does not respond to #to_str" do
- obj = mock("not a string")
- lambda { [obj].pack(pack_format) }.should raise_error(TypeError)
- end
-
- it "returns a tainted string when a pack argument is tainted" do
- ["abcd".taint, 0x20].pack(pack_format("3C")).tainted?.should be_true
- end
-
- it "does not return a tainted string when the array is tainted" do
- ["abcd", 0x20].taint.pack(pack_format("3C")).tainted?.should be_false
- end
-
- it "returns a tainted string when the format is tainted" do
- ["abcd", 0x20].pack(pack_format("3C").taint).tainted?.should be_true
- end
-
- it "returns a tainted string when an empty format is tainted" do
- ["abcd", 0x20].pack("".taint).tainted?.should be_true
- end
-
- it "returns a untrusted string when the format is untrusted" do
- ["abcd", 0x20].pack(pack_format("3C").untrust).untrusted?.should be_true
- end
-
- it "returns a untrusted string when the empty format is untrusted" do
- ["abcd", 0x20].pack("".untrust).untrusted?.should be_true
- end
-
- it "returns a untrusted string when a pack argument is untrusted" do
- ["abcd".untrust, 0x20].pack(pack_format("3C")).untrusted?.should be_true
- end
-
- it "returns a trusted string when the array is untrusted" do
- ["abcd", 0x20].untrust.pack(pack_format("3C")).untrusted?.should be_false
- end
-
- it "returns a string in encoding of common to the concatenated results" do
- f = pack_format("*")
- [ [["\u{3042 3044 3046 3048}", 0x2000B].pack(f+"U"), Encoding::ASCII_8BIT],
- [["abcde\xd1", "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::ASCII_8BIT],
- [["a".force_encoding("ascii"), "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::ASCII_8BIT],
- # under discussion [ruby-dev:37294]
- [["\u{3042 3044 3046 3048}", 1].pack(f+"N"), Encoding::ASCII_8BIT]
- ].should be_computed_by(:encoding)
- end
-end
diff --git a/spec/ruby/core/array/pack/shared/unicode.rb b/spec/ruby/core/array/pack/shared/unicode.rb
deleted file mode 100644
index e16110c491..0000000000
--- a/spec/ruby/core/array/pack/shared/unicode.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-describe :array_pack_unicode, shared: true do
- it "encodes ASCII values as a Unicode codepoint" do
- [ [[0], "\x00"],
- [[1], "\x01"],
- [[8], "\x08"],
- [[15], "\x0f"],
- [[24], "\x18"],
- [[31], "\x1f"],
- [[127], "\x7f"],
- [[128], "\xc2\x80"],
- [[129], "\xc2\x81"],
- [[255], "\xc3\xbf"]
- ].should be_computed_by(:pack, "U")
- end
-
- it "encodes UTF-8 BMP codepoints" do
- [ [[0x80], "\xc2\x80"],
- [[0x7ff], "\xdf\xbf"],
- [[0x800], "\xe0\xa0\x80"],
- [[0xffff], "\xef\xbf\xbf"]
- ].should be_computed_by(:pack, "U")
- end
-
- it "constructs strings with valid encodings" do
- str = [0x85].pack("U*")
- str.should == "\xc2\x85"
- str.valid_encoding?.should be_true
- end
-
- it "encodes values larger than UTF-8 max codepoints" do
- [
- [[0x00110000], [244, 144, 128, 128].pack('C*').force_encoding('utf-8')],
- [[0x04000000], [252, 132, 128, 128, 128, 128].pack('C*').force_encoding('utf-8')],
- [[0x7FFFFFFF], [253, 191, 191, 191, 191, 191].pack('C*').force_encoding('utf-8')]
- ].should be_computed_by(:pack, "U")
- end
-
- it "encodes UTF-8 max codepoints" do
- [ [[0x10000], "\xf0\x90\x80\x80"],
- [[0xfffff], "\xf3\xbf\xbf\xbf"],
- [[0x100000], "\xf4\x80\x80\x80"],
- [[0x10ffff], "\xf4\x8f\xbf\xbf"]
- ].should be_computed_by(:pack, "U")
- end
-
- it "encodes the number of array elements specified by the count modifier" do
- [ [[0x41, 0x42, 0x43, 0x44], "U2", "\x41\x42"],
- [[0x41, 0x42, 0x43, 0x44], "U2U", "\x41\x42\x43"]
- ].should be_computed_by(:pack)
- end
-
- it "encodes all remaining elements when passed the '*' modifier" do
- [0x41, 0x42, 0x43, 0x44].pack("U*").should == "\x41\x42\x43\x44"
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(5)
- [obj].pack("U").should == "\x05"
- end
-
- it "raises a TypeError if #to_int does not return an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return("5")
- lambda { [obj].pack("U") }.should raise_error(TypeError)
- end
-
- it "ignores NULL bytes between directives" do
- [1, 2, 3].pack("U\x00U").should == "\x01\x02"
- end
-
- it "ignores spaces between directives" do
- [1, 2, 3].pack("U U").should == "\x01\x02"
- end
-
- it "raises a RangeError if passed a negative number" do
- lambda { [-1].pack("U") }.should raise_error(RangeError)
- end
-
- it "raises a RangeError if passed a number larger than an unsigned 32-bit integer" do
- lambda { [2**32].pack("U") }.should raise_error(RangeError)
- end
-
- it "sets the output string to UTF-8 encoding" do
- [ [[0x00].pack("U"), Encoding::UTF_8],
- [[0x41].pack("U"), Encoding::UTF_8],
- [[0x7F].pack("U"), Encoding::UTF_8],
- [[0x80].pack("U"), Encoding::UTF_8],
- [[0x10FFFF].pack("U"), Encoding::UTF_8]
- ].should be_computed_by(:encoding)
- end
-end
diff --git a/spec/ruby/core/array/pack/u_spec.rb b/spec/ruby/core/array/pack/u_spec.rb
deleted file mode 100644
index 0bc78fcb88..0000000000
--- a/spec/ruby/core/array/pack/u_spec.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/unicode', __FILE__)
-
-describe "Array#pack with format 'U'" do
- it_behaves_like :array_pack_basic, 'U'
- it_behaves_like :array_pack_basic_non_float, 'U'
- it_behaves_like :array_pack_arguments, 'U'
- it_behaves_like :array_pack_unicode, 'U'
-end
-
-describe "Array#pack with format 'u'" do
- it_behaves_like :array_pack_basic, 'u'
- it_behaves_like :array_pack_basic_non_float, 'u'
- it_behaves_like :array_pack_arguments, 'u'
-
- it "encodes an empty string as an empty string" do
- [""].pack("u").should == ""
- end
-
- it "appends a newline to the end of the encoded string" do
- ["a"].pack("u").should == "!80``\n"
- end
-
- it "encodes one element per directive" do
- ["abc", "DEF"].pack("uu").should == "#86)C\n#1$5&\n"
- end
-
- it "prepends the length of each segment of the input string as the first character (+32) in each line of the output" do
- ["abcdefghijklm"].pack("u7").should == "&86)C9&5F\n&9VAI:FML\n!;0``\n"
- end
-
- it "encodes 1, 2, or 3 characters in 4 output characters (uuencoding)" do
- [ [["a"], "!80``\n"],
- [["ab"], "\"86(`\n"],
- [["abc"], "#86)C\n"],
- [["abcd"], "$86)C9```\n"],
- [["abcde"], "%86)C9&4`\n"],
- [["abcdef"], "&86)C9&5F\n"],
- [["abcdefg"], "'86)C9&5F9P``\n"],
- ].should be_computed_by(:pack, "u")
- end
-
- it "emits a newline after complete groups of count / 3 input characters when passed a count modifier" do
- ["abcdefg"].pack("u3").should == "#86)C\n#9&5F\n!9P``\n"
- end
-
- it "implicitly has a count of 45 when passed '*', 0, 1, 2 or no count modifier" do
- s = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- r = "M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A\n%86%A86$`\n"
- [ [[s], "u", r],
- [[s], "u*", r],
- [[s], "u0", r],
- [[s], "u1", r],
- [[s], "u2", r],
- ].should be_computed_by(:pack)
- end
-
- it "encodes all ascii characters" do
- [ [["\x00\x01\x02\x03\x04\x05\x06"], "'``$\"`P0%!@``\n"],
- [["\a\b\t\n\v\f\r"], "'!P@)\"@L,#0``\n"],
- [["\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"], ")\#@\\0$1(3%!46\n"],
- [["\x17\x18\x19\x1a\e\x1c\x1d\x1e\x1f"], ")%Q@9&AL<'1X?\n"],
- [["!\"\#$%&'()*+,-./"], "/(2(C)\"4F)R@I*BLL+2XO\n"],
- [["0123456789"], "*,\#$R,S0U-C<X.0``\n"],
- [[":;<=>?@"], "'.CL\\/3X_0```\n"],
- [["ABCDEFGHIJKLMNOPQRSTUVWXYZ"], ":04)#1$5&1TA)2DM,34Y/4%%24U155E=865H`\n"],
- [["[\\]^_`"], "&6UQ=7E]@\n"],
- [["abcdefghijklmnopqrstuvwxyz"], ":86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7H`\n"],
- [["{|}~"], "$>WQ]?@``\n"],
- [["\x7f\xc2\x80\xc2\x81\xc2\x82\xc2\x83"], ")?\\*`PH'\"@L*#\n"],
- [["\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2"], ")PH3\"A<*&PH?\"\n"],
- [["\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c"], ")B,*)PHK\"B\\*,\n"],
- [["\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2"], ")PHW\"CL*/PI#\"\n"],
- [["\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95"], ")D<*2PI/\"E,*5\n"],
- [["\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2"], ")PI;\"E\\*8PIG\"\n"],
- [["\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e"], ")FL*;PIS\"G<*>\n"],
- [["\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2"], ")PI_\"H,*APJ+\"\n"],
- [["\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7"], ")H\\*DPJ7\"IL*G\n"],
- [["\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2"], ")PJC\"J<*JPJO\"\n"],
- [["\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0"], ")K,*MPJ[\"K\\*P\n"],
- [["\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2"], ")PK'\"LL*SPK3\"\n"],
- [["\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9"], ")M<*VPK?\"N,*Y\n"],
- [["\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2"], ")PKK\"N\\*\\PKW\"\n"],
- [["\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82"], ")OL*_PX#\#@<.\"\n"],
- [["\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3"], ")PX/#A,.%PX;#\n"],
- [["\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b"], ")A\\.(PXG#BL.+\n"],
- [["\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3"], ")PXS#C<..PX_#\n"],
- [["\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94"], ")D,.1PY+#D\\.4\n"],
- [["\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3"], ")PY7#EL.7PYC#\n"],
- [["\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d"], ")F<.:PYO#G,.=\n"],
- [["\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3"], ")PY[#G\\.@PZ'#\n"],
- [["\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6"], ")HL.CPZ3#I<.F\n"],
- [["\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3"], ")PZ?#J,.IPZK#\n"],
- [["\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf"], ")J\\.LPZW#KL.O\n"],
- [["\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3"], ")P[##L<.RP[/#\n"],
- [["\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8"], ")M,.UP[;#M\\.X\n"],
- [["\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3"], ")P[G#NL.[P[S#\n"],
- [["\xbd\xc3\xbe\xc3\xbf"], "%O<.^P[\\`\n"]
- ].should be_computed_by(:pack, "u")
- end
-
- it "calls #to_str to convert an object to a String" do
- obj = mock("pack m string")
- obj.should_receive(:to_str).and_return("abc")
- [obj].pack("u").should == "#86)C\n"
- end
-
- it "raises a TypeError if #to_str does not return a String" do
- obj = mock("pack m non-string")
- lambda { [obj].pack("u") }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed nil" do
- lambda { [nil].pack("u") }.should raise_error(TypeError)
- end
-
- it "raises a TypeError if passed an Integer" do
- lambda { [0].pack("u") }.should raise_error(TypeError)
- lambda { [bignum_value].pack("u") }.should raise_error(TypeError)
- end
-
- it "sets the output string to US-ASCII encoding" do
- ["abcd"].pack("u").encoding.should == Encoding::US_ASCII
- end
-end
diff --git a/spec/ruby/core/array/pack/v_spec.rb b/spec/ruby/core/array/pack/v_spec.rb
deleted file mode 100644
index 8ebb863686..0000000000
--- a/spec/ruby/core/array/pack/v_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-require File.expand_path('../shared/integer', __FILE__)
-
-describe "Array#pack with format 'V'" do
- it_behaves_like :array_pack_basic, 'V'
- it_behaves_like :array_pack_basic_non_float, 'V'
- it_behaves_like :array_pack_arguments, 'V'
- it_behaves_like :array_pack_numeric_basic, 'V'
- it_behaves_like :array_pack_integer, 'V'
- it_behaves_like :array_pack_no_platform, 'V'
- it_behaves_like :array_pack_32bit_le, 'V'
-end
-
-describe "Array#pack with format 'v'" do
- it_behaves_like :array_pack_basic, 'v'
- it_behaves_like :array_pack_basic_non_float, 'v'
- it_behaves_like :array_pack_arguments, 'v'
- it_behaves_like :array_pack_numeric_basic, 'v'
- it_behaves_like :array_pack_integer, 'v'
- it_behaves_like :array_pack_no_platform, 'v'
- it_behaves_like :array_pack_16bit_le, 'v'
-end
diff --git a/spec/ruby/core/array/pack/w_spec.rb b/spec/ruby/core/array/pack/w_spec.rb
deleted file mode 100644
index 9ada3e84cb..0000000000
--- a/spec/ruby/core/array/pack/w_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/numeric_basic', __FILE__)
-
-describe "Array#pack with format 'w'" do
- it_behaves_like :array_pack_basic, 'w'
- it_behaves_like :array_pack_basic_non_float, 'w'
- it_behaves_like :array_pack_arguments, 'w'
- it_behaves_like :array_pack_numeric_basic, 'w'
-
- it "encodes a BER-compressed integer" do
- [ [[0], "\x00"],
- [[1], "\x01"],
- [[9999], "\xce\x0f"],
- [[2**65], "\x84\x80\x80\x80\x80\x80\x80\x80\x80\x00"]
- ].should be_computed_by(:pack, "w")
- end
-
- it "calls #to_int to convert the pack argument to an Integer" do
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(5)
- [obj].pack("w").should == "\x05"
- end
-
- it "ignores NULL bytes between directives" do
- [1, 2, 3].pack("w\x00w").should == "\x01\x02"
- end
-
- it "ignores spaces between directives" do
- [1, 2, 3].pack("w w").should == "\x01\x02"
- end
-
- it "raises an ArgumentError when passed a negative value" do
- lambda { [-1].pack("w") }.should raise_error(ArgumentError)
- end
-
- it "returns an ASCII-8BIT string" do
- [1].pack('w').encoding.should == Encoding::ASCII_8BIT
- end
-end
diff --git a/spec/ruby/core/array/pack/x_spec.rb b/spec/ruby/core/array/pack/x_spec.rb
deleted file mode 100644
index 8d54ab84ee..0000000000
--- a/spec/ruby/core/array/pack/x_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-
-describe "Array#pack with format 'x'" do
- it_behaves_like :array_pack_basic, 'x'
- it_behaves_like :array_pack_basic_non_float, 'x'
- it_behaves_like :array_pack_no_platform, 'x'
-
- it "adds a NULL byte with an empty array" do
- [].pack("x").should == "\x00"
- end
-
- it "adds a NULL byte without consuming an element" do
- [1, 2].pack("CxC").should == "\x01\x00\x02"
- end
-
- it "is not affected by a previous count modifier" do
- [].pack("x3x").should == "\x00\x00\x00\x00"
- end
-
- it "adds multiple NULL bytes when passed a count modifier" do
- [].pack("x3").should == "\x00\x00\x00"
- end
-
- it "does not add a NULL byte if the count modifier is zero" do
- [].pack("x0").should == ""
- end
-
- it "does not add a NULL byte when passed the '*' modifier" do
- [].pack("x*").should == ""
- end
-end
-
-describe "Array#pack with format 'X'" do
- it_behaves_like :array_pack_basic, 'X'
- it_behaves_like :array_pack_basic_non_float, 'X'
- it_behaves_like :array_pack_no_platform, 'X'
-
- it "reduces the output string by one byte at the point it is encountered" do
- [1, 2, 3].pack("C2XC").should == "\x01\x03"
- end
-
- it "does not consume any elements" do
- [1, 2, 3].pack("CXC").should == "\x02"
- end
-
- it "reduces the output string by multiple bytes when passed a count modifier" do
- [1, 2, 3, 4, 5].pack("C2X2C").should == "\x03"
- end
-
- it "has no affect when passed the '*' modifier" do
- [1, 2, 3].pack("C2X*C").should == "\x01\x02\x03"
- end
-
- it "raises an ArgumentError if the output string is empty" do
- lambda { [1, 2, 3].pack("XC") }.should raise_error(ArgumentError)
- end
-
- it "raises an ArgumentError if the count modifier is greater than the bytes in the string" do
- lambda { [1, 2, 3].pack("C2X3") }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/pack/z_spec.rb b/spec/ruby/core/array/pack/z_spec.rb
deleted file mode 100644
index b28a460a8e..0000000000
--- a/spec/ruby/core/array/pack/z_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- encoding: ascii-8bit -*-
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../shared/basic', __FILE__)
-require File.expand_path('../shared/string', __FILE__)
-
-describe "Array#pack with format 'Z'" do
- it_behaves_like :array_pack_basic, 'Z'
- it_behaves_like :array_pack_basic_non_float, 'Z'
- it_behaves_like :array_pack_no_platform, 'Z'
- it_behaves_like :array_pack_string, 'Z'
-
- it "adds all the bytes and appends a NULL byte when passed the '*' modifier" do
- ["abc"].pack("Z*").should == "abc\x00"
- end
-
- it "padds the output with NULL bytes when the count exceeds the size of the String" do
- ["abc"].pack("Z6").should == "abc\x00\x00\x00"
- end
-
- it "adds a NULL byte when the value is nil" do
- [nil].pack("Z").should == "\x00"
- end
-
- it "pads the output with NULL bytes when the value is nil" do
- [nil].pack("Z3").should == "\x00\x00\x00"
- end
-
- it "does not append a NULL byte when passed the '*' modifier and the value is nil" do
- [nil].pack("Z*").should == "\x00"
- end
-end
diff --git a/spec/ruby/core/array/partition_spec.rb b/spec/ruby/core/array/partition_spec.rb
deleted file mode 100644
index 787b574c28..0000000000
--- a/spec/ruby/core/array/partition_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#partition" do
- it "returns two arrays" do
- [].partition {}.should == [[], []]
- end
-
- it "returns in the left array values for which the block evaluates to true" do
- ary = [0, 1, 2, 3, 4, 5]
-
- ary.partition { |i| true }.should == [ary, []]
- ary.partition { |i| 5 }.should == [ary, []]
- ary.partition { |i| false }.should == [[], ary]
- ary.partition { |i| nil }.should == [[], ary]
- ary.partition { |i| i % 2 == 0 }.should == [[0, 2, 4], [1, 3, 5]]
- ary.partition { |i| i / 3 == 0 }.should == [[0, 1, 2], [3, 4, 5]]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.partition { true }.should == [[empty], []]
- empty.partition { false }.should == [[], [empty]]
-
- array = ArraySpecs.recursive_array
- array.partition { true }.should == [
- [1, 'two', 3.0, array, array, array, array, array],
- []
- ]
- condition = true
- array.partition { condition = !condition }.should == [
- ['two', array, array, array],
- [1, 3.0, array, array]
- ]
- end
-
- it "does not return subclass instances on Array subclasses" do
- result = ArraySpecs::MyArray[1, 2, 3].partition { |x| x % 2 == 0 }
- result.should be_an_instance_of(Array)
- result[0].should be_an_instance_of(Array)
- result[1].should be_an_instance_of(Array)
- end
-end
diff --git a/spec/ruby/core/array/permutation_spec.rb b/spec/ruby/core/array/permutation_spec.rb
deleted file mode 100644
index c0eba57a3e..0000000000
--- a/spec/ruby/core/array/permutation_spec.rb
+++ /dev/null
@@ -1,138 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-
-describe "Array#permutation" do
-
- before :each do
- @numbers = (1..3).to_a
- @yielded = []
- end
-
- it "returns an Enumerator of all permutations when called without a block or arguments" do
- enum = @numbers.permutation
- enum.should be_an_instance_of(Enumerator)
- enum.to_a.sort.should == [
- [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]
- ].sort
- end
-
- it "returns an Enumerator of permutations of given length when called with an argument but no block" do
- enum = @numbers.permutation(1)
- enum.should be_an_instance_of(Enumerator)
- enum.to_a.sort.should == [[1],[2],[3]]
- end
-
- it "yields all permutations to the block then returns self when called with block but no arguments" do
- array = @numbers.permutation {|n| @yielded << n}
- array.should be_an_instance_of(Array)
- array.sort.should == @numbers.sort
- @yielded.sort.should == [
- [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]
- ].sort
- end
-
- it "yields all permutations of given length to the block then returns self when called with block and argument" do
- array = @numbers.permutation(2) {|n| @yielded << n}
- array.should be_an_instance_of(Array)
- array.sort.should == @numbers.sort
- @yielded.sort.should == [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]].sort
- end
-
- it "returns the empty permutation ([[]]) when the given length is 0" do
- @numbers.permutation(0).to_a.should == [[]]
- @numbers.permutation(0) { |n| @yielded << n }
- @yielded.should == [[]]
- end
-
- it "returns the empty permutation([]) when called on an empty Array" do
- [].permutation.to_a.should == [[]]
- [].permutation { |n| @yielded << n }
- @yielded.should == [[]]
- end
-
- it "returns no permutations when the given length has no permutations" do
- @numbers.permutation(9).entries.size.should == 0
- @numbers.permutation(9) { |n| @yielded << n }
- @yielded.should == []
- end
-
- it "handles duplicate elements correctly" do
- @numbers << 1
- @numbers.permutation(2).sort.should == [
- [1,1],[1,1],[1,2],[1,2],[1,3],[1,3],
- [2,1],[2,1],[2,3],
- [3,1],[3,1],[3,2]
- ].sort
- end
-
- it "handles nested Arrays correctly" do
- # The ugliness is due to the order of permutations returned by
- # permutation being undefined combined with #sort croaking on Arrays of
- # Arrays.
- @numbers << [4,5]
- got = @numbers.permutation(2).to_a
- expected = [
- [1, 2], [1, 3], [1, [4, 5]],
- [2, 1], [2, 3], [2, [4, 5]],
- [3, 1], [3, 2], [3, [4, 5]],
- [[4, 5], 1], [[4, 5], 2], [[4, 5], 3]
- ]
- expected.each {|e| got.include?(e).should be_true}
- got.size.should == expected.size
- end
-
- it "truncates Float arguments" do
- @numbers.permutation(3.7).to_a.sort.should ==
- @numbers.permutation(3).to_a.sort
- end
-
- it "returns an Enumerator which works as expected even when the array was modified" do
- @numbers = [1, 2]
- enum = @numbers.permutation
- @numbers << 3
- enum.to_a.sort.should == [
- [1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]
- ].sort
- end
-
- it "generates from a defensive copy, ignoring mutations" do
- accum = []
- ary = [1,2,3]
- ary.permutation(3) do |x|
- accum << x
- ary[0] = 5
- end
-
- accum.should == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
- end
-
- describe "when no block is given" do
- describe "returned Enumerator" do
- describe "size" do
- describe "with an array size greater than 0" do
- it "returns the descending factorial of array size and given length" do
- @numbers.permutation(4).size.should == 0
- @numbers.permutation(3).size.should == 6
- @numbers.permutation(2).size.should == 6
- @numbers.permutation(1).size.should == 3
- @numbers.permutation(0).size.should == 1
- end
- it "returns the descending factorial of array size with array size when there's no param" do
- @numbers.permutation.size.should == 6
- [1,2,3,4].permutation.size.should == 24
- [1].permutation.size.should == 1
- end
- end
- describe "with an empty array" do
- it "returns 1 when the given length is 0" do
- [].permutation(0).size.should == 1
- end
- it "returns 1 when there's param" do
- [].permutation.size.should == 1
- end
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/plus_spec.rb b/spec/ruby/core/array/plus_spec.rb
deleted file mode 100644
index 4517087550..0000000000
--- a/spec/ruby/core/array/plus_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#+" do
- it "concatenates two arrays" do
- ([ 1, 2, 3 ] + [ 3, 4, 5 ]).should == [1, 2, 3, 3, 4, 5]
- ([ 1, 2, 3 ] + []).should == [1, 2, 3]
- ([] + [ 1, 2, 3 ]).should == [1, 2, 3]
- ([] + []).should == []
- end
-
- it "can concatenate an array with itself" do
- ary = [1, 2, 3]
- (ary + ary).should == [1, 2, 3, 1, 2, 3]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('["x", "y"]')
- obj.should_receive(:to_ary).and_return(["x", "y"])
- ([1, 2, 3] + obj).should == [1, 2, 3, "x", "y"]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty + empty).should == [empty, empty]
-
- array = ArraySpecs.recursive_array
- (empty + array).should == [empty, 1, 'two', 3.0, array, array, array, array, array]
- (array + array).should == [
- 1, 'two', 3.0, array, array, array, array, array,
- 1, 'two', 3.0, array, array, array, array, array]
- end
-
- it "does return subclass instances with Array subclasses" do
- (ArraySpecs::MyArray[1, 2, 3] + []).should be_an_instance_of(Array)
- (ArraySpecs::MyArray[1, 2, 3] + ArraySpecs::MyArray[]).should be_an_instance_of(Array)
- ([1, 2, 3] + ArraySpecs::MyArray[]).should be_an_instance_of(Array)
- end
-
- it "does not call to_ary on array subclasses" do
- ([5, 6] + ArraySpecs::ToAryArray[1, 2]).should == [5, 6, 1, 2]
- end
-
- it "does not get infected even if an original array is tainted" do
- ([1, 2] + [3, 4]).tainted?.should be_false
- ([1, 2].taint + [3, 4]).tainted?.should be_false
- ([1, 2] + [3, 4].taint).tainted?.should be_false
- ([1, 2].taint + [3, 4].taint).tainted?.should be_false
- end
-
- it "does not infected even if an original array is untrusted" do
- ([1, 2] + [3, 4]).untrusted?.should be_false
- ([1, 2].untrust + [3, 4]).untrusted?.should be_false
- ([1, 2] + [3, 4].untrust).untrusted?.should be_false
- ([1, 2].untrust + [3, 4].untrust).untrusted?.should be_false
- end
-end
diff --git a/spec/ruby/core/array/pop_spec.rb b/spec/ruby/core/array/pop_spec.rb
deleted file mode 100644
index ea649c6585..0000000000
--- a/spec/ruby/core/array/pop_spec.rb
+++ /dev/null
@@ -1,168 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#pop" do
- it "removes and returns the last element of the array" do
- a = ["a", 1, nil, true]
-
- a.pop.should == true
- a.should == ["a", 1, nil]
-
- a.pop.should == nil
- a.should == ["a", 1]
-
- a.pop.should == 1
- a.should == ["a"]
-
- a.pop.should == "a"
- a.should == []
- end
-
- it "returns nil if there are no more elements" do
- [].pop.should == nil
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.pop.should == []
-
- array = ArraySpecs.recursive_array
- array.pop.should == [1, 'two', 3.0, array, array, array, array]
- end
-
- it "keeps taint status" do
- a = [1, 2].taint
- a.pop
- a.tainted?.should be_true
- a.pop
- a.tainted?.should be_true
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.pop }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.pop }.should raise_error(RuntimeError)
- end
-
- it "keeps untrusted status" do
- a = [1, 2].untrust
- a.pop
- a.untrusted?.should be_true
- a.pop
- a.untrusted?.should be_true
- end
-
- describe "passed a number n as an argument" do
- it "removes and returns an array with the last n elements of the array" do
- a = [1, 2, 3, 4, 5, 6]
-
- a.pop(0).should == []
- a.should == [1, 2, 3, 4, 5, 6]
-
- a.pop(1).should == [6]
- a.should == [1, 2, 3, 4, 5]
-
- a.pop(2).should == [4, 5]
- a.should == [1, 2, 3]
-
- a.pop(3).should == [1, 2, 3]
- a.should == []
- end
-
- it "returns an array with the last n elements even if shift was invoked" do
- a = [1, 2, 3, 4]
- a.shift
- a.pop(3).should == [2, 3, 4]
- end
-
- it "returns a new empty array if there are no more elements" do
- a = []
- popped1 = a.pop(1)
- popped1.should == []
- a.should == []
-
- popped2 = a.pop(2)
- popped2.should == []
- a.should == []
-
- popped1.should_not equal(popped2)
- end
-
- it "returns whole elements if n exceeds size of the array" do
- a = [1, 2, 3, 4, 5]
- a.pop(6).should == [1, 2, 3, 4, 5]
- a.should == []
- end
-
- it "does not return self even when it returns whole elements" do
- a = [1, 2, 3, 4, 5]
- a.pop(5).should_not equal(a)
-
- a = [1, 2, 3, 4, 5]
- a.pop(6).should_not equal(a)
- end
-
- it "raises an ArgumentError if n is negative" do
- lambda{ [1, 2, 3].pop(-1) }.should raise_error(ArgumentError)
- end
-
- it "tries to convert n to an Integer using #to_int" do
- a = [1, 2, 3, 4]
- a.pop(2.3).should == [3, 4]
-
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- a.should == [1, 2]
- a.pop(obj).should == [1, 2]
- a.should == []
- end
-
- it "raises a TypeError when the passed n cannot be coerced to Integer" do
- lambda{ [1, 2].pop("cat") }.should raise_error(TypeError)
- lambda{ [1, 2].pop(nil) }.should raise_error(TypeError)
- end
-
- it "raises an ArgumentError if more arguments are passed" do
- lambda{ [1, 2].pop(1, 2) }.should raise_error(ArgumentError)
- end
-
- it "does not return subclass instances with Array subclass" do
- ArraySpecs::MyArray[1, 2, 3].pop(2).should be_an_instance_of(Array)
- end
-
- it "returns an untainted array even if the array is tainted" do
- ary = [1, 2].taint
- ary.pop(2).tainted?.should be_false
- ary.pop(0).tainted?.should be_false
- end
-
- it "keeps taint status" do
- a = [1, 2].taint
- a.pop(2)
- a.tainted?.should be_true
- a.pop(2)
- a.tainted?.should be_true
- end
-
- it "returns a trusted array even if the array is untrusted" do
- ary = [1, 2].untrust
- ary.pop(2).untrusted?.should be_false
- ary.pop(0).untrusted?.should be_false
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.pop(2) }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.pop(0) }.should raise_error(RuntimeError)
- end
-
- it "keeps untrusted status" do
- a = [1, 2].untrust
- a.pop(2)
- a.untrusted?.should be_true
- a.pop(2)
- a.untrusted?.should be_true
- end
- end
-end
diff --git a/spec/ruby/core/array/prepend_spec.rb b/spec/ruby/core/array/prepend_spec.rb
deleted file mode 100644
index d8c6bad1a8..0000000000
--- a/spec/ruby/core/array/prepend_spec.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/unshift', __FILE__)
-
-ruby_version_is "2.5" do
- describe "Array#prepend" do
- it_behaves_like(:array_unshift, :prepend)
- end
-end
diff --git a/spec/ruby/core/array/product_spec.rb b/spec/ruby/core/array/product_spec.rb
deleted file mode 100644
index 1ab38e34be..0000000000
--- a/spec/ruby/core/array/product_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#product" do
- it "returns converted arguments using :to_ary" do
- lambda{ [1].product(2..3) }.should raise_error(TypeError)
- ar = ArraySpecs::ArrayConvertable.new(2,3)
- [1].product(ar).should == [[1,2],[1,3]]
- ar.called.should == :to_ary
- end
-
- it "returns the expected result" do
- [1,2].product([3,4,5],[6,8]).should == [[1, 3, 6], [1, 3, 8], [1, 4, 6], [1, 4, 8], [1, 5, 6], [1, 5, 8],
- [2, 3, 6], [2, 3, 8], [2, 4, 6], [2, 4, 8], [2, 5, 6], [2, 5, 8]]
- end
-
- it "has no required argument" do
- [1,2].product.should == [[1],[2]]
- end
-
- it "returns an empty array when the argument is an empty array" do
- [1, 2].product([]).should == []
- end
-
- it "does not attempt to produce an unreasonable number of products" do
- a = (0..100).to_a
- lambda do
- a.product(a, a, a, a, a, a, a, a, a, a)
- end.should raise_error(RangeError)
- end
-
- describe "when given a block" do
- it "yields all combinations in turn" do
- acc = []
- [1,2].product([3,4,5],[6,8]){|array| acc << array}
- acc.should == [[1, 3, 6], [1, 3, 8], [1, 4, 6], [1, 4, 8], [1, 5, 6], [1, 5, 8],
- [2, 3, 6], [2, 3, 8], [2, 4, 6], [2, 4, 8], [2, 5, 6], [2, 5, 8]]
-
- acc = []
- [1,2].product([3,4,5],[],[6,8]){|array| acc << array}
- acc.should be_empty
- end
-
- it "returns self" do
- a = [1, 2, 3].freeze
-
- a.product([1, 2]) { |p| p.first }.should == a
- end
-
- it "will ignore unreasonable numbers of products and yield anyway" do
- a = (0..100).to_a
- lambda do
- a.product(a, a, a, a, a, a, a, a, a, a)
- end.should raise_error(RangeError)
- end
- end
-
- describe "when given an empty block" do
- it "returns self" do
- arr = [1,2]
- arr.product([3,4,5],[6,8]){}.should equal(arr)
- arr = []
- arr.product([3,4,5],[6,8]){}.should equal(arr)
- arr = [1,2]
- arr.product([]){}.should equal(arr)
- end
- end
-end
diff --git a/spec/ruby/core/array/push_spec.rb b/spec/ruby/core/array/push_spec.rb
deleted file mode 100644
index 0207474579..0000000000
--- a/spec/ruby/core/array/push_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/push', __FILE__)
-
-describe "Array#push" do
- it_behaves_like(:array_push, :push)
-end
diff --git a/spec/ruby/core/array/rassoc_spec.rb b/spec/ruby/core/array/rassoc_spec.rb
deleted file mode 100644
index cf3daccfc9..0000000000
--- a/spec/ruby/core/array/rassoc_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#rassoc" do
- it "returns the first contained array whose second element is == object" do
- ary = [[1, "a", 0.5], [2, "b"], [3, "b"], [4, "c"], [], [5], [6, "d"]]
- ary.rassoc("a").should == [1, "a", 0.5]
- ary.rassoc("b").should == [2, "b"]
- ary.rassoc("d").should == [6, "d"]
- ary.rassoc("z").should == nil
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.rassoc([]).should be_nil
- [[empty, empty]].rassoc(empty).should == [empty, empty]
-
- array = ArraySpecs.recursive_array
- array.rassoc(array).should be_nil
- [[empty, array]].rassoc(array).should == [empty, array]
- end
-
- it "calls elem == obj on the second element of each contained array" do
- key = 'foobar'
- o = mock('foobar')
- def o.==(other); other == 'foobar'; end
-
- [[1, :foobar], [2, o], [3, mock('foo')]].rassoc(key).should == [2, o]
- end
-
- it "does not check the last element in each contained but speficically the second" do
- key = 'foobar'
- o = mock('foobar')
- def o.==(other); other == 'foobar'; end
-
- [[1, :foobar, o], [2, o, 1], [3, mock('foo')]].rassoc(key).should == [2, o, 1]
- end
-end
diff --git a/spec/ruby/core/array/reject_spec.rb b/spec/ruby/core/array/reject_spec.rb
deleted file mode 100644
index 857cbf6a4d..0000000000
--- a/spec/ruby/core/array/reject_spec.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../shared/delete_if', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#reject" do
- it "returns a new array without elements for which block is true" do
- ary = [1, 2, 3, 4, 5]
- ary.reject { true }.should == []
- ary.reject { false }.should == ary
- ary.reject { false }.object_id.should_not == ary.object_id
- ary.reject { nil }.should == ary
- ary.reject { nil }.object_id.should_not == ary.object_id
- ary.reject { 5 }.should == []
- ary.reject { |i| i < 3 }.should == [3, 4, 5]
- ary.reject { |i| i % 2 == 0 }.should == [1, 3, 5]
- end
-
- it "returns self when called on an Array emptied with #shift" do
- array = [1]
- array.shift
- array.reject { |x| true }.should == []
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.reject { false }.should == [empty]
- empty.reject { true }.should == []
-
- array = ArraySpecs.recursive_array
- array.reject { false }.should == [1, 'two', 3.0, array, array, array, array, array]
- array.reject { true }.should == []
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].reject { |x| x % 2 == 0 }.should be_an_instance_of(Array)
- end
-
- it "does not retain instance variables" do
- array = []
- array.instance_variable_set("@variable", "value")
- array.reject { false }.instance_variable_get("@variable").should == nil
- end
-
- it_behaves_like :enumeratorize, :reject
- it_behaves_like :enumeratorized_with_origin_size, :reject, [1,2,3]
-end
-
-describe "Array#reject!" do
- it "removes elements for which block is true" do
- a = [3, 4, 5, 6, 7, 8, 9, 10, 11]
- a.reject! { |i| i % 2 == 0 }.should equal(a)
- a.should == [3, 5, 7, 9, 11]
- a.reject! { |i| i > 8 }
- a.should == [3, 5, 7]
- a.reject! { |i| i < 4 }
- a.should == [5, 7]
- a.reject! { |i| i == 5 }
- a.should == [7]
- a.reject! { true }
- a.should == []
- a.reject! { true }
- a.should == []
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty_dup = empty.dup
- empty.reject! { false }.should == nil
- empty.should == empty_dup
-
- empty = ArraySpecs.empty_recursive_array
- empty.reject! { true }.should == []
- empty.should == []
-
- array = ArraySpecs.recursive_array
- array_dup = array.dup
- array.reject! { false }.should == nil
- array.should == array_dup
-
- array = ArraySpecs.recursive_array
- array.reject! { true }.should == []
- array.should == []
- end
-
- it "returns nil when called on an Array emptied with #shift" do
- array = [1]
- array.shift
- array.reject! { |x| true }.should == nil
- end
-
- it "returns nil if no changes are made" do
- a = [1, 2, 3]
-
- a.reject! { |i| i < 0 }.should == nil
-
- a.reject! { true }
- a.reject! { true }.should == nil
- end
-
- it "returns an Enumerator if no block given, and the array is frozen" do
- ArraySpecs.frozen_array.reject!.should be_an_instance_of(Enumerator)
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.reject! {} }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.reject! {} }.should raise_error(RuntimeError)
- end
-
- it_behaves_like :enumeratorize, :reject!
- it_behaves_like :enumeratorized_with_origin_size, :reject!, [1,2,3]
- it_behaves_like :delete_if, :reject!
-end
diff --git a/spec/ruby/core/array/repeated_combination_spec.rb b/spec/ruby/core/array/repeated_combination_spec.rb
deleted file mode 100644
index e79c34a520..0000000000
--- a/spec/ruby/core/array/repeated_combination_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#repeated_combination" do
- before :each do
- @array = [10, 11, 12]
- end
-
- it "returns an enumerator when no block is provided" do
- @array.repeated_combination(2).should be_an_instance_of(Enumerator)
- end
-
- it "returns self when a block is given" do
- @array.repeated_combination(2){}.should equal(@array)
- end
-
- it "yields nothing for negative length and return self" do
- @array.repeated_combination(-1){ fail }.should equal(@array)
- @array.repeated_combination(-10){ fail }.should equal(@array)
- end
-
- it "yields the expected repeated_combinations" do
- @array.repeated_combination(2).to_a.sort.should == [[10, 10], [10, 11], [10, 12], [11, 11], [11, 12], [12, 12]]
- @array.repeated_combination(3).to_a.sort.should == [[10, 10, 10], [10, 10, 11], [10, 10, 12], [10, 11, 11], [10, 11, 12],
- [10, 12, 12], [11, 11, 11], [11, 11, 12], [11, 12, 12], [12, 12, 12]]
- end
-
- it "yields [] when length is 0" do
- @array.repeated_combination(0).to_a.should == [[]] # one repeated_combination of length 0
- [].repeated_combination(0).to_a.should == [[]] # one repeated_combination of length 0
- end
-
- it "yields nothing when the array is empty and num is non zero" do
- [].repeated_combination(5).to_a.should == [] # one repeated_combination of length 0
- end
-
- it "yields a partition consisting of only singletons" do
- @array.repeated_combination(1).sort.to_a.should == [[10],[11],[12]]
- end
-
- it "accepts sizes larger than the original array" do
- @array.repeated_combination(4).to_a.sort.should ==
- [[10, 10, 10, 10], [10, 10, 10, 11], [10, 10, 10, 12],
- [10, 10, 11, 11], [10, 10, 11, 12], [10, 10, 12, 12],
- [10, 11, 11, 11], [10, 11, 11, 12], [10, 11, 12, 12],
- [10, 12, 12, 12], [11, 11, 11, 11], [11, 11, 11, 12],
- [11, 11, 12, 12], [11, 12, 12, 12], [12, 12, 12, 12]]
- end
-
- it "generates from a defensive copy, ignoring mutations" do
- accum = []
- @array.repeated_combination(2) do |x|
- accum << x
- @array[0] = 1
- end
- accum.sort.should == [[10, 10], [10, 11], [10, 12], [11, 11], [11, 12], [12, 12]]
- end
-
- describe "when no block is given" do
- describe "returned Enumerator" do
- describe "size" do
- it "returns 0 when the combination_size is < 0" do
- @array.repeated_combination(-1).size.should == 0
- [].repeated_combination(-2).size.should == 0
- end
-
- it "returns 1 when the combination_size is 0" do
- @array.repeated_combination(0).size.should == 1
- [].repeated_combination(0).size.should == 1
- end
-
- it "returns the binomial coeficient between combination_size and array size + combination_size -1" do
- @array.repeated_combination(5).size.should == 21
- @array.repeated_combination(4).size.should == 15
- @array.repeated_combination(3).size.should == 10
- @array.repeated_combination(2).size.should == 6
- @array.repeated_combination(1).size.should == 3
- @array.repeated_combination(0).size.should == 1
- [].repeated_combination(0).size.should == 1
- [].repeated_combination(1).size.should == 0
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/repeated_permutation_spec.rb b/spec/ruby/core/array/repeated_permutation_spec.rb
deleted file mode 100644
index 9038d49560..0000000000
--- a/spec/ruby/core/array/repeated_permutation_spec.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-
-describe "Array#repeated_permutation" do
-
- before :each do
- @numbers = [10, 11, 12]
- @permutations = [[10, 10], [10, 11], [10, 12], [11, 10], [11, 11], [11, 12], [12, 10], [12, 11], [12, 12]]
- end
-
- it "returns an Enumerator of all repeated permutations of given length when called without a block" do
- enum = @numbers.repeated_permutation(2)
- enum.should be_an_instance_of(Enumerator)
- enum.to_a.sort.should == @permutations
- end
-
- it "yields all repeated_permutations to the block then returns self when called with block but no arguments" do
- yielded = []
- @numbers.repeated_permutation(2) {|n| yielded << n}.should equal(@numbers)
- yielded.sort.should == @permutations
- end
-
- it "yields the empty repeated_permutation ([[]]) when the given length is 0" do
- @numbers.repeated_permutation(0).to_a.should == [[]]
- [].repeated_permutation(0).to_a.should == [[]]
- end
-
- it "does not yield when called on an empty Array with a nonzero argument" do
- [].repeated_permutation(10).to_a.should == []
- end
-
- it "handles duplicate elements correctly" do
- @numbers[-1] = 10
- @numbers.repeated_permutation(2).sort.should ==
- [[10, 10], [10, 10], [10, 10], [10, 10], [10, 11], [10, 11], [11, 10], [11, 10], [11, 11]]
- end
-
- it "truncates Float arguments" do
- @numbers.repeated_permutation(3.7).to_a.sort.should ==
- @numbers.repeated_permutation(3).to_a.sort
- end
-
- it "returns an Enumerator which works as expected even when the array was modified" do
- @numbers.shift
- enum = @numbers.repeated_permutation(2)
- @numbers.unshift 10
- enum.to_a.sort.should == @permutations
- end
-
- it "allows permutations larger than the number of elements" do
- [1,2].repeated_permutation(3).sort.should ==
- [[1, 1, 1], [1, 1, 2], [1, 2, 1],
- [1, 2, 2], [2, 1, 1], [2, 1, 2],
- [2, 2, 1], [2, 2, 2]]
- end
-
- it "generates from a defensive copy, ignoring mutations" do
- accum = []
- ary = [1,2]
- ary.repeated_permutation(3) do |x|
- accum << x
- ary[0] = 5
- end
-
- accum.sort.should ==
- [[1, 1, 1], [1, 1, 2], [1, 2, 1],
- [1, 2, 2], [2, 1, 1], [2, 1, 2],
- [2, 2, 1], [2, 2, 2]]
- end
-
- describe "when no block is given" do
- describe "returned Enumerator" do
- describe "size" do
- it "returns 0 when combination_size is < 0" do
- @numbers.repeated_permutation(-1).size.should == 0
- [].repeated_permutation(-1).size.should == 0
- end
-
- it "returns array size ** combination_size" do
- @numbers.repeated_permutation(4).size.should == 81
- @numbers.repeated_permutation(3).size.should == 27
- @numbers.repeated_permutation(2).size.should == 9
- @numbers.repeated_permutation(1).size.should == 3
- @numbers.repeated_permutation(0).size.should == 1
- [].repeated_permutation(4).size.should == 0
- [].repeated_permutation(3).size.should == 0
- [].repeated_permutation(2).size.should == 0
- [].repeated_permutation(1).size.should == 0
- [].repeated_permutation(0).size.should == 1
- end
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/replace_spec.rb b/spec/ruby/core/array/replace_spec.rb
deleted file mode 100644
index e8b0d53e04..0000000000
--- a/spec/ruby/core/array/replace_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/replace', __FILE__)
-
-describe "Array#replace" do
- it_behaves_like(:array_replace, :replace)
-end
diff --git a/spec/ruby/core/array/reverse_each_spec.rb b/spec/ruby/core/array/reverse_each_spec.rb
deleted file mode 100644
index 1bc0ed5ac5..0000000000
--- a/spec/ruby/core/array/reverse_each_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-# Modifying a collection while the contents are being iterated
-# gives undefined behavior. See
-# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23633
-
-describe "Array#reverse_each" do
- before :each do
- ScratchPad.record []
- end
-
- it "traverses array in reverse order and pass each element to block" do
- [1, 3, 4, 6].reverse_each { |i| ScratchPad << i }
- ScratchPad.recorded.should == [6, 4, 3, 1]
- end
-
- it "returns self" do
- a = [:a, :b, :c]
- a.reverse_each { |x| }.should equal(a)
- end
-
- it "yields only the top level element of an empty recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.reverse_each { |i| ScratchPad << i }
- ScratchPad.recorded.should == [empty]
- end
-
- it "yields only the top level element of a recursive array" do
- array = ArraySpecs.recursive_array
- array.reverse_each { |i| ScratchPad << i }
- ScratchPad.recorded.should == [array, array, array, array, array, 3.0, 'two', 1]
- end
-
- it "returns the correct size when no block is given" do
- [1, 2, 3].reverse_each.size.should == 3
- end
-
- it_behaves_like :enumeratorize, :reverse_each
- it_behaves_like :enumeratorized_with_origin_size, :reverse_each, [1,2,3]
-end
diff --git a/spec/ruby/core/array/reverse_spec.rb b/spec/ruby/core/array/reverse_spec.rb
deleted file mode 100644
index a3a6db9506..0000000000
--- a/spec/ruby/core/array/reverse_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#reverse" do
- it "returns a new array with the elements in reverse order" do
- [].reverse.should == []
- [1, 3, 5, 2].reverse.should == [2, 5, 3, 1]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.reverse.should == empty
-
- array = ArraySpecs.recursive_array
- array.reverse.should == [array, array, array, array, array, 3.0, 'two', 1]
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].reverse.should be_an_instance_of(Array)
- end
-end
-
-describe "Array#reverse!" do
- it "reverses the elements in place" do
- a = [6, 3, 4, 2, 1]
- a.reverse!.should equal(a)
- a.should == [1, 2, 4, 3, 6]
- [].reverse!.should == []
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.reverse!.should == [empty]
-
- array = ArraySpecs.recursive_array
- array.reverse!.should == [array, array, array, array, array, 3.0, 'two', 1]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.reverse! }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/rindex_spec.rb b/spec/ruby/core/array/rindex_spec.rb
deleted file mode 100644
index 19a6f04c85..0000000000
--- a/spec/ruby/core/array/rindex_spec.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-# Modifying a collection while the contents are being iterated
-# gives undefined behavior. See
-# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23633
-
-describe "Array#rindex" do
- it "returns the first index backwards from the end where element == to object" do
- key = 3
- uno = mock('one')
- dos = mock('two')
- tres = mock('three')
- tres.should_receive(:==).any_number_of_times.and_return(false)
- dos.should_receive(:==).any_number_of_times.and_return(true)
- uno.should_not_receive(:==)
- ary = [uno, dos, tres]
-
- ary.rindex(key).should == 1
- end
-
- it "returns size-1 if last element == to object" do
- [2, 1, 3, 2, 5].rindex(5).should == 4
- end
-
- it "returns 0 if only first element == to object" do
- [2, 1, 3, 1, 5].rindex(2).should == 0
- end
-
- it "returns nil if no element == to object" do
- [1, 1, 3, 2, 1, 3].rindex(4).should == nil
- end
-
- it "returns correct index even after delete_at" do
- array = ["fish", "bird", "lion", "cat"]
- array.delete_at(0)
- array.rindex("lion").should == 1
- end
-
- it "properly handles empty recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.rindex(empty).should == 0
- empty.rindex(1).should be_nil
- end
-
- it "properly handles recursive arrays" do
- array = ArraySpecs.recursive_array
- array.rindex(1).should == 0
- array.rindex(array).should == 7
- end
-
- it "accepts a block instead of an argument" do
- [4, 2, 1, 5, 1, 3].rindex { |x| x < 2 }.should == 4
- end
-
- it "ignores the block if there is an argument" do
- -> {
- [4, 2, 1, 5, 1, 3].rindex(5) { |x| x < 2 }.should == 3
- }.should complain(/given block not used/)
- end
-
- it "rechecks the array size during iteration" do
- ary = [4, 2, 1, 5, 1, 3]
- seen = []
- ary.rindex { |x| seen << x; ary.clear; false }
-
- seen.should == [3]
- end
-
- describe "given no argument and no block" do
- it "produces an Enumerator" do
- enum = [4, 2, 1, 5, 1, 3].rindex
- enum.should be_an_instance_of(Enumerator)
- enum.each { |x| x < 2 }.should == 4
- end
- end
-
- it_behaves_like :enumeratorized_with_unknown_size, :bsearch, [1,2,3]
-end
diff --git a/spec/ruby/core/array/rotate_spec.rb b/spec/ruby/core/array/rotate_spec.rb
deleted file mode 100644
index 270bfeb446..0000000000
--- a/spec/ruby/core/array/rotate_spec.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#rotate" do
- describe "when passed no argument" do
- it "returns a copy of the array with the first element moved at the end" do
- [1, 2, 3, 4, 5].rotate.should == [2, 3, 4, 5, 1]
- end
- end
-
- describe "with an argument n" do
- it "returns a copy of the array with the first (n % size) elements moved at the end" do
- a = [1, 2, 3, 4, 5]
- a.rotate( 2).should == [3, 4, 5, 1, 2]
- a.rotate( -1).should == [5, 1, 2, 3, 4]
- a.rotate(-21).should == [5, 1, 2, 3, 4]
- a.rotate( 13).should == [4, 5, 1, 2, 3]
- a.rotate( 0).should == a
- end
-
- it "coerces the argument using to_int" do
- [1, 2, 3].rotate(2.6).should == [3, 1, 2]
-
- obj = mock('integer_like')
- obj.should_receive(:to_int).and_return(2)
- [1, 2, 3].rotate(obj).should == [3, 1, 2]
- end
-
- it "raises a TypeError if not passed an integer-like argument" do
- lambda {
- [1, 2].rotate(nil)
- }.should raise_error(TypeError)
- lambda {
- [1, 2].rotate("4")
- }.should raise_error(TypeError)
- end
- end
-
- it "returns a copy of the array when its length is one or zero" do
- [1].rotate.should == [1]
- [1].rotate(2).should == [1]
- [1].rotate(-42).should == [1]
- [ ].rotate.should == []
- [ ].rotate(2).should == []
- [ ].rotate(-42).should == []
- end
-
- it "does not mutate the receiver" do
- lambda {
- [].freeze.rotate
- [2].freeze.rotate(2)
- [1,2,3].freeze.rotate(-3)
- }.should_not raise_error
- end
-
- it "does not return self" do
- a = [1, 2, 3]
- a.rotate.should_not equal(a)
- a = []
- a.rotate(0).should_not equal(a)
- end
-
- it "does not return subclass instance for Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].rotate.should be_an_instance_of(Array)
- end
-end
-
-describe "Array#rotate!" do
- describe "when passed no argument" do
- it "moves the first element to the end and returns self" do
- a = [1, 2, 3, 4, 5]
- a.rotate!.should equal(a)
- a.should == [2, 3, 4, 5, 1]
- end
- end
-
- describe "with an argument n" do
- it "moves the first (n % size) elements at the end and returns self" do
- a = [1, 2, 3, 4, 5]
- a.rotate!(2).should equal(a)
- a.should == [3, 4, 5, 1, 2]
- a.rotate!(-12).should equal(a)
- a.should == [1, 2, 3, 4, 5]
- a.rotate!(13).should equal(a)
- a.should == [4, 5, 1, 2, 3]
- end
-
- it "coerces the argument using to_int" do
- [1, 2, 3].rotate!(2.6).should == [3, 1, 2]
-
- obj = mock('integer_like')
- obj.should_receive(:to_int).and_return(2)
- [1, 2, 3].rotate!(obj).should == [3, 1, 2]
- end
-
- it "raises a TypeError if not passed an integer-like argument" do
- lambda {
- [1, 2].rotate!(nil)
- }.should raise_error(TypeError)
- lambda {
- [1, 2].rotate!("4")
- }.should raise_error(TypeError)
- end
- end
-
- it "does nothing and returns self when the length is zero or one" do
- a = [1]
- a.rotate!.should equal(a)
- a.should == [1]
- a.rotate!(2).should equal(a)
- a.should == [1]
- a.rotate!(-21).should equal(a)
- a.should == [1]
-
- a = []
- a.rotate!.should equal(a)
- a.should == []
- a.rotate!(2).should equal(a)
- a.should == []
- a.rotate!(-21).should equal(a)
- a.should == []
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { [1, 2, 3].freeze.rotate!(0) }.should raise_error(RuntimeError)
- lambda { [1].freeze.rotate!(42) }.should raise_error(RuntimeError)
- lambda { [].freeze.rotate! }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/sample_spec.rb b/spec/ruby/core/array/sample_spec.rb
deleted file mode 100644
index 53601dd5c4..0000000000
--- a/spec/ruby/core/array/sample_spec.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#sample" do
- it "samples evenly" do
- ary = [0, 1, 2, 3]
- 3.times do |i|
- counts = [0, 0, 0, 0]
- 4000.times do
- counts[ary.sample(3)[i]] += 1
- end
- counts.each do |count|
- (800..1200).should include(count)
- end
- end
- end
-
- it "returns nil for an empty Array" do
- [].sample.should be_nil
- end
-
- it "returns a single value when not passed a count" do
- [4].sample.should equal(4)
- end
-
- it "returns an empty Array when passed zero" do
- [4].sample(0).should == []
- end
-
- it "returns an Array of elements when passed a count" do
- [1, 2, 3, 4].sample(3).should be_an_instance_of(Array)
- end
-
- it "returns elements from the Array" do
- array = [1, 2, 3, 4]
- array.sample(3).all? { |x| array.should include(x) }
- end
-
- it "returns at most the number of elements in the Array" do
- array = [1, 2, 3, 4]
- result = array.sample(20)
- result.size.should == 4
- end
-
- it "does not return the same value if the Array has unique values" do
- array = [1, 2, 3, 4]
- result = array.sample(20)
- result.sort.should == array
- end
-
- it "may return the same value if the array is not unique" do
- [4, 4].sample(2).should == [4,4]
- end
-
- it "calls #to_int to convert the count when passed an Object" do
- [1, 2, 3, 4].sample(mock_int(2)).size.should == 2
- end
-
- it "raises ArgumentError when passed a negative count" do
- lambda { [1, 2].sample(-1) }.should raise_error(ArgumentError)
- end
-
- it "does not return subclass instances with Array subclass" do
- ArraySpecs::MyArray[1, 2, 3].sample(2).should be_an_instance_of(Array)
- end
-
- describe "with options" do
- it "calls #to_hash to convert the passed Object" do
- obj = mock("array_sample")
- obj.should_receive(:to_hash).and_return({})
- obj.should_not_receive(:to_int)
-
- [1, 2].sample(obj).should be_an_instance_of(Fixnum)
- end
-
- it "calls #to_int on the first argument and #to_hash on the second when passed Objects" do
- count = mock("array_sample_count")
- count.should_receive(:to_int).and_return(2)
- options = mock("array_sample_options")
- options.should_receive(:to_hash).and_return({})
-
- [1, 2].sample(count, options).size.should == 2
- end
-
- it "calls #rand on the Object passed by the :random key in the arguments Hash" do
- obj = mock("array_sample_random")
- obj.should_receive(:rand).and_return(0.5)
-
- [1, 2].sample(random: obj).should be_an_instance_of(Fixnum)
- end
-
- it "raises a NoMethodError if an object passed for the RNG does not define #rand" do
- obj = BasicObject.new
-
- lambda { [1, 2].sample(random: obj) }.should raise_error(NoMethodError)
- end
-
- describe "when the object returned by #rand is a Fixnum" do
- it "uses the fixnum as index" do
- random = mock("array_sample_random_ret")
- random.should_receive(:rand).and_return(0)
-
- [1, 2].sample(random: random).should == 1
-
- random = mock("array_sample_random_ret")
- random.should_receive(:rand).and_return(1)
-
- [1, 2].sample(random: random).should == 2
- end
-
- it "raises a RangeError if the value is less than zero" do
- random = mock("array_sample_random")
- random.should_receive(:rand).and_return(-1)
-
- lambda { [1, 2].sample(random: random) }.should raise_error(RangeError)
- end
-
- it "raises a RangeError if the value is equal to the Array size" do
- random = mock("array_sample_random")
- random.should_receive(:rand).and_return(2)
-
- lambda { [1, 2].sample(random: random) }.should raise_error(RangeError)
- end
- end
- end
-
- describe "when the object returned by #rand is not a Fixnum but responds to #to_int" do
- it "calls #to_int on the Object" do
- value = mock("array_sample_random_value")
- value.should_receive(:to_int).and_return(1)
- random = mock("array_sample_random")
- random.should_receive(:rand).and_return(value)
-
- [1, 2].sample(random: random).should == 2
- end
-
- it "raises a RangeError if the value is less than zero" do
- value = mock("array_sample_random_value")
- value.should_receive(:to_int).and_return(-1)
- random = mock("array_sample_random")
- random.should_receive(:rand).and_return(value)
-
- lambda { [1, 2].sample(random: random) }.should raise_error(RangeError)
- end
-
- it "raises a RangeError if the value is equal to the Array size" do
- value = mock("array_sample_random_value")
- value.should_receive(:to_int).and_return(2)
- random = mock("array_sample_random")
- random.should_receive(:rand).and_return(value)
-
- lambda { [1, 2].sample(random: random) }.should raise_error(RangeError)
- end
- end
-end
diff --git a/spec/ruby/core/array/select_spec.rb b/spec/ruby/core/array/select_spec.rb
deleted file mode 100644
index 8b83acaa5f..0000000000
--- a/spec/ruby/core/array/select_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/enumeratorize', __FILE__)
-require File.expand_path('../shared/keep_if', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#select" do
- it_behaves_like :enumeratorize, :select
- it_behaves_like :enumeratorized_with_origin_size, :select, [1,2,3]
-
- it "returns a new array of elements for which block is true" do
- [1, 3, 4, 5, 6, 9].select { |i| i % ((i + 1) / 2) == 0}.should == [1, 4, 6]
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].select { true }.should be_an_instance_of(Array)
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.select { true }.should == empty
- empty.select { false }.should == []
-
- array = ArraySpecs.recursive_array
- array.select { true }.should == [1, 'two', 3.0, array, array, array, array, array]
- array.select { false }.should == []
- end
-end
-
-describe "Array#select!" do
- it "returns nil if no changes were made in the array" do
- [1, 2, 3].select! { true }.should be_nil
- end
-
- it_behaves_like :keep_if, :select!
-end
diff --git a/spec/ruby/core/array/shared/clone.rb b/spec/ruby/core/array/shared/clone.rb
deleted file mode 100644
index 6fc7ae31eb..0000000000
--- a/spec/ruby/core/array/shared/clone.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-describe :array_clone, shared: true do
- it "returns an Array or a subclass instance" do
- [].send(@method).should be_an_instance_of(Array)
- ArraySpecs::MyArray[1, 2].send(@method).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "produces a shallow copy where the references are directly copied" do
- a = [mock('1'), mock('2')]
- b = a.send @method
- b.first.object_id.should == a.first.object_id
- b.last.object_id.should == a.last.object_id
- end
-
- it "creates a new array containing all elements or the original" do
- a = [1, 2, 3, 4]
- b = a.send @method
- b.should == a
- b.__id__.should_not == a.__id__
- end
-
- it "copies taint status from the original" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- a.taint
- aa = a.send @method
- bb = b.send @method
-
- aa.tainted?.should == true
- bb.tainted?.should == false
- end
-
- it "copies untrusted status from the original" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- a.untrust
- aa = a.send @method
- bb = b.send @method
-
- aa.untrusted?.should == true
- bb.untrusted?.should == false
- end
-end
diff --git a/spec/ruby/core/array/shared/collect.rb b/spec/ruby/core/array/shared/collect.rb
deleted file mode 100644
index f6bcfd8904..0000000000
--- a/spec/ruby/core/array/shared/collect.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-require File.expand_path('../../../enumerable/shared/enumeratorized', __FILE__)
-
-describe :array_collect, shared: true do
- it "returns a copy of array with each element replaced by the value returned by block" do
- a = ['a', 'b', 'c', 'd']
- b = a.send(@method) { |i| i + '!' }
- b.should == ["a!", "b!", "c!", "d!"]
- b.object_id.should_not == a.object_id
- end
-
- it "does not return subclass instance" do
- ArraySpecs::MyArray[1, 2, 3].send(@method) { |x| x + 1 }.should be_an_instance_of(Array)
- end
-
- it "does not change self" do
- a = ['a', 'b', 'c', 'd']
- a.send(@method) { |i| i + '!' }
- a.should == ['a', 'b', 'c', 'd']
- end
-
- it "returns the evaluated value of block if it broke in the block" do
- a = ['a', 'b', 'c', 'd']
- b = a.send(@method) {|i|
- if i == 'c'
- break 0
- else
- i + '!'
- end
- }
- b.should == 0
- end
-
- it "returns an Enumerator when no block given" do
- a = [1, 2, 3]
- a.send(@method).should be_an_instance_of(Enumerator)
- end
-
- it "raises an ArgumentError when no block and with arguments" do
- a = [1, 2, 3]
- lambda {
- a.send(@method, :foo)
- }.should raise_error(ArgumentError)
- end
-
- it "does not copy tainted status" do
- a = [1, 2, 3]
- a.taint
- a.send(@method){|x| x}.tainted?.should be_false
- end
-
- it "does not copy untrusted status" do
- a = [1, 2, 3]
- a.untrust
- a.send(@method){|x| x}.untrusted?.should be_false
- end
-
- before :all do
- @object = [1, 2, 3, 4]
- end
- it_should_behave_like :enumeratorized_with_origin_size
-end
-
-describe :array_collect_b, shared: true do
- it "replaces each element with the value returned by block" do
- a = [7, 9, 3, 5]
- a.send(@method) { |i| i - 1 }.should equal(a)
- a.should == [6, 8, 2, 4]
- end
-
- it "returns self" do
- a = [1, 2, 3, 4, 5]
- b = a.send(@method) {|i| i+1 }
- a.object_id.should == b.object_id
- end
-
- it "returns the evaluated value of block but its contents is partially modified, if it broke in the block" do
- a = ['a', 'b', 'c', 'd']
- b = a.send(@method) {|i|
- if i == 'c'
- break 0
- else
- i + '!'
- end
- }
- b.should == 0
- a.should == ['a!', 'b!', 'c', 'd']
- end
-
- it "returns an Enumerator when no block given, and the enumerator can modify the original array" do
- a = [1, 2, 3]
- enum = a.send(@method)
- enum.should be_an_instance_of(Enumerator)
- enum.each{|i| "#{i}!" }
- a.should == ["1!", "2!", "3!"]
- end
-
- it "keeps tainted status" do
- a = [1, 2, 3]
- a.taint
- a.tainted?.should be_true
- a.send(@method){|x| x}
- a.tainted?.should be_true
- end
-
- it "keeps untrusted status" do
- a = [1, 2, 3]
- a.untrust
- a.send(@method){|x| x}
- a.untrusted?.should be_true
- end
-
- describe "when frozen" do
- it "raises a RuntimeError" do
- lambda { ArraySpecs.frozen_array.send(@method) {} }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError when empty" do
- lambda { ArraySpecs.empty_frozen_array.send(@method) {} }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError when calling #each on the returned Enumerator" do
- enumerator = ArraySpecs.frozen_array.send(@method)
- lambda { enumerator.each {|x| x } }.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError when calling #each on the returned Enumerator when empty" do
- enumerator = ArraySpecs.empty_frozen_array.send(@method)
- lambda { enumerator.each {|x| x } }.should raise_error(RuntimeError)
- end
- end
-
- before :all do
- @object = [1, 2, 3, 4]
- end
- it_should_behave_like :enumeratorized_with_origin_size
-end
diff --git a/spec/ruby/core/array/shared/delete_if.rb b/spec/ruby/core/array/shared/delete_if.rb
deleted file mode 100644
index a9fb57e0d9..0000000000
--- a/spec/ruby/core/array/shared/delete_if.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-describe :delete_if, shared: true do
- before :each do
- @object = [1,2,3]
- end
-
- ruby_version_is "2.3" do
- it "updates the receiver after all blocks" do
- @object.send(@method) do |e|
- @object.length.should == 3
- true
- end
- @object.length.should == 0
- end
- end
-
- ruby_version_is ""..."2.3" do
- it "updates the receiver after each true block" do
- count = 0
- @object.send(@method) do |e|
- @object.length.should == (3 - count)
- count += 1
- true
- end
- @object.length.should == 0
- end
- end
-end
diff --git a/spec/ruby/core/array/shared/enumeratorize.rb b/spec/ruby/core/array/shared/enumeratorize.rb
deleted file mode 100644
index a19a5d3b9b..0000000000
--- a/spec/ruby/core/array/shared/enumeratorize.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-describe :enumeratorize, shared: true do
- it "returns an Enumerator if no block given" do
- [1,2].send(@method).should be_an_instance_of(Enumerator)
- end
-end
diff --git a/spec/ruby/core/array/shared/eql.rb b/spec/ruby/core/array/shared/eql.rb
deleted file mode 100644
index b5d9128434..0000000000
--- a/spec/ruby/core/array/shared/eql.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-describe :array_eql, shared: true do
- it "returns true if other is the same array" do
- a = [1]
- a.send(@method, a).should be_true
- end
-
- it "returns true if corresponding elements are #eql?" do
- [].send(@method, []).should be_true
- [1, 2, 3, 4].send(@method, [1, 2, 3, 4]).should be_true
- end
-
- it "returns false if other is shorter than self" do
- [1, 2, 3, 4].send(@method, [1, 2, 3]).should be_false
- end
-
- it "returns false if other is longer than self" do
- [1, 2, 3, 4].send(@method, [1, 2, 3, 4, 5]).should be_false
- end
-
- it "returns false immediately when sizes of the arrays differ" do
- obj = mock('1')
- obj.should_not_receive(@method)
-
- [] .send(@method, [obj] ).should be_false
- [obj] .send(@method, [] ).should be_false
- end
-
- it "handles well recursive arrays" do
- a = ArraySpecs.empty_recursive_array
- a .send(@method, [a] ).should be_true
- a .send(@method, [[a]] ).should be_true
- [a] .send(@method, a ).should be_true
- [[a]] .send(@method, a ).should be_true
- # These may be surprising, but no difference can be
- # found between these arrays, so they are ==.
- # There is no "path" that will lead to a difference
- # (contrary to other examples below)
-
- a2 = ArraySpecs.empty_recursive_array
- a .send(@method, a2 ).should be_true
- a .send(@method, [a2] ).should be_true
- a .send(@method, [[a2]] ).should be_true
- [a] .send(@method, a2 ).should be_true
- [[a]] .send(@method, a2 ).should be_true
-
- back = []
- forth = [back]; back << forth;
- back .send(@method, a ).should be_true
-
- x = []; x << x << x
- x .send(@method, a ).should be_false # since x.size != a.size
- x .send(@method, [a, a] ).should be_false # since x[0].size != [a, a][0].size
- x .send(@method, [x, a] ).should be_false # since x[1].size != [x, a][1].size
- [x, a] .send(@method, [a, x] ).should be_false # etc...
- x .send(@method, [x, x] ).should be_true
- x .send(@method, [[x, x], [x, x]] ).should be_true
-
- tree = [];
- branch = []; branch << tree << tree; tree << branch
- tree2 = [];
- branch2 = []; branch2 << tree2 << tree2; tree2 << branch2
- forest = [tree, branch, :bird, a]; forest << forest
- forest2 = [tree2, branch2, :bird, a2]; forest2 << forest2
-
- forest .send(@method, forest2 ).should be_true
- forest .send(@method, [tree2, branch, :bird, a, forest2]).should be_true
-
- diffforest = [branch2, tree2, :bird, a2]; diffforest << forest2
- forest .send(@method, diffforest ).should be_false # since forest[0].size == 1 != 3 == diffforest[0]
- forest .send(@method, [nil] ).should be_false
- forest .send(@method, [forest] ).should be_false
- end
-
- it "does not call #to_ary on its argument" do
- obj = mock('to_ary')
- obj.should_not_receive(:to_ary)
-
- [1, 2, 3].send(@method, obj).should be_false
- end
-
- it "does not call #to_ary on Array subclasses" do
- ary = ArraySpecs::ToAryArray[5, 6, 7]
- ary.should_not_receive(:to_ary)
- [5, 6, 7].send(@method, ary).should be_true
- end
-
- it "ignores array class differences" do
- ArraySpecs::MyArray[1, 2, 3].send(@method, [1, 2, 3]).should be_true
- ArraySpecs::MyArray[1, 2, 3].send(@method, ArraySpecs::MyArray[1, 2, 3]).should be_true
- [1, 2, 3].send(@method, ArraySpecs::MyArray[1, 2, 3]).should be_true
- end
-end
diff --git a/spec/ruby/core/array/shared/index.rb b/spec/ruby/core/array/shared/index.rb
deleted file mode 100644
index a9896554f2..0000000000
--- a/spec/ruby/core/array/shared/index.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-describe :array_index, shared: true do
- it "returns the index of the first element == to object" do
- x = mock('3')
- def x.==(obj) 3 == obj; end
-
- [2, x, 3, 1, 3, 1].send(@method, 3).should == 1
- [2, 3.0, 3, x, 1, 3, 1].send(@method, x).should == 1
- end
-
- it "returns 0 if first element == to object" do
- [2, 1, 3, 2, 5].send(@method, 2).should == 0
- end
-
- it "returns size-1 if only last element == to object" do
- [2, 1, 3, 1, 5].send(@method, 5).should == 4
- end
-
- it "returns nil if no element == to object" do
- [2, 1, 1, 1, 1].send(@method, 3).should == nil
- end
-
- it "accepts a block instead of an argument" do
- [4, 2, 1, 5, 1, 3].send(@method) {|x| x < 2}.should == 2
- end
-
- it "ignores the block if there is an argument" do
- -> {
- [4, 2, 1, 5, 1, 3].send(@method, 5) {|x| x < 2}.should == 3
- }.should complain(/given block not used/)
- end
-
- describe "given no argument and no block" do
- it "produces an Enumerator" do
- [].send(@method).should be_an_instance_of(Enumerator)
- end
- end
-end
diff --git a/spec/ruby/core/array/shared/inspect.rb b/spec/ruby/core/array/shared/inspect.rb
deleted file mode 100644
index 6a60781b45..0000000000
--- a/spec/ruby/core/array/shared/inspect.rb
+++ /dev/null
@@ -1,144 +0,0 @@
-require File.expand_path('../../fixtures/encoded_strings', __FILE__)
-
-describe :array_inspect, shared: true do
- it "returns a string" do
- [1, 2, 3].send(@method).should be_an_instance_of(String)
- end
-
- it "returns '[]' for an empty Array" do
- [].send(@method).should == "[]"
- end
-
- it "calls inspect on its elements and joins the results with commas" do
- items = Array.new(3) do |i|
- obj = mock(i.to_s)
- obj.should_receive(:inspect).and_return(i.to_s)
- obj
- end
- items.send(@method).should == "[0, 1, 2]"
- end
-
- it "does not call #to_s on a String returned from #inspect" do
- str = "abc"
- str.should_not_receive(:to_s)
-
- [str].send(@method).should == '["abc"]'
- end
-
- it "calls #to_s on the object returned from #inspect if the Object isn't a String" do
- obj = mock("Array#inspect/to_s calls #to_s")
- obj.should_receive(:inspect).and_return(obj)
- obj.should_receive(:to_s).and_return("abc")
-
- [obj].send(@method).should == "[abc]"
- end
-
- it "does not call #to_str on the object returned from #inspect when it is not a String" do
- obj = mock("Array#inspect/to_s does not call #to_str")
- obj.should_receive(:inspect).and_return(obj)
- obj.should_not_receive(:to_str)
-
- [obj].send(@method).should =~ /^\[#<MockObject:0x[0-9a-f]+>\]$/
- end
-
- it "does not call #to_str on the object returned from #to_s when it is not a String" do
- obj = mock("Array#inspect/to_s does not call #to_str on #to_s result")
- obj.should_receive(:inspect).and_return(obj)
- obj.should_receive(:to_s).and_return(obj)
- obj.should_not_receive(:to_str)
-
- [obj].send(@method).should =~ /^\[#<MockObject:0x[0-9a-f]+>\]$/
- end
-
- it "does not swallow exceptions raised by #to_s" do
- obj = mock("Array#inspect/to_s does not swallow #to_s exceptions")
- obj.should_receive(:inspect).and_return(obj)
- obj.should_receive(:to_s).and_raise(Exception)
-
- lambda { [obj].send(@method) }.should raise_error(Exception)
- end
-
- it "represents a recursive element with '[...]'" do
- ArraySpecs.recursive_array.send(@method).should == "[1, \"two\", 3.0, [...], [...], [...], [...], [...]]"
- ArraySpecs.head_recursive_array.send(@method).should == "[[...], [...], [...], [...], [...], 1, \"two\", 3.0]"
- ArraySpecs.empty_recursive_array.send(@method).should == "[[...]]"
- end
-
- it "taints the result if the Array is non-empty and tainted" do
- [1, 2].taint.send(@method).tainted?.should be_true
- end
-
- it "does not taint the result if the Array is tainted but empty" do
- [].taint.send(@method).tainted?.should be_false
- end
-
- it "taints the result if an element is tainted" do
- ["str".taint].send(@method).tainted?.should be_true
- end
-
- it "untrusts the result if the Array is untrusted" do
- [1, 2].untrust.send(@method).untrusted?.should be_true
- end
-
- it "does not untrust the result if the Array is untrusted but empty" do
- [].untrust.send(@method).untrusted?.should be_false
- end
-
- it "untrusts the result if an element is untrusted" do
- ["str".untrust].send(@method).untrusted?.should be_true
- end
-
- describe "with encoding" do
- before :each do
- @default_external_encoding = Encoding.default_external
- end
-
- after :each do
- Encoding.default_external = @default_external_encoding
- end
-
- it "returns a US-ASCII string for an empty Array" do
- [].send(@method).encoding.should == Encoding::US_ASCII
- end
-
- it "use the default external encoding if it is ascii compatible" do
- Encoding.default_external = Encoding.find('UTF-8')
-
- utf8 = "utf8".encode("UTF-8")
- jp = "jp".encode("EUC-JP")
- array = [jp, utf8]
-
- array.send(@method).encoding.name.should == "UTF-8"
- end
-
- it "use US-ASCII encoding if the default external encoding is not ascii compatible" do
- Encoding.default_external = Encoding.find('UTF-32')
-
- utf8 = "utf8".encode("UTF-8")
- jp = "jp".encode("EUC-JP")
- array = [jp, utf8]
-
- array.send(@method).encoding.name.should == "US-ASCII"
- end
-
- ruby_version_is ''...'2.3' do
- it "raises if inspected result is not default external encoding" do
- utf_16be = mock("utf_16be")
- utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
-
- lambda {
- [utf_16be].send(@method)
- }.should raise_error(Encoding::CompatibilityError)
- end
- end
-
- ruby_version_is '2.3' do
- it "does not raise if inspected result is not default external encoding" do
- utf_16be = mock("utf_16be")
- utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
-
- [utf_16be].send(@method).should == '["utf_16be \u3042"]'
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/shared/join.rb b/spec/ruby/core/array/shared/join.rb
deleted file mode 100644
index fa66588b47..0000000000
--- a/spec/ruby/core/array/shared/join.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-require File.expand_path('../../fixtures/classes', __FILE__)
-require File.expand_path('../../fixtures/encoded_strings', __FILE__)
-
-describe :array_join_with_default_separator, shared: true do
- before :each do
- @separator = $,
- end
-
- after :each do
- $, = @separator
- end
-
- it "returns an empty string if the Array is empty" do
- [].send(@method).should == ''
- end
-
- it "returns a US-ASCII string for an empty Array" do
- [].send(@method).encoding.should == Encoding::US_ASCII
- end
-
- it "returns a string formed by concatenating each String element separated by $," do
- $, = " | "
- ["1", "2", "3"].send(@method).should == "1 | 2 | 3"
- end
-
- it "attempts coercion via #to_str first" do
- obj = mock('foo')
- obj.should_receive(:to_str).any_number_of_times.and_return("foo")
- [obj].send(@method).should == "foo"
- end
-
- it "attempts coercion via #to_ary second" do
- obj = mock('foo')
- obj.should_receive(:to_str).any_number_of_times.and_return(nil)
- obj.should_receive(:to_ary).any_number_of_times.and_return(["foo"])
- [obj].send(@method).should == "foo"
- end
-
- it "attempts coercion via #to_s third" do
- obj = mock('foo')
- obj.should_receive(:to_str).any_number_of_times.and_return(nil)
- obj.should_receive(:to_ary).any_number_of_times.and_return(nil)
- obj.should_receive(:to_s).any_number_of_times.and_return("foo")
- [obj].send(@method).should == "foo"
- end
-
- it "raises a NoMethodError if an element does not respond to #to_str, #to_ary, or #to_s" do
- obj = mock('o')
- class << obj; undef :to_s; end
- lambda { [1, obj].send(@method) }.should raise_error(NoMethodError)
- end
-
- it "raises an ArgumentError when the Array is recursive" do
- lambda { ArraySpecs.recursive_array.send(@method) }.should raise_error(ArgumentError)
- lambda { ArraySpecs.head_recursive_array.send(@method) }.should raise_error(ArgumentError)
- lambda { ArraySpecs.empty_recursive_array.send(@method) }.should raise_error(ArgumentError)
- end
-
- it "taints the result if the Array is tainted and non-empty" do
- [1, 2].taint.send(@method).tainted?.should be_true
- end
-
- it "does not taint the result if the Array is tainted but empty" do
- [].taint.send(@method).tainted?.should be_false
- end
-
- it "taints the result if the result of coercing an element is tainted" do
- s = mock("taint")
- s.should_receive(:to_s).and_return("str".taint)
- [s].send(@method).tainted?.should be_true
- end
-
- it "untrusts the result if the Array is untrusted and non-empty" do
- [1, 2].untrust.send(@method).untrusted?.should be_true
- end
-
- it "does not untrust the result if the Array is untrusted but empty" do
- [].untrust.send(@method).untrusted?.should be_false
- end
-
- it "untrusts the result if the result of coercing an element is untrusted" do
- s = mock("untrust")
- s.should_receive(:to_s).and_return("str".untrust)
- [s].send(@method).untrusted?.should be_true
- end
-
- it "uses the first encoding when other strings are compatible" do
- ary1 = ArraySpecs.array_with_7bit_utf8_and_usascii_strings
- ary2 = ArraySpecs.array_with_usascii_and_7bit_utf8_strings
- ary3 = ArraySpecs.array_with_utf8_and_7bit_ascii8bit_strings
- ary4 = ArraySpecs.array_with_usascii_and_7bit_ascii8bit_strings
-
- ary1.send(@method).encoding.should == Encoding::UTF_8
- ary2.send(@method).encoding.should == Encoding::US_ASCII
- ary3.send(@method).encoding.should == Encoding::UTF_8
- ary4.send(@method).encoding.should == Encoding::US_ASCII
- end
-
- it "uses the widest common encoding when other strings are incompatible" do
- ary1 = ArraySpecs.array_with_utf8_and_usascii_strings
- ary2 = ArraySpecs.array_with_usascii_and_utf8_strings
-
- ary1.send(@method).encoding.should == Encoding::UTF_8
- ary2.send(@method).encoding.should == Encoding::UTF_8
- end
-
- it "fails for arrays with incompatibly-encoded strings" do
- ary_utf8_bad_ascii8bit = ArraySpecs.array_with_utf8_and_ascii8bit_strings
-
- lambda { ary_utf8_bad_ascii8bit.send(@method) }.should raise_error(EncodingError)
- end
-end
-
-describe :array_join_with_string_separator, shared: true do
- it "returns a string formed by concatenating each element.to_str separated by separator" do
- obj = mock('foo')
- obj.should_receive(:to_str).and_return("foo")
- [1, 2, 3, 4, obj].send(@method, ' | ').should == '1 | 2 | 3 | 4 | foo'
- end
-
- it "uses the same separator with nested arrays" do
- [1, [2, [3, 4], 5], 6].send(@method, ":").should == "1:2:3:4:5:6"
- [1, [2, ArraySpecs::MyArray[3, 4], 5], 6].send(@method, ":").should == "1:2:3:4:5:6"
- end
-
- describe "with a tainted separator" do
- before :each do
- @sep = ":".taint
- end
-
- it "does not taint the result if the array is empty" do
- [].send(@method, @sep).tainted?.should be_false
- end
-
- it "does not taint the result if the array has only one element" do
- [1].send(@method, @sep).tainted?.should be_false
- end
-
- it "taints the result if the array has two or more elements" do
- [1, 2].send(@method, @sep).tainted?.should be_true
- end
- end
-
- describe "with an untrusted separator" do
- before :each do
- @sep = ":".untrust
- end
-
- it "does not untrust the result if the array is empty" do
- [].send(@method, @sep).untrusted?.should be_false
- end
-
- it "does not untrust the result if the array has only one element" do
- [1].send(@method, @sep).untrusted?.should be_false
- end
-
- it "untrusts the result if the array has two or more elements" do
- [1, 2].send(@method, @sep).untrusted?.should be_true
- end
- end
-end
diff --git a/spec/ruby/core/array/shared/keep_if.rb b/spec/ruby/core/array/shared/keep_if.rb
deleted file mode 100644
index 581ba31d1b..0000000000
--- a/spec/ruby/core/array/shared/keep_if.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require File.expand_path('../../../enumerable/shared/enumeratorized', __FILE__)
-
-describe :keep_if, shared: true do
- it "deletes elements for which the block returns a false value" do
- array = [1, 2, 3, 4, 5]
- array.send(@method) {|item| item > 3 }.should equal(array)
- array.should == [4, 5]
- end
-
- it "returns an enumerator if no block is given" do
- [1, 2, 3].send(@method).should be_an_instance_of(Enumerator)
- end
-
- it "updates the receiver after all blocks" do
- a = [1, 2, 3]
- a.send(@method) do |e|
- a.length.should == 3
- false
- end
- a.length.should == 0
- end
-
- before :all do
- @object = [1,2,3]
- end
- it_should_behave_like :enumeratorized_with_origin_size
-
- describe "on frozen objects" do
- before :each do
- @origin = [true, false]
- @frozen = @origin.dup.freeze
- end
-
- it "returns an Enumerator if no block is given" do
- @frozen.send(@method).should be_an_instance_of(Enumerator)
- end
-
- describe "with truthy block" do
- it "keeps elements after any exception" do
- lambda { @frozen.send(@method) { true } }.should raise_error(Exception)
- @frozen.should == @origin
- end
-
- it "raises a RuntimeError" do
- lambda { @frozen.send(@method) { true } }.should raise_error(RuntimeError)
- end
- end
-
- describe "with falsy block" do
- it "keeps elements after any exception" do
- lambda { @frozen.send(@method) { false } }.should raise_error(Exception)
- @frozen.should == @origin
- end
-
- it "raises a RuntimeError" do
- lambda { @frozen.send(@method) { false } }.should raise_error(RuntimeError)
- end
- end
- end
-end
diff --git a/spec/ruby/core/array/shared/length.rb b/spec/ruby/core/array/shared/length.rb
deleted file mode 100644
index f84966d0ba..0000000000
--- a/spec/ruby/core/array/shared/length.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-describe :array_length, shared: true do
- it "returns the number of elements" do
- [].send(@method).should == 0
- [1, 2, 3].send(@method).should == 3
- end
-
- it "properly handles recursive arrays" do
- ArraySpecs.empty_recursive_array.send(@method).should == 1
- ArraySpecs.recursive_array.send(@method).should == 8
- end
-end
diff --git a/spec/ruby/core/array/shared/push.rb b/spec/ruby/core/array/shared/push.rb
deleted file mode 100644
index 5951b71a19..0000000000
--- a/spec/ruby/core/array/shared/push.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-describe :array_push, shared: true do
- it "appends the arguments to the array" do
- a = [ "a", "b", "c" ]
- a.send(@method, "d", "e", "f").should equal(a)
- a.send(@method).should == ["a", "b", "c", "d", "e", "f"]
- a.send(@method, 5)
- a.should == ["a", "b", "c", "d", "e", "f", 5]
-
- a = [0, 1]
- a.send(@method, 2)
- a.should == [0, 1, 2]
- end
-
- it "isn't confused by previous shift" do
- a = [ "a", "b", "c" ]
- a.shift
- a.send(@method, "foo")
- a.should == ["b", "c", "foo"]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.send(@method, :last).should == [empty, :last]
-
- array = ArraySpecs.recursive_array
- array.send(@method, :last).should == [1, 'two', 3.0, array, array, array, array, array, :last]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(RuntimeError)
- lambda { ArraySpecs.frozen_array.send(@method) }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/shared/replace.rb b/spec/ruby/core/array/shared/replace.rb
deleted file mode 100644
index 8442d9a841..0000000000
--- a/spec/ruby/core/array/shared/replace.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-describe :array_replace, shared: true do
- it "replaces the elements with elements from other array" do
- a = [1, 2, 3, 4, 5]
- b = ['a', 'b', 'c']
- a.send(@method, b).should equal(a)
- a.should == b
- a.should_not equal(b)
-
- a.send(@method, [4] * 10)
- a.should == [4] * 10
-
- a.send(@method, [])
- a.should == []
- end
-
- it "properly handles recursive arrays" do
- orig = [1, 2, 3]
- empty = ArraySpecs.empty_recursive_array
- orig.send(@method, empty)
- orig.should == empty
-
- array = ArraySpecs.recursive_array
- orig.send(@method, array)
- orig.should == array
- end
-
- it "returns self" do
- ary = [1, 2, 3]
- other = [:a, :b, :c]
- ary.send(@method, other).should equal(ary)
- end
-
- it "does not make self dependent to the original array" do
- ary = [1, 2, 3]
- other = [:a, :b, :c]
- ary.send(@method, other)
- ary.should == [:a, :b, :c]
- ary << :d
- ary.should == [:a, :b, :c, :d]
- other.should == [:a, :b, :c]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('to_ary')
- obj.stub!(:to_ary).and_return([1, 2, 3])
- [].send(@method, obj).should == [1, 2, 3]
- end
-
- it "does not call #to_ary on Array subclasses" do
- obj = ArraySpecs::ToAryArray[5, 6, 7]
- obj.should_not_receive(:to_ary)
- [].send(@method, ArraySpecs::ToAryArray[5, 6, 7]).should == [5, 6, 7]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda {
- ArraySpecs.frozen_array.send(@method, ArraySpecs.frozen_array)
- }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/shared/slice.rb b/spec/ruby/core/array/shared/slice.rb
deleted file mode 100644
index b3f4ccb9a6..0000000000
--- a/spec/ruby/core/array/shared/slice.rb
+++ /dev/null
@@ -1,459 +0,0 @@
-describe :array_slice, shared: true do
- it "returns the element at index with [index]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 1).should == "b"
-
- a = [1, 2, 3, 4]
-
- a.send(@method, 0).should == 1
- a.send(@method, 1).should == 2
- a.send(@method, 2).should == 3
- a.send(@method, 3).should == 4
- a.send(@method, 4).should == nil
- a.send(@method, 10).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns the element at index from the end of the array with [-index]" do
- [ "a", "b", "c", "d", "e" ].send(@method, -2).should == "d"
-
- a = [1, 2, 3, 4]
-
- a.send(@method, -1).should == 4
- a.send(@method, -2).should == 3
- a.send(@method, -3).should == 2
- a.send(@method, -4).should == 1
- a.send(@method, -5).should == nil
- a.send(@method, -10).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns count elements starting from index with [index, count]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 2, 3).should == ["c", "d", "e"]
-
- a = [1, 2, 3, 4]
-
- a.send(@method, 0, 0).should == []
- a.send(@method, 0, 1).should == [1]
- a.send(@method, 0, 2).should == [1, 2]
- a.send(@method, 0, 4).should == [1, 2, 3, 4]
- a.send(@method, 0, 6).should == [1, 2, 3, 4]
- a.send(@method, 0, -1).should == nil
- a.send(@method, 0, -2).should == nil
- a.send(@method, 0, -4).should == nil
-
- a.send(@method, 2, 0).should == []
- a.send(@method, 2, 1).should == [3]
- a.send(@method, 2, 2).should == [3, 4]
- a.send(@method, 2, 4).should == [3, 4]
- a.send(@method, 2, -1).should == nil
-
- a.send(@method, 4, 0).should == []
- a.send(@method, 4, 2).should == []
- a.send(@method, 4, -1).should == nil
-
- a.send(@method, 5, 0).should == nil
- a.send(@method, 5, 2).should == nil
- a.send(@method, 5, -1).should == nil
-
- a.send(@method, 6, 0).should == nil
- a.send(@method, 6, 2).should == nil
- a.send(@method, 6, -1).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns count elements starting at index from the end of array with [-index, count]" do
- [ "a", "b", "c", "d", "e" ].send(@method, -2, 2).should == ["d", "e"]
-
- a = [1, 2, 3, 4]
-
- a.send(@method, -1, 0).should == []
- a.send(@method, -1, 1).should == [4]
- a.send(@method, -1, 2).should == [4]
- a.send(@method, -1, -1).should == nil
-
- a.send(@method, -2, 0).should == []
- a.send(@method, -2, 1).should == [3]
- a.send(@method, -2, 2).should == [3, 4]
- a.send(@method, -2, 4).should == [3, 4]
- a.send(@method, -2, -1).should == nil
-
- a.send(@method, -4, 0).should == []
- a.send(@method, -4, 1).should == [1]
- a.send(@method, -4, 2).should == [1, 2]
- a.send(@method, -4, 4).should == [1, 2, 3, 4]
- a.send(@method, -4, 6).should == [1, 2, 3, 4]
- a.send(@method, -4, -1).should == nil
-
- a.send(@method, -5, 0).should == nil
- a.send(@method, -5, 1).should == nil
- a.send(@method, -5, 10).should == nil
- a.send(@method, -5, -1).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns the first count elements with [0, count]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 0, 3).should == ["a", "b", "c"]
- end
-
- it "returns the subarray which is independent to self with [index,count]" do
- a = [1, 2, 3]
- sub = a.send(@method, 1,2)
- sub.replace([:a, :b])
- a.should == [1, 2, 3]
- end
-
- it "tries to convert the passed argument to an Integer using #to_int" do
- obj = mock('to_int')
- obj.stub!(:to_int).and_return(2)
-
- a = [1, 2, 3, 4]
- a.send(@method, obj).should == 3
- a.send(@method, obj, 1).should == [3]
- a.send(@method, obj, obj).should == [3, 4]
- a.send(@method, 0, obj).should == [1, 2]
- end
-
- it "returns the elements specified by Range indexes with [m..n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 1..3).should == ["b", "c", "d"]
- [ "a", "b", "c", "d", "e" ].send(@method, 4..-1).should == ['e']
- [ "a", "b", "c", "d", "e" ].send(@method, 3..3).should == ['d']
- [ "a", "b", "c", "d", "e" ].send(@method, 3..-2).should == ['d']
- ['a'].send(@method, 0..-1).should == ['a']
-
- a = [1, 2, 3, 4]
-
- a.send(@method, 0..-10).should == []
- a.send(@method, 0..0).should == [1]
- a.send(@method, 0..1).should == [1, 2]
- a.send(@method, 0..2).should == [1, 2, 3]
- a.send(@method, 0..3).should == [1, 2, 3, 4]
- a.send(@method, 0..4).should == [1, 2, 3, 4]
- a.send(@method, 0..10).should == [1, 2, 3, 4]
-
- a.send(@method, 2..-10).should == []
- a.send(@method, 2..0).should == []
- a.send(@method, 2..2).should == [3]
- a.send(@method, 2..3).should == [3, 4]
- a.send(@method, 2..4).should == [3, 4]
-
- a.send(@method, 3..0).should == []
- a.send(@method, 3..3).should == [4]
- a.send(@method, 3..4).should == [4]
-
- a.send(@method, 4..0).should == []
- a.send(@method, 4..4).should == []
- a.send(@method, 4..5).should == []
-
- a.send(@method, 5..0).should == nil
- a.send(@method, 5..5).should == nil
- a.send(@method, 5..6).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns elements specified by Range indexes except the element at index n with [m...n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 1...3).should == ["b", "c"]
-
- a = [1, 2, 3, 4]
-
- a.send(@method, 0...-10).should == []
- a.send(@method, 0...0).should == []
- a.send(@method, 0...1).should == [1]
- a.send(@method, 0...2).should == [1, 2]
- a.send(@method, 0...3).should == [1, 2, 3]
- a.send(@method, 0...4).should == [1, 2, 3, 4]
- a.send(@method, 0...10).should == [1, 2, 3, 4]
-
- a.send(@method, 2...-10).should == []
- a.send(@method, 2...0).should == []
- a.send(@method, 2...2).should == []
- a.send(@method, 2...3).should == [3]
- a.send(@method, 2...4).should == [3, 4]
-
- a.send(@method, 3...0).should == []
- a.send(@method, 3...3).should == []
- a.send(@method, 3...4).should == [4]
-
- a.send(@method, 4...0).should == []
- a.send(@method, 4...4).should == []
- a.send(@method, 4...5).should == []
-
- a.send(@method, 5...0).should == nil
- a.send(@method, 5...5).should == nil
- a.send(@method, 5...6).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns elements that exist if range start is in the array but range end is not with [m..n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 4..7).should == ["e"]
- end
-
- it "accepts Range instances having a negative m and both signs for n with [m..n] and [m...n]" do
- a = [1, 2, 3, 4]
-
- a.send(@method, -1..-1).should == [4]
- a.send(@method, -1...-1).should == []
- a.send(@method, -1..3).should == [4]
- a.send(@method, -1...3).should == []
- a.send(@method, -1..4).should == [4]
- a.send(@method, -1...4).should == [4]
- a.send(@method, -1..10).should == [4]
- a.send(@method, -1...10).should == [4]
- a.send(@method, -1..0).should == []
- a.send(@method, -1..-4).should == []
- a.send(@method, -1...-4).should == []
- a.send(@method, -1..-6).should == []
- a.send(@method, -1...-6).should == []
-
- a.send(@method, -2..-2).should == [3]
- a.send(@method, -2...-2).should == []
- a.send(@method, -2..-1).should == [3, 4]
- a.send(@method, -2...-1).should == [3]
- a.send(@method, -2..10).should == [3, 4]
- a.send(@method, -2...10).should == [3, 4]
-
- a.send(@method, -4..-4).should == [1]
- a.send(@method, -4..-2).should == [1, 2, 3]
- a.send(@method, -4...-2).should == [1, 2]
- a.send(@method, -4..-1).should == [1, 2, 3, 4]
- a.send(@method, -4...-1).should == [1, 2, 3]
- a.send(@method, -4..3).should == [1, 2, 3, 4]
- a.send(@method, -4...3).should == [1, 2, 3]
- a.send(@method, -4..4).should == [1, 2, 3, 4]
- a.send(@method, -4...4).should == [1, 2, 3, 4]
- a.send(@method, -4...4).should == [1, 2, 3, 4]
- a.send(@method, -4..0).should == [1]
- a.send(@method, -4...0).should == []
- a.send(@method, -4..1).should == [1, 2]
- a.send(@method, -4...1).should == [1]
-
- a.send(@method, -5..-5).should == nil
- a.send(@method, -5...-5).should == nil
- a.send(@method, -5..-4).should == nil
- a.send(@method, -5..-1).should == nil
- a.send(@method, -5..10).should == nil
-
- a.should == [1, 2, 3, 4]
- end
-
- it "returns the subarray which is independent to self with [m..n]" do
- a = [1, 2, 3]
- sub = a.send(@method, 1..2)
- sub.replace([:a, :b])
- a.should == [1, 2, 3]
- end
-
- it "tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]" do
- from = mock('from')
- to = mock('to')
-
- # So we can construct a range out of them...
- def from.<=>(o) 0 end
- def to.<=>(o) 0 end
-
- def from.to_int() 1 end
- def to.to_int() -2 end
-
- a = [1, 2, 3, 4]
-
- a.send(@method, from..to).should == [2, 3]
- a.send(@method, from...to).should == [2]
- a.send(@method, 1..0).should == []
- a.send(@method, 1...0).should == []
-
- lambda { a.send(@method, "a" .. "b") }.should raise_error(TypeError)
- lambda { a.send(@method, "a" ... "b") }.should raise_error(TypeError)
- lambda { a.send(@method, from .. "b") }.should raise_error(TypeError)
- lambda { a.send(@method, from ... "b") }.should raise_error(TypeError)
- end
-
- it "returns the same elements as [m..n] and [m...n] with Range subclasses" do
- a = [1, 2, 3, 4]
- range_incl = ArraySpecs::MyRange.new(1, 2)
- range_excl = ArraySpecs::MyRange.new(-3, -1, true)
-
- a.send(@method, range_incl).should == [2, 3]
- a.send(@method, range_excl).should == [2, 3]
- end
-
- it "returns nil for a requested index not in the array with [index]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 5).should == nil
- end
-
- it "returns [] if the index is valid but length is zero with [index, length]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 0, 0).should == []
- [ "a", "b", "c", "d", "e" ].send(@method, 2, 0).should == []
- end
-
- it "returns nil if length is zero but index is invalid with [index, length]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 100, 0).should == nil
- [ "a", "b", "c", "d", "e" ].send(@method, -50, 0).should == nil
- end
-
- # This is by design. It is in the official documentation.
- it "returns [] if index == array.size with [index, length]" do
- %w|a b c d e|.send(@method, 5, 2).should == []
- end
-
- it "returns nil if index > array.size with [index, length]" do
- %w|a b c d e|.send(@method, 6, 2).should == nil
- end
-
- it "returns nil if length is negative with [index, length]" do
- %w|a b c d e|.send(@method, 3, -1).should == nil
- %w|a b c d e|.send(@method, 2, -2).should == nil
- %w|a b c d e|.send(@method, 1, -100).should == nil
- end
-
- it "returns nil if no requested index is in the array with [m..n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, 6..10).should == nil
- end
-
- it "returns nil if range start is not in the array with [m..n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, -10..2).should == nil
- [ "a", "b", "c", "d", "e" ].send(@method, 10..12).should == nil
- end
-
- it "returns an empty array when m == n with [m...n]" do
- [1, 2, 3, 4, 5].send(@method, 1...1).should == []
- end
-
- it "returns an empty array with [0...0]" do
- [1, 2, 3, 4, 5].send(@method, 0...0).should == []
- end
-
- it "returns a subarray where m, n negatives and m < n with [m..n]" do
- [ "a", "b", "c", "d", "e" ].send(@method, -3..-2).should == ["c", "d"]
- end
-
- it "returns an array containing the first element with [0..0]" do
- [1, 2, 3, 4, 5].send(@method, 0..0).should == [1]
- end
-
- it "returns the entire array with [0..-1]" do
- [1, 2, 3, 4, 5].send(@method, 0..-1).should == [1, 2, 3, 4, 5]
- end
-
- it "returns all but the last element with [0...-1]" do
- [1, 2, 3, 4, 5].send(@method, 0...-1).should == [1, 2, 3, 4]
- end
-
- it "returns [3] for [2..-1] out of [1, 2, 3]" do
- [1,2,3].send(@method, 2..-1).should == [3]
- end
-
- it "returns an empty array when m > n and m, n are positive with [m..n]" do
- [1, 2, 3, 4, 5].send(@method, 3..2).should == []
- end
-
- it "returns an empty array when m > n and m, n are negative with [m..n]" do
- [1, 2, 3, 4, 5].send(@method, -2..-3).should == []
- end
-
- it "does not expand array when the indices are outside of the array bounds" do
- a = [1, 2]
- a.send(@method, 4).should == nil
- a.should == [1, 2]
- a.send(@method, 4, 0).should == nil
- a.should == [1, 2]
- a.send(@method, 6, 1).should == nil
- a.should == [1, 2]
- a.send(@method, 8...8).should == nil
- a.should == [1, 2]
- a.send(@method, 10..10).should == nil
- a.should == [1, 2]
- end
-
- describe "with a subclass of Array" do
- before :each do
- ScratchPad.clear
-
- @array = ArraySpecs::MyArray[1, 2, 3, 4, 5]
- end
-
- it "returns a subclass instance with [n, m]" do
- @array.send(@method, 0, 2).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns a subclass instance with [-n, m]" do
- @array.send(@method, -3, 2).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns a subclass instance with [n..m]" do
- @array.send(@method, 1..3).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns a subclass instance with [n...m]" do
- @array.send(@method, 1...3).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns a subclass instance with [-n..-m]" do
- @array.send(@method, -3..-1).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns a subclass instance with [-n...-m]" do
- @array.send(@method, -3...-1).should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "returns an empty array when m == n with [m...n]" do
- @array.send(@method, 1...1).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "returns an empty array with [0...0]" do
- @array.send(@method, 0...0).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "returns an empty array when m > n and m, n are positive with [m..n]" do
- @array.send(@method, 3..2).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "returns an empty array when m > n and m, n are negative with [m..n]" do
- @array.send(@method, -2..-3).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "returns [] if index == array.size with [index, length]" do
- @array.send(@method, 5, 2).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "returns [] if the index is valid but length is zero with [index, length]" do
- @array.send(@method, 0, 0).should == []
- @array.send(@method, 2, 0).should == []
- ScratchPad.recorded.should be_nil
- end
-
- it "does not call #initialize on the subclass instance" do
- @array.send(@method, 0, 3).should == [1, 2, 3]
- ScratchPad.recorded.should be_nil
- end
- end
-
- it "raises a RangeError when the start index is out of range of Fixnum" do
- array = [1, 2, 3, 4, 5, 6]
- obj = mock('large value')
- obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
- lambda { array.send(@method, obj) }.should raise_error(RangeError)
-
- obj = 8e19
- lambda { array.send(@method, obj) }.should raise_error(RangeError)
- end
-
- it "raises a RangeError when the length is out of range of Fixnum" do
- array = [1, 2, 3, 4, 5, 6]
- obj = mock('large value')
- obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
- lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
-
- obj = 8e19
- lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
- end
-end
diff --git a/spec/ruby/core/array/shared/unshift.rb b/spec/ruby/core/array/shared/unshift.rb
deleted file mode 100644
index 367bab4166..0000000000
--- a/spec/ruby/core/array/shared/unshift.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-describe :array_unshift, shared: true do
- it "prepends object to the original array" do
- a = [1, 2, 3]
- a.send(@method, "a").should equal(a)
- a.should == ['a', 1, 2, 3]
- a.send(@method).should equal(a)
- a.should == ['a', 1, 2, 3]
- a.send(@method, 5, 4, 3)
- a.should == [5, 4, 3, 'a', 1, 2, 3]
-
- # shift all but one element
- a = [1, 2]
- a.shift
- a.send(@method, 3, 4)
- a.should == [3, 4, 2]
-
- # now shift all elements
- a.shift
- a.shift
- a.shift
- a.send(@method, 3, 4)
- a.should == [3, 4]
- end
-
- it "quietly ignores unshifting nothing" do
- [].send(@method).should == []
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.send(@method, :new).should == [:new, empty]
-
- array = ArraySpecs.recursive_array
- array.send(@method, :new)
- array[0..5].should == [:new, 1, 'two', 3.0, array, array]
- end
-
- it "raises a RuntimeError on a frozen array when the array is modified" do
- lambda { ArraySpecs.frozen_array.send(@method, 1) }.should raise_error(RuntimeError)
- end
-
- # see [ruby-core:23666]
- it "raises a RuntimeError on a frozen array when the array would not be modified" do
- lambda { ArraySpecs.frozen_array.send(@method) }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/shift_spec.rb b/spec/ruby/core/array/shift_spec.rb
deleted file mode 100644
index a7b6f58392..0000000000
--- a/spec/ruby/core/array/shift_spec.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#shift" do
- it "removes and returns the first element" do
- a = [5, 1, 1, 5, 4]
- a.shift.should == 5
- a.should == [1, 1, 5, 4]
- a.shift.should == 1
- a.should == [1, 5, 4]
- a.shift.should == 1
- a.should == [5, 4]
- a.shift.should == 5
- a.should == [4]
- a.shift.should == 4
- a.should == []
- end
-
- it "returns nil when the array is empty" do
- [].shift.should == nil
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.shift.should == []
- empty.should == []
-
- array = ArraySpecs.recursive_array
- array.shift.should == 1
- array[0..2].should == ['two', 3.0, array]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.shift }.should raise_error(RuntimeError)
- end
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.shift }.should raise_error(RuntimeError)
- end
-
- describe "passed a number n as an argument" do
- it "removes and returns an array with the first n element of the array" do
- a = [1, 2, 3, 4, 5, 6]
-
- a.shift(0).should == []
- a.should == [1, 2, 3, 4, 5, 6]
-
- a.shift(1).should == [1]
- a.should == [2, 3, 4, 5, 6]
-
- a.shift(2).should == [2, 3]
- a.should == [4, 5, 6]
-
- a.shift(3).should == [4, 5, 6]
- a.should == []
- end
-
- it "does not corrupt the array when shift without arguments is followed by shift with an argument" do
- a = [1, 2, 3, 4, 5]
-
- a.shift.should == 1
- a.shift(3).should == [2, 3, 4]
- a.should == [5]
- end
-
- it "returns a new empty array if there are no more elements" do
- a = []
- popped1 = a.shift(1)
- popped1.should == []
- a.should == []
-
- popped2 = a.shift(2)
- popped2.should == []
- a.should == []
-
- popped1.should_not equal(popped2)
- end
-
- it "returns whole elements if n exceeds size of the array" do
- a = [1, 2, 3, 4, 5]
- a.shift(6).should == [1, 2, 3, 4, 5]
- a.should == []
- end
-
- it "does not return self even when it returns whole elements" do
- a = [1, 2, 3, 4, 5]
- a.shift(5).should_not equal(a)
-
- a = [1, 2, 3, 4, 5]
- a.shift(6).should_not equal(a)
- end
-
- it "raises an ArgumentError if n is negative" do
- lambda{ [1, 2, 3].shift(-1) }.should raise_error(ArgumentError)
- end
-
- it "tries to convert n to an Integer using #to_int" do
- a = [1, 2, 3, 4]
- a.shift(2.3).should == [1, 2]
-
- obj = mock('to_int')
- obj.should_receive(:to_int).and_return(2)
- a.should == [3, 4]
- a.shift(obj).should == [3, 4]
- a.should == []
- end
-
- it "raises a TypeError when the passed n cannot be coerced to Integer" do
- lambda{ [1, 2].shift("cat") }.should raise_error(TypeError)
- lambda{ [1, 2].shift(nil) }.should raise_error(TypeError)
- end
-
- it "raises an ArgumentError if more arguments are passed" do
- lambda{ [1, 2].shift(1, 2) }.should raise_error(ArgumentError)
- end
-
- it "does not return subclass instances with Array subclass" do
- ArraySpecs::MyArray[1, 2, 3].shift(2).should be_an_instance_of(Array)
- end
-
- it "returns an untainted array even if the array is tainted" do
- ary = [1, 2].taint
- ary.shift(2).tainted?.should be_false
- ary.shift(0).tainted?.should be_false
- end
-
- it "keeps taint status" do
- a = [1, 2].taint
- a.shift(2)
- a.tainted?.should be_true
- a.shift(2)
- a.tainted?.should be_true
- end
- end
-end
diff --git a/spec/ruby/core/array/shuffle_spec.rb b/spec/ruby/core/array/shuffle_spec.rb
deleted file mode 100644
index 4c3b820186..0000000000
--- a/spec/ruby/core/array/shuffle_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#shuffle" do
- it "returns the same values, in a usually different order" do
- a = [1, 2, 3, 4]
- different = false
- 10.times do
- s = a.shuffle
- s.sort.should == a
- different ||= (a != s)
- end
- different.should be_true # Will fail once in a blue moon (4!^10)
- end
-
- it "is not destructive" do
- a = [1, 2, 3]
- 10.times do
- a.shuffle
- a.should == [1, 2, 3]
- end
- end
-
- it "does not return subclass instances with Array subclass" do
- ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(Array)
- end
-
- it "attempts coercion via #to_hash" do
- obj = mock('hash')
- obj.should_receive(:to_hash).once.and_return({})
- [2, 3].shuffle(obj)
- end
-
- it "calls #rand on the Object passed by the :random key in the arguments Hash" do
- obj = mock("array_shuffle_random")
- obj.should_receive(:rand).at_least(1).times.and_return(0.5)
-
- result = [1, 2].shuffle(random: obj)
- result.size.should == 2
- result.should include(1, 2)
- end
-
- it "raises a NoMethodError if an object passed for the RNG does not define #rand" do
- obj = BasicObject.new
-
- lambda { [1, 2].shuffle(random: obj) }.should raise_error(NoMethodError)
- end
-
- it "accepts a Float for the value returned by #rand" do
- random = mock("array_shuffle_random")
- random.should_receive(:rand).at_least(1).times.and_return(0.3)
-
- [1, 2].shuffle(random: random).should be_an_instance_of(Array)
- end
-
- it "calls #to_int on the Object returned by #rand" do
- value = mock("array_shuffle_random_value")
- value.should_receive(:to_int).at_least(1).times.and_return(0)
- random = mock("array_shuffle_random")
- random.should_receive(:rand).at_least(1).times.and_return(value)
-
- [1, 2].shuffle(random: random).should be_an_instance_of(Array)
- end
-
- it "raises a RangeError if the value is less than zero" do
- value = mock("array_shuffle_random_value")
- value.should_receive(:to_int).and_return(-1)
- random = mock("array_shuffle_random")
- random.should_receive(:rand).and_return(value)
-
- lambda { [1, 2].shuffle(random: random) }.should raise_error(RangeError)
- end
-
- it "raises a RangeError if the value is equal to one" do
- value = mock("array_shuffle_random_value")
- value.should_receive(:to_int).at_least(1).times.and_return(1)
- random = mock("array_shuffle_random")
- random.should_receive(:rand).at_least(1).times.and_return(value)
-
- lambda { [1, 2].shuffle(random: random) }.should raise_error(RangeError)
- end
-end
-
-describe "Array#shuffle!" do
- it "returns the same values, in a usually different order" do
- a = [1, 2, 3, 4]
- original = a
- different = false
- 10.times do
- a = a.shuffle!
- a.sort.should == [1, 2, 3, 4]
- different ||= (a != [1, 2, 3, 4])
- end
- different.should be_true # Will fail once in a blue moon (4!^10)
- a.should equal(original)
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.shuffle! }.should raise_error(RuntimeError)
- lambda { ArraySpecs.empty_frozen_array.shuffle! }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/size_spec.rb b/spec/ruby/core/array/size_spec.rb
deleted file mode 100644
index 2c8a18ade6..0000000000
--- a/spec/ruby/core/array/size_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/length', __FILE__)
-
-describe "Array#size" do
- it_behaves_like(:array_length, :size)
-end
diff --git a/spec/ruby/core/array/slice_spec.rb b/spec/ruby/core/array/slice_spec.rb
deleted file mode 100644
index f6cbd1bcc4..0000000000
--- a/spec/ruby/core/array/slice_spec.rb
+++ /dev/null
@@ -1,160 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/slice', __FILE__)
-
-describe "Array#slice!" do
- it "removes and return the element at index" do
- a = [1, 2, 3, 4]
- a.slice!(10).should == nil
- a.should == [1, 2, 3, 4]
- a.slice!(-10).should == nil
- a.should == [1, 2, 3, 4]
- a.slice!(2).should == 3
- a.should == [1, 2, 4]
- a.slice!(-1).should == 4
- a.should == [1, 2]
- a.slice!(1).should == 2
- a.should == [1]
- a.slice!(-1).should == 1
- a.should == []
- a.slice!(-1).should == nil
- a.should == []
- a.slice!(0).should == nil
- a.should == []
- end
-
- it "removes and returns length elements beginning at start" do
- a = [1, 2, 3, 4, 5, 6]
- a.slice!(2, 3).should == [3, 4, 5]
- a.should == [1, 2, 6]
- a.slice!(1, 1).should == [2]
- a.should == [1, 6]
- a.slice!(1, 0).should == []
- a.should == [1, 6]
- a.slice!(2, 0).should == []
- a.should == [1, 6]
- a.slice!(0, 4).should == [1, 6]
- a.should == []
- a.slice!(0, 4).should == []
- a.should == []
-
- a = [1]
- a.slice!(0, 1).should == [1]
- a.should == []
- a[-1].should == nil
-
- a = [1, 2, 3]
- a.slice!(0,1).should == [1]
- a.should == [2, 3]
- end
-
- it "returns nil if length is negative" do
- a = [1, 2, 3]
- a.slice!(2, -1).should == nil
- a.should == [1, 2, 3]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.slice(0).should == empty
-
- array = ArraySpecs.recursive_array
- array.slice(4).should == array
- array.slice(0..3).should == [1, 'two', 3.0, array]
- end
-
- it "calls to_int on start and length arguments" do
- obj = mock('2')
- def obj.to_int() 2 end
-
- a = [1, 2, 3, 4, 5]
- a.slice!(obj).should == 3
- a.should == [1, 2, 4, 5]
- a.slice!(obj, obj).should == [4, 5]
- a.should == [1, 2]
- a.slice!(0, obj).should == [1, 2]
- a.should == []
- end
-
- it "removes and return elements in range" do
- a = [1, 2, 3, 4, 5, 6, 7, 8]
- a.slice!(1..4).should == [2, 3, 4, 5]
- a.should == [1, 6, 7, 8]
- a.slice!(1...3).should == [6, 7]
- a.should == [1, 8]
- a.slice!(-1..-1).should == [8]
- a.should == [1]
- a.slice!(0...0).should == []
- a.should == [1]
- a.slice!(0..0).should == [1]
- a.should == []
-
- a = [1,2,3]
- a.slice!(0..3).should == [1,2,3]
- a.should == []
- end
-
- it "removes and returns elements in end-exclusive ranges" do
- a = [1, 2, 3, 4, 5, 6, 7, 8]
- a.slice!(4...a.length).should == [5, 6, 7, 8]
- a.should == [1, 2, 3, 4]
- end
-
- it "calls to_int on range arguments" do
- from = mock('from')
- to = mock('to')
-
- # So we can construct a range out of them...
- def from.<=>(o) 0 end
- def to.<=>(o) 0 end
-
- def from.to_int() 1 end
- def to.to_int() -2 end
-
- a = [1, 2, 3, 4, 5]
-
- a.slice!(from .. to).should == [2, 3, 4]
- a.should == [1, 5]
-
- lambda { a.slice!("a" .. "b") }.should raise_error(TypeError)
- lambda { a.slice!(from .. "b") }.should raise_error(TypeError)
- end
-
- it "returns last element for consecutive calls at zero index" do
- a = [ 1, 2, 3 ]
- a.slice!(0).should == 1
- a.slice!(0).should == 2
- a.slice!(0).should == 3
- a.should == []
- end
-
- it "does not expand array with indices out of bounds" do
- a = [1, 2]
- a.slice!(4).should == nil
- a.should == [1, 2]
- a.slice!(4, 0).should == nil
- a.should == [1, 2]
- a.slice!(6, 1).should == nil
- a.should == [1, 2]
- a.slice!(8...8).should == nil
- a.should == [1, 2]
- a.slice!(10..10).should == nil
- a.should == [1, 2]
- end
-
- it "does not expand array with negative indices out of bounds" do
- a = [1, 2]
- a.slice!(-3, 1).should == nil
- a.should == [1, 2]
- a.slice!(-3..2).should == nil
- a.should == [1, 2]
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.slice!(0, 0) }.should raise_error(RuntimeError)
- end
-end
-
-describe "Array#slice" do
- it_behaves_like(:array_slice, :slice)
-end
diff --git a/spec/ruby/core/array/sort_by_spec.rb b/spec/ruby/core/array/sort_by_spec.rb
deleted file mode 100644
index 9f45f3ef4d..0000000000
--- a/spec/ruby/core/array/sort_by_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
-
-describe "Array#sort_by!" do
- it "sorts array in place by passing each element to the given block" do
- a = [-100, -2, 1, 200, 30000]
- a.sort_by!{ |e| e.to_s.size }
- a.should == [1, -2, 200, -100, 30000]
- end
-
- it "returns an Enumerator if not given a block" do
- (1..10).to_a.sort_by!.should be_an_instance_of(Enumerator)
- end
-
- it "completes when supplied a block that always returns the same result" do
- a = [2, 3, 5, 1, 4]
- a.sort_by!{ 1 }
- a.should be_an_instance_of(Array)
- a.sort_by!{ 0 }
- a.should be_an_instance_of(Array)
- a.sort_by!{ -1 }
- a.should be_an_instance_of(Array)
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.sort_by! {}}.should raise_error(RuntimeError)
- end
-
- it "raises a RuntimeError on an empty frozen array" do
- lambda { ArraySpecs.empty_frozen_array.sort_by! {}}.should raise_error(RuntimeError)
- end
-
- it "returns the specified value when it would break in the given block" do
- [1, 2, 3].sort_by!{ break :a }.should == :a
- end
-
- it "makes some modification even if finished sorting when it would break in the given block" do
- partially_sorted = (1..5).map{|i|
- ary = [5, 4, 3, 2, 1]
- ary.sort_by!{|x,y| break if x==i; x<=>y}
- ary
- }
- partially_sorted.any?{|ary| ary != [1, 2, 3, 4, 5]}.should be_true
- end
-
- it "changes nothing when called on a single element array" do
- [1].sort_by!(&:to_s).should == [1]
- end
-
- it_behaves_like :enumeratorized_with_origin_size, :sort_by!, [1,2,3]
-end
diff --git a/spec/ruby/core/array/sort_spec.rb b/spec/ruby/core/array/sort_spec.rb
deleted file mode 100644
index 0578742175..0000000000
--- a/spec/ruby/core/array/sort_spec.rb
+++ /dev/null
@@ -1,252 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#sort" do
- it "returns a new array sorted based on comparing elements with <=>" do
- a = [1, -2, 3, 9, 1, 5, -5, 1000, -5, 2, -10, 14, 6, 23, 0]
- a.sort.should == [-10, -5, -5, -2, 0, 1, 1, 2, 3, 5, 6, 9, 14, 23, 1000]
- end
-
- it "does not affect the original Array" do
- a = [3, 1, 2]
- a.sort.should == [1, 2, 3]
- a.should == [3, 1, 2]
-
- a = [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
- b = a.sort
- a.should == [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
- b.should == (0..15).to_a
- end
-
- it "sorts already-sorted Arrays" do
- (0..15).to_a.sort.should == (0..15).to_a
- end
-
- it "sorts reverse-sorted Arrays" do
- (0..15).to_a.reverse.sort.should == (0..15).to_a
- end
-
- it "sorts Arrays that consist entirely of equal elements" do
- a = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- a.sort.should == a
- b = Array.new(15).map { ArraySpecs::SortSame.new }
- b.sort.should == b
- end
-
- it "sorts Arrays that consist mostly of equal elements" do
- a = [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- a.sort.should == [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- end
-
- it "does not return self even if the array would be already sorted" do
- a = [1, 2, 3]
- sorted = a.sort
- sorted.should == a
- sorted.should_not equal(a)
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.sort.should == empty
-
- array = [[]]; array << array
- array.sort.should == [[], array]
- end
-
- it "uses #<=> of elements in order to sort" do
- a = ArraySpecs::MockForCompared.new
- b = ArraySpecs::MockForCompared.new
- c = ArraySpecs::MockForCompared.new
-
- ArraySpecs::MockForCompared.compared?.should == false
- [a, b, c].sort.should == [c, b, a]
- ArraySpecs::MockForCompared.compared?.should == true
- end
-
- it "does not deal with exceptions raised by unimplemented or incorrect #<=>" do
- o = Object.new
-
- lambda {
- [o, 1].sort
- }.should raise_error(ArgumentError)
- end
-
- it "may take a block which is used to determine the order of objects a and b described as -1, 0 or +1" do
- a = [5, 1, 4, 3, 2]
- a.sort.should == [1, 2, 3, 4, 5]
- a.sort {|x, y| y <=> x}.should == [5, 4, 3, 2, 1]
- end
-
- it "raises an error when a given block returns nil" do
- lambda { [1, 2].sort {} }.should raise_error(ArgumentError)
- end
-
- it "does not call #<=> on contained objects when invoked with a block" do
- a = Array.new(25)
- (0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
-
- a.sort { -1 }.should be_an_instance_of(Array)
- end
-
- it "does not call #<=> on elements when invoked with a block even if Array is large (Rubinius #412)" do
- a = Array.new(1500)
- (0...1500).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
-
- a.sort { -1 }.should be_an_instance_of(Array)
- end
-
- it "completes when supplied a block that always returns the same result" do
- a = [2, 3, 5, 1, 4]
- a.sort { 1 }.should be_an_instance_of(Array)
- a.sort { 0 }.should be_an_instance_of(Array)
- a.sort { -1 }.should be_an_instance_of(Array)
- end
-
- it "does not freezes self during being sorted" do
- a = [1, 2, 3]
- a.sort { |x,y| a.frozen?.should == false; x <=> y }
- end
-
- it "returns the specified value when it would break in the given block" do
- [1, 2, 3].sort{ break :a }.should == :a
- end
-
- it "uses the sign of Bignum block results as the sort result" do
- a = [1, 2, 5, 10, 7, -4, 12]
- begin
- class Bignum;
- alias old_spaceship <=>
- def <=>(other)
- raise
- end
- end
- a.sort {|n, m| (n - m) * (2 ** 200)}.should == [-4, 1, 2, 5, 7, 10, 12]
- ensure
- class Bignum
- alias <=> old_spaceship
- end
- end
- end
-
- it "compares values returned by block with 0" do
- a = [1, 2, 5, 10, 7, -4, 12]
- a.sort { |n, m| n - m }.should == [-4, 1, 2, 5, 7, 10, 12]
- a.sort { |n, m|
- ArraySpecs::ComparableWithFixnum.new(n-m)
- }.should == [-4, 1, 2, 5, 7, 10, 12]
- lambda {
- a.sort { |n, m| (n - m).to_s }
- }.should raise_error(ArgumentError)
- end
-
- it "sorts an array that has a value shifted off without a block" do
- a = Array.new(20, 1)
- a.shift
- a[0] = 2
- a.sort.last.should == 2
- end
-
- it "sorts an array that has a value shifted off with a block" do
- a = Array.new(20, 1)
- a.shift
- a[0] = 2
- a.sort {|x, y| x <=> y }.last.should == 2
- end
-
- it "raises an error if objects can't be compared" do
- a=[ArraySpecs::Uncomparable.new, ArraySpecs::Uncomparable.new]
- lambda {a.sort}.should raise_error(ArgumentError)
- end
-
- # From a strange Rubinius bug
- it "handles a large array that has been pruned" do
- pruned = ArraySpecs::LargeArray.dup.delete_if { |n| n !~ /^test./ }
- pruned.sort.should == ArraySpecs::LargeTestArraySorted
- end
-
- it "does not return subclass instance on Array subclasses" do
- ary = ArraySpecs::MyArray[1, 2, 3]
- ary.sort.should be_an_instance_of(Array)
- end
-end
-
-describe "Array#sort!" do
- it "sorts array in place using <=>" do
- a = [1, -2, 3, 9, 1, 5, -5, 1000, -5, 2, -10, 14, 6, 23, 0]
- a.sort!
- a.should == [-10, -5, -5, -2, 0, 1, 1, 2, 3, 5, 6, 9, 14, 23, 1000]
- end
-
- it "sorts array in place using block value if a block given" do
- a = [0, 15, 2, 3, 4, 6, 14, 5, 7, 12, 8, 9, 1, 10, 11, 13]
- a.sort! { |x, y| y <=> x }.should == (0..15).to_a.reverse
- end
-
- it "returns self if the order of elements changed" do
- a = [6, 7, 2, 3, 7]
- a.sort!.should equal(a)
- a.should == [2, 3, 6, 7, 7]
- end
-
- it "returns self even if makes no modification" do
- a = [1, 2, 3, 4, 5]
- a.sort!.should equal(a)
- a.should == [1, 2, 3, 4, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.sort!.should == empty
-
- array = [[]]; array << array
- array.sort!.should == array
- end
-
- it "uses #<=> of elements in order to sort" do
- a = ArraySpecs::MockForCompared.new
- b = ArraySpecs::MockForCompared.new
- c = ArraySpecs::MockForCompared.new
-
- ArraySpecs::MockForCompared.compared?.should == false
- [a, b, c].sort!.should == [c, b, a]
- ArraySpecs::MockForCompared.compared?.should == true
- end
-
- it "does not call #<=> on contained objects when invoked with a block" do
- a = Array.new(25)
- (0...25).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
-
- a.sort! { -1 }.should be_an_instance_of(Array)
- end
-
- it "does not call #<=> on elements when invoked with a block even if Array is large (Rubinius #412)" do
- a = Array.new(1500)
- (0...1500).each {|i| a[i] = ArraySpecs::UFOSceptic.new }
-
- a.sort! { -1 }.should be_an_instance_of(Array)
- end
-
- it "completes when supplied a block that always returns the same result" do
- a = [2, 3, 5, 1, 4]
- a.sort!{ 1 }.should be_an_instance_of(Array)
- a.sort!{ 0 }.should be_an_instance_of(Array)
- a.sort!{ -1 }.should be_an_instance_of(Array)
- end
-
- it "raises a RuntimeError on a frozen array" do
- lambda { ArraySpecs.frozen_array.sort! }.should raise_error(RuntimeError)
- end
-
- it "returns the specified value when it would break in the given block" do
- [1, 2, 3].sort{ break :a }.should == :a
- end
-
- it "makes some modification even if finished sorting when it would break in the given block" do
- partially_sorted = (1..5).map{|i|
- ary = [5, 4, 3, 2, 1]
- ary.sort!{|x,y| break if x==i; x<=>y}
- ary
- }
- partially_sorted.any?{|ary| ary != [1, 2, 3, 4, 5]}.should be_true
- end
-end
diff --git a/spec/ruby/core/array/sum_spec.rb b/spec/ruby/core/array/sum_spec.rb
deleted file mode 100644
index 6548655c35..0000000000
--- a/spec/ruby/core/array/sum_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-ruby_version_is '2.4' do
- describe "Array#sum" do
- it "returns the sum of elements" do
- [1, 2, 3].sum.should == 6
- end
-
- it "applies a block to each element before adding if it's given" do
- [1, 2, 3].sum { |i| i * 10 }.should == 60
- end
-
- it "returns init value if array is empty" do
- [].sum(-1).should == -1
- end
-
- it "returns 0 if array is empty and init is omitted" do
- [].sum.should == 0
- end
-
- it "adds init value to the sum of elemens" do
- [1, 2, 3].sum(10).should == 16
- end
-
- it "can be used for non-numeric objects by providing init value" do
- ["a", "b", "c"].sum("").should == "abc"
- end
-
- it 'raises TypeError if any element are not numeric' do
- lambda { ["a"].sum }.should raise_error(TypeError)
- end
-
- it 'raises TypeError if any element cannot be added to init value' do
- lambda { [1].sum([]) }.should raise_error(TypeError)
- end
-
- it "calls + to sum the elements" do
- a = mock("a")
- b = mock("b")
- a.should_receive(:+).with(b).and_return(42)
- [b].sum(a).should == 42
- end
- end
-end
diff --git a/spec/ruby/core/array/take_spec.rb b/spec/ruby/core/array/take_spec.rb
deleted file mode 100644
index 6ba87706cf..0000000000
--- a/spec/ruby/core/array/take_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#take" do
- it "returns the first specified number of elements" do
- [1, 2, 3].take(2).should == [1, 2]
- end
-
- it "returns all elements when the argument is greater than the Array size" do
- [1, 2].take(99).should == [1, 2]
- end
-
- it "returns all elements when the argument is less than the Array size" do
- [1, 2].take(4).should == [1, 2]
- end
-
- it "returns an empty Array when passed zero" do
- [1].take(0).should == []
- end
-
- it "returns an empty Array when called on an empty Array" do
- [].take(3).should == []
- end
-
- it "raises an ArgumentError when the argument is negative" do
- lambda{ [1].take(-3) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/take_while_spec.rb b/spec/ruby/core/array/take_while_spec.rb
deleted file mode 100644
index a97f304490..0000000000
--- a/spec/ruby/core/array/take_while_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Array#take_while" do
- it "returns all elements until the block returns false" do
- [1, 2, 3].take_while{ |element| element < 3 }.should == [1, 2]
- end
-
- it "returns all elements until the block returns nil" do
- [1, 2, nil, 4].take_while{ |element| element }.should == [1, 2]
- end
-
- it "returns all elements until the block returns false" do
- [1, 2, false, 4].take_while{ |element| element }.should == [1, 2]
- end
-end
diff --git a/spec/ruby/core/array/to_a_spec.rb b/spec/ruby/core/array/to_a_spec.rb
deleted file mode 100644
index f3761a275e..0000000000
--- a/spec/ruby/core/array/to_a_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#to_a" do
- it "returns self" do
- a = [1, 2, 3]
- a.to_a.should == [1, 2, 3]
- a.should equal(a.to_a)
- end
-
- it "does not return subclass instance on Array subclasses" do
- e = ArraySpecs::MyArray.new(1, 2)
- e.to_a.should be_an_instance_of(Array)
- e.to_a.should == [1, 2]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.to_a.should == empty
-
- array = ArraySpecs.recursive_array
- array.to_a.should == array
- end
-end
diff --git a/spec/ruby/core/array/to_ary_spec.rb b/spec/ruby/core/array/to_ary_spec.rb
deleted file mode 100644
index ab4dfdb5ed..0000000000
--- a/spec/ruby/core/array/to_ary_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#to_ary" do
- it "returns self" do
- a = [1, 2, 3]
- a.should equal(a.to_ary)
- a = ArraySpecs::MyArray[1, 2, 3]
- a.should equal(a.to_ary)
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.to_ary.should == empty
-
- array = ArraySpecs.recursive_array
- array.to_ary.should == array
- end
-
-end
diff --git a/spec/ruby/core/array/to_h_spec.rb b/spec/ruby/core/array/to_h_spec.rb
deleted file mode 100644
index 17783914aa..0000000000
--- a/spec/ruby/core/array/to_h_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#to_h" do
- it "converts empty array to empty hash" do
- [].to_h.should == {}
- end
-
- it "converts [key, value] pairs to a hash" do
- hash = [[:a, 1], [:b, 2]].to_h
- hash.should == { a: 1, b: 2 }
- end
-
- it "uses the last value of a duplicated key" do
- hash = [[:a, 1], [:b, 2], [:a, 3]].to_h
- hash.should == { a: 3, b: 2 }
- end
-
- it "calls #to_ary on contents" do
- pair = mock('to_ary')
- pair.should_receive(:to_ary).and_return([:b, 2])
- hash = [[:a, 1], pair].to_h
- hash.should == { a: 1, b: 2 }
- end
-
- it "raises TypeError if an element is not an array" do
- lambda { [:x].to_h }.should raise_error(TypeError)
- end
-
- it "raises ArgumentError if an element is not a [key, value] pair" do
- lambda { [[:x]].to_h }.should raise_error(ArgumentError)
- end
-
- it "does not accept arguments" do
- lambda { [].to_h(:a, :b) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/array/to_s_spec.rb b/spec/ruby/core/array/to_s_spec.rb
deleted file mode 100644
index 3a34d5ee0e..0000000000
--- a/spec/ruby/core/array/to_s_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/join', __FILE__)
-require File.expand_path('../shared/inspect', __FILE__)
-
-describe "Array#to_s" do
- it_behaves_like :array_inspect, :to_s
-end
diff --git a/spec/ruby/core/array/transpose_spec.rb b/spec/ruby/core/array/transpose_spec.rb
deleted file mode 100644
index a8edad7bab..0000000000
--- a/spec/ruby/core/array/transpose_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#transpose" do
- it "assumes an array of arrays and returns the result of transposing rows and columns" do
- [[1, 'a'], [2, 'b'], [3, 'c']].transpose.should == [[1, 2, 3], ["a", "b", "c"]]
- [[1, 2, 3], ["a", "b", "c"]].transpose.should == [[1, 'a'], [2, 'b'], [3, 'c']]
- [].transpose.should == []
- [[]].transpose.should == []
- [[], []].transpose.should == []
- [[0]].transpose.should == [[0]]
- [[0], [1]].transpose.should == [[0, 1]]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('[1,2]')
- obj.should_receive(:to_ary).and_return([1, 2])
- [obj, [:a, :b]].transpose.should == [[1, :a], [2, :b]]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.transpose.should == empty
-
- a = []; a << a
- b = []; b << b
- [a, b].transpose.should == [[a, b]]
-
- a = [1]; a << a
- b = [2]; b << b
- [a, b].transpose.should == [ [1, 2], [a, b] ]
- end
-
- it "raises a TypeError if the passed Argument does not respond to #to_ary" do
- lambda { [Object.new, [:a, :b]].transpose }.should raise_error(TypeError)
- end
-
- it "does not call to_ary on array subclass elements" do
- ary = [ArraySpecs::ToAryArray[1, 2], ArraySpecs::ToAryArray[4, 6]]
- ary.transpose.should == [[1, 4], [2, 6]]
- end
-
- it "raises an IndexError if the arrays are not of the same length" do
- lambda { [[1, 2], [:a]].transpose }.should raise_error(IndexError)
- end
-
- it "does not return subclass instance on Array subclasses" do
- result = ArraySpecs::MyArray[ArraySpecs::MyArray[1, 2, 3], ArraySpecs::MyArray[4, 5, 6]].transpose
- result.should be_an_instance_of(Array)
- result[0].should be_an_instance_of(Array)
- result[1].should be_an_instance_of(Array)
- end
-end
diff --git a/spec/ruby/core/array/try_convert_spec.rb b/spec/ruby/core/array/try_convert_spec.rb
deleted file mode 100644
index 5d8f9f100f..0000000000
--- a/spec/ruby/core/array/try_convert_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array.try_convert" do
- it "returns the argument if it's an Array" do
- x = Array.new
- Array.try_convert(x).should equal(x)
- end
-
- it "returns the argument if it's a kind of Array" do
- x = ArraySpecs::MyArray[]
- Array.try_convert(x).should equal(x)
- end
-
- it "returns nil when the argument does not respond to #to_ary" do
- Array.try_convert(Object.new).should be_nil
- end
-
- it "sends #to_ary to the argument and returns the result if it's nil" do
- obj = mock("to_ary")
- obj.should_receive(:to_ary).and_return(nil)
- Array.try_convert(obj).should be_nil
- end
-
- it "sends #to_ary to the argument and returns the result if it's an Array" do
- x = Array.new
- obj = mock("to_ary")
- obj.should_receive(:to_ary).and_return(x)
- Array.try_convert(obj).should equal(x)
- end
-
- it "sends #to_ary to the argument and returns the result if it's a kind of Array" do
- x = ArraySpecs::MyArray[]
- obj = mock("to_ary")
- obj.should_receive(:to_ary).and_return(x)
- Array.try_convert(obj).should equal(x)
- end
-
- it "sends #to_ary to the argument and raises TypeError if it's not a kind of Array" do
- obj = mock("to_ary")
- obj.should_receive(:to_ary).and_return(Object.new)
- lambda { Array.try_convert obj }.should raise_error(TypeError)
- end
-
- it "does not rescue exceptions raised by #to_ary" do
- obj = mock("to_ary")
- obj.should_receive(:to_ary).and_raise(RuntimeError)
- lambda { Array.try_convert obj }.should raise_error(RuntimeError)
- end
-end
diff --git a/spec/ruby/core/array/union_spec.rb b/spec/ruby/core/array/union_spec.rb
deleted file mode 100644
index 58fe23448d..0000000000
--- a/spec/ruby/core/array/union_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#|" do
- it "returns an array of elements that appear in either array (union)" do
- ([] | []).should == []
- ([1, 2] | []).should == [1, 2]
- ([] | [1, 2]).should == [1, 2]
- ([ 1, 2, 3, 4 ] | [ 3, 4, 5 ]).should == [1, 2, 3, 4, 5]
- end
-
- it "creates an array with no duplicates" do
- ([ 1, 2, 3, 1, 4, 5 ] | [ 1, 3, 4, 5, 3, 6 ]).should == [1, 2, 3, 4, 5, 6]
- end
-
- it "creates an array with elements in order they are first encountered" do
- ([ 1, 2, 3, 1 ] | [ 1, 3, 4, 5 ]).should == [1, 2, 3, 4, 5]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- (empty | empty).should == empty
-
- array = ArraySpecs.recursive_array
- (array | []).should == [1, 'two', 3.0, array]
- ([] | array).should == [1, 'two', 3.0, array]
- (array | array).should == [1, 'two', 3.0, array]
- (array | empty).should == [1, 'two', 3.0, array, empty]
- end
-
- it "tries to convert the passed argument to an Array using #to_ary" do
- obj = mock('[1,2,3]')
- obj.should_receive(:to_ary).and_return([1, 2, 3])
- ([0] | obj).should == ([0] | [1, 2, 3])
- end
-
- # MRI follows hashing semantics here, so doesn't actually call eql?/hash for Fixnum/Symbol
- it "acts as if using an intermediate hash to collect values" do
- not_supported_on :opal do
- ([5.0, 4.0] | [5, 4]).should == [5.0, 4.0, 5, 4]
- end
-
- str = "x"
- ([str] | [str.dup]).should == [str]
-
- obj1 = mock('1')
- obj2 = mock('2')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj2.should_receive(:eql?).at_least(1).and_return(true)
-
- ([obj1] | [obj2]).should == [obj1]
- ([obj1, obj1, obj2, obj2] | [obj2]).should == [obj1]
-
- obj1 = mock('3')
- obj2 = mock('4')
- obj1.stub!(:hash).and_return(0)
- obj2.stub!(:hash).and_return(0)
- obj2.should_receive(:eql?).at_least(1).and_return(false)
-
- ([obj1] | [obj2]).should == [obj1, obj2]
- ([obj1, obj1, obj2, obj2] | [obj2]).should == [obj1, obj2]
- end
-
- it "does not return subclass instances for Array subclasses" do
- (ArraySpecs::MyArray[1, 2, 3] | []).should be_an_instance_of(Array)
- (ArraySpecs::MyArray[1, 2, 3] | ArraySpecs::MyArray[1, 2, 3]).should be_an_instance_of(Array)
- ([] | ArraySpecs::MyArray[1, 2, 3]).should be_an_instance_of(Array)
- end
-
- it "does not call to_ary on array subclasses" do
- ([1, 2] | ArraySpecs::ToAryArray[5, 6]).should == [1, 2, 5, 6]
- end
-
- it "properly handles an identical item even when its #eql? isn't reflexive" do
- x = mock('x')
- x.stub!(:hash).and_return(42)
- x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI.
-
- ([x] | [x]).should == [x]
- end
-end
diff --git a/spec/ruby/core/array/uniq_spec.rb b/spec/ruby/core/array/uniq_spec.rb
deleted file mode 100644
index 199b084376..0000000000
--- a/spec/ruby/core/array/uniq_spec.rb
+++ /dev/null
@@ -1,221 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#uniq" do
- it "returns an array with no duplicates" do
- ["a", "a", "b", "b", "c"].uniq.should == ["a", "b", "c"]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.uniq.should == [empty]
-
- array = ArraySpecs.recursive_array
- array.uniq.should == [1, 'two', 3.0, array]
- end
-
- it "uses eql? semantics" do
- [1.0, 1].uniq.should == [1.0, 1]
- end
-
- it "compares elements first with hash" do
- x = mock('0')
- x.should_receive(:hash).at_least(1).and_return(0)
- y = mock('0')
- y.should_receive(:hash).at_least(1).and_return(0)
-
- [x, y].uniq.should == [x, y]
- end
-
- it "does not compare elements with different hash codes via eql?" do
- x = mock('0')
- x.should_not_receive(:eql?)
- y = mock('1')
- y.should_not_receive(:eql?)
-
- x.should_receive(:hash).at_least(1).and_return(0)
- y.should_receive(:hash).at_least(1).and_return(1)
-
- [x, y].uniq.should == [x, y]
- end
-
- it "compares elements with matching hash codes with #eql?" do
- a = Array.new(2) do
- obj = mock('0')
- obj.should_receive(:hash).at_least(1).and_return(0)
-
- def obj.eql?(o)
- # It's undefined whether the impl does a[0].eql?(a[1]) or
- # a[1].eql?(a[0]) so we taint both.
- taint
- o.taint
- false
- end
-
- obj
- end
-
- a.uniq.should == a
- a[0].tainted?.should == true
- a[1].tainted?.should == true
-
- a = Array.new(2) do
- obj = mock('0')
- obj.should_receive(:hash).at_least(1).and_return(0)
-
- def obj.eql?(o)
- # It's undefined whether the impl does a[0].eql?(a[1]) or
- # a[1].eql?(a[0]) so we taint both.
- taint
- o.taint
- true
- end
-
- obj
- end
-
- a.uniq.size.should == 1
- a[0].tainted?.should == true
- a[1].tainted?.should == true
- end
-
- it "compares elements based on the value returned from the block" do
- a = [1, 2, 3, 4]
- a.uniq { |x| x >= 2 ? 1 : 0 }.should == [1, 2]
- end
-
- it "yields items in order" do
- a = [1, 2, 3]
- yielded = []
- a.uniq { |v| yielded << v }
- yielded.should == a
- end
-
- it "handles nil and false like any other values" do
- [nil, false, 42].uniq { :foo }.should == [nil]
- [false, nil, 42].uniq { :bar }.should == [false]
- end
-
- it "returns subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].uniq.should be_an_instance_of(ArraySpecs::MyArray)
- end
-
- it "properly handles an identical item even when its #eql? isn't reflexive" do
- x = mock('x')
- x.should_receive(:hash).at_least(1).and_return(42)
- x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI.
-
- [x, x].uniq.should == [x]
- end
-
- describe "given an array of BasicObject subclasses that define ==, eql?, and hash" do
- # jruby/jruby#3227
- it "filters equivalent elements using those definitions" do
-
- basic = Class.new(BasicObject) do
- attr_reader :x
-
- def initialize(x)
- @x = x
- end
-
- def ==(rhs)
- @x == rhs.x
- end
- alias_method :eql?, :==
-
- def hash
- @x.hash
- end
- end
-
- a = [basic.new(3), basic.new(2), basic.new(1), basic.new(4), basic.new(1), basic.new(2), basic.new(3)]
- a.uniq.should == [basic.new(3), basic.new(2), basic.new(1), basic.new(4)]
- end
- end
-end
-
-describe "Array#uniq!" do
- it "modifies the array in place" do
- a = [ "a", "a", "b", "b", "c" ]
- a.uniq!
- a.should == ["a", "b", "c"]
- end
-
- it "returns self" do
- a = [ "a", "a", "b", "b", "c" ]
- a.should equal(a.uniq!)
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty_dup = empty.dup
- empty.uniq!
- empty.should == empty_dup
-
- array = ArraySpecs.recursive_array
- expected = array[0..3]
- array.uniq!
- array.should == expected
- end
-
- it "compares elements first with hash" do
- x = mock('0')
- x.should_receive(:hash).at_least(1).and_return(0)
- y = mock('0')
- y.should_receive(:hash).at_least(1).and_return(0)
-
- a = [x, y]
- a.uniq!
- a.should == [x, y]
- end
-
- it "does not compare elements with different hash codes via eql?" do
- x = mock('0')
- x.should_not_receive(:eql?)
- y = mock('1')
- y.should_not_receive(:eql?)
-
- x.should_receive(:hash).at_least(1).and_return(0)
- y.should_receive(:hash).at_least(1).and_return(1)
-
- a = [x, y]
- a.uniq!
- a.should == [x, y]
- end
-
- it "returns nil if no changes are made to the array" do
- [ "a", "b", "c" ].uniq!.should == nil
- end
-
- it "raises a RuntimeError on a frozen array when the array is modified" do
- dup_ary = [1, 1, 2]
- dup_ary.freeze
- lambda { dup_ary.uniq! }.should raise_error(RuntimeError)
- end
-
- # see [ruby-core:23666]
- it "raises a RuntimeError on a frozen array when the array would not be modified" do
- lambda { ArraySpecs.frozen_array.uniq!}.should raise_error(RuntimeError)
- lambda { ArraySpecs.empty_frozen_array.uniq!}.should raise_error(RuntimeError)
- end
-
- it "doesn't yield to the block on a frozen array" do
- lambda { ArraySpecs.frozen_array.uniq!{ raise RangeError, "shouldn't yield"}}.should raise_error(RuntimeError)
- end
-
- it "compares elements based on the value returned from the block" do
- a = [1, 2, 3, 4]
- a.uniq! { |x| x >= 2 ? 1 : 0 }.should == [1, 2]
- end
-
- it "properly handles an identical item even when its #eql? isn't reflexive" do
- x = mock('x')
- x.should_receive(:hash).at_least(1).and_return(42)
- x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI.
-
- a = [x, x]
- a.uniq!
- a.should == [x]
- end
-end
diff --git a/spec/ruby/core/array/unshift_spec.rb b/spec/ruby/core/array/unshift_spec.rb
deleted file mode 100644
index eb224acfe8..0000000000
--- a/spec/ruby/core/array/unshift_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/unshift', __FILE__)
-
-describe "Array#unshift" do
- it_behaves_like(:array_unshift, :unshift)
-end
diff --git a/spec/ruby/core/array/values_at_spec.rb b/spec/ruby/core/array/values_at_spec.rb
deleted file mode 100644
index f36356f0d3..0000000000
--- a/spec/ruby/core/array/values_at_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#values_at" do
- it "returns an array of elements at the indexes when passed indexes" do
- [1, 2, 3, 4, 5].values_at().should == []
- [1, 2, 3, 4, 5].values_at(1, 0, 5, -1, -8, 10).should == [2, 1, nil, 5, nil, nil]
- end
-
- it "calls to_int on its indices" do
- obj = mock('1')
- def obj.to_int() 1 end
- [1, 2].values_at(obj, obj, obj).should == [2, 2, 2]
- end
-
- it "properly handles recursive arrays" do
- empty = ArraySpecs.empty_recursive_array
- empty.values_at(0, 1, 2).should == [empty, nil, nil]
-
- array = ArraySpecs.recursive_array
- array.values_at(0, 1, 2, 3).should == [1, 'two', 3.0, array]
- end
-
- describe "when passed ranges" do
- it "returns an array of elements in the ranges" do
- [1, 2, 3, 4, 5].values_at(0..2, 1...3, 2..-2).should == [1, 2, 3, 2, 3, 3, 4]
- [1, 2, 3, 4, 5].values_at(6..4).should == []
- end
-
- it "calls to_int on arguments of ranges" do
- from = mock('from')
- to = mock('to')
-
- # So we can construct a range out of them...
- def from.<=>(o) 0 end
- def to.<=>(o) 0 end
-
- def from.to_int() 1 end
- def to.to_int() -2 end
-
- ary = [1, 2, 3, 4, 5]
- ary.values_at(from .. to, from ... to, to .. from).should == [2, 3, 4, 2, 3]
- end
- end
-
- describe "when passed a range" do
- it "fills with nil if the index is out of the range" do
- [0, 1].values_at(0..3).should == [0, 1, nil, nil]
- [0, 1].values_at(2..4).should == [nil, nil, nil]
- end
-
- describe "on an empty array" do
- it "fills with nils if the index is out of the range" do
- [].values_at(0..2).should == [nil, nil, nil]
- [].values_at(1..3).should == [nil, nil, nil]
- end
- end
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].values_at(0, 1..2, 1).should be_an_instance_of(Array)
- end
-end
diff --git a/spec/ruby/core/array/zip_spec.rb b/spec/ruby/core/array/zip_spec.rb
deleted file mode 100644
index 7aac13536b..0000000000
--- a/spec/ruby/core/array/zip_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Array#zip" do
- it "returns an array of arrays containing corresponding elements of each array" do
- [1, 2, 3, 4].zip(["a", "b", "c", "d", "e"]).should ==
- [[1, "a"], [2, "b"], [3, "c"], [4, "d"]]
- end
-
- it "fills in missing values with nil" do
- [1, 2, 3, 4, 5].zip(["a", "b", "c", "d"]).should ==
- [[1, "a"], [2, "b"], [3, "c"], [4, "d"], [5, nil]]
- end
-
- it "properly handles recursive arrays" do
- a = []; a << a
- b = [1]; b << b
-
- a.zip(a).should == [ [a[0], a[0]] ]
- a.zip(b).should == [ [a[0], b[0]] ]
- b.zip(a).should == [ [b[0], a[0]], [b[1], a[1]] ]
- b.zip(b).should == [ [b[0], b[0]], [b[1], b[1]] ]
- end
-
- it "calls #to_ary to convert the argument to an Array" do
- obj = mock('[3,4]')
- obj.should_receive(:to_ary).and_return([3, 4])
- [1, 2].zip(obj).should == [[1, 3], [2, 4]]
- end
-
- it "uses #each to extract arguments' elements when #to_ary fails" do
- obj = Class.new do
- def each(&b)
- [3,4].each(&b)
- end
- end.new
-
- [1, 2].zip(obj).should == [[1, 3], [2, 4]]
- end
-
- it "stops at own size when given an infinite enumerator" do
- [1, 2].zip(10.upto(Float::INFINITY)).should == [[1, 10], [2, 11]]
- end
-
- it "fills nil when the given enumereator is shorter than self" do
- obj = Object.new
- def obj.each
- yield 10
- end
- [1, 2].zip(obj).should == [[1, 10], [2, nil]]
- end
-
- it "calls block if supplied" do
- values = []
- [1, 2, 3, 4].zip(["a", "b", "c", "d", "e"]) { |value|
- values << value
- }.should == nil
-
- values.should == [[1, "a"], [2, "b"], [3, "c"], [4, "d"]]
- end
-
- it "does not return subclass instance on Array subclasses" do
- ArraySpecs::MyArray[1, 2, 3].zip(["a", "b"]).should be_an_instance_of(Array)
- end
-end
diff --git a/spec/ruby/core/basicobject/__id__spec.rb b/spec/ruby/core/basicobject/__id__spec.rb
deleted file mode 100644
index fba9ed3b34..0000000000
--- a/spec/ruby/core/basicobject/__id__spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../../shared/kernel/object_id', __FILE__)
-
-describe "BasicObject#__id__" do
- it_behaves_like :object_id, :__id__, BasicObject
-end
diff --git a/spec/ruby/core/basicobject/__send___spec.rb b/spec/ruby/core/basicobject/__send___spec.rb
deleted file mode 100644
index f25339fac7..0000000000
--- a/spec/ruby/core/basicobject/__send___spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../../shared/basicobject/send', __FILE__)
-
-describe "BasicObject#__send__" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:__send__)
- end
-
- it_behaves_like(:basicobject_send, :__send__)
-end
diff --git a/spec/ruby/core/basicobject/basicobject_spec.rb b/spec/ruby/core/basicobject/basicobject_spec.rb
deleted file mode 100644
index f58c17a0c0..0000000000
--- a/spec/ruby/core/basicobject/basicobject_spec.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/common', __FILE__)
-
-describe "BasicObject" do
- it "raises NoMethodError for nonexistent methods after #method_missing is removed" do
- script = fixture __FILE__, "remove_method_missing.rb"
- ruby_exe(script).chomp.should == "NoMethodError"
- end
-
- it "raises NameError when referencing built-in constants" do
- lambda { class BasicObjectSpecs::BOSubclass; Kernel; end }.should raise_error(NameError)
- end
-
- it "does not define built-in constants (according to const_defined?)" do
- BasicObject.const_defined?(:Kernel).should be_false
- end
-
- it "does not define built-in constants (according to defined?)" do
- BasicObjectSpecs::BOSubclass.kernel_defined?.should be_nil
- end
-
- it "includes itself in its list of constants" do
- BasicObject.constants.should include(:BasicObject)
- end
-end
-
-describe "BasicObject metaclass" do
- before :each do
- @meta = class << BasicObject; self; end
- end
-
- it "is an instance of Class" do
- @meta.should be_an_instance_of(Class)
- end
-
- it "has Class as superclass" do
- @meta.superclass.should equal(Class)
- end
-
- it "contains methods for the BasicObject class" do
- @meta.class_eval do
- def rubyspec_test_method() :test end
- end
-
- BasicObject.rubyspec_test_method.should == :test
- end
-end
-
-describe "BasicObject instance metaclass" do
- before :each do
- @object = BasicObject.new
- @meta = class << @object; self; end
- end
-
- it "is an instance of Class" do
- @meta.should be_an_instance_of(Class)
- end
-
- it "has BasicObject as superclass" do
- @meta.superclass.should equal(BasicObject)
- end
-
- it "contains methods defined for the BasicObject instance" do
- @meta.class_eval do
- def test_method() :test end
- end
-
- @object.test_method.should == :test
- end
-end
-
-describe "BasicObject subclass" do
- it "contains Kernel methods when including Kernel" do
- obj = BasicObjectSpecs::BOSubclass.new
-
- obj.instance_variable_set(:@test, :value)
- obj.instance_variable_get(:@test).should == :value
-
- obj.respond_to?(:hash).should == true
- end
-
- describe "BasicObject references" do
- it "can refer to BasicObject from within itself" do
- lambda { BasicObject::BasicObject }.should_not raise_error
- end
- end
-end
diff --git a/spec/ruby/core/basicobject/equal_spec.rb b/spec/ruby/core/basicobject/equal_spec.rb
deleted file mode 100644
index 8120df836f..0000000000
--- a/spec/ruby/core/basicobject/equal_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../../shared/kernel/equal', __FILE__)
-
-describe "BasicObject#equal?" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:equal?)
- end
-
- it_behaves_like :object_equal, :equal?
-
- it "is unaffected by overriding __id__" do
- o1 = mock("object")
- o2 = mock("object")
- def o1.__id__; 10; end
- def o2.__id__; 10; end
- o1.equal?(o2).should be_false
- end
-
- it "is unaffected by overriding object_id" do
- o1 = mock("object")
- o1.stub!(:object_id).and_return(10)
- o2 = mock("object")
- o2.stub!(:object_id).and_return(10)
- o1.equal?(o2).should be_false
- end
-
- it "is unaffected by overriding ==" do
- # different objects, overriding == to return true
- o1 = mock("object")
- o1.stub!(:==).and_return(true)
- o2 = mock("object")
- o1.equal?(o2).should be_false
-
- # same objects, overriding == to return false
- o3 = mock("object")
- o3.stub!(:==).and_return(false)
- o3.equal?(o3).should be_true
- end
-
- it "is unaffected by overriding eql?" do
- # different objects, overriding eql? to return true
- o1 = mock("object")
- o1.stub!(:eql?).and_return(true)
- o2 = mock("object")
- o1.equal?(o2).should be_false
-
- # same objects, overriding eql? to return false
- o3 = mock("object")
- o3.stub!(:eql?).and_return(false)
- o3.equal?(o3).should be_true
- end
-end
diff --git a/spec/ruby/core/basicobject/equal_value_spec.rb b/spec/ruby/core/basicobject/equal_value_spec.rb
deleted file mode 100644
index 7d67634884..0000000000
--- a/spec/ruby/core/basicobject/equal_value_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../../shared/kernel/equal', __FILE__)
-
-describe "BasicObject#==" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:==)
- end
-
- it_behaves_like :object_equal, :==
-end
diff --git a/spec/ruby/core/basicobject/fixtures/classes.rb b/spec/ruby/core/basicobject/fixtures/classes.rb
deleted file mode 100644
index d1785afe31..0000000000
--- a/spec/ruby/core/basicobject/fixtures/classes.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module BasicObjectSpecs
- class IVars
- def initialize
- @secret = 99
- end
- end
-
- module InstExec
- def self.included(base)
- base.instance_exec { @@count = 2 }
- end
- end
-
- module InstExecIncluded
- include InstExec
- end
-
- module InstEvalCVar
- instance_eval { @@count = 2 }
- end
-
- class InstEvalConst
- INST_EVAL_CONST_X = 2
- end
-
- module InstEvalOuter
- module Inner
- obj = InstEvalConst.new
- X_BY_STR = obj.instance_eval("INST_EVAL_CONST_X") rescue nil
- X_BY_BLOCK = obj.instance_eval { INST_EVAL_CONST_X } rescue nil
- end
- end
-end
diff --git a/spec/ruby/core/basicobject/fixtures/common.rb b/spec/ruby/core/basicobject/fixtures/common.rb
deleted file mode 100644
index 3447a3a5e7..0000000000
--- a/spec/ruby/core/basicobject/fixtures/common.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module BasicObjectSpecs
- class BOSubclass < BasicObject
- def self.kernel_defined?
- defined?(Kernel)
- end
-
- include ::Kernel
- end
-end
diff --git a/spec/ruby/core/basicobject/fixtures/remove_method_missing.rb b/spec/ruby/core/basicobject/fixtures/remove_method_missing.rb
deleted file mode 100644
index 095b982d3a..0000000000
--- a/spec/ruby/core/basicobject/fixtures/remove_method_missing.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class BasicObject
- remove_method :method_missing
-end
-
-begin
- Object.new.test_method
-rescue NoMethodError => e
- puts e.class.name
-end
diff --git a/spec/ruby/core/basicobject/fixtures/singleton_method.rb b/spec/ruby/core/basicobject/fixtures/singleton_method.rb
deleted file mode 100644
index 0e00e035fa..0000000000
--- a/spec/ruby/core/basicobject/fixtures/singleton_method.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module BasicObjectSpecs
- class SingletonMethod
- def self.singleton_method_added name
- ScratchPad.record [:singleton_method_added, name]
- end
-
- def self.singleton_method_to_alias
- end
- end
-end
diff --git a/spec/ruby/core/basicobject/initialize_spec.rb b/spec/ruby/core/basicobject/initialize_spec.rb
deleted file mode 100644
index 7e6680df61..0000000000
--- a/spec/ruby/core/basicobject/initialize_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "BasicObject#initialize" do
- it "is a private instance method" do
- BasicObject.should have_private_instance_method(:initialize)
- end
-
- it "does not accept arguments" do
- lambda {
- BasicObject.new("This", "makes it easier", "to call super", "from other constructors")
- }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/basicobject/instance_eval_spec.rb b/spec/ruby/core/basicobject/instance_eval_spec.rb
deleted file mode 100644
index 3898e96b8b..0000000000
--- a/spec/ruby/core/basicobject/instance_eval_spec.rb
+++ /dev/null
@@ -1,180 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "BasicObject#instance_eval" do
- before :each do
- ScratchPad.clear
- end
-
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:instance_eval)
- end
-
- it "sets self to the receiver in the context of the passed block" do
- a = BasicObject.new
- a.instance_eval { self }.equal?(a).should be_true
- end
-
- it "evaluates strings" do
- a = BasicObject.new
- a.instance_eval('self').equal?(a).should be_true
- end
-
- it "expects a block with no arguments" do
- lambda { "hola".instance_eval }.should raise_error(ArgumentError)
- end
-
- it "takes no arguments with a block" do
- lambda { "hola".instance_eval(4, 5) {|a,b| a + b } }.should raise_error(ArgumentError)
- end
-
- it "yields the object to the block" do
- "hola".instance_eval {|o| ScratchPad.record o }
- ScratchPad.recorded.should == "hola"
- end
-
- it "returns the result of the block" do
- "hola".instance_eval { :result }.should == :result
- end
-
- it "only binds the eval to the receiver" do
- f = Object.new
- f.instance_eval do
- def foo
- 1
- end
- end
- f.foo.should == 1
- lambda { Object.new.foo }.should raise_error(NoMethodError)
- end
-
- it "preserves self in the original block when passed a block argument" do
- prc = proc { self }
-
- old_self = prc.call
-
- new_self = Object.new
- new_self.instance_eval(&prc).should == new_self
-
- prc.call.should == old_self
- end
-
- # TODO: This should probably be replaced with a "should behave like" that uses
- # the many scoping/binding specs from kernel/eval_spec, since most of those
- # behaviors are the same for instance_eval. See also module_eval/class_eval.
-
- it "binds self to the receiver" do
- s = "hola"
- (s == s.instance_eval { self }).should be_true
- o = mock('o')
- (o == o.instance_eval("self")).should be_true
- end
-
- it "executes in the context of the receiver" do
- "Ruby-fu".instance_eval { size }.should == 7
- "hola".instance_eval("size").should == 4
- Object.class_eval { "hola".instance_eval("to_s") }.should == "hola"
- Object.class_eval { "Ruby-fu".instance_eval{ to_s } }.should == "Ruby-fu"
-
- end
-
- it "has access to receiver's instance variables" do
- BasicObjectSpecs::IVars.new.instance_eval { @secret }.should == 99
- BasicObjectSpecs::IVars.new.instance_eval("@secret").should == 99
- end
-
- it "treats block-local variables as local to the block" do
- prc = instance_eval <<-CODE
- proc do |x, prc|
- if x
- n = 2
- else
- n = 1
- prc.call(true, prc)
- n
- end
- end
- CODE
-
- prc.call(false, prc).should == 1
- end
-
- it "sets class variables in the receiver" do
- BasicObjectSpecs::InstEvalCVar.class_variables.should include(:@@count)
- BasicObjectSpecs::InstEvalCVar.send(:class_variable_get, :@@count).should == 2
- end
-
- it "makes the receiver metaclass the scoped class when used with a string" do
- obj = Object.new
- obj.instance_eval %{
- class B; end
- B
- }
- obj.singleton_class.const_get(:B).should be_an_instance_of(Class)
- end
-
- it "gets constants in the receiver if a string given" do
- BasicObjectSpecs::InstEvalOuter::Inner::X_BY_STR.should == 2
- end
-
- it "doesn't get constants in the receiver if a block given" do
- BasicObjectSpecs::InstEvalOuter::Inner::X_BY_BLOCK.should be_nil
- end
-
- it "raises a TypeError when defining methods on an immediate" do
- lambda do
- 1.instance_eval { def foo; end }
- end.should raise_error(TypeError)
- lambda do
- :foo.instance_eval { def foo; end }
- end.should raise_error(TypeError)
- end
-
-quarantine! do # Not clean, leaves cvars lying around to break other specs
- it "scopes class var accesses in the caller when called on a Fixnum" do
- # Fixnum can take instance vars
- Fixnum.class_eval "@@__tmp_instance_eval_spec = 1"
- (defined? @@__tmp_instance_eval_spec).should be_nil
-
- @@__tmp_instance_eval_spec = 2
- 1.instance_eval { @@__tmp_instance_eval_spec }.should == 2
- Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_eval_spec)
- end
-end
-
- it "raises a TypeError when defining methods on numerics" do
- lambda do
- (1.0).instance_eval { def foo; end }
- end.should raise_error(TypeError)
- lambda do
- (1 << 64).instance_eval { def foo; end }
- end.should raise_error(TypeError)
- end
-
- it "evaluates procs originating from methods" do
- def meth(arg); arg; end
-
- m = method(:meth)
- obj = Object.new
-
- obj.instance_eval(&m).should == obj
- end
-
- it "evaluates string with given filename and linenumber" do
- err = begin
- Object.new.instance_eval("raise", "a_file", 10)
- rescue => e
- e
- end
- err.backtrace.first.split(":")[0..1].should == ["a_file", "10"]
- end
-
- it "evaluates string with given filename and negative linenumber" do
- err = begin
- Object.new.instance_eval("\n\nraise\n", "b_file", -100)
- rescue => e
- e
- end
- err.backtrace.first.split(":")[0..1].should == ["b_file", "-98"]
- end
-end
diff --git a/spec/ruby/core/basicobject/instance_exec_spec.rb b/spec/ruby/core/basicobject/instance_exec_spec.rb
deleted file mode 100644
index f41af6f64f..0000000000
--- a/spec/ruby/core/basicobject/instance_exec_spec.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "BasicObject#instance_exec" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:instance_exec)
- end
-
- it "sets self to the receiver in the context of the passed block" do
- a = BasicObject.new
- a.instance_exec { self }.equal?(a).should be_true
- end
-
- it "passes arguments to the block" do
- a = BasicObject.new
- a.instance_exec(1) { |b| b }.should equal(1)
- end
-
- it "raises a LocalJumpError unless given a block" do
- lambda { "hola".instance_exec }.should raise_error(LocalJumpError)
- end
-
- it "has an arity of -1" do
- Object.new.method(:instance_exec).arity.should == -1
- end
-
- it "accepts arguments with a block" do
- lambda { "hola".instance_exec(4, 5) { |a,b| a + b } }.should_not raise_error
- end
-
- it "doesn't pass self to the block as an argument" do
- "hola".instance_exec { |o| o }.should be_nil
- end
-
- it "passes any arguments to the block" do
- Object.new.instance_exec(1,2) {|one, two| one + two}.should == 3
- end
-
- it "only binds the exec to the receiver" do
- f = Object.new
- f.instance_exec do
- def foo
- 1
- end
- end
- f.foo.should == 1
- lambda { Object.new.foo }.should raise_error(NoMethodError)
- end
-
- # TODO: This should probably be replaced with a "should behave like" that uses
- # the many scoping/binding specs from kernel/eval_spec, since most of those
- # behaviors are the same for instance_exec. See also module_eval/class_eval.
-
- it "binds self to the receiver" do
- s = "hola"
- (s == s.instance_exec { self }).should == true
- end
-
- it "binds the block's binding self to the receiver" do
- s = "hola"
- (s == s.instance_exec { eval "self", binding }).should == true
- end
-
- it "executes in the context of the receiver" do
- "Ruby-fu".instance_exec { size }.should == 7
- Object.class_eval { "Ruby-fu".instance_exec{ to_s } }.should == "Ruby-fu"
- end
-
- it "has access to receiver's instance variables" do
- BasicObjectSpecs::IVars.new.instance_exec { @secret }.should == 99
- end
-
- it "sets class variables in the receiver" do
- BasicObjectSpecs::InstExec.class_variables.should include(:@@count)
- BasicObjectSpecs::InstExec.send(:class_variable_get, :@@count).should == 2
- end
-
- it "raises a TypeError when defining methods on an immediate" do
- lambda do
- 1.instance_exec { def foo; end }
- end.should raise_error(TypeError)
- lambda do
- :foo.instance_exec { def foo; end }
- end.should raise_error(TypeError)
- end
-
-quarantine! do # Not clean, leaves cvars lying around to break other specs
- it "scopes class var accesses in the caller when called on a Fixnum" do
- # Fixnum can take instance vars
- Fixnum.class_eval "@@__tmp_instance_exec_spec = 1"
- (defined? @@__tmp_instance_exec_spec).should == nil
-
- @@__tmp_instance_exec_spec = 2
- 1.instance_exec { @@__tmp_instance_exec_spec }.should == 2
- Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_exec_spec)
- end
-end
-
- it "raises a TypeError when defining methods on numerics" do
- lambda do
- (1.0).instance_exec { def foo; end }
- end.should raise_error(TypeError)
- lambda do
- (1 << 64).instance_exec { def foo; end }
- end.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/basicobject/method_missing_spec.rb b/spec/ruby/core/basicobject/method_missing_spec.rb
deleted file mode 100644
index eea45a8ddc..0000000000
--- a/spec/ruby/core/basicobject/method_missing_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require File.expand_path('../../../shared/basicobject/method_missing', __FILE__)
-
-describe "BasicObject#method_missing" do
- it "is a private method" do
- BasicObject.should have_private_instance_method(:method_missing)
- end
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_class, nil, BasicObject
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_instance, nil, BasicObject
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_defined_module, nil, KernelSpecs::ModuleMM
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_module, nil, KernelSpecs::ModuleNoMM
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_defined_class, nil, KernelSpecs::ClassMM
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_class, nil, KernelSpecs::ClassNoMM
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_defined_instance, nil, KernelSpecs::ClassMM
-end
-
-describe "BasicObject#method_missing" do
- it_behaves_like :method_missing_instance, nil, KernelSpecs::ClassNoMM
-end
diff --git a/spec/ruby/core/basicobject/not_equal_spec.rb b/spec/ruby/core/basicobject/not_equal_spec.rb
deleted file mode 100644
index 9177380154..0000000000
--- a/spec/ruby/core/basicobject/not_equal_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "BasicObject#!=" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:'!=')
- end
-
- it "returns true if other is not identical to self" do
- a = BasicObject.new
- b = BasicObject.new
- (a != b).should be_true
- end
-
- it "returns true if other is an Object" do
- a = BasicObject.new
- b = Object.new
- (a != b).should be_true
- end
-
- it "returns false if other is identical to self" do
- a = BasicObject.new
- (a != a).should be_false
- end
-
- it "dispatches to #==" do
- a = mock("not_equal")
- b = BasicObject.new
- a.should_receive(:==).and_return(true)
-
- (a != b).should be_false
- end
-
- describe "when invoked using Kernel#send" do
- it "returns true if other is not identical to self" do
- a = Object.new
- b = Object.new
- a.send(:!=, b).should be_true
- end
-
- it "returns false if other is identical to self" do
- a = Object.new
- a.send(:!=, a).should be_false
- end
-
- it "dispatches to #==" do
- a = mock("not_equal")
- b = Object.new
- a.should_receive(:==).and_return(true)
-
- a.send(:!=, b).should be_false
- end
- end
-end
diff --git a/spec/ruby/core/basicobject/not_spec.rb b/spec/ruby/core/basicobject/not_spec.rb
deleted file mode 100644
index f02b31edb2..0000000000
--- a/spec/ruby/core/basicobject/not_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "BasicObject#!" do
- it "is a public instance method" do
- BasicObject.should have_public_instance_method(:'!')
- end
-
- it "returns false" do
- (!BasicObject.new).should be_false
- end
-end
diff --git a/spec/ruby/core/basicobject/singleton_method_added_spec.rb b/spec/ruby/core/basicobject/singleton_method_added_spec.rb
deleted file mode 100644
index 7622798dee..0000000000
--- a/spec/ruby/core/basicobject/singleton_method_added_spec.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/singleton_method', __FILE__)
-
-describe "BasicObject#singleton_method_added" do
- before :each do
- ScratchPad.clear
- end
-
- it "is a private method" do
- BasicObject.should have_private_instance_method(:singleton_method_added)
- end
-
- it "is called when a singleton method is defined on an object" do
- obj = BasicObject.new
-
- def obj.singleton_method_added(name)
- ScratchPad.record [:singleton_method_added, name]
- end
-
- def obj.new_singleton_method
- end
-
- ScratchPad.recorded.should == [:singleton_method_added, :new_singleton_method]
- end
-
- it "is not called for instance methods" do
- ScratchPad.record []
-
- Module.new do
- def self.singleton_method_added(name)
- ScratchPad << name
- end
-
- def new_instance_method
- end
- end
-
- ScratchPad.recorded.should_not include(:new_instance_method)
- end
-
- it "is called when a singleton method is defined on a module" do
- class BasicObjectSpecs::SingletonMethod
- def self.new_method_on_self
- end
- end
- ScratchPad.recorded.should == [:singleton_method_added, :new_method_on_self]
- end
-
- it "is called when a method is defined in the singleton class" do
- class BasicObjectSpecs::SingletonMethod
- class << self
- def new_method_on_singleton
- end
- end
- end
- ScratchPad.recorded.should == [:singleton_method_added, :new_method_on_singleton]
- end
-
- it "is called when a method is defined with alias_method in the singleton class" do
- class BasicObjectSpecs::SingletonMethod
- class << self
- alias_method :new_method_on_singleton_with_alias_method, :singleton_method_to_alias
- end
- end
- ScratchPad.recorded.should == [:singleton_method_added, :new_method_on_singleton_with_alias_method]
- end
-
- it "is called when a method is defined with syntax alias in the singleton class" do
- class BasicObjectSpecs::SingletonMethod
- class << self
- alias new_method_on_singleton_with_syntax_alias singleton_method_to_alias
- end
- end
- ScratchPad.recorded.should == [:singleton_method_added, :new_method_on_singleton_with_syntax_alias]
- end
-
- it "is called when define_method is used in the singleton class" do
- class BasicObjectSpecs::SingletonMethod
- class << self
- define_method :new_method_with_define_method do
- end
- end
- end
- ScratchPad.recorded.should == [:singleton_method_added, :new_method_with_define_method]
- end
-end
diff --git a/spec/ruby/core/basicobject/singleton_method_removed_spec.rb b/spec/ruby/core/basicobject/singleton_method_removed_spec.rb
deleted file mode 100644
index 406f4a888e..0000000000
--- a/spec/ruby/core/basicobject/singleton_method_removed_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "BasicObject#singleton_method_removed" do
- before :each do
- ScratchPad.clear
- end
-
- it "is a private method" do
- BasicObject.should have_private_instance_method(:singleton_method_removed)
- end
-
- it "is called when a method is removed on self" do
- klass = Class.new
- def klass.singleton_method_removed(name)
- ScratchPad.record [:singleton_method_removed, name]
- end
- def klass.singleton_method_to_remove
- end
- class << klass
- remove_method :singleton_method_to_remove
- end
- ScratchPad.recorded.should == [:singleton_method_removed, :singleton_method_to_remove]
- end
-end
diff --git a/spec/ruby/core/basicobject/singleton_method_undefined_spec.rb b/spec/ruby/core/basicobject/singleton_method_undefined_spec.rb
deleted file mode 100644
index 4f33cc5dbe..0000000000
--- a/spec/ruby/core/basicobject/singleton_method_undefined_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "BasicObject#singleton_method_undefined" do
- before :each do
- ScratchPad.clear
- end
-
- it "is a private method" do
- BasicObject.should have_private_instance_method(:singleton_method_undefined)
- end
-
- it "is called when a method is removed on self" do
- klass = Class.new
- def klass.singleton_method_undefined(name)
- ScratchPad.record [:singleton_method_undefined, name]
- end
- def klass.singleton_method_to_undefine
- end
- class << klass
- undef_method :singleton_method_to_undefine
- end
- ScratchPad.recorded.should == [:singleton_method_undefined, :singleton_method_to_undefine]
- end
-end
diff --git a/spec/ruby/core/bignum/abs_spec.rb b/spec/ruby/core/bignum/abs_spec.rb
deleted file mode 100644
index b551dd95ad..0000000000
--- a/spec/ruby/core/bignum/abs_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/abs', __FILE__)
-
-describe "Bignum#abs" do
- it_behaves_like(:bignum_abs, :abs)
-end
-
diff --git a/spec/ruby/core/bignum/bignum_spec.rb b/spec/ruby/core/bignum/bignum_spec.rb
deleted file mode 100644
index 3df43aec2d..0000000000
--- a/spec/ruby/core/bignum/bignum_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum" do
- it "includes Comparable" do
- Bignum.include?(Comparable).should == true
- end
-
- it ".allocate raises a TypeError" do
- lambda do
- Bignum.allocate
- end.should raise_error(TypeError)
- end
-
- it ".new is undefined" do
- lambda do
- Bignum.new
- end.should raise_error(NoMethodError)
- end
-
- ruby_version_is '2.4' do
- it "unified into Integer" do
- Bignum.should equal(Integer)
- end
-
- it "is deprecated" do
- -> {
- Bignum
- }.should complain(/constant ::Bignum is deprecated/)
- end
- end
-end
diff --git a/spec/ruby/core/bignum/bit_and_spec.rb b/spec/ruby/core/bignum/bit_and_spec.rb
deleted file mode 100644
index 4bc5c11e1b..0000000000
--- a/spec/ruby/core/bignum/bit_and_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#&" do
- before :each do
- @bignum = bignum_value(5)
- end
-
- it "returns self bitwise AND other" do
- @bignum = bignum_value(5)
- (@bignum & 3).should == 1
- (@bignum & 52).should == 4
- (@bignum & bignum_value(9921)).should == 9223372036854775809
-
- ((2*bignum_value) & 1).should == 0
- ((2*bignum_value) & (2*bignum_value)).should == 18446744073709551616
- end
-
- it "returns self bitwise AND other when one operand is negative" do
- ((2*bignum_value) & -1).should == (2*bignum_value)
- ((4*bignum_value) & -1).should == (4*bignum_value)
- (@bignum & -0xffffffffffffff5).should == 9223372036854775809
- (@bignum & -@bignum).should == 1
- (@bignum & -0x8000000000000000).should == 9223372036854775808
- end
-
- it "returns self bitwise AND other when both operands are negative" do
- (-@bignum & -0x4000000000000005).should == -13835058055282163717
- (-@bignum & -@bignum).should == -9223372036854775813
- (-@bignum & -0x4000000000000000).should == -13835058055282163712
- end
-
- it "returns self bitwise AND other when both are negative and a multiple in bitsize of Fixnum::MIN" do
- val = - ((1 << 93) - 1)
- (val & val).should == val
-
- val = - ((1 << 126) - 1)
- (val & val).should == val
- end
-
- it "raises a TypeError when passed a Float" do
- lambda { (@bignum & 3.4) }.should raise_error(TypeError)
- end
-
- it "raises a TypeError and does not call #to_int when defined on an object" do
- obj = mock("bignum bit and")
- obj.should_not_receive(:to_int)
-
- lambda { @bignum & obj }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/bit_length_spec.rb b/spec/ruby/core/bignum/bit_length_spec.rb
deleted file mode 100644
index 1c4c518345..0000000000
--- a/spec/ruby/core/bignum/bit_length_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#bit_length" do
- it "returns the position of the leftmost bit of a positive number" do
- (2**1000-1).bit_length.should == 1000
- (2**1000).bit_length.should == 1001
- (2**1000+1).bit_length.should == 1001
-
- (2**10000-1).bit_length.should == 10000
- (2**10000).bit_length.should == 10001
- (2**10000+1).bit_length.should == 10001
-
- (1 << 100).bit_length.should == 101
- (1 << 100).succ.bit_length.should == 101
- (1 << 100).pred.bit_length.should == 100
- (1 << 10000).bit_length.should == 10001
- end
-
- it "returns the position of the leftmost 0 bit of a negative number" do
- (-2**10000-1).bit_length.should == 10001
- (-2**10000).bit_length.should == 10000
- (-2**10000+1).bit_length.should == 10000
-
- (-2**1000-1).bit_length.should == 1001
- (-2**1000).bit_length.should == 1000
- (-2**1000+1).bit_length.should == 1000
-
- ((-1 << 100)-1).bit_length.should == 101
- ((-1 << 100)-1).succ.bit_length.should == 100
- ((-1 << 100)-1).pred.bit_length.should == 101
- ((-1 << 10000)-1).bit_length.should == 10001
- end
-end
diff --git a/spec/ruby/core/bignum/bit_or_spec.rb b/spec/ruby/core/bignum/bit_or_spec.rb
deleted file mode 100644
index 6bcb6ead6b..0000000000
--- a/spec/ruby/core/bignum/bit_or_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#|" do
- before :each do
- @bignum = bignum_value(11)
- end
-
- it "returns self bitwise OR other" do
- (@bignum | 2).should == 9223372036854775819
- (@bignum | 9).should == 9223372036854775819
- (@bignum | bignum_value).should == 9223372036854775819
- end
-
- it "returns self bitwise OR other when one operand is negative" do
- (@bignum | -0x40000000000000000).should == -64563604257983430645
- (@bignum | -@bignum).should == -1
- (@bignum | -0x8000000000000000).should == -9223372036854775797
- end
-
- it "returns self bitwise OR other when both operands are negative" do
- (-@bignum | -0x4000000000000005).should == -1
- (-@bignum | -@bignum).should == -9223372036854775819
- (-@bignum | -0x4000000000000000).should == -11
- end
-
- it "raises a TypeError when passed a Float" do
- not_supported_on :opal do
- lambda {
- bignum_value | bignum_value(0xffff).to_f
- }.should raise_error(TypeError)
- end
- lambda { @bignum | 9.9 }.should raise_error(TypeError)
- end
-
- it "raises a TypeError and does not call #to_int when defined on an object" do
- obj = mock("bignum bit or")
- obj.should_not_receive(:to_int)
-
- lambda { @bignum | obj }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/bit_xor_spec.rb b/spec/ruby/core/bignum/bit_xor_spec.rb
deleted file mode 100644
index ef4b4e6ae3..0000000000
--- a/spec/ruby/core/bignum/bit_xor_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#^" do
- before :each do
- @bignum = bignum_value(18)
- end
-
- it "returns self bitwise EXCLUSIVE OR other" do
- (@bignum ^ 2).should == 9223372036854775824
- (@bignum ^ @bignum).should == 0
- (@bignum ^ 14).should == 9223372036854775836
- end
-
- it "returns self bitwise EXCLUSIVE OR other when one operand is negative" do
- (@bignum ^ -0x40000000000000000).should == -64563604257983430638
- (@bignum ^ -@bignum).should == -4
- (@bignum ^ -0x8000000000000000).should == -18446744073709551598
- end
-
- it "returns self bitwise EXCLUSIVE OR other when both operands are negative" do
- (-@bignum ^ -0x40000000000000000).should == 64563604257983430638
- (-@bignum ^ -@bignum).should == 0
- (-@bignum ^ -0x4000000000000000).should == 13835058055282163694
- end
-
- it "returns self bitwise EXCLUSIVE OR other when all bits are 1 and other value is negative" do
- (9903520314283042199192993791 ^ -1).should == -9903520314283042199192993792
- (784637716923335095479473677900958302012794430558004314111 ^ -1).should ==
- -784637716923335095479473677900958302012794430558004314112
- end
-
- it "raises a TypeError when passed a Float" do
- not_supported_on :opal do
- lambda {
- bignum_value ^ bignum_value(0xffff).to_f
- }.should raise_error(TypeError)
- end
- lambda { @bignum ^ 14.5 }.should raise_error(TypeError)
- end
-
- it "raises a TypeError and does not call #to_int when defined on an object" do
- obj = mock("bignum bit xor")
- obj.should_not_receive(:to_int)
-
- lambda { @bignum ^ obj }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/case_compare_spec.rb b/spec/ruby/core/bignum/case_compare_spec.rb
deleted file mode 100644
index d7e0a89487..0000000000
--- a/spec/ruby/core/bignum/case_compare_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/equal', __FILE__)
-
-describe "Bignum#===" do
- it_behaves_like :bignum_equal, :===
-end
diff --git a/spec/ruby/core/bignum/coerce_spec.rb b/spec/ruby/core/bignum/coerce_spec.rb
deleted file mode 100644
index 40decaf51a..0000000000
--- a/spec/ruby/core/bignum/coerce_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#coerce" do
- it "coerces other to a Bignum and returns [other, self] when passed a Fixnum" do
- a = bignum_value
- ary = a.coerce(2)
-
- ary[0].should be_kind_of(Bignum)
- ary[1].should be_kind_of(Bignum)
- ary.should == [2, a]
- end
-
- it "returns [other, self] when passed a Bignum" do
- a = bignum_value
- b = bignum_value
- ary = a.coerce(b)
-
- ary[0].should be_kind_of(Bignum)
- ary[1].should be_kind_of(Bignum)
- ary.should == [b, a]
- end
-
- it "raises a TypeError when not passed a Fixnum or Bignum" do
- a = bignum_value
-
- lambda { a.coerce(nil) }.should raise_error(TypeError)
- lambda { a.coerce(mock('str')) }.should raise_error(TypeError)
- lambda { a.coerce(1..4) }.should raise_error(TypeError)
- lambda { a.coerce(:test) }.should raise_error(TypeError)
- end
-
- ruby_version_is ""..."2.4" do
- it "raises a TypeError when passed a String" do
- a = bignum_value
- lambda { a.coerce("123") }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed a Float" do
- a = bignum_value
- lambda { a.coerce(12.3) }.should raise_error(TypeError)
- end
- end
-
- ruby_version_is "2.4" do
- it "coerces both values to Floats and returns [other, self] when passed a Float" do
- a = bignum_value
- a.coerce(1.2).should == [1.2, a.to_f]
- end
-
- it "coerces both values to Floats and returns [other, self] when passed a String" do
- a = bignum_value
- a.coerce("123").should == [123.0, a.to_f]
- end
-
- it "calls #to_f to coerce other to a Float" do
- b = mock("bignum value")
- b.should_receive(:to_f).and_return(1.2)
-
- a = bignum_value
- ary = a.coerce(b)
-
- ary.should == [1.2, a.to_f]
- end
- end
-end
diff --git a/spec/ruby/core/bignum/comparison_spec.rb b/spec/ruby/core/bignum/comparison_spec.rb
deleted file mode 100644
index 435cc9aea2..0000000000
--- a/spec/ruby/core/bignum/comparison_spec.rb
+++ /dev/null
@@ -1,162 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#<=>" do
- describe "with a Fixnum" do
- it "returns -1 when other is larger" do
- (-bignum_value <=> 2).should == -1
- end
-
- it "returns 1 when other is smaller" do
- (bignum_value <=> 2).should == 1
- end
- end
-
- describe "with a Bignum" do
- describe "when other is negative" do
- it "returns -1 when self is negative and other is larger" do
- (-bignum_value(42) <=> -bignum_value).should == -1
- end
-
- it "returns 0 when other is equal" do
- (-bignum_value <=> -bignum_value).should == 0
- end
-
- it "returns 1 when self is negative and other is smaller" do
- (-bignum_value <=> -bignum_value(94)).should == 1
- end
-
- it "returns 1 when self is positive" do
- (bignum_value <=> -bignum_value).should == 1
- end
- end
-
- describe "when other is positive" do
- it "returns -1 when self is negative" do
- (-bignum_value <=> bignum_value).should == -1
- end
-
- it "returns -1 when self is positive and other is larger" do
- (bignum_value <=> bignum_value(38)).should == -1
- end
-
- it "returns 0 when other is equal" do
- (bignum_value <=> bignum_value).should == 0
- end
-
- it "returns 1 when other is smaller" do
- (bignum_value(56) <=> bignum_value).should == 1
- end
- end
- end
-
- describe "with a Float" do
- describe "when other is negative" do
- it "returns -1 when self is negative and other is larger" do
- (-bignum_value(0xffff) <=> -bignum_value.to_f).should == -1
- end
-
- it "returns 0 when other is equal" do
- (-bignum_value <=> -bignum_value.to_f).should == 0
- end
-
- it "returns 1 when self is negative and other is smaller" do
- (-bignum_value <=> -bignum_value(0xffef).to_f).should == 1
- end
-
- it "returns 1 when self is positive" do
- (bignum_value <=> -bignum_value.to_f).should == 1
- end
- end
-
- describe "when other is positive" do
- it "returns -1 when self is negative" do
- (-bignum_value <=> bignum_value.to_f).should == -1
- end
-
- it "returns -1 when self is positive and other is larger" do
- (bignum_value <=> bignum_value(0xfffe).to_f).should == -1
- end
-
- it "returns 0 when other is equal" do
- (bignum_value <=> bignum_value.to_f).should == 0
- end
-
- it "returns 1 when other is smaller" do
- (bignum_value(0xfeff) <=> bignum_value.to_f).should == 1
- end
- end
- end
-
- describe "with an Object" do
- before :each do
- @big = bignum_value
- @num = mock("value for Bignum#<=>")
- end
-
- it "calls #coerce on other" do
- @num.should_receive(:coerce).with(@big).and_return([@big.to_f, 2.5])
- @big <=> @num
- end
-
- ruby_version_is ""..."2.5" do
- it "returns nil if #coerce raises an exception" do
- @num.should_receive(:coerce).with(@big).and_raise(RuntimeError)
- lambda {
- @result = (@big <=> @num)
- }.should complain(/Numerical comparison operators will no more rescue exceptions/)
- @result.should be_nil
- end
- end
-
- ruby_version_is "2.5" do
- it "lets the exception go through if #coerce raises an exception" do
- @num.should_receive(:coerce).with(@big).and_raise(RuntimeError.new("my error"))
- lambda {
- @big <=> @num
- }.should raise_error(RuntimeError, "my error")
- end
- end
-
- it "raises an exception if #coerce raises a non-StandardError exception" do
- @num.should_receive(:coerce).with(@big).and_raise(Exception)
- lambda { @big <=> @num }.should raise_error(Exception)
- end
-
- it "returns nil if #coerce does not return an Array" do
- @num.should_receive(:coerce).with(@big).and_return(nil)
- (@big <=> @num).should be_nil
- end
-
- it "returns -1 if the coerced value is larger" do
- @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value(10)])
- (@big <=> @num).should == -1
- end
-
- it "returns 0 if the coerced value is equal" do
- @num.should_receive(:coerce).with(@big).and_return([@big, bignum_value])
- (@big <=> @num).should == 0
- end
-
- it "returns 1 if the coerced value is smaller" do
- @num.should_receive(:coerce).with(@big).and_return([@big, 22])
- (@big <=> @num).should == 1
- end
- end
-
- # The tests below are taken from matz's revision 23730 for Ruby trunk
- it "returns 1 when self is Infinity and other is a Bignum" do
- (infinity_value <=> Float::MAX.to_i*2).should == 1
- end
-
- it "returns -1 when self is negative and other is Infinty" do
- (-Float::MAX.to_i*2 <=> infinity_value).should == -1
- end
-
- it "returns 1 when self is negative and other is -Infinity" do
- (-Float::MAX.to_i*2 <=> -infinity_value).should == 1
- end
-
- it "returns -1 when self is -Infinity and other is negative" do
- (-infinity_value <=> -Float::MAX.to_i*2).should == -1
- end
-end
diff --git a/spec/ruby/core/bignum/complement_spec.rb b/spec/ruby/core/bignum/complement_spec.rb
deleted file mode 100644
index be6bc21b19..0000000000
--- a/spec/ruby/core/bignum/complement_spec.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#~" do
- it "returns self with each bit flipped" do
- (~bignum_value(48)).should == -9223372036854775857
- (~(-bignum_value(21))).should == 9223372036854775828
- (~bignum_value(1)).should == -9223372036854775810
- end
-end
diff --git a/spec/ruby/core/bignum/div_spec.rb b/spec/ruby/core/bignum/div_spec.rb
deleted file mode 100644
index 6c165289e8..0000000000
--- a/spec/ruby/core/bignum/div_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/divide', __FILE__)
-
-describe "Bignum#div" do
- it_behaves_like(:bignum_divide, :div)
-
- it "returns a result of integer division of self by a float argument" do
- bignum_value(88).div(4294967295.5).should eql(2147483648)
- not_supported_on :opal do
- bignum_value(88).div(4294967295.0).should eql(2147483648)
- bignum_value(88).div(bignum_value(88).to_f).should eql(1)
- bignum_value(88).div(-bignum_value(88).to_f).should eql(-1)
- end
- end
-
- # #5490
- it "raises ZeroDivisionError if the argument is Float zero" do
- lambda { bignum_value(88).div(0.0) }.should raise_error(ZeroDivisionError)
- lambda { bignum_value(88).div(-0.0) }.should raise_error(ZeroDivisionError)
- end
-end
diff --git a/spec/ruby/core/bignum/divide_spec.rb b/spec/ruby/core/bignum/divide_spec.rb
deleted file mode 100644
index b81938b707..0000000000
--- a/spec/ruby/core/bignum/divide_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/divide', __FILE__)
-
-describe "Bignum#/" do
- it_behaves_like(:bignum_divide, :/)
-
- it "returns self divided by float" do
- not_supported_on :opal do
- (bignum_value(88) / 4294967295.0).should be_close(2147483648.5, TOLERANCE)
- end
- (bignum_value(88) / 4294967295.5).should be_close(2147483648.25, TOLERANCE)
- end
-
- it "does NOT raise ZeroDivisionError if other is zero and is a Float" do
- (bignum_value / 0.0).to_s.should == 'Infinity'
- (bignum_value / -0.0).to_s.should == '-Infinity'
- end
-end
diff --git a/spec/ruby/core/bignum/divmod_spec.rb b/spec/ruby/core/bignum/divmod_spec.rb
deleted file mode 100644
index 656f23482b..0000000000
--- a/spec/ruby/core/bignum/divmod_spec.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#divmod" do
- before :each do
- @bignum = bignum_value(55)
- end
-
- # Based on MRI's test/test_integer.rb (test_divmod),
- # MRI maintains the following property:
- # if q, r = a.divmod(b) ==>
- # assert(0 < b ? (0 <= r && r < b) : (b < r && r <= 0))
- # So, r is always between 0 and b.
- it "returns an Array containing quotient and modulus obtained from dividing self by the given argument" do
- @bignum.divmod(4).should == [2305843009213693965, 3]
- @bignum.divmod(13).should == [709490156681136604, 11]
-
- @bignum.divmod(4.5).should == [2049638230412172288, 3.5]
-
- not_supported_on :opal do
- @bignum.divmod(4.0).should == [2305843009213693952, 0.0]
- @bignum.divmod(13.0).should == [709490156681136640, 8.0]
-
- @bignum.divmod(2.0).should == [4611686018427387904, 0.0]
- end
-
- @bignum.divmod(bignum_value).should == [1, 55]
-
- (-(10**50)).divmod(-(10**40 + 1)).should == [9999999999, -9999999999999999999999999999990000000001]
- (10**50).divmod(10**40 + 1).should == [9999999999, 9999999999999999999999999999990000000001]
-
- (-10**50).divmod(10**40 + 1).should == [-10000000000, 10000000000]
- (10**50).divmod(-(10**40 + 1)).should == [-10000000000, -10000000000]
- end
-
- describe "with q = floor(x/y), a = q*b + r," do
- it "returns [q,r] when a < 0, b > 0 and |a| < b" do
- a = -@bignum + 1
- b = @bignum
- a.divmod(b).should == [-1, 1]
- end
-
- it "returns [q,r] when a > 0, b < 0 and a > |b|" do
- b = -@bignum + 1
- a = @bignum
- a.divmod(b).should == [-2, -@bignum + 2]
- end
-
- it "returns [q,r] when a > 0, b < 0 and a < |b|" do
- a = @bignum - 1
- b = -@bignum
- a.divmod(b).should == [-1, -1]
- end
-
- it "returns [q,r] when a < 0, b < 0 and |a| < |b|" do
- a = -@bignum + 1
- b = -@bignum
- a.divmod(b).should == [0, -@bignum + 1]
- end
- end
-
- it "raises a ZeroDivisionError when the given argument is 0" do
- lambda { @bignum.divmod(0) }.should raise_error(ZeroDivisionError)
- lambda { (-@bignum).divmod(0) }.should raise_error(ZeroDivisionError)
- end
-
- # Behaviour established as correct in r23953
- it "raises a FloatDomainError if other is NaN" do
- lambda { @bignum.divmod(nan_value) }.should raise_error(FloatDomainError)
- end
-
- it "raises a ZeroDivisionError when the given argument is 0 and a Float" do
- lambda { @bignum.divmod(0.0) }.should raise_error(ZeroDivisionError)
- lambda { (-@bignum).divmod(0.0) }.should raise_error(ZeroDivisionError)
- end
-
- it "raises a TypeError when the given argument is not an Integer" do
- lambda { @bignum.divmod(mock('10')) }.should raise_error(TypeError)
- lambda { @bignum.divmod("10") }.should raise_error(TypeError)
- lambda { @bignum.divmod(:symbol) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/element_reference_spec.rb b/spec/ruby/core/bignum/element_reference_spec.rb
deleted file mode 100644
index e5ee9e15ac..0000000000
--- a/spec/ruby/core/bignum/element_reference_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#[]" do
- before :each do
- @bignum = bignum_value(4996)
- end
-
- it "returns the nth bit in the binary representation of self" do
- @bignum[2].should == 1
- @bignum[9.2].should == 1
- @bignum[21].should == 0
- @bignum[0xffffffff].should == 0
- @bignum[-0xffffffff].should == 0
- end
-
- it "tries to convert the given argument to an Integer using #to_int" do
- @bignum[1.3].should == @bignum[1]
-
- (obj = mock('2')).should_receive(:to_int).at_least(1).and_return(2)
- @bignum[obj].should == 1
- end
-
- it "raises a TypeError when the given argument can't be converted to Integer" do
- obj = mock('asdf')
- lambda { @bignum[obj] }.should raise_error(TypeError)
-
- obj.should_receive(:to_int).and_return("asdf")
- lambda { @bignum[obj] }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/eql_spec.rb b/spec/ruby/core/bignum/eql_spec.rb
deleted file mode 100644
index c9eff9ef08..0000000000
--- a/spec/ruby/core/bignum/eql_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#eql? when given a Bignum" do
- it "returns true if the given argument has the same value" do
- a = bignum_value(13)
- a.should eql(bignum_value(13))
- (-a).should eql(-bignum_value(13))
- end
-end
-
-describe "Bignum#eql? when given a non-Bignum" do
- it "returns false" do
- a = bignum_value(13)
- a.should_not eql(a.to_f)
-
- a.should_not eql(2)
- a.should_not eql(3.14)
- a.should_not eql(:symbol)
- a.should_not eql("String")
- a.should_not eql(mock('str'))
- end
-end
diff --git a/spec/ruby/core/bignum/equal_value_spec.rb b/spec/ruby/core/bignum/equal_value_spec.rb
deleted file mode 100644
index 0117d58683..0000000000
--- a/spec/ruby/core/bignum/equal_value_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/equal', __FILE__)
-
-describe "Bignum#==" do
- it_behaves_like :bignum_equal, :==
-end
diff --git a/spec/ruby/core/bignum/even_spec.rb b/spec/ruby/core/bignum/even_spec.rb
deleted file mode 100644
index a84ea80075..0000000000
--- a/spec/ruby/core/bignum/even_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#even?" do
- it "returns true if self is even and positive" do
- (10000**10).even?.should be_true
- end
-
- it "returns true if self is even and negative" do
- (-10000**10).even?.should be_true
- end
-
- it "returns false if self is odd and positive" do
- (9879**976).even?.should be_false
- end
-
- it "returns false if self is odd and negative" do
- (-9879**976).even?.should be_false
- end
-end
diff --git a/spec/ruby/core/bignum/exponent_spec.rb b/spec/ruby/core/bignum/exponent_spec.rb
deleted file mode 100644
index 9026c1ff3b..0000000000
--- a/spec/ruby/core/bignum/exponent_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#**" do
- before :each do
- @bignum = bignum_value(47)
- end
-
- it "returns self raised to other power" do
- (@bignum ** 4).should == 7237005577332262361485077344629993318496048279512298547155833600056910050625
- (@bignum ** 1.2).should be_close(57262152889751597425762.57804, TOLERANCE)
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum ** mock('10') }.should raise_error(TypeError)
- lambda { @bignum ** "10" }.should raise_error(TypeError)
- lambda { @bignum ** :symbol }.should raise_error(TypeError)
- end
-
- it "switch to a Float when the values is too big" do
- flt = (@bignum ** @bignum)
- flt.should be_kind_of(Float)
- flt.infinite?.should == 1
- end
-
- it "returns a complex number when negative and raised to a fractional power" do
- ((-@bignum) ** (1.0/3)) .should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
- ((-@bignum) ** Rational(1,3)).should be_close(Complex(1048576,1816186.907597341), TOLERANCE)
- end
-end
diff --git a/spec/ruby/core/bignum/fdiv_spec.rb b/spec/ruby/core/bignum/fdiv_spec.rb
deleted file mode 100644
index 35f3ede010..0000000000
--- a/spec/ruby/core/bignum/fdiv_spec.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#fdiv" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/ruby/core/bignum/gt_spec.rb b/spec/ruby/core/bignum/gt_spec.rb
deleted file mode 100644
index 5c814eedd1..0000000000
--- a/spec/ruby/core/bignum/gt_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#>" do
- before :each do
- @bignum = bignum_value(732)
- end
-
- it "returns true if self is greater than the given argument" do
- (@bignum > (@bignum - 1)).should == true
- (@bignum > 14.6).should == true
- (@bignum > 10).should == true
-
- (@bignum > (@bignum + 500)).should == false
- end
-
- it "raises an ArgumentError when given a non-Integer" do
- lambda { @bignum > "4" }.should raise_error(ArgumentError)
- lambda { @bignum > mock('str') }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/bignum/gte_spec.rb b/spec/ruby/core/bignum/gte_spec.rb
deleted file mode 100644
index e32ce19e0f..0000000000
--- a/spec/ruby/core/bignum/gte_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#>=" do
- before :each do
- @bignum = bignum_value(14)
- end
-
- it "returns true if self is greater than or equal to other" do
- (@bignum >= @bignum).should == true
- (@bignum >= (@bignum + 2)).should == false
- (@bignum >= 5664.2).should == true
- (@bignum >= 4).should == true
- end
-
- it "raises an ArgumentError when given a non-Integer" do
- lambda { @bignum >= "4" }.should raise_error(ArgumentError)
- lambda { @bignum >= mock('str') }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/bignum/hash_spec.rb b/spec/ruby/core/bignum/hash_spec.rb
deleted file mode 100644
index bdc85c3fdc..0000000000
--- a/spec/ruby/core/bignum/hash_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#hash" do
- it "is provided" do
- bignum_value.respond_to?(:hash).should == true
- end
-
- it "is stable" do
- bignum_value.hash.should == bignum_value.hash
- bignum_value.hash.should_not == bignum_value(1).hash
- end
-end
diff --git a/spec/ruby/core/bignum/left_shift_spec.rb b/spec/ruby/core/bignum/left_shift_spec.rb
deleted file mode 100644
index 364f51b708..0000000000
--- a/spec/ruby/core/bignum/left_shift_spec.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#<< with n << m" do
- before :each do
- @bignum = bignum_value * 16
- end
-
- it "returns n shifted left m bits when n > 0, m > 0" do
- (@bignum << 4).should == 2361183241434822606848
- end
-
- it "returns n shifted left m bits when n < 0, m > 0" do
- (-@bignum << 9).should == -75557863725914323419136
- end
-
- it "returns n shifted right m bits when n > 0, m < 0" do
- (@bignum << -1).should == 73786976294838206464
- end
-
- it "returns n shifted right m bits when n < 0, m < 0" do
- (-@bignum << -2).should == -36893488147419103232
- end
-
- it "returns n when n > 0, m == 0" do
- (@bignum << 0).should == @bignum
- end
-
- it "returns n when n < 0, m == 0" do
- (-@bignum << 0).should == -@bignum
- end
-
- it "returns 0 when m < 0 and m == p where 2**p > n >= 2**(p-1)" do
- (@bignum << -68).should == 0
- end
-
- it "returns 0 when m < 0 and m is a Bignum" do
- (@bignum << -bignum_value).should == 0
- end
-
- it "returns a Fixnum == fixnum_max when (fixnum_max * 2) << -1 and n > 0" do
- result = (fixnum_max * 2) << -1
- result.should be_an_instance_of(Fixnum)
- result.should == fixnum_max
- end
-
- it "returns a Fixnum == fixnum_min when (fixnum_min * 2) << -1 and n < 0" do
- result = (fixnum_min * 2) << -1
- result.should be_an_instance_of(Fixnum)
- result.should == fixnum_min
- end
-
- it "calls #to_int to convert the argument to an Integer" do
- obj = mock("4")
- obj.should_receive(:to_int).and_return(4)
-
- (@bignum << obj).should == 2361183241434822606848
- end
-
- it "raises a TypeError when #to_int does not return an Integer" do
- obj = mock("a string")
- obj.should_receive(:to_int).and_return("asdf")
-
- lambda { @bignum << obj }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed nil" do
- lambda { @bignum << nil }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed a String" do
- lambda { @bignum << "4" }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/lt_spec.rb b/spec/ruby/core/bignum/lt_spec.rb
deleted file mode 100644
index 802c68a58b..0000000000
--- a/spec/ruby/core/bignum/lt_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#<" do
- before :each do
- @bignum = bignum_value(32)
- end
-
- it "returns true if self is less than the given argument" do
- (@bignum < @bignum + 1).should == true
- (-@bignum < -(@bignum - 1)).should == true
-
- (@bignum < 1).should == false
- (@bignum < 5).should == false
-
- (@bignum < 4.999).should == false
- end
-
- it "raises an ArgumentError when given a non-Integer" do
- lambda { @bignum < "4" }.should raise_error(ArgumentError)
- lambda { @bignum < mock('str') }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/bignum/lte_spec.rb b/spec/ruby/core/bignum/lte_spec.rb
deleted file mode 100644
index 9a1d22d3be..0000000000
--- a/spec/ruby/core/bignum/lte_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#<=" do
- before :each do
- @bignum = bignum_value(39)
- end
-
- it "returns true if self is less than or equal to other" do
- (@bignum <= @bignum).should == true
- (-@bignum <= -(@bignum - 1)).should == true
-
- (@bignum <= 4.999).should == false
- end
-
- it "returns false if compares with near float" do
- (@bignum <= (@bignum + 0.0)).should == false
- (@bignum <= (@bignum + 0.5)).should == false
- end
-
- it "raises an ArgumentError when given a non-Integer" do
- lambda { @bignum <= "4" }.should raise_error(ArgumentError)
- lambda { @bignum <= mock('str') }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/ruby/core/bignum/magnitude_spec.rb b/spec/ruby/core/bignum/magnitude_spec.rb
deleted file mode 100644
index 35b9ba6f1e..0000000000
--- a/spec/ruby/core/bignum/magnitude_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/abs', __FILE__)
-
-describe "Bignum#magnitude" do
- it_behaves_like(:bignum_abs, :magnitude)
-end
diff --git a/spec/ruby/core/bignum/minus_spec.rb b/spec/ruby/core/bignum/minus_spec.rb
deleted file mode 100644
index 754ef7fa42..0000000000
--- a/spec/ruby/core/bignum/minus_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#-" do
- before :each do
- @bignum = bignum_value(314)
- end
-
- it "returns self minus the given Integer" do
- (@bignum - 9).should == 9223372036854776113
- (@bignum - 12.57).should be_close(9223372036854776109.43, TOLERANCE)
- (@bignum - bignum_value(42)).should == 272
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum - mock('10') }.should raise_error(TypeError)
- lambda { @bignum - "10" }.should raise_error(TypeError)
- lambda { @bignum - :symbol }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/modulo_spec.rb b/spec/ruby/core/bignum/modulo_spec.rb
deleted file mode 100644
index eee1dc76a6..0000000000
--- a/spec/ruby/core/bignum/modulo_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/modulo', __FILE__)
-
-describe "Bignum#%" do
- it_behaves_like(:bignum_modulo, :%)
-end
-
-describe "Bignum#modulo" do
- it_behaves_like(:bignum_modulo, :modulo)
-end
diff --git a/spec/ruby/core/bignum/multiply_spec.rb b/spec/ruby/core/bignum/multiply_spec.rb
deleted file mode 100644
index 486e36ecbc..0000000000
--- a/spec/ruby/core/bignum/multiply_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#*" do
- before :each do
- @bignum = bignum_value(772)
- end
-
- it "returns self multiplied by the given Integer" do
- (@bignum * (1/bignum_value(0xffff).to_f)).should be_close(1.0, TOLERANCE)
- (@bignum * (1/bignum_value(0xffff).to_f)).should be_close(1.0, TOLERANCE)
- (@bignum * 10).should == 92233720368547765800
- (@bignum * (@bignum - 40)).should == 85070591730234629737795195287525433200
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum * mock('10') }.should raise_error(TypeError)
- lambda { @bignum * "10" }.should raise_error(TypeError)
- lambda { @bignum * :symbol }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/odd_spec.rb b/spec/ruby/core/bignum/odd_spec.rb
deleted file mode 100644
index 9d4c1191f6..0000000000
--- a/spec/ruby/core/bignum/odd_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#odd?" do
- it "returns true if self is odd and positive" do
- (987279**19).odd?.should be_true
- end
-
- it "returns true if self is odd and negative" do
- (-9873389**97).odd?.should be_true
- end
-
- it "returns false if self is even and positive" do
- (10000000**10).odd?.should be_false
- end
-
- it "returns false if self is even and negative" do
- (-1000000**100).odd?.should be_false
- end
-end
diff --git a/spec/ruby/core/bignum/plus_spec.rb b/spec/ruby/core/bignum/plus_spec.rb
deleted file mode 100644
index 411e226649..0000000000
--- a/spec/ruby/core/bignum/plus_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#+" do
- before :each do
- @bignum = bignum_value(76)
- end
-
- it "returns self plus the given Integer" do
- (@bignum + 4).should == 9223372036854775888
- (@bignum + 4.2).should be_close(9223372036854775888.2, TOLERANCE)
- (@bignum + bignum_value(3)).should == 18446744073709551695
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum + mock('10') }.should raise_error(TypeError)
- lambda { @bignum + "10" }.should raise_error(TypeError)
- lambda { @bignum + :symbol}.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/remainder_spec.rb b/spec/ruby/core/bignum/remainder_spec.rb
deleted file mode 100644
index 59f7eb4326..0000000000
--- a/spec/ruby/core/bignum/remainder_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#remainder" do
- it "returns the remainder of dividing self by other" do
- a = bignum_value(79)
- a.remainder(2).should == 1
- a.remainder(97.345).should be_close(46.5674996147722, TOLERANCE)
- a.remainder(bignum_value).should == 79
- end
-
- it "raises a ZeroDivisionError if other is zero and not a Float" do
- lambda { bignum_value(66).remainder(0) }.should raise_error(ZeroDivisionError)
- end
-
- it "does raises ZeroDivisionError if other is zero and a Float" do
- a = bignum_value(7)
- b = bignum_value(32)
- lambda { a.remainder(0.0) }.should raise_error(ZeroDivisionError)
- lambda { b.remainder(-0.0) }.should raise_error(ZeroDivisionError)
- end
-end
diff --git a/spec/ruby/core/bignum/right_shift_spec.rb b/spec/ruby/core/bignum/right_shift_spec.rb
deleted file mode 100644
index d65f7c00a9..0000000000
--- a/spec/ruby/core/bignum/right_shift_spec.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#>> with n >> m" do
- before :each do
- @bignum = bignum_value * 16
- end
-
- it "returns n shifted right m bits when n > 0, m > 0" do
- (@bignum >> 1).should == 73786976294838206464
- end
-
- it "returns n shifted right m bits when n < 0, m > 0" do
- (-@bignum >> 2).should == -36893488147419103232
- end
-
- it "respects twos complement signed shifting" do
- # This explicit left hand value is important because it is the
- # exact bit pattern that matters, so it's important it's right
- # here to show the significance.
- #
-
- (-42949672980000000000000 >> 14).should == -2621440001220703125
- (-42949672980000000000001 >> 14).should == -2621440001220703126
- # Note the off by one -------------------- ^^^^^^^^^^^^^^^^^^^^
- # This is because even though we discard the lowest bit, in twos
- # complement it would influence the bits to the left of it.
-
- (-42949672980000000000000 >> 15).should == -1310720000610351563
- (-42949672980000000000001 >> 15).should == -1310720000610351563
-
- (-0xfffffffffffffffff >> 32).should == -68719476736
- end
-
- it "respects twos complement signed shifting for very large values" do
- giant = 42949672980000000000000000000000000000000000000000000000000000000000000000000000000000000000
- neg = -giant
-
- (giant >> 84).should == 2220446050284288846538547929770901490087453566957265138626098632812
- (neg >> 84).should == -2220446050284288846538547929770901490087453566957265138626098632813
- end
-
- it "returns n shifted left m bits when n > 0, m < 0" do
- (@bignum >> -2).should == 590295810358705651712
- end
-
- it "returns n shifted left m bits when n < 0, m < 0" do
- (-@bignum >> -3).should == -1180591620717411303424
- end
-
- it "returns n when n > 0, m == 0" do
- (@bignum >> 0).should == @bignum
- end
-
- it "returns n when n < 0, m == 0" do
- (-@bignum >> 0).should == -@bignum
- end
-
- it "returns 0 when m > 0 and m == p where 2**p > n >= 2**(p-1)" do
- (@bignum >> 68).should == 0
- end
-
- it "returns 0 when m is a Bignum" do
- (@bignum >> bignum_value).should == 0
- end
-
- it "returns a Fixnum == fixnum_max when (fixnum_max * 2) >> 1 and n > 0" do
- result = (fixnum_max * 2) >> 1
- result.should be_an_instance_of(Fixnum)
- result.should == fixnum_max
- end
-
- it "returns a Fixnum == fixnum_min when (fixnum_min * 2) >> 1 and n < 0" do
- result = (fixnum_min * 2) >> 1
- result.should be_an_instance_of(Fixnum)
- result.should == fixnum_min
- end
-
- it "calls #to_int to convert the argument to an Integer" do
- obj = mock("2")
- obj.should_receive(:to_int).and_return(2)
-
- (@bignum >> obj).should == 36893488147419103232
- end
-
- it "raises a TypeError when #to_int does not return an Integer" do
- obj = mock("a string")
- obj.should_receive(:to_int).and_return("asdf")
-
- lambda { @bignum >> obj }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed nil" do
- lambda { @bignum >> nil }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when passed a String" do
- lambda { @bignum >> "4" }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/shared/abs.rb b/spec/ruby/core/bignum/shared/abs.rb
deleted file mode 100644
index 35fd85060c..0000000000
--- a/spec/ruby/core/bignum/shared/abs.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-describe :bignum_abs, shared: true do
- it "returns the absolute value" do
- bignum_value(39).send(@method).should == 9223372036854775847
- (-bignum_value(18)).send(@method).should == 9223372036854775826
- end
-end
diff --git a/spec/ruby/core/bignum/shared/divide.rb b/spec/ruby/core/bignum/shared/divide.rb
deleted file mode 100644
index cbde69bbb2..0000000000
--- a/spec/ruby/core/bignum/shared/divide.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-describe :bignum_divide, shared: true do
- before :each do
- @bignum = bignum_value(88)
- end
-
- it "returns self divided by other" do
- @bignum.send(@method, 4).should == 2305843009213693974
-
- @bignum.send(@method, bignum_value(2)).should be_close(1, TOLERANCE)
-
- (-(10**50)).send(@method, -(10**40 + 1)).should == 9999999999
- (10**50).send(@method, 10**40 + 1).should == 9999999999
-
- (-10**50).send(@method, 10**40 + 1).should == -10000000000
- (10**50).send(@method, -(10**40 + 1)).should == -10000000000
- end
-
- it "raises a ZeroDivisionError if other is zero and not a Float" do
- lambda { @bignum.send(@method, 0) }.should raise_error(ZeroDivisionError)
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum.send(@method, mock('10')) }.should raise_error(TypeError)
- lambda { @bignum.send(@method, "2") }.should raise_error(TypeError)
- lambda { @bignum.send(@method, :symbol) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/shared/equal.rb b/spec/ruby/core/bignum/shared/equal.rb
deleted file mode 100644
index ffe4daf4f1..0000000000
--- a/spec/ruby/core/bignum/shared/equal.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-describe :bignum_equal, shared: true do
- before :each do
- @bignum = bignum_value
- end
-
- it "returns true if self has the same value as the given argument" do
- @bignum.send(@method, @bignum).should == true
- @bignum.send(@method, @bignum.to_f).should == true
-
- @bignum.send(@method, @bignum + 1).should == false
- (@bignum + 1).send(@method, @bignum).should == false
-
- @bignum.send(@method, 9).should == false
- @bignum.send(@method, 9.01).should == false
-
- @bignum.send(@method, bignum_value(10)).should == false
- end
-
- it "calls 'other == self' if the given argument is not an Integer" do
- obj = mock('not integer')
- obj.should_receive(:==).and_return(true)
- @bignum.send(@method, obj).should == true
- end
-
- it "returns the result of 'other == self' as a boolean" do
- obj = mock('not integer')
- obj.should_receive(:==).exactly(2).times.and_return("woot", nil)
- @bignum.send(@method, obj).should == true
- @bignum.send(@method, obj).should == false
- end
-end
diff --git a/spec/ruby/core/bignum/shared/modulo.rb b/spec/ruby/core/bignum/shared/modulo.rb
deleted file mode 100644
index 9814e22f3b..0000000000
--- a/spec/ruby/core/bignum/shared/modulo.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-describe :bignum_modulo, shared: true do
- before :each do
- @bignum = bignum_value
- end
-
- it "returns the modulus obtained from dividing self by the given argument" do
- @bignum.send(@method, 5).should == 3
- @bignum.send(@method, -5).should == -2
- @bignum.send(@method, -100).should == -92
- @bignum.send(@method, 2.22).should be_close(0.780180180180252, TOLERANCE)
- @bignum.send(@method, bignum_value(10)).should == 9223372036854775808
- end
-
- it "raises a ZeroDivisionError when the given argument is 0" do
- lambda { @bignum.send(@method, 0) }.should raise_error(ZeroDivisionError)
- lambda { (-@bignum).send(@method, 0) }.should raise_error(ZeroDivisionError)
- end
-
- it "raises a ZeroDivisionError when the given argument is 0 and a Float" do
- lambda { @bignum.send(@method, 0.0) }.should raise_error(ZeroDivisionError)
- lambda { -@bignum.send(@method, 0.0) }.should raise_error(ZeroDivisionError)
- end
-
- it "raises a TypeError when given a non-Integer" do
- lambda { @bignum.send(@method, mock('10')) }.should raise_error(TypeError)
- lambda { @bignum.send(@method, "10") }.should raise_error(TypeError)
- lambda { @bignum.send(@method, :symbol) }.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/bignum/size_spec.rb b/spec/ruby/core/bignum/size_spec.rb
deleted file mode 100644
index 8629cba972..0000000000
--- a/spec/ruby/core/bignum/size_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#size" do
- it "returns the number of bytes required to hold the unsigned bignum data" do
- # that is, n such that 256 * n <= val.abs < 256 * (n+1)
- (256**7).size.should == 8
- (256**8).size.should == 9
- (256**9).size.should == 10
- (256**10).size.should == 11
- (256**10-1).size.should == 10
- (256**11).size.should == 12
- (256**12).size.should == 13
- (256**20-1).size.should == 20
- (256**40-1).size.should == 40
- end
-end
diff --git a/spec/ruby/core/bignum/to_f_spec.rb b/spec/ruby/core/bignum/to_f_spec.rb
deleted file mode 100644
index 8d99045c95..0000000000
--- a/spec/ruby/core/bignum/to_f_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#to_f" do
- it "returns self converted to a Float" do
- bignum_value(0x4000_0aa0_0bb0_0000).to_f.should eql(13_835_069_737_789_292_544.00)
- bignum_value(0x8000_0000_0000_0ccc).to_f.should eql(18_446_744_073_709_555_712.00)
- (-bignum_value(99)).to_f.should eql(-9_223_372_036_854_775_808.00)
- end
-
- it "converts number close to Float::MAX without exceeding MAX or producing NaN" do
- (10**308).to_f.should == 10.0 ** 308
- end
-end
diff --git a/spec/ruby/core/bignum/to_s_spec.rb b/spec/ruby/core/bignum/to_s_spec.rb
deleted file mode 100644
index 524639adb6..0000000000
--- a/spec/ruby/core/bignum/to_s_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#to_s when given a base" do
- it "returns self converted to a String using the given base" do
- a = 2**64
- a.to_s(2).should == "10000000000000000000000000000000000000000000000000000000000000000"
- a.to_s(8).should == "2000000000000000000000"
- a.to_s(16).should == "10000000000000000"
- a.to_s(32).should == "g000000000000"
- end
-
- it "raises an ArgumentError if the base is less than 2 or higher than 36" do
- lambda { 123.to_s(-1) }.should raise_error(ArgumentError)
- lambda { 123.to_s(0) }.should raise_error(ArgumentError)
- lambda { 123.to_s(1) }.should raise_error(ArgumentError)
- lambda { 123.to_s(37) }.should raise_error(ArgumentError)
- end
-end
-
-describe "Bignum#to_s when given no base" do
- it "returns self converted to a String using base 10" do
- bignum_value(9).to_s.should == "9223372036854775817"
- bignum_value.to_s.should == "9223372036854775808"
- (-bignum_value(675)).to_s.should == "-9223372036854776483"
- end
-end
-
-with_feature :encoding do
- describe "Bignum#to_s" do
- before :each do
- @internal = Encoding.default_internal
- end
-
- after :each do
- Encoding.default_internal = @internal
- end
-
- it "returns a String in US-ASCII encoding when Encoding.default_internal is nil" do
- Encoding.default_internal = nil
- bignum_value.to_s.encoding.should equal(Encoding::US_ASCII)
- end
-
- it "returns a String in US-ASCII encoding when Encoding.default_internal is not nil" do
- Encoding.default_internal = Encoding::IBM437
- bignum_value.to_s.encoding.should equal(Encoding::US_ASCII)
- end
- end
-end
diff --git a/spec/ruby/core/bignum/uminus_spec.rb b/spec/ruby/core/bignum/uminus_spec.rb
deleted file mode 100644
index 7ec432ac71..0000000000
--- a/spec/ruby/core/bignum/uminus_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Bignum#-@" do
- it "returns self as a negative value" do
- bignum_value.send(:-@).should == -9223372036854775808
- (-bignum_value).send(:-@).should == 9223372036854775808
-
- bignum_value(921).send(:-@).should == -9223372036854776729
- (-bignum_value(921).send(:-@)).should == 9223372036854776729
- end
-end
diff --git a/spec/ruby/core/binding/clone_spec.rb b/spec/ruby/core/binding/clone_spec.rb
deleted file mode 100644
index d607ae2a9e..0000000000
--- a/spec/ruby/core/binding/clone_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/clone', __FILE__)
-
-describe "Binding#clone" do
- it_behaves_like(:binding_clone, :clone)
-end
diff --git a/spec/ruby/core/binding/dup_spec.rb b/spec/ruby/core/binding/dup_spec.rb
deleted file mode 100644
index 7f242626d7..0000000000
--- a/spec/ruby/core/binding/dup_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-require File.expand_path('../shared/clone', __FILE__)
-
-describe "Binding#dup" do
- it_behaves_like(:binding_clone, :dup)
-end
diff --git a/spec/ruby/core/binding/eval_spec.rb b/spec/ruby/core/binding/eval_spec.rb
deleted file mode 100644
index 4864b9f61f..0000000000
--- a/spec/ruby/core/binding/eval_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Binding#eval" do
- it "behaves like Kernel.eval(..., self)" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
-
- bind.eval("@secret += square(3)").should == 10
- bind.eval("a").should be_true
-
- bind.eval("class Inside; end")
- bind.eval("Inside.name").should == "BindingSpecs::Demo::Inside"
- end
-
- it "does not leak variables to cloned bindings" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_empty_binding
- bind2 = bind.dup
-
- bind.eval("x = 72")
- bind.local_variables.should == [:x]
- bind2.local_variables.should == []
- end
-
- describe "with a file given" do
- it "does not store the filename permanently" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
-
- bind.eval("__FILE__", "test.rb").should == "test.rb"
- bind.eval("__FILE__").should_not == "test.rb"
- end
- end
-
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/ruby/core/binding/fixtures/classes.rb b/spec/ruby/core/binding/fixtures/classes.rb
deleted file mode 100644
index 05ca2479ba..0000000000
--- a/spec/ruby/core/binding/fixtures/classes.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module BindingSpecs
- class Demo
- def initialize(n)
- @secret = n
- end
-
- def square(n)
- n * n
- end
-
- def get_binding_and_line
- a = true
- [binding, __LINE__]
- end
-
- def get_binding
- get_binding_and_line[0]
- end
-
- def get_line_of_binding
- get_binding_and_line[1]
- end
-
- def get_file_of_binding
- __FILE__
- end
-
- def get_empty_binding
- binding
- end
-
- def get_binding_in_block
- a = true
- 1.times do
- b = false
- return binding
- end
- end
- end
-end
diff --git a/spec/ruby/core/binding/local_variable_defined_spec.rb b/spec/ruby/core/binding/local_variable_defined_spec.rb
deleted file mode 100644
index 5fa79b19e2..0000000000
--- a/spec/ruby/core/binding/local_variable_defined_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe 'Binding#local_variable_defined?' do
- it 'returns false when a variable is not defined' do
- binding.local_variable_defined?(:foo).should == false
- end
-
- it 'returns true when a regular local variable is defined' do
- foo = 10
- binding.local_variable_defined?(:foo).should == true
- end
-
- it 'returns true when a local variable is defined using eval()' do
- bind = binding
- bind.eval('foo = 10')
-
- bind.local_variable_defined?(:foo).should == true
- end
-
- it 'returns true when a local variable is defined using Binding#local_variable_set' do
- bind = binding
- bind.local_variable_set(:foo, 10)
-
- bind.local_variable_defined?(:foo).should == true
- end
-
- it 'returns true when a local variable is defined in a parent scope' do
- foo = 10
- lambda {
- binding.local_variable_defined?(:foo)
- }.call.should == true
- end
-
- it 'allows usage of a String as the variable name' do
- foo = 10
- binding.local_variable_defined?('foo').should == true
- end
-
- it 'allows usage of an object responding to #to_str as the variable name' do
- foo = 10
- name = mock(:obj)
- name.stub!(:to_str).and_return('foo')
-
- binding.local_variable_defined?(name).should == true
- end
-end
diff --git a/spec/ruby/core/binding/local_variable_get_spec.rb b/spec/ruby/core/binding/local_variable_get_spec.rb
deleted file mode 100644
index e65d08130e..0000000000
--- a/spec/ruby/core/binding/local_variable_get_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Binding#local_variable_get" do
- it "reads local variables captured in the binding" do
- a = 42
- bind = binding
- bind.local_variable_get(:a).should == 42
- end
-
- it "raises a NameError for missing variables" do
- bind = BindingSpecs::Demo.new(1).get_empty_binding
-
- lambda {
- bind.local_variable_get(:no_such_variable)
- }.should raise_error(NameError)
- end
-
- it "reads variables added later to the binding" do
- bind = BindingSpecs::Demo.new(1).get_empty_binding
-
- lambda {
- bind.local_variable_get(:a)
- }.should raise_error(NameError)
-
- bind.local_variable_set(:a, 42)
-
- bind.local_variable_get(:a).should == 42
- end
-
- it 'gets a local variable defined in a parent scope' do
- number = 10
-
- lambda {
- binding.local_variable_get(:number)
- }.call.should == 10
- end
-
- it 'gets a local variable defined using eval()' do
- bind = binding
- bind.eval('number = 10')
-
- bind.local_variable_get(:number).should == 10
- end
-
- it "raises a NameError on global access" do
- bind = binding
- lambda { bind.local_variable_get(:$0) }.should raise_error(NameError)
- end
-
- it "raises a NameError on special variable access" do
- bind = binding
- lambda { bind.local_variable_get(:$~) }.should raise_error(NameError)
- lambda { bind.local_variable_get(:$_) }.should raise_error(NameError)
- end
-end
diff --git a/spec/ruby/core/binding/local_variable_set_spec.rb b/spec/ruby/core/binding/local_variable_set_spec.rb
deleted file mode 100644
index 067dcbd03e..0000000000
--- a/spec/ruby/core/binding/local_variable_set_spec.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Binding#local_variable_set" do
- it "adds nonexistent variables to the binding's eval scope" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_empty_binding
- bind.eval('local_variables').should == []
- bind.local_variable_set :foo, 1
- bind.eval('local_variables').should == [:foo]
- bind.eval('foo').should == 1
- end
-
- it 'sets a new local variable' do
- bind = binding
-
- bind.local_variable_set(:number, 10)
- bind.local_variable_get(:number).should == 10
- end
-
- it 'sets a local variable using a String as the variable name' do
- bind = binding
-
- bind.local_variable_set('number', 10)
- bind.local_variable_get('number').should == 10
- end
-
- it 'sets a local variable using an object responding to #to_str as the variable name' do
- bind = binding
- name = mock(:obj)
- name.stub!(:to_str).and_return('number')
-
- bind.local_variable_set(name, 10)
- bind.local_variable_get(name).should == 10
- end
-
- it 'scopes new local variables to the receiving Binding' do
- bind = binding
- bind.local_variable_set(:number, 10)
-
- lambda { number }.should raise_error(NameError)
- end
-
- it 'overwrites an existing local variable defined before a Binding' do
- number = 10
- bind = binding
-
- bind.local_variable_set(:number, 20)
- number.should == 20
- end
-
- it 'overwrites a local variable defined using eval()' do
- bind = binding
- bind.eval('number = 10')
-
- bind.local_variable_set(:number, 20)
- bind.local_variable_get(:number).should == 20
- end
-
- it "raises a NameError on global access" do
- bind = binding
- lambda { bind.local_variable_set(:$0, "") }.should raise_error(NameError)
- end
-
- it "raises a NameError on special variable access" do
- bind = binding
- lambda { bind.local_variable_set(:$~, "") }.should raise_error(NameError)
- lambda { bind.local_variable_set(:$_, "") }.should raise_error(NameError)
- end
-
-end
diff --git a/spec/ruby/core/binding/local_variables_spec.rb b/spec/ruby/core/binding/local_variables_spec.rb
deleted file mode 100644
index bc6ea71f10..0000000000
--- a/spec/ruby/core/binding/local_variables_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Binding#local_variables" do
- it "returns an Array" do
- binding.local_variables.should be_kind_of(Array)
- end
-
- it "includes local variables in the current scope" do
- a = 1
- b = nil
- binding.local_variables.should == [:a, :b]
- end
-
- it "includes local variables defined after calling binding.local_variables" do
- binding.local_variables.should == [:a, :b]
- a = 1
- b = 2
- end
-
- it "includes local variables of inherited scopes and eval'ed context" do
- p = proc { |a| b = 1; eval("c = 2; binding.local_variables") }
- p.call.should == [:c, :a, :b, :p]
- end
-
- it "includes shadowed local variables only once" do
- a = 1
- proc { |a| binding.local_variables }.call(2).should == [:a]
- end
-
- it "includes new variables defined in the binding" do
- b = binding
- b.local_variable_set :a, 42
- b.local_variables.should == [:a, :b]
- end
-end
diff --git a/spec/ruby/core/binding/location_spec.rb b/spec/ruby/core/binding/location_spec.rb
deleted file mode 100644
index b4a066038d..0000000000
--- a/spec/ruby/core/binding/location_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Binding#eval" do
- it "inherits __LINE__ from the enclosing scope" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
- bind.eval("__LINE__").should == obj.get_line_of_binding
- end
-
- it "preserves __LINE__ across multiple calls to eval" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
- bind.eval("__LINE__").should == obj.get_line_of_binding
- bind.eval("__LINE__").should == obj.get_line_of_binding
- end
-
- it "increments __LINE__ on each line of a multiline eval" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
- bind.eval("#foo\n__LINE__").should == obj.get_line_of_binding + 1
- end
-
- it "starts with a __LINE__ of 1 if a filename is passed" do
- bind = BindingSpecs::Demo.new(1).get_binding
- bind.eval("__LINE__", "(test)").should == 1
- bind.eval("#foo\n__LINE__", "(test)").should == 2
- end
-
- it "starts with a __LINE__ from the third argument if passed" do
- bind = BindingSpecs::Demo.new(1).get_binding
- bind.eval("__LINE__", "(test)", 88).should == 88
- bind.eval("#foo\n__LINE__", "(test)", 88).should == 89
- end
-
- it "inherits __FILE__ from the enclosing scope" do
- obj = BindingSpecs::Demo.new(1)
- bind = obj.get_binding
- bind.eval("__FILE__").should == obj.get_file_of_binding
- end
-
- it "uses the __FILE__ that is passed in" do
- bind = BindingSpecs::Demo.new(1).get_binding
- bind.eval("__FILE__", "(test)").should == "(test)"
- end
-end
diff --git a/spec/ruby/core/binding/receiver_spec.rb b/spec/ruby/core/binding/receiver_spec.rb
deleted file mode 100644
index 8784ab0e38..0000000000
--- a/spec/ruby/core/binding/receiver_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Binding#receiver" do
- it "returns the object to which binding is bound" do
- obj = BindingSpecs::Demo.new(1)
- obj.get_binding.receiver.should == obj
-
- binding.receiver.should == self
- end
-end
diff --git a/spec/ruby/core/binding/shared/clone.rb b/spec/ruby/core/binding/shared/clone.rb
deleted file mode 100644
index 0e934ac1b5..0000000000
--- a/spec/ruby/core/binding/shared/clone.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-describe :binding_clone, shared: true do
- before :each do
- @b1 = BindingSpecs::Demo.new(99).get_binding
- @b2 = @b1.send(@method)
- @b3 = BindingSpecs::Demo.new(99).get_binding_in_block
- @b4 = @b3.send(@method)
- end
-
- it "returns a copy of the Binding object" do
- [[@b1, @b2, "a"],
- [@b3, @b4, "a", "b"]].each do |b1, b2, *vars|
- b1.should_not == b2
-
- eval("@secret", b1).should == eval("@secret", b2)
- eval("square(2)", b1).should == eval("square(2)", b2)
- eval("self.square(2)", b1).should == eval("self.square(2)", b2)
- vars.each do |v|
- eval("#{v}", b1).should == eval("#{v}", b2)
- end
- end
- end
-
- it "is a shallow copy of the Binding object" do
- [[@b1, @b2, "a"],
- [@b3, @b4, "a", "b"]].each do |b1, b2, *vars|
- vars.each do |v|
- eval("#{v} = false", b1)
- eval("#{v}", b2).should == false
- end
- b1.local_variable_set(:x, 37)
- b2.local_variable_defined?(:x).should == false
- end
- end
-end
diff --git a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb b/spec/ruby/core/builtin_constants/builtin_constants_spec.rb
deleted file mode 100644
index 9019b127c2..0000000000
--- a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "RUBY_VERSION" do
- it "is a String" do
- RUBY_VERSION.should be_kind_of(String)
- end
-end
-
-describe "RUBY_PATCHLEVEL" do
- it "is a Fixnum" do
- RUBY_PATCHLEVEL.should be_kind_of(Fixnum)
- end
-end
-
-describe "RUBY_COPYRIGHT" do
- it "is a String" do
- RUBY_COPYRIGHT.should be_kind_of(String)
- end
-end
-
-describe "RUBY_DESCRIPTION" do
- it "is a String" do
- RUBY_DESCRIPTION.should be_kind_of(String)
- end
-end
-
-describe "RUBY_ENGINE" do
- it "is a String" do
- RUBY_ENGINE.should be_kind_of(String)
- end
-end
-
-describe "RUBY_PLATFORM" do
- it "is a String" do
- RUBY_PLATFORM.should be_kind_of(String)
- end
-end
-
-describe "RUBY_RELEASE_DATE" do
- it "is a String" do
- RUBY_RELEASE_DATE.should be_kind_of(String)
- end
-end
-
-describe "RUBY_REVISION" do
- it "is a Fixnum" do
- RUBY_REVISION.should be_kind_of(Fixnum)
- end
-end
diff --git a/spec/ruby/core/class/allocate_spec.rb b/spec/ruby/core/class/allocate_spec.rb
deleted file mode 100644
index 015db292eb..0000000000
--- a/spec/ruby/core/class/allocate_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Class#allocate" do
- it "returns an instance of self" do
- klass = Class.new
- klass.allocate.should be_an_instance_of(klass)
- end
-
- it "returns a fully-formed instance of Module" do
- klass = Class.allocate
- klass.constants.should_not == nil
- klass.methods.should_not == nil
- end
-
- it "throws an exception when calling a method on a new instance" do
- klass = Class.allocate
- lambda do
- klass.new
- end.should raise_error(Exception)
- end
-
- it "does not call initialize on the new instance" do
- klass = Class.new do
- def initialize(*args)
- @initialized = true
- end
-
- def initialized?
- @initialized || false
- end
- end
-
- klass.allocate.initialized?.should == false
- end
-
- it "raises TypeError for #superclass" do
- lambda do
- Class.allocate.superclass
- end.should raise_error(TypeError)
- end
-end
diff --git a/spec/ruby/core/class/dup_spec.rb b/spec/ruby/core/class/dup_spec.rb
deleted file mode 100644
index 0548536bd6..0000000000
--- a/spec/ruby/core/class/dup_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-# NOTE: This is actually implemented by Module#initialize_copy
-describe "Class#dup" do
- it "duplicates both the class and the singleton class" do
- klass = Class.new do
- def hello
- "hello"
- end
-
- def self.message
- "text"
- end
- end
-
- klass_dup = klass.dup
-
- klass_dup.new.hello.should == "hello"
- klass_dup.message.should == "text"
- end
-
- it "retains an included module in the ancestor chain for the singleton class" do
- klass = Class.new
- mod = Module.new do
- def hello
- "hello"
- end
- end
-
- klass.extend(mod)
- klass_dup = klass.dup
- klass_dup.hello.should == "hello"
- end
-
- it "retains the correct ancestor chain for the singleton class" do
- super_klass = Class.new do
- def hello
- "hello"
- end
-
- def self.message
- "text"
- end
- end
-
- klass = Class.new(super_klass)
- klass_dup = klass.dup
-
- klass_dup.new.hello.should == "hello"
- klass_dup.message.should == "text"
- end
-
- it "sets the name from the class to nil if not assigned to a constant" do
- copy = CoreClassSpecs::Record.dup
- copy.name.should be_nil
- end
-
- it "stores the new name if assigned to a constant" do
- CoreClassSpecs::RecordCopy = CoreClassSpecs::Record.dup
- CoreClassSpecs::RecordCopy.name.should == "CoreClassSpecs::RecordCopy"
- end
-
-end
diff --git a/spec/ruby/core/class/fixtures/classes.rb b/spec/ruby/core/class/fixtures/classes.rb
deleted file mode 100644
index f96db90795..0000000000
--- a/spec/ruby/core/class/fixtures/classes.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module CoreClassSpecs
- class Record
- end
-
- module M
- def inherited(klass)
- ScratchPad.record klass
- super
- end
- end
-
- class F; end
- class << F
- include M
- end
-
- class A
- def self.inherited(klass)
- ScratchPad.record klass
- end
- end
-
- class H < A
- def self.inherited(klass)
- super
- end
- end
-
- module Inherited
- class A
- SUBCLASSES = []
- def self.inherited(subclass)
- SUBCLASSES << [self, subclass]
- end
- end
-
- class B < A; end
- class B < A; end # reopen
- class C < B; end
-
- class D
- def self.inherited(subclass)
- ScratchPad << self
- end
- end
- end
-end
diff --git a/spec/ruby/core/class/inherited_spec.rb b/spec/ruby/core/class/inherited_spec.rb
deleted file mode 100644
index 356e46be7c..0000000000
--- a/spec/ruby/core/class/inherited_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Class.inherited" do
-
- before :each do
- ScratchPad.record nil
- end
-
- it "is invoked with the child Class when self is subclassed" do
- begin
- top = Class.new do
- def self.inherited(cls)
- $child_class = cls
- end
- end
-
- child = Class.new(top)
- $child_class.should == child
-
- other_child = Class.new(top)
- $child_class.should == other_child
- ensure
- $child_class = nil
- end
- end
-
- it "is invoked only once per subclass" do
- expected = [
- [CoreClassSpecs::Inherited::A, CoreClassSpecs::Inherited::B],
- [CoreClassSpecs::Inherited::B, CoreClassSpecs::Inherited::C],
- ]
-
- CoreClassSpecs::Inherited::A::SUBCLASSES.should == expected
- end
-
- it "is called when marked as a private class method" do
- a = Class.new do
- def self.inherited(klass)
- ScratchPad.record klass
- end
- end
- a.private_class_method :inherited
- ScratchPad.recorded.should == nil
- b = Class.new(a)
- ScratchPad.recorded.should == b
- end
-
- it "is called when marked as a protected class method" do
- a = Class.new
- class << a
- def inherited(klass)
- ScratchPad.record klass
- end
- protected :inherited
- end
- ScratchPad.recorded.should == nil
- b = Class.new(a)
- ScratchPad.recorded.should == b
- end
-
- it "is called when marked as a public class method" do
- a = Class.new do
- def self.inherited(klass)
- ScratchPad.record klass
- end
- end
- a.public_class_method :inherited
- ScratchPad.recorded.should == nil
- b = Class.new(a)
- ScratchPad.recorded.should == b
- end
-
- it "is called by super from a method provided by an included module" do
- ScratchPad.recorded.should == nil
- e = Class.new(CoreClassSpecs::F)
- ScratchPad.recorded.should == e
- end
-
- it "is called by super even when marked as a private class method" do
- ScratchPad.recorded.should == nil
- CoreClassSpecs::H.private_class_method :inherited
- i = Class.new(CoreClassSpecs::H)
- ScratchPad.recorded.should == i
- end
-
- it "will be invoked by child class regardless of visibility" do
- top = Class.new do
- class << self
- def inherited(cls); end
- end
- end
-
- class << top; private :inherited; end
- lambda { Class.new(top) }.should_not raise_error
-
- class << top; protected :inherited; end
- lambda { Class.new(top) }.should_not raise_error
- end
-
-end
-
diff --git a/spec/ruby/core/class/initialize_spec.rb b/spec/ruby/core/class/initialize_spec.rb
deleted file mode 100644
index d268596dfe..0000000000
--- a/spec/ruby/core/class/initialize_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "Class#initialize" do
- it "is private" do
- Class.should have_private_method(:initialize)
- end
-
- it "raises a TypeError when called on already initialized classes" do
- lambda{
- Fixnum.send :initialize
- }.should raise_error(TypeError)
-
- lambda{
- Object.send :initialize
- }.should raise_error(TypeError)
- end
-
- # See [redmine:2601]
- it "raises a TypeError when called on BasicObject" do
- lambda{
- BasicObject.send :initialize
- }.should raise_error(TypeError)
- end
-
- describe "when given the Class" do
- before :each do
- @uninitialized = Class.allocate
- end
-
- it "raises a TypeError" do
- lambda{@uninitialized.send(:initialize, Class)}.should raise_error(TypeError)
- end
- end
-end
diff --git a/spec/ruby/core/class/new_spec.rb b/spec/ruby/core/class/new_spec.rb
deleted file mode 100644
index 86323b1575..0000000000
--- a/spec/ruby/core/class/new_spec.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Class.new with a block given" do
- it "yields the new class as self in the block" do
- self_in_block = nil
- klass = Class.new do
- self_in_block = self
- end
- self_in_block.should equal klass
- end
-
- it "uses the given block as the class' body" do
- klass = Class.new do
- def self.message
- "text"
- end
-
- def hello
- "hello again"
- end
- end
-
- klass.message.should == "text"
- klass.new.hello.should == "hello again"
- end
-
- it "creates a subclass of the given superclass" do
- sc = Class.new do
- def self.body
- @body
- end
- @body = self
- def message; "text"; end
- end
- klass = Class.new(sc) do
- def self.body
- @body
- end
- @body = self
- def message2; "hello"; end
- end
-
- klass.body.should == klass
- sc.body.should == sc
- klass.superclass.should == sc
- klass.new.message.should == "text"
- klass.new.message2.should == "hello"
- end
-
- it "runs the inherited hook after yielding the block" do
- ScratchPad.record []
- klass = Class.new(CoreClassSpecs::Inherited::D) do
- ScratchPad << self
- end
-
- ScratchPad.recorded.should == [CoreClassSpecs::Inherited::D, klass]
- end
-end
-
-describe "Class.new" do
- it "creates a new anonymous class" do
- klass = Class.new
- klass.is_a?(Class).should == true
-
- klass_instance = klass.new
- klass_instance.is_a?(klass).should == true
- end
-
- it "raises a TypeError if passed a metaclass" do
- obj = mock("Class.new metaclass")
- meta = obj.singleton_class
- lambda { Class.new meta }.should raise_error(TypeError)
- end
-
- it "creates a class without a name" do
- Class.new.name.should be_nil
- end
-
- it "creates a class that can be given a name by assigning it to a constant" do
- ::MyClass = Class.new
- ::MyClass.name.should == "MyClass"
- a = Class.new
- MyClass::NestedClass = a
- MyClass::NestedClass.name.should == "MyClass::NestedClass"
- end
-
- it "sets the new class' superclass to the given class" do
- top = Class.new
- Class.new(top).superclass.should == top
- end
-
- it "sets the new class' superclass to Object when no class given" do
- Class.new.superclass.should == Object
- end
-
- it "raises a TypeError when given a non-Class" do
- error_msg = /superclass must be a Class/
- lambda { Class.new("") }.should raise_error(TypeError, error_msg)
- lambda { Class.new(1) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(:symbol) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(mock('o')) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(Module.new) }.should raise_error(TypeError, error_msg)
- end
-end
-
-describe "Class#new" do
- it "returns a new instance of self" do
- klass = Class.new
- klass.new.is_a?(klass).should == true
- end
-
- it "invokes #initialize on the new instance with the given args" do
- klass = Class.new do
- def initialize(*args)
- @initialized = true
- @args = args
- end
-
- def args
- @args
- end
-
- def initialized?
- @initialized || false
- end
- end
-
- klass.new.initialized?.should == true
- klass.new(1, 2, 3).args.should == [1, 2, 3]
- end
-
- it "uses the internal allocator and does not call #allocate" do
- klass = Class.new do
- def self.allocate
- raise "allocate should not be called"
- end
- end
-
- instance = klass.new
- instance.should be_kind_of klass
- instance.class.should equal klass
- end
-
- it "passes the block to #initialize" do
- klass = Class.new do
- def initialize
- yield
- end
- end
-
- klass.new { break 42 }.should == 42
- end
-end
diff --git a/spec/ruby/core/class/superclass_spec.rb b/spec/ruby/core/class/superclass_spec.rb
deleted file mode 100644
index 18b7ce5bde..0000000000
--- a/spec/ruby/core/class/superclass_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Class#superclass" do
- it "returns the superclass of self" do
- BasicObject.superclass.should be_nil
- Object.superclass.should == BasicObject
- Class.superclass.should == Module
- Class.new.superclass.should == Object
- Class.new(String).superclass.should == String
- Class.new(Fixnum).superclass.should == Fixnum
- end
-
- # redmine:567
- describe "for a singleton class" do
- it "of an object returns the class of the object" do
- a = CoreClassSpecs::A.new
- sc = class << a; self; end
- sc.superclass.should == CoreClassSpecs::A
- end
-
- it "of a class returns the singleton class of its superclass" do # sorry, can't find a simpler way to express this...
- sc = class << CoreClassSpecs::H; self; end
- sc.superclass.should == class << CoreClassSpecs::A; self; end
- end
- end
-end
diff --git a/spec/ruby/core/class/to_s_spec.rb b/spec/ruby/core/class/to_s_spec.rb
deleted file mode 100644
index 693517f0da..0000000000
--- a/spec/ruby/core/class/to_s_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Class#to_s" do
- it 'regular class returns same name as Module#to_s' do
- String.to_s.should == 'String'
- end
-
- describe 'singleton class' do
- it 'for modules includes module name' do
- CoreClassSpecs.singleton_class.to_s.should == '#<Class:CoreClassSpecs>'
- end
-
- it 'for classes includes class name' do
- CoreClassSpecs::Record.singleton_class.to_s.should == '#<Class:CoreClassSpecs::Record>'
- end
-
- it 'for objects includes class name and object ID' do
- obj = CoreClassSpecs::Record.new
- obj.singleton_class.to_s.should =~ /#<Class:#<CoreClassSpecs::Record:0x[0-9a-f]+>>/
- end
- end
-end
diff --git a/spec/ruby/core/comparable/between_spec.rb b/spec/ruby/core/comparable/between_spec.rb
deleted file mode 100644
index ebeadb7569..0000000000
--- a/spec/ruby/core/comparable/between_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Comparable#between?" do
- it "returns true if self is greater than or equal to the first and less than or equal to the second argument" do
- a = ComparableSpecs::Weird.new(-1)
- b = ComparableSpecs::Weird.new(0)
- c = ComparableSpecs::Weird.new(1)
- d = ComparableSpecs::Weird.new(2)
-
- a.between?(a, a).should == true
- a.between?(a, b).should == true
- a.between?(a, c).should == true
- a.between?(a, d).should == true
- c.between?(c, d).should == true
- d.between?(d, d).should == true
- c.between?(a, d).should == true
-
- a.between?(b, b).should == false
- a.between?(b, c).should == false
- a.between?(b, d).should == false
- c.between?(a, a).should == false
- c.between?(a, b).should == false
- end
-end
diff --git a/spec/ruby/core/comparable/clamp_spec.rb b/spec/ruby/core/comparable/clamp_spec.rb
deleted file mode 100644
index 75868258b5..0000000000
--- a/spec/ruby/core/comparable/clamp_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-ruby_version_is '2.4' do
- describe 'Comparable#clamp' do
- it 'raises an Argument error unless given 2 parameters' do
- c = ComparableSpecs::Weird.new(0)
- lambda { c.clamp(c) }.should raise_error(ArgumentError)
- lambda { c.clamp(c, c, c) }.should raise_error(ArgumentError)
- end
-
- it 'raises an Argument error unless the 2 parameters are correctly ordered' do
- one = ComparableSpecs::WithOnlyCompareDefined.new(1)
- two = ComparableSpecs::WithOnlyCompareDefined.new(2)
- c = ComparableSpecs::Weird.new(3)
-
- lambda { c.clamp(two, one) }.should raise_error(ArgumentError)
- one.should_receive(:<=>).any_number_of_times.and_return(nil)
- lambda { c.clamp(one, two) }.should raise_error(ArgumentError)
- end
-
- it 'returns self if within the given parameters' do
- one = ComparableSpecs::WithOnlyCompareDefined.new(1)
- two = ComparableSpecs::WithOnlyCompareDefined.new(2)
- three = ComparableSpecs::WithOnlyCompareDefined.new(3)
- c = ComparableSpecs::Weird.new(2)
-
- c.clamp(one, two).should equal(c)
- c.clamp(two, two).should equal(c)
- c.clamp(one, three).should equal(c)
- c.clamp(two, three).should equal(c)
- end
-
- it 'returns the min parameter if smaller than it' do
- one = ComparableSpecs::WithOnlyCompareDefined.new(1)
- two = ComparableSpecs::WithOnlyCompareDefined.new(2)
- c = ComparableSpecs::Weird.new(0)
-
- c.clamp(one, two).should equal(one)
- end
-
- it 'returns the max parameter if greater than it' do
- one = ComparableSpecs::WithOnlyCompareDefined.new(1)
- two = ComparableSpecs::WithOnlyCompareDefined.new(2)
- c = ComparableSpecs::Weird.new(3)
-
- c.clamp(one, two).should equal(two)
- end
- end
-end
diff --git a/spec/ruby/core/comparable/equal_value_spec.rb b/spec/ruby/core/comparable/equal_value_spec.rb
deleted file mode 100644
index 2bc22771b4..0000000000
--- a/spec/ruby/core/comparable/equal_value_spec.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Comparable#==" do
- a = b = nil
- before :each do
- a = ComparableSpecs::Weird.new(0)
- b = ComparableSpecs::Weird.new(10)
- end
-
- it "returns true if other is the same as self" do
- (a == a).should == true
- (b == b).should == true
- end
-
- it "calls #<=> on self with other and returns true if #<=> returns 0" do
- a.should_receive(:<=>).once.and_return(0)
- (a == b).should == true
- end
-
- it "calls #<=> on self with other and returns true if #<=> returns 0.0" do
- a.should_receive(:<=>).once.and_return(0.0)
- (a == b).should == true
- end
-
- it "returns false if calling #<=> on self returns a positive Integer" do
- a.should_receive(:<=>).once.and_return(1)
- (a == b).should == false
- end
-
- it "returns false if calling #<=> on self returns a negative Integer" do
- a.should_receive(:<=>).once.and_return(-1)
- (a == b).should == false
- end
-
- context "when #<=> returns nil" do
- before :each do
- a.should_receive(:<=>).once.and_return(nil)
- end
-
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- context "when #<=> returns nor nil neither an Integer" do
- before :each do
- a.should_receive(:<=>).once.and_return("abc")
- end
-
- ruby_version_is ""..."2.3" do
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "raises an ArgumentError" do
- lambda { (a == b) }.should raise_error(ArgumentError)
- end
- end
- end
-
- context "when #<=> raises an exception" do
- context "if it is a StandardError" do
- before :each do
- a.should_receive(:<=>).once.and_raise(StandardError)
- end
-
- ruby_version_is ""..."2.3" do
- # Behaviour confirmed by MRI test suite
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "lets it go through" do
- lambda { (a == b) }.should raise_error(StandardError)
- end
- end
- end
-
- context "if it is a subclass of StandardError" do
- # TypeError < StandardError
- before :each do
- a.should_receive(:<=>).once.and_raise(TypeError)
- end
-
- ruby_version_is ""..."2.3" do
- it "returns false" do
- (a == b).should be_false
- end
- end
-
- ruby_version_is "2.3" do
- it "lets it go through" do
- lambda { (a == b) }.should raise_error(TypeError)
- end
- end
- end
-
- it "lets it go through if it is not a StandardError" do
- a.should_receive(:<=>).once.and_raise(Exception)
- lambda { (a == b) }.should raise_error(Exception)
- end
- end
-
- context "when #<=> is not defined" do
- before :each do
- @a = ComparableSpecs::WithoutCompareDefined.new
- @b = ComparableSpecs::WithoutCompareDefined.new
- end
-
- it "returns true for identical objects" do
- @a.should == @a
- end
-
- it "returns false and does not recurse infinitely" do
- @a.should_not == @b
- end
- end
-
- context "when #<=> calls super" do
- before :each do
- @a = ComparableSpecs::CompareCallingSuper.new
- @b = ComparableSpecs::CompareCallingSuper.new
- end
-
- it "returns true for identical objects" do
- @a.should == @a
- end
-
- it "calls the defined #<=> only once for different objects" do
- @a.should_not == @b
- @a.calls.should == 1
- end
- end
-end
diff --git a/spec/ruby/core/comparable/fixtures/classes.rb b/spec/ruby/core/comparable/fixtures/classes.rb
deleted file mode 100644
index 4239a47d2f..0000000000
--- a/spec/ruby/core/comparable/fixtures/classes.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module ComparableSpecs
- class WithOnlyCompareDefined
- attr_reader :value
-
- def initialize(value)
- @value = value
- end
-
- def <=>(other)
- self.value <=> other.value
- end
- end
-
- class Weird < WithOnlyCompareDefined
- include Comparable
- end
-
- class WithoutCompareDefined
- include Comparable
- end
-
- class CompareCallingSuper
- include Comparable
-
- attr_reader :calls
-
- def initialize
- @calls = 0
- end
-
- def <=>(other)
- @calls += 1
- super(other)
- end
- end
-end
diff --git a/spec/ruby/core/comparable/gt_spec.rb b/spec/ruby/core/comparable/gt_spec.rb
deleted file mode 100644
index c4739bcf2a..0000000000
--- a/spec/ruby/core/comparable/gt_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "Comparable#>" do
- it "calls #<=> on self with other and returns true if #<=> returns any Integer greater than 0" do
- a = ComparableSpecs::Weird.new(0)
- b = ComparableSpecs::Weird.new(20)
-
- a.should_receive(:<=>).any_number_of_times.and_return(1)
- (a > b).should == true
-
- a.should_receive(:<=>).any_number_of_times.and_return(0.1)
- (a > b).should == true
-
- a.should_receive(:<=>).any_number_of_times.and_return(10000000)
- (a > b).should == true
- end
-
- it "returns false if calling #<=> on self returns 0 or any Integer less than 0" do
- a = ComparableSpecs::Weird.new(0)
- b = ComparableSpecs::Weird.new(10)
-
- a.should_receive(:<=>).any_number_of_times.and_return(0)
- (a > b).should == false
-
- a.should_receive(:<=>).any_number_of_times.and_return(0.0)
- (a > b).should == false
-
- a.should_receive(:<=>).any_number_of_times.and_return(-1.0)
- (a > b).should == false
-
- a.should_receive(:<=>).any_number_of_times.and_return(-10000000)
- (a > b).should == false
- end
-
- it "raises an ArgumentError if calling #<=> on self returns nil" do
- a = ComparableSpecs::Weird.new(0)
- b = ComparableSpecs::Weird.new(20)
-
- a.should_receive(:<=>).any_number_of_times.and_return(nil)
- lambda { (a > b) }.should raise_error(ArgumentError)